From: support Date: Wed, 7 Dec 2022 17:56:54 +0000 (+0000) Subject: Built motion from commit c36064f4.|2.6.25 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;//%22%7B%7Blicense.mail?a=commitdiff_plain;h=d558b7ab48a6974de955c4f4539aa3b8e4d5095c;p=motion2.git Built motion from commit c36064f4.|2.6.25 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 616bec6..88397e2 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-12-07T16:23:41.612Z", + "time": "2022-12-07T17:48:38.520Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 63555e7..14eaf52 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-12-07T16:23:41.612Z", + "time": "2022-12-07T17:48:38.520Z", "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 e8708bb..6181a0d 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 _0xcb5c=['sequelize','VIRTUAL','getDataValue','action','contactManager','motionbar','jscripty','urlForward','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[body]'];(function(_0x25a748,_0x3e95f9){var _0x56062e=function(_0x3122ba){while(--_0x3122ba){_0x25a748['push'](_0x25a748['shift']());}};_0x56062e(++_0x3e95f9);}(_0xcb5c,0x96));var _0xccb5=function(_0x35d9d0,_0x853802){_0x35d9d0=_0x35d9d0-0x0;var _0x38bd09=_0xcb5c[_0x35d9d0];return _0x38bd09;};'use strict';var Sequelize=require(_0xccb5('0x0'));module['exports']={'name':{'type':Sequelize[_0xccb5('0x1')],'get':function(_0x2f0c85){return this[_0xccb5('0x2')](_0xccb5('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xccb5('0x4'),'integration',_0xccb5('0x5'),_0xccb5('0x6'),_0xccb5('0x7'),_0xccb5('0x8'),'bot',_0xccb5('0x9')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xccb5('0xa')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0xccb5('0xb')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0xccb5('0xb')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0xccb5('0xb')](0x1000),'comments':_0xccb5('0xc')},'data5':{'type':Sequelize[_0xccb5('0xb')](0x1000),'comments':_0xccb5('0xd')},'data6':{'type':Sequelize[_0xccb5('0xb')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize['TEXT'],'comments':_0xccb5('0xe')}}; \ No newline at end of file +var _0xb3d2=['sequelize','exports','VIRTUAL','getDataValue','action','contactManager','integration','motionbar','urlForward','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb3d2,0x140));var _0x2b3d=function(_0x3897a4,_0x4394ef){_0x3897a4=_0x3897a4-0x0;var _0x52501f=_0xb3d2[_0x3897a4];return _0x52501f;};'use strict';var Sequelize=require(_0x2b3d('0x0'));module[_0x2b3d('0x1')]={'name':{'type':Sequelize[_0x2b3d('0x2')],'get':function(_0x3865a4){return this[_0x2b3d('0x3')](_0x2b3d('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x2b3d('0x5'),_0x2b3d('0x6'),_0x2b3d('0x7'),'jscripty',_0x2b3d('0x8'),_0x2b3d('0x9'),'bot',_0x2b3d('0xa')]],'msg':_0x2b3d('0xb')}},'comment':_0x2b3d('0xb')},'data1':{'type':Sequelize[_0x2b3d('0xc')](0x1000),'comment':_0x2b3d('0xd')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x2b3d('0xe')},'data3':{'type':Sequelize[_0x2b3d('0xc')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0x2b3d('0xc')](0x1000),'comments':_0x2b3d('0xf')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x2b3d('0x10')},'data6':{'type':Sequelize[_0x2b3d('0xc')],'comments':_0x2b3d('0x11')},'data7':{'type':Sequelize[_0x2b3d('0x12')],'comments':_0x2b3d('0x13')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 40ad8dd..ee3b057 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 _0xcee7=['destroy','Action','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','then','name','send','body','find'];(function(_0x3e3e50,_0x39e28c){var _0x5eb609=function(_0x22d896){while(--_0x22d896){_0x3e3e50['push'](_0x3e3e50['shift']());}};_0x5eb609(++_0x39e28c);}(_0xcee7,0xe0));var _0x7cee=function(_0x22f2de,_0x3a8dae){_0x22f2de=_0x22f2de-0x0;var _0x1aaece=_0xcee7[_0x22f2de];return _0x1aaece;};'use strict';var emlformat=require(_0x7cee('0x0'));var rimraf=require(_0x7cee('0x1'));var zipdir=require(_0x7cee('0x2'));var jsonpatch=require(_0x7cee('0x3'));var rp=require(_0x7cee('0x4'));var moment=require(_0x7cee('0x5'));var BPromise=require(_0x7cee('0x6'));var Mustache=require('mustache');var util=require(_0x7cee('0x7'));var path=require(_0x7cee('0x8'));var sox=require('sox');var csv=require(_0x7cee('0x9'));var ejs=require(_0x7cee('0xa'));var fs=require('fs');var fs_extra=require(_0x7cee('0xb'));var _=require(_0x7cee('0xc'));var squel=require('squel');var crypto=require(_0x7cee('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7cee('0xe'));var toCsv=require(_0x7cee('0x9'));var querystring=require(_0x7cee('0xf'));var Papa=require(_0x7cee('0x10'));var Redis=require(_0x7cee('0x11'));var authService=require(_0x7cee('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7cee('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7cee('0x14'))(_0x7cee('0x15'));var utils=require(_0x7cee('0x16'));var config=require(_0x7cee('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x7cee('0x18'))['db'];function respondWithStatusCode(_0x94b073,_0x44c762){_0x44c762=_0x44c762||0xcc;return function(_0xcf6773){if(_0xcf6773){return _0x94b073[_0x7cee('0x19')](_0x44c762);}return _0x94b073['status'](_0x44c762)[_0x7cee('0x1a')]();};}function respondWithResult(_0x4d4202,_0x454d4e){_0x454d4e=_0x454d4e||0xc8;return function(_0x457026){if(_0x457026){return _0x4d4202[_0x7cee('0x1b')](_0x454d4e)['json'](_0x457026);}};}function respondWithFilteredResult(_0x423ef5,_0x2f9ff8){return function(_0x3751a4){if(_0x3751a4){var _0x439715=typeof _0x2f9ff8[_0x7cee('0x1c')]===_0x7cee('0x1d')&&typeof _0x2f9ff8[_0x7cee('0x1e')]===_0x7cee('0x1d');var _0xda68cf=_0x3751a4[_0x7cee('0x1f')];var _0x4a2ab3=_0x439715?0x0:_0x2f9ff8[_0x7cee('0x1c')];var _0x22fbc4=_0x439715?_0x3751a4[_0x7cee('0x1f')]:_0x2f9ff8[_0x7cee('0x1c')]+_0x2f9ff8['limit'];var _0x5ecaf1;if(_0x22fbc4>=_0xda68cf){_0x22fbc4=_0xda68cf;_0x5ecaf1=0xc8;}else{_0x5ecaf1=0xce;}_0x423ef5[_0x7cee('0x1b')](_0x5ecaf1);return _0x423ef5[_0x7cee('0x20')](_0x7cee('0x21'),_0x4a2ab3+'-'+_0x22fbc4+'/'+_0xda68cf)['json'](_0x3751a4);}return null;};}function patchUpdates(_0x4c68e6){return function(_0x4b2df0){try{jsonpatch[_0x7cee('0x22')](_0x4b2df0,_0x4c68e6,!![]);}catch(_0x48986e){return BPromise['reject'](_0x48986e);}return _0x4b2df0['save']();};}function saveUpdates(_0x75cfe6,_0x56279e){return function(_0x37dbcd){if(_0x37dbcd){return _0x37dbcd['update'](_0x75cfe6)[_0x7cee('0x23')](function(_0xf7d9a5){return _0xf7d9a5;});}return null;};}function removeEntity(_0x17e6c1,_0x1cf3b4){return function(_0x5559d4){if(_0x5559d4){return _0x5559d4['destroy']()[_0x7cee('0x23')](function(){_0x17e6c1[_0x7cee('0x1b')](0xcc)[_0x7cee('0x1a')]();});}};}function handleEntityNotFound(_0x4cf3cd,_0x10371c){return function(_0x14b819){if(!_0x14b819){_0x4cf3cd['sendStatus'](0x194);}return _0x14b819;};}function handleError(_0x59656a,_0x3556ee){_0x3556ee=_0x3556ee||0x1f4;return function(_0x49dbf9){logger['error'](_0x49dbf9['stack']);if(_0x49dbf9[_0x7cee('0x24')]){delete _0x49dbf9[_0x7cee('0x24')];}_0x59656a[_0x7cee('0x1b')](_0x3556ee)[_0x7cee('0x25')](_0x49dbf9);};}exports['update']=function(_0x281638,_0x140459){if(_0x281638[_0x7cee('0x26')]['id']){delete _0x281638[_0x7cee('0x26')]['id'];}return db['Action'][_0x7cee('0x27')]({'where':{'id':_0x281638['params']['id']}})[_0x7cee('0x23')](handleEntityNotFound(_0x140459,null))[_0x7cee('0x23')](saveUpdates(_0x281638[_0x7cee('0x26')],null))['then'](respondWithResult(_0x140459,null))['catch'](handleError(_0x140459,null));};exports[_0x7cee('0x28')]=function(_0x47be14,_0x93b87){return db[_0x7cee('0x29')][_0x7cee('0x27')]({'where':{'id':_0x47be14[_0x7cee('0x2a')]['id']}})['then'](handleEntityNotFound(_0x93b87,null))[_0x7cee('0x23')](removeEntity(_0x93b87,null))[_0x7cee('0x2b')](handleError(_0x93b87,null));}; \ No newline at end of file +var _0x7ef8=['sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','then','end','error','name','send','body','Action','find','params','catch','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x7ef8,0x7c));var _0x87ef=function(_0x3abe6a,_0xdd7b1a){_0x3abe6a=_0x3abe6a-0x0;var _0x2fc39e=_0x7ef8[_0x3abe6a];return _0x2fc39e;};'use strict';var emlformat=require(_0x87ef('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x87ef('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x87ef('0x2'));var moment=require(_0x87ef('0x3'));var BPromise=require(_0x87ef('0x4'));var Mustache=require(_0x87ef('0x5'));var util=require(_0x87ef('0x6'));var path=require(_0x87ef('0x7'));var sox=require(_0x87ef('0x8'));var csv=require(_0x87ef('0x9'));var ejs=require(_0x87ef('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x87ef('0xb'));var squel=require(_0x87ef('0xc'));var crypto=require(_0x87ef('0xd'));var jsforce=require(_0x87ef('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x87ef('0x9'));var querystring=require('querystring');var Papa=require(_0x87ef('0xf'));var Redis=require(_0x87ef('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x87ef('0x11'));var as=require(_0x87ef('0x12'));var hardwareService=require(_0x87ef('0x13'));var logger=require(_0x87ef('0x14'))(_0x87ef('0x15'));var utils=require(_0x87ef('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x87ef('0x17'))['db'];function respondWithStatusCode(_0xcb4a8d,_0x54c1e7){_0x54c1e7=_0x54c1e7||0xcc;return function(_0xf33c9f){if(_0xf33c9f){return _0xcb4a8d[_0x87ef('0x18')](_0x54c1e7);}return _0xcb4a8d[_0x87ef('0x19')](_0x54c1e7)['end']();};}function respondWithResult(_0x1ffc16,_0x556c64){_0x556c64=_0x556c64||0xc8;return function(_0x51fb2a){if(_0x51fb2a){return _0x1ffc16[_0x87ef('0x19')](_0x556c64)[_0x87ef('0x1a')](_0x51fb2a);}};}function respondWithFilteredResult(_0x26043d,_0x19b70e){return function(_0x4e35a9){if(_0x4e35a9){var _0x24d14b=typeof _0x19b70e[_0x87ef('0x1b')]===_0x87ef('0x1c')&&typeof _0x19b70e[_0x87ef('0x1d')]==='undefined';var _0xc6e384=_0x4e35a9[_0x87ef('0x1e')];var _0x740609=_0x24d14b?0x0:_0x19b70e[_0x87ef('0x1b')];var _0x5bd9a5=_0x24d14b?_0x4e35a9[_0x87ef('0x1e')]:_0x19b70e[_0x87ef('0x1b')]+_0x19b70e[_0x87ef('0x1d')];var _0xcc83d2;if(_0x5bd9a5>=_0xc6e384){_0x5bd9a5=_0xc6e384;_0xcc83d2=0xc8;}else{_0xcc83d2=0xce;}_0x26043d[_0x87ef('0x19')](_0xcc83d2);return _0x26043d['set'](_0x87ef('0x1f'),_0x740609+'-'+_0x5bd9a5+'/'+_0xc6e384)['json'](_0x4e35a9);}return null;};}function patchUpdates(_0x5f0da4){return function(_0x364c3e){try{jsonpatch[_0x87ef('0x20')](_0x364c3e,_0x5f0da4,!![]);}catch(_0x5be0f8){return BPromise[_0x87ef('0x21')](_0x5be0f8);}return _0x364c3e['save']();};}function saveUpdates(_0x2db374,_0x46eb7a){return function(_0x120504){if(_0x120504){return _0x120504['update'](_0x2db374)[_0x87ef('0x22')](function(_0x1a97a5){return _0x1a97a5;});}return null;};}function removeEntity(_0xf274a6,_0x106b4c){return function(_0x4214f2){if(_0x4214f2){return _0x4214f2['destroy']()[_0x87ef('0x22')](function(){_0xf274a6[_0x87ef('0x19')](0xcc)[_0x87ef('0x23')]();});}};}function handleEntityNotFound(_0x367342,_0x3ae5a0){return function(_0x1f0f06){if(!_0x1f0f06){_0x367342['sendStatus'](0x194);}return _0x1f0f06;};}function handleError(_0x7a99b4,_0x1ecc1b){_0x1ecc1b=_0x1ecc1b||0x1f4;return function(_0x2c95c3){logger[_0x87ef('0x24')](_0x2c95c3['stack']);if(_0x2c95c3[_0x87ef('0x25')]){delete _0x2c95c3[_0x87ef('0x25')];}_0x7a99b4[_0x87ef('0x19')](_0x1ecc1b)[_0x87ef('0x26')](_0x2c95c3);};}exports['update']=function(_0x2f81de,_0x5e4517){if(_0x2f81de[_0x87ef('0x27')]['id']){delete _0x2f81de[_0x87ef('0x27')]['id'];}return db[_0x87ef('0x28')][_0x87ef('0x29')]({'where':{'id':_0x2f81de[_0x87ef('0x2a')]['id']}})[_0x87ef('0x22')](handleEntityNotFound(_0x5e4517,null))[_0x87ef('0x22')](saveUpdates(_0x2f81de['body'],null))[_0x87ef('0x22')](respondWithResult(_0x5e4517,null))[_0x87ef('0x2b')](handleError(_0x5e4517,null));};exports['destroy']=function(_0x1af05,_0x566a3a){return db[_0x87ef('0x28')]['find']({'where':{'id':_0x1af05[_0x87ef('0x2a')]['id']}})[_0x87ef('0x22')](handleEntityNotFound(_0x566a3a,null))[_0x87ef('0x22')](removeEntity(_0x566a3a,null))[_0x87ef('0x2b')](handleError(_0x566a3a,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index a9f3b8d..092dd13 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 _0x711c=['moment','bluebird','request-promise','path','exports','define','Action','tools_actions','lodash','util','../../config/logger','api'];(function(_0xbf1132,_0x176b34){var _0xe63ce4=function(_0x52d8ed){while(--_0x52d8ed){_0xbf1132['push'](_0xbf1132['shift']());}};_0xe63ce4(++_0x176b34);}(_0x711c,0x74));var _0xc711=function(_0x3c8cef,_0x484465){_0x3c8cef=_0x3c8cef-0x0;var _0x28e391=_0x711c[_0x3c8cef];return _0x28e391;};'use strict';var _=require(_0xc711('0x0'));var util=require(_0xc711('0x1'));var logger=require(_0xc711('0x2'))(_0xc711('0x3'));var moment=require(_0xc711('0x4'));var BPromise=require(_0xc711('0x5'));var rp=require(_0xc711('0x6'));var fs=require('fs');var path=require(_0xc711('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./action.attributes');module[_0xc711('0x8')]=function(_0x49d4c2,_0x4b615b){return _0x49d4c2[_0xc711('0x9')](_0xc711('0xa'),attributes,{'tableName':_0xc711('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb910=['../../config/environment','./action.attributes','exports','Action','tools_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4e1346,_0x230532){var _0x4e74d9=function(_0x2ad6bc){while(--_0x2ad6bc){_0x4e1346['push'](_0x4e1346['shift']());}};_0x4e74d9(++_0x230532);}(_0xb910,0x12b));var _0x0b91=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0xb910[_0x1b7368];return _0x25d54c;};'use strict';var _=require(_0x0b91('0x0'));var util=require(_0x0b91('0x1'));var logger=require(_0x0b91('0x2'))(_0x0b91('0x3'));var moment=require(_0x0b91('0x4'));var BPromise=require(_0x0b91('0x5'));var rp=require(_0x0b91('0x6'));var fs=require('fs');var path=require(_0x0b91('0x7'));var rimraf=require(_0x0b91('0x8'));var config=require(_0x0b91('0x9'));var attributes=require(_0x0b91('0xa'));module[_0x0b91('0xb')]=function(_0x295749,_0x1800dc){return _0x295749['define'](_0x0b91('0xc'),attributes,{'tableName':_0x0b91('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index b2967be..66985fe 100644 --- a/server/api/action/action.rpc.js +++ b/server/api/action/action.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x59cac7,_0x19b79b){var _0xb08b5b=function(_0x5292a1){while(--_0x5292a1){_0x59cac7['push'](_0x59cac7['shift']());}};_0xb08b5b(++_0x19b79b);}(_0xabce,0x103));var _0xeabc=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xabce[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});} \ No newline at end of file +var _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(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x814b,0x1a2));var _0xb814=function(_0x2f023d,_0x29dfe5){_0x2f023d=_0x2f023d-0x0;var _0x4ef240=_0x814b[_0x2f023d];return _0x4ef240;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Action,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index a8e8976..d4abf22 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 _0xbeca=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated','delete','/:id','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x150397,_0x258581){var _0x5cadab=function(_0x3052d6){while(--_0x3052d6){_0x150397['push'](_0x150397['shift']());}};_0x5cadab(++_0x258581);}(_0xbeca,0x15a));var _0xabec=function(_0x578062,_0x2858e9){_0x578062=_0x578062-0x0;var _0x2ba7f5=_0xbeca[_0x578062];return _0x2ba7f5;};'use strict';var multer=require(_0xabec('0x0'));var util=require(_0xabec('0x1'));var path=require(_0xabec('0x2'));var timeout=require(_0xabec('0x3'));var express=require(_0xabec('0x4'));var router=express[_0xabec('0x5')]();var fs_extra=require(_0xabec('0x6'));var auth=require(_0xabec('0x7'));var interaction=require(_0xabec('0x8'));var config=require(_0xabec('0x9'));var controller=require(_0xabec('0xa'));router[_0xabec('0xb')]('/:id',auth[_0xabec('0xc')](),controller['update']);router[_0xabec('0xd')](_0xabec('0xe'),auth[_0xabec('0xc')](),controller['destroy']);module[_0xabec('0xf')]=router; \ No newline at end of file +var _0x445e=['../../components/interaction/service','./action.controller','put','/:id','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x445e,0x158));var _0xe445=function(_0x1a7ce3,_0x3b7b87){_0x1a7ce3=_0x1a7ce3-0x0;var _0x247027=_0x445e[_0x1a7ce3];return _0x247027;};'use strict';var multer=require(_0xe445('0x0'));var util=require(_0xe445('0x1'));var path=require(_0xe445('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe445('0x3')]();var fs_extra=require(_0xe445('0x4'));var auth=require(_0xe445('0x5'));var interaction=require(_0xe445('0x6'));var config=require('../../config/environment');var controller=require(_0xe445('0x7'));router[_0xe445('0x8')](_0xe445('0x9'),auth['isAuthenticated'](),controller[_0xe445('0xa')]);router[_0xe445('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xe445('0xc')]);module[_0xe445('0xd')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 308b52a..36ec979 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 _0xeec6=['STRING','TEXT','sequelize','exports'];(function(_0x31db86,_0x2711db){var _0x244998=function(_0xaf3dde){while(--_0xaf3dde){_0x31db86['push'](_0x31db86['shift']());}};_0x244998(++_0x2711db);}(_0xeec6,0x1c2));var _0x6eec=function(_0x2389bc,_0x167cd2){_0x2389bc=_0x2389bc-0x0;var _0x170548=_0xeec6[_0x2389bc];return _0x170548;};'use strict';var Sequelize=require(_0x6eec('0x0'));module[_0x6eec('0x1')]={'name':{'type':Sequelize[_0x6eec('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6eec('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x6eec('0x2')]},'conditions':{'type':Sequelize[_0x6eec('0x3')]},'joins':{'type':Sequelize[_0x6eec('0x3')]}}; \ No newline at end of file +var _0x46ed=['sequelize','exports','STRING','TEXT'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0x46ed,0x168));var _0xd46e=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x46ed[_0x51020b];return _0x371e47;};'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 diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 5f73666..7c9a8b5 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 _0x0cb9=['%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(DISTINCT\x20%s)','HOUR(%s)','IS\x20EMPTY','DESC','alias','parse','output','web','fullPath','%s-%s.%s','randomstring','generate','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','fork','../../files/reports','COUNT(*)','run','runReport','left_join','right_join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','operator','value','metric','rimraf','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','dbH','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','destroy','then','get','CustomReports','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','key','model','map','keys','filters','intersection','query','attributes','fields','length','order','sort','pick','filter','where','merge','type','VIRTUAL','AnalyticCustomReport','findAll','rows','catch','params','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','join','cross_join','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','function','replace','format','groupBy','orderBy','joins','parentKey','foreignTable'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x0cb9,0xc8));var _0x90cb=function(_0x48c98c,_0x3b6f60){_0x48c98c=_0x48c98c-0x0;var _0x4eb693=_0x0cb9[_0x48c98c];return _0x4eb693;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x90cb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x90cb('0x1'));var rp=require(_0x90cb('0x2'));var moment=require(_0x90cb('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x90cb('0x4'));var path=require('path');var sox=require(_0x90cb('0x5'));var csv=require(_0x90cb('0x6'));var ejs=require(_0x90cb('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x90cb('0x8'));var squel=require('squel');var crypto=require(_0x90cb('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x90cb('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x90cb('0xb'));var Redis=require(_0x90cb('0xc'));var authService=require(_0x90cb('0xd'));var qs=require(_0x90cb('0xe'));var as=require(_0x90cb('0xf'));var hardwareService=require(_0x90cb('0x10'));var logger=require(_0x90cb('0x11'))(_0x90cb('0x12'));var utils=require(_0x90cb('0x13'));var config=require(_0x90cb('0x14'));var licenseUtil=require(_0x90cb('0x15'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x90cb('0x16')];function respondWithStatusCode(_0x96dedc,_0x7bb427){_0x7bb427=_0x7bb427||0xcc;return function(_0x532dcf){if(_0x532dcf){return _0x96dedc[_0x90cb('0x17')](_0x7bb427);}return _0x96dedc['status'](_0x7bb427)[_0x90cb('0x18')]();};}function respondWithResult(_0x492a75,_0x242451){_0x242451=_0x242451||0xc8;return function(_0x47061a){if(_0x47061a){return _0x492a75[_0x90cb('0x19')](_0x242451)[_0x90cb('0x1a')](_0x47061a);}};}function respondWithFilteredResult(_0x110aa8,_0x24be77){return function(_0x3eeb50){if(_0x3eeb50){var _0x4fd1c8=typeof _0x24be77[_0x90cb('0x1b')]==='undefined'&&typeof _0x24be77[_0x90cb('0x1c')]===_0x90cb('0x1d');var _0x3a07a6=_0x3eeb50[_0x90cb('0x1e')];var _0x596418=_0x4fd1c8?0x0:_0x24be77['offset'];var _0x43631a=_0x4fd1c8?_0x3eeb50[_0x90cb('0x1e')]:_0x24be77[_0x90cb('0x1b')]+_0x24be77[_0x90cb('0x1c')];var _0x24dbe7;if(_0x43631a>=_0x3a07a6){_0x43631a=_0x3a07a6;_0x24dbe7=0xc8;}else{_0x24dbe7=0xce;}_0x110aa8[_0x90cb('0x19')](_0x24dbe7);return _0x110aa8[_0x90cb('0x1f')](_0x90cb('0x20'),_0x596418+'-'+_0x43631a+'/'+_0x3a07a6)[_0x90cb('0x1a')](_0x3eeb50);}return null;};}function patchUpdates(_0x5ad1d5){return function(_0x57c4ab){try{jsonpatch['apply'](_0x57c4ab,_0x5ad1d5,!![]);}catch(_0x4d2d39){return BPromise[_0x90cb('0x21')](_0x4d2d39);}return _0x57c4ab['save']();};}function saveUpdates(_0x2488f0,_0x53e47a){return function(_0x2e3d0c){if(_0x2e3d0c){return _0x2e3d0c[_0x90cb('0x22')](_0x2488f0)['then'](function(_0x447325){return _0x447325;});}return null;};}function removeEntity(_0x53d6c4,_0x576352){return function(_0xf09c8f){if(_0xf09c8f){return _0xf09c8f[_0x90cb('0x23')]()[_0x90cb('0x24')](function(){var _0x23a08e=_0xf09c8f[_0x90cb('0x25')]({'plain':!![]});var _0x4323b6=_0x90cb('0x26');return db[_0x90cb('0x27')]['destroy']({'where':{'type':_0x4323b6,'resourceId':_0x23a08e['id']}})[_0x90cb('0x24')](function(){return _0xf09c8f;});})[_0x90cb('0x24')](function(){_0x53d6c4[_0x90cb('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53d17c,_0x5f9078){return function(_0x56cc64){if(!_0x56cc64){_0x53d17c['sendStatus'](0x194);}return _0x56cc64;};}function handleError(_0x38fbb2,_0x4b45fb){_0x4b45fb=_0x4b45fb||0x1f4;return function(_0x53ac74){logger[_0x90cb('0x28')](_0x53ac74[_0x90cb('0x29')]);if(_0x53ac74[_0x90cb('0x2a')]){delete _0x53ac74[_0x90cb('0x2a')];}_0x38fbb2[_0x90cb('0x19')](_0x4b45fb)[_0x90cb('0x2b')](_0x53ac74);};}exports[_0x90cb('0x2c')]=function(_0x201b7d,_0x394828){var _0x4be0d2={},_0x5a7847={},_0x38cfaa={'count':0x0,'rows':[]};var _0x4dd193=_['map'](db['AnalyticCustomReport'][_0x90cb('0x2d')],function(_0x4646c5){return{'name':_0x4646c5[_0x90cb('0x2e')],'type':_0x4646c5['type'][_0x90cb('0x2f')]};});_0x5a7847[_0x90cb('0x30')]=_[_0x90cb('0x31')](_0x4dd193,'name');_0x5a7847['query']=_[_0x90cb('0x32')](_0x201b7d['query']);_0x5a7847[_0x90cb('0x33')]=_[_0x90cb('0x34')](_0x5a7847[_0x90cb('0x30')],_0x5a7847[_0x90cb('0x35')]);_0x4be0d2[_0x90cb('0x36')]=_['intersection'](_0x5a7847['model'],qs[_0x90cb('0x37')](_0x201b7d[_0x90cb('0x35')][_0x90cb('0x37')]));_0x4be0d2['attributes']=_0x4be0d2[_0x90cb('0x36')][_0x90cb('0x38')]?_0x4be0d2['attributes']:_0x5a7847[_0x90cb('0x30')];if(!_0x201b7d[_0x90cb('0x35')]['hasOwnProperty']('nolimit')){_0x4be0d2[_0x90cb('0x1c')]=qs[_0x90cb('0x1c')](_0x201b7d['query'][_0x90cb('0x1c')]);_0x4be0d2['offset']=qs[_0x90cb('0x1b')](_0x201b7d[_0x90cb('0x35')][_0x90cb('0x1b')]);}_0x4be0d2[_0x90cb('0x39')]=qs[_0x90cb('0x3a')](_0x201b7d[_0x90cb('0x35')][_0x90cb('0x3a')]);_0x4be0d2['where']=qs[_0x90cb('0x33')](_[_0x90cb('0x3b')](_0x201b7d['query'],_0x5a7847['filters']),_0x4dd193);if(_0x201b7d['query'][_0x90cb('0x3c')]){_0x4be0d2[_0x90cb('0x3d')]=_[_0x90cb('0x3e')](_0x4be0d2[_0x90cb('0x3d')],{'$or':_[_0x90cb('0x31')](_0x4dd193,function(_0xee32c3){if(_0xee32c3[_0x90cb('0x3f')]!==_0x90cb('0x40')){var _0x26e614={};_0x26e614[_0xee32c3['name']]={'$like':'%'+_0x201b7d['query']['filter']+'%'};return _0x26e614;}})});}_0x4be0d2=_['merge']({},_0x4be0d2,_0x201b7d['options']);var _0x911e8b={'where':_0x4be0d2[_0x90cb('0x3d')]};return db[_0x90cb('0x41')][_0x90cb('0x1e')](_0x911e8b)[_0x90cb('0x24')](function(_0x51a779){_0x38cfaa[_0x90cb('0x1e')]=_0x51a779;if(_0x201b7d[_0x90cb('0x35')]['includeAll']){_0x4be0d2['include']=[{'all':!![]}];}return db[_0x90cb('0x41')][_0x90cb('0x42')](_0x4be0d2);})[_0x90cb('0x24')](function(_0x1af8c6){_0x38cfaa[_0x90cb('0x43')]=_0x1af8c6;return _0x38cfaa;})[_0x90cb('0x24')](respondWithFilteredResult(_0x394828,_0x4be0d2))[_0x90cb('0x44')](handleError(_0x394828,null));};exports['show']=function(_0x4d4f62,_0x51ebd5){var _0x505b49={'raw':![],'where':{'id':_0x4d4f62[_0x90cb('0x45')]['id']}},_0x538ff1={};_0x538ff1['model']=_[_0x90cb('0x32')](db[_0x90cb('0x41')][_0x90cb('0x2d')]);_0x538ff1[_0x90cb('0x35')]=_[_0x90cb('0x32')](_0x4d4f62[_0x90cb('0x35')]);_0x538ff1['filters']=_[_0x90cb('0x34')](_0x538ff1[_0x90cb('0x30')],_0x538ff1[_0x90cb('0x35')]);_0x505b49['attributes']=_[_0x90cb('0x34')](_0x538ff1[_0x90cb('0x30')],qs[_0x90cb('0x37')](_0x4d4f62[_0x90cb('0x35')]['fields']));_0x505b49[_0x90cb('0x36')]=_0x505b49['attributes']['length']?_0x505b49[_0x90cb('0x36')]:_0x538ff1[_0x90cb('0x30')];if(_0x4d4f62[_0x90cb('0x35')]['includeAll']){_0x505b49['include']=[{'all':!![]}];}_0x505b49=_['merge']({},_0x505b49,_0x4d4f62[_0x90cb('0x46')]);return db[_0x90cb('0x41')]['find'](_0x505b49)[_0x90cb('0x24')](handleEntityNotFound(_0x51ebd5,null))[_0x90cb('0x24')](respondWithResult(_0x51ebd5,null))[_0x90cb('0x44')](handleError(_0x51ebd5,null));};exports[_0x90cb('0x47')]=function(_0x4d72b3,_0x4b18c8){return db[_0x90cb('0x41')][_0x90cb('0x47')](_0x4d72b3[_0x90cb('0x48')],{})[_0x90cb('0x24')](function(_0x58a1b5){var _0x3ba060=_0x4d72b3[_0x90cb('0x49')][_0x90cb('0x25')]({'plain':!![]});if(!_0x3ba060)throw new Error(_0x90cb('0x4a'));if(_0x3ba060[_0x90cb('0x4b')]===_0x90cb('0x49')){var _0x410115=_0x58a1b5[_0x90cb('0x25')]({'plain':!![]});var _0x39080f='Reports';return db['UserProfileSection']['find']({'where':{'name':_0x39080f,'userProfileId':_0x3ba060[_0x90cb('0x4c')]},'raw':!![]})['then'](function(_0x39b7df){if(_0x39b7df&&_0x39b7df['autoAssociation']===0x0){return db['UserProfileResource'][_0x90cb('0x47')]({'name':_0x410115[_0x90cb('0x2a')],'resourceId':_0x410115['id'],'type':_0x90cb('0x26'),'sectionId':_0x39b7df['id']},{})[_0x90cb('0x24')](function(){return _0x58a1b5;});}else{return _0x58a1b5;}})[_0x90cb('0x44')](function(_0x36506d){logger[_0x90cb('0x28')](_0x90cb('0x4d'),_0x36506d);throw _0x36506d;});}return _0x58a1b5;})[_0x90cb('0x24')](respondWithResult(_0x4b18c8,0xc9))['catch'](handleError(_0x4b18c8,null));};exports[_0x90cb('0x22')]=function(_0x4fa471,_0xceec63){if(_0x4fa471[_0x90cb('0x48')]['id']){delete _0x4fa471[_0x90cb('0x48')]['id'];}return db[_0x90cb('0x41')][_0x90cb('0x4e')]({'where':{'id':_0x4fa471[_0x90cb('0x45')]['id']}})['then'](handleEntityNotFound(_0xceec63,null))[_0x90cb('0x24')](saveUpdates(_0x4fa471[_0x90cb('0x48')],null))[_0x90cb('0x24')](respondWithResult(_0xceec63,null))[_0x90cb('0x44')](handleError(_0xceec63,null));};exports[_0x90cb('0x23')]=function(_0x160476,_0x2d9932){return db[_0x90cb('0x41')][_0x90cb('0x4e')]({'where':{'id':_0x160476[_0x90cb('0x45')]['id']}})['then'](handleEntityNotFound(_0x2d9932,null))[_0x90cb('0x24')](removeEntity(_0x2d9932,null))[_0x90cb('0x44')](handleError(_0x2d9932,null));};exports['preview']=function(_0x1461de,_0x24a772){var _0x23de0d=0xa;var _0x180050=[_0x90cb('0x4f'),'left_join','right_join',_0x90cb('0x50')];var _0x30f6fd={'SUM':'SUM(%s)','COUNT':_0x90cb('0x51'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x90cb('0x52'),'MIN':_0x90cb('0x53'),'AVG':_0x90cb('0x54'),'GROUP_CONCAT':_0x90cb('0x55'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x90cb('0x56')};var _0x12b532={'SEC_TO_TIME':_0x90cb('0x57'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x90cb('0x58'),'UNIX_TIMESTAMP':_0x90cb('0x59')};var _0x8aaa3b=function(_0x41de0){return!_[_0x90cb('0x5a')]([_0x90cb('0x5b'),_0x90cb('0x5c'),'IS\x20EMPTY',_0x90cb('0x5d')],_0x41de0);};var _0x1bd61d=function(_0x390d13){if(!_0x390d13||!_0x390d13[_0x90cb('0x5e')]['length']){return'';}for(var _0x232f7e='(',_0x5df621=0x0;_0x5df621<_0x390d13['rules'][_0x90cb('0x38')];_0x5df621+=0x1){_0x5df621>0x0&&(_0x232f7e+='\x20'+_0x390d13['operator']+'\x20');_0x232f7e+=_0x390d13[_0x90cb('0x5e')][_0x5df621][_0x90cb('0x5f')]?_0x1bd61d(_0x390d13['rules'][_0x5df621][_0x90cb('0x5f')]):_0x390d13['rules'][_0x5df621][_0x90cb('0x60')]+'\x20'+_0x390d13['rules'][_0x5df621][_0x90cb('0x61')]+(_0x8aaa3b(_0x390d13[_0x90cb('0x5e')][_0x5df621]['condition'])?'\x20'+_0x390d13['rules'][_0x5df621]['value']:'');}return _0x232f7e+')';};var _0x3f6ed6={'where':{'id':_0x1461de[_0x90cb('0x45')]['id']}},_0x5836a0,_0x5ad396,_0x5720be,_0x33763a,_0x2c7c38;_0x3f6ed6=_[_0x90cb('0x3e')]({},_0x3f6ed6,_0x1461de[_0x90cb('0x46')]);return db[_0x90cb('0x41')][_0x90cb('0x4e')](_0x3f6ed6)[_0x90cb('0x24')](function(_0xb753cc){if(_0xb753cc){_0x5836a0=_0xb753cc;return _0xb753cc[_0x90cb('0x62')]();}return null;})[_0x90cb('0x24')](function(_0xb91bc){if(_0xb91bc){if(!_0xb91bc['length']){throw new db[(_0x90cb('0x63'))][(_0x90cb('0x64'))](_0x90cb('0x65'),0x193);}_0x5ad396=_0xb91bc;return db[_0x90cb('0x66')]['findAll']({'raw':!![]});}return null;})[_0x90cb('0x24')](function(_0x4687da){if(_0x4687da){_0x5720be=_[_0x90cb('0x67')](_0x4687da,'id');var _0x64c0f6;var _0x473dc8=squel[_0x90cb('0x68')]();_0x473dc8[_0x90cb('0x69')](_0x5836a0[_0x90cb('0x6a')]);for(var _0x47f4a1=0x0;_0x47f4a1<_0x5ad396['length'];_0x47f4a1+=0x1){_0x64c0f6=_0x5ad396[_0x47f4a1][_0x90cb('0x6b')]?_0x5720be[_0x5ad396[_0x47f4a1][_0x90cb('0x6b')]]['metric']:_0x5ad396[_0x47f4a1][_0x90cb('0x60')];_0x64c0f6=_0x5ad396[_0x47f4a1][_0x90cb('0x6c')]?_[_0x90cb('0x6d')](_0x30f6fd[_0x5ad396[_0x47f4a1][_0x90cb('0x6c')]],'%s',_0x64c0f6):_0x64c0f6;_0x64c0f6=_0x5ad396[_0x47f4a1][_0x90cb('0x6e')]?_[_0x90cb('0x6d')](_0x12b532[_0x5ad396[_0x47f4a1][_0x90cb('0x6e')]],'%s',_0x64c0f6):_0x64c0f6;if(_0x5ad396[_0x47f4a1][_0x90cb('0x6f')]){_0x473dc8['group'](_0x64c0f6);}_0x5ad396[_0x47f4a1]['orderBy']&&_0x473dc8[_0x90cb('0x39')](_0x64c0f6,_0x5ad396[_0x47f4a1][_0x90cb('0x70')]==='DESC'?![]:!![]);_0x473dc8[_0x90cb('0x60')](_0x64c0f6,_0x5ad396[_0x47f4a1]['alias']||_0x64c0f6);}if(_0x5836a0[_0x90cb('0x71')]){_0x5836a0[_0x90cb('0x71')]=JSON['parse'](_0x5836a0[_0x90cb('0x71')]);for(var _0x151585=0x0;_0x151585<_0x5836a0[_0x90cb('0x71')][_0x90cb('0x38')];_0x151585+=0x1){if(_0x5836a0[_0x90cb('0x71')][_0x151585][_0x90cb('0x3f')]&&_['includes'](_0x180050,_0x5836a0[_0x90cb('0x71')][_0x151585][_0x90cb('0x3f')])&&_0x5836a0['joins'][_0x151585][_0x90cb('0x72')]&&_0x5836a0[_0x90cb('0x71')][_0x151585][_0x90cb('0x73')]&&_0x5836a0[_0x90cb('0x71')][_0x151585]['foreignKey']){_0x473dc8[_0x5836a0[_0x90cb('0x71')][_0x151585][_0x90cb('0x3f')]](_0x5836a0['joins'][_0x151585][_0x90cb('0x73')],null,util[_0x90cb('0x6e')](_0x90cb('0x74'),_0x5836a0[_0x90cb('0x6a')],_0x5836a0[_0x90cb('0x71')][_0x151585][_0x90cb('0x72')],_0x5836a0['joins'][_0x151585][_0x90cb('0x73')],_0x5836a0[_0x90cb('0x71')][_0x151585][_0x90cb('0x75')]));}}}if(_0x5836a0['conditions']){_0x5836a0[_0x90cb('0x76')]=JSON['parse'](_0x5836a0[_0x90cb('0x76')]);_0x473dc8[_0x90cb('0x3d')](_0x1bd61d(_0x5836a0['conditions'][_0x90cb('0x5f')]));}_0x2c7c38=_0x473dc8[_0x90cb('0x77')]();_0x473dc8['limit'](_0x23de0d);_0x473dc8['offset'](0x0);logger[_0x90cb('0x78')](_0x90cb('0x79'),_0x473dc8[_0x90cb('0x7a')]());return dbH[_0x90cb('0x7b')][_0x90cb('0x35')](_0x473dc8[_0x90cb('0x7a')](),{'type':dbH[_0x90cb('0x7b')][_0x90cb('0x7c')][_0x90cb('0x7d')]});}})[_0x90cb('0x24')](respondWithResult(_0x24a772,null))[_0x90cb('0x44')](handleError(_0x24a772,null));};function runReport(_0x19b1cc,_0x33d552,_0x58e7c6){var _0x59d185=_0x33d552[_0x90cb('0x2a')];var _0x42c813=0xa;var _0x2c49de=[_0x90cb('0x4f'),'left_join','right_join',_0x90cb('0x50')];var _0x45d63e={'SUM':'SUM(%s)','COUNT':_0x90cb('0x51'),'COUNT DISTINCT':_0x90cb('0x7e'),'MAX':_0x90cb('0x52'),'MIN':_0x90cb('0x53'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x90cb('0x55'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x55c2af={'SEC_TO_TIME':_0x90cb('0x57'),'DATE':'DATE(%s)','HOUR':_0x90cb('0x7f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x339760=function(_0x1c7602){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0x90cb('0x80'),_0x90cb('0x5d')],_0x1c7602);};var _0x2190cd=function(_0x31e1e5){if(!_0x31e1e5||!_0x31e1e5[_0x90cb('0x5e')][_0x90cb('0x38')]){return'';}for(var _0x2060ac='(',_0x5510da=0x0;_0x5510da<_0x31e1e5[_0x90cb('0x5e')][_0x90cb('0x38')];_0x5510da+=0x1){_0x5510da>0x0&&(_0x2060ac+='\x20'+_0x31e1e5['operator']+'\x20');_0x2060ac+=_0x31e1e5[_0x90cb('0x5e')][_0x5510da][_0x90cb('0x5f')]?_0x2190cd(_0x31e1e5[_0x90cb('0x5e')][_0x5510da][_0x90cb('0x5f')]):_0x31e1e5[_0x90cb('0x5e')][_0x5510da][_0x90cb('0x60')]+'\x20'+_0x31e1e5[_0x90cb('0x5e')][_0x5510da][_0x90cb('0x61')]+(_0x339760(_0x31e1e5[_0x90cb('0x5e')][_0x5510da][_0x90cb('0x61')])?'\x20'+_0x31e1e5[_0x90cb('0x5e')][_0x5510da]['value']:'');}return _0x2060ac+')';};var _0x41128c={'where':{'id':_0x19b1cc['id']}},_0xe55346,_0x55939a,_0xd4ccfb,_0xd71419,_0x105cbb;_0x41128c=_[_0x90cb('0x3e')]({},_0x41128c,_0x58e7c6);return db[_0x90cb('0x41')][_0x90cb('0x4e')](_0x41128c)['then'](function(_0x5e971a){if(_0x5e971a){_0xe55346=_0x5e971a;return _0x5e971a[_0x90cb('0x62')]();}return null;})[_0x90cb('0x24')](function(_0x21cca2){if(_0x21cca2){if(!_0x21cca2[_0x90cb('0x38')]){throw new db[(_0x90cb('0x63'))][(_0x90cb('0x64'))](_0x90cb('0x65'),0x193);}_0x55939a=_0x21cca2;return db[_0x90cb('0x66')][_0x90cb('0x42')]({'raw':!![]});}return null;})[_0x90cb('0x24')](function(_0x536e30){if(_0x536e30){_0xd4ccfb=_[_0x90cb('0x67')](_0x536e30,'id');var _0x165ec3;var _0x598228=squel[_0x90cb('0x68')]();_0x598228[_0x90cb('0x69')](_0xe55346[_0x90cb('0x6a')]);for(var _0x20d7e6=0x0;_0x20d7e6<_0x55939a[_0x90cb('0x38')];_0x20d7e6+=0x1){_0x165ec3=_0x55939a[_0x20d7e6]['MetricId']?_0xd4ccfb[_0x55939a[_0x20d7e6][_0x90cb('0x6b')]]['metric']:_0x55939a[_0x20d7e6][_0x90cb('0x60')];_0x165ec3=_0x55939a[_0x20d7e6][_0x90cb('0x6c')]?_[_0x90cb('0x6d')](_0x45d63e[_0x55939a[_0x20d7e6][_0x90cb('0x6c')]],'%s',_0x165ec3):_0x165ec3;_0x165ec3=_0x55939a[_0x20d7e6][_0x90cb('0x6e')]?_[_0x90cb('0x6d')](_0x55c2af[_0x55939a[_0x20d7e6][_0x90cb('0x6e')]],'%s',_0x165ec3):_0x165ec3;if(_0x55939a[_0x20d7e6][_0x90cb('0x6f')]){_0x598228['group'](_0x165ec3);}_0x55939a[_0x20d7e6][_0x90cb('0x70')]&&_0x598228[_0x90cb('0x39')](_0x165ec3,_0x55939a[_0x20d7e6][_0x90cb('0x70')]===_0x90cb('0x81')?![]:!![]);_0x598228[_0x90cb('0x60')](_0x165ec3,_0x55939a[_0x20d7e6][_0x90cb('0x82')]||_0x165ec3);}if(_0xe55346[_0x90cb('0x71')]){_0xe55346[_0x90cb('0x71')]=JSON[_0x90cb('0x83')](_0xe55346['joins']);for(var _0x234728=0x0;_0x234728<_0xe55346['joins'][_0x90cb('0x38')];_0x234728+=0x1){if(_0xe55346['joins'][_0x234728][_0x90cb('0x3f')]&&_['includes'](_0x2c49de,_0xe55346['joins'][_0x234728][_0x90cb('0x3f')])&&_0xe55346[_0x90cb('0x71')][_0x234728][_0x90cb('0x72')]&&_0xe55346['joins'][_0x234728][_0x90cb('0x73')]&&_0xe55346[_0x90cb('0x71')][_0x234728]['foreignKey']){_0x598228[_0xe55346[_0x90cb('0x71')][_0x234728][_0x90cb('0x3f')]](_0xe55346[_0x90cb('0x71')][_0x234728]['foreignTable'],null,util[_0x90cb('0x6e')]('%s.%s\x20=\x20%s.%s',_0xe55346[_0x90cb('0x6a')],_0xe55346[_0x90cb('0x71')][_0x234728][_0x90cb('0x72')],_0xe55346['joins'][_0x234728][_0x90cb('0x73')],_0xe55346[_0x90cb('0x71')][_0x234728][_0x90cb('0x75')]));}}}if(_0xe55346['conditions']){_0xe55346[_0x90cb('0x76')]=JSON[_0x90cb('0x83')](_0xe55346[_0x90cb('0x76')]);_0x598228['where'](_0x2190cd(_0xe55346[_0x90cb('0x76')][_0x90cb('0x5f')]));}_0x105cbb=_0x598228['clone']();_0x598228['limit'](_0x42c813);_0x598228[_0x90cb('0x1b')](0x0);return;}})[_0x90cb('0x24')](function(){if(_0x33d552[_0x90cb('0x84')]===_0x90cb('0x85')){return null;}var _0xf9fe9f=_['merge'](_0x33d552,{'name':_0x33d552[_0x90cb('0x86')]||_0x33d552[_0x90cb('0x2a')]||_0xe55346['name'],'basename':_0x59d185,'savename':util[_0x90cb('0x6e')](_0x90cb('0x87'),_0x33d552[_0x90cb('0x2a')]||_0xe55346[_0x90cb('0x2a')],require(_0x90cb('0x88'))[_0x90cb('0x89')](0x4),_0x33d552[_0x90cb('0x84')]||'csv'),'reportId':_0xe55346['id'],'reportType':_0x90cb('0x8a')});return db['AnalyticExtractedReport'][_0x90cb('0x47')](_0xf9fe9f,{'raw':!![]});})['then'](function(_0x1c0bcd){if(_0xe55346[_0x90cb('0x6a')]===_0x90cb('0x8b')){_0x105cbb[_0x90cb('0x3d')](_0xe55346['table']+_0x90cb('0x8c'),_0x33d552[_0x90cb('0x8d')],_0x33d552['endDate']);}else{_0x105cbb[_0x90cb('0x3d')](_0xe55346['table']+_0x90cb('0x8e'),_0x33d552[_0x90cb('0x8d')],_0x33d552[_0x90cb('0x8f')]);}if(_0x1c0bcd){logger[_0x90cb('0x90')](_0x90cb('0x91'),_0x105cbb[_0x90cb('0x7a')]());require('child_process')[_0x90cb('0x92')](path['join'](__dirname,'../../components/export/',_0x1c0bcd[_0x90cb('0x84')]),[_0x1c0bcd['id'],_0x105cbb[_0x90cb('0x7a')](),path[_0x90cb('0x4f')](__dirname,_0x90cb('0x93'),_0x1c0bcd['savename']),_0x59d185]);return _0x1c0bcd;}else{var _0x21f091=squel['select']();_0x21f091[_0x90cb('0x69')]('('+_0x105cbb[_0x90cb('0x7a')]()+')','countTable');_0x21f091['field'](_0x90cb('0x94'),_0x90cb('0x1e'));_0x105cbb['limit'](_0x33d552[_0x90cb('0x1c')]||_0x42c813);_0x105cbb[_0x90cb('0x1b')](_0x33d552[_0x90cb('0x1b')]||0x0);return dbH['sequelize'][_0x90cb('0x35')](_0x21f091[_0x90cb('0x7a')](),{'type':dbH[_0x90cb('0x7b')]['QueryTypes'][_0x90cb('0x7d')]})['then'](function(_0x479d63){if(!_0x479d63[_0x90cb('0x38')]){_0xd71419=0x0;}else{_0xd71419=_0x479d63[0x0][_0x90cb('0x1e')]||0x0;}return dbH['sequelize']['query'](_0x105cbb[_0x90cb('0x7a')](),{'type':dbH['sequelize'][_0x90cb('0x7c')][_0x90cb('0x7d')]});})['then'](function(_0x1aad84){return{'rows':_0x1aad84||[],'count':_0xd71419};});}});}exports[_0x90cb('0x95')]=function(_0x3ef4b3,_0x4bf988){return runReport(_0x3ef4b3[_0x90cb('0x45')],_0x3ef4b3['query'],_0x3ef4b3[_0x90cb('0x46')])[_0x90cb('0x24')](respondWithResult(_0x4bf988,null))[_0x90cb('0x44')](handleError(_0x4bf988,null));};exports[_0x90cb('0x96')]=runReport;exports[_0x90cb('0x35')]=function(_0x181332,_0x8fd490){var _0x58e2f6=0xa;var _0x55bf03=[_0x90cb('0x4f'),_0x90cb('0x97'),_0x90cb('0x98'),_0x90cb('0x50')];var _0x45e119={'SUM':'SUM(%s)','COUNT':_0x90cb('0x51'),'COUNT DISTINCT':_0x90cb('0x7e'),'MAX':_0x90cb('0x52'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x90cb('0x55'),'GROUP_CONCAT ASC':_0x90cb('0x99'),'GROUP_CONCAT DESC':_0x90cb('0x56')};var _0x1d85aa={'SEC_TO_TIME':_0x90cb('0x57'),'DATE':_0x90cb('0x9a'),'HOUR':_0x90cb('0x7f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1cd24c=function(_0xef2f2e){return!_[_0x90cb('0x5a')](['IS\x20NULL',_0x90cb('0x5c'),_0x90cb('0x80'),_0x90cb('0x5d')],_0xef2f2e);};var _0x20ed92=function(_0x17161e){if(!_0x17161e||!_0x17161e['rules'][_0x90cb('0x38')]){return'';}for(var _0x15dfc5='(',_0x1592ee=0x0;_0x1592ee<_0x17161e['rules'][_0x90cb('0x38')];_0x1592ee+=0x1){_0x1592ee>0x0&&(_0x15dfc5+='\x20'+_0x17161e[_0x90cb('0x9b')]+'\x20');_0x15dfc5+=_0x17161e[_0x90cb('0x5e')][_0x1592ee]['group']?_0x20ed92(_0x17161e[_0x90cb('0x5e')][_0x1592ee][_0x90cb('0x5f')]):_0x17161e[_0x90cb('0x5e')][_0x1592ee][_0x90cb('0x60')]+'\x20'+_0x17161e[_0x90cb('0x5e')][_0x1592ee]['condition']+(_0x1cd24c(_0x17161e[_0x90cb('0x5e')][_0x1592ee][_0x90cb('0x61')])?'\x20'+_0x17161e[_0x90cb('0x5e')][_0x1592ee][_0x90cb('0x9c')]:'');}return _0x15dfc5+')';};var _0x34cf26={'where':{'id':_0x181332['params']['id']}},_0x56522e,_0x142fa3,_0x1bc5bd,_0x4f6a03,_0x17643c;_0x34cf26=_[_0x90cb('0x3e')]({},_0x34cf26,_0x181332[_0x90cb('0x46')]);return db[_0x90cb('0x41')][_0x90cb('0x4e')](_0x34cf26)['then'](function(_0x80351e){if(_0x80351e){_0x56522e=_0x80351e;return _0x80351e['getFields']();}return null;})['then'](function(_0x23a98e){if(_0x23a98e){if(!_0x23a98e[_0x90cb('0x38')]){throw new db[(_0x90cb('0x63'))][(_0x90cb('0x64'))](_0x90cb('0x65'),0x193);}_0x142fa3=_0x23a98e;return db['AnalyticMetric'][_0x90cb('0x42')]({'raw':!![]});}return null;})['then'](function(_0x3678b3){if(_0x3678b3){_0x1bc5bd=_[_0x90cb('0x67')](_0x3678b3,'id');var _0x2dda5a;var _0x55d126=squel[_0x90cb('0x68')]();_0x55d126['from'](_0x56522e[_0x90cb('0x6a')]);for(var _0x5b894a=0x0;_0x5b894a<_0x142fa3[_0x90cb('0x38')];_0x5b894a+=0x1){_0x2dda5a=_0x142fa3[_0x5b894a][_0x90cb('0x6b')]?_0x1bc5bd[_0x142fa3[_0x5b894a]['MetricId']][_0x90cb('0x9d')]:_0x142fa3[_0x5b894a][_0x90cb('0x60')];_0x2dda5a=_0x142fa3[_0x5b894a][_0x90cb('0x6c')]?_['replace'](_0x45e119[_0x142fa3[_0x5b894a]['function']],'%s',_0x2dda5a):_0x2dda5a;_0x2dda5a=_0x142fa3[_0x5b894a][_0x90cb('0x6e')]?_['replace'](_0x1d85aa[_0x142fa3[_0x5b894a][_0x90cb('0x6e')]],'%s',_0x2dda5a):_0x2dda5a;if(_0x142fa3[_0x5b894a][_0x90cb('0x6f')]){_0x55d126[_0x90cb('0x5f')](_0x2dda5a);}_0x142fa3[_0x5b894a][_0x90cb('0x70')]&&_0x55d126['order'](_0x2dda5a,_0x142fa3[_0x5b894a][_0x90cb('0x70')]===_0x90cb('0x81')?![]:!![]);_0x55d126[_0x90cb('0x60')](_0x2dda5a,_0x142fa3[_0x5b894a][_0x90cb('0x82')]||_0x2dda5a);}if(_0x56522e['joins']){_0x56522e[_0x90cb('0x71')]=JSON[_0x90cb('0x83')](_0x56522e[_0x90cb('0x71')]);for(var _0xc3da27=0x0;_0xc3da27<_0x56522e[_0x90cb('0x71')][_0x90cb('0x38')];_0xc3da27+=0x1){if(_0x56522e[_0x90cb('0x71')][_0xc3da27]['type']&&_['includes'](_0x55bf03,_0x56522e['joins'][_0xc3da27][_0x90cb('0x3f')])&&_0x56522e[_0x90cb('0x71')][_0xc3da27][_0x90cb('0x72')]&&_0x56522e[_0x90cb('0x71')][_0xc3da27][_0x90cb('0x73')]&&_0x56522e[_0x90cb('0x71')][_0xc3da27][_0x90cb('0x75')]){_0x55d126[_0x56522e[_0x90cb('0x71')][_0xc3da27][_0x90cb('0x3f')]](_0x56522e[_0x90cb('0x71')][_0xc3da27][_0x90cb('0x73')],null,util['format'](_0x90cb('0x74'),_0x56522e[_0x90cb('0x6a')],_0x56522e[_0x90cb('0x71')][_0xc3da27][_0x90cb('0x72')],_0x56522e[_0x90cb('0x71')][_0xc3da27][_0x90cb('0x73')],_0x56522e['joins'][_0xc3da27][_0x90cb('0x75')]));}}}if(_0x56522e[_0x90cb('0x76')]){_0x56522e[_0x90cb('0x76')]=JSON[_0x90cb('0x83')](_0x56522e[_0x90cb('0x76')]);_0x55d126[_0x90cb('0x3d')](_0x20ed92(_0x56522e['conditions']['group']));}_0x17643c=_0x55d126[_0x90cb('0x77')]();_0x55d126[_0x90cb('0x1c')](_0x58e2f6);_0x55d126[_0x90cb('0x1b')](0x0);logger['debug'](_0x90cb('0x79'),_0x55d126[_0x90cb('0x7a')]());return dbH['sequelize'][_0x90cb('0x35')](_0x55d126[_0x90cb('0x7a')](),{'type':dbH[_0x90cb('0x7b')][_0x90cb('0x7c')][_0x90cb('0x7d')]});}})[_0x90cb('0x24')](function(){return{'sql':_0x17643c[_0x90cb('0x7a')]()};})['then'](respondWithResult(_0x8fd490,null))[_0x90cb('0x44')](handleError(_0x8fd490,null));}; \ No newline at end of file +var _0xd82c=['hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','role','get','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%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)','HOUR(%s)','includes','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','AnalyticMetric','keyBy','select','from','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','type','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','sequelize','COUNT(DISTINCT\x20%s)','SEC_TO_TIME(%s)','ROUND(%s)','IS\x20NULL','table','output','fullPath','%s-%s.%s','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','toString','child_process','../../components/export/','../../files/reports','countTable','COUNT(*)','QueryTypes','SELECT','run','runReport','DATE(%s)','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','dbH','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','UserProfileResource','error','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xd82c,0x66));var _0xcd82=function(_0xff2a26,_0x2ce2aa){_0xff2a26=_0xff2a26-0x0;var _0x2c8c54=_0xd82c[_0xff2a26];return _0x2c8c54;};'use strict';var emlformat=require(_0xcd82('0x0'));var rimraf=require(_0xcd82('0x1'));var zipdir=require(_0xcd82('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcd82('0x3'));var moment=require(_0xcd82('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xcd82('0x5'));var util=require(_0xcd82('0x6'));var path=require('path');var sox=require(_0xcd82('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcd82('0x8'));var _=require(_0xcd82('0x9'));var squel=require(_0xcd82('0xa'));var crypto=require(_0xcd82('0xb'));var jsforce=require(_0xcd82('0xc'));var deskjs=require(_0xcd82('0xd'));var toCsv=require(_0xcd82('0xe'));var querystring=require(_0xcd82('0xf'));var Papa=require(_0xcd82('0x10'));var Redis=require(_0xcd82('0x11'));var authService=require(_0xcd82('0x12'));var qs=require(_0xcd82('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcd82('0x14'));var logger=require(_0xcd82('0x15'))(_0xcd82('0x16'));var utils=require(_0xcd82('0x17'));var config=require(_0xcd82('0x18'));var licenseUtil=require(_0xcd82('0x19'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xcd82('0x1a')];function respondWithStatusCode(_0x678251,_0x3cd8a3){_0x3cd8a3=_0x3cd8a3||0xcc;return function(_0xa3cbfe){if(_0xa3cbfe){return _0x678251[_0xcd82('0x1b')](_0x3cd8a3);}return _0x678251[_0xcd82('0x1c')](_0x3cd8a3)[_0xcd82('0x1d')]();};}function respondWithResult(_0x3ba0e1,_0x2c67d4){_0x2c67d4=_0x2c67d4||0xc8;return function(_0x74d6f6){if(_0x74d6f6){return _0x3ba0e1[_0xcd82('0x1c')](_0x2c67d4)[_0xcd82('0x1e')](_0x74d6f6);}};}function respondWithFilteredResult(_0x1452d7,_0xa23931){return function(_0x595965){if(_0x595965){var _0x385e2e=typeof _0xa23931['offset']===_0xcd82('0x1f')&&typeof _0xa23931[_0xcd82('0x20')]===_0xcd82('0x1f');var _0x1934cc=_0x595965[_0xcd82('0x21')];var _0x1cc85d=_0x385e2e?0x0:_0xa23931[_0xcd82('0x22')];var _0x2b79ae=_0x385e2e?_0x595965[_0xcd82('0x21')]:_0xa23931[_0xcd82('0x22')]+_0xa23931[_0xcd82('0x20')];var _0x2d371e;if(_0x2b79ae>=_0x1934cc){_0x2b79ae=_0x1934cc;_0x2d371e=0xc8;}else{_0x2d371e=0xce;}_0x1452d7[_0xcd82('0x1c')](_0x2d371e);return _0x1452d7[_0xcd82('0x23')](_0xcd82('0x24'),_0x1cc85d+'-'+_0x2b79ae+'/'+_0x1934cc)[_0xcd82('0x1e')](_0x595965);}return null;};}function patchUpdates(_0x42d0f2){return function(_0x298947){try{jsonpatch[_0xcd82('0x25')](_0x298947,_0x42d0f2,!![]);}catch(_0x9b64d0){return BPromise[_0xcd82('0x26')](_0x9b64d0);}return _0x298947['save']();};}function saveUpdates(_0x131173,_0x3d1da5){return function(_0x1f21a4){if(_0x1f21a4){return _0x1f21a4[_0xcd82('0x27')](_0x131173)[_0xcd82('0x28')](function(_0xded033){return _0xded033;});}return null;};}function removeEntity(_0x384614,_0x48d136){return function(_0x5065cc){if(_0x5065cc){return _0x5065cc[_0xcd82('0x29')]()[_0xcd82('0x28')](function(){var _0x3a0acb=_0x5065cc['get']({'plain':!![]});var _0x33f560='CustomReports';return db[_0xcd82('0x2a')]['destroy']({'where':{'type':_0x33f560,'resourceId':_0x3a0acb['id']}})[_0xcd82('0x28')](function(){return _0x5065cc;});})['then'](function(){_0x384614[_0xcd82('0x1c')](0xcc)[_0xcd82('0x1d')]();});}};}function handleEntityNotFound(_0x112d90,_0x33f2a4){return function(_0x2d30c3){if(!_0x2d30c3){_0x112d90[_0xcd82('0x1b')](0x194);}return _0x2d30c3;};}function handleError(_0x42d3f2,_0x5f2997){_0x5f2997=_0x5f2997||0x1f4;return function(_0x364d2a){logger[_0xcd82('0x2b')](_0x364d2a['stack']);if(_0x364d2a[_0xcd82('0x2c')]){delete _0x364d2a[_0xcd82('0x2c')];}_0x42d3f2[_0xcd82('0x1c')](_0x5f2997)[_0xcd82('0x2d')](_0x364d2a);};}exports[_0xcd82('0x2e')]=function(_0x50153a,_0x2eab98){var _0x485658={},_0x1d4031={},_0x1cf51d={'count':0x0,'rows':[]};var _0x4445ea=_[_0xcd82('0x2f')](db[_0xcd82('0x30')][_0xcd82('0x31')],function(_0x4fc531){return{'name':_0x4fc531[_0xcd82('0x32')],'type':_0x4fc531['type'][_0xcd82('0x33')]};});_0x1d4031[_0xcd82('0x34')]=_[_0xcd82('0x2f')](_0x4445ea,_0xcd82('0x2c'));_0x1d4031[_0xcd82('0x35')]=_[_0xcd82('0x36')](_0x50153a[_0xcd82('0x35')]);_0x1d4031[_0xcd82('0x37')]=_['intersection'](_0x1d4031[_0xcd82('0x34')],_0x1d4031[_0xcd82('0x35')]);_0x485658[_0xcd82('0x38')]=_[_0xcd82('0x39')](_0x1d4031[_0xcd82('0x34')],qs[_0xcd82('0x3a')](_0x50153a['query'][_0xcd82('0x3a')]));_0x485658[_0xcd82('0x38')]=_0x485658[_0xcd82('0x38')][_0xcd82('0x3b')]?_0x485658[_0xcd82('0x38')]:_0x1d4031[_0xcd82('0x34')];if(!_0x50153a['query'][_0xcd82('0x3c')]('nolimit')){_0x485658[_0xcd82('0x20')]=qs[_0xcd82('0x20')](_0x50153a[_0xcd82('0x35')][_0xcd82('0x20')]);_0x485658[_0xcd82('0x22')]=qs[_0xcd82('0x22')](_0x50153a['query'][_0xcd82('0x22')]);}_0x485658[_0xcd82('0x3d')]=qs[_0xcd82('0x3e')](_0x50153a[_0xcd82('0x35')][_0xcd82('0x3e')]);_0x485658[_0xcd82('0x3f')]=qs['filters'](_['pick'](_0x50153a[_0xcd82('0x35')],_0x1d4031[_0xcd82('0x37')]),_0x4445ea);if(_0x50153a['query'][_0xcd82('0x40')]){_0x485658[_0xcd82('0x3f')]=_[_0xcd82('0x41')](_0x485658[_0xcd82('0x3f')],{'$or':_[_0xcd82('0x2f')](_0x4445ea,function(_0x4949f6){if(_0x4949f6['type']!==_0xcd82('0x42')){var _0x56325b={};_0x56325b[_0x4949f6[_0xcd82('0x2c')]]={'$like':'%'+_0x50153a['query'][_0xcd82('0x40')]+'%'};return _0x56325b;}})});}_0x485658=_[_0xcd82('0x41')]({},_0x485658,_0x50153a[_0xcd82('0x43')]);var _0x3662d3={'where':_0x485658[_0xcd82('0x3f')]};return db[_0xcd82('0x30')][_0xcd82('0x21')](_0x3662d3)[_0xcd82('0x28')](function(_0x194922){_0x1cf51d[_0xcd82('0x21')]=_0x194922;if(_0x50153a[_0xcd82('0x35')]['includeAll']){_0x485658[_0xcd82('0x44')]=[{'all':!![]}];}return db[_0xcd82('0x30')][_0xcd82('0x45')](_0x485658);})['then'](function(_0x1e72db){_0x1cf51d[_0xcd82('0x46')]=_0x1e72db;return _0x1cf51d;})['then'](respondWithFilteredResult(_0x2eab98,_0x485658))[_0xcd82('0x47')](handleError(_0x2eab98,null));};exports[_0xcd82('0x48')]=function(_0x3b261c,_0x43b563){var _0x462075={'raw':![],'where':{'id':_0x3b261c[_0xcd82('0x49')]['id']}},_0x38d1f7={};_0x38d1f7[_0xcd82('0x34')]=_[_0xcd82('0x36')](db[_0xcd82('0x30')][_0xcd82('0x31')]);_0x38d1f7[_0xcd82('0x35')]=_['keys'](_0x3b261c[_0xcd82('0x35')]);_0x38d1f7[_0xcd82('0x37')]=_[_0xcd82('0x39')](_0x38d1f7[_0xcd82('0x34')],_0x38d1f7[_0xcd82('0x35')]);_0x462075[_0xcd82('0x38')]=_[_0xcd82('0x39')](_0x38d1f7[_0xcd82('0x34')],qs['fields'](_0x3b261c['query']['fields']));_0x462075[_0xcd82('0x38')]=_0x462075[_0xcd82('0x38')]['length']?_0x462075[_0xcd82('0x38')]:_0x38d1f7[_0xcd82('0x34')];if(_0x3b261c[_0xcd82('0x35')][_0xcd82('0x4a')]){_0x462075[_0xcd82('0x44')]=[{'all':!![]}];}_0x462075=_[_0xcd82('0x41')]({},_0x462075,_0x3b261c['options']);return db[_0xcd82('0x30')][_0xcd82('0x4b')](_0x462075)[_0xcd82('0x28')](handleEntityNotFound(_0x43b563,null))['then'](respondWithResult(_0x43b563,null))[_0xcd82('0x47')](handleError(_0x43b563,null));};exports[_0xcd82('0x4c')]=function(_0x48b0a4,_0x2edfaa){return db[_0xcd82('0x30')][_0xcd82('0x4c')](_0x48b0a4['body'],{})[_0xcd82('0x28')](function(_0x190fb6){var _0x57c91d=_0x48b0a4['user']['get']({'plain':!![]});if(!_0x57c91d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x57c91d[_0xcd82('0x4d')]==='user'){var _0x436de0=_0x190fb6[_0xcd82('0x4e')]({'plain':!![]});var _0x2fbb36=_0xcd82('0x4f');return db[_0xcd82('0x50')][_0xcd82('0x4b')]({'where':{'name':_0x2fbb36,'userProfileId':_0x57c91d[_0xcd82('0x51')]},'raw':!![]})[_0xcd82('0x28')](function(_0x35b362){if(_0x35b362&&_0x35b362[_0xcd82('0x52')]===0x0){return db[_0xcd82('0x2a')][_0xcd82('0x4c')]({'name':_0x436de0[_0xcd82('0x2c')],'resourceId':_0x436de0['id'],'type':'CustomReports','sectionId':_0x35b362['id']},{})[_0xcd82('0x28')](function(){return _0x190fb6;});}else{return _0x190fb6;}})[_0xcd82('0x47')](function(_0x376695){logger[_0xcd82('0x2b')](_0xcd82('0x53'),_0x376695);throw _0x376695;});}return _0x190fb6;})[_0xcd82('0x28')](respondWithResult(_0x2edfaa,0xc9))['catch'](handleError(_0x2edfaa,null));};exports[_0xcd82('0x27')]=function(_0x5acb6f,_0x3bcd92){if(_0x5acb6f[_0xcd82('0x54')]['id']){delete _0x5acb6f[_0xcd82('0x54')]['id'];}return db['AnalyticCustomReport'][_0xcd82('0x4b')]({'where':{'id':_0x5acb6f[_0xcd82('0x49')]['id']}})[_0xcd82('0x28')](handleEntityNotFound(_0x3bcd92,null))[_0xcd82('0x28')](saveUpdates(_0x5acb6f['body'],null))[_0xcd82('0x28')](respondWithResult(_0x3bcd92,null))[_0xcd82('0x47')](handleError(_0x3bcd92,null));};exports[_0xcd82('0x29')]=function(_0xdc9a94,_0x1a3b3c){return db[_0xcd82('0x30')][_0xcd82('0x4b')]({'where':{'id':_0xdc9a94['params']['id']}})['then'](handleEntityNotFound(_0x1a3b3c,null))[_0xcd82('0x28')](removeEntity(_0x1a3b3c,null))[_0xcd82('0x47')](handleError(_0x1a3b3c,null));};exports['preview']=function(_0x25b8cf,_0x30df4c){var _0x4da644=0xa;var _0x2bf336=[_0xcd82('0x55'),_0xcd82('0x56'),_0xcd82('0x57'),_0xcd82('0x58')];var _0x48a8b4={'SUM':_0xcd82('0x59'),'COUNT':_0xcd82('0x5a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xcd82('0x5b'),'MIN':_0xcd82('0x5c'),'AVG':_0xcd82('0x5d'),'GROUP_CONCAT':_0xcd82('0x5e'),'GROUP_CONCAT ASC':_0xcd82('0x5f'),'GROUP_CONCAT DESC':_0xcd82('0x60')};var _0x29be40={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xcd82('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x37f255=function(_0x404aa2){return!_[_0xcd82('0x62')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xcd82('0x63'),_0xcd82('0x64')],_0x404aa2);};var _0x53927c=function(_0x42fce){if(!_0x42fce||!_0x42fce[_0xcd82('0x65')][_0xcd82('0x3b')]){return'';}for(var _0x46d919='(',_0x54a16f=0x0;_0x54a16f<_0x42fce[_0xcd82('0x65')]['length'];_0x54a16f+=0x1){_0x54a16f>0x0&&(_0x46d919+='\x20'+_0x42fce[_0xcd82('0x66')]+'\x20');_0x46d919+=_0x42fce[_0xcd82('0x65')][_0x54a16f][_0xcd82('0x67')]?_0x53927c(_0x42fce['rules'][_0x54a16f][_0xcd82('0x67')]):_0x42fce[_0xcd82('0x65')][_0x54a16f][_0xcd82('0x68')]+'\x20'+_0x42fce[_0xcd82('0x65')][_0x54a16f][_0xcd82('0x69')]+(_0x37f255(_0x42fce[_0xcd82('0x65')][_0x54a16f]['condition'])?'\x20'+_0x42fce['rules'][_0x54a16f]['value']:'');}return _0x46d919+')';};var _0x700755={'where':{'id':_0x25b8cf[_0xcd82('0x49')]['id']}},_0x5f0f6e,_0x3f3d3b,_0x14e4bc,_0x368f68,_0x455ac0;_0x700755=_[_0xcd82('0x41')]({},_0x700755,_0x25b8cf[_0xcd82('0x43')]);return db['AnalyticCustomReport'][_0xcd82('0x4b')](_0x700755)[_0xcd82('0x28')](function(_0x22ab54){if(_0x22ab54){_0x5f0f6e=_0x22ab54;return _0x22ab54[_0xcd82('0x6a')]();}return null;})[_0xcd82('0x28')](function(_0x4f6b12){if(_0x4f6b12){if(!_0x4f6b12[_0xcd82('0x3b')]){throw new db[(_0xcd82('0x6b'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3f3d3b=_0x4f6b12;return db[_0xcd82('0x6c')][_0xcd82('0x45')]({'raw':!![]});}return null;})[_0xcd82('0x28')](function(_0x255642){if(_0x255642){_0x14e4bc=_[_0xcd82('0x6d')](_0x255642,'id');var _0x18cca5;var _0x42099d=squel[_0xcd82('0x6e')]();_0x42099d[_0xcd82('0x6f')](_0x5f0f6e['table']);for(var _0x329107=0x0;_0x329107<_0x3f3d3b[_0xcd82('0x3b')];_0x329107+=0x1){_0x18cca5=_0x3f3d3b[_0x329107][_0xcd82('0x70')]?_0x14e4bc[_0x3f3d3b[_0x329107]['MetricId']][_0xcd82('0x71')]:_0x3f3d3b[_0x329107]['field'];_0x18cca5=_0x3f3d3b[_0x329107][_0xcd82('0x72')]?_[_0xcd82('0x73')](_0x48a8b4[_0x3f3d3b[_0x329107][_0xcd82('0x72')]],'%s',_0x18cca5):_0x18cca5;_0x18cca5=_0x3f3d3b[_0x329107][_0xcd82('0x74')]?_['replace'](_0x29be40[_0x3f3d3b[_0x329107][_0xcd82('0x74')]],'%s',_0x18cca5):_0x18cca5;if(_0x3f3d3b[_0x329107][_0xcd82('0x75')]){_0x42099d[_0xcd82('0x67')](_0x18cca5);}_0x3f3d3b[_0x329107][_0xcd82('0x76')]&&_0x42099d['order'](_0x18cca5,_0x3f3d3b[_0x329107][_0xcd82('0x76')]===_0xcd82('0x77')?![]:!![]);_0x42099d[_0xcd82('0x68')](_0x18cca5,_0x3f3d3b[_0x329107][_0xcd82('0x78')]||_0x18cca5);}if(_0x5f0f6e[_0xcd82('0x79')]){_0x5f0f6e[_0xcd82('0x79')]=JSON[_0xcd82('0x7a')](_0x5f0f6e[_0xcd82('0x79')]);for(var _0x4ce27e=0x0;_0x4ce27e<_0x5f0f6e[_0xcd82('0x79')][_0xcd82('0x3b')];_0x4ce27e+=0x1){if(_0x5f0f6e[_0xcd82('0x79')][_0x4ce27e][_0xcd82('0x7b')]&&_[_0xcd82('0x62')](_0x2bf336,_0x5f0f6e[_0xcd82('0x79')][_0x4ce27e][_0xcd82('0x7b')])&&_0x5f0f6e[_0xcd82('0x79')][_0x4ce27e][_0xcd82('0x7c')]&&_0x5f0f6e[_0xcd82('0x79')][_0x4ce27e][_0xcd82('0x7d')]&&_0x5f0f6e[_0xcd82('0x79')][_0x4ce27e][_0xcd82('0x7e')]){_0x42099d[_0x5f0f6e[_0xcd82('0x79')][_0x4ce27e]['type']](_0x5f0f6e[_0xcd82('0x79')][_0x4ce27e][_0xcd82('0x7d')],null,util['format'](_0xcd82('0x7f'),_0x5f0f6e['table'],_0x5f0f6e[_0xcd82('0x79')][_0x4ce27e][_0xcd82('0x7c')],_0x5f0f6e[_0xcd82('0x79')][_0x4ce27e][_0xcd82('0x7d')],_0x5f0f6e[_0xcd82('0x79')][_0x4ce27e][_0xcd82('0x7e')]));}}}if(_0x5f0f6e['conditions']){_0x5f0f6e[_0xcd82('0x80')]=JSON['parse'](_0x5f0f6e[_0xcd82('0x80')]);_0x42099d['where'](_0x53927c(_0x5f0f6e['conditions']['group']));}_0x455ac0=_0x42099d[_0xcd82('0x81')]();_0x42099d[_0xcd82('0x20')](_0x4da644);_0x42099d['offset'](0x0);logger[_0xcd82('0x82')](_0xcd82('0x83'),_0x42099d['toString']());return dbH[_0xcd82('0x84')][_0xcd82('0x35')](_0x42099d['toString'](),{'type':dbH[_0xcd82('0x84')]['QueryTypes']['SELECT']});}})[_0xcd82('0x28')](respondWithResult(_0x30df4c,null))['catch'](handleError(_0x30df4c,null));};function runReport(_0x51e543,_0x1fc9d7,_0x128c07){var _0x5d8342=_0x1fc9d7[_0xcd82('0x2c')];var _0x3c979b=0xa;var _0x31d712=[_0xcd82('0x55'),'left_join',_0xcd82('0x57'),_0xcd82('0x58')];var _0x469fe6={'SUM':_0xcd82('0x59'),'COUNT':_0xcd82('0x5a'),'COUNT DISTINCT':_0xcd82('0x85'),'MAX':_0xcd82('0x5b'),'MIN':'MIN(%s)','AVG':_0xcd82('0x5d'),'GROUP_CONCAT':_0xcd82('0x5e'),'GROUP_CONCAT ASC':_0xcd82('0x5f'),'GROUP_CONCAT DESC':_0xcd82('0x60')};var _0x4cf6f8={'SEC_TO_TIME':_0xcd82('0x86'),'DATE':'DATE(%s)','HOUR':_0xcd82('0x61'),'ROUND':_0xcd82('0x87'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x38b9d4=function(_0x671caa){return!_[_0xcd82('0x62')]([_0xcd82('0x88'),'IS\x20NOT\x20NULL',_0xcd82('0x63'),'IS\x20NOT\x20EMPTY'],_0x671caa);};var _0x1b83af=function(_0x5404d6){if(!_0x5404d6||!_0x5404d6['rules']['length']){return'';}for(var _0x1f564f='(',_0x20f215=0x0;_0x20f215<_0x5404d6[_0xcd82('0x65')][_0xcd82('0x3b')];_0x20f215+=0x1){_0x20f215>0x0&&(_0x1f564f+='\x20'+_0x5404d6[_0xcd82('0x66')]+'\x20');_0x1f564f+=_0x5404d6[_0xcd82('0x65')][_0x20f215][_0xcd82('0x67')]?_0x1b83af(_0x5404d6[_0xcd82('0x65')][_0x20f215][_0xcd82('0x67')]):_0x5404d6[_0xcd82('0x65')][_0x20f215][_0xcd82('0x68')]+'\x20'+_0x5404d6['rules'][_0x20f215][_0xcd82('0x69')]+(_0x38b9d4(_0x5404d6[_0xcd82('0x65')][_0x20f215][_0xcd82('0x69')])?'\x20'+_0x5404d6['rules'][_0x20f215]['value']:'');}return _0x1f564f+')';};var _0x458b9f={'where':{'id':_0x51e543['id']}},_0x2c7705,_0x5688dc,_0x36894c,_0x10d487,_0x34746d;_0x458b9f=_[_0xcd82('0x41')]({},_0x458b9f,_0x128c07);return db[_0xcd82('0x30')][_0xcd82('0x4b')](_0x458b9f)['then'](function(_0x50e6e6){if(_0x50e6e6){_0x2c7705=_0x50e6e6;return _0x50e6e6[_0xcd82('0x6a')]();}return null;})[_0xcd82('0x28')](function(_0x2e5b5c){if(_0x2e5b5c){if(!_0x2e5b5c[_0xcd82('0x3b')]){throw new db[(_0xcd82('0x6b'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5688dc=_0x2e5b5c;return db[_0xcd82('0x6c')][_0xcd82('0x45')]({'raw':!![]});}return null;})[_0xcd82('0x28')](function(_0x137397){if(_0x137397){_0x36894c=_[_0xcd82('0x6d')](_0x137397,'id');var _0x3978a4;var _0x246471=squel['select']();_0x246471[_0xcd82('0x6f')](_0x2c7705['table']);for(var _0x30cc4d=0x0;_0x30cc4d<_0x5688dc[_0xcd82('0x3b')];_0x30cc4d+=0x1){_0x3978a4=_0x5688dc[_0x30cc4d][_0xcd82('0x70')]?_0x36894c[_0x5688dc[_0x30cc4d][_0xcd82('0x70')]][_0xcd82('0x71')]:_0x5688dc[_0x30cc4d][_0xcd82('0x68')];_0x3978a4=_0x5688dc[_0x30cc4d]['function']?_[_0xcd82('0x73')](_0x469fe6[_0x5688dc[_0x30cc4d][_0xcd82('0x72')]],'%s',_0x3978a4):_0x3978a4;_0x3978a4=_0x5688dc[_0x30cc4d]['format']?_['replace'](_0x4cf6f8[_0x5688dc[_0x30cc4d][_0xcd82('0x74')]],'%s',_0x3978a4):_0x3978a4;if(_0x5688dc[_0x30cc4d]['groupBy']){_0x246471[_0xcd82('0x67')](_0x3978a4);}_0x5688dc[_0x30cc4d][_0xcd82('0x76')]&&_0x246471[_0xcd82('0x3d')](_0x3978a4,_0x5688dc[_0x30cc4d][_0xcd82('0x76')]==='DESC'?![]:!![]);_0x246471[_0xcd82('0x68')](_0x3978a4,_0x5688dc[_0x30cc4d][_0xcd82('0x78')]||_0x3978a4);}if(_0x2c7705[_0xcd82('0x79')]){_0x2c7705['joins']=JSON['parse'](_0x2c7705[_0xcd82('0x79')]);for(var _0x34ab50=0x0;_0x34ab50<_0x2c7705[_0xcd82('0x79')]['length'];_0x34ab50+=0x1){if(_0x2c7705[_0xcd82('0x79')][_0x34ab50][_0xcd82('0x7b')]&&_['includes'](_0x31d712,_0x2c7705[_0xcd82('0x79')][_0x34ab50][_0xcd82('0x7b')])&&_0x2c7705[_0xcd82('0x79')][_0x34ab50]['parentKey']&&_0x2c7705[_0xcd82('0x79')][_0x34ab50][_0xcd82('0x7d')]&&_0x2c7705[_0xcd82('0x79')][_0x34ab50]['foreignKey']){_0x246471[_0x2c7705[_0xcd82('0x79')][_0x34ab50]['type']](_0x2c7705[_0xcd82('0x79')][_0x34ab50][_0xcd82('0x7d')],null,util[_0xcd82('0x74')](_0xcd82('0x7f'),_0x2c7705[_0xcd82('0x89')],_0x2c7705['joins'][_0x34ab50]['parentKey'],_0x2c7705[_0xcd82('0x79')][_0x34ab50][_0xcd82('0x7d')],_0x2c7705[_0xcd82('0x79')][_0x34ab50][_0xcd82('0x7e')]));}}}if(_0x2c7705[_0xcd82('0x80')]){_0x2c7705[_0xcd82('0x80')]=JSON[_0xcd82('0x7a')](_0x2c7705[_0xcd82('0x80')]);_0x246471[_0xcd82('0x3f')](_0x1b83af(_0x2c7705[_0xcd82('0x80')][_0xcd82('0x67')]));}_0x34746d=_0x246471[_0xcd82('0x81')]();_0x246471['limit'](_0x3c979b);_0x246471[_0xcd82('0x22')](0x0);return;}})[_0xcd82('0x28')](function(){if(_0x1fc9d7[_0xcd82('0x8a')]==='web'){return null;}var _0xb8f5b2=_['merge'](_0x1fc9d7,{'name':_0x1fc9d7[_0xcd82('0x8b')]||_0x1fc9d7[_0xcd82('0x2c')]||_0x2c7705[_0xcd82('0x2c')],'basename':_0x5d8342,'savename':util[_0xcd82('0x74')](_0xcd82('0x8c'),_0x1fc9d7['name']||_0x2c7705[_0xcd82('0x2c')],require('randomstring')[_0xcd82('0x8d')](0x4),_0x1fc9d7[_0xcd82('0x8a')]||_0xcd82('0x8e')),'reportId':_0x2c7705['id'],'reportType':_0xcd82('0x8f')});return db[_0xcd82('0x90')][_0xcd82('0x4c')](_0xb8f5b2,{'raw':!![]});})['then'](function(_0x1cce27){if(_0x2c7705[_0xcd82('0x89')]==='cdr'){_0x34746d[_0xcd82('0x3f')](_0x2c7705[_0xcd82('0x89')]+_0xcd82('0x91'),_0x1fc9d7[_0xcd82('0x92')],_0x1fc9d7[_0xcd82('0x93')]);}else{_0x34746d[_0xcd82('0x3f')](_0x2c7705['table']+_0xcd82('0x94'),_0x1fc9d7[_0xcd82('0x92')],_0x1fc9d7[_0xcd82('0x93')]);}if(_0x1cce27){logger[_0xcd82('0x95')](_0xcd82('0x96'),_0x34746d[_0xcd82('0x97')]());require(_0xcd82('0x98'))['fork'](path[_0xcd82('0x55')](__dirname,_0xcd82('0x99'),_0x1cce27[_0xcd82('0x8a')]),[_0x1cce27['id'],_0x34746d['toString'](),path[_0xcd82('0x55')](__dirname,_0xcd82('0x9a'),_0x1cce27['savename']),_0x5d8342]);return _0x1cce27;}else{var _0x2dbdfa=squel[_0xcd82('0x6e')]();_0x2dbdfa[_0xcd82('0x6f')]('('+_0x34746d[_0xcd82('0x97')]()+')',_0xcd82('0x9b'));_0x2dbdfa[_0xcd82('0x68')](_0xcd82('0x9c'),_0xcd82('0x21'));_0x34746d['limit'](_0x1fc9d7[_0xcd82('0x20')]||_0x3c979b);_0x34746d[_0xcd82('0x22')](_0x1fc9d7['offset']||0x0);return dbH[_0xcd82('0x84')][_0xcd82('0x35')](_0x2dbdfa[_0xcd82('0x97')](),{'type':dbH[_0xcd82('0x84')][_0xcd82('0x9d')]['SELECT']})[_0xcd82('0x28')](function(_0x343fba){if(!_0x343fba[_0xcd82('0x3b')]){_0x10d487=0x0;}else{_0x10d487=_0x343fba[0x0][_0xcd82('0x21')]||0x0;}return dbH[_0xcd82('0x84')]['query'](_0x34746d[_0xcd82('0x97')](),{'type':dbH['sequelize']['QueryTypes'][_0xcd82('0x9e')]});})[_0xcd82('0x28')](function(_0x5a8da9){return{'rows':_0x5a8da9||[],'count':_0x10d487};});}});}exports[_0xcd82('0x9f')]=function(_0x4ae284,_0x5aeb9b){return runReport(_0x4ae284[_0xcd82('0x49')],_0x4ae284[_0xcd82('0x35')],_0x4ae284[_0xcd82('0x43')])[_0xcd82('0x28')](respondWithResult(_0x5aeb9b,null))['catch'](handleError(_0x5aeb9b,null));};exports[_0xcd82('0xa0')]=runReport;exports[_0xcd82('0x35')]=function(_0x5a01fa,_0x553307){var _0x596f7e=0xa;var _0x5d93b1=[_0xcd82('0x55'),_0xcd82('0x56'),_0xcd82('0x57'),_0xcd82('0x58')];var _0x511f3a={'SUM':_0xcd82('0x59'),'COUNT':_0xcd82('0x5a'),'COUNT DISTINCT':_0xcd82('0x85'),'MAX':'MAX(%s)','MIN':_0xcd82('0x5c'),'AVG':_0xcd82('0x5d'),'GROUP_CONCAT':_0xcd82('0x5e'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xcd82('0x60')};var _0x2e22bd={'SEC_TO_TIME':_0xcd82('0x86'),'DATE':_0xcd82('0xa1'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xcf1d79=function(_0x360339){return!_[_0xcd82('0x62')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xcd82('0x63'),_0xcd82('0x64')],_0x360339);};var _0x305f20=function(_0x3f6173){if(!_0x3f6173||!_0x3f6173['rules']['length']){return'';}for(var _0x43539f='(',_0x964b89=0x0;_0x964b89<_0x3f6173[_0xcd82('0x65')][_0xcd82('0x3b')];_0x964b89+=0x1){_0x964b89>0x0&&(_0x43539f+='\x20'+_0x3f6173[_0xcd82('0x66')]+'\x20');_0x43539f+=_0x3f6173['rules'][_0x964b89]['group']?_0x305f20(_0x3f6173[_0xcd82('0x65')][_0x964b89][_0xcd82('0x67')]):_0x3f6173['rules'][_0x964b89][_0xcd82('0x68')]+'\x20'+_0x3f6173[_0xcd82('0x65')][_0x964b89]['condition']+(_0xcf1d79(_0x3f6173['rules'][_0x964b89][_0xcd82('0x69')])?'\x20'+_0x3f6173[_0xcd82('0x65')][_0x964b89]['value']:'');}return _0x43539f+')';};var _0x1733b8={'where':{'id':_0x5a01fa[_0xcd82('0x49')]['id']}},_0x4e0134,_0xf5f6fe,_0xeeca9c,_0x110b73,_0x1a1f32;_0x1733b8=_['merge']({},_0x1733b8,_0x5a01fa[_0xcd82('0x43')]);return db[_0xcd82('0x30')]['find'](_0x1733b8)['then'](function(_0x5f19d6){if(_0x5f19d6){_0x4e0134=_0x5f19d6;return _0x5f19d6[_0xcd82('0x6a')]();}return null;})['then'](function(_0x1855e2){if(_0x1855e2){if(!_0x1855e2[_0xcd82('0x3b')]){throw new db[(_0xcd82('0x6b'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xf5f6fe=_0x1855e2;return db[_0xcd82('0x6c')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x2d9107){if(_0x2d9107){_0xeeca9c=_[_0xcd82('0x6d')](_0x2d9107,'id');var _0x238f1f;var _0x2fe1dc=squel[_0xcd82('0x6e')]();_0x2fe1dc[_0xcd82('0x6f')](_0x4e0134['table']);for(var _0x43346f=0x0;_0x43346f<_0xf5f6fe[_0xcd82('0x3b')];_0x43346f+=0x1){_0x238f1f=_0xf5f6fe[_0x43346f][_0xcd82('0x70')]?_0xeeca9c[_0xf5f6fe[_0x43346f]['MetricId']][_0xcd82('0x71')]:_0xf5f6fe[_0x43346f][_0xcd82('0x68')];_0x238f1f=_0xf5f6fe[_0x43346f][_0xcd82('0x72')]?_[_0xcd82('0x73')](_0x511f3a[_0xf5f6fe[_0x43346f]['function']],'%s',_0x238f1f):_0x238f1f;_0x238f1f=_0xf5f6fe[_0x43346f][_0xcd82('0x74')]?_['replace'](_0x2e22bd[_0xf5f6fe[_0x43346f]['format']],'%s',_0x238f1f):_0x238f1f;if(_0xf5f6fe[_0x43346f][_0xcd82('0x75')]){_0x2fe1dc['group'](_0x238f1f);}_0xf5f6fe[_0x43346f][_0xcd82('0x76')]&&_0x2fe1dc[_0xcd82('0x3d')](_0x238f1f,_0xf5f6fe[_0x43346f]['orderBy']===_0xcd82('0x77')?![]:!![]);_0x2fe1dc[_0xcd82('0x68')](_0x238f1f,_0xf5f6fe[_0x43346f][_0xcd82('0x78')]||_0x238f1f);}if(_0x4e0134[_0xcd82('0x79')]){_0x4e0134[_0xcd82('0x79')]=JSON[_0xcd82('0x7a')](_0x4e0134[_0xcd82('0x79')]);for(var _0x1e544f=0x0;_0x1e544f<_0x4e0134[_0xcd82('0x79')]['length'];_0x1e544f+=0x1){if(_0x4e0134[_0xcd82('0x79')][_0x1e544f]['type']&&_[_0xcd82('0x62')](_0x5d93b1,_0x4e0134[_0xcd82('0x79')][_0x1e544f][_0xcd82('0x7b')])&&_0x4e0134[_0xcd82('0x79')][_0x1e544f][_0xcd82('0x7c')]&&_0x4e0134[_0xcd82('0x79')][_0x1e544f][_0xcd82('0x7d')]&&_0x4e0134[_0xcd82('0x79')][_0x1e544f][_0xcd82('0x7e')]){_0x2fe1dc[_0x4e0134[_0xcd82('0x79')][_0x1e544f]['type']](_0x4e0134[_0xcd82('0x79')][_0x1e544f][_0xcd82('0x7d')],null,util[_0xcd82('0x74')](_0xcd82('0x7f'),_0x4e0134['table'],_0x4e0134[_0xcd82('0x79')][_0x1e544f][_0xcd82('0x7c')],_0x4e0134[_0xcd82('0x79')][_0x1e544f][_0xcd82('0x7d')],_0x4e0134[_0xcd82('0x79')][_0x1e544f][_0xcd82('0x7e')]));}}}if(_0x4e0134[_0xcd82('0x80')]){_0x4e0134[_0xcd82('0x80')]=JSON[_0xcd82('0x7a')](_0x4e0134['conditions']);_0x2fe1dc[_0xcd82('0x3f')](_0x305f20(_0x4e0134[_0xcd82('0x80')]['group']));}_0x1a1f32=_0x2fe1dc[_0xcd82('0x81')]();_0x2fe1dc[_0xcd82('0x20')](_0x596f7e);_0x2fe1dc['offset'](0x0);logger[_0xcd82('0x82')](_0xcd82('0x83'),_0x2fe1dc[_0xcd82('0x97')]());return dbH[_0xcd82('0x84')]['query'](_0x2fe1dc['toString'](),{'type':dbH['sequelize'][_0xcd82('0x9d')][_0xcd82('0x9e')]});}})[_0xcd82('0x28')](function(){return{'sql':_0x1a1f32[_0xcd82('0x97')]()};})['then'](respondWithResult(_0x553307,null))[_0xcd82('0x47')](handleError(_0x553307,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 25eb09b..3e152b7 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 _0x8869=['request-promise','rimraf','../../config/environment','./analyticCustomReport.attributes','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','bluebird'];(function(_0x2c526d,_0x284ef7){var _0x1a6e7c=function(_0x34df61){while(--_0x34df61){_0x2c526d['push'](_0x2c526d['shift']());}};_0x1a6e7c(++_0x284ef7);}(_0x8869,0x157));var _0x9886=function(_0x3879b6,_0x1e2e47){_0x3879b6=_0x3879b6-0x0;var _0x19ccef=_0x8869[_0x3879b6];return _0x19ccef;};'use strict';var _=require(_0x9886('0x0'));var util=require(_0x9886('0x1'));var logger=require(_0x9886('0x2'))(_0x9886('0x3'));var moment=require('moment');var BPromise=require(_0x9886('0x4'));var rp=require(_0x9886('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9886('0x6'));var config=require(_0x9886('0x7'));var attributes=require(_0x9886('0x8'));module['exports']=function(_0x3188a1,_0x1c2881){return _0x3188a1[_0x9886('0x9')](_0x9886('0xa'),attributes,{'tableName':_0x9886('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6556=['path','rimraf','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','api','moment','bluebird','request-promise'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x6556,0x193));var _0x6655=function(_0x556ac4,_0x441fd7){_0x556ac4=_0x556ac4-0x0;var _0xd301c7=_0x6556[_0x556ac4];return _0xd301c7;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x6655('0x0'));var moment=require(_0x6655('0x1'));var BPromise=require(_0x6655('0x2'));var rp=require(_0x6655('0x3'));var fs=require('fs');var path=require(_0x6655('0x4'));var rimraf=require(_0x6655('0x5'));var config=require('../../config/environment');var attributes=require(_0x6655('0x6'));module[_0x6655('0x7')]=function(_0x5cc474,_0x14716b){return _0x5cc474[_0x6655('0x8')](_0x6655('0x9'),attributes,{'tableName':_0x6655('0xa'),'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 a24f85b..99632da 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 _0x5ee5=['client','http','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x5ee5,0x121));var _0x55ee=function(_0x29210d,_0x45648b){_0x29210d=_0x29210d-0x0;var _0x4a66e6=_0x5ee5[_0x29210d];return _0x4a66e6;};'use strict';var _=require(_0x55ee('0x0'));var util=require(_0x55ee('0x1'));var moment=require(_0x55ee('0x2'));var BPromise=require(_0x55ee('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x55ee('0x4'));var db=require(_0x55ee('0x5'))['db'];var utils=require(_0x55ee('0x6'));var logger=require(_0x55ee('0x7'))(_0x55ee('0x8'));var config=require('../../config/environment');var jayson=require(_0x55ee('0x9'));var client=jayson[_0x55ee('0xa')][_0x55ee('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x55f9a0,_0xc13225,_0x5e4cb6){return new BPromise(function(_0x5175f0,_0xf45727){return client['request'](_0x55f9a0,_0x5e4cb6)[_0x55ee('0xc')](function(_0x3b34f7){logger[_0x55ee('0xd')](_0x55ee('0xe'),_0xc13225,_0x55ee('0xf'));logger[_0x55ee('0x10')](_0x55ee('0x11'),_0xc13225,_0x55ee('0xf'),JSON['stringify'](_0x3b34f7));if(_0x3b34f7[_0x55ee('0x12')]){if(_0x3b34f7['error'][_0x55ee('0x13')]===0x1f4){logger['error'](_0x55ee('0xe'),_0xc13225,_0x3b34f7[_0x55ee('0x12')][_0x55ee('0x14')]);return _0xf45727(_0x3b34f7[_0x55ee('0x12')]['message']);}logger[_0x55ee('0x12')](_0x55ee('0xe'),_0xc13225,_0x3b34f7['error'][_0x55ee('0x14')]);return _0x5175f0(_0x3b34f7[_0x55ee('0x12')][_0x55ee('0x14')]);}else{logger[_0x55ee('0xd')](_0x55ee('0xe'),_0xc13225,_0x55ee('0xf'));_0x5175f0(_0x3b34f7[_0x55ee('0x15')][_0x55ee('0x14')]);}})[_0x55ee('0x16')](function(_0x2f132a){logger[_0x55ee('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0xc13225,_0x2f132a);_0xf45727(_0x2f132a);});});} \ No newline at end of file +var _0xb99b=['AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','http','request','then','info','request\x20sent','debug'];(function(_0xe793ae,_0x3e33f7){var _0x1c4f1a=function(_0x25dfe9){while(--_0x25dfe9){_0xe793ae['push'](_0xe793ae['shift']());}};_0x1c4f1a(++_0x3e33f7);}(_0xb99b,0x1a9));var _0xbb99=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb99b[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xbb99('0x0'));var util=require(_0xbb99('0x1'));var moment=require('moment');var BPromise=require(_0xbb99('0x2'));var rs=require(_0xbb99('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb99('0x4'))['db'];var utils=require(_0xbb99('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xbb99('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1d9d81,_0x12b4e3,_0x26c922){return new BPromise(function(_0x25166c,_0x5ebf2b){return client[_0xbb99('0x7')](_0x1d9d81,_0x26c922)[_0xbb99('0x8')](function(_0x15f6a0){logger[_0xbb99('0x9')]('AnalyticCustomReport,\x20%s,\x20%s',_0x12b4e3,_0xbb99('0xa'));logger[_0xbb99('0xb')](_0xbb99('0xc'),_0x12b4e3,_0xbb99('0xa'),JSON[_0xbb99('0xd')](_0x15f6a0));if(_0x15f6a0['error']){if(_0x15f6a0[_0xbb99('0xe')][_0xbb99('0xf')]===0x1f4){logger[_0xbb99('0xe')](_0xbb99('0x10'),_0x12b4e3,_0x15f6a0[_0xbb99('0xe')][_0xbb99('0x11')]);return _0x5ebf2b(_0x15f6a0[_0xbb99('0xe')][_0xbb99('0x11')]);}logger[_0xbb99('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x12b4e3,_0x15f6a0['error'][_0xbb99('0x11')]);return _0x25166c(_0x15f6a0['error']['message']);}else{logger[_0xbb99('0x9')](_0xbb99('0x10'),_0x12b4e3,_0xbb99('0xa'));_0x25166c(_0x15f6a0['result']['message']);}})[_0xbb99('0x12')](function(_0x37a665){logger[_0xbb99('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x12b4e3,_0x37a665);_0x5ebf2b(_0x37a665);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 35efaf4..deeb774 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 _0x0f67=['show','preview','/:id/run','run','/:id/query','query','post','put','delete','destroy','util','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id'];(function(_0x3f0fcc,_0xa86f54){var _0x35bf77=function(_0x47a562){while(--_0x47a562){_0x3f0fcc['push'](_0x3f0fcc['shift']());}};_0x35bf77(++_0xa86f54);}(_0x0f67,0x12a));var _0x70f6=function(_0x21643d,_0x57dbc1){_0x21643d=_0x21643d-0x0;var _0xa36697=_0x0f67[_0x21643d];return _0xa36697;};'use strict';var multer=require('multer');var util=require(_0x70f6('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x70f6('0x1'));var router=express[_0x70f6('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x70f6('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x70f6('0x4'));var controller=require('./analyticCustomReport.controller');router[_0x70f6('0x5')]('/',auth[_0x70f6('0x6')](),controller['index']);router[_0x70f6('0x5')](_0x70f6('0x7'),auth[_0x70f6('0x6')](),controller[_0x70f6('0x8')]);router['get']('/:id/preview',auth[_0x70f6('0x6')](),controller[_0x70f6('0x9')]);router['get'](_0x70f6('0xa'),auth[_0x70f6('0x6')](),controller[_0x70f6('0xb')]);router[_0x70f6('0x5')](_0x70f6('0xc'),auth[_0x70f6('0x6')](),controller[_0x70f6('0xd')]);router[_0x70f6('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x70f6('0xf')](_0x70f6('0x7'),auth[_0x70f6('0x6')](),controller['update']);router[_0x70f6('0x10')]('/:id',auth[_0x70f6('0x6')](),controller[_0x70f6('0x11')]);module['exports']=router; \ No newline at end of file +var _0xcd83=['update','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','/:id','isAuthenticated','show','preview','run','/:id/query','query','post','create'];(function(_0x4ac060,_0xb5916){var _0x5de364=function(_0x435c34){while(--_0x435c34){_0x4ac060['push'](_0x4ac060['shift']());}};_0x5de364(++_0xb5916);}(_0xcd83,0x1b7));var _0x3cd8=function(_0x3e9932,_0x2404de){_0x3e9932=_0x3e9932-0x0;var _0x2f00ae=_0xcd83[_0x3e9932];return _0x2f00ae;};'use strict';var multer=require(_0x3cd8('0x0'));var util=require(_0x3cd8('0x1'));var path=require(_0x3cd8('0x2'));var timeout=require(_0x3cd8('0x3'));var express=require('express');var router=express[_0x3cd8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3cd8('0x5'));var interaction=require(_0x3cd8('0x6'));var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router[_0x3cd8('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3cd8('0x7')](_0x3cd8('0x8'),auth[_0x3cd8('0x9')](),controller[_0x3cd8('0xa')]);router[_0x3cd8('0x7')]('/:id/preview',auth[_0x3cd8('0x9')](),controller[_0x3cd8('0xb')]);router[_0x3cd8('0x7')]('/:id/run',auth['isAuthenticated'](),controller[_0x3cd8('0xc')]);router[_0x3cd8('0x7')](_0x3cd8('0xd'),auth[_0x3cd8('0x9')](),controller[_0x3cd8('0xe')]);router[_0x3cd8('0xf')]('/',auth['isAuthenticated'](),controller[_0x3cd8('0x10')]);router['put'](_0x3cd8('0x8'),auth[_0x3cd8('0x9')](),controller[_0x3cd8('0x11')]);router['delete'](_0x3cd8('0x8'),auth['isAuthenticated'](),controller[_0x3cd8('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 4d4cff2..48d1993 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 _0x24ca=['sequelize','STRING','TEXT'];(function(_0x91fbc7,_0x207e4c){var _0x32a811=function(_0x3d6a42){while(--_0x3d6a42){_0x91fbc7['push'](_0x91fbc7['shift']());}};_0x32a811(++_0x207e4c);}(_0x24ca,0x1bc));var _0xa24c=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x24ca[_0x565c49];return _0x20ca34;};'use strict';var Sequelize=require(_0xa24c('0x0'));module['exports']={'name':{'type':Sequelize[_0xa24c('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa24c('0x1')]},'parent':{'type':Sequelize[_0xa24c('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0xa24c('0x2')]},'joins':{'type':Sequelize[_0xa24c('0x2')]}}; \ 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(_0x4b4bbc,_0x25b45){_0x4b4bbc=_0x4b4bbc-0x0;var _0x30ac75=_0x1cb9[_0x4b4bbc];return _0x30ac75;};'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/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 42986d7..5a57985 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 _0xdbf5=['includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','function','replace','format','groupBy','orderBy','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','debug','Limited\x20Query:','toString','SELECT','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','IS\x20EMPTY','ValidationErrorItem','metric','DESC','clone','output','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','cdr','startDate','endDate','info','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','sequelize','QueryTypes','run','Sequelize','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','dbH','end','status','json','limit','undefined','count','set','Content-Range','reject','save','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','catch','update','join','left_join','right_join','MAX(%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)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdbf5,0x18c));var _0x5dbf=function(_0xf883f9,_0x1e6fa1){_0xf883f9=_0xf883f9-0x0;var _0x3c6e0f=_0xdbf5[_0xf883f9];return _0x3c6e0f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5dbf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5dbf('0x1'));var moment=require(_0x5dbf('0x2'));var BPromise=require(_0x5dbf('0x3'));var Mustache=require(_0x5dbf('0x4'));var util=require(_0x5dbf('0x5'));var path=require(_0x5dbf('0x6'));var sox=require(_0x5dbf('0x7'));var csv=require(_0x5dbf('0x8'));var ejs=require(_0x5dbf('0x9'));var fs=require('fs');var fs_extra=require(_0x5dbf('0xa'));var _=require(_0x5dbf('0xb'));var squel=require(_0x5dbf('0xc'));var crypto=require(_0x5dbf('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5dbf('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5dbf('0xf'));var Papa=require(_0x5dbf('0x10'));var Redis=require(_0x5dbf('0x11'));var authService=require(_0x5dbf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5dbf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5dbf('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5dbf('0x15'));var db=require('../../mysqldb')['db'];var dbH=require(_0x5dbf('0x16'))[_0x5dbf('0x17')];function respondWithStatusCode(_0x1453a9,_0x7cb848){_0x7cb848=_0x7cb848||0xcc;return function(_0x14493a){if(_0x14493a){return _0x1453a9['sendStatus'](_0x7cb848);}return _0x1453a9['status'](_0x7cb848)[_0x5dbf('0x18')]();};}function respondWithResult(_0x3480c8,_0x48e7fd){_0x48e7fd=_0x48e7fd||0xc8;return function(_0x19624e){if(_0x19624e){return _0x3480c8[_0x5dbf('0x19')](_0x48e7fd)[_0x5dbf('0x1a')](_0x19624e);}};}function respondWithFilteredResult(_0x2dfa44,_0x181816){return function(_0x472eb9){if(_0x472eb9){var _0x2d32cc=typeof _0x181816['offset']==='undefined'&&typeof _0x181816[_0x5dbf('0x1b')]===_0x5dbf('0x1c');var _0x39c7aa=_0x472eb9[_0x5dbf('0x1d')];var _0x20c2b0=_0x2d32cc?0x0:_0x181816['offset'];var _0x11cd00=_0x2d32cc?_0x472eb9['count']:_0x181816['offset']+_0x181816['limit'];var _0x23d1e7;if(_0x11cd00>=_0x39c7aa){_0x11cd00=_0x39c7aa;_0x23d1e7=0xc8;}else{_0x23d1e7=0xce;}_0x2dfa44[_0x5dbf('0x19')](_0x23d1e7);return _0x2dfa44[_0x5dbf('0x1e')](_0x5dbf('0x1f'),_0x20c2b0+'-'+_0x11cd00+'/'+_0x39c7aa)[_0x5dbf('0x1a')](_0x472eb9);}return null;};}function patchUpdates(_0x5b2518){return function(_0x2764ea){try{jsonpatch['apply'](_0x2764ea,_0x5b2518,!![]);}catch(_0xb68f92){return BPromise[_0x5dbf('0x20')](_0xb68f92);}return _0x2764ea[_0x5dbf('0x21')]();};}function saveUpdates(_0x43a612,_0x3b763c){return function(_0x2f154e){if(_0x2f154e){return _0x2f154e['update'](_0x43a612)[_0x5dbf('0x22')](function(_0x3e3a2d){return _0x3e3a2d;});}return null;};}function removeEntity(_0x2d3e1b,_0x2079fc){return function(_0x2763ec){if(_0x2763ec){return _0x2763ec[_0x5dbf('0x23')]()[_0x5dbf('0x22')](function(){var _0x20ab1b=_0x2763ec[_0x5dbf('0x24')]({'plain':!![]});var _0x15a790=_0x5dbf('0x25');return db[_0x5dbf('0x26')][_0x5dbf('0x23')]({'where':{'type':_0x15a790,'resourceId':_0x20ab1b['id']}})[_0x5dbf('0x22')](function(){return _0x2763ec;});})[_0x5dbf('0x22')](function(){_0x2d3e1b[_0x5dbf('0x19')](0xcc)[_0x5dbf('0x18')]();});}};}function handleEntityNotFound(_0x3f8341,_0x159e61){return function(_0x22ec42){if(!_0x22ec42){_0x3f8341[_0x5dbf('0x27')](0x194);}return _0x22ec42;};}function handleError(_0x471027,_0x21cd00){_0x21cd00=_0x21cd00||0x1f4;return function(_0x5768b7){logger[_0x5dbf('0x28')](_0x5768b7[_0x5dbf('0x29')]);if(_0x5768b7[_0x5dbf('0x2a')]){delete _0x5768b7[_0x5dbf('0x2a')];}_0x471027[_0x5dbf('0x19')](_0x21cd00)[_0x5dbf('0x2b')](_0x5768b7);};}exports[_0x5dbf('0x2c')]=function(_0x31d57a,_0x406ce6){var _0x273b63={},_0x294dd7={},_0x50a307={'count':0x0,'rows':[]};var _0x4c1587=_[_0x5dbf('0x2d')](db[_0x5dbf('0x2e')][_0x5dbf('0x2f')],function(_0x3b73ad){return{'name':_0x3b73ad[_0x5dbf('0x30')],'type':_0x3b73ad['type']['key']};});_0x294dd7[_0x5dbf('0x31')]=_[_0x5dbf('0x2d')](_0x4c1587,'name');_0x294dd7[_0x5dbf('0x32')]=_[_0x5dbf('0x33')](_0x31d57a[_0x5dbf('0x32')]);_0x294dd7[_0x5dbf('0x34')]=_[_0x5dbf('0x35')](_0x294dd7['model'],_0x294dd7[_0x5dbf('0x32')]);_0x273b63[_0x5dbf('0x36')]=_[_0x5dbf('0x35')](_0x294dd7[_0x5dbf('0x31')],qs[_0x5dbf('0x37')](_0x31d57a['query'][_0x5dbf('0x37')]));_0x273b63[_0x5dbf('0x36')]=_0x273b63[_0x5dbf('0x36')][_0x5dbf('0x38')]?_0x273b63['attributes']:_0x294dd7[_0x5dbf('0x31')];if(!_0x31d57a[_0x5dbf('0x32')][_0x5dbf('0x39')](_0x5dbf('0x3a'))){_0x273b63[_0x5dbf('0x1b')]=qs[_0x5dbf('0x1b')](_0x31d57a[_0x5dbf('0x32')][_0x5dbf('0x1b')]);_0x273b63[_0x5dbf('0x3b')]=qs[_0x5dbf('0x3b')](_0x31d57a[_0x5dbf('0x32')]['offset']);}_0x273b63[_0x5dbf('0x3c')]=qs[_0x5dbf('0x3d')](_0x31d57a[_0x5dbf('0x32')]['sort']);_0x273b63[_0x5dbf('0x3e')]=qs[_0x5dbf('0x34')](_[_0x5dbf('0x3f')](_0x31d57a['query'],_0x294dd7[_0x5dbf('0x34')]),_0x4c1587);if(_0x31d57a[_0x5dbf('0x32')][_0x5dbf('0x40')]){_0x273b63['where']=_[_0x5dbf('0x41')](_0x273b63[_0x5dbf('0x3e')],{'$or':_[_0x5dbf('0x2d')](_0x4c1587,function(_0x260c9f){if(_0x260c9f[_0x5dbf('0x42')]!==_0x5dbf('0x43')){var _0x321ae3={};_0x321ae3[_0x260c9f[_0x5dbf('0x2a')]]={'$like':'%'+_0x31d57a['query']['filter']+'%'};return _0x321ae3;}})});}_0x273b63=_['merge']({},_0x273b63,_0x31d57a['options']);var _0x28b28f={'where':_0x273b63[_0x5dbf('0x3e')]};return db['AnalyticDefaultReport'][_0x5dbf('0x1d')](_0x28b28f)[_0x5dbf('0x22')](function(_0x5a60e8){_0x50a307[_0x5dbf('0x1d')]=_0x5a60e8;if(_0x31d57a[_0x5dbf('0x32')][_0x5dbf('0x44')]){_0x273b63[_0x5dbf('0x45')]=[{'all':!![]}];}return db[_0x5dbf('0x2e')][_0x5dbf('0x46')](_0x273b63);})[_0x5dbf('0x22')](function(_0x1c020a){_0x50a307[_0x5dbf('0x47')]=_0x1c020a;return _0x50a307;})[_0x5dbf('0x22')](respondWithFilteredResult(_0x406ce6,_0x273b63))['catch'](handleError(_0x406ce6,null));};exports[_0x5dbf('0x48')]=function(_0x22f958,_0xec1d28){var _0x50880d={'raw':!![],'where':{'id':_0x22f958[_0x5dbf('0x49')]['id']}},_0x16b0ff={};_0x16b0ff[_0x5dbf('0x31')]=_[_0x5dbf('0x33')](db['AnalyticDefaultReport'][_0x5dbf('0x2f')]);_0x16b0ff['query']=_[_0x5dbf('0x33')](_0x22f958[_0x5dbf('0x32')]);_0x16b0ff[_0x5dbf('0x34')]=_[_0x5dbf('0x35')](_0x16b0ff['model'],_0x16b0ff['query']);_0x50880d[_0x5dbf('0x36')]=_[_0x5dbf('0x35')](_0x16b0ff[_0x5dbf('0x31')],qs['fields'](_0x22f958[_0x5dbf('0x32')]['fields']));_0x50880d['attributes']=_0x50880d['attributes']['length']?_0x50880d[_0x5dbf('0x36')]:_0x16b0ff[_0x5dbf('0x31')];if(_0x22f958['query'][_0x5dbf('0x44')]){_0x50880d[_0x5dbf('0x45')]=[{'all':!![]}];}_0x50880d=_['merge']({},_0x50880d,_0x22f958[_0x5dbf('0x4a')]);return db[_0x5dbf('0x2e')]['find'](_0x50880d)[_0x5dbf('0x22')](handleEntityNotFound(_0xec1d28,null))['then'](respondWithResult(_0xec1d28,null))['catch'](handleError(_0xec1d28,null));};exports[_0x5dbf('0x4b')]=function(_0x2a3d30,_0x17a1c0){return db['AnalyticDefaultReport']['create'](_0x2a3d30[_0x5dbf('0x4c')],{})[_0x5dbf('0x22')](function(_0x21f477){var _0x307a00=_0x2a3d30[_0x5dbf('0x4d')][_0x5dbf('0x24')]({'plain':!![]});if(!_0x307a00)throw new Error(_0x5dbf('0x4e'));if(_0x307a00[_0x5dbf('0x4f')]==='user'){var _0x3f38a0=_0x21f477[_0x5dbf('0x24')]({'plain':!![]});var _0x2927a3=_0x5dbf('0x50');return db[_0x5dbf('0x51')][_0x5dbf('0x52')]({'where':{'name':_0x2927a3,'userProfileId':_0x307a00[_0x5dbf('0x53')]},'raw':!![]})['then'](function(_0x1b0b13){if(_0x1b0b13&&_0x1b0b13['autoAssociation']===0x0){return db[_0x5dbf('0x26')][_0x5dbf('0x4b')]({'name':_0x3f38a0[_0x5dbf('0x2a')],'resourceId':_0x3f38a0['id'],'type':_0x5dbf('0x25'),'sectionId':_0x1b0b13['id']},{})[_0x5dbf('0x22')](function(){return _0x21f477;});}else{return _0x21f477;}})[_0x5dbf('0x54')](function(_0x353d0f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x353d0f);throw _0x353d0f;});}return _0x21f477;})['then'](respondWithResult(_0x17a1c0,0xc9))[_0x5dbf('0x54')](handleError(_0x17a1c0,null));};exports[_0x5dbf('0x55')]=function(_0x36a787,_0x56c8b2){if(_0x36a787['body']['id']){delete _0x36a787[_0x5dbf('0x4c')]['id'];}return db[_0x5dbf('0x2e')][_0x5dbf('0x52')]({'where':{'id':_0x36a787['params']['id']}})[_0x5dbf('0x22')](handleEntityNotFound(_0x56c8b2,null))['then'](saveUpdates(_0x36a787[_0x5dbf('0x4c')],null))[_0x5dbf('0x22')](respondWithResult(_0x56c8b2,null))[_0x5dbf('0x54')](handleError(_0x56c8b2,null));};exports['destroy']=function(_0x55fd51,_0x1b316d){return db[_0x5dbf('0x2e')][_0x5dbf('0x52')]({'where':{'id':_0x55fd51[_0x5dbf('0x49')]['id']}})['then'](handleEntityNotFound(_0x1b316d,null))[_0x5dbf('0x22')](removeEntity(_0x1b316d,null))[_0x5dbf('0x54')](handleError(_0x1b316d,null));};exports['preview']=function(_0x5485f3,_0x19ec03){var _0x14bdb1=0xa;var _0x197e8c=[_0x5dbf('0x56'),_0x5dbf('0x57'),_0x5dbf('0x58'),'cross_join'];var _0x4107f1={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x5dbf('0x59'),'MIN':'MIN(%s)','AVG':_0x5dbf('0x5a'),'GROUP_CONCAT':_0x5dbf('0x5b'),'GROUP_CONCAT ASC':_0x5dbf('0x5c'),'GROUP_CONCAT DESC':_0x5dbf('0x5d')};var _0x461ffb={'SEC_TO_TIME':_0x5dbf('0x5e'),'DATE':_0x5dbf('0x5f'),'HOUR':_0x5dbf('0x60'),'ROUND':_0x5dbf('0x61'),'UNIX_TIMESTAMP':_0x5dbf('0x62')};var _0x3a84c2=function(_0x2ca889){return!_[_0x5dbf('0x63')]([_0x5dbf('0x64'),_0x5dbf('0x65'),'IS\x20EMPTY',_0x5dbf('0x66')],_0x2ca889);};var _0x553be4=function(_0xb0a9bf){if(!_0xb0a9bf||!_0xb0a9bf[_0x5dbf('0x67')][_0x5dbf('0x38')]){return'';}for(var _0x110224='(',_0x5a975a=0x0;_0x5a975a<_0xb0a9bf[_0x5dbf('0x67')][_0x5dbf('0x38')];_0x5a975a+=0x1){_0x5a975a>0x0&&(_0x110224+='\x20'+_0xb0a9bf[_0x5dbf('0x68')]+'\x20');_0x110224+=_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a][_0x5dbf('0x69')]?_0x553be4(_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a]['group']):_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a][_0x5dbf('0x6a')]+'\x20'+_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a][_0x5dbf('0x6b')]+(_0x3a84c2(_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a][_0x5dbf('0x6b')])?'\x20'+_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a][_0x5dbf('0x6c')]:'');}return _0x110224+')';};var _0x12d69b={'where':{'id':_0x5485f3[_0x5dbf('0x49')]['id']}},_0x3b53da,_0x13c8ab,_0x2997a8,_0x5d7a37,_0x52109d;_0x12d69b=_[_0x5dbf('0x41')]({},_0x12d69b,_0x5485f3[_0x5dbf('0x4a')]);return db[_0x5dbf('0x2e')][_0x5dbf('0x52')](_0x12d69b)[_0x5dbf('0x22')](function(_0x1b42cf){if(_0x1b42cf){_0x3b53da=_0x1b42cf;return _0x1b42cf[_0x5dbf('0x6d')]();}return null;})[_0x5dbf('0x22')](function(_0x57c568){if(_0x57c568){if(!_0x57c568['length']){throw new db['Sequelize']['ValidationErrorItem'](_0x5dbf('0x6e'),0x193);}_0x13c8ab=_0x57c568;return db[_0x5dbf('0x6f')][_0x5dbf('0x46')]({'raw':!![]});}return null;})[_0x5dbf('0x22')](function(_0x29c4d9){if(_0x29c4d9){_0x2997a8=_[_0x5dbf('0x70')](_0x29c4d9,'id');var _0x5331ff;var _0x5bb990=squel[_0x5dbf('0x71')]();_0x5bb990[_0x5dbf('0x72')](_0x3b53da['table']);for(var _0x1728b9=0x0;_0x1728b9<_0x13c8ab[_0x5dbf('0x38')];_0x1728b9+=0x1){_0x5331ff=_0x13c8ab[_0x1728b9][_0x5dbf('0x73')]?_0x2997a8[_0x13c8ab[_0x1728b9][_0x5dbf('0x73')]]['metric']:_0x13c8ab[_0x1728b9][_0x5dbf('0x6a')];_0x5331ff=_0x13c8ab[_0x1728b9][_0x5dbf('0x74')]?_[_0x5dbf('0x75')](_0x4107f1[_0x13c8ab[_0x1728b9][_0x5dbf('0x74')]],'%s',_0x5331ff):_0x5331ff;_0x5331ff=_0x13c8ab[_0x1728b9][_0x5dbf('0x76')]?_['replace'](_0x461ffb[_0x13c8ab[_0x1728b9][_0x5dbf('0x76')]],'%s',_0x5331ff):_0x5331ff;if(_0x13c8ab[_0x1728b9][_0x5dbf('0x77')]){_0x5bb990[_0x5dbf('0x69')](_0x5331ff);}_0x13c8ab[_0x1728b9][_0x5dbf('0x78')]&&_0x5bb990['order'](_0x5331ff,_0x13c8ab[_0x1728b9][_0x5dbf('0x78')]==='DESC'?![]:!![]);_0x5bb990[_0x5dbf('0x6a')](_0x5331ff,_0x13c8ab[_0x1728b9][_0x5dbf('0x79')]||_0x5331ff);}if(_0x3b53da[_0x5dbf('0x7a')]){_0x3b53da['joins']=JSON[_0x5dbf('0x7b')](_0x3b53da[_0x5dbf('0x7a')]);for(var _0x4166ce=0x0;_0x4166ce<_0x3b53da[_0x5dbf('0x7a')]['length'];_0x4166ce+=0x1){if(_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x42')]&&_[_0x5dbf('0x63')](_0x197e8c,_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x42')])&&_0x3b53da[_0x5dbf('0x7a')][_0x4166ce]['parentKey']&&_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x7c')]&&_0x3b53da['joins'][_0x4166ce][_0x5dbf('0x7d')]){_0x5bb990[_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x42')]](_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x7c')],null,util[_0x5dbf('0x76')](_0x5dbf('0x7e'),_0x3b53da[_0x5dbf('0x7f')],_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x80')],_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x7c')],_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x7d')]));}}}if(_0x3b53da[_0x5dbf('0x81')]){_0x3b53da[_0x5dbf('0x81')]=JSON['parse'](_0x3b53da[_0x5dbf('0x81')]);_0x5bb990[_0x5dbf('0x3e')](_0x553be4(_0x3b53da[_0x5dbf('0x81')][_0x5dbf('0x69')]));}_0x52109d=_0x5bb990['clone']();_0x5bb990[_0x5dbf('0x1b')](_0x14bdb1);_0x5bb990[_0x5dbf('0x3b')](0x0);logger[_0x5dbf('0x82')](_0x5dbf('0x83'),_0x5bb990[_0x5dbf('0x84')]());return dbH['sequelize'][_0x5dbf('0x32')](_0x5bb990[_0x5dbf('0x84')](),{'type':dbH['sequelize']['QueryTypes'][_0x5dbf('0x85')]});}})[_0x5dbf('0x22')](respondWithResult(_0x19ec03,null))[_0x5dbf('0x54')](handleError(_0x19ec03,null));};function runReport(_0x8ca7de,_0x14b21b,_0x23ec75){var _0x22339b=_0x14b21b['name'];var _0x310078=0xa;var _0x3b01c0=[_0x5dbf('0x56'),_0x5dbf('0x57'),_0x5dbf('0x58'),_0x5dbf('0x86')];var _0x4cceb1={'SUM':_0x5dbf('0x87'),'COUNT':_0x5dbf('0x88'),'COUNT DISTINCT':_0x5dbf('0x89'),'MAX':_0x5dbf('0x59'),'MIN':_0x5dbf('0x8a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x5dbf('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5924d2={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x5dbf('0x5f'),'HOUR':_0x5dbf('0x60'),'ROUND':_0x5dbf('0x61'),'UNIX_TIMESTAMP':_0x5dbf('0x62')};var _0x4333db=function(_0x4cb92d){return!_['includes']([_0x5dbf('0x64'),'IS\x20NOT\x20NULL',_0x5dbf('0x8b'),_0x5dbf('0x66')],_0x4cb92d);};var _0x541241=function(_0x3c7eaa){if(!_0x3c7eaa||!_0x3c7eaa['rules'][_0x5dbf('0x38')]){return'';}for(var _0x24d90a='(',_0xa3e94f=0x0;_0xa3e94f<_0x3c7eaa[_0x5dbf('0x67')][_0x5dbf('0x38')];_0xa3e94f+=0x1){_0xa3e94f>0x0&&(_0x24d90a+='\x20'+_0x3c7eaa['operator']+'\x20');_0x24d90a+=_0x3c7eaa[_0x5dbf('0x67')][_0xa3e94f][_0x5dbf('0x69')]?_0x541241(_0x3c7eaa[_0x5dbf('0x67')][_0xa3e94f][_0x5dbf('0x69')]):_0x3c7eaa['rules'][_0xa3e94f][_0x5dbf('0x6a')]+'\x20'+_0x3c7eaa[_0x5dbf('0x67')][_0xa3e94f][_0x5dbf('0x6b')]+(_0x4333db(_0x3c7eaa[_0x5dbf('0x67')][_0xa3e94f][_0x5dbf('0x6b')])?'\x20'+_0x3c7eaa[_0x5dbf('0x67')][_0xa3e94f][_0x5dbf('0x6c')]:'');}return _0x24d90a+')';};var _0x334f63={'where':{'id':_0x8ca7de['id']}},_0x5ac29f,_0x533fdd,_0x5bf068,_0x1bd06b,_0x274497;_0x334f63=_['merge']({},_0x334f63,_0x23ec75);return db['AnalyticDefaultReport']['find'](_0x334f63)[_0x5dbf('0x22')](function(_0x20bda9){if(_0x20bda9){_0x5ac29f=_0x20bda9;return _0x20bda9[_0x5dbf('0x6d')]();}return null;})[_0x5dbf('0x22')](function(_0x12757d){if(_0x12757d){if(!_0x12757d[_0x5dbf('0x38')]){throw new db['Sequelize'][(_0x5dbf('0x8c'))](_0x5dbf('0x6e'),0x193);}_0x533fdd=_0x12757d;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x5dbf('0x22')](function(_0x5722b3){if(_0x5722b3){_0x5bf068=_['keyBy'](_0x5722b3,'id');var _0x3a27c4;var _0x3620d2=squel[_0x5dbf('0x71')]();_0x3620d2['from'](_0x5ac29f[_0x5dbf('0x7f')]);for(var _0x447259=0x0;_0x447259<_0x533fdd['length'];_0x447259+=0x1){_0x3a27c4=_0x533fdd[_0x447259][_0x5dbf('0x73')]?_0x5bf068[_0x533fdd[_0x447259][_0x5dbf('0x73')]][_0x5dbf('0x8d')]:_0x533fdd[_0x447259][_0x5dbf('0x6a')];_0x3a27c4=_0x533fdd[_0x447259][_0x5dbf('0x74')]?_[_0x5dbf('0x75')](_0x4cceb1[_0x533fdd[_0x447259][_0x5dbf('0x74')]],'%s',_0x3a27c4):_0x3a27c4;_0x3a27c4=_0x533fdd[_0x447259][_0x5dbf('0x76')]?_['replace'](_0x5924d2[_0x533fdd[_0x447259]['format']],'%s',_0x3a27c4):_0x3a27c4;if(_0x533fdd[_0x447259]['groupBy']){_0x3620d2[_0x5dbf('0x69')](_0x3a27c4);}_0x533fdd[_0x447259][_0x5dbf('0x78')]&&_0x3620d2[_0x5dbf('0x3c')](_0x3a27c4,_0x533fdd[_0x447259][_0x5dbf('0x78')]===_0x5dbf('0x8e')?![]:!![]);_0x3620d2[_0x5dbf('0x6a')](_0x3a27c4,_0x533fdd[_0x447259][_0x5dbf('0x79')]||_0x3a27c4);}if(_0x5ac29f[_0x5dbf('0x7a')]){_0x5ac29f[_0x5dbf('0x7a')]=JSON[_0x5dbf('0x7b')](_0x5ac29f['joins']);for(var _0x2ded2b=0x0;_0x2ded2b<_0x5ac29f[_0x5dbf('0x7a')][_0x5dbf('0x38')];_0x2ded2b+=0x1){if(_0x5ac29f[_0x5dbf('0x7a')][_0x2ded2b][_0x5dbf('0x42')]&&_[_0x5dbf('0x63')](_0x3b01c0,_0x5ac29f[_0x5dbf('0x7a')][_0x2ded2b][_0x5dbf('0x42')])&&_0x5ac29f['joins'][_0x2ded2b]['parentKey']&&_0x5ac29f[_0x5dbf('0x7a')][_0x2ded2b]['foreignTable']&&_0x5ac29f['joins'][_0x2ded2b][_0x5dbf('0x7d')]){_0x3620d2[_0x5ac29f['joins'][_0x2ded2b]['type']](_0x5ac29f['joins'][_0x2ded2b]['foreignTable'],null,util[_0x5dbf('0x76')]('%s.%s\x20=\x20%s.%s',_0x5ac29f[_0x5dbf('0x7f')],_0x5ac29f[_0x5dbf('0x7a')][_0x2ded2b][_0x5dbf('0x80')],_0x5ac29f['joins'][_0x2ded2b][_0x5dbf('0x7c')],_0x5ac29f[_0x5dbf('0x7a')][_0x2ded2b][_0x5dbf('0x7d')]));}}}if(_0x5ac29f['conditions']){_0x5ac29f[_0x5dbf('0x81')]=JSON[_0x5dbf('0x7b')](_0x5ac29f[_0x5dbf('0x81')]);_0x3620d2['where'](_0x541241(_0x5ac29f[_0x5dbf('0x81')][_0x5dbf('0x69')]));}_0x274497=_0x3620d2[_0x5dbf('0x8f')]();_0x3620d2['limit'](_0x310078);_0x3620d2[_0x5dbf('0x3b')](0x0);return;}})[_0x5dbf('0x22')](function(){if(_0x14b21b[_0x5dbf('0x90')]==='web'){return null;}var _0x48a8c5=_['merge'](_0x14b21b,{'name':_0x14b21b[_0x5dbf('0x91')]||_0x14b21b[_0x5dbf('0x2a')]||_0x5ac29f[_0x5dbf('0x2a')],'basename':_0x22339b,'savename':util[_0x5dbf('0x76')](_0x5dbf('0x92'),_0x14b21b[_0x5dbf('0x2a')]||_0x5ac29f['name'],require(_0x5dbf('0x93'))[_0x5dbf('0x94')](0x4),_0x14b21b[_0x5dbf('0x90')]||'csv'),'reportId':_0x5ac29f['id'],'reportType':_0x5dbf('0x95')});return db[_0x5dbf('0x96')][_0x5dbf('0x4b')](_0x48a8c5,{'raw':!![]});})[_0x5dbf('0x22')](function(_0x2afbd4){if(_0x5ac29f[_0x5dbf('0x7f')]===_0x5dbf('0x97')){_0x274497['where'](_0x5ac29f[_0x5dbf('0x7f')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x14b21b[_0x5dbf('0x98')],_0x14b21b[_0x5dbf('0x99')]);}else{_0x274497[_0x5dbf('0x3e')](_0x5ac29f['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x14b21b['startDate'],_0x14b21b[_0x5dbf('0x99')]);}if(_0x2afbd4){logger[_0x5dbf('0x9a')]('Run\x20Query:',_0x274497[_0x5dbf('0x84')]());require('child_process')[_0x5dbf('0x9b')](path[_0x5dbf('0x56')](__dirname,_0x5dbf('0x9c'),_0x2afbd4['output']),[_0x2afbd4['id'],_0x274497[_0x5dbf('0x84')](),path[_0x5dbf('0x56')](__dirname,_0x5dbf('0x9d'),_0x2afbd4[_0x5dbf('0x9e')]),_0x22339b]);return _0x2afbd4;}else{var _0x4bc5af=squel[_0x5dbf('0x71')]();_0x4bc5af[_0x5dbf('0x72')]('('+_0x274497['toString']()+')',_0x5dbf('0x9f'));_0x4bc5af['field'](_0x5dbf('0xa0'),_0x5dbf('0x1d'));_0x274497[_0x5dbf('0x1b')](_0x14b21b['limit']||_0x310078);_0x274497[_0x5dbf('0x3b')](_0x14b21b[_0x5dbf('0x3b')]||0x0);return dbH[_0x5dbf('0xa1')][_0x5dbf('0x32')](_0x4bc5af[_0x5dbf('0x84')](),{'type':dbH[_0x5dbf('0xa1')]['QueryTypes'][_0x5dbf('0x85')]})['then'](function(_0x6cfb82){if(!_0x6cfb82[_0x5dbf('0x38')]){_0x1bd06b=0x0;}else{_0x1bd06b=_0x6cfb82[0x0][_0x5dbf('0x1d')]||0x0;}return dbH[_0x5dbf('0xa1')][_0x5dbf('0x32')](_0x274497[_0x5dbf('0x84')](),{'type':dbH['sequelize'][_0x5dbf('0xa2')][_0x5dbf('0x85')]});})[_0x5dbf('0x22')](function(_0x4d68f6){return{'rows':_0x4d68f6||[],'count':_0x1bd06b};});}});}exports[_0x5dbf('0xa3')]=function(_0x47ac95,_0x51b241){return runReport(_0x47ac95[_0x5dbf('0x49')],_0x47ac95[_0x5dbf('0x32')],_0x47ac95[_0x5dbf('0x4a')])[_0x5dbf('0x22')](respondWithResult(_0x51b241,null))[_0x5dbf('0x54')](handleError(_0x51b241,null));};exports['runReport']=runReport;exports['query']=function(_0x4f38a0,_0x144300){var _0x1da1e3=0xa;var _0x25e681=[_0x5dbf('0x56'),_0x5dbf('0x57'),_0x5dbf('0x58'),_0x5dbf('0x86')];var _0x236754={'SUM':'SUM(%s)','COUNT':_0x5dbf('0x88'),'COUNT DISTINCT':_0x5dbf('0x89'),'MAX':_0x5dbf('0x59'),'MIN':_0x5dbf('0x8a'),'AVG':_0x5dbf('0x5a'),'GROUP_CONCAT':_0x5dbf('0x5b'),'GROUP_CONCAT ASC':_0x5dbf('0x5c'),'GROUP_CONCAT DESC':_0x5dbf('0x5d')};var _0x191a16={'SEC_TO_TIME':_0x5dbf('0x5e'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5dbf('0x62')};var _0x51b0df=function(_0x48ea8a){return!_['includes']([_0x5dbf('0x64'),_0x5dbf('0x65'),_0x5dbf('0x8b'),_0x5dbf('0x66')],_0x48ea8a);};var _0x3de263=function(_0x4f8dde){if(!_0x4f8dde||!_0x4f8dde[_0x5dbf('0x67')][_0x5dbf('0x38')]){return'';}for(var _0x19effa='(',_0x29177e=0x0;_0x29177e<_0x4f8dde[_0x5dbf('0x67')]['length'];_0x29177e+=0x1){_0x29177e>0x0&&(_0x19effa+='\x20'+_0x4f8dde[_0x5dbf('0x68')]+'\x20');_0x19effa+=_0x4f8dde[_0x5dbf('0x67')][_0x29177e][_0x5dbf('0x69')]?_0x3de263(_0x4f8dde[_0x5dbf('0x67')][_0x29177e]['group']):_0x4f8dde[_0x5dbf('0x67')][_0x29177e][_0x5dbf('0x6a')]+'\x20'+_0x4f8dde[_0x5dbf('0x67')][_0x29177e][_0x5dbf('0x6b')]+(_0x51b0df(_0x4f8dde[_0x5dbf('0x67')][_0x29177e][_0x5dbf('0x6b')])?'\x20'+_0x4f8dde[_0x5dbf('0x67')][_0x29177e]['value']:'');}return _0x19effa+')';};var _0x4899ac={'where':{'id':_0x4f38a0['params']['id']}},_0x51864c,_0x4562a4,_0x240304,_0x5df275,_0xc588a2;_0x4899ac=_[_0x5dbf('0x41')]({},_0x4899ac,_0x4f38a0['options']);return db[_0x5dbf('0x2e')][_0x5dbf('0x52')](_0x4899ac)[_0x5dbf('0x22')](function(_0x2eafe0){if(_0x2eafe0){_0x51864c=_0x2eafe0;return _0x2eafe0[_0x5dbf('0x6d')]();}return null;})[_0x5dbf('0x22')](function(_0x414859){if(_0x414859){if(!_0x414859['length']){throw new db[(_0x5dbf('0xa4'))][(_0x5dbf('0x8c'))](_0x5dbf('0x6e'),0x193);}_0x4562a4=_0x414859;return db[_0x5dbf('0x6f')][_0x5dbf('0x46')]({'raw':!![]});}return null;})[_0x5dbf('0x22')](function(_0x153401){if(_0x153401){_0x240304=_[_0x5dbf('0x70')](_0x153401,'id');var _0xbe0ca0;var _0x521c72=squel[_0x5dbf('0x71')]();_0x521c72[_0x5dbf('0x72')](_0x51864c[_0x5dbf('0x7f')]);for(var _0x6b4262=0x0;_0x6b4262<_0x4562a4[_0x5dbf('0x38')];_0x6b4262+=0x1){_0xbe0ca0=_0x4562a4[_0x6b4262][_0x5dbf('0x73')]?_0x240304[_0x4562a4[_0x6b4262][_0x5dbf('0x73')]][_0x5dbf('0x8d')]:_0x4562a4[_0x6b4262][_0x5dbf('0x6a')];_0xbe0ca0=_0x4562a4[_0x6b4262][_0x5dbf('0x74')]?_[_0x5dbf('0x75')](_0x236754[_0x4562a4[_0x6b4262][_0x5dbf('0x74')]],'%s',_0xbe0ca0):_0xbe0ca0;_0xbe0ca0=_0x4562a4[_0x6b4262][_0x5dbf('0x76')]?_[_0x5dbf('0x75')](_0x191a16[_0x4562a4[_0x6b4262][_0x5dbf('0x76')]],'%s',_0xbe0ca0):_0xbe0ca0;if(_0x4562a4[_0x6b4262][_0x5dbf('0x77')]){_0x521c72[_0x5dbf('0x69')](_0xbe0ca0);}_0x4562a4[_0x6b4262][_0x5dbf('0x78')]&&_0x521c72[_0x5dbf('0x3c')](_0xbe0ca0,_0x4562a4[_0x6b4262]['orderBy']===_0x5dbf('0x8e')?![]:!![]);_0x521c72['field'](_0xbe0ca0,_0x4562a4[_0x6b4262][_0x5dbf('0x79')]||_0xbe0ca0);}if(_0x51864c['joins']){_0x51864c[_0x5dbf('0x7a')]=JSON['parse'](_0x51864c[_0x5dbf('0x7a')]);for(var _0x417869=0x0;_0x417869<_0x51864c[_0x5dbf('0x7a')]['length'];_0x417869+=0x1){if(_0x51864c[_0x5dbf('0x7a')][_0x417869][_0x5dbf('0x42')]&&_[_0x5dbf('0x63')](_0x25e681,_0x51864c[_0x5dbf('0x7a')][_0x417869][_0x5dbf('0x42')])&&_0x51864c[_0x5dbf('0x7a')][_0x417869][_0x5dbf('0x80')]&&_0x51864c['joins'][_0x417869][_0x5dbf('0x7c')]&&_0x51864c[_0x5dbf('0x7a')][_0x417869]['foreignKey']){_0x521c72[_0x51864c[_0x5dbf('0x7a')][_0x417869]['type']](_0x51864c['joins'][_0x417869][_0x5dbf('0x7c')],null,util[_0x5dbf('0x76')]('%s.%s\x20=\x20%s.%s',_0x51864c[_0x5dbf('0x7f')],_0x51864c['joins'][_0x417869]['parentKey'],_0x51864c[_0x5dbf('0x7a')][_0x417869]['foreignTable'],_0x51864c[_0x5dbf('0x7a')][_0x417869][_0x5dbf('0x7d')]));}}}if(_0x51864c[_0x5dbf('0x81')]){_0x51864c[_0x5dbf('0x81')]=JSON[_0x5dbf('0x7b')](_0x51864c[_0x5dbf('0x81')]);_0x521c72[_0x5dbf('0x3e')](_0x3de263(_0x51864c[_0x5dbf('0x81')][_0x5dbf('0x69')]));}_0xc588a2=_0x521c72[_0x5dbf('0x8f')]();_0x521c72[_0x5dbf('0x1b')](_0x1da1e3);_0x521c72[_0x5dbf('0x3b')](0x0);logger[_0x5dbf('0x82')]('Limited\x20Query:',_0x521c72[_0x5dbf('0x84')]());return dbH[_0x5dbf('0xa1')][_0x5dbf('0x32')](_0x521c72[_0x5dbf('0x84')](),{'type':dbH[_0x5dbf('0xa1')][_0x5dbf('0xa2')]['SELECT']});}})[_0x5dbf('0x22')](function(){return{'sql':_0xc588a2[_0x5dbf('0x84')]()};})[_0x5dbf('0x22')](respondWithResult(_0x144300,null))[_0x5dbf('0x54')](handleError(_0x144300,null));}; \ No newline at end of file +var _0x687b=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','sendStatus','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','options','findAll','catch','params','intersection','includeAll','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','merge','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SUM(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ValidationErrorItem','DESC','parentKey','web','fullPath','%s-%s.%s','output','csv','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','cross_join','%s.%s\x20=\x20%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x687b,0x14a));var _0xb687=function(_0x30f2d1,_0x5710ac){_0x30f2d1=_0x30f2d1-0x0;var _0x44605d=_0x687b[_0x30f2d1];return _0x44605d;};'use strict';var emlformat=require(_0xb687('0x0'));var rimraf=require(_0xb687('0x1'));var zipdir=require(_0xb687('0x2'));var jsonpatch=require(_0xb687('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb687('0x4'));var Mustache=require(_0xb687('0x5'));var util=require(_0xb687('0x6'));var path=require(_0xb687('0x7'));var sox=require(_0xb687('0x8'));var csv=require(_0xb687('0x9'));var ejs=require(_0xb687('0xa'));var fs=require('fs');var fs_extra=require(_0xb687('0xb'));var _=require(_0xb687('0xc'));var squel=require(_0xb687('0xd'));var crypto=require('crypto');var jsforce=require(_0xb687('0xe'));var deskjs=require(_0xb687('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb687('0x10'));var Papa=require(_0xb687('0x11'));var Redis=require(_0xb687('0x12'));var authService=require(_0xb687('0x13'));var qs=require(_0xb687('0x14'));var as=require(_0xb687('0x15'));var hardwareService=require(_0xb687('0x16'));var logger=require(_0xb687('0x17'))(_0xb687('0x18'));var utils=require('../../config/utils');var config=require(_0xb687('0x19'));var licenseUtil=require(_0xb687('0x1a'));var db=require(_0xb687('0x1b'))['db'];var dbH=require(_0xb687('0x1b'))['dbH'];function respondWithStatusCode(_0x4c97ed,_0x3e85b3){_0x3e85b3=_0x3e85b3||0xcc;return function(_0x155ebe){if(_0x155ebe){return _0x4c97ed['sendStatus'](_0x3e85b3);}return _0x4c97ed[_0xb687('0x1c')](_0x3e85b3)[_0xb687('0x1d')]();};}function respondWithResult(_0x1f1f35,_0x30d502){_0x30d502=_0x30d502||0xc8;return function(_0x838dd4){if(_0x838dd4){return _0x1f1f35[_0xb687('0x1c')](_0x30d502)[_0xb687('0x1e')](_0x838dd4);}};}function respondWithFilteredResult(_0x141375,_0x263085){return function(_0x2c7a18){if(_0x2c7a18){var _0x25124a=typeof _0x263085[_0xb687('0x1f')]==='undefined'&&typeof _0x263085[_0xb687('0x20')]===_0xb687('0x21');var _0x30d370=_0x2c7a18['count'];var _0x48958d=_0x25124a?0x0:_0x263085[_0xb687('0x1f')];var _0x3a10ef=_0x25124a?_0x2c7a18[_0xb687('0x22')]:_0x263085['offset']+_0x263085[_0xb687('0x20')];var _0x481f1d;if(_0x3a10ef>=_0x30d370){_0x3a10ef=_0x30d370;_0x481f1d=0xc8;}else{_0x481f1d=0xce;}_0x141375[_0xb687('0x1c')](_0x481f1d);return _0x141375[_0xb687('0x23')](_0xb687('0x24'),_0x48958d+'-'+_0x3a10ef+'/'+_0x30d370)[_0xb687('0x1e')](_0x2c7a18);}return null;};}function patchUpdates(_0x49d5a1){return function(_0x3a73d5){try{jsonpatch['apply'](_0x3a73d5,_0x49d5a1,!![]);}catch(_0x335541){return BPromise[_0xb687('0x25')](_0x335541);}return _0x3a73d5[_0xb687('0x26')]();};}function saveUpdates(_0x546fde,_0x1dc06b){return function(_0x491623){if(_0x491623){return _0x491623[_0xb687('0x27')](_0x546fde)[_0xb687('0x28')](function(_0xbf6c58){return _0xbf6c58;});}return null;};}function removeEntity(_0x38866c,_0xf48ba4){return function(_0x2f0a0a){if(_0x2f0a0a){return _0x2f0a0a['destroy']()[_0xb687('0x28')](function(){var _0x129347=_0x2f0a0a[_0xb687('0x29')]({'plain':!![]});var _0x1a0261=_0xb687('0x2a');return db[_0xb687('0x2b')][_0xb687('0x2c')]({'where':{'type':_0x1a0261,'resourceId':_0x129347['id']}})[_0xb687('0x28')](function(){return _0x2f0a0a;});})[_0xb687('0x28')](function(){_0x38866c[_0xb687('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3712cf,_0x192966){return function(_0x392721){if(!_0x392721){_0x3712cf[_0xb687('0x2d')](0x194);}return _0x392721;};}function handleError(_0x2e5c8d,_0x173c58){_0x173c58=_0x173c58||0x1f4;return function(_0x4e9a06){logger[_0xb687('0x2e')](_0x4e9a06['stack']);if(_0x4e9a06[_0xb687('0x2f')]){delete _0x4e9a06[_0xb687('0x2f')];}_0x2e5c8d[_0xb687('0x1c')](_0x173c58)[_0xb687('0x30')](_0x4e9a06);};}exports[_0xb687('0x31')]=function(_0x43d20d,_0xf1f0dd){var _0x556815={},_0x3da2be={},_0xe3428f={'count':0x0,'rows':[]};var _0x3c08ab=_[_0xb687('0x32')](db[_0xb687('0x33')][_0xb687('0x34')],function(_0x44be88){return{'name':_0x44be88[_0xb687('0x35')],'type':_0x44be88[_0xb687('0x36')][_0xb687('0x37')]};});_0x3da2be[_0xb687('0x38')]=_['map'](_0x3c08ab,'name');_0x3da2be[_0xb687('0x39')]=_[_0xb687('0x3a')](_0x43d20d[_0xb687('0x39')]);_0x3da2be[_0xb687('0x3b')]=_['intersection'](_0x3da2be['model'],_0x3da2be[_0xb687('0x39')]);_0x556815[_0xb687('0x3c')]=_['intersection'](_0x3da2be[_0xb687('0x38')],qs[_0xb687('0x3d')](_0x43d20d['query'][_0xb687('0x3d')]));_0x556815['attributes']=_0x556815[_0xb687('0x3c')][_0xb687('0x3e')]?_0x556815[_0xb687('0x3c')]:_0x3da2be[_0xb687('0x38')];if(!_0x43d20d[_0xb687('0x39')][_0xb687('0x3f')]('nolimit')){_0x556815[_0xb687('0x20')]=qs[_0xb687('0x20')](_0x43d20d[_0xb687('0x39')][_0xb687('0x20')]);_0x556815['offset']=qs[_0xb687('0x1f')](_0x43d20d[_0xb687('0x39')][_0xb687('0x1f')]);}_0x556815[_0xb687('0x40')]=qs[_0xb687('0x41')](_0x43d20d['query'][_0xb687('0x41')]);_0x556815[_0xb687('0x42')]=qs[_0xb687('0x3b')](_[_0xb687('0x43')](_0x43d20d[_0xb687('0x39')],_0x3da2be[_0xb687('0x3b')]),_0x3c08ab);if(_0x43d20d['query']['filter']){_0x556815[_0xb687('0x42')]=_['merge'](_0x556815[_0xb687('0x42')],{'$or':_[_0xb687('0x32')](_0x3c08ab,function(_0x48d3b1){if(_0x48d3b1[_0xb687('0x36')]!==_0xb687('0x44')){var _0x57776b={};_0x57776b[_0x48d3b1[_0xb687('0x2f')]]={'$like':'%'+_0x43d20d[_0xb687('0x39')][_0xb687('0x45')]+'%'};return _0x57776b;}})});}_0x556815=_['merge']({},_0x556815,_0x43d20d[_0xb687('0x46')]);var _0x9cffb2={'where':_0x556815[_0xb687('0x42')]};return db[_0xb687('0x33')][_0xb687('0x22')](_0x9cffb2)[_0xb687('0x28')](function(_0x21b9ef){_0xe3428f['count']=_0x21b9ef;if(_0x43d20d[_0xb687('0x39')]['includeAll']){_0x556815['include']=[{'all':!![]}];}return db[_0xb687('0x33')][_0xb687('0x47')](_0x556815);})['then'](function(_0x19a21c){_0xe3428f['rows']=_0x19a21c;return _0xe3428f;})[_0xb687('0x28')](respondWithFilteredResult(_0xf1f0dd,_0x556815))[_0xb687('0x48')](handleError(_0xf1f0dd,null));};exports['show']=function(_0x4cb7a0,_0x3a8509){var _0x5d9cb0={'raw':!![],'where':{'id':_0x4cb7a0[_0xb687('0x49')]['id']}},_0x247c67={};_0x247c67[_0xb687('0x38')]=_[_0xb687('0x3a')](db[_0xb687('0x33')][_0xb687('0x34')]);_0x247c67[_0xb687('0x39')]=_[_0xb687('0x3a')](_0x4cb7a0[_0xb687('0x39')]);_0x247c67[_0xb687('0x3b')]=_[_0xb687('0x4a')](_0x247c67[_0xb687('0x38')],_0x247c67['query']);_0x5d9cb0[_0xb687('0x3c')]=_['intersection'](_0x247c67[_0xb687('0x38')],qs[_0xb687('0x3d')](_0x4cb7a0[_0xb687('0x39')][_0xb687('0x3d')]));_0x5d9cb0[_0xb687('0x3c')]=_0x5d9cb0[_0xb687('0x3c')]['length']?_0x5d9cb0['attributes']:_0x247c67[_0xb687('0x38')];if(_0x4cb7a0[_0xb687('0x39')][_0xb687('0x4b')]){_0x5d9cb0[_0xb687('0x4c')]=[{'all':!![]}];}_0x5d9cb0=_['merge']({},_0x5d9cb0,_0x4cb7a0[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x5d9cb0)[_0xb687('0x28')](handleEntityNotFound(_0x3a8509,null))['then'](respondWithResult(_0x3a8509,null))[_0xb687('0x48')](handleError(_0x3a8509,null));};exports[_0xb687('0x4e')]=function(_0x162b19,_0x401b99){return db['AnalyticDefaultReport']['create'](_0x162b19[_0xb687('0x4f')],{})[_0xb687('0x28')](function(_0x42b61a){var _0x508862=_0x162b19['user'][_0xb687('0x29')]({'plain':!![]});if(!_0x508862)throw new Error(_0xb687('0x50'));if(_0x508862[_0xb687('0x51')]===_0xb687('0x52')){var _0x34205d=_0x42b61a[_0xb687('0x29')]({'plain':!![]});var _0x602864=_0xb687('0x53');return db['UserProfileSection'][_0xb687('0x4d')]({'where':{'name':_0x602864,'userProfileId':_0x508862[_0xb687('0x54')]},'raw':!![]})[_0xb687('0x28')](function(_0x4f5784){if(_0x4f5784&&_0x4f5784['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x34205d[_0xb687('0x2f')],'resourceId':_0x34205d['id'],'type':_0xb687('0x2a'),'sectionId':_0x4f5784['id']},{})[_0xb687('0x28')](function(){return _0x42b61a;});}else{return _0x42b61a;}})[_0xb687('0x48')](function(_0x1ddfd4){logger[_0xb687('0x2e')](_0xb687('0x55'),_0x1ddfd4);throw _0x1ddfd4;});}return _0x42b61a;})[_0xb687('0x28')](respondWithResult(_0x401b99,0xc9))[_0xb687('0x48')](handleError(_0x401b99,null));};exports[_0xb687('0x27')]=function(_0x128264,_0x166900){if(_0x128264[_0xb687('0x4f')]['id']){delete _0x128264[_0xb687('0x4f')]['id'];}return db[_0xb687('0x33')][_0xb687('0x4d')]({'where':{'id':_0x128264[_0xb687('0x49')]['id']}})['then'](handleEntityNotFound(_0x166900,null))['then'](saveUpdates(_0x128264[_0xb687('0x4f')],null))[_0xb687('0x28')](respondWithResult(_0x166900,null))[_0xb687('0x48')](handleError(_0x166900,null));};exports[_0xb687('0x2c')]=function(_0x4e5642,_0xfa8790){return db[_0xb687('0x33')]['find']({'where':{'id':_0x4e5642[_0xb687('0x49')]['id']}})['then'](handleEntityNotFound(_0xfa8790,null))[_0xb687('0x28')](removeEntity(_0xfa8790,null))[_0xb687('0x48')](handleError(_0xfa8790,null));};exports['preview']=function(_0x4fb188,_0x13ad6a){var _0x4ab9c5=0xa;var _0x5ea8fd=[_0xb687('0x56'),_0xb687('0x57'),_0xb687('0x58'),'cross_join'];var _0x25e140={'SUM':'SUM(%s)','COUNT':_0xb687('0x59'),'COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':_0xb687('0x5c'),'AVG':_0xb687('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb687('0x5e')};var _0x58ec8b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':_0xb687('0x60')};var _0xbc3a94=function(_0x4bc18f){return!_[_0xb687('0x61')]([_0xb687('0x62'),_0xb687('0x63'),_0xb687('0x64'),_0xb687('0x65')],_0x4bc18f);};var _0x17505c=function(_0x132e3a){if(!_0x132e3a||!_0x132e3a['rules']['length']){return'';}for(var _0x2714c6='(',_0x4906df=0x0;_0x4906df<_0x132e3a[_0xb687('0x66')][_0xb687('0x3e')];_0x4906df+=0x1){_0x4906df>0x0&&(_0x2714c6+='\x20'+_0x132e3a[_0xb687('0x67')]+'\x20');_0x2714c6+=_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x68')]?_0x17505c(_0x132e3a['rules'][_0x4906df][_0xb687('0x68')]):_0x132e3a['rules'][_0x4906df][_0xb687('0x69')]+'\x20'+_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6a')]+(_0xbc3a94(_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6a')])?'\x20'+_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6b')]:'');}return _0x2714c6+')';};var _0x5deb7a={'where':{'id':_0x4fb188['params']['id']}},_0x28a6aa,_0x31ed20,_0x8942b7,_0x36bb4b,_0x258caf;_0x5deb7a=_[_0xb687('0x6c')]({},_0x5deb7a,_0x4fb188[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x5deb7a)[_0xb687('0x28')](function(_0x15ef44){if(_0x15ef44){_0x28a6aa=_0x15ef44;return _0x15ef44[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x177ea4){if(_0x177ea4){if(!_0x177ea4[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))]['ValidationErrorItem'](_0xb687('0x6f'),0x193);}_0x31ed20=_0x177ea4;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x505f7a){if(_0x505f7a){_0x8942b7=_[_0xb687('0x71')](_0x505f7a,'id');var _0x1a6075;var _0x53b00a=squel[_0xb687('0x72')]();_0x53b00a[_0xb687('0x73')](_0x28a6aa[_0xb687('0x74')]);for(var _0x5eeb75=0x0;_0x5eeb75<_0x31ed20[_0xb687('0x3e')];_0x5eeb75+=0x1){_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x75')]?_0x8942b7[_0x31ed20[_0x5eeb75]['MetricId']][_0xb687('0x76')]:_0x31ed20[_0x5eeb75][_0xb687('0x69')];_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x77')]?_[_0xb687('0x78')](_0x25e140[_0x31ed20[_0x5eeb75]['function']],'%s',_0x1a6075):_0x1a6075;_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x79')]?_[_0xb687('0x78')](_0x58ec8b[_0x31ed20[_0x5eeb75]['format']],'%s',_0x1a6075):_0x1a6075;if(_0x31ed20[_0x5eeb75][_0xb687('0x7a')]){_0x53b00a[_0xb687('0x68')](_0x1a6075);}_0x31ed20[_0x5eeb75]['orderBy']&&_0x53b00a['order'](_0x1a6075,_0x31ed20[_0x5eeb75][_0xb687('0x7b')]==='DESC'?![]:!![]);_0x53b00a[_0xb687('0x69')](_0x1a6075,_0x31ed20[_0x5eeb75][_0xb687('0x7c')]||_0x1a6075);}if(_0x28a6aa[_0xb687('0x7d')]){_0x28a6aa[_0xb687('0x7d')]=JSON[_0xb687('0x7e')](_0x28a6aa[_0xb687('0x7d')]);for(var _0x229bc4=0x0;_0x229bc4<_0x28a6aa[_0xb687('0x7d')]['length'];_0x229bc4+=0x1){if(_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')]&&_[_0xb687('0x61')](_0x5ea8fd,_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')])&&_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['parentKey']&&_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x7f')]&&_0x28a6aa['joins'][_0x229bc4][_0xb687('0x80')]){_0x53b00a[_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')]](_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['foreignTable'],null,util[_0xb687('0x79')]('%s.%s\x20=\x20%s.%s',_0x28a6aa['table'],_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['parentKey'],_0x28a6aa['joins'][_0x229bc4][_0xb687('0x7f')],_0x28a6aa['joins'][_0x229bc4][_0xb687('0x80')]));}}}if(_0x28a6aa[_0xb687('0x81')]){_0x28a6aa['conditions']=JSON[_0xb687('0x7e')](_0x28a6aa[_0xb687('0x81')]);_0x53b00a['where'](_0x17505c(_0x28a6aa[_0xb687('0x81')][_0xb687('0x68')]));}_0x258caf=_0x53b00a[_0xb687('0x82')]();_0x53b00a[_0xb687('0x20')](_0x4ab9c5);_0x53b00a[_0xb687('0x1f')](0x0);logger[_0xb687('0x83')](_0xb687('0x84'),_0x53b00a[_0xb687('0x85')]());return dbH[_0xb687('0x86')][_0xb687('0x39')](_0x53b00a[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')]['SELECT']});}})['then'](respondWithResult(_0x13ad6a,null))[_0xb687('0x48')](handleError(_0x13ad6a,null));};function runReport(_0x29e830,_0x22ebca,_0xfecb8d){var _0x3a7339=_0x22ebca['name'];var _0x59c94b=0xa;var _0x29e27e=[_0xb687('0x56'),_0xb687('0x57'),_0xb687('0x58'),'cross_join'];var _0x448d59={'SUM':_0xb687('0x88'),'COUNT':_0xb687('0x59'),'COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':_0xb687('0x5c'),'AVG':_0xb687('0x5d'),'GROUP_CONCAT':_0xb687('0x89'),'GROUP_CONCAT ASC':_0xb687('0x8a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x25f5c3={'SEC_TO_TIME':_0xb687('0x8b'),'DATE':_0xb687('0x8c'),'HOUR':_0xb687('0x8d'),'ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1037b1=function(_0x3bf480){return!_['includes']([_0xb687('0x62'),'IS\x20NOT\x20NULL',_0xb687('0x64'),_0xb687('0x65')],_0x3bf480);};var _0x5ec5f6=function(_0x1c683e){if(!_0x1c683e||!_0x1c683e[_0xb687('0x66')]['length']){return'';}for(var _0x231caa='(',_0x3479c5=0x0;_0x3479c5<_0x1c683e[_0xb687('0x66')][_0xb687('0x3e')];_0x3479c5+=0x1){_0x3479c5>0x0&&(_0x231caa+='\x20'+_0x1c683e[_0xb687('0x67')]+'\x20');_0x231caa+=_0x1c683e[_0xb687('0x66')][_0x3479c5]['group']?_0x5ec5f6(_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x68')]):_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x69')]+'\x20'+_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6a')]+(_0x1037b1(_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6a')])?'\x20'+_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6b')]:'');}return _0x231caa+')';};var _0x290ddf={'where':{'id':_0x29e830['id']}},_0x5ee585,_0x10fb0,_0x5be566,_0x3d98e2,_0x3aa1c8;_0x290ddf=_['merge']({},_0x290ddf,_0xfecb8d);return db['AnalyticDefaultReport'][_0xb687('0x4d')](_0x290ddf)[_0xb687('0x28')](function(_0x3b4acf){if(_0x3b4acf){_0x5ee585=_0x3b4acf;return _0x3b4acf[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x1c3de0){if(_0x1c3de0){if(!_0x1c3de0[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))][(_0xb687('0x8e'))](_0xb687('0x6f'),0x193);}_0x10fb0=_0x1c3de0;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x1ea6fd){if(_0x1ea6fd){_0x5be566=_[_0xb687('0x71')](_0x1ea6fd,'id');var _0x3f45b7;var _0x508550=squel['select']();_0x508550[_0xb687('0x73')](_0x5ee585['table']);for(var _0x5f2557=0x0;_0x5f2557<_0x10fb0[_0xb687('0x3e')];_0x5f2557+=0x1){_0x3f45b7=_0x10fb0[_0x5f2557][_0xb687('0x75')]?_0x5be566[_0x10fb0[_0x5f2557]['MetricId']][_0xb687('0x76')]:_0x10fb0[_0x5f2557][_0xb687('0x69')];_0x3f45b7=_0x10fb0[_0x5f2557]['function']?_[_0xb687('0x78')](_0x448d59[_0x10fb0[_0x5f2557][_0xb687('0x77')]],'%s',_0x3f45b7):_0x3f45b7;_0x3f45b7=_0x10fb0[_0x5f2557][_0xb687('0x79')]?_[_0xb687('0x78')](_0x25f5c3[_0x10fb0[_0x5f2557][_0xb687('0x79')]],'%s',_0x3f45b7):_0x3f45b7;if(_0x10fb0[_0x5f2557][_0xb687('0x7a')]){_0x508550[_0xb687('0x68')](_0x3f45b7);}_0x10fb0[_0x5f2557][_0xb687('0x7b')]&&_0x508550[_0xb687('0x40')](_0x3f45b7,_0x10fb0[_0x5f2557]['orderBy']===_0xb687('0x8f')?![]:!![]);_0x508550[_0xb687('0x69')](_0x3f45b7,_0x10fb0[_0x5f2557]['alias']||_0x3f45b7);}if(_0x5ee585[_0xb687('0x7d')]){_0x5ee585['joins']=JSON[_0xb687('0x7e')](_0x5ee585[_0xb687('0x7d')]);for(var _0x59166c=0x0;_0x59166c<_0x5ee585[_0xb687('0x7d')][_0xb687('0x3e')];_0x59166c+=0x1){if(_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')]&&_[_0xb687('0x61')](_0x29e27e,_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')])&&_0x5ee585['joins'][_0x59166c]['parentKey']&&_0x5ee585[_0xb687('0x7d')][_0x59166c]['foreignTable']&&_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x80')]){_0x508550[_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')]](_0x5ee585['joins'][_0x59166c][_0xb687('0x7f')],null,util[_0xb687('0x79')]('%s.%s\x20=\x20%s.%s',_0x5ee585[_0xb687('0x74')],_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x90')],_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x7f')],_0x5ee585[_0xb687('0x7d')][_0x59166c]['foreignKey']));}}}if(_0x5ee585[_0xb687('0x81')]){_0x5ee585[_0xb687('0x81')]=JSON[_0xb687('0x7e')](_0x5ee585[_0xb687('0x81')]);_0x508550[_0xb687('0x42')](_0x5ec5f6(_0x5ee585[_0xb687('0x81')][_0xb687('0x68')]));}_0x3aa1c8=_0x508550[_0xb687('0x82')]();_0x508550[_0xb687('0x20')](_0x59c94b);_0x508550[_0xb687('0x1f')](0x0);return;}})['then'](function(){if(_0x22ebca['output']===_0xb687('0x91')){return null;}var _0x1a7cd8=_[_0xb687('0x6c')](_0x22ebca,{'name':_0x22ebca[_0xb687('0x92')]||_0x22ebca[_0xb687('0x2f')]||_0x5ee585[_0xb687('0x2f')],'basename':_0x3a7339,'savename':util[_0xb687('0x79')](_0xb687('0x93'),_0x22ebca[_0xb687('0x2f')]||_0x5ee585['name'],require('randomstring')['generate'](0x4),_0x22ebca[_0xb687('0x94')]||_0xb687('0x95')),'reportId':_0x5ee585['id'],'reportType':_0xb687('0x96')});return db[_0xb687('0x97')][_0xb687('0x4e')](_0x1a7cd8,{'raw':!![]});})[_0xb687('0x28')](function(_0x473130){if(_0x5ee585[_0xb687('0x74')]==='cdr'){_0x3aa1c8[_0xb687('0x42')](_0x5ee585[_0xb687('0x74')]+_0xb687('0x98'),_0x22ebca[_0xb687('0x99')],_0x22ebca[_0xb687('0x9a')]);}else{_0x3aa1c8[_0xb687('0x42')](_0x5ee585[_0xb687('0x74')]+_0xb687('0x9b'),_0x22ebca['startDate'],_0x22ebca[_0xb687('0x9a')]);}if(_0x473130){logger['info'](_0xb687('0x9c'),_0x3aa1c8[_0xb687('0x85')]());require('child_process')[_0xb687('0x9d')](path[_0xb687('0x56')](__dirname,_0xb687('0x9e'),_0x473130['output']),[_0x473130['id'],_0x3aa1c8[_0xb687('0x85')](),path[_0xb687('0x56')](__dirname,_0xb687('0x9f'),_0x473130[_0xb687('0xa0')]),_0x3a7339]);return _0x473130;}else{var _0x3d4596=squel[_0xb687('0x72')]();_0x3d4596[_0xb687('0x73')]('('+_0x3aa1c8['toString']()+')',_0xb687('0xa1'));_0x3d4596[_0xb687('0x69')](_0xb687('0xa2'),_0xb687('0x22'));_0x3aa1c8[_0xb687('0x20')](_0x22ebca['limit']||_0x59c94b);_0x3aa1c8[_0xb687('0x1f')](_0x22ebca[_0xb687('0x1f')]||0x0);return dbH[_0xb687('0x86')]['query'](_0x3d4596[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')][_0xb687('0xa3')]})['then'](function(_0x3dbbd6){if(!_0x3dbbd6[_0xb687('0x3e')]){_0x3d98e2=0x0;}else{_0x3d98e2=_0x3dbbd6[0x0][_0xb687('0x22')]||0x0;}return dbH['sequelize'][_0xb687('0x39')](_0x3aa1c8[_0xb687('0x85')](),{'type':dbH[_0xb687('0x86')][_0xb687('0x87')][_0xb687('0xa3')]});})[_0xb687('0x28')](function(_0x15e599){return{'rows':_0x15e599||[],'count':_0x3d98e2};});}});}exports[_0xb687('0xa4')]=function(_0x8f6ba0,_0x568aca){return runReport(_0x8f6ba0[_0xb687('0x49')],_0x8f6ba0[_0xb687('0x39')],_0x8f6ba0[_0xb687('0x46')])['then'](respondWithResult(_0x568aca,null))['catch'](handleError(_0x568aca,null));};exports[_0xb687('0xa5')]=runReport;exports['query']=function(_0x187810,_0x1d21ef){var _0x386d12=0xa;var _0x4dd8f4=['join',_0xb687('0x57'),_0xb687('0x58'),_0xb687('0xa6')];var _0x295795={'SUM':_0xb687('0x88'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':'MIN(%s)','AVG':_0xb687('0x5d'),'GROUP_CONCAT':_0xb687('0x89'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb687('0x5e')};var _0xe7056c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xb687('0x8c'),'HOUR':_0xb687('0x8d'),'ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':_0xb687('0x60')};var _0x1b1cf5=function(_0x46283c){return!_[_0xb687('0x61')](['IS\x20NULL',_0xb687('0x63'),'IS\x20EMPTY',_0xb687('0x65')],_0x46283c);};var _0x394ed6=function(_0x875169){if(!_0x875169||!_0x875169[_0xb687('0x66')]['length']){return'';}for(var _0x1ec485='(',_0x55a919=0x0;_0x55a919<_0x875169['rules'][_0xb687('0x3e')];_0x55a919+=0x1){_0x55a919>0x0&&(_0x1ec485+='\x20'+_0x875169[_0xb687('0x67')]+'\x20');_0x1ec485+=_0x875169[_0xb687('0x66')][_0x55a919]['group']?_0x394ed6(_0x875169[_0xb687('0x66')][_0x55a919][_0xb687('0x68')]):_0x875169['rules'][_0x55a919][_0xb687('0x69')]+'\x20'+_0x875169['rules'][_0x55a919][_0xb687('0x6a')]+(_0x1b1cf5(_0x875169[_0xb687('0x66')][_0x55a919]['condition'])?'\x20'+_0x875169[_0xb687('0x66')][_0x55a919]['value']:'');}return _0x1ec485+')';};var _0x2aecd5={'where':{'id':_0x187810[_0xb687('0x49')]['id']}},_0x58955e,_0x488a2a,_0x303738,_0x3904a3,_0x581338;_0x2aecd5=_['merge']({},_0x2aecd5,_0x187810[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x2aecd5)['then'](function(_0xc29834){if(_0xc29834){_0x58955e=_0xc29834;return _0xc29834[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x1f2f2b){if(_0x1f2f2b){if(!_0x1f2f2b[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))]['ValidationErrorItem'](_0xb687('0x6f'),0x193);}_0x488a2a=_0x1f2f2b;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x3591e2){if(_0x3591e2){_0x303738=_['keyBy'](_0x3591e2,'id');var _0x4d0c14;var _0x200b55=squel[_0xb687('0x72')]();_0x200b55[_0xb687('0x73')](_0x58955e[_0xb687('0x74')]);for(var _0x33f4de=0x0;_0x33f4de<_0x488a2a[_0xb687('0x3e')];_0x33f4de+=0x1){_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x75')]?_0x303738[_0x488a2a[_0x33f4de]['MetricId']][_0xb687('0x76')]:_0x488a2a[_0x33f4de][_0xb687('0x69')];_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x77')]?_['replace'](_0x295795[_0x488a2a[_0x33f4de][_0xb687('0x77')]],'%s',_0x4d0c14):_0x4d0c14;_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x79')]?_[_0xb687('0x78')](_0xe7056c[_0x488a2a[_0x33f4de]['format']],'%s',_0x4d0c14):_0x4d0c14;if(_0x488a2a[_0x33f4de][_0xb687('0x7a')]){_0x200b55[_0xb687('0x68')](_0x4d0c14);}_0x488a2a[_0x33f4de]['orderBy']&&_0x200b55[_0xb687('0x40')](_0x4d0c14,_0x488a2a[_0x33f4de][_0xb687('0x7b')]===_0xb687('0x8f')?![]:!![]);_0x200b55[_0xb687('0x69')](_0x4d0c14,_0x488a2a[_0x33f4de]['alias']||_0x4d0c14);}if(_0x58955e[_0xb687('0x7d')]){_0x58955e[_0xb687('0x7d')]=JSON[_0xb687('0x7e')](_0x58955e[_0xb687('0x7d')]);for(var _0xcff220=0x0;_0xcff220<_0x58955e['joins'][_0xb687('0x3e')];_0xcff220+=0x1){if(_0x58955e[_0xb687('0x7d')][_0xcff220]['type']&&_[_0xb687('0x61')](_0x4dd8f4,_0x58955e[_0xb687('0x7d')][_0xcff220]['type'])&&_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x90')]&&_0x58955e[_0xb687('0x7d')][_0xcff220]['foreignTable']&&_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x80')]){_0x200b55[_0x58955e['joins'][_0xcff220]['type']](_0x58955e['joins'][_0xcff220][_0xb687('0x7f')],null,util['format'](_0xb687('0xa7'),_0x58955e[_0xb687('0x74')],_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x90')],_0x58955e[_0xb687('0x7d')][_0xcff220]['foreignTable'],_0x58955e['joins'][_0xcff220][_0xb687('0x80')]));}}}if(_0x58955e[_0xb687('0x81')]){_0x58955e[_0xb687('0x81')]=JSON[_0xb687('0x7e')](_0x58955e[_0xb687('0x81')]);_0x200b55[_0xb687('0x42')](_0x394ed6(_0x58955e[_0xb687('0x81')]['group']));}_0x581338=_0x200b55['clone']();_0x200b55['limit'](_0x386d12);_0x200b55[_0xb687('0x1f')](0x0);logger[_0xb687('0x83')](_0xb687('0x84'),_0x200b55['toString']());return dbH['sequelize']['query'](_0x200b55[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')][_0xb687('0xa3')]});}})[_0xb687('0x28')](function(){return{'sql':_0x581338[_0xb687('0x85')]()};})[_0xb687('0x28')](respondWithResult(_0x1d21ef,null))[_0xb687('0x48')](handleError(_0x1d21ef,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 116b8c3..1c5af06 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 _0xb8a7=['analytics_default_reports','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./analyticDefaultReport.attributes','AnalyticDefaultReport'];(function(_0x177f35,_0x569774){var _0xaabb31=function(_0x309ae0){while(--_0x309ae0){_0x177f35['push'](_0x177f35['shift']());}};_0xaabb31(++_0x569774);}(_0xb8a7,0xb1));var _0x7b8a=function(_0x4dce9c,_0xc94456){_0x4dce9c=_0x4dce9c-0x0;var _0x3d7858=_0xb8a7[_0x4dce9c];return _0x3d7858;};'use strict';var _=require(_0x7b8a('0x0'));var util=require(_0x7b8a('0x1'));var logger=require(_0x7b8a('0x2'))(_0x7b8a('0x3'));var moment=require('moment');var BPromise=require(_0x7b8a('0x4'));var rp=require(_0x7b8a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b8a('0x6'));var config=require(_0x7b8a('0x7'));var attributes=require(_0x7b8a('0x8'));module['exports']=function(_0x489a3b,_0xf7ce7b){return _0x489a3b['define'](_0x7b8a('0x9'),attributes,{'tableName':_0x7b8a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2bb8=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','lodash','util','../../config/logger'];(function(_0x59c0dd,_0x5dfcf8){var _0x1534be=function(_0x121d62){while(--_0x121d62){_0x59c0dd['push'](_0x59c0dd['shift']());}};_0x1534be(++_0x5dfcf8);}(_0x2bb8,0x1b9));var _0x82bb=function(_0x394fc1,_0x1ed843){_0x394fc1=_0x394fc1-0x0;var _0x4894d6=_0x2bb8[_0x394fc1];return _0x4894d6;};'use strict';var _=require(_0x82bb('0x0'));var util=require(_0x82bb('0x1'));var logger=require(_0x82bb('0x2'))(_0x82bb('0x3'));var moment=require(_0x82bb('0x4'));var BPromise=require(_0x82bb('0x5'));var rp=require(_0x82bb('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x82bb('0x7'));var config=require(_0x82bb('0x8'));var attributes=require(_0x82bb('0x9'));module[_0x82bb('0xa')]=function(_0x3df3ce,_0x31157d){return _0x3df3ce[_0x82bb('0xb')]('AnalyticDefaultReport',attributes,{'tableName':'analytics_default_reports','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 c423fe3..fefe875 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 _0xb3e6=['result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message'];(function(_0x4c9c5b,_0x210cbb){var _0x4088ab=function(_0x3f1d0a){while(--_0x3f1d0a){_0x4c9c5b['push'](_0x4c9c5b['shift']());}};_0x4088ab(++_0x210cbb);}(_0xb3e6,0x1b7));var _0x6b3e=function(_0x39f34f,_0x298f45){_0x39f34f=_0x39f34f-0x0;var _0x59fee1=_0xb3e6[_0x39f34f];return _0x59fee1;};'use strict';var _=require(_0x6b3e('0x0'));var util=require(_0x6b3e('0x1'));var moment=require(_0x6b3e('0x2'));var BPromise=require('bluebird');var rs=require(_0x6b3e('0x3'));var fs=require('fs');var Redis=require(_0x6b3e('0x4'));var db=require(_0x6b3e('0x5'))['db'];var utils=require(_0x6b3e('0x6'));var logger=require(_0x6b3e('0x7'))(_0x6b3e('0x8'));var config=require(_0x6b3e('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6b3e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3763f7,_0x3d4c97,_0x5994ee){return new BPromise(function(_0x251207,_0x2c22c6){return client[_0x6b3e('0xb')](_0x3763f7,_0x5994ee)[_0x6b3e('0xc')](function(_0xaf486f){logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x3d4c97,'request\x20sent');logger[_0x6b3e('0xd')](_0x6b3e('0xe'),_0x3d4c97,_0x6b3e('0xf'),JSON[_0x6b3e('0x10')](_0xaf486f));if(_0xaf486f[_0x6b3e('0x11')]){if(_0xaf486f[_0x6b3e('0x11')][_0x6b3e('0x12')]===0x1f4){logger[_0x6b3e('0x11')](_0x6b3e('0x13'),_0x3d4c97,_0xaf486f[_0x6b3e('0x11')][_0x6b3e('0x14')]);return _0x2c22c6(_0xaf486f[_0x6b3e('0x11')][_0x6b3e('0x14')]);}logger[_0x6b3e('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3d4c97,_0xaf486f['error'][_0x6b3e('0x14')]);return _0x251207(_0xaf486f[_0x6b3e('0x11')][_0x6b3e('0x14')]);}else{logger['info'](_0x6b3e('0x13'),_0x3d4c97,_0x6b3e('0xf'));_0x251207(_0xaf486f[_0x6b3e('0x15')][_0x6b3e('0x14')]);}})[_0x6b3e('0x16')](function(_0x1826d6){logger[_0x6b3e('0x11')](_0x6b3e('0x13'),_0x3d4c97,_0x1826d6);_0x2c22c6(_0x1826d6);});});} \ No newline at end of file +var _0xdacd=['result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/environment','jayson/promise','client','request','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x5bb42d,_0x1367b1){var _0x4a8de3=function(_0x4d69da){while(--_0x4d69da){_0x5bb42d['push'](_0x5bb42d['shift']());}};_0x4a8de3(++_0x1367b1);}(_0xdacd,0x1f0));var _0xddac=function(_0x16d11d,_0x4f6075){_0x16d11d=_0x16d11d-0x0;var _0x4bfa07=_0xdacd[_0x16d11d];return _0x4bfa07;};'use strict';var _=require(_0xddac('0x0'));var util=require('util');var moment=require(_0xddac('0x1'));var BPromise=require(_0xddac('0x2'));var rs=require(_0xddac('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xddac('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xddac('0x5'));var jayson=require(_0xddac('0x6'));var client=jayson[_0xddac('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4cfee3,_0x4fe33f,_0x1de050){return new BPromise(function(_0x2242cb,_0x4deed9){return client[_0xddac('0x8')](_0x4cfee3,_0x1de050)['then'](function(_0x3007d4){logger[_0xddac('0x9')](_0xddac('0xa'),_0x4fe33f,_0xddac('0xb'));logger[_0xddac('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x4fe33f,_0xddac('0xb'),JSON[_0xddac('0xd')](_0x3007d4));if(_0x3007d4[_0xddac('0xe')]){if(_0x3007d4[_0xddac('0xe')][_0xddac('0xf')]===0x1f4){logger[_0xddac('0xe')](_0xddac('0xa'),_0x4fe33f,_0x3007d4[_0xddac('0xe')][_0xddac('0x10')]);return _0x4deed9(_0x3007d4[_0xddac('0xe')][_0xddac('0x10')]);}logger[_0xddac('0xe')](_0xddac('0xa'),_0x4fe33f,_0x3007d4[_0xddac('0xe')][_0xddac('0x10')]);return _0x2242cb(_0x3007d4[_0xddac('0xe')]['message']);}else{logger['info'](_0xddac('0xa'),_0x4fe33f,'request\x20sent');_0x2242cb(_0x3007d4[_0xddac('0x11')][_0xddac('0x10')]);}})[_0xddac('0x12')](function(_0x26a7b9){logger[_0xddac('0xe')](_0xddac('0xa'),_0x4fe33f,_0x26a7b9);_0x4deed9(_0x26a7b9);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 8bd0dca..e283b88 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 _0xc7c3=['delete','destroy','exports','multer','util','path','fs-extra','../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','/:id','show','get','/:id/preview','/:id/run','query','post','put'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xc7c3,0x143));var _0x3c7c=function(_0x1e8c18,_0x1de6b8){_0x1e8c18=_0x1e8c18-0x0;var _0x2ab792=_0xc7c3[_0x1e8c18];return _0x2ab792;};'use strict';var multer=require(_0x3c7c('0x0'));var util=require(_0x3c7c('0x1'));var path=require(_0x3c7c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x3c7c('0x3'));var auth=require(_0x3c7c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3c7c('0x5'));var controller=require(_0x3c7c('0x6'));router['get']('/',auth[_0x3c7c('0x7')](),controller[_0x3c7c('0x8')]);router['get'](_0x3c7c('0x9'),auth[_0x3c7c('0x7')](),controller[_0x3c7c('0xa')]);router[_0x3c7c('0xb')](_0x3c7c('0xc'),auth[_0x3c7c('0x7')](),controller['preview']);router['get'](_0x3c7c('0xd'),auth[_0x3c7c('0x7')](),controller['run']);router[_0x3c7c('0xb')]('/:id/query',auth[_0x3c7c('0x7')](),controller[_0x3c7c('0xe')]);router[_0x3c7c('0xf')]('/',auth[_0x3c7c('0x7')](),controller['create']);router[_0x3c7c('0x10')](_0x3c7c('0x9'),auth[_0x3c7c('0x7')](),controller['update']);router[_0x3c7c('0x11')](_0x3c7c('0x9'),auth[_0x3c7c('0x7')](),controller[_0x3c7c('0x12')]);module[_0x3c7c('0x13')]=router; \ No newline at end of file +var _0x1798=['util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','query','put','update','delete','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1798,0xa7));var _0x8179=function(_0x3fe529,_0xa9d13f){_0x3fe529=_0x3fe529-0x0;var _0x2e0f12=_0x1798[_0x3fe529];return _0x2e0f12;};'use strict';var multer=require(_0x8179('0x0'));var util=require(_0x8179('0x1'));var path=require(_0x8179('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8179('0x3')]();var fs_extra=require(_0x8179('0x4'));var auth=require(_0x8179('0x5'));var interaction=require(_0x8179('0x6'));var config=require(_0x8179('0x7'));var controller=require(_0x8179('0x8'));router[_0x8179('0x9')]('/',auth[_0x8179('0xa')](),controller[_0x8179('0xb')]);router[_0x8179('0x9')](_0x8179('0xc'),auth[_0x8179('0xa')](),controller[_0x8179('0xd')]);router[_0x8179('0x9')](_0x8179('0xe'),auth[_0x8179('0xa')](),controller[_0x8179('0xf')]);router[_0x8179('0x9')](_0x8179('0x10'),auth[_0x8179('0xa')](),controller['run']);router[_0x8179('0x9')]('/:id/query',auth[_0x8179('0xa')](),controller[_0x8179('0x11')]);router['post']('/',auth[_0x8179('0xa')](),controller['create']);router[_0x8179('0x12')]('/:id',auth[_0x8179('0xa')](),controller[_0x8179('0x13')]);router[_0x8179('0x14')](_0x8179('0xc'),auth[_0x8179('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index e777996..a7b9449 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 _0x45ce=['sequelize','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual','scheduled','UNSIGNED'];(function(_0x2a725d,_0x2466f5){var _0x1d7453=function(_0x2b5f4c){while(--_0x2b5f4c){_0x2a725d['push'](_0x2a725d['shift']());}};_0x1d7453(++_0x2466f5);}(_0x45ce,0x18c));var _0xe45c=function(_0x1facbf,_0x53e75b){_0x1facbf=_0x1facbf-0x0;var _0x4de6a1=_0x45ce[_0x1facbf];return _0x4de6a1;};'use strict';var Sequelize=require(_0xe45c('0x0'));var moment=require('moment');module['exports']={'name':{'type':Sequelize[_0xe45c('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0xe45c('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0xe45c('0x2')](_0xe45c('0x3'),_0xe45c('0x4'),_0xe45c('0x5')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xe45c('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0xe45c('0x6')]},'endDate':{'type':Sequelize[_0xe45c('0x6')]},'status':{'type':Sequelize[_0xe45c('0x1')],'defaultValue':_0xe45c('0x7')},'type':{'type':Sequelize[_0xe45c('0x2')](_0xe45c('0x8'),_0xe45c('0x9')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xe45c('0xa')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6fcd=['DATE','scheduled','INTEGER','UNSIGNED','sequelize','moment','STRING','ENUM','pdf','xlsx','csv'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6fcd,0x19b));var _0xd6fc=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x6fcd[_0x5c2e3e];return _0x53f64a;};'use strict';var Sequelize=require(_0xd6fc('0x0'));var moment=require(_0xd6fc('0x1'));module['exports']={'name':{'type':Sequelize[_0xd6fc('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xd6fc('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xd6fc('0x3')]('csv',_0xd6fc('0x4'),_0xd6fc('0x5')),'allowNull':![],'defaultValue':_0xd6fc('0x6')},'savename':{'type':Sequelize[_0xd6fc('0x2')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0xd6fc('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xd6fc('0x3')]('manual',_0xd6fc('0x8')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xd6fc('0x9')](0xb)[_0xd6fc('0xa')]},'reportType':{'type':Sequelize[_0xd6fc('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index bd1ab8e..aa63852 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 _0x68c4=['request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','crypto','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','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','stack','name','send','index','map','AnalyticExtractedReport','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','params','rawAttributes','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ExtractedReports','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','download','basename','output','existsSync','join','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir'];(function(_0x1a016d,_0x424831){var _0x586305=function(_0x1ddf54){while(--_0x1ddf54){_0x1a016d['push'](_0x1a016d['shift']());}};_0x586305(++_0x424831);}(_0x68c4,0x114));var _0x468c=function(_0x5b8155,_0x51c636){_0x5b8155=_0x5b8155-0x0;var _0x1d6f07=_0x68c4[_0x5b8155];return _0x1d6f07;};'use strict';var emlformat=require(_0x468c('0x0'));var rimraf=require(_0x468c('0x1'));var zipdir=require(_0x468c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x468c('0x3'));var moment=require(_0x468c('0x4'));var BPromise=require(_0x468c('0x5'));var Mustache=require('mustache');var util=require(_0x468c('0x6'));var path=require('path');var sox=require(_0x468c('0x7'));var csv=require(_0x468c('0x8'));var ejs=require(_0x468c('0x9'));var fs=require('fs');var fs_extra=require(_0x468c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x468c('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x468c('0x8'));var querystring=require('querystring');var Papa=require(_0x468c('0xc'));var Redis=require('ioredis');var authService=require(_0x468c('0xd'));var qs=require(_0x468c('0xe'));var as=require(_0x468c('0xf'));var hardwareService=require(_0x468c('0x10'));var logger=require(_0x468c('0x11'))(_0x468c('0x12'));var utils=require(_0x468c('0x13'));var config=require(_0x468c('0x14'));var licenseUtil=require(_0x468c('0x15'));var db=require(_0x468c('0x16'))['db'];function respondWithStatusCode(_0x3be5e6,_0x36efdd){_0x36efdd=_0x36efdd||0xcc;return function(_0x2faf33){if(_0x2faf33){return _0x3be5e6[_0x468c('0x17')](_0x36efdd);}return _0x3be5e6[_0x468c('0x18')](_0x36efdd)[_0x468c('0x19')]();};}function respondWithResult(_0x410ec0,_0x1c3668){_0x1c3668=_0x1c3668||0xc8;return function(_0xc5dfea){if(_0xc5dfea){return _0x410ec0[_0x468c('0x18')](_0x1c3668)['json'](_0xc5dfea);}};}function respondWithFilteredResult(_0x2b1e9a,_0x1284ee){return function(_0x394f4f){if(_0x394f4f){var _0xd39d7e=typeof _0x1284ee[_0x468c('0x1a')]===_0x468c('0x1b')&&typeof _0x1284ee[_0x468c('0x1c')]===_0x468c('0x1b');var _0x2d6679=_0x394f4f[_0x468c('0x1d')];var _0x1e444f=_0xd39d7e?0x0:_0x1284ee[_0x468c('0x1a')];var _0x568e63=_0xd39d7e?_0x394f4f[_0x468c('0x1d')]:_0x1284ee['offset']+_0x1284ee[_0x468c('0x1c')];var _0x6793cc;if(_0x568e63>=_0x2d6679){_0x568e63=_0x2d6679;_0x6793cc=0xc8;}else{_0x6793cc=0xce;}_0x2b1e9a[_0x468c('0x18')](_0x6793cc);return _0x2b1e9a[_0x468c('0x1e')]('Content-Range',_0x1e444f+'-'+_0x568e63+'/'+_0x2d6679)['json'](_0x394f4f);}return null;};}function patchUpdates(_0x6d1113){return function(_0x3833c4){try{jsonpatch[_0x468c('0x1f')](_0x3833c4,_0x6d1113,!![]);}catch(_0x35fe49){return BPromise[_0x468c('0x20')](_0x35fe49);}return _0x3833c4[_0x468c('0x21')]();};}function saveUpdates(_0x4a0e15,_0x213e1a){return function(_0x5863f3){if(_0x5863f3){return _0x5863f3[_0x468c('0x22')](_0x4a0e15)[_0x468c('0x23')](function(_0xcf60b6){return _0xcf60b6;});}return null;};}function removeEntity(_0x225066,_0x4e7b4a){return function(_0x59bfef){if(_0x59bfef){return _0x59bfef[_0x468c('0x24')]()['then'](function(){var _0x114cbd=_0x59bfef[_0x468c('0x25')]({'plain':!![]});var _0x434d1a='ExtractedReports';return db['UserProfileResource'][_0x468c('0x24')]({'where':{'type':_0x434d1a,'resourceId':_0x114cbd['id']}})[_0x468c('0x23')](function(){return _0x59bfef;});})[_0x468c('0x23')](function(){_0x225066['status'](0xcc)[_0x468c('0x19')]();});}};}function handleEntityNotFound(_0x31a379,_0x1be48a){return function(_0x587a71){if(!_0x587a71){_0x31a379['sendStatus'](0x194);}return _0x587a71;};}function handleError(_0x1414f8,_0x481449){_0x481449=_0x481449||0x1f4;return function(_0x5ecc27){logger['error'](_0x5ecc27[_0x468c('0x26')]);if(_0x5ecc27[_0x468c('0x27')]){delete _0x5ecc27[_0x468c('0x27')];}_0x1414f8[_0x468c('0x18')](_0x481449)[_0x468c('0x28')](_0x5ecc27);};}exports[_0x468c('0x29')]=function(_0x554763,_0x3684dd){var _0x6d32a1={},_0x2d8c54={},_0x300012={'count':0x0,'rows':[]};var _0x2594e2=_[_0x468c('0x2a')](db[_0x468c('0x2b')]['rawAttributes'],function(_0x2e5743){return{'name':_0x2e5743[_0x468c('0x2c')],'type':_0x2e5743[_0x468c('0x2d')][_0x468c('0x2e')]};});_0x2d8c54[_0x468c('0x2f')]=_[_0x468c('0x2a')](_0x2594e2,'name');_0x2d8c54[_0x468c('0x30')]=_['keys'](_0x554763[_0x468c('0x30')]);_0x2d8c54[_0x468c('0x31')]=_[_0x468c('0x32')](_0x2d8c54[_0x468c('0x2f')],_0x2d8c54['query']);_0x6d32a1[_0x468c('0x33')]=_[_0x468c('0x32')](_0x2d8c54[_0x468c('0x2f')],qs['fields'](_0x554763['query'][_0x468c('0x34')]));_0x6d32a1[_0x468c('0x33')]=_0x6d32a1['attributes'][_0x468c('0x35')]?_0x6d32a1[_0x468c('0x33')]:_0x2d8c54[_0x468c('0x2f')];if(!_0x554763[_0x468c('0x30')][_0x468c('0x36')](_0x468c('0x37'))){_0x6d32a1[_0x468c('0x1c')]=qs[_0x468c('0x1c')](_0x554763[_0x468c('0x30')]['limit']);_0x6d32a1[_0x468c('0x1a')]=qs[_0x468c('0x1a')](_0x554763[_0x468c('0x30')]['offset']);}_0x6d32a1[_0x468c('0x38')]=qs[_0x468c('0x39')](_0x554763['query']['sort']);_0x6d32a1[_0x468c('0x3a')]=qs[_0x468c('0x31')](_[_0x468c('0x3b')](_0x554763[_0x468c('0x30')],_0x2d8c54[_0x468c('0x31')]),_0x2594e2);if(_0x554763[_0x468c('0x30')][_0x468c('0x3c')]){_0x6d32a1[_0x468c('0x3a')]=_[_0x468c('0x3d')](_0x6d32a1[_0x468c('0x3a')],{'$or':_[_0x468c('0x2a')](_0x2594e2,function(_0x48cddd){if(_0x48cddd[_0x468c('0x2d')]!=='VIRTUAL'){var _0x7f199c={};_0x7f199c[_0x48cddd[_0x468c('0x27')]]={'$like':'%'+_0x554763[_0x468c('0x30')][_0x468c('0x3c')]+'%'};return _0x7f199c;}})});}_0x6d32a1=_[_0x468c('0x3d')]({},_0x6d32a1,_0x554763[_0x468c('0x3e')]);var _0x2c1fdb={'where':_0x6d32a1[_0x468c('0x3a')]};return db[_0x468c('0x2b')][_0x468c('0x1d')](_0x2c1fdb)['then'](function(_0x1cdeda){_0x300012[_0x468c('0x1d')]=_0x1cdeda;if(_0x554763[_0x468c('0x30')]['includeAll']){_0x6d32a1[_0x468c('0x3f')]=[{'all':!![]}];}return db[_0x468c('0x2b')][_0x468c('0x40')](_0x6d32a1);})[_0x468c('0x23')](function(_0x3d7e17){_0x300012['rows']=_0x3d7e17;return _0x300012;})[_0x468c('0x23')](respondWithFilteredResult(_0x3684dd,_0x6d32a1))['catch'](handleError(_0x3684dd,null));};exports['show']=function(_0x532110,_0x189c93){var _0x36523e={'raw':!![],'where':{'id':_0x532110[_0x468c('0x41')]['id']}},_0x3655ff={};_0x3655ff[_0x468c('0x2f')]=_['keys'](db[_0x468c('0x2b')][_0x468c('0x42')]);_0x3655ff[_0x468c('0x30')]=_['keys'](_0x532110['query']);_0x3655ff[_0x468c('0x31')]=_['intersection'](_0x3655ff[_0x468c('0x2f')],_0x3655ff['query']);_0x36523e[_0x468c('0x33')]=_[_0x468c('0x32')](_0x3655ff[_0x468c('0x2f')],qs['fields'](_0x532110['query']['fields']));_0x36523e[_0x468c('0x33')]=_0x36523e[_0x468c('0x33')]['length']?_0x36523e[_0x468c('0x33')]:_0x3655ff[_0x468c('0x2f')];if(_0x532110['query']['includeAll']){_0x36523e[_0x468c('0x3f')]=[{'all':!![]}];}_0x36523e=_[_0x468c('0x3d')]({},_0x36523e,_0x532110['options']);return db[_0x468c('0x2b')]['find'](_0x36523e)[_0x468c('0x23')](handleEntityNotFound(_0x189c93,null))[_0x468c('0x23')](respondWithResult(_0x189c93,null))[_0x468c('0x43')](handleError(_0x189c93,null));};exports[_0x468c('0x44')]=function(_0x5a3d8c,_0x261c84){return db[_0x468c('0x2b')][_0x468c('0x44')](_0x5a3d8c[_0x468c('0x45')],{})['then'](function(_0x2a9635){var _0x10a00b=_0x5a3d8c[_0x468c('0x46')][_0x468c('0x25')]({'plain':!![]});if(!_0x10a00b)throw new Error(_0x468c('0x47'));if(_0x10a00b[_0x468c('0x48')]===_0x468c('0x46')){var _0x437c51=_0x2a9635[_0x468c('0x25')]({'plain':!![]});var _0x56d22b=_0x468c('0x49');return db[_0x468c('0x4a')]['find']({'where':{'name':_0x56d22b,'userProfileId':_0x10a00b[_0x468c('0x4b')]},'raw':!![]})[_0x468c('0x23')](function(_0x230f51){if(_0x230f51&&_0x230f51['autoAssociation']===0x0){return db[_0x468c('0x4c')][_0x468c('0x44')]({'name':_0x437c51[_0x468c('0x27')],'resourceId':_0x437c51['id'],'type':_0x230f51[_0x468c('0x27')],'sectionId':_0x230f51['id']},{})[_0x468c('0x23')](function(){return _0x2a9635;});}else{return _0x2a9635;}})['catch'](function(_0x4c758d){logger['error'](_0x468c('0x4d'),_0x4c758d);throw _0x4c758d;});}return _0x2a9635;})[_0x468c('0x23')](respondWithResult(_0x261c84,0xc9))[_0x468c('0x43')](handleError(_0x261c84,null));};exports['update']=function(_0x58e736,_0x24fa46){if(_0x58e736['body']['id']){delete _0x58e736[_0x468c('0x45')]['id'];}return db[_0x468c('0x2b')][_0x468c('0x4e')]({'where':{'id':_0x58e736[_0x468c('0x41')]['id']}})[_0x468c('0x23')](handleEntityNotFound(_0x24fa46,null))['then'](saveUpdates(_0x58e736[_0x468c('0x45')],null))[_0x468c('0x23')](respondWithResult(_0x24fa46,null))[_0x468c('0x43')](handleError(_0x24fa46,null));};exports[_0x468c('0x24')]=function(_0x4b2754,_0x5acf3e){return db[_0x468c('0x2b')][_0x468c('0x4e')]({'where':{'id':_0x4b2754[_0x468c('0x41')]['id']}})[_0x468c('0x23')](handleEntityNotFound(_0x5acf3e,null))[_0x468c('0x23')](removeEntity(_0x5acf3e,null))['catch'](handleError(_0x5acf3e,null));};exports[_0x468c('0x4f')]=function(_0x334df0,_0x4d7257,_0x4682e0){return db[_0x468c('0x2b')][_0x468c('0x4e')]({'where':{'id':_0x334df0[_0x468c('0x41')]['id']},'attributes':[_0x468c('0x27'),_0x468c('0x50'),'savename',_0x468c('0x51')],'raw':!![]})[_0x468c('0x23')](handleEntityNotFound(_0x4d7257,null))[_0x468c('0x23')](function(_0x3675f2){if(_0x3675f2){if(!fs[_0x468c('0x52')](path[_0x468c('0x53')](config['root'],_0x468c('0x54'),_0x3675f2[_0x468c('0x55')]))){throw new db[(_0x468c('0x56'))][(_0x468c('0x57'))](_0x468c('0x58'));}if(_0x334df0[_0x468c('0x30')][_0x468c('0x59')]){return _0x4d7257[_0x468c('0x17')](0xc8);}return _0x4d7257[_0x468c('0x4f')](path[_0x468c('0x53')](config['root'],_0x468c('0x54'),_0x3675f2[_0x468c('0x55')]),util[_0x468c('0x5a')](_0x468c('0x5b'),_0x3675f2[_0x468c('0x50')]||_0x3675f2[_0x468c('0x27')],_0x3675f2[_0x468c('0x51')][_0x468c('0x5c')]()));}})[_0x468c('0x43')](handleError(_0x4d7257,null));}; \ No newline at end of file +var _0x6f6b=['apply','reject','save','update','destroy','get','UserProfileResource','then','error','stack','name','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','VIRTUAL','includeAll','include','show','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ExtractedReports','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','basename','savename','output','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range'];(function(_0x40b3f2,_0x2c4f5f){var _0x4ce90c=function(_0x516f31){while(--_0x516f31){_0x40b3f2['push'](_0x40b3f2['shift']());}};_0x4ce90c(++_0x2c4f5f);}(_0x6f6b,0x1b1));var _0xb6f6=function(_0x2e2d89,_0x4bb615){_0x2e2d89=_0x2e2d89-0x0;var _0x3aba90=_0x6f6b[_0x2e2d89];return _0x3aba90;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb6f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb6f6('0x1'));var moment=require(_0xb6f6('0x2'));var BPromise=require(_0xb6f6('0x3'));var Mustache=require(_0xb6f6('0x4'));var util=require(_0xb6f6('0x5'));var path=require(_0xb6f6('0x6'));var sox=require('sox');var csv=require(_0xb6f6('0x7'));var ejs=require(_0xb6f6('0x8'));var fs=require('fs');var fs_extra=require(_0xb6f6('0x9'));var _=require(_0xb6f6('0xa'));var squel=require('squel');var crypto=require(_0xb6f6('0xb'));var jsforce=require(_0xb6f6('0xc'));var deskjs=require(_0xb6f6('0xd'));var toCsv=require(_0xb6f6('0x7'));var querystring=require(_0xb6f6('0xe'));var Papa=require('papaparse');var Redis=require(_0xb6f6('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb6f6('0x10'));var as=require(_0xb6f6('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb6f6('0x12'))(_0xb6f6('0x13'));var utils=require(_0xb6f6('0x14'));var config=require(_0xb6f6('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xb6f6('0x16'))['db'];function respondWithStatusCode(_0x386a98,_0x4db88a){_0x4db88a=_0x4db88a||0xcc;return function(_0x8f98ec){if(_0x8f98ec){return _0x386a98[_0xb6f6('0x17')](_0x4db88a);}return _0x386a98[_0xb6f6('0x18')](_0x4db88a)[_0xb6f6('0x19')]();};}function respondWithResult(_0xe44d29,_0x29cf05){_0x29cf05=_0x29cf05||0xc8;return function(_0x1f9aaa){if(_0x1f9aaa){return _0xe44d29['status'](_0x29cf05)[_0xb6f6('0x1a')](_0x1f9aaa);}};}function respondWithFilteredResult(_0x3f13bb,_0x2894a0){return function(_0x33256f){if(_0x33256f){var _0x22e20c=typeof _0x2894a0[_0xb6f6('0x1b')]===_0xb6f6('0x1c')&&typeof _0x2894a0[_0xb6f6('0x1d')]==='undefined';var _0xb00958=_0x33256f[_0xb6f6('0x1e')];var _0x58c2db=_0x22e20c?0x0:_0x2894a0['offset'];var _0x5d5822=_0x22e20c?_0x33256f[_0xb6f6('0x1e')]:_0x2894a0[_0xb6f6('0x1b')]+_0x2894a0['limit'];var _0x1b27b5;if(_0x5d5822>=_0xb00958){_0x5d5822=_0xb00958;_0x1b27b5=0xc8;}else{_0x1b27b5=0xce;}_0x3f13bb[_0xb6f6('0x18')](_0x1b27b5);return _0x3f13bb['set'](_0xb6f6('0x1f'),_0x58c2db+'-'+_0x5d5822+'/'+_0xb00958)[_0xb6f6('0x1a')](_0x33256f);}return null;};}function patchUpdates(_0x43e7b8){return function(_0x3768d1){try{jsonpatch[_0xb6f6('0x20')](_0x3768d1,_0x43e7b8,!![]);}catch(_0x35a05e){return BPromise[_0xb6f6('0x21')](_0x35a05e);}return _0x3768d1[_0xb6f6('0x22')]();};}function saveUpdates(_0x6a8418,_0x4c2c18){return function(_0x56e3ee){if(_0x56e3ee){return _0x56e3ee[_0xb6f6('0x23')](_0x6a8418)['then'](function(_0x314613){return _0x314613;});}return null;};}function removeEntity(_0x31ed84,_0xedc125){return function(_0x651538){if(_0x651538){return _0x651538[_0xb6f6('0x24')]()['then'](function(){var _0x420205=_0x651538[_0xb6f6('0x25')]({'plain':!![]});var _0x303055='ExtractedReports';return db[_0xb6f6('0x26')][_0xb6f6('0x24')]({'where':{'type':_0x303055,'resourceId':_0x420205['id']}})[_0xb6f6('0x27')](function(){return _0x651538;});})[_0xb6f6('0x27')](function(){_0x31ed84[_0xb6f6('0x18')](0xcc)[_0xb6f6('0x19')]();});}};}function handleEntityNotFound(_0x5b3b5f,_0x2e6c01){return function(_0x31c699){if(!_0x31c699){_0x5b3b5f[_0xb6f6('0x17')](0x194);}return _0x31c699;};}function handleError(_0xe32591,_0x3d89db){_0x3d89db=_0x3d89db||0x1f4;return function(_0xc5df35){logger[_0xb6f6('0x28')](_0xc5df35[_0xb6f6('0x29')]);if(_0xc5df35[_0xb6f6('0x2a')]){delete _0xc5df35[_0xb6f6('0x2a')];}_0xe32591[_0xb6f6('0x18')](_0x3d89db)['send'](_0xc5df35);};}exports['index']=function(_0x1356b5,_0x3bc717){var _0xea7561={},_0x5e2c9d={},_0x279c57={'count':0x0,'rows':[]};var _0x533331=_[_0xb6f6('0x2b')](db[_0xb6f6('0x2c')][_0xb6f6('0x2d')],function(_0x225075){return{'name':_0x225075[_0xb6f6('0x2e')],'type':_0x225075[_0xb6f6('0x2f')][_0xb6f6('0x30')]};});_0x5e2c9d[_0xb6f6('0x31')]=_[_0xb6f6('0x2b')](_0x533331,_0xb6f6('0x2a'));_0x5e2c9d['query']=_[_0xb6f6('0x32')](_0x1356b5[_0xb6f6('0x33')]);_0x5e2c9d[_0xb6f6('0x34')]=_[_0xb6f6('0x35')](_0x5e2c9d[_0xb6f6('0x31')],_0x5e2c9d[_0xb6f6('0x33')]);_0xea7561[_0xb6f6('0x36')]=_['intersection'](_0x5e2c9d[_0xb6f6('0x31')],qs[_0xb6f6('0x37')](_0x1356b5[_0xb6f6('0x33')]['fields']));_0xea7561[_0xb6f6('0x36')]=_0xea7561['attributes'][_0xb6f6('0x38')]?_0xea7561[_0xb6f6('0x36')]:_0x5e2c9d[_0xb6f6('0x31')];if(!_0x1356b5['query']['hasOwnProperty'](_0xb6f6('0x39'))){_0xea7561[_0xb6f6('0x1d')]=qs[_0xb6f6('0x1d')](_0x1356b5[_0xb6f6('0x33')][_0xb6f6('0x1d')]);_0xea7561[_0xb6f6('0x1b')]=qs[_0xb6f6('0x1b')](_0x1356b5[_0xb6f6('0x33')]['offset']);}_0xea7561[_0xb6f6('0x3a')]=qs[_0xb6f6('0x3b')](_0x1356b5[_0xb6f6('0x33')][_0xb6f6('0x3b')]);_0xea7561[_0xb6f6('0x3c')]=qs['filters'](_['pick'](_0x1356b5[_0xb6f6('0x33')],_0x5e2c9d[_0xb6f6('0x34')]),_0x533331);if(_0x1356b5['query'][_0xb6f6('0x3d')]){_0xea7561['where']=_['merge'](_0xea7561[_0xb6f6('0x3c')],{'$or':_[_0xb6f6('0x2b')](_0x533331,function(_0x347e1c){if(_0x347e1c['type']!==_0xb6f6('0x3e')){var _0x268245={};_0x268245[_0x347e1c['name']]={'$like':'%'+_0x1356b5[_0xb6f6('0x33')][_0xb6f6('0x3d')]+'%'};return _0x268245;}})});}_0xea7561=_['merge']({},_0xea7561,_0x1356b5['options']);var _0x58d175={'where':_0xea7561[_0xb6f6('0x3c')]};return db[_0xb6f6('0x2c')][_0xb6f6('0x1e')](_0x58d175)[_0xb6f6('0x27')](function(_0xee746d){_0x279c57['count']=_0xee746d;if(_0x1356b5[_0xb6f6('0x33')][_0xb6f6('0x3f')]){_0xea7561[_0xb6f6('0x40')]=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0xea7561);})[_0xb6f6('0x27')](function(_0x554364){_0x279c57['rows']=_0x554364;return _0x279c57;})[_0xb6f6('0x27')](respondWithFilteredResult(_0x3bc717,_0xea7561))['catch'](handleError(_0x3bc717,null));};exports[_0xb6f6('0x41')]=function(_0x3d654d,_0x5cc392){var _0xabce34={'raw':!![],'where':{'id':_0x3d654d['params']['id']}},_0x4e22d4={};_0x4e22d4['model']=_[_0xb6f6('0x32')](db[_0xb6f6('0x2c')]['rawAttributes']);_0x4e22d4[_0xb6f6('0x33')]=_['keys'](_0x3d654d['query']);_0x4e22d4[_0xb6f6('0x34')]=_['intersection'](_0x4e22d4[_0xb6f6('0x31')],_0x4e22d4[_0xb6f6('0x33')]);_0xabce34['attributes']=_['intersection'](_0x4e22d4[_0xb6f6('0x31')],qs['fields'](_0x3d654d[_0xb6f6('0x33')][_0xb6f6('0x37')]));_0xabce34[_0xb6f6('0x36')]=_0xabce34['attributes'][_0xb6f6('0x38')]?_0xabce34['attributes']:_0x4e22d4[_0xb6f6('0x31')];if(_0x3d654d[_0xb6f6('0x33')][_0xb6f6('0x3f')]){_0xabce34[_0xb6f6('0x40')]=[{'all':!![]}];}_0xabce34=_['merge']({},_0xabce34,_0x3d654d['options']);return db[_0xb6f6('0x2c')][_0xb6f6('0x42')](_0xabce34)[_0xb6f6('0x27')](handleEntityNotFound(_0x5cc392,null))['then'](respondWithResult(_0x5cc392,null))['catch'](handleError(_0x5cc392,null));};exports['create']=function(_0x28ea17,_0x114c3c){return db[_0xb6f6('0x2c')][_0xb6f6('0x43')](_0x28ea17[_0xb6f6('0x44')],{})[_0xb6f6('0x27')](function(_0x1ba8e4){var _0x4a226c=_0x28ea17['user']['get']({'plain':!![]});if(!_0x4a226c)throw new Error(_0xb6f6('0x45'));if(_0x4a226c[_0xb6f6('0x46')]===_0xb6f6('0x47')){var _0x584793=_0x1ba8e4[_0xb6f6('0x25')]({'plain':!![]});var _0x4d814c=_0xb6f6('0x48');return db[_0xb6f6('0x49')][_0xb6f6('0x42')]({'where':{'name':_0x4d814c,'userProfileId':_0x4a226c[_0xb6f6('0x4a')]},'raw':!![]})[_0xb6f6('0x27')](function(_0x1f21a2){if(_0x1f21a2&&_0x1f21a2[_0xb6f6('0x4b')]===0x0){return db[_0xb6f6('0x26')]['create']({'name':_0x584793[_0xb6f6('0x2a')],'resourceId':_0x584793['id'],'type':_0x1f21a2['name'],'sectionId':_0x1f21a2['id']},{})['then'](function(){return _0x1ba8e4;});}else{return _0x1ba8e4;}})[_0xb6f6('0x4c')](function(_0x5c8a5a){logger['error'](_0xb6f6('0x4d'),_0x5c8a5a);throw _0x5c8a5a;});}return _0x1ba8e4;})[_0xb6f6('0x27')](respondWithResult(_0x114c3c,0xc9))[_0xb6f6('0x4c')](handleError(_0x114c3c,null));};exports[_0xb6f6('0x23')]=function(_0x3a868f,_0x2a9499){if(_0x3a868f['body']['id']){delete _0x3a868f[_0xb6f6('0x44')]['id'];}return db[_0xb6f6('0x2c')]['find']({'where':{'id':_0x3a868f['params']['id']}})[_0xb6f6('0x27')](handleEntityNotFound(_0x2a9499,null))[_0xb6f6('0x27')](saveUpdates(_0x3a868f['body'],null))['then'](respondWithResult(_0x2a9499,null))[_0xb6f6('0x4c')](handleError(_0x2a9499,null));};exports[_0xb6f6('0x24')]=function(_0x50a21e,_0x427b39){return db[_0xb6f6('0x2c')][_0xb6f6('0x42')]({'where':{'id':_0x50a21e[_0xb6f6('0x4e')]['id']}})[_0xb6f6('0x27')](handleEntityNotFound(_0x427b39,null))[_0xb6f6('0x27')](removeEntity(_0x427b39,null))[_0xb6f6('0x4c')](handleError(_0x427b39,null));};exports[_0xb6f6('0x4f')]=function(_0x12fd6a,_0x1b4fcf,_0x3026b1){return db['AnalyticExtractedReport'][_0xb6f6('0x42')]({'where':{'id':_0x12fd6a['params']['id']},'attributes':[_0xb6f6('0x2a'),_0xb6f6('0x50'),_0xb6f6('0x51'),_0xb6f6('0x52')],'raw':!![]})[_0xb6f6('0x27')](handleEntityNotFound(_0x1b4fcf,null))[_0xb6f6('0x27')](function(_0x5170d6){if(_0x5170d6){if(!fs['existsSync'](path[_0xb6f6('0x53')](config[_0xb6f6('0x54')],_0xb6f6('0x55'),_0x5170d6[_0xb6f6('0x51')]))){throw new db[(_0xb6f6('0x56'))][(_0xb6f6('0x57'))](_0xb6f6('0x58'));}if(_0x12fd6a['query'][_0xb6f6('0x59')]){return _0x1b4fcf[_0xb6f6('0x17')](0xc8);}return _0x1b4fcf['download'](path['join'](config[_0xb6f6('0x54')],_0xb6f6('0x55'),_0x5170d6[_0xb6f6('0x51')]),util[_0xb6f6('0x5a')](_0xb6f6('0x5b'),_0x5170d6[_0xb6f6('0x50')]||_0x5170d6['name'],_0x5170d6[_0xb6f6('0x52')][_0xb6f6('0x5c')]()));}})[_0xb6f6('0x4c')](handleError(_0x1b4fcf,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 4cdd745..94715ca 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 _0x559b=['exports','define','AnalyticExtractedReport','analytics_extracted_reports','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes'];(function(_0x9a8e05,_0x95ed11){var _0x2a6ef5=function(_0x122ef2){while(--_0x122ef2){_0x9a8e05['push'](_0x9a8e05['shift']());}};_0x2a6ef5(++_0x95ed11);}(_0x559b,0x1c4));var _0xb559=function(_0x18e0f7,_0x3e567c){_0x18e0f7=_0x18e0f7-0x0;var _0x4364f7=_0x559b[_0x18e0f7];return _0x4364f7;};'use strict';var _=require('lodash');var util=require(_0xb559('0x0'));var logger=require(_0xb559('0x1'))(_0xb559('0x2'));var moment=require(_0xb559('0x3'));var BPromise=require(_0xb559('0x4'));var rp=require(_0xb559('0x5'));var fs=require('fs');var path=require(_0xb559('0x6'));var rimraf=require(_0xb559('0x7'));var config=require(_0xb559('0x8'));var attributes=require(_0xb559('0x9'));module[_0xb559('0xa')]=function(_0x1fd596,_0x182622){return _0x1fd596[_0xb559('0xb')](_0xb559('0xc'),attributes,{'tableName':_0xb559('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc384=['analytics_extracted_reports','lodash','util','../../config/logger','moment','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport'];(function(_0x46c50d,_0x388015){var _0x172939=function(_0x4ab892){while(--_0x4ab892){_0x46c50d['push'](_0x46c50d['shift']());}};_0x172939(++_0x388015);}(_0xc384,0x140));var _0x4c38=function(_0x3aa6a5,_0x4c6b25){_0x3aa6a5=_0x3aa6a5-0x0;var _0xe8a82a=_0xc384[_0x3aa6a5];return _0xe8a82a;};'use strict';var _=require(_0x4c38('0x0'));var util=require(_0x4c38('0x1'));var logger=require(_0x4c38('0x2'))('api');var moment=require(_0x4c38('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4c38('0x4'));var config=require(_0x4c38('0x5'));var attributes=require(_0x4c38('0x6'));module[_0x4c38('0x7')]=function(_0x78bd71,_0x42436a){return _0x78bd71[_0x4c38('0x8')](_0x4c38('0x9'),attributes,{'tableName':_0x4c38('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 0f6d592..692cfc1 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 _0xa940=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa940,0x113));var _0x0a94=function(_0x10e284,_0x1b8128){_0x10e284=_0x10e284-0x0;var _0x137a2b=_0xa940[_0x10e284];return _0x137a2b;};'use strict';var _=require(_0x0a94('0x0'));var util=require(_0x0a94('0x1'));var moment=require(_0x0a94('0x2'));var BPromise=require(_0x0a94('0x3'));var rs=require(_0x0a94('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0a94('0x5'));var logger=require(_0x0a94('0x6'))(_0x0a94('0x7'));var config=require(_0x0a94('0x8'));var jayson=require(_0x0a94('0x9'));var client=jayson[_0x0a94('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a05cc,_0x481b8c,_0x5e0888){return new BPromise(function(_0x2f24fa,_0x795d77){return client['request'](_0x3a05cc,_0x5e0888)[_0x0a94('0xb')](function(_0x163814){logger[_0x0a94('0xc')](_0x0a94('0xd'),_0x481b8c,_0x0a94('0xe'));logger[_0x0a94('0xf')](_0x0a94('0x10'),_0x481b8c,_0x0a94('0xe'),JSON[_0x0a94('0x11')](_0x163814));if(_0x163814[_0x0a94('0x12')]){if(_0x163814['error'][_0x0a94('0x13')]===0x1f4){logger['error'](_0x0a94('0xd'),_0x481b8c,_0x163814[_0x0a94('0x12')][_0x0a94('0x14')]);return _0x795d77(_0x163814[_0x0a94('0x12')]['message']);}logger[_0x0a94('0x12')](_0x0a94('0xd'),_0x481b8c,_0x163814[_0x0a94('0x12')][_0x0a94('0x14')]);return _0x2f24fa(_0x163814[_0x0a94('0x12')][_0x0a94('0x14')]);}else{logger[_0x0a94('0xc')](_0x0a94('0xd'),_0x481b8c,'request\x20sent');_0x2f24fa(_0x163814[_0x0a94('0x15')][_0x0a94('0x14')]);}})[_0x0a94('0x16')](function(_0x4d3799){logger[_0x0a94('0x12')](_0x0a94('0xd'),_0x481b8c,_0x4d3799);_0x795d77(_0x4d3799);});});} \ No newline at end of file +var _0x56dc=['http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x56dc,0xfd));var _0xc56d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x56dc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc56d('0x0'));var util=require('util');var moment=require(_0xc56d('0x1'));var BPromise=require(_0xc56d('0x2'));var rs=require(_0xc56d('0x3'));var fs=require('fs');var Redis=require(_0xc56d('0x4'));var db=require(_0xc56d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc56d('0x6'))(_0xc56d('0x7'));var config=require(_0xc56d('0x8'));var jayson=require(_0xc56d('0x9'));var client=jayson[_0xc56d('0xa')][_0xc56d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x571341,_0x452715,_0x24b556){return new BPromise(function(_0x3ac7cd,_0x51ca01){return client[_0xc56d('0xc')](_0x571341,_0x24b556)[_0xc56d('0xd')](function(_0x3ff2cb){logger[_0xc56d('0xe')](_0xc56d('0xf'),_0x452715,'request\x20sent');logger[_0xc56d('0x10')](_0xc56d('0x11'),_0x452715,_0xc56d('0x12'),JSON['stringify'](_0x3ff2cb));if(_0x3ff2cb[_0xc56d('0x13')]){if(_0x3ff2cb[_0xc56d('0x13')][_0xc56d('0x14')]===0x1f4){logger[_0xc56d('0x13')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x452715,_0x3ff2cb[_0xc56d('0x13')][_0xc56d('0x15')]);return _0x51ca01(_0x3ff2cb[_0xc56d('0x13')]['message']);}logger[_0xc56d('0x13')](_0xc56d('0xf'),_0x452715,_0x3ff2cb[_0xc56d('0x13')][_0xc56d('0x15')]);return _0x3ac7cd(_0x3ff2cb['error'][_0xc56d('0x15')]);}else{logger[_0xc56d('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x452715,'request\x20sent');_0x3ac7cd(_0x3ff2cb[_0xc56d('0x16')][_0xc56d('0x15')]);}})[_0xc56d('0x17')](function(_0x1d142c){logger['error'](_0xc56d('0xf'),_0x452715,_0x1d142c);_0x51ca01(_0x1d142c);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 1985ebc..917f887 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 _0x4616=['exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','/:id','show','/:id/download','download','post','create','update'];(function(_0x4fc177,_0x1fef76){var _0x3cdecb=function(_0x3caebc){while(--_0x3caebc){_0x4fc177['push'](_0x4fc177['shift']());}};_0x3cdecb(++_0x1fef76);}(_0x4616,0x169));var _0x6461=function(_0x122274,_0x34dc4e){_0x122274=_0x122274-0x0;var _0x1164c3=_0x4616[_0x122274];return _0x1164c3;};'use strict';var multer=require(_0x6461('0x0'));var util=require(_0x6461('0x1'));var path=require('path');var timeout=require(_0x6461('0x2'));var express=require(_0x6461('0x3'));var router=express['Router']();var fs_extra=require(_0x6461('0x4'));var auth=require(_0x6461('0x5'));var interaction=require(_0x6461('0x6'));var config=require('../../config/environment');var controller=require(_0x6461('0x7'));router[_0x6461('0x8')]('/',auth[_0x6461('0x9')](),controller['index']);router['get'](_0x6461('0xa'),auth[_0x6461('0x9')](),controller[_0x6461('0xb')]);router[_0x6461('0x8')](_0x6461('0xc'),auth['isAuthenticated'](),controller[_0x6461('0xd')]);router[_0x6461('0xe')]('/',auth[_0x6461('0x9')](),controller[_0x6461('0xf')]);router['put'](_0x6461('0xa'),auth[_0x6461('0x9')](),controller[_0x6461('0x10')]);router['delete'](_0x6461('0xa'),auth[_0x6461('0x9')](),controller['destroy']);module[_0x6461('0x11')]=router; \ No newline at end of file +var _0xede6=['isAuthenticated','index','/:id','show','/:id/download','post','create','put','delete','destroy','exports','multer','path','express','fs-extra','../../config/environment','get'];(function(_0x163f27,_0x35f269){var _0x11f0a1=function(_0x270615){while(--_0x270615){_0x163f27['push'](_0x163f27['shift']());}};_0x11f0a1(++_0x35f269);}(_0xede6,0x14e));var _0x6ede=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xede6[_0x49ca18];return _0x145d54;};'use strict';var multer=require(_0x6ede('0x0'));var util=require('util');var path=require(_0x6ede('0x1'));var timeout=require('connect-timeout');var express=require(_0x6ede('0x2'));var router=express['Router']();var fs_extra=require(_0x6ede('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6ede('0x4'));var controller=require('./analyticExtractedReport.controller');router[_0x6ede('0x5')]('/',auth[_0x6ede('0x6')](),controller[_0x6ede('0x7')]);router[_0x6ede('0x5')](_0x6ede('0x8'),auth[_0x6ede('0x6')](),controller[_0x6ede('0x9')]);router[_0x6ede('0x5')](_0x6ede('0xa'),auth['isAuthenticated'](),controller['download']);router[_0x6ede('0xb')]('/',auth['isAuthenticated'](),controller[_0x6ede('0xc')]);router[_0x6ede('0xd')](_0x6ede('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x6ede('0xe')](_0x6ede('0x8'),auth[_0x6ede('0x6')](),controller[_0x6ede('0xf')]);module[_0x6ede('0x10')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index b6089fc..0b7b8d7 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 _0x71e8=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x71e8,0xc5));var _0x871e=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x71e8[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0x871e('0x0'));module[_0x871e('0x1')]={'field':{'type':Sequelize[_0x871e('0x2')]},'alias':{'type':Sequelize[_0x871e('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x871e('0x3')]},'groupBy':{'type':Sequelize[_0x871e('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x871e('0x3')]},'custom':{'type':Sequelize[_0x871e('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xf2a0=['BOOLEAN','sequelize','exports','STRING'];(function(_0x56507e,_0x29e0ef){var _0x159a9a=function(_0x605629){while(--_0x605629){_0x56507e['push'](_0x56507e['shift']());}};_0x159a9a(++_0x29e0ef);}(_0xf2a0,0x1a5));var _0x0f2a=function(_0x406fbb,_0x1093e5){_0x406fbb=_0x406fbb-0x0;var _0x8e921d=_0xf2a0[_0x406fbb];return _0x8e921d;};'use strict';var Sequelize=require(_0x0f2a('0x0'));module[_0x0f2a('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x0f2a('0x2')]},'function':{'type':Sequelize[_0x0f2a('0x2')]},'format':{'type':Sequelize[_0x0f2a('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x0f2a('0x2')]},'custom':{'type':Sequelize[_0x0f2a('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index d2434ad..22a5a37 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 _0xeaff=['crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','name','send','index','AnalyticFieldReport','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','options','include','rows','catch','show','rawAttributes','includeAll','find','create','body','bulkCreate','params','destroy','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel'];(function(_0xcead5,_0x1a38dd){var _0x5b74e0=function(_0x4eb6c3){while(--_0x4eb6c3){_0xcead5['push'](_0xcead5['shift']());}};_0x5b74e0(++_0x1a38dd);}(_0xeaff,0x19f));var _0xfeaf=function(_0x4b1bd7,_0x5bae1a){_0x4b1bd7=_0x4b1bd7-0x0;var _0x34d11c=_0xeaff[_0x4b1bd7];return _0x34d11c;};'use strict';var emlformat=require(_0xfeaf('0x0'));var rimraf=require(_0xfeaf('0x1'));var zipdir=require(_0xfeaf('0x2'));var jsonpatch=require(_0xfeaf('0x3'));var rp=require(_0xfeaf('0x4'));var moment=require(_0xfeaf('0x5'));var BPromise=require(_0xfeaf('0x6'));var Mustache=require(_0xfeaf('0x7'));var util=require(_0xfeaf('0x8'));var path=require(_0xfeaf('0x9'));var sox=require(_0xfeaf('0xa'));var csv=require(_0xfeaf('0xb'));var ejs=require(_0xfeaf('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfeaf('0xd'));var squel=require(_0xfeaf('0xe'));var crypto=require(_0xfeaf('0xf'));var jsforce=require(_0xfeaf('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xfeaf('0xb'));var querystring=require(_0xfeaf('0x11'));var Papa=require(_0xfeaf('0x12'));var Redis=require(_0xfeaf('0x13'));var authService=require(_0xfeaf('0x14'));var qs=require(_0xfeaf('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xfeaf('0x16'))('api');var utils=require(_0xfeaf('0x17'));var config=require(_0xfeaf('0x18'));var licenseUtil=require(_0xfeaf('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x30da30,_0x515b38){_0x515b38=_0x515b38||0xcc;return function(_0x1d90ef){if(_0x1d90ef){return _0x30da30['sendStatus'](_0x515b38);}return _0x30da30[_0xfeaf('0x1a')](_0x515b38)[_0xfeaf('0x1b')]();};}function respondWithResult(_0x54d950,_0xcb2b87){_0xcb2b87=_0xcb2b87||0xc8;return function(_0x29fe90){if(_0x29fe90){return _0x54d950[_0xfeaf('0x1a')](_0xcb2b87)[_0xfeaf('0x1c')](_0x29fe90);}};}function respondWithFilteredResult(_0x1beaeb,_0x57cac2){return function(_0xaac8ec){if(_0xaac8ec){var _0xf3cc9e=typeof _0x57cac2[_0xfeaf('0x1d')]==='undefined'&&typeof _0x57cac2[_0xfeaf('0x1e')]===_0xfeaf('0x1f');var _0x1b758b=_0xaac8ec[_0xfeaf('0x20')];var _0x5e45b9=_0xf3cc9e?0x0:_0x57cac2['offset'];var _0x7bab54=_0xf3cc9e?_0xaac8ec[_0xfeaf('0x20')]:_0x57cac2[_0xfeaf('0x1d')]+_0x57cac2[_0xfeaf('0x1e')];var _0x5291ce;if(_0x7bab54>=_0x1b758b){_0x7bab54=_0x1b758b;_0x5291ce=0xc8;}else{_0x5291ce=0xce;}_0x1beaeb[_0xfeaf('0x1a')](_0x5291ce);return _0x1beaeb[_0xfeaf('0x21')](_0xfeaf('0x22'),_0x5e45b9+'-'+_0x7bab54+'/'+_0x1b758b)[_0xfeaf('0x1c')](_0xaac8ec);}return null;};}function patchUpdates(_0x4e431f){return function(_0x488eb8){try{jsonpatch[_0xfeaf('0x23')](_0x488eb8,_0x4e431f,!![]);}catch(_0x5be25a){return BPromise[_0xfeaf('0x24')](_0x5be25a);}return _0x488eb8[_0xfeaf('0x25')]();};}function saveUpdates(_0x40aa91,_0x5c52f1){return function(_0x494ef0){if(_0x494ef0){return _0x494ef0[_0xfeaf('0x26')](_0x40aa91)[_0xfeaf('0x27')](function(_0xec422f){return _0xec422f;});}return null;};}function removeEntity(_0xb7229b,_0x30ed77){return function(_0x19b933){if(_0x19b933){return _0x19b933['destroy']()[_0xfeaf('0x27')](function(){_0xb7229b[_0xfeaf('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1cbe20,_0x1c416){return function(_0x3c3145){if(!_0x3c3145){_0x1cbe20[_0xfeaf('0x28')](0x194);}return _0x3c3145;};}function handleError(_0x57addc,_0x3999a4){_0x3999a4=_0x3999a4||0x1f4;return function(_0x42be5e){logger[_0xfeaf('0x29')](_0x42be5e['stack']);if(_0x42be5e[_0xfeaf('0x2a')]){delete _0x42be5e[_0xfeaf('0x2a')];}_0x57addc[_0xfeaf('0x1a')](_0x3999a4)[_0xfeaf('0x2b')](_0x42be5e);};}exports[_0xfeaf('0x2c')]=function(_0x26dafe,_0x3857cc){var _0x9068b7={},_0xd88fa4={},_0x2a3d32={'count':0x0,'rows':[]};var _0x524cdd=_['map'](db[_0xfeaf('0x2d')]['rawAttributes'],function(_0x6cee3a){return{'name':_0x6cee3a[_0xfeaf('0x2e')],'type':_0x6cee3a[_0xfeaf('0x2f')][_0xfeaf('0x30')]};});_0xd88fa4['model']=_[_0xfeaf('0x31')](_0x524cdd,'name');_0xd88fa4[_0xfeaf('0x32')]=_[_0xfeaf('0x33')](_0x26dafe[_0xfeaf('0x32')]);_0xd88fa4[_0xfeaf('0x34')]=_[_0xfeaf('0x35')](_0xd88fa4['model'],_0xd88fa4[_0xfeaf('0x32')]);_0x9068b7['attributes']=_['intersection'](_0xd88fa4[_0xfeaf('0x36')],qs[_0xfeaf('0x37')](_0x26dafe['query'][_0xfeaf('0x37')]));_0x9068b7[_0xfeaf('0x38')]=_0x9068b7[_0xfeaf('0x38')][_0xfeaf('0x39')]?_0x9068b7[_0xfeaf('0x38')]:_0xd88fa4['model'];if(!_0x26dafe['query'][_0xfeaf('0x3a')](_0xfeaf('0x3b'))){_0x9068b7[_0xfeaf('0x1e')]=qs[_0xfeaf('0x1e')](_0x26dafe[_0xfeaf('0x32')][_0xfeaf('0x1e')]);_0x9068b7['offset']=qs[_0xfeaf('0x1d')](_0x26dafe[_0xfeaf('0x32')][_0xfeaf('0x1d')]);}_0x9068b7[_0xfeaf('0x3c')]=qs['sort'](_0x26dafe[_0xfeaf('0x32')][_0xfeaf('0x3d')]);_0x9068b7[_0xfeaf('0x3e')]=qs[_0xfeaf('0x34')](_['pick'](_0x26dafe[_0xfeaf('0x32')],_0xd88fa4[_0xfeaf('0x34')]),_0x524cdd);if(_0x26dafe[_0xfeaf('0x32')]['filter']){_0x9068b7[_0xfeaf('0x3e')]=_['merge'](_0x9068b7['where'],{'$or':_['map'](_0x524cdd,function(_0x42f23d){if(_0x42f23d[_0xfeaf('0x2f')]!==_0xfeaf('0x3f')){var _0xccfe35={};_0xccfe35[_0x42f23d[_0xfeaf('0x2a')]]={'$like':'%'+_0x26dafe['query'][_0xfeaf('0x40')]+'%'};return _0xccfe35;}})});}_0x9068b7=_[_0xfeaf('0x41')]({},_0x9068b7,_0x26dafe[_0xfeaf('0x42')]);var _0x5c790d={'where':_0x9068b7[_0xfeaf('0x3e')]};return db['AnalyticFieldReport'][_0xfeaf('0x20')](_0x5c790d)['then'](function(_0xf06f58){_0x2a3d32[_0xfeaf('0x20')]=_0xf06f58;if(_0x26dafe['query']['includeAll']){_0x9068b7[_0xfeaf('0x43')]=[{'all':!![]}];}return db[_0xfeaf('0x2d')]['findAll'](_0x9068b7);})['then'](function(_0x27aabb){_0x2a3d32[_0xfeaf('0x44')]=_0x27aabb;return _0x2a3d32;})[_0xfeaf('0x27')](respondWithFilteredResult(_0x3857cc,_0x9068b7))[_0xfeaf('0x45')](handleError(_0x3857cc,null));};exports[_0xfeaf('0x46')]=function(_0x308c6e,_0x277c4b){var _0x2eb6db={'raw':![],'where':{'id':_0x308c6e['params']['id']}},_0x4cf7a9={};_0x4cf7a9['model']=_[_0xfeaf('0x33')](db[_0xfeaf('0x2d')][_0xfeaf('0x47')]);_0x4cf7a9[_0xfeaf('0x32')]=_['keys'](_0x308c6e[_0xfeaf('0x32')]);_0x4cf7a9[_0xfeaf('0x34')]=_[_0xfeaf('0x35')](_0x4cf7a9[_0xfeaf('0x36')],_0x4cf7a9[_0xfeaf('0x32')]);_0x2eb6db[_0xfeaf('0x38')]=_[_0xfeaf('0x35')](_0x4cf7a9[_0xfeaf('0x36')],qs[_0xfeaf('0x37')](_0x308c6e[_0xfeaf('0x32')][_0xfeaf('0x37')]));_0x2eb6db[_0xfeaf('0x38')]=_0x2eb6db[_0xfeaf('0x38')][_0xfeaf('0x39')]?_0x2eb6db['attributes']:_0x4cf7a9['model'];if(_0x308c6e[_0xfeaf('0x32')][_0xfeaf('0x48')]){_0x2eb6db[_0xfeaf('0x43')]=[{'all':!![]}];}_0x2eb6db=_[_0xfeaf('0x41')]({},_0x2eb6db,_0x308c6e[_0xfeaf('0x42')]);return db[_0xfeaf('0x2d')][_0xfeaf('0x49')](_0x2eb6db)['then'](handleEntityNotFound(_0x277c4b,null))[_0xfeaf('0x27')](respondWithResult(_0x277c4b,null))[_0xfeaf('0x45')](handleError(_0x277c4b,null));};exports['create']=function(_0x4ad377,_0x44687c){return db['AnalyticFieldReport'][_0xfeaf('0x4a')](_0x4ad377[_0xfeaf('0x4b')],{})[_0xfeaf('0x27')](respondWithResult(_0x44687c,0xc9))[_0xfeaf('0x45')](handleError(_0x44687c,null));};exports['bulkCreate']=function(_0x36ab2c,_0x2805ea){return db['AnalyticFieldReport'][_0xfeaf('0x4c')](_0x36ab2c[_0xfeaf('0x4b')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x2805ea,0xc9))[_0xfeaf('0x45')](handleError(_0x2805ea,null));};exports['update']=function(_0x1f7539,_0x1988c8){if(_0x1f7539[_0xfeaf('0x4b')]['id']){delete _0x1f7539[_0xfeaf('0x4b')]['id'];}return db[_0xfeaf('0x2d')]['find']({'where':{'id':_0x1f7539[_0xfeaf('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1988c8,null))[_0xfeaf('0x27')](saveUpdates(_0x1f7539[_0xfeaf('0x4b')],null))[_0xfeaf('0x27')](respondWithResult(_0x1988c8,null))['catch'](handleError(_0x1988c8,null));};exports[_0xfeaf('0x4e')]=function(_0x4fd9b6,_0x5644dc){return db[_0xfeaf('0x2d')][_0xfeaf('0x49')]({'where':{'id':_0x4fd9b6[_0xfeaf('0x4d')]['id']}})[_0xfeaf('0x27')](handleEntityNotFound(_0x5644dc,null))[_0xfeaf('0x27')](removeEntity(_0x5644dc,null))[_0xfeaf('0x45')](handleError(_0x5644dc,null));};exports['bulkDestroy']=function(_0x845a06,_0x40e1b8){return db['AnalyticFieldReport'][_0xfeaf('0x4e')]({'where':{'id':_0x845a06[_0xfeaf('0x32')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0xfeaf('0x27')](respondWithResult(_0x40e1b8,0xcc))[_0xfeaf('0x45')](handleError(_0x40e1b8,null));};exports[_0xfeaf('0x4f')]=function(_0x46e67f,_0x1ba7f9,_0x17a1f9){return db[_0xfeaf('0x50')][_0xfeaf('0x51')]({'where':{'id':_0x46e67f[_0xfeaf('0x4d')]['id']}})[_0xfeaf('0x27')](handleEntityNotFound(_0x1ba7f9,null))[_0xfeaf('0x27')](function(_0x5a7ec9){if(_0x5a7ec9){return db[_0xfeaf('0x52')][_0xfeaf('0x53')](function(_0x5ac219){return db[_0xfeaf('0x2d')]['destroy']({'where':{'CustomReportId':_0x46e67f[_0xfeaf('0x4d')]['id']},'transaction':_0x5ac219})[_0xfeaf('0x27')](function(_0x264671){var _0x215582=_[_0xfeaf('0x31')](_0x46e67f[_0xfeaf('0x4b')],function(_0x499d5a){delete _0x499d5a['id'];_0x499d5a[_0xfeaf('0x54')]=_0x46e67f[_0xfeaf('0x4d')]['id'];return _0x499d5a;});return db[_0xfeaf('0x2d')][_0xfeaf('0x4c')](_0x215582,{'transaction':_0x5ac219});});})['then'](function(){return db[_0xfeaf('0x2d')][_0xfeaf('0x55')]({'where':{'CustomReportId':_0x46e67f[_0xfeaf('0x4d')]['id']}});});}})[_0xfeaf('0x27')](respondWithResult(_0x1ba7f9,null))['catch'](handleError(_0x1ba7f9,null));}; \ No newline at end of file +var _0xaefd=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','error','stack','name','send','index','map','AnalyticFieldReport','fieldName','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','show','params','rawAttributes','catch','create','body','bulkCreate','find','destroy','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','eml-format','rimraf','fast-json-patch','request-promise','moment','sox','to-csv','ejs','fs-extra'];(function(_0x2d364e,_0x301c5e){var _0x1b9312=function(_0x1b05bb){while(--_0x1b05bb){_0x2d364e['push'](_0x2d364e['shift']());}};_0x1b9312(++_0x301c5e);}(_0xaefd,0x1ef));var _0xdaef=function(_0x1b77c8,_0x431121){_0x1b77c8=_0x1b77c8-0x0;var _0x490a57=_0xaefd[_0x1b77c8];return _0x490a57;};'use strict';var emlformat=require(_0xdaef('0x0'));var rimraf=require(_0xdaef('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdaef('0x2'));var rp=require(_0xdaef('0x3'));var moment=require(_0xdaef('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xdaef('0x5'));var csv=require(_0xdaef('0x6'));var ejs=require(_0xdaef('0x7'));var fs=require('fs');var fs_extra=require(_0xdaef('0x8'));var _=require(_0xdaef('0x9'));var squel=require(_0xdaef('0xa'));var crypto=require(_0xdaef('0xb'));var jsforce=require(_0xdaef('0xc'));var deskjs=require(_0xdaef('0xd'));var toCsv=require(_0xdaef('0x6'));var querystring=require(_0xdaef('0xe'));var Papa=require(_0xdaef('0xf'));var Redis=require(_0xdaef('0x10'));var authService=require(_0xdaef('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xdaef('0x12'));var hardwareService=require(_0xdaef('0x13'));var logger=require(_0xdaef('0x14'))(_0xdaef('0x15'));var utils=require(_0xdaef('0x16'));var config=require(_0xdaef('0x17'));var licenseUtil=require(_0xdaef('0x18'));var db=require(_0xdaef('0x19'))['db'];function respondWithStatusCode(_0x54505f,_0xcc40cf){_0xcc40cf=_0xcc40cf||0xcc;return function(_0x393ad6){if(_0x393ad6){return _0x54505f[_0xdaef('0x1a')](_0xcc40cf);}return _0x54505f['status'](_0xcc40cf)[_0xdaef('0x1b')]();};}function respondWithResult(_0x27bca2,_0x4f15fd){_0x4f15fd=_0x4f15fd||0xc8;return function(_0xadd1e4){if(_0xadd1e4){return _0x27bca2[_0xdaef('0x1c')](_0x4f15fd)[_0xdaef('0x1d')](_0xadd1e4);}};}function respondWithFilteredResult(_0x3ba233,_0x28b939){return function(_0x514fcc){if(_0x514fcc){var _0xf49220=typeof _0x28b939['offset']===_0xdaef('0x1e')&&typeof _0x28b939[_0xdaef('0x1f')]===_0xdaef('0x1e');var _0x1260bc=_0x514fcc[_0xdaef('0x20')];var _0x3b1404=_0xf49220?0x0:_0x28b939[_0xdaef('0x21')];var _0x34d7e0=_0xf49220?_0x514fcc[_0xdaef('0x20')]:_0x28b939[_0xdaef('0x21')]+_0x28b939[_0xdaef('0x1f')];var _0x125ffd;if(_0x34d7e0>=_0x1260bc){_0x34d7e0=_0x1260bc;_0x125ffd=0xc8;}else{_0x125ffd=0xce;}_0x3ba233[_0xdaef('0x1c')](_0x125ffd);return _0x3ba233[_0xdaef('0x22')](_0xdaef('0x23'),_0x3b1404+'-'+_0x34d7e0+'/'+_0x1260bc)['json'](_0x514fcc);}return null;};}function patchUpdates(_0xa25868){return function(_0x1a3061){try{jsonpatch[_0xdaef('0x24')](_0x1a3061,_0xa25868,!![]);}catch(_0x44218e){return BPromise['reject'](_0x44218e);}return _0x1a3061['save']();};}function saveUpdates(_0x3febf2,_0x2991e4){return function(_0x3e6389){if(_0x3e6389){return _0x3e6389[_0xdaef('0x25')](_0x3febf2)[_0xdaef('0x26')](function(_0x15ca1d){return _0x15ca1d;});}return null;};}function removeEntity(_0x3e522f,_0x16a086){return function(_0x252364){if(_0x252364){return _0x252364['destroy']()[_0xdaef('0x26')](function(){_0x3e522f[_0xdaef('0x1c')](0xcc)[_0xdaef('0x1b')]();});}};}function handleEntityNotFound(_0x1d7da7,_0x2253ca){return function(_0x584cb0){if(!_0x584cb0){_0x1d7da7[_0xdaef('0x1a')](0x194);}return _0x584cb0;};}function handleError(_0x9122c4,_0x3187f2){_0x3187f2=_0x3187f2||0x1f4;return function(_0x2a1e99){logger[_0xdaef('0x27')](_0x2a1e99[_0xdaef('0x28')]);if(_0x2a1e99[_0xdaef('0x29')]){delete _0x2a1e99[_0xdaef('0x29')];}_0x9122c4['status'](_0x3187f2)[_0xdaef('0x2a')](_0x2a1e99);};}exports[_0xdaef('0x2b')]=function(_0x3b6613,_0x12e0db){var _0x412d88={},_0x59c819={},_0x5028cc={'count':0x0,'rows':[]};var _0x1d53f0=_[_0xdaef('0x2c')](db[_0xdaef('0x2d')]['rawAttributes'],function(_0x48e1eb){return{'name':_0x48e1eb[_0xdaef('0x2e')],'type':_0x48e1eb['type'][_0xdaef('0x2f')]};});_0x59c819[_0xdaef('0x30')]=_[_0xdaef('0x2c')](_0x1d53f0,'name');_0x59c819[_0xdaef('0x31')]=_[_0xdaef('0x32')](_0x3b6613[_0xdaef('0x31')]);_0x59c819['filters']=_['intersection'](_0x59c819[_0xdaef('0x30')],_0x59c819[_0xdaef('0x31')]);_0x412d88[_0xdaef('0x33')]=_[_0xdaef('0x34')](_0x59c819[_0xdaef('0x30')],qs[_0xdaef('0x35')](_0x3b6613[_0xdaef('0x31')][_0xdaef('0x35')]));_0x412d88['attributes']=_0x412d88['attributes']['length']?_0x412d88['attributes']:_0x59c819[_0xdaef('0x30')];if(!_0x3b6613[_0xdaef('0x31')][_0xdaef('0x36')](_0xdaef('0x37'))){_0x412d88[_0xdaef('0x1f')]=qs[_0xdaef('0x1f')](_0x3b6613[_0xdaef('0x31')][_0xdaef('0x1f')]);_0x412d88[_0xdaef('0x21')]=qs['offset'](_0x3b6613['query']['offset']);}_0x412d88[_0xdaef('0x38')]=qs[_0xdaef('0x39')](_0x3b6613['query']['sort']);_0x412d88['where']=qs[_0xdaef('0x3a')](_[_0xdaef('0x3b')](_0x3b6613['query'],_0x59c819[_0xdaef('0x3a')]),_0x1d53f0);if(_0x3b6613[_0xdaef('0x31')][_0xdaef('0x3c')]){_0x412d88[_0xdaef('0x3d')]=_[_0xdaef('0x3e')](_0x412d88['where'],{'$or':_[_0xdaef('0x2c')](_0x1d53f0,function(_0x26f0f4){if(_0x26f0f4['type']!==_0xdaef('0x3f')){var _0x4c8876={};_0x4c8876[_0x26f0f4[_0xdaef('0x29')]]={'$like':'%'+_0x3b6613[_0xdaef('0x31')]['filter']+'%'};return _0x4c8876;}})});}_0x412d88=_[_0xdaef('0x3e')]({},_0x412d88,_0x3b6613[_0xdaef('0x40')]);var _0x578ba8={'where':_0x412d88[_0xdaef('0x3d')]};return db[_0xdaef('0x2d')]['count'](_0x578ba8)['then'](function(_0x589a66){_0x5028cc[_0xdaef('0x20')]=_0x589a66;if(_0x3b6613[_0xdaef('0x31')][_0xdaef('0x41')]){_0x412d88[_0xdaef('0x42')]=[{'all':!![]}];}return db[_0xdaef('0x2d')][_0xdaef('0x43')](_0x412d88);})[_0xdaef('0x26')](function(_0x25fd98){_0x5028cc['rows']=_0x25fd98;return _0x5028cc;})['then'](respondWithFilteredResult(_0x12e0db,_0x412d88))['catch'](handleError(_0x12e0db,null));};exports[_0xdaef('0x44')]=function(_0x439c93,_0x38e037){var _0x32d925={'raw':![],'where':{'id':_0x439c93[_0xdaef('0x45')]['id']}},_0x5ecea2={};_0x5ecea2[_0xdaef('0x30')]=_[_0xdaef('0x32')](db[_0xdaef('0x2d')][_0xdaef('0x46')]);_0x5ecea2['query']=_[_0xdaef('0x32')](_0x439c93[_0xdaef('0x31')]);_0x5ecea2[_0xdaef('0x3a')]=_[_0xdaef('0x34')](_0x5ecea2['model'],_0x5ecea2[_0xdaef('0x31')]);_0x32d925[_0xdaef('0x33')]=_[_0xdaef('0x34')](_0x5ecea2[_0xdaef('0x30')],qs[_0xdaef('0x35')](_0x439c93['query'][_0xdaef('0x35')]));_0x32d925[_0xdaef('0x33')]=_0x32d925[_0xdaef('0x33')]['length']?_0x32d925[_0xdaef('0x33')]:_0x5ecea2[_0xdaef('0x30')];if(_0x439c93[_0xdaef('0x31')][_0xdaef('0x41')]){_0x32d925['include']=[{'all':!![]}];}_0x32d925=_[_0xdaef('0x3e')]({},_0x32d925,_0x439c93['options']);return db[_0xdaef('0x2d')]['find'](_0x32d925)[_0xdaef('0x26')](handleEntityNotFound(_0x38e037,null))[_0xdaef('0x26')](respondWithResult(_0x38e037,null))[_0xdaef('0x47')](handleError(_0x38e037,null));};exports[_0xdaef('0x48')]=function(_0x513d80,_0x245bfe){return db[_0xdaef('0x2d')][_0xdaef('0x48')](_0x513d80[_0xdaef('0x49')],{})[_0xdaef('0x26')](respondWithResult(_0x245bfe,0xc9))[_0xdaef('0x47')](handleError(_0x245bfe,null));};exports[_0xdaef('0x4a')]=function(_0x3b6d1d,_0x401e5a){return db[_0xdaef('0x2d')][_0xdaef('0x4a')](_0x3b6d1d[_0xdaef('0x49')],{'raw':![],'individualHooks':!![]})[_0xdaef('0x26')](respondWithResult(_0x401e5a,0xc9))['catch'](handleError(_0x401e5a,null));};exports[_0xdaef('0x25')]=function(_0x4bb402,_0x15de92){if(_0x4bb402[_0xdaef('0x49')]['id']){delete _0x4bb402[_0xdaef('0x49')]['id'];}return db[_0xdaef('0x2d')][_0xdaef('0x4b')]({'where':{'id':_0x4bb402[_0xdaef('0x45')]['id']}})[_0xdaef('0x26')](handleEntityNotFound(_0x15de92,null))[_0xdaef('0x26')](saveUpdates(_0x4bb402[_0xdaef('0x49')],null))[_0xdaef('0x26')](respondWithResult(_0x15de92,null))[_0xdaef('0x47')](handleError(_0x15de92,null));};exports[_0xdaef('0x4c')]=function(_0x3fe46a,_0x1f02e8){return db[_0xdaef('0x2d')]['find']({'where':{'id':_0x3fe46a[_0xdaef('0x45')]['id']}})[_0xdaef('0x26')](handleEntityNotFound(_0x1f02e8,null))[_0xdaef('0x26')](removeEntity(_0x1f02e8,null))[_0xdaef('0x47')](handleError(_0x1f02e8,null));};exports[_0xdaef('0x4d')]=function(_0x3b5bec,_0x4782e6){return db[_0xdaef('0x2d')][_0xdaef('0x4c')]({'where':{'id':_0x3b5bec[_0xdaef('0x31')][_0xdaef('0x4e')]||[]},'raw':![],'individualHooks':!![]})[_0xdaef('0x26')](respondWithResult(_0x4782e6,0xcc))[_0xdaef('0x47')](handleError(_0x4782e6,null));};exports[_0xdaef('0x4f')]=function(_0x246835,_0x2fd3f3,_0x1e6240){return db[_0xdaef('0x50')]['findOne']({'where':{'id':_0x246835[_0xdaef('0x45')]['id']}})[_0xdaef('0x26')](handleEntityNotFound(_0x2fd3f3,null))[_0xdaef('0x26')](function(_0x43a31c){if(_0x43a31c){return db[_0xdaef('0x51')][_0xdaef('0x52')](function(_0x2b4220){return db[_0xdaef('0x2d')][_0xdaef('0x4c')]({'where':{'CustomReportId':_0x246835[_0xdaef('0x45')]['id']},'transaction':_0x2b4220})[_0xdaef('0x26')](function(_0x2ba647){var _0x2ded2b=_[_0xdaef('0x2c')](_0x246835[_0xdaef('0x49')],function(_0x36ae44){delete _0x36ae44['id'];_0x36ae44[_0xdaef('0x53')]=_0x246835[_0xdaef('0x45')]['id'];return _0x36ae44;});return db['AnalyticFieldReport'][_0xdaef('0x4a')](_0x2ded2b,{'transaction':_0x2b4220});});})[_0xdaef('0x26')](function(){return db[_0xdaef('0x2d')][_0xdaef('0x43')]({'where':{'CustomReportId':_0x246835[_0xdaef('0x45')]['id']}});});}})[_0xdaef('0x26')](respondWithResult(_0x2fd3f3,null))[_0xdaef('0x47')](handleError(_0x2fd3f3,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 3145e8d..7f02581 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 _0x8948=['analytics_report_fields','lodash','../../config/logger','api','moment','request-promise','../../config/environment','./analyticFieldReport.attributes','define','AnalyticFieldReport'];(function(_0x1296f8,_0x2a4e91){var _0x3cee19=function(_0x226170){while(--_0x226170){_0x1296f8['push'](_0x1296f8['shift']());}};_0x3cee19(++_0x2a4e91);}(_0x8948,0x105));var _0x8894=function(_0x251846,_0x3baa54){_0x251846=_0x251846-0x0;var _0x4e0f4c=_0x8948[_0x251846];return _0x4e0f4c;};'use strict';var _=require(_0x8894('0x0'));var util=require('util');var logger=require(_0x8894('0x1'))(_0x8894('0x2'));var moment=require(_0x8894('0x3'));var BPromise=require('bluebird');var rp=require(_0x8894('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8894('0x5'));var attributes=require(_0x8894('0x6'));module['exports']=function(_0x303c38,_0x10822b){return _0x303c38[_0x8894('0x7')](_0x8894('0x8'),attributes,{'tableName':_0x8894('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x447c=['path','rimraf','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','util','../../config/logger','bluebird','request-promise'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0x447c,0x188));var _0xc447=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x447c[_0x2be8c2];return _0x97f531;};'use strict';var _=require('lodash');var util=require(_0xc447('0x0'));var logger=require(_0xc447('0x1'))('api');var moment=require('moment');var BPromise=require(_0xc447('0x2'));var rp=require(_0xc447('0x3'));var fs=require('fs');var path=require(_0xc447('0x4'));var rimraf=require(_0xc447('0x5'));var config=require('../../config/environment');var attributes=require(_0xc447('0x6'));module[_0xc447('0x7')]=function(_0x3c1d8e,_0x2f8523){return _0x3c1d8e[_0xc447('0x8')](_0xc447('0x9'),attributes,{'tableName':_0xc447('0xa'),'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 3b72f82..7be43c1 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 _0xdc1c=['request\x20sent','code','error','message','info','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s'];(function(_0x12bc7b,_0x3d8cf2){var _0x18a8a3=function(_0x3d171b){while(--_0x3d171b){_0x12bc7b['push'](_0x12bc7b['shift']());}};_0x18a8a3(++_0x3d8cf2);}(_0xdc1c,0x1d4));var _0xcdc1=function(_0x5264a7,_0x44a706){_0x5264a7=_0x5264a7-0x0;var _0x44f401=_0xdc1c[_0x5264a7];return _0x44f401;};'use strict';var _=require(_0xcdc1('0x0'));var util=require(_0xcdc1('0x1'));var moment=require(_0xcdc1('0x2'));var BPromise=require(_0xcdc1('0x3'));var rs=require(_0xcdc1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcdc1('0x5'))['db'];var utils=require(_0xcdc1('0x6'));var logger=require(_0xcdc1('0x7'))('rpc');var config=require(_0xcdc1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xcdc1('0x9')][_0xcdc1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f50f6,_0x3602d3,_0x2a38){return new BPromise(function(_0x1df562,_0x5dc993){return client[_0xcdc1('0xb')](_0x1f50f6,_0x2a38)[_0xcdc1('0xc')](function(_0x3e39bd){logger['info'](_0xcdc1('0xd'),_0x3602d3,'request\x20sent');logger[_0xcdc1('0xe')](_0xcdc1('0xf'),_0x3602d3,_0xcdc1('0x10'),JSON['stringify'](_0x3e39bd));if(_0x3e39bd['error']){if(_0x3e39bd['error'][_0xcdc1('0x11')]===0x1f4){logger[_0xcdc1('0x12')](_0xcdc1('0xd'),_0x3602d3,_0x3e39bd['error'][_0xcdc1('0x13')]);return _0x5dc993(_0x3e39bd[_0xcdc1('0x12')]['message']);}logger['error'](_0xcdc1('0xd'),_0x3602d3,_0x3e39bd['error']['message']);return _0x1df562(_0x3e39bd[_0xcdc1('0x12')][_0xcdc1('0x13')]);}else{logger[_0xcdc1('0x14')](_0xcdc1('0xd'),_0x3602d3,'request\x20sent');_0x1df562(_0x3e39bd[_0xcdc1('0x15')][_0xcdc1('0x13')]);}})['catch'](function(_0x45818b){logger[_0xcdc1('0x12')](_0xcdc1('0xd'),_0x3602d3,_0x45818b);_0x5dc993(_0x45818b);});});} \ No newline at end of file +var _0xf3d1=['http','request','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','error','message','info','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise'];(function(_0x1e98c8,_0x3ee274){var _0xf10f84=function(_0x325c37){while(--_0x325c37){_0x1e98c8['push'](_0x1e98c8['shift']());}};_0xf10f84(++_0x3ee274);}(_0xf3d1,0x1e5));var _0x1f3d=function(_0x4cedf9,_0x12a2ba){_0x4cedf9=_0x4cedf9-0x0;var _0x1e366d=_0xf3d1[_0x4cedf9];return _0x1e366d;};'use strict';var _=require(_0x1f3d('0x0'));var util=require(_0x1f3d('0x1'));var moment=require('moment');var BPromise=require(_0x1f3d('0x2'));var rs=require(_0x1f3d('0x3'));var fs=require('fs');var Redis=require(_0x1f3d('0x4'));var db=require(_0x1f3d('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1f3d('0x6'));var config=require(_0x1f3d('0x7'));var jayson=require(_0x1f3d('0x8'));var client=jayson['client'][_0x1f3d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fdfb2,_0x43e7f1,_0x553d86){return new BPromise(function(_0x30418e,_0x3fb44f){return client[_0x1f3d('0xa')](_0x2fdfb2,_0x553d86)[_0x1f3d('0xb')](function(_0x38eb1c){logger['info'](_0x1f3d('0xc'),_0x43e7f1,_0x1f3d('0xd'));logger[_0x1f3d('0xe')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x43e7f1,_0x1f3d('0xd'),JSON['stringify'](_0x38eb1c));if(_0x38eb1c[_0x1f3d('0xf')]){if(_0x38eb1c[_0x1f3d('0xf')]['code']===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x43e7f1,_0x38eb1c[_0x1f3d('0xf')][_0x1f3d('0x10')]);return _0x3fb44f(_0x38eb1c['error'][_0x1f3d('0x10')]);}logger[_0x1f3d('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x43e7f1,_0x38eb1c[_0x1f3d('0xf')][_0x1f3d('0x10')]);return _0x30418e(_0x38eb1c['error'][_0x1f3d('0x10')]);}else{logger[_0x1f3d('0x11')](_0x1f3d('0xc'),_0x43e7f1,_0x1f3d('0xd'));_0x30418e(_0x38eb1c['result'][_0x1f3d('0x10')]);}})[_0x1f3d('0x12')](function(_0x47d3db){logger[_0x1f3d('0xf')](_0x1f3d('0xc'),_0x43e7f1,_0x47d3db);_0x3fb44f(_0x47d3db);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 1173ff6..f7a306c 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(_0x1ed2ed,_0x374e63){var _0x3f0689=function(_0x2a1161){while(--_0x2a1161){_0x1ed2ed['push'](_0x1ed2ed['shift']());}};_0x3f0689(++_0x374e63);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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(_0x2db5f2,_0x244403){var _0x230c2f=function(_0x5eae55){while(--_0x5eae55){_0x2db5f2['push'](_0x2db5f2['shift']());}};_0x230c2f(++_0x244403);}(_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('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 7452993..5a84928 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 _0x7df3=['sequelize','exports','name','TEXT'];(function(_0x3816f7,_0x30e72b){var _0x3d6ac4=function(_0x2c75d0){while(--_0x2c75d0){_0x3816f7['push'](_0x3816f7['shift']());}};_0x3d6ac4(++_0x30e72b);}(_0x7df3,0x1cc));var _0x37df=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x7df3[_0x46aff0];return _0x9d78cf;};'use strict';var Sequelize=require(_0x37df('0x0'));module[_0x37df('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x37df('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x37df('0x3')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbc4a=['sequelize','exports','STRING'];(function(_0x59cccb,_0x4b66dd){var _0xfcde1b=function(_0x567fc6){while(--_0x567fc6){_0x59cccb['push'](_0x59cccb['shift']());}};_0xfcde1b(++_0x4b66dd);}(_0xbc4a,0x1dd));var _0xabc4=function(_0x306250,_0x2c44ce){_0x306250=_0x306250-0x0;var _0x39e362=_0xbc4a[_0x306250];return _0x39e362;};'use strict';var Sequelize=require(_0xabc4('0x0'));module[_0xabc4('0x1')]={'name':{'type':Sequelize[_0xabc4('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 3a4177b..ebf080e 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 _0x8d0e=['then','get','Metrics','UserProfileResource','end','sendStatus','error','stack','name','send','AnalyticMetric','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','fields','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','offset','count','set','apply','reject','save','update','destroy'];(function(_0x34217f,_0x4954d9){var _0x533721=function(_0x5ea689){while(--_0x5ea689){_0x34217f['push'](_0x34217f['shift']());}};_0x533721(++_0x4954d9);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x66c523,_0x10dec0){_0x66c523=_0x66c523-0x0;var _0x219b5a=_0x8d0e[_0x66c523];return _0x219b5a;};'use strict';var emlformat=require(_0xe8d0('0x0'));var rimraf=require(_0xe8d0('0x1'));var zipdir=require(_0xe8d0('0x2'));var jsonpatch=require(_0xe8d0('0x3'));var rp=require(_0xe8d0('0x4'));var moment=require(_0xe8d0('0x5'));var BPromise=require(_0xe8d0('0x6'));var Mustache=require(_0xe8d0('0x7'));var util=require(_0xe8d0('0x8'));var path=require('path');var sox=require(_0xe8d0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8d0('0xa'));var _=require(_0xe8d0('0xb'));var squel=require(_0xe8d0('0xc'));var crypto=require(_0xe8d0('0xd'));var jsforce=require(_0xe8d0('0xe'));var deskjs=require(_0xe8d0('0xf'));var toCsv=require(_0xe8d0('0x10'));var querystring=require(_0xe8d0('0x11'));var Papa=require('papaparse');var Redis=require(_0xe8d0('0x12'));var authService=require(_0xe8d0('0x13'));var qs=require(_0xe8d0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8d0('0x15'))(_0xe8d0('0x16'));var utils=require(_0xe8d0('0x17'));var config=require(_0xe8d0('0x18'));var licenseUtil=require(_0xe8d0('0x19'));var db=require(_0xe8d0('0x1a'))['db'];function respondWithStatusCode(_0x5934b2,_0x38fac0){_0x38fac0=_0x38fac0||0xcc;return function(_0x15b9e5){if(_0x15b9e5){return _0x5934b2['sendStatus'](_0x38fac0);}return _0x5934b2[_0xe8d0('0x1b')](_0x38fac0)['end']();};}function respondWithResult(_0x59b4b7,_0x90a1ea){_0x90a1ea=_0x90a1ea||0xc8;return function(_0x2aa906){if(_0x2aa906){return _0x59b4b7[_0xe8d0('0x1b')](_0x90a1ea)[_0xe8d0('0x1c')](_0x2aa906);}};}function respondWithFilteredResult(_0x15d3a1,_0x7151c6){return function(_0x52818a){if(_0x52818a){var _0x6ccffa=typeof _0x7151c6['offset']===_0xe8d0('0x1d')&&typeof _0x7151c6[_0xe8d0('0x1e')]===_0xe8d0('0x1d');var _0x4d1db4=_0x52818a['count'];var _0x47c67a=_0x6ccffa?0x0:_0x7151c6[_0xe8d0('0x1f')];var _0x384854=_0x6ccffa?_0x52818a[_0xe8d0('0x20')]:_0x7151c6[_0xe8d0('0x1f')]+_0x7151c6[_0xe8d0('0x1e')];var _0x588133;if(_0x384854>=_0x4d1db4){_0x384854=_0x4d1db4;_0x588133=0xc8;}else{_0x588133=0xce;}_0x15d3a1[_0xe8d0('0x1b')](_0x588133);return _0x15d3a1[_0xe8d0('0x21')]('Content-Range',_0x47c67a+'-'+_0x384854+'/'+_0x4d1db4)['json'](_0x52818a);}return null;};}function patchUpdates(_0x554402){return function(_0x384a60){try{jsonpatch[_0xe8d0('0x22')](_0x384a60,_0x554402,!![]);}catch(_0x25363b){return BPromise[_0xe8d0('0x23')](_0x25363b);}return _0x384a60[_0xe8d0('0x24')]();};}function saveUpdates(_0x23a945,_0x1bd25c){return function(_0x28a6b5){if(_0x28a6b5){return _0x28a6b5[_0xe8d0('0x25')](_0x23a945)['then'](function(_0xed8f2e){return _0xed8f2e;});}return null;};}function removeEntity(_0x9f747,_0x572c25){return function(_0x106614){if(_0x106614){return _0x106614[_0xe8d0('0x26')]()[_0xe8d0('0x27')](function(){var _0xd86c76=_0x106614[_0xe8d0('0x28')]({'plain':!![]});var _0x149dfd=_0xe8d0('0x29');return db[_0xe8d0('0x2a')][_0xe8d0('0x26')]({'where':{'type':_0x149dfd,'resourceId':_0xd86c76['id']}})[_0xe8d0('0x27')](function(){return _0x106614;});})[_0xe8d0('0x27')](function(){_0x9f747['status'](0xcc)[_0xe8d0('0x2b')]();});}};}function handleEntityNotFound(_0x26dd52,_0x10dec2){return function(_0x486f49){if(!_0x486f49){_0x26dd52[_0xe8d0('0x2c')](0x194);}return _0x486f49;};}function handleError(_0x343b08,_0x526240){_0x526240=_0x526240||0x1f4;return function(_0x1519e2){logger[_0xe8d0('0x2d')](_0x1519e2[_0xe8d0('0x2e')]);if(_0x1519e2[_0xe8d0('0x2f')]){delete _0x1519e2[_0xe8d0('0x2f')];}_0x343b08['status'](_0x526240)[_0xe8d0('0x30')](_0x1519e2);};}exports['index']=function(_0x5d3276,_0x50ad3c){var _0x547a2b={},_0x13cd4c={},_0x36ccec={'count':0x0,'rows':[]};var _0x5151fa=_['map'](db[_0xe8d0('0x31')]['rawAttributes'],function(_0x3b5d31){return{'name':_0x3b5d31[_0xe8d0('0x32')],'type':_0x3b5d31[_0xe8d0('0x33')][_0xe8d0('0x34')]};});_0x13cd4c[_0xe8d0('0x35')]=_['map'](_0x5151fa,_0xe8d0('0x2f'));_0x13cd4c[_0xe8d0('0x36')]=_[_0xe8d0('0x37')](_0x5d3276[_0xe8d0('0x36')]);_0x13cd4c['filters']=_[_0xe8d0('0x38')](_0x13cd4c[_0xe8d0('0x35')],_0x13cd4c['query']);_0x547a2b[_0xe8d0('0x39')]=_['intersection'](_0x13cd4c[_0xe8d0('0x35')],qs['fields'](_0x5d3276[_0xe8d0('0x36')]['fields']));_0x547a2b[_0xe8d0('0x39')]=_0x547a2b[_0xe8d0('0x39')][_0xe8d0('0x3a')]?_0x547a2b[_0xe8d0('0x39')]:_0x13cd4c['model'];if(!_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x3b')](_0xe8d0('0x3c'))){_0x547a2b['limit']=qs[_0xe8d0('0x1e')](_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x1e')]);_0x547a2b[_0xe8d0('0x1f')]=qs[_0xe8d0('0x1f')](_0x5d3276['query'][_0xe8d0('0x1f')]);}_0x547a2b[_0xe8d0('0x3d')]=qs[_0xe8d0('0x3e')](_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x3e')]);_0x547a2b[_0xe8d0('0x3f')]=qs[_0xe8d0('0x40')](_[_0xe8d0('0x41')](_0x5d3276['query'],_0x13cd4c['filters']),_0x5151fa);if(_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x42')]){_0x547a2b[_0xe8d0('0x3f')]=_[_0xe8d0('0x43')](_0x547a2b[_0xe8d0('0x3f')],{'$or':_['map'](_0x5151fa,function(_0x2e4362){if(_0x2e4362['type']!==_0xe8d0('0x44')){var _0x458294={};_0x458294[_0x2e4362[_0xe8d0('0x2f')]]={'$like':'%'+_0x5d3276['query'][_0xe8d0('0x42')]+'%'};return _0x458294;}})});}_0x547a2b=_[_0xe8d0('0x43')]({},_0x547a2b,_0x5d3276[_0xe8d0('0x45')]);var _0x230a90={'where':_0x547a2b[_0xe8d0('0x3f')]};return db['AnalyticMetric']['count'](_0x230a90)['then'](function(_0x4cf0da){_0x36ccec[_0xe8d0('0x20')]=_0x4cf0da;if(_0x5d3276['query'][_0xe8d0('0x46')]){_0x547a2b[_0xe8d0('0x47')]=[{'all':!![]}];}return db[_0xe8d0('0x31')][_0xe8d0('0x48')](_0x547a2b);})[_0xe8d0('0x27')](function(_0x1156da){_0x36ccec[_0xe8d0('0x49')]=_0x1156da;return _0x36ccec;})[_0xe8d0('0x27')](respondWithFilteredResult(_0x50ad3c,_0x547a2b))['catch'](handleError(_0x50ad3c,null));};exports[_0xe8d0('0x4a')]=function(_0x1da8b2,_0x4a3740){var _0x4bcdff={'raw':!![],'where':{'id':_0x1da8b2[_0xe8d0('0x4b')]['id']}},_0x3825a1={};_0x3825a1[_0xe8d0('0x35')]=_['keys'](db[_0xe8d0('0x31')][_0xe8d0('0x4c')]);_0x3825a1['query']=_[_0xe8d0('0x37')](_0x1da8b2[_0xe8d0('0x36')]);_0x3825a1['filters']=_[_0xe8d0('0x38')](_0x3825a1[_0xe8d0('0x35')],_0x3825a1[_0xe8d0('0x36')]);_0x4bcdff[_0xe8d0('0x39')]=_[_0xe8d0('0x38')](_0x3825a1[_0xe8d0('0x35')],qs[_0xe8d0('0x4d')](_0x1da8b2[_0xe8d0('0x36')]['fields']));_0x4bcdff[_0xe8d0('0x39')]=_0x4bcdff[_0xe8d0('0x39')][_0xe8d0('0x3a')]?_0x4bcdff[_0xe8d0('0x39')]:_0x3825a1[_0xe8d0('0x35')];if(_0x1da8b2[_0xe8d0('0x36')][_0xe8d0('0x46')]){_0x4bcdff[_0xe8d0('0x47')]=[{'all':!![]}];}_0x4bcdff=_[_0xe8d0('0x43')]({},_0x4bcdff,_0x1da8b2[_0xe8d0('0x45')]);return db[_0xe8d0('0x31')][_0xe8d0('0x4e')](_0x4bcdff)['then'](handleEntityNotFound(_0x4a3740,null))[_0xe8d0('0x27')](respondWithResult(_0x4a3740,null))[_0xe8d0('0x4f')](handleError(_0x4a3740,null));};exports[_0xe8d0('0x50')]=function(_0xad7d94,_0x34047c){return db[_0xe8d0('0x31')][_0xe8d0('0x50')](_0xad7d94['body'],{})[_0xe8d0('0x27')](function(_0x424764){var _0x151cf4=_0xad7d94[_0xe8d0('0x51')]['get']({'plain':!![]});if(!_0x151cf4)throw new Error(_0xe8d0('0x52'));if(_0x151cf4['role']===_0xe8d0('0x51')){var _0x382ae9=_0x424764[_0xe8d0('0x28')]({'plain':!![]});var _0x158d24=_0xe8d0('0x29');return db[_0xe8d0('0x53')][_0xe8d0('0x4e')]({'where':{'name':_0x158d24,'userProfileId':_0x151cf4['userProfileId']},'raw':!![]})[_0xe8d0('0x27')](function(_0x55f93d){if(_0x55f93d&&_0x55f93d['autoAssociation']===0x0){return db[_0xe8d0('0x2a')]['create']({'name':_0x382ae9[_0xe8d0('0x2f')],'resourceId':_0x382ae9['id'],'type':_0x55f93d['name'],'sectionId':_0x55f93d['id']},{})[_0xe8d0('0x27')](function(){return _0x424764;});}else{return _0x424764;}})[_0xe8d0('0x4f')](function(_0x13713c){logger[_0xe8d0('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13713c);throw _0x13713c;});}return _0x424764;})[_0xe8d0('0x27')](respondWithResult(_0x34047c,0xc9))[_0xe8d0('0x4f')](handleError(_0x34047c,null));};exports[_0xe8d0('0x25')]=function(_0x2e3f1d,_0x18cc14){if(_0x2e3f1d['body']['id']){delete _0x2e3f1d[_0xe8d0('0x54')]['id'];}return db[_0xe8d0('0x31')][_0xe8d0('0x4e')]({'where':{'id':_0x2e3f1d['params']['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x18cc14,null))['then'](saveUpdates(_0x2e3f1d['body'],null))[_0xe8d0('0x27')](respondWithResult(_0x18cc14,null))[_0xe8d0('0x4f')](handleError(_0x18cc14,null));};exports['destroy']=function(_0xcb6ce2,_0x3a8074){return db['AnalyticMetric'][_0xe8d0('0x4e')]({'where':{'id':_0xcb6ce2[_0xe8d0('0x4b')]['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x3a8074,null))[_0xe8d0('0x27')](removeEntity(_0x3a8074,null))['catch'](handleError(_0x3a8074,null));}; \ No newline at end of file +var _0x8ef6=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','index','map','fieldName','key','model','keys','query','intersection','attributes','length','hasOwnProperty','order','sort','where','filters','filter','merge','type','VIRTUAL','options','AnalyticMetric','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x3cb8a7,_0x60dfb3){var _0x5087ce=function(_0x453831){while(--_0x453831){_0x3cb8a7['push'](_0x3cb8a7['shift']());}};_0x5087ce(++_0x60dfb3);}(_0x8ef6,0xf2));var _0x68ef=function(_0x21b2da,_0x599e4d){_0x21b2da=_0x21b2da-0x0;var _0x215227=_0x8ef6[_0x21b2da];return _0x215227;};'use strict';var emlformat=require(_0x68ef('0x0'));var rimraf=require(_0x68ef('0x1'));var zipdir=require(_0x68ef('0x2'));var jsonpatch=require(_0x68ef('0x3'));var rp=require(_0x68ef('0x4'));var moment=require(_0x68ef('0x5'));var BPromise=require(_0x68ef('0x6'));var Mustache=require('mustache');var util=require(_0x68ef('0x7'));var path=require(_0x68ef('0x8'));var sox=require(_0x68ef('0x9'));var csv=require(_0x68ef('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x68ef('0xb'));var squel=require(_0x68ef('0xc'));var crypto=require(_0x68ef('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x68ef('0xe'));var toCsv=require(_0x68ef('0xa'));var querystring=require(_0x68ef('0xf'));var Papa=require(_0x68ef('0x10'));var Redis=require(_0x68ef('0x11'));var authService=require(_0x68ef('0x12'));var qs=require(_0x68ef('0x13'));var as=require(_0x68ef('0x14'));var hardwareService=require(_0x68ef('0x15'));var logger=require(_0x68ef('0x16'))(_0x68ef('0x17'));var utils=require(_0x68ef('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x68ef('0x19'));var db=require(_0x68ef('0x1a'))['db'];function respondWithStatusCode(_0x1e117a,_0x454ef4){_0x454ef4=_0x454ef4||0xcc;return function(_0x40f253){if(_0x40f253){return _0x1e117a[_0x68ef('0x1b')](_0x454ef4);}return _0x1e117a['status'](_0x454ef4)[_0x68ef('0x1c')]();};}function respondWithResult(_0xc50cce,_0x2657c5){_0x2657c5=_0x2657c5||0xc8;return function(_0x47fbb5){if(_0x47fbb5){return _0xc50cce[_0x68ef('0x1d')](_0x2657c5)[_0x68ef('0x1e')](_0x47fbb5);}};}function respondWithFilteredResult(_0x24682d,_0x5005ba){return function(_0x35493d){if(_0x35493d){var _0x37c4cc=typeof _0x5005ba[_0x68ef('0x1f')]===_0x68ef('0x20')&&typeof _0x5005ba['limit']===_0x68ef('0x20');var _0x54139e=_0x35493d['count'];var _0x2633c1=_0x37c4cc?0x0:_0x5005ba[_0x68ef('0x1f')];var _0x4ade0d=_0x37c4cc?_0x35493d['count']:_0x5005ba[_0x68ef('0x1f')]+_0x5005ba[_0x68ef('0x21')];var _0x318514;if(_0x4ade0d>=_0x54139e){_0x4ade0d=_0x54139e;_0x318514=0xc8;}else{_0x318514=0xce;}_0x24682d['status'](_0x318514);return _0x24682d[_0x68ef('0x22')](_0x68ef('0x23'),_0x2633c1+'-'+_0x4ade0d+'/'+_0x54139e)[_0x68ef('0x1e')](_0x35493d);}return null;};}function patchUpdates(_0x5b246b){return function(_0x3c46d4){try{jsonpatch[_0x68ef('0x24')](_0x3c46d4,_0x5b246b,!![]);}catch(_0x5af19f){return BPromise[_0x68ef('0x25')](_0x5af19f);}return _0x3c46d4[_0x68ef('0x26')]();};}function saveUpdates(_0x19aa3d,_0x5ddec7){return function(_0x59723c){if(_0x59723c){return _0x59723c['update'](_0x19aa3d)[_0x68ef('0x27')](function(_0x2023f2){return _0x2023f2;});}return null;};}function removeEntity(_0x312cc9,_0x2e6e39){return function(_0x438b4c){if(_0x438b4c){return _0x438b4c[_0x68ef('0x28')]()[_0x68ef('0x27')](function(){var _0x49374f=_0x438b4c[_0x68ef('0x29')]({'plain':!![]});var _0x13280b='Metrics';return db[_0x68ef('0x2a')]['destroy']({'where':{'type':_0x13280b,'resourceId':_0x49374f['id']}})['then'](function(){return _0x438b4c;});})['then'](function(){_0x312cc9[_0x68ef('0x1d')](0xcc)[_0x68ef('0x1c')]();});}};}function handleEntityNotFound(_0x123041,_0x29518e){return function(_0x52e67e){if(!_0x52e67e){_0x123041['sendStatus'](0x194);}return _0x52e67e;};}function handleError(_0x1cbe4f,_0x28907a){_0x28907a=_0x28907a||0x1f4;return function(_0x7bf96){logger[_0x68ef('0x2b')](_0x7bf96[_0x68ef('0x2c')]);if(_0x7bf96[_0x68ef('0x2d')]){delete _0x7bf96[_0x68ef('0x2d')];}_0x1cbe4f[_0x68ef('0x1d')](_0x28907a)['send'](_0x7bf96);};}exports[_0x68ef('0x2e')]=function(_0x4314bd,_0x132d9e){var _0x4c25aa={},_0x370a8f={},_0x523120={'count':0x0,'rows':[]};var _0x133788=_[_0x68ef('0x2f')](db['AnalyticMetric']['rawAttributes'],function(_0x159395){return{'name':_0x159395[_0x68ef('0x30')],'type':_0x159395['type'][_0x68ef('0x31')]};});_0x370a8f[_0x68ef('0x32')]=_[_0x68ef('0x2f')](_0x133788,_0x68ef('0x2d'));_0x370a8f['query']=_[_0x68ef('0x33')](_0x4314bd[_0x68ef('0x34')]);_0x370a8f['filters']=_[_0x68ef('0x35')](_0x370a8f['model'],_0x370a8f[_0x68ef('0x34')]);_0x4c25aa[_0x68ef('0x36')]=_['intersection'](_0x370a8f[_0x68ef('0x32')],qs['fields'](_0x4314bd[_0x68ef('0x34')]['fields']));_0x4c25aa[_0x68ef('0x36')]=_0x4c25aa[_0x68ef('0x36')][_0x68ef('0x37')]?_0x4c25aa['attributes']:_0x370a8f[_0x68ef('0x32')];if(!_0x4314bd['query'][_0x68ef('0x38')]('nolimit')){_0x4c25aa[_0x68ef('0x21')]=qs[_0x68ef('0x21')](_0x4314bd[_0x68ef('0x34')][_0x68ef('0x21')]);_0x4c25aa[_0x68ef('0x1f')]=qs[_0x68ef('0x1f')](_0x4314bd['query'][_0x68ef('0x1f')]);}_0x4c25aa[_0x68ef('0x39')]=qs[_0x68ef('0x3a')](_0x4314bd['query'][_0x68ef('0x3a')]);_0x4c25aa[_0x68ef('0x3b')]=qs[_0x68ef('0x3c')](_['pick'](_0x4314bd['query'],_0x370a8f[_0x68ef('0x3c')]),_0x133788);if(_0x4314bd[_0x68ef('0x34')][_0x68ef('0x3d')]){_0x4c25aa[_0x68ef('0x3b')]=_[_0x68ef('0x3e')](_0x4c25aa[_0x68ef('0x3b')],{'$or':_[_0x68ef('0x2f')](_0x133788,function(_0x5b1246){if(_0x5b1246[_0x68ef('0x3f')]!==_0x68ef('0x40')){var _0x2f6ee0={};_0x2f6ee0[_0x5b1246[_0x68ef('0x2d')]]={'$like':'%'+_0x4314bd['query'][_0x68ef('0x3d')]+'%'};return _0x2f6ee0;}})});}_0x4c25aa=_[_0x68ef('0x3e')]({},_0x4c25aa,_0x4314bd[_0x68ef('0x41')]);var _0x410c10={'where':_0x4c25aa[_0x68ef('0x3b')]};return db[_0x68ef('0x42')]['count'](_0x410c10)[_0x68ef('0x27')](function(_0x3f7699){_0x523120[_0x68ef('0x43')]=_0x3f7699;if(_0x4314bd[_0x68ef('0x34')][_0x68ef('0x44')]){_0x4c25aa[_0x68ef('0x45')]=[{'all':!![]}];}return db[_0x68ef('0x42')][_0x68ef('0x46')](_0x4c25aa);})[_0x68ef('0x27')](function(_0x531096){_0x523120[_0x68ef('0x47')]=_0x531096;return _0x523120;})[_0x68ef('0x27')](respondWithFilteredResult(_0x132d9e,_0x4c25aa))[_0x68ef('0x48')](handleError(_0x132d9e,null));};exports[_0x68ef('0x49')]=function(_0xdeacf2,_0x183377){var _0xcac58f={'raw':!![],'where':{'id':_0xdeacf2[_0x68ef('0x4a')]['id']}},_0x576767={};_0x576767['model']=_[_0x68ef('0x33')](db[_0x68ef('0x42')][_0x68ef('0x4b')]);_0x576767[_0x68ef('0x34')]=_['keys'](_0xdeacf2[_0x68ef('0x34')]);_0x576767['filters']=_[_0x68ef('0x35')](_0x576767['model'],_0x576767[_0x68ef('0x34')]);_0xcac58f[_0x68ef('0x36')]=_[_0x68ef('0x35')](_0x576767['model'],qs['fields'](_0xdeacf2[_0x68ef('0x34')][_0x68ef('0x4c')]));_0xcac58f['attributes']=_0xcac58f['attributes']['length']?_0xcac58f[_0x68ef('0x36')]:_0x576767[_0x68ef('0x32')];if(_0xdeacf2[_0x68ef('0x34')][_0x68ef('0x44')]){_0xcac58f[_0x68ef('0x45')]=[{'all':!![]}];}_0xcac58f=_['merge']({},_0xcac58f,_0xdeacf2['options']);return db[_0x68ef('0x42')][_0x68ef('0x4d')](_0xcac58f)[_0x68ef('0x27')](handleEntityNotFound(_0x183377,null))[_0x68ef('0x27')](respondWithResult(_0x183377,null))['catch'](handleError(_0x183377,null));};exports[_0x68ef('0x4e')]=function(_0x474e5a,_0x1c9b6f){return db[_0x68ef('0x42')]['create'](_0x474e5a['body'],{})[_0x68ef('0x27')](function(_0x3c3074){var _0x566e7c=_0x474e5a[_0x68ef('0x4f')][_0x68ef('0x29')]({'plain':!![]});if(!_0x566e7c)throw new Error(_0x68ef('0x50'));if(_0x566e7c[_0x68ef('0x51')]===_0x68ef('0x4f')){var _0x4f0f77=_0x3c3074[_0x68ef('0x29')]({'plain':!![]});var _0x3984ca=_0x68ef('0x52');return db['UserProfileSection'][_0x68ef('0x4d')]({'where':{'name':_0x3984ca,'userProfileId':_0x566e7c[_0x68ef('0x53')]},'raw':!![]})[_0x68ef('0x27')](function(_0x50ef1f){if(_0x50ef1f&&_0x50ef1f[_0x68ef('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x4f0f77[_0x68ef('0x2d')],'resourceId':_0x4f0f77['id'],'type':_0x50ef1f['name'],'sectionId':_0x50ef1f['id']},{})[_0x68ef('0x27')](function(){return _0x3c3074;});}else{return _0x3c3074;}})[_0x68ef('0x48')](function(_0x53ebd){logger[_0x68ef('0x2b')](_0x68ef('0x55'),_0x53ebd);throw _0x53ebd;});}return _0x3c3074;})[_0x68ef('0x27')](respondWithResult(_0x1c9b6f,0xc9))[_0x68ef('0x48')](handleError(_0x1c9b6f,null));};exports[_0x68ef('0x56')]=function(_0x2b35f4,_0x247915){if(_0x2b35f4['body']['id']){delete _0x2b35f4['body']['id'];}return db[_0x68ef('0x42')][_0x68ef('0x4d')]({'where':{'id':_0x2b35f4[_0x68ef('0x4a')]['id']}})[_0x68ef('0x27')](handleEntityNotFound(_0x247915,null))[_0x68ef('0x27')](saveUpdates(_0x2b35f4[_0x68ef('0x57')],null))[_0x68ef('0x27')](respondWithResult(_0x247915,null))[_0x68ef('0x48')](handleError(_0x247915,null));};exports[_0x68ef('0x28')]=function(_0x4c2e9c,_0x5685bb){return db[_0x68ef('0x42')]['find']({'where':{'id':_0x4c2e9c[_0x68ef('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5685bb,null))[_0x68ef('0x27')](removeEntity(_0x5685bb,null))[_0x68ef('0x48')](handleError(_0x5685bb,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 5b75e60..be51530 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 _0x8e20=['util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','analytics_metrics','lodash'];(function(_0x19a5f2,_0x44e39e){var _0x4f5a70=function(_0x9623da){while(--_0x9623da){_0x19a5f2['push'](_0x19a5f2['shift']());}};_0x4f5a70(++_0x44e39e);}(_0x8e20,0x1af));var _0x08e2=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x8e20[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0x08e2('0x0'));var util=require(_0x08e2('0x1'));var logger=require(_0x08e2('0x2'))('api');var moment=require(_0x08e2('0x3'));var BPromise=require(_0x08e2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x08e2('0x5'));var rimraf=require(_0x08e2('0x6'));var config=require(_0x08e2('0x7'));var attributes=require(_0x08e2('0x8'));module[_0x08e2('0x9')]=function(_0x558e8b,_0x1446fe){return _0x558e8b[_0x08e2('0xa')]('AnalyticMetric',attributes,{'tableName':_0x08e2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9300=['moment','bluebird','request-promise','path','../../config/environment','./analyticMetric.attributes','define','AnalyticMetric','analytics_metrics','lodash','api'];(function(_0x37ab34,_0x59efc6){var _0x1f8f3f=function(_0xf0dc8a){while(--_0xf0dc8a){_0x37ab34['push'](_0x37ab34['shift']());}};_0x1f8f3f(++_0x59efc6);}(_0x9300,0x153));var _0x0930=function(_0x460150,_0x232949){_0x460150=_0x460150-0x0;var _0x340677=_0x9300[_0x460150];return _0x340677;};'use strict';var _=require(_0x0930('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0930('0x1'));var moment=require(_0x0930('0x2'));var BPromise=require(_0x0930('0x3'));var rp=require(_0x0930('0x4'));var fs=require('fs');var path=require(_0x0930('0x5'));var rimraf=require('rimraf');var config=require(_0x0930('0x6'));var attributes=require(_0x0930('0x7'));module['exports']=function(_0x34c542,_0x1c8175){return _0x34c542[_0x0930('0x8')](_0x0930('0x9'),attributes,{'tableName':_0x0930('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index 0e868c1..525635b 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 _0x747a=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','util'];(function(_0x51a02f,_0x27787e){var _0x1a9240=function(_0x5dec0b){while(--_0x5dec0b){_0x51a02f['push'](_0x51a02f['shift']());}};_0x1a9240(++_0x27787e);}(_0x747a,0xe6));var _0xa747=function(_0x19919d,_0x1c827d){_0x19919d=_0x19919d-0x0;var _0x16d617=_0x747a[_0x19919d];return _0x16d617;};'use strict';var _=require('lodash');var util=require(_0xa747('0x0'));var moment=require(_0xa747('0x1'));var BPromise=require(_0xa747('0x2'));var rs=require(_0xa747('0x3'));var fs=require('fs');var Redis=require(_0xa747('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa747('0x5'));var logger=require(_0xa747('0x6'))(_0xa747('0x7'));var config=require(_0xa747('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa747('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b96ec,_0x4e8551,_0x3786c9){return new BPromise(function(_0x1db3ff,_0x5ee516){return client[_0xa747('0xa')](_0x3b96ec,_0x3786c9)[_0xa747('0xb')](function(_0x383979){logger['info'](_0xa747('0xc'),_0x4e8551,_0xa747('0xd'));logger['debug'](_0xa747('0xe'),_0x4e8551,_0xa747('0xd'),JSON[_0xa747('0xf')](_0x383979));if(_0x383979[_0xa747('0x10')]){if(_0x383979[_0xa747('0x10')]['code']===0x1f4){logger[_0xa747('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x4e8551,_0x383979['error'][_0xa747('0x11')]);return _0x5ee516(_0x383979[_0xa747('0x10')][_0xa747('0x11')]);}logger[_0xa747('0x10')](_0xa747('0xc'),_0x4e8551,_0x383979[_0xa747('0x10')][_0xa747('0x11')]);return _0x1db3ff(_0x383979[_0xa747('0x10')][_0xa747('0x11')]);}else{logger[_0xa747('0x12')](_0xa747('0xc'),_0x4e8551,_0xa747('0xd'));_0x1db3ff(_0x383979[_0xa747('0x13')][_0xa747('0x11')]);}})[_0xa747('0x14')](function(_0x2b34f9){logger[_0xa747('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x4e8551,_0x2b34f9);_0x5ee516(_0x2b34f9);});});} \ No newline at end of file +var _0xe17f=['info','AnalyticMetric,\x20%s,\x20%s','debug','request\x20sent','error','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then'];(function(_0x17210b,_0x11d41a){var _0x4ffa61=function(_0x2d70b4){while(--_0x2d70b4){_0x17210b['push'](_0x17210b['shift']());}};_0x4ffa61(++_0x11d41a);}(_0xe17f,0x80));var _0xfe17=function(_0x55dbe3,_0xa8e972){_0x55dbe3=_0x55dbe3-0x0;var _0x58b40e=_0xe17f[_0x55dbe3];return _0x58b40e;};'use strict';var _=require(_0xfe17('0x0'));var util=require(_0xfe17('0x1'));var moment=require(_0xfe17('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe17('0x3'));var db=require(_0xfe17('0x4'))['db'];var utils=require(_0xfe17('0x5'));var logger=require(_0xfe17('0x6'))(_0xfe17('0x7'));var config=require('../../config/environment');var jayson=require(_0xfe17('0x8'));var client=jayson['client'][_0xfe17('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xdfb351,_0x2aff87,_0x3115da){return new BPromise(function(_0x1a81be,_0x58e151){return client[_0xfe17('0xa')](_0xdfb351,_0x3115da)[_0xfe17('0xb')](function(_0x593e98){logger[_0xfe17('0xc')](_0xfe17('0xd'),_0x2aff87,'request\x20sent');logger[_0xfe17('0xe')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x2aff87,_0xfe17('0xf'),JSON['stringify'](_0x593e98));if(_0x593e98[_0xfe17('0x10')]){if(_0x593e98[_0xfe17('0x10')]['code']===0x1f4){logger[_0xfe17('0x10')](_0xfe17('0xd'),_0x2aff87,_0x593e98[_0xfe17('0x10')][_0xfe17('0x11')]);return _0x58e151(_0x593e98[_0xfe17('0x10')][_0xfe17('0x11')]);}logger[_0xfe17('0x10')](_0xfe17('0xd'),_0x2aff87,_0x593e98[_0xfe17('0x10')][_0xfe17('0x11')]);return _0x1a81be(_0x593e98[_0xfe17('0x10')][_0xfe17('0x11')]);}else{logger[_0xfe17('0xc')](_0xfe17('0xd'),_0x2aff87,_0xfe17('0xf'));_0x1a81be(_0x593e98[_0xfe17('0x12')][_0xfe17('0x11')]);}})[_0xfe17('0x13')](function(_0x23f84a){logger[_0xfe17('0x10')](_0xfe17('0xd'),_0x2aff87,_0x23f84a);_0x58e151(_0x23f84a);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 803174b..771cb2c 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 _0xc3a8=['update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','put'];(function(_0x29718c,_0x438054){var _0x206b76=function(_0x53119d){while(--_0x53119d){_0x29718c['push'](_0x29718c['shift']());}};_0x206b76(++_0x438054);}(_0xc3a8,0xe8));var _0x8c3a=function(_0x8b953b,_0x132acf){_0x8b953b=_0x8b953b-0x0;var _0x1943d5=_0xc3a8[_0x8b953b];return _0x1943d5;};'use strict';var multer=require(_0x8c3a('0x0'));var util=require(_0x8c3a('0x1'));var path=require(_0x8c3a('0x2'));var timeout=require('connect-timeout');var express=require(_0x8c3a('0x3'));var router=express['Router']();var fs_extra=require(_0x8c3a('0x4'));var auth=require(_0x8c3a('0x5'));var interaction=require(_0x8c3a('0x6'));var config=require(_0x8c3a('0x7'));var controller=require('./analyticMetric.controller');router[_0x8c3a('0x8')]('/',auth[_0x8c3a('0x9')](),controller[_0x8c3a('0xa')]);router[_0x8c3a('0x8')](_0x8c3a('0xb'),auth[_0x8c3a('0x9')](),controller['show']);router[_0x8c3a('0xc')]('/',auth[_0x8c3a('0x9')](),controller[_0x8c3a('0xd')]);router[_0x8c3a('0xe')](_0x8c3a('0xb'),auth['isAuthenticated'](),controller[_0x8c3a('0xf')]);router[_0x8c3a('0x10')]('/:id',auth[_0x8c3a('0x9')](),controller[_0x8c3a('0x11')]);module[_0x8c3a('0x12')]=router; \ No newline at end of file +var _0x46e1=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','put','update','delete','exports','multer'];(function(_0xbd8711,_0x141fc9){var _0xf4a0db=function(_0x2dd33e){while(--_0x2dd33e){_0xbd8711['push'](_0xbd8711['shift']());}};_0xf4a0db(++_0x141fc9);}(_0x46e1,0x155));var _0x146e=function(_0x2eec09,_0x29a261){_0x2eec09=_0x2eec09-0x0;var _0x38b8de=_0x46e1[_0x2eec09];return _0x38b8de;};'use strict';var multer=require(_0x146e('0x0'));var util=require(_0x146e('0x1'));var path=require(_0x146e('0x2'));var timeout=require(_0x146e('0x3'));var express=require(_0x146e('0x4'));var router=express[_0x146e('0x5')]();var fs_extra=require(_0x146e('0x6'));var auth=require(_0x146e('0x7'));var interaction=require(_0x146e('0x8'));var config=require(_0x146e('0x9'));var controller=require('./analyticMetric.controller');router[_0x146e('0xa')]('/',auth[_0x146e('0xb')](),controller[_0x146e('0xc')]);router[_0x146e('0xa')](_0x146e('0xd'),auth[_0x146e('0xb')](),controller[_0x146e('0xe')]);router['post']('/',auth[_0x146e('0xb')](),controller['create']);router[_0x146e('0xf')](_0x146e('0xd'),auth[_0x146e('0xb')](),controller[_0x146e('0x10')]);router[_0x146e('0x11')](_0x146e('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x146e('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index a54cf0e..f33bfd5 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 _0x62a6=['TEXT','exports'];(function(_0x553283,_0xb12ca3){var _0x4e5f74=function(_0xc0ed6b){while(--_0xc0ed6b){_0x553283['push'](_0x553283['shift']());}};_0x4e5f74(++_0xb12ca3);}(_0x62a6,0x7f));var _0x662a=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x62a6[_0x5d2803];return _0xdcad2c;};'use strict';var Sequelize=require('sequelize');module[_0x662a('0x0')]={'tree':{'type':Sequelize[_0x662a('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xca07=['exports','sequelize'];(function(_0x434ded,_0x4a219d){var _0x194aa2=function(_0x1987f2){while(--_0x1987f2){_0x434ded['push'](_0x434ded['shift']());}};_0x194aa2(++_0x4a219d);}(_0xca07,0x1e5));var _0x7ca0=function(_0x522957,_0x9dfe2b){_0x522957=_0x522957-0x0;var _0x3287ad=_0xca07[_0x522957];return _0x3287ad;};'use strict';var Sequelize=require(_0x7ca0('0x0'));module[_0x7ca0('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 93fadb1..7d8caab 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 _0xc6e3=['keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','includeAll','include','rows','catch','show','params','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','jsforce','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','save','then','destroy','name','send','map','AnalyticTreeReport','fieldName','key','model','query'];(function(_0xad42ce,_0x3dee68){var _0x2b2fca=function(_0x5aa31a){while(--_0x5aa31a){_0xad42ce['push'](_0xad42ce['shift']());}};_0x2b2fca(++_0x3dee68);}(_0xc6e3,0x11b));var _0x3c6e=function(_0x1e68f7,_0x298d6d){_0x1e68f7=_0x1e68f7-0x0;var _0x2b14e6=_0xc6e3[_0x1e68f7];return _0x2b14e6;};'use strict';var emlformat=require(_0x3c6e('0x0'));var rimraf=require(_0x3c6e('0x1'));var zipdir=require(_0x3c6e('0x2'));var jsonpatch=require(_0x3c6e('0x3'));var rp=require(_0x3c6e('0x4'));var moment=require(_0x3c6e('0x5'));var BPromise=require(_0x3c6e('0x6'));var Mustache=require(_0x3c6e('0x7'));var util=require(_0x3c6e('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x3c6e('0x9'));var ejs=require(_0x3c6e('0xa'));var fs=require('fs');var fs_extra=require(_0x3c6e('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3c6e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3c6e('0x9'));var querystring=require('querystring');var Papa=require(_0x3c6e('0xd'));var Redis=require(_0x3c6e('0xe'));var authService=require(_0x3c6e('0xf'));var qs=require(_0x3c6e('0x10'));var as=require(_0x3c6e('0x11'));var hardwareService=require(_0x3c6e('0x12'));var logger=require(_0x3c6e('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x3c6e('0x14'));var licenseUtil=require(_0x3c6e('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x354a20,_0x2aef5d){_0x2aef5d=_0x2aef5d||0xcc;return function(_0x34b1e2){if(_0x34b1e2){return _0x354a20[_0x3c6e('0x16')](_0x2aef5d);}return _0x354a20['status'](_0x2aef5d)['end']();};}function respondWithResult(_0x14f8c1,_0x36ecc3){_0x36ecc3=_0x36ecc3||0xc8;return function(_0x46f7f8){if(_0x46f7f8){return _0x14f8c1[_0x3c6e('0x17')](_0x36ecc3)[_0x3c6e('0x18')](_0x46f7f8);}};}function respondWithFilteredResult(_0x585b2b,_0x77eaa8){return function(_0x2c7761){if(_0x2c7761){var _0x55e29b=typeof _0x77eaa8[_0x3c6e('0x19')]===_0x3c6e('0x1a')&&typeof _0x77eaa8[_0x3c6e('0x1b')]===_0x3c6e('0x1a');var _0x4edb7b=_0x2c7761[_0x3c6e('0x1c')];var _0xb7f503=_0x55e29b?0x0:_0x77eaa8[_0x3c6e('0x19')];var _0xf816e6=_0x55e29b?_0x2c7761[_0x3c6e('0x1c')]:_0x77eaa8['offset']+_0x77eaa8['limit'];var _0x48d914;if(_0xf816e6>=_0x4edb7b){_0xf816e6=_0x4edb7b;_0x48d914=0xc8;}else{_0x48d914=0xce;}_0x585b2b[_0x3c6e('0x17')](_0x48d914);return _0x585b2b[_0x3c6e('0x1d')]('Content-Range',_0xb7f503+'-'+_0xf816e6+'/'+_0x4edb7b)['json'](_0x2c7761);}return null;};}function patchUpdates(_0x22bef9){return function(_0x1b98e4){try{jsonpatch[_0x3c6e('0x1e')](_0x1b98e4,_0x22bef9,!![]);}catch(_0x5b5597){return BPromise['reject'](_0x5b5597);}return _0x1b98e4[_0x3c6e('0x1f')]();};}function saveUpdates(_0x57bacd,_0x2756cf){return function(_0xf5e998){if(_0xf5e998){return _0xf5e998['update'](_0x57bacd)[_0x3c6e('0x20')](function(_0x4f87c8){return _0x4f87c8;});}return null;};}function removeEntity(_0x5edca3,_0x3dc527){return function(_0x1724d2){if(_0x1724d2){return _0x1724d2[_0x3c6e('0x21')]()[_0x3c6e('0x20')](function(){_0x5edca3[_0x3c6e('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa94c92,_0x3909ed){return function(_0x5cc0bd){if(!_0x5cc0bd){_0xa94c92['sendStatus'](0x194);}return _0x5cc0bd;};}function handleError(_0x375186,_0x333f9a){_0x333f9a=_0x333f9a||0x1f4;return function(_0x364366){logger['error'](_0x364366['stack']);if(_0x364366[_0x3c6e('0x22')]){delete _0x364366['name'];}_0x375186[_0x3c6e('0x17')](_0x333f9a)[_0x3c6e('0x23')](_0x364366);};}exports['index']=function(_0x27c3e3,_0xaa8c51){var _0x178e81={},_0x5872c7={},_0x30caa9={'count':0x0,'rows':[]};var _0x2f31ba=_[_0x3c6e('0x24')](db[_0x3c6e('0x25')]['rawAttributes'],function(_0x3e426a){return{'name':_0x3e426a[_0x3c6e('0x26')],'type':_0x3e426a['type'][_0x3c6e('0x27')]};});_0x5872c7[_0x3c6e('0x28')]=_[_0x3c6e('0x24')](_0x2f31ba,_0x3c6e('0x22'));_0x5872c7[_0x3c6e('0x29')]=_[_0x3c6e('0x2a')](_0x27c3e3[_0x3c6e('0x29')]);_0x5872c7[_0x3c6e('0x2b')]=_[_0x3c6e('0x2c')](_0x5872c7['model'],_0x5872c7['query']);_0x178e81[_0x3c6e('0x2d')]=_['intersection'](_0x5872c7[_0x3c6e('0x28')],qs[_0x3c6e('0x2e')](_0x27c3e3[_0x3c6e('0x29')]['fields']));_0x178e81[_0x3c6e('0x2d')]=_0x178e81[_0x3c6e('0x2d')]['length']?_0x178e81[_0x3c6e('0x2d')]:_0x5872c7['model'];if(!_0x27c3e3[_0x3c6e('0x29')][_0x3c6e('0x2f')](_0x3c6e('0x30'))){_0x178e81[_0x3c6e('0x1b')]=qs[_0x3c6e('0x1b')](_0x27c3e3[_0x3c6e('0x29')][_0x3c6e('0x1b')]);_0x178e81['offset']=qs[_0x3c6e('0x19')](_0x27c3e3['query'][_0x3c6e('0x19')]);}_0x178e81['order']=qs[_0x3c6e('0x31')](_0x27c3e3['query'][_0x3c6e('0x31')]);_0x178e81[_0x3c6e('0x32')]=qs[_0x3c6e('0x2b')](_['pick'](_0x27c3e3[_0x3c6e('0x29')],_0x5872c7[_0x3c6e('0x2b')]),_0x2f31ba);if(_0x27c3e3[_0x3c6e('0x29')][_0x3c6e('0x33')]){_0x178e81[_0x3c6e('0x32')]=_[_0x3c6e('0x34')](_0x178e81['where'],{'$or':_[_0x3c6e('0x24')](_0x2f31ba,function(_0x301974){if(_0x301974[_0x3c6e('0x35')]!==_0x3c6e('0x36')){var _0x303841={};_0x303841[_0x301974[_0x3c6e('0x22')]]={'$like':'%'+_0x27c3e3[_0x3c6e('0x29')][_0x3c6e('0x33')]+'%'};return _0x303841;}})});}_0x178e81=_[_0x3c6e('0x34')]({},_0x178e81,_0x27c3e3['options']);var _0x787392={'where':_0x178e81[_0x3c6e('0x32')]};return db[_0x3c6e('0x25')][_0x3c6e('0x1c')](_0x787392)['then'](function(_0x5dbb2a){_0x30caa9[_0x3c6e('0x1c')]=_0x5dbb2a;if(_0x27c3e3[_0x3c6e('0x29')][_0x3c6e('0x37')]){_0x178e81[_0x3c6e('0x38')]=[{'all':!![]}];}return db[_0x3c6e('0x25')]['findAll'](_0x178e81);})[_0x3c6e('0x20')](function(_0x37cf1b){_0x30caa9[_0x3c6e('0x39')]=_0x37cf1b;return _0x30caa9;})[_0x3c6e('0x20')](respondWithFilteredResult(_0xaa8c51,_0x178e81))[_0x3c6e('0x3a')](handleError(_0xaa8c51,null));};exports[_0x3c6e('0x3b')]=function(_0x253d02,_0x416d43){var _0x353442={'raw':!![],'where':{'id':_0x253d02[_0x3c6e('0x3c')]['id']}},_0x5f67ad={};_0x5f67ad['model']=_[_0x3c6e('0x2a')](db[_0x3c6e('0x25')]['rawAttributes']);_0x5f67ad[_0x3c6e('0x29')]=_[_0x3c6e('0x2a')](_0x253d02[_0x3c6e('0x29')]);_0x5f67ad[_0x3c6e('0x2b')]=_['intersection'](_0x5f67ad[_0x3c6e('0x28')],_0x5f67ad[_0x3c6e('0x29')]);_0x353442[_0x3c6e('0x2d')]=_[_0x3c6e('0x2c')](_0x5f67ad[_0x3c6e('0x28')],qs['fields'](_0x253d02[_0x3c6e('0x29')][_0x3c6e('0x2e')]));_0x353442[_0x3c6e('0x2d')]=_0x353442[_0x3c6e('0x2d')]['length']?_0x353442[_0x3c6e('0x2d')]:_0x5f67ad['model'];if(_0x253d02['query'][_0x3c6e('0x37')]){_0x353442[_0x3c6e('0x38')]=[{'all':!![]}];}_0x353442=_[_0x3c6e('0x34')]({},_0x353442,_0x253d02[_0x3c6e('0x3d')]);return db['AnalyticTreeReport'][_0x3c6e('0x3e')](_0x353442)[_0x3c6e('0x20')](handleEntityNotFound(_0x416d43,null))['then'](respondWithResult(_0x416d43,null))[_0x3c6e('0x3a')](handleError(_0x416d43,null));};exports[_0x3c6e('0x3f')]=function(_0x1e5a85,_0xaebe1e){return db[_0x3c6e('0x25')]['create'](_0x1e5a85[_0x3c6e('0x40')],{})['then'](respondWithResult(_0xaebe1e,0xc9))[_0x3c6e('0x3a')](handleError(_0xaebe1e,null));};exports['update']=function(_0x42dfa3,_0x389f9d){if(_0x42dfa3['body']['id']){delete _0x42dfa3[_0x3c6e('0x40')]['id'];}return db[_0x3c6e('0x25')][_0x3c6e('0x3e')]({'where':{'id':_0x42dfa3[_0x3c6e('0x3c')]['id']}})['then'](handleEntityNotFound(_0x389f9d,null))[_0x3c6e('0x20')](saveUpdates(_0x42dfa3[_0x3c6e('0x40')],null))[_0x3c6e('0x20')](respondWithResult(_0x389f9d,null))[_0x3c6e('0x3a')](handleError(_0x389f9d,null));};exports[_0x3c6e('0x21')]=function(_0x6e35a6,_0x484d30){return db[_0x3c6e('0x25')][_0x3c6e('0x3e')]({'where':{'id':_0x6e35a6[_0x3c6e('0x3c')]['id']}})[_0x3c6e('0x20')](handleEntityNotFound(_0x484d30,null))[_0x3c6e('0x20')](removeEntity(_0x484d30,null))['catch'](handleError(_0x484d30,null));}; \ No newline at end of file +var _0x0acf=['querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','AnalyticTreeReport','catch','keys','include','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv'];(function(_0x578ac2,_0x4fd399){var _0x4976de=function(_0x53bdbd){while(--_0x53bdbd){_0x578ac2['push'](_0x578ac2['shift']());}};_0x4976de(++_0x4fd399);}(_0x0acf,0x19a));var _0xf0ac=function(_0x735da9,_0x38b186){_0x735da9=_0x735da9-0x0;var _0x39160b=_0x0acf[_0x735da9];return _0x39160b;};'use strict';var emlformat=require(_0xf0ac('0x0'));var rimraf=require(_0xf0ac('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf0ac('0x2'));var rp=require(_0xf0ac('0x3'));var moment=require('moment');var BPromise=require(_0xf0ac('0x4'));var Mustache=require(_0xf0ac('0x5'));var util=require(_0xf0ac('0x6'));var path=require(_0xf0ac('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf0ac('0x8'));var fs=require('fs');var fs_extra=require(_0xf0ac('0x9'));var _=require(_0xf0ac('0xa'));var squel=require(_0xf0ac('0xb'));var crypto=require(_0xf0ac('0xc'));var jsforce=require(_0xf0ac('0xd'));var deskjs=require(_0xf0ac('0xe'));var toCsv=require(_0xf0ac('0xf'));var querystring=require(_0xf0ac('0x10'));var Papa=require(_0xf0ac('0x11'));var Redis=require(_0xf0ac('0x12'));var authService=require(_0xf0ac('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf0ac('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xf0ac('0x15'));var licenseUtil=require(_0xf0ac('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x329dc8,_0x55db28){_0x55db28=_0x55db28||0xcc;return function(_0x5105ba){if(_0x5105ba){return _0x329dc8[_0xf0ac('0x17')](_0x55db28);}return _0x329dc8['status'](_0x55db28)['end']();};}function respondWithResult(_0x1a6795,_0x906110){_0x906110=_0x906110||0xc8;return function(_0xe97144){if(_0xe97144){return _0x1a6795[_0xf0ac('0x18')](_0x906110)[_0xf0ac('0x19')](_0xe97144);}};}function respondWithFilteredResult(_0x210d92,_0xc63b){return function(_0x22879d){if(_0x22879d){var _0x5c864e=typeof _0xc63b[_0xf0ac('0x1a')]==='undefined'&&typeof _0xc63b['limit']===_0xf0ac('0x1b');var _0x4c2505=_0x22879d[_0xf0ac('0x1c')];var _0x2b0c53=_0x5c864e?0x0:_0xc63b['offset'];var _0x202db4=_0x5c864e?_0x22879d[_0xf0ac('0x1c')]:_0xc63b[_0xf0ac('0x1a')]+_0xc63b[_0xf0ac('0x1d')];var _0x307bc3;if(_0x202db4>=_0x4c2505){_0x202db4=_0x4c2505;_0x307bc3=0xc8;}else{_0x307bc3=0xce;}_0x210d92[_0xf0ac('0x18')](_0x307bc3);return _0x210d92[_0xf0ac('0x1e')](_0xf0ac('0x1f'),_0x2b0c53+'-'+_0x202db4+'/'+_0x4c2505)[_0xf0ac('0x19')](_0x22879d);}return null;};}function patchUpdates(_0x3e62e1){return function(_0x4e81bd){try{jsonpatch[_0xf0ac('0x20')](_0x4e81bd,_0x3e62e1,!![]);}catch(_0x5f1eac){return BPromise[_0xf0ac('0x21')](_0x5f1eac);}return _0x4e81bd[_0xf0ac('0x22')]();};}function saveUpdates(_0x3f4b25,_0x5c14f8){return function(_0x51f85f){if(_0x51f85f){return _0x51f85f[_0xf0ac('0x23')](_0x3f4b25)['then'](function(_0x555a9f){return _0x555a9f;});}return null;};}function removeEntity(_0x5c07af,_0x48f99e){return function(_0x2061fd){if(_0x2061fd){return _0x2061fd[_0xf0ac('0x24')]()[_0xf0ac('0x25')](function(){_0x5c07af[_0xf0ac('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x577c92,_0x2b699b){return function(_0x2bdde1){if(!_0x2bdde1){_0x577c92[_0xf0ac('0x17')](0x194);}return _0x2bdde1;};}function handleError(_0x290469,_0x1cf947){_0x1cf947=_0x1cf947||0x1f4;return function(_0x489532){logger['error'](_0x489532['stack']);if(_0x489532[_0xf0ac('0x26')]){delete _0x489532['name'];}_0x290469[_0xf0ac('0x18')](_0x1cf947)[_0xf0ac('0x27')](_0x489532);};}exports[_0xf0ac('0x28')]=function(_0x2efc0f,_0x379f64){var _0x24de48={},_0x24d26f={},_0x34a6ce={'count':0x0,'rows':[]};var _0x3b9b20=_[_0xf0ac('0x29')](db['AnalyticTreeReport'][_0xf0ac('0x2a')],function(_0x3e5824){return{'name':_0x3e5824[_0xf0ac('0x2b')],'type':_0x3e5824[_0xf0ac('0x2c')][_0xf0ac('0x2d')]};});_0x24d26f[_0xf0ac('0x2e')]=_['map'](_0x3b9b20,'name');_0x24d26f[_0xf0ac('0x2f')]=_['keys'](_0x2efc0f[_0xf0ac('0x2f')]);_0x24d26f[_0xf0ac('0x30')]=_[_0xf0ac('0x31')](_0x24d26f[_0xf0ac('0x2e')],_0x24d26f[_0xf0ac('0x2f')]);_0x24de48[_0xf0ac('0x32')]=_['intersection'](_0x24d26f[_0xf0ac('0x2e')],qs[_0xf0ac('0x33')](_0x2efc0f['query'][_0xf0ac('0x33')]));_0x24de48[_0xf0ac('0x32')]=_0x24de48[_0xf0ac('0x32')][_0xf0ac('0x34')]?_0x24de48['attributes']:_0x24d26f[_0xf0ac('0x2e')];if(!_0x2efc0f[_0xf0ac('0x2f')][_0xf0ac('0x35')](_0xf0ac('0x36'))){_0x24de48[_0xf0ac('0x1d')]=qs['limit'](_0x2efc0f[_0xf0ac('0x2f')][_0xf0ac('0x1d')]);_0x24de48[_0xf0ac('0x1a')]=qs[_0xf0ac('0x1a')](_0x2efc0f[_0xf0ac('0x2f')]['offset']);}_0x24de48[_0xf0ac('0x37')]=qs[_0xf0ac('0x38')](_0x2efc0f[_0xf0ac('0x2f')][_0xf0ac('0x38')]);_0x24de48['where']=qs['filters'](_[_0xf0ac('0x39')](_0x2efc0f[_0xf0ac('0x2f')],_0x24d26f[_0xf0ac('0x30')]),_0x3b9b20);if(_0x2efc0f[_0xf0ac('0x2f')][_0xf0ac('0x3a')]){_0x24de48[_0xf0ac('0x3b')]=_[_0xf0ac('0x3c')](_0x24de48[_0xf0ac('0x3b')],{'$or':_['map'](_0x3b9b20,function(_0xa8dcae){if(_0xa8dcae[_0xf0ac('0x2c')]!==_0xf0ac('0x3d')){var _0x567b2b={};_0x567b2b[_0xa8dcae['name']]={'$like':'%'+_0x2efc0f['query'][_0xf0ac('0x3a')]+'%'};return _0x567b2b;}})});}_0x24de48=_['merge']({},_0x24de48,_0x2efc0f[_0xf0ac('0x3e')]);var _0x485176={'where':_0x24de48[_0xf0ac('0x3b')]};return db[_0xf0ac('0x3f')][_0xf0ac('0x1c')](_0x485176)['then'](function(_0x1e9751){_0x34a6ce[_0xf0ac('0x1c')]=_0x1e9751;if(_0x2efc0f[_0xf0ac('0x2f')]['includeAll']){_0x24de48['include']=[{'all':!![]}];}return db[_0xf0ac('0x3f')]['findAll'](_0x24de48);})[_0xf0ac('0x25')](function(_0x4267de){_0x34a6ce['rows']=_0x4267de;return _0x34a6ce;})[_0xf0ac('0x25')](respondWithFilteredResult(_0x379f64,_0x24de48))[_0xf0ac('0x40')](handleError(_0x379f64,null));};exports['show']=function(_0x4031d5,_0x5a01aa){var _0x5c7af9={'raw':!![],'where':{'id':_0x4031d5['params']['id']}},_0x108532={};_0x108532[_0xf0ac('0x2e')]=_[_0xf0ac('0x41')](db[_0xf0ac('0x3f')][_0xf0ac('0x2a')]);_0x108532['query']=_[_0xf0ac('0x41')](_0x4031d5[_0xf0ac('0x2f')]);_0x108532['filters']=_['intersection'](_0x108532[_0xf0ac('0x2e')],_0x108532['query']);_0x5c7af9[_0xf0ac('0x32')]=_[_0xf0ac('0x31')](_0x108532['model'],qs[_0xf0ac('0x33')](_0x4031d5[_0xf0ac('0x2f')][_0xf0ac('0x33')]));_0x5c7af9[_0xf0ac('0x32')]=_0x5c7af9[_0xf0ac('0x32')][_0xf0ac('0x34')]?_0x5c7af9[_0xf0ac('0x32')]:_0x108532[_0xf0ac('0x2e')];if(_0x4031d5['query']['includeAll']){_0x5c7af9[_0xf0ac('0x42')]=[{'all':!![]}];}_0x5c7af9=_[_0xf0ac('0x3c')]({},_0x5c7af9,_0x4031d5[_0xf0ac('0x3e')]);return db[_0xf0ac('0x3f')][_0xf0ac('0x43')](_0x5c7af9)[_0xf0ac('0x25')](handleEntityNotFound(_0x5a01aa,null))[_0xf0ac('0x25')](respondWithResult(_0x5a01aa,null))[_0xf0ac('0x40')](handleError(_0x5a01aa,null));};exports[_0xf0ac('0x44')]=function(_0x2e97c5,_0x5439c8){return db[_0xf0ac('0x3f')]['create'](_0x2e97c5[_0xf0ac('0x45')],{})[_0xf0ac('0x25')](respondWithResult(_0x5439c8,0xc9))[_0xf0ac('0x40')](handleError(_0x5439c8,null));};exports[_0xf0ac('0x23')]=function(_0xbf941c,_0x119e6d){if(_0xbf941c['body']['id']){delete _0xbf941c[_0xf0ac('0x45')]['id'];}return db[_0xf0ac('0x3f')][_0xf0ac('0x43')]({'where':{'id':_0xbf941c[_0xf0ac('0x46')]['id']}})['then'](handleEntityNotFound(_0x119e6d,null))[_0xf0ac('0x25')](saveUpdates(_0xbf941c[_0xf0ac('0x45')],null))[_0xf0ac('0x25')](respondWithResult(_0x119e6d,null))['catch'](handleError(_0x119e6d,null));};exports[_0xf0ac('0x24')]=function(_0x243773,_0x400608){return db[_0xf0ac('0x3f')][_0xf0ac('0x43')]({'where':{'id':_0x243773[_0xf0ac('0x46')]['id']}})[_0xf0ac('0x25')](handleEntityNotFound(_0x400608,null))[_0xf0ac('0x25')](removeEntity(_0x400608,null))[_0xf0ac('0x40')](handleError(_0x400608,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index a320923..5c37d3a 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 _0x2aca=['request-promise','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','AnalyticTreeReport','analytics_report_trees','util','api','bluebird'];(function(_0x3712d2,_0x259c5a){var _0x18d859=function(_0x5242cf){while(--_0x5242cf){_0x3712d2['push'](_0x3712d2['shift']());}};_0x18d859(++_0x259c5a);}(_0x2aca,0xb1));var _0xa2ac=function(_0x9350b6,_0x2355d5){_0x9350b6=_0x9350b6-0x0;var _0x4e797e=_0x2aca[_0x9350b6];return _0x4e797e;};'use strict';var _=require('lodash');var util=require(_0xa2ac('0x0'));var logger=require('../../config/logger')(_0xa2ac('0x1'));var moment=require('moment');var BPromise=require(_0xa2ac('0x2'));var rp=require(_0xa2ac('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa2ac('0x4'));var config=require(_0xa2ac('0x5'));var attributes=require(_0xa2ac('0x6'));module[_0xa2ac('0x7')]=function(_0x5e943b,_0x5b512d){return _0x5e943b['define'](_0xa2ac('0x8'),attributes,{'tableName':_0xa2ac('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x078a=['request-promise','path','rimraf','../../config/environment','exports','define','AnalyticTreeReport','analytics_report_trees','util','../../config/logger','api','moment'];(function(_0x360b40,_0x206827){var _0x42bebf=function(_0x1bd438){while(--_0x1bd438){_0x360b40['push'](_0x360b40['shift']());}};_0x42bebf(++_0x206827);}(_0x078a,0x1c4));var _0xa078=function(_0x415344,_0x2d0f25){_0x415344=_0x415344-0x0;var _0x56dd24=_0x078a[_0x415344];return _0x56dd24;};'use strict';var _=require('lodash');var util=require(_0xa078('0x0'));var logger=require(_0xa078('0x1'))(_0xa078('0x2'));var moment=require(_0xa078('0x3'));var BPromise=require('bluebird');var rp=require(_0xa078('0x4'));var fs=require('fs');var path=require(_0xa078('0x5'));var rimraf=require(_0xa078('0x6'));var config=require(_0xa078('0x7'));var attributes=require('./analyticTreeReport.attributes');module[_0xa078('0x8')]=function(_0x42e11e,_0x4cc5af){return _0x42e11e[_0xa078('0x9')](_0xa078('0xa'),attributes,{'tableName':_0xa078('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 2682bd9..b8dd92a 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(_0x2e409e,_0x2d227e){var _0xe6e039=function(_0x47195d){while(--_0x47195d){_0x2e409e['push'](_0x2e409e['shift']());}};_0xe6e039(++_0x2d227e);}(_0xadb5,0xad));var _0x5adb=function(_0x3aa490,_0x3a9a5e){_0x3aa490=_0x3aa490-0x0;var _0xed54e6=_0xadb5[_0x3aa490];return _0xed54e6;};'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(_0x100e36,_0x4da225){var _0x1df0c9=function(_0xe4b84f){while(--_0xe4b84f){_0x100e36['push'](_0x100e36['shift']());}};_0x1df0c9(++_0x4da225);}(_0xadb5,0xad));var _0x5adb=function(_0x293dae,_0x6178e0){_0x293dae=_0x293dae-0x0;var _0x1446a4=_0xadb5[_0x293dae];return _0x1446a4;};'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 80939f7..9bfd339 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 _0x406f=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','multer','util'];(function(_0x236c89,_0xd76ba9){var _0x3b2a15=function(_0x89e4f9){while(--_0x89e4f9){_0x236c89['push'](_0x236c89['shift']());}};_0x3b2a15(++_0xd76ba9);}(_0x406f,0x1d9));var _0xf406=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x406f[_0x178e48];return _0x440d7e;};'use strict';var multer=require(_0xf406('0x0'));var util=require(_0xf406('0x1'));var path=require(_0xf406('0x2'));var timeout=require(_0xf406('0x3'));var express=require('express');var router=express[_0xf406('0x4')]();var fs_extra=require(_0xf406('0x5'));var auth=require(_0xf406('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf406('0x7'));var controller=require(_0xf406('0x8'));router[_0xf406('0x9')]('/',auth[_0xf406('0xa')](),controller[_0xf406('0xb')]);router[_0xf406('0x9')](_0xf406('0xc'),auth[_0xf406('0xa')](),controller['show']);router[_0xf406('0xd')]('/',auth['isAuthenticated'](),controller[_0xf406('0xe')]);router[_0xf406('0xf')](_0xf406('0xc'),auth[_0xf406('0xa')](),controller[_0xf406('0x10')]);router[_0xf406('0x11')](_0xf406('0xc'),auth[_0xf406('0xa')](),controller[_0xf406('0x12')]);module['exports']=router; \ No newline at end of file +var _0xa726=['show','post','put','isAuthenticated','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','./analyticTreeReport.controller','index','get','/:id'];(function(_0x3bc43e,_0x308bb6){var _0x3d6fe3=function(_0x1d9062){while(--_0x1d9062){_0x3bc43e['push'](_0x3bc43e['shift']());}};_0x3d6fe3(++_0x308bb6);}(_0xa726,0x7e));var _0x6a72=function(_0xfcbcb8,_0x35bf6b){_0xfcbcb8=_0xfcbcb8-0x0;var _0x1b1f97=_0xa726[_0xfcbcb8];return _0x1b1f97;};'use strict';var multer=require(_0x6a72('0x0'));var util=require(_0x6a72('0x1'));var path=require('path');var timeout=require(_0x6a72('0x2'));var express=require(_0x6a72('0x3'));var router=express[_0x6a72('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6a72('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6a72('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x6a72('0x7')]);router[_0x6a72('0x8')](_0x6a72('0x9'),auth['isAuthenticated'](),controller[_0x6a72('0xa')]);router[_0x6a72('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6a72('0xc')](_0x6a72('0x9'),auth[_0x6a72('0xd')](),controller['update']);router[_0x6a72('0xe')](_0x6a72('0x9'),auth[_0x6a72('0xd')](),controller[_0x6a72('0xf')]);module[_0x6a72('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 b427161..81d2909 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 _0xcee8=['sequelize','exports','STRING'];(function(_0x38d729,_0x4f5ad0){var _0x2005ea=function(_0x1ff687){while(--_0x1ff687){_0x38d729['push'](_0x38d729['shift']());}};_0x2005ea(++_0x4f5ad0);}(_0xcee8,0xb1));var _0x8cee=function(_0xb8f89e,_0x5df65){_0xb8f89e=_0xb8f89e-0x0;var _0x955eac=_0xcee8[_0xb8f89e];return _0x955eac;};'use strict';var Sequelize=require(_0x8cee('0x0'));module[_0x8cee('0x1')]={'name':{'type':Sequelize[_0x8cee('0x2')]},'basename':{'type':Sequelize[_0x8cee('0x2')]},'type':{'type':Sequelize[_0x8cee('0x2')]}}; \ No newline at end of file +var _0x3140=['STRING','sequelize','exports'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x3140,0xaf));var _0x0314=function(_0x1f5d35,_0x13db91){_0x1f5d35=_0x1f5d35-0x0;var _0x27355a=_0x3140[_0x1f5d35];return _0x27355a;};'use strict';var Sequelize=require(_0x0314('0x0'));module[_0x0314('0x1')]={'name':{'type':Sequelize[_0x0314('0x2')]},'basename':{'type':Sequelize[_0x0314('0x2')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 57b13c8..d5eb99e 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 _0x1f26=['root','server/files/attachments/','offline-chat/','basename','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','include','findAll','rows','catch','show','params','keys','includeAll','find','clone','get','omit','createdAt','updatedAt','body','create','destroy','file','originalname','filename','mimetype','findOne','ChatOfflineMessageId','join'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x1f26,0x1e5));var _0x61f2=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1f26[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x61f2('0x0'));var rimraf=require(_0x61f2('0x1'));var zipdir=require(_0x61f2('0x2'));var jsonpatch=require(_0x61f2('0x3'));var rp=require(_0x61f2('0x4'));var moment=require(_0x61f2('0x5'));var BPromise=require(_0x61f2('0x6'));var Mustache=require(_0x61f2('0x7'));var util=require(_0x61f2('0x8'));var path=require(_0x61f2('0x9'));var sox=require('sox');var csv=require(_0x61f2('0xa'));var ejs=require(_0x61f2('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x61f2('0xc'));var squel=require(_0x61f2('0xd'));var crypto=require('crypto');var jsforce=require(_0x61f2('0xe'));var deskjs=require(_0x61f2('0xf'));var toCsv=require(_0x61f2('0xa'));var querystring=require(_0x61f2('0x10'));var Papa=require(_0x61f2('0x11'));var Redis=require(_0x61f2('0x12'));var authService=require(_0x61f2('0x13'));var qs=require(_0x61f2('0x14'));var as=require(_0x61f2('0x15'));var hardwareService=require(_0x61f2('0x16'));var logger=require(_0x61f2('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x61f2('0x18'));var licenseUtil=require(_0x61f2('0x19'));var db=require(_0x61f2('0x1a'))['db'];function respondWithStatusCode(_0x3dfaa2,_0x55aae3){_0x55aae3=_0x55aae3||0xcc;return function(_0x3f168a){if(_0x3f168a){return _0x3dfaa2[_0x61f2('0x1b')](_0x55aae3);}return _0x3dfaa2[_0x61f2('0x1c')](_0x55aae3)[_0x61f2('0x1d')]();};}function respondWithResult(_0x2221c0,_0x252e44){_0x252e44=_0x252e44||0xc8;return function(_0x3c1a97){if(_0x3c1a97){return _0x2221c0[_0x61f2('0x1c')](_0x252e44)[_0x61f2('0x1e')](_0x3c1a97);}};}function respondWithFilteredResult(_0x4369c6,_0x2c300c){return function(_0x7dfc3){if(_0x7dfc3){var _0x1e9c93=typeof _0x2c300c[_0x61f2('0x1f')]===_0x61f2('0x20')&&typeof _0x2c300c[_0x61f2('0x21')]===_0x61f2('0x20');var _0x186ddb=_0x7dfc3[_0x61f2('0x22')];var _0x4514e6=_0x1e9c93?0x0:_0x2c300c[_0x61f2('0x1f')];var _0x5e49c1=_0x1e9c93?_0x7dfc3[_0x61f2('0x22')]:_0x2c300c[_0x61f2('0x1f')]+_0x2c300c[_0x61f2('0x21')];var _0x337c82;if(_0x5e49c1>=_0x186ddb){_0x5e49c1=_0x186ddb;_0x337c82=0xc8;}else{_0x337c82=0xce;}_0x4369c6[_0x61f2('0x1c')](_0x337c82);return _0x4369c6['set'](_0x61f2('0x23'),_0x4514e6+'-'+_0x5e49c1+'/'+_0x186ddb)['json'](_0x7dfc3);}return null;};}function patchUpdates(_0x20c9c8){return function(_0x57e00c){try{jsonpatch[_0x61f2('0x24')](_0x57e00c,_0x20c9c8,!![]);}catch(_0x19be32){return BPromise[_0x61f2('0x25')](_0x19be32);}return _0x57e00c[_0x61f2('0x26')]();};}function saveUpdates(_0xcb0ed6,_0x4e7ff0){return function(_0x5aa9d4){if(_0x5aa9d4){return _0x5aa9d4['update'](_0xcb0ed6)[_0x61f2('0x27')](function(_0x331d5a){return _0x331d5a;});}return null;};}function removeEntity(_0xe2836d,_0x4fe589){return function(_0x328c0d){if(_0x328c0d){return _0x328c0d['destroy']()[_0x61f2('0x27')](function(){_0xe2836d[_0x61f2('0x1c')](0xcc)[_0x61f2('0x1d')]();});}};}function handleEntityNotFound(_0x4ee1ef,_0x4d05c3){return function(_0x5e65e2){if(!_0x5e65e2){_0x4ee1ef[_0x61f2('0x1b')](0x194);}return _0x5e65e2;};}function handleError(_0x2927f7,_0xc4fc19){_0xc4fc19=_0xc4fc19||0x1f4;return function(_0x53721e){logger[_0x61f2('0x28')](_0x53721e[_0x61f2('0x29')]);if(_0x53721e[_0x61f2('0x2a')]){delete _0x53721e[_0x61f2('0x2a')];}_0x2927f7[_0x61f2('0x1c')](_0xc4fc19)[_0x61f2('0x2b')](_0x53721e);};}exports[_0x61f2('0x2c')]=function(_0x13ab29,_0x592b23){var _0x3d9590={},_0x32f405={},_0x3da8dc={'count':0x0,'rows':[]};var _0x22b47a=_[_0x61f2('0x2d')](db[_0x61f2('0x2e')][_0x61f2('0x2f')],function(_0x3adb33){return{'name':_0x3adb33[_0x61f2('0x30')],'type':_0x3adb33[_0x61f2('0x31')][_0x61f2('0x32')]};});_0x32f405['model']=_['map'](_0x22b47a,_0x61f2('0x2a'));_0x32f405['query']=_['keys'](_0x13ab29[_0x61f2('0x33')]);_0x32f405['filters']=_[_0x61f2('0x34')](_0x32f405[_0x61f2('0x35')],_0x32f405[_0x61f2('0x33')]);_0x3d9590[_0x61f2('0x36')]=_[_0x61f2('0x34')](_0x32f405['model'],qs[_0x61f2('0x37')](_0x13ab29['query'][_0x61f2('0x37')]));_0x3d9590[_0x61f2('0x36')]=_0x3d9590[_0x61f2('0x36')][_0x61f2('0x38')]?_0x3d9590[_0x61f2('0x36')]:_0x32f405[_0x61f2('0x35')];if(!_0x13ab29[_0x61f2('0x33')][_0x61f2('0x39')](_0x61f2('0x3a'))){_0x3d9590['limit']=qs[_0x61f2('0x21')](_0x13ab29[_0x61f2('0x33')]['limit']);_0x3d9590['offset']=qs[_0x61f2('0x1f')](_0x13ab29['query'][_0x61f2('0x1f')]);}_0x3d9590[_0x61f2('0x3b')]=qs[_0x61f2('0x3c')](_0x13ab29[_0x61f2('0x33')][_0x61f2('0x3c')]);_0x3d9590[_0x61f2('0x3d')]=qs[_0x61f2('0x3e')](_[_0x61f2('0x3f')](_0x13ab29[_0x61f2('0x33')],_0x32f405[_0x61f2('0x3e')]),_0x22b47a);if(_0x13ab29[_0x61f2('0x33')][_0x61f2('0x40')]){_0x3d9590[_0x61f2('0x3d')]=_[_0x61f2('0x41')](_0x3d9590['where'],{'$or':_[_0x61f2('0x2d')](_0x22b47a,function(_0x4e45a7){if(_0x4e45a7[_0x61f2('0x31')]!=='VIRTUAL'){var _0x1aee67={};_0x1aee67[_0x4e45a7[_0x61f2('0x2a')]]={'$like':'%'+_0x13ab29[_0x61f2('0x33')][_0x61f2('0x40')]+'%'};return _0x1aee67;}})});}_0x3d9590=_[_0x61f2('0x41')]({},_0x3d9590,_0x13ab29[_0x61f2('0x42')]);var _0x28dd4c={'where':_0x3d9590[_0x61f2('0x3d')]};return db[_0x61f2('0x2e')][_0x61f2('0x22')](_0x28dd4c)[_0x61f2('0x27')](function(_0x1a65f9){_0x3da8dc['count']=_0x1a65f9;if(_0x13ab29[_0x61f2('0x33')]['includeAll']){_0x3d9590[_0x61f2('0x43')]=[{'all':!![]}];}return db['Attachment'][_0x61f2('0x44')](_0x3d9590);})[_0x61f2('0x27')](function(_0x56036c){_0x3da8dc[_0x61f2('0x45')]=_0x56036c;return _0x3da8dc;})[_0x61f2('0x27')](respondWithFilteredResult(_0x592b23,_0x3d9590))[_0x61f2('0x46')](handleError(_0x592b23,null));};exports[_0x61f2('0x47')]=function(_0x3ab482,_0xa736f7){var _0x7cac21={'raw':!![],'where':{'id':_0x3ab482[_0x61f2('0x48')]['id']}},_0x110757={};_0x110757[_0x61f2('0x35')]=_[_0x61f2('0x49')](db[_0x61f2('0x2e')]['rawAttributes']);_0x110757[_0x61f2('0x33')]=_[_0x61f2('0x49')](_0x3ab482[_0x61f2('0x33')]);_0x110757[_0x61f2('0x3e')]=_[_0x61f2('0x34')](_0x110757['model'],_0x110757[_0x61f2('0x33')]);_0x7cac21[_0x61f2('0x36')]=_[_0x61f2('0x34')](_0x110757['model'],qs[_0x61f2('0x37')](_0x3ab482[_0x61f2('0x33')][_0x61f2('0x37')]));_0x7cac21[_0x61f2('0x36')]=_0x7cac21[_0x61f2('0x36')][_0x61f2('0x38')]?_0x7cac21[_0x61f2('0x36')]:_0x110757[_0x61f2('0x35')];if(_0x3ab482[_0x61f2('0x33')][_0x61f2('0x4a')]){_0x7cac21[_0x61f2('0x43')]=[{'all':!![]}];}_0x7cac21=_[_0x61f2('0x41')]({},_0x7cac21,_0x3ab482[_0x61f2('0x42')]);return db['Attachment'][_0x61f2('0x4b')](_0x7cac21)['then'](handleEntityNotFound(_0xa736f7,null))[_0x61f2('0x27')](respondWithResult(_0xa736f7,null))[_0x61f2('0x46')](handleError(_0xa736f7,null));};exports[_0x61f2('0x4c')]=function(_0x4ddc7f,_0xddd096){var _0x1151e0={'where':{'id':_0x4ddc7f['params']['id']}},_0x1cc786={};_0x1cc786[_0x61f2('0x35')]=_[_0x61f2('0x49')](db['Attachment']['rawAttributes']);_0x1151e0['attributes']=_['intersection'](_0x1cc786[_0x61f2('0x35')],qs['fields'](_0x4ddc7f[_0x61f2('0x33')][_0x61f2('0x37')]));_0x1151e0[_0x61f2('0x36')]=_0x1151e0['attributes'][_0x61f2('0x38')]?_0x1151e0[_0x61f2('0x36')]:_0x1cc786[_0x61f2('0x35')];if(_0x4ddc7f[_0x61f2('0x33')][_0x61f2('0x4a')]){_0x1151e0[_0x61f2('0x43')]=[{'all':!![]}];}_0x1151e0=_[_0x61f2('0x41')]({},_0x1151e0,_0x4ddc7f['options']);return db[_0x61f2('0x2e')]['find'](_0x1151e0)[_0x61f2('0x27')](handleEntityNotFound(_0xddd096,null))[_0x61f2('0x27')](function(_0x4fcf70){if(_0x4fcf70){var _0x58ac34=_0x4fcf70[_0x61f2('0x4d')]({'plain':!![]});_0x58ac34=qs[_0x61f2('0x4e')](_0x58ac34,['id',_0x61f2('0x4f'),_0x61f2('0x50')]);_0x4ddc7f[_0x61f2('0x51')]=_[_0x61f2('0x4e')](_0x4ddc7f['body'],['id',_0x61f2('0x4f'),_0x61f2('0x50')]);return db['Attachment'][_0x61f2('0x52')](_[_0x61f2('0x41')](_0x58ac34,_0x4ddc7f['body']),{'include':_0x4ddc7f['query']['includeAll']?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0xddd096,0xc9))[_0x61f2('0x46')](handleError(_0xddd096,null));};exports['update']=function(_0x279c3c,_0x80c83f){if(_0x279c3c[_0x61f2('0x51')]['id']){delete _0x279c3c[_0x61f2('0x51')]['id'];}return db[_0x61f2('0x2e')][_0x61f2('0x4b')]({'where':{'id':_0x279c3c[_0x61f2('0x48')]['id']}})[_0x61f2('0x27')](handleEntityNotFound(_0x80c83f,null))[_0x61f2('0x27')](saveUpdates(_0x279c3c['body'],null))[_0x61f2('0x27')](respondWithResult(_0x80c83f,null))[_0x61f2('0x46')](handleError(_0x80c83f,null));};exports[_0x61f2('0x53')]=function(_0x250111,_0x333051){return db[_0x61f2('0x2e')][_0x61f2('0x4b')]({'where':{'id':_0x250111[_0x61f2('0x48')]['id']}})[_0x61f2('0x27')](handleEntityNotFound(_0x333051,null))[_0x61f2('0x27')](removeEntity(_0x333051,null))[_0x61f2('0x46')](handleError(_0x333051,null));};exports['create']=function(_0x418651,_0x197284,_0x7204b5){_0x418651[_0x61f2('0x51')][_0x61f2('0x2a')]=_0x418651[_0x61f2('0x54')][_0x61f2('0x55')];_0x418651[_0x61f2('0x51')]['basename']=_0x418651['file'][_0x61f2('0x56')];_0x418651['body'][_0x61f2('0x31')]=_0x418651['file'][_0x61f2('0x57')];return db['Attachment'][_0x61f2('0x52')](_0x418651[_0x61f2('0x51')])['then'](respondWithResult(_0x197284,0xc9))[_0x61f2('0x46')](handleError(_0x197284,null));};exports['download']=function(_0x55b696,_0x1d30c2,_0x52d51d){return db['Attachment'][_0x61f2('0x58')]({'where':{'id':_0x55b696[_0x61f2('0x48')]['id']},'raw':!![]})[_0x61f2('0x27')](handleEntityNotFound(_0x1d30c2,null))['then'](function(_0xef639){if(_0xef639){var _0x53b0e6=_0xef639[_0x61f2('0x59')]!==null;var _0x125d73=path[_0x61f2('0x5a')](config[_0x61f2('0x5b')],_0x61f2('0x5c'));if(_0x53b0e6){_0x125d73=path['join'](_0x125d73,_0x61f2('0x5d'));}var _0x172851=path['join'](_0x125d73,_0xef639[_0x61f2('0x5e')]);return _0x1d30c2[_0x61f2('0x5f')](_0x172851);}})[_0x61f2('0x46')](handleError(_0x1d30c2,null));}; \ No newline at end of file +var _0xa191=['length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','fields','find','clone','get','omit','createdAt','updatedAt','body','create','destroy','originalname','file','filename','mimetype','download','ChatOfflineMessageId','join','root','eml-format','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','Attachment','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes'];(function(_0x82afaa,_0x51e825){var _0x2efad1=function(_0x34e33f){while(--_0x34e33f){_0x82afaa['push'](_0x82afaa['shift']());}};_0x2efad1(++_0x51e825);}(_0xa191,0x78));var _0x1a19=function(_0x2a1d90,_0x1362b9){_0x2a1d90=_0x2a1d90-0x0;var _0x161d04=_0xa191[_0x2a1d90];return _0x161d04;};'use strict';var emlformat=require(_0x1a19('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1a19('0x1'));var jsonpatch=require(_0x1a19('0x2'));var rp=require('request-promise');var moment=require(_0x1a19('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1a19('0x4'));var path=require(_0x1a19('0x5'));var sox=require(_0x1a19('0x6'));var csv=require(_0x1a19('0x7'));var ejs=require(_0x1a19('0x8'));var fs=require('fs');var fs_extra=require(_0x1a19('0x9'));var _=require('lodash');var squel=require(_0x1a19('0xa'));var crypto=require(_0x1a19('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x1a19('0xc'));var toCsv=require(_0x1a19('0x7'));var querystring=require(_0x1a19('0xd'));var Papa=require(_0x1a19('0xe'));var Redis=require(_0x1a19('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1a19('0x10'));var as=require(_0x1a19('0x11'));var hardwareService=require(_0x1a19('0x12'));var logger=require(_0x1a19('0x13'))(_0x1a19('0x14'));var utils=require(_0x1a19('0x15'));var config=require(_0x1a19('0x16'));var licenseUtil=require(_0x1a19('0x17'));var db=require(_0x1a19('0x18'))['db'];function respondWithStatusCode(_0x569211,_0x227e78){_0x227e78=_0x227e78||0xcc;return function(_0x1e79af){if(_0x1e79af){return _0x569211[_0x1a19('0x19')](_0x227e78);}return _0x569211[_0x1a19('0x1a')](_0x227e78)[_0x1a19('0x1b')]();};}function respondWithResult(_0x37898f,_0x20dc3d){_0x20dc3d=_0x20dc3d||0xc8;return function(_0x101d5c){if(_0x101d5c){return _0x37898f['status'](_0x20dc3d)[_0x1a19('0x1c')](_0x101d5c);}};}function respondWithFilteredResult(_0x1b8a72,_0x520425){return function(_0x5119f0){if(_0x5119f0){var _0x27d561=typeof _0x520425[_0x1a19('0x1d')]===_0x1a19('0x1e')&&typeof _0x520425[_0x1a19('0x1f')]===_0x1a19('0x1e');var _0x47f474=_0x5119f0[_0x1a19('0x20')];var _0x23fe9d=_0x27d561?0x0:_0x520425[_0x1a19('0x1d')];var _0x9db855=_0x27d561?_0x5119f0[_0x1a19('0x20')]:_0x520425['offset']+_0x520425['limit'];var _0x867cbe;if(_0x9db855>=_0x47f474){_0x9db855=_0x47f474;_0x867cbe=0xc8;}else{_0x867cbe=0xce;}_0x1b8a72['status'](_0x867cbe);return _0x1b8a72['set'](_0x1a19('0x21'),_0x23fe9d+'-'+_0x9db855+'/'+_0x47f474)[_0x1a19('0x1c')](_0x5119f0);}return null;};}function patchUpdates(_0x20fa1a){return function(_0x337ee1){try{jsonpatch[_0x1a19('0x22')](_0x337ee1,_0x20fa1a,!![]);}catch(_0x1fcaea){return BPromise[_0x1a19('0x23')](_0x1fcaea);}return _0x337ee1[_0x1a19('0x24')]();};}function saveUpdates(_0x1ae91a,_0x3d648e){return function(_0x5eb1b5){if(_0x5eb1b5){return _0x5eb1b5[_0x1a19('0x25')](_0x1ae91a)[_0x1a19('0x26')](function(_0xaee038){return _0xaee038;});}return null;};}function removeEntity(_0x2cf830,_0x48bf7f){return function(_0x5e292c){if(_0x5e292c){return _0x5e292c['destroy']()['then'](function(){_0x2cf830[_0x1a19('0x1a')](0xcc)[_0x1a19('0x1b')]();});}};}function handleEntityNotFound(_0x5de603,_0x385665){return function(_0x482c3b){if(!_0x482c3b){_0x5de603['sendStatus'](0x194);}return _0x482c3b;};}function handleError(_0x43a4e1,_0xa6c95b){_0xa6c95b=_0xa6c95b||0x1f4;return function(_0x71abe3){logger[_0x1a19('0x27')](_0x71abe3[_0x1a19('0x28')]);if(_0x71abe3[_0x1a19('0x29')]){delete _0x71abe3[_0x1a19('0x29')];}_0x43a4e1[_0x1a19('0x1a')](_0xa6c95b)['send'](_0x71abe3);};}exports[_0x1a19('0x2a')]=function(_0x3ebdc6,_0x1c8ca9){var _0x49aef4={},_0x4190e9={},_0x11af4c={'count':0x0,'rows':[]};var _0x39c834=_[_0x1a19('0x2b')](db[_0x1a19('0x2c')][_0x1a19('0x2d')],function(_0x40c895){return{'name':_0x40c895[_0x1a19('0x2e')],'type':_0x40c895[_0x1a19('0x2f')][_0x1a19('0x30')]};});_0x4190e9[_0x1a19('0x31')]=_[_0x1a19('0x2b')](_0x39c834,_0x1a19('0x29'));_0x4190e9['query']=_[_0x1a19('0x32')](_0x3ebdc6[_0x1a19('0x33')]);_0x4190e9['filters']=_['intersection'](_0x4190e9['model'],_0x4190e9['query']);_0x49aef4['attributes']=_[_0x1a19('0x34')](_0x4190e9[_0x1a19('0x31')],qs['fields'](_0x3ebdc6[_0x1a19('0x33')]['fields']));_0x49aef4[_0x1a19('0x35')]=_0x49aef4[_0x1a19('0x35')][_0x1a19('0x36')]?_0x49aef4['attributes']:_0x4190e9['model'];if(!_0x3ebdc6['query'][_0x1a19('0x37')](_0x1a19('0x38'))){_0x49aef4['limit']=qs[_0x1a19('0x1f')](_0x3ebdc6[_0x1a19('0x33')][_0x1a19('0x1f')]);_0x49aef4[_0x1a19('0x1d')]=qs[_0x1a19('0x1d')](_0x3ebdc6[_0x1a19('0x33')][_0x1a19('0x1d')]);}_0x49aef4['order']=qs['sort'](_0x3ebdc6[_0x1a19('0x33')][_0x1a19('0x39')]);_0x49aef4[_0x1a19('0x3a')]=qs[_0x1a19('0x3b')](_['pick'](_0x3ebdc6[_0x1a19('0x33')],_0x4190e9[_0x1a19('0x3b')]),_0x39c834);if(_0x3ebdc6[_0x1a19('0x33')][_0x1a19('0x3c')]){_0x49aef4['where']=_[_0x1a19('0x3d')](_0x49aef4[_0x1a19('0x3a')],{'$or':_[_0x1a19('0x2b')](_0x39c834,function(_0x6495e){if(_0x6495e[_0x1a19('0x2f')]!==_0x1a19('0x3e')){var _0x166d96={};_0x166d96[_0x6495e['name']]={'$like':'%'+_0x3ebdc6['query'][_0x1a19('0x3c')]+'%'};return _0x166d96;}})});}_0x49aef4=_[_0x1a19('0x3d')]({},_0x49aef4,_0x3ebdc6[_0x1a19('0x3f')]);var _0x8c00ed={'where':_0x49aef4[_0x1a19('0x3a')]};return db[_0x1a19('0x2c')]['count'](_0x8c00ed)[_0x1a19('0x26')](function(_0x36e57b){_0x11af4c[_0x1a19('0x20')]=_0x36e57b;if(_0x3ebdc6[_0x1a19('0x33')][_0x1a19('0x40')]){_0x49aef4[_0x1a19('0x41')]=[{'all':!![]}];}return db[_0x1a19('0x2c')]['findAll'](_0x49aef4);})['then'](function(_0x4891e4){_0x11af4c[_0x1a19('0x42')]=_0x4891e4;return _0x11af4c;})[_0x1a19('0x26')](respondWithFilteredResult(_0x1c8ca9,_0x49aef4))[_0x1a19('0x43')](handleError(_0x1c8ca9,null));};exports['show']=function(_0x50102f,_0x1e7fdd){var _0x419d4c={'raw':!![],'where':{'id':_0x50102f[_0x1a19('0x44')]['id']}},_0x36eb53={};_0x36eb53[_0x1a19('0x31')]=_[_0x1a19('0x32')](db[_0x1a19('0x2c')][_0x1a19('0x2d')]);_0x36eb53['query']=_[_0x1a19('0x32')](_0x50102f[_0x1a19('0x33')]);_0x36eb53['filters']=_[_0x1a19('0x34')](_0x36eb53[_0x1a19('0x31')],_0x36eb53['query']);_0x419d4c[_0x1a19('0x35')]=_['intersection'](_0x36eb53['model'],qs['fields'](_0x50102f[_0x1a19('0x33')][_0x1a19('0x45')]));_0x419d4c[_0x1a19('0x35')]=_0x419d4c['attributes'][_0x1a19('0x36')]?_0x419d4c[_0x1a19('0x35')]:_0x36eb53[_0x1a19('0x31')];if(_0x50102f[_0x1a19('0x33')][_0x1a19('0x40')]){_0x419d4c[_0x1a19('0x41')]=[{'all':!![]}];}_0x419d4c=_[_0x1a19('0x3d')]({},_0x419d4c,_0x50102f[_0x1a19('0x3f')]);return db[_0x1a19('0x2c')][_0x1a19('0x46')](_0x419d4c)['then'](handleEntityNotFound(_0x1e7fdd,null))[_0x1a19('0x26')](respondWithResult(_0x1e7fdd,null))['catch'](handleError(_0x1e7fdd,null));};exports[_0x1a19('0x47')]=function(_0x3ebbc8,_0x83807f){var _0x22d3c2={'where':{'id':_0x3ebbc8[_0x1a19('0x44')]['id']}},_0x453c09={};_0x453c09[_0x1a19('0x31')]=_[_0x1a19('0x32')](db[_0x1a19('0x2c')]['rawAttributes']);_0x22d3c2[_0x1a19('0x35')]=_[_0x1a19('0x34')](_0x453c09['model'],qs[_0x1a19('0x45')](_0x3ebbc8[_0x1a19('0x33')][_0x1a19('0x45')]));_0x22d3c2['attributes']=_0x22d3c2['attributes']['length']?_0x22d3c2['attributes']:_0x453c09[_0x1a19('0x31')];if(_0x3ebbc8[_0x1a19('0x33')][_0x1a19('0x40')]){_0x22d3c2['include']=[{'all':!![]}];}_0x22d3c2=_[_0x1a19('0x3d')]({},_0x22d3c2,_0x3ebbc8[_0x1a19('0x3f')]);return db[_0x1a19('0x2c')][_0x1a19('0x46')](_0x22d3c2)[_0x1a19('0x26')](handleEntityNotFound(_0x83807f,null))[_0x1a19('0x26')](function(_0x4c1cea){if(_0x4c1cea){var _0x529aaf=_0x4c1cea[_0x1a19('0x48')]({'plain':!![]});_0x529aaf=qs[_0x1a19('0x49')](_0x529aaf,['id',_0x1a19('0x4a'),_0x1a19('0x4b')]);_0x3ebbc8[_0x1a19('0x4c')]=_[_0x1a19('0x49')](_0x3ebbc8[_0x1a19('0x4c')],['id',_0x1a19('0x4a'),_0x1a19('0x4b')]);return db['Attachment'][_0x1a19('0x4d')](_['merge'](_0x529aaf,_0x3ebbc8[_0x1a19('0x4c')]),{'include':_0x3ebbc8[_0x1a19('0x33')][_0x1a19('0x40')]?[{'all':!![]}]:undefined});}})[_0x1a19('0x26')](respondWithResult(_0x83807f,0xc9))[_0x1a19('0x43')](handleError(_0x83807f,null));};exports[_0x1a19('0x25')]=function(_0x187203,_0x546e4c){if(_0x187203[_0x1a19('0x4c')]['id']){delete _0x187203[_0x1a19('0x4c')]['id'];}return db['Attachment'][_0x1a19('0x46')]({'where':{'id':_0x187203[_0x1a19('0x44')]['id']}})[_0x1a19('0x26')](handleEntityNotFound(_0x546e4c,null))[_0x1a19('0x26')](saveUpdates(_0x187203[_0x1a19('0x4c')],null))['then'](respondWithResult(_0x546e4c,null))[_0x1a19('0x43')](handleError(_0x546e4c,null));};exports[_0x1a19('0x4e')]=function(_0x4a93dc,_0x544d9d){return db[_0x1a19('0x2c')][_0x1a19('0x46')]({'where':{'id':_0x4a93dc['params']['id']}})[_0x1a19('0x26')](handleEntityNotFound(_0x544d9d,null))[_0x1a19('0x26')](removeEntity(_0x544d9d,null))[_0x1a19('0x43')](handleError(_0x544d9d,null));};exports[_0x1a19('0x4d')]=function(_0x57ca2c,_0x19240f,_0x351e65){_0x57ca2c['body'][_0x1a19('0x29')]=_0x57ca2c['file'][_0x1a19('0x4f')];_0x57ca2c['body']['basename']=_0x57ca2c[_0x1a19('0x50')][_0x1a19('0x51')];_0x57ca2c[_0x1a19('0x4c')]['type']=_0x57ca2c[_0x1a19('0x50')][_0x1a19('0x52')];return db[_0x1a19('0x2c')][_0x1a19('0x4d')](_0x57ca2c[_0x1a19('0x4c')])[_0x1a19('0x26')](respondWithResult(_0x19240f,0xc9))[_0x1a19('0x43')](handleError(_0x19240f,null));};exports[_0x1a19('0x53')]=function(_0x1fda45,_0x271b12,_0x30ef0b){return db[_0x1a19('0x2c')]['findOne']({'where':{'id':_0x1fda45[_0x1a19('0x44')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x271b12,null))[_0x1a19('0x26')](function(_0x1d396a){if(_0x1d396a){var _0x8696cf=_0x1d396a[_0x1a19('0x54')]!==null;var _0x53bfb3=path[_0x1a19('0x55')](config[_0x1a19('0x56')],'server/files/attachments/');if(_0x8696cf){_0x53bfb3=path['join'](_0x53bfb3,'offline-chat/');}var _0x28436a=path[_0x1a19('0x55')](_0x53bfb3,_0x1d396a['basename']);return _0x271b12['download'](_0x28436a);}})[_0x1a19('0x43')](handleError(_0x271b12,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index e18d4b1..b01ffc5 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 _0xfbd4=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','Attachment','attachments'];(function(_0x2d3841,_0xa88cc7){var _0x24457e=function(_0x50d756){while(--_0x50d756){_0x2d3841['push'](_0x2d3841['shift']());}};_0x24457e(++_0xa88cc7);}(_0xfbd4,0x179));var _0x4fbd=function(_0x4f84fe,_0xf35373){_0x4f84fe=_0x4f84fe-0x0;var _0x577dab=_0xfbd4[_0x4f84fe];return _0x577dab;};'use strict';var _=require(_0x4fbd('0x0'));var util=require(_0x4fbd('0x1'));var logger=require(_0x4fbd('0x2'))(_0x4fbd('0x3'));var moment=require(_0x4fbd('0x4'));var BPromise=require('bluebird');var rp=require(_0x4fbd('0x5'));var fs=require('fs');var path=require(_0x4fbd('0x6'));var rimraf=require(_0x4fbd('0x7'));var config=require(_0x4fbd('0x8'));var attributes=require('./attachment.attributes');module[_0x4fbd('0x9')]=function(_0x43f48e,_0x302035){return _0x43f48e[_0x4fbd('0xa')](_0x4fbd('0xb'),attributes,{'tableName':_0x4fbd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0d10=['api','moment','request-promise','path','rimraf','./attachment.attributes','exports','Attachment','attachments','lodash','util','../../config/logger'];(function(_0x8a565b,_0x49df9f){var _0x231c1d=function(_0x1e51c8){while(--_0x1e51c8){_0x8a565b['push'](_0x8a565b['shift']());}};_0x231c1d(++_0x49df9f);}(_0x0d10,0x11d));var _0x00d1=function(_0x441563,_0x1d4a28){_0x441563=_0x441563-0x0;var _0x2369ec=_0x0d10[_0x441563];return _0x2369ec;};'use strict';var _=require(_0x00d1('0x0'));var util=require(_0x00d1('0x1'));var logger=require(_0x00d1('0x2'))(_0x00d1('0x3'));var moment=require(_0x00d1('0x4'));var BPromise=require('bluebird');var rp=require(_0x00d1('0x5'));var fs=require('fs');var path=require(_0x00d1('0x6'));var rimraf=require(_0x00d1('0x7'));var config=require('../../config/environment');var attributes=require(_0x00d1('0x8'));module[_0x00d1('0x9')]=function(_0x337e77,_0x367849){return _0x337e77['define'](_0x00d1('0xa'),attributes,{'tableName':_0x00d1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index c056294..ff5e6cb 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 _0x34b2=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateAttachment','Attachment','create','body','options','raw','then','lodash','util','moment','bluebird'];(function(_0x3f4358,_0x4ecc25){var _0xb7a0ea=function(_0x2d3c72){while(--_0x2d3c72){_0x3f4358['push'](_0x3f4358['shift']());}};_0xb7a0ea(++_0x4ecc25);}(_0x34b2,0x11c));var _0x234b=function(_0x36aad0,_0x3d2e17){_0x36aad0=_0x36aad0-0x0;var _0x31e987=_0x34b2[_0x36aad0];return _0x31e987;};'use strict';var _=require(_0x234b('0x0'));var util=require(_0x234b('0x1'));var moment=require(_0x234b('0x2'));var BPromise=require(_0x234b('0x3'));var rs=require(_0x234b('0x4'));var fs=require('fs');var Redis=require(_0x234b('0x5'));var db=require(_0x234b('0x6'))['db'];var utils=require(_0x234b('0x7'));var logger=require(_0x234b('0x8'))(_0x234b('0x9'));var config=require(_0x234b('0xa'));var jayson=require(_0x234b('0xb'));var client=jayson[_0x234b('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52fac7,_0x5e71ac,_0x2eb07e){return new BPromise(function(_0x84f1f0,_0x153974){return client[_0x234b('0xd')](_0x52fac7,_0x2eb07e)['then'](function(_0x4f4899){logger[_0x234b('0xe')](_0x234b('0xf'),_0x5e71ac,_0x234b('0x10'));logger[_0x234b('0x11')](_0x234b('0x12'),_0x5e71ac,_0x234b('0x10'),JSON[_0x234b('0x13')](_0x4f4899));if(_0x4f4899[_0x234b('0x14')]){if(_0x4f4899[_0x234b('0x14')][_0x234b('0x15')]===0x1f4){logger[_0x234b('0x14')](_0x234b('0xf'),_0x5e71ac,_0x4f4899[_0x234b('0x14')]['message']);return _0x153974(_0x4f4899[_0x234b('0x14')][_0x234b('0x16')]);}logger['error'](_0x234b('0xf'),_0x5e71ac,_0x4f4899[_0x234b('0x14')]['message']);return _0x84f1f0(_0x4f4899[_0x234b('0x14')][_0x234b('0x16')]);}else{logger[_0x234b('0xe')](_0x234b('0xf'),_0x5e71ac,_0x234b('0x10'));_0x84f1f0(_0x4f4899[_0x234b('0x17')][_0x234b('0x16')]);}})[_0x234b('0x18')](function(_0x1fb3d8){logger['error'](_0x234b('0xf'),_0x5e71ac,_0x1fb3d8);_0x153974(_0x1fb3d8);});});}exports[_0x234b('0x19')]=function(_0x18153a){var _0x22696d=this;return new Promise(function(_0x4424a1,_0x530e4a){return db[_0x234b('0x1a')][_0x234b('0x1b')](_0x18153a[_0x234b('0x1c')],{'raw':_0x18153a[_0x234b('0x1d')]?_0x18153a['options'][_0x234b('0x1e')]===undefined?!![]:![]:!![]})[_0x234b('0x1f')](function(_0x2a47e1){logger[_0x234b('0xe')](_0x234b('0x19'),_0x18153a);logger['debug'](_0x234b('0x19'),_0x18153a,JSON[_0x234b('0x13')](_0x2a47e1));_0x4424a1(_0x2a47e1);})['catch'](function(_0x184e98){logger[_0x234b('0x14')](_0x234b('0x19'),_0x184e98[_0x234b('0x16')],_0x18153a);_0x530e4a(_0x22696d[_0x234b('0x14')](0x1f4,_0x184e98[_0x234b('0x16')]));});});}; \ No newline at end of file +var _0xb0b9=['CreateAttachment','create','body','options','raw','debug','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x37d09c,_0x3e5e2a){var _0x539d51=function(_0x3e7b62){while(--_0x3e7b62){_0x37d09c['push'](_0x37d09c['shift']());}};_0x539d51(++_0x3e5e2a);}(_0xb0b9,0x1f3));var _0x9b0b=function(_0x5d5ce4,_0x5a5430){_0x5d5ce4=_0x5d5ce4-0x0;var _0x4fa3f6=_0xb0b9[_0x5d5ce4];return _0x4fa3f6;};'use strict';var _=require(_0x9b0b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9b0b('0x1'));var rs=require(_0x9b0b('0x2'));var fs=require('fs');var Redis=require(_0x9b0b('0x3'));var db=require(_0x9b0b('0x4'))['db'];var utils=require(_0x9b0b('0x5'));var logger=require(_0x9b0b('0x6'))(_0x9b0b('0x7'));var config=require(_0x9b0b('0x8'));var jayson=require(_0x9b0b('0x9'));var client=jayson[_0x9b0b('0xa')][_0x9b0b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x157d81,_0x21ccdd,_0x1feca7){return new BPromise(function(_0x4894ae,_0x537d6e){return client[_0x9b0b('0xc')](_0x157d81,_0x1feca7)[_0x9b0b('0xd')](function(_0x22e8bd){logger[_0x9b0b('0xe')](_0x9b0b('0xf'),_0x21ccdd,_0x9b0b('0x10'));logger['debug'](_0x9b0b('0x11'),_0x21ccdd,_0x9b0b('0x10'),JSON[_0x9b0b('0x12')](_0x22e8bd));if(_0x22e8bd[_0x9b0b('0x13')]){if(_0x22e8bd['error']['code']===0x1f4){logger[_0x9b0b('0x13')]('Attachment,\x20%s,\x20%s',_0x21ccdd,_0x22e8bd[_0x9b0b('0x13')]['message']);return _0x537d6e(_0x22e8bd[_0x9b0b('0x13')][_0x9b0b('0x14')]);}logger['error']('Attachment,\x20%s,\x20%s',_0x21ccdd,_0x22e8bd[_0x9b0b('0x13')][_0x9b0b('0x14')]);return _0x4894ae(_0x22e8bd[_0x9b0b('0x13')]['message']);}else{logger[_0x9b0b('0xe')](_0x9b0b('0xf'),_0x21ccdd,_0x9b0b('0x10'));_0x4894ae(_0x22e8bd[_0x9b0b('0x15')][_0x9b0b('0x14')]);}})[_0x9b0b('0x16')](function(_0x8ed071){logger[_0x9b0b('0x13')](_0x9b0b('0xf'),_0x21ccdd,_0x8ed071);_0x537d6e(_0x8ed071);});});}exports[_0x9b0b('0x17')]=function(_0x264b6d){var _0x3f2733=this;return new Promise(function(_0x3334e5,_0x24c230){return db['Attachment'][_0x9b0b('0x18')](_0x264b6d[_0x9b0b('0x19')],{'raw':_0x264b6d[_0x9b0b('0x1a')]?_0x264b6d['options'][_0x9b0b('0x1b')]===undefined?!![]:![]:!![]})[_0x9b0b('0xd')](function(_0x4067d3){logger['info'](_0x9b0b('0x17'),_0x264b6d);logger[_0x9b0b('0x1c')](_0x9b0b('0x17'),_0x264b6d,JSON[_0x9b0b('0x12')](_0x4067d3));_0x3334e5(_0x4067d3);})['catch'](function(_0x30bfe8){logger[_0x9b0b('0x13')]('CreateAttachment',_0x30bfe8[_0x9b0b('0x14')],_0x264b6d);_0x24c230(_0x3f2733[_0x9b0b('0x13')](0x1f4,_0x30bfe8[_0x9b0b('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 75bac43..0382e7f 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 _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x0b0e,0x187));var _0xe0b0=function(_0x58db4e,_0x439d8d){_0x58db4e=_0x58db4e-0x0;var _0x40139a=_0x0b0e[_0x58db4e];return _0x40139a;};'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('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x1f9f5f,_0x509fb7){var _0x51d649=function(_0x4a5285){while(--_0x4a5285){_0x1f9f5f['push'](_0x1f9f5f['shift']());}};_0x51d649(++_0x509fb7);}(_0x5f66,0x1a0));var _0x65f6=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x5f66[_0x164eca];return _0x2ce562;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 4845ccd..cda7d8c 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 _0xe921=['undefined','baseDN','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','role','blocked','blockedAt','user','agent','name','disabled','getLicense','catch','send','login','ad-login','signToken','json','online','use','passport','bluebird','util','../../components/auth/service','../../config/utils','../../config/logger','api','activedirectory'];(function(_0x1c6eea,_0x19a204){var _0x19e1a1=function(_0x24e50a){while(--_0x24e50a){_0x1c6eea['push'](_0x1c6eea['shift']());}};_0x19e1a1(++_0x19a204);}(_0xe921,0x1f3));var _0x1e92=function(_0x3dee08,_0x196ccf){_0x3dee08=_0x3dee08-0x0;var _0x425419=_0xe921[_0x3dee08];return _0x425419;};'use strict';var passport=require(_0x1e92('0x0'));var LocalStrategy=require('passport-local')['Strategy'];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x1e92('0x1'));var util=require(_0x1e92('0x2'));var db=require('../../mysqldb')['db'];var authService=require(_0x1e92('0x3'));var utils=require(_0x1e92('0x4'));var config=require('../../config/environment');var logger=require(_0x1e92('0x5'))(_0x1e92('0x6'));function isActiveDirectoryConfigured(_0x48aed8){var _0x542050=![];if(typeof _0x48aed8[_0x1e92('0x7')]!==_0x1e92('0x8')){_0x542050=_0x48aed8['activedirectory'][_0x1e92('0x9')]&&_0x48aed8[_0x1e92('0x7')]['url']&&_0x48aed8['activedirectory'][_0x1e92('0xa')];}return _0x542050;}function adAuthenticate(_0x1b5d35,_0x259f9a,_0x2a7779){return new BPromise(function(_0x3678da,_0x574fb1){try{var _0x4e53f6=new ActiveDirectory(_0x1b5d35);_0x4e53f6[_0x1e92('0xb')](_0x259f9a,_0x2a7779,function(_0x4fcb9c,_0x12425d){if(_0x4fcb9c){logger[_0x1e92('0xc')](_0x1e92('0xd'),_0x259f9a,util[_0x1e92('0xe')](_0x4fcb9c,{'showHidden':![],'depth':null}));_0x574fb1(_0x1e92('0xf'));}else if(!_0x12425d){logger[_0x1e92('0xc')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x259f9a);_0x574fb1(_0x1e92('0xf'));}else{_0x3678da(_0x12425d);}});}catch(_0x3ee692){_0x574fb1(_0x3ee692);}});}function ActiveDirectoryAuthenticate(_0x5c3512,_0x22d9ce,_0x1fd480,_0x144f30){var _0x3de9ec,_0x406c27;if(!isActiveDirectoryConfigured(config)){logger[_0x1e92('0xc')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x22d9ce);return _0x144f30(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x1e92('0x10')][_0x1e92('0x11')]({'where':{'id':0x1},'attributes':[_0x1e92('0x12'),_0x1e92('0x13')],'raw':!![]})[_0x1e92('0x14')](function(_0x25f6ac){_0x3de9ec=_0x25f6ac;if(!_0x3de9ec[_0x1e92('0x12')]){logger[_0x1e92('0xc')](_0x1e92('0x15'),_0x22d9ce);throw new Error(_0x1e92('0xf'));}return _0x5c3512[_0x1e92('0x11')]({'attributes':['id','name',_0x1e92('0x16'),'salt',_0x1e92('0x17'),'disabled',_0x1e92('0x18'),_0x1e92('0x19'),'online'],'where':{'name':_0x22d9ce,'role':{'$or':['admin',_0x1e92('0x1a'),_0x1e92('0x1b')]},'adSsoEnabled':!![]}});})[_0x1e92('0x14')](function(_0x16b10b){if(!_0x16b10b||_0x16b10b&&_0x16b10b[_0x1e92('0x1c')]!==_0x22d9ce){throw new Error(_0x1e92('0xf'));}_0x406c27=_0x16b10b;var _0x4612ff=_0x406c27[_0x1e92('0x1c')]+'@'+config[_0x1e92('0x7')][_0x1e92('0xa')];return adAuthenticate(config[_0x1e92('0x7')],_0x4612ff,_0x1fd480);})['then'](function(_0x228075){if(_0x406c27[_0x1e92('0x1d')]){throw new Error(_0x1e92('0xf'));}if(_0x3de9ec['blockDuration']>0x0){if(_0x406c27[_0x1e92('0x18')]){if(moment(_0x406c27[_0x1e92('0x19')])['add'](_0x3de9ec[_0x1e92('0x13')],'minutes')>moment()){throw new Error(_0x1e92('0xf'));}return utils['clearBlockUser'](_0x406c27,0x0,![],null)[_0x1e92('0x14')](function(){return utils[_0x1e92('0x1e')](_0x406c27);})[_0x1e92('0x14')](function(){return _0x144f30(null,_0x406c27);});}else{return utils[_0x1e92('0x1e')](_0x406c27)[_0x1e92('0x14')](function(){return _0x144f30(null,_0x406c27);});}}else{return utils[_0x1e92('0x1e')](_0x406c27)[_0x1e92('0x14')](function(){return _0x144f30(null,_0x406c27);});}})[_0x1e92('0x1f')](function(_0x374cb5){return _0x144f30(null,![],_0x374cb5);});}function handleError(_0x26a947,_0x18c4b8,_0x260a6b){return _0x26a947['status'](_0x18c4b8||0x1f4)[_0x1e92('0x20')]({'message':_0x260a6b?_0x260a6b['message']||_0x260a6b:''});}exports[_0x1e92('0x21')]=function(_0x58c62e,_0x1cb1d6,_0x67a140){passport[_0x1e92('0xb')](_0x1e92('0x22'),function(_0x36edce,_0x5c3b45,_0x2a8bb2){var _0x440a53=_0x36edce||_0x2a8bb2;if(_0x440a53){return handleError(_0x1cb1d6,0x191,_0x440a53);}if(!_0x5c3b45){return handleError(_0x1cb1d6,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x40e264={'payload':{'id':_0x5c3b45['id'],'role':_0x5c3b45['role']},'options':{'expiresIn':0x15180}};return authService[_0x1e92('0x23')](_0x40e264)['then'](function(_0x2d8360){_0x1cb1d6[_0x1e92('0x24')]({'id':_0x5c3b45['id'],'token':_0x2d8360,'statusCall':'','isAlreadyLogged':_0x5c3b45[_0x1e92('0x25')]});});}})(_0x58c62e,_0x1cb1d6,_0x67a140);};passport[_0x1e92('0x26')](_0x1e92('0x22'),new LocalStrategy({'usernameField':'name','passwordField':_0x1e92('0x16')},function(_0x38bb83,_0x1b205b,_0x59a119){return ActiveDirectoryAuthenticate(db['User'],_0x38bb83,_0x1b205b,_0x59a119);})); \ No newline at end of file +var _0x873e=['domain','blockDuration','add','minutes','clearBlockUser','getLicense','catch','send','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','passport','passport-local','Strategy','moment','activedirectory2','../../config/utils','../../config/environment','api','activedirectory','undefined','url','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','disabled','blocked','blockedAt','online','admin','user','agent'];(function(_0x4359fa,_0x4d5f23){var _0x3df26d=function(_0x6eafe1){while(--_0x6eafe1){_0x4359fa['push'](_0x4359fa['shift']());}};_0x3df26d(++_0x4d5f23);}(_0x873e,0x141));var _0xe873=function(_0x285281,_0x15076c){_0x285281=_0x285281-0x0;var _0x1ff051=_0x873e[_0x285281];return _0x1ff051;};'use strict';var passport=require(_0xe873('0x0'));var LocalStrategy=require(_0xe873('0x1'))[_0xe873('0x2')];var moment=require(_0xe873('0x3'));var ActiveDirectory=require(_0xe873('0x4'));var BPromise=require('bluebird');var util=require('util');var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0xe873('0x5'));var config=require(_0xe873('0x6'));var logger=require('../../config/logger')(_0xe873('0x7'));function isActiveDirectoryConfigured(_0x3e461c){var _0x4e82f9=![];if(typeof _0x3e461c[_0xe873('0x8')]!==_0xe873('0x9')){_0x4e82f9=_0x3e461c[_0xe873('0x8')]['baseDN']&&_0x3e461c[_0xe873('0x8')][_0xe873('0xa')]&&_0x3e461c[_0xe873('0x8')]['domain'];}return _0x4e82f9;}function adAuthenticate(_0x2fe9b7,_0x285afb,_0x222e3b){return new BPromise(function(_0x39d31c,_0x35f8f3){try{var _0x34347d=new ActiveDirectory(_0x2fe9b7);_0x34347d[_0xe873('0xb')](_0x285afb,_0x222e3b,function(_0x15e571,_0x12b0a2){if(_0x15e571){logger[_0xe873('0xc')](_0xe873('0xd'),_0x285afb,util[_0xe873('0xe')](_0x15e571,{'showHidden':![],'depth':null}));_0x35f8f3(_0xe873('0xf'));}else if(!_0x12b0a2){logger[_0xe873('0xc')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x285afb);_0x35f8f3(_0xe873('0xf'));}else{_0x39d31c(_0x12b0a2);}});}catch(_0x3be0d6){_0x35f8f3(_0x3be0d6);}});}function ActiveDirectoryAuthenticate(_0x40408f,_0x46becb,_0x3a54f7,_0x4170bc){var _0x5865aa,_0x15f954;if(!isActiveDirectoryConfigured(config)){logger[_0xe873('0xc')](_0xe873('0x10'),_0x46becb);return _0x4170bc(null,![],{'message':_0xe873('0xf')});}return db[_0xe873('0x11')][_0xe873('0x12')]({'where':{'id':0x1},'attributes':[_0xe873('0x13'),'blockDuration'],'raw':!![]})[_0xe873('0x14')](function(_0x284338){_0x5865aa=_0x284338;if(!_0x5865aa[_0xe873('0x13')]){logger[_0xe873('0xc')](_0xe873('0x15'),_0x46becb);throw new Error(_0xe873('0xf'));}return _0x40408f[_0xe873('0x12')]({'attributes':['id',_0xe873('0x16'),_0xe873('0x17'),'salt','role',_0xe873('0x18'),_0xe873('0x19'),_0xe873('0x1a'),_0xe873('0x1b')],'where':{'name':_0x46becb,'role':{'$or':[_0xe873('0x1c'),_0xe873('0x1d'),_0xe873('0x1e')]},'adSsoEnabled':!![]}});})[_0xe873('0x14')](function(_0x2bf581){if(!_0x2bf581||_0x2bf581&&_0x2bf581[_0xe873('0x16')]!==_0x46becb){throw new Error(_0xe873('0xf'));}_0x15f954=_0x2bf581;var _0x2d68d0=_0x15f954[_0xe873('0x16')]+'@'+config[_0xe873('0x8')][_0xe873('0x1f')];return adAuthenticate(config[_0xe873('0x8')],_0x2d68d0,_0x3a54f7);})[_0xe873('0x14')](function(_0x538802){if(_0x15f954[_0xe873('0x18')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x5865aa[_0xe873('0x20')]>0x0){if(_0x15f954[_0xe873('0x19')]){if(moment(_0x15f954['blockedAt'])[_0xe873('0x21')](_0x5865aa['blockDuration'],_0xe873('0x22'))>moment()){throw new Error(_0xe873('0xf'));}return utils[_0xe873('0x23')](_0x15f954,0x0,![],null)[_0xe873('0x14')](function(){return utils[_0xe873('0x24')](_0x15f954);})[_0xe873('0x14')](function(){return _0x4170bc(null,_0x15f954);});}else{return utils['getLicense'](_0x15f954)[_0xe873('0x14')](function(){return _0x4170bc(null,_0x15f954);});}}else{return utils[_0xe873('0x24')](_0x15f954)['then'](function(){return _0x4170bc(null,_0x15f954);});}})[_0xe873('0x25')](function(_0x18d6a6){return _0x4170bc(null,![],_0x18d6a6);});}function handleError(_0x3998c3,_0x221d80,_0x27c181){return _0x3998c3['status'](_0x221d80||0x1f4)[_0xe873('0x26')]({'message':_0x27c181?_0x27c181['message']||_0x27c181:''});}exports['login']=function(_0x9ab5f8,_0x2658fd,_0x45908c){passport[_0xe873('0xb')](_0xe873('0x27'),function(_0xadaac7,_0x5d825e,_0x566b80){var _0xb5db18=_0xadaac7||_0x566b80;if(_0xb5db18){return handleError(_0x2658fd,0x191,_0xb5db18);}if(!_0x5d825e){return handleError(_0x2658fd,0x194,{'message':_0xe873('0x28')});}else{var _0x442505={'payload':{'id':_0x5d825e['id'],'role':_0x5d825e['role']},'options':{'expiresIn':0x15180}};return authService[_0xe873('0x29')](_0x442505)[_0xe873('0x14')](function(_0x328edd){_0x2658fd[_0xe873('0x2a')]({'id':_0x5d825e['id'],'token':_0x328edd,'statusCall':'','isAlreadyLogged':_0x5d825e[_0xe873('0x1b')]});});}})(_0x9ab5f8,_0x2658fd,_0x45908c);};passport[_0xe873('0x2b')]('ad-login',new LocalStrategy({'usernameField':_0xe873('0x16'),'passwordField':_0xe873('0x17')},function(_0x5d8c63,_0x5241e9,_0x1ce4bb){return ActiveDirectoryAuthenticate(db['User'],_0x5d8c63,_0x5241e9,_0x1ce4bb);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 3185fdb..89e751e 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 _0x677c=['login','exports','Router','./authActiveDirectory.controller','post'];(function(_0x2276b3,_0xc9912){var _0x52eebc=function(_0x4b6446){while(--_0x4b6446){_0x2276b3['push'](_0x2276b3['shift']());}};_0x52eebc(++_0xc9912);}(_0x677c,0x188));var _0xc677=function(_0x217981,_0x3dc5bb){_0x217981=_0x217981-0x0;var _0x83b4cf=_0x677c[_0x217981];return _0x83b4cf;};'use strict';var express=require('express');var router=express[_0xc677('0x0')]();var controller=require(_0xc677('0x1'));router[_0xc677('0x2')]('/',controller[_0xc677('0x3')]);module[_0xc677('0x4')]=router; \ No newline at end of file +var _0x5f7f=['./authActiveDirectory.controller','login','exports'];(function(_0x18d1c3,_0x62846b){var _0x2c00cb=function(_0x1e3b23){while(--_0x1e3b23){_0x18d1c3['push'](_0x18d1c3['shift']());}};_0x2c00cb(++_0x62846b);}(_0x5f7f,0xb7));var _0xf5f7=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x5f7f[_0x5ddb1c];return _0x354adc;};'use strict';var express=require('express');var router=express['Router']();var controller=require(_0xf5f7('0x0'));router['post']('/',controller[_0xf5f7('0x1')]);module[_0xf5f7('0x2')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 067ab6b..bfd518d 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(_0x45dd3f,_0x49ad9b){var _0x2a4a56=function(_0x3a2bcb){while(--_0x3a2bcb){_0x45dd3f['push'](_0x45dd3f['shift']());}};_0x2a4a56(++_0x49ad9b);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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(_0x177e62,_0x214260){var _0x5e0c13=function(_0xd45baa){while(--_0xd45baa){_0x177e62['push'](_0x177e62['shift']());}};_0x5e0c13(++_0x214260);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'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 6d934de..38632e0 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 _0x170d=['login','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','callback','isMiddleware'];(function(_0x1832fe,_0x2830dc){var _0x29e05f=function(_0x2cb186){while(--_0x2cb186){_0x1832fe['push'](_0x1832fe['shift']());}};_0x29e05f(++_0x2830dc);}(_0x170d,0x13b));var _0xd170=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x170d[_0x122ef9];return _0x42fba0;};'use strict';var express=require(_0xd170('0x0'));var passport=require(_0xd170('0x1'));var router=express[_0xd170('0x2')]();var controller=require(_0xd170('0x3'));var userController=require(_0xd170('0x4'));var authService=require(_0xd170('0x5'));router['get']('/',controller['login']);router[_0xd170('0x6')]('/callback',controller[_0xd170('0x7')],authService[_0xd170('0x8')],userController[_0xd170('0x9')],authService[_0xd170('0xa')]);module[_0xd170('0xb')]=router; \ No newline at end of file +var _0x08cf=['exports','express','passport','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie'];(function(_0x2ed4e2,_0x4578e9){var _0x41bf38=function(_0x410c78){while(--_0x410c78){_0x2ed4e2['push'](_0x2ed4e2['shift']());}};_0x41bf38(++_0x4578e9);}(_0x08cf,0x1ed));var _0xf08c=function(_0x4de1b1,_0x18c64c){_0x4de1b1=_0x4de1b1-0x0;var _0x639f27=_0x08cf[_0x4de1b1];return _0x639f27;};'use strict';var express=require(_0xf08c('0x0'));var passport=require(_0xf08c('0x1'));var router=express['Router']();var controller=require(_0xf08c('0x2'));var userController=require(_0xf08c('0x3'));var authService=require(_0xf08c('0x4'));router[_0xf08c('0x5')]('/',controller[_0xf08c('0x6')]);router[_0xf08c('0x5')](_0xf08c('0x7'),controller[_0xf08c('0x8')],authService[_0xf08c('0x9')],userController[_0xf08c('0x6')],authService[_0xf08c('0xa')]);module[_0xf08c('0xb')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index c03c3a4..73fef03 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 _0xba15=['../../components/auth/service','../../config/utils','client','http','Setting','findOne','blockDuration','then','password','salt','role','blockedAt','loginAttempts','admin','user','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','allowedLoginAttempts','blocked','add','clearBlockUser','minutes','getLicense','MailAccount','find','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','\x22%s\x22\x20<%s>','email','request','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','status','send','login','local-login','signToken','json','online','forgot','body','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','/reset/','reset','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','Password\x20reset!','catch','use','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment'];(function(_0x4e3040,_0x225dd0){var _0x25d609=function(_0x5b28f4){while(--_0x5b28f4){_0x4e3040['push'](_0x4e3040['shift']());}};_0x25d609(++_0x225dd0);}(_0xba15,0xf4));var _0x5ba1=function(_0xc6e937,_0x4447b2){_0xc6e937=_0xc6e937-0x0;var _0x38943b=_0xba15[_0xc6e937];return _0x38943b;};'use strict';var util=require(_0x5ba1('0x0'));var passport=require(_0x5ba1('0x1'));var LocalStrategy=require(_0x5ba1('0x2'))[_0x5ba1('0x3')];var jayson=require(_0x5ba1('0x4'));var _=require(_0x5ba1('0x5'));var rs=require(_0x5ba1('0x6'));var moment=require(_0x5ba1('0x7'));var db=require('../../mysqldb')['db'];var authService=require(_0x5ba1('0x8'));var utils=require(_0x5ba1('0x9'));var client=jayson[_0x5ba1('0xa')][_0x5ba1('0xb')]({'port':0x232b});function localAuthenticate(_0x3e8fcf,_0x3ef678,_0xcdc4a3,_0x43f5cb){var _0x4be6f2,_0x7e9364;return db[_0x5ba1('0xc')][_0x5ba1('0xd')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x5ba1('0xe')],'raw':!![]})[_0x5ba1('0xf')](function(_0x530ce9){_0x4be6f2=_0x530ce9;return _0x3e8fcf[_0x5ba1('0xd')]({'attributes':['id','name',_0x5ba1('0x10'),_0x5ba1('0x11'),_0x5ba1('0x12'),'disabled','blocked',_0x5ba1('0x13'),_0x5ba1('0x14')],'where':{'name':_0x3ef678,'role':{'$or':[_0x5ba1('0x15'),_0x5ba1('0x16'),_0x5ba1('0x17')]}}});})[_0x5ba1('0xf')](function(_0x17e09d){if(!_0x17e09d||_0x17e09d&&_0x17e09d[_0x5ba1('0x18')]!==_0x3ef678){throw new Error(_0x5ba1('0x19'));}else{_0x7e9364=_0x17e09d;return _0x7e9364;}})[_0x5ba1('0xf')](function(){_0x7e9364[_0x5ba1('0x1a')](_0xcdc4a3,function(_0x3a0b27,_0x18951b){var _0x40fade=_0x7e9364['loginAttempts']+0x1;if(_0x3a0b27){return _0x43f5cb(_0x3a0b27);}else if(!_0x18951b){if(_0x7e9364[_0x5ba1('0x1b')]){return _0x43f5cb(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x4be6f2[_0x5ba1('0x1c')]>0x0){if(_0x7e9364[_0x5ba1('0x1d')]){if(_0x4be6f2[_0x5ba1('0xe')]>0x0){if(moment(_0x7e9364[_0x5ba1('0x13')])[_0x5ba1('0x1e')](_0x4be6f2[_0x5ba1('0xe')],'minutes')>moment()){return _0x43f5cb(null,![],{'message':_0x5ba1('0x19')});}else{return utils[_0x5ba1('0x1f')](_0x7e9364,_0x40fade,![],null)[_0x5ba1('0xf')](function(){return _0x43f5cb(null,![],{'message':_0x5ba1('0x19')});});}}else{return _0x43f5cb(null,![],{'message':_0x5ba1('0x19')});}}else{if(_0x40fade>=_0x4be6f2[_0x5ba1('0x1c')]){return utils[_0x5ba1('0x1f')](_0x7e9364,0x0,!![],moment())[_0x5ba1('0xf')](function(){return _0x43f5cb(null,![],{'message':_0x5ba1('0x19')});});}else{return utils[_0x5ba1('0x1f')](_0x7e9364,_0x40fade,![],null)[_0x5ba1('0xf')](function(){return _0x43f5cb(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x43f5cb(null,![],{'message':_0x5ba1('0x19')});}}else{if(_0x7e9364['disabled']){return _0x43f5cb(null,![],{'message':_0x5ba1('0x19')});}else if(_0x4be6f2[_0x5ba1('0x1c')]>0x0){if(_0x7e9364[_0x5ba1('0x1d')]){if(_0x4be6f2['blockDuration']>0x0){if(moment(_0x7e9364[_0x5ba1('0x13')])['add'](_0x4be6f2[_0x5ba1('0xe')],_0x5ba1('0x20'))>moment()){return _0x43f5cb(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x5ba1('0x1f')](_0x7e9364,0x0,![],null)[_0x5ba1('0xf')](function(){return utils[_0x5ba1('0x21')](_0x7e9364);})['then'](function(){return _0x43f5cb(null,_0x7e9364);});}}else{return _0x43f5cb(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x5ba1('0x1f')](_0x7e9364,0x0,![],null)[_0x5ba1('0xf')](function(){return utils[_0x5ba1('0x21')](_0x7e9364);})[_0x5ba1('0xf')](function(){return _0x43f5cb(null,_0x7e9364);})['catch'](function(_0x8cf6bd){return _0x43f5cb(null,![],_0x8cf6bd);});}}else{if(_0x7e9364['blocked']){return _0x43f5cb(null,![],{'message':_0x5ba1('0x19')});}else{return utils[_0x5ba1('0x21')](_0x7e9364)['then'](function(){return _0x43f5cb(null,_0x7e9364);});}}}});})['catch'](function(_0x2dcb68){return _0x43f5cb(null,![],_0x2dcb68);});}function sendServiceMail(_0x8da511){return db[_0x5ba1('0x22')][_0x5ba1('0x23')]({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db[_0x5ba1('0x24')],'as':_0x5ba1('0x25'),'include':[{'model':db[_0x5ba1('0x26')],'as':_0x5ba1('0x26')}]}]})['then'](function(_0x15aa94){if(!_0x15aa94){throw new Error(_0x5ba1('0x27'));}var _0x8bdae6=_0x15aa94[_0x5ba1('0x28')]();var _0x4a37c0={'account':_0x8bdae6,'message':_[_0x5ba1('0x29')]({'from':util['format'](_0x5ba1('0x2a'),_0x15aa94[_0x5ba1('0x18')],_0x15aa94[_0x5ba1('0x2b')]||_0x15aa94[_0x5ba1('0x25')][_0x5ba1('0x16')])},_0x8da511)};return client[_0x5ba1('0x2c')](_0x5ba1('0x2d'),_0x4a37c0);})[_0x5ba1('0xf')](function(_0x2fb0ab){if(_0x2fb0ab['error']){throw new Error(util['format'](_0x5ba1('0x2e'),_0x2fb0ab[_0x5ba1('0x2f')][_0x5ba1('0x30')]||JSON[_0x5ba1('0x31')](_0x2fb0ab[_0x5ba1('0x2f')])));}return!![];});}function handleError(_0x45354c,_0x2081ec,_0x52ef60){return _0x45354c[_0x5ba1('0x32')](_0x2081ec||0x1f4)[_0x5ba1('0x33')]({'message':_0x52ef60?_0x52ef60[_0x5ba1('0x30')]||_0x52ef60:''});}exports[_0x5ba1('0x34')]=function(_0x656bbf,_0x950596,_0x312e84){passport[_0x5ba1('0x1a')](_0x5ba1('0x35'),function(_0x538967,_0x13f3ad,_0x18f092){var _0xe30ae4=_0x538967||_0x18f092;if(_0xe30ae4){return handleError(_0x950596,0x191,_0xe30ae4);}if(!_0x13f3ad){return handleError(_0x950596,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x13b5d9={'payload':{'id':_0x13f3ad['id'],'role':_0x13f3ad[_0x5ba1('0x12')]},'options':{'expiresIn':0x15180}};return authService[_0x5ba1('0x36')](_0x13b5d9)['then'](function(_0x1ce93d){_0x950596[_0x5ba1('0x37')]({'id':_0x13f3ad['id'],'token':_0x1ce93d,'statusCall':'','isAlreadyLogged':_0x13f3ad[_0x5ba1('0x38')]});});}})(_0x656bbf,_0x950596,_0x312e84);};exports[_0x5ba1('0x39')]=function(_0x5ad487,_0x6b9ba6){if(!_0x5ad487[_0x5ba1('0x3a')][_0x5ba1('0x2b')]){return handleError(_0x6b9ba6,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x275adc=rs[_0x5ba1('0x3b')]();_0x5ad487[_0x5ba1('0x3a')][_0x5ba1('0x2b')]=_0x5ad487[_0x5ba1('0x3a')][_0x5ba1('0x2b')][_0x5ba1('0x3c')]()[_0x5ba1('0x3d')]();var _0x21c906;return db[_0x5ba1('0xc')][_0x5ba1('0xd')]({'where':{'id':0x1},'attributes':[_0x5ba1('0x1c'),_0x5ba1('0xe')],'raw':!![]})['then'](function(_0x14e972){_0x21c906=_0x14e972;return db[_0x5ba1('0x3e')][_0x5ba1('0x23')]({'where':{'email':_0x5ad487[_0x5ba1('0x3a')][_0x5ba1('0x2b')]}});})[_0x5ba1('0xf')](function(_0x2924e9){if(!_0x2924e9){throw new Error(_0x5ba1('0x3f'));}if(_0x2924e9[_0x5ba1('0x1b')]){throw new Error(_0x5ba1('0x40'));}if(_0x2924e9[_0x5ba1('0x1d')]){if(moment(_0x2924e9[_0x5ba1('0x13')])[_0x5ba1('0x1e')](_0x21c906[_0x5ba1('0xe')],_0x5ba1('0x20'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x2924e9['blocked']=![];_0x2924e9[_0x5ba1('0x13')]=null;}}_0x2924e9[_0x5ba1('0x41')]=_0x275adc;_0x2924e9[_0x5ba1('0x42')]=Date[_0x5ba1('0x43')]()+0x36ee80;return _0x2924e9['save']();})[_0x5ba1('0xf')](function(){return sendServiceMail({'to':_0x5ad487[_0x5ba1('0x3a')][_0x5ba1('0x2b')],'subject':_0x5ba1('0x44'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x5ba1('0x45')+'https://'+_0x5ad487[_0x5ba1('0x46')]['host']+_0x5ba1('0x47')+_0x275adc+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x5ba1('0xf')](function(){_0x6b9ba6[_0x5ba1('0x32')](0xc8)[_0x5ba1('0x33')]({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x1dab81){return handleError(_0x6b9ba6,0x1f4,_0x1dab81);});};exports[_0x5ba1('0x48')]=function(_0xf0ebfc,_0x5cced1){return db[_0x5ba1('0x3e')][_0x5ba1('0x23')]({'where':{'resetPasswordToken':_0xf0ebfc[_0x5ba1('0x49')]['token'],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0x45bc62){if(!_0x45bc62){throw new Error(_0x5ba1('0x4a'));}return db['Setting'][_0x5ba1('0xd')]({'attributes':['id',_0x5ba1('0x4b'),_0x5ba1('0x4c'),_0x5ba1('0x4d')]})[_0x5ba1('0xf')](function(_0x2ab41b){if(_0x2ab41b[_0x5ba1('0x4b')])authService[_0x5ba1('0x4e')](_0xf0ebfc[_0x5ba1('0x3a')][_0x5ba1('0x10')]);if(!_0x2ab41b[_0x5ba1('0x4c')]||!_0x45bc62[_0x5ba1('0x4f')])return _0x45bc62;authService[_0x5ba1('0x50')](_0xf0ebfc[_0x5ba1('0x3a')][_0x5ba1('0x10')],_0x45bc62[_0x5ba1('0x4f')],_0x2ab41b['passwordHistoryLimit']);return _0x45bc62;})[_0x5ba1('0xf')](function(){_0x45bc62['password']=_0xf0ebfc['body'][_0x5ba1('0x10')];_0x45bc62['resetPasswordToken']=null;_0x45bc62[_0x5ba1('0x42')]=null;return _0x45bc62['save']();});})[_0x5ba1('0xf')](function(){_0x5cced1[_0x5ba1('0x32')](0xc8)[_0x5ba1('0x33')]({'message':_0x5ba1('0x51')});})[_0x5ba1('0x52')](function(_0x160f60){return handleError(_0x5cced1,0x1f4,_0x160f60);});};passport[_0x5ba1('0x53')]('local-login',new LocalStrategy({'usernameField':_0x5ba1('0x18'),'passwordField':_0x5ba1('0x10')},function(_0x2cae84,_0x1aa431,_0x2a0254){return localAuthenticate(db[_0x5ba1('0x3e')],_0x2cae84,_0x1aa431,_0x2a0254);})); \ No newline at end of file +var _0x2864=['role','disabled','blocked','blockedAt','loginAttempts','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','then','authenticate','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','Smtp','user','request','error','message','stringify','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','headers','host','/reset/','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','resetPasswordToken','save','use','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','http','Setting','findOne','allowedLoginAttempts','blockDuration','name','password','salt'];(function(_0x7267ad,_0x269191){var _0x2b4e35=function(_0x458050){while(--_0x458050){_0x7267ad['push'](_0x7267ad['shift']());}};_0x2b4e35(++_0x269191);}(_0x2864,0x12a));var _0x4286=function(_0x3bfd29,_0x407cd5){_0x3bfd29=_0x3bfd29-0x0;var _0x2e1a78=_0x2864[_0x3bfd29];return _0x2e1a78;};'use strict';var util=require(_0x4286('0x0'));var passport=require(_0x4286('0x1'));var LocalStrategy=require(_0x4286('0x2'))[_0x4286('0x3')];var jayson=require(_0x4286('0x4'));var _=require(_0x4286('0x5'));var rs=require(_0x4286('0x6'));var moment=require(_0x4286('0x7'));var db=require(_0x4286('0x8'))['db'];var authService=require(_0x4286('0x9'));var utils=require('../../config/utils');var client=jayson['client'][_0x4286('0xa')]({'port':0x232b});function localAuthenticate(_0x7d3791,_0x4ea1a3,_0x3df9bb,_0x23cd71){var _0x40bc33,_0x4683f8;return db[_0x4286('0xb')][_0x4286('0xc')]({'where':{'id':0x1},'attributes':[_0x4286('0xd'),_0x4286('0xe')],'raw':!![]})['then'](function(_0x579017){_0x40bc33=_0x579017;return _0x7d3791[_0x4286('0xc')]({'attributes':['id',_0x4286('0xf'),_0x4286('0x10'),_0x4286('0x11'),_0x4286('0x12'),_0x4286('0x13'),_0x4286('0x14'),_0x4286('0x15'),_0x4286('0x16')],'where':{'name':_0x4ea1a3,'role':{'$or':[_0x4286('0x17'),'user',_0x4286('0x18')]}}});})['then'](function(_0x11dc65){if(!_0x11dc65||_0x11dc65&&_0x11dc65[_0x4286('0xf')]!==_0x4ea1a3){throw new Error(_0x4286('0x19'));}else{_0x4683f8=_0x11dc65;return _0x4683f8;}})[_0x4286('0x1a')](function(){_0x4683f8[_0x4286('0x1b')](_0x3df9bb,function(_0xe853d4,_0x355706){var _0x123f96=_0x4683f8['loginAttempts']+0x1;if(_0xe853d4){return _0x23cd71(_0xe853d4);}else if(!_0x355706){if(_0x4683f8[_0x4286('0x13')]){return _0x23cd71(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x40bc33[_0x4286('0xd')]>0x0){if(_0x4683f8[_0x4286('0x14')]){if(_0x40bc33[_0x4286('0xe')]>0x0){if(moment(_0x4683f8['blockedAt'])[_0x4286('0x1c')](_0x40bc33[_0x4286('0xe')],_0x4286('0x1d'))>moment()){return _0x23cd71(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x4286('0x1e')](_0x4683f8,_0x123f96,![],null)[_0x4286('0x1a')](function(){return _0x23cd71(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x23cd71(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x123f96>=_0x40bc33[_0x4286('0xd')]){return utils[_0x4286('0x1e')](_0x4683f8,0x0,!![],moment())[_0x4286('0x1a')](function(){return _0x23cd71(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x4286('0x1e')](_0x4683f8,_0x123f96,![],null)[_0x4286('0x1a')](function(){return _0x23cd71(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x23cd71(null,![],{'message':_0x4286('0x19')});}}else{if(_0x4683f8[_0x4286('0x13')]){return _0x23cd71(null,![],{'message':_0x4286('0x19')});}else if(_0x40bc33[_0x4286('0xd')]>0x0){if(_0x4683f8[_0x4286('0x14')]){if(_0x40bc33['blockDuration']>0x0){if(moment(_0x4683f8['blockedAt'])[_0x4286('0x1c')](_0x40bc33[_0x4286('0xe')],_0x4286('0x1d'))>moment()){return _0x23cd71(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x4286('0x1e')](_0x4683f8,0x0,![],null)['then'](function(){return utils[_0x4286('0x1f')](_0x4683f8);})[_0x4286('0x1a')](function(){return _0x23cd71(null,_0x4683f8);});}}else{return _0x23cd71(null,![],{'message':_0x4286('0x19')});}}else{return utils[_0x4286('0x1e')](_0x4683f8,0x0,![],null)[_0x4286('0x1a')](function(){return utils[_0x4286('0x1f')](_0x4683f8);})[_0x4286('0x1a')](function(){return _0x23cd71(null,_0x4683f8);})[_0x4286('0x20')](function(_0x3e765c){return _0x23cd71(null,![],_0x3e765c);});}}else{if(_0x4683f8['blocked']){return _0x23cd71(null,![],{'message':_0x4286('0x19')});}else{return utils[_0x4286('0x1f')](_0x4683f8)[_0x4286('0x1a')](function(){return _0x23cd71(null,_0x4683f8);});}}}});})[_0x4286('0x20')](function(_0x11c138){return _0x23cd71(null,![],_0x11c138);});}function sendServiceMail(_0x2e051d){return db[_0x4286('0x21')][_0x4286('0x22')]({'where':{'service':!![]},'attributes':['id',_0x4286('0xf'),_0x4286('0x23')],'include':[{'model':db[_0x4286('0x24')],'as':'Smtp','include':[{'model':db[_0x4286('0x25')],'as':'CloudProvider'}]}]})[_0x4286('0x1a')](function(_0x44ea9e){if(!_0x44ea9e){throw new Error(_0x4286('0x26'));}var _0x3d5cfa=_0x44ea9e[_0x4286('0x27')]();var _0x33e0b3={'account':_0x3d5cfa,'message':_[_0x4286('0x28')]({'from':util[_0x4286('0x29')]('\x22%s\x22\x20<%s>',_0x44ea9e['name'],_0x44ea9e[_0x4286('0x23')]||_0x44ea9e[_0x4286('0x2a')][_0x4286('0x2b')])},_0x2e051d)};return client[_0x4286('0x2c')]('SendMail',_0x33e0b3);})[_0x4286('0x1a')](function(_0x35d061){if(_0x35d061[_0x4286('0x2d')]){throw new Error(util[_0x4286('0x29')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x35d061[_0x4286('0x2d')][_0x4286('0x2e')]||JSON[_0x4286('0x2f')](_0x35d061[_0x4286('0x2d')])));}return!![];});}function handleError(_0x23671d,_0x5089fd,_0x1df9d1){return _0x23671d['status'](_0x5089fd||0x1f4)[_0x4286('0x30')]({'message':_0x1df9d1?_0x1df9d1[_0x4286('0x2e')]||_0x1df9d1:''});}exports[_0x4286('0x31')]=function(_0x3951b0,_0xd34dcb,_0x5932b8){passport[_0x4286('0x1b')](_0x4286('0x32'),function(_0x434cc2,_0x365d94,_0x185792){var _0x5b0eb9=_0x434cc2||_0x185792;if(_0x5b0eb9){return handleError(_0xd34dcb,0x191,_0x5b0eb9);}if(!_0x365d94){return handleError(_0xd34dcb,0x194,{'message':_0x4286('0x33')});}else{var _0x54f6ee={'payload':{'id':_0x365d94['id'],'role':_0x365d94[_0x4286('0x12')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x54f6ee)[_0x4286('0x1a')](function(_0x18fb19){_0xd34dcb[_0x4286('0x34')]({'id':_0x365d94['id'],'token':_0x18fb19,'statusCall':'','isAlreadyLogged':_0x365d94[_0x4286('0x35')]});});}})(_0x3951b0,_0xd34dcb,_0x5932b8);};exports[_0x4286('0x36')]=function(_0x215b3f,_0x57b3df){if(!_0x215b3f[_0x4286('0x37')][_0x4286('0x23')]){return handleError(_0x57b3df,0x1f4,{'message':_0x4286('0x38')});}var _0x4e6cf8=rs[_0x4286('0x39')]();_0x215b3f['body']['email']=_0x215b3f['body'][_0x4286('0x23')]['trim']()[_0x4286('0x3a')]();var _0x534a8f;return db[_0x4286('0xb')][_0x4286('0xc')]({'where':{'id':0x1},'attributes':[_0x4286('0xd'),'blockDuration'],'raw':!![]})[_0x4286('0x1a')](function(_0x292d4d){_0x534a8f=_0x292d4d;return db[_0x4286('0x3b')][_0x4286('0x22')]({'where':{'email':_0x215b3f['body']['email']}});})[_0x4286('0x1a')](function(_0x3ec21a){if(!_0x3ec21a){throw new Error(_0x4286('0x3c'));}if(_0x3ec21a['disabled']){throw new Error(_0x4286('0x3d'));}if(_0x3ec21a[_0x4286('0x14')]){if(moment(_0x3ec21a[_0x4286('0x15')])[_0x4286('0x1c')](_0x534a8f[_0x4286('0xe')],_0x4286('0x1d'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x3ec21a[_0x4286('0x14')]=![];_0x3ec21a[_0x4286('0x15')]=null;}}_0x3ec21a['resetPasswordToken']=_0x4e6cf8;_0x3ec21a[_0x4286('0x3e')]=Date[_0x4286('0x3f')]()+0x36ee80;return _0x3ec21a['save']();})[_0x4286('0x1a')](function(){return sendServiceMail({'to':_0x215b3f[_0x4286('0x37')][_0x4286('0x23')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x4286('0x40')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+'https://'+_0x215b3f[_0x4286('0x41')][_0x4286('0x42')]+_0x4286('0x43')+_0x4e6cf8+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x4286('0x1a')](function(){_0x57b3df['status'](0xc8)[_0x4286('0x30')]({'message':'Reset\x20Email\x20sent!'});})[_0x4286('0x20')](function(_0x110b5c){return handleError(_0x57b3df,0x1f4,_0x110b5c);});};exports['reset']=function(_0x3da644,_0x40be3d){return db[_0x4286('0x3b')][_0x4286('0x22')]({'where':{'resetPasswordToken':_0x3da644[_0x4286('0x44')]['token'],'resetPasswordExpires':{'$gt':Date[_0x4286('0x3f')]()}}})['then'](function(_0x2e5a8e){if(!_0x2e5a8e){throw new Error(_0x4286('0x45'));}return db[_0x4286('0xb')][_0x4286('0xc')]({'attributes':['id',_0x4286('0x46'),_0x4286('0x47'),_0x4286('0x48')]})[_0x4286('0x1a')](function(_0x1bf096){if(_0x1bf096['securePassword'])authService[_0x4286('0x49')](_0x3da644[_0x4286('0x37')][_0x4286('0x10')]);if(!_0x1bf096[_0x4286('0x47')]||!_0x2e5a8e[_0x4286('0x4a')])return _0x2e5a8e;authService[_0x4286('0x4b')](_0x3da644[_0x4286('0x37')]['password'],_0x2e5a8e[_0x4286('0x4a')],_0x1bf096['passwordHistoryLimit']);return _0x2e5a8e;})[_0x4286('0x1a')](function(){_0x2e5a8e[_0x4286('0x10')]=_0x3da644['body'][_0x4286('0x10')];_0x2e5a8e[_0x4286('0x4c')]=null;_0x2e5a8e[_0x4286('0x3e')]=null;return _0x2e5a8e[_0x4286('0x4d')]();});})[_0x4286('0x1a')](function(){_0x40be3d['status'](0xc8)[_0x4286('0x30')]({'message':'Password\x20reset!'});})[_0x4286('0x20')](function(_0x59f2e5){return handleError(_0x40be3d,0x1f4,_0x59f2e5);});};passport[_0x4286('0x4e')](_0x4286('0x32'),new LocalStrategy({'usernameField':_0x4286('0xf'),'passwordField':_0x4286('0x10')},function(_0x923364,_0x50df04,_0x4def85){return localAuthenticate(db['User'],_0x923364,_0x50df04,_0x4def85);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index a83c141..5485721 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 _0xfa96=['login','/forgot','forgot','/reset/:token','reset','exports','express','Router','./authLocal.controller','post'];(function(_0x4e1286,_0x1c02fd){var _0x2cd16c=function(_0x19c67d){while(--_0x19c67d){_0x4e1286['push'](_0x4e1286['shift']());}};_0x2cd16c(++_0x1c02fd);}(_0xfa96,0x18c));var _0x6fa9=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xfa96[_0x17b6e3];return _0x3906f3;};'use strict';var express=require(_0x6fa9('0x0'));var router=express[_0x6fa9('0x1')]();var controller=require(_0x6fa9('0x2'));router[_0x6fa9('0x3')]('/',controller[_0x6fa9('0x4')]);router[_0x6fa9('0x3')](_0x6fa9('0x5'),controller[_0x6fa9('0x6')]);router[_0x6fa9('0x3')](_0x6fa9('0x7'),controller[_0x6fa9('0x8')]);module[_0x6fa9('0x9')]=router; \ No newline at end of file +var _0xfabf=['forgot','/reset/:token','exports','./authLocal.controller','post','login','/forgot'];(function(_0x7e07c3,_0x1ea67d){var _0x5e6137=function(_0x37d5f6){while(--_0x37d5f6){_0x7e07c3['push'](_0x7e07c3['shift']());}};_0x5e6137(++_0x1ea67d);}(_0xfabf,0x1c3));var _0xffab=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xfabf[_0x2dafbe];return _0x58a45a;};'use strict';var express=require('express');var router=express['Router']();var controller=require(_0xffab('0x0'));router[_0xffab('0x1')]('/',controller[_0xffab('0x2')]);router[_0xffab('0x1')](_0xffab('0x3'),controller[_0xffab('0x4')]);router[_0xffab('0x1')](_0xffab('0x5'),controller['reset']);module[_0xffab('0x6')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index f1149fe..5beeb00 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 _0x4ee9=['INTEGER','sequelize','STRING','BOOLEAN'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x4ee9,0x11d));var _0x94ee=function(_0xe61616,_0x1bd828){_0xe61616=_0xe61616-0x0;var _0x3fa7e0=_0x4ee9[_0xe61616];return _0x3fa7e0;};'use strict';var Sequelize=require(_0x94ee('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x94ee('0x1')]},'description':{'type':Sequelize[_0x94ee('0x1')]},'status':{'type':Sequelize[_0x94ee('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x94ee('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0x5b25=['STRING','BOOLEAN','exports'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x5b25,0x1ee));var _0x55b2=function(_0x2caa2f,_0x41aa56){_0x2caa2f=_0x2caa2f-0x0;var _0x51e305=_0x5b25[_0x2caa2f];return _0x51e305;};'use strict';var Sequelize=require('sequelize');module[_0x55b2('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x55b2('0x1')]},'description':{'type':Sequelize[_0x55b2('0x1')]},'status':{'type':Sequelize[_0x55b2('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index c8f42a1..fcb1e3c 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 _0x7187=['destroy','addConditions','ids','getConditions','findOne','Condition','Action','addActions','omit','getActions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','error','name','send','index','map','Automation','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','find','create','body','params'];(function(_0x314af3,_0x55b640){var _0x14f133=function(_0x2810a9){while(--_0x2810a9){_0x314af3['push'](_0x314af3['shift']());}};_0x14f133(++_0x55b640);}(_0x7187,0x1b3));var _0x7718=function(_0x41dfe8,_0x4fba9f){_0x41dfe8=_0x41dfe8-0x0;var _0x2c163d=_0x7187[_0x41dfe8];return _0x2c163d;};'use strict';var emlformat=require(_0x7718('0x0'));var rimraf=require(_0x7718('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7718('0x2'));var rp=require(_0x7718('0x3'));var moment=require(_0x7718('0x4'));var BPromise=require(_0x7718('0x5'));var Mustache=require('mustache');var util=require(_0x7718('0x6'));var path=require('path');var sox=require(_0x7718('0x7'));var csv=require('to-csv');var ejs=require(_0x7718('0x8'));var fs=require('fs');var fs_extra=require(_0x7718('0x9'));var _=require(_0x7718('0xa'));var squel=require('squel');var crypto=require(_0x7718('0xb'));var jsforce=require(_0x7718('0xc'));var deskjs=require(_0x7718('0xd'));var toCsv=require(_0x7718('0xe'));var querystring=require(_0x7718('0xf'));var Papa=require(_0x7718('0x10'));var Redis=require(_0x7718('0x11'));var authService=require(_0x7718('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7718('0x13'));var logger=require('../../config/logger')(_0x7718('0x14'));var utils=require(_0x7718('0x15'));var config=require(_0x7718('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x7718('0x17'))['db'];function respondWithStatusCode(_0x2fcee0,_0x315365){_0x315365=_0x315365||0xcc;return function(_0x42ccfb){if(_0x42ccfb){return _0x2fcee0[_0x7718('0x18')](_0x315365);}return _0x2fcee0[_0x7718('0x19')](_0x315365)[_0x7718('0x1a')]();};}function respondWithResult(_0x17fa66,_0x580fd7){_0x580fd7=_0x580fd7||0xc8;return function(_0x44c0ac){if(_0x44c0ac){return _0x17fa66[_0x7718('0x19')](_0x580fd7)['json'](_0x44c0ac);}};}function respondWithFilteredResult(_0x5ee32e,_0x4a38f8){return function(_0x213154){if(_0x213154){var _0x7c6fe3=typeof _0x4a38f8[_0x7718('0x1b')]===_0x7718('0x1c')&&typeof _0x4a38f8[_0x7718('0x1d')]===_0x7718('0x1c');var _0x343f06=_0x213154[_0x7718('0x1e')];var _0x7594d=_0x7c6fe3?0x0:_0x4a38f8['offset'];var _0x4b4ca5=_0x7c6fe3?_0x213154[_0x7718('0x1e')]:_0x4a38f8[_0x7718('0x1b')]+_0x4a38f8['limit'];var _0x12e5a0;if(_0x4b4ca5>=_0x343f06){_0x4b4ca5=_0x343f06;_0x12e5a0=0xc8;}else{_0x12e5a0=0xce;}_0x5ee32e[_0x7718('0x19')](_0x12e5a0);return _0x5ee32e[_0x7718('0x1f')](_0x7718('0x20'),_0x7594d+'-'+_0x4b4ca5+'/'+_0x343f06)[_0x7718('0x21')](_0x213154);}return null;};}function patchUpdates(_0x1b1683){return function(_0x1d6e47){try{jsonpatch[_0x7718('0x22')](_0x1d6e47,_0x1b1683,!![]);}catch(_0xd834b0){return BPromise[_0x7718('0x23')](_0xd834b0);}return _0x1d6e47[_0x7718('0x24')]();};}function saveUpdates(_0x30fb78,_0x178e7a){return function(_0x476261){if(_0x476261){return _0x476261[_0x7718('0x25')](_0x30fb78)[_0x7718('0x26')](function(_0xf7eb1d){return _0xf7eb1d;});}return null;};}function removeEntity(_0x470056,_0x3c44f1){return function(_0x6539cf){if(_0x6539cf){return _0x6539cf['destroy']()[_0x7718('0x26')](function(){_0x470056[_0x7718('0x19')](0xcc)[_0x7718('0x1a')]();});}};}function handleEntityNotFound(_0x1f4ae0,_0x45b8f6){return function(_0x57ede9){if(!_0x57ede9){_0x1f4ae0['sendStatus'](0x194);}return _0x57ede9;};}function handleError(_0x3cd6db,_0x18275a){_0x18275a=_0x18275a||0x1f4;return function(_0x1f7cab){logger[_0x7718('0x27')](_0x1f7cab['stack']);if(_0x1f7cab['name']){delete _0x1f7cab[_0x7718('0x28')];}_0x3cd6db[_0x7718('0x19')](_0x18275a)[_0x7718('0x29')](_0x1f7cab);};}exports[_0x7718('0x2a')]=function(_0x3cdfcc,_0x3ecbf6){var _0x556477={},_0x4988f9={},_0x3990df={'count':0x0,'rows':[]};var _0x5c41b7=_[_0x7718('0x2b')](db[_0x7718('0x2c')][_0x7718('0x2d')],function(_0x346d04){return{'name':_0x346d04['fieldName'],'type':_0x346d04[_0x7718('0x2e')][_0x7718('0x2f')]};});_0x4988f9[_0x7718('0x30')]=_[_0x7718('0x2b')](_0x5c41b7,_0x7718('0x28'));_0x4988f9[_0x7718('0x31')]=_[_0x7718('0x32')](_0x3cdfcc[_0x7718('0x31')]);_0x4988f9[_0x7718('0x33')]=_['intersection'](_0x4988f9[_0x7718('0x30')],_0x4988f9[_0x7718('0x31')]);_0x556477[_0x7718('0x34')]=_[_0x7718('0x35')](_0x4988f9[_0x7718('0x30')],qs[_0x7718('0x36')](_0x3cdfcc[_0x7718('0x31')]['fields']));_0x556477['attributes']=_0x556477[_0x7718('0x34')][_0x7718('0x37')]?_0x556477[_0x7718('0x34')]:_0x4988f9['model'];if(!_0x3cdfcc[_0x7718('0x31')][_0x7718('0x38')](_0x7718('0x39'))){_0x556477[_0x7718('0x1d')]=qs['limit'](_0x3cdfcc[_0x7718('0x31')][_0x7718('0x1d')]);_0x556477[_0x7718('0x1b')]=qs[_0x7718('0x1b')](_0x3cdfcc[_0x7718('0x31')][_0x7718('0x1b')]);}_0x556477[_0x7718('0x3a')]=qs[_0x7718('0x3b')](_0x3cdfcc[_0x7718('0x31')][_0x7718('0x3b')]);_0x556477[_0x7718('0x3c')]=qs[_0x7718('0x33')](_[_0x7718('0x3d')](_0x3cdfcc[_0x7718('0x31')],_0x4988f9[_0x7718('0x33')]),_0x5c41b7);if(_0x3cdfcc[_0x7718('0x31')]['filter']){_0x556477[_0x7718('0x3c')]=_[_0x7718('0x3e')](_0x556477[_0x7718('0x3c')],{'$or':_[_0x7718('0x2b')](_0x5c41b7,function(_0x3efbfe){if(_0x3efbfe[_0x7718('0x2e')]!==_0x7718('0x3f')){var _0x1f0d22={};_0x1f0d22[_0x3efbfe[_0x7718('0x28')]]={'$like':'%'+_0x3cdfcc['query'][_0x7718('0x40')]+'%'};return _0x1f0d22;}})});}_0x556477=_[_0x7718('0x3e')]({},_0x556477,_0x3cdfcc[_0x7718('0x41')]);var _0x2a5780={'where':_0x556477[_0x7718('0x3c')]};return db['Automation'][_0x7718('0x1e')](_0x2a5780)[_0x7718('0x26')](function(_0x3edc33){_0x3990df[_0x7718('0x1e')]=_0x3edc33;if(_0x3cdfcc['query'][_0x7718('0x42')]){_0x556477[_0x7718('0x43')]=[{'all':!![]}];}return db['Automation'][_0x7718('0x44')](_0x556477);})[_0x7718('0x26')](function(_0x10eedb){_0x3990df['rows']=_0x10eedb;return _0x3990df;})['then'](respondWithFilteredResult(_0x3ecbf6,_0x556477))[_0x7718('0x45')](handleError(_0x3ecbf6,null));};exports[_0x7718('0x46')]=function(_0x376cd0,_0x535cd6){var _0x373726={'raw':![],'where':{'id':_0x376cd0['params']['id']}},_0x7ed9f2={};_0x7ed9f2[_0x7718('0x30')]=_[_0x7718('0x32')](db[_0x7718('0x2c')][_0x7718('0x2d')]);_0x7ed9f2[_0x7718('0x31')]=_[_0x7718('0x32')](_0x376cd0[_0x7718('0x31')]);_0x7ed9f2[_0x7718('0x33')]=_[_0x7718('0x35')](_0x7ed9f2[_0x7718('0x30')],_0x7ed9f2[_0x7718('0x31')]);_0x373726['attributes']=_[_0x7718('0x35')](_0x7ed9f2['model'],qs['fields'](_0x376cd0[_0x7718('0x31')]['fields']));_0x373726[_0x7718('0x34')]=_0x373726[_0x7718('0x34')]['length']?_0x373726[_0x7718('0x34')]:_0x7ed9f2[_0x7718('0x30')];if(_0x376cd0[_0x7718('0x31')]['includeAll']){_0x373726[_0x7718('0x43')]=[{'all':!![]}];}_0x373726=_[_0x7718('0x3e')]({},_0x373726,_0x376cd0[_0x7718('0x41')]);return db[_0x7718('0x2c')][_0x7718('0x47')](_0x373726)[_0x7718('0x26')](handleEntityNotFound(_0x535cd6,null))['then'](respondWithResult(_0x535cd6,null))[_0x7718('0x45')](handleError(_0x535cd6,null));};exports[_0x7718('0x48')]=function(_0x440a54,_0xe04ae1){return db['Automation']['create'](_0x440a54[_0x7718('0x49')],{})[_0x7718('0x26')](respondWithResult(_0xe04ae1,0xc9))['catch'](handleError(_0xe04ae1,null));};exports[_0x7718('0x25')]=function(_0x1f2642,_0x66a54a){if(_0x1f2642[_0x7718('0x49')]['id']){delete _0x1f2642[_0x7718('0x49')]['id'];}return db[_0x7718('0x2c')][_0x7718('0x47')]({'where':{'id':_0x1f2642[_0x7718('0x4a')]['id']}})[_0x7718('0x26')](handleEntityNotFound(_0x66a54a,null))['then'](saveUpdates(_0x1f2642[_0x7718('0x49')],null))[_0x7718('0x26')](respondWithResult(_0x66a54a,null))['catch'](handleError(_0x66a54a,null));};exports[_0x7718('0x4b')]=function(_0x3fd0f3,_0x249e0a){return db['Automation'][_0x7718('0x47')]({'where':{'id':_0x3fd0f3['params']['id']}})['then'](handleEntityNotFound(_0x249e0a,null))[_0x7718('0x26')](removeEntity(_0x249e0a,null))[_0x7718('0x45')](handleError(_0x249e0a,null));};exports[_0x7718('0x4c')]=function(_0xd68972,_0x50409c,_0x3314fc){return db['Condition'][_0x7718('0x47')]({'where':{'id':_0xd68972['params']['id']}})[_0x7718('0x26')](handleEntityNotFound(_0x50409c,null))[_0x7718('0x26')](function(_0x43ce8d){if(_0x43ce8d){return _0x43ce8d[_0x7718('0x4c')](_0xd68972[_0x7718('0x49')][_0x7718('0x4d')],_['omit'](_0xd68972[_0x7718('0x49')],[_0x7718('0x4d'),'id'])||{});}})[_0x7718('0x26')](respondWithResult(_0x50409c,null))[_0x7718('0x45')](handleError(_0x50409c,null));};exports[_0x7718('0x4e')]=function(_0x4745e4,_0x5c2377,_0x3e2902){var _0xa624b8={};var _0x2aee78={};var _0x7b2298;var _0x1a9db5;return db['Automation'][_0x7718('0x4f')]({'where':{'id':_0x4745e4['params']['id']}})[_0x7718('0x26')](handleEntityNotFound(_0x5c2377,null))[_0x7718('0x26')](function(_0x31ad1c){if(_0x31ad1c){_0x7b2298=_0x31ad1c;_0x2aee78[_0x7718('0x30')]=_[_0x7718('0x32')](db[_0x7718('0x50')][_0x7718('0x2d')]);_0x2aee78[_0x7718('0x31')]=_[_0x7718('0x32')](_0x4745e4['query']);_0x2aee78[_0x7718('0x33')]=_[_0x7718('0x35')](_0x2aee78['model'],_0x2aee78[_0x7718('0x31')]);_0xa624b8[_0x7718('0x34')]=_[_0x7718('0x35')](_0x2aee78['model'],qs[_0x7718('0x36')](_0x4745e4[_0x7718('0x31')][_0x7718('0x36')]));_0xa624b8['attributes']=_0xa624b8[_0x7718('0x34')][_0x7718('0x37')]?_0xa624b8[_0x7718('0x34')]:_0x2aee78[_0x7718('0x30')];_0xa624b8[_0x7718('0x3a')]=qs[_0x7718('0x3b')](_0x4745e4[_0x7718('0x31')][_0x7718('0x3b')]);_0xa624b8[_0x7718('0x3c')]=qs[_0x7718('0x33')](_['pick'](_0x4745e4['query'],_0x2aee78[_0x7718('0x33')]));if(_0x4745e4[_0x7718('0x31')][_0x7718('0x40')]){_0xa624b8[_0x7718('0x3c')]=_[_0x7718('0x3e')](_0xa624b8[_0x7718('0x3c')],{'$or':_[_0x7718('0x2b')](_0xa624b8[_0x7718('0x34')],function(_0x1ea7b1){var _0x25a916={};_0x25a916[_0x1ea7b1]={'$like':'%'+_0x4745e4['query'][_0x7718('0x40')]+'%'};return _0x25a916;})});}_0xa624b8=_[_0x7718('0x3e')]({},_0xa624b8,_0x4745e4[_0x7718('0x41')]);return _0x7b2298[_0x7718('0x4e')](_0xa624b8);}})[_0x7718('0x26')](function(_0x44f31a){if(_0x44f31a){_0x1a9db5=_0x44f31a[_0x7718('0x37')];if(!_0x4745e4[_0x7718('0x31')]['hasOwnProperty'](_0x7718('0x39'))){_0xa624b8[_0x7718('0x1d')]=qs['limit'](_0x4745e4['query']['limit']);_0xa624b8[_0x7718('0x1b')]=qs[_0x7718('0x1b')](_0x4745e4[_0x7718('0x31')][_0x7718('0x1b')]);}return _0x7b2298['getConditions'](_0xa624b8);}})[_0x7718('0x26')](function(_0x124d0e){if(_0x124d0e){return _0x124d0e?{'count':_0x1a9db5,'rows':_0x124d0e}:null;}})[_0x7718('0x26')](respondWithResult(_0x5c2377,null))[_0x7718('0x45')](handleError(_0x5c2377,null));};exports['addActions']=function(_0x5bfb08,_0x1940d8,_0x104e91){return db[_0x7718('0x51')][_0x7718('0x47')]({'where':{'id':_0x5bfb08['params']['id']}})[_0x7718('0x26')](handleEntityNotFound(_0x1940d8,null))[_0x7718('0x26')](function(_0x27353c){if(_0x27353c){return _0x27353c[_0x7718('0x52')](_0x5bfb08[_0x7718('0x49')][_0x7718('0x4d')],_[_0x7718('0x53')](_0x5bfb08[_0x7718('0x49')],['ids','id'])||{});}})[_0x7718('0x26')](respondWithResult(_0x1940d8,null))[_0x7718('0x45')](handleError(_0x1940d8,null));};exports[_0x7718('0x54')]=function(_0x4c4435,_0x4559d7,_0x38960a){var _0x448705={};var _0x1183c3={};var _0x58a84f;var _0x1971e7;return db[_0x7718('0x2c')][_0x7718('0x4f')]({'where':{'id':_0x4c4435[_0x7718('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4559d7,null))['then'](function(_0x48ca1f){if(_0x48ca1f){_0x58a84f=_0x48ca1f;_0x1183c3[_0x7718('0x30')]=_[_0x7718('0x32')](db['Action'][_0x7718('0x2d')]);_0x1183c3[_0x7718('0x31')]=_['keys'](_0x4c4435['query']);_0x1183c3[_0x7718('0x33')]=_[_0x7718('0x35')](_0x1183c3['model'],_0x1183c3[_0x7718('0x31')]);_0x448705[_0x7718('0x34')]=_[_0x7718('0x35')](_0x1183c3[_0x7718('0x30')],qs[_0x7718('0x36')](_0x4c4435[_0x7718('0x31')][_0x7718('0x36')]));_0x448705[_0x7718('0x34')]=_0x448705[_0x7718('0x34')]['length']?_0x448705['attributes']:_0x1183c3[_0x7718('0x30')];_0x448705[_0x7718('0x3a')]=qs[_0x7718('0x3b')](_0x4c4435[_0x7718('0x31')]['sort']);_0x448705[_0x7718('0x3c')]=qs[_0x7718('0x33')](_[_0x7718('0x3d')](_0x4c4435[_0x7718('0x31')],_0x1183c3[_0x7718('0x33')]));if(_0x4c4435['query'][_0x7718('0x40')]){_0x448705[_0x7718('0x3c')]=_[_0x7718('0x3e')](_0x448705[_0x7718('0x3c')],{'$or':_[_0x7718('0x2b')](_0x448705[_0x7718('0x34')],function(_0x3d003b){var _0x38ae80={};_0x38ae80[_0x3d003b]={'$like':'%'+_0x4c4435[_0x7718('0x31')][_0x7718('0x40')]+'%'};return _0x38ae80;})});}_0x448705=_[_0x7718('0x3e')]({},_0x448705,_0x4c4435[_0x7718('0x41')]);return _0x58a84f[_0x7718('0x54')](_0x448705);}})[_0x7718('0x26')](function(_0x5bb142){if(_0x5bb142){_0x1971e7=_0x5bb142['length'];if(!_0x4c4435['query'][_0x7718('0x38')](_0x7718('0x39'))){_0x448705[_0x7718('0x1d')]=qs[_0x7718('0x1d')](_0x4c4435['query'][_0x7718('0x1d')]);_0x448705[_0x7718('0x1b')]=qs[_0x7718('0x1b')](_0x4c4435[_0x7718('0x31')]['offset']);}return _0x58a84f['getActions'](_0x448705);}})['then'](function(_0x3f69c8){if(_0x3f69c8){return _0x3f69c8?{'count':_0x1971e7,'rows':_0x3f69c8}:null;}})['then'](respondWithResult(_0x4559d7,null))[_0x7718('0x45')](handleError(_0x4559d7,null));}; \ No newline at end of file +var _0x8801=['addActions','Action','omit','ids','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','offset','undefined','count','limit','set','Content-Range','then','destroy','sendStatus','error','name','send','index','Automation','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filters','filter','merge','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','addConditions','findOne','Condition','order','options','getConditions','nolimit'];(function(_0x1ebe90,_0x5d29fc){var _0x447c82=function(_0x1c2646){while(--_0x1c2646){_0x1ebe90['push'](_0x1ebe90['shift']());}};_0x447c82(++_0x5d29fc);}(_0x8801,0x155));var _0x1880=function(_0x37329c,_0x57413e){_0x37329c=_0x37329c-0x0;var _0x38b67f=_0x8801[_0x37329c];return _0x38b67f;};'use strict';var emlformat=require(_0x1880('0x0'));var rimraf=require(_0x1880('0x1'));var zipdir=require(_0x1880('0x2'));var jsonpatch=require(_0x1880('0x3'));var rp=require(_0x1880('0x4'));var moment=require(_0x1880('0x5'));var BPromise=require(_0x1880('0x6'));var Mustache=require(_0x1880('0x7'));var util=require('util');var path=require(_0x1880('0x8'));var sox=require(_0x1880('0x9'));var csv=require(_0x1880('0xa'));var ejs=require(_0x1880('0xb'));var fs=require('fs');var fs_extra=require(_0x1880('0xc'));var _=require(_0x1880('0xd'));var squel=require(_0x1880('0xe'));var crypto=require(_0x1880('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x1880('0x10'));var toCsv=require(_0x1880('0xa'));var querystring=require('querystring');var Papa=require(_0x1880('0x11'));var Redis=require(_0x1880('0x12'));var authService=require(_0x1880('0x13'));var qs=require(_0x1880('0x14'));var as=require(_0x1880('0x15'));var hardwareService=require(_0x1880('0x16'));var logger=require(_0x1880('0x17'))(_0x1880('0x18'));var utils=require(_0x1880('0x19'));var config=require(_0x1880('0x1a'));var licenseUtil=require(_0x1880('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x108da5,_0x8a6c1c){_0x8a6c1c=_0x8a6c1c||0xcc;return function(_0x31311c){if(_0x31311c){return _0x108da5['sendStatus'](_0x8a6c1c);}return _0x108da5['status'](_0x8a6c1c)[_0x1880('0x1c')]();};}function respondWithResult(_0x311e9e,_0x8e1b3f){_0x8e1b3f=_0x8e1b3f||0xc8;return function(_0x135297){if(_0x135297){return _0x311e9e[_0x1880('0x1d')](_0x8e1b3f)['json'](_0x135297);}};}function respondWithFilteredResult(_0x4bc404,_0x4117f8){return function(_0x11ea9b){if(_0x11ea9b){var _0x23c6df=typeof _0x4117f8[_0x1880('0x1e')]===_0x1880('0x1f')&&typeof _0x4117f8['limit']===_0x1880('0x1f');var _0x226c52=_0x11ea9b[_0x1880('0x20')];var _0x18d420=_0x23c6df?0x0:_0x4117f8[_0x1880('0x1e')];var _0x40bff4=_0x23c6df?_0x11ea9b[_0x1880('0x20')]:_0x4117f8[_0x1880('0x1e')]+_0x4117f8[_0x1880('0x21')];var _0x15bb55;if(_0x40bff4>=_0x226c52){_0x40bff4=_0x226c52;_0x15bb55=0xc8;}else{_0x15bb55=0xce;}_0x4bc404[_0x1880('0x1d')](_0x15bb55);return _0x4bc404[_0x1880('0x22')](_0x1880('0x23'),_0x18d420+'-'+_0x40bff4+'/'+_0x226c52)['json'](_0x11ea9b);}return null;};}function patchUpdates(_0x4f7037){return function(_0x1bd013){try{jsonpatch['apply'](_0x1bd013,_0x4f7037,!![]);}catch(_0x4bc82b){return BPromise['reject'](_0x4bc82b);}return _0x1bd013['save']();};}function saveUpdates(_0x59b13e,_0x4d4262){return function(_0x48cd92){if(_0x48cd92){return _0x48cd92['update'](_0x59b13e)[_0x1880('0x24')](function(_0x2aff57){return _0x2aff57;});}return null;};}function removeEntity(_0x4bc7de,_0x386256){return function(_0x3d3d96){if(_0x3d3d96){return _0x3d3d96[_0x1880('0x25')]()['then'](function(){_0x4bc7de['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e10b1,_0x2c62b7){return function(_0x487eb4){if(!_0x487eb4){_0x1e10b1[_0x1880('0x26')](0x194);}return _0x487eb4;};}function handleError(_0x3d223b,_0x4dd10c){_0x4dd10c=_0x4dd10c||0x1f4;return function(_0x18918c){logger[_0x1880('0x27')](_0x18918c['stack']);if(_0x18918c[_0x1880('0x28')]){delete _0x18918c[_0x1880('0x28')];}_0x3d223b['status'](_0x4dd10c)[_0x1880('0x29')](_0x18918c);};}exports[_0x1880('0x2a')]=function(_0x4b4608,_0x4eec81){var _0x1c0099={},_0x570091={},_0x4e56a1={'count':0x0,'rows':[]};var _0x232f84=_['map'](db[_0x1880('0x2b')][_0x1880('0x2c')],function(_0x611b4e){return{'name':_0x611b4e[_0x1880('0x2d')],'type':_0x611b4e[_0x1880('0x2e')][_0x1880('0x2f')]};});_0x570091['model']=_['map'](_0x232f84,_0x1880('0x28'));_0x570091['query']=_['keys'](_0x4b4608[_0x1880('0x30')]);_0x570091['filters']=_[_0x1880('0x31')](_0x570091[_0x1880('0x32')],_0x570091[_0x1880('0x30')]);_0x1c0099[_0x1880('0x33')]=_[_0x1880('0x31')](_0x570091[_0x1880('0x32')],qs[_0x1880('0x34')](_0x4b4608[_0x1880('0x30')]['fields']));_0x1c0099['attributes']=_0x1c0099[_0x1880('0x33')][_0x1880('0x35')]?_0x1c0099[_0x1880('0x33')]:_0x570091[_0x1880('0x32')];if(!_0x4b4608[_0x1880('0x30')][_0x1880('0x36')]('nolimit')){_0x1c0099[_0x1880('0x21')]=qs[_0x1880('0x21')](_0x4b4608['query'][_0x1880('0x21')]);_0x1c0099['offset']=qs[_0x1880('0x1e')](_0x4b4608[_0x1880('0x30')][_0x1880('0x1e')]);}_0x1c0099['order']=qs[_0x1880('0x37')](_0x4b4608[_0x1880('0x30')][_0x1880('0x37')]);_0x1c0099[_0x1880('0x38')]=qs['filters'](_[_0x1880('0x39')](_0x4b4608[_0x1880('0x30')],_0x570091[_0x1880('0x3a')]),_0x232f84);if(_0x4b4608[_0x1880('0x30')][_0x1880('0x3b')]){_0x1c0099[_0x1880('0x38')]=_[_0x1880('0x3c')](_0x1c0099[_0x1880('0x38')],{'$or':_['map'](_0x232f84,function(_0x451593){if(_0x451593[_0x1880('0x2e')]!=='VIRTUAL'){var _0x6c8861={};_0x6c8861[_0x451593[_0x1880('0x28')]]={'$like':'%'+_0x4b4608[_0x1880('0x30')][_0x1880('0x3b')]+'%'};return _0x6c8861;}})});}_0x1c0099=_[_0x1880('0x3c')]({},_0x1c0099,_0x4b4608['options']);var _0x303d83={'where':_0x1c0099['where']};return db[_0x1880('0x2b')][_0x1880('0x20')](_0x303d83)[_0x1880('0x24')](function(_0x4439ca){_0x4e56a1[_0x1880('0x20')]=_0x4439ca;if(_0x4b4608[_0x1880('0x30')][_0x1880('0x3d')]){_0x1c0099[_0x1880('0x3e')]=[{'all':!![]}];}return db[_0x1880('0x2b')][_0x1880('0x3f')](_0x1c0099);})[_0x1880('0x24')](function(_0x47f6c1){_0x4e56a1[_0x1880('0x40')]=_0x47f6c1;return _0x4e56a1;})['then'](respondWithFilteredResult(_0x4eec81,_0x1c0099))[_0x1880('0x41')](handleError(_0x4eec81,null));};exports[_0x1880('0x42')]=function(_0x5419e4,_0x1467ef){var _0xc956bc={'raw':![],'where':{'id':_0x5419e4[_0x1880('0x43')]['id']}},_0x362177={};_0x362177['model']=_['keys'](db[_0x1880('0x2b')][_0x1880('0x2c')]);_0x362177['query']=_[_0x1880('0x44')](_0x5419e4[_0x1880('0x30')]);_0x362177[_0x1880('0x3a')]=_[_0x1880('0x31')](_0x362177[_0x1880('0x32')],_0x362177[_0x1880('0x30')]);_0xc956bc['attributes']=_[_0x1880('0x31')](_0x362177['model'],qs[_0x1880('0x34')](_0x5419e4[_0x1880('0x30')][_0x1880('0x34')]));_0xc956bc['attributes']=_0xc956bc[_0x1880('0x33')][_0x1880('0x35')]?_0xc956bc[_0x1880('0x33')]:_0x362177[_0x1880('0x32')];if(_0x5419e4[_0x1880('0x30')][_0x1880('0x3d')]){_0xc956bc[_0x1880('0x3e')]=[{'all':!![]}];}_0xc956bc=_['merge']({},_0xc956bc,_0x5419e4['options']);return db[_0x1880('0x2b')][_0x1880('0x45')](_0xc956bc)[_0x1880('0x24')](handleEntityNotFound(_0x1467ef,null))['then'](respondWithResult(_0x1467ef,null))['catch'](handleError(_0x1467ef,null));};exports['create']=function(_0x3d4974,_0x4fd0cb){return db['Automation'][_0x1880('0x46')](_0x3d4974['body'],{})['then'](respondWithResult(_0x4fd0cb,0xc9))[_0x1880('0x41')](handleError(_0x4fd0cb,null));};exports['update']=function(_0x474732,_0x398c46){if(_0x474732[_0x1880('0x47')]['id']){delete _0x474732[_0x1880('0x47')]['id'];}return db['Automation']['find']({'where':{'id':_0x474732[_0x1880('0x43')]['id']}})[_0x1880('0x24')](handleEntityNotFound(_0x398c46,null))[_0x1880('0x24')](saveUpdates(_0x474732[_0x1880('0x47')],null))[_0x1880('0x24')](respondWithResult(_0x398c46,null))[_0x1880('0x41')](handleError(_0x398c46,null));};exports['destroy']=function(_0x2baef9,_0x225d7d){return db[_0x1880('0x2b')][_0x1880('0x45')]({'where':{'id':_0x2baef9[_0x1880('0x43')]['id']}})['then'](handleEntityNotFound(_0x225d7d,null))[_0x1880('0x24')](removeEntity(_0x225d7d,null))[_0x1880('0x41')](handleError(_0x225d7d,null));};exports[_0x1880('0x48')]=function(_0x4b3577,_0x30a0c3,_0x3284cb){return db['Condition'][_0x1880('0x45')]({'where':{'id':_0x4b3577[_0x1880('0x43')]['id']}})['then'](handleEntityNotFound(_0x30a0c3,null))[_0x1880('0x24')](function(_0x287fb3){if(_0x287fb3){return _0x287fb3['addConditions'](_0x4b3577['body']['ids'],_['omit'](_0x4b3577['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x30a0c3,null))[_0x1880('0x41')](handleError(_0x30a0c3,null));};exports['getConditions']=function(_0x12a262,_0x1a5eff,_0x5c0a70){var _0x5639c5={};var _0x4e5cde={};var _0xa5692e;var _0x4e4bed;return db[_0x1880('0x2b')][_0x1880('0x49')]({'where':{'id':_0x12a262[_0x1880('0x43')]['id']}})[_0x1880('0x24')](handleEntityNotFound(_0x1a5eff,null))[_0x1880('0x24')](function(_0x18441f){if(_0x18441f){_0xa5692e=_0x18441f;_0x4e5cde['model']=_[_0x1880('0x44')](db[_0x1880('0x4a')][_0x1880('0x2c')]);_0x4e5cde[_0x1880('0x30')]=_[_0x1880('0x44')](_0x12a262[_0x1880('0x30')]);_0x4e5cde[_0x1880('0x3a')]=_['intersection'](_0x4e5cde['model'],_0x4e5cde['query']);_0x5639c5[_0x1880('0x33')]=_[_0x1880('0x31')](_0x4e5cde[_0x1880('0x32')],qs[_0x1880('0x34')](_0x12a262[_0x1880('0x30')]['fields']));_0x5639c5[_0x1880('0x33')]=_0x5639c5[_0x1880('0x33')]['length']?_0x5639c5[_0x1880('0x33')]:_0x4e5cde[_0x1880('0x32')];_0x5639c5[_0x1880('0x4b')]=qs[_0x1880('0x37')](_0x12a262[_0x1880('0x30')][_0x1880('0x37')]);_0x5639c5['where']=qs[_0x1880('0x3a')](_[_0x1880('0x39')](_0x12a262[_0x1880('0x30')],_0x4e5cde[_0x1880('0x3a')]));if(_0x12a262['query'][_0x1880('0x3b')]){_0x5639c5[_0x1880('0x38')]=_[_0x1880('0x3c')](_0x5639c5['where'],{'$or':_['map'](_0x5639c5['attributes'],function(_0x2fe57f){var _0x50958d={};_0x50958d[_0x2fe57f]={'$like':'%'+_0x12a262['query'][_0x1880('0x3b')]+'%'};return _0x50958d;})});}_0x5639c5=_['merge']({},_0x5639c5,_0x12a262[_0x1880('0x4c')]);return _0xa5692e[_0x1880('0x4d')](_0x5639c5);}})[_0x1880('0x24')](function(_0x4a9540){if(_0x4a9540){_0x4e4bed=_0x4a9540[_0x1880('0x35')];if(!_0x12a262[_0x1880('0x30')][_0x1880('0x36')](_0x1880('0x4e'))){_0x5639c5[_0x1880('0x21')]=qs[_0x1880('0x21')](_0x12a262[_0x1880('0x30')]['limit']);_0x5639c5[_0x1880('0x1e')]=qs[_0x1880('0x1e')](_0x12a262[_0x1880('0x30')][_0x1880('0x1e')]);}return _0xa5692e[_0x1880('0x4d')](_0x5639c5);}})[_0x1880('0x24')](function(_0x398d39){if(_0x398d39){return _0x398d39?{'count':_0x4e4bed,'rows':_0x398d39}:null;}})['then'](respondWithResult(_0x1a5eff,null))['catch'](handleError(_0x1a5eff,null));};exports[_0x1880('0x4f')]=function(_0x579a62,_0x4133fb,_0xb75ad1){return db[_0x1880('0x50')][_0x1880('0x45')]({'where':{'id':_0x579a62[_0x1880('0x43')]['id']}})['then'](handleEntityNotFound(_0x4133fb,null))[_0x1880('0x24')](function(_0x424e3f){if(_0x424e3f){return _0x424e3f[_0x1880('0x4f')](_0x579a62[_0x1880('0x47')]['ids'],_[_0x1880('0x51')](_0x579a62[_0x1880('0x47')],[_0x1880('0x52'),'id'])||{});}})[_0x1880('0x24')](respondWithResult(_0x4133fb,null))[_0x1880('0x41')](handleError(_0x4133fb,null));};exports['getActions']=function(_0x48f19a,_0xb352e3,_0x160f1c){var _0x3ba3ec={};var _0x117adf={};var _0x2ef7dc;var _0x22ef95;return db[_0x1880('0x2b')][_0x1880('0x49')]({'where':{'id':_0x48f19a[_0x1880('0x43')]['id']}})['then'](handleEntityNotFound(_0xb352e3,null))[_0x1880('0x24')](function(_0x46a738){if(_0x46a738){_0x2ef7dc=_0x46a738;_0x117adf[_0x1880('0x32')]=_[_0x1880('0x44')](db['Action'][_0x1880('0x2c')]);_0x117adf[_0x1880('0x30')]=_[_0x1880('0x44')](_0x48f19a[_0x1880('0x30')]);_0x117adf[_0x1880('0x3a')]=_['intersection'](_0x117adf[_0x1880('0x32')],_0x117adf[_0x1880('0x30')]);_0x3ba3ec[_0x1880('0x33')]=_[_0x1880('0x31')](_0x117adf['model'],qs[_0x1880('0x34')](_0x48f19a[_0x1880('0x30')][_0x1880('0x34')]));_0x3ba3ec[_0x1880('0x33')]=_0x3ba3ec[_0x1880('0x33')]['length']?_0x3ba3ec[_0x1880('0x33')]:_0x117adf[_0x1880('0x32')];_0x3ba3ec[_0x1880('0x4b')]=qs['sort'](_0x48f19a[_0x1880('0x30')][_0x1880('0x37')]);_0x3ba3ec[_0x1880('0x38')]=qs['filters'](_[_0x1880('0x39')](_0x48f19a[_0x1880('0x30')],_0x117adf[_0x1880('0x3a')]));if(_0x48f19a[_0x1880('0x30')]['filter']){_0x3ba3ec[_0x1880('0x38')]=_['merge'](_0x3ba3ec[_0x1880('0x38')],{'$or':_['map'](_0x3ba3ec[_0x1880('0x33')],function(_0x198a29){var _0x52ff96={};_0x52ff96[_0x198a29]={'$like':'%'+_0x48f19a['query'][_0x1880('0x3b')]+'%'};return _0x52ff96;})});}_0x3ba3ec=_[_0x1880('0x3c')]({},_0x3ba3ec,_0x48f19a[_0x1880('0x4c')]);return _0x2ef7dc[_0x1880('0x53')](_0x3ba3ec);}})[_0x1880('0x24')](function(_0x125091){if(_0x125091){_0x22ef95=_0x125091[_0x1880('0x35')];if(!_0x48f19a['query'][_0x1880('0x36')]('nolimit')){_0x3ba3ec['limit']=qs[_0x1880('0x21')](_0x48f19a[_0x1880('0x30')][_0x1880('0x21')]);_0x3ba3ec[_0x1880('0x1e')]=qs[_0x1880('0x1e')](_0x48f19a['query'][_0x1880('0x1e')]);}return _0x2ef7dc['getActions'](_0x3ba3ec);}})[_0x1880('0x24')](function(_0x216625){if(_0x216625){return _0x216625?{'count':_0x22ef95,'rows':_0x216625}:null;}})[_0x1880('0x24')](respondWithResult(_0xb352e3,null))[_0x1880('0x41')](handleError(_0xb352e3,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 66d1cdc..ad879ec 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 _0xe57d=['util','api','moment','bluebird','path','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe57d,0x18c));var _0xde57=function(_0x350086,_0x4c6fb6){_0x350086=_0x350086-0x0;var _0x29e709=_0xe57d[_0x350086];return _0x29e709;};'use strict';var _=require('lodash');var util=require(_0xde57('0x0'));var logger=require('../../config/logger')(_0xde57('0x1'));var moment=require(_0xde57('0x2'));var BPromise=require(_0xde57('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xde57('0x4'));var rimraf=require(_0xde57('0x5'));var config=require(_0xde57('0x6'));var attributes=require(_0xde57('0x7'));module[_0xde57('0x8')]=function(_0x5e0a42,_0x257b7b){return _0x5e0a42[_0xde57('0x9')](_0xde57('0xa'),attributes,{'tableName':_0xde57('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x49de=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./automation.attributes','exports','define'];(function(_0x312caa,_0x137ae1){var _0x5eaff4=function(_0x4a228d){while(--_0x4a228d){_0x312caa['push'](_0x312caa['shift']());}};_0x5eaff4(++_0x137ae1);}(_0x49de,0x176));var _0xe49d=function(_0x2fef36,_0x2d9657){_0x2fef36=_0x2fef36-0x0;var _0x36cb38=_0x49de[_0x2fef36];return _0x36cb38;};'use strict';var _=require(_0xe49d('0x0'));var util=require(_0xe49d('0x1'));var logger=require(_0xe49d('0x2'))('api');var moment=require(_0xe49d('0x3'));var BPromise=require(_0xe49d('0x4'));var rp=require(_0xe49d('0x5'));var fs=require('fs');var path=require(_0xe49d('0x6'));var rimraf=require(_0xe49d('0x7'));var config=require('../../config/environment');var attributes=require(_0xe49d('0x8'));module[_0xe49d('0x9')]=function(_0x4cb65e,_0x4d3fdb){return _0x4cb65e[_0xe49d('0xa')]('Automation',attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index 0c0bebe..bf4eb4a 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 _0xc7da=['request','then','info','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc7da,0xf2));var _0xac7d=function(_0x2c5bc1,_0x32f0b8){_0x2c5bc1=_0x2c5bc1-0x0;var _0x121145=_0xc7da[_0x2c5bc1];return _0x121145;};'use strict';var _=require(_0xac7d('0x0'));var util=require(_0xac7d('0x1'));var moment=require(_0xac7d('0x2'));var BPromise=require('bluebird');var rs=require(_0xac7d('0x3'));var fs=require('fs');var Redis=require(_0xac7d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xac7d('0x5'));var logger=require(_0xac7d('0x6'))('rpc');var config=require(_0xac7d('0x7'));var jayson=require(_0xac7d('0x8'));var client=jayson[_0xac7d('0x9')][_0xac7d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x268265,_0x153ce5,_0x48ca59){return new BPromise(function(_0x44eb2b,_0x457e2d){return client[_0xac7d('0xb')](_0x268265,_0x48ca59)[_0xac7d('0xc')](function(_0x217811){logger[_0xac7d('0xd')](_0xac7d('0xe'),_0x153ce5,'request\x20sent');logger[_0xac7d('0xf')](_0xac7d('0x10'),_0x153ce5,_0xac7d('0x11'),JSON['stringify'](_0x217811));if(_0x217811[_0xac7d('0x12')]){if(_0x217811[_0xac7d('0x12')][_0xac7d('0x13')]===0x1f4){logger[_0xac7d('0x12')]('Automation,\x20%s,\x20%s',_0x153ce5,_0x217811[_0xac7d('0x12')][_0xac7d('0x14')]);return _0x457e2d(_0x217811[_0xac7d('0x12')][_0xac7d('0x14')]);}logger[_0xac7d('0x12')]('Automation,\x20%s,\x20%s',_0x153ce5,_0x217811[_0xac7d('0x12')]['message']);return _0x44eb2b(_0x217811[_0xac7d('0x12')][_0xac7d('0x14')]);}else{logger[_0xac7d('0xd')](_0xac7d('0xe'),_0x153ce5,'request\x20sent');_0x44eb2b(_0x217811[_0xac7d('0x15')][_0xac7d('0x14')]);}})[_0xac7d('0x16')](function(_0x12813a){logger[_0xac7d('0x12')]('Automation,\x20%s,\x20%s',_0x153ce5,_0x12813a);_0x457e2d(_0x12813a);});});} \ No newline at end of file +var _0x3070=['debug','Automation,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent'];(function(_0x1bdc8a,_0x53ddd8){var _0x26b420=function(_0x14045f){while(--_0x14045f){_0x1bdc8a['push'](_0x1bdc8a['shift']());}};_0x26b420(++_0x53ddd8);}(_0x3070,0x75));var _0x0307=function(_0x29bacf,_0x24c920){_0x29bacf=_0x29bacf-0x0;var _0x310c5f=_0x3070[_0x29bacf];return _0x310c5f;};'use strict';var _=require('lodash');var util=require(_0x0307('0x0'));var moment=require('moment');var BPromise=require(_0x0307('0x1'));var rs=require(_0x0307('0x2'));var fs=require('fs');var Redis=require(_0x0307('0x3'));var db=require(_0x0307('0x4'))['db'];var utils=require(_0x0307('0x5'));var logger=require(_0x0307('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0307('0x7'));var client=jayson[_0x0307('0x8')][_0x0307('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc1dc51,_0x4fbe3e,_0x3ecfb6){return new BPromise(function(_0x41e638,_0x53e6b7){return client[_0x0307('0xa')](_0xc1dc51,_0x3ecfb6)[_0x0307('0xb')](function(_0x187fb3){logger[_0x0307('0xc')](_0x0307('0xd'),_0x4fbe3e,_0x0307('0xe'));logger[_0x0307('0xf')](_0x0307('0x10'),_0x4fbe3e,_0x0307('0xe'),JSON['stringify'](_0x187fb3));if(_0x187fb3[_0x0307('0x11')]){if(_0x187fb3['error'][_0x0307('0x12')]===0x1f4){logger[_0x0307('0x11')](_0x0307('0xd'),_0x4fbe3e,_0x187fb3[_0x0307('0x11')][_0x0307('0x13')]);return _0x53e6b7(_0x187fb3[_0x0307('0x11')][_0x0307('0x13')]);}logger[_0x0307('0x11')](_0x0307('0xd'),_0x4fbe3e,_0x187fb3[_0x0307('0x11')][_0x0307('0x13')]);return _0x41e638(_0x187fb3[_0x0307('0x11')][_0x0307('0x13')]);}else{logger[_0x0307('0xc')](_0x0307('0xd'),_0x4fbe3e,'request\x20sent');_0x41e638(_0x187fb3[_0x0307('0x14')][_0x0307('0x13')]);}})[_0x0307('0x15')](function(_0x5f11a5){logger['error'](_0x0307('0xd'),_0x4fbe3e,_0x5f11a5);_0x53e6b7(_0x5f11a5);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index d2a020c..a541d8c 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 _0xfd2f=['multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./automation.controller','get','/:id','show','isAuthenticated','getConditions','/:id/actions','getActions','post','/:id/conditions','addConditions','update','delete','destroy','exports'];(function(_0x4256aa,_0x1c73a3){var _0x53de4c=function(_0xe9f2eb){while(--_0xe9f2eb){_0x4256aa['push'](_0x4256aa['shift']());}};_0x53de4c(++_0x1c73a3);}(_0xfd2f,0x14a));var _0xffd2=function(_0x1b33d9,_0x18de98){_0x1b33d9=_0x1b33d9-0x0;var _0x142ee5=_0xfd2f[_0x1b33d9];return _0x142ee5;};'use strict';var multer=require(_0xffd2('0x0'));var util=require(_0xffd2('0x1'));var path=require(_0xffd2('0x2'));var timeout=require('connect-timeout');var express=require(_0xffd2('0x3'));var router=express['Router']();var fs_extra=require(_0xffd2('0x4'));var auth=require(_0xffd2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xffd2('0x6'));var controller=require(_0xffd2('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xffd2('0x8')](_0xffd2('0x9'),auth['isAuthenticated'](),controller[_0xffd2('0xa')]);router['get']('/:id/conditions',auth[_0xffd2('0xb')](),controller[_0xffd2('0xc')]);router[_0xffd2('0x8')](_0xffd2('0xd'),auth['isAuthenticated'](),controller[_0xffd2('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xffd2('0xf')](_0xffd2('0x10'),auth[_0xffd2('0xb')](),controller[_0xffd2('0x11')]);router[_0xffd2('0xf')](_0xffd2('0xd'),auth[_0xffd2('0xb')](),controller['addActions']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xffd2('0x12')]);router[_0xffd2('0x13')]('/:id',auth[_0xffd2('0xb')](),controller[_0xffd2('0x14')]);module[_0xffd2('0x15')]=router; \ No newline at end of file +var _0x57cf=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','/:id/conditions','/:id/actions','getActions','create','post','addActions','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x1e9e6a,_0x3b4865){var _0x222046=function(_0x4db175){while(--_0x4db175){_0x1e9e6a['push'](_0x1e9e6a['shift']());}};_0x222046(++_0x3b4865);}(_0x57cf,0x11b));var _0xf57c=function(_0xa4b8e1,_0x49d30b){_0xa4b8e1=_0xa4b8e1-0x0;var _0x507e42=_0x57cf[_0xa4b8e1];return _0x507e42;};'use strict';var multer=require(_0xf57c('0x0'));var util=require(_0xf57c('0x1'));var path=require(_0xf57c('0x2'));var timeout=require(_0xf57c('0x3'));var express=require(_0xf57c('0x4'));var router=express[_0xf57c('0x5')]();var fs_extra=require(_0xf57c('0x6'));var auth=require(_0xf57c('0x7'));var interaction=require(_0xf57c('0x8'));var config=require(_0xf57c('0x9'));var controller=require('./automation.controller');router[_0xf57c('0xa')]('/',auth['isAuthenticated'](),controller[_0xf57c('0xb')]);router['get']('/:id',auth[_0xf57c('0xc')](),controller['show']);router[_0xf57c('0xa')](_0xf57c('0xd'),auth['isAuthenticated'](),controller['getConditions']);router[_0xf57c('0xa')](_0xf57c('0xe'),auth[_0xf57c('0xc')](),controller[_0xf57c('0xf')]);router['post']('/',auth[_0xf57c('0xc')](),controller[_0xf57c('0x10')]);router[_0xf57c('0x11')]('/:id/conditions',auth[_0xf57c('0xc')](),controller['addConditions']);router[_0xf57c('0x11')](_0xf57c('0xe'),auth['isAuthenticated'](),controller[_0xf57c('0x12')]);router['put'](_0xf57c('0x13'),auth['isAuthenticated'](),controller[_0xf57c('0x14')]);router[_0xf57c('0x15')](_0xf57c('0x13'),auth[_0xf57c('0xc')](),controller[_0xf57c('0x16')]);module[_0xf57c('0x17')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 759091f..baa54e0 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 _0x6496=['#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)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','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)','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x2bdf6a,_0x1c924b){var _0x1726c7=function(_0x31493f){while(--_0x31493f){_0x2bdf6a['push'](_0x2bdf6a['shift']());}};_0x1726c7(++_0x1c924b);}(_0x6496,0xa3));var _0x6649=function(_0x5cb71a,_0x263bdf){_0x5cb71a=_0x5cb71a-0x0;var _0x3f380f=_0x6496[_0x5cb71a];return _0x3f380f;};'use strict';var Sequelize=require('sequelize');module[_0x6649('0x0')]={'name':{'type':Sequelize[_0x6649('0x1')],'unique':_0x6649('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x6649('0x3')](_0x6649('0x4')),'allowNull':![],'defaultValue':_0x6649('0x4')},'description':{'type':Sequelize[_0x6649('0x1')]},'active':{'type':Sequelize[_0x6649('0x5')],'defaultValue':0x0,'comment':_0x6649('0x6')},'limitCalls':{'type':Sequelize[_0x6649('0x7')](0x4)[_0x6649('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x6649('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x6649('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x6649('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x6649('0x7')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x6649('0x7')](0x3)[_0x6649('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6649('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x6649('0x7')](0x5)[_0x6649('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6649('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x6649('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6649('0xc')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6649('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x6649('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x6649('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x6649('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6649('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0x6649('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x6649('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x6649('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x6649('0x3')](_0x6649('0x11'),_0x6649('0x12'),_0x6649('0x13')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x6649('0x14')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x6649('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x6649('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x6649('0x7')](0x9)[_0x6649('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x6649('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x6649('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x6649('0x7')](0x9)[_0x6649('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x6649('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x6649('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x6649('0x7')](0x9)[_0x6649('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x6649('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x6649('0x7')](0x9)[_0x6649('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x6649('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x6649('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x6649('0x3')](_0x6649('0x19'),_0x6649('0x1a')),'defaultValue':_0x6649('0x19')},'dialPrefix':{'type':Sequelize[_0x6649('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x6649('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x6649('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x6649('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x6649('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6649('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x6649('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x6649('0x7')](0x3)[_0x6649('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6649('0x1d')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x6649('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x6649('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6649('0x1e')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x6649('0x7')](0x5)[_0x6649('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6649('0x1f')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x6649('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6649('0x20')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x6649('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6649('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x6649('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x6649('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6649('0x22')}}; \ No newline at end of file +var _0x90d2=['INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#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)','exports','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign'];(function(_0x197fdd,_0x48aac0){var _0x501ce8=function(_0x2bcf49){while(--_0x2bcf49){_0x197fdd['push'](_0x197fdd['shift']());}};_0x501ce8(++_0x48aac0);}(_0x90d2,0x1aa));var _0x290d=function(_0x26546a,_0x809188){_0x26546a=_0x26546a-0x0;var _0x5689d8=_0x90d2[_0x26546a];return _0x5689d8;};'use strict';var Sequelize=require('sequelize');module[_0x290d('0x0')]={'name':{'type':Sequelize[_0x290d('0x1')],'unique':_0x290d('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x290d('0x3')),'allowNull':![],'defaultValue':_0x290d('0x3')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x290d('0x4')],'defaultValue':0x0,'comment':_0x290d('0x5')},'limitCalls':{'type':Sequelize[_0x290d('0x6')](0x4)[_0x290d('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x290d('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x290d('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0x290d('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x290d('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x290d('0x6')](0x5)[_0x290d('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x290d('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x290d('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x290d('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x290d('0x6')](0x5)[_0x290d('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x290d('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x290d('0x6')](0x3)[_0x290d('0x7')],'defaultValue':0x3,'comment':_0x290d('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x290d('0x6')](0x5)[_0x290d('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x290d('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x290d('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x290d('0xf')},'dialTimezone':{'type':Sequelize[_0x290d('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x290d('0x1')],'defaultValue':_0x290d('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x290d('0x11')](_0x290d('0x12'),'never',_0x290d('0x13')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x290d('0x4')],'defaultValue':0x0,'comment':_0x290d('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0x290d('0x6')](0x9)[_0x290d('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x290d('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x290d('0x6')](0x9)[_0x290d('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x290d('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x290d('0x6')](0x9)[_0x290d('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x290d('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x290d('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x290d('0x6')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x290d('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x290d('0x6')](0x9)[_0x290d('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x290d('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x290d('0x6')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x290d('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x290d('0x6')](0x9)[_0x290d('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x290d('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0x290d('0x11')]('DESC','ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x290d('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x290d('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x290d('0x6')](0x3)[_0x290d('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x290d('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x290d('0x6')](0x3)[_0x290d('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x290d('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x290d('0x6')](0x5)[_0x290d('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x290d('0x6')](0x3)[_0x290d('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x290d('0x1e')},'dialDropRetryFrequency':{'type':Sequelize[_0x290d('0x6')](0x5)[_0x290d('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x290d('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x290d('0x6')](0x3)[_0x290d('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x290d('0x6')](0x5)[_0x290d('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x290d('0x6')](0x3)[_0x290d('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x290d('0x20')},'dialMachineRetryFrequency':{'type':Sequelize[_0x290d('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x290d('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x290d('0x6')](0x3)[_0x290d('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x290d('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x290d('0x6')](0x5)[_0x290d('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x290d('0x23')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 65d4e89..32bcaf2 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 _0x5987=['select','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','scheduledAt','ListId\x20=\x20?','cm_hopper_additional_phones','cmHopperId','OrderBy','ci.item','ci.OrderBY','h.ContactId\x20=\x20ci.CmContactId','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','Content-Range','json','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','index','Campaign','fieldName','type','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','sort','where','filter','merge','includeAll','include','findAll','rows','show','rawAttributes','options','find','catch','create','user','UserProfileSection','autoAssociation','params','omit','createdAt','body','updatedAt','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','CmHopper','pick','CmHopperHistory','order','CampaignId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId'];(function(_0x5c3619,_0x5cf728){var _0x24a2da=function(_0x4d14a9){while(--_0x4d14a9){_0x5c3619['push'](_0x5c3619['shift']());}};_0x24a2da(++_0x5cf728);}(_0x5987,0x128));var _0x7598=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x5987[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0x7598('0x0'));var rimraf=require(_0x7598('0x1'));var zipdir=require(_0x7598('0x2'));var jsonpatch=require(_0x7598('0x3'));var rp=require('request-promise');var moment=require(_0x7598('0x4'));var BPromise=require(_0x7598('0x5'));var Mustache=require(_0x7598('0x6'));var util=require(_0x7598('0x7'));var path=require(_0x7598('0x8'));var sox=require(_0x7598('0x9'));var csv=require(_0x7598('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7598('0xb'));var _=require('lodash');var squel=require(_0x7598('0xc'));var crypto=require(_0x7598('0xd'));var jsforce=require(_0x7598('0xe'));var deskjs=require(_0x7598('0xf'));var toCsv=require(_0x7598('0xa'));var querystring=require(_0x7598('0x10'));var Papa=require(_0x7598('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7598('0x12'));var hardwareService=require(_0x7598('0x13'));var logger=require(_0x7598('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x7598('0x15'));var licenseUtil=require(_0x7598('0x16'));var db=require(_0x7598('0x17'))['db'];function respondWithStatusCode(_0x1a92e9,_0x22cc20){_0x22cc20=_0x22cc20||0xcc;return function(_0x52bc43){if(_0x52bc43){return _0x1a92e9[_0x7598('0x18')](_0x22cc20);}return _0x1a92e9['status'](_0x22cc20)['end']();};}function respondWithResult(_0x3773cd,_0x16527e){_0x16527e=_0x16527e||0xc8;return function(_0x1608b8){if(_0x1608b8){return _0x3773cd[_0x7598('0x19')](_0x16527e)['json'](_0x1608b8);}};}function respondWithFilteredResult(_0x388b3f,_0x3d80be){return function(_0x353d18){if(_0x353d18){var _0x3282de=typeof _0x3d80be['offset']===_0x7598('0x1a')&&typeof _0x3d80be[_0x7598('0x1b')]===_0x7598('0x1a');var _0x1360bb=_0x353d18[_0x7598('0x1c')];var _0x2a62ed=_0x3282de?0x0:_0x3d80be['offset'];var _0x817355=_0x3282de?_0x353d18[_0x7598('0x1c')]:_0x3d80be['offset']+_0x3d80be[_0x7598('0x1b')];var _0x2bc78d;if(_0x817355>=_0x1360bb){_0x817355=_0x1360bb;_0x2bc78d=0xc8;}else{_0x2bc78d=0xce;}_0x388b3f['status'](_0x2bc78d);return _0x388b3f['set'](_0x7598('0x1d'),_0x2a62ed+'-'+_0x817355+'/'+_0x1360bb)[_0x7598('0x1e')](_0x353d18);}return null;};}function patchUpdates(_0x1ae307){return function(_0x42286f){try{jsonpatch[_0x7598('0x1f')](_0x42286f,_0x1ae307,!![]);}catch(_0x5902a9){return BPromise[_0x7598('0x20')](_0x5902a9);}return _0x42286f[_0x7598('0x21')]();};}function saveUpdates(_0x1d6e1b,_0x87e713){return function(_0xb76cfc){if(_0xb76cfc){return _0xb76cfc['update'](_0x1d6e1b)[_0x7598('0x22')](function(_0x3d7ff0){return _0x3d7ff0;});}return null;};}function removeEntity(_0x3ec8b1,_0x453901){return function(_0x384d1d){if(_0x384d1d){return _0x384d1d[_0x7598('0x23')]()['then'](function(){var _0x4bfac0=_0x384d1d[_0x7598('0x24')]({'plain':!![]});var _0x5b4d1c='IvrCampaigns';return db[_0x7598('0x25')][_0x7598('0x23')]({'where':{'type':_0x5b4d1c,'resourceId':_0x4bfac0['id']}})[_0x7598('0x22')](function(){return _0x384d1d;});})['then'](function(){_0x3ec8b1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x9402c7,_0x136d49){return function(_0x2c914c){if(!_0x2c914c){_0x9402c7[_0x7598('0x18')](0x194);}return _0x2c914c;};}function handleError(_0x14ab59,_0x36733a){_0x36733a=_0x36733a||0x1f4;return function(_0x2d36fc){logger[_0x7598('0x26')](_0x2d36fc[_0x7598('0x27')]);if(_0x2d36fc[_0x7598('0x28')]){delete _0x2d36fc['name'];}_0x14ab59['status'](_0x36733a)['send'](_0x2d36fc);};}exports[_0x7598('0x29')]=function(_0x15107d,_0x386ae4){var _0x1654f7={},_0x519e9b={},_0x1d9661={'count':0x0,'rows':[]};var _0x3bd86b=_['map'](db[_0x7598('0x2a')]['rawAttributes'],function(_0x23e126){return{'name':_0x23e126[_0x7598('0x2b')],'type':_0x23e126[_0x7598('0x2c')]['key']};});_0x519e9b['model']=_[_0x7598('0x2d')](_0x3bd86b,'name');_0x519e9b[_0x7598('0x2e')]=_[_0x7598('0x2f')](_0x15107d[_0x7598('0x2e')]);_0x519e9b[_0x7598('0x30')]=_['intersection'](_0x519e9b[_0x7598('0x31')],_0x519e9b[_0x7598('0x2e')]);_0x1654f7[_0x7598('0x32')]=_[_0x7598('0x33')](_0x519e9b[_0x7598('0x31')],qs[_0x7598('0x34')](_0x15107d[_0x7598('0x2e')][_0x7598('0x34')]));_0x1654f7[_0x7598('0x32')]=_0x1654f7['attributes'][_0x7598('0x35')]?_0x1654f7['attributes']:_0x519e9b[_0x7598('0x31')];if(!_0x15107d[_0x7598('0x2e')][_0x7598('0x36')](_0x7598('0x37'))){_0x1654f7[_0x7598('0x1b')]=qs[_0x7598('0x1b')](_0x15107d[_0x7598('0x2e')][_0x7598('0x1b')]);_0x1654f7['offset']=qs['offset'](_0x15107d[_0x7598('0x2e')][_0x7598('0x38')]);}_0x1654f7['order']=qs['sort'](_0x15107d['query'][_0x7598('0x39')]);_0x1654f7[_0x7598('0x3a')]=qs['filters'](_['pick'](_0x15107d[_0x7598('0x2e')],_0x519e9b[_0x7598('0x30')]),_0x3bd86b);if(_0x15107d[_0x7598('0x2e')][_0x7598('0x3b')]){_0x1654f7[_0x7598('0x3a')]=_[_0x7598('0x3c')](_0x1654f7[_0x7598('0x3a')],{'$or':_['map'](_0x3bd86b,function(_0x118bb2){if(_0x118bb2['type']!=='VIRTUAL'){var _0x6308fe={};_0x6308fe[_0x118bb2[_0x7598('0x28')]]={'$like':'%'+_0x15107d[_0x7598('0x2e')]['filter']+'%'};return _0x6308fe;}})});}_0x1654f7=_[_0x7598('0x3c')]({},_0x1654f7,_0x15107d['options']);var _0x42c5a6={'where':_0x1654f7[_0x7598('0x3a')]};return db['Campaign'][_0x7598('0x1c')](_0x42c5a6)[_0x7598('0x22')](function(_0x1ca78c){_0x1d9661['count']=_0x1ca78c;if(_0x15107d[_0x7598('0x2e')][_0x7598('0x3d')]){_0x1654f7[_0x7598('0x3e')]=[{'all':!![]}];}return db[_0x7598('0x2a')][_0x7598('0x3f')](_0x1654f7);})[_0x7598('0x22')](function(_0x102b91){_0x1d9661[_0x7598('0x40')]=_0x102b91;return _0x1d9661;})[_0x7598('0x22')](respondWithFilteredResult(_0x386ae4,_0x1654f7))['catch'](handleError(_0x386ae4,null));};exports[_0x7598('0x41')]=function(_0x553689,_0x14d6d1){var _0x456a24={'raw':![],'where':{'id':_0x553689['params']['id']}},_0x292dca={};_0x292dca[_0x7598('0x31')]=_['keys'](db[_0x7598('0x2a')][_0x7598('0x42')]);_0x292dca[_0x7598('0x2e')]=_[_0x7598('0x2f')](_0x553689[_0x7598('0x2e')]);_0x292dca['filters']=_['intersection'](_0x292dca[_0x7598('0x31')],_0x292dca[_0x7598('0x2e')]);_0x456a24[_0x7598('0x32')]=_[_0x7598('0x33')](_0x292dca['model'],qs[_0x7598('0x34')](_0x553689['query']['fields']));_0x456a24[_0x7598('0x32')]=_0x456a24[_0x7598('0x32')][_0x7598('0x35')]?_0x456a24[_0x7598('0x32')]:_0x292dca['model'];if(_0x553689[_0x7598('0x2e')][_0x7598('0x3d')]){_0x456a24[_0x7598('0x3e')]=[{'all':!![]}];}_0x456a24=_[_0x7598('0x3c')]({},_0x456a24,_0x553689[_0x7598('0x43')]);return db[_0x7598('0x2a')][_0x7598('0x44')](_0x456a24)[_0x7598('0x22')](handleEntityNotFound(_0x14d6d1,null))[_0x7598('0x22')](respondWithResult(_0x14d6d1,null))[_0x7598('0x45')](handleError(_0x14d6d1,null));};exports[_0x7598('0x46')]=function(_0x2efa18,_0x12c6a6){return db['Campaign']['create'](_0x2efa18['body'],{})[_0x7598('0x22')](function(_0x1fae29){var _0x13da32=_0x2efa18[_0x7598('0x47')][_0x7598('0x24')]({'plain':!![]});if(!_0x13da32)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x13da32['role']===_0x7598('0x47')){var _0x33a6a5=_0x1fae29['get']({'plain':!![]});var _0x47cb9d='IvrCampaigns';return db[_0x7598('0x48')]['find']({'where':{'name':_0x47cb9d,'userProfileId':_0x13da32['userProfileId']},'raw':!![]})[_0x7598('0x22')](function(_0x2a5532){if(_0x2a5532&&_0x2a5532[_0x7598('0x49')]===0x0){return db['UserProfileResource']['create']({'name':_0x33a6a5[_0x7598('0x28')],'resourceId':_0x33a6a5['id'],'type':_0x2a5532[_0x7598('0x28')],'sectionId':_0x2a5532['id']},{})[_0x7598('0x22')](function(){return _0x1fae29;});}else{return _0x1fae29;}})['catch'](function(_0x1ce912){logger[_0x7598('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1ce912);throw _0x1ce912;});}return _0x1fae29;})[_0x7598('0x22')](respondWithResult(_0x12c6a6,0xc9))[_0x7598('0x45')](handleError(_0x12c6a6,null));};exports['clone']=function(_0x570d3d,_0x357921){var _0x42486a={'where':{'id':_0x570d3d[_0x7598('0x4a')]['id']}},_0x3891fb={};_0x3891fb['model']=_[_0x7598('0x2f')](db[_0x7598('0x2a')][_0x7598('0x42')]);_0x42486a[_0x7598('0x32')]=_[_0x7598('0x33')](_0x3891fb[_0x7598('0x31')],qs[_0x7598('0x34')](_0x570d3d[_0x7598('0x2e')]['fields']));_0x42486a[_0x7598('0x32')]=_0x42486a['attributes'][_0x7598('0x35')]?_0x42486a[_0x7598('0x32')]:_0x3891fb[_0x7598('0x31')];if(_0x570d3d[_0x7598('0x2e')]['includeAll']){_0x42486a[_0x7598('0x3e')]=[{'all':!![]}];}_0x42486a=_['merge']({},_0x42486a,_0x570d3d['options']);return db[_0x7598('0x2a')][_0x7598('0x44')](_0x42486a)[_0x7598('0x22')](handleEntityNotFound(_0x357921,null))[_0x7598('0x22')](function(_0xfe8ab9){if(_0xfe8ab9){var _0x3f29fc=_0xfe8ab9[_0x7598('0x24')]({'plain':!![]});_0x3f29fc=qs[_0x7598('0x4b')](_0x3f29fc,['id',_0x7598('0x4c'),'updatedAt']);_0x570d3d['body']=_[_0x7598('0x4b')](_0x570d3d[_0x7598('0x4d')],['id',_0x7598('0x4c'),_0x7598('0x4e')]);return db['Campaign'][_0x7598('0x46')](_[_0x7598('0x3c')](_0x3f29fc,_0x570d3d[_0x7598('0x4d')]),{'include':_0x570d3d[_0x7598('0x2e')]['includeAll']?[{'all':!![]}]:undefined})[_0x7598('0x22')](function(_0x2ee0b9){var _0x5e732a=_0x570d3d['user'][_0x7598('0x24')]({'plain':!![]});if(!_0x5e732a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5e732a[_0x7598('0x4f')]===_0x7598('0x47')){var _0x4d5e05=_0x2ee0b9['get']({'plain':!![]});var _0x4d130c='IvrCampaigns';return db[_0x7598('0x48')][_0x7598('0x44')]({'where':{'name':_0x4d130c,'userProfileId':_0x5e732a['userProfileId']},'raw':!![]})['then'](function(_0xc03282){if(_0xc03282&&_0xc03282[_0x7598('0x49')]===0x0){return db[_0x7598('0x25')]['create']({'name':_0x4d5e05[_0x7598('0x28')],'resourceId':_0x4d5e05['id'],'type':_0xc03282[_0x7598('0x28')],'sectionId':_0xc03282['id']},{})['then'](function(){return _0x2ee0b9;});}else{return _0x2ee0b9;}})[_0x7598('0x45')](function(_0x3a26a7){logger[_0x7598('0x26')](_0x7598('0x50'),_0x3a26a7);throw _0x3a26a7;});}return _0x2ee0b9;});}})[_0x7598('0x22')](respondWithResult(_0x357921,0xc9))[_0x7598('0x45')](handleError(_0x357921,null));};exports['update']=function(_0x5d1ffa,_0x41e2fb){if(_0x5d1ffa[_0x7598('0x4d')]['id']){delete _0x5d1ffa[_0x7598('0x4d')]['id'];}return db['Campaign'][_0x7598('0x44')]({'where':{'id':_0x5d1ffa[_0x7598('0x4a')]['id']}})['then'](handleEntityNotFound(_0x41e2fb,null))[_0x7598('0x22')](saveUpdates(_0x5d1ffa[_0x7598('0x4d')],null))[_0x7598('0x22')](respondWithResult(_0x41e2fb,null))[_0x7598('0x45')](handleError(_0x41e2fb,null));};exports['destroy']=function(_0x14467e,_0x46617b){return db[_0x7598('0x2a')][_0x7598('0x44')]({'where':{'id':_0x14467e[_0x7598('0x4a')]['id']}})['then'](handleEntityNotFound(_0x46617b,null))[_0x7598('0x22')](removeEntity(_0x46617b,null))['catch'](handleError(_0x46617b,null));};exports['getHoppers']=function(_0x32ed35,_0x182a26,_0x28d96b){var _0x2b729a={'raw':!![],'where':{}};var _0x57c598={};var _0x132f3b={'count':0x0,'rows':[]};return db[_0x7598('0x2a')][_0x7598('0x51')]({'where':{'id':_0x32ed35[_0x7598('0x4a')]['id']}})[_0x7598('0x22')](handleEntityNotFound(_0x182a26,null))[_0x7598('0x22')](function(_0x5d3f49){if(_0x5d3f49){_0x57c598['model']=_[_0x7598('0x2f')](db[_0x7598('0x52')][_0x7598('0x42')]);_0x57c598['query']=_[_0x7598('0x2f')](_0x32ed35['query']);_0x57c598[_0x7598('0x30')]=_[_0x7598('0x33')](_0x57c598[_0x7598('0x31')],_0x57c598[_0x7598('0x2e')]);_0x2b729a[_0x7598('0x32')]=_[_0x7598('0x33')](_0x57c598[_0x7598('0x31')],qs[_0x7598('0x34')](_0x32ed35['query'][_0x7598('0x34')]));_0x2b729a[_0x7598('0x32')]=_0x2b729a[_0x7598('0x32')][_0x7598('0x35')]?_0x2b729a[_0x7598('0x32')]:_0x57c598[_0x7598('0x31')];if(!_0x32ed35[_0x7598('0x2e')][_0x7598('0x36')]('nolimit')){_0x2b729a[_0x7598('0x1b')]=qs['limit'](_0x32ed35[_0x7598('0x2e')][_0x7598('0x1b')]);_0x2b729a['offset']=qs[_0x7598('0x38')](_0x32ed35[_0x7598('0x2e')]['offset']);}_0x2b729a['order']=qs[_0x7598('0x39')](_0x32ed35['query']['sort']);_0x2b729a[_0x7598('0x3a')]=qs['filters'](_[_0x7598('0x53')](_0x32ed35[_0x7598('0x2e')],_0x57c598[_0x7598('0x30')]));_0x2b729a['where']['CampaignId']=_0x5d3f49['id'];if(_0x32ed35[_0x7598('0x2e')][_0x7598('0x3b')]){_0x2b729a[_0x7598('0x3a')]=_['merge'](_0x2b729a['where'],{'$or':_['map'](_0x2b729a['attributes'],function(_0xf05e17){var _0x1d7413={};_0x1d7413[_0xf05e17]={'$like':'%'+_0x32ed35[_0x7598('0x2e')][_0x7598('0x3b')]+'%'};return _0x1d7413;})});}_0x2b729a=_['merge']({},_0x2b729a,_0x32ed35[_0x7598('0x43')]);return db[_0x7598('0x52')]['count']({'where':_0x2b729a[_0x7598('0x3a')]})[_0x7598('0x22')](function(_0x4191dd){_0x132f3b['count']=_0x4191dd;if(_0x32ed35[_0x7598('0x2e')]['includeAll']){_0x2b729a[_0x7598('0x3e')]=[{'all':!![]}];}return db[_0x7598('0x52')]['findAll'](_0x2b729a);})['then'](function(_0x12c235){_0x132f3b[_0x7598('0x40')]=_0x12c235;return _0x132f3b;});}})['then'](respondWithFilteredResult(_0x182a26,_0x2b729a))[_0x7598('0x45')](handleError(_0x182a26,null));};exports['getHopperHistories']=function(_0x5abcf3,_0x25e149,_0x3b286f){var _0x868882={'raw':!![],'where':{}};var _0x165391={};var _0x8af083={'count':0x0,'rows':[]};return db[_0x7598('0x2a')][_0x7598('0x51')]({'where':{'id':_0x5abcf3[_0x7598('0x4a')]['id']}})[_0x7598('0x22')](handleEntityNotFound(_0x25e149,null))[_0x7598('0x22')](function(_0x99d323){if(_0x99d323){_0x165391['model']=_[_0x7598('0x2f')](db[_0x7598('0x54')][_0x7598('0x42')]);_0x165391['query']=_[_0x7598('0x2f')](_0x5abcf3[_0x7598('0x2e')]);_0x165391['filters']=_[_0x7598('0x33')](_0x165391[_0x7598('0x31')],_0x165391[_0x7598('0x2e')]);_0x868882[_0x7598('0x32')]=_[_0x7598('0x33')](_0x165391[_0x7598('0x31')],qs['fields'](_0x5abcf3[_0x7598('0x2e')][_0x7598('0x34')]));_0x868882[_0x7598('0x32')]=_0x868882['attributes'][_0x7598('0x35')]?_0x868882[_0x7598('0x32')]:_0x165391['model'];if(!_0x5abcf3[_0x7598('0x2e')][_0x7598('0x36')](_0x7598('0x37'))){_0x868882['limit']=qs[_0x7598('0x1b')](_0x5abcf3[_0x7598('0x2e')]['limit']);_0x868882[_0x7598('0x38')]=qs[_0x7598('0x38')](_0x5abcf3[_0x7598('0x2e')][_0x7598('0x38')]);}_0x868882[_0x7598('0x55')]=qs[_0x7598('0x39')](_0x5abcf3['query'][_0x7598('0x39')]);_0x868882['where']=qs[_0x7598('0x30')](_[_0x7598('0x53')](_0x5abcf3['query'],_0x165391['filters']));_0x868882[_0x7598('0x3a')][_0x7598('0x56')]=_0x99d323['id'];if(_0x5abcf3[_0x7598('0x2e')][_0x7598('0x3b')]){_0x868882[_0x7598('0x3a')]=_[_0x7598('0x3c')](_0x868882[_0x7598('0x3a')],{'$or':_[_0x7598('0x2d')](_0x868882['attributes'],function(_0x5b00d3){var _0x50cc05={};_0x50cc05[_0x5b00d3]={'$like':'%'+_0x5abcf3['query'][_0x7598('0x3b')]+'%'};return _0x50cc05;})});}_0x868882=_['merge']({},_0x868882,_0x5abcf3[_0x7598('0x43')]);return db['CmHopperHistory'][_0x7598('0x1c')]({'where':_0x868882[_0x7598('0x3a')]})['then'](function(_0x2442cc){_0x8af083['count']=_0x2442cc;if(_0x5abcf3['query'][_0x7598('0x3d')]){_0x868882[_0x7598('0x3e')]=[{'all':!![]}];}return db[_0x7598('0x54')]['findAll'](_0x868882);})[_0x7598('0x22')](function(_0x3e53fe){_0x8af083[_0x7598('0x40')]=_0x3e53fe;return _0x8af083;});}})[_0x7598('0x22')](respondWithFilteredResult(_0x25e149,_0x868882))[_0x7598('0x45')](handleError(_0x25e149,null));};exports[_0x7598('0x57')]=function(_0x5b99df,_0x58715c,_0x4dd9cc){var _0x1d46ce={'raw':!![],'where':{}};var _0x5e4530={};var _0x292bec={'count':0x0,'rows':[]};return db['Campaign'][_0x7598('0x51')]({'where':{'id':_0x5b99df[_0x7598('0x4a')]['id']}})[_0x7598('0x22')](handleEntityNotFound(_0x58715c,null))['then'](function(_0x595590){if(_0x595590){_0x5e4530[_0x7598('0x31')]=_[_0x7598('0x2f')](db[_0x7598('0x58')][_0x7598('0x42')]);_0x5e4530[_0x7598('0x2e')]=_[_0x7598('0x2f')](_0x5b99df[_0x7598('0x2e')]);_0x5e4530[_0x7598('0x30')]=_[_0x7598('0x33')](_0x5e4530[_0x7598('0x31')],_0x5e4530[_0x7598('0x2e')]);_0x1d46ce[_0x7598('0x32')]=_['intersection'](_0x5e4530[_0x7598('0x31')],qs[_0x7598('0x34')](_0x5b99df[_0x7598('0x2e')][_0x7598('0x34')]));_0x1d46ce[_0x7598('0x32')]=_0x1d46ce['attributes'][_0x7598('0x35')]?_0x1d46ce[_0x7598('0x32')]:_0x5e4530[_0x7598('0x31')];if(!_0x5b99df[_0x7598('0x2e')][_0x7598('0x36')](_0x7598('0x37'))){_0x1d46ce['limit']=qs[_0x7598('0x1b')](_0x5b99df['query']['limit']);_0x1d46ce['offset']=qs[_0x7598('0x38')](_0x5b99df['query'][_0x7598('0x38')]);}_0x1d46ce['order']=qs[_0x7598('0x39')](_0x5b99df['query'][_0x7598('0x39')]);_0x1d46ce['where']=qs[_0x7598('0x30')](_[_0x7598('0x53')](_0x5b99df[_0x7598('0x2e')],_0x5e4530['filters']));_0x1d46ce['where'][_0x7598('0x56')]=_0x595590['id'];if(_0x5b99df[_0x7598('0x2e')][_0x7598('0x3b')]){_0x1d46ce['where']=_[_0x7598('0x3c')](_0x1d46ce[_0x7598('0x3a')],{'$or':_[_0x7598('0x2d')](_0x1d46ce[_0x7598('0x32')],function(_0x865c24){var _0x2cd4df={};_0x2cd4df[_0x865c24]={'$like':'%'+_0x5b99df[_0x7598('0x2e')][_0x7598('0x3b')]+'%'};return _0x2cd4df;})});}_0x1d46ce=_[_0x7598('0x3c')]({},_0x1d46ce,_0x5b99df[_0x7598('0x43')]);return db['CmHopperFinal']['count']({'where':_0x1d46ce['where']})[_0x7598('0x22')](function(_0x1aaaa4){_0x292bec[_0x7598('0x1c')]=_0x1aaaa4;if(_0x5b99df[_0x7598('0x2e')][_0x7598('0x3d')]){_0x1d46ce['include']=[{'all':!![]}];}return db[_0x7598('0x58')][_0x7598('0x3f')](_0x1d46ce);})['then'](function(_0x307823){_0x292bec[_0x7598('0x40')]=_0x307823;return _0x292bec;});}})[_0x7598('0x22')](respondWithFilteredResult(_0x58715c,_0x1d46ce))['catch'](handleError(_0x58715c,null));};exports[_0x7598('0x59')]=function(_0x591aaf,_0x2db7f5,_0x41d817){var _0x2c814b={'raw':!![],'where':{}};var _0x51e7c0={};var _0x43403e={'count':0x0,'rows':[]};return db[_0x7598('0x2a')][_0x7598('0x51')]({'where':{'id':_0x591aaf['params']['id']}})[_0x7598('0x22')](handleEntityNotFound(_0x2db7f5,null))['then'](function(_0x271a56){if(_0x271a56){_0x51e7c0['model']=_[_0x7598('0x2f')](db['CmHopperBlack'][_0x7598('0x42')]);_0x51e7c0[_0x7598('0x2e')]=_[_0x7598('0x2f')](_0x591aaf[_0x7598('0x2e')]);_0x51e7c0[_0x7598('0x30')]=_[_0x7598('0x33')](_0x51e7c0['model'],_0x51e7c0['query']);_0x2c814b[_0x7598('0x32')]=_[_0x7598('0x33')](_0x51e7c0[_0x7598('0x31')],qs[_0x7598('0x34')](_0x591aaf[_0x7598('0x2e')][_0x7598('0x34')]));_0x2c814b[_0x7598('0x32')]=_0x2c814b['attributes'][_0x7598('0x35')]?_0x2c814b['attributes']:_0x51e7c0[_0x7598('0x31')];if(!_0x591aaf['query']['hasOwnProperty'](_0x7598('0x37'))){_0x2c814b['limit']=qs['limit'](_0x591aaf[_0x7598('0x2e')][_0x7598('0x1b')]);_0x2c814b[_0x7598('0x38')]=qs[_0x7598('0x38')](_0x591aaf[_0x7598('0x2e')][_0x7598('0x38')]);}_0x2c814b[_0x7598('0x55')]=qs[_0x7598('0x39')](_0x591aaf[_0x7598('0x2e')][_0x7598('0x39')]);_0x2c814b['where']=qs[_0x7598('0x30')](_['pick'](_0x591aaf['query'],_0x51e7c0[_0x7598('0x30')]));_0x2c814b[_0x7598('0x3a')]['CampaignId']=_0x271a56['id'];if(_0x591aaf[_0x7598('0x2e')][_0x7598('0x3b')]){_0x2c814b[_0x7598('0x3a')]=_[_0x7598('0x3c')](_0x2c814b[_0x7598('0x3a')],{'$or':_[_0x7598('0x2d')](_0x2c814b[_0x7598('0x32')],function(_0x31e529){var _0x34c9b6={};_0x34c9b6[_0x31e529]={'$like':'%'+_0x591aaf[_0x7598('0x2e')][_0x7598('0x3b')]+'%'};return _0x34c9b6;})});}_0x2c814b=_['merge']({},_0x2c814b,_0x591aaf['options']);return db[_0x7598('0x5a')]['count']({'where':_0x2c814b[_0x7598('0x3a')]})[_0x7598('0x22')](function(_0x31b0d4){_0x43403e['count']=_0x31b0d4;if(_0x591aaf[_0x7598('0x2e')][_0x7598('0x3d')]){_0x2c814b[_0x7598('0x3e')]=[{'all':!![]}];}return db[_0x7598('0x5a')]['findAll'](_0x2c814b);})[_0x7598('0x22')](function(_0x44921f){_0x43403e[_0x7598('0x40')]=_0x44921f;return _0x43403e;});}})[_0x7598('0x22')](respondWithFilteredResult(_0x2db7f5,_0x2c814b))[_0x7598('0x45')](handleError(_0x2db7f5,null));};exports[_0x7598('0x5b')]=function(_0x46cd3a,_0x3876e2,_0x46250a){var _0x3302bb={};var _0x526ed8={};var _0x304638;var _0x4e671b;return db[_0x7598('0x2a')][_0x7598('0x51')]({'where':{'id':_0x46cd3a[_0x7598('0x4a')]['id']}})[_0x7598('0x22')](handleEntityNotFound(_0x3876e2,null))['then'](function(_0x249552){if(_0x249552){_0x304638=_0x249552;_0x526ed8[_0x7598('0x31')]=_[_0x7598('0x2f')](db[_0x7598('0x5c')]['rawAttributes']);_0x526ed8['query']=_[_0x7598('0x2f')](_0x46cd3a['query']);_0x526ed8[_0x7598('0x30')]=_[_0x7598('0x33')](_0x526ed8[_0x7598('0x31')],_0x526ed8[_0x7598('0x2e')]);_0x3302bb[_0x7598('0x32')]=_[_0x7598('0x33')](_0x526ed8[_0x7598('0x31')],qs[_0x7598('0x34')](_0x46cd3a[_0x7598('0x2e')][_0x7598('0x34')]));_0x3302bb[_0x7598('0x32')]=_0x3302bb[_0x7598('0x32')]['length']?_0x3302bb['attributes']:_0x526ed8[_0x7598('0x31')];_0x3302bb['order']=qs[_0x7598('0x39')](_0x46cd3a[_0x7598('0x2e')]['sort']);_0x3302bb[_0x7598('0x3a')]=qs[_0x7598('0x30')](_[_0x7598('0x53')](_0x46cd3a[_0x7598('0x2e')],_0x526ed8[_0x7598('0x30')]));if(_0x46cd3a[_0x7598('0x2e')][_0x7598('0x3b')]){_0x3302bb[_0x7598('0x3a')]=_[_0x7598('0x3c')](_0x3302bb[_0x7598('0x3a')],{'$or':_[_0x7598('0x2d')](_0x3302bb[_0x7598('0x32')],function(_0x5ac39e){var _0x14ee34={};_0x14ee34[_0x5ac39e]={'$like':'%'+_0x46cd3a[_0x7598('0x2e')][_0x7598('0x3b')]+'%'};return _0x14ee34;})});}_0x3302bb=_[_0x7598('0x3c')]({},_0x3302bb,_0x46cd3a['options']);return _0x304638[_0x7598('0x5b')](_0x3302bb);}})[_0x7598('0x22')](function(_0x457fb5){if(_0x457fb5){_0x4e671b=_0x457fb5[_0x7598('0x35')];if(!_0x46cd3a[_0x7598('0x2e')][_0x7598('0x36')](_0x7598('0x37'))){_0x3302bb['limit']=qs['limit'](_0x46cd3a[_0x7598('0x2e')]['limit']);_0x3302bb[_0x7598('0x38')]=qs[_0x7598('0x38')](_0x46cd3a[_0x7598('0x2e')]['offset']);}return _0x304638[_0x7598('0x5b')](_0x3302bb);}})[_0x7598('0x22')](function(_0x566b80){if(_0x566b80){return _0x566b80?{'count':_0x4e671b,'rows':_0x566b80}:null;}})[_0x7598('0x22')](respondWithResult(_0x3876e2,null))['catch'](handleError(_0x3876e2,null));};exports[_0x7598('0x5d')]=function(_0x3b06d6,_0x5cbb2b,_0x4d521d){var _0x30f99d,_0x2a6f9b;var _0x58e3fc=[];var _0x336356=moment()[_0x7598('0x5e')](_0x7598('0x5f'));return db[_0x7598('0x2a')][_0x7598('0x44')]({'where':{'id':_0x3b06d6['params']['id']}})['then'](handleEntityNotFound(_0x5cbb2b,null))[_0x7598('0x22')](function(_0xe6cb69){if(_0xe6cb69){_0x2a6f9b=_0xe6cb69;return _0xe6cb69['addLists'](_0x3b06d6['body'][_0x7598('0x60')],_[_0x7598('0x4b')](_0x3b06d6[_0x7598('0x4d')],[_0x7598('0x60'),'id'])||{});}return null;})[_0x7598('0x61')](function(_0x3bd2ab){var _0x22fd33;var _0x43266d;_0x30f99d=_0x3bd2ab||[];var _0x172c6d=[];if(_0x3bd2ab){for(var _0x273efd=0x0;_0x273efd<_0x3bd2ab[_0x7598('0x35')];_0x273efd+=0x1){var _0x21762a=_0x3bd2ab[_0x273efd][_0x7598('0x24')]({'plain':!![]});_0x2a6f9b[_0x7598('0x62')]=_0x3b06d6[_0x7598('0x4d')][_0x7598('0x62')]?_0x3b06d6[_0x7598('0x4d')][_0x7598('0x62')]:_0x2a6f9b[_0x7598('0x62')];switch(_0x2a6f9b[_0x7598('0x62')]){case'always':_0x22fd33=squel[_0x7598('0x63')]()[_0x7598('0x64')](_0x7598('0x65'))[_0x7598('0x66')]([_0x7598('0x67'),'scheduledAt',_0x7598('0x68'),_0x7598('0x69'),_0x7598('0x56'),'createdAt',_0x7598('0x4e')],squel[_0x7598('0x6a')]()[_0x7598('0x6b')](_0x7598('0x67'),'phone')[_0x7598('0x6b')](_0x7598('0x6c'),'scheduledAt')[_0x7598('0x6b')]('id',_0x7598('0x68'))[_0x7598('0x6b')](_0x21762a[_0x7598('0x6d')][_0x7598('0x6e')](),'ListId')[_0x7598('0x6b')](_0x3b06d6['params']['id'][_0x7598('0x6e')](),_0x7598('0x56'))[_0x7598('0x6b')]('\x27'+_0x336356+'\x27',_0x7598('0x4c'))[_0x7598('0x6b')]('\x27'+_0x336356+'\x27','updatedAt')[_0x7598('0x6f')](_0x7598('0x70'))[_0x7598('0x3a')](_0x7598('0x71'))[_0x7598('0x3a')]('ListId\x20=\x20?',_0x21762a[_0x7598('0x6d')][_0x7598('0x6e')]())[_0x7598('0x3a')](_0x7598('0x72'))['where'](_0x7598('0x73'),squel[_0x7598('0x6a')]()[_0x7598('0x6b')](_0x7598('0x74'))[_0x7598('0x6f')]('cm_hopper_final')[_0x7598('0x3a')](_0x7598('0x75'),_0x3b06d6['params']['id'][_0x7598('0x6e')]()))[_0x7598('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0x7598('0x76'))[_0x7598('0x6f')](_0x7598('0x65'))[_0x7598('0x3a')]('CampaignId\x20=\x20?',_0x3b06d6[_0x7598('0x4a')]['id'][_0x7598('0x6e')]())))[_0x7598('0x6e')]();break;case'onlyIfOpen':_0x22fd33=squel[_0x7598('0x63')]()[_0x7598('0x64')](_0x7598('0x65'))[_0x7598('0x66')]([_0x7598('0x67'),'scheduledAt',_0x7598('0x68'),'ListId',_0x7598('0x56'),'createdAt','updatedAt'],squel[_0x7598('0x6a')]()['field'](_0x7598('0x67'),_0x7598('0x67'))['field'](_0x7598('0x6c'),_0x7598('0x77'))[_0x7598('0x6b')]('id',_0x7598('0x68'))[_0x7598('0x6b')](_0x21762a[_0x7598('0x6d')][_0x7598('0x6e')](),_0x7598('0x69'))[_0x7598('0x6b')](_0x3b06d6[_0x7598('0x4a')]['id']['toString'](),_0x7598('0x56'))[_0x7598('0x6b')]('\x27'+_0x336356+'\x27',_0x7598('0x4c'))[_0x7598('0x6b')]('\x27'+_0x336356+'\x27',_0x7598('0x4e'))[_0x7598('0x6f')]('cm_contacts')['where'](_0x7598('0x71'))['where'](_0x7598('0x78'),_0x21762a[_0x7598('0x6d')][_0x7598('0x6e')]())[_0x7598('0x3a')](_0x7598('0x72'))[_0x7598('0x3a')](_0x7598('0x73'),squel[_0x7598('0x6a')]()['field'](_0x7598('0x76'))[_0x7598('0x6f')](_0x7598('0x65'))[_0x7598('0x3a')](_0x7598('0x75'),_0x3b06d6[_0x7598('0x4a')]['id'][_0x7598('0x6e')]())))['toString']();break;default:_0x22fd33=squel[_0x7598('0x63')]()[_0x7598('0x64')](_0x7598('0x65'))['fromQuery']([_0x7598('0x67'),_0x7598('0x77'),_0x7598('0x68'),_0x7598('0x69'),_0x7598('0x56'),'createdAt','updatedAt'],squel[_0x7598('0x6a')]()[_0x7598('0x6b')](_0x7598('0x67'),_0x7598('0x67'))['field'](_0x7598('0x6c'),'scheduledAt')[_0x7598('0x6b')]('id',_0x7598('0x68'))[_0x7598('0x6b')](_0x21762a[_0x7598('0x6d')][_0x7598('0x6e')](),'ListId')[_0x7598('0x6b')](_0x3b06d6['params']['id'][_0x7598('0x6e')](),_0x7598('0x56'))[_0x7598('0x6b')]('\x27'+_0x336356+'\x27',_0x7598('0x4c'))[_0x7598('0x6b')]('\x27'+_0x336356+'\x27',_0x7598('0x4e'))['from'](_0x7598('0x70'))[_0x7598('0x3a')]('deletedAt\x20IS\x20NULL')[_0x7598('0x3a')]('ListId\x20=\x20?',_0x21762a[_0x7598('0x6d')][_0x7598('0x6e')]())[_0x7598('0x3a')]('phone\x20IS\x20NOT\x20NULL'))[_0x7598('0x6e')]();}_0x43266d=squel[_0x7598('0x63')]()['into'](_0x7598('0x79'))[_0x7598('0x66')]([_0x7598('0x7a'),_0x7598('0x77'),_0x7598('0x67'),_0x7598('0x7b'),_0x7598('0x4c'),_0x7598('0x4e')],squel['select']()[_0x7598('0x6b')]('h.id','id')[_0x7598('0x6b')](_0x7598('0x6c'),_0x7598('0x77'))['field'](_0x7598('0x7c'),_0x7598('0x67'))['field'](_0x7598('0x7d'),_0x7598('0x7b'))['field']('\x27'+_0x336356+'\x27',_0x7598('0x4c'))[_0x7598('0x6b')]('\x27'+_0x336356+'\x27','updatedAt')[_0x7598('0x6f')]('cm_contact_has_items','ci')['join']('cm_hopper','h',_0x7598('0x7e'))[_0x7598('0x3a')]('h.ListId\x20=\x20?',_0x21762a['CmListId'][_0x7598('0x6e')]())[_0x7598('0x3a')]('h.CampaignId=?',_0x3b06d6[_0x7598('0x4a')]['id']['toString']())[_0x7598('0x3a')](_0x7598('0x7f'),_0x336356))[_0x7598('0x6e')]();_0x172c6d[_0x7598('0x80')](db['sequelize'][_0x7598('0x2e')](_0x22fd33));_0x58e3fc['push'](db[_0x7598('0x81')][_0x7598('0x2e')](_0x43266d));}return BPromise['all'](_0x172c6d);}})[_0x7598('0x22')](function(){return BPromise[_0x7598('0x82')](_0x58e3fc);})[_0x7598('0x22')](function(){return _0x30f99d;})['then'](respondWithResult(_0x5cbb2b,null))['catch'](handleError(_0x5cbb2b,null));};exports[_0x7598('0x83')]=function(_0x3900b1,_0x4f3137,_0x8c1555){return db[_0x7598('0x2a')]['find']({'where':{'id':_0x3900b1[_0x7598('0x4a')]['id']}})[_0x7598('0x22')](handleEntityNotFound(_0x4f3137,null))[_0x7598('0x22')](function(_0x4d3edc){if(_0x4d3edc){return _0x4d3edc[_0x7598('0x83')](_0x3900b1[_0x7598('0x2e')][_0x7598('0x60')]);}})[_0x7598('0x22')](function(_0x95e22){if(_0x95e22){return db[_0x7598('0x52')][_0x7598('0x23')]({'where':{'ListId':_0x3900b1['query'][_0x7598('0x60')],'CampaignId':_0x3900b1[_0x7598('0x4a')]['id']}})[_0x7598('0x22')](function(){return _0x95e22;});}})[_0x7598('0x22')](respondWithStatusCode(_0x4f3137,null))[_0x7598('0x45')](handleError(_0x4f3137,null));};exports[_0x7598('0x84')]=function(_0x3ed982,_0xbd2642,_0x39d1a1){var _0xb087f8={};var _0x2e3227={};var _0x1ef78d;var _0x3e1ed0;return db[_0x7598('0x2a')][_0x7598('0x51')]({'where':{'id':_0x3ed982[_0x7598('0x4a')]['id']}})[_0x7598('0x22')](handleEntityNotFound(_0xbd2642,null))['then'](function(_0x41fa76){if(_0x41fa76){_0x1ef78d=_0x41fa76;_0x2e3227['model']=_[_0x7598('0x2f')](db['CmList']['rawAttributes']);_0x2e3227[_0x7598('0x2e')]=_['keys'](_0x3ed982[_0x7598('0x2e')]);_0x2e3227['filters']=_['intersection'](_0x2e3227[_0x7598('0x31')],_0x2e3227[_0x7598('0x2e')]);_0xb087f8['attributes']=_['intersection'](_0x2e3227[_0x7598('0x31')],qs['fields'](_0x3ed982[_0x7598('0x2e')][_0x7598('0x34')]));_0xb087f8[_0x7598('0x32')]=_0xb087f8[_0x7598('0x32')][_0x7598('0x35')]?_0xb087f8[_0x7598('0x32')]:_0x2e3227[_0x7598('0x31')];_0xb087f8[_0x7598('0x55')]=qs['sort'](_0x3ed982[_0x7598('0x2e')][_0x7598('0x39')]);_0xb087f8[_0x7598('0x3a')]=qs[_0x7598('0x30')](_['pick'](_0x3ed982[_0x7598('0x2e')],_0x2e3227[_0x7598('0x30')]));if(_0x3ed982[_0x7598('0x2e')]['filter']){_0xb087f8['where']=_['merge'](_0xb087f8['where'],{'$or':_[_0x7598('0x2d')](_0xb087f8[_0x7598('0x32')],function(_0x487b33){var _0x4d435c={};_0x4d435c[_0x487b33]={'$like':'%'+_0x3ed982[_0x7598('0x2e')][_0x7598('0x3b')]+'%'};return _0x4d435c;})});}_0xb087f8=_['merge']({},_0xb087f8,_0x3ed982[_0x7598('0x43')]);return _0x1ef78d[_0x7598('0x84')](_0xb087f8);}})[_0x7598('0x22')](function(_0xff29ed){if(_0xff29ed){_0x3e1ed0=_0xff29ed[_0x7598('0x35')];if(!_0x3ed982['query']['hasOwnProperty'](_0x7598('0x37'))){_0xb087f8['limit']=qs[_0x7598('0x1b')](_0x3ed982[_0x7598('0x2e')]['limit']);_0xb087f8['offset']=qs['offset'](_0x3ed982[_0x7598('0x2e')][_0x7598('0x38')]);}return _0x1ef78d[_0x7598('0x84')](_0xb087f8);}})[_0x7598('0x22')](function(_0x2598fa){if(_0x2598fa){return _0x2598fa?{'count':_0x3e1ed0,'rows':_0x2598fa}:null;}})[_0x7598('0x22')](respondWithResult(_0xbd2642,null))[_0x7598('0x45')](handleError(_0xbd2642,null));};exports['addBlackLists']=function(_0x20d65b,_0x55eecb,_0x2f79db){var _0x5ba3a1,_0xe53e76;var _0x183e60=[];var _0x89d105=moment()['format'](_0x7598('0x5f'));return db[_0x7598('0x2a')][_0x7598('0x44')]({'where':{'id':_0x20d65b[_0x7598('0x4a')]['id']}})[_0x7598('0x22')](handleEntityNotFound(_0x55eecb,null))['then'](function(_0x56cda4){if(_0x56cda4){_0xe53e76=_0x56cda4;return _0x56cda4['addBlackLists'](_0x20d65b[_0x7598('0x4d')]['ids'],_['omit'](_0x20d65b[_0x7598('0x4d')],[_0x7598('0x60'),'id'])||{});}return null;})[_0x7598('0x61')](function(_0x22fdd2){var _0x3639ce;var _0x3e8fba;_0x5ba3a1=_0x22fdd2||[];var _0x3fabd0=[];if(_0x22fdd2){for(var _0x1200a6=0x0;_0x1200a6<_0x22fdd2[_0x7598('0x35')];_0x1200a6+=0x1){var _0x33b3b5=_0x22fdd2[_0x1200a6][_0x7598('0x24')]({'plain':!![]});_0x3639ce=squel[_0x7598('0x63')]()[_0x7598('0x64')]('cm_hopper_black')['fromQuery'](['phone','ContactId',_0x7598('0x69'),_0x7598('0x56'),'createdAt',_0x7598('0x4e')],squel[_0x7598('0x6a')]()['field'](_0x7598('0x67'),_0x7598('0x67'))[_0x7598('0x6b')]('id',_0x7598('0x68'))[_0x7598('0x6b')](_0x33b3b5[_0x7598('0x6d')][_0x7598('0x6e')](),'ListId')[_0x7598('0x6b')](_0x20d65b[_0x7598('0x4a')]['id'][_0x7598('0x6e')](),_0x7598('0x56'))['field']('NOW()',_0x7598('0x4c'))[_0x7598('0x6b')](_0x7598('0x6c'),_0x7598('0x4e'))[_0x7598('0x6f')](_0x7598('0x70'))['where']('deletedAt\x20IS\x20NULL')[_0x7598('0x3a')]('ListId\x20=\x20?',_0x33b3b5['CmListId'][_0x7598('0x6e')]())[_0x7598('0x3a')](_0x7598('0x72')))['toString']();_0x3fabd0[_0x7598('0x80')](db[_0x7598('0x81')][_0x7598('0x2e')](_0x3639ce));}return BPromise['all'](_0x3fabd0);}})[_0x7598('0x22')](function(){return _0x5ba3a1;})[_0x7598('0x22')](respondWithResult(_0x55eecb,null))['catch'](handleError(_0x55eecb,null));};exports[_0x7598('0x85')]=function(_0x48dd1e,_0x3ce521,_0x4f5c01){return db[_0x7598('0x2a')][_0x7598('0x44')]({'where':{'id':_0x48dd1e[_0x7598('0x4a')]['id']}})[_0x7598('0x22')](handleEntityNotFound(_0x3ce521,null))[_0x7598('0x22')](function(_0x1c4bc6){if(_0x1c4bc6){return _0x1c4bc6[_0x7598('0x85')](_0x48dd1e[_0x7598('0x2e')][_0x7598('0x60')]);}})[_0x7598('0x22')](function(_0x5a9dcb){if(_0x5a9dcb){return db[_0x7598('0x5a')][_0x7598('0x23')]({'where':{'ListId':_0x48dd1e['query'][_0x7598('0x60')],'CampaignId':_0x48dd1e['params']['id']}})[_0x7598('0x22')](function(){return _0x5a9dcb;});}})[_0x7598('0x22')](respondWithStatusCode(_0x3ce521,null))['catch'](handleError(_0x3ce521,null));}; \ No newline at end of file +var _0x3b46=['name','send','index','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','Campaign','findAll','rows','show','params','keys','rawAttributes','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','autoAssociation','clone','createdAt','body','omit','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','hasOwnProperty','CmHopper','getHopperHistories','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','into','fromQuery','phone','scheduledAt','ListId','field','NOW()','CmListId','toString','updatedAt','cm_contacts','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','CampaignId\x20=\x20?','select','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','insert','ContactId','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','removeLists','getBlackLists','addBlackLists','cm_hopper_black','all','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','IvrCampaigns','UserProfileResource','error','stack'];(function(_0x2859f2,_0x1e3102){var _0x4974cd=function(_0x13ec65){while(--_0x13ec65){_0x2859f2['push'](_0x2859f2['shift']());}};_0x4974cd(++_0x1e3102);}(_0x3b46,0x1a2));var _0x63b4=function(_0x45fe9c,_0x55e0d7){_0x45fe9c=_0x45fe9c-0x0;var _0x233d48=_0x3b46[_0x45fe9c];return _0x233d48;};'use strict';var emlformat=require(_0x63b4('0x0'));var rimraf=require(_0x63b4('0x1'));var zipdir=require(_0x63b4('0x2'));var jsonpatch=require(_0x63b4('0x3'));var rp=require('request-promise');var moment=require(_0x63b4('0x4'));var BPromise=require(_0x63b4('0x5'));var Mustache=require('mustache');var util=require(_0x63b4('0x6'));var path=require(_0x63b4('0x7'));var sox=require(_0x63b4('0x8'));var csv=require(_0x63b4('0x9'));var ejs=require(_0x63b4('0xa'));var fs=require('fs');var fs_extra=require(_0x63b4('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x63b4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x63b4('0xd'));var toCsv=require(_0x63b4('0x9'));var querystring=require(_0x63b4('0xe'));var Papa=require(_0x63b4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x63b4('0x10'));var as=require(_0x63b4('0x11'));var hardwareService=require(_0x63b4('0x12'));var logger=require(_0x63b4('0x13'))(_0x63b4('0x14'));var utils=require(_0x63b4('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x63b4('0x16'));var db=require(_0x63b4('0x17'))['db'];function respondWithStatusCode(_0x14868e,_0xd64039){_0xd64039=_0xd64039||0xcc;return function(_0x5cada5){if(_0x5cada5){return _0x14868e[_0x63b4('0x18')](_0xd64039);}return _0x14868e[_0x63b4('0x19')](_0xd64039)[_0x63b4('0x1a')]();};}function respondWithResult(_0x30ef05,_0x400e6d){_0x400e6d=_0x400e6d||0xc8;return function(_0xd9036d){if(_0xd9036d){return _0x30ef05[_0x63b4('0x19')](_0x400e6d)['json'](_0xd9036d);}};}function respondWithFilteredResult(_0x3e287c,_0xf9a262){return function(_0x2ec72a){if(_0x2ec72a){var _0x495ac4=typeof _0xf9a262[_0x63b4('0x1b')]===_0x63b4('0x1c')&&typeof _0xf9a262[_0x63b4('0x1d')]===_0x63b4('0x1c');var _0x594bf0=_0x2ec72a[_0x63b4('0x1e')];var _0x143352=_0x495ac4?0x0:_0xf9a262[_0x63b4('0x1b')];var _0x4c8ab2=_0x495ac4?_0x2ec72a[_0x63b4('0x1e')]:_0xf9a262['offset']+_0xf9a262['limit'];var _0x1d3a77;if(_0x4c8ab2>=_0x594bf0){_0x4c8ab2=_0x594bf0;_0x1d3a77=0xc8;}else{_0x1d3a77=0xce;}_0x3e287c['status'](_0x1d3a77);return _0x3e287c[_0x63b4('0x1f')](_0x63b4('0x20'),_0x143352+'-'+_0x4c8ab2+'/'+_0x594bf0)[_0x63b4('0x21')](_0x2ec72a);}return null;};}function patchUpdates(_0x48dc55){return function(_0x4faf20){try{jsonpatch[_0x63b4('0x22')](_0x4faf20,_0x48dc55,!![]);}catch(_0x37e340){return BPromise[_0x63b4('0x23')](_0x37e340);}return _0x4faf20[_0x63b4('0x24')]();};}function saveUpdates(_0x48ea96,_0x39f910){return function(_0x430371){if(_0x430371){return _0x430371[_0x63b4('0x25')](_0x48ea96)[_0x63b4('0x26')](function(_0x533272){return _0x533272;});}return null;};}function removeEntity(_0x1533e5,_0x41970f){return function(_0x5cbbc3){if(_0x5cbbc3){return _0x5cbbc3[_0x63b4('0x27')]()['then'](function(){var _0x4159ee=_0x5cbbc3['get']({'plain':!![]});var _0x53fe67=_0x63b4('0x28');return db[_0x63b4('0x29')][_0x63b4('0x27')]({'where':{'type':_0x53fe67,'resourceId':_0x4159ee['id']}})[_0x63b4('0x26')](function(){return _0x5cbbc3;});})[_0x63b4('0x26')](function(){_0x1533e5[_0x63b4('0x19')](0xcc)[_0x63b4('0x1a')]();});}};}function handleEntityNotFound(_0xbf72dc,_0x9e0f08){return function(_0x30834b){if(!_0x30834b){_0xbf72dc[_0x63b4('0x18')](0x194);}return _0x30834b;};}function handleError(_0x774412,_0x2f7d54){_0x2f7d54=_0x2f7d54||0x1f4;return function(_0x579af6){logger[_0x63b4('0x2a')](_0x579af6[_0x63b4('0x2b')]);if(_0x579af6[_0x63b4('0x2c')]){delete _0x579af6[_0x63b4('0x2c')];}_0x774412[_0x63b4('0x19')](_0x2f7d54)[_0x63b4('0x2d')](_0x579af6);};}exports[_0x63b4('0x2e')]=function(_0x4a66d1,_0x58e90e){var _0x3bf9b5={},_0x371b56={},_0x454508={'count':0x0,'rows':[]};var _0x3a6655=_[_0x63b4('0x2f')](db['Campaign']['rawAttributes'],function(_0x9081b6){return{'name':_0x9081b6[_0x63b4('0x30')],'type':_0x9081b6[_0x63b4('0x31')][_0x63b4('0x32')]};});_0x371b56[_0x63b4('0x33')]=_[_0x63b4('0x2f')](_0x3a6655,_0x63b4('0x2c'));_0x371b56[_0x63b4('0x34')]=_['keys'](_0x4a66d1[_0x63b4('0x34')]);_0x371b56[_0x63b4('0x35')]=_[_0x63b4('0x36')](_0x371b56[_0x63b4('0x33')],_0x371b56[_0x63b4('0x34')]);_0x3bf9b5[_0x63b4('0x37')]=_[_0x63b4('0x36')](_0x371b56[_0x63b4('0x33')],qs[_0x63b4('0x38')](_0x4a66d1[_0x63b4('0x34')][_0x63b4('0x38')]));_0x3bf9b5[_0x63b4('0x37')]=_0x3bf9b5[_0x63b4('0x37')][_0x63b4('0x39')]?_0x3bf9b5[_0x63b4('0x37')]:_0x371b56[_0x63b4('0x33')];if(!_0x4a66d1[_0x63b4('0x34')]['hasOwnProperty'](_0x63b4('0x3a'))){_0x3bf9b5[_0x63b4('0x1d')]=qs[_0x63b4('0x1d')](_0x4a66d1['query'][_0x63b4('0x1d')]);_0x3bf9b5[_0x63b4('0x1b')]=qs[_0x63b4('0x1b')](_0x4a66d1[_0x63b4('0x34')][_0x63b4('0x1b')]);}_0x3bf9b5[_0x63b4('0x3b')]=qs['sort'](_0x4a66d1['query'][_0x63b4('0x3c')]);_0x3bf9b5[_0x63b4('0x3d')]=qs[_0x63b4('0x35')](_[_0x63b4('0x3e')](_0x4a66d1[_0x63b4('0x34')],_0x371b56[_0x63b4('0x35')]),_0x3a6655);if(_0x4a66d1['query'][_0x63b4('0x3f')]){_0x3bf9b5[_0x63b4('0x3d')]=_[_0x63b4('0x40')](_0x3bf9b5['where'],{'$or':_[_0x63b4('0x2f')](_0x3a6655,function(_0x1725ba){if(_0x1725ba[_0x63b4('0x31')]!==_0x63b4('0x41')){var _0x99b4d2={};_0x99b4d2[_0x1725ba[_0x63b4('0x2c')]]={'$like':'%'+_0x4a66d1[_0x63b4('0x34')][_0x63b4('0x3f')]+'%'};return _0x99b4d2;}})});}_0x3bf9b5=_[_0x63b4('0x40')]({},_0x3bf9b5,_0x4a66d1[_0x63b4('0x42')]);var _0xc546db={'where':_0x3bf9b5[_0x63b4('0x3d')]};return db['Campaign'][_0x63b4('0x1e')](_0xc546db)[_0x63b4('0x26')](function(_0x1b100b){_0x454508['count']=_0x1b100b;if(_0x4a66d1['query'][_0x63b4('0x43')]){_0x3bf9b5[_0x63b4('0x44')]=[{'all':!![]}];}return db[_0x63b4('0x45')][_0x63b4('0x46')](_0x3bf9b5);})['then'](function(_0x3b5dc8){_0x454508[_0x63b4('0x47')]=_0x3b5dc8;return _0x454508;})[_0x63b4('0x26')](respondWithFilteredResult(_0x58e90e,_0x3bf9b5))['catch'](handleError(_0x58e90e,null));};exports[_0x63b4('0x48')]=function(_0x74fcb8,_0x390f72){var _0x2f91b4={'raw':![],'where':{'id':_0x74fcb8[_0x63b4('0x49')]['id']}},_0x4f37b1={};_0x4f37b1[_0x63b4('0x33')]=_[_0x63b4('0x4a')](db['Campaign'][_0x63b4('0x4b')]);_0x4f37b1[_0x63b4('0x34')]=_['keys'](_0x74fcb8[_0x63b4('0x34')]);_0x4f37b1[_0x63b4('0x35')]=_['intersection'](_0x4f37b1[_0x63b4('0x33')],_0x4f37b1[_0x63b4('0x34')]);_0x2f91b4[_0x63b4('0x37')]=_[_0x63b4('0x36')](_0x4f37b1['model'],qs[_0x63b4('0x38')](_0x74fcb8[_0x63b4('0x34')][_0x63b4('0x38')]));_0x2f91b4[_0x63b4('0x37')]=_0x2f91b4[_0x63b4('0x37')]['length']?_0x2f91b4['attributes']:_0x4f37b1['model'];if(_0x74fcb8[_0x63b4('0x34')]['includeAll']){_0x2f91b4[_0x63b4('0x44')]=[{'all':!![]}];}_0x2f91b4=_[_0x63b4('0x40')]({},_0x2f91b4,_0x74fcb8[_0x63b4('0x42')]);return db['Campaign'][_0x63b4('0x4c')](_0x2f91b4)[_0x63b4('0x26')](handleEntityNotFound(_0x390f72,null))[_0x63b4('0x26')](respondWithResult(_0x390f72,null))[_0x63b4('0x4d')](handleError(_0x390f72,null));};exports[_0x63b4('0x4e')]=function(_0x784f96,_0x9b1029){return db[_0x63b4('0x45')][_0x63b4('0x4e')](_0x784f96['body'],{})[_0x63b4('0x26')](function(_0x1cd721){var _0x41484f=_0x784f96[_0x63b4('0x4f')]['get']({'plain':!![]});if(!_0x41484f)throw new Error(_0x63b4('0x50'));if(_0x41484f[_0x63b4('0x51')]===_0x63b4('0x4f')){var _0x18bbd0=_0x1cd721[_0x63b4('0x52')]({'plain':!![]});var _0x3237c4=_0x63b4('0x28');return db[_0x63b4('0x53')][_0x63b4('0x4c')]({'where':{'name':_0x3237c4,'userProfileId':_0x41484f['userProfileId']},'raw':!![]})[_0x63b4('0x26')](function(_0x34c9da){if(_0x34c9da&&_0x34c9da[_0x63b4('0x54')]===0x0){return db[_0x63b4('0x29')][_0x63b4('0x4e')]({'name':_0x18bbd0[_0x63b4('0x2c')],'resourceId':_0x18bbd0['id'],'type':_0x34c9da[_0x63b4('0x2c')],'sectionId':_0x34c9da['id']},{})[_0x63b4('0x26')](function(){return _0x1cd721;});}else{return _0x1cd721;}})['catch'](function(_0x58fd0c){logger[_0x63b4('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x58fd0c);throw _0x58fd0c;});}return _0x1cd721;})[_0x63b4('0x26')](respondWithResult(_0x9b1029,0xc9))[_0x63b4('0x4d')](handleError(_0x9b1029,null));};exports[_0x63b4('0x55')]=function(_0x424232,_0x3e2e57){var _0x29513f={'where':{'id':_0x424232[_0x63b4('0x49')]['id']}},_0x4d56f5={};_0x4d56f5[_0x63b4('0x33')]=_[_0x63b4('0x4a')](db['Campaign'][_0x63b4('0x4b')]);_0x29513f[_0x63b4('0x37')]=_['intersection'](_0x4d56f5['model'],qs[_0x63b4('0x38')](_0x424232[_0x63b4('0x34')][_0x63b4('0x38')]));_0x29513f[_0x63b4('0x37')]=_0x29513f[_0x63b4('0x37')][_0x63b4('0x39')]?_0x29513f['attributes']:_0x4d56f5['model'];if(_0x424232[_0x63b4('0x34')][_0x63b4('0x43')]){_0x29513f['include']=[{'all':!![]}];}_0x29513f=_[_0x63b4('0x40')]({},_0x29513f,_0x424232[_0x63b4('0x42')]);return db['Campaign'][_0x63b4('0x4c')](_0x29513f)['then'](handleEntityNotFound(_0x3e2e57,null))[_0x63b4('0x26')](function(_0x5a1e94){if(_0x5a1e94){var _0x5aca1f=_0x5a1e94[_0x63b4('0x52')]({'plain':!![]});_0x5aca1f=qs['omit'](_0x5aca1f,['id',_0x63b4('0x56'),'updatedAt']);_0x424232[_0x63b4('0x57')]=_[_0x63b4('0x58')](_0x424232[_0x63b4('0x57')],['id','createdAt','updatedAt']);return db[_0x63b4('0x45')][_0x63b4('0x4e')](_['merge'](_0x5aca1f,_0x424232[_0x63b4('0x57')]),{'include':_0x424232[_0x63b4('0x34')][_0x63b4('0x43')]?[{'all':!![]}]:undefined})[_0x63b4('0x26')](function(_0x3e086b){var _0x27ee2f=_0x424232[_0x63b4('0x4f')][_0x63b4('0x52')]({'plain':!![]});if(!_0x27ee2f)throw new Error(_0x63b4('0x50'));if(_0x27ee2f['role']===_0x63b4('0x4f')){var _0x2c8375=_0x3e086b[_0x63b4('0x52')]({'plain':!![]});var _0x40a3cf=_0x63b4('0x28');return db[_0x63b4('0x53')][_0x63b4('0x4c')]({'where':{'name':_0x40a3cf,'userProfileId':_0x27ee2f[_0x63b4('0x59')]},'raw':!![]})[_0x63b4('0x26')](function(_0x1d90f9){if(_0x1d90f9&&_0x1d90f9['autoAssociation']===0x0){return db[_0x63b4('0x29')][_0x63b4('0x4e')]({'name':_0x2c8375[_0x63b4('0x2c')],'resourceId':_0x2c8375['id'],'type':_0x1d90f9[_0x63b4('0x2c')],'sectionId':_0x1d90f9['id']},{})[_0x63b4('0x26')](function(){return _0x3e086b;});}else{return _0x3e086b;}})[_0x63b4('0x4d')](function(_0x473389){logger[_0x63b4('0x2a')](_0x63b4('0x5a'),_0x473389);throw _0x473389;});}return _0x3e086b;});}})[_0x63b4('0x26')](respondWithResult(_0x3e2e57,0xc9))[_0x63b4('0x4d')](handleError(_0x3e2e57,null));};exports[_0x63b4('0x25')]=function(_0x12f3b9,_0x3e2a55){if(_0x12f3b9[_0x63b4('0x57')]['id']){delete _0x12f3b9[_0x63b4('0x57')]['id'];}return db[_0x63b4('0x45')][_0x63b4('0x4c')]({'where':{'id':_0x12f3b9[_0x63b4('0x49')]['id']}})['then'](handleEntityNotFound(_0x3e2a55,null))[_0x63b4('0x26')](saveUpdates(_0x12f3b9['body'],null))['then'](respondWithResult(_0x3e2a55,null))[_0x63b4('0x4d')](handleError(_0x3e2a55,null));};exports[_0x63b4('0x27')]=function(_0x4b21a2,_0x4ff2b6){return db[_0x63b4('0x45')][_0x63b4('0x4c')]({'where':{'id':_0x4b21a2[_0x63b4('0x49')]['id']}})[_0x63b4('0x26')](handleEntityNotFound(_0x4ff2b6,null))[_0x63b4('0x26')](removeEntity(_0x4ff2b6,null))[_0x63b4('0x4d')](handleError(_0x4ff2b6,null));};exports[_0x63b4('0x5b')]=function(_0x564a9b,_0x3067be,_0x3a6f23){var _0x31f814={'raw':!![],'where':{}};var _0x5b737f={};var _0x34df70={'count':0x0,'rows':[]};return db['Campaign'][_0x63b4('0x5c')]({'where':{'id':_0x564a9b[_0x63b4('0x49')]['id']}})['then'](handleEntityNotFound(_0x3067be,null))['then'](function(_0x283cea){if(_0x283cea){_0x5b737f[_0x63b4('0x33')]=_[_0x63b4('0x4a')](db['CmHopper'][_0x63b4('0x4b')]);_0x5b737f[_0x63b4('0x34')]=_['keys'](_0x564a9b[_0x63b4('0x34')]);_0x5b737f['filters']=_[_0x63b4('0x36')](_0x5b737f['model'],_0x5b737f[_0x63b4('0x34')]);_0x31f814[_0x63b4('0x37')]=_[_0x63b4('0x36')](_0x5b737f[_0x63b4('0x33')],qs[_0x63b4('0x38')](_0x564a9b['query'][_0x63b4('0x38')]));_0x31f814[_0x63b4('0x37')]=_0x31f814[_0x63b4('0x37')][_0x63b4('0x39')]?_0x31f814[_0x63b4('0x37')]:_0x5b737f[_0x63b4('0x33')];if(!_0x564a9b[_0x63b4('0x34')][_0x63b4('0x5d')](_0x63b4('0x3a'))){_0x31f814['limit']=qs[_0x63b4('0x1d')](_0x564a9b[_0x63b4('0x34')]['limit']);_0x31f814['offset']=qs[_0x63b4('0x1b')](_0x564a9b[_0x63b4('0x34')][_0x63b4('0x1b')]);}_0x31f814[_0x63b4('0x3b')]=qs[_0x63b4('0x3c')](_0x564a9b[_0x63b4('0x34')][_0x63b4('0x3c')]);_0x31f814[_0x63b4('0x3d')]=qs[_0x63b4('0x35')](_[_0x63b4('0x3e')](_0x564a9b[_0x63b4('0x34')],_0x5b737f[_0x63b4('0x35')]));_0x31f814[_0x63b4('0x3d')]['CampaignId']=_0x283cea['id'];if(_0x564a9b[_0x63b4('0x34')][_0x63b4('0x3f')]){_0x31f814[_0x63b4('0x3d')]=_[_0x63b4('0x40')](_0x31f814[_0x63b4('0x3d')],{'$or':_['map'](_0x31f814['attributes'],function(_0x5c8a42){var _0x1f06e8={};_0x1f06e8[_0x5c8a42]={'$like':'%'+_0x564a9b[_0x63b4('0x34')][_0x63b4('0x3f')]+'%'};return _0x1f06e8;})});}_0x31f814=_[_0x63b4('0x40')]({},_0x31f814,_0x564a9b['options']);return db[_0x63b4('0x5e')][_0x63b4('0x1e')]({'where':_0x31f814[_0x63b4('0x3d')]})['then'](function(_0x114d73){_0x34df70[_0x63b4('0x1e')]=_0x114d73;if(_0x564a9b['query'][_0x63b4('0x43')]){_0x31f814[_0x63b4('0x44')]=[{'all':!![]}];}return db['CmHopper'][_0x63b4('0x46')](_0x31f814);})[_0x63b4('0x26')](function(_0x4e50df){_0x34df70[_0x63b4('0x47')]=_0x4e50df;return _0x34df70;});}})[_0x63b4('0x26')](respondWithFilteredResult(_0x3067be,_0x31f814))[_0x63b4('0x4d')](handleError(_0x3067be,null));};exports[_0x63b4('0x5f')]=function(_0x294051,_0x591a6f,_0x4070eb){var _0x5531da={'raw':!![],'where':{}};var _0x5bfbeb={};var _0x30d820={'count':0x0,'rows':[]};return db[_0x63b4('0x45')]['findOne']({'where':{'id':_0x294051[_0x63b4('0x49')]['id']}})['then'](handleEntityNotFound(_0x591a6f,null))[_0x63b4('0x26')](function(_0x10b9cf){if(_0x10b9cf){_0x5bfbeb['model']=_[_0x63b4('0x4a')](db[_0x63b4('0x60')][_0x63b4('0x4b')]);_0x5bfbeb[_0x63b4('0x34')]=_[_0x63b4('0x4a')](_0x294051[_0x63b4('0x34')]);_0x5bfbeb['filters']=_['intersection'](_0x5bfbeb[_0x63b4('0x33')],_0x5bfbeb[_0x63b4('0x34')]);_0x5531da['attributes']=_[_0x63b4('0x36')](_0x5bfbeb['model'],qs['fields'](_0x294051['query']['fields']));_0x5531da[_0x63b4('0x37')]=_0x5531da[_0x63b4('0x37')][_0x63b4('0x39')]?_0x5531da[_0x63b4('0x37')]:_0x5bfbeb[_0x63b4('0x33')];if(!_0x294051[_0x63b4('0x34')][_0x63b4('0x5d')](_0x63b4('0x3a'))){_0x5531da['limit']=qs[_0x63b4('0x1d')](_0x294051['query']['limit']);_0x5531da[_0x63b4('0x1b')]=qs[_0x63b4('0x1b')](_0x294051[_0x63b4('0x34')][_0x63b4('0x1b')]);}_0x5531da['order']=qs[_0x63b4('0x3c')](_0x294051['query'][_0x63b4('0x3c')]);_0x5531da['where']=qs[_0x63b4('0x35')](_[_0x63b4('0x3e')](_0x294051['query'],_0x5bfbeb['filters']));_0x5531da[_0x63b4('0x3d')][_0x63b4('0x61')]=_0x10b9cf['id'];if(_0x294051[_0x63b4('0x34')][_0x63b4('0x3f')]){_0x5531da[_0x63b4('0x3d')]=_['merge'](_0x5531da['where'],{'$or':_[_0x63b4('0x2f')](_0x5531da[_0x63b4('0x37')],function(_0xf4771b){var _0x18f378={};_0x18f378[_0xf4771b]={'$like':'%'+_0x294051[_0x63b4('0x34')][_0x63b4('0x3f')]+'%'};return _0x18f378;})});}_0x5531da=_['merge']({},_0x5531da,_0x294051['options']);return db[_0x63b4('0x60')][_0x63b4('0x1e')]({'where':_0x5531da[_0x63b4('0x3d')]})['then'](function(_0x3ee6d8){_0x30d820['count']=_0x3ee6d8;if(_0x294051[_0x63b4('0x34')][_0x63b4('0x43')]){_0x5531da['include']=[{'all':!![]}];}return db[_0x63b4('0x60')][_0x63b4('0x46')](_0x5531da);})[_0x63b4('0x26')](function(_0x4f66c7){_0x30d820['rows']=_0x4f66c7;return _0x30d820;});}})[_0x63b4('0x26')](respondWithFilteredResult(_0x591a6f,_0x5531da))[_0x63b4('0x4d')](handleError(_0x591a6f,null));};exports[_0x63b4('0x62')]=function(_0x2c2bfe,_0x59fb9e,_0x49d6b6){var _0x4fa7f7={'raw':!![],'where':{}};var _0x334610={};var _0x4def04={'count':0x0,'rows':[]};return db[_0x63b4('0x45')][_0x63b4('0x5c')]({'where':{'id':_0x2c2bfe[_0x63b4('0x49')]['id']}})[_0x63b4('0x26')](handleEntityNotFound(_0x59fb9e,null))[_0x63b4('0x26')](function(_0x400a28){if(_0x400a28){_0x334610[_0x63b4('0x33')]=_[_0x63b4('0x4a')](db[_0x63b4('0x63')]['rawAttributes']);_0x334610[_0x63b4('0x34')]=_['keys'](_0x2c2bfe[_0x63b4('0x34')]);_0x334610[_0x63b4('0x35')]=_[_0x63b4('0x36')](_0x334610[_0x63b4('0x33')],_0x334610[_0x63b4('0x34')]);_0x4fa7f7[_0x63b4('0x37')]=_[_0x63b4('0x36')](_0x334610[_0x63b4('0x33')],qs['fields'](_0x2c2bfe['query'][_0x63b4('0x38')]));_0x4fa7f7[_0x63b4('0x37')]=_0x4fa7f7[_0x63b4('0x37')][_0x63b4('0x39')]?_0x4fa7f7[_0x63b4('0x37')]:_0x334610[_0x63b4('0x33')];if(!_0x2c2bfe['query']['hasOwnProperty'](_0x63b4('0x3a'))){_0x4fa7f7[_0x63b4('0x1d')]=qs[_0x63b4('0x1d')](_0x2c2bfe[_0x63b4('0x34')][_0x63b4('0x1d')]);_0x4fa7f7[_0x63b4('0x1b')]=qs[_0x63b4('0x1b')](_0x2c2bfe[_0x63b4('0x34')]['offset']);}_0x4fa7f7[_0x63b4('0x3b')]=qs[_0x63b4('0x3c')](_0x2c2bfe[_0x63b4('0x34')][_0x63b4('0x3c')]);_0x4fa7f7[_0x63b4('0x3d')]=qs[_0x63b4('0x35')](_[_0x63b4('0x3e')](_0x2c2bfe['query'],_0x334610[_0x63b4('0x35')]));_0x4fa7f7[_0x63b4('0x3d')][_0x63b4('0x61')]=_0x400a28['id'];if(_0x2c2bfe[_0x63b4('0x34')]['filter']){_0x4fa7f7['where']=_['merge'](_0x4fa7f7['where'],{'$or':_[_0x63b4('0x2f')](_0x4fa7f7['attributes'],function(_0x500ea9){var _0x5a17aa={};_0x5a17aa[_0x500ea9]={'$like':'%'+_0x2c2bfe[_0x63b4('0x34')][_0x63b4('0x3f')]+'%'};return _0x5a17aa;})});}_0x4fa7f7=_[_0x63b4('0x40')]({},_0x4fa7f7,_0x2c2bfe[_0x63b4('0x42')]);return db[_0x63b4('0x63')]['count']({'where':_0x4fa7f7[_0x63b4('0x3d')]})[_0x63b4('0x26')](function(_0x2de683){_0x4def04[_0x63b4('0x1e')]=_0x2de683;if(_0x2c2bfe['query'][_0x63b4('0x43')]){_0x4fa7f7['include']=[{'all':!![]}];}return db[_0x63b4('0x63')][_0x63b4('0x46')](_0x4fa7f7);})[_0x63b4('0x26')](function(_0x152d94){_0x4def04[_0x63b4('0x47')]=_0x152d94;return _0x4def04;});}})[_0x63b4('0x26')](respondWithFilteredResult(_0x59fb9e,_0x4fa7f7))[_0x63b4('0x4d')](handleError(_0x59fb9e,null));};exports[_0x63b4('0x64')]=function(_0x2d5fb0,_0x54d330,_0x46790c){var _0x5cf81e={'raw':!![],'where':{}};var _0x50f319={};var _0x2ca24f={'count':0x0,'rows':[]};return db['Campaign'][_0x63b4('0x5c')]({'where':{'id':_0x2d5fb0['params']['id']}})[_0x63b4('0x26')](handleEntityNotFound(_0x54d330,null))[_0x63b4('0x26')](function(_0x19ffd2){if(_0x19ffd2){_0x50f319['model']=_[_0x63b4('0x4a')](db[_0x63b4('0x65')][_0x63b4('0x4b')]);_0x50f319[_0x63b4('0x34')]=_[_0x63b4('0x4a')](_0x2d5fb0[_0x63b4('0x34')]);_0x50f319[_0x63b4('0x35')]=_[_0x63b4('0x36')](_0x50f319[_0x63b4('0x33')],_0x50f319[_0x63b4('0x34')]);_0x5cf81e[_0x63b4('0x37')]=_[_0x63b4('0x36')](_0x50f319['model'],qs[_0x63b4('0x38')](_0x2d5fb0[_0x63b4('0x34')][_0x63b4('0x38')]));_0x5cf81e[_0x63b4('0x37')]=_0x5cf81e['attributes'][_0x63b4('0x39')]?_0x5cf81e['attributes']:_0x50f319['model'];if(!_0x2d5fb0[_0x63b4('0x34')][_0x63b4('0x5d')](_0x63b4('0x3a'))){_0x5cf81e[_0x63b4('0x1d')]=qs[_0x63b4('0x1d')](_0x2d5fb0[_0x63b4('0x34')]['limit']);_0x5cf81e[_0x63b4('0x1b')]=qs[_0x63b4('0x1b')](_0x2d5fb0[_0x63b4('0x34')]['offset']);}_0x5cf81e[_0x63b4('0x3b')]=qs[_0x63b4('0x3c')](_0x2d5fb0['query']['sort']);_0x5cf81e['where']=qs[_0x63b4('0x35')](_[_0x63b4('0x3e')](_0x2d5fb0[_0x63b4('0x34')],_0x50f319[_0x63b4('0x35')]));_0x5cf81e[_0x63b4('0x3d')]['CampaignId']=_0x19ffd2['id'];if(_0x2d5fb0['query'][_0x63b4('0x3f')]){_0x5cf81e[_0x63b4('0x3d')]=_['merge'](_0x5cf81e[_0x63b4('0x3d')],{'$or':_[_0x63b4('0x2f')](_0x5cf81e[_0x63b4('0x37')],function(_0x51ca93){var _0x15a018={};_0x15a018[_0x51ca93]={'$like':'%'+_0x2d5fb0['query']['filter']+'%'};return _0x15a018;})});}_0x5cf81e=_[_0x63b4('0x40')]({},_0x5cf81e,_0x2d5fb0[_0x63b4('0x42')]);return db[_0x63b4('0x65')][_0x63b4('0x1e')]({'where':_0x5cf81e[_0x63b4('0x3d')]})[_0x63b4('0x26')](function(_0x2812c5){_0x2ca24f[_0x63b4('0x1e')]=_0x2812c5;if(_0x2d5fb0[_0x63b4('0x34')][_0x63b4('0x43')]){_0x5cf81e[_0x63b4('0x44')]=[{'all':!![]}];}return db[_0x63b4('0x65')][_0x63b4('0x46')](_0x5cf81e);})[_0x63b4('0x26')](function(_0x511ec2){_0x2ca24f[_0x63b4('0x47')]=_0x511ec2;return _0x2ca24f;});}})[_0x63b4('0x26')](respondWithFilteredResult(_0x54d330,_0x5cf81e))[_0x63b4('0x4d')](handleError(_0x54d330,null));};exports['getLists']=function(_0x467c64,_0x9e2fdc,_0x34449b){var _0x5b7ac2={};var _0x4a3860={};var _0x35b83d;var _0x60f6e6;return db['Campaign'][_0x63b4('0x5c')]({'where':{'id':_0x467c64[_0x63b4('0x49')]['id']}})[_0x63b4('0x26')](handleEntityNotFound(_0x9e2fdc,null))[_0x63b4('0x26')](function(_0x4a372d){if(_0x4a372d){_0x35b83d=_0x4a372d;_0x4a3860[_0x63b4('0x33')]=_[_0x63b4('0x4a')](db[_0x63b4('0x66')][_0x63b4('0x4b')]);_0x4a3860[_0x63b4('0x34')]=_['keys'](_0x467c64[_0x63b4('0x34')]);_0x4a3860[_0x63b4('0x35')]=_[_0x63b4('0x36')](_0x4a3860['model'],_0x4a3860['query']);_0x5b7ac2['attributes']=_[_0x63b4('0x36')](_0x4a3860[_0x63b4('0x33')],qs[_0x63b4('0x38')](_0x467c64[_0x63b4('0x34')][_0x63b4('0x38')]));_0x5b7ac2[_0x63b4('0x37')]=_0x5b7ac2[_0x63b4('0x37')][_0x63b4('0x39')]?_0x5b7ac2[_0x63b4('0x37')]:_0x4a3860[_0x63b4('0x33')];_0x5b7ac2['order']=qs['sort'](_0x467c64[_0x63b4('0x34')][_0x63b4('0x3c')]);_0x5b7ac2['where']=qs[_0x63b4('0x35')](_[_0x63b4('0x3e')](_0x467c64[_0x63b4('0x34')],_0x4a3860[_0x63b4('0x35')]));if(_0x467c64[_0x63b4('0x34')][_0x63b4('0x3f')]){_0x5b7ac2[_0x63b4('0x3d')]=_[_0x63b4('0x40')](_0x5b7ac2['where'],{'$or':_[_0x63b4('0x2f')](_0x5b7ac2[_0x63b4('0x37')],function(_0x52d045){var _0x185e42={};_0x185e42[_0x52d045]={'$like':'%'+_0x467c64[_0x63b4('0x34')][_0x63b4('0x3f')]+'%'};return _0x185e42;})});}_0x5b7ac2=_[_0x63b4('0x40')]({},_0x5b7ac2,_0x467c64[_0x63b4('0x42')]);return _0x35b83d[_0x63b4('0x67')](_0x5b7ac2);}})['then'](function(_0x1f0f75){if(_0x1f0f75){_0x60f6e6=_0x1f0f75['length'];if(!_0x467c64[_0x63b4('0x34')][_0x63b4('0x5d')](_0x63b4('0x3a'))){_0x5b7ac2[_0x63b4('0x1d')]=qs[_0x63b4('0x1d')](_0x467c64[_0x63b4('0x34')][_0x63b4('0x1d')]);_0x5b7ac2[_0x63b4('0x1b')]=qs['offset'](_0x467c64['query']['offset']);}return _0x35b83d[_0x63b4('0x67')](_0x5b7ac2);}})[_0x63b4('0x26')](function(_0x58e075){if(_0x58e075){return _0x58e075?{'count':_0x60f6e6,'rows':_0x58e075}:null;}})[_0x63b4('0x26')](respondWithResult(_0x9e2fdc,null))[_0x63b4('0x4d')](handleError(_0x9e2fdc,null));};exports[_0x63b4('0x68')]=function(_0x29491d,_0x91b009,_0x4c5a92){var _0x13d5aa,_0x10cf7e;var _0x427013=[];var _0x40bcc5=moment()[_0x63b4('0x69')](_0x63b4('0x6a'));return db[_0x63b4('0x45')][_0x63b4('0x4c')]({'where':{'id':_0x29491d[_0x63b4('0x49')]['id']}})[_0x63b4('0x26')](handleEntityNotFound(_0x91b009,null))[_0x63b4('0x26')](function(_0x271188){if(_0x271188){_0x10cf7e=_0x271188;return _0x271188['addLists'](_0x29491d[_0x63b4('0x57')][_0x63b4('0x6b')],_[_0x63b4('0x58')](_0x29491d[_0x63b4('0x57')],[_0x63b4('0x6b'),'id'])||{});}return null;})[_0x63b4('0x6c')](function(_0x564312){var _0x4f1573;var _0x18e2f8;_0x13d5aa=_0x564312||[];var _0x1b0f30=[];if(_0x564312){for(var _0x4f9113=0x0;_0x4f9113<_0x564312[_0x63b4('0x39')];_0x4f9113+=0x1){var _0x1041ca=_0x564312[_0x4f9113][_0x63b4('0x52')]({'plain':!![]});_0x10cf7e[_0x63b4('0x6d')]=_0x29491d[_0x63b4('0x57')][_0x63b4('0x6d')]?_0x29491d[_0x63b4('0x57')][_0x63b4('0x6d')]:_0x10cf7e[_0x63b4('0x6d')];switch(_0x10cf7e[_0x63b4('0x6d')]){case _0x63b4('0x6e'):_0x4f1573=squel['insert']()[_0x63b4('0x6f')]('cm_hopper')[_0x63b4('0x70')]([_0x63b4('0x71'),_0x63b4('0x72'),'ContactId',_0x63b4('0x73'),_0x63b4('0x61'),_0x63b4('0x56'),'updatedAt'],squel['select']()[_0x63b4('0x74')]('phone',_0x63b4('0x71'))[_0x63b4('0x74')](_0x63b4('0x75'),'scheduledAt')[_0x63b4('0x74')]('id','ContactId')[_0x63b4('0x74')](_0x1041ca[_0x63b4('0x76')][_0x63b4('0x77')](),_0x63b4('0x73'))['field'](_0x29491d[_0x63b4('0x49')]['id'][_0x63b4('0x77')](),_0x63b4('0x61'))[_0x63b4('0x74')]('\x27'+_0x40bcc5+'\x27',_0x63b4('0x56'))[_0x63b4('0x74')]('\x27'+_0x40bcc5+'\x27',_0x63b4('0x78'))['from'](_0x63b4('0x79'))['where']('deletedAt\x20IS\x20NULL')['where'](_0x63b4('0x7a'),_0x1041ca['CmListId'][_0x63b4('0x77')]())[_0x63b4('0x3d')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x63b4('0x7b'),squel['select']()[_0x63b4('0x74')](_0x63b4('0x7c'))[_0x63b4('0x7d')]('cm_hopper_final')[_0x63b4('0x3d')](_0x63b4('0x7e'),_0x29491d[_0x63b4('0x49')]['id'][_0x63b4('0x77')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x63b4('0x7f')]()[_0x63b4('0x74')](_0x63b4('0x80'))[_0x63b4('0x7d')](_0x63b4('0x81'))['where'](_0x63b4('0x7e'),_0x29491d[_0x63b4('0x49')]['id'][_0x63b4('0x77')]())))[_0x63b4('0x77')]();break;case _0x63b4('0x82'):_0x4f1573=squel[_0x63b4('0x83')]()[_0x63b4('0x6f')](_0x63b4('0x81'))[_0x63b4('0x70')]([_0x63b4('0x71'),'scheduledAt',_0x63b4('0x84'),'ListId',_0x63b4('0x61'),_0x63b4('0x56'),_0x63b4('0x78')],squel['select']()[_0x63b4('0x74')]('phone',_0x63b4('0x71'))['field'](_0x63b4('0x75'),_0x63b4('0x72'))[_0x63b4('0x74')]('id',_0x63b4('0x84'))[_0x63b4('0x74')](_0x1041ca[_0x63b4('0x76')][_0x63b4('0x77')](),'ListId')[_0x63b4('0x74')](_0x29491d[_0x63b4('0x49')]['id']['toString'](),_0x63b4('0x61'))[_0x63b4('0x74')]('\x27'+_0x40bcc5+'\x27',_0x63b4('0x56'))[_0x63b4('0x74')]('\x27'+_0x40bcc5+'\x27',_0x63b4('0x78'))[_0x63b4('0x7d')](_0x63b4('0x79'))['where'](_0x63b4('0x85'))[_0x63b4('0x3d')](_0x63b4('0x7a'),_0x1041ca['CmListId']['toString']())[_0x63b4('0x3d')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x63b4('0x7f')]()[_0x63b4('0x74')](_0x63b4('0x80'))[_0x63b4('0x7d')](_0x63b4('0x81'))[_0x63b4('0x3d')](_0x63b4('0x7e'),_0x29491d['params']['id'][_0x63b4('0x77')]())))[_0x63b4('0x77')]();break;default:_0x4f1573=squel[_0x63b4('0x83')]()['into'](_0x63b4('0x81'))[_0x63b4('0x70')]([_0x63b4('0x71'),_0x63b4('0x72'),_0x63b4('0x84'),_0x63b4('0x73'),_0x63b4('0x61'),_0x63b4('0x56'),_0x63b4('0x78')],squel[_0x63b4('0x7f')]()['field'](_0x63b4('0x71'),_0x63b4('0x71'))[_0x63b4('0x74')](_0x63b4('0x75'),_0x63b4('0x72'))['field']('id',_0x63b4('0x84'))['field'](_0x1041ca[_0x63b4('0x76')][_0x63b4('0x77')](),_0x63b4('0x73'))[_0x63b4('0x74')](_0x29491d[_0x63b4('0x49')]['id'][_0x63b4('0x77')](),_0x63b4('0x61'))[_0x63b4('0x74')]('\x27'+_0x40bcc5+'\x27',_0x63b4('0x56'))[_0x63b4('0x74')]('\x27'+_0x40bcc5+'\x27',_0x63b4('0x78'))[_0x63b4('0x7d')](_0x63b4('0x79'))[_0x63b4('0x3d')](_0x63b4('0x85'))[_0x63b4('0x3d')]('ListId\x20=\x20?',_0x1041ca[_0x63b4('0x76')][_0x63b4('0x77')]())['where'](_0x63b4('0x86')))['toString']();}_0x18e2f8=squel[_0x63b4('0x83')]()[_0x63b4('0x6f')](_0x63b4('0x87'))[_0x63b4('0x70')](['cmHopperId',_0x63b4('0x72'),_0x63b4('0x71'),_0x63b4('0x88'),_0x63b4('0x56'),'updatedAt'],squel[_0x63b4('0x7f')]()[_0x63b4('0x74')](_0x63b4('0x89'),'id')['field'](_0x63b4('0x75'),'scheduledAt')[_0x63b4('0x74')](_0x63b4('0x8a'),_0x63b4('0x71'))[_0x63b4('0x74')](_0x63b4('0x8b'),_0x63b4('0x88'))[_0x63b4('0x74')]('\x27'+_0x40bcc5+'\x27',_0x63b4('0x56'))['field']('\x27'+_0x40bcc5+'\x27','updatedAt')[_0x63b4('0x7d')](_0x63b4('0x8c'),'ci')[_0x63b4('0x8d')](_0x63b4('0x81'),'h',_0x63b4('0x8e'))[_0x63b4('0x3d')](_0x63b4('0x8f'),_0x1041ca[_0x63b4('0x76')][_0x63b4('0x77')]())[_0x63b4('0x3d')](_0x63b4('0x90'),_0x29491d[_0x63b4('0x49')]['id'][_0x63b4('0x77')]())[_0x63b4('0x3d')](_0x63b4('0x91'),_0x40bcc5))[_0x63b4('0x77')]();_0x1b0f30[_0x63b4('0x92')](db[_0x63b4('0x93')]['query'](_0x4f1573));_0x427013[_0x63b4('0x92')](db[_0x63b4('0x93')][_0x63b4('0x34')](_0x18e2f8));}return BPromise['all'](_0x1b0f30);}})[_0x63b4('0x26')](function(){return BPromise['all'](_0x427013);})[_0x63b4('0x26')](function(){return _0x13d5aa;})['then'](respondWithResult(_0x91b009,null))['catch'](handleError(_0x91b009,null));};exports[_0x63b4('0x94')]=function(_0xd52d12,_0x2a726c,_0x5765b1){return db['Campaign'][_0x63b4('0x4c')]({'where':{'id':_0xd52d12[_0x63b4('0x49')]['id']}})['then'](handleEntityNotFound(_0x2a726c,null))[_0x63b4('0x26')](function(_0x20fa58){if(_0x20fa58){return _0x20fa58[_0x63b4('0x94')](_0xd52d12[_0x63b4('0x34')][_0x63b4('0x6b')]);}})[_0x63b4('0x26')](function(_0x26aa5a){if(_0x26aa5a){return db[_0x63b4('0x5e')][_0x63b4('0x27')]({'where':{'ListId':_0xd52d12[_0x63b4('0x34')][_0x63b4('0x6b')],'CampaignId':_0xd52d12[_0x63b4('0x49')]['id']}})['then'](function(){return _0x26aa5a;});}})[_0x63b4('0x26')](respondWithStatusCode(_0x2a726c,null))[_0x63b4('0x4d')](handleError(_0x2a726c,null));};exports[_0x63b4('0x95')]=function(_0x492d40,_0x4ffcc7,_0x13d36d){var _0x5e23c2={};var _0x58535a={};var _0x8919c1;var _0x39954a;return db[_0x63b4('0x45')][_0x63b4('0x5c')]({'where':{'id':_0x492d40[_0x63b4('0x49')]['id']}})[_0x63b4('0x26')](handleEntityNotFound(_0x4ffcc7,null))[_0x63b4('0x26')](function(_0x59a91e){if(_0x59a91e){_0x8919c1=_0x59a91e;_0x58535a[_0x63b4('0x33')]=_['keys'](db[_0x63b4('0x66')][_0x63b4('0x4b')]);_0x58535a['query']=_[_0x63b4('0x4a')](_0x492d40[_0x63b4('0x34')]);_0x58535a[_0x63b4('0x35')]=_[_0x63b4('0x36')](_0x58535a[_0x63b4('0x33')],_0x58535a[_0x63b4('0x34')]);_0x5e23c2[_0x63b4('0x37')]=_[_0x63b4('0x36')](_0x58535a[_0x63b4('0x33')],qs['fields'](_0x492d40[_0x63b4('0x34')][_0x63b4('0x38')]));_0x5e23c2[_0x63b4('0x37')]=_0x5e23c2[_0x63b4('0x37')][_0x63b4('0x39')]?_0x5e23c2[_0x63b4('0x37')]:_0x58535a[_0x63b4('0x33')];_0x5e23c2['order']=qs[_0x63b4('0x3c')](_0x492d40[_0x63b4('0x34')][_0x63b4('0x3c')]);_0x5e23c2[_0x63b4('0x3d')]=qs[_0x63b4('0x35')](_[_0x63b4('0x3e')](_0x492d40[_0x63b4('0x34')],_0x58535a['filters']));if(_0x492d40['query'][_0x63b4('0x3f')]){_0x5e23c2[_0x63b4('0x3d')]=_[_0x63b4('0x40')](_0x5e23c2[_0x63b4('0x3d')],{'$or':_[_0x63b4('0x2f')](_0x5e23c2[_0x63b4('0x37')],function(_0x1ba394){var _0x5340bd={};_0x5340bd[_0x1ba394]={'$like':'%'+_0x492d40[_0x63b4('0x34')]['filter']+'%'};return _0x5340bd;})});}_0x5e23c2=_['merge']({},_0x5e23c2,_0x492d40[_0x63b4('0x42')]);return _0x8919c1['getBlackLists'](_0x5e23c2);}})['then'](function(_0x47907d){if(_0x47907d){_0x39954a=_0x47907d[_0x63b4('0x39')];if(!_0x492d40[_0x63b4('0x34')]['hasOwnProperty'](_0x63b4('0x3a'))){_0x5e23c2[_0x63b4('0x1d')]=qs[_0x63b4('0x1d')](_0x492d40[_0x63b4('0x34')][_0x63b4('0x1d')]);_0x5e23c2[_0x63b4('0x1b')]=qs[_0x63b4('0x1b')](_0x492d40[_0x63b4('0x34')][_0x63b4('0x1b')]);}return _0x8919c1[_0x63b4('0x95')](_0x5e23c2);}})[_0x63b4('0x26')](function(_0xedbde8){if(_0xedbde8){return _0xedbde8?{'count':_0x39954a,'rows':_0xedbde8}:null;}})[_0x63b4('0x26')](respondWithResult(_0x4ffcc7,null))[_0x63b4('0x4d')](handleError(_0x4ffcc7,null));};exports[_0x63b4('0x96')]=function(_0x509164,_0x59585e,_0xf33884){var _0x39c041,_0x1efd2b;var _0x11798c=[];var _0x13015a=moment()[_0x63b4('0x69')](_0x63b4('0x6a'));return db[_0x63b4('0x45')][_0x63b4('0x4c')]({'where':{'id':_0x509164['params']['id']}})['then'](handleEntityNotFound(_0x59585e,null))[_0x63b4('0x26')](function(_0xe2fbd1){if(_0xe2fbd1){_0x1efd2b=_0xe2fbd1;return _0xe2fbd1[_0x63b4('0x96')](_0x509164[_0x63b4('0x57')]['ids'],_[_0x63b4('0x58')](_0x509164[_0x63b4('0x57')],[_0x63b4('0x6b'),'id'])||{});}return null;})['spread'](function(_0x44172a){var _0x1f7d94;var _0x578eb8;_0x39c041=_0x44172a||[];var _0x392126=[];if(_0x44172a){for(var _0x36bd80=0x0;_0x36bd80<_0x44172a[_0x63b4('0x39')];_0x36bd80+=0x1){var _0x49783e=_0x44172a[_0x36bd80]['get']({'plain':!![]});_0x1f7d94=squel[_0x63b4('0x83')]()[_0x63b4('0x6f')](_0x63b4('0x97'))[_0x63b4('0x70')]([_0x63b4('0x71'),'ContactId',_0x63b4('0x73'),_0x63b4('0x61'),_0x63b4('0x56'),_0x63b4('0x78')],squel[_0x63b4('0x7f')]()[_0x63b4('0x74')](_0x63b4('0x71'),_0x63b4('0x71'))[_0x63b4('0x74')]('id',_0x63b4('0x84'))[_0x63b4('0x74')](_0x49783e['CmListId'][_0x63b4('0x77')](),_0x63b4('0x73'))[_0x63b4('0x74')](_0x509164[_0x63b4('0x49')]['id'][_0x63b4('0x77')](),_0x63b4('0x61'))[_0x63b4('0x74')](_0x63b4('0x75'),_0x63b4('0x56'))['field'](_0x63b4('0x75'),_0x63b4('0x78'))[_0x63b4('0x7d')](_0x63b4('0x79'))[_0x63b4('0x3d')](_0x63b4('0x85'))['where'](_0x63b4('0x7a'),_0x49783e[_0x63b4('0x76')][_0x63b4('0x77')]())[_0x63b4('0x3d')]('phone\x20IS\x20NOT\x20NULL'))[_0x63b4('0x77')]();_0x392126[_0x63b4('0x92')](db[_0x63b4('0x93')][_0x63b4('0x34')](_0x1f7d94));}return BPromise[_0x63b4('0x98')](_0x392126);}})[_0x63b4('0x26')](function(){return _0x39c041;})[_0x63b4('0x26')](respondWithResult(_0x59585e,null))['catch'](handleError(_0x59585e,null));};exports[_0x63b4('0x99')]=function(_0x4496e9,_0x507b3c,_0x4926f3){return db[_0x63b4('0x45')][_0x63b4('0x4c')]({'where':{'id':_0x4496e9[_0x63b4('0x49')]['id']}})['then'](handleEntityNotFound(_0x507b3c,null))[_0x63b4('0x26')](function(_0x21e9cc){if(_0x21e9cc){return _0x21e9cc[_0x63b4('0x99')](_0x4496e9['query']['ids']);}})[_0x63b4('0x26')](function(_0x9376e5){if(_0x9376e5){return db[_0x63b4('0x65')][_0x63b4('0x27')]({'where':{'ListId':_0x4496e9['query'][_0x63b4('0x6b')],'CampaignId':_0x4496e9[_0x63b4('0x49')]['id']}})[_0x63b4('0x26')](function(){return _0x9376e5;});}})[_0x63b4('0x26')](respondWithStatusCode(_0x507b3c,null))[_0x63b4('0x4d')](handleError(_0x507b3c,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index a3cf28e..af73956 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(_0x197127,_0x48bbfd){var _0x558ca6=function(_0x580faf){while(--_0x580faf){_0x197127['push'](_0x197127['shift']());}};_0x558ca6(++_0x48bbfd);}(_0x7a54,0x106));var _0x47a5=function(_0x50e998,_0x281bd1){_0x50e998=_0x50e998-0x0;var _0x180ebf=_0x7a54[_0x50e998];return _0x180ebf;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 16c3a8a..2f330e8 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 _0xdb4b=['Campaign','options','raw','where','attributes','limit','include','map','model','stringify','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','Campaign,\x20%s,\x20%s','result','GetCampaign'];(function(_0x33fd3a,_0x1cf330){var _0x22687a=function(_0x5cd3b2){while(--_0x5cd3b2){_0x33fd3a['push'](_0x33fd3a['shift']());}};_0x22687a(++_0x1cf330);}(_0xdb4b,0xd7));var _0xbdb4=function(_0x8f448c,_0x5587a4){_0x8f448c=_0x8f448c-0x0;var _0x24b4e3=_0xdb4b[_0x8f448c];return _0x24b4e3;};'use strict';var _=require('lodash');var util=require(_0xbdb4('0x0'));var moment=require('moment');var BPromise=require(_0xbdb4('0x1'));var rs=require(_0xbdb4('0x2'));var fs=require('fs');var Redis=require(_0xbdb4('0x3'));var db=require(_0xbdb4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbdb4('0x5'))(_0xbdb4('0x6'));var config=require(_0xbdb4('0x7'));var jayson=require(_0xbdb4('0x8'));var client=jayson[_0xbdb4('0x9')][_0xbdb4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1dcaa1,_0x565f24,_0x5b0b37){return new BPromise(function(_0x1345fd,_0x3a2b2d){return client[_0xbdb4('0xb')](_0x1dcaa1,_0x5b0b37)[_0xbdb4('0xc')](function(_0x57ded4){logger[_0xbdb4('0xd')]('Campaign,\x20%s,\x20%s',_0x565f24,_0xbdb4('0xe'));logger[_0xbdb4('0xf')](_0xbdb4('0x10'),_0x565f24,'request\x20sent',JSON['stringify'](_0x57ded4));if(_0x57ded4[_0xbdb4('0x11')]){if(_0x57ded4[_0xbdb4('0x11')][_0xbdb4('0x12')]===0x1f4){logger[_0xbdb4('0x11')]('Campaign,\x20%s,\x20%s',_0x565f24,_0x57ded4['error'][_0xbdb4('0x13')]);return _0x3a2b2d(_0x57ded4[_0xbdb4('0x11')][_0xbdb4('0x13')]);}logger[_0xbdb4('0x11')](_0xbdb4('0x14'),_0x565f24,_0x57ded4[_0xbdb4('0x11')]['message']);return _0x1345fd(_0x57ded4['error'][_0xbdb4('0x13')]);}else{logger[_0xbdb4('0xd')]('Campaign,\x20%s,\x20%s',_0x565f24,_0xbdb4('0xe'));_0x1345fd(_0x57ded4[_0xbdb4('0x15')]['message']);}})['catch'](function(_0x3b7c35){logger[_0xbdb4('0x11')]('Campaign,\x20%s,\x20%s',_0x565f24,_0x3b7c35);_0x3a2b2d(_0x3b7c35);});});}exports[_0xbdb4('0x16')]=function(_0x113471){var _0x4a180b=this;return new Promise(function(_0x2ca1d5,_0x1e5d10){return db[_0xbdb4('0x17')]['findAll']({'raw':_0x113471['options']?_0x113471[_0xbdb4('0x18')][_0xbdb4('0x19')]===undefined?!![]:![]:!![],'where':_0x113471['options']?_0x113471[_0xbdb4('0x18')][_0xbdb4('0x1a')]||null:null,'attributes':_0x113471[_0xbdb4('0x18')]?_0x113471['options'][_0xbdb4('0x1b')]||null:null,'limit':_0x113471['options']?_0x113471[_0xbdb4('0x18')][_0xbdb4('0x1c')]||null:null,'include':_0x113471[_0xbdb4('0x18')]?_0x113471[_0xbdb4('0x18')][_0xbdb4('0x1d')]?_[_0xbdb4('0x1e')](_0x113471['options'][_0xbdb4('0x1d')],function(_0x18b284){return{'model':db[_0x18b284[_0xbdb4('0x1f')]],'as':_0x18b284['as'],'attributes':_0x18b284[_0xbdb4('0x1b')],'include':_0x18b284[_0xbdb4('0x1d')]?_['map'](_0x18b284[_0xbdb4('0x1d')],function(_0x18a6f6){return{'model':db[_0x18a6f6[_0xbdb4('0x1f')]],'as':_0x18a6f6['as'],'attributes':_0x18a6f6['attributes'],'include':_0x18a6f6['include']?_[_0xbdb4('0x1e')](_0x18a6f6[_0xbdb4('0x1d')],function(_0x3b3e0b){return{'model':db[_0x3b3e0b[_0xbdb4('0x1f')]],'as':_0x3b3e0b['as'],'attributes':_0x3b3e0b[_0xbdb4('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xbdb4('0xc')](function(_0x401be4){logger[_0xbdb4('0xd')](_0xbdb4('0x16'),_0x113471);logger[_0xbdb4('0xf')]('GetCampaign',_0x113471,JSON[_0xbdb4('0x20')](_0x401be4));_0x2ca1d5(_0x401be4);})[_0xbdb4('0x21')](function(_0x1246a7){logger[_0xbdb4('0x11')](_0xbdb4('0x16'),_0x1246a7['message'],_0x113471);_0x1e5d10(_0x4a180b[_0xbdb4('0x11')](0x1f4,_0x1246a7[_0xbdb4('0x13')]));});});}; \ No newline at end of file +var _0x4c6d=['info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetCampaign','Campaign','findAll','options','raw','where','limit','include','map','model','attributes','then','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request'];(function(_0x14f75f,_0x14b38f){var _0x27afbe=function(_0x503ed0){while(--_0x503ed0){_0x14f75f['push'](_0x14f75f['shift']());}};_0x27afbe(++_0x14b38f);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0x3bccce,_0x480619){_0x3bccce=_0x3bccce-0x0;var _0xd45a4=_0x4c6d[_0x3bccce];return _0xd45a4;};'use strict';var _=require(_0xd4c6('0x0'));var util=require(_0xd4c6('0x1'));var moment=require(_0xd4c6('0x2'));var BPromise=require(_0xd4c6('0x3'));var rs=require(_0xd4c6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd4c6('0x5'))['db'];var utils=require(_0xd4c6('0x6'));var logger=require(_0xd4c6('0x7'))('rpc');var config=require(_0xd4c6('0x8'));var jayson=require(_0xd4c6('0x9'));var client=jayson['client'][_0xd4c6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x316314,_0x4329e3,_0x5d4fce){return new BPromise(function(_0x440ee3,_0x19ce1c){return client[_0xd4c6('0xb')](_0x316314,_0x5d4fce)['then'](function(_0xe2f90b){logger[_0xd4c6('0xc')](_0xd4c6('0xd'),_0x4329e3,'request\x20sent');logger[_0xd4c6('0xe')](_0xd4c6('0xf'),_0x4329e3,_0xd4c6('0x10'),JSON[_0xd4c6('0x11')](_0xe2f90b));if(_0xe2f90b[_0xd4c6('0x12')]){if(_0xe2f90b[_0xd4c6('0x12')]['code']===0x1f4){logger['error'](_0xd4c6('0xd'),_0x4329e3,_0xe2f90b['error'][_0xd4c6('0x13')]);return _0x19ce1c(_0xe2f90b[_0xd4c6('0x12')][_0xd4c6('0x13')]);}logger[_0xd4c6('0x12')](_0xd4c6('0xd'),_0x4329e3,_0xe2f90b[_0xd4c6('0x12')][_0xd4c6('0x13')]);return _0x440ee3(_0xe2f90b['error']['message']);}else{logger[_0xd4c6('0xc')](_0xd4c6('0xd'),_0x4329e3,_0xd4c6('0x10'));_0x440ee3(_0xe2f90b[_0xd4c6('0x14')][_0xd4c6('0x13')]);}})[_0xd4c6('0x15')](function(_0xe52075){logger['error'](_0xd4c6('0xd'),_0x4329e3,_0xe52075);_0x19ce1c(_0xe52075);});});}exports[_0xd4c6('0x16')]=function(_0x23a16f){var _0x2c97b=this;return new Promise(function(_0x31f328,_0x54e0a5){return db[_0xd4c6('0x17')][_0xd4c6('0x18')]({'raw':_0x23a16f[_0xd4c6('0x19')]?_0x23a16f['options'][_0xd4c6('0x1a')]===undefined?!![]:![]:!![],'where':_0x23a16f[_0xd4c6('0x19')]?_0x23a16f[_0xd4c6('0x19')][_0xd4c6('0x1b')]||null:null,'attributes':_0x23a16f['options']?_0x23a16f[_0xd4c6('0x19')]['attributes']||null:null,'limit':_0x23a16f[_0xd4c6('0x19')]?_0x23a16f[_0xd4c6('0x19')][_0xd4c6('0x1c')]||null:null,'include':_0x23a16f[_0xd4c6('0x19')]?_0x23a16f[_0xd4c6('0x19')][_0xd4c6('0x1d')]?_[_0xd4c6('0x1e')](_0x23a16f[_0xd4c6('0x19')][_0xd4c6('0x1d')],function(_0x466330){return{'model':db[_0x466330[_0xd4c6('0x1f')]],'as':_0x466330['as'],'attributes':_0x466330[_0xd4c6('0x20')],'include':_0x466330['include']?_['map'](_0x466330[_0xd4c6('0x1d')],function(_0x2febbf){return{'model':db[_0x2febbf['model']],'as':_0x2febbf['as'],'attributes':_0x2febbf[_0xd4c6('0x20')],'include':_0x2febbf[_0xd4c6('0x1d')]?_[_0xd4c6('0x1e')](_0x2febbf['include'],function(_0x35b50c){return{'model':db[_0x35b50c[_0xd4c6('0x1f')]],'as':_0x35b50c['as'],'attributes':_0x35b50c['attributes']};}):[]};}):[]};}):[]:[]})[_0xd4c6('0x21')](function(_0x8ce066){logger[_0xd4c6('0xc')]('GetCampaign',_0x23a16f);logger[_0xd4c6('0xe')](_0xd4c6('0x16'),_0x23a16f,JSON[_0xd4c6('0x11')](_0x8ce066));_0x31f328(_0x8ce066);})[_0xd4c6('0x15')](function(_0x2e8c34){logger[_0xd4c6('0x12')](_0xd4c6('0x16'),_0x2e8c34[_0xd4c6('0x13')],_0x23a16f);_0x54e0a5(_0x2c97b[_0xd4c6('0x12')](0x1f4,_0x2e8c34[_0xd4c6('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 45f8e27..0716eb2 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 _0x077a=['getHopperHistories','getHopperFinals','/:id/hopper_black','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','put','/:id','update','delete','removeBlackLists','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','getHoppers','/:id/hopper_histories'];(function(_0x544752,_0x4cbed2){var _0xdb0644=function(_0x4387a4){while(--_0x4387a4){_0x544752['push'](_0x544752['shift']());}};_0xdb0644(++_0x4cbed2);}(_0x077a,0x1f2));var _0xa077=function(_0x311f44,_0x1d7f5b){_0x311f44=_0x311f44-0x0;var _0x46f1e6=_0x077a[_0x311f44];return _0x46f1e6;};'use strict';var multer=require(_0xa077('0x0'));var util=require('util');var path=require(_0xa077('0x1'));var timeout=require(_0xa077('0x2'));var express=require(_0xa077('0x3'));var router=express[_0xa077('0x4')]();var fs_extra=require(_0xa077('0x5'));var auth=require(_0xa077('0x6'));var interaction=require(_0xa077('0x7'));var config=require(_0xa077('0x8'));var controller=require('./campaign.controller');router[_0xa077('0x9')]('/',auth[_0xa077('0xa')](),controller['index']);router['get']('/:id',auth[_0xa077('0xa')](),controller[_0xa077('0xb')]);router['get']('/:id/hoppers',auth[_0xa077('0xa')](),controller[_0xa077('0xc')]);router[_0xa077('0x9')](_0xa077('0xd'),auth[_0xa077('0xa')](),controller[_0xa077('0xe')]);router[_0xa077('0x9')]('/:id/hopper_finals',auth[_0xa077('0xa')](),controller[_0xa077('0xf')]);router[_0xa077('0x9')](_0xa077('0x10'),auth['isAuthenticated'](),controller['getHopperBlacks']);router[_0xa077('0x9')](_0xa077('0x11'),auth[_0xa077('0xa')](),controller[_0xa077('0x12')]);router[_0xa077('0x9')](_0xa077('0x13'),auth[_0xa077('0xa')](),controller[_0xa077('0x14')]);router[_0xa077('0x15')]('/',auth[_0xa077('0xa')](),controller[_0xa077('0x16')]);router[_0xa077('0x15')](_0xa077('0x17'),auth[_0xa077('0xa')](),controller[_0xa077('0x18')]);router[_0xa077('0x15')](_0xa077('0x11'),auth[_0xa077('0xa')](),controller[_0xa077('0x19')]);router[_0xa077('0x15')](_0xa077('0x13'),auth['isAuthenticated'](),controller['addBlackLists']);router[_0xa077('0x1a')](_0xa077('0x1b'),auth[_0xa077('0xa')](),controller[_0xa077('0x1c')]);router[_0xa077('0x1d')]('/:id',auth[_0xa077('0xa')](),controller['destroy']);router[_0xa077('0x1d')](_0xa077('0x11'),auth[_0xa077('0xa')](),controller['removeLists']);router[_0xa077('0x1d')](_0xa077('0x13'),auth[_0xa077('0xa')](),controller[_0xa077('0x1e')]);module[_0xa077('0x1f')]=router; \ No newline at end of file +var _0x831e=['addBlackLists','put','update','delete','removeLists','removeBlackLists','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','/:id','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','addLists'];(function(_0x1f8d8d,_0x54a5c4){var _0x5c16d9=function(_0x41f668){while(--_0x41f668){_0x1f8d8d['push'](_0x1f8d8d['shift']());}};_0x5c16d9(++_0x54a5c4);}(_0x831e,0xb0));var _0xe831=function(_0x4fabe2,_0xd4a7dd){_0x4fabe2=_0x4fabe2-0x0;var _0x2cebc1=_0x831e[_0x4fabe2];return _0x2cebc1;};'use strict';var multer=require(_0xe831('0x0'));var util=require('util');var path=require(_0xe831('0x1'));var timeout=require(_0xe831('0x2'));var express=require('express');var router=express[_0xe831('0x3')]();var fs_extra=require(_0xe831('0x4'));var auth=require(_0xe831('0x5'));var interaction=require(_0xe831('0x6'));var config=require(_0xe831('0x7'));var controller=require(_0xe831('0x8'));router[_0xe831('0x9')]('/',auth[_0xe831('0xa')](),controller['index']);router['get'](_0xe831('0xb'),auth[_0xe831('0xa')](),controller[_0xe831('0xc')]);router[_0xe831('0x9')](_0xe831('0xd'),auth[_0xe831('0xa')](),controller['getHoppers']);router[_0xe831('0x9')](_0xe831('0xe'),auth[_0xe831('0xa')](),controller[_0xe831('0xf')]);router[_0xe831('0x9')](_0xe831('0x10'),auth[_0xe831('0xa')](),controller[_0xe831('0x11')]);router[_0xe831('0x9')](_0xe831('0x12'),auth[_0xe831('0xa')](),controller[_0xe831('0x13')]);router['get'](_0xe831('0x14'),auth[_0xe831('0xa')](),controller[_0xe831('0x15')]);router[_0xe831('0x9')](_0xe831('0x16'),auth[_0xe831('0xa')](),controller[_0xe831('0x17')]);router[_0xe831('0x18')]('/',auth[_0xe831('0xa')](),controller['create']);router['post'](_0xe831('0x19'),auth[_0xe831('0xa')](),controller[_0xe831('0x1a')]);router[_0xe831('0x18')](_0xe831('0x14'),auth[_0xe831('0xa')](),controller[_0xe831('0x1b')]);router[_0xe831('0x18')](_0xe831('0x16'),auth[_0xe831('0xa')](),controller[_0xe831('0x1c')]);router[_0xe831('0x1d')]('/:id',auth[_0xe831('0xa')](),controller[_0xe831('0x1e')]);router[_0xe831('0x1f')]('/:id',auth['isAuthenticated'](),controller['destroy']);router['delete']('/:id/lists',auth['isAuthenticated'](),controller[_0xe831('0x20')]);router[_0xe831('0x1f')](_0xe831('0x16'),auth[_0xe831('0xa')](),controller[_0xe831('0x21')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index c0f5866..ac46ca4 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 _0xc5dd=['key','sequelize','exports','STRING','medium','VIRTUAL','getDataValue'];(function(_0x5d3fff,_0x5bd503){var _0xdda096=function(_0x5a3543){while(--_0x5a3543){_0x5d3fff['push'](_0x5d3fff['shift']());}};_0xdda096(++_0x5bd503);}(_0xc5dd,0x143));var _0xdc5d=function(_0x40c50b,_0x168f67){_0x40c50b=_0x40c50b-0x0;var _0x50b563=_0xc5dd[_0x40c50b];return _0x50b563;};'use strict';var Sequelize=require(_0xdc5d('0x0'));module[_0xdc5d('0x1')]={'key':{'type':Sequelize[_0xdc5d('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'length':_0xdc5d('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xdc5d('0x2')]},'name':{'type':Sequelize[_0xdc5d('0x4')],'get':function(){return this[_0xdc5d('0x5')](_0xdc5d('0x6'));}}}; \ No newline at end of file +var _0x5dd4=['sequelize','STRING','TEXT','medium','VIRTUAL','getDataValue','key'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0x5dd4,0x1ea));var _0x45dd=function(_0x3b74a3,_0x14d65b){_0x3b74a3=_0x3b74a3-0x0;var _0x2605ce=_0x5dd4[_0x3b74a3];return _0x2605ce;};'use strict';var Sequelize=require(_0x45dd('0x0'));module['exports']={'key':{'type':Sequelize[_0x45dd('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x45dd('0x2')],'length':_0x45dd('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x45dd('0x1')]},'name':{'type':Sequelize[_0x45dd('0x4')],'get':function(){return this[_0x45dd('0x5')](_0x45dd('0x6'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 5947e3e..8112d08 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 _0x3b0e=['body','destroy','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','undefined','limit','count','offset','set','apply','reject','save','update','then','CannedAnswers','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','CannedAnswer'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3b0e,0x1d5));var _0xe3b0=function(_0x1e83df,_0x187f48){_0x1e83df=_0x1e83df-0x0;var _0x31822b=_0x3b0e[_0x1e83df];return _0x31822b;};'use strict';var emlformat=require(_0xe3b0('0x0'));var rimraf=require(_0xe3b0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe3b0('0x2'));var moment=require(_0xe3b0('0x3'));var BPromise=require(_0xe3b0('0x4'));var Mustache=require(_0xe3b0('0x5'));var util=require('util');var path=require(_0xe3b0('0x6'));var sox=require(_0xe3b0('0x7'));var csv=require('to-csv');var ejs=require(_0xe3b0('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe3b0('0x9'));var squel=require(_0xe3b0('0xa'));var crypto=require(_0xe3b0('0xb'));var jsforce=require(_0xe3b0('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe3b0('0xd'));var querystring=require(_0xe3b0('0xe'));var Papa=require('papaparse');var Redis=require(_0xe3b0('0xf'));var authService=require(_0xe3b0('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe3b0('0x11'));var hardwareService=require(_0xe3b0('0x12'));var logger=require(_0xe3b0('0x13'))(_0xe3b0('0x14'));var utils=require(_0xe3b0('0x15'));var config=require(_0xe3b0('0x16'));var licenseUtil=require(_0xe3b0('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2866dd,_0x394e9d){_0x394e9d=_0x394e9d||0xcc;return function(_0x2005a0){if(_0x2005a0){return _0x2866dd['sendStatus'](_0x394e9d);}return _0x2866dd['status'](_0x394e9d)[_0xe3b0('0x18')]();};}function respondWithResult(_0x1b2253,_0x55ee15){_0x55ee15=_0x55ee15||0xc8;return function(_0x2ebb0c){if(_0x2ebb0c){return _0x1b2253[_0xe3b0('0x19')](_0x55ee15)[_0xe3b0('0x1a')](_0x2ebb0c);}};}function respondWithFilteredResult(_0x421ca7,_0x21e6df){return function(_0x3dd1a3){if(_0x3dd1a3){var _0x1ff17f=typeof _0x21e6df['offset']===_0xe3b0('0x1b')&&typeof _0x21e6df[_0xe3b0('0x1c')]===_0xe3b0('0x1b');var _0x5e68e0=_0x3dd1a3[_0xe3b0('0x1d')];var _0x4bbfed=_0x1ff17f?0x0:_0x21e6df[_0xe3b0('0x1e')];var _0x539a2f=_0x1ff17f?_0x3dd1a3[_0xe3b0('0x1d')]:_0x21e6df[_0xe3b0('0x1e')]+_0x21e6df['limit'];var _0x35a39b;if(_0x539a2f>=_0x5e68e0){_0x539a2f=_0x5e68e0;_0x35a39b=0xc8;}else{_0x35a39b=0xce;}_0x421ca7[_0xe3b0('0x19')](_0x35a39b);return _0x421ca7[_0xe3b0('0x1f')]('Content-Range',_0x4bbfed+'-'+_0x539a2f+'/'+_0x5e68e0)[_0xe3b0('0x1a')](_0x3dd1a3);}return null;};}function patchUpdates(_0x1df416){return function(_0x3d5aed){try{jsonpatch[_0xe3b0('0x20')](_0x3d5aed,_0x1df416,!![]);}catch(_0x1fc3b2){return BPromise[_0xe3b0('0x21')](_0x1fc3b2);}return _0x3d5aed[_0xe3b0('0x22')]();};}function saveUpdates(_0x369973,_0x4cc141){return function(_0xe2facb){if(_0xe2facb){return _0xe2facb[_0xe3b0('0x23')](_0x369973)[_0xe3b0('0x24')](function(_0x4412fc){return _0x4412fc;});}return null;};}function removeEntity(_0x5a8359,_0x4d3a87){return function(_0x42b69c){if(_0x42b69c){return _0x42b69c['destroy']()['then'](function(){var _0x1e9470=_0x42b69c['get']({'plain':!![]});var _0x39f148=_0xe3b0('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x39f148,'resourceId':_0x1e9470['id']}})[_0xe3b0('0x24')](function(){return _0x42b69c;});})[_0xe3b0('0x24')](function(){_0x5a8359[_0xe3b0('0x19')](0xcc)[_0xe3b0('0x18')]();});}};}function handleEntityNotFound(_0x4019a9,_0x17ac31){return function(_0x205be1){if(!_0x205be1){_0x4019a9['sendStatus'](0x194);}return _0x205be1;};}function handleError(_0x3df6b6,_0x544061){_0x544061=_0x544061||0x1f4;return function(_0x2d4a9e){logger[_0xe3b0('0x26')](_0x2d4a9e[_0xe3b0('0x27')]);if(_0x2d4a9e[_0xe3b0('0x28')]){delete _0x2d4a9e[_0xe3b0('0x28')];}_0x3df6b6[_0xe3b0('0x19')](_0x544061)['send'](_0x2d4a9e);};}exports[_0xe3b0('0x29')]=function(_0x5f4076,_0xdf02a8){var _0x590ff9={},_0x1f1521={},_0x4be3c6={'count':0x0,'rows':[]};var _0x588aaa=_[_0xe3b0('0x2a')](db['CannedAnswer'][_0xe3b0('0x2b')],function(_0x6cf764){return{'name':_0x6cf764[_0xe3b0('0x2c')],'type':_0x6cf764[_0xe3b0('0x2d')][_0xe3b0('0x2e')]};});_0x1f1521[_0xe3b0('0x2f')]=_['map'](_0x588aaa,_0xe3b0('0x28'));_0x1f1521[_0xe3b0('0x30')]=_[_0xe3b0('0x31')](_0x5f4076[_0xe3b0('0x30')]);_0x1f1521[_0xe3b0('0x32')]=_['intersection'](_0x1f1521['model'],_0x1f1521['query']);_0x590ff9[_0xe3b0('0x33')]=_[_0xe3b0('0x34')](_0x1f1521['model'],qs[_0xe3b0('0x35')](_0x5f4076[_0xe3b0('0x30')][_0xe3b0('0x35')]));_0x590ff9[_0xe3b0('0x33')]=_0x590ff9[_0xe3b0('0x33')][_0xe3b0('0x36')]?_0x590ff9[_0xe3b0('0x33')]:_0x1f1521[_0xe3b0('0x2f')];if(!_0x5f4076[_0xe3b0('0x30')][_0xe3b0('0x37')]('nolimit')){_0x590ff9[_0xe3b0('0x1c')]=qs[_0xe3b0('0x1c')](_0x5f4076[_0xe3b0('0x30')][_0xe3b0('0x1c')]);_0x590ff9[_0xe3b0('0x1e')]=qs[_0xe3b0('0x1e')](_0x5f4076['query'][_0xe3b0('0x1e')]);}_0x590ff9[_0xe3b0('0x38')]=qs[_0xe3b0('0x39')](_0x5f4076[_0xe3b0('0x30')]['sort']);_0x590ff9[_0xe3b0('0x3a')]=qs['filters'](_[_0xe3b0('0x3b')](_0x5f4076[_0xe3b0('0x30')],_0x1f1521['filters']),_0x588aaa);if(_0x5f4076[_0xe3b0('0x30')]['filter']){_0x590ff9[_0xe3b0('0x3a')]=_[_0xe3b0('0x3c')](_0x590ff9['where'],{'$or':[{'key':{'$like':'%'+_0x5f4076['query'][_0xe3b0('0x3d')]+'%'}},{'value':{'$like':'%'+_0x5f4076['query'][_0xe3b0('0x3d')]+'%'}}]});}_0x590ff9=_[_0xe3b0('0x3c')]({},_0x590ff9,_0x5f4076[_0xe3b0('0x3e')]);var _0x333a59={'where':_0x590ff9[_0xe3b0('0x3a')]};return db['CannedAnswer'][_0xe3b0('0x1d')](_0x333a59)[_0xe3b0('0x24')](function(_0x367f06){_0x4be3c6['count']=_0x367f06;if(_0x5f4076[_0xe3b0('0x30')][_0xe3b0('0x3f')]){_0x590ff9[_0xe3b0('0x40')]=[{'all':!![]}];}return db['CannedAnswer'][_0xe3b0('0x41')](_0x590ff9);})[_0xe3b0('0x24')](function(_0x25a193){_0x4be3c6[_0xe3b0('0x42')]=_0x25a193;return _0x4be3c6;})['then'](respondWithFilteredResult(_0xdf02a8,_0x590ff9))[_0xe3b0('0x43')](handleError(_0xdf02a8,null));};exports[_0xe3b0('0x44')]=function(_0x367864,_0x2a0f5e){var _0x4b4e82={'raw':!![],'where':{'id':_0x367864[_0xe3b0('0x45')]['id']}},_0x32eb14={};_0x32eb14[_0xe3b0('0x2f')]=_[_0xe3b0('0x31')](db[_0xe3b0('0x46')][_0xe3b0('0x2b')]);_0x32eb14['query']=_[_0xe3b0('0x31')](_0x367864[_0xe3b0('0x30')]);_0x32eb14['filters']=_[_0xe3b0('0x34')](_0x32eb14[_0xe3b0('0x2f')],_0x32eb14['query']);_0x4b4e82[_0xe3b0('0x33')]=_[_0xe3b0('0x34')](_0x32eb14['model'],qs[_0xe3b0('0x35')](_0x367864[_0xe3b0('0x30')]['fields']));_0x4b4e82[_0xe3b0('0x33')]=_0x4b4e82['attributes']['length']?_0x4b4e82[_0xe3b0('0x33')]:_0x32eb14['model'];if(_0x367864[_0xe3b0('0x30')][_0xe3b0('0x3f')]){_0x4b4e82[_0xe3b0('0x40')]=[{'all':!![]}];}_0x4b4e82=_['merge']({},_0x4b4e82,_0x367864[_0xe3b0('0x3e')]);return db[_0xe3b0('0x46')]['find'](_0x4b4e82)[_0xe3b0('0x24')](handleEntityNotFound(_0x2a0f5e,null))[_0xe3b0('0x24')](respondWithResult(_0x2a0f5e,null))[_0xe3b0('0x43')](handleError(_0x2a0f5e,null));};exports[_0xe3b0('0x23')]=function(_0x4ffcc3,_0x261623){if(_0x4ffcc3[_0xe3b0('0x47')]['id']){delete _0x4ffcc3[_0xe3b0('0x47')]['id'];}return db[_0xe3b0('0x46')]['find']({'where':{'id':_0x4ffcc3[_0xe3b0('0x45')]['id']}})[_0xe3b0('0x24')](handleEntityNotFound(_0x261623,null))[_0xe3b0('0x24')](saveUpdates(_0x4ffcc3[_0xe3b0('0x47')],null))[_0xe3b0('0x24')](respondWithResult(_0x261623,null))[_0xe3b0('0x43')](handleError(_0x261623,null));};exports[_0xe3b0('0x48')]=function(_0x6513f4,_0x16dd0b){return db[_0xe3b0('0x46')][_0xe3b0('0x49')]({'where':{'id':_0x6513f4[_0xe3b0('0x45')]['id']}})['then'](handleEntityNotFound(_0x16dd0b,null))['then'](removeEntity(_0x16dd0b,null))[_0xe3b0('0x43')](handleError(_0x16dd0b,null));};exports[_0xe3b0('0x4a')]=function(_0x3cbc34,_0x2fb3c1){var _0x586375={'key':_0x3cbc34['body']['key']};if(_0x3cbc34[_0xe3b0('0x47')][_0xe3b0('0x4b')]){_0x586375['MailAccountId']=_0x3cbc34[_0xe3b0('0x47')][_0xe3b0('0x4b')];}else if(_0x3cbc34[_0xe3b0('0x47')][_0xe3b0('0x4c')]){_0x586375[_0xe3b0('0x4c')]=_0x3cbc34[_0xe3b0('0x47')]['SmsAccountId'];}else if(_0x3cbc34[_0xe3b0('0x47')][_0xe3b0('0x4d')]){_0x586375[_0xe3b0('0x4d')]=_0x3cbc34['body'][_0xe3b0('0x4d')];}else if(_0x3cbc34['body'][_0xe3b0('0x4e')]){_0x586375[_0xe3b0('0x4e')]=_0x3cbc34[_0xe3b0('0x47')][_0xe3b0('0x4e')];}return db[_0xe3b0('0x46')][_0xe3b0('0x49')]({'where':_0x586375})[_0xe3b0('0x24')](function(_0x2dd4e5){if(_0x2dd4e5){throw new db[(_0xe3b0('0x4f'))][(_0xe3b0('0x50'))](_0xe3b0('0x51'));}return db['CannedAnswer'][_0xe3b0('0x4a')](_0x3cbc34[_0xe3b0('0x47')]);})['then'](function(_0x597ee4){var _0x475917=_0x3cbc34[_0xe3b0('0x52')]['get']({'plain':!![]});if(!_0x475917)throw new Error(_0xe3b0('0x53'));if(_0x475917[_0xe3b0('0x54')]===_0xe3b0('0x52')){var _0x23fe93=_0x597ee4['get']({'plain':!![]});return db[_0xe3b0('0x55')][_0xe3b0('0x49')]({'where':{'name':'CannedAnswers','userProfileId':_0x475917[_0xe3b0('0x56')]},'raw':!![]})[_0xe3b0('0x24')](function(_0x47bca2){if(_0x47bca2&&_0x47bca2[_0xe3b0('0x57')]===0x0){return db[_0xe3b0('0x58')]['create']({'name':_0x23fe93[_0xe3b0('0x28')],'resourceId':_0x23fe93['id'],'type':_0x47bca2[_0xe3b0('0x28')],'sectionId':_0x47bca2['id']},{})[_0xe3b0('0x24')](function(){return _0x597ee4;});}else{return _0x597ee4;}})[_0xe3b0('0x43')](function(_0x219dcc){logger[_0xe3b0('0x26')](_0xe3b0('0x59'),_0x219dcc);throw _0x219dcc;});}return _0x597ee4;})[_0xe3b0('0x24')](respondWithResult(_0x2fb3c1,0xc9))['catch'](handleError(_0x2fb3c1,null));}; \ No newline at end of file +var _0x85a6=['rows','catch','show','params','update','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','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','../../mysqldb','sendStatus','json','offset','undefined','count','limit','status','Content-Range','reject','save','then','destroy','get','CannedAnswers','UserProfileResource','end','error','stack','name','send','index','map','CannedAnswer','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','filter','where','merge','options','includeAll','include'];(function(_0x11ef3b,_0x28c0d2){var _0x462082=function(_0x4d6408){while(--_0x4d6408){_0x11ef3b['push'](_0x11ef3b['shift']());}};_0x462082(++_0x28c0d2);}(_0x85a6,0xcb));var _0x685a=function(_0x3a9007,_0x2c420b){_0x3a9007=_0x3a9007-0x0;var _0x284903=_0x85a6[_0x3a9007];return _0x284903;};'use strict';var emlformat=require(_0x685a('0x0'));var rimraf=require(_0x685a('0x1'));var zipdir=require(_0x685a('0x2'));var jsonpatch=require(_0x685a('0x3'));var rp=require(_0x685a('0x4'));var moment=require(_0x685a('0x5'));var BPromise=require(_0x685a('0x6'));var Mustache=require(_0x685a('0x7'));var util=require(_0x685a('0x8'));var path=require(_0x685a('0x9'));var sox=require('sox');var csv=require(_0x685a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x685a('0xb'));var squel=require(_0x685a('0xc'));var crypto=require('crypto');var jsforce=require(_0x685a('0xd'));var deskjs=require(_0x685a('0xe'));var toCsv=require(_0x685a('0xa'));var querystring=require(_0x685a('0xf'));var Papa=require(_0x685a('0x10'));var Redis=require(_0x685a('0x11'));var authService=require(_0x685a('0x12'));var qs=require(_0x685a('0x13'));var as=require(_0x685a('0x14'));var hardwareService=require(_0x685a('0x15'));var logger=require(_0x685a('0x16'))(_0x685a('0x17'));var utils=require(_0x685a('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x685a('0x19'))['db'];function respondWithStatusCode(_0x1cb832,_0x21c703){_0x21c703=_0x21c703||0xcc;return function(_0x363e32){if(_0x363e32){return _0x1cb832[_0x685a('0x1a')](_0x21c703);}return _0x1cb832['status'](_0x21c703)['end']();};}function respondWithResult(_0x42a753,_0x3b134d){_0x3b134d=_0x3b134d||0xc8;return function(_0x5c3ffa){if(_0x5c3ffa){return _0x42a753['status'](_0x3b134d)[_0x685a('0x1b')](_0x5c3ffa);}};}function respondWithFilteredResult(_0x55505e,_0x46cdf9){return function(_0x1bf789){if(_0x1bf789){var _0x390066=typeof _0x46cdf9[_0x685a('0x1c')]==='undefined'&&typeof _0x46cdf9['limit']===_0x685a('0x1d');var _0x532a4a=_0x1bf789[_0x685a('0x1e')];var _0x29077d=_0x390066?0x0:_0x46cdf9[_0x685a('0x1c')];var _0x3296c3=_0x390066?_0x1bf789[_0x685a('0x1e')]:_0x46cdf9[_0x685a('0x1c')]+_0x46cdf9[_0x685a('0x1f')];var _0x57659f;if(_0x3296c3>=_0x532a4a){_0x3296c3=_0x532a4a;_0x57659f=0xc8;}else{_0x57659f=0xce;}_0x55505e[_0x685a('0x20')](_0x57659f);return _0x55505e['set'](_0x685a('0x21'),_0x29077d+'-'+_0x3296c3+'/'+_0x532a4a)[_0x685a('0x1b')](_0x1bf789);}return null;};}function patchUpdates(_0x2d3162){return function(_0x469049){try{jsonpatch['apply'](_0x469049,_0x2d3162,!![]);}catch(_0x3a5ea3){return BPromise[_0x685a('0x22')](_0x3a5ea3);}return _0x469049[_0x685a('0x23')]();};}function saveUpdates(_0x198476,_0x560eea){return function(_0x5776d5){if(_0x5776d5){return _0x5776d5['update'](_0x198476)[_0x685a('0x24')](function(_0x342d29){return _0x342d29;});}return null;};}function removeEntity(_0x2fc9e8,_0x4700de){return function(_0x5ddd51){if(_0x5ddd51){return _0x5ddd51[_0x685a('0x25')]()[_0x685a('0x24')](function(){var _0x2ee62b=_0x5ddd51[_0x685a('0x26')]({'plain':!![]});var _0x3886ba=_0x685a('0x27');return db[_0x685a('0x28')]['destroy']({'where':{'type':_0x3886ba,'resourceId':_0x2ee62b['id']}})[_0x685a('0x24')](function(){return _0x5ddd51;});})['then'](function(){_0x2fc9e8[_0x685a('0x20')](0xcc)[_0x685a('0x29')]();});}};}function handleEntityNotFound(_0x5b3f8d,_0x178786){return function(_0x96a24c){if(!_0x96a24c){_0x5b3f8d[_0x685a('0x1a')](0x194);}return _0x96a24c;};}function handleError(_0x2e72cf,_0x34f887){_0x34f887=_0x34f887||0x1f4;return function(_0x4db0dd){logger[_0x685a('0x2a')](_0x4db0dd[_0x685a('0x2b')]);if(_0x4db0dd[_0x685a('0x2c')]){delete _0x4db0dd[_0x685a('0x2c')];}_0x2e72cf[_0x685a('0x20')](_0x34f887)[_0x685a('0x2d')](_0x4db0dd);};}exports[_0x685a('0x2e')]=function(_0x1b4709,_0x382f33){var _0x2e1151={},_0x429654={},_0x23ba65={'count':0x0,'rows':[]};var _0x4aaf80=_[_0x685a('0x2f')](db[_0x685a('0x30')]['rawAttributes'],function(_0x129c57){return{'name':_0x129c57[_0x685a('0x31')],'type':_0x129c57[_0x685a('0x32')][_0x685a('0x33')]};});_0x429654[_0x685a('0x34')]=_[_0x685a('0x2f')](_0x4aaf80,_0x685a('0x2c'));_0x429654[_0x685a('0x35')]=_[_0x685a('0x36')](_0x1b4709[_0x685a('0x35')]);_0x429654['filters']=_[_0x685a('0x37')](_0x429654[_0x685a('0x34')],_0x429654['query']);_0x2e1151[_0x685a('0x38')]=_[_0x685a('0x37')](_0x429654['model'],qs[_0x685a('0x39')](_0x1b4709[_0x685a('0x35')][_0x685a('0x39')]));_0x2e1151[_0x685a('0x38')]=_0x2e1151['attributes'][_0x685a('0x3a')]?_0x2e1151[_0x685a('0x38')]:_0x429654[_0x685a('0x34')];if(!_0x1b4709[_0x685a('0x35')]['hasOwnProperty'](_0x685a('0x3b'))){_0x2e1151[_0x685a('0x1f')]=qs[_0x685a('0x1f')](_0x1b4709[_0x685a('0x35')]['limit']);_0x2e1151[_0x685a('0x1c')]=qs['offset'](_0x1b4709[_0x685a('0x35')]['offset']);}_0x2e1151[_0x685a('0x3c')]=qs[_0x685a('0x3d')](_0x1b4709[_0x685a('0x35')][_0x685a('0x3d')]);_0x2e1151['where']=qs[_0x685a('0x3e')](_[_0x685a('0x3f')](_0x1b4709[_0x685a('0x35')],_0x429654['filters']),_0x4aaf80);if(_0x1b4709['query'][_0x685a('0x40')]){_0x2e1151[_0x685a('0x41')]=_[_0x685a('0x42')](_0x2e1151[_0x685a('0x41')],{'$or':[{'key':{'$like':'%'+_0x1b4709[_0x685a('0x35')][_0x685a('0x40')]+'%'}},{'value':{'$like':'%'+_0x1b4709[_0x685a('0x35')][_0x685a('0x40')]+'%'}}]});}_0x2e1151=_[_0x685a('0x42')]({},_0x2e1151,_0x1b4709[_0x685a('0x43')]);var _0x4326d7={'where':_0x2e1151['where']};return db[_0x685a('0x30')][_0x685a('0x1e')](_0x4326d7)['then'](function(_0x4f4cd4){_0x23ba65[_0x685a('0x1e')]=_0x4f4cd4;if(_0x1b4709[_0x685a('0x35')][_0x685a('0x44')]){_0x2e1151[_0x685a('0x45')]=[{'all':!![]}];}return db[_0x685a('0x30')]['findAll'](_0x2e1151);})[_0x685a('0x24')](function(_0x3e3a64){_0x23ba65[_0x685a('0x46')]=_0x3e3a64;return _0x23ba65;})['then'](respondWithFilteredResult(_0x382f33,_0x2e1151))[_0x685a('0x47')](handleError(_0x382f33,null));};exports[_0x685a('0x48')]=function(_0x55ad31,_0x1d2d03){var _0x33b8d2={'raw':!![],'where':{'id':_0x55ad31[_0x685a('0x49')]['id']}},_0x1c80fa={};_0x1c80fa['model']=_['keys'](db[_0x685a('0x30')]['rawAttributes']);_0x1c80fa[_0x685a('0x35')]=_['keys'](_0x55ad31[_0x685a('0x35')]);_0x1c80fa[_0x685a('0x3e')]=_[_0x685a('0x37')](_0x1c80fa[_0x685a('0x34')],_0x1c80fa['query']);_0x33b8d2[_0x685a('0x38')]=_[_0x685a('0x37')](_0x1c80fa[_0x685a('0x34')],qs[_0x685a('0x39')](_0x55ad31[_0x685a('0x35')][_0x685a('0x39')]));_0x33b8d2['attributes']=_0x33b8d2[_0x685a('0x38')]['length']?_0x33b8d2[_0x685a('0x38')]:_0x1c80fa[_0x685a('0x34')];if(_0x55ad31[_0x685a('0x35')][_0x685a('0x44')]){_0x33b8d2['include']=[{'all':!![]}];}_0x33b8d2=_[_0x685a('0x42')]({},_0x33b8d2,_0x55ad31[_0x685a('0x43')]);return db[_0x685a('0x30')]['find'](_0x33b8d2)['then'](handleEntityNotFound(_0x1d2d03,null))[_0x685a('0x24')](respondWithResult(_0x1d2d03,null))[_0x685a('0x47')](handleError(_0x1d2d03,null));};exports[_0x685a('0x4a')]=function(_0x34b339,_0x3d4a12){if(_0x34b339[_0x685a('0x4b')]['id']){delete _0x34b339[_0x685a('0x4b')]['id'];}return db[_0x685a('0x30')][_0x685a('0x4c')]({'where':{'id':_0x34b339['params']['id']}})[_0x685a('0x24')](handleEntityNotFound(_0x3d4a12,null))[_0x685a('0x24')](saveUpdates(_0x34b339[_0x685a('0x4b')],null))['then'](respondWithResult(_0x3d4a12,null))[_0x685a('0x47')](handleError(_0x3d4a12,null));};exports[_0x685a('0x25')]=function(_0x5e01de,_0x26ffcc){return db[_0x685a('0x30')][_0x685a('0x4c')]({'where':{'id':_0x5e01de[_0x685a('0x49')]['id']}})[_0x685a('0x24')](handleEntityNotFound(_0x26ffcc,null))['then'](removeEntity(_0x26ffcc,null))[_0x685a('0x47')](handleError(_0x26ffcc,null));};exports[_0x685a('0x4d')]=function(_0xe9410b,_0x235449){var _0x39fb47={'key':_0xe9410b['body'][_0x685a('0x33')]};if(_0xe9410b[_0x685a('0x4b')][_0x685a('0x4e')]){_0x39fb47['MailAccountId']=_0xe9410b[_0x685a('0x4b')]['MailAccountId'];}else if(_0xe9410b[_0x685a('0x4b')][_0x685a('0x4f')]){_0x39fb47['SmsAccountId']=_0xe9410b[_0x685a('0x4b')][_0x685a('0x4f')];}else if(_0xe9410b[_0x685a('0x4b')]['OpenchannelAccountId']){_0x39fb47[_0x685a('0x50')]=_0xe9410b['body']['OpenchannelAccountId'];}else if(_0xe9410b[_0x685a('0x4b')][_0x685a('0x51')]){_0x39fb47['ChatWebsiteId']=_0xe9410b[_0x685a('0x4b')]['ChatWebsiteId'];}return db[_0x685a('0x30')][_0x685a('0x4c')]({'where':_0x39fb47})['then'](function(_0x2be745){if(_0x2be745){throw new db[(_0x685a('0x52'))][(_0x685a('0x53'))](_0x685a('0x54'));}return db[_0x685a('0x30')]['create'](_0xe9410b[_0x685a('0x4b')]);})['then'](function(_0x2fb9ba){var _0x1afd78=_0xe9410b[_0x685a('0x55')][_0x685a('0x26')]({'plain':!![]});if(!_0x1afd78)throw new Error(_0x685a('0x56'));if(_0x1afd78[_0x685a('0x57')]==='user'){var _0xb8fab4=_0x2fb9ba[_0x685a('0x26')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x685a('0x27'),'userProfileId':_0x1afd78[_0x685a('0x58')]},'raw':!![]})['then'](function(_0x1fb77c){if(_0x1fb77c&&_0x1fb77c[_0x685a('0x59')]===0x0){return db[_0x685a('0x28')]['create']({'name':_0xb8fab4['name'],'resourceId':_0xb8fab4['id'],'type':_0x1fb77c['name'],'sectionId':_0x1fb77c['id']},{})[_0x685a('0x24')](function(){return _0x2fb9ba;});}else{return _0x2fb9ba;}})['catch'](function(_0x260186){logger[_0x685a('0x2a')](_0x685a('0x5a'),_0x260186);throw _0x260186;});}return _0x2fb9ba;})['then'](respondWithResult(_0x235449,0xc9))['catch'](handleError(_0x235449,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 0039401..542f8d8 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 _0x8e18=['moment','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x1a798b,_0x174a32){var _0x42f95f=function(_0x2a3460){while(--_0x2a3460){_0x1a798b['push'](_0x1a798b['shift']());}};_0x42f95f(++_0x174a32);}(_0x8e18,0x1ae));var _0x88e1=function(_0x28a244,_0x29cdab){_0x28a244=_0x28a244-0x0;var _0x38c6f5=_0x8e18[_0x28a244];return _0x38c6f5;};'use strict';var _=require(_0x88e1('0x0'));var util=require(_0x88e1('0x1'));var logger=require(_0x88e1('0x2'))(_0x88e1('0x3'));var moment=require(_0x88e1('0x4'));var BPromise=require('bluebird');var rp=require(_0x88e1('0x5'));var fs=require('fs');var path=require(_0x88e1('0x6'));var rimraf=require(_0x88e1('0x7'));var config=require(_0x88e1('0x8'));var attributes=require(_0x88e1('0x9'));module[_0x88e1('0xa')]=function(_0x528360,_0x20d067){return _0x528360['define'](_0x88e1('0xb'),attributes,{'tableName':_0x88e1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x88e1('0xd')});}; \ No newline at end of file +var _0x2f03=['utf8mb4_unicode_ci','util','api','bluebird','request-promise','path','../../config/environment','exports','utf8mb4'];(function(_0x241e61,_0x51e5ea){var _0x409de4=function(_0x1ccc72){while(--_0x1ccc72){_0x241e61['push'](_0x241e61['shift']());}};_0x409de4(++_0x51e5ea);}(_0x2f03,0xfd));var _0x32f0=function(_0x2be169,_0x5ec2ed){_0x2be169=_0x2be169-0x0;var _0x56b138=_0x2f03[_0x2be169];return _0x56b138;};'use strict';var _=require('lodash');var util=require(_0x32f0('0x0'));var logger=require('../../config/logger')(_0x32f0('0x1'));var moment=require('moment');var BPromise=require(_0x32f0('0x2'));var rp=require(_0x32f0('0x3'));var fs=require('fs');var path=require(_0x32f0('0x4'));var rimraf=require('rimraf');var config=require(_0x32f0('0x5'));var attributes=require('./cannedAnswer.attributes');module[_0x32f0('0x6')]=function(_0x4e13b1,_0x4e1582){return _0x4e13b1['define']('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x32f0('0x7'),'collate':_0x32f0('0x8')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 3f704ba..fade4aa 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(_0x2869ab,_0x4ae6e9){var _0x389e9a=function(_0xcd8b49){while(--_0xcd8b49){_0x2869ab['push'](_0x2869ab['shift']());}};_0x389e9a(++_0x4ae6e9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'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(_0x71e532,_0x2bd3bf){var _0x26b934=function(_0x439216){while(--_0x439216){_0x71e532['push'](_0x71e532['shift']());}};_0x26b934(++_0x2bd3bf);}(_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 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 33d05d8..1a76d84 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 _0x9023=['create','put','/:id','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','show','post'];(function(_0x4fad6a,_0x2b4914){var _0x29b377=function(_0x464670){while(--_0x464670){_0x4fad6a['push'](_0x4fad6a['shift']());}};_0x29b377(++_0x2b4914);}(_0x9023,0x145));var _0x3902=function(_0x195299,_0x4fdf6f){_0x195299=_0x195299-0x0;var _0x6b32bd=_0x9023[_0x195299];return _0x6b32bd;};'use strict';var multer=require(_0x3902('0x0'));var util=require(_0x3902('0x1'));var path=require(_0x3902('0x2'));var timeout=require(_0x3902('0x3'));var express=require(_0x3902('0x4'));var router=express[_0x3902('0x5')]();var fs_extra=require(_0x3902('0x6'));var auth=require(_0x3902('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x3902('0x8'));var controller=require(_0x3902('0x9'));router[_0x3902('0xa')]('/',auth[_0x3902('0xb')](),controller[_0x3902('0xc')]);router[_0x3902('0xa')]('/:id',auth[_0x3902('0xb')](),controller[_0x3902('0xd')]);router[_0x3902('0xe')]('/',auth['isAuthenticated'](),controller[_0x3902('0xf')]);router[_0x3902('0x10')](_0x3902('0x11'),auth['isAuthenticated'](),controller['update']);router[_0x3902('0x12')](_0x3902('0x11'),auth['isAuthenticated'](),controller[_0x3902('0x13')]);module['exports']=router; \ No newline at end of file +var _0xaad5=['connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','index','/:id','post','create','update','destroy','exports','multer','util','path'];(function(_0x181c34,_0x69ebb3){var _0x356a16=function(_0x446228){while(--_0x446228){_0x181c34['push'](_0x181c34['shift']());}};_0x356a16(++_0x69ebb3);}(_0xaad5,0x1b7));var _0x5aad=function(_0x179e11,_0xf65436){_0x179e11=_0x179e11-0x0;var _0x549f04=_0xaad5[_0x179e11];return _0x549f04;};'use strict';var multer=require(_0x5aad('0x0'));var util=require(_0x5aad('0x1'));var path=require(_0x5aad('0x2'));var timeout=require(_0x5aad('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5aad('0x4'));var auth=require(_0x5aad('0x5'));var interaction=require(_0x5aad('0x6'));var config=require('../../config/environment');var controller=require(_0x5aad('0x7'));router[_0x5aad('0x8')]('/',auth[_0x5aad('0x9')](),controller[_0x5aad('0xa')]);router[_0x5aad('0x8')](_0x5aad('0xb'),auth[_0x5aad('0x9')](),controller['show']);router[_0x5aad('0xc')]('/',auth[_0x5aad('0x9')](),controller[_0x5aad('0xd')]);router['put'](_0x5aad('0xb'),auth[_0x5aad('0x9')](),controller[_0x5aad('0xe')]);router['delete'](_0x5aad('0xb'),auth[_0x5aad('0x9')](),controller[_0x5aad('0xf')]);module[_0x5aad('0x10')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 875ef6d..5b5ecaa 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 _0x1c4f=['sequelize','exports','DATE','STRING','INTEGER'];(function(_0x5005ab,_0x5f3dd8){var _0x5ea36b=function(_0x24dd6e){while(--_0x24dd6e){_0x5005ab['push'](_0x5005ab['shift']());}};_0x5ea36b(++_0x5f3dd8);}(_0x1c4f,0x1f4));var _0xf1c4=function(_0x2d521f,_0x17efcb){_0x2d521f=_0x2d521f-0x0;var _0x188488=_0x1c4f[_0x2d521f];return _0x188488;};'use strict';var Sequelize=require(_0xf1c4('0x0'));module[_0xf1c4('0x1')]={'calldate':{'type':Sequelize[_0xf1c4('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0xf1c4('0x3')]},'src':{'type':Sequelize[_0xf1c4('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xf1c4('0x3')]},'channel':{'type':Sequelize[_0xf1c4('0x3')]},'dstchannel':{'type':Sequelize[_0xf1c4('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xf1c4('0x3')]},'duration':{'type':Sequelize[_0xf1c4('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xf1c4('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xf1c4('0x3')]},'amaflags':{'type':Sequelize[_0xf1c4('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xf1c4('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xf1c4('0x3')]},'linkedid':{'type':Sequelize[_0xf1c4('0x3')]},'sequence':{'type':Sequelize[_0xf1c4('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xf1c4('0x3')]},'tag':{'type':Sequelize[_0xf1c4('0x3')]}}; \ No newline at end of file +var _0xf0a3=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports','DATE'];(function(_0x11db81,_0x5806e7){var _0x4657e0=function(_0x3c517f){while(--_0x3c517f){_0x11db81['push'](_0x11db81['shift']());}};_0x4657e0(++_0x5806e7);}(_0xf0a3,0xe1));var _0x3f0a=function(_0x5bde16,_0xf7065a){_0x5bde16=_0x5bde16-0x0;var _0xbb0e81=_0xf0a3[_0x5bde16];return _0xbb0e81;};'use strict';var Sequelize=require(_0x3f0a('0x0'));module[_0x3f0a('0x1')]={'calldate':{'type':Sequelize[_0x3f0a('0x2')],'allowNull':![],'defaultValue':_0x3f0a('0x3')},'clid':{'type':Sequelize[_0x3f0a('0x4')]},'src':{'type':Sequelize[_0x3f0a('0x4')]},'dst':{'type':Sequelize[_0x3f0a('0x4')]},'dcontext':{'type':Sequelize[_0x3f0a('0x4')]},'channel':{'type':Sequelize[_0x3f0a('0x4')]},'dstchannel':{'type':Sequelize[_0x3f0a('0x4')]},'lastapp':{'type':Sequelize[_0x3f0a('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x3f0a('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x3f0a('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x3f0a('0x4')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x3f0a('0x4')]},'userfield':{'type':Sequelize[_0x3f0a('0x4')]},'uniqueid':{'type':Sequelize[_0x3f0a('0x4')]},'linkedid':{'type':Sequelize[_0x3f0a('0x4')]},'sequence':{'type':Sequelize[_0x3f0a('0x4')]},'peeraccount':{'type':Sequelize[_0x3f0a('0x4')]},'type':{'type':Sequelize[_0x3f0a('0x4')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 8de9dcc..fc7357e 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 _0x5d17=['to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','name','send','index','Cdr','rawAttributes','fieldName','type','model','map','query','intersection','attributes','fields','length','nolimit','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','create','update','body','find','describe','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox'];(function(_0x49abf7,_0x4c90b8){var _0x2a919a=function(_0x4d91ba){while(--_0x4d91ba){_0x49abf7['push'](_0x49abf7['shift']());}};_0x2a919a(++_0x4c90b8);}(_0x5d17,0x114));var _0x75d1=function(_0x4cfc1d,_0x2c0927){_0x4cfc1d=_0x4cfc1d-0x0;var _0x1c01a0=_0x5d17[_0x4cfc1d];return _0x1c01a0;};'use strict';var emlformat=require(_0x75d1('0x0'));var rimraf=require(_0x75d1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x75d1('0x2'));var moment=require(_0x75d1('0x3'));var BPromise=require(_0x75d1('0x4'));var Mustache=require('mustache');var util=require(_0x75d1('0x5'));var path=require(_0x75d1('0x6'));var sox=require(_0x75d1('0x7'));var csv=require(_0x75d1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x75d1('0x9'));var _=require(_0x75d1('0xa'));var squel=require(_0x75d1('0xb'));var crypto=require(_0x75d1('0xc'));var jsforce=require(_0x75d1('0xd'));var deskjs=require(_0x75d1('0xe'));var toCsv=require(_0x75d1('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x75d1('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x75d1('0x10'));var hardwareService=require(_0x75d1('0x11'));var logger=require('../../config/logger')(_0x75d1('0x12'));var utils=require(_0x75d1('0x13'));var config=require(_0x75d1('0x14'));var licenseUtil=require(_0x75d1('0x15'));var db=require(_0x75d1('0x16'))['db'];function respondWithStatusCode(_0xd089cf,_0x49667a){_0x49667a=_0x49667a||0xcc;return function(_0x19e825){if(_0x19e825){return _0xd089cf[_0x75d1('0x17')](_0x49667a);}return _0xd089cf[_0x75d1('0x18')](_0x49667a)[_0x75d1('0x19')]();};}function respondWithResult(_0x49d723,_0x553697){_0x553697=_0x553697||0xc8;return function(_0x55b8a0){if(_0x55b8a0){return _0x49d723[_0x75d1('0x18')](_0x553697)[_0x75d1('0x1a')](_0x55b8a0);}};}function respondWithFilteredResult(_0x2fd022,_0x52e649){return function(_0x1f9620){if(_0x1f9620){var _0x3fff9b=typeof _0x52e649[_0x75d1('0x1b')]===_0x75d1('0x1c')&&typeof _0x52e649[_0x75d1('0x1d')]===_0x75d1('0x1c');var _0x2845bc=_0x1f9620[_0x75d1('0x1e')];var _0x1bc5de=_0x3fff9b?0x0:_0x52e649[_0x75d1('0x1b')];var _0x2c2a6d=_0x3fff9b?_0x1f9620['count']:_0x52e649['offset']+_0x52e649[_0x75d1('0x1d')];var _0x42b7ac;if(_0x2c2a6d>=_0x2845bc){_0x2c2a6d=_0x2845bc;_0x42b7ac=0xc8;}else{_0x42b7ac=0xce;}_0x2fd022['status'](_0x42b7ac);return _0x2fd022[_0x75d1('0x1f')](_0x75d1('0x20'),_0x1bc5de+'-'+_0x2c2a6d+'/'+_0x2845bc)[_0x75d1('0x1a')](_0x1f9620);}return null;};}function patchUpdates(_0xf6cc70){return function(_0xa42dbe){try{jsonpatch[_0x75d1('0x21')](_0xa42dbe,_0xf6cc70,!![]);}catch(_0x51d3b0){return BPromise[_0x75d1('0x22')](_0x51d3b0);}return _0xa42dbe[_0x75d1('0x23')]();};}function saveUpdates(_0x501cc7,_0x1cb58c){return function(_0x641ea4){if(_0x641ea4){return _0x641ea4['update'](_0x501cc7)[_0x75d1('0x24')](function(_0x5e70ec){return _0x5e70ec;});}return null;};}function removeEntity(_0x3a85c0,_0xc256af){return function(_0x345cf5){if(_0x345cf5){return _0x345cf5['destroy']()['then'](function(){_0x3a85c0[_0x75d1('0x18')](0xcc)[_0x75d1('0x19')]();});}};}function handleEntityNotFound(_0x315ce5,_0x18184b){return function(_0x51d043){if(!_0x51d043){_0x315ce5[_0x75d1('0x17')](0x194);}return _0x51d043;};}function handleError(_0x2b5848,_0x367238){_0x367238=_0x367238||0x1f4;return function(_0x51138e){logger['error'](_0x51138e['stack']);if(_0x51138e[_0x75d1('0x25')]){delete _0x51138e[_0x75d1('0x25')];}_0x2b5848[_0x75d1('0x18')](_0x367238)[_0x75d1('0x26')](_0x51138e);};}exports[_0x75d1('0x27')]=function(_0x519ceb,_0x4d292e){var _0x410e16={},_0x197f52={},_0x4967b5={'count':0x0,'rows':[]};var _0x2408b6=_['map'](db[_0x75d1('0x28')][_0x75d1('0x29')],function(_0x91e7c9){return{'name':_0x91e7c9[_0x75d1('0x2a')],'type':_0x91e7c9[_0x75d1('0x2b')]['key']};});_0x197f52[_0x75d1('0x2c')]=_[_0x75d1('0x2d')](_0x2408b6,_0x75d1('0x25'));_0x197f52[_0x75d1('0x2e')]=_['keys'](_0x519ceb[_0x75d1('0x2e')]);_0x197f52['filters']=_[_0x75d1('0x2f')](_0x197f52[_0x75d1('0x2c')],_0x197f52['query']);_0x410e16[_0x75d1('0x30')]=_[_0x75d1('0x2f')](_0x197f52[_0x75d1('0x2c')],qs[_0x75d1('0x31')](_0x519ceb[_0x75d1('0x2e')]['fields']));_0x410e16[_0x75d1('0x30')]=_0x410e16[_0x75d1('0x30')][_0x75d1('0x32')]?_0x410e16[_0x75d1('0x30')]:_0x197f52['model'];if(!_0x519ceb['query']['hasOwnProperty'](_0x75d1('0x33'))){_0x410e16[_0x75d1('0x1d')]=qs[_0x75d1('0x1d')](_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x1d')]);_0x410e16[_0x75d1('0x1b')]=qs[_0x75d1('0x1b')](_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x1b')]);}_0x410e16['order']=qs[_0x75d1('0x34')](_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x34')]);_0x410e16[_0x75d1('0x35')]=qs[_0x75d1('0x36')](_['pick'](_0x519ceb['query'],_0x197f52['filters']),_0x2408b6);if(_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x37')]){_0x410e16[_0x75d1('0x35')]=_[_0x75d1('0x38')](_0x410e16[_0x75d1('0x35')],{'$or':_[_0x75d1('0x2d')](_0x2408b6,function(_0x48f9f3){if(_0x48f9f3['type']!=='VIRTUAL'){var _0x3f2569={};_0x3f2569[_0x48f9f3['name']]={'$like':'%'+_0x519ceb['query'][_0x75d1('0x37')]+'%'};return _0x3f2569;}})});}_0x410e16=_[_0x75d1('0x38')]({},_0x410e16,_0x519ceb[_0x75d1('0x39')]);var _0x46854c={'where':_0x410e16['where']};return db[_0x75d1('0x28')][_0x75d1('0x1e')](_0x46854c)[_0x75d1('0x24')](function(_0x3d4137){_0x4967b5[_0x75d1('0x1e')]=_0x3d4137;if(_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x3a')]){_0x410e16[_0x75d1('0x3b')]=[{'all':!![]}];}return db[_0x75d1('0x28')][_0x75d1('0x3c')](_0x410e16);})[_0x75d1('0x24')](function(_0x93922f){_0x4967b5[_0x75d1('0x3d')]=_0x93922f;return _0x4967b5;})[_0x75d1('0x24')](respondWithFilteredResult(_0x4d292e,_0x410e16))[_0x75d1('0x3e')](handleError(_0x4d292e,null));};exports[_0x75d1('0x3f')]=function(_0x25f689,_0x2ad3ef){var _0x42c18c={'raw':!![],'where':{'id':_0x25f689[_0x75d1('0x40')]['id']}},_0x2384aa={};_0x2384aa[_0x75d1('0x2c')]=_['keys'](db['Cdr'][_0x75d1('0x29')]);_0x2384aa[_0x75d1('0x2e')]=_[_0x75d1('0x41')](_0x25f689[_0x75d1('0x2e')]);_0x2384aa['filters']=_[_0x75d1('0x2f')](_0x2384aa[_0x75d1('0x2c')],_0x2384aa[_0x75d1('0x2e')]);_0x42c18c[_0x75d1('0x30')]=_['intersection'](_0x2384aa[_0x75d1('0x2c')],qs[_0x75d1('0x31')](_0x25f689[_0x75d1('0x2e')][_0x75d1('0x31')]));_0x42c18c['attributes']=_0x42c18c[_0x75d1('0x30')]['length']?_0x42c18c[_0x75d1('0x30')]:_0x2384aa[_0x75d1('0x2c')];if(_0x25f689[_0x75d1('0x2e')][_0x75d1('0x3a')]){_0x42c18c[_0x75d1('0x3b')]=[{'all':!![]}];}_0x42c18c=_[_0x75d1('0x38')]({},_0x42c18c,_0x25f689['options']);return db[_0x75d1('0x28')]['find'](_0x42c18c)['then'](handleEntityNotFound(_0x2ad3ef,null))[_0x75d1('0x24')](respondWithResult(_0x2ad3ef,null))[_0x75d1('0x3e')](handleError(_0x2ad3ef,null));};exports[_0x75d1('0x42')]=function(_0x12bd67,_0x16f744){return db[_0x75d1('0x28')][_0x75d1('0x42')](_0x12bd67['body'],{})['then'](respondWithResult(_0x16f744,0xc9))[_0x75d1('0x3e')](handleError(_0x16f744,null));};exports[_0x75d1('0x43')]=function(_0x50def3,_0x2d380d){if(_0x50def3[_0x75d1('0x44')]['id']){delete _0x50def3[_0x75d1('0x44')]['id'];}return db['Cdr'][_0x75d1('0x45')]({'where':{'id':_0x50def3[_0x75d1('0x40')]['id']}})[_0x75d1('0x24')](handleEntityNotFound(_0x2d380d,null))[_0x75d1('0x24')](saveUpdates(_0x50def3[_0x75d1('0x44')],null))[_0x75d1('0x24')](respondWithResult(_0x2d380d,null))[_0x75d1('0x3e')](handleError(_0x2d380d,null));};exports['destroy']=function(_0x1eaa66,_0x382195){return db[_0x75d1('0x28')][_0x75d1('0x45')]({'where':{'id':_0x1eaa66[_0x75d1('0x40')]['id']}})[_0x75d1('0x24')](handleEntityNotFound(_0x382195,null))[_0x75d1('0x24')](removeEntity(_0x382195,null))['catch'](handleError(_0x382195,null));};exports[_0x75d1('0x46')]=function(_0x3af9c5,_0x42d587){return db['Cdr'][_0x75d1('0x46')]()[_0x75d1('0x24')](respondWithResult(_0x42d587,null))[_0x75d1('0x3e')](handleError(_0x42d587,null));}; \ No newline at end of file +var _0x5292=['rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','length','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','params','fields','options','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','lodash','squel','desk.js','to-csv','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','limit','count','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','Cdr'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x5292,0xf7));var _0x2529=function(_0x5caabb,_0x2b0cc1){_0x5caabb=_0x5caabb-0x0;var _0x2929d8=_0x5292[_0x5caabb];return _0x2929d8;};'use strict';var emlformat=require(_0x2529('0x0'));var rimraf=require(_0x2529('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2529('0x2'));var rp=require('request-promise');var moment=require(_0x2529('0x3'));var BPromise=require(_0x2529('0x4'));var Mustache=require(_0x2529('0x5'));var util=require(_0x2529('0x6'));var path=require('path');var sox=require(_0x2529('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2529('0x8'));var squel=require(_0x2529('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2529('0xa'));var toCsv=require(_0x2529('0xb'));var querystring=require('querystring');var Papa=require(_0x2529('0xc'));var Redis=require(_0x2529('0xd'));var authService=require(_0x2529('0xe'));var qs=require(_0x2529('0xf'));var as=require(_0x2529('0x10'));var hardwareService=require(_0x2529('0x11'));var logger=require(_0x2529('0x12'))(_0x2529('0x13'));var utils=require('../../config/utils');var config=require(_0x2529('0x14'));var licenseUtil=require(_0x2529('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe333c9,_0x23bfaf){_0x23bfaf=_0x23bfaf||0xcc;return function(_0x149692){if(_0x149692){return _0xe333c9[_0x2529('0x16')](_0x23bfaf);}return _0xe333c9[_0x2529('0x17')](_0x23bfaf)[_0x2529('0x18')]();};}function respondWithResult(_0x3f3b40,_0x5245cf){_0x5245cf=_0x5245cf||0xc8;return function(_0x101668){if(_0x101668){return _0x3f3b40[_0x2529('0x17')](_0x5245cf)[_0x2529('0x19')](_0x101668);}};}function respondWithFilteredResult(_0x19e4bf,_0x1cc716){return function(_0x2598a1){if(_0x2598a1){var _0x1a1ccc=typeof _0x1cc716[_0x2529('0x1a')]==='undefined'&&typeof _0x1cc716[_0x2529('0x1b')]==='undefined';var _0x337720=_0x2598a1[_0x2529('0x1c')];var _0x89be58=_0x1a1ccc?0x0:_0x1cc716['offset'];var _0x5b4d0d=_0x1a1ccc?_0x2598a1[_0x2529('0x1c')]:_0x1cc716[_0x2529('0x1a')]+_0x1cc716[_0x2529('0x1b')];var _0x37204a;if(_0x5b4d0d>=_0x337720){_0x5b4d0d=_0x337720;_0x37204a=0xc8;}else{_0x37204a=0xce;}_0x19e4bf[_0x2529('0x17')](_0x37204a);return _0x19e4bf['set'](_0x2529('0x1d'),_0x89be58+'-'+_0x5b4d0d+'/'+_0x337720)[_0x2529('0x19')](_0x2598a1);}return null;};}function patchUpdates(_0x1ca15f){return function(_0xeff5a6){try{jsonpatch['apply'](_0xeff5a6,_0x1ca15f,!![]);}catch(_0x1fa873){return BPromise[_0x2529('0x1e')](_0x1fa873);}return _0xeff5a6[_0x2529('0x1f')]();};}function saveUpdates(_0x5b4760,_0x3d5d17){return function(_0x3f57da){if(_0x3f57da){return _0x3f57da[_0x2529('0x20')](_0x5b4760)[_0x2529('0x21')](function(_0x5540e4){return _0x5540e4;});}return null;};}function removeEntity(_0x2736f6,_0x2d0c6d){return function(_0x400a01){if(_0x400a01){return _0x400a01[_0x2529('0x22')]()[_0x2529('0x21')](function(){_0x2736f6[_0x2529('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5539ef,_0x856e50){return function(_0x40f42b){if(!_0x40f42b){_0x5539ef[_0x2529('0x16')](0x194);}return _0x40f42b;};}function handleError(_0x431c40,_0x24418a){_0x24418a=_0x24418a||0x1f4;return function(_0x2a8371){logger[_0x2529('0x23')](_0x2a8371[_0x2529('0x24')]);if(_0x2a8371[_0x2529('0x25')]){delete _0x2a8371[_0x2529('0x25')];}_0x431c40['status'](_0x24418a)[_0x2529('0x26')](_0x2a8371);};}exports[_0x2529('0x27')]=function(_0x4dd0fb,_0x1822ce){var _0x3c46c6={},_0x5bea2d={},_0x17bcbd={'count':0x0,'rows':[]};var _0x1d7e98=_['map'](db[_0x2529('0x28')][_0x2529('0x29')],function(_0x4a18f6){return{'name':_0x4a18f6[_0x2529('0x2a')],'type':_0x4a18f6[_0x2529('0x2b')][_0x2529('0x2c')]};});_0x5bea2d[_0x2529('0x2d')]=_[_0x2529('0x2e')](_0x1d7e98,'name');_0x5bea2d[_0x2529('0x2f')]=_[_0x2529('0x30')](_0x4dd0fb[_0x2529('0x2f')]);_0x5bea2d[_0x2529('0x31')]=_[_0x2529('0x32')](_0x5bea2d[_0x2529('0x2d')],_0x5bea2d[_0x2529('0x2f')]);_0x3c46c6['attributes']=_['intersection'](_0x5bea2d[_0x2529('0x2d')],qs['fields'](_0x4dd0fb[_0x2529('0x2f')]['fields']));_0x3c46c6['attributes']=_0x3c46c6['attributes'][_0x2529('0x33')]?_0x3c46c6[_0x2529('0x34')]:_0x5bea2d[_0x2529('0x2d')];if(!_0x4dd0fb['query'][_0x2529('0x35')]('nolimit')){_0x3c46c6['limit']=qs['limit'](_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x1b')]);_0x3c46c6[_0x2529('0x1a')]=qs[_0x2529('0x1a')](_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x1a')]);}_0x3c46c6[_0x2529('0x36')]=qs[_0x2529('0x37')](_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x37')]);_0x3c46c6[_0x2529('0x38')]=qs[_0x2529('0x31')](_[_0x2529('0x39')](_0x4dd0fb['query'],_0x5bea2d['filters']),_0x1d7e98);if(_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x3a')]){_0x3c46c6['where']=_[_0x2529('0x3b')](_0x3c46c6[_0x2529('0x38')],{'$or':_[_0x2529('0x2e')](_0x1d7e98,function(_0x1b1f81){if(_0x1b1f81[_0x2529('0x2b')]!==_0x2529('0x3c')){var _0x1b8226={};_0x1b8226[_0x1b1f81['name']]={'$like':'%'+_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x3a')]+'%'};return _0x1b8226;}})});}_0x3c46c6=_[_0x2529('0x3b')]({},_0x3c46c6,_0x4dd0fb['options']);var _0x1393b7={'where':_0x3c46c6[_0x2529('0x38')]};return db[_0x2529('0x28')][_0x2529('0x1c')](_0x1393b7)[_0x2529('0x21')](function(_0x33acbf){_0x17bcbd[_0x2529('0x1c')]=_0x33acbf;if(_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x3d')]){_0x3c46c6['include']=[{'all':!![]}];}return db[_0x2529('0x28')][_0x2529('0x3e')](_0x3c46c6);})[_0x2529('0x21')](function(_0x3b4e47){_0x17bcbd[_0x2529('0x3f')]=_0x3b4e47;return _0x17bcbd;})[_0x2529('0x21')](respondWithFilteredResult(_0x1822ce,_0x3c46c6))[_0x2529('0x40')](handleError(_0x1822ce,null));};exports['show']=function(_0x8ced2e,_0x33a13e){var _0x3f76e8={'raw':!![],'where':{'id':_0x8ced2e[_0x2529('0x41')]['id']}},_0x2aaecb={};_0x2aaecb['model']=_[_0x2529('0x30')](db[_0x2529('0x28')][_0x2529('0x29')]);_0x2aaecb[_0x2529('0x2f')]=_[_0x2529('0x30')](_0x8ced2e[_0x2529('0x2f')]);_0x2aaecb['filters']=_['intersection'](_0x2aaecb['model'],_0x2aaecb['query']);_0x3f76e8[_0x2529('0x34')]=_['intersection'](_0x2aaecb[_0x2529('0x2d')],qs[_0x2529('0x42')](_0x8ced2e[_0x2529('0x2f')][_0x2529('0x42')]));_0x3f76e8[_0x2529('0x34')]=_0x3f76e8['attributes'][_0x2529('0x33')]?_0x3f76e8['attributes']:_0x2aaecb[_0x2529('0x2d')];if(_0x8ced2e['query'][_0x2529('0x3d')]){_0x3f76e8['include']=[{'all':!![]}];}_0x3f76e8=_[_0x2529('0x3b')]({},_0x3f76e8,_0x8ced2e[_0x2529('0x43')]);return db['Cdr'][_0x2529('0x44')](_0x3f76e8)['then'](handleEntityNotFound(_0x33a13e,null))[_0x2529('0x21')](respondWithResult(_0x33a13e,null))[_0x2529('0x40')](handleError(_0x33a13e,null));};exports[_0x2529('0x45')]=function(_0x3c6d79,_0xdc4bef){return db[_0x2529('0x28')][_0x2529('0x45')](_0x3c6d79[_0x2529('0x46')],{})[_0x2529('0x21')](respondWithResult(_0xdc4bef,0xc9))['catch'](handleError(_0xdc4bef,null));};exports['update']=function(_0x5e72d1,_0x37a23a){if(_0x5e72d1[_0x2529('0x46')]['id']){delete _0x5e72d1[_0x2529('0x46')]['id'];}return db['Cdr']['find']({'where':{'id':_0x5e72d1[_0x2529('0x41')]['id']}})['then'](handleEntityNotFound(_0x37a23a,null))[_0x2529('0x21')](saveUpdates(_0x5e72d1[_0x2529('0x46')],null))[_0x2529('0x21')](respondWithResult(_0x37a23a,null))[_0x2529('0x40')](handleError(_0x37a23a,null));};exports[_0x2529('0x22')]=function(_0x196ee8,_0x4583ba){return db[_0x2529('0x28')]['find']({'where':{'id':_0x196ee8['params']['id']}})[_0x2529('0x21')](handleEntityNotFound(_0x4583ba,null))[_0x2529('0x21')](removeEntity(_0x4583ba,null))[_0x2529('0x40')](handleError(_0x4583ba,null));};exports[_0x2529('0x47')]=function(_0x1f76d3,_0x3ac799){return db[_0x2529('0x28')][_0x2529('0x47')]()[_0x2529('0x21')](respondWithResult(_0x3ac799,null))[_0x2529('0x40')](handleError(_0x3ac799,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 7599e9a..12650a5 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(_0x2bf2f7,_0x3797ff){var _0x7c9d1c=function(_0x1ecbd0){while(--_0x1ecbd0){_0x2bf2f7['push'](_0x2bf2f7['shift']());}};_0x7c9d1c(++_0x3797ff);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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 _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x548c32,_0x183c3f){var _0x151a32=function(_0x5e5010){while(--_0x5e5010){_0x548c32['push'](_0x548c32['shift']());}};_0x151a32(++_0x183c3f);}(_0x7a54,0x106));var _0x47a5=function(_0x54d0a8,_0x20cf73){_0x54d0a8=_0x54d0a8-0x0;var _0x1e7a31=_0x7a54[_0x54d0a8];return _0x1e7a31;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 16aefda..51a25a2 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 _0x1f47=['lodash','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','Cdr,\x20%s,\x20%s','message','result','catch'];(function(_0x129c1,_0x144d9b){var _0x42cde2=function(_0x418257){while(--_0x418257){_0x129c1['push'](_0x129c1['shift']());}};_0x42cde2(++_0x144d9b);}(_0x1f47,0xa8));var _0x71f4=function(_0x21fc25,_0x5dd815){_0x21fc25=_0x21fc25-0x0;var _0x19ab0=_0x1f47[_0x21fc25];return _0x19ab0;};'use strict';var _=require(_0x71f4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x71f4('0x1'));var rs=require(_0x71f4('0x2'));var fs=require('fs');var Redis=require(_0x71f4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x71f4('0x4'));var logger=require('../../config/logger')(_0x71f4('0x5'));var config=require('../../config/environment');var jayson=require(_0x71f4('0x6'));var client=jayson[_0x71f4('0x7')][_0x71f4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xb9ef3b,_0x11f0d7,_0x2e3f64){return new BPromise(function(_0x38db0a,_0x56aaab){return client[_0x71f4('0x9')](_0xb9ef3b,_0x2e3f64)[_0x71f4('0xa')](function(_0x373b30){logger[_0x71f4('0xb')]('Cdr,\x20%s,\x20%s',_0x11f0d7,_0x71f4('0xc'));logger[_0x71f4('0xd')]('Cdr,\x20%s,\x20%s,\x20%s',_0x11f0d7,_0x71f4('0xc'),JSON[_0x71f4('0xe')](_0x373b30));if(_0x373b30[_0x71f4('0xf')]){if(_0x373b30[_0x71f4('0xf')][_0x71f4('0x10')]===0x1f4){logger[_0x71f4('0xf')](_0x71f4('0x11'),_0x11f0d7,_0x373b30['error']['message']);return _0x56aaab(_0x373b30[_0x71f4('0xf')][_0x71f4('0x12')]);}logger['error'](_0x71f4('0x11'),_0x11f0d7,_0x373b30[_0x71f4('0xf')][_0x71f4('0x12')]);return _0x38db0a(_0x373b30[_0x71f4('0xf')][_0x71f4('0x12')]);}else{logger[_0x71f4('0xb')]('Cdr,\x20%s,\x20%s',_0x11f0d7,_0x71f4('0xc'));_0x38db0a(_0x373b30[_0x71f4('0x13')][_0x71f4('0x12')]);}})[_0x71f4('0x14')](function(_0x3dd2b5){logger[_0x71f4('0xf')]('Cdr,\x20%s,\x20%s',_0x11f0d7,_0x3dd2b5);_0x56aaab(_0x3dd2b5);});});} \ No newline at end of file +var _0x4bf3=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Cdr,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x44a819,_0x244c11){var _0x462821=function(_0x667216){while(--_0x667216){_0x44a819['push'](_0x44a819['shift']());}};_0x462821(++_0x244c11);}(_0x4bf3,0x1de));var _0x34bf=function(_0x50ceab,_0x4795c9){_0x50ceab=_0x50ceab-0x0;var _0x249d0a=_0x4bf3[_0x50ceab];return _0x249d0a;};'use strict';var _=require(_0x34bf('0x0'));var util=require(_0x34bf('0x1'));var moment=require(_0x34bf('0x2'));var BPromise=require('bluebird');var rs=require(_0x34bf('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x34bf('0x4'))['db'];var utils=require(_0x34bf('0x5'));var logger=require(_0x34bf('0x6'))(_0x34bf('0x7'));var config=require(_0x34bf('0x8'));var jayson=require(_0x34bf('0x9'));var client=jayson[_0x34bf('0xa')][_0x34bf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29b32e,_0x53472c,_0x499a28){return new BPromise(function(_0x4cae4c,_0x25b839){return client['request'](_0x29b32e,_0x499a28)[_0x34bf('0xc')](function(_0x345911){logger[_0x34bf('0xd')](_0x34bf('0xe'),_0x53472c,'request\x20sent');logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x53472c,_0x34bf('0xf'),JSON[_0x34bf('0x10')](_0x345911));if(_0x345911[_0x34bf('0x11')]){if(_0x345911[_0x34bf('0x11')][_0x34bf('0x12')]===0x1f4){logger[_0x34bf('0x11')]('Cdr,\x20%s,\x20%s',_0x53472c,_0x345911[_0x34bf('0x11')][_0x34bf('0x13')]);return _0x25b839(_0x345911[_0x34bf('0x11')][_0x34bf('0x13')]);}logger[_0x34bf('0x11')](_0x34bf('0xe'),_0x53472c,_0x345911[_0x34bf('0x11')][_0x34bf('0x13')]);return _0x4cae4c(_0x345911['error'][_0x34bf('0x13')]);}else{logger[_0x34bf('0xd')]('Cdr,\x20%s,\x20%s',_0x53472c,_0x34bf('0xf'));_0x4cae4c(_0x345911[_0x34bf('0x14')][_0x34bf('0x13')]);}})[_0x34bf('0x15')](function(_0x48e8f0){logger[_0x34bf('0x11')]('Cdr,\x20%s,\x20%s',_0x53472c,_0x48e8f0);_0x25b839(_0x48e8f0);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index cc03b82..07b41bc 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x5cdacf,_0x7c82b1){var _0xa68a8b=function(_0x4b3818){while(--_0x4b3818){_0x5cdacf['push'](_0x5cdacf['shift']());}};_0xa68a8b(++_0x7c82b1);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x3c50c6,_0x7627c8){var _0x29a9e6=function(_0x13f4e2){while(--_0x13f4e2){_0x3c50c6['push'](_0x3c50c6['shift']());}};_0x29a9e6(++_0x7627c8);}(_0xb10b,0x12a));var _0xbb10=function(_0x49392e,_0x441b28){_0x49392e=_0x49392e-0x0;var _0xe978bb=_0xb10b[_0x49392e];return _0xe978bb;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index ae3d8f9..379222a 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 _0x1b5c=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x672fd,_0x2bd791){var _0xdb133f=function(_0x3c198f){while(--_0x3c198f){_0x672fd['push'](_0x672fd['shift']());}};_0xdb133f(++_0x2bd791);}(_0x1b5c,0x152));var _0xc1b5=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x1b5c[_0x5d6456];return _0x4d66c1;};'use strict';var Sequelize=require(_0xc1b5('0x0'));module[_0xc1b5('0x1')]={'priority':{'type':Sequelize[_0xc1b5('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xc1b5('0x3')],'allowNull':![],'defaultValue':_0xc1b5('0x4')},'appdata':{'type':Sequelize[_0xc1b5('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xc1b5('0x6')}}; \ No newline at end of file +var _0xce6b=['TEXT','sequelize','exports','INTEGER','STRING'];(function(_0x42e013,_0x4e1584){var _0x3e951b=function(_0x5fb964){while(--_0x5fb964){_0x42e013['push'](_0x42e013['shift']());}};_0x3e951b(++_0x4e1584);}(_0xce6b,0xba));var _0xbce6=function(_0x5e2dc0,_0x13c209){_0x5e2dc0=_0x5e2dc0-0x0;var _0x2dbea3=_0xce6b[_0x5e2dc0];return _0x2dbea3;};'use strict';var Sequelize=require(_0xbce6('0x0'));module[_0xbce6('0x1')]={'priority':{'type':Sequelize[_0xbce6('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xbce6('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xbce6('0x4')]()},'description':{'type':Sequelize[_0xbce6('0x3')]},'interval':{'type':Sequelize[_0xbce6('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 1fe63d7..265a505 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 _0x2f38=['../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','end','error','stack','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','fields','attributes','includeAll','include','options','find','catch','update','body','destroy','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x2f38,0x1a7));var _0x82f3=function(_0x5ac9d8,_0x2091a6){_0x5ac9d8=_0x5ac9d8-0x0;var _0x46198b=_0x2f38[_0x5ac9d8];return _0x46198b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x82f3('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x82f3('0x1'));var rp=require(_0x82f3('0x2'));var moment=require(_0x82f3('0x3'));var BPromise=require(_0x82f3('0x4'));var Mustache=require(_0x82f3('0x5'));var util=require(_0x82f3('0x6'));var path=require('path');var sox=require(_0x82f3('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x82f3('0x8'));var _=require(_0x82f3('0x9'));var squel=require(_0x82f3('0xa'));var crypto=require(_0x82f3('0xb'));var jsforce=require(_0x82f3('0xc'));var deskjs=require(_0x82f3('0xd'));var toCsv=require(_0x82f3('0xe'));var querystring=require(_0x82f3('0xf'));var Papa=require(_0x82f3('0x10'));var Redis=require(_0x82f3('0x11'));var authService=require(_0x82f3('0x12'));var qs=require(_0x82f3('0x13'));var as=require(_0x82f3('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x82f3('0x15'))(_0x82f3('0x16'));var utils=require(_0x82f3('0x17'));var config=require(_0x82f3('0x18'));var licenseUtil=require(_0x82f3('0x19'));var db=require(_0x82f3('0x1a'))['db'];function respondWithStatusCode(_0x34333c,_0x52a044){_0x52a044=_0x52a044||0xcc;return function(_0x561868){if(_0x561868){return _0x34333c[_0x82f3('0x1b')](_0x52a044);}return _0x34333c[_0x82f3('0x1c')](_0x52a044)['end']();};}function respondWithResult(_0x18d4b5,_0x2cca50){_0x2cca50=_0x2cca50||0xc8;return function(_0x3d34b2){if(_0x3d34b2){return _0x18d4b5[_0x82f3('0x1c')](_0x2cca50)[_0x82f3('0x1d')](_0x3d34b2);}};}function respondWithFilteredResult(_0x40df3d,_0x4ad50f){return function(_0x2621ae){if(_0x2621ae){var _0x2cafd6=typeof _0x4ad50f[_0x82f3('0x1e')]===_0x82f3('0x1f')&&typeof _0x4ad50f[_0x82f3('0x20')]===_0x82f3('0x1f');var _0x4ad7c3=_0x2621ae['count'];var _0x2a06bf=_0x2cafd6?0x0:_0x4ad50f[_0x82f3('0x1e')];var _0x15c508=_0x2cafd6?_0x2621ae[_0x82f3('0x21')]:_0x4ad50f[_0x82f3('0x1e')]+_0x4ad50f[_0x82f3('0x20')];var _0x571804;if(_0x15c508>=_0x4ad7c3){_0x15c508=_0x4ad7c3;_0x571804=0xc8;}else{_0x571804=0xce;}_0x40df3d['status'](_0x571804);return _0x40df3d[_0x82f3('0x22')](_0x82f3('0x23'),_0x2a06bf+'-'+_0x15c508+'/'+_0x4ad7c3)['json'](_0x2621ae);}return null;};}function patchUpdates(_0x5d1120){return function(_0xe0c596){try{jsonpatch[_0x82f3('0x24')](_0xe0c596,_0x5d1120,!![]);}catch(_0x2ea839){return BPromise[_0x82f3('0x25')](_0x2ea839);}return _0xe0c596[_0x82f3('0x26')]();};}function saveUpdates(_0x115b92,_0x25f3b8){return function(_0x11d076){if(_0x11d076){return _0x11d076['update'](_0x115b92)[_0x82f3('0x27')](function(_0xd4ff59){return _0xd4ff59;});}return null;};}function removeEntity(_0x5ddf8c,_0x5a5070){return function(_0x2144a7){if(_0x2144a7){return _0x2144a7['destroy']()[_0x82f3('0x27')](function(){_0x5ddf8c[_0x82f3('0x1c')](0xcc)[_0x82f3('0x28')]();});}};}function handleEntityNotFound(_0x4d861b,_0x402bff){return function(_0xcd0d7){if(!_0xcd0d7){_0x4d861b[_0x82f3('0x1b')](0x194);}return _0xcd0d7;};}function handleError(_0x590d4b,_0x3021d7){_0x3021d7=_0x3021d7||0x1f4;return function(_0x48b7d3){logger[_0x82f3('0x29')](_0x48b7d3[_0x82f3('0x2a')]);if(_0x48b7d3[_0x82f3('0x2b')]){delete _0x48b7d3['name'];}_0x590d4b[_0x82f3('0x1c')](_0x3021d7)[_0x82f3('0x2c')](_0x48b7d3);};}exports[_0x82f3('0x2d')]=function(_0x2352ab,_0xf98e7f){var _0x11141f={'raw':!![],'where':{'id':_0x2352ab[_0x82f3('0x2e')]['id']}},_0x35d7c3={};_0x35d7c3[_0x82f3('0x2f')]=_[_0x82f3('0x30')](db[_0x82f3('0x31')][_0x82f3('0x32')]);_0x35d7c3[_0x82f3('0x33')]=_[_0x82f3('0x30')](_0x2352ab[_0x82f3('0x33')]);_0x35d7c3[_0x82f3('0x34')]=_[_0x82f3('0x35')](_0x35d7c3[_0x82f3('0x2f')],_0x35d7c3[_0x82f3('0x33')]);_0x11141f['attributes']=_[_0x82f3('0x35')](_0x35d7c3['model'],qs[_0x82f3('0x36')](_0x2352ab[_0x82f3('0x33')][_0x82f3('0x36')]));_0x11141f[_0x82f3('0x37')]=_0x11141f[_0x82f3('0x37')]['length']?_0x11141f[_0x82f3('0x37')]:_0x35d7c3[_0x82f3('0x2f')];if(_0x2352ab[_0x82f3('0x33')][_0x82f3('0x38')]){_0x11141f[_0x82f3('0x39')]=[{'all':!![]}];}_0x11141f=_['merge']({},_0x11141f,_0x2352ab[_0x82f3('0x3a')]);return db['ChatApplication'][_0x82f3('0x3b')](_0x11141f)['then'](handleEntityNotFound(_0xf98e7f,null))[_0x82f3('0x27')](respondWithResult(_0xf98e7f,null))[_0x82f3('0x3c')](handleError(_0xf98e7f,null));};exports[_0x82f3('0x3d')]=function(_0x561239,_0x503c77){if(_0x561239['body']['id']){delete _0x561239[_0x82f3('0x3e')]['id'];}return db[_0x82f3('0x31')][_0x82f3('0x3b')]({'where':{'id':_0x561239[_0x82f3('0x2e')]['id']}})[_0x82f3('0x27')](handleEntityNotFound(_0x503c77,null))[_0x82f3('0x27')](saveUpdates(_0x561239[_0x82f3('0x3e')],null))[_0x82f3('0x27')](respondWithResult(_0x503c77,null))['catch'](handleError(_0x503c77,null));};exports[_0x82f3('0x3f')]=function(_0x461ebb,_0x9956fa){return db['ChatApplication'][_0x82f3('0x3b')]({'where':{'id':_0x461ebb[_0x82f3('0x2e')]['id']}})[_0x82f3('0x27')](handleEntityNotFound(_0x9956fa,null))[_0x82f3('0x27')](removeEntity(_0x9956fa,null))['catch'](handleError(_0x9956fa,null));}; \ No newline at end of file +var _0x515d=['filters','attributes','intersection','fields','length','includeAll','include','merge','ChatApplication','find','catch','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','params','model','keys','query'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x515d,0x104));var _0xd515=function(_0x45c6fd,_0x3ade78){_0x45c6fd=_0x45c6fd-0x0;var _0x8974b2=_0x515d[_0x45c6fd];return _0x8974b2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd515('0x0'));var zipdir=require(_0xd515('0x1'));var jsonpatch=require(_0xd515('0x2'));var rp=require(_0xd515('0x3'));var moment=require(_0xd515('0x4'));var BPromise=require(_0xd515('0x5'));var Mustache=require(_0xd515('0x6'));var util=require(_0xd515('0x7'));var path=require('path');var sox=require(_0xd515('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd515('0x9'));var _=require(_0xd515('0xa'));var squel=require(_0xd515('0xb'));var crypto=require(_0xd515('0xc'));var jsforce=require(_0xd515('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd515('0xe'));var querystring=require(_0xd515('0xf'));var Papa=require(_0xd515('0x10'));var Redis=require(_0xd515('0x11'));var authService=require(_0xd515('0x12'));var qs=require(_0xd515('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd515('0x14'));var logger=require(_0xd515('0x15'))(_0xd515('0x16'));var utils=require(_0xd515('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xd515('0x18'));var db=require(_0xd515('0x19'))['db'];function respondWithStatusCode(_0x29c078,_0x33b905){_0x33b905=_0x33b905||0xcc;return function(_0x1d6bda){if(_0x1d6bda){return _0x29c078[_0xd515('0x1a')](_0x33b905);}return _0x29c078[_0xd515('0x1b')](_0x33b905)[_0xd515('0x1c')]();};}function respondWithResult(_0x1f23b7,_0x43384b){_0x43384b=_0x43384b||0xc8;return function(_0x10620b){if(_0x10620b){return _0x1f23b7[_0xd515('0x1b')](_0x43384b)[_0xd515('0x1d')](_0x10620b);}};}function respondWithFilteredResult(_0x589d04,_0x274550){return function(_0xc41eca){if(_0xc41eca){var _0xc8fbf=typeof _0x274550[_0xd515('0x1e')]===_0xd515('0x1f')&&typeof _0x274550[_0xd515('0x20')]===_0xd515('0x1f');var _0x139e91=_0xc41eca[_0xd515('0x21')];var _0x564c4e=_0xc8fbf?0x0:_0x274550['offset'];var _0x43bb12=_0xc8fbf?_0xc41eca[_0xd515('0x21')]:_0x274550[_0xd515('0x1e')]+_0x274550[_0xd515('0x20')];var _0x1ef858;if(_0x43bb12>=_0x139e91){_0x43bb12=_0x139e91;_0x1ef858=0xc8;}else{_0x1ef858=0xce;}_0x589d04[_0xd515('0x1b')](_0x1ef858);return _0x589d04[_0xd515('0x22')](_0xd515('0x23'),_0x564c4e+'-'+_0x43bb12+'/'+_0x139e91)[_0xd515('0x1d')](_0xc41eca);}return null;};}function patchUpdates(_0x5c7fef){return function(_0x57e1f4){try{jsonpatch[_0xd515('0x24')](_0x57e1f4,_0x5c7fef,!![]);}catch(_0x5b1649){return BPromise[_0xd515('0x25')](_0x5b1649);}return _0x57e1f4[_0xd515('0x26')]();};}function saveUpdates(_0x2b2ed5,_0x4e9d06){return function(_0xb422bc){if(_0xb422bc){return _0xb422bc[_0xd515('0x27')](_0x2b2ed5)[_0xd515('0x28')](function(_0x299b46){return _0x299b46;});}return null;};}function removeEntity(_0x519b7f,_0x430153){return function(_0x11cc9f){if(_0x11cc9f){return _0x11cc9f[_0xd515('0x29')]()[_0xd515('0x28')](function(){_0x519b7f[_0xd515('0x1b')](0xcc)[_0xd515('0x1c')]();});}};}function handleEntityNotFound(_0x130533,_0x84adb){return function(_0x19ce0c){if(!_0x19ce0c){_0x130533['sendStatus'](0x194);}return _0x19ce0c;};}function handleError(_0x5b6a98,_0x2e4455){_0x2e4455=_0x2e4455||0x1f4;return function(_0x2b803a){logger[_0xd515('0x2a')](_0x2b803a[_0xd515('0x2b')]);if(_0x2b803a[_0xd515('0x2c')]){delete _0x2b803a[_0xd515('0x2c')];}_0x5b6a98[_0xd515('0x1b')](_0x2e4455)[_0xd515('0x2d')](_0x2b803a);};}exports['show']=function(_0x38766a,_0x290489){var _0x3c2841={'raw':!![],'where':{'id':_0x38766a[_0xd515('0x2e')]['id']}},_0x154c02={};_0x154c02[_0xd515('0x2f')]=_[_0xd515('0x30')](db['ChatApplication']['rawAttributes']);_0x154c02['query']=_[_0xd515('0x30')](_0x38766a[_0xd515('0x31')]);_0x154c02[_0xd515('0x32')]=_['intersection'](_0x154c02['model'],_0x154c02['query']);_0x3c2841[_0xd515('0x33')]=_[_0xd515('0x34')](_0x154c02[_0xd515('0x2f')],qs[_0xd515('0x35')](_0x38766a[_0xd515('0x31')]['fields']));_0x3c2841[_0xd515('0x33')]=_0x3c2841['attributes'][_0xd515('0x36')]?_0x3c2841[_0xd515('0x33')]:_0x154c02[_0xd515('0x2f')];if(_0x38766a[_0xd515('0x31')][_0xd515('0x37')]){_0x3c2841[_0xd515('0x38')]=[{'all':!![]}];}_0x3c2841=_[_0xd515('0x39')]({},_0x3c2841,_0x38766a['options']);return db[_0xd515('0x3a')][_0xd515('0x3b')](_0x3c2841)[_0xd515('0x28')](handleEntityNotFound(_0x290489,null))[_0xd515('0x28')](respondWithResult(_0x290489,null))[_0xd515('0x3c')](handleError(_0x290489,null));};exports['update']=function(_0x21c3dc,_0x599054){if(_0x21c3dc[_0xd515('0x3d')]['id']){delete _0x21c3dc[_0xd515('0x3d')]['id'];}return db[_0xd515('0x3a')][_0xd515('0x3b')]({'where':{'id':_0x21c3dc[_0xd515('0x2e')]['id']}})[_0xd515('0x28')](handleEntityNotFound(_0x599054,null))[_0xd515('0x28')](saveUpdates(_0x21c3dc[_0xd515('0x3d')],null))[_0xd515('0x28')](respondWithResult(_0x599054,null))[_0xd515('0x3c')](handleError(_0x599054,null));};exports[_0xd515('0x29')]=function(_0x4201c3,_0x59a029){return db[_0xd515('0x3a')][_0xd515('0x3b')]({'where':{'id':_0x4201c3[_0xd515('0x2e')]['id']}})['then'](handleEntityNotFound(_0x59a029,null))[_0xd515('0x28')](removeEntity(_0x59a029,null))['catch'](handleError(_0x59a029,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 8f178fd..6b2aa36 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 _0x35cf=['path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x1c4865,_0x163598){var _0x2a3640=function(_0x16e8d8){while(--_0x16e8d8){_0x1c4865['push'](_0x1c4865['shift']());}};_0x2a3640(++_0x163598);}(_0x35cf,0xbf));var _0xf35c=function(_0xf90c74,_0x1ea5ca){_0xf90c74=_0xf90c74-0x0;var _0x3e5b3a=_0x35cf[_0xf90c74];return _0x3e5b3a;};'use strict';var _=require(_0xf35c('0x0'));var util=require(_0xf35c('0x1'));var logger=require(_0xf35c('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf35c('0x3'));var rp=require(_0xf35c('0x4'));var fs=require('fs');var path=require(_0xf35c('0x5'));var rimraf=require(_0xf35c('0x6'));var config=require(_0xf35c('0x7'));var attributes=require(_0xf35c('0x8'));module[_0xf35c('0x9')]=function(_0x1bd1ad,_0x5795e3){return _0x1bd1ad[_0xf35c('0xa')](_0xf35c('0xb'),attributes,{'tableName':_0xf35c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf35c('0xd')});}; \ No newline at end of file +var _0x061c=['utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','path','rimraf','../../config/environment','./chatApplication.attributes','define'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x061c,0x1df));var _0xc061=function(_0x82ed49,_0x5d5ed9){_0x82ed49=_0x82ed49-0x0;var _0x3f726d=_0x061c[_0x82ed49];return _0x3f726d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc061('0x0'))(_0xc061('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc061('0x2'));var rimraf=require(_0xc061('0x3'));var config=require(_0xc061('0x4'));var attributes=require(_0xc061('0x5'));module['exports']=function(_0x3126ee,_0x4f7004){return _0x3126ee[_0xc061('0x6')]('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc061('0x7'),'collate':_0xc061('0x8')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 15ce066..8986c71 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 _0x1402=['error','code','ChatApplication,\x20%s,\x20%s','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','stringify'];(function(_0x1c4e6d,_0x5556b2){var _0x342924=function(_0x383988){while(--_0x383988){_0x1c4e6d['push'](_0x1c4e6d['shift']());}};_0x342924(++_0x5556b2);}(_0x1402,0xcc));var _0x2140=function(_0x146915,_0x32dda1){_0x146915=_0x146915-0x0;var _0x1a463a=_0x1402[_0x146915];return _0x1a463a;};'use strict';var _=require('lodash');var util=require(_0x2140('0x0'));var moment=require(_0x2140('0x1'));var BPromise=require(_0x2140('0x2'));var rs=require(_0x2140('0x3'));var fs=require('fs');var Redis=require(_0x2140('0x4'));var db=require(_0x2140('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2140('0x6'))(_0x2140('0x7'));var config=require(_0x2140('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2140('0x9')][_0x2140('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b6a05,_0x15d2f1,_0x44d856){return new BPromise(function(_0xda32c5,_0x5f2723){return client[_0x2140('0xb')](_0x5b6a05,_0x44d856)[_0x2140('0xc')](function(_0x143712){logger[_0x2140('0xd')]('ChatApplication,\x20%s,\x20%s',_0x15d2f1,_0x2140('0xe'));logger['debug']('ChatApplication,\x20%s,\x20%s,\x20%s',_0x15d2f1,'request\x20sent',JSON[_0x2140('0xf')](_0x143712));if(_0x143712[_0x2140('0x10')]){if(_0x143712[_0x2140('0x10')][_0x2140('0x11')]===0x1f4){logger['error'](_0x2140('0x12'),_0x15d2f1,_0x143712[_0x2140('0x10')][_0x2140('0x13')]);return _0x5f2723(_0x143712[_0x2140('0x10')][_0x2140('0x13')]);}logger['error'](_0x2140('0x12'),_0x15d2f1,_0x143712[_0x2140('0x10')][_0x2140('0x13')]);return _0xda32c5(_0x143712['error']['message']);}else{logger['info'](_0x2140('0x12'),_0x15d2f1,_0x2140('0xe'));_0xda32c5(_0x143712['result'][_0x2140('0x13')]);}})['catch'](function(_0x6ee56b){logger[_0x2140('0x10')](_0x2140('0x12'),_0x15d2f1,_0x6ee56b);_0x5f2723(_0x6ee56b);});});} \ No newline at end of file +var _0xd413=['client','http','request','then','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x512885,_0x452da3){var _0x45726b=function(_0x2fb98c){while(--_0x2fb98c){_0x512885['push'](_0x512885['shift']());}};_0x45726b(++_0x452da3);}(_0xd413,0x186));var _0x3d41=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xd413[_0x2cfb58];return _0xd99951;};'use strict';var _=require(_0x3d41('0x0'));var util=require(_0x3d41('0x1'));var moment=require(_0x3d41('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d41('0x3'));var db=require(_0x3d41('0x4'))['db'];var utils=require(_0x3d41('0x5'));var logger=require('../../config/logger')(_0x3d41('0x6'));var config=require(_0x3d41('0x7'));var jayson=require(_0x3d41('0x8'));var client=jayson[_0x3d41('0x9')][_0x3d41('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x466246,_0x2784fa,_0x5d4554){return new BPromise(function(_0x2a163f,_0xed55fa){return client[_0x3d41('0xb')](_0x466246,_0x5d4554)[_0x3d41('0xc')](function(_0x3d8553){logger['info'](_0x3d41('0xd'),_0x2784fa,'request\x20sent');logger[_0x3d41('0xe')](_0x3d41('0xf'),_0x2784fa,_0x3d41('0x10'),JSON['stringify'](_0x3d8553));if(_0x3d8553[_0x3d41('0x11')]){if(_0x3d8553[_0x3d41('0x11')]['code']===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x2784fa,_0x3d8553[_0x3d41('0x11')]['message']);return _0xed55fa(_0x3d8553[_0x3d41('0x11')][_0x3d41('0x12')]);}logger[_0x3d41('0x11')](_0x3d41('0xd'),_0x2784fa,_0x3d8553[_0x3d41('0x11')][_0x3d41('0x12')]);return _0x2a163f(_0x3d8553[_0x3d41('0x11')][_0x3d41('0x12')]);}else{logger['info'](_0x3d41('0xd'),_0x2784fa,_0x3d41('0x10'));_0x2a163f(_0x3d8553[_0x3d41('0x13')][_0x3d41('0x12')]);}})[_0x3d41('0x14')](function(_0x3dc799){logger[_0x3d41('0x11')](_0x3d41('0xd'),_0x2784fa,_0x3dc799);_0xed55fa(_0x3dc799);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 2f84dd8..b37a9f1 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 _0xf768=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id','isAuthenticated','show','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x3f30a1,_0x1cc9c3){var _0x13dec8=function(_0xc4502){while(--_0xc4502){_0x3f30a1['push'](_0x3f30a1['shift']());}};_0x13dec8(++_0x1cc9c3);}(_0xf768,0x1d5));var _0x8f76=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xf768[_0x110c3d];return _0x226d67;};'use strict';var multer=require(_0x8f76('0x0'));var util=require(_0x8f76('0x1'));var path=require(_0x8f76('0x2'));var timeout=require(_0x8f76('0x3'));var express=require(_0x8f76('0x4'));var router=express[_0x8f76('0x5')]();var fs_extra=require(_0x8f76('0x6'));var auth=require(_0x8f76('0x7'));var interaction=require(_0x8f76('0x8'));var config=require(_0x8f76('0x9'));var controller=require(_0x8f76('0xa'));router['get'](_0x8f76('0xb'),auth[_0x8f76('0xc')](),controller[_0x8f76('0xd')]);router[_0x8f76('0xe')](_0x8f76('0xb'),auth[_0x8f76('0xc')](),controller[_0x8f76('0xf')]);router[_0x8f76('0x10')]('/:id',auth[_0x8f76('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x771c=['delete','/:id','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatApplication.controller','get','show','put','isAuthenticated','update'];(function(_0x4131a1,_0x14ccd0){var _0x2a9271=function(_0x2b2cdb){while(--_0x2b2cdb){_0x4131a1['push'](_0x4131a1['shift']());}};_0x2a9271(++_0x14ccd0);}(_0x771c,0x1e4));var _0xc771=function(_0x36efc0,_0x3d1187){_0x36efc0=_0x36efc0-0x0;var _0x1e8fb3=_0x771c[_0x36efc0];return _0x1e8fb3;};'use strict';var multer=require('multer');var util=require(_0xc771('0x0'));var path=require('path');var timeout=require(_0xc771('0x1'));var express=require(_0xc771('0x2'));var router=express[_0xc771('0x3')]();var fs_extra=require(_0xc771('0x4'));var auth=require(_0xc771('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc771('0x6'));router[_0xc771('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xc771('0x8')]);router[_0xc771('0x9')]('/:id',auth[_0xc771('0xa')](),controller[_0xc771('0xb')]);router[_0xc771('0xc')](_0xc771('0xd'),auth[_0xc771('0xa')](),controller[_0xc771('0xe')]);module[_0xc771('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 02f6078..19344bf 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 _0x8f5c=['BOOLEAN','sequelize'];(function(_0x2ba6f5,_0x15d26b){var _0x4ef753=function(_0x5c92b6){while(--_0x5c92b6){_0x2ba6f5['push'](_0x2ba6f5['shift']());}};_0x4ef753(++_0x15d26b);}(_0x8f5c,0x177));var _0xc8f5=function(_0x1c6089,_0x3816e2){_0x1c6089=_0x1c6089-0x0;var _0x4d97c1=_0x8f5c[_0x1c6089];return _0x4d97c1;};'use strict';var Sequelize=require(_0xc8f5('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xc8f5('0x1')],'defaultValue':!![]}}; \ No newline at end of file +var _0xb8f0=['BOOLEAN','sequelize','exports','STRING'];(function(_0x3a7e01,_0x51204c){var _0x5b8398=function(_0x4dcfab){while(--_0x4dcfab){_0x3a7e01['push'](_0x3a7e01['shift']());}};_0x5b8398(++_0x51204c);}(_0xb8f0,0x16d));var _0x0b8f=function(_0x2fff39,_0x28f642){_0x2fff39=_0x2fff39-0x0;var _0x12e042=_0xb8f0[_0x2fff39];return _0x12e042;};'use strict';var Sequelize=require(_0x0b8f('0x0'));module[_0x0b8f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x0b8f('0x2')]},'write':{'type':Sequelize[_0x0b8f('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 9427b62..9f76092 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 _0xeebc=['fields','hasOwnProperty','order','sort','pick','where','type','filter','options','findAll','rows','catch','show','params','length','includeAll','include','merge','find','create','body','destroy','describe','getUnread','ChatInternalMessage','user','addMembers','ids','findOne','User','nolimit','getMembers','removeMembers','getMessages','$gte','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','limit','undefined','count','offset','set','apply','save','update','then','end','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes'];(function(_0x5572fa,_0x240c8d){var _0xb4a018=function(_0x50d659){while(--_0x50d659){_0x5572fa['push'](_0x5572fa['shift']());}};_0xb4a018(++_0x240c8d);}(_0xeebc,0x86));var _0xceeb=function(_0x2005d2,_0xe470e0){_0x2005d2=_0x2005d2-0x0;var _0x2c635a=_0xeebc[_0x2005d2];return _0x2c635a;};'use strict';var emlformat=require(_0xceeb('0x0'));var rimraf=require(_0xceeb('0x1'));var zipdir=require(_0xceeb('0x2'));var jsonpatch=require(_0xceeb('0x3'));var rp=require(_0xceeb('0x4'));var moment=require(_0xceeb('0x5'));var BPromise=require(_0xceeb('0x6'));var Mustache=require(_0xceeb('0x7'));var util=require('util');var path=require('path');var sox=require(_0xceeb('0x8'));var csv=require(_0xceeb('0x9'));var ejs=require(_0xceeb('0xa'));var fs=require('fs');var fs_extra=require(_0xceeb('0xb'));var _=require(_0xceeb('0xc'));var squel=require(_0xceeb('0xd'));var crypto=require(_0xceeb('0xe'));var jsforce=require(_0xceeb('0xf'));var deskjs=require(_0xceeb('0x10'));var toCsv=require(_0xceeb('0x9'));var querystring=require(_0xceeb('0x11'));var Papa=require('papaparse');var Redis=require(_0xceeb('0x12'));var authService=require(_0xceeb('0x13'));var qs=require(_0xceeb('0x14'));var as=require(_0xceeb('0x15'));var hardwareService=require(_0xceeb('0x16'));var logger=require(_0xceeb('0x17'))(_0xceeb('0x18'));var utils=require(_0xceeb('0x19'));var config=require(_0xceeb('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xceeb('0x1b'))['db'];config[_0xceeb('0x1c')]=_[_0xceeb('0x1d')](config[_0xceeb('0x1c')],{'host':_0xceeb('0x1e'),'port':0x18eb});var socket=require(_0xceeb('0x1f'))(new Redis(config[_0xceeb('0x1c')]));require('./chatGroup.socket')[_0xceeb('0x20')](socket);function respondWithStatusCode(_0x59bee2,_0x2a6b56){_0x2a6b56=_0x2a6b56||0xcc;return function(_0x490751){if(_0x490751){return _0x59bee2[_0xceeb('0x21')](_0x2a6b56);}return _0x59bee2[_0xceeb('0x22')](_0x2a6b56)['end']();};}function respondWithResult(_0x40c2bb,_0x1b7cbe){_0x1b7cbe=_0x1b7cbe||0xc8;return function(_0x4f5636){if(_0x4f5636){return _0x40c2bb['status'](_0x1b7cbe)[_0xceeb('0x23')](_0x4f5636);}};}function respondWithFilteredResult(_0x522804,_0x31dc30){return function(_0x28f891){if(_0x28f891){var _0x5f1412=typeof _0x31dc30['offset']==='undefined'&&typeof _0x31dc30[_0xceeb('0x24')]===_0xceeb('0x25');var _0x9a4c89=_0x28f891[_0xceeb('0x26')];var _0x49fa18=_0x5f1412?0x0:_0x31dc30[_0xceeb('0x27')];var _0x29be4b=_0x5f1412?_0x28f891['count']:_0x31dc30[_0xceeb('0x27')]+_0x31dc30[_0xceeb('0x24')];var _0x7ff20a;if(_0x29be4b>=_0x9a4c89){_0x29be4b=_0x9a4c89;_0x7ff20a=0xc8;}else{_0x7ff20a=0xce;}_0x522804[_0xceeb('0x22')](_0x7ff20a);return _0x522804[_0xceeb('0x28')]('Content-Range',_0x49fa18+'-'+_0x29be4b+'/'+_0x9a4c89)[_0xceeb('0x23')](_0x28f891);}return null;};}function patchUpdates(_0x3b8262){return function(_0x563ca5){try{jsonpatch[_0xceeb('0x29')](_0x563ca5,_0x3b8262,!![]);}catch(_0x40b4c4){return BPromise['reject'](_0x40b4c4);}return _0x563ca5[_0xceeb('0x2a')]();};}function saveUpdates(_0x4e1c44,_0x43f4bb){return function(_0x1b0693){if(_0x1b0693){return _0x1b0693[_0xceeb('0x2b')](_0x4e1c44)['then'](function(_0x244d86){return _0x244d86;});}return null;};}function removeEntity(_0x1d1789,_0x4ef47b){return function(_0x5c423a){if(_0x5c423a){return _0x5c423a['destroy']()[_0xceeb('0x2c')](function(){_0x1d1789[_0xceeb('0x22')](0xcc)[_0xceeb('0x2d')]();});}};}function handleEntityNotFound(_0x231fe7,_0x12c075){return function(_0x5cdd24){if(!_0x5cdd24){_0x231fe7['sendStatus'](0x194);}return _0x5cdd24;};}function handleError(_0x565263,_0x2c32f8){_0x2c32f8=_0x2c32f8||0x1f4;return function(_0x4722d5){logger[_0xceeb('0x2e')](_0x4722d5[_0xceeb('0x2f')]);if(_0x4722d5[_0xceeb('0x30')]){delete _0x4722d5[_0xceeb('0x30')];}_0x565263[_0xceeb('0x22')](_0x2c32f8)[_0xceeb('0x31')](_0x4722d5);};}exports[_0xceeb('0x32')]=function(_0x33af93,_0x5caaaf){var _0x21ffdf={},_0x24b0bb={},_0x5e5a3c={'count':0x0,'rows':[]};var _0x1f77f2=_[_0xceeb('0x33')](db[_0xceeb('0x34')][_0xceeb('0x35')],function(_0x1f063d){return{'name':_0x1f063d[_0xceeb('0x36')],'type':_0x1f063d['type'][_0xceeb('0x37')]};});_0x24b0bb[_0xceeb('0x38')]=_['map'](_0x1f77f2,'name');_0x24b0bb[_0xceeb('0x39')]=_[_0xceeb('0x3a')](_0x33af93['query']);_0x24b0bb[_0xceeb('0x3b')]=_[_0xceeb('0x3c')](_0x24b0bb[_0xceeb('0x38')],_0x24b0bb['query']);_0x21ffdf[_0xceeb('0x3d')]=_[_0xceeb('0x3c')](_0x24b0bb[_0xceeb('0x38')],qs[_0xceeb('0x3e')](_0x33af93[_0xceeb('0x39')][_0xceeb('0x3e')]));_0x21ffdf[_0xceeb('0x3d')]=_0x21ffdf[_0xceeb('0x3d')]['length']?_0x21ffdf[_0xceeb('0x3d')]:_0x24b0bb[_0xceeb('0x38')];if(!_0x33af93['query'][_0xceeb('0x3f')]('nolimit')){_0x21ffdf[_0xceeb('0x24')]=qs[_0xceeb('0x24')](_0x33af93[_0xceeb('0x39')]['limit']);_0x21ffdf['offset']=qs['offset'](_0x33af93['query'][_0xceeb('0x27')]);}_0x21ffdf[_0xceeb('0x40')]=qs[_0xceeb('0x41')](_0x33af93['query'][_0xceeb('0x41')]);_0x21ffdf['where']=qs[_0xceeb('0x3b')](_[_0xceeb('0x42')](_0x33af93[_0xceeb('0x39')],_0x24b0bb['filters']),_0x1f77f2);if(_0x33af93[_0xceeb('0x39')]['filter']){_0x21ffdf[_0xceeb('0x43')]=_['merge'](_0x21ffdf[_0xceeb('0x43')],{'$or':_[_0xceeb('0x33')](_0x1f77f2,function(_0x62067a){if(_0x62067a[_0xceeb('0x44')]!=='VIRTUAL'){var _0x13a16d={};_0x13a16d[_0x62067a[_0xceeb('0x30')]]={'$like':'%'+_0x33af93[_0xceeb('0x39')][_0xceeb('0x45')]+'%'};return _0x13a16d;}})});}_0x21ffdf=_['merge']({},_0x21ffdf,_0x33af93[_0xceeb('0x46')]);var _0x5eab10={'where':_0x21ffdf['where']};return db[_0xceeb('0x34')][_0xceeb('0x26')](_0x5eab10)[_0xceeb('0x2c')](function(_0x51e656){_0x5e5a3c[_0xceeb('0x26')]=_0x51e656;if(_0x33af93[_0xceeb('0x39')]['includeAll']){_0x21ffdf['include']=[{'all':!![]}];}return db[_0xceeb('0x34')][_0xceeb('0x47')](_0x21ffdf);})[_0xceeb('0x2c')](function(_0x50caec){_0x5e5a3c[_0xceeb('0x48')]=_0x50caec;return _0x5e5a3c;})[_0xceeb('0x2c')](respondWithFilteredResult(_0x5caaaf,_0x21ffdf))[_0xceeb('0x49')](handleError(_0x5caaaf,null));};exports[_0xceeb('0x4a')]=function(_0x3db709,_0x976f2){var _0x2e4454={'raw':!![],'where':{'id':_0x3db709[_0xceeb('0x4b')]['id']}},_0x475f13={};_0x475f13[_0xceeb('0x38')]=_['keys'](db[_0xceeb('0x34')][_0xceeb('0x35')]);_0x475f13[_0xceeb('0x39')]=_[_0xceeb('0x3a')](_0x3db709[_0xceeb('0x39')]);_0x475f13['filters']=_[_0xceeb('0x3c')](_0x475f13[_0xceeb('0x38')],_0x475f13['query']);_0x2e4454[_0xceeb('0x3d')]=_[_0xceeb('0x3c')](_0x475f13[_0xceeb('0x38')],qs[_0xceeb('0x3e')](_0x3db709[_0xceeb('0x39')][_0xceeb('0x3e')]));_0x2e4454[_0xceeb('0x3d')]=_0x2e4454[_0xceeb('0x3d')][_0xceeb('0x4c')]?_0x2e4454[_0xceeb('0x3d')]:_0x475f13[_0xceeb('0x38')];if(_0x3db709['query'][_0xceeb('0x4d')]){_0x2e4454[_0xceeb('0x4e')]=[{'all':!![]}];}_0x2e4454=_[_0xceeb('0x4f')]({},_0x2e4454,_0x3db709[_0xceeb('0x46')]);return db[_0xceeb('0x34')][_0xceeb('0x50')](_0x2e4454)['then'](handleEntityNotFound(_0x976f2,null))[_0xceeb('0x2c')](respondWithResult(_0x976f2,null))['catch'](handleError(_0x976f2,null));};exports[_0xceeb('0x51')]=function(_0x57fce0,_0x1b6d7f){return db['ChatGroup'][_0xceeb('0x51')](_0x57fce0[_0xceeb('0x52')],{})[_0xceeb('0x2c')](respondWithResult(_0x1b6d7f,0xc9))['catch'](handleError(_0x1b6d7f,null));};exports['update']=function(_0x1b416b,_0x19cdd8){if(_0x1b416b[_0xceeb('0x52')]['id']){delete _0x1b416b[_0xceeb('0x52')]['id'];}return db[_0xceeb('0x34')]['find']({'where':{'id':_0x1b416b['params']['id']}})[_0xceeb('0x2c')](handleEntityNotFound(_0x19cdd8,null))[_0xceeb('0x2c')](saveUpdates(_0x1b416b[_0xceeb('0x52')],null))[_0xceeb('0x2c')](respondWithResult(_0x19cdd8,null))[_0xceeb('0x49')](handleError(_0x19cdd8,null));};exports[_0xceeb('0x53')]=function(_0x282e3e,_0x20f09f){return db[_0xceeb('0x34')][_0xceeb('0x50')]({'where':{'id':_0x282e3e['params']['id']}})[_0xceeb('0x2c')](handleEntityNotFound(_0x20f09f,null))[_0xceeb('0x2c')](removeEntity(_0x20f09f,null))[_0xceeb('0x49')](handleError(_0x20f09f,null));};exports[_0xceeb('0x54')]=function(_0x5334ef,_0x20a0c8){return db[_0xceeb('0x34')]['describe']()[_0xceeb('0x2c')](respondWithResult(_0x20a0c8,null))[_0xceeb('0x49')](handleError(_0x20a0c8,null));};exports[_0xceeb('0x55')]=function(_0x1ca49a,_0x1ddad0,_0x2278d8){return db[_0xceeb('0x56')][_0xceeb('0x26')]({'where':{'ChatGroupId':_0x1ca49a[_0xceeb('0x4b')]['id'],'ToId':_0x1ca49a[_0xceeb('0x57')]['id'],'read':![]}})[_0xceeb('0x2c')](function(_0x258a42){return{'id':_['toInteger'](_0x1ca49a['params']['id']),'count':_0x258a42};})[_0xceeb('0x2c')](respondWithResult(_0x1ddad0,null))[_0xceeb('0x49')](handleError(_0x1ddad0,null));};exports[_0xceeb('0x58')]=function(_0x2724cd,_0x50f816,_0x5dc286){return db['ChatGroup'][_0xceeb('0x50')]({'where':{'id':_0x2724cd[_0xceeb('0x4b')]['id']}})[_0xceeb('0x2c')](handleEntityNotFound(_0x50f816,null))[_0xceeb('0x2c')](function(_0x3e8ad9){if(_0x3e8ad9){return _0x3e8ad9[_0xceeb('0x58')](_0x2724cd[_0xceeb('0x52')]['ids'],_['omit'](_0x2724cd[_0xceeb('0x52')],[_0xceeb('0x59'),'id'])||{});}})[_0xceeb('0x2c')](respondWithResult(_0x50f816,null))['catch'](handleError(_0x50f816,null));};exports['getMembers']=function(_0x375ccc,_0x1f03ce,_0x2a0cfc){var _0x172230={};var _0x347395={};var _0x41f924;var _0x3fa6ba;return db[_0xceeb('0x34')][_0xceeb('0x5a')]({'where':{'id':_0x375ccc['params']['id']}})['then'](handleEntityNotFound(_0x1f03ce,null))['then'](function(_0x7ad6a6){if(_0x7ad6a6){_0x41f924=_0x7ad6a6;_0x347395[_0xceeb('0x38')]=_[_0xceeb('0x3a')](db[_0xceeb('0x5b')][_0xceeb('0x35')]);_0x347395[_0xceeb('0x39')]=_[_0xceeb('0x3a')](_0x375ccc[_0xceeb('0x39')]);_0x347395['filters']=_[_0xceeb('0x3c')](_0x347395[_0xceeb('0x38')],_0x347395[_0xceeb('0x39')]);_0x172230[_0xceeb('0x3d')]=_[_0xceeb('0x3c')](_0x347395[_0xceeb('0x38')],qs[_0xceeb('0x3e')](_0x375ccc['query']['fields']));_0x172230[_0xceeb('0x3d')]=_0x172230[_0xceeb('0x3d')][_0xceeb('0x4c')]?_0x172230[_0xceeb('0x3d')]:_0x347395[_0xceeb('0x38')];_0x172230['order']=qs[_0xceeb('0x41')](_0x375ccc['query'][_0xceeb('0x41')]);_0x172230['where']=qs[_0xceeb('0x3b')](_['pick'](_0x375ccc[_0xceeb('0x39')],_0x347395[_0xceeb('0x3b')]));if(_0x375ccc[_0xceeb('0x39')][_0xceeb('0x45')]){_0x172230[_0xceeb('0x43')]=_[_0xceeb('0x4f')](_0x172230['where'],{'$or':_['map'](_0x172230[_0xceeb('0x3d')],function(_0xc46dda){var _0x4b8d0c={};_0x4b8d0c[_0xc46dda]={'$like':'%'+_0x375ccc['query']['filter']+'%'};return _0x4b8d0c;})});}_0x172230=_[_0xceeb('0x4f')]({},_0x172230,_0x375ccc[_0xceeb('0x46')]);return _0x41f924['getMembers'](_0x172230);}})[_0xceeb('0x2c')](function(_0x4b350d){if(_0x4b350d){_0x3fa6ba=_0x4b350d[_0xceeb('0x4c')];if(!_0x375ccc[_0xceeb('0x39')][_0xceeb('0x3f')](_0xceeb('0x5c'))){_0x172230[_0xceeb('0x24')]=qs[_0xceeb('0x24')](_0x375ccc[_0xceeb('0x39')][_0xceeb('0x24')]);_0x172230[_0xceeb('0x27')]=qs[_0xceeb('0x27')](_0x375ccc[_0xceeb('0x39')][_0xceeb('0x27')]);}return _0x41f924[_0xceeb('0x5d')](_0x172230);}})['then'](function(_0x153cdc){if(_0x153cdc){return _0x153cdc?{'count':_0x3fa6ba,'rows':_0x153cdc}:null;}})[_0xceeb('0x2c')](respondWithResult(_0x1f03ce,null))[_0xceeb('0x49')](handleError(_0x1f03ce,null));};exports[_0xceeb('0x5e')]=function(_0x3594c5,_0x2e70c1,_0x2cd40d){return db[_0xceeb('0x34')][_0xceeb('0x50')]({'where':{'id':_0x3594c5[_0xceeb('0x4b')]['id']}})[_0xceeb('0x2c')](handleEntityNotFound(_0x2e70c1,null))[_0xceeb('0x2c')](function(_0x54fb3f){if(_0x54fb3f){return _0x54fb3f[_0xceeb('0x5e')](_0x3594c5[_0xceeb('0x39')]['ids']);}})[_0xceeb('0x2c')](respondWithStatusCode(_0x2e70c1,null))['catch'](handleError(_0x2e70c1,null));};exports['addMessage']=function(_0x53a021,_0x2a56ba,_0x27b7ab){if(_0x53a021['body']['id']){delete _0x53a021[_0xceeb('0x52')]['id'];}return db[_0xceeb('0x34')][_0xceeb('0x50')]({'where':{'id':_0x53a021[_0xceeb('0x4b')]['id']}})[_0xceeb('0x2c')](handleEntityNotFound(_0x2a56ba,null))[_0xceeb('0x2c')](function(_0x26ee9b){if(_0x26ee9b){_0x53a021[_0xceeb('0x52')]['ChatGroupId']=_0x26ee9b['id'];return db[_0xceeb('0x56')][_0xceeb('0x51')](_0x53a021[_0xceeb('0x52')]);}})[_0xceeb('0x2c')](respondWithResult(_0x2a56ba,null))[_0xceeb('0x49')](handleError(_0x2a56ba,null));};exports[_0xceeb('0x5f')]=function(_0x16cc86,_0xa2c6f,_0x278c9d){var _0x16a068={};var _0x411359={};var _0x34d3c0;var _0x448a75;return db[_0xceeb('0x34')][_0xceeb('0x5a')]({'where':{'id':_0x16cc86[_0xceeb('0x4b')]['id']}})[_0xceeb('0x2c')](handleEntityNotFound(_0xa2c6f,null))[_0xceeb('0x2c')](function(_0x3282e5){if(_0x3282e5){_0x34d3c0=_0x3282e5;_0x411359['model']=_['keys'](db[_0xceeb('0x56')][_0xceeb('0x35')]);_0x411359[_0xceeb('0x39')]=_[_0xceeb('0x3a')](_0x16cc86['query']);_0x411359[_0xceeb('0x3b')]=_['intersection'](_0x411359[_0xceeb('0x38')],_0x411359['query']);_0x16a068[_0xceeb('0x3d')]=_['intersection'](_0x411359['model'],qs[_0xceeb('0x3e')](_0x16cc86[_0xceeb('0x39')][_0xceeb('0x3e')]));_0x16a068[_0xceeb('0x3d')]=_0x16a068[_0xceeb('0x3d')][_0xceeb('0x4c')]?_0x16a068['attributes']:_0x411359[_0xceeb('0x38')];_0x16a068[_0xceeb('0x40')]=qs[_0xceeb('0x41')](_0x16cc86[_0xceeb('0x39')][_0xceeb('0x41')]);_0x16a068['where']=qs[_0xceeb('0x3b')](_[_0xceeb('0x42')](_0x16cc86[_0xceeb('0x39')],_0x411359[_0xceeb('0x3b')]));if(_0x16cc86[_0xceeb('0x39')][_0xceeb('0x45')]){_0x16a068[_0xceeb('0x43')]=_[_0xceeb('0x4f')](_0x16a068[_0xceeb('0x43')],{'$or':_[_0xceeb('0x33')](_0x16a068['attributes'],function(_0x4cacc8){var _0x29b08d={};_0x29b08d[_0x4cacc8]={'$like':'%'+_0x16cc86[_0xceeb('0x39')][_0xceeb('0x45')]+'%'};return _0x29b08d;})});}if(_0x16cc86[_0xceeb('0x39')][_0xceeb('0x60')]){var _0x126087=_0x16cc86[_0xceeb('0x39')][_0xceeb('0x60')]['split'](',');var _0xb2c946={};_0xb2c946[_0x126087[0x0]]={'$gte':moment(_0x126087[0x1])['format'](_0xceeb('0x61'))};_0x16a068['where']=_[_0xceeb('0x4f')](_0x16a068[_0xceeb('0x43')],_0xb2c946);}_0x16a068=_['merge']({},_0x16a068,_0x16cc86[_0xceeb('0x46')]);return _0x34d3c0[_0xceeb('0x5f')](_0x16a068);}})[_0xceeb('0x2c')](function(_0x59e8fd){if(_0x59e8fd){_0x448a75=_0x59e8fd[_0xceeb('0x4c')];if(!_0x16cc86[_0xceeb('0x39')][_0xceeb('0x3f')](_0xceeb('0x5c'))){_0x16a068[_0xceeb('0x24')]=qs['limit'](_0x16cc86[_0xceeb('0x39')][_0xceeb('0x24')]);_0x16a068['offset']=qs['offset'](_0x16cc86['query'][_0xceeb('0x27')]);}return _0x34d3c0['getMessages'](_0x16a068);}})[_0xceeb('0x2c')](function(_0x40061b){if(_0x40061b){return _0x40061b?{'count':_0x448a75,'rows':_0x40061b}:null;}})[_0xceeb('0x2c')](respondWithResult(_0xa2c6f,null))['catch'](handleError(_0xa2c6f,null));}; \ No newline at end of file +var _0xc4ba=['rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','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','redis','localhost','socket.io-emitter','register','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','sendStatus','stack','name','send','index','map','ChatGroup','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','describe','getUnread','user','toInteger','addMembers','ids','omit','findOne','User','order','getMembers','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','getMessages','split','YYYY-MM-DD\x20HH:mm:ss','eml-format'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xc4ba,0x12b));var _0xac4b=function(_0x37dfa9,_0x488729){_0x37dfa9=_0x37dfa9-0x0;var _0x36c64d=_0xc4ba[_0x37dfa9];return _0x36c64d;};'use strict';var emlformat=require(_0xac4b('0x0'));var rimraf=require(_0xac4b('0x1'));var zipdir=require(_0xac4b('0x2'));var jsonpatch=require(_0xac4b('0x3'));var rp=require(_0xac4b('0x4'));var moment=require('moment');var BPromise=require(_0xac4b('0x5'));var Mustache=require(_0xac4b('0x6'));var util=require(_0xac4b('0x7'));var path=require(_0xac4b('0x8'));var sox=require(_0xac4b('0x9'));var csv=require(_0xac4b('0xa'));var ejs=require(_0xac4b('0xb'));var fs=require('fs');var fs_extra=require(_0xac4b('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xac4b('0xd'));var jsforce=require(_0xac4b('0xe'));var deskjs=require(_0xac4b('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xac4b('0x10'));var authService=require(_0xac4b('0x11'));var qs=require(_0xac4b('0x12'));var as=require(_0xac4b('0x13'));var hardwareService=require(_0xac4b('0x14'));var logger=require(_0xac4b('0x15'))('api');var utils=require(_0xac4b('0x16'));var config=require(_0xac4b('0x17'));var licenseUtil=require(_0xac4b('0x18'));var db=require(_0xac4b('0x19'))['db'];config['redis']=_['defaults'](config[_0xac4b('0x1a')],{'host':_0xac4b('0x1b'),'port':0x18eb});var socket=require(_0xac4b('0x1c'))(new Redis(config[_0xac4b('0x1a')]));require('./chatGroup.socket')[_0xac4b('0x1d')](socket);function respondWithStatusCode(_0x2a0003,_0x29a9cc){_0x29a9cc=_0x29a9cc||0xcc;return function(_0x5b3e09){if(_0x5b3e09){return _0x2a0003['sendStatus'](_0x29a9cc);}return _0x2a0003[_0xac4b('0x1e')](_0x29a9cc)[_0xac4b('0x1f')]();};}function respondWithResult(_0x38e410,_0x249285){_0x249285=_0x249285||0xc8;return function(_0x375be6){if(_0x375be6){return _0x38e410['status'](_0x249285)[_0xac4b('0x20')](_0x375be6);}};}function respondWithFilteredResult(_0x368b18,_0x9ab793){return function(_0x2a083a){if(_0x2a083a){var _0x12727c=typeof _0x9ab793[_0xac4b('0x21')]===_0xac4b('0x22')&&typeof _0x9ab793[_0xac4b('0x23')]==='undefined';var _0x1d5af6=_0x2a083a[_0xac4b('0x24')];var _0x26ebd7=_0x12727c?0x0:_0x9ab793[_0xac4b('0x21')];var _0x4cd0e5=_0x12727c?_0x2a083a[_0xac4b('0x24')]:_0x9ab793[_0xac4b('0x21')]+_0x9ab793[_0xac4b('0x23')];var _0xed6b64;if(_0x4cd0e5>=_0x1d5af6){_0x4cd0e5=_0x1d5af6;_0xed6b64=0xc8;}else{_0xed6b64=0xce;}_0x368b18['status'](_0xed6b64);return _0x368b18['set'](_0xac4b('0x25'),_0x26ebd7+'-'+_0x4cd0e5+'/'+_0x1d5af6)['json'](_0x2a083a);}return null;};}function patchUpdates(_0x3dd64b){return function(_0x542bba){try{jsonpatch[_0xac4b('0x26')](_0x542bba,_0x3dd64b,!![]);}catch(_0xb29153){return BPromise[_0xac4b('0x27')](_0xb29153);}return _0x542bba[_0xac4b('0x28')]();};}function saveUpdates(_0x1ca3d2,_0x4c9b42){return function(_0x7d5fd1){if(_0x7d5fd1){return _0x7d5fd1[_0xac4b('0x29')](_0x1ca3d2)['then'](function(_0x1103b6){return _0x1103b6;});}return null;};}function removeEntity(_0x126cdd,_0x3add1){return function(_0x444fa8){if(_0x444fa8){return _0x444fa8[_0xac4b('0x2a')]()[_0xac4b('0x2b')](function(){_0x126cdd[_0xac4b('0x1e')](0xcc)[_0xac4b('0x1f')]();});}};}function handleEntityNotFound(_0x2702f9,_0x30b626){return function(_0x181634){if(!_0x181634){_0x2702f9[_0xac4b('0x2c')](0x194);}return _0x181634;};}function handleError(_0x4cb1fe,_0x481470){_0x481470=_0x481470||0x1f4;return function(_0x3b41c3){logger['error'](_0x3b41c3[_0xac4b('0x2d')]);if(_0x3b41c3[_0xac4b('0x2e')]){delete _0x3b41c3[_0xac4b('0x2e')];}_0x4cb1fe[_0xac4b('0x1e')](_0x481470)[_0xac4b('0x2f')](_0x3b41c3);};}exports[_0xac4b('0x30')]=function(_0x522d36,_0x568a61){var _0x397b4a={},_0xcb1422={},_0x581b4f={'count':0x0,'rows':[]};var _0x317e7a=_[_0xac4b('0x31')](db[_0xac4b('0x32')]['rawAttributes'],function(_0x286c65){return{'name':_0x286c65[_0xac4b('0x33')],'type':_0x286c65[_0xac4b('0x34')][_0xac4b('0x35')]};});_0xcb1422[_0xac4b('0x36')]=_['map'](_0x317e7a,_0xac4b('0x2e'));_0xcb1422['query']=_[_0xac4b('0x37')](_0x522d36['query']);_0xcb1422[_0xac4b('0x38')]=_[_0xac4b('0x39')](_0xcb1422[_0xac4b('0x36')],_0xcb1422[_0xac4b('0x3a')]);_0x397b4a['attributes']=_[_0xac4b('0x39')](_0xcb1422['model'],qs[_0xac4b('0x3b')](_0x522d36[_0xac4b('0x3a')]['fields']));_0x397b4a[_0xac4b('0x3c')]=_0x397b4a[_0xac4b('0x3c')]['length']?_0x397b4a[_0xac4b('0x3c')]:_0xcb1422[_0xac4b('0x36')];if(!_0x522d36[_0xac4b('0x3a')][_0xac4b('0x3d')](_0xac4b('0x3e'))){_0x397b4a[_0xac4b('0x23')]=qs[_0xac4b('0x23')](_0x522d36[_0xac4b('0x3a')]['limit']);_0x397b4a[_0xac4b('0x21')]=qs[_0xac4b('0x21')](_0x522d36[_0xac4b('0x3a')][_0xac4b('0x21')]);}_0x397b4a['order']=qs['sort'](_0x522d36[_0xac4b('0x3a')][_0xac4b('0x3f')]);_0x397b4a[_0xac4b('0x40')]=qs[_0xac4b('0x38')](_[_0xac4b('0x41')](_0x522d36['query'],_0xcb1422['filters']),_0x317e7a);if(_0x522d36[_0xac4b('0x3a')][_0xac4b('0x42')]){_0x397b4a['where']=_[_0xac4b('0x43')](_0x397b4a[_0xac4b('0x40')],{'$or':_[_0xac4b('0x31')](_0x317e7a,function(_0x32bcc6){if(_0x32bcc6['type']!==_0xac4b('0x44')){var _0x3a385c={};_0x3a385c[_0x32bcc6[_0xac4b('0x2e')]]={'$like':'%'+_0x522d36[_0xac4b('0x3a')][_0xac4b('0x42')]+'%'};return _0x3a385c;}})});}_0x397b4a=_[_0xac4b('0x43')]({},_0x397b4a,_0x522d36[_0xac4b('0x45')]);var _0x4b2dbd={'where':_0x397b4a[_0xac4b('0x40')]};return db[_0xac4b('0x32')]['count'](_0x4b2dbd)['then'](function(_0x3f100f){_0x581b4f[_0xac4b('0x24')]=_0x3f100f;if(_0x522d36['query'][_0xac4b('0x46')]){_0x397b4a[_0xac4b('0x47')]=[{'all':!![]}];}return db['ChatGroup'][_0xac4b('0x48')](_0x397b4a);})[_0xac4b('0x2b')](function(_0x48fb63){_0x581b4f[_0xac4b('0x49')]=_0x48fb63;return _0x581b4f;})['then'](respondWithFilteredResult(_0x568a61,_0x397b4a))[_0xac4b('0x4a')](handleError(_0x568a61,null));};exports[_0xac4b('0x4b')]=function(_0x14d91f,_0x260d8d){var _0xe2081a={'raw':!![],'where':{'id':_0x14d91f[_0xac4b('0x4c')]['id']}},_0x599ca2={};_0x599ca2[_0xac4b('0x36')]=_[_0xac4b('0x37')](db[_0xac4b('0x32')][_0xac4b('0x4d')]);_0x599ca2['query']=_[_0xac4b('0x37')](_0x14d91f[_0xac4b('0x3a')]);_0x599ca2[_0xac4b('0x38')]=_[_0xac4b('0x39')](_0x599ca2[_0xac4b('0x36')],_0x599ca2[_0xac4b('0x3a')]);_0xe2081a[_0xac4b('0x3c')]=_[_0xac4b('0x39')](_0x599ca2[_0xac4b('0x36')],qs['fields'](_0x14d91f[_0xac4b('0x3a')][_0xac4b('0x3b')]));_0xe2081a['attributes']=_0xe2081a['attributes'][_0xac4b('0x4e')]?_0xe2081a[_0xac4b('0x3c')]:_0x599ca2['model'];if(_0x14d91f['query'][_0xac4b('0x46')]){_0xe2081a[_0xac4b('0x47')]=[{'all':!![]}];}_0xe2081a=_[_0xac4b('0x43')]({},_0xe2081a,_0x14d91f[_0xac4b('0x45')]);return db['ChatGroup'][_0xac4b('0x4f')](_0xe2081a)[_0xac4b('0x2b')](handleEntityNotFound(_0x260d8d,null))[_0xac4b('0x2b')](respondWithResult(_0x260d8d,null))[_0xac4b('0x4a')](handleError(_0x260d8d,null));};exports['create']=function(_0x44da61,_0x5e51ca){return db[_0xac4b('0x32')][_0xac4b('0x50')](_0x44da61['body'],{})[_0xac4b('0x2b')](respondWithResult(_0x5e51ca,0xc9))['catch'](handleError(_0x5e51ca,null));};exports[_0xac4b('0x29')]=function(_0x26f86a,_0x18d376){if(_0x26f86a[_0xac4b('0x51')]['id']){delete _0x26f86a[_0xac4b('0x51')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x26f86a[_0xac4b('0x4c')]['id']}})[_0xac4b('0x2b')](handleEntityNotFound(_0x18d376,null))[_0xac4b('0x2b')](saveUpdates(_0x26f86a['body'],null))[_0xac4b('0x2b')](respondWithResult(_0x18d376,null))[_0xac4b('0x4a')](handleError(_0x18d376,null));};exports[_0xac4b('0x2a')]=function(_0x56b0db,_0x4bbd2f){return db[_0xac4b('0x32')][_0xac4b('0x4f')]({'where':{'id':_0x56b0db[_0xac4b('0x4c')]['id']}})[_0xac4b('0x2b')](handleEntityNotFound(_0x4bbd2f,null))[_0xac4b('0x2b')](removeEntity(_0x4bbd2f,null))[_0xac4b('0x4a')](handleError(_0x4bbd2f,null));};exports[_0xac4b('0x52')]=function(_0x2bd619,_0x1bff05){return db['ChatGroup'][_0xac4b('0x52')]()[_0xac4b('0x2b')](respondWithResult(_0x1bff05,null))[_0xac4b('0x4a')](handleError(_0x1bff05,null));};exports[_0xac4b('0x53')]=function(_0x8704ed,_0x2123db,_0xee8562){return db['ChatInternalMessage'][_0xac4b('0x24')]({'where':{'ChatGroupId':_0x8704ed[_0xac4b('0x4c')]['id'],'ToId':_0x8704ed[_0xac4b('0x54')]['id'],'read':![]}})[_0xac4b('0x2b')](function(_0x571427){return{'id':_[_0xac4b('0x55')](_0x8704ed['params']['id']),'count':_0x571427};})['then'](respondWithResult(_0x2123db,null))[_0xac4b('0x4a')](handleError(_0x2123db,null));};exports['addMembers']=function(_0x47381c,_0x270889,_0x27ee8e){return db[_0xac4b('0x32')][_0xac4b('0x4f')]({'where':{'id':_0x47381c[_0xac4b('0x4c')]['id']}})['then'](handleEntityNotFound(_0x270889,null))['then'](function(_0x200628){if(_0x200628){return _0x200628[_0xac4b('0x56')](_0x47381c[_0xac4b('0x51')][_0xac4b('0x57')],_[_0xac4b('0x58')](_0x47381c[_0xac4b('0x51')],[_0xac4b('0x57'),'id'])||{});}})[_0xac4b('0x2b')](respondWithResult(_0x270889,null))[_0xac4b('0x4a')](handleError(_0x270889,null));};exports['getMembers']=function(_0x1dce17,_0x20f5f8,_0x1f30f3){var _0x2a6ff4={};var _0x247525={};var _0xfc5f7a;var _0x3f633a;return db[_0xac4b('0x32')][_0xac4b('0x59')]({'where':{'id':_0x1dce17[_0xac4b('0x4c')]['id']}})[_0xac4b('0x2b')](handleEntityNotFound(_0x20f5f8,null))[_0xac4b('0x2b')](function(_0x142ff1){if(_0x142ff1){_0xfc5f7a=_0x142ff1;_0x247525[_0xac4b('0x36')]=_['keys'](db[_0xac4b('0x5a')][_0xac4b('0x4d')]);_0x247525[_0xac4b('0x3a')]=_['keys'](_0x1dce17['query']);_0x247525[_0xac4b('0x38')]=_[_0xac4b('0x39')](_0x247525['model'],_0x247525[_0xac4b('0x3a')]);_0x2a6ff4[_0xac4b('0x3c')]=_[_0xac4b('0x39')](_0x247525['model'],qs[_0xac4b('0x3b')](_0x1dce17[_0xac4b('0x3a')][_0xac4b('0x3b')]));_0x2a6ff4[_0xac4b('0x3c')]=_0x2a6ff4['attributes'][_0xac4b('0x4e')]?_0x2a6ff4[_0xac4b('0x3c')]:_0x247525[_0xac4b('0x36')];_0x2a6ff4[_0xac4b('0x5b')]=qs[_0xac4b('0x3f')](_0x1dce17['query'][_0xac4b('0x3f')]);_0x2a6ff4[_0xac4b('0x40')]=qs[_0xac4b('0x38')](_[_0xac4b('0x41')](_0x1dce17[_0xac4b('0x3a')],_0x247525[_0xac4b('0x38')]));if(_0x1dce17[_0xac4b('0x3a')][_0xac4b('0x42')]){_0x2a6ff4[_0xac4b('0x40')]=_[_0xac4b('0x43')](_0x2a6ff4['where'],{'$or':_[_0xac4b('0x31')](_0x2a6ff4[_0xac4b('0x3c')],function(_0x1060d7){var _0x1cd750={};_0x1cd750[_0x1060d7]={'$like':'%'+_0x1dce17['query'][_0xac4b('0x42')]+'%'};return _0x1cd750;})});}_0x2a6ff4=_[_0xac4b('0x43')]({},_0x2a6ff4,_0x1dce17[_0xac4b('0x45')]);return _0xfc5f7a[_0xac4b('0x5c')](_0x2a6ff4);}})[_0xac4b('0x2b')](function(_0x49ab32){if(_0x49ab32){_0x3f633a=_0x49ab32[_0xac4b('0x4e')];if(!_0x1dce17[_0xac4b('0x3a')][_0xac4b('0x3d')](_0xac4b('0x3e'))){_0x2a6ff4[_0xac4b('0x23')]=qs[_0xac4b('0x23')](_0x1dce17[_0xac4b('0x3a')][_0xac4b('0x23')]);_0x2a6ff4['offset']=qs[_0xac4b('0x21')](_0x1dce17['query']['offset']);}return _0xfc5f7a[_0xac4b('0x5c')](_0x2a6ff4);}})[_0xac4b('0x2b')](function(_0x585389){if(_0x585389){return _0x585389?{'count':_0x3f633a,'rows':_0x585389}:null;}})['then'](respondWithResult(_0x20f5f8,null))[_0xac4b('0x4a')](handleError(_0x20f5f8,null));};exports[_0xac4b('0x5d')]=function(_0x39daa9,_0x3f93b1,_0x4a77bc){return db['ChatGroup']['find']({'where':{'id':_0x39daa9['params']['id']}})['then'](handleEntityNotFound(_0x3f93b1,null))[_0xac4b('0x2b')](function(_0x393bc2){if(_0x393bc2){return _0x393bc2['removeMembers'](_0x39daa9[_0xac4b('0x3a')]['ids']);}})['then'](respondWithStatusCode(_0x3f93b1,null))[_0xac4b('0x4a')](handleError(_0x3f93b1,null));};exports[_0xac4b('0x5e')]=function(_0x4e3b71,_0x62ec5a,_0x35a2f5){if(_0x4e3b71[_0xac4b('0x51')]['id']){delete _0x4e3b71[_0xac4b('0x51')]['id'];}return db['ChatGroup'][_0xac4b('0x4f')]({'where':{'id':_0x4e3b71['params']['id']}})[_0xac4b('0x2b')](handleEntityNotFound(_0x62ec5a,null))['then'](function(_0x4229e6){if(_0x4229e6){_0x4e3b71[_0xac4b('0x51')][_0xac4b('0x5f')]=_0x4229e6['id'];return db[_0xac4b('0x60')][_0xac4b('0x50')](_0x4e3b71[_0xac4b('0x51')]);}})[_0xac4b('0x2b')](respondWithResult(_0x62ec5a,null))[_0xac4b('0x4a')](handleError(_0x62ec5a,null));};exports[_0xac4b('0x61')]=function(_0x17b780,_0x10ef9d,_0x5bfa21){var _0x2c3ad2={};var _0x33e2ee={};var _0x53ca88;var _0x1567dd;return db[_0xac4b('0x32')][_0xac4b('0x59')]({'where':{'id':_0x17b780[_0xac4b('0x4c')]['id']}})[_0xac4b('0x2b')](handleEntityNotFound(_0x10ef9d,null))['then'](function(_0x2305f5){if(_0x2305f5){_0x53ca88=_0x2305f5;_0x33e2ee[_0xac4b('0x36')]=_[_0xac4b('0x37')](db[_0xac4b('0x60')][_0xac4b('0x4d')]);_0x33e2ee[_0xac4b('0x3a')]=_['keys'](_0x17b780[_0xac4b('0x3a')]);_0x33e2ee[_0xac4b('0x38')]=_[_0xac4b('0x39')](_0x33e2ee['model'],_0x33e2ee['query']);_0x2c3ad2[_0xac4b('0x3c')]=_[_0xac4b('0x39')](_0x33e2ee[_0xac4b('0x36')],qs[_0xac4b('0x3b')](_0x17b780['query'][_0xac4b('0x3b')]));_0x2c3ad2[_0xac4b('0x3c')]=_0x2c3ad2[_0xac4b('0x3c')]['length']?_0x2c3ad2['attributes']:_0x33e2ee['model'];_0x2c3ad2[_0xac4b('0x5b')]=qs['sort'](_0x17b780[_0xac4b('0x3a')]['sort']);_0x2c3ad2[_0xac4b('0x40')]=qs[_0xac4b('0x38')](_['pick'](_0x17b780[_0xac4b('0x3a')],_0x33e2ee[_0xac4b('0x38')]));if(_0x17b780[_0xac4b('0x3a')][_0xac4b('0x42')]){_0x2c3ad2[_0xac4b('0x40')]=_[_0xac4b('0x43')](_0x2c3ad2[_0xac4b('0x40')],{'$or':_[_0xac4b('0x31')](_0x2c3ad2[_0xac4b('0x3c')],function(_0x33ffb2){var _0x26340d={};_0x26340d[_0x33ffb2]={'$like':'%'+_0x17b780['query'][_0xac4b('0x42')]+'%'};return _0x26340d;})});}if(_0x17b780['query']['$gte']){var _0x37bb6a=_0x17b780['query']['$gte'][_0xac4b('0x62')](',');var _0x12b5d4={};_0x12b5d4[_0x37bb6a[0x0]]={'$gte':moment(_0x37bb6a[0x1])['format'](_0xac4b('0x63'))};_0x2c3ad2['where']=_['merge'](_0x2c3ad2[_0xac4b('0x40')],_0x12b5d4);}_0x2c3ad2=_['merge']({},_0x2c3ad2,_0x17b780[_0xac4b('0x45')]);return _0x53ca88['getMessages'](_0x2c3ad2);}})[_0xac4b('0x2b')](function(_0x110e1b){if(_0x110e1b){_0x1567dd=_0x110e1b['length'];if(!_0x17b780[_0xac4b('0x3a')]['hasOwnProperty']('nolimit')){_0x2c3ad2[_0xac4b('0x23')]=qs['limit'](_0x17b780[_0xac4b('0x3a')][_0xac4b('0x23')]);_0x2c3ad2[_0xac4b('0x21')]=qs[_0xac4b('0x21')](_0x17b780[_0xac4b('0x3a')][_0xac4b('0x21')]);}return _0x53ca88[_0xac4b('0x61')](_0x2c3ad2);}})[_0xac4b('0x2b')](function(_0x2314a4){if(_0x2314a4){return _0x2314a4?{'count':_0x1567dd,'rows':_0x2314a4}:null;}})[_0xac4b('0x2b')](respondWithResult(_0x10ef9d,null))[_0xac4b('0x4a')](handleError(_0x10ef9d,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index a1669f3..79d8d01 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 _0xd3a7=['hasOwnProperty','hook','events','../../mysqldb','ChatGroup','setMaxListeners','save','remove','emit'];(function(_0x454018,_0x46e33a){var _0x24697d=function(_0x3ec647){while(--_0x3ec647){_0x454018['push'](_0x454018['shift']());}};_0x24697d(++_0x46e33a);}(_0xd3a7,0x107));var _0x7d3a=function(_0x48e217,_0x52f37f){_0x48e217=_0x48e217-0x0;var _0x3dec9b=_0xd3a7[_0x48e217];return _0x3dec9b;};'use strict';var EventEmitter=require(_0x7d3a('0x0'));var ChatGroup=require(_0x7d3a('0x1'))['db'][_0x7d3a('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x7d3a('0x3')](0x0);var events={'afterCreate':_0x7d3a('0x4'),'afterUpdate':'update','afterDestroy':_0x7d3a('0x5')};function emitEvent(_0x11263b){return function(_0x4e808a,_0xd65c98,_0x5ab854){ChatGroupEvents[_0x7d3a('0x6')](_0x11263b+':'+_0x4e808a['id'],_0x4e808a);ChatGroupEvents[_0x7d3a('0x6')](_0x11263b,_0x4e808a);_0x5ab854(null);};}for(var e in events){if(events[_0x7d3a('0x7')](e)){var event=events[e];ChatGroup[_0x7d3a('0x8')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file +var _0x7f59=['setMaxListeners','save','update','remove','hook','exports','events','../../mysqldb'];(function(_0x14ea0e,_0xa1ff61){var _0x287b2f=function(_0x1922e4){while(--_0x1922e4){_0x14ea0e['push'](_0x14ea0e['shift']());}};_0x287b2f(++_0xa1ff61);}(_0x7f59,0x12e));var _0x97f5=function(_0xf857,_0x1502b5){_0xf857=_0xf857-0x0;var _0x23ce80=_0x7f59[_0xf857];return _0x23ce80;};'use strict';var EventEmitter=require(_0x97f5('0x0'));var ChatGroup=require(_0x97f5('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x97f5('0x2')](0x0);var events={'afterCreate':_0x97f5('0x3'),'afterUpdate':_0x97f5('0x4'),'afterDestroy':_0x97f5('0x5')};function emitEvent(_0x2b37b0){return function(_0x18d4c3,_0x29af72,_0x5e6215){ChatGroupEvents['emit'](_0x2b37b0+':'+_0x18d4c3['id'],_0x18d4c3);ChatGroupEvents['emit'](_0x2b37b0,_0x18d4c3);_0x5e6215(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x97f5('0x6')](e,emitEvent(event));}}module[_0x97f5('0x7')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 722c44d..f667cd3 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 _0x545f=['exports','define','ChatGroup','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1ca9eb,_0x99a10b){var _0x2e284e=function(_0x1196a4){while(--_0x1196a4){_0x1ca9eb['push'](_0x1ca9eb['shift']());}};_0x2e284e(++_0x99a10b);}(_0x545f,0x7b));var _0xf545=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0x545f[_0xe66cf2];return _0x2d84e7;};'use strict';var _=require('lodash');var util=require(_0xf545('0x0'));var logger=require(_0xf545('0x1'))(_0xf545('0x2'));var moment=require(_0xf545('0x3'));var BPromise=require(_0xf545('0x4'));var rp=require(_0xf545('0x5'));var fs=require('fs');var path=require(_0xf545('0x6'));var rimraf=require(_0xf545('0x7'));var config=require(_0xf545('0x8'));var attributes=require('./chatGroup.attributes');module[_0xf545('0x9')]=function(_0x3b8af7,_0x38f650){return _0x3b8af7[_0xf545('0xa')](_0xf545('0xb'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde4a=['../../config/logger','moment','bluebird','request-promise','path','rimraf','exports','ChatGroup','lodash','util'];(function(_0x11b19f,_0x5807af){var _0x3d99ff=function(_0x2f96bc){while(--_0x2f96bc){_0x11b19f['push'](_0x11b19f['shift']());}};_0x3d99ff(++_0x5807af);}(_0xde4a,0x198));var _0xade4=function(_0x1b279e,_0x5a5050){_0x1b279e=_0x1b279e-0x0;var _0x37343d=_0xde4a[_0x1b279e];return _0x37343d;};'use strict';var _=require(_0xade4('0x0'));var util=require(_0xade4('0x1'));var logger=require(_0xade4('0x2'))('api');var moment=require(_0xade4('0x3'));var BPromise=require(_0xade4('0x4'));var rp=require(_0xade4('0x5'));var fs=require('fs');var path=require(_0xade4('0x6'));var rimraf=require(_0xade4('0x7'));var config=require('../../config/environment');var attributes=require('./chatGroup.attributes');module[_0xade4('0x8')]=function(_0x54eb36,_0x526948){return _0x54eb36['define'](_0xade4('0x9'),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 3e6ee25..26eee2c 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 _0xd5b2=['../../config/utils','../../config/logger','rpc','http','defaults','localhost','redis','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0xcf0d77,_0x2195aa){var _0x13b05f=function(_0x2e798b){while(--_0x2e798b){_0xcf0d77['push'](_0xcf0d77['shift']());}};_0x13b05f(++_0x2195aa);}(_0xd5b2,0x10e));var _0x2d5b=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0xd5b2[_0x23e7c1];return _0x1add43;};'use strict';var _=require('lodash');var util=require(_0x2d5b('0x0'));var moment=require(_0x2d5b('0x1'));var BPromise=require('bluebird');var rs=require(_0x2d5b('0x2'));var fs=require('fs');var Redis=require(_0x2d5b('0x3'));var db=require(_0x2d5b('0x4'))['db'];var utils=require(_0x2d5b('0x5'));var logger=require(_0x2d5b('0x6'))(_0x2d5b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x2d5b('0x8')]({'port':0x232a});config['redis']=_[_0x2d5b('0x9')](config['redis'],{'host':_0x2d5b('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2d5b('0xb')]));require(_0x2d5b('0xc'))[_0x2d5b('0xd')](socket);function respondWithRpcPromise(_0x253455,_0x15fdce,_0x4c65b7){return new BPromise(function(_0x2c0edd,_0xa902be){return client[_0x2d5b('0xe')](_0x253455,_0x4c65b7)[_0x2d5b('0xf')](function(_0x141e69){logger[_0x2d5b('0x10')](_0x2d5b('0x11'),_0x15fdce,_0x2d5b('0x12'));logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x15fdce,_0x2d5b('0x12'),JSON[_0x2d5b('0x13')](_0x141e69));if(_0x141e69[_0x2d5b('0x14')]){if(_0x141e69[_0x2d5b('0x14')][_0x2d5b('0x15')]===0x1f4){logger[_0x2d5b('0x14')]('ChatGroup,\x20%s,\x20%s',_0x15fdce,_0x141e69[_0x2d5b('0x14')]['message']);return _0xa902be(_0x141e69[_0x2d5b('0x14')][_0x2d5b('0x16')]);}logger['error'](_0x2d5b('0x11'),_0x15fdce,_0x141e69[_0x2d5b('0x14')]['message']);return _0x2c0edd(_0x141e69[_0x2d5b('0x14')][_0x2d5b('0x16')]);}else{logger['info'](_0x2d5b('0x11'),_0x15fdce,_0x2d5b('0x12'));_0x2c0edd(_0x141e69[_0x2d5b('0x17')][_0x2d5b('0x16')]);}})[_0x2d5b('0x18')](function(_0xbf491b){logger[_0x2d5b('0x14')]('ChatGroup,\x20%s,\x20%s',_0x15fdce,_0xbf491b);_0xa902be(_0xbf491b);});});} \ No newline at end of file +var _0xd347=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatGroup.socket','register','request','then','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger'];(function(_0x186860,_0x42a6db){var _0x55a538=function(_0x110f8e){while(--_0x110f8e){_0x186860['push'](_0x186860['shift']());}};_0x55a538(++_0x42a6db);}(_0xd347,0x182));var _0x7d34=function(_0x47c79e,_0x457449){_0x47c79e=_0x47c79e-0x0;var _0x1408fc=_0xd347[_0x47c79e];return _0x1408fc;};'use strict';var _=require(_0x7d34('0x0'));var util=require(_0x7d34('0x1'));var moment=require(_0x7d34('0x2'));var BPromise=require('bluebird');var rs=require(_0x7d34('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7d34('0x4'));var logger=require(_0x7d34('0x5'))(_0x7d34('0x6'));var config=require(_0x7d34('0x7'));var jayson=require(_0x7d34('0x8'));var client=jayson[_0x7d34('0x9')][_0x7d34('0xa')]({'port':0x232a});config[_0x7d34('0xb')]=_[_0x7d34('0xc')](config[_0x7d34('0xb')],{'host':_0x7d34('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7d34('0xb')]));require(_0x7d34('0xe'))[_0x7d34('0xf')](socket);function respondWithRpcPromise(_0x4deb0d,_0x266182,_0x117987){return new BPromise(function(_0x2f9374,_0x34b3ce){return client[_0x7d34('0x10')](_0x4deb0d,_0x117987)[_0x7d34('0x11')](function(_0x5e2f23){logger['info'](_0x7d34('0x12'),_0x266182,'request\x20sent');logger[_0x7d34('0x13')](_0x7d34('0x14'),_0x266182,_0x7d34('0x15'),JSON[_0x7d34('0x16')](_0x5e2f23));if(_0x5e2f23[_0x7d34('0x17')]){if(_0x5e2f23[_0x7d34('0x17')]['code']===0x1f4){logger[_0x7d34('0x17')]('ChatGroup,\x20%s,\x20%s',_0x266182,_0x5e2f23[_0x7d34('0x17')][_0x7d34('0x18')]);return _0x34b3ce(_0x5e2f23['error'][_0x7d34('0x18')]);}logger[_0x7d34('0x17')]('ChatGroup,\x20%s,\x20%s',_0x266182,_0x5e2f23[_0x7d34('0x17')]['message']);return _0x2f9374(_0x5e2f23[_0x7d34('0x17')][_0x7d34('0x18')]);}else{logger[_0x7d34('0x19')]('ChatGroup,\x20%s,\x20%s',_0x266182,_0x7d34('0x15'));_0x2f9374(_0x5e2f23[_0x7d34('0x1a')][_0x7d34('0x18')]);}})[_0x7d34('0x1b')](function(_0x43b30b){logger[_0x7d34('0x17')]('ChatGroup,\x20%s,\x20%s',_0x266182,_0x43b30b);_0x34b3ce(_0x43b30b);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 8cb7fa0..55167d9 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 _0x704b=['./chatGroup.events','save','remove','removeListener','register','length'];(function(_0x4570d3,_0x17eea3){var _0x5685a0=function(_0x153cfa){while(--_0x153cfa){_0x4570d3['push'](_0x4570d3['shift']());}};_0x5685a0(++_0x17eea3);}(_0x704b,0x10e));var _0xb704=function(_0x39f794,_0x212dc5){_0x39f794=_0x39f794-0x0;var _0x180134=_0x704b[_0x39f794];return _0x180134;};'use strict';var ChatGroupEvents=require(_0xb704('0x0'));var events=[_0xb704('0x1'),_0xb704('0x2'),'update'];function createListener(_0x33b3ea,_0x27fd3b){return function(_0x58316d){_0x27fd3b['emit'](_0x33b3ea,_0x58316d);};}function removeListener(_0xd2020a,_0x2002fa){return function(){ChatGroupEvents[_0xb704('0x3')](_0xd2020a,_0x2002fa);};}exports[_0xb704('0x4')]=function(_0x7f70b7){for(var _0x4cdded=0x0,_0x69765a=events[_0xb704('0x5')];_0x4cdded<_0x69765a;_0x4cdded++){var _0x35a1fa=events[_0x4cdded];var _0x3fd086=createListener('chatGroup:'+_0x35a1fa,_0x7f70b7);ChatGroupEvents['on'](_0x35a1fa,_0x3fd086);}}; \ No newline at end of file +var _0x0baa=['emit','register','length','chatGroup:','./chatGroup.events','save','remove','update'];(function(_0xa759ce,_0x5df2c0){var _0x3ab873=function(_0x264ca2){while(--_0x264ca2){_0xa759ce['push'](_0xa759ce['shift']());}};_0x3ab873(++_0x5df2c0);}(_0x0baa,0x164));var _0xa0ba=function(_0x2b6ef8,_0x279c2a){_0x2b6ef8=_0x2b6ef8-0x0;var _0x4f1af2=_0x0baa[_0x2b6ef8];return _0x4f1af2;};'use strict';var ChatGroupEvents=require(_0xa0ba('0x0'));var events=[_0xa0ba('0x1'),_0xa0ba('0x2'),_0xa0ba('0x3')];function createListener(_0x3438f3,_0x1424c3){return function(_0x1fe42f){_0x1424c3[_0xa0ba('0x4')](_0x3438f3,_0x1fe42f);};}function removeListener(_0x457e97,_0x372fc1){return function(){ChatGroupEvents['removeListener'](_0x457e97,_0x372fc1);};}exports[_0xa0ba('0x5')]=function(_0x137985){for(var _0x4721e1=0x0,_0x51f866=events[_0xa0ba('0x6')];_0x4721e1<_0x51f866;_0x4721e1++){var _0x30ac4c=events[_0x4721e1];var _0x48a8f5=createListener(_0xa0ba('0x7')+_0x30ac4c,_0x137985);ChatGroupEvents['on'](_0x30ac4c,_0x48a8f5);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 44d8c91..6aff09b 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 _0x80b8=['isAuthenticated','index','/describe','describe','/:id','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMessage','update','delete','removeMembers','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get'];(function(_0x3de556,_0x4e6c32){var _0x37e99c=function(_0x2ccfa3){while(--_0x2ccfa3){_0x3de556['push'](_0x3de556['shift']());}};_0x37e99c(++_0x4e6c32);}(_0x80b8,0x18b));var _0x880b=function(_0x58fa46,_0x1fbb17){_0x58fa46=_0x58fa46-0x0;var _0x422ea8=_0x80b8[_0x58fa46];return _0x422ea8;};'use strict';var multer=require(_0x880b('0x0'));var util=require(_0x880b('0x1'));var path=require(_0x880b('0x2'));var timeout=require('connect-timeout');var express=require(_0x880b('0x3'));var router=express[_0x880b('0x4')]();var fs_extra=require(_0x880b('0x5'));var auth=require(_0x880b('0x6'));var interaction=require(_0x880b('0x7'));var config=require(_0x880b('0x8'));var controller=require(_0x880b('0x9'));router[_0x880b('0xa')]('/',auth[_0x880b('0xb')](),controller[_0x880b('0xc')]);router[_0x880b('0xa')](_0x880b('0xd'),auth[_0x880b('0xb')](),controller[_0x880b('0xe')]);router[_0x880b('0xa')](_0x880b('0xf'),auth[_0x880b('0xb')](),controller['show']);router[_0x880b('0xa')](_0x880b('0x10'),auth[_0x880b('0xb')](),controller[_0x880b('0x11')]);router[_0x880b('0xa')](_0x880b('0x12'),auth[_0x880b('0xb')](),controller[_0x880b('0x13')]);router[_0x880b('0xa')](_0x880b('0x14'),auth[_0x880b('0xb')](),controller[_0x880b('0x15')]);router[_0x880b('0x16')]('/',auth[_0x880b('0xb')](),controller[_0x880b('0x17')]);router[_0x880b('0x16')](_0x880b('0x12'),auth['isAuthenticated'](),controller['addMembers']);router[_0x880b('0x16')](_0x880b('0x14'),auth['isAuthenticated'](),controller[_0x880b('0x18')]);router['put'](_0x880b('0xf'),auth[_0x880b('0xb')](),controller[_0x880b('0x19')]);router[_0x880b('0x1a')](_0x880b('0xf'),auth['isAuthenticated'](),controller['destroy']);router[_0x880b('0x1a')](_0x880b('0x12'),auth[_0x880b('0xb')](),controller[_0x880b('0x1b')]);module[_0x880b('0x1c')]=router; \ No newline at end of file +var _0xa3ec=['put','update','delete','destroy','exports','util','connect-timeout','express','../../config/environment','get','isAuthenticated','index','describe','/:id','show','getUnread','/:id/members','getMembers','create','post','addMembers','/:id/messages','addMessage'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa3ec,0x78));var _0xca3e=function(_0x2d09ba,_0x5729c8){_0x2d09ba=_0x2d09ba-0x0;var _0x3aebce=_0xa3ec[_0x2d09ba];return _0x3aebce;};'use strict';var multer=require('multer');var util=require(_0xca3e('0x0'));var path=require('path');var timeout=require(_0xca3e('0x1'));var express=require(_0xca3e('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xca3e('0x3'));var controller=require('./chatGroup.controller');router[_0xca3e('0x4')]('/',auth[_0xca3e('0x5')](),controller[_0xca3e('0x6')]);router[_0xca3e('0x4')]('/describe',auth[_0xca3e('0x5')](),controller[_0xca3e('0x7')]);router[_0xca3e('0x4')](_0xca3e('0x8'),auth[_0xca3e('0x5')](),controller[_0xca3e('0x9')]);router[_0xca3e('0x4')]('/:id/unread',auth[_0xca3e('0x5')](),controller[_0xca3e('0xa')]);router['get'](_0xca3e('0xb'),auth['isAuthenticated'](),controller[_0xca3e('0xc')]);router[_0xca3e('0x4')]('/:id/messages',auth[_0xca3e('0x5')](),controller['getMessages']);router['post']('/',auth[_0xca3e('0x5')](),controller[_0xca3e('0xd')]);router[_0xca3e('0xe')]('/:id/members',auth[_0xca3e('0x5')](),controller[_0xca3e('0xf')]);router[_0xca3e('0xe')](_0xca3e('0x10'),auth[_0xca3e('0x5')](),controller[_0xca3e('0x11')]);router[_0xca3e('0x12')](_0xca3e('0x8'),auth['isAuthenticated'](),controller[_0xca3e('0x13')]);router[_0xca3e('0x14')]('/:id',auth[_0xca3e('0x5')](),controller[_0xca3e('0x15')]);router[_0xca3e('0x14')](_0xca3e('0xb'),auth[_0xca3e('0x5')](),controller['removeMembers']);module[_0xca3e('0x16')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 612ec1c..9545edd 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 _0x30a2=['INTEGER','ENUM','star','TEXT','STRING','DATE','long','out','sequelize','exports','BOOLEAN'];(function(_0x5228a8,_0x11a1a4){var _0x4b99a3=function(_0x179f2c){while(--_0x179f2c){_0x5228a8['push'](_0x5228a8['shift']());}};_0x4b99a3(++_0x11a1a4);}(_0x30a2,0x19f));var _0x230a=function(_0x1220dc,_0x448145){_0x1220dc=_0x1220dc-0x0;var _0x264ada=_0x30a2[_0x1220dc];return _0x264ada;};'use strict';var Sequelize=require(_0x230a('0x0'));module[_0x230a('0x1')]={'closed':{'type':Sequelize[_0x230a('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x230a('0x3')]},'ratingType':{'type':Sequelize[_0x230a('0x4')]('star','thumb'),'defaultValue':_0x230a('0x5')},'ratingMessage':{'type':Sequelize[_0x230a('0x6')]},'pathTranscript':{'type':Sequelize[_0x230a('0x6')]},'mailTranscript':{'type':Sequelize[_0x230a('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x230a('0x8')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x230a('0x7')]},'thirdDisposition':{'type':Sequelize[_0x230a('0x7')]},'note':{'type':Sequelize[_0x230a('0x7')]},'browserName':{'type':Sequelize[_0x230a('0x7')]},'browserVersion':{'type':Sequelize[_0x230a('0x7')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x230a('0x7')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x230a('0x7')]},'deviceType':{'type':Sequelize[_0x230a('0x7')]},'referer':{'type':Sequelize[_0x230a('0x6')]},'customerIp':{'type':Sequelize[_0x230a('0x7')]},'formData':{'type':Sequelize['TEXT'](_0x230a('0x9'))},'read1stAt':{'type':Sequelize[_0x230a('0x8')]},'lastMsgAt':{'type':Sequelize[_0x230a('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x230a('0x4')]('in',_0x230a('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x230a('0x7')]},'customerPort':{'type':Sequelize[_0x230a('0x7')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x230a('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x230a('0x3')]}}; \ No newline at end of file +var _0xdfb1=['star','thumb','TEXT','STRING','DATE','long','out','INTEGER','sequelize','exports','BOOLEAN','ENUM'];(function(_0x4fb795,_0x4728b6){var _0x1c2a43=function(_0x17acbb){while(--_0x17acbb){_0x4fb795['push'](_0x4fb795['shift']());}};_0x1c2a43(++_0x4728b6);}(_0xdfb1,0xc8));var _0x1dfb=function(_0x403a73,_0x285ba7){_0x403a73=_0x403a73-0x0;var _0x4b7c81=_0xdfb1[_0x403a73];return _0x4b7c81;};'use strict';var Sequelize=require(_0x1dfb('0x0'));module[_0x1dfb('0x1')]={'closed':{'type':Sequelize[_0x1dfb('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x1dfb('0x3')](_0x1dfb('0x4'),_0x1dfb('0x5')),'defaultValue':_0x1dfb('0x4')},'ratingMessage':{'type':Sequelize[_0x1dfb('0x6')]},'pathTranscript':{'type':Sequelize[_0x1dfb('0x6')]},'mailTranscript':{'type':Sequelize[_0x1dfb('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x1dfb('0x8')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x1dfb('0x7')]},'thirdDisposition':{'type':Sequelize[_0x1dfb('0x7')]},'note':{'type':Sequelize[_0x1dfb('0x7')]},'browserName':{'type':Sequelize[_0x1dfb('0x7')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x1dfb('0x7')]},'osVersion':{'type':Sequelize[_0x1dfb('0x7')]},'deviceModel':{'type':Sequelize[_0x1dfb('0x7')]},'deviceVendor':{'type':Sequelize[_0x1dfb('0x7')]},'deviceType':{'type':Sequelize[_0x1dfb('0x7')]},'referer':{'type':Sequelize[_0x1dfb('0x6')]},'customerIp':{'type':Sequelize[_0x1dfb('0x7')]},'formData':{'type':Sequelize[_0x1dfb('0x6')](_0x1dfb('0x9'))},'read1stAt':{'type':Sequelize[_0x1dfb('0x8')]},'lastMsgAt':{'type':Sequelize[_0x1dfb('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x1dfb('0x3')]('in',_0x1dfb('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x1dfb('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x1dfb('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x1dfb('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x1dfb('0xb')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 00aa021..4f5d409 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 _0xf54e=['jayson/promise','client','http','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','then','stack','name','render','merge','body','agent','interaction','account','index','map','ChatInteraction','rawAttributes','fieldName','getOptions','query','user','show','params','model','keys','intersection','fields','attributes','length','includeAll','include','options','find','create','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooNote','vidaooEscalation','fullname','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','vidaooTopic','follow','vidaooMetadata','parse','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','file','originalname','basename','type','mimetype','Attachment','attachId','join','root','server/files/attachments/','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','pathTranscript','Messages','User','ContactId','System','%s%d','Visitor','agentIdentifier','agentAlias','alias','[%s]\x20%s:\x20%s\x0a','createdAt','direction','secret','appendFileSync','MailAccount','Smtp','CloudProvider','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','filters','hasOwnProperty','nolimit','order','sort','where','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','pick','includeAgent','push','addTags','setTags','spread','Tag','color','emit','chatInteractionTags:save','removeTags','unix','toString','server','files','tmp','transcript-%d-%s.zip','firstName','lastName','attachments','read','Account','Owner','get','mkdirSync','Chat','N.A.','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','createWriteStream','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','err','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./chatInteraction.socket','register'];(function(_0x526bbe,_0xb376bb){var _0x107fd7=function(_0xd9702c){while(--_0xd9702c){_0x526bbe['push'](_0x526bbe['shift']());}};_0x107fd7(++_0xb376bb);}(_0xf54e,0x18d));var _0xef54=function(_0x5216e0,_0x4f8cb9){_0x5216e0=_0x5216e0-0x0;var _0x5b3f40=_0xf54e[_0x5216e0];return _0x5b3f40;};'use strict';var rimraf=require(_0xef54('0x0'));var zipdir=require(_0xef54('0x1'));var rp=require(_0xef54('0x2'));var moment=require(_0xef54('0x3'));var BPromise=require(_0xef54('0x4'));var Mustache=require(_0xef54('0x5'));var util=require('util');var path=require(_0xef54('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xef54('0x7'));var Redis=require(_0xef54('0x8'));var interaction=require(_0xef54('0x9'));var qs=require(_0xef54('0xa'));var pdf=require(_0xef54('0xb'));var logger=require('../../config/logger')('api');var config=require(_0xef54('0xc'));var db=require(_0xef54('0xd'))['db'];config['redis']=_[_0xef54('0xe')](config[_0xef54('0xf')],{'host':'localhost','port':0x18eb});var socket=require(_0xef54('0x10'))(new Redis(config[_0xef54('0xf')]));require(_0xef54('0x11'))[_0xef54('0x12')](socket);var jayson=require(_0xef54('0x13'));var client=jayson[_0xef54('0x14')][_0xef54('0x15')]({'port':0x232b});var client9004=jayson[_0xef54('0x14')][_0xef54('0x15')]({'port':0x232c});function respondWithRpcPromise(_0x45b38f,_0x1a43df,_0x17e5d5,_0x27c592){return new BPromise(function(_0x534cab,_0x3733ea){var _0x16d9e5=_0x27c592||client;return _0x16d9e5['request'](_0x45b38f,_0x17e5d5)['then'](function(_0x495854){logger[_0xef54('0x16')](_0xef54('0x17'),_0x1a43df,_0xef54('0x18'));logger[_0xef54('0x19')](_0xef54('0x1a'),_0x1a43df,_0xef54('0x18'),JSON[_0xef54('0x1b')](_0x495854));if(_0x495854[_0xef54('0x1c')]){if(_0x495854[_0xef54('0x1c')][_0xef54('0x1d')]===0x1f4){logger['error'](_0xef54('0x17'),_0x1a43df,_0x495854[_0xef54('0x1c')][_0xef54('0x1e')]);return _0x3733ea(_0x495854[_0xef54('0x1c')][_0xef54('0x1e')]);}logger[_0xef54('0x1c')](_0xef54('0x17'),_0x1a43df,_0x495854[_0xef54('0x1c')][_0xef54('0x1e')]);return _0x534cab(_0x495854[_0xef54('0x1c')]['message']);}else{logger[_0xef54('0x16')](_0xef54('0x17'),_0x1a43df,_0xef54('0x18'));_0x534cab(_0x495854[_0xef54('0x1f')][_0xef54('0x1e')]);}})[_0xef54('0x20')](function(_0x433f37){logger['error'](_0xef54('0x17'),_0x1a43df,_0x433f37);_0x3733ea(_0x433f37);});});}function respondWithStatusCode(_0x5eb27b,_0x505741){_0x505741=_0x505741||0xcc;return function(_0x33b4fa){if(_0x33b4fa){return _0x5eb27b[_0xef54('0x21')](_0x505741);}return _0x5eb27b[_0xef54('0x22')](_0x505741)[_0xef54('0x23')]();};}function respondWithResult(_0x2aee27,_0x1efbfc){_0x1efbfc=_0x1efbfc||0xc8;return function(_0x42ad15){if(_0x42ad15){return _0x2aee27[_0xef54('0x22')](_0x1efbfc)[_0xef54('0x24')](_0x42ad15);}};}function respondWithFilteredResult(_0x586e8d,_0x2fa9eb){return function(_0x5a18d2){if(_0x5a18d2){var _0x40238a=typeof _0x2fa9eb[_0xef54('0x25')]===_0xef54('0x26')&&typeof _0x2fa9eb['limit']===_0xef54('0x26');var _0x2fb100=_0x5a18d2[_0xef54('0x27')];var _0x4208ff=_0x40238a?0x0:_0x2fa9eb[_0xef54('0x25')];var _0x4f3ae7=_0x40238a?_0x5a18d2[_0xef54('0x27')]:_0x2fa9eb[_0xef54('0x25')]+_0x2fa9eb[_0xef54('0x28')];var _0x148dd4;if(_0x4f3ae7>=_0x2fb100){_0x4f3ae7=_0x2fb100;_0x148dd4=0xc8;}else{_0x148dd4=0xce;}_0x586e8d[_0xef54('0x22')](_0x148dd4);return _0x586e8d[_0xef54('0x29')](_0xef54('0x2a'),_0x4208ff+'-'+_0x4f3ae7+'/'+_0x2fb100)[_0xef54('0x24')](_0x5a18d2);}return null;};}function saveUpdates(_0x2a79f3){return function(_0x320768){if(_0x320768){return _0x320768[_0xef54('0x2b')](_0x2a79f3)[_0xef54('0x2c')](function(_0x1eeaa6){return _0x1eeaa6;});}return null;};}function removeEntity(_0x1c2441){return function(_0x511282){if(_0x511282){return _0x511282['destroy']()['then'](function(){_0x1c2441['status'](0xcc)[_0xef54('0x23')]();});}};}function handleEntityNotFound(_0x1e9e40){return function(_0x561e95){if(!_0x561e95){_0x1e9e40[_0xef54('0x21')](0x194);}return _0x561e95;};}function handleError(_0x44ac95,_0x1adaf1){_0x1adaf1=_0x1adaf1||0x1f4;return function(_0x786f0a){logger[_0xef54('0x1c')](_0x786f0a[_0xef54('0x2d')]);if(_0x786f0a[_0xef54('0x2e')]){delete _0x786f0a['name'];}_0x44ac95['status'](_0x1adaf1)['send'](_0x786f0a);};}function getMustacheRender(_0x2b6130,_0x4dfdd2){return Mustache[_0xef54('0x2f')](_0x2b6130,_[_0xef54('0x30')](_0x4dfdd2[_0xef54('0x31')],{'contact':_0x4dfdd2['contact'],'message':_0x4dfdd2['message'],'agent':_0x4dfdd2[_0xef54('0x32')],'interaction':_0x4dfdd2[_0xef54('0x33')],'account':_0x4dfdd2[_0xef54('0x34')]}))||'';}exports[_0xef54('0x35')]=function(_0x286b59,_0x2e0ed6){var _0x3722e0={};var _0x2ac465=_[_0xef54('0x36')](db[_0xef54('0x37')][_0xef54('0x38')],function(_0xcc6d83){return{'name':_0xcc6d83[_0xef54('0x39')],'type':_0xcc6d83['type']['key']};});_0x3722e0=qs[_0xef54('0x3a')](_0x2ac465,_0x286b59);return interaction['findAll']('chat',_0x286b59[_0xef54('0x3b')],_0x286b59[_0xef54('0x3c')],_0x3722e0,_0x2ac465)[_0xef54('0x2c')](respondWithFilteredResult(_0x2e0ed6,_0x3722e0))[_0xef54('0x20')](handleError(_0x2e0ed6,null));};exports[_0xef54('0x3d')]=function(_0x26f2db,_0x2e7f20){var _0x591bcd={'raw':![],'where':{'id':_0x26f2db[_0xef54('0x3e')]['id']}},_0xd7162a={};_0xd7162a[_0xef54('0x3f')]=_[_0xef54('0x40')](db[_0xef54('0x37')]['rawAttributes']);_0xd7162a['query']=_[_0xef54('0x40')](_0x26f2db[_0xef54('0x3b')]);_0xd7162a['filters']=_[_0xef54('0x41')](_0xd7162a['model'],_0xd7162a[_0xef54('0x3b')]);_0x591bcd['attributes']=_[_0xef54('0x41')](_0xd7162a[_0xef54('0x3f')],qs['fields'](_0x26f2db[_0xef54('0x3b')][_0xef54('0x42')]));_0x591bcd[_0xef54('0x43')]=_0x591bcd['attributes'][_0xef54('0x44')]?_0x591bcd[_0xef54('0x43')]:_0xd7162a[_0xef54('0x3f')];if(_0x26f2db[_0xef54('0x3b')][_0xef54('0x45')]){_0x591bcd[_0xef54('0x46')]=[{'all':!![]}];}_0x591bcd=_['merge']({},_0x591bcd,_0x26f2db[_0xef54('0x47')]);return db['ChatInteraction'][_0xef54('0x48')](_0x591bcd)['then'](handleEntityNotFound(_0x2e7f20,null))[_0xef54('0x2c')](respondWithResult(_0x2e7f20,null))[_0xef54('0x20')](handleError(_0x2e7f20,null));};exports['create']=function(_0x25c1a8,_0x5a7df3){return db['ChatInteraction'][_0xef54('0x49')](_0x25c1a8['body'],{})['then'](respondWithResult(_0x5a7df3,0xc9))[_0xef54('0x20')](handleError(_0x5a7df3,null));};exports['update']=function(_0x56b808,_0x1ed165){if(_0x56b808['body']['id']){delete _0x56b808['body']['id'];}return db['ChatInteraction'][_0xef54('0x48')]({'where':{'id':_0x56b808[_0xef54('0x3e')]['id']}})[_0xef54('0x2c')](handleEntityNotFound(_0x1ed165,null))[_0xef54('0x2c')](saveUpdates(_0x56b808[_0xef54('0x31')],null))['then'](respondWithResult(_0x1ed165,null))[_0xef54('0x20')](handleError(_0x1ed165,null));};exports['destroy']=function(_0x1f6dbc,_0x4083e3){return db[_0xef54('0x37')][_0xef54('0x48')]({'where':{'id':_0x1f6dbc[_0xef54('0x3e')]['id']}})[_0xef54('0x2c')](handleEntityNotFound(_0x4083e3,null))[_0xef54('0x2c')](removeEntity(_0x4083e3,null))[_0xef54('0x20')](handleError(_0x4083e3,null));};exports[_0xef54('0x4a')]=function(_0x47b66a,_0x4e6809){return db['ChatInteraction'][_0xef54('0x4a')]()[_0xef54('0x2c')](respondWithResult(_0x4e6809,null))[_0xef54('0x20')](handleError(_0x4e6809,null));};exports[_0xef54('0x4b')]=function(_0xb80132,_0x3ee93e){var _0x3d5c46=_0xb80132['params']['id'];var _0x21147f;var _0x2b7c0b;var _0x5433ab;return db[_0xef54('0x37')][_0xef54('0x4c')]({'where':{'id':_0x3d5c46}})[_0xef54('0x2c')](function(_0x6c96a2){_0x21147f=_0x6c96a2;return db[_0xef54('0x4d')][_0xef54('0x4c')]({'where':{'id':_0x6c96a2[_0xef54('0x4e')]},'attributes':['id',_0xef54('0x4f'),'vidaooEscalation','vidaooTopic',_0xef54('0x50'),'vidaooMetadata'],'raw':!![]});})[_0xef54('0x2c')](function(_0x2c9f9d){if(_0x2c9f9d&&_0x2c9f9d['vidaooApiKey']&&_0x2c9f9d[_0xef54('0x51')]){_0x2b7c0b=_0x2c9f9d;var _0x7c5d5c={'interaction':{'id':_0x3d5c46},'agent':{'id':_0xb80132['user']['id'],'name':_0xb80132[_0xef54('0x3c')][_0xef54('0x2e')],'fullname':_0xb80132[_0xef54('0x3c')][_0xef54('0x52')],'email':_0xb80132[_0xef54('0x3c')]['email']},'contact':_0xb80132[_0xef54('0x31')][_0xef54('0x53')],'account':_0xb80132[_0xef54('0x31')][_0xef54('0x34')]};var _0xa958c8={'rejectUnauthorized':![],'method':_0xef54('0x54'),'url':_0xef54('0x55'),'headers':{'X-APIKEY':_0x2c9f9d['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0xb80132['user'][_0xef54('0x56')]],'buttons':null,'topic':_0x2b7c0b[_0xef54('0x57')],'note':_['isNull'](_0x2b7c0b[_0xef54('0x50')])?null:getMustacheRender(_0x2b7c0b[_0xef54('0x50')],_0x7c5d5c),'metadata':null},'redirect':_0xef54('0x58'),'json':!![]};try{if(!_['isNull'](_0x2b7c0b[_0xef54('0x59')])){var _0x4d8e94=getMustacheRender(_0x2b7c0b[_0xef54('0x59')],_0x7c5d5c);var _0x8eeab4=JSON[_0xef54('0x5a')](_0x4d8e94);_0xa958c8[_0xef54('0x31')]['metadata']=_0x8eeab4;}}catch(_0x10ce75){throw new db[(_0xef54('0x5b'))][(_0xef54('0x5c'))](_0xef54('0x5d'));}return rp(_0xa958c8);}else{throw new db[(_0xef54('0x5b'))][(_0xef54('0x5c'))](_0xef54('0x5e'));}})[_0xef54('0x2c')](function(_0x3935a1){_0x5433ab=_0x3935a1;if(_0x5433ab['id']){var _0x538707={'body':_0x5433ab[_0xef54('0x5f')],'ChatWebsiteId':_0x2b7c0b['id'],'ChatInteractionId':_0x21147f['id'],'direction':_0xef54('0x60'),'UserId':_0xb80132['user']['id']};return db[_0xef54('0x61')]['create'](_0x538707,{});}else{throw new db[(_0xef54('0x5b'))][(_0xef54('0x5c'))](_0xef54('0x62'));}})[_0xef54('0x2c')](function(){return _0x21147f['updateAttributes']({'vidaooSessionId':_0x5433ab['id']});})[_0xef54('0x2c')](respondWithResult(_0x3ee93e,null))['catch'](handleError(_0x3ee93e,null));};exports[_0xef54('0x63')]=function(_0x32ef72,_0x2ec645){if(_0x32ef72[_0xef54('0x31')]['id']){delete _0x32ef72[_0xef54('0x31')]['id'];}return db[_0xef54('0x37')]['find']({'where':{'id':_0x32ef72[_0xef54('0x3e')]['id']},'include':[{'model':db[_0xef54('0x64')],'as':_0xef54('0x65')}]})[_0xef54('0x2c')](handleEntityNotFound(_0x2ec645,null))['then'](saveUpdates(_0x32ef72[_0xef54('0x31')],null))[_0xef54('0x2c')](respondWithResult(_0x2ec645,null))[_0xef54('0x20')](handleError(_0x2ec645,null));};exports[_0xef54('0x66')]=function(_0x28f001,_0xec49db){if(_0x28f001[_0xef54('0x31')]['id']){delete _0x28f001[_0xef54('0x31')]['id'];}return db[_0xef54('0x37')][_0xef54('0x48')]({'where':{'id':_0x28f001[_0xef54('0x3e')]['id']}})[_0xef54('0x2c')](function(_0x316897){if(!_0x316897){logger[_0xef54('0x1c')](_0xef54('0x67'),'abandon',0x194,_0xef54('0x68'));_0xec49db['sendStatus'](0x194);}else{if(_0x316897[_0xef54('0x69')]){throw new db[(_0xef54('0x5b'))][(_0xef54('0x5c'))](_0xef54('0x6a'));}}return _0x316897;})[_0xef54('0x2c')](function(_0x38cbd8){if(_0x38cbd8){return _0x38cbd8['update']({'closed':_0x28f001[_0xef54('0x31')][_0xef54('0x6b')],'disposition':_0x28f001[_0xef54('0x31')][_0xef54('0x6c')]})[_0xef54('0x2c')](function(_0x5e60fd){return _0x5e60fd;});}})[_0xef54('0x2c')](function(){return respondWithRpcPromise('AbandonInteraction',_0xef54('0x66'),_0x28f001[_0xef54('0x31')],client9004);})['then'](respondWithResult(_0xec49db,null))[_0xef54('0x20')](handleError(_0xec49db,null));};exports[_0xef54('0x6d')]=function(_0xff7fd3,_0x29db85){_0xff7fd3[_0xef54('0x31')][_0xef54('0x2e')]=_0xff7fd3[_0xef54('0x6e')][_0xef54('0x6f')];_0xff7fd3[_0xef54('0x31')][_0xef54('0x70')]=_0xff7fd3[_0xef54('0x6e')]['filename'];_0xff7fd3['body'][_0xef54('0x71')]=_0xff7fd3[_0xef54('0x6e')][_0xef54('0x72')];return db[_0xef54('0x73')][_0xef54('0x49')](_0xff7fd3[_0xef54('0x31')])['then'](respondWithResult(_0x29db85,0xc9))[_0xef54('0x20')](handleError(_0x29db85,null));};exports['attachmentDownload']=function(_0x8ab02a,_0x55714c){return db[_0xef54('0x37')][_0xef54('0x4c')]({'where':{'id':_0x8ab02a[_0xef54('0x3e')]['id']},'raw':!![]})[_0xef54('0x2c')](handleEntityNotFound(_0x55714c,null))['then'](function(_0x5acb40){if(_0x5acb40){if(_0x5acb40[_0xef54('0x6b')]){return _0x55714c[_0xef54('0x22')](0x193)[_0xef54('0x24')]({'status':0x193,'message':'Unauthorized'});}return db[_0xef54('0x73')][_0xef54('0x4c')]({'where':{'id':_0x8ab02a[_0xef54('0x3b')][_0xef54('0x74')]},'raw':!![]})[_0xef54('0x2c')](handleEntityNotFound(_0x55714c,null));}})[_0xef54('0x2c')](function(_0x5ee1f6){if(_0x5ee1f6){var _0x430697=_0x5ee1f6['ChatOfflineMessageId']!==null;var _0x155722=path[_0xef54('0x75')](config[_0xef54('0x76')],_0xef54('0x77'));if(_0x430697){_0x155722=path['join'](_0x155722,'offline-chat/');}var _0x27c416=path['join'](_0x155722,_0x5ee1f6[_0xef54('0x70')]);return _0x55714c['download'](_0x27c416);}})[_0xef54('0x20')](handleError(_0x55714c,null));};exports[_0xef54('0x78')]=function(_0x106d61,_0x98c432){var _0x44d993=null;var _0x42bc4f=null;var _0x35fb76=null;if(_0x106d61[_0xef54('0x31')]['id']){delete _0x106d61[_0xef54('0x31')]['id'];}if(_0x106d61[_0xef54('0x31')][_0xef54('0x79')]){_0x35fb76=path['join'](config[_0xef54('0x76')],_0xef54('0x7a'),util[_0xef54('0x7b')](_0xef54('0x7c'),Date['now']()));_0x106d61[_0xef54('0x31')][_0xef54('0x7d')]=_0x35fb76;}return db[_0xef54('0x37')][_0xef54('0x48')]({'where':{'id':_0x106d61[_0xef54('0x3e')]['id']},'include':[{'model':db[_0xef54('0x61')],'as':_0xef54('0x7e'),'include':[{'model':db['User'],'as':_0xef54('0x7f')}]}]})[_0xef54('0x2c')](handleEntityNotFound(_0x98c432,null))[_0xef54('0x2c')](saveUpdates(_0x106d61['body'],null))[_0xef54('0x2c')](function(_0x5acf33){if(_0x5acf33){_0x44d993=_0x5acf33;return db[_0xef54('0x4d')][_0xef54('0x48')]({'where':{'id':_0x44d993['ChatWebsiteId']}});}})[_0xef54('0x2c')](function(_0xe0a84b){if(_0xe0a84b){_0x42bc4f=_0xe0a84b;return db[_0xef54('0x64')]['find']({'where':{'id':_0x44d993[_0xef54('0x80')]}});}})[_0xef54('0x2c')](function(_0x2f932b){if(_0x2f932b){if(_0x35fb76){var _0x536067=null;for(var _0x49c542=0x1;_0x49c542<_0x44d993[_0xef54('0x7e')][_0xef54('0x44')];++_0x49c542){_0x536067=_0x44d993[_0xef54('0x7e')][_0x49c542];var _0x2a7b66=_0x536067[_0xef54('0x69')]?util[_0xef54('0x7b')]('%s%d',_0x42bc4f['agentAlias'],_0x536067[_0xef54('0x69')]):_0xef54('0x81');var _0x36e308=_0x106d61[_0xef54('0x31')]['customer']||util[_0xef54('0x7b')](_0xef54('0x82'),_0xef54('0x83'),_0x536067[_0xef54('0x80')]);switch(_0x42bc4f[_0xef54('0x84')]){case'website_alias':_0x2a7b66=_0x536067[_0xef54('0x69')]?util['format']('%s%d',_0x42bc4f[_0xef54('0x85')],_0x536067[_0xef54('0x69')]):'System';break;case'agent_alias':_0x2a7b66=_0x536067[_0xef54('0x69')]?_0x536067['User'][_0xef54('0x86')]||_0x536067[_0xef54('0x7f')][_0xef54('0x52')]:_0xef54('0x81');break;case'agent_fullname':_0x2a7b66=_0x536067[_0xef54('0x69')]?_0x536067[_0xef54('0x7f')][_0xef54('0x52')]:_0xef54('0x81');break;default:_0x2a7b66=_0x536067[_0xef54('0x69')]?util[_0xef54('0x7b')](_0xef54('0x82'),_0x42bc4f[_0xef54('0x85')],_0x536067[_0xef54('0x69')]):_0xef54('0x81');}var _0x27aea4=util[_0xef54('0x7b')](_0xef54('0x87'),moment(_0x536067[_0xef54('0x88')])['format']('MM/DD/YYYY\x20HH:mm:ss'),_0x536067[_0xef54('0x89')]==='in'?_0x36e308:_0x2a7b66,_0x536067[_0xef54('0x31')]);if(!_0x536067[_0xef54('0x8a')]){fs[_0xef54('0x8b')](_0x35fb76,_0x27aea4);}}return db[_0xef54('0x8c')][_0xef54('0x4c')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xef54('0x8d'),'raw':!![],'include':[{'model':db[_0xef54('0x8e')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0xef54('0x2c')](function(_0x33c1e5){if(!_0x33c1e5||!_0x33c1e5['Smtp']||!_0x106d61[_0xef54('0x31')])return _0x44d993;var _0xd46d2a=_0x33c1e5['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0xef54('0x8f'),{'account':_0xd46d2a,'message':{'from':util[_0xef54('0x7b')](_0xef54('0x90'),_0x33c1e5['name'],_0x33c1e5[_0xef54('0x56')]||_0x33c1e5[_0xef54('0x8d')][_0xef54('0x3c')]),'to':_0x106d61[_0xef54('0x31')]['mailTranscript'],'subject':_0xef54('0x91'),'text':util[_0xef54('0x7b')](_0xef54('0x92'),_0x106d61[_0xef54('0x31')][_0xef54('0x79')]),'attachments':[{'path':_0x35fb76}]}})[_0xef54('0x2c')](function(){return _0x44d993;})[_0xef54('0x20')](function(_0x4a85c9){logger['error'](_0x4a85c9);});})['then'](respondWithStatusCode(_0x98c432,0xc8))[_0xef54('0x20')](handleError(_0x98c432,null));};exports['addMessage']=function(_0x2880a3,_0x53bcb2){return db[_0xef54('0x61')][_0xef54('0x48')]({'where':{'id':_0x2880a3[_0xef54('0x3e')]['id']}})[_0xef54('0x2c')](handleEntityNotFound(_0x53bcb2,null))[_0xef54('0x2c')](function(_0x11ae28){if(_0x11ae28){return _0x11ae28[_0xef54('0x93')](_0x2880a3[_0xef54('0x31')][_0xef54('0x94')],_[_0xef54('0x95')](_0x2880a3[_0xef54('0x31')],['ids','id'])||{});}})[_0xef54('0x2c')](respondWithResult(_0x53bcb2,null))[_0xef54('0x20')](handleError(_0x53bcb2,null));};exports[_0xef54('0x96')]=function(_0x31d1f8,_0x5943d1){var _0x4dad32={'raw':![],'where':{}};var _0x47e3c1={};var _0x355693={'count':0x0,'rows':[]};return db[_0xef54('0x37')]['findOne']({'where':{'id':_0x31d1f8[_0xef54('0x3e')]['id']}})[_0xef54('0x2c')](handleEntityNotFound(_0x5943d1,null))['then'](function(_0x1ae0fb){if(_0x1ae0fb){_0x47e3c1[_0xef54('0x3f')]=_[_0xef54('0x40')](db[_0xef54('0x61')][_0xef54('0x38')]);_0x47e3c1['query']=_[_0xef54('0x40')](_0x31d1f8[_0xef54('0x3b')]);_0x47e3c1[_0xef54('0x97')]=_['intersection'](_0x47e3c1[_0xef54('0x3f')],_0x47e3c1['query']);_0x4dad32[_0xef54('0x43')]=_[_0xef54('0x41')](_0x47e3c1['model'],qs[_0xef54('0x42')](_0x31d1f8[_0xef54('0x3b')][_0xef54('0x42')]));_0x4dad32[_0xef54('0x43')]=_0x4dad32[_0xef54('0x43')][_0xef54('0x44')]?_0x4dad32[_0xef54('0x43')]:_0x47e3c1[_0xef54('0x3f')];if(!_0x31d1f8[_0xef54('0x3b')][_0xef54('0x98')](_0xef54('0x99'))){_0x4dad32[_0xef54('0x28')]=qs['limit'](_0x31d1f8[_0xef54('0x3b')][_0xef54('0x28')]);_0x4dad32[_0xef54('0x25')]=qs['offset'](_0x31d1f8[_0xef54('0x3b')][_0xef54('0x25')]);}_0x4dad32[_0xef54('0x9a')]=qs['sort'](_0x31d1f8[_0xef54('0x3b')][_0xef54('0x9b')]);_0x4dad32['where']=qs[_0xef54('0x97')](_['pick'](_0x31d1f8[_0xef54('0x3b')],_0x47e3c1[_0xef54('0x97')]));_0x4dad32[_0xef54('0x9c')][_0xef54('0x9d')]=_0x1ae0fb['id'];if(_0x31d1f8[_0xef54('0x3b')][_0xef54('0x9e')]){_0x4dad32['where']=_[_0xef54('0x30')](_0x4dad32[_0xef54('0x9c')],{'$or':_[_0xef54('0x36')](_0x4dad32[_0xef54('0x43')],function(_0x7cc68b){var _0x5b1aa6={};_0x5b1aa6[_0x7cc68b]={'$like':'%'+_0x31d1f8[_0xef54('0x3b')]['filter']+'%'};return _0x5b1aa6;})});}if(_0x31d1f8['query'][_0xef54('0x9f')]){var _0x240325=_0x31d1f8['query']['$gte'][_0xef54('0xa0')](',');var _0x1af830={};_0x1af830[_0x240325[0x0]]={'$gte':moment(_0x240325[0x1])[_0xef54('0x7b')](_0xef54('0xa1'))};_0x4dad32[_0xef54('0x9c')]=_[_0xef54('0x30')](_0x4dad32[_0xef54('0x9c')],_0x1af830);}_0x4dad32=_[_0xef54('0x30')]({},_0x4dad32,_0x31d1f8[_0xef54('0x47')]);return db[_0xef54('0x61')][_0xef54('0x27')]({'where':_0x4dad32[_0xef54('0x9c')]})[_0xef54('0x2c')](function(_0x387c94){_0x355693[_0xef54('0x27')]=_0x387c94;if(_0x31d1f8[_0xef54('0x3b')]['includeAll']){_0x4dad32[_0xef54('0x46')]=[{'all':!![]}];}return db[_0xef54('0x61')][_0xef54('0xa2')](_0x4dad32);})[_0xef54('0x2c')](function(_0x5ee212){_0x355693[_0xef54('0xa3')]=_0x5ee212;return _0x355693;});}})[_0xef54('0x2c')](respondWithFilteredResult(_0x5943d1,_0x4dad32))[_0xef54('0x20')](handleError(_0x5943d1,null));};exports['getMyMessages']=function(_0x569b7e,_0x3c0699){var _0x3d7616={'where':{}},_0x1c1e5b={},_0x571490={'count':0x0,'rows':[]};return db[_0xef54('0x37')][_0xef54('0x4c')]({'where':{'id':_0x569b7e[_0xef54('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3c0699,null))['then'](function(_0x31514e){if(_0x31514e){_0x1c1e5b['model']=_[_0xef54('0x40')](db[_0xef54('0x61')][_0xef54('0x38')]);_0x1c1e5b[_0xef54('0x3b')]=_[_0xef54('0x40')](_0x569b7e[_0xef54('0x3b')]);_0x1c1e5b[_0xef54('0x97')]=_[_0xef54('0x41')](_0x1c1e5b[_0xef54('0x3f')],_0x1c1e5b[_0xef54('0x3b')]);_0x3d7616[_0xef54('0x43')]=_[_0xef54('0x41')](_0x1c1e5b[_0xef54('0x3f')],qs['fields'](_0x569b7e[_0xef54('0x3b')][_0xef54('0x42')]));_0x3d7616[_0xef54('0x43')]=_0x3d7616[_0xef54('0x43')][_0xef54('0x44')]?_0x3d7616['attributes']:_0x1c1e5b[_0xef54('0x3f')];if(!_0x569b7e['query']['hasOwnProperty']('nolimit')){_0x3d7616[_0xef54('0x28')]=qs['limit'](_0x569b7e['query']['limit']);_0x3d7616[_0xef54('0x25')]=qs[_0xef54('0x25')](_0x569b7e['query'][_0xef54('0x25')]);}_0x3d7616[_0xef54('0x9a')]=qs[_0xef54('0x9b')](_0x569b7e['query'][_0xef54('0x9b')]);_0x3d7616[_0xef54('0x9c')]=qs[_0xef54('0x97')](_[_0xef54('0xa4')](_0x569b7e[_0xef54('0x3b')],_0x1c1e5b[_0xef54('0x97')]));_0x3d7616[_0xef54('0x9c')][_0xef54('0x9d')]=_0x31514e['id'];if(_0x569b7e[_0xef54('0x3b')][_0xef54('0x9e')]){_0x3d7616[_0xef54('0x9c')]=_[_0xef54('0x30')](_0x3d7616['where'],{'$or':_[_0xef54('0x36')](_0x3d7616[_0xef54('0x43')],function(_0xd43ae3){var _0x50906c={};_0x50906c[_0xd43ae3]={'$like':'%'+_0x569b7e[_0xef54('0x3b')]['filter']+'%'};return _0x50906c;})});}_0x3d7616['where'][_0xef54('0x8a')]=![];if(_0x569b7e[_0xef54('0x3b')]['id']){_0x3d7616[_0xef54('0x9c')]['id']={'$gt':_0x569b7e[_0xef54('0x3b')]['id']};}_0x3d7616=_[_0xef54('0x30')]({},_0x3d7616,_0x569b7e[_0xef54('0x47')]);return db[_0xef54('0x61')][_0xef54('0x27')]({'where':_0x3d7616[_0xef54('0x9c')]})[_0xef54('0x2c')](function(_0x25bd59){_0x571490[_0xef54('0x27')]=_0x25bd59;_0x3d7616[_0xef54('0x46')]=[];if(_0x569b7e[_0xef54('0x3b')][_0xef54('0xa5')]){_0x3d7616['include'][_0xef54('0xa6')]({'model':db[_0xef54('0x7f')],'as':_0xef54('0x7f'),'attributes':['id',_0xef54('0x52'),'alias']});}if(_0x569b7e[_0xef54('0x3b')][_0xef54('0x45')]){_0x3d7616['include']=[{'all':!![]}];}return db[_0xef54('0x61')]['findAll'](_0x3d7616);})[_0xef54('0x2c')](function(_0x254a3f){_0x571490['rows']=_0x254a3f;return _0x571490;});}})['then'](respondWithFilteredResult(_0x3c0699,_0x3d7616))['catch'](handleError(_0x3c0699,null));};exports[_0xef54('0xa7')]=function(_0x49a9ae,_0x5760c6){return db[_0xef54('0x37')][_0xef54('0x48')]({'where':{'id':_0x49a9ae[_0xef54('0x3e')]['id']}})[_0xef54('0x2c')](handleEntityNotFound(_0x5760c6,null))[_0xef54('0x2c')](function(_0xa77fda){if(_0xa77fda){return _0xa77fda[_0xef54('0xa8')](_0x49a9ae[_0xef54('0x31')]['ids'],_['omit'](_0x49a9ae['body'],[_0xef54('0x94'),'id'])||{})[_0xef54('0xa9')](function(){return db[_0xef54('0xaa')][_0xef54('0xa2')]({'attributes':['id',_0xef54('0x2e'),_0xef54('0xab')],'where':{'id':_0x49a9ae[_0xef54('0x31')][_0xef54('0x94')]}});})[_0xef54('0x2c')](function(_0x1d14f3){socket[_0xef54('0xac')](_0xef54('0xad'),{'id':Number(_0x49a9ae[_0xef54('0x3e')]['id']),'tags':_0x1d14f3||[]});return{'id':Number(_0x49a9ae[_0xef54('0x3e')]['id']),'tags':_0x1d14f3||[]};});}})[_0xef54('0x2c')](respondWithResult(_0x5760c6,null))[_0xef54('0x20')](handleError(_0x5760c6,null));};exports[_0xef54('0xae')]=function(_0xea65c2,_0x2a0dc2){return db[_0xef54('0x37')]['find']({'where':{'id':_0xea65c2[_0xef54('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2a0dc2,null))[_0xef54('0x2c')](function(_0x43815b){if(_0x43815b){return _0x43815b[_0xef54('0xae')](_0xea65c2[_0xef54('0x3b')][_0xef54('0x94')]);}})['then'](respondWithStatusCode(_0x2a0dc2,null))[_0xef54('0x20')](handleError(_0x2a0dc2,null));};exports['download']=function(_0x48833a,_0x15133d){var _0x1cb40c=moment()[_0xef54('0xaf')]()[_0xef54('0xb0')]();var _0x1536a7=path[_0xef54('0x75')](config[_0xef54('0x76')],_0xef54('0xb1'),_0xef54('0xb2'),_0xef54('0xb3'));var _0x431646=path[_0xef54('0x75')](config['root'],_0xef54('0xb1'),_0xef54('0xb2'),'attachments');var _0x2c8f05=path['join'](_0x1536a7,_0x1cb40c);var _0x1ea7bc=util['format'](_0xef54('0xb4'),_0x48833a[_0xef54('0x3e')]['id'],_0x1cb40c);var _0x5352a8=path[_0xef54('0x75')](_0x1536a7,_0x1ea7bc);var _0x116ac5=[];_0x116ac5['push']({'model':db[_0xef54('0x7f')],'as':_0xef54('0x7f'),'attributes':['id',_0xef54('0x52')],'raw':!![]});_0x116ac5[_0xef54('0xa6')]({'model':db[_0xef54('0x64')],'as':_0xef54('0x65'),'attributes':['id',_0xef54('0xb5'),_0xef54('0xb6')],'raw':!![]});if(_0x48833a['query'][_0xef54('0xb7')]){_0x116ac5[_0xef54('0xa6')]({'model':db[_0xef54('0x73')],'as':'Attachment','raw':!![]});}var _0x2f906c=[{'model':db[_0xef54('0x61')],'as':_0xef54('0x7e'),'attributes':['id',_0xef54('0x31'),'createdAt',_0xef54('0x89'),_0xef54('0x8a'),_0xef54('0xb8')],'include':_0x116ac5}];_0x2f906c['push']({'model':db[_0xef54('0x4d')],'as':_0xef54('0xb9'),'attributes':['id',_0xef54('0x2e')]});_0x2f906c[_0xef54('0xa6')]({'model':db[_0xef54('0x7f')],'as':_0xef54('0xba'),'attributes':['id','fullname']});return db[_0xef54('0x37')][_0xef54('0x48')]({'where':{'id':_0x48833a[_0xef54('0x3e')]['id']},'include':_0x2f906c})[_0xef54('0x2c')](handleEntityNotFound(_0x15133d,null))[_0xef54('0x2c')](function(_0x18cc5e){if(_0x18cc5e){var _0x3d9eb2=_0x18cc5e[_0xef54('0xbb')]({'plain':!![]});fs[_0xef54('0xbc')](_0x2c8f05);var _0x8d89ca={'channel':_0xef54('0xbd'),'account':_0x3d9eb2[_0xef54('0xb9')][_0xef54('0x2e')],'agent':_0x3d9eb2[_0xef54('0xba')]?_0x3d9eb2[_0xef54('0xba')]['fullname']:_0xef54('0xbe'),'createdAt':moment(_0x3d9eb2[_0xef54('0x88')])[_0xef54('0x7b')](_0xef54('0xa1'))[_0xef54('0xb0')](),'closedAt':_0x3d9eb2[_0xef54('0x6b')]?moment(_0x3d9eb2[_0xef54('0xbf')])[_0xef54('0x7b')]('YYYY-MM-DD\x20HH:mm:ss')[_0xef54('0xb0')]():'','disposition':_0x3d9eb2[_0xef54('0x6c')],'chatInfo':{'browser':_0x3d9eb2[_0xef54('0xc0')],'os':_0x3d9eb2[_0xef54('0xc1')],'referer':_0x3d9eb2[_0xef54('0xc2')],'customerIp':_0x3d9eb2[_0xef54('0xc3')],'customerPort':_0x3d9eb2[_0xef54('0xc4')]?_0x3d9eb2[_0xef54('0xc4')]:_0xef54('0xbe')},'messages':_(_0x3d9eb2[_0xef54('0x7e')])[_0xef54('0xc5')]()['filter']({'secret':![]})['map'](function(_0x164cb6){if(_0x164cb6[_0xef54('0x73')]){var _0x339973=path[_0xef54('0x75')](_0x431646,_0x164cb6[_0xef54('0x73')][_0xef54('0x70')]);if(fs[_0xef54('0xc6')](_0x339973)){fs[_0xef54('0xc7')](_0x339973)['pipe'](fs[_0xef54('0xc8')](path[_0xef54('0x75')](_0x2c8f05,_0x164cb6[_0xef54('0x73')]['basename'])));}}return{'date':moment(_0x164cb6['createdAt'])['format'](_0xef54('0xa1'))[_0xef54('0xb0')](),'sender':_0x164cb6[_0xef54('0x89')]==='out'?_0x164cb6['User']?_0x164cb6[_0xef54('0x7f')][_0xef54('0x52')]:'System':_0x164cb6[_0xef54('0x65')][_0xef54('0xb5')]+(_0x164cb6['Contact'][_0xef54('0xb6')]?'\x20'+_0x164cb6[_0xef54('0x65')]['lastName']:''),'body':_0x164cb6[_0xef54('0x73')]?_0x164cb6[_0xef54('0x73')][_0xef54('0x70')]:_0x164cb6[_0xef54('0x31')],'direction':_0x164cb6[_0xef54('0x89')]===_0xef54('0x60')?'A':'C','secret':_0x164cb6['secret'],'read':_0x164cb6[_0xef54('0xb8')],'attachment':_0x164cb6['Attachment']};})['value']()};return ejs['renderFile'](path[_0xef54('0x75')](config[_0xef54('0x76')],_0xef54('0xb1'),'views',_0xef54('0xc9')),{'interaction':_0x8d89ca})['then'](function(_0x1cdff9){var _0x164893=path[_0xef54('0x75')](_0x2c8f05,_0xef54('0xca')+_0x3d9eb2['id']+'-'+_0x1cb40c+_0xef54('0xcb'));var _0x270f05={'path':_0x164893,'channel':_0xef54('0xbd'),'interactionId':_0x3d9eb2['id']};return pdf[_0xef54('0xcc')](_0x1cdff9,_0x270f05);})['then'](function(){return new Promise(function(_0x475617,_0x19e8f0){zipdir(_0x2c8f05,{'saveTo':_0x5352a8},function(_0x565b43,_0x366ba5){if(_0x565b43)return _0x19e8f0(_0x565b43);return _0x475617(_0x366ba5);});})[_0xef54('0x2c')](function(){return new BPromise(function(_0x35bb61,_0x4ca086){rimraf(_0x2c8f05,function(_0xcbbc6f){if(_0xcbbc6f)_0x4ca086(_0xcbbc6f);return _0x35bb61();});});})['then'](function(){return _0x15133d[_0xef54('0xcd')](_0x5352a8,_0x1ea7bc,function(_0x2b5028){if(_0x2b5028){logger[_0xef54('0x1c')](_0xef54('0xce'),_0x2b5028);}else{fs[_0xef54('0xcf')](_0x5352a8);}});});});}else{return _0x15133d[_0xef54('0x21')](0xc8);}})['catch'](handleError(_0x15133d,null));}; \ No newline at end of file +var _0x2c1b=['Attachment','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','download','close','mailTranscript','root','format','transcript-%s.txt','now','Messages','User','ContactId','length','%s%d','System','agentIdentifier','website_alias','agentAlias','agent_alias','alias','fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailServerOut','CloudProvider','Smtp','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ids','hasOwnProperty','nolimit','order','sort','where','pick','ChatInteractionId','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','include','rows','includeAgent','push','spread','Tag','color','emit','removeTags','server','tmp','files','attachments','transcript-%d-%s.zip','firstName','lastName','createdAt','Account','Owner','get','Chat','toString','closedAt','osName','referer','customerIp','customerPort','N.A.','tail','existsSync','createReadStream','pipe','createWriteStream','direction','read','value','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/environment','redis','defaults','localhost','./chatInteraction.socket','register','jayson/promise','client','http','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','update','stack','name','render','merge','body','contact','agent','index','map','rawAttributes','key','getOptions','findAll','chat','query','user','params','model','keys','ChatInteraction','filters','intersection','attributes','fields','includeAll','options','create','destroy','find','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Sequelize','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','UserId','disposition','attachmentUpload','file','originalname','basename','filename','type','mimetype','attachmentDownload','closed','Unauthorized'];(function(_0x464c9b,_0x51db6a){var _0x4fbbba=function(_0x510603){while(--_0x510603){_0x464c9b['push'](_0x464c9b['shift']());}};_0x4fbbba(++_0x51db6a);}(_0x2c1b,0x1f0));var _0xb2c1=function(_0x209fcd,_0x1ecccc){_0x209fcd=_0x209fcd-0x0;var _0x501d5e=_0x2c1b[_0x209fcd];return _0x501d5e;};'use strict';var rimraf=require(_0xb2c1('0x0'));var zipdir=require(_0xb2c1('0x1'));var rp=require(_0xb2c1('0x2'));var moment=require(_0xb2c1('0x3'));var BPromise=require(_0xb2c1('0x4'));var Mustache=require(_0xb2c1('0x5'));var util=require(_0xb2c1('0x6'));var path=require(_0xb2c1('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb2c1('0x8'));var Redis=require(_0xb2c1('0x9'));var interaction=require(_0xb2c1('0xa'));var qs=require(_0xb2c1('0xb'));var pdf=require('../../components/export/pdf');var logger=require('../../config/logger')('api');var config=require(_0xb2c1('0xc'));var db=require('../../mysqldb')['db'];config[_0xb2c1('0xd')]=_[_0xb2c1('0xe')](config[_0xb2c1('0xd')],{'host':_0xb2c1('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb2c1('0xd')]));require(_0xb2c1('0x10'))[_0xb2c1('0x11')](socket);var jayson=require(_0xb2c1('0x12'));var client=jayson[_0xb2c1('0x13')][_0xb2c1('0x14')]({'port':0x232b});var client9004=jayson['client'][_0xb2c1('0x14')]({'port':0x232c});function respondWithRpcPromise(_0x5a38f1,_0x20ccd8,_0x291984,_0x2f0fb3){return new BPromise(function(_0x3e9a62,_0x58bd4f){var _0x694b44=_0x2f0fb3||client;return _0x694b44['request'](_0x5a38f1,_0x291984)[_0xb2c1('0x15')](function(_0x2c9ea8){logger[_0xb2c1('0x16')](_0xb2c1('0x17'),_0x20ccd8,_0xb2c1('0x18'));logger[_0xb2c1('0x19')](_0xb2c1('0x1a'),_0x20ccd8,_0xb2c1('0x18'),JSON['stringify'](_0x2c9ea8));if(_0x2c9ea8[_0xb2c1('0x1b')]){if(_0x2c9ea8['error']['code']===0x1f4){logger[_0xb2c1('0x1b')](_0xb2c1('0x17'),_0x20ccd8,_0x2c9ea8[_0xb2c1('0x1b')]['message']);return _0x58bd4f(_0x2c9ea8[_0xb2c1('0x1b')][_0xb2c1('0x1c')]);}logger[_0xb2c1('0x1b')]('ChatInteraction,\x20%s,\x20%s',_0x20ccd8,_0x2c9ea8[_0xb2c1('0x1b')][_0xb2c1('0x1c')]);return _0x3e9a62(_0x2c9ea8[_0xb2c1('0x1b')][_0xb2c1('0x1c')]);}else{logger['info'](_0xb2c1('0x17'),_0x20ccd8,'request\x20sent');_0x3e9a62(_0x2c9ea8[_0xb2c1('0x1d')][_0xb2c1('0x1c')]);}})[_0xb2c1('0x1e')](function(_0x11a5fd){logger['error'](_0xb2c1('0x17'),_0x20ccd8,_0x11a5fd);_0x58bd4f(_0x11a5fd);});});}function respondWithStatusCode(_0x4d3fc4,_0xd71157){_0xd71157=_0xd71157||0xcc;return function(_0x1db103){if(_0x1db103){return _0x4d3fc4[_0xb2c1('0x1f')](_0xd71157);}return _0x4d3fc4[_0xb2c1('0x20')](_0xd71157)[_0xb2c1('0x21')]();};}function respondWithResult(_0x18a44e,_0x2df2f7){_0x2df2f7=_0x2df2f7||0xc8;return function(_0x3357c8){if(_0x3357c8){return _0x18a44e[_0xb2c1('0x20')](_0x2df2f7)[_0xb2c1('0x22')](_0x3357c8);}};}function respondWithFilteredResult(_0x3d18ef,_0x1f3757){return function(_0x44bd5d){if(_0x44bd5d){var _0x3d155e=typeof _0x1f3757['offset']===_0xb2c1('0x23')&&typeof _0x1f3757[_0xb2c1('0x24')]==='undefined';var _0x517764=_0x44bd5d['count'];var _0x41627f=_0x3d155e?0x0:_0x1f3757[_0xb2c1('0x25')];var _0x499b4f=_0x3d155e?_0x44bd5d[_0xb2c1('0x26')]:_0x1f3757[_0xb2c1('0x25')]+_0x1f3757['limit'];var _0x4de74c;if(_0x499b4f>=_0x517764){_0x499b4f=_0x517764;_0x4de74c=0xc8;}else{_0x4de74c=0xce;}_0x3d18ef[_0xb2c1('0x20')](_0x4de74c);return _0x3d18ef[_0xb2c1('0x27')](_0xb2c1('0x28'),_0x41627f+'-'+_0x499b4f+'/'+_0x517764)['json'](_0x44bd5d);}return null;};}function saveUpdates(_0x12d4ea){return function(_0x565938){if(_0x565938){return _0x565938[_0xb2c1('0x29')](_0x12d4ea)['then'](function(_0x9878c4){return _0x9878c4;});}return null;};}function removeEntity(_0x534c3a){return function(_0xf91535){if(_0xf91535){return _0xf91535['destroy']()[_0xb2c1('0x15')](function(){_0x534c3a['status'](0xcc)[_0xb2c1('0x21')]();});}};}function handleEntityNotFound(_0x2a3bf7){return function(_0x39d664){if(!_0x39d664){_0x2a3bf7['sendStatus'](0x194);}return _0x39d664;};}function handleError(_0x1e8343,_0x1e99af){_0x1e99af=_0x1e99af||0x1f4;return function(_0xbc47fa){logger[_0xb2c1('0x1b')](_0xbc47fa[_0xb2c1('0x2a')]);if(_0xbc47fa[_0xb2c1('0x2b')]){delete _0xbc47fa['name'];}_0x1e8343['status'](_0x1e99af)['send'](_0xbc47fa);};}function getMustacheRender(_0x1aabdd,_0x3efcaf){return Mustache[_0xb2c1('0x2c')](_0x1aabdd,_[_0xb2c1('0x2d')](_0x3efcaf[_0xb2c1('0x2e')],{'contact':_0x3efcaf[_0xb2c1('0x2f')],'message':_0x3efcaf[_0xb2c1('0x1c')],'agent':_0x3efcaf[_0xb2c1('0x30')],'interaction':_0x3efcaf['interaction'],'account':_0x3efcaf['account']}))||'';}exports[_0xb2c1('0x31')]=function(_0x109d4e,_0x4d39fd){var _0x38fb78={};var _0x55e203=_[_0xb2c1('0x32')](db['ChatInteraction'][_0xb2c1('0x33')],function(_0x10f332){return{'name':_0x10f332['fieldName'],'type':_0x10f332['type'][_0xb2c1('0x34')]};});_0x38fb78=qs[_0xb2c1('0x35')](_0x55e203,_0x109d4e);return interaction[_0xb2c1('0x36')](_0xb2c1('0x37'),_0x109d4e[_0xb2c1('0x38')],_0x109d4e[_0xb2c1('0x39')],_0x38fb78,_0x55e203)['then'](respondWithFilteredResult(_0x4d39fd,_0x38fb78))[_0xb2c1('0x1e')](handleError(_0x4d39fd,null));};exports['show']=function(_0x294892,_0x47aafc){var _0x533b0={'raw':![],'where':{'id':_0x294892[_0xb2c1('0x3a')]['id']}},_0xef3cb={};_0xef3cb[_0xb2c1('0x3b')]=_[_0xb2c1('0x3c')](db[_0xb2c1('0x3d')]['rawAttributes']);_0xef3cb['query']=_[_0xb2c1('0x3c')](_0x294892[_0xb2c1('0x38')]);_0xef3cb[_0xb2c1('0x3e')]=_[_0xb2c1('0x3f')](_0xef3cb[_0xb2c1('0x3b')],_0xef3cb[_0xb2c1('0x38')]);_0x533b0[_0xb2c1('0x40')]=_[_0xb2c1('0x3f')](_0xef3cb[_0xb2c1('0x3b')],qs['fields'](_0x294892[_0xb2c1('0x38')][_0xb2c1('0x41')]));_0x533b0[_0xb2c1('0x40')]=_0x533b0['attributes']['length']?_0x533b0[_0xb2c1('0x40')]:_0xef3cb[_0xb2c1('0x3b')];if(_0x294892[_0xb2c1('0x38')][_0xb2c1('0x42')]){_0x533b0['include']=[{'all':!![]}];}_0x533b0=_[_0xb2c1('0x2d')]({},_0x533b0,_0x294892[_0xb2c1('0x43')]);return db[_0xb2c1('0x3d')]['find'](_0x533b0)[_0xb2c1('0x15')](handleEntityNotFound(_0x47aafc,null))[_0xb2c1('0x15')](respondWithResult(_0x47aafc,null))[_0xb2c1('0x1e')](handleError(_0x47aafc,null));};exports[_0xb2c1('0x44')]=function(_0x1341de,_0x24ddfe){return db[_0xb2c1('0x3d')][_0xb2c1('0x44')](_0x1341de[_0xb2c1('0x2e')],{})['then'](respondWithResult(_0x24ddfe,0xc9))[_0xb2c1('0x1e')](handleError(_0x24ddfe,null));};exports[_0xb2c1('0x29')]=function(_0x841015,_0x2f4883){if(_0x841015[_0xb2c1('0x2e')]['id']){delete _0x841015[_0xb2c1('0x2e')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x841015[_0xb2c1('0x3a')]['id']}})[_0xb2c1('0x15')](handleEntityNotFound(_0x2f4883,null))[_0xb2c1('0x15')](saveUpdates(_0x841015[_0xb2c1('0x2e')],null))[_0xb2c1('0x15')](respondWithResult(_0x2f4883,null))[_0xb2c1('0x1e')](handleError(_0x2f4883,null));};exports[_0xb2c1('0x45')]=function(_0x4883c6,_0x37c841){return db[_0xb2c1('0x3d')][_0xb2c1('0x46')]({'where':{'id':_0x4883c6['params']['id']}})[_0xb2c1('0x15')](handleEntityNotFound(_0x37c841,null))[_0xb2c1('0x15')](removeEntity(_0x37c841,null))[_0xb2c1('0x1e')](handleError(_0x37c841,null));};exports[_0xb2c1('0x47')]=function(_0xbfb180,_0x25b6e1){return db[_0xb2c1('0x3d')][_0xb2c1('0x47')]()[_0xb2c1('0x15')](respondWithResult(_0x25b6e1,null))[_0xb2c1('0x1e')](handleError(_0x25b6e1,null));};exports[_0xb2c1('0x48')]=function(_0x32cebc,_0x108b38){var _0x5bfb6a=_0x32cebc[_0xb2c1('0x3a')]['id'];var _0x5a68de;var _0x1de888;var _0x17701c;return db['ChatInteraction'][_0xb2c1('0x49')]({'where':{'id':_0x5bfb6a}})['then'](function(_0x50a1f4){_0x5a68de=_0x50a1f4;return db[_0xb2c1('0x4a')][_0xb2c1('0x49')]({'where':{'id':_0x50a1f4[_0xb2c1('0x4b')]},'attributes':['id',_0xb2c1('0x4c'),_0xb2c1('0x4d'),_0xb2c1('0x4e'),_0xb2c1('0x4f'),_0xb2c1('0x50')],'raw':!![]});})[_0xb2c1('0x15')](function(_0x765085){if(_0x765085&&_0x765085[_0xb2c1('0x4c')]&&_0x765085[_0xb2c1('0x4d')]){_0x1de888=_0x765085;var _0x8b1f20={'interaction':{'id':_0x5bfb6a},'agent':{'id':_0x32cebc[_0xb2c1('0x39')]['id'],'name':_0x32cebc[_0xb2c1('0x39')][_0xb2c1('0x2b')],'fullname':_0x32cebc[_0xb2c1('0x39')]['fullname'],'email':_0x32cebc['user'][_0xb2c1('0x51')]},'contact':_0x32cebc[_0xb2c1('0x2e')]['contact'],'account':_0x32cebc[_0xb2c1('0x2e')]['account']};var _0x101752={'rejectUnauthorized':![],'method':_0xb2c1('0x52'),'url':_0xb2c1('0x53'),'headers':{'X-APIKEY':_0x765085['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x32cebc[_0xb2c1('0x39')][_0xb2c1('0x51')]],'buttons':null,'topic':_0x1de888[_0xb2c1('0x4e')],'note':_[_0xb2c1('0x54')](_0x1de888[_0xb2c1('0x4f')])?null:getMustacheRender(_0x1de888['vidaooNote'],_0x8b1f20),'metadata':null},'redirect':_0xb2c1('0x55'),'json':!![]};try{if(!_[_0xb2c1('0x54')](_0x1de888['vidaooMetadata'])){var _0x511a55=getMustacheRender(_0x1de888[_0xb2c1('0x50')],_0x8b1f20);var _0xa67e05=JSON[_0xb2c1('0x56')](_0x511a55);_0x101752['body']['metadata']=_0xa67e05;}}catch(_0x54c6a9){throw new db['Sequelize']['ValidationError'](_0xb2c1('0x57'));}return rp(_0x101752);}else{throw new db['Sequelize'][(_0xb2c1('0x58'))](_0xb2c1('0x59'));}})[_0xb2c1('0x15')](function(_0x11d8c6){_0x17701c=_0x11d8c6;if(_0x17701c['id']){var _0x585f58={'body':_0x17701c[_0xb2c1('0x5a')],'ChatWebsiteId':_0x1de888['id'],'ChatInteractionId':_0x5a68de['id'],'direction':_0xb2c1('0x5b'),'UserId':_0x32cebc[_0xb2c1('0x39')]['id']};return db[_0xb2c1('0x5c')]['create'](_0x585f58,{});}else{throw new db[(_0xb2c1('0x5d'))][(_0xb2c1('0x58'))](_0xb2c1('0x5e'));}})['then'](function(){return _0x5a68de[_0xb2c1('0x5f')]({'vidaooSessionId':_0x17701c['id']});})['then'](respondWithResult(_0x108b38,null))[_0xb2c1('0x1e')](handleError(_0x108b38,null));};exports[_0xb2c1('0x60')]=function(_0x436895,_0x2532af){if(_0x436895['body']['id']){delete _0x436895[_0xb2c1('0x2e')]['id'];}return db[_0xb2c1('0x3d')]['find']({'where':{'id':_0x436895[_0xb2c1('0x3a')]['id']},'include':[{'model':db[_0xb2c1('0x61')],'as':_0xb2c1('0x62')}]})['then'](handleEntityNotFound(_0x2532af,null))['then'](saveUpdates(_0x436895['body'],null))[_0xb2c1('0x15')](respondWithResult(_0x2532af,null))['catch'](handleError(_0x2532af,null));};exports[_0xb2c1('0x63')]=function(_0x3cbde8,_0x4a0e1d){if(_0x3cbde8['body']['id']){delete _0x3cbde8[_0xb2c1('0x2e')]['id'];}return db[_0xb2c1('0x3d')][_0xb2c1('0x46')]({'where':{'id':_0x3cbde8[_0xb2c1('0x3a')]['id']}})[_0xb2c1('0x15')](function(_0xfd16ee){if(!_0xfd16ee){logger[_0xb2c1('0x1b')](_0xb2c1('0x64'),'abandon',0x194,'entity\x20not\x20found');_0x4a0e1d[_0xb2c1('0x1f')](0x194);}else{if(_0xfd16ee[_0xb2c1('0x65')]){throw new db[(_0xb2c1('0x5d'))]['ValidationError']('Interaction\x20already\x20assigned');}}return _0xfd16ee;})[_0xb2c1('0x15')](function(_0x332bdc){if(_0x332bdc){return _0x332bdc[_0xb2c1('0x29')]({'closed':_0x3cbde8[_0xb2c1('0x2e')]['closed'],'disposition':_0x3cbde8[_0xb2c1('0x2e')][_0xb2c1('0x66')]})[_0xb2c1('0x15')](function(_0x4524fc){return _0x4524fc;});}})['then'](function(){return respondWithRpcPromise('AbandonInteraction','abandon',_0x3cbde8[_0xb2c1('0x2e')],client9004);})[_0xb2c1('0x15')](respondWithResult(_0x4a0e1d,null))[_0xb2c1('0x1e')](handleError(_0x4a0e1d,null));};exports[_0xb2c1('0x67')]=function(_0x43a920,_0x17101e){_0x43a920[_0xb2c1('0x2e')][_0xb2c1('0x2b')]=_0x43a920[_0xb2c1('0x68')][_0xb2c1('0x69')];_0x43a920[_0xb2c1('0x2e')][_0xb2c1('0x6a')]=_0x43a920[_0xb2c1('0x68')][_0xb2c1('0x6b')];_0x43a920[_0xb2c1('0x2e')][_0xb2c1('0x6c')]=_0x43a920[_0xb2c1('0x68')][_0xb2c1('0x6d')];return db['Attachment'][_0xb2c1('0x44')](_0x43a920[_0xb2c1('0x2e')])[_0xb2c1('0x15')](respondWithResult(_0x17101e,0xc9))[_0xb2c1('0x1e')](handleError(_0x17101e,null));};exports[_0xb2c1('0x6e')]=function(_0x26686e,_0x393dc3){return db[_0xb2c1('0x3d')][_0xb2c1('0x49')]({'where':{'id':_0x26686e[_0xb2c1('0x3a')]['id']},'raw':!![]})[_0xb2c1('0x15')](handleEntityNotFound(_0x393dc3,null))[_0xb2c1('0x15')](function(_0x4a05ae){if(_0x4a05ae){if(_0x4a05ae[_0xb2c1('0x6f')]){return _0x393dc3[_0xb2c1('0x20')](0x193)[_0xb2c1('0x22')]({'status':0x193,'message':_0xb2c1('0x70')});}return db[_0xb2c1('0x71')][_0xb2c1('0x49')]({'where':{'id':_0x26686e['query']['attachId']},'raw':!![]})[_0xb2c1('0x15')](handleEntityNotFound(_0x393dc3,null));}})[_0xb2c1('0x15')](function(_0x595511){if(_0x595511){var _0x5175d3=_0x595511[_0xb2c1('0x72')]!==null;var _0x5c9f16=path[_0xb2c1('0x73')](config['root'],_0xb2c1('0x74'));if(_0x5175d3){_0x5c9f16=path[_0xb2c1('0x73')](_0x5c9f16,_0xb2c1('0x75'));}var _0x462d42=path[_0xb2c1('0x73')](_0x5c9f16,_0x595511[_0xb2c1('0x6a')]);return _0x393dc3[_0xb2c1('0x76')](_0x462d42);}})[_0xb2c1('0x1e')](handleError(_0x393dc3,null));};exports[_0xb2c1('0x77')]=function(_0x4f1d2b,_0x4d6c75){var _0x513094=null;var _0x1d019f=null;var _0x55e7fb=null;if(_0x4f1d2b['body']['id']){delete _0x4f1d2b[_0xb2c1('0x2e')]['id'];}if(_0x4f1d2b[_0xb2c1('0x2e')][_0xb2c1('0x78')]){_0x55e7fb=path[_0xb2c1('0x73')](config[_0xb2c1('0x79')],'server/files/chat/upload/',util[_0xb2c1('0x7a')](_0xb2c1('0x7b'),Date[_0xb2c1('0x7c')]()));_0x4f1d2b[_0xb2c1('0x2e')]['pathTranscript']=_0x55e7fb;}return db['ChatInteraction'][_0xb2c1('0x46')]({'where':{'id':_0x4f1d2b[_0xb2c1('0x3a')]['id']},'include':[{'model':db[_0xb2c1('0x5c')],'as':_0xb2c1('0x7d'),'include':[{'model':db[_0xb2c1('0x7e')],'as':'User'}]}]})[_0xb2c1('0x15')](handleEntityNotFound(_0x4d6c75,null))['then'](saveUpdates(_0x4f1d2b[_0xb2c1('0x2e')],null))['then'](function(_0x3fbf62){if(_0x3fbf62){_0x513094=_0x3fbf62;return db[_0xb2c1('0x4a')][_0xb2c1('0x46')]({'where':{'id':_0x513094['ChatWebsiteId']}});}})[_0xb2c1('0x15')](function(_0x27a5eb){if(_0x27a5eb){_0x1d019f=_0x27a5eb;return db[_0xb2c1('0x61')]['find']({'where':{'id':_0x513094[_0xb2c1('0x7f')]}});}})['then'](function(_0xd8d1f6){if(_0xd8d1f6){if(_0x55e7fb){var _0x494abf=null;for(var _0x141cad=0x1;_0x141cad<_0x513094[_0xb2c1('0x7d')][_0xb2c1('0x80')];++_0x141cad){_0x494abf=_0x513094[_0xb2c1('0x7d')][_0x141cad];var _0x2318fd=_0x494abf[_0xb2c1('0x65')]?util[_0xb2c1('0x7a')](_0xb2c1('0x81'),_0x1d019f['agentAlias'],_0x494abf['UserId']):_0xb2c1('0x82');var _0x4e9976=_0x4f1d2b[_0xb2c1('0x2e')]['customer']||util['format'](_0xb2c1('0x81'),'Visitor',_0x494abf[_0xb2c1('0x7f')]);switch(_0x1d019f[_0xb2c1('0x83')]){case _0xb2c1('0x84'):_0x2318fd=_0x494abf[_0xb2c1('0x65')]?util[_0xb2c1('0x7a')](_0xb2c1('0x81'),_0x1d019f[_0xb2c1('0x85')],_0x494abf[_0xb2c1('0x65')]):_0xb2c1('0x82');break;case _0xb2c1('0x86'):_0x2318fd=_0x494abf[_0xb2c1('0x65')]?_0x494abf[_0xb2c1('0x7e')][_0xb2c1('0x87')]||_0x494abf['User']['fullname']:_0xb2c1('0x82');break;case'agent_fullname':_0x2318fd=_0x494abf[_0xb2c1('0x65')]?_0x494abf[_0xb2c1('0x7e')][_0xb2c1('0x88')]:'System';break;default:_0x2318fd=_0x494abf[_0xb2c1('0x65')]?util[_0xb2c1('0x7a')](_0xb2c1('0x81'),_0x1d019f[_0xb2c1('0x85')],_0x494abf[_0xb2c1('0x65')]):_0xb2c1('0x82');}var _0x4e4eb5=util[_0xb2c1('0x7a')](_0xb2c1('0x89'),moment(_0x494abf['createdAt'])['format'](_0xb2c1('0x8a')),_0x494abf['direction']==='in'?_0x4e9976:_0x2318fd,_0x494abf[_0xb2c1('0x2e')]);if(!_0x494abf[_0xb2c1('0x8b')]){fs[_0xb2c1('0x8c')](_0x55e7fb,_0x4e4eb5);}}return db['MailAccount'][_0xb2c1('0x49')]({'where':{'service':!![]},'include':[{'model':db[_0xb2c1('0x8d')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xb2c1('0x8e')],'as':_0xb2c1('0x8e'),'raw':!![]}]}]});}}})[_0xb2c1('0x15')](function(_0x4c4b5a){if(!_0x4c4b5a||!_0x4c4b5a[_0xb2c1('0x8f')]||!_0x4f1d2b[_0xb2c1('0x2e')])return _0x513094;var _0x4ce971=_0x4c4b5a[_0xb2c1('0x90')]();return respondWithRpcPromise(_0xb2c1('0x91'),_0xb2c1('0x92'),{'account':_0x4ce971,'message':{'from':util[_0xb2c1('0x7a')](_0xb2c1('0x93'),_0x4c4b5a[_0xb2c1('0x2b')],_0x4c4b5a['email']||_0x4c4b5a[_0xb2c1('0x8f')]['user']),'to':_0x4f1d2b[_0xb2c1('0x2e')]['mailTranscript'],'subject':_0xb2c1('0x94'),'text':util[_0xb2c1('0x7a')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x4f1d2b[_0xb2c1('0x2e')][_0xb2c1('0x78')]),'attachments':[{'path':_0x55e7fb}]}})[_0xb2c1('0x15')](function(){return _0x513094;})[_0xb2c1('0x1e')](function(_0x4e15e0){logger[_0xb2c1('0x1b')](_0x4e15e0);});})[_0xb2c1('0x15')](respondWithStatusCode(_0x4d6c75,0xc8))['catch'](handleError(_0x4d6c75,null));};exports[_0xb2c1('0x95')]=function(_0x2b5d35,_0x56103e){return db['ChatMessage'][_0xb2c1('0x46')]({'where':{'id':_0x2b5d35['params']['id']}})['then'](handleEntityNotFound(_0x56103e,null))['then'](function(_0x443584){if(_0x443584){return _0x443584[_0xb2c1('0x95')](_0x2b5d35['body'][_0xb2c1('0x96')],_['omit'](_0x2b5d35['body'],['ids','id'])||{});}})[_0xb2c1('0x15')](respondWithResult(_0x56103e,null))[_0xb2c1('0x1e')](handleError(_0x56103e,null));};exports['getMessages']=function(_0x4315bf,_0x1163db){var _0x4ecb5c={'raw':![],'where':{}};var _0x350b8a={};var _0xad4ef3={'count':0x0,'rows':[]};return db[_0xb2c1('0x3d')][_0xb2c1('0x49')]({'where':{'id':_0x4315bf[_0xb2c1('0x3a')]['id']}})[_0xb2c1('0x15')](handleEntityNotFound(_0x1163db,null))['then'](function(_0x21fdc8){if(_0x21fdc8){_0x350b8a[_0xb2c1('0x3b')]=_[_0xb2c1('0x3c')](db[_0xb2c1('0x5c')]['rawAttributes']);_0x350b8a[_0xb2c1('0x38')]=_['keys'](_0x4315bf['query']);_0x350b8a['filters']=_['intersection'](_0x350b8a[_0xb2c1('0x3b')],_0x350b8a['query']);_0x4ecb5c['attributes']=_['intersection'](_0x350b8a[_0xb2c1('0x3b')],qs[_0xb2c1('0x41')](_0x4315bf[_0xb2c1('0x38')]['fields']));_0x4ecb5c[_0xb2c1('0x40')]=_0x4ecb5c[_0xb2c1('0x40')][_0xb2c1('0x80')]?_0x4ecb5c[_0xb2c1('0x40')]:_0x350b8a[_0xb2c1('0x3b')];if(!_0x4315bf[_0xb2c1('0x38')][_0xb2c1('0x97')](_0xb2c1('0x98'))){_0x4ecb5c[_0xb2c1('0x24')]=qs[_0xb2c1('0x24')](_0x4315bf[_0xb2c1('0x38')]['limit']);_0x4ecb5c[_0xb2c1('0x25')]=qs['offset'](_0x4315bf[_0xb2c1('0x38')][_0xb2c1('0x25')]);}_0x4ecb5c[_0xb2c1('0x99')]=qs[_0xb2c1('0x9a')](_0x4315bf[_0xb2c1('0x38')][_0xb2c1('0x9a')]);_0x4ecb5c[_0xb2c1('0x9b')]=qs[_0xb2c1('0x3e')](_[_0xb2c1('0x9c')](_0x4315bf['query'],_0x350b8a[_0xb2c1('0x3e')]));_0x4ecb5c[_0xb2c1('0x9b')][_0xb2c1('0x9d')]=_0x21fdc8['id'];if(_0x4315bf['query'][_0xb2c1('0x9e')]){_0x4ecb5c[_0xb2c1('0x9b')]=_[_0xb2c1('0x2d')](_0x4ecb5c[_0xb2c1('0x9b')],{'$or':_['map'](_0x4ecb5c[_0xb2c1('0x40')],function(_0x573038){var _0x236bfd={};_0x236bfd[_0x573038]={'$like':'%'+_0x4315bf[_0xb2c1('0x38')][_0xb2c1('0x9e')]+'%'};return _0x236bfd;})});}if(_0x4315bf[_0xb2c1('0x38')]['$gte']){var _0x3b4dac=_0x4315bf[_0xb2c1('0x38')][_0xb2c1('0x9f')]['split'](',');var _0x1c9249={};_0x1c9249[_0x3b4dac[0x0]]={'$gte':moment(_0x3b4dac[0x1])[_0xb2c1('0x7a')](_0xb2c1('0xa0'))};_0x4ecb5c[_0xb2c1('0x9b')]=_['merge'](_0x4ecb5c['where'],_0x1c9249);}_0x4ecb5c=_[_0xb2c1('0x2d')]({},_0x4ecb5c,_0x4315bf[_0xb2c1('0x43')]);return db[_0xb2c1('0x5c')][_0xb2c1('0x26')]({'where':_0x4ecb5c[_0xb2c1('0x9b')]})[_0xb2c1('0x15')](function(_0x48caaf){_0xad4ef3[_0xb2c1('0x26')]=_0x48caaf;if(_0x4315bf[_0xb2c1('0x38')]['includeAll']){_0x4ecb5c[_0xb2c1('0xa1')]=[{'all':!![]}];}return db[_0xb2c1('0x5c')][_0xb2c1('0x36')](_0x4ecb5c);})[_0xb2c1('0x15')](function(_0x317fc5){_0xad4ef3[_0xb2c1('0xa2')]=_0x317fc5;return _0xad4ef3;});}})[_0xb2c1('0x15')](respondWithFilteredResult(_0x1163db,_0x4ecb5c))['catch'](handleError(_0x1163db,null));};exports['getMyMessages']=function(_0x2f7627,_0x173581){var _0x42ef66={'where':{}},_0x5543ef={},_0x4aee94={'count':0x0,'rows':[]};return db[_0xb2c1('0x3d')]['findOne']({'where':{'id':_0x2f7627['params']['id']}})[_0xb2c1('0x15')](handleEntityNotFound(_0x173581,null))[_0xb2c1('0x15')](function(_0x53453b){if(_0x53453b){_0x5543ef['model']=_[_0xb2c1('0x3c')](db[_0xb2c1('0x5c')]['rawAttributes']);_0x5543ef[_0xb2c1('0x38')]=_[_0xb2c1('0x3c')](_0x2f7627['query']);_0x5543ef[_0xb2c1('0x3e')]=_[_0xb2c1('0x3f')](_0x5543ef['model'],_0x5543ef[_0xb2c1('0x38')]);_0x42ef66['attributes']=_['intersection'](_0x5543ef[_0xb2c1('0x3b')],qs[_0xb2c1('0x41')](_0x2f7627['query'][_0xb2c1('0x41')]));_0x42ef66['attributes']=_0x42ef66['attributes'][_0xb2c1('0x80')]?_0x42ef66[_0xb2c1('0x40')]:_0x5543ef['model'];if(!_0x2f7627[_0xb2c1('0x38')][_0xb2c1('0x97')](_0xb2c1('0x98'))){_0x42ef66['limit']=qs[_0xb2c1('0x24')](_0x2f7627[_0xb2c1('0x38')][_0xb2c1('0x24')]);_0x42ef66[_0xb2c1('0x25')]=qs[_0xb2c1('0x25')](_0x2f7627[_0xb2c1('0x38')][_0xb2c1('0x25')]);}_0x42ef66[_0xb2c1('0x99')]=qs[_0xb2c1('0x9a')](_0x2f7627[_0xb2c1('0x38')][_0xb2c1('0x9a')]);_0x42ef66[_0xb2c1('0x9b')]=qs[_0xb2c1('0x3e')](_[_0xb2c1('0x9c')](_0x2f7627['query'],_0x5543ef[_0xb2c1('0x3e')]));_0x42ef66[_0xb2c1('0x9b')]['ChatInteractionId']=_0x53453b['id'];if(_0x2f7627[_0xb2c1('0x38')][_0xb2c1('0x9e')]){_0x42ef66['where']=_['merge'](_0x42ef66[_0xb2c1('0x9b')],{'$or':_[_0xb2c1('0x32')](_0x42ef66['attributes'],function(_0x4d914d){var _0x565e28={};_0x565e28[_0x4d914d]={'$like':'%'+_0x2f7627[_0xb2c1('0x38')][_0xb2c1('0x9e')]+'%'};return _0x565e28;})});}_0x42ef66[_0xb2c1('0x9b')][_0xb2c1('0x8b')]=![];if(_0x2f7627[_0xb2c1('0x38')]['id']){_0x42ef66['where']['id']={'$gt':_0x2f7627[_0xb2c1('0x38')]['id']};}_0x42ef66=_['merge']({},_0x42ef66,_0x2f7627['options']);return db['ChatMessage'][_0xb2c1('0x26')]({'where':_0x42ef66[_0xb2c1('0x9b')]})['then'](function(_0x3a870e){_0x4aee94[_0xb2c1('0x26')]=_0x3a870e;_0x42ef66[_0xb2c1('0xa1')]=[];if(_0x2f7627['query'][_0xb2c1('0xa3')]){_0x42ef66[_0xb2c1('0xa1')][_0xb2c1('0xa4')]({'model':db[_0xb2c1('0x7e')],'as':_0xb2c1('0x7e'),'attributes':['id','fullname',_0xb2c1('0x87')]});}if(_0x2f7627[_0xb2c1('0x38')]['includeAll']){_0x42ef66[_0xb2c1('0xa1')]=[{'all':!![]}];}return db[_0xb2c1('0x5c')]['findAll'](_0x42ef66);})[_0xb2c1('0x15')](function(_0x442884){_0x4aee94[_0xb2c1('0xa2')]=_0x442884;return _0x4aee94;});}})[_0xb2c1('0x15')](respondWithFilteredResult(_0x173581,_0x42ef66))[_0xb2c1('0x1e')](handleError(_0x173581,null));};exports['addTags']=function(_0x36d2a2,_0x2a822e){return db[_0xb2c1('0x3d')]['find']({'where':{'id':_0x36d2a2[_0xb2c1('0x3a')]['id']}})[_0xb2c1('0x15')](handleEntityNotFound(_0x2a822e,null))['then'](function(_0x336bca){if(_0x336bca){return _0x336bca['setTags'](_0x36d2a2[_0xb2c1('0x2e')][_0xb2c1('0x96')],_['omit'](_0x36d2a2[_0xb2c1('0x2e')],[_0xb2c1('0x96'),'id'])||{})[_0xb2c1('0xa5')](function(){return db[_0xb2c1('0xa6')]['findAll']({'attributes':['id',_0xb2c1('0x2b'),_0xb2c1('0xa7')],'where':{'id':_0x36d2a2['body'][_0xb2c1('0x96')]}});})[_0xb2c1('0x15')](function(_0x54cb69){socket[_0xb2c1('0xa8')]('chatInteractionTags:save',{'id':Number(_0x36d2a2[_0xb2c1('0x3a')]['id']),'tags':_0x54cb69||[]});return{'id':Number(_0x36d2a2[_0xb2c1('0x3a')]['id']),'tags':_0x54cb69||[]};});}})[_0xb2c1('0x15')](respondWithResult(_0x2a822e,null))[_0xb2c1('0x1e')](handleError(_0x2a822e,null));};exports['removeTags']=function(_0x552e5f,_0x3c6c61){return db[_0xb2c1('0x3d')]['find']({'where':{'id':_0x552e5f[_0xb2c1('0x3a')]['id']}})[_0xb2c1('0x15')](handleEntityNotFound(_0x3c6c61,null))['then'](function(_0x4e7aea){if(_0x4e7aea){return _0x4e7aea[_0xb2c1('0xa9')](_0x552e5f[_0xb2c1('0x38')][_0xb2c1('0x96')]);}})[_0xb2c1('0x15')](respondWithStatusCode(_0x3c6c61,null))['catch'](handleError(_0x3c6c61,null));};exports[_0xb2c1('0x76')]=function(_0x4abed5,_0x573fcb){var _0x118836=moment()['unix']()['toString']();var _0x25054f=path[_0xb2c1('0x73')](config['root'],_0xb2c1('0xaa'),'files',_0xb2c1('0xab'));var _0x219800=path[_0xb2c1('0x73')](config[_0xb2c1('0x79')],_0xb2c1('0xaa'),_0xb2c1('0xac'),_0xb2c1('0xad'));var _0xafefd9=path[_0xb2c1('0x73')](_0x25054f,_0x118836);var _0x20a388=util[_0xb2c1('0x7a')](_0xb2c1('0xae'),_0x4abed5[_0xb2c1('0x3a')]['id'],_0x118836);var _0x2cca42=path[_0xb2c1('0x73')](_0x25054f,_0x20a388);var _0x4aea97=[];_0x4aea97[_0xb2c1('0xa4')]({'model':db['User'],'as':_0xb2c1('0x7e'),'attributes':['id','fullname'],'raw':!![]});_0x4aea97[_0xb2c1('0xa4')]({'model':db[_0xb2c1('0x61')],'as':'Contact','attributes':['id',_0xb2c1('0xaf'),_0xb2c1('0xb0')],'raw':!![]});if(_0x4abed5[_0xb2c1('0x38')][_0xb2c1('0xad')]){_0x4aea97['push']({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x45c5ab=[{'model':db[_0xb2c1('0x5c')],'as':_0xb2c1('0x7d'),'attributes':['id',_0xb2c1('0x2e'),_0xb2c1('0xb1'),'direction',_0xb2c1('0x8b'),'read'],'include':_0x4aea97}];_0x45c5ab[_0xb2c1('0xa4')]({'model':db[_0xb2c1('0x4a')],'as':_0xb2c1('0xb2'),'attributes':['id','name']});_0x45c5ab[_0xb2c1('0xa4')]({'model':db[_0xb2c1('0x7e')],'as':_0xb2c1('0xb3'),'attributes':['id','fullname']});return db[_0xb2c1('0x3d')]['find']({'where':{'id':_0x4abed5[_0xb2c1('0x3a')]['id']},'include':_0x45c5ab})['then'](handleEntityNotFound(_0x573fcb,null))[_0xb2c1('0x15')](function(_0x387e61){if(_0x387e61){var _0xbdc113=_0x387e61[_0xb2c1('0xb4')]({'plain':!![]});fs['mkdirSync'](_0xafefd9);var _0x3cd515={'channel':_0xb2c1('0xb5'),'account':_0xbdc113['Account'][_0xb2c1('0x2b')],'agent':_0xbdc113[_0xb2c1('0xb3')]?_0xbdc113[_0xb2c1('0xb3')]['fullname']:'N.A.','createdAt':moment(_0xbdc113[_0xb2c1('0xb1')])[_0xb2c1('0x7a')](_0xb2c1('0xa0'))[_0xb2c1('0xb6')](),'closedAt':_0xbdc113[_0xb2c1('0x6f')]?moment(_0xbdc113[_0xb2c1('0xb7')])[_0xb2c1('0x7a')](_0xb2c1('0xa0'))['toString']():'','disposition':_0xbdc113['disposition'],'chatInfo':{'browser':_0xbdc113['browserName'],'os':_0xbdc113[_0xb2c1('0xb8')],'referer':_0xbdc113[_0xb2c1('0xb9')],'customerIp':_0xbdc113[_0xb2c1('0xba')],'customerPort':_0xbdc113[_0xb2c1('0xbb')]?_0xbdc113['customerPort']:_0xb2c1('0xbc')},'messages':_(_0xbdc113[_0xb2c1('0x7d')])[_0xb2c1('0xbd')]()[_0xb2c1('0x9e')]({'secret':![]})['map'](function(_0x2e15bb){if(_0x2e15bb[_0xb2c1('0x71')]){var _0x5e1b9a=path[_0xb2c1('0x73')](_0x219800,_0x2e15bb[_0xb2c1('0x71')][_0xb2c1('0x6a')]);if(fs[_0xb2c1('0xbe')](_0x5e1b9a)){fs[_0xb2c1('0xbf')](_0x5e1b9a)[_0xb2c1('0xc0')](fs[_0xb2c1('0xc1')](path[_0xb2c1('0x73')](_0xafefd9,_0x2e15bb[_0xb2c1('0x71')][_0xb2c1('0x6a')])));}}return{'date':moment(_0x2e15bb[_0xb2c1('0xb1')])[_0xb2c1('0x7a')]('YYYY-MM-DD\x20HH:mm:ss')[_0xb2c1('0xb6')](),'sender':_0x2e15bb[_0xb2c1('0xc2')]===_0xb2c1('0x5b')?_0x2e15bb['User']?_0x2e15bb[_0xb2c1('0x7e')]['fullname']:_0xb2c1('0x82'):_0x2e15bb[_0xb2c1('0x62')][_0xb2c1('0xaf')]+(_0x2e15bb['Contact'][_0xb2c1('0xb0')]?'\x20'+_0x2e15bb['Contact']['lastName']:''),'body':_0x2e15bb['Attachment']?_0x2e15bb[_0xb2c1('0x71')]['basename']:_0x2e15bb[_0xb2c1('0x2e')],'direction':_0x2e15bb[_0xb2c1('0xc2')]==='out'?'A':'C','secret':_0x2e15bb[_0xb2c1('0x8b')],'read':_0x2e15bb[_0xb2c1('0xc3')],'attachment':_0x2e15bb[_0xb2c1('0x71')]};})[_0xb2c1('0xc4')]()};return ejs[_0xb2c1('0xc5')](path[_0xb2c1('0x73')](config[_0xb2c1('0x79')],_0xb2c1('0xaa'),_0xb2c1('0xc6'),_0xb2c1('0xc7')),{'interaction':_0x3cd515})[_0xb2c1('0x15')](function(_0x18718d){var _0x4d803f=path[_0xb2c1('0x73')](_0xafefd9,'transcript-'+_0xbdc113['id']+'-'+_0x118836+_0xb2c1('0xc8'));var _0xd0f8ee={'path':_0x4d803f,'channel':_0xb2c1('0xb5'),'interactionId':_0xbdc113['id']};return pdf[_0xb2c1('0xc9')](_0x18718d,_0xd0f8ee);})[_0xb2c1('0x15')](function(){return new Promise(function(_0x4e7106,_0x17352e){zipdir(_0xafefd9,{'saveTo':_0x2cca42},function(_0x2bfee1,_0x38e947){if(_0x2bfee1)return _0x17352e(_0x2bfee1);return _0x4e7106(_0x38e947);});})[_0xb2c1('0x15')](function(){return new BPromise(function(_0x9bd5c9,_0x26d24e){rimraf(_0xafefd9,function(_0x51fe17){if(_0x51fe17)_0x26d24e(_0x51fe17);return _0x9bd5c9();});});})['then'](function(){return _0x573fcb[_0xb2c1('0x76')](_0x2cca42,_0x20a388,function(_0x3d5fba){if(_0x3d5fba){logger[_0xb2c1('0x1b')]('err',_0x3d5fba);}else{fs[_0xb2c1('0xca')](_0x2cca42);}});});});}else{return _0x573fcb[_0xb2c1('0x1f')](0xc8);}})[_0xb2c1('0x1e')](handleError(_0x573fcb,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 383148b..3e7b04c 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 _0x4371=['emit','catch','hasOwnProperty','hook','exports','events','ChatInteraction','../../mysqldb','ChatMessage','setMaxListeners','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length'];(function(_0x491468,_0x42f169){var _0x5b8c22=function(_0x407a9b){while(--_0x407a9b){_0x491468['push'](_0x491468['shift']());}};_0x5b8c22(++_0x42f169);}(_0x4371,0x15b));var _0x1437=function(_0x3f1688,_0x34b8ad){_0x3f1688=_0x3f1688-0x0;var _0x5390e8=_0x4371[_0x3f1688];return _0x5390e8;};'use strict';var EventEmitter=require(_0x1437('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x1437('0x1')];var ChatMessage=require(_0x1437('0x2'))['db'][_0x1437('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x1437('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x1437('0x5')};function emitEvent(_0x35b8a7){return function(_0x1eeea1,_0x522d84,_0x25a87d){_0x1eeea1[_0x1437('0x6')]({'attributes':['id'],'raw':!![]})[_0x1437('0x7')](function(_0x6eb44c){_0x1eeea1[_0x1437('0x8')](_0x1437('0x9'),_0x6eb44c[_0x1437('0xa')](function(_0x412f7a){return{'id':_0x412f7a['id']};}));return ChatMessage[_0x1437('0xb')]({'where':{'ChatInteractionId':_0x1eeea1['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1437('0x7')](function(_0x4474ca){_0x1eeea1[_0x1437('0x8')](_0x1437('0xc'),_0x4474ca[_0x1437('0xd')]);ChatInteractionEvents[_0x1437('0xe')](_0x35b8a7+':'+_0x1eeea1['id'],_0x1eeea1);ChatInteractionEvents[_0x1437('0xe')](_0x35b8a7,_0x1eeea1);_0x25a87d(null);})[_0x1437('0xf')](_0x25a87d(null));};}for(var e in events){if(events[_0x1437('0x10')](e)){var event=events[e];ChatInteraction[_0x1437('0x11')](e,emitEvent(event));}}module[_0x1437('0x12')]=ChatInteractionEvents; \ No newline at end of file +var _0xf6fa=['save','update','remove','getUsers','then','setDataValue','Users','map','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage'];(function(_0x3f9029,_0x5c86a6){var _0xd3b70d=function(_0x48e47b){while(--_0x48e47b){_0x3f9029['push'](_0x3f9029['shift']());}};_0xd3b70d(++_0x5c86a6);}(_0xf6fa,0x8d));var _0xaf6f=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xf6fa[_0x19e35c];return _0x3e1fe8;};'use strict';var EventEmitter=require(_0xaf6f('0x0'));var ChatInteraction=require(_0xaf6f('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0xaf6f('0x1'))['db'][_0xaf6f('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xaf6f('0x3'),'afterUpdate':_0xaf6f('0x4'),'afterDestroy':_0xaf6f('0x5')};function emitEvent(_0x12a238){return function(_0x52cb94,_0x53dbca,_0x277843){_0x52cb94[_0xaf6f('0x6')]({'attributes':['id'],'raw':!![]})[_0xaf6f('0x7')](function(_0x477d13){_0x52cb94[_0xaf6f('0x8')](_0xaf6f('0x9'),_0x477d13[_0xaf6f('0xa')](function(_0x57fdf0){return{'id':_0x57fdf0['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x52cb94['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2bc3db){_0x52cb94[_0xaf6f('0x8')](_0xaf6f('0xb'),_0x2bc3db[_0xaf6f('0xc')]);ChatInteractionEvents[_0xaf6f('0xd')](_0x12a238+':'+_0x52cb94['id'],_0x52cb94);ChatInteractionEvents[_0xaf6f('0xd')](_0x12a238,_0x52cb94);_0x277843(null);})[_0xaf6f('0xe')](_0x277843(null));};}for(var e in events){if(events[_0xaf6f('0xf')](e)){var event=events[e];ChatInteraction[_0xaf6f('0x10')](e,emitEvent(event));}}module[_0xaf6f('0x11')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 24dfd1c..f92426e 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 _0x1de2=['lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','closedAt','format','utf8mb4_unicode_ci'];(function(_0x42df60,_0x3cd73c){var _0x5e912d=function(_0x540a1a){while(--_0x540a1a){_0x42df60['push'](_0x42df60['shift']());}};_0x5e912d(++_0x3cd73c);}(_0x1de2,0xb4));var _0x21de=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x1de2[_0x2112d4];return _0x434972;};'use strict';var _=require(_0x21de('0x0'));var util=require(_0x21de('0x1'));var logger=require(_0x21de('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x21de('0x3'));var fs=require('fs');var path=require(_0x21de('0x4'));var rimraf=require(_0x21de('0x5'));var config=require(_0x21de('0x6'));var attributes=require(_0x21de('0x7'));module[_0x21de('0x8')]=function(_0x5c6ae8,_0x1ff3e0){return _0x5c6ae8[_0x21de('0x9')](_0x21de('0xa'),attributes,{'tableName':_0x21de('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x580960,_0xcfddb7,_0x124fc1){if(_0x580960['changed']('closed')){_0x580960[_0x21de('0xc')]=moment()[_0x21de('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x124fc1(null,_0x580960);}},'charset':'utf8mb4','collate':_0x21de('0xe')});}; \ No newline at end of file +var _0xdbd5=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','util','../../config/logger','api','request-promise','rimraf','./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','changed','closed'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdbd5,0x94));var _0x5dbd=function(_0x5400b,_0x55943a){_0x5400b=_0x5400b-0x0;var _0x36a39b=_0xdbd5[_0x5400b];return _0x36a39b;};'use strict';var _=require(_0x5dbd('0x0'));var util=require(_0x5dbd('0x1'));var logger=require(_0x5dbd('0x2'))(_0x5dbd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5dbd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5dbd('0x5'));var config=require('../../config/environment');var attributes=require(_0x5dbd('0x6'));module[_0x5dbd('0x7')]=function(_0x301b56,_0x2bfb78){return _0x301b56['define'](_0x5dbd('0x8'),attributes,{'tableName':_0x5dbd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3a5031,_0x106871,_0x23e17a){if(_0x3a5031[_0x5dbd('0xa')](_0x5dbd('0xb'))){_0x3a5031[_0x5dbd('0xc')]=moment()[_0x5dbd('0xd')](_0x5dbd('0xe'));}_0x23e17a(null,_0x3a5031);}},'charset':_0x5dbd('0xf'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index c95b163..b20d556 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 _0x1244=['body','options','raw','where','limit','UpdateChatInteraction','catch','AddTagsToChatInteraction','addTags','ids','omit','spread','AddTags','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','ChatInteraction'];(function(_0x27abea,_0x17c21c){var _0x51c4de=function(_0x2e9260){while(--_0x2e9260){_0x27abea['push'](_0x27abea['shift']());}};_0x51c4de(++_0x17c21c);}(_0x1244,0x125));var _0x4124=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x1244[_0x3635ce];return _0x97ecd0;};'use strict';var _=require(_0x4124('0x0'));var util=require(_0x4124('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4124('0x2'));var fs=require('fs');var Redis=require(_0x4124('0x3'));var db=require(_0x4124('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4124('0x5'))(_0x4124('0x6'));var config=require(_0x4124('0x7'));var jayson=require(_0x4124('0x8'));var client=jayson[_0x4124('0x9')][_0x4124('0xa')]({'port':0x232a});config[_0x4124('0xb')]=_[_0x4124('0xc')](config[_0x4124('0xb')],{'host':_0x4124('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4124('0xb')]));require('./chatInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x26187e,_0x44a298,_0x2f5087){return new BPromise(function(_0x2ef789,_0x6f5bd7){return client[_0x4124('0xe')](_0x26187e,_0x2f5087)[_0x4124('0xf')](function(_0x257636){logger[_0x4124('0x10')]('ChatInteraction,\x20%s,\x20%s',_0x44a298,_0x4124('0x11'));logger[_0x4124('0x12')](_0x4124('0x13'),_0x44a298,_0x4124('0x11'),JSON[_0x4124('0x14')](_0x257636));if(_0x257636[_0x4124('0x15')]){if(_0x257636['error'][_0x4124('0x16')]===0x1f4){logger[_0x4124('0x15')](_0x4124('0x17'),_0x44a298,_0x257636[_0x4124('0x15')]['message']);return _0x6f5bd7(_0x257636['error'][_0x4124('0x18')]);}logger[_0x4124('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x44a298,_0x257636[_0x4124('0x15')][_0x4124('0x18')]);return _0x2ef789(_0x257636[_0x4124('0x15')][_0x4124('0x18')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x44a298,_0x4124('0x11'));_0x2ef789(_0x257636[_0x4124('0x19')][_0x4124('0x18')]);}})['catch'](function(_0x482409){logger['error'](_0x4124('0x17'),_0x44a298,_0x482409);_0x6f5bd7(_0x482409);});});}exports['UpdateChatInteraction']=function(_0x7984f2){var _0x508828=this;return new Promise(function(_0x48e0c4,_0x532bb7){return db[_0x4124('0x1a')]['update'](_0x7984f2[_0x4124('0x1b')],{'raw':_0x7984f2[_0x4124('0x1c')]?_0x7984f2['options'][_0x4124('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x7984f2[_0x4124('0x1c')]?_0x7984f2[_0x4124('0x1c')][_0x4124('0x1e')]||null:null,'attributes':_0x7984f2[_0x4124('0x1c')]?_0x7984f2[_0x4124('0x1c')]['attributes']||null:null,'limit':_0x7984f2['options']?_0x7984f2[_0x4124('0x1c')][_0x4124('0x1f')]||null:null})[_0x4124('0xf')](function(_0x1644fa){logger[_0x4124('0x10')](_0x4124('0x20'),_0x7984f2);logger[_0x4124('0x12')]('UpdateChatInteraction',_0x7984f2,JSON['stringify'](_0x1644fa));_0x48e0c4(_0x1644fa);})[_0x4124('0x21')](function(_0x5c1dab){logger['error'](_0x4124('0x20'),_0x5c1dab[_0x4124('0x18')],_0x7984f2);_0x532bb7(_0x508828['error'](0x1f4,_0x5c1dab[_0x4124('0x18')]));});});};exports[_0x4124('0x22')]=function(_0x4b31f5){return new Promise(function(_0x2703fe,_0x2c8994){return db[_0x4124('0x1a')]['find']({'where':_0x4b31f5['options']?_0x4b31f5[_0x4124('0x1c')]['where']||null:null})[_0x4124('0xf')](function(_0x29fd1d){if(_0x29fd1d){return _0x29fd1d[_0x4124('0x23')](_0x4b31f5[_0x4124('0x1b')][_0x4124('0x24')],_[_0x4124('0x25')](_0x4b31f5['body'],[_0x4124('0x24'),'id'])||{});}})[_0x4124('0x26')](function(_0x18f046){logger[_0x4124('0x10')](_0x4124('0x27'),_0x4b31f5);logger[_0x4124('0x12')](_0x4124('0x27'),_0x4b31f5,JSON[_0x4124('0x14')](_0x18f046));_0x2703fe(_0x18f046);})[_0x4124('0x21')](function(_0x3e4068){logger[_0x4124('0x15')](_0x4124('0x27'),_0x3e4068[_0x4124('0x18')],_0x4b31f5);_0x2c8994(_this[_0x4124('0x15')](0x1f4,_0x3e4068[_0x4124('0x18')]));});});}; \ No newline at end of file +var _0x11a8=['raw','where','attributes','limit','stringify','find','addTags','spread','AddTags','lodash','util','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options'];(function(_0x25059d,_0x23b765){var _0x476a8d=function(_0x4539ed){while(--_0x4539ed){_0x25059d['push'](_0x25059d['shift']());}};_0x476a8d(++_0x23b765);}(_0x11a8,0x1a0));var _0x811a=function(_0x36960d,_0x4ae00b){_0x36960d=_0x36960d-0x0;var _0x3bbcc3=_0x11a8[_0x36960d];return _0x3bbcc3;};'use strict';var _=require(_0x811a('0x0'));var util=require(_0x811a('0x1'));var moment=require(_0x811a('0x2'));var BPromise=require(_0x811a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x811a('0x4'));var logger=require(_0x811a('0x5'))('rpc');var config=require(_0x811a('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x811a('0x7')]['http']({'port':0x232a});config[_0x811a('0x8')]=_[_0x811a('0x9')](config[_0x811a('0x8')],{'host':_0x811a('0xa'),'port':0x18eb});var socket=require(_0x811a('0xb'))(new Redis(config[_0x811a('0x8')]));require('./chatInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x2566dd,_0x31e99a,_0x2af0d6){return new BPromise(function(_0x3438c8,_0x52f401){return client[_0x811a('0xc')](_0x2566dd,_0x2af0d6)[_0x811a('0xd')](function(_0x44d66d){logger[_0x811a('0xe')](_0x811a('0xf'),_0x31e99a,_0x811a('0x10'));logger[_0x811a('0x11')](_0x811a('0x12'),_0x31e99a,_0x811a('0x10'),JSON['stringify'](_0x44d66d));if(_0x44d66d[_0x811a('0x13')]){if(_0x44d66d['error']['code']===0x1f4){logger[_0x811a('0x13')](_0x811a('0xf'),_0x31e99a,_0x44d66d[_0x811a('0x13')][_0x811a('0x14')]);return _0x52f401(_0x44d66d[_0x811a('0x13')][_0x811a('0x14')]);}logger[_0x811a('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x31e99a,_0x44d66d[_0x811a('0x13')][_0x811a('0x14')]);return _0x3438c8(_0x44d66d[_0x811a('0x13')][_0x811a('0x14')]);}else{logger[_0x811a('0xe')](_0x811a('0xf'),_0x31e99a,_0x811a('0x10'));_0x3438c8(_0x44d66d[_0x811a('0x15')][_0x811a('0x14')]);}})[_0x811a('0x16')](function(_0x4d3725){logger[_0x811a('0x13')](_0x811a('0xf'),_0x31e99a,_0x4d3725);_0x52f401(_0x4d3725);});});}exports[_0x811a('0x17')]=function(_0x558764){var _0x3df157=this;return new Promise(function(_0x5e2e08,_0x315343){return db[_0x811a('0x18')][_0x811a('0x19')](_0x558764[_0x811a('0x1a')],{'raw':_0x558764[_0x811a('0x1b')]?_0x558764[_0x811a('0x1b')][_0x811a('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x558764[_0x811a('0x1b')]?_0x558764['options'][_0x811a('0x1d')]||null:null,'attributes':_0x558764[_0x811a('0x1b')]?_0x558764[_0x811a('0x1b')][_0x811a('0x1e')]||null:null,'limit':_0x558764['options']?_0x558764[_0x811a('0x1b')][_0x811a('0x1f')]||null:null})[_0x811a('0xd')](function(_0x42c633){logger['info']('UpdateChatInteraction',_0x558764);logger[_0x811a('0x11')](_0x811a('0x17'),_0x558764,JSON[_0x811a('0x20')](_0x42c633));_0x5e2e08(_0x42c633);})[_0x811a('0x16')](function(_0x86198a){logger[_0x811a('0x13')](_0x811a('0x17'),_0x86198a['message'],_0x558764);_0x315343(_0x3df157['error'](0x1f4,_0x86198a[_0x811a('0x14')]));});});};exports['AddTagsToChatInteraction']=function(_0x582c84){return new Promise(function(_0x3443e8,_0x2ee0bd){return db[_0x811a('0x18')][_0x811a('0x21')]({'where':_0x582c84[_0x811a('0x1b')]?_0x582c84[_0x811a('0x1b')][_0x811a('0x1d')]||null:null})['then'](function(_0x3e0cfe){if(_0x3e0cfe){return _0x3e0cfe[_0x811a('0x22')](_0x582c84[_0x811a('0x1a')]['ids'],_['omit'](_0x582c84['body'],['ids','id'])||{});}})[_0x811a('0x23')](function(_0x1028eb){logger['info'](_0x811a('0x24'),_0x582c84);logger[_0x811a('0x11')](_0x811a('0x24'),_0x582c84,JSON[_0x811a('0x20')](_0x1028eb));_0x3443e8(_0x1028eb);})[_0x811a('0x16')](function(_0x1ef27a){logger['error'](_0x811a('0x24'),_0x1ef27a[_0x811a('0x14')],_0x582c84);_0x2ee0bd(_this[_0x811a('0x13')](0x1f4,_0x1ef27a['message']));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 128599b..fa4a4fe 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 _0xcb9f=['emit','removeListener','register','length','chatInteraction:','./chatInteraction.events','save','update'];(function(_0x34e030,_0x57c46d){var _0x1a6406=function(_0x74f5ca){while(--_0x74f5ca){_0x34e030['push'](_0x34e030['shift']());}};_0x1a6406(++_0x57c46d);}(_0xcb9f,0x65));var _0xfcb9=function(_0x14feec,_0x333daf){_0x14feec=_0x14feec-0x0;var _0x306fa9=_0xcb9f[_0x14feec];return _0x306fa9;};'use strict';var ChatInteractionEvents=require(_0xfcb9('0x0'));var events=[_0xfcb9('0x1'),'remove',_0xfcb9('0x2')];function createListener(_0x5100da,_0x5a3818){return function(_0x22103e){_0x5a3818[_0xfcb9('0x3')](_0x5100da,_0x22103e);};}function removeListener(_0x321617,_0x2738dc){return function(){ChatInteractionEvents[_0xfcb9('0x4')](_0x321617,_0x2738dc);};}exports[_0xfcb9('0x5')]=function(_0x50a2b9){for(var _0x4e613e=0x0,_0x57572b=events[_0xfcb9('0x6')];_0x4e613e<_0x57572b;_0x4e613e++){var _0x51d067=events[_0x4e613e];var _0x4c48ad=createListener(_0xfcb9('0x7')+_0x51d067,_0x50a2b9);ChatInteractionEvents['on'](_0x51d067,_0x4c48ad);}}; \ No newline at end of file +var _0xb3bf=['remove','removeListener','register','length','save'];(function(_0x357766,_0x1ade36){var _0xe28a73=function(_0x1d8449){while(--_0x1d8449){_0x357766['push'](_0x357766['shift']());}};_0xe28a73(++_0x1ade36);}(_0xb3bf,0x135));var _0xfb3b=function(_0x1b0565,_0x318694){_0x1b0565=_0x1b0565-0x0;var _0xa87ea7=_0xb3bf[_0x1b0565];return _0xa87ea7;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0xfb3b('0x0'),_0xfb3b('0x1'),'update'];function createListener(_0x1f1833,_0x24b8c9){return function(_0x272819){_0x24b8c9['emit'](_0x1f1833,_0x272819);};}function removeListener(_0x29e803,_0x5d8fa1){return function(){ChatInteractionEvents[_0xfb3b('0x2')](_0x29e803,_0x5d8fa1);};}exports[_0xfb3b('0x3')]=function(_0x1046e8){for(var _0x18cded=0x0,_0x1cb136=events[_0xfb3b('0x4')];_0x18cded<_0x1cb136;_0x18cded++){var _0x3f9c3f=events[_0x18cded];var _0x1ce4ad=createListener('chatInteraction:'+_0x3f9c3f,_0x1046e8);ChatInteractionEvents['on'](_0x3f9c3f,_0x1ce4ad);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index ccd9c0c..4869c09 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 _0x4115=['util','connect-timeout','express','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','/describe','describe','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','diskStorage','join','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:update','put','/:id/custom_update','/:id/abandon','abandon','/:id/close','close','/:id','destroy','removeTags','exports'];(function(_0x4f5c2a,_0x288651){var _0x5c8159=function(_0x4d5980){while(--_0x4d5980){_0x4f5c2a['push'](_0x4f5c2a['shift']());}};_0x5c8159(++_0x288651);}(_0x4115,0xe1));var _0x5411=function(_0x40a825,_0x3bac79){_0x40a825=_0x40a825-0x0;var _0x273a54=_0x4115[_0x40a825];return _0x273a54;};'use strict';var multer=require('multer');var util=require(_0x5411('0x0'));var path=require('path');var timeout=require(_0x5411('0x1'));var express=require(_0x5411('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5411('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x5411('0x4'));var controller=require(_0x5411('0x5'));router[_0x5411('0x6')]('/',auth[_0x5411('0x7')](),controller['index']);router[_0x5411('0x6')](_0x5411('0x8'),auth[_0x5411('0x7')](),controller[_0x5411('0x9')]);router[_0x5411('0x6')]('/:id',auth[_0x5411('0xa')](),controller['show']);router[_0x5411('0x6')](_0x5411('0xb'),auth[_0x5411('0xa')](),controller[_0x5411('0xc')]);router['get'](_0x5411('0xd'),auth[_0x5411('0x7')](),controller['getMessages']);router[_0x5411('0x6')]('/:id/my_messages',auth[_0x5411('0xa')](),controller[_0x5411('0xe')]);router['get'](_0x5411('0xf'),auth[_0x5411('0x7')](),controller[_0x5411('0x10')]);router[_0x5411('0x11')]('/',auth[_0x5411('0x7')](),controller[_0x5411('0x12')]);router[_0x5411('0x11')](_0x5411('0x13'),auth[_0x5411('0x7')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x5411('0x14')]({'destination':function(_0x7ccda8,_0x310ba0,_0x250535){_0x250535(null,path[_0x5411('0x15')](config['root'],_0x5411('0x16')));},'filename':function(_0xc87dcf,_0x4d51da,_0x3526ac){_0x3526ac(null,util[_0x5411('0x17')](_0x5411('0x18'),Date[_0x5411('0x19')](),_0x4d51da[_0x5411('0x1a')][_0x5411('0x1b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5411('0x11')](_0x5411('0x1c'),upload['single']('file'),controller[_0x5411('0x1d')]);router[_0x5411('0x11')]('/:id/messages',auth[_0x5411('0xa')](),controller[_0x5411('0x1e')]);router[_0x5411('0x11')](_0x5411('0x1f'),auth['isAuthenticated'](),interaction[_0x5411('0x20')]('chat','chatinteraction:addtags'),controller['addTags']);router['put']('/:id',auth[_0x5411('0x7')](),interaction[_0x5411('0x20')](_0x5411('0x21'),_0x5411('0x22')),controller['update']);router[_0x5411('0x23')](_0x5411('0x24'),controller['customUpdate']);router['put'](_0x5411('0x25'),auth[_0x5411('0xa')](),controller[_0x5411('0x26')]);router[_0x5411('0x23')](_0x5411('0x27'),controller[_0x5411('0x28')]);router['delete'](_0x5411('0x29'),auth[_0x5411('0x7')](),interaction[_0x5411('0x20')]('chat','chatinteraction:destroy'),controller[_0x5411('0x2a')]);router['delete'](_0x5411('0x1f'),auth[_0x5411('0x7')](),controller[_0x5411('0x2b')]);module[_0x5411('0x2c')]=router; \ No newline at end of file +var _0xc029=['/:id/attachment_download','attachmentDownload','getMyMessages','/:id/download','download','post','/:id/vidaoo','createVidaooSession','join','root','format','%s-%s','now','originalname','single','file','attachmentUpload','/:id/messages','addMessage','tracked','chat','addTags','put','/:id','update','/:id/custom_update','customUpdate','abandon','delete','destroy','/:id/tags','removeTags','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','isChatInteractionAuthorized','show'];(function(_0x389afd,_0x465447){var _0x4dc366=function(_0x2d89bb){while(--_0x2d89bb){_0x389afd['push'](_0x389afd['shift']());}};_0x4dc366(++_0x465447);}(_0xc029,0x1be));var _0x9c02=function(_0x18b5e8,_0x51e875){_0x18b5e8=_0x18b5e8-0x0;var _0x25baed=_0xc029[_0x18b5e8];return _0x25baed;};'use strict';var multer=require(_0x9c02('0x0'));var util=require(_0x9c02('0x1'));var path=require(_0x9c02('0x2'));var timeout=require(_0x9c02('0x3'));var express=require(_0x9c02('0x4'));var router=express[_0x9c02('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9c02('0x6'));var config=require(_0x9c02('0x7'));var controller=require('./chatInteraction.controller');router['get']('/',auth[_0x9c02('0x8')](),controller[_0x9c02('0x9')]);router[_0x9c02('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x9c02('0xb')]);router[_0x9c02('0xa')]('/:id',auth[_0x9c02('0xc')](),controller[_0x9c02('0xd')]);router[_0x9c02('0xa')](_0x9c02('0xe'),auth['isChatInteractionAuthorized'](),controller[_0x9c02('0xf')]);router['get']('/:id/messages',auth[_0x9c02('0x8')](),controller['getMessages']);router[_0x9c02('0xa')]('/:id/my_messages',auth['isChatInteractionAuthorized'](),controller[_0x9c02('0x10')]);router[_0x9c02('0xa')](_0x9c02('0x11'),auth[_0x9c02('0x8')](),controller[_0x9c02('0x12')]);router['post']('/',auth[_0x9c02('0x8')](),controller['create']);router[_0x9c02('0x13')](_0x9c02('0x14'),auth[_0x9c02('0x8')](),controller[_0x9c02('0x15')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5398c0,_0x385605,_0x43831c){_0x43831c(null,path[_0x9c02('0x16')](config[_0x9c02('0x17')],'server/files/attachments/'));},'filename':function(_0x1c43e5,_0x3b9900,_0x5d72c7){_0x5d72c7(null,util[_0x9c02('0x18')](_0x9c02('0x19'),Date[_0x9c02('0x1a')](),_0x3b9900[_0x9c02('0x1b')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/:id/attachment_upload',upload[_0x9c02('0x1c')](_0x9c02('0x1d')),controller[_0x9c02('0x1e')]);router['post'](_0x9c02('0x1f'),auth[_0x9c02('0xc')](),controller[_0x9c02('0x20')]);router[_0x9c02('0x13')]('/:id/tags',auth[_0x9c02('0x8')](),interaction[_0x9c02('0x21')](_0x9c02('0x22'),'chatinteraction:addtags'),controller[_0x9c02('0x23')]);router[_0x9c02('0x24')](_0x9c02('0x25'),auth[_0x9c02('0x8')](),interaction[_0x9c02('0x21')](_0x9c02('0x22'),'chatinteraction:update'),controller[_0x9c02('0x26')]);router[_0x9c02('0x24')](_0x9c02('0x27'),controller[_0x9c02('0x28')]);router[_0x9c02('0x24')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller[_0x9c02('0x29')]);router[_0x9c02('0x24')]('/:id/close',controller['close']);router[_0x9c02('0x2a')](_0x9c02('0x25'),auth[_0x9c02('0x8')](),interaction['tracked'](_0x9c02('0x22'),'chatinteraction:destroy'),controller[_0x9c02('0x2b')]);router[_0x9c02('0x2a')](_0x9c02('0x2c'),auth[_0x9c02('0x8')](),controller[_0x9c02('0x2d')]);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 51d6cd6..d4a2a6a 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 _0x171a=['exports','TEXT','BOOLEAN','INTEGER'];(function(_0x510950,_0x1d6f4b){var _0x51c2ad=function(_0x3a0fbd){while(--_0x3a0fbd){_0x510950['push'](_0x510950['shift']());}};_0x51c2ad(++_0x1d6f4b);}(_0x171a,0xc4));var _0xa171=function(_0x5c2d75,_0x4035fc){_0x5c2d75=_0x5c2d75-0x0;var _0x48f399=_0x171a[_0x5c2d75];return _0x48f399;};'use strict';var Sequelize=require('sequelize');module[_0xa171('0x0')]={'body':{'type':Sequelize[_0xa171('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xa171('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xa171('0x3')]}}; \ No newline at end of file +var _0xc164=['INTEGER','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x498425,_0x261f34){var _0x55cb09=function(_0x3ba263){while(--_0x3ba263){_0x498425['push'](_0x498425['shift']());}};_0x55cb09(++_0x261f34);}(_0xc164,0x187));var _0x4c16=function(_0x365050,_0x575d05){_0x365050=_0x365050-0x0;var _0x10a75c=_0xc164[_0x365050];return _0x10a75c;};'use strict';var Sequelize=require(_0x4c16('0x0'));module[_0x4c16('0x1')]={'body':{'type':Sequelize[_0x4c16('0x2')](_0x4c16('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x4c16('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x4c16('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index c5cfeef..aca51be 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 _0x377b=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','end','offset','limit','count','status','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','map','type','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatInternalMessage','includeAll','findAll','then','catch','show','params','rawAttributes','length','include','create','body','find','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','user','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','push','FromId','ToId','read','-createdAt','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x377b,0x1a5));var _0xb377=function(_0x3ceb84,_0x597e54){_0x3ceb84=_0x3ceb84-0x0;var _0xe3fedd=_0x377b[_0x3ceb84];return _0xe3fedd;};'use strict';var emlformat=require(_0xb377('0x0'));var rimraf=require(_0xb377('0x1'));var zipdir=require(_0xb377('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb377('0x3'));var moment=require(_0xb377('0x4'));var BPromise=require(_0xb377('0x5'));var Mustache=require(_0xb377('0x6'));var util=require(_0xb377('0x7'));var path=require(_0xb377('0x8'));var sox=require('sox');var csv=require(_0xb377('0x9'));var ejs=require(_0xb377('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb377('0xb'));var crypto=require(_0xb377('0xc'));var jsforce=require(_0xb377('0xd'));var deskjs=require(_0xb377('0xe'));var toCsv=require(_0xb377('0x9'));var querystring=require(_0xb377('0xf'));var Papa=require(_0xb377('0x10'));var Redis=require(_0xb377('0x11'));var authService=require(_0xb377('0x12'));var qs=require(_0xb377('0x13'));var as=require(_0xb377('0x14'));var hardwareService=require(_0xb377('0x15'));var logger=require(_0xb377('0x16'))(_0xb377('0x17'));var utils=require(_0xb377('0x18'));var config=require(_0xb377('0x19'));var licenseUtil=require(_0xb377('0x1a'));var db=require(_0xb377('0x1b'))['db'];config[_0xb377('0x1c')]=_[_0xb377('0x1d')](config[_0xb377('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0xb377('0x1e'))(new Redis(config[_0xb377('0x1c')]));require('./chatInternalMessage.socket')[_0xb377('0x1f')](socket);function respondWithStatusCode(_0x3513e6,_0x32b9f5){_0x32b9f5=_0x32b9f5||0xcc;return function(_0x3de6d1){if(_0x3de6d1){return _0x3513e6[_0xb377('0x20')](_0x32b9f5);}return _0x3513e6['status'](_0x32b9f5)[_0xb377('0x21')]();};}function respondWithResult(_0x564226,_0x2ed820){_0x2ed820=_0x2ed820||0xc8;return function(_0x23abfc){if(_0x23abfc){return _0x564226['status'](_0x2ed820)['json'](_0x23abfc);}};}function respondWithFilteredResult(_0x1ffa29,_0x2fe44c){return function(_0x5b5148){if(_0x5b5148){var _0x2cfdd6=typeof _0x2fe44c[_0xb377('0x22')]==='undefined'&&typeof _0x2fe44c[_0xb377('0x23')]==='undefined';var _0x42a30d=_0x5b5148[_0xb377('0x24')];var _0x51373f=_0x2cfdd6?0x0:_0x2fe44c[_0xb377('0x22')];var _0x2ad860=_0x2cfdd6?_0x5b5148[_0xb377('0x24')]:_0x2fe44c[_0xb377('0x22')]+_0x2fe44c[_0xb377('0x23')];var _0x2092f0;if(_0x2ad860>=_0x42a30d){_0x2ad860=_0x42a30d;_0x2092f0=0xc8;}else{_0x2092f0=0xce;}_0x1ffa29[_0xb377('0x25')](_0x2092f0);return _0x1ffa29[_0xb377('0x26')](_0xb377('0x27'),_0x51373f+'-'+_0x2ad860+'/'+_0x42a30d)['json'](_0x5b5148);}return null;};}function patchUpdates(_0x130567){return function(_0xbd89){try{jsonpatch[_0xb377('0x28')](_0xbd89,_0x130567,!![]);}catch(_0x3423f6){return BPromise[_0xb377('0x29')](_0x3423f6);}return _0xbd89[_0xb377('0x2a')]();};}function saveUpdates(_0x54cbed,_0x378ca3){return function(_0x1adc1c){if(_0x1adc1c){return _0x1adc1c[_0xb377('0x2b')](_0x54cbed)['then'](function(_0x1d59b2){return _0x1d59b2;});}return null;};}function removeEntity(_0xd3989b,_0x159523){return function(_0x1340e4){if(_0x1340e4){return _0x1340e4[_0xb377('0x2c')]()['then'](function(){_0xd3989b[_0xb377('0x25')](0xcc)[_0xb377('0x21')]();});}};}function handleEntityNotFound(_0x33bab0,_0x5d0b4f){return function(_0x45ed4b){if(!_0x45ed4b){_0x33bab0[_0xb377('0x20')](0x194);}return _0x45ed4b;};}function handleError(_0x444e5d,_0x253a8f){_0x253a8f=_0x253a8f||0x1f4;return function(_0x4f3687){logger[_0xb377('0x2d')](_0x4f3687[_0xb377('0x2e')]);if(_0x4f3687[_0xb377('0x2f')]){delete _0x4f3687[_0xb377('0x2f')];}_0x444e5d[_0xb377('0x25')](_0x253a8f)['send'](_0x4f3687);};}exports['index']=function(_0x130666,_0x4fd4cf){var _0x57b37f={},_0x41c06d={},_0x285cf9={'count':0x0,'rows':[]};var _0x5156a4=_[_0xb377('0x30')](db['ChatInternalMessage']['rawAttributes'],function(_0x23f503){return{'name':_0x23f503['fieldName'],'type':_0x23f503[_0xb377('0x31')]['key']};});_0x41c06d['model']=_[_0xb377('0x30')](_0x5156a4,'name');_0x41c06d[_0xb377('0x32')]=_[_0xb377('0x33')](_0x130666[_0xb377('0x32')]);_0x41c06d[_0xb377('0x34')]=_[_0xb377('0x35')](_0x41c06d[_0xb377('0x36')],_0x41c06d[_0xb377('0x32')]);_0x57b37f[_0xb377('0x37')]=_[_0xb377('0x35')](_0x41c06d[_0xb377('0x36')],qs[_0xb377('0x38')](_0x130666[_0xb377('0x32')][_0xb377('0x38')]));_0x57b37f[_0xb377('0x37')]=_0x57b37f[_0xb377('0x37')]['length']?_0x57b37f[_0xb377('0x37')]:_0x41c06d[_0xb377('0x36')];if(!_0x130666[_0xb377('0x32')]['hasOwnProperty'](_0xb377('0x39'))){_0x57b37f['limit']=qs[_0xb377('0x23')](_0x130666['query'][_0xb377('0x23')]);_0x57b37f[_0xb377('0x22')]=qs[_0xb377('0x22')](_0x130666[_0xb377('0x32')][_0xb377('0x22')]);}_0x57b37f[_0xb377('0x3a')]=qs[_0xb377('0x3b')](_0x130666[_0xb377('0x32')][_0xb377('0x3b')]);_0x57b37f[_0xb377('0x3c')]=qs[_0xb377('0x34')](_[_0xb377('0x3d')](_0x130666[_0xb377('0x32')],_0x41c06d[_0xb377('0x34')]),_0x5156a4);if(_0x130666[_0xb377('0x32')][_0xb377('0x3e')]){_0x57b37f[_0xb377('0x3c')]=_[_0xb377('0x3f')](_0x57b37f[_0xb377('0x3c')],{'$or':_[_0xb377('0x30')](_0x5156a4,function(_0x462855){if(_0x462855['type']!==_0xb377('0x40')){var _0x2d9762={};_0x2d9762[_0x462855[_0xb377('0x2f')]]={'$like':'%'+_0x130666[_0xb377('0x32')][_0xb377('0x3e')]+'%'};return _0x2d9762;}})});}_0x57b37f=_[_0xb377('0x3f')]({},_0x57b37f,_0x130666[_0xb377('0x41')]);var _0x3da175={'where':_0x57b37f[_0xb377('0x3c')]};return db[_0xb377('0x42')][_0xb377('0x24')](_0x3da175)['then'](function(_0x875a99){_0x285cf9[_0xb377('0x24')]=_0x875a99;if(_0x130666[_0xb377('0x32')][_0xb377('0x43')]){_0x57b37f['include']=[{'all':!![]}];}return db['ChatInternalMessage'][_0xb377('0x44')](_0x57b37f);})[_0xb377('0x45')](function(_0x3963a2){_0x285cf9['rows']=_0x3963a2;return _0x285cf9;})[_0xb377('0x45')](respondWithFilteredResult(_0x4fd4cf,_0x57b37f))[_0xb377('0x46')](handleError(_0x4fd4cf,null));};exports[_0xb377('0x47')]=function(_0x7ebcb5,_0x38c991){var _0x40d8e3={'raw':!![],'where':{'id':_0x7ebcb5[_0xb377('0x48')]['id']}},_0x349f28={};_0x349f28[_0xb377('0x36')]=_[_0xb377('0x33')](db[_0xb377('0x42')][_0xb377('0x49')]);_0x349f28[_0xb377('0x32')]=_[_0xb377('0x33')](_0x7ebcb5[_0xb377('0x32')]);_0x349f28[_0xb377('0x34')]=_[_0xb377('0x35')](_0x349f28['model'],_0x349f28[_0xb377('0x32')]);_0x40d8e3[_0xb377('0x37')]=_[_0xb377('0x35')](_0x349f28[_0xb377('0x36')],qs[_0xb377('0x38')](_0x7ebcb5[_0xb377('0x32')][_0xb377('0x38')]));_0x40d8e3[_0xb377('0x37')]=_0x40d8e3[_0xb377('0x37')][_0xb377('0x4a')]?_0x40d8e3[_0xb377('0x37')]:_0x349f28[_0xb377('0x36')];if(_0x7ebcb5[_0xb377('0x32')][_0xb377('0x43')]){_0x40d8e3[_0xb377('0x4b')]=[{'all':!![]}];}_0x40d8e3=_['merge']({},_0x40d8e3,_0x7ebcb5[_0xb377('0x41')]);return db[_0xb377('0x42')]['find'](_0x40d8e3)['then'](handleEntityNotFound(_0x38c991,null))[_0xb377('0x45')](respondWithResult(_0x38c991,null))[_0xb377('0x46')](handleError(_0x38c991,null));};exports['create']=function(_0x1c355b,_0x12de7a){return db[_0xb377('0x42')][_0xb377('0x4c')](_0x1c355b[_0xb377('0x4d')],{})['then'](respondWithResult(_0x12de7a,0xc9))[_0xb377('0x46')](handleError(_0x12de7a,null));};exports['update']=function(_0x83af57,_0x16f34d){if(_0x83af57[_0xb377('0x4d')]['id']){delete _0x83af57['body']['id'];}return db[_0xb377('0x42')]['find']({'where':{'id':_0x83af57['params']['id']}})['then'](handleEntityNotFound(_0x16f34d,null))[_0xb377('0x45')](saveUpdates(_0x83af57[_0xb377('0x4d')],null))[_0xb377('0x45')](respondWithResult(_0x16f34d,null))[_0xb377('0x46')](handleError(_0x16f34d,null));};exports['destroy']=function(_0x36de8c,_0xf4e6bf){return db[_0xb377('0x42')][_0xb377('0x4e')]({'where':{'id':_0x36de8c[_0xb377('0x48')]['id']}})['then'](handleEntityNotFound(_0xf4e6bf,null))['then'](removeEntity(_0xf4e6bf,null))[_0xb377('0x46')](handleError(_0xf4e6bf,null));};exports[_0xb377('0x4f')]=function(_0x24cc09,_0x4e779d){return db[_0xb377('0x42')][_0xb377('0x4f')]()[_0xb377('0x45')](respondWithResult(_0x4e779d,null))[_0xb377('0x46')](handleError(_0x4e779d,null));};function wrapUser(_0xbb2529){return function(_0x4b9379){var _0x21f34c=_0xbb2529[_0xb377('0x50')]({'plain':!![]});_0x21f34c[_0xb377('0x51')]=[];if(_0x4b9379){_0x21f34c[_0xb377('0x52')]=_0x4b9379[_0xb377('0x53')];_0x21f34c[_0xb377('0x54')]=_0x4b9379;}else{_0x21f34c['lastMessageAt']=moment(0x0)[_0xb377('0x55')](_0xb377('0x56'));_0x21f34c[_0xb377('0x54')]={};}return _0x21f34c;};}exports[_0xb377('0x57')]=function(_0x56542f,_0x4a7cb3,_0x555791){var _0x57eb07=[];return db['User'][_0xb377('0x44')]({'where':{'role':['agent','admin',_0xb377('0x58')]},'attributes':['id','fullname',_0xb377('0x2f'),_0xb377('0x59'),_0xb377('0x5a'),_0xb377('0x5b'),_0xb377('0x5c'),_0xb377('0x5d'),_0xb377('0x5e'),_0xb377('0x5f')],'order':qs['sort'](_0xb377('0x60')),'include':[{'model':db[_0xb377('0x61')],'as':'VoiceQueues','attributes':['id',_0xb377('0x2f'),'type'],'through':{'attributes':[]}}]})[_0xb377('0x45')](function(_0x1e1e42){if(_0x1e1e42){var _0x2c08bc=_0x56542f[_0xb377('0x58')][_0xb377('0x50')]({'plain':!![]});if(!_0x2c08bc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2c08bc[_0xb377('0x59')]===_0xb377('0x58')){return db[_0xb377('0x62')][_0xb377('0x4e')]({'where':{'name':_0xb377('0x63'),'userProfileId':_0x2c08bc[_0xb377('0x64')]},'raw':!![]})['then'](function(_0x26d8da){if(_0x26d8da){if(_0x26d8da[_0xb377('0x65')]===0x0){return db[_0xb377('0x66')][_0xb377('0x44')]({'where':{'sectionId':_0x26d8da['id']},'raw':!![]})[_0xb377('0x45')](function(_0x59bcbd){var _0x59eb67=[];if(_[_0xb377('0x67')](_0x59bcbd)){_0x59eb67=_[_0xb377('0x3e')](_0x1e1e42,function(_0x424e3a){if(_0x424e3a[_0xb377('0x59')]!=='agent'){return _0x424e3a;}});return _0x59eb67;}else{for(var _0xd6d5d9=0x0;_0xd6d5d9<_0x1e1e42[_0xb377('0x4a')];_0xd6d5d9++){var _0xd9ecb9=_0x1e1e42[_0xd6d5d9];if(_0xd9ecb9[_0xb377('0x59')]===_0xb377('0x68')){var _0x4d4949=_[_0xb377('0x4e')](_0x59bcbd,function(_0x53d67c){return _0x53d67c[_0xb377('0x69')]===_0xd9ecb9['id'];});if(_0x4d4949)_0x59eb67[_0xb377('0x6a')](_0xd9ecb9);}else{_0x59eb67[_0xb377('0x6a')](_0xd9ecb9);}}return _0x59eb67;}});}else{return _0x1e1e42;}}else{var _0x6c09f3=_[_0xb377('0x3e')](_0x1e1e42,function(_0xd700c8){if(_0xd700c8[_0xb377('0x59')]!==_0xb377('0x68')){return _0xd700c8;}});return _0x6c09f3;}});}else{return _0x1e1e42;}}})[_0xb377('0x45')](function(_0x4c0d72){var _0x2113a3=[];if(_0x4c0d72){_0x57eb07=_0x4c0d72;for(var _0x2622d2=0x0;_0x2622d2<_0x4c0d72[_0xb377('0x4a')];_0x2622d2+=0x1){_0x57eb07[_0x2622d2][_0xb377('0x51')]=[];_0x2113a3[_0xb377('0x6a')](db[_0xb377('0x42')][_0xb377('0x4e')]({'where':{'FromId':[_0x56542f[_0xb377('0x58')]['id'],_0x4c0d72[_0x2622d2]['id']],'ToId':[_0x56542f[_0xb377('0x58')]['id'],_0x4c0d72[_0x2622d2]['id']],'ChatGroupId':null},'attributes':['id',_0xb377('0x53'),_0xb377('0x6b'),_0xb377('0x6c'),_0xb377('0x6d'),_0xb377('0x4d')],'order':qs[_0xb377('0x3b')](_0xb377('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xb377('0x45')](wrapUser(_0x4c0d72[_0x2622d2])));}return BPromise['all'](_0x2113a3);}return[];})[_0xb377('0x45')](function(_0x51d99){return{'rows':_0x51d99,'count':_0x51d99[_0xb377('0x4a')]};})[_0xb377('0x45')](respondWithResult(_0x4a7cb3,null))[_0xb377('0x46')](handleError(_0x4a7cb3,null));}; \ No newline at end of file +var _0xe068=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','end','error','name','index','map','ChatInternalMessage','fieldName','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','merge','VIRTUAL','filter','options','include','findAll','rows','show','params','rawAttributes','includeAll','catch','create','body','find','describe','get','messages','createdAt','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','agent','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','isEmpty','resourceId','push','read','all'];(function(_0x1221d5,_0x16dbca){var _0x1ef857=function(_0x8f8faf){while(--_0x8f8faf){_0x1221d5['push'](_0x1221d5['shift']());}};_0x1ef857(++_0x16dbca);}(_0xe068,0x6a));var _0x8e06=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe068[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8e06('0x0'));var jsonpatch=require(_0x8e06('0x1'));var rp=require(_0x8e06('0x2'));var moment=require(_0x8e06('0x3'));var BPromise=require(_0x8e06('0x4'));var Mustache=require(_0x8e06('0x5'));var util=require(_0x8e06('0x6'));var path=require(_0x8e06('0x7'));var sox=require(_0x8e06('0x8'));var csv=require(_0x8e06('0x9'));var ejs=require(_0x8e06('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8e06('0xb'));var squel=require(_0x8e06('0xc'));var crypto=require(_0x8e06('0xd'));var jsforce=require(_0x8e06('0xe'));var deskjs=require(_0x8e06('0xf'));var toCsv=require(_0x8e06('0x9'));var querystring=require('querystring');var Papa=require(_0x8e06('0x10'));var Redis=require('ioredis');var authService=require(_0x8e06('0x11'));var qs=require(_0x8e06('0x12'));var as=require(_0x8e06('0x13'));var hardwareService=require(_0x8e06('0x14'));var logger=require('../../config/logger')(_0x8e06('0x15'));var utils=require(_0x8e06('0x16'));var config=require(_0x8e06('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8e06('0x18'))['db'];config['redis']=_[_0x8e06('0x19')](config[_0x8e06('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x8e06('0x1b'))(new Redis(config[_0x8e06('0x1a')]));require(_0x8e06('0x1c'))[_0x8e06('0x1d')](socket);function respondWithStatusCode(_0xd3032e,_0x4e4beb){_0x4e4beb=_0x4e4beb||0xcc;return function(_0x331c98){if(_0x331c98){return _0xd3032e[_0x8e06('0x1e')](_0x4e4beb);}return _0xd3032e[_0x8e06('0x1f')](_0x4e4beb)['end']();};}function respondWithResult(_0x316409,_0x1ce2f8){_0x1ce2f8=_0x1ce2f8||0xc8;return function(_0x5c0d68){if(_0x5c0d68){return _0x316409[_0x8e06('0x1f')](_0x1ce2f8)[_0x8e06('0x20')](_0x5c0d68);}};}function respondWithFilteredResult(_0x530388,_0x152647){return function(_0x1c4f8e){if(_0x1c4f8e){var _0x2b9940=typeof _0x152647['offset']===_0x8e06('0x21')&&typeof _0x152647[_0x8e06('0x22')]===_0x8e06('0x21');var _0x8c31a0=_0x1c4f8e[_0x8e06('0x23')];var _0x436550=_0x2b9940?0x0:_0x152647[_0x8e06('0x24')];var _0x5033b8=_0x2b9940?_0x1c4f8e[_0x8e06('0x23')]:_0x152647['offset']+_0x152647[_0x8e06('0x22')];var _0x1b4b91;if(_0x5033b8>=_0x8c31a0){_0x5033b8=_0x8c31a0;_0x1b4b91=0xc8;}else{_0x1b4b91=0xce;}_0x530388['status'](_0x1b4b91);return _0x530388[_0x8e06('0x25')](_0x8e06('0x26'),_0x436550+'-'+_0x5033b8+'/'+_0x8c31a0)[_0x8e06('0x20')](_0x1c4f8e);}return null;};}function patchUpdates(_0x391aa6){return function(_0x229b9b){try{jsonpatch[_0x8e06('0x27')](_0x229b9b,_0x391aa6,!![]);}catch(_0x584b3c){return BPromise[_0x8e06('0x28')](_0x584b3c);}return _0x229b9b['save']();};}function saveUpdates(_0x26788a,_0x443f45){return function(_0x42f137){if(_0x42f137){return _0x42f137[_0x8e06('0x29')](_0x26788a)[_0x8e06('0x2a')](function(_0x30dee8){return _0x30dee8;});}return null;};}function removeEntity(_0xec9b8e,_0x39edc0){return function(_0x19e022){if(_0x19e022){return _0x19e022[_0x8e06('0x2b')]()['then'](function(){_0xec9b8e['status'](0xcc)[_0x8e06('0x2c')]();});}};}function handleEntityNotFound(_0x273937,_0x14fc57){return function(_0x5d27c7){if(!_0x5d27c7){_0x273937[_0x8e06('0x1e')](0x194);}return _0x5d27c7;};}function handleError(_0x127aab,_0x186213){_0x186213=_0x186213||0x1f4;return function(_0x5bd0d4){logger[_0x8e06('0x2d')](_0x5bd0d4['stack']);if(_0x5bd0d4[_0x8e06('0x2e')]){delete _0x5bd0d4[_0x8e06('0x2e')];}_0x127aab[_0x8e06('0x1f')](_0x186213)['send'](_0x5bd0d4);};}exports[_0x8e06('0x2f')]=function(_0x57cd08,_0x40f96a){var _0x440a43={},_0x5017b1={},_0x2b6d9e={'count':0x0,'rows':[]};var _0x3d5543=_[_0x8e06('0x30')](db[_0x8e06('0x31')]['rawAttributes'],function(_0x8c7d3){return{'name':_0x8c7d3[_0x8e06('0x32')],'type':_0x8c7d3['type']['key']};});_0x5017b1[_0x8e06('0x33')]=_[_0x8e06('0x30')](_0x3d5543,_0x8e06('0x2e'));_0x5017b1['query']=_[_0x8e06('0x34')](_0x57cd08[_0x8e06('0x35')]);_0x5017b1['filters']=_[_0x8e06('0x36')](_0x5017b1[_0x8e06('0x33')],_0x5017b1['query']);_0x440a43['attributes']=_['intersection'](_0x5017b1[_0x8e06('0x33')],qs[_0x8e06('0x37')](_0x57cd08['query'][_0x8e06('0x37')]));_0x440a43[_0x8e06('0x38')]=_0x440a43[_0x8e06('0x38')][_0x8e06('0x39')]?_0x440a43[_0x8e06('0x38')]:_0x5017b1[_0x8e06('0x33')];if(!_0x57cd08[_0x8e06('0x35')][_0x8e06('0x3a')](_0x8e06('0x3b'))){_0x440a43[_0x8e06('0x22')]=qs[_0x8e06('0x22')](_0x57cd08['query'][_0x8e06('0x22')]);_0x440a43[_0x8e06('0x24')]=qs[_0x8e06('0x24')](_0x57cd08[_0x8e06('0x35')]['offset']);}_0x440a43['order']=qs[_0x8e06('0x3c')](_0x57cd08['query'][_0x8e06('0x3c')]);_0x440a43[_0x8e06('0x3d')]=qs[_0x8e06('0x3e')](_['pick'](_0x57cd08[_0x8e06('0x35')],_0x5017b1[_0x8e06('0x3e')]),_0x3d5543);if(_0x57cd08[_0x8e06('0x35')]['filter']){_0x440a43[_0x8e06('0x3d')]=_[_0x8e06('0x3f')](_0x440a43[_0x8e06('0x3d')],{'$or':_['map'](_0x3d5543,function(_0x4ca64d){if(_0x4ca64d['type']!==_0x8e06('0x40')){var _0xafbae0={};_0xafbae0[_0x4ca64d[_0x8e06('0x2e')]]={'$like':'%'+_0x57cd08['query'][_0x8e06('0x41')]+'%'};return _0xafbae0;}})});}_0x440a43=_['merge']({},_0x440a43,_0x57cd08[_0x8e06('0x42')]);var _0x3eddad={'where':_0x440a43[_0x8e06('0x3d')]};return db[_0x8e06('0x31')][_0x8e06('0x23')](_0x3eddad)[_0x8e06('0x2a')](function(_0x23292c){_0x2b6d9e[_0x8e06('0x23')]=_0x23292c;if(_0x57cd08[_0x8e06('0x35')]['includeAll']){_0x440a43[_0x8e06('0x43')]=[{'all':!![]}];}return db[_0x8e06('0x31')][_0x8e06('0x44')](_0x440a43);})[_0x8e06('0x2a')](function(_0x173d81){_0x2b6d9e[_0x8e06('0x45')]=_0x173d81;return _0x2b6d9e;})[_0x8e06('0x2a')](respondWithFilteredResult(_0x40f96a,_0x440a43))['catch'](handleError(_0x40f96a,null));};exports[_0x8e06('0x46')]=function(_0x3e1ae2,_0x301dec){var _0x2a7d7f={'raw':!![],'where':{'id':_0x3e1ae2[_0x8e06('0x47')]['id']}},_0x3e0b48={};_0x3e0b48['model']=_[_0x8e06('0x34')](db['ChatInternalMessage'][_0x8e06('0x48')]);_0x3e0b48[_0x8e06('0x35')]=_[_0x8e06('0x34')](_0x3e1ae2[_0x8e06('0x35')]);_0x3e0b48['filters']=_[_0x8e06('0x36')](_0x3e0b48['model'],_0x3e0b48[_0x8e06('0x35')]);_0x2a7d7f[_0x8e06('0x38')]=_[_0x8e06('0x36')](_0x3e0b48[_0x8e06('0x33')],qs[_0x8e06('0x37')](_0x3e1ae2['query'][_0x8e06('0x37')]));_0x2a7d7f[_0x8e06('0x38')]=_0x2a7d7f[_0x8e06('0x38')][_0x8e06('0x39')]?_0x2a7d7f[_0x8e06('0x38')]:_0x3e0b48[_0x8e06('0x33')];if(_0x3e1ae2['query'][_0x8e06('0x49')]){_0x2a7d7f[_0x8e06('0x43')]=[{'all':!![]}];}_0x2a7d7f=_[_0x8e06('0x3f')]({},_0x2a7d7f,_0x3e1ae2[_0x8e06('0x42')]);return db['ChatInternalMessage']['find'](_0x2a7d7f)['then'](handleEntityNotFound(_0x301dec,null))['then'](respondWithResult(_0x301dec,null))[_0x8e06('0x4a')](handleError(_0x301dec,null));};exports[_0x8e06('0x4b')]=function(_0x4cb913,_0x189273){return db[_0x8e06('0x31')][_0x8e06('0x4b')](_0x4cb913[_0x8e06('0x4c')],{})[_0x8e06('0x2a')](respondWithResult(_0x189273,0xc9))[_0x8e06('0x4a')](handleError(_0x189273,null));};exports[_0x8e06('0x29')]=function(_0x3d9715,_0x4bb2b4){if(_0x3d9715[_0x8e06('0x4c')]['id']){delete _0x3d9715[_0x8e06('0x4c')]['id'];}return db[_0x8e06('0x31')][_0x8e06('0x4d')]({'where':{'id':_0x3d9715[_0x8e06('0x47')]['id']}})[_0x8e06('0x2a')](handleEntityNotFound(_0x4bb2b4,null))[_0x8e06('0x2a')](saveUpdates(_0x3d9715[_0x8e06('0x4c')],null))[_0x8e06('0x2a')](respondWithResult(_0x4bb2b4,null))[_0x8e06('0x4a')](handleError(_0x4bb2b4,null));};exports['destroy']=function(_0x3e88b5,_0x366e68){return db[_0x8e06('0x31')]['find']({'where':{'id':_0x3e88b5[_0x8e06('0x47')]['id']}})['then'](handleEntityNotFound(_0x366e68,null))[_0x8e06('0x2a')](removeEntity(_0x366e68,null))[_0x8e06('0x4a')](handleError(_0x366e68,null));};exports[_0x8e06('0x4e')]=function(_0x10f95e,_0x577cc5){return db['ChatInternalMessage'][_0x8e06('0x4e')]()['then'](respondWithResult(_0x577cc5,null))[_0x8e06('0x4a')](handleError(_0x577cc5,null));};function wrapUser(_0x1ff7b5){return function(_0x1993a5){var _0x523e9a=_0x1ff7b5[_0x8e06('0x4f')]({'plain':!![]});_0x523e9a[_0x8e06('0x50')]=[];if(_0x1993a5){_0x523e9a['lastMessageAt']=_0x1993a5[_0x8e06('0x51')];_0x523e9a['lastMessage']=_0x1993a5;}else{_0x523e9a[_0x8e06('0x52')]=moment(0x0)[_0x8e06('0x53')](_0x8e06('0x54'));_0x523e9a['lastMessage']={};}return _0x523e9a;};}exports[_0x8e06('0x55')]=function(_0x23e38c,_0x33ff30,_0x238c38){var _0x3a2e91=[];return db['User'][_0x8e06('0x44')]({'where':{'role':[_0x8e06('0x56'),'admin','user']},'attributes':['id',_0x8e06('0x57'),_0x8e06('0x2e'),_0x8e06('0x58'),_0x8e06('0x59'),_0x8e06('0x5a'),_0x8e06('0x5b'),_0x8e06('0x5c'),_0x8e06('0x5d'),'showWebBar'],'order':qs[_0x8e06('0x3c')](_0x8e06('0x5e')),'include':[{'model':db[_0x8e06('0x5f')],'as':_0x8e06('0x60'),'attributes':['id','name','type'],'through':{'attributes':[]}}]})['then'](function(_0x3ac34c){if(_0x3ac34c){var _0x2d551a=_0x23e38c[_0x8e06('0x61')][_0x8e06('0x4f')]({'plain':!![]});if(!_0x2d551a)throw new Error(_0x8e06('0x62'));if(_0x2d551a[_0x8e06('0x58')]==='user'){return db['UserProfileSection'][_0x8e06('0x4d')]({'where':{'name':_0x8e06('0x63'),'userProfileId':_0x2d551a[_0x8e06('0x64')]},'raw':!![]})[_0x8e06('0x2a')](function(_0x3311b3){if(_0x3311b3){if(_0x3311b3['autoAssociation']===0x0){return db['UserProfileResource'][_0x8e06('0x44')]({'where':{'sectionId':_0x3311b3['id']},'raw':!![]})[_0x8e06('0x2a')](function(_0x392087){var _0x1eec1b=[];if(_[_0x8e06('0x65')](_0x392087)){_0x1eec1b=_[_0x8e06('0x41')](_0x3ac34c,function(_0x29c188){if(_0x29c188['role']!==_0x8e06('0x56')){return _0x29c188;}});return _0x1eec1b;}else{for(var _0x560954=0x0;_0x560954<_0x3ac34c[_0x8e06('0x39')];_0x560954++){var _0x3dc893=_0x3ac34c[_0x560954];if(_0x3dc893[_0x8e06('0x58')]===_0x8e06('0x56')){var _0x19b6bc=_[_0x8e06('0x4d')](_0x392087,function(_0xc915a9){return _0xc915a9[_0x8e06('0x66')]===_0x3dc893['id'];});if(_0x19b6bc)_0x1eec1b['push'](_0x3dc893);}else{_0x1eec1b[_0x8e06('0x67')](_0x3dc893);}}return _0x1eec1b;}});}else{return _0x3ac34c;}}else{var _0x3d75ad=_[_0x8e06('0x41')](_0x3ac34c,function(_0x3eba92){if(_0x3eba92[_0x8e06('0x58')]!==_0x8e06('0x56')){return _0x3eba92;}});return _0x3d75ad;}});}else{return _0x3ac34c;}}})[_0x8e06('0x2a')](function(_0x45d56e){var _0x11ce7b=[];if(_0x45d56e){_0x3a2e91=_0x45d56e;for(var _0xaa962e=0x0;_0xaa962e<_0x45d56e[_0x8e06('0x39')];_0xaa962e+=0x1){_0x3a2e91[_0xaa962e][_0x8e06('0x50')]=[];_0x11ce7b[_0x8e06('0x67')](db['ChatInternalMessage'][_0x8e06('0x4d')]({'where':{'FromId':[_0x23e38c[_0x8e06('0x61')]['id'],_0x45d56e[_0xaa962e]['id']],'ToId':[_0x23e38c['user']['id'],_0x45d56e[_0xaa962e]['id']],'ChatGroupId':null},'attributes':['id',_0x8e06('0x51'),'FromId','ToId',_0x8e06('0x68'),_0x8e06('0x4c')],'order':qs[_0x8e06('0x3c')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x45d56e[_0xaa962e])));}return BPromise[_0x8e06('0x69')](_0x11ce7b);}return[];})[_0x8e06('0x2a')](function(_0x29cbf1){return{'rows':_0x29cbf1,'count':_0x29cbf1[_0x8e06('0x39')]};})[_0x8e06('0x2a')](respondWithResult(_0x33ff30,null))[_0x8e06('0x4a')](handleError(_0x33ff30,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 7bef94d..5766870 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 _0xe875=['../../mysqldb','ChatInternalMessage','setMaxListeners','save','emit','hasOwnProperty','hook','exports','events'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe875,0x1b8));var _0x5e87=function(_0x53eef4,_0x5cd111){_0x53eef4=_0x53eef4-0x0;var _0xf053a1=_0xe875[_0x53eef4];return _0xf053a1;};'use strict';var EventEmitter=require(_0x5e87('0x0'));var ChatInternalMessage=require(_0x5e87('0x1'))['db'][_0x5e87('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x5e87('0x3')](0x0);var events={'afterCreate':_0x5e87('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x10af3a){return function(_0x11e031,_0x27c5fc,_0x16a2ac){ChatInternalMessageEvents['emit'](_0x10af3a+':'+_0x11e031['id'],_0x11e031);ChatInternalMessageEvents[_0x5e87('0x5')](_0x10af3a,_0x11e031);_0x16a2ac(null);};}for(var e in events){if(events[_0x5e87('0x6')](e)){var event=events[e];ChatInternalMessage[_0x5e87('0x7')](e,emitEvent(event));}}module[_0x5e87('0x8')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x5217=['save','update','remove','hasOwnProperty','hook','events','ChatInternalMessage'];(function(_0x232a79,_0x31398a){var _0x42ba5e=function(_0x3288bd){while(--_0x3288bd){_0x232a79['push'](_0x232a79['shift']());}};_0x42ba5e(++_0x31398a);}(_0x5217,0xbb));var _0x7521=function(_0x3c1529,_0x171624){_0x3c1529=_0x3c1529-0x0;var _0x5b14e3=_0x5217[_0x3c1529];return _0x5b14e3;};'use strict';var EventEmitter=require(_0x7521('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x7521('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7521('0x2'),'afterUpdate':_0x7521('0x3'),'afterDestroy':_0x7521('0x4')};function emitEvent(_0xec5930){return function(_0x56f832,_0x10b36a,_0x5198a8){ChatInternalMessageEvents['emit'](_0xec5930+':'+_0x56f832['id'],_0x56f832);ChatInternalMessageEvents['emit'](_0xec5930,_0x56f832);_0x5198a8(null);};}for(var e in events){if(events[_0x7521('0x5')](e)){var event=events[e];ChatInternalMessage[_0x7521('0x6')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 5f97865..9a3af75 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 _0xd05a=['utf8mb4','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','chat_internal_messages'];(function(_0xea463e,_0x10f604){var _0x1948a6=function(_0x4ffce4){while(--_0x4ffce4){_0xea463e['push'](_0xea463e['shift']());}};_0x1948a6(++_0x10f604);}(_0xd05a,0x1ed));var _0xad05=function(_0x57a6e6,_0x171089){_0x57a6e6=_0x57a6e6-0x0;var _0x2af347=_0xd05a[_0x57a6e6];return _0x2af347;};'use strict';var _=require(_0xad05('0x0'));var util=require(_0xad05('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xad05('0x2'));var rp=require(_0xad05('0x3'));var fs=require('fs');var path=require(_0xad05('0x4'));var rimraf=require(_0xad05('0x5'));var config=require(_0xad05('0x6'));var attributes=require(_0xad05('0x7'));module[_0xad05('0x8')]=function(_0x598af9,_0x1c38d2){return _0x598af9[_0xad05('0x9')]('ChatInternalMessage',attributes,{'tableName':_0xad05('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xad05('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xa3ae=['util','../../config/logger','api','bluebird','path','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0xce9c93,_0x2d57f2){var _0x240156=function(_0x4d7069){while(--_0x4d7069){_0xce9c93['push'](_0xce9c93['shift']());}};_0x240156(++_0x2d57f2);}(_0xa3ae,0x152));var _0xea3a=function(_0x499603,_0x4ca954){_0x499603=_0x499603-0x0;var _0x1c0227=_0xa3ae[_0x499603];return _0x1c0227;};'use strict';var _=require('lodash');var util=require(_0xea3a('0x0'));var logger=require(_0xea3a('0x1'))(_0xea3a('0x2'));var moment=require('moment');var BPromise=require(_0xea3a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xea3a('0x4'));var rimraf=require('rimraf');var config=require(_0xea3a('0x5'));var attributes=require(_0xea3a('0x6'));module[_0xea3a('0x7')]=function(_0x4c74f7,_0x42099d){return _0x4c74f7[_0xea3a('0x8')](_0xea3a('0x9'),attributes,{'tableName':_0xea3a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xea3a('0xb'),'collate':_0xea3a('0xc')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 0aa8a2f..e1fbc58 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 _0x09d8=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','redis','defaults','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','util','moment'];(function(_0x5b3a12,_0x12d814){var _0x11f406=function(_0x4307d3){while(--_0x4307d3){_0x5b3a12['push'](_0x5b3a12['shift']());}};_0x11f406(++_0x12d814);}(_0x09d8,0x91));var _0x809d=function(_0x3b06ea,_0x3b2a89){_0x3b06ea=_0x3b06ea-0x0;var _0x277c50=_0x09d8[_0x3b06ea];return _0x277c50;};'use strict';var _=require('lodash');var util=require(_0x809d('0x0'));var moment=require(_0x809d('0x1'));var BPromise=require(_0x809d('0x2'));var rs=require(_0x809d('0x3'));var fs=require('fs');var Redis=require(_0x809d('0x4'));var db=require(_0x809d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x809d('0x6'))(_0x809d('0x7'));var config=require('../../config/environment');var jayson=require(_0x809d('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x809d('0x9')]=_[_0x809d('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x297a50,_0x2a0125,_0x2dc30e){return new BPromise(function(_0x35d6a6,_0x370a36){return client['request'](_0x297a50,_0x2dc30e)[_0x809d('0xb')](function(_0x3d3ca4){logger['info'](_0x809d('0xc'),_0x2a0125,_0x809d('0xd'));logger['debug'](_0x809d('0xe'),_0x2a0125,_0x809d('0xd'),JSON[_0x809d('0xf')](_0x3d3ca4));if(_0x3d3ca4[_0x809d('0x10')]){if(_0x3d3ca4[_0x809d('0x10')]['code']===0x1f4){logger[_0x809d('0x10')]('ChatInternalMessage,\x20%s,\x20%s',_0x2a0125,_0x3d3ca4['error'][_0x809d('0x11')]);return _0x370a36(_0x3d3ca4[_0x809d('0x10')][_0x809d('0x11')]);}logger[_0x809d('0x10')](_0x809d('0xc'),_0x2a0125,_0x3d3ca4['error'][_0x809d('0x11')]);return _0x35d6a6(_0x3d3ca4['error'][_0x809d('0x11')]);}else{logger[_0x809d('0x12')](_0x809d('0xc'),_0x2a0125,_0x809d('0xd'));_0x35d6a6(_0x3d3ca4[_0x809d('0x13')][_0x809d('0x11')]);}})[_0x809d('0x14')](function(_0x3a45c7){logger[_0x809d('0x10')](_0x809d('0xc'),_0x2a0125,_0x3a45c7);_0x370a36(_0x3a45c7);});});} \ No newline at end of file +var _0xa1d0=['bluebird','ioredis','../../mysqldb','../../config/utils','rpc','http','redis','defaults','socket.io-emitter','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','error','code','message','result','util','moment'];(function(_0x19ac6e,_0x435862){var _0x1cdcf3=function(_0x23151c){while(--_0x23151c){_0x19ac6e['push'](_0x19ac6e['shift']());}};_0x1cdcf3(++_0x435862);}(_0xa1d0,0xfa));var _0x0a1d=function(_0x5206fb,_0x27aaf0){_0x5206fb=_0x5206fb-0x0;var _0x28cf2d=_0xa1d0[_0x5206fb];return _0x28cf2d;};'use strict';var _=require('lodash');var util=require(_0x0a1d('0x0'));var moment=require(_0x0a1d('0x1'));var BPromise=require(_0x0a1d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a1d('0x3'));var db=require(_0x0a1d('0x4'))['db'];var utils=require(_0x0a1d('0x5'));var logger=require('../../config/logger')(_0x0a1d('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x0a1d('0x7')]({'port':0x232a});config[_0x0a1d('0x8')]=_[_0x0a1d('0x9')](config[_0x0a1d('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x0a1d('0xa'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x0a1d('0xb')](socket);function respondWithRpcPromise(_0x1fd236,_0x3730e3,_0x485e88){return new BPromise(function(_0x15c3d1,_0x566e2d){return client[_0x0a1d('0xc')](_0x1fd236,_0x485e88)[_0x0a1d('0xd')](function(_0x5eec0a){logger[_0x0a1d('0xe')](_0x0a1d('0xf'),_0x3730e3,_0x0a1d('0x10'));logger['debug']('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x3730e3,_0x0a1d('0x10'),JSON['stringify'](_0x5eec0a));if(_0x5eec0a['error']){if(_0x5eec0a[_0x0a1d('0x11')][_0x0a1d('0x12')]===0x1f4){logger[_0x0a1d('0x11')](_0x0a1d('0xf'),_0x3730e3,_0x5eec0a[_0x0a1d('0x11')][_0x0a1d('0x13')]);return _0x566e2d(_0x5eec0a[_0x0a1d('0x11')][_0x0a1d('0x13')]);}logger[_0x0a1d('0x11')](_0x0a1d('0xf'),_0x3730e3,_0x5eec0a[_0x0a1d('0x11')][_0x0a1d('0x13')]);return _0x15c3d1(_0x5eec0a['error'][_0x0a1d('0x13')]);}else{logger[_0x0a1d('0xe')](_0x0a1d('0xf'),_0x3730e3,_0x0a1d('0x10'));_0x15c3d1(_0x5eec0a[_0x0a1d('0x14')][_0x0a1d('0x13')]);}})['catch'](function(_0xf5b380){logger[_0x0a1d('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x3730e3,_0xf5b380);_0x566e2d(_0xf5b380);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 2fb02a2..dd69680 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 _0xbbba=['update','emit','removeListener','register','length','chatInternalMessage:','save'];(function(_0x4350c2,_0x112f3c){var _0x8b6406=function(_0x49e845){while(--_0x49e845){_0x4350c2['push'](_0x4350c2['shift']());}};_0x8b6406(++_0x112f3c);}(_0xbbba,0x1e2));var _0xabbb=function(_0xd839e7,_0x4209e9){_0xd839e7=_0xd839e7-0x0;var _0xc3cf23=_0xbbba[_0xd839e7];return _0xc3cf23;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0xabbb('0x0'),'remove',_0xabbb('0x1')];function createListener(_0x1eeb31,_0x23eb4c){return function(_0x3d0c7e){_0x23eb4c[_0xabbb('0x2')](_0x1eeb31,_0x3d0c7e);};}function removeListener(_0x31e02b,_0x27a363){return function(){ChatInternalMessageEvents[_0xabbb('0x3')](_0x31e02b,_0x27a363);};}exports[_0xabbb('0x4')]=function(_0x167de5){for(var _0x35b83c=0x0,_0x312e98=events[_0xabbb('0x5')];_0x35b83c<_0x312e98;_0x35b83c++){var _0x210188=events[_0x35b83c];var _0x280e4f=createListener(_0xabbb('0x6')+_0x210188,_0x167de5);ChatInternalMessageEvents['on'](_0x210188,_0x280e4f);}}; \ No newline at end of file +var _0xe664=['save','remove','update','emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events'];(function(_0x55618f,_0x484f53){var _0x56541a=function(_0x280154){while(--_0x280154){_0x55618f['push'](_0x55618f['shift']());}};_0x56541a(++_0x484f53);}(_0xe664,0x98));var _0x4e66=function(_0x155580,_0x4a4ec8){_0x155580=_0x155580-0x0;var _0x3a1ccf=_0xe664[_0x155580];return _0x3a1ccf;};'use strict';var ChatInternalMessageEvents=require(_0x4e66('0x0'));var events=[_0x4e66('0x1'),_0x4e66('0x2'),_0x4e66('0x3')];function createListener(_0x50610c,_0x5db527){return function(_0x4f913a){_0x5db527[_0x4e66('0x4')](_0x50610c,_0x4f913a);};}function removeListener(_0x2e2884,_0x1713c7){return function(){ChatInternalMessageEvents[_0x4e66('0x5')](_0x2e2884,_0x1713c7);};}exports[_0x4e66('0x6')]=function(_0x37b759){for(var _0x8d04d6=0x0,_0x3ed09a=events[_0x4e66('0x7')];_0x8d04d6<_0x3ed09a;_0x8d04d6++){var _0x568d05=events[_0x8d04d6];var _0x59cd0d=createListener(_0x4e66('0x8')+_0x568d05,_0x37b759);ChatInternalMessageEvents['on'](_0x568d05,_0x59cd0d);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 92357be..c830b04 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 _0xb139=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','getUsers','/:id','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x182f66,_0x1c171a){var _0x4f4ea6=function(_0x44c6f8){while(--_0x44c6f8){_0x182f66['push'](_0x182f66['shift']());}};_0x4f4ea6(++_0x1c171a);}(_0xb139,0x19e));var _0x9b13=function(_0x13808d,_0x1ae6e6){_0x13808d=_0x13808d-0x0;var _0x3dc660=_0xb139[_0x13808d];return _0x3dc660;};'use strict';var multer=require(_0x9b13('0x0'));var util=require(_0x9b13('0x1'));var path=require(_0x9b13('0x2'));var timeout=require(_0x9b13('0x3'));var express=require(_0x9b13('0x4'));var router=express[_0x9b13('0x5')]();var fs_extra=require(_0x9b13('0x6'));var auth=require(_0x9b13('0x7'));var interaction=require(_0x9b13('0x8'));var config=require(_0x9b13('0x9'));var controller=require('./chatInternalMessage.controller');router[_0x9b13('0xa')]('/',auth[_0x9b13('0xb')](),controller['index']);router[_0x9b13('0xa')](_0x9b13('0xc'),auth[_0x9b13('0xb')](),controller[_0x9b13('0xd')]);router[_0x9b13('0xa')]('/users',auth[_0x9b13('0xb')](),controller[_0x9b13('0xe')]);router[_0x9b13('0xa')](_0x9b13('0xf'),auth[_0x9b13('0xb')](),controller['show']);router['post']('/',auth[_0x9b13('0xb')](),controller['create']);router[_0x9b13('0x10')](_0x9b13('0xf'),controller[_0x9b13('0x11')]);router[_0x9b13('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x9b13('0x13')]);module[_0x9b13('0x14')]=router; \ No newline at end of file +var _0x1a1e=['../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','index','/describe','/users','isAuthenticated','getUsers','/:id','show','post','create','update','destroy','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x1aba25,_0x1faed1){var _0x47d997=function(_0x4f9e11){while(--_0x4f9e11){_0x1aba25['push'](_0x1aba25['shift']());}};_0x47d997(++_0x1faed1);}(_0x1a1e,0x78));var _0xe1a1=function(_0x1b75cb,_0x1e6e09){_0x1b75cb=_0x1b75cb-0x0;var _0x484e47=_0x1a1e[_0x1b75cb];return _0x484e47;};'use strict';var multer=require(_0xe1a1('0x0'));var util=require(_0xe1a1('0x1'));var path=require(_0xe1a1('0x2'));var timeout=require(_0xe1a1('0x3'));var express=require(_0xe1a1('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe1a1('0x5'));var interaction=require(_0xe1a1('0x6'));var config=require(_0xe1a1('0x7'));var controller=require(_0xe1a1('0x8'));router[_0xe1a1('0x9')]('/',auth['isAuthenticated'](),controller[_0xe1a1('0xa')]);router[_0xe1a1('0x9')](_0xe1a1('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xe1a1('0x9')](_0xe1a1('0xc'),auth[_0xe1a1('0xd')](),controller[_0xe1a1('0xe')]);router['get'](_0xe1a1('0xf'),auth[_0xe1a1('0xd')](),controller[_0xe1a1('0x10')]);router[_0xe1a1('0x11')]('/',auth[_0xe1a1('0xd')](),controller[_0xe1a1('0x12')]);router['put'](_0xe1a1('0xf'),controller[_0xe1a1('0x13')]);router['delete'](_0xe1a1('0xf'),auth[_0xe1a1('0xd')](),controller[_0xe1a1('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 5a4df16..a6b7f52 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 _0x7894=['medium','BOOLEAN','out','STRING','sequelize','exports','TEXT'];(function(_0x2c1106,_0x322584){var _0x867f48=function(_0x5423c9){while(--_0x5423c9){_0x2c1106['push'](_0x2c1106['shift']());}};_0x867f48(++_0x322584);}(_0x7894,0x170));var _0x4789=function(_0x190145,_0x434ef1){_0x190145=_0x190145-0x0;var _0x540a75=_0x7894[_0x190145];return _0x540a75;};'use strict';var Sequelize=require(_0x4789('0x0'));module[_0x4789('0x1')]={'body':{'type':Sequelize[_0x4789('0x2')](_0x4789('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x4789('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x4789('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x4789('0x5')),'defaultValue':_0x4789('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x4789('0x6')]},'providerResponse':{'type':Sequelize[_0x4789('0x2')]}}; \ No newline at end of file +var _0xb4f4=['STRING','TEXT','sequelize','exports','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x23eecd,_0x2f6dc9){var _0x3cf17f=function(_0x4e56d5){while(--_0x4e56d5){_0x23eecd['push'](_0x23eecd['shift']());}};_0x3cf17f(++_0x2f6dc9);}(_0xb4f4,0xda));var _0x4b4f=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0xb4f4[_0x4a3898];return _0x25ceb0;};'use strict';var Sequelize=require(_0x4b4f('0x0'));module[_0x4b4f('0x1')]={'body':{'type':Sequelize['TEXT'](_0x4b4f('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x4b4f('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x4b4f('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4b4f('0x4')]('in','out'),'defaultValue':_0x4b4f('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x4b4f('0x6')]},'providerName':{'type':Sequelize[_0x4b4f('0x7')]},'providerResponse':{'type':Sequelize[_0x4b4f('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 2c10aae..ab6027f 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 _0xc07f=['nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','find','create','body','params','chat-interactions','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','ChatInteractionId','isNil','read1stAt','interaction','get','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','contact','User','email','EventManager','rejectmessage','formData','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','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','register','jayson/promise','client','http','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','name','send','map','ChatMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length'];(function(_0x3f5fe8,_0x578da8){var _0x18c478=function(_0x4708ef){while(--_0x4708ef){_0x3f5fe8['push'](_0x3f5fe8['shift']());}};_0x18c478(++_0x578da8);}(_0xc07f,0x1c3));var _0xfc07=function(_0x53fa74,_0xc84045){_0x53fa74=_0x53fa74-0x0;var _0x46e1b5=_0xc07f[_0x53fa74];return _0x46e1b5;};'use strict';var emlformat=require(_0xfc07('0x0'));var rimraf=require(_0xfc07('0x1'));var zipdir=require(_0xfc07('0x2'));var jsonpatch=require(_0xfc07('0x3'));var rp=require(_0xfc07('0x4'));var moment=require(_0xfc07('0x5'));var BPromise=require(_0xfc07('0x6'));var Mustache=require(_0xfc07('0x7'));var util=require(_0xfc07('0x8'));var path=require(_0xfc07('0x9'));var sox=require(_0xfc07('0xa'));var csv=require(_0xfc07('0xb'));var ejs=require(_0xfc07('0xc'));var fs=require('fs');var fs_extra=require(_0xfc07('0xd'));var _=require(_0xfc07('0xe'));var squel=require(_0xfc07('0xf'));var crypto=require(_0xfc07('0x10'));var jsforce=require(_0xfc07('0x11'));var deskjs=require(_0xfc07('0x12'));var toCsv=require(_0xfc07('0xb'));var querystring=require('querystring');var Papa=require(_0xfc07('0x13'));var Redis=require(_0xfc07('0x14'));var authService=require(_0xfc07('0x15'));var qs=require(_0xfc07('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xfc07('0x17'))(_0xfc07('0x18'));var utils=require(_0xfc07('0x19'));var config=require(_0xfc07('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xfc07('0x1b'))['db'];config['redis']=_[_0xfc07('0x1c')](config[_0xfc07('0x1d')],{'host':_0xfc07('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfc07('0x1d')]));require('./chatMessage.socket')[_0xfc07('0x1f')](socket);var jayson=require(_0xfc07('0x20'));var client=jayson[_0xfc07('0x21')][_0xfc07('0x22')]({'port':0x232c});var client9002=jayson['client'][_0xfc07('0x22')]({'port':0x232a});function respondWithRpcPromise(_0xc47fba,_0x1daf61,_0x195e1f,_0x4111d5){return new BPromise(function(_0x210e44,_0x5eccba){var _0x306421=_0x4111d5||client;return _0x306421['request'](_0xc47fba,_0x195e1f)[_0xfc07('0x23')](function(_0x38f6cb){logger['info'](_0xfc07('0x24'),_0x1daf61,_0xfc07('0x25'));logger[_0xfc07('0x26')](_0xfc07('0x27'),_0x1daf61,_0xfc07('0x25'),JSON[_0xfc07('0x28')](_0x38f6cb));if(_0x38f6cb[_0xfc07('0x29')]){if(_0x38f6cb['error'][_0xfc07('0x2a')]===0x1f4){logger[_0xfc07('0x29')](_0xfc07('0x24'),_0x1daf61,_0x38f6cb['error']['message']);return _0x5eccba(_0x38f6cb[_0xfc07('0x29')][_0xfc07('0x2b')]);}logger['error'](_0xfc07('0x24'),_0x1daf61,_0x38f6cb[_0xfc07('0x29')]['message']);return _0x210e44(_0x38f6cb[_0xfc07('0x29')][_0xfc07('0x2b')]);}else{logger[_0xfc07('0x2c')]('ChatMessage,\x20%s,\x20%s',_0x1daf61,_0xfc07('0x25'));_0x210e44(_0x38f6cb[_0xfc07('0x2d')]['message']);}})[_0xfc07('0x2e')](function(_0xdd47cc){logger[_0xfc07('0x29')](_0xfc07('0x24'),_0x1daf61,_0xdd47cc);_0x5eccba(_0xdd47cc);});});}function respondWithStatusCode(_0x38b4a3,_0x47480a){_0x47480a=_0x47480a||0xcc;return function(_0x2f21c5){if(_0x2f21c5){return _0x38b4a3[_0xfc07('0x2f')](_0x47480a);}return _0x38b4a3[_0xfc07('0x30')](_0x47480a)[_0xfc07('0x31')]();};}function respondWithResult(_0x5c7bec,_0x2642c4){_0x2642c4=_0x2642c4||0xc8;return function(_0x56c891){if(_0x56c891){return _0x5c7bec[_0xfc07('0x30')](_0x2642c4)[_0xfc07('0x32')](_0x56c891);}};}function respondWithFilteredResult(_0x4d2195,_0x32d1e8){return function(_0x554f66){if(_0x554f66){var _0x35a9ec=typeof _0x32d1e8[_0xfc07('0x33')]===_0xfc07('0x34')&&typeof _0x32d1e8[_0xfc07('0x35')]===_0xfc07('0x34');var _0xb44f92=_0x554f66[_0xfc07('0x36')];var _0x4aa64d=_0x35a9ec?0x0:_0x32d1e8[_0xfc07('0x33')];var _0x11ee31=_0x35a9ec?_0x554f66['count']:_0x32d1e8[_0xfc07('0x33')]+_0x32d1e8[_0xfc07('0x35')];var _0x5cfae3;if(_0x11ee31>=_0xb44f92){_0x11ee31=_0xb44f92;_0x5cfae3=0xc8;}else{_0x5cfae3=0xce;}_0x4d2195['status'](_0x5cfae3);return _0x4d2195[_0xfc07('0x37')](_0xfc07('0x38'),_0x4aa64d+'-'+_0x11ee31+'/'+_0xb44f92)['json'](_0x554f66);}return null;};}function patchUpdates(_0x941bab){return function(_0xb2611c){try{jsonpatch['apply'](_0xb2611c,_0x941bab,!![]);}catch(_0x11a744){return BPromise[_0xfc07('0x39')](_0x11a744);}return _0xb2611c[_0xfc07('0x3a')]();};}function saveUpdates(_0x5d9d58,_0x4e7a02){return function(_0x1dde05){if(_0x1dde05){return _0x1dde05[_0xfc07('0x3b')](_0x5d9d58)['then'](function(_0x6d5232){return _0x6d5232;});}return null;};}function removeEntity(_0x5f3459,_0x56c08f){return function(_0x1fc982){if(_0x1fc982){return _0x1fc982[_0xfc07('0x3c')]()[_0xfc07('0x23')](function(){_0x5f3459[_0xfc07('0x30')](0xcc)[_0xfc07('0x31')]();});}};}function handleEntityNotFound(_0x503dc5,_0x538b27){return function(_0x51fcd6){if(!_0x51fcd6){_0x503dc5['sendStatus'](0x194);}return _0x51fcd6;};}function handleError(_0x4cffca,_0x269f1b){_0x269f1b=_0x269f1b||0x1f4;return function(_0x2f7aae){logger[_0xfc07('0x29')](_0x2f7aae['stack']);if(_0x2f7aae[_0xfc07('0x3d')]){delete _0x2f7aae[_0xfc07('0x3d')];}_0x4cffca[_0xfc07('0x30')](_0x269f1b)[_0xfc07('0x3e')](_0x2f7aae);};}exports['index']=function(_0x481877,_0x1ce48b){var _0x2da40f={},_0x25bf72={},_0x4d2c19={'count':0x0,'rows':[]};var _0x334fe8=_[_0xfc07('0x3f')](db[_0xfc07('0x40')][_0xfc07('0x41')],function(_0x2fdaf9){return{'name':_0x2fdaf9[_0xfc07('0x42')],'type':_0x2fdaf9[_0xfc07('0x43')][_0xfc07('0x44')]};});_0x25bf72['model']=_[_0xfc07('0x3f')](_0x334fe8,_0xfc07('0x3d'));_0x25bf72[_0xfc07('0x45')]=_[_0xfc07('0x46')](_0x481877[_0xfc07('0x45')]);_0x25bf72[_0xfc07('0x47')]=_[_0xfc07('0x48')](_0x25bf72['model'],_0x25bf72['query']);_0x2da40f[_0xfc07('0x49')]=_[_0xfc07('0x48')](_0x25bf72[_0xfc07('0x4a')],qs[_0xfc07('0x4b')](_0x481877[_0xfc07('0x45')]['fields']));_0x2da40f['attributes']=_0x2da40f[_0xfc07('0x49')][_0xfc07('0x4c')]?_0x2da40f[_0xfc07('0x49')]:_0x25bf72[_0xfc07('0x4a')];if(!_0x481877['query']['hasOwnProperty'](_0xfc07('0x4d'))){_0x2da40f[_0xfc07('0x35')]=qs[_0xfc07('0x35')](_0x481877[_0xfc07('0x45')][_0xfc07('0x35')]);_0x2da40f[_0xfc07('0x33')]=qs[_0xfc07('0x33')](_0x481877[_0xfc07('0x45')][_0xfc07('0x33')]);}_0x2da40f[_0xfc07('0x4e')]=qs['sort'](_0x481877['query'][_0xfc07('0x4f')]);_0x2da40f[_0xfc07('0x50')]=qs[_0xfc07('0x47')](_[_0xfc07('0x51')](_0x481877[_0xfc07('0x45')],_0x25bf72[_0xfc07('0x47')]),_0x334fe8);if(_0x481877['query']['filter']){_0x2da40f['where']=_[_0xfc07('0x52')](_0x2da40f[_0xfc07('0x50')],{'$or':_[_0xfc07('0x3f')](_0x334fe8,function(_0x4e2e32){if(_0x4e2e32[_0xfc07('0x43')]!==_0xfc07('0x53')){var _0x24bcf8={};_0x24bcf8[_0x4e2e32[_0xfc07('0x3d')]]={'$like':'%'+_0x481877[_0xfc07('0x45')][_0xfc07('0x54')]+'%'};return _0x24bcf8;}})});}_0x2da40f=_[_0xfc07('0x52')]({},_0x2da40f,_0x481877[_0xfc07('0x55')]);var _0x525a42={'where':_0x2da40f[_0xfc07('0x50')]};return db[_0xfc07('0x40')]['count'](_0x525a42)[_0xfc07('0x23')](function(_0x3e4633){_0x4d2c19[_0xfc07('0x36')]=_0x3e4633;if(_0x481877[_0xfc07('0x45')][_0xfc07('0x56')]){_0x2da40f[_0xfc07('0x57')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x2da40f);})[_0xfc07('0x23')](function(_0x2926be){_0x4d2c19['rows']=_0x2926be;return _0x4d2c19;})[_0xfc07('0x23')](respondWithFilteredResult(_0x1ce48b,_0x2da40f))['catch'](handleError(_0x1ce48b,null));};exports['show']=function(_0x24fea4,_0x4e4895){var _0x3b2604={'raw':!![],'where':{'id':_0x24fea4['params']['id']}},_0x449878={};_0x449878[_0xfc07('0x4a')]=_[_0xfc07('0x46')](db[_0xfc07('0x40')][_0xfc07('0x41')]);_0x449878[_0xfc07('0x45')]=_[_0xfc07('0x46')](_0x24fea4[_0xfc07('0x45')]);_0x449878[_0xfc07('0x47')]=_['intersection'](_0x449878[_0xfc07('0x4a')],_0x449878[_0xfc07('0x45')]);_0x3b2604['attributes']=_['intersection'](_0x449878[_0xfc07('0x4a')],qs[_0xfc07('0x4b')](_0x24fea4[_0xfc07('0x45')][_0xfc07('0x4b')]));_0x3b2604[_0xfc07('0x49')]=_0x3b2604[_0xfc07('0x49')]['length']?_0x3b2604[_0xfc07('0x49')]:_0x449878[_0xfc07('0x4a')];if(_0x24fea4[_0xfc07('0x45')]['includeAll']){_0x3b2604[_0xfc07('0x57')]=[{'all':!![]}];}_0x3b2604=_[_0xfc07('0x52')]({},_0x3b2604,_0x24fea4[_0xfc07('0x55')]);return db[_0xfc07('0x40')][_0xfc07('0x58')](_0x3b2604)[_0xfc07('0x23')](handleEntityNotFound(_0x4e4895,null))[_0xfc07('0x23')](respondWithResult(_0x4e4895,null))['catch'](handleError(_0x4e4895,null));};exports[_0xfc07('0x59')]=function(_0x2f5291,_0x1f6816){return db['ChatMessage'][_0xfc07('0x59')](_0x2f5291[_0xfc07('0x5a')],{})['then'](respondWithResult(_0x1f6816,0xc9))[_0xfc07('0x2e')](handleError(_0x1f6816,null));};exports[_0xfc07('0x3b')]=function(_0x3bb352,_0x43510f){if(_0x3bb352['body']['id']){delete _0x3bb352[_0xfc07('0x5a')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x3bb352[_0xfc07('0x5b')]['id']}})[_0xfc07('0x23')](handleEntityNotFound(_0x43510f,null))[_0xfc07('0x23')](saveUpdates(_0x3bb352['body'],null))[_0xfc07('0x23')](respondWithResult(_0x43510f,null))[_0xfc07('0x2e')](handleError(_0x43510f,null));};exports[_0xfc07('0x3c')]=function(_0x54ff53,_0x27b938){return db['ChatMessage'][_0xfc07('0x58')]({'where':{'id':_0x54ff53['params']['id']}})['then'](handleEntityNotFound(_0x27b938,null))[_0xfc07('0x23')](removeEntity(_0x27b938,null))[_0xfc07('0x2e')](handleError(_0x27b938,null));};exports['describe']=function(_0x3a0c57,_0x37ee04){return db[_0xfc07('0x40')]['describe']()['then'](respondWithResult(_0x37ee04,null))['catch'](handleError(_0x37ee04,null));};var interaction_log=require(_0xfc07('0x17'))(_0xfc07('0x5c'));exports[_0xfc07('0x5d')]=function(_0x269732,_0x262ca7,_0x313fcd){var _0xd8445f={'agent':{},'channel':_0xfc07('0x5e')};if(_0x269732[_0xfc07('0x5a')]['id']){delete _0x269732[_0xfc07('0x5a')]['id'];}_0x269732[_0xfc07('0x5a')][_0xfc07('0x5f')]=!![];_0x269732[_0xfc07('0x5a')]['readAt']=moment()[_0xfc07('0x60')](_0xfc07('0x61'));_0x269732[_0xfc07('0x5a')]['UserId']=_0x269732['body'][_0xfc07('0x62')]||_0x269732[_0xfc07('0x63')]['id'];_0xd8445f[_0xfc07('0x64')]['id']=_0x269732[_0xfc07('0x5a')][_0xfc07('0x62')];return db[_0xfc07('0x40')][_0xfc07('0x58')]({'where':{'id':_0x269732[_0xfc07('0x5b')]['id'],'UserId':null}})[_0xfc07('0x23')](handleEntityNotFound(_0x262ca7,null))[_0xfc07('0x23')](saveUpdates(_0x269732[_0xfc07('0x5a')],null))[_0xfc07('0x23')](function(_0x5b0f1f){if(_0x5b0f1f){_0xd8445f[_0xfc07('0x2b')]=_0x5b0f1f['get']({'plain':!![]});return db['ChatInteraction'][_0xfc07('0x58')]({'where':{'id':_0x5b0f1f[_0xfc07('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x262ca7,null))[_0xfc07('0x23')](function(_0x5da41e){if(_0x5da41e){return _0x5da41e['update']({'UserId':_0x269732['body'][_0xfc07('0x62')],'read1stAt':_[_0xfc07('0x66')](_0x5da41e[_0xfc07('0x67')])?moment()[_0xfc07('0x60')](_0xfc07('0x61')):undefined});}return null;})[_0xfc07('0x23')](function(_0x1df928){if(_0x1df928){_0xd8445f[_0xfc07('0x68')]=_0x1df928[_0xfc07('0x69')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x269732[_0xfc07('0x63')]['id'],_0x269732[_0xfc07('0x63')][_0xfc07('0x3d')],_0x269732[_0xfc07('0x63')][_0xfc07('0x6a')],_0xd8445f[_0xfc07('0x68')]['id'],_0x269732[_0xfc07('0x5a')]?JSON[_0xfc07('0x28')](_0x269732[_0xfc07('0x5a')]):'null');return respondWithRpcPromise(_0xfc07('0x6b'),_0xfc07('0x6c'),_0xd8445f);}return null;})[_0xfc07('0x23')](function(_0x1a2835){var _0x29cca5=_0xfc07('0x6d')+_0x1a2835[_0xfc07('0x2b')]['ContactId'];return db[_0xfc07('0x6e')][_0xfc07('0x45')](_0x29cca5,{'type':db[_0xfc07('0x6f')][_0xfc07('0x70')][_0xfc07('0x71')],'raw':!![]})[_0xfc07('0x23')](function(_0x476dde){return _0x476dde;});})[_0xfc07('0x23')](function(_0x1eb738){if(_0x1eb738){_0xd8445f[_0xfc07('0x2b')]['contact']=_0x1eb738[0x0];if(!_0x269732[_0xfc07('0x5a')][_0xfc07('0x62')])return;return db['User'][_0xfc07('0x58')]({'where':{'id':_0x269732[_0xfc07('0x5a')][_0xfc07('0x62')],'role':_0xfc07('0x64')},'attributes':['id','name',_0xfc07('0x72'),'email',_0xfc07('0x73')],'raw':!![]});}return null;})['then'](function(_0x3f3e3b){if(!_0x3f3e3b)return null;_0xd8445f[_0xfc07('0x2b')]['agent']=_0x3f3e3b;return _0xd8445f;})['then'](function(_0x5e0ea2){if(_0x5e0ea2){if(_0x269732['body'][_0xfc07('0x74')]){_0xd8445f['message'][_0xfc07('0x75')]=util[_0xfc07('0x60')](_0xfc07('0x76'),_0x269732[_0xfc07('0x63')][_0xfc07('0x3d')]);_0xd8445f[_0xfc07('0x2b')][_0xfc07('0x77')]=_0xd8445f[_0xfc07('0x77')];_0xd8445f['message'][_0xfc07('0x78')]=_0xd8445f[_0xfc07('0x77')];_0xd8445f[_0xfc07('0x2b')][_0xfc07('0x79')]='accept';return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_['merge'](_0xd8445f[_0xfc07('0x2b')],JSON['parse'](_0xd8445f[_0xfc07('0x68')]['formData']))},client9002)[_0xfc07('0x23')](function(){return _0xd8445f;});}return _0xd8445f;}return null;})[_0xfc07('0x23')](respondWithResult(_0x262ca7,null))[_0xfc07('0x2e')](handleError(_0x262ca7,null));};var interaction_log=require(_0xfc07('0x17'))(_0xfc07('0x5c'));exports[_0xfc07('0x39')]=function(_0x9fbf0c,_0x155f78,_0x3acc1a){var _0x1c2ddf={'agent':{},'channel':_0xfc07('0x5e')};if(_0x9fbf0c['body']['id']){delete _0x9fbf0c[_0xfc07('0x5a')]['id'];}_0x9fbf0c['body'][_0xfc07('0x62')]=_0x9fbf0c[_0xfc07('0x5a')][_0xfc07('0x62')]||_0x9fbf0c[_0xfc07('0x63')]['id'];_0x1c2ddf[_0xfc07('0x64')]['id']=_0x9fbf0c[_0xfc07('0x5a')]['UserId'];return db[_0xfc07('0x40')][_0xfc07('0x58')]({'where':{'id':_0x9fbf0c['params']['id'],'UserId':null}})[_0xfc07('0x23')](handleEntityNotFound(_0x155f78,null))[_0xfc07('0x23')](function(_0x483809){if(_0x483809){_0x1c2ddf['message']=_0x483809[_0xfc07('0x69')]({'plain':!![]});return db[_0xfc07('0x7a')][_0xfc07('0x58')]({'where':{'id':_0x483809[_0xfc07('0x65')]}});}return null;})[_0xfc07('0x23')](handleEntityNotFound(_0x155f78,null))[_0xfc07('0x23')](function(_0x3a2eb6){if(_0x3a2eb6){_0x1c2ddf[_0xfc07('0x68')]=_0x3a2eb6['get']({'plain':!![]});interaction_log[_0xfc07('0x2c')](_0xfc07('0x7b'),_0x9fbf0c[_0xfc07('0x63')]['id'],_0x9fbf0c[_0xfc07('0x63')]['name'],_0x9fbf0c[_0xfc07('0x63')]['role'],_0x1c2ddf[_0xfc07('0x68')]['id'],_0x9fbf0c[_0xfc07('0x5a')]?JSON[_0xfc07('0x28')](_0x9fbf0c[_0xfc07('0x5a')]):_0xfc07('0x7c'));return respondWithRpcPromise(_0xfc07('0x7d'),'rejectMessage',_0x1c2ddf);}return null;})[_0xfc07('0x23')](function(_0x37bf5d){var _0xa455fd=_0xfc07('0x6d')+_0x37bf5d['message']['ContactId'];return db[_0xfc07('0x6e')]['query'](_0xa455fd,{'type':db['Sequelize'][_0xfc07('0x70')][_0xfc07('0x71')],'raw':!![]})[_0xfc07('0x23')](function(_0x291a0c){return _0x291a0c;});})[_0xfc07('0x23')](function(_0x4f0756){if(_0x4f0756){_0x1c2ddf[_0xfc07('0x2b')][_0xfc07('0x7e')]=_0x4f0756[0x0];if(!_0x9fbf0c[_0xfc07('0x5a')][_0xfc07('0x62')])return;return db[_0xfc07('0x7f')]['find']({'where':{'id':_0x9fbf0c['body']['UserId'],'role':'agent'},'attributes':['id',_0xfc07('0x3d'),_0xfc07('0x72'),_0xfc07('0x80'),_0xfc07('0x73')],'raw':!![]});}return null;})[_0xfc07('0x23')](function(_0x595a34){if(!_0x595a34)return null;_0x1c2ddf[_0xfc07('0x2b')]['agent']=_0x595a34;return _0x1c2ddf;})['then'](function(_0x3640b5){if(_0x3640b5){_0x3640b5['message']['interface']=util[_0xfc07('0x60')](_0xfc07('0x76'),_0x9fbf0c[_0xfc07('0x63')][_0xfc07('0x3d')]);_0x3640b5['message'][_0xfc07('0x77')]=_0x1c2ddf[_0xfc07('0x77')];_0x3640b5[_0xfc07('0x2b')]['motionChannel']=_0x1c2ddf[_0xfc07('0x77')];_0x3640b5[_0xfc07('0x2b')]['event']=_0xfc07('0x39');respondWithRpcPromise(_0xfc07('0x81'),_0xfc07('0x81'),{'event':_0xfc07('0x82'),'message':_['merge'](_0x1c2ddf[_0xfc07('0x2b')],JSON['parse'](_0x1c2ddf['interaction'][_0xfc07('0x83')]))},client9002);return _0x1c2ddf;}return null;})[_0xfc07('0x23')](respondWithResult(_0x155f78,null))[_0xfc07('0x2e')](handleError(_0x155f78,null));}; \ No newline at end of file +var _0xe0a9=['ChatInteractionId','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','contact','User','fullname','internal','manual','interface','channel','event','EventManager','acceptmessage','interaction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','sequelize','Sequelize','SELECT','email','SIP/%s','motionChannel','rejectmessage','formData','rimraf','request-promise','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./chatMessage.socket','jayson/promise','http','client','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatMessage','includeAll','include','rows','show','params','keys','find','create','body','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction'];(function(_0x335838,_0x5aab95){var _0x5f09a1=function(_0x56c417){while(--_0x56c417){_0x335838['push'](_0x335838['shift']());}};_0x5f09a1(++_0x5aab95);}(_0xe0a9,0x12e));var _0x9e0a=function(_0x512b90,_0x2f34a2){_0x512b90=_0x512b90-0x0;var _0x54984b=_0xe0a9[_0x512b90];return _0x54984b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9e0a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9e0a('0x1'));var moment=require('moment');var BPromise=require(_0x9e0a('0x2'));var Mustache=require(_0x9e0a('0x3'));var util=require('util');var path=require(_0x9e0a('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9e0a('0x5'));var fs=require('fs');var fs_extra=require(_0x9e0a('0x6'));var _=require(_0x9e0a('0x7'));var squel=require(_0x9e0a('0x8'));var crypto=require(_0x9e0a('0x9'));var jsforce=require(_0x9e0a('0xa'));var deskjs=require(_0x9e0a('0xb'));var toCsv=require(_0x9e0a('0xc'));var querystring=require(_0x9e0a('0xd'));var Papa=require(_0x9e0a('0xe'));var Redis=require(_0x9e0a('0xf'));var authService=require(_0x9e0a('0x10'));var qs=require(_0x9e0a('0x11'));var as=require(_0x9e0a('0x12'));var hardwareService=require(_0x9e0a('0x13'));var logger=require(_0x9e0a('0x14'))(_0x9e0a('0x15'));var utils=require(_0x9e0a('0x16'));var config=require(_0x9e0a('0x17'));var licenseUtil=require(_0x9e0a('0x18'));var db=require(_0x9e0a('0x19'))['db'];config['redis']=_['defaults'](config[_0x9e0a('0x1a')],{'host':_0x9e0a('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9e0a('0x1a')]));require(_0x9e0a('0x1c'))['register'](socket);var jayson=require(_0x9e0a('0x1d'));var client=jayson['client'][_0x9e0a('0x1e')]({'port':0x232c});var client9002=jayson[_0x9e0a('0x1f')][_0x9e0a('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x3f1a8c,_0x42459b,_0x48ae8f,_0x407ddd){return new BPromise(function(_0x5e3aad,_0x426111){var _0x10ee07=_0x407ddd||client;return _0x10ee07[_0x9e0a('0x20')](_0x3f1a8c,_0x48ae8f)[_0x9e0a('0x21')](function(_0x13b28e){logger['info'](_0x9e0a('0x22'),_0x42459b,_0x9e0a('0x23'));logger[_0x9e0a('0x24')](_0x9e0a('0x25'),_0x42459b,_0x9e0a('0x23'),JSON['stringify'](_0x13b28e));if(_0x13b28e[_0x9e0a('0x26')]){if(_0x13b28e[_0x9e0a('0x26')][_0x9e0a('0x27')]===0x1f4){logger[_0x9e0a('0x26')]('ChatMessage,\x20%s,\x20%s',_0x42459b,_0x13b28e[_0x9e0a('0x26')][_0x9e0a('0x28')]);return _0x426111(_0x13b28e[_0x9e0a('0x26')][_0x9e0a('0x28')]);}logger[_0x9e0a('0x26')](_0x9e0a('0x22'),_0x42459b,_0x13b28e[_0x9e0a('0x26')][_0x9e0a('0x28')]);return _0x5e3aad(_0x13b28e[_0x9e0a('0x26')]['message']);}else{logger[_0x9e0a('0x29')]('ChatMessage,\x20%s,\x20%s',_0x42459b,_0x9e0a('0x23'));_0x5e3aad(_0x13b28e[_0x9e0a('0x2a')][_0x9e0a('0x28')]);}})[_0x9e0a('0x2b')](function(_0x27aeab){logger[_0x9e0a('0x26')]('ChatMessage,\x20%s,\x20%s',_0x42459b,_0x27aeab);_0x426111(_0x27aeab);});});}function respondWithStatusCode(_0x3a38b6,_0x1b39e2){_0x1b39e2=_0x1b39e2||0xcc;return function(_0x2e1534){if(_0x2e1534){return _0x3a38b6['sendStatus'](_0x1b39e2);}return _0x3a38b6[_0x9e0a('0x2c')](_0x1b39e2)['end']();};}function respondWithResult(_0x4cb142,_0x344ce3){_0x344ce3=_0x344ce3||0xc8;return function(_0xa3af41){if(_0xa3af41){return _0x4cb142[_0x9e0a('0x2c')](_0x344ce3)[_0x9e0a('0x2d')](_0xa3af41);}};}function respondWithFilteredResult(_0x3f276d,_0x284d68){return function(_0x55f497){if(_0x55f497){var _0x3e5464=typeof _0x284d68[_0x9e0a('0x2e')]===_0x9e0a('0x2f')&&typeof _0x284d68[_0x9e0a('0x30')]===_0x9e0a('0x2f');var _0x362ddc=_0x55f497[_0x9e0a('0x31')];var _0x2d4759=_0x3e5464?0x0:_0x284d68[_0x9e0a('0x2e')];var _0x547483=_0x3e5464?_0x55f497[_0x9e0a('0x31')]:_0x284d68['offset']+_0x284d68[_0x9e0a('0x30')];var _0x185c58;if(_0x547483>=_0x362ddc){_0x547483=_0x362ddc;_0x185c58=0xc8;}else{_0x185c58=0xce;}_0x3f276d[_0x9e0a('0x2c')](_0x185c58);return _0x3f276d[_0x9e0a('0x32')](_0x9e0a('0x33'),_0x2d4759+'-'+_0x547483+'/'+_0x362ddc)[_0x9e0a('0x2d')](_0x55f497);}return null;};}function patchUpdates(_0x3017a4){return function(_0xc95a89){try{jsonpatch[_0x9e0a('0x34')](_0xc95a89,_0x3017a4,!![]);}catch(_0x3b26e3){return BPromise[_0x9e0a('0x35')](_0x3b26e3);}return _0xc95a89[_0x9e0a('0x36')]();};}function saveUpdates(_0x56cee2,_0x3becb4){return function(_0x30dea2){if(_0x30dea2){return _0x30dea2[_0x9e0a('0x37')](_0x56cee2)[_0x9e0a('0x21')](function(_0x3f11d3){return _0x3f11d3;});}return null;};}function removeEntity(_0xd17819,_0x5f3925){return function(_0x2798a9){if(_0x2798a9){return _0x2798a9[_0x9e0a('0x38')]()['then'](function(){_0xd17819[_0x9e0a('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9b25b1,_0x30493f){return function(_0xfabb65){if(!_0xfabb65){_0x9b25b1[_0x9e0a('0x39')](0x194);}return _0xfabb65;};}function handleError(_0x2d3834,_0x12db35){_0x12db35=_0x12db35||0x1f4;return function(_0x10a1be){logger[_0x9e0a('0x26')](_0x10a1be[_0x9e0a('0x3a')]);if(_0x10a1be[_0x9e0a('0x3b')]){delete _0x10a1be[_0x9e0a('0x3b')];}_0x2d3834[_0x9e0a('0x2c')](_0x12db35)[_0x9e0a('0x3c')](_0x10a1be);};}exports[_0x9e0a('0x3d')]=function(_0x41e37e,_0x5f42f6){var _0x580e2d={},_0x25168e={},_0x7196c9={'count':0x0,'rows':[]};var _0x28455d=_['map'](db['ChatMessage'][_0x9e0a('0x3e')],function(_0x50f63b){return{'name':_0x50f63b['fieldName'],'type':_0x50f63b[_0x9e0a('0x3f')][_0x9e0a('0x40')]};});_0x25168e[_0x9e0a('0x41')]=_[_0x9e0a('0x42')](_0x28455d,'name');_0x25168e[_0x9e0a('0x43')]=_['keys'](_0x41e37e[_0x9e0a('0x43')]);_0x25168e[_0x9e0a('0x44')]=_[_0x9e0a('0x45')](_0x25168e[_0x9e0a('0x41')],_0x25168e['query']);_0x580e2d[_0x9e0a('0x46')]=_[_0x9e0a('0x45')](_0x25168e[_0x9e0a('0x41')],qs['fields'](_0x41e37e[_0x9e0a('0x43')][_0x9e0a('0x47')]));_0x580e2d[_0x9e0a('0x46')]=_0x580e2d[_0x9e0a('0x46')][_0x9e0a('0x48')]?_0x580e2d['attributes']:_0x25168e[_0x9e0a('0x41')];if(!_0x41e37e[_0x9e0a('0x43')][_0x9e0a('0x49')](_0x9e0a('0x4a'))){_0x580e2d[_0x9e0a('0x30')]=qs[_0x9e0a('0x30')](_0x41e37e[_0x9e0a('0x43')][_0x9e0a('0x30')]);_0x580e2d[_0x9e0a('0x2e')]=qs[_0x9e0a('0x2e')](_0x41e37e['query'][_0x9e0a('0x2e')]);}_0x580e2d[_0x9e0a('0x4b')]=qs['sort'](_0x41e37e['query'][_0x9e0a('0x4c')]);_0x580e2d[_0x9e0a('0x4d')]=qs[_0x9e0a('0x44')](_[_0x9e0a('0x4e')](_0x41e37e[_0x9e0a('0x43')],_0x25168e[_0x9e0a('0x44')]),_0x28455d);if(_0x41e37e[_0x9e0a('0x43')][_0x9e0a('0x4f')]){_0x580e2d[_0x9e0a('0x4d')]=_[_0x9e0a('0x50')](_0x580e2d[_0x9e0a('0x4d')],{'$or':_['map'](_0x28455d,function(_0x2f1ba5){if(_0x2f1ba5[_0x9e0a('0x3f')]!==_0x9e0a('0x51')){var _0x3f2eaf={};_0x3f2eaf[_0x2f1ba5[_0x9e0a('0x3b')]]={'$like':'%'+_0x41e37e['query'][_0x9e0a('0x4f')]+'%'};return _0x3f2eaf;}})});}_0x580e2d=_['merge']({},_0x580e2d,_0x41e37e[_0x9e0a('0x52')]);var _0x5ace39={'where':_0x580e2d[_0x9e0a('0x4d')]};return db[_0x9e0a('0x53')][_0x9e0a('0x31')](_0x5ace39)[_0x9e0a('0x21')](function(_0x2961fa){_0x7196c9['count']=_0x2961fa;if(_0x41e37e[_0x9e0a('0x43')][_0x9e0a('0x54')]){_0x580e2d[_0x9e0a('0x55')]=[{'all':!![]}];}return db[_0x9e0a('0x53')]['findAll'](_0x580e2d);})[_0x9e0a('0x21')](function(_0xd579f9){_0x7196c9[_0x9e0a('0x56')]=_0xd579f9;return _0x7196c9;})['then'](respondWithFilteredResult(_0x5f42f6,_0x580e2d))['catch'](handleError(_0x5f42f6,null));};exports[_0x9e0a('0x57')]=function(_0x5e2cb1,_0x4bf3df){var _0x53d4d9={'raw':!![],'where':{'id':_0x5e2cb1[_0x9e0a('0x58')]['id']}},_0x1f35ce={};_0x1f35ce[_0x9e0a('0x41')]=_[_0x9e0a('0x59')](db['ChatMessage'][_0x9e0a('0x3e')]);_0x1f35ce[_0x9e0a('0x43')]=_[_0x9e0a('0x59')](_0x5e2cb1[_0x9e0a('0x43')]);_0x1f35ce[_0x9e0a('0x44')]=_[_0x9e0a('0x45')](_0x1f35ce[_0x9e0a('0x41')],_0x1f35ce[_0x9e0a('0x43')]);_0x53d4d9[_0x9e0a('0x46')]=_[_0x9e0a('0x45')](_0x1f35ce[_0x9e0a('0x41')],qs[_0x9e0a('0x47')](_0x5e2cb1[_0x9e0a('0x43')][_0x9e0a('0x47')]));_0x53d4d9[_0x9e0a('0x46')]=_0x53d4d9[_0x9e0a('0x46')][_0x9e0a('0x48')]?_0x53d4d9[_0x9e0a('0x46')]:_0x1f35ce[_0x9e0a('0x41')];if(_0x5e2cb1[_0x9e0a('0x43')]['includeAll']){_0x53d4d9[_0x9e0a('0x55')]=[{'all':!![]}];}_0x53d4d9=_[_0x9e0a('0x50')]({},_0x53d4d9,_0x5e2cb1['options']);return db['ChatMessage'][_0x9e0a('0x5a')](_0x53d4d9)['then'](handleEntityNotFound(_0x4bf3df,null))[_0x9e0a('0x21')](respondWithResult(_0x4bf3df,null))['catch'](handleError(_0x4bf3df,null));};exports[_0x9e0a('0x5b')]=function(_0x5815dd,_0xefb18e){return db['ChatMessage'][_0x9e0a('0x5b')](_0x5815dd[_0x9e0a('0x5c')],{})[_0x9e0a('0x21')](respondWithResult(_0xefb18e,0xc9))[_0x9e0a('0x2b')](handleError(_0xefb18e,null));};exports[_0x9e0a('0x37')]=function(_0x46ff26,_0x71e943){if(_0x46ff26['body']['id']){delete _0x46ff26[_0x9e0a('0x5c')]['id'];}return db['ChatMessage'][_0x9e0a('0x5a')]({'where':{'id':_0x46ff26[_0x9e0a('0x58')]['id']}})[_0x9e0a('0x21')](handleEntityNotFound(_0x71e943,null))['then'](saveUpdates(_0x46ff26[_0x9e0a('0x5c')],null))['then'](respondWithResult(_0x71e943,null))[_0x9e0a('0x2b')](handleError(_0x71e943,null));};exports[_0x9e0a('0x38')]=function(_0x5cdbb5,_0x158b0a){return db[_0x9e0a('0x53')][_0x9e0a('0x5a')]({'where':{'id':_0x5cdbb5['params']['id']}})[_0x9e0a('0x21')](handleEntityNotFound(_0x158b0a,null))[_0x9e0a('0x21')](removeEntity(_0x158b0a,null))['catch'](handleError(_0x158b0a,null));};exports[_0x9e0a('0x5d')]=function(_0x3ca84d,_0x15b170){return db[_0x9e0a('0x53')][_0x9e0a('0x5d')]()['then'](respondWithResult(_0x15b170,null))[_0x9e0a('0x2b')](handleError(_0x15b170,null));};var interaction_log=require(_0x9e0a('0x14'))(_0x9e0a('0x5e'));exports[_0x9e0a('0x5f')]=function(_0x1ab907,_0x3c9fb4,_0x5efe63){var _0x104481={'agent':{},'channel':_0x9e0a('0x60')};if(_0x1ab907['body']['id']){delete _0x1ab907[_0x9e0a('0x5c')]['id'];}_0x1ab907[_0x9e0a('0x5c')][_0x9e0a('0x61')]=!![];_0x1ab907[_0x9e0a('0x5c')][_0x9e0a('0x62')]=moment()[_0x9e0a('0x63')](_0x9e0a('0x64'));_0x1ab907[_0x9e0a('0x5c')][_0x9e0a('0x65')]=_0x1ab907[_0x9e0a('0x5c')][_0x9e0a('0x65')]||_0x1ab907[_0x9e0a('0x66')]['id'];_0x104481[_0x9e0a('0x67')]['id']=_0x1ab907[_0x9e0a('0x5c')][_0x9e0a('0x65')];return db[_0x9e0a('0x53')][_0x9e0a('0x5a')]({'where':{'id':_0x1ab907['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3c9fb4,null))['then'](saveUpdates(_0x1ab907['body'],null))[_0x9e0a('0x21')](function(_0x42351e){if(_0x42351e){_0x104481[_0x9e0a('0x28')]=_0x42351e[_0x9e0a('0x68')]({'plain':!![]});return db[_0x9e0a('0x69')][_0x9e0a('0x5a')]({'where':{'id':_0x42351e[_0x9e0a('0x6a')]}});}return null;})[_0x9e0a('0x21')](handleEntityNotFound(_0x3c9fb4,null))[_0x9e0a('0x21')](function(_0x32162d){if(_0x32162d){return _0x32162d[_0x9e0a('0x37')]({'UserId':_0x1ab907['body'][_0x9e0a('0x65')],'read1stAt':_['isNil'](_0x32162d['read1stAt'])?moment()[_0x9e0a('0x63')](_0x9e0a('0x64')):undefined});}return null;})[_0x9e0a('0x21')](function(_0x58bf47){if(_0x58bf47){_0x104481['interaction']=_0x58bf47[_0x9e0a('0x68')]({'plain':!![]});interaction_log[_0x9e0a('0x29')](_0x9e0a('0x6b'),_0x1ab907[_0x9e0a('0x66')]['id'],_0x1ab907[_0x9e0a('0x66')][_0x9e0a('0x3b')],_0x1ab907[_0x9e0a('0x66')][_0x9e0a('0x6c')],_0x104481['interaction']['id'],_0x1ab907['body']?JSON[_0x9e0a('0x6d')](_0x1ab907[_0x9e0a('0x5c')]):_0x9e0a('0x6e'));return respondWithRpcPromise('AcceptMessage',_0x9e0a('0x6f'),_0x104481);}return null;})['then'](function(_0x547dbb){var _0x3d3e37=_0x9e0a('0x70')+_0x547dbb[_0x9e0a('0x28')][_0x9e0a('0x71')];return db['sequelize']['query'](_0x3d3e37,{'type':db['Sequelize'][_0x9e0a('0x72')]['SELECT'],'raw':!![]})[_0x9e0a('0x21')](function(_0x45d5b8){return _0x45d5b8;});})[_0x9e0a('0x21')](function(_0x508ae1){if(_0x508ae1){_0x104481[_0x9e0a('0x28')][_0x9e0a('0x73')]=_0x508ae1[0x0];if(!_0x1ab907[_0x9e0a('0x5c')]['UserId'])return;return db[_0x9e0a('0x74')]['find']({'where':{'id':_0x1ab907[_0x9e0a('0x5c')][_0x9e0a('0x65')],'role':_0x9e0a('0x67')},'attributes':['id',_0x9e0a('0x3b'),_0x9e0a('0x75'),'email',_0x9e0a('0x76')],'raw':!![]});}return null;})[_0x9e0a('0x21')](function(_0x1459dd){if(!_0x1459dd)return null;_0x104481[_0x9e0a('0x28')]['agent']=_0x1459dd;return _0x104481;})[_0x9e0a('0x21')](function(_0xde56e2){if(_0xde56e2){if(_0x1ab907['body'][_0x9e0a('0x77')]){_0x104481[_0x9e0a('0x28')][_0x9e0a('0x78')]=util[_0x9e0a('0x63')]('SIP/%s',_0x1ab907['user'][_0x9e0a('0x3b')]);_0x104481[_0x9e0a('0x28')][_0x9e0a('0x79')]=_0x104481[_0x9e0a('0x79')];_0x104481[_0x9e0a('0x28')]['motionChannel']=_0x104481[_0x9e0a('0x79')];_0x104481[_0x9e0a('0x28')][_0x9e0a('0x7a')]=_0x9e0a('0x5f');return respondWithRpcPromise(_0x9e0a('0x7b'),'EventManager',{'event':_0x9e0a('0x7c'),'message':_[_0x9e0a('0x50')](_0x104481[_0x9e0a('0x28')],JSON['parse'](_0x104481['interaction']['formData']))},client9002)['then'](function(){return _0x104481;});}return _0x104481;}return null;})[_0x9e0a('0x21')](respondWithResult(_0x3c9fb4,null))[_0x9e0a('0x2b')](handleError(_0x3c9fb4,null));};var interaction_log=require(_0x9e0a('0x14'))(_0x9e0a('0x5e'));exports[_0x9e0a('0x35')]=function(_0x55fa86,_0xdacd47,_0x324986){var _0x40f90e={'agent':{},'channel':_0x9e0a('0x60')};if(_0x55fa86['body']['id']){delete _0x55fa86['body']['id'];}_0x55fa86['body'][_0x9e0a('0x65')]=_0x55fa86['body']['UserId']||_0x55fa86[_0x9e0a('0x66')]['id'];_0x40f90e[_0x9e0a('0x67')]['id']=_0x55fa86[_0x9e0a('0x5c')]['UserId'];return db['ChatMessage']['find']({'where':{'id':_0x55fa86[_0x9e0a('0x58')]['id'],'UserId':null}})[_0x9e0a('0x21')](handleEntityNotFound(_0xdacd47,null))['then'](function(_0x2e343b){if(_0x2e343b){_0x40f90e['message']=_0x2e343b[_0x9e0a('0x68')]({'plain':!![]});return db[_0x9e0a('0x69')]['find']({'where':{'id':_0x2e343b[_0x9e0a('0x6a')]}});}return null;})[_0x9e0a('0x21')](handleEntityNotFound(_0xdacd47,null))['then'](function(_0x39fdc6){if(_0x39fdc6){_0x40f90e[_0x9e0a('0x7d')]=_0x39fdc6['get']({'plain':!![]});interaction_log['info'](_0x9e0a('0x7e'),_0x55fa86[_0x9e0a('0x66')]['id'],_0x55fa86[_0x9e0a('0x66')][_0x9e0a('0x3b')],_0x55fa86[_0x9e0a('0x66')][_0x9e0a('0x6c')],_0x40f90e[_0x9e0a('0x7d')]['id'],_0x55fa86['body']?JSON[_0x9e0a('0x6d')](_0x55fa86[_0x9e0a('0x5c')]):_0x9e0a('0x6e'));return respondWithRpcPromise('RejectMessage',_0x9e0a('0x7f'),_0x40f90e);}return null;})[_0x9e0a('0x21')](function(_0x522fd6){var _0x282472='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x522fd6['message'][_0x9e0a('0x71')];return db[_0x9e0a('0x80')][_0x9e0a('0x43')](_0x282472,{'type':db[_0x9e0a('0x81')][_0x9e0a('0x72')][_0x9e0a('0x82')],'raw':!![]})[_0x9e0a('0x21')](function(_0x4ebc45){return _0x4ebc45;});})[_0x9e0a('0x21')](function(_0x5e99b0){if(_0x5e99b0){_0x40f90e[_0x9e0a('0x28')][_0x9e0a('0x73')]=_0x5e99b0[0x0];if(!_0x55fa86['body'][_0x9e0a('0x65')])return;return db[_0x9e0a('0x74')][_0x9e0a('0x5a')]({'where':{'id':_0x55fa86[_0x9e0a('0x5c')][_0x9e0a('0x65')],'role':_0x9e0a('0x67')},'attributes':['id',_0x9e0a('0x3b'),_0x9e0a('0x75'),_0x9e0a('0x83'),_0x9e0a('0x76')],'raw':!![]});}return null;})[_0x9e0a('0x21')](function(_0x1ab5a4){if(!_0x1ab5a4)return null;_0x40f90e[_0x9e0a('0x28')]['agent']=_0x1ab5a4;return _0x40f90e;})[_0x9e0a('0x21')](function(_0x3e5e8e){if(_0x3e5e8e){_0x3e5e8e[_0x9e0a('0x28')][_0x9e0a('0x78')]=util['format'](_0x9e0a('0x84'),_0x55fa86[_0x9e0a('0x66')]['name']);_0x3e5e8e[_0x9e0a('0x28')][_0x9e0a('0x79')]=_0x40f90e[_0x9e0a('0x79')];_0x3e5e8e[_0x9e0a('0x28')][_0x9e0a('0x85')]=_0x40f90e['channel'];_0x3e5e8e[_0x9e0a('0x28')][_0x9e0a('0x7a')]=_0x9e0a('0x35');respondWithRpcPromise(_0x9e0a('0x7b'),_0x9e0a('0x7b'),{'event':_0x9e0a('0x86'),'message':_['merge'](_0x40f90e[_0x9e0a('0x28')],JSON['parse'](_0x40f90e[_0x9e0a('0x7d')][_0x9e0a('0x87')]))},client9002);return _0x40f90e;}return null;})['then'](respondWithResult(_0xdacd47,null))['catch'](handleError(_0xdacd47,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 359e9c8..2a3ea91 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 _0x1075=['hasOwnProperty','exports','events','ChatMessage','update','remove','emit'];(function(_0x36d567,_0x5d9b45){var _0x4d4ac2=function(_0x475402){while(--_0x475402){_0x36d567['push'](_0x36d567['shift']());}};_0x4d4ac2(++_0x5d9b45);}(_0x1075,0xf0));var _0x5107=function(_0x413f87,_0x12c5c0){_0x413f87=_0x413f87-0x0;var _0xb4ae8c=_0x1075[_0x413f87];return _0xb4ae8c;};'use strict';var EventEmitter=require(_0x5107('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x5107('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5107('0x2'),'afterDestroy':_0x5107('0x3')};function emitEvent(_0x31bb4a){return function(_0xc2311,_0x3330f4,_0x14de1b){ChatMessageEvents[_0x5107('0x4')](_0x31bb4a+':'+_0xc2311['id'],_0xc2311);ChatMessageEvents[_0x5107('0x4')](_0x31bb4a,_0xc2311);_0x14de1b(null);};}for(var e in events){if(events[_0x5107('0x5')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x5107('0x6')]=ChatMessageEvents; \ No newline at end of file +var _0x3c8d=['update','emit','hasOwnProperty','hook','exports','events','setMaxListeners'];(function(_0x41c01a,_0x432ffc){var _0x1bae2e=function(_0x39b3b5){while(--_0x39b3b5){_0x41c01a['push'](_0x41c01a['shift']());}};_0x1bae2e(++_0x432ffc);}(_0x3c8d,0x140));var _0xd3c8=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0x3c8d[_0x43d11d];return _0x38cd08;};'use strict';var EventEmitter=require(_0xd3c8('0x0'));var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xd3c8('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd3c8('0x2'),'afterDestroy':'remove'};function emitEvent(_0x341027){return function(_0x7a421a,_0x3db298,_0x4ed7d6){ChatMessageEvents[_0xd3c8('0x3')](_0x341027+':'+_0x7a421a['id'],_0x7a421a);ChatMessageEvents[_0xd3c8('0x3')](_0x341027,_0x7a421a);_0x4ed7d6(null);};}for(var e in events){if(events[_0xd3c8('0x4')](e)){var event=events[e];ChatMessage[_0xd3c8('0x5')](e,emitEvent(event));}}module[_0xd3c8('0x6')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index f72dd2a..66a736a 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 _0x2016=['createdAt','error','utf8mb4','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./chatMessage.attributes','define','ChatMessage','chat_messages','body','FULLTEXT','direction','toLowerCase','secret','isNil','findOne','then','update'];(function(_0x513051,_0x575b8c){var _0x571744=function(_0x25eaf2){while(--_0x25eaf2){_0x513051['push'](_0x513051['shift']());}};_0x571744(++_0x575b8c);}(_0x2016,0xf5));var _0x6201=function(_0x20538b,_0x1f1e33){_0x20538b=_0x20538b-0x0;var _0x3d3afa=_0x2016[_0x20538b];return _0x3d3afa;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6201('0x0'))(_0x6201('0x1'));var moment=require('moment');var BPromise=require(_0x6201('0x2'));var rp=require(_0x6201('0x3'));var fs=require('fs');var path=require(_0x6201('0x4'));var rimraf=require('rimraf');var config=require(_0x6201('0x5'));var attributes=require(_0x6201('0x6'));module['exports']=function(_0x4dd813,_0x412364){return _0x4dd813[_0x6201('0x7')](_0x6201('0x8'),attributes,{'tableName':_0x6201('0x9'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x6201('0xa')],'type':_0x6201('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4e7c98,_0x403295,_0x27e607){var _0xbc0be=_0x4dd813['models'];var _0x2bcd44=_0x4e7c98['get']({'plain':!![]});if(_0x2bcd44[_0x6201('0xc')][_0x6201('0xd')]()==='in'||_0x2bcd44[_0x6201('0xc')][_0x6201('0xd')]()==='out'&&!_0x2bcd44[_0x6201('0xe')]&&!_[_0x6201('0xf')](_0x2bcd44['UserId'])){_0xbc0be['ChatInteraction'][_0x6201('0x10')]({'where':{'id':_0x2bcd44['ChatInteractionId']}})[_0x6201('0x11')](function(_0xa2f8c0){if(_0xa2f8c0){_0xa2f8c0[_0x6201('0x12')]({'lastMsgAt':_0x2bcd44[_0x6201('0x13')],'lastMsgDirection':_0x2bcd44[_0x6201('0xc')]['toLowerCase']()});}})['catch'](function(_0x233df9){console[_0x6201('0x14')](_0x233df9);});}_0x27e607();}},'charset':_0x6201('0x15'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xbd9b=['define','ChatMessage','chat_messages','body','models','get','direction','toLowerCase','out','isNil','UserId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x3d3ac8,_0x3687c3){var _0x401834=function(_0x26819c){while(--_0x26819c){_0x3d3ac8['push'](_0x3d3ac8['shift']());}};_0x401834(++_0x3687c3);}(_0xbd9b,0x1dd));var _0xbbd9=function(_0x43cc23,_0x19dfc2){_0x43cc23=_0x43cc23-0x0;var _0x450ca6=_0xbd9b[_0x43cc23];return _0x450ca6;};'use strict';var _=require(_0xbbd9('0x0'));var util=require(_0xbbd9('0x1'));var logger=require(_0xbbd9('0x2'))('api');var moment=require(_0xbbd9('0x3'));var BPromise=require(_0xbbd9('0x4'));var rp=require(_0xbbd9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbbd9('0x6'));var config=require(_0xbbd9('0x7'));var attributes=require('./chatMessage.attributes');module[_0xbbd9('0x8')]=function(_0x31ce6a,_0x29f997){return _0x31ce6a[_0xbbd9('0x9')](_0xbbd9('0xa'),attributes,{'tableName':_0xbbd9('0xb'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0xbbd9('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x11f4e2,_0x178ea1,_0xc78c8){var _0x3e8748=_0x31ce6a[_0xbbd9('0xd')];var _0x1c5175=_0x11f4e2[_0xbbd9('0xe')]({'plain':!![]});if(_0x1c5175[_0xbbd9('0xf')]['toLowerCase']()==='in'||_0x1c5175['direction'][_0xbbd9('0x10')]()===_0xbbd9('0x11')&&!_0x1c5175['secret']&&!_[_0xbbd9('0x12')](_0x1c5175[_0xbbd9('0x13')])){_0x3e8748['ChatInteraction']['findOne']({'where':{'id':_0x1c5175['ChatInteractionId']}})[_0xbbd9('0x14')](function(_0x1a45a9){if(_0x1a45a9){_0x1a45a9[_0xbbd9('0x15')]({'lastMsgAt':_0x1c5175[_0xbbd9('0x16')],'lastMsgDirection':_0x1c5175[_0xbbd9('0xf')]['toLowerCase']()});}})[_0xbbd9('0x17')](function(_0x3e4881){console[_0xbbd9('0x18')](_0x3e4881);});}_0xc78c8();}},'charset':_0xbbd9('0x19'),'collate':_0xbbd9('0x1a')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index b09db62..e5c4b90 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 _0xb6db=['create','body','options','raw','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','defaults','redis','./chatMessage.socket','register','request','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','ChatMessage,\x20%s,\x20%s','result','catch','CreateChatMessage','ChatMessage'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xb6db,0xec));var _0xbb6d=function(_0x283c5a,_0x1cd8ec){_0x283c5a=_0x283c5a-0x0;var _0x2f7458=_0xb6db[_0x283c5a];return _0x2f7458;};'use strict';var _=require('lodash');var util=require(_0xbb6d('0x0'));var moment=require(_0xbb6d('0x1'));var BPromise=require(_0xbb6d('0x2'));var rs=require(_0xbb6d('0x3'));var fs=require('fs');var Redis=require(_0xbb6d('0x4'));var db=require(_0xbb6d('0x5'))['db'];var utils=require(_0xbb6d('0x6'));var logger=require(_0xbb6d('0x7'))('rpc');var config=require(_0xbb6d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbb6d('0x9')][_0xbb6d('0xa')]({'port':0x232a});config['redis']=_[_0xbb6d('0xb')](config[_0xbb6d('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbb6d('0xc')]));require(_0xbb6d('0xd'))[_0xbb6d('0xe')](socket);function respondWithRpcPromise(_0x1857f7,_0x59d5c7,_0x2b86bf){return new BPromise(function(_0x36955a,_0x5e4a22){return client[_0xbb6d('0xf')](_0x1857f7,_0x2b86bf)['then'](function(_0x4f5cc3){logger['info']('ChatMessage,\x20%s,\x20%s',_0x59d5c7,_0xbb6d('0x10'));logger['debug'](_0xbb6d('0x11'),_0x59d5c7,_0xbb6d('0x10'),JSON[_0xbb6d('0x12')](_0x4f5cc3));if(_0x4f5cc3[_0xbb6d('0x13')]){if(_0x4f5cc3['error'][_0xbb6d('0x14')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x59d5c7,_0x4f5cc3[_0xbb6d('0x13')][_0xbb6d('0x15')]);return _0x5e4a22(_0x4f5cc3[_0xbb6d('0x13')][_0xbb6d('0x15')]);}logger[_0xbb6d('0x13')]('ChatMessage,\x20%s,\x20%s',_0x59d5c7,_0x4f5cc3['error'][_0xbb6d('0x15')]);return _0x36955a(_0x4f5cc3[_0xbb6d('0x13')][_0xbb6d('0x15')]);}else{logger[_0xbb6d('0x16')](_0xbb6d('0x17'),_0x59d5c7,_0xbb6d('0x10'));_0x36955a(_0x4f5cc3[_0xbb6d('0x18')]['message']);}})[_0xbb6d('0x19')](function(_0xd9a977){logger[_0xbb6d('0x13')](_0xbb6d('0x17'),_0x59d5c7,_0xd9a977);_0x5e4a22(_0xd9a977);});});}exports[_0xbb6d('0x1a')]=function(_0x16bc22){var _0x2b1ca9=this;return new Promise(function(_0x55c435,_0x1247a2){return db[_0xbb6d('0x1b')][_0xbb6d('0x1c')](_0x16bc22[_0xbb6d('0x1d')],{'raw':_0x16bc22['options']?_0x16bc22[_0xbb6d('0x1e')][_0xbb6d('0x1f')]===undefined?!![]:![]:!![]})[_0xbb6d('0x20')](function(_0x32eadd){logger[_0xbb6d('0x16')](_0xbb6d('0x1a'),_0x16bc22);logger['debug']('CreateChatMessage',_0x16bc22,JSON[_0xbb6d('0x12')](_0x32eadd));_0x55c435(_0x32eadd);})[_0xbb6d('0x19')](function(_0x366182){logger[_0xbb6d('0x13')](_0xbb6d('0x1a'),_0x366182[_0xbb6d('0x15')],_0x16bc22);_0x1247a2(_0x2b1ca9[_0xbb6d('0x13')](0x1f4,_0x366182[_0xbb6d('0x15')]));});});}; \ No newline at end of file +var _0x30d8=['then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateChatMessage','create','body','options','raw','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register'];(function(_0x462e1b,_0x370020){var _0x5aff7d=function(_0x493683){while(--_0x493683){_0x462e1b['push'](_0x462e1b['shift']());}};_0x5aff7d(++_0x370020);}(_0x30d8,0x187));var _0x830d=function(_0x57590a,_0x4bb3e5){_0x57590a=_0x57590a-0x0;var _0x5ec126=_0x30d8[_0x57590a];return _0x5ec126;};'use strict';var _=require(_0x830d('0x0'));var util=require('util');var moment=require(_0x830d('0x1'));var BPromise=require('bluebird');var rs=require(_0x830d('0x2'));var fs=require('fs');var Redis=require(_0x830d('0x3'));var db=require(_0x830d('0x4'))['db'];var utils=require(_0x830d('0x5'));var logger=require(_0x830d('0x6'))(_0x830d('0x7'));var config=require(_0x830d('0x8'));var jayson=require(_0x830d('0x9'));var client=jayson['client'][_0x830d('0xa')]({'port':0x232a});config[_0x830d('0xb')]=_[_0x830d('0xc')](config[_0x830d('0xb')],{'host':_0x830d('0xd'),'port':0x18eb});var socket=require(_0x830d('0xe'))(new Redis(config[_0x830d('0xb')]));require(_0x830d('0xf'))[_0x830d('0x10')](socket);function respondWithRpcPromise(_0x5a9380,_0x46d94d,_0x12b8b4){return new BPromise(function(_0x1c33b4,_0x41a662){return client['request'](_0x5a9380,_0x12b8b4)[_0x830d('0x11')](function(_0x1236b0){logger[_0x830d('0x12')](_0x830d('0x13'),_0x46d94d,_0x830d('0x14'));logger[_0x830d('0x15')](_0x830d('0x16'),_0x46d94d,_0x830d('0x14'),JSON[_0x830d('0x17')](_0x1236b0));if(_0x1236b0[_0x830d('0x18')]){if(_0x1236b0[_0x830d('0x18')][_0x830d('0x19')]===0x1f4){logger[_0x830d('0x18')](_0x830d('0x13'),_0x46d94d,_0x1236b0['error'][_0x830d('0x1a')]);return _0x41a662(_0x1236b0[_0x830d('0x18')][_0x830d('0x1a')]);}logger[_0x830d('0x18')](_0x830d('0x13'),_0x46d94d,_0x1236b0[_0x830d('0x18')][_0x830d('0x1a')]);return _0x1c33b4(_0x1236b0[_0x830d('0x18')][_0x830d('0x1a')]);}else{logger[_0x830d('0x12')](_0x830d('0x13'),_0x46d94d,_0x830d('0x14'));_0x1c33b4(_0x1236b0[_0x830d('0x1b')]['message']);}})['catch'](function(_0x298df3){logger[_0x830d('0x18')](_0x830d('0x13'),_0x46d94d,_0x298df3);_0x41a662(_0x298df3);});});}exports[_0x830d('0x1c')]=function(_0x14e86e){var _0x2522dc=this;return new Promise(function(_0x4f7078,_0x20e263){return db['ChatMessage'][_0x830d('0x1d')](_0x14e86e[_0x830d('0x1e')],{'raw':_0x14e86e[_0x830d('0x1f')]?_0x14e86e[_0x830d('0x1f')][_0x830d('0x20')]===undefined?!![]:![]:!![]})[_0x830d('0x11')](function(_0x483c09){logger[_0x830d('0x12')](_0x830d('0x1c'),_0x14e86e);logger[_0x830d('0x15')](_0x830d('0x1c'),_0x14e86e,JSON['stringify'](_0x483c09));_0x4f7078(_0x483c09);})[_0x830d('0x21')](function(_0x1eb37e){logger[_0x830d('0x18')](_0x830d('0x1c'),_0x1eb37e[_0x830d('0x1a')],_0x14e86e);_0x20e263(_0x2522dc['error'](0x1f4,_0x1eb37e[_0x830d('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index ec01b74..2a3f99a 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 _0xdf98=['removeListener','register','length','./chatMessage.events','remove','emit'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xdf98,0xcf));var _0x8df9=function(_0x4d9f63,_0x115c88){_0x4d9f63=_0x4d9f63-0x0;var _0xa6dcfe=_0xdf98[_0x4d9f63];return _0xa6dcfe;};'use strict';var ChatMessageEvents=require(_0x8df9('0x0'));var events=['save',_0x8df9('0x1'),'update'];function createListener(_0x493604,_0x263e95){return function(_0x27ce98){_0x263e95[_0x8df9('0x2')](_0x493604,_0x27ce98);};}function removeListener(_0xeec2ab,_0x3f2ade){return function(){ChatMessageEvents[_0x8df9('0x3')](_0xeec2ab,_0x3f2ade);};}exports[_0x8df9('0x4')]=function(_0x158424){for(var _0x20b677=0x0,_0x5e79af=events[_0x8df9('0x5')];_0x20b677<_0x5e79af;_0x20b677++){var _0x393533=events[_0x20b677];var _0x410568=createListener('chatMessage:'+_0x393533,_0x158424);ChatMessageEvents['on'](_0x393533,_0x410568);}}; \ No newline at end of file +var _0xf5a7=['save','update','emit','removeListener','register','chatMessage:','./chatMessage.events'];(function(_0x54dd35,_0x4a7b1a){var _0x1ce193=function(_0x1e658d){while(--_0x1e658d){_0x54dd35['push'](_0x54dd35['shift']());}};_0x1ce193(++_0x4a7b1a);}(_0xf5a7,0x133));var _0x7f5a=function(_0xe641da,_0x3bb8b2){_0xe641da=_0xe641da-0x0;var _0x11818d=_0xf5a7[_0xe641da];return _0x11818d;};'use strict';var ChatMessageEvents=require(_0x7f5a('0x0'));var events=[_0x7f5a('0x1'),'remove',_0x7f5a('0x2')];function createListener(_0x13cc6f,_0x15a24a){return function(_0x25616d){_0x15a24a[_0x7f5a('0x3')](_0x13cc6f,_0x25616d);};}function removeListener(_0x342fa0,_0x6da3f3){return function(){ChatMessageEvents[_0x7f5a('0x4')](_0x342fa0,_0x6da3f3);};}exports[_0x7f5a('0x5')]=function(_0x520bf9){for(var _0x2808f2=0x0,_0x2be845=events['length'];_0x2808f2<_0x2be845;_0x2808f2++){var _0x19c400=events[_0x2808f2];var _0x46d6d5=createListener(_0x7f5a('0x6')+_0x19c400,_0x520bf9);ChatMessageEvents['on'](_0x19c400,_0x46d6d5);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 8c378de..9535ac7 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 _0x8f27=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','chat','create','put','/:id/accept','accept','reject','delete','destroy'];(function(_0x52d19a,_0x2ebdc2){var _0x23ec77=function(_0x33b780){while(--_0x33b780){_0x52d19a['push'](_0x52d19a['shift']());}};_0x23ec77(++_0x2ebdc2);}(_0x8f27,0xb7));var _0x78f2=function(_0x23a8ba,_0xab5848){_0x23a8ba=_0x23a8ba-0x0;var _0x468389=_0x8f27[_0x23a8ba];return _0x468389;};'use strict';var multer=require(_0x78f2('0x0'));var util=require('util');var path=require(_0x78f2('0x1'));var timeout=require(_0x78f2('0x2'));var express=require(_0x78f2('0x3'));var router=express[_0x78f2('0x4')]();var fs_extra=require(_0x78f2('0x5'));var auth=require(_0x78f2('0x6'));var interaction=require(_0x78f2('0x7'));var config=require('../../config/environment');var controller=require(_0x78f2('0x8'));router[_0x78f2('0x9')]('/',auth[_0x78f2('0xa')](),controller[_0x78f2('0xb')]);router[_0x78f2('0x9')](_0x78f2('0xc'),auth[_0x78f2('0xa')](),controller[_0x78f2('0xd')]);router[_0x78f2('0x9')](_0x78f2('0xe'),auth[_0x78f2('0xa')](),controller[_0x78f2('0xf')]);router[_0x78f2('0x10')]('/',auth[_0x78f2('0xa')](),interaction['tracked'](_0x78f2('0x11'),'chatmessage:create'),controller[_0x78f2('0x12')]);router['put'](_0x78f2('0xe'),controller['update']);router[_0x78f2('0x13')](_0x78f2('0x14'),auth[_0x78f2('0xa')](),controller[_0x78f2('0x15')]);router[_0x78f2('0x13')]('/:id/reject',auth[_0x78f2('0xa')](),controller[_0x78f2('0x16')]);router[_0x78f2('0x17')](_0x78f2('0xe'),auth[_0x78f2('0xa')](),controller[_0x78f2('0x18')]);module[_0x78f2('0x19')]=router; \ No newline at end of file +var _0x9ae0=['../../config/environment','./chatMessage.controller','get','isAuthenticated','/describe','show','tracked','chat','create','put','/:id','update','accept','/:id/reject','reject','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2742a8,_0x47fecd){var _0x2b1b53=function(_0x503bb1){while(--_0x503bb1){_0x2742a8['push'](_0x2742a8['shift']());}};_0x2b1b53(++_0x47fecd);}(_0x9ae0,0x1a9));var _0x09ae=function(_0x598aa9,_0x36ce33){_0x598aa9=_0x598aa9-0x0;var _0x4ccbc3=_0x9ae0[_0x598aa9];return _0x4ccbc3;};'use strict';var multer=require(_0x09ae('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x09ae('0x1'));var express=require(_0x09ae('0x2'));var router=express[_0x09ae('0x3')]();var fs_extra=require(_0x09ae('0x4'));var auth=require(_0x09ae('0x5'));var interaction=require(_0x09ae('0x6'));var config=require(_0x09ae('0x7'));var controller=require(_0x09ae('0x8'));router[_0x09ae('0x9')]('/',auth[_0x09ae('0xa')](),controller['index']);router['get'](_0x09ae('0xb'),auth[_0x09ae('0xa')](),controller['describe']);router[_0x09ae('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x09ae('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x09ae('0xd')](_0x09ae('0xe'),'chatmessage:create'),controller[_0x09ae('0xf')]);router[_0x09ae('0x10')](_0x09ae('0x11'),controller[_0x09ae('0x12')]);router[_0x09ae('0x10')]('/:id/accept',auth[_0x09ae('0xa')](),controller[_0x09ae('0x13')]);router['put'](_0x09ae('0x14'),auth[_0x09ae('0xa')](),controller[_0x09ae('0x15')]);router[_0x09ae('0x16')](_0x09ae('0x11'),auth['isAuthenticated'](),controller[_0x09ae('0x17')]);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 7ccd5ce..6ade282 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['medium','sequelize','TEXT'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x0b0e,0x187));var _0xe0b0=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0x0b0e[_0x32b542];return _0x554d54;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}}; \ No newline at end of file +var _0x0b0e=['medium','sequelize','TEXT'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x0b0e,0x187));var _0xe0b0=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x0b0e[_0x5f1391];return _0x50ebe3;};'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 0bc0807..ea93438 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(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0x7a54,0x106));var _0x47a5=function(_0x51b2ad,_0x16eebb){_0x51b2ad=_0x51b2ad-0x0;var _0x549342=_0x7a54[_0x51b2ad];return _0x549342;};'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(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x7a54,0x106));var _0x47a5=function(_0x111f29,_0x1d7bea){_0x111f29=_0x111f29-0x0;var _0x51a9d4=_0x7a54[_0x111f29];return _0x51a9d4;};'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 a64d1d2..9e541a5 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 _0x9df5=['exports','events','../../mysqldb','ChatOfflineMessage','update','emit','hook'];(function(_0x3f3346,_0x2e591d){var _0x50f355=function(_0x302eb9){while(--_0x302eb9){_0x3f3346['push'](_0x3f3346['shift']());}};_0x50f355(++_0x2e591d);}(_0x9df5,0x9b));var _0x59df=function(_0x12a930,_0x27b4a5){_0x12a930=_0x12a930-0x0;var _0x627937=_0x9df5[_0x12a930];return _0x627937;};'use strict';var EventEmitter=require(_0x59df('0x0'));var ChatOfflineMessage=require(_0x59df('0x1'))['db'][_0x59df('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x59df('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3dee4f){return function(_0x4e7910,_0xd96d42,_0x2b478c){ChatOfflineMessageEvents[_0x59df('0x4')](_0x3dee4f+':'+_0x4e7910['id'],_0x4e7910);ChatOfflineMessageEvents[_0x59df('0x4')](_0x3dee4f,_0x4e7910);_0x2b478c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x59df('0x5')](e,emitEvent(event));}}module[_0x59df('0x6')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0xda5b=['hook','exports','events','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x4a71c3,_0x1bd58a){var _0x1ca465=function(_0xee8ec6){while(--_0xee8ec6){_0x4a71c3['push'](_0x4a71c3['shift']());}};_0x1ca465(++_0x1bd58a);}(_0xda5b,0xc8));var _0xbda5=function(_0x54332e,_0x286092){_0x54332e=_0x54332e-0x0;var _0x44d685=_0xda5b[_0x54332e];return _0x44d685;};'use strict';var EventEmitter=require(_0xbda5('0x0'));var ChatOfflineMessage=require(_0xbda5('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xbda5('0x2')](0x0);var events={'afterCreate':_0xbda5('0x3'),'afterUpdate':'update','afterDestroy':_0xbda5('0x4')};function emitEvent(_0x5128a4){return function(_0x1cd782,_0x2a81dc,_0x26962f){ChatOfflineMessageEvents[_0xbda5('0x5')](_0x5128a4+':'+_0x1cd782['id'],_0x1cd782);ChatOfflineMessageEvents[_0xbda5('0x5')](_0x5128a4,_0x1cd782);_0x26962f(null);};}for(var e in events){if(events[_0xbda5('0x6')](e)){var event=events[e];ChatOfflineMessage[_0xbda5('0x7')](e,emitEvent(event));}}module[_0xbda5('0x8')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 6e423a9..e8628c6 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 _0xb43a=['chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage'];(function(_0x5db09b,_0x5b6402){var _0x4c98f3=function(_0x1154e5){while(--_0x1154e5){_0x5db09b['push'](_0x5db09b['shift']());}};_0x4c98f3(++_0x5b6402);}(_0xb43a,0xdc));var _0xab43=function(_0x260f28,_0x4e9b30){_0x260f28=_0x260f28-0x0;var _0x3aefcc=_0xb43a[_0x260f28];return _0x3aefcc;};'use strict';var attributes=require(_0xab43('0x0'));module[_0xab43('0x1')]=function(_0x53fdf1){return _0x53fdf1[_0xab43('0x2')](_0xab43('0x3'),attributes,{'tableName':_0xab43('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xab43('0x5'),'collate':_0xab43('0x6')});}; \ No newline at end of file +var _0x755c=['exports','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0x755c,0xc5));var _0xc755=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x755c[_0x20a584];return _0x4b41a8;};'use strict';var attributes=require(_0xc755('0x0'));module[_0xc755('0x1')]=function(_0xa5865){return _0xa5865['define'](_0xc755('0x2'),attributes,{'tableName':_0xc755('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc755('0x4'),'collate':_0xc755('0x5')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index da3e862..0176c23 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 _0xf9c5=['code','message','info','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xf9c5,0xf7));var _0x5f9c=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xf9c5[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x5f9c('0x0'));var util=require(_0x5f9c('0x1'));var moment=require(_0x5f9c('0x2'));var BPromise=require(_0x5f9c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5f9c('0x4'))['db'];var utils=require(_0x5f9c('0x5'));var logger=require(_0x5f9c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5f9c('0x7'));var client=jayson['client'][_0x5f9c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x540cc8,_0x43f795,_0x4d86a5){return new BPromise(function(_0x2edbce,_0x559d9b){return client[_0x5f9c('0x9')](_0x540cc8,_0x4d86a5)[_0x5f9c('0xa')](function(_0x6e87ae){logger['info'](_0x5f9c('0xb'),_0x43f795,_0x5f9c('0xc'));logger[_0x5f9c('0xd')](_0x5f9c('0xe'),_0x43f795,_0x5f9c('0xc'),JSON[_0x5f9c('0xf')](_0x6e87ae));if(_0x6e87ae[_0x5f9c('0x10')]){if(_0x6e87ae[_0x5f9c('0x10')][_0x5f9c('0x11')]===0x1f4){logger['error'](_0x5f9c('0xb'),_0x43f795,_0x6e87ae[_0x5f9c('0x10')][_0x5f9c('0x12')]);return _0x559d9b(_0x6e87ae['error']['message']);}logger[_0x5f9c('0x10')](_0x5f9c('0xb'),_0x43f795,_0x6e87ae[_0x5f9c('0x10')]['message']);return _0x2edbce(_0x6e87ae[_0x5f9c('0x10')][_0x5f9c('0x12')]);}else{logger[_0x5f9c('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x43f795,_0x5f9c('0xc'));_0x2edbce(_0x6e87ae[_0x5f9c('0x14')][_0x5f9c('0x12')]);}})[_0x5f9c('0x15')](function(_0x205300){logger[_0x5f9c('0x10')](_0x5f9c('0xb'),_0x43f795,_0x205300);_0x559d9b(_0x205300);});});} \ No newline at end of file +var _0x4a77=['client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x535edb,_0x301a49){var _0x3f6f64=function(_0x249c3b){while(--_0x249c3b){_0x535edb['push'](_0x535edb['shift']());}};_0x3f6f64(++_0x301a49);}(_0x4a77,0x1ee));var _0x74a7=function(_0xe209a0,_0x49ed6d){_0xe209a0=_0xe209a0-0x0;var _0x19779c=_0x4a77[_0xe209a0];return _0x19779c;};'use strict';var _=require(_0x74a7('0x0'));var util=require(_0x74a7('0x1'));var moment=require(_0x74a7('0x2'));var BPromise=require(_0x74a7('0x3'));var rs=require(_0x74a7('0x4'));var fs=require('fs');var Redis=require(_0x74a7('0x5'));var db=require(_0x74a7('0x6'))['db'];var utils=require(_0x74a7('0x7'));var logger=require('../../config/logger')(_0x74a7('0x8'));var config=require(_0x74a7('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x74a7('0xa')][_0x74a7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x383b0c,_0x4d65dd,_0x34addf){return new BPromise(function(_0x2cf960,_0xe46ddc){return client[_0x74a7('0xc')](_0x383b0c,_0x34addf)[_0x74a7('0xd')](function(_0x143476){logger[_0x74a7('0xe')](_0x74a7('0xf'),_0x4d65dd,_0x74a7('0x10'));logger[_0x74a7('0x11')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x4d65dd,_0x74a7('0x10'),JSON[_0x74a7('0x12')](_0x143476));if(_0x143476['error']){if(_0x143476['error'][_0x74a7('0x13')]===0x1f4){logger['error'](_0x74a7('0xf'),_0x4d65dd,_0x143476[_0x74a7('0x14')][_0x74a7('0x15')]);return _0xe46ddc(_0x143476[_0x74a7('0x14')][_0x74a7('0x15')]);}logger[_0x74a7('0x14')]('ChatOfflineMessage,\x20%s,\x20%s',_0x4d65dd,_0x143476['error'][_0x74a7('0x15')]);return _0x2cf960(_0x143476[_0x74a7('0x14')][_0x74a7('0x15')]);}else{logger[_0x74a7('0xe')](_0x74a7('0xf'),_0x4d65dd,_0x74a7('0x10'));_0x2cf960(_0x143476[_0x74a7('0x16')][_0x74a7('0x15')]);}})[_0x74a7('0x17')](function(_0x13957f){logger[_0x74a7('0x14')]('ChatOfflineMessage,\x20%s,\x20%s',_0x4d65dd,_0x13957f);_0xe46ddc(_0x13957f);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 621a2ad..d137e27 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 _0xc1f2=['describe','/:id','post','put','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x2e765f,_0x3b5e44){var _0x3a4da8=function(_0x5e2655){while(--_0x5e2655){_0x2e765f['push'](_0x2e765f['shift']());}};_0x3a4da8(++_0x3b5e44);}(_0xc1f2,0x16c));var _0x2c1f=function(_0x35ce91,_0x3c0f73){_0x35ce91=_0x35ce91-0x0;var _0x145e20=_0xc1f2[_0x35ce91];return _0x145e20;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2c1f('0x0'));var timeout=require(_0x2c1f('0x1'));var express=require(_0x2c1f('0x2'));var router=express[_0x2c1f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2c1f('0x4'));var interaction=require(_0x2c1f('0x5'));var config=require(_0x2c1f('0x6'));var controller=require('./chatOfflineMessage.controller');router[_0x2c1f('0x7')]('/',auth[_0x2c1f('0x8')](),controller[_0x2c1f('0x9')]);router[_0x2c1f('0x7')]('/describe',auth[_0x2c1f('0x8')](),controller[_0x2c1f('0xa')]);router[_0x2c1f('0x7')](_0x2c1f('0xb'),auth[_0x2c1f('0x8')](),controller['show']);router[_0x2c1f('0xc')]('/',auth[_0x2c1f('0x8')](),controller['create']);router[_0x2c1f('0xd')](_0x2c1f('0xb'),auth[_0x2c1f('0x8')](),controller['update']);router[_0x2c1f('0xe')](_0x2c1f('0xb'),auth[_0x2c1f('0x8')](),controller[_0x2c1f('0xf')]);module[_0x2c1f('0x10')]=router; \ No newline at end of file +var _0x0264=['show','post','put','update','delete','destroy','exports','multer','connect-timeout','Router','../../components/auth/service','./chatOfflineMessage.controller','index','get','/describe','/:id','isAuthenticated'];(function(_0x1b4bd8,_0xcacd2d){var _0x34346c=function(_0x32b0d8){while(--_0x32b0d8){_0x1b4bd8['push'](_0x1b4bd8['shift']());}};_0x34346c(++_0xcacd2d);}(_0x0264,0x8f));var _0x4026=function(_0x41093b,_0x1f094e){_0x41093b=_0x41093b-0x0;var _0x42bf03=_0x0264[_0x41093b];return _0x42bf03;};'use strict';var multer=require(_0x4026('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4026('0x1'));var express=require('express');var router=express[_0x4026('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x4026('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4026('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0x4026('0x5')]);router[_0x4026('0x6')](_0x4026('0x7'),auth['isAuthenticated'](),controller['describe']);router[_0x4026('0x6')](_0x4026('0x8'),auth[_0x4026('0x9')](),controller[_0x4026('0xa')]);router[_0x4026('0xb')]('/',auth[_0x4026('0x9')](),controller['create']);router[_0x4026('0xc')](_0x4026('0x8'),auth[_0x4026('0x9')](),controller[_0x4026('0xd')]);router[_0x4026('0xe')]('/:id',auth[_0x4026('0x9')](),controller[_0x4026('0xf')]);module[_0x4026('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 19a9896..a4fc550 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 _0x5dca=['ENUM','mouseOver','timeout','INTEGER','sequelize','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5dca,0x1d8));var _0xa5dc=function(_0x273ea1,_0x13d940){_0x273ea1=_0x273ea1-0x0;var _0x2e593c=_0x5dca[_0x273ea1];return _0x2e593c;};'use strict';var Sequelize=require(_0xa5dc('0x0'));module['exports']={'name':{'type':Sequelize[_0xa5dc('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xa5dc('0x2')](_0xa5dc('0x3'),_0xa5dc('0x4')),'defaultValue':_0xa5dc('0x3')},'selector':{'type':Sequelize[_0xa5dc('0x1')]},'timeout':{'type':Sequelize[_0xa5dc('0x5')]}}; \ No newline at end of file +var _0x525c=['exports','STRING','ENUM','timeout','mouseOver','sequelize'];(function(_0x10b5da,_0x4dc64b){var _0x1198b7=function(_0x5086da){while(--_0x5086da){_0x10b5da['push'](_0x10b5da['shift']());}};_0x1198b7(++_0x4dc64b);}(_0x525c,0x12b));var _0xc525=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0x525c[_0x1da04e];return _0xdd8c41;};'use strict';var Sequelize=require(_0xc525('0x0'));module[_0xc525('0x1')]={'name':{'type':Sequelize[_0xc525('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xc525('0x3')]('mouseOver',_0xc525('0x4')),'defaultValue':_0xc525('0x5')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index a162900..dacd2b9 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 _0x5ad3=['show','keys','rawAttributes','intersection','attributes','model','query','length','includeAll','include','merge','options','ChatProactiveAction','catch','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','status','end','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name'];(function(_0x2f3b86,_0x1fffad){var _0x9741a0=function(_0x654b64){while(--_0x654b64){_0x2f3b86['push'](_0x2f3b86['shift']());}};_0x9741a0(++_0x1fffad);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x1ba43c,_0x5bd2e8){_0x1ba43c=_0x1ba43c-0x0;var _0x2f60eb=_0x5ad3[_0x1ba43c];return _0x2f60eb;};'use strict';var emlformat=require(_0x35ad('0x0'));var rimraf=require(_0x35ad('0x1'));var zipdir=require(_0x35ad('0x2'));var jsonpatch=require(_0x35ad('0x3'));var rp=require('request-promise');var moment=require(_0x35ad('0x4'));var BPromise=require(_0x35ad('0x5'));var Mustache=require(_0x35ad('0x6'));var util=require(_0x35ad('0x7'));var path=require(_0x35ad('0x8'));var sox=require(_0x35ad('0x9'));var csv=require(_0x35ad('0xa'));var ejs=require(_0x35ad('0xb'));var fs=require('fs');var fs_extra=require(_0x35ad('0xc'));var _=require(_0x35ad('0xd'));var squel=require('squel');var crypto=require(_0x35ad('0xe'));var jsforce=require(_0x35ad('0xf'));var deskjs=require(_0x35ad('0x10'));var toCsv=require('to-csv');var querystring=require(_0x35ad('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x35ad('0x12'));var qs=require(_0x35ad('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x35ad('0x14'));var logger=require(_0x35ad('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x35ad('0x16'));var licenseUtil=require(_0x35ad('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c4dd5,_0x33e2ec){_0x33e2ec=_0x33e2ec||0xcc;return function(_0x595fe8){if(_0x595fe8){return _0x3c4dd5['sendStatus'](_0x33e2ec);}return _0x3c4dd5[_0x35ad('0x18')](_0x33e2ec)[_0x35ad('0x19')]();};}function respondWithResult(_0x3cda5e,_0x4b7ad9){_0x4b7ad9=_0x4b7ad9||0xc8;return function(_0x3e2676){if(_0x3e2676){return _0x3cda5e[_0x35ad('0x18')](_0x4b7ad9)['json'](_0x3e2676);}};}function respondWithFilteredResult(_0x1494be,_0x4d5185){return function(_0x4e3cd8){if(_0x4e3cd8){var _0x3a981a=typeof _0x4d5185[_0x35ad('0x1a')]===_0x35ad('0x1b')&&typeof _0x4d5185['limit']===_0x35ad('0x1b');var _0x2f3f27=_0x4e3cd8[_0x35ad('0x1c')];var _0x3158a1=_0x3a981a?0x0:_0x4d5185[_0x35ad('0x1a')];var _0x418416=_0x3a981a?_0x4e3cd8['count']:_0x4d5185[_0x35ad('0x1a')]+_0x4d5185[_0x35ad('0x1d')];var _0x574557;if(_0x418416>=_0x2f3f27){_0x418416=_0x2f3f27;_0x574557=0xc8;}else{_0x574557=0xce;}_0x1494be['status'](_0x574557);return _0x1494be[_0x35ad('0x1e')](_0x35ad('0x1f'),_0x3158a1+'-'+_0x418416+'/'+_0x2f3f27)['json'](_0x4e3cd8);}return null;};}function patchUpdates(_0x21f611){return function(_0x32735e){try{jsonpatch['apply'](_0x32735e,_0x21f611,!![]);}catch(_0x37c03d){return BPromise[_0x35ad('0x20')](_0x37c03d);}return _0x32735e[_0x35ad('0x21')]();};}function saveUpdates(_0x30542c,_0x1be6d2){return function(_0x43a6a8){if(_0x43a6a8){return _0x43a6a8[_0x35ad('0x22')](_0x30542c)[_0x35ad('0x23')](function(_0x2fb296){return _0x2fb296;});}return null;};}function removeEntity(_0xebc6c5,_0x4c5740){return function(_0x1cb9da){if(_0x1cb9da){return _0x1cb9da[_0x35ad('0x24')]()['then'](function(){_0xebc6c5[_0x35ad('0x18')](0xcc)[_0x35ad('0x19')]();});}};}function handleEntityNotFound(_0xa3cb9f,_0xfc80ac){return function(_0x368468){if(!_0x368468){_0xa3cb9f['sendStatus'](0x194);}return _0x368468;};}function handleError(_0x37e9bd,_0x226167){_0x226167=_0x226167||0x1f4;return function(_0x3dc3c4){logger[_0x35ad('0x25')](_0x3dc3c4[_0x35ad('0x26')]);if(_0x3dc3c4[_0x35ad('0x27')]){delete _0x3dc3c4[_0x35ad('0x27')];}_0x37e9bd[_0x35ad('0x18')](_0x226167)['send'](_0x3dc3c4);};}exports[_0x35ad('0x28')]=function(_0x11da54,_0x2f8b3){var _0x34b8b9={'raw':!![],'where':{'id':_0x11da54['params']['id']}},_0x2c82f1={};_0x2c82f1['model']=_[_0x35ad('0x29')](db['ChatProactiveAction'][_0x35ad('0x2a')]);_0x2c82f1['query']=_['keys'](_0x11da54['query']);_0x2c82f1['filters']=_[_0x35ad('0x2b')](_0x2c82f1['model'],_0x2c82f1['query']);_0x34b8b9[_0x35ad('0x2c')]=_['intersection'](_0x2c82f1[_0x35ad('0x2d')],qs['fields'](_0x11da54[_0x35ad('0x2e')]['fields']));_0x34b8b9[_0x35ad('0x2c')]=_0x34b8b9['attributes'][_0x35ad('0x2f')]?_0x34b8b9[_0x35ad('0x2c')]:_0x2c82f1[_0x35ad('0x2d')];if(_0x11da54['query'][_0x35ad('0x30')]){_0x34b8b9[_0x35ad('0x31')]=[{'all':!![]}];}_0x34b8b9=_[_0x35ad('0x32')]({},_0x34b8b9,_0x11da54[_0x35ad('0x33')]);return db[_0x35ad('0x34')]['find'](_0x34b8b9)['then'](handleEntityNotFound(_0x2f8b3,null))[_0x35ad('0x23')](respondWithResult(_0x2f8b3,null))[_0x35ad('0x35')](handleError(_0x2f8b3,null));};exports[_0x35ad('0x36')]=function(_0x1c8a3d,_0x55e676){return db[_0x35ad('0x34')][_0x35ad('0x36')](_0x1c8a3d[_0x35ad('0x37')],{})[_0x35ad('0x23')](respondWithResult(_0x55e676,0xc9))[_0x35ad('0x35')](handleError(_0x55e676,null));};exports[_0x35ad('0x22')]=function(_0x49c33d,_0x58250d){if(_0x49c33d[_0x35ad('0x37')]['id']){delete _0x49c33d[_0x35ad('0x37')]['id'];}return db[_0x35ad('0x34')][_0x35ad('0x38')]({'where':{'id':_0x49c33d[_0x35ad('0x39')]['id']}})[_0x35ad('0x23')](handleEntityNotFound(_0x58250d,null))[_0x35ad('0x23')](saveUpdates(_0x49c33d[_0x35ad('0x37')],null))[_0x35ad('0x23')](respondWithResult(_0x58250d,null))['catch'](handleError(_0x58250d,null));};exports[_0x35ad('0x24')]=function(_0x4f975b,_0x25e63e){return db[_0x35ad('0x34')][_0x35ad('0x38')]({'where':{'id':_0x4f975b[_0x35ad('0x39')]['id']}})[_0x35ad('0x23')](handleEntityNotFound(_0x25e63e,null))[_0x35ad('0x23')](removeEntity(_0x25e63e,null))[_0x35ad('0x35')](handleError(_0x25e63e,null));}; \ No newline at end of file +var _0xb66c=['options','find','catch','ChatProactiveAction','create','body','destroy','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','update','then','error','stack','name','send','show','params','rawAttributes','keys','query','filters','model','attributes','intersection','fields','includeAll','include','merge'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb66c,0x175));var _0xcb66=function(_0x1dc77a,_0x1c0658){_0x1dc77a=_0x1dc77a-0x0;var _0x31da80=_0xb66c[_0x1dc77a];return _0x31da80;};'use strict';var emlformat=require(_0xcb66('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcb66('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcb66('0x2'));var moment=require(_0xcb66('0x3'));var BPromise=require(_0xcb66('0x4'));var Mustache=require('mustache');var util=require(_0xcb66('0x5'));var path=require(_0xcb66('0x6'));var sox=require(_0xcb66('0x7'));var csv=require(_0xcb66('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcb66('0x9'));var squel=require(_0xcb66('0xa'));var crypto=require(_0xcb66('0xb'));var jsforce=require(_0xcb66('0xc'));var deskjs=require(_0xcb66('0xd'));var toCsv=require('to-csv');var querystring=require(_0xcb66('0xe'));var Papa=require(_0xcb66('0xf'));var Redis=require(_0xcb66('0x10'));var authService=require(_0xcb66('0x11'));var qs=require(_0xcb66('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcb66('0x13'));var logger=require(_0xcb66('0x14'))(_0xcb66('0x15'));var utils=require(_0xcb66('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xcb66('0x17'));var db=require(_0xcb66('0x18'))['db'];function respondWithStatusCode(_0x4105d2,_0x2339bb){_0x2339bb=_0x2339bb||0xcc;return function(_0x582523){if(_0x582523){return _0x4105d2[_0xcb66('0x19')](_0x2339bb);}return _0x4105d2[_0xcb66('0x1a')](_0x2339bb)[_0xcb66('0x1b')]();};}function respondWithResult(_0x401bc9,_0x58fb9e){_0x58fb9e=_0x58fb9e||0xc8;return function(_0x19072b){if(_0x19072b){return _0x401bc9['status'](_0x58fb9e)[_0xcb66('0x1c')](_0x19072b);}};}function respondWithFilteredResult(_0x52b058,_0x27442d){return function(_0x573dc7){if(_0x573dc7){var _0x4bef09=typeof _0x27442d[_0xcb66('0x1d')]===_0xcb66('0x1e')&&typeof _0x27442d[_0xcb66('0x1f')]===_0xcb66('0x1e');var _0x4d99c0=_0x573dc7[_0xcb66('0x20')];var _0x42ad03=_0x4bef09?0x0:_0x27442d[_0xcb66('0x1d')];var _0x58bca0=_0x4bef09?_0x573dc7[_0xcb66('0x20')]:_0x27442d['offset']+_0x27442d[_0xcb66('0x1f')];var _0x41edae;if(_0x58bca0>=_0x4d99c0){_0x58bca0=_0x4d99c0;_0x41edae=0xc8;}else{_0x41edae=0xce;}_0x52b058[_0xcb66('0x1a')](_0x41edae);return _0x52b058[_0xcb66('0x21')]('Content-Range',_0x42ad03+'-'+_0x58bca0+'/'+_0x4d99c0)['json'](_0x573dc7);}return null;};}function patchUpdates(_0x4d9690){return function(_0xb39b87){try{jsonpatch['apply'](_0xb39b87,_0x4d9690,!![]);}catch(_0x5e07e8){return BPromise[_0xcb66('0x22')](_0x5e07e8);}return _0xb39b87['save']();};}function saveUpdates(_0x1c1219,_0x12e2bc){return function(_0x602b44){if(_0x602b44){return _0x602b44[_0xcb66('0x23')](_0x1c1219)[_0xcb66('0x24')](function(_0x204f15){return _0x204f15;});}return null;};}function removeEntity(_0x3391a0,_0x5977e1){return function(_0x36faba){if(_0x36faba){return _0x36faba['destroy']()['then'](function(){_0x3391a0[_0xcb66('0x1a')](0xcc)[_0xcb66('0x1b')]();});}};}function handleEntityNotFound(_0x19da3b,_0x5f389f){return function(_0x341554){if(!_0x341554){_0x19da3b[_0xcb66('0x19')](0x194);}return _0x341554;};}function handleError(_0x43cd8f,_0x40e3de){_0x40e3de=_0x40e3de||0x1f4;return function(_0x5affdb){logger[_0xcb66('0x25')](_0x5affdb[_0xcb66('0x26')]);if(_0x5affdb[_0xcb66('0x27')]){delete _0x5affdb[_0xcb66('0x27')];}_0x43cd8f[_0xcb66('0x1a')](_0x40e3de)[_0xcb66('0x28')](_0x5affdb);};}exports[_0xcb66('0x29')]=function(_0x967710,_0x28fc0b){var _0x178a06={'raw':!![],'where':{'id':_0x967710[_0xcb66('0x2a')]['id']}},_0x516194={};_0x516194['model']=_['keys'](db['ChatProactiveAction'][_0xcb66('0x2b')]);_0x516194['query']=_[_0xcb66('0x2c')](_0x967710[_0xcb66('0x2d')]);_0x516194[_0xcb66('0x2e')]=_['intersection'](_0x516194[_0xcb66('0x2f')],_0x516194[_0xcb66('0x2d')]);_0x178a06[_0xcb66('0x30')]=_[_0xcb66('0x31')](_0x516194[_0xcb66('0x2f')],qs[_0xcb66('0x32')](_0x967710[_0xcb66('0x2d')][_0xcb66('0x32')]));_0x178a06[_0xcb66('0x30')]=_0x178a06[_0xcb66('0x30')]['length']?_0x178a06[_0xcb66('0x30')]:_0x516194[_0xcb66('0x2f')];if(_0x967710[_0xcb66('0x2d')][_0xcb66('0x33')]){_0x178a06[_0xcb66('0x34')]=[{'all':!![]}];}_0x178a06=_[_0xcb66('0x35')]({},_0x178a06,_0x967710[_0xcb66('0x36')]);return db['ChatProactiveAction'][_0xcb66('0x37')](_0x178a06)[_0xcb66('0x24')](handleEntityNotFound(_0x28fc0b,null))[_0xcb66('0x24')](respondWithResult(_0x28fc0b,null))[_0xcb66('0x38')](handleError(_0x28fc0b,null));};exports['create']=function(_0x1a9545,_0x17a21a){return db[_0xcb66('0x39')][_0xcb66('0x3a')](_0x1a9545[_0xcb66('0x3b')],{})[_0xcb66('0x24')](respondWithResult(_0x17a21a,0xc9))[_0xcb66('0x38')](handleError(_0x17a21a,null));};exports[_0xcb66('0x23')]=function(_0x3ae1cc,_0x299156){if(_0x3ae1cc[_0xcb66('0x3b')]['id']){delete _0x3ae1cc[_0xcb66('0x3b')]['id'];}return db['ChatProactiveAction']['find']({'where':{'id':_0x3ae1cc['params']['id']}})[_0xcb66('0x24')](handleEntityNotFound(_0x299156,null))[_0xcb66('0x24')](saveUpdates(_0x3ae1cc[_0xcb66('0x3b')],null))[_0xcb66('0x24')](respondWithResult(_0x299156,null))[_0xcb66('0x38')](handleError(_0x299156,null));};exports[_0xcb66('0x3c')]=function(_0x4c53b8,_0x13865f){return db['ChatProactiveAction']['find']({'where':{'id':_0x4c53b8['params']['id']}})[_0xcb66('0x24')](handleEntityNotFound(_0x13865f,null))[_0xcb66('0x24')](removeEntity(_0x13865f,null))[_0xcb66('0x38')](handleError(_0x13865f,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 98a5a51..727ac92 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 _0xc0e4=['moment','request-promise','path','rimraf','./chatProactiveAction.attributes','define','chat_proactive_actions','lodash','util','../../config/logger'];(function(_0x2245d7,_0x92dad1){var _0x32459e=function(_0xb0ce3){while(--_0xb0ce3){_0x2245d7['push'](_0x2245d7['shift']());}};_0x32459e(++_0x92dad1);}(_0xc0e4,0x1b5));var _0x4c0e=function(_0x566bdf,_0x1f4861){_0x566bdf=_0x566bdf-0x0;var _0x331215=_0xc0e4[_0x566bdf];return _0x331215;};'use strict';var _=require(_0x4c0e('0x0'));var util=require(_0x4c0e('0x1'));var logger=require(_0x4c0e('0x2'))('api');var moment=require(_0x4c0e('0x3'));var BPromise=require('bluebird');var rp=require(_0x4c0e('0x4'));var fs=require('fs');var path=require(_0x4c0e('0x5'));var rimraf=require(_0x4c0e('0x6'));var config=require('../../config/environment');var attributes=require(_0x4c0e('0x7'));module['exports']=function(_0x140790,_0x30a9d3){return _0x140790[_0x4c0e('0x8')]('ChatProactiveAction',attributes,{'tableName':_0x4c0e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6daf=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','lodash','util'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x6daf,0x6c));var _0xf6da=function(_0x32ac74,_0x3c0a14){_0x32ac74=_0x32ac74-0x0;var _0x349bf4=_0x6daf[_0x32ac74];return _0x349bf4;};'use strict';var _=require(_0xf6da('0x0'));var util=require(_0xf6da('0x1'));var logger=require(_0xf6da('0x2'))(_0xf6da('0x3'));var moment=require(_0xf6da('0x4'));var BPromise=require('bluebird');var rp=require(_0xf6da('0x5'));var fs=require('fs');var path=require(_0xf6da('0x6'));var rimraf=require(_0xf6da('0x7'));var config=require(_0xf6da('0x8'));var attributes=require(_0xf6da('0x9'));module['exports']=function(_0x2dc48e,_0x17bf7f){return _0x2dc48e['define']('ChatProactiveAction',attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index 16388a8..65ceba5 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 _0x6f7a=['info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x158e3b,_0x4534b){var _0x551a1d=function(_0x629c21){while(--_0x629c21){_0x158e3b['push'](_0x158e3b['shift']());}};_0x551a1d(++_0x4534b);}(_0x6f7a,0x17a));var _0xa6f7=function(_0x2e6c65,_0x5d1b24){_0x2e6c65=_0x2e6c65-0x0;var _0x29d209=_0x6f7a[_0x2e6c65];return _0x29d209;};'use strict';var _=require(_0xa6f7('0x0'));var util=require(_0xa6f7('0x1'));var moment=require(_0xa6f7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa6f7('0x3'));var db=require(_0xa6f7('0x4'))['db'];var utils=require(_0xa6f7('0x5'));var logger=require(_0xa6f7('0x6'))(_0xa6f7('0x7'));var config=require(_0xa6f7('0x8'));var jayson=require(_0xa6f7('0x9'));var client=jayson[_0xa6f7('0xa')][_0xa6f7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f2fdb,_0x34279b,_0x129ba0){return new BPromise(function(_0x2ae38f,_0x3fdeb6){return client['request'](_0x3f2fdb,_0x129ba0)[_0xa6f7('0xc')](function(_0x21f2f9){logger[_0xa6f7('0xd')](_0xa6f7('0xe'),_0x34279b,'request\x20sent');logger[_0xa6f7('0xf')](_0xa6f7('0x10'),_0x34279b,_0xa6f7('0x11'),JSON['stringify'](_0x21f2f9));if(_0x21f2f9[_0xa6f7('0x12')]){if(_0x21f2f9[_0xa6f7('0x12')][_0xa6f7('0x13')]===0x1f4){logger[_0xa6f7('0x12')](_0xa6f7('0xe'),_0x34279b,_0x21f2f9[_0xa6f7('0x12')][_0xa6f7('0x14')]);return _0x3fdeb6(_0x21f2f9['error']['message']);}logger['error'](_0xa6f7('0xe'),_0x34279b,_0x21f2f9[_0xa6f7('0x12')][_0xa6f7('0x14')]);return _0x2ae38f(_0x21f2f9[_0xa6f7('0x12')][_0xa6f7('0x14')]);}else{logger['info'](_0xa6f7('0xe'),_0x34279b,_0xa6f7('0x11'));_0x2ae38f(_0x21f2f9[_0xa6f7('0x15')][_0xa6f7('0x14')]);}})[_0xa6f7('0x16')](function(_0x4445c1){logger[_0xa6f7('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x34279b,_0x4445c1);_0x3fdeb6(_0x4445c1);});});} \ No newline at end of file +var _0x2c2d=['ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x2c2d,0x1ed));var _0xd2c2=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0x2c2d[_0x5a3cf0];return _0x5a64ee;};'use strict';var _=require('lodash');var util=require(_0xd2c2('0x0'));var moment=require('moment');var BPromise=require(_0xd2c2('0x1'));var rs=require(_0xd2c2('0x2'));var fs=require('fs');var Redis=require(_0xd2c2('0x3'));var db=require(_0xd2c2('0x4'))['db'];var utils=require(_0xd2c2('0x5'));var logger=require('../../config/logger')(_0xd2c2('0x6'));var config=require(_0xd2c2('0x7'));var jayson=require(_0xd2c2('0x8'));var client=jayson[_0xd2c2('0x9')][_0xd2c2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5eddf2,_0x392cd3,_0x5bd244){return new BPromise(function(_0x69563,_0x150ec4){return client[_0xd2c2('0xb')](_0x5eddf2,_0x5bd244)['then'](function(_0x1b5b0f){logger[_0xd2c2('0xc')](_0xd2c2('0xd'),_0x392cd3,_0xd2c2('0xe'));logger[_0xd2c2('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x392cd3,'request\x20sent',JSON[_0xd2c2('0x10')](_0x1b5b0f));if(_0x1b5b0f[_0xd2c2('0x11')]){if(_0x1b5b0f['error'][_0xd2c2('0x12')]===0x1f4){logger[_0xd2c2('0x11')](_0xd2c2('0xd'),_0x392cd3,_0x1b5b0f[_0xd2c2('0x11')][_0xd2c2('0x13')]);return _0x150ec4(_0x1b5b0f[_0xd2c2('0x11')][_0xd2c2('0x13')]);}logger[_0xd2c2('0x11')](_0xd2c2('0xd'),_0x392cd3,_0x1b5b0f['error'][_0xd2c2('0x13')]);return _0x69563(_0x1b5b0f[_0xd2c2('0x11')][_0xd2c2('0x13')]);}else{logger[_0xd2c2('0xc')](_0xd2c2('0xd'),_0x392cd3,_0xd2c2('0xe'));_0x69563(_0x1b5b0f[_0xd2c2('0x14')]['message']);}})[_0xd2c2('0x15')](function(_0x126adb){logger[_0xd2c2('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x392cd3,_0x126adb);_0x150ec4(_0x126adb);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 2653d30..aaa892a 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 _0x6aa7=['/:id','show','post','isAuthenticated','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x437516,_0x9b8cfc){var _0x45c3e6=function(_0x2ad2a8){while(--_0x2ad2a8){_0x437516['push'](_0x437516['shift']());}};_0x45c3e6(++_0x9b8cfc);}(_0x6aa7,0x178));var _0x76aa=function(_0x4d953e,_0x159fd4){_0x4d953e=_0x4d953e-0x0;var _0x5562bc=_0x6aa7[_0x4d953e];return _0x5562bc;};'use strict';var multer=require(_0x76aa('0x0'));var util=require('util');var path=require(_0x76aa('0x1'));var timeout=require(_0x76aa('0x2'));var express=require(_0x76aa('0x3'));var router=express[_0x76aa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x76aa('0x5'));var interaction=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var controller=require('./chatProactiveAction.controller');router['get'](_0x76aa('0x8'),auth['isAuthenticated'](),controller[_0x76aa('0x9')]);router[_0x76aa('0xa')]('/',auth[_0x76aa('0xb')](),controller['create']);router[_0x76aa('0xc')](_0x76aa('0x8'),auth[_0x76aa('0xb')](),controller['update']);router[_0x76aa('0xd')](_0x76aa('0x8'),auth[_0x76aa('0xb')](),controller[_0x76aa('0xe')]);module[_0x76aa('0xf')]=router; \ No newline at end of file +var _0x98a8=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','show','isAuthenticated','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x200aa5,_0x197802){var _0x458200=function(_0x594959){while(--_0x594959){_0x200aa5['push'](_0x200aa5['shift']());}};_0x458200(++_0x197802);}(_0x98a8,0x12c));var _0x898a=function(_0x16e526,_0xab7a29){_0x16e526=_0x16e526-0x0;var _0x712a5e=_0x98a8[_0x16e526];return _0x712a5e;};'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')](_0x898a('0xb'),auth['isAuthenticated'](),controller[_0x898a('0xc')]);router['post']('/',auth[_0x898a('0xd')](),controller['create']);router[_0x898a('0xe')](_0x898a('0xb'),auth[_0x898a('0xd')](),controller[_0x898a('0xf')]);router[_0x898a('0x10')](_0x898a('0xb'),auth[_0x898a('0xd')](),controller[_0x898a('0x11')]);module[_0x898a('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 68c320f..ff5d451 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 _0xc5e7=['roundrobin','sequelize','exports','STRING','INTEGER','ENUM','rrmemory'];(function(_0x339cc4,_0x5c00a8){var _0x5704ab=function(_0x65116b){while(--_0x65116b){_0x339cc4['push'](_0x339cc4['shift']());}};_0x5704ab(++_0x5c00a8);}(_0xc5e7,0x86));var _0x7c5e=function(_0x42c8ce,_0xdc007f){_0x42c8ce=_0x42c8ce-0x0;var _0x348975=_0xc5e7[_0x42c8ce];return _0x348975;};'use strict';var Sequelize=require(_0x7c5e('0x0'));module[_0x7c5e('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7c5e('0x2')]},'timeout':{'type':Sequelize[_0x7c5e('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7c5e('0x4')](_0x7c5e('0x5'),'beepall',_0x7c5e('0x6'))}}; \ No newline at end of file +var _0x7d55=['beepall','roundrobin','sequelize','exports','name','STRING','ENUM','rrmemory'];(function(_0x2e0443,_0x7e5974){var _0x52d450=function(_0x3a9985){while(--_0x3a9985){_0x2e0443['push'](_0x2e0443['shift']());}};_0x52d450(++_0x7e5974);}(_0x7d55,0xb2));var _0x57d5=function(_0x15a437,_0x1157a0){_0x15a437=_0x15a437-0x0;var _0x24f7ef=_0x7d55[_0x15a437];return _0x24f7ef;};'use strict';var Sequelize=require(_0x57d5('0x0'));module[_0x57d5('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x57d5('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x57d5('0x3')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x57d5('0x4')](_0x57d5('0x5'),_0x57d5('0x6'),_0x57d5('0x7'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 1ee44de..cabdb2b 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 _0x9280=['pick','filter','merge','map','User','UserId','agent','chatPause','updatedAt','%s/%s','SIP','createdAt','Team','getTeams','addTeams','ids','Agents','online','voicePause','sequelize','each','findOrCreate','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','compact','value','transaction','isEmpty','removeAgents','forEach','emit','userChatQueue:remove','addAgents','omit','isArray','getAgents','bluebird','util','lodash','squel','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter','redis','./chatQueue.socket','register','sendStatus','status','end','json','undefined','limit','count','Content-Range','update','then','destroy','ChatQueues','stack','name','send','ChatQueue','rawAttributes','fieldName','type','key','where','include','query','findAll','rows','catch','show','params','model','keys','filters','attributes','intersection','length','includeAll','options','find','create','body','user','get','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','fields','hasOwnProperty','nolimit','offset','order','sort'];(function(_0x45a3b7,_0x3d7cc0){var _0x301784=function(_0x47ecc3){while(--_0x47ecc3){_0x45a3b7['push'](_0x45a3b7['shift']());}};_0x301784(++_0x3d7cc0);}(_0x9280,0xab));var _0x0928=function(_0x159931,_0x3f87cc){_0x159931=_0x159931-0x0;var _0x46f591=_0x9280[_0x159931];return _0x46f591;};'use strict';var BPromise=require(_0x0928('0x0'));var util=require(_0x0928('0x1'));var _=require(_0x0928('0x2'));var squel=require(_0x0928('0x3'));var Redis=require('ioredis');var qs=require(_0x0928('0x4'));var logger=require(_0x0928('0x5'))(_0x0928('0x6'));var config=require(_0x0928('0x7'));var db=require(_0x0928('0x8'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0928('0x9'))(new Redis(config[_0x0928('0xa')]));require(_0x0928('0xb'))[_0x0928('0xc')](socket);function respondWithStatusCode(_0x25e4c7,_0x322024){_0x322024=_0x322024||0xcc;return function(_0x425321){if(_0x425321){return _0x25e4c7[_0x0928('0xd')](_0x322024);}return _0x25e4c7[_0x0928('0xe')](_0x322024)[_0x0928('0xf')]();};}function respondWithResult(_0x26ce55,_0xe55f95){_0xe55f95=_0xe55f95||0xc8;return function(_0x1ef5e5){if(_0x1ef5e5){return _0x26ce55[_0x0928('0xe')](_0xe55f95)[_0x0928('0x10')](_0x1ef5e5);}};}function respondWithFilteredResult(_0x911950,_0x164aa7){return function(_0x446d88){if(_0x446d88){var _0x395fa7=typeof _0x164aa7['offset']===_0x0928('0x11')&&typeof _0x164aa7[_0x0928('0x12')]==='undefined';var _0x4fd5c5=_0x446d88[_0x0928('0x13')];var _0x2e7fe0=_0x395fa7?0x0:_0x164aa7['offset'];var _0xa4897f=_0x395fa7?_0x446d88['count']:_0x164aa7['offset']+_0x164aa7[_0x0928('0x12')];var _0xf4da42;if(_0xa4897f>=_0x4fd5c5){_0xa4897f=_0x4fd5c5;_0xf4da42=0xc8;}else{_0xf4da42=0xce;}_0x911950[_0x0928('0xe')](_0xf4da42);return _0x911950['set'](_0x0928('0x14'),_0x2e7fe0+'-'+_0xa4897f+'/'+_0x4fd5c5)[_0x0928('0x10')](_0x446d88);}return null;};}function saveUpdates(_0xe50a95){return function(_0x571728){if(_0x571728){return _0x571728[_0x0928('0x15')](_0xe50a95)[_0x0928('0x16')](function(_0x491a85){return _0x491a85;});}return null;};}function removeEntity(_0x2c1968){return function(_0x525c05){if(_0x525c05){return _0x525c05[_0x0928('0x17')]()[_0x0928('0x16')](function(){var _0x2fdcd8=_0x525c05['get']({'plain':!![]});var _0xc58198=_0x0928('0x18');return db['UserProfileResource'][_0x0928('0x17')]({'where':{'type':_0xc58198,'resourceId':_0x2fdcd8['id']}})[_0x0928('0x16')](function(){return _0x525c05;});})['then'](function(){_0x2c1968[_0x0928('0xe')](0xcc)[_0x0928('0xf')]();});}};}function handleEntityNotFound(_0x3e2e76){return function(_0xaaa536){if(!_0xaaa536){_0x3e2e76[_0x0928('0xd')](0x194);}return _0xaaa536;};}function handleError(_0x16b2a0,_0x585dca){_0x585dca=_0x585dca||0x1f4;return function(_0x139a06){logger['error'](_0x139a06[_0x0928('0x19')]);if(_0x139a06[_0x0928('0x1a')]){delete _0x139a06[_0x0928('0x1a')];}_0x16b2a0[_0x0928('0xe')](_0x585dca)[_0x0928('0x1b')](_0x139a06);};}exports['index']=function(_0x5aac57,_0x4b0321){var _0x525017={};var _0x44fee7={'count':0x0,'rows':[]};var _0x2a0f72=_['map'](db[_0x0928('0x1c')][_0x0928('0x1d')],function(_0x2554dd){return{'name':_0x2554dd[_0x0928('0x1e')],'type':_0x2554dd[_0x0928('0x1f')][_0x0928('0x20')]};});_0x525017=qs['getOptions'](_0x2a0f72,_0x5aac57);var _0x27fd34={'where':_0x525017[_0x0928('0x21')]};return db[_0x0928('0x1c')]['count'](_0x27fd34)[_0x0928('0x16')](function(_0x2e9c51){_0x44fee7['count']=_0x2e9c51;_0x525017[_0x0928('0x22')]=qs[_0x0928('0x22')](_0x5aac57[_0x0928('0x23')]);return db[_0x0928('0x1c')][_0x0928('0x24')](_0x525017);})[_0x0928('0x16')](function(_0x2f95f3){_0x44fee7[_0x0928('0x25')]=_0x2f95f3;return _0x44fee7;})[_0x0928('0x16')](respondWithFilteredResult(_0x4b0321,_0x525017))[_0x0928('0x26')](handleError(_0x4b0321,null));};exports[_0x0928('0x27')]=function(_0x1b155b,_0x599a1b){var _0x21a969={'raw':!![],'where':{'id':_0x1b155b[_0x0928('0x28')]['id']}},_0x58ab1a={};_0x58ab1a[_0x0928('0x29')]=_[_0x0928('0x2a')](db[_0x0928('0x1c')][_0x0928('0x1d')]);_0x58ab1a[_0x0928('0x23')]=_['keys'](_0x1b155b['query']);_0x58ab1a[_0x0928('0x2b')]=_['intersection'](_0x58ab1a[_0x0928('0x29')],_0x58ab1a[_0x0928('0x23')]);_0x21a969[_0x0928('0x2c')]=_[_0x0928('0x2d')](_0x58ab1a[_0x0928('0x29')],qs['fields'](_0x1b155b['query']['fields']));_0x21a969[_0x0928('0x2c')]=_0x21a969[_0x0928('0x2c')][_0x0928('0x2e')]?_0x21a969[_0x0928('0x2c')]:_0x58ab1a[_0x0928('0x29')];if(_0x1b155b[_0x0928('0x23')][_0x0928('0x2f')]){_0x21a969[_0x0928('0x22')]=[{'all':!![]}];}_0x21a969=_['merge']({},_0x21a969,_0x1b155b[_0x0928('0x30')]);return db['ChatQueue'][_0x0928('0x31')](_0x21a969)[_0x0928('0x16')](handleEntityNotFound(_0x599a1b,null))[_0x0928('0x16')](respondWithResult(_0x599a1b,null))[_0x0928('0x26')](handleError(_0x599a1b,null));};exports[_0x0928('0x32')]=function(_0x2436fb,_0x369b44){return db[_0x0928('0x1c')][_0x0928('0x32')](_0x2436fb[_0x0928('0x33')],{})[_0x0928('0x16')](function(_0x421133){var _0x1e33a7=_0x2436fb[_0x0928('0x34')][_0x0928('0x35')]({'plain':!![]});if(!_0x1e33a7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1e33a7[_0x0928('0x36')]===_0x0928('0x34')){var _0x2d80f0=_0x421133[_0x0928('0x35')]({'plain':!![]});var _0x50c1c0=_0x0928('0x18');return db['UserProfileSection'][_0x0928('0x31')]({'where':{'name':_0x50c1c0,'userProfileId':_0x1e33a7[_0x0928('0x37')]},'raw':!![]})[_0x0928('0x16')](function(_0x59a646){if(_0x59a646&&_0x59a646[_0x0928('0x38')]===0x0){return db[_0x0928('0x39')][_0x0928('0x32')]({'name':_0x2d80f0[_0x0928('0x1a')],'resourceId':_0x2d80f0['id'],'type':_0x59a646[_0x0928('0x1a')],'sectionId':_0x59a646['id']},{})[_0x0928('0x16')](function(){return _0x421133;});}else{return _0x421133;}})[_0x0928('0x26')](function(_0x13d0c7){logger['error'](_0x0928('0x3a'),_0x13d0c7);throw _0x13d0c7;});}return _0x421133;})[_0x0928('0x16')](respondWithResult(_0x369b44,0xc9))[_0x0928('0x26')](handleError(_0x369b44,null));};exports[_0x0928('0x15')]=function(_0x14b9c9,_0x191365){if(_0x14b9c9['body']['id']){delete _0x14b9c9[_0x0928('0x33')]['id'];}return db['ChatQueue']['find']({'where':{'id':_0x14b9c9[_0x0928('0x28')]['id']}})[_0x0928('0x16')](handleEntityNotFound(_0x191365,null))['then'](saveUpdates(_0x14b9c9[_0x0928('0x33')],null))[_0x0928('0x16')](respondWithResult(_0x191365,null))[_0x0928('0x26')](handleError(_0x191365,null));};exports[_0x0928('0x17')]=function(_0x193dfd,_0x407677){return db[_0x0928('0x1c')][_0x0928('0x31')]({'where':{'id':_0x193dfd[_0x0928('0x28')]['id']}})[_0x0928('0x16')](handleEntityNotFound(_0x407677,null))[_0x0928('0x16')](removeEntity(_0x407677,null))[_0x0928('0x26')](handleError(_0x407677,null));};exports[_0x0928('0x3b')]=function(_0x2d35c5,_0x233543){return db[_0x0928('0x1c')][_0x0928('0x3b')]()['then'](respondWithResult(_0x233543,null))['catch'](handleError(_0x233543,null));};exports[_0x0928('0x3c')]=function(_0x589064,_0xb05ba4){var _0x57fb69={'raw':!![],'where':{}},_0x511447={},_0x4e8d33;return db['ChatQueue'][_0x0928('0x3d')]({'where':{'id':_0x589064[_0x0928('0x28')]['id']}})[_0x0928('0x16')](handleEntityNotFound(_0xb05ba4,null))[_0x0928('0x16')](function(_0x2a4f61){if(_0x2a4f61){_0x4e8d33=_0x2a4f61[_0x0928('0x35')]({'plain':!![]});_0x511447[_0x0928('0x29')]=_['keys'](db[_0x0928('0x3e')]['rawAttributes']);_0x511447[_0x0928('0x23')]=_[_0x0928('0x2a')](_0x589064[_0x0928('0x23')]);_0x511447[_0x0928('0x2b')]=_[_0x0928('0x2d')](_0x511447[_0x0928('0x29')],_0x511447[_0x0928('0x23')]);_0x57fb69[_0x0928('0x2c')]=_['intersection'](_0x511447[_0x0928('0x29')],qs['fields'](_0x589064['query'][_0x0928('0x3f')]));_0x57fb69[_0x0928('0x2c')]=_0x57fb69['attributes'][_0x0928('0x2e')]?_0x57fb69[_0x0928('0x2c')]:_0x511447[_0x0928('0x29')];if(!_0x589064[_0x0928('0x23')][_0x0928('0x40')](_0x0928('0x41'))){_0x57fb69[_0x0928('0x12')]=qs['limit'](_0x589064[_0x0928('0x23')][_0x0928('0x12')]);_0x57fb69[_0x0928('0x42')]=qs['offset'](_0x589064[_0x0928('0x23')][_0x0928('0x42')]);}_0x57fb69[_0x0928('0x43')]=qs[_0x0928('0x44')](_0x589064[_0x0928('0x23')]['sort']);_0x57fb69['where']=qs[_0x0928('0x2b')](_[_0x0928('0x45')](_0x589064[_0x0928('0x23')],_0x511447[_0x0928('0x2b')]));_0x57fb69[_0x0928('0x21')]['ChatQueueId']=_0x2a4f61['id'];if(_0x589064[_0x0928('0x23')][_0x0928('0x46')]){_0x57fb69['where']=_[_0x0928('0x47')](_0x57fb69[_0x0928('0x21')],{'$or':_[_0x0928('0x48')](_0x57fb69['attributes'],function(_0x141c06){var _0x40aeb3={};_0x40aeb3[_0x141c06]={'$like':'%'+_0x589064[_0x0928('0x23')]['filter']+'%'};return _0x40aeb3;})});}_0x57fb69=_[_0x0928('0x47')]({},_0x57fb69,_0x589064['options']);return db['UserChatQueue'][_0x0928('0x24')](_0x57fb69);}})[_0x0928('0x16')](function(_0x2f0b18){if(_0x2f0b18){return db[_0x0928('0x49')]['findAndCountAll']({'where':{'id':_[_0x0928('0x48')](_0x2f0b18,_0x0928('0x4a')),'role':_0x0928('0x4b')},'attributes':['id',_0x0928('0x1a'),_0x0928('0x4c'),_0x0928('0x4d'),'createdAt']});}})[_0x0928('0x16')](function(_0x4d8ce5){if(_0x4d8ce5){return{'count':_0x4d8ce5[_0x0928('0x13')],'rows':_['map'](_0x4d8ce5['rows'],function(_0x2c68a4){return{'membername':_0x2c68a4[_0x0928('0x1a')],'UserId':_0x2c68a4['id'],'queue_name':_0x4e8d33['name'],'ChatQueueId':_0x4e8d33['id'],'interface':util['format'](_0x0928('0x4e'),_0x0928('0x4f'),_0x2c68a4[_0x0928('0x1a')]),'penalty':0x0,'paused':_0x2c68a4[_0x0928('0x4c')],'createdAt':_0x2c68a4[_0x0928('0x50')],'updatedAt':_0x2c68a4[_0x0928('0x4d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0928('0x16')](respondWithFilteredResult(_0xb05ba4,_0x57fb69))[_0x0928('0x26')](handleError(_0xb05ba4,null));};exports['getTeams']=function(_0x2ac445,_0x46ebd8){var _0x2467a4={};var _0x2f056b={};var _0x3d2d12;var _0x4af8cb;return db[_0x0928('0x1c')][_0x0928('0x3d')]({'where':{'id':_0x2ac445[_0x0928('0x28')]['id']}})['then'](handleEntityNotFound(_0x46ebd8,null))['then'](function(_0x24b484){if(_0x24b484){_0x3d2d12=_0x24b484;_0x2f056b[_0x0928('0x29')]=_[_0x0928('0x2a')](db[_0x0928('0x51')][_0x0928('0x1d')]);_0x2f056b['query']=_[_0x0928('0x2a')](_0x2ac445[_0x0928('0x23')]);_0x2f056b[_0x0928('0x2b')]=_[_0x0928('0x2d')](_0x2f056b[_0x0928('0x29')],_0x2f056b[_0x0928('0x23')]);_0x2467a4[_0x0928('0x2c')]=_[_0x0928('0x2d')](_0x2f056b[_0x0928('0x29')],qs[_0x0928('0x3f')](_0x2ac445[_0x0928('0x23')][_0x0928('0x3f')]));_0x2467a4[_0x0928('0x2c')]=_0x2467a4[_0x0928('0x2c')][_0x0928('0x2e')]?_0x2467a4[_0x0928('0x2c')]:_0x2f056b['model'];_0x2467a4[_0x0928('0x43')]=qs[_0x0928('0x44')](_0x2ac445[_0x0928('0x23')][_0x0928('0x44')]);_0x2467a4[_0x0928('0x21')]=qs['filters'](_[_0x0928('0x45')](_0x2ac445[_0x0928('0x23')],_0x2f056b[_0x0928('0x2b')]));if(_0x2ac445[_0x0928('0x23')][_0x0928('0x46')]){_0x2467a4[_0x0928('0x21')]=_['merge'](_0x2467a4['where'],{'$or':_[_0x0928('0x48')](_0x2467a4[_0x0928('0x2c')],function(_0x2dd64a){var _0x1cff6d={};_0x1cff6d[_0x2dd64a]={'$like':'%'+_0x2ac445[_0x0928('0x23')][_0x0928('0x46')]+'%'};return _0x1cff6d;})});}_0x2467a4=_[_0x0928('0x47')]({},_0x2467a4,_0x2ac445['options']);return _0x3d2d12['getTeams'](_0x2467a4);}})[_0x0928('0x16')](function(_0x542ef9){if(_0x542ef9){_0x4af8cb=_0x542ef9[_0x0928('0x2e')];if(!_0x2ac445[_0x0928('0x23')][_0x0928('0x40')](_0x0928('0x41'))){_0x2467a4['limit']=qs[_0x0928('0x12')](_0x2ac445[_0x0928('0x23')][_0x0928('0x12')]);_0x2467a4[_0x0928('0x42')]=qs[_0x0928('0x42')](_0x2ac445[_0x0928('0x23')][_0x0928('0x42')]);}return _0x3d2d12[_0x0928('0x52')](_0x2467a4);}})[_0x0928('0x16')](function(_0x1c64ab){if(_0x1c64ab){return _0x1c64ab?{'count':_0x4af8cb,'rows':_0x1c64ab}:null;}})['then'](respondWithResult(_0x46ebd8,null))[_0x0928('0x26')](handleError(_0x46ebd8,null));};exports[_0x0928('0x53')]=function(_0x5e06eb,_0x18241d){var _0x4c61e9=_0x5e06eb[_0x0928('0x33')][_0x0928('0x54')];return db[_0x0928('0x51')][_0x0928('0x24')]({'where':{'id':_0x4c61e9},'attributes':['id'],'include':[{'model':db[_0x0928('0x49')],'as':_0x0928('0x55'),'attributes':['id',_0x0928('0x1a'),_0x0928('0x56'),_0x0928('0x57'),'interface'],'raw':!![]}]})[_0x0928('0x16')](function(_0x42968e){if(_0x42968e){var _0x29015e=_['flatMap'](_0x42968e,function(_0x87160a){var _0x2ce664=_0x87160a[_0x0928('0x35')]({'plain':!![]});return _0x2ce664[_0x0928('0x55')];});return db['ChatQueue'][_0x0928('0x31')]({'where':{'id':_0x5e06eb[_0x0928('0x28')]['id']}})[_0x0928('0x16')](function(_0x81b6f8){return db[_0x0928('0x58')]['transaction'](function(_0x1f73f7){return _0x81b6f8[_0x0928('0x53')](_0x4c61e9,{'transaction':_0x1f73f7})[_0x0928('0x16')](function(){return BPromise[_0x0928('0x59')](_0x29015e,function(_0x5ae10b){return db[_0x0928('0x3e')][_0x0928('0x5a')]({'where':{'UserId':_0x5ae10b['id'],'ChatQueueId':_0x5e06eb[_0x0928('0x28')]['id']},'transaction':_0x1f73f7});});})[_0x0928('0x16')](function(){_0x29015e['forEach'](function(_0x2237cf){socket['emit'](_0x0928('0x5b'),{'UserId':_0x2237cf['id'],'ChatQueueId':_0x81b6f8['id']});});});});});}})['then'](respondWithStatusCode(_0x18241d,null))[_0x0928('0x26')](handleError(_0x18241d,null));};exports[_0x0928('0x5c')]=function(_0x4c7ee4,_0x3e9d93){return db['Team'][_0x0928('0x24')]({'where':{'id':_0x4c7ee4[_0x0928('0x23')][_0x0928('0x54')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0928('0x55'),'attributes':['id'],'raw':!![]}]})[_0x0928('0x16')](handleEntityNotFound(_0x3e9d93,null))[_0x0928('0x16')](function(_0x596df1){var _0x3f8d62=_[_0x0928('0x48')](_0x596df1,'id');var _0x1fa1d4=[];var _0x39bbe2=[];var _0x31b075=squel[_0x0928('0x5d')]();_0x31b075[_0x0928('0x5e')](_0x0928('0x5f'))[_0x0928('0x60')](_0x0928('0x61'),'tq')[_0x0928('0x62')](_0x0928('0x63'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x0928('0x21')](_0x0928('0x64'),_0x4c7ee4[_0x0928('0x28')]['id']);for(var _0x939444=0x0;_0x939444<_0x596df1[_0x0928('0x2e')];_0x939444+=0x1){let _0x66455=_0x596df1[_0x939444];for(var _0x5e7466=0x0;_0x5e7466<_0x66455['Agents']['length'];_0x5e7466+=0x1){let _0x5d1615=_0x66455['Agents'][_0x5e7466];var _0x44acc0=_0x31b075[_0x0928('0x65')]();_0x44acc0[_0x0928('0x21')](_0x0928('0x66'),_0x5d1615['id']);_0x39bbe2[_0x0928('0x67')](db[_0x0928('0x58')][_0x0928('0x23')](_0x44acc0[_0x0928('0x68')](),{'type':db[_0x0928('0x58')][_0x0928('0x69')][_0x0928('0x6a')]})['then'](function(_0x257dab){if(_0x257dab[_0x0928('0x2e')]===0x1){return _0x5d1615['id'];}else{var _0x495804=_[_0x0928('0x6b')](_['map'](_0x257dab,'TeamId'),function(_0x2f3a54){return _['includes'](_0x3f8d62,_0x2f3a54);});if(_0x495804){return _0x5d1615['id'];}}}));}}return BPromise['all'](_0x39bbe2)[_0x0928('0x16')](function(_0x1d490b){_0x1fa1d4=_(_0x1fa1d4)['union'](_0x1d490b)[_0x0928('0x6c')]()[_0x0928('0x6d')]();return db['ChatQueue']['find']({'where':{'id':_0x4c7ee4[_0x0928('0x28')]['id']}})[_0x0928('0x16')](function(_0xea27fb){return db['sequelize'][_0x0928('0x6e')](function(_0x3e14ee){return _0xea27fb['removeTeams'](_0x4c7ee4['query']['ids'],{'transaction':_0x3e14ee})[_0x0928('0x16')](function(){if(!_[_0x0928('0x6f')](_0x1fa1d4)){return _0xea27fb[_0x0928('0x70')](_0x1fa1d4,{'transaction':_0x3e14ee});}})[_0x0928('0x16')](function(){_0x1fa1d4[_0x0928('0x71')](function(_0x3147f7){socket[_0x0928('0x72')](_0x0928('0x73'),{'UserId':_0x3147f7,'ChatQueueId':_0xea27fb['id']});});});});});});})[_0x0928('0x16')](respondWithStatusCode(_0x3e9d93,null))[_0x0928('0x26')](handleError(_0x3e9d93,null));};exports[_0x0928('0x74')]=function(_0x3b78e5,_0x5d2baf){return db['ChatQueue'][_0x0928('0x31')]({'where':{'id':_0x3b78e5[_0x0928('0x28')]['id']}})[_0x0928('0x16')](handleEntityNotFound(_0x5d2baf,null))['then'](function(_0x2ab39e){if(_0x2ab39e){return _0x2ab39e[_0x0928('0x74')](_0x3b78e5[_0x0928('0x33')][_0x0928('0x54')],_[_0x0928('0x75')](_0x3b78e5[_0x0928('0x33')],[_0x0928('0x54'),'id'])||{})['spread'](function(_0x489357){for(var _0x456db8=0x0;_0x456db8<_0x3b78e5[_0x0928('0x33')]['ids'][_0x0928('0x2e')];_0x456db8+=0x1){socket[_0x0928('0x72')](_0x0928('0x5b'),{'UserId':Number(_0x3b78e5[_0x0928('0x33')]['ids'][_0x456db8]),'ChatQueueId':Number(_0x3b78e5[_0x0928('0x28')]['id'])});}return _0x489357;});}})[_0x0928('0x16')](respondWithResult(_0x5d2baf,null))['catch'](handleError(_0x5d2baf,null));};exports[_0x0928('0x70')]=function(_0x391bc9,_0x1ce635){return db['ChatQueue'][_0x0928('0x31')]({'where':{'id':_0x391bc9[_0x0928('0x28')]['id']}})[_0x0928('0x16')](handleEntityNotFound(_0x1ce635,null))[_0x0928('0x16')](function(_0x27fb94){if(_0x27fb94){return _0x27fb94['removeAgents'](_0x391bc9[_0x0928('0x23')][_0x0928('0x54')])[_0x0928('0x16')](function(){if(_[_0x0928('0x76')](_0x391bc9['query'][_0x0928('0x54')])){for(var _0x384beb=0x0;_0x384beb<_0x391bc9[_0x0928('0x23')][_0x0928('0x54')][_0x0928('0x2e')];_0x384beb+=0x1){socket[_0x0928('0x72')](_0x0928('0x73'),{'UserId':Number(_0x391bc9[_0x0928('0x23')][_0x0928('0x54')][_0x384beb]),'ChatQueueId':Number(_0x391bc9[_0x0928('0x28')]['id'])});}}else{socket[_0x0928('0x72')](_0x0928('0x73'),{'UserId':Number(_0x391bc9[_0x0928('0x23')][_0x0928('0x54')]),'ChatQueueId':Number(_0x391bc9['params']['id'])});}});}})[_0x0928('0x16')](respondWithStatusCode(_0x1ce635,null))[_0x0928('0x26')](handleError(_0x1ce635,null));};exports[_0x0928('0x77')]=function(_0x8b0765,_0x3d339b){var _0x380086={};var _0x36711a={};var _0x15d2a6;var _0x33a5e6;return db[_0x0928('0x1c')][_0x0928('0x3d')]({'where':{'id':_0x8b0765[_0x0928('0x28')]['id']}})[_0x0928('0x16')](handleEntityNotFound(_0x3d339b,null))[_0x0928('0x16')](function(_0x278149){if(_0x278149){_0x15d2a6=_0x278149;_0x36711a[_0x0928('0x29')]=_[_0x0928('0x2a')](db[_0x0928('0x49')][_0x0928('0x1d')]);_0x36711a[_0x0928('0x23')]=_[_0x0928('0x2a')](_0x8b0765['query']);_0x36711a[_0x0928('0x2b')]=_['intersection'](_0x36711a[_0x0928('0x29')],_0x36711a[_0x0928('0x23')]);_0x380086[_0x0928('0x2c')]=_[_0x0928('0x2d')](_0x36711a[_0x0928('0x29')],qs[_0x0928('0x3f')](_0x8b0765['query'][_0x0928('0x3f')]));_0x380086[_0x0928('0x2c')]=_0x380086['attributes'][_0x0928('0x2e')]?_0x380086[_0x0928('0x2c')]:_0x36711a[_0x0928('0x29')];_0x380086['order']=qs[_0x0928('0x44')](_0x8b0765[_0x0928('0x23')][_0x0928('0x44')]);_0x380086[_0x0928('0x21')]=qs[_0x0928('0x2b')](_[_0x0928('0x45')](_0x8b0765[_0x0928('0x23')],_0x36711a[_0x0928('0x2b')]));if(_0x8b0765[_0x0928('0x23')]['filter']){_0x380086[_0x0928('0x21')]=_[_0x0928('0x47')](_0x380086[_0x0928('0x21')],{'$or':_[_0x0928('0x48')](_0x380086[_0x0928('0x2c')],function(_0x393d69){var _0x25eaf8={};_0x25eaf8[_0x393d69]={'$like':'%'+_0x8b0765[_0x0928('0x23')]['filter']+'%'};return _0x25eaf8;})});}_0x380086=_[_0x0928('0x47')]({},_0x380086,_0x8b0765[_0x0928('0x30')]);return _0x15d2a6['getAgents'](_0x380086);}})[_0x0928('0x16')](function(_0x5818d2){if(_0x5818d2){_0x33a5e6=_0x5818d2['length'];if(!_0x8b0765[_0x0928('0x23')]['hasOwnProperty'](_0x0928('0x41'))){_0x380086[_0x0928('0x12')]=qs[_0x0928('0x12')](_0x8b0765[_0x0928('0x23')][_0x0928('0x12')]);_0x380086[_0x0928('0x42')]=qs[_0x0928('0x42')](_0x8b0765[_0x0928('0x23')][_0x0928('0x42')]);}return _0x15d2a6[_0x0928('0x77')](_0x380086);}})[_0x0928('0x16')](function(_0x43d72b){if(_0x43d72b){return _0x43d72b?{'count':_0x33a5e6,'rows':_0x43d72b}:null;}})['then'](respondWithResult(_0x3d339b,null))['catch'](handleError(_0x3d339b,null));}; \ No newline at end of file +var _0x6c1f=['defaults','socket.io-emitter','redis','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','update','then','ChatQueues','UserProfileResource','destroy','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','rows','catch','show','params','model','keys','filters','attributes','intersection','fields','length','merge','options','find','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','UserChatQueue','nolimit','sort','ChatQueueId','filter','findAll','User','findAndCountAll','chatPause','createdAt','format','%s/%s','SIP','updatedAt','Team','order','hasOwnProperty','getTeams','addTeams','ids','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','sequelize','QueryTypes','SELECT','every','TeamId','all','removeAgents','userChatQueue:remove','addAgents','isArray','getAgents','bluebird','squel','ioredis','../../components/parsers/qs','../../config/logger','../../mysqldb'];(function(_0x2f37d3,_0x4ccc03){var _0x116b7d=function(_0x214080){while(--_0x214080){_0x2f37d3['push'](_0x2f37d3['shift']());}};_0x116b7d(++_0x4ccc03);}(_0x6c1f,0xe2));var _0xf6c1=function(_0x1f20d6,_0x1b4431){_0x1f20d6=_0x1f20d6-0x0;var _0x2a7f7f=_0x6c1f[_0x1f20d6];return _0x2a7f7f;};'use strict';var BPromise=require(_0xf6c1('0x0'));var util=require('util');var _=require('lodash');var squel=require(_0xf6c1('0x1'));var Redis=require(_0xf6c1('0x2'));var qs=require(_0xf6c1('0x3'));var logger=require(_0xf6c1('0x4'))('api');var config=require('../../config/environment');var db=require(_0xf6c1('0x5'))['db'];config['redis']=_[_0xf6c1('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf6c1('0x7'))(new Redis(config[_0xf6c1('0x8')]));require('./chatQueue.socket')[_0xf6c1('0x9')](socket);function respondWithStatusCode(_0x16d6fa,_0x245b56){_0x245b56=_0x245b56||0xcc;return function(_0x506072){if(_0x506072){return _0x16d6fa[_0xf6c1('0xa')](_0x245b56);}return _0x16d6fa[_0xf6c1('0xb')](_0x245b56)[_0xf6c1('0xc')]();};}function respondWithResult(_0x146180,_0x12fc1e){_0x12fc1e=_0x12fc1e||0xc8;return function(_0x3fff32){if(_0x3fff32){return _0x146180[_0xf6c1('0xb')](_0x12fc1e)['json'](_0x3fff32);}};}function respondWithFilteredResult(_0x4433e4,_0x2f61f0){return function(_0x359bce){if(_0x359bce){var _0x115cbd=typeof _0x2f61f0[_0xf6c1('0xd')]===_0xf6c1('0xe')&&typeof _0x2f61f0[_0xf6c1('0xf')]===_0xf6c1('0xe');var _0x1da69b=_0x359bce[_0xf6c1('0x10')];var _0x2480a0=_0x115cbd?0x0:_0x2f61f0[_0xf6c1('0xd')];var _0x387710=_0x115cbd?_0x359bce['count']:_0x2f61f0[_0xf6c1('0xd')]+_0x2f61f0[_0xf6c1('0xf')];var _0x2f160f;if(_0x387710>=_0x1da69b){_0x387710=_0x1da69b;_0x2f160f=0xc8;}else{_0x2f160f=0xce;}_0x4433e4[_0xf6c1('0xb')](_0x2f160f);return _0x4433e4[_0xf6c1('0x11')](_0xf6c1('0x12'),_0x2480a0+'-'+_0x387710+'/'+_0x1da69b)['json'](_0x359bce);}return null;};}function saveUpdates(_0x45b88f){return function(_0x55de00){if(_0x55de00){return _0x55de00[_0xf6c1('0x13')](_0x45b88f)['then'](function(_0x3538a1){return _0x3538a1;});}return null;};}function removeEntity(_0x1334ec){return function(_0x1069ea){if(_0x1069ea){return _0x1069ea['destroy']()[_0xf6c1('0x14')](function(){var _0x52edee=_0x1069ea['get']({'plain':!![]});var _0x1946de=_0xf6c1('0x15');return db[_0xf6c1('0x16')][_0xf6c1('0x17')]({'where':{'type':_0x1946de,'resourceId':_0x52edee['id']}})[_0xf6c1('0x14')](function(){return _0x1069ea;});})[_0xf6c1('0x14')](function(){_0x1334ec['status'](0xcc)[_0xf6c1('0xc')]();});}};}function handleEntityNotFound(_0x4c0744){return function(_0x25f0bc){if(!_0x25f0bc){_0x4c0744[_0xf6c1('0xa')](0x194);}return _0x25f0bc;};}function handleError(_0x308ebd,_0x96b102){_0x96b102=_0x96b102||0x1f4;return function(_0x5418c7){logger['error'](_0x5418c7[_0xf6c1('0x18')]);if(_0x5418c7[_0xf6c1('0x19')]){delete _0x5418c7['name'];}_0x308ebd['status'](_0x96b102)[_0xf6c1('0x1a')](_0x5418c7);};}exports[_0xf6c1('0x1b')]=function(_0x33cb2d,_0x326439){var _0x2f8d3a={};var _0x1228c3={'count':0x0,'rows':[]};var _0x8681e4=_[_0xf6c1('0x1c')](db[_0xf6c1('0x1d')][_0xf6c1('0x1e')],function(_0x58387d){return{'name':_0x58387d[_0xf6c1('0x1f')],'type':_0x58387d[_0xf6c1('0x20')][_0xf6c1('0x21')]};});_0x2f8d3a=qs[_0xf6c1('0x22')](_0x8681e4,_0x33cb2d);var _0x2bb4e3={'where':_0x2f8d3a[_0xf6c1('0x23')]};return db[_0xf6c1('0x1d')][_0xf6c1('0x10')](_0x2bb4e3)[_0xf6c1('0x14')](function(_0x338999){_0x1228c3[_0xf6c1('0x10')]=_0x338999;_0x2f8d3a[_0xf6c1('0x24')]=qs[_0xf6c1('0x24')](_0x33cb2d[_0xf6c1('0x25')]);return db[_0xf6c1('0x1d')]['findAll'](_0x2f8d3a);})[_0xf6c1('0x14')](function(_0x2e55c6){_0x1228c3[_0xf6c1('0x26')]=_0x2e55c6;return _0x1228c3;})['then'](respondWithFilteredResult(_0x326439,_0x2f8d3a))[_0xf6c1('0x27')](handleError(_0x326439,null));};exports[_0xf6c1('0x28')]=function(_0x44700f,_0x110511){var _0x2a3cba={'raw':!![],'where':{'id':_0x44700f[_0xf6c1('0x29')]['id']}},_0x2986dd={};_0x2986dd[_0xf6c1('0x2a')]=_[_0xf6c1('0x2b')](db[_0xf6c1('0x1d')][_0xf6c1('0x1e')]);_0x2986dd[_0xf6c1('0x25')]=_['keys'](_0x44700f[_0xf6c1('0x25')]);_0x2986dd[_0xf6c1('0x2c')]=_['intersection'](_0x2986dd['model'],_0x2986dd[_0xf6c1('0x25')]);_0x2a3cba[_0xf6c1('0x2d')]=_[_0xf6c1('0x2e')](_0x2986dd[_0xf6c1('0x2a')],qs[_0xf6c1('0x2f')](_0x44700f[_0xf6c1('0x25')][_0xf6c1('0x2f')]));_0x2a3cba[_0xf6c1('0x2d')]=_0x2a3cba['attributes'][_0xf6c1('0x30')]?_0x2a3cba[_0xf6c1('0x2d')]:_0x2986dd['model'];if(_0x44700f[_0xf6c1('0x25')]['includeAll']){_0x2a3cba[_0xf6c1('0x24')]=[{'all':!![]}];}_0x2a3cba=_[_0xf6c1('0x31')]({},_0x2a3cba,_0x44700f[_0xf6c1('0x32')]);return db[_0xf6c1('0x1d')][_0xf6c1('0x33')](_0x2a3cba)[_0xf6c1('0x14')](handleEntityNotFound(_0x110511,null))[_0xf6c1('0x14')](respondWithResult(_0x110511,null))[_0xf6c1('0x27')](handleError(_0x110511,null));};exports['create']=function(_0x28bc2b,_0x1fdcab){return db[_0xf6c1('0x1d')]['create'](_0x28bc2b['body'],{})[_0xf6c1('0x14')](function(_0x24ad98){var _0x14ad09=_0x28bc2b[_0xf6c1('0x34')][_0xf6c1('0x35')]({'plain':!![]});if(!_0x14ad09)throw new Error(_0xf6c1('0x36'));if(_0x14ad09[_0xf6c1('0x37')]===_0xf6c1('0x34')){var _0x816c23=_0x24ad98['get']({'plain':!![]});var _0x3c9d62=_0xf6c1('0x15');return db[_0xf6c1('0x38')]['find']({'where':{'name':_0x3c9d62,'userProfileId':_0x14ad09[_0xf6c1('0x39')]},'raw':!![]})[_0xf6c1('0x14')](function(_0x456864){if(_0x456864&&_0x456864['autoAssociation']===0x0){return db[_0xf6c1('0x16')][_0xf6c1('0x3a')]({'name':_0x816c23['name'],'resourceId':_0x816c23['id'],'type':_0x456864[_0xf6c1('0x19')],'sectionId':_0x456864['id']},{})[_0xf6c1('0x14')](function(){return _0x24ad98;});}else{return _0x24ad98;}})[_0xf6c1('0x27')](function(_0x19f03c){logger[_0xf6c1('0x3b')](_0xf6c1('0x3c'),_0x19f03c);throw _0x19f03c;});}return _0x24ad98;})[_0xf6c1('0x14')](respondWithResult(_0x1fdcab,0xc9))[_0xf6c1('0x27')](handleError(_0x1fdcab,null));};exports[_0xf6c1('0x13')]=function(_0x21bacf,_0x4a275b){if(_0x21bacf['body']['id']){delete _0x21bacf[_0xf6c1('0x3d')]['id'];}return db[_0xf6c1('0x1d')][_0xf6c1('0x33')]({'where':{'id':_0x21bacf[_0xf6c1('0x29')]['id']}})[_0xf6c1('0x14')](handleEntityNotFound(_0x4a275b,null))[_0xf6c1('0x14')](saveUpdates(_0x21bacf[_0xf6c1('0x3d')],null))[_0xf6c1('0x14')](respondWithResult(_0x4a275b,null))[_0xf6c1('0x27')](handleError(_0x4a275b,null));};exports[_0xf6c1('0x17')]=function(_0x6eeac4,_0x3d4ff6){return db[_0xf6c1('0x1d')]['find']({'where':{'id':_0x6eeac4[_0xf6c1('0x29')]['id']}})[_0xf6c1('0x14')](handleEntityNotFound(_0x3d4ff6,null))[_0xf6c1('0x14')](removeEntity(_0x3d4ff6,null))[_0xf6c1('0x27')](handleError(_0x3d4ff6,null));};exports[_0xf6c1('0x3e')]=function(_0x4aa06c,_0x124259){return db[_0xf6c1('0x1d')][_0xf6c1('0x3e')]()[_0xf6c1('0x14')](respondWithResult(_0x124259,null))[_0xf6c1('0x27')](handleError(_0x124259,null));};exports['getMembers']=function(_0x4a9741,_0x1d5794){var _0x1b9839={'raw':!![],'where':{}},_0x2cdb85={},_0x13dbbf;return db[_0xf6c1('0x1d')][_0xf6c1('0x3f')]({'where':{'id':_0x4a9741[_0xf6c1('0x29')]['id']}})[_0xf6c1('0x14')](handleEntityNotFound(_0x1d5794,null))['then'](function(_0xa22c43){if(_0xa22c43){_0x13dbbf=_0xa22c43['get']({'plain':!![]});_0x2cdb85['model']=_[_0xf6c1('0x2b')](db[_0xf6c1('0x40')][_0xf6c1('0x1e')]);_0x2cdb85[_0xf6c1('0x25')]=_['keys'](_0x4a9741[_0xf6c1('0x25')]);_0x2cdb85[_0xf6c1('0x2c')]=_[_0xf6c1('0x2e')](_0x2cdb85['model'],_0x2cdb85[_0xf6c1('0x25')]);_0x1b9839[_0xf6c1('0x2d')]=_[_0xf6c1('0x2e')](_0x2cdb85['model'],qs[_0xf6c1('0x2f')](_0x4a9741[_0xf6c1('0x25')]['fields']));_0x1b9839['attributes']=_0x1b9839[_0xf6c1('0x2d')]['length']?_0x1b9839[_0xf6c1('0x2d')]:_0x2cdb85[_0xf6c1('0x2a')];if(!_0x4a9741['query']['hasOwnProperty'](_0xf6c1('0x41'))){_0x1b9839[_0xf6c1('0xf')]=qs[_0xf6c1('0xf')](_0x4a9741[_0xf6c1('0x25')][_0xf6c1('0xf')]);_0x1b9839['offset']=qs[_0xf6c1('0xd')](_0x4a9741[_0xf6c1('0x25')]['offset']);}_0x1b9839['order']=qs[_0xf6c1('0x42')](_0x4a9741[_0xf6c1('0x25')]['sort']);_0x1b9839[_0xf6c1('0x23')]=qs['filters'](_['pick'](_0x4a9741['query'],_0x2cdb85[_0xf6c1('0x2c')]));_0x1b9839['where'][_0xf6c1('0x43')]=_0xa22c43['id'];if(_0x4a9741[_0xf6c1('0x25')]['filter']){_0x1b9839[_0xf6c1('0x23')]=_[_0xf6c1('0x31')](_0x1b9839['where'],{'$or':_['map'](_0x1b9839[_0xf6c1('0x2d')],function(_0x12b80f){var _0x29c09d={};_0x29c09d[_0x12b80f]={'$like':'%'+_0x4a9741[_0xf6c1('0x25')][_0xf6c1('0x44')]+'%'};return _0x29c09d;})});}_0x1b9839=_[_0xf6c1('0x31')]({},_0x1b9839,_0x4a9741[_0xf6c1('0x32')]);return db[_0xf6c1('0x40')][_0xf6c1('0x45')](_0x1b9839);}})['then'](function(_0x1149d6){if(_0x1149d6){return db[_0xf6c1('0x46')][_0xf6c1('0x47')]({'where':{'id':_[_0xf6c1('0x1c')](_0x1149d6,'UserId'),'role':'agent'},'attributes':['id','name',_0xf6c1('0x48'),'updatedAt',_0xf6c1('0x49')]});}})['then'](function(_0x19c915){if(_0x19c915){return{'count':_0x19c915[_0xf6c1('0x10')],'rows':_['map'](_0x19c915[_0xf6c1('0x26')],function(_0x1b4753){return{'membername':_0x1b4753[_0xf6c1('0x19')],'UserId':_0x1b4753['id'],'queue_name':_0x13dbbf[_0xf6c1('0x19')],'ChatQueueId':_0x13dbbf['id'],'interface':util[_0xf6c1('0x4a')](_0xf6c1('0x4b'),_0xf6c1('0x4c'),_0x1b4753[_0xf6c1('0x19')]),'penalty':0x0,'paused':_0x1b4753[_0xf6c1('0x48')],'createdAt':_0x1b4753[_0xf6c1('0x49')],'updatedAt':_0x1b4753[_0xf6c1('0x4d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf6c1('0x14')](respondWithFilteredResult(_0x1d5794,_0x1b9839))[_0xf6c1('0x27')](handleError(_0x1d5794,null));};exports['getTeams']=function(_0x3a72b0,_0x57c7bd){var _0x5dcd35={};var _0x507fab={};var _0x10460f;var _0x1e72f1;return db[_0xf6c1('0x1d')][_0xf6c1('0x3f')]({'where':{'id':_0x3a72b0[_0xf6c1('0x29')]['id']}})[_0xf6c1('0x14')](handleEntityNotFound(_0x57c7bd,null))[_0xf6c1('0x14')](function(_0x355b2a){if(_0x355b2a){_0x10460f=_0x355b2a;_0x507fab['model']=_['keys'](db[_0xf6c1('0x4e')][_0xf6c1('0x1e')]);_0x507fab['query']=_[_0xf6c1('0x2b')](_0x3a72b0[_0xf6c1('0x25')]);_0x507fab[_0xf6c1('0x2c')]=_['intersection'](_0x507fab['model'],_0x507fab['query']);_0x5dcd35[_0xf6c1('0x2d')]=_[_0xf6c1('0x2e')](_0x507fab[_0xf6c1('0x2a')],qs[_0xf6c1('0x2f')](_0x3a72b0['query'][_0xf6c1('0x2f')]));_0x5dcd35[_0xf6c1('0x2d')]=_0x5dcd35[_0xf6c1('0x2d')][_0xf6c1('0x30')]?_0x5dcd35[_0xf6c1('0x2d')]:_0x507fab['model'];_0x5dcd35[_0xf6c1('0x4f')]=qs[_0xf6c1('0x42')](_0x3a72b0[_0xf6c1('0x25')][_0xf6c1('0x42')]);_0x5dcd35[_0xf6c1('0x23')]=qs['filters'](_['pick'](_0x3a72b0[_0xf6c1('0x25')],_0x507fab['filters']));if(_0x3a72b0['query']['filter']){_0x5dcd35[_0xf6c1('0x23')]=_[_0xf6c1('0x31')](_0x5dcd35['where'],{'$or':_[_0xf6c1('0x1c')](_0x5dcd35[_0xf6c1('0x2d')],function(_0x2ccaea){var _0x40aa30={};_0x40aa30[_0x2ccaea]={'$like':'%'+_0x3a72b0[_0xf6c1('0x25')][_0xf6c1('0x44')]+'%'};return _0x40aa30;})});}_0x5dcd35=_[_0xf6c1('0x31')]({},_0x5dcd35,_0x3a72b0[_0xf6c1('0x32')]);return _0x10460f['getTeams'](_0x5dcd35);}})['then'](function(_0x4d4450){if(_0x4d4450){_0x1e72f1=_0x4d4450['length'];if(!_0x3a72b0['query'][_0xf6c1('0x50')]('nolimit')){_0x5dcd35[_0xf6c1('0xf')]=qs[_0xf6c1('0xf')](_0x3a72b0['query'][_0xf6c1('0xf')]);_0x5dcd35[_0xf6c1('0xd')]=qs[_0xf6c1('0xd')](_0x3a72b0['query'][_0xf6c1('0xd')]);}return _0x10460f[_0xf6c1('0x51')](_0x5dcd35);}})['then'](function(_0x20a604){if(_0x20a604){return _0x20a604?{'count':_0x1e72f1,'rows':_0x20a604}:null;}})['then'](respondWithResult(_0x57c7bd,null))[_0xf6c1('0x27')](handleError(_0x57c7bd,null));};exports[_0xf6c1('0x52')]=function(_0x435750,_0x5154a3){var _0x4ef17d=_0x435750['body'][_0xf6c1('0x53')];return db[_0xf6c1('0x4e')][_0xf6c1('0x45')]({'where':{'id':_0x4ef17d},'attributes':['id'],'include':[{'model':db['User'],'as':_0xf6c1('0x54'),'attributes':['id','name',_0xf6c1('0x55'),_0xf6c1('0x56'),_0xf6c1('0x57')],'raw':!![]}]})['then'](function(_0x37ed65){if(_0x37ed65){var _0x1c638a=_[_0xf6c1('0x58')](_0x37ed65,function(_0x20ebd2){var _0x403f0d=_0x20ebd2[_0xf6c1('0x35')]({'plain':!![]});return _0x403f0d[_0xf6c1('0x54')];});return db[_0xf6c1('0x1d')][_0xf6c1('0x33')]({'where':{'id':_0x435750[_0xf6c1('0x29')]['id']}})['then'](function(_0x182ab8){return db['sequelize'][_0xf6c1('0x59')](function(_0x55283f){return _0x182ab8[_0xf6c1('0x52')](_0x4ef17d,{'transaction':_0x55283f})[_0xf6c1('0x14')](function(){return BPromise[_0xf6c1('0x5a')](_0x1c638a,function(_0x20f42c){return db[_0xf6c1('0x40')][_0xf6c1('0x5b')]({'where':{'UserId':_0x20f42c['id'],'ChatQueueId':_0x435750[_0xf6c1('0x29')]['id']},'transaction':_0x55283f});});})['then'](function(){_0x1c638a[_0xf6c1('0x5c')](function(_0x3147aa){socket[_0xf6c1('0x5d')](_0xf6c1('0x5e'),{'UserId':_0x3147aa['id'],'ChatQueueId':_0x182ab8['id']});});});});});}})[_0xf6c1('0x14')](respondWithStatusCode(_0x5154a3,null))[_0xf6c1('0x27')](handleError(_0x5154a3,null));};exports[_0xf6c1('0x5f')]=function(_0x49ded8,_0x4e93e9){return db[_0xf6c1('0x4e')][_0xf6c1('0x45')]({'where':{'id':_0x49ded8[_0xf6c1('0x25')][_0xf6c1('0x53')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xf6c1('0x54'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4e93e9,null))[_0xf6c1('0x14')](function(_0x3e80df){var _0x46d9fb=_['map'](_0x3e80df,'id');var _0x41206c=[];var _0x157f08=[];var _0x4b6c1f=squel[_0xf6c1('0x60')]();_0x4b6c1f[_0xf6c1('0x61')](_0xf6c1('0x62'))[_0xf6c1('0x63')](_0xf6c1('0x64'),'tq')[_0xf6c1('0x65')](_0xf6c1('0x66'),'ut',_0xf6c1('0x67'))[_0xf6c1('0x23')](_0xf6c1('0x68'),_0x49ded8['params']['id']);for(var _0x2c5664=0x0;_0x2c5664<_0x3e80df[_0xf6c1('0x30')];_0x2c5664+=0x1){let _0x423dfa=_0x3e80df[_0x2c5664];for(var _0xb1602a=0x0;_0xb1602a<_0x423dfa[_0xf6c1('0x54')][_0xf6c1('0x30')];_0xb1602a+=0x1){let _0x415988=_0x423dfa['Agents'][_0xb1602a];var _0x4c0d06=_0x4b6c1f['clone']();_0x4c0d06[_0xf6c1('0x23')]('ut.UserId\x20=\x20?',_0x415988['id']);_0x157f08['push'](db[_0xf6c1('0x69')][_0xf6c1('0x25')](_0x4c0d06['toString'](),{'type':db['sequelize'][_0xf6c1('0x6a')][_0xf6c1('0x6b')]})[_0xf6c1('0x14')](function(_0x4efa5d){if(_0x4efa5d[_0xf6c1('0x30')]===0x1){return _0x415988['id'];}else{var _0x5c36d3=_[_0xf6c1('0x6c')](_['map'](_0x4efa5d,_0xf6c1('0x6d')),function(_0x245d2b){return _['includes'](_0x46d9fb,_0x245d2b);});if(_0x5c36d3){return _0x415988['id'];}}}));}}return BPromise[_0xf6c1('0x6e')](_0x157f08)['then'](function(_0xedc047){_0x41206c=_(_0x41206c)['union'](_0xedc047)['compact']()['value']();return db[_0xf6c1('0x1d')][_0xf6c1('0x33')]({'where':{'id':_0x49ded8[_0xf6c1('0x29')]['id']}})[_0xf6c1('0x14')](function(_0x170c0a){return db['sequelize'][_0xf6c1('0x59')](function(_0x5a1cba){return _0x170c0a[_0xf6c1('0x5f')](_0x49ded8[_0xf6c1('0x25')]['ids'],{'transaction':_0x5a1cba})['then'](function(){if(!_['isEmpty'](_0x41206c)){return _0x170c0a[_0xf6c1('0x6f')](_0x41206c,{'transaction':_0x5a1cba});}})[_0xf6c1('0x14')](function(){_0x41206c[_0xf6c1('0x5c')](function(_0x8770a6){socket['emit'](_0xf6c1('0x70'),{'UserId':_0x8770a6,'ChatQueueId':_0x170c0a['id']});});});});});});})[_0xf6c1('0x14')](respondWithStatusCode(_0x4e93e9,null))['catch'](handleError(_0x4e93e9,null));};exports[_0xf6c1('0x71')]=function(_0x2dc1fe,_0x5a5976){return db['ChatQueue'][_0xf6c1('0x33')]({'where':{'id':_0x2dc1fe[_0xf6c1('0x29')]['id']}})[_0xf6c1('0x14')](handleEntityNotFound(_0x5a5976,null))['then'](function(_0x35d246){if(_0x35d246){return _0x35d246[_0xf6c1('0x71')](_0x2dc1fe[_0xf6c1('0x3d')]['ids'],_['omit'](_0x2dc1fe['body'],['ids','id'])||{})['spread'](function(_0x2c74e2){for(var _0x2f20dc=0x0;_0x2f20dc<_0x2dc1fe[_0xf6c1('0x3d')]['ids'][_0xf6c1('0x30')];_0x2f20dc+=0x1){socket[_0xf6c1('0x5d')](_0xf6c1('0x5e'),{'UserId':Number(_0x2dc1fe[_0xf6c1('0x3d')][_0xf6c1('0x53')][_0x2f20dc]),'ChatQueueId':Number(_0x2dc1fe[_0xf6c1('0x29')]['id'])});}return _0x2c74e2;});}})[_0xf6c1('0x14')](respondWithResult(_0x5a5976,null))[_0xf6c1('0x27')](handleError(_0x5a5976,null));};exports[_0xf6c1('0x6f')]=function(_0x5ab236,_0x3d9449){return db[_0xf6c1('0x1d')][_0xf6c1('0x33')]({'where':{'id':_0x5ab236[_0xf6c1('0x29')]['id']}})[_0xf6c1('0x14')](handleEntityNotFound(_0x3d9449,null))[_0xf6c1('0x14')](function(_0x81db9){if(_0x81db9){return _0x81db9[_0xf6c1('0x6f')](_0x5ab236[_0xf6c1('0x25')][_0xf6c1('0x53')])[_0xf6c1('0x14')](function(){if(_[_0xf6c1('0x72')](_0x5ab236[_0xf6c1('0x25')]['ids'])){for(var _0x5aec16=0x0;_0x5aec16<_0x5ab236[_0xf6c1('0x25')]['ids'][_0xf6c1('0x30')];_0x5aec16+=0x1){socket['emit'](_0xf6c1('0x70'),{'UserId':Number(_0x5ab236[_0xf6c1('0x25')][_0xf6c1('0x53')][_0x5aec16]),'ChatQueueId':Number(_0x5ab236[_0xf6c1('0x29')]['id'])});}}else{socket[_0xf6c1('0x5d')](_0xf6c1('0x70'),{'UserId':Number(_0x5ab236['query']['ids']),'ChatQueueId':Number(_0x5ab236[_0xf6c1('0x29')]['id'])});}});}})[_0xf6c1('0x14')](respondWithStatusCode(_0x3d9449,null))[_0xf6c1('0x27')](handleError(_0x3d9449,null));};exports[_0xf6c1('0x73')]=function(_0x33c95b,_0x2fbe56){var _0x4d1f={};var _0x198300={};var _0x375683;var _0x2ad275;return db['ChatQueue'][_0xf6c1('0x3f')]({'where':{'id':_0x33c95b[_0xf6c1('0x29')]['id']}})['then'](handleEntityNotFound(_0x2fbe56,null))[_0xf6c1('0x14')](function(_0x380efb){if(_0x380efb){_0x375683=_0x380efb;_0x198300[_0xf6c1('0x2a')]=_['keys'](db[_0xf6c1('0x46')][_0xf6c1('0x1e')]);_0x198300[_0xf6c1('0x25')]=_[_0xf6c1('0x2b')](_0x33c95b[_0xf6c1('0x25')]);_0x198300[_0xf6c1('0x2c')]=_['intersection'](_0x198300['model'],_0x198300[_0xf6c1('0x25')]);_0x4d1f[_0xf6c1('0x2d')]=_[_0xf6c1('0x2e')](_0x198300[_0xf6c1('0x2a')],qs[_0xf6c1('0x2f')](_0x33c95b[_0xf6c1('0x25')][_0xf6c1('0x2f')]));_0x4d1f['attributes']=_0x4d1f[_0xf6c1('0x2d')][_0xf6c1('0x30')]?_0x4d1f[_0xf6c1('0x2d')]:_0x198300[_0xf6c1('0x2a')];_0x4d1f[_0xf6c1('0x4f')]=qs[_0xf6c1('0x42')](_0x33c95b[_0xf6c1('0x25')]['sort']);_0x4d1f[_0xf6c1('0x23')]=qs[_0xf6c1('0x2c')](_['pick'](_0x33c95b[_0xf6c1('0x25')],_0x198300[_0xf6c1('0x2c')]));if(_0x33c95b[_0xf6c1('0x25')][_0xf6c1('0x44')]){_0x4d1f[_0xf6c1('0x23')]=_[_0xf6c1('0x31')](_0x4d1f[_0xf6c1('0x23')],{'$or':_[_0xf6c1('0x1c')](_0x4d1f[_0xf6c1('0x2d')],function(_0x10e0c6){var _0x118343={};_0x118343[_0x10e0c6]={'$like':'%'+_0x33c95b[_0xf6c1('0x25')][_0xf6c1('0x44')]+'%'};return _0x118343;})});}_0x4d1f=_[_0xf6c1('0x31')]({},_0x4d1f,_0x33c95b[_0xf6c1('0x32')]);return _0x375683[_0xf6c1('0x73')](_0x4d1f);}})[_0xf6c1('0x14')](function(_0xfebe7a){if(_0xfebe7a){_0x2ad275=_0xfebe7a['length'];if(!_0x33c95b['query'][_0xf6c1('0x50')]('nolimit')){_0x4d1f['limit']=qs['limit'](_0x33c95b['query'][_0xf6c1('0xf')]);_0x4d1f['offset']=qs[_0xf6c1('0xd')](_0x33c95b[_0xf6c1('0x25')][_0xf6c1('0xd')]);}return _0x375683['getAgents'](_0x4d1f);}})['then'](function(_0xb466cd){if(_0xb466cd){return _0xb466cd?{'count':_0x2ad275,'rows':_0xb466cd}:null;}})['then'](respondWithResult(_0x2fbe56,null))[_0xf6c1('0x27')](handleError(_0x2fbe56,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 7745f14..e076a7f 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 _0x3cc8=['remove','emit','hasOwnProperty','ChatQueue','setMaxListeners','save','update'];(function(_0x35278e,_0x219be3){var _0x250560=function(_0x1b7ab9){while(--_0x1b7ab9){_0x35278e['push'](_0x35278e['shift']());}};_0x250560(++_0x219be3);}(_0x3cc8,0x1ca));var _0x83cc=function(_0x1e5ba6,_0x562579){_0x1e5ba6=_0x1e5ba6-0x0;var _0x146c88=_0x3cc8[_0x1e5ba6];return _0x146c88;};'use strict';var EventEmitter=require('events');var ChatQueue=require('../../mysqldb')['db'][_0x83cc('0x0')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x83cc('0x1')](0x0);var events={'afterCreate':_0x83cc('0x2'),'afterUpdate':_0x83cc('0x3'),'afterDestroy':_0x83cc('0x4')};function emitEvent(_0x339ce7){return function(_0x5775b9,_0x547be9,_0x2ef9b8){ChatQueueEvents[_0x83cc('0x5')](_0x339ce7+':'+_0x5775b9['id'],_0x5775b9);ChatQueueEvents[_0x83cc('0x5')](_0x339ce7,_0x5775b9);_0x2ef9b8(null);};}for(var e in events){if(events[_0x83cc('0x6')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0x36ea=['../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit','hook','exports','events'];(function(_0x1f3655,_0x2d9dbd){var _0x4e5725=function(_0xacdbcd){while(--_0xacdbcd){_0x1f3655['push'](_0x1f3655['shift']());}};_0x4e5725(++_0x2d9dbd);}(_0x36ea,0x10d));var _0xa36e=function(_0x4ec42,_0x36177b){_0x4ec42=_0x4ec42-0x0;var _0x385e11=_0x36ea[_0x4ec42];return _0x385e11;};'use strict';var EventEmitter=require(_0xa36e('0x0'));var ChatQueue=require(_0xa36e('0x1'))['db'][_0xa36e('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xa36e('0x3')](0x0);var events={'afterCreate':_0xa36e('0x4'),'afterUpdate':_0xa36e('0x5'),'afterDestroy':_0xa36e('0x6')};function emitEvent(_0x5ed57e){return function(_0x2788c5,_0x359d44,_0x47a863){ChatQueueEvents[_0xa36e('0x7')](_0x5ed57e+':'+_0x2788c5['id'],_0x2788c5);ChatQueueEvents['emit'](_0x5ed57e,_0x2788c5);_0x47a863(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xa36e('0x8')](e,emitEvent(event));}}module[_0xa36e('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 6cd85ae..9cc8242 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 _0xed86=['ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports'];(function(_0x5d9341,_0x3b6c34){var _0xf55979=function(_0x1fc670){while(--_0x1fc670){_0x5d9341['push'](_0x5d9341['shift']());}};_0xf55979(++_0x3b6c34);}(_0xed86,0xff));var _0x6ed8=function(_0xd39959,_0x302d09){_0xd39959=_0xd39959-0x0;var _0x1ff69c=_0xed86[_0xd39959];return _0x1ff69c;};'use strict';var _=require(_0x6ed8('0x0'));var util=require(_0x6ed8('0x1'));var logger=require(_0x6ed8('0x2'))(_0x6ed8('0x3'));var moment=require(_0x6ed8('0x4'));var BPromise=require('bluebird');var rp=require(_0x6ed8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6ed8('0x6'));var config=require(_0x6ed8('0x7'));var attributes=require('./chatQueue.attributes');module[_0x6ed8('0x8')]=function(_0x2ae2dd,_0x36243c){return _0x2ae2dd['define'](_0x6ed8('0x9'),attributes,{'tableName':_0x6ed8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbb77=['./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x4fc660,_0x57be97){var _0x577457=function(_0x1a322a){while(--_0x1a322a){_0x4fc660['push'](_0x4fc660['shift']());}};_0x577457(++_0x57be97);}(_0xbb77,0x164));var _0x7bb7=function(_0x3c3ff7,_0x810fc0){_0x3c3ff7=_0x3c3ff7-0x0;var _0xb44ede=_0xbb77[_0x3c3ff7];return _0xb44ede;};'use strict';var _=require(_0x7bb7('0x0'));var util=require(_0x7bb7('0x1'));var logger=require(_0x7bb7('0x2'))(_0x7bb7('0x3'));var moment=require('moment');var BPromise=require(_0x7bb7('0x4'));var rp=require(_0x7bb7('0x5'));var fs=require('fs');var path=require(_0x7bb7('0x6'));var rimraf=require('rimraf');var config=require(_0x7bb7('0x7'));var attributes=require(_0x7bb7('0x8'));module[_0x7bb7('0x9')]=function(_0x1cd6b9,_0x193693){return _0x1cd6b9[_0x7bb7('0xa')](_0x7bb7('0xb'),attributes,{'tableName':_0x7bb7('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 aa987fc..2cc2920 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 _0x641b=['include','map','model','GetChatQueue','debug','ShowChatQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','ChatQueue','options','raw','where','attributes','limit'];(function(_0x4ac485,_0x3f8fe2){var _0x12643b=function(_0x45b0e4){while(--_0x45b0e4){_0x4ac485['push'](_0x4ac485['shift']());}};_0x12643b(++_0x3f8fe2);}(_0x641b,0xca));var _0xb641=function(_0x7649c2,_0x510059){_0x7649c2=_0x7649c2-0x0;var _0x48d9c6=_0x641b[_0x7649c2];return _0x48d9c6;};'use strict';var _=require(_0xb641('0x0'));var util=require('util');var moment=require(_0xb641('0x1'));var BPromise=require(_0xb641('0x2'));var rs=require(_0xb641('0x3'));var fs=require('fs');var Redis=require(_0xb641('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb641('0x5'));var logger=require(_0xb641('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb641('0x7'));var client=jayson[_0xb641('0x8')][_0xb641('0x9')]({'port':0x232a});config[_0xb641('0xa')]=_[_0xb641('0xb')](config[_0xb641('0xa')],{'host':_0xb641('0xc'),'port':0x18eb});var socket=require(_0xb641('0xd'))(new Redis(config['redis']));require(_0xb641('0xe'))[_0xb641('0xf')](socket);function respondWithRpcPromise(_0x3f3c32,_0x4e7ee4,_0x3f1597){return new BPromise(function(_0x30d931,_0x784c8b){return client[_0xb641('0x10')](_0x3f3c32,_0x3f1597)[_0xb641('0x11')](function(_0x530a49){logger['info'](_0xb641('0x12'),_0x4e7ee4,_0xb641('0x13'));logger['debug'](_0xb641('0x14'),_0x4e7ee4,'request\x20sent',JSON[_0xb641('0x15')](_0x530a49));if(_0x530a49[_0xb641('0x16')]){if(_0x530a49['error']['code']===0x1f4){logger['error'](_0xb641('0x12'),_0x4e7ee4,_0x530a49[_0xb641('0x16')][_0xb641('0x17')]);return _0x784c8b(_0x530a49[_0xb641('0x16')][_0xb641('0x17')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x4e7ee4,_0x530a49[_0xb641('0x16')]['message']);return _0x30d931(_0x530a49[_0xb641('0x16')][_0xb641('0x17')]);}else{logger[_0xb641('0x18')](_0xb641('0x12'),_0x4e7ee4,'request\x20sent');_0x30d931(_0x530a49['result'][_0xb641('0x17')]);}})[_0xb641('0x19')](function(_0x64dc7c){logger['error'](_0xb641('0x12'),_0x4e7ee4,_0x64dc7c);_0x784c8b(_0x64dc7c);});});}exports['GetChatQueue']=function(_0x4d520c){var _0x513606=this;return new Promise(function(_0x18f314,_0x1c4d6c){return db[_0xb641('0x1a')]['findAll']({'raw':_0x4d520c[_0xb641('0x1b')]?_0x4d520c[_0xb641('0x1b')][_0xb641('0x1c')]===undefined?!![]:![]:!![],'where':_0x4d520c['options']?_0x4d520c[_0xb641('0x1b')][_0xb641('0x1d')]||null:null,'attributes':_0x4d520c[_0xb641('0x1b')]?_0x4d520c['options'][_0xb641('0x1e')]||null:null,'limit':_0x4d520c['options']?_0x4d520c['options'][_0xb641('0x1f')]||null:null,'include':_0x4d520c[_0xb641('0x1b')]?_0x4d520c[_0xb641('0x1b')][_0xb641('0x20')]?_[_0xb641('0x21')](_0x4d520c['options']['include'],function(_0x23142b){return{'model':db[_0x23142b[_0xb641('0x22')]],'as':_0x23142b['as'],'attributes':_0x23142b[_0xb641('0x1e')],'include':_0x23142b[_0xb641('0x20')]?_[_0xb641('0x21')](_0x23142b[_0xb641('0x20')],function(_0x3e9b7f){return{'model':db[_0x3e9b7f[_0xb641('0x22')]],'as':_0x3e9b7f['as'],'attributes':_0x3e9b7f[_0xb641('0x1e')],'include':_0x3e9b7f[_0xb641('0x20')]?_[_0xb641('0x21')](_0x3e9b7f[_0xb641('0x20')],function(_0x3a28ca){return{'model':db[_0x3a28ca['model']],'as':_0x3a28ca['as'],'attributes':_0x3a28ca[_0xb641('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xb641('0x11')](function(_0x1aaf26){logger[_0xb641('0x18')](_0xb641('0x23'),_0x4d520c);logger[_0xb641('0x24')]('GetChatQueue',_0x4d520c,JSON[_0xb641('0x15')](_0x1aaf26));_0x18f314(_0x1aaf26);})[_0xb641('0x19')](function(_0x1e1b21){logger[_0xb641('0x16')](_0xb641('0x23'),_0x1e1b21[_0xb641('0x17')],_0x4d520c);_0x1c4d6c(_0x513606[_0xb641('0x16')](0x1f4,_0x1e1b21[_0xb641('0x17')]));});});};exports[_0xb641('0x25')]=function(_0x5e37a2){var _0x17a46b=this;return new Promise(function(_0x5bba80,_0x38ae40){return db[_0xb641('0x1a')][_0xb641('0x26')]({'raw':_0x5e37a2[_0xb641('0x1b')]?_0x5e37a2['options'][_0xb641('0x1c')]===undefined?!![]:![]:!![],'where':_0x5e37a2['options']?_0x5e37a2[_0xb641('0x1b')][_0xb641('0x1d')]||null:null,'attributes':_0x5e37a2[_0xb641('0x1b')]?_0x5e37a2[_0xb641('0x1b')][_0xb641('0x1e')]||null:null,'include':_0x5e37a2['options']?_0x5e37a2[_0xb641('0x1b')][_0xb641('0x20')]?_[_0xb641('0x21')](_0x5e37a2[_0xb641('0x1b')]['include'],function(_0x456c64){return{'model':db[_0x456c64[_0xb641('0x22')]],'as':_0x456c64['as'],'attributes':_0x456c64[_0xb641('0x1e')],'include':_0x456c64[_0xb641('0x20')]?_[_0xb641('0x21')](_0x456c64[_0xb641('0x20')],function(_0x153251){return{'model':db[_0x153251[_0xb641('0x22')]],'as':_0x153251['as'],'attributes':_0x153251[_0xb641('0x1e')],'include':_0x153251[_0xb641('0x20')]?_[_0xb641('0x21')](_0x153251['include'],function(_0x34857e){return{'model':db[_0x34857e[_0xb641('0x22')]],'as':_0x34857e['as'],'attributes':_0x34857e[_0xb641('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2f12a4){logger[_0xb641('0x18')](_0xb641('0x25'),_0x5e37a2);logger[_0xb641('0x24')](_0xb641('0x25'),_0x5e37a2,JSON[_0xb641('0x15')](_0x2f12a4));_0x5bba80(_0x2f12a4);})[_0xb641('0x19')](function(_0x4f1e20){logger[_0xb641('0x16')](_0xb641('0x25'),_0x4f1e20[_0xb641('0x17')],_0x5e37a2);_0x38ae40(_0x17a46b['error'](0x1f4,_0x4f1e20[_0xb641('0x17')]));});});}; \ No newline at end of file +var _0x77ff=['options','where','attributes','limit','include','map','model','ChatQueue','raw','ShowChatQueue','util','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatQueue,\x20%s,\x20%s','info','result','catch','GetChatQueue'];(function(_0x3c52ab,_0xd937ed){var _0x5e610b=function(_0x305fcf){while(--_0x305fcf){_0x3c52ab['push'](_0x3c52ab['shift']());}};_0x5e610b(++_0xd937ed);}(_0x77ff,0x168));var _0xf77f=function(_0x31c96d,_0x5da707){_0x31c96d=_0x31c96d-0x0;var _0x446e83=_0x77ff[_0x31c96d];return _0x446e83;};'use strict';var _=require('lodash');var util=require(_0xf77f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf77f('0x1'))['db'];var utils=require(_0xf77f('0x2'));var logger=require(_0xf77f('0x3'))('rpc');var config=require(_0xf77f('0x4'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf77f('0x5')]({'port':0x232a});config['redis']=_['defaults'](config[_0xf77f('0x6')],{'host':_0xf77f('0x7'),'port':0x18eb});var socket=require(_0xf77f('0x8'))(new Redis(config['redis']));require(_0xf77f('0x9'))[_0xf77f('0xa')](socket);function respondWithRpcPromise(_0x53aead,_0x27412c,_0x41dcee){return new BPromise(function(_0x66def4,_0x257499){return client[_0xf77f('0xb')](_0x53aead,_0x41dcee)[_0xf77f('0xc')](function(_0x1d8bca){logger['info']('ChatQueue,\x20%s,\x20%s',_0x27412c,_0xf77f('0xd'));logger[_0xf77f('0xe')](_0xf77f('0xf'),_0x27412c,_0xf77f('0xd'),JSON[_0xf77f('0x10')](_0x1d8bca));if(_0x1d8bca[_0xf77f('0x11')]){if(_0x1d8bca['error'][_0xf77f('0x12')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x27412c,_0x1d8bca[_0xf77f('0x11')][_0xf77f('0x13')]);return _0x257499(_0x1d8bca[_0xf77f('0x11')][_0xf77f('0x13')]);}logger[_0xf77f('0x11')](_0xf77f('0x14'),_0x27412c,_0x1d8bca[_0xf77f('0x11')][_0xf77f('0x13')]);return _0x66def4(_0x1d8bca[_0xf77f('0x11')]['message']);}else{logger[_0xf77f('0x15')]('ChatQueue,\x20%s,\x20%s',_0x27412c,_0xf77f('0xd'));_0x66def4(_0x1d8bca[_0xf77f('0x16')][_0xf77f('0x13')]);}})[_0xf77f('0x17')](function(_0x31a99f){logger[_0xf77f('0x11')](_0xf77f('0x14'),_0x27412c,_0x31a99f);_0x257499(_0x31a99f);});});}exports[_0xf77f('0x18')]=function(_0x28fc63){var _0x220606=this;return new Promise(function(_0x331db7,_0x4db2c2){return db['ChatQueue']['findAll']({'raw':_0x28fc63[_0xf77f('0x19')]?_0x28fc63[_0xf77f('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x28fc63[_0xf77f('0x19')]?_0x28fc63['options'][_0xf77f('0x1a')]||null:null,'attributes':_0x28fc63['options']?_0x28fc63[_0xf77f('0x19')][_0xf77f('0x1b')]||null:null,'limit':_0x28fc63[_0xf77f('0x19')]?_0x28fc63[_0xf77f('0x19')][_0xf77f('0x1c')]||null:null,'include':_0x28fc63[_0xf77f('0x19')]?_0x28fc63['options'][_0xf77f('0x1d')]?_[_0xf77f('0x1e')](_0x28fc63[_0xf77f('0x19')]['include'],function(_0x45bbe6){return{'model':db[_0x45bbe6['model']],'as':_0x45bbe6['as'],'attributes':_0x45bbe6[_0xf77f('0x1b')],'include':_0x45bbe6['include']?_['map'](_0x45bbe6['include'],function(_0x53aa0c){return{'model':db[_0x53aa0c[_0xf77f('0x1f')]],'as':_0x53aa0c['as'],'attributes':_0x53aa0c[_0xf77f('0x1b')],'include':_0x53aa0c['include']?_[_0xf77f('0x1e')](_0x53aa0c[_0xf77f('0x1d')],function(_0x534fee){return{'model':db[_0x534fee['model']],'as':_0x534fee['as'],'attributes':_0x534fee[_0xf77f('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xba82b){logger['info'](_0xf77f('0x18'),_0x28fc63);logger[_0xf77f('0xe')](_0xf77f('0x18'),_0x28fc63,JSON[_0xf77f('0x10')](_0xba82b));_0x331db7(_0xba82b);})['catch'](function(_0x5cd804){logger[_0xf77f('0x11')]('GetChatQueue',_0x5cd804[_0xf77f('0x13')],_0x28fc63);_0x4db2c2(_0x220606[_0xf77f('0x11')](0x1f4,_0x5cd804[_0xf77f('0x13')]));});});};exports['ShowChatQueue']=function(_0xd49582){var _0x1fd637=this;return new Promise(function(_0x418a94,_0x275daf){return db[_0xf77f('0x20')]['find']({'raw':_0xd49582[_0xf77f('0x19')]?_0xd49582['options'][_0xf77f('0x21')]===undefined?!![]:![]:!![],'where':_0xd49582[_0xf77f('0x19')]?_0xd49582[_0xf77f('0x19')]['where']||null:null,'attributes':_0xd49582[_0xf77f('0x19')]?_0xd49582[_0xf77f('0x19')][_0xf77f('0x1b')]||null:null,'include':_0xd49582[_0xf77f('0x19')]?_0xd49582[_0xf77f('0x19')][_0xf77f('0x1d')]?_[_0xf77f('0x1e')](_0xd49582[_0xf77f('0x19')][_0xf77f('0x1d')],function(_0x4f3ae2){return{'model':db[_0x4f3ae2['model']],'as':_0x4f3ae2['as'],'attributes':_0x4f3ae2[_0xf77f('0x1b')],'include':_0x4f3ae2[_0xf77f('0x1d')]?_[_0xf77f('0x1e')](_0x4f3ae2['include'],function(_0x4cf629){return{'model':db[_0x4cf629[_0xf77f('0x1f')]],'as':_0x4cf629['as'],'attributes':_0x4cf629[_0xf77f('0x1b')],'include':_0x4cf629['include']?_[_0xf77f('0x1e')](_0x4cf629[_0xf77f('0x1d')],function(_0x3c369a){return{'model':db[_0x3c369a[_0xf77f('0x1f')]],'as':_0x3c369a['as'],'attributes':_0x3c369a[_0xf77f('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1a8959){logger[_0xf77f('0x15')]('ShowChatQueue',_0xd49582);logger[_0xf77f('0xe')](_0xf77f('0x22'),_0xd49582,JSON[_0xf77f('0x10')](_0x1a8959));_0x418a94(_0x1a8959);})['catch'](function(_0x10a289){logger[_0xf77f('0x11')](_0xf77f('0x22'),_0x10a289[_0xf77f('0x13')],_0xd49582);_0x275daf(_0x1fd637[_0xf77f('0x11')](0x1f4,_0x10a289[_0xf77f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index e20904f..62e69f6 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 _0x7a2c=['chatQueue:','./chatQueue.events','remove','update','emit','register'];(function(_0x34666e,_0x346cb1){var _0x3c1472=function(_0x233354){while(--_0x233354){_0x34666e['push'](_0x34666e['shift']());}};_0x3c1472(++_0x346cb1);}(_0x7a2c,0x17b));var _0xc7a2=function(_0xb7f272,_0x1df77f){_0xb7f272=_0xb7f272-0x0;var _0x80b907=_0x7a2c[_0xb7f272];return _0x80b907;};'use strict';var ChatQueueEvents=require(_0xc7a2('0x0'));var events=['save',_0xc7a2('0x1'),_0xc7a2('0x2')];function createListener(_0x409ec5,_0x26fb61){return function(_0x44d702){_0x26fb61[_0xc7a2('0x3')](_0x409ec5,_0x44d702);};}function removeListener(_0x3f2b0d,_0x34cd60){return function(){ChatQueueEvents['removeListener'](_0x3f2b0d,_0x34cd60);};}exports[_0xc7a2('0x4')]=function(_0x1ddbae){for(var _0x5f334e=0x0,_0x481430=events['length'];_0x5f334e<_0x481430;_0x5f334e++){var _0x1dd150=events[_0x5f334e];var _0x3de428=createListener(_0xc7a2('0x5')+_0x1dd150,_0x1ddbae);ChatQueueEvents['on'](_0x1dd150,_0x3de428);}}; \ No newline at end of file +var _0x1cc7=['remove','emit','length','chatQueue:','./chatQueue.events','save'];(function(_0x561a8a,_0x770406){var _0x277a9d=function(_0x239c03){while(--_0x239c03){_0x561a8a['push'](_0x561a8a['shift']());}};_0x277a9d(++_0x770406);}(_0x1cc7,0x15a));var _0x71cc=function(_0x4e3bbd,_0x9c0776){_0x4e3bbd=_0x4e3bbd-0x0;var _0x27c4a0=_0x1cc7[_0x4e3bbd];return _0x27c4a0;};'use strict';var ChatQueueEvents=require(_0x71cc('0x0'));var events=[_0x71cc('0x1'),_0x71cc('0x2'),'update'];function createListener(_0x4db9cd,_0x547fe6){return function(_0xe5d54e){_0x547fe6[_0x71cc('0x3')](_0x4db9cd,_0xe5d54e);};}function removeListener(_0x402191,_0x5431e1){return function(){ChatQueueEvents['removeListener'](_0x402191,_0x5431e1);};}exports['register']=function(_0x27a175){for(var _0x4ecf81=0x0,_0xc0444e=events[_0x71cc('0x4')];_0x4ecf81<_0xc0444e;_0x4ecf81++){var _0x4039ce=events[_0x4ecf81];var _0x2e70f0=createListener(_0x71cc('0x5')+_0x4039ce,_0x27a175);ChatQueueEvents['on'](_0x4039ce,_0x2e70f0);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index eb4a8c5..3a3d7bb 100644 --- a/server/api/chatQueue/index.js +++ b/server/api/chatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x504b79,_0x4115b0){var _0x10f21a=function(_0x36dcb9){while(--_0x36dcb9){_0x504b79['push'](_0x504b79['shift']());}};_0x10f21a(++_0x4115b0);}(_0x814b,0x1a2));var _0xb814=function(_0x3baaf2,_0x894e3d){_0x3baaf2=_0x3baaf2-0x0;var _0x50e8b0=_0x814b[_0x3baaf2];return _0x50e8b0;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router; \ No newline at end of file +var _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(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3e74,0x175));var _0x43e7=function(_0x4779b3,_0x28a886){_0x4779b3=_0x4779b3-0x0;var _0x3dc69d=_0x3e74[_0x4779b3];return _0x3dc69d;};'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 4b73bdc..d6db1ef 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 _0x6781=['sequelize','exports','STRING','DATE'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x6781,0x104));var _0x1678=function(_0x3d85af,_0x4426cf){_0x3d85af=_0x3d85af-0x0;var _0x129e73=_0x6781[_0x3d85af];return _0x129e73;};'use strict';var moment=require('moment');var Sequelize=require(_0x1678('0x0'));module[_0x1678('0x1')]={'uniqueid':{'type':Sequelize[_0x1678('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x1678('0x3')]},'leaveAt':{'type':Sequelize[_0x1678('0x3')]},'acceptAt':{'type':Sequelize[_0x1678('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x1678('0x2')]}}; \ No newline at end of file +var _0xf5be=['STRING','DATE','sequelize','exports'];(function(_0x2358c5,_0x2ba6b0){var _0x3274a9=function(_0x4dc9cf){while(--_0x4dc9cf){_0x2358c5['push'](_0x2358c5['shift']());}};_0x3274a9(++_0x2ba6b0);}(_0xf5be,0x15a));var _0xef5b=function(_0x4a7d39,_0x3f036c){_0x4a7d39=_0x4a7d39-0x0;var _0x1452aa=_0xf5be[_0x4a7d39];return _0x1452aa;};'use strict';var moment=require('moment');var Sequelize=require(_0xef5b('0x0'));module[_0xef5b('0x1')]={'uniqueid':{'type':Sequelize[_0xef5b('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xef5b('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xef5b('0x3')]},'exitAt':{'type':Sequelize[_0xef5b('0x3')]},'reason':{'type':Sequelize[_0xef5b('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 749e4b3..9b2dad8 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 _0x1a61=['json','offset','limit','undefined','count','set','Content-Range','apply','destroy','then','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','includeAll','findAll','rows','catch','params','merge','find','create','body','update','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x1a61,0x1e6));var _0x11a6=function(_0x2d1b35,_0x3561d7){_0x2d1b35=_0x2d1b35-0x0;var _0x45450f=_0x1a61[_0x2d1b35];return _0x45450f;};'use strict';var emlformat=require(_0x11a6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x11a6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x11a6('0x2'));var moment=require(_0x11a6('0x3'));var BPromise=require(_0x11a6('0x4'));var Mustache=require(_0x11a6('0x5'));var util=require('util');var path=require('path');var sox=require(_0x11a6('0x6'));var csv=require(_0x11a6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x11a6('0x8'));var _=require(_0x11a6('0x9'));var squel=require(_0x11a6('0xa'));var crypto=require(_0x11a6('0xb'));var jsforce=require(_0x11a6('0xc'));var deskjs=require(_0x11a6('0xd'));var toCsv=require(_0x11a6('0x7'));var querystring=require(_0x11a6('0xe'));var Papa=require(_0x11a6('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x11a6('0x10'));var hardwareService=require(_0x11a6('0x11'));var logger=require('../../config/logger')(_0x11a6('0x12'));var utils=require(_0x11a6('0x13'));var config=require(_0x11a6('0x14'));var licenseUtil=require(_0x11a6('0x15'));var db=require(_0x11a6('0x16'))['db'];function respondWithStatusCode(_0x41c4aa,_0x52f39a){_0x52f39a=_0x52f39a||0xcc;return function(_0x52c999){if(_0x52c999){return _0x41c4aa[_0x11a6('0x17')](_0x52f39a);}return _0x41c4aa[_0x11a6('0x18')](_0x52f39a)['end']();};}function respondWithResult(_0x1d3123,_0x15d140){_0x15d140=_0x15d140||0xc8;return function(_0x5158ea){if(_0x5158ea){return _0x1d3123[_0x11a6('0x18')](_0x15d140)[_0x11a6('0x19')](_0x5158ea);}};}function respondWithFilteredResult(_0x5b8e51,_0x345c70){return function(_0x2c79f4){if(_0x2c79f4){var _0x1fec24=typeof _0x345c70[_0x11a6('0x1a')]==='undefined'&&typeof _0x345c70[_0x11a6('0x1b')]===_0x11a6('0x1c');var _0xe8ed8=_0x2c79f4[_0x11a6('0x1d')];var _0x1a9d43=_0x1fec24?0x0:_0x345c70[_0x11a6('0x1a')];var _0x2449bf=_0x1fec24?_0x2c79f4[_0x11a6('0x1d')]:_0x345c70[_0x11a6('0x1a')]+_0x345c70[_0x11a6('0x1b')];var _0x2516a4;if(_0x2449bf>=_0xe8ed8){_0x2449bf=_0xe8ed8;_0x2516a4=0xc8;}else{_0x2516a4=0xce;}_0x5b8e51[_0x11a6('0x18')](_0x2516a4);return _0x5b8e51[_0x11a6('0x1e')](_0x11a6('0x1f'),_0x1a9d43+'-'+_0x2449bf+'/'+_0xe8ed8)['json'](_0x2c79f4);}return null;};}function patchUpdates(_0x485a4f){return function(_0xbd4c49){try{jsonpatch[_0x11a6('0x20')](_0xbd4c49,_0x485a4f,!![]);}catch(_0x3d1efd){return BPromise['reject'](_0x3d1efd);}return _0xbd4c49['save']();};}function saveUpdates(_0x7120c0,_0x521f50){return function(_0x707dd2){if(_0x707dd2){return _0x707dd2['update'](_0x7120c0)['then'](function(_0x51fe97){return _0x51fe97;});}return null;};}function removeEntity(_0x5b3a27,_0x111a63){return function(_0x55a043){if(_0x55a043){return _0x55a043[_0x11a6('0x21')]()[_0x11a6('0x22')](function(){_0x5b3a27['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ffd7f,_0x144cc5){return function(_0x34e230){if(!_0x34e230){_0x2ffd7f[_0x11a6('0x17')](0x194);}return _0x34e230;};}function handleError(_0x14f510,_0x407ae0){_0x407ae0=_0x407ae0||0x1f4;return function(_0x40e3b4){logger[_0x11a6('0x23')](_0x40e3b4[_0x11a6('0x24')]);if(_0x40e3b4[_0x11a6('0x25')]){delete _0x40e3b4[_0x11a6('0x25')];}_0x14f510[_0x11a6('0x18')](_0x407ae0)[_0x11a6('0x26')](_0x40e3b4);};}exports[_0x11a6('0x27')]=function(_0x304ad8,_0x453453){var _0x1ddbb2={},_0x1b7f4e={},_0x44c92d={'count':0x0,'rows':[]};var _0x2bfdf6=_[_0x11a6('0x28')](db[_0x11a6('0x29')][_0x11a6('0x2a')],function(_0x1ec7aa){return{'name':_0x1ec7aa[_0x11a6('0x2b')],'type':_0x1ec7aa['type'][_0x11a6('0x2c')]};});_0x1b7f4e['model']=_[_0x11a6('0x28')](_0x2bfdf6,_0x11a6('0x25'));_0x1b7f4e[_0x11a6('0x2d')]=_[_0x11a6('0x2e')](_0x304ad8[_0x11a6('0x2d')]);_0x1b7f4e['filters']=_[_0x11a6('0x2f')](_0x1b7f4e[_0x11a6('0x30')],_0x1b7f4e['query']);_0x1ddbb2['attributes']=_['intersection'](_0x1b7f4e[_0x11a6('0x30')],qs[_0x11a6('0x31')](_0x304ad8['query'][_0x11a6('0x31')]));_0x1ddbb2[_0x11a6('0x32')]=_0x1ddbb2[_0x11a6('0x32')][_0x11a6('0x33')]?_0x1ddbb2[_0x11a6('0x32')]:_0x1b7f4e['model'];if(!_0x304ad8[_0x11a6('0x2d')][_0x11a6('0x34')](_0x11a6('0x35'))){_0x1ddbb2[_0x11a6('0x1b')]=qs[_0x11a6('0x1b')](_0x304ad8[_0x11a6('0x2d')][_0x11a6('0x1b')]);_0x1ddbb2[_0x11a6('0x1a')]=qs[_0x11a6('0x1a')](_0x304ad8[_0x11a6('0x2d')][_0x11a6('0x1a')]);}_0x1ddbb2[_0x11a6('0x36')]=qs[_0x11a6('0x37')](_0x304ad8['query'][_0x11a6('0x37')]);_0x1ddbb2[_0x11a6('0x38')]=qs[_0x11a6('0x39')](_[_0x11a6('0x3a')](_0x304ad8[_0x11a6('0x2d')],_0x1b7f4e[_0x11a6('0x39')]),_0x2bfdf6);if(_0x304ad8[_0x11a6('0x2d')][_0x11a6('0x3b')]){_0x1ddbb2[_0x11a6('0x38')]=_['merge'](_0x1ddbb2[_0x11a6('0x38')],{'$or':_[_0x11a6('0x28')](_0x2bfdf6,function(_0x5f38c1){if(_0x5f38c1[_0x11a6('0x3c')]!==_0x11a6('0x3d')){var _0x38aaa7={};_0x38aaa7[_0x5f38c1['name']]={'$like':'%'+_0x304ad8[_0x11a6('0x2d')][_0x11a6('0x3b')]+'%'};return _0x38aaa7;}})});}_0x1ddbb2=_['merge']({},_0x1ddbb2,_0x304ad8['options']);var _0x10c485={'where':_0x1ddbb2['where']};return db[_0x11a6('0x29')][_0x11a6('0x1d')](_0x10c485)['then'](function(_0x275aa0){_0x44c92d['count']=_0x275aa0;if(_0x304ad8[_0x11a6('0x2d')][_0x11a6('0x3e')]){_0x1ddbb2['include']=[{'all':!![]}];}return db[_0x11a6('0x29')][_0x11a6('0x3f')](_0x1ddbb2);})[_0x11a6('0x22')](function(_0xd769e4){_0x44c92d[_0x11a6('0x40')]=_0xd769e4;return _0x44c92d;})[_0x11a6('0x22')](respondWithFilteredResult(_0x453453,_0x1ddbb2))[_0x11a6('0x41')](handleError(_0x453453,null));};exports['show']=function(_0x1d3a8b,_0x382182){var _0x5f44c1={'raw':!![],'where':{'id':_0x1d3a8b[_0x11a6('0x42')]['id']}},_0x588b96={};_0x588b96['model']=_[_0x11a6('0x2e')](db[_0x11a6('0x29')][_0x11a6('0x2a')]);_0x588b96['query']=_['keys'](_0x1d3a8b['query']);_0x588b96['filters']=_[_0x11a6('0x2f')](_0x588b96['model'],_0x588b96[_0x11a6('0x2d')]);_0x5f44c1[_0x11a6('0x32')]=_['intersection'](_0x588b96['model'],qs['fields'](_0x1d3a8b[_0x11a6('0x2d')][_0x11a6('0x31')]));_0x5f44c1['attributes']=_0x5f44c1[_0x11a6('0x32')]['length']?_0x5f44c1[_0x11a6('0x32')]:_0x588b96['model'];if(_0x1d3a8b[_0x11a6('0x2d')][_0x11a6('0x3e')]){_0x5f44c1['include']=[{'all':!![]}];}_0x5f44c1=_[_0x11a6('0x43')]({},_0x5f44c1,_0x1d3a8b['options']);return db[_0x11a6('0x29')][_0x11a6('0x44')](_0x5f44c1)[_0x11a6('0x22')](handleEntityNotFound(_0x382182,null))[_0x11a6('0x22')](respondWithResult(_0x382182,null))['catch'](handleError(_0x382182,null));};exports[_0x11a6('0x45')]=function(_0x18feb7,_0x25f137){return db[_0x11a6('0x29')][_0x11a6('0x45')](_0x18feb7[_0x11a6('0x46')],{})['then'](respondWithResult(_0x25f137,0xc9))[_0x11a6('0x41')](handleError(_0x25f137,null));};exports[_0x11a6('0x47')]=function(_0x41afe9,_0x5b8bbf){if(_0x41afe9[_0x11a6('0x46')]['id']){delete _0x41afe9[_0x11a6('0x46')]['id'];}return db[_0x11a6('0x29')][_0x11a6('0x44')]({'where':{'id':_0x41afe9[_0x11a6('0x42')]['id']}})[_0x11a6('0x22')](handleEntityNotFound(_0x5b8bbf,null))[_0x11a6('0x22')](saveUpdates(_0x41afe9[_0x11a6('0x46')],null))[_0x11a6('0x22')](respondWithResult(_0x5b8bbf,null))[_0x11a6('0x41')](handleError(_0x5b8bbf,null));};exports[_0x11a6('0x21')]=function(_0x2e105f,_0x1febf1){return db[_0x11a6('0x29')][_0x11a6('0x44')]({'where':{'id':_0x2e105f[_0x11a6('0x42')]['id']}})[_0x11a6('0x22')](handleEntityNotFound(_0x1febf1,null))[_0x11a6('0x22')](removeEntity(_0x1febf1,null))['catch'](handleError(_0x1febf1,null));};exports[_0x11a6('0x48')]=function(_0x5e7235,_0x27c59a){return db['ChatQueueReport'][_0x11a6('0x48')]()[_0x11a6('0x22')](respondWithResult(_0x27c59a,null))[_0x11a6('0x41')](handleError(_0x27c59a,null));}; \ No newline at end of file +var _0x2c8f=['then','destroy','error','stack','name','send','index','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','includeAll','include','show','params','length','find','catch','create','body','describe','rimraf','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update'];(function(_0x5c3d3a,_0x57e3d8){var _0x1ec1ca=function(_0x54f2cc){while(--_0x54f2cc){_0x5c3d3a['push'](_0x5c3d3a['shift']());}};_0x1ec1ca(++_0x57e3d8);}(_0x2c8f,0x192));var _0xf2c8=function(_0x514134,_0x546fde){_0x514134=_0x514134-0x0;var _0x595aaa=_0x2c8f[_0x514134];return _0x595aaa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf2c8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf2c8('0x1'));var BPromise=require(_0xf2c8('0x2'));var Mustache=require(_0xf2c8('0x3'));var util=require('util');var path=require('path');var sox=require(_0xf2c8('0x4'));var csv=require(_0xf2c8('0x5'));var ejs=require(_0xf2c8('0x6'));var fs=require('fs');var fs_extra=require(_0xf2c8('0x7'));var _=require(_0xf2c8('0x8'));var squel=require('squel');var crypto=require(_0xf2c8('0x9'));var jsforce=require(_0xf2c8('0xa'));var deskjs=require(_0xf2c8('0xb'));var toCsv=require(_0xf2c8('0x5'));var querystring=require(_0xf2c8('0xc'));var Papa=require(_0xf2c8('0xd'));var Redis=require('ioredis');var authService=require(_0xf2c8('0xe'));var qs=require(_0xf2c8('0xf'));var as=require(_0xf2c8('0x10'));var hardwareService=require(_0xf2c8('0x11'));var logger=require(_0xf2c8('0x12'))(_0xf2c8('0x13'));var utils=require(_0xf2c8('0x14'));var config=require(_0xf2c8('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xf2c8('0x16'))['db'];function respondWithStatusCode(_0x5ce572,_0x10bc2c){_0x10bc2c=_0x10bc2c||0xcc;return function(_0x16b7a4){if(_0x16b7a4){return _0x5ce572[_0xf2c8('0x17')](_0x10bc2c);}return _0x5ce572[_0xf2c8('0x18')](_0x10bc2c)[_0xf2c8('0x19')]();};}function respondWithResult(_0x40849c,_0x54dd36){_0x54dd36=_0x54dd36||0xc8;return function(_0x3b86f0){if(_0x3b86f0){return _0x40849c[_0xf2c8('0x18')](_0x54dd36)[_0xf2c8('0x1a')](_0x3b86f0);}};}function respondWithFilteredResult(_0x34f9b1,_0x3ed09e){return function(_0x383af2){if(_0x383af2){var _0x1b8c5b=typeof _0x3ed09e['offset']===_0xf2c8('0x1b')&&typeof _0x3ed09e[_0xf2c8('0x1c')]===_0xf2c8('0x1b');var _0x31b8e0=_0x383af2[_0xf2c8('0x1d')];var _0x52e9d0=_0x1b8c5b?0x0:_0x3ed09e['offset'];var _0x104d9d=_0x1b8c5b?_0x383af2[_0xf2c8('0x1d')]:_0x3ed09e[_0xf2c8('0x1e')]+_0x3ed09e[_0xf2c8('0x1c')];var _0x516d99;if(_0x104d9d>=_0x31b8e0){_0x104d9d=_0x31b8e0;_0x516d99=0xc8;}else{_0x516d99=0xce;}_0x34f9b1[_0xf2c8('0x18')](_0x516d99);return _0x34f9b1[_0xf2c8('0x1f')](_0xf2c8('0x20'),_0x52e9d0+'-'+_0x104d9d+'/'+_0x31b8e0)['json'](_0x383af2);}return null;};}function patchUpdates(_0x4442f9){return function(_0x31008e){try{jsonpatch['apply'](_0x31008e,_0x4442f9,!![]);}catch(_0x5b1e44){return BPromise[_0xf2c8('0x21')](_0x5b1e44);}return _0x31008e[_0xf2c8('0x22')]();};}function saveUpdates(_0x98f9cb,_0x57affa){return function(_0xd2e728){if(_0xd2e728){return _0xd2e728[_0xf2c8('0x23')](_0x98f9cb)[_0xf2c8('0x24')](function(_0x239350){return _0x239350;});}return null;};}function removeEntity(_0x4ba1e0,_0x17956f){return function(_0xe5ff6c){if(_0xe5ff6c){return _0xe5ff6c[_0xf2c8('0x25')]()[_0xf2c8('0x24')](function(){_0x4ba1e0[_0xf2c8('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x93707c,_0x54bbcb){return function(_0x3cd344){if(!_0x3cd344){_0x93707c[_0xf2c8('0x17')](0x194);}return _0x3cd344;};}function handleError(_0x27dc4f,_0x3bb777){_0x3bb777=_0x3bb777||0x1f4;return function(_0x1d2e74){logger[_0xf2c8('0x26')](_0x1d2e74[_0xf2c8('0x27')]);if(_0x1d2e74[_0xf2c8('0x28')]){delete _0x1d2e74[_0xf2c8('0x28')];}_0x27dc4f[_0xf2c8('0x18')](_0x3bb777)[_0xf2c8('0x29')](_0x1d2e74);};}exports[_0xf2c8('0x2a')]=function(_0x311349,_0x4e12a2){var _0x1cb979={},_0x5146e4={},_0x584587={'count':0x0,'rows':[]};var _0x3df45d=_['map'](db[_0xf2c8('0x2b')][_0xf2c8('0x2c')],function(_0x23de17){return{'name':_0x23de17[_0xf2c8('0x2d')],'type':_0x23de17[_0xf2c8('0x2e')][_0xf2c8('0x2f')]};});_0x5146e4[_0xf2c8('0x30')]=_['map'](_0x3df45d,_0xf2c8('0x28'));_0x5146e4[_0xf2c8('0x31')]=_[_0xf2c8('0x32')](_0x311349[_0xf2c8('0x31')]);_0x5146e4[_0xf2c8('0x33')]=_[_0xf2c8('0x34')](_0x5146e4['model'],_0x5146e4[_0xf2c8('0x31')]);_0x1cb979['attributes']=_[_0xf2c8('0x34')](_0x5146e4['model'],qs[_0xf2c8('0x35')](_0x311349[_0xf2c8('0x31')][_0xf2c8('0x35')]));_0x1cb979[_0xf2c8('0x36')]=_0x1cb979[_0xf2c8('0x36')]['length']?_0x1cb979[_0xf2c8('0x36')]:_0x5146e4[_0xf2c8('0x30')];if(!_0x311349['query'][_0xf2c8('0x37')](_0xf2c8('0x38'))){_0x1cb979['limit']=qs[_0xf2c8('0x1c')](_0x311349[_0xf2c8('0x31')][_0xf2c8('0x1c')]);_0x1cb979[_0xf2c8('0x1e')]=qs[_0xf2c8('0x1e')](_0x311349['query']['offset']);}_0x1cb979[_0xf2c8('0x39')]=qs[_0xf2c8('0x3a')](_0x311349[_0xf2c8('0x31')][_0xf2c8('0x3a')]);_0x1cb979[_0xf2c8('0x3b')]=qs[_0xf2c8('0x33')](_[_0xf2c8('0x3c')](_0x311349[_0xf2c8('0x31')],_0x5146e4['filters']),_0x3df45d);if(_0x311349[_0xf2c8('0x31')][_0xf2c8('0x3d')]){_0x1cb979[_0xf2c8('0x3b')]=_['merge'](_0x1cb979['where'],{'$or':_['map'](_0x3df45d,function(_0x5e646e){if(_0x5e646e[_0xf2c8('0x2e')]!=='VIRTUAL'){var _0x219318={};_0x219318[_0x5e646e['name']]={'$like':'%'+_0x311349[_0xf2c8('0x31')]['filter']+'%'};return _0x219318;}})});}_0x1cb979=_['merge']({},_0x1cb979,_0x311349[_0xf2c8('0x3e')]);var _0x523f92={'where':_0x1cb979['where']};return db[_0xf2c8('0x2b')][_0xf2c8('0x1d')](_0x523f92)['then'](function(_0x1f4115){_0x584587[_0xf2c8('0x1d')]=_0x1f4115;if(_0x311349[_0xf2c8('0x31')][_0xf2c8('0x3f')]){_0x1cb979[_0xf2c8('0x40')]=[{'all':!![]}];}return db[_0xf2c8('0x2b')]['findAll'](_0x1cb979);})['then'](function(_0x200920){_0x584587['rows']=_0x200920;return _0x584587;})[_0xf2c8('0x24')](respondWithFilteredResult(_0x4e12a2,_0x1cb979))['catch'](handleError(_0x4e12a2,null));};exports[_0xf2c8('0x41')]=function(_0x580def,_0x3e70eb){var _0x295910={'raw':!![],'where':{'id':_0x580def[_0xf2c8('0x42')]['id']}},_0x251e4c={};_0x251e4c['model']=_[_0xf2c8('0x32')](db[_0xf2c8('0x2b')]['rawAttributes']);_0x251e4c[_0xf2c8('0x31')]=_[_0xf2c8('0x32')](_0x580def[_0xf2c8('0x31')]);_0x251e4c[_0xf2c8('0x33')]=_[_0xf2c8('0x34')](_0x251e4c[_0xf2c8('0x30')],_0x251e4c[_0xf2c8('0x31')]);_0x295910['attributes']=_[_0xf2c8('0x34')](_0x251e4c[_0xf2c8('0x30')],qs[_0xf2c8('0x35')](_0x580def[_0xf2c8('0x31')]['fields']));_0x295910['attributes']=_0x295910[_0xf2c8('0x36')][_0xf2c8('0x43')]?_0x295910[_0xf2c8('0x36')]:_0x251e4c['model'];if(_0x580def[_0xf2c8('0x31')][_0xf2c8('0x3f')]){_0x295910['include']=[{'all':!![]}];}_0x295910=_['merge']({},_0x295910,_0x580def[_0xf2c8('0x3e')]);return db[_0xf2c8('0x2b')][_0xf2c8('0x44')](_0x295910)[_0xf2c8('0x24')](handleEntityNotFound(_0x3e70eb,null))['then'](respondWithResult(_0x3e70eb,null))[_0xf2c8('0x45')](handleError(_0x3e70eb,null));};exports[_0xf2c8('0x46')]=function(_0x18bbd9,_0x598997){return db[_0xf2c8('0x2b')][_0xf2c8('0x46')](_0x18bbd9[_0xf2c8('0x47')],{})['then'](respondWithResult(_0x598997,0xc9))[_0xf2c8('0x45')](handleError(_0x598997,null));};exports[_0xf2c8('0x23')]=function(_0x24d4a2,_0x3d90f5){if(_0x24d4a2[_0xf2c8('0x47')]['id']){delete _0x24d4a2['body']['id'];}return db[_0xf2c8('0x2b')]['find']({'where':{'id':_0x24d4a2['params']['id']}})[_0xf2c8('0x24')](handleEntityNotFound(_0x3d90f5,null))[_0xf2c8('0x24')](saveUpdates(_0x24d4a2[_0xf2c8('0x47')],null))[_0xf2c8('0x24')](respondWithResult(_0x3d90f5,null))[_0xf2c8('0x45')](handleError(_0x3d90f5,null));};exports['destroy']=function(_0x1c7fa5,_0x134077){return db[_0xf2c8('0x2b')][_0xf2c8('0x44')]({'where':{'id':_0x1c7fa5[_0xf2c8('0x42')]['id']}})[_0xf2c8('0x24')](handleEntityNotFound(_0x134077,null))['then'](removeEntity(_0x134077,null))['catch'](handleError(_0x134077,null));};exports[_0xf2c8('0x48')]=function(_0x334285,_0x372296){return db[_0xf2c8('0x2b')][_0xf2c8('0x48')]()[_0xf2c8('0x24')](respondWithResult(_0x372296,null))[_0xf2c8('0x45')](handleError(_0x372296,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 419ffb6..acd04cc 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 _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x533612,_0x31db03){var _0x252938=function(_0x2f95b3){while(--_0x2f95b3){_0x533612['push'](_0x533612['shift']());}};_0x252938(++_0x31db03);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x4a39e9,_0x21d30a){var _0x4fa35d=function(_0x3b13dc){while(--_0x3b13dc){_0x4a39e9['push'](_0x4a39e9['shift']());}};_0x4fa35d(++_0x21d30a);}(_0x757a,0xde));var _0xa757=function(_0x435f57,_0x1fd7ae){_0x435f57=_0x435f57-0x0;var _0x569681=_0x757a[_0x435f57];return _0x569681;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index a41bc96..a4f6c5a 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 _0x21c0=['../../config/environment','jayson/promise','http','request','ChatQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','info','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','catch','update','where','attributes','limit','then','UpdateChatQueueReport','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x37042a,_0x170e96){var _0x1da4de=function(_0x4e5b95){while(--_0x4e5b95){_0x37042a['push'](_0x37042a['shift']());}};_0x1da4de(++_0x170e96);}(_0x21c0,0x180));var _0x021c=function(_0x3db233,_0x28809e){_0x3db233=_0x3db233-0x0;var _0x59b35f=_0x21c0[_0x3db233];return _0x59b35f;};'use strict';var _=require('lodash');var util=require(_0x021c('0x0'));var moment=require('moment');var BPromise=require(_0x021c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x021c('0x2'));var db=require(_0x021c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x021c('0x4'))(_0x021c('0x5'));var config=require(_0x021c('0x6'));var jayson=require(_0x021c('0x7'));var client=jayson['client'][_0x021c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x305c82,_0x157396,_0x15fd31){return new BPromise(function(_0x39ecd7,_0x393585){return client[_0x021c('0x9')](_0x305c82,_0x15fd31)['then'](function(_0x49be06){logger['info'](_0x021c('0xa'),_0x157396,'request\x20sent');logger[_0x021c('0xb')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x157396,'request\x20sent',JSON[_0x021c('0xc')](_0x49be06));if(_0x49be06[_0x021c('0xd')]){if(_0x49be06['error'][_0x021c('0xe')]===0x1f4){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x157396,_0x49be06[_0x021c('0xd')][_0x021c('0xf')]);return _0x393585(_0x49be06['error']['message']);}logger[_0x021c('0xd')](_0x021c('0xa'),_0x157396,_0x49be06[_0x021c('0xd')]['message']);return _0x39ecd7(_0x49be06[_0x021c('0xd')][_0x021c('0xf')]);}else{logger[_0x021c('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x157396,'request\x20sent');_0x39ecd7(_0x49be06['result']['message']);}})['catch'](function(_0x5f1197){logger[_0x021c('0xd')](_0x021c('0xa'),_0x157396,_0x5f1197);_0x393585(_0x5f1197);});});}exports[_0x021c('0x11')]=function(_0x435943){var _0x4893b6=this;return new Promise(function(_0x25a86c,_0x28812c){return db[_0x021c('0x12')][_0x021c('0x13')](_0x435943[_0x021c('0x14')],{'raw':_0x435943['options']?_0x435943[_0x021c('0x15')][_0x021c('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x24828b){logger[_0x021c('0x10')](_0x021c('0x11'),_0x435943);logger['debug']('CreateChatQueueReport',_0x435943,JSON[_0x021c('0xc')](_0x24828b));_0x25a86c(_0x24828b);})[_0x021c('0x17')](function(_0x5a9ca7){logger[_0x021c('0xd')](_0x021c('0x11'),_0x5a9ca7['message'],_0x435943);_0x28812c(_0x4893b6[_0x021c('0xd')](0x1f4,_0x5a9ca7[_0x021c('0xf')]));});});};exports['UpdateChatQueueReport']=function(_0x4c7a6f){var _0x34a7e3=this;return new Promise(function(_0x3a8fe4,_0x4ecc23){return db[_0x021c('0x12')][_0x021c('0x18')](_0x4c7a6f[_0x021c('0x14')],{'raw':_0x4c7a6f[_0x021c('0x15')]?_0x4c7a6f['options'][_0x021c('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c7a6f['options']?_0x4c7a6f['options'][_0x021c('0x19')]||null:null,'attributes':_0x4c7a6f[_0x021c('0x15')]?_0x4c7a6f[_0x021c('0x15')][_0x021c('0x1a')]||null:null,'limit':_0x4c7a6f[_0x021c('0x15')]?_0x4c7a6f[_0x021c('0x15')][_0x021c('0x1b')]||null:null})[_0x021c('0x1c')](function(_0x48ce22){logger[_0x021c('0x10')]('UpdateChatQueueReport',_0x4c7a6f);logger[_0x021c('0xb')](_0x021c('0x1d'),_0x4c7a6f,JSON[_0x021c('0xc')](_0x48ce22));_0x3a8fe4(_0x48ce22);})[_0x021c('0x17')](function(_0x2c15ee){logger[_0x021c('0xd')](_0x021c('0x1d'),_0x2c15ee[_0x021c('0xf')],_0x4c7a6f);_0x4ecc23(_0x34a7e3[_0x021c('0xd')](0x1f4,_0x2c15ee[_0x021c('0xf')]));});});}; \ No newline at end of file +var _0xd4b2=['update','body','where','attributes','limit','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','ChatQueueReport,\x20%s,\x20%s','message','result','catch','CreateChatQueueReport','create','options','raw','UpdateChatQueueReport','ChatQueueReport'];(function(_0x199b1f,_0x4ed849){var _0x267ac9=function(_0x184ac6){while(--_0x184ac6){_0x199b1f['push'](_0x199b1f['shift']());}};_0x267ac9(++_0x4ed849);}(_0xd4b2,0x1da));var _0x2d4b=function(_0xf937d7,_0x59d955){_0xf937d7=_0xf937d7-0x0;var _0x39edc8=_0xd4b2[_0xf937d7];return _0x39edc8;};'use strict';var _=require(_0x2d4b('0x0'));var util=require(_0x2d4b('0x1'));var moment=require(_0x2d4b('0x2'));var BPromise=require(_0x2d4b('0x3'));var rs=require(_0x2d4b('0x4'));var fs=require('fs');var Redis=require(_0x2d4b('0x5'));var db=require(_0x2d4b('0x6'))['db'];var utils=require(_0x2d4b('0x7'));var logger=require(_0x2d4b('0x8'))(_0x2d4b('0x9'));var config=require(_0x2d4b('0xa'));var jayson=require(_0x2d4b('0xb'));var client=jayson[_0x2d4b('0xc')][_0x2d4b('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xe3a258,_0x5eb7df,_0x4447d3){return new BPromise(function(_0x50727b,_0x3ce3d6){return client[_0x2d4b('0xe')](_0xe3a258,_0x4447d3)[_0x2d4b('0xf')](function(_0x728ccb){logger[_0x2d4b('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x5eb7df,_0x2d4b('0x11'));logger['debug']('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x5eb7df,_0x2d4b('0x11'),JSON[_0x2d4b('0x12')](_0x728ccb));if(_0x728ccb['error']){if(_0x728ccb[_0x2d4b('0x13')]['code']===0x1f4){logger[_0x2d4b('0x13')](_0x2d4b('0x14'),_0x5eb7df,_0x728ccb[_0x2d4b('0x13')]['message']);return _0x3ce3d6(_0x728ccb[_0x2d4b('0x13')][_0x2d4b('0x15')]);}logger[_0x2d4b('0x13')](_0x2d4b('0x14'),_0x5eb7df,_0x728ccb[_0x2d4b('0x13')][_0x2d4b('0x15')]);return _0x50727b(_0x728ccb[_0x2d4b('0x13')][_0x2d4b('0x15')]);}else{logger['info'](_0x2d4b('0x14'),_0x5eb7df,_0x2d4b('0x11'));_0x50727b(_0x728ccb[_0x2d4b('0x16')][_0x2d4b('0x15')]);}})[_0x2d4b('0x17')](function(_0x3722e4){logger[_0x2d4b('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x5eb7df,_0x3722e4);_0x3ce3d6(_0x3722e4);});});}exports[_0x2d4b('0x18')]=function(_0x41bcf0){var _0x2fa9f5=this;return new Promise(function(_0x245561,_0x2dedbf){return db['ChatQueueReport'][_0x2d4b('0x19')](_0x41bcf0['body'],{'raw':_0x41bcf0[_0x2d4b('0x1a')]?_0x41bcf0[_0x2d4b('0x1a')][_0x2d4b('0x1b')]===undefined?!![]:![]:!![]})[_0x2d4b('0xf')](function(_0x51a297){logger[_0x2d4b('0x10')](_0x2d4b('0x18'),_0x41bcf0);logger['debug'](_0x2d4b('0x18'),_0x41bcf0,JSON[_0x2d4b('0x12')](_0x51a297));_0x245561(_0x51a297);})[_0x2d4b('0x17')](function(_0x933890){logger[_0x2d4b('0x13')](_0x2d4b('0x18'),_0x933890[_0x2d4b('0x15')],_0x41bcf0);_0x2dedbf(_0x2fa9f5['error'](0x1f4,_0x933890[_0x2d4b('0x15')]));});});};exports[_0x2d4b('0x1c')]=function(_0x467c79){var _0x50764f=this;return new Promise(function(_0x462d6a,_0x115dfb){return db[_0x2d4b('0x1d')][_0x2d4b('0x1e')](_0x467c79[_0x2d4b('0x1f')],{'raw':_0x467c79[_0x2d4b('0x1a')]?_0x467c79['options'][_0x2d4b('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x467c79[_0x2d4b('0x1a')]?_0x467c79[_0x2d4b('0x1a')][_0x2d4b('0x20')]||null:null,'attributes':_0x467c79[_0x2d4b('0x1a')]?_0x467c79[_0x2d4b('0x1a')][_0x2d4b('0x21')]||null:null,'limit':_0x467c79[_0x2d4b('0x1a')]?_0x467c79[_0x2d4b('0x1a')][_0x2d4b('0x22')]||null:null})[_0x2d4b('0xf')](function(_0x258884){logger['info'](_0x2d4b('0x1c'),_0x467c79);logger[_0x2d4b('0x23')](_0x2d4b('0x1c'),_0x467c79,JSON[_0x2d4b('0x12')](_0x258884));_0x462d6a(_0x258884);})[_0x2d4b('0x17')](function(_0x3085a0){logger['error']('UpdateChatQueueReport',_0x3085a0[_0x2d4b('0x15')],_0x467c79);_0x115dfb(_0x50764f['error'](0x1f4,_0x3085a0[_0x2d4b('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index e21778a..e53a36c 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 _0x86e5=['exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','index','/describe','isAuthenticated','show','post','create','put','/:id','delete','destroy'];(function(_0x20a322,_0x3c7c23){var _0x295ed6=function(_0x555832){while(--_0x555832){_0x20a322['push'](_0x20a322['shift']());}};_0x295ed6(++_0x3c7c23);}(_0x86e5,0x169));var _0x586e=function(_0xa1da30,_0x1d9a72){_0xa1da30=_0xa1da30-0x0;var _0x3eabe9=_0x86e5[_0xa1da30];return _0x3eabe9;};'use strict';var multer=require('multer');var util=require(_0x586e('0x0'));var path=require(_0x586e('0x1'));var timeout=require(_0x586e('0x2'));var express=require(_0x586e('0x3'));var router=express[_0x586e('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x586e('0x5'));var config=require(_0x586e('0x6'));var controller=require(_0x586e('0x7'));router[_0x586e('0x8')]('/',auth['isAuthenticated'](),controller[_0x586e('0x9')]);router[_0x586e('0x8')](_0x586e('0xa'),auth[_0x586e('0xb')](),controller['describe']);router[_0x586e('0x8')]('/:id',auth[_0x586e('0xb')](),controller[_0x586e('0xc')]);router[_0x586e('0xd')]('/',auth[_0x586e('0xb')](),controller[_0x586e('0xe')]);router[_0x586e('0xf')](_0x586e('0x10'),auth['isAuthenticated'](),controller['update']);router[_0x586e('0x11')](_0x586e('0x10'),auth[_0x586e('0xb')](),controller[_0x586e('0x12')]);module[_0x586e('0x13')]=router; \ No newline at end of file +var _0xba65=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','exports','multer'];(function(_0x3b0f8d,_0xd442f0){var _0xfdf603=function(_0x3b764b){while(--_0x3b764b){_0x3b0f8d['push'](_0x3b0f8d['shift']());}};_0xfdf603(++_0xd442f0);}(_0xba65,0x12b));var _0x5ba6=function(_0x26e727,_0x3e65be){_0x26e727=_0x26e727-0x0;var _0x563800=_0xba65[_0x26e727];return _0x563800;};'use strict';var multer=require(_0x5ba6('0x0'));var util=require(_0x5ba6('0x1'));var path=require(_0x5ba6('0x2'));var timeout=require(_0x5ba6('0x3'));var express=require(_0x5ba6('0x4'));var router=express[_0x5ba6('0x5')]();var fs_extra=require(_0x5ba6('0x6'));var auth=require(_0x5ba6('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatQueueReport.controller');router[_0x5ba6('0x8')]('/',auth[_0x5ba6('0x9')](),controller[_0x5ba6('0xa')]);router[_0x5ba6('0x8')](_0x5ba6('0xb'),auth[_0x5ba6('0x9')](),controller[_0x5ba6('0xc')]);router[_0x5ba6('0x8')](_0x5ba6('0xd'),auth[_0x5ba6('0x9')](),controller[_0x5ba6('0xe')]);router[_0x5ba6('0xf')]('/',auth[_0x5ba6('0x9')](),controller[_0x5ba6('0x10')]);router[_0x5ba6('0x11')](_0x5ba6('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x5ba6('0x12')]('/:id',auth[_0x5ba6('0x9')](),controller['destroy']);module[_0x5ba6('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index ffb81ca..1cc0de7 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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x41aa44,_0x573e85){var _0x2735f8=function(_0x49f8a7){while(--_0x49f8a7){_0x41aa44['push'](_0x41aa44['shift']());}};_0x2735f8(++_0x573e85);}(_0xaa88,0x137));var _0x8aa8=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0xaa88[_0x24259d];return _0x5a701;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file +var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x5928b5,_0xd4eec3){var _0x237611=function(_0x3436eb){while(--_0x3436eb){_0x5928b5['push'](_0x5928b5['shift']());}};_0x237611(++_0xd4eec3);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1911ed,_0x4e8c73){_0x1911ed=_0x1911ed-0x0;var _0x11edaa=_0xcb91[_0x1911ed];return _0x11edaa;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index d636361..dd0b9af 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 _0x63f5=['intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','includeAll','create','body','update','find','params','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','error','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','name','query','keys','filters'];(function(_0x3f2d02,_0x2c7deb){var _0x54092b=function(_0x427ff8){while(--_0x427ff8){_0x3f2d02['push'](_0x3f2d02['shift']());}};_0x54092b(++_0x2c7deb);}(_0x63f5,0x105));var _0x563f=function(_0x4ede04,_0x58132b){_0x4ede04=_0x4ede04-0x0;var _0x49ccfc=_0x63f5[_0x4ede04];return _0x49ccfc;};'use strict';var emlformat=require(_0x563f('0x0'));var rimraf=require(_0x563f('0x1'));var zipdir=require(_0x563f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x563f('0x3'));var BPromise=require(_0x563f('0x4'));var Mustache=require(_0x563f('0x5'));var util=require('util');var path=require(_0x563f('0x6'));var sox=require(_0x563f('0x7'));var csv=require(_0x563f('0x8'));var ejs=require(_0x563f('0x9'));var fs=require('fs');var fs_extra=require(_0x563f('0xa'));var _=require(_0x563f('0xb'));var squel=require(_0x563f('0xc'));var crypto=require(_0x563f('0xd'));var jsforce=require(_0x563f('0xe'));var deskjs=require(_0x563f('0xf'));var toCsv=require(_0x563f('0x8'));var querystring=require('querystring');var Papa=require(_0x563f('0x10'));var Redis=require(_0x563f('0x11'));var authService=require(_0x563f('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x563f('0x13'));var logger=require(_0x563f('0x14'))(_0x563f('0x15'));var utils=require(_0x563f('0x16'));var config=require(_0x563f('0x17'));var licenseUtil=require(_0x563f('0x18'));var db=require(_0x563f('0x19'))['db'];function respondWithStatusCode(_0x3b55db,_0x42acf3){_0x42acf3=_0x42acf3||0xcc;return function(_0x176b21){if(_0x176b21){return _0x3b55db[_0x563f('0x1a')](_0x42acf3);}return _0x3b55db[_0x563f('0x1b')](_0x42acf3)[_0x563f('0x1c')]();};}function respondWithResult(_0x3f644d,_0x3e8f6a){_0x3e8f6a=_0x3e8f6a||0xc8;return function(_0x51bf44){if(_0x51bf44){return _0x3f644d[_0x563f('0x1b')](_0x3e8f6a)[_0x563f('0x1d')](_0x51bf44);}};}function respondWithFilteredResult(_0x2d2678,_0x1b1b91){return function(_0x4c60d6){if(_0x4c60d6){var _0x45c5f5=typeof _0x1b1b91[_0x563f('0x1e')]===_0x563f('0x1f')&&typeof _0x1b1b91[_0x563f('0x20')]==='undefined';var _0x127d3d=_0x4c60d6[_0x563f('0x21')];var _0x467bb8=_0x45c5f5?0x0:_0x1b1b91[_0x563f('0x1e')];var _0x1fa500=_0x45c5f5?_0x4c60d6['count']:_0x1b1b91[_0x563f('0x1e')]+_0x1b1b91[_0x563f('0x20')];var _0xa5160f;if(_0x1fa500>=_0x127d3d){_0x1fa500=_0x127d3d;_0xa5160f=0xc8;}else{_0xa5160f=0xce;}_0x2d2678['status'](_0xa5160f);return _0x2d2678[_0x563f('0x22')](_0x563f('0x23'),_0x467bb8+'-'+_0x1fa500+'/'+_0x127d3d)['json'](_0x4c60d6);}return null;};}function patchUpdates(_0x1b3ea5){return function(_0x5d8b6c){try{jsonpatch[_0x563f('0x24')](_0x5d8b6c,_0x1b3ea5,!![]);}catch(_0x2fd0fa){return BPromise[_0x563f('0x25')](_0x2fd0fa);}return _0x5d8b6c[_0x563f('0x26')]();};}function saveUpdates(_0x450cd0,_0x121707){return function(_0x40da46){if(_0x40da46){return _0x40da46['update'](_0x450cd0)['then'](function(_0x1a7a32){return _0x1a7a32;});}return null;};}function removeEntity(_0x280f7e,_0x272b6a){return function(_0x5acc05){if(_0x5acc05){return _0x5acc05[_0x563f('0x27')]()[_0x563f('0x28')](function(){_0x280f7e[_0x563f('0x1b')](0xcc)[_0x563f('0x1c')]();});}};}function handleEntityNotFound(_0x280d31,_0x43a246){return function(_0xde34ca){if(!_0xde34ca){_0x280d31[_0x563f('0x1a')](0x194);}return _0xde34ca;};}function handleError(_0xd595e0,_0xff5a1f){_0xff5a1f=_0xff5a1f||0x1f4;return function(_0x3691ee){logger[_0x563f('0x29')](_0x3691ee['stack']);if(_0x3691ee['name']){delete _0x3691ee['name'];}_0xd595e0[_0x563f('0x1b')](_0xff5a1f)[_0x563f('0x2a')](_0x3691ee);};}exports[_0x563f('0x2b')]=function(_0x3c555b,_0x5b1171){var _0x31a399={},_0x11c5cc={},_0x37d614={'count':0x0,'rows':[]};var _0xfbc34c=_[_0x563f('0x2c')](db[_0x563f('0x2d')][_0x563f('0x2e')],function(_0x18bd8f){return{'name':_0x18bd8f[_0x563f('0x2f')],'type':_0x18bd8f[_0x563f('0x30')][_0x563f('0x31')]};});_0x11c5cc[_0x563f('0x32')]=_[_0x563f('0x2c')](_0xfbc34c,_0x563f('0x33'));_0x11c5cc[_0x563f('0x34')]=_[_0x563f('0x35')](_0x3c555b[_0x563f('0x34')]);_0x11c5cc[_0x563f('0x36')]=_[_0x563f('0x37')](_0x11c5cc['model'],_0x11c5cc[_0x563f('0x34')]);_0x31a399[_0x563f('0x38')]=_[_0x563f('0x37')](_0x11c5cc[_0x563f('0x32')],qs[_0x563f('0x39')](_0x3c555b[_0x563f('0x34')][_0x563f('0x39')]));_0x31a399[_0x563f('0x38')]=_0x31a399[_0x563f('0x38')][_0x563f('0x3a')]?_0x31a399[_0x563f('0x38')]:_0x11c5cc[_0x563f('0x32')];if(!_0x3c555b['query']['hasOwnProperty']('nolimit')){_0x31a399['limit']=qs['limit'](_0x3c555b['query'][_0x563f('0x20')]);_0x31a399[_0x563f('0x1e')]=qs['offset'](_0x3c555b[_0x563f('0x34')][_0x563f('0x1e')]);}_0x31a399[_0x563f('0x3b')]=qs['sort'](_0x3c555b[_0x563f('0x34')][_0x563f('0x3c')]);_0x31a399[_0x563f('0x3d')]=qs['filters'](_[_0x563f('0x3e')](_0x3c555b[_0x563f('0x34')],_0x11c5cc[_0x563f('0x36')]),_0xfbc34c);if(_0x3c555b['query'][_0x563f('0x3f')]){_0x31a399[_0x563f('0x3d')]=_[_0x563f('0x40')](_0x31a399[_0x563f('0x3d')],{'$or':_[_0x563f('0x2c')](_0xfbc34c,function(_0x2ee9d3){if(_0x2ee9d3[_0x563f('0x30')]!==_0x563f('0x41')){var _0x10edd9={};_0x10edd9[_0x2ee9d3[_0x563f('0x33')]]={'$like':'%'+_0x3c555b[_0x563f('0x34')][_0x563f('0x3f')]+'%'};return _0x10edd9;}})});}_0x31a399=_[_0x563f('0x40')]({},_0x31a399,_0x3c555b[_0x563f('0x42')]);var _0x366318={'where':_0x31a399[_0x563f('0x3d')]};return db['ChatTransferReport'][_0x563f('0x21')](_0x366318)[_0x563f('0x28')](function(_0x4ef29e){_0x37d614[_0x563f('0x21')]=_0x4ef29e;if(_0x3c555b['query']['includeAll']){_0x31a399[_0x563f('0x43')]=[{'all':!![]}];}return db[_0x563f('0x2d')][_0x563f('0x44')](_0x31a399);})[_0x563f('0x28')](function(_0x4b9a3e){_0x37d614[_0x563f('0x45')]=_0x4b9a3e;return _0x37d614;})['then'](respondWithFilteredResult(_0x5b1171,_0x31a399))[_0x563f('0x46')](handleError(_0x5b1171,null));};exports[_0x563f('0x47')]=function(_0x538b33,_0x2e1572){var _0x53c16b={'raw':!![],'where':{'id':_0x538b33['params']['id']}},_0x5d1d0a={};_0x5d1d0a['model']=_[_0x563f('0x35')](db[_0x563f('0x2d')][_0x563f('0x2e')]);_0x5d1d0a['query']=_['keys'](_0x538b33['query']);_0x5d1d0a['filters']=_['intersection'](_0x5d1d0a[_0x563f('0x32')],_0x5d1d0a[_0x563f('0x34')]);_0x53c16b['attributes']=_[_0x563f('0x37')](_0x5d1d0a[_0x563f('0x32')],qs[_0x563f('0x39')](_0x538b33[_0x563f('0x34')]['fields']));_0x53c16b[_0x563f('0x38')]=_0x53c16b['attributes'][_0x563f('0x3a')]?_0x53c16b[_0x563f('0x38')]:_0x5d1d0a[_0x563f('0x32')];if(_0x538b33[_0x563f('0x34')][_0x563f('0x48')]){_0x53c16b[_0x563f('0x43')]=[{'all':!![]}];}_0x53c16b=_['merge']({},_0x53c16b,_0x538b33[_0x563f('0x42')]);return db[_0x563f('0x2d')]['find'](_0x53c16b)[_0x563f('0x28')](handleEntityNotFound(_0x2e1572,null))[_0x563f('0x28')](respondWithResult(_0x2e1572,null))[_0x563f('0x46')](handleError(_0x2e1572,null));};exports[_0x563f('0x49')]=function(_0x325c71,_0x222e08){return db[_0x563f('0x2d')][_0x563f('0x49')](_0x325c71[_0x563f('0x4a')],{})[_0x563f('0x28')](respondWithResult(_0x222e08,0xc9))[_0x563f('0x46')](handleError(_0x222e08,null));};exports[_0x563f('0x4b')]=function(_0x2660ba,_0x574e06){if(_0x2660ba['body']['id']){delete _0x2660ba[_0x563f('0x4a')]['id'];}return db[_0x563f('0x2d')][_0x563f('0x4c')]({'where':{'id':_0x2660ba['params']['id']}})['then'](handleEntityNotFound(_0x574e06,null))[_0x563f('0x28')](saveUpdates(_0x2660ba[_0x563f('0x4a')],null))['then'](respondWithResult(_0x574e06,null))['catch'](handleError(_0x574e06,null));};exports[_0x563f('0x27')]=function(_0x338972,_0x2734ca){return db[_0x563f('0x2d')][_0x563f('0x4c')]({'where':{'id':_0x338972[_0x563f('0x4d')]['id']}})[_0x563f('0x28')](handleEntityNotFound(_0x2734ca,null))[_0x563f('0x28')](removeEntity(_0x2734ca,null))[_0x563f('0x46')](handleError(_0x2734ca,null));};exports[_0x563f('0x4e')]=function(_0x390d99,_0x44f614){return db[_0x563f('0x2d')][_0x563f('0x4e')]()[_0x563f('0x28')](respondWithResult(_0x44f614,null))[_0x563f('0x46')](handleError(_0x44f614,null));}; \ No newline at end of file +var _0x6656=['fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','apply','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','VIRTUAL','options','ChatTransferReport','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf'];(function(_0x1b65b3,_0x206605){var _0x53fbab=function(_0x207400){while(--_0x207400){_0x1b65b3['push'](_0x1b65b3['shift']());}};_0x53fbab(++_0x206605);}(_0x6656,0xd6));var _0x6665=function(_0x124bf2,_0x1e0919){_0x124bf2=_0x124bf2-0x0;var _0x197fc2=_0x6656[_0x124bf2];return _0x197fc2;};'use strict';var emlformat=require(_0x6665('0x0'));var rimraf=require(_0x6665('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6665('0x2'));var rp=require(_0x6665('0x3'));var moment=require('moment');var BPromise=require(_0x6665('0x4'));var Mustache=require(_0x6665('0x5'));var util=require('util');var path=require(_0x6665('0x6'));var sox=require(_0x6665('0x7'));var csv=require(_0x6665('0x8'));var ejs=require(_0x6665('0x9'));var fs=require('fs');var fs_extra=require(_0x6665('0xa'));var _=require('lodash');var squel=require(_0x6665('0xb'));var crypto=require(_0x6665('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6665('0xd'));var toCsv=require(_0x6665('0x8'));var querystring=require(_0x6665('0xe'));var Papa=require(_0x6665('0xf'));var Redis=require('ioredis');var authService=require(_0x6665('0x10'));var qs=require(_0x6665('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6665('0x12'));var utils=require('../../config/utils');var config=require(_0x6665('0x13'));var licenseUtil=require(_0x6665('0x14'));var db=require(_0x6665('0x15'))['db'];function respondWithStatusCode(_0xae4e17,_0x1cd744){_0x1cd744=_0x1cd744||0xcc;return function(_0x45d653){if(_0x45d653){return _0xae4e17[_0x6665('0x16')](_0x1cd744);}return _0xae4e17[_0x6665('0x17')](_0x1cd744)['end']();};}function respondWithResult(_0x2b5838,_0x246410){_0x246410=_0x246410||0xc8;return function(_0x315cea){if(_0x315cea){return _0x2b5838['status'](_0x246410)[_0x6665('0x18')](_0x315cea);}};}function respondWithFilteredResult(_0x3945e8,_0x2df8f0){return function(_0x3f1865){if(_0x3f1865){var _0x37f387=typeof _0x2df8f0['offset']===_0x6665('0x19')&&typeof _0x2df8f0[_0x6665('0x1a')]===_0x6665('0x19');var _0x57d856=_0x3f1865[_0x6665('0x1b')];var _0x4ae28b=_0x37f387?0x0:_0x2df8f0['offset'];var _0x5eea02=_0x37f387?_0x3f1865[_0x6665('0x1b')]:_0x2df8f0[_0x6665('0x1c')]+_0x2df8f0[_0x6665('0x1a')];var _0x4999cf;if(_0x5eea02>=_0x57d856){_0x5eea02=_0x57d856;_0x4999cf=0xc8;}else{_0x4999cf=0xce;}_0x3945e8[_0x6665('0x17')](_0x4999cf);return _0x3945e8[_0x6665('0x1d')]('Content-Range',_0x4ae28b+'-'+_0x5eea02+'/'+_0x57d856)['json'](_0x3f1865);}return null;};}function patchUpdates(_0x4bf388){return function(_0x4dfee3){try{jsonpatch[_0x6665('0x1e')](_0x4dfee3,_0x4bf388,!![]);}catch(_0x2e1f11){return BPromise['reject'](_0x2e1f11);}return _0x4dfee3[_0x6665('0x1f')]();};}function saveUpdates(_0x561a39,_0x2db61f){return function(_0x1db265){if(_0x1db265){return _0x1db265[_0x6665('0x20')](_0x561a39)[_0x6665('0x21')](function(_0x59a6d4){return _0x59a6d4;});}return null;};}function removeEntity(_0x7ebbbc,_0x1fa980){return function(_0x3f261e){if(_0x3f261e){return _0x3f261e[_0x6665('0x22')]()['then'](function(){_0x7ebbbc[_0x6665('0x17')](0xcc)[_0x6665('0x23')]();});}};}function handleEntityNotFound(_0x4a8635,_0x1729dd){return function(_0x4cb073){if(!_0x4cb073){_0x4a8635['sendStatus'](0x194);}return _0x4cb073;};}function handleError(_0x1ebb87,_0xefe247){_0xefe247=_0xefe247||0x1f4;return function(_0x1895e2){logger[_0x6665('0x24')](_0x1895e2[_0x6665('0x25')]);if(_0x1895e2[_0x6665('0x26')]){delete _0x1895e2['name'];}_0x1ebb87[_0x6665('0x17')](_0xefe247)[_0x6665('0x27')](_0x1895e2);};}exports[_0x6665('0x28')]=function(_0x6cbb9c,_0x51df2f){var _0x177866={},_0x400f91={},_0x4ffac2={'count':0x0,'rows':[]};var _0x6840e3=_[_0x6665('0x29')](db['ChatTransferReport'][_0x6665('0x2a')],function(_0x1c5245){return{'name':_0x1c5245['fieldName'],'type':_0x1c5245[_0x6665('0x2b')][_0x6665('0x2c')]};});_0x400f91[_0x6665('0x2d')]=_['map'](_0x6840e3,_0x6665('0x26'));_0x400f91[_0x6665('0x2e')]=_[_0x6665('0x2f')](_0x6cbb9c[_0x6665('0x2e')]);_0x400f91[_0x6665('0x30')]=_[_0x6665('0x31')](_0x400f91[_0x6665('0x2d')],_0x400f91[_0x6665('0x2e')]);_0x177866[_0x6665('0x32')]=_[_0x6665('0x31')](_0x400f91[_0x6665('0x2d')],qs[_0x6665('0x33')](_0x6cbb9c[_0x6665('0x2e')]['fields']));_0x177866[_0x6665('0x32')]=_0x177866[_0x6665('0x32')][_0x6665('0x34')]?_0x177866['attributes']:_0x400f91[_0x6665('0x2d')];if(!_0x6cbb9c[_0x6665('0x2e')]['hasOwnProperty']('nolimit')){_0x177866[_0x6665('0x1a')]=qs[_0x6665('0x1a')](_0x6cbb9c[_0x6665('0x2e')][_0x6665('0x1a')]);_0x177866[_0x6665('0x1c')]=qs[_0x6665('0x1c')](_0x6cbb9c[_0x6665('0x2e')][_0x6665('0x1c')]);}_0x177866['order']=qs[_0x6665('0x35')](_0x6cbb9c['query'][_0x6665('0x35')]);_0x177866[_0x6665('0x36')]=qs[_0x6665('0x30')](_[_0x6665('0x37')](_0x6cbb9c[_0x6665('0x2e')],_0x400f91['filters']),_0x6840e3);if(_0x6cbb9c['query'][_0x6665('0x38')]){_0x177866[_0x6665('0x36')]=_[_0x6665('0x39')](_0x177866[_0x6665('0x36')],{'$or':_[_0x6665('0x29')](_0x6840e3,function(_0x25123c){if(_0x25123c[_0x6665('0x2b')]!==_0x6665('0x3a')){var _0x2bda81={};_0x2bda81[_0x25123c[_0x6665('0x26')]]={'$like':'%'+_0x6cbb9c[_0x6665('0x2e')][_0x6665('0x38')]+'%'};return _0x2bda81;}})});}_0x177866=_[_0x6665('0x39')]({},_0x177866,_0x6cbb9c[_0x6665('0x3b')]);var _0x10ab7f={'where':_0x177866[_0x6665('0x36')]};return db[_0x6665('0x3c')][_0x6665('0x1b')](_0x10ab7f)['then'](function(_0x11cc49){_0x4ffac2[_0x6665('0x1b')]=_0x11cc49;if(_0x6cbb9c[_0x6665('0x2e')][_0x6665('0x3d')]){_0x177866[_0x6665('0x3e')]=[{'all':!![]}];}return db[_0x6665('0x3c')][_0x6665('0x3f')](_0x177866);})[_0x6665('0x21')](function(_0x1a0d86){_0x4ffac2[_0x6665('0x40')]=_0x1a0d86;return _0x4ffac2;})[_0x6665('0x21')](respondWithFilteredResult(_0x51df2f,_0x177866))[_0x6665('0x41')](handleError(_0x51df2f,null));};exports[_0x6665('0x42')]=function(_0x3d38f2,_0x5042b0){var _0x15f91a={'raw':!![],'where':{'id':_0x3d38f2[_0x6665('0x43')]['id']}},_0x170175={};_0x170175[_0x6665('0x2d')]=_[_0x6665('0x2f')](db['ChatTransferReport'][_0x6665('0x2a')]);_0x170175[_0x6665('0x2e')]=_['keys'](_0x3d38f2['query']);_0x170175[_0x6665('0x30')]=_[_0x6665('0x31')](_0x170175['model'],_0x170175[_0x6665('0x2e')]);_0x15f91a['attributes']=_['intersection'](_0x170175[_0x6665('0x2d')],qs['fields'](_0x3d38f2[_0x6665('0x2e')]['fields']));_0x15f91a['attributes']=_0x15f91a[_0x6665('0x32')][_0x6665('0x34')]?_0x15f91a[_0x6665('0x32')]:_0x170175['model'];if(_0x3d38f2['query'][_0x6665('0x3d')]){_0x15f91a[_0x6665('0x3e')]=[{'all':!![]}];}_0x15f91a=_[_0x6665('0x39')]({},_0x15f91a,_0x3d38f2['options']);return db[_0x6665('0x3c')][_0x6665('0x44')](_0x15f91a)[_0x6665('0x21')](handleEntityNotFound(_0x5042b0,null))['then'](respondWithResult(_0x5042b0,null))['catch'](handleError(_0x5042b0,null));};exports[_0x6665('0x45')]=function(_0x1ce8f1,_0x4d36e6){return db[_0x6665('0x3c')]['create'](_0x1ce8f1[_0x6665('0x46')],{})[_0x6665('0x21')](respondWithResult(_0x4d36e6,0xc9))[_0x6665('0x41')](handleError(_0x4d36e6,null));};exports[_0x6665('0x20')]=function(_0x22d25e,_0x323d83){if(_0x22d25e['body']['id']){delete _0x22d25e[_0x6665('0x46')]['id'];}return db[_0x6665('0x3c')][_0x6665('0x44')]({'where':{'id':_0x22d25e['params']['id']}})[_0x6665('0x21')](handleEntityNotFound(_0x323d83,null))['then'](saveUpdates(_0x22d25e[_0x6665('0x46')],null))[_0x6665('0x21')](respondWithResult(_0x323d83,null))[_0x6665('0x41')](handleError(_0x323d83,null));};exports[_0x6665('0x22')]=function(_0x23509e,_0x1c37d3){return db['ChatTransferReport'][_0x6665('0x44')]({'where':{'id':_0x23509e[_0x6665('0x43')]['id']}})[_0x6665('0x21')](handleEntityNotFound(_0x1c37d3,null))[_0x6665('0x21')](removeEntity(_0x1c37d3,null))[_0x6665('0x41')](handleError(_0x1c37d3,null));};exports['describe']=function(_0x59af8d,_0x5ce519){return db['ChatTransferReport'][_0x6665('0x47')]()['then'](respondWithResult(_0x5ce519,null))[_0x6665('0x41')](handleError(_0x5ce519,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 719309c..a2ef285 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 _0x4561=['request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','define','report_chat_transfer','uniqueid','lodash','../../config/logger','bluebird'];(function(_0xadd2e3,_0x148cba){var _0x47e800=function(_0x2e332c){while(--_0x2e332c){_0xadd2e3['push'](_0xadd2e3['shift']());}};_0x47e800(++_0x148cba);}(_0x4561,0xce));var _0x1456=function(_0x39a07e,_0x1a621d){_0x39a07e=_0x39a07e-0x0;var _0x52465f=_0x4561[_0x39a07e];return _0x52465f;};'use strict';var _=require(_0x1456('0x0'));var util=require('util');var logger=require(_0x1456('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1456('0x2'));var rp=require(_0x1456('0x3'));var fs=require('fs');var path=require(_0x1456('0x4'));var rimraf=require(_0x1456('0x5'));var config=require(_0x1456('0x6'));var attributes=require(_0x1456('0x7'));module['exports']=function(_0xdd5580,_0x471c89){return _0xdd5580[_0x1456('0x8')]('ChatTransferReport',attributes,{'tableName':_0x1456('0x9'),'paranoid':![],'indexes':[{'name':_0x1456('0xa'),'fields':[_0x1456('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x816d=['bluebird','path','rimraf','../../config/environment','./chatTransferReport.attributes','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','moment'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x816d,0x1aa));var _0xd816=function(_0x16a006,_0x1c9024){_0x16a006=_0x16a006-0x0;var _0x4e72b6=_0x816d[_0x16a006];return _0x4e72b6;};'use strict';var _=require(_0xd816('0x0'));var util=require(_0xd816('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd816('0x2'));var BPromise=require(_0xd816('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd816('0x4'));var rimraf=require(_0xd816('0x5'));var config=require(_0xd816('0x6'));var attributes=require(_0xd816('0x7'));module['exports']=function(_0x47b8e4,_0x3da7b3){return _0x47b8e4['define'](_0xd816('0x8'),attributes,{'tableName':_0xd816('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xd816('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 0ffddc4..c2d58ba 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 _0x327b=['jayson/promise','client','request','then','info','request\x20sent','debug','error','message','ChatTransferReport,\x20%s,\x20%s','result','catch','moment','bluebird','randomstring','rpc'];(function(_0x432aa9,_0x204563){var _0x4b1889=function(_0xbb5cf3){while(--_0xbb5cf3){_0x432aa9['push'](_0x432aa9['shift']());}};_0x4b1889(++_0x204563);}(_0x327b,0x1bc));var _0xb327=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x327b[_0xdea41a];return _0x15d0d8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb327('0x0'));var BPromise=require(_0xb327('0x1'));var rs=require(_0xb327('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb327('0x3'));var config=require('../../config/environment');var jayson=require(_0xb327('0x4'));var client=jayson[_0xb327('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x133c87,_0x53d41b,_0x324263){return new BPromise(function(_0x4f6df5,_0x37680c){return client[_0xb327('0x6')](_0x133c87,_0x324263)[_0xb327('0x7')](function(_0x5e19c2){logger[_0xb327('0x8')]('ChatTransferReport,\x20%s,\x20%s',_0x53d41b,_0xb327('0x9'));logger[_0xb327('0xa')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x53d41b,_0xb327('0x9'),JSON['stringify'](_0x5e19c2));if(_0x5e19c2[_0xb327('0xb')]){if(_0x5e19c2['error']['code']===0x1f4){logger[_0xb327('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x53d41b,_0x5e19c2[_0xb327('0xb')][_0xb327('0xc')]);return _0x37680c(_0x5e19c2['error'][_0xb327('0xc')]);}logger[_0xb327('0xb')](_0xb327('0xd'),_0x53d41b,_0x5e19c2[_0xb327('0xb')][_0xb327('0xc')]);return _0x4f6df5(_0x5e19c2[_0xb327('0xb')][_0xb327('0xc')]);}else{logger[_0xb327('0x8')]('ChatTransferReport,\x20%s,\x20%s',_0x53d41b,_0xb327('0x9'));_0x4f6df5(_0x5e19c2[_0xb327('0xe')][_0xb327('0xc')]);}})[_0xb327('0xf')](function(_0x11549f){logger['error'](_0xb327('0xd'),_0x53d41b,_0x11549f);_0x37680c(_0x11549f);});});} \ No newline at end of file +var _0x777a=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x1973e2,_0x91711e){var _0x1d73b2=function(_0x418523){while(--_0x418523){_0x1973e2['push'](_0x1973e2['shift']());}};_0x1d73b2(++_0x91711e);}(_0x777a,0x1b1));var _0xa777=function(_0x361178,_0x32bcea){_0x361178=_0x361178-0x0;var _0x184953=_0x777a[_0x361178];return _0x184953;};'use strict';var _=require(_0xa777('0x0'));var util=require(_0xa777('0x1'));var moment=require(_0xa777('0x2'));var BPromise=require(_0xa777('0x3'));var rs=require(_0xa777('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa777('0x5'))['db'];var utils=require(_0xa777('0x6'));var logger=require(_0xa777('0x7'))(_0xa777('0x8'));var config=require(_0xa777('0x9'));var jayson=require(_0xa777('0xa'));var client=jayson[_0xa777('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x337ae7,_0x4b8675,_0x1fefe0){return new BPromise(function(_0x252ea9,_0x53d960){return client['request'](_0x337ae7,_0x1fefe0)[_0xa777('0xc')](function(_0x48c92d){logger['info'](_0xa777('0xd'),_0x4b8675,'request\x20sent');logger[_0xa777('0xe')](_0xa777('0xf'),_0x4b8675,_0xa777('0x10'),JSON[_0xa777('0x11')](_0x48c92d));if(_0x48c92d['error']){if(_0x48c92d[_0xa777('0x12')][_0xa777('0x13')]===0x1f4){logger[_0xa777('0x12')](_0xa777('0xd'),_0x4b8675,_0x48c92d[_0xa777('0x12')][_0xa777('0x14')]);return _0x53d960(_0x48c92d['error'][_0xa777('0x14')]);}logger['error'](_0xa777('0xd'),_0x4b8675,_0x48c92d[_0xa777('0x12')][_0xa777('0x14')]);return _0x252ea9(_0x48c92d[_0xa777('0x12')][_0xa777('0x14')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x4b8675,_0xa777('0x10'));_0x252ea9(_0x48c92d[_0xa777('0x15')][_0xa777('0x14')]);}})[_0xa777('0x16')](function(_0x31ee09){logger[_0xa777('0x12')](_0xa777('0xd'),_0x4b8675,_0x31ee09);_0x53d960(_0x31ee09);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index ab6c35d..f8cab30 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 _0xa3a6=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','/describe','isAuthenticated','describe','show','post','create','put','/:id','delete','destroy','exports','util','path','express'];(function(_0x3bbb6f,_0x417963){var _0x42cfc4=function(_0x357d55){while(--_0x357d55){_0x3bbb6f['push'](_0x3bbb6f['shift']());}};_0x42cfc4(++_0x417963);}(_0xa3a6,0xb1));var _0x6a3a=function(_0x42c26c,_0x293b2e){_0x42c26c=_0x42c26c-0x0;var _0x76fae5=_0xa3a6[_0x42c26c];return _0x76fae5;};'use strict';var multer=require('multer');var util=require(_0x6a3a('0x0'));var path=require(_0x6a3a('0x1'));var timeout=require('connect-timeout');var express=require(_0x6a3a('0x2'));var router=express[_0x6a3a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6a3a('0x4'));var interaction=require(_0x6a3a('0x5'));var config=require(_0x6a3a('0x6'));var controller=require(_0x6a3a('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x6a3a('0x8')](_0x6a3a('0x9'),auth[_0x6a3a('0xa')](),controller[_0x6a3a('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x6a3a('0xc')]);router[_0x6a3a('0xd')]('/',auth[_0x6a3a('0xa')](),controller[_0x6a3a('0xe')]);router[_0x6a3a('0xf')](_0x6a3a('0x10'),auth[_0x6a3a('0xa')](),controller['update']);router[_0x6a3a('0x11')](_0x6a3a('0x10'),auth[_0x6a3a('0xa')](),controller[_0x6a3a('0x12')]);module[_0x6a3a('0x13')]=router; \ No newline at end of file +var _0x9856=['create','put','update','delete','/:id','destroy','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','./chatTransferReport.controller','get','/describe','isAuthenticated','describe','show'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0x9856,0x84));var _0x6985=function(_0x53a435,_0xa67f88){_0x53a435=_0x53a435-0x0;var _0x17a702=_0x9856[_0x53a435];return _0x17a702;};'use strict';var multer=require(_0x6985('0x0'));var util=require(_0x6985('0x1'));var path=require('path');var timeout=require(_0x6985('0x2'));var express=require('express');var router=express[_0x6985('0x3')]();var fs_extra=require(_0x6985('0x4'));var auth=require(_0x6985('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6985('0x6'));router[_0x6985('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6985('0x7')](_0x6985('0x8'),auth[_0x6985('0x9')](),controller[_0x6985('0xa')]);router[_0x6985('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x6985('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6985('0xc')]);router[_0x6985('0xd')]('/:id',auth[_0x6985('0x9')](),controller[_0x6985('0xe')]);router[_0x6985('0xf')](_0x6985('0x10'),auth['isAuthenticated'](),controller[_0x6985('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 12dbbfc..c4de6f8 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 _0xfd90=['input','name','text','getDataValue','onlineForm','parse','setDataValue','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','#011F6A','#ffffff','INTEGER','BOOLEAN','rounded','squared','We\x20are\x20here!','Chat','Send','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Skip','ENUM','thumb','star','stringify'];(function(_0x3f4098,_0x3365b2){var _0x3d5d0c=function(_0x3a7cdb){while(--_0x3a7cdb){_0x3f4098['push'](_0x3f4098['shift']());}};_0x3d5d0c(++_0x3365b2);}(_0xfd90,0x7d));var _0x0fd9=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfd90[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0fd9('0x0'));var rs=require(_0x0fd9('0x1'));module[_0x0fd9('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x0fd9('0x3')],'allowNull':![],'unique':_0x0fd9('0x4')},'description':{'type':Sequelize[_0x0fd9('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x0fd9('0x5')},'mapKeyOffline':{'type':Sequelize[_0x0fd9('0x3')],'defaultValue':_0x0fd9('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x0fd9('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x0fd9('0x3')],'allowNull':![],'defaultValue':_0x0fd9('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x0fd9('0x3')],'allowNull':![],'defaultValue':_0x0fd9('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x0fd9('0x3')],'allowNull':![],'defaultValue':_0x0fd9('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x0fd9('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x0fd9('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x0fd9('0x3')]},'animation':{'type':Sequelize[_0x0fd9('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x0fd9('0xa'),_0x0fd9('0xb')),'defaultValue':_0x0fd9('0xa')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x0fd9('0xc')},'start_chat_button':{'type':Sequelize[_0x0fd9('0x3')],'defaultValue':_0x0fd9('0xd')},'offline_chat_button':{'type':Sequelize[_0x0fd9('0x3')],'defaultValue':_0x0fd9('0xe')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x0fd9('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x0fd9('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x0fd9('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x0fd9('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x0fd9('0xf')]},'closingQuestion':{'type':Sequelize[_0x0fd9('0x3')],'defaultValue':_0x0fd9('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0x0fd9('0x3')],'defaultValue':_0x0fd9('0x11')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0fd9('0x12')},'noteTitle':{'type':Sequelize[_0x0fd9('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x0fd9('0x3')],'defaultValue':_0x0fd9('0x13')},'closingMessage':{'type':Sequelize[_0x0fd9('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x0fd9('0xe')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x0fd9('0x14')},'conditionAgreement':{'type':Sequelize[_0x0fd9('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x0fd9('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x0fd9('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x0fd9('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x0fd9('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x0fd9('0x15')]('star',_0x0fd9('0x16')),'defaultValue':_0x0fd9('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x0fd9('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x0fd9('0xf')],'defaultValue':function(){return JSON[_0x0fd9('0x18')]({'items':[{'type':_0x0fd9('0x19'),'variable':null,'config':{'placeholder':_0x0fd9('0x1a'),'type':_0x0fd9('0x1b'),'required':!![]},'props':{'title':_0x0fd9('0x1a'),'helpText':''}},{'type':_0x0fd9('0x19'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x0fd9('0x5'),'type':_0x0fd9('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x0fd9('0x1c')](_0x0fd9('0x1d'))?JSON[_0x0fd9('0x1e')](this['getDataValue']('onlineForm')):{};},'set':function(_0x42d5f4){return this[_0x0fd9('0x1f')](_0x0fd9('0x1d'),JSON[_0x0fd9('0x18')](_0x42d5f4));}},'offlineForm':{'type':Sequelize[_0x0fd9('0xf')],'defaultValue':function(){return JSON[_0x0fd9('0x18')]({'items':[{'type':_0x0fd9('0x19'),'props':{'title':_0x0fd9('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x0fd9('0x5'),'type':_0x0fd9('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':_0x0fd9('0x20')},'props':{'title':_0x0fd9('0x20'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x0fd9('0x1c')](_0x0fd9('0x21'))?JSON['parse'](this[_0x0fd9('0x1c')](_0x0fd9('0x21'))):{};},'set':function(_0x44dbd7){return this['setDataValue']('offlineForm',JSON['stringify'](_0x44dbd7));}},'token':{'type':Sequelize[_0x0fd9('0x3')],'defaultValue':function(){return rs[_0x0fd9('0x22')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x0fd9('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x0fd9('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x0fd9('0x3')],'defaultValue':_0x0fd9('0x23')},'waitingMessage':{'type':Sequelize[_0x0fd9('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x0fd9('0x3')],'defaultValue':_0x0fd9('0x24')},'offlineMessageBody':{'type':Sequelize[_0x0fd9('0x3')],'defaultValue':_0x0fd9('0x25')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0fd9('0x26')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x0fd9('0xe')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x0fd9('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x0fd9('0xf')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x0fd9('0x3')]},'notificationTemplate':{'type':Sequelize[_0x0fd9('0xf')],'defaultValue':function(){return _0x0fd9('0x27');}},'notificationSound':{'type':Sequelize[_0x0fd9('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0fd9('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x0fd9('0x3')],'defaultValue':_0x0fd9('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0x0fd9('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x0fd9('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x0fd9('0x3')],'defaultValue':_0x0fd9('0x29')},'verticalAlignment':{'type':Sequelize[_0x0fd9('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x0fd9('0x3')],'defaultValue':_0x0fd9('0x2a')},'messagesAlignment':{'type':Sequelize[_0x0fd9('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x0fd9('0x3')]},'customerAvatar':{'type':Sequelize[_0x0fd9('0xf')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x0fd9('0x3')],'allowNull':![],'defaultValue':_0x0fd9('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x0fd9('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0fd9('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0fd9('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0fd9('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x0fd9('0x3')],'defaultValue':_0x0fd9('0x2c')},'systemAvatar':{'type':Sequelize[_0x0fd9('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0fd9('0x8')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x0fd9('0x9')],'defaultValue':![],'comment':_0x0fd9('0x2d'),'set':function(_0x33876b){if(!_0x33876b)this[_0x0fd9('0x1f')](_0x0fd9('0x2e'),null);this[_0x0fd9('0x1f')](_0x0fd9('0x2f'),_0x33876b);}},'vidaooEscalation':{'type':Sequelize[_0x0fd9('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0fd9('0x30')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x0fd9('0x31');}},'vidaooMetadata':{'type':Sequelize[_0x0fd9('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x0fd9('0xf')]}}; \ No newline at end of file +var _0xabb4=['#011F6A','#ffffff','INTEGER','BOOLEAN','rounded','Chat','Powered\x20by\x20xCALLY','TEXT','Note','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','Feedback','ENUM','star','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','#fafafa','System','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','address','email','Agent'];(function(_0x2f6233,_0x90172){var _0x1c9c36=function(_0x3ac680){while(--_0x3ac680){_0x2f6233['push'](_0x2f6233['shift']());}};_0x1c9c36(++_0x90172);}(_0xabb4,0x198));var _0x4abb=function(_0x47c6b7,_0x2e510f){_0x47c6b7=_0x47c6b7-0x0;var _0x53e87e=_0xabb4[_0x47c6b7];return _0x53e87e;};'use strict';var Sequelize=require(_0x4abb('0x0'));var rs=require(_0x4abb('0x1'));module['exports']={'name':{'type':Sequelize[_0x4abb('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x4abb('0x2')],'allowNull':![],'unique':_0x4abb('0x3')},'description':{'type':Sequelize[_0x4abb('0x2')]},'mapKey':{'type':Sequelize[_0x4abb('0x2')],'defaultValue':_0x4abb('0x4')},'mapKeyOffline':{'type':Sequelize[_0x4abb('0x2')],'defaultValue':_0x4abb('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x4abb('0x2')],'defaultValue':_0x4abb('0x5')},'customerAlias':{'type':Sequelize[_0x4abb('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x4abb('0x2')],'allowNull':![],'defaultValue':_0x4abb('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4abb('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x4abb('0x2')],'allowNull':![],'defaultValue':_0x4abb('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4abb('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x4abb('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x4abb('0x2')]},'animation':{'type':Sequelize[_0x4abb('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x4abb('0xa'),'squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x4abb('0x2')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x4abb('0x2')],'defaultValue':_0x4abb('0xb')},'offline_chat_button':{'type':Sequelize[_0x4abb('0x2')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x4abb('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x4abb('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x4abb('0x2')],'defaultValue':_0x4abb('0xc')},'defaultWhiteLabel':{'type':Sequelize[_0x4abb('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x4abb('0xd')]},'closingQuestion':{'type':Sequelize[_0x4abb('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x4abb('0x2')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x4abb('0x2')],'defaultValue':_0x4abb('0xe')},'placeholderMessage':{'type':Sequelize[_0x4abb('0x2')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x4abb('0x2')],'defaultValue':_0x4abb('0xf')},'closingMessageButton':{'type':Sequelize[_0x4abb('0x2')],'defaultValue':_0x4abb('0x10')},'skipMessageButton':{'type':Sequelize[_0x4abb('0x2')],'defaultValue':_0x4abb('0x11')},'conditionAgreement':{'type':Sequelize[_0x4abb('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x4abb('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x4abb('0x12')},'ratingType':{'type':Sequelize[_0x4abb('0x13')](_0x4abb('0x14'),_0x4abb('0x15')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x4abb('0xd')],'defaultValue':function(){return JSON[_0x4abb('0x16')]({'items':[{'type':_0x4abb('0x17'),'variable':null,'config':{'placeholder':_0x4abb('0x18'),'type':_0x4abb('0x19'),'required':!![]},'props':{'title':_0x4abb('0x18'),'helpText':''}},{'type':_0x4abb('0x17'),'props':{'title':_0x4abb('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x4abb('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x4abb('0x1a')](_0x4abb('0x1b'))?JSON[_0x4abb('0x1c')](this[_0x4abb('0x1a')](_0x4abb('0x1b'))):{};},'set':function(_0x52f302){return this[_0x4abb('0x1d')]('onlineForm',JSON[_0x4abb('0x16')](_0x52f302));}},'offlineForm':{'type':Sequelize[_0x4abb('0xd')],'defaultValue':function(){return JSON[_0x4abb('0x16')]({'items':[{'type':_0x4abb('0x17'),'props':{'title':_0x4abb('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x4abb('0x4'),'type':_0x4abb('0x4')},'variable':null},{'type':_0x4abb('0x1e'),'config':{'placeholder':_0x4abb('0x1f')},'props':{'title':_0x4abb('0x1f'),'helpText':_0x4abb('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x4abb('0x1a')]('offlineForm')?JSON[_0x4abb('0x1c')](this['getDataValue'](_0x4abb('0x21'))):{};},'set':function(_0x33b765){return this['setDataValue']('offlineForm',JSON[_0x4abb('0x16')](_0x33b765));}},'token':{'type':Sequelize[_0x4abb('0x2')],'defaultValue':function(){return rs[_0x4abb('0x22')]();}},'autoclose':{'type':Sequelize[_0x4abb('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x4abb('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x4abb('0x2')]},'forwardOffline':{'type':Sequelize[_0x4abb('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x4abb('0x2')]},'waitingTitle':{'type':Sequelize[_0x4abb('0x2')],'defaultValue':_0x4abb('0x23')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x4abb('0x24')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x4abb('0x25')},'offlineMessageBody':{'type':Sequelize[_0x4abb('0x2')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x4abb('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x4abb('0x2')],'defaultValue':_0x4abb('0x26')},'skipUnmanaged':{'type':Sequelize[_0x4abb('0x2')],'defaultValue':_0x4abb('0x11')},'sendUnmanaged':{'type':Sequelize[_0x4abb('0x2')],'defaultValue':_0x4abb('0x10')},'enableCustomerAttachment':{'type':Sequelize[_0x4abb('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x4abb('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x4abb('0xd')]},'showAgentAvatar':{'type':Sequelize[_0x4abb('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x4abb('0x2')]},'notificationTemplate':{'type':Sequelize[_0x4abb('0xd')],'defaultValue':function(){return _0x4abb('0x27');}},'notificationSound':{'type':Sequelize[_0x4abb('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x4abb('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x4abb('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x4abb('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x4abb('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x4abb('0x28')},'verticalAlignment':{'type':Sequelize[_0x4abb('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x4abb('0x2')],'defaultValue':_0x4abb('0x29')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x4abb('0x2')]},'customerAvatar':{'type':Sequelize[_0x4abb('0xd')]},'showCustomerAvatar':{'type':Sequelize[_0x4abb('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x4abb('0x2')],'allowNull':![],'defaultValue':_0x4abb('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x4abb('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4abb('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4abb('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x4abb('0x2')],'defaultValue':_0x4abb('0x2b')},'systemAvatar':{'type':Sequelize[_0x4abb('0xd')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x4abb('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x5928ec){if(!_0x5928ec)this[_0x4abb('0x1d')]('mandatoryDispositionPauseId',null);this[_0x4abb('0x1d')](_0x4abb('0x2c'),_0x5928ec);}},'vidaooEscalation':{'type':Sequelize[_0x4abb('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x4abb('0x2')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x4abb('0x2d');}},'vidaooMetadata':{'type':Sequelize[_0x4abb('0xd')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x4abb('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x4abb('0xd')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index c086c51..6abd234 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 _0xc316=['priority','finally','getApplications','addProactiveActions','chatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','Attachments','addAgents','userChatWebsite:save','emit','getAgents','mustache','ejs','querystring','html-to-text','ioredis','jayson/promise','url','../../components/parsers/qs','../../config/logger','../../config/environment','../../errors/api','APIBadRequestError','APINotFoundError','APIConflictError','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','http','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','then','get','ChatWebsites','UserProfileResource','sendStatus','stack','name','send','user-agent-parser','user-agent','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','browser','version','format','%s\x20%s','unknown','device','model','vendor','type','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','key','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','filter','where','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ChatWebsiteId','Disposition','getDispositions','sort','pick','removeDispositions','ids','addAnswer','CannedAnswer','findOne','removeAnswers','addLogo','file','filename','addAvatar','customerAvatar','systemAvatar','getLogo','join','root','sitepic','../../config/license/util','custom','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','isNil','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','chat','from','From\x20is\x20mandatory','mapKey','Body\x20is\x20mandatory','CmContact','createdAt','updatedAt','includes','CompanyId','ListId','CmList','List','Applications','Interval','Intervals','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','timezone','ifTime','account','list','applications','orderBy','asc','Contacts','contact','headers','threadId','ChatInteraction','customerIp','referer','externalUrl','ContactId','interaction','messageId','created','autoclose','push','close','unmanaged','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','queueId','ChatQueue','queue','waitForTheAssignedQueue','EventManager','offline','files','Sequelize','ValidationError','no\x20available\x20attributes','difference','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','Smtp','CloudProvider','forwardOffline','getSmtpOptions','sendMail','MailAccountId','toPairsIn','subjectOffline','email','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','internal','color','tag','getProactiveActions','getLicense','virtual','chatLicenseExceeded','server/files/chat/iframe.ejs','address','origin','3.8.0','remote','x-real-ip','connection','remoteAddress','alignment','labelText','textColor','textButtonColor','backgroundColor','IntervalId','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication'];(function(_0x5a0f53,_0x3cf8a4){var _0x262793=function(_0x7d6caa){while(--_0x7d6caa){_0x5a0f53['push'](_0x5a0f53['shift']());}};_0x262793(++_0x3cf8a4);}(_0xc316,0x12f));var _0x6c31=function(_0x59f0f7,_0x47d38d){_0x59f0f7=_0x59f0f7-0x0;var _0x275ae4=_0xc316[_0x59f0f7];return _0x275ae4;};'use strict';var Mustache=require(_0x6c31('0x0'));var util=require('util');var path=require('path');var ejs=require(_0x6c31('0x1'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var querystring=require(_0x6c31('0x2'));var htmlToText=require(_0x6c31('0x3'));var Redis=require(_0x6c31('0x4'));var jayson=require(_0x6c31('0x5'));var url=require(_0x6c31('0x6'));var qs=require(_0x6c31('0x7'));var logger=require(_0x6c31('0x8'))('api');var config=require(_0x6c31('0x9'));var APIBadRequestError=require(_0x6c31('0xa'))[_0x6c31('0xb')];var APINotFoundError=require(_0x6c31('0xa'))[_0x6c31('0xc')];var APIOutOfIntervalError=require(_0x6c31('0xa'))['APIOutOfIntervalError'];var APIHandleError=require(_0x6c31('0xa'))['handleError'];var APIConflictError=require(_0x6c31('0xa'))[_0x6c31('0xd')];var db=require(_0x6c31('0xe'))['db'];config[_0x6c31('0xf')]=_[_0x6c31('0x10')](config[_0x6c31('0xf')],{'host':_0x6c31('0x11'),'port':0x18eb});var socket=require(_0x6c31('0x12'))(new Redis(config[_0x6c31('0xf')]));require('./chatWebsite.socket')[_0x6c31('0x13')](socket);var client=jayson[_0x6c31('0x14')][_0x6c31('0x15')]({'port':0x232c});var client9002=jayson['client'][_0x6c31('0x15')]({'port':0x232a});var client9003=jayson[_0x6c31('0x14')][_0x6c31('0x15')]({'port':0x232b});var client9001=jayson[_0x6c31('0x14')][_0x6c31('0x15')]({'port':0x2329});function respondWithRpcPromise(_0x3d2644,_0x2a52f9,_0x1e12fd,_0x6253c1){return new Promise(function(_0xae0153,_0x1ea3c1){var _0x21171d=_0x6253c1||client;return _0x21171d[_0x6c31('0x16')](_0x3d2644,_0x1e12fd)['then'](function(_0x22eb40){logger[_0x6c31('0x17')](_0x6c31('0x18'),_0x2a52f9,_0x6c31('0x19'));logger[_0x6c31('0x1a')](_0x6c31('0x1b'),_0x2a52f9,_0x6c31('0x19'),JSON[_0x6c31('0x1c')](_0x22eb40));if(_0x22eb40[_0x6c31('0x1d')]){if(_0x22eb40[_0x6c31('0x1d')][_0x6c31('0x1e')]===0x1f4){logger[_0x6c31('0x1d')](_0x6c31('0x18'),_0x2a52f9,_0x22eb40[_0x6c31('0x1d')][_0x6c31('0x1f')]);return _0x1ea3c1(_0x22eb40[_0x6c31('0x1d')][_0x6c31('0x1f')]);}logger['error'](_0x6c31('0x18'),_0x2a52f9,_0x22eb40[_0x6c31('0x1d')][_0x6c31('0x1f')]);return _0xae0153(_0x22eb40['error'][_0x6c31('0x1f')]);}else{logger[_0x6c31('0x17')](_0x6c31('0x18'),_0x2a52f9,_0x6c31('0x19'));_0xae0153(_0x22eb40[_0x6c31('0x20')][_0x6c31('0x1f')]);}})[_0x6c31('0x21')](function(_0x679051){logger[_0x6c31('0x1d')](_0x6c31('0x18'),_0x2a52f9,_0x679051);_0x1ea3c1(_0x679051);});});}function respondWithStatusCode(_0x2ab609,_0x26d7e0){_0x26d7e0=_0x26d7e0||0xcc;return function(_0x513a44){if(_0x513a44){return _0x2ab609['sendStatus'](_0x26d7e0);}return _0x2ab609[_0x6c31('0x22')](_0x26d7e0)[_0x6c31('0x23')]();};}function respondWithResult(_0x4b83c4,_0x4c3bb3){_0x4c3bb3=_0x4c3bb3||0xc8;return function(_0x139f45){if(_0x139f45){return _0x4b83c4[_0x6c31('0x22')](_0x4c3bb3)[_0x6c31('0x24')](_0x139f45);}};}function respondWithFilteredResult(_0x5ae544,_0x2b7bde){return function(_0x2ef3e1){if(_0x2ef3e1){var _0x494e88=typeof _0x2b7bde[_0x6c31('0x25')]===_0x6c31('0x26')&&typeof _0x2b7bde[_0x6c31('0x27')]===_0x6c31('0x26');var _0x3a8bdb=_0x2ef3e1[_0x6c31('0x28')];var _0x438048=_0x494e88?0x0:_0x2b7bde[_0x6c31('0x25')];var _0x19b81c=_0x494e88?_0x2ef3e1['count']:_0x2b7bde[_0x6c31('0x25')]+_0x2b7bde[_0x6c31('0x27')];var _0x43b3fa;if(_0x19b81c>=_0x3a8bdb){_0x19b81c=_0x3a8bdb;_0x43b3fa=0xc8;}else{_0x43b3fa=0xce;}_0x5ae544[_0x6c31('0x22')](_0x43b3fa);return _0x5ae544[_0x6c31('0x29')](_0x6c31('0x2a'),_0x438048+'-'+_0x19b81c+'/'+_0x3a8bdb)[_0x6c31('0x24')](_0x2ef3e1);}return null;};}function saveUpdates(_0x1e38e1){return function(_0x68e5f7){if(_0x68e5f7){return _0x68e5f7['update'](_0x1e38e1)['then'](function(_0x1c4275){return _0x1c4275;});}return null;};}function removeEntity(_0x1f12d1){return function(_0x46389c){if(_0x46389c){return _0x46389c[_0x6c31('0x2b')]()[_0x6c31('0x2c')](function(){var _0x51720a=_0x46389c[_0x6c31('0x2d')]({'plain':!![]});var _0x274737=_0x6c31('0x2e');return db[_0x6c31('0x2f')]['destroy']({'where':{'type':_0x274737,'resourceId':_0x51720a['id']}})[_0x6c31('0x2c')](function(){return _0x46389c;});})[_0x6c31('0x2c')](function(){_0x1f12d1[_0x6c31('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x488a81){return function(_0x360323){if(!_0x360323){_0x488a81[_0x6c31('0x30')](0x194);}return _0x360323;};}function handleError(_0x35eb32,_0x1bced4){_0x1bced4=_0x1bced4||0x1f4;return function(_0x1b4fa1){logger[_0x6c31('0x1d')](_0x1b4fa1[_0x6c31('0x31')]);if(_0x1b4fa1[_0x6c31('0x32')]){delete _0x1b4fa1[_0x6c31('0x32')];}_0x35eb32[_0x6c31('0x22')](_0x1bced4)[_0x6c31('0x33')](_0x1b4fa1);};}function createInteractionObject(_0x2e7b7d,_0x3cbb83,_0x31807a,_0x44f036){var _0x4c9a36=require(_0x6c31('0x34'));var _0x2ed57b=new _0x4c9a36();var _0x2cdb2e=_0x2ed57b['setUA'](_0x31807a[_0x6c31('0x35')])['getResult']();var _0x43af8a=_0x3cbb83['customerIp'];if(_0x31807a[_0x6c31('0x36')]){_0x43af8a=_0x31807a[_0x6c31('0x36')];}else if(_0x31807a[_0x6c31('0x37')]){_0x43af8a=_['first'](_0x31807a[_0x6c31('0x37')][_0x6c31('0x38')](','));}return{'ContactId':_0x44f036['id'],'ChatWebsiteId':_0x2e7b7d,'from':(_0x44f036[_0x6c31('0x39')]||'')+'\x20'+(_0x44f036[_0x6c31('0x3a')]||''),'customerIp':_0x43af8a,'customerPort':_0x31807a[_0x6c31('0x3b')]?_0x31807a[_0x6c31('0x3b')]:null,'referer':_0x3cbb83['referer'],'browserName':_0x2cdb2e[_0x6c31('0x3c')][_0x6c31('0x32')]&&_0x2cdb2e[_0x6c31('0x3c')][_0x6c31('0x3d')]?util[_0x6c31('0x3e')](_0x6c31('0x3f'),_0x2cdb2e[_0x6c31('0x3c')][_0x6c31('0x32')],_0x2cdb2e['browser'][_0x6c31('0x3d')]):_0x6c31('0x40'),'browserVersion':_0x2cdb2e[_0x6c31('0x3c')]['version']||_0x6c31('0x40'),'osName':util[_0x6c31('0x3e')](_0x6c31('0x3f'),_0x2cdb2e['os']['name'],_0x2cdb2e['os']['version']),'osVersion':_0x2cdb2e['os'][_0x6c31('0x3d')],'deviceModel':_0x2cdb2e[_0x6c31('0x41')][_0x6c31('0x42')]&&_0x2cdb2e['device'][_0x6c31('0x43')]?util[_0x6c31('0x3e')]('%s\x20%s\x20%s',_0x2cdb2e['device']['model'],_0x2cdb2e[_0x6c31('0x41')]['vendor'],_0x2cdb2e['device']['type']):null,'deviceVendor':_0x2cdb2e[_0x6c31('0x41')]['vendor'],'deviceType':_0x2cdb2e['device'][_0x6c31('0x44')],'formData':JSON[_0x6c31('0x1c')](_0x3cbb83)};}exports[_0x6c31('0x45')]=function(_0x587c43,_0x85f2bd){var _0x3cb72f={'include':[{'model':db[_0x6c31('0x46')],'as':_0x6c31('0x47')}]},_0x51ef21={},_0xbbf063={'count':0x0,'rows':[]};var _0x46df9c=_['map'](db[_0x6c31('0x48')][_0x6c31('0x49')],function(_0x6266f4){return{'name':_0x6266f4['fieldName'],'type':_0x6266f4[_0x6c31('0x44')][_0x6c31('0x4a')]};});_0x51ef21[_0x6c31('0x42')]=_[_0x6c31('0x4b')](_0x46df9c,_0x6c31('0x32'));_0x51ef21[_0x6c31('0x4c')]=_[_0x6c31('0x4d')](_0x587c43['query']);_0x51ef21[_0x6c31('0x4e')]=_[_0x6c31('0x4f')](_0x51ef21[_0x6c31('0x42')],_0x51ef21[_0x6c31('0x4c')]);_0x3cb72f[_0x6c31('0x50')]=_['intersection'](_0x51ef21[_0x6c31('0x42')],qs[_0x6c31('0x51')](_0x587c43[_0x6c31('0x4c')][_0x6c31('0x51')]));_0x3cb72f['attributes']=_0x3cb72f[_0x6c31('0x50')][_0x6c31('0x52')]?_0x3cb72f[_0x6c31('0x50')]:_0x51ef21[_0x6c31('0x42')];if(!_0x587c43[_0x6c31('0x4c')][_0x6c31('0x53')](_0x6c31('0x54'))){_0x3cb72f[_0x6c31('0x27')]=qs['limit'](_0x587c43[_0x6c31('0x4c')][_0x6c31('0x27')]);_0x3cb72f['offset']=qs[_0x6c31('0x25')](_0x587c43[_0x6c31('0x4c')][_0x6c31('0x25')]);}_0x3cb72f[_0x6c31('0x55')]=qs['sort'](_0x587c43[_0x6c31('0x4c')]['sort']);_0x3cb72f['where']=qs[_0x6c31('0x4e')](_['pick'](_0x587c43[_0x6c31('0x4c')],_0x51ef21[_0x6c31('0x4e')]),_0x46df9c);if(_0x587c43[_0x6c31('0x4c')][_0x6c31('0x56')]){_0x3cb72f[_0x6c31('0x57')]=_[_0x6c31('0x58')](_0x3cb72f[_0x6c31('0x57')],{'$or':_['map'](_0x46df9c,function(_0x33e77f){if(_0x33e77f[_0x6c31('0x44')]!=='VIRTUAL'){var _0x172a04={};_0x172a04[_0x33e77f['name']]={'$like':'%'+_0x587c43[_0x6c31('0x4c')][_0x6c31('0x56')]+'%'};return _0x172a04;}})});}_0x3cb72f=_[_0x6c31('0x58')]({},_0x3cb72f,_0x587c43[_0x6c31('0x59')]);var _0x2bf0f7={'where':_0x3cb72f[_0x6c31('0x57')]};return db[_0x6c31('0x48')][_0x6c31('0x28')](_0x2bf0f7)[_0x6c31('0x2c')](function(_0xe2f7f8){_0xbbf063[_0x6c31('0x28')]=_0xe2f7f8;if(_0x587c43['query'][_0x6c31('0x5a')]){_0x3cb72f[_0x6c31('0x5b')]=[{'all':!![]}];}return db['ChatWebsite'][_0x6c31('0x5c')](_0x3cb72f);})[_0x6c31('0x2c')](function(_0x45d23d){_0xbbf063[_0x6c31('0x5d')]=_0x45d23d;return _0xbbf063;})['then'](respondWithFilteredResult(_0x85f2bd,_0x3cb72f))['catch'](handleError(_0x85f2bd,null));};exports[_0x6c31('0x5e')]=function(_0x1d18bb,_0x49f4ed){var _0x2b93c3={'raw':![],'where':{'id':_0x1d18bb[_0x6c31('0x5f')]['id']},'include':[{'model':db['Pause'],'as':_0x6c31('0x47')}]},_0x2fffda={};_0x2fffda['model']=_[_0x6c31('0x4d')](db['ChatWebsite']['rawAttributes']);_0x2fffda['query']=_['keys'](_0x1d18bb['query']);_0x2fffda[_0x6c31('0x4e')]=_[_0x6c31('0x4f')](_0x2fffda[_0x6c31('0x42')],_0x2fffda[_0x6c31('0x4c')]);_0x2b93c3[_0x6c31('0x50')]=_['intersection'](_0x2fffda['model'],qs[_0x6c31('0x51')](_0x1d18bb['query'][_0x6c31('0x51')]));_0x2b93c3[_0x6c31('0x50')]=_0x2b93c3[_0x6c31('0x50')][_0x6c31('0x52')]?_0x2b93c3[_0x6c31('0x50')]:_0x2fffda[_0x6c31('0x42')];if(_0x1d18bb['query'][_0x6c31('0x5a')]){_0x2b93c3['include']=[{'all':!![]}];}_0x2b93c3=_[_0x6c31('0x58')]({},_0x2b93c3,_0x1d18bb[_0x6c31('0x59')]);return db[_0x6c31('0x48')][_0x6c31('0x60')](_0x2b93c3)['then'](handleEntityNotFound(_0x49f4ed,null))[_0x6c31('0x2c')](respondWithResult(_0x49f4ed,null))[_0x6c31('0x21')](handleError(_0x49f4ed,null));};exports[_0x6c31('0x61')]=function(_0x4e22a9,_0x21cc35){return db[_0x6c31('0x48')][_0x6c31('0x61')](_0x4e22a9[_0x6c31('0x62')],{})[_0x6c31('0x2c')](function(_0x3e33e0){var _0x366879=_0x4e22a9[_0x6c31('0x63')][_0x6c31('0x2d')]({'plain':!![]});if(!_0x366879)throw new Error(_0x6c31('0x64'));if(_0x366879['role']===_0x6c31('0x63')){var _0x47915d=_0x3e33e0[_0x6c31('0x2d')]({'plain':!![]});var _0x6232ba=_0x6c31('0x2e');return db['UserProfileSection'][_0x6c31('0x60')]({'where':{'name':_0x6232ba,'userProfileId':_0x366879[_0x6c31('0x65')]},'raw':!![]})[_0x6c31('0x2c')](function(_0x9d0f53){if(_0x9d0f53&&_0x9d0f53[_0x6c31('0x66')]===0x0){return db[_0x6c31('0x2f')]['create']({'name':_0x47915d[_0x6c31('0x32')],'resourceId':_0x47915d['id'],'type':_0x9d0f53['name'],'sectionId':_0x9d0f53['id']},{})[_0x6c31('0x2c')](function(){return _0x3e33e0;});}else{return _0x3e33e0;}})[_0x6c31('0x21')](function(_0x1a1ab1){logger[_0x6c31('0x1d')](_0x6c31('0x67'),_0x1a1ab1);throw _0x1a1ab1;});}return _0x3e33e0;})['then'](respondWithResult(_0x21cc35,0xc9))[_0x6c31('0x21')](handleError(_0x21cc35,null));};exports['update']=function(_0x1e2fa7,_0x3f82c1){if(_0x1e2fa7[_0x6c31('0x62')]['id']){delete _0x1e2fa7[_0x6c31('0x62')]['id'];}return db['ChatWebsite'][_0x6c31('0x60')]({'where':{'id':_0x1e2fa7['params']['id']},'include':[{'model':db['Pause'],'as':_0x6c31('0x47')}]})[_0x6c31('0x2c')](handleEntityNotFound(_0x3f82c1,null))[_0x6c31('0x2c')](saveUpdates(_0x1e2fa7[_0x6c31('0x62')],null))[_0x6c31('0x2c')](respondWithResult(_0x3f82c1,null))[_0x6c31('0x21')](handleError(_0x3f82c1,null));};exports['destroy']=function(_0x525044,_0x41f83c){return db[_0x6c31('0x48')][_0x6c31('0x60')]({'where':{'id':_0x525044[_0x6c31('0x5f')]['id']}})[_0x6c31('0x2c')](handleEntityNotFound(_0x41f83c,null))[_0x6c31('0x2c')](removeEntity(_0x41f83c,null))[_0x6c31('0x21')](handleError(_0x41f83c,null));};exports[_0x6c31('0x68')]=function(_0x1b4129,_0x77e5e2){return db[_0x6c31('0x48')][_0x6c31('0x68')]()[_0x6c31('0x2c')](respondWithResult(_0x77e5e2,null))[_0x6c31('0x21')](handleError(_0x77e5e2,null));};exports['addDisposition']=function(_0x511473,_0x57cd84){if(_0x511473[_0x6c31('0x62')]['id']){delete _0x511473[_0x6c31('0x62')]['id'];}return db[_0x6c31('0x48')][_0x6c31('0x60')]({'where':{'id':_0x511473['params']['id']}})['then'](handleEntityNotFound(_0x57cd84,null))['then'](function(_0x37684c){if(_0x37684c){_0x511473[_0x6c31('0x62')][_0x6c31('0x69')]=_0x37684c['id'];return db[_0x6c31('0x6a')][_0x6c31('0x61')](_0x511473[_0x6c31('0x62')]);}})[_0x6c31('0x2c')](respondWithResult(_0x57cd84,null))[_0x6c31('0x21')](handleError(_0x57cd84,null));};exports[_0x6c31('0x6b')]=function(_0x4f964b,_0x3d781d){var _0x21579c={'raw':![],'where':{}};var _0x36ad26={};var _0x240ed9={'count':0x0,'rows':[]};return db[_0x6c31('0x48')]['findOne']({'where':{'id':_0x4f964b[_0x6c31('0x5f')]['id']}})[_0x6c31('0x2c')](handleEntityNotFound(_0x3d781d,null))[_0x6c31('0x2c')](function(_0x5c8e1e){if(_0x5c8e1e){_0x36ad26[_0x6c31('0x42')]=_[_0x6c31('0x4d')](db[_0x6c31('0x6a')]['rawAttributes']);_0x36ad26[_0x6c31('0x4c')]=_[_0x6c31('0x4d')](_0x4f964b[_0x6c31('0x4c')]);_0x36ad26[_0x6c31('0x4e')]=_[_0x6c31('0x4f')](_0x36ad26['model'],_0x36ad26[_0x6c31('0x4c')]);_0x21579c[_0x6c31('0x50')]=_[_0x6c31('0x4f')](_0x36ad26[_0x6c31('0x42')],qs[_0x6c31('0x51')](_0x4f964b[_0x6c31('0x4c')][_0x6c31('0x51')]));_0x21579c[_0x6c31('0x50')]=_0x21579c['attributes'][_0x6c31('0x52')]?_0x21579c[_0x6c31('0x50')]:_0x36ad26['model'];if(!_0x4f964b[_0x6c31('0x4c')]['hasOwnProperty']('nolimit')){_0x21579c[_0x6c31('0x27')]=qs[_0x6c31('0x27')](_0x4f964b[_0x6c31('0x4c')][_0x6c31('0x27')]);_0x21579c[_0x6c31('0x25')]=qs[_0x6c31('0x25')](_0x4f964b[_0x6c31('0x4c')][_0x6c31('0x25')]);}_0x21579c['order']=qs['sort'](_0x4f964b[_0x6c31('0x4c')][_0x6c31('0x6c')]);_0x21579c[_0x6c31('0x57')]=qs[_0x6c31('0x4e')](_[_0x6c31('0x6d')](_0x4f964b['query'],_0x36ad26['filters']));_0x21579c[_0x6c31('0x57')]['ChatWebsiteId']=_0x5c8e1e['id'];if(_0x4f964b[_0x6c31('0x4c')][_0x6c31('0x56')]){_0x21579c[_0x6c31('0x57')]=_[_0x6c31('0x58')](_0x21579c[_0x6c31('0x57')],{'$or':_[_0x6c31('0x4b')](_0x21579c['attributes'],function(_0x579b62){var _0x55f195={};_0x55f195[_0x579b62]={'$like':'%'+_0x4f964b[_0x6c31('0x4c')][_0x6c31('0x56')]+'%'};return _0x55f195;})});}_0x21579c=_[_0x6c31('0x58')]({},_0x21579c,_0x4f964b[_0x6c31('0x59')]);return db[_0x6c31('0x6a')][_0x6c31('0x28')]({'where':_0x21579c[_0x6c31('0x57')]})[_0x6c31('0x2c')](function(_0x1967b5){_0x240ed9[_0x6c31('0x28')]=_0x1967b5;if(_0x4f964b['query'][_0x6c31('0x5a')]){_0x21579c['include']=[{'all':!![]}];}return db['Disposition'][_0x6c31('0x5c')](_0x21579c);})[_0x6c31('0x2c')](function(_0x266a7f){_0x240ed9[_0x6c31('0x5d')]=_0x266a7f;return _0x240ed9;});}})[_0x6c31('0x2c')](respondWithFilteredResult(_0x3d781d,_0x21579c))[_0x6c31('0x21')](handleError(_0x3d781d,null));};exports[_0x6c31('0x6e')]=function(_0x1b428e,_0x1eacd6){return db['ChatWebsite'][_0x6c31('0x60')]({'where':{'id':_0x1b428e['params']['id']}})[_0x6c31('0x2c')](handleEntityNotFound(_0x1eacd6,null))[_0x6c31('0x2c')](function(_0x53ea18){if(_0x53ea18){return _0x53ea18[_0x6c31('0x6e')](_0x1b428e[_0x6c31('0x4c')][_0x6c31('0x6f')]);}})[_0x6c31('0x2c')](respondWithStatusCode(_0x1eacd6,null))['catch'](handleError(_0x1eacd6,null));};exports[_0x6c31('0x70')]=function(_0x5b4a7f,_0x426a7c){if(_0x5b4a7f[_0x6c31('0x62')]['id']){delete _0x5b4a7f[_0x6c31('0x62')]['id'];}return db[_0x6c31('0x48')]['find']({'where':{'id':_0x5b4a7f['params']['id']}})['then'](handleEntityNotFound(_0x426a7c,null))['then'](function(_0x48e4da){if(_0x48e4da){_0x5b4a7f['body']['ChatWebsiteId']=_0x48e4da['id'];return db[_0x6c31('0x71')]['create'](_0x5b4a7f['body']);}})[_0x6c31('0x2c')](respondWithResult(_0x426a7c,null))[_0x6c31('0x21')](handleError(_0x426a7c,null));};exports['getAnswers']=function(_0x5cbee2,_0x327b26){var _0x14a6b0={'raw':![],'where':{}};var _0x582285={};var _0x36aed9={'count':0x0,'rows':[]};return db[_0x6c31('0x48')][_0x6c31('0x72')]({'where':{'id':_0x5cbee2[_0x6c31('0x5f')]['id']}})[_0x6c31('0x2c')](handleEntityNotFound(_0x327b26,null))[_0x6c31('0x2c')](function(_0x579446){if(_0x579446){_0x582285[_0x6c31('0x42')]=_['keys'](db[_0x6c31('0x71')][_0x6c31('0x49')]);_0x582285[_0x6c31('0x4c')]=_[_0x6c31('0x4d')](_0x5cbee2[_0x6c31('0x4c')]);_0x582285[_0x6c31('0x4e')]=_[_0x6c31('0x4f')](_0x582285['model'],_0x582285[_0x6c31('0x4c')]);_0x14a6b0[_0x6c31('0x50')]=_[_0x6c31('0x4f')](_0x582285[_0x6c31('0x42')],qs[_0x6c31('0x51')](_0x5cbee2[_0x6c31('0x4c')][_0x6c31('0x51')]));_0x14a6b0[_0x6c31('0x50')]=_0x14a6b0['attributes'][_0x6c31('0x52')]?_0x14a6b0[_0x6c31('0x50')]:_0x582285['model'];if(!_0x5cbee2[_0x6c31('0x4c')][_0x6c31('0x53')]('nolimit')){_0x14a6b0[_0x6c31('0x27')]=qs[_0x6c31('0x27')](_0x5cbee2['query']['limit']);_0x14a6b0['offset']=qs[_0x6c31('0x25')](_0x5cbee2[_0x6c31('0x4c')][_0x6c31('0x25')]);}_0x14a6b0[_0x6c31('0x55')]=qs[_0x6c31('0x6c')](_0x5cbee2[_0x6c31('0x4c')]['sort']);_0x14a6b0['where']=qs[_0x6c31('0x4e')](_[_0x6c31('0x6d')](_0x5cbee2[_0x6c31('0x4c')],_0x582285[_0x6c31('0x4e')]));_0x14a6b0['where'][_0x6c31('0x69')]=_0x579446['id'];if(_0x5cbee2['query']['filter']){_0x14a6b0[_0x6c31('0x57')]=_[_0x6c31('0x58')](_0x14a6b0[_0x6c31('0x57')],{'$or':_[_0x6c31('0x4b')](_0x14a6b0[_0x6c31('0x50')],function(_0x546ce1){var _0x3020e8={};_0x3020e8[_0x546ce1]={'$like':'%'+_0x5cbee2[_0x6c31('0x4c')]['filter']+'%'};return _0x3020e8;})});}_0x14a6b0=_[_0x6c31('0x58')]({},_0x14a6b0,_0x5cbee2['options']);return db[_0x6c31('0x71')][_0x6c31('0x28')]({'where':_0x14a6b0[_0x6c31('0x57')]})[_0x6c31('0x2c')](function(_0x3451dd){_0x36aed9['count']=_0x3451dd;if(_0x5cbee2[_0x6c31('0x4c')]['includeAll']){_0x14a6b0['include']=[{'all':!![]}];}return db[_0x6c31('0x71')][_0x6c31('0x5c')](_0x14a6b0);})['then'](function(_0x5b3752){_0x36aed9[_0x6c31('0x5d')]=_0x5b3752;return _0x36aed9;});}})[_0x6c31('0x2c')](respondWithFilteredResult(_0x327b26,_0x14a6b0))[_0x6c31('0x21')](handleError(_0x327b26,null));};exports[_0x6c31('0x73')]=function(_0x4de75a,_0x4a54ff){return db[_0x6c31('0x48')][_0x6c31('0x60')]({'where':{'id':_0x4de75a['params']['id']}})[_0x6c31('0x2c')](handleEntityNotFound(_0x4a54ff,null))[_0x6c31('0x2c')](function(_0x2aa805){if(_0x2aa805){return _0x2aa805[_0x6c31('0x73')](_0x4de75a['query'][_0x6c31('0x6f')]);}})[_0x6c31('0x2c')](respondWithStatusCode(_0x4a54ff,null))[_0x6c31('0x21')](handleError(_0x4a54ff,null));};exports[_0x6c31('0x74')]=function(_0x5ca335,_0x413fa7){_0x5ca335['body']['sitepic']=_0x5ca335[_0x6c31('0x75')][_0x6c31('0x76')];return db[_0x6c31('0x48')]['find']({'where':{'id':_0x5ca335[_0x6c31('0x5f')]['id']}})[_0x6c31('0x2c')](handleEntityNotFound(_0x413fa7,null))['then'](saveUpdates(_0x5ca335[_0x6c31('0x62')],null))[_0x6c31('0x2c')](respondWithResult(_0x413fa7,null))[_0x6c31('0x21')](handleError(_0x413fa7,null));};exports[_0x6c31('0x77')]=function(_0xc1a6d2,_0x5ed7c5){_0xc1a6d2[_0x6c31('0x62')]['agentAvatar']=_0xc1a6d2[_0x6c31('0x75')][_0x6c31('0x76')];return db[_0x6c31('0x48')]['find']({'where':{'id':_0xc1a6d2[_0x6c31('0x5f')]['id']}})[_0x6c31('0x2c')](handleEntityNotFound(_0x5ed7c5,null))['then'](saveUpdates(_0xc1a6d2[_0x6c31('0x62')],null))[_0x6c31('0x2c')](respondWithResult(_0x5ed7c5,null))[_0x6c31('0x21')](handleError(_0x5ed7c5,null));};exports['addCustomerAvatar']=function(_0x572878,_0xa75ff6){_0x572878[_0x6c31('0x62')][_0x6c31('0x78')]=_0x572878[_0x6c31('0x75')][_0x6c31('0x76')];return db[_0x6c31('0x48')][_0x6c31('0x60')]({'where':{'id':_0x572878[_0x6c31('0x5f')]['id']}})['then'](handleEntityNotFound(_0xa75ff6,null))[_0x6c31('0x2c')](saveUpdates(_0x572878[_0x6c31('0x62')],null))[_0x6c31('0x2c')](respondWithResult(_0xa75ff6,null))['catch'](handleError(_0xa75ff6,null));};exports['addSystemAvatar']=function(_0x3be2cc,_0x598751){_0x3be2cc[_0x6c31('0x62')][_0x6c31('0x79')]=_0x3be2cc[_0x6c31('0x75')][_0x6c31('0x76')];return db[_0x6c31('0x48')][_0x6c31('0x60')]({'where':{'id':_0x3be2cc[_0x6c31('0x5f')]['id']}})['then'](handleEntityNotFound(_0x598751,null))[_0x6c31('0x2c')](saveUpdates(_0x3be2cc[_0x6c31('0x62')],null))[_0x6c31('0x2c')](respondWithResult(_0x598751,null))[_0x6c31('0x21')](handleError(_0x598751,null));};exports[_0x6c31('0x7a')]=function(_0x39498b,_0x319dea){var _0x2be541=path[_0x6c31('0x7b')](config[_0x6c31('0x7c')],'server/files/images/logos/default_logo.svg');var _0x12a95f={'where':{'id':_0x39498b[_0x6c31('0x5f')]['id']},'attributes':['id',_0x6c31('0x7d')],'raw':!![]};var _0x1af4ad=![];return require(_0x6c31('0x7e'))['getLicense']()[_0x6c31('0x2c')](function(_0x3e8d84){if(_0x3e8d84){_0x1af4ad=_0x3e8d84[_0x6c31('0x7f')];}})[_0x6c31('0x2c')](function(){return db['ChatWebsite'][_0x6c31('0x60')](_0x12a95f);})['then'](handleEntityNotFound(_0x319dea,null))['then'](function(_0x826eba){if(_0x826eba){if(!_['isNil'](_0x826eba[_0x6c31('0x7d')])){if(fs[_0x6c31('0x80')](path['join'](config['root'],_0x6c31('0x81'),_0x826eba[_0x6c31('0x7d')]))&&_0x1af4ad){_0x2be541=path[_0x6c31('0x7b')](config[_0x6c31('0x7c')],_0x6c31('0x81'),_0x826eba[_0x6c31('0x7d')]);}}return _0x319dea[_0x6c31('0x82')](_0x2be541);}})[_0x6c31('0x21')](handleError(_0x319dea,null));};exports[_0x6c31('0x83')]=function(_0x20865a,_0x40996d){var _0x15fe9c=path[_0x6c31('0x7b')](config[_0x6c31('0x7c')],_0x6c31('0x84'));var _0x1b6da6={'where':{'id':_0x20865a[_0x6c31('0x5f')]['id']},'attributes':['id',_0x6c31('0x85')],'raw':!![]};return db[_0x6c31('0x48')]['find'](_0x1b6da6)['then'](handleEntityNotFound(_0x40996d,null))[_0x6c31('0x2c')](function(_0x26e755){if(_0x26e755){if(!_[_0x6c31('0x86')](_0x26e755[_0x6c31('0x85')])){if(fs[_0x6c31('0x80')](path[_0x6c31('0x7b')](config[_0x6c31('0x7c')],'server/files/images/avatars/',_0x26e755[_0x6c31('0x85')]))){_0x15fe9c=path[_0x6c31('0x7b')](config[_0x6c31('0x7c')],_0x6c31('0x87'),_0x26e755['agentAvatar']);}}return _0x40996d['download'](_0x15fe9c);}})[_0x6c31('0x21')](handleError(_0x40996d,null));};exports[_0x6c31('0x88')]=function(_0x1f49f5,_0x1c4f45){var _0x77cc4d=path[_0x6c31('0x7b')](config[_0x6c31('0x7c')],_0x6c31('0x89'));var _0x1060ef={'where':{'id':_0x1f49f5[_0x6c31('0x5f')]['id']},'attributes':['id','customerAvatar',_0x6c31('0x8a')],'raw':!![]};return db[_0x6c31('0x48')][_0x6c31('0x60')](_0x1060ef)[_0x6c31('0x2c')](handleEntityNotFound(_0x1c4f45,null))[_0x6c31('0x2c')](function(_0x4ad8a0){if(_0x4ad8a0){if(!_[_0x6c31('0x86')](_0x4ad8a0[_0x6c31('0x78')])){if(fs[_0x6c31('0x80')](path[_0x6c31('0x7b')](config['root'],_0x6c31('0x87'),_0x4ad8a0[_0x6c31('0x78')]))&&_0x4ad8a0[_0x6c31('0x8a')]){_0x77cc4d=path[_0x6c31('0x7b')](config[_0x6c31('0x7c')],_0x6c31('0x87'),_0x4ad8a0[_0x6c31('0x78')]);}}return _0x1c4f45[_0x6c31('0x82')](_0x77cc4d);}})['catch'](handleError(_0x1c4f45,null));};exports['getSystemAvatar']=function(_0x2eb26d,_0x38adf9){var _0x3460d9=path[_0x6c31('0x7b')](config[_0x6c31('0x7c')],_0x6c31('0x8b'));var _0x34cee8={'where':{'id':_0x2eb26d['params']['id']},'attributes':['id',_0x6c31('0x79')],'raw':!![]};return db['ChatWebsite'][_0x6c31('0x60')](_0x34cee8)[_0x6c31('0x2c')](handleEntityNotFound(_0x38adf9,null))['then'](function(_0x3638a3){if(_0x3638a3){if(!_[_0x6c31('0x86')](_0x3638a3[_0x6c31('0x79')])){if(fs[_0x6c31('0x80')](path['join'](config[_0x6c31('0x7c')],_0x6c31('0x87'),_0x3638a3[_0x6c31('0x79')]))){_0x3460d9=path[_0x6c31('0x7b')](config[_0x6c31('0x7c')],'server/files/images/avatars/',_0x3638a3[_0x6c31('0x79')]);}}return _0x38adf9[_0x6c31('0x82')](_0x3460d9);}})[_0x6c31('0x21')](handleError(_0x38adf9,null));};exports[_0x6c31('0x8c')]=function(_0x1038eb,_0x28bdeb){var _0x5b6b8e={'body':_0x1038eb['body'],'channel':_0x6c31('0x8d')};var _0xbb281f=[];var _0x5a7624=[];var _0x41731e={};var _0x5085cb=![];if(_0x1038eb[_0x6c31('0x62')]['id']){delete _0x1038eb[_0x6c31('0x62')]['id'];}if(_[_0x6c31('0x86')](_0x1038eb['body'][_0x6c31('0x8e')])){throw new APIBadRequestError(_0x6c31('0x8f'));}if(_['isNil'](_0x1038eb[_0x6c31('0x62')][_0x6c31('0x90')])){throw new APIBadRequestError('MapKey\x20is\x20mandatory');}if(_['isEmpty'](_0x1038eb[_0x6c31('0x62')][_0x6c31('0x62')])){throw new APIBadRequestError(_0x6c31('0x91'));}return db[_0x6c31('0x92')][_0x6c31('0x68')]()[_0x6c31('0x2c')](function(_0xe74139){if(!_0xe74139){throw new Error('No\x20available\x20attributes');}_0xbb281f=Object[_0x6c31('0x4d')](_0xe74139)['filter'](function(_0x452cf6){return![_0x6c31('0x93'),_0x6c31('0x94')][_0x6c31('0x95')](_0x452cf6);});_0x5a7624=Object[_0x6c31('0x4d')](_0xe74139)[_0x6c31('0x56')](function(_0x7d4e7c){return![_0x6c31('0x93'),'updatedAt',_0x6c31('0x96'),_0x6c31('0x97')]['includes'](_0x7d4e7c);});if(!_[_0x6c31('0x95')](_0x5a7624,_0x1038eb[_0x6c31('0x62')][_0x6c31('0x90')])){throw new APIBadRequestError('Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20'+_0x5a7624[_0x6c31('0x7b')](',\x20'));}_0x41731e[_0x1038eb[_0x6c31('0x62')][_0x6c31('0x90')]]=_0x1038eb[_0x6c31('0x62')]['from'];})[_0x6c31('0x2c')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x1038eb['params']['id']},'include':[{'model':db[_0x6c31('0x98')],'as':_0x6c31('0x99'),'include':[{'model':db[_0x6c31('0x92')],'as':'Contacts','where':_0x41731e,'limit':0x1,'order':[[_0x6c31('0x94'),'DESC']]}]},{'model':db['ChatApplication'],'as':_0x6c31('0x9a')},{'model':db['Interval'],'as':_0x6c31('0x9b'),'include':[{'model':db['Interval'],'as':_0x6c31('0x9c'),'attributes':['id',_0x6c31('0x9d')],'raw':!![]}]}]});})[_0x6c31('0x2c')](function(_0x5ba6b2){if(!_0x5ba6b2){throw new APINotFoundError(util[_0x6c31('0x3e')](_0x6c31('0x9e'),_0x1038eb['params']['id']));}var _0x2ebe7d=_0x5ba6b2[_0x6c31('0x9b')];if(_0x2ebe7d){var _0x3a50ed=_0x5ba6b2[_0x6c31('0x9f')]||undefined;return _0x2ebe7d[_0x6c31('0xa0')](_0x3a50ed)[_0x6c31('0x2c')](function(_0x2200c3){if(!_0x2200c3){throw new APIOutOfIntervalError();}return _0x5ba6b2;});}else{return _0x5ba6b2;}})[_0x6c31('0x2c')](function(_0x22d5ff){if(!_0x22d5ff[_0x6c31('0x99')]){return;}_0x5b6b8e[_0x6c31('0xa1')]=_0x22d5ff;_0x5b6b8e[_0x6c31('0xa2')]=_0x22d5ff[_0x6c31('0x99')];_0x5b6b8e[_0x6c31('0xa3')]=_[_0x6c31('0xa4')](_0x22d5ff[_0x6c31('0x9a')],['priority'],[_0x6c31('0xa5')]);if(_0x5b6b8e[_0x6c31('0xa1')][_0x6c31('0x9a')]){delete _0x5b6b8e[_0x6c31('0xa1')][_0x6c31('0x9a')];}if(_0x5b6b8e['account']['List']&&_0x5b6b8e['account'][_0x6c31('0x99')][_0x6c31('0xa6')]['length']){return _0x5b6b8e['account'][_0x6c31('0x99')][_0x6c31('0xa6')][0x0];}var _0x1a53f5=_[_0x6c31('0x10')](_0x1038eb[_0x6c31('0x62')],{'firstName':_0x1038eb[_0x6c31('0x62')][_0x6c31('0x8e')],'ListId':_0x22d5ff['ListId']});_0x1a53f5[_0x1038eb[_0x6c31('0x62')][_0x6c31('0x90')]]=_0x1038eb[_0x6c31('0x62')][_0x6c31('0x8e')];return db[_0x6c31('0x92')][_0x6c31('0x61')](_0x1a53f5,{'fields':_0xbb281f,'raw':!![]});})[_0x6c31('0x2c')](function(_0xcd00a8){_0x5b6b8e[_0x6c31('0xa7')]=_0xcd00a8;var _0x16d7a7=createInteractionObject(_0x1038eb['params']['id'],_0x1038eb['body'],_0x1038eb[_0x6c31('0xa8')],_0xcd00a8);var _0x2448ee={'ChatWebsiteId':_0x1038eb[_0x6c31('0x5f')]['id']};if(_0x1038eb['body'][_0x6c31('0xa9')]){_0x2448ee[_0x6c31('0xa9')]=_0x1038eb['body'][_0x6c31('0xa9')];_0x2448ee['closed']=![];return db[_0x6c31('0xaa')][_0x6c31('0x60')]({'where':_0x2448ee})['then'](function(_0x56777f){var _0x2aba46=_0x1038eb[_0x6c31('0x62')][_0x6c31('0xab')]&&_0x1038eb[_0x6c31('0x62')][_0x6c31('0xac')];if(_0x56777f){_0x5085cb=!![];return _0x56777f;}else if(!_0x2aba46&&_0x56777f&&_0x56777f['closed']){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}_0x16d7a7['threadId']=_0x1038eb[_0x6c31('0x62')][_0x6c31('0xa9')];_0x16d7a7[_0x6c31('0xad')]=_0x1038eb[_0x6c31('0x62')][_0x6c31('0xad')];return db[_0x6c31('0xaa')][_0x6c31('0x61')](_0x16d7a7);});}_0x2448ee[_0x6c31('0xae')]=_0xcd00a8['id'];if(_0x1038eb[_0x6c31('0x62')]['interaction']&&_0x1038eb['body'][_0x6c31('0xaf')]['id']){_0x2448ee['id']=_0x1038eb[_0x6c31('0x62')][_0x6c31('0xaf')]['id'];return db['ChatInteraction'][_0x6c31('0x60')]({'where':_0x2448ee})[_0x6c31('0x2c')](function(_0x28928c){if(_0x28928c){_0x5085cb=!![];return _0x28928c;}return db[_0x6c31('0xaa')][_0x6c31('0x61')](_0x16d7a7);});}return db[_0x6c31('0xaa')][_0x6c31('0x61')](_0x16d7a7);})[_0x6c31('0x2c')](function(_0xeebfbb){if(!_0x5085cb){return _0xeebfbb;}var _0x2ea619={'from':(_0x5b6b8e[_0x6c31('0xa7')]['firstName']||'')+'\x20'+(_0x5b6b8e[_0x6c31('0xa7')]['lastName']||'')};if(_0x1038eb[_0x6c31('0x62')][_0x6c31('0xa9')]&&_0x1038eb[_0x6c31('0x62')]['messageId']&&_0x1038eb[_0x6c31('0x62')][_0x6c31('0xa9')]!=_0x1038eb['body'][_0x6c31('0xb0')]){_0x2ea619['threadId']=_0x1038eb[_0x6c31('0x62')][_0x6c31('0xb0')];}return _0xeebfbb['update'](_0x2ea619);})[_0x6c31('0x2c')](function(_0xeed903){_0x5b6b8e[_0x6c31('0xaf')]=_0xeed903[_0x6c31('0x2d')]({'plain':!![]});_0x5b6b8e[_0x6c31('0xaf')][_0x6c31('0xb1')]=!_0x5085cb;if(_0x5b6b8e[_0x6c31('0xaf')][_0x6c31('0xb1')]){if(_0x5b6b8e[_0x6c31('0xa1')][_0x6c31('0xb2')]){_0x5b6b8e['applications'][_0x6c31('0xb3')]({'id':0x0,'priority':_0x5b6b8e['applications']['length']+0x1,'app':_0x6c31('0xb4'),'appdata':_0x6c31('0xb5'),'interval':'*,*,*,*'});}}return db['ChatMessage']['create']({'body':_0x1038eb[_0x6c31('0x62')][_0x6c31('0x62')],'ChatWebsiteId':_0x1038eb[_0x6c31('0x5f')]['id'],'ChatInteractionId':_0xeed903['id'],'direction':'in','ContactId':_0x5b6b8e[_0x6c31('0xa7')]['id'],'AttachmentId':_0x1038eb[_0x6c31('0x62')][_0x6c31('0xb6')]});})[_0x6c31('0x2c')](function(_0x3beefd){_0x5b6b8e['message']=_0x3beefd;if(!_0x5b6b8e[_0x6c31('0xaf')][_0x6c31('0xb7')]){return;}return db[_0x6c31('0xb8')][_0x6c31('0x60')]({'attributes':['id',_0x6c31('0x32')],'where':{'id':_0x5b6b8e[_0x6c31('0xaf')][_0x6c31('0xb7')]}});})[_0x6c31('0x2c')](function(_0x1bbfd7){if(_0x1bbfd7){_0x5b6b8e[_0x6c31('0xa3')][_0x6c31('0xb9')]({'id':0x0,'priority':0x0,'app':_0x6c31('0xba'),'appdata':_0x1bbfd7[_0x6c31('0x32')]+','+(_0x5b6b8e['account'][_0x6c31('0xbb')]||0xa),'interval':_0x6c31('0xbc')});_0x5b6b8e[_0x6c31('0xbd')]=!![];}if(!_0x5b6b8e[_0x6c31('0xaf')][_0x6c31('0xbe')]){return;}return db[_0x6c31('0xbf')]['find']({'attributes':['id',_0x6c31('0x32')],'where':{'id':_0x5b6b8e['interaction'][_0x6c31('0xbe')]}});})['then'](function(_0x231814){if(_0x231814){_0x5b6b8e[_0x6c31('0xa3')]['unshift']({'id':0x0,'priority':0x1,'app':_0x6c31('0xc0'),'appdata':_0x231814['name']+','+(_0x5b6b8e[_0x6c31('0xa1')][_0x6c31('0xc1')]||0x12c),'interval':_0x6c31('0xbc')});}return respondWithRpcPromise('Start','startRouting',_0x5b6b8e);})[_0x6c31('0x2c')](function(_0x40cab2){respondWithRpcPromise(_0x6c31('0xc2'),_0x6c31('0xc2'),{'event':_0x6c31('0x8c'),'message':_0x40cab2},client9002);return _0x40cab2;})[_0x6c31('0x2c')](respondWithResult(_0x28bdeb,null))[_0x6c31('0x21')](APIHandleError(_0x28bdeb));};exports[_0x6c31('0xc3')]=function(_0x2350e2,_0x17e0c2){var _0x51ec04,_0x1dd008,_0x420c1a;var _0x2c43f2=[];var _0x246223={};var _0x27113d=_0x2350e2[_0x6c31('0xc4')]||[];var _0x429afa=[];var _0x76e5ff;return db[_0x6c31('0x92')][_0x6c31('0x68')]()['then'](function(_0x417d54){if(!_0x417d54){throw new db[(_0x6c31('0xc5'))][(_0x6c31('0xc6'))](_0x6c31('0xc7'));}_0x2c43f2=_[_0x6c31('0xc8')](_[_0x6c31('0x4d')](_0x417d54),[_0x6c31('0x93'),'updatedAt',_0x6c31('0x96'),_0x6c31('0x97')]);if(_0x2350e2[_0x6c31('0x62')]['id']){delete _0x2350e2[_0x6c31('0x62')]['id'];}if(_[_0x6c31('0x86')](_0x2350e2[_0x6c31('0x62')][_0x6c31('0x8e')])){throw _0x17e0c2[_0x6c31('0x22')](0x1f4)[_0x6c31('0x33')](new db['Sequelize'][(_0x6c31('0xc6'))](_0x6c31('0xc9')));}if(_[_0x6c31('0x86')](_0x2350e2[_0x6c31('0x62')]['body'])||_0x2350e2['body'][_0x6c31('0x62')]===''){throw _0x17e0c2[_0x6c31('0x22')](0x1f4)[_0x6c31('0x33')](new db[(_0x6c31('0xc5'))][(_0x6c31('0xc6'))](_0x6c31('0xca')));}if(_[_0x6c31('0x86')](_0x2350e2[_0x6c31('0x62')][_0x6c31('0xcb')])){throw _0x17e0c2[_0x6c31('0x22')](0x1f4)[_0x6c31('0x33')](new db[(_0x6c31('0xc5'))][(_0x6c31('0xc6'))](_0x6c31('0xcc')+_0x2c43f2));}if(!_[_0x6c31('0x95')](_0x2c43f2,_0x2350e2[_0x6c31('0x62')]['mapKeyOffline'])){throw _0x17e0c2[_0x6c31('0x22')](0x1f4)[_0x6c31('0x33')](new db[(_0x6c31('0xc5'))][(_0x6c31('0xc6'))](_0x6c31('0xcd')+_0x2c43f2));}_0x246223[_0x2350e2['body'][_0x6c31('0xcb')]]=_0x2350e2[_0x6c31('0x62')][_0x6c31('0x8e')];})['then'](function(){return db[_0x6c31('0x48')][_0x6c31('0x60')]({'where':{'id':_0x2350e2[_0x6c31('0x5f')]['id']},'include':[{'model':db[_0x6c31('0x98')],'as':_0x6c31('0x99')},{'model':db[_0x6c31('0xce')],'as':_0x6c31('0xce')}]});})[_0x6c31('0x2c')](handleEntityNotFound(_0x17e0c2,null))[_0x6c31('0x2c')](function(_0x26b8e5){if(_0x26b8e5&&_0x26b8e5[_0x6c31('0x99')]){_0x1dd008=_0x26b8e5;var _0x13e9b6=_[_0x6c31('0x10')](_0x2350e2[_0x6c31('0x62')],{'firstName':_0x2350e2[_0x6c31('0x62')][_0x6c31('0x8e')],'phone':_0x2350e2[_0x6c31('0x62')][_0x6c31('0x8e')],'ListId':_0x26b8e5['ListId']});_0x13e9b6[_0x2350e2[_0x6c31('0x62')][_0x6c31('0xcb')]]=_0x2350e2[_0x6c31('0x62')][_0x6c31('0x8e')];return db['CmContact'][_0x6c31('0xcf')]({'where':_0x246223,'defaults':_0x13e9b6});}})[_0x6c31('0xd0')](function(_0x1c6653){if(_0x1c6653){_0x420c1a=_0x1c6653;var _0x426030=fs['readFileSync'](path[_0x6c31('0x7b')](config[_0x6c31('0x7c')],_0x6c31('0xd1')),_0x6c31('0xd2'));var _0x806347=ejs[_0x6c31('0xd3')](_0x426030,{'body':_[_0x6c31('0xd4')](_0x2350e2['body'][_0x6c31('0x62')]),'bodyTitle':_0x1dd008[_0x6c31('0xd5')]});return db[_0x6c31('0xd6')]['create']({'body':_0x806347,'plainBody':htmlToText['fromString'](_0x806347),'ContactId':_0x1c6653['id'],'ChatWebsiteId':_0x1dd008['id']});}})[_0x6c31('0x2c')](function(_0x287776){_0x76e5ff=_0x287776;if(_0x27113d[_0x6c31('0x52')]){var _0x23b14e=_0x27113d[_0x6c31('0x4b')](function(_0x1bc964){return{'name':_0x1bc964[_0x6c31('0xd7')],'basename':_0x1bc964[_0x6c31('0x76')],'type':_0x1bc964[_0x6c31('0xd8')],'ChatOfflineMessageId':_0x287776['id']};});_0x429afa=_0x23b14e[_0x6c31('0x4b')](_0x37aa02=>{var _0x2ec966={'filename':_0x37aa02[_0x6c31('0x32')],'path':path[_0x6c31('0x7b')](config[_0x6c31('0x7c')],_0x6c31('0xd9'),_0x6c31('0xc4'),_0x6c31('0xda'),_0x6c31('0xdb'),_0x37aa02['basename'])};return _0x2ec966;});if(!_0x1dd008[_0x6c31('0xdc')]){return db[_0x6c31('0xdd')][_0x6c31('0xde')](function(_0x3b252d){return db[_0x6c31('0xdf')][_0x6c31('0xe0')](_0x23b14e,{'transaction':_0x3b252d});});}}})['then'](function(){if(_0x76e5ff){_0x51ec04=_0x76e5ff;return db[_0x6c31('0xce')][_0x6c31('0x72')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x6c31('0xe1'),'raw':!![],'include':[{'model':db[_0x6c31('0xe2')],'as':_0x6c31('0xe2'),'raw':!![]}]}]});}})[_0x6c31('0x2c')](function(_0x1b164b){if(_0x1b164b&&_0x1b164b[_0x6c31('0xe1')]&&_0x1dd008[_0x6c31('0xe3')]&&_0x1dd008['forwardOfflineAddress']){var _0x467a7e=_0x1b164b[_0x6c31('0xe4')]();return respondWithRpcPromise('SendMail',_0x6c31('0xe5'),{'account':_0x467a7e,'message':{'from':util[_0x6c31('0x3e')]('\x22%s\x22\x20<%s>',_0x1b164b[_0x6c31('0x32')],_0x1b164b['email']||_0x1b164b[_0x6c31('0xe1')][_0x6c31('0x63')]),'to':_0x1dd008['forwardOfflineAddress'],'subject':_0x1dd008['offlineMessageSubject'],'html':_0x51ec04[_0x6c31('0x62')],'attachments':_0x429afa}},client9003)[_0x6c31('0x2c')](function(){return _0x51ec04;})[_0x6c31('0x21')](function(_0x2db147){logger['error'](_0x2db147);});}})[_0x6c31('0x2c')](function(){if(_0x1dd008&&_0x1dd008[_0x6c31('0xdc')]&&_0x1dd008[_0x6c31('0xe6')]){var _0x237b14=[];if(_0x27113d[_0x6c31('0x52')]){_0x237b14=_0x27113d['map'](function(_0x330457){return{'name':_0x330457['originalname'],'basename':_0x330457[_0x6c31('0x76')],'type':_0x330457['mimetype'],'ChatOfflineMessageId':_0x76e5ff['id']};});}var _0x4c561f;if(!_[_0x6c31('0x86')](_0x1dd008['subjectOffline'])){var _0x36928a=_[_0x6c31('0x4b')](_0x2350e2[_0x6c31('0x62')],function(_0x46d09f){return _0x46d09f;});var _0x51745d=_[_0x6c31('0xe7')](_0x36928a)[0x0];var _0x58c059=_['mapValues'](_0x51745d,function(_0x35c849){return _0x35c849;});_0x4c561f=_0x58c059[0x1][_0x1dd008[_0x6c31('0xe8')]];}var _0x4b14f5={'from':_0x420c1a[_0x6c31('0xe9')],'firstName':_0x420c1a[_0x6c31('0x39')],'lastName':_0x420c1a[_0x6c31('0x3a')],'mapKey':_0x6c31('0xe9'),'message':{'from':_0x420c1a['email'],'to':_0x1dd008[_0x6c31('0xce')][_0x6c31('0xe9')],'cc':'','subject':_[_0x6c31('0x86')](_0x4c561f)?_0x1dd008[_0x6c31('0xea')]:_0x4c561f,'messageId':'','sentAt':new Date(),'attach':_0x237b14[_0x6c31('0x52')],'attachments':_0x237b14,'originChannel':_0x6c31('0xeb'),'ChatWebsiteId':_0x1dd008['id'],'ChatOfflineMessageId':_0x51ec04['id'],'originTo':_0x1dd008[_0x6c31('0xce')][_0x6c31('0xe9')]},'body':_0x51ec04[_0x6c31('0x62')]};var _0x3c5a3a={'account':{'id':_0x1dd008['MailAccountId']},'body':_0x4b14f5,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x6c31('0xec'),_0x6c31('0xed'),_0x3c5a3a,client9001)['then'](function(){return _0x51ec04;})['catch'](function(_0x4a3e46){logger[_0x6c31('0x1d')](_0x4a3e46);});}return;})[_0x6c31('0x2c')](function(){if(_0x51ec04){return _0x51ec04;}})[_0x6c31('0x2c')](respondWithResult(_0x17e0c2,null))[_0x6c31('0x21')](function(){for(var _0x4b7cc2 of _0x27113d){var _0x4692a2=path[_0x6c31('0x7b')](config['root'],_0x6c31('0xd9'),_0x6c31('0xc4'),_0x6c31('0xda'),'offline-chat',_0x4b7cc2[_0x6c31('0x76')]);fs_extra[_0x6c31('0xee')](_0x4692a2)[_0x6c31('0x21')](function(_0x20e53f){logger[_0x6c31('0x1d')](_0x6c31('0xef'),_0x4692a2,_0x20e53f);});}});};exports[_0x6c31('0xf0')]=function(_0x1773de,_0x156cb3){return db[_0x6c31('0xaa')][_0x6c31('0x60')]({'where':{'id':_0x1773de[_0x6c31('0x5f')]['id']}})[_0x6c31('0x2c')](handleEntityNotFound(_0x156cb3,null))[_0x6c31('0x2c')](function(_0x297832){if(_0x297832){return _0x297832[_0x6c31('0xf0')](_0x1773de[_0x6c31('0x62')]['ids'],_[_0x6c31('0xf1')](_0x1773de['body'],[_0x6c31('0x6f'),'id'])||{});}})[_0x6c31('0x2c')](respondWithResult(_0x156cb3,null))[_0x6c31('0x21')](handleError(_0x156cb3,null));};exports[_0x6c31('0xf2')]=function(_0x9b0a07,_0x3d0ccc){var _0x321967={'raw':![],'where':{}};var _0xb5d836={};var _0x48a80d={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x6c31('0x72')]({'where':{'id':_0x9b0a07[_0x6c31('0x5f')]['id']}})['then'](handleEntityNotFound(_0x3d0ccc,null))[_0x6c31('0x2c')](function(_0x29cd7b){if(_0x29cd7b){_0xb5d836['model']=_['keys'](db[_0x6c31('0xaa')][_0x6c31('0x49')]);_0xb5d836[_0x6c31('0x4c')]=_[_0x6c31('0x4d')](_0x9b0a07['query']);_0xb5d836[_0x6c31('0x4e')]=_[_0x6c31('0x4f')](_0xb5d836['model'],_0xb5d836[_0x6c31('0x4c')]);_0x321967[_0x6c31('0x50')]=_[_0x6c31('0x4f')](_0xb5d836[_0x6c31('0x42')],qs['fields'](_0x9b0a07[_0x6c31('0x4c')][_0x6c31('0x51')]));_0x321967[_0x6c31('0x50')]=_0x321967['attributes']['length']?_0x321967[_0x6c31('0x50')]:_0xb5d836[_0x6c31('0x42')];if(!_0x9b0a07[_0x6c31('0x4c')][_0x6c31('0x53')](_0x6c31('0x54'))){_0x321967[_0x6c31('0x27')]=qs[_0x6c31('0x27')](_0x9b0a07[_0x6c31('0x4c')][_0x6c31('0x27')]);_0x321967['offset']=qs[_0x6c31('0x25')](_0x9b0a07[_0x6c31('0x4c')]['offset']);}_0x321967['order']=qs[_0x6c31('0x6c')](_0x9b0a07[_0x6c31('0x4c')][_0x6c31('0x6c')]);_0x321967['where']=qs[_0x6c31('0x4e')](_[_0x6c31('0x6d')](_0x9b0a07[_0x6c31('0x4c')],_0xb5d836[_0x6c31('0x4e')]));_0x321967[_0x6c31('0x57')]['ChatWebsiteId']=_0x29cd7b['id'];if(_0x9b0a07[_0x6c31('0x4c')]['filter']){_0x321967[_0x6c31('0x57')]=_[_0x6c31('0x58')](_0x321967[_0x6c31('0x57')],{'$or':_[_0x6c31('0x4b')](_0x321967[_0x6c31('0x50')],function(_0x5b0b7c){var _0x593790={};_0x593790[_0x5b0b7c]={'$like':'%'+_0x9b0a07[_0x6c31('0x4c')][_0x6c31('0x56')]+'%'};return _0x593790;})});}_0x321967=_['merge']({},_0x321967,_0x9b0a07[_0x6c31('0x59')]);return db['ChatInteraction'][_0x6c31('0x28')]({'where':_0x321967[_0x6c31('0x57')]})['then'](function(_0x29a1fb){_0x48a80d[_0x6c31('0x28')]=_0x29a1fb;if(_0x9b0a07[_0x6c31('0x4c')][_0x6c31('0x5a')]){_0x321967[_0x6c31('0x5b')]=[{'model':db[_0x6c31('0x92')],'as':_0x6c31('0xf3'),'required':![]},{'model':db[_0x6c31('0xb8')],'as':'Owner','attributes':[_0x6c31('0x32'),'fullname',_0x6c31('0xf4')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id','name',_0x6c31('0xf5')],'where':_0x9b0a07[_0x6c31('0x4c')]['tag']?{'id':_0x9b0a07[_0x6c31('0x4c')][_0x6c31('0xf6')]}:undefined,'required':_0x9b0a07['query'][_0x6c31('0xf6')]?!![]:![]}];}return db[_0x6c31('0xaa')][_0x6c31('0x5c')](_0x321967);})[_0x6c31('0x2c')](function(_0x5310fe){_0x48a80d[_0x6c31('0x5d')]=_0x5310fe;return _0x48a80d;});}})[_0x6c31('0x2c')](respondWithFilteredResult(_0x3d0ccc,_0x321967))[_0x6c31('0x21')](handleError(_0x3d0ccc,null));};exports['getSnippet']=function(_0x5addf6,_0x46708b){var _0x1afd83=0x0;var _0xdc17f6=0x0;var _0x5103d9=![];var _0x647956;var _0x30f2ff;return db[_0x6c31('0x48')][_0x6c31('0x60')]({'where':{'id':_0x5addf6[_0x6c31('0x5f')]['id']},'include':[{'model':db[_0x6c31('0x9b')],'as':'Interval','include':[{'model':db['Interval'],'as':_0x6c31('0x9c'),'attributes':['id',_0x6c31('0x9d')]}]}]})[_0x6c31('0x2c')](handleEntityNotFound(_0x46708b,null))[_0x6c31('0x2c')](function(_0x34f841){if(_0x34f841){_0x647956=_0x34f841;return _0x34f841[_0x6c31('0xf7')]({'raw':!![]});}})[_0x6c31('0x2c')](function(_0x1a7843){if(_0x647956){if(_0x1a7843){_0x30f2ff=_0x1a7843;}}return require(_0x6c31('0x7e'))[_0x6c31('0xf8')]();})[_0x6c31('0x2c')](function(_0x318b22){if(_0x318b22){_0xdc17f6=_0x318b22[_0x6c31('0xf9')];_0x5103d9=_0x318b22[_0x6c31('0x7f')];}})[_0x6c31('0x2c')](function(){return db[_0x6c31('0xaa')][_0x6c31('0x28')]({'where':{'closed':![]}});})[_0x6c31('0x2c')](function(_0x244a86){_0x1afd83=_0x244a86;if(_0xdc17f6&&_0x244a86>_0xdc17f6){return db['License']['findOne']({'where':{'id':0x1}})['then'](function(_0xa89bcf){if(_0xa89bcf){_0xa89bcf['increment'](_0x6c31('0xfa'));}});}})[_0x6c31('0x2c')](function(){var _0x25389b=_0x647956[_0x6c31('0x9b')];var _0x5c0db0=_0x647956[_0x6c31('0x9f')]||undefined;return _0x25389b?_0x25389b['ifTime'](_0x5c0db0):!![];})[_0x6c31('0x2c')](function(_0xeaa392){var _0x2db671=fs['readFileSync'](path[_0x6c31('0x7b')](config[_0x6c31('0x7c')],_0x6c31('0xfb')),'utf8');var _0x116da9=new url['URL'](_0x647956[_0x6c31('0xfc')])[_0x6c31('0xfd')];var _0x16cda6=_0x6c31('0xfe');var _0x3bc024=![];var _0x2942bb={'chatVersion':_0x16cda6,'chatWebsiteAddressOrigin':_0x116da9,'remote':_0x647956[_0x6c31('0xff')],'query':querystring[_0x6c31('0x1c')](_['merge'](_0x647956['get']({'plain':!![]}),{'customerIp':_0x5addf6[_0x6c31('0xa8')][_0x6c31('0x37')]||_0x5addf6[_0x6c31('0xa8')][_0x6c31('0x100')]||_0x5addf6[_0x6c31('0x101')][_0x6c31('0x102')]||_0x5addf6['ip'],'referer':_0x5addf6[_0x6c31('0xa8')]['referer'],'openedInteractions':_0x1afd83,'maxInteractions':_0xdc17f6,'virtual':_0x5103d9[_0x6c31('0xf9')],'online':_0xeaa392,'custom':_0x5103d9}))['replace'](/'/g,'\x5c\x27')};_0x46708b[_0x6c31('0x33')](ejs[_0x6c31('0xd3')](Mustache[_0x6c31('0xd3')](_0x2db671,_0x2942bb),{'proactiveActions':_0x30f2ff,'alignment':_0x647956[_0x6c31('0x103')],'verticalAlignment':_0x647956['verticalAlignment'],'div_color':_0x647956[_0x6c31('0xf5')],'labelText':_0x647956[_0x6c31('0x104')],'text_color':_0x647956[_0x6c31('0x105')],'text_button_color':_0x647956[_0x6c31('0x106')],'button_color':_0x647956['color_button'],'background_color':_0x647956[_0x6c31('0x107')],'hideWhenOffline':_0x647956['hideWhenOffline'],'intervalId':_0x647956[_0x6c31('0x108')],'isDevelopment':_0x3bc024,'chatVersion':_0x16cda6}));})[_0x6c31('0x21')](handleError(_0x46708b,null));};exports['addApplications']=function(_0x327075,_0x406528){var _0x32bd72=_0x327075[_0x6c31('0x5f')]['id'];var _0x2e0571=_0x327075[_0x6c31('0x62')];var _0x4e6ad9=0xc8;var _0x330304=null;return db['sequelize'][_0x6c31('0xde')]({'isolationLevel':db[_0x6c31('0xdd')][_0x6c31('0x109')][_0x6c31('0x10a')][_0x6c31('0x10b')]},function(_0x500b63){return db[_0x6c31('0x48')][_0x6c31('0x72')]({'where':{'id':_0x32bd72},'transaction':_0x500b63})[_0x6c31('0x2c')](function(_0x33fefa){if(_0x33fefa){return db[_0x6c31('0x10c')][_0x6c31('0x2b')]({'where':{'ChatWebsiteId':_0x32bd72},'transaction':_0x500b63})[_0x6c31('0x2c')](function(){var _0x1f83f7=_[_0x6c31('0x4b')](_0x2e0571,function(_0x56b63e){_0x56b63e[_0x6c31('0x69')]=_0x32bd72;return _0x56b63e;});return db['ChatApplication'][_0x6c31('0xe0')](_0x1f83f7,{'transaction':_0x500b63});});}else{_0x4e6ad9=0x194;_0x330304=[];}});})[_0x6c31('0x2c')](function(){if(_0x4e6ad9!==0x194){return db[_0x6c31('0x10c')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x32bd72},'order':_0x6c31('0x10d')})['then'](function(_0x3543ba){_0x330304=_0x3543ba;});}})[_0x6c31('0x21')](function(_0x10d509){_0x4e6ad9=0x1f4;logger[_0x6c31('0x1d')](_0x10d509['stack']);if(_0x10d509['name']){delete _0x10d509[_0x6c31('0x32')];}_0x330304=_0x10d509;})[_0x6c31('0x10e')](function(){if(_0x330304===null){_0x406528['sendStatus'](_0x4e6ad9);}else{if(_0x4e6ad9===0x1f4){_0x406528[_0x6c31('0x22')](_0x4e6ad9)[_0x6c31('0x33')](_0x330304);}else{_0x406528[_0x6c31('0x22')](_0x4e6ad9)['json'](_0x330304);}}});};exports[_0x6c31('0x10f')]=function(_0x1539de,_0xa5c55e){var _0x434896={};var _0x18fff7={};var _0x17102a;var _0x3b0a4d;return db[_0x6c31('0x48')][_0x6c31('0x72')]({'where':{'id':_0x1539de[_0x6c31('0x5f')]['id']}})[_0x6c31('0x2c')](handleEntityNotFound(_0xa5c55e,null))['then'](function(_0x43a2cf){if(_0x43a2cf){_0x17102a=_0x43a2cf;_0x18fff7[_0x6c31('0x42')]=_[_0x6c31('0x4d')](db[_0x6c31('0x10c')][_0x6c31('0x49')]);_0x18fff7[_0x6c31('0x4c')]=_[_0x6c31('0x4d')](_0x1539de[_0x6c31('0x4c')]);_0x18fff7['filters']=_[_0x6c31('0x4f')](_0x18fff7[_0x6c31('0x42')],_0x18fff7[_0x6c31('0x4c')]);_0x434896[_0x6c31('0x50')]=_[_0x6c31('0x4f')](_0x18fff7[_0x6c31('0x42')],qs[_0x6c31('0x51')](_0x1539de[_0x6c31('0x4c')][_0x6c31('0x51')]));_0x434896[_0x6c31('0x50')]=_0x434896['attributes'][_0x6c31('0x52')]?_0x434896[_0x6c31('0x50')]:_0x18fff7[_0x6c31('0x42')];_0x434896[_0x6c31('0x55')]=qs[_0x6c31('0x6c')](_0x1539de['query'][_0x6c31('0x6c')]);_0x434896['where']=qs['filters'](_[_0x6c31('0x6d')](_0x1539de[_0x6c31('0x4c')],_0x18fff7[_0x6c31('0x4e')]));if(_0x1539de[_0x6c31('0x4c')][_0x6c31('0x56')]){_0x434896[_0x6c31('0x57')]=_[_0x6c31('0x58')](_0x434896['where'],{'$or':_[_0x6c31('0x4b')](_0x434896[_0x6c31('0x50')],function(_0x3fa4f2){var _0x3f0fa8={};_0x3f0fa8[_0x3fa4f2]={'$like':'%'+_0x1539de['query'][_0x6c31('0x56')]+'%'};return _0x3f0fa8;})});}_0x434896=_[_0x6c31('0x58')]({},_0x434896,_0x1539de[_0x6c31('0x59')]);return _0x17102a[_0x6c31('0x10f')](_0x434896);}})[_0x6c31('0x2c')](function(_0xc77f76){if(_0xc77f76){_0x3b0a4d=_0xc77f76[_0x6c31('0x52')];if(!_0x1539de['query'][_0x6c31('0x53')](_0x6c31('0x54'))){_0x434896[_0x6c31('0x27')]=qs[_0x6c31('0x27')](_0x1539de[_0x6c31('0x4c')][_0x6c31('0x27')]);_0x434896[_0x6c31('0x25')]=qs[_0x6c31('0x25')](_0x1539de['query'][_0x6c31('0x25')]);}return _0x17102a[_0x6c31('0x10f')](_0x434896);}})['then'](function(_0x278fdd){if(_0x278fdd){return _0x278fdd?{'count':_0x3b0a4d,'rows':_0x278fdd}:null;}})[_0x6c31('0x2c')](respondWithResult(_0xa5c55e,null))[_0x6c31('0x21')](handleError(_0xa5c55e,null));};exports[_0x6c31('0x110')]=function(_0x55a738,_0x2ba1d7){return db[_0x6c31('0x111')]['find']({'where':{'id':_0x55a738[_0x6c31('0x5f')]['id']}})[_0x6c31('0x2c')](handleEntityNotFound(_0x2ba1d7,null))['then'](function(_0x31ebe4){if(_0x31ebe4){return _0x31ebe4[_0x6c31('0x110')](_0x55a738[_0x6c31('0x62')][_0x6c31('0x6f')],_[_0x6c31('0xf1')](_0x55a738[_0x6c31('0x62')],[_0x6c31('0x6f'),'id'])||{});}})[_0x6c31('0x2c')](respondWithResult(_0x2ba1d7,null))[_0x6c31('0x21')](handleError(_0x2ba1d7,null));};exports[_0x6c31('0xf7')]=function(_0x39c210,_0x33cbff){var _0x564245={};var _0x3ca014={};var _0x7de392;var _0x1071ed;return db[_0x6c31('0x48')][_0x6c31('0x72')]({'where':{'id':_0x39c210[_0x6c31('0x5f')]['id']}})[_0x6c31('0x2c')](handleEntityNotFound(_0x33cbff,null))['then'](function(_0x35823c){if(_0x35823c){_0x7de392=_0x35823c;_0x3ca014['model']=_[_0x6c31('0x4d')](db['ChatProactiveAction'][_0x6c31('0x49')]);_0x3ca014['query']=_['keys'](_0x39c210[_0x6c31('0x4c')]);_0x3ca014['filters']=_[_0x6c31('0x4f')](_0x3ca014[_0x6c31('0x42')],_0x3ca014[_0x6c31('0x4c')]);_0x564245[_0x6c31('0x50')]=_[_0x6c31('0x4f')](_0x3ca014[_0x6c31('0x42')],qs['fields'](_0x39c210[_0x6c31('0x4c')][_0x6c31('0x51')]));_0x564245['attributes']=_0x564245['attributes'][_0x6c31('0x52')]?_0x564245[_0x6c31('0x50')]:_0x3ca014['model'];_0x564245[_0x6c31('0x55')]=qs[_0x6c31('0x6c')](_0x39c210['query']['sort']);_0x564245['where']=qs[_0x6c31('0x4e')](_['pick'](_0x39c210[_0x6c31('0x4c')],_0x3ca014[_0x6c31('0x4e')]));if(_0x39c210[_0x6c31('0x4c')][_0x6c31('0x56')]){_0x564245['where']=_[_0x6c31('0x58')](_0x564245['where'],{'$or':_[_0x6c31('0x4b')](_0x564245[_0x6c31('0x50')],function(_0x42315d){var _0x45bb20={};_0x45bb20[_0x42315d]={'$like':'%'+_0x39c210['query']['filter']+'%'};return _0x45bb20;})});}_0x564245=_['merge']({},_0x564245,_0x39c210[_0x6c31('0x59')]);return _0x7de392['getProactiveActions'](_0x564245);}})[_0x6c31('0x2c')](function(_0x19952c){if(_0x19952c){_0x1071ed=_0x19952c[_0x6c31('0x52')];if(!_0x39c210[_0x6c31('0x4c')][_0x6c31('0x53')](_0x6c31('0x54'))){_0x564245[_0x6c31('0x27')]=qs[_0x6c31('0x27')](_0x39c210[_0x6c31('0x4c')][_0x6c31('0x27')]);_0x564245[_0x6c31('0x25')]=qs[_0x6c31('0x25')](_0x39c210[_0x6c31('0x4c')]['offset']);}return _0x7de392['getProactiveActions'](_0x564245);}})[_0x6c31('0x2c')](function(_0xf45051){if(_0xf45051){return _0xf45051?{'count':_0x1071ed,'rows':_0xf45051}:null;}})[_0x6c31('0x2c')](respondWithResult(_0x33cbff,null))[_0x6c31('0x21')](handleError(_0x33cbff,null));};exports[_0x6c31('0x112')]=function(_0x5fc9c9,_0x4ed8ff){var _0x5deb7e=_0x5fc9c9[_0x6c31('0x4c')][_0x6c31('0x113')]===_0x6c31('0x114')?_0x6c31('0x115'):_0x6c31('0x116');return db[_0x6c31('0x48')][_0x6c31('0x60')]({'attributes':['id',_0x5deb7e],'where':{'id':_0x5fc9c9['params']['id']}})[_0x6c31('0x2c')](handleEntityNotFound(_0x4ed8ff,null))[_0x6c31('0x2c')](function(_0x24478c){if(_0x24478c){var _0x3d75d1=_0x24478c[_0x5deb7e];var _0x3b7915=_0x3d75d1&&_0x3d75d1[_0x6c31('0x117')]?_0x3d75d1[_0x6c31('0x117')]:[];_0x4ed8ff[_0x6c31('0x33')]({'fromKey':_['isNil'](_0x3d75d1[_0x6c31('0x118')])?undefined:_0x3d75d1[_0x6c31('0x118')],'count':_0x3b7915[_0x6c31('0x52')],'rows':_0x3b7915});}})[_0x6c31('0x21')](handleError(_0x4ed8ff,null));};exports['getOfflineMessages']=function(_0x222650,_0x58a872){var _0xf3a787={'raw':![],'where':{}};var _0x2c31c4={};var _0x76ec0d={'count':0x0,'rows':[]};return db[_0x6c31('0x48')][_0x6c31('0x72')]({'where':{'id':_0x222650[_0x6c31('0x5f')]['id']}})[_0x6c31('0x2c')](handleEntityNotFound(_0x58a872,null))[_0x6c31('0x2c')](function(_0x4fc062){if(_0x4fc062){_0x2c31c4[_0x6c31('0x42')]=_['keys'](db[_0x6c31('0xd6')]['rawAttributes']);_0x2c31c4[_0x6c31('0x4c')]=_['keys'](_0x222650['query']);_0x2c31c4['filters']=_[_0x6c31('0x4f')](_0x2c31c4[_0x6c31('0x42')],_0x2c31c4[_0x6c31('0x4c')]);_0xf3a787['attributes']=_[_0x6c31('0x4f')](_0x2c31c4['model'],qs[_0x6c31('0x51')](_0x222650[_0x6c31('0x4c')][_0x6c31('0x51')]));_0xf3a787[_0x6c31('0x50')]=_0xf3a787[_0x6c31('0x50')][_0x6c31('0x52')]?_0xf3a787['attributes']:_0x2c31c4[_0x6c31('0x42')];if(!_0x222650[_0x6c31('0x4c')][_0x6c31('0x53')](_0x6c31('0x54'))){_0xf3a787['limit']=qs[_0x6c31('0x27')](_0x222650['query'][_0x6c31('0x27')]);_0xf3a787[_0x6c31('0x25')]=qs[_0x6c31('0x25')](_0x222650[_0x6c31('0x4c')]['offset']);}_0xf3a787[_0x6c31('0x55')]=qs[_0x6c31('0x6c')](_0x222650[_0x6c31('0x4c')]['sort']);_0xf3a787[_0x6c31('0x57')]=qs[_0x6c31('0x4e')](_[_0x6c31('0x6d')](_0x222650[_0x6c31('0x4c')],_0x2c31c4[_0x6c31('0x4e')]));_0xf3a787[_0x6c31('0x57')]['ChatWebsiteId']=_0x4fc062['id'];if(_0x222650[_0x6c31('0x4c')][_0x6c31('0x56')]){_0xf3a787[_0x6c31('0x57')]=_[_0x6c31('0x58')](_0xf3a787[_0x6c31('0x57')],{'$or':_[_0x6c31('0x4b')](_0xf3a787[_0x6c31('0x50')],function(_0x3d0778){var _0x52c83e={};_0x52c83e[_0x3d0778]={'$like':'%'+_0x222650['query'][_0x6c31('0x56')]+'%'};return _0x52c83e;})});}_0xf3a787=_[_0x6c31('0x58')]({},_0xf3a787,_0x222650[_0x6c31('0x59')]);return db[_0x6c31('0xd6')][_0x6c31('0x28')]({'where':_0xf3a787['where']})[_0x6c31('0x2c')](function(_0x3e6cd5){_0x76ec0d['count']=_0x3e6cd5;if(_0x222650[_0x6c31('0x4c')][_0x6c31('0x5a')]){_0xf3a787[_0x6c31('0x5b')]=[{'all':!![]}];}else{_0xf3a787['include']=[{'model':db['CmContact'],'as':_0x6c31('0xf3'),'required':![]},{'model':db[_0x6c31('0xdf')],'as':_0x6c31('0x119'),'required':![]}];}return db[_0x6c31('0xd6')][_0x6c31('0x5c')](_0xf3a787);})[_0x6c31('0x2c')](function(_0x4e1c23){_0x76ec0d[_0x6c31('0x5d')]=_0x4e1c23;return _0x76ec0d;});}})[_0x6c31('0x2c')](respondWithFilteredResult(_0x58a872,_0xf3a787))[_0x6c31('0x21')](handleError(_0x58a872,null));};exports[_0x6c31('0x11a')]=function(_0x5ef126,_0x43c3dc){return db[_0x6c31('0x48')]['find']({'where':{'id':_0x5ef126[_0x6c31('0x5f')]['id']}})['then'](handleEntityNotFound(_0x43c3dc,null))[_0x6c31('0x2c')](function(_0x4bc966){if(_0x4bc966){return _0x4bc966[_0x6c31('0x11a')](_0x5ef126[_0x6c31('0x62')][_0x6c31('0x6f')],_[_0x6c31('0xf1')](_0x5ef126[_0x6c31('0x62')],['ids','id'])||{})[_0x6c31('0xd0')](function(_0x55a03f){for(var _0x119885=0x0;_0x119885<_0x5ef126[_0x6c31('0x62')][_0x6c31('0x6f')][_0x6c31('0x52')];_0x119885+=0x1){socket['emit'](_0x6c31('0x11b'),{'UserId':Number(_0x5ef126[_0x6c31('0x62')][_0x6c31('0x6f')][_0x119885]),'ChatWebsiteId':Number(_0x5ef126[_0x6c31('0x5f')]['id'])});}return _0x55a03f;});}})[_0x6c31('0x2c')](respondWithResult(_0x43c3dc,null))[_0x6c31('0x21')](handleError(_0x43c3dc,null));};exports['removeAgents']=function(_0x3e4e69,_0x481606){return db[_0x6c31('0x48')]['find']({'where':{'id':_0x3e4e69[_0x6c31('0x5f')]['id']}})[_0x6c31('0x2c')](handleEntityNotFound(_0x481606,null))[_0x6c31('0x2c')](function(_0x4807db){if(_0x4807db){return _0x4807db['removeAgents'](_0x3e4e69[_0x6c31('0x4c')]['ids'])['then'](function(){if(_['isArray'](_0x3e4e69[_0x6c31('0x4c')][_0x6c31('0x6f')])){for(var _0x124bbc=0x0;_0x124bbc<_0x3e4e69[_0x6c31('0x4c')][_0x6c31('0x6f')][_0x6c31('0x52')];_0x124bbc+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x3e4e69[_0x6c31('0x4c')][_0x6c31('0x6f')][_0x124bbc]),'ChatWebsiteId':Number(_0x3e4e69[_0x6c31('0x5f')]['id'])});}}else{socket[_0x6c31('0x11c')]('userChatWebsite:remove',{'UserId':Number(_0x3e4e69[_0x6c31('0x4c')][_0x6c31('0x6f')]),'ChatWebsiteId':Number(_0x3e4e69[_0x6c31('0x5f')]['id'])});}});}})[_0x6c31('0x2c')](respondWithStatusCode(_0x481606,null))[_0x6c31('0x21')](handleError(_0x481606,null));};exports[_0x6c31('0x11d')]=function(_0x40a492,_0x1726ab){var _0xd9d728={};var _0x5b4206={};var _0x22a9d4;var _0x2c35a6;return db[_0x6c31('0x48')][_0x6c31('0x72')]({'where':{'id':_0x40a492[_0x6c31('0x5f')]['id']}})[_0x6c31('0x2c')](handleEntityNotFound(_0x1726ab,null))[_0x6c31('0x2c')](function(_0x485fc1){if(_0x485fc1){_0x22a9d4=_0x485fc1;_0x5b4206[_0x6c31('0x42')]=_[_0x6c31('0x4d')](db[_0x6c31('0xb8')][_0x6c31('0x49')]);_0x5b4206[_0x6c31('0x4c')]=_[_0x6c31('0x4d')](_0x40a492[_0x6c31('0x4c')]);_0x5b4206[_0x6c31('0x4e')]=_[_0x6c31('0x4f')](_0x5b4206[_0x6c31('0x42')],_0x5b4206[_0x6c31('0x4c')]);_0xd9d728[_0x6c31('0x50')]=_[_0x6c31('0x4f')](_0x5b4206[_0x6c31('0x42')],qs['fields'](_0x40a492[_0x6c31('0x4c')][_0x6c31('0x51')]));_0xd9d728[_0x6c31('0x50')]=_0xd9d728[_0x6c31('0x50')][_0x6c31('0x52')]?_0xd9d728[_0x6c31('0x50')]:_0x5b4206['model'];_0xd9d728['order']=qs[_0x6c31('0x6c')](_0x40a492['query'][_0x6c31('0x6c')]);_0xd9d728[_0x6c31('0x57')]=qs[_0x6c31('0x4e')](_[_0x6c31('0x6d')](_0x40a492[_0x6c31('0x4c')],_0x5b4206[_0x6c31('0x4e')]));if(_0x40a492[_0x6c31('0x4c')][_0x6c31('0x56')]){_0xd9d728[_0x6c31('0x57')]=_['merge'](_0xd9d728['where'],{'$or':_[_0x6c31('0x4b')](_0xd9d728[_0x6c31('0x50')],function(_0x979368){var _0x4e6020={};_0x4e6020[_0x979368]={'$like':'%'+_0x40a492[_0x6c31('0x4c')][_0x6c31('0x56')]+'%'};return _0x4e6020;})});}_0xd9d728=_[_0x6c31('0x58')]({},_0xd9d728,_0x40a492['options']);return _0x22a9d4[_0x6c31('0x11d')](_0xd9d728);}})[_0x6c31('0x2c')](function(_0x4274d8){if(_0x4274d8){_0x2c35a6=_0x4274d8['length'];if(!_0x40a492['query'][_0x6c31('0x53')](_0x6c31('0x54'))){_0xd9d728[_0x6c31('0x27')]=qs[_0x6c31('0x27')](_0x40a492[_0x6c31('0x4c')][_0x6c31('0x27')]);_0xd9d728[_0x6c31('0x25')]=qs[_0x6c31('0x25')](_0x40a492[_0x6c31('0x4c')][_0x6c31('0x25')]);}return _0x22a9d4[_0x6c31('0x11d')](_0xd9d728);}})['then'](function(_0x223f39){if(_0x223f39){return _0x223f39?{'count':_0x2c35a6,'rows':_0x223f39}:null;}})[_0x6c31('0x2c')](respondWithResult(_0x1726ab,null))[_0x6c31('0x21')](handleError(_0x1726ab,null));}; \ No newline at end of file +var _0x19d4=['x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','labelText','textButtonColor','color_button','backgroundColor','hideWhenOffline','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','omit','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachment','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','User','mustache','util','ejs','fs-extra','lodash','querystring','html-to-text','ioredis','jayson/promise','url','../../components/parsers/qs','../../config/logger','../../config/environment','../../errors/api','APINotFoundError','APIConflictError','../../mysqldb','defaults','redis','socket.io-emitter','register','http','client','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','error','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','user-agent-parser','setUA','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','firstName','x-real-port','referer','browser','version','unknown','format','%s\x20%s','device','vendor','%s\x20%s\x20%s','type','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','ChatWebsiteId','Disposition','getDispositions','hasOwnProperty','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','rows','removeAnswers','addLogo','sitepic','file','filename','addCustomerAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','systemAvatar','notify','chat','From\x20is\x20mandatory','mapKey','MapKey\x20is\x20mandatory','isEmpty','Body\x20is\x20mandatory','CmContact','No\x20available\x20attributes','updatedAt','includes','createdAt','CompanyId','ListId','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','from','CmList','DESC','Applications','Interval','Intervals','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','timezone','ifTime','account','list','applications','orderBy','priority','List','Contacts','threadId','closed','ChatInteraction','Writing\x20on\x20closed\x20interaction','externalUrl','ContactId','interaction','contact','lastName','messageId','created','autoclose','push','unmanaged','*,*,*,*','ChatMessage','UserId','agent','waitForTheAssignedAgent','queueId','ChatQueue','unshift','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','files','Sequelize','ValidationError','difference','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','basename','sequelize','transaction','findOne','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','sendMail','email','offlineMessageSubject','openNewInteraction','MailAccountId','subjectOffline','toPairsIn','NotifyMailAccount','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','pick','Contact','Owner','Tag','Tags','color','tag','getSnippet','interval','getProactiveActions','virtual','increment','chatLicenseExceeded','server/files/chat/iframe.ejs','URL','address','origin','3.8.0','stringify','headers'];(function(_0x5a4913,_0xb31c08){var _0x175969=function(_0x3fd7fa){while(--_0x3fd7fa){_0x5a4913['push'](_0x5a4913['shift']());}};_0x175969(++_0xb31c08);}(_0x19d4,0x15c));var _0x419d=function(_0x25762b,_0x569eb1){_0x25762b=_0x25762b-0x0;var _0x46b313=_0x19d4[_0x25762b];return _0x46b313;};'use strict';var Mustache=require(_0x419d('0x0'));var util=require(_0x419d('0x1'));var path=require('path');var ejs=require(_0x419d('0x2'));var fs=require('fs');var fs_extra=require(_0x419d('0x3'));var _=require(_0x419d('0x4'));var querystring=require(_0x419d('0x5'));var htmlToText=require(_0x419d('0x6'));var Redis=require(_0x419d('0x7'));var jayson=require(_0x419d('0x8'));var url=require(_0x419d('0x9'));var qs=require(_0x419d('0xa'));var logger=require(_0x419d('0xb'))('api');var config=require(_0x419d('0xc'));var APIBadRequestError=require(_0x419d('0xd'))['APIBadRequestError'];var APINotFoundError=require('../../errors/api')[_0x419d('0xe')];var APIOutOfIntervalError=require(_0x419d('0xd'))['APIOutOfIntervalError'];var APIHandleError=require(_0x419d('0xd'))['handleError'];var APIConflictError=require(_0x419d('0xd'))[_0x419d('0xf')];var db=require(_0x419d('0x10'))['db'];config['redis']=_[_0x419d('0x11')](config[_0x419d('0x12')],{'host':'localhost','port':0x18eb});var socket=require(_0x419d('0x13'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0x419d('0x14')](socket);var client=jayson['client'][_0x419d('0x15')]({'port':0x232c});var client9002=jayson[_0x419d('0x16')][_0x419d('0x15')]({'port':0x232a});var client9003=jayson[_0x419d('0x16')][_0x419d('0x15')]({'port':0x232b});var client9001=jayson[_0x419d('0x16')][_0x419d('0x15')]({'port':0x2329});function respondWithRpcPromise(_0xe03d75,_0x57bd04,_0x4be504,_0x426418){return new Promise(function(_0x10a7c7,_0x5355cc){var _0x2ab106=_0x426418||client;return _0x2ab106[_0x419d('0x17')](_0xe03d75,_0x4be504)[_0x419d('0x18')](function(_0x55faf9){logger[_0x419d('0x19')](_0x419d('0x1a'),_0x57bd04,_0x419d('0x1b'));logger[_0x419d('0x1c')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x57bd04,'request\x20sent',JSON['stringify'](_0x55faf9));if(_0x55faf9[_0x419d('0x1d')]){if(_0x55faf9['error']['code']===0x1f4){logger[_0x419d('0x1d')](_0x419d('0x1a'),_0x57bd04,_0x55faf9[_0x419d('0x1d')][_0x419d('0x1e')]);return _0x5355cc(_0x55faf9['error'][_0x419d('0x1e')]);}logger[_0x419d('0x1d')](_0x419d('0x1a'),_0x57bd04,_0x55faf9[_0x419d('0x1d')]['message']);return _0x10a7c7(_0x55faf9[_0x419d('0x1d')][_0x419d('0x1e')]);}else{logger[_0x419d('0x19')](_0x419d('0x1a'),_0x57bd04,'request\x20sent');_0x10a7c7(_0x55faf9[_0x419d('0x1f')]['message']);}})['catch'](function(_0x47a067){logger[_0x419d('0x1d')](_0x419d('0x1a'),_0x57bd04,_0x47a067);_0x5355cc(_0x47a067);});});}function respondWithStatusCode(_0x1348c2,_0x57f20d){_0x57f20d=_0x57f20d||0xcc;return function(_0x1e78e2){if(_0x1e78e2){return _0x1348c2[_0x419d('0x20')](_0x57f20d);}return _0x1348c2[_0x419d('0x21')](_0x57f20d)[_0x419d('0x22')]();};}function respondWithResult(_0x2b2e2f,_0x3600db){_0x3600db=_0x3600db||0xc8;return function(_0x3e8b3c){if(_0x3e8b3c){return _0x2b2e2f['status'](_0x3600db)[_0x419d('0x23')](_0x3e8b3c);}};}function respondWithFilteredResult(_0x2fdbe5,_0xae861a){return function(_0x23c7d4){if(_0x23c7d4){var _0x1b93e6=typeof _0xae861a[_0x419d('0x24')]===_0x419d('0x25')&&typeof _0xae861a[_0x419d('0x26')]===_0x419d('0x25');var _0x2183e9=_0x23c7d4[_0x419d('0x27')];var _0x47eebf=_0x1b93e6?0x0:_0xae861a[_0x419d('0x24')];var _0x285f74=_0x1b93e6?_0x23c7d4['count']:_0xae861a[_0x419d('0x24')]+_0xae861a[_0x419d('0x26')];var _0x269fb0;if(_0x285f74>=_0x2183e9){_0x285f74=_0x2183e9;_0x269fb0=0xc8;}else{_0x269fb0=0xce;}_0x2fdbe5[_0x419d('0x21')](_0x269fb0);return _0x2fdbe5[_0x419d('0x28')](_0x419d('0x29'),_0x47eebf+'-'+_0x285f74+'/'+_0x2183e9)[_0x419d('0x23')](_0x23c7d4);}return null;};}function saveUpdates(_0x36126a){return function(_0xce7fc7){if(_0xce7fc7){return _0xce7fc7['update'](_0x36126a)['then'](function(_0x32df03){return _0x32df03;});}return null;};}function removeEntity(_0x4effc1){return function(_0x14056a){if(_0x14056a){return _0x14056a[_0x419d('0x2a')]()[_0x419d('0x18')](function(){var _0x34af8f=_0x14056a[_0x419d('0x2b')]({'plain':!![]});var _0x2f5b32=_0x419d('0x2c');return db[_0x419d('0x2d')][_0x419d('0x2a')]({'where':{'type':_0x2f5b32,'resourceId':_0x34af8f['id']}})[_0x419d('0x18')](function(){return _0x14056a;});})[_0x419d('0x18')](function(){_0x4effc1['status'](0xcc)[_0x419d('0x22')]();});}};}function handleEntityNotFound(_0x3bbbb3){return function(_0x27ca8d){if(!_0x27ca8d){_0x3bbbb3['sendStatus'](0x194);}return _0x27ca8d;};}function handleError(_0x126061,_0x5541e2){_0x5541e2=_0x5541e2||0x1f4;return function(_0x47101a){logger[_0x419d('0x1d')](_0x47101a[_0x419d('0x2e')]);if(_0x47101a[_0x419d('0x2f')]){delete _0x47101a[_0x419d('0x2f')];}_0x126061[_0x419d('0x21')](_0x5541e2)[_0x419d('0x30')](_0x47101a);};}function createInteractionObject(_0xc70c2,_0x5db8d3,_0x5ad59f,_0x4d1fb5){var _0x4dede0=require(_0x419d('0x31'));var _0x55e0a2=new _0x4dede0();var _0x2c0329=_0x55e0a2[_0x419d('0x32')](_0x5ad59f['user-agent'])[_0x419d('0x33')]();var _0x2c9f4e=_0x5db8d3[_0x419d('0x34')];if(_0x5ad59f[_0x419d('0x35')]){_0x2c9f4e=_0x5ad59f['cf-connecting-ip'];}else if(_0x5ad59f[_0x419d('0x36')]){_0x2c9f4e=_[_0x419d('0x37')](_0x5ad59f[_0x419d('0x36')]['split'](','));}return{'ContactId':_0x4d1fb5['id'],'ChatWebsiteId':_0xc70c2,'from':(_0x4d1fb5[_0x419d('0x38')]||'')+'\x20'+(_0x4d1fb5['lastName']||''),'customerIp':_0x2c9f4e,'customerPort':_0x5ad59f[_0x419d('0x39')]?_0x5ad59f[_0x419d('0x39')]:null,'referer':_0x5db8d3[_0x419d('0x3a')],'browserName':_0x2c0329[_0x419d('0x3b')]['name']&&_0x2c0329[_0x419d('0x3b')][_0x419d('0x3c')]?util['format']('%s\x20%s',_0x2c0329['browser'][_0x419d('0x2f')],_0x2c0329[_0x419d('0x3b')][_0x419d('0x3c')]):_0x419d('0x3d'),'browserVersion':_0x2c0329[_0x419d('0x3b')][_0x419d('0x3c')]||'unknown','osName':util[_0x419d('0x3e')](_0x419d('0x3f'),_0x2c0329['os']['name'],_0x2c0329['os']['version']),'osVersion':_0x2c0329['os'][_0x419d('0x3c')],'deviceModel':_0x2c0329[_0x419d('0x40')]['model']&&_0x2c0329[_0x419d('0x40')][_0x419d('0x41')]?util[_0x419d('0x3e')](_0x419d('0x42'),_0x2c0329[_0x419d('0x40')]['model'],_0x2c0329[_0x419d('0x40')][_0x419d('0x41')],_0x2c0329[_0x419d('0x40')][_0x419d('0x43')]):null,'deviceVendor':_0x2c0329[_0x419d('0x40')][_0x419d('0x41')],'deviceType':_0x2c0329[_0x419d('0x40')][_0x419d('0x43')],'formData':JSON['stringify'](_0x5db8d3)};}exports[_0x419d('0x44')]=function(_0x3c48d0,_0xe324bf){var _0x2f8321={'include':[{'model':db[_0x419d('0x45')],'as':_0x419d('0x46')}]},_0x52b154={},_0x146eed={'count':0x0,'rows':[]};var _0x176d14=_[_0x419d('0x47')](db[_0x419d('0x48')][_0x419d('0x49')],function(_0x91facc){return{'name':_0x91facc[_0x419d('0x4a')],'type':_0x91facc[_0x419d('0x43')][_0x419d('0x4b')]};});_0x52b154['model']=_['map'](_0x176d14,'name');_0x52b154[_0x419d('0x4c')]=_[_0x419d('0x4d')](_0x3c48d0[_0x419d('0x4c')]);_0x52b154[_0x419d('0x4e')]=_[_0x419d('0x4f')](_0x52b154[_0x419d('0x50')],_0x52b154[_0x419d('0x4c')]);_0x2f8321[_0x419d('0x51')]=_['intersection'](_0x52b154[_0x419d('0x50')],qs['fields'](_0x3c48d0[_0x419d('0x4c')]['fields']));_0x2f8321[_0x419d('0x51')]=_0x2f8321[_0x419d('0x51')][_0x419d('0x52')]?_0x2f8321[_0x419d('0x51')]:_0x52b154[_0x419d('0x50')];if(!_0x3c48d0[_0x419d('0x4c')]['hasOwnProperty'](_0x419d('0x53'))){_0x2f8321[_0x419d('0x26')]=qs[_0x419d('0x26')](_0x3c48d0['query'][_0x419d('0x26')]);_0x2f8321['offset']=qs[_0x419d('0x24')](_0x3c48d0['query'][_0x419d('0x24')]);}_0x2f8321[_0x419d('0x54')]=qs[_0x419d('0x55')](_0x3c48d0['query']['sort']);_0x2f8321[_0x419d('0x56')]=qs[_0x419d('0x4e')](_['pick'](_0x3c48d0['query'],_0x52b154[_0x419d('0x4e')]),_0x176d14);if(_0x3c48d0[_0x419d('0x4c')][_0x419d('0x57')]){_0x2f8321[_0x419d('0x56')]=_[_0x419d('0x58')](_0x2f8321[_0x419d('0x56')],{'$or':_['map'](_0x176d14,function(_0x7d9f3a){if(_0x7d9f3a['type']!==_0x419d('0x59')){var _0x3c51a9={};_0x3c51a9[_0x7d9f3a[_0x419d('0x2f')]]={'$like':'%'+_0x3c48d0[_0x419d('0x4c')][_0x419d('0x57')]+'%'};return _0x3c51a9;}})});}_0x2f8321=_[_0x419d('0x58')]({},_0x2f8321,_0x3c48d0[_0x419d('0x5a')]);var _0x213ef0={'where':_0x2f8321['where']};return db['ChatWebsite'][_0x419d('0x27')](_0x213ef0)[_0x419d('0x18')](function(_0x2bf6cd){_0x146eed['count']=_0x2bf6cd;if(_0x3c48d0[_0x419d('0x4c')][_0x419d('0x5b')]){_0x2f8321[_0x419d('0x5c')]=[{'all':!![]}];}return db[_0x419d('0x48')][_0x419d('0x5d')](_0x2f8321);})['then'](function(_0xd38973){_0x146eed['rows']=_0xd38973;return _0x146eed;})[_0x419d('0x18')](respondWithFilteredResult(_0xe324bf,_0x2f8321))[_0x419d('0x5e')](handleError(_0xe324bf,null));};exports[_0x419d('0x5f')]=function(_0xea6301,_0x489958){var _0x23c79e={'raw':![],'where':{'id':_0xea6301[_0x419d('0x60')]['id']},'include':[{'model':db[_0x419d('0x45')],'as':_0x419d('0x46')}]},_0x4f5da3={};_0x4f5da3['model']=_[_0x419d('0x4d')](db['ChatWebsite'][_0x419d('0x49')]);_0x4f5da3[_0x419d('0x4c')]=_[_0x419d('0x4d')](_0xea6301[_0x419d('0x4c')]);_0x4f5da3[_0x419d('0x4e')]=_[_0x419d('0x4f')](_0x4f5da3[_0x419d('0x50')],_0x4f5da3[_0x419d('0x4c')]);_0x23c79e[_0x419d('0x51')]=_['intersection'](_0x4f5da3[_0x419d('0x50')],qs[_0x419d('0x61')](_0xea6301[_0x419d('0x4c')][_0x419d('0x61')]));_0x23c79e[_0x419d('0x51')]=_0x23c79e[_0x419d('0x51')][_0x419d('0x52')]?_0x23c79e['attributes']:_0x4f5da3[_0x419d('0x50')];if(_0xea6301[_0x419d('0x4c')][_0x419d('0x5b')]){_0x23c79e['include']=[{'all':!![]}];}_0x23c79e=_[_0x419d('0x58')]({},_0x23c79e,_0xea6301[_0x419d('0x5a')]);return db['ChatWebsite'][_0x419d('0x62')](_0x23c79e)[_0x419d('0x18')](handleEntityNotFound(_0x489958,null))['then'](respondWithResult(_0x489958,null))[_0x419d('0x5e')](handleError(_0x489958,null));};exports[_0x419d('0x63')]=function(_0x401743,_0x9a8757){return db['ChatWebsite']['create'](_0x401743[_0x419d('0x64')],{})[_0x419d('0x18')](function(_0x2ada6f){var _0x73494f=_0x401743[_0x419d('0x65')][_0x419d('0x2b')]({'plain':!![]});if(!_0x73494f)throw new Error(_0x419d('0x66'));if(_0x73494f[_0x419d('0x67')]==='user'){var _0x2d864b=_0x2ada6f[_0x419d('0x2b')]({'plain':!![]});var _0x32535d=_0x419d('0x2c');return db[_0x419d('0x68')]['find']({'where':{'name':_0x32535d,'userProfileId':_0x73494f[_0x419d('0x69')]},'raw':!![]})[_0x419d('0x18')](function(_0x4f7fb6){if(_0x4f7fb6&&_0x4f7fb6['autoAssociation']===0x0){return db[_0x419d('0x2d')][_0x419d('0x63')]({'name':_0x2d864b[_0x419d('0x2f')],'resourceId':_0x2d864b['id'],'type':_0x4f7fb6[_0x419d('0x2f')],'sectionId':_0x4f7fb6['id']},{})[_0x419d('0x18')](function(){return _0x2ada6f;});}else{return _0x2ada6f;}})['catch'](function(_0x2ee741){logger[_0x419d('0x1d')](_0x419d('0x6a'),_0x2ee741);throw _0x2ee741;});}return _0x2ada6f;})[_0x419d('0x18')](respondWithResult(_0x9a8757,0xc9))['catch'](handleError(_0x9a8757,null));};exports[_0x419d('0x6b')]=function(_0x4b2114,_0x4cd024){if(_0x4b2114[_0x419d('0x64')]['id']){delete _0x4b2114[_0x419d('0x64')]['id'];}return db[_0x419d('0x48')]['find']({'where':{'id':_0x4b2114['params']['id']},'include':[{'model':db[_0x419d('0x45')],'as':_0x419d('0x46')}]})['then'](handleEntityNotFound(_0x4cd024,null))[_0x419d('0x18')](saveUpdates(_0x4b2114[_0x419d('0x64')],null))[_0x419d('0x18')](respondWithResult(_0x4cd024,null))[_0x419d('0x5e')](handleError(_0x4cd024,null));};exports[_0x419d('0x2a')]=function(_0x23e252,_0x2fe3fa){return db[_0x419d('0x48')]['find']({'where':{'id':_0x23e252[_0x419d('0x60')]['id']}})['then'](handleEntityNotFound(_0x2fe3fa,null))[_0x419d('0x18')](removeEntity(_0x2fe3fa,null))['catch'](handleError(_0x2fe3fa,null));};exports['describe']=function(_0x1d7e95,_0x5423a3){return db[_0x419d('0x48')][_0x419d('0x6c')]()[_0x419d('0x18')](respondWithResult(_0x5423a3,null))[_0x419d('0x5e')](handleError(_0x5423a3,null));};exports['addDisposition']=function(_0x5d8020,_0x167625){if(_0x5d8020[_0x419d('0x64')]['id']){delete _0x5d8020['body']['id'];}return db['ChatWebsite'][_0x419d('0x62')]({'where':{'id':_0x5d8020['params']['id']}})['then'](handleEntityNotFound(_0x167625,null))[_0x419d('0x18')](function(_0x4f86b1){if(_0x4f86b1){_0x5d8020[_0x419d('0x64')][_0x419d('0x6d')]=_0x4f86b1['id'];return db[_0x419d('0x6e')][_0x419d('0x63')](_0x5d8020[_0x419d('0x64')]);}})[_0x419d('0x18')](respondWithResult(_0x167625,null))[_0x419d('0x5e')](handleError(_0x167625,null));};exports[_0x419d('0x6f')]=function(_0xb31ff8,_0x3d98d3){var _0x18487e={'raw':![],'where':{}};var _0x5e8232={};var _0x33bf3b={'count':0x0,'rows':[]};return db[_0x419d('0x48')]['findOne']({'where':{'id':_0xb31ff8[_0x419d('0x60')]['id']}})[_0x419d('0x18')](handleEntityNotFound(_0x3d98d3,null))['then'](function(_0x1c02b3){if(_0x1c02b3){_0x5e8232[_0x419d('0x50')]=_[_0x419d('0x4d')](db['Disposition'][_0x419d('0x49')]);_0x5e8232[_0x419d('0x4c')]=_[_0x419d('0x4d')](_0xb31ff8[_0x419d('0x4c')]);_0x5e8232[_0x419d('0x4e')]=_[_0x419d('0x4f')](_0x5e8232[_0x419d('0x50')],_0x5e8232[_0x419d('0x4c')]);_0x18487e[_0x419d('0x51')]=_[_0x419d('0x4f')](_0x5e8232[_0x419d('0x50')],qs[_0x419d('0x61')](_0xb31ff8['query'][_0x419d('0x61')]));_0x18487e['attributes']=_0x18487e[_0x419d('0x51')]['length']?_0x18487e[_0x419d('0x51')]:_0x5e8232[_0x419d('0x50')];if(!_0xb31ff8[_0x419d('0x4c')][_0x419d('0x70')](_0x419d('0x53'))){_0x18487e['limit']=qs[_0x419d('0x26')](_0xb31ff8['query'][_0x419d('0x26')]);_0x18487e['offset']=qs[_0x419d('0x24')](_0xb31ff8[_0x419d('0x4c')][_0x419d('0x24')]);}_0x18487e[_0x419d('0x54')]=qs[_0x419d('0x55')](_0xb31ff8[_0x419d('0x4c')][_0x419d('0x55')]);_0x18487e['where']=qs[_0x419d('0x4e')](_['pick'](_0xb31ff8[_0x419d('0x4c')],_0x5e8232[_0x419d('0x4e')]));_0x18487e[_0x419d('0x56')]['ChatWebsiteId']=_0x1c02b3['id'];if(_0xb31ff8['query'][_0x419d('0x57')]){_0x18487e['where']=_['merge'](_0x18487e[_0x419d('0x56')],{'$or':_[_0x419d('0x47')](_0x18487e[_0x419d('0x51')],function(_0x45ece7){var _0x1198d2={};_0x1198d2[_0x45ece7]={'$like':'%'+_0xb31ff8[_0x419d('0x4c')][_0x419d('0x57')]+'%'};return _0x1198d2;})});}_0x18487e=_[_0x419d('0x58')]({},_0x18487e,_0xb31ff8[_0x419d('0x5a')]);return db[_0x419d('0x6e')][_0x419d('0x27')]({'where':_0x18487e[_0x419d('0x56')]})['then'](function(_0x4d5d52){_0x33bf3b[_0x419d('0x27')]=_0x4d5d52;if(_0xb31ff8['query']['includeAll']){_0x18487e[_0x419d('0x5c')]=[{'all':!![]}];}return db[_0x419d('0x6e')][_0x419d('0x5d')](_0x18487e);})[_0x419d('0x18')](function(_0x41f739){_0x33bf3b['rows']=_0x41f739;return _0x33bf3b;});}})['then'](respondWithFilteredResult(_0x3d98d3,_0x18487e))[_0x419d('0x5e')](handleError(_0x3d98d3,null));};exports['removeDispositions']=function(_0x298773,_0x1955a3){return db[_0x419d('0x48')][_0x419d('0x62')]({'where':{'id':_0x298773['params']['id']}})[_0x419d('0x18')](handleEntityNotFound(_0x1955a3,null))[_0x419d('0x18')](function(_0x397000){if(_0x397000){return _0x397000[_0x419d('0x71')](_0x298773[_0x419d('0x4c')][_0x419d('0x72')]);}})[_0x419d('0x18')](respondWithStatusCode(_0x1955a3,null))[_0x419d('0x5e')](handleError(_0x1955a3,null));};exports[_0x419d('0x73')]=function(_0x42c142,_0x16b1cd){if(_0x42c142[_0x419d('0x64')]['id']){delete _0x42c142[_0x419d('0x64')]['id'];}return db[_0x419d('0x48')][_0x419d('0x62')]({'where':{'id':_0x42c142[_0x419d('0x60')]['id']}})[_0x419d('0x18')](handleEntityNotFound(_0x16b1cd,null))[_0x419d('0x18')](function(_0x47537c){if(_0x47537c){_0x42c142[_0x419d('0x64')]['ChatWebsiteId']=_0x47537c['id'];return db[_0x419d('0x74')][_0x419d('0x63')](_0x42c142[_0x419d('0x64')]);}})['then'](respondWithResult(_0x16b1cd,null))[_0x419d('0x5e')](handleError(_0x16b1cd,null));};exports[_0x419d('0x75')]=function(_0x5392ec,_0x31d613){var _0x44f9dd={'raw':![],'where':{}};var _0x3859de={};var _0x5a474f={'count':0x0,'rows':[]};return db[_0x419d('0x48')]['findOne']({'where':{'id':_0x5392ec[_0x419d('0x60')]['id']}})[_0x419d('0x18')](handleEntityNotFound(_0x31d613,null))['then'](function(_0x239b46){if(_0x239b46){_0x3859de[_0x419d('0x50')]=_[_0x419d('0x4d')](db[_0x419d('0x74')][_0x419d('0x49')]);_0x3859de[_0x419d('0x4c')]=_[_0x419d('0x4d')](_0x5392ec[_0x419d('0x4c')]);_0x3859de['filters']=_[_0x419d('0x4f')](_0x3859de[_0x419d('0x50')],_0x3859de[_0x419d('0x4c')]);_0x44f9dd[_0x419d('0x51')]=_['intersection'](_0x3859de['model'],qs['fields'](_0x5392ec[_0x419d('0x4c')][_0x419d('0x61')]));_0x44f9dd[_0x419d('0x51')]=_0x44f9dd[_0x419d('0x51')][_0x419d('0x52')]?_0x44f9dd['attributes']:_0x3859de['model'];if(!_0x5392ec[_0x419d('0x4c')][_0x419d('0x70')](_0x419d('0x53'))){_0x44f9dd[_0x419d('0x26')]=qs[_0x419d('0x26')](_0x5392ec[_0x419d('0x4c')][_0x419d('0x26')]);_0x44f9dd[_0x419d('0x24')]=qs[_0x419d('0x24')](_0x5392ec[_0x419d('0x4c')][_0x419d('0x24')]);}_0x44f9dd[_0x419d('0x54')]=qs[_0x419d('0x55')](_0x5392ec['query']['sort']);_0x44f9dd['where']=qs['filters'](_['pick'](_0x5392ec['query'],_0x3859de[_0x419d('0x4e')]));_0x44f9dd[_0x419d('0x56')][_0x419d('0x6d')]=_0x239b46['id'];if(_0x5392ec[_0x419d('0x4c')][_0x419d('0x57')]){_0x44f9dd['where']=_[_0x419d('0x58')](_0x44f9dd[_0x419d('0x56')],{'$or':_[_0x419d('0x47')](_0x44f9dd[_0x419d('0x51')],function(_0x19e5bf){var _0x321faa={};_0x321faa[_0x19e5bf]={'$like':'%'+_0x5392ec['query']['filter']+'%'};return _0x321faa;})});}_0x44f9dd=_[_0x419d('0x58')]({},_0x44f9dd,_0x5392ec[_0x419d('0x5a')]);return db[_0x419d('0x74')][_0x419d('0x27')]({'where':_0x44f9dd[_0x419d('0x56')]})[_0x419d('0x18')](function(_0x342b3c){_0x5a474f[_0x419d('0x27')]=_0x342b3c;if(_0x5392ec[_0x419d('0x4c')][_0x419d('0x5b')]){_0x44f9dd[_0x419d('0x5c')]=[{'all':!![]}];}return db[_0x419d('0x74')][_0x419d('0x5d')](_0x44f9dd);})[_0x419d('0x18')](function(_0x427330){_0x5a474f[_0x419d('0x76')]=_0x427330;return _0x5a474f;});}})[_0x419d('0x18')](respondWithFilteredResult(_0x31d613,_0x44f9dd))[_0x419d('0x5e')](handleError(_0x31d613,null));};exports['removeAnswers']=function(_0x193556,_0x34879b){return db[_0x419d('0x48')][_0x419d('0x62')]({'where':{'id':_0x193556[_0x419d('0x60')]['id']}})[_0x419d('0x18')](handleEntityNotFound(_0x34879b,null))[_0x419d('0x18')](function(_0x501add){if(_0x501add){return _0x501add[_0x419d('0x77')](_0x193556['query'][_0x419d('0x72')]);}})[_0x419d('0x18')](respondWithStatusCode(_0x34879b,null))[_0x419d('0x5e')](handleError(_0x34879b,null));};exports[_0x419d('0x78')]=function(_0x5a12fb,_0x47eff0){_0x5a12fb[_0x419d('0x64')][_0x419d('0x79')]=_0x5a12fb[_0x419d('0x7a')][_0x419d('0x7b')];return db[_0x419d('0x48')]['find']({'where':{'id':_0x5a12fb[_0x419d('0x60')]['id']}})['then'](handleEntityNotFound(_0x47eff0,null))['then'](saveUpdates(_0x5a12fb[_0x419d('0x64')],null))[_0x419d('0x18')](respondWithResult(_0x47eff0,null))[_0x419d('0x5e')](handleError(_0x47eff0,null));};exports['addAvatar']=function(_0x4a02e9,_0x17e0d3){_0x4a02e9[_0x419d('0x64')]['agentAvatar']=_0x4a02e9['file'][_0x419d('0x7b')];return db['ChatWebsite'][_0x419d('0x62')]({'where':{'id':_0x4a02e9['params']['id']}})[_0x419d('0x18')](handleEntityNotFound(_0x17e0d3,null))[_0x419d('0x18')](saveUpdates(_0x4a02e9[_0x419d('0x64')],null))[_0x419d('0x18')](respondWithResult(_0x17e0d3,null))[_0x419d('0x5e')](handleError(_0x17e0d3,null));};exports[_0x419d('0x7c')]=function(_0xcb656b,_0x58922c){_0xcb656b[_0x419d('0x64')]['customerAvatar']=_0xcb656b['file'][_0x419d('0x7b')];return db[_0x419d('0x48')][_0x419d('0x62')]({'where':{'id':_0xcb656b[_0x419d('0x60')]['id']}})[_0x419d('0x18')](handleEntityNotFound(_0x58922c,null))[_0x419d('0x18')](saveUpdates(_0xcb656b[_0x419d('0x64')],null))['then'](respondWithResult(_0x58922c,null))[_0x419d('0x5e')](handleError(_0x58922c,null));};exports['addSystemAvatar']=function(_0x1018f2,_0x5dbe3f){_0x1018f2[_0x419d('0x64')]['systemAvatar']=_0x1018f2[_0x419d('0x7a')][_0x419d('0x7b')];return db[_0x419d('0x48')]['find']({'where':{'id':_0x1018f2[_0x419d('0x60')]['id']}})[_0x419d('0x18')](handleEntityNotFound(_0x5dbe3f,null))[_0x419d('0x18')](saveUpdates(_0x1018f2[_0x419d('0x64')],null))[_0x419d('0x18')](respondWithResult(_0x5dbe3f,null))[_0x419d('0x5e')](handleError(_0x5dbe3f,null));};exports[_0x419d('0x7d')]=function(_0x1e350e,_0x22d15d){var _0x58587b=path[_0x419d('0x7e')](config[_0x419d('0x7f')],_0x419d('0x80'));var _0x9651b4={'where':{'id':_0x1e350e[_0x419d('0x60')]['id']},'attributes':['id',_0x419d('0x79')],'raw':!![]};var _0x2d1711=![];return require(_0x419d('0x81'))[_0x419d('0x82')]()[_0x419d('0x18')](function(_0x386b0c){if(_0x386b0c){_0x2d1711=_0x386b0c[_0x419d('0x83')];}})[_0x419d('0x18')](function(){return db['ChatWebsite'][_0x419d('0x62')](_0x9651b4);})[_0x419d('0x18')](handleEntityNotFound(_0x22d15d,null))[_0x419d('0x18')](function(_0x5bcd6){if(_0x5bcd6){if(!_[_0x419d('0x84')](_0x5bcd6[_0x419d('0x79')])){if(fs[_0x419d('0x85')](path['join'](config[_0x419d('0x7f')],'server/files/images/logos/',_0x5bcd6['sitepic']))&&_0x2d1711){_0x58587b=path[_0x419d('0x7e')](config[_0x419d('0x7f')],_0x419d('0x86'),_0x5bcd6[_0x419d('0x79')]);}}return _0x22d15d[_0x419d('0x87')](_0x58587b);}})[_0x419d('0x5e')](handleError(_0x22d15d,null));};exports[_0x419d('0x88')]=function(_0x5b4528,_0x425666){var _0x3c838b=path['join'](config[_0x419d('0x7f')],_0x419d('0x89'));var _0x58ecb4={'where':{'id':_0x5b4528['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x419d('0x48')]['find'](_0x58ecb4)[_0x419d('0x18')](handleEntityNotFound(_0x425666,null))[_0x419d('0x18')](function(_0x59bd2a){if(_0x59bd2a){if(!_[_0x419d('0x84')](_0x59bd2a[_0x419d('0x8a')])){if(fs['existsSync'](path[_0x419d('0x7e')](config['root'],_0x419d('0x8b'),_0x59bd2a[_0x419d('0x8a')]))){_0x3c838b=path[_0x419d('0x7e')](config[_0x419d('0x7f')],_0x419d('0x8b'),_0x59bd2a['agentAvatar']);}}return _0x425666[_0x419d('0x87')](_0x3c838b);}})[_0x419d('0x5e')](handleError(_0x425666,null));};exports[_0x419d('0x8c')]=function(_0x13397b,_0x2f0da3){var _0x41e729=path[_0x419d('0x7e')](config[_0x419d('0x7f')],_0x419d('0x8d'));var _0x50f202={'where':{'id':_0x13397b['params']['id']},'attributes':['id',_0x419d('0x8e'),_0x419d('0x8f')],'raw':!![]};return db[_0x419d('0x48')][_0x419d('0x62')](_0x50f202)[_0x419d('0x18')](handleEntityNotFound(_0x2f0da3,null))[_0x419d('0x18')](function(_0x3c0b46){if(_0x3c0b46){if(!_[_0x419d('0x84')](_0x3c0b46[_0x419d('0x8e')])){if(fs['existsSync'](path[_0x419d('0x7e')](config[_0x419d('0x7f')],_0x419d('0x8b'),_0x3c0b46['customerAvatar']))&&_0x3c0b46['showCustomerAvatar']){_0x41e729=path[_0x419d('0x7e')](config[_0x419d('0x7f')],_0x419d('0x8b'),_0x3c0b46[_0x419d('0x8e')]);}}return _0x2f0da3[_0x419d('0x87')](_0x41e729);}})[_0x419d('0x5e')](handleError(_0x2f0da3,null));};exports[_0x419d('0x90')]=function(_0x405fb5,_0x496250){var _0x293588=path[_0x419d('0x7e')](config[_0x419d('0x7f')],'server/files/images/avatars/system_avatar.png');var _0x378366={'where':{'id':_0x405fb5['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x419d('0x48')][_0x419d('0x62')](_0x378366)[_0x419d('0x18')](handleEntityNotFound(_0x496250,null))[_0x419d('0x18')](function(_0x263803){if(_0x263803){if(!_['isNil'](_0x263803[_0x419d('0x91')])){if(fs[_0x419d('0x85')](path[_0x419d('0x7e')](config[_0x419d('0x7f')],'server/files/images/avatars/',_0x263803[_0x419d('0x91')]))){_0x293588=path[_0x419d('0x7e')](config['root'],'server/files/images/avatars/',_0x263803[_0x419d('0x91')]);}}return _0x496250[_0x419d('0x87')](_0x293588);}})[_0x419d('0x5e')](handleError(_0x496250,null));};exports[_0x419d('0x92')]=function(_0x13a2f5,_0x20f72a){var _0x510f90={'body':_0x13a2f5[_0x419d('0x64')],'channel':_0x419d('0x93')};var _0x58f76f=[];var _0x2fca90=[];var _0x2c17e2={};var _0x5bf3bf=![];if(_0x13a2f5[_0x419d('0x64')]['id']){delete _0x13a2f5['body']['id'];}if(_[_0x419d('0x84')](_0x13a2f5[_0x419d('0x64')]['from'])){throw new APIBadRequestError(_0x419d('0x94'));}if(_[_0x419d('0x84')](_0x13a2f5['body'][_0x419d('0x95')])){throw new APIBadRequestError(_0x419d('0x96'));}if(_[_0x419d('0x97')](_0x13a2f5['body'][_0x419d('0x64')])){throw new APIBadRequestError(_0x419d('0x98'));}return db[_0x419d('0x99')][_0x419d('0x6c')]()[_0x419d('0x18')](function(_0x1ea312){if(!_0x1ea312){throw new Error(_0x419d('0x9a'));}_0x58f76f=Object[_0x419d('0x4d')](_0x1ea312)['filter'](function(_0x4bb070){return!['createdAt',_0x419d('0x9b')][_0x419d('0x9c')](_0x4bb070);});_0x2fca90=Object[_0x419d('0x4d')](_0x1ea312)['filter'](function(_0x203466){return![_0x419d('0x9d'),_0x419d('0x9b'),_0x419d('0x9e'),_0x419d('0x9f')]['includes'](_0x203466);});if(!_[_0x419d('0x9c')](_0x2fca90,_0x13a2f5[_0x419d('0x64')][_0x419d('0x95')])){throw new APIBadRequestError(_0x419d('0xa0')+_0x2fca90[_0x419d('0x7e')](',\x20'));}_0x2c17e2[_0x13a2f5[_0x419d('0x64')]['mapKey']]=_0x13a2f5['body'][_0x419d('0xa1')];})['then'](function(){return db[_0x419d('0x48')][_0x419d('0x62')]({'where':{'id':_0x13a2f5[_0x419d('0x60')]['id']},'include':[{'model':db[_0x419d('0xa2')],'as':'List','include':[{'model':db[_0x419d('0x99')],'as':'Contacts','where':_0x2c17e2,'limit':0x1,'order':[['updatedAt',_0x419d('0xa3')]]}]},{'model':db['ChatApplication'],'as':_0x419d('0xa4')},{'model':db[_0x419d('0xa5')],'as':_0x419d('0xa5'),'include':[{'model':db['Interval'],'as':_0x419d('0xa6'),'attributes':['id','interval'],'raw':!![]}]}]});})[_0x419d('0x18')](function(_0x2c9ccc){if(!_0x2c9ccc){throw new APINotFoundError(util[_0x419d('0x3e')](_0x419d('0xa7'),_0x13a2f5['params']['id']));}var _0x4fd9d8=_0x2c9ccc[_0x419d('0xa5')];if(_0x4fd9d8){var _0x5b243f=_0x2c9ccc[_0x419d('0xa8')]||undefined;return _0x4fd9d8[_0x419d('0xa9')](_0x5b243f)[_0x419d('0x18')](function(_0x42b689){if(!_0x42b689){throw new APIOutOfIntervalError();}return _0x2c9ccc;});}else{return _0x2c9ccc;}})[_0x419d('0x18')](function(_0x30a62a){if(!_0x30a62a['List']){return;}_0x510f90[_0x419d('0xaa')]=_0x30a62a;_0x510f90[_0x419d('0xab')]=_0x30a62a['List'];_0x510f90[_0x419d('0xac')]=_[_0x419d('0xad')](_0x30a62a[_0x419d('0xa4')],[_0x419d('0xae')],['asc']);if(_0x510f90[_0x419d('0xaa')][_0x419d('0xa4')]){delete _0x510f90[_0x419d('0xaa')][_0x419d('0xa4')];}if(_0x510f90['account']['List']&&_0x510f90[_0x419d('0xaa')]['List']['Contacts'][_0x419d('0x52')]){return _0x510f90[_0x419d('0xaa')][_0x419d('0xaf')][_0x419d('0xb0')][0x0];}var _0x1c2cdc=_['defaults'](_0x13a2f5[_0x419d('0x64')],{'firstName':_0x13a2f5[_0x419d('0x64')]['from'],'ListId':_0x30a62a['ListId']});_0x1c2cdc[_0x13a2f5[_0x419d('0x64')][_0x419d('0x95')]]=_0x13a2f5[_0x419d('0x64')]['from'];return db[_0x419d('0x99')][_0x419d('0x63')](_0x1c2cdc,{'fields':_0x58f76f,'raw':!![]});})[_0x419d('0x18')](function(_0x4da290){_0x510f90['contact']=_0x4da290;var _0x2175e1=createInteractionObject(_0x13a2f5[_0x419d('0x60')]['id'],_0x13a2f5[_0x419d('0x64')],_0x13a2f5['headers'],_0x4da290);var _0x44988a={'ChatWebsiteId':_0x13a2f5['params']['id']};if(_0x13a2f5[_0x419d('0x64')][_0x419d('0xb1')]){_0x44988a[_0x419d('0xb1')]=_0x13a2f5[_0x419d('0x64')][_0x419d('0xb1')];_0x44988a[_0x419d('0xb2')]=![];return db[_0x419d('0xb3')][_0x419d('0x62')]({'where':_0x44988a})[_0x419d('0x18')](function(_0x3dee0d){var _0x28c138=_0x13a2f5[_0x419d('0x64')][_0x419d('0x34')]&&_0x13a2f5[_0x419d('0x64')]['referer'];if(_0x3dee0d){_0x5bf3bf=!![];return _0x3dee0d;}else if(!_0x28c138&&_0x3dee0d&&_0x3dee0d[_0x419d('0xb2')]){throw new APIConflictError(_0x419d('0xb4'));}_0x2175e1[_0x419d('0xb1')]=_0x13a2f5['body'][_0x419d('0xb1')];_0x2175e1[_0x419d('0xb5')]=_0x13a2f5[_0x419d('0x64')][_0x419d('0xb5')];return db[_0x419d('0xb3')]['create'](_0x2175e1);});}_0x44988a[_0x419d('0xb6')]=_0x4da290['id'];if(_0x13a2f5[_0x419d('0x64')][_0x419d('0xb7')]&&_0x13a2f5[_0x419d('0x64')][_0x419d('0xb7')]['id']){_0x44988a['id']=_0x13a2f5[_0x419d('0x64')][_0x419d('0xb7')]['id'];return db[_0x419d('0xb3')][_0x419d('0x62')]({'where':_0x44988a})[_0x419d('0x18')](function(_0x14f28c){if(_0x14f28c){_0x5bf3bf=!![];return _0x14f28c;}return db[_0x419d('0xb3')][_0x419d('0x63')](_0x2175e1);});}return db[_0x419d('0xb3')][_0x419d('0x63')](_0x2175e1);})[_0x419d('0x18')](function(_0x57674d){if(!_0x5bf3bf){return _0x57674d;}var _0x33b1a5={'from':(_0x510f90[_0x419d('0xb8')][_0x419d('0x38')]||'')+'\x20'+(_0x510f90['contact'][_0x419d('0xb9')]||'')};if(_0x13a2f5['body'][_0x419d('0xb1')]&&_0x13a2f5[_0x419d('0x64')][_0x419d('0xba')]&&_0x13a2f5[_0x419d('0x64')][_0x419d('0xb1')]!=_0x13a2f5['body'][_0x419d('0xba')]){_0x33b1a5[_0x419d('0xb1')]=_0x13a2f5['body'][_0x419d('0xba')];}return _0x57674d[_0x419d('0x6b')](_0x33b1a5);})[_0x419d('0x18')](function(_0x308c43){_0x510f90[_0x419d('0xb7')]=_0x308c43[_0x419d('0x2b')]({'plain':!![]});_0x510f90[_0x419d('0xb7')][_0x419d('0xbb')]=!_0x5bf3bf;if(_0x510f90[_0x419d('0xb7')]['created']){if(_0x510f90['account'][_0x419d('0xbc')]){_0x510f90[_0x419d('0xac')][_0x419d('0xbd')]({'id':0x0,'priority':_0x510f90[_0x419d('0xac')]['length']+0x1,'app':'close','appdata':_0x419d('0xbe'),'interval':_0x419d('0xbf')});}}return db[_0x419d('0xc0')][_0x419d('0x63')]({'body':_0x13a2f5[_0x419d('0x64')][_0x419d('0x64')],'ChatWebsiteId':_0x13a2f5[_0x419d('0x60')]['id'],'ChatInteractionId':_0x308c43['id'],'direction':'in','ContactId':_0x510f90['contact']['id'],'AttachmentId':_0x13a2f5[_0x419d('0x64')]['AttachmentId']});})[_0x419d('0x18')](function(_0x569f9b){_0x510f90[_0x419d('0x1e')]=_0x569f9b;if(!_0x510f90['interaction'][_0x419d('0xc1')]){return;}return db['User']['find']({'attributes':['id',_0x419d('0x2f')],'where':{'id':_0x510f90[_0x419d('0xb7')]['UserId']}});})[_0x419d('0x18')](function(_0x54d0d4){if(_0x54d0d4){_0x510f90[_0x419d('0xac')]['unshift']({'id':0x0,'priority':0x0,'app':_0x419d('0xc2'),'appdata':_0x54d0d4[_0x419d('0x2f')]+','+(_0x510f90['account'][_0x419d('0xc3')]||0xa),'interval':_0x419d('0xbf')});_0x510f90['forcedOwnership']=!![];}if(!_0x510f90[_0x419d('0xb7')][_0x419d('0xc4')]){return;}return db[_0x419d('0xc5')][_0x419d('0x62')]({'attributes':['id',_0x419d('0x2f')],'where':{'id':_0x510f90[_0x419d('0xb7')][_0x419d('0xc4')]}});})['then'](function(_0x19c327){if(_0x19c327){_0x510f90[_0x419d('0xac')][_0x419d('0xc6')]({'id':0x0,'priority':0x1,'app':_0x419d('0xc7'),'appdata':_0x19c327[_0x419d('0x2f')]+','+(_0x510f90[_0x419d('0xaa')][_0x419d('0xc8')]||0x12c),'interval':_0x419d('0xbf')});}return respondWithRpcPromise(_0x419d('0xc9'),_0x419d('0xca'),_0x510f90);})[_0x419d('0x18')](function(_0x387acf){respondWithRpcPromise(_0x419d('0xcb'),_0x419d('0xcb'),{'event':'notify','message':_0x387acf},client9002);return _0x387acf;})[_0x419d('0x18')](respondWithResult(_0x20f72a,null))[_0x419d('0x5e')](APIHandleError(_0x20f72a));};exports['offline']=function(_0x5afd62,_0x4f1a9c){var _0x4cab03,_0x101fed,_0x46ad0e;var _0x4bcab1=[];var _0x5be971={};var _0x56d84f=_0x5afd62[_0x419d('0xcc')]||[];var _0x10c44b=[];var _0x58fc08;return db['CmContact'][_0x419d('0x6c')]()[_0x419d('0x18')](function(_0x14c7b5){if(!_0x14c7b5){throw new db[(_0x419d('0xcd'))][(_0x419d('0xce'))]('no\x20available\x20attributes');}_0x4bcab1=_[_0x419d('0xcf')](_[_0x419d('0x4d')](_0x14c7b5),['createdAt','updatedAt',_0x419d('0x9e'),_0x419d('0x9f')]);if(_0x5afd62[_0x419d('0x64')]['id']){delete _0x5afd62[_0x419d('0x64')]['id'];}if(_[_0x419d('0x84')](_0x5afd62[_0x419d('0x64')]['from'])){throw _0x4f1a9c['status'](0x1f4)['send'](new db[(_0x419d('0xcd'))][(_0x419d('0xce'))](_0x419d('0xd0')));}if(_[_0x419d('0x84')](_0x5afd62[_0x419d('0x64')][_0x419d('0x64')])||_0x5afd62[_0x419d('0x64')][_0x419d('0x64')]===''){throw _0x4f1a9c[_0x419d('0x21')](0x1f4)[_0x419d('0x30')](new db[(_0x419d('0xcd'))][(_0x419d('0xce'))](_0x419d('0xd1')));}if(_[_0x419d('0x84')](_0x5afd62[_0x419d('0x64')][_0x419d('0xd2')])){throw _0x4f1a9c[_0x419d('0x21')](0x1f4)['send'](new db['Sequelize'][(_0x419d('0xce'))](_0x419d('0xd3')+_0x4bcab1));}if(!_[_0x419d('0x9c')](_0x4bcab1,_0x5afd62[_0x419d('0x64')][_0x419d('0xd2')])){throw _0x4f1a9c['status'](0x1f4)['send'](new db[(_0x419d('0xcd'))][(_0x419d('0xce'))](_0x419d('0xd4')+_0x4bcab1));}_0x5be971[_0x5afd62[_0x419d('0x64')]['mapKeyOffline']]=_0x5afd62[_0x419d('0x64')]['from'];})[_0x419d('0x18')](function(){return db[_0x419d('0x48')][_0x419d('0x62')]({'where':{'id':_0x5afd62[_0x419d('0x60')]['id']},'include':[{'model':db[_0x419d('0xa2')],'as':_0x419d('0xaf')},{'model':db[_0x419d('0xd5')],'as':'MailAccount'}]});})[_0x419d('0x18')](handleEntityNotFound(_0x4f1a9c,null))['then'](function(_0x257cde){if(_0x257cde&&_0x257cde[_0x419d('0xaf')]){_0x101fed=_0x257cde;var _0x3e4080=_[_0x419d('0x11')](_0x5afd62[_0x419d('0x64')],{'firstName':_0x5afd62[_0x419d('0x64')]['from'],'phone':_0x5afd62[_0x419d('0x64')]['from'],'ListId':_0x257cde[_0x419d('0x9f')]});_0x3e4080[_0x5afd62[_0x419d('0x64')][_0x419d('0xd2')]]=_0x5afd62[_0x419d('0x64')]['from'];return db[_0x419d('0x99')]['findOrCreate']({'where':_0x5be971,'defaults':_0x3e4080});}})[_0x419d('0xd6')](function(_0x162d5a){if(_0x162d5a){_0x46ad0e=_0x162d5a;var _0x3c86e1=fs[_0x419d('0xd7')](path[_0x419d('0x7e')](config['root'],_0x419d('0xd8')),_0x419d('0xd9'));var _0x39d6d7=ejs[_0x419d('0xda')](_0x3c86e1,{'body':_[_0x419d('0xdb')](_0x5afd62[_0x419d('0x64')]['body']),'bodyTitle':_0x101fed[_0x419d('0xdc')]});return db[_0x419d('0xdd')]['create']({'body':_0x39d6d7,'plainBody':htmlToText[_0x419d('0xde')](_0x39d6d7),'ContactId':_0x162d5a['id'],'ChatWebsiteId':_0x101fed['id']});}})[_0x419d('0x18')](function(_0xcf1c33){_0x58fc08=_0xcf1c33;if(_0x56d84f[_0x419d('0x52')]){var _0x3049b4=_0x56d84f[_0x419d('0x47')](function(_0x3f2995){return{'name':_0x3f2995[_0x419d('0xdf')],'basename':_0x3f2995[_0x419d('0x7b')],'type':_0x3f2995[_0x419d('0xe0')],'ChatOfflineMessageId':_0xcf1c33['id']};});_0x10c44b=_0x3049b4[_0x419d('0x47')](_0x44a46c=>{var _0x50daec={'filename':_0x44a46c['name'],'path':path[_0x419d('0x7e')](config['root'],_0x419d('0xe1'),_0x419d('0xcc'),_0x419d('0xe2'),_0x419d('0xe3'),_0x44a46c[_0x419d('0xe4')])};return _0x50daec;});if(!_0x101fed['openNewInteraction']){return db[_0x419d('0xe5')][_0x419d('0xe6')](function(_0x1039b8){return db['Attachment']['bulkCreate'](_0x3049b4,{'transaction':_0x1039b8});});}}})[_0x419d('0x18')](function(){if(_0x58fc08){_0x4cab03=_0x58fc08;return db[_0x419d('0xd5')][_0x419d('0xe7')]({'where':{'service':!![]},'include':[{'model':db[_0x419d('0xe8')],'as':_0x419d('0xe9'),'raw':!![],'include':[{'model':db[_0x419d('0xea')],'as':_0x419d('0xea'),'raw':!![]}]}]});}})[_0x419d('0x18')](function(_0x494ec9){if(_0x494ec9&&_0x494ec9['Smtp']&&_0x101fed[_0x419d('0xeb')]&&_0x101fed[_0x419d('0xec')]){var _0x32be9e=_0x494ec9[_0x419d('0xed')]();return respondWithRpcPromise('SendMail',_0x419d('0xee'),{'account':_0x32be9e,'message':{'from':util[_0x419d('0x3e')]('\x22%s\x22\x20<%s>',_0x494ec9[_0x419d('0x2f')],_0x494ec9[_0x419d('0xef')]||_0x494ec9[_0x419d('0xe9')][_0x419d('0x65')]),'to':_0x101fed[_0x419d('0xec')],'subject':_0x101fed[_0x419d('0xf0')],'html':_0x4cab03[_0x419d('0x64')],'attachments':_0x10c44b}},client9003)[_0x419d('0x18')](function(){return _0x4cab03;})[_0x419d('0x5e')](function(_0x598e33){logger[_0x419d('0x1d')](_0x598e33);});}})[_0x419d('0x18')](function(){if(_0x101fed&&_0x101fed[_0x419d('0xf1')]&&_0x101fed[_0x419d('0xf2')]){var _0x31f5c2=[];if(_0x56d84f[_0x419d('0x52')]){_0x31f5c2=_0x56d84f[_0x419d('0x47')](function(_0xe1d7){return{'name':_0xe1d7[_0x419d('0xdf')],'basename':_0xe1d7[_0x419d('0x7b')],'type':_0xe1d7[_0x419d('0xe0')],'ChatOfflineMessageId':_0x58fc08['id']};});}var _0x2d89ab;if(!_[_0x419d('0x84')](_0x101fed[_0x419d('0xf3')])){var _0x4e4451=_['map'](_0x5afd62[_0x419d('0x64')],function(_0x4d837e){return _0x4d837e;});var _0x524046=_[_0x419d('0xf4')](_0x4e4451)[0x0];var _0x5bb39c=_['mapValues'](_0x524046,function(_0x465b8b){return _0x465b8b;});_0x2d89ab=_0x5bb39c[0x1][_0x101fed[_0x419d('0xf3')]];}var _0x56f4cc={'from':_0x46ad0e['email'],'firstName':_0x46ad0e[_0x419d('0x38')],'lastName':_0x46ad0e[_0x419d('0xb9')],'mapKey':_0x419d('0xef'),'message':{'from':_0x46ad0e[_0x419d('0xef')],'to':_0x101fed[_0x419d('0xd5')][_0x419d('0xef')],'cc':'','subject':_[_0x419d('0x84')](_0x2d89ab)?_0x101fed[_0x419d('0xf0')]:_0x2d89ab,'messageId':'','sentAt':new Date(),'attach':_0x31f5c2[_0x419d('0x52')],'attachments':_0x31f5c2,'originChannel':'Chat','ChatWebsiteId':_0x101fed['id'],'ChatOfflineMessageId':_0x4cab03['id'],'originTo':_0x101fed[_0x419d('0xd5')]['email']},'body':_0x4cab03[_0x419d('0x64')]};var _0x5d629a={'account':{'id':_0x101fed[_0x419d('0xf2')]},'body':_0x56f4cc,'log':_0x419d('0xf5')};return respondWithRpcPromise(_0x419d('0xf5'),'notifyMail',_0x5d629a,client9001)[_0x419d('0x18')](function(){return _0x4cab03;})[_0x419d('0x5e')](function(_0x52b41f){logger[_0x419d('0x1d')](_0x52b41f);});}return;})['then'](function(){if(_0x4cab03){return _0x4cab03;}})[_0x419d('0x18')](respondWithResult(_0x4f1a9c,null))[_0x419d('0x5e')](function(){for(var _0x4e2515 of _0x56d84f){var _0x527b8b=path[_0x419d('0x7e')](config['root'],'server',_0x419d('0xcc'),_0x419d('0xe2'),_0x419d('0xe3'),_0x4e2515[_0x419d('0x7b')]);fs_extra[_0x419d('0xf6')](_0x527b8b)[_0x419d('0x5e')](function(_0x1764d7){logger[_0x419d('0x1d')](_0x419d('0xf7'),_0x527b8b,_0x1764d7);});}});};exports['addInteraction']=function(_0x1899da,_0x4c0932){return db[_0x419d('0xb3')]['find']({'where':{'id':_0x1899da[_0x419d('0x60')]['id']}})[_0x419d('0x18')](handleEntityNotFound(_0x4c0932,null))[_0x419d('0x18')](function(_0x4a7cc6){if(_0x4a7cc6){return _0x4a7cc6[_0x419d('0xf8')](_0x1899da[_0x419d('0x64')]['ids'],_['omit'](_0x1899da[_0x419d('0x64')],[_0x419d('0x72'),'id'])||{});}})[_0x419d('0x18')](respondWithResult(_0x4c0932,null))[_0x419d('0x5e')](handleError(_0x4c0932,null));};exports[_0x419d('0xf9')]=function(_0xe13f46,_0x2b539b){var _0x35bcd7={'raw':![],'where':{}};var _0x6b171d={};var _0x2b86bf={'count':0x0,'rows':[]};return db[_0x419d('0x48')][_0x419d('0xe7')]({'where':{'id':_0xe13f46[_0x419d('0x60')]['id']}})[_0x419d('0x18')](handleEntityNotFound(_0x2b539b,null))[_0x419d('0x18')](function(_0x37ce69){if(_0x37ce69){_0x6b171d[_0x419d('0x50')]=_[_0x419d('0x4d')](db['ChatInteraction'][_0x419d('0x49')]);_0x6b171d[_0x419d('0x4c')]=_['keys'](_0xe13f46[_0x419d('0x4c')]);_0x6b171d['filters']=_[_0x419d('0x4f')](_0x6b171d[_0x419d('0x50')],_0x6b171d['query']);_0x35bcd7['attributes']=_[_0x419d('0x4f')](_0x6b171d[_0x419d('0x50')],qs[_0x419d('0x61')](_0xe13f46[_0x419d('0x4c')][_0x419d('0x61')]));_0x35bcd7['attributes']=_0x35bcd7[_0x419d('0x51')]['length']?_0x35bcd7['attributes']:_0x6b171d[_0x419d('0x50')];if(!_0xe13f46[_0x419d('0x4c')]['hasOwnProperty'](_0x419d('0x53'))){_0x35bcd7[_0x419d('0x26')]=qs[_0x419d('0x26')](_0xe13f46[_0x419d('0x4c')][_0x419d('0x26')]);_0x35bcd7[_0x419d('0x24')]=qs[_0x419d('0x24')](_0xe13f46[_0x419d('0x4c')]['offset']);}_0x35bcd7[_0x419d('0x54')]=qs[_0x419d('0x55')](_0xe13f46[_0x419d('0x4c')][_0x419d('0x55')]);_0x35bcd7[_0x419d('0x56')]=qs[_0x419d('0x4e')](_[_0x419d('0xfa')](_0xe13f46[_0x419d('0x4c')],_0x6b171d['filters']));_0x35bcd7['where'][_0x419d('0x6d')]=_0x37ce69['id'];if(_0xe13f46[_0x419d('0x4c')][_0x419d('0x57')]){_0x35bcd7[_0x419d('0x56')]=_[_0x419d('0x58')](_0x35bcd7['where'],{'$or':_['map'](_0x35bcd7['attributes'],function(_0x4ace8c){var _0x21cfbf={};_0x21cfbf[_0x4ace8c]={'$like':'%'+_0xe13f46[_0x419d('0x4c')][_0x419d('0x57')]+'%'};return _0x21cfbf;})});}_0x35bcd7=_[_0x419d('0x58')]({},_0x35bcd7,_0xe13f46[_0x419d('0x5a')]);return db[_0x419d('0xb3')]['count']({'where':_0x35bcd7[_0x419d('0x56')]})['then'](function(_0x5e0ed5){_0x2b86bf[_0x419d('0x27')]=_0x5e0ed5;if(_0xe13f46[_0x419d('0x4c')][_0x419d('0x5b')]){_0x35bcd7['include']=[{'model':db[_0x419d('0x99')],'as':_0x419d('0xfb'),'required':![]},{'model':db['User'],'as':_0x419d('0xfc'),'attributes':[_0x419d('0x2f'),'fullname','internal'],'required':![]},{'model':db[_0x419d('0xfd')],'as':_0x419d('0xfe'),'attributes':['id','name',_0x419d('0xff')],'where':_0xe13f46[_0x419d('0x4c')][_0x419d('0x100')]?{'id':_0xe13f46['query']['tag']}:undefined,'required':_0xe13f46[_0x419d('0x4c')]['tag']?!![]:![]}];}return db[_0x419d('0xb3')][_0x419d('0x5d')](_0x35bcd7);})['then'](function(_0x36f206){_0x2b86bf[_0x419d('0x76')]=_0x36f206;return _0x2b86bf;});}})[_0x419d('0x18')](respondWithFilteredResult(_0x2b539b,_0x35bcd7))[_0x419d('0x5e')](handleError(_0x2b539b,null));};exports[_0x419d('0x101')]=function(_0xbd6abe,_0x5255e5){var _0x2f254b=0x0;var _0x5f5a53=0x0;var _0xf2f3c6=![];var _0x59fd48;var _0xe0c3ae;return db[_0x419d('0x48')][_0x419d('0x62')]({'where':{'id':_0xbd6abe[_0x419d('0x60')]['id']},'include':[{'model':db[_0x419d('0xa5')],'as':_0x419d('0xa5'),'include':[{'model':db[_0x419d('0xa5')],'as':_0x419d('0xa6'),'attributes':['id',_0x419d('0x102')]}]}]})[_0x419d('0x18')](handleEntityNotFound(_0x5255e5,null))[_0x419d('0x18')](function(_0x4cc579){if(_0x4cc579){_0x59fd48=_0x4cc579;return _0x4cc579[_0x419d('0x103')]({'raw':!![]});}})[_0x419d('0x18')](function(_0x5209f8){if(_0x59fd48){if(_0x5209f8){_0xe0c3ae=_0x5209f8;}}return require(_0x419d('0x81'))[_0x419d('0x82')]();})[_0x419d('0x18')](function(_0x1e7c2e){if(_0x1e7c2e){_0x5f5a53=_0x1e7c2e[_0x419d('0x104')];_0xf2f3c6=_0x1e7c2e['custom'];}})[_0x419d('0x18')](function(){return db[_0x419d('0xb3')][_0x419d('0x27')]({'where':{'closed':![]}});})[_0x419d('0x18')](function(_0x28688f){_0x2f254b=_0x28688f;if(_0x5f5a53&&_0x28688f>_0x5f5a53){return db['License'][_0x419d('0xe7')]({'where':{'id':0x1}})['then'](function(_0xc85c73){if(_0xc85c73){_0xc85c73[_0x419d('0x105')](_0x419d('0x106'));}});}})['then'](function(){var _0x279d19=_0x59fd48[_0x419d('0xa5')];var _0x58373f=_0x59fd48[_0x419d('0xa8')]||undefined;return _0x279d19?_0x279d19[_0x419d('0xa9')](_0x58373f):!![];})[_0x419d('0x18')](function(_0x3f6aed){var _0x141029=fs['readFileSync'](path[_0x419d('0x7e')](config[_0x419d('0x7f')],_0x419d('0x107')),_0x419d('0xd9'));var _0x169b3c=new url[(_0x419d('0x108'))](_0x59fd48[_0x419d('0x109')])[_0x419d('0x10a')];var _0x1f910b=_0x419d('0x10b');var _0x16f763=![];var _0x14e510={'chatVersion':_0x1f910b,'chatWebsiteAddressOrigin':_0x169b3c,'remote':_0x59fd48['remote'],'query':querystring[_0x419d('0x10c')](_[_0x419d('0x58')](_0x59fd48[_0x419d('0x2b')]({'plain':!![]}),{'customerIp':_0xbd6abe[_0x419d('0x10d')]['x-forwarded-for']||_0xbd6abe[_0x419d('0x10d')][_0x419d('0x10e')]||_0xbd6abe[_0x419d('0x10f')][_0x419d('0x110')]||_0xbd6abe['ip'],'referer':_0xbd6abe[_0x419d('0x10d')][_0x419d('0x3a')],'openedInteractions':_0x2f254b,'maxInteractions':_0x5f5a53,'virtual':_0xf2f3c6[_0x419d('0x104')],'online':_0x3f6aed,'custom':_0xf2f3c6}))[_0x419d('0x111')](/'/g,'\x5c\x27')};_0x5255e5[_0x419d('0x30')](ejs['render'](Mustache[_0x419d('0xda')](_0x141029,_0x14e510),{'proactiveActions':_0xe0c3ae,'alignment':_0x59fd48[_0x419d('0x112')],'verticalAlignment':_0x59fd48[_0x419d('0x113')],'div_color':_0x59fd48['color'],'labelText':_0x59fd48[_0x419d('0x114')],'text_color':_0x59fd48['textColor'],'text_button_color':_0x59fd48[_0x419d('0x115')],'button_color':_0x59fd48[_0x419d('0x116')],'background_color':_0x59fd48[_0x419d('0x117')],'hideWhenOffline':_0x59fd48[_0x419d('0x118')],'intervalId':_0x59fd48['IntervalId'],'isDevelopment':_0x16f763,'chatVersion':_0x1f910b}));})['catch'](handleError(_0x5255e5,null));};exports['addApplications']=function(_0x378d29,_0x454468){var _0x33fb65=_0x378d29[_0x419d('0x60')]['id'];var _0x46d93f=_0x378d29[_0x419d('0x64')];var _0x565ffc=0xc8;var _0x87541=null;return db[_0x419d('0xe5')]['transaction']({'isolationLevel':db['sequelize'][_0x419d('0x119')][_0x419d('0x11a')][_0x419d('0x11b')]},function(_0x3fa36a){return db['ChatWebsite']['findOne']({'where':{'id':_0x33fb65},'transaction':_0x3fa36a})[_0x419d('0x18')](function(_0x4dd7c2){if(_0x4dd7c2){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x33fb65},'transaction':_0x3fa36a})[_0x419d('0x18')](function(){var _0x4193cc=_[_0x419d('0x47')](_0x46d93f,function(_0x189edb){_0x189edb[_0x419d('0x6d')]=_0x33fb65;return _0x189edb;});return db['ChatApplication']['bulkCreate'](_0x4193cc,{'transaction':_0x3fa36a});});}else{_0x565ffc=0x194;_0x87541=[];}});})[_0x419d('0x18')](function(){if(_0x565ffc!==0x194){return db[_0x419d('0x11c')][_0x419d('0x11d')]({'where':{'ChatWebsiteId':_0x33fb65},'order':_0x419d('0xae')})['then'](function(_0x172817){_0x87541=_0x172817;});}})['catch'](function(_0x59c111){_0x565ffc=0x1f4;logger[_0x419d('0x1d')](_0x59c111[_0x419d('0x2e')]);if(_0x59c111[_0x419d('0x2f')]){delete _0x59c111[_0x419d('0x2f')];}_0x87541=_0x59c111;})[_0x419d('0x11e')](function(){if(_0x87541===null){_0x454468['sendStatus'](_0x565ffc);}else{if(_0x565ffc===0x1f4){_0x454468[_0x419d('0x21')](_0x565ffc)['send'](_0x87541);}else{_0x454468[_0x419d('0x21')](_0x565ffc)['json'](_0x87541);}}});};exports[_0x419d('0x11f')]=function(_0x28b071,_0x243862){var _0x5443b5={};var _0x24508d={};var _0x8c8ac4;var _0x1076a5;return db['ChatWebsite'][_0x419d('0xe7')]({'where':{'id':_0x28b071[_0x419d('0x60')]['id']}})['then'](handleEntityNotFound(_0x243862,null))[_0x419d('0x18')](function(_0x1c8d47){if(_0x1c8d47){_0x8c8ac4=_0x1c8d47;_0x24508d['model']=_['keys'](db[_0x419d('0x11c')]['rawAttributes']);_0x24508d[_0x419d('0x4c')]=_[_0x419d('0x4d')](_0x28b071[_0x419d('0x4c')]);_0x24508d[_0x419d('0x4e')]=_[_0x419d('0x4f')](_0x24508d[_0x419d('0x50')],_0x24508d[_0x419d('0x4c')]);_0x5443b5[_0x419d('0x51')]=_[_0x419d('0x4f')](_0x24508d[_0x419d('0x50')],qs[_0x419d('0x61')](_0x28b071['query'][_0x419d('0x61')]));_0x5443b5['attributes']=_0x5443b5[_0x419d('0x51')][_0x419d('0x52')]?_0x5443b5[_0x419d('0x51')]:_0x24508d['model'];_0x5443b5['order']=qs[_0x419d('0x55')](_0x28b071['query'][_0x419d('0x55')]);_0x5443b5[_0x419d('0x56')]=qs[_0x419d('0x4e')](_['pick'](_0x28b071[_0x419d('0x4c')],_0x24508d['filters']));if(_0x28b071['query'][_0x419d('0x57')]){_0x5443b5[_0x419d('0x56')]=_['merge'](_0x5443b5[_0x419d('0x56')],{'$or':_[_0x419d('0x47')](_0x5443b5['attributes'],function(_0x48abae){var _0x50a127={};_0x50a127[_0x48abae]={'$like':'%'+_0x28b071[_0x419d('0x4c')][_0x419d('0x57')]+'%'};return _0x50a127;})});}_0x5443b5=_[_0x419d('0x58')]({},_0x5443b5,_0x28b071[_0x419d('0x5a')]);return _0x8c8ac4[_0x419d('0x11f')](_0x5443b5);}})[_0x419d('0x18')](function(_0x525a17){if(_0x525a17){_0x1076a5=_0x525a17['length'];if(!_0x28b071[_0x419d('0x4c')][_0x419d('0x70')]('nolimit')){_0x5443b5['limit']=qs[_0x419d('0x26')](_0x28b071[_0x419d('0x4c')][_0x419d('0x26')]);_0x5443b5['offset']=qs[_0x419d('0x24')](_0x28b071[_0x419d('0x4c')][_0x419d('0x24')]);}return _0x8c8ac4[_0x419d('0x11f')](_0x5443b5);}})[_0x419d('0x18')](function(_0x1567da){if(_0x1567da){return _0x1567da?{'count':_0x1076a5,'rows':_0x1567da}:null;}})[_0x419d('0x18')](respondWithResult(_0x243862,null))[_0x419d('0x5e')](handleError(_0x243862,null));};exports[_0x419d('0x120')]=function(_0x4c45c4,_0x129eca){return db[_0x419d('0x121')][_0x419d('0x62')]({'where':{'id':_0x4c45c4[_0x419d('0x60')]['id']}})[_0x419d('0x18')](handleEntityNotFound(_0x129eca,null))['then'](function(_0x2f80c9){if(_0x2f80c9){return _0x2f80c9[_0x419d('0x120')](_0x4c45c4['body']['ids'],_[_0x419d('0x122')](_0x4c45c4['body'],[_0x419d('0x72'),'id'])||{});}})[_0x419d('0x18')](respondWithResult(_0x129eca,null))['catch'](handleError(_0x129eca,null));};exports[_0x419d('0x103')]=function(_0x82a160,_0x4526e8){var _0x53bce9={};var _0x4a8be7={};var _0xe3bc77;var _0x31bb95;return db[_0x419d('0x48')][_0x419d('0xe7')]({'where':{'id':_0x82a160[_0x419d('0x60')]['id']}})['then'](handleEntityNotFound(_0x4526e8,null))[_0x419d('0x18')](function(_0x1b9b58){if(_0x1b9b58){_0xe3bc77=_0x1b9b58;_0x4a8be7[_0x419d('0x50')]=_['keys'](db['ChatProactiveAction'][_0x419d('0x49')]);_0x4a8be7[_0x419d('0x4c')]=_[_0x419d('0x4d')](_0x82a160['query']);_0x4a8be7['filters']=_[_0x419d('0x4f')](_0x4a8be7[_0x419d('0x50')],_0x4a8be7['query']);_0x53bce9[_0x419d('0x51')]=_[_0x419d('0x4f')](_0x4a8be7[_0x419d('0x50')],qs[_0x419d('0x61')](_0x82a160[_0x419d('0x4c')][_0x419d('0x61')]));_0x53bce9[_0x419d('0x51')]=_0x53bce9[_0x419d('0x51')][_0x419d('0x52')]?_0x53bce9['attributes']:_0x4a8be7[_0x419d('0x50')];_0x53bce9[_0x419d('0x54')]=qs[_0x419d('0x55')](_0x82a160['query'][_0x419d('0x55')]);_0x53bce9[_0x419d('0x56')]=qs[_0x419d('0x4e')](_[_0x419d('0xfa')](_0x82a160[_0x419d('0x4c')],_0x4a8be7[_0x419d('0x4e')]));if(_0x82a160[_0x419d('0x4c')][_0x419d('0x57')]){_0x53bce9[_0x419d('0x56')]=_[_0x419d('0x58')](_0x53bce9[_0x419d('0x56')],{'$or':_['map'](_0x53bce9['attributes'],function(_0x32f3af){var _0x20688={};_0x20688[_0x32f3af]={'$like':'%'+_0x82a160['query'][_0x419d('0x57')]+'%'};return _0x20688;})});}_0x53bce9=_[_0x419d('0x58')]({},_0x53bce9,_0x82a160[_0x419d('0x5a')]);return _0xe3bc77['getProactiveActions'](_0x53bce9);}})[_0x419d('0x18')](function(_0x4a2471){if(_0x4a2471){_0x31bb95=_0x4a2471[_0x419d('0x52')];if(!_0x82a160['query']['hasOwnProperty'](_0x419d('0x53'))){_0x53bce9[_0x419d('0x26')]=qs[_0x419d('0x26')](_0x82a160['query'][_0x419d('0x26')]);_0x53bce9[_0x419d('0x24')]=qs['offset'](_0x82a160['query'][_0x419d('0x24')]);}return _0xe3bc77['getProactiveActions'](_0x53bce9);}})['then'](function(_0x58c7aa){if(_0x58c7aa){return _0x58c7aa?{'count':_0x31bb95,'rows':_0x58c7aa}:null;}})[_0x419d('0x18')](respondWithResult(_0x4526e8,null))[_0x419d('0x5e')](handleError(_0x4526e8,null));};exports[_0x419d('0x123')]=function(_0x325843,_0x59c651){var _0x401391=_0x325843['query'][_0x419d('0x124')]===_0x419d('0x125')?_0x419d('0x126'):_0x419d('0x127');return db[_0x419d('0x48')]['find']({'attributes':['id',_0x401391],'where':{'id':_0x325843[_0x419d('0x60')]['id']}})[_0x419d('0x18')](handleEntityNotFound(_0x59c651,null))[_0x419d('0x18')](function(_0x3b5fbc){if(_0x3b5fbc){var _0x43cd43=_0x3b5fbc[_0x401391];var _0x4a8aec=_0x43cd43&&_0x43cd43[_0x419d('0x128')]?_0x43cd43[_0x419d('0x128')]:[];_0x59c651[_0x419d('0x30')]({'fromKey':_[_0x419d('0x84')](_0x43cd43['fromKey'])?undefined:_0x43cd43[_0x419d('0x129')],'count':_0x4a8aec['length'],'rows':_0x4a8aec});}})[_0x419d('0x5e')](handleError(_0x59c651,null));};exports[_0x419d('0x12a')]=function(_0x1287a9,_0x47a9a7){var _0x42815d={'raw':![],'where':{}};var _0x2453ee={};var _0x414f66={'count':0x0,'rows':[]};return db[_0x419d('0x48')][_0x419d('0xe7')]({'where':{'id':_0x1287a9['params']['id']}})[_0x419d('0x18')](handleEntityNotFound(_0x47a9a7,null))['then'](function(_0x2845a9){if(_0x2845a9){_0x2453ee['model']=_[_0x419d('0x4d')](db[_0x419d('0xdd')][_0x419d('0x49')]);_0x2453ee[_0x419d('0x4c')]=_[_0x419d('0x4d')](_0x1287a9['query']);_0x2453ee[_0x419d('0x4e')]=_[_0x419d('0x4f')](_0x2453ee[_0x419d('0x50')],_0x2453ee['query']);_0x42815d[_0x419d('0x51')]=_[_0x419d('0x4f')](_0x2453ee[_0x419d('0x50')],qs[_0x419d('0x61')](_0x1287a9[_0x419d('0x4c')]['fields']));_0x42815d[_0x419d('0x51')]=_0x42815d[_0x419d('0x51')][_0x419d('0x52')]?_0x42815d['attributes']:_0x2453ee[_0x419d('0x50')];if(!_0x1287a9[_0x419d('0x4c')][_0x419d('0x70')]('nolimit')){_0x42815d[_0x419d('0x26')]=qs[_0x419d('0x26')](_0x1287a9[_0x419d('0x4c')][_0x419d('0x26')]);_0x42815d[_0x419d('0x24')]=qs[_0x419d('0x24')](_0x1287a9[_0x419d('0x4c')][_0x419d('0x24')]);}_0x42815d[_0x419d('0x54')]=qs[_0x419d('0x55')](_0x1287a9['query'][_0x419d('0x55')]);_0x42815d['where']=qs[_0x419d('0x4e')](_['pick'](_0x1287a9[_0x419d('0x4c')],_0x2453ee['filters']));_0x42815d[_0x419d('0x56')][_0x419d('0x6d')]=_0x2845a9['id'];if(_0x1287a9[_0x419d('0x4c')][_0x419d('0x57')]){_0x42815d['where']=_[_0x419d('0x58')](_0x42815d['where'],{'$or':_['map'](_0x42815d[_0x419d('0x51')],function(_0x51bc8f){var _0x4fb665={};_0x4fb665[_0x51bc8f]={'$like':'%'+_0x1287a9['query'][_0x419d('0x57')]+'%'};return _0x4fb665;})});}_0x42815d=_[_0x419d('0x58')]({},_0x42815d,_0x1287a9[_0x419d('0x5a')]);return db[_0x419d('0xdd')][_0x419d('0x27')]({'where':_0x42815d[_0x419d('0x56')]})[_0x419d('0x18')](function(_0x17a114){_0x414f66[_0x419d('0x27')]=_0x17a114;if(_0x1287a9[_0x419d('0x4c')][_0x419d('0x5b')]){_0x42815d[_0x419d('0x5c')]=[{'all':!![]}];}else{_0x42815d[_0x419d('0x5c')]=[{'model':db[_0x419d('0x99')],'as':_0x419d('0xfb'),'required':![]},{'model':db[_0x419d('0x12b')],'as':_0x419d('0x12c'),'required':![]}];}return db[_0x419d('0xdd')][_0x419d('0x5d')](_0x42815d);})['then'](function(_0x6400fe){_0x414f66[_0x419d('0x76')]=_0x6400fe;return _0x414f66;});}})['then'](respondWithFilteredResult(_0x47a9a7,_0x42815d))[_0x419d('0x5e')](handleError(_0x47a9a7,null));};exports[_0x419d('0x12d')]=function(_0x2e6078,_0x216d75){return db[_0x419d('0x48')][_0x419d('0x62')]({'where':{'id':_0x2e6078[_0x419d('0x60')]['id']}})[_0x419d('0x18')](handleEntityNotFound(_0x216d75,null))[_0x419d('0x18')](function(_0x3e3dfd){if(_0x3e3dfd){return _0x3e3dfd['addAgents'](_0x2e6078['body'][_0x419d('0x72')],_[_0x419d('0x122')](_0x2e6078[_0x419d('0x64')],[_0x419d('0x72'),'id'])||{})['spread'](function(_0x5c7666){for(var _0xd29f2=0x0;_0xd29f2<_0x2e6078[_0x419d('0x64')][_0x419d('0x72')][_0x419d('0x52')];_0xd29f2+=0x1){socket[_0x419d('0x12e')](_0x419d('0x12f'),{'UserId':Number(_0x2e6078[_0x419d('0x64')][_0x419d('0x72')][_0xd29f2]),'ChatWebsiteId':Number(_0x2e6078[_0x419d('0x60')]['id'])});}return _0x5c7666;});}})[_0x419d('0x18')](respondWithResult(_0x216d75,null))[_0x419d('0x5e')](handleError(_0x216d75,null));};exports[_0x419d('0x130')]=function(_0x4aa4ab,_0xfaff3a){return db['ChatWebsite'][_0x419d('0x62')]({'where':{'id':_0x4aa4ab['params']['id']}})[_0x419d('0x18')](handleEntityNotFound(_0xfaff3a,null))['then'](function(_0x276594){if(_0x276594){return _0x276594[_0x419d('0x130')](_0x4aa4ab[_0x419d('0x4c')]['ids'])[_0x419d('0x18')](function(){if(_[_0x419d('0x131')](_0x4aa4ab['query']['ids'])){for(var _0x15e44d=0x0;_0x15e44d<_0x4aa4ab['query'][_0x419d('0x72')][_0x419d('0x52')];_0x15e44d+=0x1){socket['emit'](_0x419d('0x132'),{'UserId':Number(_0x4aa4ab[_0x419d('0x4c')]['ids'][_0x15e44d]),'ChatWebsiteId':Number(_0x4aa4ab[_0x419d('0x60')]['id'])});}}else{socket[_0x419d('0x12e')](_0x419d('0x132'),{'UserId':Number(_0x4aa4ab[_0x419d('0x4c')]['ids']),'ChatWebsiteId':Number(_0x4aa4ab[_0x419d('0x60')]['id'])});}});}})[_0x419d('0x18')](respondWithStatusCode(_0xfaff3a,null))[_0x419d('0x5e')](handleError(_0xfaff3a,null));};exports[_0x419d('0x133')]=function(_0x330928,_0x1c4a72){var _0x37f939={};var _0xcd524b={};var _0x204070;var _0x327162;return db[_0x419d('0x48')][_0x419d('0xe7')]({'where':{'id':_0x330928[_0x419d('0x60')]['id']}})[_0x419d('0x18')](handleEntityNotFound(_0x1c4a72,null))[_0x419d('0x18')](function(_0x14cb8f){if(_0x14cb8f){_0x204070=_0x14cb8f;_0xcd524b[_0x419d('0x50')]=_[_0x419d('0x4d')](db[_0x419d('0x134')][_0x419d('0x49')]);_0xcd524b[_0x419d('0x4c')]=_['keys'](_0x330928['query']);_0xcd524b[_0x419d('0x4e')]=_['intersection'](_0xcd524b[_0x419d('0x50')],_0xcd524b[_0x419d('0x4c')]);_0x37f939[_0x419d('0x51')]=_[_0x419d('0x4f')](_0xcd524b[_0x419d('0x50')],qs['fields'](_0x330928[_0x419d('0x4c')][_0x419d('0x61')]));_0x37f939[_0x419d('0x51')]=_0x37f939['attributes']['length']?_0x37f939['attributes']:_0xcd524b['model'];_0x37f939[_0x419d('0x54')]=qs['sort'](_0x330928[_0x419d('0x4c')][_0x419d('0x55')]);_0x37f939[_0x419d('0x56')]=qs[_0x419d('0x4e')](_[_0x419d('0xfa')](_0x330928[_0x419d('0x4c')],_0xcd524b['filters']));if(_0x330928[_0x419d('0x4c')][_0x419d('0x57')]){_0x37f939[_0x419d('0x56')]=_[_0x419d('0x58')](_0x37f939[_0x419d('0x56')],{'$or':_[_0x419d('0x47')](_0x37f939['attributes'],function(_0x2aa344){var _0x2fbde5={};_0x2fbde5[_0x2aa344]={'$like':'%'+_0x330928['query'][_0x419d('0x57')]+'%'};return _0x2fbde5;})});}_0x37f939=_[_0x419d('0x58')]({},_0x37f939,_0x330928[_0x419d('0x5a')]);return _0x204070[_0x419d('0x133')](_0x37f939);}})[_0x419d('0x18')](function(_0x3b84a1){if(_0x3b84a1){_0x327162=_0x3b84a1['length'];if(!_0x330928['query'][_0x419d('0x70')]('nolimit')){_0x37f939[_0x419d('0x26')]=qs['limit'](_0x330928[_0x419d('0x4c')][_0x419d('0x26')]);_0x37f939[_0x419d('0x24')]=qs[_0x419d('0x24')](_0x330928[_0x419d('0x4c')][_0x419d('0x24')]);}return _0x204070[_0x419d('0x133')](_0x37f939);}})[_0x419d('0x18')](function(_0x5e2a37){if(_0x5e2a37){return _0x5e2a37?{'count':_0x327162,'rows':_0x5e2a37}:null;}})[_0x419d('0x18')](respondWithResult(_0x1c4a72,null))[_0x419d('0x5e')](handleError(_0x1c4a72,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 9ee0b29..66570bf 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 _0x3e25=['hook','exports','events','../../mysqldb','ChatWebsite','save','remove','emit','hasOwnProperty'];(function(_0x4091ed,_0x57f0fa){var _0x4bfa33=function(_0x380717){while(--_0x380717){_0x4091ed['push'](_0x4091ed['shift']());}};_0x4bfa33(++_0x57f0fa);}(_0x3e25,0x14f));var _0x53e2=function(_0x78740f,_0x2ec83d){_0x78740f=_0x78740f-0x0;var _0x5b2774=_0x3e25[_0x78740f];return _0x5b2774;};'use strict';var EventEmitter=require(_0x53e2('0x0'));var ChatWebsite=require(_0x53e2('0x1'))['db'][_0x53e2('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x53e2('0x3'),'afterUpdate':'update','afterDestroy':_0x53e2('0x4')};function emitEvent(_0x54366b){return function(_0x36545f,_0x2e0130,_0x14845f){ChatWebsiteEvents[_0x53e2('0x5')](_0x54366b+':'+_0x36545f['id'],_0x36545f);ChatWebsiteEvents[_0x53e2('0x5')](_0x54366b,_0x36545f);_0x14845f(null);};}for(var e in events){if(events[_0x53e2('0x6')](e)){var event=events[e];ChatWebsite[_0x53e2('0x7')](e,emitEvent(event));}}module[_0x53e2('0x8')]=ChatWebsiteEvents; \ No newline at end of file +var _0x7d55=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','remove','emit'];(function(_0x15a9db,_0x2b69c1){var _0x5e7e40=function(_0xd3c673){while(--_0xd3c673){_0x15a9db['push'](_0x15a9db['shift']());}};_0x5e7e40(++_0x2b69c1);}(_0x7d55,0x1bc));var _0x57d5=function(_0x265996,_0x55aa70){_0x265996=_0x265996-0x0;var _0x163e22=_0x7d55[_0x265996];return _0x163e22;};'use strict';var EventEmitter=require(_0x57d5('0x0'));var ChatWebsite=require(_0x57d5('0x1'))['db'][_0x57d5('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x57d5('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x57d5('0x4')};function emitEvent(_0x37caed){return function(_0x2b6dc5,_0x48b5aa,_0x2527c1){ChatWebsiteEvents[_0x57d5('0x5')](_0x37caed+':'+_0x2b6dc5['id'],_0x2b6dc5);ChatWebsiteEvents[_0x57d5('0x5')](_0x37caed,_0x2b6dc5);_0x2527c1(null);};}for(var e in events){if(events[_0x57d5('0x6')](e)){var event=events[e];ChatWebsite[_0x57d5('0x7')](e,emitEvent(event));}}module[_0x57d5('0x8')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index bbe32fe..1c06ec3 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 _0x7771=['lodash','util','moment','bluebird','request-promise','path','../../config/environment','./chatWebsite.attributes','ChatWebsite','chat_websites'];(function(_0x2c5784,_0x5e1e63){var _0x1d1a63=function(_0x475517){while(--_0x475517){_0x2c5784['push'](_0x2c5784['shift']());}};_0x1d1a63(++_0x5e1e63);}(_0x7771,0x1b8));var _0x1777=function(_0x51ab33,_0x71a8a8){_0x51ab33=_0x51ab33-0x0;var _0x5e1298=_0x7771[_0x51ab33];return _0x5e1298;};'use strict';var _=require(_0x1777('0x0'));var util=require(_0x1777('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1777('0x2'));var BPromise=require(_0x1777('0x3'));var rp=require(_0x1777('0x4'));var fs=require('fs');var path=require(_0x1777('0x5'));var rimraf=require('rimraf');var config=require(_0x1777('0x6'));var attributes=require(_0x1777('0x7'));module['exports']=function(_0x3a9551,_0x461cfe){return _0x3a9551['define'](_0x1777('0x8'),attributes,{'tableName':_0x1777('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xce7d=['./chatWebsite.attributes','exports','define','ChatWebsite','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x54a00b,_0x3c5e6e){var _0x30000d=function(_0x4c4f21){while(--_0x4c4f21){_0x54a00b['push'](_0x54a00b['shift']());}};_0x30000d(++_0x3c5e6e);}(_0xce7d,0xa0));var _0xdce7=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xce7d[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0xdce7('0x0'));var util=require(_0xdce7('0x1'));var logger=require(_0xdce7('0x2'))('api');var moment=require(_0xdce7('0x3'));var BPromise=require('bluebird');var rp=require(_0xdce7('0x4'));var fs=require('fs');var path=require(_0xdce7('0x5'));var rimraf=require(_0xdce7('0x6'));var config=require(_0xdce7('0x7'));var attributes=require(_0xdce7('0x8'));module[_0xdce7('0x9')]=function(_0x18fdab,_0xe738a6){return _0x18fdab[_0xdce7('0xa')](_0xdce7('0xb'),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 ad02bf4..5d7d8c6 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 _0xfd3d=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x460666,_0x24bfa0){var _0x555cbf=function(_0x3b4743){while(--_0x3b4743){_0x460666['push'](_0x460666['shift']());}};_0x555cbf(++_0x24bfa0);}(_0xfd3d,0xd2));var _0xdfd3=function(_0x17d78f,_0x3d4bae){_0x17d78f=_0x17d78f-0x0;var _0x30cf70=_0xfd3d[_0x17d78f];return _0x30cf70;};'use strict';var _=require(_0xdfd3('0x0'));var util=require('util');var moment=require(_0xdfd3('0x1'));var BPromise=require(_0xdfd3('0x2'));var rs=require(_0xdfd3('0x3'));var fs=require('fs');var Redis=require(_0xdfd3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdfd3('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xdfd3('0x6'));var jayson=require(_0xdfd3('0x7'));var client=jayson[_0xdfd3('0x8')][_0xdfd3('0x9')]({'port':0x232a});config[_0xdfd3('0xa')]=_[_0xdfd3('0xb')](config['redis'],{'host':_0xdfd3('0xc'),'port':0x18eb});var socket=require(_0xdfd3('0xd'))(new Redis(config[_0xdfd3('0xa')]));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x3b3134,_0x202095,_0x58b351){return new BPromise(function(_0x51a922,_0x380baa){return client[_0xdfd3('0xe')](_0x3b3134,_0x58b351)[_0xdfd3('0xf')](function(_0x1c3897){logger[_0xdfd3('0x10')](_0xdfd3('0x11'),_0x202095,_0xdfd3('0x12'));logger[_0xdfd3('0x13')](_0xdfd3('0x14'),_0x202095,_0xdfd3('0x12'),JSON[_0xdfd3('0x15')](_0x1c3897));if(_0x1c3897['error']){if(_0x1c3897[_0xdfd3('0x16')][_0xdfd3('0x17')]===0x1f4){logger[_0xdfd3('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x202095,_0x1c3897['error'][_0xdfd3('0x18')]);return _0x380baa(_0x1c3897[_0xdfd3('0x16')][_0xdfd3('0x18')]);}logger['error'](_0xdfd3('0x11'),_0x202095,_0x1c3897['error'][_0xdfd3('0x18')]);return _0x51a922(_0x1c3897[_0xdfd3('0x16')][_0xdfd3('0x18')]);}else{logger[_0xdfd3('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x202095,_0xdfd3('0x12'));_0x51a922(_0x1c3897[_0xdfd3('0x19')][_0xdfd3('0x18')]);}})[_0xdfd3('0x1a')](function(_0x5d4976){logger[_0xdfd3('0x16')](_0xdfd3('0x11'),_0x202095,_0x5d4976);_0x380baa(_0x5d4976);});});} \ No newline at end of file +var _0x66bb=['request\x20sent','debug','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s'];(function(_0x3c2863,_0x1b2cee){var _0x2c3d27=function(_0x4f831b){while(--_0x4f831b){_0x3c2863['push'](_0x3c2863['shift']());}};_0x2c3d27(++_0x1b2cee);}(_0x66bb,0x14b));var _0xb66b=function(_0x45416a,_0x50d3ec){_0x45416a=_0x45416a-0x0;var _0x5c24f3=_0x66bb[_0x45416a];return _0x5c24f3;};'use strict';var _=require(_0xb66b('0x0'));var util=require('util');var moment=require(_0xb66b('0x1'));var BPromise=require(_0xb66b('0x2'));var rs=require(_0xb66b('0x3'));var fs=require('fs');var Redis=require(_0xb66b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb66b('0x5'));var logger=require(_0xb66b('0x6'))(_0xb66b('0x7'));var config=require(_0xb66b('0x8'));var jayson=require(_0xb66b('0x9'));var client=jayson['client'][_0xb66b('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xb66b('0xb')],{'host':_0xb66b('0xc'),'port':0x18eb});var socket=require(_0xb66b('0xd'))(new Redis(config[_0xb66b('0xb')]));require(_0xb66b('0xe'))[_0xb66b('0xf')](socket);function respondWithRpcPromise(_0x120bb6,_0x3a02e1,_0x3e7fb4){return new BPromise(function(_0x42e240,_0x39ef0e){return client[_0xb66b('0x10')](_0x120bb6,_0x3e7fb4)[_0xb66b('0x11')](function(_0x107cd9){logger[_0xb66b('0x12')](_0xb66b('0x13'),_0x3a02e1,_0xb66b('0x14'));logger[_0xb66b('0x15')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x3a02e1,'request\x20sent',JSON[_0xb66b('0x16')](_0x107cd9));if(_0x107cd9['error']){if(_0x107cd9[_0xb66b('0x17')]['code']===0x1f4){logger[_0xb66b('0x17')](_0xb66b('0x13'),_0x3a02e1,_0x107cd9[_0xb66b('0x17')][_0xb66b('0x18')]);return _0x39ef0e(_0x107cd9[_0xb66b('0x17')]['message']);}logger[_0xb66b('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x3a02e1,_0x107cd9[_0xb66b('0x17')]['message']);return _0x42e240(_0x107cd9[_0xb66b('0x17')]['message']);}else{logger[_0xb66b('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x3a02e1,_0xb66b('0x14'));_0x42e240(_0x107cd9[_0xb66b('0x19')][_0xb66b('0x18')]);}})[_0xb66b('0x1a')](function(_0x2743e2){logger['error'](_0xb66b('0x13'),_0x3a02e1,_0x2743e2);_0x39ef0e(_0x2743e2);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 2d9a99c..40ab8b3 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 _0xa6f6=['length','./chatWebsite.events','save','remove','removeListener'];(function(_0x2c7784,_0x5aeb33){var _0x204784=function(_0x56cbf5){while(--_0x56cbf5){_0x2c7784['push'](_0x2c7784['shift']());}};_0x204784(++_0x5aeb33);}(_0xa6f6,0x16e));var _0x6a6f=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xa6f6[_0x57b54c];return _0x59cc19;};'use strict';var ChatWebsiteEvents=require(_0x6a6f('0x0'));var events=[_0x6a6f('0x1'),_0x6a6f('0x2'),'update'];function createListener(_0x29df27,_0x2fb640){return function(_0x26f4ac){_0x2fb640['emit'](_0x29df27,_0x26f4ac);};}function removeListener(_0x240163,_0x411707){return function(){ChatWebsiteEvents[_0x6a6f('0x3')](_0x240163,_0x411707);};}exports['register']=function(_0x1a6b34){for(var _0x338154=0x0,_0x5c380a=events[_0x6a6f('0x4')];_0x338154<_0x5c380a;_0x338154++){var _0x303296=events[_0x338154];var _0x532c19=createListener('chatWebsite:'+_0x303296,_0x1a6b34);ChatWebsiteEvents['on'](_0x303296,_0x532c19);}}; \ No newline at end of file +var _0xe5fa=['update','removeListener','length','chatWebsite:','./chatWebsite.events','save','remove'];(function(_0x49c99e,_0x572406){var _0xe3dc55=function(_0x4a5255){while(--_0x4a5255){_0x49c99e['push'](_0x49c99e['shift']());}};_0xe3dc55(++_0x572406);}(_0xe5fa,0x15b));var _0xae5f=function(_0x106342,_0x2a915e){_0x106342=_0x106342-0x0;var _0x58d435=_0xe5fa[_0x106342];return _0x58d435;};'use strict';var ChatWebsiteEvents=require(_0xae5f('0x0'));var events=[_0xae5f('0x1'),_0xae5f('0x2'),_0xae5f('0x3')];function createListener(_0xacb017,_0x4044e7){return function(_0x50e9a8){_0x4044e7['emit'](_0xacb017,_0x50e9a8);};}function removeListener(_0x305d83,_0x4e6dbc){return function(){ChatWebsiteEvents[_0xae5f('0x4')](_0x305d83,_0x4e6dbc);};}exports['register']=function(_0xc0237f){for(var _0x2ce31f=0x0,_0x261066=events[_0xae5f('0x5')];_0x2ce31f<_0x261066;_0x2ce31f++){var _0xc68187=events[_0x2ce31f];var _0x2f0172=createListener(_0xae5f('0x6')+_0xc68187,_0xc0237f);ChatWebsiteEvents['on'](_0xc68187,_0x2f0172);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 2d2f7e8..c5f9a1e 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 _0xeced=['file','addLogo','originalname','addAvatar','server/files/images/avatars/','addCustomerAvatar','addSystemAvatar','/:id/notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','offline','addInteraction','addApplications','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','/:id/users','getAgents','create','addDisposition','post','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','single'];(function(_0x59b41d,_0x2ba427){var _0x13a78d=function(_0x214216){while(--_0x214216){_0x59b41d['push'](_0x59b41d['shift']());}};_0x13a78d(++_0x2ba427);}(_0xeced,0x173));var _0xdece=function(_0x18fe24,_0x329d38){_0x18fe24=_0x18fe24-0x0;var _0x5e0a4d=_0xeced[_0x18fe24];return _0x5e0a4d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xdece('0x0'));var timeout=require(_0xdece('0x1'));var express=require(_0xdece('0x2'));var router=express[_0xdece('0x3')]();var fs_extra=require(_0xdece('0x4'));var auth=require(_0xdece('0x5'));var interaction=require(_0xdece('0x6'));var config=require(_0xdece('0x7'));var controller=require('./chatWebsite.controller');router[_0xdece('0x8')]('/',auth[_0xdece('0x9')](),controller['index']);router[_0xdece('0x8')]('/describe',auth[_0xdece('0x9')](),controller['describe']);router[_0xdece('0x8')](_0xdece('0xa'),auth[_0xdece('0x9')](),controller['show']);router[_0xdece('0x8')](_0xdece('0xb'),auth[_0xdece('0x9')](),controller[_0xdece('0xc')]);router[_0xdece('0x8')](_0xdece('0xd'),auth['isAuthenticated'](),controller['getAnswers']);router[_0xdece('0x8')](_0xdece('0xe'),controller[_0xdece('0xf')]);router[_0xdece('0x8')](_0xdece('0x10'),controller['getAvatar']);router['get'](_0xdece('0x11'),controller['getCustomerAvatar']);router[_0xdece('0x8')](_0xdece('0x12'),controller[_0xdece('0x13')]);router['get'](_0xdece('0x14'),auth[_0xdece('0x9')](),controller[_0xdece('0x15')]);router[_0xdece('0x8')](_0xdece('0x16'),controller[_0xdece('0x17')]);router[_0xdece('0x8')](_0xdece('0x18'),auth[_0xdece('0x9')](),controller['getApplications']);router[_0xdece('0x8')](_0xdece('0x19'),auth[_0xdece('0x9')](),controller[_0xdece('0x1a')]);router[_0xdece('0x8')](_0xdece('0x1b'),controller[_0xdece('0x1c')]);router[_0xdece('0x8')](_0xdece('0x1d'),auth[_0xdece('0x9')](),controller['getOfflineMessages']);router[_0xdece('0x8')](_0xdece('0x1e'),auth[_0xdece('0x9')](),controller[_0xdece('0x1f')]);router['post']('/',auth[_0xdece('0x9')](),controller[_0xdece('0x20')]);router['post'](_0xdece('0xb'),auth[_0xdece('0x9')](),controller[_0xdece('0x21')]);router[_0xdece('0x22')]('/:id/canned_answers',auth[_0xdece('0x9')](),controller['addAnswer']);var upload=multer({'storage':multer[_0xdece('0x23')]({'destination':function(_0x3ffa31,_0x540258,_0xe09e3b){_0xe09e3b(null,path[_0xdece('0x24')](config[_0xdece('0x25')],_0xdece('0x26')));},'filename':function(_0x21cbc5,_0x2450a6,_0x49d169){_0x49d169(null,util[_0xdece('0x27')](_0xdece('0x28'),Date[_0xdece('0x29')](),_0x2450a6['originalname']));}})});router[_0xdece('0x22')](_0xdece('0xe'),upload[_0xdece('0x2a')](_0xdece('0x2b')),controller[_0xdece('0x2c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xc277bd,_0x2670e1,_0x1c71fa){_0x1c71fa(null,path[_0xdece('0x24')](config[_0xdece('0x25')],'server/files/images/avatars/'));},'filename':function(_0x47d911,_0x509fcf,_0x2fe77f){_0x2fe77f(null,util['format'](_0xdece('0x28'),Date[_0xdece('0x29')](),_0x509fcf[_0xdece('0x2d')]));}})});router[_0xdece('0x22')](_0xdece('0x10'),upload[_0xdece('0x2a')](_0xdece('0x2b')),controller[_0xdece('0x2e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x339f89,_0x211a45,_0x20464e){_0x20464e(null,path[_0xdece('0x24')](config[_0xdece('0x25')],_0xdece('0x2f')));},'filename':function(_0x446b64,_0x5f14ff,_0x34a6ed){_0x34a6ed(null,util[_0xdece('0x27')]('%s-%s',Date[_0xdece('0x29')](),_0x5f14ff[_0xdece('0x2d')]));}})});router[_0xdece('0x22')](_0xdece('0x11'),upload[_0xdece('0x2a')](_0xdece('0x2b')),controller[_0xdece('0x30')]);var upload=multer({'storage':multer[_0xdece('0x23')]({'destination':function(_0x3c1cf3,_0x57a647,_0x2e27b6){_0x2e27b6(null,path[_0xdece('0x24')](config['root'],_0xdece('0x2f')));},'filename':function(_0x4535d8,_0xfd1f22,_0x533931){_0x533931(null,util[_0xdece('0x27')](_0xdece('0x28'),Date['now'](),_0xfd1f22[_0xdece('0x2d')]));}})});router[_0xdece('0x22')](_0xdece('0x12'),upload[_0xdece('0x2a')](_0xdece('0x2b')),controller[_0xdece('0x31')]);router[_0xdece('0x22')](_0xdece('0x32'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0xdece('0x23')]({'destination':function(_0x573b4e,_0x2707a3,_0x2a416d){const _0x315b73=path['join'](config[_0xdece('0x25')],_0xdece('0x33'),_0xdece('0x34'),_0xdece('0x35'));fs_extra[_0xdece('0x36')](_0x315b73,function(){_0x2a416d(null,_0x315b73);});},'filename':function(_0x16dd79,_0x59e4f4,_0x3a5333){const _0x34bf7a=_0x59e4f4[_0xdece('0x2d')][_0xdece('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2b8d1f=path[_0xdece('0x38')](_0x34bf7a);const _0x1bc1b6=Date['now']()+'-'+_0x34bf7a[_0xdece('0x37')](_0x2b8d1f,'')+_0x2b8d1f;_0x3a5333(null,_0x1bc1b6);}})});router[_0xdece('0x22')](_0xdece('0x39'),offlineUploadMulter['any'](),controller[_0xdece('0x3a')]);router[_0xdece('0x22')](_0xdece('0x14'),auth[_0xdece('0x9')](),controller[_0xdece('0x3b')]);router[_0xdece('0x22')](_0xdece('0x18'),auth[_0xdece('0x9')](),controller[_0xdece('0x3c')]);router[_0xdece('0x22')](_0xdece('0x19'),auth[_0xdece('0x9')](),controller['addProactiveActions']);router[_0xdece('0x22')]('/:id/users',auth['isAuthenticated'](),controller[_0xdece('0x3d')]);router[_0xdece('0x3e')]('/:id',auth['isAuthenticated'](),controller[_0xdece('0x3f')]);router[_0xdece('0x40')](_0xdece('0xa'),auth[_0xdece('0x9')](),controller[_0xdece('0x41')]);router['delete'](_0xdece('0xb'),auth[_0xdece('0x9')](),controller[_0xdece('0x42')]);router['delete'](_0xdece('0xd'),auth[_0xdece('0x9')](),controller[_0xdece('0x43')]);router[_0xdece('0x40')](_0xdece('0x1e'),auth[_0xdece('0x9')](),controller['removeAgents']);module[_0xdece('0x44')]=router; \ No newline at end of file +var _0x6702=['now','single','file','addLogo','originalname','addAvatar','server/files/images/avatars/','/:id/customer_avatar','addCustomerAvatar','root','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','extname','/:id/offline','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','removeAgents','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','create','post','addDisposition','addAnswer','diskStorage','join','server/files/images/logos/','format','%s-%s'];(function(_0x30d36f,_0x4c0030){var _0x21cc8b=function(_0x6e88a1){while(--_0x6e88a1){_0x30d36f['push'](_0x30d36f['shift']());}};_0x21cc8b(++_0x4c0030);}(_0x6702,0x185));var _0x2670=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x6702[_0x263a74];return _0x2aa86c;};'use strict';var multer=require(_0x2670('0x0'));var util=require(_0x2670('0x1'));var path=require(_0x2670('0x2'));var timeout=require('connect-timeout');var express=require(_0x2670('0x3'));var router=express[_0x2670('0x4')]();var fs_extra=require(_0x2670('0x5'));var auth=require(_0x2670('0x6'));var interaction=require(_0x2670('0x7'));var config=require(_0x2670('0x8'));var controller=require('./chatWebsite.controller');router[_0x2670('0x9')]('/',auth[_0x2670('0xa')](),controller['index']);router['get']('/describe',auth[_0x2670('0xa')](),controller[_0x2670('0xb')]);router[_0x2670('0x9')](_0x2670('0xc'),auth[_0x2670('0xa')](),controller['show']);router[_0x2670('0x9')](_0x2670('0xd'),auth[_0x2670('0xa')](),controller[_0x2670('0xe')]);router[_0x2670('0x9')](_0x2670('0xf'),auth[_0x2670('0xa')](),controller[_0x2670('0x10')]);router[_0x2670('0x9')](_0x2670('0x11'),controller[_0x2670('0x12')]);router[_0x2670('0x9')](_0x2670('0x13'),controller[_0x2670('0x14')]);router[_0x2670('0x9')]('/:id/customer_avatar',controller['getCustomerAvatar']);router[_0x2670('0x9')]('/:id/system_avatar',controller['getSystemAvatar']);router['get'](_0x2670('0x15'),auth['isAuthenticated'](),controller['getInteractions']);router['get'](_0x2670('0x16'),controller[_0x2670('0x17')]);router[_0x2670('0x9')](_0x2670('0x18'),auth[_0x2670('0xa')](),controller[_0x2670('0x19')]);router['get'](_0x2670('0x1a'),auth[_0x2670('0xa')](),controller[_0x2670('0x1b')]);router[_0x2670('0x9')](_0x2670('0x1c'),controller[_0x2670('0x1d')]);router[_0x2670('0x9')](_0x2670('0x1e'),auth[_0x2670('0xa')](),controller[_0x2670('0x1f')]);router[_0x2670('0x9')](_0x2670('0x20'),auth[_0x2670('0xa')](),controller[_0x2670('0x21')]);router['post']('/',auth[_0x2670('0xa')](),controller[_0x2670('0x22')]);router[_0x2670('0x23')]('/:id/dispositions',auth[_0x2670('0xa')](),controller[_0x2670('0x24')]);router[_0x2670('0x23')](_0x2670('0xf'),auth['isAuthenticated'](),controller[_0x2670('0x25')]);var upload=multer({'storage':multer[_0x2670('0x26')]({'destination':function(_0x4c6aa2,_0xb4d795,_0x575e6d){_0x575e6d(null,path[_0x2670('0x27')](config['root'],_0x2670('0x28')));},'filename':function(_0x40d74f,_0x5dfbc7,_0x14b7c7){_0x14b7c7(null,util[_0x2670('0x29')](_0x2670('0x2a'),Date[_0x2670('0x2b')](),_0x5dfbc7['originalname']));}})});router[_0x2670('0x23')]('/:id/logo',upload[_0x2670('0x2c')](_0x2670('0x2d')),controller[_0x2670('0x2e')]);var upload=multer({'storage':multer[_0x2670('0x26')]({'destination':function(_0x1124ef,_0xace628,_0x35b108){_0x35b108(null,path[_0x2670('0x27')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x49b99b,_0x3bcbf3,_0x2e0a37){_0x2e0a37(null,util[_0x2670('0x29')](_0x2670('0x2a'),Date['now'](),_0x3bcbf3[_0x2670('0x2f')]));}})});router[_0x2670('0x23')](_0x2670('0x13'),upload[_0x2670('0x2c')]('file'),controller[_0x2670('0x30')]);var upload=multer({'storage':multer[_0x2670('0x26')]({'destination':function(_0x4c74dd,_0x3f0f59,_0x247181){_0x247181(null,path['join'](config['root'],_0x2670('0x31')));},'filename':function(_0x45a901,_0x13dd0a,_0x37b0d7){_0x37b0d7(null,util[_0x2670('0x29')](_0x2670('0x2a'),Date[_0x2670('0x2b')](),_0x13dd0a[_0x2670('0x2f')]));}})});router[_0x2670('0x23')](_0x2670('0x32'),upload[_0x2670('0x2c')](_0x2670('0x2d')),controller[_0x2670('0x33')]);var upload=multer({'storage':multer[_0x2670('0x26')]({'destination':function(_0x418526,_0x4284ac,_0x443dd3){_0x443dd3(null,path[_0x2670('0x27')](config[_0x2670('0x34')],'server/files/images/avatars/'));},'filename':function(_0x4012e6,_0x48d241,_0x14df5e){_0x14df5e(null,util[_0x2670('0x29')]('%s-%s',Date[_0x2670('0x2b')](),_0x48d241['originalname']));}})});router['post'](_0x2670('0x35'),upload[_0x2670('0x2c')](_0x2670('0x2d')),controller[_0x2670('0x36')]);router[_0x2670('0x23')](_0x2670('0x37'),controller[_0x2670('0x38')]);const offlineUploadMulter=multer({'storage':multer[_0x2670('0x26')]({'destination':function(_0x469684,_0x6e550d,_0x1dc397){const _0x4d30cd=path[_0x2670('0x27')](config[_0x2670('0x34')],_0x2670('0x39'),_0x2670('0x3a'),_0x2670('0x3b'));fs_extra[_0x2670('0x3c')](_0x4d30cd,function(){_0x1dc397(null,_0x4d30cd);});},'filename':function(_0x43d034,_0x4f940c,_0x2305c1){const _0x1e483c=_0x4f940c['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x51fa57=path[_0x2670('0x3d')](_0x1e483c);const _0x2f3452=Date[_0x2670('0x2b')]()+'-'+_0x1e483c['replace'](_0x51fa57,'')+_0x51fa57;_0x2305c1(null,_0x2f3452);}})});router[_0x2670('0x23')](_0x2670('0x3e'),offlineUploadMulter['any'](),controller[_0x2670('0x3f')]);router[_0x2670('0x23')](_0x2670('0x15'),auth['isAuthenticated'](),controller[_0x2670('0x40')]);router[_0x2670('0x23')]('/:id/applications',auth[_0x2670('0xa')](),controller[_0x2670('0x41')]);router['post']('/:id/proactive_actions',auth[_0x2670('0xa')](),controller[_0x2670('0x42')]);router[_0x2670('0x23')](_0x2670('0x20'),auth[_0x2670('0xa')](),controller[_0x2670('0x43')]);router[_0x2670('0x44')]('/:id',auth['isAuthenticated'](),controller[_0x2670('0x45')]);router[_0x2670('0x46')](_0x2670('0xc'),auth[_0x2670('0xa')](),controller['destroy']);router[_0x2670('0x46')](_0x2670('0xd'),auth[_0x2670('0xa')](),controller['removeDispositions']);router[_0x2670('0x46')](_0x2670('0xf'),auth[_0x2670('0xa')](),controller['removeAnswers']);router['delete'](_0x2670('0x20'),auth['isAuthenticated'](),controller[_0x2670('0x47')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index c473aee..25dcb1e 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 _0x421b=['../config/environment','Router','env','production','app','get','Client-Side\x20logger\x20not\x20found!','/client-logs','use','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service'];(function(_0x380be3,_0x6933dc){var _0x229661=function(_0x13d961){while(--_0x13d961){_0x380be3['push'](_0x380be3['shift']());}};_0x229661(++_0x6933dc);}(_0x421b,0xeb));var _0xb421=function(_0x313d6f,_0x122c8d){_0x313d6f=_0x313d6f-0x0;var _0x2059ac=_0x421b[_0x313d6f];return _0x2059ac;};var beaverLogger=require(_0xb421('0x0'));var express=require(_0xb421('0x1'));var auth=require(_0xb421('0x2'));var config=require(_0xb421('0x3'));var router=express[_0xb421('0x4')]();var isProduction=config[_0xb421('0x5')]===_0xb421('0x6')||![];function clientSideLogs(_0x59f283,_0x455122,_0x1da5b5){var _0x5c5fd0=_0x59f283[_0xb421('0x7')][_0xb421('0x8')]('client-side-logger');if(!_0x5c5fd0){throw new Error(_0xb421('0x9'));}return beaverLogger['expressEndpoint']({'uri':_0xb421('0xa'),'logger':_0x5c5fd0,'enableCors':!isProduction})(_0x59f283,_0x455122,_0x1da5b5);}router[_0xb421('0xb')](auth[_0xb421('0xc')](),clientSideLogs);module[_0xb421('0xd')]=router; \ No newline at end of file +var _0xc3bb=['../components/auth/service','../config/environment','Router','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','/client-logs','use','isAuthenticated','express'];(function(_0x1bad8a,_0x4a160f){var _0xfa3b6b=function(_0x1abb3a){while(--_0x1abb3a){_0x1bad8a['push'](_0x1bad8a['shift']());}};_0xfa3b6b(++_0x4a160f);}(_0xc3bb,0xe3));var _0xbc3b=function(_0x1acc9d,_0x196df7){_0x1acc9d=_0x1acc9d-0x0;var _0x8f04f1=_0xc3bb[_0x1acc9d];return _0x8f04f1;};var beaverLogger=require('beaver-logger/server');var express=require(_0xbc3b('0x0'));var auth=require(_0xbc3b('0x1'));var config=require(_0xbc3b('0x2'));var router=express[_0xbc3b('0x3')]();var isProduction=config['env']===_0xbc3b('0x4')||![];function clientSideLogs(_0xfc6f52,_0x4102a1,_0x1beacb){var _0x4e6a92=_0xfc6f52[_0xbc3b('0x5')][_0xbc3b('0x6')](_0xbc3b('0x7'));if(!_0x4e6a92){throw new Error(_0xbc3b('0x8'));}return beaverLogger['expressEndpoint']({'uri':_0xbc3b('0x9'),'logger':_0x4e6a92,'enableCors':!isProduction})(_0xfc6f52,_0x4102a1,_0x1beacb);}router[_0xbc3b('0xa')](auth[_0xbc3b('0xb')](),clientSideLogs);module['exports']=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 20bfc06..927e96d 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 _0x5964=['ENUM','AmazonAWS','MicrosoftAzure','Outlook365','Dynamics365','STRING','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x5964,0x7c));var _0x4596=function(_0x501732,_0x53aaa0){_0x501732=_0x501732-0x0;var _0x588ae8=_0x5964[_0x501732];return _0x588ae8;};'use strict';var Sequelize=require(_0x4596('0x0'));module[_0x4596('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x4596('0x2')](_0x4596('0x3'),'Google',_0x4596('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x4596('0x2')](_0x4596('0x5'),_0x4596('0x6'))},'data1':{'type':Sequelize[_0x4596('0x7')],'comment':_0x4596('0x8')},'data2':{'type':Sequelize[_0x4596('0x7')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x4596('0x7')],'comment':_0x4596('0x9')},'data4':{'type':Sequelize['STRING'],'comment':_0x4596('0xa')},'data5':{'type':Sequelize[_0x4596('0xb')],'comment':_0x4596('0xc')},'data6':{'type':Sequelize[_0x4596('0xb')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x4596('0xb')],'comment':_0x4596('0xd')}}; \ No newline at end of file +var _0x5380=['MicrosoftAzure\x20=>\x20refresh_token','sequelize','exports','ENUM','AmazonAWS','MicrosoftAzure','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','STRING','MicrosoftAzure\x20=>\x20redirect_uri','TEXT'];(function(_0x173f10,_0x35db61){var _0x53142d=function(_0x37bbef){while(--_0x37bbef){_0x173f10['push'](_0x173f10['shift']());}};_0x53142d(++_0x35db61);}(_0x5380,0xb1));var _0x0538=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x5380[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0x0538('0x0'));module[_0x0538('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x0538('0x2')](_0x0538('0x3'),'Google',_0x0538('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('Outlook365','Dynamics365')},'data1':{'type':Sequelize['STRING'],'comment':_0x0538('0x5')},'data2':{'type':Sequelize['STRING'],'comment':_0x0538('0x6')},'data3':{'type':Sequelize[_0x0538('0x7')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x0538('0x7')],'comment':_0x0538('0x8')},'data5':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0x0538('0x9')],'comment':_0x0538('0xa')},'data7':{'type':Sequelize[_0x0538('0x9')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 78f5f0e..ebe2aab 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 _0x22eb=['get','state','Invalid\x20state\x20parameter','parse','from','base64','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','data5','refresh_token','data6','startRefreshInterval','emit','send','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','end','json','undefined','limit','count','offset','status','then','error','name','padEnd','index','CloudProvider','rawAttributes','fieldName','key','model','map','keys','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','params','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','update','find','destroy','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x22eb,0x1d6));var _0xb22e=function(_0x4eab68,_0x1aad06){_0x4eab68=_0x4eab68-0x0;var _0x2528ba=_0x22eb[_0x4eab68];return _0x2528ba;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require(_0xb22e('0x0'));var encryptor=require(_0xb22e('0x1'));var config=require(_0xb22e('0x2'));var logger=require(_0xb22e('0x3'))(_0xb22e('0x4'));var db=require(_0xb22e('0x5'))['db'];var oauth=require(_0xb22e('0x6'));config[_0xb22e('0x7')]=_[_0xb22e('0x8')](config[_0xb22e('0x7')],{'host':_0xb22e('0x9'),'port':0x18eb});var socket=require(_0xb22e('0xa'))(new Redis(config[_0xb22e('0x7')]));var redis=new Redis(config[_0xb22e('0x7')]);function respondWithStatusCode(_0x8c030b,_0x375e74){_0x375e74=_0x375e74||0xcc;return function(_0x54803a){if(_0x54803a){return _0x8c030b[_0xb22e('0xb')](_0x375e74);}return _0x8c030b['status'](_0x375e74)[_0xb22e('0xc')]();};}function respondWithResult(_0x255af6,_0x17b730){_0x17b730=_0x17b730||0xc8;return function(_0x3c1054){if(_0x3c1054){return _0x255af6['status'](_0x17b730)[_0xb22e('0xd')](_0x3c1054);}};}function respondWithFilteredResult(_0x3686f5,_0x280129){return function(_0x12c888){if(_0x12c888){var _0xb34291=typeof _0x280129['offset']===_0xb22e('0xe')&&typeof _0x280129[_0xb22e('0xf')]===_0xb22e('0xe');var _0x378922=_0x12c888[_0xb22e('0x10')];var _0x58b21c=_0xb34291?0x0:_0x280129[_0xb22e('0x11')];var _0xdf92b3=_0xb34291?_0x12c888[_0xb22e('0x10')]:_0x280129[_0xb22e('0x11')]+_0x280129[_0xb22e('0xf')];var _0x51cc13;if(_0xdf92b3>=_0x378922){_0xdf92b3=_0x378922;_0x51cc13=0xc8;}else{_0x51cc13=0xce;}_0x3686f5[_0xb22e('0x12')](_0x51cc13);return _0x3686f5['set']('Content-Range',_0x58b21c+'-'+_0xdf92b3+'/'+_0x378922)[_0xb22e('0xd')](_0x12c888);}return null;};}function saveUpdates(_0x5c177b){return function(_0x2708db){if(_0x2708db){return _0x2708db['update'](_0x5c177b)['then'](function(_0x46f1d8){return _0x46f1d8;});}return null;};}function removeEntity(_0x330bdc){return function(_0x3ae7ce){if(_0x3ae7ce){return _0x3ae7ce['destroy']()[_0xb22e('0x13')](function(){_0x330bdc['status'](0xcc)[_0xb22e('0xc')]();});}};}function handleEntityNotFound(_0x4b80a4){return function(_0x2fbf0f){if(!_0x2fbf0f){_0x4b80a4['sendStatus'](0x194);}return _0x2fbf0f;};}function handleError(_0x579c71,_0x1fbc1b){_0x1fbc1b=_0x1fbc1b||0x1f4;return function(_0x221d51){logger[_0xb22e('0x14')](_0x221d51['stack']);if(_0x221d51[_0xb22e('0x15')]){delete _0x221d51[_0xb22e('0x15')];}_0x579c71[_0xb22e('0x12')](_0x1fbc1b)['send'](_0x221d51);};}function maskClientSecret(_0x42465a){return _[_0xb22e('0x16')](_0x42465a['slice'](0x0,0x3),0x14,'*');}exports[_0xb22e('0x17')]=function(_0x577d02,_0x47fee3){var _0x2dacfa={},_0x204d47={},_0x216692={'count':0x0,'rows':[]};var _0x53e2fa=_['map'](db[_0xb22e('0x18')][_0xb22e('0x19')],function(_0x6eb6ce){return{'name':_0x6eb6ce[_0xb22e('0x1a')],'type':_0x6eb6ce['type'][_0xb22e('0x1b')]};});_0x204d47[_0xb22e('0x1c')]=_[_0xb22e('0x1d')](_0x53e2fa,_0xb22e('0x15'));_0x204d47['query']=_[_0xb22e('0x1e')](_0x577d02[_0xb22e('0x1f')]);_0x204d47['filters']=_['intersection'](_0x204d47[_0xb22e('0x1c')],_0x204d47[_0xb22e('0x1f')]);_0x2dacfa[_0xb22e('0x20')]=_[_0xb22e('0x21')](_0x204d47[_0xb22e('0x1c')],qs[_0xb22e('0x22')](_0x577d02[_0xb22e('0x1f')]['fields']));_0x2dacfa[_0xb22e('0x20')]=_0x2dacfa[_0xb22e('0x20')][_0xb22e('0x23')]?_0x2dacfa[_0xb22e('0x20')]:_0x204d47[_0xb22e('0x1c')];if(!_0x577d02[_0xb22e('0x1f')][_0xb22e('0x24')]('nolimit')){_0x2dacfa[_0xb22e('0xf')]=qs[_0xb22e('0xf')](_0x577d02['query'][_0xb22e('0xf')]);_0x2dacfa[_0xb22e('0x11')]=qs[_0xb22e('0x11')](_0x577d02[_0xb22e('0x1f')]['offset']);}_0x2dacfa[_0xb22e('0x25')]=qs[_0xb22e('0x26')](_0x577d02[_0xb22e('0x1f')][_0xb22e('0x26')]);_0x2dacfa[_0xb22e('0x27')]=qs[_0xb22e('0x28')](_['pick'](_0x577d02[_0xb22e('0x1f')],_0x204d47[_0xb22e('0x28')]),_0x53e2fa);if(_0x577d02[_0xb22e('0x1f')]['filter']){_0x2dacfa['where']=_['merge'](_0x2dacfa[_0xb22e('0x27')],{'$or':_[_0xb22e('0x1d')](_0x53e2fa,function(_0x167d49){if(_0x167d49['type']!==_0xb22e('0x29')){var _0x5b88ef={};_0x5b88ef[_0x167d49[_0xb22e('0x15')]]={'$like':'%'+_0x577d02[_0xb22e('0x1f')][_0xb22e('0x2a')]+'%'};return _0x5b88ef;}})});}_0x2dacfa=_[_0xb22e('0x2b')]({},_0x2dacfa,_0x577d02[_0xb22e('0x2c')]);var _0x155722={'where':_0x2dacfa[_0xb22e('0x27')]};return db[_0xb22e('0x18')][_0xb22e('0x10')](_0x155722)['then'](function(_0x427ad2){_0x216692[_0xb22e('0x10')]=_0x427ad2;if(_0x577d02['query'][_0xb22e('0x2d')]){_0x2dacfa[_0xb22e('0x2e')]=[{'all':!![]}];}return db['CloudProvider'][_0xb22e('0x2f')](_0x2dacfa);})[_0xb22e('0x13')](function(_0x3c9dad){_0x216692[_0xb22e('0x30')]=_[_0xb22e('0x1d')](_0x3c9dad,function(_0x2c023b){if(_0x2c023b[_0xb22e('0x31')]===_0xb22e('0x32')){var _0x5642e3=encryptor[_0xb22e('0x33')](_0x2c023b['data3']);_0x2c023b[_0xb22e('0x34')]=maskClientSecret(_0x5642e3);}return _0x2c023b;});return _0x216692;})['then'](respondWithFilteredResult(_0x47fee3,_0x2dacfa))[_0xb22e('0x35')](handleError(_0x47fee3,null));};exports['show']=function(_0xcd4d43,_0x42a58b){var _0x51be93={'raw':!![],'where':{'id':_0xcd4d43[_0xb22e('0x36')]['id']}},_0x9d329c={};_0x9d329c[_0xb22e('0x1c')]=_[_0xb22e('0x1e')](db[_0xb22e('0x18')][_0xb22e('0x19')]);_0x9d329c[_0xb22e('0x1f')]=_['keys'](_0xcd4d43[_0xb22e('0x1f')]);_0x9d329c[_0xb22e('0x28')]=_[_0xb22e('0x21')](_0x9d329c[_0xb22e('0x1c')],_0x9d329c['query']);_0x51be93[_0xb22e('0x20')]=_[_0xb22e('0x21')](_0x9d329c[_0xb22e('0x1c')],qs[_0xb22e('0x22')](_0xcd4d43[_0xb22e('0x1f')][_0xb22e('0x22')]));_0x51be93[_0xb22e('0x20')]=_0x51be93[_0xb22e('0x20')]['length']?_0x51be93[_0xb22e('0x20')]:_0x9d329c['model'];if(_0xcd4d43['query'][_0xb22e('0x2d')]){_0x51be93[_0xb22e('0x2e')]=[{'all':!![]}];}_0x51be93=_[_0xb22e('0x2b')]({},_0x51be93,_0xcd4d43['options']);return db[_0xb22e('0x18')]['find'](_0x51be93)[_0xb22e('0x13')](handleEntityNotFound(_0x42a58b,null))[_0xb22e('0x13')](function(_0x321333){if(_0x321333[_0xb22e('0x31')]===_0xb22e('0x32')){var _0xbb4318=encryptor[_0xb22e('0x33')](_0x321333[_0xb22e('0x34')]);_0x321333[_0xb22e('0x34')]=maskClientSecret(_0xbb4318);}return _0x321333;})[_0xb22e('0x13')](respondWithResult(_0x42a58b,null))[_0xb22e('0x35')](handleError(_0x42a58b,null));};exports[_0xb22e('0x37')]=function(_0x5a5c46,_0x1dacea){if(!_0x5a5c46[_0xb22e('0x38')][_0xb22e('0x15')])throw new Error(_0xb22e('0x39'));if(!_0x5a5c46['body'][_0xb22e('0x31')])throw new Error(_0xb22e('0x3a'));var _0x225a49=db[_0xb22e('0x18')][_0xb22e('0x19')][_0xb22e('0x31')][_0xb22e('0x3b')];if(!_0x225a49['includes'](_0x5a5c46['body'][_0xb22e('0x31')]))throw new Error(_0xb22e('0x3c')+_0x225a49['join'](',\x20'));if(_0x5a5c46[_0xb22e('0x38')][_0xb22e('0x31')]==='MicrosoftAzure'&&_0x5a5c46[_0xb22e('0x38')][_0xb22e('0x34')]){_0x5a5c46[_0xb22e('0x38')][_0xb22e('0x34')]=encryptor[_0xb22e('0x3d')](_0x5a5c46[_0xb22e('0x38')][_0xb22e('0x34')]);}return db['CloudProvider'][_0xb22e('0x37')](_0x5a5c46[_0xb22e('0x38')],{})[_0xb22e('0x13')](respondWithResult(_0x1dacea,0xc9))[_0xb22e('0x35')](handleError(_0x1dacea,null));};exports[_0xb22e('0x3e')]=function(_0x34695a,_0x3c7148){if(_0x34695a['body']['id']){delete _0x34695a[_0xb22e('0x38')]['id'];}return db[_0xb22e('0x18')][_0xb22e('0x3f')]({'where':{'id':_0x34695a[_0xb22e('0x36')]['id']}})[_0xb22e('0x13')](handleEntityNotFound(_0x3c7148,null))[_0xb22e('0x13')](function(_0x4b18cb){if(_0x4b18cb['service']===_0xb22e('0x32')&&_0x34695a[_0xb22e('0x38')][_0xb22e('0x34')]){_0x34695a[_0xb22e('0x38')][_0xb22e('0x34')]=encryptor[_0xb22e('0x3d')](_0x34695a['body']['data3']);}return _0x4b18cb;})['then'](saveUpdates(_0x34695a[_0xb22e('0x38')],null))[_0xb22e('0x13')](respondWithResult(_0x3c7148,null))[_0xb22e('0x35')](handleError(_0x3c7148,null));};exports[_0xb22e('0x40')]=function(_0x5905b3,_0x127455){return db[_0xb22e('0x18')][_0xb22e('0x3f')]({'where':{'id':_0x5905b3[_0xb22e('0x36')]['id']}})['then'](handleEntityNotFound(_0x127455,null))[_0xb22e('0x13')](removeEntity(_0x127455,null))[_0xb22e('0x35')](handleError(_0x127455,null));};exports[_0xb22e('0x41')]=function(_0x2931f3,_0x5be216){return db[_0xb22e('0x18')][_0xb22e('0x42')]({'where':{'id':_0x2931f3[_0xb22e('0x36')]['id']},'raw':!![]})[_0xb22e('0x13')](function(_0x550c04){if(!_0x550c04)return _0x5be216['sendStatus'](0x194);return{'url':oauth[_0xb22e('0x43')](_0x550c04,_0x2931f3[_0xb22e('0x44')]['id'])};})[_0xb22e('0x13')](respondWithResult(_0x5be216,null))[_0xb22e('0x35')](handleError(_0x5be216,null));};exports[_0xb22e('0x45')]=function(_0x35655a,_0x414a36){var _0x278735=_0x35655a[_0xb22e('0x38')];var _0x402044;var _0x434aba;if(_0x278735['error'])throw _0x278735;redis[_0xb22e('0x46')](_0x278735[_0xb22e('0x47')])[_0xb22e('0x13')](function(_0x26ba5f){if(!_0x26ba5f)throw new Error(_0xb22e('0x48'));_0x402044=JSON[_0xb22e('0x49')](_0x26ba5f);var _0x17dcd2=Buffer[_0xb22e('0x4a')](_0x278735[_0xb22e('0x47')],_0xb22e('0x4b'))['toString']('ascii');_0x434aba=JSON[_0xb22e('0x49')](_0x17dcd2);if(!oauth['isValidIdToken'](_0x278735[_0xb22e('0x4c')],_0x402044[_0xb22e('0x4d')]))throw new Error(_0xb22e('0x4e'));redis[_0xb22e('0x4f')](_0x278735[_0xb22e('0x47')]);return oauth[_0xb22e('0x50')](_0x278735['code'],_0x402044);})[_0xb22e('0x13')](function(_0x21dfda){_0x402044[_0xb22e('0x51')]=_0x21dfda['access_token'];_0x402044['data6']=_0x21dfda[_0xb22e('0x52')];return db[_0xb22e('0x18')][_0xb22e('0x3e')]({'data5':_0x402044[_0xb22e('0x51')],'data6':_0x402044[_0xb22e('0x53')]},{'where':{'id':_0x402044['id']}});})[_0xb22e('0x13')](function(){oauth[_0xb22e('0x54')](_0x402044);socket[_0xb22e('0x55')]('microsoftAuthorization:success',{'id':_0x434aba['id']});return;})[_0xb22e('0x13')](respondWithStatusCode(_0x414a36,null))[_0xb22e('0x35')](function(_0x5a24ff){if(_0x434aba){socket[_0xb22e('0x55')]('microsoftAuthorization:error',{'id':_0x434aba['id']});}if(!_0x402044){logger['error']('Invalid\x20authentication\x20state\x20parameter',_0x5a24ff);return _0x414a36[_0xb22e('0x12')](0x1f4)[_0xb22e('0x56')](_0x5a24ff[_0xb22e('0x57')]);}logger['error'](_0xb22e('0x58'),_0x402044['id'],JSON[_0xb22e('0x59')](_0x5a24ff));});}; \ No newline at end of file +var _0x2871=['include','findAll','MicrosoftAzure','decryptString','data3','catch','show','rawAttributes','options','find','service','body','Name\x20parameter\x20not\x20specified','values','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','create','params','oauth2MicrosoftAuthorize','findOne','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','access_token','refresh_token','data5','startRefreshInterval','microsoftAuthorization:success','microsoftAuthorization:error','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','api','./cloudProvider.oauth','redis','defaults','localhost','status','end','offset','undefined','count','limit','set','Content-Range','update','then','destroy','sendStatus','error','stack','name','send','slice','index','map','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','CloudProvider','includeAll'];(function(_0x392a01,_0x220367){var _0x2280a7=function(_0x3dedcd){while(--_0x3dedcd){_0x392a01['push'](_0x392a01['shift']());}};_0x2280a7(++_0x220367);}(_0x2871,0x1e3));var _0x1287=function(_0x8b3c4,_0x429c10){_0x8b3c4=_0x8b3c4-0x0;var _0xa4bdc1=_0x2871[_0x8b3c4];return _0xa4bdc1;};'use strict';var _=require(_0x1287('0x0'));var Redis=require(_0x1287('0x1'));var qs=require(_0x1287('0x2'));var encryptor=require(_0x1287('0x3'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0x1287('0x4'));var db=require('../../mysqldb')['db'];var oauth=require(_0x1287('0x5'));config[_0x1287('0x6')]=_[_0x1287('0x7')](config[_0x1287('0x6')],{'host':_0x1287('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x16eb92,_0x26f8fc){_0x26f8fc=_0x26f8fc||0xcc;return function(_0x482e51){if(_0x482e51){return _0x16eb92['sendStatus'](_0x26f8fc);}return _0x16eb92[_0x1287('0x9')](_0x26f8fc)[_0x1287('0xa')]();};}function respondWithResult(_0x3f10a0,_0x425591){_0x425591=_0x425591||0xc8;return function(_0x318b9d){if(_0x318b9d){return _0x3f10a0['status'](_0x425591)['json'](_0x318b9d);}};}function respondWithFilteredResult(_0x3addc0,_0x335f42){return function(_0x37db04){if(_0x37db04){var _0xb54f0b=typeof _0x335f42[_0x1287('0xb')]===_0x1287('0xc')&&typeof _0x335f42['limit']==='undefined';var _0x26ac9c=_0x37db04[_0x1287('0xd')];var _0x472c06=_0xb54f0b?0x0:_0x335f42[_0x1287('0xb')];var _0x35b071=_0xb54f0b?_0x37db04['count']:_0x335f42['offset']+_0x335f42[_0x1287('0xe')];var _0x21a1be;if(_0x35b071>=_0x26ac9c){_0x35b071=_0x26ac9c;_0x21a1be=0xc8;}else{_0x21a1be=0xce;}_0x3addc0['status'](_0x21a1be);return _0x3addc0[_0x1287('0xf')](_0x1287('0x10'),_0x472c06+'-'+_0x35b071+'/'+_0x26ac9c)['json'](_0x37db04);}return null;};}function saveUpdates(_0xa9e0e5){return function(_0x35329f){if(_0x35329f){return _0x35329f[_0x1287('0x11')](_0xa9e0e5)[_0x1287('0x12')](function(_0x29d4ec){return _0x29d4ec;});}return null;};}function removeEntity(_0x195a06){return function(_0x191de6){if(_0x191de6){return _0x191de6[_0x1287('0x13')]()['then'](function(){_0x195a06[_0x1287('0x9')](0xcc)[_0x1287('0xa')]();});}};}function handleEntityNotFound(_0x4f581a){return function(_0x455bb4){if(!_0x455bb4){_0x4f581a[_0x1287('0x14')](0x194);}return _0x455bb4;};}function handleError(_0xaa9a98,_0x56caad){_0x56caad=_0x56caad||0x1f4;return function(_0x9944aa){logger[_0x1287('0x15')](_0x9944aa[_0x1287('0x16')]);if(_0x9944aa[_0x1287('0x17')]){delete _0x9944aa[_0x1287('0x17')];}_0xaa9a98[_0x1287('0x9')](_0x56caad)[_0x1287('0x18')](_0x9944aa);};}function maskClientSecret(_0x546679){return _['padEnd'](_0x546679[_0x1287('0x19')](0x0,0x3),0x14,'*');}exports[_0x1287('0x1a')]=function(_0x18cd75,_0x2f1f33){var _0xc39406={},_0x198c6d={},_0x13592e={'count':0x0,'rows':[]};var _0x17a7a2=_[_0x1287('0x1b')](db['CloudProvider']['rawAttributes'],function(_0x2ba288){return{'name':_0x2ba288['fieldName'],'type':_0x2ba288[_0x1287('0x1c')]['key']};});_0x198c6d[_0x1287('0x1d')]=_[_0x1287('0x1b')](_0x17a7a2,_0x1287('0x17'));_0x198c6d[_0x1287('0x1e')]=_[_0x1287('0x1f')](_0x18cd75[_0x1287('0x1e')]);_0x198c6d[_0x1287('0x20')]=_[_0x1287('0x21')](_0x198c6d[_0x1287('0x1d')],_0x198c6d[_0x1287('0x1e')]);_0xc39406[_0x1287('0x22')]=_[_0x1287('0x21')](_0x198c6d[_0x1287('0x1d')],qs[_0x1287('0x23')](_0x18cd75[_0x1287('0x1e')][_0x1287('0x23')]));_0xc39406[_0x1287('0x22')]=_0xc39406[_0x1287('0x22')]['length']?_0xc39406[_0x1287('0x22')]:_0x198c6d[_0x1287('0x1d')];if(!_0x18cd75[_0x1287('0x1e')][_0x1287('0x24')](_0x1287('0x25'))){_0xc39406['limit']=qs[_0x1287('0xe')](_0x18cd75['query'][_0x1287('0xe')]);_0xc39406[_0x1287('0xb')]=qs[_0x1287('0xb')](_0x18cd75['query'][_0x1287('0xb')]);}_0xc39406[_0x1287('0x26')]=qs[_0x1287('0x27')](_0x18cd75[_0x1287('0x1e')]['sort']);_0xc39406[_0x1287('0x28')]=qs[_0x1287('0x20')](_['pick'](_0x18cd75[_0x1287('0x1e')],_0x198c6d[_0x1287('0x20')]),_0x17a7a2);if(_0x18cd75[_0x1287('0x1e')][_0x1287('0x29')]){_0xc39406['where']=_['merge'](_0xc39406[_0x1287('0x28')],{'$or':_[_0x1287('0x1b')](_0x17a7a2,function(_0x5de6c4){if(_0x5de6c4[_0x1287('0x1c')]!=='VIRTUAL'){var _0x1e477b={};_0x1e477b[_0x5de6c4['name']]={'$like':'%'+_0x18cd75[_0x1287('0x1e')][_0x1287('0x29')]+'%'};return _0x1e477b;}})});}_0xc39406=_[_0x1287('0x2a')]({},_0xc39406,_0x18cd75['options']);var _0x49916c={'where':_0xc39406[_0x1287('0x28')]};return db[_0x1287('0x2b')]['count'](_0x49916c)[_0x1287('0x12')](function(_0x2cb61f){_0x13592e[_0x1287('0xd')]=_0x2cb61f;if(_0x18cd75['query'][_0x1287('0x2c')]){_0xc39406[_0x1287('0x2d')]=[{'all':!![]}];}return db['CloudProvider'][_0x1287('0x2e')](_0xc39406);})[_0x1287('0x12')](function(_0x1df04f){_0x13592e['rows']=_[_0x1287('0x1b')](_0x1df04f,function(_0x1da633){if(_0x1da633['service']===_0x1287('0x2f')){var _0x456d0b=encryptor[_0x1287('0x30')](_0x1da633[_0x1287('0x31')]);_0x1da633[_0x1287('0x31')]=maskClientSecret(_0x456d0b);}return _0x1da633;});return _0x13592e;})[_0x1287('0x12')](respondWithFilteredResult(_0x2f1f33,_0xc39406))[_0x1287('0x32')](handleError(_0x2f1f33,null));};exports[_0x1287('0x33')]=function(_0x4c399a,_0x2384d1){var _0x15a75e={'raw':!![],'where':{'id':_0x4c399a['params']['id']}},_0x31fb6f={};_0x31fb6f[_0x1287('0x1d')]=_[_0x1287('0x1f')](db[_0x1287('0x2b')][_0x1287('0x34')]);_0x31fb6f[_0x1287('0x1e')]=_[_0x1287('0x1f')](_0x4c399a['query']);_0x31fb6f[_0x1287('0x20')]=_[_0x1287('0x21')](_0x31fb6f[_0x1287('0x1d')],_0x31fb6f[_0x1287('0x1e')]);_0x15a75e[_0x1287('0x22')]=_['intersection'](_0x31fb6f['model'],qs[_0x1287('0x23')](_0x4c399a[_0x1287('0x1e')][_0x1287('0x23')]));_0x15a75e[_0x1287('0x22')]=_0x15a75e[_0x1287('0x22')]['length']?_0x15a75e[_0x1287('0x22')]:_0x31fb6f[_0x1287('0x1d')];if(_0x4c399a[_0x1287('0x1e')][_0x1287('0x2c')]){_0x15a75e['include']=[{'all':!![]}];}_0x15a75e=_[_0x1287('0x2a')]({},_0x15a75e,_0x4c399a[_0x1287('0x35')]);return db['CloudProvider'][_0x1287('0x36')](_0x15a75e)[_0x1287('0x12')](handleEntityNotFound(_0x2384d1,null))[_0x1287('0x12')](function(_0x3ca57f){if(_0x3ca57f[_0x1287('0x37')]==='MicrosoftAzure'){var _0x247a88=encryptor[_0x1287('0x30')](_0x3ca57f[_0x1287('0x31')]);_0x3ca57f[_0x1287('0x31')]=maskClientSecret(_0x247a88);}return _0x3ca57f;})[_0x1287('0x12')](respondWithResult(_0x2384d1,null))[_0x1287('0x32')](handleError(_0x2384d1,null));};exports['create']=function(_0x4a1f26,_0x3cc2bc){if(!_0x4a1f26[_0x1287('0x38')][_0x1287('0x17')])throw new Error(_0x1287('0x39'));if(!_0x4a1f26[_0x1287('0x38')]['service'])throw new Error('Service\x20parameter\x20not\x20specified');var _0x3c46a9=db[_0x1287('0x2b')]['rawAttributes'][_0x1287('0x37')][_0x1287('0x3a')];if(!_0x3c46a9['includes'](_0x4a1f26[_0x1287('0x38')][_0x1287('0x37')]))throw new Error(_0x1287('0x3b')+_0x3c46a9['join'](',\x20'));if(_0x4a1f26[_0x1287('0x38')][_0x1287('0x37')]===_0x1287('0x2f')&&_0x4a1f26['body'][_0x1287('0x31')]){_0x4a1f26[_0x1287('0x38')][_0x1287('0x31')]=encryptor[_0x1287('0x3c')](_0x4a1f26[_0x1287('0x38')][_0x1287('0x31')]);}return db[_0x1287('0x2b')][_0x1287('0x3d')](_0x4a1f26[_0x1287('0x38')],{})[_0x1287('0x12')](respondWithResult(_0x3cc2bc,0xc9))[_0x1287('0x32')](handleError(_0x3cc2bc,null));};exports[_0x1287('0x11')]=function(_0x1cb407,_0x4f1748){if(_0x1cb407[_0x1287('0x38')]['id']){delete _0x1cb407['body']['id'];}return db[_0x1287('0x2b')]['find']({'where':{'id':_0x1cb407[_0x1287('0x3e')]['id']}})['then'](handleEntityNotFound(_0x4f1748,null))[_0x1287('0x12')](function(_0xb33870){if(_0xb33870[_0x1287('0x37')]===_0x1287('0x2f')&&_0x1cb407[_0x1287('0x38')][_0x1287('0x31')]){_0x1cb407[_0x1287('0x38')]['data3']=encryptor['encryptString'](_0x1cb407['body'][_0x1287('0x31')]);}return _0xb33870;})[_0x1287('0x12')](saveUpdates(_0x1cb407[_0x1287('0x38')],null))[_0x1287('0x12')](respondWithResult(_0x4f1748,null))[_0x1287('0x32')](handleError(_0x4f1748,null));};exports[_0x1287('0x13')]=function(_0x301132,_0x2839e3){return db['CloudProvider']['find']({'where':{'id':_0x301132['params']['id']}})[_0x1287('0x12')](handleEntityNotFound(_0x2839e3,null))[_0x1287('0x12')](removeEntity(_0x2839e3,null))[_0x1287('0x32')](handleError(_0x2839e3,null));};exports[_0x1287('0x3f')]=function(_0x2d5b36,_0x2a008a){return db[_0x1287('0x2b')][_0x1287('0x40')]({'where':{'id':_0x2d5b36[_0x1287('0x3e')]['id']},'raw':!![]})['then'](function(_0x16cd0b){if(!_0x16cd0b)return _0x2a008a[_0x1287('0x14')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x16cd0b,_0x2d5b36['user']['id'])};})[_0x1287('0x12')](respondWithResult(_0x2a008a,null))[_0x1287('0x32')](handleError(_0x2a008a,null));};exports['oauth2MicrosoftCallback']=function(_0x48a392,_0x5af4e6){var _0x3ad97e=_0x48a392[_0x1287('0x38')];var _0x1da0d1;var _0x24eb9a;if(_0x3ad97e[_0x1287('0x15')])throw _0x3ad97e;redis[_0x1287('0x41')](_0x3ad97e[_0x1287('0x42')])[_0x1287('0x12')](function(_0x22b288){if(!_0x22b288)throw new Error(_0x1287('0x43'));_0x1da0d1=JSON[_0x1287('0x44')](_0x22b288);var _0x194e38=Buffer[_0x1287('0x45')](_0x3ad97e['state'],_0x1287('0x46'))[_0x1287('0x47')](_0x1287('0x48'));_0x24eb9a=JSON[_0x1287('0x44')](_0x194e38);if(!oauth[_0x1287('0x49')](_0x3ad97e[_0x1287('0x4a')],_0x1da0d1[_0x1287('0x4b')]))throw new Error(_0x1287('0x4c'));redis[_0x1287('0x4d')](_0x3ad97e[_0x1287('0x42')]);return oauth[_0x1287('0x4e')](_0x3ad97e[_0x1287('0x4f')],_0x1da0d1);})[_0x1287('0x12')](function(_0x2d8a4d){_0x1da0d1['data5']=_0x2d8a4d[_0x1287('0x50')];_0x1da0d1['data6']=_0x2d8a4d[_0x1287('0x51')];return db['CloudProvider']['update']({'data5':_0x1da0d1[_0x1287('0x52')],'data6':_0x1da0d1['data6']},{'where':{'id':_0x1da0d1['id']}});})[_0x1287('0x12')](function(){oauth[_0x1287('0x53')](_0x1da0d1);socket['emit'](_0x1287('0x54'),{'id':_0x24eb9a['id']});return;})[_0x1287('0x12')](respondWithStatusCode(_0x5af4e6,null))['catch'](function(_0x35cc8e){if(_0x24eb9a){socket['emit'](_0x1287('0x55'),{'id':_0x24eb9a['id']});}if(!_0x1da0d1){logger[_0x1287('0x15')]('Invalid\x20authentication\x20state\x20parameter',_0x35cc8e);return _0x5af4e6[_0x1287('0x9')](0x1f4)['send'](_0x35cc8e['message']);}logger[_0x1287('0x15')](_0x1287('0x56'),_0x1da0d1['id'],JSON[_0x1287('0x57')](_0x35cc8e));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index e93bd15..3fb619b 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 _0xa119=['CloudProvider','cloud_providers','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x3bc022,_0x398082){var _0x4a19c6=function(_0x1e3281){while(--_0x1e3281){_0x3bc022['push'](_0x3bc022['shift']());}};_0x4a19c6(++_0x398082);}(_0xa119,0xf2));var _0x9a11=function(_0x3d4334,_0x2223c1){_0x3d4334=_0x3d4334-0x0;var _0x2b86b6=_0xa119[_0x3d4334];return _0x2b86b6;};'use strict';var _=require('lodash');var util=require(_0x9a11('0x0'));var logger=require(_0x9a11('0x1'))(_0x9a11('0x2'));var moment=require(_0x9a11('0x3'));var BPromise=require(_0x9a11('0x4'));var rp=require(_0x9a11('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9a11('0x6'));var config=require(_0x9a11('0x7'));var attributes=require('./cloudProvider.attributes');module[_0x9a11('0x8')]=function(_0xd5de1,_0x439e29){return _0xd5de1[_0x9a11('0x9')](_0x9a11('0xa'),attributes,{'tableName':_0x9a11('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9e7e=['./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x469037,_0x3b6b21){var _0x2204c6=function(_0x2a313d){while(--_0x2a313d){_0x469037['push'](_0x469037['shift']());}};_0x2204c6(++_0x3b6b21);}(_0x9e7e,0xf3));var _0xe9e7=function(_0x5f0ecc,_0x36e3de){_0x5f0ecc=_0x5f0ecc-0x0;var _0x47b0ed=_0x9e7e[_0x5f0ecc];return _0x47b0ed;};'use strict';var _=require(_0xe9e7('0x0'));var util=require(_0xe9e7('0x1'));var logger=require(_0xe9e7('0x2'))('api');var moment=require(_0xe9e7('0x3'));var BPromise=require(_0xe9e7('0x4'));var rp=require(_0xe9e7('0x5'));var fs=require('fs');var path=require(_0xe9e7('0x6'));var rimraf=require(_0xe9e7('0x7'));var config=require(_0xe9e7('0x8'));var attributes=require(_0xe9e7('0x9'));module[_0xe9e7('0xa')]=function(_0x1ddb82,_0x5ed8d1){return _0x1ddb82[_0xe9e7('0xb')](_0xe9e7('0xc'),attributes,{'tableName':_0xe9e7('0xd'),'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 3fe3365..08eec33 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 _0xb9d0=['stringify','payload','iss','issuer','aud','audience','unix','exp','resolve','then','data3','CloudProvider','refresh_token','data4','decryptString','data5','access_token','data6','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','POST','intervals','findAll','map','all','exports','lodash','crypto','moment','ioredis','request-promise','util','../../components/encryptor','../../config/logger','../../config/schedule/cloud-provider','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','https://outlook.office.com/POP.AccessAsUser.All','/authorize','type','Dynamics365','push','join','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','data7','/.default','{TENANT_ID}','data2','code','id_token','from','toString','randomBytes','hex','client_id','data1','response_type','redirect_uri','response_mode','scope','state','nonce','prompt','login','oauth2Claims','replace','set'];(function(_0x342952,_0x441653){var _0x89327=function(_0x3838e3){while(--_0x3838e3){_0x342952['push'](_0x342952['shift']());}};_0x89327(++_0x441653);}(_0xb9d0,0x14d));var _0x0b9d=function(_0x167d21,_0x5e550d){_0x167d21=_0x167d21-0x0;var _0x2fa25c=_0xb9d0[_0x167d21];return _0x2fa25c;};'use strict';var _=require(_0x0b9d('0x0'));var crypto=require(_0x0b9d('0x1'));var jwt=require('jsonwebtoken');var moment=require(_0x0b9d('0x2'));var Redis=require(_0x0b9d('0x3'));var rp=require(_0x0b9d('0x4'));var util=require(_0x0b9d('0x5'));var encryptor=require(_0x0b9d('0x6'));var config=require('../../config/environment');var logger=require(_0x0b9d('0x7'))('api');var schedule=require(_0x0b9d('0x8'));var db=require('../../mysqldb')['db'];config[_0x0b9d('0x9')]=_[_0x0b9d('0xa')](config[_0x0b9d('0x9')],{'host':_0x0b9d('0xb'),'port':0x18eb});var redis=new Redis(config[_0x0b9d('0x9')]);var MICROSOFT_AUTH_URL=_0x0b9d('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0x0b9d('0xd'),_0x0b9d('0xe'),_0x0b9d('0xf'),'offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All',_0x0b9d('0x10'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x0b9d('0xd'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0x0b9d('0x11');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x1ad7d8){var _0x5451a5=_['map'](AZURE_AUTH_SCOPES[_0x1ad7d8[_0x0b9d('0x12')]]);if(_0x1ad7d8[_0x0b9d('0x12')]===_0x0b9d('0x13'))_0x5451a5[_0x0b9d('0x14')](_0x1ad7d8['data7']+'/.default');return _0x5451a5[_0x0b9d('0x15')]('\x20');}function getAccessTokenScope(_0x2f12e7){if(_0x2f12e7[_0x0b9d('0x12')]===_0x0b9d('0x16'))return _0x0b9d('0x17');if(_0x2f12e7[_0x0b9d('0x12')]==='Dynamics365')return _0x2f12e7[_0x0b9d('0x18')]+_0x0b9d('0x19');}function generateMicrosoftAuthorizationUrl(_0x591939,_0x3ac40d){var _0x288cac=MICROSOFT_AUTH_URL['replace'](_0x0b9d('0x1a'),_0x591939[_0x0b9d('0x1b')]);var _0x566e02=[_0x0b9d('0x1c'),_0x0b9d('0x1d')];var _0x29790a=Buffer[_0x0b9d('0x1e')](JSON['stringify']({'id':_0x3ac40d}))[_0x0b9d('0x1f')]('base64');var _0x5e7f92=crypto[_0x0b9d('0x20')](0x10)['toString'](_0x0b9d('0x21'));var _0x1e6a02=getAuthorizationScopes(_0x591939);var _0x1dfe68=[{'key':_0x0b9d('0x22'),'value':_0x591939[_0x0b9d('0x23')]},{'key':_0x0b9d('0x24'),'value':encodeURIComponent(_0x566e02[_0x0b9d('0x15')]('\x20'))},{'key':_0x0b9d('0x25'),'value':_0x591939['data4']},{'key':_0x0b9d('0x26'),'value':'form_post'},{'key':_0x0b9d('0x27'),'value':encodeURIComponent(_0x1e6a02)},{'key':_0x0b9d('0x28'),'value':_0x29790a},{'key':_0x0b9d('0x29'),'value':_0x5e7f92},{'key':_0x0b9d('0x2a'),'value':_0x0b9d('0x2b')}];var _0x237596=_0x288cac+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x1dfe68,function(_0x173d16){return _0x173d16['key']+'='+_0x173d16['value'];})[_0x0b9d('0x15')]('&');_0x591939[_0x0b9d('0x2c')]={'issuer':_0x288cac[_0x0b9d('0x2d')]('oauth2/',''),'audience':_0x591939['data1'],'state':_0x29790a,'nonce':_0x5e7f92};redis[_0x0b9d('0x2e')](_0x29790a,JSON[_0x0b9d('0x2f')](_0x591939));return _0x237596;}function isValidIdToken(_0x369a46,_0x5267c6){try{var _0x5dea53=jwt['decode'](_0x369a46,{'complete':!![]});var _0x522a1d=_0x5dea53[_0x0b9d('0x30')];if(_0x522a1d[_0x0b9d('0x31')]!==_0x5267c6[_0x0b9d('0x32')])return![];if(_0x522a1d[_0x0b9d('0x33')]!==_0x5267c6[_0x0b9d('0x34')])return![];if(_0x522a1d[_0x0b9d('0x29')]!==_0x5267c6['nonce'])return![];if(moment()['isAfter'](moment[_0x0b9d('0x35')](_0x522a1d[_0x0b9d('0x36')])))return![];return!![];}catch(_0x3a31d0){throw _0x3a31d0;}}function refreshOauth2MicrosoftAccessToken(_0x743d8f){return Promise[_0x0b9d('0x37')]()[_0x0b9d('0x38')](function(){if(_0x743d8f[_0x0b9d('0x39')])return _0x743d8f;return db[_0x0b9d('0x3a')]['findOne']({'where':{'id':_0x743d8f['id']},'raw':!![]});})[_0x0b9d('0x38')](function(_0x7d12c7){var _0x160ed0={'grant_type':_0x0b9d('0x3b'),'refresh_token':_0x7d12c7['data6'],'scope':getAccessTokenScope(_0x7d12c7),'redirect_uri':_0x7d12c7[_0x0b9d('0x3c')],'client_id':_0x7d12c7[_0x0b9d('0x23')],'client_secret':encryptor[_0x0b9d('0x3d')](_0x7d12c7[_0x0b9d('0x39')])};var _0x5f4586={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x0b9d('0x2d')]('{TENANT_ID}',_0x7d12c7[_0x0b9d('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x160ed0,'json':!![]};return rp(_0x5f4586);})[_0x0b9d('0x38')](function(_0x40d033){_0x743d8f[_0x0b9d('0x3e')]=_0x40d033[_0x0b9d('0x3f')];_0x743d8f[_0x0b9d('0x40')]=_0x40d033[_0x0b9d('0x3b')];return db['CloudProvider'][_0x0b9d('0x41')]({'data5':_0x743d8f[_0x0b9d('0x3e')],'data6':_0x743d8f[_0x0b9d('0x40')]},{'where':{'id':_0x743d8f['id']}});})[_0x0b9d('0x38')](function(){return _0x743d8f;})[_0x0b9d('0x42')](function(_0x1cd6f1){logger[_0x0b9d('0x43')](_0x0b9d('0x44'),_0x743d8f['id'],_0x1cd6f1);});}function getOauth2MicrosoftAccessToken(_0x337ab9,_0x1a41e7){var _0x11e308={'grant_type':_0x0b9d('0x45'),'code':_0x337ab9,'scope':getAccessTokenScope(_0x1a41e7),'redirect_uri':_0x1a41e7[_0x0b9d('0x3c')],'client_id':_0x1a41e7[_0x0b9d('0x23')],'client_secret':encryptor['decryptString'](_0x1a41e7[_0x0b9d('0x39')])};var _0x42bb92={'method':_0x0b9d('0x46'),'uri':MICROSOFT_AUTH_URL['replace'](_0x0b9d('0x1a'),_0x1a41e7[_0x0b9d('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x11e308,'json':!![]};return rp(_0x42bb92);}function startRefreshInterval(_0x5230b8){var _0x24a224=schedule[_0x0b9d('0x47')];if(_0x24a224[_0x5230b8['id']])clearInterval(_0x24a224[_0x5230b8['id']]);_0x24a224[_0x5230b8['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x5230b8['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x24a224;}function startAllRefreshIntervals(){return db[_0x0b9d('0x3a')][_0x0b9d('0x48')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x0b9d('0x38')](function(_0x55f464){var _0x31acce=_0x55f464[_0x0b9d('0x49')](function(_0x7ce2de){return refreshOauth2MicrosoftAccessToken(_0x7ce2de)[_0x0b9d('0x38')](function(_0x4b6825){startRefreshInterval(_0x4b6825);});});return Promise[_0x0b9d('0x4a')](_0x31acce);})['catch'](function(_0x5195cb){var _0x38c08f=_0x5195cb?util['inspect'](_0x5195cb,{'showHidden':![],'depth':null}):'';logger['error']('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x38c08f);});}module[_0x0b9d('0x4b')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x2b2f=['data4','response_mode','form_post','scope','state','nonce','prompt','login','map','key','value','oauth2Claims','set','decode','payload','issuer','audience','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','data6','decryptString','access_token','update','data5','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','POST','data2','intervals','bind','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','jsonwebtoken','moment','request-promise','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','redis','localhost','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','offline_access','/authorize','/token','type','Dynamics365','push','data7','/.default','join','replace','{TENANT_ID}','from','stringify','randomBytes','hex','client_id','data1','response_type'];(function(_0x2b2da6,_0x2bc6c0){var _0xbf139a=function(_0xd6cd50){while(--_0xd6cd50){_0x2b2da6['push'](_0x2b2da6['shift']());}};_0xbf139a(++_0x2bc6c0);}(_0x2b2f,0x1f1));var _0xf2b2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2b2f[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xf2b2('0x0'));var crypto=require('crypto');var jwt=require(_0xf2b2('0x1'));var moment=require(_0xf2b2('0x2'));var Redis=require('ioredis');var rp=require(_0xf2b2('0x3'));var util=require('util');var encryptor=require(_0xf2b2('0x4'));var config=require(_0xf2b2('0x5'));var logger=require(_0xf2b2('0x6'))(_0xf2b2('0x7'));var schedule=require(_0xf2b2('0x8'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xf2b2('0x9')],{'host':_0xf2b2('0xa'),'port':0x18eb});var redis=new Redis(config[_0xf2b2('0x9')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0xf2b2('0xb'),_0xf2b2('0xc'),'offline_access',_0xf2b2('0xd'),_0xf2b2('0xe'),_0xf2b2('0xf')],'Dynamics365':[_0xf2b2('0x10'),_0xf2b2('0x11')]};var MICROSOFT_AUTH_ENDPOINT=_0xf2b2('0x12');var MICROSOFT_TOKEN_ENDPOINT=_0xf2b2('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x3133fb){var _0x585a90=_['map'](AZURE_AUTH_SCOPES[_0x3133fb[_0xf2b2('0x14')]]);if(_0x3133fb[_0xf2b2('0x14')]===_0xf2b2('0x15'))_0x585a90[_0xf2b2('0x16')](_0x3133fb[_0xf2b2('0x17')]+_0xf2b2('0x18'));return _0x585a90[_0xf2b2('0x19')]('\x20');}function getAccessTokenScope(_0x5447ec){if(_0x5447ec[_0xf2b2('0x14')]==='Outlook365')return _0xf2b2('0xd');if(_0x5447ec[_0xf2b2('0x14')]===_0xf2b2('0x15'))return _0x5447ec[_0xf2b2('0x17')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x4a3ece,_0x1462c4){var _0x51df83=MICROSOFT_AUTH_URL[_0xf2b2('0x1a')](_0xf2b2('0x1b'),_0x4a3ece['data2']);var _0x47906a=['code','id_token'];var _0x5362a7=Buffer[_0xf2b2('0x1c')](JSON[_0xf2b2('0x1d')]({'id':_0x1462c4}))['toString']('base64');var _0x57766d=crypto[_0xf2b2('0x1e')](0x10)['toString'](_0xf2b2('0x1f'));var _0x509f80=getAuthorizationScopes(_0x4a3ece);var _0x177d86=[{'key':_0xf2b2('0x20'),'value':_0x4a3ece[_0xf2b2('0x21')]},{'key':_0xf2b2('0x22'),'value':encodeURIComponent(_0x47906a['join']('\x20'))},{'key':'redirect_uri','value':_0x4a3ece[_0xf2b2('0x23')]},{'key':_0xf2b2('0x24'),'value':_0xf2b2('0x25')},{'key':_0xf2b2('0x26'),'value':encodeURIComponent(_0x509f80)},{'key':_0xf2b2('0x27'),'value':_0x5362a7},{'key':_0xf2b2('0x28'),'value':_0x57766d},{'key':_0xf2b2('0x29'),'value':_0xf2b2('0x2a')}];var _0xf9b250=_0x51df83+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xf2b2('0x2b')](_0x177d86,function(_0x3b6b33){return _0x3b6b33[_0xf2b2('0x2c')]+'='+_0x3b6b33[_0xf2b2('0x2d')];})['join']('&');_0x4a3ece[_0xf2b2('0x2e')]={'issuer':_0x51df83[_0xf2b2('0x1a')]('oauth2/',''),'audience':_0x4a3ece[_0xf2b2('0x21')],'state':_0x5362a7,'nonce':_0x57766d};redis[_0xf2b2('0x2f')](_0x5362a7,JSON[_0xf2b2('0x1d')](_0x4a3ece));return _0xf9b250;}function isValidIdToken(_0x4b7ab6,_0x19304e){try{var _0x15ef20=jwt[_0xf2b2('0x30')](_0x4b7ab6,{'complete':!![]});var _0x2a86b3=_0x15ef20[_0xf2b2('0x31')];if(_0x2a86b3['iss']!==_0x19304e[_0xf2b2('0x32')])return![];if(_0x2a86b3['aud']!==_0x19304e[_0xf2b2('0x33')])return![];if(_0x2a86b3[_0xf2b2('0x28')]!==_0x19304e[_0xf2b2('0x28')])return![];if(moment()['isAfter'](moment['unix'](_0x2a86b3[_0xf2b2('0x34')])))return![];return!![];}catch(_0x4f8f4c){throw _0x4f8f4c;}}function refreshOauth2MicrosoftAccessToken(_0x4ebe25){return Promise[_0xf2b2('0x35')]()[_0xf2b2('0x36')](function(){if(_0x4ebe25[_0xf2b2('0x37')])return _0x4ebe25;return db[_0xf2b2('0x38')][_0xf2b2('0x39')]({'where':{'id':_0x4ebe25['id']},'raw':!![]});})[_0xf2b2('0x36')](function(_0x563224){var _0x138014={'grant_type':_0xf2b2('0x3a'),'refresh_token':_0x563224[_0xf2b2('0x3b')],'scope':getAccessTokenScope(_0x563224),'redirect_uri':_0x563224['data4'],'client_id':_0x563224[_0xf2b2('0x21')],'client_secret':encryptor[_0xf2b2('0x3c')](_0x563224[_0xf2b2('0x37')])};var _0x1fb993={'method':'POST','uri':MICROSOFT_AUTH_URL['replace'](_0xf2b2('0x1b'),_0x563224['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x138014,'json':!![]};return rp(_0x1fb993);})['then'](function(_0x5e1af6){_0x4ebe25['data5']=_0x5e1af6[_0xf2b2('0x3d')];_0x4ebe25[_0xf2b2('0x3b')]=_0x5e1af6['refresh_token'];return db[_0xf2b2('0x38')][_0xf2b2('0x3e')]({'data5':_0x4ebe25[_0xf2b2('0x3f')],'data6':_0x4ebe25[_0xf2b2('0x3b')]},{'where':{'id':_0x4ebe25['id']}});})['then'](function(){return _0x4ebe25;})[_0xf2b2('0x40')](function(_0x3feab7){logger[_0xf2b2('0x41')](_0xf2b2('0x42'),_0x4ebe25['id'],_0x3feab7);});}function getOauth2MicrosoftAccessToken(_0x47724f,_0x396ecc){var _0x3ef180={'grant_type':_0xf2b2('0x43'),'code':_0x47724f,'scope':getAccessTokenScope(_0x396ecc),'redirect_uri':_0x396ecc['data4'],'client_id':_0x396ecc[_0xf2b2('0x21')],'client_secret':encryptor[_0xf2b2('0x3c')](_0x396ecc[_0xf2b2('0x37')])};var _0x4083b1={'method':_0xf2b2('0x44'),'uri':MICROSOFT_AUTH_URL[_0xf2b2('0x1a')]('{TENANT_ID}',_0x396ecc[_0xf2b2('0x45')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3ef180,'json':!![]};return rp(_0x4083b1);}function startRefreshInterval(_0x4719a1){var _0x2b1021=schedule[_0xf2b2('0x46')];if(_0x2b1021[_0x4719a1['id']])clearInterval(_0x2b1021[_0x4719a1['id']]);_0x2b1021[_0x4719a1['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xf2b2('0x47')](this,{'id':_0x4719a1['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xf2b2('0x46')]=_0x2b1021;}function startAllRefreshIntervals(){return db[_0xf2b2('0x38')][_0xf2b2('0x48')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x3757de){var _0x412edc=_0x3757de[_0xf2b2('0x2b')](function(_0x141373){return refreshOauth2MicrosoftAccessToken(_0x141373)[_0xf2b2('0x36')](function(_0x3fc2b5){startRefreshInterval(_0x3fc2b5);});});return Promise[_0xf2b2('0x49')](_0x412edc);})[_0xf2b2('0x40')](function(_0x46e98a){var _0x33e14d=_0x46e98a?util[_0xf2b2('0x4a')](_0x46e98a,{'showHidden':![],'depth':null}):'';logger[_0xf2b2('0x41')](_0xf2b2('0x4b'),_0x33e14d);});}module['exports']={'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 0e82c7f..761c37c 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 _0x5464=['info','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x5a8d1a,_0x249fb3){var _0x340d35=function(_0x2834ee){while(--_0x2834ee){_0x5a8d1a['push'](_0x5a8d1a['shift']());}};_0x340d35(++_0x249fb3);}(_0x5464,0x15d));var _0x4546=function(_0x517660,_0x431fca){_0x517660=_0x517660-0x0;var _0x22d562=_0x5464[_0x517660];return _0x22d562;};'use strict';var _=require(_0x4546('0x0'));var util=require(_0x4546('0x1'));var moment=require(_0x4546('0x2'));var BPromise=require('bluebird');var rs=require(_0x4546('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4546('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4546('0x5'))(_0x4546('0x6'));var config=require(_0x4546('0x7'));var jayson=require(_0x4546('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5c5e09,_0x224c7c,_0x36c875){return new BPromise(function(_0x1a76c1,_0x2e860a){return client[_0x4546('0x9')](_0x5c5e09,_0x36c875)[_0x4546('0xa')](function(_0x11d63e){logger[_0x4546('0xb')](_0x4546('0xc'),_0x224c7c,'request\x20sent');logger[_0x4546('0xd')](_0x4546('0xe'),_0x224c7c,_0x4546('0xf'),JSON['stringify'](_0x11d63e));if(_0x11d63e[_0x4546('0x10')]){if(_0x11d63e[_0x4546('0x10')][_0x4546('0x11')]===0x1f4){logger[_0x4546('0x10')]('CloudProvider,\x20%s,\x20%s',_0x224c7c,_0x11d63e['error'][_0x4546('0x12')]);return _0x2e860a(_0x11d63e['error']['message']);}logger['error']('CloudProvider,\x20%s,\x20%s',_0x224c7c,_0x11d63e['error']['message']);return _0x1a76c1(_0x11d63e[_0x4546('0x10')]['message']);}else{logger[_0x4546('0xb')]('CloudProvider,\x20%s,\x20%s',_0x224c7c,_0x4546('0xf'));_0x1a76c1(_0x11d63e['result'][_0x4546('0x12')]);}})[_0x4546('0x13')](function(_0x24b32a){logger[_0x4546('0x10')](_0x4546('0xc'),_0x224c7c,_0x24b32a);_0x2e860a(_0x24b32a);});});} \ No newline at end of file +var _0x13cc=['../../config/environment','client','request','then','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','CloudProvider,\x20%s,\x20%s','info','result','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5beeeb,_0x1e93f8){var _0x595f77=function(_0x281a87){while(--_0x281a87){_0x5beeeb['push'](_0x5beeeb['shift']());}};_0x595f77(++_0x1e93f8);}(_0x13cc,0x161));var _0xc13c=function(_0x3f57c5,_0x1ad5ac){_0x3f57c5=_0x3f57c5-0x0;var _0x7a30b6=_0x13cc[_0x3f57c5];return _0x7a30b6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc13c('0x0'));var BPromise=require(_0xc13c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc13c('0x2'));var db=require(_0xc13c('0x3'))['db'];var utils=require(_0xc13c('0x4'));var logger=require(_0xc13c('0x5'))(_0xc13c('0x6'));var config=require(_0xc13c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc13c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18b0b4,_0x41b41b,_0x4889d6){return new BPromise(function(_0x318eab,_0x3570f3){return client[_0xc13c('0x9')](_0x18b0b4,_0x4889d6)[_0xc13c('0xa')](function(_0x5ee2aa){logger['info']('CloudProvider,\x20%s,\x20%s',_0x41b41b,_0xc13c('0xb'));logger[_0xc13c('0xc')](_0xc13c('0xd'),_0x41b41b,_0xc13c('0xb'),JSON[_0xc13c('0xe')](_0x5ee2aa));if(_0x5ee2aa['error']){if(_0x5ee2aa[_0xc13c('0xf')]['code']===0x1f4){logger[_0xc13c('0xf')]('CloudProvider,\x20%s,\x20%s',_0x41b41b,_0x5ee2aa['error'][_0xc13c('0x10')]);return _0x3570f3(_0x5ee2aa[_0xc13c('0xf')][_0xc13c('0x10')]);}logger[_0xc13c('0xf')](_0xc13c('0x11'),_0x41b41b,_0x5ee2aa[_0xc13c('0xf')][_0xc13c('0x10')]);return _0x318eab(_0x5ee2aa[_0xc13c('0xf')][_0xc13c('0x10')]);}else{logger[_0xc13c('0x12')]('CloudProvider,\x20%s,\x20%s',_0x41b41b,_0xc13c('0xb'));_0x318eab(_0x5ee2aa[_0xc13c('0x13')][_0xc13c('0x10')]);}})['catch'](function(_0x93cb3b){logger[_0xc13c('0xf')](_0xc13c('0x11'),_0x41b41b,_0x93cb3b);_0x3570f3(_0x93cb3b);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 7d4c7dd..9765263 100644 --- a/server/api/cloudProvider/index.js +++ b/server/api/cloudProvider/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0x2479a0,_0x5a9af6){var _0x237d29=function(_0x4cd9a6){while(--_0x4cd9a6){_0x2479a0['push'](_0x2479a0['shift']());}};_0x237d29(++_0x5a9af6);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xc4aa[_0x53ccf2];return _0x5a2964;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router; \ No newline at end of file +var _0xdb28=['delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','oauth2MicrosoftCallback','express','Router','../../components/auth/service','./cloudProvider.controller','isAuthenticated','index','get','/:id','post','update'];(function(_0x2a7c09,_0x365a9b){var _0x26d48d=function(_0x5ec443){while(--_0x5ec443){_0x2a7c09['push'](_0x2a7c09['shift']());}};_0x26d48d(++_0x365a9b);}(_0xdb28,0x106));var _0x8db2=function(_0x2b1a28,_0x1c4a9e){_0x2b1a28=_0x2b1a28-0x0;var _0x29b7da=_0xdb28[_0x2b1a28];return _0x29b7da;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['get']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);router[_0x8db2('0x6')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller['show']);router[_0x8db2('0x8')]('/',auth[_0x8db2('0x4')](),controller['create']);router['put'](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0x9')]);router[_0x8db2('0xa')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xb')]);router['get'](_0x8db2('0xc'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xd')]);router['post'](_0x8db2('0xe'),controller[_0x8db2('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 71af239..82dde05 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 _0xb5b3=['exports','STRING','name','sequelize'];(function(_0x56083d,_0x4014ee){var _0x332f02=function(_0x43b9ec){while(--_0x43b9ec){_0x56083d['push'](_0x56083d['shift']());}};_0x332f02(++_0x4014ee);}(_0xb5b3,0x143));var _0x3b5b=function(_0x36a39e,_0x564ec5){_0x36a39e=_0x36a39e-0x0;var _0x345bca=_0xb5b3[_0x36a39e];return _0x345bca;};'use strict';var Sequelize=require(_0x3b5b('0x0'));module[_0x3b5b('0x1')]={'name':{'type':Sequelize[_0x3b5b('0x2')],'unique':_0x3b5b('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x3b5b('0x2')]},'website':{'type':Sequelize[_0x3b5b('0x2')]},'phone':{'type':Sequelize[_0x3b5b('0x2')]},'fax':{'type':Sequelize[_0x3b5b('0x2')]},'type':{'type':Sequelize[_0x3b5b('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x3b5b('0x2')]},'city':{'type':Sequelize[_0x3b5b('0x2')]},'country':{'type':Sequelize[_0x3b5b('0x2')]},'email':{'type':Sequelize[_0x3b5b('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x3b5b('0x2')]},'sStreet':{'type':Sequelize[_0x3b5b('0x2')]},'sPostalCode':{'type':Sequelize[_0x3b5b('0x2')]},'sCity':{'type':Sequelize[_0x3b5b('0x2')]},'sCountry':{'type':Sequelize[_0x3b5b('0x2')]},'description':{'type':Sequelize[_0x3b5b('0x2')]}}; \ No newline at end of file +var _0x4c97=['STRING','sequelize','exports','name'];(function(_0x5d1237,_0x5bb744){var _0x300572=function(_0x48d23c){while(--_0x48d23c){_0x5d1237['push'](_0x5d1237['shift']());}};_0x300572(++_0x5bb744);}(_0x4c97,0xcd));var _0x74c9=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0x4c97[_0x3c8e9a];return _0x2d4c57;};'use strict';var Sequelize=require(_0x74c9('0x0'));module[_0x74c9('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x74c9('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x74c9('0x3')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x74c9('0x3')]},'fax':{'type':Sequelize[_0x74c9('0x3')]},'type':{'type':Sequelize[_0x74c9('0x3')]},'street':{'type':Sequelize[_0x74c9('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x74c9('0x3')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x74c9('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x74c9('0x3')]},'sStreet':{'type':Sequelize[_0x74c9('0x3')]},'sPostalCode':{'type':Sequelize[_0x74c9('0x3')]},'sCity':{'type':Sequelize[_0x74c9('0x3')]},'sCountry':{'type':Sequelize[_0x74c9('0x3')]},'description':{'type':Sequelize[_0x74c9('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 6c83316..0ae50df 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 _0x7fff=['api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','destroy','get','Companies','then','error','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','includeAll','include','rows','show','params','rawAttributes','options','find','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContact','addContacts','ids','omit','getContacts','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x400f53,_0x1981d4){var _0x31a631=function(_0x4b2547){while(--_0x4b2547){_0x400f53['push'](_0x400f53['shift']());}};_0x31a631(++_0x1981d4);}(_0x7fff,0x199));var _0xf7ff=function(_0x20d070,_0x5f18f7){_0x20d070=_0x20d070-0x0;var _0x224eb1=_0x7fff[_0x20d070];return _0x224eb1;};'use strict';var emlformat=require(_0xf7ff('0x0'));var rimraf=require(_0xf7ff('0x1'));var zipdir=require(_0xf7ff('0x2'));var jsonpatch=require(_0xf7ff('0x3'));var rp=require(_0xf7ff('0x4'));var moment=require(_0xf7ff('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf7ff('0x6'));var util=require('util');var path=require('path');var sox=require(_0xf7ff('0x7'));var csv=require(_0xf7ff('0x8'));var ejs=require(_0xf7ff('0x9'));var fs=require('fs');var fs_extra=require(_0xf7ff('0xa'));var _=require('lodash');var squel=require(_0xf7ff('0xb'));var crypto=require(_0xf7ff('0xc'));var jsforce=require(_0xf7ff('0xd'));var deskjs=require(_0xf7ff('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf7ff('0xf'));var Papa=require(_0xf7ff('0x10'));var Redis=require(_0xf7ff('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf7ff('0x12'));var as=require(_0xf7ff('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf7ff('0x14'))(_0xf7ff('0x15'));var utils=require(_0xf7ff('0x16'));var config=require(_0xf7ff('0x17'));var licenseUtil=require(_0xf7ff('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5449cb,_0x46bfee){_0x46bfee=_0x46bfee||0xcc;return function(_0x2182c2){if(_0x2182c2){return _0x5449cb[_0xf7ff('0x19')](_0x46bfee);}return _0x5449cb[_0xf7ff('0x1a')](_0x46bfee)[_0xf7ff('0x1b')]();};}function respondWithResult(_0x32a01f,_0x4b7632){_0x4b7632=_0x4b7632||0xc8;return function(_0x2082f0){if(_0x2082f0){return _0x32a01f['status'](_0x4b7632)[_0xf7ff('0x1c')](_0x2082f0);}};}function respondWithFilteredResult(_0x1a339e,_0x36625e){return function(_0x413846){if(_0x413846){var _0x2e192d=typeof _0x36625e[_0xf7ff('0x1d')]===_0xf7ff('0x1e')&&typeof _0x36625e[_0xf7ff('0x1f')]===_0xf7ff('0x1e');var _0x1c6a83=_0x413846['count'];var _0x47a967=_0x2e192d?0x0:_0x36625e['offset'];var _0x19fe3a=_0x2e192d?_0x413846[_0xf7ff('0x20')]:_0x36625e[_0xf7ff('0x1d')]+_0x36625e[_0xf7ff('0x1f')];var _0x578dce;if(_0x19fe3a>=_0x1c6a83){_0x19fe3a=_0x1c6a83;_0x578dce=0xc8;}else{_0x578dce=0xce;}_0x1a339e[_0xf7ff('0x1a')](_0x578dce);return _0x1a339e['set']('Content-Range',_0x47a967+'-'+_0x19fe3a+'/'+_0x1c6a83)[_0xf7ff('0x1c')](_0x413846);}return null;};}function patchUpdates(_0x116971){return function(_0xb27b0c){try{jsonpatch[_0xf7ff('0x21')](_0xb27b0c,_0x116971,!![]);}catch(_0x42df20){return BPromise[_0xf7ff('0x22')](_0x42df20);}return _0xb27b0c[_0xf7ff('0x23')]();};}function saveUpdates(_0x4a6b85,_0x177823){return function(_0x74bf15){if(_0x74bf15){return _0x74bf15[_0xf7ff('0x24')](_0x4a6b85)['then'](function(_0x5c902a){return _0x5c902a;});}return null;};}function removeEntity(_0x1474a5,_0x658e84){return function(_0x45a582){if(_0x45a582){return _0x45a582[_0xf7ff('0x25')]()['then'](function(){var _0x412710=_0x45a582[_0xf7ff('0x26')]({'plain':!![]});var _0x461084=_0xf7ff('0x27');return db['UserProfileResource'][_0xf7ff('0x25')]({'where':{'type':_0x461084,'resourceId':_0x412710['id']}})[_0xf7ff('0x28')](function(){return _0x45a582;});})['then'](function(){_0x1474a5[_0xf7ff('0x1a')](0xcc)[_0xf7ff('0x1b')]();});}};}function handleEntityNotFound(_0x2064dc,_0x46179f){return function(_0x3b45d9){if(!_0x3b45d9){_0x2064dc['sendStatus'](0x194);}return _0x3b45d9;};}function handleError(_0x528c43,_0x4df432){_0x4df432=_0x4df432||0x1f4;return function(_0x4ee230){logger[_0xf7ff('0x29')](_0x4ee230['stack']);if(_0x4ee230[_0xf7ff('0x2a')]){delete _0x4ee230['name'];}_0x528c43[_0xf7ff('0x1a')](_0x4df432)[_0xf7ff('0x2b')](_0x4ee230);};}exports[_0xf7ff('0x2c')]=function(_0x3faa9c,_0x1578de){var _0x26c1ed={},_0xf9a543={},_0x11caaa={'count':0x0,'rows':[]};return db[_0xf7ff('0x2d')][_0xf7ff('0x2e')]()[_0xf7ff('0x28')](function(_0x41762c){_0xf9a543[_0xf7ff('0x2f')]=_[_0xf7ff('0x30')](_0x41762c);_0xf9a543[_0xf7ff('0x31')]=_[_0xf7ff('0x30')](_0x3faa9c[_0xf7ff('0x31')]);_0xf9a543[_0xf7ff('0x32')]=_[_0xf7ff('0x33')](_0xf9a543[_0xf7ff('0x2f')],_0xf9a543[_0xf7ff('0x31')]);_0x26c1ed[_0xf7ff('0x34')]=_[_0xf7ff('0x33')](_0xf9a543[_0xf7ff('0x2f')],qs[_0xf7ff('0x35')](_0x3faa9c[_0xf7ff('0x31')][_0xf7ff('0x35')]));_0x26c1ed[_0xf7ff('0x34')]=_0x26c1ed[_0xf7ff('0x34')][_0xf7ff('0x36')]?_0x26c1ed[_0xf7ff('0x34')]:_0xf9a543[_0xf7ff('0x2f')];if(!_0x3faa9c[_0xf7ff('0x31')][_0xf7ff('0x37')](_0xf7ff('0x38'))){_0x26c1ed[_0xf7ff('0x1f')]=qs[_0xf7ff('0x1f')](_0x3faa9c[_0xf7ff('0x31')]['limit']);_0x26c1ed[_0xf7ff('0x1d')]=qs['offset'](_0x3faa9c[_0xf7ff('0x31')]['offset']);}_0x26c1ed[_0xf7ff('0x39')]=qs[_0xf7ff('0x3a')](_0x3faa9c[_0xf7ff('0x31')][_0xf7ff('0x3a')]);_0x26c1ed[_0xf7ff('0x3b')]=qs['filters'](_[_0xf7ff('0x3c')](_0x3faa9c['query'],_0xf9a543[_0xf7ff('0x32')]),_0x41762c);if(_0x3faa9c[_0xf7ff('0x31')][_0xf7ff('0x3d')]){_0x26c1ed[_0xf7ff('0x3b')]=_[_0xf7ff('0x3e')](_0x26c1ed['where'],{'$or':_[_0xf7ff('0x3f')](_0x26c1ed['attributes'],function(_0x131d09){var _0x4c1fc4={};_0x4c1fc4[_0x131d09]={'$like':'%'+_0x3faa9c[_0xf7ff('0x31')][_0xf7ff('0x3d')]+'%'};return _0x4c1fc4;})});}_0x26c1ed=_[_0xf7ff('0x3e')]({},_0x26c1ed,_0x3faa9c['options']);var _0x44e44d={'where':_0x26c1ed[_0xf7ff('0x3b')]};return db['CmCompany'][_0xf7ff('0x20')](_0x44e44d)[_0xf7ff('0x28')](function(_0x57f44d){_0x11caaa['count']=_0x57f44d;if(_0x3faa9c[_0xf7ff('0x31')][_0xf7ff('0x40')]){_0x26c1ed[_0xf7ff('0x41')]=[{'all':!![]}];}return db[_0xf7ff('0x2d')]['findAll'](_0x26c1ed);})['then'](function(_0x3b5b3a){_0x11caaa[_0xf7ff('0x42')]=_0x3b5b3a;return _0x11caaa;})[_0xf7ff('0x28')](respondWithFilteredResult(_0x1578de,_0x26c1ed))['catch'](handleError(_0x1578de,null));})['catch'](handleError(_0x1578de,null));};exports[_0xf7ff('0x43')]=function(_0x22687b,_0x2a8c21){var _0x28f09c={'raw':![],'where':{'id':_0x22687b[_0xf7ff('0x44')]['id']}},_0x222f3f={};_0x222f3f[_0xf7ff('0x2f')]=_[_0xf7ff('0x30')](db['CmCompany'][_0xf7ff('0x45')]);_0x222f3f[_0xf7ff('0x31')]=_[_0xf7ff('0x30')](_0x22687b[_0xf7ff('0x31')]);_0x222f3f['filters']=_[_0xf7ff('0x33')](_0x222f3f['model'],_0x222f3f[_0xf7ff('0x31')]);_0x28f09c[_0xf7ff('0x34')]=_[_0xf7ff('0x33')](_0x222f3f[_0xf7ff('0x2f')],qs['fields'](_0x22687b[_0xf7ff('0x31')][_0xf7ff('0x35')]));_0x28f09c[_0xf7ff('0x34')]=_0x28f09c[_0xf7ff('0x34')]['length']?_0x28f09c[_0xf7ff('0x34')]:_0x222f3f[_0xf7ff('0x2f')];if(_0x22687b[_0xf7ff('0x31')][_0xf7ff('0x40')]){_0x28f09c['include']=[{'all':!![]}];}_0x28f09c=_[_0xf7ff('0x3e')]({},_0x28f09c,_0x22687b[_0xf7ff('0x46')]);return db[_0xf7ff('0x2d')][_0xf7ff('0x47')](_0x28f09c)[_0xf7ff('0x28')](handleEntityNotFound(_0x2a8c21,null))[_0xf7ff('0x28')](respondWithResult(_0x2a8c21,null))[_0xf7ff('0x48')](handleError(_0x2a8c21,null));};exports['create']=function(_0x572fdf,_0x253b49){return db[_0xf7ff('0x2d')]['create'](_0x572fdf[_0xf7ff('0x49')],{})['then'](function(_0x38f97d){var _0x2b92d8=_0x572fdf[_0xf7ff('0x4a')][_0xf7ff('0x26')]({'plain':!![]});if(!_0x2b92d8)throw new Error(_0xf7ff('0x4b'));if(_0x2b92d8['role']===_0xf7ff('0x4a')){var _0x550d88=_0x38f97d[_0xf7ff('0x26')]({'plain':!![]});var _0x521b8b=_0xf7ff('0x27');return db[_0xf7ff('0x4c')]['find']({'where':{'name':_0x521b8b,'userProfileId':_0x2b92d8[_0xf7ff('0x4d')]},'raw':!![]})[_0xf7ff('0x28')](function(_0x2ae48d){if(_0x2ae48d&&_0x2ae48d['autoAssociation']===0x0){return db[_0xf7ff('0x4e')]['create']({'name':_0x550d88['name'],'resourceId':_0x550d88['id'],'type':_0x2ae48d[_0xf7ff('0x2a')],'sectionId':_0x2ae48d['id']},{})[_0xf7ff('0x28')](function(){return _0x38f97d;});}else{return _0x38f97d;}})['catch'](function(_0x35a867){logger[_0xf7ff('0x29')](_0xf7ff('0x4f'),_0x35a867);throw _0x35a867;});}return _0x38f97d;})[_0xf7ff('0x28')](respondWithResult(_0x253b49,0xc9))['catch'](handleError(_0x253b49,null));};exports['update']=function(_0x4a8c6a,_0x4d2e98){if(_0x4a8c6a[_0xf7ff('0x49')]['id']){delete _0x4a8c6a[_0xf7ff('0x49')]['id'];}return db['CmCompany']['find']({'where':{'id':_0x4a8c6a[_0xf7ff('0x44')]['id']}})[_0xf7ff('0x28')](handleEntityNotFound(_0x4d2e98,null))[_0xf7ff('0x28')](saveUpdates(_0x4a8c6a[_0xf7ff('0x49')],null))['then'](respondWithResult(_0x4d2e98,null))[_0xf7ff('0x48')](handleError(_0x4d2e98,null));};exports[_0xf7ff('0x25')]=function(_0x355850,_0x3b7a5e){return db['CmCompany']['find']({'where':{'id':_0x355850[_0xf7ff('0x44')]['id']}})[_0xf7ff('0x28')](handleEntityNotFound(_0x3b7a5e,null))['then'](removeEntity(_0x3b7a5e,null))['catch'](handleError(_0x3b7a5e,null));};exports['describe']=function(_0x4efd94,_0x14d5d3){return db[_0xf7ff('0x2d')][_0xf7ff('0x2e')]()[_0xf7ff('0x28')](respondWithResult(_0x14d5d3,null))['catch'](handleError(_0x14d5d3,null));};exports['addContacts']=function(_0x1f77bb,_0x2fe1e6,_0x123c30){return db[_0xf7ff('0x50')][_0xf7ff('0x47')]({'where':{'id':_0x1f77bb['params']['id']}})[_0xf7ff('0x28')](handleEntityNotFound(_0x2fe1e6,null))[_0xf7ff('0x28')](function(_0x3ef4e5){if(_0x3ef4e5){return _0x3ef4e5[_0xf7ff('0x51')](_0x1f77bb[_0xf7ff('0x49')][_0xf7ff('0x52')],_[_0xf7ff('0x53')](_0x1f77bb[_0xf7ff('0x49')],[_0xf7ff('0x52'),'id'])||{});}})[_0xf7ff('0x28')](respondWithResult(_0x2fe1e6,null))[_0xf7ff('0x48')](handleError(_0x2fe1e6,null));};exports[_0xf7ff('0x54')]=function(_0x5aea9d,_0x2c7623,_0x46ef48){var _0x2114c8={};var _0x8593c6={};var _0x89b8a5;var _0x2e47f0;return db[_0xf7ff('0x2d')][_0xf7ff('0x55')]({'where':{'id':_0x5aea9d[_0xf7ff('0x44')]['id']}})[_0xf7ff('0x28')](handleEntityNotFound(_0x2c7623,null))[_0xf7ff('0x28')](function(_0x5716cc){if(_0x5716cc){_0x89b8a5=_0x5716cc;_0x8593c6[_0xf7ff('0x2f')]=_['keys'](db[_0xf7ff('0x50')][_0xf7ff('0x45')]);_0x8593c6[_0xf7ff('0x31')]=_[_0xf7ff('0x30')](_0x5aea9d['query']);_0x8593c6['filters']=_[_0xf7ff('0x33')](_0x8593c6[_0xf7ff('0x2f')],_0x8593c6[_0xf7ff('0x31')]);_0x2114c8[_0xf7ff('0x34')]=_[_0xf7ff('0x33')](_0x8593c6['model'],qs['fields'](_0x5aea9d[_0xf7ff('0x31')][_0xf7ff('0x35')]));_0x2114c8[_0xf7ff('0x34')]=_0x2114c8[_0xf7ff('0x34')][_0xf7ff('0x36')]?_0x2114c8[_0xf7ff('0x34')]:_0x8593c6[_0xf7ff('0x2f')];_0x2114c8[_0xf7ff('0x39')]=qs[_0xf7ff('0x3a')](_0x5aea9d['query']['sort']);_0x2114c8['where']=qs[_0xf7ff('0x32')](_[_0xf7ff('0x3c')](_0x5aea9d[_0xf7ff('0x31')],_0x8593c6['filters']));if(_0x5aea9d[_0xf7ff('0x31')]['filter']){_0x2114c8['where']=_[_0xf7ff('0x3e')](_0x2114c8[_0xf7ff('0x3b')],{'$or':_[_0xf7ff('0x3f')](_0x2114c8[_0xf7ff('0x34')],function(_0x29dd0f){var _0x5704a2={};_0x5704a2[_0x29dd0f]={'$like':'%'+_0x5aea9d[_0xf7ff('0x31')][_0xf7ff('0x3d')]+'%'};return _0x5704a2;})});}_0x2114c8=_[_0xf7ff('0x3e')]({},_0x2114c8,_0x5aea9d[_0xf7ff('0x46')]);return _0x89b8a5[_0xf7ff('0x54')](_0x2114c8);}})['then'](function(_0x4b9b81){if(_0x4b9b81){_0x2e47f0=_0x4b9b81[_0xf7ff('0x36')];if(!_0x5aea9d[_0xf7ff('0x31')]['hasOwnProperty'](_0xf7ff('0x38'))){_0x2114c8[_0xf7ff('0x1f')]=qs[_0xf7ff('0x1f')](_0x5aea9d[_0xf7ff('0x31')][_0xf7ff('0x1f')]);_0x2114c8[_0xf7ff('0x1d')]=qs[_0xf7ff('0x1d')](_0x5aea9d['query'][_0xf7ff('0x1d')]);}return _0x89b8a5[_0xf7ff('0x54')](_0x2114c8);}})[_0xf7ff('0x28')](function(_0x4176ec){if(_0x4176ec){return _0x4176ec?{'count':_0x2e47f0,'rows':_0x4176ec}:null;}})['then'](respondWithResult(_0x2c7623,null))[_0xf7ff('0x48')](handleError(_0x2c7623,null));}; \ No newline at end of file +var _0x280d=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','addContacts','CmContact','ids','omit','findOne','pick','getContacts','nolimit','eml-format','rimraf','zip-dir','moment','mustache','util','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','destroy','then','get','Companies','UserProfileResource','error','stack','name','send','describe','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','filter','map','merge','CmCompany','includeAll','include','findAll','rows','catch','show','rawAttributes','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation'];(function(_0x24f8d9,_0x2f2e1c){var _0xd16fab=function(_0x5d6695){while(--_0x5d6695){_0x24f8d9['push'](_0x24f8d9['shift']());}};_0xd16fab(++_0x2f2e1c);}(_0x280d,0x119));var _0xd280=function(_0x4651b7,_0x1c424c){_0x4651b7=_0x4651b7-0x0;var _0x459d79=_0x280d[_0x4651b7];return _0x459d79;};'use strict';var emlformat=require(_0xd280('0x0'));var rimraf=require(_0xd280('0x1'));var zipdir=require(_0xd280('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd280('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd280('0x4'));var util=require(_0xd280('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd280('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd280('0x7'));var squel=require(_0xd280('0x8'));var crypto=require(_0xd280('0x9'));var jsforce=require(_0xd280('0xa'));var deskjs=require(_0xd280('0xb'));var toCsv=require(_0xd280('0xc'));var querystring=require(_0xd280('0xd'));var Papa=require(_0xd280('0xe'));var Redis=require(_0xd280('0xf'));var authService=require(_0xd280('0x10'));var qs=require(_0xd280('0x11'));var as=require(_0xd280('0x12'));var hardwareService=require(_0xd280('0x13'));var logger=require(_0xd280('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xd280('0x15'));var licenseUtil=require(_0xd280('0x16'));var db=require(_0xd280('0x17'))['db'];function respondWithStatusCode(_0x297f13,_0x1f8cd7){_0x1f8cd7=_0x1f8cd7||0xcc;return function(_0x4c7cac){if(_0x4c7cac){return _0x297f13[_0xd280('0x18')](_0x1f8cd7);}return _0x297f13[_0xd280('0x19')](_0x1f8cd7)[_0xd280('0x1a')]();};}function respondWithResult(_0x33a0fd,_0x541ab9){_0x541ab9=_0x541ab9||0xc8;return function(_0x26d110){if(_0x26d110){return _0x33a0fd[_0xd280('0x19')](_0x541ab9)[_0xd280('0x1b')](_0x26d110);}};}function respondWithFilteredResult(_0x26744a,_0x28f4a9){return function(_0x104494){if(_0x104494){var _0x6a7c65=typeof _0x28f4a9[_0xd280('0x1c')]==='undefined'&&typeof _0x28f4a9[_0xd280('0x1d')]===_0xd280('0x1e');var _0xd87416=_0x104494[_0xd280('0x1f')];var _0x5ddf9d=_0x6a7c65?0x0:_0x28f4a9[_0xd280('0x1c')];var _0x59453d=_0x6a7c65?_0x104494[_0xd280('0x1f')]:_0x28f4a9[_0xd280('0x1c')]+_0x28f4a9[_0xd280('0x1d')];var _0x2aaac7;if(_0x59453d>=_0xd87416){_0x59453d=_0xd87416;_0x2aaac7=0xc8;}else{_0x2aaac7=0xce;}_0x26744a['status'](_0x2aaac7);return _0x26744a[_0xd280('0x20')]('Content-Range',_0x5ddf9d+'-'+_0x59453d+'/'+_0xd87416)[_0xd280('0x1b')](_0x104494);}return null;};}function patchUpdates(_0x417f26){return function(_0x4360f7){try{jsonpatch[_0xd280('0x21')](_0x4360f7,_0x417f26,!![]);}catch(_0x4e6fa5){return BPromise[_0xd280('0x22')](_0x4e6fa5);}return _0x4360f7[_0xd280('0x23')]();};}function saveUpdates(_0x5c7ccd,_0x2c8688){return function(_0x9cd8ad){if(_0x9cd8ad){return _0x9cd8ad['update'](_0x5c7ccd)['then'](function(_0x113af7){return _0x113af7;});}return null;};}function removeEntity(_0x351f15,_0xc24cf4){return function(_0x36c8c7){if(_0x36c8c7){return _0x36c8c7[_0xd280('0x24')]()[_0xd280('0x25')](function(){var _0x34614f=_0x36c8c7[_0xd280('0x26')]({'plain':!![]});var _0x3ede0e=_0xd280('0x27');return db[_0xd280('0x28')][_0xd280('0x24')]({'where':{'type':_0x3ede0e,'resourceId':_0x34614f['id']}})[_0xd280('0x25')](function(){return _0x36c8c7;});})[_0xd280('0x25')](function(){_0x351f15[_0xd280('0x19')](0xcc)[_0xd280('0x1a')]();});}};}function handleEntityNotFound(_0x19d7ef,_0x5f14cd){return function(_0xea9e9a){if(!_0xea9e9a){_0x19d7ef[_0xd280('0x18')](0x194);}return _0xea9e9a;};}function handleError(_0x5c44d9,_0x53209c){_0x53209c=_0x53209c||0x1f4;return function(_0x3abd02){logger[_0xd280('0x29')](_0x3abd02[_0xd280('0x2a')]);if(_0x3abd02[_0xd280('0x2b')]){delete _0x3abd02[_0xd280('0x2b')];}_0x5c44d9[_0xd280('0x19')](_0x53209c)[_0xd280('0x2c')](_0x3abd02);};}exports['index']=function(_0x185808,_0x2291ed){var _0x4ce324={},_0x208ab8={},_0x289629={'count':0x0,'rows':[]};return db['CmCompany'][_0xd280('0x2d')]()[_0xd280('0x25')](function(_0x1d109e){_0x208ab8[_0xd280('0x2e')]=_[_0xd280('0x2f')](_0x1d109e);_0x208ab8['query']=_[_0xd280('0x2f')](_0x185808['query']);_0x208ab8[_0xd280('0x30')]=_[_0xd280('0x31')](_0x208ab8['model'],_0x208ab8[_0xd280('0x32')]);_0x4ce324[_0xd280('0x33')]=_['intersection'](_0x208ab8[_0xd280('0x2e')],qs[_0xd280('0x34')](_0x185808[_0xd280('0x32')][_0xd280('0x34')]));_0x4ce324[_0xd280('0x33')]=_0x4ce324[_0xd280('0x33')][_0xd280('0x35')]?_0x4ce324[_0xd280('0x33')]:_0x208ab8[_0xd280('0x2e')];if(!_0x185808[_0xd280('0x32')][_0xd280('0x36')]('nolimit')){_0x4ce324[_0xd280('0x1d')]=qs['limit'](_0x185808['query'][_0xd280('0x1d')]);_0x4ce324['offset']=qs[_0xd280('0x1c')](_0x185808[_0xd280('0x32')][_0xd280('0x1c')]);}_0x4ce324[_0xd280('0x37')]=qs[_0xd280('0x38')](_0x185808[_0xd280('0x32')][_0xd280('0x38')]);_0x4ce324[_0xd280('0x39')]=qs[_0xd280('0x30')](_['pick'](_0x185808[_0xd280('0x32')],_0x208ab8[_0xd280('0x30')]),_0x1d109e);if(_0x185808[_0xd280('0x32')][_0xd280('0x3a')]){_0x4ce324['where']=_['merge'](_0x4ce324[_0xd280('0x39')],{'$or':_[_0xd280('0x3b')](_0x4ce324['attributes'],function(_0x3b79f6){var _0x3239d1={};_0x3239d1[_0x3b79f6]={'$like':'%'+_0x185808[_0xd280('0x32')]['filter']+'%'};return _0x3239d1;})});}_0x4ce324=_[_0xd280('0x3c')]({},_0x4ce324,_0x185808['options']);var _0x1c0968={'where':_0x4ce324[_0xd280('0x39')]};return db[_0xd280('0x3d')][_0xd280('0x1f')](_0x1c0968)['then'](function(_0x1a1f05){_0x289629[_0xd280('0x1f')]=_0x1a1f05;if(_0x185808['query'][_0xd280('0x3e')]){_0x4ce324[_0xd280('0x3f')]=[{'all':!![]}];}return db[_0xd280('0x3d')][_0xd280('0x40')](_0x4ce324);})['then'](function(_0x451bbb){_0x289629[_0xd280('0x41')]=_0x451bbb;return _0x289629;})['then'](respondWithFilteredResult(_0x2291ed,_0x4ce324))[_0xd280('0x42')](handleError(_0x2291ed,null));})[_0xd280('0x42')](handleError(_0x2291ed,null));};exports[_0xd280('0x43')]=function(_0x29febd,_0x41e4f9){var _0x5e93e8={'raw':![],'where':{'id':_0x29febd['params']['id']}},_0x1d0fc9={};_0x1d0fc9[_0xd280('0x2e')]=_[_0xd280('0x2f')](db[_0xd280('0x3d')][_0xd280('0x44')]);_0x1d0fc9[_0xd280('0x32')]=_[_0xd280('0x2f')](_0x29febd['query']);_0x1d0fc9['filters']=_[_0xd280('0x31')](_0x1d0fc9[_0xd280('0x2e')],_0x1d0fc9[_0xd280('0x32')]);_0x5e93e8['attributes']=_[_0xd280('0x31')](_0x1d0fc9['model'],qs[_0xd280('0x34')](_0x29febd[_0xd280('0x32')][_0xd280('0x34')]));_0x5e93e8[_0xd280('0x33')]=_0x5e93e8[_0xd280('0x33')][_0xd280('0x35')]?_0x5e93e8[_0xd280('0x33')]:_0x1d0fc9[_0xd280('0x2e')];if(_0x29febd[_0xd280('0x32')]['includeAll']){_0x5e93e8[_0xd280('0x3f')]=[{'all':!![]}];}_0x5e93e8=_[_0xd280('0x3c')]({},_0x5e93e8,_0x29febd[_0xd280('0x45')]);return db['CmCompany']['find'](_0x5e93e8)[_0xd280('0x25')](handleEntityNotFound(_0x41e4f9,null))[_0xd280('0x25')](respondWithResult(_0x41e4f9,null))[_0xd280('0x42')](handleError(_0x41e4f9,null));};exports[_0xd280('0x46')]=function(_0x44544b,_0x1ce562){return db['CmCompany'][_0xd280('0x46')](_0x44544b[_0xd280('0x47')],{})[_0xd280('0x25')](function(_0x35fbd6){var _0x37893c=_0x44544b[_0xd280('0x48')]['get']({'plain':!![]});if(!_0x37893c)throw new Error(_0xd280('0x49'));if(_0x37893c[_0xd280('0x4a')]===_0xd280('0x48')){var _0x404f6d=_0x35fbd6[_0xd280('0x26')]({'plain':!![]});var _0x259ecf=_0xd280('0x27');return db[_0xd280('0x4b')][_0xd280('0x4c')]({'where':{'name':_0x259ecf,'userProfileId':_0x37893c[_0xd280('0x4d')]},'raw':!![]})['then'](function(_0x359cd6){if(_0x359cd6&&_0x359cd6[_0xd280('0x4e')]===0x0){return db[_0xd280('0x28')][_0xd280('0x46')]({'name':_0x404f6d[_0xd280('0x2b')],'resourceId':_0x404f6d['id'],'type':_0x359cd6['name'],'sectionId':_0x359cd6['id']},{})['then'](function(){return _0x35fbd6;});}else{return _0x35fbd6;}})[_0xd280('0x42')](function(_0x42a4f3){logger[_0xd280('0x29')](_0xd280('0x4f'),_0x42a4f3);throw _0x42a4f3;});}return _0x35fbd6;})[_0xd280('0x25')](respondWithResult(_0x1ce562,0xc9))[_0xd280('0x42')](handleError(_0x1ce562,null));};exports[_0xd280('0x50')]=function(_0x3e58c1,_0x20fc88){if(_0x3e58c1['body']['id']){delete _0x3e58c1['body']['id'];}return db[_0xd280('0x3d')][_0xd280('0x4c')]({'where':{'id':_0x3e58c1[_0xd280('0x51')]['id']}})['then'](handleEntityNotFound(_0x20fc88,null))[_0xd280('0x25')](saveUpdates(_0x3e58c1['body'],null))[_0xd280('0x25')](respondWithResult(_0x20fc88,null))[_0xd280('0x42')](handleError(_0x20fc88,null));};exports['destroy']=function(_0x2a4d30,_0x440294){return db[_0xd280('0x3d')][_0xd280('0x4c')]({'where':{'id':_0x2a4d30[_0xd280('0x51')]['id']}})['then'](handleEntityNotFound(_0x440294,null))[_0xd280('0x25')](removeEntity(_0x440294,null))[_0xd280('0x42')](handleError(_0x440294,null));};exports[_0xd280('0x2d')]=function(_0x3c266c,_0x103ee9){return db[_0xd280('0x3d')]['describe']()[_0xd280('0x25')](respondWithResult(_0x103ee9,null))[_0xd280('0x42')](handleError(_0x103ee9,null));};exports[_0xd280('0x52')]=function(_0x4f9dac,_0x44f076,_0x5a2a32){return db[_0xd280('0x53')]['find']({'where':{'id':_0x4f9dac[_0xd280('0x51')]['id']}})[_0xd280('0x25')](handleEntityNotFound(_0x44f076,null))[_0xd280('0x25')](function(_0x38cb14){if(_0x38cb14){return _0x38cb14[_0xd280('0x52')](_0x4f9dac[_0xd280('0x47')][_0xd280('0x54')],_[_0xd280('0x55')](_0x4f9dac[_0xd280('0x47')],['ids','id'])||{});}})[_0xd280('0x25')](respondWithResult(_0x44f076,null))['catch'](handleError(_0x44f076,null));};exports['getContacts']=function(_0x1dff0e,_0x3f7ad9,_0x25488a){var _0xd06551={};var _0x7756e8={};var _0x4a5155;var _0x29289c;return db[_0xd280('0x3d')][_0xd280('0x56')]({'where':{'id':_0x1dff0e['params']['id']}})[_0xd280('0x25')](handleEntityNotFound(_0x3f7ad9,null))['then'](function(_0x2042cd){if(_0x2042cd){_0x4a5155=_0x2042cd;_0x7756e8[_0xd280('0x2e')]=_[_0xd280('0x2f')](db['CmContact'][_0xd280('0x44')]);_0x7756e8[_0xd280('0x32')]=_[_0xd280('0x2f')](_0x1dff0e[_0xd280('0x32')]);_0x7756e8[_0xd280('0x30')]=_['intersection'](_0x7756e8['model'],_0x7756e8['query']);_0xd06551['attributes']=_[_0xd280('0x31')](_0x7756e8[_0xd280('0x2e')],qs[_0xd280('0x34')](_0x1dff0e[_0xd280('0x32')][_0xd280('0x34')]));_0xd06551[_0xd280('0x33')]=_0xd06551[_0xd280('0x33')][_0xd280('0x35')]?_0xd06551[_0xd280('0x33')]:_0x7756e8[_0xd280('0x2e')];_0xd06551[_0xd280('0x37')]=qs[_0xd280('0x38')](_0x1dff0e[_0xd280('0x32')][_0xd280('0x38')]);_0xd06551[_0xd280('0x39')]=qs[_0xd280('0x30')](_[_0xd280('0x57')](_0x1dff0e[_0xd280('0x32')],_0x7756e8['filters']));if(_0x1dff0e[_0xd280('0x32')][_0xd280('0x3a')]){_0xd06551[_0xd280('0x39')]=_[_0xd280('0x3c')](_0xd06551[_0xd280('0x39')],{'$or':_[_0xd280('0x3b')](_0xd06551[_0xd280('0x33')],function(_0x214f89){var _0x25d27a={};_0x25d27a[_0x214f89]={'$like':'%'+_0x1dff0e[_0xd280('0x32')][_0xd280('0x3a')]+'%'};return _0x25d27a;})});}_0xd06551=_['merge']({},_0xd06551,_0x1dff0e['options']);return _0x4a5155[_0xd280('0x58')](_0xd06551);}})[_0xd280('0x25')](function(_0xd164ea){if(_0xd164ea){_0x29289c=_0xd164ea[_0xd280('0x35')];if(!_0x1dff0e[_0xd280('0x32')][_0xd280('0x36')](_0xd280('0x59'))){_0xd06551['limit']=qs[_0xd280('0x1d')](_0x1dff0e[_0xd280('0x32')]['limit']);_0xd06551['offset']=qs[_0xd280('0x1c')](_0x1dff0e['query'][_0xd280('0x1c')]);}return _0x4a5155['getContacts'](_0xd06551);}})['then'](function(_0x5e798f){if(_0x5e798f){return _0x5e798f?{'count':_0x29289c,'rows':_0x5e798f}:null;}})['then'](respondWithResult(_0x3f7ad9,null))['catch'](handleError(_0x3f7ad9,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 4d6a93e..b940fae 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 _0x1afd=['moment','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','../../config/logger'];(function(_0xc84ed4,_0x3b8a6b){var _0x58b337=function(_0x303ddb){while(--_0x303ddb){_0xc84ed4['push'](_0xc84ed4['shift']());}};_0x58b337(++_0x3b8a6b);}(_0x1afd,0x1ac));var _0xd1af=function(_0x2fb175,_0x530dae){_0x2fb175=_0x2fb175-0x0;var _0x25e827=_0x1afd[_0x2fb175];return _0x25e827;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd1af('0x0'))('api');var moment=require(_0xd1af('0x1'));var BPromise=require('bluebird');var rp=require(_0xd1af('0x2'));var fs=require('fs');var path=require(_0xd1af('0x3'));var rimraf=require(_0xd1af('0x4'));var config=require(_0xd1af('0x5'));var attributes=require(_0xd1af('0x6'));module[_0xd1af('0x7')]=function(_0x27f002,_0x46f5df){return _0x27f002[_0xd1af('0x8')](_0xd1af('0x9'),attributes,{'tableName':_0xd1af('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x16f0=['../../config/environment','./cmCompany.attributes','exports','define','cm_companies','lodash','../../config/logger','moment','request-promise','rimraf'];(function(_0x22fb29,_0x359f3a){var _0x26cb08=function(_0xb379af){while(--_0xb379af){_0x22fb29['push'](_0x22fb29['shift']());}};_0x26cb08(++_0x359f3a);}(_0x16f0,0x91));var _0x016f=function(_0xd0fafb,_0x51aea0){_0xd0fafb=_0xd0fafb-0x0;var _0x375763=_0x16f0[_0xd0fafb];return _0x375763;};'use strict';var _=require(_0x016f('0x0'));var util=require('util');var logger=require(_0x016f('0x1'))('api');var moment=require(_0x016f('0x2'));var BPromise=require('bluebird');var rp=require(_0x016f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x016f('0x4'));var config=require(_0x016f('0x5'));var attributes=require(_0x016f('0x6'));module[_0x016f('0x7')]=function(_0x4d7b58,_0x1b2f1f){return _0x4d7b58[_0x016f('0x8')]('CmCompany',attributes,{'tableName':_0x016f('0x9'),'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 509d1c9..0435e05 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 _0x7c45=['../../config/environment','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7c45,0x13a));var _0x57c4=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x7c45[_0x4b7895];return _0x264180;};'use strict';var _=require('lodash');var util=require(_0x57c4('0x0'));var moment=require(_0x57c4('0x1'));var BPromise=require('bluebird');var rs=require(_0x57c4('0x2'));var fs=require('fs');var Redis=require(_0x57c4('0x3'));var db=require(_0x57c4('0x4'))['db'];var utils=require(_0x57c4('0x5'));var logger=require(_0x57c4('0x6'))(_0x57c4('0x7'));var config=require(_0x57c4('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x57c4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c9a72,_0x2a2524,_0x2f09da){return new BPromise(function(_0x3aea68,_0x42e781){return client[_0x57c4('0xa')](_0x1c9a72,_0x2f09da)[_0x57c4('0xb')](function(_0x4c3cf3){logger[_0x57c4('0xc')](_0x57c4('0xd'),_0x2a2524,_0x57c4('0xe'));logger[_0x57c4('0xf')](_0x57c4('0x10'),_0x2a2524,_0x57c4('0xe'),JSON[_0x57c4('0x11')](_0x4c3cf3));if(_0x4c3cf3[_0x57c4('0x12')]){if(_0x4c3cf3['error'][_0x57c4('0x13')]===0x1f4){logger[_0x57c4('0x12')]('CmCompany,\x20%s,\x20%s',_0x2a2524,_0x4c3cf3[_0x57c4('0x12')]['message']);return _0x42e781(_0x4c3cf3[_0x57c4('0x12')][_0x57c4('0x14')]);}logger[_0x57c4('0x12')](_0x57c4('0xd'),_0x2a2524,_0x4c3cf3[_0x57c4('0x12')][_0x57c4('0x14')]);return _0x3aea68(_0x4c3cf3[_0x57c4('0x12')][_0x57c4('0x14')]);}else{logger[_0x57c4('0xc')](_0x57c4('0xd'),_0x2a2524,_0x57c4('0xe'));_0x3aea68(_0x4c3cf3[_0x57c4('0x15')][_0x57c4('0x14')]);}})[_0x57c4('0x16')](function(_0x5eab3f){logger[_0x57c4('0x12')](_0x57c4('0xd'),_0x2a2524,_0x5eab3f);_0x42e781(_0x5eab3f);});});} \ No newline at end of file +var _0x82ce=['then','CmCompany,\x20%s,\x20%s','debug','stringify','error','message','info','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x261522,_0x1adc1f){var _0x98a25a=function(_0x1b0f9c){while(--_0x1b0f9c){_0x261522['push'](_0x261522['shift']());}};_0x98a25a(++_0x1adc1f);}(_0x82ce,0x65));var _0xe82c=function(_0x415df1,_0x3b1074){_0x415df1=_0x415df1-0x0;var _0x6d2a15=_0x82ce[_0x415df1];return _0x6d2a15;};'use strict';var _=require(_0xe82c('0x0'));var util=require(_0xe82c('0x1'));var moment=require(_0xe82c('0x2'));var BPromise=require(_0xe82c('0x3'));var rs=require(_0xe82c('0x4'));var fs=require('fs');var Redis=require(_0xe82c('0x5'));var db=require(_0xe82c('0x6'))['db'];var utils=require(_0xe82c('0x7'));var logger=require('../../config/logger')(_0xe82c('0x8'));var config=require(_0xe82c('0x9'));var jayson=require(_0xe82c('0xa'));var client=jayson[_0xe82c('0xb')][_0xe82c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5deab1,_0x32f173,_0x1cfa7b){return new BPromise(function(_0x2910ae,_0x485bf7){return client[_0xe82c('0xd')](_0x5deab1,_0x1cfa7b)[_0xe82c('0xe')](function(_0x151f95){logger['info'](_0xe82c('0xf'),_0x32f173,'request\x20sent');logger[_0xe82c('0x10')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x32f173,'request\x20sent',JSON[_0xe82c('0x11')](_0x151f95));if(_0x151f95['error']){if(_0x151f95[_0xe82c('0x12')]['code']===0x1f4){logger[_0xe82c('0x12')](_0xe82c('0xf'),_0x32f173,_0x151f95[_0xe82c('0x12')][_0xe82c('0x13')]);return _0x485bf7(_0x151f95[_0xe82c('0x12')][_0xe82c('0x13')]);}logger['error'](_0xe82c('0xf'),_0x32f173,_0x151f95['error']['message']);return _0x2910ae(_0x151f95[_0xe82c('0x12')]['message']);}else{logger[_0xe82c('0x14')](_0xe82c('0xf'),_0x32f173,_0xe82c('0x15'));_0x2910ae(_0x151f95['result'][_0xe82c('0x13')]);}})[_0xe82c('0x16')](function(_0x472199){logger[_0xe82c('0x12')](_0xe82c('0xf'),_0x32f173,_0x472199);_0x485bf7(_0x472199);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index a14e4cc..d9a13af 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 _0x3fdc=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','describe','getContacts','post','create','/:id/contacts','addContacts','delete','/:id','destroy','util','path','connect-timeout'];(function(_0x52c3af,_0x50a7f8){var _0x224822=function(_0x37d6ea){while(--_0x37d6ea){_0x52c3af['push'](_0x52c3af['shift']());}};_0x224822(++_0x50a7f8);}(_0x3fdc,0x1dd));var _0xc3fd=function(_0x79d58f,_0x3908dd){_0x79d58f=_0x79d58f-0x0;var _0x32cd2d=_0x3fdc[_0x79d58f];return _0x32cd2d;};'use strict';var multer=require('multer');var util=require(_0xc3fd('0x0'));var path=require(_0xc3fd('0x1'));var timeout=require(_0xc3fd('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc3fd('0x3'));var auth=require(_0xc3fd('0x4'));var interaction=require(_0xc3fd('0x5'));var config=require(_0xc3fd('0x6'));var controller=require(_0xc3fd('0x7'));router[_0xc3fd('0x8')]('/',auth[_0xc3fd('0x9')](),controller[_0xc3fd('0xa')]);router['get']('/describe',auth[_0xc3fd('0x9')](),controller[_0xc3fd('0xb')]);router[_0xc3fd('0x8')]('/:id',auth[_0xc3fd('0x9')](),controller['show']);router[_0xc3fd('0x8')]('/:id/contacts',auth[_0xc3fd('0x9')](),controller[_0xc3fd('0xc')]);router[_0xc3fd('0xd')]('/',auth['isAuthenticated'](),controller[_0xc3fd('0xe')]);router[_0xc3fd('0xd')](_0xc3fd('0xf'),auth['isAuthenticated'](),controller[_0xc3fd('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xc3fd('0x11')](_0xc3fd('0x12'),auth['isAuthenticated'](),controller[_0xc3fd('0x13')]);module['exports']=router; \ No newline at end of file +var _0x8506=['update','delete','destroy','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/contacts','getContacts','post','addContacts','put'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x8506,0xe8));var _0x6850=function(_0x555be7,_0x4de438){_0x555be7=_0x555be7-0x0;var _0x316e18=_0x8506[_0x555be7];return _0x316e18;};'use strict';var multer=require('multer');var util=require(_0x6850('0x0'));var path=require('path');var timeout=require(_0x6850('0x1'));var express=require('express');var router=express[_0x6850('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x6850('0x3'));var interaction=require(_0x6850('0x4'));var config=require(_0x6850('0x5'));var controller=require('./cmCompany.controller');router[_0x6850('0x6')]('/',auth[_0x6850('0x7')](),controller[_0x6850('0x8')]);router[_0x6850('0x6')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x6850('0x6')](_0x6850('0x9'),auth[_0x6850('0x7')](),controller['show']);router['get'](_0x6850('0xa'),auth[_0x6850('0x7')](),controller[_0x6850('0xb')]);router[_0x6850('0xc')]('/',auth[_0x6850('0x7')](),controller['create']);router[_0x6850('0xc')](_0x6850('0xa'),auth[_0x6850('0x7')](),controller[_0x6850('0xd')]);router[_0x6850('0xe')](_0x6850('0x9'),auth['isAuthenticated'](),controller[_0x6850('0xf')]);router[_0x6850('0x10')](_0x6850('0x9'),auth[_0x6850('0x7')](),controller[_0x6850('0x11')]);module[_0x6850('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 55a6d8b..61fd015 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 _0x84e7=['sequelize','exports','STRING','INTEGER','UNSIGNED','NOW','lodash'];(function(_0x3d8e9d,_0x4e2448){var _0x171c0a=function(_0x692c56){while(--_0x692c56){_0x3d8e9d['push'](_0x3d8e9d['shift']());}};_0x171c0a(++_0x4e2448);}(_0x84e7,0xf4));var _0x784e=function(_0x3afa16,_0x387d59){_0x3afa16=_0x3afa16-0x0;var _0xce287b=_0x84e7[_0x3afa16];return _0xce287b;};'use strict';var _=require(_0x784e('0x0'));var Sequelize=require(_0x784e('0x1'));module[_0x784e('0x2')]={'firstName':{'type':Sequelize[_0x784e('0x3')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x784e('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x784e('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x784e('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x784e('0x3')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x784e('0x3')]},'twitter':{'type':Sequelize[_0x784e('0x3')]},'skype':{'type':Sequelize[_0x784e('0x3')]},'teams':{'type':Sequelize[_0x784e('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x784e('0x3')]},'wechat':{'type':Sequelize[_0x784e('0x3')]},'telegram':{'type':Sequelize[_0x784e('0x3')]},'UserId':{'type':Sequelize[_0x784e('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x784e('0x3')]},'priority':{'type':Sequelize[_0x784e('0x4')](0x2)[_0x784e('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x784e('0x6')]},'dialTimezone':{'type':Sequelize[_0x784e('0x3')]},'utcOffset':{'type':Sequelize[_0x784e('0x4')]}}; \ No newline at end of file +var _0x4e29=['lodash','exports','STRING','TEXT','INTEGER','DATE','NOW'];(function(_0x58a003,_0x32ff0b){var _0x375357=function(_0x833b3a){while(--_0x833b3a){_0x58a003['push'](_0x58a003['shift']());}};_0x375357(++_0x32ff0b);}(_0x4e29,0x8c));var _0x94e2=function(_0x962fc5,_0x58f074){_0x962fc5=_0x962fc5-0x0;var _0x43667c=_0x4e29[_0x962fc5];return _0x43667c;};'use strict';var _=require(_0x94e2('0x0'));var Sequelize=require('sequelize');module[_0x94e2('0x1')]={'firstName':{'type':Sequelize[_0x94e2('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x94e2('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x94e2('0x2')]},'country':{'type':Sequelize[_0x94e2('0x2')]},'dateOfBirth':{'type':Sequelize[_0x94e2('0x2')]},'description':{'type':Sequelize[_0x94e2('0x3')]},'phone':{'type':Sequelize[_0x94e2('0x2')]},'mobile':{'type':Sequelize[_0x94e2('0x2')]},'fax':{'type':Sequelize[_0x94e2('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x94e2('0x2')]},'facebook':{'type':Sequelize[_0x94e2('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x94e2('0x2')]},'teams':{'type':Sequelize[_0x94e2('0x2')]},'viber':{'type':Sequelize[_0x94e2('0x2')]},'line':{'type':Sequelize[_0x94e2('0x2')]},'wechat':{'type':Sequelize[_0x94e2('0x2')]},'telegram':{'type':Sequelize[_0x94e2('0x2')]},'UserId':{'type':Sequelize[_0x94e2('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x94e2('0x2')]},'priority':{'type':Sequelize[_0x94e2('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x94e2('0x5')],'defaultValue':Sequelize[_0x94e2('0x6')]},'dialTimezone':{'type':Sequelize[_0x94e2('0x2')]},'utcOffset':{'type':Sequelize[_0x94e2('0x4')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 7f65300..459df2b 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 _0x2988=['ratingType','ratingValue','referer','subject','externalUrl','threadId','flatten','sortBy','reverse','value','slice','moment','bluebird','util','squel','papaparse','ioredis','../../components/contacts','../../components/parsers/qs','../../config/environment','../../config/environment/shared','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','status','offset','undefined','count','limit','set','Content-Range','json','update','then','end','sendStatus','error','stack','name','send','index','describe','getOptions','findAll','user','CmContact','params','catch','tags','length','keys','cf_','displayName','query','analytics','CmCustomField','columnName','alias','custom','type','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','merge','body','from','get','mergeWith','isArray','CmHopper','destroy','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappQueueReport','join','isNil','dialTimezone','timezones','utcOffset','additionalPhones','duplicates','where','$or','ListId','spread','push','contact','show','find','Tag','Tags','color','tag','Phones','sequelize','literal','Phones.OrderBy','$and','omit','map','pickBy','table','cm_contacts','id\x20=\x20?','toParam','text','phone','findOne','model','filters','intersection','attributes','fields','order','sort','filter','getTags','setTags','ids','setAdditionalPhones','all','ContactItemType','OrderBy','item_types','items','ItemTypeId','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','ItemType','CmHopperId','ItemType.OrderBy','bulkCreate','getAdditionalPhones','`ItemType`.OrderBy','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','getHoppers','rawAttributes','nolimit','ContactId','options','rows','getHopperHistories','pick','includeAll','CmHopperFinal','include','JscriptySessionReport','No\x20ListId\x20specified','No\x20association\x20keys\x20specified!','binding_values','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_keys','split','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','server/files/tmp','file','filename','chmodSync','child_process','../../components/import/cm/csv','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','meta','import','agent','fork','error\x20child\x20process','User','binding','../../components/import/cm/csvUpdates','stringify','message','start\x20child\x20process\x20correctly!','exit','mail','chat','sms','openchannel','whatsapp','voice','-createdAt','channel','includes','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','source','destination','callerid','starttime','note','userDisposition','userSecondDisposition','userThirdDisposition','UserId','createdAt','DESC','findAndCountAll','fullname','startCase','Account','closed','closedAt','disposition','secondDisposition','thirdDisposition','key','Owner','browserName','customerIp','deviceModel'];(function(_0xa883e3,_0x599111){var _0x23300a=function(_0x4abd7f){while(--_0x4abd7f){_0xa883e3['push'](_0xa883e3['shift']());}};_0x23300a(++_0x599111);}(_0x2988,0x107));var _0x8298=function(_0x54cca7,_0x2fe248){_0x54cca7=_0x54cca7-0x0;var _0x4019f2=_0x2988[_0x54cca7];return _0x4019f2;};'use strict';var moment=require(_0x8298('0x0'));var BPromise=require(_0x8298('0x1'));var util=require(_0x8298('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x8298('0x3'));var Papa=require(_0x8298('0x4'));var Redis=require(_0x8298('0x5'));var contacts=require(_0x8298('0x6'));var qs=require(_0x8298('0x7'));var logger=require('../../config/logger')('api');var config=require(_0x8298('0x8'));var shared=require(_0x8298('0x9'));var db=require(_0x8298('0xa'))['db'];config[_0x8298('0xb')]=_[_0x8298('0xc')](config[_0x8298('0xb')],{'host':_0x8298('0xd'),'port':0x18eb});var socket=require(_0x8298('0xe'))(new Redis(config[_0x8298('0xb')]));require(_0x8298('0xf'))[_0x8298('0x10')](socket);function respondWithResult(_0x4cff0e,_0x1e2fcd){_0x1e2fcd=_0x1e2fcd||0xc8;return function(_0x9be0fd){if(_0x9be0fd){return _0x4cff0e[_0x8298('0x11')](_0x1e2fcd)['json'](_0x9be0fd);}};}function respondWithFilteredResult(_0x44badb,_0x3d88a6){return function(_0x3a4294){if(_0x3a4294){var _0x44f700=typeof _0x3d88a6[_0x8298('0x12')]==='undefined'&&typeof _0x3d88a6['limit']===_0x8298('0x13');var _0x53b2f0=_0x3a4294[_0x8298('0x14')];var _0x284671=_0x44f700?0x0:_0x3d88a6[_0x8298('0x12')];var _0x5a2676=_0x44f700?_0x3a4294[_0x8298('0x14')]:_0x3d88a6[_0x8298('0x12')]+_0x3d88a6[_0x8298('0x15')];var _0x587aea;if(_0x5a2676>=_0x53b2f0){_0x5a2676=_0x53b2f0;_0x587aea=0xc8;}else{_0x587aea=0xce;}_0x44badb[_0x8298('0x11')](_0x587aea);return _0x44badb[_0x8298('0x16')](_0x8298('0x17'),_0x284671+'-'+_0x5a2676+'/'+_0x53b2f0)[_0x8298('0x18')](_0x3a4294);}return null;};}function saveUpdates(_0x38bfef){return function(_0x582dfa){if(_0x582dfa){return _0x582dfa[_0x8298('0x19')](_0x38bfef)[_0x8298('0x1a')](function(_0x22c46c){return _0x22c46c;});}return null;};}function removeEntity(_0x445451){return function(_0x203c7c){if(_0x203c7c){return _0x203c7c['destroy']()['then'](function(){_0x445451[_0x8298('0x11')](0xcc)[_0x8298('0x1b')]();});}};}function handleEntityNotFound(_0x506695){return function(_0x249b4c){if(!_0x249b4c){_0x506695[_0x8298('0x1c')](0x194);}return _0x249b4c;};}function handleError(_0x48005c,_0xd86148){_0xd86148=_0xd86148||0x1f4;return function(_0x2668a5){logger[_0x8298('0x1d')](_0x2668a5[_0x8298('0x1e')]);if(_0x2668a5['name']){delete _0x2668a5[_0x8298('0x1f')];}_0x48005c[_0x8298('0x11')](_0xd86148)[_0x8298('0x20')](_0x2668a5);};}exports[_0x8298('0x21')]=function(_0x51507c,_0x4d098f){var _0x52fbc7={};return contacts[_0x8298('0x22')]()[_0x8298('0x1a')](function(_0x2fbcf6){_0x52fbc7=qs[_0x8298('0x23')](_0x2fbcf6,_0x51507c);return contacts[_0x8298('0x24')](_0x51507c['query'],_0x51507c[_0x8298('0x25')],_0x52fbc7,_0x2fbcf6);})[_0x8298('0x1a')](respondWithFilteredResult(_0x4d098f,_0x52fbc7))['catch'](handleError(_0x4d098f,null));};exports['destroy']=function(_0x40ff2b,_0x2ca191){return db[_0x8298('0x26')]['find']({'where':{'id':_0x40ff2b[_0x8298('0x27')]['id']}})[_0x8298('0x1a')](handleEntityNotFound(_0x2ca191,null))['then'](removeEntity(_0x2ca191,null))[_0x8298('0x28')](handleError(_0x2ca191,null));};exports[_0x8298('0x22')]=function(_0x17ff62,_0x13b2d6){return db[_0x8298('0x26')][_0x8298('0x22')]()[_0x8298('0x1a')](function(_0x58800f){delete _0x58800f[_0x8298('0x29')];for(var _0x59fca3=0x0;_0x59fca30x0){return new Promise(function(_0x231894){var _0x2d577f=[];for(var _0x32252d=0x0;_0x32252d<_0x292114[_0x8298('0x2a')];_0x32252d++){_0x2d577f['push'](insertAdditionalPhones(_0x292114[_0x32252d][_0x8298('0x66')],_0x292114[_0x32252d][_0x8298('0x5f')]));}Promise['all'](_0x2d577f)[_0x8298('0x1a')](function(){_0x231894(0x1);});})[_0x8298('0x1a')](function(){return{'success':_0x53e6fc,'failure':_0x53a491,'duplicates':_0x37d1ae};});}else{return{'success':_0x53e6fc,'failure':_0x53a491,'duplicates':_0x37d1ae};}}})[_0x8298('0x1a')](respondWithResult(_0x19f6ff,0xc9))[_0x8298('0x28')](handleError(_0x19f6ff,null));};exports[_0x8298('0x67')]=function(_0x28acfc,_0x298a61){var _0x2771af;return db[_0x8298('0x26')][_0x8298('0x22')]()['then'](function(_0x3694bd){return db[_0x8298('0x26')][_0x8298('0x68')]({'where':{'id':_0x28acfc[_0x8298('0x27')]['id']},'include':[{'model':db[_0x8298('0x69')],'as':_0x8298('0x6a'),'attributes':['id',_0x8298('0x1f'),_0x8298('0x6b')],'required':_0x28acfc[_0x8298('0x2e')][_0x8298('0x6c')]?!![]:![]},{'model':db[_0x8298('0x50')],'as':_0x8298('0x6d'),'where':{'CmContactId':_0x28acfc[_0x8298('0x27')]['id']},'required':![],'include':[{'model':db['ContactItemType'],'as':'ItemType'}]}],'order':[db[_0x8298('0x6e')][_0x8298('0x6f')](_0x8298('0x70'))],'attributes':_['keys'](_0x3694bd)});})[_0x8298('0x1a')](function(_0x486a0e){if(!_[_0x8298('0x5b')](_0x486a0e)){_0x2771af=_0x486a0e['get']({'plain':!![]});var _0x9ef1dd={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x486a0e&&_0x486a0e[_0x8298('0x63')]){if(_0x486a0e[_0x8298('0x63')]){_0x9ef1dd[_0x8298('0x61')][_0x8298('0x71')]['push']({'ListId':{'$ne':_0x486a0e[_0x8298('0x63')]}});}}return db['CmCustomField'][_0x8298('0x24')](_0x9ef1dd);}})[_0x8298('0x1a')](function(_0x2f4016){if(!_[_0x8298('0x5b')](_0x2f4016)){return _[_0x8298('0x72')](_0x2771af,_[_0x8298('0x73')](_0x2f4016,function(_0x2d7a08){return util['format']('cf_%d',_0x2d7a08['id']);}));}})[_0x8298('0x1a')](handleEntityNotFound(_0x298a61,null))[_0x8298('0x1a')](respondWithResult(_0x298a61,null))[_0x8298('0x28')](handleError(_0x298a61,null));};exports[_0x8298('0x19')]=function(_0x49411d,_0x2151a8){var _0x4372a6;if(_0x49411d['body']['id']){delete _0x49411d['body']['id'];}if(!_[_0x8298('0x5b')](_0x49411d['body']['dialTimezone'])){var _0x90c7e0=_0x49411d[_0x8298('0x3b')]['dialTimezone'];if(!_[_0x8298('0x5b')](shared[_0x8298('0x5d')][_0x90c7e0]))_0x49411d[_0x8298('0x3b')]['utcOffset']=shared['timezones'][_0x90c7e0]['utcOffset'];}return db[_0x8298('0x26')]['find']({'where':{'id':_0x49411d[_0x8298('0x27')]['id']}})[_0x8298('0x1a')](handleEntityNotFound(_0x2151a8,null))[_0x8298('0x1a')](saveUpdates(_0x49411d[_0x8298('0x3b')],null))[_0x8298('0x1a')](function(_0x272133){_0x4372a6=_0x272133;var _0x4b1b={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x272133&&_0x272133['ListId']){if(_0x272133[_0x8298('0x63')]){_0x4b1b[_0x8298('0x61')]['$and'][_0x8298('0x65')]({'ListId':{'$ne':_0x272133['ListId']}});}}return db['CmCustomField']['findAll'](_0x4b1b);})[_0x8298('0x1a')](function(_0x36de75){if(_0x36de75){return _[_0x8298('0x72')](_[_0x8298('0x74')](_0x49411d[_0x8298('0x3b')],function(_0x545e73,_0x2c03a6){return _['startsWith'](_0x2c03a6,'cf_');}),_['map'](_0x36de75,function(_0x4ea7c1){return util['format']('cf_%d',_0x4ea7c1['id']);}));}})[_0x8298('0x1a')](function(_0x513b96){if(_0x513b96&&!_['isEmpty'](_0x513b96)){var _0x4e8ae1=squel['update']()[_0x8298('0x75')](_0x8298('0x76'))['setFields'](_0x513b96)[_0x8298('0x61')](_0x8298('0x77'),_0x49411d[_0x8298('0x27')]['id'])[_0x8298('0x78')]();return db[_0x8298('0x6e')][_0x8298('0x2e')](_0x4e8ae1[_0x8298('0x79')],{'replacements':_0x4e8ae1[_0x8298('0x35')]});}})['then'](function(){if(_0x49411d['body']['phone']&&_0x4372a6){return db['CmHopper'][_0x8298('0x19')]({'phone':_0x49411d[_0x8298('0x3b')][_0x8298('0x7a')],'OrderBy':0x0},{'where':{'ContactId':_0x4372a6['id']}});}})[_0x8298('0x1a')](function(){return _0x4372a6;})['then'](respondWithResult(_0x2151a8,null))[_0x8298('0x28')](handleError(_0x2151a8,null));};exports['getTags']=function(_0x1f0fa6,_0xf99137){var _0x5f3062={};var _0x4b259a={};var _0x55b402;var _0x2f7b64;return db[_0x8298('0x26')][_0x8298('0x7b')]({'where':{'id':_0x1f0fa6[_0x8298('0x27')]['id']}})[_0x8298('0x1a')](handleEntityNotFound(_0xf99137,null))[_0x8298('0x1a')](function(_0x889f83){if(_0x889f83){_0x55b402=_0x889f83;_0x4b259a[_0x8298('0x7c')]=_[_0x8298('0x2b')](db[_0x8298('0x69')]['rawAttributes']);_0x4b259a['query']=_['keys'](_0x1f0fa6[_0x8298('0x2e')]);_0x4b259a[_0x8298('0x7d')]=_[_0x8298('0x7e')](_0x4b259a[_0x8298('0x7c')],_0x4b259a[_0x8298('0x2e')]);_0x5f3062[_0x8298('0x7f')]=_[_0x8298('0x7e')](_0x4b259a['model'],qs[_0x8298('0x80')](_0x1f0fa6[_0x8298('0x2e')][_0x8298('0x80')]));_0x5f3062[_0x8298('0x7f')]=_0x5f3062['attributes'][_0x8298('0x2a')]?_0x5f3062[_0x8298('0x7f')]:_0x4b259a[_0x8298('0x7c')];_0x5f3062[_0x8298('0x81')]=qs[_0x8298('0x82')](_0x1f0fa6[_0x8298('0x2e')][_0x8298('0x82')]);_0x5f3062[_0x8298('0x61')]=qs[_0x8298('0x7d')](_['pick'](_0x1f0fa6[_0x8298('0x2e')],_0x4b259a[_0x8298('0x7d')]));if(_0x1f0fa6[_0x8298('0x2e')]['filter']){_0x5f3062[_0x8298('0x61')]=_[_0x8298('0x3a')](_0x5f3062[_0x8298('0x61')],{'$or':_[_0x8298('0x73')](_0x5f3062[_0x8298('0x7f')],function(_0x27e248){var _0x1b9206={};_0x1b9206[_0x27e248]={'$like':'%'+_0x1f0fa6[_0x8298('0x2e')][_0x8298('0x83')]+'%'};return _0x1b9206;})});}_0x5f3062=_[_0x8298('0x3a')]({},_0x5f3062,_0x1f0fa6['options']);return _0x55b402[_0x8298('0x84')](_0x5f3062);}})['then'](function(_0x57365d){if(_0x57365d){_0x2f7b64=_0x57365d[_0x8298('0x2a')];if(!_0x1f0fa6[_0x8298('0x2e')][_0x8298('0x39')]('nolimit')){_0x5f3062['limit']=qs[_0x8298('0x15')](_0x1f0fa6[_0x8298('0x2e')][_0x8298('0x15')]);_0x5f3062[_0x8298('0x12')]=qs[_0x8298('0x12')](_0x1f0fa6[_0x8298('0x2e')]['offset']);}return _0x55b402['getTags'](_0x5f3062);}})[_0x8298('0x1a')](function(_0x32cde8){if(_0x32cde8){return _0x32cde8?{'count':_0x2f7b64,'rows':_0x32cde8}:null;}})[_0x8298('0x1a')](respondWithResult(_0xf99137,null))[_0x8298('0x28')](handleError(_0xf99137,null));};exports[_0x8298('0x85')]=function(_0x435a0b,_0x393ff9){if(_0x435a0b[_0x8298('0x3b')]['id']){delete _0x435a0b[_0x8298('0x3b')]['id'];}return db[_0x8298('0x26')][_0x8298('0x7b')]({'where':{'id':_0x435a0b[_0x8298('0x27')]['id']}})[_0x8298('0x1a')](handleEntityNotFound(_0x393ff9,null))['then'](function(_0x216f9a){if(_0x216f9a){return _0x216f9a[_0x8298('0x85')](_0x435a0b[_0x8298('0x3b')][_0x8298('0x86')]||[]);}return null;})[_0x8298('0x1a')](respondWithResult(_0x393ff9,null))['catch'](handleError(_0x393ff9,null));};exports[_0x8298('0x87')]=function(_0x5384e6,_0x2f235a){var _0x104421=[];_0x104421[_0x8298('0x65')](addAdditionalPhones(_0x5384e6['body']));Promise[_0x8298('0x88')](_0x104421)[_0x8298('0x1a')](function(){_0x104421=[];_0x104421[_0x8298('0x65')](deleteCmHopperPhones(_0x5384e6[_0x8298('0x3b')]['id']));_0x104421[_0x8298('0x65')](addCmHopperPhones(_0x5384e6['body']['id']));Promise['all'](_0x104421)['then'](function(){return[0x1];})[_0x8298('0x1a')](respondWithResult(_0x2f235a,null));});};function addAdditionalPhones(_0x1f9761){var _0x513e3d;return new Promise(function(_0x4dfaf9){return db[_0x8298('0x50')][_0x8298('0x41')]({'where':{'CmContactId':_0x1f9761['id']}})[_0x8298('0x1a')](function(){db[_0x8298('0x89')][_0x8298('0x24')]({'raw':!![],'attributes':['id',_0x8298('0x8a')]})['then'](function(_0x16b7fe){var _0x33e18c=[];for(var _0x56fef9=0x0;_0x56fef9<_0x1f9761['items'][_0x8298('0x2a')];_0x56fef9++){var _0x5010de=_0x1f9761[_0x8298('0x8b')]?_[_0x8298('0x5b')](_0x1f9761[_0x8298('0x8b')][_0x56fef9])?'':_0x1f9761[_0x8298('0x8b')][_0x56fef9]:_0x1f9761[_0x8298('0x8c')][_0x56fef9][_0x8298('0x8d')]?_0x1f9761[_0x8298('0x8c')][_0x56fef9][_0x8298('0x8d')]:'';var _0x11d91e=_[_0x8298('0x5b')](_0x1f9761[_0x8298('0x8c')][_0x56fef9]['description'])?'':_0x1f9761[_0x8298('0x8c')][_0x56fef9]['description'];var _0x2bff44=_0x5010de+':'+_0x1f9761['items'][_0x56fef9][_0x8298('0x7a')]+'§'+_0x11d91e;if(_[_0x8298('0x5b')](_0x513e3d))_0x513e3d=_0x2bff44;else _0x513e3d+=';'+_0x2bff44;var _0x7ff063=null;var _0x30ef0e=null;if(_0x1f9761[_0x8298('0x8b')]){if(!_['isNil'](_0x1f9761[_0x8298('0x8b')][_0x56fef9])){_0x30ef0e=_[_0x8298('0x68')](_0x16b7fe,function(_0x530adb){return _0x530adb['id']===_0x1f9761[_0x8298('0x8b')][_0x56fef9];});if(!_[_0x8298('0x5b')](_0x30ef0e)){_0x7ff063=_0x30ef0e[_0x8298('0x8a')];}}}else{if(!_[_0x8298('0x5b')](_0x1f9761['items'][_0x56fef9])){_0x30ef0e=_[_0x8298('0x68')](_0x16b7fe,function(_0x5e3b15){return _0x5e3b15['id']===_0x1f9761[_0x8298('0x8c')][_0x56fef9]['ItemTypeId'];});if(!_[_0x8298('0x5b')](_0x30ef0e)){_0x7ff063=_0x56fef9;}}}if(_['isNil'](_0x7ff063)){_0x7ff063=0x64;}_0x33e18c[_0x8298('0x65')](addAdditionalPhone(_0x1f9761['id'],_0x1f9761['items'][_0x56fef9][_0x8298('0x7a')],_0x1f9761[_0x8298('0x8b')]?_[_0x8298('0x5b')](_0x1f9761[_0x8298('0x8b')][_0x56fef9])?null:_0x1f9761[_0x8298('0x8b')][_0x56fef9]:_0x1f9761[_0x8298('0x8c')][_0x56fef9]['ItemTypeId']?_0x1f9761[_0x8298('0x8c')][_0x56fef9][_0x8298('0x8d')]:null,_0x7ff063,_0x11d91e));}Promise[_0x8298('0x88')](_0x33e18c)[_0x8298('0x1a')](function(){db[_0x8298('0x26')][_0x8298('0x19')]({'AdditionalPhones':_0x513e3d},{'where':{'id':_0x1f9761['id']}})[_0x8298('0x1a')](function(){_0x4dfaf9(0x1);});});});});});}function addAdditionalPhone(_0x29f918,_0x4266ee,_0x1f8527,_0x10fcb4,_0x1a78ef){return db['CmContactHasItem']['find']({'where':{'CmContactId':_0x29f918,'item':_0x4266ee}})[_0x8298('0x1a')](function(_0x29b8ad){if(_0x29b8ad)logger['info'](_0x8298('0x8e'),_0x29b8ad);else{db[_0x8298('0x50')][_0x8298('0x45')]({'CmContactId':_0x29f918,'item':_0x4266ee,'ItemTypeId':_0x1f8527,'OrderBy':_0x10fcb4,'ItemClass':_0x8298('0x8f'),'description':_0x1a78ef});}});}function deleteCmHopperPhones(_0xb812a1){return new Promise(function(_0x3b670a){return db['CmHopper'][_0x8298('0x24')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0xb812a1}})[_0x8298('0x1a')](function(_0x3f147c){db[_0x8298('0x90')][_0x8298('0x41')]({'where':{'CmHopperId':{'$in':_['map'](_0x3f147c,'id')}}});})['then'](function(){_0x3b670a(0x1);});});}function addCmHopperPhones(_0x5bf237){return new Promise(function(_0x2d8f1a){return db[_0x8298('0x40')][_0x8298('0x24')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x5bf237}})[_0x8298('0x1a')](function(_0x36010d){var _0x5d1e55=[];_[_0x8298('0x73')](_0x36010d,function(_0x4342fc){_0x5d1e55[_0x8298('0x65')](createCmHopperPhone(_0x5bf237,_0x4342fc['id']));});Promise[_0x8298('0x88')](_0x5d1e55)['then'](function(){_0x2d8f1a(0x1);});});});}function createCmHopperPhone(_0x131ac0,_0x26a819){return new Promise(function(_0x4c737c){db[_0x8298('0x50')][_0x8298('0x24')]({'raw':!![],'attributes':['item',_0x8298('0x8a')],'where':{'CmContactId':_0x131ac0,'ItemClass':_0x8298('0x8f')},'include':[{'model':db[_0x8298('0x89')],'attributes':[_0x8298('0x8a')],'as':_0x8298('0x91')}],'order':['OrderBy',db['sequelize']['literal']('`ItemType`.OrderBy')]})[_0x8298('0x1a')](function(_0x2c5144){var _0x672e97=0x1;var _0x3fa85c=_[_0x8298('0x73')](_0x2c5144,function(_0x189a45){_0x189a45[_0x8298('0x92')]=_0x26a819;_0x189a45[_0x8298('0x7a')]=_0x189a45['item'];_0x189a45[_0x8298('0x8a')]=_0x672e97;delete _0x189a45[_0x8298('0x93')];_0x672e97=_0x672e97+0x1;return _0x189a45;});return db['CmHopperAdditionalPhone'][_0x8298('0x94')](_0x3fa85c,{});})[_0x8298('0x1a')](function(){_0x4c737c(0x1);});});}function insertAdditionalPhones(_0x33f213,_0x573869){return new Promise(function(_0xdf005f){var _0x2041f4=[];for(var _0x5c08ff=0x0;_0x5c08ff<_0x573869['length'];_0x5c08ff++){var _0xb61e43=_0x573869[_0x5c08ff];_0x2041f4[_0x8298('0x65')](parseContactItemType(_0xb61e43));}Promise['all'](_0x2041f4)[_0x8298('0x1a')](function(){var _0x338f71={'id':_0x33f213['id'],'items':_0x573869};return addAdditionalPhones(_0x338f71)[_0x8298('0x1a')](function(){return addCmHopperPhones(_0x33f213['id']);});})[_0x8298('0x1a')](function(){_0xdf005f(_0x33f213);});});}function parseContactItemType(_0x18bb51){return new Promise(function(_0x56fad6){if(_0x18bb51[_0x8298('0x39')](_0x8298('0x8d'))){_0x56fad6(_0x18bb51);}else{return db[_0x8298('0x89')][_0x8298('0x68')]({'where':{'name':_0x18bb51[_0x8298('0x91')]}})[_0x8298('0x1a')](function(_0x157e81){if(_[_0x8298('0x5b')](_0x157e81))_0x18bb51[_0x8298('0x8d')]=null;else _0x18bb51[_0x8298('0x8d')]=_0x157e81['id'];_0x56fad6(_0x18bb51);});}});}exports[_0x8298('0x95')]=function(_0x21ee33,_0x311326){return db[_0x8298('0x50')]['findAll']({'raw':!![],'where':{'CmContactId':_0x21ee33[_0x8298('0x27')]['id'],'ItemClass':_0x8298('0x8f')},'include':[{'model':db[_0x8298('0x89')],'as':_0x8298('0x91')}],'order':[['OrderBy'],[db[_0x8298('0x6e')][_0x8298('0x6f')](_0x8298('0x96'))]]})[_0x8298('0x1a')](function(_0x5d9cc3){return _0x5d9cc3;})['then'](respondWithResult(_0x311326,null))[_0x8298('0x28')](handleError(_0x311326,null));};exports[_0x8298('0x97')]=function(_0x204ec5,_0x334b05){return db[_0x8298('0x50')][_0x8298('0x24')]({'raw':!![],'where':{'CmContactId':_0x204ec5[_0x8298('0x3b')][_0x8298('0x98')]}})['then'](function(_0x3e5cc3){var _0x27ec73=_[_0x8298('0x73')](_0x3e5cc3,function(_0x3aa000){_0x3aa000[_0x8298('0x99')]=_0x204ec5[_0x8298('0x3b')][_0x8298('0x9a')];return _0x3aa000;});return db[_0x8298('0x50')][_0x8298('0x94')](_0x27ec73,{});})['then'](function(){return addCmHopperPhones(_0x204ec5[_0x8298('0x3b')][_0x8298('0x9a')]);})[_0x8298('0x1a')](function(){return['ok'];})[_0x8298('0x1a')](respondWithResult(_0x334b05,null))[_0x8298('0x28')](handleError(_0x334b05,null));};exports[_0x8298('0x9b')]=function(_0x5ec14b,_0x18ba78){var _0x555fb1=[];_0x555fb1[_0x8298('0x65')](createCmHopperPhone(_0x5ec14b['body']['id'],_0x5ec14b[_0x8298('0x3b')]['hopperId']));Promise[_0x8298('0x88')](_0x555fb1)[_0x8298('0x1a')](function(){return[0x1];})[_0x8298('0x1a')](respondWithResult(_0x18ba78,null));};exports[_0x8298('0x9c')]=function(_0x4fb722,_0x45b3cb){var _0x2525aa={'raw':![],'where':{}};var _0x3e51f0={};var _0x3f74b8={'count':0x0,'rows':[]};return db[_0x8298('0x26')][_0x8298('0x7b')]({'where':{'id':_0x4fb722[_0x8298('0x27')]['id']}})[_0x8298('0x1a')](handleEntityNotFound(_0x45b3cb,null))['then'](function(_0x394f32){if(_0x394f32){_0x3e51f0[_0x8298('0x7c')]=_[_0x8298('0x2b')](db[_0x8298('0x40')][_0x8298('0x9d')]);_0x3e51f0[_0x8298('0x2e')]=_[_0x8298('0x2b')](_0x4fb722[_0x8298('0x2e')]);_0x3e51f0[_0x8298('0x7d')]=_['intersection'](_0x3e51f0[_0x8298('0x7c')],_0x3e51f0[_0x8298('0x2e')]);_0x2525aa['attributes']=_[_0x8298('0x7e')](_0x3e51f0[_0x8298('0x7c')],qs[_0x8298('0x80')](_0x4fb722[_0x8298('0x2e')][_0x8298('0x80')]));_0x2525aa[_0x8298('0x7f')]=_0x2525aa['attributes'][_0x8298('0x2a')]?_0x2525aa[_0x8298('0x7f')]:_0x3e51f0[_0x8298('0x7c')];if(!_0x4fb722[_0x8298('0x2e')]['hasOwnProperty'](_0x8298('0x9e'))){_0x2525aa[_0x8298('0x15')]=qs[_0x8298('0x15')](_0x4fb722[_0x8298('0x2e')][_0x8298('0x15')]);_0x2525aa[_0x8298('0x12')]=qs[_0x8298('0x12')](_0x4fb722[_0x8298('0x2e')][_0x8298('0x12')]);}_0x2525aa[_0x8298('0x81')]=qs[_0x8298('0x82')](_0x4fb722[_0x8298('0x2e')][_0x8298('0x82')]);_0x2525aa[_0x8298('0x61')]=qs['filters'](_['pick'](_0x4fb722['query'],_0x3e51f0['filters']));_0x2525aa[_0x8298('0x61')][_0x8298('0x9f')]=_0x394f32['id'];if(_0x4fb722[_0x8298('0x2e')][_0x8298('0x83')]){_0x2525aa[_0x8298('0x61')]=_['merge'](_0x2525aa[_0x8298('0x61')],{'$or':_[_0x8298('0x73')](_0x2525aa[_0x8298('0x7f')],function(_0x3d405c){var _0x470294={};_0x470294[_0x3d405c]={'$like':'%'+_0x4fb722[_0x8298('0x2e')]['filter']+'%'};return _0x470294;})});}_0x2525aa=_[_0x8298('0x3a')]({},_0x2525aa,_0x4fb722[_0x8298('0xa0')]);return db[_0x8298('0x40')][_0x8298('0x14')]({'where':_0x2525aa[_0x8298('0x61')]})[_0x8298('0x1a')](function(_0x548219){_0x3f74b8['count']=_0x548219;if(_0x4fb722[_0x8298('0x2e')]['includeAll']){_0x2525aa['include']=[{'all':!![]}];}return db[_0x8298('0x40')][_0x8298('0x24')](_0x2525aa);})[_0x8298('0x1a')](function(_0x213e04){_0x3f74b8[_0x8298('0xa1')]=_0x213e04;return _0x3f74b8;});}})[_0x8298('0x1a')](respondWithFilteredResult(_0x45b3cb,_0x2525aa))[_0x8298('0x28')](handleError(_0x45b3cb,null));};exports[_0x8298('0xa2')]=function(_0x2196d4,_0x1e0d49){var _0x25244f={'raw':!![],'where':{}};var _0xe8a25e={};var _0x3cee4b={'count':0x0,'rows':[]};return db[_0x8298('0x26')][_0x8298('0x7b')]({'where':{'id':_0x2196d4['params']['id']}})[_0x8298('0x1a')](handleEntityNotFound(_0x1e0d49,null))[_0x8298('0x1a')](function(_0x4b4082){if(_0x4b4082){_0xe8a25e[_0x8298('0x7c')]=_['keys'](db[_0x8298('0x51')][_0x8298('0x9d')]);_0xe8a25e[_0x8298('0x2e')]=_['keys'](_0x2196d4[_0x8298('0x2e')]);_0xe8a25e[_0x8298('0x7d')]=_['intersection'](_0xe8a25e[_0x8298('0x7c')],_0xe8a25e[_0x8298('0x2e')]);_0x25244f['attributes']=_[_0x8298('0x7e')](_0xe8a25e[_0x8298('0x7c')],qs[_0x8298('0x80')](_0x2196d4['query'][_0x8298('0x80')]));_0x25244f[_0x8298('0x7f')]=_0x25244f[_0x8298('0x7f')]['length']?_0x25244f[_0x8298('0x7f')]:_0xe8a25e['model'];if(!_0x2196d4[_0x8298('0x2e')][_0x8298('0x39')](_0x8298('0x9e'))){_0x25244f[_0x8298('0x15')]=qs[_0x8298('0x15')](_0x2196d4[_0x8298('0x2e')][_0x8298('0x15')]);_0x25244f[_0x8298('0x12')]=qs[_0x8298('0x12')](_0x2196d4['query'][_0x8298('0x12')]);}_0x25244f[_0x8298('0x81')]=qs[_0x8298('0x82')](_0x2196d4[_0x8298('0x2e')][_0x8298('0x82')]);_0x25244f['where']=qs[_0x8298('0x7d')](_[_0x8298('0xa3')](_0x2196d4[_0x8298('0x2e')],_0xe8a25e[_0x8298('0x7d')]));_0x25244f[_0x8298('0x61')]['ContactId']=_0x4b4082['id'];if(_0x2196d4[_0x8298('0x2e')]['filter']){_0x25244f[_0x8298('0x61')]=_[_0x8298('0x3a')](_0x25244f[_0x8298('0x61')],{'$or':_[_0x8298('0x73')](_0x25244f['attributes'],function(_0x30b43d){var _0x3b468c={};_0x3b468c[_0x30b43d]={'$like':'%'+_0x2196d4['query']['filter']+'%'};return _0x3b468c;})});}_0x25244f=_['merge']({},_0x25244f,_0x2196d4[_0x8298('0xa0')]);return db['CmHopperHistory'][_0x8298('0x14')]({'where':_0x25244f[_0x8298('0x61')]})['then'](function(_0x48c3a8){_0x3cee4b[_0x8298('0x14')]=_0x48c3a8;if(_0x2196d4[_0x8298('0x2e')][_0x8298('0xa4')]){_0x25244f['include']=[{'all':!![]}];}return db[_0x8298('0x51')][_0x8298('0x24')](_0x25244f);})[_0x8298('0x1a')](function(_0x2def20){_0x3cee4b[_0x8298('0xa1')]=_0x2def20;return _0x3cee4b;});}})['then'](respondWithFilteredResult(_0x1e0d49,_0x25244f))['catch'](handleError(_0x1e0d49,null));};exports['getHopperFinals']=function(_0x2bd47d,_0x1be941){var _0xa9d6db={'raw':!![],'where':{}};var _0xfbfc78={};var _0x1985fd={'count':0x0,'rows':[]};return db[_0x8298('0x26')]['findOne']({'where':{'id':_0x2bd47d[_0x8298('0x27')]['id']}})[_0x8298('0x1a')](handleEntityNotFound(_0x1be941,null))[_0x8298('0x1a')](function(_0x172ae5){if(_0x172ae5){_0xfbfc78['model']=_[_0x8298('0x2b')](db[_0x8298('0xa5')][_0x8298('0x9d')]);_0xfbfc78[_0x8298('0x2e')]=_[_0x8298('0x2b')](_0x2bd47d['query']);_0xfbfc78['filters']=_[_0x8298('0x7e')](_0xfbfc78[_0x8298('0x7c')],_0xfbfc78['query']);_0xa9d6db[_0x8298('0x7f')]=_['intersection'](_0xfbfc78[_0x8298('0x7c')],qs[_0x8298('0x80')](_0x2bd47d['query'][_0x8298('0x80')]));_0xa9d6db[_0x8298('0x7f')]=_0xa9d6db[_0x8298('0x7f')]['length']?_0xa9d6db[_0x8298('0x7f')]:_0xfbfc78[_0x8298('0x7c')];if(!_0x2bd47d[_0x8298('0x2e')][_0x8298('0x39')](_0x8298('0x9e'))){_0xa9d6db['limit']=qs[_0x8298('0x15')](_0x2bd47d[_0x8298('0x2e')][_0x8298('0x15')]);_0xa9d6db[_0x8298('0x12')]=qs[_0x8298('0x12')](_0x2bd47d[_0x8298('0x2e')][_0x8298('0x12')]);}_0xa9d6db[_0x8298('0x81')]=qs['sort'](_0x2bd47d[_0x8298('0x2e')][_0x8298('0x82')]);_0xa9d6db[_0x8298('0x61')]=qs[_0x8298('0x7d')](_[_0x8298('0xa3')](_0x2bd47d[_0x8298('0x2e')],_0xfbfc78['filters']));_0xa9d6db[_0x8298('0x61')]['ContactId']=_0x172ae5['id'];if(_0x2bd47d[_0x8298('0x2e')][_0x8298('0x83')]){_0xa9d6db[_0x8298('0x61')]=_[_0x8298('0x3a')](_0xa9d6db['where'],{'$or':_['map'](_0xa9d6db[_0x8298('0x7f')],function(_0x35376a){var _0x4487fd={};_0x4487fd[_0x35376a]={'$like':'%'+_0x2bd47d[_0x8298('0x2e')][_0x8298('0x83')]+'%'};return _0x4487fd;})});}_0xa9d6db=_[_0x8298('0x3a')]({},_0xa9d6db,_0x2bd47d[_0x8298('0xa0')]);return db['CmHopperFinal'][_0x8298('0x14')]({'where':_0xa9d6db[_0x8298('0x61')]})[_0x8298('0x1a')](function(_0x2e9de9){_0x1985fd[_0x8298('0x14')]=_0x2e9de9;if(_0x2bd47d['query']['includeAll']){_0xa9d6db[_0x8298('0xa6')]=[{'all':!![]}];}return db[_0x8298('0xa5')][_0x8298('0x24')](_0xa9d6db);})[_0x8298('0x1a')](function(_0xbdd0c){_0x1985fd[_0x8298('0xa1')]=_0xbdd0c;return _0x1985fd;});}})[_0x8298('0x1a')](respondWithFilteredResult(_0x1be941,_0xa9d6db))[_0x8298('0x28')](handleError(_0x1be941,null));};exports['getJscriptySessions']=function(_0x18b5c1,_0x43b582){var _0x11824e={'raw':!![],'where':{}};var _0x6187c1={};var _0x5f2f33={'count':0x0,'rows':[]};return db[_0x8298('0x26')][_0x8298('0x7b')]({'where':{'id':_0x18b5c1[_0x8298('0x27')]['id']}})[_0x8298('0x1a')](handleEntityNotFound(_0x43b582,null))[_0x8298('0x1a')](function(_0x29ef74){if(_0x29ef74){_0x6187c1[_0x8298('0x7c')]=_[_0x8298('0x2b')](db[_0x8298('0xa7')]['rawAttributes']);_0x6187c1[_0x8298('0x2e')]=_[_0x8298('0x2b')](_0x18b5c1[_0x8298('0x2e')]);_0x6187c1[_0x8298('0x7d')]=_[_0x8298('0x7e')](_0x6187c1[_0x8298('0x7c')],_0x6187c1[_0x8298('0x2e')]);_0x11824e[_0x8298('0x7f')]=_[_0x8298('0x7e')](_0x6187c1['model'],qs[_0x8298('0x80')](_0x18b5c1['query'][_0x8298('0x80')]));_0x11824e[_0x8298('0x7f')]=_0x11824e[_0x8298('0x7f')]['length']?_0x11824e[_0x8298('0x7f')]:_0x6187c1[_0x8298('0x7c')];if(!_0x18b5c1[_0x8298('0x2e')][_0x8298('0x39')]('nolimit')){_0x11824e[_0x8298('0x15')]=qs['limit'](_0x18b5c1[_0x8298('0x2e')][_0x8298('0x15')]);_0x11824e['offset']=qs[_0x8298('0x12')](_0x18b5c1['query']['offset']);}_0x11824e['order']=qs[_0x8298('0x82')](_0x18b5c1['query'][_0x8298('0x82')]);_0x11824e[_0x8298('0x61')]=qs[_0x8298('0x7d')](_[_0x8298('0xa3')](_0x18b5c1[_0x8298('0x2e')],_0x6187c1[_0x8298('0x7d')]));_0x11824e['where'][_0x8298('0x9f')]=_0x29ef74['id'];if(_0x18b5c1[_0x8298('0x2e')][_0x8298('0x83')]){_0x11824e[_0x8298('0x61')]=_[_0x8298('0x3a')](_0x11824e['where'],{'$or':_[_0x8298('0x73')](_0x11824e[_0x8298('0x7f')],function(_0xe6760d){var _0x5edb0c={};_0x5edb0c[_0xe6760d]={'$like':'%'+_0x18b5c1[_0x8298('0x2e')][_0x8298('0x83')]+'%'};return _0x5edb0c;})});}_0x11824e=_[_0x8298('0x3a')]({},_0x11824e,_0x18b5c1[_0x8298('0xa0')]);return db[_0x8298('0xa7')]['count']({'where':_0x11824e[_0x8298('0x61')]})[_0x8298('0x1a')](function(_0x32c0f1){_0x5f2f33[_0x8298('0x14')]=_0x32c0f1;if(_0x18b5c1[_0x8298('0x2e')][_0x8298('0xa4')]){_0x11824e[_0x8298('0xa6')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x8298('0x24')](_0x11824e);})[_0x8298('0x1a')](function(_0x14631b){_0x5f2f33[_0x8298('0xa1')]=_0x14631b;return _0x5f2f33;});}})[_0x8298('0x1a')](respondWithFilteredResult(_0x43b582,_0x11824e))[_0x8298('0x28')](handleError(_0x43b582,null));};exports['uploadCsv']=function(_0x448832,_0x2cb114){try{if(!_0x448832[_0x8298('0x3b')][_0x8298('0x63')]){throw new Error(_0x8298('0xa8'));}if(!_0x448832[_0x8298('0x3b')]['binding_keys']){throw new Error(_0x8298('0xa9'));}if(!_0x448832[_0x8298('0x3b')][_0x8298('0xaa')]){throw new Error('No\x20association\x20values\x20specified!');}if(!_0x448832[_0x8298('0x3b')][_0x8298('0xab')]){throw new Error(_0x8298('0xac'));}var _0xe2078e=_0x448832[_0x8298('0x3b')][_0x8298('0xad')][_0x8298('0xae')](',');var _0x5898a3=_0x448832[_0x8298('0x3b')][_0x8298('0xaa')]['split'](',');if(!_0xe2078e['length']||!_0x5898a3['length']||_0xe2078e[_0x8298('0x2a')]!==_0x5898a3[_0x8298('0x2a')]){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x448832['body'][_0x8298('0x80')]=_['zipObject'](_0xe2078e,_0x5898a3);if(!_0x448832[_0x8298('0x3b')][_0x8298('0x80')]['phone']){throw new Error(_0x8298('0xaf'));}if(!_0x448832['body'][_0x8298('0x80')][_0x8298('0xb0')]){throw new Error(_0x8298('0xb1'));}var _0x1df6c7=path[_0x8298('0x5a')](config['root'],_0x8298('0xb2'),_0x448832[_0x8298('0xb3')][_0x8298('0xb4')]);fs[_0x8298('0xb5')](_0x1df6c7,parseInt('0777',0x8));var _0x4d912c=require(_0x8298('0xb6'))['fork'](path[_0x8298('0x5a')](__dirname,_0x8298('0xb7')),[_0x1df6c7,_0x448832[_0x8298('0x3b')][_0x8298('0xad')],_0x448832[_0x8298('0x3b')][_0x8298('0xaa')],_0x448832['body'][_0x8298('0x63')],_0x448832[_0x8298('0x3b')]['CompanyId'],_0x448832['body'][_0x8298('0x60')],_0x448832[_0x8298('0x3b')][_0x8298('0xab')]]);return _0x2cb114[_0x8298('0x11')](0xc8)[_0x8298('0x18')]({'message':_0x8298('0xb8'),'pid':_0x4d912c[_0x8298('0xb9')]});}catch(_0x30cc50){return _0x2cb114['status'](0x1f4)[_0x8298('0x20')](_0x30cc50);}};exports[_0x8298('0xba')]=function(_0x3514fe,_0x2f6626){var _0x9317b0=fs[_0x8298('0xbb')](_0x3514fe[_0x8298('0xb3')]['path']);Papa[_0x8298('0xbc')](_0x9317b0,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x29c3aa){return _0x2f6626[_0x8298('0x11')](0xc8)[_0x8298('0x18')]({'file':_0x3514fe[_0x8298('0xb3')],'fields':_0x29c3aa[_0x8298('0xbd')][_0x8298('0x80')]});}});};exports[_0x8298('0xbe')]=function(_0x1de396,_0x4d1003){return db['User']['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x8298('0xbf')}})[_0x8298('0x1a')](function(_0x241e47){var _0x326f80=![];if(!_0x1de396[_0x8298('0x3b')][_0x8298('0x63')]){throw new Error(_0x8298('0xa8'));}if(!_0x1de396[_0x8298('0x3b')]['binding']['phone']){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x1de396[_0x8298('0x3b')]['binding'][_0x8298('0xb0')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x1de396[_0x8298('0x3b')][_0x8298('0xab')]){throw new Error(_0x8298('0xac'));}var _0x316d7c=require(_0x8298('0xb6'))[_0x8298('0xc0')](path[_0x8298('0x5a')](__dirname,'../../components/import/cm/csv2'),[_0x1de396['params']['id'],JSON['stringify'](_0x1de396['body']),JSON['stringify'](_0x241e47)]);_0x316d7c['on']('message',function(){_0x326f80=!![];return _0x4d1003[_0x8298('0x11')](0xc8)[_0x8298('0x18')]({'message':'start\x20child\x20process\x20correctly!','pid':_0x316d7c[_0x8298('0xb9')]});});_0x316d7c['on']('exit',function(_0x3b3a84){if(_0x3b3a84&&!_0x326f80){return _0x4d1003[_0x8298('0x11')](0x1f4)[_0x8298('0x18')]({'message':_0x8298('0xc1'),'pid':_0x316d7c[_0x8298('0xb9')]});}});})[_0x8298('0x28')](handleError(_0x4d1003,null));};exports['importUpdates']=function(_0x16ac9e,_0x5dbc14){return db[_0x8298('0xc2')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x8298('0xbf')}})[_0x8298('0x1a')](function(_0x310f2c){var _0x3e9631=![];if(!_0x16ac9e[_0x8298('0x3b')][_0x8298('0x63')]){throw new Error(_0x8298('0xa8'));}if(!_0x16ac9e[_0x8298('0x3b')][_0x8298('0xc3')][_0x8298('0x7a')]){throw new Error(_0x8298('0xaf'));}if(!_0x16ac9e[_0x8298('0x3b')]['binding'][_0x8298('0xb0')]){throw new Error(_0x8298('0xb1'));}if(!_0x16ac9e[_0x8298('0x3b')]['socket_timestamp']){throw new Error(_0x8298('0xac'));}var _0x1d58fc=require(_0x8298('0xb6'))[_0x8298('0xc0')](path[_0x8298('0x5a')](__dirname,_0x8298('0xc4')),[_0x16ac9e[_0x8298('0x27')]['id'],JSON[_0x8298('0xc5')](_0x16ac9e[_0x8298('0x3b')]),JSON[_0x8298('0xc5')](_0x310f2c)]);_0x1d58fc['on'](_0x8298('0xc6'),function(){_0x3e9631=!![];return _0x5dbc14[_0x8298('0x11')](0xc8)[_0x8298('0x18')]({'message':_0x8298('0xc7'),'pid':_0x1d58fc[_0x8298('0xb9')]});});_0x1d58fc['on'](_0x8298('0xc8'),function(_0x3df256){if(_0x3df256&&!_0x3e9631){return _0x5dbc14['status'](0x1f4)[_0x8298('0x18')]({'message':'error\x20child\x20process','pid':_0x1d58fc[_0x8298('0xb9')]});}});})[_0x8298('0x28')](handleError(_0x5dbc14,null));};exports['getJourney']=function(_0x1dcf16,_0x277067){var _0x1299c9=[_0x8298('0xc9'),_0x8298('0xca'),_0x8298('0xcb'),_0x8298('0xcc'),'fax',_0x8298('0xcd'),_0x8298('0xce')];var _0x543c9={'offset':0x0,'order':qs['sort'](_0x8298('0xcf'))},_0x2a70fb={'count':0x0,'rows':[]};Promise['resolve']()['then'](function(){if(_0x1dcf16['query'][_0x8298('0xd0')]){if(!_[_0x8298('0xd1')](_0x1299c9,_0x1dcf16[_0x8298('0x2e')][_0x8298('0xd0')][_0x8298('0xd2')]())){throw new Error('Invalid\x20channel');}_0x1299c9=[_0x1dcf16[_0x8298('0x2e')][_0x8298('0xd0')][_0x8298('0xd2')]()];}if(_0x1dcf16[_0x8298('0x2e')][_0x8298('0xd3')]){try{var _0x5900f1=JSON[_0x8298('0xbc')](_0x1dcf16[_0x8298('0x2e')][_0x8298('0xd3')]);if(!moment(_0x5900f1[_0x8298('0x3c')])[_0x8298('0xd4')]()){throw new Error(_0x8298('0xd5'));}if(!moment(_0x5900f1['to'])[_0x8298('0xd4')]()){throw new Error(_0x8298('0xd6'));}}catch(_0x46ac05){throw new Error(_0x8298('0xd7'));}}if(!_0x1dcf16[_0x8298('0x2e')][_0x8298('0x39')](_0x8298('0x9e'))){_0x543c9[_0x8298('0x15')]=qs[_0x8298('0x15')](_0x1dcf16[_0x8298('0x2e')][_0x8298('0x15')]||0xa);_0x543c9['offset']=qs[_0x8298('0x12')](_0x1dcf16['query'][_0x8298('0x12')]);}var _0x32004a=_0x1299c9[_0x8298('0x73')](function(_0x3ebb49){if(_0x3ebb49==='voice'){var _0x597871={'attributes':['id','uniqueid',_0x8298('0x34'),_0x8298('0xd8'),_0x8298('0xd9'),_0x8298('0xda'),_0x8298('0xdb'),'endtime','duration',_0x8298('0xdc'),'createdAt',_0x8298('0xdd'),_0x8298('0xde'),_0x8298('0xdf'),_0x8298('0xe0')],'where':{'ContactId':_0x1dcf16[_0x8298('0x27')]['id']},'include':[{'model':db[_0x8298('0xc2')],'as':'User','attributes':['id',_0x8298('0x1f'),'fullname','alias']}],'order':[[_0x8298('0xe1'),_0x8298('0xe2')]]};if(_0x1dcf16['query'][_0x8298('0xd3')]){_0x597871[_0x8298('0x61')]['createdAt']={'$gte':_0x5900f1[_0x8298('0x3c')],'$lte':_0x5900f1['to']};}return db[_0x8298('0x53')][_0x8298('0xe3')](_0x597871)['then'](function(_0x15d46c){_0x2a70fb[_0x8298('0x14')]+=_0x15d46c[_0x8298('0x14')];return _[_0x8298('0x73')](_0x15d46c[_0x8298('0xa1')],function(_0x4f969b){var _0x4c7bf2=_0x4f969b[_0x8298('0x3d')]({'plain':!![]});_0x4c7bf2[_0x8298('0xd0')]=_0x3ebb49;if(_0x4c7bf2['User']){_0x4c7bf2[_0x8298('0xc2')]={'id':_0x4c7bf2['User']['id'],'name':_0x4c7bf2[_0x8298('0xc2')][_0x8298('0x1f')],'fullname':_0x4c7bf2[_0x8298('0xc2')][_0x8298('0xe4')],'alias':_0x4c7bf2['User'][_0x8298('0x32')]};}return _0x4c7bf2;});});}else{var _0x7ab9c7=_[_0x8298('0xe5')](_0x3ebb49)+(_0x3ebb49===_0x8298('0xca')?'Website':_0x8298('0xe6'));var _0x592e45={'attributes':['id',_0x8298('0xe7'),_0x8298('0xe8'),_0x8298('0xe1'),_0x8298('0xdc'),_0x8298('0xe9'),_0x8298('0xea'),_0x8298('0xeb'),_0x8298('0xe0'),_0x7ab9c7+'Id'],'where':{'ContactId':_0x1dcf16[_0x8298('0x27')]['id']},'include':[{'model':db[_0x7ab9c7],'as':_0x8298('0xe6'),'attributes':['id','name',_0x8298('0xec')]},{'model':db[_0x8298('0xc2')],'as':_0x8298('0xed'),'attributes':['id','name','fullname']},{'model':db[_0x8298('0x69')],'as':_0x8298('0x6a'),'attributes':['id',_0x8298('0x1f'),_0x8298('0x6b')],'through':{'attributes':[]}}],'order':[[_0x8298('0xe1'),_0x8298('0xe2')]]};if(_0x1dcf16['query']['range']){_0x592e45[_0x8298('0x61')][_0x8298('0xe1')]={'$gte':_0x5900f1[_0x8298('0x3c')],'$lte':_0x5900f1['to']};}switch(_0x3ebb49){case _0x8298('0xca'):_0x592e45['attributes']['push'](_0x8298('0xee'),_0x8298('0xef'),'customerPort',_0x8298('0xf0'),'osName','ratingMessage',_0x8298('0xf1'),_0x8298('0xf2'),_0x8298('0xf3'));break;case _0x8298('0xc9'):_0x592e45[_0x8298('0x7f')]['push'](_0x8298('0xf4'),'substatus');break;case _0x8298('0xcc'):_0x592e45[_0x8298('0x7f')]['push'](_0x8298('0xf5'),_0x8298('0xf6'));break;}return db[_[_0x8298('0xe5')](_0x3ebb49)+'Interaction']['findAndCountAll'](_0x592e45)[_0x8298('0x1a')](function(_0x531e76){_0x2a70fb[_0x8298('0x14')]+=_0x531e76['count'];return _[_0x8298('0x73')](_0x531e76[_0x8298('0xa1')],function(_0x11a765){var _0xd9a6bd=_0x11a765['get']({'plain':!![]});_0xd9a6bd[_0x8298('0xd0')]=_0x3ebb49;if(_0xd9a6bd['Owner']){_0xd9a6bd['Owner']={'id':_0xd9a6bd['Owner']['id'],'name':_0xd9a6bd['Owner'][_0x8298('0x1f')],'fullname':_0xd9a6bd[_0x8298('0xed')][_0x8298('0xe4')]};}return _0xd9a6bd;});});}});return Promise[_0x8298('0x88')](_0x32004a);})[_0x8298('0x1a')](function(_0x4797a8){return _(_0x4797a8)[_0x8298('0xf7')]()[_0x8298('0xf8')]('createdAt')[_0x8298('0xf9')]()[_0x8298('0xfa')]();})[_0x8298('0x1a')](function(_0x1de256){_0x2a70fb[_0x8298('0xa1')]=_0x543c9[_0x8298('0x15')]?_0x1de256[_0x8298('0xfb')](_0x543c9['offset'],_0x543c9[_0x8298('0x12')]+_0x543c9[_0x8298('0x15')]):_0x1de256;return _0x2a70fb;})[_0x8298('0x1a')](respondWithFilteredResult(_0x277067,_0x543c9))[_0x8298('0x28')](handleError(_0x277067,null));}; \ No newline at end of file +var _0xfce5=['CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','ChatQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','create','dialTimezone','isNil','timezones','utcOffset','bulkCreate','each','duplicates','where','push','ListId','findOrCreate','spread','contact','additionalPhones','all','show','Tag','Tags','color','tag','Phones','ContactItemType','ItemType','Phones.OrderBy','$and','omit','map','format','cf_%d','isEmpty','cm_contacts','toParam','text','values','phone','getTags','findOne','rawAttributes','filters','intersection','model','fields','attributes','order','filter','options','setTags','setAdditionalPhones','OrderBy','items','item_types','description','ItemTypeId','contact\x20phone\x20exists','PHONE','sequelize','literal','`ItemType`.OrderBy','CmHopperId','item','ItemType.OrderBy','CmHopperAdditionalPhone','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','toContactId','rescheduleAdditionalPhones','hopperId','sort','pick','ContactId','include','getHopperHistories','nolimit','includeAll','rows','getJscriptySessions','uploadCsv','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','binding_values','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','file','chmodSync','0777','child_process','fork','binding_keys','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','path','meta','User','agent','No\x20ListId\x20specified','binding','../../components/import/cm/csv2','stringify','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','../../components/import/cm/csvUpdates','message','getJourney','chat','sms','openchannel','fax','whatsapp','voice','resolve','includes','channel','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','source','callerid','duration','note','createdAt','userSecondDisposition','UserId','findAndCountAll','fullname','startCase','Website','Account','closed','closedAt','disposition','secondDisposition','thirdDisposition','key','Owner','DESC','customerIp','osName','ratingMessage','ratingType','ratingValue','referer','mail','subject','externalUrl','threadId','Interaction','flatten','sortBy','reverse','moment','bluebird','util','lodash','squel','papaparse','../../components/contacts','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/environment/shared','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','status','offset','undefined','limit','count','set','Content-Range','json','then','destroy','end','sendStatus','error','stack','name','send','getOptions','query','user','catch','CmContact','find','params','describe','tags','keys','length','startsWith','cf_','columnName','displayName','analytics','CmCustomField','findAll','alias','custom','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','merge','body','from','get','mergeWith','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','update','ChatMessage','ChatOfflineMessage','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage'];(function(_0x5ef161,_0x27d16c){var _0x1c6e9e=function(_0x8fc2a6){while(--_0x8fc2a6){_0x5ef161['push'](_0x5ef161['shift']());}};_0x1c6e9e(++_0x27d16c);}(_0xfce5,0x1b0));var _0x5fce=function(_0x1e50fc,_0x3d2684){_0x1e50fc=_0x1e50fc-0x0;var _0x497f51=_0xfce5[_0x1e50fc];return _0x497f51;};'use strict';var moment=require(_0x5fce('0x0'));var BPromise=require(_0x5fce('0x1'));var util=require(_0x5fce('0x2'));var path=require('path');var fs=require('fs');var _=require(_0x5fce('0x3'));var squel=require(_0x5fce('0x4'));var Papa=require(_0x5fce('0x5'));var Redis=require('ioredis');var contacts=require(_0x5fce('0x6'));var qs=require(_0x5fce('0x7'));var logger=require(_0x5fce('0x8'))('api');var config=require(_0x5fce('0x9'));var shared=require(_0x5fce('0xa'));var db=require(_0x5fce('0xb'))['db'];config[_0x5fce('0xc')]=_[_0x5fce('0xd')](config['redis'],{'host':_0x5fce('0xe'),'port':0x18eb});var socket=require(_0x5fce('0xf'))(new Redis(config[_0x5fce('0xc')]));require(_0x5fce('0x10'))[_0x5fce('0x11')](socket);function respondWithResult(_0x2c7195,_0x53884f){_0x53884f=_0x53884f||0xc8;return function(_0xbea4c6){if(_0xbea4c6){return _0x2c7195[_0x5fce('0x12')](_0x53884f)['json'](_0xbea4c6);}};}function respondWithFilteredResult(_0x5efe92,_0x4e12e6){return function(_0x12d656){if(_0x12d656){var _0x1f4e8a=typeof _0x4e12e6[_0x5fce('0x13')]===_0x5fce('0x14')&&typeof _0x4e12e6[_0x5fce('0x15')]===_0x5fce('0x14');var _0x4f7bbd=_0x12d656[_0x5fce('0x16')];var _0x1cb496=_0x1f4e8a?0x0:_0x4e12e6[_0x5fce('0x13')];var _0x4894be=_0x1f4e8a?_0x12d656[_0x5fce('0x16')]:_0x4e12e6[_0x5fce('0x13')]+_0x4e12e6[_0x5fce('0x15')];var _0x47ae08;if(_0x4894be>=_0x4f7bbd){_0x4894be=_0x4f7bbd;_0x47ae08=0xc8;}else{_0x47ae08=0xce;}_0x5efe92[_0x5fce('0x12')](_0x47ae08);return _0x5efe92[_0x5fce('0x17')](_0x5fce('0x18'),_0x1cb496+'-'+_0x4894be+'/'+_0x4f7bbd)[_0x5fce('0x19')](_0x12d656);}return null;};}function saveUpdates(_0x3bc1c7){return function(_0x8c25e9){if(_0x8c25e9){return _0x8c25e9['update'](_0x3bc1c7)[_0x5fce('0x1a')](function(_0x18f38c){return _0x18f38c;});}return null;};}function removeEntity(_0x3f31f2){return function(_0x5af9f3){if(_0x5af9f3){return _0x5af9f3[_0x5fce('0x1b')]()[_0x5fce('0x1a')](function(){_0x3f31f2[_0x5fce('0x12')](0xcc)[_0x5fce('0x1c')]();});}};}function handleEntityNotFound(_0x4a691f){return function(_0x3801c6){if(!_0x3801c6){_0x4a691f[_0x5fce('0x1d')](0x194);}return _0x3801c6;};}function handleError(_0x2e8a65,_0x3e63b2){_0x3e63b2=_0x3e63b2||0x1f4;return function(_0x415bb9){logger[_0x5fce('0x1e')](_0x415bb9[_0x5fce('0x1f')]);if(_0x415bb9[_0x5fce('0x20')]){delete _0x415bb9[_0x5fce('0x20')];}_0x2e8a65[_0x5fce('0x12')](_0x3e63b2)[_0x5fce('0x21')](_0x415bb9);};}exports['index']=function(_0x5e323a,_0x57f479){var _0x24a49f={};return contacts['describe']()['then'](function(_0x3582df){_0x24a49f=qs[_0x5fce('0x22')](_0x3582df,_0x5e323a);return contacts['findAll'](_0x5e323a[_0x5fce('0x23')],_0x5e323a[_0x5fce('0x24')],_0x24a49f,_0x3582df);})[_0x5fce('0x1a')](respondWithFilteredResult(_0x57f479,_0x24a49f))[_0x5fce('0x25')](handleError(_0x57f479,null));};exports[_0x5fce('0x1b')]=function(_0x4e63c9,_0x291481){return db[_0x5fce('0x26')][_0x5fce('0x27')]({'where':{'id':_0x4e63c9[_0x5fce('0x28')]['id']}})[_0x5fce('0x1a')](handleEntityNotFound(_0x291481,null))[_0x5fce('0x1a')](removeEntity(_0x291481,null))[_0x5fce('0x25')](handleError(_0x291481,null));};exports[_0x5fce('0x29')]=function(_0x5c487b,_0x1aac97){return db[_0x5fce('0x26')]['describe']()[_0x5fce('0x1a')](function(_0x3e1069){delete _0x3e1069[_0x5fce('0x2a')];for(var _0x1d0723=0x0;_0x1d07230x0){return new Promise(function(_0x2addfd){var _0x521b60=[];for(var _0x5bba46=0x0;_0x5bba46<_0x52ecf5[_0x5fce('0x2c')];_0x5bba46++){_0x521b60[_0x5fce('0x64')](insertAdditionalPhones(_0x52ecf5[_0x5bba46][_0x5fce('0x68')],_0x52ecf5[_0x5bba46][_0x5fce('0x69')]));}Promise[_0x5fce('0x6a')](_0x521b60)['then'](function(){_0x2addfd(0x1);});})[_0x5fce('0x1a')](function(){return{'success':_0x3483b4,'failure':_0x5a218c,'duplicates':_0x4fac3a};});}else{return{'success':_0x3483b4,'failure':_0x5a218c,'duplicates':_0x4fac3a};}}})[_0x5fce('0x1a')](respondWithResult(_0x7b7763,0xc9))[_0x5fce('0x25')](handleError(_0x7b7763,null));};exports[_0x5fce('0x6b')]=function(_0x424516,_0x5dd5d0){var _0x572a99;return db[_0x5fce('0x26')][_0x5fce('0x29')]()[_0x5fce('0x1a')](function(_0x4400d3){return db[_0x5fce('0x26')]['find']({'where':{'id':_0x424516[_0x5fce('0x28')]['id']},'include':[{'model':db[_0x5fce('0x6c')],'as':_0x5fce('0x6d'),'attributes':['id',_0x5fce('0x20'),_0x5fce('0x6e')],'required':_0x424516['query'][_0x5fce('0x6f')]?!![]:![]},{'model':db[_0x5fce('0x50')],'as':_0x5fce('0x70'),'where':{'CmContactId':_0x424516[_0x5fce('0x28')]['id']},'required':![],'include':[{'model':db[_0x5fce('0x71')],'as':_0x5fce('0x72')}]}],'order':[db['sequelize']['literal'](_0x5fce('0x73'))],'attributes':_['keys'](_0x4400d3)});})[_0x5fce('0x1a')](function(_0x3af9e1){if(!_['isNil'](_0x3af9e1)){_0x572a99=_0x3af9e1[_0x5fce('0x3d')]({'plain':!![]});var _0x3677ed={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x3af9e1&&_0x3af9e1[_0x5fce('0x65')]){if(_0x3af9e1['ListId']){_0x3677ed['where'][_0x5fce('0x74')]['push']({'ListId':{'$ne':_0x3af9e1[_0x5fce('0x65')]}});}}return db[_0x5fce('0x32')][_0x5fce('0x33')](_0x3677ed);}})[_0x5fce('0x1a')](function(_0x3afce3){if(!_[_0x5fce('0x5d')](_0x3afce3)){return _[_0x5fce('0x75')](_0x572a99,_[_0x5fce('0x76')](_0x3afce3,function(_0x3f5bec){return util[_0x5fce('0x77')]('cf_%d',_0x3f5bec['id']);}));}})[_0x5fce('0x1a')](handleEntityNotFound(_0x5dd5d0,null))[_0x5fce('0x1a')](respondWithResult(_0x5dd5d0,null))[_0x5fce('0x25')](handleError(_0x5dd5d0,null));};exports[_0x5fce('0x46')]=function(_0x12a3de,_0x5bf783){var _0x409488;if(_0x12a3de[_0x5fce('0x3b')]['id']){delete _0x12a3de[_0x5fce('0x3b')]['id'];}if(!_[_0x5fce('0x5d')](_0x12a3de[_0x5fce('0x3b')][_0x5fce('0x5c')])){var _0x4c1a0d=_0x12a3de[_0x5fce('0x3b')][_0x5fce('0x5c')];if(!_['isNil'](shared['timezones'][_0x4c1a0d]))_0x12a3de[_0x5fce('0x3b')][_0x5fce('0x5f')]=shared[_0x5fce('0x5e')][_0x4c1a0d][_0x5fce('0x5f')];}return db[_0x5fce('0x26')][_0x5fce('0x27')]({'where':{'id':_0x12a3de[_0x5fce('0x28')]['id']}})[_0x5fce('0x1a')](handleEntityNotFound(_0x5bf783,null))[_0x5fce('0x1a')](saveUpdates(_0x12a3de[_0x5fce('0x3b')],null))[_0x5fce('0x1a')](function(_0x4318fb){_0x409488=_0x4318fb;var _0x2777d6={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4318fb&&_0x4318fb[_0x5fce('0x65')]){if(_0x4318fb[_0x5fce('0x65')]){_0x2777d6[_0x5fce('0x63')][_0x5fce('0x74')][_0x5fce('0x64')]({'ListId':{'$ne':_0x4318fb[_0x5fce('0x65')]}});}}return db[_0x5fce('0x32')][_0x5fce('0x33')](_0x2777d6);})[_0x5fce('0x1a')](function(_0x1c72c5){if(_0x1c72c5){return _[_0x5fce('0x75')](_['pickBy'](_0x12a3de[_0x5fce('0x3b')],function(_0x1a6911,_0x1bc9f0){return _[_0x5fce('0x2d')](_0x1bc9f0,_0x5fce('0x2e'));}),_[_0x5fce('0x76')](_0x1c72c5,function(_0x4b6060){return util[_0x5fce('0x77')](_0x5fce('0x78'),_0x4b6060['id']);}));}})['then'](function(_0xef4126){if(_0xef4126&&!_[_0x5fce('0x79')](_0xef4126)){var _0x2b173f=squel[_0x5fce('0x46')]()['table'](_0x5fce('0x7a'))['setFields'](_0xef4126)[_0x5fce('0x63')]('id\x20=\x20?',_0x12a3de[_0x5fce('0x28')]['id'])[_0x5fce('0x7b')]();return db['sequelize'][_0x5fce('0x23')](_0x2b173f[_0x5fce('0x7c')],{'replacements':_0x2b173f[_0x5fce('0x7d')]});}})['then'](function(){if(_0x12a3de[_0x5fce('0x3b')][_0x5fce('0x7e')]&&_0x409488){return db['CmHopper']['update']({'phone':_0x12a3de[_0x5fce('0x3b')][_0x5fce('0x7e')],'OrderBy':0x0},{'where':{'ContactId':_0x409488['id']}});}})[_0x5fce('0x1a')](function(){return _0x409488;})[_0x5fce('0x1a')](respondWithResult(_0x5bf783,null))[_0x5fce('0x25')](handleError(_0x5bf783,null));};exports[_0x5fce('0x7f')]=function(_0x14bd07,_0x2ab743){var _0x298f91={};var _0x4d3161={};var _0x20390d;var _0x110262;return db[_0x5fce('0x26')][_0x5fce('0x80')]({'where':{'id':_0x14bd07['params']['id']}})[_0x5fce('0x1a')](handleEntityNotFound(_0x2ab743,null))['then'](function(_0x50a960){if(_0x50a960){_0x20390d=_0x50a960;_0x4d3161['model']=_[_0x5fce('0x2b')](db[_0x5fce('0x6c')][_0x5fce('0x81')]);_0x4d3161[_0x5fce('0x23')]=_[_0x5fce('0x2b')](_0x14bd07[_0x5fce('0x23')]);_0x4d3161[_0x5fce('0x82')]=_[_0x5fce('0x83')](_0x4d3161[_0x5fce('0x84')],_0x4d3161[_0x5fce('0x23')]);_0x298f91['attributes']=_['intersection'](_0x4d3161['model'],qs['fields'](_0x14bd07[_0x5fce('0x23')][_0x5fce('0x85')]));_0x298f91['attributes']=_0x298f91[_0x5fce('0x86')][_0x5fce('0x2c')]?_0x298f91[_0x5fce('0x86')]:_0x4d3161[_0x5fce('0x84')];_0x298f91[_0x5fce('0x87')]=qs['sort'](_0x14bd07[_0x5fce('0x23')]['sort']);_0x298f91[_0x5fce('0x63')]=qs[_0x5fce('0x82')](_['pick'](_0x14bd07[_0x5fce('0x23')],_0x4d3161[_0x5fce('0x82')]));if(_0x14bd07['query'][_0x5fce('0x88')]){_0x298f91[_0x5fce('0x63')]=_['merge'](_0x298f91['where'],{'$or':_[_0x5fce('0x76')](_0x298f91[_0x5fce('0x86')],function(_0x5103f2){var _0xc447e={};_0xc447e[_0x5103f2]={'$like':'%'+_0x14bd07[_0x5fce('0x23')]['filter']+'%'};return _0xc447e;})});}_0x298f91=_[_0x5fce('0x3a')]({},_0x298f91,_0x14bd07[_0x5fce('0x89')]);return _0x20390d['getTags'](_0x298f91);}})[_0x5fce('0x1a')](function(_0x3f719b){if(_0x3f719b){_0x110262=_0x3f719b[_0x5fce('0x2c')];if(!_0x14bd07[_0x5fce('0x23')][_0x5fce('0x39')]('nolimit')){_0x298f91[_0x5fce('0x15')]=qs[_0x5fce('0x15')](_0x14bd07[_0x5fce('0x23')][_0x5fce('0x15')]);_0x298f91[_0x5fce('0x13')]=qs[_0x5fce('0x13')](_0x14bd07[_0x5fce('0x23')][_0x5fce('0x13')]);}return _0x20390d[_0x5fce('0x7f')](_0x298f91);}})[_0x5fce('0x1a')](function(_0x4adda0){if(_0x4adda0){return _0x4adda0?{'count':_0x110262,'rows':_0x4adda0}:null;}})[_0x5fce('0x1a')](respondWithResult(_0x2ab743,null))[_0x5fce('0x25')](handleError(_0x2ab743,null));};exports[_0x5fce('0x8a')]=function(_0x46a1ef,_0x40e7bf){if(_0x46a1ef['body']['id']){delete _0x46a1ef[_0x5fce('0x3b')]['id'];}return db['CmContact'][_0x5fce('0x80')]({'where':{'id':_0x46a1ef[_0x5fce('0x28')]['id']}})[_0x5fce('0x1a')](handleEntityNotFound(_0x40e7bf,null))[_0x5fce('0x1a')](function(_0x2bbb27){if(_0x2bbb27){return _0x2bbb27[_0x5fce('0x8a')](_0x46a1ef[_0x5fce('0x3b')]['ids']||[]);}return null;})['then'](respondWithResult(_0x40e7bf,null))[_0x5fce('0x25')](handleError(_0x40e7bf,null));};exports[_0x5fce('0x8b')]=function(_0x3f4378,_0x58fa9e){var _0x36592b=[];_0x36592b[_0x5fce('0x64')](addAdditionalPhones(_0x3f4378[_0x5fce('0x3b')]));Promise[_0x5fce('0x6a')](_0x36592b)['then'](function(){_0x36592b=[];_0x36592b['push'](deleteCmHopperPhones(_0x3f4378['body']['id']));_0x36592b[_0x5fce('0x64')](addCmHopperPhones(_0x3f4378['body']['id']));Promise['all'](_0x36592b)[_0x5fce('0x1a')](function(){return[0x1];})[_0x5fce('0x1a')](respondWithResult(_0x58fa9e,null));});};function addAdditionalPhones(_0x2d35d6){var _0x904899;return new Promise(function(_0x5e99c2){return db[_0x5fce('0x50')]['destroy']({'where':{'CmContactId':_0x2d35d6['id']}})['then'](function(){db[_0x5fce('0x71')][_0x5fce('0x33')]({'raw':!![],'attributes':['id',_0x5fce('0x8c')]})[_0x5fce('0x1a')](function(_0x337ed2){var _0x49bc2c=[];for(var _0x530591=0x0;_0x530591<_0x2d35d6[_0x5fce('0x8d')]['length'];_0x530591++){var _0x49b7d9=_0x2d35d6[_0x5fce('0x8e')]?_[_0x5fce('0x5d')](_0x2d35d6[_0x5fce('0x8e')][_0x530591])?'':_0x2d35d6['item_types'][_0x530591]:_0x2d35d6[_0x5fce('0x8d')][_0x530591]['ItemTypeId']?_0x2d35d6['items'][_0x530591]['ItemTypeId']:'';var _0x226d14=_[_0x5fce('0x5d')](_0x2d35d6['items'][_0x530591][_0x5fce('0x8f')])?'':_0x2d35d6['items'][_0x530591]['description'];var _0x2f5413=_0x49b7d9+':'+_0x2d35d6[_0x5fce('0x8d')][_0x530591][_0x5fce('0x7e')]+'§'+_0x226d14;if(_['isNil'](_0x904899))_0x904899=_0x2f5413;else _0x904899+=';'+_0x2f5413;var _0x4db1b4=null;var _0x3fee85=null;if(_0x2d35d6[_0x5fce('0x8e')]){if(!_[_0x5fce('0x5d')](_0x2d35d6['item_types'][_0x530591])){_0x3fee85=_[_0x5fce('0x27')](_0x337ed2,function(_0x584728){return _0x584728['id']===_0x2d35d6[_0x5fce('0x8e')][_0x530591];});if(!_['isNil'](_0x3fee85)){_0x4db1b4=_0x3fee85[_0x5fce('0x8c')];}}}else{if(!_[_0x5fce('0x5d')](_0x2d35d6['items'][_0x530591])){_0x3fee85=_[_0x5fce('0x27')](_0x337ed2,function(_0xfe2e9e){return _0xfe2e9e['id']===_0x2d35d6[_0x5fce('0x8d')][_0x530591][_0x5fce('0x90')];});if(!_[_0x5fce('0x5d')](_0x3fee85)){_0x4db1b4=_0x530591;}}}if(_[_0x5fce('0x5d')](_0x4db1b4)){_0x4db1b4=0x64;}_0x49bc2c[_0x5fce('0x64')](addAdditionalPhone(_0x2d35d6['id'],_0x2d35d6[_0x5fce('0x8d')][_0x530591]['phone'],_0x2d35d6[_0x5fce('0x8e')]?_[_0x5fce('0x5d')](_0x2d35d6['item_types'][_0x530591])?null:_0x2d35d6[_0x5fce('0x8e')][_0x530591]:_0x2d35d6[_0x5fce('0x8d')][_0x530591][_0x5fce('0x90')]?_0x2d35d6[_0x5fce('0x8d')][_0x530591]['ItemTypeId']:null,_0x4db1b4,_0x226d14));}Promise['all'](_0x49bc2c)[_0x5fce('0x1a')](function(){db[_0x5fce('0x26')]['update']({'AdditionalPhones':_0x904899},{'where':{'id':_0x2d35d6['id']}})[_0x5fce('0x1a')](function(){_0x5e99c2(0x1);});});});});});}function addAdditionalPhone(_0xca676c,_0x48a935,_0x51820d,_0x14e80a,_0x227277){return db['CmContactHasItem'][_0x5fce('0x27')]({'where':{'CmContactId':_0xca676c,'item':_0x48a935}})['then'](function(_0x569862){if(_0x569862)logger[_0x5fce('0x36')](_0x5fce('0x91'),_0x569862);else{db[_0x5fce('0x50')]['create']({'CmContactId':_0xca676c,'item':_0x48a935,'ItemTypeId':_0x51820d,'OrderBy':_0x14e80a,'ItemClass':_0x5fce('0x92'),'description':_0x227277});}});}function deleteCmHopperPhones(_0x17bf8a){return new Promise(function(_0x51e20a){return db['CmHopper']['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x17bf8a}})[_0x5fce('0x1a')](function(_0x34ad52){db['CmHopperAdditionalPhone'][_0x5fce('0x1b')]({'where':{'CmHopperId':{'$in':_[_0x5fce('0x76')](_0x34ad52,'id')}}});})[_0x5fce('0x1a')](function(){_0x51e20a(0x1);});});}function addCmHopperPhones(_0x13fc1f){return new Promise(function(_0x3a8eb0){return db['CmHopper'][_0x5fce('0x33')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x13fc1f}})['then'](function(_0x3062c9){var _0x32a7cb=[];_['map'](_0x3062c9,function(_0xd7b97b){_0x32a7cb[_0x5fce('0x64')](createCmHopperPhone(_0x13fc1f,_0xd7b97b['id']));});Promise[_0x5fce('0x6a')](_0x32a7cb)[_0x5fce('0x1a')](function(){_0x3a8eb0(0x1);});});});}function createCmHopperPhone(_0x2ae2aa,_0x307c52){return new Promise(function(_0x5a6962){db[_0x5fce('0x50')][_0x5fce('0x33')]({'raw':!![],'attributes':['item','OrderBy'],'where':{'CmContactId':_0x2ae2aa,'ItemClass':_0x5fce('0x92')},'include':[{'model':db[_0x5fce('0x71')],'attributes':[_0x5fce('0x8c')],'as':'ItemType'}],'order':[_0x5fce('0x8c'),db[_0x5fce('0x93')][_0x5fce('0x94')](_0x5fce('0x95'))]})[_0x5fce('0x1a')](function(_0x1b685e){var _0x22acab=0x1;var _0x27f8cf=_[_0x5fce('0x76')](_0x1b685e,function(_0x419b61){_0x419b61[_0x5fce('0x96')]=_0x307c52;_0x419b61['phone']=_0x419b61[_0x5fce('0x97')];_0x419b61[_0x5fce('0x8c')]=_0x22acab;delete _0x419b61[_0x5fce('0x98')];_0x22acab=_0x22acab+0x1;return _0x419b61;});return db[_0x5fce('0x99')]['bulkCreate'](_0x27f8cf,{});})[_0x5fce('0x1a')](function(){_0x5a6962(0x1);});});}function insertAdditionalPhones(_0x5336cb,_0x28a96d){return new Promise(function(_0x14ef26){var _0x5317aa=[];for(var _0x4869dd=0x0;_0x4869dd<_0x28a96d[_0x5fce('0x2c')];_0x4869dd++){var _0xe8d269=_0x28a96d[_0x4869dd];_0x5317aa[_0x5fce('0x64')](parseContactItemType(_0xe8d269));}Promise['all'](_0x5317aa)['then'](function(){var _0x5397aa={'id':_0x5336cb['id'],'items':_0x28a96d};return addAdditionalPhones(_0x5397aa)['then'](function(){return addCmHopperPhones(_0x5336cb['id']);});})[_0x5fce('0x1a')](function(){_0x14ef26(_0x5336cb);});});}function parseContactItemType(_0x1f510b){return new Promise(function(_0x941975){if(_0x1f510b[_0x5fce('0x39')](_0x5fce('0x90'))){_0x941975(_0x1f510b);}else{return db[_0x5fce('0x71')][_0x5fce('0x27')]({'where':{'name':_0x1f510b[_0x5fce('0x72')]}})[_0x5fce('0x1a')](function(_0x481e17){if(_[_0x5fce('0x5d')](_0x481e17))_0x1f510b['ItemTypeId']=null;else _0x1f510b[_0x5fce('0x90')]=_0x481e17['id'];_0x941975(_0x1f510b);});}});}exports[_0x5fce('0x9a')]=function(_0x5e636e,_0x1be2ff){return db[_0x5fce('0x50')]['findAll']({'raw':!![],'where':{'CmContactId':_0x5e636e['params']['id'],'ItemClass':_0x5fce('0x92')},'include':[{'model':db['ContactItemType'],'as':_0x5fce('0x72')}],'order':[[_0x5fce('0x8c')],[db[_0x5fce('0x93')][_0x5fce('0x94')](_0x5fce('0x95'))]]})[_0x5fce('0x1a')](function(_0x13482f){return _0x13482f;})[_0x5fce('0x1a')](respondWithResult(_0x1be2ff,null))[_0x5fce('0x25')](handleError(_0x1be2ff,null));};exports[_0x5fce('0x9b')]=function(_0x110704,_0x5f49cd){return db[_0x5fce('0x50')][_0x5fce('0x33')]({'raw':!![],'where':{'CmContactId':_0x110704[_0x5fce('0x3b')][_0x5fce('0x9c')]}})[_0x5fce('0x1a')](function(_0x5b3bef){var _0x594ecb=_['map'](_0x5b3bef,function(_0x51491a){_0x51491a['CmContactId']=_0x110704[_0x5fce('0x3b')][_0x5fce('0x9d')];return _0x51491a;});return db[_0x5fce('0x50')][_0x5fce('0x60')](_0x594ecb,{});})['then'](function(){return addCmHopperPhones(_0x110704[_0x5fce('0x3b')][_0x5fce('0x9d')]);})[_0x5fce('0x1a')](function(){return['ok'];})[_0x5fce('0x1a')](respondWithResult(_0x5f49cd,null))[_0x5fce('0x25')](handleError(_0x5f49cd,null));};exports[_0x5fce('0x9e')]=function(_0x3828c1,_0x531e13){var _0xb4df15=[];_0xb4df15[_0x5fce('0x64')](createCmHopperPhone(_0x3828c1[_0x5fce('0x3b')]['id'],_0x3828c1[_0x5fce('0x3b')][_0x5fce('0x9f')]));Promise['all'](_0xb4df15)[_0x5fce('0x1a')](function(){return[0x1];})[_0x5fce('0x1a')](respondWithResult(_0x531e13,null));};exports['getHoppers']=function(_0x2c0026,_0x5b58c1){var _0x58e992={'raw':![],'where':{}};var _0x4a29c4={};var _0x47f392={'count':0x0,'rows':[]};return db[_0x5fce('0x26')][_0x5fce('0x80')]({'where':{'id':_0x2c0026[_0x5fce('0x28')]['id']}})[_0x5fce('0x1a')](handleEntityNotFound(_0x5b58c1,null))[_0x5fce('0x1a')](function(_0x547f80){if(_0x547f80){_0x4a29c4['model']=_[_0x5fce('0x2b')](db[_0x5fce('0x42')]['rawAttributes']);_0x4a29c4[_0x5fce('0x23')]=_[_0x5fce('0x2b')](_0x2c0026['query']);_0x4a29c4[_0x5fce('0x82')]=_[_0x5fce('0x83')](_0x4a29c4['model'],_0x4a29c4[_0x5fce('0x23')]);_0x58e992[_0x5fce('0x86')]=_[_0x5fce('0x83')](_0x4a29c4[_0x5fce('0x84')],qs[_0x5fce('0x85')](_0x2c0026[_0x5fce('0x23')][_0x5fce('0x85')]));_0x58e992[_0x5fce('0x86')]=_0x58e992[_0x5fce('0x86')][_0x5fce('0x2c')]?_0x58e992[_0x5fce('0x86')]:_0x4a29c4[_0x5fce('0x84')];if(!_0x2c0026['query'][_0x5fce('0x39')]('nolimit')){_0x58e992[_0x5fce('0x15')]=qs['limit'](_0x2c0026[_0x5fce('0x23')][_0x5fce('0x15')]);_0x58e992[_0x5fce('0x13')]=qs[_0x5fce('0x13')](_0x2c0026['query'][_0x5fce('0x13')]);}_0x58e992['order']=qs[_0x5fce('0xa0')](_0x2c0026[_0x5fce('0x23')][_0x5fce('0xa0')]);_0x58e992[_0x5fce('0x63')]=qs[_0x5fce('0x82')](_[_0x5fce('0xa1')](_0x2c0026['query'],_0x4a29c4['filters']));_0x58e992[_0x5fce('0x63')][_0x5fce('0xa2')]=_0x547f80['id'];if(_0x2c0026['query'][_0x5fce('0x88')]){_0x58e992['where']=_[_0x5fce('0x3a')](_0x58e992['where'],{'$or':_[_0x5fce('0x76')](_0x58e992[_0x5fce('0x86')],function(_0x2a8e72){var _0x58624f={};_0x58624f[_0x2a8e72]={'$like':'%'+_0x2c0026['query'][_0x5fce('0x88')]+'%'};return _0x58624f;})});}_0x58e992=_['merge']({},_0x58e992,_0x2c0026[_0x5fce('0x89')]);return db[_0x5fce('0x42')][_0x5fce('0x16')]({'where':_0x58e992[_0x5fce('0x63')]})[_0x5fce('0x1a')](function(_0x4fcdf5){_0x47f392['count']=_0x4fcdf5;if(_0x2c0026['query']['includeAll']){_0x58e992[_0x5fce('0xa3')]=[{'all':!![]}];}return db[_0x5fce('0x42')][_0x5fce('0x33')](_0x58e992);})[_0x5fce('0x1a')](function(_0x4b75c7){_0x47f392['rows']=_0x4b75c7;return _0x47f392;});}})[_0x5fce('0x1a')](respondWithFilteredResult(_0x5b58c1,_0x58e992))[_0x5fce('0x25')](handleError(_0x5b58c1,null));};exports[_0x5fce('0xa4')]=function(_0x38a2e9,_0x17a641){var _0x48d5e6={'raw':!![],'where':{}};var _0x1133c0={};var _0x21b646={'count':0x0,'rows':[]};return db['CmContact'][_0x5fce('0x80')]({'where':{'id':_0x38a2e9[_0x5fce('0x28')]['id']}})[_0x5fce('0x1a')](handleEntityNotFound(_0x17a641,null))[_0x5fce('0x1a')](function(_0x4f3e72){if(_0x4f3e72){_0x1133c0['model']=_['keys'](db[_0x5fce('0x52')]['rawAttributes']);_0x1133c0[_0x5fce('0x23')]=_[_0x5fce('0x2b')](_0x38a2e9[_0x5fce('0x23')]);_0x1133c0[_0x5fce('0x82')]=_[_0x5fce('0x83')](_0x1133c0[_0x5fce('0x84')],_0x1133c0[_0x5fce('0x23')]);_0x48d5e6['attributes']=_[_0x5fce('0x83')](_0x1133c0['model'],qs[_0x5fce('0x85')](_0x38a2e9['query'][_0x5fce('0x85')]));_0x48d5e6[_0x5fce('0x86')]=_0x48d5e6[_0x5fce('0x86')][_0x5fce('0x2c')]?_0x48d5e6['attributes']:_0x1133c0[_0x5fce('0x84')];if(!_0x38a2e9[_0x5fce('0x23')][_0x5fce('0x39')](_0x5fce('0xa5'))){_0x48d5e6['limit']=qs['limit'](_0x38a2e9['query'][_0x5fce('0x15')]);_0x48d5e6['offset']=qs['offset'](_0x38a2e9[_0x5fce('0x23')]['offset']);}_0x48d5e6[_0x5fce('0x87')]=qs[_0x5fce('0xa0')](_0x38a2e9[_0x5fce('0x23')][_0x5fce('0xa0')]);_0x48d5e6['where']=qs[_0x5fce('0x82')](_[_0x5fce('0xa1')](_0x38a2e9[_0x5fce('0x23')],_0x1133c0[_0x5fce('0x82')]));_0x48d5e6['where']['ContactId']=_0x4f3e72['id'];if(_0x38a2e9[_0x5fce('0x23')][_0x5fce('0x88')]){_0x48d5e6[_0x5fce('0x63')]=_[_0x5fce('0x3a')](_0x48d5e6[_0x5fce('0x63')],{'$or':_[_0x5fce('0x76')](_0x48d5e6[_0x5fce('0x86')],function(_0x235c16){var _0x522393={};_0x522393[_0x235c16]={'$like':'%'+_0x38a2e9[_0x5fce('0x23')][_0x5fce('0x88')]+'%'};return _0x522393;})});}_0x48d5e6=_[_0x5fce('0x3a')]({},_0x48d5e6,_0x38a2e9[_0x5fce('0x89')]);return db['CmHopperHistory']['count']({'where':_0x48d5e6[_0x5fce('0x63')]})['then'](function(_0x362c3c){_0x21b646[_0x5fce('0x16')]=_0x362c3c;if(_0x38a2e9[_0x5fce('0x23')][_0x5fce('0xa6')]){_0x48d5e6[_0x5fce('0xa3')]=[{'all':!![]}];}return db[_0x5fce('0x52')]['findAll'](_0x48d5e6);})[_0x5fce('0x1a')](function(_0x4cffb7){_0x21b646[_0x5fce('0xa7')]=_0x4cffb7;return _0x21b646;});}})['then'](respondWithFilteredResult(_0x17a641,_0x48d5e6))['catch'](handleError(_0x17a641,null));};exports['getHopperFinals']=function(_0x3ec8d8,_0x3ef0ad){var _0x44906e={'raw':!![],'where':{}};var _0x18199f={};var _0x4fad84={'count':0x0,'rows':[]};return db['CmContact'][_0x5fce('0x80')]({'where':{'id':_0x3ec8d8['params']['id']}})['then'](handleEntityNotFound(_0x3ef0ad,null))['then'](function(_0x289700){if(_0x289700){_0x18199f[_0x5fce('0x84')]=_[_0x5fce('0x2b')](db[_0x5fce('0x51')][_0x5fce('0x81')]);_0x18199f['query']=_[_0x5fce('0x2b')](_0x3ec8d8[_0x5fce('0x23')]);_0x18199f[_0x5fce('0x82')]=_[_0x5fce('0x83')](_0x18199f[_0x5fce('0x84')],_0x18199f[_0x5fce('0x23')]);_0x44906e[_0x5fce('0x86')]=_[_0x5fce('0x83')](_0x18199f[_0x5fce('0x84')],qs[_0x5fce('0x85')](_0x3ec8d8[_0x5fce('0x23')]['fields']));_0x44906e[_0x5fce('0x86')]=_0x44906e[_0x5fce('0x86')]['length']?_0x44906e[_0x5fce('0x86')]:_0x18199f[_0x5fce('0x84')];if(!_0x3ec8d8[_0x5fce('0x23')][_0x5fce('0x39')]('nolimit')){_0x44906e['limit']=qs['limit'](_0x3ec8d8[_0x5fce('0x23')][_0x5fce('0x15')]);_0x44906e[_0x5fce('0x13')]=qs['offset'](_0x3ec8d8[_0x5fce('0x23')][_0x5fce('0x13')]);}_0x44906e[_0x5fce('0x87')]=qs[_0x5fce('0xa0')](_0x3ec8d8['query'][_0x5fce('0xa0')]);_0x44906e['where']=qs['filters'](_[_0x5fce('0xa1')](_0x3ec8d8[_0x5fce('0x23')],_0x18199f[_0x5fce('0x82')]));_0x44906e['where'][_0x5fce('0xa2')]=_0x289700['id'];if(_0x3ec8d8[_0x5fce('0x23')][_0x5fce('0x88')]){_0x44906e[_0x5fce('0x63')]=_[_0x5fce('0x3a')](_0x44906e[_0x5fce('0x63')],{'$or':_[_0x5fce('0x76')](_0x44906e['attributes'],function(_0x39eebb){var _0x16d97e={};_0x16d97e[_0x39eebb]={'$like':'%'+_0x3ec8d8[_0x5fce('0x23')][_0x5fce('0x88')]+'%'};return _0x16d97e;})});}_0x44906e=_[_0x5fce('0x3a')]({},_0x44906e,_0x3ec8d8['options']);return db[_0x5fce('0x51')][_0x5fce('0x16')]({'where':_0x44906e[_0x5fce('0x63')]})[_0x5fce('0x1a')](function(_0xc7071){_0x4fad84[_0x5fce('0x16')]=_0xc7071;if(_0x3ec8d8[_0x5fce('0x23')][_0x5fce('0xa6')]){_0x44906e['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0x5fce('0x33')](_0x44906e);})[_0x5fce('0x1a')](function(_0x4ad6ba){_0x4fad84[_0x5fce('0xa7')]=_0x4ad6ba;return _0x4fad84;});}})[_0x5fce('0x1a')](respondWithFilteredResult(_0x3ef0ad,_0x44906e))[_0x5fce('0x25')](handleError(_0x3ef0ad,null));};exports[_0x5fce('0xa8')]=function(_0xf3282b,_0x25b00b){var _0x38daf2={'raw':!![],'where':{}};var _0x1c1c66={};var _0x2bce56={'count':0x0,'rows':[]};return db[_0x5fce('0x26')]['findOne']({'where':{'id':_0xf3282b[_0x5fce('0x28')]['id']}})['then'](handleEntityNotFound(_0x25b00b,null))[_0x5fce('0x1a')](function(_0x323c8d){if(_0x323c8d){_0x1c1c66[_0x5fce('0x84')]=_[_0x5fce('0x2b')](db['JscriptySessionReport']['rawAttributes']);_0x1c1c66[_0x5fce('0x23')]=_[_0x5fce('0x2b')](_0xf3282b['query']);_0x1c1c66['filters']=_[_0x5fce('0x83')](_0x1c1c66[_0x5fce('0x84')],_0x1c1c66[_0x5fce('0x23')]);_0x38daf2['attributes']=_[_0x5fce('0x83')](_0x1c1c66[_0x5fce('0x84')],qs['fields'](_0xf3282b[_0x5fce('0x23')][_0x5fce('0x85')]));_0x38daf2['attributes']=_0x38daf2[_0x5fce('0x86')][_0x5fce('0x2c')]?_0x38daf2[_0x5fce('0x86')]:_0x1c1c66['model'];if(!_0xf3282b[_0x5fce('0x23')][_0x5fce('0x39')]('nolimit')){_0x38daf2[_0x5fce('0x15')]=qs[_0x5fce('0x15')](_0xf3282b[_0x5fce('0x23')][_0x5fce('0x15')]);_0x38daf2['offset']=qs[_0x5fce('0x13')](_0xf3282b[_0x5fce('0x23')]['offset']);}_0x38daf2[_0x5fce('0x87')]=qs[_0x5fce('0xa0')](_0xf3282b['query']['sort']);_0x38daf2[_0x5fce('0x63')]=qs[_0x5fce('0x82')](_[_0x5fce('0xa1')](_0xf3282b[_0x5fce('0x23')],_0x1c1c66[_0x5fce('0x82')]));_0x38daf2[_0x5fce('0x63')][_0x5fce('0xa2')]=_0x323c8d['id'];if(_0xf3282b['query'][_0x5fce('0x88')]){_0x38daf2[_0x5fce('0x63')]=_['merge'](_0x38daf2[_0x5fce('0x63')],{'$or':_['map'](_0x38daf2[_0x5fce('0x86')],function(_0xa74a7d){var _0x5cf317={};_0x5cf317[_0xa74a7d]={'$like':'%'+_0xf3282b[_0x5fce('0x23')][_0x5fce('0x88')]+'%'};return _0x5cf317;})});}_0x38daf2=_[_0x5fce('0x3a')]({},_0x38daf2,_0xf3282b[_0x5fce('0x89')]);return db['JscriptySessionReport']['count']({'where':_0x38daf2[_0x5fce('0x63')]})[_0x5fce('0x1a')](function(_0x1b548a){_0x2bce56[_0x5fce('0x16')]=_0x1b548a;if(_0xf3282b[_0x5fce('0x23')]['includeAll']){_0x38daf2[_0x5fce('0xa3')]=[{'all':!![]}];}return db[_0x5fce('0x57')][_0x5fce('0x33')](_0x38daf2);})[_0x5fce('0x1a')](function(_0x4f0e80){_0x2bce56[_0x5fce('0xa7')]=_0x4f0e80;return _0x2bce56;});}})['then'](respondWithFilteredResult(_0x25b00b,_0x38daf2))[_0x5fce('0x25')](handleError(_0x25b00b,null));};exports[_0x5fce('0xa9')]=function(_0x50448e,_0x4bed29){try{if(!_0x50448e[_0x5fce('0x3b')]['ListId']){throw new Error('No\x20ListId\x20specified');}if(!_0x50448e[_0x5fce('0x3b')]['binding_keys']){throw new Error(_0x5fce('0xaa'));}if(!_0x50448e['body']['binding_values']){throw new Error(_0x5fce('0xab'));}if(!_0x50448e['body'][_0x5fce('0xac')]){throw new Error(_0x5fce('0xad'));}var _0x1f5f3c=_0x50448e['body']['binding_keys'][_0x5fce('0xae')](',');var _0xfa42d1=_0x50448e[_0x5fce('0x3b')][_0x5fce('0xaf')][_0x5fce('0xae')](',');if(!_0x1f5f3c[_0x5fce('0x2c')]||!_0xfa42d1['length']||_0x1f5f3c['length']!==_0xfa42d1[_0x5fce('0x2c')]){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x50448e[_0x5fce('0x3b')][_0x5fce('0x85')]=_[_0x5fce('0xb0')](_0x1f5f3c,_0xfa42d1);if(!_0x50448e['body'][_0x5fce('0x85')][_0x5fce('0x7e')]){throw new Error(_0x5fce('0xb1'));}if(!_0x50448e[_0x5fce('0x3b')][_0x5fce('0x85')][_0x5fce('0xb2')]){throw new Error(_0x5fce('0xb3'));}var _0x2f885c=path[_0x5fce('0x40')](config['root'],'server/files/tmp',_0x50448e[_0x5fce('0xb4')]['filename']);fs[_0x5fce('0xb5')](_0x2f885c,parseInt(_0x5fce('0xb6'),0x8));var _0x58a79f=require(_0x5fce('0xb7'))[_0x5fce('0xb8')](path['join'](__dirname,'../../components/import/cm/csv'),[_0x2f885c,_0x50448e[_0x5fce('0x3b')][_0x5fce('0xb9')],_0x50448e['body'][_0x5fce('0xaf')],_0x50448e['body'][_0x5fce('0x65')],_0x50448e['body'][_0x5fce('0xba')],_0x50448e[_0x5fce('0x3b')][_0x5fce('0x62')],_0x50448e[_0x5fce('0x3b')][_0x5fce('0xac')]]);return _0x4bed29[_0x5fce('0x12')](0xc8)[_0x5fce('0x19')]({'message':_0x5fce('0xbb'),'pid':_0x58a79f[_0x5fce('0xbc')]});}catch(_0x170bee){return _0x4bed29[_0x5fce('0x12')](0x1f4)[_0x5fce('0x21')](_0x170bee);}};exports[_0x5fce('0xbd')]=function(_0x14a5ed,_0x5a0c2d){var _0x573df9=fs[_0x5fce('0xbe')](_0x14a5ed[_0x5fce('0xb4')][_0x5fce('0xbf')]);Papa['parse'](_0x573df9,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5f9f32){return _0x5a0c2d['status'](0xc8)[_0x5fce('0x19')]({'file':_0x14a5ed[_0x5fce('0xb4')],'fields':_0x5f9f32[_0x5fce('0xc0')][_0x5fce('0x85')]});}});};exports['import']=function(_0x494390,_0x4174b2){return db[_0x5fce('0xc1')][_0x5fce('0x33')]({'raw':!![],'attributes':['id'],'where':{'role':_0x5fce('0xc2')}})['then'](function(_0x36624d){var _0x4fca8a=![];if(!_0x494390[_0x5fce('0x3b')][_0x5fce('0x65')]){throw new Error(_0x5fce('0xc3'));}if(!_0x494390[_0x5fce('0x3b')][_0x5fce('0xc4')][_0x5fce('0x7e')]){throw new Error(_0x5fce('0xb1'));}if(!_0x494390[_0x5fce('0x3b')][_0x5fce('0xc4')]['firstName']){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x494390[_0x5fce('0x3b')][_0x5fce('0xac')]){throw new Error(_0x5fce('0xad'));}var _0x2e65cd=require(_0x5fce('0xb7'))['fork'](path[_0x5fce('0x40')](__dirname,_0x5fce('0xc5')),[_0x494390[_0x5fce('0x28')]['id'],JSON[_0x5fce('0xc6')](_0x494390[_0x5fce('0x3b')]),JSON['stringify'](_0x36624d)]);_0x2e65cd['on']('message',function(){_0x4fca8a=!![];return _0x4174b2[_0x5fce('0x12')](0xc8)['json']({'message':_0x5fce('0xc7'),'pid':_0x2e65cd['pid']});});_0x2e65cd['on'](_0x5fce('0xc8'),function(_0x2a74c7){if(_0x2a74c7&&!_0x4fca8a){return _0x4174b2['status'](0x1f4)['json']({'message':_0x5fce('0xc9'),'pid':_0x2e65cd[_0x5fce('0xbc')]});}});})[_0x5fce('0x25')](handleError(_0x4174b2,null));};exports['importUpdates']=function(_0xef522d,_0x5cabde){return db[_0x5fce('0xc1')][_0x5fce('0x33')]({'raw':!![],'attributes':['id'],'where':{'role':_0x5fce('0xc2')}})[_0x5fce('0x1a')](function(_0x25fdb4){var _0x3922fc=![];if(!_0xef522d[_0x5fce('0x3b')]['ListId']){throw new Error(_0x5fce('0xc3'));}if(!_0xef522d[_0x5fce('0x3b')][_0x5fce('0xc4')]['phone']){throw new Error('No\x20phone\x20column\x20specified');}if(!_0xef522d['body']['binding']['firstName']){throw new Error(_0x5fce('0xb3'));}if(!_0xef522d[_0x5fce('0x3b')][_0x5fce('0xac')]){throw new Error(_0x5fce('0xad'));}var _0x2756be=require(_0x5fce('0xb7'))[_0x5fce('0xb8')](path[_0x5fce('0x40')](__dirname,_0x5fce('0xca')),[_0xef522d[_0x5fce('0x28')]['id'],JSON[_0x5fce('0xc6')](_0xef522d['body']),JSON[_0x5fce('0xc6')](_0x25fdb4)]);_0x2756be['on'](_0x5fce('0xcb'),function(){_0x3922fc=!![];return _0x5cabde[_0x5fce('0x12')](0xc8)['json']({'message':_0x5fce('0xc7'),'pid':_0x2756be[_0x5fce('0xbc')]});});_0x2756be['on'](_0x5fce('0xc8'),function(_0x311c65){if(_0x311c65&&!_0x3922fc){return _0x5cabde[_0x5fce('0x12')](0x1f4)[_0x5fce('0x19')]({'message':_0x5fce('0xc9'),'pid':_0x2756be[_0x5fce('0xbc')]});}});})['catch'](handleError(_0x5cabde,null));};exports[_0x5fce('0xcc')]=function(_0x533607,_0x3edebf){var _0x227103=['mail',_0x5fce('0xcd'),_0x5fce('0xce'),_0x5fce('0xcf'),_0x5fce('0xd0'),_0x5fce('0xd1'),_0x5fce('0xd2')];var _0x4fa6ed={'offset':0x0,'order':qs[_0x5fce('0xa0')]('-createdAt')},_0x491db8={'count':0x0,'rows':[]};Promise[_0x5fce('0xd3')]()[_0x5fce('0x1a')](function(){if(_0x533607['query']['channel']){if(!_[_0x5fce('0xd4')](_0x227103,_0x533607[_0x5fce('0x23')][_0x5fce('0xd5')][_0x5fce('0xd6')]())){throw new Error(_0x5fce('0xd7'));}_0x227103=[_0x533607[_0x5fce('0x23')][_0x5fce('0xd5')][_0x5fce('0xd6')]()];}if(_0x533607[_0x5fce('0x23')][_0x5fce('0xd8')]){try{var _0x4a7a64=JSON[_0x5fce('0xd9')](_0x533607[_0x5fce('0x23')]['range']);if(!moment(_0x4a7a64[_0x5fce('0x3c')])[_0x5fce('0xda')]()){throw new Error(_0x5fce('0xdb'));}if(!moment(_0x4a7a64['to'])[_0x5fce('0xda')]()){throw new Error(_0x5fce('0xdc'));}}catch(_0x1963c0){throw new Error(_0x5fce('0xdd'));}}if(!_0x533607[_0x5fce('0x23')][_0x5fce('0x39')](_0x5fce('0xa5'))){_0x4fa6ed['limit']=qs[_0x5fce('0x15')](_0x533607[_0x5fce('0x23')][_0x5fce('0x15')]||0xa);_0x4fa6ed[_0x5fce('0x13')]=qs[_0x5fce('0x13')](_0x533607[_0x5fce('0x23')][_0x5fce('0x13')]);}var _0x3408b1=_0x227103['map'](function(_0x1a3059){if(_0x1a3059===_0x5fce('0xd2')){var _0x17741b={'attributes':['id','uniqueid','type',_0x5fce('0xde'),'destination',_0x5fce('0xdf'),'starttime','endtime',_0x5fce('0xe0'),_0x5fce('0xe1'),_0x5fce('0xe2'),'userDisposition',_0x5fce('0xe3'),'userThirdDisposition',_0x5fce('0xe4')],'where':{'ContactId':_0x533607[_0x5fce('0x28')]['id']},'include':[{'model':db[_0x5fce('0xc1')],'as':_0x5fce('0xc1'),'attributes':['id',_0x5fce('0x20'),'fullname','alias']}],'order':[[_0x5fce('0xe2'),'DESC']]};if(_0x533607[_0x5fce('0x23')][_0x5fce('0xd8')]){_0x17741b['where'][_0x5fce('0xe2')]={'$gte':_0x4a7a64['from'],'$lte':_0x4a7a64['to']};}return db['VoiceCallReport'][_0x5fce('0xe5')](_0x17741b)[_0x5fce('0x1a')](function(_0x5524f4){_0x491db8[_0x5fce('0x16')]+=_0x5524f4[_0x5fce('0x16')];return _['map'](_0x5524f4[_0x5fce('0xa7')],function(_0x37f0a9){var _0x14ba87=_0x37f0a9[_0x5fce('0x3d')]({'plain':!![]});_0x14ba87[_0x5fce('0xd5')]=_0x1a3059;if(_0x14ba87['User']){_0x14ba87[_0x5fce('0xc1')]={'id':_0x14ba87['User']['id'],'name':_0x14ba87['User'][_0x5fce('0x20')],'fullname':_0x14ba87[_0x5fce('0xc1')][_0x5fce('0xe6')],'alias':_0x14ba87[_0x5fce('0xc1')]['alias']};}return _0x14ba87;});});}else{var _0x34cb7a=_[_0x5fce('0xe7')](_0x1a3059)+(_0x1a3059===_0x5fce('0xcd')?_0x5fce('0xe8'):_0x5fce('0xe9'));var _0x1f3c3f={'attributes':['id',_0x5fce('0xea'),_0x5fce('0xeb'),_0x5fce('0xe2'),_0x5fce('0xe1'),_0x5fce('0xec'),_0x5fce('0xed'),_0x5fce('0xee'),_0x5fce('0xe4'),_0x34cb7a+'Id'],'where':{'ContactId':_0x533607['params']['id']},'include':[{'model':db[_0x34cb7a],'as':_0x5fce('0xe9'),'attributes':['id',_0x5fce('0x20'),_0x5fce('0xef')]},{'model':db[_0x5fce('0xc1')],'as':_0x5fce('0xf0'),'attributes':['id','name',_0x5fce('0xe6')]},{'model':db[_0x5fce('0x6c')],'as':'Tags','attributes':['id','name',_0x5fce('0x6e')],'through':{'attributes':[]}}],'order':[[_0x5fce('0xe2'),_0x5fce('0xf1')]]};if(_0x533607[_0x5fce('0x23')][_0x5fce('0xd8')]){_0x1f3c3f[_0x5fce('0x63')][_0x5fce('0xe2')]={'$gte':_0x4a7a64[_0x5fce('0x3c')],'$lte':_0x4a7a64['to']};}switch(_0x1a3059){case _0x5fce('0xcd'):_0x1f3c3f[_0x5fce('0x86')][_0x5fce('0x64')]('browserName',_0x5fce('0xf2'),'customerPort','deviceModel',_0x5fce('0xf3'),_0x5fce('0xf4'),_0x5fce('0xf5'),_0x5fce('0xf6'),_0x5fce('0xf7'));break;case _0x5fce('0xf8'):_0x1f3c3f[_0x5fce('0x86')][_0x5fce('0x64')](_0x5fce('0xf9'),'substatus');break;case _0x5fce('0xcf'):_0x1f3c3f[_0x5fce('0x86')][_0x5fce('0x64')](_0x5fce('0xfa'),_0x5fce('0xfb'));break;}return db[_[_0x5fce('0xe7')](_0x1a3059)+_0x5fce('0xfc')][_0x5fce('0xe5')](_0x1f3c3f)[_0x5fce('0x1a')](function(_0xa1e7b4){_0x491db8[_0x5fce('0x16')]+=_0xa1e7b4[_0x5fce('0x16')];return _[_0x5fce('0x76')](_0xa1e7b4['rows'],function(_0xbc13a9){var _0x30604a=_0xbc13a9[_0x5fce('0x3d')]({'plain':!![]});_0x30604a[_0x5fce('0xd5')]=_0x1a3059;if(_0x30604a[_0x5fce('0xf0')]){_0x30604a['Owner']={'id':_0x30604a[_0x5fce('0xf0')]['id'],'name':_0x30604a[_0x5fce('0xf0')][_0x5fce('0x20')],'fullname':_0x30604a[_0x5fce('0xf0')][_0x5fce('0xe6')]};}return _0x30604a;});});}});return Promise[_0x5fce('0x6a')](_0x3408b1);})[_0x5fce('0x1a')](function(_0x51abfc){return _(_0x51abfc)[_0x5fce('0xfd')]()[_0x5fce('0xfe')](_0x5fce('0xe2'))[_0x5fce('0xff')]()['value']();})[_0x5fce('0x1a')](function(_0x2392bc){_0x491db8[_0x5fce('0xa7')]=_0x4fa6ed[_0x5fce('0x15')]?_0x2392bc['slice'](_0x4fa6ed[_0x5fce('0x13')],_0x4fa6ed['offset']+_0x4fa6ed[_0x5fce('0x15')]):_0x2392bc;return _0x491db8;})[_0x5fce('0x1a')](respondWithFilteredResult(_0x3edebf,_0x4fa6ed))['catch'](handleError(_0x3edebf,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 14ceea3..da8cee0 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 _0x7a9e=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmContact'];(function(_0x1460ae,_0xdf2689){var _0x2ddad7=function(_0x23b6b8){while(--_0x23b6b8){_0x1460ae['push'](_0x1460ae['shift']());}};_0x2ddad7(++_0xdf2689);}(_0x7a9e,0x177));var _0xe7a9=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x7a9e[_0x122ef9];return _0x42fba0;};'use strict';var EventEmitter=require(_0xe7a9('0x0'));var CmContact=require(_0xe7a9('0x1'))['db'][_0xe7a9('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xe7a9('0x3'),'afterDestroy':_0xe7a9('0x4')};function emitEvent(_0x24cccb){return function(_0x3d305f,_0x4f7ef5,_0x41e53c){CmContactEvents['emit'](_0x24cccb+':'+_0x3d305f['id'],_0x3d305f);CmContactEvents[_0xe7a9('0x5')](_0x24cccb,_0x3d305f);_0x41e53c(null);};}for(var e in events){if(events[_0xe7a9('0x6')](e)){var event=events[e];CmContact[_0xe7a9('0x7')](e,emitEvent(event));}}module[_0xe7a9('0x8')]=CmContactEvents; \ No newline at end of file +var _0x33c5=['events','../../mysqldb','CmContact','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x59df11,_0x35e775){var _0x2c6a88=function(_0x28c2ee){while(--_0x28c2ee){_0x59df11['push'](_0x59df11['shift']());}};_0x2c6a88(++_0x35e775);}(_0x33c5,0xea));var _0x533c=function(_0x9077a4,_0x41748c){_0x9077a4=_0x9077a4-0x0;var _0x204bdc=_0x33c5[_0x9077a4];return _0x204bdc;};'use strict';var EventEmitter=require(_0x533c('0x0'));var CmContact=require(_0x533c('0x1'))['db'][_0x533c('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x533c('0x3'),'afterUpdate':_0x533c('0x4'),'afterDestroy':_0x533c('0x5')};function emitEvent(_0x4d8fd9){return function(_0x4ad292,_0x2d3f40,_0x5a091b){CmContactEvents[_0x533c('0x6')](_0x4d8fd9+':'+_0x4ad292['id'],_0x4ad292);CmContactEvents['emit'](_0x4d8fd9,_0x4ad292);_0x5a091b(null);};}for(var e in events){if(events[_0x533c('0x7')](e)){var event=events[e];CmContact[_0x533c('0x8')](e,emitEvent(event));}}module['exports']=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index 4637fd2..11d7084 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 _0xe14b=['fti_cm_contacts','firstName','lastName','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','get','List\x20not\x20found','catch','cmContact,\x20%s,\x20%s','afterCreate','isEmpty','length','destroy','ContactId','push','[CmContact][afterDestroy][Succesfull]','inspect','error','lodash','util','moment','../../config/environment/shared','Campaign','VoiceQueue','scheduledat','dialTimezone','resolve','findOne','then','isNil','timezones','utcOffset','add','minutes','format','YYYY-MM-DD\x20HH:mm:ss','phone','ListId','priority','callbackUniqueid','VoiceQueueId','CmHopper','assign','CmHopperFinal','[CmContact][Always]\x20Hopper\x20Final\x20already\x20exists\x20for\x20contact\x20with\x20phone\x20','create','CampaignId','[CmContact][OnlyIfOpen]\x20Hopper\x20already\x20exists\x20for\x20contact\x20with\x20phone\x20','\x20in\x20Campaign\x20with\x20id\x20','findAll','outbound','dialCheckDuplicateType','CmList','all','Lists','map','BlackLists','CmHopperBlack','CmContact','cm_contacts'];(function(_0x816922,_0x40650f){var _0x31ecac=function(_0x346a87){while(--_0x346a87){_0x816922['push'](_0x816922['shift']());}};_0x31ecac(++_0x40650f);}(_0xe14b,0x93));var _0xbe14=function(_0x20bb95,_0x2e88fa){_0x20bb95=_0x20bb95-0x0;var _0x5abdad=_0xe14b[_0x20bb95];return _0x5abdad;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var shared=require(_0xbe14('0x3'));var attributes=require('./cmContact.attributes');function getTimezoneCallbackAt(_0x7d3665,_0x5ce8fb,_0x496c04,_0x1833e3){var _0x2d1a4a=_0x1833e3?_0xbe14('0x4'):_0xbe14('0x5');var _0x1d9ade=_0x496c04[_0xbe14('0x6')]?_0x496c04[_0xbe14('0x6')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss');if(_['isNil'](_0x496c04[_0xbe14('0x7')])){return Promise[_0xbe14('0x8')](_0x1d9ade);}return _0x7d3665[_0x2d1a4a][_0xbe14('0x9')]({'where':{'id':_0x5ce8fb}})[_0xbe14('0xa')](function(_0x53c7ea){if(_['isNil'](_0x53c7ea)||_[_0xbe14('0xb')](_0x53c7ea[_0xbe14('0x7')])){return Promise['resolve'](_0x1d9ade);}var _0x254c3b=shared[_0xbe14('0xc')];var _0x886a5e=_0x254c3b[_0x53c7ea[_0xbe14('0x7')]];var _0x27792f=_0x254c3b[_0x496c04[_0xbe14('0x7')]];if(_[_0xbe14('0xb')](_0x886a5e)&&_[_0xbe14('0xb')](_0x27792f)){return Promise[_0xbe14('0x8')](_0x1d9ade);}var _0xa2cf72=_0x886a5e[_0xbe14('0xd')]-_0x27792f[_0xbe14('0xd')];var _0x813399=_0x496c04['scheduledat']?_0x496c04['scheduledat']:moment();_0x1d9ade=moment(_0x813399)[_0xbe14('0xe')](_0xa2cf72,_0xbe14('0xf'))[_0xbe14('0x10')](_0xbe14('0x11'));return Promise['resolve'](_0x1d9ade);});}function getNewHopperPayload(_0x21c789){return{'phone':_0x21c789[_0xbe14('0x12')],'ContactId':_0x21c789['id'],'ListId':_0x21c789[_0xbe14('0x13')],'scheduledat':_0x21c789[_0xbe14('0x6')]?_0x21c789[_0xbe14('0x6')]:moment()[_0xbe14('0x10')](_0xbe14('0x11')),'priority':_0x21c789['priority']?_0x21c789[_0xbe14('0x14')]:0x2,'callback':_0x21c789[_0xbe14('0x15')]?!![]:![],'callbackuniqueid':_0x21c789[_0xbe14('0x15')]?_0x21c789[_0xbe14('0x15')]:undefined,'callbackat':_0x21c789[_0xbe14('0x15')]?moment()[_0xbe14('0x10')]('YYYY-MM-DD\x20HH:mm:ss'):undefined};}function handleAlwaysCheckDuplicate(_0x24f820,_0x4a1bbd,_0x417c8d,_0xc12977){var _0x188ec4=_0xc12977?'CampaignId':_0xbe14('0x16');var _0x56d845={['foreignKey']:_0x4a1bbd['id']};return _0x24f820[_0xbe14('0x17')]['findOne']({'where':Object[_0xbe14('0x18')]({},_0x56d845,{'phone':_0x417c8d['phone']})})[_0xbe14('0xa')](function(_0x3d3608){if(_0x3d3608){throw new Error('[CmContact][Always]\x20Hopper\x20already\x20exists\x20for\x20contact\x20with\x20phone\x20'+_0x417c8d[_0xbe14('0x12')]+'\x20in\x20Campaign\x20with\x20id\x20'+_0x4a1bbd['id']);}return _0x24f820[_0xbe14('0x19')]['findOne']({'where':Object[_0xbe14('0x18')]({},_0x56d845,{'calleridnum':_0x417c8d[_0xbe14('0x12')]})});})[_0xbe14('0xa')](function(_0x39cc81){if(_0x39cc81){throw new Error(_0xbe14('0x1a')+_0x417c8d[_0xbe14('0x12')]+'\x20in\x20Campaign\x20with\x20id\x20'+_0x4a1bbd['id']);}var _0x1822e0=getNewHopperPayload(_0x417c8d);_0x1822e0[_0x188ec4]=_0x4a1bbd['id'];return _0x24f820[_0xbe14('0x17')][_0xbe14('0x1b')](_0x1822e0);});}function handleOnlyIfOpenCheckDuplicate(_0x169369,_0x5dd475,_0x16f884,_0x29fc64){var _0x59bf34=_0x29fc64?_0xbe14('0x1c'):_0xbe14('0x16');var _0x1c7cc7={'phone':_0x16f884[_0xbe14('0x12')],['foreignKey']:_0x5dd475['id']};return _0x169369[_0xbe14('0x17')][_0xbe14('0x9')]({'where':_0x1c7cc7})[_0xbe14('0xa')](function(_0x2b05cb){if(_0x2b05cb){throw new Error(_0xbe14('0x1d')+_0x16f884[_0xbe14('0x12')]+_0xbe14('0x1e')+_0x5dd475['id']);}var _0x3bf43c=getNewHopperPayload(_0x16f884);_0x3bf43c[_0x59bf34]=_0x5dd475['id'];return _0x169369[_0xbe14('0x17')][_0xbe14('0x1b')](_0x3bf43c);});}function handleNeverCheckDuplicate(_0x223f7a,_0xe6feb2,_0x6ba36c){var _0x2ff48e=getNewHopperPayload(_0x6ba36c);_0x2ff48e[_0xbe14('0x16')]=_0xe6feb2['id'];return _0x223f7a[_0xbe14('0x17')]['create'](_0x2ff48e);}function handleCheckDuplicate(_0x2e33e1,_0x499793,_0x58f8de,_0x46c2d1){return getTimezoneCallbackAt(_0x2e33e1,_0x499793,_0x58f8de,_0x46c2d1)['then'](function(_0x243524){_0x58f8de[_0xbe14('0x6')]=_0x243524;switch(_0x499793['dialCheckDuplicateType']){case'always':return handleAlwaysCheckDuplicate(_0x2e33e1,_0x499793,_0x58f8de,_0x46c2d1);case'onlyIfOpen':return handleOnlyIfOpenCheckDuplicate(_0x2e33e1,_0x499793,_0x58f8de,_0x46c2d1);default:return handleNeverCheckDuplicate(_0x2e33e1,_0x499793,_0x58f8de);}});}function createHopperForVoiceQueues(_0x412ad5,_0xa3d24){return _0x412ad5['VoiceQueue'][_0xbe14('0x1f')]({'where':{'type':_0xbe14('0x20')},'attributes':['id',_0xbe14('0x21'),_0xbe14('0x7')],'include':[{'model':_0x412ad5[_0xbe14('0x22')],'as':'Lists','where':{'id':_0xa3d24['ListId']}}],'raw':!![]})[_0xbe14('0xa')](function(_0x52b24c){var _0x5dd7aa=_0x52b24c['map'](function(_0x163ef7){return handleCheckDuplicate(_0x412ad5,_0x163ef7,_0xa3d24,![]);});return Promise[_0xbe14('0x23')](_0x5dd7aa);});}function createHopperForCampaigns(_0x2bb45,_0x3dbacb){return _0x2bb45[_0xbe14('0x4')][_0xbe14('0x1f')]({'attributes':['id',_0xbe14('0x21'),_0xbe14('0x7')],'include':[{'model':_0x2bb45[_0xbe14('0x22')],'as':_0xbe14('0x24'),'where':{'id':_0x3dbacb[_0xbe14('0x13')]}}],'raw':!![]})[_0xbe14('0xa')](function(_0x539c41){var _0x4f51f8=_0x539c41[_0xbe14('0x25')](function(_0x2951e1){return handleCheckDuplicate(_0x2bb45,_0x2951e1,_0x3dbacb,!![]);});return Promise[_0xbe14('0x23')](_0x4f51f8);});}function createHopperBlackForVoiceQueues(_0x520e09,_0x326329){return _0x520e09[_0xbe14('0x5')][_0xbe14('0x1f')]({'where':{'type':_0xbe14('0x20')},'attributes':['id'],'include':[{'model':_0x520e09[_0xbe14('0x22')],'as':_0xbe14('0x26'),'where':{'id':_0x326329[_0xbe14('0x13')]}}],'raw':!![]})[_0xbe14('0xa')](function(_0x1b2608){var _0x5255ff=_0x1b2608[_0xbe14('0x25')](function(_0x841b71){return _0x520e09[_0xbe14('0x27')][_0xbe14('0x1b')]({'phone':_0x326329[_0xbe14('0x12')],'ContactId':_0x326329['id'],'ListId':_0x326329[_0xbe14('0x13')],'VoiceQueueId':_0x841b71['id']});});return Promise['all'](_0x5255ff);});}function createHopperBlackForCampaigns(_0xb0f143,_0x1974a4){return _0xb0f143[_0xbe14('0x4')][_0xbe14('0x1f')]({'attributes':['id'],'include':[{'model':_0xb0f143['CmList'],'as':'BlackLists','where':{'id':_0x1974a4[_0xbe14('0x13')]}}],'raw':!![]})[_0xbe14('0xa')](function(_0x3272ae){var _0x51c859=_0x3272ae['map'](function(_0x6b6aa8){return _0xb0f143['CmHopperBlack']['create']({'phone':_0x1974a4[_0xbe14('0x12')],'ContactId':_0x1974a4['id'],'ListId':_0x1974a4[_0xbe14('0x13')],'CampaignId':_0x6b6aa8['id']});});return Promise[_0xbe14('0x23')](_0x51c859);});}module['exports']=function(_0x558525){return _0x558525['define'](_0xbe14('0x28'),attributes,{'tableName':_0xbe14('0x29'),'paranoid':!![],'indexes':[{'name':_0xbe14('0x12'),'fields':['phone']},{'name':_0xbe14('0x2a'),'fields':[_0xbe14('0x2b'),_0xbe14('0x2c'),_0xbe14('0x12'),'mobile','fax',_0xbe14('0x2d')],'type':_0xbe14('0x2e')}],'timestamps':!![],'charset':_0xbe14('0x2f'),'collate':_0xbe14('0x30'),'hooks':{'afterCreate':function(_0x2550dc,_0x4f2d95,_0x51023a){var _0x46af81=_0x558525[_0xbe14('0x31')];var _0x238c60=_0x2550dc[_0xbe14('0x32')]({'plain':!![]});if(!_0x238c60['ListId']){return _0x51023a(new Error(_0xbe14('0x33')));}if(!_0x238c60[_0xbe14('0x12')]){return _0x51023a();}return createHopperForVoiceQueues(_0x46af81,_0x238c60)['then'](function(){return createHopperBlackForVoiceQueues(_0x46af81,_0x238c60);})[_0xbe14('0xa')](function(){return createHopperForCampaigns(_0x46af81,_0x238c60);})[_0xbe14('0xa')](function(){return createHopperBlackForCampaigns(_0x46af81,_0x238c60);})[_0xbe14('0xa')](function(){return _0x51023a();})[_0xbe14('0x34')](function(_0x589dac){logger['error'](_0xbe14('0x35'),_0xbe14('0x36'),_0x589dac['message']);_0x51023a(_0x589dac);});},'afterDestroy':function(_0x5acf90,_0xca8cdb,_0x5d3726){var _0x3f7f5b=_0x558525[_0xbe14('0x31')];var _0xdbc6e1=_0x5acf90[_0xbe14('0x32')]({'plain':!![]});return _0x3f7f5b[_0xbe14('0x17')]['findAll']({'raw':!![],'where':{'ListId':_0xdbc6e1[_0xbe14('0x13')],'ContactId':_0xdbc6e1['id']}})[_0xbe14('0xa')](function(_0x6928f2){if(!_[_0xbe14('0x37')](_0x6928f2)){var _0x2fc073=[];for(var _0x494c32=0x0;_0x494c32<_0x6928f2[_0xbe14('0x38')];_0x494c32+=0x1){var _0x3d419a=_0x3f7f5b[_0xbe14('0x17')][_0xbe14('0x39')]({'where':{'ListId':_0x6928f2[_0x494c32][_0xbe14('0x13')],'ContactId':_0x6928f2[_0x494c32][_0xbe14('0x3a')],'VoiceQueueId':_0x6928f2[_0x494c32]['VoiceQueueId'],'CampaignId':_0x6928f2[_0x494c32]['CampaignId']}});_0x2fc073[_0xbe14('0x3b')](_0x3d419a);}return Promise[_0xbe14('0x23')](_0x2fc073);}})[_0xbe14('0xa')](function(_0x48554a){logger['info'](_0xbe14('0x3c'),util[_0xbe14('0x3d')](_0x48554a,{'showHidden':![],'depth':null}));_0x5d3726();})['catch'](function(_0x339a86){logger[_0xbe14('0x3e')]('[CmContact][afterDestroy][Error]',util[_0xbe14('0x3d')](_0x339a86,{'showHidden':![],'depth':null}));_0x5d3726(_0x339a86);});}}});}; \ No newline at end of file +var _0xae2b=['resolve','timezones','utcOffset','add','minutes','ListId','YYYY-MM-DD\x20HH:mm:ss','priority','callbackUniqueid','CampaignId','VoiceQueueId','CmHopper','[CmContact][Always]\x20Hopper\x20already\x20exists\x20for\x20contact\x20with\x20phone\x20','phone','CmHopperFinal','[CmContact][Always]\x20Hopper\x20Final\x20already\x20exists\x20for\x20contact\x20with\x20phone\x20','\x20in\x20Campaign\x20with\x20id\x20','create','[CmContact][OnlyIfOpen]\x20Hopper\x20already\x20exists\x20for\x20contact\x20with\x20phone\x20','dialCheckDuplicateType','always','onlyIfOpen','findAll','outbound','map','all','Lists','BlackLists','CmHopperBlack','CmList','exports','define','CmContact','lastName','mobile','fax','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','get','List\x20not\x20found','catch','error','cmContact,\x20%s,\x20%s','afterCreate','message','isEmpty','length','destroy','ContactId','info','[CmContact][afterDestroy][Succesfull]','inspect','lodash','../../config/logger','api','moment','../../config/environment/shared','./cmContact.attributes','Campaign','VoiceQueue','scheduledat','format','isNil','dialTimezone','findOne','then'];(function(_0x448972,_0x30558c){var _0x4a36c5=function(_0xa8b1f0){while(--_0xa8b1f0){_0x448972['push'](_0x448972['shift']());}};_0x4a36c5(++_0x30558c);}(_0xae2b,0x14b));var _0xbae2=function(_0x355263,_0x41ac21){_0x355263=_0x355263-0x0;var _0xcf8fb4=_0xae2b[_0x355263];return _0xcf8fb4;};'use strict';var _=require(_0xbae2('0x0'));var util=require('util');var logger=require(_0xbae2('0x1'))(_0xbae2('0x2'));var moment=require(_0xbae2('0x3'));var shared=require(_0xbae2('0x4'));var attributes=require(_0xbae2('0x5'));function getTimezoneCallbackAt(_0xea26c3,_0x4999dc,_0x3d81ce,_0x572afe){var _0x6abd18=_0x572afe?_0xbae2('0x6'):_0xbae2('0x7');var _0x31b4e4=_0x3d81ce['scheduledat']?_0x3d81ce[_0xbae2('0x8')]:moment()[_0xbae2('0x9')]('YYYY-MM-DD\x20HH:mm:ss');if(_[_0xbae2('0xa')](_0x3d81ce[_0xbae2('0xb')])){return Promise['resolve'](_0x31b4e4);}return _0xea26c3[_0x6abd18][_0xbae2('0xc')]({'where':{'id':_0x4999dc}})[_0xbae2('0xd')](function(_0x2f2f98){if(_['isNil'](_0x2f2f98)||_[_0xbae2('0xa')](_0x2f2f98[_0xbae2('0xb')])){return Promise[_0xbae2('0xe')](_0x31b4e4);}var _0x15d3c7=shared[_0xbae2('0xf')];var _0x3bbad7=_0x15d3c7[_0x2f2f98['dialTimezone']];var _0x49a32a=_0x15d3c7[_0x3d81ce[_0xbae2('0xb')]];if(_[_0xbae2('0xa')](_0x3bbad7)&&_[_0xbae2('0xa')](_0x49a32a)){return Promise[_0xbae2('0xe')](_0x31b4e4);}var _0x207546=_0x3bbad7['utcOffset']-_0x49a32a[_0xbae2('0x10')];var _0x3fd4c4=_0x3d81ce[_0xbae2('0x8')]?_0x3d81ce['scheduledat']:moment();_0x31b4e4=moment(_0x3fd4c4)[_0xbae2('0x11')](_0x207546,_0xbae2('0x12'))['format']('YYYY-MM-DD\x20HH:mm:ss');return Promise[_0xbae2('0xe')](_0x31b4e4);});}function getNewHopperPayload(_0x28d18b){return{'phone':_0x28d18b['phone'],'ContactId':_0x28d18b['id'],'ListId':_0x28d18b[_0xbae2('0x13')],'scheduledat':_0x28d18b[_0xbae2('0x8')]?_0x28d18b['scheduledat']:moment()[_0xbae2('0x9')](_0xbae2('0x14')),'priority':_0x28d18b['priority']?_0x28d18b[_0xbae2('0x15')]:0x2,'callback':_0x28d18b[_0xbae2('0x16')]?!![]:![],'callbackuniqueid':_0x28d18b['callbackUniqueid']?_0x28d18b[_0xbae2('0x16')]:undefined,'callbackat':_0x28d18b['callbackUniqueid']?moment()[_0xbae2('0x9')](_0xbae2('0x14')):undefined};}function handleAlwaysCheckDuplicate(_0x304d95,_0x1e502d,_0x38da31,_0x11959c){var _0x463aad=_0x11959c?_0xbae2('0x17'):_0xbae2('0x18');return _0x304d95[_0xbae2('0x19')][_0xbae2('0xc')]({'where':{'phone':_0x38da31['phone'],['fkField']:_0x1e502d['id']}})[_0xbae2('0xd')](function(_0x5457f4){if(_0x5457f4){throw new Error(_0xbae2('0x1a')+_0x38da31[_0xbae2('0x1b')]+'\x20in\x20Campaign\x20with\x20id\x20'+_0x1e502d['id']);}return _0x304d95[_0xbae2('0x1c')][_0xbae2('0xc')]({'where':{'calleridnum':_0x38da31[_0xbae2('0x1b')],['fkField']:_0x1e502d['id']}});})['then'](function(_0x4a7161){if(_0x4a7161){throw new Error(_0xbae2('0x1d')+_0x38da31[_0xbae2('0x1b')]+_0xbae2('0x1e')+_0x1e502d['id']);}var _0x1e2875=getNewHopperPayload(_0x38da31);_0x1e2875[_0x463aad]=_0x1e502d['id'];return _0x304d95['CmHopper'][_0xbae2('0x1f')](_0x1e2875);});}function handleOnlyIfOpenCheckDuplicate(_0x4382a2,_0x49b249,_0x13f3f2,_0x38576d){var _0x8f346a=_0x38576d?_0xbae2('0x17'):_0xbae2('0x18');return _0x4382a2['CmHopper']['findOne']({'where':{'phone':_0x13f3f2[_0xbae2('0x1b')],['fkField']:_0x49b249['id']}})[_0xbae2('0xd')](function(_0xac3423){if(_0xac3423){throw new Error(_0xbae2('0x20')+_0x13f3f2[_0xbae2('0x1b')]+_0xbae2('0x1e')+_0x49b249['id']);}var _0x581352=getNewHopperPayload(_0x13f3f2);_0x581352[_0x8f346a]=_0x49b249['id'];return _0x4382a2[_0xbae2('0x19')]['create'](_0x581352);});}function handleNeverCheckDuplicate(_0x595cf7,_0x4e68dc,_0x318f0d){var _0xd9d017=getNewHopperPayload(_0x318f0d);_0xd9d017['VoiceQueueId']=_0x4e68dc['id'];return _0x595cf7[_0xbae2('0x19')]['create'](_0xd9d017);}function handleCheckDuplicate(_0xdce091,_0xc02791,_0x338d72,_0x43a585){return getTimezoneCallbackAt(_0xdce091,_0xc02791,_0x338d72,_0x43a585)[_0xbae2('0xd')](function(_0x4ab656){_0x338d72['scheduledat']=_0x4ab656;switch(_0xc02791[_0xbae2('0x21')]){case _0xbae2('0x22'):return handleAlwaysCheckDuplicate(_0xdce091,_0xc02791,_0x338d72,_0x43a585);case _0xbae2('0x23'):return handleOnlyIfOpenCheckDuplicate(_0xdce091,_0xc02791,_0x338d72,_0x43a585);default:return handleNeverCheckDuplicate(_0xdce091,_0xc02791,_0x338d72);}});}function createHopperForVoiceQueues(_0x409365,_0x457dae){return _0x409365[_0xbae2('0x7')][_0xbae2('0x24')]({'where':{'type':_0xbae2('0x25')},'attributes':['id',_0xbae2('0x21'),_0xbae2('0xb')],'include':[{'model':_0x409365['CmList'],'as':'Lists','where':{'id':_0x457dae[_0xbae2('0x13')]}}],'raw':!![]})[_0xbae2('0xd')](function(_0x1f6228){var _0x53b7b3=_0x1f6228[_0xbae2('0x26')](function(_0x35f8ef){return handleCheckDuplicate(_0x409365,_0x35f8ef,_0x457dae,![]);});return Promise[_0xbae2('0x27')](_0x53b7b3);});}function createHopperForCampaigns(_0x305773,_0x406437){return _0x305773[_0xbae2('0x6')][_0xbae2('0x24')]({'attributes':['id','dialCheckDuplicateType','dialTimezone'],'include':[{'model':_0x305773['CmList'],'as':_0xbae2('0x28'),'where':{'id':_0x406437[_0xbae2('0x13')]}}],'raw':!![]})[_0xbae2('0xd')](function(_0x1cec27){var _0x2a739c=_0x1cec27[_0xbae2('0x26')](function(_0x3c34e0){return handleCheckDuplicate(_0x305773,_0x3c34e0,_0x406437,!![]);});return Promise[_0xbae2('0x27')](_0x2a739c);});}function createHopperBlackForVoiceQueues(_0x4531e1,_0x3b54b7){return _0x4531e1[_0xbae2('0x7')][_0xbae2('0x24')]({'where':{'type':_0xbae2('0x25')},'attributes':['id'],'include':[{'model':_0x4531e1['CmList'],'as':_0xbae2('0x29'),'where':{'id':_0x3b54b7[_0xbae2('0x13')]}}],'raw':!![]})[_0xbae2('0xd')](function(_0x561feb){var _0x54d588=_0x561feb[_0xbae2('0x26')](function(_0x4e2ce4){return _0x4531e1[_0xbae2('0x2a')]['create']({'phone':_0x3b54b7['phone'],'ContactId':_0x3b54b7['id'],'ListId':_0x3b54b7['ListId'],'VoiceQueueId':_0x4e2ce4['id']});});return Promise[_0xbae2('0x27')](_0x54d588);});}function createHopperBlackForCampaigns(_0x254a0c,_0x9e0c27){return _0x254a0c['Campaign'][_0xbae2('0x24')]({'attributes':['id'],'include':[{'model':_0x254a0c[_0xbae2('0x2b')],'as':_0xbae2('0x29'),'where':{'id':_0x9e0c27[_0xbae2('0x13')]}}],'raw':!![]})[_0xbae2('0xd')](function(_0x32b734){var _0x5c08f9=_0x32b734[_0xbae2('0x26')](function(_0xd9ed5){return _0x254a0c[_0xbae2('0x2a')]['create']({'phone':_0x9e0c27[_0xbae2('0x1b')],'ContactId':_0x9e0c27['id'],'ListId':_0x9e0c27[_0xbae2('0x13')],'CampaignId':_0xd9ed5['id']});});return Promise['all'](_0x5c08f9);});}module[_0xbae2('0x2c')]=function(_0x354010){return _0x354010[_0xbae2('0x2d')](_0xbae2('0x2e'),attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':_0xbae2('0x1b'),'fields':[_0xbae2('0x1b')]},{'name':'fti_cm_contacts','fields':['firstName',_0xbae2('0x2f'),_0xbae2('0x1b'),_0xbae2('0x30'),_0xbae2('0x31'),_0xbae2('0x32')],'type':_0xbae2('0x33')}],'timestamps':!![],'charset':_0xbae2('0x34'),'collate':_0xbae2('0x35'),'hooks':{'afterCreate':function(_0x33123c,_0x52523b,_0x83fdc5){var _0x1652be=_0x354010[_0xbae2('0x36')];var _0x13d2f1=_0x33123c[_0xbae2('0x37')]({'plain':!![]});if(!_0x13d2f1['ListId']){return _0x83fdc5(new Error(_0xbae2('0x38')));}if(!_0x13d2f1['phone']){return _0x83fdc5();}return createHopperForVoiceQueues(_0x1652be,_0x13d2f1)[_0xbae2('0xd')](function(){return createHopperBlackForVoiceQueues(_0x1652be,_0x13d2f1);})['then'](function(){return createHopperForCampaigns(_0x1652be,_0x13d2f1);})['then'](function(){return createHopperBlackForCampaigns(_0x1652be,_0x13d2f1);})['then'](function(){return _0x83fdc5();})[_0xbae2('0x39')](function(_0x2948ef){logger[_0xbae2('0x3a')](_0xbae2('0x3b'),_0xbae2('0x3c'),_0x2948ef[_0xbae2('0x3d')]);_0x83fdc5(_0x2948ef);});},'afterDestroy':function(_0x561a3e,_0x543274,_0x37a3a8){var _0x570e02=_0x354010['models'];var _0x58e88f=_0x561a3e[_0xbae2('0x37')]({'plain':!![]});return _0x570e02[_0xbae2('0x19')]['findAll']({'raw':!![],'where':{'ListId':_0x58e88f['ListId'],'ContactId':_0x58e88f['id']}})[_0xbae2('0xd')](function(_0x2fd8ba){if(!_[_0xbae2('0x3e')](_0x2fd8ba)){var _0x52088a=[];for(var _0x3a6432=0x0;_0x3a6432<_0x2fd8ba[_0xbae2('0x3f')];_0x3a6432+=0x1){var _0x1d086f=_0x570e02['CmHopper'][_0xbae2('0x40')]({'where':{'ListId':_0x2fd8ba[_0x3a6432][_0xbae2('0x13')],'ContactId':_0x2fd8ba[_0x3a6432][_0xbae2('0x41')],'VoiceQueueId':_0x2fd8ba[_0x3a6432][_0xbae2('0x18')],'CampaignId':_0x2fd8ba[_0x3a6432]['CampaignId']}});_0x52088a['push'](_0x1d086f);}return Promise['all'](_0x52088a);}})['then'](function(_0x5b8a11){logger[_0xbae2('0x42')](_0xbae2('0x43'),util[_0xbae2('0x44')](_0x5b8a11,{'showHidden':![],'depth':null}));_0x37a3a8();})[_0xbae2('0x39')](function(_0x213d91){logger[_0xbae2('0x3a')]('[CmContact][afterDestroy][Error]',util[_0xbae2('0x44')](_0x213d91,{'showHidden':![],'depth':null}));_0x37a3a8(_0x213d91);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index af4cf5a..bf7395b 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['phone','ListId','Contact','CmContactId','create','body','keys','length','startsWith','update','table','cm_contacts','id\x20=\x20?','sequelize','query','CreateCmContact','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./cmContact.socket','register','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmContact','CmContact','findAll','options','where','limit','include','map','model','attributes','then','stringify','CmContactHasItem','find'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var squel=require('squel');var db=require(_0x0a9e('0x4'))['db'];var utils=require(_0x0a9e('0x5'));var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var config=require(_0x0a9e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0a9e('0x9')][_0x0a9e('0xa')]({'port':0x232a});config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithRpcPromise(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){return client['request'](_0x307b3e,_0xfeb75b)['then'](function(_0x4cfe67){logger[_0x0a9e('0xf')](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));logger[_0x0a9e('0x12')](_0x0a9e('0x13'),_0x3ab53f,_0x0a9e('0x11'),JSON['stringify'](_0x4cfe67));if(_0x4cfe67[_0x0a9e('0x14')]){if(_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x15')]===0x1f4){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')]['message']);return _0x4a4c56(_0x4cfe67[_0x0a9e('0x14')]['message']);}logger[_0x0a9e('0x14')]('CmContact,\x20%s,\x20%s',_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x16')]);return _0xbd1168(_0x4cfe67['error'][_0x0a9e('0x16')]);}else{logger['info'](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));_0xbd1168(_0x4cfe67[_0x0a9e('0x17')][_0x0a9e('0x16')]);}})[_0x0a9e('0x18')](function(_0x2eb11f){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x2eb11f);_0x4a4c56(_0x2eb11f);});});}exports[_0x0a9e('0x19')]=function(_0x112016){var _0x1c696a=this;return new Promise(function(_0x105080,_0x4bb1e3){return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':_0x112016['options']?_0x112016[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x112016['options']?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')]||null:null,'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')]['attributes']||null:null,'limit':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1e')]||null:null,'include':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x112016['options']['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x21')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x22')],'include':_0x197ec0[_0x0a9e('0x1f')]?_['map'](_0x197ec0[_0x0a9e('0x1f')],function(_0x479bc4){return{'model':db[_0x479bc4[_0x0a9e('0x21')]],'as':_0x479bc4['as'],'attributes':_0x479bc4['attributes'],'include':_0x479bc4[_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x479bc4[_0x0a9e('0x1f')],function(_0x14433c){return{'model':db[_0x14433c[_0x0a9e('0x21')]],'as':_0x14433c['as'],'attributes':_0x14433c[_0x0a9e('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x14de77){logger['info'](_0x0a9e('0x19'),_0x112016);logger[_0x0a9e('0x12')](_0x0a9e('0x19'),_0x112016,JSON[_0x0a9e('0x24')](_0x14de77));if(_0x14de77['length']==0x0){return db[_0x0a9e('0x25')][_0x0a9e('0x26')]({'raw':!![],'where':{'item':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x27')]},'include':[{'model':db[_0x0a9e('0x1a')],'where':{'ListId':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')][_0x0a9e('0x28')],'deletedAt':{'$eq':null}},'as':_0x0a9e('0x29')}]})['then'](function(_0x426950){if(_['isNil'](_0x426950)){_0x105080(_0x14de77);}else{var _0x2407f9=_0x426950[_0x0a9e('0x2a')];return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':!![],'where':{'id':_0x2407f9},'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016['options'][_0x0a9e('0x22')]||null:null})[_0x0a9e('0x23')](function(_0x40cb85){_0x105080(_0x40cb85);});}});}else{_0x105080(_0x14de77);}})[_0x0a9e('0x18')](function(_0x2b45ea){logger[_0x0a9e('0x14')](_0x0a9e('0x19'),_0x2b45ea[_0x0a9e('0x16')],_0x112016);_0x4bb1e3(_0x1c696a['error'](0x1f4,_0x2b45ea[_0x0a9e('0x16')]));});});};exports['CreateCmContact']=function(_0x2cc7a0){var _0x14b13f=this;return new Promise(function(_0x2b7e7f,_0x3f3d41){return db['CmContact'][_0x0a9e('0x2b')](_0x2cc7a0[_0x0a9e('0x2c')],{'raw':_0x2cc7a0[_0x0a9e('0x1c')]?_0x2cc7a0[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e8694){var _0x5640eb;for(var _0x24936a=0x0;_0x24936a{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file +var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x48b88d,_0x1ac9bc){var _0x11fa08=function(_0x800ad6){while(--_0x800ad6){_0x48b88d['push'](_0x48b88d['shift']());}};_0x11fa08(++_0x1ac9bc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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 f704529..6e35f80 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 _0xe920=['sequelize','exports','INTEGER','STRING','PHONE'];(function(_0x231952,_0x25d759){var _0x573744=function(_0x568091){while(--_0x568091){_0x231952['push'](_0x231952['shift']());}};_0x573744(++_0x25d759);}(_0xe920,0xbe));var _0x0e92=function(_0x31ced5,_0x5d5415){_0x31ced5=_0x31ced5-0x0;var _0x10d9e5=_0xe920[_0x31ced5];return _0x10d9e5;};'use strict';var Sequelize=require(_0x0e92('0x0'));module[_0x0e92('0x1')]={'CmContactId':{'type':Sequelize[_0x0e92('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0x0e92('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x0e92('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x0e92('0x3')],'defaultValue':_0x0e92('0x4')},'OrderBy':{'type':Sequelize[_0x0e92('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0x0e92('0x3')],'defaultValue':null}}; \ No newline at end of file +var _0xaa88=['PHONE','sequelize','exports','INTEGER','STRING'];(function(_0x388899,_0x17f370){var _0x3be17d=function(_0x19ad17){while(--_0x19ad17){_0x388899['push'](_0x388899['shift']());}};_0x3be17d(++_0x17f370);}(_0xaa88,0x137));var _0x8aa8=function(_0xdeac17,_0x19ad66){_0xdeac17=_0xdeac17-0x0;var _0x33aabd=_0xaa88[_0xdeac17];return _0x33aabd;};'use strict';var Sequelize=require(_0x8aa8('0x0'));module[_0x8aa8('0x1')]={'CmContactId':{'type':Sequelize[_0x8aa8('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize['INTEGER'],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x4')},'OrderBy':{'type':Sequelize[_0x8aa8('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0x8aa8('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 8b9f99d..c30c31a 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 _0x1ab7=['desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','end','error','stack','name','send','index','map','CmContactHasItem','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CmContactHasItems','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce'];(function(_0x6a850f,_0x4e026b){var _0x5370ac=function(_0xc5193a){while(--_0xc5193a){_0x6a850f['push'](_0x6a850f['shift']());}};_0x5370ac(++_0x4e026b);}(_0x1ab7,0x187));var _0x71ab=function(_0x2c1ad0,_0x5c2efb){_0x2c1ad0=_0x2c1ad0-0x0;var _0x22da92=_0x1ab7[_0x2c1ad0];return _0x22da92;};'use strict';var emlformat=require(_0x71ab('0x0'));var rimraf=require(_0x71ab('0x1'));var zipdir=require(_0x71ab('0x2'));var jsonpatch=require(_0x71ab('0x3'));var rp=require(_0x71ab('0x4'));var moment=require('moment');var BPromise=require(_0x71ab('0x5'));var Mustache=require(_0x71ab('0x6'));var util=require('util');var path=require(_0x71ab('0x7'));var sox=require('sox');var csv=require(_0x71ab('0x8'));var ejs=require(_0x71ab('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x71ab('0xa'));var squel=require(_0x71ab('0xb'));var crypto=require(_0x71ab('0xc'));var jsforce=require(_0x71ab('0xd'));var deskjs=require(_0x71ab('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x71ab('0xf'));var Redis=require(_0x71ab('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x71ab('0x11'));var hardwareService=require(_0x71ab('0x12'));var logger=require('../../config/logger')(_0x71ab('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x71ab('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x211621,_0x415d9e){_0x415d9e=_0x415d9e||0xcc;return function(_0x44900e){if(_0x44900e){return _0x211621[_0x71ab('0x15')](_0x415d9e);}return _0x211621[_0x71ab('0x16')](_0x415d9e)['end']();};}function respondWithResult(_0x195f74,_0xb10700){_0xb10700=_0xb10700||0xc8;return function(_0x3351c9){if(_0x3351c9){return _0x195f74[_0x71ab('0x16')](_0xb10700)[_0x71ab('0x17')](_0x3351c9);}};}function respondWithFilteredResult(_0x366d4e,_0x369565){return function(_0x4815fb){if(_0x4815fb){var _0x14830a=typeof _0x369565[_0x71ab('0x18')]===_0x71ab('0x19')&&typeof _0x369565[_0x71ab('0x1a')]===_0x71ab('0x19');var _0x48fbd7=_0x4815fb[_0x71ab('0x1b')];var _0x572722=_0x14830a?0x0:_0x369565[_0x71ab('0x18')];var _0x30a963=_0x14830a?_0x4815fb[_0x71ab('0x1b')]:_0x369565[_0x71ab('0x18')]+_0x369565[_0x71ab('0x1a')];var _0xa67a36;if(_0x30a963>=_0x48fbd7){_0x30a963=_0x48fbd7;_0xa67a36=0xc8;}else{_0xa67a36=0xce;}_0x366d4e['status'](_0xa67a36);return _0x366d4e[_0x71ab('0x1c')](_0x71ab('0x1d'),_0x572722+'-'+_0x30a963+'/'+_0x48fbd7)[_0x71ab('0x17')](_0x4815fb);}return null;};}function patchUpdates(_0x8a7556){return function(_0x1b1e31){try{jsonpatch[_0x71ab('0x1e')](_0x1b1e31,_0x8a7556,!![]);}catch(_0xc0fd31){return BPromise[_0x71ab('0x1f')](_0xc0fd31);}return _0x1b1e31[_0x71ab('0x20')]();};}function saveUpdates(_0x1d5c20,_0x25afd1){return function(_0x2b6a36){if(_0x2b6a36){return _0x2b6a36[_0x71ab('0x21')](_0x1d5c20)['then'](function(_0x5d3e3a){return _0x5d3e3a;});}return null;};}function removeEntity(_0x50cd51,_0x15ff7f){return function(_0x895535){if(_0x895535){return _0x895535[_0x71ab('0x22')]()[_0x71ab('0x23')](function(){var _0x1178c4=_0x895535[_0x71ab('0x24')]({'plain':!![]});var _0x338d78='CmContactHasItems';return db[_0x71ab('0x25')][_0x71ab('0x22')]({'where':{'type':_0x338d78,'resourceId':_0x1178c4['id']}})['then'](function(){return _0x895535;});})['then'](function(){_0x50cd51[_0x71ab('0x16')](0xcc)[_0x71ab('0x26')]();});}};}function handleEntityNotFound(_0x239893,_0x419fb6){return function(_0x12e801){if(!_0x12e801){_0x239893[_0x71ab('0x15')](0x194);}return _0x12e801;};}function handleError(_0xd74af,_0x1aa6ca){_0x1aa6ca=_0x1aa6ca||0x1f4;return function(_0x375a27){logger[_0x71ab('0x27')](_0x375a27[_0x71ab('0x28')]);if(_0x375a27[_0x71ab('0x29')]){delete _0x375a27['name'];}_0xd74af[_0x71ab('0x16')](_0x1aa6ca)[_0x71ab('0x2a')](_0x375a27);};}exports[_0x71ab('0x2b')]=function(_0x50d61d,_0x1213f1){var _0x4da0ee={},_0x4c231a={},_0x21f32d={'count':0x0,'rows':[]};var _0xb8d1ef=_[_0x71ab('0x2c')](db[_0x71ab('0x2d')][_0x71ab('0x2e')],function(_0x565dc9){return{'name':_0x565dc9[_0x71ab('0x2f')],'type':_0x565dc9['type'][_0x71ab('0x30')]};});_0x4c231a[_0x71ab('0x31')]=_['map'](_0xb8d1ef,_0x71ab('0x29'));_0x4c231a[_0x71ab('0x32')]=_[_0x71ab('0x33')](_0x50d61d[_0x71ab('0x32')]);_0x4c231a[_0x71ab('0x34')]=_['intersection'](_0x4c231a[_0x71ab('0x31')],_0x4c231a[_0x71ab('0x32')]);_0x4da0ee[_0x71ab('0x35')]=_[_0x71ab('0x36')](_0x4c231a['model'],qs[_0x71ab('0x37')](_0x50d61d[_0x71ab('0x32')]['fields']));_0x4da0ee[_0x71ab('0x35')]=_0x4da0ee[_0x71ab('0x35')]['length']?_0x4da0ee[_0x71ab('0x35')]:_0x4c231a[_0x71ab('0x31')];if(!_0x50d61d['query'][_0x71ab('0x38')](_0x71ab('0x39'))){_0x4da0ee[_0x71ab('0x1a')]=qs[_0x71ab('0x1a')](_0x50d61d[_0x71ab('0x32')][_0x71ab('0x1a')]);_0x4da0ee[_0x71ab('0x18')]=qs[_0x71ab('0x18')](_0x50d61d[_0x71ab('0x32')][_0x71ab('0x18')]);}_0x4da0ee[_0x71ab('0x3a')]=qs[_0x71ab('0x3b')](_0x50d61d[_0x71ab('0x32')][_0x71ab('0x3b')]);_0x4da0ee[_0x71ab('0x3c')]=qs['filters'](_['pick'](_0x50d61d[_0x71ab('0x32')],_0x4c231a['filters']),_0xb8d1ef);if(_0x50d61d['query'][_0x71ab('0x3d')]){_0x4da0ee['where']=_[_0x71ab('0x3e')](_0x4da0ee[_0x71ab('0x3c')],{'$or':_[_0x71ab('0x2c')](_0xb8d1ef,function(_0x45765e){if(_0x45765e[_0x71ab('0x3f')]!=='VIRTUAL'){var _0x393c27={};_0x393c27[_0x45765e[_0x71ab('0x29')]]={'$like':'%'+_0x50d61d['query'][_0x71ab('0x3d')]+'%'};return _0x393c27;}})});}_0x4da0ee=_[_0x71ab('0x3e')]({},_0x4da0ee,_0x50d61d[_0x71ab('0x40')]);var _0x37ae58={'where':_0x4da0ee['where']};return db[_0x71ab('0x2d')][_0x71ab('0x1b')](_0x37ae58)[_0x71ab('0x23')](function(_0x4c0510){_0x21f32d[_0x71ab('0x1b')]=_0x4c0510;if(_0x50d61d[_0x71ab('0x32')][_0x71ab('0x41')]){_0x4da0ee[_0x71ab('0x42')]=[{'all':!![]}];}return db[_0x71ab('0x2d')][_0x71ab('0x43')](_0x4da0ee);})[_0x71ab('0x23')](function(_0x3163c4){_0x21f32d[_0x71ab('0x44')]=_0x3163c4;return _0x21f32d;})[_0x71ab('0x23')](respondWithFilteredResult(_0x1213f1,_0x4da0ee))[_0x71ab('0x45')](handleError(_0x1213f1,null));};exports[_0x71ab('0x46')]=function(_0x1f9b51,_0xe9a8d8){var _0x3c6bd2={'raw':!![],'where':{'id':_0x1f9b51['params']['id']}},_0x192d79={};_0x192d79[_0x71ab('0x31')]=_[_0x71ab('0x33')](db[_0x71ab('0x2d')]['rawAttributes']);_0x192d79[_0x71ab('0x32')]=_[_0x71ab('0x33')](_0x1f9b51[_0x71ab('0x32')]);_0x192d79['filters']=_[_0x71ab('0x36')](_0x192d79[_0x71ab('0x31')],_0x192d79[_0x71ab('0x32')]);_0x3c6bd2[_0x71ab('0x35')]=_[_0x71ab('0x36')](_0x192d79[_0x71ab('0x31')],qs[_0x71ab('0x37')](_0x1f9b51[_0x71ab('0x32')][_0x71ab('0x37')]));_0x3c6bd2['attributes']=_0x3c6bd2[_0x71ab('0x35')]['length']?_0x3c6bd2[_0x71ab('0x35')]:_0x192d79[_0x71ab('0x31')];if(_0x1f9b51[_0x71ab('0x32')]['includeAll']){_0x3c6bd2[_0x71ab('0x42')]=[{'all':!![]}];}_0x3c6bd2=_['merge']({},_0x3c6bd2,_0x1f9b51[_0x71ab('0x40')]);return db[_0x71ab('0x2d')][_0x71ab('0x47')](_0x3c6bd2)[_0x71ab('0x23')](handleEntityNotFound(_0xe9a8d8,null))[_0x71ab('0x23')](respondWithResult(_0xe9a8d8,null))[_0x71ab('0x45')](handleError(_0xe9a8d8,null));};exports[_0x71ab('0x48')]=function(_0x37f7f1,_0x3a618c){return db['CmContactHasItem']['create'](_0x37f7f1[_0x71ab('0x49')],{})['then'](function(_0x3972d5){var _0x3e806f=_0x37f7f1[_0x71ab('0x4a')][_0x71ab('0x24')]({'plain':!![]});if(!_0x3e806f)throw new Error(_0x71ab('0x4b'));if(_0x3e806f[_0x71ab('0x4c')]==='user'){var _0x56c6a6=_0x3972d5['get']({'plain':!![]});var _0x6b6897=_0x71ab('0x4d');return db['UserProfileSection'][_0x71ab('0x47')]({'where':{'name':_0x6b6897,'userProfileId':_0x3e806f['userProfileId']},'raw':!![]})[_0x71ab('0x23')](function(_0x105554){if(_0x105554&&_0x105554[_0x71ab('0x4e')]===0x0){return db[_0x71ab('0x25')][_0x71ab('0x48')]({'name':_0x56c6a6[_0x71ab('0x29')],'resourceId':_0x56c6a6['id'],'type':_0x105554[_0x71ab('0x29')],'sectionId':_0x105554['id']},{})[_0x71ab('0x23')](function(){return _0x3972d5;});}else{return _0x3972d5;}})['catch'](function(_0x757eb0){logger['error'](_0x71ab('0x4f'),_0x757eb0);throw _0x757eb0;});}return _0x3972d5;})[_0x71ab('0x23')](respondWithResult(_0x3a618c,0xc9))[_0x71ab('0x45')](handleError(_0x3a618c,null));};exports['update']=function(_0x264267,_0x274851){if(_0x264267[_0x71ab('0x49')]['id']){delete _0x264267[_0x71ab('0x49')]['id'];}return db[_0x71ab('0x2d')][_0x71ab('0x47')]({'where':{'id':_0x264267[_0x71ab('0x50')]['id']}})[_0x71ab('0x23')](handleEntityNotFound(_0x274851,null))[_0x71ab('0x23')](saveUpdates(_0x264267[_0x71ab('0x49')],null))[_0x71ab('0x23')](respondWithResult(_0x274851,null))[_0x71ab('0x45')](handleError(_0x274851,null));};exports[_0x71ab('0x22')]=function(_0x5a484a,_0x5d7e36){return db[_0x71ab('0x2d')][_0x71ab('0x47')]({'where':{'id':_0x5a484a[_0x71ab('0x50')]['id']}})[_0x71ab('0x23')](handleEntityNotFound(_0x5d7e36,null))[_0x71ab('0x23')](removeEntity(_0x5d7e36,null))[_0x71ab('0x45')](handleError(_0x5d7e36,null));}; \ No newline at end of file +var _0xb143=['name','send','index','map','CmContactHasItem','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','type','VIRTUAL','options','include','findAll','rows','params','keys','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','then','destroy','CmContactHasItems','end','error','stack'];(function(_0x175342,_0x57e790){var _0x1477a8=function(_0x3f6b55){while(--_0x3f6b55){_0x175342['push'](_0x175342['shift']());}};_0x1477a8(++_0x57e790);}(_0xb143,0x1b2));var _0x3b14=function(_0x3b1ed4,_0x158fec){_0x3b1ed4=_0x3b1ed4-0x0;var _0x2fc35e=_0xb143[_0x3b1ed4];return _0x2fc35e;};'use strict';var emlformat=require(_0x3b14('0x0'));var rimraf=require(_0x3b14('0x1'));var zipdir=require(_0x3b14('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3b14('0x3'));var moment=require(_0x3b14('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3b14('0x5'));var util=require('util');var path=require('path');var sox=require(_0x3b14('0x6'));var csv=require(_0x3b14('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3b14('0x8'));var _=require(_0x3b14('0x9'));var squel=require(_0x3b14('0xa'));var crypto=require(_0x3b14('0xb'));var jsforce=require(_0x3b14('0xc'));var deskjs=require(_0x3b14('0xd'));var toCsv=require(_0x3b14('0x7'));var querystring=require(_0x3b14('0xe'));var Papa=require('papaparse');var Redis=require(_0x3b14('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3b14('0x10'));var as=require(_0x3b14('0x11'));var hardwareService=require(_0x3b14('0x12'));var logger=require(_0x3b14('0x13'))(_0x3b14('0x14'));var utils=require(_0x3b14('0x15'));var config=require(_0x3b14('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16ae0a,_0x2e2ece){_0x2e2ece=_0x2e2ece||0xcc;return function(_0x4d637b){if(_0x4d637b){return _0x16ae0a[_0x3b14('0x17')](_0x2e2ece);}return _0x16ae0a[_0x3b14('0x18')](_0x2e2ece)['end']();};}function respondWithResult(_0xb72ba,_0x1f2e90){_0x1f2e90=_0x1f2e90||0xc8;return function(_0x17aeb0){if(_0x17aeb0){return _0xb72ba[_0x3b14('0x18')](_0x1f2e90)[_0x3b14('0x19')](_0x17aeb0);}};}function respondWithFilteredResult(_0x4baef,_0x417a37){return function(_0x58360c){if(_0x58360c){var _0x427096=typeof _0x417a37['offset']===_0x3b14('0x1a')&&typeof _0x417a37[_0x3b14('0x1b')]===_0x3b14('0x1a');var _0x34aadd=_0x58360c[_0x3b14('0x1c')];var _0x20458c=_0x427096?0x0:_0x417a37[_0x3b14('0x1d')];var _0x92c766=_0x427096?_0x58360c[_0x3b14('0x1c')]:_0x417a37['offset']+_0x417a37[_0x3b14('0x1b')];var _0x1e3247;if(_0x92c766>=_0x34aadd){_0x92c766=_0x34aadd;_0x1e3247=0xc8;}else{_0x1e3247=0xce;}_0x4baef[_0x3b14('0x18')](_0x1e3247);return _0x4baef[_0x3b14('0x1e')](_0x3b14('0x1f'),_0x20458c+'-'+_0x92c766+'/'+_0x34aadd)[_0x3b14('0x19')](_0x58360c);}return null;};}function patchUpdates(_0x41f04d){return function(_0x131cda){try{jsonpatch['apply'](_0x131cda,_0x41f04d,!![]);}catch(_0x18d90f){return BPromise[_0x3b14('0x20')](_0x18d90f);}return _0x131cda[_0x3b14('0x21')]();};}function saveUpdates(_0x877a8c,_0x156b8e){return function(_0x2ec040){if(_0x2ec040){return _0x2ec040['update'](_0x877a8c)[_0x3b14('0x22')](function(_0x4010a4){return _0x4010a4;});}return null;};}function removeEntity(_0x91ef68,_0x3cceec){return function(_0x54ced6){if(_0x54ced6){return _0x54ced6[_0x3b14('0x23')]()['then'](function(){var _0x40f83d=_0x54ced6['get']({'plain':!![]});var _0x307d39=_0x3b14('0x24');return db['UserProfileResource'][_0x3b14('0x23')]({'where':{'type':_0x307d39,'resourceId':_0x40f83d['id']}})[_0x3b14('0x22')](function(){return _0x54ced6;});})['then'](function(){_0x91ef68[_0x3b14('0x18')](0xcc)[_0x3b14('0x25')]();});}};}function handleEntityNotFound(_0x203b63,_0x15a0fe){return function(_0x3c7425){if(!_0x3c7425){_0x203b63[_0x3b14('0x17')](0x194);}return _0x3c7425;};}function handleError(_0x2c9438,_0x27ed6e){_0x27ed6e=_0x27ed6e||0x1f4;return function(_0x4be6b8){logger[_0x3b14('0x26')](_0x4be6b8[_0x3b14('0x27')]);if(_0x4be6b8[_0x3b14('0x28')]){delete _0x4be6b8[_0x3b14('0x28')];}_0x2c9438[_0x3b14('0x18')](_0x27ed6e)[_0x3b14('0x29')](_0x4be6b8);};}exports[_0x3b14('0x2a')]=function(_0xd2e821,_0x309a06){var _0x4b0f95={},_0x159cc7={},_0xe30e0b={'count':0x0,'rows':[]};var _0x1895d6=_[_0x3b14('0x2b')](db[_0x3b14('0x2c')][_0x3b14('0x2d')],function(_0x52a8c5){return{'name':_0x52a8c5['fieldName'],'type':_0x52a8c5['type'][_0x3b14('0x2e')]};});_0x159cc7[_0x3b14('0x2f')]=_[_0x3b14('0x2b')](_0x1895d6,_0x3b14('0x28'));_0x159cc7[_0x3b14('0x30')]=_['keys'](_0xd2e821['query']);_0x159cc7[_0x3b14('0x31')]=_[_0x3b14('0x32')](_0x159cc7[_0x3b14('0x2f')],_0x159cc7[_0x3b14('0x30')]);_0x4b0f95[_0x3b14('0x33')]=_[_0x3b14('0x32')](_0x159cc7['model'],qs['fields'](_0xd2e821[_0x3b14('0x30')][_0x3b14('0x34')]));_0x4b0f95[_0x3b14('0x33')]=_0x4b0f95[_0x3b14('0x33')][_0x3b14('0x35')]?_0x4b0f95[_0x3b14('0x33')]:_0x159cc7[_0x3b14('0x2f')];if(!_0xd2e821['query']['hasOwnProperty']('nolimit')){_0x4b0f95[_0x3b14('0x1b')]=qs['limit'](_0xd2e821[_0x3b14('0x30')]['limit']);_0x4b0f95['offset']=qs[_0x3b14('0x1d')](_0xd2e821[_0x3b14('0x30')][_0x3b14('0x1d')]);}_0x4b0f95[_0x3b14('0x36')]=qs[_0x3b14('0x37')](_0xd2e821[_0x3b14('0x30')][_0x3b14('0x37')]);_0x4b0f95[_0x3b14('0x38')]=qs['filters'](_[_0x3b14('0x39')](_0xd2e821[_0x3b14('0x30')],_0x159cc7[_0x3b14('0x31')]),_0x1895d6);if(_0xd2e821[_0x3b14('0x30')]['filter']){_0x4b0f95[_0x3b14('0x38')]=_[_0x3b14('0x3a')](_0x4b0f95[_0x3b14('0x38')],{'$or':_[_0x3b14('0x2b')](_0x1895d6,function(_0x32adef){if(_0x32adef[_0x3b14('0x3b')]!==_0x3b14('0x3c')){var _0x2f1857={};_0x2f1857[_0x32adef[_0x3b14('0x28')]]={'$like':'%'+_0xd2e821['query']['filter']+'%'};return _0x2f1857;}})});}_0x4b0f95=_[_0x3b14('0x3a')]({},_0x4b0f95,_0xd2e821[_0x3b14('0x3d')]);var _0x1aa35d={'where':_0x4b0f95['where']};return db[_0x3b14('0x2c')][_0x3b14('0x1c')](_0x1aa35d)[_0x3b14('0x22')](function(_0xd93429){_0xe30e0b[_0x3b14('0x1c')]=_0xd93429;if(_0xd2e821['query']['includeAll']){_0x4b0f95[_0x3b14('0x3e')]=[{'all':!![]}];}return db[_0x3b14('0x2c')][_0x3b14('0x3f')](_0x4b0f95);})[_0x3b14('0x22')](function(_0x5420dc){_0xe30e0b[_0x3b14('0x40')]=_0x5420dc;return _0xe30e0b;})[_0x3b14('0x22')](respondWithFilteredResult(_0x309a06,_0x4b0f95))['catch'](handleError(_0x309a06,null));};exports['show']=function(_0x2b2803,_0x89a888){var _0x27a5cd={'raw':!![],'where':{'id':_0x2b2803[_0x3b14('0x41')]['id']}},_0x5af427={};_0x5af427[_0x3b14('0x2f')]=_['keys'](db[_0x3b14('0x2c')][_0x3b14('0x2d')]);_0x5af427[_0x3b14('0x30')]=_[_0x3b14('0x42')](_0x2b2803[_0x3b14('0x30')]);_0x5af427['filters']=_['intersection'](_0x5af427[_0x3b14('0x2f')],_0x5af427[_0x3b14('0x30')]);_0x27a5cd[_0x3b14('0x33')]=_[_0x3b14('0x32')](_0x5af427[_0x3b14('0x2f')],qs['fields'](_0x2b2803[_0x3b14('0x30')]['fields']));_0x27a5cd['attributes']=_0x27a5cd[_0x3b14('0x33')]['length']?_0x27a5cd[_0x3b14('0x33')]:_0x5af427['model'];if(_0x2b2803[_0x3b14('0x30')]['includeAll']){_0x27a5cd[_0x3b14('0x3e')]=[{'all':!![]}];}_0x27a5cd=_['merge']({},_0x27a5cd,_0x2b2803[_0x3b14('0x3d')]);return db[_0x3b14('0x2c')][_0x3b14('0x43')](_0x27a5cd)['then'](handleEntityNotFound(_0x89a888,null))['then'](respondWithResult(_0x89a888,null))[_0x3b14('0x44')](handleError(_0x89a888,null));};exports[_0x3b14('0x45')]=function(_0x151432,_0x160a8b){return db[_0x3b14('0x2c')][_0x3b14('0x45')](_0x151432['body'],{})[_0x3b14('0x22')](function(_0x2eb952){var _0x33ca1c=_0x151432[_0x3b14('0x46')][_0x3b14('0x47')]({'plain':!![]});if(!_0x33ca1c)throw new Error(_0x3b14('0x48'));if(_0x33ca1c[_0x3b14('0x49')]===_0x3b14('0x46')){var _0x88a649=_0x2eb952['get']({'plain':!![]});var _0x3a762f=_0x3b14('0x24');return db['UserProfileSection'][_0x3b14('0x43')]({'where':{'name':_0x3a762f,'userProfileId':_0x33ca1c[_0x3b14('0x4a')]},'raw':!![]})[_0x3b14('0x22')](function(_0x41a780){if(_0x41a780&&_0x41a780['autoAssociation']===0x0){return db[_0x3b14('0x4b')][_0x3b14('0x45')]({'name':_0x88a649['name'],'resourceId':_0x88a649['id'],'type':_0x41a780[_0x3b14('0x28')],'sectionId':_0x41a780['id']},{})['then'](function(){return _0x2eb952;});}else{return _0x2eb952;}})['catch'](function(_0xdc2ae4){logger[_0x3b14('0x26')](_0x3b14('0x4c'),_0xdc2ae4);throw _0xdc2ae4;});}return _0x2eb952;})[_0x3b14('0x22')](respondWithResult(_0x160a8b,0xc9))[_0x3b14('0x44')](handleError(_0x160a8b,null));};exports[_0x3b14('0x4d')]=function(_0x34d32b,_0x3b1f3f){if(_0x34d32b[_0x3b14('0x4e')]['id']){delete _0x34d32b['body']['id'];}return db[_0x3b14('0x2c')][_0x3b14('0x43')]({'where':{'id':_0x34d32b[_0x3b14('0x41')]['id']}})['then'](handleEntityNotFound(_0x3b1f3f,null))[_0x3b14('0x22')](saveUpdates(_0x34d32b[_0x3b14('0x4e')],null))[_0x3b14('0x22')](respondWithResult(_0x3b1f3f,null))[_0x3b14('0x44')](handleError(_0x3b1f3f,null));};exports[_0x3b14('0x23')]=function(_0x6353c6,_0x38e8d5){return db[_0x3b14('0x2c')][_0x3b14('0x43')]({'where':{'id':_0x6353c6['params']['id']}})[_0x3b14('0x22')](handleEntityNotFound(_0x38e8d5,null))['then'](removeEntity(_0x38e8d5,null))[_0x3b14('0x44')](handleError(_0x38e8d5,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index ef20778..0fb74bb 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 _0xd76b=['api','moment','bluebird','path','rimraf','exports','define','lodash','../../config/logger'];(function(_0xbf4ddf,_0x66b3cb){var _0x3cb273=function(_0x3cf903){while(--_0x3cf903){_0xbf4ddf['push'](_0xbf4ddf['shift']());}};_0x3cb273(++_0x66b3cb);}(_0xd76b,0x1c9));var _0xbd76=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xd76b[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0xbd76('0x0'));var util=require('util');var logger=require(_0xbd76('0x1'))(_0xbd76('0x2'));var moment=require(_0xbd76('0x3'));var BPromise=require(_0xbd76('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbd76('0x5'));var rimraf=require(_0xbd76('0x6'));var config=require('../../config/environment');var attributes=require('./cmContactHasItem.attributes');module[_0xbd76('0x7')]=function(_0x3d0738,_0x525932){return _0x3d0738[_0xbd76('0x8')]('CmContactHasItem',attributes,{'tableName':'cm_contact_has_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x05f3=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmContactHasItem.attributes','exports','define','CmContactHasItem','cm_contact_has_items','lodash'];(function(_0x3bbb48,_0x30d1cd){var _0x5c0bdb=function(_0x3e5138){while(--_0x3e5138){_0x3bbb48['push'](_0x3bbb48['shift']());}};_0x5c0bdb(++_0x30d1cd);}(_0x05f3,0x16b));var _0x305f=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0x05f3[_0x4bfac3];return _0x15f0f2;};'use strict';var _=require(_0x305f('0x0'));var util=require(_0x305f('0x1'));var logger=require(_0x305f('0x2'))(_0x305f('0x3'));var moment=require(_0x305f('0x4'));var BPromise=require(_0x305f('0x5'));var rp=require(_0x305f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x305f('0x7'));var config=require(_0x305f('0x8'));var attributes=require(_0x305f('0x9'));module[_0x305f('0xa')]=function(_0x440e5a,_0xc82dbd){return _0x440e5a[_0x305f('0xb')](_0x305f('0xc'),attributes,{'tableName':_0x305f('0xd'),'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 3d2a19f..8e7557a 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 _0x436d=['info','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','CmContactHasItem,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x57f701,_0x5c1086){var _0x286201=function(_0x44ac20){while(--_0x44ac20){_0x57f701['push'](_0x57f701['shift']());}};_0x286201(++_0x5c1086);}(_0x436d,0x191));var _0xd436=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x436d[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xd436('0x0'));var util=require(_0xd436('0x1'));var moment=require(_0xd436('0x2'));var BPromise=require(_0xd436('0x3'));var rs=require(_0xd436('0x4'));var fs=require('fs');var Redis=require(_0xd436('0x5'));var db=require(_0xd436('0x6'))['db'];var utils=require(_0xd436('0x7'));var logger=require(_0xd436('0x8'))(_0xd436('0x9'));var config=require('../../config/environment');var jayson=require(_0xd436('0xa'));var client=jayson[_0xd436('0xb')][_0xd436('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x28f88c,_0x108440,_0x5144c6){return new BPromise(function(_0x5f04e0,_0x3fd135){return client[_0xd436('0xd')](_0x28f88c,_0x5144c6)[_0xd436('0xe')](function(_0x1c155e){logger[_0xd436('0xf')]('CmContactHasItem,\x20%s,\x20%s',_0x108440,_0xd436('0x10'));logger[_0xd436('0x11')](_0xd436('0x12'),_0x108440,_0xd436('0x10'),JSON[_0xd436('0x13')](_0x1c155e));if(_0x1c155e[_0xd436('0x14')]){if(_0x1c155e[_0xd436('0x14')][_0xd436('0x15')]===0x1f4){logger['error'](_0xd436('0x16'),_0x108440,_0x1c155e['error']['message']);return _0x3fd135(_0x1c155e[_0xd436('0x14')][_0xd436('0x17')]);}logger['error'](_0xd436('0x16'),_0x108440,_0x1c155e['error'][_0xd436('0x17')]);return _0x5f04e0(_0x1c155e[_0xd436('0x14')][_0xd436('0x17')]);}else{logger[_0xd436('0xf')](_0xd436('0x16'),_0x108440,_0xd436('0x10'));_0x5f04e0(_0x1c155e[_0xd436('0x18')][_0xd436('0x17')]);}})[_0xd436('0x19')](function(_0x56b269){logger[_0xd436('0x14')](_0xd436('0x16'),_0x108440,_0x56b269);_0x3fd135(_0x56b269);});});} \ No newline at end of file +var _0x5f3e=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x32d999,_0x8a4ca9){var _0x280400=function(_0x3e0f28){while(--_0x3e0f28){_0x32d999['push'](_0x32d999['shift']());}};_0x280400(++_0x8a4ca9);}(_0x5f3e,0x117));var _0xe5f3=function(_0x53166a,_0x43b2d3){_0x53166a=_0x53166a-0x0;var _0x2676c5=_0x5f3e[_0x53166a];return _0x2676c5;};'use strict';var _=require(_0xe5f3('0x0'));var util=require(_0xe5f3('0x1'));var moment=require(_0xe5f3('0x2'));var BPromise=require(_0xe5f3('0x3'));var rs=require(_0xe5f3('0x4'));var fs=require('fs');var Redis=require(_0xe5f3('0x5'));var db=require(_0xe5f3('0x6'))['db'];var utils=require(_0xe5f3('0x7'));var logger=require(_0xe5f3('0x8'))(_0xe5f3('0x9'));var config=require(_0xe5f3('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xe5f3('0xb')][_0xe5f3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2e2d62,_0x40f329,_0x42a448){return new BPromise(function(_0x172ac1,_0x27f72e){return client['request'](_0x2e2d62,_0x42a448)[_0xe5f3('0xd')](function(_0x599555){logger[_0xe5f3('0xe')](_0xe5f3('0xf'),_0x40f329,_0xe5f3('0x10'));logger[_0xe5f3('0x11')](_0xe5f3('0x12'),_0x40f329,_0xe5f3('0x10'),JSON[_0xe5f3('0x13')](_0x599555));if(_0x599555[_0xe5f3('0x14')]){if(_0x599555['error'][_0xe5f3('0x15')]===0x1f4){logger[_0xe5f3('0x14')](_0xe5f3('0xf'),_0x40f329,_0x599555[_0xe5f3('0x14')][_0xe5f3('0x16')]);return _0x27f72e(_0x599555[_0xe5f3('0x14')][_0xe5f3('0x16')]);}logger[_0xe5f3('0x14')](_0xe5f3('0xf'),_0x40f329,_0x599555['error'][_0xe5f3('0x16')]);return _0x172ac1(_0x599555[_0xe5f3('0x14')]['message']);}else{logger[_0xe5f3('0xe')](_0xe5f3('0xf'),_0x40f329,_0xe5f3('0x10'));_0x172ac1(_0x599555[_0xe5f3('0x17')][_0xe5f3('0x16')]);}})[_0xe5f3('0x18')](function(_0x1efa3f){logger[_0xe5f3('0x14')](_0xe5f3('0xf'),_0x40f329,_0x1efa3f);_0x27f72e(_0x1efa3f);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 61d0a08..1323dc1 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 _0x317b=['./cmContactHasItem.controller','get','index','/:id','isAuthenticated','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x317b,0x96));var _0xb317=function(_0x562830,_0x16d702){_0x562830=_0x562830-0x0;var _0x193066=_0x317b[_0x562830];return _0x193066;};'use strict';var multer=require(_0xb317('0x0'));var util=require(_0xb317('0x1'));var path=require(_0xb317('0x2'));var timeout=require(_0xb317('0x3'));var express=require(_0xb317('0x4'));var router=express[_0xb317('0x5')]();var fs_extra=require(_0xb317('0x6'));var auth=require(_0xb317('0x7'));var interaction=require(_0xb317('0x8'));var config=require(_0xb317('0x9'));var controller=require(_0xb317('0xa'));router[_0xb317('0xb')]('/',auth['isAuthenticated'](),controller[_0xb317('0xc')]);router[_0xb317('0xb')](_0xb317('0xd'),auth[_0xb317('0xe')](),controller['show']);router['post']('/',auth[_0xb317('0xe')](),controller[_0xb317('0xf')]);router[_0xb317('0x10')]('/:id',auth[_0xb317('0xe')](),controller[_0xb317('0x11')]);router[_0xb317('0x12')]('/:id',auth[_0xb317('0xe')](),controller['destroy']);module[_0xb317('0x13')]=router; \ No newline at end of file +var _0x08e8=['update','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get','isAuthenticated','/:id','show','post','create'];(function(_0x2fa11e,_0x57a5c4){var _0x2b445c=function(_0x1179c4){while(--_0x1179c4){_0x2fa11e['push'](_0x2fa11e['shift']());}};_0x2b445c(++_0x57a5c4);}(_0x08e8,0xc9));var _0x808e=function(_0x193495,_0x5bcfa2){_0x193495=_0x193495-0x0;var _0x42d4fd=_0x08e8[_0x193495];return _0x42d4fd;};'use strict';var multer=require('multer');var util=require(_0x808e('0x0'));var path=require('path');var timeout=require(_0x808e('0x1'));var express=require(_0x808e('0x2'));var router=express[_0x808e('0x3')]();var fs_extra=require(_0x808e('0x4'));var auth=require(_0x808e('0x5'));var interaction=require(_0x808e('0x6'));var config=require(_0x808e('0x7'));var controller=require(_0x808e('0x8'));router[_0x808e('0x9')]('/',auth[_0x808e('0xa')](),controller['index']);router['get'](_0x808e('0xb'),auth['isAuthenticated'](),controller[_0x808e('0xc')]);router[_0x808e('0xd')]('/',auth[_0x808e('0xa')](),controller[_0x808e('0xe')]);router['put']('/:id',auth[_0x808e('0xa')](),controller[_0x808e('0xf')]);router['delete'](_0x808e('0xb'),auth[_0x808e('0xa')](),controller[_0x808e('0x10')]);module[_0x808e('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 a5c8878..51a0e98 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 _0x140b=['STRING','setDataValue','name','long','type','select','parse','values','isArray','stringify','voice','sequelize','lodash','VIRTUAL','getDataValue','alias'];(function(_0x5e2619,_0x2fdc1a){var _0x5c1768=function(_0x28f9c4){while(--_0x28f9c4){_0x5e2619['push'](_0x5e2619['shift']());}};_0x5c1768(++_0x2fdc1a);}(_0x140b,0x1bb));var _0xb140=function(_0x1f49ca,_0x1e68c8){_0x1f49ca=_0x1f49ca-0x0;var _0x599f1d=_0x140b[_0x1f49ca];return _0x599f1d;};'use strict';var Sequelize=require(_0xb140('0x0'));var _=require(_0xb140('0x1'));module['exports']={'name':{'type':Sequelize[_0xb140('0x2')],'get':function(_0x170b6a){return this[_0xb140('0x3')](_0xb140('0x4'));}},'alias':{'type':Sequelize[_0xb140('0x5')],'allowNull':![],'set':function(_0x321e79){this[_0xb140('0x6')](_0xb140('0x4'),_0x321e79?_0x321e79:this[_0xb140('0x3')](_0xb140('0x7')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0xb140('0x8')),'get':function(){if(this[_0xb140('0x3')](_0xb140('0x9'))===_0xb140('0xa')){return JSON[_0xb140('0xb')](this['getDataValue'](_0xb140('0xc')));}else{return this[_0xb140('0x3')](_0xb140('0xc'));}},'set':function(_0x1304bd){if(Array[_0xb140('0xd')](_0x1304bd)){this[_0xb140('0x6')](_0xb140('0xc'),JSON[_0xb140('0xe')](_0x1304bd));}else{this[_0xb140('0x6')](_0xb140('0xc'),_0x1304bd);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0xb140('0xf'))}}; \ No newline at end of file +var _0x63d0=['name','long','type','select','parse','values','isArray','BOOLEAN','ENUM','voice','sequelize','lodash','exports','getDataValue','alias','STRING','setDataValue'];(function(_0x35f2da,_0x1981de){var _0x4d545d=function(_0x50095c){while(--_0x50095c){_0x35f2da['push'](_0x35f2da['shift']());}};_0x4d545d(++_0x1981de);}(_0x63d0,0xd6));var _0x063d=function(_0x298397,_0x524038){_0x298397=_0x298397-0x0;var _0x350b81=_0x63d0[_0x298397];return _0x350b81;};'use strict';var Sequelize=require(_0x063d('0x0'));var _=require(_0x063d('0x1'));module[_0x063d('0x2')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x598955){return this[_0x063d('0x3')](_0x063d('0x4'));}},'alias':{'type':Sequelize[_0x063d('0x5')],'allowNull':![],'set':function(_0x138f19){this[_0x063d('0x6')]('alias',_0x138f19?_0x138f19:this['getDataValue'](_0x063d('0x7')));}},'type':{'type':Sequelize[_0x063d('0x5')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x063d('0x8')),'get':function(){if(this[_0x063d('0x3')](_0x063d('0x9'))===_0x063d('0xa')){return JSON[_0x063d('0xb')](this[_0x063d('0x3')](_0x063d('0xc')));}else{return this['getDataValue'](_0x063d('0xc'));}},'set':function(_0x190c57){if(Array[_0x063d('0xd')](_0x190c57)){this[_0x063d('0x6')](_0x063d('0xc'),JSON['stringify'](_0x190c57));}else{this['setDataValue'](_0x063d('0xc'),_0x190c57);}}},'required':{'type':Sequelize[_0x063d('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x063d('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x063d('0xf')](_0x063d('0x10'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 4d7c9d4..ce6fe2e 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 _0xcfcd=['filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','show','params','length','include','find','catch','body','destroy','create','sequelize','transaction','Sequelize','TEXT','text','INTEGER','switch','BOOLEAN','defaultValue','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','reject','then','error','stack','name','send','index','map','CmCustomField','rawAttributes','fieldName','type','key','query','keys'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xcfcd,0x134));var _0xdcfc=function(_0x1b42f2,_0x5b0c12){_0x1b42f2=_0x1b42f2-0x0;var _0x477f19=_0xcfcd[_0x1b42f2];return _0x477f19;};'use strict';var emlformat=require(_0xdcfc('0x0'));var rimraf=require(_0xdcfc('0x1'));var zipdir=require(_0xdcfc('0x2'));var jsonpatch=require(_0xdcfc('0x3'));var rp=require(_0xdcfc('0x4'));var moment=require(_0xdcfc('0x5'));var BPromise=require(_0xdcfc('0x6'));var Mustache=require('mustache');var util=require(_0xdcfc('0x7'));var path=require(_0xdcfc('0x8'));var sox=require('sox');var csv=require(_0xdcfc('0x9'));var ejs=require(_0xdcfc('0xa'));var fs=require('fs');var fs_extra=require(_0xdcfc('0xb'));var _=require(_0xdcfc('0xc'));var squel=require('squel');var crypto=require(_0xdcfc('0xd'));var jsforce=require(_0xdcfc('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xdcfc('0x9'));var querystring=require(_0xdcfc('0xf'));var Papa=require(_0xdcfc('0x10'));var Redis=require(_0xdcfc('0x11'));var authService=require(_0xdcfc('0x12'));var qs=require(_0xdcfc('0x13'));var as=require(_0xdcfc('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdcfc('0x15'))(_0xdcfc('0x16'));var utils=require(_0xdcfc('0x17'));var config=require(_0xdcfc('0x18'));var licenseUtil=require(_0xdcfc('0x19'));var db=require(_0xdcfc('0x1a'))['db'];function respondWithStatusCode(_0x40d3e6,_0x4042bc){_0x4042bc=_0x4042bc||0xcc;return function(_0x46616a){if(_0x46616a){return _0x40d3e6[_0xdcfc('0x1b')](_0x4042bc);}return _0x40d3e6[_0xdcfc('0x1c')](_0x4042bc)[_0xdcfc('0x1d')]();};}function respondWithResult(_0x5b56b2,_0x10a69e){_0x10a69e=_0x10a69e||0xc8;return function(_0x22ce9e){if(_0x22ce9e){return _0x5b56b2[_0xdcfc('0x1c')](_0x10a69e)[_0xdcfc('0x1e')](_0x22ce9e);}};}function respondWithFilteredResult(_0x56f811,_0x10dbe8){return function(_0x5e7818){if(_0x5e7818){var _0x288d5b=typeof _0x10dbe8['offset']===_0xdcfc('0x1f')&&typeof _0x10dbe8[_0xdcfc('0x20')]==='undefined';var _0x186a6a=_0x5e7818['count'];var _0x46e0e8=_0x288d5b?0x0:_0x10dbe8[_0xdcfc('0x21')];var _0xcdc92c=_0x288d5b?_0x5e7818[_0xdcfc('0x22')]:_0x10dbe8[_0xdcfc('0x21')]+_0x10dbe8[_0xdcfc('0x20')];var _0x1d78df;if(_0xcdc92c>=_0x186a6a){_0xcdc92c=_0x186a6a;_0x1d78df=0xc8;}else{_0x1d78df=0xce;}_0x56f811[_0xdcfc('0x1c')](_0x1d78df);return _0x56f811[_0xdcfc('0x23')](_0xdcfc('0x24'),_0x46e0e8+'-'+_0xcdc92c+'/'+_0x186a6a)[_0xdcfc('0x1e')](_0x5e7818);}return null;};}function patchUpdates(_0x54a701){return function(_0x38ba89){try{jsonpatch['apply'](_0x38ba89,_0x54a701,!![]);}catch(_0x2e56a0){return BPromise[_0xdcfc('0x25')](_0x2e56a0);}return _0x38ba89['save']();};}function saveUpdates(_0x4acdc4,_0x3f63fa){return function(_0x27f6c0){if(_0x27f6c0){return _0x27f6c0['update'](_0x4acdc4)['then'](function(_0x5bf2c6){return _0x5bf2c6;});}return null;};}function removeEntity(_0x50a2e4,_0x43c7eb){return function(_0xb6a745){if(_0xb6a745){return _0xb6a745['destroy']()[_0xdcfc('0x26')](function(){_0x50a2e4[_0xdcfc('0x1c')](0xcc)[_0xdcfc('0x1d')]();});}};}function handleEntityNotFound(_0x5dfe54,_0x1ff92f){return function(_0x5cbf4a){if(!_0x5cbf4a){_0x5dfe54[_0xdcfc('0x1b')](0x194);}return _0x5cbf4a;};}function handleError(_0x22b097,_0xb11ead){_0xb11ead=_0xb11ead||0x1f4;return function(_0x233c32){logger[_0xdcfc('0x27')](_0x233c32[_0xdcfc('0x28')]);if(_0x233c32[_0xdcfc('0x29')]){delete _0x233c32[_0xdcfc('0x29')];}_0x22b097[_0xdcfc('0x1c')](_0xb11ead)[_0xdcfc('0x2a')](_0x233c32);};}exports[_0xdcfc('0x2b')]=function(_0x2df593,_0x5bc0b7){var _0x3ed361={},_0x36d146={},_0x5807a6={'count':0x0,'rows':[]};var _0x40b841=_[_0xdcfc('0x2c')](db[_0xdcfc('0x2d')][_0xdcfc('0x2e')],function(_0xf8a0fe){return{'name':_0xf8a0fe[_0xdcfc('0x2f')],'type':_0xf8a0fe[_0xdcfc('0x30')][_0xdcfc('0x31')]};});_0x36d146['model']=_['differenceBy'](_['map'](_0x40b841,_0xdcfc('0x29')),['name']);_0x36d146[_0xdcfc('0x32')]=_[_0xdcfc('0x33')](_0x2df593[_0xdcfc('0x32')]);_0x36d146[_0xdcfc('0x34')]=_[_0xdcfc('0x35')](_0x36d146[_0xdcfc('0x36')],_0x36d146[_0xdcfc('0x32')]);_0x3ed361[_0xdcfc('0x37')]=_[_0xdcfc('0x35')](_0x36d146[_0xdcfc('0x36')],qs[_0xdcfc('0x38')](_0x2df593['query'][_0xdcfc('0x38')]));_0x3ed361['attributes']=_0x3ed361[_0xdcfc('0x37')]['length']?_0x3ed361[_0xdcfc('0x37')]:_0x36d146['model'];if(!_0x2df593[_0xdcfc('0x32')][_0xdcfc('0x39')]('nolimit')){_0x3ed361[_0xdcfc('0x20')]=qs[_0xdcfc('0x20')](_0x2df593[_0xdcfc('0x32')][_0xdcfc('0x20')]);_0x3ed361[_0xdcfc('0x21')]=qs['offset'](_0x2df593['query'][_0xdcfc('0x21')]);}_0x3ed361[_0xdcfc('0x3a')]=qs[_0xdcfc('0x3b')](_0x2df593['query'][_0xdcfc('0x3b')]);_0x3ed361['where']=qs[_0xdcfc('0x34')](_[_0xdcfc('0x3c')](_0x2df593['query'],_0x36d146[_0xdcfc('0x34')]),_0x40b841);if(_0x2df593['query'][_0xdcfc('0x3d')]){_0x3ed361[_0xdcfc('0x3e')]=_['merge'](_0x3ed361[_0xdcfc('0x3e')],{'$or':_[_0xdcfc('0x2c')](_0x40b841,function(_0x587309){if(_0x587309['type']!==_0xdcfc('0x3f')){var _0x2f133a={};_0x2f133a[_0x587309[_0xdcfc('0x29')]]={'$like':'%'+_0x2df593['query'][_0xdcfc('0x3d')]+'%'};return _0x2f133a;}})});}_0x3ed361=_[_0xdcfc('0x40')]({},_0x3ed361,_0x2df593[_0xdcfc('0x41')]);var _0x3ea13d={'where':_0x3ed361[_0xdcfc('0x3e')]};return db[_0xdcfc('0x2d')][_0xdcfc('0x22')](_0x3ea13d)[_0xdcfc('0x26')](function(_0x41fdeb){_0x5807a6[_0xdcfc('0x22')]=_0x41fdeb;if(_0x2df593[_0xdcfc('0x32')][_0xdcfc('0x42')]){_0x3ed361['include']=[{'all':!![]}];}return db['CmCustomField'][_0xdcfc('0x43')](_0x3ed361);})[_0xdcfc('0x26')](function(_0x431fcc){_0x5807a6['rows']=_0x431fcc;return _0x5807a6;})[_0xdcfc('0x26')](respondWithFilteredResult(_0x5bc0b7,_0x3ed361))['catch'](handleError(_0x5bc0b7,null));};exports[_0xdcfc('0x44')]=function(_0x37485d,_0x446035){var _0x11782c={'raw':!![],'where':{'id':_0x37485d[_0xdcfc('0x45')]['id']}},_0x295200={};_0x295200['model']=_[_0xdcfc('0x33')](db[_0xdcfc('0x2d')][_0xdcfc('0x2e')]);_0x295200[_0xdcfc('0x32')]=_[_0xdcfc('0x33')](_0x37485d[_0xdcfc('0x32')]);_0x295200[_0xdcfc('0x34')]=_[_0xdcfc('0x35')](_0x295200[_0xdcfc('0x36')],_0x295200[_0xdcfc('0x32')]);_0x11782c[_0xdcfc('0x37')]=_[_0xdcfc('0x35')](_0x295200[_0xdcfc('0x36')],qs['fields'](_0x37485d[_0xdcfc('0x32')]['fields']));_0x11782c[_0xdcfc('0x37')]=_0x11782c['attributes'][_0xdcfc('0x46')]?_0x11782c[_0xdcfc('0x37')]:_0x295200[_0xdcfc('0x36')];if(_0x37485d['query']['includeAll']){_0x11782c[_0xdcfc('0x47')]=[{'all':!![]}];}_0x11782c=_[_0xdcfc('0x40')]({},_0x11782c,_0x37485d[_0xdcfc('0x41')]);return db['CmCustomField'][_0xdcfc('0x48')](_0x11782c)[_0xdcfc('0x26')](handleEntityNotFound(_0x446035,null))[_0xdcfc('0x26')](respondWithResult(_0x446035,null))[_0xdcfc('0x49')](handleError(_0x446035,null));};exports['update']=function(_0x3e456c,_0x16b466){if(_0x3e456c[_0xdcfc('0x4a')]['id']){delete _0x3e456c['body']['id'];}return db[_0xdcfc('0x2d')][_0xdcfc('0x48')]({'where':{'id':_0x3e456c[_0xdcfc('0x45')]['id']}})['then'](handleEntityNotFound(_0x16b466,null))[_0xdcfc('0x26')](saveUpdates(_0x3e456c[_0xdcfc('0x4a')],null))[_0xdcfc('0x26')](respondWithResult(_0x16b466,null))[_0xdcfc('0x49')](handleError(_0x16b466,null));};exports[_0xdcfc('0x4b')]=function(_0x5e9234,_0x56fe74){return db[_0xdcfc('0x2d')][_0xdcfc('0x48')]({'where':{'id':_0x5e9234[_0xdcfc('0x45')]['id']}})[_0xdcfc('0x26')](handleEntityNotFound(_0x56fe74,null))['then'](removeEntity(_0x56fe74,null))['catch'](handleError(_0x56fe74,null));};exports[_0xdcfc('0x4c')]=function(_0x450aa7,_0x32a2a8){var _0x50b3ff;return db[_0xdcfc('0x4d')][_0xdcfc('0x4e')](function(_0x51bc9f){return db['CmCustomField']['create'](_0x450aa7['body'],{'transaction':_0x51bc9f})[_0xdcfc('0x26')](function(_0xd5c48){_0x50b3ff=_0xd5c48;var _0x11383d={'type':db[_0xdcfc('0x4f')][_0xdcfc('0x50')],'transaction':_0x51bc9f};switch(_0x450aa7['body']['type']){case _0xdcfc('0x51'):_0x11383d[_0xdcfc('0x30')]=db['Sequelize']['TEXT'];break;case'number':_0x11383d[_0xdcfc('0x30')]=db[_0xdcfc('0x4f')][_0xdcfc('0x52')];break;case _0xdcfc('0x53'):_0x11383d['type']=db['Sequelize'][_0xdcfc('0x54')];_0x11383d[_0xdcfc('0x55')]=![];break;default:}return db[_0xdcfc('0x4d')]['queryInterface'][_0xdcfc('0x56')](_0xdcfc('0x57'),util[_0xdcfc('0x58')](_0xdcfc('0x59'),_0x50b3ff['id']),_0x11383d);})[_0xdcfc('0x26')](function(){return _0x50b3ff;});})[_0xdcfc('0x26')](respondWithResult(_0x32a2a8,0xc9))['catch'](handleError(_0x32a2a8,null));}; \ No newline at end of file +var _0xf9f3=['rawAttributes','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','CmCustomField','includeAll','include','findAll','rows','show','find','catch','body','params','sequelize','create','Sequelize','TEXT','text','number','INTEGER','switch','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map'];(function(_0x4988da,_0x5bf9c1){var _0x3564fd=function(_0x13f768){while(--_0x13f768){_0x4988da['push'](_0x4988da['shift']());}};_0x3564fd(++_0x5bf9c1);}(_0xf9f3,0x1f4));var _0x3f9f=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xf9f3[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0x3f9f('0x0'));var rimraf=require(_0x3f9f('0x1'));var zipdir=require(_0x3f9f('0x2'));var jsonpatch=require(_0x3f9f('0x3'));var rp=require('request-promise');var moment=require(_0x3f9f('0x4'));var BPromise=require(_0x3f9f('0x5'));var Mustache=require(_0x3f9f('0x6'));var util=require('util');var path=require(_0x3f9f('0x7'));var sox=require('sox');var csv=require(_0x3f9f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3f9f('0x9'));var _=require(_0x3f9f('0xa'));var squel=require(_0x3f9f('0xb'));var crypto=require(_0x3f9f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3f9f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3f9f('0xe'));var Papa=require(_0x3f9f('0xf'));var Redis=require('ioredis');var authService=require(_0x3f9f('0x10'));var qs=require(_0x3f9f('0x11'));var as=require(_0x3f9f('0x12'));var hardwareService=require(_0x3f9f('0x13'));var logger=require(_0x3f9f('0x14'))(_0x3f9f('0x15'));var utils=require(_0x3f9f('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x3f9f('0x17'));var db=require(_0x3f9f('0x18'))['db'];function respondWithStatusCode(_0xe941be,_0x3fb3e8){_0x3fb3e8=_0x3fb3e8||0xcc;return function(_0x5e1b8f){if(_0x5e1b8f){return _0xe941be[_0x3f9f('0x19')](_0x3fb3e8);}return _0xe941be[_0x3f9f('0x1a')](_0x3fb3e8)[_0x3f9f('0x1b')]();};}function respondWithResult(_0x1528e0,_0x303415){_0x303415=_0x303415||0xc8;return function(_0x187dff){if(_0x187dff){return _0x1528e0[_0x3f9f('0x1a')](_0x303415)[_0x3f9f('0x1c')](_0x187dff);}};}function respondWithFilteredResult(_0x56f190,_0x206300){return function(_0x61c543){if(_0x61c543){var _0x5bd602=typeof _0x206300[_0x3f9f('0x1d')]===_0x3f9f('0x1e')&&typeof _0x206300[_0x3f9f('0x1f')]==='undefined';var _0xfc6b60=_0x61c543['count'];var _0x15b7c7=_0x5bd602?0x0:_0x206300[_0x3f9f('0x1d')];var _0x4cc0ef=_0x5bd602?_0x61c543[_0x3f9f('0x20')]:_0x206300[_0x3f9f('0x1d')]+_0x206300['limit'];var _0x13a1ff;if(_0x4cc0ef>=_0xfc6b60){_0x4cc0ef=_0xfc6b60;_0x13a1ff=0xc8;}else{_0x13a1ff=0xce;}_0x56f190['status'](_0x13a1ff);return _0x56f190[_0x3f9f('0x21')](_0x3f9f('0x22'),_0x15b7c7+'-'+_0x4cc0ef+'/'+_0xfc6b60)[_0x3f9f('0x1c')](_0x61c543);}return null;};}function patchUpdates(_0x503422){return function(_0x49216d){try{jsonpatch[_0x3f9f('0x23')](_0x49216d,_0x503422,!![]);}catch(_0x9e8f92){return BPromise['reject'](_0x9e8f92);}return _0x49216d[_0x3f9f('0x24')]();};}function saveUpdates(_0x362c36,_0x30331a){return function(_0x3ac1ea){if(_0x3ac1ea){return _0x3ac1ea[_0x3f9f('0x25')](_0x362c36)[_0x3f9f('0x26')](function(_0x177475){return _0x177475;});}return null;};}function removeEntity(_0x3275eb,_0x8e8579){return function(_0x3868dd){if(_0x3868dd){return _0x3868dd[_0x3f9f('0x27')]()[_0x3f9f('0x26')](function(){_0x3275eb[_0x3f9f('0x1a')](0xcc)[_0x3f9f('0x1b')]();});}};}function handleEntityNotFound(_0x2921a6,_0x1aac89){return function(_0x5a1e2f){if(!_0x5a1e2f){_0x2921a6[_0x3f9f('0x19')](0x194);}return _0x5a1e2f;};}function handleError(_0x3659dc,_0x8cb2f4){_0x8cb2f4=_0x8cb2f4||0x1f4;return function(_0x555a68){logger[_0x3f9f('0x28')](_0x555a68[_0x3f9f('0x29')]);if(_0x555a68[_0x3f9f('0x2a')]){delete _0x555a68['name'];}_0x3659dc[_0x3f9f('0x1a')](_0x8cb2f4)[_0x3f9f('0x2b')](_0x555a68);};}exports[_0x3f9f('0x2c')]=function(_0x295f3f,_0x575947){var _0x51e0b5={},_0x1e6146={},_0x272deb={'count':0x0,'rows':[]};var _0x82a332=_[_0x3f9f('0x2d')](db['CmCustomField'][_0x3f9f('0x2e')],function(_0x201240){return{'name':_0x201240['fieldName'],'type':_0x201240[_0x3f9f('0x2f')][_0x3f9f('0x30')]};});_0x1e6146[_0x3f9f('0x31')]=_[_0x3f9f('0x32')](_['map'](_0x82a332,_0x3f9f('0x2a')),['name']);_0x1e6146[_0x3f9f('0x33')]=_[_0x3f9f('0x34')](_0x295f3f[_0x3f9f('0x33')]);_0x1e6146[_0x3f9f('0x35')]=_[_0x3f9f('0x36')](_0x1e6146[_0x3f9f('0x31')],_0x1e6146['query']);_0x51e0b5[_0x3f9f('0x37')]=_[_0x3f9f('0x36')](_0x1e6146['model'],qs[_0x3f9f('0x38')](_0x295f3f['query'][_0x3f9f('0x38')]));_0x51e0b5[_0x3f9f('0x37')]=_0x51e0b5[_0x3f9f('0x37')][_0x3f9f('0x39')]?_0x51e0b5[_0x3f9f('0x37')]:_0x1e6146[_0x3f9f('0x31')];if(!_0x295f3f[_0x3f9f('0x33')][_0x3f9f('0x3a')](_0x3f9f('0x3b'))){_0x51e0b5[_0x3f9f('0x1f')]=qs[_0x3f9f('0x1f')](_0x295f3f[_0x3f9f('0x33')]['limit']);_0x51e0b5[_0x3f9f('0x1d')]=qs[_0x3f9f('0x1d')](_0x295f3f[_0x3f9f('0x33')]['offset']);}_0x51e0b5[_0x3f9f('0x3c')]=qs[_0x3f9f('0x3d')](_0x295f3f[_0x3f9f('0x33')][_0x3f9f('0x3d')]);_0x51e0b5[_0x3f9f('0x3e')]=qs[_0x3f9f('0x35')](_[_0x3f9f('0x3f')](_0x295f3f[_0x3f9f('0x33')],_0x1e6146[_0x3f9f('0x35')]),_0x82a332);if(_0x295f3f['query'][_0x3f9f('0x40')]){_0x51e0b5['where']=_[_0x3f9f('0x41')](_0x51e0b5[_0x3f9f('0x3e')],{'$or':_[_0x3f9f('0x2d')](_0x82a332,function(_0x5ae855){if(_0x5ae855[_0x3f9f('0x2f')]!=='VIRTUAL'){var _0x37ddb4={};_0x37ddb4[_0x5ae855['name']]={'$like':'%'+_0x295f3f[_0x3f9f('0x33')][_0x3f9f('0x40')]+'%'};return _0x37ddb4;}})});}_0x51e0b5=_[_0x3f9f('0x41')]({},_0x51e0b5,_0x295f3f[_0x3f9f('0x42')]);var _0x38b57a={'where':_0x51e0b5[_0x3f9f('0x3e')]};return db[_0x3f9f('0x43')][_0x3f9f('0x20')](_0x38b57a)[_0x3f9f('0x26')](function(_0x3c6fb3){_0x272deb[_0x3f9f('0x20')]=_0x3c6fb3;if(_0x295f3f[_0x3f9f('0x33')][_0x3f9f('0x44')]){_0x51e0b5[_0x3f9f('0x45')]=[{'all':!![]}];}return db['CmCustomField'][_0x3f9f('0x46')](_0x51e0b5);})['then'](function(_0x3f17bf){_0x272deb[_0x3f9f('0x47')]=_0x3f17bf;return _0x272deb;})[_0x3f9f('0x26')](respondWithFilteredResult(_0x575947,_0x51e0b5))['catch'](handleError(_0x575947,null));};exports[_0x3f9f('0x48')]=function(_0x46e7dc,_0x1a288d){var _0x8d7585={'raw':!![],'where':{'id':_0x46e7dc['params']['id']}},_0x454259={};_0x454259[_0x3f9f('0x31')]=_[_0x3f9f('0x34')](db[_0x3f9f('0x43')]['rawAttributes']);_0x454259[_0x3f9f('0x33')]=_['keys'](_0x46e7dc[_0x3f9f('0x33')]);_0x454259[_0x3f9f('0x35')]=_[_0x3f9f('0x36')](_0x454259[_0x3f9f('0x31')],_0x454259[_0x3f9f('0x33')]);_0x8d7585[_0x3f9f('0x37')]=_[_0x3f9f('0x36')](_0x454259[_0x3f9f('0x31')],qs[_0x3f9f('0x38')](_0x46e7dc[_0x3f9f('0x33')][_0x3f9f('0x38')]));_0x8d7585['attributes']=_0x8d7585['attributes'][_0x3f9f('0x39')]?_0x8d7585[_0x3f9f('0x37')]:_0x454259[_0x3f9f('0x31')];if(_0x46e7dc['query'][_0x3f9f('0x44')]){_0x8d7585[_0x3f9f('0x45')]=[{'all':!![]}];}_0x8d7585=_['merge']({},_0x8d7585,_0x46e7dc[_0x3f9f('0x42')]);return db[_0x3f9f('0x43')][_0x3f9f('0x49')](_0x8d7585)['then'](handleEntityNotFound(_0x1a288d,null))['then'](respondWithResult(_0x1a288d,null))[_0x3f9f('0x4a')](handleError(_0x1a288d,null));};exports['update']=function(_0xbf9c83,_0x2f31fb){if(_0xbf9c83[_0x3f9f('0x4b')]['id']){delete _0xbf9c83[_0x3f9f('0x4b')]['id'];}return db['CmCustomField'][_0x3f9f('0x49')]({'where':{'id':_0xbf9c83[_0x3f9f('0x4c')]['id']}})[_0x3f9f('0x26')](handleEntityNotFound(_0x2f31fb,null))[_0x3f9f('0x26')](saveUpdates(_0xbf9c83[_0x3f9f('0x4b')],null))[_0x3f9f('0x26')](respondWithResult(_0x2f31fb,null))['catch'](handleError(_0x2f31fb,null));};exports[_0x3f9f('0x27')]=function(_0x2d6b20,_0x174fd7){return db[_0x3f9f('0x43')][_0x3f9f('0x49')]({'where':{'id':_0x2d6b20['params']['id']}})['then'](handleEntityNotFound(_0x174fd7,null))[_0x3f9f('0x26')](removeEntity(_0x174fd7,null))['catch'](handleError(_0x174fd7,null));};exports['create']=function(_0x3f076f,_0x2ef78f){var _0xb961d8;return db[_0x3f9f('0x4d')]['transaction'](function(_0x269de5){return db['CmCustomField'][_0x3f9f('0x4e')](_0x3f076f['body'],{'transaction':_0x269de5})[_0x3f9f('0x26')](function(_0x2209ab){_0xb961d8=_0x2209ab;var _0x4fe0d0={'type':db[_0x3f9f('0x4f')][_0x3f9f('0x50')],'transaction':_0x269de5};switch(_0x3f076f[_0x3f9f('0x4b')][_0x3f9f('0x2f')]){case _0x3f9f('0x51'):_0x4fe0d0[_0x3f9f('0x2f')]=db[_0x3f9f('0x4f')][_0x3f9f('0x50')];break;case _0x3f9f('0x52'):_0x4fe0d0[_0x3f9f('0x2f')]=db[_0x3f9f('0x4f')][_0x3f9f('0x53')];break;case _0x3f9f('0x54'):_0x4fe0d0[_0x3f9f('0x2f')]=db[_0x3f9f('0x4f')]['BOOLEAN'];_0x4fe0d0[_0x3f9f('0x55')]=![];break;default:}return db['sequelize'][_0x3f9f('0x56')][_0x3f9f('0x57')](_0x3f9f('0x58'),util[_0x3f9f('0x59')](_0x3f9f('0x5a'),_0xb961d8['id']),_0x4fe0d0);})['then'](function(){return _0xb961d8;});})['then'](respondWithResult(_0x2ef78f,0xc9))['catch'](handleError(_0x2ef78f,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index f5d236a..ac8aafa 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 _0x68c1=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','cm_custom_fields','lodash','../../config/logger','api'];(function(_0x26d347,_0x3154d2){var _0x5abd62=function(_0x333a07){while(--_0x333a07){_0x26d347['push'](_0x26d347['shift']());}};_0x5abd62(++_0x3154d2);}(_0x68c1,0x1d6));var _0x168c=function(_0x6243bb,_0x269bd7){_0x6243bb=_0x6243bb-0x0;var _0x16ef17=_0x68c1[_0x6243bb];return _0x16ef17;};'use strict';var _=require(_0x168c('0x0'));var util=require('util');var logger=require(_0x168c('0x1'))(_0x168c('0x2'));var moment=require(_0x168c('0x3'));var BPromise=require(_0x168c('0x4'));var rp=require(_0x168c('0x5'));var fs=require('fs');var path=require(_0x168c('0x6'));var rimraf=require(_0x168c('0x7'));var config=require(_0x168c('0x8'));var attributes=require(_0x168c('0x9'));module['exports']=function(_0x3be881,_0x3a4a66){return _0x3be881['define']('CmCustomField',attributes,{'tableName':_0x168c('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1332=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','CmCustomField','cm_custom_fields','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1332,0x1a3));var _0x2133=function(_0x402259,_0x5985b5){_0x402259=_0x402259-0x0;var _0x959696=_0x1332[_0x402259];return _0x959696;};'use strict';var _=require(_0x2133('0x0'));var util=require(_0x2133('0x1'));var logger=require(_0x2133('0x2'))(_0x2133('0x3'));var moment=require(_0x2133('0x4'));var BPromise=require(_0x2133('0x5'));var rp=require(_0x2133('0x6'));var fs=require('fs');var path=require(_0x2133('0x7'));var rimraf=require('rimraf');var config=require(_0x2133('0x8'));var attributes=require('./cmCustomField.attributes');module[_0x2133('0x9')]=function(_0x41f729,_0x389017){return _0x41f729['define'](_0x2133('0xa'),attributes,{'tableName':_0x2133('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index f75f0b3..044cc3c 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 _0x3054=['http','request','then','CmCustomField,\x20%s,\x20%s','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client'];(function(_0x211f66,_0x6d409f){var _0x324240=function(_0x5b0c0e){while(--_0x5b0c0e){_0x211f66['push'](_0x211f66['shift']());}};_0x324240(++_0x6d409f);}(_0x3054,0xac));var _0x4305=function(_0x33d98b,_0xdb372c){_0x33d98b=_0x33d98b-0x0;var _0x16ecf6=_0x3054[_0x33d98b];return _0x16ecf6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4305('0x0'));var BPromise=require(_0x4305('0x1'));var rs=require(_0x4305('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4305('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4305('0x4'))(_0x4305('0x5'));var config=require('../../config/environment');var jayson=require(_0x4305('0x6'));var client=jayson[_0x4305('0x7')][_0x4305('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3782cf,_0x5ea4be,_0x111844){return new BPromise(function(_0x238206,_0x5400a1){return client[_0x4305('0x9')](_0x3782cf,_0x111844)[_0x4305('0xa')](function(_0x22a9c6){logger['info'](_0x4305('0xb'),_0x5ea4be,_0x4305('0xc'));logger['debug'](_0x4305('0xd'),_0x5ea4be,'request\x20sent',JSON[_0x4305('0xe')](_0x22a9c6));if(_0x22a9c6['error']){if(_0x22a9c6[_0x4305('0xf')][_0x4305('0x10')]===0x1f4){logger['error'](_0x4305('0xb'),_0x5ea4be,_0x22a9c6['error'][_0x4305('0x11')]);return _0x5400a1(_0x22a9c6['error'][_0x4305('0x11')]);}logger[_0x4305('0xf')](_0x4305('0xb'),_0x5ea4be,_0x22a9c6[_0x4305('0xf')]['message']);return _0x238206(_0x22a9c6['error']['message']);}else{logger['info'](_0x4305('0xb'),_0x5ea4be,_0x4305('0xc'));_0x238206(_0x22a9c6[_0x4305('0x12')][_0x4305('0x11')]);}})[_0x4305('0x13')](function(_0x4c00d6){logger['error'](_0x4305('0xb'),_0x5ea4be,_0x4c00d6);_0x5400a1(_0x4c00d6);});});} \ No newline at end of file +var _0x4f1f=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util'];(function(_0x12d9cf,_0xbe11f4){var _0x56e9fe=function(_0x576abb){while(--_0x576abb){_0x12d9cf['push'](_0x12d9cf['shift']());}};_0x56e9fe(++_0xbe11f4);}(_0x4f1f,0x1e3));var _0xf4f1=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x4f1f[_0x2d7f0e];return _0x110b07;};'use strict';var _=require('lodash');var util=require(_0xf4f1('0x0'));var moment=require('moment');var BPromise=require(_0xf4f1('0x1'));var rs=require(_0xf4f1('0x2'));var fs=require('fs');var Redis=require(_0xf4f1('0x3'));var db=require(_0xf4f1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf4f1('0x5'))(_0xf4f1('0x6'));var config=require('../../config/environment');var jayson=require(_0xf4f1('0x7'));var client=jayson['client'][_0xf4f1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5c4773,_0x50eb69,_0x5a9d0c){return new BPromise(function(_0x5e0e66,_0x11f90c){return client[_0xf4f1('0x9')](_0x5c4773,_0x5a9d0c)[_0xf4f1('0xa')](function(_0x1b1fff){logger[_0xf4f1('0xb')](_0xf4f1('0xc'),_0x50eb69,_0xf4f1('0xd'));logger[_0xf4f1('0xe')](_0xf4f1('0xf'),_0x50eb69,_0xf4f1('0xd'),JSON[_0xf4f1('0x10')](_0x1b1fff));if(_0x1b1fff['error']){if(_0x1b1fff[_0xf4f1('0x11')][_0xf4f1('0x12')]===0x1f4){logger[_0xf4f1('0x11')](_0xf4f1('0xc'),_0x50eb69,_0x1b1fff[_0xf4f1('0x11')]['message']);return _0x11f90c(_0x1b1fff['error'][_0xf4f1('0x13')]);}logger[_0xf4f1('0x11')](_0xf4f1('0xc'),_0x50eb69,_0x1b1fff[_0xf4f1('0x11')]['message']);return _0x5e0e66(_0x1b1fff[_0xf4f1('0x11')][_0xf4f1('0x13')]);}else{logger[_0xf4f1('0xb')](_0xf4f1('0xc'),_0x50eb69,_0xf4f1('0xd'));_0x5e0e66(_0x1b1fff[_0xf4f1('0x14')]['message']);}})[_0xf4f1('0x15')](function(_0x51f0d0){logger[_0xf4f1('0x11')](_0xf4f1('0xc'),_0x50eb69,_0x51f0d0);_0x11f90c(_0x51f0d0);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 73d410a..4f01a03 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 _0xcbef=['delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','isAuthenticated','index','get','/:id','show','post','create','put','update'];(function(_0x4fcecc,_0x9d68b2){var _0x36e629=function(_0x3ebe4c){while(--_0x3ebe4c){_0x4fcecc['push'](_0x4fcecc['shift']());}};_0x36e629(++_0x9d68b2);}(_0xcbef,0x11a));var _0xfcbe=function(_0x588cf2,_0x2e250a){_0x588cf2=_0x588cf2-0x0;var _0x437057=_0xcbef[_0x588cf2];return _0x437057;};'use strict';var multer=require('multer');var util=require(_0xfcbe('0x0'));var path=require(_0xfcbe('0x1'));var timeout=require('connect-timeout');var express=require(_0xfcbe('0x2'));var router=express[_0xfcbe('0x3')]();var fs_extra=require(_0xfcbe('0x4'));var auth=require(_0xfcbe('0x5'));var interaction=require(_0xfcbe('0x6'));var config=require(_0xfcbe('0x7'));var controller=require(_0xfcbe('0x8'));router['get']('/',auth[_0xfcbe('0x9')](),controller[_0xfcbe('0xa')]);router[_0xfcbe('0xb')](_0xfcbe('0xc'),auth[_0xfcbe('0x9')](),controller[_0xfcbe('0xd')]);router[_0xfcbe('0xe')]('/',auth[_0xfcbe('0x9')](),controller[_0xfcbe('0xf')]);router[_0xfcbe('0x10')]('/:id',auth[_0xfcbe('0x9')](),controller[_0xfcbe('0x11')]);router[_0xfcbe('0x12')]('/:id',auth[_0xfcbe('0x9')](),controller[_0xfcbe('0x13')]);module['exports']=router; \ No newline at end of file +var _0x323e=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','index','/:id','isAuthenticated','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x450df7,_0x5e5fde){var _0x4cfd2e=function(_0x2dee1c){while(--_0x2dee1c){_0x450df7['push'](_0x450df7['shift']());}};_0x4cfd2e(++_0x5e5fde);}(_0x323e,0x188));var _0xe323=function(_0x10e0fd,_0x425fbc){_0x10e0fd=_0x10e0fd-0x0;var _0x2ae7b1=_0x323e[_0x10e0fd];return _0x2ae7b1;};'use strict';var multer=require(_0xe323('0x0'));var util=require(_0xe323('0x1'));var path=require(_0xe323('0x2'));var timeout=require(_0xe323('0x3'));var express=require(_0xe323('0x4'));var router=express[_0xe323('0x5')]();var fs_extra=require(_0xe323('0x6'));var auth=require(_0xe323('0x7'));var interaction=require(_0xe323('0x8'));var config=require(_0xe323('0x9'));var controller=require(_0xe323('0xa'));router[_0xe323('0xb')]('/',auth['isAuthenticated'](),controller[_0xe323('0xc')]);router['get'](_0xe323('0xd'),auth[_0xe323('0xe')](),controller['show']);router[_0xe323('0xf')]('/',auth[_0xe323('0xe')](),controller[_0xe323('0x10')]);router[_0xe323('0x11')](_0xe323('0xd'),auth['isAuthenticated'](),controller[_0xe323('0x12')]);router[_0xe323('0x13')](_0xe323('0xd'),auth[_0xe323('0xe')](),controller[_0xe323('0x14')]);module[_0xe323('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 025743a..744094b 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 _0xc7d7=['YYYY-MM-DD\x20HH:mm:ss','INTEGER','STRING','contactListQueue','moment','sequelize','exports','BOOLEAN','DATE','format'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xc7d7,0x16c));var _0x7c7d=function(_0x281012,_0x59f528){_0x281012=_0x281012-0x0;var _0x2aab9a=_0xc7d7[_0x281012];return _0x2aab9a;};'use strict';var moment=require(_0x7c7d('0x0'));var Sequelize=require(_0x7c7d('0x1'));module[_0x7c7d('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0x7c7d('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x7c7d('0x4')],'defaultValue':moment()[_0x7c7d('0x5')](_0x7c7d('0x6'))},'countbusyretry':{'type':Sequelize[_0x7c7d('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x7c7d('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x7c7d('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x7c7d('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x7c7d('0x8')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x7c7d('0x4')]},'priority':{'type':Sequelize[_0x7c7d('0x7')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x7c7d('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x7c7d('0x7')],'unique':_0x7c7d('0x9')},'ListId':{'type':Sequelize[_0x7c7d('0x7')],'unique':_0x7c7d('0x9')},'UserId':{'type':Sequelize[_0x7c7d('0x7')]},'VoiceQueueId':{'type':Sequelize[_0x7c7d('0x7')],'unique':_0x7c7d('0x9')},'CampaignId':{'type':Sequelize[_0x7c7d('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0x7c7d('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x7c7d('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x7c7d('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x7c7d('0x7')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x7c7d('0x7')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x7c7d('0x8')]},'recallmeNotifiedDate':{'type':Sequelize[_0x7c7d('0x4')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x35d9=['YYYY-MM-DD\x20HH:mm:ss','INTEGER','contactListQueue','sequelize','exports','STRING','BOOLEAN','DATE','format'];(function(_0x4a17a9,_0x3f964e){var _0x6911e3=function(_0x45c692){while(--_0x45c692){_0x4a17a9['push'](_0x4a17a9['shift']());}};_0x6911e3(++_0x3f964e);}(_0x35d9,0x111));var _0x935d=function(_0x54a7e9,_0x2349eb){_0x54a7e9=_0x54a7e9-0x0;var _0xcef1f6=_0x35d9[_0x54a7e9];return _0xcef1f6;};'use strict';var moment=require('moment');var Sequelize=require(_0x935d('0x0'));module[_0x935d('0x1')]={'phone':{'type':Sequelize[_0x935d('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x935d('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x935d('0x4')],'defaultValue':moment()[_0x935d('0x5')](_0x935d('0x6'))},'countbusyretry':{'type':Sequelize[_0x935d('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x935d('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x935d('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x935d('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x935d('0x4')]},'priority':{'type':Sequelize[_0x935d('0x7')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x935d('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x935d('0x7')],'unique':_0x935d('0x8')},'ListId':{'type':Sequelize[_0x935d('0x7')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x935d('0x7')]},'VoiceQueueId':{'type':Sequelize[_0x935d('0x7')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0x935d('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0x935d('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x935d('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x935d('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x935d('0x7')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x935d('0x7')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize[_0x935d('0x4')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 347f81a..23d7ea1 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 _0xcb99=['getPreviewRecall','recallme','Company','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','push','utcOffset','getTimezone','timezones','moment','../../components/parsers/qs','../../config/environment','../../mysqldb','status','offset','undefined','limit','count','json','then','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$notBetween','$in','$notIn','$like','$iLike','$overlap','$contains','$contained','attributes','length','nolimit','sort','where','pick','filter','merge','options','includeAll','CmHopper','findAll','rows','catch','show','params','fields','include','find','create','update','body','describe','VoiceQueueId','VoiceQueue','Campaign','CampaignId','omit','dataValues','createdAt','statedesc','deleted','campaign','membername','UserId','user','format','YYYY-MM-DD\x20HH:mm:ss','queue','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','destroy','end','CmContact','getVoiceQueues','outbound','preview','dialPreviewAutoRecallMe','sequelize','transaction','value','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','COALESCE(CmHopper.UserId,\x200)\x20ASC','findOne','scheduledat','phone','LOCK','UPDATE','Contact','CmCompany','CmList','List','Queue'];(function(_0x2574dc,_0x5241c9){var _0x238405=function(_0xf02570){while(--_0xf02570){_0x2574dc['push'](_0x2574dc['shift']());}};_0x238405(++_0x5241c9);}(_0xcb99,0x8b));var _0x9cb9=function(_0x46f4bb,_0x7dc8a9){_0x46f4bb=_0x46f4bb-0x0;var _0x29f2af=_0xcb99[_0x46f4bb];return _0x29f2af;};'use strict';var moment=require(_0x9cb9('0x0'));var _=require('lodash');var qs=require(_0x9cb9('0x1'));var logger=require('../../config/logger')('api');var shared=require(_0x9cb9('0x2'));var db=require(_0x9cb9('0x3'))['db'];function respondWithResult(_0x124c48,_0x51f2ee){_0x51f2ee=_0x51f2ee||0xc8;return function(_0x167735){if(_0x167735){return _0x124c48[_0x9cb9('0x4')](_0x51f2ee)['json'](_0x167735);}};}function respondWithFilteredResult(_0x214b72,_0x509cfc){return function(_0x2ed26a){if(_0x2ed26a){var _0xa84493=typeof _0x509cfc[_0x9cb9('0x5')]===_0x9cb9('0x6')&&typeof _0x509cfc[_0x9cb9('0x7')]===_0x9cb9('0x6');var _0x106f17=_0x2ed26a[_0x9cb9('0x8')];var _0x48d99a=_0xa84493?0x0:_0x509cfc['offset'];var _0xe6d275=_0xa84493?_0x2ed26a[_0x9cb9('0x8')]:_0x509cfc[_0x9cb9('0x5')]+_0x509cfc['limit'];var _0x3be02c;if(_0xe6d275>=_0x106f17){_0xe6d275=_0x106f17;_0x3be02c=0xc8;}else{_0x3be02c=0xce;}_0x214b72[_0x9cb9('0x4')](_0x3be02c);return _0x214b72['set']('Content-Range',_0x48d99a+'-'+_0xe6d275+'/'+_0x106f17)[_0x9cb9('0x9')](_0x2ed26a);}return null;};}function saveUpdates(_0x2e687e,_0x3382c8){return function(_0x1bcb05){if(_0x1bcb05){return _0x1bcb05['update'](_0x2e687e)[_0x9cb9('0xa')](function(_0x37dc98){return _0x37dc98;});}return null;};}function handleEntityNotFound(_0x3ec500,_0x32352d){return function(_0x18fa1f){if(!_0x18fa1f){_0x3ec500[_0x9cb9('0xb')](0x194);}return _0x18fa1f;};}function handleError(_0xc0bf6,_0x2132be){_0x2132be=_0x2132be||0x1f4;return function(_0x3975a5){logger[_0x9cb9('0xc')](_0x3975a5[_0x9cb9('0xd')]);if(_0x3975a5[_0x9cb9('0xe')]){delete _0x3975a5[_0x9cb9('0xe')];}_0xc0bf6[_0x9cb9('0x4')](_0x2132be)[_0x9cb9('0xf')](_0x3975a5);};}exports[_0x9cb9('0x10')]=function(_0x41e598,_0x5a6fba){var _0x4e89cf={},_0x59fcae={},_0x1a23d3={'count':0x0,'rows':[]};var _0x50169f=_['map'](db['CmHopper'][_0x9cb9('0x11')],function(_0x5b2aa3){return{'name':_0x5b2aa3[_0x9cb9('0x12')],'type':_0x5b2aa3[_0x9cb9('0x13')][_0x9cb9('0x14')]};});_0x59fcae[_0x9cb9('0x15')]=_[_0x9cb9('0x16')](_0x50169f,_0x9cb9('0xe'));_0x59fcae[_0x9cb9('0x17')]=_[_0x9cb9('0x18')](_0x41e598[_0x9cb9('0x17')]);_0x59fcae[_0x9cb9('0x19')]=_[_0x9cb9('0x1a')](_0x59fcae[_0x9cb9('0x15')],_0x59fcae[_0x9cb9('0x17')]);_0x59fcae[_0x9cb9('0x19')]=_['concat'](_0x59fcae['filters'],[_0x9cb9('0x1b'),_0x9cb9('0x1c'),_0x9cb9('0x1d'),_0x9cb9('0x1e'),_0x9cb9('0x1f'),_0x9cb9('0x20'),_0x9cb9('0x21'),_0x9cb9('0x22'),_0x9cb9('0x23'),'$between',_0x9cb9('0x24'),_0x9cb9('0x25'),_0x9cb9('0x26'),_0x9cb9('0x27'),'$notLike',_0x9cb9('0x28'),'$notILike',_0x9cb9('0x27'),_0x9cb9('0x29'),_0x9cb9('0x2a'),_0x9cb9('0x2b'),'$any']);_0x4e89cf[_0x9cb9('0x2c')]=_[_0x9cb9('0x1a')](_0x59fcae[_0x9cb9('0x15')],qs['fields'](_0x41e598[_0x9cb9('0x17')]['fields']));_0x4e89cf[_0x9cb9('0x2c')]=_0x4e89cf[_0x9cb9('0x2c')][_0x9cb9('0x2d')]?_0x4e89cf[_0x9cb9('0x2c')]:_0x59fcae[_0x9cb9('0x15')];if(!_0x41e598[_0x9cb9('0x17')]['hasOwnProperty'](_0x9cb9('0x2e'))){_0x4e89cf[_0x9cb9('0x7')]=qs[_0x9cb9('0x7')](_0x41e598['query']['limit']);_0x4e89cf[_0x9cb9('0x5')]=qs[_0x9cb9('0x5')](_0x41e598[_0x9cb9('0x17')]['offset']);}_0x4e89cf['order']=qs[_0x9cb9('0x2f')](_0x41e598[_0x9cb9('0x17')]['sort']);_0x4e89cf[_0x9cb9('0x30')]=qs[_0x9cb9('0x19')](_[_0x9cb9('0x31')](_0x41e598[_0x9cb9('0x17')],_0x59fcae[_0x9cb9('0x19')]),_0x50169f);if(_0x41e598['query'][_0x9cb9('0x32')]){_0x4e89cf[_0x9cb9('0x30')]=_['merge'](_0x4e89cf[_0x9cb9('0x30')],{'$or':_['map'](_0x50169f,function(_0x1f72b2){if(_0x1f72b2[_0x9cb9('0x13')]!=='VIRTUAL'){var _0x5668c4={};_0x5668c4[_0x1f72b2[_0x9cb9('0xe')]]={'$like':'%'+_0x41e598[_0x9cb9('0x17')][_0x9cb9('0x32')]+'%'};return _0x5668c4;}})});}_0x4e89cf=_[_0x9cb9('0x33')]({},_0x4e89cf,_0x41e598[_0x9cb9('0x34')]);var _0x2dd463={'where':_0x4e89cf[_0x9cb9('0x30')]};return db['CmHopper'][_0x9cb9('0x8')](_0x2dd463)[_0x9cb9('0xa')](function(_0x4496a4){_0x1a23d3[_0x9cb9('0x8')]=_0x4496a4;if(_0x41e598[_0x9cb9('0x17')][_0x9cb9('0x35')]){_0x4e89cf['include']=[{'all':!![]}];}return db[_0x9cb9('0x36')][_0x9cb9('0x37')](_0x4e89cf);})[_0x9cb9('0xa')](function(_0x31f8d7){_0x1a23d3[_0x9cb9('0x38')]=_0x31f8d7;return _0x1a23d3;})[_0x9cb9('0xa')](respondWithFilteredResult(_0x5a6fba,_0x4e89cf))[_0x9cb9('0x39')](handleError(_0x5a6fba,null));};exports[_0x9cb9('0x3a')]=function(_0x481377,_0x597db6){var _0x448113={'raw':!![],'where':{'id':_0x481377[_0x9cb9('0x3b')]['id']}},_0x5c0811={};_0x5c0811['model']=_[_0x9cb9('0x18')](db[_0x9cb9('0x36')][_0x9cb9('0x11')]);_0x5c0811[_0x9cb9('0x17')]=_['keys'](_0x481377[_0x9cb9('0x17')]);_0x5c0811['filters']=_[_0x9cb9('0x1a')](_0x5c0811[_0x9cb9('0x15')],_0x5c0811[_0x9cb9('0x17')]);_0x448113[_0x9cb9('0x2c')]=_[_0x9cb9('0x1a')](_0x5c0811['model'],qs[_0x9cb9('0x3c')](_0x481377[_0x9cb9('0x17')][_0x9cb9('0x3c')]));_0x448113[_0x9cb9('0x2c')]=_0x448113[_0x9cb9('0x2c')][_0x9cb9('0x2d')]?_0x448113[_0x9cb9('0x2c')]:_0x5c0811[_0x9cb9('0x15')];if(_0x481377[_0x9cb9('0x17')]['includeAll']){_0x448113[_0x9cb9('0x3d')]=[{'all':!![]}];}_0x448113=_[_0x9cb9('0x33')]({},_0x448113,_0x481377[_0x9cb9('0x34')]);return db[_0x9cb9('0x36')][_0x9cb9('0x3e')](_0x448113)['then'](handleEntityNotFound(_0x597db6,null))[_0x9cb9('0xa')](respondWithResult(_0x597db6,null))[_0x9cb9('0x39')](handleError(_0x597db6,null));};exports[_0x9cb9('0x3f')]=function(_0x52c295,_0x2813ce){return db[_0x9cb9('0x36')][_0x9cb9('0x3f')](_0x52c295['body'],{})[_0x9cb9('0xa')](respondWithResult(_0x2813ce,0xc9))[_0x9cb9('0x39')](handleError(_0x2813ce,null));};exports[_0x9cb9('0x40')]=function(_0x45bbdd,_0x2920fb){if(_0x45bbdd[_0x9cb9('0x41')]['id']){delete _0x45bbdd['body']['id'];}return db[_0x9cb9('0x36')][_0x9cb9('0x3e')]({'where':{'id':_0x45bbdd[_0x9cb9('0x3b')]['id']}})[_0x9cb9('0xa')](handleEntityNotFound(_0x2920fb,null))[_0x9cb9('0xa')](saveUpdates(_0x45bbdd[_0x9cb9('0x41')],null))[_0x9cb9('0xa')](respondWithResult(_0x2920fb,null))[_0x9cb9('0x39')](handleError(_0x2920fb,null));};exports[_0x9cb9('0x42')]=function(_0x28efec,_0x11e990){return db[_0x9cb9('0x36')][_0x9cb9('0x42')]()['then'](respondWithResult(_0x11e990,null))[_0x9cb9('0x39')](handleError(_0x11e990,null));};exports['destroy']=function(_0x40ae9b,_0x23fece){var _0x401f1e;var _0x5a7691=_0x40ae9b[_0x9cb9('0x3b')]['id'];return db[_0x9cb9('0x36')][_0x9cb9('0x3e')]({'where':{'id':_0x40ae9b[_0x9cb9('0x3b')]['id']}})['then'](handleEntityNotFound(_0x23fece,null))['then'](function(_0x57475e){if(_0x57475e){return _0x57475e['destroy']()['then'](function(_0x527e4a){return _0x527e4a;});}})[_0x9cb9('0xa')](function(_0x4490ec){_0x401f1e=_0x4490ec;if(_0x4490ec){if(_0x4490ec[_0x9cb9('0x43')]||_0x4490ec['CampaignId']){return db[_0x4490ec[_0x9cb9('0x43')]?_0x9cb9('0x44'):_0x9cb9('0x45')][_0x9cb9('0x3e')]({'where':{'id':_0x4490ec[_0x9cb9('0x43')]?_0x4490ec[_0x9cb9('0x43')]:_0x4490ec[_0x9cb9('0x46')]},'attributes':['id',_0x9cb9('0xe')],'raw':!![]});}}})['then'](function(_0x5b8ffa){var _0x58df82={};if(_0x5b8ffa){_[_0x9cb9('0x33')](_0x58df82,_[_0x9cb9('0x47')](_0x401f1e[_0x9cb9('0x48')],[_0x9cb9('0x49'),'updatedAt','id']));_0x58df82['state']=0x15;_0x58df82[_0x9cb9('0x4a')]=_0x9cb9('0x4b');_0x58df82[_0x9cb9('0x4c')]=_0x5b8ffa['name'];_0x58df82[_0x9cb9('0x4d')]=_0x40ae9b['user'][_0x9cb9('0xe')];_0x58df82[_0x9cb9('0x4e')]=_0x40ae9b[_0x9cb9('0x4f')]['id'];_0x58df82[_0x9cb9('0x4b')]=!![];_0x58df82['deletedat']=moment()[_0x9cb9('0x50')](_0x9cb9('0x51'));_0x58df82['calleridnum']=_0x401f1e['phone'];_0x58df82['campaigntype']=_0x401f1e[_0x9cb9('0x43')]?_0x9cb9('0x52'):'ivr';return db['CmContact'][_0x9cb9('0x3e')]({'where':{'id':_0x58df82[_0x9cb9('0x53')]},'attributes':[_0x9cb9('0x54'),_0x9cb9('0x55')]})[_0x9cb9('0xa')](function(_0x4e030a){if(!_[_0x9cb9('0x56')](_0x23fece)&&!_['isNil'](_0x4e030a['firstName'])){_0x58df82[_0x9cb9('0x57')]=_0x4e030a[_0x9cb9('0x54')];if(!_[_0x9cb9('0x56')](_0x4e030a['lastName'])){_0x58df82[_0x9cb9('0x57')]+='\x20'+_0x4e030a[_0x9cb9('0x55')];}}})[_0x9cb9('0x58')](function(){return db[_0x9cb9('0x59')][_0x9cb9('0x3f')](_0x58df82);});}})[_0x9cb9('0xa')](function(_0x21f73a){return db[_0x9cb9('0x5a')][_0x9cb9('0x5b')]({'where':{'CmHopperId':_0x5a7691}});})[_0x9cb9('0xa')](function(){return _0x23fece[_0x9cb9('0x4')](0xcc)[_0x9cb9('0x5c')]();})[_0x9cb9('0x39')](handleError(_0x23fece,null));};exports['getPreview']=function(_0x4dfc6e,_0x3e19ca){var _0x41ff82=[];return db[_0x9cb9('0x5d')]['describe']()[_0x9cb9('0xa')](function(_0xfd180d){_0x41ff82=_['keys'](_0xfd180d);return _0x4dfc6e['user'][_0x9cb9('0x5e')]({'where':{'type':_0x9cb9('0x5f'),'dialActive':!![],'dialMethod':_0x9cb9('0x60')},'attributes':['id','dialOrderByScheduledAt',_0x9cb9('0x61')],'raw':!![]});})['then'](function(_0x4473c6){if(_0x4473c6&&_0x4473c6[_0x9cb9('0x2d')]){return db[_0x9cb9('0x62')][_0x9cb9('0x63')](function(_0x3b3897){var _0x2d1b65={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x9cb9('0x16')](_0x4473c6,'id')},'$or':[{'UserId':null},{'UserId':_0x4dfc6e[_0x9cb9('0x4f')]['id']}]};var _0x38acc6={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x4473c6)[_0x9cb9('0x32')](['dialPreviewAutoRecallMe',0x0])[_0x9cb9('0x16')]('id')[_0x9cb9('0x64')]()},'$or':[{'UserId':null},{'UserId':_0x4dfc6e[_0x9cb9('0x4f')]['id']}]};var _0x58b9b3={'$or':[_0x2d1b65,_0x38acc6]};var _0x4f11b6=[];if(_0x4dfc6e['body']['direction']&&_0x4dfc6e[_0x9cb9('0x41')]['direction']===_0x9cb9('0x65')){if(!_[_0x9cb9('0x66')](_0x4dfc6e[_0x9cb9('0x41')][_0x9cb9('0x67')])){_0x58b9b3['id']={'$in':_0x4dfc6e[_0x9cb9('0x41')][_0x9cb9('0x67')]};}_0x4f11b6=[[_0x9cb9('0x68'),_0x9cb9('0x69')],[_0x9cb9('0x6a'),_0x4473c6[0x0]['dialOrderByScheduledAt']==='ASC'?_0x9cb9('0x6b'):_0x9cb9('0x69')],db['sequelize']['literal'](_0x9cb9('0x6c')),['id',_0x9cb9('0x6b')]];}else{if(!_['isEmpty'](_0x4dfc6e['body']['hopperIds'])){_0x58b9b3['id']={'$notIn':_0x4dfc6e['body'][_0x9cb9('0x67')]};}_0x4f11b6=[['priority',_0x9cb9('0x6b')],[_0x9cb9('0x6a'),_0x4473c6[0x0]['dialOrderByScheduledAt']],db[_0x9cb9('0x62')]['literal']('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id','ASC']];}return db[_0x9cb9('0x36')][_0x9cb9('0x6d')]({'attributes':['id',_0x9cb9('0x6e'),_0x9cb9('0x6f'),'recallme'],'where':_0x58b9b3,'order':_0x4f11b6,'transaction':_0x3b3897,'lock':_0x3b3897[_0x9cb9('0x70')][_0x9cb9('0x71')],'include':[{'model':db['CmContact'],'as':_0x9cb9('0x72'),'attributes':_0x41ff82,'include':[{'model':db[_0x9cb9('0x73')],'as':'Company','attributes':['id',_0x9cb9('0xe')]}]},{'model':db[_0x9cb9('0x74')],'as':_0x9cb9('0x75'),'attributes':['id',_0x9cb9('0xe')]},{'model':db[_0x9cb9('0x44')],'as':_0x9cb9('0x76'),'attributes':['id','name','dialActive']}]})[_0x9cb9('0xa')](function(_0x2c2ff1){if(_0x2c2ff1){return _0x2c2ff1[_0x9cb9('0x40')]({'UserId':_0x4dfc6e[_0x9cb9('0x4f')]['id']},{'transaction':_0x3b3897});}});});}})[_0x9cb9('0xa')](handleEntityNotFound(_0x3e19ca,null))[_0x9cb9('0xa')](respondWithResult(_0x3e19ca,null))[_0x9cb9('0x39')](handleError(_0x3e19ca,null));};exports[_0x9cb9('0x77')]=function(_0x24f574,_0x4eb9c6,_0x23a727){var _0x1ef68b=[];var _0x3ceb83=_0x24f574['params']['id'];var _0x7d8ce8=_0x24f574[_0x9cb9('0x4f')]['id'];return db[_0x9cb9('0x5d')][_0x9cb9('0x42')]()['then'](function(_0x222393){_0x1ef68b=_[_0x9cb9('0x18')](_0x222393);return db[_0x9cb9('0x62')][_0x9cb9('0x63')](function(_0x30342f){const _0x203156={'id':_0x3ceb83};return db[_0x9cb9('0x36')][_0x9cb9('0x6d')]({'attributes':['id',_0x9cb9('0x6e'),_0x9cb9('0x78')],'where':_0x203156,'transaction':_0x30342f,'lock':_0x30342f[_0x9cb9('0x70')]['UPDATE'],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_0x1ef68b,'include':[{'model':db[_0x9cb9('0x73')],'as':_0x9cb9('0x79'),'attributes':['id','name']}]},{'model':db[_0x9cb9('0x74')],'as':_0x9cb9('0x75'),'attributes':['id','name']},{'model':db[_0x9cb9('0x44')],'as':'Queue','attributes':['id',_0x9cb9('0xe'),'dialActive']}]})[_0x9cb9('0xa')](function(_0xd49604){if(_0xd49604){return _0xd49604[_0x9cb9('0x40')]({'UserId':_0x7d8ce8},{'transaction':_0x30342f});}});});})[_0x9cb9('0xa')](handleEntityNotFound(_0x4eb9c6,null))[_0x9cb9('0xa')](respondWithResult(_0x4eb9c6,null))['catch'](handleError(_0x4eb9c6,null));};exports[_0x9cb9('0x7a')]=function(_0x303dfc,_0x3a60d3){return _0x303dfc['user']['getVoiceQueues']({'where':{'type':_0x9cb9('0x5f'),'dialActive':!![],'dialMethod':_0x9cb9('0x60')},'attributes':['id'],'raw':!![]})[_0x9cb9('0xa')](function(_0x288782){if(_0x288782&&_0x288782['length']){return db[_0x9cb9('0x36')][_0x9cb9('0x8')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x9cb9('0x51'))},'VoiceQueueId':{'$in':_[_0x9cb9('0x16')](_0x288782,'id')},'$or':[{'UserId':null},{'UserId':_0x303dfc[_0x9cb9('0x4f')]['id']}]}});}return 0x0;})[_0x9cb9('0xa')](function(_0x54043e){if(!_[_0x9cb9('0x56')](_0x54043e)&&_[_0x9cb9('0x7b')](_0x54043e)){return _0x3a60d3[_0x9cb9('0x4')](0xc8)[_0x9cb9('0x9')]({'contacts':_0x54043e});}else{logger[_0x9cb9('0xc')](_0x9cb9('0x7c'),_0x9cb9('0x7a'),0x194,'entity\x20not\x20found');_0x3a60d3[_0x9cb9('0xb')](0x194);}})['catch'](handleError(_0x3a60d3,null));};exports['getTimezones']=function(_0x54d5ed,_0x5341d1){var _0x32130f=shared['timezones'];var _0x4c2ca1=[];_[_0x9cb9('0x16')](_0x32130f,function(_0x465945){_0x4c2ca1[_0x9cb9('0x7d')]({'id':_0x465945[_0x9cb9('0xe')],'name':_0x465945[_0x9cb9('0xe')],'utcOffset':_0x465945[_0x9cb9('0x7e')]});});return _0x5341d1[_0x9cb9('0x4')](0xc8)[_0x9cb9('0x9')]({'tz':_0x4c2ca1});};exports[_0x9cb9('0x7f')]=function(_0x206abd,_0x5971eb){var _0xe48750=shared[_0x9cb9('0x80')];var _0x13b776={};if(!_[_0x9cb9('0x56')](_0xe48750[_0x206abd[_0x9cb9('0x41')]['id']]))_0x13b776=_0xe48750[_0x206abd['body']['id']];return _0x5971eb['status'](0xc8)[_0x9cb9('0x9')](_0x13b776);}; \ No newline at end of file +var _0xd2bb=['scheduledAt','DESC','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','isEmpty','findOne','recallme','LOCK','UPDATE','Contact','CmCompany','CmList','List','dialActive','getPreviewRecall','scheduledat','Queue','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','timezones','push','utcOffset','lodash','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','update','then','sendStatus','error','stack','name','send','index','map','CmHopper','fieldName','type','key','model','filters','query','$and','$lt','$lte','$ne','$eq','$not','$between','$notIn','$like','$iLike','$notILike','$overlap','$contained','attributes','intersection','fields','length','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','merge','find','create','body','params','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','omit','dataValues','createdAt','updatedAt','campaign','user','UserId','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','transaction','direction','prev','hopperIds','priority','ASC'];(function(_0xc91b5c,_0x3468c4){var _0x43352c=function(_0x596e46){while(--_0x596e46){_0xc91b5c['push'](_0xc91b5c['shift']());}};_0x43352c(++_0x3468c4);}(_0xd2bb,0x9a));var _0xbd2b=function(_0x21ee11,_0x4b8932){_0x21ee11=_0x21ee11-0x0;var _0x184a3b=_0xd2bb[_0x21ee11];return _0x184a3b;};'use strict';var moment=require('moment');var _=require(_0xbd2b('0x0'));var qs=require('../../components/parsers/qs');var logger=require(_0xbd2b('0x1'))(_0xbd2b('0x2'));var shared=require(_0xbd2b('0x3'));var db=require(_0xbd2b('0x4'))['db'];function respondWithResult(_0x306817,_0x3c67c1){_0x3c67c1=_0x3c67c1||0xc8;return function(_0x5c41c7){if(_0x5c41c7){return _0x306817[_0xbd2b('0x5')](_0x3c67c1)[_0xbd2b('0x6')](_0x5c41c7);}};}function respondWithFilteredResult(_0xdcd8bd,_0x2f64a8){return function(_0x296d68){if(_0x296d68){var _0x3751df=typeof _0x2f64a8[_0xbd2b('0x7')]===_0xbd2b('0x8')&&typeof _0x2f64a8[_0xbd2b('0x9')]===_0xbd2b('0x8');var _0x4fd4f2=_0x296d68[_0xbd2b('0xa')];var _0x517862=_0x3751df?0x0:_0x2f64a8[_0xbd2b('0x7')];var _0x3bcbea=_0x3751df?_0x296d68['count']:_0x2f64a8[_0xbd2b('0x7')]+_0x2f64a8[_0xbd2b('0x9')];var _0x2a43a4;if(_0x3bcbea>=_0x4fd4f2){_0x3bcbea=_0x4fd4f2;_0x2a43a4=0xc8;}else{_0x2a43a4=0xce;}_0xdcd8bd[_0xbd2b('0x5')](_0x2a43a4);return _0xdcd8bd[_0xbd2b('0xb')](_0xbd2b('0xc'),_0x517862+'-'+_0x3bcbea+'/'+_0x4fd4f2)[_0xbd2b('0x6')](_0x296d68);}return null;};}function saveUpdates(_0x275b60,_0x5722a4){return function(_0x35c2c0){if(_0x35c2c0){return _0x35c2c0[_0xbd2b('0xd')](_0x275b60)[_0xbd2b('0xe')](function(_0x36916c){return _0x36916c;});}return null;};}function handleEntityNotFound(_0x29f3d1,_0x5f246b){return function(_0x1ccc21){if(!_0x1ccc21){_0x29f3d1[_0xbd2b('0xf')](0x194);}return _0x1ccc21;};}function handleError(_0x1bc648,_0x1018dc){_0x1018dc=_0x1018dc||0x1f4;return function(_0x1815b3){logger[_0xbd2b('0x10')](_0x1815b3[_0xbd2b('0x11')]);if(_0x1815b3[_0xbd2b('0x12')]){delete _0x1815b3[_0xbd2b('0x12')];}_0x1bc648['status'](_0x1018dc)[_0xbd2b('0x13')](_0x1815b3);};}exports[_0xbd2b('0x14')]=function(_0x21224b,_0x19ee5c){var _0x3ea01c={},_0x112b5e={},_0x13af97={'count':0x0,'rows':[]};var _0xe4eaa6=_[_0xbd2b('0x15')](db[_0xbd2b('0x16')]['rawAttributes'],function(_0x21a4e2){return{'name':_0x21a4e2[_0xbd2b('0x17')],'type':_0x21a4e2[_0xbd2b('0x18')][_0xbd2b('0x19')]};});_0x112b5e[_0xbd2b('0x1a')]=_[_0xbd2b('0x15')](_0xe4eaa6,_0xbd2b('0x12'));_0x112b5e['query']=_['keys'](_0x21224b['query']);_0x112b5e[_0xbd2b('0x1b')]=_['intersection'](_0x112b5e[_0xbd2b('0x1a')],_0x112b5e[_0xbd2b('0x1c')]);_0x112b5e['filters']=_['concat'](_0x112b5e[_0xbd2b('0x1b')],[_0xbd2b('0x1d'),'$or','$gt','$gte',_0xbd2b('0x1e'),_0xbd2b('0x1f'),_0xbd2b('0x20'),_0xbd2b('0x21'),_0xbd2b('0x22'),_0xbd2b('0x23'),'$notBetween','$in',_0xbd2b('0x24'),_0xbd2b('0x25'),'$notLike',_0xbd2b('0x26'),_0xbd2b('0x27'),_0xbd2b('0x25'),_0xbd2b('0x28'),'$contains',_0xbd2b('0x29'),'$any']);_0x3ea01c[_0xbd2b('0x2a')]=_[_0xbd2b('0x2b')](_0x112b5e[_0xbd2b('0x1a')],qs[_0xbd2b('0x2c')](_0x21224b[_0xbd2b('0x1c')][_0xbd2b('0x2c')]));_0x3ea01c[_0xbd2b('0x2a')]=_0x3ea01c['attributes'][_0xbd2b('0x2d')]?_0x3ea01c['attributes']:_0x112b5e[_0xbd2b('0x1a')];if(!_0x21224b[_0xbd2b('0x1c')]['hasOwnProperty']('nolimit')){_0x3ea01c[_0xbd2b('0x9')]=qs[_0xbd2b('0x9')](_0x21224b[_0xbd2b('0x1c')][_0xbd2b('0x9')]);_0x3ea01c[_0xbd2b('0x7')]=qs['offset'](_0x21224b[_0xbd2b('0x1c')][_0xbd2b('0x7')]);}_0x3ea01c[_0xbd2b('0x2e')]=qs[_0xbd2b('0x2f')](_0x21224b[_0xbd2b('0x1c')][_0xbd2b('0x2f')]);_0x3ea01c[_0xbd2b('0x30')]=qs['filters'](_[_0xbd2b('0x31')](_0x21224b['query'],_0x112b5e['filters']),_0xe4eaa6);if(_0x21224b[_0xbd2b('0x1c')][_0xbd2b('0x32')]){_0x3ea01c[_0xbd2b('0x30')]=_['merge'](_0x3ea01c['where'],{'$or':_[_0xbd2b('0x15')](_0xe4eaa6,function(_0x389d28){if(_0x389d28[_0xbd2b('0x18')]!==_0xbd2b('0x33')){var _0xdd1383={};_0xdd1383[_0x389d28['name']]={'$like':'%'+_0x21224b[_0xbd2b('0x1c')][_0xbd2b('0x32')]+'%'};return _0xdd1383;}})});}_0x3ea01c=_['merge']({},_0x3ea01c,_0x21224b[_0xbd2b('0x34')]);var _0x5e0d58={'where':_0x3ea01c[_0xbd2b('0x30')]};return db[_0xbd2b('0x16')][_0xbd2b('0xa')](_0x5e0d58)[_0xbd2b('0xe')](function(_0x5054b6){_0x13af97[_0xbd2b('0xa')]=_0x5054b6;if(_0x21224b[_0xbd2b('0x1c')][_0xbd2b('0x35')]){_0x3ea01c[_0xbd2b('0x36')]=[{'all':!![]}];}return db['CmHopper'][_0xbd2b('0x37')](_0x3ea01c);})['then'](function(_0x3ea722){_0x13af97[_0xbd2b('0x38')]=_0x3ea722;return _0x13af97;})[_0xbd2b('0xe')](respondWithFilteredResult(_0x19ee5c,_0x3ea01c))[_0xbd2b('0x39')](handleError(_0x19ee5c,null));};exports[_0xbd2b('0x3a')]=function(_0x534741,_0x252f0b){var _0x5050de={'raw':!![],'where':{'id':_0x534741['params']['id']}},_0xef8bb3={};_0xef8bb3[_0xbd2b('0x1a')]=_[_0xbd2b('0x3b')](db[_0xbd2b('0x16')][_0xbd2b('0x3c')]);_0xef8bb3[_0xbd2b('0x1c')]=_[_0xbd2b('0x3b')](_0x534741['query']);_0xef8bb3[_0xbd2b('0x1b')]=_[_0xbd2b('0x2b')](_0xef8bb3[_0xbd2b('0x1a')],_0xef8bb3['query']);_0x5050de['attributes']=_['intersection'](_0xef8bb3[_0xbd2b('0x1a')],qs[_0xbd2b('0x2c')](_0x534741[_0xbd2b('0x1c')][_0xbd2b('0x2c')]));_0x5050de[_0xbd2b('0x2a')]=_0x5050de['attributes'][_0xbd2b('0x2d')]?_0x5050de['attributes']:_0xef8bb3[_0xbd2b('0x1a')];if(_0x534741['query'][_0xbd2b('0x35')]){_0x5050de[_0xbd2b('0x36')]=[{'all':!![]}];}_0x5050de=_[_0xbd2b('0x3d')]({},_0x5050de,_0x534741['options']);return db['CmHopper'][_0xbd2b('0x3e')](_0x5050de)['then'](handleEntityNotFound(_0x252f0b,null))[_0xbd2b('0xe')](respondWithResult(_0x252f0b,null))[_0xbd2b('0x39')](handleError(_0x252f0b,null));};exports[_0xbd2b('0x3f')]=function(_0x37b408,_0x31d752){return db[_0xbd2b('0x16')][_0xbd2b('0x3f')](_0x37b408[_0xbd2b('0x40')],{})['then'](respondWithResult(_0x31d752,0xc9))[_0xbd2b('0x39')](handleError(_0x31d752,null));};exports['update']=function(_0x545fad,_0x59ea00){if(_0x545fad[_0xbd2b('0x40')]['id']){delete _0x545fad['body']['id'];}return db[_0xbd2b('0x16')][_0xbd2b('0x3e')]({'where':{'id':_0x545fad[_0xbd2b('0x41')]['id']}})['then'](handleEntityNotFound(_0x59ea00,null))[_0xbd2b('0xe')](saveUpdates(_0x545fad['body'],null))[_0xbd2b('0xe')](respondWithResult(_0x59ea00,null))[_0xbd2b('0x39')](handleError(_0x59ea00,null));};exports[_0xbd2b('0x42')]=function(_0x2dae90,_0x3194af){return db[_0xbd2b('0x16')]['describe']()[_0xbd2b('0xe')](respondWithResult(_0x3194af,null))[_0xbd2b('0x39')](handleError(_0x3194af,null));};exports[_0xbd2b('0x43')]=function(_0x18361d,_0x3cf8be){var _0x9a66d;var _0x64eb80=_0x18361d['params']['id'];return db[_0xbd2b('0x16')]['find']({'where':{'id':_0x18361d[_0xbd2b('0x41')]['id']}})[_0xbd2b('0xe')](handleEntityNotFound(_0x3cf8be,null))[_0xbd2b('0xe')](function(_0xc094ae){if(_0xc094ae){return _0xc094ae[_0xbd2b('0x43')]()[_0xbd2b('0xe')](function(_0x304d11){return _0x304d11;});}})[_0xbd2b('0xe')](function(_0x3a343b){_0x9a66d=_0x3a343b;if(_0x3a343b){if(_0x3a343b[_0xbd2b('0x44')]||_0x3a343b[_0xbd2b('0x45')]){return db[_0x3a343b['VoiceQueueId']?_0xbd2b('0x46'):'Campaign'][_0xbd2b('0x3e')]({'where':{'id':_0x3a343b['VoiceQueueId']?_0x3a343b[_0xbd2b('0x44')]:_0x3a343b[_0xbd2b('0x45')]},'attributes':['id',_0xbd2b('0x12')],'raw':!![]});}}})[_0xbd2b('0xe')](function(_0x50d373){var _0x3854c6={};if(_0x50d373){_[_0xbd2b('0x3d')](_0x3854c6,_[_0xbd2b('0x47')](_0x9a66d[_0xbd2b('0x48')],[_0xbd2b('0x49'),_0xbd2b('0x4a'),'id']));_0x3854c6['state']=0x15;_0x3854c6['statedesc']='deleted';_0x3854c6[_0xbd2b('0x4b')]=_0x50d373[_0xbd2b('0x12')];_0x3854c6['membername']=_0x18361d[_0xbd2b('0x4c')][_0xbd2b('0x12')];_0x3854c6[_0xbd2b('0x4d')]=_0x18361d[_0xbd2b('0x4c')]['id'];_0x3854c6['deleted']=!![];_0x3854c6['deletedat']=moment()[_0xbd2b('0x4e')](_0xbd2b('0x4f'));_0x3854c6[_0xbd2b('0x50')]=_0x9a66d[_0xbd2b('0x51')];_0x3854c6[_0xbd2b('0x52')]=_0x9a66d['VoiceQueueId']?_0xbd2b('0x53'):'ivr';return db[_0xbd2b('0x54')][_0xbd2b('0x3e')]({'where':{'id':_0x3854c6[_0xbd2b('0x55')]},'attributes':[_0xbd2b('0x56'),_0xbd2b('0x57')]})[_0xbd2b('0xe')](function(_0xc49804){if(!_[_0xbd2b('0x58')](_0x3cf8be)&&!_[_0xbd2b('0x58')](_0xc49804[_0xbd2b('0x56')])){_0x3854c6[_0xbd2b('0x59')]=_0xc49804[_0xbd2b('0x56')];if(!_[_0xbd2b('0x58')](_0xc49804[_0xbd2b('0x57')])){_0x3854c6[_0xbd2b('0x59')]+='\x20'+_0xc49804['lastName'];}}})[_0xbd2b('0x5a')](function(){return db[_0xbd2b('0x5b')]['create'](_0x3854c6);});}})['then'](function(_0x2d54bd){return db[_0xbd2b('0x5c')]['destroy']({'where':{'CmHopperId':_0x64eb80}});})[_0xbd2b('0xe')](function(){return _0x3cf8be[_0xbd2b('0x5')](0xcc)[_0xbd2b('0x5d')]();})['catch'](handleError(_0x3cf8be,null));};exports[_0xbd2b('0x5e')]=function(_0x45e8c5,_0x139e86){var _0x47c700=[];return db[_0xbd2b('0x54')][_0xbd2b('0x42')]()[_0xbd2b('0xe')](function(_0x26ac87){_0x47c700=_['keys'](_0x26ac87);return _0x45e8c5['user'][_0xbd2b('0x5f')]({'where':{'type':_0xbd2b('0x60'),'dialActive':!![],'dialMethod':_0xbd2b('0x61')},'attributes':['id',_0xbd2b('0x62'),_0xbd2b('0x63')],'raw':!![]});})[_0xbd2b('0xe')](function(_0x1b475f){if(_0x1b475f&&_0x1b475f[_0xbd2b('0x2d')]){return db['sequelize'][_0xbd2b('0x64')](function(_0xbaf13e){var _0x5aed9b={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xbd2b('0x4e')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xbd2b('0x15')](_0x1b475f,'id')},'$or':[{'UserId':null},{'UserId':_0x45e8c5[_0xbd2b('0x4c')]['id']}]};var _0xed811f={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x1b475f)['filter'](['dialPreviewAutoRecallMe',0x0])[_0xbd2b('0x15')]('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x45e8c5[_0xbd2b('0x4c')]['id']}]};var _0x1e832f={'$or':[_0x5aed9b,_0xed811f]};var _0x3bc96a=[];if(_0x45e8c5['body'][_0xbd2b('0x65')]&&_0x45e8c5[_0xbd2b('0x40')][_0xbd2b('0x65')]===_0xbd2b('0x66')){if(!_['isEmpty'](_0x45e8c5[_0xbd2b('0x40')][_0xbd2b('0x67')])){_0x1e832f['id']={'$in':_0x45e8c5[_0xbd2b('0x40')][_0xbd2b('0x67')]};}_0x3bc96a=[[_0xbd2b('0x68'),_0xbd2b('0x69')],[_0xbd2b('0x6a'),_0x1b475f[0x0]['dialOrderByScheduledAt']===_0xbd2b('0x69')?_0xbd2b('0x6b'):_0xbd2b('0x69')],db[_0xbd2b('0x6c')][_0xbd2b('0x6d')](_0xbd2b('0x6e')),['id',_0xbd2b('0x6b')]];}else{if(!_[_0xbd2b('0x6f')](_0x45e8c5['body'][_0xbd2b('0x67')])){_0x1e832f['id']={'$notIn':_0x45e8c5[_0xbd2b('0x40')][_0xbd2b('0x67')]};}_0x3bc96a=[['priority',_0xbd2b('0x6b')],[_0xbd2b('0x6a'),_0x1b475f[0x0][_0xbd2b('0x62')]],db[_0xbd2b('0x6c')]['literal']('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0xbd2b('0x69')]];}return db['CmHopper'][_0xbd2b('0x70')]({'attributes':['id','scheduledat','phone',_0xbd2b('0x71')],'where':_0x1e832f,'order':_0x3bc96a,'transaction':_0xbaf13e,'lock':_0xbaf13e[_0xbd2b('0x72')][_0xbd2b('0x73')],'include':[{'model':db[_0xbd2b('0x54')],'as':_0xbd2b('0x74'),'attributes':_0x47c700,'include':[{'model':db[_0xbd2b('0x75')],'as':'Company','attributes':['id','name']}]},{'model':db[_0xbd2b('0x76')],'as':_0xbd2b('0x77'),'attributes':['id',_0xbd2b('0x12')]},{'model':db[_0xbd2b('0x46')],'as':'Queue','attributes':['id',_0xbd2b('0x12'),_0xbd2b('0x78')]}]})[_0xbd2b('0xe')](function(_0x1abd04){if(_0x1abd04){return _0x1abd04[_0xbd2b('0xd')]({'UserId':_0x45e8c5[_0xbd2b('0x4c')]['id']},{'transaction':_0xbaf13e});}});});}})[_0xbd2b('0xe')](handleEntityNotFound(_0x139e86,null))[_0xbd2b('0xe')](respondWithResult(_0x139e86,null))[_0xbd2b('0x39')](handleError(_0x139e86,null));};exports[_0xbd2b('0x79')]=function(_0xf893c9,_0x38a514,_0x3cd300){var _0x322a14=[];var _0x4f1b0c=_0xf893c9['params']['id'];var _0x51cf38=_0xf893c9[_0xbd2b('0x4c')]['id'];return db[_0xbd2b('0x54')]['describe']()[_0xbd2b('0xe')](function(_0x188291){_0x322a14=_[_0xbd2b('0x3b')](_0x188291);return db[_0xbd2b('0x6c')][_0xbd2b('0x64')](function(_0x49023e){const _0x280b1c={'id':_0x4f1b0c};return db[_0xbd2b('0x16')][_0xbd2b('0x70')]({'attributes':['id',_0xbd2b('0x7a'),_0xbd2b('0x71')],'where':_0x280b1c,'transaction':_0x49023e,'lock':_0x49023e[_0xbd2b('0x72')][_0xbd2b('0x73')],'include':[{'model':db[_0xbd2b('0x54')],'as':'Contact','attributes':_0x322a14,'include':[{'model':db['CmCompany'],'as':'Company','attributes':['id',_0xbd2b('0x12')]}]},{'model':db[_0xbd2b('0x76')],'as':_0xbd2b('0x77'),'attributes':['id','name']},{'model':db[_0xbd2b('0x46')],'as':_0xbd2b('0x7b'),'attributes':['id','name','dialActive']}]})[_0xbd2b('0xe')](function(_0x342c65){if(_0x342c65){return _0x342c65[_0xbd2b('0xd')]({'UserId':_0x51cf38},{'transaction':_0x49023e});}});});})[_0xbd2b('0xe')](handleEntityNotFound(_0x38a514,null))[_0xbd2b('0xe')](respondWithResult(_0x38a514,null))['catch'](handleError(_0x38a514,null));};exports['getOpenContacts']=function(_0x41527b,_0x40c5fb){return _0x41527b['user'][_0xbd2b('0x5f')]({'where':{'type':_0xbd2b('0x60'),'dialActive':!![],'dialMethod':_0xbd2b('0x61')},'attributes':['id'],'raw':!![]})[_0xbd2b('0xe')](function(_0x8b15fb){if(_0x8b15fb&&_0x8b15fb[_0xbd2b('0x2d')]){return db[_0xbd2b('0x16')][_0xbd2b('0xa')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xbd2b('0x4e')](_0xbd2b('0x4f'))},'VoiceQueueId':{'$in':_[_0xbd2b('0x15')](_0x8b15fb,'id')},'$or':[{'UserId':null},{'UserId':_0x41527b[_0xbd2b('0x4c')]['id']}]}});}return 0x0;})['then'](function(_0x198f9b){if(!_[_0xbd2b('0x58')](_0x198f9b)&&_['isNumber'](_0x198f9b)){return _0x40c5fb[_0xbd2b('0x5')](0xc8)[_0xbd2b('0x6')]({'contacts':_0x198f9b});}else{logger['error'](_0xbd2b('0x7c'),_0xbd2b('0x7d'),0x194,_0xbd2b('0x7e'));_0x40c5fb[_0xbd2b('0xf')](0x194);}})[_0xbd2b('0x39')](handleError(_0x40c5fb,null));};exports['getTimezones']=function(_0x2bd92b,_0x57a458){var _0x5ca66a=shared[_0xbd2b('0x7f')];var _0x45f0b3=[];_[_0xbd2b('0x15')](_0x5ca66a,function(_0x2172db){_0x45f0b3[_0xbd2b('0x80')]({'id':_0x2172db['name'],'name':_0x2172db[_0xbd2b('0x12')],'utcOffset':_0x2172db[_0xbd2b('0x81')]});});return _0x57a458[_0xbd2b('0x5')](0xc8)[_0xbd2b('0x6')]({'tz':_0x45f0b3});};exports['getTimezone']=function(_0x40f0d3,_0x107811){var _0x59567e=shared[_0xbd2b('0x7f')];var _0x288658={};if(!_[_0xbd2b('0x58')](_0x59567e[_0x40f0d3[_0xbd2b('0x40')]['id']]))_0x288658=_0x59567e[_0x40f0d3[_0xbd2b('0x40')]['id']];return _0x107811['status'](0xc8)[_0xbd2b('0x6')](_0x288658);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index f9b9762..9e1b6b4 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 _0xc4aa=['define','CmHopper','cm_hopper','phone','priority','lodash','util','../../config/logger','api','moment','bluebird','../../config/environment','./cmHopper.attributes','exports'];(function(_0x2fe132,_0x31bb8f){var _0x83b089=function(_0x40fe8b){while(--_0x40fe8b){_0x2fe132['push'](_0x2fe132['shift']());}};_0x83b089(++_0x31bb8f);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xc4aa[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'scheduledat','fields':['scheduledat']},{'name':_0xac4a('0xc'),'fields':[_0xac4a('0xc')]},{'name':_0xac4a('0xd'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb4c7=['request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','define','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x1590a0,_0x1ec4db){_0x1590a0=_0x1590a0-0x0;var _0x276db1=_0xb4c7[_0x1590a0];return _0x276db1;};'use strict';var _=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var logger=require(_0x7b4c('0x2'))(_0x7b4c('0x3'));var moment=require(_0x7b4c('0x4'));var BPromise=require('bluebird');var rp=require(_0x7b4c('0x5'));var fs=require('fs');var path=require(_0x7b4c('0x6'));var rimraf=require(_0x7b4c('0x7'));var config=require(_0x7b4c('0x8'));var attributes=require(_0x7b4c('0x9'));module['exports']=function(_0x1b0f57,_0x10e197){return _0x1b0f57[_0x7b4c('0xa')]('CmHopper',attributes,{'tableName':_0x7b4c('0xb'),'paranoid':![],'indexes':[{'name':_0x7b4c('0xc'),'fields':['scheduledat']},{'name':_0x7b4c('0xd'),'fields':[_0x7b4c('0xd')]},{'name':_0x7b4c('0xe'),'fields':[_0x7b4c('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 07c1775..cc291df 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 _0x23fb=['create','body','UpdateCmHopper','active','DestroyCmHopper','CmContact','sequelize','findAll','order','LOCK','UPDATE','Contact','keys','Agent','name','voicePause','length','UserId','push','includes','update','all','GetContactDialer','dataValues','ContactId','MoveContactManagedDialer','transaction','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','destroy','COUNT','literal','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','GetContactRecallMe','GetCmHopperPreview','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','User','lodash','util','moment','../../mysqldb','../../config/logger','rpc','GetCmHopper','options','raw','where','attributes','limit','include','map','model','then','info','stringify','catch','error','message','ShowCmHopper','CmHopper','debug','CreateCmHopper'];(function(_0x53216c,_0x505ce0){var _0x42f18a=function(_0x437470){while(--_0x437470){_0x53216c['push'](_0x53216c['shift']());}};_0x42f18a(++_0x505ce0);}(_0x23fb,0x11b));var _0xb23f=function(_0x322c2f,_0x254da0){_0x322c2f=_0x322c2f-0x0;var _0x33994f=_0x23fb[_0x322c2f];return _0x33994f;};'use strict';var _=require(_0xb23f('0x0'));var util=require(_0xb23f('0x1'));var moment=require(_0xb23f('0x2'));var BPromise=require('bluebird');var db=require(_0xb23f('0x3'))['db'];var logger=require(_0xb23f('0x4'))(_0xb23f('0x5'));exports[_0xb23f('0x6')]=function(_0x4e7971){var _0x918e50=this;return new Promise(function(_0x11aa4f,_0x3384d7){return db['CmHopper']['findAll']({'raw':_0x4e7971[_0xb23f('0x7')]?_0x4e7971[_0xb23f('0x7')][_0xb23f('0x8')]===undefined?!![]:![]:!![],'where':_0x4e7971[_0xb23f('0x7')]?_0x4e7971['options'][_0xb23f('0x9')]||null:null,'attributes':_0x4e7971['options']?_0x4e7971[_0xb23f('0x7')][_0xb23f('0xa')]||null:null,'limit':_0x4e7971[_0xb23f('0x7')]?_0x4e7971['options'][_0xb23f('0xb')]||null:null,'include':_0x4e7971[_0xb23f('0x7')]?_0x4e7971[_0xb23f('0x7')][_0xb23f('0xc')]?_[_0xb23f('0xd')](_0x4e7971[_0xb23f('0x7')][_0xb23f('0xc')],function(_0xd4f2f3){return{'model':db[_0xd4f2f3['model']],'as':_0xd4f2f3['as'],'attributes':_0xd4f2f3[_0xb23f('0xa')],'include':_0xd4f2f3[_0xb23f('0xc')]?_[_0xb23f('0xd')](_0xd4f2f3[_0xb23f('0xc')],function(_0x31d95f){return{'model':db[_0x31d95f[_0xb23f('0xe')]],'as':_0x31d95f['as'],'attributes':_0x31d95f[_0xb23f('0xa')],'include':_0x31d95f['include']?_[_0xb23f('0xd')](_0x31d95f[_0xb23f('0xc')],function(_0x4d45f8){return{'model':db[_0x4d45f8[_0xb23f('0xe')]],'as':_0x4d45f8['as'],'attributes':_0x4d45f8[_0xb23f('0xa')]};}):[]};}):[]};}):[]:[]})[_0xb23f('0xf')](function(_0x2382f3){logger[_0xb23f('0x10')]('GetCmHopper',_0x4e7971);logger['debug'](_0xb23f('0x6'),_0x4e7971,JSON[_0xb23f('0x11')](_0x2382f3));_0x11aa4f(_0x2382f3);})[_0xb23f('0x12')](function(_0xfcb20a){logger[_0xb23f('0x13')](_0xb23f('0x6'),_0xfcb20a[_0xb23f('0x14')],_0x4e7971);_0x3384d7(_0x918e50[_0xb23f('0x13')](0x1f4,_0xfcb20a[_0xb23f('0x14')]));});});};exports[_0xb23f('0x15')]=function(_0x275a36){var _0x5e837d=this;return new Promise(function(_0x446478,_0x3333d9){return db[_0xb23f('0x16')]['find']({'raw':_0x275a36[_0xb23f('0x7')]?_0x275a36[_0xb23f('0x7')]['raw']===undefined?!![]:![]:!![],'where':_0x275a36[_0xb23f('0x7')]?_0x275a36['options'][_0xb23f('0x9')]||null:null,'attributes':_0x275a36[_0xb23f('0x7')]?_0x275a36[_0xb23f('0x7')][_0xb23f('0xa')]||null:null,'include':_0x275a36['options']?_0x275a36[_0xb23f('0x7')][_0xb23f('0xc')]?_['map'](_0x275a36[_0xb23f('0x7')][_0xb23f('0xc')],function(_0x4f9d52){return{'model':db[_0x4f9d52[_0xb23f('0xe')]],'as':_0x4f9d52['as'],'attributes':_0x4f9d52[_0xb23f('0xa')],'include':_0x4f9d52[_0xb23f('0xc')]?_[_0xb23f('0xd')](_0x4f9d52['include'],function(_0x2e35b4){return{'model':db[_0x2e35b4[_0xb23f('0xe')]],'as':_0x2e35b4['as'],'attributes':_0x2e35b4[_0xb23f('0xa')],'include':_0x2e35b4[_0xb23f('0xc')]?_[_0xb23f('0xd')](_0x2e35b4[_0xb23f('0xc')],function(_0x4c66f8){return{'model':db[_0x4c66f8[_0xb23f('0xe')]],'as':_0x4c66f8['as'],'attributes':_0x4c66f8['attributes']};}):[]};}):[]};}):[]:[]})[_0xb23f('0xf')](function(_0x3eff6f){logger['info'](_0xb23f('0x15'),_0x275a36);logger[_0xb23f('0x17')](_0xb23f('0x15'),_0x275a36,JSON['stringify'](_0x3eff6f));_0x446478(_0x3eff6f);})[_0xb23f('0x12')](function(_0x5e0d1a){logger[_0xb23f('0x13')]('ShowCmHopper',_0x5e0d1a[_0xb23f('0x14')],_0x275a36);_0x3333d9(_0x5e837d[_0xb23f('0x13')](0x1f4,_0x5e0d1a[_0xb23f('0x14')]));});});};exports[_0xb23f('0x18')]=function(_0x4894d0){var _0x5263a0=this;return new Promise(function(_0x1efe21,_0x59ce36){return db['CmHopper'][_0xb23f('0x19')](_0x4894d0[_0xb23f('0x1a')],{'raw':_0x4894d0[_0xb23f('0x7')]?_0x4894d0[_0xb23f('0x7')][_0xb23f('0x8')]===undefined?!![]:![]:!![]})['then'](function(_0x211fc7){logger[_0xb23f('0x10')](_0xb23f('0x18'),_0x4894d0);logger['debug'](_0xb23f('0x18'),_0x4894d0,JSON['stringify'](_0x211fc7));_0x1efe21(_0x211fc7);})[_0xb23f('0x12')](function(_0x4d06dc){logger[_0xb23f('0x13')](_0xb23f('0x18'),_0x4d06dc[_0xb23f('0x14')],_0x4894d0);_0x59ce36(_0x5263a0[_0xb23f('0x13')](0x1f4,_0x4d06dc['message']));});});};exports[_0xb23f('0x1b')]=function(_0x4fa0fe){var _0x585309=this;return new Promise(function(_0x3703b6,_0x3be2c1){return db[_0xb23f('0x16')]['update'](_0x4fa0fe['body'],{'raw':_0x4fa0fe[_0xb23f('0x7')]?_0x4fa0fe['options'][_0xb23f('0x8')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4fa0fe[_0xb23f('0x7')]?_0x4fa0fe[_0xb23f('0x7')][_0xb23f('0x9')]||null:null,'attributes':_0x4fa0fe[_0xb23f('0x7')]?_0x4fa0fe[_0xb23f('0x7')][_0xb23f('0xa')]||null:null,'limit':_0x4fa0fe[_0xb23f('0x7')]?_0x4fa0fe[_0xb23f('0x7')][_0xb23f('0xb')]||null:null})[_0xb23f('0xf')](function(_0x3132d3){logger[_0xb23f('0x10')](_0xb23f('0x1b'),_0x4fa0fe);logger[_0xb23f('0x10')]('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0xb23f('0x11')](_0x4fa0fe[_0xb23f('0x7')]['where']),_0x4fa0fe[_0xb23f('0x1a')][_0xb23f('0x1c')]);logger[_0xb23f('0x17')](_0xb23f('0x1b'),_0x4fa0fe,JSON['stringify'](_0x3132d3));_0x3703b6(_0x3132d3);})['catch'](function(_0x380678){logger[_0xb23f('0x13')](_0xb23f('0x1b'),_0x380678[_0xb23f('0x14')],_0x4fa0fe);_0x3be2c1(_0x585309[_0xb23f('0x13')](0x1f4,_0x380678[_0xb23f('0x14')]));});});};exports[_0xb23f('0x1d')]=function(_0x2e504b){var _0x10df26=this;return new Promise(function(_0x46411a,_0x1bb0bd){return db['CmHopper']['destroy']({'where':_0x2e504b[_0xb23f('0x7')]?_0x2e504b[_0xb23f('0x7')]['where']||null:null})['then'](function(_0x4a9fe5){logger[_0xb23f('0x10')](_0xb23f('0x1d'),_0x2e504b);logger[_0xb23f('0x17')](_0xb23f('0x1d'),_0x2e504b,JSON[_0xb23f('0x11')](_0x4a9fe5));_0x46411a(_0x4a9fe5);})[_0xb23f('0x12')](function(_0x496fe5){logger[_0xb23f('0x13')](_0xb23f('0x1d'),_0x496fe5['message'],_0x2e504b);_0x1bb0bd(_0x10df26[_0xb23f('0x13')](0x1f4,_0x496fe5['message']));});});};exports['GetContactDialer']=function(_0x3d2254){var _0x5a17d3=this;return new Promise(function(_0xd55528,_0x4dba32){return db[_0xb23f('0x1e')]['describe']()[_0xb23f('0xf')](function(_0x218bd7){return db[_0xb23f('0x1f')]['transaction'](function(_0x39b308){return db[_0xb23f('0x16')][_0xb23f('0x20')]({'where':_0x3d2254['options']?_0x3d2254[_0xb23f('0x7')][_0xb23f('0x9')]||null:null,'attributes':_0x3d2254[_0xb23f('0x7')]?_0x3d2254[_0xb23f('0x7')][_0xb23f('0xa')]||null:null,'limit':_0x3d2254[_0xb23f('0x7')]?_0x3d2254[_0xb23f('0x7')]['limit']||null:null,'order':_0x3d2254[_0xb23f('0x7')]?_0x3d2254[_0xb23f('0x7')][_0xb23f('0x21')]||null:null,'transaction':_0x39b308,'lock':_0x39b308[_0xb23f('0x22')][_0xb23f('0x23')],'include':[{'model':db['CmContact'],'as':_0xb23f('0x24'),'attributes':_[_0xb23f('0x25')](_0x218bd7)},{'model':db['User'],'as':_0xb23f('0x26'),'attributes':['id',_0xb23f('0x27'),_0xb23f('0x28')]}]})[_0xb23f('0xf')](function(_0x595a5c){var _0x3c2fd9=[];var _0x2c912a=[];for(var _0x5dc4ee=0x0;_0x5dc4ee<_0x595a5c[_0xb23f('0x29')];_0x5dc4ee+=0x1){var _0x16b062=_0x595a5c[_0x5dc4ee][_0xb23f('0x2a')];if(_0x16b062===null){_0x3c2fd9[_0xb23f('0x2b')](_0x595a5c[_0x5dc4ee]['update'](_0x3d2254[_0xb23f('0x1a')],{'transaction':_0x39b308}));}else if(!_0x2c912a[_0xb23f('0x2c')](_0x16b062)){_0x2c912a[_0xb23f('0x2b')](_0x16b062);_0x3c2fd9[_0xb23f('0x2b')](_0x595a5c[_0x5dc4ee][_0xb23f('0x2d')](_0x3d2254[_0xb23f('0x1a')],{'transaction':_0x39b308}));}}return BPromise[_0xb23f('0x2e')](_0x3c2fd9);});})[_0xb23f('0xf')](function(_0x22f70b){logger[_0xb23f('0x10')](_0xb23f('0x2f'),_0x3d2254);if(_0x22f70b[_0xb23f('0x29')]>0x0){logger['info']('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x22f70b[0x0][_0xb23f('0x30')]['id'],_0x22f70b[0x0][_0xb23f('0x30')][_0xb23f('0x31')],_0x22f70b[0x0][_0xb23f('0x30')][_0xb23f('0x1c')]);}logger['debug'](_0xb23f('0x2f'),_0x3d2254,JSON[_0xb23f('0x11')](_0x22f70b));_0xd55528(_0x22f70b);})['catch'](function(_0x5ccfd5){logger[_0xb23f('0x13')](_0xb23f('0x2f'),_0x5ccfd5['message'],_0x3d2254);_0x4dba32(_0x5a17d3[_0xb23f('0x13')](0x1f4,_0x5ccfd5[_0xb23f('0x14')]));});});});};exports[_0xb23f('0x32')]=function(_0x24d282){var _0x323ba4=this;return new Promise(function(_0x482800,_0xe971ad){return db[_0xb23f('0x1f')][_0xb23f('0x33')](function(_0x4283ee){return db[_0xb23f('0x34')][_0xb23f('0x19')](_0x24d282[_0xb23f('0x1a')],{'raw':_0x24d282[_0xb23f('0x7')]?_0x24d282['options'][_0xb23f('0x8')]===undefined?!![]:![]:!![],'transaction':_0x4283ee})[_0xb23f('0xf')](function(){logger[_0xb23f('0x10')](_0xb23f('0x35'),JSON[_0xb23f('0x11')](_0x24d282[_0xb23f('0x7')][_0xb23f('0x9')]),_0x24d282[_0xb23f('0x7')][_0xb23f('0x9')][_0xb23f('0x1c')]);return db[_0xb23f('0x16')][_0xb23f('0x36')]({'where':_0x24d282[_0xb23f('0x7')]?_0x24d282[_0xb23f('0x7')][_0xb23f('0x9')]||null:null,'transaction':_0x4283ee});});})[_0xb23f('0xf')](function(_0x594745){logger[_0xb23f('0x10')](_0xb23f('0x32'),_0x24d282);logger['debug'](_0xb23f('0x32'),_0x24d282,JSON['stringify'](_0x594745));_0x482800(_0x594745);})[_0xb23f('0x12')](function(_0x2b64b8){logger[_0xb23f('0x13')](_0xb23f('0x32'),_0x2b64b8['message'],_0x24d282);_0xe971ad(_0x323ba4[_0xb23f('0x13')](0x1f4,_0x2b64b8[_0xb23f('0x14')]));});});};exports['CountReScheduled']=function(_0x34770d){var _0x1dc003=this;return new Promise(function(_0x871054,_0x5b574a){return db['CmHopper'][_0xb23f('0x20')]({'raw':_0x34770d['options']?_0x34770d[_0xb23f('0x7')][_0xb23f('0x8')]===undefined?!![]:![]:!![],'where':_0x34770d[_0xb23f('0x7')]?_0x34770d[_0xb23f('0x7')][_0xb23f('0x9')]||null:null,'attributes':[[db['sequelize']['fn'](_0xb23f('0x37'),db[_0xb23f('0x1f')]['fn']('IF',db['sequelize'][_0xb23f('0x38')](_0xb23f('0x39')+util[_0xb23f('0x3a')]('\x22%s\x22',moment()['format'](_0xb23f('0x3b')))+_0xb23f('0x3c')))),_0xb23f('0x3d')]]})[_0xb23f('0xf')](function(_0x2f7d60){logger[_0xb23f('0x10')](_0xb23f('0x3e'),_0x34770d);logger[_0xb23f('0x17')](_0xb23f('0x3e'),_0x34770d,JSON[_0xb23f('0x11')](_0x2f7d60));_0x871054(_0x2f7d60);})[_0xb23f('0x12')](function(_0xe3251){logger[_0xb23f('0x13')](_0xb23f('0x3e'),_0xe3251[_0xb23f('0x14')],_0x34770d);_0x5b574a(_0x1dc003['error'](0x1f4,_0xe3251[_0xb23f('0x14')]));});});};exports[_0xb23f('0x3f')]=function(_0x5484ba){var _0x12deab=this;return new Promise(function(_0x1f0016,_0x5a54e2){return db['CmContact']['describe']()[_0xb23f('0xf')](function(){return db[_0xb23f('0x1f')][_0xb23f('0x33')](function(_0x45b7f3){return db[_0xb23f('0x16')][_0xb23f('0x20')]({'where':_0x5484ba[_0xb23f('0x7')]?_0x5484ba[_0xb23f('0x7')]['where']||null:null,'attributes':_0x5484ba[_0xb23f('0x7')]?_0x5484ba[_0xb23f('0x7')][_0xb23f('0xa')]||null:null,'limit':0x1,'order':_0x5484ba['options']?_0x5484ba[_0xb23f('0x7')]['order']||null:null,'group':db[_0xb23f('0x16')][_0xb23f('0x2a')],'transaction':_0x45b7f3,'lock':_0x45b7f3[_0xb23f('0x22')][_0xb23f('0x23')],'include':_0x5484ba['options']?_0x5484ba[_0xb23f('0x7')][_0xb23f('0xc')]?_[_0xb23f('0xd')](_0x5484ba[_0xb23f('0x7')][_0xb23f('0xc')],function(_0xf95021){return{'model':db[_0xf95021[_0xb23f('0xe')]],'as':_0xf95021['as'],'attributes':_0xf95021[_0xb23f('0xa')],'include':_0xf95021[_0xb23f('0xc')]?_[_0xb23f('0xd')](_0xf95021[_0xb23f('0xc')],function(_0x2338b8){return{'model':db[_0x2338b8['model']],'as':_0x2338b8['as'],'attributes':_0x2338b8[_0xb23f('0xa')],'include':_0x2338b8[_0xb23f('0xc')]?_[_0xb23f('0xd')](_0x2338b8[_0xb23f('0xc')],function(_0x27c5ef){return{'model':db[_0x27c5ef[_0xb23f('0xe')]],'as':_0x27c5ef['as'],'attributes':_0x27c5ef['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x281453){var _0x502e5f=[];for(var _0x29ff9e=0x0;_0x29ff9e<_0x281453['length'];_0x29ff9e+=0x1){_0x502e5f['push'](_0x281453[_0x29ff9e][_0xb23f('0x2d')](_0x5484ba[_0xb23f('0x1a')],{'transaction':_0x45b7f3}));}return BPromise[_0xb23f('0x2e')](_0x502e5f);});})[_0xb23f('0xf')](function(_0x1245c3){logger[_0xb23f('0x10')]('GetContactRecallMe',_0x5484ba);logger[_0xb23f('0x17')]('GetContactRecallMe',_0x5484ba,JSON['stringify'](_0x1245c3));_0x1f0016(_0x1245c3);})[_0xb23f('0x12')](function(_0x40f11){logger['error'](_0xb23f('0x3f'),_0x40f11['message'],_0x5484ba);_0x5a54e2(_0x12deab[_0xb23f('0x13')](0x1f4,_0x40f11[_0xb23f('0x14')]));});});});};exports[_0xb23f('0x40')]=function(_0x35f0a2){var _0x1f487b=this;return new Promise(function(_0x5d8965,_0x6f6867){db[_0xb23f('0x1e')]['describe']()[_0xb23f('0xf')](function(_0x4fb6a0){return db[_0xb23f('0x16')]['findAll']({'raw':_0x35f0a2[_0xb23f('0x7')]?_0x35f0a2[_0xb23f('0x7')]['raw']===undefined?!![]:![]:!![],'where':_0x35f0a2[_0xb23f('0x7')]?_0x35f0a2[_0xb23f('0x7')][_0xb23f('0x9')]||null:null,'attributes':_0x35f0a2[_0xb23f('0x7')]?_0x35f0a2[_0xb23f('0x7')][_0xb23f('0xa')]||null:null,'limit':_0x35f0a2[_0xb23f('0x7')]?_0x35f0a2[_0xb23f('0x7')][_0xb23f('0xb')]||null:null,'include':_0x35f0a2[_0xb23f('0x7')]?_0x35f0a2[_0xb23f('0x7')][_0xb23f('0xc')]?_[_0xb23f('0xd')](_0x35f0a2['options']['include'],function(_0x3a1af4){return{'model':db[_0x3a1af4[_0xb23f('0xe')]],'as':_0x3a1af4['as'],'attributes':_0x3a1af4['as']==='Contact'?_[_0xb23f('0x25')](_0x4fb6a0):_0x3a1af4[_0xb23f('0xa')],'include':_0x3a1af4[_0xb23f('0xc')]?_['map'](_0x3a1af4[_0xb23f('0xc')],function(_0x672792){return{'model':db[_0x672792['model']],'as':_0x672792['as'],'attributes':_0x672792['attributes'],'include':_0x672792['include']?_[_0xb23f('0xd')](_0x672792[_0xb23f('0xc')],function(_0x22a7cf){return{'model':db[_0x22a7cf[_0xb23f('0xe')]],'as':_0x22a7cf['as'],'attributes':_0x22a7cf['attributes']};}):[]};}):[]};}):[]:[]})[_0xb23f('0xf')](function(_0x1124f2){logger[_0xb23f('0x10')](_0xb23f('0x6'),_0x35f0a2);logger[_0xb23f('0x17')](_0xb23f('0x6'),_0x35f0a2,JSON[_0xb23f('0x11')](_0x1124f2));_0x5d8965(_0x1124f2);})[_0xb23f('0x12')](function(_0x3c8751){logger[_0xb23f('0x13')]('GetCmHopper',_0x3c8751[_0xb23f('0x14')],_0x35f0a2);_0x6f6867(_0x1f487b[_0xb23f('0x13')](0x1f4,_0x3c8751[_0xb23f('0x14')]));});});});};exports['GetContactByPhone']=function(_0x14fabb){var _0x4a5da9=this;return new Promise(function(_0x496486,_0x8141b0){return db[_0xb23f('0x1e')][_0xb23f('0x41')]({'raw':!![],'where':{'phone':_0x14fabb[_0xb23f('0x7')][_0xb23f('0x9')][_0xb23f('0x42')]},'attributes':['id',_0xb23f('0x43')],'order':[['id',_0xb23f('0x44')]]})[_0xb23f('0xf')](function(_0xf845fe){logger[_0xb23f('0x10')](_0xb23f('0x45'),_0x14fabb);logger[_0xb23f('0x17')](_0xb23f('0x45'),_0x14fabb,JSON[_0xb23f('0x11')](_0xf845fe));_0x496486(_0xf845fe);})[_0xb23f('0x12')](function(_0x4e6952){logger['error'](_0xb23f('0x45'),_0x4e6952[_0xb23f('0x14')],_0x14fabb);_0x8141b0(_0x4a5da9[_0xb23f('0x13')](0x1f4,_0x4e6952[_0xb23f('0x14')]));});});};exports['ResetActiveCalls']=function(_0x382628){var _0x2612db=this;return new Promise(function(_0x27d58c,_0x2f887d){return db[_0xb23f('0x1f')][_0xb23f('0x33')](function(_0x22489e){var _0x3d8e9c=_0x382628[_0xb23f('0x7')]&&_0x382628[_0xb23f('0x7')][_0xb23f('0x9')]?_0x382628[_0xb23f('0x7')][_0xb23f('0x9')]:{};return db[_0xb23f('0x16')]['update'](_0x382628[_0xb23f('0x1a')],{'where':_0x3d8e9c,'transaction':_0x22489e})[_0xb23f('0xf')](function(_0x5be4bd){logger[_0xb23f('0x10')]('ResetActiveCalls',_0x382628);logger[_0xb23f('0x17')](_0xb23f('0x46'),_0x382628,JSON[_0xb23f('0x11')](_0x5be4bd));_0x27d58c(_0x5be4bd);})['catch'](function(_0x98e735){logger['error']('ResetActiveCalls',_0x98e735[_0xb23f('0x14')],_0x382628);_0x2f887d(_0x2612db['error'](0x1f4,_0x98e735[_0xb23f('0x14')]));});});});};exports[_0xb23f('0x47')]=function(_0x336192){var _0x349f7a=this;var _0x4ab145=_0x336192[_0xb23f('0x1a')][_0xb23f('0x9')]['voiceQueueIds'];var _0x20d4ec=_0x336192['body']['where']['interval'];var _0x4d197c=_0x336192[_0xb23f('0x1a')][_0xb23f('0x9')][_0xb23f('0x48')];return new Promise(function(_0x36e32d,_0x3a5f27){return db['CmHopper'][_0xb23f('0x20')]({'where':{'voiceQueueId':{'$in':_0x4ab145},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xb23f('0x1f')]['literal'](_0xb23f('0x49')+_0x20d4ec+_0xb23f('0x4a')),'$gt':db[_0xb23f('0x1f')][_0xb23f('0x38')](_0xb23f('0x4b'))}},'UserId':{'$in':_0x4d197c}},'include':[{'model':db['CmContact'],'as':_0xb23f('0x24')},{'model':db[_0xb23f('0x4c')],'as':_0xb23f('0x26'),'attributes':['id',_0xb23f('0x27'),'voicePause']},{'model':db['CmList'],'as':'List'}]})[_0xb23f('0xf')](function(_0x41d5f7){if(_0x41d5f7[_0xb23f('0x29')]>0x0){return db[_0xb23f('0x1f')][_0xb23f('0x33')](function(_0x2d0729){return db[_0xb23f('0x16')][_0xb23f('0x2d')]({'recallmeNotifiedDate':db[_0xb23f('0x1f')]['literal'](_0xb23f('0x4b'))},{'where':{'id':{'$in':_[_0xb23f('0xd')](_0x41d5f7,'id')}},'transaction':_0x2d0729})[_0xb23f('0xf')](function(){_0x36e32d(_0x41d5f7);})['catch'](function(_0x5c5807){logger[_0xb23f('0x13')](_0xb23f('0x47'),_0x5c5807[_0xb23f('0x14')],_0x336192);_0x3a5f27(_0x349f7a[_0xb23f('0x13')](0x1f4,_0x5c5807['message']));});})[_0xb23f('0x12')](function(_0x175008){logger[_0xb23f('0x13')](_0xb23f('0x47'),_0x175008['message'],_0x336192);_0x3a5f27(_0x349f7a[_0xb23f('0x13')](0x1f4,_0x175008[_0xb23f('0x14')]));});}else{_0x36e32d(_0x41d5f7);}});});}; \ No newline at end of file +var _0x900f=['util','bluebird','../../mysqldb','../../config/logger','rpc','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','include','map','model','then','info','stringify','catch','error','message','find','ShowCmHopper','debug','CreateCmHopper','body','UpdateCmHopper','update','limit','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','destroy','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction','LOCK','UPDATE','Contact','keys','Agent','name','voicePause','UserId','push','includes','all','length','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','active','CmHopperFinal','MoveContactManagedDialer','COUNT','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','CountReScheduled','GetContactRecallMe','GetContactByPhone','findOne','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','literal','NOW()','User','CmList','List','lodash'];(function(_0x1e175d,_0x41ff45){var _0x3a3ce5=function(_0x186001){while(--_0x186001){_0x1e175d['push'](_0x1e175d['shift']());}};_0x3a3ce5(++_0x41ff45);}(_0x900f,0x18a));var _0xf900=function(_0x45c10a,_0x4b9090){_0x45c10a=_0x45c10a-0x0;var _0x3f680=_0x900f[_0x45c10a];return _0x3f680;};'use strict';var _=require(_0xf900('0x0'));var util=require(_0xf900('0x1'));var moment=require('moment');var BPromise=require(_0xf900('0x2'));var db=require(_0xf900('0x3'))['db'];var logger=require(_0xf900('0x4'))(_0xf900('0x5'));exports[_0xf900('0x6')]=function(_0x29b960){var _0x594ce8=this;return new Promise(function(_0x2a164c,_0x471fe9){return db[_0xf900('0x7')][_0xf900('0x8')]({'raw':_0x29b960[_0xf900('0x9')]?_0x29b960['options'][_0xf900('0xa')]===undefined?!![]:![]:!![],'where':_0x29b960['options']?_0x29b960[_0xf900('0x9')][_0xf900('0xb')]||null:null,'attributes':_0x29b960[_0xf900('0x9')]?_0x29b960['options'][_0xf900('0xc')]||null:null,'limit':_0x29b960[_0xf900('0x9')]?_0x29b960[_0xf900('0x9')]['limit']||null:null,'include':_0x29b960[_0xf900('0x9')]?_0x29b960[_0xf900('0x9')][_0xf900('0xd')]?_[_0xf900('0xe')](_0x29b960['options'][_0xf900('0xd')],function(_0x209f65){return{'model':db[_0x209f65[_0xf900('0xf')]],'as':_0x209f65['as'],'attributes':_0x209f65['attributes'],'include':_0x209f65[_0xf900('0xd')]?_[_0xf900('0xe')](_0x209f65['include'],function(_0x2157ce){return{'model':db[_0x2157ce[_0xf900('0xf')]],'as':_0x2157ce['as'],'attributes':_0x2157ce[_0xf900('0xc')],'include':_0x2157ce['include']?_[_0xf900('0xe')](_0x2157ce[_0xf900('0xd')],function(_0x13e667){return{'model':db[_0x13e667['model']],'as':_0x13e667['as'],'attributes':_0x13e667[_0xf900('0xc')]};}):[]};}):[]};}):[]:[]})[_0xf900('0x10')](function(_0x3e5339){logger[_0xf900('0x11')](_0xf900('0x6'),_0x29b960);logger['debug']('GetCmHopper',_0x29b960,JSON[_0xf900('0x12')](_0x3e5339));_0x2a164c(_0x3e5339);})[_0xf900('0x13')](function(_0x3a6afe){logger[_0xf900('0x14')]('GetCmHopper',_0x3a6afe[_0xf900('0x15')],_0x29b960);_0x471fe9(_0x594ce8['error'](0x1f4,_0x3a6afe[_0xf900('0x15')]));});});};exports['ShowCmHopper']=function(_0x212d42){var _0x4868ea=this;return new Promise(function(_0x281c4c,_0x3d116d){return db[_0xf900('0x7')][_0xf900('0x16')]({'raw':_0x212d42['options']?_0x212d42[_0xf900('0x9')]['raw']===undefined?!![]:![]:!![],'where':_0x212d42['options']?_0x212d42['options'][_0xf900('0xb')]||null:null,'attributes':_0x212d42[_0xf900('0x9')]?_0x212d42['options']['attributes']||null:null,'include':_0x212d42['options']?_0x212d42[_0xf900('0x9')][_0xf900('0xd')]?_[_0xf900('0xe')](_0x212d42[_0xf900('0x9')]['include'],function(_0xa1c1cb){return{'model':db[_0xa1c1cb[_0xf900('0xf')]],'as':_0xa1c1cb['as'],'attributes':_0xa1c1cb['attributes'],'include':_0xa1c1cb[_0xf900('0xd')]?_[_0xf900('0xe')](_0xa1c1cb[_0xf900('0xd')],function(_0x5e7a66){return{'model':db[_0x5e7a66[_0xf900('0xf')]],'as':_0x5e7a66['as'],'attributes':_0x5e7a66['attributes'],'include':_0x5e7a66[_0xf900('0xd')]?_[_0xf900('0xe')](_0x5e7a66[_0xf900('0xd')],function(_0x33a66c){return{'model':db[_0x33a66c[_0xf900('0xf')]],'as':_0x33a66c['as'],'attributes':_0x33a66c[_0xf900('0xc')]};}):[]};}):[]};}):[]:[]})[_0xf900('0x10')](function(_0xa6f659){logger[_0xf900('0x11')](_0xf900('0x17'),_0x212d42);logger[_0xf900('0x18')](_0xf900('0x17'),_0x212d42,JSON[_0xf900('0x12')](_0xa6f659));_0x281c4c(_0xa6f659);})[_0xf900('0x13')](function(_0x1e44f3){logger[_0xf900('0x14')](_0xf900('0x17'),_0x1e44f3[_0xf900('0x15')],_0x212d42);_0x3d116d(_0x4868ea[_0xf900('0x14')](0x1f4,_0x1e44f3[_0xf900('0x15')]));});});};exports[_0xf900('0x19')]=function(_0x24bb0a){var _0x68308d=this;return new Promise(function(_0x5e5782,_0x59ad38){return db[_0xf900('0x7')]['create'](_0x24bb0a[_0xf900('0x1a')],{'raw':_0x24bb0a[_0xf900('0x9')]?_0x24bb0a[_0xf900('0x9')][_0xf900('0xa')]===undefined?!![]:![]:!![]})[_0xf900('0x10')](function(_0x552be2){logger['info'](_0xf900('0x19'),_0x24bb0a);logger['debug'](_0xf900('0x19'),_0x24bb0a,JSON[_0xf900('0x12')](_0x552be2));_0x5e5782(_0x552be2);})[_0xf900('0x13')](function(_0x481865){logger[_0xf900('0x14')](_0xf900('0x19'),_0x481865[_0xf900('0x15')],_0x24bb0a);_0x59ad38(_0x68308d['error'](0x1f4,_0x481865[_0xf900('0x15')]));});});};exports[_0xf900('0x1b')]=function(_0x1a93b0){var _0x314105=this;return new Promise(function(_0x42fcfc,_0x4493ce){return db['CmHopper'][_0xf900('0x1c')](_0x1a93b0[_0xf900('0x1a')],{'raw':_0x1a93b0[_0xf900('0x9')]?_0x1a93b0[_0xf900('0x9')][_0xf900('0xa')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a93b0[_0xf900('0x9')]?_0x1a93b0[_0xf900('0x9')][_0xf900('0xb')]||null:null,'attributes':_0x1a93b0[_0xf900('0x9')]?_0x1a93b0['options'][_0xf900('0xc')]||null:null,'limit':_0x1a93b0[_0xf900('0x9')]?_0x1a93b0[_0xf900('0x9')][_0xf900('0x1d')]||null:null})[_0xf900('0x10')](function(_0x5f00be){logger[_0xf900('0x11')](_0xf900('0x1b'),_0x1a93b0);logger[_0xf900('0x11')](_0xf900('0x1e'),JSON[_0xf900('0x12')](_0x1a93b0['options'][_0xf900('0xb')]),_0x1a93b0[_0xf900('0x1a')]['active']);logger['debug'](_0xf900('0x1b'),_0x1a93b0,JSON[_0xf900('0x12')](_0x5f00be));_0x42fcfc(_0x5f00be);})[_0xf900('0x13')](function(_0x12ee0f){logger[_0xf900('0x14')](_0xf900('0x1b'),_0x12ee0f[_0xf900('0x15')],_0x1a93b0);_0x4493ce(_0x314105[_0xf900('0x14')](0x1f4,_0x12ee0f[_0xf900('0x15')]));});});};exports['DestroyCmHopper']=function(_0x17f81c){var _0x252c0a=this;return new Promise(function(_0x32559c,_0x194f97){return db[_0xf900('0x7')][_0xf900('0x1f')]({'where':_0x17f81c[_0xf900('0x9')]?_0x17f81c[_0xf900('0x9')][_0xf900('0xb')]||null:null})[_0xf900('0x10')](function(_0x42cd20){logger[_0xf900('0x11')]('DestroyCmHopper',_0x17f81c);logger[_0xf900('0x18')](_0xf900('0x20'),_0x17f81c,JSON['stringify'](_0x42cd20));_0x32559c(_0x42cd20);})[_0xf900('0x13')](function(_0x5b1cc4){logger[_0xf900('0x14')](_0xf900('0x20'),_0x5b1cc4['message'],_0x17f81c);_0x194f97(_0x252c0a[_0xf900('0x14')](0x1f4,_0x5b1cc4[_0xf900('0x15')]));});});};exports[_0xf900('0x21')]=function(_0x28051e){var _0x161559=this;return new Promise(function(_0x2fce40,_0xb749ed){return db[_0xf900('0x22')][_0xf900('0x23')]()[_0xf900('0x10')](function(_0x6cf7a1){return db[_0xf900('0x24')][_0xf900('0x25')](function(_0x1fba41){return db[_0xf900('0x7')][_0xf900('0x8')]({'where':_0x28051e['options']?_0x28051e[_0xf900('0x9')][_0xf900('0xb')]||null:null,'attributes':_0x28051e[_0xf900('0x9')]?_0x28051e[_0xf900('0x9')]['attributes']||null:null,'limit':_0x28051e[_0xf900('0x9')]?_0x28051e['options']['limit']||null:null,'order':_0x28051e[_0xf900('0x9')]?_0x28051e[_0xf900('0x9')]['order']||null:null,'transaction':_0x1fba41,'lock':_0x1fba41[_0xf900('0x26')][_0xf900('0x27')],'include':[{'model':db[_0xf900('0x22')],'as':_0xf900('0x28'),'attributes':_[_0xf900('0x29')](_0x6cf7a1)},{'model':db['User'],'as':_0xf900('0x2a'),'attributes':['id',_0xf900('0x2b'),_0xf900('0x2c')]}]})[_0xf900('0x10')](function(_0x4a67ea){var _0x680ab2=[];var _0x3c82ea=[];for(var _0x32771d=0x0;_0x32771d<_0x4a67ea['length'];_0x32771d+=0x1){var _0x9cc65=_0x4a67ea[_0x32771d][_0xf900('0x2d')];if(_0x9cc65===null){_0x680ab2[_0xf900('0x2e')](_0x4a67ea[_0x32771d][_0xf900('0x1c')](_0x28051e[_0xf900('0x1a')],{'transaction':_0x1fba41}));}else if(!_0x3c82ea[_0xf900('0x2f')](_0x9cc65)){_0x3c82ea[_0xf900('0x2e')](_0x9cc65);_0x680ab2[_0xf900('0x2e')](_0x4a67ea[_0x32771d][_0xf900('0x1c')](_0x28051e[_0xf900('0x1a')],{'transaction':_0x1fba41}));}}return BPromise[_0xf900('0x30')](_0x680ab2);});})['then'](function(_0x2d43d8){logger['info'](_0xf900('0x21'),_0x28051e);if(_0x2d43d8[_0xf900('0x31')]>0x0){logger[_0xf900('0x11')](_0xf900('0x32'),_0x2d43d8[0x0][_0xf900('0x33')]['id'],_0x2d43d8[0x0][_0xf900('0x33')][_0xf900('0x34')],_0x2d43d8[0x0][_0xf900('0x33')][_0xf900('0x35')]);}logger['debug'](_0xf900('0x21'),_0x28051e,JSON[_0xf900('0x12')](_0x2d43d8));_0x2fce40(_0x2d43d8);})['catch'](function(_0x18720c){logger[_0xf900('0x14')](_0xf900('0x21'),_0x18720c[_0xf900('0x15')],_0x28051e);_0xb749ed(_0x161559[_0xf900('0x14')](0x1f4,_0x18720c[_0xf900('0x15')]));});});});};exports['MoveContactManagedDialer']=function(_0xe7b082){var _0x4c2cc5=this;return new Promise(function(_0x58f2e3,_0xd8a730){return db[_0xf900('0x24')][_0xf900('0x25')](function(_0x52b37e){return db[_0xf900('0x36')]['create'](_0xe7b082['body'],{'raw':_0xe7b082[_0xf900('0x9')]?_0xe7b082[_0xf900('0x9')][_0xf900('0xa')]===undefined?!![]:![]:!![],'transaction':_0x52b37e})[_0xf900('0x10')](function(){logger[_0xf900('0x11')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON['stringify'](_0xe7b082[_0xf900('0x9')][_0xf900('0xb')]),_0xe7b082[_0xf900('0x9')][_0xf900('0xb')][_0xf900('0x35')]);return db[_0xf900('0x7')][_0xf900('0x1f')]({'where':_0xe7b082[_0xf900('0x9')]?_0xe7b082[_0xf900('0x9')][_0xf900('0xb')]||null:null,'transaction':_0x52b37e});});})[_0xf900('0x10')](function(_0x298a31){logger[_0xf900('0x11')](_0xf900('0x37'),_0xe7b082);logger[_0xf900('0x18')](_0xf900('0x37'),_0xe7b082,JSON[_0xf900('0x12')](_0x298a31));_0x58f2e3(_0x298a31);})['catch'](function(_0x1f393f){logger[_0xf900('0x14')](_0xf900('0x37'),_0x1f393f['message'],_0xe7b082);_0xd8a730(_0x4c2cc5[_0xf900('0x14')](0x1f4,_0x1f393f['message']));});});};exports['CountReScheduled']=function(_0x1591b6){var _0x1f4e86=this;return new Promise(function(_0x352580,_0x9b5fd8){return db[_0xf900('0x7')][_0xf900('0x8')]({'raw':_0x1591b6['options']?_0x1591b6[_0xf900('0x9')][_0xf900('0xa')]===undefined?!![]:![]:!![],'where':_0x1591b6[_0xf900('0x9')]?_0x1591b6[_0xf900('0x9')][_0xf900('0xb')]||null:null,'attributes':[[db[_0xf900('0x24')]['fn'](_0xf900('0x38'),db[_0xf900('0x24')]['fn']('IF',db[_0xf900('0x24')]['literal'](_0xf900('0x39')+util[_0xf900('0x3a')](_0xf900('0x3b'),moment()[_0xf900('0x3a')](_0xf900('0x3c')))+'\x20,\x201,\x20null'))),'contactsRescheduled']]})[_0xf900('0x10')](function(_0x525995){logger['info'](_0xf900('0x3d'),_0x1591b6);logger['debug'](_0xf900('0x3d'),_0x1591b6,JSON[_0xf900('0x12')](_0x525995));_0x352580(_0x525995);})[_0xf900('0x13')](function(_0x63e71f){logger[_0xf900('0x14')](_0xf900('0x3d'),_0x63e71f[_0xf900('0x15')],_0x1591b6);_0x9b5fd8(_0x1f4e86[_0xf900('0x14')](0x1f4,_0x63e71f[_0xf900('0x15')]));});});};exports[_0xf900('0x3e')]=function(_0x9b7654){var _0x19991a=this;return new Promise(function(_0x280d64,_0x37488d){return db['CmContact'][_0xf900('0x23')]()[_0xf900('0x10')](function(){return db[_0xf900('0x24')][_0xf900('0x25')](function(_0x3efefd){return db[_0xf900('0x7')][_0xf900('0x8')]({'where':_0x9b7654[_0xf900('0x9')]?_0x9b7654[_0xf900('0x9')]['where']||null:null,'attributes':_0x9b7654[_0xf900('0x9')]?_0x9b7654[_0xf900('0x9')][_0xf900('0xc')]||null:null,'limit':0x1,'order':_0x9b7654[_0xf900('0x9')]?_0x9b7654['options']['order']||null:null,'group':db[_0xf900('0x7')]['UserId'],'transaction':_0x3efefd,'lock':_0x3efefd[_0xf900('0x26')]['UPDATE'],'include':_0x9b7654[_0xf900('0x9')]?_0x9b7654[_0xf900('0x9')][_0xf900('0xd')]?_[_0xf900('0xe')](_0x9b7654[_0xf900('0x9')][_0xf900('0xd')],function(_0x484066){return{'model':db[_0x484066['model']],'as':_0x484066['as'],'attributes':_0x484066[_0xf900('0xc')],'include':_0x484066[_0xf900('0xd')]?_[_0xf900('0xe')](_0x484066[_0xf900('0xd')],function(_0x405557){return{'model':db[_0x405557[_0xf900('0xf')]],'as':_0x405557['as'],'attributes':_0x405557[_0xf900('0xc')],'include':_0x405557[_0xf900('0xd')]?_[_0xf900('0xe')](_0x405557['include'],function(_0x2a4d4b){return{'model':db[_0x2a4d4b['model']],'as':_0x2a4d4b['as'],'attributes':_0x2a4d4b[_0xf900('0xc')]};}):[]};}):[]};}):[]:[]})[_0xf900('0x10')](function(_0xb40a0b){var _0x335668=[];for(var _0x3ad88b=0x0;_0x3ad88b<_0xb40a0b[_0xf900('0x31')];_0x3ad88b+=0x1){_0x335668['push'](_0xb40a0b[_0x3ad88b][_0xf900('0x1c')](_0x9b7654['body'],{'transaction':_0x3efefd}));}return BPromise['all'](_0x335668);});})[_0xf900('0x10')](function(_0x16b67e){logger[_0xf900('0x11')]('GetContactRecallMe',_0x9b7654);logger[_0xf900('0x18')](_0xf900('0x3e'),_0x9b7654,JSON[_0xf900('0x12')](_0x16b67e));_0x280d64(_0x16b67e);})[_0xf900('0x13')](function(_0xd3fdf){logger['error']('GetContactRecallMe',_0xd3fdf[_0xf900('0x15')],_0x9b7654);_0x37488d(_0x19991a[_0xf900('0x14')](0x1f4,_0xd3fdf[_0xf900('0x15')]));});});});};exports['GetCmHopperPreview']=function(_0x555530){var _0x154523=this;return new Promise(function(_0x353140,_0xbe90ed){db[_0xf900('0x22')][_0xf900('0x23')]()['then'](function(_0x2cf12e){return db[_0xf900('0x7')][_0xf900('0x8')]({'raw':_0x555530[_0xf900('0x9')]?_0x555530[_0xf900('0x9')][_0xf900('0xa')]===undefined?!![]:![]:!![],'where':_0x555530[_0xf900('0x9')]?_0x555530['options'][_0xf900('0xb')]||null:null,'attributes':_0x555530[_0xf900('0x9')]?_0x555530[_0xf900('0x9')][_0xf900('0xc')]||null:null,'limit':_0x555530[_0xf900('0x9')]?_0x555530['options'][_0xf900('0x1d')]||null:null,'include':_0x555530[_0xf900('0x9')]?_0x555530[_0xf900('0x9')][_0xf900('0xd')]?_[_0xf900('0xe')](_0x555530[_0xf900('0x9')][_0xf900('0xd')],function(_0x2acf21){return{'model':db[_0x2acf21['model']],'as':_0x2acf21['as'],'attributes':_0x2acf21['as']===_0xf900('0x28')?_[_0xf900('0x29')](_0x2cf12e):_0x2acf21[_0xf900('0xc')],'include':_0x2acf21['include']?_['map'](_0x2acf21['include'],function(_0x94c3f1){return{'model':db[_0x94c3f1['model']],'as':_0x94c3f1['as'],'attributes':_0x94c3f1[_0xf900('0xc')],'include':_0x94c3f1[_0xf900('0xd')]?_['map'](_0x94c3f1[_0xf900('0xd')],function(_0x1c8d51){return{'model':db[_0x1c8d51[_0xf900('0xf')]],'as':_0x1c8d51['as'],'attributes':_0x1c8d51['attributes']};}):[]};}):[]};}):[]:[]})[_0xf900('0x10')](function(_0x1ad422){logger['info']('GetCmHopper',_0x555530);logger['debug']('GetCmHopper',_0x555530,JSON[_0xf900('0x12')](_0x1ad422));_0x353140(_0x1ad422);})[_0xf900('0x13')](function(_0x477a72){logger[_0xf900('0x14')](_0xf900('0x6'),_0x477a72[_0xf900('0x15')],_0x555530);_0xbe90ed(_0x154523[_0xf900('0x14')](0x1f4,_0x477a72['message']));});});});};exports[_0xf900('0x3f')]=function(_0x46f3b3){var _0x40f6c8=this;return new Promise(function(_0x2a5462,_0x64f93f){return db[_0xf900('0x22')][_0xf900('0x40')]({'raw':!![],'where':{'phone':_0x46f3b3[_0xf900('0x9')][_0xf900('0xb')]['phone']},'attributes':['id','dialTimezone'],'order':[['id',_0xf900('0x41')]]})[_0xf900('0x10')](function(_0x21a7a5){logger[_0xf900('0x11')]('getContactByPhone',_0x46f3b3);logger[_0xf900('0x18')](_0xf900('0x42'),_0x46f3b3,JSON[_0xf900('0x12')](_0x21a7a5));_0x2a5462(_0x21a7a5);})[_0xf900('0x13')](function(_0x507c33){logger[_0xf900('0x14')](_0xf900('0x42'),_0x507c33[_0xf900('0x15')],_0x46f3b3);_0x64f93f(_0x40f6c8['error'](0x1f4,_0x507c33[_0xf900('0x15')]));});});};exports[_0xf900('0x43')]=function(_0x5d6760){var _0x5afe23=this;return new Promise(function(_0x5bcf9d,_0x5e57a0){return db[_0xf900('0x24')]['transaction'](function(_0x8431c8){var _0x3c3f4e=_0x5d6760[_0xf900('0x9')]&&_0x5d6760[_0xf900('0x9')][_0xf900('0xb')]?_0x5d6760[_0xf900('0x9')][_0xf900('0xb')]:{};return db[_0xf900('0x7')][_0xf900('0x1c')](_0x5d6760[_0xf900('0x1a')],{'where':_0x3c3f4e,'transaction':_0x8431c8})[_0xf900('0x10')](function(_0x416918){logger[_0xf900('0x11')]('ResetActiveCalls',_0x5d6760);logger[_0xf900('0x18')]('ResetActiveCalls',_0x5d6760,JSON[_0xf900('0x12')](_0x416918));_0x5bcf9d(_0x416918);})[_0xf900('0x13')](function(_0x534292){logger['error'](_0xf900('0x43'),_0x534292[_0xf900('0x15')],_0x5d6760);_0x5e57a0(_0x5afe23[_0xf900('0x14')](0x1f4,_0x534292[_0xf900('0x15')]));});});});};exports[_0xf900('0x44')]=function(_0x25fb0e){var _0x3c559a=this;var _0x456e3f=_0x25fb0e[_0xf900('0x1a')][_0xf900('0xb')][_0xf900('0x45')];var _0x16d50f=_0x25fb0e[_0xf900('0x1a')]['where'][_0xf900('0x46')];var _0x15e5e1=_0x25fb0e[_0xf900('0x1a')][_0xf900('0xb')][_0xf900('0x47')];return new Promise(function(_0x558b13,_0x46b815){return db[_0xf900('0x7')][_0xf900('0x8')]({'where':{'voiceQueueId':{'$in':_0x456e3f},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xf900('0x24')]['literal'](_0xf900('0x48')+_0x16d50f+_0xf900('0x49')),'$gt':db['sequelize'][_0xf900('0x4a')](_0xf900('0x4b'))}},'UserId':{'$in':_0x15e5e1}},'include':[{'model':db['CmContact'],'as':_0xf900('0x28')},{'model':db[_0xf900('0x4c')],'as':'Agent','attributes':['id','name',_0xf900('0x2c')]},{'model':db[_0xf900('0x4d')],'as':_0xf900('0x4e')}]})[_0xf900('0x10')](function(_0x2dd713){if(_0x2dd713['length']>0x0){return db['sequelize']['transaction'](function(_0x23302f){return db[_0xf900('0x7')][_0xf900('0x1c')]({'recallmeNotifiedDate':db[_0xf900('0x24')][_0xf900('0x4a')](_0xf900('0x4b'))},{'where':{'id':{'$in':_[_0xf900('0xe')](_0x2dd713,'id')}},'transaction':_0x23302f})[_0xf900('0x10')](function(){_0x558b13(_0x2dd713);})[_0xf900('0x13')](function(_0x212b55){logger['error'](_0xf900('0x44'),_0x212b55[_0xf900('0x15')],_0x25fb0e);_0x46b815(_0x3c559a[_0xf900('0x14')](0x1f4,_0x212b55[_0xf900('0x15')]));});})[_0xf900('0x13')](function(_0x1fcdb7){logger['error']('CmHopperHandlePreviewRecallNotifications',_0x1fcdb7[_0xf900('0x15')],_0x25fb0e);_0x46b815(_0x3c559a[_0xf900('0x14')](0x1f4,_0x1fcdb7[_0xf900('0x15')]));});}else{_0x558b13(_0x2dd713);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 3585d52..292ad3f 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 _0xdd70=['./cmHopper.controller','get','isAuthenticated','index','describe','/opencontacts','/:id','show','getPreviewRecall','post','create','/preview','getPreview','getTimezone','put','update','destroy','exports','express'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xdd70,0x1c7));var _0x0dd7=function(_0x40a257,_0x198734){_0x40a257=_0x40a257-0x0;var _0x17cb98=_0xdd70[_0x40a257];return _0x17cb98;};'use strict';var express=require(_0x0dd7('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x0dd7('0x1'));router[_0x0dd7('0x2')]('/',auth[_0x0dd7('0x3')](),controller[_0x0dd7('0x4')]);router[_0x0dd7('0x2')]('/describe',auth[_0x0dd7('0x3')](),controller[_0x0dd7('0x5')]);router[_0x0dd7('0x2')](_0x0dd7('0x6'),auth[_0x0dd7('0x3')](),controller['getOpenContacts']);router['get']('/timezones',auth[_0x0dd7('0x3')](),controller['getTimezones']);router[_0x0dd7('0x2')](_0x0dd7('0x7'),auth[_0x0dd7('0x3')](),controller[_0x0dd7('0x8')]);router[_0x0dd7('0x2')]('/:id/previewrecall',auth[_0x0dd7('0x3')](),controller[_0x0dd7('0x9')]);router[_0x0dd7('0xa')]('/',auth['isAuthenticated'](),controller[_0x0dd7('0xb')]);router[_0x0dd7('0xa')](_0x0dd7('0xc'),auth[_0x0dd7('0x3')](),controller[_0x0dd7('0xd')]);router[_0x0dd7('0xa')]('/timezone',auth['isAuthenticated'](),controller[_0x0dd7('0xe')]);router[_0x0dd7('0xf')]('/:id',auth[_0x0dd7('0x3')](),controller[_0x0dd7('0x10')]);router['delete'](_0x0dd7('0x7'),auth[_0x0dd7('0x3')](),controller[_0x0dd7('0x11')]);module[_0x0dd7('0x12')]=router; \ No newline at end of file +var _0xe807=['get','isAuthenticated','/describe','/opencontacts','/timezones','/:id','show','/:id/previewrecall','post','create','/preview','/timezone','getTimezone','put','update','delete','destroy','exports','express','Router','../../components/auth/service','./cmHopper.controller'];(function(_0x5c814d,_0x4d81c7){var _0x89b71=function(_0x1068a4){while(--_0x1068a4){_0x5c814d['push'](_0x5c814d['shift']());}};_0x89b71(++_0x4d81c7);}(_0xe807,0x1e0));var _0x7e80=function(_0x1e2118,_0x3b4938){_0x1e2118=_0x1e2118-0x0;var _0x1d1697=_0xe807[_0x1e2118];return _0x1d1697;};'use strict';var express=require(_0x7e80('0x0'));var router=express[_0x7e80('0x1')]();var auth=require(_0x7e80('0x2'));var controller=require(_0x7e80('0x3'));router[_0x7e80('0x4')]('/',auth[_0x7e80('0x5')](),controller['index']);router['get'](_0x7e80('0x6'),auth[_0x7e80('0x5')](),controller['describe']);router[_0x7e80('0x4')](_0x7e80('0x7'),auth['isAuthenticated'](),controller['getOpenContacts']);router[_0x7e80('0x4')](_0x7e80('0x8'),auth[_0x7e80('0x5')](),controller['getTimezones']);router[_0x7e80('0x4')](_0x7e80('0x9'),auth[_0x7e80('0x5')](),controller[_0x7e80('0xa')]);router['get'](_0x7e80('0xb'),auth[_0x7e80('0x5')](),controller['getPreviewRecall']);router[_0x7e80('0xc')]('/',auth['isAuthenticated'](),controller[_0x7e80('0xd')]);router[_0x7e80('0xc')](_0x7e80('0xe'),auth[_0x7e80('0x5')](),controller['getPreview']);router[_0x7e80('0xc')](_0x7e80('0xf'),auth[_0x7e80('0x5')](),controller[_0x7e80('0x10')]);router[_0x7e80('0x11')](_0x7e80('0x9'),auth[_0x7e80('0x5')](),controller[_0x7e80('0x12')]);router[_0x7e80('0x13')](_0x7e80('0x9'),auth[_0x7e80('0x5')](),controller[_0x7e80('0x14')]);module[_0x7e80('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index 0731f95..2381f50 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 _0xf894=['STRING','DATE','format','INTEGER','moment','exports'];(function(_0x27e6c7,_0x3abcb2){var _0x6bd1a9=function(_0x6a1b5c){while(--_0x6a1b5c){_0x27e6c7['push'](_0x27e6c7['shift']());}};_0x6bd1a9(++_0x3abcb2);}(_0xf894,0x6a));var _0x4f89=function(_0x52bb7b,_0x197a4a){_0x52bb7b=_0x52bb7b-0x0;var _0x2d3c2e=_0xf894[_0x52bb7b];return _0x2d3c2e;};'use strict';var moment=require(_0x4f89('0x0'));var Sequelize=require('sequelize');module[_0x4f89('0x1')]={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize[_0x4f89('0x2')],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x4f89('0x3')],'defaultValue':moment()[_0x4f89('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x4f89('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x4f89('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x4f89('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x4f89('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x9498=['DATE','moment','sequelize','INTEGER','STRING'];(function(_0x5df4f7,_0x2e0f27){var _0x5a0db9=function(_0x2964f9){while(--_0x2964f9){_0x5df4f7['push'](_0x5df4f7['shift']());}};_0x5a0db9(++_0x2e0f27);}(_0x9498,0x15a));var _0x8949=function(_0x408b4f,_0x3ff4b9){_0x408b4f=_0x408b4f-0x0;var _0x253169=_0x9498[_0x408b4f];return _0x253169;};'use strict';var moment=require(_0x8949('0x0'));var Sequelize=require(_0x8949('0x1'));module['exports']={'CmHopperId':{'type':Sequelize[_0x8949('0x2')]},'phone':{'type':Sequelize[_0x8949('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x8949('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x8949('0x4')],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x8949('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x8949('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x8949('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x8949('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x8949('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index ca49f18..e5e0cb9 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 _0x8cb2=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','Content-Range','json','apply','reject','save','update','then','destroy','get','CmHopperAdditionalPhones','UserProfileResource','stack','name','send','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','merge','options','count','include','findAll','catch','params','length','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x178913,_0x3a4ce2){var _0x160d8e=function(_0x409c73){while(--_0x409c73){_0x178913['push'](_0x178913['shift']());}};_0x160d8e(++_0x3a4ce2);}(_0x8cb2,0x147));var _0x28cb=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x8cb2[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require(_0x28cb('0x0'));var rimraf=require(_0x28cb('0x1'));var zipdir=require(_0x28cb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x28cb('0x3'));var moment=require(_0x28cb('0x4'));var BPromise=require(_0x28cb('0x5'));var Mustache=require('mustache');var util=require(_0x28cb('0x6'));var path=require('path');var sox=require(_0x28cb('0x7'));var csv=require(_0x28cb('0x8'));var ejs=require(_0x28cb('0x9'));var fs=require('fs');var fs_extra=require(_0x28cb('0xa'));var _=require(_0x28cb('0xb'));var squel=require(_0x28cb('0xc'));var crypto=require(_0x28cb('0xd'));var jsforce=require(_0x28cb('0xe'));var deskjs=require(_0x28cb('0xf'));var toCsv=require('to-csv');var querystring=require(_0x28cb('0x10'));var Papa=require(_0x28cb('0x11'));var Redis=require(_0x28cb('0x12'));var authService=require(_0x28cb('0x13'));var qs=require(_0x28cb('0x14'));var as=require(_0x28cb('0x15'));var hardwareService=require(_0x28cb('0x16'));var logger=require('../../config/logger')(_0x28cb('0x17'));var utils=require(_0x28cb('0x18'));var config=require(_0x28cb('0x19'));var licenseUtil=require(_0x28cb('0x1a'));var db=require(_0x28cb('0x1b'))['db'];function respondWithStatusCode(_0x4433d9,_0x43c50c){_0x43c50c=_0x43c50c||0xcc;return function(_0x2ec68f){if(_0x2ec68f){return _0x4433d9[_0x28cb('0x1c')](_0x43c50c);}return _0x4433d9[_0x28cb('0x1d')](_0x43c50c)[_0x28cb('0x1e')]();};}function respondWithResult(_0x43f13e,_0x5a56ff){_0x5a56ff=_0x5a56ff||0xc8;return function(_0x5f3ee3){if(_0x5f3ee3){return _0x43f13e[_0x28cb('0x1d')](_0x5a56ff)['json'](_0x5f3ee3);}};}function respondWithFilteredResult(_0x5034fa,_0x2a024a){return function(_0x449a81){if(_0x449a81){var _0x345fdd=typeof _0x2a024a[_0x28cb('0x1f')]===_0x28cb('0x20')&&typeof _0x2a024a['limit']===_0x28cb('0x20');var _0x552334=_0x449a81['count'];var _0x5945e1=_0x345fdd?0x0:_0x2a024a[_0x28cb('0x1f')];var _0x2226d1=_0x345fdd?_0x449a81['count']:_0x2a024a['offset']+_0x2a024a[_0x28cb('0x21')];var _0x1c9fca;if(_0x2226d1>=_0x552334){_0x2226d1=_0x552334;_0x1c9fca=0xc8;}else{_0x1c9fca=0xce;}_0x5034fa[_0x28cb('0x1d')](_0x1c9fca);return _0x5034fa['set'](_0x28cb('0x22'),_0x5945e1+'-'+_0x2226d1+'/'+_0x552334)[_0x28cb('0x23')](_0x449a81);}return null;};}function patchUpdates(_0x3052e1){return function(_0x19e05a){try{jsonpatch[_0x28cb('0x24')](_0x19e05a,_0x3052e1,!![]);}catch(_0x57c661){return BPromise[_0x28cb('0x25')](_0x57c661);}return _0x19e05a[_0x28cb('0x26')]();};}function saveUpdates(_0x285fbd,_0x19f404){return function(_0x2187b4){if(_0x2187b4){return _0x2187b4[_0x28cb('0x27')](_0x285fbd)[_0x28cb('0x28')](function(_0x5e89b1){return _0x5e89b1;});}return null;};}function removeEntity(_0x213512,_0x1f366b){return function(_0x122dfd){if(_0x122dfd){return _0x122dfd[_0x28cb('0x29')]()['then'](function(){var _0x39dccb=_0x122dfd[_0x28cb('0x2a')]({'plain':!![]});var _0x295807=_0x28cb('0x2b');return db[_0x28cb('0x2c')][_0x28cb('0x29')]({'where':{'type':_0x295807,'resourceId':_0x39dccb['id']}})['then'](function(){return _0x122dfd;});})[_0x28cb('0x28')](function(){_0x213512['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x40fe94,_0x1e0302){return function(_0x15d38f){if(!_0x15d38f){_0x40fe94[_0x28cb('0x1c')](0x194);}return _0x15d38f;};}function handleError(_0xbf4628,_0x2338cb){_0x2338cb=_0x2338cb||0x1f4;return function(_0x1c97dd){logger['error'](_0x1c97dd[_0x28cb('0x2d')]);if(_0x1c97dd[_0x28cb('0x2e')]){delete _0x1c97dd['name'];}_0xbf4628[_0x28cb('0x1d')](_0x2338cb)[_0x28cb('0x2f')](_0x1c97dd);};}exports[_0x28cb('0x30')]=function(_0x3c7bed,_0x224180){var _0x203cba={},_0x3180ce={},_0x15cdc8={'count':0x0,'rows':[]};var _0x2627c2=_[_0x28cb('0x31')](db[_0x28cb('0x32')][_0x28cb('0x33')],function(_0x2196e9){return{'name':_0x2196e9[_0x28cb('0x34')],'type':_0x2196e9[_0x28cb('0x35')][_0x28cb('0x36')]};});_0x3180ce[_0x28cb('0x37')]=_['map'](_0x2627c2,_0x28cb('0x2e'));_0x3180ce[_0x28cb('0x38')]=_[_0x28cb('0x39')](_0x3c7bed[_0x28cb('0x38')]);_0x3180ce['filters']=_[_0x28cb('0x3a')](_0x3180ce[_0x28cb('0x37')],_0x3180ce['query']);_0x203cba[_0x28cb('0x3b')]=_[_0x28cb('0x3a')](_0x3180ce[_0x28cb('0x37')],qs['fields'](_0x3c7bed[_0x28cb('0x38')][_0x28cb('0x3c')]));_0x203cba['attributes']=_0x203cba[_0x28cb('0x3b')]['length']?_0x203cba['attributes']:_0x3180ce[_0x28cb('0x37')];if(!_0x3c7bed['query']['hasOwnProperty'](_0x28cb('0x3d'))){_0x203cba[_0x28cb('0x21')]=qs[_0x28cb('0x21')](_0x3c7bed[_0x28cb('0x38')][_0x28cb('0x21')]);_0x203cba[_0x28cb('0x1f')]=qs[_0x28cb('0x1f')](_0x3c7bed[_0x28cb('0x38')]['offset']);}_0x203cba[_0x28cb('0x3e')]=qs[_0x28cb('0x3f')](_0x3c7bed[_0x28cb('0x38')]['sort']);_0x203cba[_0x28cb('0x40')]=qs['filters'](_[_0x28cb('0x41')](_0x3c7bed['query'],_0x3180ce[_0x28cb('0x42')]),_0x2627c2);if(_0x3c7bed['query'][_0x28cb('0x43')]){_0x203cba['where']=_['merge'](_0x203cba[_0x28cb('0x40')],{'$or':_[_0x28cb('0x31')](_0x2627c2,function(_0x3ecb52){if(_0x3ecb52[_0x28cb('0x35')]!==_0x28cb('0x44')){var _0x213141={};_0x213141[_0x3ecb52[_0x28cb('0x2e')]]={'$like':'%'+_0x3c7bed[_0x28cb('0x38')][_0x28cb('0x43')]+'%'};return _0x213141;}})});}_0x203cba=_[_0x28cb('0x45')]({},_0x203cba,_0x3c7bed[_0x28cb('0x46')]);var _0x2e046a={'where':_0x203cba['where']};return db[_0x28cb('0x32')][_0x28cb('0x47')](_0x2e046a)['then'](function(_0x1dc195){_0x15cdc8[_0x28cb('0x47')]=_0x1dc195;if(_0x3c7bed[_0x28cb('0x38')]['includeAll']){_0x203cba[_0x28cb('0x48')]=[{'all':!![]}];}return db[_0x28cb('0x32')][_0x28cb('0x49')](_0x203cba);})[_0x28cb('0x28')](function(_0x4134ef){_0x15cdc8['rows']=_0x4134ef;return _0x15cdc8;})['then'](respondWithFilteredResult(_0x224180,_0x203cba))[_0x28cb('0x4a')](handleError(_0x224180,null));};exports['show']=function(_0x58cd92,_0x3272c0){var _0x1135c7={'raw':!![],'where':{'id':_0x58cd92[_0x28cb('0x4b')]['id']}},_0x34963a={};_0x34963a[_0x28cb('0x37')]=_['keys'](db[_0x28cb('0x32')][_0x28cb('0x33')]);_0x34963a[_0x28cb('0x38')]=_[_0x28cb('0x39')](_0x58cd92[_0x28cb('0x38')]);_0x34963a[_0x28cb('0x42')]=_[_0x28cb('0x3a')](_0x34963a[_0x28cb('0x37')],_0x34963a[_0x28cb('0x38')]);_0x1135c7[_0x28cb('0x3b')]=_[_0x28cb('0x3a')](_0x34963a[_0x28cb('0x37')],qs[_0x28cb('0x3c')](_0x58cd92[_0x28cb('0x38')][_0x28cb('0x3c')]));_0x1135c7[_0x28cb('0x3b')]=_0x1135c7['attributes'][_0x28cb('0x4c')]?_0x1135c7[_0x28cb('0x3b')]:_0x34963a[_0x28cb('0x37')];if(_0x58cd92[_0x28cb('0x38')][_0x28cb('0x4d')]){_0x1135c7[_0x28cb('0x48')]=[{'all':!![]}];}_0x1135c7=_[_0x28cb('0x45')]({},_0x1135c7,_0x58cd92[_0x28cb('0x46')]);return db[_0x28cb('0x32')]['find'](_0x1135c7)[_0x28cb('0x28')](handleEntityNotFound(_0x3272c0,null))[_0x28cb('0x28')](respondWithResult(_0x3272c0,null))[_0x28cb('0x4a')](handleError(_0x3272c0,null));};exports['create']=function(_0x286ea7,_0x1f94f9){return db[_0x28cb('0x32')][_0x28cb('0x4e')](_0x286ea7[_0x28cb('0x4f')],{})[_0x28cb('0x28')](function(_0x360ba6){var _0x361f78=_0x286ea7[_0x28cb('0x50')]['get']({'plain':!![]});if(!_0x361f78)throw new Error(_0x28cb('0x51'));if(_0x361f78[_0x28cb('0x52')]===_0x28cb('0x50')){var _0x514b54=_0x360ba6[_0x28cb('0x2a')]({'plain':!![]});var _0x4e59e8=_0x28cb('0x2b');return db['UserProfileSection'][_0x28cb('0x53')]({'where':{'name':_0x4e59e8,'userProfileId':_0x361f78['userProfileId']},'raw':!![]})[_0x28cb('0x28')](function(_0x58f1b7){if(_0x58f1b7&&_0x58f1b7['autoAssociation']===0x0){return db[_0x28cb('0x2c')]['create']({'name':_0x514b54[_0x28cb('0x2e')],'resourceId':_0x514b54['id'],'type':_0x58f1b7['name'],'sectionId':_0x58f1b7['id']},{})[_0x28cb('0x28')](function(){return _0x360ba6;});}else{return _0x360ba6;}})[_0x28cb('0x4a')](function(_0xcd049a){logger[_0x28cb('0x54')](_0x28cb('0x55'),_0xcd049a);throw _0xcd049a;});}return _0x360ba6;})[_0x28cb('0x28')](respondWithResult(_0x1f94f9,0xc9))['catch'](handleError(_0x1f94f9,null));};exports[_0x28cb('0x27')]=function(_0x1d4fa2,_0x24215e){if(_0x1d4fa2[_0x28cb('0x4f')]['id']){delete _0x1d4fa2[_0x28cb('0x4f')]['id'];}return db[_0x28cb('0x32')][_0x28cb('0x53')]({'where':{'id':_0x1d4fa2['params']['id']}})[_0x28cb('0x28')](handleEntityNotFound(_0x24215e,null))[_0x28cb('0x28')](saveUpdates(_0x1d4fa2[_0x28cb('0x4f')],null))['then'](respondWithResult(_0x24215e,null))[_0x28cb('0x4a')](handleError(_0x24215e,null));};exports[_0x28cb('0x29')]=function(_0x20f558,_0x2b93ea){return db[_0x28cb('0x32')][_0x28cb('0x53')]({'where':{'id':_0x20f558[_0x28cb('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2b93ea,null))[_0x28cb('0x28')](removeEntity(_0x2b93ea,null))[_0x28cb('0x4a')](handleError(_0x2b93ea,null));}; \ No newline at end of file +var _0x6053=['nolimit','sort','where','pick','filter','merge','options','CmHopperAdditionalPhone','includeAll','findAll','rows','catch','show','params','length','include','find','create','get','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','CmHopperAdditionalPhones','error','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty'];(function(_0xf34df,_0x4ad70e){var _0x34f558=function(_0x726b5e){while(--_0x726b5e){_0xf34df['push'](_0xf34df['shift']());}};_0x34f558(++_0x4ad70e);}(_0x6053,0x159));var _0x3605=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6053[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x3605('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3605('0x1'));var jsonpatch=require(_0x3605('0x2'));var rp=require(_0x3605('0x3'));var moment=require(_0x3605('0x4'));var BPromise=require(_0x3605('0x5'));var Mustache=require('mustache');var util=require(_0x3605('0x6'));var path=require(_0x3605('0x7'));var sox=require(_0x3605('0x8'));var csv=require('to-csv');var ejs=require(_0x3605('0x9'));var fs=require('fs');var fs_extra=require(_0x3605('0xa'));var _=require('lodash');var squel=require(_0x3605('0xb'));var crypto=require(_0x3605('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3605('0xd'));var toCsv=require(_0x3605('0xe'));var querystring=require('querystring');var Papa=require(_0x3605('0xf'));var Redis=require(_0x3605('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3605('0x11'));var as=require(_0x3605('0x12'));var hardwareService=require(_0x3605('0x13'));var logger=require(_0x3605('0x14'))(_0x3605('0x15'));var utils=require(_0x3605('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x3605('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xcf375,_0x497cf){_0x497cf=_0x497cf||0xcc;return function(_0x5e2a78){if(_0x5e2a78){return _0xcf375[_0x3605('0x18')](_0x497cf);}return _0xcf375[_0x3605('0x19')](_0x497cf)[_0x3605('0x1a')]();};}function respondWithResult(_0x5dee6f,_0x47debe){_0x47debe=_0x47debe||0xc8;return function(_0x1bc15c){if(_0x1bc15c){return _0x5dee6f[_0x3605('0x19')](_0x47debe)[_0x3605('0x1b')](_0x1bc15c);}};}function respondWithFilteredResult(_0x5ea431,_0x5016d2){return function(_0x136f9e){if(_0x136f9e){var _0x4bb825=typeof _0x5016d2[_0x3605('0x1c')]==='undefined'&&typeof _0x5016d2['limit']===_0x3605('0x1d');var _0x2bd1b2=_0x136f9e[_0x3605('0x1e')];var _0x3ac220=_0x4bb825?0x0:_0x5016d2[_0x3605('0x1c')];var _0x2468c3=_0x4bb825?_0x136f9e[_0x3605('0x1e')]:_0x5016d2[_0x3605('0x1c')]+_0x5016d2[_0x3605('0x1f')];var _0x203cb5;if(_0x2468c3>=_0x2bd1b2){_0x2468c3=_0x2bd1b2;_0x203cb5=0xc8;}else{_0x203cb5=0xce;}_0x5ea431[_0x3605('0x19')](_0x203cb5);return _0x5ea431[_0x3605('0x20')](_0x3605('0x21'),_0x3ac220+'-'+_0x2468c3+'/'+_0x2bd1b2)['json'](_0x136f9e);}return null;};}function patchUpdates(_0x3aed55){return function(_0x12ef74){try{jsonpatch[_0x3605('0x22')](_0x12ef74,_0x3aed55,!![]);}catch(_0x4ee022){return BPromise['reject'](_0x4ee022);}return _0x12ef74[_0x3605('0x23')]();};}function saveUpdates(_0x16cf25,_0x46327a){return function(_0x328525){if(_0x328525){return _0x328525[_0x3605('0x24')](_0x16cf25)[_0x3605('0x25')](function(_0x12b6ff){return _0x12b6ff;});}return null;};}function removeEntity(_0xd38a2d,_0x2d66f0){return function(_0x57111d){if(_0x57111d){return _0x57111d[_0x3605('0x26')]()[_0x3605('0x25')](function(){var _0x3e2efa=_0x57111d['get']({'plain':!![]});var _0x31d58b=_0x3605('0x27');return db['UserProfileResource'][_0x3605('0x26')]({'where':{'type':_0x31d58b,'resourceId':_0x3e2efa['id']}})[_0x3605('0x25')](function(){return _0x57111d;});})[_0x3605('0x25')](function(){_0xd38a2d[_0x3605('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x781f0b,_0x293f8e){return function(_0x257016){if(!_0x257016){_0x781f0b[_0x3605('0x18')](0x194);}return _0x257016;};}function handleError(_0x5542a9,_0x29ed44){_0x29ed44=_0x29ed44||0x1f4;return function(_0x43ebf2){logger[_0x3605('0x28')](_0x43ebf2['stack']);if(_0x43ebf2[_0x3605('0x29')]){delete _0x43ebf2['name'];}_0x5542a9[_0x3605('0x19')](_0x29ed44)['send'](_0x43ebf2);};}exports['index']=function(_0x229e91,_0x6e11b9){var _0x5bf8f5={},_0x1131e2={},_0x4f0530={'count':0x0,'rows':[]};var _0x42c3e4=_[_0x3605('0x2a')](db['CmHopperAdditionalPhone'][_0x3605('0x2b')],function(_0x329e59){return{'name':_0x329e59[_0x3605('0x2c')],'type':_0x329e59[_0x3605('0x2d')][_0x3605('0x2e')]};});_0x1131e2[_0x3605('0x2f')]=_[_0x3605('0x2a')](_0x42c3e4,_0x3605('0x29'));_0x1131e2[_0x3605('0x30')]=_[_0x3605('0x31')](_0x229e91[_0x3605('0x30')]);_0x1131e2[_0x3605('0x32')]=_['intersection'](_0x1131e2[_0x3605('0x2f')],_0x1131e2['query']);_0x5bf8f5[_0x3605('0x33')]=_[_0x3605('0x34')](_0x1131e2[_0x3605('0x2f')],qs[_0x3605('0x35')](_0x229e91['query'][_0x3605('0x35')]));_0x5bf8f5['attributes']=_0x5bf8f5[_0x3605('0x33')]['length']?_0x5bf8f5[_0x3605('0x33')]:_0x1131e2[_0x3605('0x2f')];if(!_0x229e91[_0x3605('0x30')][_0x3605('0x36')](_0x3605('0x37'))){_0x5bf8f5[_0x3605('0x1f')]=qs[_0x3605('0x1f')](_0x229e91[_0x3605('0x30')]['limit']);_0x5bf8f5['offset']=qs[_0x3605('0x1c')](_0x229e91[_0x3605('0x30')]['offset']);}_0x5bf8f5['order']=qs[_0x3605('0x38')](_0x229e91[_0x3605('0x30')]['sort']);_0x5bf8f5[_0x3605('0x39')]=qs[_0x3605('0x32')](_[_0x3605('0x3a')](_0x229e91[_0x3605('0x30')],_0x1131e2['filters']),_0x42c3e4);if(_0x229e91[_0x3605('0x30')][_0x3605('0x3b')]){_0x5bf8f5['where']=_[_0x3605('0x3c')](_0x5bf8f5[_0x3605('0x39')],{'$or':_[_0x3605('0x2a')](_0x42c3e4,function(_0x402be1){if(_0x402be1['type']!=='VIRTUAL'){var _0x57094b={};_0x57094b[_0x402be1[_0x3605('0x29')]]={'$like':'%'+_0x229e91[_0x3605('0x30')][_0x3605('0x3b')]+'%'};return _0x57094b;}})});}_0x5bf8f5=_[_0x3605('0x3c')]({},_0x5bf8f5,_0x229e91[_0x3605('0x3d')]);var _0xbf33fa={'where':_0x5bf8f5[_0x3605('0x39')]};return db[_0x3605('0x3e')][_0x3605('0x1e')](_0xbf33fa)[_0x3605('0x25')](function(_0x59766a){_0x4f0530[_0x3605('0x1e')]=_0x59766a;if(_0x229e91['query'][_0x3605('0x3f')]){_0x5bf8f5['include']=[{'all':!![]}];}return db[_0x3605('0x3e')][_0x3605('0x40')](_0x5bf8f5);})[_0x3605('0x25')](function(_0x285784){_0x4f0530[_0x3605('0x41')]=_0x285784;return _0x4f0530;})[_0x3605('0x25')](respondWithFilteredResult(_0x6e11b9,_0x5bf8f5))[_0x3605('0x42')](handleError(_0x6e11b9,null));};exports[_0x3605('0x43')]=function(_0x5095f1,_0x9c9b00){var _0x4fc905={'raw':!![],'where':{'id':_0x5095f1[_0x3605('0x44')]['id']}},_0x315498={};_0x315498['model']=_[_0x3605('0x31')](db[_0x3605('0x3e')][_0x3605('0x2b')]);_0x315498[_0x3605('0x30')]=_['keys'](_0x5095f1[_0x3605('0x30')]);_0x315498[_0x3605('0x32')]=_[_0x3605('0x34')](_0x315498[_0x3605('0x2f')],_0x315498[_0x3605('0x30')]);_0x4fc905['attributes']=_[_0x3605('0x34')](_0x315498['model'],qs[_0x3605('0x35')](_0x5095f1[_0x3605('0x30')][_0x3605('0x35')]));_0x4fc905[_0x3605('0x33')]=_0x4fc905[_0x3605('0x33')][_0x3605('0x45')]?_0x4fc905[_0x3605('0x33')]:_0x315498['model'];if(_0x5095f1[_0x3605('0x30')][_0x3605('0x3f')]){_0x4fc905[_0x3605('0x46')]=[{'all':!![]}];}_0x4fc905=_[_0x3605('0x3c')]({},_0x4fc905,_0x5095f1[_0x3605('0x3d')]);return db[_0x3605('0x3e')][_0x3605('0x47')](_0x4fc905)[_0x3605('0x25')](handleEntityNotFound(_0x9c9b00,null))[_0x3605('0x25')](respondWithResult(_0x9c9b00,null))[_0x3605('0x42')](handleError(_0x9c9b00,null));};exports[_0x3605('0x48')]=function(_0x3562df,_0x2e43e8){return db[_0x3605('0x3e')][_0x3605('0x48')](_0x3562df['body'],{})[_0x3605('0x25')](function(_0x3ff2c8){var _0x44908a=_0x3562df['user'][_0x3605('0x49')]({'plain':!![]});if(!_0x44908a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x44908a['role']===_0x3605('0x4a')){var _0x390d04=_0x3ff2c8['get']({'plain':!![]});var _0x4144f3=_0x3605('0x27');return db[_0x3605('0x4b')]['find']({'where':{'name':_0x4144f3,'userProfileId':_0x44908a['userProfileId']},'raw':!![]})[_0x3605('0x25')](function(_0x591a17){if(_0x591a17&&_0x591a17[_0x3605('0x4c')]===0x0){return db[_0x3605('0x4d')][_0x3605('0x48')]({'name':_0x390d04[_0x3605('0x29')],'resourceId':_0x390d04['id'],'type':_0x591a17[_0x3605('0x29')],'sectionId':_0x591a17['id']},{})[_0x3605('0x25')](function(){return _0x3ff2c8;});}else{return _0x3ff2c8;}})[_0x3605('0x42')](function(_0x506df3){logger['error'](_0x3605('0x4e'),_0x506df3);throw _0x506df3;});}return _0x3ff2c8;})[_0x3605('0x25')](respondWithResult(_0x2e43e8,0xc9))[_0x3605('0x42')](handleError(_0x2e43e8,null));};exports[_0x3605('0x24')]=function(_0x1d22da,_0x376ae2){if(_0x1d22da[_0x3605('0x4f')]['id']){delete _0x1d22da[_0x3605('0x4f')]['id'];}return db[_0x3605('0x3e')][_0x3605('0x47')]({'where':{'id':_0x1d22da[_0x3605('0x44')]['id']}})[_0x3605('0x25')](handleEntityNotFound(_0x376ae2,null))[_0x3605('0x25')](saveUpdates(_0x1d22da[_0x3605('0x4f')],null))['then'](respondWithResult(_0x376ae2,null))['catch'](handleError(_0x376ae2,null));};exports[_0x3605('0x26')]=function(_0x5a27e4,_0x5dd4b1){return db[_0x3605('0x3e')]['find']({'where':{'id':_0x5a27e4[_0x3605('0x44')]['id']}})[_0x3605('0x25')](handleEntityNotFound(_0x5dd4b1,null))[_0x3605('0x25')](removeEntity(_0x5dd4b1,null))['catch'](handleError(_0x5dd4b1,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 29890a4..29fa78e 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 _0x4720=['request-promise','path','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','exports','define','CmHopperAdditionalPhone','../../config/logger','api','moment','bluebird'];(function(_0x1b23e7,_0x44e9a0){var _0x52c72b=function(_0x1ad83f){while(--_0x1ad83f){_0x1b23e7['push'](_0x1b23e7['shift']());}};_0x52c72b(++_0x44e9a0);}(_0x4720,0x164));var _0x0472=function(_0x4e7844,_0x30ce77){_0x4e7844=_0x4e7844-0x0;var _0x336119=_0x4720[_0x4e7844];return _0x336119;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0472('0x0'))(_0x0472('0x1'));var moment=require(_0x0472('0x2'));var BPromise=require(_0x0472('0x3'));var rp=require(_0x0472('0x4'));var fs=require('fs');var path=require(_0x0472('0x5'));var rimraf=require(_0x0472('0x6'));var config=require(_0x0472('0x7'));var attributes=require(_0x0472('0x8'));module[_0x0472('0x9')]=function(_0x4e49a1,_0x199f62){return _0x4e49a1[_0x0472('0xa')](_0x0472('0xb'),attributes,{'tableName':'cm_hopper_additional_phones','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7968=['bluebird','path','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','util','../../config/logger','api','moment'];(function(_0x575984,_0x3e5f51){var _0x35fe09=function(_0x6be83b){while(--_0x6be83b){_0x575984['push'](_0x575984['shift']());}};_0x35fe09(++_0x3e5f51);}(_0x7968,0x105));var _0x8796=function(_0x231a60,_0x2341f7){_0x231a60=_0x231a60-0x0;var _0xb46695=_0x7968[_0x231a60];return _0xb46695;};'use strict';var _=require(_0x8796('0x0'));var util=require(_0x8796('0x1'));var logger=require(_0x8796('0x2'))(_0x8796('0x3'));var moment=require(_0x8796('0x4'));var BPromise=require(_0x8796('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8796('0x6'));var rimraf=require(_0x8796('0x7'));var config=require(_0x8796('0x8'));var attributes=require(_0x8796('0x9'));module[_0x8796('0xa')]=function(_0x2c191,_0x552f6c){return _0x2c191[_0x8796('0xb')](_0x8796('0xc'),attributes,{'tableName':_0x8796('0xd'),'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 b8c430d..b3026df 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 _0x18a1=['message','info','result','catch','findOne','body','ListId','VoiceQueueId','CampaignId','OrderBy','ASC','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','CmHopperAdditionalPhone','entity','VerifyAdditionalPhones','SwapAdditionalPhones','CmHopper','ContactId','waitTime','duration','isNil','scheduledat','add','minutes','updatedAt','phone','createdAt','sequelize','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','field','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','error','code','CmHopperAdditionalPhone,\x20%s,\x20%s'];(function(_0x309d92,_0x37bcd3){var _0x46f3de=function(_0x3dabe4){while(--_0x3dabe4){_0x309d92['push'](_0x309d92['shift']());}};_0x46f3de(++_0x37bcd3);}(_0x18a1,0x191));var _0x118a=function(_0x541151,_0x40a019){_0x541151=_0x541151-0x0;var _0x13e4e8=_0x18a1[_0x541151];return _0x13e4e8;};'use strict';var _=require(_0x118a('0x0'));var util=require(_0x118a('0x1'));var moment=require('moment');var BPromise=require(_0x118a('0x2'));var rs=require(_0x118a('0x3'));var fs=require('fs');var Redis=require(_0x118a('0x4'));var db=require(_0x118a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x118a('0x6'))(_0x118a('0x7'));var config=require(_0x118a('0x8'));var jayson=require(_0x118a('0x9'));var client=jayson[_0x118a('0xa')][_0x118a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x20126c,_0x1ecb86,_0x3884b7){return new BPromise(function(_0x41d84f,_0x4412f4){return client[_0x118a('0xc')](_0x20126c,_0x3884b7)[_0x118a('0xd')](function(_0x5b0420){logger['info']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x1ecb86,_0x118a('0xe'));logger['debug'](_0x118a('0xf'),_0x1ecb86,'request\x20sent',JSON['stringify'](_0x5b0420));if(_0x5b0420['error']){if(_0x5b0420[_0x118a('0x10')][_0x118a('0x11')]===0x1f4){logger[_0x118a('0x10')](_0x118a('0x12'),_0x1ecb86,_0x5b0420[_0x118a('0x10')][_0x118a('0x13')]);return _0x4412f4(_0x5b0420[_0x118a('0x10')][_0x118a('0x13')]);}logger[_0x118a('0x10')](_0x118a('0x12'),_0x1ecb86,_0x5b0420[_0x118a('0x10')]['message']);return _0x41d84f(_0x5b0420[_0x118a('0x10')]['message']);}else{logger[_0x118a('0x14')](_0x118a('0x12'),_0x1ecb86,'request\x20sent');_0x41d84f(_0x5b0420[_0x118a('0x15')]['message']);}})[_0x118a('0x16')](function(_0x707d94){logger[_0x118a('0x10')](_0x118a('0x12'),_0x1ecb86,_0x707d94);_0x4412f4(_0x707d94);});});}exports['VerifyAdditionalPhones']=function(_0x12ede3){var _0x231cdc=this;return new Promise(function(_0x3eec08,_0x56e6fc){return db['CmHopper'][_0x118a('0x17')]({'raw':!![],'where':{'ContactId':_0x12ede3['body']['ContactId'],'ListId':_0x12ede3[_0x118a('0x18')][_0x118a('0x19')],'VoiceQueueId':_0x12ede3[_0x118a('0x18')][_0x118a('0x1a')]===undefined?null:_0x12ede3[_0x118a('0x18')][_0x118a('0x1a')],'CampaignId':_0x12ede3['body'][_0x118a('0x1b')]===undefined?null:_0x12ede3[_0x118a('0x18')][_0x118a('0x1b')]}})[_0x118a('0xd')](function(_0x4811ce){if(_0x4811ce!=null){return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x4811ce['id'],'OrderBy':{'$gt':_0x4811ce['OrderBy']}},'order':[[_0x118a('0x1c'),_0x118a('0x1d')]]})[_0x118a('0xd')](function(_0x3b582d){var _0x135ffc=0x0;if(_0x3b582d){if(_0x3b582d[_0x118a('0x1e')]+_0x3b582d[_0x118a('0x1f')]+_0x3b582d[_0x118a('0x20')]+_0x3b582d[_0x118a('0x21')]+_0x3b582d[_0x118a('0x22')]+_0x3b582d[_0x118a('0x23')]+_0x3b582d[_0x118a('0x24')]+_0x3b582d[_0x118a('0x25')]<_0x12ede3['entity'][_0x118a('0x26')])_0x135ffc=0x1;_0x3eec08({'additional':_0x135ffc});}else{return db[_0x118a('0x27')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x4811ce['id']},'order':[[_0x118a('0x1c'),_0x118a('0x1d')]]})[_0x118a('0xd')](function(_0x5eea19){var _0x1109b9=0x0;if(_0x5eea19){if(_0x5eea19[_0x118a('0x1e')]+_0x5eea19['countcongestionretry']+_0x5eea19[_0x118a('0x20')]+_0x5eea19[_0x118a('0x21')]+_0x5eea19[_0x118a('0x22')]+_0x5eea19[_0x118a('0x23')]+_0x5eea19[_0x118a('0x24')]+_0x5eea19[_0x118a('0x25')]<_0x12ede3[_0x118a('0x28')][_0x118a('0x26')])_0x1109b9=0x1;_0x3eec08({'additional':_0x1109b9});}else{_0x3eec08({'additional':0x0});}})[_0x118a('0x16')](function(_0x3468b9){logger[_0x118a('0x10')](_0x118a('0x29'),_0x3468b9[_0x118a('0x13')]);_0x56e6fc(_0x231cdc[_0x118a('0x10')](0x1f4,_0x3468b9['message']));});}})[_0x118a('0x16')](function(_0x4fcd89){logger['error'](_0x118a('0x29'),_0x4fcd89[_0x118a('0x13')]);_0x56e6fc(_0x231cdc[_0x118a('0x10')](0x1f4,_0x4fcd89[_0x118a('0x13')]));});}else _0x3eec08({'additional':0x0});});});};exports[_0x118a('0x2a')]=function(_0x37090e){var _0xa6c384=this;return new Promise(function(_0x14e6b4,_0x2dd10b){return db[_0x118a('0x2b')]['findOne']({'raw':!![],'where':{'ContactId':_0x37090e[_0x118a('0x18')][_0x118a('0x2c')],'ListId':_0x37090e[_0x118a('0x18')][_0x118a('0x19')],'VoiceQueueId':_0x37090e['body'][_0x118a('0x1a')]===undefined?null:_0x37090e[_0x118a('0x18')][_0x118a('0x1a')],'CampaignId':_0x37090e[_0x118a('0x18')]['CampaignId']===undefined?null:_0x37090e[_0x118a('0x18')][_0x118a('0x1b')]}})[_0x118a('0xd')](function(_0x445898){if(_0x445898!=null){return db['CmHopperAdditionalPhone'][_0x118a('0x17')]({'raw':!![],'where':{'CmHopperId':_0x445898['id'],'OrderBy':{'$gte':_0x445898[_0x118a('0x1c')]}},'order':[[_0x118a('0x1c'),_0x118a('0x1d')]]})[_0x118a('0xd')](function(_0x57d339){if(_0x57d339)return activateAdditionalPhone(_0x445898,_0x37090e['body'],_0x57d339,_0x37090e['duration'],_0x37090e[_0x118a('0x2d')])[_0x118a('0xd')](function(_0x15f7f5){_0x14e6b4(_0x15f7f5);});else{return db['CmHopperAdditionalPhone'][_0x118a('0x17')]({'raw':!![],'where':{'CmHopperId':_0x445898['id']},'order':[[_0x118a('0x1c'),_0x118a('0x1d')]]})[_0x118a('0xd')](function(_0x543127){if(_0x543127)return activateAdditionalPhone(_0x445898,_0x37090e[_0x118a('0x18')],_0x543127,_0x37090e[_0x118a('0x2e')],_0x37090e[_0x118a('0x2d')])[_0x118a('0xd')](function(_0x2de6a5){_0x14e6b4(_0x2de6a5);});else{_0x14e6b4({'id':_0x445898['id'],'phone':''});}})[_0x118a('0x16')](function(_0x3be1c3){logger[_0x118a('0x10')]('VerifyAdditionalPhones',_0x3be1c3[_0x118a('0x13')]);_0x2dd10b(_0xa6c384[_0x118a('0x10')](0x1f4,_0x3be1c3[_0x118a('0x13')]));});}})[_0x118a('0x16')](function(_0x257fc5){logger[_0x118a('0x10')](_0x118a('0x29'),_0x257fc5[_0x118a('0x13')]);_0x2dd10b(_0xa6c384['error'](0x1f4,_0x257fc5['message']));});}else _0x14e6b4(0x1);});});};function activateAdditionalPhone(_0x242e75,_0x5ac83e,_0x26085b,_0x3313b4,_0x27ac7e){return new Promise(function(_0x475330,_0x4b6a60){var _0x45eed1;if(_[_0x118a('0x2f')](_0x26085b[_0x118a('0x30')])){_0x26085b[_0x118a('0x30')]=moment();}if(moment()>moment(_0x26085b[_0x118a('0x30')])){_0x45eed1=moment()[_0x118a('0x31')](_0x27ac7e||0x3,_0x118a('0x32'));}else{if(_0x26085b[_0x118a('0x1c')]==0x0){_0x45eed1=moment(_0x26085b['scheduledat']);}else{_0x45eed1=moment()[_0x118a('0x31')](_0x27ac7e||0x3,_0x118a('0x32'));}}if(_['isNil'](_0x45eed1)){_0x45eed1=moment()[_0x118a('0x31')](_0x27ac7e||0x3,'minutes');}var _0x1bdf73={'phone':_0x242e75['phone'],'active':0x0,'OrderBy':_[_0x118a('0x2f')](_0x242e75[_0x118a('0x1c')])?0x0:_0x242e75[_0x118a('0x1c')],'scheduledat':moment()[_0x118a('0x31')](_0x3313b4||0x1,_0x118a('0x32')),'countbusyretry':_0x5ac83e[_0x118a('0x1e')],'countcongestionretry':_0x5ac83e['countcongestionretry'],'countnoanswerretry':_0x5ac83e[_0x118a('0x20')],'countnosuchnumberretry':_0x5ac83e[_0x118a('0x21')],'countdropretry':_0x5ac83e[_0x118a('0x22')],'countabandonedretry':_0x5ac83e[_0x118a('0x23')],'countmachineretry':_0x5ac83e['countmachineretry'],'countagentrejectretry':_0x5ac83e[_0x118a('0x25')],'createdAt':_0x5ac83e['createdAt'],'updatedAt':_0x5ac83e[_0x118a('0x33')]};var _0x456527={'CmHopperId':_0x242e75['id'],'phone':_0x26085b[_0x118a('0x34')],'active':0x0,'OrderBy':_[_0x118a('0x2f')](_0x26085b['OrderBy'])?0x0:_0x26085b[_0x118a('0x1c')],'scheduledat':_0x45eed1,'countbusyretry':_0x26085b[_0x118a('0x1e')],'countcongestionretry':_0x26085b[_0x118a('0x1f')],'countnoanswerretry':_0x26085b[_0x118a('0x20')],'countnosuchnumberretry':_0x26085b['countnosuchnumberretry'],'countdropretry':_0x26085b[_0x118a('0x22')],'countabandonedretry':_0x26085b[_0x118a('0x23')],'countmachineretry':_0x26085b[_0x118a('0x24')],'countagentrejectretry':_0x26085b['countagentrejectretry'],'createdAt':_0x26085b[_0x118a('0x35')],'updatedAt':_0x26085b[_0x118a('0x33')]};return db[_0x118a('0x36')][_0x118a('0x37')](function(_0x486a14){return db[_0x118a('0x27')][_0x118a('0x38')](_0x1bdf73,{'where':{'id':_0x26085b['id']}},{'transaction':_0x486a14})[_0x118a('0xd')](function(){return db[_0x118a('0x2b')][_0x118a('0x38')](_0x456527,{'where':{'id':_0x242e75['id']}},{'transaction':_0x486a14});});})[_0x118a('0xd')](function(_0x11d1d5){_0x475330({'id':_0x242e75['id'],'phone':_0x26085b[_0x118a('0x34')]});})[_0x118a('0x16')](function(_0x3fcd59){logger[_0x118a('0x10')](_0x118a('0x39'),_0x3fcd59[_0x118a('0x13')]);_0x4b6a60({'error':_0x3fcd59['message']});});});}exports[_0x118a('0x3a')]=function(_0x230dd5){var _0x1e2142=this;return new Promise(function(_0x4e74f1,_0x274c5f){return db[_0x118a('0x2b')][_0x118a('0x38')](_0x230dd5[_0x118a('0x18')][_0x118a('0x3b')],{'where':{'id':_0x230dd5[_0x118a('0x18')]['id']}})[_0x118a('0xd')](function(_0x2d8396){_0x4e74f1(_0x2d8396);})[_0x118a('0x16')](function(_0x50ca84){logger['error'](_0x118a('0x3a'),_0x50ca84[_0x118a('0x13')]);_0x274c5f(_0x1e2142[_0x118a('0x10')](0x1f4,_0x50ca84['message']));});});}; \ No newline at end of file +var _0x9551=['isNil','scheduledat','minutes','add','phone','updatedAt','createdAt','update','activateAdditionalPhone','IncrementPreviewCounters','field','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','error','code','CmHopperAdditionalPhone,\x20%s,\x20%s','message','info','result','catch','VerifyAdditionalPhones','CmHopper','findOne','body','ListId','VoiceQueueId','CmHopperAdditionalPhone','OrderBy','ASC','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','countnosuchnumberretry','SwapAdditionalPhones','ContactId','duration','waitTime'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x9551,0x11e));var _0x1955=function(_0x5c59e9,_0x253541){_0x5c59e9=_0x5c59e9-0x0;var _0x56b0b3=_0x9551[_0x5c59e9];return _0x56b0b3;};'use strict';var _=require(_0x1955('0x0'));var util=require('util');var moment=require(_0x1955('0x1'));var BPromise=require(_0x1955('0x2'));var rs=require(_0x1955('0x3'));var fs=require('fs');var Redis=require(_0x1955('0x4'));var db=require(_0x1955('0x5'))['db'];var utils=require(_0x1955('0x6'));var logger=require(_0x1955('0x7'))(_0x1955('0x8'));var config=require('../../config/environment');var jayson=require(_0x1955('0x9'));var client=jayson[_0x1955('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd58a63,_0x193fa8,_0x24c4a2){return new BPromise(function(_0x193f3e,_0xc8c8b9){return client['request'](_0xd58a63,_0x24c4a2)[_0x1955('0xb')](function(_0x5cea4e){logger['info']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x193fa8,_0x1955('0xc'));logger[_0x1955('0xd')](_0x1955('0xe'),_0x193fa8,'request\x20sent',JSON['stringify'](_0x5cea4e));if(_0x5cea4e[_0x1955('0xf')]){if(_0x5cea4e[_0x1955('0xf')][_0x1955('0x10')]===0x1f4){logger['error'](_0x1955('0x11'),_0x193fa8,_0x5cea4e[_0x1955('0xf')][_0x1955('0x12')]);return _0xc8c8b9(_0x5cea4e[_0x1955('0xf')]['message']);}logger[_0x1955('0xf')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x193fa8,_0x5cea4e[_0x1955('0xf')][_0x1955('0x12')]);return _0x193f3e(_0x5cea4e[_0x1955('0xf')][_0x1955('0x12')]);}else{logger[_0x1955('0x13')](_0x1955('0x11'),_0x193fa8,'request\x20sent');_0x193f3e(_0x5cea4e[_0x1955('0x14')]['message']);}})[_0x1955('0x15')](function(_0xd5a5db){logger[_0x1955('0xf')](_0x1955('0x11'),_0x193fa8,_0xd5a5db);_0xc8c8b9(_0xd5a5db);});});}exports[_0x1955('0x16')]=function(_0x7ab25b){var _0xb7af8c=this;return new Promise(function(_0x47ddd0,_0x1ac69e){return db[_0x1955('0x17')][_0x1955('0x18')]({'raw':!![],'where':{'ContactId':_0x7ab25b['body']['ContactId'],'ListId':_0x7ab25b[_0x1955('0x19')][_0x1955('0x1a')],'VoiceQueueId':_0x7ab25b[_0x1955('0x19')]['VoiceQueueId']===undefined?null:_0x7ab25b[_0x1955('0x19')][_0x1955('0x1b')],'CampaignId':_0x7ab25b[_0x1955('0x19')]['CampaignId']===undefined?null:_0x7ab25b[_0x1955('0x19')]['CampaignId']}})[_0x1955('0xb')](function(_0x74c244){if(_0x74c244!=null){return db[_0x1955('0x1c')][_0x1955('0x18')]({'raw':!![],'where':{'CmHopperId':_0x74c244['id'],'OrderBy':{'$gt':_0x74c244['OrderBy']}},'order':[[_0x1955('0x1d'),_0x1955('0x1e')]]})['then'](function(_0x581ac0){var _0x2bd21f=0x0;if(_0x581ac0){if(_0x581ac0[_0x1955('0x1f')]+_0x581ac0[_0x1955('0x20')]+_0x581ac0[_0x1955('0x21')]+_0x581ac0['countnosuchnumberretry']+_0x581ac0[_0x1955('0x22')]+_0x581ac0[_0x1955('0x23')]+_0x581ac0[_0x1955('0x24')]+_0x581ac0[_0x1955('0x25')]<_0x7ab25b['entity'][_0x1955('0x26')])_0x2bd21f=0x1;_0x47ddd0({'additional':_0x2bd21f});}else{return db['CmHopperAdditionalPhone'][_0x1955('0x18')]({'raw':!![],'where':{'CmHopperId':_0x74c244['id']},'order':[[_0x1955('0x1d'),_0x1955('0x1e')]]})[_0x1955('0xb')](function(_0x48bb84){var _0x537a1f=0x0;if(_0x48bb84){if(_0x48bb84[_0x1955('0x1f')]+_0x48bb84[_0x1955('0x20')]+_0x48bb84[_0x1955('0x21')]+_0x48bb84[_0x1955('0x27')]+_0x48bb84[_0x1955('0x22')]+_0x48bb84[_0x1955('0x23')]+_0x48bb84[_0x1955('0x24')]+_0x48bb84['countagentrejectretry']<_0x7ab25b['entity'][_0x1955('0x26')])_0x537a1f=0x1;_0x47ddd0({'additional':_0x537a1f});}else{_0x47ddd0({'additional':0x0});}})[_0x1955('0x15')](function(_0x5b39b7){logger[_0x1955('0xf')](_0x1955('0x16'),_0x5b39b7[_0x1955('0x12')]);_0x1ac69e(_0xb7af8c[_0x1955('0xf')](0x1f4,_0x5b39b7[_0x1955('0x12')]));});}})['catch'](function(_0x2a2474){logger[_0x1955('0xf')](_0x1955('0x16'),_0x2a2474[_0x1955('0x12')]);_0x1ac69e(_0xb7af8c[_0x1955('0xf')](0x1f4,_0x2a2474['message']));});}else _0x47ddd0({'additional':0x0});});});};exports[_0x1955('0x28')]=function(_0x3b1611){var _0xe10706=this;return new Promise(function(_0xc0b34d,_0x55222c){return db[_0x1955('0x17')][_0x1955('0x18')]({'raw':!![],'where':{'ContactId':_0x3b1611[_0x1955('0x19')][_0x1955('0x29')],'ListId':_0x3b1611['body'][_0x1955('0x1a')],'VoiceQueueId':_0x3b1611['body'][_0x1955('0x1b')]===undefined?null:_0x3b1611[_0x1955('0x19')][_0x1955('0x1b')],'CampaignId':_0x3b1611[_0x1955('0x19')]['CampaignId']===undefined?null:_0x3b1611['body']['CampaignId']}})['then'](function(_0x5c1f75){if(_0x5c1f75!=null){return db[_0x1955('0x1c')][_0x1955('0x18')]({'raw':!![],'where':{'CmHopperId':_0x5c1f75['id'],'OrderBy':{'$gte':_0x5c1f75[_0x1955('0x1d')]}},'order':[[_0x1955('0x1d'),'ASC']]})[_0x1955('0xb')](function(_0x4ac8a5){if(_0x4ac8a5)return activateAdditionalPhone(_0x5c1f75,_0x3b1611['body'],_0x4ac8a5,_0x3b1611[_0x1955('0x2a')],_0x3b1611[_0x1955('0x2b')])[_0x1955('0xb')](function(_0x4db0ba){_0xc0b34d(_0x4db0ba);});else{return db[_0x1955('0x1c')][_0x1955('0x18')]({'raw':!![],'where':{'CmHopperId':_0x5c1f75['id']},'order':[[_0x1955('0x1d'),_0x1955('0x1e')]]})['then'](function(_0x49f4cc){if(_0x49f4cc)return activateAdditionalPhone(_0x5c1f75,_0x3b1611[_0x1955('0x19')],_0x49f4cc,_0x3b1611[_0x1955('0x2a')],_0x3b1611[_0x1955('0x2b')])[_0x1955('0xb')](function(_0xf26c9b){_0xc0b34d(_0xf26c9b);});else{_0xc0b34d({'id':_0x5c1f75['id'],'phone':''});}})[_0x1955('0x15')](function(_0x2cb215){logger['error'](_0x1955('0x16'),_0x2cb215[_0x1955('0x12')]);_0x55222c(_0xe10706[_0x1955('0xf')](0x1f4,_0x2cb215[_0x1955('0x12')]));});}})[_0x1955('0x15')](function(_0x182e87){logger[_0x1955('0xf')](_0x1955('0x16'),_0x182e87[_0x1955('0x12')]);_0x55222c(_0xe10706[_0x1955('0xf')](0x1f4,_0x182e87[_0x1955('0x12')]));});}else _0xc0b34d(0x1);});});};function activateAdditionalPhone(_0x332f8e,_0x510b25,_0x36a530,_0x28b47c,_0x3fd176){return new Promise(function(_0x430b00,_0x1c4101){var _0x43e197;if(_[_0x1955('0x2c')](_0x36a530[_0x1955('0x2d')])){_0x36a530[_0x1955('0x2d')]=moment();}if(moment()>moment(_0x36a530[_0x1955('0x2d')])){_0x43e197=moment()['add'](_0x3fd176||0x3,'minutes');}else{if(_0x36a530['OrderBy']==0x0){_0x43e197=moment(_0x36a530[_0x1955('0x2d')]);}else{_0x43e197=moment()['add'](_0x3fd176||0x3,_0x1955('0x2e'));}}if(_[_0x1955('0x2c')](_0x43e197)){_0x43e197=moment()[_0x1955('0x2f')](_0x3fd176||0x3,_0x1955('0x2e'));}var _0x3753b3={'phone':_0x332f8e[_0x1955('0x30')],'active':0x0,'OrderBy':_[_0x1955('0x2c')](_0x332f8e[_0x1955('0x1d')])?0x0:_0x332f8e[_0x1955('0x1d')],'scheduledat':moment()[_0x1955('0x2f')](_0x28b47c||0x1,_0x1955('0x2e')),'countbusyretry':_0x510b25[_0x1955('0x1f')],'countcongestionretry':_0x510b25[_0x1955('0x20')],'countnoanswerretry':_0x510b25['countnoanswerretry'],'countnosuchnumberretry':_0x510b25[_0x1955('0x27')],'countdropretry':_0x510b25[_0x1955('0x22')],'countabandonedretry':_0x510b25['countabandonedretry'],'countmachineretry':_0x510b25['countmachineretry'],'countagentrejectretry':_0x510b25[_0x1955('0x25')],'createdAt':_0x510b25['createdAt'],'updatedAt':_0x510b25[_0x1955('0x31')]};var _0x395e94={'CmHopperId':_0x332f8e['id'],'phone':_0x36a530[_0x1955('0x30')],'active':0x0,'OrderBy':_['isNil'](_0x36a530[_0x1955('0x1d')])?0x0:_0x36a530[_0x1955('0x1d')],'scheduledat':_0x43e197,'countbusyretry':_0x36a530[_0x1955('0x1f')],'countcongestionretry':_0x36a530[_0x1955('0x20')],'countnoanswerretry':_0x36a530['countnoanswerretry'],'countnosuchnumberretry':_0x36a530[_0x1955('0x27')],'countdropretry':_0x36a530['countdropretry'],'countabandonedretry':_0x36a530[_0x1955('0x23')],'countmachineretry':_0x36a530[_0x1955('0x24')],'countagentrejectretry':_0x36a530[_0x1955('0x25')],'createdAt':_0x36a530[_0x1955('0x32')],'updatedAt':_0x36a530[_0x1955('0x31')]};return db['sequelize']['transaction'](function(_0x1b0dac){return db[_0x1955('0x1c')][_0x1955('0x33')](_0x3753b3,{'where':{'id':_0x36a530['id']}},{'transaction':_0x1b0dac})[_0x1955('0xb')](function(){return db[_0x1955('0x17')][_0x1955('0x33')](_0x395e94,{'where':{'id':_0x332f8e['id']}},{'transaction':_0x1b0dac});});})['then'](function(_0x5deff6){_0x430b00({'id':_0x332f8e['id'],'phone':_0x36a530[_0x1955('0x30')]});})[_0x1955('0x15')](function(_0x4bde70){logger[_0x1955('0xf')](_0x1955('0x34'),_0x4bde70[_0x1955('0x12')]);_0x1c4101({'error':_0x4bde70[_0x1955('0x12')]});});});}exports[_0x1955('0x35')]=function(_0x49d0fe){var _0x4437cd=this;return new Promise(function(_0x45c5ba,_0x56c28f){return db[_0x1955('0x17')][_0x1955('0x33')](_0x49d0fe[_0x1955('0x19')][_0x1955('0x36')],{'where':{'id':_0x49d0fe[_0x1955('0x19')]['id']}})[_0x1955('0xb')](function(_0x3fb1fa){_0x45c5ba(_0x3fb1fa);})[_0x1955('0x15')](function(_0x1b55c7){logger[_0x1955('0xf')](_0x1955('0x35'),_0x1b55c7[_0x1955('0x12')]);_0x56c28f(_0x4437cd['error'](0x1f4,_0x1b55c7[_0x1955('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index d075a72..d500f4e 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 _0xbfcf=['create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperAdditionalPhone.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x12ce92,_0x3dfd4e){var _0x5902be=function(_0x11dc08){while(--_0x11dc08){_0x12ce92['push'](_0x12ce92['shift']());}};_0x5902be(++_0x3dfd4e);}(_0xbfcf,0x1a9));var _0xfbfc=function(_0x5d860f,_0x467498){_0x5d860f=_0x5d860f-0x0;var _0x236490=_0xbfcf[_0x5d860f];return _0x236490;};'use strict';var multer=require(_0xfbfc('0x0'));var util=require(_0xfbfc('0x1'));var path=require(_0xfbfc('0x2'));var timeout=require(_0xfbfc('0x3'));var express=require(_0xfbfc('0x4'));var router=express['Router']();var fs_extra=require(_0xfbfc('0x5'));var auth=require(_0xfbfc('0x6'));var interaction=require(_0xfbfc('0x7'));var config=require('../../config/environment');var controller=require(_0xfbfc('0x8'));router[_0xfbfc('0x9')]('/',auth[_0xfbfc('0xa')](),controller[_0xfbfc('0xb')]);router[_0xfbfc('0x9')](_0xfbfc('0xc'),auth[_0xfbfc('0xa')](),controller[_0xfbfc('0xd')]);router[_0xfbfc('0xe')]('/',auth['isAuthenticated'](),controller[_0xfbfc('0xf')]);router['put']('/:id',auth[_0xfbfc('0xa')](),controller[_0xfbfc('0x10')]);router[_0xfbfc('0x11')]('/:id',auth[_0xfbfc('0xa')](),controller[_0xfbfc('0x12')]);module[_0xfbfc('0x13')]=router; \ No newline at end of file +var _0x7f44=['../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x7f44,0xa6));var _0x47f4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7f44[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x47f4('0x0'));var path=require(_0x47f4('0x1'));var timeout=require(_0x47f4('0x2'));var express=require(_0x47f4('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x47f4('0x4'));var interaction=require(_0x47f4('0x5'));var config=require('../../config/environment');var controller=require('./cmHopperAdditionalPhone.controller');router[_0x47f4('0x6')]('/',auth['isAuthenticated'](),controller[_0x47f4('0x7')]);router[_0x47f4('0x6')](_0x47f4('0x8'),auth[_0x47f4('0x9')](),controller[_0x47f4('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x47f4('0xb')]);router[_0x47f4('0xc')](_0x47f4('0x8'),auth[_0x47f4('0x9')](),controller[_0x47f4('0xd')]);router[_0x47f4('0xe')](_0x47f4('0x8'),auth[_0x47f4('0x9')](),controller[_0x47f4('0xf')]);module[_0x47f4('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 32f2f3b..0184c80 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 _0xddd2=['INTEGER','contactListQueue','moment','exports'];(function(_0xa5e609,_0x4b28a4){var _0x42d910=function(_0x1ff139){while(--_0x1ff139){_0xa5e609['push'](_0xa5e609['shift']());}};_0x42d910(++_0x4b28a4);}(_0xddd2,0x1e2));var _0x2ddd=function(_0x20cd72,_0x2a6055){_0x20cd72=_0x20cd72-0x0;var _0x378cb3=_0xddd2[_0x20cd72];return _0x378cb3;};'use strict';var moment=require(_0x2ddd('0x0'));var Sequelize=require('sequelize');module[_0x2ddd('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x2ddd('0x2')],'unique':_0x2ddd('0x3')},'ListId':{'type':Sequelize[_0x2ddd('0x2')],'unique':_0x2ddd('0x3')},'VoiceQueueId':{'type':Sequelize[_0x2ddd('0x2')],'unique':_0x2ddd('0x3')}}; \ No newline at end of file +var _0x2f3d=['exports','STRING','INTEGER','contactListQueue','sequelize'];(function(_0x1d3b81,_0x3acf80){var _0x1a615c=function(_0x99343d){while(--_0x99343d){_0x1d3b81['push'](_0x1d3b81['shift']());}};_0x1a615c(++_0x3acf80);}(_0x2f3d,0x1a8));var _0xd2f3=function(_0x5af636,_0x5b24b9){_0x5af636=_0x5af636-0x0;var _0x1b3c15=_0x2f3d[_0x5af636];return _0x1b3c15;};'use strict';var moment=require('moment');var Sequelize=require(_0xd2f3('0x0'));module[_0xd2f3('0x1')]={'phone':{'type':Sequelize[_0xd2f3('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xd2f3('0x3')],'unique':_0xd2f3('0x4')},'ListId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0xd2f3('0x3')],'unique':_0xd2f3('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 33384ca..b0d0e20 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 _0x9dcf=['send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','VIRTUAL','CmHopperBlack','includeAll','rows','catch','show','params','keys','include','options','find','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','ejs','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name'];(function(_0x442a5d,_0x2a6745){var _0x51d134=function(_0x5cae90){while(--_0x5cae90){_0x442a5d['push'](_0x442a5d['shift']());}};_0x51d134(++_0x2a6745);}(_0x9dcf,0x103));var _0xf9dc=function(_0x1e697a,_0x177ff2){_0x1e697a=_0x1e697a-0x0;var _0x4db7ea=_0x9dcf[_0x1e697a];return _0x4db7ea;};'use strict';var emlformat=require(_0xf9dc('0x0'));var rimraf=require(_0xf9dc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf9dc('0x2'));var rp=require('request-promise');var moment=require(_0xf9dc('0x3'));var BPromise=require(_0xf9dc('0x4'));var Mustache=require('mustache');var util=require(_0xf9dc('0x5'));var path=require(_0xf9dc('0x6'));var sox=require(_0xf9dc('0x7'));var csv=require('to-csv');var ejs=require(_0xf9dc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf9dc('0x9'));var squel=require('squel');var crypto=require(_0xf9dc('0xa'));var jsforce=require(_0xf9dc('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf9dc('0xc'));var querystring=require(_0xf9dc('0xd'));var Papa=require(_0xf9dc('0xe'));var Redis=require(_0xf9dc('0xf'));var authService=require(_0xf9dc('0x10'));var qs=require(_0xf9dc('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf9dc('0x12'));var utils=require(_0xf9dc('0x13'));var config=require(_0xf9dc('0x14'));var licenseUtil=require(_0xf9dc('0x15'));var db=require(_0xf9dc('0x16'))['db'];function respondWithStatusCode(_0x38187b,_0x1048c2){_0x1048c2=_0x1048c2||0xcc;return function(_0x438c46){if(_0x438c46){return _0x38187b['sendStatus'](_0x1048c2);}return _0x38187b['status'](_0x1048c2)[_0xf9dc('0x17')]();};}function respondWithResult(_0x417622,_0x20f91e){_0x20f91e=_0x20f91e||0xc8;return function(_0x372306){if(_0x372306){return _0x417622[_0xf9dc('0x18')](_0x20f91e)[_0xf9dc('0x19')](_0x372306);}};}function respondWithFilteredResult(_0x91129,_0x10e3b4){return function(_0x1b9f6e){if(_0x1b9f6e){var _0x3c2431=typeof _0x10e3b4[_0xf9dc('0x1a')]==='undefined'&&typeof _0x10e3b4[_0xf9dc('0x1b')]===_0xf9dc('0x1c');var _0x2f79e8=_0x1b9f6e[_0xf9dc('0x1d')];var _0x5d3dc8=_0x3c2431?0x0:_0x10e3b4[_0xf9dc('0x1a')];var _0x5181bd=_0x3c2431?_0x1b9f6e[_0xf9dc('0x1d')]:_0x10e3b4[_0xf9dc('0x1a')]+_0x10e3b4[_0xf9dc('0x1b')];var _0x575066;if(_0x5181bd>=_0x2f79e8){_0x5181bd=_0x2f79e8;_0x575066=0xc8;}else{_0x575066=0xce;}_0x91129[_0xf9dc('0x18')](_0x575066);return _0x91129[_0xf9dc('0x1e')](_0xf9dc('0x1f'),_0x5d3dc8+'-'+_0x5181bd+'/'+_0x2f79e8)[_0xf9dc('0x19')](_0x1b9f6e);}return null;};}function patchUpdates(_0x3ccacd){return function(_0x36ba58){try{jsonpatch[_0xf9dc('0x20')](_0x36ba58,_0x3ccacd,!![]);}catch(_0x3744b3){return BPromise[_0xf9dc('0x21')](_0x3744b3);}return _0x36ba58[_0xf9dc('0x22')]();};}function saveUpdates(_0x438649,_0x254da8){return function(_0x3a816b){if(_0x3a816b){return _0x3a816b[_0xf9dc('0x23')](_0x438649)[_0xf9dc('0x24')](function(_0x5362b7){return _0x5362b7;});}return null;};}function removeEntity(_0x1cb31b,_0x41b812){return function(_0x2764f3){if(_0x2764f3){return _0x2764f3[_0xf9dc('0x25')]()[_0xf9dc('0x24')](function(){_0x1cb31b[_0xf9dc('0x18')](0xcc)[_0xf9dc('0x17')]();});}};}function handleEntityNotFound(_0x29159f,_0x45d559){return function(_0x11cdaf){if(!_0x11cdaf){_0x29159f[_0xf9dc('0x26')](0x194);}return _0x11cdaf;};}function handleError(_0x5e5c4d,_0x543888){_0x543888=_0x543888||0x1f4;return function(_0x232d80){logger[_0xf9dc('0x27')](_0x232d80['stack']);if(_0x232d80[_0xf9dc('0x28')]){delete _0x232d80[_0xf9dc('0x28')];}_0x5e5c4d['status'](_0x543888)[_0xf9dc('0x29')](_0x232d80);};}exports[_0xf9dc('0x2a')]=function(_0x4d129e,_0x4a863a){var _0x1e3460={},_0x32b1ff={},_0x3e93bf={'count':0x0,'rows':[]};var _0x5e3d84=_[_0xf9dc('0x2b')](db['CmHopperBlack'][_0xf9dc('0x2c')],function(_0x2d5c55){return{'name':_0x2d5c55[_0xf9dc('0x2d')],'type':_0x2d5c55[_0xf9dc('0x2e')][_0xf9dc('0x2f')]};});_0x32b1ff[_0xf9dc('0x30')]=_['map'](_0x5e3d84,_0xf9dc('0x28'));_0x32b1ff[_0xf9dc('0x31')]=_['keys'](_0x4d129e[_0xf9dc('0x31')]);_0x32b1ff['filters']=_[_0xf9dc('0x32')](_0x32b1ff['model'],_0x32b1ff[_0xf9dc('0x31')]);_0x1e3460[_0xf9dc('0x33')]=_[_0xf9dc('0x32')](_0x32b1ff[_0xf9dc('0x30')],qs[_0xf9dc('0x34')](_0x4d129e[_0xf9dc('0x31')][_0xf9dc('0x34')]));_0x1e3460[_0xf9dc('0x33')]=_0x1e3460[_0xf9dc('0x33')][_0xf9dc('0x35')]?_0x1e3460[_0xf9dc('0x33')]:_0x32b1ff[_0xf9dc('0x30')];if(!_0x4d129e[_0xf9dc('0x31')][_0xf9dc('0x36')](_0xf9dc('0x37'))){_0x1e3460[_0xf9dc('0x1b')]=qs[_0xf9dc('0x1b')](_0x4d129e['query'][_0xf9dc('0x1b')]);_0x1e3460[_0xf9dc('0x1a')]=qs[_0xf9dc('0x1a')](_0x4d129e[_0xf9dc('0x31')]['offset']);}_0x1e3460[_0xf9dc('0x38')]=qs['sort'](_0x4d129e[_0xf9dc('0x31')]['sort']);_0x1e3460[_0xf9dc('0x39')]=qs[_0xf9dc('0x3a')](_[_0xf9dc('0x3b')](_0x4d129e[_0xf9dc('0x31')],_0x32b1ff[_0xf9dc('0x3a')]),_0x5e3d84);if(_0x4d129e[_0xf9dc('0x31')][_0xf9dc('0x3c')]){_0x1e3460[_0xf9dc('0x39')]=_[_0xf9dc('0x3d')](_0x1e3460['where'],{'$or':_[_0xf9dc('0x2b')](_0x5e3d84,function(_0x38e0db){if(_0x38e0db[_0xf9dc('0x2e')]!==_0xf9dc('0x3e')){var _0x4283b7={};_0x4283b7[_0x38e0db[_0xf9dc('0x28')]]={'$like':'%'+_0x4d129e[_0xf9dc('0x31')][_0xf9dc('0x3c')]+'%'};return _0x4283b7;}})});}_0x1e3460=_[_0xf9dc('0x3d')]({},_0x1e3460,_0x4d129e['options']);var _0x569695={'where':_0x1e3460[_0xf9dc('0x39')]};return db[_0xf9dc('0x3f')][_0xf9dc('0x1d')](_0x569695)[_0xf9dc('0x24')](function(_0x3d8c6f){_0x3e93bf['count']=_0x3d8c6f;if(_0x4d129e[_0xf9dc('0x31')][_0xf9dc('0x40')]){_0x1e3460['include']=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x1e3460);})[_0xf9dc('0x24')](function(_0x2c8fb6){_0x3e93bf[_0xf9dc('0x41')]=_0x2c8fb6;return _0x3e93bf;})[_0xf9dc('0x24')](respondWithFilteredResult(_0x4a863a,_0x1e3460))[_0xf9dc('0x42')](handleError(_0x4a863a,null));};exports[_0xf9dc('0x43')]=function(_0x31884d,_0x16ab5d){var _0x435d24={'raw':!![],'where':{'id':_0x31884d[_0xf9dc('0x44')]['id']}},_0x2f7f49={};_0x2f7f49['model']=_['keys'](db[_0xf9dc('0x3f')][_0xf9dc('0x2c')]);_0x2f7f49[_0xf9dc('0x31')]=_[_0xf9dc('0x45')](_0x31884d[_0xf9dc('0x31')]);_0x2f7f49[_0xf9dc('0x3a')]=_[_0xf9dc('0x32')](_0x2f7f49[_0xf9dc('0x30')],_0x2f7f49['query']);_0x435d24['attributes']=_[_0xf9dc('0x32')](_0x2f7f49['model'],qs[_0xf9dc('0x34')](_0x31884d[_0xf9dc('0x31')][_0xf9dc('0x34')]));_0x435d24['attributes']=_0x435d24[_0xf9dc('0x33')]['length']?_0x435d24[_0xf9dc('0x33')]:_0x2f7f49['model'];if(_0x31884d[_0xf9dc('0x31')]['includeAll']){_0x435d24[_0xf9dc('0x46')]=[{'all':!![]}];}_0x435d24=_[_0xf9dc('0x3d')]({},_0x435d24,_0x31884d[_0xf9dc('0x47')]);return db[_0xf9dc('0x3f')][_0xf9dc('0x48')](_0x435d24)[_0xf9dc('0x24')](handleEntityNotFound(_0x16ab5d,null))['then'](respondWithResult(_0x16ab5d,null))[_0xf9dc('0x42')](handleError(_0x16ab5d,null));};exports[_0xf9dc('0x23')]=function(_0x4bc381,_0xb0e93d){if(_0x4bc381[_0xf9dc('0x49')]['id']){delete _0x4bc381[_0xf9dc('0x49')]['id'];}return db[_0xf9dc('0x3f')]['find']({'where':{'id':_0x4bc381[_0xf9dc('0x44')]['id']}})[_0xf9dc('0x24')](handleEntityNotFound(_0xb0e93d,null))[_0xf9dc('0x24')](saveUpdates(_0x4bc381[_0xf9dc('0x49')],null))['then'](respondWithResult(_0xb0e93d,null))['catch'](handleError(_0xb0e93d,null));};exports['destroy']=function(_0x207d16,_0x463e67){return db['CmHopperBlack'][_0xf9dc('0x48')]({'where':{'id':_0x207d16[_0xf9dc('0x44')]['id']}})[_0xf9dc('0x24')](handleEntityNotFound(_0x463e67,null))['then'](removeEntity(_0x463e67,null))['catch'](handleError(_0x463e67,null));};exports[_0xf9dc('0x4a')]=function(_0x171a2a,_0x4c0679){return db['CmHopperBlack'][_0xf9dc('0x4a')]()['then'](respondWithResult(_0x4c0679,null))[_0xf9dc('0x42')](handleError(_0x4c0679,null));}; \ No newline at end of file +var _0xb76a=['filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','find','body','catch','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','status','end','offset','undefined','count','set','Content-Range','json','reject','save','update','then','sendStatus','error','name','send','index','CmHopperBlack','rawAttributes','fieldName','type','key','model','map','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where'];(function(_0x2931fc,_0x4046c5){var _0x28f0e5=function(_0x46ece3){while(--_0x46ece3){_0x2931fc['push'](_0x2931fc['shift']());}};_0x28f0e5(++_0x4046c5);}(_0xb76a,0x150));var _0xab76=function(_0x576e7e,_0x5f3e1d){_0x576e7e=_0x576e7e-0x0;var _0x49efd5=_0xb76a[_0x576e7e];return _0x49efd5;};'use strict';var emlformat=require(_0xab76('0x0'));var rimraf=require(_0xab76('0x1'));var zipdir=require(_0xab76('0x2'));var jsonpatch=require(_0xab76('0x3'));var rp=require(_0xab76('0x4'));var moment=require(_0xab76('0x5'));var BPromise=require(_0xab76('0x6'));var Mustache=require(_0xab76('0x7'));var util=require(_0xab76('0x8'));var path=require(_0xab76('0x9'));var sox=require(_0xab76('0xa'));var csv=require('to-csv');var ejs=require(_0xab76('0xb'));var fs=require('fs');var fs_extra=require(_0xab76('0xc'));var _=require(_0xab76('0xd'));var squel=require(_0xab76('0xe'));var crypto=require(_0xab76('0xf'));var jsforce=require(_0xab76('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xab76('0x11'));var querystring=require(_0xab76('0x12'));var Papa=require(_0xab76('0x13'));var Redis=require(_0xab76('0x14'));var authService=require(_0xab76('0x15'));var qs=require(_0xab76('0x16'));var as=require(_0xab76('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xab76('0x18'))(_0xab76('0x19'));var utils=require('../../config/utils');var config=require(_0xab76('0x1a'));var licenseUtil=require(_0xab76('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25d6cf,_0xf691d4){_0xf691d4=_0xf691d4||0xcc;return function(_0x3f1c0d){if(_0x3f1c0d){return _0x25d6cf['sendStatus'](_0xf691d4);}return _0x25d6cf[_0xab76('0x1c')](_0xf691d4)[_0xab76('0x1d')]();};}function respondWithResult(_0xcc24b1,_0x3a94cc){_0x3a94cc=_0x3a94cc||0xc8;return function(_0x1252c3){if(_0x1252c3){return _0xcc24b1[_0xab76('0x1c')](_0x3a94cc)['json'](_0x1252c3);}};}function respondWithFilteredResult(_0x5ea2f4,_0x5c95fb){return function(_0x468a26){if(_0x468a26){var _0x3459f4=typeof _0x5c95fb[_0xab76('0x1e')]===_0xab76('0x1f')&&typeof _0x5c95fb['limit']===_0xab76('0x1f');var _0x3a26a1=_0x468a26[_0xab76('0x20')];var _0x1ebc16=_0x3459f4?0x0:_0x5c95fb[_0xab76('0x1e')];var _0xee7517=_0x3459f4?_0x468a26['count']:_0x5c95fb[_0xab76('0x1e')]+_0x5c95fb['limit'];var _0x5f4dfa;if(_0xee7517>=_0x3a26a1){_0xee7517=_0x3a26a1;_0x5f4dfa=0xc8;}else{_0x5f4dfa=0xce;}_0x5ea2f4['status'](_0x5f4dfa);return _0x5ea2f4[_0xab76('0x21')](_0xab76('0x22'),_0x1ebc16+'-'+_0xee7517+'/'+_0x3a26a1)[_0xab76('0x23')](_0x468a26);}return null;};}function patchUpdates(_0x3bfb57){return function(_0x479a81){try{jsonpatch['apply'](_0x479a81,_0x3bfb57,!![]);}catch(_0x319aa3){return BPromise[_0xab76('0x24')](_0x319aa3);}return _0x479a81[_0xab76('0x25')]();};}function saveUpdates(_0x36cb66,_0x49623e){return function(_0x2a7065){if(_0x2a7065){return _0x2a7065[_0xab76('0x26')](_0x36cb66)['then'](function(_0x23aed4){return _0x23aed4;});}return null;};}function removeEntity(_0x11673a,_0x2ee1b3){return function(_0x3a8c4){if(_0x3a8c4){return _0x3a8c4['destroy']()[_0xab76('0x27')](function(){_0x11673a['status'](0xcc)[_0xab76('0x1d')]();});}};}function handleEntityNotFound(_0x2e9012,_0x3808b4){return function(_0x3796e5){if(!_0x3796e5){_0x2e9012[_0xab76('0x28')](0x194);}return _0x3796e5;};}function handleError(_0x3775fd,_0x33cd29){_0x33cd29=_0x33cd29||0x1f4;return function(_0x2a0e82){logger[_0xab76('0x29')](_0x2a0e82['stack']);if(_0x2a0e82[_0xab76('0x2a')]){delete _0x2a0e82[_0xab76('0x2a')];}_0x3775fd[_0xab76('0x1c')](_0x33cd29)[_0xab76('0x2b')](_0x2a0e82);};}exports[_0xab76('0x2c')]=function(_0x4820f7,_0x390c23){var _0x5e7963={},_0x14cf41={},_0x16de3c={'count':0x0,'rows':[]};var _0x2ca357=_['map'](db[_0xab76('0x2d')][_0xab76('0x2e')],function(_0x115158){return{'name':_0x115158[_0xab76('0x2f')],'type':_0x115158[_0xab76('0x30')][_0xab76('0x31')]};});_0x14cf41[_0xab76('0x32')]=_[_0xab76('0x33')](_0x2ca357,'name');_0x14cf41['query']=_[_0xab76('0x34')](_0x4820f7['query']);_0x14cf41['filters']=_[_0xab76('0x35')](_0x14cf41[_0xab76('0x32')],_0x14cf41[_0xab76('0x36')]);_0x5e7963[_0xab76('0x37')]=_[_0xab76('0x35')](_0x14cf41[_0xab76('0x32')],qs[_0xab76('0x38')](_0x4820f7[_0xab76('0x36')]['fields']));_0x5e7963[_0xab76('0x37')]=_0x5e7963[_0xab76('0x37')][_0xab76('0x39')]?_0x5e7963['attributes']:_0x14cf41[_0xab76('0x32')];if(!_0x4820f7['query'][_0xab76('0x3a')](_0xab76('0x3b'))){_0x5e7963[_0xab76('0x3c')]=qs[_0xab76('0x3c')](_0x4820f7['query']['limit']);_0x5e7963[_0xab76('0x1e')]=qs[_0xab76('0x1e')](_0x4820f7[_0xab76('0x36')][_0xab76('0x1e')]);}_0x5e7963[_0xab76('0x3d')]=qs[_0xab76('0x3e')](_0x4820f7[_0xab76('0x36')][_0xab76('0x3e')]);_0x5e7963[_0xab76('0x3f')]=qs[_0xab76('0x40')](_[_0xab76('0x41')](_0x4820f7[_0xab76('0x36')],_0x14cf41[_0xab76('0x40')]),_0x2ca357);if(_0x4820f7['query']['filter']){_0x5e7963['where']=_[_0xab76('0x42')](_0x5e7963[_0xab76('0x3f')],{'$or':_['map'](_0x2ca357,function(_0x2a01ac){if(_0x2a01ac[_0xab76('0x30')]!==_0xab76('0x43')){var _0x31a63c={};_0x31a63c[_0x2a01ac[_0xab76('0x2a')]]={'$like':'%'+_0x4820f7[_0xab76('0x36')][_0xab76('0x44')]+'%'};return _0x31a63c;}})});}_0x5e7963=_[_0xab76('0x42')]({},_0x5e7963,_0x4820f7[_0xab76('0x45')]);var _0x41a7a0={'where':_0x5e7963['where']};return db[_0xab76('0x2d')][_0xab76('0x20')](_0x41a7a0)[_0xab76('0x27')](function(_0x5e05b4){_0x16de3c[_0xab76('0x20')]=_0x5e05b4;if(_0x4820f7[_0xab76('0x36')][_0xab76('0x46')]){_0x5e7963[_0xab76('0x47')]=[{'all':!![]}];}return db[_0xab76('0x2d')][_0xab76('0x48')](_0x5e7963);})[_0xab76('0x27')](function(_0x2566c6){_0x16de3c[_0xab76('0x49')]=_0x2566c6;return _0x16de3c;})[_0xab76('0x27')](respondWithFilteredResult(_0x390c23,_0x5e7963))['catch'](handleError(_0x390c23,null));};exports['show']=function(_0x44d718,_0x30ea01){var _0x34e92b={'raw':!![],'where':{'id':_0x44d718[_0xab76('0x4a')]['id']}},_0x1de187={};_0x1de187[_0xab76('0x32')]=_[_0xab76('0x34')](db['CmHopperBlack'][_0xab76('0x2e')]);_0x1de187[_0xab76('0x36')]=_[_0xab76('0x34')](_0x44d718[_0xab76('0x36')]);_0x1de187[_0xab76('0x40')]=_[_0xab76('0x35')](_0x1de187[_0xab76('0x32')],_0x1de187[_0xab76('0x36')]);_0x34e92b[_0xab76('0x37')]=_['intersection'](_0x1de187[_0xab76('0x32')],qs[_0xab76('0x38')](_0x44d718['query'][_0xab76('0x38')]));_0x34e92b[_0xab76('0x37')]=_0x34e92b[_0xab76('0x37')][_0xab76('0x39')]?_0x34e92b[_0xab76('0x37')]:_0x1de187[_0xab76('0x32')];if(_0x44d718[_0xab76('0x36')][_0xab76('0x46')]){_0x34e92b[_0xab76('0x47')]=[{'all':!![]}];}_0x34e92b=_['merge']({},_0x34e92b,_0x44d718[_0xab76('0x45')]);return db[_0xab76('0x2d')][_0xab76('0x4b')](_0x34e92b)['then'](handleEntityNotFound(_0x30ea01,null))[_0xab76('0x27')](respondWithResult(_0x30ea01,null))['catch'](handleError(_0x30ea01,null));};exports[_0xab76('0x26')]=function(_0x151f21,_0x9d0616){if(_0x151f21[_0xab76('0x4c')]['id']){delete _0x151f21[_0xab76('0x4c')]['id'];}return db[_0xab76('0x2d')][_0xab76('0x4b')]({'where':{'id':_0x151f21['params']['id']}})[_0xab76('0x27')](handleEntityNotFound(_0x9d0616,null))[_0xab76('0x27')](saveUpdates(_0x151f21[_0xab76('0x4c')],null))[_0xab76('0x27')](respondWithResult(_0x9d0616,null))[_0xab76('0x4d')](handleError(_0x9d0616,null));};exports[_0xab76('0x4e')]=function(_0x23f719,_0x3112f8){return db[_0xab76('0x2d')][_0xab76('0x4b')]({'where':{'id':_0x23f719[_0xab76('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3112f8,null))[_0xab76('0x27')](removeEntity(_0x3112f8,null))[_0xab76('0x4d')](handleError(_0x3112f8,null));};exports['describe']=function(_0x486b72,_0x55baa3){return db['CmHopperBlack'][_0xab76('0x4f')]()['then'](respondWithResult(_0x55baa3,null))[_0xab76('0x4d')](handleError(_0x55baa3,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 3d2eec5..eafab47 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 _0x4974=['api','moment','bluebird','path','rimraf','../../config/environment','./cmHopperBlack.attributes','cm_hopper_black','lodash'];(function(_0x5b0892,_0x42410f){var _0x9b0116=function(_0x52bce3){while(--_0x52bce3){_0x5b0892['push'](_0x5b0892['shift']());}};_0x9b0116(++_0x42410f);}(_0x4974,0x143));var _0x4497=function(_0x212950,_0x412c4a){_0x212950=_0x212950-0x0;var _0x1eb5d6=_0x4974[_0x212950];return _0x1eb5d6;};'use strict';var _=require(_0x4497('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4497('0x1'));var moment=require(_0x4497('0x2'));var BPromise=require(_0x4497('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4497('0x4'));var rimraf=require(_0x4497('0x5'));var config=require(_0x4497('0x6'));var attributes=require(_0x4497('0x7'));module['exports']=function(_0x194e9c,_0x34eb77){return _0x194e9c['define']('CmHopperBlack',attributes,{'tableName':_0x4497('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0bb2=['rimraf','../../config/environment','exports','define','CmHopperBlack','util','../../config/logger','moment','request-promise','path'];(function(_0x1b1e76,_0x31695b){var _0x3d743a=function(_0x4ae27b){while(--_0x4ae27b){_0x1b1e76['push'](_0x1b1e76['shift']());}};_0x3d743a(++_0x31695b);}(_0x0bb2,0xcd));var _0x20bb=function(_0x319aca,_0x3999f9){_0x319aca=_0x319aca-0x0;var _0x3499fa=_0x0bb2[_0x319aca];return _0x3499fa;};'use strict';var _=require('lodash');var util=require(_0x20bb('0x0'));var logger=require(_0x20bb('0x1'))('api');var moment=require(_0x20bb('0x2'));var BPromise=require('bluebird');var rp=require(_0x20bb('0x3'));var fs=require('fs');var path=require(_0x20bb('0x4'));var rimraf=require(_0x20bb('0x5'));var config=require(_0x20bb('0x6'));var attributes=require('./cmHopperBlack.attributes');module[_0x20bb('0x7')]=function(_0x5cc15c,_0x2dadf1){return _0x5cc15c[_0x20bb('0x8')](_0x20bb('0x9'),attributes,{'tableName':'cm_hopper_black','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 2f9e431..05fc9ff 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 _0xec1e=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','limit','include','map','model','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','destroy','util','moment','bluebird','randomstring','ioredis'];(function(_0x7d36ee,_0x247639){var _0x562c86=function(_0x49c644){while(--_0x49c644){_0x7d36ee['push'](_0x7d36ee['shift']());}};_0x562c86(++_0x247639);}(_0xec1e,0x73));var _0xeec1=function(_0x1d7599,_0x49929f){_0x1d7599=_0x1d7599-0x0;var _0x55da12=_0xec1e[_0x1d7599];return _0x55da12;};'use strict';var _=require('lodash');var util=require(_0xeec1('0x0'));var moment=require(_0xeec1('0x1'));var BPromise=require(_0xeec1('0x2'));var rs=require(_0xeec1('0x3'));var fs=require('fs');var Redis=require(_0xeec1('0x4'));var db=require(_0xeec1('0x5'))['db'];var utils=require(_0xeec1('0x6'));var logger=require(_0xeec1('0x7'))(_0xeec1('0x8'));var config=require('../../config/environment');var jayson=require(_0xeec1('0x9'));var client=jayson[_0xeec1('0xa')][_0xeec1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ff627,_0x116d10,_0x221193){return new BPromise(function(_0x5cb06a,_0x59d181){return client[_0xeec1('0xc')](_0x1ff627,_0x221193)[_0xeec1('0xd')](function(_0x17ab7e){logger[_0xeec1('0xe')](_0xeec1('0xf'),_0x116d10,_0xeec1('0x10'));logger[_0xeec1('0x11')](_0xeec1('0x12'),_0x116d10,_0xeec1('0x10'),JSON[_0xeec1('0x13')](_0x17ab7e));if(_0x17ab7e[_0xeec1('0x14')]){if(_0x17ab7e[_0xeec1('0x14')]['code']===0x1f4){logger[_0xeec1('0x14')](_0xeec1('0xf'),_0x116d10,_0x17ab7e[_0xeec1('0x14')][_0xeec1('0x15')]);return _0x59d181(_0x17ab7e[_0xeec1('0x14')][_0xeec1('0x15')]);}logger[_0xeec1('0x14')]('CmHopperBlack,\x20%s,\x20%s',_0x116d10,_0x17ab7e[_0xeec1('0x14')][_0xeec1('0x15')]);return _0x5cb06a(_0x17ab7e[_0xeec1('0x14')][_0xeec1('0x15')]);}else{logger[_0xeec1('0xe')]('CmHopperBlack,\x20%s,\x20%s',_0x116d10,_0xeec1('0x10'));_0x5cb06a(_0x17ab7e[_0xeec1('0x16')][_0xeec1('0x15')]);}})[_0xeec1('0x17')](function(_0x346f79){logger['error'](_0xeec1('0xf'),_0x116d10,_0x346f79);_0x59d181(_0x346f79);});});}exports[_0xeec1('0x18')]=function(_0x34d1d1){var _0x13e1f8=this;return new Promise(function(_0x260bdb,_0x465d98){return db[_0xeec1('0x19')][_0xeec1('0x1a')]({'raw':_0x34d1d1[_0xeec1('0x1b')]?_0x34d1d1[_0xeec1('0x1b')][_0xeec1('0x1c')]===undefined?!![]:![]:!![],'where':_0x34d1d1[_0xeec1('0x1b')]?_0x34d1d1[_0xeec1('0x1b')][_0xeec1('0x1d')]||null:null,'attributes':_0x34d1d1[_0xeec1('0x1b')]?_0x34d1d1[_0xeec1('0x1b')][_0xeec1('0x1e')]||null:null,'limit':_0x34d1d1[_0xeec1('0x1b')]?_0x34d1d1[_0xeec1('0x1b')][_0xeec1('0x1f')]||null:null,'include':_0x34d1d1[_0xeec1('0x1b')]?_0x34d1d1[_0xeec1('0x1b')][_0xeec1('0x20')]?_[_0xeec1('0x21')](_0x34d1d1['options'][_0xeec1('0x20')],function(_0x92400a){return{'model':db[_0x92400a[_0xeec1('0x22')]],'as':_0x92400a['as'],'attributes':_0x92400a['attributes'],'include':_0x92400a['include']?_[_0xeec1('0x21')](_0x92400a[_0xeec1('0x20')],function(_0x536e4b){return{'model':db[_0x536e4b['model']],'as':_0x536e4b['as'],'attributes':_0x536e4b[_0xeec1('0x1e')],'include':_0x536e4b[_0xeec1('0x20')]?_[_0xeec1('0x21')](_0x536e4b[_0xeec1('0x20')],function(_0x19e6e8){return{'model':db[_0x19e6e8[_0xeec1('0x22')]],'as':_0x19e6e8['as'],'attributes':_0x19e6e8[_0xeec1('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xeec1('0xd')](function(_0x292a8a){logger[_0xeec1('0xe')](_0xeec1('0x18'),_0x34d1d1);logger[_0xeec1('0x11')](_0xeec1('0x18'),_0x34d1d1,JSON[_0xeec1('0x13')](_0x292a8a));_0x260bdb(_0x292a8a);})[_0xeec1('0x17')](function(_0x5c2099){logger[_0xeec1('0x14')](_0xeec1('0x18'),_0x5c2099[_0xeec1('0x15')],_0x34d1d1);_0x465d98(_0x13e1f8[_0xeec1('0x14')](0x1f4,_0x5c2099[_0xeec1('0x15')]));});});};exports[_0xeec1('0x23')]=function(_0x22c7bd){var _0x18b50d=this;return new Promise(function(_0x54d09b,_0x2155e1){return db[_0xeec1('0x19')][_0xeec1('0x24')](_0x22c7bd[_0xeec1('0x25')],{'raw':_0x22c7bd[_0xeec1('0x1b')]?_0x22c7bd['options'][_0xeec1('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x22c7bd[_0xeec1('0x1b')]?_0x22c7bd['options'][_0xeec1('0x1d')]||null:null,'attributes':_0x22c7bd[_0xeec1('0x1b')]?_0x22c7bd[_0xeec1('0x1b')]['attributes']||null:null,'limit':_0x22c7bd['options']?_0x22c7bd[_0xeec1('0x1b')][_0xeec1('0x1f')]||null:null})[_0xeec1('0xd')](function(_0x1bd0c1){logger['info']('UpdateCmHopperBlack',_0x22c7bd);logger[_0xeec1('0x11')](_0xeec1('0x23'),_0x22c7bd,JSON[_0xeec1('0x13')](_0x1bd0c1));_0x54d09b(_0x1bd0c1);})[_0xeec1('0x17')](function(_0x13dde9){logger['error'](_0xeec1('0x23'),_0x13dde9['message'],_0x22c7bd);_0x2155e1(_0x18b50d[_0xeec1('0x14')](0x1f4,_0x13dde9[_0xeec1('0x15')]));});});};exports[_0xeec1('0x26')]=function(_0x349fe8){var _0x337b9d=this;return new Promise(function(_0x3bccce,_0x25bd72){return db[_0xeec1('0x19')][_0xeec1('0x27')]({'where':_0x349fe8[_0xeec1('0x1b')]?_0x349fe8[_0xeec1('0x1b')]['where']||null:null})['then'](function(_0x1462ca){logger[_0xeec1('0xe')]('DestroyCmHopperBlack',_0x349fe8);logger['debug'](_0xeec1('0x26'),_0x349fe8,JSON['stringify'](_0x1462ca));_0x3bccce(_0x1462ca);})['catch'](function(_0x1e1195){logger[_0xeec1('0x14')](_0xeec1('0x26'),_0x1e1195[_0xeec1('0x15')],_0x349fe8);_0x25bd72(_0x337b9d[_0xeec1('0x14')](0x1f4,_0x1e1195[_0xeec1('0x15')]));});});}; \ No newline at end of file +var _0x0f4d=['error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','where','include','map','model','attributes','debug','UpdateCmHopperBlack','update','body','raw','limit','DestroyCmHopperBlack','destroy','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x54c035,_0x2e7d9a){var _0x2a73c4=function(_0x33ec1e){while(--_0x33ec1e){_0x54c035['push'](_0x54c035['shift']());}};_0x2a73c4(++_0x2e7d9a);}(_0x0f4d,0x8b));var _0xd0f4=function(_0x30cbc5,_0x1054e6){_0x30cbc5=_0x30cbc5-0x0;var _0x1b1369=_0x0f4d[_0x30cbc5];return _0x1b1369;};'use strict';var _=require(_0xd0f4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd0f4('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd0f4('0x2'));var db=require(_0xd0f4('0x3'))['db'];var utils=require(_0xd0f4('0x4'));var logger=require('../../config/logger')(_0xd0f4('0x5'));var config=require(_0xd0f4('0x6'));var jayson=require(_0xd0f4('0x7'));var client=jayson[_0xd0f4('0x8')][_0xd0f4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d2fae,_0x1c4d1f,_0x5ad70c){return new BPromise(function(_0x338cf0,_0xb4a267){return client[_0xd0f4('0xa')](_0x3d2fae,_0x5ad70c)[_0xd0f4('0xb')](function(_0x4afb2a){logger[_0xd0f4('0xc')](_0xd0f4('0xd'),_0x1c4d1f,_0xd0f4('0xe'));logger['debug'](_0xd0f4('0xf'),_0x1c4d1f,_0xd0f4('0xe'),JSON[_0xd0f4('0x10')](_0x4afb2a));if(_0x4afb2a[_0xd0f4('0x11')]){if(_0x4afb2a['error'][_0xd0f4('0x12')]===0x1f4){logger['error'](_0xd0f4('0xd'),_0x1c4d1f,_0x4afb2a['error']['message']);return _0xb4a267(_0x4afb2a['error'][_0xd0f4('0x13')]);}logger[_0xd0f4('0x11')](_0xd0f4('0xd'),_0x1c4d1f,_0x4afb2a['error'][_0xd0f4('0x13')]);return _0x338cf0(_0x4afb2a['error']['message']);}else{logger[_0xd0f4('0xc')]('CmHopperBlack,\x20%s,\x20%s',_0x1c4d1f,'request\x20sent');_0x338cf0(_0x4afb2a[_0xd0f4('0x14')][_0xd0f4('0x13')]);}})[_0xd0f4('0x15')](function(_0x4b8de3){logger[_0xd0f4('0x11')](_0xd0f4('0xd'),_0x1c4d1f,_0x4b8de3);_0xb4a267(_0x4b8de3);});});}exports[_0xd0f4('0x16')]=function(_0x11b014){var _0x219d7b=this;return new Promise(function(_0x2c5128,_0x14c964){return db[_0xd0f4('0x17')][_0xd0f4('0x18')]({'raw':_0x11b014['options']?_0x11b014[_0xd0f4('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x11b014[_0xd0f4('0x19')]?_0x11b014[_0xd0f4('0x19')][_0xd0f4('0x1a')]||null:null,'attributes':_0x11b014[_0xd0f4('0x19')]?_0x11b014['options']['attributes']||null:null,'limit':_0x11b014[_0xd0f4('0x19')]?_0x11b014[_0xd0f4('0x19')]['limit']||null:null,'include':_0x11b014['options']?_0x11b014[_0xd0f4('0x19')][_0xd0f4('0x1b')]?_[_0xd0f4('0x1c')](_0x11b014[_0xd0f4('0x19')][_0xd0f4('0x1b')],function(_0x814a18){return{'model':db[_0x814a18[_0xd0f4('0x1d')]],'as':_0x814a18['as'],'attributes':_0x814a18[_0xd0f4('0x1e')],'include':_0x814a18[_0xd0f4('0x1b')]?_[_0xd0f4('0x1c')](_0x814a18[_0xd0f4('0x1b')],function(_0x553e08){return{'model':db[_0x553e08['model']],'as':_0x553e08['as'],'attributes':_0x553e08[_0xd0f4('0x1e')],'include':_0x553e08['include']?_[_0xd0f4('0x1c')](_0x553e08['include'],function(_0x297614){return{'model':db[_0x297614[_0xd0f4('0x1d')]],'as':_0x297614['as'],'attributes':_0x297614[_0xd0f4('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3be546){logger[_0xd0f4('0xc')](_0xd0f4('0x16'),_0x11b014);logger[_0xd0f4('0x1f')](_0xd0f4('0x16'),_0x11b014,JSON[_0xd0f4('0x10')](_0x3be546));_0x2c5128(_0x3be546);})[_0xd0f4('0x15')](function(_0x55547a){logger[_0xd0f4('0x11')](_0xd0f4('0x16'),_0x55547a[_0xd0f4('0x13')],_0x11b014);_0x14c964(_0x219d7b[_0xd0f4('0x11')](0x1f4,_0x55547a[_0xd0f4('0x13')]));});});};exports[_0xd0f4('0x20')]=function(_0x24fa03){var _0x34f16f=this;return new Promise(function(_0x1a38eb,_0x5af173){return db[_0xd0f4('0x17')][_0xd0f4('0x21')](_0x24fa03[_0xd0f4('0x22')],{'raw':_0x24fa03[_0xd0f4('0x19')]?_0x24fa03[_0xd0f4('0x19')][_0xd0f4('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24fa03[_0xd0f4('0x19')]?_0x24fa03[_0xd0f4('0x19')]['where']||null:null,'attributes':_0x24fa03['options']?_0x24fa03[_0xd0f4('0x19')][_0xd0f4('0x1e')]||null:null,'limit':_0x24fa03[_0xd0f4('0x19')]?_0x24fa03[_0xd0f4('0x19')][_0xd0f4('0x24')]||null:null})[_0xd0f4('0xb')](function(_0x541a53){logger[_0xd0f4('0xc')]('UpdateCmHopperBlack',_0x24fa03);logger[_0xd0f4('0x1f')]('UpdateCmHopperBlack',_0x24fa03,JSON['stringify'](_0x541a53));_0x1a38eb(_0x541a53);})['catch'](function(_0x6ab9c8){logger['error'](_0xd0f4('0x20'),_0x6ab9c8[_0xd0f4('0x13')],_0x24fa03);_0x5af173(_0x34f16f[_0xd0f4('0x11')](0x1f4,_0x6ab9c8[_0xd0f4('0x13')]));});});};exports[_0xd0f4('0x25')]=function(_0xb70cec){var _0x3b85f7=this;return new Promise(function(_0x4127c9,_0x409eb0){return db[_0xd0f4('0x17')][_0xd0f4('0x26')]({'where':_0xb70cec[_0xd0f4('0x19')]?_0xb70cec[_0xd0f4('0x19')][_0xd0f4('0x1a')]||null:null})[_0xd0f4('0xb')](function(_0x37e213){logger[_0xd0f4('0xc')](_0xd0f4('0x25'),_0xb70cec);logger[_0xd0f4('0x1f')](_0xd0f4('0x25'),_0xb70cec,JSON[_0xd0f4('0x10')](_0x37e213));_0x4127c9(_0x37e213);})[_0xd0f4('0x15')](function(_0x4690a8){logger[_0xd0f4('0x11')]('DestroyCmHopperBlack',_0x4690a8['message'],_0xb70cec);_0x409eb0(_0x3b85f7[_0xd0f4('0x11')](0x1f4,_0x4690a8[_0xd0f4('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 19e4297..38908b0 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 _0xf494=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','describe','/:id','show','put','delete','destroy','multer','util'];(function(_0x5409aa,_0x2f7db4){var _0x4677b6=function(_0x25ca63){while(--_0x25ca63){_0x5409aa['push'](_0x5409aa['shift']());}};_0x4677b6(++_0x2f7db4);}(_0xf494,0x1c6));var _0x4f49=function(_0x2b70df,_0x224881){_0x2b70df=_0x2b70df-0x0;var _0x44b705=_0xf494[_0x2b70df];return _0x44b705;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var fs_extra=require(_0x4f49('0x5'));var auth=require(_0x4f49('0x6'));var interaction=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var controller=require(_0x4f49('0x9'));router[_0x4f49('0xa')]('/',auth[_0x4f49('0xb')](),controller[_0x4f49('0xc')]);router[_0x4f49('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x4f49('0xd')]);router[_0x4f49('0xa')](_0x4f49('0xe'),auth[_0x4f49('0xb')](),controller[_0x4f49('0xf')]);router[_0x4f49('0x10')](_0x4f49('0xe'),auth[_0x4f49('0xb')](),controller['update']);router[_0x4f49('0x11')](_0x4f49('0xe'),auth['isAuthenticated'](),controller[_0x4f49('0x12')]);module['exports']=router; \ No newline at end of file +var _0xafc4=['multer','path','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','/:id','show','put','delete','destroy'];(function(_0x1442c4,_0x26551a){var _0x4244df=function(_0x2faf61){while(--_0x2faf61){_0x1442c4['push'](_0x1442c4['shift']());}};_0x4244df(++_0x26551a);}(_0xafc4,0x69));var _0x4afc=function(_0xf5dd14,_0x2f2e40){_0xf5dd14=_0xf5dd14-0x0;var _0x2d07e5=_0xafc4[_0xf5dd14];return _0x2d07e5;};'use strict';var multer=require(_0x4afc('0x0'));var util=require('util');var path=require(_0x4afc('0x1'));var timeout=require('connect-timeout');var express=require(_0x4afc('0x2'));var router=express[_0x4afc('0x3')]();var fs_extra=require(_0x4afc('0x4'));var auth=require(_0x4afc('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmHopperBlack.controller');router[_0x4afc('0x6')]('/',auth[_0x4afc('0x7')](),controller[_0x4afc('0x8')]);router[_0x4afc('0x6')](_0x4afc('0x9'),auth[_0x4afc('0x7')](),controller['describe']);router[_0x4afc('0x6')](_0x4afc('0xa'),auth[_0x4afc('0x7')](),controller[_0x4afc('0xb')]);router[_0x4afc('0xc')](_0x4afc('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x4afc('0xd')]('/:id',auth[_0x4afc('0x7')](),controller[_0x4afc('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 85182d6..05eb7b7 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 _0x258e=['getDataValue','endtime','setDataValue','followuptime','diff','seconds','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE'];(function(_0x16a7d8,_0x326d5c){var _0xa4b589=function(_0x17add5){while(--_0x17add5){_0x16a7d8['push'](_0x16a7d8['shift']());}};_0xa4b589(++_0x326d5c);}(_0x258e,0x118));var _0xe258=function(_0x449e04,_0x18458d){_0x449e04=_0x449e04-0x0;var _0x54ac4c=_0x258e[_0x449e04];return _0x54ac4c;};'use strict';var Sequelize=require(_0xe258('0x0'));var moment=require(_0xe258('0x1'));module[_0xe258('0x2')]={'state':{'type':Sequelize[_0xe258('0x3')](0x2)},'statedesc':{'type':Sequelize[_0xe258('0x4')]},'scheduledat':{'type':Sequelize[_0xe258('0x5')]},'countbusyretry':{'type':Sequelize[_0xe258('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xe258('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xe258('0x4')]},'originatecalleridnum':{'type':Sequelize[_0xe258('0x4')]},'originatecalleridname':{'type':Sequelize[_0xe258('0x4')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xe258('0x4')]},'starttime':{'type':Sequelize[_0xe258('0x5')]},'responsetime':{'type':Sequelize[_0xe258('0x5')]},'answertime':{'type':Sequelize[_0xe258('0x5')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xe258('0x5')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xe258('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xe258('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xe258('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xe258('0x4')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xe258('0x4')]},'reason':{'type':Sequelize[_0xe258('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xe258('0x4')]},'thirdDisposition':{'type':Sequelize[_0xe258('0x4')]},'dispositionat':{'type':Sequelize[_0xe258('0x5')],'set':function(_0x3e48c0){var _0x23756c=this[_0xe258('0x6')](_0xe258('0x7'));if(_0x23756c&&_0x3e48c0){this[_0xe258('0x8')](_0xe258('0x9'),moment(_0x3e48c0)[_0xe258('0xa')](moment(_0x23756c),_0xe258('0xb')));}}},'amd':{'type':Sequelize[_0xe258('0xc')],'defaultValue':![]},'fax':{'type':Sequelize[_0xe258('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xe258('0xc')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xe258('0xc')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xe258('0x5')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xe258('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xe258('0x5')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0xe258('0x5')]},'recallme':{'type':Sequelize[_0xe258('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xe258('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0xe258('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xe258('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xe258('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xe258('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x4859=['moment','STRING','DATE','INTEGER','getDataValue','endtime','setDataValue','followuptime','seconds','BOOLEAN','sequelize'];(function(_0x21588e,_0x22a66e){var _0x5497c0=function(_0x43c83a){while(--_0x43c83a){_0x21588e['push'](_0x21588e['shift']());}};_0x5497c0(++_0x22a66e);}(_0x4859,0x128));var _0x9485=function(_0x5c6613,_0xb039a5){_0x5c6613=_0x5c6613-0x0;var _0x40b610=_0x4859[_0x5c6613];return _0x40b610;};'use strict';var Sequelize=require(_0x9485('0x0'));var moment=require(_0x9485('0x1'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x9485('0x2')]},'scheduledat':{'type':Sequelize[_0x9485('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9485('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x9485('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x9485('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x9485('0x2')]},'originatecalleridname':{'type':Sequelize[_0x9485('0x2')]},'calleridnum':{'type':Sequelize[_0x9485('0x2')]},'calleridname':{'type':Sequelize[_0x9485('0x2')]},'starttime':{'type':Sequelize[_0x9485('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x9485('0x3')]},'droptime':{'type':Sequelize[_0x9485('0x3')]},'endtime':{'type':Sequelize[_0x9485('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x9485('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x9485('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x9485('0x2')]},'campaigntype':{'type':Sequelize[_0x9485('0x2')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x9485('0x2')]},'secondDisposition':{'type':Sequelize[_0x9485('0x2')]},'thirdDisposition':{'type':Sequelize[_0x9485('0x2')]},'dispositionat':{'type':Sequelize[_0x9485('0x3')],'set':function(_0x1b09a4){var _0x2da112=this[_0x9485('0x5')](_0x9485('0x6'));if(_0x2da112&&_0x1b09a4){this[_0x9485('0x7')](_0x9485('0x8'),moment(_0x1b09a4)['diff'](moment(_0x2da112),_0x9485('0x9')));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x9485('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x9485('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x9485('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x9485('0x3')]},'callback':{'type':Sequelize[_0x9485('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x9485('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x9485('0x3')]},'deleted':{'type':Sequelize[_0x9485('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x9485('0x3')]},'recallme':{'type':Sequelize[_0x9485('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x9485('0x3')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x9485('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x9485('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9485('0x4')],'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 d5a0fb4..aba5a94 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 _0x53ec=['ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','group','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','sendStatus','name','send','map','CmHopperFinal','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','rows','show','params','include','find','catch','describe','update','body','uniqueid','countContactsQueueCampaignHopperFinal','COUNT','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','findAll','noSuchContacts','`state`\x20=\x203,\x201,\x20null','dropContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','phone','ContactId','VoiceQueueId','updatedAt','select','ANY_VALUE(calleridnum)','scheduledAt','field','ListId','ANY_VALUE(VoiceQueueId)','NOW()','createdAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','moveContactsIvrCampaignHopperFinal','Campaign','fromQuery','CampaignId','ANY_VALUE(ContactId)'];(function(_0x419e5d,_0x3d8de6){var _0x4ba5ad=function(_0x658ba3){while(--_0x658ba3){_0x419e5d['push'](_0x419e5d['shift']());}};_0x4ba5ad(++_0x3d8de6);}(_0x53ec,0x192));var _0xc53e=function(_0x72895a,_0x433607){_0x72895a=_0x72895a-0x0;var _0x5226d5=_0x53ec[_0x72895a];return _0x5226d5;};'use strict';var emlformat=require(_0xc53e('0x0'));var rimraf=require(_0xc53e('0x1'));var zipdir=require(_0xc53e('0x2'));var jsonpatch=require(_0xc53e('0x3'));var rp=require(_0xc53e('0x4'));var moment=require(_0xc53e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc53e('0x6'));var util=require('util');var path=require(_0xc53e('0x7'));var sox=require(_0xc53e('0x8'));var csv=require('to-csv');var ejs=require(_0xc53e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc53e('0xa'));var squel=require(_0xc53e('0xb'));var crypto=require('crypto');var jsforce=require(_0xc53e('0xc'));var deskjs=require(_0xc53e('0xd'));var toCsv=require(_0xc53e('0xe'));var querystring=require(_0xc53e('0xf'));var Papa=require(_0xc53e('0x10'));var Redis=require(_0xc53e('0x11'));var authService=require(_0xc53e('0x12'));var qs=require(_0xc53e('0x13'));var as=require(_0xc53e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc53e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc53e('0x16'));var db=require(_0xc53e('0x17'))['db'];function respondWithStatusCode(_0x863fa,_0x4203aa){_0x4203aa=_0x4203aa||0xcc;return function(_0x56f0e5){if(_0x56f0e5){return _0x863fa['sendStatus'](_0x4203aa);}return _0x863fa[_0xc53e('0x18')](_0x4203aa)[_0xc53e('0x19')]();};}function respondWithResult(_0x7cd798,_0x3d2e17){_0x3d2e17=_0x3d2e17||0xc8;return function(_0x358ef3){if(_0x358ef3){return _0x7cd798[_0xc53e('0x18')](_0x3d2e17)[_0xc53e('0x1a')](_0x358ef3);}};}function respondWithFilteredResult(_0x19c0d1,_0x455e4d){return function(_0x2ad6eb){if(_0x2ad6eb){var _0x5b0a88=typeof _0x455e4d[_0xc53e('0x1b')]===_0xc53e('0x1c')&&typeof _0x455e4d[_0xc53e('0x1d')]===_0xc53e('0x1c');var _0x15333b=_0x2ad6eb[_0xc53e('0x1e')];var _0x164016=_0x5b0a88?0x0:_0x455e4d[_0xc53e('0x1b')];var _0x3b550e=_0x5b0a88?_0x2ad6eb['count']:_0x455e4d['offset']+_0x455e4d[_0xc53e('0x1d')];var _0x2a5bac;if(_0x3b550e>=_0x15333b){_0x3b550e=_0x15333b;_0x2a5bac=0xc8;}else{_0x2a5bac=0xce;}_0x19c0d1[_0xc53e('0x18')](_0x2a5bac);return _0x19c0d1[_0xc53e('0x1f')](_0xc53e('0x20'),_0x164016+'-'+_0x3b550e+'/'+_0x15333b)[_0xc53e('0x1a')](_0x2ad6eb);}return null;};}function patchUpdates(_0x15a015){return function(_0x25702b){try{jsonpatch[_0xc53e('0x21')](_0x25702b,_0x15a015,!![]);}catch(_0x401af6){return BPromise[_0xc53e('0x22')](_0x401af6);}return _0x25702b[_0xc53e('0x23')]();};}function saveUpdates(_0x426467,_0x4fb695){return function(_0x47cfdd){if(_0x47cfdd){return _0x47cfdd['update'](_0x426467)[_0xc53e('0x24')](function(_0x384218){return _0x384218;});}return null;};}function removeEntity(_0x7591c1,_0x4015c8){return function(_0x180811){if(_0x180811){return _0x180811['destroy']()['then'](function(){_0x7591c1[_0xc53e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ae55e,_0x3a5ce8){return function(_0x443179){if(!_0x443179){_0x1ae55e[_0xc53e('0x25')](0x194);}return _0x443179;};}function handleError(_0x63c5dc,_0x4df8cf){_0x4df8cf=_0x4df8cf||0x1f4;return function(_0x398e7a){logger['error'](_0x398e7a['stack']);if(_0x398e7a['name']){delete _0x398e7a[_0xc53e('0x26')];}_0x63c5dc['status'](_0x4df8cf)[_0xc53e('0x27')](_0x398e7a);};}exports['index']=function(_0x24a77e,_0x5112d2){var _0x5ce216={},_0x8f0ee6={},_0x6a62b0={'count':0x0,'rows':[]};var _0x42dec1=_[_0xc53e('0x28')](db[_0xc53e('0x29')][_0xc53e('0x2a')],function(_0x3280fe){return{'name':_0x3280fe[_0xc53e('0x2b')],'type':_0x3280fe['type'][_0xc53e('0x2c')]};});_0x8f0ee6[_0xc53e('0x2d')]=_[_0xc53e('0x28')](_0x42dec1,'name');_0x8f0ee6[_0xc53e('0x2e')]=_['keys'](_0x24a77e[_0xc53e('0x2e')]);_0x8f0ee6[_0xc53e('0x2f')]=_['intersection'](_0x8f0ee6['model'],_0x8f0ee6[_0xc53e('0x2e')]);_0x5ce216[_0xc53e('0x30')]=_[_0xc53e('0x31')](_0x8f0ee6[_0xc53e('0x2d')],qs[_0xc53e('0x32')](_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x32')]));_0x5ce216[_0xc53e('0x30')]=_0x5ce216['attributes'][_0xc53e('0x33')]?_0x5ce216[_0xc53e('0x30')]:_0x8f0ee6[_0xc53e('0x2d')];if(!_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x34')](_0xc53e('0x35'))){_0x5ce216[_0xc53e('0x1d')]=qs[_0xc53e('0x1d')](_0x24a77e[_0xc53e('0x2e')]['limit']);_0x5ce216[_0xc53e('0x1b')]=qs['offset'](_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x1b')]);}_0x5ce216['order']=qs[_0xc53e('0x36')](_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x36')]);_0x5ce216['where']=qs[_0xc53e('0x2f')](_[_0xc53e('0x37')](_0x24a77e[_0xc53e('0x2e')],_0x8f0ee6[_0xc53e('0x2f')]),_0x42dec1);if(_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x38')]){_0x5ce216[_0xc53e('0x39')]=_['merge'](_0x5ce216[_0xc53e('0x39')],{'$or':_[_0xc53e('0x28')](_0x42dec1,function(_0x2db711){if(_0x2db711['type']!==_0xc53e('0x3a')){var _0x5e8ab7={};_0x5e8ab7[_0x2db711[_0xc53e('0x26')]]={'$like':'%'+_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x38')]+'%'};return _0x5e8ab7;}})});}_0x5ce216=_[_0xc53e('0x3b')]({},_0x5ce216,_0x24a77e[_0xc53e('0x3c')]);var _0x5507d0={'where':_0x5ce216[_0xc53e('0x39')]};return db[_0xc53e('0x29')]['count'](_0x5507d0)['then'](function(_0x5e9e15){_0x6a62b0['count']=_0x5e9e15;if(_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x3d')]){_0x5ce216['include']=[{'all':!![]}];}return db[_0xc53e('0x29')]['findAll'](_0x5ce216);})['then'](function(_0x53447e){_0x6a62b0[_0xc53e('0x3e')]=_0x53447e;return _0x6a62b0;})['then'](respondWithFilteredResult(_0x5112d2,_0x5ce216))['catch'](handleError(_0x5112d2,null));};exports[_0xc53e('0x3f')]=function(_0x53a82f,_0x422088){var _0x360af9={'raw':!![],'where':{'id':_0x53a82f[_0xc53e('0x40')]['id']}},_0x49f204={};_0x49f204[_0xc53e('0x2d')]=_['keys'](db[_0xc53e('0x29')]['rawAttributes']);_0x49f204['query']=_['keys'](_0x53a82f['query']);_0x49f204[_0xc53e('0x2f')]=_[_0xc53e('0x31')](_0x49f204[_0xc53e('0x2d')],_0x49f204['query']);_0x360af9[_0xc53e('0x30')]=_[_0xc53e('0x31')](_0x49f204['model'],qs['fields'](_0x53a82f[_0xc53e('0x2e')][_0xc53e('0x32')]));_0x360af9[_0xc53e('0x30')]=_0x360af9['attributes'][_0xc53e('0x33')]?_0x360af9[_0xc53e('0x30')]:_0x49f204[_0xc53e('0x2d')];if(_0x53a82f[_0xc53e('0x2e')][_0xc53e('0x3d')]){_0x360af9[_0xc53e('0x41')]=[{'all':!![]}];}_0x360af9=_[_0xc53e('0x3b')]({},_0x360af9,_0x53a82f['options']);return db[_0xc53e('0x29')][_0xc53e('0x42')](_0x360af9)[_0xc53e('0x24')](handleEntityNotFound(_0x422088,null))['then'](respondWithResult(_0x422088,null))[_0xc53e('0x43')](handleError(_0x422088,null));};exports[_0xc53e('0x44')]=function(_0x4458c8,_0x15e744){return db[_0xc53e('0x29')][_0xc53e('0x44')]()['then'](respondWithResult(_0x15e744,null))[_0xc53e('0x43')](handleError(_0x15e744,null));};exports[_0xc53e('0x45')]=function(_0x39feea,_0x5a6e41){if(_0x39feea[_0xc53e('0x46')][_0xc53e('0x47')]){delete _0x39feea[_0xc53e('0x46')][_0xc53e('0x47')];}return db[_0xc53e('0x29')][_0xc53e('0x42')]({'where':{'uniqueid':_0x39feea[_0xc53e('0x40')]['id']}})[_0xc53e('0x24')](handleEntityNotFound(_0x5a6e41,null))[_0xc53e('0x24')](saveUpdates(_0x39feea[_0xc53e('0x46')],null))['then'](respondWithResult(_0x5a6e41,null))[_0xc53e('0x43')](handleError(_0x5a6e41,null));};exports[_0xc53e('0x48')]=function(_0x38520c,_0x3d74ac,_0x136544){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'VoiceQueueId':_0x38520c[_0xc53e('0x40')]['id']},'attributes':[[db['sequelize']['fn'](_0xc53e('0x49'),db['sequelize']['fn']('IF',db[_0xc53e('0x4a')][_0xc53e('0x4b')](_0xc53e('0x4c')))),'noSuchContacts'],[db[_0xc53e('0x4a')]['fn'](_0xc53e('0x49'),db[_0xc53e('0x4a')]['fn']('IF',db['sequelize'][_0xc53e('0x4b')]('`state`\x20=\x203,\x201,\x20null'))),_0xc53e('0x4d')],[db[_0xc53e('0x4a')]['fn']('COUNT',db[_0xc53e('0x4a')]['fn']('IF',db[_0xc53e('0x4a')]['literal'](_0xc53e('0x4e')))),_0xc53e('0x4f')],[db[_0xc53e('0x4a')]['fn'](_0xc53e('0x49'),db[_0xc53e('0x4a')]['fn']('IF',db[_0xc53e('0x4a')][_0xc53e('0x4b')](_0xc53e('0x50')))),_0xc53e('0x51')],[db[_0xc53e('0x4a')]['fn'](_0xc53e('0x49'),db['sequelize']['fn']('IF',db[_0xc53e('0x4a')]['literal'](_0xc53e('0x52')))),'dropContacts'],[db[_0xc53e('0x4a')]['fn'](_0xc53e('0x49'),db['sequelize']['fn']('IF',db[_0xc53e('0x4a')][_0xc53e('0x4b')](_0xc53e('0x53')))),_0xc53e('0x54')],[db['sequelize']['fn'](_0xc53e('0x49'),db[_0xc53e('0x4a')]['fn']('IF',db['sequelize']['literal'](_0xc53e('0x55')))),'reCallContacts'],[db['sequelize']['fn']('COUNT',db[_0xc53e('0x4a')]['fn']('IF',db['sequelize'][_0xc53e('0x4b')]('`state`\x20=\x2019,\x201,\x20null'))),_0xc53e('0x56')]]})[_0xc53e('0x24')](handleEntityNotFound(_0x3d74ac,null))[_0xc53e('0x24')](respondWithResult(_0x3d74ac,null))[_0xc53e('0x43')](handleError(_0x3d74ac,null));};exports[_0xc53e('0x57')]=function(_0x4caf5f,_0x55e068,_0x4655b7){return db[_0xc53e('0x29')][_0xc53e('0x58')]({'raw':![],'where':{'CampaignId':_0x4caf5f[_0xc53e('0x40')]['id']},'attributes':[[db[_0xc53e('0x4a')]['fn'](_0xc53e('0x49'),db[_0xc53e('0x4a')]['fn']('IF',db[_0xc53e('0x4a')][_0xc53e('0x4b')](_0xc53e('0x4c')))),_0xc53e('0x59')],[db[_0xc53e('0x4a')]['fn'](_0xc53e('0x49'),db['sequelize']['fn']('IF',db[_0xc53e('0x4a')]['literal'](_0xc53e('0x5a')))),_0xc53e('0x4d')],[db[_0xc53e('0x4a')]['fn'](_0xc53e('0x49'),db[_0xc53e('0x4a')]['fn']('IF',db[_0xc53e('0x4a')][_0xc53e('0x4b')](_0xc53e('0x4e')))),'busyContacts'],[db['sequelize']['fn']('COUNT',db[_0xc53e('0x4a')]['fn']('IF',db[_0xc53e('0x4a')][_0xc53e('0x4b')](_0xc53e('0x50')))),_0xc53e('0x51')],[db[_0xc53e('0x4a')]['fn'](_0xc53e('0x49'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xc53e('0x52')))),_0xc53e('0x5b')],[db['sequelize']['fn'](_0xc53e('0x49'),db[_0xc53e('0x4a')]['fn']('IF',db[_0xc53e('0x4a')][_0xc53e('0x4b')](_0xc53e('0x53')))),_0xc53e('0x54')],[db['sequelize']['fn']('COUNT',db[_0xc53e('0x4a')]['fn']('IF',db[_0xc53e('0x4a')][_0xc53e('0x4b')](_0xc53e('0x55')))),_0xc53e('0x5c')],[db[_0xc53e('0x4a')]['fn']('COUNT',db[_0xc53e('0x4a')]['fn']('IF',db[_0xc53e('0x4a')][_0xc53e('0x4b')](_0xc53e('0x5d')))),'answeringMachine']]})[_0xc53e('0x24')](handleEntityNotFound(_0x55e068,null))[_0xc53e('0x24')](respondWithResult(_0x55e068,null))[_0xc53e('0x43')](handleError(_0x55e068,null));};exports[_0xc53e('0x5e')]=function(_0x32f954,_0x2d9803,_0x51638a){return db[_0xc53e('0x5f')][_0xc53e('0x42')]({'where':{'id':_0x32f954[_0xc53e('0x40')]['id']}})[_0xc53e('0x24')](handleEntityNotFound(_0x2d9803,null))['then'](function(_0x5e1f4a){var _0x57edb;if(_0x5e1f4a){_0x57edb=squel[_0xc53e('0x60')]()[_0xc53e('0x61')](_0xc53e('0x62'))['fromQuery']([_0xc53e('0x63'),'scheduledAt',_0xc53e('0x64'),'ListId',_0xc53e('0x65'),'createdAt',_0xc53e('0x66')],squel[_0xc53e('0x67')]()['field'](_0xc53e('0x68'),_0xc53e('0x63'))['field']('NOW()',_0xc53e('0x69'))[_0xc53e('0x6a')]('ANY_VALUE(ContactId)','ContactId')[_0xc53e('0x6a')]('ANY_VALUE(ListId)',_0xc53e('0x6b'))['field'](_0xc53e('0x6c'),_0xc53e('0x65'))[_0xc53e('0x6a')](_0xc53e('0x6d'),_0xc53e('0x6e'))[_0xc53e('0x6a')](_0xc53e('0x6d'),_0xc53e('0x66'))[_0xc53e('0x6f')](_0xc53e('0x70'))['where'](_0xc53e('0x71'),_0x32f954['params']['id'][_0xc53e('0x72')]())[_0xc53e('0x39')](_0xc53e('0x73'),_0x32f954[_0xc53e('0x46')][_0xc53e('0x74')][_0xc53e('0x72')]())[_0xc53e('0x39')](_0xc53e('0x75'))[_0xc53e('0x39')](_0xc53e('0x76'),squel['select']()[_0xc53e('0x6a')]('phone')[_0xc53e('0x6f')](_0xc53e('0x62'))[_0xc53e('0x39')]('VoiceQueueId\x20=\x20?',_0x32f954[_0xc53e('0x40')]['id'][_0xc53e('0x72')]()))[_0xc53e('0x39')](_0xc53e('0x76'),squel[_0xc53e('0x67')]()['field'](_0xc53e('0x77'))[_0xc53e('0x6f')]('cm_hopper_final')[_0xc53e('0x39')](_0xc53e('0x71'),_0x32f954[_0xc53e('0x40')]['id']['toString']())[_0xc53e('0x39')](_0xc53e('0x78')))['group'](_0xc53e('0x64')))[_0xc53e('0x72')]();return db['sequelize']['query'](_0x57edb);}return[];})[_0xc53e('0x24')](respondWithResult(_0x2d9803,null))['catch'](handleError(_0x2d9803,null));};exports[_0xc53e('0x79')]=function(_0x3d2636,_0x263d97,_0x58684c){return db[_0xc53e('0x7a')][_0xc53e('0x42')]({'where':{'id':_0x3d2636[_0xc53e('0x40')]['id']}})['then'](handleEntityNotFound(_0x263d97,null))[_0xc53e('0x24')](function(_0x2e048a){var _0x1c24e6;if(_0x2e048a){_0x1c24e6=squel[_0xc53e('0x60')]()[_0xc53e('0x61')]('cm_hopper')[_0xc53e('0x7b')]([_0xc53e('0x63'),_0xc53e('0x69'),_0xc53e('0x64'),_0xc53e('0x6b'),_0xc53e('0x7c'),_0xc53e('0x6e'),_0xc53e('0x66')],squel[_0xc53e('0x67')]()['field'](_0xc53e('0x68'),_0xc53e('0x63'))[_0xc53e('0x6a')](_0xc53e('0x6d'),_0xc53e('0x69'))[_0xc53e('0x6a')](_0xc53e('0x7d'),_0xc53e('0x64'))[_0xc53e('0x6a')]('ANY_VALUE(ListId)',_0xc53e('0x6b'))[_0xc53e('0x6a')](_0xc53e('0x7e'),_0xc53e('0x7c'))['field'](_0xc53e('0x6d'),_0xc53e('0x6e'))[_0xc53e('0x6a')](_0xc53e('0x6d'),'updatedAt')[_0xc53e('0x6f')](_0xc53e('0x70'))[_0xc53e('0x39')](_0xc53e('0x7f'),_0x3d2636[_0xc53e('0x40')]['id'][_0xc53e('0x72')]())[_0xc53e('0x39')]('state\x20=\x20?',_0x3d2636[_0xc53e('0x46')]['state'][_0xc53e('0x72')]())[_0xc53e('0x39')](_0xc53e('0x75'))['where'](_0xc53e('0x76'),squel[_0xc53e('0x67')]()[_0xc53e('0x6a')]('phone')[_0xc53e('0x6f')](_0xc53e('0x62'))[_0xc53e('0x39')]('CampaignId\x20=\x20?',_0x3d2636[_0xc53e('0x40')]['id'][_0xc53e('0x72')]()))[_0xc53e('0x39')](_0xc53e('0x76'),squel[_0xc53e('0x67')]()['field']('calleridnum')['from'](_0xc53e('0x70'))[_0xc53e('0x39')](_0xc53e('0x7f'),_0x3d2636[_0xc53e('0x40')]['id']['toString']())[_0xc53e('0x39')]('state\x20=\x204'))[_0xc53e('0x80')](_0xc53e('0x64')))[_0xc53e('0x72')]();return db[_0xc53e('0x4a')]['query'](_0x1c24e6);}return[];})[_0xc53e('0x24')](respondWithResult(_0x263d97,null))[_0xc53e('0x43')](handleError(_0x263d97,null));};exports[_0xc53e('0x81')]=function(_0x352bc6,_0x67be18,_0x306343){return db[_0xc53e('0x82')][_0xc53e('0x83')]({'where':{'VoiceQueueId':_0x352bc6[_0xc53e('0x46')][_0xc53e('0x65')],'CampaignId':_0x352bc6[_0xc53e('0x46')][_0xc53e('0x7c')],'ContactId':_0x352bc6[_0xc53e('0x46')][_0xc53e('0x64')]}})[_0xc53e('0x24')](handleEntityNotFound(_0x67be18,null))[_0xc53e('0x24')](function(_0x3dc1be){if(_0x3dc1be){return _0x3dc1be;}return null;})[_0xc53e('0x24')](respondWithResult(_0x67be18,null))[_0xc53e('0x43')](handleError(_0x67be18,null));}; \ No newline at end of file +var _0x5d17=['ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','VoiceQueueId','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper','state\x20=\x204','moveContactsIvrCampaignHopperFinal','into','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum','group','checkContactHopper','findOne','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','name','send','index','CmHopperFinal','rawAttributes','fieldName','type','model','map','query','intersection','attributes','fields','length','nolimit','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','describe','update','body','uniqueid','find','countContactsQueueCampaignHopperFinal','COUNT','sequelize','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','literal','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','answeringMachine','countContactsIvrCampaignHopperFinal','congestionContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','fromQuery','scheduledAt','ContactId','ListId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','phone','NOW()'];(function(_0x254abd,_0x1ab7f0){var _0x31bf1b=function(_0x447fd8){while(--_0x447fd8){_0x254abd['push'](_0x254abd['shift']());}};_0x31bf1b(++_0x1ab7f0);}(_0x5d17,0x114));var _0x75d1=function(_0x277fa3,_0x3b2dde){_0x277fa3=_0x277fa3-0x0;var _0x2e4520=_0x5d17[_0x277fa3];return _0x2e4520;};'use strict';var emlformat=require(_0x75d1('0x0'));var rimraf=require(_0x75d1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x75d1('0x2'));var moment=require(_0x75d1('0x3'));var BPromise=require(_0x75d1('0x4'));var Mustache=require('mustache');var util=require(_0x75d1('0x5'));var path=require(_0x75d1('0x6'));var sox=require(_0x75d1('0x7'));var csv=require(_0x75d1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x75d1('0x9'));var _=require(_0x75d1('0xa'));var squel=require(_0x75d1('0xb'));var crypto=require(_0x75d1('0xc'));var jsforce=require(_0x75d1('0xd'));var deskjs=require(_0x75d1('0xe'));var toCsv=require(_0x75d1('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x75d1('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x75d1('0x10'));var hardwareService=require(_0x75d1('0x11'));var logger=require('../../config/logger')(_0x75d1('0x12'));var utils=require(_0x75d1('0x13'));var config=require(_0x75d1('0x14'));var licenseUtil=require(_0x75d1('0x15'));var db=require(_0x75d1('0x16'))['db'];function respondWithStatusCode(_0xd089cf,_0x49667a){_0x49667a=_0x49667a||0xcc;return function(_0x19e825){if(_0x19e825){return _0xd089cf[_0x75d1('0x17')](_0x49667a);}return _0xd089cf[_0x75d1('0x18')](_0x49667a)[_0x75d1('0x19')]();};}function respondWithResult(_0x49d723,_0x553697){_0x553697=_0x553697||0xc8;return function(_0x55b8a0){if(_0x55b8a0){return _0x49d723[_0x75d1('0x18')](_0x553697)[_0x75d1('0x1a')](_0x55b8a0);}};}function respondWithFilteredResult(_0x2fd022,_0x52e649){return function(_0x1f9620){if(_0x1f9620){var _0x3fff9b=typeof _0x52e649[_0x75d1('0x1b')]===_0x75d1('0x1c')&&typeof _0x52e649[_0x75d1('0x1d')]===_0x75d1('0x1c');var _0x2845bc=_0x1f9620[_0x75d1('0x1e')];var _0x1bc5de=_0x3fff9b?0x0:_0x52e649[_0x75d1('0x1b')];var _0x2c2a6d=_0x3fff9b?_0x1f9620['count']:_0x52e649['offset']+_0x52e649[_0x75d1('0x1d')];var _0x42b7ac;if(_0x2c2a6d>=_0x2845bc){_0x2c2a6d=_0x2845bc;_0x42b7ac=0xc8;}else{_0x42b7ac=0xce;}_0x2fd022['status'](_0x42b7ac);return _0x2fd022[_0x75d1('0x1f')](_0x75d1('0x20'),_0x1bc5de+'-'+_0x2c2a6d+'/'+_0x2845bc)[_0x75d1('0x1a')](_0x1f9620);}return null;};}function patchUpdates(_0xf6cc70){return function(_0xa42dbe){try{jsonpatch[_0x75d1('0x21')](_0xa42dbe,_0xf6cc70,!![]);}catch(_0x51d3b0){return BPromise[_0x75d1('0x22')](_0x51d3b0);}return _0xa42dbe[_0x75d1('0x23')]();};}function saveUpdates(_0x501cc7,_0x1cb58c){return function(_0x641ea4){if(_0x641ea4){return _0x641ea4['update'](_0x501cc7)[_0x75d1('0x24')](function(_0x5e70ec){return _0x5e70ec;});}return null;};}function removeEntity(_0x3a85c0,_0xc256af){return function(_0x345cf5){if(_0x345cf5){return _0x345cf5['destroy']()['then'](function(){_0x3a85c0[_0x75d1('0x18')](0xcc)[_0x75d1('0x19')]();});}};}function handleEntityNotFound(_0x315ce5,_0x18184b){return function(_0x51d043){if(!_0x51d043){_0x315ce5[_0x75d1('0x17')](0x194);}return _0x51d043;};}function handleError(_0x2b5848,_0x367238){_0x367238=_0x367238||0x1f4;return function(_0x51138e){logger['error'](_0x51138e['stack']);if(_0x51138e[_0x75d1('0x25')]){delete _0x51138e[_0x75d1('0x25')];}_0x2b5848[_0x75d1('0x18')](_0x367238)[_0x75d1('0x26')](_0x51138e);};}exports[_0x75d1('0x27')]=function(_0x519ceb,_0x4d292e){var _0x410e16={},_0x197f52={},_0x4967b5={'count':0x0,'rows':[]};var _0x2408b6=_['map'](db[_0x75d1('0x28')][_0x75d1('0x29')],function(_0x91e7c9){return{'name':_0x91e7c9[_0x75d1('0x2a')],'type':_0x91e7c9[_0x75d1('0x2b')]['key']};});_0x197f52[_0x75d1('0x2c')]=_[_0x75d1('0x2d')](_0x2408b6,_0x75d1('0x25'));_0x197f52[_0x75d1('0x2e')]=_['keys'](_0x519ceb[_0x75d1('0x2e')]);_0x197f52['filters']=_[_0x75d1('0x2f')](_0x197f52[_0x75d1('0x2c')],_0x197f52['query']);_0x410e16[_0x75d1('0x30')]=_[_0x75d1('0x2f')](_0x197f52[_0x75d1('0x2c')],qs[_0x75d1('0x31')](_0x519ceb[_0x75d1('0x2e')]['fields']));_0x410e16[_0x75d1('0x30')]=_0x410e16[_0x75d1('0x30')][_0x75d1('0x32')]?_0x410e16[_0x75d1('0x30')]:_0x197f52['model'];if(!_0x519ceb['query']['hasOwnProperty'](_0x75d1('0x33'))){_0x410e16[_0x75d1('0x1d')]=qs[_0x75d1('0x1d')](_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x1d')]);_0x410e16[_0x75d1('0x1b')]=qs[_0x75d1('0x1b')](_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x1b')]);}_0x410e16['order']=qs[_0x75d1('0x34')](_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x34')]);_0x410e16[_0x75d1('0x35')]=qs[_0x75d1('0x36')](_['pick'](_0x519ceb['query'],_0x197f52['filters']),_0x2408b6);if(_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x37')]){_0x410e16[_0x75d1('0x35')]=_[_0x75d1('0x38')](_0x410e16[_0x75d1('0x35')],{'$or':_[_0x75d1('0x2d')](_0x2408b6,function(_0x48f9f3){if(_0x48f9f3['type']!=='VIRTUAL'){var _0x3f2569={};_0x3f2569[_0x48f9f3['name']]={'$like':'%'+_0x519ceb['query'][_0x75d1('0x37')]+'%'};return _0x3f2569;}})});}_0x410e16=_[_0x75d1('0x38')]({},_0x410e16,_0x519ceb[_0x75d1('0x39')]);var _0x46854c={'where':_0x410e16['where']};return db[_0x75d1('0x28')][_0x75d1('0x1e')](_0x46854c)[_0x75d1('0x24')](function(_0x3d4137){_0x4967b5[_0x75d1('0x1e')]=_0x3d4137;if(_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x3a')]){_0x410e16[_0x75d1('0x3b')]=[{'all':!![]}];}return db[_0x75d1('0x28')][_0x75d1('0x3c')](_0x410e16);})[_0x75d1('0x24')](function(_0x93922f){_0x4967b5[_0x75d1('0x3d')]=_0x93922f;return _0x4967b5;})[_0x75d1('0x24')](respondWithFilteredResult(_0x4d292e,_0x410e16))[_0x75d1('0x3e')](handleError(_0x4d292e,null));};exports[_0x75d1('0x3f')]=function(_0x25f689,_0x2ad3ef){var _0x42c18c={'raw':!![],'where':{'id':_0x25f689[_0x75d1('0x40')]['id']}},_0x2384aa={};_0x2384aa[_0x75d1('0x2c')]=_['keys'](db['CmHopperFinal'][_0x75d1('0x29')]);_0x2384aa[_0x75d1('0x2e')]=_[_0x75d1('0x41')](_0x25f689[_0x75d1('0x2e')]);_0x2384aa['filters']=_[_0x75d1('0x2f')](_0x2384aa[_0x75d1('0x2c')],_0x2384aa[_0x75d1('0x2e')]);_0x42c18c[_0x75d1('0x30')]=_['intersection'](_0x2384aa[_0x75d1('0x2c')],qs[_0x75d1('0x31')](_0x25f689[_0x75d1('0x2e')][_0x75d1('0x31')]));_0x42c18c['attributes']=_0x42c18c[_0x75d1('0x30')]['length']?_0x42c18c[_0x75d1('0x30')]:_0x2384aa[_0x75d1('0x2c')];if(_0x25f689[_0x75d1('0x2e')][_0x75d1('0x3a')]){_0x42c18c[_0x75d1('0x3b')]=[{'all':!![]}];}_0x42c18c=_[_0x75d1('0x38')]({},_0x42c18c,_0x25f689['options']);return db[_0x75d1('0x28')]['find'](_0x42c18c)['then'](handleEntityNotFound(_0x2ad3ef,null))[_0x75d1('0x24')](respondWithResult(_0x2ad3ef,null))[_0x75d1('0x3e')](handleError(_0x2ad3ef,null));};exports[_0x75d1('0x42')]=function(_0x12bd67,_0x16f744){return db[_0x75d1('0x28')][_0x75d1('0x42')]()['then'](respondWithResult(_0x16f744,null))['catch'](handleError(_0x16f744,null));};exports[_0x75d1('0x43')]=function(_0x8ce3d2,_0x50def3){if(_0x8ce3d2[_0x75d1('0x44')][_0x75d1('0x45')]){delete _0x8ce3d2[_0x75d1('0x44')]['uniqueid'];}return db[_0x75d1('0x28')][_0x75d1('0x46')]({'where':{'uniqueid':_0x8ce3d2[_0x75d1('0x40')]['id']}})[_0x75d1('0x24')](handleEntityNotFound(_0x50def3,null))[_0x75d1('0x24')](saveUpdates(_0x8ce3d2[_0x75d1('0x44')],null))[_0x75d1('0x24')](respondWithResult(_0x50def3,null))['catch'](handleError(_0x50def3,null));};exports[_0x75d1('0x47')]=function(_0x382195,_0x16b3c0,_0x395e0b){return db[_0x75d1('0x28')][_0x75d1('0x3c')]({'raw':![],'where':{'VoiceQueueId':_0x382195[_0x75d1('0x40')]['id']},'attributes':[[db['sequelize']['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')]['literal'](_0x75d1('0x4a')))),_0x75d1('0x4b')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')]['literal'](_0x75d1('0x4c')))),_0x75d1('0x4d')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x4f')))),_0x75d1('0x50')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db['sequelize']['literal'](_0x75d1('0x51')))),'congestionContacts'],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db['sequelize']['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x52')))),_0x75d1('0x53')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db['sequelize'][_0x75d1('0x4e')](_0x75d1('0x54')))),_0x75d1('0x55')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x56')))),_0x75d1('0x57')],[db['sequelize']['fn']('COUNT',db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')]('`state`\x20=\x2019,\x201,\x20null'))),_0x75d1('0x58')]]})['then'](handleEntityNotFound(_0x16b3c0,null))[_0x75d1('0x24')](respondWithResult(_0x16b3c0,null))[_0x75d1('0x3e')](handleError(_0x16b3c0,null));};exports[_0x75d1('0x59')]=function(_0x16cc70,_0x5d2219,_0x22ce12){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'CampaignId':_0x16cc70[_0x75d1('0x40')]['id']},'attributes':[[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db['sequelize']['literal'](_0x75d1('0x4a')))),_0x75d1('0x4b')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db['sequelize'][_0x75d1('0x4e')](_0x75d1('0x4c')))),_0x75d1('0x4d')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x4f')))),_0x75d1('0x50')],[db[_0x75d1('0x49')]['fn']('COUNT',db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x51')))),_0x75d1('0x5a')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db['sequelize']['fn']('IF',db['sequelize'][_0x75d1('0x4e')](_0x75d1('0x52')))),_0x75d1('0x53')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db['sequelize']['fn']('IF',db['sequelize'][_0x75d1('0x4e')](_0x75d1('0x54')))),'abandonedContacts'],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x56')))),'reCallContacts'],[db['sequelize']['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db['sequelize'][_0x75d1('0x4e')]('`state`\x20=\x2019,\x201,\x20null'))),_0x75d1('0x58')]]})[_0x75d1('0x24')](handleEntityNotFound(_0x5d2219,null))[_0x75d1('0x24')](respondWithResult(_0x5d2219,null))['catch'](handleError(_0x5d2219,null));};exports[_0x75d1('0x5b')]=function(_0x1f9ac2,_0x290587,_0x1baaca){return db[_0x75d1('0x5c')]['find']({'where':{'id':_0x1f9ac2['params']['id']}})[_0x75d1('0x24')](handleEntityNotFound(_0x290587,null))['then'](function(_0x3f15f3){var _0xf29a9f;if(_0x3f15f3){_0xf29a9f=squel[_0x75d1('0x5d')]()['into']('cm_hopper')[_0x75d1('0x5e')](['phone',_0x75d1('0x5f'),_0x75d1('0x60'),_0x75d1('0x61'),'VoiceQueueId',_0x75d1('0x62'),_0x75d1('0x63')],squel[_0x75d1('0x64')]()[_0x75d1('0x65')](_0x75d1('0x66'),_0x75d1('0x67'))[_0x75d1('0x65')](_0x75d1('0x68'),_0x75d1('0x5f'))[_0x75d1('0x65')](_0x75d1('0x69'),_0x75d1('0x60'))[_0x75d1('0x65')](_0x75d1('0x6a'),'ListId')['field'](_0x75d1('0x6b'),_0x75d1('0x6c'))['field'](_0x75d1('0x68'),'createdAt')['field']('NOW()',_0x75d1('0x63'))[_0x75d1('0x6d')](_0x75d1('0x6e'))[_0x75d1('0x35')](_0x75d1('0x6f'),_0x1f9ac2['params']['id'][_0x75d1('0x70')]())[_0x75d1('0x35')](_0x75d1('0x71'),_0x1f9ac2[_0x75d1('0x44')][_0x75d1('0x72')]['toString']())[_0x75d1('0x35')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x75d1('0x35')](_0x75d1('0x73'),squel[_0x75d1('0x64')]()['field']('phone')['from'](_0x75d1('0x74'))[_0x75d1('0x35')](_0x75d1('0x6f'),_0x1f9ac2[_0x75d1('0x40')]['id'][_0x75d1('0x70')]()))[_0x75d1('0x35')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x75d1('0x64')]()[_0x75d1('0x65')]('calleridnum')[_0x75d1('0x6d')]('cm_hopper_final')['where']('VoiceQueueId\x20=\x20?',_0x1f9ac2[_0x75d1('0x40')]['id']['toString']())['where'](_0x75d1('0x75')))['group'](_0x75d1('0x60')))[_0x75d1('0x70')]();return db[_0x75d1('0x49')][_0x75d1('0x2e')](_0xf29a9f);}return[];})[_0x75d1('0x24')](respondWithResult(_0x290587,null))[_0x75d1('0x3e')](handleError(_0x290587,null));};exports[_0x75d1('0x76')]=function(_0x217347,_0x51b682,_0x195a0a){return db['Campaign'][_0x75d1('0x46')]({'where':{'id':_0x217347[_0x75d1('0x40')]['id']}})[_0x75d1('0x24')](handleEntityNotFound(_0x51b682,null))['then'](function(_0x10bc92){var _0x150735;if(_0x10bc92){_0x150735=squel[_0x75d1('0x5d')]()[_0x75d1('0x77')](_0x75d1('0x74'))[_0x75d1('0x5e')]([_0x75d1('0x67'),'scheduledAt',_0x75d1('0x60'),_0x75d1('0x61'),_0x75d1('0x78'),_0x75d1('0x62'),_0x75d1('0x63')],squel['select']()['field'](_0x75d1('0x66'),'phone')[_0x75d1('0x65')](_0x75d1('0x68'),_0x75d1('0x5f'))[_0x75d1('0x65')]('ANY_VALUE(ContactId)','ContactId')[_0x75d1('0x65')](_0x75d1('0x6a'),_0x75d1('0x61'))[_0x75d1('0x65')](_0x75d1('0x79'),'CampaignId')[_0x75d1('0x65')](_0x75d1('0x68'),'createdAt')[_0x75d1('0x65')](_0x75d1('0x68'),_0x75d1('0x63'))[_0x75d1('0x6d')](_0x75d1('0x6e'))[_0x75d1('0x35')]('CampaignId\x20=\x20?',_0x217347[_0x75d1('0x40')]['id'][_0x75d1('0x70')]())[_0x75d1('0x35')](_0x75d1('0x71'),_0x217347[_0x75d1('0x44')][_0x75d1('0x72')]['toString']())[_0x75d1('0x35')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x75d1('0x35')](_0x75d1('0x73'),squel[_0x75d1('0x64')]()[_0x75d1('0x65')](_0x75d1('0x67'))[_0x75d1('0x6d')]('cm_hopper')[_0x75d1('0x35')](_0x75d1('0x7a'),_0x217347[_0x75d1('0x40')]['id']['toString']()))[_0x75d1('0x35')](_0x75d1('0x73'),squel['select']()[_0x75d1('0x65')](_0x75d1('0x7b'))[_0x75d1('0x6d')](_0x75d1('0x6e'))[_0x75d1('0x35')](_0x75d1('0x7a'),_0x217347[_0x75d1('0x40')]['id'][_0x75d1('0x70')]())[_0x75d1('0x35')]('state\x20=\x204'))[_0x75d1('0x7c')](_0x75d1('0x60')))['toString']();return db[_0x75d1('0x49')][_0x75d1('0x2e')](_0x150735);}return[];})['then'](respondWithResult(_0x51b682,null))['catch'](handleError(_0x51b682,null));};exports[_0x75d1('0x7d')]=function(_0x44a017,_0x4d8e5d,_0x1f3a7e){return db['CmHopper'][_0x75d1('0x7e')]({'where':{'VoiceQueueId':_0x44a017['body'][_0x75d1('0x6c')],'CampaignId':_0x44a017[_0x75d1('0x44')][_0x75d1('0x78')],'ContactId':_0x44a017[_0x75d1('0x44')][_0x75d1('0x60')]}})[_0x75d1('0x24')](handleEntityNotFound(_0x4d8e5d,null))[_0x75d1('0x24')](function(_0x205e82){if(_0x205e82){return _0x205e82;}return null;})[_0x75d1('0x24')](respondWithResult(_0x4d8e5d,null))[_0x75d1('0x3e')](handleError(_0x4d8e5d,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index e550960..f76b711 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 _0x6f58=['calleridnum','uniqueid','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','CmHopperFinal','cm_hopper_final'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x6f58,0x147));var _0x86f5=function(_0x32c757,_0x3f3b5f){_0x32c757=_0x32c757-0x0;var _0x21bcb4=_0x6f58[_0x32c757];return _0x21bcb4;};'use strict';var _=require('lodash');var util=require(_0x86f5('0x0'));var logger=require('../../config/logger')(_0x86f5('0x1'));var moment=require(_0x86f5('0x2'));var BPromise=require(_0x86f5('0x3'));var rp=require(_0x86f5('0x4'));var fs=require('fs');var path=require(_0x86f5('0x5'));var rimraf=require(_0x86f5('0x6'));var config=require(_0x86f5('0x7'));var attributes=require(_0x86f5('0x8'));module['exports']=function(_0x4ad756,_0x6b17ad){return _0x4ad756['define'](_0x86f5('0x9'),attributes,{'tableName':_0x86f5('0xa'),'paranoid':![],'indexes':[{'name':_0x86f5('0xb'),'fields':[_0x86f5('0xb')]},{'name':'uniqueid','fields':[_0x86f5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x264d=['bluebird','request-promise','path','rimraf','./cmHopperFinal.attributes','exports','define','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x4ebefd,_0x42d171){var _0xa5f155=function(_0x3a6083){while(--_0x3a6083){_0x4ebefd['push'](_0x4ebefd['shift']());}};_0xa5f155(++_0x42d171);}(_0x264d,0x136));var _0xd264=function(_0x5e25f7,_0x39298c){_0x5e25f7=_0x5e25f7-0x0;var _0x1ae051=_0x264d[_0x5e25f7];return _0x1ae051;};'use strict';var _=require(_0xd264('0x0'));var util=require(_0xd264('0x1'));var logger=require(_0xd264('0x2'))(_0xd264('0x3'));var moment=require(_0xd264('0x4'));var BPromise=require(_0xd264('0x5'));var rp=require(_0xd264('0x6'));var fs=require('fs');var path=require(_0xd264('0x7'));var rimraf=require(_0xd264('0x8'));var config=require('../../config/environment');var attributes=require(_0xd264('0x9'));module[_0xd264('0xa')]=function(_0x2d43b6,_0x543ab0){return _0x2d43b6[_0xd264('0xb')]('CmHopperFinal',attributes,{'tableName':_0xd264('0xc'),'paranoid':![],'indexes':[{'name':_0xd264('0xd'),'fields':[_0xd264('0xd')]},{'name':_0xd264('0xe'),'fields':[_0xd264('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 6244355..9ac6251 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(_0xaf1ad,_0x24cbb9){var _0x1cc676=function(_0x2b6170){while(--_0x2b6170){_0xaf1ad['push'](_0xaf1ad['shift']());}};_0x1cc676(++_0x24cbb9);}(_0x7a54,0x106));var _0x47a5=function(_0x42c12f,_0x34cec4){_0x42c12f=_0x42c12f-0x0;var _0x5ed1f5=_0x7a54[_0x42c12f];return _0x5ed1f5;};'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(_0x316751,_0x381a70){var _0x34a386=function(_0x22fd9f){while(--_0x22fd9f){_0x316751['push'](_0x316751['shift']());}};_0x34a386(++_0x381a70);}(_0x7a54,0x106));var _0x47a5=function(_0x48226c,_0x42c1de){_0x48226c=_0x48226c-0x0;var _0x54ad80=_0x7a54[_0x48226c];return _0x54ad80;};'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 ec10777..5dc36f4 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 _0x9ce4=['get','isAuthenticated','index','describe','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','post','/voice/queue/moveContacts/:id','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','put','update','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1a2b0f,_0x25d1b){var _0x4b6e20=function(_0x14d465){while(--_0x14d465){_0x1a2b0f['push'](_0x1a2b0f['shift']());}};_0x4b6e20(++_0x25d1b);}(_0x9ce4,0x1d2));var _0x49ce=function(_0x16b962,_0x1e8b75){_0x16b962=_0x16b962-0x0;var _0x5b8877=_0x9ce4[_0x16b962];return _0x5b8877;};'use strict';var multer=require('multer');var util=require(_0x49ce('0x0'));var path=require(_0x49ce('0x1'));var timeout=require(_0x49ce('0x2'));var express=require(_0x49ce('0x3'));var router=express[_0x49ce('0x4')]();var fs_extra=require(_0x49ce('0x5'));var auth=require(_0x49ce('0x6'));var interaction=require(_0x49ce('0x7'));var config=require(_0x49ce('0x8'));var controller=require('./cmHopperFinal.controller');router[_0x49ce('0x9')]('/',auth[_0x49ce('0xa')](),controller[_0x49ce('0xb')]);router[_0x49ce('0x9')]('/describe',auth[_0x49ce('0xa')](),controller[_0x49ce('0xc')]);router[_0x49ce('0x9')]('/:id',auth[_0x49ce('0xa')](),controller[_0x49ce('0xd')]);router[_0x49ce('0x9')](_0x49ce('0xe'),auth['isAuthenticated'](),controller[_0x49ce('0xf')]);router[_0x49ce('0x9')](_0x49ce('0x10'),auth['isAuthenticated'](),controller['countContactsIvrCampaignHopperFinal']);router[_0x49ce('0x11')](_0x49ce('0x12'),auth['isAuthenticated'](),controller['moveContactsQueueCampaignHopperFinal']);router[_0x49ce('0x11')](_0x49ce('0x13'),auth[_0x49ce('0xa')](),controller[_0x49ce('0x14')]);router['post'](_0x49ce('0x15'),auth[_0x49ce('0xa')](),controller['checkContactHopper']);router[_0x49ce('0x16')]('/:id',auth[_0x49ce('0xa')](),controller[_0x49ce('0x17')]);module[_0x49ce('0x18')]=router; \ No newline at end of file +var _0x0b95=['isAuthenticated','index','get','/describe','describe','show','/voice/queue/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','/:id','update','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x8cdb08,_0x59062f){var _0xd348c3=function(_0x585252){while(--_0x585252){_0x8cdb08['push'](_0x8cdb08['shift']());}};_0xd348c3(++_0x59062f);}(_0x0b95,0x198));var _0x50b9=function(_0x43c119,_0xefad0c){_0x43c119=_0x43c119-0x0;var _0x5d525b=_0x0b95[_0x43c119];return _0x5d525b;};'use strict';var multer=require('multer');var util=require(_0x50b9('0x0'));var path=require(_0x50b9('0x1'));var timeout=require(_0x50b9('0x2'));var express=require(_0x50b9('0x3'));var router=express[_0x50b9('0x4')]();var fs_extra=require(_0x50b9('0x5'));var auth=require(_0x50b9('0x6'));var interaction=require(_0x50b9('0x7'));var config=require('../../config/environment');var controller=require('./cmHopperFinal.controller');router['get']('/',auth[_0x50b9('0x8')](),controller[_0x50b9('0x9')]);router[_0x50b9('0xa')](_0x50b9('0xb'),auth['isAuthenticated'](),controller[_0x50b9('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x50b9('0xd')]);router['get'](_0x50b9('0xe'),auth[_0x50b9('0x8')](),controller['countContactsQueueCampaignHopperFinal']);router[_0x50b9('0xa')]('/campaign/countAttributes/:id',auth[_0x50b9('0x8')](),controller[_0x50b9('0xf')]);router[_0x50b9('0x10')](_0x50b9('0x11'),auth[_0x50b9('0x8')](),controller[_0x50b9('0x12')]);router[_0x50b9('0x10')](_0x50b9('0x13'),auth['isAuthenticated'](),controller[_0x50b9('0x14')]);router[_0x50b9('0x10')](_0x50b9('0x15'),auth[_0x50b9('0x8')](),controller[_0x50b9('0x16')]);router['put'](_0x50b9('0x17'),auth['isAuthenticated'](),controller[_0x50b9('0x18')]);module[_0x50b9('0x19')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 22a870a..1fd9710 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 _0xade6=['sequelize','exports','INTEGER','DATE','STRING','BOOLEAN'];(function(_0xf5926f,_0x58bc6e){var _0x43c169=function(_0x3d187c){while(--_0x3d187c){_0xf5926f['push'](_0xf5926f['shift']());}};_0x43c169(++_0x58bc6e);}(_0xade6,0x120));var _0x6ade=function(_0x3328b4,_0x403a24){_0x3328b4=_0x3328b4-0x0;var _0x530143=_0xade6[_0x3328b4];return _0x530143;};'use strict';var Sequelize=require(_0x6ade('0x0'));module[_0x6ade('0x1')]={'state':{'type':Sequelize[_0x6ade('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x6ade('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x6ade('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6ade('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x6ade('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x6ade('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x6ade('0x4')]},'originatecalleridname':{'type':Sequelize[_0x6ade('0x4')]},'calleridnum':{'type':Sequelize[_0x6ade('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x6ade('0x3')]},'responsetime':{'type':Sequelize[_0x6ade('0x3')]},'answertime':{'type':Sequelize[_0x6ade('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x6ade('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x6ade('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x6ade('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x6ade('0x4')]},'membername':{'type':Sequelize[_0x6ade('0x4')]},'reason':{'type':Sequelize[_0x6ade('0x4')]},'amd':{'type':Sequelize[_0x6ade('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x6ade('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x6ade('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0x6ade('0x3')]},'edited':{'type':Sequelize[_0x6ade('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x6ade('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x6ade('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x6ade('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6ade('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x6ade('0x4')]}}; \ No newline at end of file +var _0xdbd3=['INTEGER','STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x1ca5d0,_0x1cedd7){var _0x4a5426=function(_0x5793a4){while(--_0x5793a4){_0x1ca5d0['push'](_0x1ca5d0['shift']());}};_0x4a5426(++_0x1cedd7);}(_0xdbd3,0xa0));var _0x3dbd=function(_0xeb4c8b,_0x1dc497){_0xeb4c8b=_0xeb4c8b-0x0;var _0x90b0d0=_0xdbd3[_0xeb4c8b];return _0x90b0d0;};'use strict';var Sequelize=require(_0x3dbd('0x0'));module[_0x3dbd('0x1')]={'state':{'type':Sequelize[_0x3dbd('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x3dbd('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x3dbd('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x3dbd('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x3dbd('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x3dbd('0x3')]},'originatecalleridname':{'type':Sequelize[_0x3dbd('0x3')]},'calleridnum':{'type':Sequelize[_0x3dbd('0x3')]},'calleridname':{'type':Sequelize[_0x3dbd('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x3dbd('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x3dbd('0x4')]},'endtime':{'type':Sequelize[_0x3dbd('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x3dbd('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x3dbd('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x3dbd('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x3dbd('0x3')]},'campaign':{'type':Sequelize[_0x3dbd('0x3')]},'campaigntype':{'type':Sequelize[_0x3dbd('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x3dbd('0x3')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x3dbd('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x3dbd('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x3dbd('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x3dbd('0x4')]},'recallme':{'type':Sequelize[_0x3dbd('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x3dbd('0x4')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x3dbd('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x3dbd('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x3dbd('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x3dbd('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x3dbd('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x3dbd('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index aa11ed3..3b98f20 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 _0xcb52=['fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','rawAttributes','include','find','catch','create','body','describe','uniqueid','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','CmHopperHistory'];(function(_0x349367,_0x1cede2){var _0x14179b=function(_0x38a191){while(--_0x38a191){_0x349367['push'](_0x349367['shift']());}};_0x14179b(++_0x1cede2);}(_0xcb52,0xc2));var _0x2cb5=function(_0x3bbb0e,_0xf4cdf2){_0x3bbb0e=_0x3bbb0e-0x0;var _0x1558b3=_0xcb52[_0x3bbb0e];return _0x1558b3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2cb5('0x0'));var rp=require(_0x2cb5('0x1'));var moment=require(_0x2cb5('0x2'));var BPromise=require(_0x2cb5('0x3'));var Mustache=require(_0x2cb5('0x4'));var util=require(_0x2cb5('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x2cb5('0x6'));var ejs=require(_0x2cb5('0x7'));var fs=require('fs');var fs_extra=require(_0x2cb5('0x8'));var _=require(_0x2cb5('0x9'));var squel=require(_0x2cb5('0xa'));var crypto=require(_0x2cb5('0xb'));var jsforce=require(_0x2cb5('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2cb5('0xd'));var Papa=require(_0x2cb5('0xe'));var Redis=require(_0x2cb5('0xf'));var authService=require(_0x2cb5('0x10'));var qs=require(_0x2cb5('0x11'));var as=require(_0x2cb5('0x12'));var hardwareService=require(_0x2cb5('0x13'));var logger=require(_0x2cb5('0x14'))(_0x2cb5('0x15'));var utils=require('../../config/utils');var config=require(_0x2cb5('0x16'));var licenseUtil=require(_0x2cb5('0x17'));var db=require(_0x2cb5('0x18'))['db'];function respondWithStatusCode(_0x1e5a03,_0x33c724){_0x33c724=_0x33c724||0xcc;return function(_0x5fbeb2){if(_0x5fbeb2){return _0x1e5a03[_0x2cb5('0x19')](_0x33c724);}return _0x1e5a03[_0x2cb5('0x1a')](_0x33c724)[_0x2cb5('0x1b')]();};}function respondWithResult(_0x4c1d7b,_0x2b1ea9){_0x2b1ea9=_0x2b1ea9||0xc8;return function(_0x116408){if(_0x116408){return _0x4c1d7b[_0x2cb5('0x1a')](_0x2b1ea9)[_0x2cb5('0x1c')](_0x116408);}};}function respondWithFilteredResult(_0xd6ab5c,_0x47ef7f){return function(_0x24995b){if(_0x24995b){var _0x51c1b2=typeof _0x47ef7f[_0x2cb5('0x1d')]==='undefined'&&typeof _0x47ef7f[_0x2cb5('0x1e')]===_0x2cb5('0x1f');var _0x321321=_0x24995b[_0x2cb5('0x20')];var _0xb60dbb=_0x51c1b2?0x0:_0x47ef7f[_0x2cb5('0x1d')];var _0x447fee=_0x51c1b2?_0x24995b[_0x2cb5('0x20')]:_0x47ef7f[_0x2cb5('0x1d')]+_0x47ef7f[_0x2cb5('0x1e')];var _0x338088;if(_0x447fee>=_0x321321){_0x447fee=_0x321321;_0x338088=0xc8;}else{_0x338088=0xce;}_0xd6ab5c[_0x2cb5('0x1a')](_0x338088);return _0xd6ab5c[_0x2cb5('0x21')](_0x2cb5('0x22'),_0xb60dbb+'-'+_0x447fee+'/'+_0x321321)[_0x2cb5('0x1c')](_0x24995b);}return null;};}function patchUpdates(_0x5c201e){return function(_0x4c12e5){try{jsonpatch[_0x2cb5('0x23')](_0x4c12e5,_0x5c201e,!![]);}catch(_0x404df4){return BPromise['reject'](_0x404df4);}return _0x4c12e5[_0x2cb5('0x24')]();};}function saveUpdates(_0x20b12c,_0x4bf9cd){return function(_0x45d57f){if(_0x45d57f){return _0x45d57f[_0x2cb5('0x25')](_0x20b12c)[_0x2cb5('0x26')](function(_0x4644ba){return _0x4644ba;});}return null;};}function removeEntity(_0x51bbfc,_0x371e9d){return function(_0x4457c1){if(_0x4457c1){return _0x4457c1[_0x2cb5('0x27')]()[_0x2cb5('0x26')](function(){_0x51bbfc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x52111b,_0x4f3360){return function(_0x4217ad){if(!_0x4217ad){_0x52111b[_0x2cb5('0x19')](0x194);}return _0x4217ad;};}function handleError(_0x5670a5,_0x393b71){_0x393b71=_0x393b71||0x1f4;return function(_0x3b9f27){logger[_0x2cb5('0x28')](_0x3b9f27[_0x2cb5('0x29')]);if(_0x3b9f27[_0x2cb5('0x2a')]){delete _0x3b9f27[_0x2cb5('0x2a')];}_0x5670a5['status'](_0x393b71)[_0x2cb5('0x2b')](_0x3b9f27);};}exports[_0x2cb5('0x2c')]=function(_0x2a7730,_0x7b88e9){var _0x5f30a2={},_0x5a8628={},_0x275970={'count':0x0,'rows':[]};var _0x12aaa5=_['map'](db[_0x2cb5('0x2d')]['rawAttributes'],function(_0x33e8ce){return{'name':_0x33e8ce[_0x2cb5('0x2e')],'type':_0x33e8ce[_0x2cb5('0x2f')][_0x2cb5('0x30')]};});_0x5a8628['model']=_['map'](_0x12aaa5,'name');_0x5a8628[_0x2cb5('0x31')]=_['keys'](_0x2a7730[_0x2cb5('0x31')]);_0x5a8628[_0x2cb5('0x32')]=_[_0x2cb5('0x33')](_0x5a8628['model'],_0x5a8628['query']);_0x5f30a2['attributes']=_['intersection'](_0x5a8628[_0x2cb5('0x34')],qs[_0x2cb5('0x35')](_0x2a7730[_0x2cb5('0x31')][_0x2cb5('0x35')]));_0x5f30a2['attributes']=_0x5f30a2[_0x2cb5('0x36')][_0x2cb5('0x37')]?_0x5f30a2[_0x2cb5('0x36')]:_0x5a8628[_0x2cb5('0x34')];if(!_0x2a7730[_0x2cb5('0x31')][_0x2cb5('0x38')](_0x2cb5('0x39'))){_0x5f30a2[_0x2cb5('0x1e')]=qs['limit'](_0x2a7730[_0x2cb5('0x31')][_0x2cb5('0x1e')]);_0x5f30a2[_0x2cb5('0x1d')]=qs[_0x2cb5('0x1d')](_0x2a7730[_0x2cb5('0x31')][_0x2cb5('0x1d')]);}_0x5f30a2[_0x2cb5('0x3a')]=qs[_0x2cb5('0x3b')](_0x2a7730[_0x2cb5('0x31')][_0x2cb5('0x3b')]);_0x5f30a2[_0x2cb5('0x3c')]=qs[_0x2cb5('0x32')](_[_0x2cb5('0x3d')](_0x2a7730['query'],_0x5a8628[_0x2cb5('0x32')]),_0x12aaa5);if(_0x2a7730[_0x2cb5('0x31')][_0x2cb5('0x3e')]){_0x5f30a2[_0x2cb5('0x3c')]=_[_0x2cb5('0x3f')](_0x5f30a2[_0x2cb5('0x3c')],{'$or':_['map'](_0x12aaa5,function(_0xabae51){if(_0xabae51[_0x2cb5('0x2f')]!==_0x2cb5('0x40')){var _0x176736={};_0x176736[_0xabae51[_0x2cb5('0x2a')]]={'$like':'%'+_0x2a7730[_0x2cb5('0x31')]['filter']+'%'};return _0x176736;}})});}_0x5f30a2=_[_0x2cb5('0x3f')]({},_0x5f30a2,_0x2a7730[_0x2cb5('0x41')]);var _0x1e26fb={'where':_0x5f30a2[_0x2cb5('0x3c')]};return db[_0x2cb5('0x2d')][_0x2cb5('0x20')](_0x1e26fb)['then'](function(_0x408ecc){_0x275970[_0x2cb5('0x20')]=_0x408ecc;if(_0x2a7730['query'][_0x2cb5('0x42')]){_0x5f30a2['include']=[{'all':!![]}];}return db[_0x2cb5('0x2d')][_0x2cb5('0x43')](_0x5f30a2);})[_0x2cb5('0x26')](function(_0x5d1cb1){_0x275970[_0x2cb5('0x44')]=_0x5d1cb1;return _0x275970;})[_0x2cb5('0x26')](respondWithFilteredResult(_0x7b88e9,_0x5f30a2))['catch'](handleError(_0x7b88e9,null));};exports[_0x2cb5('0x45')]=function(_0x1a91c3,_0x282377){var _0x535c5f={'raw':!![],'where':{'id':_0x1a91c3[_0x2cb5('0x46')]['id']}},_0x1be360={};_0x1be360[_0x2cb5('0x34')]=_[_0x2cb5('0x47')](db['CmHopperHistory'][_0x2cb5('0x48')]);_0x1be360[_0x2cb5('0x31')]=_[_0x2cb5('0x47')](_0x1a91c3[_0x2cb5('0x31')]);_0x1be360[_0x2cb5('0x32')]=_[_0x2cb5('0x33')](_0x1be360[_0x2cb5('0x34')],_0x1be360[_0x2cb5('0x31')]);_0x535c5f['attributes']=_[_0x2cb5('0x33')](_0x1be360['model'],qs[_0x2cb5('0x35')](_0x1a91c3[_0x2cb5('0x31')][_0x2cb5('0x35')]));_0x535c5f[_0x2cb5('0x36')]=_0x535c5f[_0x2cb5('0x36')][_0x2cb5('0x37')]?_0x535c5f['attributes']:_0x1be360['model'];if(_0x1a91c3[_0x2cb5('0x31')][_0x2cb5('0x42')]){_0x535c5f[_0x2cb5('0x49')]=[{'all':!![]}];}_0x535c5f=_[_0x2cb5('0x3f')]({},_0x535c5f,_0x1a91c3[_0x2cb5('0x41')]);return db[_0x2cb5('0x2d')][_0x2cb5('0x4a')](_0x535c5f)['then'](handleEntityNotFound(_0x282377,null))[_0x2cb5('0x26')](respondWithResult(_0x282377,null))[_0x2cb5('0x4b')](handleError(_0x282377,null));};exports[_0x2cb5('0x4c')]=function(_0x4cbace,_0x40f8af){return db['CmHopperHistory'][_0x2cb5('0x4c')](_0x4cbace[_0x2cb5('0x4d')],{})[_0x2cb5('0x26')](respondWithResult(_0x40f8af,0xc9))['catch'](handleError(_0x40f8af,null));};exports['describe']=function(_0x1057ed,_0x4a3079){return db['CmHopperHistory'][_0x2cb5('0x4e')]()[_0x2cb5('0x26')](respondWithResult(_0x4a3079,null))['catch'](handleError(_0x4a3079,null));};exports['update']=function(_0x58af3c,_0x10c8f2){if(_0x58af3c[_0x2cb5('0x4d')][_0x2cb5('0x4f')]){delete _0x58af3c[_0x2cb5('0x4d')]['uniqueid'];}return db[_0x2cb5('0x2d')][_0x2cb5('0x4a')]({'where':{'uniqueid':_0x58af3c['params']['id']}})['then'](handleEntityNotFound(_0x10c8f2,null))[_0x2cb5('0x26')](saveUpdates(_0x58af3c[_0x2cb5('0x4d')],null))[_0x2cb5('0x26')](respondWithResult(_0x10c8f2,null))[_0x2cb5('0x4b')](handleError(_0x10c8f2,null));}; \ No newline at end of file +var _0x5bb9=['send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','CmHopperHistory','includeAll','show','params','keys','length','include','find','catch','create','body','describe','uniqueid','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','save','update','then','destroy','error','name'];(function(_0x4cfc1d,_0x2c0927){var _0x1c01a0=function(_0x264a74){while(--_0x264a74){_0x4cfc1d['push'](_0x4cfc1d['shift']());}};_0x1c01a0(++_0x2c0927);}(_0x5bb9,0x6c));var _0x95bb=function(_0x5b49ca,_0x5eef70){_0x5b49ca=_0x5b49ca-0x0;var _0x26702f=_0x5bb9[_0x5b49ca];return _0x26702f;};'use strict';var emlformat=require(_0x95bb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x95bb('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x95bb('0x2'));var moment=require(_0x95bb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x95bb('0x4'));var util=require(_0x95bb('0x5'));var path=require(_0x95bb('0x6'));var sox=require(_0x95bb('0x7'));var csv=require(_0x95bb('0x8'));var ejs=require(_0x95bb('0x9'));var fs=require('fs');var fs_extra=require(_0x95bb('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x95bb('0xb'));var jsforce=require(_0x95bb('0xc'));var deskjs=require(_0x95bb('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x95bb('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x95bb('0xf'));var as=require(_0x95bb('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x95bb('0x11'))(_0x95bb('0x12'));var utils=require(_0x95bb('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x95bb('0x14'));var db=require(_0x95bb('0x15'))['db'];function respondWithStatusCode(_0x494a3a,_0x1fc897){_0x1fc897=_0x1fc897||0xcc;return function(_0x2dfc33){if(_0x2dfc33){return _0x494a3a[_0x95bb('0x16')](_0x1fc897);}return _0x494a3a[_0x95bb('0x17')](_0x1fc897)[_0x95bb('0x18')]();};}function respondWithResult(_0x4dad24,_0x24ff77){_0x24ff77=_0x24ff77||0xc8;return function(_0x1c7592){if(_0x1c7592){return _0x4dad24[_0x95bb('0x17')](_0x24ff77)[_0x95bb('0x19')](_0x1c7592);}};}function respondWithFilteredResult(_0x5eb33d,_0x1af749){return function(_0x526405){if(_0x526405){var _0xaef7ad=typeof _0x1af749['offset']===_0x95bb('0x1a')&&typeof _0x1af749[_0x95bb('0x1b')]===_0x95bb('0x1a');var _0x235e7e=_0x526405[_0x95bb('0x1c')];var _0x4d8557=_0xaef7ad?0x0:_0x1af749[_0x95bb('0x1d')];var _0x32dbdf=_0xaef7ad?_0x526405[_0x95bb('0x1c')]:_0x1af749['offset']+_0x1af749[_0x95bb('0x1b')];var _0x53fbab;if(_0x32dbdf>=_0x235e7e){_0x32dbdf=_0x235e7e;_0x53fbab=0xc8;}else{_0x53fbab=0xce;}_0x5eb33d['status'](_0x53fbab);return _0x5eb33d[_0x95bb('0x1e')]('Content-Range',_0x4d8557+'-'+_0x32dbdf+'/'+_0x235e7e)[_0x95bb('0x19')](_0x526405);}return null;};}function patchUpdates(_0xc1781){return function(_0x4af851){try{jsonpatch['apply'](_0x4af851,_0xc1781,!![]);}catch(_0x45daf9){return BPromise[_0x95bb('0x1f')](_0x45daf9);}return _0x4af851[_0x95bb('0x20')]();};}function saveUpdates(_0x3f7c5d,_0x54adfb){return function(_0x956442){if(_0x956442){return _0x956442[_0x95bb('0x21')](_0x3f7c5d)[_0x95bb('0x22')](function(_0x595dd9){return _0x595dd9;});}return null;};}function removeEntity(_0x2432d4,_0x5dca48){return function(_0x1e839c){if(_0x1e839c){return _0x1e839c[_0x95bb('0x23')]()['then'](function(){_0x2432d4[_0x95bb('0x17')](0xcc)[_0x95bb('0x18')]();});}};}function handleEntityNotFound(_0x1383bd,_0x249590){return function(_0x117b2e){if(!_0x117b2e){_0x1383bd['sendStatus'](0x194);}return _0x117b2e;};}function handleError(_0x49a17d,_0x2bdf4b){_0x2bdf4b=_0x2bdf4b||0x1f4;return function(_0x48460c){logger[_0x95bb('0x24')](_0x48460c['stack']);if(_0x48460c[_0x95bb('0x25')]){delete _0x48460c[_0x95bb('0x25')];}_0x49a17d[_0x95bb('0x17')](_0x2bdf4b)[_0x95bb('0x26')](_0x48460c);};}exports['index']=function(_0x34c64a,_0x2999ed){var _0x2b81f2={},_0x31a93a={},_0x3fdfab={'count':0x0,'rows':[]};var _0x5265c2=_[_0x95bb('0x27')](db['CmHopperHistory'][_0x95bb('0x28')],function(_0x23713a){return{'name':_0x23713a[_0x95bb('0x29')],'type':_0x23713a[_0x95bb('0x2a')][_0x95bb('0x2b')]};});_0x31a93a[_0x95bb('0x2c')]=_[_0x95bb('0x27')](_0x5265c2,'name');_0x31a93a['query']=_['keys'](_0x34c64a[_0x95bb('0x2d')]);_0x31a93a[_0x95bb('0x2e')]=_[_0x95bb('0x2f')](_0x31a93a['model'],_0x31a93a['query']);_0x2b81f2[_0x95bb('0x30')]=_['intersection'](_0x31a93a[_0x95bb('0x2c')],qs[_0x95bb('0x31')](_0x34c64a['query'][_0x95bb('0x31')]));_0x2b81f2[_0x95bb('0x30')]=_0x2b81f2[_0x95bb('0x30')]['length']?_0x2b81f2[_0x95bb('0x30')]:_0x31a93a[_0x95bb('0x2c')];if(!_0x34c64a[_0x95bb('0x2d')][_0x95bb('0x32')](_0x95bb('0x33'))){_0x2b81f2[_0x95bb('0x1b')]=qs[_0x95bb('0x1b')](_0x34c64a[_0x95bb('0x2d')][_0x95bb('0x1b')]);_0x2b81f2[_0x95bb('0x1d')]=qs[_0x95bb('0x1d')](_0x34c64a[_0x95bb('0x2d')][_0x95bb('0x1d')]);}_0x2b81f2[_0x95bb('0x34')]=qs[_0x95bb('0x35')](_0x34c64a[_0x95bb('0x2d')][_0x95bb('0x35')]);_0x2b81f2[_0x95bb('0x36')]=qs['filters'](_[_0x95bb('0x37')](_0x34c64a[_0x95bb('0x2d')],_0x31a93a[_0x95bb('0x2e')]),_0x5265c2);if(_0x34c64a['query']['filter']){_0x2b81f2[_0x95bb('0x36')]=_[_0x95bb('0x38')](_0x2b81f2[_0x95bb('0x36')],{'$or':_[_0x95bb('0x27')](_0x5265c2,function(_0x1914f4){if(_0x1914f4['type']!==_0x95bb('0x39')){var _0x4216c5={};_0x4216c5[_0x1914f4['name']]={'$like':'%'+_0x34c64a[_0x95bb('0x2d')][_0x95bb('0x3a')]+'%'};return _0x4216c5;}})});}_0x2b81f2=_[_0x95bb('0x38')]({},_0x2b81f2,_0x34c64a[_0x95bb('0x3b')]);var _0x4ca1ed={'where':_0x2b81f2[_0x95bb('0x36')]};return db[_0x95bb('0x3c')][_0x95bb('0x1c')](_0x4ca1ed)[_0x95bb('0x22')](function(_0xb32053){_0x3fdfab[_0x95bb('0x1c')]=_0xb32053;if(_0x34c64a[_0x95bb('0x2d')][_0x95bb('0x3d')]){_0x2b81f2['include']=[{'all':!![]}];}return db[_0x95bb('0x3c')]['findAll'](_0x2b81f2);})[_0x95bb('0x22')](function(_0x5a63c0){_0x3fdfab['rows']=_0x5a63c0;return _0x3fdfab;})['then'](respondWithFilteredResult(_0x2999ed,_0x2b81f2))['catch'](handleError(_0x2999ed,null));};exports[_0x95bb('0x3e')]=function(_0x5c041e,_0x5b45fd){var _0x238e71={'raw':!![],'where':{'id':_0x5c041e[_0x95bb('0x3f')]['id']}},_0x20e8bc={};_0x20e8bc[_0x95bb('0x2c')]=_[_0x95bb('0x40')](db[_0x95bb('0x3c')][_0x95bb('0x28')]);_0x20e8bc['query']=_['keys'](_0x5c041e[_0x95bb('0x2d')]);_0x20e8bc[_0x95bb('0x2e')]=_['intersection'](_0x20e8bc[_0x95bb('0x2c')],_0x20e8bc[_0x95bb('0x2d')]);_0x238e71[_0x95bb('0x30')]=_[_0x95bb('0x2f')](_0x20e8bc[_0x95bb('0x2c')],qs['fields'](_0x5c041e[_0x95bb('0x2d')][_0x95bb('0x31')]));_0x238e71[_0x95bb('0x30')]=_0x238e71['attributes'][_0x95bb('0x41')]?_0x238e71[_0x95bb('0x30')]:_0x20e8bc['model'];if(_0x5c041e[_0x95bb('0x2d')][_0x95bb('0x3d')]){_0x238e71[_0x95bb('0x42')]=[{'all':!![]}];}_0x238e71=_[_0x95bb('0x38')]({},_0x238e71,_0x5c041e['options']);return db['CmHopperHistory'][_0x95bb('0x43')](_0x238e71)[_0x95bb('0x22')](handleEntityNotFound(_0x5b45fd,null))[_0x95bb('0x22')](respondWithResult(_0x5b45fd,null))[_0x95bb('0x44')](handleError(_0x5b45fd,null));};exports['create']=function(_0x41e8c3,_0x59d672){return db['CmHopperHistory'][_0x95bb('0x45')](_0x41e8c3[_0x95bb('0x46')],{})[_0x95bb('0x22')](respondWithResult(_0x59d672,0xc9))[_0x95bb('0x44')](handleError(_0x59d672,null));};exports[_0x95bb('0x47')]=function(_0x231c46,_0x430485){return db[_0x95bb('0x3c')][_0x95bb('0x47')]()[_0x95bb('0x22')](respondWithResult(_0x430485,null))[_0x95bb('0x44')](handleError(_0x430485,null));};exports[_0x95bb('0x21')]=function(_0x16fdb2,_0x5aa7f1){if(_0x16fdb2[_0x95bb('0x46')][_0x95bb('0x48')]){delete _0x16fdb2[_0x95bb('0x46')][_0x95bb('0x48')];}return db[_0x95bb('0x3c')][_0x95bb('0x43')]({'where':{'uniqueid':_0x16fdb2[_0x95bb('0x3f')]['id']}})[_0x95bb('0x22')](handleEntityNotFound(_0x5aa7f1,null))[_0x95bb('0x22')](saveUpdates(_0x16fdb2['body'],null))[_0x95bb('0x22')](respondWithResult(_0x5aa7f1,null))[_0x95bb('0x44')](handleError(_0x5aa7f1,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 49f3139..fe1631a 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 _0x8a9a=['rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','cm_hopper_history','endtime','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x332e21,_0x2bf254){var _0x5aae4e=function(_0x529e90){while(--_0x529e90){_0x332e21['push'](_0x332e21['shift']());}};_0x5aae4e(++_0x2bf254);}(_0x8a9a,0x17f));var _0xa8a9=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x8a9a[_0x273c39];return _0x46d6b5;};'use strict';var _=require('lodash');var util=require(_0xa8a9('0x0'));var logger=require(_0xa8a9('0x1'))(_0xa8a9('0x2'));var moment=require(_0xa8a9('0x3'));var BPromise=require(_0xa8a9('0x4'));var rp=require(_0xa8a9('0x5'));var fs=require('fs');var path=require(_0xa8a9('0x6'));var rimraf=require(_0xa8a9('0x7'));var config=require(_0xa8a9('0x8'));var attributes=require(_0xa8a9('0x9'));module[_0xa8a9('0xa')]=function(_0x1de1c6,_0x4ac303){return _0x1de1c6[_0xa8a9('0xb')]('CmHopperHistory',attributes,{'tableName':_0xa8a9('0xc'),'paranoid':![],'indexes':[{'name':_0xa8a9('0xd'),'fields':[_0xa8a9('0xd')]},{'name':_0xa8a9('0xe'),'fields':[_0xa8a9('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1f92=['rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','../../config/logger','api','request-promise','path'];(function(_0x3307ea,_0x3d4d43){var _0x33a898=function(_0x2e6663){while(--_0x2e6663){_0x3307ea['push'](_0x3307ea['shift']());}};_0x33a898(++_0x3d4d43);}(_0x1f92,0x1ad));var _0x21f9=function(_0x59f75e,_0x3c9d80){_0x59f75e=_0x59f75e-0x0;var _0x41eaba=_0x1f92[_0x59f75e];return _0x41eaba;};'use strict';var _=require(_0x21f9('0x0'));var util=require('util');var logger=require(_0x21f9('0x1'))(_0x21f9('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x21f9('0x3'));var fs=require('fs');var path=require(_0x21f9('0x4'));var rimraf=require(_0x21f9('0x5'));var config=require(_0x21f9('0x6'));var attributes=require(_0x21f9('0x7'));module[_0x21f9('0x8')]=function(_0x259f4e,_0x3be0f2){return _0x259f4e[_0x21f9('0x9')](_0x21f9('0xa'),attributes,{'tableName':_0x21f9('0xb'),'paranoid':![],'indexes':[{'name':_0x21f9('0xc'),'fields':['endtime']},{'name':_0x21f9('0xd'),'fields':[_0x21f9('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 8b45735..64f8f42 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 _0xa79e=['predictiveIntervalAvgTalktime','AvgHandleTime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','`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=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','then','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','create','body','options','raw','CreateCmHopperHistory','CmHopperHistory','findAll','where','sequelize','col','predictiveIntervalTotalCalls','COUNT','literal','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`talktime`,\x20null'];(function(_0x1e516e,_0x2fe049){var _0x5b6fdc=function(_0x2645c5){while(--_0x2645c5){_0x1e516e['push'](_0x1e516e['shift']());}};_0x5b6fdc(++_0x2fe049);}(_0xa79e,0xf7));var _0xea79=function(_0x202c61,_0x3673e0){_0x202c61=_0x202c61-0x0;var _0x540691=_0xa79e[_0x202c61];return _0x540691;};'use strict';var _=require(_0xea79('0x0'));var util=require('util');var moment=require(_0xea79('0x1'));var BPromise=require(_0xea79('0x2'));var rs=require(_0xea79('0x3'));var fs=require('fs');var Redis=require(_0xea79('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xea79('0x5'))(_0xea79('0x6'));var config=require('../../config/environment');var jayson=require(_0xea79('0x7'));var client=jayson[_0xea79('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b0770,_0xa2a312,_0x448c7e){return new BPromise(function(_0x59ab11,_0x498460){return client['request'](_0x1b0770,_0x448c7e)[_0xea79('0x9')](function(_0x38fc39){logger['info'](_0xea79('0xa'),_0xa2a312,_0xea79('0xb'));logger[_0xea79('0xc')](_0xea79('0xd'),_0xa2a312,'request\x20sent',JSON[_0xea79('0xe')](_0x38fc39));if(_0x38fc39[_0xea79('0xf')]){if(_0x38fc39[_0xea79('0xf')][_0xea79('0x10')]===0x1f4){logger['error'](_0xea79('0xa'),_0xa2a312,_0x38fc39['error'][_0xea79('0x11')]);return _0x498460(_0x38fc39[_0xea79('0xf')][_0xea79('0x11')]);}logger['error'](_0xea79('0xa'),_0xa2a312,_0x38fc39[_0xea79('0xf')]['message']);return _0x59ab11(_0x38fc39[_0xea79('0xf')][_0xea79('0x11')]);}else{logger[_0xea79('0x12')](_0xea79('0xa'),_0xa2a312,'request\x20sent');_0x59ab11(_0x38fc39[_0xea79('0x13')][_0xea79('0x11')]);}})[_0xea79('0x14')](function(_0x265088){logger[_0xea79('0xf')](_0xea79('0xa'),_0xa2a312,_0x265088);_0x498460(_0x265088);});});}exports['CreateCmHopperHistory']=function(_0x1938c7){var _0x455434=this;return new Promise(function(_0xb5cfd2,_0x4d6f48){return db['CmHopperHistory'][_0xea79('0x15')](_0x1938c7[_0xea79('0x16')],{'raw':_0x1938c7[_0xea79('0x17')]?_0x1938c7[_0xea79('0x17')][_0xea79('0x18')]===undefined?!![]:![]:!![]})[_0xea79('0x9')](function(_0x2fa5bb){logger['info'](_0xea79('0x19'),_0x1938c7);logger['debug'](_0xea79('0x19'),_0x1938c7,JSON['stringify'](_0x2fa5bb));_0xb5cfd2(_0x2fa5bb);})['catch'](function(_0x2dac7f){logger['error'](_0xea79('0x19'),_0x2dac7f[_0xea79('0x11')],_0x1938c7);_0x4d6f48(_0x455434[_0xea79('0xf')](0x1f4,_0x2dac7f[_0xea79('0x11')]));});});};exports['AvgHandleTime']=function(_0x45adee){var _0x4065e7=this;return new Promise(function(_0x682b9f,_0x271a73){return db[_0xea79('0x1a')][_0xea79('0x1b')]({'raw':_0x45adee['options']?_0x45adee['options'][_0xea79('0x18')]===undefined?!![]:![]:!![],'where':_0x45adee['options']?_0x45adee[_0xea79('0x17')][_0xea79('0x1c')]||null:null,'attributes':[[db[_0xea79('0x1d')]['fn']('COUNT',db[_0xea79('0x1d')][_0xea79('0x1e')]('id')),_0xea79('0x1f')],[db[_0xea79('0x1d')]['fn'](_0xea79('0x20'),db['sequelize']['fn']('IF',db[_0xea79('0x1d')][_0xea79('0x21')](_0xea79('0x22')))),'predictiveIntervalAnsweredCalls'],[db['sequelize']['fn'](_0xea79('0x20'),db['sequelize']['fn']('IF',db[_0xea79('0x1d')]['literal'](_0xea79('0x23')))),_0xea79('0x24')],[db[_0xea79('0x1d')]['fn']('COUNT',db[_0xea79('0x1d')]['fn']('IF',db[_0xea79('0x1d')][_0xea79('0x21')](_0xea79('0x25')))),_0xea79('0x26')],[db['sequelize']['fn']('AVG',db[_0xea79('0x1d')]['fn']('IF',db[_0xea79('0x1d')][_0xea79('0x21')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),'predictiveIntervalAvgHoldtime'],[db['sequelize']['fn'](_0xea79('0x27'),db[_0xea79('0x1d')]['fn']('IF',db[_0xea79('0x1d')][_0xea79('0x21')](_0xea79('0x28')))),_0xea79('0x29')]]})[_0xea79('0x9')](function(_0x37bc7e){logger[_0xea79('0x12')](_0xea79('0x2a'),_0x45adee);logger['debug'](_0xea79('0x2a'),_0x45adee,JSON['stringify'](_0x37bc7e));_0x682b9f(_0x37bc7e);})['catch'](function(_0x1db264){logger[_0xea79('0xf')](_0xea79('0x2a'),_0x1db264[_0xea79('0x11')],_0x45adee);_0x271a73(_0x4065e7[_0xea79('0xf')](0x1f4,_0x1db264[_0xea79('0x11')]));});});};exports[_0xea79('0x2b')]=function(_0x24e72c){var _0x4000be=this;return new Promise(function(_0x379a8e,_0x4464aa){return db[_0xea79('0x1a')][_0xea79('0x1b')]({'raw':_0x24e72c[_0xea79('0x17')]?_0x24e72c[_0xea79('0x17')][_0xea79('0x18')]===undefined?!![]:![]:!![],'where':_0x24e72c['options']?_0x24e72c[_0xea79('0x17')][_0xea79('0x1c')]||null:null,'attributes':[[_0xea79('0x2c'),_0xea79('0x2d')],[db[_0xea79('0x1d')]['fn']('COUNT',db[_0xea79('0x1d')]['fn']('IF',db[_0xea79('0x1d')][_0xea79('0x21')](_0xea79('0x2e')))),_0xea79('0x2f')],[db[_0xea79('0x1d')]['fn'](_0xea79('0x20'),db[_0xea79('0x1d')]['fn']('IF',db['sequelize']['literal'](_0xea79('0x30')))),_0xea79('0x31')],[db['sequelize']['fn'](_0xea79('0x20'),db[_0xea79('0x1d')]['fn']('IF',db[_0xea79('0x1d')][_0xea79('0x21')](_0xea79('0x22')))),_0xea79('0x32')],[db['sequelize']['fn'](_0xea79('0x20'),db[_0xea79('0x1d')]['fn']('IF',db[_0xea79('0x1d')][_0xea79('0x21')]('`state`\x20=\x205,\x201,\x20null'))),_0xea79('0x33')],[db[_0xea79('0x1d')]['fn'](_0xea79('0x20'),db[_0xea79('0x1d')]['fn']('IF',db['sequelize'][_0xea79('0x21')](_0xea79('0x34')))),_0xea79('0x35')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xea79('0x1d')][_0xea79('0x21')](_0xea79('0x36')))),_0xea79('0x37')],[db['sequelize']['fn'](_0xea79('0x20'),db[_0xea79('0x1d')]['fn']('IF',db[_0xea79('0x1d')][_0xea79('0x21')](_0xea79('0x38')))),'outboundDropCallsDayCallersExit'],[db[_0xea79('0x1d')]['fn'](_0xea79('0x20'),db[_0xea79('0x1d')]['fn']('IF',db['sequelize'][_0xea79('0x21')](_0xea79('0x39')))),_0xea79('0x3a')],[db[_0xea79('0x1d')]['fn'](_0xea79('0x20'),db[_0xea79('0x1d')]['fn']('IF',db[_0xea79('0x1d')]['literal'](_0xea79('0x3b')))),_0xea79('0x3c')],[db[_0xea79('0x1d')]['fn']('COUNT',db[_0xea79('0x1d')]['fn']('IF',db[_0xea79('0x1d')][_0xea79('0x21')](_0xea79('0x3d')))),_0xea79('0x3e')],[db[_0xea79('0x1d')]['fn'](_0xea79('0x20'),db['sequelize']['fn']('IF',db['sequelize'][_0xea79('0x21')](_0xea79('0x3f')))),_0xea79('0x40')],[db[_0xea79('0x1d')]['fn'](_0xea79('0x20'),db[_0xea79('0x1d')]['fn']('IF',db['sequelize'][_0xea79('0x21')](_0xea79('0x41')))),_0xea79('0x42')],[db[_0xea79('0x1d')]['fn'](_0xea79('0x20'),db[_0xea79('0x1d')]['fn']('IF',db[_0xea79('0x1d')]['literal'](_0xea79('0x43')))),_0xea79('0x40')],[db[_0xea79('0x1d')]['fn'](_0xea79('0x20'),db[_0xea79('0x1d')]['fn']('IF',db['sequelize'][_0xea79('0x21')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0xea79('0x44')]],'group':[_0xea79('0x2c')]})[_0xea79('0x9')](function(_0x2f9bcd){logger[_0xea79('0x12')](_0xea79('0x2b'),_0x24e72c);logger[_0xea79('0xc')](_0xea79('0x2b'),_0x24e72c,JSON['stringify'](_0x2f9bcd));_0x379a8e(_0x2f9bcd);})['catch'](function(_0x1d8d83){logger[_0xea79('0xf')](_0xea79('0x2b'),_0x1d8d83[_0xea79('0x11')],_0x24e72c);_0x4464aa(_0x4000be[_0xea79('0xf')](0x1f4,_0x1d8d83[_0xea79('0x11')]));});});};exports[_0xea79('0x45')]=function(_0x390812){var _0x21dcdb=this;return new Promise(function(_0x24ce46,_0x40da05){return db[_0xea79('0x1a')][_0xea79('0x1b')]({'raw':_0x390812[_0xea79('0x17')]?_0x390812['options']['raw']===undefined?!![]:![]:!![],'where':_0x390812[_0xea79('0x17')]?_0x390812[_0xea79('0x17')][_0xea79('0x1c')]||null:null,'attributes':[[_0xea79('0x2c'),_0xea79('0x2d')],[db[_0xea79('0x1d')]['fn']('COUNT',db[_0xea79('0x1d')][_0xea79('0x1e')]('id')),_0xea79('0x46')],[db[_0xea79('0x1d')]['fn']('COUNT',db[_0xea79('0x1d')]['fn']('IF',db[_0xea79('0x1d')][_0xea79('0x21')](_0xea79('0x22')))),_0xea79('0x47')]],'group':[_0xea79('0x2c')]})[_0xea79('0x9')](function(_0x40c60b){logger[_0xea79('0x12')](_0xea79('0x45'),_0x390812);logger[_0xea79('0xc')](_0xea79('0x45'),_0x390812,JSON[_0xea79('0xe')](_0x40c60b));_0x24ce46(_0x40c60b);})[_0xea79('0x14')](function(_0x3eb35c){logger['error'](_0xea79('0x45'),_0x3eb35c[_0xea79('0x11')],_0x390812);_0x40da05(_0x21dcdb[_0xea79('0xf')](0x1f4,_0x3eb35c[_0xea79('0x11')]));});});}; \ No newline at end of file +var _0xb58b=['CmHopperHistory','create','body','options','raw','debug','catch','AvgHandleTime','findAll','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','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','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateCmHopperHistory'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xb58b,0x1f1));var _0xbb58=function(_0x460c52,_0x44b0ac){_0x460c52=_0x460c52-0x0;var _0x5df74d=_0xb58b[_0x460c52];return _0x5df74d;};'use strict';var _=require('lodash');var util=require(_0xbb58('0x0'));var moment=require(_0xbb58('0x1'));var BPromise=require(_0xbb58('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbb58('0x3'));var db=require(_0xbb58('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbb58('0x5'))('rpc');var config=require(_0xbb58('0x6'));var jayson=require(_0xbb58('0x7'));var client=jayson[_0xbb58('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27cbda,_0x323066,_0xe874f2){return new BPromise(function(_0x5d7fe8,_0xd94f1){return client[_0xbb58('0x9')](_0x27cbda,_0xe874f2)[_0xbb58('0xa')](function(_0x36ca50){logger[_0xbb58('0xb')](_0xbb58('0xc'),_0x323066,_0xbb58('0xd'));logger['debug'](_0xbb58('0xe'),_0x323066,'request\x20sent',JSON[_0xbb58('0xf')](_0x36ca50));if(_0x36ca50[_0xbb58('0x10')]){if(_0x36ca50[_0xbb58('0x10')][_0xbb58('0x11')]===0x1f4){logger['error'](_0xbb58('0xc'),_0x323066,_0x36ca50[_0xbb58('0x10')]['message']);return _0xd94f1(_0x36ca50[_0xbb58('0x10')][_0xbb58('0x12')]);}logger[_0xbb58('0x10')](_0xbb58('0xc'),_0x323066,_0x36ca50[_0xbb58('0x10')]['message']);return _0x5d7fe8(_0x36ca50[_0xbb58('0x10')][_0xbb58('0x12')]);}else{logger['info']('CmHopperHistory,\x20%s,\x20%s',_0x323066,_0xbb58('0xd'));_0x5d7fe8(_0x36ca50[_0xbb58('0x13')][_0xbb58('0x12')]);}})['catch'](function(_0x5edc97){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x323066,_0x5edc97);_0xd94f1(_0x5edc97);});});}exports[_0xbb58('0x14')]=function(_0x3134ea){var _0x48f3e0=this;return new Promise(function(_0xbee66,_0x497653){return db[_0xbb58('0x15')][_0xbb58('0x16')](_0x3134ea[_0xbb58('0x17')],{'raw':_0x3134ea[_0xbb58('0x18')]?_0x3134ea[_0xbb58('0x18')][_0xbb58('0x19')]===undefined?!![]:![]:!![]})[_0xbb58('0xa')](function(_0x497fd0){logger[_0xbb58('0xb')](_0xbb58('0x14'),_0x3134ea);logger[_0xbb58('0x1a')](_0xbb58('0x14'),_0x3134ea,JSON[_0xbb58('0xf')](_0x497fd0));_0xbee66(_0x497fd0);})[_0xbb58('0x1b')](function(_0x49453a){logger[_0xbb58('0x10')](_0xbb58('0x14'),_0x49453a['message'],_0x3134ea);_0x497653(_0x48f3e0[_0xbb58('0x10')](0x1f4,_0x49453a['message']));});});};exports[_0xbb58('0x1c')]=function(_0x287822){var _0x152f22=this;return new Promise(function(_0x3e215c,_0x2d111c){return db[_0xbb58('0x15')][_0xbb58('0x1d')]({'raw':_0x287822[_0xbb58('0x18')]?_0x287822['options'][_0xbb58('0x19')]===undefined?!![]:![]:!![],'where':_0x287822[_0xbb58('0x18')]?_0x287822[_0xbb58('0x18')][_0xbb58('0x1e')]||null:null,'attributes':[[db[_0xbb58('0x1f')]['fn'](_0xbb58('0x20'),db[_0xbb58('0x1f')][_0xbb58('0x21')]('id')),_0xbb58('0x22')],[db[_0xbb58('0x1f')]['fn'](_0xbb58('0x20'),db[_0xbb58('0x1f')]['fn']('IF',db[_0xbb58('0x1f')][_0xbb58('0x23')](_0xbb58('0x24')))),'predictiveIntervalAnsweredCalls'],[db[_0xbb58('0x1f')]['fn'](_0xbb58('0x20'),db[_0xbb58('0x1f')]['fn']('IF',db[_0xbb58('0x1f')][_0xbb58('0x23')](_0xbb58('0x25')))),_0xbb58('0x26')],[db[_0xbb58('0x1f')]['fn'](_0xbb58('0x20'),db['sequelize']['fn']('IF',db[_0xbb58('0x1f')][_0xbb58('0x23')](_0xbb58('0x27')))),_0xbb58('0x28')],[db[_0xbb58('0x1f')]['fn'](_0xbb58('0x29'),db[_0xbb58('0x1f')]['fn']('IF',db[_0xbb58('0x1f')][_0xbb58('0x23')](_0xbb58('0x2a')))),_0xbb58('0x2b')],[db[_0xbb58('0x1f')]['fn'](_0xbb58('0x29'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xbb58('0x2c')))),_0xbb58('0x2d')]]})[_0xbb58('0xa')](function(_0x3c7627){logger[_0xbb58('0xb')](_0xbb58('0x1c'),_0x287822);logger[_0xbb58('0x1a')](_0xbb58('0x1c'),_0x287822,JSON['stringify'](_0x3c7627));_0x3e215c(_0x3c7627);})[_0xbb58('0x1b')](function(_0x230859){logger['error'](_0xbb58('0x1c'),_0x230859['message'],_0x287822);_0x2d111c(_0x152f22[_0xbb58('0x10')](0x1f4,_0x230859['message']));});});};exports[_0xbb58('0x2e')]=function(_0x36c7b4){var _0x52f4af=this;return new Promise(function(_0x3d3aee,_0x300c7b){return db[_0xbb58('0x15')][_0xbb58('0x1d')]({'raw':_0x36c7b4[_0xbb58('0x18')]?_0x36c7b4[_0xbb58('0x18')][_0xbb58('0x19')]===undefined?!![]:![]:!![],'where':_0x36c7b4[_0xbb58('0x18')]?_0x36c7b4['options'][_0xbb58('0x1e')]||null:null,'attributes':[[_0xbb58('0x2f'),_0xbb58('0x30')],[db['sequelize']['fn']('COUNT',db[_0xbb58('0x1f')]['fn']('IF',db['sequelize'][_0xbb58('0x23')](_0xbb58('0x31')))),_0xbb58('0x32')],[db['sequelize']['fn']('COUNT',db[_0xbb58('0x1f')]['fn']('IF',db[_0xbb58('0x1f')][_0xbb58('0x23')](_0xbb58('0x33')))),_0xbb58('0x34')],[db[_0xbb58('0x1f')]['fn']('COUNT',db[_0xbb58('0x1f')]['fn']('IF',db[_0xbb58('0x1f')][_0xbb58('0x23')](_0xbb58('0x24')))),_0xbb58('0x35')],[db[_0xbb58('0x1f')]['fn']('COUNT',db[_0xbb58('0x1f')]['fn']('IF',db['sequelize'][_0xbb58('0x23')](_0xbb58('0x36')))),_0xbb58('0x37')],[db[_0xbb58('0x1f')]['fn']('COUNT',db[_0xbb58('0x1f')]['fn']('IF',db[_0xbb58('0x1f')][_0xbb58('0x23')](_0xbb58('0x38')))),'outboundCongestionCallsDay'],[db[_0xbb58('0x1f')]['fn']('COUNT',db[_0xbb58('0x1f')]['fn']('IF',db[_0xbb58('0x1f')][_0xbb58('0x23')](_0xbb58('0x39')))),_0xbb58('0x3a')],[db[_0xbb58('0x1f')]['fn'](_0xbb58('0x20'),db[_0xbb58('0x1f')]['fn']('IF',db[_0xbb58('0x1f')][_0xbb58('0x23')](_0xbb58('0x3b')))),_0xbb58('0x3c')],[db[_0xbb58('0x1f')]['fn']('COUNT',db[_0xbb58('0x1f')]['fn']('IF',db['sequelize']['literal'](_0xbb58('0x3d')))),_0xbb58('0x3e')],[db[_0xbb58('0x1f')]['fn'](_0xbb58('0x20'),db[_0xbb58('0x1f')]['fn']('IF',db[_0xbb58('0x1f')][_0xbb58('0x23')](_0xbb58('0x3f')))),_0xbb58('0x40')],[db[_0xbb58('0x1f')]['fn'](_0xbb58('0x20'),db['sequelize']['fn']('IF',db[_0xbb58('0x1f')][_0xbb58('0x23')]('`state`\x20=\x2014,\x201,\x20null'))),_0xbb58('0x41')],[db[_0xbb58('0x1f')]['fn'](_0xbb58('0x20'),db[_0xbb58('0x1f')]['fn']('IF',db['sequelize'][_0xbb58('0x23')]('`state`\x20=\x2018,\x201,\x20null'))),_0xbb58('0x42')],[db[_0xbb58('0x1f')]['fn'](_0xbb58('0x20'),db['sequelize']['fn']('IF',db[_0xbb58('0x1f')][_0xbb58('0x23')]('`state`\x20=\x2016,\x201,\x20null'))),_0xbb58('0x43')],[db['sequelize']['fn'](_0xbb58('0x20'),db[_0xbb58('0x1f')]['fn']('IF',db[_0xbb58('0x1f')][_0xbb58('0x23')](_0xbb58('0x44')))),_0xbb58('0x42')],[db[_0xbb58('0x1f')]['fn']('COUNT',db[_0xbb58('0x1f')]['fn']('IF',db[_0xbb58('0x1f')]['literal'](_0xbb58('0x45')))),_0xbb58('0x46')]],'group':['campaign']})[_0xbb58('0xa')](function(_0x44636b){logger[_0xbb58('0xb')]('GetVoiceQueueHopperHistory',_0x36c7b4);logger[_0xbb58('0x1a')](_0xbb58('0x2e'),_0x36c7b4,JSON[_0xbb58('0xf')](_0x44636b));_0x3d3aee(_0x44636b);})['catch'](function(_0x537ed5){logger['error'](_0xbb58('0x2e'),_0x537ed5[_0xbb58('0x12')],_0x36c7b4);_0x300c7b(_0x52f4af[_0xbb58('0x10')](0x1f4,_0x537ed5['message']));});});};exports['GetCampaignHopperHistory']=function(_0x1573d1){var _0x40c55d=this;return new Promise(function(_0x37bb99,_0x23ed08){return db[_0xbb58('0x15')]['findAll']({'raw':_0x1573d1[_0xbb58('0x18')]?_0x1573d1[_0xbb58('0x18')][_0xbb58('0x19')]===undefined?!![]:![]:!![],'where':_0x1573d1['options']?_0x1573d1[_0xbb58('0x18')][_0xbb58('0x1e')]||null:null,'attributes':[[_0xbb58('0x2f'),_0xbb58('0x30')],[db[_0xbb58('0x1f')]['fn']('COUNT',db[_0xbb58('0x1f')][_0xbb58('0x21')]('id')),_0xbb58('0x47')],[db[_0xbb58('0x1f')]['fn'](_0xbb58('0x20'),db[_0xbb58('0x1f')]['fn']('IF',db[_0xbb58('0x1f')][_0xbb58('0x23')]('`state`\x20=\x204,\x201,\x20null'))),_0xbb58('0x48')]],'group':['campaign']})[_0xbb58('0xa')](function(_0x29c28b){logger[_0xbb58('0xb')](_0xbb58('0x49'),_0x1573d1);logger[_0xbb58('0x1a')](_0xbb58('0x49'),_0x1573d1,JSON[_0xbb58('0xf')](_0x29c28b));_0x37bb99(_0x29c28b);})[_0xbb58('0x1b')](function(_0x19ef37){logger[_0xbb58('0x10')](_0xbb58('0x49'),_0x19ef37['message'],_0x1573d1);_0x23ed08(_0x40c55d[_0xbb58('0x10')](0x1f4,_0x19ef37[_0xbb58('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 062aef5..bb65e32 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 _0x7d21=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x5a4663,_0x27a762){var _0x4876d8=function(_0x46bc72){while(--_0x46bc72){_0x5a4663['push'](_0x5a4663['shift']());}};_0x4876d8(++_0x27a762);}(_0x7d21,0x1a2));var _0x17d2=function(_0x43350b,_0xa7d264){_0x43350b=_0x43350b-0x0;var _0x3b1040=_0x7d21[_0x43350b];return _0x3b1040;};'use strict';var multer=require(_0x17d2('0x0'));var util=require(_0x17d2('0x1'));var path=require(_0x17d2('0x2'));var timeout=require(_0x17d2('0x3'));var express=require(_0x17d2('0x4'));var router=express[_0x17d2('0x5')]();var fs_extra=require(_0x17d2('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x17d2('0x7'));var config=require(_0x17d2('0x8'));var controller=require('./cmHopperHistory.controller');router[_0x17d2('0x9')]('/',auth[_0x17d2('0xa')](),controller[_0x17d2('0xb')]);router[_0x17d2('0x9')](_0x17d2('0xc'),auth[_0x17d2('0xa')](),controller[_0x17d2('0xd')]);router[_0x17d2('0x9')](_0x17d2('0xe'),auth['isAuthenticated'](),controller[_0x17d2('0xf')]);router[_0x17d2('0x10')]('/',auth['isAuthenticated'](),controller[_0x17d2('0x11')]);router[_0x17d2('0x12')]('/:id',auth['isAuthenticated'](),controller['update']);module['exports']=router; \ No newline at end of file +var _0x06fa=['put','update','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./cmHopperHistory.controller','index','isAuthenticated','describe','get','show','post','create'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x06fa,0x6f));var _0xa06f=function(_0x6d40ac,_0x37cb32){_0x6d40ac=_0x6d40ac-0x0;var _0x32fc0e=_0x06fa[_0x6d40ac];return _0x32fc0e;};'use strict';var multer=require(_0xa06f('0x0'));var util=require(_0xa06f('0x1'));var path=require(_0xa06f('0x2'));var timeout=require(_0xa06f('0x3'));var express=require(_0xa06f('0x4'));var router=express['Router']();var fs_extra=require(_0xa06f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa06f('0x6'));var config=require('../../config/environment');var controller=require(_0xa06f('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xa06f('0x8')]);router['get']('/describe',auth[_0xa06f('0x9')](),controller[_0xa06f('0xa')]);router[_0xa06f('0xb')]('/:id',auth[_0xa06f('0x9')](),controller[_0xa06f('0xc')]);router[_0xa06f('0xd')]('/',auth[_0xa06f('0x9')](),controller[_0xa06f('0xe')]);router[_0xa06f('0xf')]('/:id',auth[_0xa06f('0x9')](),controller[_0xa06f('0x10')]);module[_0xa06f('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 243d57e..26f971c 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 _0xc92f=['exports','name','STRING','sequelize'];(function(_0x5256aa,_0x484e8f){var _0x137e79=function(_0x325020){while(--_0x325020){_0x5256aa['push'](_0x5256aa['shift']());}};_0x137e79(++_0x484e8f);}(_0xc92f,0xf3));var _0xfc92=function(_0x3f83b5,_0x4c73d4){_0x3f83b5=_0x3f83b5-0x0;var _0x3804e9=_0xc92f[_0x3f83b5];return _0x3804e9;};'use strict';var Sequelize=require(_0xfc92('0x0'));module[_0xfc92('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xfc92('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xfc92('0x3')]},'dialPrefix':{'type':Sequelize[_0xfc92('0x3')]}}; \ No newline at end of file +var _0x2086=['sequelize','exports','STRING','name'];(function(_0x3d1a2c,_0x2ded19){var _0x22af84=function(_0x5ccd90){while(--_0x5ccd90){_0x3d1a2c['push'](_0x3d1a2c['shift']());}};_0x22af84(++_0x2ded19);}(_0x2086,0x124));var _0x6208=function(_0x44ebfd,_0x5c034c){_0x44ebfd=_0x44ebfd-0x0;var _0x8c9d6b=_0x2086[_0x44ebfd];return _0x8c9d6b;};'use strict';var Sequelize=require(_0x6208('0x0'));module[_0x6208('0x1')]={'name':{'type':Sequelize[_0x6208('0x2')],'unique':_0x6208('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x6208('0x2')]},'dialPrefix':{'type':Sequelize[_0x6208('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index da5828d..3c84802 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 _0x9bd1=['role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','getDispositions','findOne','nolimit','map','removeDispositions','ids','CmContact','isArray','tags','join','push','omit','success','dataValues','errors','message','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','raw','getContactsCsv','ContactItemType','alias','select','from','cm_contacts','field','c.cf_','customField_','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description_additionalPhone_','toString','each','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','attachment;\x20filename=','list_%d_%s.csv','download','addCustomField','sequelize','transaction','Sequelize','TEXT','text','number','BOOLEAN','queryInterface','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','User','getAgents','info','eml-format','rimraf','moment','bluebird','mustache','path','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./cmList.socket','register','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','then','get','Lists','name','send','index','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','CmList','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x358d28,_0x2819be){var _0x849e2=function(_0x344cae){while(--_0x344cae){_0x358d28['push'](_0x358d28['shift']());}};_0x849e2(++_0x2819be);}(_0x9bd1,0x17f));var _0x19bd=function(_0x3e5c7a,_0x5e1081){_0x3e5c7a=_0x3e5c7a-0x0;var _0x3ad833=_0x9bd1[_0x3e5c7a];return _0x3ad833;};'use strict';var emlformat=require(_0x19bd('0x0'));var rimraf=require(_0x19bd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x19bd('0x2'));var BPromise=require(_0x19bd('0x3'));var Mustache=require(_0x19bd('0x4'));var util=require('util');var path=require(_0x19bd('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x19bd('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x19bd('0x7'));var squel=require(_0x19bd('0x8'));var crypto=require('crypto');var jsforce=require(_0x19bd('0x9'));var deskjs=require(_0x19bd('0xa'));var toCsv=require(_0x19bd('0xb'));var querystring=require(_0x19bd('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x19bd('0xd'));var qs=require(_0x19bd('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x19bd('0xf'))('api');var utils=require(_0x19bd('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x19bd('0x11'));var db=require(_0x19bd('0x12'))['db'];var csv_results;config[_0x19bd('0x13')]=_[_0x19bd('0x14')](config[_0x19bd('0x13')],{'host':_0x19bd('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x19bd('0x13')]));require(_0x19bd('0x16'))[_0x19bd('0x17')](socket);function respondWithStatusCode(_0xce9ad9,_0x4b1691){_0x4b1691=_0x4b1691||0xcc;return function(_0xaf11e5){if(_0xaf11e5){return _0xce9ad9[_0x19bd('0x18')](_0x4b1691);}return _0xce9ad9[_0x19bd('0x19')](_0x4b1691)[_0x19bd('0x1a')]();};}function respondWithResult(_0x5a5002,_0x4e2294){_0x4e2294=_0x4e2294||0xc8;return function(_0x5bb01c){if(_0x5bb01c){return _0x5a5002[_0x19bd('0x19')](_0x4e2294)['json'](_0x5bb01c);}};}function respondWithFilteredResult(_0xb485b8,_0x558611){return function(_0x163398){if(_0x163398){var _0x5f07f1=typeof _0x558611['offset']===_0x19bd('0x1b')&&typeof _0x558611[_0x19bd('0x1c')]===_0x19bd('0x1b');var _0x564cc5=_0x163398[_0x19bd('0x1d')];var _0x17653d=_0x5f07f1?0x0:_0x558611[_0x19bd('0x1e')];var _0x131f3c=_0x5f07f1?_0x163398[_0x19bd('0x1d')]:_0x558611[_0x19bd('0x1e')]+_0x558611['limit'];var _0x48a39a;if(_0x131f3c>=_0x564cc5){_0x131f3c=_0x564cc5;_0x48a39a=0xc8;}else{_0x48a39a=0xce;}_0xb485b8['status'](_0x48a39a);return _0xb485b8[_0x19bd('0x1f')](_0x19bd('0x20'),_0x17653d+'-'+_0x131f3c+'/'+_0x564cc5)[_0x19bd('0x21')](_0x163398);}return null;};}function patchUpdates(_0x18f265){return function(_0x39db8f){try{jsonpatch[_0x19bd('0x22')](_0x39db8f,_0x18f265,!![]);}catch(_0x180799){return BPromise[_0x19bd('0x23')](_0x180799);}return _0x39db8f[_0x19bd('0x24')]();};}function saveUpdates(_0x5e6b7d,_0x481ed1){return function(_0x5e0ee3){if(_0x5e0ee3){return _0x5e0ee3[_0x19bd('0x25')](_0x5e6b7d)['then'](function(_0x5329b2){return _0x5329b2;});}return null;};}function removeEntity(_0x4e713f,_0x10d002){return function(_0x4952b2){if(_0x4952b2){return _0x4952b2[_0x19bd('0x26')]()[_0x19bd('0x27')](function(){var _0x543d16=_0x4952b2[_0x19bd('0x28')]({'plain':!![]});var _0x3eacb2=_0x19bd('0x29');return db['UserProfileResource'][_0x19bd('0x26')]({'where':{'type':_0x3eacb2,'resourceId':_0x543d16['id']}})[_0x19bd('0x27')](function(){return _0x4952b2;});})[_0x19bd('0x27')](function(){_0x4e713f[_0x19bd('0x19')](0xcc)[_0x19bd('0x1a')]();});}};}function handleEntityNotFound(_0x1c42cb,_0x52927c){return function(_0xa06ee5){if(!_0xa06ee5){_0x1c42cb['sendStatus'](0x194);}return _0xa06ee5;};}function handleError(_0x5ca5e1,_0x5275ce){_0x5275ce=_0x5275ce||0x1f4;return function(_0x4e605a){logger['error'](_0x4e605a['stack']);if(_0x4e605a[_0x19bd('0x2a')]){delete _0x4e605a[_0x19bd('0x2a')];}_0x5ca5e1['status'](_0x5275ce)[_0x19bd('0x2b')](_0x4e605a);};}exports[_0x19bd('0x2c')]=function(_0x3ca211,_0x54f531){var _0x1d8d64={},_0x3e60bc={},_0x1e2289={'count':0x0,'rows':[]};var _0x5a0499=_['map'](db['CmList']['rawAttributes'],function(_0x3cbee3){return{'name':_0x3cbee3['fieldName'],'type':_0x3cbee3[_0x19bd('0x2d')]['key']};});_0x3e60bc[_0x19bd('0x2e')]=_['map'](_0x5a0499,_0x19bd('0x2a'));_0x3e60bc[_0x19bd('0x2f')]=_['keys'](_0x3ca211[_0x19bd('0x2f')]);_0x3e60bc[_0x19bd('0x30')]=_[_0x19bd('0x31')](_0x3e60bc[_0x19bd('0x2e')],_0x3e60bc[_0x19bd('0x2f')]);_0x1d8d64[_0x19bd('0x32')]=_[_0x19bd('0x31')](_0x3e60bc['model'],qs[_0x19bd('0x33')](_0x3ca211['query'][_0x19bd('0x33')]));_0x1d8d64[_0x19bd('0x32')]=_0x1d8d64[_0x19bd('0x32')][_0x19bd('0x34')]?_0x1d8d64[_0x19bd('0x32')]:_0x3e60bc[_0x19bd('0x2e')];if(!_0x3ca211[_0x19bd('0x2f')][_0x19bd('0x35')]('nolimit')){_0x1d8d64['limit']=qs[_0x19bd('0x1c')](_0x3ca211[_0x19bd('0x2f')]['limit']);_0x1d8d64['offset']=qs[_0x19bd('0x1e')](_0x3ca211['query'][_0x19bd('0x1e')]);}_0x1d8d64[_0x19bd('0x36')]=qs['sort'](_0x3ca211[_0x19bd('0x2f')][_0x19bd('0x37')]);_0x1d8d64[_0x19bd('0x38')]=qs['filters'](_[_0x19bd('0x39')](_0x3ca211[_0x19bd('0x2f')],_0x3e60bc['filters']),_0x5a0499);if(_0x3ca211[_0x19bd('0x2f')][_0x19bd('0x3a')]){_0x1d8d64[_0x19bd('0x38')]=_[_0x19bd('0x3b')](_0x1d8d64[_0x19bd('0x38')],{'$or':_['map'](_0x5a0499,function(_0x5351d7){if(_0x5351d7[_0x19bd('0x2d')]!=='VIRTUAL'){var _0x4a0f49={};_0x4a0f49[_0x5351d7[_0x19bd('0x2a')]]={'$like':'%'+_0x3ca211[_0x19bd('0x2f')][_0x19bd('0x3a')]+'%'};return _0x4a0f49;}})});}_0x1d8d64=_['merge']({},_0x1d8d64,_0x3ca211[_0x19bd('0x3c')]);var _0x5859e9={'where':_0x1d8d64[_0x19bd('0x38')]};return db[_0x19bd('0x3d')][_0x19bd('0x1d')](_0x5859e9)[_0x19bd('0x27')](function(_0xbfd7f8){_0x1e2289[_0x19bd('0x1d')]=_0xbfd7f8;if(_0x3ca211['query'][_0x19bd('0x3e')]){_0x1d8d64[_0x19bd('0x3f')]=[{'all':!![]}];}return db[_0x19bd('0x3d')][_0x19bd('0x40')](_0x1d8d64);})[_0x19bd('0x27')](function(_0x2c9ef6){_0x1e2289[_0x19bd('0x41')]=_0x2c9ef6;return _0x1e2289;})[_0x19bd('0x27')](respondWithFilteredResult(_0x54f531,_0x1d8d64))[_0x19bd('0x42')](handleError(_0x54f531,null));};exports[_0x19bd('0x43')]=function(_0x5368ec,_0x37d9bb){var _0x13b1e0={'raw':![],'where':{'id':_0x5368ec[_0x19bd('0x44')]['id']}},_0x3a5873={};_0x3a5873[_0x19bd('0x2e')]=_[_0x19bd('0x45')](db[_0x19bd('0x3d')][_0x19bd('0x46')]);_0x3a5873['query']=_[_0x19bd('0x45')](_0x5368ec[_0x19bd('0x2f')]);_0x3a5873[_0x19bd('0x30')]=_[_0x19bd('0x31')](_0x3a5873['model'],_0x3a5873[_0x19bd('0x2f')]);_0x13b1e0[_0x19bd('0x32')]=_[_0x19bd('0x31')](_0x3a5873[_0x19bd('0x2e')],qs[_0x19bd('0x33')](_0x5368ec[_0x19bd('0x2f')][_0x19bd('0x33')]));_0x13b1e0[_0x19bd('0x32')]=_0x13b1e0[_0x19bd('0x32')][_0x19bd('0x34')]?_0x13b1e0['attributes']:_0x3a5873['model'];if(_0x5368ec[_0x19bd('0x2f')][_0x19bd('0x3e')]){_0x13b1e0['include']=[{'all':!![]}];}_0x13b1e0=_['merge']({},_0x13b1e0,_0x5368ec[_0x19bd('0x3c')]);return db['CmList'][_0x19bd('0x47')](_0x13b1e0)[_0x19bd('0x27')](handleEntityNotFound(_0x37d9bb,null))[_0x19bd('0x27')](respondWithResult(_0x37d9bb,null))[_0x19bd('0x42')](handleError(_0x37d9bb,null));};exports[_0x19bd('0x48')]=function(_0x3e57d7,_0x1eb804){return db[_0x19bd('0x3d')][_0x19bd('0x48')](_0x3e57d7[_0x19bd('0x49')],{})[_0x19bd('0x27')](function(_0x492458){var _0x3de7a4=_0x3e57d7[_0x19bd('0x4a')][_0x19bd('0x28')]({'plain':!![]});if(!_0x3de7a4)throw new Error(_0x19bd('0x4b'));if(_0x3de7a4[_0x19bd('0x4c')]==='user'){var _0x42a135=_0x492458[_0x19bd('0x28')]({'plain':!![]});var _0xaaf0ee=_0x19bd('0x29');return db[_0x19bd('0x4d')][_0x19bd('0x47')]({'where':{'name':_0xaaf0ee,'userProfileId':_0x3de7a4[_0x19bd('0x4e')]},'raw':!![]})[_0x19bd('0x27')](function(_0x5a5c25){if(_0x5a5c25&&_0x5a5c25['autoAssociation']===0x0){return db['UserProfileResource'][_0x19bd('0x48')]({'name':_0x42a135[_0x19bd('0x2a')],'resourceId':_0x42a135['id'],'type':_0x5a5c25['name'],'sectionId':_0x5a5c25['id']},{})[_0x19bd('0x27')](function(){return _0x492458;});}else{return _0x492458;}})['catch'](function(_0x2e9208){logger[_0x19bd('0x4f')](_0x19bd('0x50'),_0x2e9208);throw _0x2e9208;});}return _0x492458;})[_0x19bd('0x27')](respondWithResult(_0x1eb804,0xc9))[_0x19bd('0x42')](handleError(_0x1eb804,null));};exports['update']=function(_0x48144e,_0x1b96f6){if(_0x48144e[_0x19bd('0x49')]['id']){delete _0x48144e['body']['id'];}return db[_0x19bd('0x3d')]['find']({'where':{'id':_0x48144e[_0x19bd('0x44')]['id']}})[_0x19bd('0x27')](handleEntityNotFound(_0x1b96f6,null))[_0x19bd('0x27')](saveUpdates(_0x48144e['body'],null))[_0x19bd('0x27')](respondWithResult(_0x1b96f6,null))[_0x19bd('0x42')](handleError(_0x1b96f6,null));};exports[_0x19bd('0x26')]=function(_0x3096a4,_0x1f6d9d){return db[_0x19bd('0x3d')][_0x19bd('0x47')]({'where':{'id':_0x3096a4[_0x19bd('0x44')]['id']}})[_0x19bd('0x27')](handleEntityNotFound(_0x1f6d9d,null))['then'](removeEntity(_0x1f6d9d,null))[_0x19bd('0x42')](handleError(_0x1f6d9d,null));};exports['describe']=function(_0x42103f,_0x11494b){return db[_0x19bd('0x3d')][_0x19bd('0x51')]()['then'](respondWithResult(_0x11494b,null))[_0x19bd('0x42')](handleError(_0x11494b,null));};exports[_0x19bd('0x52')]=function(_0x538555,_0x180c8f,_0x33be01){if(_0x538555[_0x19bd('0x49')]['id']){delete _0x538555[_0x19bd('0x49')]['id'];}return db[_0x19bd('0x3d')]['find']({'where':{'id':_0x538555['params']['id']}})['then'](handleEntityNotFound(_0x180c8f,null))[_0x19bd('0x27')](function(_0x516a86){if(_0x516a86){_0x538555[_0x19bd('0x49')][_0x19bd('0x53')]=_0x516a86['id'];return db[_0x19bd('0x54')]['create'](_0x538555[_0x19bd('0x49')]);}})[_0x19bd('0x27')](respondWithResult(_0x180c8f,null))['catch'](handleError(_0x180c8f,null));};exports[_0x19bd('0x55')]=function(_0x597265,_0x424719,_0x41f8ec){var _0x45a11d={'raw':![],'where':{}};var _0x127f7e={};var _0x450b9c={'count':0x0,'rows':[]};return db[_0x19bd('0x3d')][_0x19bd('0x56')]({'where':{'id':_0x597265[_0x19bd('0x44')]['id']}})['then'](handleEntityNotFound(_0x424719,null))[_0x19bd('0x27')](function(_0x1ba195){if(_0x1ba195){_0x127f7e[_0x19bd('0x2e')]=_['keys'](db['Disposition'][_0x19bd('0x46')]);_0x127f7e[_0x19bd('0x2f')]=_[_0x19bd('0x45')](_0x597265[_0x19bd('0x2f')]);_0x127f7e[_0x19bd('0x30')]=_[_0x19bd('0x31')](_0x127f7e[_0x19bd('0x2e')],_0x127f7e['query']);_0x45a11d[_0x19bd('0x32')]=_[_0x19bd('0x31')](_0x127f7e[_0x19bd('0x2e')],qs[_0x19bd('0x33')](_0x597265[_0x19bd('0x2f')][_0x19bd('0x33')]));_0x45a11d[_0x19bd('0x32')]=_0x45a11d[_0x19bd('0x32')][_0x19bd('0x34')]?_0x45a11d['attributes']:_0x127f7e[_0x19bd('0x2e')];if(!_0x597265[_0x19bd('0x2f')][_0x19bd('0x35')](_0x19bd('0x57'))){_0x45a11d['limit']=qs[_0x19bd('0x1c')](_0x597265[_0x19bd('0x2f')]['limit']);_0x45a11d[_0x19bd('0x1e')]=qs[_0x19bd('0x1e')](_0x597265['query'][_0x19bd('0x1e')]);}_0x45a11d[_0x19bd('0x36')]=qs[_0x19bd('0x37')](_0x597265[_0x19bd('0x2f')][_0x19bd('0x37')]);_0x45a11d[_0x19bd('0x38')]=qs[_0x19bd('0x30')](_[_0x19bd('0x39')](_0x597265[_0x19bd('0x2f')],_0x127f7e[_0x19bd('0x30')]));_0x45a11d[_0x19bd('0x38')]['ListId']=_0x1ba195['id'];if(_0x597265['query'][_0x19bd('0x3a')]){_0x45a11d['where']=_[_0x19bd('0x3b')](_0x45a11d[_0x19bd('0x38')],{'$or':_[_0x19bd('0x58')](_0x45a11d[_0x19bd('0x32')],function(_0x2deffb){var _0x221178={};_0x221178[_0x2deffb]={'$like':'%'+_0x597265[_0x19bd('0x2f')][_0x19bd('0x3a')]+'%'};return _0x221178;})});}_0x45a11d=_[_0x19bd('0x3b')]({},_0x45a11d,_0x597265[_0x19bd('0x3c')]);return db[_0x19bd('0x54')][_0x19bd('0x1d')]({'where':_0x45a11d[_0x19bd('0x38')]})[_0x19bd('0x27')](function(_0x4c85f7){_0x450b9c[_0x19bd('0x1d')]=_0x4c85f7;if(_0x597265[_0x19bd('0x2f')][_0x19bd('0x3e')]){_0x45a11d[_0x19bd('0x3f')]=[{'all':!![]}];}return db[_0x19bd('0x54')][_0x19bd('0x40')](_0x45a11d);})[_0x19bd('0x27')](function(_0x39a875){_0x450b9c[_0x19bd('0x41')]=_0x39a875;return _0x450b9c;});}})[_0x19bd('0x27')](respondWithFilteredResult(_0x424719,_0x45a11d))['catch'](handleError(_0x424719,null));};exports[_0x19bd('0x59')]=function(_0x257dfd,_0x49798b,_0x24a6ea){return db['CmList'][_0x19bd('0x47')]({'where':{'id':_0x257dfd[_0x19bd('0x44')]['id']}})[_0x19bd('0x27')](handleEntityNotFound(_0x49798b,null))['then'](function(_0x260e7e){if(_0x260e7e){return _0x260e7e[_0x19bd('0x59')](_0x257dfd[_0x19bd('0x2f')][_0x19bd('0x5a')]);}})[_0x19bd('0x27')](respondWithStatusCode(_0x49798b,null))[_0x19bd('0x42')](handleError(_0x49798b,null));};exports['addContacts']=function(_0x2a8155,_0x328e9a,_0xac1aef){return db[_0x19bd('0x3d')][_0x19bd('0x47')]({'where':{'id':_0x2a8155[_0x19bd('0x44')]['id']}})[_0x19bd('0x27')](handleEntityNotFound(_0x328e9a,null))[_0x19bd('0x27')](function(_0x44145d){if(_0x44145d){var _0x5ee0bc=[];var _0x504ab5={'success':[],'errors':[]};return db[_0x19bd('0x5b')][_0x19bd('0x51')]()[_0x19bd('0x27')](function(_0x304d77){if(_0x2a8155[_0x19bd('0x49')]['tags']&&_[_0x19bd('0x5c')](_0x2a8155[_0x19bd('0x49')][_0x19bd('0x5d')])){if(_0x2a8155[_0x19bd('0x49')][_0x19bd('0x5d')]['length']){_0x2a8155[_0x19bd('0x49')][_0x19bd('0x5d')]=_0x2a8155[_0x19bd('0x49')][_0x19bd('0x5d')][_0x19bd('0x5e')](';')+';';}else{_0x2a8155['body']['tags']=null;}}else{_0x2a8155[_0x19bd('0x49')]['tags']=null;}if(_0x2a8155[_0x19bd('0x49')]&&_[_0x19bd('0x5c')](_0x2a8155['body'])){for(var _0x185152=0x0;_0x185152<_0x2a8155[_0x19bd('0x49')]['length'];_0x185152+=0x1){_0x2a8155[_0x19bd('0x49')][_0x185152]['ListId']=_0x2a8155['params']['id'];_0x5ee0bc[_0x19bd('0x5f')](_0x2a8155['body'][_0x185152]);}return BPromise['each'](_0x5ee0bc,function(_0x365f8e){return db[_0x19bd('0x5b')][_0x19bd('0x48')](_[_0x19bd('0x60')](_0x365f8e,['ids','id'])||{},{'fields':_[_0x19bd('0x45')](_0x304d77),'raw':!![]})[_0x19bd('0x27')](function(_0x334f74){_0x504ab5[_0x19bd('0x61')]['push'](_0x334f74[_0x19bd('0x62')]);})[_0x19bd('0x42')](function(_0x1d1ce2){_0x504ab5[_0x19bd('0x63')][_0x19bd('0x5f')]({'data':_0x365f8e,'error':_0x1d1ce2[_0x19bd('0x64')]});});})[_0x19bd('0x27')](function(_0x25f651){return _0x504ab5;})[_0x19bd('0x42')](function(_0x25b34f){return _0x25b34f;});}else{_0x328e9a[_0x19bd('0x19')](0x190)['json']({'message':'Malformed\x20request\x20syntax'});}});}})[_0x19bd('0x27')](respondWithResult(_0x328e9a,null))['catch'](handleError(_0x328e9a,null));};exports[_0x19bd('0x65')]=function(_0x25f0f0,_0x592638,_0x58b096){var _0x581707;return db[_0x19bd('0x3d')][_0x19bd('0x47')]({'where':{'id':_0x25f0f0[_0x19bd('0x44')]['id']},'include':[{'model':db[_0x19bd('0x66')],'as':_0x19bd('0x67')}]})[_0x19bd('0x27')](handleEntityNotFound(_0x592638,null))['then'](function(_0x45311c){if(_0x45311c){_0x581707=_0x45311c;return db[_0x19bd('0x5b')][_0x19bd('0x46')];}})[_0x19bd('0x27')](function(_0x3ca064){if(_0x3ca064){var _0x470399={};var _0x178ebd={};_0x178ebd[_0x19bd('0x2e')]=_[_0x19bd('0x68')](_[_0x19bd('0x45')](_0x3ca064),_[_0x19bd('0x58')](_0x581707[_0x19bd('0x67')],function(_0x5b7878){return util[_0x19bd('0x69')](_0x19bd('0x6a'),_0x5b7878['id']);}));_0x178ebd[_0x19bd('0x2f')]=_[_0x19bd('0x45')](_0x25f0f0[_0x19bd('0x2f')]);_0x178ebd[_0x19bd('0x30')]=_[_0x19bd('0x31')](_0x178ebd[_0x19bd('0x2e')],_0x178ebd[_0x19bd('0x2f')]);_0x470399['attributes']=_['intersection'](_0x178ebd[_0x19bd('0x2e')],qs[_0x19bd('0x33')](_0x25f0f0[_0x19bd('0x2f')]['fields']));_0x470399[_0x19bd('0x32')]=_0x470399[_0x19bd('0x32')][_0x19bd('0x34')]?_0x470399[_0x19bd('0x32')]:_0x178ebd[_0x19bd('0x2e')];if(!_0x25f0f0[_0x19bd('0x2f')]['hasOwnProperty'](_0x19bd('0x57'))){_0x470399[_0x19bd('0x1c')]=qs[_0x19bd('0x1c')](_0x25f0f0[_0x19bd('0x2f')][_0x19bd('0x1c')]);_0x470399[_0x19bd('0x1e')]=qs[_0x19bd('0x1e')](_0x25f0f0['query'][_0x19bd('0x1e')]);}_0x470399[_0x19bd('0x36')]=qs['sort'](_0x25f0f0[_0x19bd('0x2f')]['sort']);_0x470399[_0x19bd('0x38')]=qs[_0x19bd('0x30')](_['pick'](_0x25f0f0[_0x19bd('0x2f')],_0x178ebd[_0x19bd('0x30')]));_0x470399[_0x19bd('0x6b')]=!![];if(_0x25f0f0['query'][_0x19bd('0x3a')]){_0x470399[_0x19bd('0x38')]=_[_0x19bd('0x3b')](_0x470399[_0x19bd('0x38')],{'$or':_['map'](_0x470399['attributes'],function(_0x2ae4ac){var _0x17fca1={};_0x17fca1[_0x2ae4ac]={'$like':'%'+_0x25f0f0[_0x19bd('0x2f')][_0x19bd('0x3a')]+'%'};return _0x17fca1;})});}_0x470399=_[_0x19bd('0x3b')]({},_0x470399,_0x25f0f0[_0x19bd('0x3c')]);return _0x581707['getContacts'](_0x470399);}})['then'](respondWithResult(_0x592638,null))[_0x19bd('0x42')](handleError(_0x592638,null));};exports[_0x19bd('0x6c')]=function(_0x18bef4,_0x3f7da3,_0x45e2f3){var _0x5aff9f;var _0xeee2d1;var _0x44283f;var _0x3efa7a=_0x18bef4[_0x19bd('0x44')]['id'];csv_results=[];return db[_0x19bd('0x6d')][_0x19bd('0x40')]({'attributes':['id','name'],'raw':!![],'order':['OrderBy']})[_0x19bd('0x27')](function(_0x1b7b33){_0x5aff9f=_0x1b7b33;var _0x2247f9=_[_0x19bd('0x45')](db[_0x19bd('0x5b')][_0x19bd('0x46')]);return db['CmCustomField'][_0x19bd('0x40')]({'raw':!![],'attributes':['id',_0x19bd('0x6e')]})[_0x19bd('0x27')](function(_0x768401){_0xeee2d1=_0x768401;var _0x94742=squel[_0x19bd('0x6f')]()[_0x19bd('0x33')](_0x2247f9)[_0x19bd('0x70')](_0x19bd('0x71'),'c')['where']('c.ListId\x20=\x20?',_0x3efa7a)[_0x19bd('0x38')]('c.deletedAt\x20is\x20null')['distinct']();for(var _0x5a18b4=0x0;_0x5a18b4<_0xeee2d1[_0x19bd('0x34')];_0x5a18b4++){_0x94742[_0x19bd('0x72')](_0x19bd('0x73')+_0xeee2d1[_0x5a18b4]['id'],_0x19bd('0x74')+_0xeee2d1[_0x5a18b4]['alias']);}for(var _0x5a18b4=0x0;_0x5a18b4<_0x5aff9f['length'];_0x5a18b4++){_0x94742[_0x19bd('0x72')](squel[_0x19bd('0x6f')]()[_0x19bd('0x72')]('item')[_0x19bd('0x70')](_0x19bd('0x75'))[_0x19bd('0x38')](_0x19bd('0x76'),_0x5aff9f[_0x5a18b4]['id'])[_0x19bd('0x38')](_0x19bd('0x77')),_0x19bd('0x78')+_0x5aff9f[_0x5a18b4][_0x19bd('0x2a')]);_0x94742[_0x19bd('0x72')](squel[_0x19bd('0x6f')]()[_0x19bd('0x72')]('description')['from']('cm_contact_has_items')[_0x19bd('0x38')](_0x19bd('0x76'),_0x5aff9f[_0x5a18b4]['id'])['where']('CmContactId\x20=\x20c.id'),_0x19bd('0x79')+_0x5aff9f[_0x5a18b4][_0x19bd('0x2a')]);}var _0x37ff97=[];_0x37ff97[_0x19bd('0x5f')](_0x94742[_0x19bd('0x7a')]());BPromise[_0x19bd('0x7b')](_0x37ff97,handleQuery)[_0x19bd('0x27')](function(_0x4f0a70){handleQuery(_0x94742[_0x19bd('0x7a')]());var _0x37decb=csv_results[0x0];if(!_[_0x19bd('0x7c')](_0x37decb)){var _0x19834d=toCsv(_0x37decb);var _0x3e4a2a=Date[_0x19bd('0x7d')]();fs[_0x19bd('0x7e')](util['format'](_0x19bd('0x7f'),_0x3efa7a,_0x3e4a2a),_0x19834d);_0x3f7da3[_0x19bd('0x80')]('Content-disposition',_0x19bd('0x81')+util[_0x19bd('0x69')](_0x19bd('0x82'),_0x3efa7a,_0x3e4a2a));_0x3f7da3[_0x19bd('0x80')]('Content-type','text/csv');return _0x3f7da3[_0x19bd('0x83')](util[_0x19bd('0x69')](_0x19bd('0x7f'),_0x3efa7a,_0x3e4a2a));}else{return _0x3f7da3[_0x19bd('0x18')](0xcc);}});});});};exports[_0x19bd('0x84')]=function(_0x36392e,_0x2194c6,_0x5357ca){var _0x41913c;delete _0x36392e['body']['id'];return db[_0x19bd('0x3d')][_0x19bd('0x56')]({'where':{'id':_0x36392e['params']['id']}})['then'](handleEntityNotFound(_0x2194c6,null))[_0x19bd('0x27')](function(_0xadf518){if(_0xadf518){return db[_0x19bd('0x85')][_0x19bd('0x86')](function(_0x566096){return db['CmCustomField'][_0x19bd('0x48')](_0x36392e[_0x19bd('0x49')],{'transaction':_0x566096})[_0x19bd('0x27')](function(_0x258344){_0x41913c=_0x258344;return _0xadf518['addCustomFields'](_0x258344,{'transaction':_0x566096});})[_0x19bd('0x27')](function(){var _0x14c179={'type':db[_0x19bd('0x87')][_0x19bd('0x88')],'transaction':_0x566096};switch(_0x36392e[_0x19bd('0x49')][_0x19bd('0x2d')]){case _0x19bd('0x89'):_0x14c179[_0x19bd('0x2d')]=db[_0x19bd('0x87')][_0x19bd('0x88')];break;case _0x19bd('0x8a'):_0x14c179[_0x19bd('0x2d')]=db['Sequelize']['INTEGER'];break;case'switch':_0x14c179[_0x19bd('0x2d')]=db[_0x19bd('0x87')][_0x19bd('0x8b')];_0x14c179['defaultValue']=![];break;default:}return db[_0x19bd('0x85')][_0x19bd('0x8c')]['addColumn']('cm_contacts',util[_0x19bd('0x69')](_0x19bd('0x8d'),_0x41913c['id']),_0x14c179);})[_0x19bd('0x27')](function(){return _0x41913c;});});}})[_0x19bd('0x27')](respondWithResult(_0x2194c6,null))['catch'](handleError(_0x2194c6,null));};exports[_0x19bd('0x8e')]=function(_0x514850,_0x57eca4,_0x79192a){var _0x202e25={};var _0x237423={};var _0x2b61bd;var _0x368da7;return db['CmList']['findOne']({'where':{'id':_0x514850['params']['id']}})[_0x19bd('0x27')](handleEntityNotFound(_0x57eca4,null))[_0x19bd('0x27')](function(_0x45b8f2){if(_0x45b8f2){_0x2b61bd=_0x45b8f2;_0x237423[_0x19bd('0x2e')]=_[_0x19bd('0x45')](db[_0x19bd('0x66')][_0x19bd('0x46')]);_0x237423[_0x19bd('0x2f')]=_[_0x19bd('0x45')](_0x514850['query']);_0x237423[_0x19bd('0x30')]=_[_0x19bd('0x31')](_0x237423[_0x19bd('0x2e')],_0x237423[_0x19bd('0x2f')]);_0x202e25[_0x19bd('0x32')]=_[_0x19bd('0x31')](_0x237423[_0x19bd('0x2e')],qs[_0x19bd('0x33')](_0x514850['query'][_0x19bd('0x33')]));_0x202e25[_0x19bd('0x32')]=_0x202e25[_0x19bd('0x32')][_0x19bd('0x34')]?_0x202e25[_0x19bd('0x32')]:_0x237423[_0x19bd('0x2e')];_0x202e25[_0x19bd('0x36')]=qs[_0x19bd('0x37')](_0x514850[_0x19bd('0x2f')]['sort']);_0x202e25[_0x19bd('0x38')]=qs[_0x19bd('0x30')](_['pick'](_0x514850[_0x19bd('0x2f')],_0x237423[_0x19bd('0x30')]));_0x202e25[_0x19bd('0x38')]=_['merge'](_0x202e25[_0x19bd('0x38')],{'$or':[{'ListId':_0x45b8f2['id']},{'ListId':null}]});if(_0x514850[_0x19bd('0x2f')][_0x19bd('0x3a')]){_0x202e25[_0x19bd('0x38')]=_['merge'](_0x202e25[_0x19bd('0x38')],{'$or':_[_0x19bd('0x58')](_0x202e25['attributes'],function(_0x510235){var _0x1e979a={};_0x1e979a[_0x510235]={'$like':'%'+_0x514850[_0x19bd('0x2f')][_0x19bd('0x3a')]+'%'};return _0x1e979a;})});}_0x202e25=_[_0x19bd('0x3b')]({},_0x202e25,_0x514850[_0x19bd('0x3c')]);return db[_0x19bd('0x66')][_0x19bd('0x8f')](_0x202e25);}})[_0x19bd('0x27')](respondWithResult(_0x57eca4,null))[_0x19bd('0x42')](handleError(_0x57eca4,null));};exports[_0x19bd('0x90')]=function(_0x13bafe,_0x18cf76){return db[_0x19bd('0x66')][_0x19bd('0x8f')]({'where':{'ListId':null}})[_0x19bd('0x27')](handleEntityNotFound(_0x18cf76,null))[_0x19bd('0x27')](function(_0x3dbf24){return _0x3dbf24;})[_0x19bd('0x27')](respondWithResult(_0x18cf76,null))['catch'](handleError(_0x18cf76,null));};exports['addAgents']=function(_0x90ce2a,_0x8b9906,_0x1be1fa){return db[_0x19bd('0x3d')][_0x19bd('0x47')]({'where':{'id':_0x90ce2a['params']['id']}})[_0x19bd('0x27')](handleEntityNotFound(_0x8b9906,null))[_0x19bd('0x27')](function(_0x15589b){if(_0x15589b){return _0x15589b[_0x19bd('0x91')](_0x90ce2a[_0x19bd('0x49')][_0x19bd('0x5a')],_[_0x19bd('0x60')](_0x90ce2a[_0x19bd('0x49')],['ids','id'])||{})[_0x19bd('0x92')](function(_0x2c2c27){for(var _0x1de88d=0x0;_0x1de88d<_0x90ce2a[_0x19bd('0x49')][_0x19bd('0x5a')][_0x19bd('0x34')];_0x1de88d+=0x1){socket[_0x19bd('0x93')](_0x19bd('0x94'),{'UserId':Number(_0x90ce2a[_0x19bd('0x49')]['ids'][_0x1de88d]),'CmListId':Number(_0x90ce2a[_0x19bd('0x44')]['id'])});}return _0x2c2c27;});}})['then'](respondWithResult(_0x8b9906,null))[_0x19bd('0x42')](handleError(_0x8b9906,null));};exports[_0x19bd('0x95')]=function(_0x103c9a,_0x7d9450,_0x450fd3){return db['CmList']['find']({'where':{'id':_0x103c9a[_0x19bd('0x44')]['id']}})[_0x19bd('0x27')](handleEntityNotFound(_0x7d9450,null))[_0x19bd('0x27')](function(_0x3750a9){if(_0x3750a9){return _0x3750a9['removeAgents'](_0x103c9a[_0x19bd('0x2f')]['ids'])['then'](function(){if(_[_0x19bd('0x5c')](_0x103c9a[_0x19bd('0x2f')]['ids'])){for(var _0x326c9f=0x0;_0x326c9f<_0x103c9a[_0x19bd('0x2f')][_0x19bd('0x5a')][_0x19bd('0x34')];_0x326c9f+=0x1){socket[_0x19bd('0x93')]('userCmList:remove',{'UserId':Number(_0x103c9a['query'][_0x19bd('0x5a')][_0x326c9f]),'CmListId':Number(_0x103c9a['params']['id'])});}}else{socket['emit']('userCmList:remove',{'UserId':Number(_0x103c9a[_0x19bd('0x2f')][_0x19bd('0x5a')]),'CmListId':Number(_0x103c9a[_0x19bd('0x44')]['id'])});}});}})[_0x19bd('0x27')](respondWithStatusCode(_0x7d9450,null))[_0x19bd('0x42')](handleError(_0x7d9450,null));};exports['getAgents']=function(_0x4c09d3,_0x404c35,_0x39d4da){var _0x41c0a8={};var _0x566cf1={};var _0x17ec32;var _0x1bd7fb;return db[_0x19bd('0x3d')][_0x19bd('0x56')]({'where':{'id':_0x4c09d3[_0x19bd('0x44')]['id']}})[_0x19bd('0x27')](handleEntityNotFound(_0x404c35,null))['then'](function(_0x1c9ec7){if(_0x1c9ec7){_0x17ec32=_0x1c9ec7;_0x566cf1[_0x19bd('0x2e')]=_[_0x19bd('0x45')](db[_0x19bd('0x96')][_0x19bd('0x46')]);_0x566cf1[_0x19bd('0x2f')]=_['keys'](_0x4c09d3[_0x19bd('0x2f')]);_0x566cf1[_0x19bd('0x30')]=_['intersection'](_0x566cf1[_0x19bd('0x2e')],_0x566cf1[_0x19bd('0x2f')]);_0x41c0a8[_0x19bd('0x32')]=_[_0x19bd('0x31')](_0x566cf1[_0x19bd('0x2e')],qs[_0x19bd('0x33')](_0x4c09d3['query'][_0x19bd('0x33')]));_0x41c0a8['attributes']=_0x41c0a8[_0x19bd('0x32')][_0x19bd('0x34')]?_0x41c0a8[_0x19bd('0x32')]:_0x566cf1['model'];_0x41c0a8[_0x19bd('0x36')]=qs[_0x19bd('0x37')](_0x4c09d3[_0x19bd('0x2f')][_0x19bd('0x37')]);_0x41c0a8[_0x19bd('0x38')]=qs[_0x19bd('0x30')](_[_0x19bd('0x39')](_0x4c09d3[_0x19bd('0x2f')],_0x566cf1[_0x19bd('0x30')]));if(_0x4c09d3['query'][_0x19bd('0x3a')]){_0x41c0a8[_0x19bd('0x38')]=_[_0x19bd('0x3b')](_0x41c0a8[_0x19bd('0x38')],{'$or':_[_0x19bd('0x58')](_0x41c0a8[_0x19bd('0x32')],function(_0x5d2802){var _0x1bea4a={};_0x1bea4a[_0x5d2802]={'$like':'%'+_0x4c09d3['query'][_0x19bd('0x3a')]+'%'};return _0x1bea4a;})});}_0x41c0a8=_[_0x19bd('0x3b')]({},_0x41c0a8,_0x4c09d3[_0x19bd('0x3c')]);return _0x17ec32[_0x19bd('0x97')](_0x41c0a8);}})[_0x19bd('0x27')](function(_0x14e311){if(_0x14e311){_0x1bd7fb=_0x14e311['length'];if(!_0x4c09d3[_0x19bd('0x2f')]['hasOwnProperty'](_0x19bd('0x57'))){_0x41c0a8[_0x19bd('0x1c')]=qs[_0x19bd('0x1c')](_0x4c09d3[_0x19bd('0x2f')][_0x19bd('0x1c')]);_0x41c0a8[_0x19bd('0x1e')]=qs[_0x19bd('0x1e')](_0x4c09d3[_0x19bd('0x2f')][_0x19bd('0x1e')]);}return _0x17ec32[_0x19bd('0x97')](_0x41c0a8);}})['then'](function(_0x27f9e2){if(_0x27f9e2){return _0x27f9e2?{'count':_0x1bd7fb,'rows':_0x27f9e2}:null;}})[_0x19bd('0x27')](respondWithResult(_0x404c35,null))[_0x19bd('0x42')](handleError(_0x404c35,null));};function handleQuery(_0x181aa9){logger[_0x19bd('0x98')](_0x181aa9);return db[_0x19bd('0x85')][_0x19bd('0x2f')](_0x181aa9)[_0x19bd('0x92')](function(_0x186342){csv_results['push'](_0x186342);})[_0x19bd('0x42')](function(_0x529ce1){logger[_0x19bd('0x4f')](_0x529ce1[_0x19bd('0x64')]);});} \ No newline at end of file +var _0xc63c=['include','rows','show','params','options','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','getDispositions','findAll','removeDispositions','ids','addContacts','tags','isArray','push','CmContact','omit','success','dataValues','errors','Malformed\x20request\x20syntax','CmCustomField','concat','CustomFields','format','cf_%d','raw','getContacts','getContactsCsv','OrderBy','from','cm_contacts','c.ListId\x20=\x20?','distinct','field','c.cf_','customField_','alias','item','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','cm_contact_has_items','toString','each','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','attachment;\x20filename=','list_%d_%s.csv','Content-type','findOne','sequelize','transaction','addCustomFields','Sequelize','TEXT','number','INTEGER','switch','addColumn','cf_%s','findAndCountAll','getGlobalCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','info','eml-format','rimraf','fast-json-patch','moment','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','sendStatus','offset','limit','undefined','status','set','Content-Range','json','apply','reject','update','then','destroy','Lists','UserProfileResource','end','error','stack','name','send','index','map','CmList','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','count','includeAll'];(function(_0x336376,_0xe4b28d){var _0x1d2a8e=function(_0x3afe68){while(--_0x3afe68){_0x336376['push'](_0x336376['shift']());}};_0x1d2a8e(++_0xe4b28d);}(_0xc63c,0x1a0));var _0xcc63=function(_0x1526e1,_0x5ed5a5){_0x1526e1=_0x1526e1-0x0;var _0x249a1e=_0xc63c[_0x1526e1];return _0x249a1e;};'use strict';var emlformat=require(_0xcc63('0x0'));var rimraf=require(_0xcc63('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcc63('0x2'));var rp=require('request-promise');var moment=require(_0xcc63('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xcc63('0x4'));var path=require(_0xcc63('0x5'));var sox=require(_0xcc63('0x6'));var csv=require(_0xcc63('0x7'));var ejs=require(_0xcc63('0x8'));var fs=require('fs');var fs_extra=require(_0xcc63('0x9'));var _=require('lodash');var squel=require(_0xcc63('0xa'));var crypto=require(_0xcc63('0xb'));var jsforce=require(_0xcc63('0xc'));var deskjs=require(_0xcc63('0xd'));var toCsv=require(_0xcc63('0x7'));var querystring=require('querystring');var Papa=require(_0xcc63('0xe'));var Redis=require(_0xcc63('0xf'));var authService=require(_0xcc63('0x10'));var qs=require(_0xcc63('0x11'));var as=require(_0xcc63('0x12'));var hardwareService=require(_0xcc63('0x13'));var logger=require(_0xcc63('0x14'))(_0xcc63('0x15'));var utils=require(_0xcc63('0x16'));var config=require(_0xcc63('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xcc63('0x18'))['db'];var csv_results;config[_0xcc63('0x19')]=_[_0xcc63('0x1a')](config[_0xcc63('0x19')],{'host':_0xcc63('0x1b'),'port':0x18eb});var socket=require(_0xcc63('0x1c'))(new Redis(config[_0xcc63('0x19')]));require(_0xcc63('0x1d'))['register'](socket);function respondWithStatusCode(_0x4f3609,_0x9324ae){_0x9324ae=_0x9324ae||0xcc;return function(_0x75790a){if(_0x75790a){return _0x4f3609[_0xcc63('0x1e')](_0x9324ae);}return _0x4f3609['status'](_0x9324ae)['end']();};}function respondWithResult(_0x18e2be,_0x422611){_0x422611=_0x422611||0xc8;return function(_0x1e065f){if(_0x1e065f){return _0x18e2be['status'](_0x422611)['json'](_0x1e065f);}};}function respondWithFilteredResult(_0x46c8fb,_0x9fb2e8){return function(_0x16329b){if(_0x16329b){var _0x5930e5=typeof _0x9fb2e8[_0xcc63('0x1f')]==='undefined'&&typeof _0x9fb2e8[_0xcc63('0x20')]===_0xcc63('0x21');var _0x2e547b=_0x16329b['count'];var _0x481363=_0x5930e5?0x0:_0x9fb2e8[_0xcc63('0x1f')];var _0x5a16dc=_0x5930e5?_0x16329b['count']:_0x9fb2e8[_0xcc63('0x1f')]+_0x9fb2e8[_0xcc63('0x20')];var _0x3d9ce8;if(_0x5a16dc>=_0x2e547b){_0x5a16dc=_0x2e547b;_0x3d9ce8=0xc8;}else{_0x3d9ce8=0xce;}_0x46c8fb[_0xcc63('0x22')](_0x3d9ce8);return _0x46c8fb[_0xcc63('0x23')](_0xcc63('0x24'),_0x481363+'-'+_0x5a16dc+'/'+_0x2e547b)[_0xcc63('0x25')](_0x16329b);}return null;};}function patchUpdates(_0x2730db){return function(_0xd78363){try{jsonpatch[_0xcc63('0x26')](_0xd78363,_0x2730db,!![]);}catch(_0x19c1d9){return BPromise[_0xcc63('0x27')](_0x19c1d9);}return _0xd78363['save']();};}function saveUpdates(_0x4eb84e,_0x21b56c){return function(_0x263830){if(_0x263830){return _0x263830[_0xcc63('0x28')](_0x4eb84e)[_0xcc63('0x29')](function(_0x482c40){return _0x482c40;});}return null;};}function removeEntity(_0x1880c7,_0x555613){return function(_0x477f8f){if(_0x477f8f){return _0x477f8f[_0xcc63('0x2a')]()['then'](function(){var _0x3dfe14=_0x477f8f['get']({'plain':!![]});var _0x35a577=_0xcc63('0x2b');return db[_0xcc63('0x2c')][_0xcc63('0x2a')]({'where':{'type':_0x35a577,'resourceId':_0x3dfe14['id']}})[_0xcc63('0x29')](function(){return _0x477f8f;});})['then'](function(){_0x1880c7[_0xcc63('0x22')](0xcc)[_0xcc63('0x2d')]();});}};}function handleEntityNotFound(_0x1f9439,_0x277101){return function(_0x45eb27){if(!_0x45eb27){_0x1f9439[_0xcc63('0x1e')](0x194);}return _0x45eb27;};}function handleError(_0x2ae580,_0x3f406f){_0x3f406f=_0x3f406f||0x1f4;return function(_0x334dc1){logger[_0xcc63('0x2e')](_0x334dc1[_0xcc63('0x2f')]);if(_0x334dc1['name']){delete _0x334dc1[_0xcc63('0x30')];}_0x2ae580[_0xcc63('0x22')](_0x3f406f)[_0xcc63('0x31')](_0x334dc1);};}exports[_0xcc63('0x32')]=function(_0x2624ca,_0x25ee8a){var _0x401b1e={},_0x43b1b3={},_0xb99a23={'count':0x0,'rows':[]};var _0x51af4b=_[_0xcc63('0x33')](db[_0xcc63('0x34')][_0xcc63('0x35')],function(_0x33be7b){return{'name':_0x33be7b[_0xcc63('0x36')],'type':_0x33be7b[_0xcc63('0x37')][_0xcc63('0x38')]};});_0x43b1b3[_0xcc63('0x39')]=_[_0xcc63('0x33')](_0x51af4b,_0xcc63('0x30'));_0x43b1b3[_0xcc63('0x3a')]=_[_0xcc63('0x3b')](_0x2624ca[_0xcc63('0x3a')]);_0x43b1b3[_0xcc63('0x3c')]=_[_0xcc63('0x3d')](_0x43b1b3[_0xcc63('0x39')],_0x43b1b3[_0xcc63('0x3a')]);_0x401b1e[_0xcc63('0x3e')]=_[_0xcc63('0x3d')](_0x43b1b3['model'],qs[_0xcc63('0x3f')](_0x2624ca[_0xcc63('0x3a')][_0xcc63('0x3f')]));_0x401b1e[_0xcc63('0x3e')]=_0x401b1e[_0xcc63('0x3e')][_0xcc63('0x40')]?_0x401b1e[_0xcc63('0x3e')]:_0x43b1b3[_0xcc63('0x39')];if(!_0x2624ca['query'][_0xcc63('0x41')](_0xcc63('0x42'))){_0x401b1e[_0xcc63('0x20')]=qs['limit'](_0x2624ca[_0xcc63('0x3a')][_0xcc63('0x20')]);_0x401b1e[_0xcc63('0x1f')]=qs[_0xcc63('0x1f')](_0x2624ca['query'][_0xcc63('0x1f')]);}_0x401b1e[_0xcc63('0x43')]=qs[_0xcc63('0x44')](_0x2624ca[_0xcc63('0x3a')][_0xcc63('0x44')]);_0x401b1e['where']=qs['filters'](_[_0xcc63('0x45')](_0x2624ca[_0xcc63('0x3a')],_0x43b1b3[_0xcc63('0x3c')]),_0x51af4b);if(_0x2624ca[_0xcc63('0x3a')][_0xcc63('0x46')]){_0x401b1e['where']=_[_0xcc63('0x47')](_0x401b1e[_0xcc63('0x48')],{'$or':_[_0xcc63('0x33')](_0x51af4b,function(_0xbcc3cb){if(_0xbcc3cb['type']!==_0xcc63('0x49')){var _0x5cacd4={};_0x5cacd4[_0xbcc3cb[_0xcc63('0x30')]]={'$like':'%'+_0x2624ca[_0xcc63('0x3a')][_0xcc63('0x46')]+'%'};return _0x5cacd4;}})});}_0x401b1e=_['merge']({},_0x401b1e,_0x2624ca['options']);var _0xa72014={'where':_0x401b1e[_0xcc63('0x48')]};return db[_0xcc63('0x34')][_0xcc63('0x4a')](_0xa72014)[_0xcc63('0x29')](function(_0x1881d1){_0xb99a23[_0xcc63('0x4a')]=_0x1881d1;if(_0x2624ca[_0xcc63('0x3a')][_0xcc63('0x4b')]){_0x401b1e[_0xcc63('0x4c')]=[{'all':!![]}];}return db[_0xcc63('0x34')]['findAll'](_0x401b1e);})[_0xcc63('0x29')](function(_0x52a783){_0xb99a23[_0xcc63('0x4d')]=_0x52a783;return _0xb99a23;})[_0xcc63('0x29')](respondWithFilteredResult(_0x25ee8a,_0x401b1e))['catch'](handleError(_0x25ee8a,null));};exports[_0xcc63('0x4e')]=function(_0x603132,_0x560e15){var _0x5a63fc={'raw':![],'where':{'id':_0x603132[_0xcc63('0x4f')]['id']}},_0x431aef={};_0x431aef[_0xcc63('0x39')]=_[_0xcc63('0x3b')](db['CmList'][_0xcc63('0x35')]);_0x431aef[_0xcc63('0x3a')]=_[_0xcc63('0x3b')](_0x603132['query']);_0x431aef['filters']=_['intersection'](_0x431aef[_0xcc63('0x39')],_0x431aef[_0xcc63('0x3a')]);_0x5a63fc[_0xcc63('0x3e')]=_['intersection'](_0x431aef['model'],qs[_0xcc63('0x3f')](_0x603132[_0xcc63('0x3a')]['fields']));_0x5a63fc[_0xcc63('0x3e')]=_0x5a63fc[_0xcc63('0x3e')][_0xcc63('0x40')]?_0x5a63fc['attributes']:_0x431aef[_0xcc63('0x39')];if(_0x603132[_0xcc63('0x3a')][_0xcc63('0x4b')]){_0x5a63fc[_0xcc63('0x4c')]=[{'all':!![]}];}_0x5a63fc=_[_0xcc63('0x47')]({},_0x5a63fc,_0x603132[_0xcc63('0x50')]);return db[_0xcc63('0x34')][_0xcc63('0x51')](_0x5a63fc)['then'](handleEntityNotFound(_0x560e15,null))[_0xcc63('0x29')](respondWithResult(_0x560e15,null))[_0xcc63('0x52')](handleError(_0x560e15,null));};exports[_0xcc63('0x53')]=function(_0x54afd4,_0xb66502){return db[_0xcc63('0x34')][_0xcc63('0x53')](_0x54afd4[_0xcc63('0x54')],{})[_0xcc63('0x29')](function(_0x225384){var _0x16f1e7=_0x54afd4[_0xcc63('0x55')][_0xcc63('0x56')]({'plain':!![]});if(!_0x16f1e7)throw new Error(_0xcc63('0x57'));if(_0x16f1e7[_0xcc63('0x58')]===_0xcc63('0x55')){var _0x507bf7=_0x225384[_0xcc63('0x56')]({'plain':!![]});var _0xd1d341=_0xcc63('0x2b');return db['UserProfileSection'][_0xcc63('0x51')]({'where':{'name':_0xd1d341,'userProfileId':_0x16f1e7[_0xcc63('0x59')]},'raw':!![]})['then'](function(_0x466950){if(_0x466950&&_0x466950['autoAssociation']===0x0){return db[_0xcc63('0x2c')][_0xcc63('0x53')]({'name':_0x507bf7[_0xcc63('0x30')],'resourceId':_0x507bf7['id'],'type':_0x466950['name'],'sectionId':_0x466950['id']},{})[_0xcc63('0x29')](function(){return _0x225384;});}else{return _0x225384;}})[_0xcc63('0x52')](function(_0x299715){logger[_0xcc63('0x2e')](_0xcc63('0x5a'),_0x299715);throw _0x299715;});}return _0x225384;})['then'](respondWithResult(_0xb66502,0xc9))['catch'](handleError(_0xb66502,null));};exports[_0xcc63('0x28')]=function(_0x24b79c,_0x36f816){if(_0x24b79c[_0xcc63('0x54')]['id']){delete _0x24b79c[_0xcc63('0x54')]['id'];}return db[_0xcc63('0x34')]['find']({'where':{'id':_0x24b79c[_0xcc63('0x4f')]['id']}})[_0xcc63('0x29')](handleEntityNotFound(_0x36f816,null))[_0xcc63('0x29')](saveUpdates(_0x24b79c[_0xcc63('0x54')],null))['then'](respondWithResult(_0x36f816,null))[_0xcc63('0x52')](handleError(_0x36f816,null));};exports[_0xcc63('0x2a')]=function(_0x3de225,_0x24ea81){return db[_0xcc63('0x34')][_0xcc63('0x51')]({'where':{'id':_0x3de225['params']['id']}})[_0xcc63('0x29')](handleEntityNotFound(_0x24ea81,null))[_0xcc63('0x29')](removeEntity(_0x24ea81,null))[_0xcc63('0x52')](handleError(_0x24ea81,null));};exports['describe']=function(_0xa5c470,_0x5009d6){return db[_0xcc63('0x34')][_0xcc63('0x5b')]()[_0xcc63('0x29')](respondWithResult(_0x5009d6,null))['catch'](handleError(_0x5009d6,null));};exports[_0xcc63('0x5c')]=function(_0x3a9408,_0x56d1cc,_0x46c8a4){if(_0x3a9408[_0xcc63('0x54')]['id']){delete _0x3a9408[_0xcc63('0x54')]['id'];}return db[_0xcc63('0x34')][_0xcc63('0x51')]({'where':{'id':_0x3a9408[_0xcc63('0x4f')]['id']}})[_0xcc63('0x29')](handleEntityNotFound(_0x56d1cc,null))[_0xcc63('0x29')](function(_0x397403){if(_0x397403){_0x3a9408['body'][_0xcc63('0x5d')]=_0x397403['id'];return db[_0xcc63('0x5e')][_0xcc63('0x53')](_0x3a9408[_0xcc63('0x54')]);}})[_0xcc63('0x29')](respondWithResult(_0x56d1cc,null))[_0xcc63('0x52')](handleError(_0x56d1cc,null));};exports[_0xcc63('0x5f')]=function(_0x142008,_0xec6f25,_0x590ba7){var _0x54f505={'raw':![],'where':{}};var _0x437285={};var _0x598286={'count':0x0,'rows':[]};return db[_0xcc63('0x34')]['findOne']({'where':{'id':_0x142008[_0xcc63('0x4f')]['id']}})[_0xcc63('0x29')](handleEntityNotFound(_0xec6f25,null))['then'](function(_0x229ce0){if(_0x229ce0){_0x437285[_0xcc63('0x39')]=_[_0xcc63('0x3b')](db['Disposition'][_0xcc63('0x35')]);_0x437285[_0xcc63('0x3a')]=_[_0xcc63('0x3b')](_0x142008['query']);_0x437285[_0xcc63('0x3c')]=_['intersection'](_0x437285[_0xcc63('0x39')],_0x437285['query']);_0x54f505['attributes']=_[_0xcc63('0x3d')](_0x437285[_0xcc63('0x39')],qs[_0xcc63('0x3f')](_0x142008[_0xcc63('0x3a')][_0xcc63('0x3f')]));_0x54f505[_0xcc63('0x3e')]=_0x54f505[_0xcc63('0x3e')][_0xcc63('0x40')]?_0x54f505[_0xcc63('0x3e')]:_0x437285[_0xcc63('0x39')];if(!_0x142008[_0xcc63('0x3a')]['hasOwnProperty'](_0xcc63('0x42'))){_0x54f505[_0xcc63('0x20')]=qs[_0xcc63('0x20')](_0x142008[_0xcc63('0x3a')]['limit']);_0x54f505[_0xcc63('0x1f')]=qs[_0xcc63('0x1f')](_0x142008[_0xcc63('0x3a')][_0xcc63('0x1f')]);}_0x54f505[_0xcc63('0x43')]=qs[_0xcc63('0x44')](_0x142008[_0xcc63('0x3a')][_0xcc63('0x44')]);_0x54f505[_0xcc63('0x48')]=qs[_0xcc63('0x3c')](_[_0xcc63('0x45')](_0x142008[_0xcc63('0x3a')],_0x437285[_0xcc63('0x3c')]));_0x54f505[_0xcc63('0x48')][_0xcc63('0x5d')]=_0x229ce0['id'];if(_0x142008[_0xcc63('0x3a')][_0xcc63('0x46')]){_0x54f505['where']=_[_0xcc63('0x47')](_0x54f505[_0xcc63('0x48')],{'$or':_[_0xcc63('0x33')](_0x54f505['attributes'],function(_0x55be91){var _0x1a838d={};_0x1a838d[_0x55be91]={'$like':'%'+_0x142008[_0xcc63('0x3a')]['filter']+'%'};return _0x1a838d;})});}_0x54f505=_[_0xcc63('0x47')]({},_0x54f505,_0x142008[_0xcc63('0x50')]);return db['Disposition']['count']({'where':_0x54f505[_0xcc63('0x48')]})[_0xcc63('0x29')](function(_0x52e11c){_0x598286[_0xcc63('0x4a')]=_0x52e11c;if(_0x142008['query']['includeAll']){_0x54f505[_0xcc63('0x4c')]=[{'all':!![]}];}return db[_0xcc63('0x5e')][_0xcc63('0x60')](_0x54f505);})['then'](function(_0x134fcf){_0x598286[_0xcc63('0x4d')]=_0x134fcf;return _0x598286;});}})['then'](respondWithFilteredResult(_0xec6f25,_0x54f505))[_0xcc63('0x52')](handleError(_0xec6f25,null));};exports[_0xcc63('0x61')]=function(_0xc3c1b5,_0x595cc4,_0x4a5fe8){return db[_0xcc63('0x34')][_0xcc63('0x51')]({'where':{'id':_0xc3c1b5[_0xcc63('0x4f')]['id']}})[_0xcc63('0x29')](handleEntityNotFound(_0x595cc4,null))[_0xcc63('0x29')](function(_0x44defe){if(_0x44defe){return _0x44defe[_0xcc63('0x61')](_0xc3c1b5[_0xcc63('0x3a')][_0xcc63('0x62')]);}})[_0xcc63('0x29')](respondWithStatusCode(_0x595cc4,null))[_0xcc63('0x52')](handleError(_0x595cc4,null));};exports[_0xcc63('0x63')]=function(_0x5672a5,_0x58961b,_0x2e3cb9){return db[_0xcc63('0x34')]['find']({'where':{'id':_0x5672a5['params']['id']}})['then'](handleEntityNotFound(_0x58961b,null))[_0xcc63('0x29')](function(_0x299f1b){if(_0x299f1b){var _0x5cfe2e=[];var _0x2c7e99={'success':[],'errors':[]};return db['CmContact']['describe']()[_0xcc63('0x29')](function(_0x2b42f0){if(_0x5672a5[_0xcc63('0x54')][_0xcc63('0x64')]&&_['isArray'](_0x5672a5[_0xcc63('0x54')][_0xcc63('0x64')])){if(_0x5672a5[_0xcc63('0x54')][_0xcc63('0x64')][_0xcc63('0x40')]){_0x5672a5[_0xcc63('0x54')][_0xcc63('0x64')]=_0x5672a5['body'][_0xcc63('0x64')]['join'](';')+';';}else{_0x5672a5[_0xcc63('0x54')][_0xcc63('0x64')]=null;}}else{_0x5672a5['body'][_0xcc63('0x64')]=null;}if(_0x5672a5[_0xcc63('0x54')]&&_[_0xcc63('0x65')](_0x5672a5['body'])){for(var _0x34058d=0x0;_0x34058d<_0x5672a5[_0xcc63('0x54')][_0xcc63('0x40')];_0x34058d+=0x1){_0x5672a5[_0xcc63('0x54')][_0x34058d][_0xcc63('0x5d')]=_0x5672a5[_0xcc63('0x4f')]['id'];_0x5cfe2e[_0xcc63('0x66')](_0x5672a5['body'][_0x34058d]);}return BPromise['each'](_0x5cfe2e,function(_0x453414){return db[_0xcc63('0x67')][_0xcc63('0x53')](_[_0xcc63('0x68')](_0x453414,[_0xcc63('0x62'),'id'])||{},{'fields':_[_0xcc63('0x3b')](_0x2b42f0),'raw':!![]})['then'](function(_0x3f307c){_0x2c7e99[_0xcc63('0x69')][_0xcc63('0x66')](_0x3f307c[_0xcc63('0x6a')]);})['catch'](function(_0x52b5f0){_0x2c7e99[_0xcc63('0x6b')]['push']({'data':_0x453414,'error':_0x52b5f0['message']});});})[_0xcc63('0x29')](function(_0x8de2b9){return _0x2c7e99;})[_0xcc63('0x52')](function(_0x54d090){return _0x54d090;});}else{_0x58961b[_0xcc63('0x22')](0x190)[_0xcc63('0x25')]({'message':_0xcc63('0x6c')});}});}})[_0xcc63('0x29')](respondWithResult(_0x58961b,null))[_0xcc63('0x52')](handleError(_0x58961b,null));};exports['getContacts']=function(_0x31ad15,_0x2bb332,_0x378b99){var _0x23bf3c;return db[_0xcc63('0x34')][_0xcc63('0x51')]({'where':{'id':_0x31ad15[_0xcc63('0x4f')]['id']},'include':[{'model':db[_0xcc63('0x6d')],'as':'CustomFields'}]})[_0xcc63('0x29')](handleEntityNotFound(_0x2bb332,null))[_0xcc63('0x29')](function(_0xd5aff7){if(_0xd5aff7){_0x23bf3c=_0xd5aff7;return db[_0xcc63('0x67')][_0xcc63('0x35')];}})['then'](function(_0x2edacb){if(_0x2edacb){var _0x3769cd={};var _0x42a927={};_0x42a927[_0xcc63('0x39')]=_[_0xcc63('0x6e')](_[_0xcc63('0x3b')](_0x2edacb),_[_0xcc63('0x33')](_0x23bf3c[_0xcc63('0x6f')],function(_0x5d613f){return util[_0xcc63('0x70')](_0xcc63('0x71'),_0x5d613f['id']);}));_0x42a927[_0xcc63('0x3a')]=_[_0xcc63('0x3b')](_0x31ad15['query']);_0x42a927[_0xcc63('0x3c')]=_[_0xcc63('0x3d')](_0x42a927['model'],_0x42a927['query']);_0x3769cd[_0xcc63('0x3e')]=_['intersection'](_0x42a927[_0xcc63('0x39')],qs[_0xcc63('0x3f')](_0x31ad15[_0xcc63('0x3a')][_0xcc63('0x3f')]));_0x3769cd[_0xcc63('0x3e')]=_0x3769cd['attributes'][_0xcc63('0x40')]?_0x3769cd[_0xcc63('0x3e')]:_0x42a927[_0xcc63('0x39')];if(!_0x31ad15['query'][_0xcc63('0x41')]('nolimit')){_0x3769cd[_0xcc63('0x20')]=qs['limit'](_0x31ad15[_0xcc63('0x3a')][_0xcc63('0x20')]);_0x3769cd[_0xcc63('0x1f')]=qs['offset'](_0x31ad15['query']['offset']);}_0x3769cd[_0xcc63('0x43')]=qs[_0xcc63('0x44')](_0x31ad15[_0xcc63('0x3a')][_0xcc63('0x44')]);_0x3769cd[_0xcc63('0x48')]=qs[_0xcc63('0x3c')](_[_0xcc63('0x45')](_0x31ad15[_0xcc63('0x3a')],_0x42a927[_0xcc63('0x3c')]));_0x3769cd[_0xcc63('0x72')]=!![];if(_0x31ad15[_0xcc63('0x3a')][_0xcc63('0x46')]){_0x3769cd[_0xcc63('0x48')]=_['merge'](_0x3769cd[_0xcc63('0x48')],{'$or':_[_0xcc63('0x33')](_0x3769cd[_0xcc63('0x3e')],function(_0x5cc899){var _0x1be6b2={};_0x1be6b2[_0x5cc899]={'$like':'%'+_0x31ad15['query'][_0xcc63('0x46')]+'%'};return _0x1be6b2;})});}_0x3769cd=_[_0xcc63('0x47')]({},_0x3769cd,_0x31ad15[_0xcc63('0x50')]);return _0x23bf3c[_0xcc63('0x73')](_0x3769cd);}})[_0xcc63('0x29')](respondWithResult(_0x2bb332,null))[_0xcc63('0x52')](handleError(_0x2bb332,null));};exports[_0xcc63('0x74')]=function(_0x241047,_0x5eef88,_0x59be81){var _0x24a0de;var _0x1599c4;var _0x492c3b;var _0x148181=_0x241047[_0xcc63('0x4f')]['id'];csv_results=[];return db['ContactItemType'][_0xcc63('0x60')]({'attributes':['id','name'],'raw':!![],'order':[_0xcc63('0x75')]})['then'](function(_0x5410fc){_0x24a0de=_0x5410fc;var _0x4dd78e=_[_0xcc63('0x3b')](db[_0xcc63('0x67')][_0xcc63('0x35')]);return db['CmCustomField'][_0xcc63('0x60')]({'raw':!![],'attributes':['id','alias']})[_0xcc63('0x29')](function(_0x499b9f){_0x1599c4=_0x499b9f;var _0x4dffcf=squel['select']()[_0xcc63('0x3f')](_0x4dd78e)[_0xcc63('0x76')](_0xcc63('0x77'),'c')[_0xcc63('0x48')](_0xcc63('0x78'),_0x148181)[_0xcc63('0x48')]('c.deletedAt\x20is\x20null')[_0xcc63('0x79')]();for(var _0x3fab76=0x0;_0x3fab76<_0x1599c4[_0xcc63('0x40')];_0x3fab76++){_0x4dffcf[_0xcc63('0x7a')](_0xcc63('0x7b')+_0x1599c4[_0x3fab76]['id'],_0xcc63('0x7c')+_0x1599c4[_0x3fab76][_0xcc63('0x7d')]);}for(var _0x3fab76=0x0;_0x3fab76<_0x24a0de['length'];_0x3fab76++){_0x4dffcf[_0xcc63('0x7a')](squel['select']()[_0xcc63('0x7a')](_0xcc63('0x7e'))[_0xcc63('0x76')]('cm_contact_has_items')[_0xcc63('0x48')](_0xcc63('0x7f'),_0x24a0de[_0x3fab76]['id'])[_0xcc63('0x48')](_0xcc63('0x80')),_0xcc63('0x81')+_0x24a0de[_0x3fab76][_0xcc63('0x30')]);_0x4dffcf[_0xcc63('0x7a')](squel['select']()[_0xcc63('0x7a')](_0xcc63('0x82'))[_0xcc63('0x76')](_0xcc63('0x83'))[_0xcc63('0x48')](_0xcc63('0x7f'),_0x24a0de[_0x3fab76]['id'])['where'](_0xcc63('0x80')),'description_additionalPhone_'+_0x24a0de[_0x3fab76][_0xcc63('0x30')]);}var _0x41a020=[];_0x41a020['push'](_0x4dffcf[_0xcc63('0x84')]());BPromise[_0xcc63('0x85')](_0x41a020,handleQuery)[_0xcc63('0x29')](function(_0x1cc1fb){handleQuery(_0x4dffcf['toString']());var _0x2e1449=csv_results[0x0];if(!_[_0xcc63('0x86')](_0x2e1449)){var _0x58ee10=toCsv(_0x2e1449);var _0x5df5c1=Date[_0xcc63('0x87')]();fs[_0xcc63('0x88')](util[_0xcc63('0x70')](_0xcc63('0x89'),_0x148181,_0x5df5c1),_0x58ee10);_0x5eef88[_0xcc63('0x8a')]('Content-disposition',_0xcc63('0x8b')+util[_0xcc63('0x70')](_0xcc63('0x8c'),_0x148181,_0x5df5c1));_0x5eef88['setHeader'](_0xcc63('0x8d'),'text/csv');return _0x5eef88['download'](util[_0xcc63('0x70')]('/tmp/list_%d_%s.csv',_0x148181,_0x5df5c1));}else{return _0x5eef88[_0xcc63('0x1e')](0xcc);}});});});};exports['addCustomField']=function(_0x400e25,_0xb642d1,_0x4bd22e){var _0x111a9f;delete _0x400e25['body']['id'];return db[_0xcc63('0x34')][_0xcc63('0x8e')]({'where':{'id':_0x400e25[_0xcc63('0x4f')]['id']}})[_0xcc63('0x29')](handleEntityNotFound(_0xb642d1,null))[_0xcc63('0x29')](function(_0x20cfa3){if(_0x20cfa3){return db[_0xcc63('0x8f')][_0xcc63('0x90')](function(_0x531bfe){return db[_0xcc63('0x6d')]['create'](_0x400e25[_0xcc63('0x54')],{'transaction':_0x531bfe})[_0xcc63('0x29')](function(_0x4580ad){_0x111a9f=_0x4580ad;return _0x20cfa3[_0xcc63('0x91')](_0x4580ad,{'transaction':_0x531bfe});})[_0xcc63('0x29')](function(){var _0x22f06f={'type':db[_0xcc63('0x92')][_0xcc63('0x93')],'transaction':_0x531bfe};switch(_0x400e25['body'][_0xcc63('0x37')]){case'text':_0x22f06f[_0xcc63('0x37')]=db['Sequelize'][_0xcc63('0x93')];break;case _0xcc63('0x94'):_0x22f06f[_0xcc63('0x37')]=db[_0xcc63('0x92')][_0xcc63('0x95')];break;case _0xcc63('0x96'):_0x22f06f['type']=db[_0xcc63('0x92')]['BOOLEAN'];_0x22f06f['defaultValue']=![];break;default:}return db[_0xcc63('0x8f')]['queryInterface'][_0xcc63('0x97')](_0xcc63('0x77'),util['format'](_0xcc63('0x98'),_0x111a9f['id']),_0x22f06f);})[_0xcc63('0x29')](function(){return _0x111a9f;});});}})['then'](respondWithResult(_0xb642d1,null))[_0xcc63('0x52')](handleError(_0xb642d1,null));};exports['getCustomFields']=function(_0x16fc68,_0x16c618,_0x445803){var _0x20469c={};var _0x18effb={};var _0x3877f1;var _0x2aca8d;return db['CmList'][_0xcc63('0x8e')]({'where':{'id':_0x16fc68[_0xcc63('0x4f')]['id']}})['then'](handleEntityNotFound(_0x16c618,null))[_0xcc63('0x29')](function(_0x58a547){if(_0x58a547){_0x3877f1=_0x58a547;_0x18effb[_0xcc63('0x39')]=_['keys'](db[_0xcc63('0x6d')][_0xcc63('0x35')]);_0x18effb[_0xcc63('0x3a')]=_[_0xcc63('0x3b')](_0x16fc68['query']);_0x18effb[_0xcc63('0x3c')]=_[_0xcc63('0x3d')](_0x18effb[_0xcc63('0x39')],_0x18effb['query']);_0x20469c[_0xcc63('0x3e')]=_[_0xcc63('0x3d')](_0x18effb[_0xcc63('0x39')],qs[_0xcc63('0x3f')](_0x16fc68[_0xcc63('0x3a')][_0xcc63('0x3f')]));_0x20469c['attributes']=_0x20469c['attributes']['length']?_0x20469c['attributes']:_0x18effb[_0xcc63('0x39')];_0x20469c[_0xcc63('0x43')]=qs[_0xcc63('0x44')](_0x16fc68[_0xcc63('0x3a')][_0xcc63('0x44')]);_0x20469c[_0xcc63('0x48')]=qs[_0xcc63('0x3c')](_[_0xcc63('0x45')](_0x16fc68[_0xcc63('0x3a')],_0x18effb[_0xcc63('0x3c')]));_0x20469c['where']=_[_0xcc63('0x47')](_0x20469c['where'],{'$or':[{'ListId':_0x58a547['id']},{'ListId':null}]});if(_0x16fc68[_0xcc63('0x3a')][_0xcc63('0x46')]){_0x20469c[_0xcc63('0x48')]=_[_0xcc63('0x47')](_0x20469c[_0xcc63('0x48')],{'$or':_[_0xcc63('0x33')](_0x20469c[_0xcc63('0x3e')],function(_0x14e935){var _0x1d7c4d={};_0x1d7c4d[_0x14e935]={'$like':'%'+_0x16fc68[_0xcc63('0x3a')][_0xcc63('0x46')]+'%'};return _0x1d7c4d;})});}_0x20469c=_[_0xcc63('0x47')]({},_0x20469c,_0x16fc68[_0xcc63('0x50')]);return db[_0xcc63('0x6d')][_0xcc63('0x99')](_0x20469c);}})['then'](respondWithResult(_0x16c618,null))['catch'](handleError(_0x16c618,null));};exports[_0xcc63('0x9a')]=function(_0xf6859b,_0x324d94){return db[_0xcc63('0x6d')]['findAndCountAll']({'where':{'ListId':null}})[_0xcc63('0x29')](handleEntityNotFound(_0x324d94,null))[_0xcc63('0x29')](function(_0x104e94){return _0x104e94;})['then'](respondWithResult(_0x324d94,null))[_0xcc63('0x52')](handleError(_0x324d94,null));};exports[_0xcc63('0x9b')]=function(_0x3f9e60,_0x34d620,_0x343a93){return db[_0xcc63('0x34')][_0xcc63('0x51')]({'where':{'id':_0x3f9e60[_0xcc63('0x4f')]['id']}})[_0xcc63('0x29')](handleEntityNotFound(_0x34d620,null))[_0xcc63('0x29')](function(_0x5d06e7){if(_0x5d06e7){return _0x5d06e7['addAgents'](_0x3f9e60[_0xcc63('0x54')][_0xcc63('0x62')],_[_0xcc63('0x68')](_0x3f9e60[_0xcc63('0x54')],[_0xcc63('0x62'),'id'])||{})[_0xcc63('0x9c')](function(_0x541d90){for(var _0x4f417d=0x0;_0x4f417d<_0x3f9e60['body'][_0xcc63('0x62')][_0xcc63('0x40')];_0x4f417d+=0x1){socket[_0xcc63('0x9d')](_0xcc63('0x9e'),{'UserId':Number(_0x3f9e60[_0xcc63('0x54')][_0xcc63('0x62')][_0x4f417d]),'CmListId':Number(_0x3f9e60[_0xcc63('0x4f')]['id'])});}return _0x541d90;});}})[_0xcc63('0x29')](respondWithResult(_0x34d620,null))[_0xcc63('0x52')](handleError(_0x34d620,null));};exports[_0xcc63('0x9f')]=function(_0x2dbf7f,_0x4a42d8,_0x4b48b9){return db[_0xcc63('0x34')]['find']({'where':{'id':_0x2dbf7f[_0xcc63('0x4f')]['id']}})[_0xcc63('0x29')](handleEntityNotFound(_0x4a42d8,null))[_0xcc63('0x29')](function(_0x180cd5){if(_0x180cd5){return _0x180cd5[_0xcc63('0x9f')](_0x2dbf7f[_0xcc63('0x3a')][_0xcc63('0x62')])['then'](function(){if(_[_0xcc63('0x65')](_0x2dbf7f[_0xcc63('0x3a')][_0xcc63('0x62')])){for(var _0x1cc9a4=0x0;_0x1cc9a4<_0x2dbf7f[_0xcc63('0x3a')][_0xcc63('0x62')][_0xcc63('0x40')];_0x1cc9a4+=0x1){socket['emit']('userCmList:remove',{'UserId':Number(_0x2dbf7f[_0xcc63('0x3a')]['ids'][_0x1cc9a4]),'CmListId':Number(_0x2dbf7f[_0xcc63('0x4f')]['id'])});}}else{socket[_0xcc63('0x9d')](_0xcc63('0xa0'),{'UserId':Number(_0x2dbf7f[_0xcc63('0x3a')]['ids']),'CmListId':Number(_0x2dbf7f[_0xcc63('0x4f')]['id'])});}});}})[_0xcc63('0x29')](respondWithStatusCode(_0x4a42d8,null))[_0xcc63('0x52')](handleError(_0x4a42d8,null));};exports[_0xcc63('0xa1')]=function(_0x3a2201,_0x4c6bfd,_0x5789f6){var _0x23266b={};var _0x3c332e={};var _0x259b7e;var _0x22230e;return db[_0xcc63('0x34')][_0xcc63('0x8e')]({'where':{'id':_0x3a2201[_0xcc63('0x4f')]['id']}})[_0xcc63('0x29')](handleEntityNotFound(_0x4c6bfd,null))[_0xcc63('0x29')](function(_0x1182c3){if(_0x1182c3){_0x259b7e=_0x1182c3;_0x3c332e[_0xcc63('0x39')]=_['keys'](db[_0xcc63('0xa2')]['rawAttributes']);_0x3c332e['query']=_[_0xcc63('0x3b')](_0x3a2201[_0xcc63('0x3a')]);_0x3c332e['filters']=_['intersection'](_0x3c332e[_0xcc63('0x39')],_0x3c332e[_0xcc63('0x3a')]);_0x23266b[_0xcc63('0x3e')]=_['intersection'](_0x3c332e[_0xcc63('0x39')],qs[_0xcc63('0x3f')](_0x3a2201[_0xcc63('0x3a')]['fields']));_0x23266b[_0xcc63('0x3e')]=_0x23266b['attributes'][_0xcc63('0x40')]?_0x23266b[_0xcc63('0x3e')]:_0x3c332e[_0xcc63('0x39')];_0x23266b[_0xcc63('0x43')]=qs[_0xcc63('0x44')](_0x3a2201[_0xcc63('0x3a')][_0xcc63('0x44')]);_0x23266b[_0xcc63('0x48')]=qs[_0xcc63('0x3c')](_[_0xcc63('0x45')](_0x3a2201['query'],_0x3c332e[_0xcc63('0x3c')]));if(_0x3a2201[_0xcc63('0x3a')][_0xcc63('0x46')]){_0x23266b[_0xcc63('0x48')]=_[_0xcc63('0x47')](_0x23266b['where'],{'$or':_['map'](_0x23266b[_0xcc63('0x3e')],function(_0xd15419){var _0x3758ae={};_0x3758ae[_0xd15419]={'$like':'%'+_0x3a2201[_0xcc63('0x3a')][_0xcc63('0x46')]+'%'};return _0x3758ae;})});}_0x23266b=_[_0xcc63('0x47')]({},_0x23266b,_0x3a2201[_0xcc63('0x50')]);return _0x259b7e[_0xcc63('0xa1')](_0x23266b);}})[_0xcc63('0x29')](function(_0xfcbd9c){if(_0xfcbd9c){_0x22230e=_0xfcbd9c[_0xcc63('0x40')];if(!_0x3a2201[_0xcc63('0x3a')][_0xcc63('0x41')](_0xcc63('0x42'))){_0x23266b['limit']=qs[_0xcc63('0x20')](_0x3a2201['query']['limit']);_0x23266b[_0xcc63('0x1f')]=qs[_0xcc63('0x1f')](_0x3a2201[_0xcc63('0x3a')][_0xcc63('0x1f')]);}return _0x259b7e[_0xcc63('0xa1')](_0x23266b);}})[_0xcc63('0x29')](function(_0x40716c){if(_0x40716c){return _0x40716c?{'count':_0x22230e,'rows':_0x40716c}:null;}})[_0xcc63('0x29')](respondWithResult(_0x4c6bfd,null))['catch'](handleError(_0x4c6bfd,null));};function handleQuery(_0x4f8aa7){logger[_0xcc63('0xa3')](_0x4f8aa7);return db[_0xcc63('0x8f')][_0xcc63('0x3a')](_0x4f8aa7)[_0xcc63('0x9c')](function(_0x3c9f1a){csv_results[_0xcc63('0x66')](_0x3c9f1a);})[_0xcc63('0x52')](function(_0x25d4e9){logger[_0xcc63('0x2e')](_0x25d4e9['message']);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index cd16092..ede607e 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0x55ca,0x126));var _0xa55c=function(_0x21353c,_0x2ea587){_0x21353c=_0x21353c-0x0;var _0xa99120=_0x55ca[_0x21353c];return _0xa99120;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var CmList=require(_0xa55c('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){CmListEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);CmListEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];CmList[_0xa55c('0x6')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file +var _0x326f=['exports','events','setMaxListeners','save','update','remove','emit','hook'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x326f,0xd1));var _0xf326=function(_0x4a767f,_0x3246eb){_0x4a767f=_0x4a767f-0x0;var _0x44923d=_0x326f[_0x4a767f];return _0x44923d;};'use strict';var EventEmitter=require(_0xf326('0x0'));var CmList=require('../../mysqldb')['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0xf326('0x1')](0x0);var events={'afterCreate':_0xf326('0x2'),'afterUpdate':_0xf326('0x3'),'afterDestroy':_0xf326('0x4')};function emitEvent(_0x27e8d7){return function(_0x120a26,_0x9445c6,_0xf1c243){CmListEvents[_0xf326('0x5')](_0x27e8d7+':'+_0x120a26['id'],_0x120a26);CmListEvents[_0xf326('0x5')](_0x27e8d7,_0x120a26);_0xf1c243(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xf326('0x6')](e,emitEvent(event));}}module[_0xf326('0x7')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index c986a42..557b796 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 _0x41bb=['bluebird','request-promise','path','rimraf','./cmList.attributes','exports','cm_lists','lodash','util','api'];(function(_0xee66a7,_0x45c04d){var _0x1ca6c3=function(_0x2e6337){while(--_0x2e6337){_0xee66a7['push'](_0xee66a7['shift']());}};_0x1ca6c3(++_0x45c04d);}(_0x41bb,0xc5));var _0xb41b=function(_0x1ab695,_0x131a89){_0x1ab695=_0x1ab695-0x0;var _0xd92d5b=_0x41bb[_0x1ab695];return _0xd92d5b;};'use strict';var _=require(_0xb41b('0x0'));var util=require(_0xb41b('0x1'));var logger=require('../../config/logger')(_0xb41b('0x2'));var moment=require('moment');var BPromise=require(_0xb41b('0x3'));var rp=require(_0xb41b('0x4'));var fs=require('fs');var path=require(_0xb41b('0x5'));var rimraf=require(_0xb41b('0x6'));var config=require('../../config/environment');var attributes=require(_0xb41b('0x7'));module[_0xb41b('0x8')]=function(_0x2dbaa3,_0x50bc62){return _0x2dbaa3['define']('CmList',attributes,{'tableName':_0xb41b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa74f=['cm_lists','../../config/logger','bluebird','request-promise','path','rimraf','./cmList.attributes','define','CmList'];(function(_0x426618,_0x137a7f){var _0x20f9cd=function(_0x54267f){while(--_0x54267f){_0x426618['push'](_0x426618['shift']());}};_0x20f9cd(++_0x137a7f);}(_0xa74f,0x9a));var _0xfa74=function(_0x382e89,_0x4768c0){_0x382e89=_0x382e89-0x0;var _0x3a1318=_0xa74f[_0x382e89];return _0x3a1318;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfa74('0x0'))('api');var moment=require('moment');var BPromise=require(_0xfa74('0x1'));var rp=require(_0xfa74('0x2'));var fs=require('fs');var path=require(_0xfa74('0x3'));var rimraf=require(_0xfa74('0x4'));var config=require('../../config/environment');var attributes=require(_0xfa74('0x5'));module['exports']=function(_0x543cfe,_0x43dd2f){return _0x543cfe[_0xfa74('0x6')](_0xfa74('0x7'),attributes,{'tableName':_0xfa74('0x8'),'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 c0eab78..5343b4f 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 _0x0ab6=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./cmList.socket','then','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','CmList,\x20%s,\x20%s','message','info','request\x20sent','catch','lodash','util'];(function(_0x28d965,_0x349580){var _0x5ab74a=function(_0x5d446f){while(--_0x5d446f){_0x28d965['push'](_0x28d965['shift']());}};_0x5ab74a(++_0x349580);}(_0x0ab6,0x1ce));var _0x60ab=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x0ab6[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x60ab('0x0'));var util=require(_0x60ab('0x1'));var moment=require('moment');var BPromise=require(_0x60ab('0x2'));var rs=require(_0x60ab('0x3'));var fs=require('fs');var Redis=require(_0x60ab('0x4'));var db=require(_0x60ab('0x5'))['db'];var utils=require(_0x60ab('0x6'));var logger=require(_0x60ab('0x7'))(_0x60ab('0x8'));var config=require(_0x60ab('0x9'));var jayson=require(_0x60ab('0xa'));var client=jayson[_0x60ab('0xb')][_0x60ab('0xc')]({'port':0x232a});config['redis']=_[_0x60ab('0xd')](config[_0x60ab('0xe')],{'host':_0x60ab('0xf'),'port':0x18eb});var socket=require(_0x60ab('0x10'))(new Redis(config[_0x60ab('0xe')]));require(_0x60ab('0x11'))['register'](socket);function respondWithRpcPromise(_0x24241a,_0x3d819a,_0x514d50){return new BPromise(function(_0x5a7447,_0x52e811){return client['request'](_0x24241a,_0x514d50)[_0x60ab('0x12')](function(_0x23d8d0){logger['info']('CmList,\x20%s,\x20%s',_0x3d819a,'request\x20sent');logger[_0x60ab('0x13')](_0x60ab('0x14'),_0x3d819a,'request\x20sent',JSON[_0x60ab('0x15')](_0x23d8d0));if(_0x23d8d0[_0x60ab('0x16')]){if(_0x23d8d0['error'][_0x60ab('0x17')]===0x1f4){logger['error'](_0x60ab('0x18'),_0x3d819a,_0x23d8d0[_0x60ab('0x16')][_0x60ab('0x19')]);return _0x52e811(_0x23d8d0[_0x60ab('0x16')][_0x60ab('0x19')]);}logger['error'](_0x60ab('0x18'),_0x3d819a,_0x23d8d0[_0x60ab('0x16')][_0x60ab('0x19')]);return _0x5a7447(_0x23d8d0['error'][_0x60ab('0x19')]);}else{logger[_0x60ab('0x1a')](_0x60ab('0x18'),_0x3d819a,_0x60ab('0x1b'));_0x5a7447(_0x23d8d0['result'][_0x60ab('0x19')]);}})[_0x60ab('0x1c')](function(_0x52b663){logger[_0x60ab('0x16')](_0x60ab('0x18'),_0x3d819a,_0x52b663);_0x52e811(_0x52b663);});});} \ No newline at end of file +var _0x2459=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','./cmList.socket','request','then','info','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','CmList,\x20%s,\x20%s','message','result','catch','util','moment','bluebird'];(function(_0x2d92b9,_0x3e5d10){var _0x3edf72=function(_0x29fe63){while(--_0x29fe63){_0x2d92b9['push'](_0x2d92b9['shift']());}};_0x3edf72(++_0x3e5d10);}(_0x2459,0x115));var _0x9245=function(_0x2b63a0,_0x14fc48){_0x2b63a0=_0x2b63a0-0x0;var _0x4f0434=_0x2459[_0x2b63a0];return _0x4f0434;};'use strict';var _=require('lodash');var util=require(_0x9245('0x0'));var moment=require(_0x9245('0x1'));var BPromise=require(_0x9245('0x2'));var rs=require(_0x9245('0x3'));var fs=require('fs');var Redis=require(_0x9245('0x4'));var db=require(_0x9245('0x5'))['db'];var utils=require(_0x9245('0x6'));var logger=require(_0x9245('0x7'))(_0x9245('0x8'));var config=require('../../config/environment');var jayson=require(_0x9245('0x9'));var client=jayson[_0x9245('0xa')][_0x9245('0xb')]({'port':0x232a});config['redis']=_[_0x9245('0xc')](config[_0x9245('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9245('0xd')]));require(_0x9245('0xe'))['register'](socket);function respondWithRpcPromise(_0x328fc2,_0x57b3ae,_0x3b7acc){return new BPromise(function(_0x2d3edd,_0x1b43dc){return client[_0x9245('0xf')](_0x328fc2,_0x3b7acc)[_0x9245('0x10')](function(_0xa6c521){logger[_0x9245('0x11')]('CmList,\x20%s,\x20%s',_0x57b3ae,_0x9245('0x12'));logger[_0x9245('0x13')](_0x9245('0x14'),_0x57b3ae,_0x9245('0x12'),JSON[_0x9245('0x15')](_0xa6c521));if(_0xa6c521[_0x9245('0x16')]){if(_0xa6c521[_0x9245('0x16')][_0x9245('0x17')]===0x1f4){logger[_0x9245('0x16')](_0x9245('0x18'),_0x57b3ae,_0xa6c521[_0x9245('0x16')][_0x9245('0x19')]);return _0x1b43dc(_0xa6c521[_0x9245('0x16')][_0x9245('0x19')]);}logger[_0x9245('0x16')](_0x9245('0x18'),_0x57b3ae,_0xa6c521['error'][_0x9245('0x19')]);return _0x2d3edd(_0xa6c521[_0x9245('0x16')][_0x9245('0x19')]);}else{logger[_0x9245('0x11')](_0x9245('0x18'),_0x57b3ae,_0x9245('0x12'));_0x2d3edd(_0xa6c521[_0x9245('0x1a')][_0x9245('0x19')]);}})[_0x9245('0x1b')](function(_0x537d76){logger[_0x9245('0x16')]('CmList,\x20%s,\x20%s',_0x57b3ae,_0x537d76);_0x1b43dc(_0x537d76);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 8f6f8af..5f4c994 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 _0xbcdf=['removeListener','length','./cmList.events','save','update','emit'];(function(_0x41f199,_0x3d3010){var _0x307212=function(_0x5ae56d){while(--_0x5ae56d){_0x41f199['push'](_0x41f199['shift']());}};_0x307212(++_0x3d3010);}(_0xbcdf,0x1b2));var _0xfbcd=function(_0xd7b7c4,_0x3bde33){_0xd7b7c4=_0xd7b7c4-0x0;var _0x3701d4=_0xbcdf[_0xd7b7c4];return _0x3701d4;};'use strict';var CmListEvents=require(_0xfbcd('0x0'));var events=[_0xfbcd('0x1'),'remove',_0xfbcd('0x2')];function createListener(_0x1e85ba,_0x345f0c){return function(_0x5dd790){_0x345f0c[_0xfbcd('0x3')](_0x1e85ba,_0x5dd790);};}function removeListener(_0x376c29,_0x1d3d06){return function(){CmListEvents[_0xfbcd('0x4')](_0x376c29,_0x1d3d06);};}exports['register']=function(_0x4cd374){for(var _0x320bc9=0x0,_0x48a4bb=events[_0xfbcd('0x5')];_0x320bc9<_0x48a4bb;_0x320bc9++){var _0x2115ad=events[_0x320bc9];var _0x5af52b=createListener('cmList:'+_0x2115ad,_0x4cd374);CmListEvents['on'](_0x2115ad,_0x5af52b);}}; \ No newline at end of file +var _0x3bf9=['update','removeListener','length','cmList:','./cmList.events','save','remove'];(function(_0x58886d,_0x4cfa1c){var _0x2fb067=function(_0x16872f){while(--_0x16872f){_0x58886d['push'](_0x58886d['shift']());}};_0x2fb067(++_0x4cfa1c);}(_0x3bf9,0xcf));var _0x93bf=function(_0x386525,_0xefae6){_0x386525=_0x386525-0x0;var _0x14d015=_0x3bf9[_0x386525];return _0x14d015;};'use strict';var CmListEvents=require(_0x93bf('0x0'));var events=[_0x93bf('0x1'),_0x93bf('0x2'),_0x93bf('0x3')];function createListener(_0x5df21d,_0x5101b7){return function(_0x444fa1){_0x5101b7['emit'](_0x5df21d,_0x444fa1);};}function removeListener(_0x41042d,_0xb9407){return function(){CmListEvents[_0x93bf('0x4')](_0x41042d,_0xb9407);};}exports['register']=function(_0x1921d7){for(var _0x4eee58=0x0,_0x307bce=events[_0x93bf('0x5')];_0x4eee58<_0x307bce;_0x4eee58++){var _0x4065e8=events[_0x4eee58];var _0x4ed738=createListener(_0x93bf('0x6')+_0x4065e8,_0x1921d7);CmListEvents['on'](_0x4065e8,_0x4ed738);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index f8f6ab4..4408834 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 _0x2a4b=['removeAgents','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','/global_fields','getGlobalCustomFields','/:id','/:id/dispositions','getDispositions','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','post','create','addDisposition','/:id/contacts','addContacts','addCustomField','addAgents','put','update','destroy','removeDispositions','delete'];(function(_0x7e9a24,_0x3f9c9b){var _0x8d6795=function(_0x220841){while(--_0x220841){_0x7e9a24['push'](_0x7e9a24['shift']());}};_0x8d6795(++_0x3f9c9b);}(_0x2a4b,0xbb));var _0xb2a4=function(_0x18331a,_0x5e7f73){_0x18331a=_0x18331a-0x0;var _0x4f5013=_0x2a4b[_0x18331a];return _0x4f5013;};'use strict';var multer=require('multer');var util=require(_0xb2a4('0x0'));var path=require('path');var timeout=require(_0xb2a4('0x1'));var express=require(_0xb2a4('0x2'));var router=express[_0xb2a4('0x3')]();var fs_extra=require(_0xb2a4('0x4'));var auth=require(_0xb2a4('0x5'));var interaction=require(_0xb2a4('0x6'));var config=require('../../config/environment');var controller=require('./cmList.controller');router['get']('/',auth[_0xb2a4('0x7')](),controller[_0xb2a4('0x8')]);router[_0xb2a4('0x9')](_0xb2a4('0xa'),auth[_0xb2a4('0x7')](),controller[_0xb2a4('0xb')]);router['get'](_0xb2a4('0xc'),auth[_0xb2a4('0x7')](),controller[_0xb2a4('0xd')]);router[_0xb2a4('0x9')](_0xb2a4('0xe'),auth[_0xb2a4('0x7')](),controller['show']);router[_0xb2a4('0x9')](_0xb2a4('0xf'),auth[_0xb2a4('0x7')](),controller[_0xb2a4('0x10')]);router[_0xb2a4('0x9')]('/:id/contacts',auth[_0xb2a4('0x7')](),controller[_0xb2a4('0x11')]);router[_0xb2a4('0x9')](_0xb2a4('0x12'),auth[_0xb2a4('0x7')](),controller[_0xb2a4('0x13')]);router[_0xb2a4('0x9')](_0xb2a4('0x14'),auth[_0xb2a4('0x7')](),controller[_0xb2a4('0x15')]);router[_0xb2a4('0x9')](_0xb2a4('0x16'),auth[_0xb2a4('0x7')](),controller['getAgents']);router[_0xb2a4('0x17')]('/',auth[_0xb2a4('0x7')](),controller[_0xb2a4('0x18')]);router[_0xb2a4('0x17')](_0xb2a4('0xf'),auth['isAuthenticated'](),controller[_0xb2a4('0x19')]);router['post'](_0xb2a4('0x1a'),auth[_0xb2a4('0x7')](),controller[_0xb2a4('0x1b')]);router[_0xb2a4('0x17')]('/:id/fields',auth['isAuthenticated'](),controller[_0xb2a4('0x1c')]);router['post']('/:id/users',auth[_0xb2a4('0x7')](),controller[_0xb2a4('0x1d')]);router[_0xb2a4('0x1e')](_0xb2a4('0xe'),auth['isAuthenticated'](),controller[_0xb2a4('0x1f')]);router['delete'](_0xb2a4('0xe'),auth[_0xb2a4('0x7')](),controller[_0xb2a4('0x20')]);router['delete'](_0xb2a4('0xf'),auth['isAuthenticated'](),controller[_0xb2a4('0x21')]);router[_0xb2a4('0x22')](_0xb2a4('0x16'),auth[_0xb2a4('0x7')](),controller[_0xb2a4('0x23')]);module[_0xb2a4('0x24')]=router; \ No newline at end of file +var _0x8fe8=['delete','destroy','removeDispositions','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/global_fields','getGlobalCustomFields','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/users','getAgents','post','/:id/fields','put','/:id','update'];(function(_0x2f5d01,_0x1fdfae){var _0x134391=function(_0x38de4f){while(--_0x38de4f){_0x2f5d01['push'](_0x2f5d01['shift']());}};_0x134391(++_0x1fdfae);}(_0x8fe8,0x1b6));var _0x88fe=function(_0x45a9e0,_0x229b84){_0x45a9e0=_0x45a9e0-0x0;var _0x5796b2=_0x8fe8[_0x45a9e0];return _0x5796b2;};'use strict';var multer=require(_0x88fe('0x0'));var util=require(_0x88fe('0x1'));var path=require(_0x88fe('0x2'));var timeout=require(_0x88fe('0x3'));var express=require('express');var router=express[_0x88fe('0x4')]();var fs_extra=require(_0x88fe('0x5'));var auth=require(_0x88fe('0x6'));var interaction=require(_0x88fe('0x7'));var config=require('../../config/environment');var controller=require('./cmList.controller');router[_0x88fe('0x8')]('/',auth[_0x88fe('0x9')](),controller[_0x88fe('0xa')]);router[_0x88fe('0x8')]('/describe',auth[_0x88fe('0x9')](),controller['describe']);router[_0x88fe('0x8')](_0x88fe('0xb'),auth[_0x88fe('0x9')](),controller[_0x88fe('0xc')]);router[_0x88fe('0x8')]('/:id',auth[_0x88fe('0x9')](),controller[_0x88fe('0xd')]);router[_0x88fe('0x8')](_0x88fe('0xe'),auth['isAuthenticated'](),controller[_0x88fe('0xf')]);router[_0x88fe('0x8')](_0x88fe('0x10'),auth['isAuthenticated'](),controller[_0x88fe('0x11')]);router[_0x88fe('0x8')](_0x88fe('0x12'),auth[_0x88fe('0x9')](),controller[_0x88fe('0x13')]);router[_0x88fe('0x8')]('/:id/fields',auth[_0x88fe('0x9')](),controller['getCustomFields']);router[_0x88fe('0x8')](_0x88fe('0x14'),auth[_0x88fe('0x9')](),controller[_0x88fe('0x15')]);router['post']('/',auth[_0x88fe('0x9')](),controller['create']);router[_0x88fe('0x16')](_0x88fe('0xe'),auth[_0x88fe('0x9')](),controller['addDisposition']);router[_0x88fe('0x16')]('/:id/contacts',auth['isAuthenticated'](),controller['addContacts']);router[_0x88fe('0x16')](_0x88fe('0x17'),auth[_0x88fe('0x9')](),controller['addCustomField']);router['post'](_0x88fe('0x14'),auth[_0x88fe('0x9')](),controller['addAgents']);router[_0x88fe('0x18')](_0x88fe('0x19'),auth[_0x88fe('0x9')](),controller[_0x88fe('0x1a')]);router[_0x88fe('0x1b')](_0x88fe('0x19'),auth[_0x88fe('0x9')](),controller[_0x88fe('0x1c')]);router['delete'](_0x88fe('0xe'),auth[_0x88fe('0x9')](),controller[_0x88fe('0x1d')]);router[_0x88fe('0x1b')](_0x88fe('0x14'),auth[_0x88fe('0x9')](),controller['removeAgents']);module[_0x88fe('0x1e')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 004560b..1194761 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 _0x8789=['exports','getDataValue','field','STRING','sequelize'];(function(_0x3a8c1b,_0x5d4e5d){var _0x2f3c39=function(_0x4fba6d){while(--_0x4fba6d){_0x3a8c1b['push'](_0x3a8c1b['shift']());}};_0x2f3c39(++_0x5d4e5d);}(_0x8789,0xef));var _0x9878=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x8789[_0x2d7f0e];return _0x110b07;};'use strict';var Sequelize=require(_0x9878('0x0'));module[_0x9878('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x52b22b){return this[_0x9878('0x2')](_0x9878('0x3'));}},'field':{'type':Sequelize[_0x9878('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x9878('0x4')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x509e=['STRING','sequelize','exports','VIRTUAL','getDataValue','field'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x509e,0x199));var _0xe509=function(_0xa7bfc1,_0x5a8fca){_0xa7bfc1=_0xa7bfc1-0x0;var _0x5960b5=_0x509e[_0xa7bfc1];return _0x5960b5;};'use strict';var Sequelize=require(_0xe509('0x0'));module[_0xe509('0x1')]={'name':{'type':Sequelize[_0xe509('0x2')],'get':function(_0x535129){return this[_0xe509('0x3')](_0xe509('0x4'));}},'field':{'type':Sequelize[_0xe509('0x5')],'allowNull':![]},'operator':{'type':Sequelize[_0xe509('0x5')],'allowNull':![]},'value':{'type':Sequelize[_0xe509('0x5')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index fca7b80..f82c9e9 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x107cdc,_0x218b4e){var _0x7fe3c1=function(_0x35728a){while(--_0x35728a){_0x107cdc['push'](_0x107cdc['shift']());}};_0x7fe3c1(++_0x218b4e);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file +var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x5af89b,_0x3c0003){var _0x23c06b=function(_0x3f26bf){while(--_0x3f26bf){_0x5af89b['push'](_0x5af89b['shift']());}};_0x23c06b(++_0x3c0003);}(_0x7a54,0x106));var _0x47a5=function(_0x35a225,_0x41213c){_0x35a225=_0x35a225-0x0;var _0x4edbf7=_0x7a54[_0x35a225];return _0x4edbf7;};'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 87216af..1f763c4 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 _0xdc25=['moment','request-promise','path','rimraf','../../config/environment','./condition.attributes','exports','define','Condition','lodash','util','../../config/logger','api'];(function(_0xe6d681,_0x2475a5){var _0x4ce0f2=function(_0x45446d){while(--_0x45446d){_0xe6d681['push'](_0xe6d681['shift']());}};_0x4ce0f2(++_0x2475a5);}(_0xdc25,0x10d));var _0x5dc2=function(_0x38369b,_0x3f24bd){_0x38369b=_0x38369b-0x0;var _0x475ac1=_0xdc25[_0x38369b];return _0x475ac1;};'use strict';var _=require(_0x5dc2('0x0'));var util=require(_0x5dc2('0x1'));var logger=require(_0x5dc2('0x2'))(_0x5dc2('0x3'));var moment=require(_0x5dc2('0x4'));var BPromise=require('bluebird');var rp=require(_0x5dc2('0x5'));var fs=require('fs');var path=require(_0x5dc2('0x6'));var rimraf=require(_0x5dc2('0x7'));var config=require(_0x5dc2('0x8'));var attributes=require(_0x5dc2('0x9'));module[_0x5dc2('0xa')]=function(_0x243e8a,_0x1e817e){return _0x243e8a[_0x5dc2('0xb')](_0x5dc2('0xc'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x838e=['./condition.attributes','define','lodash','api','moment','request-promise','../../config/environment'];(function(_0x2671b4,_0x1a59b4){var _0x67bb10=function(_0x47da1a){while(--_0x47da1a){_0x2671b4['push'](_0x2671b4['shift']());}};_0x67bb10(++_0x1a59b4);}(_0x838e,0x175));var _0xe838=function(_0x58d654,_0x4106d4){_0x58d654=_0x58d654-0x0;var _0x6f6c64=_0x838e[_0x58d654];return _0x6f6c64;};'use strict';var _=require(_0xe838('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe838('0x1'));var moment=require(_0xe838('0x2'));var BPromise=require('bluebird');var rp=require(_0xe838('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe838('0x4'));var attributes=require(_0xe838('0x5'));module['exports']=function(_0x5b2bc4,_0x310a25){return _0x5b2bc4[_0xe838('0x6')]('Condition',attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index e08e15f..912dc39 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 _0xcee6=['code','Condition,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3674bd,_0x46a05a){var _0x1e7703=function(_0x1394c3){while(--_0x1394c3){_0x3674bd['push'](_0x3674bd['shift']());}};_0x1e7703(++_0x46a05a);}(_0xcee6,0x1a9));var _0x6cee=function(_0x5ce8b9,_0x5cded8){_0x5ce8b9=_0x5ce8b9-0x0;var _0xe34be0=_0xcee6[_0x5ce8b9];return _0xe34be0;};'use strict';var _=require(_0x6cee('0x0'));var util=require(_0x6cee('0x1'));var moment=require(_0x6cee('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6cee('0x3'));var db=require(_0x6cee('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6cee('0x5'))(_0x6cee('0x6'));var config=require(_0x6cee('0x7'));var jayson=require(_0x6cee('0x8'));var client=jayson[_0x6cee('0x9')][_0x6cee('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59eb44,_0x29a095,_0x9d124d){return new BPromise(function(_0x14e16e,_0x149ebc){return client[_0x6cee('0xb')](_0x59eb44,_0x9d124d)['then'](function(_0x153ac3){logger['info']('Condition,\x20%s,\x20%s',_0x29a095,_0x6cee('0xc'));logger['debug'](_0x6cee('0xd'),_0x29a095,'request\x20sent',JSON[_0x6cee('0xe')](_0x153ac3));if(_0x153ac3[_0x6cee('0xf')]){if(_0x153ac3['error'][_0x6cee('0x10')]===0x1f4){logger[_0x6cee('0xf')](_0x6cee('0x11'),_0x29a095,_0x153ac3[_0x6cee('0xf')][_0x6cee('0x12')]);return _0x149ebc(_0x153ac3['error'][_0x6cee('0x12')]);}logger[_0x6cee('0xf')](_0x6cee('0x11'),_0x29a095,_0x153ac3[_0x6cee('0xf')][_0x6cee('0x12')]);return _0x14e16e(_0x153ac3[_0x6cee('0xf')][_0x6cee('0x12')]);}else{logger['info'](_0x6cee('0x11'),_0x29a095,_0x6cee('0xc'));_0x14e16e(_0x153ac3[_0x6cee('0x13')][_0x6cee('0x12')]);}})[_0x6cee('0x14')](function(_0x2de5e2){logger['error']('Condition,\x20%s,\x20%s',_0x29a095,_0x2de5e2);_0x149ebc(_0x2de5e2);});});} \ No newline at end of file +var _0x3797=['randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird'];(function(_0x3ad7ad,_0x291a8d){var _0x225a60=function(_0xca7354){while(--_0xca7354){_0x3ad7ad['push'](_0x3ad7ad['shift']());}};_0x225a60(++_0x291a8d);}(_0x3797,0x1b6));var _0x7379=function(_0x1dd6cb,_0x28512e){_0x1dd6cb=_0x1dd6cb-0x0;var _0x457606=_0x3797[_0x1dd6cb];return _0x457606;};'use strict';var _=require(_0x7379('0x0'));var util=require('util');var moment=require(_0x7379('0x1'));var BPromise=require(_0x7379('0x2'));var rs=require(_0x7379('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7379('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7379('0x5'))(_0x7379('0x6'));var config=require(_0x7379('0x7'));var jayson=require(_0x7379('0x8'));var client=jayson['client'][_0x7379('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1fb8ef,_0x138367,_0x52dbcf){return new BPromise(function(_0x478847,_0x479de0){return client['request'](_0x1fb8ef,_0x52dbcf)[_0x7379('0xa')](function(_0x367113){logger[_0x7379('0xb')](_0x7379('0xc'),_0x138367,_0x7379('0xd'));logger[_0x7379('0xe')](_0x7379('0xf'),_0x138367,_0x7379('0xd'),JSON[_0x7379('0x10')](_0x367113));if(_0x367113[_0x7379('0x11')]){if(_0x367113[_0x7379('0x11')]['code']===0x1f4){logger[_0x7379('0x11')](_0x7379('0xc'),_0x138367,_0x367113['error'][_0x7379('0x12')]);return _0x479de0(_0x367113[_0x7379('0x11')][_0x7379('0x12')]);}logger[_0x7379('0x11')](_0x7379('0xc'),_0x138367,_0x367113[_0x7379('0x11')]['message']);return _0x478847(_0x367113[_0x7379('0x11')][_0x7379('0x12')]);}else{logger['info'](_0x7379('0xc'),_0x138367,_0x7379('0xd'));_0x478847(_0x367113[_0x7379('0x13')]['message']);}})[_0x7379('0x14')](function(_0x30f506){logger[_0x7379('0x11')](_0x7379('0xc'),_0x138367,_0x30f506);_0x479de0(_0x30f506);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index ab16caf..8572e48 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 _0x71fe=['put','update','delete','isAuthenticated','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./condition.controller'];(function(_0x28fbbf,_0x11f896){var _0x543af6=function(_0x27fa74){while(--_0x27fa74){_0x28fbbf['push'](_0x28fbbf['shift']());}};_0x543af6(++_0x11f896);}(_0x71fe,0x1d4));var _0xe71f=function(_0x2bbd23,_0x43c40f){_0x2bbd23=_0x2bbd23-0x0;var _0x4dc031=_0x71fe[_0x2bbd23];return _0x4dc031;};'use strict';var multer=require(_0xe71f('0x0'));var util=require(_0xe71f('0x1'));var path=require(_0xe71f('0x2'));var timeout=require(_0xe71f('0x3'));var express=require(_0xe71f('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe71f('0x5'));var config=require(_0xe71f('0x6'));var controller=require(_0xe71f('0x7'));router[_0xe71f('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xe71f('0x9')]);router[_0xe71f('0xa')]('/:id',auth[_0xe71f('0xb')](),controller[_0xe71f('0xc')]);module[_0xe71f('0xd')]=router; \ No newline at end of file +var _0x57f0=['/:id','isAuthenticated','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./condition.controller','put'];(function(_0x744520,_0x5c9622){var _0x3c4fd7=function(_0x1e13b9){while(--_0x1e13b9){_0x744520['push'](_0x744520['shift']());}};_0x3c4fd7(++_0x5c9622);}(_0x57f0,0x9f));var _0x057f=function(_0x1d0d23,_0x43e210){_0x1d0d23=_0x1d0d23-0x0;var _0x2d295b=_0x57f0[_0x1d0d23];return _0x2d295b;};'use strict';var multer=require('multer');var util=require(_0x057f('0x0'));var path=require(_0x057f('0x1'));var timeout=require(_0x057f('0x2'));var express=require(_0x057f('0x3'));var router=express['Router']();var fs_extra=require(_0x057f('0x4'));var auth=require(_0x057f('0x5'));var interaction=require(_0x057f('0x6'));var config=require('../../config/environment');var controller=require(_0x057f('0x7'));router[_0x057f('0x8')](_0x057f('0x9'),auth[_0x057f('0xa')](),controller['update']);router[_0x057f('0xb')](_0x057f('0x9'),auth[_0x057f('0xa')](),controller[_0x057f('0xc')]);module[_0x057f('0xd')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index e54a586..25bfadb 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 _0x5e65=['exports','STRING','name'];(function(_0x29d6e6,_0x264220){var _0xc75ff0=function(_0x214f6b){while(--_0x214f6b){_0x29d6e6['push'](_0x29d6e6['shift']());}};_0xc75ff0(++_0x264220);}(_0x5e65,0xdb));var _0x55e6=function(_0x6726c8,_0x30aff7){_0x6726c8=_0x6726c8-0x0;var _0x4ab0e3=_0x5e65[_0x6726c8];return _0x4ab0e3;};'use strict';var Sequelize=require('sequelize');module[_0x55e6('0x0')]={'name':{'type':Sequelize[_0x55e6('0x1')],'allowNull':![],'unique':_0x55e6('0x2')},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x55e6('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x9eab=['STRING','sequelize','exports','name','INTEGER'];(function(_0x56e469,_0x134f1f){var _0x459c64=function(_0x5ad2f0){while(--_0x5ad2f0){_0x56e469['push'](_0x56e469['shift']());}};_0x459c64(++_0x134f1f);}(_0x9eab,0x19b));var _0xb9ea=function(_0x48beb0,_0x27e832){_0x48beb0=_0x48beb0-0x0;var _0x2e2904=_0x9eab[_0x48beb0];return _0x2e2904;};'use strict';var Sequelize=require(_0xb9ea('0x0'));module[_0xb9ea('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb9ea('0x2')},'OrderBy':{'type':Sequelize[_0xb9ea('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0xb9ea('0x4')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 88debda..67ccaa9 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 _0x9f0e=['index','map','ContactItemType','rawAttributes','fieldName','type','key','model','query','intersection','attributes','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','findAll','catch','show','params','keys','filters','fields','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','get','ContactItemTypes','UserProfileResource','end','error','stack','name','send'];(function(_0x7502,_0x4d125f){var _0x3e9163=function(_0x4f3317){while(--_0x4f3317){_0x7502['push'](_0x7502['shift']());}};_0x3e9163(++_0x4d125f);}(_0x9f0e,0x116));var _0xe9f0=function(_0x544b2a,_0x73da24){_0x544b2a=_0x544b2a-0x0;var _0x1914b8=_0x9f0e[_0x544b2a];return _0x1914b8;};'use strict';var emlformat=require(_0xe9f0('0x0'));var rimraf=require(_0xe9f0('0x1'));var zipdir=require(_0xe9f0('0x2'));var jsonpatch=require(_0xe9f0('0x3'));var rp=require(_0xe9f0('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe9f0('0x5'));var util=require(_0xe9f0('0x6'));var path=require(_0xe9f0('0x7'));var sox=require(_0xe9f0('0x8'));var csv=require(_0xe9f0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe9f0('0xa'));var squel=require(_0xe9f0('0xb'));var crypto=require(_0xe9f0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe9f0('0xd'));var toCsv=require(_0xe9f0('0x9'));var querystring=require(_0xe9f0('0xe'));var Papa=require(_0xe9f0('0xf'));var Redis=require(_0xe9f0('0x10'));var authService=require(_0xe9f0('0x11'));var qs=require(_0xe9f0('0x12'));var as=require(_0xe9f0('0x13'));var hardwareService=require(_0xe9f0('0x14'));var logger=require('../../config/logger')(_0xe9f0('0x15'));var utils=require(_0xe9f0('0x16'));var config=require(_0xe9f0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe9f0('0x18'))['db'];function respondWithStatusCode(_0x586763,_0x367545){_0x367545=_0x367545||0xcc;return function(_0xd82420){if(_0xd82420){return _0x586763[_0xe9f0('0x19')](_0x367545);}return _0x586763[_0xe9f0('0x1a')](_0x367545)['end']();};}function respondWithResult(_0x2cf75d,_0x5a10c6){_0x5a10c6=_0x5a10c6||0xc8;return function(_0x1e3ba8){if(_0x1e3ba8){return _0x2cf75d[_0xe9f0('0x1a')](_0x5a10c6)[_0xe9f0('0x1b')](_0x1e3ba8);}};}function respondWithFilteredResult(_0x59320d,_0x28bfac){return function(_0x33e9e4){if(_0x33e9e4){var _0x2e68ef=typeof _0x28bfac['offset']===_0xe9f0('0x1c')&&typeof _0x28bfac[_0xe9f0('0x1d')]===_0xe9f0('0x1c');var _0xd71ac8=_0x33e9e4[_0xe9f0('0x1e')];var _0x2ab12b=_0x2e68ef?0x0:_0x28bfac[_0xe9f0('0x1f')];var _0x59bf5a=_0x2e68ef?_0x33e9e4[_0xe9f0('0x1e')]:_0x28bfac[_0xe9f0('0x1f')]+_0x28bfac[_0xe9f0('0x1d')];var _0x5c4182;if(_0x59bf5a>=_0xd71ac8){_0x59bf5a=_0xd71ac8;_0x5c4182=0xc8;}else{_0x5c4182=0xce;}_0x59320d[_0xe9f0('0x1a')](_0x5c4182);return _0x59320d[_0xe9f0('0x20')](_0xe9f0('0x21'),_0x2ab12b+'-'+_0x59bf5a+'/'+_0xd71ac8)[_0xe9f0('0x1b')](_0x33e9e4);}return null;};}function patchUpdates(_0x5ba788){return function(_0x33f143){try{jsonpatch[_0xe9f0('0x22')](_0x33f143,_0x5ba788,!![]);}catch(_0x583687){return BPromise['reject'](_0x583687);}return _0x33f143['save']();};}function saveUpdates(_0x12fe9f,_0xa1ddc){return function(_0x1211ae){if(_0x1211ae){return _0x1211ae[_0xe9f0('0x23')](_0x12fe9f)[_0xe9f0('0x24')](function(_0x4a5c27){return _0x4a5c27;});}return null;};}function removeEntity(_0x229fe0,_0x38b7ee){return function(_0x437d43){if(_0x437d43){return _0x437d43[_0xe9f0('0x25')]()[_0xe9f0('0x24')](function(){var _0x372ffd=_0x437d43[_0xe9f0('0x26')]({'plain':!![]});var _0x1321bb=_0xe9f0('0x27');return db[_0xe9f0('0x28')]['destroy']({'where':{'type':_0x1321bb,'resourceId':_0x372ffd['id']}})[_0xe9f0('0x24')](function(){return _0x437d43;});})[_0xe9f0('0x24')](function(){_0x229fe0[_0xe9f0('0x1a')](0xcc)[_0xe9f0('0x29')]();});}};}function handleEntityNotFound(_0x4cf1b1,_0x212a38){return function(_0x2613fd){if(!_0x2613fd){_0x4cf1b1[_0xe9f0('0x19')](0x194);}return _0x2613fd;};}function handleError(_0x1f98a7,_0x4335c6){_0x4335c6=_0x4335c6||0x1f4;return function(_0x5457f6){logger[_0xe9f0('0x2a')](_0x5457f6[_0xe9f0('0x2b')]);if(_0x5457f6[_0xe9f0('0x2c')]){delete _0x5457f6[_0xe9f0('0x2c')];}_0x1f98a7[_0xe9f0('0x1a')](_0x4335c6)[_0xe9f0('0x2d')](_0x5457f6);};}exports[_0xe9f0('0x2e')]=function(_0x2efd33,_0x2b6503){var _0x3dbe49={},_0x22806c={},_0x617ad3={'count':0x0,'rows':[]};var _0x445ad0=_[_0xe9f0('0x2f')](db[_0xe9f0('0x30')][_0xe9f0('0x31')],function(_0x80e3ac){return{'name':_0x80e3ac[_0xe9f0('0x32')],'type':_0x80e3ac[_0xe9f0('0x33')][_0xe9f0('0x34')]};});_0x22806c[_0xe9f0('0x35')]=_[_0xe9f0('0x2f')](_0x445ad0,_0xe9f0('0x2c'));_0x22806c[_0xe9f0('0x36')]=_['keys'](_0x2efd33['query']);_0x22806c['filters']=_[_0xe9f0('0x37')](_0x22806c['model'],_0x22806c[_0xe9f0('0x36')]);_0x3dbe49[_0xe9f0('0x38')]=_['intersection'](_0x22806c[_0xe9f0('0x35')],qs['fields'](_0x2efd33['query']['fields']));_0x3dbe49[_0xe9f0('0x38')]=_0x3dbe49[_0xe9f0('0x38')]['length']?_0x3dbe49[_0xe9f0('0x38')]:_0x22806c[_0xe9f0('0x35')];if(!_0x2efd33[_0xe9f0('0x36')]['hasOwnProperty']('nolimit')){_0x3dbe49[_0xe9f0('0x1d')]=qs[_0xe9f0('0x1d')](_0x2efd33[_0xe9f0('0x36')]['limit']);_0x3dbe49[_0xe9f0('0x1f')]=qs[_0xe9f0('0x1f')](_0x2efd33[_0xe9f0('0x36')][_0xe9f0('0x1f')]);}_0x3dbe49[_0xe9f0('0x39')]=qs['sort'](_0x2efd33[_0xe9f0('0x36')][_0xe9f0('0x3a')]);_0x3dbe49[_0xe9f0('0x3b')]=qs['filters'](_[_0xe9f0('0x3c')](_0x2efd33[_0xe9f0('0x36')],_0x22806c['filters']),_0x445ad0);if(_0x2efd33[_0xe9f0('0x36')]['filter']){_0x3dbe49[_0xe9f0('0x3b')]=_['merge'](_0x3dbe49['where'],{'$or':_['map'](_0x445ad0,function(_0x5bddcc){if(_0x5bddcc['type']!==_0xe9f0('0x3d')){var _0x2d4115={};_0x2d4115[_0x5bddcc[_0xe9f0('0x2c')]]={'$like':'%'+_0x2efd33[_0xe9f0('0x36')][_0xe9f0('0x3e')]+'%'};return _0x2d4115;}})});}_0x3dbe49=_[_0xe9f0('0x3f')]({},_0x3dbe49,_0x2efd33[_0xe9f0('0x40')]);var _0x3e79c1={'where':_0x3dbe49[_0xe9f0('0x3b')]};return db['ContactItemType'][_0xe9f0('0x1e')](_0x3e79c1)[_0xe9f0('0x24')](function(_0x36b00a){_0x617ad3['count']=_0x36b00a;if(_0x2efd33['query'][_0xe9f0('0x41')]){_0x3dbe49['include']=[{'all':!![]}];}return db[_0xe9f0('0x30')][_0xe9f0('0x42')](_0x3dbe49);})[_0xe9f0('0x24')](function(_0x42d9d2){_0x617ad3['rows']=_0x42d9d2;return _0x617ad3;})[_0xe9f0('0x24')](respondWithFilteredResult(_0x2b6503,_0x3dbe49))[_0xe9f0('0x43')](handleError(_0x2b6503,null));};exports[_0xe9f0('0x44')]=function(_0x18faaf,_0x37a2ac){var _0x59378a={'raw':!![],'where':{'id':_0x18faaf[_0xe9f0('0x45')]['id']}},_0x60a40d={};_0x60a40d[_0xe9f0('0x35')]=_[_0xe9f0('0x46')](db[_0xe9f0('0x30')]['rawAttributes']);_0x60a40d[_0xe9f0('0x36')]=_['keys'](_0x18faaf['query']);_0x60a40d[_0xe9f0('0x47')]=_[_0xe9f0('0x37')](_0x60a40d['model'],_0x60a40d[_0xe9f0('0x36')]);_0x59378a[_0xe9f0('0x38')]=_[_0xe9f0('0x37')](_0x60a40d[_0xe9f0('0x35')],qs[_0xe9f0('0x48')](_0x18faaf[_0xe9f0('0x36')][_0xe9f0('0x48')]));_0x59378a['attributes']=_0x59378a[_0xe9f0('0x38')]['length']?_0x59378a[_0xe9f0('0x38')]:_0x60a40d['model'];if(_0x18faaf[_0xe9f0('0x36')]['includeAll']){_0x59378a[_0xe9f0('0x49')]=[{'all':!![]}];}_0x59378a=_[_0xe9f0('0x3f')]({},_0x59378a,_0x18faaf[_0xe9f0('0x40')]);return db['ContactItemType'][_0xe9f0('0x4a')](_0x59378a)[_0xe9f0('0x24')](handleEntityNotFound(_0x37a2ac,null))[_0xe9f0('0x24')](respondWithResult(_0x37a2ac,null))[_0xe9f0('0x43')](handleError(_0x37a2ac,null));};exports[_0xe9f0('0x4b')]=function(_0x135175,_0x6ece3f){return db[_0xe9f0('0x30')][_0xe9f0('0x4b')](_0x135175[_0xe9f0('0x4c')],{})[_0xe9f0('0x24')](function(_0x1325a2){var _0x57beee=_0x135175['user'][_0xe9f0('0x26')]({'plain':!![]});if(!_0x57beee)throw new Error(_0xe9f0('0x4d'));if(_0x57beee[_0xe9f0('0x4e')]==='user'){var _0x1ac381=_0x1325a2['get']({'plain':!![]});var _0x323e1e=_0xe9f0('0x27');return db[_0xe9f0('0x4f')][_0xe9f0('0x4a')]({'where':{'name':_0x323e1e,'userProfileId':_0x57beee['userProfileId']},'raw':!![]})[_0xe9f0('0x24')](function(_0x3fa271){if(_0x3fa271&&_0x3fa271['autoAssociation']===0x0){return db[_0xe9f0('0x28')][_0xe9f0('0x4b')]({'name':_0x1ac381[_0xe9f0('0x2c')],'resourceId':_0x1ac381['id'],'type':_0x3fa271[_0xe9f0('0x2c')],'sectionId':_0x3fa271['id']},{})['then'](function(){return _0x1325a2;});}else{return _0x1325a2;}})[_0xe9f0('0x43')](function(_0x3a5d19){logger[_0xe9f0('0x2a')](_0xe9f0('0x50'),_0x3a5d19);throw _0x3a5d19;});}return _0x1325a2;})[_0xe9f0('0x24')](respondWithResult(_0x6ece3f,0xc9))[_0xe9f0('0x43')](handleError(_0x6ece3f,null));};exports[_0xe9f0('0x23')]=function(_0x12d9be,_0x4da78f){if(_0x12d9be[_0xe9f0('0x4c')]['id']){delete _0x12d9be[_0xe9f0('0x4c')]['id'];}return db[_0xe9f0('0x30')][_0xe9f0('0x4a')]({'where':{'id':_0x12d9be[_0xe9f0('0x45')]['id']}})[_0xe9f0('0x24')](handleEntityNotFound(_0x4da78f,null))[_0xe9f0('0x24')](saveUpdates(_0x12d9be[_0xe9f0('0x4c')],null))[_0xe9f0('0x24')](respondWithResult(_0x4da78f,null))[_0xe9f0('0x43')](handleError(_0x4da78f,null));};exports[_0xe9f0('0x25')]=function(_0x3c26ac,_0x4f1c25){return db[_0xe9f0('0x30')]['find']({'where':{'id':_0x3c26ac[_0xe9f0('0x45')]['id']}})[_0xe9f0('0x24')](handleEntityNotFound(_0x4f1c25,null))[_0xe9f0('0x24')](db['CmContactHasItem']['update']({'ItemTypeId':null},{'where':{'ItemTypeId':_0x3c26ac[_0xe9f0('0x45')]['id']}}))['then'](removeEntity(_0x4f1c25,null))[_0xe9f0('0x43')](handleError(_0x4f1c25,null));}; \ No newline at end of file +var _0x1893=['util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','get','ContactItemTypes','UserProfileResource','destroy','error','stack','name','index','ContactItemType','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','catch','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','CmContactHasItem','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x274509,_0x1353f7){var _0x47298c=function(_0x514eaf){while(--_0x514eaf){_0x274509['push'](_0x274509['shift']());}};_0x47298c(++_0x1353f7);}(_0x1893,0xa2));var _0x3189=function(_0x567ef4,_0x10a870){_0x567ef4=_0x567ef4-0x0;var _0x481cd6=_0x1893[_0x567ef4];return _0x481cd6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3189('0x0'));var jsonpatch=require(_0x3189('0x1'));var rp=require(_0x3189('0x2'));var moment=require(_0x3189('0x3'));var BPromise=require(_0x3189('0x4'));var Mustache=require(_0x3189('0x5'));var util=require(_0x3189('0x6'));var path=require('path');var sox=require(_0x3189('0x7'));var csv=require(_0x3189('0x8'));var ejs=require(_0x3189('0x9'));var fs=require('fs');var fs_extra=require(_0x3189('0xa'));var _=require(_0x3189('0xb'));var squel=require(_0x3189('0xc'));var crypto=require(_0x3189('0xd'));var jsforce=require(_0x3189('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3189('0x8'));var querystring=require('querystring');var Papa=require(_0x3189('0xf'));var Redis=require('ioredis');var authService=require(_0x3189('0x10'));var qs=require(_0x3189('0x11'));var as=require(_0x3189('0x12'));var hardwareService=require(_0x3189('0x13'));var logger=require('../../config/logger')(_0x3189('0x14'));var utils=require(_0x3189('0x15'));var config=require(_0x3189('0x16'));var licenseUtil=require(_0x3189('0x17'));var db=require(_0x3189('0x18'))['db'];function respondWithStatusCode(_0x5d9fff,_0x22b11e){_0x22b11e=_0x22b11e||0xcc;return function(_0x353b17){if(_0x353b17){return _0x5d9fff[_0x3189('0x19')](_0x22b11e);}return _0x5d9fff[_0x3189('0x1a')](_0x22b11e)[_0x3189('0x1b')]();};}function respondWithResult(_0x20dcc2,_0xef438){_0xef438=_0xef438||0xc8;return function(_0x25a917){if(_0x25a917){return _0x20dcc2['status'](_0xef438)[_0x3189('0x1c')](_0x25a917);}};}function respondWithFilteredResult(_0xb3e4c2,_0x1c209b){return function(_0x2fb62b){if(_0x2fb62b){var _0x486dd2=typeof _0x1c209b[_0x3189('0x1d')]==='undefined'&&typeof _0x1c209b['limit']===_0x3189('0x1e');var _0x49b1bc=_0x2fb62b[_0x3189('0x1f')];var _0xf8aed7=_0x486dd2?0x0:_0x1c209b[_0x3189('0x1d')];var _0x9905c4=_0x486dd2?_0x2fb62b['count']:_0x1c209b[_0x3189('0x1d')]+_0x1c209b[_0x3189('0x20')];var _0x16edd7;if(_0x9905c4>=_0x49b1bc){_0x9905c4=_0x49b1bc;_0x16edd7=0xc8;}else{_0x16edd7=0xce;}_0xb3e4c2['status'](_0x16edd7);return _0xb3e4c2[_0x3189('0x21')](_0x3189('0x22'),_0xf8aed7+'-'+_0x9905c4+'/'+_0x49b1bc)[_0x3189('0x1c')](_0x2fb62b);}return null;};}function patchUpdates(_0x2c1e59){return function(_0x29b275){try{jsonpatch['apply'](_0x29b275,_0x2c1e59,!![]);}catch(_0x1771a8){return BPromise[_0x3189('0x23')](_0x1771a8);}return _0x29b275[_0x3189('0x24')]();};}function saveUpdates(_0x539e12,_0x309c6e){return function(_0x47abb4){if(_0x47abb4){return _0x47abb4[_0x3189('0x25')](_0x539e12)[_0x3189('0x26')](function(_0x200f16){return _0x200f16;});}return null;};}function removeEntity(_0x38e56a,_0x1cbe33){return function(_0x393fcb){if(_0x393fcb){return _0x393fcb['destroy']()['then'](function(){var _0x1dd6c2=_0x393fcb[_0x3189('0x27')]({'plain':!![]});var _0x1dc1c8=_0x3189('0x28');return db[_0x3189('0x29')][_0x3189('0x2a')]({'where':{'type':_0x1dc1c8,'resourceId':_0x1dd6c2['id']}})[_0x3189('0x26')](function(){return _0x393fcb;});})[_0x3189('0x26')](function(){_0x38e56a[_0x3189('0x1a')](0xcc)[_0x3189('0x1b')]();});}};}function handleEntityNotFound(_0x5ce5f5,_0x4c4a5e){return function(_0x5aa34a){if(!_0x5aa34a){_0x5ce5f5[_0x3189('0x19')](0x194);}return _0x5aa34a;};}function handleError(_0x3d7d5b,_0x1be399){_0x1be399=_0x1be399||0x1f4;return function(_0x90c31){logger[_0x3189('0x2b')](_0x90c31[_0x3189('0x2c')]);if(_0x90c31['name']){delete _0x90c31[_0x3189('0x2d')];}_0x3d7d5b[_0x3189('0x1a')](_0x1be399)['send'](_0x90c31);};}exports[_0x3189('0x2e')]=function(_0x3744ff,_0x39c5e4){var _0x5c7a36={},_0x168dc2={},_0x32bba1={'count':0x0,'rows':[]};var _0x23798e=_['map'](db[_0x3189('0x2f')][_0x3189('0x30')],function(_0x51ce54){return{'name':_0x51ce54[_0x3189('0x31')],'type':_0x51ce54[_0x3189('0x32')][_0x3189('0x33')]};});_0x168dc2[_0x3189('0x34')]=_[_0x3189('0x35')](_0x23798e,'name');_0x168dc2['query']=_[_0x3189('0x36')](_0x3744ff['query']);_0x168dc2[_0x3189('0x37')]=_[_0x3189('0x38')](_0x168dc2[_0x3189('0x34')],_0x168dc2[_0x3189('0x39')]);_0x5c7a36[_0x3189('0x3a')]=_[_0x3189('0x38')](_0x168dc2[_0x3189('0x34')],qs[_0x3189('0x3b')](_0x3744ff[_0x3189('0x39')]['fields']));_0x5c7a36[_0x3189('0x3a')]=_0x5c7a36[_0x3189('0x3a')][_0x3189('0x3c')]?_0x5c7a36[_0x3189('0x3a')]:_0x168dc2[_0x3189('0x34')];if(!_0x3744ff[_0x3189('0x39')][_0x3189('0x3d')]('nolimit')){_0x5c7a36['limit']=qs[_0x3189('0x20')](_0x3744ff['query'][_0x3189('0x20')]);_0x5c7a36[_0x3189('0x1d')]=qs['offset'](_0x3744ff[_0x3189('0x39')][_0x3189('0x1d')]);}_0x5c7a36[_0x3189('0x3e')]=qs[_0x3189('0x3f')](_0x3744ff['query'][_0x3189('0x3f')]);_0x5c7a36['where']=qs['filters'](_[_0x3189('0x40')](_0x3744ff[_0x3189('0x39')],_0x168dc2[_0x3189('0x37')]),_0x23798e);if(_0x3744ff[_0x3189('0x39')][_0x3189('0x41')]){_0x5c7a36[_0x3189('0x42')]=_[_0x3189('0x43')](_0x5c7a36[_0x3189('0x42')],{'$or':_['map'](_0x23798e,function(_0x568dab){if(_0x568dab[_0x3189('0x32')]!==_0x3189('0x44')){var _0x59fc8f={};_0x59fc8f[_0x568dab[_0x3189('0x2d')]]={'$like':'%'+_0x3744ff[_0x3189('0x39')][_0x3189('0x41')]+'%'};return _0x59fc8f;}})});}_0x5c7a36=_['merge']({},_0x5c7a36,_0x3744ff[_0x3189('0x45')]);var _0xc48bf1={'where':_0x5c7a36[_0x3189('0x42')]};return db[_0x3189('0x2f')]['count'](_0xc48bf1)[_0x3189('0x26')](function(_0x2f0d49){_0x32bba1['count']=_0x2f0d49;if(_0x3744ff['query'][_0x3189('0x46')]){_0x5c7a36['include']=[{'all':!![]}];}return db[_0x3189('0x2f')][_0x3189('0x47')](_0x5c7a36);})[_0x3189('0x26')](function(_0x9593f3){_0x32bba1['rows']=_0x9593f3;return _0x32bba1;})[_0x3189('0x26')](respondWithFilteredResult(_0x39c5e4,_0x5c7a36))[_0x3189('0x48')](handleError(_0x39c5e4,null));};exports['show']=function(_0x42e1d2,_0x4114ba){var _0x279991={'raw':!![],'where':{'id':_0x42e1d2[_0x3189('0x49')]['id']}},_0x3a6a36={};_0x3a6a36['model']=_['keys'](db[_0x3189('0x2f')]['rawAttributes']);_0x3a6a36[_0x3189('0x39')]=_[_0x3189('0x36')](_0x42e1d2[_0x3189('0x39')]);_0x3a6a36['filters']=_[_0x3189('0x38')](_0x3a6a36[_0x3189('0x34')],_0x3a6a36[_0x3189('0x39')]);_0x279991['attributes']=_[_0x3189('0x38')](_0x3a6a36[_0x3189('0x34')],qs[_0x3189('0x3b')](_0x42e1d2[_0x3189('0x39')][_0x3189('0x3b')]));_0x279991[_0x3189('0x3a')]=_0x279991['attributes']['length']?_0x279991[_0x3189('0x3a')]:_0x3a6a36['model'];if(_0x42e1d2['query'][_0x3189('0x46')]){_0x279991['include']=[{'all':!![]}];}_0x279991=_[_0x3189('0x43')]({},_0x279991,_0x42e1d2[_0x3189('0x45')]);return db[_0x3189('0x2f')]['find'](_0x279991)[_0x3189('0x26')](handleEntityNotFound(_0x4114ba,null))['then'](respondWithResult(_0x4114ba,null))[_0x3189('0x48')](handleError(_0x4114ba,null));};exports['create']=function(_0x49c4a8,_0x244166){return db['ContactItemType'][_0x3189('0x4a')](_0x49c4a8['body'],{})['then'](function(_0x347993){var _0x3f961e=_0x49c4a8[_0x3189('0x4b')][_0x3189('0x27')]({'plain':!![]});if(!_0x3f961e)throw new Error(_0x3189('0x4c'));if(_0x3f961e[_0x3189('0x4d')]==='user'){var _0x21d446=_0x347993['get']({'plain':!![]});var _0x5e2823=_0x3189('0x28');return db[_0x3189('0x4e')][_0x3189('0x4f')]({'where':{'name':_0x5e2823,'userProfileId':_0x3f961e[_0x3189('0x50')]},'raw':!![]})[_0x3189('0x26')](function(_0xaa2012){if(_0xaa2012&&_0xaa2012['autoAssociation']===0x0){return db[_0x3189('0x29')]['create']({'name':_0x21d446[_0x3189('0x2d')],'resourceId':_0x21d446['id'],'type':_0xaa2012[_0x3189('0x2d')],'sectionId':_0xaa2012['id']},{})[_0x3189('0x26')](function(){return _0x347993;});}else{return _0x347993;}})[_0x3189('0x48')](function(_0x4f41e5){logger[_0x3189('0x2b')](_0x3189('0x51'),_0x4f41e5);throw _0x4f41e5;});}return _0x347993;})['then'](respondWithResult(_0x244166,0xc9))[_0x3189('0x48')](handleError(_0x244166,null));};exports[_0x3189('0x25')]=function(_0x584009,_0x2bc288){if(_0x584009['body']['id']){delete _0x584009[_0x3189('0x52')]['id'];}return db['ContactItemType'][_0x3189('0x4f')]({'where':{'id':_0x584009['params']['id']}})[_0x3189('0x26')](handleEntityNotFound(_0x2bc288,null))[_0x3189('0x26')](saveUpdates(_0x584009['body'],null))['then'](respondWithResult(_0x2bc288,null))['catch'](handleError(_0x2bc288,null));};exports[_0x3189('0x2a')]=function(_0x5b14ac,_0x212df4){return db[_0x3189('0x2f')][_0x3189('0x4f')]({'where':{'id':_0x5b14ac[_0x3189('0x49')]['id']}})[_0x3189('0x26')](handleEntityNotFound(_0x212df4,null))[_0x3189('0x26')](db[_0x3189('0x53')][_0x3189('0x25')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x5b14ac[_0x3189('0x49')]['id']}}))['then'](removeEntity(_0x212df4,null))[_0x3189('0x48')](handleError(_0x212df4,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 9a62eb2..99b1610 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 _0xd934=['rimraf','../../config/environment','exports','define','tools_contact_item_types','lodash','util','../../config/logger','moment','path'];(function(_0x6c023d,_0x33662d){var _0xae9ed5=function(_0x1ac6d0){while(--_0x1ac6d0){_0x6c023d['push'](_0x6c023d['shift']());}};_0xae9ed5(++_0x33662d);}(_0xd934,0x131));var _0x4d93=function(_0x3a6bca,_0x5dbf24){_0x3a6bca=_0x3a6bca-0x0;var _0x34a210=_0xd934[_0x3a6bca];return _0x34a210;};'use strict';var _=require(_0x4d93('0x0'));var util=require(_0x4d93('0x1'));var logger=require(_0x4d93('0x2'))('api');var moment=require(_0x4d93('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4d93('0x4'));var rimraf=require(_0x4d93('0x5'));var config=require(_0x4d93('0x6'));var attributes=require('./contactItemType.attributes');module[_0x4d93('0x7')]=function(_0x1239bf,_0x556d87){return _0x1239bf[_0x4d93('0x8')]('ContactItemType',attributes,{'tableName':_0x4d93('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3165=['util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./contactItemType.attributes','exports','ContactItemType','tools_contact_item_types','lodash'];(function(_0x2259e3,_0x457898){var _0x4d9e3e=function(_0x3a364c){while(--_0x3a364c){_0x2259e3['push'](_0x2259e3['shift']());}};_0x4d9e3e(++_0x457898);}(_0x3165,0x149));var _0x5316=function(_0x27e0d4,_0x56f98f){_0x27e0d4=_0x27e0d4-0x0;var _0x18e1ed=_0x3165[_0x27e0d4];return _0x18e1ed;};'use strict';var _=require(_0x5316('0x0'));var util=require(_0x5316('0x1'));var logger=require(_0x5316('0x2'))('api');var moment=require(_0x5316('0x3'));var BPromise=require('bluebird');var rp=require(_0x5316('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5316('0x5'));var config=require(_0x5316('0x6'));var attributes=require(_0x5316('0x7'));module[_0x5316('0x8')]=function(_0x3d0f70,_0x5a6d26){return _0x3d0f70['define'](_0x5316('0x9'),attributes,{'tableName':_0x5316('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.rpc.js b/server/api/contactItemType/contactItemType.rpc.js index 59f61f4..95c278d 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 _0xb927=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','ContactItemType,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0xb927,0xa9));var _0x7b92=function(_0x5f7a83,_0x322a2f){_0x5f7a83=_0x5f7a83-0x0;var _0xf05190=_0xb927[_0x5f7a83];return _0xf05190;};'use strict';var _=require('lodash');var util=require(_0x7b92('0x0'));var moment=require(_0x7b92('0x1'));var BPromise=require(_0x7b92('0x2'));var rs=require(_0x7b92('0x3'));var fs=require('fs');var Redis=require(_0x7b92('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7b92('0x5'));var logger=require(_0x7b92('0x6'))(_0x7b92('0x7'));var config=require(_0x7b92('0x8'));var jayson=require(_0x7b92('0x9'));var client=jayson[_0x7b92('0xa')][_0x7b92('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c5b67,_0xcf00e0,_0x14efaf){return new BPromise(function(_0x507e5c,_0x2fa60e){return client[_0x7b92('0xc')](_0x3c5b67,_0x14efaf)[_0x7b92('0xd')](function(_0x1b2234){logger[_0x7b92('0xe')](_0x7b92('0xf'),_0xcf00e0,_0x7b92('0x10'));logger['debug'](_0x7b92('0x11'),_0xcf00e0,_0x7b92('0x10'),JSON['stringify'](_0x1b2234));if(_0x1b2234['error']){if(_0x1b2234[_0x7b92('0x12')][_0x7b92('0x13')]===0x1f4){logger['error'](_0x7b92('0xf'),_0xcf00e0,_0x1b2234['error'][_0x7b92('0x14')]);return _0x2fa60e(_0x1b2234[_0x7b92('0x12')][_0x7b92('0x14')]);}logger[_0x7b92('0x12')](_0x7b92('0xf'),_0xcf00e0,_0x1b2234[_0x7b92('0x12')]['message']);return _0x507e5c(_0x1b2234[_0x7b92('0x12')][_0x7b92('0x14')]);}else{logger[_0x7b92('0xe')](_0x7b92('0xf'),_0xcf00e0,_0x7b92('0x10'));_0x507e5c(_0x1b2234['result'][_0x7b92('0x14')]);}})[_0x7b92('0x15')](function(_0x4b6aaf){logger['error'](_0x7b92('0xf'),_0xcf00e0,_0x4b6aaf);_0x2fa60e(_0x4b6aaf);});});} \ No newline at end of file +var _0x02e7=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x22d202,_0xfcd670){var _0x3cb212=function(_0xafd594){while(--_0xafd594){_0x22d202['push'](_0x22d202['shift']());}};_0x3cb212(++_0xfcd670);}(_0x02e7,0x146));var _0x702e=function(_0x3bfbcf,_0x43feb3){_0x3bfbcf=_0x3bfbcf-0x0;var _0x1384d1=_0x02e7[_0x3bfbcf];return _0x1384d1;};'use strict';var _=require(_0x702e('0x0'));var util=require('util');var moment=require(_0x702e('0x1'));var BPromise=require(_0x702e('0x2'));var rs=require(_0x702e('0x3'));var fs=require('fs');var Redis=require(_0x702e('0x4'));var db=require(_0x702e('0x5'))['db'];var utils=require(_0x702e('0x6'));var logger=require(_0x702e('0x7'))(_0x702e('0x8'));var config=require(_0x702e('0x9'));var jayson=require(_0x702e('0xa'));var client=jayson[_0x702e('0xb')][_0x702e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xd0e83b,_0x25b23f,_0x30c8aa){return new BPromise(function(_0x25a4e8,_0x35f4d9){return client[_0x702e('0xd')](_0xd0e83b,_0x30c8aa)[_0x702e('0xe')](function(_0x134f81){logger[_0x702e('0xf')](_0x702e('0x10'),_0x25b23f,_0x702e('0x11'));logger[_0x702e('0x12')](_0x702e('0x13'),_0x25b23f,'request\x20sent',JSON[_0x702e('0x14')](_0x134f81));if(_0x134f81[_0x702e('0x15')]){if(_0x134f81[_0x702e('0x15')]['code']===0x1f4){logger['error'](_0x702e('0x10'),_0x25b23f,_0x134f81['error']['message']);return _0x35f4d9(_0x134f81[_0x702e('0x15')][_0x702e('0x16')]);}logger[_0x702e('0x15')](_0x702e('0x10'),_0x25b23f,_0x134f81[_0x702e('0x15')][_0x702e('0x16')]);return _0x25a4e8(_0x134f81[_0x702e('0x15')][_0x702e('0x16')]);}else{logger[_0x702e('0xf')](_0x702e('0x10'),_0x25b23f,_0x702e('0x11'));_0x25a4e8(_0x134f81[_0x702e('0x17')][_0x702e('0x16')]);}})[_0x702e('0x18')](function(_0x76af45){logger[_0x702e('0x15')]('ContactItemType,\x20%s,\x20%s',_0x25b23f,_0x76af45);_0x35f4d9(_0x76af45);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 6d90706..23b0ba4 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 _0x4dfa=['get','/:id','isAuthenticated','put','exports','multer','connect-timeout','Router','../../config/environment','./contactItemType.controller','index'];(function(_0x56daff,_0xadca9a){var _0x132c82=function(_0x19e0d7){while(--_0x19e0d7){_0x56daff['push'](_0x56daff['shift']());}};_0x132c82(++_0xadca9a);}(_0x4dfa,0xec));var _0xa4df=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x4dfa[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0xa4df('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa4df('0x1'));var express=require('express');var router=express[_0xa4df('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa4df('0x3'));var controller=require(_0xa4df('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0xa4df('0x5')]);router[_0xa4df('0x6')](_0xa4df('0x7'),auth[_0xa4df('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xa4df('0x9')]('/:id',auth[_0xa4df('0x8')](),controller['update']);router['delete'](_0xa4df('0x7'),auth[_0xa4df('0x8')](),controller['destroy']);module[_0xa4df('0xa')]=router; \ No newline at end of file +var _0xa073=['path','connect-timeout','express','fs-extra','../../config/environment','./contactItemType.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa073,0x141));var _0x3a07=function(_0x330335,_0x1038b0){_0x330335=_0x330335-0x0;var _0x2a4966=_0xa073[_0x330335];return _0x2a4966;};'use strict';var multer=require(_0x3a07('0x0'));var util=require(_0x3a07('0x1'));var path=require(_0x3a07('0x2'));var timeout=require(_0x3a07('0x3'));var express=require(_0x3a07('0x4'));var router=express['Router']();var fs_extra=require(_0x3a07('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3a07('0x6'));var controller=require(_0x3a07('0x7'));router[_0x3a07('0x8')]('/',auth[_0x3a07('0x9')](),controller[_0x3a07('0xa')]);router[_0x3a07('0x8')](_0x3a07('0xb'),auth[_0x3a07('0x9')](),controller[_0x3a07('0xc')]);router[_0x3a07('0xd')]('/',auth[_0x3a07('0x9')](),controller[_0x3a07('0xe')]);router['put']('/:id',auth[_0x3a07('0x9')](),controller[_0x3a07('0xf')]);router[_0x3a07('0x10')]('/:id',auth[_0x3a07('0x9')](),controller[_0x3a07('0x11')]);module[_0x3a07('0x12')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 730b9ef..af61eb8 100644 --- a/server/api/dashboard/dashboard.attributes.js +++ b/server/api/dashboard/dashboard.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['exports','sequelize'];(function(_0x339b49,_0x23de01){var _0x3c6365=function(_0x175cb1){while(--_0x175cb1){_0x339b49['push'](_0x339b49['shift']());}};_0x3c6365(++_0x23de01);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb7e7=['STRING','sequelize'];(function(_0x3e25c1,_0x1d15f9){var _0x52e7f2=function(_0x597a5a){while(--_0x597a5a){_0x3e25c1['push'](_0x3e25c1['shift']());}};_0x52e7f2(++_0x1d15f9);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xb7e7[_0x2763f2];return _0x3ef471;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 6ec037c..3419a89 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 _0x4370=['attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','getItems','findOne','DashboardItem','hasOwnProperty','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','get','destroy','end','error','name','send','rawAttributes','fieldName','type','key','map','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','options','Dashboard','includeAll','include','findAll','rows','catch','params','merge','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','UserProfileResource','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues'];(function(_0x3cf6a3,_0xc502f9){var _0x26c993=function(_0x34844f){while(--_0x34844f){_0x3cf6a3['push'](_0x3cf6a3['shift']());}};_0x26c993(++_0xc502f9);}(_0x4370,0x1ac));var _0x0437=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x4370[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0x0437('0x0'));var rimraf=require(_0x0437('0x1'));var zipdir=require(_0x0437('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0437('0x3'));var BPromise=require(_0x0437('0x4'));var Mustache=require(_0x0437('0x5'));var util=require(_0x0437('0x6'));var path=require(_0x0437('0x7'));var sox=require(_0x0437('0x8'));var csv=require(_0x0437('0x9'));var ejs=require(_0x0437('0xa'));var fs=require('fs');var fs_extra=require(_0x0437('0xb'));var _=require('lodash');var squel=require(_0x0437('0xc'));var crypto=require(_0x0437('0xd'));var jsforce=require(_0x0437('0xe'));var deskjs=require(_0x0437('0xf'));var toCsv=require(_0x0437('0x9'));var querystring=require(_0x0437('0x10'));var Papa=require('papaparse');var Redis=require(_0x0437('0x11'));var authService=require(_0x0437('0x12'));var qs=require(_0x0437('0x13'));var as=require(_0x0437('0x14'));var hardwareService=require(_0x0437('0x15'));var logger=require(_0x0437('0x16'))(_0x0437('0x17'));var utils=require(_0x0437('0x18'));var config=require(_0x0437('0x19'));var licenseUtil=require(_0x0437('0x1a'));var db=require(_0x0437('0x1b'))['db'];config[_0x0437('0x1c')]=_[_0x0437('0x1d')](config['redis'],{'host':_0x0437('0x1e'),'port':0x18eb});var socket=require(_0x0437('0x1f'))(new Redis(config[_0x0437('0x1c')]));require(_0x0437('0x20'))[_0x0437('0x21')](socket);function respondWithStatusCode(_0xcb3795,_0x488366){_0x488366=_0x488366||0xcc;return function(_0x56d26f){if(_0x56d26f){return _0xcb3795[_0x0437('0x22')](_0x488366);}return _0xcb3795[_0x0437('0x23')](_0x488366)['end']();};}function respondWithResult(_0x3eff2c,_0x42be6c){_0x42be6c=_0x42be6c||0xc8;return function(_0xe458a7){if(_0xe458a7){return _0x3eff2c[_0x0437('0x23')](_0x42be6c)[_0x0437('0x24')](_0xe458a7);}};}function respondWithFilteredResult(_0x44f5e5,_0x517d8b){return function(_0x1f4fb4){if(_0x1f4fb4){var _0x21525f=typeof _0x517d8b[_0x0437('0x25')]===_0x0437('0x26')&&typeof _0x517d8b['limit']===_0x0437('0x26');var _0x214204=_0x1f4fb4[_0x0437('0x27')];var _0x8a639d=_0x21525f?0x0:_0x517d8b[_0x0437('0x25')];var _0x1e3d48=_0x21525f?_0x1f4fb4[_0x0437('0x27')]:_0x517d8b[_0x0437('0x25')]+_0x517d8b[_0x0437('0x28')];var _0x32218b;if(_0x1e3d48>=_0x214204){_0x1e3d48=_0x214204;_0x32218b=0xc8;}else{_0x32218b=0xce;}_0x44f5e5['status'](_0x32218b);return _0x44f5e5[_0x0437('0x29')](_0x0437('0x2a'),_0x8a639d+'-'+_0x1e3d48+'/'+_0x214204)[_0x0437('0x24')](_0x1f4fb4);}return null;};}function patchUpdates(_0x17f35a){return function(_0x231c50){try{jsonpatch[_0x0437('0x2b')](_0x231c50,_0x17f35a,!![]);}catch(_0x59c37c){return BPromise[_0x0437('0x2c')](_0x59c37c);}return _0x231c50['save']();};}function saveUpdates(_0x37c915,_0x75177a){return function(_0x3d58fc){if(_0x3d58fc){return _0x3d58fc[_0x0437('0x2d')](_0x37c915)['then'](function(_0x1b5883){return _0x1b5883;});}return null;};}function removeEntity(_0x3eb93c,_0x5c1b0a){return function(_0x141511){if(_0x141511){return _0x141511['destroy']()[_0x0437('0x2e')](function(){var _0x1ea71d=_0x141511[_0x0437('0x2f')]({'plain':!![]});var _0x323f89='CustomDashboards';return db['UserProfileResource'][_0x0437('0x30')]({'where':{'type':_0x323f89,'resourceId':_0x1ea71d['id']}})[_0x0437('0x2e')](function(){return _0x141511;});})[_0x0437('0x2e')](function(){_0x3eb93c[_0x0437('0x23')](0xcc)[_0x0437('0x31')]();});}};}function handleEntityNotFound(_0x59cf23,_0x40a5ba){return function(_0x2cf735){if(!_0x2cf735){_0x59cf23[_0x0437('0x22')](0x194);}return _0x2cf735;};}function handleError(_0x2c138f,_0x1ee276){_0x1ee276=_0x1ee276||0x1f4;return function(_0x3282f4){logger[_0x0437('0x32')](_0x3282f4['stack']);if(_0x3282f4[_0x0437('0x33')]){delete _0x3282f4[_0x0437('0x33')];}_0x2c138f[_0x0437('0x23')](_0x1ee276)[_0x0437('0x34')](_0x3282f4);};}exports['index']=function(_0x9b1f15,_0x405ab7){var _0x3a64b2={},_0x376300={},_0x1e4473={'count':0x0,'rows':[]};var _0x12b529=_['map'](db['Dashboard'][_0x0437('0x35')],function(_0x3efc32){return{'name':_0x3efc32[_0x0437('0x36')],'type':_0x3efc32[_0x0437('0x37')][_0x0437('0x38')]};});_0x376300['model']=_[_0x0437('0x39')](_0x12b529,_0x0437('0x33'));_0x376300['query']=_[_0x0437('0x3a')](_0x9b1f15[_0x0437('0x3b')]);_0x376300[_0x0437('0x3c')]=_[_0x0437('0x3d')](_0x376300[_0x0437('0x3e')],_0x376300[_0x0437('0x3b')]);_0x3a64b2[_0x0437('0x3f')]=_['intersection'](_0x376300[_0x0437('0x3e')],qs[_0x0437('0x40')](_0x9b1f15[_0x0437('0x3b')]['fields']));_0x3a64b2['attributes']=_0x3a64b2['attributes'][_0x0437('0x41')]?_0x3a64b2[_0x0437('0x3f')]:_0x376300[_0x0437('0x3e')];if(!_0x9b1f15[_0x0437('0x3b')]['hasOwnProperty'](_0x0437('0x42'))){_0x3a64b2[_0x0437('0x28')]=qs[_0x0437('0x28')](_0x9b1f15[_0x0437('0x3b')][_0x0437('0x28')]);_0x3a64b2['offset']=qs[_0x0437('0x25')](_0x9b1f15[_0x0437('0x3b')][_0x0437('0x25')]);}_0x3a64b2[_0x0437('0x43')]=qs['sort'](_0x9b1f15[_0x0437('0x3b')][_0x0437('0x44')]);_0x3a64b2[_0x0437('0x45')]=qs[_0x0437('0x3c')](_[_0x0437('0x46')](_0x9b1f15[_0x0437('0x3b')],_0x376300[_0x0437('0x3c')]),_0x12b529);if(_0x9b1f15[_0x0437('0x3b')][_0x0437('0x47')]){_0x3a64b2[_0x0437('0x45')]=_['merge'](_0x3a64b2[_0x0437('0x45')],{'$or':_[_0x0437('0x39')](_0x12b529,function(_0x538fd5){if(_0x538fd5['type']!=='VIRTUAL'){var _0x539611={};_0x539611[_0x538fd5['name']]={'$like':'%'+_0x9b1f15['query']['filter']+'%'};return _0x539611;}})});}_0x3a64b2=_['merge']({},_0x3a64b2,_0x9b1f15[_0x0437('0x48')]);var _0x29e7dd={'where':_0x3a64b2[_0x0437('0x45')]};return db[_0x0437('0x49')][_0x0437('0x27')](_0x29e7dd)[_0x0437('0x2e')](function(_0x3d77be){_0x1e4473['count']=_0x3d77be;if(_0x9b1f15[_0x0437('0x3b')][_0x0437('0x4a')]){_0x3a64b2[_0x0437('0x4b')]=[{'all':!![]}];}return db['Dashboard'][_0x0437('0x4c')](_0x3a64b2);})[_0x0437('0x2e')](function(_0x3385b7){_0x1e4473[_0x0437('0x4d')]=_0x3385b7;return _0x1e4473;})[_0x0437('0x2e')](respondWithFilteredResult(_0x405ab7,_0x3a64b2))[_0x0437('0x4e')](handleError(_0x405ab7,null));};exports['show']=function(_0x5b9954,_0x554dfb){var _0x28e25a={'raw':![],'where':{'id':_0x5b9954[_0x0437('0x4f')]['id']}},_0xdc4ff0={};_0xdc4ff0[_0x0437('0x3e')]=_['keys'](db[_0x0437('0x49')][_0x0437('0x35')]);_0xdc4ff0[_0x0437('0x3b')]=_[_0x0437('0x3a')](_0x5b9954[_0x0437('0x3b')]);_0xdc4ff0[_0x0437('0x3c')]=_[_0x0437('0x3d')](_0xdc4ff0[_0x0437('0x3e')],_0xdc4ff0['query']);_0x28e25a[_0x0437('0x3f')]=_[_0x0437('0x3d')](_0xdc4ff0['model'],qs['fields'](_0x5b9954[_0x0437('0x3b')][_0x0437('0x40')]));_0x28e25a[_0x0437('0x3f')]=_0x28e25a[_0x0437('0x3f')][_0x0437('0x41')]?_0x28e25a[_0x0437('0x3f')]:_0xdc4ff0[_0x0437('0x3e')];if(_0x5b9954[_0x0437('0x3b')][_0x0437('0x4a')]){_0x28e25a[_0x0437('0x4b')]=[{'all':!![]}];}_0x28e25a=_[_0x0437('0x50')]({},_0x28e25a,_0x5b9954[_0x0437('0x48')]);return db[_0x0437('0x49')][_0x0437('0x51')](_0x28e25a)['then'](handleEntityNotFound(_0x554dfb,null))[_0x0437('0x2e')](respondWithResult(_0x554dfb,null))[_0x0437('0x4e')](handleError(_0x554dfb,null));};exports['create']=function(_0x27455f,_0x244ffa){return db[_0x0437('0x49')][_0x0437('0x52')](_0x27455f[_0x0437('0x53')],{})[_0x0437('0x2e')](function(_0x2169b0){var _0x298b04=_0x27455f[_0x0437('0x54')][_0x0437('0x2f')]({'plain':!![]});if(!_0x298b04)throw new Error(_0x0437('0x55'));if(_0x298b04['role']==='user'){var _0x11fa0a=_0x2169b0['get']({'plain':!![]});var _0x3ea85e=_0x0437('0x56');return db['UserProfileSection'][_0x0437('0x51')]({'where':{'name':_0x3ea85e,'userProfileId':_0x298b04['userProfileId']},'raw':!![]})[_0x0437('0x2e')](function(_0x3bcf2c){if(_0x3bcf2c&&_0x3bcf2c[_0x0437('0x57')]===0x0){return db['UserProfileResource'][_0x0437('0x52')]({'name':_0x11fa0a[_0x0437('0x33')],'resourceId':_0x11fa0a['id'],'type':_0x3bcf2c[_0x0437('0x33')],'sectionId':_0x3bcf2c['id']},{})[_0x0437('0x2e')](function(){return _0x2169b0;});}else{return _0x2169b0;}})[_0x0437('0x4e')](function(_0x3484ed){logger[_0x0437('0x32')](_0x0437('0x58'),_0x3484ed);throw _0x3484ed;});}return _0x2169b0;})[_0x0437('0x2e')](respondWithResult(_0x244ffa,0xc9))['catch'](handleError(_0x244ffa,null));};exports[_0x0437('0x59')]=function(_0x26b26b,_0x163946){var _0x5d198a={'where':{'id':_0x26b26b[_0x0437('0x4f')]['id']}},_0x430176={};_0x430176['model']=_[_0x0437('0x3a')](db[_0x0437('0x49')][_0x0437('0x35')]);_0x5d198a[_0x0437('0x3f')]=_[_0x0437('0x3d')](_0x430176[_0x0437('0x3e')],qs['fields'](_0x26b26b[_0x0437('0x3b')]['fields']));_0x5d198a[_0x0437('0x3f')]=_0x5d198a[_0x0437('0x3f')][_0x0437('0x41')]?_0x5d198a[_0x0437('0x3f')]:_0x430176[_0x0437('0x3e')];if(_0x26b26b[_0x0437('0x3b')][_0x0437('0x4a')]){_0x5d198a[_0x0437('0x4b')]=[{'all':!![]}];}_0x5d198a=_[_0x0437('0x50')]({},_0x5d198a,_0x26b26b[_0x0437('0x48')]);return db[_0x0437('0x49')][_0x0437('0x51')](_0x5d198a)[_0x0437('0x2e')](handleEntityNotFound(_0x163946,null))[_0x0437('0x2e')](function(_0x3fb124){if(_0x3fb124){var _0x369077=_0x3fb124['get']({'plain':!![]});_0x369077=qs[_0x0437('0x5a')](_0x369077,['id',_0x0437('0x5b'),_0x0437('0x5c')]);_0x26b26b[_0x0437('0x53')]=_[_0x0437('0x5a')](_0x26b26b[_0x0437('0x53')],['id',_0x0437('0x5b'),_0x0437('0x5c')]);return db[_0x0437('0x49')]['create'](_[_0x0437('0x50')](_0x369077,_0x26b26b[_0x0437('0x53')]),{'include':_0x26b26b[_0x0437('0x3b')][_0x0437('0x4a')]?[{'all':!![]}]:undefined})[_0x0437('0x2e')](function(_0x5bdad9){var _0x4f6491=_0x26b26b[_0x0437('0x54')][_0x0437('0x2f')]({'plain':!![]});if(!_0x4f6491)throw new Error(_0x0437('0x55'));if(_0x4f6491[_0x0437('0x5d')]===_0x0437('0x54')){var _0x3da11c=_0x5bdad9[_0x0437('0x2f')]({'plain':!![]});var _0x549b18=_0x0437('0x56');return db[_0x0437('0x5e')][_0x0437('0x51')]({'where':{'name':_0x549b18,'userProfileId':_0x4f6491['userProfileId']},'raw':!![]})[_0x0437('0x2e')](function(_0x3fe3b5){if(_0x3fe3b5&&_0x3fe3b5['autoAssociation']===0x0){return db[_0x0437('0x5f')][_0x0437('0x52')]({'name':_0x3da11c[_0x0437('0x33')],'resourceId':_0x3da11c['id'],'type':_0x3fe3b5['name'],'sectionId':_0x3fe3b5['id']},{})[_0x0437('0x2e')](function(){return _0x5bdad9;});}else{return _0x5bdad9;}})[_0x0437('0x4e')](function(_0x59d1ce){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x59d1ce);throw _0x59d1ce;});}return _0x5bdad9;});}})[_0x0437('0x2e')](respondWithResult(_0x163946,0xc9))[_0x0437('0x4e')](handleError(_0x163946,null));};exports['update']=function(_0x24afaa,_0x29415b){if(_0x24afaa[_0x0437('0x53')]['id']){delete _0x24afaa['body']['id'];}return db[_0x0437('0x49')][_0x0437('0x51')]({'where':{'id':_0x24afaa[_0x0437('0x4f')]['id']}})[_0x0437('0x2e')](handleEntityNotFound(_0x29415b,null))[_0x0437('0x2e')](saveUpdates(_0x24afaa[_0x0437('0x53')],null))[_0x0437('0x2e')](respondWithResult(_0x29415b,null))[_0x0437('0x4e')](handleError(_0x29415b,null));};exports[_0x0437('0x30')]=function(_0xcc9e66,_0x33ab86){return db[_0x0437('0x49')][_0x0437('0x51')]({'where':{'id':_0xcc9e66[_0x0437('0x4f')]['id']}})[_0x0437('0x2e')](handleEntityNotFound(_0x33ab86,null))[_0x0437('0x2e')](removeEntity(_0x33ab86,null))[_0x0437('0x4e')](handleError(_0x33ab86,null));};function widgetAttributes(_0x57483e){try{switch(_0x57483e[_0x0437('0x37')]){case _0x0437('0x60'):return[{'name':_0x0437('0x61'),'value':_0x57483e[_0x0437('0x61')]||(_0x57483e[_0x0437('0x62')]&&_0x57483e[_0x0437('0x62')][0x0]?_0x57483e['attrs'][0x0][_0x0437('0x63')]:undefined)||_0x0437('0x64')}];case'custom':return[{'name':_0x0437('0x65'),'value':_0x57483e[_0x0437('0x65')]||(_0x57483e[_0x0437('0x62')]&&_0x57483e[_0x0437('0x62')][0x0]?_0x57483e[_0x0437('0x62')][0x0][_0x0437('0x63')]:undefined)||''}];case _0x0437('0x66'):return[{'name':_0x0437('0x67'),'value':_0x57483e[_0x0437('0x67')]||(_0x57483e['attrs']&&_0x57483e[_0x0437('0x62')][0x0]?_0x57483e[_0x0437('0x62')][0x0][_0x0437('0x63')]:undefined)||_0x0437('0x68')},{'name':'attrTimezone','value':_0x57483e[_0x0437('0x69')]||(_0x57483e['attrs']&&_0x57483e[_0x0437('0x62')][0x1]?_0x57483e[_0x0437('0x62')][0x1][_0x0437('0x63')]:undefined)||_0x0437('0x6a')},{'name':_0x0437('0x6b'),'value':_0x57483e[_0x0437('0x6b')]||(_0x57483e['attrs']&&_0x57483e['attrs'][0x2]?_0x57483e['attrs'][0x2][_0x0437('0x63')]:undefined)||0xc}];case _0x0437('0x6c'):return[{'name':_0x0437('0x6d'),'value':_0x57483e[_0x0437('0x6d')]||(_0x57483e[_0x0437('0x62')]&&_0x57483e['attrs'][0x0]?_0x57483e[_0x0437('0x62')][0x0][_0x0437('0x63')]:undefined)||_0x0437('0x6e')},{'name':_0x0437('0x6f'),'value':_0x57483e[_0x0437('0x6f')]||(_0x57483e[_0x0437('0x62')]&&_0x57483e[_0x0437('0x62')][0x1]?_0x57483e[_0x0437('0x62')][0x1][_0x0437('0x63')]:undefined)||[]},{'name':_0x0437('0x6b'),'value':_0x57483e[_0x0437('0x6b')]||(_0x57483e['attrs']&&_0x57483e['attrs'][0x2]?_0x57483e[_0x0437('0x62')][0x2][_0x0437('0x63')]:undefined)||0x14},{'name':_0x0437('0x70'),'value':_0x57483e['attrChannel']||(_0x57483e[_0x0437('0x62')]&&_0x57483e[_0x0437('0x62')][0x3]?_0x57483e[_0x0437('0x62')][0x3][_0x0437('0x63')]:undefined)||_0x0437('0x71')},{'name':_0x0437('0x72'),'value':_0x57483e[_0x0437('0x72')]||(_0x57483e[_0x0437('0x62')]&&_0x57483e[_0x0437('0x62')][0x4]?_0x57483e[_0x0437('0x62')][0x4][_0x0437('0x63')]:undefined)||''},{'name':_0x0437('0x73'),'value':_0x57483e[_0x0437('0x73')]||(_0x57483e[_0x0437('0x62')]&&_0x57483e[_0x0437('0x62')][0x5]?_0x57483e[_0x0437('0x62')][0x5][_0x0437('0x63')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x57483e[_0x0437('0x74')]||(_0x57483e[_0x0437('0x62')]&&_0x57483e['attrs'][0x6]?_0x57483e['attrs'][0x6][_0x0437('0x63')]:undefined)||''},{'name':_0x0437('0x75'),'value':_0x57483e[_0x0437('0x75')]||(_0x57483e['attrs']&&_0x57483e['attrs'][0x7]?_0x57483e[_0x0437('0x62')][0x7][_0x0437('0x63')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x57483e[_0x0437('0x76')]||(_0x57483e[_0x0437('0x62')]&&_0x57483e['attrs'][0x8]?_0x57483e[_0x0437('0x62')][0x8][_0x0437('0x63')]:undefined)||''},{'name':_0x0437('0x77'),'value':_0x57483e[_0x0437('0x77')]||(_0x57483e[_0x0437('0x62')]&&_0x57483e[_0x0437('0x62')][0x9]?_0x57483e[_0x0437('0x62')][0x9]['value']:undefined)||''}];case _0x0437('0x78'):case _0x0437('0x79'):return[{'name':_0x0437('0x7a'),'value':_0x57483e['attrSerie1']||(_0x57483e[_0x0437('0x62')]&&_0x57483e['attrs'][0x0]?_0x57483e['attrs'][0x0][_0x0437('0x63')]:undefined)||_0x0437('0x6e')},{'name':'attrSerie2','value':_0x57483e[_0x0437('0x7b')]||(_0x57483e['attrs']&&_0x57483e['attrs'][0x1]?_0x57483e['attrs'][0x1][_0x0437('0x63')]:undefined)||null},{'name':_0x0437('0x7c'),'value':_0x57483e[_0x0437('0x7c')]||(_0x57483e[_0x0437('0x62')]&&_0x57483e[_0x0437('0x62')][0x2]?_0x57483e[_0x0437('0x62')][0x2][_0x0437('0x63')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x57483e['attrVoiceQueues']||(_0x57483e[_0x0437('0x62')]&&_0x57483e[_0x0437('0x62')][0x3]?_0x57483e[_0x0437('0x62')][0x3][_0x0437('0x63')]:undefined)||[]},{'name':_0x0437('0x70'),'value':_0x57483e['attrChannel']||(_0x57483e[_0x0437('0x62')]&&_0x57483e[_0x0437('0x62')][0x4]?_0x57483e[_0x0437('0x62')][0x4][_0x0437('0x63')]:undefined)||'voice'},{'name':_0x0437('0x72'),'value':_0x57483e[_0x0437('0x72')]||(_0x57483e[_0x0437('0x62')]&&_0x57483e['attrs'][0x5]?_0x57483e['attrs'][0x5][_0x0437('0x63')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x57483e[_0x0437('0x73')]||(_0x57483e[_0x0437('0x62')]&&_0x57483e[_0x0437('0x62')][0x6]?_0x57483e[_0x0437('0x62')][0x6][_0x0437('0x63')]:undefined)||''},{'name':_0x0437('0x74'),'value':_0x57483e[_0x0437('0x74')]||(_0x57483e[_0x0437('0x62')]&&_0x57483e['attrs'][0x7]?_0x57483e[_0x0437('0x62')][0x7][_0x0437('0x63')]:undefined)||''},{'name':_0x0437('0x75'),'value':_0x57483e[_0x0437('0x75')]||(_0x57483e['attrs']&&_0x57483e['attrs'][0x8]?_0x57483e[_0x0437('0x62')][0x8][_0x0437('0x63')]:undefined)||''},{'name':_0x0437('0x76'),'value':_0x57483e[_0x0437('0x76')]||(_0x57483e[_0x0437('0x62')]&&_0x57483e['attrs'][0x9]?_0x57483e[_0x0437('0x62')][0x9][_0x0437('0x63')]:undefined)||''},{'name':_0x0437('0x77'),'value':_0x57483e['attrChatWebsites']||(_0x57483e[_0x0437('0x62')]&&_0x57483e[_0x0437('0x62')][0xa]?_0x57483e['attrs'][0xa][_0x0437('0x63')]:undefined)||''}];case _0x0437('0x7d'):return[{'name':_0x0437('0x7e'),'type':_0x57483e[_0x0437('0x7f')]||(_0x57483e['attrs']&&_0x57483e[_0x0437('0x62')][0x0]?_0x57483e[_0x0437('0x62')][0x0][_0x0437('0x37')]:undefined)||null,'value':_0x57483e[_0x0437('0x7e')]||(_0x57483e[_0x0437('0x62')]&&_0x57483e[_0x0437('0x62')][0x0]?_0x57483e[_0x0437('0x62')][0x0][_0x0437('0x63')]:undefined)||null},{'name':'attrRefresh','value':_0x57483e[_0x0437('0x80')]||(_0x57483e[_0x0437('0x62')]&&_0x57483e[_0x0437('0x62')][0x1]?_0x57483e['attrs'][0x1][_0x0437('0x63')]:undefined)||0x0}];default:return[];}}catch(_0x419362){logger[_0x0437('0x32')](_0x0437('0x81'),JSON[_0x0437('0x82')](_0x419362));return[];}}exports['addItem']=function(_0x1c2814,_0x111a0c,_0x2550f3){if(_0x1c2814[_0x0437('0x53')]['id']){delete _0x1c2814[_0x0437('0x53')]['id'];}return db[_0x0437('0x49')][_0x0437('0x51')]({'where':{'id':_0x1c2814[_0x0437('0x4f')]['id']}})[_0x0437('0x2e')](handleEntityNotFound(_0x111a0c,null))[_0x0437('0x2e')](function(_0x4cfeea){if(_0x4cfeea){_0x1c2814[_0x0437('0x53')]['DashboardId']=_0x4cfeea['id'];_0x1c2814[_0x0437('0x53')][_0x0437('0x62')]=widgetAttributes(_0x1c2814[_0x0437('0x53')]);return db['DashboardItem']['create'](_0x1c2814[_0x0437('0x53')]);}})[_0x0437('0x2e')](respondWithResult(_0x111a0c,null))['catch'](handleError(_0x111a0c,null));};exports[_0x0437('0x83')]=function(_0x3390ff,_0x3d1b0a,_0x1554aa){var _0xa4b6a6={};var _0x3a583b={};var _0x5af59d;var _0x492d0b;return db[_0x0437('0x49')][_0x0437('0x84')]({'where':{'id':_0x3390ff['params']['id']}})[_0x0437('0x2e')](handleEntityNotFound(_0x3d1b0a,null))[_0x0437('0x2e')](function(_0x1a8eca){if(_0x1a8eca){_0x5af59d=_0x1a8eca;_0x3a583b[_0x0437('0x3e')]=_[_0x0437('0x3a')](db[_0x0437('0x85')][_0x0437('0x35')]);_0x3a583b[_0x0437('0x3b')]=_[_0x0437('0x3a')](_0x3390ff[_0x0437('0x3b')]);_0x3a583b[_0x0437('0x3c')]=_[_0x0437('0x3d')](_0x3a583b['model'],_0x3a583b[_0x0437('0x3b')]);_0xa4b6a6[_0x0437('0x3f')]=_[_0x0437('0x3d')](_0x3a583b[_0x0437('0x3e')],qs[_0x0437('0x40')](_0x3390ff[_0x0437('0x3b')]['fields']));_0xa4b6a6[_0x0437('0x3f')]=_0xa4b6a6[_0x0437('0x3f')]['length']?_0xa4b6a6[_0x0437('0x3f')]:_0x3a583b[_0x0437('0x3e')];_0xa4b6a6[_0x0437('0x43')]=qs[_0x0437('0x44')](_0x3390ff[_0x0437('0x3b')][_0x0437('0x44')]);_0xa4b6a6[_0x0437('0x45')]=qs[_0x0437('0x3c')](_['pick'](_0x3390ff[_0x0437('0x3b')],_0x3a583b[_0x0437('0x3c')]));if(_0x3390ff[_0x0437('0x3b')]['filter']){_0xa4b6a6[_0x0437('0x45')]=_[_0x0437('0x50')](_0xa4b6a6[_0x0437('0x45')],{'$or':_[_0x0437('0x39')](_0xa4b6a6[_0x0437('0x3f')],function(_0x1b4e84){var _0x1204c3={};_0x1204c3[_0x1b4e84]={'$like':'%'+_0x3390ff[_0x0437('0x3b')][_0x0437('0x47')]+'%'};return _0x1204c3;})});}_0xa4b6a6=_[_0x0437('0x50')]({},_0xa4b6a6,_0x3390ff['options']);return _0x5af59d[_0x0437('0x83')](_0xa4b6a6);}})[_0x0437('0x2e')](function(_0x2c8040){if(_0x2c8040){_0x492d0b=_0x2c8040[_0x0437('0x41')];if(!_0x3390ff[_0x0437('0x3b')][_0x0437('0x86')]('nolimit')){_0xa4b6a6[_0x0437('0x28')]=qs[_0x0437('0x28')](_0x3390ff['query']['limit']);_0xa4b6a6[_0x0437('0x25')]=qs['offset'](_0x3390ff['query']['offset']);}return _0x5af59d['getItems'](_0xa4b6a6);}})[_0x0437('0x2e')](function(_0x24075f){if(_0x24075f){return _0x24075f?{'count':_0x492d0b,'rows':_0x24075f}:null;}})[_0x0437('0x2e')](respondWithResult(_0x3d1b0a,null))[_0x0437('0x4e')](handleError(_0x3d1b0a,null));}; \ No newline at end of file +var _0x1a26=['findAll','rows','catch','show','include','options','find','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','params','destroy','type','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','voice','web-report','attrReport','widgetAttributes:\x20%s','stringify','addItem','DashboardItem','getItems','findOne','hasOwnProperty','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','save','update','then','CustomDashboards','UserProfileResource','stack','name','send','index','Dashboard','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','map','VIRTUAL','filter','includeAll'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1a26,0x145));var _0x61a2=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0x1a26[_0x220f3f];return _0x1f170e;};'use strict';var emlformat=require(_0x61a2('0x0'));var rimraf=require(_0x61a2('0x1'));var zipdir=require(_0x61a2('0x2'));var jsonpatch=require(_0x61a2('0x3'));var rp=require(_0x61a2('0x4'));var moment=require(_0x61a2('0x5'));var BPromise=require(_0x61a2('0x6'));var Mustache=require(_0x61a2('0x7'));var util=require(_0x61a2('0x8'));var path=require(_0x61a2('0x9'));var sox=require(_0x61a2('0xa'));var csv=require(_0x61a2('0xb'));var ejs=require(_0x61a2('0xc'));var fs=require('fs');var fs_extra=require(_0x61a2('0xd'));var _=require(_0x61a2('0xe'));var squel=require('squel');var crypto=require(_0x61a2('0xf'));var jsforce=require(_0x61a2('0x10'));var deskjs=require(_0x61a2('0x11'));var toCsv=require(_0x61a2('0xb'));var querystring=require('querystring');var Papa=require(_0x61a2('0x12'));var Redis=require(_0x61a2('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x61a2('0x14'));var as=require(_0x61a2('0x15'));var hardwareService=require(_0x61a2('0x16'));var logger=require(_0x61a2('0x17'))('api');var utils=require(_0x61a2('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x61a2('0x19'))['db'];config[_0x61a2('0x1a')]=_[_0x61a2('0x1b')](config[_0x61a2('0x1a')],{'host':_0x61a2('0x1c'),'port':0x18eb});var socket=require(_0x61a2('0x1d'))(new Redis(config[_0x61a2('0x1a')]));require(_0x61a2('0x1e'))['register'](socket);function respondWithStatusCode(_0x413d91,_0x259bfb){_0x259bfb=_0x259bfb||0xcc;return function(_0x114e3c){if(_0x114e3c){return _0x413d91[_0x61a2('0x1f')](_0x259bfb);}return _0x413d91['status'](_0x259bfb)[_0x61a2('0x20')]();};}function respondWithResult(_0x531e84,_0x56d2a6){_0x56d2a6=_0x56d2a6||0xc8;return function(_0x565491){if(_0x565491){return _0x531e84['status'](_0x56d2a6)[_0x61a2('0x21')](_0x565491);}};}function respondWithFilteredResult(_0x2143c2,_0x557555){return function(_0x45bccb){if(_0x45bccb){var _0x17905d=typeof _0x557555[_0x61a2('0x22')]===_0x61a2('0x23')&&typeof _0x557555['limit']===_0x61a2('0x23');var _0x428dcc=_0x45bccb[_0x61a2('0x24')];var _0x2a6bd7=_0x17905d?0x0:_0x557555['offset'];var _0x13f873=_0x17905d?_0x45bccb[_0x61a2('0x24')]:_0x557555[_0x61a2('0x22')]+_0x557555[_0x61a2('0x25')];var _0x2912dd;if(_0x13f873>=_0x428dcc){_0x13f873=_0x428dcc;_0x2912dd=0xc8;}else{_0x2912dd=0xce;}_0x2143c2[_0x61a2('0x26')](_0x2912dd);return _0x2143c2[_0x61a2('0x27')](_0x61a2('0x28'),_0x2a6bd7+'-'+_0x13f873+'/'+_0x428dcc)[_0x61a2('0x21')](_0x45bccb);}return null;};}function patchUpdates(_0x5ee7cb){return function(_0x5abc84){try{jsonpatch['apply'](_0x5abc84,_0x5ee7cb,!![]);}catch(_0x590066){return BPromise['reject'](_0x590066);}return _0x5abc84[_0x61a2('0x29')]();};}function saveUpdates(_0x19e267,_0x168b97){return function(_0x41ee87){if(_0x41ee87){return _0x41ee87[_0x61a2('0x2a')](_0x19e267)[_0x61a2('0x2b')](function(_0x45cd87){return _0x45cd87;});}return null;};}function removeEntity(_0x4504e3,_0x465851){return function(_0x40a103){if(_0x40a103){return _0x40a103['destroy']()[_0x61a2('0x2b')](function(){var _0x1144e7=_0x40a103['get']({'plain':!![]});var _0x1b4692=_0x61a2('0x2c');return db[_0x61a2('0x2d')]['destroy']({'where':{'type':_0x1b4692,'resourceId':_0x1144e7['id']}})[_0x61a2('0x2b')](function(){return _0x40a103;});})['then'](function(){_0x4504e3[_0x61a2('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59ba1c,_0x34d285){return function(_0x45b8ad){if(!_0x45b8ad){_0x59ba1c[_0x61a2('0x1f')](0x194);}return _0x45b8ad;};}function handleError(_0x55be73,_0x18f6c1){_0x18f6c1=_0x18f6c1||0x1f4;return function(_0x5bb50b){logger['error'](_0x5bb50b[_0x61a2('0x2e')]);if(_0x5bb50b[_0x61a2('0x2f')]){delete _0x5bb50b[_0x61a2('0x2f')];}_0x55be73[_0x61a2('0x26')](_0x18f6c1)[_0x61a2('0x30')](_0x5bb50b);};}exports[_0x61a2('0x31')]=function(_0x803919,_0x141627){var _0x324c9d={},_0xe4e162={},_0x3bf20b={'count':0x0,'rows':[]};var _0x1578ab=_['map'](db[_0x61a2('0x32')][_0x61a2('0x33')],function(_0x2b0e5e){return{'name':_0x2b0e5e[_0x61a2('0x34')],'type':_0x2b0e5e['type'][_0x61a2('0x35')]};});_0xe4e162[_0x61a2('0x36')]=_['map'](_0x1578ab,_0x61a2('0x2f'));_0xe4e162[_0x61a2('0x37')]=_[_0x61a2('0x38')](_0x803919[_0x61a2('0x37')]);_0xe4e162[_0x61a2('0x39')]=_[_0x61a2('0x3a')](_0xe4e162[_0x61a2('0x36')],_0xe4e162[_0x61a2('0x37')]);_0x324c9d[_0x61a2('0x3b')]=_[_0x61a2('0x3a')](_0xe4e162[_0x61a2('0x36')],qs[_0x61a2('0x3c')](_0x803919[_0x61a2('0x37')][_0x61a2('0x3c')]));_0x324c9d[_0x61a2('0x3b')]=_0x324c9d[_0x61a2('0x3b')][_0x61a2('0x3d')]?_0x324c9d['attributes']:_0xe4e162[_0x61a2('0x36')];if(!_0x803919[_0x61a2('0x37')]['hasOwnProperty']('nolimit')){_0x324c9d[_0x61a2('0x25')]=qs[_0x61a2('0x25')](_0x803919[_0x61a2('0x37')][_0x61a2('0x25')]);_0x324c9d[_0x61a2('0x22')]=qs[_0x61a2('0x22')](_0x803919['query'][_0x61a2('0x22')]);}_0x324c9d[_0x61a2('0x3e')]=qs['sort'](_0x803919[_0x61a2('0x37')][_0x61a2('0x3f')]);_0x324c9d[_0x61a2('0x40')]=qs[_0x61a2('0x39')](_[_0x61a2('0x41')](_0x803919[_0x61a2('0x37')],_0xe4e162[_0x61a2('0x39')]),_0x1578ab);if(_0x803919[_0x61a2('0x37')]['filter']){_0x324c9d[_0x61a2('0x40')]=_[_0x61a2('0x42')](_0x324c9d['where'],{'$or':_[_0x61a2('0x43')](_0x1578ab,function(_0x3baacf){if(_0x3baacf['type']!==_0x61a2('0x44')){var _0x1a18c2={};_0x1a18c2[_0x3baacf[_0x61a2('0x2f')]]={'$like':'%'+_0x803919[_0x61a2('0x37')][_0x61a2('0x45')]+'%'};return _0x1a18c2;}})});}_0x324c9d=_[_0x61a2('0x42')]({},_0x324c9d,_0x803919['options']);var _0x409340={'where':_0x324c9d[_0x61a2('0x40')]};return db[_0x61a2('0x32')][_0x61a2('0x24')](_0x409340)[_0x61a2('0x2b')](function(_0x3778b5){_0x3bf20b[_0x61a2('0x24')]=_0x3778b5;if(_0x803919[_0x61a2('0x37')][_0x61a2('0x46')]){_0x324c9d['include']=[{'all':!![]}];}return db['Dashboard'][_0x61a2('0x47')](_0x324c9d);})['then'](function(_0x4b5e79){_0x3bf20b[_0x61a2('0x48')]=_0x4b5e79;return _0x3bf20b;})[_0x61a2('0x2b')](respondWithFilteredResult(_0x141627,_0x324c9d))[_0x61a2('0x49')](handleError(_0x141627,null));};exports[_0x61a2('0x4a')]=function(_0x56d314,_0x4434d4){var _0x8b3177={'raw':![],'where':{'id':_0x56d314['params']['id']}},_0x4a08f0={};_0x4a08f0['model']=_[_0x61a2('0x38')](db[_0x61a2('0x32')]['rawAttributes']);_0x4a08f0[_0x61a2('0x37')]=_['keys'](_0x56d314[_0x61a2('0x37')]);_0x4a08f0['filters']=_[_0x61a2('0x3a')](_0x4a08f0[_0x61a2('0x36')],_0x4a08f0[_0x61a2('0x37')]);_0x8b3177[_0x61a2('0x3b')]=_[_0x61a2('0x3a')](_0x4a08f0[_0x61a2('0x36')],qs[_0x61a2('0x3c')](_0x56d314['query'][_0x61a2('0x3c')]));_0x8b3177[_0x61a2('0x3b')]=_0x8b3177['attributes'][_0x61a2('0x3d')]?_0x8b3177[_0x61a2('0x3b')]:_0x4a08f0[_0x61a2('0x36')];if(_0x56d314[_0x61a2('0x37')][_0x61a2('0x46')]){_0x8b3177[_0x61a2('0x4b')]=[{'all':!![]}];}_0x8b3177=_[_0x61a2('0x42')]({},_0x8b3177,_0x56d314[_0x61a2('0x4c')]);return db[_0x61a2('0x32')][_0x61a2('0x4d')](_0x8b3177)[_0x61a2('0x2b')](handleEntityNotFound(_0x4434d4,null))[_0x61a2('0x2b')](respondWithResult(_0x4434d4,null))['catch'](handleError(_0x4434d4,null));};exports[_0x61a2('0x4e')]=function(_0x3f08b3,_0x17e4e4){return db['Dashboard']['create'](_0x3f08b3[_0x61a2('0x4f')],{})[_0x61a2('0x2b')](function(_0x5a3937){var _0x16dc59=_0x3f08b3[_0x61a2('0x50')][_0x61a2('0x51')]({'plain':!![]});if(!_0x16dc59)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x16dc59[_0x61a2('0x52')]===_0x61a2('0x50')){var _0x91048b=_0x5a3937[_0x61a2('0x51')]({'plain':!![]});var _0x28fa71='CustomDashboards';return db[_0x61a2('0x53')][_0x61a2('0x4d')]({'where':{'name':_0x28fa71,'userProfileId':_0x16dc59[_0x61a2('0x54')]},'raw':!![]})[_0x61a2('0x2b')](function(_0x259708){if(_0x259708&&_0x259708[_0x61a2('0x55')]===0x0){return db[_0x61a2('0x2d')][_0x61a2('0x4e')]({'name':_0x91048b[_0x61a2('0x2f')],'resourceId':_0x91048b['id'],'type':_0x259708[_0x61a2('0x2f')],'sectionId':_0x259708['id']},{})['then'](function(){return _0x5a3937;});}else{return _0x5a3937;}})[_0x61a2('0x49')](function(_0x395d49){logger[_0x61a2('0x56')](_0x61a2('0x57'),_0x395d49);throw _0x395d49;});}return _0x5a3937;})[_0x61a2('0x2b')](respondWithResult(_0x17e4e4,0xc9))[_0x61a2('0x49')](handleError(_0x17e4e4,null));};exports['clone']=function(_0x4e596e,_0x1076af){var _0x2d241e={'where':{'id':_0x4e596e['params']['id']}},_0x33aa97={};_0x33aa97[_0x61a2('0x36')]=_['keys'](db[_0x61a2('0x32')][_0x61a2('0x33')]);_0x2d241e['attributes']=_['intersection'](_0x33aa97[_0x61a2('0x36')],qs[_0x61a2('0x3c')](_0x4e596e[_0x61a2('0x37')]['fields']));_0x2d241e[_0x61a2('0x3b')]=_0x2d241e['attributes'][_0x61a2('0x3d')]?_0x2d241e['attributes']:_0x33aa97[_0x61a2('0x36')];if(_0x4e596e['query']['includeAll']){_0x2d241e[_0x61a2('0x4b')]=[{'all':!![]}];}_0x2d241e=_[_0x61a2('0x42')]({},_0x2d241e,_0x4e596e[_0x61a2('0x4c')]);return db['Dashboard']['find'](_0x2d241e)[_0x61a2('0x2b')](handleEntityNotFound(_0x1076af,null))['then'](function(_0x513f68){if(_0x513f68){var _0x17b481=_0x513f68[_0x61a2('0x51')]({'plain':!![]});_0x17b481=qs[_0x61a2('0x58')](_0x17b481,['id','createdAt',_0x61a2('0x59')]);_0x4e596e[_0x61a2('0x4f')]=_['omit'](_0x4e596e[_0x61a2('0x4f')],['id','createdAt',_0x61a2('0x59')]);return db[_0x61a2('0x32')]['create'](_[_0x61a2('0x42')](_0x17b481,_0x4e596e[_0x61a2('0x4f')]),{'include':_0x4e596e[_0x61a2('0x37')][_0x61a2('0x46')]?[{'all':!![]}]:undefined})['then'](function(_0x41e8ed){var _0xa9001=_0x4e596e[_0x61a2('0x50')][_0x61a2('0x51')]({'plain':!![]});if(!_0xa9001)throw new Error(_0x61a2('0x5a'));if(_0xa9001[_0x61a2('0x52')]===_0x61a2('0x50')){var _0xc83a64=_0x41e8ed[_0x61a2('0x51')]({'plain':!![]});var _0x77739=_0x61a2('0x2c');return db[_0x61a2('0x53')][_0x61a2('0x4d')]({'where':{'name':_0x77739,'userProfileId':_0xa9001[_0x61a2('0x54')]},'raw':!![]})[_0x61a2('0x2b')](function(_0x2d0a28){if(_0x2d0a28&&_0x2d0a28[_0x61a2('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0xc83a64['name'],'resourceId':_0xc83a64['id'],'type':_0x2d0a28['name'],'sectionId':_0x2d0a28['id']},{})['then'](function(){return _0x41e8ed;});}else{return _0x41e8ed;}})[_0x61a2('0x49')](function(_0x1c47bc){logger[_0x61a2('0x56')](_0x61a2('0x57'),_0x1c47bc);throw _0x1c47bc;});}return _0x41e8ed;});}})['then'](respondWithResult(_0x1076af,0xc9))[_0x61a2('0x49')](handleError(_0x1076af,null));};exports['update']=function(_0x52bf7d,_0x5b7de7){if(_0x52bf7d[_0x61a2('0x4f')]['id']){delete _0x52bf7d[_0x61a2('0x4f')]['id'];}return db[_0x61a2('0x32')][_0x61a2('0x4d')]({'where':{'id':_0x52bf7d[_0x61a2('0x5b')]['id']}})[_0x61a2('0x2b')](handleEntityNotFound(_0x5b7de7,null))['then'](saveUpdates(_0x52bf7d['body'],null))[_0x61a2('0x2b')](respondWithResult(_0x5b7de7,null))['catch'](handleError(_0x5b7de7,null));};exports[_0x61a2('0x5c')]=function(_0x420071,_0x2da3a4){return db[_0x61a2('0x32')][_0x61a2('0x4d')]({'where':{'id':_0x420071['params']['id']}})[_0x61a2('0x2b')](handleEntityNotFound(_0x2da3a4,null))[_0x61a2('0x2b')](removeEntity(_0x2da3a4,null))['catch'](handleError(_0x2da3a4,null));};function widgetAttributes(_0x1baef5){try{switch(_0x1baef5[_0x61a2('0x5d')]){case _0x61a2('0x5e'):return[{'name':'attrUrl','value':_0x1baef5[_0x61a2('0x5f')]||(_0x1baef5['attrs']&&_0x1baef5['attrs'][0x0]?_0x1baef5[_0x61a2('0x60')][0x0][_0x61a2('0x61')]:undefined)||'https://'}];case _0x61a2('0x62'):return[{'name':'attrPath','value':_0x1baef5[_0x61a2('0x63')]||(_0x1baef5['attrs']&&_0x1baef5[_0x61a2('0x60')][0x0]?_0x1baef5[_0x61a2('0x60')][0x0]['value']:undefined)||''}];case _0x61a2('0x64'):return[{'name':'attrHourFormat','value':_0x1baef5[_0x61a2('0x65')]||(_0x1baef5[_0x61a2('0x60')]&&_0x1baef5[_0x61a2('0x60')][0x0]?_0x1baef5['attrs'][0x0][_0x61a2('0x61')]:undefined)||_0x61a2('0x66')},{'name':_0x61a2('0x67'),'value':_0x1baef5[_0x61a2('0x67')]||(_0x1baef5[_0x61a2('0x60')]&&_0x1baef5[_0x61a2('0x60')][0x1]?_0x1baef5['attrs'][0x1][_0x61a2('0x61')]:undefined)||_0x61a2('0x68')},{'name':_0x61a2('0x69'),'value':_0x1baef5['attrFontSize']||(_0x1baef5['attrs']&&_0x1baef5[_0x61a2('0x60')][0x2]?_0x1baef5['attrs'][0x2]['value']:undefined)||0xc}];case _0x61a2('0x6a'):return[{'name':_0x61a2('0x6b'),'value':_0x1baef5[_0x61a2('0x6b')]||(_0x1baef5[_0x61a2('0x60')]&&_0x1baef5[_0x61a2('0x60')][0x0]?_0x1baef5['attrs'][0x0]['value']:undefined)||'total'},{'name':_0x61a2('0x6c'),'value':_0x1baef5['attrVoiceQueues']||(_0x1baef5[_0x61a2('0x60')]&&_0x1baef5[_0x61a2('0x60')][0x1]?_0x1baef5[_0x61a2('0x60')][0x1][_0x61a2('0x61')]:undefined)||[]},{'name':_0x61a2('0x69'),'value':_0x1baef5[_0x61a2('0x69')]||(_0x1baef5[_0x61a2('0x60')]&&_0x1baef5[_0x61a2('0x60')][0x2]?_0x1baef5['attrs'][0x2][_0x61a2('0x61')]:undefined)||0x14},{'name':_0x61a2('0x6d'),'value':_0x1baef5[_0x61a2('0x6d')]||(_0x1baef5[_0x61a2('0x60')]&&_0x1baef5[_0x61a2('0x60')][0x3]?_0x1baef5[_0x61a2('0x60')][0x3]['value']:undefined)||'voice'},{'name':_0x61a2('0x6e'),'value':_0x1baef5[_0x61a2('0x6e')]||(_0x1baef5[_0x61a2('0x60')]&&_0x1baef5[_0x61a2('0x60')][0x4]?_0x1baef5[_0x61a2('0x60')][0x4]['value']:undefined)||''},{'name':_0x61a2('0x6f'),'value':_0x1baef5[_0x61a2('0x6f')]||(_0x1baef5['attrs']&&_0x1baef5[_0x61a2('0x60')][0x5]?_0x1baef5[_0x61a2('0x60')][0x5][_0x61a2('0x61')]:undefined)||''},{'name':_0x61a2('0x70'),'value':_0x1baef5[_0x61a2('0x70')]||(_0x1baef5[_0x61a2('0x60')]&&_0x1baef5['attrs'][0x6]?_0x1baef5['attrs'][0x6][_0x61a2('0x61')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x1baef5[_0x61a2('0x71')]||(_0x1baef5[_0x61a2('0x60')]&&_0x1baef5[_0x61a2('0x60')][0x7]?_0x1baef5['attrs'][0x7][_0x61a2('0x61')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x1baef5[_0x61a2('0x72')]||(_0x1baef5['attrs']&&_0x1baef5['attrs'][0x8]?_0x1baef5['attrs'][0x8][_0x61a2('0x61')]:undefined)||''},{'name':'attrChatWebsites','value':_0x1baef5[_0x61a2('0x73')]||(_0x1baef5[_0x61a2('0x60')]&&_0x1baef5[_0x61a2('0x60')][0x9]?_0x1baef5['attrs'][0x9][_0x61a2('0x61')]:undefined)||''}];case'multibar-chart':case _0x61a2('0x74'):return[{'name':_0x61a2('0x75'),'value':_0x1baef5[_0x61a2('0x75')]||(_0x1baef5[_0x61a2('0x60')]&&_0x1baef5[_0x61a2('0x60')][0x0]?_0x1baef5['attrs'][0x0][_0x61a2('0x61')]:undefined)||_0x61a2('0x76')},{'name':_0x61a2('0x77'),'value':_0x1baef5['attrSerie2']||(_0x1baef5[_0x61a2('0x60')]&&_0x1baef5[_0x61a2('0x60')][0x1]?_0x1baef5[_0x61a2('0x60')][0x1][_0x61a2('0x61')]:undefined)||null},{'name':_0x61a2('0x78'),'value':_0x1baef5[_0x61a2('0x78')]||(_0x1baef5[_0x61a2('0x60')]&&_0x1baef5[_0x61a2('0x60')][0x2]?_0x1baef5[_0x61a2('0x60')][0x2][_0x61a2('0x61')]:undefined)||null},{'name':_0x61a2('0x6c'),'value':_0x1baef5[_0x61a2('0x6c')]||(_0x1baef5[_0x61a2('0x60')]&&_0x1baef5[_0x61a2('0x60')][0x3]?_0x1baef5[_0x61a2('0x60')][0x3][_0x61a2('0x61')]:undefined)||[]},{'name':_0x61a2('0x6d'),'value':_0x1baef5['attrChannel']||(_0x1baef5[_0x61a2('0x60')]&&_0x1baef5['attrs'][0x4]?_0x1baef5['attrs'][0x4]['value']:undefined)||_0x61a2('0x79')},{'name':_0x61a2('0x6e'),'value':_0x1baef5[_0x61a2('0x6e')]||(_0x1baef5['attrs']&&_0x1baef5[_0x61a2('0x60')][0x5]?_0x1baef5[_0x61a2('0x60')][0x5]['value']:undefined)||''},{'name':_0x61a2('0x6f'),'value':_0x1baef5[_0x61a2('0x6f')]||(_0x1baef5[_0x61a2('0x60')]&&_0x1baef5[_0x61a2('0x60')][0x6]?_0x1baef5[_0x61a2('0x60')][0x6][_0x61a2('0x61')]:undefined)||''},{'name':_0x61a2('0x70'),'value':_0x1baef5[_0x61a2('0x70')]||(_0x1baef5['attrs']&&_0x1baef5['attrs'][0x7]?_0x1baef5['attrs'][0x7]['value']:undefined)||''},{'name':_0x61a2('0x71'),'value':_0x1baef5[_0x61a2('0x71')]||(_0x1baef5[_0x61a2('0x60')]&&_0x1baef5['attrs'][0x8]?_0x1baef5[_0x61a2('0x60')][0x8][_0x61a2('0x61')]:undefined)||''},{'name':_0x61a2('0x72'),'value':_0x1baef5[_0x61a2('0x72')]||(_0x1baef5[_0x61a2('0x60')]&&_0x1baef5[_0x61a2('0x60')][0x9]?_0x1baef5[_0x61a2('0x60')][0x9]['value']:undefined)||''},{'name':_0x61a2('0x73'),'value':_0x1baef5['attrChatWebsites']||(_0x1baef5[_0x61a2('0x60')]&&_0x1baef5[_0x61a2('0x60')][0xa]?_0x1baef5[_0x61a2('0x60')][0xa]['value']:undefined)||''}];case _0x61a2('0x7a'):return[{'name':_0x61a2('0x7b'),'type':_0x1baef5['reportType']||(_0x1baef5[_0x61a2('0x60')]&&_0x1baef5['attrs'][0x0]?_0x1baef5[_0x61a2('0x60')][0x0][_0x61a2('0x5d')]:undefined)||null,'value':_0x1baef5[_0x61a2('0x7b')]||(_0x1baef5[_0x61a2('0x60')]&&_0x1baef5[_0x61a2('0x60')][0x0]?_0x1baef5[_0x61a2('0x60')][0x0][_0x61a2('0x61')]:undefined)||null},{'name':'attrRefresh','value':_0x1baef5['attrRefresh']||(_0x1baef5[_0x61a2('0x60')]&&_0x1baef5['attrs'][0x1]?_0x1baef5[_0x61a2('0x60')][0x1][_0x61a2('0x61')]:undefined)||0x0}];default:return[];}}catch(_0x1e5324){logger['error'](_0x61a2('0x7c'),JSON[_0x61a2('0x7d')](_0x1e5324));return[];}}exports[_0x61a2('0x7e')]=function(_0x1738ee,_0x2296a4,_0x3983b1){if(_0x1738ee[_0x61a2('0x4f')]['id']){delete _0x1738ee[_0x61a2('0x4f')]['id'];}return db['Dashboard'][_0x61a2('0x4d')]({'where':{'id':_0x1738ee[_0x61a2('0x5b')]['id']}})['then'](handleEntityNotFound(_0x2296a4,null))['then'](function(_0x4ea9cf){if(_0x4ea9cf){_0x1738ee[_0x61a2('0x4f')]['DashboardId']=_0x4ea9cf['id'];_0x1738ee[_0x61a2('0x4f')][_0x61a2('0x60')]=widgetAttributes(_0x1738ee[_0x61a2('0x4f')]);return db[_0x61a2('0x7f')][_0x61a2('0x4e')](_0x1738ee[_0x61a2('0x4f')]);}})[_0x61a2('0x2b')](respondWithResult(_0x2296a4,null))['catch'](handleError(_0x2296a4,null));};exports[_0x61a2('0x80')]=function(_0x33663b,_0x48fafa,_0x2d7a8c){var _0x45ba80={};var _0x1a6815={};var _0x4fb65d;var _0x2db3ba;return db['Dashboard'][_0x61a2('0x81')]({'where':{'id':_0x33663b[_0x61a2('0x5b')]['id']}})['then'](handleEntityNotFound(_0x48fafa,null))[_0x61a2('0x2b')](function(_0x518a7e){if(_0x518a7e){_0x4fb65d=_0x518a7e;_0x1a6815[_0x61a2('0x36')]=_['keys'](db[_0x61a2('0x7f')][_0x61a2('0x33')]);_0x1a6815[_0x61a2('0x37')]=_[_0x61a2('0x38')](_0x33663b[_0x61a2('0x37')]);_0x1a6815[_0x61a2('0x39')]=_['intersection'](_0x1a6815[_0x61a2('0x36')],_0x1a6815[_0x61a2('0x37')]);_0x45ba80[_0x61a2('0x3b')]=_['intersection'](_0x1a6815['model'],qs[_0x61a2('0x3c')](_0x33663b[_0x61a2('0x37')][_0x61a2('0x3c')]));_0x45ba80[_0x61a2('0x3b')]=_0x45ba80['attributes'][_0x61a2('0x3d')]?_0x45ba80[_0x61a2('0x3b')]:_0x1a6815[_0x61a2('0x36')];_0x45ba80[_0x61a2('0x3e')]=qs[_0x61a2('0x3f')](_0x33663b[_0x61a2('0x37')][_0x61a2('0x3f')]);_0x45ba80[_0x61a2('0x40')]=qs[_0x61a2('0x39')](_[_0x61a2('0x41')](_0x33663b[_0x61a2('0x37')],_0x1a6815[_0x61a2('0x39')]));if(_0x33663b[_0x61a2('0x37')]['filter']){_0x45ba80[_0x61a2('0x40')]=_[_0x61a2('0x42')](_0x45ba80[_0x61a2('0x40')],{'$or':_[_0x61a2('0x43')](_0x45ba80[_0x61a2('0x3b')],function(_0x4d9071){var _0x59cf08={};_0x59cf08[_0x4d9071]={'$like':'%'+_0x33663b[_0x61a2('0x37')][_0x61a2('0x45')]+'%'};return _0x59cf08;})});}_0x45ba80=_[_0x61a2('0x42')]({},_0x45ba80,_0x33663b[_0x61a2('0x4c')]);return _0x4fb65d['getItems'](_0x45ba80);}})[_0x61a2('0x2b')](function(_0x5419de){if(_0x5419de){_0x2db3ba=_0x5419de[_0x61a2('0x3d')];if(!_0x33663b[_0x61a2('0x37')][_0x61a2('0x82')](_0x61a2('0x83'))){_0x45ba80[_0x61a2('0x25')]=qs[_0x61a2('0x25')](_0x33663b[_0x61a2('0x37')]['limit']);_0x45ba80[_0x61a2('0x22')]=qs[_0x61a2('0x22')](_0x33663b['query']['offset']);}return _0x4fb65d[_0x61a2('0x80')](_0x45ba80);}})['then'](function(_0xbcefa){if(_0xbcefa){return _0xbcefa?{'count':_0x2db3ba,'rows':_0xbcefa}:null;}})['then'](respondWithResult(_0x48fafa,null))[_0x61a2('0x49')](handleError(_0x48fafa,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 082be14..52d418c 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 _0xe5e9=['Dashboard','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3a0e99,_0x2008cf){var _0x1f3fb6=function(_0x4a9063){while(--_0x4a9063){_0x3a0e99['push'](_0x3a0e99['shift']());}};_0x1f3fb6(++_0x2008cf);}(_0xe5e9,0xda));var _0x9e5e=function(_0x209cc0,_0x59bb37){_0x209cc0=_0x209cc0-0x0;var _0x3c5029=_0xe5e9[_0x209cc0];return _0x3c5029;};'use strict';var EventEmitter=require(_0x9e5e('0x0'));var Dashboard=require(_0x9e5e('0x1'))['db'][_0x9e5e('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x9e5e('0x3')](0x0);var events={'afterCreate':_0x9e5e('0x4'),'afterUpdate':_0x9e5e('0x5'),'afterDestroy':_0x9e5e('0x6')};function emitEvent(_0x363ecd){return function(_0x5d25da,_0xf2c296,_0xc7e3ce){DashboardEvents[_0x9e5e('0x7')](_0x363ecd+':'+_0x5d25da['id'],_0x5d25da);DashboardEvents['emit'](_0x363ecd,_0x5d25da);_0xc7e3ce(null);};}for(var e in events){if(events[_0x9e5e('0x8')](e)){var event=events[e];Dashboard[_0x9e5e('0x9')](e,emitEvent(event));}}module[_0x9e5e('0xa')]=DashboardEvents; \ No newline at end of file +var _0xc3ea=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Dashboard'];(function(_0x479509,_0x1daf8a){var _0x382da8=function(_0x39d77c){while(--_0x39d77c){_0x479509['push'](_0x479509['shift']());}};_0x382da8(++_0x1daf8a);}(_0xc3ea,0x165));var _0xac3e=function(_0x5a7618,_0x3f44c2){_0x5a7618=_0x5a7618-0x0;var _0x12dc65=_0xc3ea[_0x5a7618];return _0x12dc65;};'use strict';var EventEmitter=require(_0xac3e('0x0'));var Dashboard=require(_0xac3e('0x1'))['db'][_0xac3e('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xac3e('0x3')](0x0);var events={'afterCreate':_0xac3e('0x4'),'afterUpdate':_0xac3e('0x5'),'afterDestroy':'remove'};function emitEvent(_0x49d3b4){return function(_0x2d9362,_0x443304,_0x468ff7){DashboardEvents[_0xac3e('0x6')](_0x49d3b4+':'+_0x2d9362['id'],_0x2d9362);DashboardEvents[_0xac3e('0x6')](_0x49d3b4,_0x2d9362);_0x468ff7(null);};}for(var e in events){if(events[_0xac3e('0x7')](e)){var event=events[e];Dashboard[_0xac3e('0x8')](e,emitEvent(event));}}module[_0xac3e('0x9')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 6d3faa5..15bc9c0 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 _0xa515=['lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','exports','Dashboard','dashboards'];(function(_0x3a200d,_0x240e25){var _0x52d683=function(_0x5333cb){while(--_0x5333cb){_0x3a200d['push'](_0x3a200d['shift']());}};_0x52d683(++_0x240e25);}(_0xa515,0x108));var _0x5a51=function(_0x5df5f4,_0x4b4aa1){_0x5df5f4=_0x5df5f4-0x0;var _0x1b28c8=_0xa515[_0x5df5f4];return _0x1b28c8;};'use strict';var _=require(_0x5a51('0x0'));var util=require(_0x5a51('0x1'));var logger=require(_0x5a51('0x2'))(_0x5a51('0x3'));var moment=require('moment');var BPromise=require(_0x5a51('0x4'));var rp=require(_0x5a51('0x5'));var fs=require('fs');var path=require(_0x5a51('0x6'));var rimraf=require('rimraf');var config=require(_0x5a51('0x7'));var attributes=require('./dashboard.attributes');module[_0x5a51('0x8')]=function(_0x4a839c,_0x152850){return _0x4a839c['define'](_0x5a51('0x9'),attributes,{'tableName':_0x5a51('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x219f=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./dashboard.attributes','define','Dashboard','dashboards'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x219f,0xc3));var _0xf219=function(_0x46d431,_0x5e992e){_0x46d431=_0x46d431-0x0;var _0x44be7d=_0x219f[_0x46d431];return _0x44be7d;};'use strict';var _=require(_0xf219('0x0'));var util=require(_0xf219('0x1'));var logger=require(_0xf219('0x2'))(_0xf219('0x3'));var moment=require(_0xf219('0x4'));var BPromise=require(_0xf219('0x5'));var rp=require(_0xf219('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf219('0x7'));var config=require(_0xf219('0x8'));var attributes=require(_0xf219('0x9'));module['exports']=function(_0xd28235,_0xa111cb){return _0xd28235[_0xf219('0xa')](_0xf219('0xb'),attributes,{'tableName':_0xf219('0xc'),'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 65d9d86..d219935 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 _0x67fe=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./dashboard.socket','request','then','info','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','message','Dashboard,\x20%s,\x20%s','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x3b0cdd,_0x1fd5f4){var _0x143bd1=function(_0xbcf961){while(--_0xbcf961){_0x3b0cdd['push'](_0x3b0cdd['shift']());}};_0x143bd1(++_0x1fd5f4);}(_0x67fe,0xbf));var _0xe67f=function(_0x45a150,_0x6ace92){_0x45a150=_0x45a150-0x0;var _0x1e0cb1=_0x67fe[_0x45a150];return _0x1e0cb1;};'use strict';var _=require(_0xe67f('0x0'));var util=require(_0xe67f('0x1'));var moment=require(_0xe67f('0x2'));var BPromise=require('bluebird');var rs=require(_0xe67f('0x3'));var fs=require('fs');var Redis=require(_0xe67f('0x4'));var db=require(_0xe67f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe67f('0x6'))(_0xe67f('0x7'));var config=require(_0xe67f('0x8'));var jayson=require(_0xe67f('0x9'));var client=jayson[_0xe67f('0xa')][_0xe67f('0xb')]({'port':0x232a});config['redis']=_[_0xe67f('0xc')](config['redis'],{'host':_0xe67f('0xd'),'port':0x18eb});var socket=require(_0xe67f('0xe'))(new Redis(config[_0xe67f('0xf')]));require(_0xe67f('0x10'))['register'](socket);function respondWithRpcPromise(_0xc2b4db,_0x433a3f,_0x3afb26){return new BPromise(function(_0xfd7c64,_0xc5fe30){return client[_0xe67f('0x11')](_0xc2b4db,_0x3afb26)[_0xe67f('0x12')](function(_0x4ad4f8){logger[_0xe67f('0x13')]('Dashboard,\x20%s,\x20%s',_0x433a3f,'request\x20sent');logger[_0xe67f('0x14')](_0xe67f('0x15'),_0x433a3f,'request\x20sent',JSON[_0xe67f('0x16')](_0x4ad4f8));if(_0x4ad4f8[_0xe67f('0x17')]){if(_0x4ad4f8['error']['code']===0x1f4){logger[_0xe67f('0x17')]('Dashboard,\x20%s,\x20%s',_0x433a3f,_0x4ad4f8[_0xe67f('0x17')][_0xe67f('0x18')]);return _0xc5fe30(_0x4ad4f8[_0xe67f('0x17')][_0xe67f('0x18')]);}logger[_0xe67f('0x17')](_0xe67f('0x19'),_0x433a3f,_0x4ad4f8[_0xe67f('0x17')][_0xe67f('0x18')]);return _0xfd7c64(_0x4ad4f8[_0xe67f('0x17')][_0xe67f('0x18')]);}else{logger[_0xe67f('0x13')](_0xe67f('0x19'),_0x433a3f,'request\x20sent');_0xfd7c64(_0x4ad4f8[_0xe67f('0x1a')][_0xe67f('0x18')]);}})[_0xe67f('0x1b')](function(_0x10a9af){logger[_0xe67f('0x17')](_0xe67f('0x19'),_0x433a3f,_0x10a9af);_0xc5fe30(_0x10a9af);});});} \ No newline at end of file +var _0xe3ff=['http','redis','localhost','socket.io-emitter','request','info','Dashboard,\x20%s,\x20%s','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x3ed288,_0x5020d3){var _0x5f02ab=function(_0xdc46e7){while(--_0xdc46e7){_0x3ed288['push'](_0x3ed288['shift']());}};_0x5f02ab(++_0x5020d3);}(_0xe3ff,0x1d0));var _0xfe3f=function(_0x37656e,_0x56865e){_0x37656e=_0x37656e-0x0;var _0x42b584=_0xe3ff[_0x37656e];return _0x42b584;};'use strict';var _=require(_0xfe3f('0x0'));var util=require(_0xfe3f('0x1'));var moment=require(_0xfe3f('0x2'));var BPromise=require(_0xfe3f('0x3'));var rs=require(_0xfe3f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfe3f('0x5'))['db'];var utils=require(_0xfe3f('0x6'));var logger=require(_0xfe3f('0x7'))('rpc');var config=require(_0xfe3f('0x8'));var jayson=require(_0xfe3f('0x9'));var client=jayson[_0xfe3f('0xa')][_0xfe3f('0xb')]({'port':0x232a});config[_0xfe3f('0xc')]=_['defaults'](config['redis'],{'host':_0xfe3f('0xd'),'port':0x18eb});var socket=require(_0xfe3f('0xe'))(new Redis(config[_0xfe3f('0xc')]));require('./dashboard.socket')['register'](socket);function respondWithRpcPromise(_0x3d9703,_0xf97300,_0x3245d0){return new BPromise(function(_0x37b551,_0x2bd3ef){return client[_0xfe3f('0xf')](_0x3d9703,_0x3245d0)['then'](function(_0x289b04){logger[_0xfe3f('0x10')](_0xfe3f('0x11'),_0xf97300,_0xfe3f('0x12'));logger['debug'](_0xfe3f('0x13'),_0xf97300,_0xfe3f('0x12'),JSON['stringify'](_0x289b04));if(_0x289b04['error']){if(_0x289b04[_0xfe3f('0x14')][_0xfe3f('0x15')]===0x1f4){logger[_0xfe3f('0x14')](_0xfe3f('0x11'),_0xf97300,_0x289b04[_0xfe3f('0x14')][_0xfe3f('0x16')]);return _0x2bd3ef(_0x289b04['error'][_0xfe3f('0x16')]);}logger[_0xfe3f('0x14')](_0xfe3f('0x11'),_0xf97300,_0x289b04[_0xfe3f('0x14')]['message']);return _0x37b551(_0x289b04[_0xfe3f('0x14')]['message']);}else{logger['info'](_0xfe3f('0x11'),_0xf97300,'request\x20sent');_0x37b551(_0x289b04[_0xfe3f('0x17')][_0xfe3f('0x16')]);}})[_0xfe3f('0x18')](function(_0x20cb10){logger[_0xfe3f('0x14')](_0xfe3f('0x11'),_0xf97300,_0x20cb10);_0x2bd3ef(_0x20cb10);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 1cf5ac9..2215568 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 _0x8d85=['remove','emit','register','dashboard:'];(function(_0x2f7be9,_0x173b28){var _0x22b2ad=function(_0x2f50e4){while(--_0x2f50e4){_0x2f7be9['push'](_0x2f7be9['shift']());}};_0x22b2ad(++_0x173b28);}(_0x8d85,0xfc));var _0x58d8=function(_0x107e5f,_0x1d3168){_0x107e5f=_0x107e5f-0x0;var _0x43e0ad=_0x8d85[_0x107e5f];return _0x43e0ad;};'use strict';var DashboardEvents=require('./dashboard.events');var events=['save',_0x58d8('0x0'),'update'];function createListener(_0x24eea3,_0x10524e){return function(_0x3aaddb){_0x10524e[_0x58d8('0x1')](_0x24eea3,_0x3aaddb);};}function removeListener(_0x313b29,_0x3d4536){return function(){DashboardEvents['removeListener'](_0x313b29,_0x3d4536);};}exports[_0x58d8('0x2')]=function(_0x54ae66){for(var _0x48189e=0x0,_0x3c5d43=events['length'];_0x48189e<_0x3c5d43;_0x48189e++){var _0xa18bb9=events[_0x48189e];var _0x11301b=createListener(_0x58d8('0x3')+_0xa18bb9,_0x54ae66);DashboardEvents['on'](_0xa18bb9,_0x11301b);}}; \ No newline at end of file +var _0x8e94=['remove','update','removeListener','register','dashboard:','./dashboard.events','save'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x8e94,0x194));var _0x48e9=function(_0x166acc,_0x111e4e){_0x166acc=_0x166acc-0x0;var _0x209f4d=_0x8e94[_0x166acc];return _0x209f4d;};'use strict';var DashboardEvents=require(_0x48e9('0x0'));var events=[_0x48e9('0x1'),_0x48e9('0x2'),_0x48e9('0x3')];function createListener(_0x374826,_0x201fec){return function(_0x26baa5){_0x201fec['emit'](_0x374826,_0x26baa5);};}function removeListener(_0xeb2ba6,_0x5af372){return function(){DashboardEvents[_0x48e9('0x4')](_0xeb2ba6,_0x5af372);};}exports[_0x48e9('0x5')]=function(_0x684369){for(var _0x8b76f1=0x0,_0x4441e0=events['length'];_0x8b76f1<_0x4441e0;_0x8b76f1++){var _0x28457d=events[_0x8b76f1];var _0xcb6b15=createListener(_0x48e9('0x6')+_0x28457d,_0x684369);DashboardEvents['on'](_0x28457d,_0xcb6b15);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 4dfda10..c7e6845 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 _0xf8f1=['../../components/auth/service','../../config/environment','./dashboard.controller','isAuthenticated','get','show','/:id/items','getItems','create','post','addItem','put','/:id','update','delete','destroy','exports','util','connect-timeout','express','fs-extra'];(function(_0x343ba3,_0x39ebaa){var _0x356fc4=function(_0x2536ae){while(--_0x2536ae){_0x343ba3['push'](_0x343ba3['shift']());}};_0x356fc4(++_0x39ebaa);}(_0xf8f1,0x176));var _0x1f8f=function(_0x55ff3e,_0x41077f){_0x55ff3e=_0x55ff3e-0x0;var _0x2709eb=_0xf8f1[_0x55ff3e];return _0x2709eb;};'use strict';var multer=require('multer');var util=require(_0x1f8f('0x0'));var path=require('path');var timeout=require(_0x1f8f('0x1'));var express=require(_0x1f8f('0x2'));var router=express['Router']();var fs_extra=require(_0x1f8f('0x3'));var auth=require(_0x1f8f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1f8f('0x5'));var controller=require(_0x1f8f('0x6'));router['get']('/',auth[_0x1f8f('0x7')](),controller['index']);router[_0x1f8f('0x8')]('/:id',auth[_0x1f8f('0x7')](),controller[_0x1f8f('0x9')]);router['get'](_0x1f8f('0xa'),auth['isAuthenticated'](),controller[_0x1f8f('0xb')]);router['post']('/',auth[_0x1f8f('0x7')](),controller[_0x1f8f('0xc')]);router[_0x1f8f('0xd')]('/:id/clone',auth[_0x1f8f('0x7')](),controller['clone']);router[_0x1f8f('0xd')](_0x1f8f('0xa'),auth[_0x1f8f('0x7')](),controller[_0x1f8f('0xe')]);router[_0x1f8f('0xf')](_0x1f8f('0x10'),auth['isAuthenticated'](),controller[_0x1f8f('0x11')]);router[_0x1f8f('0x12')](_0x1f8f('0x10'),auth['isAuthenticated'](),controller[_0x1f8f('0x13')]);module[_0x1f8f('0x14')]=router; \ No newline at end of file +var _0xc142=['index','/:id','show','/:id/items','getItems','post','create','/:id/clone','addItem','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated'];(function(_0x252550,_0x1ffe4d){var _0x352629=function(_0x31548e){while(--_0x31548e){_0x252550['push'](_0x252550['shift']());}};_0x352629(++_0x1ffe4d);}(_0xc142,0x19d));var _0x2c14=function(_0x10d34b,_0x4fef76){_0x10d34b=_0x10d34b-0x0;var _0x92b0bf=_0xc142[_0x10d34b];return _0x92b0bf;};'use strict';var multer=require(_0x2c14('0x0'));var util=require(_0x2c14('0x1'));var path=require('path');var timeout=require(_0x2c14('0x2'));var express=require(_0x2c14('0x3'));var router=express[_0x2c14('0x4')]();var fs_extra=require(_0x2c14('0x5'));var auth=require(_0x2c14('0x6'));var interaction=require(_0x2c14('0x7'));var config=require(_0x2c14('0x8'));var controller=require(_0x2c14('0x9'));router[_0x2c14('0xa')]('/',auth[_0x2c14('0xb')](),controller[_0x2c14('0xc')]);router['get'](_0x2c14('0xd'),auth[_0x2c14('0xb')](),controller[_0x2c14('0xe')]);router[_0x2c14('0xa')](_0x2c14('0xf'),auth[_0x2c14('0xb')](),controller[_0x2c14('0x10')]);router[_0x2c14('0x11')]('/',auth[_0x2c14('0xb')](),controller[_0x2c14('0x12')]);router[_0x2c14('0x11')](_0x2c14('0x13'),auth['isAuthenticated'](),controller['clone']);router[_0x2c14('0x11')](_0x2c14('0xf'),auth['isAuthenticated'](),controller[_0x2c14('0x14')]);router[_0x2c14('0x15')](_0x2c14('0xd'),auth[_0x2c14('0xb')](),controller['update']);router[_0x2c14('0x16')](_0x2c14('0xd'),auth[_0x2c14('0xb')](),controller[_0x2c14('0x17')]);module[_0x2c14('0x18')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index e812cef..31ce64a 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 _0x1261=['squel','lodash','exports','STRING','TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER'];(function(_0x5eef05,_0x1be989){var _0x56d4b8=function(_0x57993d){while(--_0x57993d){_0x5eef05['push'](_0x5eef05['shift']());}};_0x56d4b8(++_0x1be989);}(_0x1261,0x144));var _0x1126=function(_0x43de22,_0x1eced6){_0x43de22=_0x43de22-0x0;var _0x4b15ee=_0x1261[_0x43de22];return _0x4b15ee;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x1126('0x0'));var _=require(_0x1126('0x1'));module[_0x1126('0x2')]={'title':{'type':Sequelize[_0x1126('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x1126('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x1126('0x4')](_0x1126('0x5')),'get':function(){try{return JSON[_0x1126('0x6')](this[_0x1126('0x7')](_0x1126('0x8')));}catch(_0x5a2189){return[];}},'set':function(_0x5c68c8){try{this[_0x1126('0x9')](_0x1126('0x8'),JSON['stringify'](_0x5c68c8));}catch(_0x17e5f0){this[_0x1126('0x9')](_0x1126('0x8'),JSON[_0x1126('0xa')]([]));}}},'sizeX':{'type':Sequelize[_0x1126('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x1126('0xb')]},'col':{'type':Sequelize[_0x1126('0xb')]},'background':{'type':Sequelize[_0x1126('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x1126('0x3')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0x1126('0xb')],'defaultValue':0xc}}; \ No newline at end of file +var _0xc6ac=['#ffffff','#2196f3','sequelize','squel','lodash','exports','STRING','TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER'];(function(_0x2540d5,_0x4b3f3a){var _0x9af246=function(_0x46482a){while(--_0x46482a){_0x2540d5['push'](_0x2540d5['shift']());}};_0x9af246(++_0x4b3f3a);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x5ca342,_0x439dd3){_0x5ca342=_0x5ca342-0x0;var _0x3ec95c=_0xc6ac[_0x5ca342];return _0x3ec95c;};'use strict';var Sequelize=require(_0xcc6a('0x0'));var squel=require(_0xcc6a('0x1'));var _=require(_0xcc6a('0x2'));module[_0xcc6a('0x3')]={'title':{'type':Sequelize[_0xcc6a('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xcc6a('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xcc6a('0x5')](_0xcc6a('0x6')),'get':function(){try{return JSON[_0xcc6a('0x7')](this[_0xcc6a('0x8')](_0xcc6a('0x9')));}catch(_0x188b05){return[];}},'set':function(_0x12330e){try{this[_0xcc6a('0xa')]('attrs',JSON[_0xcc6a('0xb')](_0x12330e));}catch(_0x11b919){this[_0xcc6a('0xa')]('attrs',JSON[_0xcc6a('0xb')]([]));}}},'sizeX':{'type':Sequelize[_0xcc6a('0xc')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xcc6a('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xcc6a('0xc')]},'col':{'type':Sequelize[_0xcc6a('0xc')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xcc6a('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xcc6a('0x4')],'allowNull':![],'defaultValue':_0xcc6a('0xe'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0xcc6a('0xc')],'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 e6a2ed7..c5c9868 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 _0xb194=['attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','stringify','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','./dashboardItem.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','show','params','model','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','type','iframe'];(function(_0x699072,_0x3aca68){var _0x44edc2=function(_0x3c1e8b){while(--_0x3c1e8b){_0x699072['push'](_0x699072['shift']());}};_0x44edc2(++_0x3aca68);}(_0xb194,0x1b2));var _0x4b19=function(_0x58e39a,_0x474e33){_0x58e39a=_0x58e39a-0x0;var _0x5233f4=_0xb194[_0x58e39a];return _0x5233f4;};'use strict';var emlformat=require(_0x4b19('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4b19('0x1'));var jsonpatch=require(_0x4b19('0x2'));var rp=require(_0x4b19('0x3'));var moment=require(_0x4b19('0x4'));var BPromise=require(_0x4b19('0x5'));var Mustache=require('mustache');var util=require(_0x4b19('0x6'));var path=require(_0x4b19('0x7'));var sox=require('sox');var csv=require(_0x4b19('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4b19('0x9'));var _=require('lodash');var squel=require(_0x4b19('0xa'));var crypto=require(_0x4b19('0xb'));var jsforce=require(_0x4b19('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4b19('0xd'));var Papa=require('papaparse');var Redis=require(_0x4b19('0xe'));var authService=require(_0x4b19('0xf'));var qs=require(_0x4b19('0x10'));var as=require(_0x4b19('0x11'));var hardwareService=require(_0x4b19('0x12'));var logger=require(_0x4b19('0x13'))(_0x4b19('0x14'));var utils=require(_0x4b19('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x4b19('0x16'));var db=require('../../mysqldb')['db'];config[_0x4b19('0x17')]=_[_0x4b19('0x18')](config['redis'],{'host':_0x4b19('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4b19('0x17')]));require(_0x4b19('0x1a'))[_0x4b19('0x1b')](socket);function respondWithStatusCode(_0x3a3af4,_0xc0a0da){_0xc0a0da=_0xc0a0da||0xcc;return function(_0x5e02bc){if(_0x5e02bc){return _0x3a3af4[_0x4b19('0x1c')](_0xc0a0da);}return _0x3a3af4[_0x4b19('0x1d')](_0xc0a0da)[_0x4b19('0x1e')]();};}function respondWithResult(_0x3a19cf,_0x18d261){_0x18d261=_0x18d261||0xc8;return function(_0x1ac29b){if(_0x1ac29b){return _0x3a19cf['status'](_0x18d261)[_0x4b19('0x1f')](_0x1ac29b);}};}function respondWithFilteredResult(_0xd3f210,_0x21e845){return function(_0xe7696a){if(_0xe7696a){var _0x2d17b5=typeof _0x21e845[_0x4b19('0x20')]===_0x4b19('0x21')&&typeof _0x21e845[_0x4b19('0x22')]==='undefined';var _0x28a433=_0xe7696a['count'];var _0x81a5f3=_0x2d17b5?0x0:_0x21e845[_0x4b19('0x20')];var _0x3f1ba5=_0x2d17b5?_0xe7696a[_0x4b19('0x23')]:_0x21e845[_0x4b19('0x20')]+_0x21e845[_0x4b19('0x22')];var _0x56b421;if(_0x3f1ba5>=_0x28a433){_0x3f1ba5=_0x28a433;_0x56b421=0xc8;}else{_0x56b421=0xce;}_0xd3f210[_0x4b19('0x1d')](_0x56b421);return _0xd3f210['set'](_0x4b19('0x24'),_0x81a5f3+'-'+_0x3f1ba5+'/'+_0x28a433)[_0x4b19('0x1f')](_0xe7696a);}return null;};}function patchUpdates(_0x234632){return function(_0x5c2fd6){try{jsonpatch[_0x4b19('0x25')](_0x5c2fd6,_0x234632,!![]);}catch(_0x52e144){return BPromise[_0x4b19('0x26')](_0x52e144);}return _0x5c2fd6[_0x4b19('0x27')]();};}function saveUpdates(_0x53f903,_0x363165){return function(_0x428e72){if(_0x428e72){return _0x428e72[_0x4b19('0x28')](_0x53f903)[_0x4b19('0x29')](function(_0x4c5f27){return _0x4c5f27;});}return null;};}function removeEntity(_0x12c4ac,_0x4ceba3){return function(_0x545991){if(_0x545991){return _0x545991[_0x4b19('0x2a')]()['then'](function(){_0x12c4ac[_0x4b19('0x1d')](0xcc)[_0x4b19('0x1e')]();});}};}function handleEntityNotFound(_0x28ae60,_0x29ea36){return function(_0x5c6741){if(!_0x5c6741){_0x28ae60[_0x4b19('0x1c')](0x194);}return _0x5c6741;};}function handleError(_0xcf1850,_0x5987d6){_0x5987d6=_0x5987d6||0x1f4;return function(_0x2e1fab){logger[_0x4b19('0x2b')](_0x2e1fab[_0x4b19('0x2c')]);if(_0x2e1fab['name']){delete _0x2e1fab['name'];}_0xcf1850[_0x4b19('0x1d')](_0x5987d6)[_0x4b19('0x2d')](_0x2e1fab);};}exports[_0x4b19('0x2e')]=function(_0x22798d,_0x1d63a3){var _0x4b4463={'raw':![],'where':{'id':_0x22798d[_0x4b19('0x2f')]['id']}},_0x15d240={};_0x15d240[_0x4b19('0x30')]=_[_0x4b19('0x31')](db[_0x4b19('0x32')][_0x4b19('0x33')]);_0x15d240[_0x4b19('0x34')]=_[_0x4b19('0x31')](_0x22798d[_0x4b19('0x34')]);_0x15d240[_0x4b19('0x35')]=_[_0x4b19('0x36')](_0x15d240[_0x4b19('0x30')],_0x15d240['query']);_0x4b4463[_0x4b19('0x37')]=_['intersection'](_0x15d240[_0x4b19('0x30')],qs[_0x4b19('0x38')](_0x22798d['query'][_0x4b19('0x38')]));_0x4b4463[_0x4b19('0x37')]=_0x4b4463[_0x4b19('0x37')][_0x4b19('0x39')]?_0x4b4463[_0x4b19('0x37')]:_0x15d240[_0x4b19('0x30')];if(_0x22798d[_0x4b19('0x34')][_0x4b19('0x3a')]){_0x4b4463[_0x4b19('0x3b')]=[{'all':!![]}];}_0x4b4463=_[_0x4b19('0x3c')]({},_0x4b4463,_0x22798d[_0x4b19('0x3d')]);return db[_0x4b19('0x32')][_0x4b19('0x3e')](_0x4b4463)['then'](handleEntityNotFound(_0x1d63a3,null))[_0x4b19('0x29')](respondWithResult(_0x1d63a3,null))['catch'](handleError(_0x1d63a3,null));};exports['destroy']=function(_0xc530e2,_0x31eabc){return db[_0x4b19('0x32')][_0x4b19('0x3e')]({'where':{'id':_0xc530e2[_0x4b19('0x2f')]['id']}})[_0x4b19('0x29')](handleEntityNotFound(_0x31eabc,null))[_0x4b19('0x29')](removeEntity(_0x31eabc,null))[_0x4b19('0x3f')](handleError(_0x31eabc,null));};function widgetAttributes(_0x418a24){try{switch(_0x418a24[_0x4b19('0x40')]){case _0x4b19('0x41'):return[{'name':'attrUrl','value':_0x418a24[_0x4b19('0x42')]||(_0x418a24[_0x4b19('0x43')]&&_0x418a24['attrs'][0x0]?_0x418a24['attrs'][0x0][_0x4b19('0x44')]:undefined)||_0x4b19('0x45')}];case _0x4b19('0x46'):return[{'name':_0x4b19('0x47'),'value':_0x418a24[_0x4b19('0x47')]||(_0x418a24['attrs']&&_0x418a24['attrs'][0x0]?_0x418a24[_0x4b19('0x43')][0x0][_0x4b19('0x44')]:undefined)||''}];case _0x4b19('0x48'):return[{'name':_0x4b19('0x49'),'value':_0x418a24[_0x4b19('0x49')]||(_0x418a24[_0x4b19('0x43')]&&_0x418a24[_0x4b19('0x43')][0x0]?_0x418a24[_0x4b19('0x43')][0x0][_0x4b19('0x44')]:undefined)||_0x4b19('0x4a')},{'name':_0x4b19('0x4b'),'value':_0x418a24[_0x4b19('0x4b')]||(_0x418a24[_0x4b19('0x43')]&&_0x418a24['attrs'][0x1]?_0x418a24[_0x4b19('0x43')][0x1][_0x4b19('0x44')]:undefined)||_0x4b19('0x4c')},{'name':'attrFontSize','value':_0x418a24[_0x4b19('0x4d')]||(_0x418a24[_0x4b19('0x43')]&&_0x418a24[_0x4b19('0x43')][0x2]?_0x418a24[_0x4b19('0x43')][0x2][_0x4b19('0x44')]:undefined)||0xc}];case'counter':return[{'name':_0x4b19('0x4e'),'value':_0x418a24['attrMetric']||(_0x418a24[_0x4b19('0x43')]&&_0x418a24[_0x4b19('0x43')][0x0]?_0x418a24[_0x4b19('0x43')][0x0]['value']:undefined)||_0x4b19('0x4f')},{'name':_0x4b19('0x50'),'value':_0x418a24[_0x4b19('0x50')]||(_0x418a24[_0x4b19('0x43')]&&_0x418a24['attrs'][0x1]?_0x418a24['attrs'][0x1]['value']:undefined)||[]},{'name':_0x4b19('0x4d'),'value':_0x418a24[_0x4b19('0x4d')]||(_0x418a24[_0x4b19('0x43')]&&_0x418a24['attrs'][0x2]?_0x418a24[_0x4b19('0x43')][0x2]['value']:undefined)||0x14},{'name':_0x4b19('0x51'),'value':_0x418a24[_0x4b19('0x51')]||(_0x418a24[_0x4b19('0x43')]&&_0x418a24[_0x4b19('0x43')][0x3]?_0x418a24[_0x4b19('0x43')][0x3][_0x4b19('0x44')]:undefined)||'voice'},{'name':_0x4b19('0x52'),'value':_0x418a24[_0x4b19('0x52')]||(_0x418a24[_0x4b19('0x43')]&&_0x418a24[_0x4b19('0x43')][0x4]?_0x418a24[_0x4b19('0x43')][0x4]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x418a24[_0x4b19('0x53')]||(_0x418a24[_0x4b19('0x43')]&&_0x418a24[_0x4b19('0x43')][0x5]?_0x418a24[_0x4b19('0x43')][0x5]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x418a24[_0x4b19('0x54')]||(_0x418a24[_0x4b19('0x43')]&&_0x418a24['attrs'][0x6]?_0x418a24['attrs'][0x6][_0x4b19('0x44')]:undefined)||''},{'name':_0x4b19('0x55'),'value':_0x418a24[_0x4b19('0x55')]||(_0x418a24[_0x4b19('0x43')]&&_0x418a24[_0x4b19('0x43')][0x7]?_0x418a24['attrs'][0x7][_0x4b19('0x44')]:undefined)||''},{'name':_0x4b19('0x56'),'value':_0x418a24['attrWhatsappAccounts']||(_0x418a24[_0x4b19('0x43')]&&_0x418a24[_0x4b19('0x43')][0x8]?_0x418a24['attrs'][0x8][_0x4b19('0x44')]:undefined)||''},{'name':_0x4b19('0x57'),'value':_0x418a24[_0x4b19('0x57')]||(_0x418a24[_0x4b19('0x43')]&&_0x418a24[_0x4b19('0x43')][0x9]?_0x418a24[_0x4b19('0x43')][0x9][_0x4b19('0x44')]:undefined)||''}];case _0x4b19('0x58'):case _0x4b19('0x59'):return[{'name':_0x4b19('0x5a'),'value':_0x418a24[_0x4b19('0x5a')]||(_0x418a24[_0x4b19('0x43')]&&_0x418a24['attrs'][0x0]?_0x418a24[_0x4b19('0x43')][0x0][_0x4b19('0x44')]:undefined)||_0x4b19('0x4f')},{'name':_0x4b19('0x5b'),'value':_0x418a24[_0x4b19('0x5b')]||(_0x418a24[_0x4b19('0x43')]&&_0x418a24['attrs'][0x1]?_0x418a24[_0x4b19('0x43')][0x1]['value']:undefined)||null},{'name':_0x4b19('0x5c'),'value':_0x418a24[_0x4b19('0x5c')]||(_0x418a24[_0x4b19('0x43')]&&_0x418a24['attrs'][0x2]?_0x418a24[_0x4b19('0x43')][0x2][_0x4b19('0x44')]:undefined)||null},{'name':_0x4b19('0x50'),'value':_0x418a24['attrVoiceQueues']||(_0x418a24['attrs']&&_0x418a24[_0x4b19('0x43')][0x3]?_0x418a24[_0x4b19('0x43')][0x3][_0x4b19('0x44')]:undefined)||[]},{'name':_0x4b19('0x51'),'value':_0x418a24['attrChannel']||(_0x418a24[_0x4b19('0x43')]&&_0x418a24[_0x4b19('0x43')][0x4]?_0x418a24['attrs'][0x4][_0x4b19('0x44')]:undefined)||'voice'},{'name':_0x4b19('0x52'),'value':_0x418a24[_0x4b19('0x52')]||(_0x418a24[_0x4b19('0x43')]&&_0x418a24[_0x4b19('0x43')][0x5]?_0x418a24['attrs'][0x5][_0x4b19('0x44')]:undefined)||''},{'name':_0x4b19('0x53'),'value':_0x418a24[_0x4b19('0x53')]||(_0x418a24[_0x4b19('0x43')]&&_0x418a24[_0x4b19('0x43')][0x6]?_0x418a24['attrs'][0x6][_0x4b19('0x44')]:undefined)||''},{'name':_0x4b19('0x54'),'value':_0x418a24[_0x4b19('0x54')]||(_0x418a24[_0x4b19('0x43')]&&_0x418a24[_0x4b19('0x43')][0x7]?_0x418a24[_0x4b19('0x43')][0x7]['value']:undefined)||''},{'name':_0x4b19('0x55'),'value':_0x418a24[_0x4b19('0x55')]||(_0x418a24[_0x4b19('0x43')]&&_0x418a24['attrs'][0x8]?_0x418a24['attrs'][0x8]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x418a24['attrWhatsappAccounts']||(_0x418a24[_0x4b19('0x43')]&&_0x418a24[_0x4b19('0x43')][0x9]?_0x418a24['attrs'][0x9]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x418a24[_0x4b19('0x57')]||(_0x418a24[_0x4b19('0x43')]&&_0x418a24[_0x4b19('0x43')][0xa]?_0x418a24['attrs'][0xa][_0x4b19('0x44')]:undefined)||''}];case _0x4b19('0x5d'):return[{'name':_0x4b19('0x5e'),'type':_0x418a24[_0x4b19('0x5f')]||(_0x418a24[_0x4b19('0x43')]&&_0x418a24['attrs'][0x0]?_0x418a24['attrs'][0x0][_0x4b19('0x40')]:undefined)||null,'value':_0x418a24[_0x4b19('0x5e')]||(_0x418a24[_0x4b19('0x43')]&&_0x418a24['attrs'][0x0]?_0x418a24[_0x4b19('0x43')][0x0]['value']:undefined)||null},{'name':_0x4b19('0x60'),'value':_0x418a24[_0x4b19('0x60')]||(_0x418a24[_0x4b19('0x43')]&&_0x418a24[_0x4b19('0x43')][0x1]?_0x418a24[_0x4b19('0x43')][0x1][_0x4b19('0x44')]:undefined)||0x0}];default:return[];}}catch(_0x5b6503){logger[_0x4b19('0x2b')]('widgetAttributes:\x20%s',JSON[_0x4b19('0x61')](_0x5b6503));return[];}}exports[_0x4b19('0x62')]=function(_0x456ad0,_0x53622c){if(_0x456ad0[_0x4b19('0x63')]){_0x456ad0['body'][_0x4b19('0x43')]=widgetAttributes(_0x456ad0[_0x4b19('0x63')]);}return db[_0x4b19('0x32')][_0x4b19('0x62')](_0x456ad0[_0x4b19('0x63')],{})[_0x4b19('0x29')](respondWithResult(_0x53622c,0xc9))['catch'](handleError(_0x53622c,null));};exports[_0x4b19('0x28')]=function(_0x2a3599,_0x483b57){if(_0x2a3599['body']['id']){delete _0x2a3599[_0x4b19('0x63')]['id'];}_0x2a3599['body'][_0x4b19('0x43')]=widgetAttributes(_0x2a3599[_0x4b19('0x63')]);return db[_0x4b19('0x32')][_0x4b19('0x3e')]({'where':{'id':_0x2a3599[_0x4b19('0x2f')]['id']}})[_0x4b19('0x29')](handleEntityNotFound(_0x483b57,null))[_0x4b19('0x29')](saveUpdates(_0x2a3599['body'],null))[_0x4b19('0x29')](respondWithResult(_0x483b57,null))[_0x4b19('0x3f')](handleError(_0x483b57,null));}; \ No newline at end of file +var _0xd9fb=['attrRefresh','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','defaults','redis','localhost','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','show','params','model','rawAttributes','query','keys','filters','intersection','attributes','fields','length','includeAll','include','options','DashboardItem','find','catch','type','iframe','attrUrl','attrs','https://','custom','attrPath','value','clock','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','reportType','attrReport'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd9fb,0x189));var _0xbd9f=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xd9fb[_0x2a6809];return _0x11c371;};'use strict';var emlformat=require(_0xbd9f('0x0'));var rimraf=require(_0xbd9f('0x1'));var zipdir=require(_0xbd9f('0x2'));var jsonpatch=require(_0xbd9f('0x3'));var rp=require(_0xbd9f('0x4'));var moment=require(_0xbd9f('0x5'));var BPromise=require(_0xbd9f('0x6'));var Mustache=require('mustache');var util=require(_0xbd9f('0x7'));var path=require(_0xbd9f('0x8'));var sox=require('sox');var csv=require(_0xbd9f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbd9f('0xa'));var _=require(_0xbd9f('0xb'));var squel=require('squel');var crypto=require(_0xbd9f('0xc'));var jsforce=require(_0xbd9f('0xd'));var deskjs=require(_0xbd9f('0xe'));var toCsv=require(_0xbd9f('0x9'));var querystring=require('querystring');var Papa=require(_0xbd9f('0xf'));var Redis=require(_0xbd9f('0x10'));var authService=require(_0xbd9f('0x11'));var qs=require(_0xbd9f('0x12'));var as=require(_0xbd9f('0x13'));var hardwareService=require(_0xbd9f('0x14'));var logger=require(_0xbd9f('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xbd9f('0x16'))['db'];config['redis']=_[_0xbd9f('0x17')](config[_0xbd9f('0x18')],{'host':_0xbd9f('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbd9f('0x18')]));require('./dashboardItem.socket')[_0xbd9f('0x1a')](socket);function respondWithStatusCode(_0x699e8f,_0x91c2bc){_0x91c2bc=_0x91c2bc||0xcc;return function(_0x1c6ade){if(_0x1c6ade){return _0x699e8f['sendStatus'](_0x91c2bc);}return _0x699e8f[_0xbd9f('0x1b')](_0x91c2bc)[_0xbd9f('0x1c')]();};}function respondWithResult(_0x104cfd,_0x1deb0f){_0x1deb0f=_0x1deb0f||0xc8;return function(_0x24dde0){if(_0x24dde0){return _0x104cfd[_0xbd9f('0x1b')](_0x1deb0f)[_0xbd9f('0x1d')](_0x24dde0);}};}function respondWithFilteredResult(_0x4f6181,_0x49a818){return function(_0x35be6d){if(_0x35be6d){var _0x5ebaf6=typeof _0x49a818[_0xbd9f('0x1e')]===_0xbd9f('0x1f')&&typeof _0x49a818[_0xbd9f('0x20')]===_0xbd9f('0x1f');var _0x2c276b=_0x35be6d[_0xbd9f('0x21')];var _0x3f6c17=_0x5ebaf6?0x0:_0x49a818[_0xbd9f('0x1e')];var _0x5af956=_0x5ebaf6?_0x35be6d[_0xbd9f('0x21')]:_0x49a818[_0xbd9f('0x1e')]+_0x49a818[_0xbd9f('0x20')];var _0x144051;if(_0x5af956>=_0x2c276b){_0x5af956=_0x2c276b;_0x144051=0xc8;}else{_0x144051=0xce;}_0x4f6181[_0xbd9f('0x1b')](_0x144051);return _0x4f6181[_0xbd9f('0x22')](_0xbd9f('0x23'),_0x3f6c17+'-'+_0x5af956+'/'+_0x2c276b)[_0xbd9f('0x1d')](_0x35be6d);}return null;};}function patchUpdates(_0x3d0d68){return function(_0xa2315d){try{jsonpatch[_0xbd9f('0x24')](_0xa2315d,_0x3d0d68,!![]);}catch(_0x4e929d){return BPromise[_0xbd9f('0x25')](_0x4e929d);}return _0xa2315d[_0xbd9f('0x26')]();};}function saveUpdates(_0x256aec,_0x18b387){return function(_0x5d74e0){if(_0x5d74e0){return _0x5d74e0[_0xbd9f('0x27')](_0x256aec)[_0xbd9f('0x28')](function(_0x278a10){return _0x278a10;});}return null;};}function removeEntity(_0x36f503,_0x46fcc0){return function(_0x35e3f2){if(_0x35e3f2){return _0x35e3f2[_0xbd9f('0x29')]()['then'](function(){_0x36f503[_0xbd9f('0x1b')](0xcc)[_0xbd9f('0x1c')]();});}};}function handleEntityNotFound(_0xa46ce3,_0x892315){return function(_0x25a5c8){if(!_0x25a5c8){_0xa46ce3['sendStatus'](0x194);}return _0x25a5c8;};}function handleError(_0x5b9981,_0x42a6b2){_0x42a6b2=_0x42a6b2||0x1f4;return function(_0x2b26bf){logger[_0xbd9f('0x2a')](_0x2b26bf['stack']);if(_0x2b26bf[_0xbd9f('0x2b')]){delete _0x2b26bf[_0xbd9f('0x2b')];}_0x5b9981[_0xbd9f('0x1b')](_0x42a6b2)['send'](_0x2b26bf);};}exports[_0xbd9f('0x2c')]=function(_0x270f10,_0xcbfaa2){var _0x25c219={'raw':![],'where':{'id':_0x270f10[_0xbd9f('0x2d')]['id']}},_0x2a733e={};_0x2a733e[_0xbd9f('0x2e')]=_['keys'](db['DashboardItem'][_0xbd9f('0x2f')]);_0x2a733e[_0xbd9f('0x30')]=_[_0xbd9f('0x31')](_0x270f10[_0xbd9f('0x30')]);_0x2a733e[_0xbd9f('0x32')]=_[_0xbd9f('0x33')](_0x2a733e[_0xbd9f('0x2e')],_0x2a733e[_0xbd9f('0x30')]);_0x25c219[_0xbd9f('0x34')]=_['intersection'](_0x2a733e['model'],qs[_0xbd9f('0x35')](_0x270f10['query']['fields']));_0x25c219[_0xbd9f('0x34')]=_0x25c219[_0xbd9f('0x34')][_0xbd9f('0x36')]?_0x25c219[_0xbd9f('0x34')]:_0x2a733e[_0xbd9f('0x2e')];if(_0x270f10[_0xbd9f('0x30')][_0xbd9f('0x37')]){_0x25c219[_0xbd9f('0x38')]=[{'all':!![]}];}_0x25c219=_['merge']({},_0x25c219,_0x270f10[_0xbd9f('0x39')]);return db[_0xbd9f('0x3a')][_0xbd9f('0x3b')](_0x25c219)['then'](handleEntityNotFound(_0xcbfaa2,null))['then'](respondWithResult(_0xcbfaa2,null))[_0xbd9f('0x3c')](handleError(_0xcbfaa2,null));};exports[_0xbd9f('0x29')]=function(_0x505d00,_0x149777){return db['DashboardItem'][_0xbd9f('0x3b')]({'where':{'id':_0x505d00[_0xbd9f('0x2d')]['id']}})[_0xbd9f('0x28')](handleEntityNotFound(_0x149777,null))[_0xbd9f('0x28')](removeEntity(_0x149777,null))[_0xbd9f('0x3c')](handleError(_0x149777,null));};function widgetAttributes(_0x5f0cb2){try{switch(_0x5f0cb2[_0xbd9f('0x3d')]){case _0xbd9f('0x3e'):return[{'name':'attrUrl','value':_0x5f0cb2[_0xbd9f('0x3f')]||(_0x5f0cb2[_0xbd9f('0x40')]&&_0x5f0cb2[_0xbd9f('0x40')][0x0]?_0x5f0cb2[_0xbd9f('0x40')][0x0]['value']:undefined)||_0xbd9f('0x41')}];case _0xbd9f('0x42'):return[{'name':_0xbd9f('0x43'),'value':_0x5f0cb2[_0xbd9f('0x43')]||(_0x5f0cb2['attrs']&&_0x5f0cb2[_0xbd9f('0x40')][0x0]?_0x5f0cb2[_0xbd9f('0x40')][0x0][_0xbd9f('0x44')]:undefined)||''}];case _0xbd9f('0x45'):return[{'name':'attrHourFormat','value':_0x5f0cb2['attrHourFormat']||(_0x5f0cb2[_0xbd9f('0x40')]&&_0x5f0cb2[_0xbd9f('0x40')][0x0]?_0x5f0cb2['attrs'][0x0][_0xbd9f('0x44')]:undefined)||'HH:mm:ss'},{'name':_0xbd9f('0x46'),'value':_0x5f0cb2['attrTimezone']||(_0x5f0cb2[_0xbd9f('0x40')]&&_0x5f0cb2[_0xbd9f('0x40')][0x1]?_0x5f0cb2['attrs'][0x1]['value']:undefined)||'0.00'},{'name':_0xbd9f('0x47'),'value':_0x5f0cb2[_0xbd9f('0x47')]||(_0x5f0cb2['attrs']&&_0x5f0cb2['attrs'][0x2]?_0x5f0cb2[_0xbd9f('0x40')][0x2][_0xbd9f('0x44')]:undefined)||0xc}];case _0xbd9f('0x48'):return[{'name':_0xbd9f('0x49'),'value':_0x5f0cb2['attrMetric']||(_0x5f0cb2[_0xbd9f('0x40')]&&_0x5f0cb2[_0xbd9f('0x40')][0x0]?_0x5f0cb2[_0xbd9f('0x40')][0x0][_0xbd9f('0x44')]:undefined)||_0xbd9f('0x4a')},{'name':'attrVoiceQueues','value':_0x5f0cb2[_0xbd9f('0x4b')]||(_0x5f0cb2[_0xbd9f('0x40')]&&_0x5f0cb2[_0xbd9f('0x40')][0x1]?_0x5f0cb2[_0xbd9f('0x40')][0x1]['value']:undefined)||[]},{'name':_0xbd9f('0x47'),'value':_0x5f0cb2[_0xbd9f('0x47')]||(_0x5f0cb2[_0xbd9f('0x40')]&&_0x5f0cb2['attrs'][0x2]?_0x5f0cb2['attrs'][0x2][_0xbd9f('0x44')]:undefined)||0x14},{'name':_0xbd9f('0x4c'),'value':_0x5f0cb2[_0xbd9f('0x4c')]||(_0x5f0cb2[_0xbd9f('0x40')]&&_0x5f0cb2['attrs'][0x3]?_0x5f0cb2[_0xbd9f('0x40')][0x3][_0xbd9f('0x44')]:undefined)||_0xbd9f('0x4d')},{'name':_0xbd9f('0x4e'),'value':_0x5f0cb2['attrEmailAccounts']||(_0x5f0cb2['attrs']&&_0x5f0cb2[_0xbd9f('0x40')][0x4]?_0x5f0cb2[_0xbd9f('0x40')][0x4][_0xbd9f('0x44')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x5f0cb2[_0xbd9f('0x4f')]||(_0x5f0cb2[_0xbd9f('0x40')]&&_0x5f0cb2[_0xbd9f('0x40')][0x5]?_0x5f0cb2[_0xbd9f('0x40')][0x5][_0xbd9f('0x44')]:undefined)||''},{'name':_0xbd9f('0x50'),'value':_0x5f0cb2[_0xbd9f('0x50')]||(_0x5f0cb2[_0xbd9f('0x40')]&&_0x5f0cb2[_0xbd9f('0x40')][0x6]?_0x5f0cb2[_0xbd9f('0x40')][0x6][_0xbd9f('0x44')]:undefined)||''},{'name':_0xbd9f('0x51'),'value':_0x5f0cb2[_0xbd9f('0x51')]||(_0x5f0cb2[_0xbd9f('0x40')]&&_0x5f0cb2[_0xbd9f('0x40')][0x7]?_0x5f0cb2['attrs'][0x7][_0xbd9f('0x44')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x5f0cb2[_0xbd9f('0x52')]||(_0x5f0cb2[_0xbd9f('0x40')]&&_0x5f0cb2['attrs'][0x8]?_0x5f0cb2['attrs'][0x8][_0xbd9f('0x44')]:undefined)||''},{'name':_0xbd9f('0x53'),'value':_0x5f0cb2[_0xbd9f('0x53')]||(_0x5f0cb2[_0xbd9f('0x40')]&&_0x5f0cb2[_0xbd9f('0x40')][0x9]?_0x5f0cb2[_0xbd9f('0x40')][0x9][_0xbd9f('0x44')]:undefined)||''}];case _0xbd9f('0x54'):case _0xbd9f('0x55'):return[{'name':_0xbd9f('0x56'),'value':_0x5f0cb2['attrSerie1']||(_0x5f0cb2[_0xbd9f('0x40')]&&_0x5f0cb2['attrs'][0x0]?_0x5f0cb2[_0xbd9f('0x40')][0x0][_0xbd9f('0x44')]:undefined)||_0xbd9f('0x4a')},{'name':_0xbd9f('0x57'),'value':_0x5f0cb2[_0xbd9f('0x57')]||(_0x5f0cb2['attrs']&&_0x5f0cb2[_0xbd9f('0x40')][0x1]?_0x5f0cb2[_0xbd9f('0x40')][0x1][_0xbd9f('0x44')]:undefined)||null},{'name':_0xbd9f('0x58'),'value':_0x5f0cb2[_0xbd9f('0x58')]||(_0x5f0cb2[_0xbd9f('0x40')]&&_0x5f0cb2[_0xbd9f('0x40')][0x2]?_0x5f0cb2[_0xbd9f('0x40')][0x2][_0xbd9f('0x44')]:undefined)||null},{'name':_0xbd9f('0x4b'),'value':_0x5f0cb2[_0xbd9f('0x4b')]||(_0x5f0cb2[_0xbd9f('0x40')]&&_0x5f0cb2[_0xbd9f('0x40')][0x3]?_0x5f0cb2[_0xbd9f('0x40')][0x3][_0xbd9f('0x44')]:undefined)||[]},{'name':_0xbd9f('0x4c'),'value':_0x5f0cb2[_0xbd9f('0x4c')]||(_0x5f0cb2[_0xbd9f('0x40')]&&_0x5f0cb2[_0xbd9f('0x40')][0x4]?_0x5f0cb2[_0xbd9f('0x40')][0x4]['value']:undefined)||'voice'},{'name':_0xbd9f('0x4e'),'value':_0x5f0cb2[_0xbd9f('0x4e')]||(_0x5f0cb2[_0xbd9f('0x40')]&&_0x5f0cb2['attrs'][0x5]?_0x5f0cb2['attrs'][0x5][_0xbd9f('0x44')]:undefined)||''},{'name':_0xbd9f('0x4f'),'value':_0x5f0cb2[_0xbd9f('0x4f')]||(_0x5f0cb2['attrs']&&_0x5f0cb2[_0xbd9f('0x40')][0x6]?_0x5f0cb2[_0xbd9f('0x40')][0x6]['value']:undefined)||''},{'name':_0xbd9f('0x50'),'value':_0x5f0cb2['attrSmsAccounts']||(_0x5f0cb2[_0xbd9f('0x40')]&&_0x5f0cb2[_0xbd9f('0x40')][0x7]?_0x5f0cb2[_0xbd9f('0x40')][0x7][_0xbd9f('0x44')]:undefined)||''},{'name':_0xbd9f('0x51'),'value':_0x5f0cb2[_0xbd9f('0x51')]||(_0x5f0cb2[_0xbd9f('0x40')]&&_0x5f0cb2[_0xbd9f('0x40')][0x8]?_0x5f0cb2[_0xbd9f('0x40')][0x8][_0xbd9f('0x44')]:undefined)||''},{'name':_0xbd9f('0x52'),'value':_0x5f0cb2[_0xbd9f('0x52')]||(_0x5f0cb2['attrs']&&_0x5f0cb2['attrs'][0x9]?_0x5f0cb2['attrs'][0x9][_0xbd9f('0x44')]:undefined)||''},{'name':_0xbd9f('0x53'),'value':_0x5f0cb2[_0xbd9f('0x53')]||(_0x5f0cb2[_0xbd9f('0x40')]&&_0x5f0cb2[_0xbd9f('0x40')][0xa]?_0x5f0cb2[_0xbd9f('0x40')][0xa][_0xbd9f('0x44')]:undefined)||''}];case _0xbd9f('0x59'):return[{'name':'attrReport','type':_0x5f0cb2[_0xbd9f('0x5a')]||(_0x5f0cb2[_0xbd9f('0x40')]&&_0x5f0cb2['attrs'][0x0]?_0x5f0cb2[_0xbd9f('0x40')][0x0][_0xbd9f('0x3d')]:undefined)||null,'value':_0x5f0cb2[_0xbd9f('0x5b')]||(_0x5f0cb2['attrs']&&_0x5f0cb2['attrs'][0x0]?_0x5f0cb2[_0xbd9f('0x40')][0x0][_0xbd9f('0x44')]:undefined)||null},{'name':_0xbd9f('0x5c'),'value':_0x5f0cb2[_0xbd9f('0x5c')]||(_0x5f0cb2[_0xbd9f('0x40')]&&_0x5f0cb2[_0xbd9f('0x40')][0x1]?_0x5f0cb2[_0xbd9f('0x40')][0x1][_0xbd9f('0x44')]:undefined)||0x0}];default:return[];}}catch(_0x470b52){logger['error'](_0xbd9f('0x5d'),JSON[_0xbd9f('0x5e')](_0x470b52));return[];}}exports[_0xbd9f('0x5f')]=function(_0x1d6d77,_0x2832aa){if(_0x1d6d77[_0xbd9f('0x60')]){_0x1d6d77[_0xbd9f('0x60')][_0xbd9f('0x40')]=widgetAttributes(_0x1d6d77[_0xbd9f('0x60')]);}return db[_0xbd9f('0x3a')][_0xbd9f('0x5f')](_0x1d6d77['body'],{})[_0xbd9f('0x28')](respondWithResult(_0x2832aa,0xc9))[_0xbd9f('0x3c')](handleError(_0x2832aa,null));};exports[_0xbd9f('0x27')]=function(_0x44c6d6,_0x2665a7){if(_0x44c6d6[_0xbd9f('0x60')]['id']){delete _0x44c6d6[_0xbd9f('0x60')]['id'];}_0x44c6d6[_0xbd9f('0x60')][_0xbd9f('0x40')]=widgetAttributes(_0x44c6d6['body']);return db[_0xbd9f('0x3a')][_0xbd9f('0x3b')]({'where':{'id':_0x44c6d6['params']['id']}})[_0xbd9f('0x28')](handleEntityNotFound(_0x2665a7,null))['then'](saveUpdates(_0x44c6d6[_0xbd9f('0x60')],null))[_0xbd9f('0x28')](respondWithResult(_0x2665a7,null))[_0xbd9f('0x3c')](handleError(_0x2665a7,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index e55b37a..9765019 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 _0xf11e=['hasOwnProperty','hook','exports','events','DashboardItem','setMaxListeners','save','emit'];(function(_0x4cd87e,_0x206c15){var _0x1f7a44=function(_0xfc2a34){while(--_0xfc2a34){_0x4cd87e['push'](_0x4cd87e['shift']());}};_0x1f7a44(++_0x206c15);}(_0xf11e,0x11b));var _0xef11=function(_0x1e7468,_0xa89ba1){_0x1e7468=_0x1e7468-0x0;var _0x82327e=_0xf11e[_0x1e7468];return _0x82327e;};'use strict';var EventEmitter=require(_0xef11('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0xef11('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xef11('0x2')](0x0);var events={'afterCreate':_0xef11('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3368fd){return function(_0x5cea87,_0x594a7c,_0x23dbcb){DashboardItemEvents[_0xef11('0x4')](_0x3368fd+':'+_0x5cea87['id'],_0x5cea87);DashboardItemEvents[_0xef11('0x4')](_0x3368fd,_0x5cea87);_0x23dbcb(null);};}for(var e in events){if(events[_0xef11('0x5')](e)){var event=events[e];DashboardItem[_0xef11('0x6')](e,emitEvent(event));}}module[_0xef11('0x7')]=DashboardItemEvents; \ No newline at end of file +var _0x74a7=['exports','DashboardItem','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x99d14a,_0xee1775){var _0x1c016e=function(_0x1746f3){while(--_0x1746f3){_0x99d14a['push'](_0x99d14a['shift']());}};_0x1c016e(++_0xee1775);}(_0x74a7,0x91));var _0x774a=function(_0x5c492b,_0x26f02d){_0x5c492b=_0x5c492b-0x0;var _0x23d3e1=_0x74a7[_0x5c492b];return _0x23d3e1;};'use strict';var EventEmitter=require('events');var DashboardItem=require('../../mysqldb')['db'][_0x774a('0x0')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x774a('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x774a('0x2'),'afterDestroy':_0x774a('0x3')};function emitEvent(_0x17bf8f){return function(_0xdc4582,_0x53ea5f,_0x2d29c5){DashboardItemEvents[_0x774a('0x4')](_0x17bf8f+':'+_0xdc4582['id'],_0xdc4582);DashboardItemEvents[_0x774a('0x4')](_0x17bf8f,_0xdc4582);_0x2d29c5(null);};}for(var e in events){if(events[_0x774a('0x5')](e)){var event=events[e];DashboardItem[_0x774a('0x6')](e,emitEvent(event));}}module[_0x774a('0x7')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index ebd6d95..96810ab 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 _0x3d62=['DashboardItem','dashboard_items','lodash','util','moment','bluebird','request-promise','path','./dashboardItem.attributes','exports'];(function(_0x37564b,_0x5b7e5b){var _0x12a817=function(_0x4cc01c){while(--_0x4cc01c){_0x37564b['push'](_0x37564b['shift']());}};_0x12a817(++_0x5b7e5b);}(_0x3d62,0x70));var _0x23d6=function(_0x377b20,_0x2a658b){_0x377b20=_0x377b20-0x0;var _0x576278=_0x3d62[_0x377b20];return _0x576278;};'use strict';var _=require(_0x23d6('0x0'));var util=require(_0x23d6('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x23d6('0x2'));var BPromise=require(_0x23d6('0x3'));var rp=require(_0x23d6('0x4'));var fs=require('fs');var path=require(_0x23d6('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x23d6('0x6'));module[_0x23d6('0x7')]=function(_0x21e0a4,_0x3680dd){return _0x21e0a4['define'](_0x23d6('0x8'),attributes,{'tableName':_0x23d6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6ff1=['request-promise','rimraf','../../config/environment','./dashboardItem.attributes','exports','dashboard_items','lodash','util','../../config/logger','api'];(function(_0x544cc4,_0x307ff7){var _0x9afdb9=function(_0x307890){while(--_0x307890){_0x544cc4['push'](_0x544cc4['shift']());}};_0x9afdb9(++_0x307ff7);}(_0x6ff1,0x10a));var _0x16ff=function(_0x5776ea,_0x5818ed){_0x5776ea=_0x5776ea-0x0;var _0x3c6249=_0x6ff1[_0x5776ea];return _0x3c6249;};'use strict';var _=require(_0x16ff('0x0'));var util=require(_0x16ff('0x1'));var logger=require(_0x16ff('0x2'))(_0x16ff('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x16ff('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x16ff('0x5'));var config=require(_0x16ff('0x6'));var attributes=require(_0x16ff('0x7'));module[_0x16ff('0x8')]=function(_0x5325dd,_0x4f3752){return _0x5325dd['define']('DashboardItem',attributes,{'tableName':_0x16ff('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index 6e63d38..0fdf15d 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 _0xdb76=['util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','DashboardItem,\x20%s,\x20%s','message','info','result','catch','lodash'];(function(_0x51f645,_0x17197d){var _0x1affe3=function(_0x18f8d6){while(--_0x18f8d6){_0x51f645['push'](_0x51f645['shift']());}};_0x1affe3(++_0x17197d);}(_0xdb76,0xbc));var _0x6db7=function(_0x2920d3,_0x57de5c){_0x2920d3=_0x2920d3-0x0;var _0x5ae06a=_0xdb76[_0x2920d3];return _0x5ae06a;};'use strict';var _=require(_0x6db7('0x0'));var util=require(_0x6db7('0x1'));var moment=require('moment');var BPromise=require(_0x6db7('0x2'));var rs=require(_0x6db7('0x3'));var fs=require('fs');var Redis=require(_0x6db7('0x4'));var db=require(_0x6db7('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6db7('0x6'));var config=require(_0x6db7('0x7'));var jayson=require(_0x6db7('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x6db7('0x9')]=_[_0x6db7('0xa')](config[_0x6db7('0x9')],{'host':_0x6db7('0xb'),'port':0x18eb});var socket=require(_0x6db7('0xc'))(new Redis(config['redis']));require(_0x6db7('0xd'))[_0x6db7('0xe')](socket);function respondWithRpcPromise(_0x4a0dae,_0x3c02dc,_0xc7ea8a){return new BPromise(function(_0x3a34d1,_0x2b8f94){return client[_0x6db7('0xf')](_0x4a0dae,_0xc7ea8a)[_0x6db7('0x10')](function(_0x296b68){logger['info']('DashboardItem,\x20%s,\x20%s',_0x3c02dc,_0x6db7('0x11'));logger[_0x6db7('0x12')](_0x6db7('0x13'),_0x3c02dc,_0x6db7('0x11'),JSON[_0x6db7('0x14')](_0x296b68));if(_0x296b68[_0x6db7('0x15')]){if(_0x296b68['error']['code']===0x1f4){logger[_0x6db7('0x15')](_0x6db7('0x16'),_0x3c02dc,_0x296b68[_0x6db7('0x15')][_0x6db7('0x17')]);return _0x2b8f94(_0x296b68[_0x6db7('0x15')][_0x6db7('0x17')]);}logger[_0x6db7('0x15')]('DashboardItem,\x20%s,\x20%s',_0x3c02dc,_0x296b68[_0x6db7('0x15')][_0x6db7('0x17')]);return _0x3a34d1(_0x296b68[_0x6db7('0x15')]['message']);}else{logger[_0x6db7('0x18')](_0x6db7('0x16'),_0x3c02dc,_0x6db7('0x11'));_0x3a34d1(_0x296b68[_0x6db7('0x19')][_0x6db7('0x17')]);}})[_0x6db7('0x1a')](function(_0x22f0de){logger[_0x6db7('0x15')]('DashboardItem,\x20%s,\x20%s',_0x3c02dc,_0x22f0de);_0x2b8f94(_0x22f0de);});});} \ No newline at end of file +var _0x2316=['redis','socket.io-emitter','./dashboardItem.socket','register','request','then','info','request\x20sent','debug','error','code','DashboardItem,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0xe10a88,_0x369287){var _0x205a3f=function(_0x596722){while(--_0x596722){_0xe10a88['push'](_0xe10a88['shift']());}};_0x205a3f(++_0x369287);}(_0x2316,0x147));var _0x6231=function(_0xfcbcb8,_0x35bf6b){_0xfcbcb8=_0xfcbcb8-0x0;var _0x1b1f97=_0x2316[_0xfcbcb8];return _0x1b1f97;};'use strict';var _=require('lodash');var util=require(_0x6231('0x0'));var moment=require(_0x6231('0x1'));var BPromise=require(_0x6231('0x2'));var rs=require(_0x6231('0x3'));var fs=require('fs');var Redis=require(_0x6231('0x4'));var db=require(_0x6231('0x5'))['db'];var utils=require(_0x6231('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x6231('0x7'));var jayson=require(_0x6231('0x8'));var client=jayson[_0x6231('0x9')][_0x6231('0xa')]({'port':0x232a});config[_0x6231('0xb')]=_['defaults'](config[_0x6231('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x6231('0xc'))(new Redis(config[_0x6231('0xb')]));require(_0x6231('0xd'))[_0x6231('0xe')](socket);function respondWithRpcPromise(_0x4dab38,_0x54ce04,_0x27c011){return new BPromise(function(_0x4d0b6f,_0xb7fda8){return client[_0x6231('0xf')](_0x4dab38,_0x27c011)[_0x6231('0x10')](function(_0x10795f){logger[_0x6231('0x11')]('DashboardItem,\x20%s,\x20%s',_0x54ce04,_0x6231('0x12'));logger[_0x6231('0x13')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x54ce04,'request\x20sent',JSON['stringify'](_0x10795f));if(_0x10795f[_0x6231('0x14')]){if(_0x10795f[_0x6231('0x14')][_0x6231('0x15')]===0x1f4){logger[_0x6231('0x14')](_0x6231('0x16'),_0x54ce04,_0x10795f[_0x6231('0x14')]['message']);return _0xb7fda8(_0x10795f[_0x6231('0x14')][_0x6231('0x17')]);}logger[_0x6231('0x14')](_0x6231('0x16'),_0x54ce04,_0x10795f['error'][_0x6231('0x17')]);return _0x4d0b6f(_0x10795f[_0x6231('0x14')][_0x6231('0x17')]);}else{logger[_0x6231('0x11')](_0x6231('0x16'),_0x54ce04,_0x6231('0x12'));_0x4d0b6f(_0x10795f[_0x6231('0x18')][_0x6231('0x17')]);}})[_0x6231('0x19')](function(_0x3545fb){logger[_0x6231('0x14')](_0x6231('0x16'),_0x54ce04,_0x3545fb);_0xb7fda8(_0x3545fb);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 41d3a0c..c20d6bc 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 _0x6afd=['update','removeListener','register','length','remove'];(function(_0x556927,_0x34b53f){var _0x5f1235=function(_0x4f4e44){while(--_0x4f4e44){_0x556927['push'](_0x556927['shift']());}};_0x5f1235(++_0x34b53f);}(_0x6afd,0x1bc));var _0xd6af=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x6afd[_0x46aff0];return _0x9d78cf;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=['save',_0xd6af('0x0'),_0xd6af('0x1')];function createListener(_0x2abb51,_0x364704){return function(_0x5d119b){_0x364704['emit'](_0x2abb51,_0x5d119b);};}function removeListener(_0x4d4be1,_0x493f08){return function(){DashboardItemEvents[_0xd6af('0x2')](_0x4d4be1,_0x493f08);};}exports[_0xd6af('0x3')]=function(_0x561aa4){for(var _0x368cb4=0x0,_0x230752=events[_0xd6af('0x4')];_0x368cb4<_0x230752;_0x368cb4++){var _0x4c4c1c=events[_0x368cb4];var _0x4bc8b4=createListener('dashboardItem:'+_0x4c4c1c,_0x561aa4);DashboardItemEvents['on'](_0x4c4c1c,_0x4bc8b4);}}; \ No newline at end of file +var _0xd875=['dashboardItem:','./dashboardItem.events','save','update','removeListener','register','length'];(function(_0x2886bf,_0x2e3cba){var _0x4433b0=function(_0x419dbd){while(--_0x419dbd){_0x2886bf['push'](_0x2886bf['shift']());}};_0x4433b0(++_0x2e3cba);}(_0xd875,0x112));var _0x5d87=function(_0x4492af,_0x47e25d){_0x4492af=_0x4492af-0x0;var _0x216729=_0xd875[_0x4492af];return _0x216729;};'use strict';var DashboardItemEvents=require(_0x5d87('0x0'));var events=[_0x5d87('0x1'),'remove',_0x5d87('0x2')];function createListener(_0x281c37,_0x149611){return function(_0x346514){_0x149611['emit'](_0x281c37,_0x346514);};}function removeListener(_0xe00a24,_0x15ebd9){return function(){DashboardItemEvents[_0x5d87('0x3')](_0xe00a24,_0x15ebd9);};}exports[_0x5d87('0x4')]=function(_0x405b08){for(var _0x52393e=0x0,_0x5ce806=events[_0x5d87('0x5')];_0x52393e<_0x5ce806;_0x52393e++){var _0x4e3695=events[_0x52393e];var _0x5da290=createListener(_0x5d87('0x6')+_0x4e3695,_0x405b08);DashboardItemEvents['on'](_0x4e3695,_0x5da290);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 3a79629..fd2e507 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 _0x90eb=['../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','post','put','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4f8d61,_0x29eff0){var _0x3bc078=function(_0x4c7203){while(--_0x4c7203){_0x4f8d61['push'](_0x4f8d61['shift']());}};_0x3bc078(++_0x29eff0);}(_0x90eb,0x1df));var _0xb90e=function(_0x1a9921,_0x26f45c){_0x1a9921=_0x1a9921-0x0;var _0x5aa39a=_0x90eb[_0x1a9921];return _0x5aa39a;};'use strict';var multer=require('multer');var util=require(_0xb90e('0x0'));var path=require(_0xb90e('0x1'));var timeout=require(_0xb90e('0x2'));var express=require(_0xb90e('0x3'));var router=express[_0xb90e('0x4')]();var fs_extra=require(_0xb90e('0x5'));var auth=require(_0xb90e('0x6'));var interaction=require(_0xb90e('0x7'));var config=require(_0xb90e('0x8'));var controller=require(_0xb90e('0x9'));router[_0xb90e('0xa')](_0xb90e('0xb'),auth[_0xb90e('0xc')](),controller[_0xb90e('0xd')]);router[_0xb90e('0xe')]('/',auth[_0xb90e('0xc')](),controller['create']);router[_0xb90e('0xf')](_0xb90e('0xb'),auth[_0xb90e('0xc')](),controller['update']);router[_0xb90e('0x10')](_0xb90e('0xb'),auth[_0xb90e('0xc')](),controller['destroy']);module[_0xb90e('0x11')]=router; \ No newline at end of file +var _0x005d=['put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','create'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x005d,0x1cf));var _0xd005=function(_0x3119d2,_0x2b1160){_0x3119d2=_0x3119d2-0x0;var _0x535915=_0x005d[_0x3119d2];return _0x535915;};'use strict';var multer=require(_0xd005('0x0'));var util=require('util');var path=require(_0xd005('0x1'));var timeout=require(_0xd005('0x2'));var express=require(_0xd005('0x3'));var router=express[_0xd005('0x4')]();var fs_extra=require(_0xd005('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd005('0x6'));var config=require(_0xd005('0x7'));var controller=require(_0xd005('0x8'));router[_0xd005('0x9')](_0xd005('0xa'),auth[_0xd005('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xd005('0xc')]);router[_0xd005('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd005('0xe')](_0xd005('0xa'),auth[_0xd005('0xb')](),controller[_0xd005('0xf')]);module[_0xd005('0x10')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index a6ba34c..84d6f1c 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 _0xf7a7=['first','second','third','sequelize','exports','STRING','ENUM'];(function(_0x406913,_0x57bdfe){var _0x2df997=function(_0x2a4c4c){while(--_0x2a4c4c){_0x406913['push'](_0x406913['shift']());}};_0x2df997(++_0x57bdfe);}(_0xf7a7,0xd5));var _0x7f7a=function(_0x9a44b1,_0x3c4d86){_0x9a44b1=_0x9a44b1-0x0;var _0x1353f7=_0xf7a7[_0x9a44b1];return _0x1353f7;};'use strict';var Sequelize=require(_0x7f7a('0x0'));module[_0x7f7a('0x1')]={'name':{'type':Sequelize[_0x7f7a('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x7f7a('0x3')](_0x7f7a('0x4'),_0x7f7a('0x5'),_0x7f7a('0x6')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0x7f7a('0x2')]}}; \ No newline at end of file +var _0x06fa=['STRING','ENUM','third','first','sequelize'];(function(_0x4aeb6b,_0x4e082c){var _0x52ad8a=function(_0x5971ad){while(--_0x5971ad){_0x4aeb6b['push'](_0x4aeb6b['shift']());}};_0x52ad8a(++_0x4e082c);}(_0x06fa,0xc2));var _0xa06f=function(_0x46302a,_0x5075b0){_0x46302a=_0x46302a-0x0;var _0x1dbc9d=_0x06fa[_0x46302a];return _0x1dbc9d;};'use strict';var Sequelize=require(_0xa06f('0x0'));module['exports']={'name':{'type':Sequelize[_0xa06f('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0xa06f('0x2')]('first','second',_0xa06f('0x3')),'allowNull':![],'defaultValue':_0xa06f('0x4')},'description':{'type':Sequelize[_0xa06f('0x1')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index e8958fb..40b3d47 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 _0x8a62=['fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Dispositions','UserProfileResource','error','stack','name','index','map','Disposition','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','includeAll','findAll','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs'];(function(_0x4a96d2,_0x689504){var _0x38af04=function(_0x3a67cd){while(--_0x3a67cd){_0x4a96d2['push'](_0x4a96d2['shift']());}};_0x38af04(++_0x689504);}(_0x8a62,0x18f));var _0x28a6=function(_0x344030,_0x589731){_0x344030=_0x344030-0x0;var _0x4f7860=_0x8a62[_0x344030];return _0x4f7860;};'use strict';var emlformat=require(_0x28a6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x28a6('0x1'));var jsonpatch=require(_0x28a6('0x2'));var rp=require(_0x28a6('0x3'));var moment=require(_0x28a6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x28a6('0x5'));var util=require(_0x28a6('0x6'));var path=require(_0x28a6('0x7'));var sox=require(_0x28a6('0x8'));var csv=require(_0x28a6('0x9'));var ejs=require(_0x28a6('0xa'));var fs=require('fs');var fs_extra=require(_0x28a6('0xb'));var _=require(_0x28a6('0xc'));var squel=require('squel');var crypto=require(_0x28a6('0xd'));var jsforce=require(_0x28a6('0xe'));var deskjs=require(_0x28a6('0xf'));var toCsv=require('to-csv');var querystring=require(_0x28a6('0x10'));var Papa=require('papaparse');var Redis=require(_0x28a6('0x11'));var authService=require(_0x28a6('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x28a6('0x13'));var logger=require('../../config/logger')(_0x28a6('0x14'));var utils=require('../../config/utils');var config=require(_0x28a6('0x15'));var licenseUtil=require(_0x28a6('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc6e917,_0x37a50a){_0x37a50a=_0x37a50a||0xcc;return function(_0x356cbb){if(_0x356cbb){return _0xc6e917[_0x28a6('0x17')](_0x37a50a);}return _0xc6e917['status'](_0x37a50a)[_0x28a6('0x18')]();};}function respondWithResult(_0x2d40fe,_0x5f410e){_0x5f410e=_0x5f410e||0xc8;return function(_0x4e1030){if(_0x4e1030){return _0x2d40fe[_0x28a6('0x19')](_0x5f410e)[_0x28a6('0x1a')](_0x4e1030);}};}function respondWithFilteredResult(_0x9fef62,_0x21cd27){return function(_0x10965d){if(_0x10965d){var _0x568fce=typeof _0x21cd27[_0x28a6('0x1b')]===_0x28a6('0x1c')&&typeof _0x21cd27[_0x28a6('0x1d')]===_0x28a6('0x1c');var _0x4d3b15=_0x10965d['count'];var _0x5433ca=_0x568fce?0x0:_0x21cd27[_0x28a6('0x1b')];var _0xa0919f=_0x568fce?_0x10965d['count']:_0x21cd27[_0x28a6('0x1b')]+_0x21cd27[_0x28a6('0x1d')];var _0x2e1d0c;if(_0xa0919f>=_0x4d3b15){_0xa0919f=_0x4d3b15;_0x2e1d0c=0xc8;}else{_0x2e1d0c=0xce;}_0x9fef62['status'](_0x2e1d0c);return _0x9fef62[_0x28a6('0x1e')](_0x28a6('0x1f'),_0x5433ca+'-'+_0xa0919f+'/'+_0x4d3b15)[_0x28a6('0x1a')](_0x10965d);}return null;};}function patchUpdates(_0x53d2b5){return function(_0x188d8b){try{jsonpatch[_0x28a6('0x20')](_0x188d8b,_0x53d2b5,!![]);}catch(_0x1e7270){return BPromise[_0x28a6('0x21')](_0x1e7270);}return _0x188d8b[_0x28a6('0x22')]();};}function saveUpdates(_0x517d1b,_0x49651e){return function(_0xf4bf9e){if(_0xf4bf9e){return _0xf4bf9e[_0x28a6('0x23')](_0x517d1b)[_0x28a6('0x24')](function(_0x57f2a9){return _0x57f2a9;});}return null;};}function removeEntity(_0x13fbb1,_0x47d051){return function(_0x3d1050){if(_0x3d1050){return _0x3d1050[_0x28a6('0x25')]()['then'](function(){var _0x25ab96=_0x3d1050[_0x28a6('0x26')]({'plain':!![]});var _0x48f976=_0x28a6('0x27');return db[_0x28a6('0x28')][_0x28a6('0x25')]({'where':{'type':_0x48f976,'resourceId':_0x25ab96['id']}})['then'](function(){return _0x3d1050;});})[_0x28a6('0x24')](function(){_0x13fbb1[_0x28a6('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d7b2d,_0x52ba25){return function(_0x48daba){if(!_0x48daba){_0x5d7b2d[_0x28a6('0x17')](0x194);}return _0x48daba;};}function handleError(_0x2f141f,_0x1d25ed){_0x1d25ed=_0x1d25ed||0x1f4;return function(_0x4501e9){logger[_0x28a6('0x29')](_0x4501e9[_0x28a6('0x2a')]);if(_0x4501e9[_0x28a6('0x2b')]){delete _0x4501e9[_0x28a6('0x2b')];}_0x2f141f['status'](_0x1d25ed)['send'](_0x4501e9);};}exports[_0x28a6('0x2c')]=function(_0x4b2938,_0x58629d){var _0x4716a1={},_0x11c5af={},_0x301b69={'count':0x0,'rows':[]};var _0x46b70f=_[_0x28a6('0x2d')](db[_0x28a6('0x2e')][_0x28a6('0x2f')],function(_0x11f96d){return{'name':_0x11f96d['fieldName'],'type':_0x11f96d[_0x28a6('0x30')][_0x28a6('0x31')]};});_0x11c5af[_0x28a6('0x32')]=_[_0x28a6('0x2d')](_0x46b70f,_0x28a6('0x2b'));_0x11c5af[_0x28a6('0x33')]=_[_0x28a6('0x34')](_0x4b2938[_0x28a6('0x33')]);_0x11c5af[_0x28a6('0x35')]=_[_0x28a6('0x36')](_0x11c5af[_0x28a6('0x32')],_0x11c5af[_0x28a6('0x33')]);_0x4716a1[_0x28a6('0x37')]=_[_0x28a6('0x36')](_0x11c5af[_0x28a6('0x32')],qs[_0x28a6('0x38')](_0x4b2938[_0x28a6('0x33')][_0x28a6('0x38')]));_0x4716a1[_0x28a6('0x37')]=_0x4716a1[_0x28a6('0x37')][_0x28a6('0x39')]?_0x4716a1[_0x28a6('0x37')]:_0x11c5af['model'];if(!_0x4b2938['query'][_0x28a6('0x3a')](_0x28a6('0x3b'))){_0x4716a1[_0x28a6('0x1d')]=qs['limit'](_0x4b2938[_0x28a6('0x33')][_0x28a6('0x1d')]);_0x4716a1[_0x28a6('0x1b')]=qs[_0x28a6('0x1b')](_0x4b2938[_0x28a6('0x33')][_0x28a6('0x1b')]);}_0x4716a1[_0x28a6('0x3c')]=qs[_0x28a6('0x3d')](_0x4b2938[_0x28a6('0x33')]['sort']);_0x4716a1[_0x28a6('0x3e')]=qs[_0x28a6('0x35')](_[_0x28a6('0x3f')](_0x4b2938[_0x28a6('0x33')],_0x11c5af[_0x28a6('0x35')]),_0x46b70f);if(_0x4b2938['query'][_0x28a6('0x40')]){_0x4716a1[_0x28a6('0x3e')]=_[_0x28a6('0x41')](_0x4716a1['where'],{'$or':_[_0x28a6('0x2d')](_0x46b70f,function(_0x1c16e0){if(_0x1c16e0[_0x28a6('0x30')]!=='VIRTUAL'){var _0x3b5876={};_0x3b5876[_0x1c16e0['name']]={'$like':'%'+_0x4b2938[_0x28a6('0x33')][_0x28a6('0x40')]+'%'};return _0x3b5876;}})});}_0x4716a1=_[_0x28a6('0x41')]({},_0x4716a1,_0x4b2938[_0x28a6('0x42')]);var _0x326785={'where':_0x4716a1[_0x28a6('0x3e')]};return db[_0x28a6('0x2e')]['count'](_0x326785)[_0x28a6('0x24')](function(_0x2f940a){_0x301b69[_0x28a6('0x43')]=_0x2f940a;if(_0x4b2938[_0x28a6('0x33')][_0x28a6('0x44')]){_0x4716a1['include']=[{'all':!![]}];}return db[_0x28a6('0x2e')][_0x28a6('0x45')](_0x4716a1);})[_0x28a6('0x24')](function(_0x5e7e77){_0x301b69['rows']=_0x5e7e77;return _0x301b69;})[_0x28a6('0x24')](respondWithFilteredResult(_0x58629d,_0x4716a1))[_0x28a6('0x46')](handleError(_0x58629d,null));};exports[_0x28a6('0x47')]=function(_0x17618c,_0x2828c2){var _0x39bd4d={'raw':!![],'where':{'id':_0x17618c[_0x28a6('0x48')]['id']}},_0x422f15={};_0x422f15['model']=_['keys'](db[_0x28a6('0x2e')][_0x28a6('0x2f')]);_0x422f15[_0x28a6('0x33')]=_[_0x28a6('0x34')](_0x17618c['query']);_0x422f15[_0x28a6('0x35')]=_[_0x28a6('0x36')](_0x422f15[_0x28a6('0x32')],_0x422f15[_0x28a6('0x33')]);_0x39bd4d[_0x28a6('0x37')]=_[_0x28a6('0x36')](_0x422f15['model'],qs[_0x28a6('0x38')](_0x17618c[_0x28a6('0x33')]['fields']));_0x39bd4d[_0x28a6('0x37')]=_0x39bd4d[_0x28a6('0x37')]['length']?_0x39bd4d['attributes']:_0x422f15[_0x28a6('0x32')];if(_0x17618c[_0x28a6('0x33')][_0x28a6('0x44')]){_0x39bd4d[_0x28a6('0x49')]=[{'all':!![]}];}_0x39bd4d=_[_0x28a6('0x41')]({},_0x39bd4d,_0x17618c['options']);return db[_0x28a6('0x2e')][_0x28a6('0x4a')](_0x39bd4d)[_0x28a6('0x24')](handleEntityNotFound(_0x2828c2,null))['then'](respondWithResult(_0x2828c2,null))['catch'](handleError(_0x2828c2,null));};exports[_0x28a6('0x4b')]=function(_0x4107e9,_0x3b781d){return db[_0x28a6('0x2e')][_0x28a6('0x4b')](_0x4107e9[_0x28a6('0x4c')],{})[_0x28a6('0x24')](function(_0x37f8c0){var _0x4b6f04=_0x4107e9[_0x28a6('0x4d')][_0x28a6('0x26')]({'plain':!![]});if(!_0x4b6f04)throw new Error(_0x28a6('0x4e'));if(_0x4b6f04[_0x28a6('0x4f')]==='user'){var _0x8f65ce=_0x37f8c0[_0x28a6('0x26')]({'plain':!![]});var _0x57635d=_0x28a6('0x27');return db['UserProfileSection'][_0x28a6('0x4a')]({'where':{'name':_0x57635d,'userProfileId':_0x4b6f04['userProfileId']},'raw':!![]})[_0x28a6('0x24')](function(_0x428939){if(_0x428939&&_0x428939[_0x28a6('0x50')]===0x0){return db[_0x28a6('0x28')][_0x28a6('0x4b')]({'name':_0x8f65ce[_0x28a6('0x2b')],'resourceId':_0x8f65ce['id'],'type':_0x428939[_0x28a6('0x2b')],'sectionId':_0x428939['id']},{})[_0x28a6('0x24')](function(){return _0x37f8c0;});}else{return _0x37f8c0;}})[_0x28a6('0x46')](function(_0x3a6d6c){logger[_0x28a6('0x29')](_0x28a6('0x51'),_0x3a6d6c);throw _0x3a6d6c;});}return _0x37f8c0;})['then'](respondWithResult(_0x3b781d,0xc9))['catch'](handleError(_0x3b781d,null));};exports[_0x28a6('0x23')]=function(_0x5a1b94,_0x4b03e2){if(_0x5a1b94[_0x28a6('0x4c')]['id']){delete _0x5a1b94[_0x28a6('0x4c')]['id'];}return db[_0x28a6('0x2e')]['find']({'where':{'id':_0x5a1b94[_0x28a6('0x48')]['id']}})['then'](handleEntityNotFound(_0x4b03e2,null))[_0x28a6('0x24')](saveUpdates(_0x5a1b94['body'],null))[_0x28a6('0x24')](respondWithResult(_0x4b03e2,null))['catch'](handleError(_0x4b03e2,null));};exports[_0x28a6('0x25')]=function(_0x2ff1fd,_0x5d3102){return db[_0x28a6('0x2e')][_0x28a6('0x4a')]({'where':{'id':_0x2ff1fd['params']['id']}})[_0x28a6('0x24')](handleEntityNotFound(_0x5d3102,null))[_0x28a6('0x24')](removeEntity(_0x5d3102,null))[_0x28a6('0x46')](handleError(_0x5d3102,null));}; \ No newline at end of file +var _0x60f0=['query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','includeAll','include','Disposition','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','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','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','set','Content-Range','json','apply','save','then','destroy','get','Dispositions','UserProfileResource','name','send','index','map','rawAttributes','type','model','keys'];(function(_0x5d8e25,_0xf966b4){var _0x212dba=function(_0x175125){while(--_0x175125){_0x5d8e25['push'](_0x5d8e25['shift']());}};_0x212dba(++_0xf966b4);}(_0x60f0,0x128));var _0x060f=function(_0x4c3ed2,_0x477042){_0x4c3ed2=_0x4c3ed2-0x0;var _0x5c6de4=_0x60f0[_0x4c3ed2];return _0x5c6de4;};'use strict';var emlformat=require(_0x060f('0x0'));var rimraf=require(_0x060f('0x1'));var zipdir=require(_0x060f('0x2'));var jsonpatch=require(_0x060f('0x3'));var rp=require(_0x060f('0x4'));var moment=require(_0x060f('0x5'));var BPromise=require(_0x060f('0x6'));var Mustache=require(_0x060f('0x7'));var util=require(_0x060f('0x8'));var path=require(_0x060f('0x9'));var sox=require(_0x060f('0xa'));var csv=require(_0x060f('0xb'));var ejs=require(_0x060f('0xc'));var fs=require('fs');var fs_extra=require(_0x060f('0xd'));var _=require(_0x060f('0xe'));var squel=require(_0x060f('0xf'));var crypto=require(_0x060f('0x10'));var jsforce=require(_0x060f('0x11'));var deskjs=require(_0x060f('0x12'));var toCsv=require(_0x060f('0xb'));var querystring=require(_0x060f('0x13'));var Papa=require(_0x060f('0x14'));var Redis=require(_0x060f('0x15'));var authService=require(_0x060f('0x16'));var qs=require(_0x060f('0x17'));var as=require(_0x060f('0x18'));var hardwareService=require(_0x060f('0x19'));var logger=require(_0x060f('0x1a'))('api');var utils=require(_0x060f('0x1b'));var config=require(_0x060f('0x1c'));var licenseUtil=require(_0x060f('0x1d'));var db=require(_0x060f('0x1e'))['db'];function respondWithStatusCode(_0x32701c,_0x331eac){_0x331eac=_0x331eac||0xcc;return function(_0xec8c5d){if(_0xec8c5d){return _0x32701c[_0x060f('0x1f')](_0x331eac);}return _0x32701c[_0x060f('0x20')](_0x331eac)[_0x060f('0x21')]();};}function respondWithResult(_0x59a8e0,_0x3a1530){_0x3a1530=_0x3a1530||0xc8;return function(_0x5aabaa){if(_0x5aabaa){return _0x59a8e0[_0x060f('0x20')](_0x3a1530)['json'](_0x5aabaa);}};}function respondWithFilteredResult(_0x52ccac,_0xc81fa4){return function(_0x18f386){if(_0x18f386){var _0x48c22c=typeof _0xc81fa4['offset']==='undefined'&&typeof _0xc81fa4[_0x060f('0x22')]===_0x060f('0x23');var _0x1dcf2a=_0x18f386[_0x060f('0x24')];var _0x293a06=_0x48c22c?0x0:_0xc81fa4[_0x060f('0x25')];var _0x26c658=_0x48c22c?_0x18f386[_0x060f('0x24')]:_0xc81fa4['offset']+_0xc81fa4['limit'];var _0x1b284f;if(_0x26c658>=_0x1dcf2a){_0x26c658=_0x1dcf2a;_0x1b284f=0xc8;}else{_0x1b284f=0xce;}_0x52ccac[_0x060f('0x20')](_0x1b284f);return _0x52ccac[_0x060f('0x26')](_0x060f('0x27'),_0x293a06+'-'+_0x26c658+'/'+_0x1dcf2a)[_0x060f('0x28')](_0x18f386);}return null;};}function patchUpdates(_0x33a836){return function(_0x334246){try{jsonpatch[_0x060f('0x29')](_0x334246,_0x33a836,!![]);}catch(_0xd509b9){return BPromise['reject'](_0xd509b9);}return _0x334246[_0x060f('0x2a')]();};}function saveUpdates(_0x32db3b,_0x383f85){return function(_0xbf8d4e){if(_0xbf8d4e){return _0xbf8d4e['update'](_0x32db3b)[_0x060f('0x2b')](function(_0x522ed9){return _0x522ed9;});}return null;};}function removeEntity(_0x425ffa,_0x1986c7){return function(_0x4b3888){if(_0x4b3888){return _0x4b3888[_0x060f('0x2c')]()[_0x060f('0x2b')](function(){var _0x189b87=_0x4b3888[_0x060f('0x2d')]({'plain':!![]});var _0x5873de=_0x060f('0x2e');return db[_0x060f('0x2f')][_0x060f('0x2c')]({'where':{'type':_0x5873de,'resourceId':_0x189b87['id']}})['then'](function(){return _0x4b3888;});})['then'](function(){_0x425ffa[_0x060f('0x20')](0xcc)[_0x060f('0x21')]();});}};}function handleEntityNotFound(_0xde803f,_0x4f843f){return function(_0x177d63){if(!_0x177d63){_0xde803f[_0x060f('0x1f')](0x194);}return _0x177d63;};}function handleError(_0x394393,_0x93ab41){_0x93ab41=_0x93ab41||0x1f4;return function(_0x2dbb2e){logger['error'](_0x2dbb2e['stack']);if(_0x2dbb2e['name']){delete _0x2dbb2e[_0x060f('0x30')];}_0x394393[_0x060f('0x20')](_0x93ab41)[_0x060f('0x31')](_0x2dbb2e);};}exports[_0x060f('0x32')]=function(_0x3f7aa5,_0xdb54a6){var _0x37f3ea={},_0x227de8={},_0x31375d={'count':0x0,'rows':[]};var _0x178943=_[_0x060f('0x33')](db['Disposition'][_0x060f('0x34')],function(_0x28db16){return{'name':_0x28db16['fieldName'],'type':_0x28db16[_0x060f('0x35')]['key']};});_0x227de8[_0x060f('0x36')]=_['map'](_0x178943,_0x060f('0x30'));_0x227de8['query']=_[_0x060f('0x37')](_0x3f7aa5[_0x060f('0x38')]);_0x227de8[_0x060f('0x39')]=_[_0x060f('0x3a')](_0x227de8[_0x060f('0x36')],_0x227de8['query']);_0x37f3ea[_0x060f('0x3b')]=_[_0x060f('0x3a')](_0x227de8[_0x060f('0x36')],qs[_0x060f('0x3c')](_0x3f7aa5['query'][_0x060f('0x3c')]));_0x37f3ea[_0x060f('0x3b')]=_0x37f3ea[_0x060f('0x3b')][_0x060f('0x3d')]?_0x37f3ea[_0x060f('0x3b')]:_0x227de8[_0x060f('0x36')];if(!_0x3f7aa5[_0x060f('0x38')][_0x060f('0x3e')](_0x060f('0x3f'))){_0x37f3ea[_0x060f('0x22')]=qs[_0x060f('0x22')](_0x3f7aa5[_0x060f('0x38')][_0x060f('0x22')]);_0x37f3ea[_0x060f('0x25')]=qs[_0x060f('0x25')](_0x3f7aa5[_0x060f('0x38')][_0x060f('0x25')]);}_0x37f3ea[_0x060f('0x40')]=qs['sort'](_0x3f7aa5['query'][_0x060f('0x41')]);_0x37f3ea[_0x060f('0x42')]=qs[_0x060f('0x39')](_['pick'](_0x3f7aa5[_0x060f('0x38')],_0x227de8[_0x060f('0x39')]),_0x178943);if(_0x3f7aa5[_0x060f('0x38')]['filter']){_0x37f3ea[_0x060f('0x42')]=_[_0x060f('0x43')](_0x37f3ea[_0x060f('0x42')],{'$or':_['map'](_0x178943,function(_0x79ba9){if(_0x79ba9[_0x060f('0x35')]!=='VIRTUAL'){var _0x5d8e2f={};_0x5d8e2f[_0x79ba9[_0x060f('0x30')]]={'$like':'%'+_0x3f7aa5[_0x060f('0x38')][_0x060f('0x44')]+'%'};return _0x5d8e2f;}})});}_0x37f3ea=_[_0x060f('0x43')]({},_0x37f3ea,_0x3f7aa5[_0x060f('0x45')]);var _0xa50c9e={'where':_0x37f3ea['where']};return db['Disposition'][_0x060f('0x24')](_0xa50c9e)['then'](function(_0x553a1d){_0x31375d[_0x060f('0x24')]=_0x553a1d;if(_0x3f7aa5[_0x060f('0x38')][_0x060f('0x46')]){_0x37f3ea[_0x060f('0x47')]=[{'all':!![]}];}return db[_0x060f('0x48')][_0x060f('0x49')](_0x37f3ea);})[_0x060f('0x2b')](function(_0x4ec478){_0x31375d['rows']=_0x4ec478;return _0x31375d;})[_0x060f('0x2b')](respondWithFilteredResult(_0xdb54a6,_0x37f3ea))[_0x060f('0x4a')](handleError(_0xdb54a6,null));};exports[_0x060f('0x4b')]=function(_0x4f9b82,_0xf5de11){var _0x59621f={'raw':!![],'where':{'id':_0x4f9b82[_0x060f('0x4c')]['id']}},_0x273bcb={};_0x273bcb[_0x060f('0x36')]=_[_0x060f('0x37')](db['Disposition']['rawAttributes']);_0x273bcb[_0x060f('0x38')]=_['keys'](_0x4f9b82['query']);_0x273bcb[_0x060f('0x39')]=_[_0x060f('0x3a')](_0x273bcb[_0x060f('0x36')],_0x273bcb['query']);_0x59621f[_0x060f('0x3b')]=_[_0x060f('0x3a')](_0x273bcb['model'],qs['fields'](_0x4f9b82[_0x060f('0x38')]['fields']));_0x59621f[_0x060f('0x3b')]=_0x59621f[_0x060f('0x3b')][_0x060f('0x3d')]?_0x59621f['attributes']:_0x273bcb[_0x060f('0x36')];if(_0x4f9b82[_0x060f('0x38')]['includeAll']){_0x59621f[_0x060f('0x47')]=[{'all':!![]}];}_0x59621f=_[_0x060f('0x43')]({},_0x59621f,_0x4f9b82[_0x060f('0x45')]);return db[_0x060f('0x48')][_0x060f('0x4d')](_0x59621f)['then'](handleEntityNotFound(_0xf5de11,null))[_0x060f('0x2b')](respondWithResult(_0xf5de11,null))['catch'](handleError(_0xf5de11,null));};exports[_0x060f('0x4e')]=function(_0xe35fe4,_0x119813){return db[_0x060f('0x48')][_0x060f('0x4e')](_0xe35fe4[_0x060f('0x4f')],{})[_0x060f('0x2b')](function(_0x133eb9){var _0x226bea=_0xe35fe4[_0x060f('0x50')][_0x060f('0x2d')]({'plain':!![]});if(!_0x226bea)throw new Error(_0x060f('0x51'));if(_0x226bea['role']===_0x060f('0x50')){var _0x24756b=_0x133eb9[_0x060f('0x2d')]({'plain':!![]});var _0x271f04=_0x060f('0x2e');return db[_0x060f('0x52')][_0x060f('0x4d')]({'where':{'name':_0x271f04,'userProfileId':_0x226bea[_0x060f('0x53')]},'raw':!![]})[_0x060f('0x2b')](function(_0xa99e62){if(_0xa99e62&&_0xa99e62[_0x060f('0x54')]===0x0){return db[_0x060f('0x2f')][_0x060f('0x4e')]({'name':_0x24756b[_0x060f('0x30')],'resourceId':_0x24756b['id'],'type':_0xa99e62[_0x060f('0x30')],'sectionId':_0xa99e62['id']},{})['then'](function(){return _0x133eb9;});}else{return _0x133eb9;}})[_0x060f('0x4a')](function(_0x4e6fbb){logger[_0x060f('0x55')](_0x060f('0x56'),_0x4e6fbb);throw _0x4e6fbb;});}return _0x133eb9;})['then'](respondWithResult(_0x119813,0xc9))['catch'](handleError(_0x119813,null));};exports[_0x060f('0x57')]=function(_0x421942,_0x2ea338){if(_0x421942[_0x060f('0x4f')]['id']){delete _0x421942[_0x060f('0x4f')]['id'];}return db['Disposition'][_0x060f('0x4d')]({'where':{'id':_0x421942[_0x060f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2ea338,null))['then'](saveUpdates(_0x421942[_0x060f('0x4f')],null))[_0x060f('0x2b')](respondWithResult(_0x2ea338,null))[_0x060f('0x4a')](handleError(_0x2ea338,null));};exports['destroy']=function(_0x497e5f,_0x59396c){return db['Disposition'][_0x060f('0x4d')]({'where':{'id':_0x497e5f[_0x060f('0x4c')]['id']}})[_0x060f('0x2b')](handleEntityNotFound(_0x59396c,null))[_0x060f('0x2b')](removeEntity(_0x59396c,null))[_0x060f('0x4a')](handleError(_0x59396c,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index f3e4156..013b7e3 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 _0x8228=['Disposition','name_voice','name','ListId','name_chat','MailAccountId','FaxAccountId','name_openchannel','OpenchannelAccountId','WhatsappAccountId','bluebird','rimraf','../../config/environment','./disposition.attributes','exports'];(function(_0x408e38,_0x23cda8){var _0x426b0e=function(_0x8f2898){while(--_0x8f2898){_0x408e38['push'](_0x408e38['shift']());}};_0x426b0e(++_0x23cda8);}(_0x8228,0x145));var _0x8822=function(_0x40f17f,_0x1a1d66){_0x40f17f=_0x40f17f-0x0;var _0x2b41f4=_0x8228[_0x40f17f];return _0x2b41f4;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x8822('0x0'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8822('0x1'));var config=require(_0x8822('0x2'));var attributes=require(_0x8822('0x3'));module[_0x8822('0x4')]=function(_0x283bb1,_0x2b664c){return _0x283bb1['define'](_0x8822('0x5'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x8822('0x6'),'fields':[_0x8822('0x7'),_0x8822('0x8')]},{'unique':!![],'name':_0x8822('0x9'),'fields':['name','ChatWebsiteId']},{'unique':!![],'name':'name_mail','fields':[_0x8822('0x7'),_0x8822('0xa')]},{'unique':!![],'name':'name_sms','fields':['name','SmsAccountId']},{'unique':!![],'name':'name_fax','fields':[_0x8822('0x7'),_0x8822('0xb')]},{'unique':!![],'name':_0x8822('0xc'),'fields':[_0x8822('0x7'),_0x8822('0xd')]},{'unique':!![],'name':'name_whatsapp','fields':['name',_0x8822('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4f7b=['name_chat','ChatWebsiteId','name_mail','name_sms','SmsAccountId','name_fax','FaxAccountId','name_whatsapp','WhatsappAccountId','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','name_voice','name','ListId'];(function(_0x29326d,_0x4f9f08){var _0x2d5444=function(_0x520da8){while(--_0x520da8){_0x29326d['push'](_0x29326d['shift']());}};_0x2d5444(++_0x4f9f08);}(_0x4f7b,0x153));var _0xb4f7=function(_0x417587,_0xcbfdc){_0x417587=_0x417587-0x0;var _0x2e8461=_0x4f7b[_0x417587];return _0x2e8461;};'use strict';var _=require('lodash');var util=require(_0xb4f7('0x0'));var logger=require(_0xb4f7('0x1'))('api');var moment=require('moment');var BPromise=require(_0xb4f7('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb4f7('0x3'));var rimraf=require(_0xb4f7('0x4'));var config=require(_0xb4f7('0x5'));var attributes=require(_0xb4f7('0x6'));module[_0xb4f7('0x7')]=function(_0x3904ce,_0x44d341){return _0x3904ce[_0xb4f7('0x8')](_0xb4f7('0x9'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0xb4f7('0xa'),'fields':[_0xb4f7('0xb'),_0xb4f7('0xc')]},{'unique':!![],'name':_0xb4f7('0xd'),'fields':[_0xb4f7('0xb'),_0xb4f7('0xe')]},{'unique':!![],'name':_0xb4f7('0xf'),'fields':[_0xb4f7('0xb'),'MailAccountId']},{'unique':!![],'name':_0xb4f7('0x10'),'fields':[_0xb4f7('0xb'),_0xb4f7('0x11')]},{'unique':!![],'name':_0xb4f7('0x12'),'fields':[_0xb4f7('0xb'),_0xb4f7('0x13')]},{'unique':!![],'name':'name_openchannel','fields':[_0xb4f7('0xb'),'OpenchannelAccountId']},{'unique':!![],'name':_0xb4f7('0x14'),'fields':[_0xb4f7('0xb'),_0xb4f7('0x15')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 96da127..b74917e 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(_0x397e01,_0x5a5635){var _0x49e118=function(_0x154677){while(--_0x154677){_0x397e01['push'](_0x397e01['shift']());}};_0x49e118(++_0x5a5635);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'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(_0x140985,_0xafebad){var _0x39834b=function(_0x46ca4b){while(--_0x46ca4b){_0x140985['push'](_0x140985['shift']());}};_0x39834b(++_0xafebad);}(_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 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 ea8780f..8497e24 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 _0x80bc=['update','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','isAuthenticated','index','get','show','post','put','/:id'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x80bc,0x14b));var _0xc80b=function(_0x7dbd65,_0x18da49){_0x7dbd65=_0x7dbd65-0x0;var _0x33d551=_0x80bc[_0x7dbd65];return _0x33d551;};'use strict';var multer=require(_0xc80b('0x0'));var util=require(_0xc80b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc80b('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xc80b('0x3'));var interaction=require(_0xc80b('0x4'));var config=require(_0xc80b('0x5'));var controller=require(_0xc80b('0x6'));router['get']('/',auth[_0xc80b('0x7')](),controller[_0xc80b('0x8')]);router[_0xc80b('0x9')]('/:id',auth[_0xc80b('0x7')](),controller[_0xc80b('0xa')]);router[_0xc80b('0xb')]('/',auth[_0xc80b('0x7')](),controller['create']);router[_0xc80b('0xc')](_0xc80b('0xd'),auth[_0xc80b('0x7')](),controller[_0xc80b('0xe')]);router['delete'](_0xc80b('0xd'),auth[_0xc80b('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x43c2=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./disposition.controller','get','isAuthenticated','/:id'];(function(_0x22d45e,_0x4f9c12){var _0x44bd3e=function(_0x1cf153){while(--_0x1cf153){_0x22d45e['push'](_0x22d45e['shift']());}};_0x44bd3e(++_0x4f9c12);}(_0x43c2,0x164));var _0x243c=function(_0x5bdc92,_0x29fd6d){_0x5bdc92=_0x5bdc92-0x0;var _0x14727c=_0x43c2[_0x5bdc92];return _0x14727c;};'use strict';var multer=require(_0x243c('0x0'));var util=require(_0x243c('0x1'));var path=require(_0x243c('0x2'));var timeout=require(_0x243c('0x3'));var express=require(_0x243c('0x4'));var router=express[_0x243c('0x5')]();var fs_extra=require(_0x243c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x243c('0x7'));var config=require('../../config/environment');var controller=require(_0x243c('0x8'));router[_0x243c('0x9')]('/',auth[_0x243c('0xa')](),controller['index']);router[_0x243c('0x9')](_0x243c('0xb'),auth[_0x243c('0xa')](),controller['show']);router['post']('/',auth[_0x243c('0xa')](),controller['create']);router['put'](_0x243c('0xb'),auth[_0x243c('0xa')](),controller[_0x243c('0xc')]);router[_0x243c('0xd')](_0x243c('0xb'),auth['isAuthenticated'](),controller[_0x243c('0xe')]);module[_0x243c('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 05fba71..43cfbf5 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 _0xb46f=['7200','9600','14400','v17,v27,v29','INTEGER','SIP','IAX','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','2400','4800'];(function(_0x2c353f,_0x49693e){var _0x23df36=function(_0x4b8356){while(--_0x4b8356){_0x2c353f['push'](_0x2c353f['shift']());}};_0x23df36(++_0x49693e);}(_0xb46f,0xb6));var _0xfb46=function(_0x3aa181,_0x3d1c33){_0x3aa181=_0x3aa181-0x0;var _0x58b92a=_0xb46f[_0x3aa181];return _0x58b92a;};'use strict';var Sequelize=require(_0xfb46('0x0'));module[_0xfb46('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xfb46('0x2')]},'ecm':{'type':Sequelize[_0xfb46('0x3')](_0xfb46('0x4'),'no'),'defaultValue':_0xfb46('0x4')},'headerinfo':{'type':Sequelize[_0xfb46('0x2')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0xfb46('0x2')],'unique':'localstationid'},'minrate':{'type':Sequelize[_0xfb46('0x3')](_0xfb46('0x5'),_0xfb46('0x6'),_0xfb46('0x7'),_0xfb46('0x8'),'12000',_0xfb46('0x9')),'defaultValue':_0xfb46('0x6')},'maxrate':{'type':Sequelize['ENUM']('2400','4800','7200',_0xfb46('0x8'),'12000',_0xfb46('0x9')),'defaultValue':_0xfb46('0x9')},'modem':{'type':Sequelize[_0xfb46('0x2')],'defaultValue':_0xfb46('0xa')},'gateway':{'type':Sequelize[_0xfb46('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xfb46('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xfb46('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xfb46('0x3')](_0xfb46('0xc'),_0xfb46('0xd'),'DADHI','KHOMP'),'defaultValue':_0xfb46('0xc')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xfb46('0xe')],'defaultValue':function(){return _0xfb46('0xf');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xfb46('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xfb46('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xfb46('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xfb46('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xfb46('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfb46('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xfb46('0xb')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xfb46('0x10')],'defaultValue':![],'comment':_0xfb46('0x11'),'set':function(_0x47959d){if(!_0x47959d)this['setDataValue'](_0xfb46('0x12'),null);this[_0xfb46('0x13')](_0xfb46('0x14'),_0x47959d);}}}; \ No newline at end of file +var _0xa6b0=['2400','4800','7200','9600','12000','14400','v17,v27,v29','INTEGER','SIP','IAX','DADHI','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','ENUM','yes','xCALLY\x20Motion\x20Fax','STRING','localstationid'];(function(_0x244f42,_0x5cbff6){var _0x162e66=function(_0x25dc56){while(--_0x25dc56){_0x244f42['push'](_0x244f42['shift']());}};_0x162e66(++_0x5cbff6);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x451978,_0x82cd50){_0x451978=_0x451978-0x0;var _0x155cac=_0xa6b0[_0x451978];return _0x155cac;};'use strict';var Sequelize=require(_0x0a6b('0x0'));module[_0x0a6b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x0a6b('0x2')](_0x0a6b('0x3'),'no'),'defaultValue':_0x0a6b('0x3')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x0a6b('0x4')},'localstationid':{'type':Sequelize[_0x0a6b('0x5')],'unique':_0x0a6b('0x6')},'minrate':{'type':Sequelize[_0x0a6b('0x2')](_0x0a6b('0x7'),_0x0a6b('0x8'),_0x0a6b('0x9'),_0x0a6b('0xa'),_0x0a6b('0xb'),_0x0a6b('0xc')),'defaultValue':_0x0a6b('0x8')},'maxrate':{'type':Sequelize[_0x0a6b('0x2')]('2400','4800',_0x0a6b('0x9'),_0x0a6b('0xa'),_0x0a6b('0xb'),_0x0a6b('0xc')),'defaultValue':_0x0a6b('0xc')},'modem':{'type':Sequelize[_0x0a6b('0x5')],'defaultValue':_0x0a6b('0xd')},'gateway':{'type':Sequelize[_0x0a6b('0x5')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x0a6b('0x5')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x0a6b('0xe')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x0a6b('0x2')](_0x0a6b('0xf'),_0x0a6b('0x10'),_0x0a6b('0x11'),'KHOMP'),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x0a6b('0x5')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x0a6b('0x12')],'defaultValue':function(){return _0x0a6b('0x13');}},'notificationSound':{'type':Sequelize[_0x0a6b('0x14')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0a6b('0x14')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0a6b('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x0a6b('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x0a6b('0x14')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0a6b('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0a6b('0x14')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0a6b('0xe')],'allowNull':!![],'defaultValue':null,'comment':_0x0a6b('0x15')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x0a6b('0x16'),'set':function(_0x4d0e3b){if(!_0x4d0e3b)this[_0x0a6b('0x17')](_0x0a6b('0x18'),null);this[_0x0a6b('0x17')](_0x0a6b('0x19'),_0x4d0e3b);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 0b4459e..cde9e56 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 _0xeb21=['tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','priority','json','getApplications','context','from-voip-provider','app','description','Fax\x20Extension','appdata','push','CDR(type)=inbound-fax','Set','localstationid','gateway','modem','t38timeout','FAXOPT(','ReceiveFax','addAccountApplications','bulkCreate','updateAccountApplications','VoiceExtension','tech','key','createdAt','updatedAt','TrunkId','ListId','findById','FaxMessage','split','format','List','CmContact','Contacts','DESC','attachments','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','Send\x20Fax\x20failed','Messages','spread','out','filename','dataValues','path','SendFaxRpc,\x20%s','addAgents','emit','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','client','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','end','offset','undefined','limit','count','Content-Range','reject','save','update','then','get','UserProfileResource','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxAccounts','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','nolimit','removeAnswers','addInteraction','omit','getInteractions','FaxInteraction','User','Owner','fullname','internal','Tags','color'];(function(_0x947f69,_0x2312c3){var _0x31659e=function(_0x28d311){while(--_0x28d311){_0x947f69['push'](_0x947f69['shift']());}};_0x31659e(++_0x2312c3);}(_0xeb21,0xff));var _0x1eb2=function(_0x2675da,_0x5a250e){_0x2675da=_0x2675da-0x0;var _0x5e6153=_0xeb21[_0x2675da];return _0x5e6153;};'use strict';var emlformat=require(_0x1eb2('0x0'));var rimraf=require(_0x1eb2('0x1'));var zipdir=require(_0x1eb2('0x2'));var jsonpatch=require(_0x1eb2('0x3'));var rp=require('request-promise');var moment=require(_0x1eb2('0x4'));var BPromise=require(_0x1eb2('0x5'));var Mustache=require(_0x1eb2('0x6'));var util=require(_0x1eb2('0x7'));var path=require('path');var sox=require(_0x1eb2('0x8'));var csv=require(_0x1eb2('0x9'));var ejs=require(_0x1eb2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1eb2('0xb'));var squel=require(_0x1eb2('0xc'));var crypto=require(_0x1eb2('0xd'));var jsforce=require(_0x1eb2('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1eb2('0xf'));var Papa=require(_0x1eb2('0x10'));var Redis=require('ioredis');var authService=require(_0x1eb2('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1eb2('0x12'));var hardwareService=require(_0x1eb2('0x13'));var logger=require('../../config/logger')(_0x1eb2('0x14'));var utils=require(_0x1eb2('0x15'));var config=require(_0x1eb2('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x1eb2('0x17'))['db'];config[_0x1eb2('0x18')]=_[_0x1eb2('0x19')](config[_0x1eb2('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x1eb2('0x1a'))(new Redis(config['redis']));require('./faxAccount.socket')[_0x1eb2('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x1eb2('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c1a5a,_0x328ce3,_0x309eff,_0x6e55e3){return new BPromise(function(_0x5f52fe,_0x13cecf){var _0x4703cb=_0x6e55e3||client;return _0x4703cb[_0x1eb2('0x1d')](_0x4c1a5a,_0x309eff)['then'](function(_0x4a0a40){logger[_0x1eb2('0x1e')](_0x1eb2('0x1f'),_0x328ce3,_0x1eb2('0x20'));logger[_0x1eb2('0x21')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x328ce3,'request\x20sent',JSON[_0x1eb2('0x22')](_0x4a0a40));if(_0x4a0a40[_0x1eb2('0x23')]){if(_0x4a0a40[_0x1eb2('0x23')][_0x1eb2('0x24')]===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x328ce3,_0x4a0a40[_0x1eb2('0x23')]['message']);return _0x13cecf(_0x4a0a40[_0x1eb2('0x23')]['message']);}logger['error'](_0x1eb2('0x1f'),_0x328ce3,_0x4a0a40[_0x1eb2('0x23')][_0x1eb2('0x25')]);return _0x5f52fe(_0x4a0a40[_0x1eb2('0x23')][_0x1eb2('0x25')]);}else{logger[_0x1eb2('0x1e')](_0x1eb2('0x1f'),_0x328ce3,_0x1eb2('0x20'));_0x5f52fe(_0x4a0a40['result']['message']);}})[_0x1eb2('0x26')](function(_0x5a0660){logger['error'](_0x1eb2('0x1f'),_0x328ce3,_0x5a0660);_0x13cecf(_0x5a0660);});});}function respondWithStatusCode(_0x266fe2,_0x51c80b){_0x51c80b=_0x51c80b||0xcc;return function(_0xe22759){if(_0xe22759){return _0x266fe2[_0x1eb2('0x27')](_0x51c80b);}return _0x266fe2[_0x1eb2('0x28')](_0x51c80b)[_0x1eb2('0x29')]();};}function respondWithResult(_0x437fdf,_0x43332a){_0x43332a=_0x43332a||0xc8;return function(_0x516b1e){if(_0x516b1e){return _0x437fdf[_0x1eb2('0x28')](_0x43332a)['json'](_0x516b1e);}};}function respondWithFilteredResult(_0x1c0a54,_0x3554da){return function(_0x57b551){if(_0x57b551){var _0x424493=typeof _0x3554da[_0x1eb2('0x2a')]===_0x1eb2('0x2b')&&typeof _0x3554da[_0x1eb2('0x2c')]===_0x1eb2('0x2b');var _0x37ad74=_0x57b551['count'];var _0x4aea1f=_0x424493?0x0:_0x3554da['offset'];var _0x385b7d=_0x424493?_0x57b551[_0x1eb2('0x2d')]:_0x3554da[_0x1eb2('0x2a')]+_0x3554da[_0x1eb2('0x2c')];var _0x5ce8a9;if(_0x385b7d>=_0x37ad74){_0x385b7d=_0x37ad74;_0x5ce8a9=0xc8;}else{_0x5ce8a9=0xce;}_0x1c0a54[_0x1eb2('0x28')](_0x5ce8a9);return _0x1c0a54['set'](_0x1eb2('0x2e'),_0x4aea1f+'-'+_0x385b7d+'/'+_0x37ad74)['json'](_0x57b551);}return null;};}function patchUpdates(_0x63949a){return function(_0x57fcaa){try{jsonpatch['apply'](_0x57fcaa,_0x63949a,!![]);}catch(_0x4f3057){return BPromise[_0x1eb2('0x2f')](_0x4f3057);}return _0x57fcaa[_0x1eb2('0x30')]();};}function saveUpdates(_0x4d4faa,_0x253e2f){return function(_0x18e19){if(_0x18e19){return _0x18e19[_0x1eb2('0x31')](_0x4d4faa)[_0x1eb2('0x32')](function(_0x2be2d0){return _0x2be2d0;});}return null;};}function removeEntity(_0x325fe8,_0x5e3738){return function(_0x9f1bdb){if(_0x9f1bdb){return _0x9f1bdb['destroy']()['then'](function(){var _0x1ac7b5=_0x9f1bdb[_0x1eb2('0x33')]({'plain':!![]});var _0x1a64b1='FaxAccounts';return db[_0x1eb2('0x34')][_0x1eb2('0x35')]({'where':{'type':_0x1a64b1,'resourceId':_0x1ac7b5['id']}})[_0x1eb2('0x32')](function(){return _0x9f1bdb;});})[_0x1eb2('0x32')](function(){_0x325fe8[_0x1eb2('0x28')](0xcc)[_0x1eb2('0x29')]();});}};}function handleEntityNotFound(_0x1aea09,_0x36b7bb){return function(_0x1d8e73){if(!_0x1d8e73){_0x1aea09[_0x1eb2('0x27')](0x194);}return _0x1d8e73;};}function handleError(_0x5eaca4,_0x46251a){_0x46251a=_0x46251a||0x1f4;return function(_0x555299){logger[_0x1eb2('0x23')](_0x555299[_0x1eb2('0x36')]);if(_0x555299[_0x1eb2('0x37')]){delete _0x555299[_0x1eb2('0x37')];}_0x5eaca4[_0x1eb2('0x28')](_0x46251a)[_0x1eb2('0x38')](_0x555299);};}exports[_0x1eb2('0x39')]=function(_0x2a2246,_0x23858d){var _0x1fc245={'include':[{'model':db[_0x1eb2('0x3a')],'as':_0x1eb2('0x3b')}]},_0x4f22b6={},_0x183730={'count':0x0,'rows':[]};var _0x4820a2=_[_0x1eb2('0x3c')](db[_0x1eb2('0x3d')][_0x1eb2('0x3e')],function(_0x9c18ee){return{'name':_0x9c18ee['fieldName'],'type':_0x9c18ee[_0x1eb2('0x3f')]['key']};});_0x4f22b6[_0x1eb2('0x40')]=_[_0x1eb2('0x3c')](_0x4820a2,_0x1eb2('0x37'));_0x4f22b6['query']=_[_0x1eb2('0x41')](_0x2a2246[_0x1eb2('0x42')]);_0x4f22b6['filters']=_[_0x1eb2('0x43')](_0x4f22b6['model'],_0x4f22b6['query']);_0x1fc245[_0x1eb2('0x44')]=_[_0x1eb2('0x43')](_0x4f22b6[_0x1eb2('0x40')],qs[_0x1eb2('0x45')](_0x2a2246[_0x1eb2('0x42')][_0x1eb2('0x45')]));_0x1fc245[_0x1eb2('0x44')]=_0x1fc245[_0x1eb2('0x44')][_0x1eb2('0x46')]?_0x1fc245['attributes']:_0x4f22b6[_0x1eb2('0x40')];if(!_0x2a2246[_0x1eb2('0x42')][_0x1eb2('0x47')]('nolimit')){_0x1fc245['limit']=qs['limit'](_0x2a2246['query'][_0x1eb2('0x2c')]);_0x1fc245[_0x1eb2('0x2a')]=qs['offset'](_0x2a2246[_0x1eb2('0x42')]['offset']);}_0x1fc245[_0x1eb2('0x48')]=qs[_0x1eb2('0x49')](_0x2a2246[_0x1eb2('0x42')][_0x1eb2('0x49')]);_0x1fc245[_0x1eb2('0x4a')]=qs[_0x1eb2('0x4b')](_[_0x1eb2('0x4c')](_0x2a2246['query'],_0x4f22b6[_0x1eb2('0x4b')]),_0x4820a2);if(_0x2a2246[_0x1eb2('0x42')][_0x1eb2('0x4d')]){_0x1fc245['where']=_[_0x1eb2('0x4e')](_0x1fc245[_0x1eb2('0x4a')],{'$or':_['map'](_0x4820a2,function(_0x17a026){if(_0x17a026[_0x1eb2('0x3f')]!==_0x1eb2('0x4f')){var _0x3b3b78={};_0x3b3b78[_0x17a026[_0x1eb2('0x37')]]={'$like':'%'+_0x2a2246[_0x1eb2('0x42')][_0x1eb2('0x4d')]+'%'};return _0x3b3b78;}})});}_0x1fc245=_[_0x1eb2('0x4e')]({},_0x1fc245,_0x2a2246[_0x1eb2('0x50')]);var _0x140eda={'where':_0x1fc245[_0x1eb2('0x4a')]};return db['FaxAccount'][_0x1eb2('0x2d')](_0x140eda)[_0x1eb2('0x32')](function(_0xd9318e){_0x183730['count']=_0xd9318e;if(_0x2a2246[_0x1eb2('0x42')][_0x1eb2('0x51')]){_0x1fc245[_0x1eb2('0x52')]=[{'all':!![]}];}return db['FaxAccount']['findAll'](_0x1fc245);})[_0x1eb2('0x32')](function(_0x5606f3){_0x183730[_0x1eb2('0x53')]=_0x5606f3;return _0x183730;})['then'](respondWithFilteredResult(_0x23858d,_0x1fc245))[_0x1eb2('0x26')](handleError(_0x23858d,null));};exports[_0x1eb2('0x54')]=function(_0x40bb19,_0x4f024f){var _0x2ba725={'raw':![],'where':{'id':_0x40bb19['params']['id']},'include':[{'model':db[_0x1eb2('0x3a')],'as':_0x1eb2('0x3b')}]},_0x5bb522={};_0x5bb522[_0x1eb2('0x40')]=_[_0x1eb2('0x41')](db[_0x1eb2('0x3d')][_0x1eb2('0x3e')]);_0x5bb522[_0x1eb2('0x42')]=_[_0x1eb2('0x41')](_0x40bb19[_0x1eb2('0x42')]);_0x5bb522[_0x1eb2('0x4b')]=_[_0x1eb2('0x43')](_0x5bb522['model'],_0x5bb522[_0x1eb2('0x42')]);_0x2ba725[_0x1eb2('0x44')]=_[_0x1eb2('0x43')](_0x5bb522[_0x1eb2('0x40')],qs['fields'](_0x40bb19[_0x1eb2('0x42')]['fields']));_0x2ba725[_0x1eb2('0x44')]=_0x2ba725[_0x1eb2('0x44')][_0x1eb2('0x46')]?_0x2ba725['attributes']:_0x5bb522[_0x1eb2('0x40')];if(_0x40bb19['query'][_0x1eb2('0x51')]){_0x2ba725[_0x1eb2('0x52')]=[{'all':!![]}];}_0x2ba725=_['merge']({},_0x2ba725,_0x40bb19[_0x1eb2('0x50')]);return db[_0x1eb2('0x3d')][_0x1eb2('0x55')](_0x2ba725)['then'](handleEntityNotFound(_0x4f024f,null))[_0x1eb2('0x32')](respondWithResult(_0x4f024f,null))[_0x1eb2('0x26')](handleError(_0x4f024f,null));};exports[_0x1eb2('0x56')]=function(_0x52e644,_0x879ae0){return db[_0x1eb2('0x3d')][_0x1eb2('0x56')](_0x52e644[_0x1eb2('0x57')],{})[_0x1eb2('0x32')](function(_0xdfda2){var _0x171af7=_0x52e644[_0x1eb2('0x58')][_0x1eb2('0x33')]({'plain':!![]});if(!_0x171af7)throw new Error(_0x1eb2('0x59'));if(_0x171af7[_0x1eb2('0x5a')]==='user'){var _0x3b55a0=_0xdfda2['get']({'plain':!![]});var _0x44c772=_0x1eb2('0x5b');return db[_0x1eb2('0x5c')][_0x1eb2('0x55')]({'where':{'name':_0x44c772,'userProfileId':_0x171af7[_0x1eb2('0x5d')]},'raw':!![]})['then'](function(_0x71edb8){if(_0x71edb8&&_0x71edb8[_0x1eb2('0x5e')]===0x0){return db['UserProfileResource'][_0x1eb2('0x56')]({'name':_0x3b55a0[_0x1eb2('0x37')],'resourceId':_0x3b55a0['id'],'type':_0x71edb8[_0x1eb2('0x37')],'sectionId':_0x71edb8['id']},{})[_0x1eb2('0x32')](function(){return _0xdfda2;});}else{return _0xdfda2;}})[_0x1eb2('0x26')](function(_0x963b5c){logger['error'](_0x1eb2('0x5f'),_0x963b5c);throw _0x963b5c;});}return _0xdfda2;})[_0x1eb2('0x32')](respondWithResult(_0x879ae0,0xc9))['catch'](handleError(_0x879ae0,null));};exports[_0x1eb2('0x31')]=function(_0xced266,_0x447abe){if(_0xced266['body']['id']){delete _0xced266['body']['id'];}return db[_0x1eb2('0x3d')]['find']({'where':{'id':_0xced266[_0x1eb2('0x60')]['id']},'include':[{'model':db[_0x1eb2('0x3a')],'as':_0x1eb2('0x3b')}]})['then'](handleEntityNotFound(_0x447abe,null))[_0x1eb2('0x32')](saveUpdates(_0xced266[_0x1eb2('0x57')],null))[_0x1eb2('0x32')](respondWithResult(_0x447abe,null))['catch'](handleError(_0x447abe,null));};exports[_0x1eb2('0x35')]=function(_0x3be05b,_0x47b89f){return db[_0x1eb2('0x3d')][_0x1eb2('0x55')]({'where':{'id':_0x3be05b[_0x1eb2('0x60')]['id']}})[_0x1eb2('0x32')](handleEntityNotFound(_0x47b89f,null))[_0x1eb2('0x32')](removeEntity(_0x47b89f,null))['catch'](handleError(_0x47b89f,null));};exports[_0x1eb2('0x61')]=function(_0x5c6fd5,_0x2b01b2){return db[_0x1eb2('0x3d')][_0x1eb2('0x61')]()['then'](respondWithResult(_0x2b01b2,null))[_0x1eb2('0x26')](handleError(_0x2b01b2,null));};exports[_0x1eb2('0x62')]=function(_0x2963b8,_0x1a3c6d,_0x31d127){if(_0x2963b8[_0x1eb2('0x57')]['id']){delete _0x2963b8[_0x1eb2('0x57')]['id'];}return db['FaxAccount'][_0x1eb2('0x55')]({'where':{'id':_0x2963b8[_0x1eb2('0x60')]['id']}})[_0x1eb2('0x32')](handleEntityNotFound(_0x1a3c6d,null))[_0x1eb2('0x32')](function(_0x53b968){if(_0x53b968){_0x2963b8[_0x1eb2('0x57')][_0x1eb2('0x63')]=_0x53b968['id'];return db[_0x1eb2('0x64')]['create'](_0x2963b8[_0x1eb2('0x57')]);}})[_0x1eb2('0x32')](respondWithResult(_0x1a3c6d,null))['catch'](handleError(_0x1a3c6d,null));};exports[_0x1eb2('0x65')]=function(_0x563cb6,_0x24feb2,_0x2aab4e){var _0x4b298d={'raw':![],'where':{}};var _0x367ade={};var _0x4eeb0b={'count':0x0,'rows':[]};return db['FaxAccount'][_0x1eb2('0x66')]({'where':{'id':_0x563cb6[_0x1eb2('0x60')]['id']}})['then'](handleEntityNotFound(_0x24feb2,null))['then'](function(_0x5863da){if(_0x5863da){_0x367ade[_0x1eb2('0x40')]=_[_0x1eb2('0x41')](db[_0x1eb2('0x64')][_0x1eb2('0x3e')]);_0x367ade['query']=_[_0x1eb2('0x41')](_0x563cb6[_0x1eb2('0x42')]);_0x367ade[_0x1eb2('0x4b')]=_[_0x1eb2('0x43')](_0x367ade[_0x1eb2('0x40')],_0x367ade[_0x1eb2('0x42')]);_0x4b298d[_0x1eb2('0x44')]=_[_0x1eb2('0x43')](_0x367ade[_0x1eb2('0x40')],qs[_0x1eb2('0x45')](_0x563cb6[_0x1eb2('0x42')][_0x1eb2('0x45')]));_0x4b298d[_0x1eb2('0x44')]=_0x4b298d[_0x1eb2('0x44')]['length']?_0x4b298d['attributes']:_0x367ade[_0x1eb2('0x40')];if(!_0x563cb6[_0x1eb2('0x42')]['hasOwnProperty']('nolimit')){_0x4b298d[_0x1eb2('0x2c')]=qs[_0x1eb2('0x2c')](_0x563cb6[_0x1eb2('0x42')][_0x1eb2('0x2c')]);_0x4b298d[_0x1eb2('0x2a')]=qs[_0x1eb2('0x2a')](_0x563cb6[_0x1eb2('0x42')][_0x1eb2('0x2a')]);}_0x4b298d[_0x1eb2('0x48')]=qs[_0x1eb2('0x49')](_0x563cb6['query'][_0x1eb2('0x49')]);_0x4b298d['where']=qs[_0x1eb2('0x4b')](_[_0x1eb2('0x4c')](_0x563cb6[_0x1eb2('0x42')],_0x367ade[_0x1eb2('0x4b')]));_0x4b298d[_0x1eb2('0x4a')][_0x1eb2('0x63')]=_0x5863da['id'];if(_0x563cb6[_0x1eb2('0x42')][_0x1eb2('0x4d')]){_0x4b298d[_0x1eb2('0x4a')]=_[_0x1eb2('0x4e')](_0x4b298d['where'],{'$or':_['map'](_0x4b298d[_0x1eb2('0x44')],function(_0x431b20){var _0x2b5696={};_0x2b5696[_0x431b20]={'$like':'%'+_0x563cb6['query']['filter']+'%'};return _0x2b5696;})});}_0x4b298d=_[_0x1eb2('0x4e')]({},_0x4b298d,_0x563cb6[_0x1eb2('0x50')]);return db['Disposition'][_0x1eb2('0x2d')]({'where':_0x4b298d[_0x1eb2('0x4a')]})[_0x1eb2('0x32')](function(_0x1e05c6){_0x4eeb0b[_0x1eb2('0x2d')]=_0x1e05c6;if(_0x563cb6[_0x1eb2('0x42')][_0x1eb2('0x51')]){_0x4b298d[_0x1eb2('0x52')]=[{'all':!![]}];}return db['Disposition'][_0x1eb2('0x67')](_0x4b298d);})[_0x1eb2('0x32')](function(_0x4be8cc){_0x4eeb0b[_0x1eb2('0x53')]=_0x4be8cc;return _0x4eeb0b;});}})['then'](respondWithFilteredResult(_0x24feb2,_0x4b298d))[_0x1eb2('0x26')](handleError(_0x24feb2,null));};exports[_0x1eb2('0x68')]=function(_0x16c189,_0xc2476,_0x154bb5){return db['FaxAccount'][_0x1eb2('0x55')]({'where':{'id':_0x16c189['params']['id']}})[_0x1eb2('0x32')](handleEntityNotFound(_0xc2476,null))[_0x1eb2('0x32')](function(_0x19ffed){if(_0x19ffed){return _0x19ffed[_0x1eb2('0x68')](_0x16c189[_0x1eb2('0x42')][_0x1eb2('0x69')]);}})[_0x1eb2('0x32')](respondWithStatusCode(_0xc2476,null))[_0x1eb2('0x26')](handleError(_0xc2476,null));};exports[_0x1eb2('0x6a')]=function(_0x465efe,_0x567b2c,_0x21aa66){if(_0x465efe[_0x1eb2('0x57')]['id']){delete _0x465efe[_0x1eb2('0x57')]['id'];}return db[_0x1eb2('0x3d')][_0x1eb2('0x55')]({'where':{'id':_0x465efe['params']['id']}})[_0x1eb2('0x32')](handleEntityNotFound(_0x567b2c,null))[_0x1eb2('0x32')](function(_0x45e1fc){if(_0x45e1fc){_0x465efe[_0x1eb2('0x57')][_0x1eb2('0x63')]=_0x45e1fc['id'];return db[_0x1eb2('0x6b')]['create'](_0x465efe[_0x1eb2('0x57')]);}})[_0x1eb2('0x32')](respondWithResult(_0x567b2c,null))['catch'](handleError(_0x567b2c,null));};exports[_0x1eb2('0x6c')]=function(_0x14b02a,_0xa8e6d9,_0x36bc3f){var _0x42c9ea={'raw':![],'where':{}};var _0x48ac6d={};var _0x326157={'count':0x0,'rows':[]};return db[_0x1eb2('0x3d')][_0x1eb2('0x66')]({'where':{'id':_0x14b02a[_0x1eb2('0x60')]['id']}})[_0x1eb2('0x32')](handleEntityNotFound(_0xa8e6d9,null))[_0x1eb2('0x32')](function(_0x21325d){if(_0x21325d){_0x48ac6d['model']=_['keys'](db[_0x1eb2('0x6b')][_0x1eb2('0x3e')]);_0x48ac6d[_0x1eb2('0x42')]=_['keys'](_0x14b02a['query']);_0x48ac6d[_0x1eb2('0x4b')]=_[_0x1eb2('0x43')](_0x48ac6d[_0x1eb2('0x40')],_0x48ac6d[_0x1eb2('0x42')]);_0x42c9ea[_0x1eb2('0x44')]=_['intersection'](_0x48ac6d[_0x1eb2('0x40')],qs[_0x1eb2('0x45')](_0x14b02a[_0x1eb2('0x42')]['fields']));_0x42c9ea[_0x1eb2('0x44')]=_0x42c9ea[_0x1eb2('0x44')][_0x1eb2('0x46')]?_0x42c9ea[_0x1eb2('0x44')]:_0x48ac6d[_0x1eb2('0x40')];if(!_0x14b02a[_0x1eb2('0x42')][_0x1eb2('0x47')](_0x1eb2('0x6d'))){_0x42c9ea['limit']=qs[_0x1eb2('0x2c')](_0x14b02a[_0x1eb2('0x42')][_0x1eb2('0x2c')]);_0x42c9ea[_0x1eb2('0x2a')]=qs[_0x1eb2('0x2a')](_0x14b02a[_0x1eb2('0x42')][_0x1eb2('0x2a')]);}_0x42c9ea[_0x1eb2('0x48')]=qs['sort'](_0x14b02a['query']['sort']);_0x42c9ea[_0x1eb2('0x4a')]=qs[_0x1eb2('0x4b')](_[_0x1eb2('0x4c')](_0x14b02a[_0x1eb2('0x42')],_0x48ac6d['filters']));_0x42c9ea[_0x1eb2('0x4a')][_0x1eb2('0x63')]=_0x21325d['id'];if(_0x14b02a[_0x1eb2('0x42')]['filter']){_0x42c9ea[_0x1eb2('0x4a')]=_['merge'](_0x42c9ea[_0x1eb2('0x4a')],{'$or':_[_0x1eb2('0x3c')](_0x42c9ea[_0x1eb2('0x44')],function(_0x59711f){var _0xe2912f={};_0xe2912f[_0x59711f]={'$like':'%'+_0x14b02a[_0x1eb2('0x42')]['filter']+'%'};return _0xe2912f;})});}_0x42c9ea=_[_0x1eb2('0x4e')]({},_0x42c9ea,_0x14b02a[_0x1eb2('0x50')]);return db[_0x1eb2('0x6b')]['count']({'where':_0x42c9ea['where']})[_0x1eb2('0x32')](function(_0x4363e5){_0x326157[_0x1eb2('0x2d')]=_0x4363e5;if(_0x14b02a[_0x1eb2('0x42')][_0x1eb2('0x51')]){_0x42c9ea[_0x1eb2('0x52')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x42c9ea);})[_0x1eb2('0x32')](function(_0x5017c8){_0x326157[_0x1eb2('0x53')]=_0x5017c8;return _0x326157;});}})[_0x1eb2('0x32')](respondWithFilteredResult(_0xa8e6d9,_0x42c9ea))[_0x1eb2('0x26')](handleError(_0xa8e6d9,null));};exports['removeAnswers']=function(_0x371db3,_0x45e5f8,_0xb11148){return db['FaxAccount'][_0x1eb2('0x55')]({'where':{'id':_0x371db3[_0x1eb2('0x60')]['id']}})[_0x1eb2('0x32')](handleEntityNotFound(_0x45e5f8,null))[_0x1eb2('0x32')](function(_0x39b5c5){if(_0x39b5c5){return _0x39b5c5[_0x1eb2('0x6e')](_0x371db3[_0x1eb2('0x42')][_0x1eb2('0x69')]);}})[_0x1eb2('0x32')](respondWithStatusCode(_0x45e5f8,null))[_0x1eb2('0x26')](handleError(_0x45e5f8,null));};exports['addInteraction']=function(_0x3f1acb,_0x424bbe,_0x31ba45){return db['FaxInteraction'][_0x1eb2('0x55')]({'where':{'id':_0x3f1acb[_0x1eb2('0x60')]['id']}})[_0x1eb2('0x32')](handleEntityNotFound(_0x424bbe,null))[_0x1eb2('0x32')](function(_0x82f4b9){if(_0x82f4b9){return _0x82f4b9[_0x1eb2('0x6f')](_0x3f1acb['body'][_0x1eb2('0x69')],_[_0x1eb2('0x70')](_0x3f1acb[_0x1eb2('0x57')],['ids','id'])||{});}})['then'](respondWithResult(_0x424bbe,null))[_0x1eb2('0x26')](handleError(_0x424bbe,null));};exports[_0x1eb2('0x71')]=function(_0x43e2ac,_0x107982,_0x3f6d06){var _0x2e17b5={'raw':![],'where':{}};var _0x33e4ba={};var _0xcd4f05={'count':0x0,'rows':[]};return db[_0x1eb2('0x3d')][_0x1eb2('0x66')]({'where':{'id':_0x43e2ac[_0x1eb2('0x60')]['id']}})[_0x1eb2('0x32')](handleEntityNotFound(_0x107982,null))[_0x1eb2('0x32')](function(_0x4b8308){if(_0x4b8308){_0x33e4ba[_0x1eb2('0x40')]=_[_0x1eb2('0x41')](db['FaxInteraction'][_0x1eb2('0x3e')]);_0x33e4ba[_0x1eb2('0x42')]=_['keys'](_0x43e2ac[_0x1eb2('0x42')]);_0x33e4ba[_0x1eb2('0x4b')]=_['intersection'](_0x33e4ba[_0x1eb2('0x40')],_0x33e4ba[_0x1eb2('0x42')]);_0x2e17b5['attributes']=_[_0x1eb2('0x43')](_0x33e4ba[_0x1eb2('0x40')],qs[_0x1eb2('0x45')](_0x43e2ac[_0x1eb2('0x42')][_0x1eb2('0x45')]));_0x2e17b5['attributes']=_0x2e17b5[_0x1eb2('0x44')][_0x1eb2('0x46')]?_0x2e17b5['attributes']:_0x33e4ba['model'];if(!_0x43e2ac['query'][_0x1eb2('0x47')](_0x1eb2('0x6d'))){_0x2e17b5[_0x1eb2('0x2c')]=qs[_0x1eb2('0x2c')](_0x43e2ac[_0x1eb2('0x42')][_0x1eb2('0x2c')]);_0x2e17b5[_0x1eb2('0x2a')]=qs[_0x1eb2('0x2a')](_0x43e2ac[_0x1eb2('0x42')][_0x1eb2('0x2a')]);}_0x2e17b5[_0x1eb2('0x48')]=qs[_0x1eb2('0x49')](_0x43e2ac[_0x1eb2('0x42')]['sort']);_0x2e17b5[_0x1eb2('0x4a')]=qs[_0x1eb2('0x4b')](_[_0x1eb2('0x4c')](_0x43e2ac[_0x1eb2('0x42')],_0x33e4ba[_0x1eb2('0x4b')]));_0x2e17b5[_0x1eb2('0x4a')][_0x1eb2('0x63')]=_0x4b8308['id'];if(_0x43e2ac[_0x1eb2('0x42')]['filter']){_0x2e17b5[_0x1eb2('0x4a')]=_[_0x1eb2('0x4e')](_0x2e17b5[_0x1eb2('0x4a')],{'$or':_[_0x1eb2('0x3c')](_0x2e17b5[_0x1eb2('0x44')],function(_0x23b054){var _0x6680b3={};_0x6680b3[_0x23b054]={'$like':'%'+_0x43e2ac['query'][_0x1eb2('0x4d')]+'%'};return _0x6680b3;})});}_0x2e17b5=_['merge']({},_0x2e17b5,_0x43e2ac[_0x1eb2('0x50')]);return db[_0x1eb2('0x72')][_0x1eb2('0x2d')]({'where':_0x2e17b5[_0x1eb2('0x4a')]})['then'](function(_0x4094d4){_0xcd4f05[_0x1eb2('0x2d')]=_0x4094d4;if(_0x43e2ac[_0x1eb2('0x42')][_0x1eb2('0x51')]){_0x2e17b5[_0x1eb2('0x52')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x1eb2('0x73')],'as':_0x1eb2('0x74'),'attributes':[_0x1eb2('0x37'),_0x1eb2('0x75'),_0x1eb2('0x76')],'required':![]},{'model':db['Tag'],'as':_0x1eb2('0x77'),'attributes':['id',_0x1eb2('0x37'),_0x1eb2('0x78')],'where':_0x43e2ac[_0x1eb2('0x42')][_0x1eb2('0x79')]?{'id':_0x43e2ac[_0x1eb2('0x42')][_0x1eb2('0x79')]}:undefined,'required':_0x43e2ac[_0x1eb2('0x42')][_0x1eb2('0x79')]?!![]:![]}];}return db['FaxInteraction'][_0x1eb2('0x67')](_0x2e17b5);})['then'](function(_0x45c0a7){_0xcd4f05['rows']=_0x45c0a7;return _0xcd4f05;});}})[_0x1eb2('0x32')](respondWithFilteredResult(_0x107982,_0x2e17b5))[_0x1eb2('0x26')](handleError(_0x107982,null));};exports[_0x1eb2('0x7a')]=function(_0x4f6f6b,_0x988724){var _0x13ca35=_0x4f6f6b[_0x1eb2('0x60')]['id'];var _0x1721e8=_0x4f6f6b[_0x1eb2('0x57')];var _0x5e9408=0xc8;var _0x5e3ce0=null;return db[_0x1eb2('0x7b')][_0x1eb2('0x7c')]({'isolationLevel':db[_0x1eb2('0x7b')][_0x1eb2('0x7d')][_0x1eb2('0x7e')][_0x1eb2('0x7f')]},function(_0x4a748a){return db[_0x1eb2('0x3d')][_0x1eb2('0x66')]({'where':{'id':_0x13ca35},'transaction':_0x4a748a})[_0x1eb2('0x32')](function(_0x2026e3){if(_0x2026e3){return db[_0x1eb2('0x80')][_0x1eb2('0x35')]({'where':{'FaxAccountId':_0x13ca35},'transaction':_0x4a748a})[_0x1eb2('0x32')](function(){var _0x7ff4cc=_[_0x1eb2('0x3c')](_0x1721e8,function(_0x54d2b0){_0x54d2b0[_0x1eb2('0x63')]=_0x13ca35;return _0x54d2b0;});return db[_0x1eb2('0x80')]['bulkCreate'](_0x7ff4cc,{'transaction':_0x4a748a});});}else{_0x5e9408=0x194;_0x5e3ce0=[];}});})[_0x1eb2('0x32')](function(){if(_0x5e9408!==0x194){return db[_0x1eb2('0x80')]['findAndCountAll']({'where':{'FaxAccountId':_0x13ca35},'order':_0x1eb2('0x81')})[_0x1eb2('0x32')](function(_0x528f76){_0x5e3ce0=_0x528f76;});}})[_0x1eb2('0x26')](function(_0xcd563b){_0x5e9408=0x1f4;logger[_0x1eb2('0x23')](_0xcd563b[_0x1eb2('0x36')]);if(_0xcd563b[_0x1eb2('0x37')]){delete _0xcd563b[_0x1eb2('0x37')];}_0x5e3ce0=_0xcd563b;})['finally'](function(){if(_0x5e3ce0===null){_0x988724['sendStatus'](_0x5e9408);}else{if(_0x5e9408===0x1f4){_0x988724[_0x1eb2('0x28')](_0x5e9408)['send'](_0x5e3ce0);}else{_0x988724[_0x1eb2('0x28')](_0x5e9408)[_0x1eb2('0x82')](_0x5e3ce0);}}});};exports[_0x1eb2('0x83')]=function(_0xc08ec5,_0x5962a1,_0x252edf){var _0x2b1c00={};var _0x40c2dd={};var _0x46e389;var _0x261fd3;return db[_0x1eb2('0x3d')][_0x1eb2('0x66')]({'where':{'id':_0xc08ec5[_0x1eb2('0x60')]['id']}})[_0x1eb2('0x32')](handleEntityNotFound(_0x5962a1,null))[_0x1eb2('0x32')](function(_0xff941b){if(_0xff941b){_0x46e389=_0xff941b;_0x40c2dd[_0x1eb2('0x40')]=_['keys'](db[_0x1eb2('0x80')]['rawAttributes']);_0x40c2dd[_0x1eb2('0x42')]=_[_0x1eb2('0x41')](_0xc08ec5[_0x1eb2('0x42')]);_0x40c2dd['filters']=_['intersection'](_0x40c2dd[_0x1eb2('0x40')],_0x40c2dd[_0x1eb2('0x42')]);_0x2b1c00[_0x1eb2('0x44')]=_[_0x1eb2('0x43')](_0x40c2dd[_0x1eb2('0x40')],qs[_0x1eb2('0x45')](_0xc08ec5[_0x1eb2('0x42')][_0x1eb2('0x45')]));_0x2b1c00[_0x1eb2('0x44')]=_0x2b1c00['attributes']['length']?_0x2b1c00[_0x1eb2('0x44')]:_0x40c2dd['model'];_0x2b1c00['order']=qs[_0x1eb2('0x49')](_0xc08ec5[_0x1eb2('0x42')][_0x1eb2('0x49')]);_0x2b1c00['where']=qs[_0x1eb2('0x4b')](_[_0x1eb2('0x4c')](_0xc08ec5[_0x1eb2('0x42')],_0x40c2dd[_0x1eb2('0x4b')]));if(_0xc08ec5[_0x1eb2('0x42')][_0x1eb2('0x4d')]){_0x2b1c00[_0x1eb2('0x4a')]=_[_0x1eb2('0x4e')](_0x2b1c00[_0x1eb2('0x4a')],{'$or':_[_0x1eb2('0x3c')](_0x2b1c00['attributes'],function(_0x55a9a3){var _0x2a6e95={};_0x2a6e95[_0x55a9a3]={'$like':'%'+_0xc08ec5[_0x1eb2('0x42')][_0x1eb2('0x4d')]+'%'};return _0x2a6e95;})});}_0x2b1c00=_[_0x1eb2('0x4e')]({},_0x2b1c00,_0xc08ec5[_0x1eb2('0x50')]);return _0x46e389[_0x1eb2('0x83')](_0x2b1c00);}})[_0x1eb2('0x32')](function(_0x5cbac3){if(_0x5cbac3){_0x261fd3=_0x5cbac3[_0x1eb2('0x46')];if(!_0xc08ec5[_0x1eb2('0x42')][_0x1eb2('0x47')](_0x1eb2('0x6d'))){_0x2b1c00[_0x1eb2('0x2c')]=qs[_0x1eb2('0x2c')](_0xc08ec5['query'][_0x1eb2('0x2c')]);_0x2b1c00[_0x1eb2('0x2a')]=qs[_0x1eb2('0x2a')](_0xc08ec5[_0x1eb2('0x42')][_0x1eb2('0x2a')]);}return _0x46e389[_0x1eb2('0x83')](_0x2b1c00);}})[_0x1eb2('0x32')](function(_0x5333a5){if(_0x5333a5){return _0x5333a5?{'count':_0x261fd3,'rows':_0x5333a5}:null;}})['then'](respondWithResult(_0x5962a1,null))['catch'](handleError(_0x5962a1,null));};function Extension(_0x4a4248,_0x43dd2d,_0x3e2a4b,_0x2f0c89){this[_0x1eb2('0x84')]=_0x1eb2('0x85');this['exten']=_0x4a4248['localstationid'];this[_0x1eb2('0x86')]=_0x2f0c89;this[_0x1eb2('0x3f')]='system';this[_0x1eb2('0x87')]=_0x1eb2('0x88');this[_0x1eb2('0x63')]=_0x4a4248['id'];this[_0x1eb2('0x81')]=_0x43dd2d;this[_0x1eb2('0x89')]=_0x3e2a4b;}function createExtensionsReciveFax(_0x4f4475){var _0x57a8d4=0x1;var _0x3d9786=[];_0x3d9786[_0x1eb2('0x8a')](new Extension(_0x4f4475,_0x57a8d4,'','Answer'));_0x57a8d4+=0x1;_0x3d9786[_0x1eb2('0x8a')](new Extension(_0x4f4475,_0x57a8d4,_0x1eb2('0x8b'),_0x1eb2('0x8c')));_0x57a8d4+=0x1;for(var _0x3d8a3e in _0x4f4475){if(_0x4f4475[_0x1eb2('0x47')](_0x3d8a3e)&&(_0x3d8a3e==='ecm'||_0x3d8a3e===_0x1eb2('0x8d')||_0x3d8a3e===_0x1eb2('0x8e')||_0x3d8a3e==='faxdetect'||_0x3d8a3e==='headerinfo'||_0x3d8a3e==='maxrate'||_0x3d8a3e==='minrate'||_0x3d8a3e===_0x1eb2('0x8f')||_0x3d8a3e===_0x1eb2('0x90'))){_0x3d9786[_0x1eb2('0x8a')](new Extension(_0x4f4475,_0x57a8d4,_0x1eb2('0x91')+_0x3d8a3e+')='+_0x4f4475[_0x3d8a3e],_0x1eb2('0x8c')));_0x57a8d4+=0x1;}}_0x3d9786[_0x1eb2('0x8a')](new Extension(_0x4f4475,_0x57a8d4,'6','Wait'));_0x57a8d4+=0x1;_0x3d9786['push'](new Extension(_0x4f4475,_0x57a8d4,'/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',_0x1eb2('0x92')));_0x57a8d4=0x0;return _0x3d9786;}exports[_0x1eb2('0x93')]=function(_0x511407,_0x3622f8,_0x5bc551){var _0x2c0b30;return db['sequelize'][_0x1eb2('0x7c')](function(_0x428e04){return db[_0x1eb2('0x3d')][_0x1eb2('0x56')](_0x511407['body'],{'transaction':_0x428e04})[_0x1eb2('0x32')](function(_0x51e868){_0x2c0b30=_0x51e868[_0x1eb2('0x33')]({'plain':!![]});return db['VoiceExtension'][_0x1eb2('0x94')](createExtensionsReciveFax(_0x2c0b30),{'transaction':_0x428e04});});})[_0x1eb2('0x32')](function(){return _0x2c0b30;})[_0x1eb2('0x32')](respondWithResult(_0x3622f8,null))['catch'](handleError(_0x3622f8,null));};exports[_0x1eb2('0x95')]=function(_0x29a842,_0x4594e7,_0x25faaa){var _0x981c83;return db[_0x1eb2('0x7b')][_0x1eb2('0x7c')](function(_0x178480){return db[_0x1eb2('0x3d')][_0x1eb2('0x31')](_0x29a842[_0x1eb2('0x57')],{'where':{'id':_0x29a842[_0x1eb2('0x57')]['id']},'transaction':_0x178480})[_0x1eb2('0x32')](function(_0x59012f){return db[_0x1eb2('0x96')][_0x1eb2('0x35')]({'where':{'FaxAccountId':_0x29a842['body']['id']},'transaction':_0x178480})[_0x1eb2('0x32')](function(_0x32a279){return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_[_0x1eb2('0x70')](_0x29a842[_0x1eb2('0x57')],[_0x1eb2('0x97'),_0x1eb2('0x98'),_0x1eb2('0x99'),_0x1eb2('0x9a'),_0x1eb2('0x9b'),_0x1eb2('0x9c')])),{'transaction':_0x178480});});});})[_0x1eb2('0x32')](function(){return db[_0x1eb2('0x3d')][_0x1eb2('0x9d')](_0x29a842[_0x1eb2('0x57')]['id']);})['then'](respondWithResult(_0x4594e7,null))[_0x1eb2('0x26')](handleError(_0x4594e7,null));};exports['getMessages']=function(_0x19631a,_0x27fead,_0x3030bd){var _0x2cc494={'raw':!![],'where':{}};var _0x8bb3f={};var _0x3201f9={'count':0x0,'rows':[]};return db[_0x1eb2('0x3d')][_0x1eb2('0x66')]({'where':{'id':_0x19631a[_0x1eb2('0x60')]['id']}})[_0x1eb2('0x32')](handleEntityNotFound(_0x27fead,null))[_0x1eb2('0x32')](function(_0x5de0b2){if(_0x5de0b2){_0x8bb3f[_0x1eb2('0x40')]=_['keys'](db[_0x1eb2('0x9e')]['rawAttributes']);_0x8bb3f['query']=_[_0x1eb2('0x41')](_0x19631a[_0x1eb2('0x42')]);_0x8bb3f[_0x1eb2('0x4b')]=_[_0x1eb2('0x43')](_0x8bb3f['model'],_0x8bb3f[_0x1eb2('0x42')]);_0x2cc494[_0x1eb2('0x44')]=_[_0x1eb2('0x43')](_0x8bb3f[_0x1eb2('0x40')],qs[_0x1eb2('0x45')](_0x19631a[_0x1eb2('0x42')][_0x1eb2('0x45')]));_0x2cc494[_0x1eb2('0x44')]=_0x2cc494[_0x1eb2('0x44')][_0x1eb2('0x46')]?_0x2cc494[_0x1eb2('0x44')]:_0x8bb3f[_0x1eb2('0x40')];if(!_0x19631a[_0x1eb2('0x42')][_0x1eb2('0x47')](_0x1eb2('0x6d'))){_0x2cc494[_0x1eb2('0x2c')]=qs[_0x1eb2('0x2c')](_0x19631a[_0x1eb2('0x42')][_0x1eb2('0x2c')]);_0x2cc494[_0x1eb2('0x2a')]=qs[_0x1eb2('0x2a')](_0x19631a[_0x1eb2('0x42')][_0x1eb2('0x2a')]);}_0x2cc494['order']=qs[_0x1eb2('0x49')](_0x19631a[_0x1eb2('0x42')]['sort']);_0x2cc494[_0x1eb2('0x4a')]=qs[_0x1eb2('0x4b')](_[_0x1eb2('0x4c')](_0x19631a['query'],_0x8bb3f[_0x1eb2('0x4b')]));_0x2cc494['where'][_0x1eb2('0x63')]=_0x5de0b2['id'];if(_0x19631a[_0x1eb2('0x42')]['filter']){_0x2cc494[_0x1eb2('0x4a')]=_[_0x1eb2('0x4e')](_0x2cc494[_0x1eb2('0x4a')],{'$or':_[_0x1eb2('0x3c')](_0x2cc494[_0x1eb2('0x44')],function(_0x4e7a05){var _0x5ca6f8={};_0x5ca6f8[_0x4e7a05]={'$like':'%'+_0x19631a[_0x1eb2('0x42')][_0x1eb2('0x4d')]+'%'};return _0x5ca6f8;})});}if(_0x19631a[_0x1eb2('0x42')]['$gte']){var _0x4f0b7d=_0x19631a[_0x1eb2('0x42')]['$gte'][_0x1eb2('0x9f')](',');var _0x551c7d={};_0x551c7d[_0x4f0b7d[0x0]]={'$gte':moment(_0x4f0b7d[0x1])[_0x1eb2('0xa0')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2cc494[_0x1eb2('0x4a')]=_[_0x1eb2('0x4e')](_0x2cc494[_0x1eb2('0x4a')],_0x551c7d);}_0x2cc494=_['merge']({},_0x2cc494,_0x19631a[_0x1eb2('0x50')]);return db[_0x1eb2('0x9e')][_0x1eb2('0x2d')]({'where':_0x2cc494[_0x1eb2('0x4a')]})[_0x1eb2('0x32')](function(_0xe18d52){_0x3201f9[_0x1eb2('0x2d')]=_0xe18d52;if(_0x19631a[_0x1eb2('0x42')][_0x1eb2('0x51')]){_0x2cc494[_0x1eb2('0x52')]=[{'all':!![]}];}return db[_0x1eb2('0x9e')][_0x1eb2('0x67')](_0x2cc494);})['then'](function(_0x35a0d4){_0x3201f9[_0x1eb2('0x53')]=_0x35a0d4;return _0x3201f9;});}})[_0x1eb2('0x32')](respondWithFilteredResult(_0x27fead,_0x2cc494))[_0x1eb2('0x26')](handleError(_0x27fead,null));};exports[_0x1eb2('0x38')]=function(_0x22ea1d,_0x58946d,_0x4afe12){var _0x206111,_0x449398={},_0x1053dd;if(_0x22ea1d['body']['to']){_0x1053dd=_0x22ea1d['body']['to'][0x0];}return db['FaxAccount'][_0x1eb2('0x55')]({'where':{'id':_0x22ea1d[_0x1eb2('0x60')]['id']},'include':[{'model':db['CmList'],'as':_0x1eb2('0xa1'),'include':[{'model':db[_0x1eb2('0xa2')],'as':_0x1eb2('0xa3'),'where':{'fax':_0x1053dd},'limit':0x1,'order':[[_0x1eb2('0x9a'),_0x1eb2('0xa4')]]}]}]})[_0x1eb2('0x32')](handleEntityNotFound(_0x58946d,null))[_0x1eb2('0x32')](function(_0x382df4){_0x206111=_0x382df4;if(_0x22ea1d[_0x1eb2('0x57')][_0x1eb2('0xa5')]&&_0x22ea1d[_0x1eb2('0x57')][_0x1eb2('0xa5')][_0x1eb2('0x46')]){for(var _0x1f9d1d=0x0;_0x1f9d1d<_0x22ea1d[_0x1eb2('0x57')][_0x1eb2('0xa5')]['length'];_0x1f9d1d+=0x1){_0x22ea1d[_0x1eb2('0x57')][_0x1eb2('0xa5')][_0x1f9d1d]={'filename':_0x22ea1d[_0x1eb2('0x57')][_0x1eb2('0xa5')][_0x1f9d1d]['name'],'id':_0x22ea1d[_0x1eb2('0x57')][_0x1eb2('0xa5')][_0x1f9d1d]['id'],'path':path['join'](config[_0x1eb2('0xa6')],_0x1eb2('0xa7'),_0x22ea1d[_0x1eb2('0x57')][_0x1eb2('0xa5')][_0x1f9d1d][_0x1eb2('0xa8')])};}}return respondWithRpcPromise(_0x1eb2('0xa9'),_0x1eb2('0xa9'),{'FaxAccountId':_['isNil'](_0x22ea1d[_0x1eb2('0x60')]['id'])?undefined:_0x22ea1d['params']['id'],'path':_[_0x1eb2('0xaa')](_0x22ea1d[_0x1eb2('0x57')][_0x1eb2('0xa5')][0x0]['path'])?undefined:_0x22ea1d['body'][_0x1eb2('0xa5')][0x0]['path'],'fax':_[_0x1eb2('0xaa')](_0x22ea1d[_0x1eb2('0x57')]['to'][0x0])?undefined:_0x22ea1d[_0x1eb2('0x57')]['to'][0x0]},client9002);})[_0x1eb2('0x32')](function(){if(_0x206111){if(_[_0x1eb2('0xaa')](_0x22ea1d[_0x1eb2('0x57')][_0x1eb2('0xab')])){_0x22ea1d[_0x1eb2('0x57')][_0x1eb2('0xab')]=util[_0x1eb2('0xa0')](_0x1eb2('0xac'),_0x206111[_0x1eb2('0x37')],_0x206111[_0x1eb2('0xad')]);}if(_0x206111['List']){if(_0x206111[_0x1eb2('0xa1')][_0x1eb2('0xa3')][_0x1eb2('0x46')]){return _0x206111[_0x1eb2('0xa1')][_0x1eb2('0xa3')][0x0];}else{return db[_0x1eb2('0xa2')]['create'](_[_0x1eb2('0x19')](_0x22ea1d[_0x1eb2('0x57')],{'firstName':_0x22ea1d[_0x1eb2('0x57')]['to'][0x0],'phone':_0x22ea1d[_0x1eb2('0x57')]['to'][0x0],'fax':_0x22ea1d[_0x1eb2('0x57')]['to'][0x0],'ListId':_0x206111['ListId']}));}}else{throw new Error(_0x1eb2('0xae'));}}else{throw new Error(_0x1eb2('0xaf'));}})[_0x1eb2('0x32')](function(_0x217831){if(_0x217831){return db[_0x1eb2('0x72')][_0x1eb2('0x55')]({'where':{'ContactId':_0x217831['id'],'closed':![],'FaxAccountId':_0x206111['id']}})['then'](function(_0xb4ca1e){if(_0xb4ca1e){return[_0xb4ca1e,![]];}return db[_0x1eb2('0x72')][_0x1eb2('0x56')]({'UserId':_0x22ea1d[_0x1eb2('0x58')]['id'],'ContactId':_0x217831['id'],'FaxAccountId':_0x206111['id'],'fax':_0x22ea1d[_0x1eb2('0x57')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x1eb2('0x4e')](_0x22ea1d[_0x1eb2('0x57')],{'read':![],'body':_0x22ea1d[_0x1eb2('0x57')][_0x1eb2('0xa5')][0x0]['filename'],'FaxAccountId':_0x206111['id'],'UserId':_0x22ea1d[_0x1eb2('0x58')]['id'],'ContactId':_0x217831['id'],'AttachmentId':_0x22ea1d[_0x1eb2('0x57')][_0x1eb2('0xa5')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x1eb2('0xb0')}]})[_0x1eb2('0x32')](function(_0x3d093b){return[_0x3d093b,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x1eb2('0xb1')](function(_0x474164,_0x323deb){if(_0x323deb){return _0x474164;}return db[_0x1eb2('0x9e')][_0x1eb2('0x56')]({'direction':_0x1eb2('0xb2'),'read':![],'body':_0x22ea1d['body'][_0x1eb2('0xa5')][0x0][_0x1eb2('0xb3')],'FaxAccountId':_0x206111['id'],'FaxInteractionId':_0x474164['id'],'UserId':_0x22ea1d[_0x1eb2('0x58')]['id'],'ContactId':_0x474164['ContactId'],'AttachmentId':_0x22ea1d[_0x1eb2('0x57')][_0x1eb2('0xa5')][0x0]['id']})['then'](function(_0x5fdbfc){_0x474164[_0x1eb2('0xb4')]['Messages']=[];_0x474164[_0x1eb2('0xb4')][_0x1eb2('0xb0')][_0x1eb2('0x8a')](_0x5fdbfc[_0x1eb2('0xb4')]);return _0x474164;});})[_0x1eb2('0x32')](function(_0x1a071f){respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_[_0x1eb2('0xaa')](_0x22ea1d['params']['id'])?undefined:_0x22ea1d[_0x1eb2('0x60')]['id'],'path':_['isNil'](_0x22ea1d[_0x1eb2('0x57')]['attachments'][0x0][_0x1eb2('0xb5')])?undefined:_0x22ea1d[_0x1eb2('0x57')]['attachments'][0x0]['path'],'fax':_['isNil'](_0x22ea1d['body']['to'][0x0])?undefined:_0x22ea1d['body']['to'][0x0],'AttachmentId':_0x22ea1d[_0x1eb2('0x57')]['attachments'][0x0]['id']},client9002)['then'](function(_0x5288d8){logger['info'](_0x1eb2('0xb6'),_0x5288d8);})[_0x1eb2('0x26')](function(_0x5ecb6f){logger[_0x1eb2('0x1e')](_0x1eb2('0xb6'),_0x5ecb6f);});return _0x1a071f;})[_0x1eb2('0x32')](respondWithResult(_0x58946d,null))['catch'](handleError(_0x58946d,null));};exports[_0x1eb2('0xb7')]=function(_0x941de2,_0x575ed0,_0x436f55){return db[_0x1eb2('0x3d')]['find']({'where':{'id':_0x941de2[_0x1eb2('0x60')]['id']}})[_0x1eb2('0x32')](handleEntityNotFound(_0x575ed0,null))[_0x1eb2('0x32')](function(_0x3877a5){if(_0x3877a5){return _0x3877a5[_0x1eb2('0xb7')](_0x941de2[_0x1eb2('0x57')][_0x1eb2('0x69')],_[_0x1eb2('0x70')](_0x941de2['body'],[_0x1eb2('0x69'),'id'])||{})[_0x1eb2('0xb1')](function(_0x15b839){for(var _0x201eac=0x0;_0x201eac<_0x941de2['body'][_0x1eb2('0x69')][_0x1eb2('0x46')];_0x201eac+=0x1){socket[_0x1eb2('0xb8')]('userFaxAccount:save',{'UserId':Number(_0x941de2[_0x1eb2('0x57')][_0x1eb2('0x69')][_0x201eac]),'FaxAccountId':Number(_0x941de2[_0x1eb2('0x60')]['id'])});}return _0x15b839;});}})['then'](respondWithResult(_0x575ed0,null))['catch'](handleError(_0x575ed0,null));};exports['removeAgents']=function(_0x12f49c,_0x5c754e,_0x499176){return db[_0x1eb2('0x3d')][_0x1eb2('0x55')]({'where':{'id':_0x12f49c[_0x1eb2('0x60')]['id']}})[_0x1eb2('0x32')](handleEntityNotFound(_0x5c754e,null))[_0x1eb2('0x32')](function(_0x4e7cf4){if(_0x4e7cf4){return _0x4e7cf4[_0x1eb2('0xb9')](_0x12f49c[_0x1eb2('0x42')][_0x1eb2('0x69')])[_0x1eb2('0x32')](function(){if(_[_0x1eb2('0xba')](_0x12f49c[_0x1eb2('0x42')]['ids'])){for(var _0x1b2217=0x0;_0x1b2217<_0x12f49c['query'][_0x1eb2('0x69')][_0x1eb2('0x46')];_0x1b2217+=0x1){socket[_0x1eb2('0xb8')]('userFaxAccount:remove',{'UserId':Number(_0x12f49c['query'][_0x1eb2('0x69')][_0x1b2217]),'FaxAccountId':Number(_0x12f49c[_0x1eb2('0x60')]['id'])});}}else{socket[_0x1eb2('0xb8')]('userFaxAccount:remove',{'UserId':Number(_0x12f49c['query'][_0x1eb2('0x69')]),'FaxAccountId':Number(_0x12f49c[_0x1eb2('0x60')]['id'])});}});}})['then'](respondWithStatusCode(_0x5c754e,null))['catch'](handleError(_0x5c754e,null));};exports[_0x1eb2('0xbb')]=function(_0x4e8737,_0x5ceeea,_0x1a3181){var _0x24a4c5={};var _0x57015e={};var _0x2daf18;var _0x5c8a5e;return db['FaxAccount']['findOne']({'where':{'id':_0x4e8737[_0x1eb2('0x60')]['id']}})[_0x1eb2('0x32')](handleEntityNotFound(_0x5ceeea,null))[_0x1eb2('0x32')](function(_0x523f13){if(_0x523f13){_0x2daf18=_0x523f13;_0x57015e[_0x1eb2('0x40')]=_[_0x1eb2('0x41')](db[_0x1eb2('0x73')][_0x1eb2('0x3e')]);_0x57015e[_0x1eb2('0x42')]=_[_0x1eb2('0x41')](_0x4e8737[_0x1eb2('0x42')]);_0x57015e[_0x1eb2('0x4b')]=_['intersection'](_0x57015e[_0x1eb2('0x40')],_0x57015e['query']);_0x24a4c5[_0x1eb2('0x44')]=_[_0x1eb2('0x43')](_0x57015e[_0x1eb2('0x40')],qs['fields'](_0x4e8737['query'][_0x1eb2('0x45')]));_0x24a4c5['attributes']=_0x24a4c5[_0x1eb2('0x44')][_0x1eb2('0x46')]?_0x24a4c5[_0x1eb2('0x44')]:_0x57015e[_0x1eb2('0x40')];_0x24a4c5['order']=qs[_0x1eb2('0x49')](_0x4e8737[_0x1eb2('0x42')][_0x1eb2('0x49')]);_0x24a4c5['where']=qs[_0x1eb2('0x4b')](_['pick'](_0x4e8737['query'],_0x57015e[_0x1eb2('0x4b')]));if(_0x4e8737['query']['filter']){_0x24a4c5['where']=_[_0x1eb2('0x4e')](_0x24a4c5['where'],{'$or':_[_0x1eb2('0x3c')](_0x24a4c5[_0x1eb2('0x44')],function(_0x89c3bc){var _0x283f0b={};_0x283f0b[_0x89c3bc]={'$like':'%'+_0x4e8737['query'][_0x1eb2('0x4d')]+'%'};return _0x283f0b;})});}_0x24a4c5=_[_0x1eb2('0x4e')]({},_0x24a4c5,_0x4e8737[_0x1eb2('0x50')]);return _0x2daf18[_0x1eb2('0xbb')](_0x24a4c5);}})[_0x1eb2('0x32')](function(_0x1a3fb1){if(_0x1a3fb1){_0x5c8a5e=_0x1a3fb1[_0x1eb2('0x46')];if(!_0x4e8737['query'][_0x1eb2('0x47')](_0x1eb2('0x6d'))){_0x24a4c5[_0x1eb2('0x2c')]=qs['limit'](_0x4e8737['query']['limit']);_0x24a4c5[_0x1eb2('0x2a')]=qs['offset'](_0x4e8737[_0x1eb2('0x42')][_0x1eb2('0x2a')]);}return _0x2daf18[_0x1eb2('0xbb')](_0x24a4c5);}})['then'](function(_0x2b5c03){if(_0x2b5c03){return _0x2b5c03?{'count':_0x5c8a5e,'rows':_0x2b5c03}:null;}})[_0x1eb2('0x32')](respondWithResult(_0x5ceeea,null))[_0x1eb2('0x26')](handleError(_0x5ceeea,null));}; \ No newline at end of file +var _0xd250=['fullname','internal','Tag','Tags','color','tag','sequelize','transaction','READ_COMMITTED','FaxApplication','finally','sendStatus','send','getApplications','app','description','Fax\x20Extension','priority','appdata','Answer','CDR(type)=inbound-fax','Set','ecm','localstationid','gateway','faxdetect','headerinfo','maxrate','modem','t38timeout','push','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','bulkCreate','tech','key','TrunkId','ListId','findById','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','CmContact','Contacts','updatedAt','DESC','attachments','root','CheckAfterSend','isNil','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','Send\x20Fax\x20failed','out','Contact\x20not\x20found','spread','filename','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','emit','removeAgents','isArray','userFaxAccount:remove','getAgents','User','eml-format','rimraf','zip-dir','request-promise','mustache','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','http','client','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','FaxAccount','rawAttributes','fieldName','model','map','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','rows','show','params','keys','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','body','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','hasOwnProperty','nolimit','merge','removeDispositions','ids','CannedAnswer','getAnswers','findAll','removeAnswers','FaxInteraction','addInteraction','omit','Contact','Owner'];(function(_0xe99beb,_0x34ded7){var _0x496ba5=function(_0x5ca9f4){while(--_0x5ca9f4){_0xe99beb['push'](_0xe99beb['shift']());}};_0x496ba5(++_0x34ded7);}(_0xd250,0x10f));var _0x0d25=function(_0x3fb030,_0x12aebe){_0x3fb030=_0x3fb030-0x0;var _0xd6899b=_0xd250[_0x3fb030];return _0xd6899b;};'use strict';var emlformat=require(_0x0d25('0x0'));var rimraf=require(_0x0d25('0x1'));var zipdir=require(_0x0d25('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0d25('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0d25('0x4'));var util=require('util');var path=require(_0x0d25('0x5'));var sox=require('sox');var csv=require(_0x0d25('0x6'));var ejs=require(_0x0d25('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0d25('0x8'));var squel=require('squel');var crypto=require(_0x0d25('0x9'));var jsforce=require(_0x0d25('0xa'));var deskjs=require(_0x0d25('0xb'));var toCsv=require(_0x0d25('0x6'));var querystring=require(_0x0d25('0xc'));var Papa=require(_0x0d25('0xd'));var Redis=require(_0x0d25('0xe'));var authService=require(_0x0d25('0xf'));var qs=require(_0x0d25('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0d25('0x11'));var logger=require(_0x0d25('0x12'))(_0x0d25('0x13'));var utils=require('../../config/utils');var config=require(_0x0d25('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x0d25('0x15'))['db'];config[_0x0d25('0x16')]=_[_0x0d25('0x17')](config[_0x0d25('0x16')],{'host':_0x0d25('0x18'),'port':0x18eb});var socket=require(_0x0d25('0x19'))(new Redis(config['redis']));require(_0x0d25('0x1a'))[_0x0d25('0x1b')](socket);var jayson=require(_0x0d25('0x1c'));var client=jayson['client'][_0x0d25('0x1d')]({'port':0x232c});var client9002=jayson[_0x0d25('0x1e')][_0x0d25('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x15401a,_0x2e0c63,_0x914f86,_0x36d5fb){return new BPromise(function(_0x2cdc20,_0xe57e4b){var _0x1715a4=_0x36d5fb||client;return _0x1715a4['request'](_0x15401a,_0x914f86)[_0x0d25('0x1f')](function(_0x3ae9a5){logger[_0x0d25('0x20')](_0x0d25('0x21'),_0x2e0c63,'request\x20sent');logger[_0x0d25('0x22')](_0x0d25('0x23'),_0x2e0c63,'request\x20sent',JSON['stringify'](_0x3ae9a5));if(_0x3ae9a5[_0x0d25('0x24')]){if(_0x3ae9a5[_0x0d25('0x24')][_0x0d25('0x25')]===0x1f4){logger[_0x0d25('0x24')]('FaxAccount,\x20%s,\x20%s',_0x2e0c63,_0x3ae9a5['error']['message']);return _0xe57e4b(_0x3ae9a5[_0x0d25('0x24')][_0x0d25('0x26')]);}logger[_0x0d25('0x24')](_0x0d25('0x21'),_0x2e0c63,_0x3ae9a5[_0x0d25('0x24')]['message']);return _0x2cdc20(_0x3ae9a5[_0x0d25('0x24')]['message']);}else{logger[_0x0d25('0x20')]('FaxAccount,\x20%s,\x20%s',_0x2e0c63,_0x0d25('0x27'));_0x2cdc20(_0x3ae9a5[_0x0d25('0x28')][_0x0d25('0x26')]);}})[_0x0d25('0x29')](function(_0x2cce3b){logger['error'](_0x0d25('0x21'),_0x2e0c63,_0x2cce3b);_0xe57e4b(_0x2cce3b);});});}function respondWithStatusCode(_0x511997,_0x4de503){_0x4de503=_0x4de503||0xcc;return function(_0x129be3){if(_0x129be3){return _0x511997['sendStatus'](_0x4de503);}return _0x511997[_0x0d25('0x2a')](_0x4de503)[_0x0d25('0x2b')]();};}function respondWithResult(_0x13367f,_0x5b65aa){_0x5b65aa=_0x5b65aa||0xc8;return function(_0x3dd30b){if(_0x3dd30b){return _0x13367f[_0x0d25('0x2a')](_0x5b65aa)[_0x0d25('0x2c')](_0x3dd30b);}};}function respondWithFilteredResult(_0x1f025a,_0x595438){return function(_0x461841){if(_0x461841){var _0x51289a=typeof _0x595438[_0x0d25('0x2d')]==='undefined'&&typeof _0x595438[_0x0d25('0x2e')]===_0x0d25('0x2f');var _0x78ec19=_0x461841[_0x0d25('0x30')];var _0x54a546=_0x51289a?0x0:_0x595438['offset'];var _0x5cb377=_0x51289a?_0x461841[_0x0d25('0x30')]:_0x595438[_0x0d25('0x2d')]+_0x595438['limit'];var _0xbffd4d;if(_0x5cb377>=_0x78ec19){_0x5cb377=_0x78ec19;_0xbffd4d=0xc8;}else{_0xbffd4d=0xce;}_0x1f025a[_0x0d25('0x2a')](_0xbffd4d);return _0x1f025a['set'](_0x0d25('0x31'),_0x54a546+'-'+_0x5cb377+'/'+_0x78ec19)['json'](_0x461841);}return null;};}function patchUpdates(_0x238bdf){return function(_0x5017ef){try{jsonpatch[_0x0d25('0x32')](_0x5017ef,_0x238bdf,!![]);}catch(_0x32da07){return BPromise[_0x0d25('0x33')](_0x32da07);}return _0x5017ef[_0x0d25('0x34')]();};}function saveUpdates(_0x125326,_0x536b07){return function(_0xd17f07){if(_0xd17f07){return _0xd17f07[_0x0d25('0x35')](_0x125326)[_0x0d25('0x1f')](function(_0x58200d){return _0x58200d;});}return null;};}function removeEntity(_0x3e3d90,_0x192ed9){return function(_0x42fbb2){if(_0x42fbb2){return _0x42fbb2[_0x0d25('0x36')]()[_0x0d25('0x1f')](function(){var _0x1b128a=_0x42fbb2[_0x0d25('0x37')]({'plain':!![]});var _0x197ba0=_0x0d25('0x38');return db[_0x0d25('0x39')][_0x0d25('0x36')]({'where':{'type':_0x197ba0,'resourceId':_0x1b128a['id']}})[_0x0d25('0x1f')](function(){return _0x42fbb2;});})[_0x0d25('0x1f')](function(){_0x3e3d90[_0x0d25('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e2e5e,_0x23667d){return function(_0x304c5d){if(!_0x304c5d){_0x1e2e5e['sendStatus'](0x194);}return _0x304c5d;};}function handleError(_0xd779e2,_0x4357e4){_0x4357e4=_0x4357e4||0x1f4;return function(_0x12402e){logger[_0x0d25('0x24')](_0x12402e[_0x0d25('0x3a')]);if(_0x12402e[_0x0d25('0x3b')]){delete _0x12402e[_0x0d25('0x3b')];}_0xd779e2[_0x0d25('0x2a')](_0x4357e4)['send'](_0x12402e);};}exports[_0x0d25('0x3c')]=function(_0x3ae29e,_0x1f04b6){var _0x34936c={'include':[{'model':db[_0x0d25('0x3d')],'as':_0x0d25('0x3e')}]},_0x28ec6c={},_0x2b80c5={'count':0x0,'rows':[]};var _0x1c95e0=_['map'](db[_0x0d25('0x3f')][_0x0d25('0x40')],function(_0x5d3911){return{'name':_0x5d3911[_0x0d25('0x41')],'type':_0x5d3911['type']['key']};});_0x28ec6c[_0x0d25('0x42')]=_[_0x0d25('0x43')](_0x1c95e0,_0x0d25('0x3b'));_0x28ec6c[_0x0d25('0x44')]=_['keys'](_0x3ae29e[_0x0d25('0x44')]);_0x28ec6c[_0x0d25('0x45')]=_[_0x0d25('0x46')](_0x28ec6c[_0x0d25('0x42')],_0x28ec6c[_0x0d25('0x44')]);_0x34936c[_0x0d25('0x47')]=_[_0x0d25('0x46')](_0x28ec6c[_0x0d25('0x42')],qs[_0x0d25('0x48')](_0x3ae29e[_0x0d25('0x44')][_0x0d25('0x48')]));_0x34936c[_0x0d25('0x47')]=_0x34936c[_0x0d25('0x47')][_0x0d25('0x49')]?_0x34936c[_0x0d25('0x47')]:_0x28ec6c[_0x0d25('0x42')];if(!_0x3ae29e[_0x0d25('0x44')]['hasOwnProperty']('nolimit')){_0x34936c['limit']=qs['limit'](_0x3ae29e[_0x0d25('0x44')][_0x0d25('0x2e')]);_0x34936c['offset']=qs[_0x0d25('0x2d')](_0x3ae29e[_0x0d25('0x44')]['offset']);}_0x34936c[_0x0d25('0x4a')]=qs[_0x0d25('0x4b')](_0x3ae29e[_0x0d25('0x44')][_0x0d25('0x4b')]);_0x34936c[_0x0d25('0x4c')]=qs[_0x0d25('0x45')](_[_0x0d25('0x4d')](_0x3ae29e[_0x0d25('0x44')],_0x28ec6c[_0x0d25('0x45')]),_0x1c95e0);if(_0x3ae29e[_0x0d25('0x44')][_0x0d25('0x4e')]){_0x34936c['where']=_['merge'](_0x34936c[_0x0d25('0x4c')],{'$or':_[_0x0d25('0x43')](_0x1c95e0,function(_0x2da500){if(_0x2da500[_0x0d25('0x4f')]!==_0x0d25('0x50')){var _0x4f686f={};_0x4f686f[_0x2da500[_0x0d25('0x3b')]]={'$like':'%'+_0x3ae29e[_0x0d25('0x44')]['filter']+'%'};return _0x4f686f;}})});}_0x34936c=_['merge']({},_0x34936c,_0x3ae29e[_0x0d25('0x51')]);var _0x1b9ab6={'where':_0x34936c['where']};return db[_0x0d25('0x3f')][_0x0d25('0x30')](_0x1b9ab6)[_0x0d25('0x1f')](function(_0x4079e7){_0x2b80c5[_0x0d25('0x30')]=_0x4079e7;if(_0x3ae29e[_0x0d25('0x44')][_0x0d25('0x52')]){_0x34936c[_0x0d25('0x53')]=[{'all':!![]}];}return db['FaxAccount']['findAll'](_0x34936c);})['then'](function(_0x1afc42){_0x2b80c5[_0x0d25('0x54')]=_0x1afc42;return _0x2b80c5;})[_0x0d25('0x1f')](respondWithFilteredResult(_0x1f04b6,_0x34936c))[_0x0d25('0x29')](handleError(_0x1f04b6,null));};exports[_0x0d25('0x55')]=function(_0x25766b,_0x12b2b3){var _0x185b46={'raw':![],'where':{'id':_0x25766b[_0x0d25('0x56')]['id']},'include':[{'model':db[_0x0d25('0x3d')],'as':_0x0d25('0x3e')}]},_0xe27ed2={};_0xe27ed2[_0x0d25('0x42')]=_['keys'](db[_0x0d25('0x3f')][_0x0d25('0x40')]);_0xe27ed2[_0x0d25('0x44')]=_[_0x0d25('0x57')](_0x25766b[_0x0d25('0x44')]);_0xe27ed2[_0x0d25('0x45')]=_['intersection'](_0xe27ed2[_0x0d25('0x42')],_0xe27ed2[_0x0d25('0x44')]);_0x185b46[_0x0d25('0x47')]=_[_0x0d25('0x46')](_0xe27ed2[_0x0d25('0x42')],qs[_0x0d25('0x48')](_0x25766b[_0x0d25('0x44')][_0x0d25('0x48')]));_0x185b46[_0x0d25('0x47')]=_0x185b46['attributes'][_0x0d25('0x49')]?_0x185b46[_0x0d25('0x47')]:_0xe27ed2[_0x0d25('0x42')];if(_0x25766b[_0x0d25('0x44')]['includeAll']){_0x185b46[_0x0d25('0x53')]=[{'all':!![]}];}_0x185b46=_['merge']({},_0x185b46,_0x25766b[_0x0d25('0x51')]);return db[_0x0d25('0x3f')]['find'](_0x185b46)[_0x0d25('0x1f')](handleEntityNotFound(_0x12b2b3,null))[_0x0d25('0x1f')](respondWithResult(_0x12b2b3,null))[_0x0d25('0x29')](handleError(_0x12b2b3,null));};exports[_0x0d25('0x58')]=function(_0x49de2f,_0x15122d){return db['FaxAccount'][_0x0d25('0x58')](_0x49de2f['body'],{})[_0x0d25('0x1f')](function(_0x348d7a){var _0x575e51=_0x49de2f['user'][_0x0d25('0x37')]({'plain':!![]});if(!_0x575e51)throw new Error(_0x0d25('0x59'));if(_0x575e51[_0x0d25('0x5a')]===_0x0d25('0x5b')){var _0x56a174=_0x348d7a[_0x0d25('0x37')]({'plain':!![]});var _0x5177f2=_0x0d25('0x38');return db[_0x0d25('0x5c')][_0x0d25('0x5d')]({'where':{'name':_0x5177f2,'userProfileId':_0x575e51[_0x0d25('0x5e')]},'raw':!![]})['then'](function(_0x5b1d38){if(_0x5b1d38&&_0x5b1d38[_0x0d25('0x5f')]===0x0){return db[_0x0d25('0x39')]['create']({'name':_0x56a174[_0x0d25('0x3b')],'resourceId':_0x56a174['id'],'type':_0x5b1d38[_0x0d25('0x3b')],'sectionId':_0x5b1d38['id']},{})['then'](function(){return _0x348d7a;});}else{return _0x348d7a;}})[_0x0d25('0x29')](function(_0x154eb5){logger[_0x0d25('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x154eb5);throw _0x154eb5;});}return _0x348d7a;})[_0x0d25('0x1f')](respondWithResult(_0x15122d,0xc9))[_0x0d25('0x29')](handleError(_0x15122d,null));};exports[_0x0d25('0x35')]=function(_0x40007d,_0x4c9011){if(_0x40007d[_0x0d25('0x60')]['id']){delete _0x40007d[_0x0d25('0x60')]['id'];}return db[_0x0d25('0x3f')][_0x0d25('0x5d')]({'where':{'id':_0x40007d[_0x0d25('0x56')]['id']},'include':[{'model':db[_0x0d25('0x3d')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x4c9011,null))['then'](saveUpdates(_0x40007d[_0x0d25('0x60')],null))['then'](respondWithResult(_0x4c9011,null))[_0x0d25('0x29')](handleError(_0x4c9011,null));};exports[_0x0d25('0x36')]=function(_0x5b41b0,_0x1691f9){return db[_0x0d25('0x3f')][_0x0d25('0x5d')]({'where':{'id':_0x5b41b0['params']['id']}})[_0x0d25('0x1f')](handleEntityNotFound(_0x1691f9,null))['then'](removeEntity(_0x1691f9,null))['catch'](handleError(_0x1691f9,null));};exports[_0x0d25('0x61')]=function(_0x333d69,_0xe08220){return db['FaxAccount'][_0x0d25('0x61')]()['then'](respondWithResult(_0xe08220,null))['catch'](handleError(_0xe08220,null));};exports[_0x0d25('0x62')]=function(_0x205971,_0x507ad3,_0x5079cd){if(_0x205971[_0x0d25('0x60')]['id']){delete _0x205971[_0x0d25('0x60')]['id'];}return db[_0x0d25('0x3f')][_0x0d25('0x5d')]({'where':{'id':_0x205971[_0x0d25('0x56')]['id']}})['then'](handleEntityNotFound(_0x507ad3,null))[_0x0d25('0x1f')](function(_0x47ecd8){if(_0x47ecd8){_0x205971['body'][_0x0d25('0x63')]=_0x47ecd8['id'];return db[_0x0d25('0x64')]['create'](_0x205971[_0x0d25('0x60')]);}})[_0x0d25('0x1f')](respondWithResult(_0x507ad3,null))[_0x0d25('0x29')](handleError(_0x507ad3,null));};exports[_0x0d25('0x65')]=function(_0x48f08c,_0xd6c759,_0x77f7d6){var _0x10b21c={'raw':![],'where':{}};var _0x42ff99={};var _0x3abceb={'count':0x0,'rows':[]};return db[_0x0d25('0x3f')][_0x0d25('0x66')]({'where':{'id':_0x48f08c[_0x0d25('0x56')]['id']}})['then'](handleEntityNotFound(_0xd6c759,null))[_0x0d25('0x1f')](function(_0x55fed2){if(_0x55fed2){_0x42ff99[_0x0d25('0x42')]=_[_0x0d25('0x57')](db['Disposition'][_0x0d25('0x40')]);_0x42ff99['query']=_[_0x0d25('0x57')](_0x48f08c[_0x0d25('0x44')]);_0x42ff99[_0x0d25('0x45')]=_[_0x0d25('0x46')](_0x42ff99['model'],_0x42ff99[_0x0d25('0x44')]);_0x10b21c[_0x0d25('0x47')]=_['intersection'](_0x42ff99['model'],qs[_0x0d25('0x48')](_0x48f08c[_0x0d25('0x44')][_0x0d25('0x48')]));_0x10b21c[_0x0d25('0x47')]=_0x10b21c[_0x0d25('0x47')]['length']?_0x10b21c[_0x0d25('0x47')]:_0x42ff99[_0x0d25('0x42')];if(!_0x48f08c[_0x0d25('0x44')][_0x0d25('0x67')](_0x0d25('0x68'))){_0x10b21c[_0x0d25('0x2e')]=qs['limit'](_0x48f08c[_0x0d25('0x44')][_0x0d25('0x2e')]);_0x10b21c[_0x0d25('0x2d')]=qs[_0x0d25('0x2d')](_0x48f08c[_0x0d25('0x44')]['offset']);}_0x10b21c[_0x0d25('0x4a')]=qs[_0x0d25('0x4b')](_0x48f08c[_0x0d25('0x44')][_0x0d25('0x4b')]);_0x10b21c[_0x0d25('0x4c')]=qs[_0x0d25('0x45')](_[_0x0d25('0x4d')](_0x48f08c[_0x0d25('0x44')],_0x42ff99['filters']));_0x10b21c[_0x0d25('0x4c')][_0x0d25('0x63')]=_0x55fed2['id'];if(_0x48f08c[_0x0d25('0x44')][_0x0d25('0x4e')]){_0x10b21c[_0x0d25('0x4c')]=_[_0x0d25('0x69')](_0x10b21c[_0x0d25('0x4c')],{'$or':_[_0x0d25('0x43')](_0x10b21c[_0x0d25('0x47')],function(_0x504ace){var _0x2fefb4={};_0x2fefb4[_0x504ace]={'$like':'%'+_0x48f08c[_0x0d25('0x44')][_0x0d25('0x4e')]+'%'};return _0x2fefb4;})});}_0x10b21c=_['merge']({},_0x10b21c,_0x48f08c['options']);return db[_0x0d25('0x64')][_0x0d25('0x30')]({'where':_0x10b21c[_0x0d25('0x4c')]})[_0x0d25('0x1f')](function(_0xd2e7df){_0x3abceb[_0x0d25('0x30')]=_0xd2e7df;if(_0x48f08c['query'][_0x0d25('0x52')]){_0x10b21c[_0x0d25('0x53')]=[{'all':!![]}];}return db[_0x0d25('0x64')]['findAll'](_0x10b21c);})[_0x0d25('0x1f')](function(_0x5a583e){_0x3abceb['rows']=_0x5a583e;return _0x3abceb;});}})[_0x0d25('0x1f')](respondWithFilteredResult(_0xd6c759,_0x10b21c))[_0x0d25('0x29')](handleError(_0xd6c759,null));};exports[_0x0d25('0x6a')]=function(_0x15989d,_0x1f22ed,_0x46f430){return db[_0x0d25('0x3f')][_0x0d25('0x5d')]({'where':{'id':_0x15989d[_0x0d25('0x56')]['id']}})[_0x0d25('0x1f')](handleEntityNotFound(_0x1f22ed,null))[_0x0d25('0x1f')](function(_0x44b967){if(_0x44b967){return _0x44b967[_0x0d25('0x6a')](_0x15989d[_0x0d25('0x44')][_0x0d25('0x6b')]);}})['then'](respondWithStatusCode(_0x1f22ed,null))[_0x0d25('0x29')](handleError(_0x1f22ed,null));};exports['addAnswer']=function(_0x27fc33,_0x4f49e2,_0x5b93d0){if(_0x27fc33[_0x0d25('0x60')]['id']){delete _0x27fc33['body']['id'];}return db[_0x0d25('0x3f')][_0x0d25('0x5d')]({'where':{'id':_0x27fc33['params']['id']}})['then'](handleEntityNotFound(_0x4f49e2,null))[_0x0d25('0x1f')](function(_0x113a17){if(_0x113a17){_0x27fc33[_0x0d25('0x60')][_0x0d25('0x63')]=_0x113a17['id'];return db[_0x0d25('0x6c')][_0x0d25('0x58')](_0x27fc33[_0x0d25('0x60')]);}})[_0x0d25('0x1f')](respondWithResult(_0x4f49e2,null))[_0x0d25('0x29')](handleError(_0x4f49e2,null));};exports[_0x0d25('0x6d')]=function(_0xc03075,_0x3fee64,_0x572dc1){var _0x31a2c2={'raw':![],'where':{}};var _0x4810ef={};var _0x4a48c1={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0xc03075['params']['id']}})[_0x0d25('0x1f')](handleEntityNotFound(_0x3fee64,null))[_0x0d25('0x1f')](function(_0x323c10){if(_0x323c10){_0x4810ef[_0x0d25('0x42')]=_['keys'](db[_0x0d25('0x6c')][_0x0d25('0x40')]);_0x4810ef[_0x0d25('0x44')]=_[_0x0d25('0x57')](_0xc03075[_0x0d25('0x44')]);_0x4810ef[_0x0d25('0x45')]=_[_0x0d25('0x46')](_0x4810ef['model'],_0x4810ef[_0x0d25('0x44')]);_0x31a2c2[_0x0d25('0x47')]=_[_0x0d25('0x46')](_0x4810ef[_0x0d25('0x42')],qs[_0x0d25('0x48')](_0xc03075[_0x0d25('0x44')][_0x0d25('0x48')]));_0x31a2c2[_0x0d25('0x47')]=_0x31a2c2[_0x0d25('0x47')][_0x0d25('0x49')]?_0x31a2c2[_0x0d25('0x47')]:_0x4810ef['model'];if(!_0xc03075[_0x0d25('0x44')][_0x0d25('0x67')]('nolimit')){_0x31a2c2[_0x0d25('0x2e')]=qs[_0x0d25('0x2e')](_0xc03075['query'][_0x0d25('0x2e')]);_0x31a2c2[_0x0d25('0x2d')]=qs[_0x0d25('0x2d')](_0xc03075[_0x0d25('0x44')]['offset']);}_0x31a2c2[_0x0d25('0x4a')]=qs[_0x0d25('0x4b')](_0xc03075[_0x0d25('0x44')][_0x0d25('0x4b')]);_0x31a2c2['where']=qs['filters'](_['pick'](_0xc03075['query'],_0x4810ef[_0x0d25('0x45')]));_0x31a2c2[_0x0d25('0x4c')][_0x0d25('0x63')]=_0x323c10['id'];if(_0xc03075[_0x0d25('0x44')][_0x0d25('0x4e')]){_0x31a2c2[_0x0d25('0x4c')]=_[_0x0d25('0x69')](_0x31a2c2['where'],{'$or':_['map'](_0x31a2c2[_0x0d25('0x47')],function(_0x22d086){var _0x20db38={};_0x20db38[_0x22d086]={'$like':'%'+_0xc03075[_0x0d25('0x44')]['filter']+'%'};return _0x20db38;})});}_0x31a2c2=_[_0x0d25('0x69')]({},_0x31a2c2,_0xc03075['options']);return db[_0x0d25('0x6c')]['count']({'where':_0x31a2c2['where']})[_0x0d25('0x1f')](function(_0x2a67b3){_0x4a48c1['count']=_0x2a67b3;if(_0xc03075['query'][_0x0d25('0x52')]){_0x31a2c2[_0x0d25('0x53')]=[{'all':!![]}];}return db[_0x0d25('0x6c')][_0x0d25('0x6e')](_0x31a2c2);})[_0x0d25('0x1f')](function(_0x22c437){_0x4a48c1[_0x0d25('0x54')]=_0x22c437;return _0x4a48c1;});}})[_0x0d25('0x1f')](respondWithFilteredResult(_0x3fee64,_0x31a2c2))[_0x0d25('0x29')](handleError(_0x3fee64,null));};exports['removeAnswers']=function(_0x45e3f5,_0x59bf57,_0x121328){return db[_0x0d25('0x3f')][_0x0d25('0x5d')]({'where':{'id':_0x45e3f5[_0x0d25('0x56')]['id']}})[_0x0d25('0x1f')](handleEntityNotFound(_0x59bf57,null))[_0x0d25('0x1f')](function(_0x195489){if(_0x195489){return _0x195489[_0x0d25('0x6f')](_0x45e3f5[_0x0d25('0x44')][_0x0d25('0x6b')]);}})[_0x0d25('0x1f')](respondWithStatusCode(_0x59bf57,null))[_0x0d25('0x29')](handleError(_0x59bf57,null));};exports['addInteraction']=function(_0x4d68dc,_0x74467,_0x5a66ea){return db[_0x0d25('0x70')][_0x0d25('0x5d')]({'where':{'id':_0x4d68dc[_0x0d25('0x56')]['id']}})[_0x0d25('0x1f')](handleEntityNotFound(_0x74467,null))['then'](function(_0x3ab881){if(_0x3ab881){return _0x3ab881[_0x0d25('0x71')](_0x4d68dc[_0x0d25('0x60')]['ids'],_[_0x0d25('0x72')](_0x4d68dc[_0x0d25('0x60')],[_0x0d25('0x6b'),'id'])||{});}})[_0x0d25('0x1f')](respondWithResult(_0x74467,null))[_0x0d25('0x29')](handleError(_0x74467,null));};exports['getInteractions']=function(_0xcf24c6,_0x4d1b1a,_0x2c1b84){var _0x45d4ee={'raw':![],'where':{}};var _0x258a37={};var _0x408460={'count':0x0,'rows':[]};return db[_0x0d25('0x3f')][_0x0d25('0x66')]({'where':{'id':_0xcf24c6[_0x0d25('0x56')]['id']}})[_0x0d25('0x1f')](handleEntityNotFound(_0x4d1b1a,null))[_0x0d25('0x1f')](function(_0x237fd5){if(_0x237fd5){_0x258a37[_0x0d25('0x42')]=_[_0x0d25('0x57')](db[_0x0d25('0x70')]['rawAttributes']);_0x258a37[_0x0d25('0x44')]=_[_0x0d25('0x57')](_0xcf24c6[_0x0d25('0x44')]);_0x258a37[_0x0d25('0x45')]=_[_0x0d25('0x46')](_0x258a37['model'],_0x258a37[_0x0d25('0x44')]);_0x45d4ee[_0x0d25('0x47')]=_[_0x0d25('0x46')](_0x258a37[_0x0d25('0x42')],qs[_0x0d25('0x48')](_0xcf24c6[_0x0d25('0x44')][_0x0d25('0x48')]));_0x45d4ee[_0x0d25('0x47')]=_0x45d4ee[_0x0d25('0x47')][_0x0d25('0x49')]?_0x45d4ee[_0x0d25('0x47')]:_0x258a37[_0x0d25('0x42')];if(!_0xcf24c6[_0x0d25('0x44')][_0x0d25('0x67')](_0x0d25('0x68'))){_0x45d4ee[_0x0d25('0x2e')]=qs['limit'](_0xcf24c6[_0x0d25('0x44')][_0x0d25('0x2e')]);_0x45d4ee[_0x0d25('0x2d')]=qs[_0x0d25('0x2d')](_0xcf24c6[_0x0d25('0x44')][_0x0d25('0x2d')]);}_0x45d4ee[_0x0d25('0x4a')]=qs[_0x0d25('0x4b')](_0xcf24c6[_0x0d25('0x44')][_0x0d25('0x4b')]);_0x45d4ee[_0x0d25('0x4c')]=qs[_0x0d25('0x45')](_[_0x0d25('0x4d')](_0xcf24c6[_0x0d25('0x44')],_0x258a37[_0x0d25('0x45')]));_0x45d4ee[_0x0d25('0x4c')][_0x0d25('0x63')]=_0x237fd5['id'];if(_0xcf24c6[_0x0d25('0x44')][_0x0d25('0x4e')]){_0x45d4ee[_0x0d25('0x4c')]=_['merge'](_0x45d4ee[_0x0d25('0x4c')],{'$or':_[_0x0d25('0x43')](_0x45d4ee[_0x0d25('0x47')],function(_0x3ae3b4){var _0x165150={};_0x165150[_0x3ae3b4]={'$like':'%'+_0xcf24c6['query'][_0x0d25('0x4e')]+'%'};return _0x165150;})});}_0x45d4ee=_['merge']({},_0x45d4ee,_0xcf24c6[_0x0d25('0x51')]);return db[_0x0d25('0x70')][_0x0d25('0x30')]({'where':_0x45d4ee['where']})['then'](function(_0x289aed){_0x408460['count']=_0x289aed;if(_0xcf24c6[_0x0d25('0x44')][_0x0d25('0x52')]){_0x45d4ee[_0x0d25('0x53')]=[{'model':db['CmContact'],'as':_0x0d25('0x73'),'required':![]},{'model':db['User'],'as':_0x0d25('0x74'),'attributes':['name',_0x0d25('0x75'),_0x0d25('0x76')],'required':![]},{'model':db[_0x0d25('0x77')],'as':_0x0d25('0x78'),'attributes':['id','name',_0x0d25('0x79')],'where':_0xcf24c6[_0x0d25('0x44')][_0x0d25('0x7a')]?{'id':_0xcf24c6[_0x0d25('0x44')][_0x0d25('0x7a')]}:undefined,'required':_0xcf24c6[_0x0d25('0x44')][_0x0d25('0x7a')]?!![]:![]}];}return db[_0x0d25('0x70')][_0x0d25('0x6e')](_0x45d4ee);})['then'](function(_0x2defdb){_0x408460[_0x0d25('0x54')]=_0x2defdb;return _0x408460;});}})[_0x0d25('0x1f')](respondWithFilteredResult(_0x4d1b1a,_0x45d4ee))[_0x0d25('0x29')](handleError(_0x4d1b1a,null));};exports['addApplications']=function(_0x544426,_0x5bb3f6){var _0x37b411=_0x544426[_0x0d25('0x56')]['id'];var _0x449f96=_0x544426['body'];var _0x135eb4=0xc8;var _0x112a28=null;return db[_0x0d25('0x7b')][_0x0d25('0x7c')]({'isolationLevel':db[_0x0d25('0x7b')]['Transaction']['ISOLATION_LEVELS'][_0x0d25('0x7d')]},function(_0x526d4e){return db['FaxAccount']['findOne']({'where':{'id':_0x37b411},'transaction':_0x526d4e})[_0x0d25('0x1f')](function(_0x5cd520){if(_0x5cd520){return db[_0x0d25('0x7e')][_0x0d25('0x36')]({'where':{'FaxAccountId':_0x37b411},'transaction':_0x526d4e})['then'](function(){var _0xae38b0=_['map'](_0x449f96,function(_0x3d7311){_0x3d7311['FaxAccountId']=_0x37b411;return _0x3d7311;});return db[_0x0d25('0x7e')]['bulkCreate'](_0xae38b0,{'transaction':_0x526d4e});});}else{_0x135eb4=0x194;_0x112a28=[];}});})['then'](function(){if(_0x135eb4!==0x194){return db['FaxApplication']['findAndCountAll']({'where':{'FaxAccountId':_0x37b411},'order':'priority'})[_0x0d25('0x1f')](function(_0x5efed5){_0x112a28=_0x5efed5;});}})[_0x0d25('0x29')](function(_0x41164e){_0x135eb4=0x1f4;logger['error'](_0x41164e['stack']);if(_0x41164e[_0x0d25('0x3b')]){delete _0x41164e[_0x0d25('0x3b')];}_0x112a28=_0x41164e;})[_0x0d25('0x7f')](function(){if(_0x112a28===null){_0x5bb3f6[_0x0d25('0x80')](_0x135eb4);}else{if(_0x135eb4===0x1f4){_0x5bb3f6[_0x0d25('0x2a')](_0x135eb4)[_0x0d25('0x81')](_0x112a28);}else{_0x5bb3f6[_0x0d25('0x2a')](_0x135eb4)['json'](_0x112a28);}}});};exports[_0x0d25('0x82')]=function(_0x31182d,_0x1c391c,_0x1a7ce5){var _0x5d3120={};var _0x26bd29={};var _0x28789e;var _0x50ae3b;return db[_0x0d25('0x3f')][_0x0d25('0x66')]({'where':{'id':_0x31182d[_0x0d25('0x56')]['id']}})[_0x0d25('0x1f')](handleEntityNotFound(_0x1c391c,null))[_0x0d25('0x1f')](function(_0x303693){if(_0x303693){_0x28789e=_0x303693;_0x26bd29[_0x0d25('0x42')]=_['keys'](db[_0x0d25('0x7e')][_0x0d25('0x40')]);_0x26bd29[_0x0d25('0x44')]=_[_0x0d25('0x57')](_0x31182d[_0x0d25('0x44')]);_0x26bd29[_0x0d25('0x45')]=_[_0x0d25('0x46')](_0x26bd29[_0x0d25('0x42')],_0x26bd29[_0x0d25('0x44')]);_0x5d3120['attributes']=_[_0x0d25('0x46')](_0x26bd29[_0x0d25('0x42')],qs[_0x0d25('0x48')](_0x31182d[_0x0d25('0x44')]['fields']));_0x5d3120[_0x0d25('0x47')]=_0x5d3120['attributes'][_0x0d25('0x49')]?_0x5d3120['attributes']:_0x26bd29[_0x0d25('0x42')];_0x5d3120['order']=qs[_0x0d25('0x4b')](_0x31182d['query'][_0x0d25('0x4b')]);_0x5d3120['where']=qs[_0x0d25('0x45')](_[_0x0d25('0x4d')](_0x31182d[_0x0d25('0x44')],_0x26bd29[_0x0d25('0x45')]));if(_0x31182d[_0x0d25('0x44')][_0x0d25('0x4e')]){_0x5d3120[_0x0d25('0x4c')]=_['merge'](_0x5d3120[_0x0d25('0x4c')],{'$or':_['map'](_0x5d3120[_0x0d25('0x47')],function(_0x230f83){var _0x53080c={};_0x53080c[_0x230f83]={'$like':'%'+_0x31182d[_0x0d25('0x44')][_0x0d25('0x4e')]+'%'};return _0x53080c;})});}_0x5d3120=_[_0x0d25('0x69')]({},_0x5d3120,_0x31182d[_0x0d25('0x51')]);return _0x28789e[_0x0d25('0x82')](_0x5d3120);}})[_0x0d25('0x1f')](function(_0x101f65){if(_0x101f65){_0x50ae3b=_0x101f65[_0x0d25('0x49')];if(!_0x31182d[_0x0d25('0x44')][_0x0d25('0x67')]('nolimit')){_0x5d3120['limit']=qs[_0x0d25('0x2e')](_0x31182d[_0x0d25('0x44')][_0x0d25('0x2e')]);_0x5d3120[_0x0d25('0x2d')]=qs[_0x0d25('0x2d')](_0x31182d['query'][_0x0d25('0x2d')]);}return _0x28789e[_0x0d25('0x82')](_0x5d3120);}})[_0x0d25('0x1f')](function(_0x3bf3bf){if(_0x3bf3bf){return _0x3bf3bf?{'count':_0x50ae3b,'rows':_0x3bf3bf}:null;}})[_0x0d25('0x1f')](respondWithResult(_0x1c391c,null))[_0x0d25('0x29')](handleError(_0x1c391c,null));};function Extension(_0x5693bc,_0xb6a566,_0x245386,_0x4ca08c){this['context']='from-voip-provider';this['exten']=_0x5693bc['localstationid'];this[_0x0d25('0x83')]=_0x4ca08c;this[_0x0d25('0x4f')]='system';this[_0x0d25('0x84')]=_0x0d25('0x85');this[_0x0d25('0x63')]=_0x5693bc['id'];this[_0x0d25('0x86')]=_0xb6a566;this[_0x0d25('0x87')]=_0x245386;}function createExtensionsReciveFax(_0x422a9d){var _0x4199a1=0x1;var _0x257378=[];_0x257378['push'](new Extension(_0x422a9d,_0x4199a1,'',_0x0d25('0x88')));_0x4199a1+=0x1;_0x257378['push'](new Extension(_0x422a9d,_0x4199a1,_0x0d25('0x89'),_0x0d25('0x8a')));_0x4199a1+=0x1;for(var _0x548416 in _0x422a9d){if(_0x422a9d['hasOwnProperty'](_0x548416)&&(_0x548416===_0x0d25('0x8b')||_0x548416===_0x0d25('0x8c')||_0x548416===_0x0d25('0x8d')||_0x548416===_0x0d25('0x8e')||_0x548416===_0x0d25('0x8f')||_0x548416===_0x0d25('0x90')||_0x548416==='minrate'||_0x548416===_0x0d25('0x91')||_0x548416===_0x0d25('0x92'))){_0x257378[_0x0d25('0x93')](new Extension(_0x422a9d,_0x4199a1,_0x0d25('0x94')+_0x548416+')='+_0x422a9d[_0x548416],_0x0d25('0x8a')));_0x4199a1+=0x1;}}_0x257378[_0x0d25('0x93')](new Extension(_0x422a9d,_0x4199a1,'6',_0x0d25('0x95')));_0x4199a1+=0x1;_0x257378[_0x0d25('0x93')](new Extension(_0x422a9d,_0x4199a1,_0x0d25('0x96'),_0x0d25('0x97')));_0x4199a1=0x0;return _0x257378;}exports[_0x0d25('0x98')]=function(_0xea91af,_0x5efbb4,_0x5bf6b1){var _0x2c29d5;return db[_0x0d25('0x7b')]['transaction'](function(_0x50297e){return db[_0x0d25('0x3f')][_0x0d25('0x58')](_0xea91af[_0x0d25('0x60')],{'transaction':_0x50297e})[_0x0d25('0x1f')](function(_0x4fcb1e){_0x2c29d5=_0x4fcb1e[_0x0d25('0x37')]({'plain':!![]});return db[_0x0d25('0x99')][_0x0d25('0x9a')](createExtensionsReciveFax(_0x2c29d5),{'transaction':_0x50297e});});})[_0x0d25('0x1f')](function(){return _0x2c29d5;})[_0x0d25('0x1f')](respondWithResult(_0x5efbb4,null))['catch'](handleError(_0x5efbb4,null));};exports['updateAccountApplications']=function(_0xd2f800,_0x4533ea,_0x4de5e8){var _0x25149c;return db[_0x0d25('0x7b')]['transaction'](function(_0x285f87){return db[_0x0d25('0x3f')][_0x0d25('0x35')](_0xd2f800[_0x0d25('0x60')],{'where':{'id':_0xd2f800['body']['id']},'transaction':_0x285f87})[_0x0d25('0x1f')](function(_0x286531){return db[_0x0d25('0x99')][_0x0d25('0x36')]({'where':{'FaxAccountId':_0xd2f800[_0x0d25('0x60')]['id']},'transaction':_0x285f87})[_0x0d25('0x1f')](function(_0x401eae){return db[_0x0d25('0x99')]['bulkCreate'](createExtensionsReciveFax(_[_0x0d25('0x72')](_0xd2f800[_0x0d25('0x60')],[_0x0d25('0x9b'),_0x0d25('0x9c'),'createdAt','updatedAt',_0x0d25('0x9d'),_0x0d25('0x9e')])),{'transaction':_0x285f87});});});})[_0x0d25('0x1f')](function(){return db['FaxAccount'][_0x0d25('0x9f')](_0xd2f800['body']['id']);})['then'](respondWithResult(_0x4533ea,null))[_0x0d25('0x29')](handleError(_0x4533ea,null));};exports['getMessages']=function(_0x2a1a06,_0x53a739,_0x1f52ae){var _0x594b71={'raw':!![],'where':{}};var _0x5ecdce={};var _0xff9d3c={'count':0x0,'rows':[]};return db['FaxAccount'][_0x0d25('0x66')]({'where':{'id':_0x2a1a06[_0x0d25('0x56')]['id']}})[_0x0d25('0x1f')](handleEntityNotFound(_0x53a739,null))[_0x0d25('0x1f')](function(_0x215975){if(_0x215975){_0x5ecdce[_0x0d25('0x42')]=_[_0x0d25('0x57')](db[_0x0d25('0xa0')][_0x0d25('0x40')]);_0x5ecdce['query']=_['keys'](_0x2a1a06[_0x0d25('0x44')]);_0x5ecdce['filters']=_[_0x0d25('0x46')](_0x5ecdce['model'],_0x5ecdce[_0x0d25('0x44')]);_0x594b71[_0x0d25('0x47')]=_[_0x0d25('0x46')](_0x5ecdce[_0x0d25('0x42')],qs[_0x0d25('0x48')](_0x2a1a06[_0x0d25('0x44')][_0x0d25('0x48')]));_0x594b71['attributes']=_0x594b71[_0x0d25('0x47')][_0x0d25('0x49')]?_0x594b71['attributes']:_0x5ecdce[_0x0d25('0x42')];if(!_0x2a1a06[_0x0d25('0x44')][_0x0d25('0x67')]('nolimit')){_0x594b71[_0x0d25('0x2e')]=qs[_0x0d25('0x2e')](_0x2a1a06[_0x0d25('0x44')]['limit']);_0x594b71['offset']=qs[_0x0d25('0x2d')](_0x2a1a06['query'][_0x0d25('0x2d')]);}_0x594b71[_0x0d25('0x4a')]=qs['sort'](_0x2a1a06[_0x0d25('0x44')][_0x0d25('0x4b')]);_0x594b71[_0x0d25('0x4c')]=qs[_0x0d25('0x45')](_[_0x0d25('0x4d')](_0x2a1a06['query'],_0x5ecdce[_0x0d25('0x45')]));_0x594b71[_0x0d25('0x4c')][_0x0d25('0x63')]=_0x215975['id'];if(_0x2a1a06[_0x0d25('0x44')][_0x0d25('0x4e')]){_0x594b71[_0x0d25('0x4c')]=_[_0x0d25('0x69')](_0x594b71[_0x0d25('0x4c')],{'$or':_[_0x0d25('0x43')](_0x594b71[_0x0d25('0x47')],function(_0x59576e){var _0x3006cf={};_0x3006cf[_0x59576e]={'$like':'%'+_0x2a1a06[_0x0d25('0x44')]['filter']+'%'};return _0x3006cf;})});}if(_0x2a1a06[_0x0d25('0x44')]['$gte']){var _0xb011d3=_0x2a1a06[_0x0d25('0x44')][_0x0d25('0xa1')][_0x0d25('0xa2')](',');var _0x1cd64b={};_0x1cd64b[_0xb011d3[0x0]]={'$gte':moment(_0xb011d3[0x1])[_0x0d25('0xa3')](_0x0d25('0xa4'))};_0x594b71[_0x0d25('0x4c')]=_['merge'](_0x594b71[_0x0d25('0x4c')],_0x1cd64b);}_0x594b71=_[_0x0d25('0x69')]({},_0x594b71,_0x2a1a06[_0x0d25('0x51')]);return db[_0x0d25('0xa0')]['count']({'where':_0x594b71[_0x0d25('0x4c')]})[_0x0d25('0x1f')](function(_0x401ae2){_0xff9d3c[_0x0d25('0x30')]=_0x401ae2;if(_0x2a1a06['query'][_0x0d25('0x52')]){_0x594b71['include']=[{'all':!![]}];}return db['FaxMessage'][_0x0d25('0x6e')](_0x594b71);})[_0x0d25('0x1f')](function(_0x9e86f9){_0xff9d3c[_0x0d25('0x54')]=_0x9e86f9;return _0xff9d3c;});}})[_0x0d25('0x1f')](respondWithFilteredResult(_0x53a739,_0x594b71))[_0x0d25('0x29')](handleError(_0x53a739,null));};exports[_0x0d25('0x81')]=function(_0x17fdf8,_0x116400,_0x51bfb6){var _0x299ecc,_0x2c73c3={},_0x17d12d;if(_0x17fdf8['body']['to']){_0x17d12d=_0x17fdf8['body']['to'][0x0];}return db[_0x0d25('0x3f')]['find']({'where':{'id':_0x17fdf8[_0x0d25('0x56')]['id']},'include':[{'model':db[_0x0d25('0xa5')],'as':_0x0d25('0xa6'),'include':[{'model':db[_0x0d25('0xa7')],'as':_0x0d25('0xa8'),'where':{'fax':_0x17d12d},'limit':0x1,'order':[[_0x0d25('0xa9'),_0x0d25('0xaa')]]}]}]})[_0x0d25('0x1f')](handleEntityNotFound(_0x116400,null))[_0x0d25('0x1f')](function(_0x12e9ac){_0x299ecc=_0x12e9ac;if(_0x17fdf8['body'][_0x0d25('0xab')]&&_0x17fdf8[_0x0d25('0x60')]['attachments'][_0x0d25('0x49')]){for(var _0xb6090=0x0;_0xb6090<_0x17fdf8[_0x0d25('0x60')][_0x0d25('0xab')][_0x0d25('0x49')];_0xb6090+=0x1){_0x17fdf8['body']['attachments'][_0xb6090]={'filename':_0x17fdf8[_0x0d25('0x60')][_0x0d25('0xab')][_0xb6090][_0x0d25('0x3b')],'id':_0x17fdf8[_0x0d25('0x60')][_0x0d25('0xab')][_0xb6090]['id'],'path':path['join'](config[_0x0d25('0xac')],'server/files/attachments',_0x17fdf8['body'][_0x0d25('0xab')][_0xb6090]['basename'])};}}return respondWithRpcPromise(_0x0d25('0xad'),_0x0d25('0xad'),{'FaxAccountId':_['isNil'](_0x17fdf8[_0x0d25('0x56')]['id'])?undefined:_0x17fdf8[_0x0d25('0x56')]['id'],'path':_[_0x0d25('0xae')](_0x17fdf8[_0x0d25('0x60')][_0x0d25('0xab')][0x0][_0x0d25('0x5')])?undefined:_0x17fdf8[_0x0d25('0x60')][_0x0d25('0xab')][0x0][_0x0d25('0x5')],'fax':_['isNil'](_0x17fdf8[_0x0d25('0x60')]['to'][0x0])?undefined:_0x17fdf8[_0x0d25('0x60')]['to'][0x0]},client9002);})[_0x0d25('0x1f')](function(){if(_0x299ecc){if(_['isNil'](_0x17fdf8[_0x0d25('0x60')]['from'])){_0x17fdf8[_0x0d25('0x60')]['from']=util[_0x0d25('0xa3')](_0x0d25('0xaf'),_0x299ecc[_0x0d25('0x3b')],_0x299ecc[_0x0d25('0xb0')]);}if(_0x299ecc[_0x0d25('0xa6')]){if(_0x299ecc[_0x0d25('0xa6')]['Contacts'][_0x0d25('0x49')]){return _0x299ecc[_0x0d25('0xa6')][_0x0d25('0xa8')][0x0];}else{return db[_0x0d25('0xa7')][_0x0d25('0x58')](_[_0x0d25('0x17')](_0x17fdf8['body'],{'firstName':_0x17fdf8['body']['to'][0x0],'phone':_0x17fdf8[_0x0d25('0x60')]['to'][0x0],'fax':_0x17fdf8[_0x0d25('0x60')]['to'][0x0],'ListId':_0x299ecc['ListId']}));}}else{throw new Error(_0x0d25('0xb1'));}}else{throw new Error(_0x0d25('0xb2'));}})[_0x0d25('0x1f')](function(_0x3df6e3){if(_0x3df6e3){return db[_0x0d25('0x70')][_0x0d25('0x5d')]({'where':{'ContactId':_0x3df6e3['id'],'closed':![],'FaxAccountId':_0x299ecc['id']}})[_0x0d25('0x1f')](function(_0xc45fc9){if(_0xc45fc9){return[_0xc45fc9,![]];}return db[_0x0d25('0x70')][_0x0d25('0x58')]({'UserId':_0x17fdf8[_0x0d25('0x5b')]['id'],'ContactId':_0x3df6e3['id'],'FaxAccountId':_0x299ecc['id'],'fax':_0x17fdf8[_0x0d25('0x60')]['to'][0x0],'firstMsgDirection':_0x0d25('0xb3'),'Messages':[_['merge'](_0x17fdf8['body'],{'read':![],'body':_0x17fdf8[_0x0d25('0x60')][_0x0d25('0xab')][0x0]['filename'],'FaxAccountId':_0x299ecc['id'],'UserId':_0x17fdf8[_0x0d25('0x5b')]['id'],'ContactId':_0x3df6e3['id'],'AttachmentId':_0x17fdf8[_0x0d25('0x60')][_0x0d25('0xab')][0x0]['id']})]},{'include':[{'model':db[_0x0d25('0xa0')],'as':'Messages'}]})[_0x0d25('0x1f')](function(_0x33ba25){return[_0x33ba25,!![]];});});}else{throw new Error(_0x0d25('0xb4'));}})[_0x0d25('0xb5')](function(_0x40a880,_0x35c5d8){if(_0x35c5d8){return _0x40a880;}return db['FaxMessage'][_0x0d25('0x58')]({'direction':'out','read':![],'body':_0x17fdf8[_0x0d25('0x60')]['attachments'][0x0][_0x0d25('0xb6')],'FaxAccountId':_0x299ecc['id'],'FaxInteractionId':_0x40a880['id'],'UserId':_0x17fdf8[_0x0d25('0x5b')]['id'],'ContactId':_0x40a880['ContactId'],'AttachmentId':_0x17fdf8['body'][_0x0d25('0xab')][0x0]['id']})['then'](function(_0x348563){_0x40a880[_0x0d25('0xb7')][_0x0d25('0xb8')]=[];_0x40a880['dataValues'][_0x0d25('0xb8')]['push'](_0x348563[_0x0d25('0xb7')]);return _0x40a880;});})[_0x0d25('0x1f')](function(_0xf29f57){respondWithRpcPromise('SendFax',_0x0d25('0xb9'),{'FaxAccountId':_[_0x0d25('0xae')](_0x17fdf8[_0x0d25('0x56')]['id'])?undefined:_0x17fdf8[_0x0d25('0x56')]['id'],'path':_[_0x0d25('0xae')](_0x17fdf8[_0x0d25('0x60')][_0x0d25('0xab')][0x0][_0x0d25('0x5')])?undefined:_0x17fdf8['body'][_0x0d25('0xab')][0x0][_0x0d25('0x5')],'fax':_[_0x0d25('0xae')](_0x17fdf8['body']['to'][0x0])?undefined:_0x17fdf8[_0x0d25('0x60')]['to'][0x0],'AttachmentId':_0x17fdf8[_0x0d25('0x60')][_0x0d25('0xab')][0x0]['id']},client9002)['then'](function(_0x26512f){logger[_0x0d25('0x20')](_0x0d25('0xba'),_0x26512f);})[_0x0d25('0x29')](function(_0x4b4255){logger[_0x0d25('0x20')](_0x0d25('0xba'),_0x4b4255);});return _0xf29f57;})[_0x0d25('0x1f')](respondWithResult(_0x116400,null))[_0x0d25('0x29')](handleError(_0x116400,null));};exports['addAgents']=function(_0x44e745,_0x5014e9,_0x3c3cc8){return db['FaxAccount'][_0x0d25('0x5d')]({'where':{'id':_0x44e745[_0x0d25('0x56')]['id']}})[_0x0d25('0x1f')](handleEntityNotFound(_0x5014e9,null))[_0x0d25('0x1f')](function(_0x361f0f){if(_0x361f0f){return _0x361f0f[_0x0d25('0xbb')](_0x44e745['body']['ids'],_[_0x0d25('0x72')](_0x44e745[_0x0d25('0x60')],['ids','id'])||{})[_0x0d25('0xb5')](function(_0x386457){for(var _0x294d21=0x0;_0x294d21<_0x44e745[_0x0d25('0x60')][_0x0d25('0x6b')]['length'];_0x294d21+=0x1){socket[_0x0d25('0xbc')]('userFaxAccount:save',{'UserId':Number(_0x44e745[_0x0d25('0x60')][_0x0d25('0x6b')][_0x294d21]),'FaxAccountId':Number(_0x44e745['params']['id'])});}return _0x386457;});}})[_0x0d25('0x1f')](respondWithResult(_0x5014e9,null))['catch'](handleError(_0x5014e9,null));};exports['removeAgents']=function(_0x32813b,_0x182d4f,_0x296e84){return db[_0x0d25('0x3f')][_0x0d25('0x5d')]({'where':{'id':_0x32813b[_0x0d25('0x56')]['id']}})[_0x0d25('0x1f')](handleEntityNotFound(_0x182d4f,null))['then'](function(_0x889db7){if(_0x889db7){return _0x889db7[_0x0d25('0xbd')](_0x32813b[_0x0d25('0x44')][_0x0d25('0x6b')])[_0x0d25('0x1f')](function(){if(_[_0x0d25('0xbe')](_0x32813b['query'][_0x0d25('0x6b')])){for(var _0x43eb83=0x0;_0x43eb83<_0x32813b[_0x0d25('0x44')][_0x0d25('0x6b')]['length'];_0x43eb83+=0x1){socket[_0x0d25('0xbc')](_0x0d25('0xbf'),{'UserId':Number(_0x32813b['query'][_0x0d25('0x6b')][_0x43eb83]),'FaxAccountId':Number(_0x32813b[_0x0d25('0x56')]['id'])});}}else{socket['emit']('userFaxAccount:remove',{'UserId':Number(_0x32813b[_0x0d25('0x44')]['ids']),'FaxAccountId':Number(_0x32813b[_0x0d25('0x56')]['id'])});}});}})[_0x0d25('0x1f')](respondWithStatusCode(_0x182d4f,null))[_0x0d25('0x29')](handleError(_0x182d4f,null));};exports[_0x0d25('0xc0')]=function(_0x2a3cb9,_0x4d0b2e,_0x42ea5b){var _0x53b0d4={};var _0x4ec3dd={};var _0x3e0d40;var _0x1a5ecb;return db['FaxAccount'][_0x0d25('0x66')]({'where':{'id':_0x2a3cb9[_0x0d25('0x56')]['id']}})['then'](handleEntityNotFound(_0x4d0b2e,null))[_0x0d25('0x1f')](function(_0x2cb78d){if(_0x2cb78d){_0x3e0d40=_0x2cb78d;_0x4ec3dd[_0x0d25('0x42')]=_[_0x0d25('0x57')](db[_0x0d25('0xc1')][_0x0d25('0x40')]);_0x4ec3dd['query']=_[_0x0d25('0x57')](_0x2a3cb9[_0x0d25('0x44')]);_0x4ec3dd[_0x0d25('0x45')]=_[_0x0d25('0x46')](_0x4ec3dd['model'],_0x4ec3dd[_0x0d25('0x44')]);_0x53b0d4[_0x0d25('0x47')]=_[_0x0d25('0x46')](_0x4ec3dd[_0x0d25('0x42')],qs[_0x0d25('0x48')](_0x2a3cb9['query'][_0x0d25('0x48')]));_0x53b0d4[_0x0d25('0x47')]=_0x53b0d4[_0x0d25('0x47')][_0x0d25('0x49')]?_0x53b0d4[_0x0d25('0x47')]:_0x4ec3dd[_0x0d25('0x42')];_0x53b0d4[_0x0d25('0x4a')]=qs[_0x0d25('0x4b')](_0x2a3cb9[_0x0d25('0x44')]['sort']);_0x53b0d4['where']=qs[_0x0d25('0x45')](_[_0x0d25('0x4d')](_0x2a3cb9['query'],_0x4ec3dd[_0x0d25('0x45')]));if(_0x2a3cb9[_0x0d25('0x44')]['filter']){_0x53b0d4[_0x0d25('0x4c')]=_[_0x0d25('0x69')](_0x53b0d4[_0x0d25('0x4c')],{'$or':_[_0x0d25('0x43')](_0x53b0d4[_0x0d25('0x47')],function(_0x165999){var _0x138738={};_0x138738[_0x165999]={'$like':'%'+_0x2a3cb9[_0x0d25('0x44')][_0x0d25('0x4e')]+'%'};return _0x138738;})});}_0x53b0d4=_[_0x0d25('0x69')]({},_0x53b0d4,_0x2a3cb9[_0x0d25('0x51')]);return _0x3e0d40[_0x0d25('0xc0')](_0x53b0d4);}})[_0x0d25('0x1f')](function(_0x1dfe1d){if(_0x1dfe1d){_0x1a5ecb=_0x1dfe1d[_0x0d25('0x49')];if(!_0x2a3cb9[_0x0d25('0x44')][_0x0d25('0x67')](_0x0d25('0x68'))){_0x53b0d4['limit']=qs[_0x0d25('0x2e')](_0x2a3cb9[_0x0d25('0x44')][_0x0d25('0x2e')]);_0x53b0d4[_0x0d25('0x2d')]=qs[_0x0d25('0x2d')](_0x2a3cb9[_0x0d25('0x44')]['offset']);}return _0x3e0d40[_0x0d25('0xc0')](_0x53b0d4);}})[_0x0d25('0x1f')](function(_0x5a6af8){if(_0x5a6af8){return _0x5a6af8?{'count':_0x1a5ecb,'rows':_0x5a6af8}:null;}})[_0x0d25('0x1f')](respondWithResult(_0x4d0b2e,null))[_0x0d25('0x29')](handleError(_0x4d0b2e,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 0b48ea2..fa25dc5 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 _0xb313=['hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners','save','update','remove','emit'];(function(_0x492bf7,_0x14319d){var _0x448a9a=function(_0x1ffd77){while(--_0x1ffd77){_0x492bf7['push'](_0x492bf7['shift']());}};_0x448a9a(++_0x14319d);}(_0xb313,0x142));var _0x3b31=function(_0x35bb5c,_0x31f555){_0x35bb5c=_0x35bb5c-0x0;var _0x2e324a=_0xb313[_0x35bb5c];return _0x2e324a;};'use strict';var EventEmitter=require(_0x3b31('0x0'));var FaxAccount=require(_0x3b31('0x1'))['db'][_0x3b31('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x3b31('0x3')](0x0);var events={'afterCreate':_0x3b31('0x4'),'afterUpdate':_0x3b31('0x5'),'afterDestroy':_0x3b31('0x6')};function emitEvent(_0x49c4ab){return function(_0x56b907,_0x36a031,_0x5a366b){FaxAccountEvents[_0x3b31('0x7')](_0x49c4ab+':'+_0x56b907['id'],_0x56b907);FaxAccountEvents[_0x3b31('0x7')](_0x49c4ab,_0x56b907);_0x5a366b(null);};}for(var e in events){if(events[_0x3b31('0x8')](e)){var event=events[e];FaxAccount[_0x3b31('0x9')](e,emitEvent(event));}}module[_0x3b31('0xa')]=FaxAccountEvents; \ No newline at end of file +var _0x672b=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','FaxAccount','setMaxListeners','save'];(function(_0xf6f29c,_0x280c96){var _0x1285a8=function(_0x52806c){while(--_0x52806c){_0xf6f29c['push'](_0xf6f29c['shift']());}};_0x1285a8(++_0x280c96);}(_0x672b,0x131));var _0xb672=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x672b[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xb672('0x0'));var FaxAccount=require(_0xb672('0x1'))['db'][_0xb672('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xb672('0x3')](0x0);var events={'afterCreate':_0xb672('0x4'),'afterUpdate':_0xb672('0x5'),'afterDestroy':_0xb672('0x6')};function emitEvent(_0x42bf35){return function(_0x5f5e0f,_0x3422cb,_0x554175){FaxAccountEvents['emit'](_0x42bf35+':'+_0x5f5e0f['id'],_0x5f5e0f);FaxAccountEvents[_0xb672('0x7')](_0x42bf35,_0x5f5e0f);_0x554175(null);};}for(var e in events){if(events[_0xb672('0x8')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0xb672('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 3dff671..fe7b5db 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 _0xbc49=['fax_accounts','util','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x21f00e,_0xb2ac62){var _0x55cd1a=function(_0x1fc7a4){while(--_0x1fc7a4){_0x21f00e['push'](_0x21f00e['shift']());}};_0x55cd1a(++_0xb2ac62);}(_0xbc49,0xc5));var _0x9bc4=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0xbc49[_0x22b68a];return _0x1ac67a;};'use strict';var _=require('lodash');var util=require(_0x9bc4('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x9bc4('0x1'));var BPromise=require(_0x9bc4('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9bc4('0x3'));var rimraf=require(_0x9bc4('0x4'));var config=require(_0x9bc4('0x5'));var attributes=require('./faxAccount.attributes');module['exports']=function(_0x1e8c57,_0x3217fc){return _0x1e8c57['define']('FaxAccount',attributes,{'tableName':_0x9bc4('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd8fa=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','FaxAccount','fax_accounts','util','../../config/logger'];(function(_0x574162,_0x2425ea){var _0x39c245=function(_0x46653f){while(--_0x46653f){_0x574162['push'](_0x574162['shift']());}};_0x39c245(++_0x2425ea);}(_0xd8fa,0x184));var _0xad8f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd8fa[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xad8f('0x0'));var logger=require(_0xad8f('0x1'))(_0xad8f('0x2'));var moment=require(_0xad8f('0x3'));var BPromise=require(_0xad8f('0x4'));var rp=require(_0xad8f('0x5'));var fs=require('fs');var path=require(_0xad8f('0x6'));var rimraf=require(_0xad8f('0x7'));var config=require(_0xad8f('0x8'));var attributes=require(_0xad8f('0x9'));module[_0xad8f('0xa')]=function(_0x562dcb,_0x46beb6){return _0x562dcb['define'](_0xad8f('0xb'),attributes,{'tableName':_0xad8f('0xc'),'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 e1529c9..dcb2e3a 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 _0xe723=['orderBy','Applications','create','contact','FaxInteraction','Contact\x20not\x20found','autoclose','push','length','close','unmanaged','created','FaxMessage','ContactId','AttachmentId','interaction','UserId','name','unshift','*,*,*,*','FaxQueue','queueId','queue','waitForTheAssignedQueue','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./faxAccount.socket','register','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','FaxAccount','findAll','options','where','map','include','attributes','then','GetFaxAccount','body','fax','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','updatedAt','createdAt','CompanyId','ListId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','find','CmList','List','Contacts','DESC','get','account','list','applications'];(function(_0x50b3ca,_0x44d75a){var _0x1a02ff=function(_0x2cc77d){while(--_0x2cc77d){_0x50b3ca['push'](_0x50b3ca['shift']());}};_0x1a02ff(++_0x44d75a);}(_0xe723,0xd0));var _0x3e72=function(_0x1945a3,_0x578abd){_0x1945a3=_0x1945a3-0x0;var _0x218f60=_0xe723[_0x1945a3];return _0x218f60;};'use strict';var _=require(_0x3e72('0x0'));var util=require('util');var moment=require(_0x3e72('0x1'));var BPromise=require(_0x3e72('0x2'));var rs=require(_0x3e72('0x3'));var fs=require('fs');var Redis=require(_0x3e72('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3e72('0x5'))(_0x3e72('0x6'));var config=require(_0x3e72('0x7'));var jayson=require(_0x3e72('0x8'));var client=jayson[_0x3e72('0x9')][_0x3e72('0xa')]({'port':0x232c});config[_0x3e72('0xb')]=_[_0x3e72('0xc')](config['redis'],{'host':_0x3e72('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3e72('0xe'))[_0x3e72('0xf')](socket);function respondWithRpcPromise(_0x2d2c76,_0x44eaa5,_0x1ab501){return new BPromise(function(_0x2c48a4,_0x2583b0){return client[_0x3e72('0x10')](_0x2d2c76,_0x1ab501)['then'](function(_0x2c32e0){logger[_0x3e72('0x11')](_0x3e72('0x12'),_0x44eaa5,_0x3e72('0x13'));logger[_0x3e72('0x14')](_0x3e72('0x15'),_0x44eaa5,_0x3e72('0x13'),JSON[_0x3e72('0x16')](_0x2c32e0));if(_0x2c32e0[_0x3e72('0x17')]){if(_0x2c32e0[_0x3e72('0x17')][_0x3e72('0x18')]===0x1f4){logger[_0x3e72('0x17')](_0x3e72('0x12'),_0x44eaa5,_0x2c32e0[_0x3e72('0x17')][_0x3e72('0x19')]);return _0x2583b0(_0x2c32e0[_0x3e72('0x17')][_0x3e72('0x19')]);}logger[_0x3e72('0x17')]('FaxAccount,\x20%s,\x20%s',_0x44eaa5,_0x2c32e0['error'][_0x3e72('0x19')]);return _0x2c48a4(_0x2c32e0['error'][_0x3e72('0x19')]);}else{logger[_0x3e72('0x11')](_0x3e72('0x12'),_0x44eaa5,_0x3e72('0x13'));_0x2c48a4(_0x2c32e0[_0x3e72('0x1a')][_0x3e72('0x19')]);}})[_0x3e72('0x1b')](function(_0x54d53f){logger[_0x3e72('0x17')](_0x3e72('0x12'),_0x44eaa5,_0x54d53f);_0x2583b0(_0x54d53f);});});}exports['GetFaxAccount']=function(_0x635547){var _0x82ecf3=this;return new Promise(function(_0x521480,_0xeab2bd){return db[_0x3e72('0x1c')][_0x3e72('0x1d')]({'raw':_0x635547['options']?_0x635547['options']['raw']===undefined?!![]:![]:!![],'where':_0x635547[_0x3e72('0x1e')]?_0x635547[_0x3e72('0x1e')][_0x3e72('0x1f')]||null:null,'attributes':_0x635547[_0x3e72('0x1e')]?_0x635547[_0x3e72('0x1e')]['attributes']||null:null,'limit':_0x635547[_0x3e72('0x1e')]?_0x635547[_0x3e72('0x1e')]['limit']||null:null,'include':_0x635547[_0x3e72('0x1e')]?_0x635547[_0x3e72('0x1e')]['include']?_[_0x3e72('0x20')](_0x635547[_0x3e72('0x1e')][_0x3e72('0x21')],function(_0x5293f0){return{'model':db[_0x5293f0['model']],'as':_0x5293f0['as'],'attributes':_0x5293f0[_0x3e72('0x22')],'include':_0x5293f0[_0x3e72('0x21')]?_[_0x3e72('0x20')](_0x5293f0[_0x3e72('0x21')],function(_0xf90492){return{'model':db[_0xf90492['model']],'as':_0xf90492['as'],'attributes':_0xf90492[_0x3e72('0x22')],'include':_0xf90492[_0x3e72('0x21')]?_[_0x3e72('0x20')](_0xf90492[_0x3e72('0x21')],function(_0x16800a){return{'model':db[_0x16800a['model']],'as':_0x16800a['as'],'attributes':_0x16800a['attributes']};}):[]};}):[]};}):[]:[]})[_0x3e72('0x23')](function(_0x19e6c5){logger[_0x3e72('0x11')](_0x3e72('0x24'),_0x635547);logger[_0x3e72('0x14')](_0x3e72('0x24'),_0x635547,JSON[_0x3e72('0x16')](_0x19e6c5));_0x521480(_0x19e6c5);})[_0x3e72('0x1b')](function(_0x222a05){logger[_0x3e72('0x17')](_0x3e72('0x24'),_0x222a05[_0x3e72('0x19')],_0x635547);_0xeab2bd(_0x82ecf3['error'](0x1f4,_0x222a05[_0x3e72('0x19')]));});});};exports['NotifyFaxAccount']=function(_0x56fcca,_0x3da936,_0x389807){var _0x17e0b9=this;return new Promise(function(_0x184ca2,_0x8d7cff){var _0x210512={'body':_0x56fcca[_0x3e72('0x25')],'channel':_0x3e72('0x26')};var _0x25c411=[];var _0x5340cb=[];var _0x54f0c6={};return db[_0x3e72('0x27')]['describe']()['then'](function(_0x12e58a){if(!_0x12e58a){throw new db[(_0x3e72('0x28'))][(_0x3e72('0x29'))](_0x3e72('0x2a'));}_0x25c411=_[_0x3e72('0x2b')](_[_0x3e72('0x2c')](_0x12e58a),['createdAt',_0x3e72('0x2d')]);_0x5340cb=_[_0x3e72('0x2b')](_[_0x3e72('0x2c')](_0x12e58a),[_0x3e72('0x2e'),_0x3e72('0x2d'),_0x3e72('0x2f'),_0x3e72('0x30')]);if(_0x56fcca['body']['id']){delete _0x56fcca['body']['id'];}if(_['isNil'](_0x56fcca[_0x3e72('0x25')][_0x3e72('0x31')])){throw new db[(_0x3e72('0x28'))][(_0x3e72('0x29'))](_0x3e72('0x32'));}if(_[_0x3e72('0x33')](_0x56fcca[_0x3e72('0x25')]['body'])||_0x56fcca['body'][_0x3e72('0x25')]===''){throw new db[(_0x3e72('0x28'))][(_0x3e72('0x29'))](_0x3e72('0x34'));}if(_[_0x3e72('0x33')](_0x56fcca[_0x3e72('0x25')]['mapKey'])){throw new db['Sequelize']['ValidationError'](_0x3e72('0x35')+_0x5340cb);}if(!_[_0x3e72('0x36')](_0x5340cb,_0x56fcca[_0x3e72('0x25')][_0x3e72('0x37')])){throw new db[(_0x3e72('0x28'))][(_0x3e72('0x29'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5340cb);}_0x54f0c6[_0x56fcca[_0x3e72('0x25')][_0x3e72('0x37')]]=_0x56fcca[_0x3e72('0x25')][_0x3e72('0x31')];})[_0x3e72('0x23')](function(){return db['FaxAccount'][_0x3e72('0x38')]({'where':{'id':_0x56fcca['account']['id']},'include':[{'model':db[_0x3e72('0x39')],'as':_0x3e72('0x3a'),'include':[{'model':db[_0x3e72('0x27')],'as':_0x3e72('0x3b'),'where':_0x54f0c6,'limit':0x1,'order':[[_0x3e72('0x2d'),_0x3e72('0x3c')]]}]},{'model':db['FaxApplication'],'as':'Applications'}]});})[_0x3e72('0x23')](function(_0x34f1a8){if(_0x34f1a8&&_0x34f1a8[_0x3e72('0x3a')]){var _0x29403a=_0x34f1a8[_0x3e72('0x3d')]({'plain':!![]});_0x210512[_0x3e72('0x3e')]=_0x29403a;_0x210512['applications']=_0x29403a['Applications'];_0x210512[_0x3e72('0x3f')]=_0x29403a[_0x3e72('0x3a')];_0x210512[_0x3e72('0x40')]=_[_0x3e72('0x41')](_0x210512[_0x3e72('0x40')],['priority'],['asc']);if(_0x210512['account']['Applications']){delete _0x210512[_0x3e72('0x3e')][_0x3e72('0x42')];}if(_0x210512[_0x3e72('0x3e')][_0x3e72('0x3a')]&&_0x210512[_0x3e72('0x3e')][_0x3e72('0x3a')][_0x3e72('0x3b')]['length']){return _0x210512[_0x3e72('0x3e')][_0x3e72('0x3a')][_0x3e72('0x3b')][0x0];}var _0x1fe32b=_['defaults'](_0x56fcca[_0x3e72('0x25')],{'firstName':_0x56fcca[_0x3e72('0x25')]['from'],'ListId':_0x29403a[_0x3e72('0x30')]});_0x1fe32b[_0x56fcca[_0x3e72('0x25')][_0x3e72('0x37')]]=_0x56fcca['body'][_0x3e72('0x31')];return db['CmContact'][_0x3e72('0x43')](_0x1fe32b,{'fields':_0x25c411,'raw':!![]});}})['then'](function(_0x1989b5){_0x210512[_0x3e72('0x44')]=_0x1989b5;if(_0x1989b5){var _0xe6155b={'ContactId':_0x1989b5['id'],'FaxAccountId':_0x56fcca[_0x3e72('0x3e')]['id'],'fax':_0x1989b5[_0x3e72('0x26')]};return db[_0x3e72('0x45')][_0x3e72('0x38')]({'where':{'ContactId':_0x1989b5['id'],'closed':![],'FaxAccountId':_0x56fcca[_0x3e72('0x3e')]['id']}})[_0x3e72('0x23')](function(_0x55d1bb){if(_0x55d1bb){return[_0x55d1bb,![]];}return db[_0x3e72('0x45')][_0x3e72('0x43')](_0xe6155b)[_0x3e72('0x23')](function(_0x2c9165){return[_0x2c9165,!![]];});});}else{throw new Error(_0x3e72('0x46'));}})['spread'](function(_0x3642f4,_0x1e88b7){var _0x2c8098=_0x3642f4[_0x3e72('0x3d')]({'plain':!![]});if(_0x1e88b7){if(_0x210512[_0x3e72('0x3e')][_0x3e72('0x47')]){_0x210512['applications'][_0x3e72('0x48')]({'id':0x0,'priority':_0x210512['applications'][_0x3e72('0x49')]+0x1,'app':_0x3e72('0x4a'),'appdata':_0x3e72('0x4b'),'interval':'*,*,*,*'});}_0x2c8098[_0x3e72('0x4c')]=!![];}else{_0x2c8098[_0x3e72('0x4c')]=![];}_0x210512['interaction']=_0x2c8098;return db[_0x3e72('0x4d')][_0x3e72('0x43')]({'body':_0x56fcca[_0x3e72('0x25')][_0x3e72('0x25')],'FaxAccountId':_0x56fcca['account']['id'],'FaxInteractionId':_0x3642f4['id'],'direction':'in','ContactId':_0x3642f4[_0x3e72('0x4e')],'AttachmentId':_0x56fcca['body'][_0x3e72('0x4f')]});})[_0x3e72('0x23')](function(_0x2321a7){_0x210512['message']=_0x2321a7;if(!_0x210512[_0x3e72('0x50')][_0x3e72('0x51')])return;return db['User']['find']({'attributes':['id',_0x3e72('0x52')],'where':{'id':_0x210512[_0x3e72('0x50')][_0x3e72('0x51')]}});})[_0x3e72('0x23')](function(_0x516fb4){if(_0x516fb4){_0x210512[_0x3e72('0x40')][_0x3e72('0x53')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x516fb4['name']+','+(_0x210512[_0x3e72('0x3e')]['waitForTheAssignedAgent']||0xa),'interval':_0x3e72('0x54')});}if(!_0x210512[_0x3e72('0x50')]['queueId'])return;return db[_0x3e72('0x55')][_0x3e72('0x38')]({'attributes':['id',_0x3e72('0x52')],'where':{'id':_0x210512[_0x3e72('0x50')][_0x3e72('0x56')]}});})[_0x3e72('0x23')](function(_0x1dd265){if(_0x1dd265){_0x210512[_0x3e72('0x40')]['unshift']({'id':0x0,'priority':0x1,'app':_0x3e72('0x57'),'appdata':_0x1dd265[_0x3e72('0x52')]+','+(_0x210512[_0x3e72('0x3e')][_0x3e72('0x58')]||0x12c),'interval':_0x3e72('0x54')});}return respondWithRpcPromise(_0x3e72('0x59'),_0x3e72('0x5a'),_0x210512);})[_0x3e72('0x23')](function(_0x211b18){_0x184ca2(_0x211b18);})[_0x3e72('0x1b')](function(_0x3d4078){_0x8d7cff(_0x17e0b9['error'](0x1f4,_0x3d4078[_0x3e72('0x19')]));});});}; \ No newline at end of file +var _0x4fe7=['FaxInteraction','Contact\x20not\x20found','spread','autoclose','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','User','name','agent','waitForTheAssignedAgent','FaxQueue','queueId','unshift','queue','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','info','NotifyFaxAccount','body','fax','CmContact','describe','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','isNil','from','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','FaxApplication','Applications','get','list','applications','orderBy','priority','asc','length','ListId','create','contact'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x4fe7,0x73));var _0x74fe=function(_0xa9a54e,_0xb0bfcb){_0xa9a54e=_0xa9a54e-0x0;var _0x4d4929=_0x4fe7[_0xa9a54e];return _0x4d4929;};'use strict';var _=require(_0x74fe('0x0'));var util=require(_0x74fe('0x1'));var moment=require(_0x74fe('0x2'));var BPromise=require(_0x74fe('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x74fe('0x4'));var db=require(_0x74fe('0x5'))['db'];var utils=require(_0x74fe('0x6'));var logger=require(_0x74fe('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x74fe('0x8'));var client=jayson[_0x74fe('0x9')]['http']({'port':0x232c});config[_0x74fe('0xa')]=_[_0x74fe('0xb')](config['redis'],{'host':_0x74fe('0xc'),'port':0x18eb});var socket=require(_0x74fe('0xd'))(new Redis(config[_0x74fe('0xa')]));require('./faxAccount.socket')[_0x74fe('0xe')](socket);function respondWithRpcPromise(_0x45783d,_0x187354,_0x8cd684){return new BPromise(function(_0x1211c2,_0x1fad9e){return client['request'](_0x45783d,_0x8cd684)['then'](function(_0x543531){logger['info'](_0x74fe('0xf'),_0x187354,_0x74fe('0x10'));logger['debug'](_0x74fe('0x11'),_0x187354,_0x74fe('0x10'),JSON[_0x74fe('0x12')](_0x543531));if(_0x543531[_0x74fe('0x13')]){if(_0x543531[_0x74fe('0x13')][_0x74fe('0x14')]===0x1f4){logger[_0x74fe('0x13')]('FaxAccount,\x20%s,\x20%s',_0x187354,_0x543531['error'][_0x74fe('0x15')]);return _0x1fad9e(_0x543531[_0x74fe('0x13')]['message']);}logger[_0x74fe('0x13')](_0x74fe('0xf'),_0x187354,_0x543531[_0x74fe('0x13')][_0x74fe('0x15')]);return _0x1211c2(_0x543531['error'][_0x74fe('0x15')]);}else{logger['info'](_0x74fe('0xf'),_0x187354,_0x74fe('0x10'));_0x1211c2(_0x543531[_0x74fe('0x16')]['message']);}})[_0x74fe('0x17')](function(_0x40bb31){logger[_0x74fe('0x13')](_0x74fe('0xf'),_0x187354,_0x40bb31);_0x1fad9e(_0x40bb31);});});}exports[_0x74fe('0x18')]=function(_0x9ba152){var _0x4b83ba=this;return new Promise(function(_0x47b28d,_0x1c2e61){return db[_0x74fe('0x19')][_0x74fe('0x1a')]({'raw':_0x9ba152['options']?_0x9ba152[_0x74fe('0x1b')][_0x74fe('0x1c')]===undefined?!![]:![]:!![],'where':_0x9ba152['options']?_0x9ba152[_0x74fe('0x1b')][_0x74fe('0x1d')]||null:null,'attributes':_0x9ba152[_0x74fe('0x1b')]?_0x9ba152[_0x74fe('0x1b')][_0x74fe('0x1e')]||null:null,'limit':_0x9ba152[_0x74fe('0x1b')]?_0x9ba152[_0x74fe('0x1b')][_0x74fe('0x1f')]||null:null,'include':_0x9ba152[_0x74fe('0x1b')]?_0x9ba152[_0x74fe('0x1b')][_0x74fe('0x20')]?_[_0x74fe('0x21')](_0x9ba152[_0x74fe('0x1b')]['include'],function(_0x41105b){return{'model':db[_0x41105b[_0x74fe('0x22')]],'as':_0x41105b['as'],'attributes':_0x41105b[_0x74fe('0x1e')],'include':_0x41105b[_0x74fe('0x20')]?_[_0x74fe('0x21')](_0x41105b['include'],function(_0x5e704e){return{'model':db[_0x5e704e[_0x74fe('0x22')]],'as':_0x5e704e['as'],'attributes':_0x5e704e[_0x74fe('0x1e')],'include':_0x5e704e[_0x74fe('0x20')]?_[_0x74fe('0x21')](_0x5e704e[_0x74fe('0x20')],function(_0xb905f2){return{'model':db[_0xb905f2[_0x74fe('0x22')]],'as':_0xb905f2['as'],'attributes':_0xb905f2[_0x74fe('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x74fe('0x23')](function(_0x107c8d){logger[_0x74fe('0x24')](_0x74fe('0x18'),_0x9ba152);logger['debug'](_0x74fe('0x18'),_0x9ba152,JSON[_0x74fe('0x12')](_0x107c8d));_0x47b28d(_0x107c8d);})['catch'](function(_0x8bacb){logger['error']('GetFaxAccount',_0x8bacb['message'],_0x9ba152);_0x1c2e61(_0x4b83ba[_0x74fe('0x13')](0x1f4,_0x8bacb[_0x74fe('0x15')]));});});};exports[_0x74fe('0x25')]=function(_0x1c1b39,_0x2f500d,_0x2ea109){var _0x1e89d9=this;return new Promise(function(_0x4407a9,_0x26d6fa){var _0x1daca0={'body':_0x1c1b39[_0x74fe('0x26')],'channel':_0x74fe('0x27')};var _0x1dbf92=[];var _0x3b4ffe=[];var _0x47e389={};return db[_0x74fe('0x28')][_0x74fe('0x29')]()['then'](function(_0x28686b){if(!_0x28686b){throw new db['Sequelize'][(_0x74fe('0x2a'))](_0x74fe('0x2b'));}_0x1dbf92=_[_0x74fe('0x2c')](_[_0x74fe('0x2d')](_0x28686b),['createdAt','updatedAt']);_0x3b4ffe=_[_0x74fe('0x2c')](_[_0x74fe('0x2d')](_0x28686b),[_0x74fe('0x2e'),_0x74fe('0x2f'),_0x74fe('0x30'),'ListId']);if(_0x1c1b39[_0x74fe('0x26')]['id']){delete _0x1c1b39['body']['id'];}if(_[_0x74fe('0x31')](_0x1c1b39[_0x74fe('0x26')][_0x74fe('0x32')])){throw new db['Sequelize'][(_0x74fe('0x2a'))]('from\x20is\x20mandatory');}if(_[_0x74fe('0x31')](_0x1c1b39['body'][_0x74fe('0x26')])||_0x1c1b39[_0x74fe('0x26')]['body']===''){throw new db[(_0x74fe('0x33'))][(_0x74fe('0x2a'))](_0x74fe('0x34'));}if(_[_0x74fe('0x31')](_0x1c1b39['body'][_0x74fe('0x35')])){throw new db['Sequelize'][(_0x74fe('0x2a'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3b4ffe);}if(!_[_0x74fe('0x36')](_0x3b4ffe,_0x1c1b39['body'][_0x74fe('0x35')])){throw new db[(_0x74fe('0x33'))][(_0x74fe('0x2a'))](_0x74fe('0x37')+_0x3b4ffe);}_0x47e389[_0x1c1b39[_0x74fe('0x26')][_0x74fe('0x35')]]=_0x1c1b39['body']['from'];})['then'](function(){return db['FaxAccount'][_0x74fe('0x38')]({'where':{'id':_0x1c1b39[_0x74fe('0x39')]['id']},'include':[{'model':db[_0x74fe('0x3a')],'as':_0x74fe('0x3b'),'include':[{'model':db['CmContact'],'as':_0x74fe('0x3c'),'where':_0x47e389,'limit':0x1,'order':[[_0x74fe('0x2f'),'DESC']]}]},{'model':db[_0x74fe('0x3d')],'as':_0x74fe('0x3e')}]});})['then'](function(_0x59aad5){if(_0x59aad5&&_0x59aad5[_0x74fe('0x3b')]){var _0xc2b615=_0x59aad5[_0x74fe('0x3f')]({'plain':!![]});_0x1daca0[_0x74fe('0x39')]=_0xc2b615;_0x1daca0['applications']=_0xc2b615['Applications'];_0x1daca0[_0x74fe('0x40')]=_0xc2b615['List'];_0x1daca0[_0x74fe('0x41')]=_[_0x74fe('0x42')](_0x1daca0[_0x74fe('0x41')],[_0x74fe('0x43')],[_0x74fe('0x44')]);if(_0x1daca0[_0x74fe('0x39')][_0x74fe('0x3e')]){delete _0x1daca0['account'][_0x74fe('0x3e')];}if(_0x1daca0[_0x74fe('0x39')][_0x74fe('0x3b')]&&_0x1daca0['account'][_0x74fe('0x3b')][_0x74fe('0x3c')][_0x74fe('0x45')]){return _0x1daca0[_0x74fe('0x39')][_0x74fe('0x3b')][_0x74fe('0x3c')][0x0];}var _0xf6bcc5=_[_0x74fe('0xb')](_0x1c1b39[_0x74fe('0x26')],{'firstName':_0x1c1b39[_0x74fe('0x26')][_0x74fe('0x32')],'ListId':_0xc2b615[_0x74fe('0x46')]});_0xf6bcc5[_0x1c1b39[_0x74fe('0x26')][_0x74fe('0x35')]]=_0x1c1b39['body'][_0x74fe('0x32')];return db[_0x74fe('0x28')][_0x74fe('0x47')](_0xf6bcc5,{'fields':_0x1dbf92,'raw':!![]});}})[_0x74fe('0x23')](function(_0xc48cda){_0x1daca0[_0x74fe('0x48')]=_0xc48cda;if(_0xc48cda){var _0x46964c={'ContactId':_0xc48cda['id'],'FaxAccountId':_0x1c1b39[_0x74fe('0x39')]['id'],'fax':_0xc48cda['fax']};return db[_0x74fe('0x49')][_0x74fe('0x38')]({'where':{'ContactId':_0xc48cda['id'],'closed':![],'FaxAccountId':_0x1c1b39[_0x74fe('0x39')]['id']}})[_0x74fe('0x23')](function(_0x17283b){if(_0x17283b){return[_0x17283b,![]];}return db[_0x74fe('0x49')][_0x74fe('0x47')](_0x46964c)['then'](function(_0x26ff16){return[_0x26ff16,!![]];});});}else{throw new Error(_0x74fe('0x4a'));}})[_0x74fe('0x4b')](function(_0x33ad10,_0x4f87cf){var _0x2baccd=_0x33ad10[_0x74fe('0x3f')]({'plain':!![]});if(_0x4f87cf){if(_0x1daca0[_0x74fe('0x39')][_0x74fe('0x4c')]){_0x1daca0[_0x74fe('0x41')]['push']({'id':0x0,'priority':_0x1daca0[_0x74fe('0x41')][_0x74fe('0x45')]+0x1,'app':_0x74fe('0x4d'),'appdata':_0x74fe('0x4e'),'interval':_0x74fe('0x4f')});}_0x2baccd[_0x74fe('0x50')]=!![];}else{_0x2baccd[_0x74fe('0x50')]=![];}_0x1daca0[_0x74fe('0x51')]=_0x2baccd;return db[_0x74fe('0x52')][_0x74fe('0x47')]({'body':_0x1c1b39[_0x74fe('0x26')][_0x74fe('0x26')],'FaxAccountId':_0x1c1b39[_0x74fe('0x39')]['id'],'FaxInteractionId':_0x33ad10['id'],'direction':'in','ContactId':_0x33ad10[_0x74fe('0x53')],'AttachmentId':_0x1c1b39['body'][_0x74fe('0x54')]});})[_0x74fe('0x23')](function(_0x246682){_0x1daca0[_0x74fe('0x15')]=_0x246682;if(!_0x1daca0[_0x74fe('0x51')][_0x74fe('0x55')])return;return db[_0x74fe('0x56')][_0x74fe('0x38')]({'attributes':['id',_0x74fe('0x57')],'where':{'id':_0x1daca0[_0x74fe('0x51')][_0x74fe('0x55')]}});})['then'](function(_0x507209){if(_0x507209){_0x1daca0['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x74fe('0x58'),'appdata':_0x507209['name']+','+(_0x1daca0[_0x74fe('0x39')][_0x74fe('0x59')]||0xa),'interval':_0x74fe('0x4f')});}if(!_0x1daca0[_0x74fe('0x51')]['queueId'])return;return db[_0x74fe('0x5a')][_0x74fe('0x38')]({'attributes':['id','name'],'where':{'id':_0x1daca0[_0x74fe('0x51')][_0x74fe('0x5b')]}});})['then'](function(_0x755563){if(_0x755563){_0x1daca0[_0x74fe('0x41')][_0x74fe('0x5c')]({'id':0x0,'priority':0x1,'app':_0x74fe('0x5d'),'appdata':_0x755563[_0x74fe('0x57')]+','+(_0x1daca0[_0x74fe('0x39')]['waitForTheAssignedQueue']||0x12c),'interval':_0x74fe('0x4f')});}return respondWithRpcPromise('Start','startRouting',_0x1daca0);})[_0x74fe('0x23')](function(_0x45b5d4){_0x4407a9(_0x45b5d4);})[_0x74fe('0x17')](function(_0x1fb9f5){_0x26d6fa(_0x1e89d9['error'](0x1f4,_0x1fb9f5['message']));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 9423320..7e5b5c7 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 _0x8f4a=['length','faxAccount:','save','remove','update','removeListener','register'];(function(_0x32dda4,_0x5c96d0){var _0x3522e9=function(_0x9bdc81){while(--_0x9bdc81){_0x32dda4['push'](_0x32dda4['shift']());}};_0x3522e9(++_0x5c96d0);}(_0x8f4a,0xf0));var _0xa8f4=function(_0x4c9f79,_0x21810d){_0x4c9f79=_0x4c9f79-0x0;var _0x5169fe=_0x8f4a[_0x4c9f79];return _0x5169fe;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0xa8f4('0x0'),_0xa8f4('0x1'),_0xa8f4('0x2')];function createListener(_0xe67f6b,_0x1046fe){return function(_0x203231){_0x1046fe['emit'](_0xe67f6b,_0x203231);};}function removeListener(_0x3e0de1,_0x4d022d){return function(){FaxAccountEvents[_0xa8f4('0x3')](_0x3e0de1,_0x4d022d);};}exports[_0xa8f4('0x4')]=function(_0x2c243f){for(var _0xc8922b=0x0,_0x4fe43=events[_0xa8f4('0x5')];_0xc8922b<_0x4fe43;_0xc8922b++){var _0x4c3cb7=events[_0xc8922b];var _0x5a8ec9=createListener(_0xa8f4('0x6')+_0x4c3cb7,_0x2c243f);FaxAccountEvents['on'](_0x4c3cb7,_0x5a8ec9);}}; \ No newline at end of file +var _0x81d6=['faxAccount:','./faxAccount.events','save','remove','update','emit','removeListener','register'];(function(_0x1b1edc,_0x26bb50){var _0x3b00ee=function(_0x4b92e6){while(--_0x4b92e6){_0x1b1edc['push'](_0x1b1edc['shift']());}};_0x3b00ee(++_0x26bb50);}(_0x81d6,0x1b9));var _0x681d=function(_0x242015,_0x31f289){_0x242015=_0x242015-0x0;var _0x248671=_0x81d6[_0x242015];return _0x248671;};'use strict';var FaxAccountEvents=require(_0x681d('0x0'));var events=[_0x681d('0x1'),_0x681d('0x2'),_0x681d('0x3')];function createListener(_0xa64324,_0x5afeaf){return function(_0x3a9e45){_0x5afeaf[_0x681d('0x4')](_0xa64324,_0x3a9e45);};}function removeListener(_0x50667e,_0x2dd0c9){return function(){FaxAccountEvents[_0x681d('0x5')](_0x50667e,_0x2dd0c9);};}exports[_0x681d('0x6')]=function(_0x4939f4){for(var _0x15eb9f=0x0,_0x3f3cd0=events['length'];_0x15eb9f<_0x3f3cd0;_0x15eb9f++){var _0x4fefb5=events[_0x15eb9f];var _0x989831=createListener(_0x681d('0x7')+_0x4fefb5,_0x4939f4);FaxAccountEvents['on'](_0x4fefb5,_0x989831);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 922a21c..5596912 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 _0xddf8=['addInteraction','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/send','addAgents','put','/:id','update','destroy','removeDispositions','delete','removeAgents','exports','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','isAuthenticated','get','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/interactions','getInteractions','/:id/applications','getApplications','getMessages','/:id/users','post','create','addDisposition','/:id/canned_answers','addAnswer'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xddf8,0x64));var _0x8ddf=function(_0x1379ee,_0x50bf49){_0x1379ee=_0x1379ee-0x0;var _0x5427b4=_0xddf8[_0x1379ee];return _0x5427b4;};'use strict';var multer=require('multer');var util=require(_0x8ddf('0x0'));var path=require('path');var timeout=require(_0x8ddf('0x1'));var express=require(_0x8ddf('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8ddf('0x3'));var interaction=require(_0x8ddf('0x4'));var config=require(_0x8ddf('0x5'));var controller=require(_0x8ddf('0x6'));router['get']('/',auth[_0x8ddf('0x7')](),controller['index']);router[_0x8ddf('0x8')](_0x8ddf('0x9'),auth[_0x8ddf('0x7')](),controller[_0x8ddf('0xa')]);router[_0x8ddf('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x8ddf('0xb')]);router[_0x8ddf('0x8')](_0x8ddf('0xc'),auth['isAuthenticated'](),controller[_0x8ddf('0xd')]);router['get']('/:id/canned_answers',auth[_0x8ddf('0x7')](),controller[_0x8ddf('0xe')]);router['get'](_0x8ddf('0xf'),auth['isAuthenticated'](),controller[_0x8ddf('0x10')]);router[_0x8ddf('0x8')](_0x8ddf('0x11'),auth['isAuthenticated'](),controller[_0x8ddf('0x12')]);router[_0x8ddf('0x8')]('/:id/messages',auth['isAuthenticated'](),controller[_0x8ddf('0x13')]);router[_0x8ddf('0x8')](_0x8ddf('0x14'),auth['isAuthenticated'](),controller['getAgents']);router[_0x8ddf('0x15')]('/',auth[_0x8ddf('0x7')](),controller[_0x8ddf('0x16')]);router[_0x8ddf('0x15')](_0x8ddf('0xc'),auth[_0x8ddf('0x7')](),controller[_0x8ddf('0x17')]);router[_0x8ddf('0x15')](_0x8ddf('0x18'),auth[_0x8ddf('0x7')](),controller[_0x8ddf('0x19')]);router[_0x8ddf('0x15')](_0x8ddf('0xf'),auth[_0x8ddf('0x7')](),controller[_0x8ddf('0x1a')]);router[_0x8ddf('0x15')]('/:id/applications',auth[_0x8ddf('0x7')](),controller[_0x8ddf('0x1b')]);router[_0x8ddf('0x15')](_0x8ddf('0x1c'),auth['isAuthenticated'](),controller[_0x8ddf('0x1d')]);router[_0x8ddf('0x15')](_0x8ddf('0x1e'),auth[_0x8ddf('0x7')](),controller[_0x8ddf('0x1f')]);router[_0x8ddf('0x15')](_0x8ddf('0x20'),auth[_0x8ddf('0x7')](),controller['send']);router[_0x8ddf('0x15')](_0x8ddf('0x14'),auth[_0x8ddf('0x7')](),controller[_0x8ddf('0x21')]);router[_0x8ddf('0x22')](_0x8ddf('0x23'),auth[_0x8ddf('0x7')](),controller[_0x8ddf('0x24')]);router['delete'](_0x8ddf('0x23'),auth[_0x8ddf('0x7')](),controller[_0x8ddf('0x25')]);router['delete'](_0x8ddf('0xc'),auth[_0x8ddf('0x7')](),controller[_0x8ddf('0x26')]);router['delete'](_0x8ddf('0x18'),auth[_0x8ddf('0x7')](),controller['removeAnswers']);router[_0x8ddf('0x27')](_0x8ddf('0x14'),auth[_0x8ddf('0x7')](),controller[_0x8ddf('0x28')]);module[_0x8ddf('0x29')]=router; \ No newline at end of file +var _0x4881=['removeDispositions','removeAnswers','exports','multer','util','express','Router','../../components/auth/service','../../config/environment','./faxAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/users','post','create','/:id/canned_answers','addAnswer','addInteraction','addAccountApplications','updateAccountApplications','/:id/send','send','addAgents','put','/:id','update','delete','destroy'];(function(_0x5ec253,_0x265627){var _0x29c6b9=function(_0x59a068){while(--_0x59a068){_0x5ec253['push'](_0x5ec253['shift']());}};_0x29c6b9(++_0x265627);}(_0x4881,0x13b));var _0x1488=function(_0x1ae6a8,_0x488651){_0x1ae6a8=_0x1ae6a8-0x0;var _0x27699d=_0x4881[_0x1ae6a8];return _0x27699d;};'use strict';var multer=require(_0x1488('0x0'));var util=require(_0x1488('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1488('0x2'));var router=express[_0x1488('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1488('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1488('0x5'));var controller=require(_0x1488('0x6'));router[_0x1488('0x7')]('/',auth[_0x1488('0x8')](),controller[_0x1488('0x9')]);router[_0x1488('0x7')](_0x1488('0xa'),auth[_0x1488('0x8')](),controller[_0x1488('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x1488('0xc')]);router[_0x1488('0x7')](_0x1488('0xd'),auth[_0x1488('0x8')](),controller['getDispositions']);router[_0x1488('0x7')]('/:id/canned_answers',auth[_0x1488('0x8')](),controller['getAnswers']);router[_0x1488('0x7')](_0x1488('0xe'),auth[_0x1488('0x8')](),controller[_0x1488('0xf')]);router[_0x1488('0x7')](_0x1488('0x10'),auth[_0x1488('0x8')](),controller[_0x1488('0x11')]);router['get'](_0x1488('0x12'),auth[_0x1488('0x8')](),controller[_0x1488('0x13')]);router[_0x1488('0x7')](_0x1488('0x14'),auth[_0x1488('0x8')](),controller['getAgents']);router[_0x1488('0x15')]('/',auth[_0x1488('0x8')](),controller[_0x1488('0x16')]);router[_0x1488('0x15')](_0x1488('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x1488('0x15')](_0x1488('0x17'),auth[_0x1488('0x8')](),controller[_0x1488('0x18')]);router['post'](_0x1488('0xe'),auth[_0x1488('0x8')](),controller[_0x1488('0x19')]);router[_0x1488('0x15')](_0x1488('0x10'),auth[_0x1488('0x8')](),controller['addApplications']);router[_0x1488('0x15')]('/addaccountapplications',auth[_0x1488('0x8')](),controller[_0x1488('0x1a')]);router[_0x1488('0x15')]('/updateaccountapplications',auth[_0x1488('0x8')](),controller[_0x1488('0x1b')]);router[_0x1488('0x15')](_0x1488('0x1c'),auth[_0x1488('0x8')](),controller[_0x1488('0x1d')]);router['post']('/:id/users',auth[_0x1488('0x8')](),controller[_0x1488('0x1e')]);router[_0x1488('0x1f')](_0x1488('0x20'),auth[_0x1488('0x8')](),controller[_0x1488('0x21')]);router[_0x1488('0x22')](_0x1488('0x20'),auth[_0x1488('0x8')](),controller[_0x1488('0x23')]);router[_0x1488('0x22')](_0x1488('0xd'),auth[_0x1488('0x8')](),controller[_0x1488('0x24')]);router[_0x1488('0x22')](_0x1488('0x17'),auth['isAuthenticated'](),controller[_0x1488('0x25')]);router['delete'](_0x1488('0x14'),auth[_0x1488('0x8')](),controller['removeAgents']);module[_0x1488('0x26')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index ea25daf..f71bdab 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 _0xd097=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x148785,_0x195ee5){var _0x17a172=function(_0x478b94){while(--_0x478b94){_0x148785['push'](_0x148785['shift']());}};_0x17a172(++_0x195ee5);}(_0xd097,0x1ba));var _0x7d09=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xd097[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x7d09('0x0'));module[_0x7d09('0x1')]={'priority':{'type':Sequelize[_0x7d09('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x7d09('0x3')],'allowNull':![],'defaultValue':_0x7d09('0x4')},'appdata':{'type':Sequelize[_0x7d09('0x5')]()},'description':{'type':Sequelize[_0x7d09('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x7d09('0x6')}}; \ No newline at end of file +var _0x2003=['STRING','TEXT','*,*,*,*','sequelize','INTEGER'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x2003,0x1ed));var _0x3200=function(_0x427217,_0x4039b1){_0x427217=_0x427217-0x0;var _0x5b28fb=_0x2003[_0x427217];return _0x5b28fb;};'use strict';var Sequelize=require(_0x3200('0x0'));module['exports']={'priority':{'type':Sequelize[_0x3200('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x3200('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x3200('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x3200('0x2')],'defaultValue':_0x3200('0x4')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 8772afb..b9d7141 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 _0x3910=['fields','length','hasOwnProperty','order','sort','filter','where','type','options','includeAll','include','findAll','rows','show','rawAttributes','find','catch','create','body','params','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','map','FaxApplication','fieldName','model','query','keys','filters','intersection','attributes'];(function(_0x2a72ac,_0x51d35f){var _0x347a64=function(_0x13fc98){while(--_0x13fc98){_0x2a72ac['push'](_0x2a72ac['shift']());}};_0x347a64(++_0x51d35f);}(_0x3910,0x130));var _0x0391=function(_0x172fe1,_0x31bb8d){_0x172fe1=_0x172fe1-0x0;var _0x31cdbf=_0x3910[_0x172fe1];return _0x31cdbf;};'use strict';var emlformat=require(_0x0391('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0391('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0391('0x2'));var moment=require('moment');var BPromise=require(_0x0391('0x3'));var Mustache=require(_0x0391('0x4'));var util=require(_0x0391('0x5'));var path=require(_0x0391('0x6'));var sox=require(_0x0391('0x7'));var csv=require(_0x0391('0x8'));var ejs=require(_0x0391('0x9'));var fs=require('fs');var fs_extra=require(_0x0391('0xa'));var _=require(_0x0391('0xb'));var squel=require(_0x0391('0xc'));var crypto=require(_0x0391('0xd'));var jsforce=require(_0x0391('0xe'));var deskjs=require(_0x0391('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0391('0x10'));var Redis=require(_0x0391('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0391('0x12'));var as=require(_0x0391('0x13'));var hardwareService=require(_0x0391('0x14'));var logger=require('../../config/logger')(_0x0391('0x15'));var utils=require(_0x0391('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0391('0x17'));var db=require(_0x0391('0x18'))['db'];function respondWithStatusCode(_0x218874,_0x2fc73f){_0x2fc73f=_0x2fc73f||0xcc;return function(_0x1621a5){if(_0x1621a5){return _0x218874[_0x0391('0x19')](_0x2fc73f);}return _0x218874['status'](_0x2fc73f)['end']();};}function respondWithResult(_0x536713,_0x5aee4e){_0x5aee4e=_0x5aee4e||0xc8;return function(_0x2c7f65){if(_0x2c7f65){return _0x536713[_0x0391('0x1a')](_0x5aee4e)[_0x0391('0x1b')](_0x2c7f65);}};}function respondWithFilteredResult(_0x1acf9b,_0x3bc1f3){return function(_0x4ca4c1){if(_0x4ca4c1){var _0x2e147c=typeof _0x3bc1f3[_0x0391('0x1c')]===_0x0391('0x1d')&&typeof _0x3bc1f3[_0x0391('0x1e')]===_0x0391('0x1d');var _0x55f77c=_0x4ca4c1[_0x0391('0x1f')];var _0x45033e=_0x2e147c?0x0:_0x3bc1f3['offset'];var _0x1941cf=_0x2e147c?_0x4ca4c1[_0x0391('0x1f')]:_0x3bc1f3[_0x0391('0x1c')]+_0x3bc1f3['limit'];var _0xda7a07;if(_0x1941cf>=_0x55f77c){_0x1941cf=_0x55f77c;_0xda7a07=0xc8;}else{_0xda7a07=0xce;}_0x1acf9b['status'](_0xda7a07);return _0x1acf9b[_0x0391('0x20')](_0x0391('0x21'),_0x45033e+'-'+_0x1941cf+'/'+_0x55f77c)['json'](_0x4ca4c1);}return null;};}function patchUpdates(_0x48da36){return function(_0x4cf44e){try{jsonpatch['apply'](_0x4cf44e,_0x48da36,!![]);}catch(_0x3272b9){return BPromise[_0x0391('0x22')](_0x3272b9);}return _0x4cf44e[_0x0391('0x23')]();};}function saveUpdates(_0x20effd,_0x542729){return function(_0x246eb0){if(_0x246eb0){return _0x246eb0[_0x0391('0x24')](_0x20effd)[_0x0391('0x25')](function(_0x58d304){return _0x58d304;});}return null;};}function removeEntity(_0x56515e,_0x401a48){return function(_0x59a2dc){if(_0x59a2dc){return _0x59a2dc[_0x0391('0x26')]()[_0x0391('0x25')](function(){_0x56515e[_0x0391('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ad79b,_0x5a6cac){return function(_0x14040a){if(!_0x14040a){_0x4ad79b[_0x0391('0x19')](0x194);}return _0x14040a;};}function handleError(_0x4dbc43,_0x30f2d2){_0x30f2d2=_0x30f2d2||0x1f4;return function(_0x4b4764){logger['error'](_0x4b4764[_0x0391('0x27')]);if(_0x4b4764[_0x0391('0x28')]){delete _0x4b4764[_0x0391('0x28')];}_0x4dbc43[_0x0391('0x1a')](_0x30f2d2)[_0x0391('0x29')](_0x4b4764);};}exports['index']=function(_0x1a31e8,_0x641857){var _0x38a523={},_0x18e966={},_0x3b5a33={'count':0x0,'rows':[]};var _0x9f836c=_[_0x0391('0x2a')](db[_0x0391('0x2b')]['rawAttributes'],function(_0x2301c7){return{'name':_0x2301c7[_0x0391('0x2c')],'type':_0x2301c7['type']['key']};});_0x18e966[_0x0391('0x2d')]=_[_0x0391('0x2a')](_0x9f836c,'name');_0x18e966[_0x0391('0x2e')]=_[_0x0391('0x2f')](_0x1a31e8[_0x0391('0x2e')]);_0x18e966[_0x0391('0x30')]=_[_0x0391('0x31')](_0x18e966[_0x0391('0x2d')],_0x18e966['query']);_0x38a523[_0x0391('0x32')]=_['intersection'](_0x18e966[_0x0391('0x2d')],qs[_0x0391('0x33')](_0x1a31e8[_0x0391('0x2e')][_0x0391('0x33')]));_0x38a523[_0x0391('0x32')]=_0x38a523[_0x0391('0x32')][_0x0391('0x34')]?_0x38a523[_0x0391('0x32')]:_0x18e966['model'];if(!_0x1a31e8[_0x0391('0x2e')][_0x0391('0x35')]('nolimit')){_0x38a523[_0x0391('0x1e')]=qs[_0x0391('0x1e')](_0x1a31e8['query'][_0x0391('0x1e')]);_0x38a523[_0x0391('0x1c')]=qs[_0x0391('0x1c')](_0x1a31e8[_0x0391('0x2e')]['offset']);}_0x38a523[_0x0391('0x36')]=qs[_0x0391('0x37')](_0x1a31e8[_0x0391('0x2e')][_0x0391('0x37')]);_0x38a523['where']=qs[_0x0391('0x30')](_['pick'](_0x1a31e8[_0x0391('0x2e')],_0x18e966[_0x0391('0x30')]),_0x9f836c);if(_0x1a31e8[_0x0391('0x2e')][_0x0391('0x38')]){_0x38a523[_0x0391('0x39')]=_['merge'](_0x38a523[_0x0391('0x39')],{'$or':_[_0x0391('0x2a')](_0x9f836c,function(_0x2614a9){if(_0x2614a9[_0x0391('0x3a')]!=='VIRTUAL'){var _0x4ce721={};_0x4ce721[_0x2614a9[_0x0391('0x28')]]={'$like':'%'+_0x1a31e8['query'][_0x0391('0x38')]+'%'};return _0x4ce721;}})});}_0x38a523=_['merge']({},_0x38a523,_0x1a31e8[_0x0391('0x3b')]);var _0x22f9e5={'where':_0x38a523['where']};return db['FaxApplication'][_0x0391('0x1f')](_0x22f9e5)[_0x0391('0x25')](function(_0x987498){_0x3b5a33[_0x0391('0x1f')]=_0x987498;if(_0x1a31e8[_0x0391('0x2e')][_0x0391('0x3c')]){_0x38a523[_0x0391('0x3d')]=[{'all':!![]}];}return db[_0x0391('0x2b')][_0x0391('0x3e')](_0x38a523);})['then'](function(_0x3b6dc3){_0x3b5a33[_0x0391('0x3f')]=_0x3b6dc3;return _0x3b5a33;})[_0x0391('0x25')](respondWithFilteredResult(_0x641857,_0x38a523))['catch'](handleError(_0x641857,null));};exports[_0x0391('0x40')]=function(_0x1b537c,_0x2aadef){var _0x1d94c6={'raw':!![],'where':{'id':_0x1b537c['params']['id']}},_0xb7803f={};_0xb7803f[_0x0391('0x2d')]=_[_0x0391('0x2f')](db['FaxApplication'][_0x0391('0x41')]);_0xb7803f[_0x0391('0x2e')]=_[_0x0391('0x2f')](_0x1b537c[_0x0391('0x2e')]);_0xb7803f[_0x0391('0x30')]=_['intersection'](_0xb7803f[_0x0391('0x2d')],_0xb7803f[_0x0391('0x2e')]);_0x1d94c6[_0x0391('0x32')]=_[_0x0391('0x31')](_0xb7803f['model'],qs[_0x0391('0x33')](_0x1b537c[_0x0391('0x2e')][_0x0391('0x33')]));_0x1d94c6[_0x0391('0x32')]=_0x1d94c6[_0x0391('0x32')][_0x0391('0x34')]?_0x1d94c6[_0x0391('0x32')]:_0xb7803f[_0x0391('0x2d')];if(_0x1b537c[_0x0391('0x2e')][_0x0391('0x3c')]){_0x1d94c6[_0x0391('0x3d')]=[{'all':!![]}];}_0x1d94c6=_['merge']({},_0x1d94c6,_0x1b537c[_0x0391('0x3b')]);return db['FaxApplication'][_0x0391('0x42')](_0x1d94c6)[_0x0391('0x25')](handleEntityNotFound(_0x2aadef,null))['then'](respondWithResult(_0x2aadef,null))[_0x0391('0x43')](handleError(_0x2aadef,null));};exports[_0x0391('0x44')]=function(_0x537782,_0x550442){return db[_0x0391('0x2b')][_0x0391('0x44')](_0x537782[_0x0391('0x45')],{})[_0x0391('0x25')](respondWithResult(_0x550442,0xc9))[_0x0391('0x43')](handleError(_0x550442,null));};exports[_0x0391('0x24')]=function(_0x3f1256,_0x3d253d){if(_0x3f1256[_0x0391('0x45')]['id']){delete _0x3f1256['body']['id'];}return db[_0x0391('0x2b')][_0x0391('0x42')]({'where':{'id':_0x3f1256[_0x0391('0x46')]['id']}})['then'](handleEntityNotFound(_0x3d253d,null))['then'](saveUpdates(_0x3f1256[_0x0391('0x45')],null))[_0x0391('0x25')](respondWithResult(_0x3d253d,null))[_0x0391('0x43')](handleError(_0x3d253d,null));};exports[_0x0391('0x26')]=function(_0x1af629,_0x4342d6){return db[_0x0391('0x2b')][_0x0391('0x42')]({'where':{'id':_0x1af629[_0x0391('0x46')]['id']}})['then'](handleEntityNotFound(_0x4342d6,null))[_0x0391('0x25')](removeEntity(_0x4342d6,null))[_0x0391('0x43')](handleError(_0x4342d6,null));}; \ No newline at end of file +var _0x102e=['count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','map','FaxApplication','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','order','sort','pick','filter','where','merge','type','includeAll','include','show','params','find','catch','create','body','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined'];(function(_0x3ad769,_0x15ef3c){var _0x17cfba=function(_0x45110f){while(--_0x45110f){_0x3ad769['push'](_0x3ad769['shift']());}};_0x17cfba(++_0x15ef3c);}(_0x102e,0x13e));var _0xe102=function(_0x2a924a,_0x5e8f86){_0x2a924a=_0x2a924a-0x0;var _0x4e990b=_0x102e[_0x2a924a];return _0x4e990b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe102('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe102('0x1'));var moment=require(_0xe102('0x2'));var BPromise=require(_0xe102('0x3'));var Mustache=require(_0xe102('0x4'));var util=require('util');var path=require(_0xe102('0x5'));var sox=require(_0xe102('0x6'));var csv=require(_0xe102('0x7'));var ejs=require(_0xe102('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe102('0x9'));var squel=require(_0xe102('0xa'));var crypto=require('crypto');var jsforce=require(_0xe102('0xb'));var deskjs=require(_0xe102('0xc'));var toCsv=require(_0xe102('0x7'));var querystring=require(_0xe102('0xd'));var Papa=require('papaparse');var Redis=require(_0xe102('0xe'));var authService=require(_0xe102('0xf'));var qs=require(_0xe102('0x10'));var as=require(_0xe102('0x11'));var hardwareService=require(_0xe102('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xe102('0x13'));var config=require(_0xe102('0x14'));var licenseUtil=require(_0xe102('0x15'));var db=require(_0xe102('0x16'))['db'];function respondWithStatusCode(_0x3742eb,_0x7ef38b){_0x7ef38b=_0x7ef38b||0xcc;return function(_0x5b38e7){if(_0x5b38e7){return _0x3742eb[_0xe102('0x17')](_0x7ef38b);}return _0x3742eb[_0xe102('0x18')](_0x7ef38b)[_0xe102('0x19')]();};}function respondWithResult(_0x42dc04,_0x3ef87a){_0x3ef87a=_0x3ef87a||0xc8;return function(_0x1a8429){if(_0x1a8429){return _0x42dc04[_0xe102('0x18')](_0x3ef87a)['json'](_0x1a8429);}};}function respondWithFilteredResult(_0xe6674f,_0x12fdf8){return function(_0x11fb5d){if(_0x11fb5d){var _0x1fb2b1=typeof _0x12fdf8['offset']===_0xe102('0x1a')&&typeof _0x12fdf8['limit']==='undefined';var _0x1ba650=_0x11fb5d[_0xe102('0x1b')];var _0x1336de=_0x1fb2b1?0x0:_0x12fdf8[_0xe102('0x1c')];var _0x36781b=_0x1fb2b1?_0x11fb5d[_0xe102('0x1b')]:_0x12fdf8['offset']+_0x12fdf8[_0xe102('0x1d')];var _0x45bbe5;if(_0x36781b>=_0x1ba650){_0x36781b=_0x1ba650;_0x45bbe5=0xc8;}else{_0x45bbe5=0xce;}_0xe6674f[_0xe102('0x18')](_0x45bbe5);return _0xe6674f[_0xe102('0x1e')](_0xe102('0x1f'),_0x1336de+'-'+_0x36781b+'/'+_0x1ba650)[_0xe102('0x20')](_0x11fb5d);}return null;};}function patchUpdates(_0x4d21c7){return function(_0x3cd3f3){try{jsonpatch[_0xe102('0x21')](_0x3cd3f3,_0x4d21c7,!![]);}catch(_0x22d69b){return BPromise[_0xe102('0x22')](_0x22d69b);}return _0x3cd3f3[_0xe102('0x23')]();};}function saveUpdates(_0xf759b9,_0xa09a8e){return function(_0x4583dc){if(_0x4583dc){return _0x4583dc[_0xe102('0x24')](_0xf759b9)['then'](function(_0x5de5ff){return _0x5de5ff;});}return null;};}function removeEntity(_0xee5ff4,_0x5eecb9){return function(_0x46692d){if(_0x46692d){return _0x46692d[_0xe102('0x25')]()[_0xe102('0x26')](function(){_0xee5ff4[_0xe102('0x18')](0xcc)[_0xe102('0x19')]();});}};}function handleEntityNotFound(_0x4f2247,_0x41cddb){return function(_0xb19189){if(!_0xb19189){_0x4f2247['sendStatus'](0x194);}return _0xb19189;};}function handleError(_0x43de15,_0x4656fa){_0x4656fa=_0x4656fa||0x1f4;return function(_0x394107){logger[_0xe102('0x27')](_0x394107[_0xe102('0x28')]);if(_0x394107[_0xe102('0x29')]){delete _0x394107[_0xe102('0x29')];}_0x43de15[_0xe102('0x18')](_0x4656fa)[_0xe102('0x2a')](_0x394107);};}exports['index']=function(_0x22c5ad,_0x2f79a5){var _0x5dfe62={},_0x12bca4={},_0x27696a={'count':0x0,'rows':[]};var _0x32575d=_[_0xe102('0x2b')](db[_0xe102('0x2c')][_0xe102('0x2d')],function(_0x419c8c){return{'name':_0x419c8c['fieldName'],'type':_0x419c8c['type']['key']};});_0x12bca4[_0xe102('0x2e')]=_[_0xe102('0x2b')](_0x32575d,'name');_0x12bca4['query']=_[_0xe102('0x2f')](_0x22c5ad[_0xe102('0x30')]);_0x12bca4[_0xe102('0x31')]=_[_0xe102('0x32')](_0x12bca4[_0xe102('0x2e')],_0x12bca4['query']);_0x5dfe62[_0xe102('0x33')]=_[_0xe102('0x32')](_0x12bca4[_0xe102('0x2e')],qs['fields'](_0x22c5ad[_0xe102('0x30')][_0xe102('0x34')]));_0x5dfe62[_0xe102('0x33')]=_0x5dfe62[_0xe102('0x33')][_0xe102('0x35')]?_0x5dfe62[_0xe102('0x33')]:_0x12bca4[_0xe102('0x2e')];if(!_0x22c5ad[_0xe102('0x30')]['hasOwnProperty']('nolimit')){_0x5dfe62[_0xe102('0x1d')]=qs['limit'](_0x22c5ad['query']['limit']);_0x5dfe62['offset']=qs['offset'](_0x22c5ad[_0xe102('0x30')][_0xe102('0x1c')]);}_0x5dfe62[_0xe102('0x36')]=qs[_0xe102('0x37')](_0x22c5ad[_0xe102('0x30')][_0xe102('0x37')]);_0x5dfe62['where']=qs['filters'](_[_0xe102('0x38')](_0x22c5ad[_0xe102('0x30')],_0x12bca4[_0xe102('0x31')]),_0x32575d);if(_0x22c5ad[_0xe102('0x30')][_0xe102('0x39')]){_0x5dfe62[_0xe102('0x3a')]=_[_0xe102('0x3b')](_0x5dfe62[_0xe102('0x3a')],{'$or':_[_0xe102('0x2b')](_0x32575d,function(_0x35a542){if(_0x35a542[_0xe102('0x3c')]!=='VIRTUAL'){var _0x3e8759={};_0x3e8759[_0x35a542[_0xe102('0x29')]]={'$like':'%'+_0x22c5ad['query'][_0xe102('0x39')]+'%'};return _0x3e8759;}})});}_0x5dfe62=_[_0xe102('0x3b')]({},_0x5dfe62,_0x22c5ad['options']);var _0x46c568={'where':_0x5dfe62[_0xe102('0x3a')]};return db[_0xe102('0x2c')][_0xe102('0x1b')](_0x46c568)[_0xe102('0x26')](function(_0x507d64){_0x27696a['count']=_0x507d64;if(_0x22c5ad[_0xe102('0x30')][_0xe102('0x3d')]){_0x5dfe62[_0xe102('0x3e')]=[{'all':!![]}];}return db[_0xe102('0x2c')]['findAll'](_0x5dfe62);})[_0xe102('0x26')](function(_0x528be4){_0x27696a['rows']=_0x528be4;return _0x27696a;})['then'](respondWithFilteredResult(_0x2f79a5,_0x5dfe62))['catch'](handleError(_0x2f79a5,null));};exports[_0xe102('0x3f')]=function(_0xcb5e42,_0x52c7a9){var _0x7a2a6a={'raw':!![],'where':{'id':_0xcb5e42[_0xe102('0x40')]['id']}},_0x121f0f={};_0x121f0f[_0xe102('0x2e')]=_['keys'](db[_0xe102('0x2c')][_0xe102('0x2d')]);_0x121f0f['query']=_[_0xe102('0x2f')](_0xcb5e42[_0xe102('0x30')]);_0x121f0f[_0xe102('0x31')]=_[_0xe102('0x32')](_0x121f0f[_0xe102('0x2e')],_0x121f0f[_0xe102('0x30')]);_0x7a2a6a[_0xe102('0x33')]=_['intersection'](_0x121f0f[_0xe102('0x2e')],qs['fields'](_0xcb5e42[_0xe102('0x30')][_0xe102('0x34')]));_0x7a2a6a['attributes']=_0x7a2a6a[_0xe102('0x33')][_0xe102('0x35')]?_0x7a2a6a[_0xe102('0x33')]:_0x121f0f[_0xe102('0x2e')];if(_0xcb5e42[_0xe102('0x30')]['includeAll']){_0x7a2a6a[_0xe102('0x3e')]=[{'all':!![]}];}_0x7a2a6a=_[_0xe102('0x3b')]({},_0x7a2a6a,_0xcb5e42['options']);return db[_0xe102('0x2c')][_0xe102('0x41')](_0x7a2a6a)[_0xe102('0x26')](handleEntityNotFound(_0x52c7a9,null))['then'](respondWithResult(_0x52c7a9,null))[_0xe102('0x42')](handleError(_0x52c7a9,null));};exports[_0xe102('0x43')]=function(_0x1f5fd0,_0x31d58d){return db[_0xe102('0x2c')][_0xe102('0x43')](_0x1f5fd0[_0xe102('0x44')],{})[_0xe102('0x26')](respondWithResult(_0x31d58d,0xc9))[_0xe102('0x42')](handleError(_0x31d58d,null));};exports[_0xe102('0x24')]=function(_0x187826,_0x261d49){if(_0x187826[_0xe102('0x44')]['id']){delete _0x187826['body']['id'];}return db[_0xe102('0x2c')][_0xe102('0x41')]({'where':{'id':_0x187826[_0xe102('0x40')]['id']}})['then'](handleEntityNotFound(_0x261d49,null))[_0xe102('0x26')](saveUpdates(_0x187826[_0xe102('0x44')],null))[_0xe102('0x26')](respondWithResult(_0x261d49,null))[_0xe102('0x42')](handleError(_0x261d49,null));};exports['destroy']=function(_0x383db9,_0x3b451e){return db[_0xe102('0x2c')][_0xe102('0x41')]({'where':{'id':_0x383db9[_0xe102('0x40')]['id']}})[_0xe102('0x26')](handleEntityNotFound(_0x3b451e,null))[_0xe102('0x26')](removeEntity(_0x3b451e,null))[_0xe102('0x42')](handleError(_0x3b451e,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index a060d37..504254c 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 _0x9259=['path','rimraf','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication','utf8mb4','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0xea19a8,_0xb99e2){var _0x8191a3=function(_0x29db22){while(--_0x29db22){_0xea19a8['push'](_0xea19a8['shift']());}};_0x8191a3(++_0xb99e2);}(_0x9259,0x1ac));var _0x9925=function(_0x1a08ad,_0x21d209){_0x1a08ad=_0x1a08ad-0x0;var _0x521649=_0x9259[_0x1a08ad];return _0x521649;};'use strict';var _=require(_0x9925('0x0'));var util=require(_0x9925('0x1'));var logger=require(_0x9925('0x2'))(_0x9925('0x3'));var moment=require('moment');var BPromise=require(_0x9925('0x4'));var rp=require(_0x9925('0x5'));var fs=require('fs');var path=require(_0x9925('0x6'));var rimraf=require(_0x9925('0x7'));var config=require(_0x9925('0x8'));var attributes=require(_0x9925('0x9'));module[_0x9925('0xa')]=function(_0x11d7bc,_0x31e9c3){return _0x11d7bc[_0x9925('0xb')](_0x9925('0xc'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9925('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xaa6b=['path','rimraf','../../config/environment','./faxApplication.attributes','exports','define','fax_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x47dcef,_0x1d6e3a){var _0x1f6765=function(_0x1421e5){while(--_0x1421e5){_0x47dcef['push'](_0x47dcef['shift']());}};_0x1f6765(++_0x1d6e3a);}(_0xaa6b,0xda));var _0xbaa6=function(_0xd9142f,_0x366841){_0xd9142f=_0xd9142f-0x0;var _0x59b527=_0xaa6b[_0xd9142f];return _0x59b527;};'use strict';var _=require(_0xbaa6('0x0'));var util=require(_0xbaa6('0x1'));var logger=require(_0xbaa6('0x2'))(_0xbaa6('0x3'));var moment=require(_0xbaa6('0x4'));var BPromise=require(_0xbaa6('0x5'));var rp=require(_0xbaa6('0x6'));var fs=require('fs');var path=require(_0xbaa6('0x7'));var rimraf=require(_0xbaa6('0x8'));var config=require(_0xbaa6('0x9'));var attributes=require(_0xbaa6('0xa'));module[_0xbaa6('0xb')]=function(_0x421d24,_0x21c649){return _0x421d24[_0xbaa6('0xc')]('FaxApplication',attributes,{'tableName':_0xbaa6('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbaa6('0xe'),'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 9621dbe..c747fb8 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 _0x4d84=['../../config/environment','jayson/promise','client','request','then','FaxApplication,\x20%s,\x20%s','debug','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','FaxApplication','body','options','raw','where','attributes','limit','UpdateFaxApplication','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x252bfc,_0x2837f1){var _0x16bf76=function(_0x4a99e3){while(--_0x4a99e3){_0x252bfc['push'](_0x252bfc['shift']());}};_0x16bf76(++_0x2837f1);}(_0x4d84,0xad));var _0x44d8=function(_0x40c2f1,_0x1b4e95){_0x40c2f1=_0x40c2f1-0x0;var _0x3dd985=_0x4d84[_0x40c2f1];return _0x3dd985;};'use strict';var _=require(_0x44d8('0x0'));var util=require(_0x44d8('0x1'));var moment=require(_0x44d8('0x2'));var BPromise=require(_0x44d8('0x3'));var rs=require(_0x44d8('0x4'));var fs=require('fs');var Redis=require(_0x44d8('0x5'));var db=require(_0x44d8('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x44d8('0x7'));var jayson=require(_0x44d8('0x8'));var client=jayson[_0x44d8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x95604e,_0x2111ed,_0x129e62){return new BPromise(function(_0x41cf89,_0x2947f7){return client[_0x44d8('0xa')](_0x95604e,_0x129e62)[_0x44d8('0xb')](function(_0x37201b){logger['info'](_0x44d8('0xc'),_0x2111ed,'request\x20sent');logger[_0x44d8('0xd')](_0x44d8('0xe'),_0x2111ed,_0x44d8('0xf'),JSON[_0x44d8('0x10')](_0x37201b));if(_0x37201b['error']){if(_0x37201b[_0x44d8('0x11')][_0x44d8('0x12')]===0x1f4){logger[_0x44d8('0x11')](_0x44d8('0xc'),_0x2111ed,_0x37201b[_0x44d8('0x11')][_0x44d8('0x13')]);return _0x2947f7(_0x37201b[_0x44d8('0x11')][_0x44d8('0x13')]);}logger[_0x44d8('0x11')](_0x44d8('0xc'),_0x2111ed,_0x37201b['error'][_0x44d8('0x13')]);return _0x41cf89(_0x37201b[_0x44d8('0x11')][_0x44d8('0x13')]);}else{logger[_0x44d8('0x14')](_0x44d8('0xc'),_0x2111ed,_0x44d8('0xf'));_0x41cf89(_0x37201b[_0x44d8('0x15')][_0x44d8('0x13')]);}})['catch'](function(_0x305910){logger[_0x44d8('0x11')]('FaxApplication,\x20%s,\x20%s',_0x2111ed,_0x305910);_0x2947f7(_0x305910);});});}exports['UpdateFaxApplication']=function(_0x84355f){var _0xe59fbf=this;return new Promise(function(_0x16ca06,_0x545d11){return db[_0x44d8('0x16')]['update'](_0x84355f[_0x44d8('0x17')],{'raw':_0x84355f[_0x44d8('0x18')]?_0x84355f[_0x44d8('0x18')][_0x44d8('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x84355f['options']?_0x84355f['options'][_0x44d8('0x1a')]||null:null,'attributes':_0x84355f[_0x44d8('0x18')]?_0x84355f['options'][_0x44d8('0x1b')]||null:null,'limit':_0x84355f[_0x44d8('0x18')]?_0x84355f[_0x44d8('0x18')][_0x44d8('0x1c')]||null:null})[_0x44d8('0xb')](function(_0x1866f9){logger[_0x44d8('0x14')](_0x44d8('0x1d'),_0x84355f);logger[_0x44d8('0xd')](_0x44d8('0x1d'),_0x84355f,JSON[_0x44d8('0x10')](_0x1866f9));_0x16ca06(_0x1866f9);})['catch'](function(_0x2a43a9){logger[_0x44d8('0x11')](_0x44d8('0x1d'),_0x2a43a9[_0x44d8('0x13')],_0x84355f);_0x545d11(_0xe59fbf[_0x44d8('0x11')](0x1f4,_0x2a43a9[_0x44d8('0x13')]));});});}; \ No newline at end of file +var _0x4a3f=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','FaxApplication','update','raw','options','where','limit','UpdateFaxApplication','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x4a3f,0x101));var _0xf4a3=function(_0x170eb7,_0x1ac59b){_0x170eb7=_0x170eb7-0x0;var _0x4dfeac=_0x4a3f[_0x170eb7];return _0x4dfeac;};'use strict';var _=require(_0xf4a3('0x0'));var util=require(_0xf4a3('0x1'));var moment=require(_0xf4a3('0x2'));var BPromise=require(_0xf4a3('0x3'));var rs=require(_0xf4a3('0x4'));var fs=require('fs');var Redis=require(_0xf4a3('0x5'));var db=require(_0xf4a3('0x6'))['db'];var utils=require(_0xf4a3('0x7'));var logger=require('../../config/logger')(_0xf4a3('0x8'));var config=require(_0xf4a3('0x9'));var jayson=require(_0xf4a3('0xa'));var client=jayson[_0xf4a3('0xb')][_0xf4a3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x35dfbb,_0x4fb10f,_0x5c7cc1){return new BPromise(function(_0x211930,_0x2d098b){return client[_0xf4a3('0xd')](_0x35dfbb,_0x5c7cc1)[_0xf4a3('0xe')](function(_0x2f362f){logger[_0xf4a3('0xf')](_0xf4a3('0x10'),_0x4fb10f,_0xf4a3('0x11'));logger[_0xf4a3('0x12')](_0xf4a3('0x13'),_0x4fb10f,_0xf4a3('0x11'),JSON[_0xf4a3('0x14')](_0x2f362f));if(_0x2f362f['error']){if(_0x2f362f[_0xf4a3('0x15')][_0xf4a3('0x16')]===0x1f4){logger[_0xf4a3('0x15')]('FaxApplication,\x20%s,\x20%s',_0x4fb10f,_0x2f362f[_0xf4a3('0x15')]['message']);return _0x2d098b(_0x2f362f[_0xf4a3('0x15')][_0xf4a3('0x17')]);}logger[_0xf4a3('0x15')]('FaxApplication,\x20%s,\x20%s',_0x4fb10f,_0x2f362f[_0xf4a3('0x15')]['message']);return _0x211930(_0x2f362f['error'][_0xf4a3('0x17')]);}else{logger[_0xf4a3('0xf')]('FaxApplication,\x20%s,\x20%s',_0x4fb10f,'request\x20sent');_0x211930(_0x2f362f[_0xf4a3('0x18')][_0xf4a3('0x17')]);}})[_0xf4a3('0x19')](function(_0x2ba9b3){logger['error'](_0xf4a3('0x10'),_0x4fb10f,_0x2ba9b3);_0x2d098b(_0x2ba9b3);});});}exports['UpdateFaxApplication']=function(_0x4b3bc5){var _0x5dbe9d=this;return new Promise(function(_0x21f2db,_0x4915b2){return db[_0xf4a3('0x1a')][_0xf4a3('0x1b')](_0x4b3bc5['body'],{'raw':_0x4b3bc5['options']?_0x4b3bc5['options'][_0xf4a3('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b3bc5['options']?_0x4b3bc5[_0xf4a3('0x1d')][_0xf4a3('0x1e')]||null:null,'attributes':_0x4b3bc5[_0xf4a3('0x1d')]?_0x4b3bc5[_0xf4a3('0x1d')]['attributes']||null:null,'limit':_0x4b3bc5[_0xf4a3('0x1d')]?_0x4b3bc5['options'][_0xf4a3('0x1f')]||null:null})[_0xf4a3('0xe')](function(_0x5375c1){logger['info']('UpdateFaxApplication',_0x4b3bc5);logger[_0xf4a3('0x12')](_0xf4a3('0x20'),_0x4b3bc5,JSON['stringify'](_0x5375c1));_0x21f2db(_0x5375c1);})[_0xf4a3('0x19')](function(_0x129bb3){logger[_0xf4a3('0x15')]('UpdateFaxApplication',_0x129bb3[_0xf4a3('0x17')],_0x4b3bc5);_0x4915b2(_0x5dbe9d[_0xf4a3('0x15')](0x1f4,_0x129bb3[_0xf4a3('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 4746aeb..86f575e 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 _0xea28=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','destroy','exports','multer'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xea28,0x13a));var _0x8ea2=function(_0xce6b02,_0x13052e){_0xce6b02=_0xce6b02-0x0;var _0x5b36fc=_0xea28[_0xce6b02];return _0x5b36fc;};'use strict';var multer=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var path=require(_0x8ea2('0x2'));var timeout=require(_0x8ea2('0x3'));var express=require(_0x8ea2('0x4'));var router=express[_0x8ea2('0x5')]();var fs_extra=require(_0x8ea2('0x6'));var auth=require(_0x8ea2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8ea2('0x8'));var controller=require(_0x8ea2('0x9'));router[_0x8ea2('0xa')]('/',auth['isAuthenticated'](),controller[_0x8ea2('0xb')]);router[_0x8ea2('0xa')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0xe')]);router[_0x8ea2('0xf')]('/',auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x10')]);router[_0x8ea2('0x11')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x12')]);router['delete']('/:id',auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x13')]);module[_0x8ea2('0x14')]=router; \ No newline at end of file +var _0x80ed=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer'];(function(_0x3b150c,_0x2f93f8){var _0x5cd414=function(_0x26305e){while(--_0x26305e){_0x3b150c['push'](_0x3b150c['shift']());}};_0x5cd414(++_0x2f93f8);}(_0x80ed,0x11c));var _0xd80e=function(_0x17a38b,_0x113ecb){_0x17a38b=_0x17a38b-0x0;var _0x3cf776=_0x80ed[_0x17a38b];return _0x3cf776;};'use strict';var multer=require(_0xd80e('0x0'));var util=require('util');var path=require(_0xd80e('0x1'));var timeout=require(_0xd80e('0x2'));var express=require(_0xd80e('0x3'));var router=express['Router']();var fs_extra=require(_0xd80e('0x4'));var auth=require(_0xd80e('0x5'));var interaction=require(_0xd80e('0x6'));var config=require(_0xd80e('0x7'));var controller=require('./faxApplication.controller');router[_0xd80e('0x8')]('/',auth[_0xd80e('0x9')](),controller[_0xd80e('0xa')]);router['get'](_0xd80e('0xb'),auth[_0xd80e('0x9')](),controller[_0xd80e('0xc')]);router[_0xd80e('0xd')]('/',auth[_0xd80e('0x9')](),controller[_0xd80e('0xe')]);router[_0xd80e('0xf')](_0xd80e('0xb'),auth[_0xd80e('0x9')](),controller[_0xd80e('0x10')]);router['delete'](_0xd80e('0xb'),auth[_0xd80e('0x9')](),controller[_0xd80e('0x11')]);module[_0xd80e('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 3f7f404..1ef8d30 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 _0xb145=['out','INTEGER','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x4178cb,_0x290510){var _0x5555ee=function(_0x16eeda){while(--_0x16eeda){_0x4178cb['push'](_0x4178cb['shift']());}};_0x5555ee(++_0x290510);}(_0xb145,0xa3));var _0x5b14=function(_0x5c46ec,_0xc53762){_0x5c46ec=_0x5c46ec-0x0;var _0x48bc75=_0xb145[_0x5c46ec];return _0x48bc75;};'use strict';var Sequelize=require('sequelize');module[_0x5b14('0x0')]={'closed':{'type':Sequelize[_0x5b14('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5b14('0x2')]},'disposition':{'type':Sequelize[_0x5b14('0x3')]},'secondDisposition':{'type':Sequelize[_0x5b14('0x3')]},'thirdDisposition':{'type':Sequelize[_0x5b14('0x3')]},'note':{'type':Sequelize[_0x5b14('0x3')]},'read1stAt':{'type':Sequelize[_0x5b14('0x2')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0x5b14('0x4')]('in',_0x5b14('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x5b14('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x5b14('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0x5b14('0x6')]}}; \ No newline at end of file +var _0xf61e=['ENUM','out','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x3c0488,_0x5c74fb){var _0x4c0f26=function(_0x10a399){while(--_0x10a399){_0x3c0488['push'](_0x3c0488['shift']());}};_0x4c0f26(++_0x5c74fb);}(_0xf61e,0x191));var _0xef61=function(_0x2b1e4f,_0x5dd351){_0x2b1e4f=_0x2b1e4f-0x0;var _0x27c4a0=_0xf61e[_0x2b1e4f];return _0x27c4a0;};'use strict';var Sequelize=require(_0xef61('0x0'));module[_0xef61('0x1')]={'closed':{'type':Sequelize[_0xef61('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xef61('0x3')]},'disposition':{'type':Sequelize[_0xef61('0x4')]},'secondDisposition':{'type':Sequelize[_0xef61('0x4')]},'thirdDisposition':{'type':Sequelize[_0xef61('0x4')]},'note':{'type':Sequelize[_0xef61('0x4')]},'read1stAt':{'type':Sequelize[_0xef61('0x3')]},'fax':{'type':Sequelize[_0xef61('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xef61('0x5')]('in',_0xef61('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xef61('0x5')]('in',_0xef61('0x6')),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index bd7a71a..00cd562 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 _0x3901=['spread','color','emit','faxInteractionTags:save','removeTags','unix','toString','root','files','join','server','attachments','transcript-%d-%s.zip','push','Attachment','createdAt','Messages','mkdirSync','existsSync','createReadStream','pipe','createWriteStream','basename','resolve','download','log','unlinkSync','rimraf','moment','bluebird','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../mysqldb','redis','defaults','localhost','./faxInteraction.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','then','stack','name','send','index','map','FaxInteraction','rawAttributes','type','getOptions','query','user','catch','show','model','keys','filters','intersection','fields','attributes','length','includeAll','options','find','create','update','body','params','describe','addMessage','FaxMessage','ids','omit','findOne','hasOwnProperty','nolimit','sort','pick','where','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','merge','findAll','addTags','setTags'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3901,0x7e));var _0x1390=function(_0xf5605c,_0x178148){_0xf5605c=_0xf5605c-0x0;var _0x4a5d10=_0x3901[_0xf5605c];return _0x4a5d10;};'use strict';var rimraf=require(_0x1390('0x0'));var zipdir=require('zip-dir');var moment=require(_0x1390('0x1'));var BPromise=require(_0x1390('0x2'));var util=require(_0x1390('0x3'));var path=require(_0x1390('0x4'));var fs=require('fs');var _=require(_0x1390('0x5'));var Redis=require(_0x1390('0x6'));var interaction=require(_0x1390('0x7'));var qs=require(_0x1390('0x8'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require(_0x1390('0x9'))['db'];config[_0x1390('0xa')]=_[_0x1390('0xb')](config[_0x1390('0xa')],{'host':_0x1390('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1390('0xa')]));require(_0x1390('0xd'))[_0x1390('0xe')](socket);function respondWithStatusCode(_0x48568f,_0x3d371a){_0x3d371a=_0x3d371a||0xcc;return function(_0x16721b){if(_0x16721b){return _0x48568f[_0x1390('0xf')](_0x3d371a);}return _0x48568f['status'](_0x3d371a)['end']();};}function respondWithResult(_0x351396,_0x45cb15){_0x45cb15=_0x45cb15||0xc8;return function(_0x49f4c0){if(_0x49f4c0){return _0x351396[_0x1390('0x10')](_0x45cb15)[_0x1390('0x11')](_0x49f4c0);}};}function respondWithFilteredResult(_0x30189d,_0x1d9c75){return function(_0x16d182){if(_0x16d182){var _0x586153=typeof _0x1d9c75[_0x1390('0x12')]===_0x1390('0x13')&&typeof _0x1d9c75[_0x1390('0x14')]===_0x1390('0x13');var _0xb442af=_0x16d182[_0x1390('0x15')];var _0x5edbb8=_0x586153?0x0:_0x1d9c75[_0x1390('0x12')];var _0x2dd949=_0x586153?_0x16d182['count']:_0x1d9c75[_0x1390('0x12')]+_0x1d9c75[_0x1390('0x14')];var _0x278795;if(_0x2dd949>=_0xb442af){_0x2dd949=_0xb442af;_0x278795=0xc8;}else{_0x278795=0xce;}_0x30189d[_0x1390('0x10')](_0x278795);return _0x30189d[_0x1390('0x16')](_0x1390('0x17'),_0x5edbb8+'-'+_0x2dd949+'/'+_0xb442af)[_0x1390('0x11')](_0x16d182);}return null;};}function saveUpdates(_0x1d4e25){return function(_0x4aec57){if(_0x4aec57){return _0x4aec57['update'](_0x1d4e25)[_0x1390('0x18')](function(_0x613f24){return _0x613f24;});}return null;};}function removeEntity(_0x5192b3){return function(_0x402da4){if(_0x402da4){return _0x402da4['destroy']()['then'](function(){_0x5192b3[_0x1390('0x10')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47d179){return function(_0x2d3f90){if(!_0x2d3f90){_0x47d179['sendStatus'](0x194);}return _0x2d3f90;};}function handleError(_0x5626ae,_0x50557b){_0x50557b=_0x50557b||0x1f4;return function(_0x1d4e1e){logger['error'](_0x1d4e1e[_0x1390('0x19')]);if(_0x1d4e1e['name']){delete _0x1d4e1e[_0x1390('0x1a')];}_0x5626ae[_0x1390('0x10')](_0x50557b)[_0x1390('0x1b')](_0x1d4e1e);};}exports[_0x1390('0x1c')]=function(_0x471a55,_0x4a1b04){var _0x4e2a21={};var _0x29d122=_[_0x1390('0x1d')](db[_0x1390('0x1e')][_0x1390('0x1f')],function(_0x36cb1a){return{'name':_0x36cb1a['fieldName'],'type':_0x36cb1a[_0x1390('0x20')]['key']};});_0x4e2a21=qs[_0x1390('0x21')](_0x29d122,_0x471a55);return interaction['findAll']('fax',_0x471a55[_0x1390('0x22')],_0x471a55[_0x1390('0x23')],_0x4e2a21,_0x29d122)[_0x1390('0x18')](respondWithFilteredResult(_0x4a1b04,_0x4e2a21))[_0x1390('0x24')](handleError(_0x4a1b04,null));};exports[_0x1390('0x25')]=function(_0x353d77,_0x32be99){var _0x3d3a32={'raw':![],'where':{'id':_0x353d77['params']['id']}},_0x344367={};_0x344367[_0x1390('0x26')]=_[_0x1390('0x27')](db[_0x1390('0x1e')][_0x1390('0x1f')]);_0x344367[_0x1390('0x22')]=_['keys'](_0x353d77[_0x1390('0x22')]);_0x344367[_0x1390('0x28')]=_[_0x1390('0x29')](_0x344367[_0x1390('0x26')],_0x344367[_0x1390('0x22')]);_0x3d3a32['attributes']=_[_0x1390('0x29')](_0x344367[_0x1390('0x26')],qs[_0x1390('0x2a')](_0x353d77[_0x1390('0x22')][_0x1390('0x2a')]));_0x3d3a32[_0x1390('0x2b')]=_0x3d3a32[_0x1390('0x2b')][_0x1390('0x2c')]?_0x3d3a32[_0x1390('0x2b')]:_0x344367[_0x1390('0x26')];if(_0x353d77['query'][_0x1390('0x2d')]){_0x3d3a32['include']=[{'all':!![]}];}_0x3d3a32=_['merge']({},_0x3d3a32,_0x353d77[_0x1390('0x2e')]);return db[_0x1390('0x1e')][_0x1390('0x2f')](_0x3d3a32)[_0x1390('0x18')](handleEntityNotFound(_0x32be99,null))[_0x1390('0x18')](respondWithResult(_0x32be99,null))[_0x1390('0x24')](handleError(_0x32be99,null));};exports[_0x1390('0x30')]=function(_0x2578f2,_0x2f0b2b){return db[_0x1390('0x1e')][_0x1390('0x30')](_0x2578f2['body'],{})[_0x1390('0x18')](respondWithResult(_0x2f0b2b,0xc9))[_0x1390('0x24')](handleError(_0x2f0b2b,null));};exports[_0x1390('0x31')]=function(_0x3d2581,_0x9959c0){if(_0x3d2581[_0x1390('0x32')]['id']){delete _0x3d2581[_0x1390('0x32')]['id'];}return db[_0x1390('0x1e')][_0x1390('0x2f')]({'where':{'id':_0x3d2581[_0x1390('0x33')]['id']}})[_0x1390('0x18')](handleEntityNotFound(_0x9959c0,null))['then'](saveUpdates(_0x3d2581['body'],null))[_0x1390('0x18')](respondWithResult(_0x9959c0,null))[_0x1390('0x24')](handleError(_0x9959c0,null));};exports['destroy']=function(_0x2505e1,_0x5d1c28){return db[_0x1390('0x1e')]['find']({'where':{'id':_0x2505e1['params']['id']}})['then'](handleEntityNotFound(_0x5d1c28,null))[_0x1390('0x18')](removeEntity(_0x5d1c28,null))[_0x1390('0x24')](handleError(_0x5d1c28,null));};exports[_0x1390('0x34')]=function(_0x229084,_0xcd796c){return db[_0x1390('0x1e')]['describe']()[_0x1390('0x18')](respondWithResult(_0xcd796c,null))[_0x1390('0x24')](handleError(_0xcd796c,null));};exports[_0x1390('0x35')]=function(_0x7ad3e,_0x41d2f3){return db[_0x1390('0x36')][_0x1390('0x2f')]({'where':{'id':_0x7ad3e[_0x1390('0x33')]['id']}})['then'](handleEntityNotFound(_0x41d2f3,null))[_0x1390('0x18')](function(_0x26a4b7){if(_0x26a4b7){return _0x26a4b7[_0x1390('0x35')](_0x7ad3e[_0x1390('0x32')][_0x1390('0x37')],_[_0x1390('0x38')](_0x7ad3e[_0x1390('0x32')],[_0x1390('0x37'),'id'])||{});}})[_0x1390('0x18')](respondWithResult(_0x41d2f3,null))[_0x1390('0x24')](handleError(_0x41d2f3,null));};exports['getMessages']=function(_0x2bc6dc,_0x2b6c39){var _0x4ab0b6={'raw':![],'where':{}};var _0x5d883a={};var _0x40acff={'count':0x0,'rows':[]};return db[_0x1390('0x1e')][_0x1390('0x39')]({'where':{'id':_0x2bc6dc[_0x1390('0x33')]['id']}})[_0x1390('0x18')](handleEntityNotFound(_0x2b6c39,null))['then'](function(_0x204ab7){if(_0x204ab7){_0x5d883a['model']=_[_0x1390('0x27')](db[_0x1390('0x36')]['rawAttributes']);_0x5d883a[_0x1390('0x22')]=_[_0x1390('0x27')](_0x2bc6dc[_0x1390('0x22')]);_0x5d883a[_0x1390('0x28')]=_[_0x1390('0x29')](_0x5d883a[_0x1390('0x26')],_0x5d883a[_0x1390('0x22')]);_0x4ab0b6['attributes']=_[_0x1390('0x29')](_0x5d883a['model'],qs[_0x1390('0x2a')](_0x2bc6dc['query']['fields']));_0x4ab0b6[_0x1390('0x2b')]=_0x4ab0b6['attributes'][_0x1390('0x2c')]?_0x4ab0b6[_0x1390('0x2b')]:_0x5d883a[_0x1390('0x26')];if(!_0x2bc6dc['query'][_0x1390('0x3a')](_0x1390('0x3b'))){_0x4ab0b6[_0x1390('0x14')]=qs[_0x1390('0x14')](_0x2bc6dc['query'][_0x1390('0x14')]);_0x4ab0b6['offset']=qs[_0x1390('0x12')](_0x2bc6dc[_0x1390('0x22')][_0x1390('0x12')]);}_0x4ab0b6['order']=qs[_0x1390('0x3c')](_0x2bc6dc[_0x1390('0x22')][_0x1390('0x3c')]);_0x4ab0b6['where']=qs[_0x1390('0x28')](_[_0x1390('0x3d')](_0x2bc6dc['query'],_0x5d883a[_0x1390('0x28')]));_0x4ab0b6[_0x1390('0x3e')]['FaxInteractionId']=_0x204ab7['id'];if(_0x2bc6dc['query'][_0x1390('0x3f')]){_0x4ab0b6[_0x1390('0x3e')]=_['merge'](_0x4ab0b6[_0x1390('0x3e')],{'$or':_['map'](_0x4ab0b6[_0x1390('0x2b')],function(_0x348f5a){var _0x4ada9d={};_0x4ada9d[_0x348f5a]={'$like':'%'+_0x2bc6dc[_0x1390('0x22')][_0x1390('0x3f')]+'%'};return _0x4ada9d;})});}if(_0x2bc6dc['query'][_0x1390('0x40')]){var _0x3392dd=_0x2bc6dc['query'][_0x1390('0x40')][_0x1390('0x41')](',');var _0x5cdc69={};_0x5cdc69[_0x3392dd[0x0]]={'$gte':moment(_0x3392dd[0x1])[_0x1390('0x42')](_0x1390('0x43'))};_0x4ab0b6[_0x1390('0x3e')]=_[_0x1390('0x44')](_0x4ab0b6[_0x1390('0x3e')],_0x5cdc69);}_0x4ab0b6=_[_0x1390('0x44')]({},_0x4ab0b6,_0x2bc6dc[_0x1390('0x2e')]);return db['FaxMessage'][_0x1390('0x15')]({'where':_0x4ab0b6[_0x1390('0x3e')]})[_0x1390('0x18')](function(_0x555790){_0x40acff['count']=_0x555790;if(_0x2bc6dc[_0x1390('0x22')][_0x1390('0x2d')]){_0x4ab0b6['include']=[{'all':!![]}];}return db[_0x1390('0x36')][_0x1390('0x45')](_0x4ab0b6);})[_0x1390('0x18')](function(_0x1975c4){_0x40acff['rows']=_0x1975c4;return _0x40acff;});}})[_0x1390('0x18')](respondWithFilteredResult(_0x2b6c39,_0x4ab0b6))[_0x1390('0x24')](handleError(_0x2b6c39,null));};exports[_0x1390('0x46')]=function(_0x1a7ec7,_0x3ae1de){return db[_0x1390('0x1e')][_0x1390('0x2f')]({'where':{'id':_0x1a7ec7[_0x1390('0x33')]['id']}})[_0x1390('0x18')](handleEntityNotFound(_0x3ae1de,null))[_0x1390('0x18')](function(_0x5ea32d){if(_0x5ea32d){return _0x5ea32d[_0x1390('0x47')](_0x1a7ec7['body'][_0x1390('0x37')],_[_0x1390('0x38')](_0x1a7ec7['body'],[_0x1390('0x37'),'id'])||{})[_0x1390('0x48')](function(){return db['Tag'][_0x1390('0x45')]({'attributes':['id',_0x1390('0x1a'),_0x1390('0x49')],'where':{'id':_0x1a7ec7[_0x1390('0x32')]['ids']}});})['then'](function(_0x108bf1){socket[_0x1390('0x4a')](_0x1390('0x4b'),{'id':Number(_0x1a7ec7['params']['id']),'tags':_0x108bf1||[]});return{'id':Number(_0x1a7ec7[_0x1390('0x33')]['id']),'tags':_0x108bf1||[]};});}})[_0x1390('0x18')](respondWithResult(_0x3ae1de,null))['catch'](handleError(_0x3ae1de,null));};exports[_0x1390('0x4c')]=function(_0x2943ba,_0x1d078d){return db['FaxInteraction'][_0x1390('0x2f')]({'where':{'id':_0x2943ba['params']['id']}})[_0x1390('0x18')](handleEntityNotFound(_0x1d078d,null))['then'](function(_0x57c15d){if(_0x57c15d){return _0x57c15d['removeTags'](_0x2943ba[_0x1390('0x22')]['ids']);}})[_0x1390('0x18')](respondWithStatusCode(_0x1d078d,null))[_0x1390('0x24')](handleError(_0x1d078d,null));};exports['download']=function(_0x26e152,_0xc0079f){var _0x3e8a4e=moment()[_0x1390('0x4d')]()[_0x1390('0x4e')]();var _0x296bb4=path['join'](config[_0x1390('0x4f')],'server',_0x1390('0x50'),'tmp');var _0x2736b0=path[_0x1390('0x51')](config['root'],_0x1390('0x52'),_0x1390('0x50'),_0x1390('0x53'));var _0x280944=path[_0x1390('0x51')](_0x296bb4,_0x3e8a4e);var _0x4052ac=util[_0x1390('0x42')](_0x1390('0x54'),_0x26e152[_0x1390('0x33')]['id'],_0x3e8a4e);var _0xc2177b=path[_0x1390('0x51')](_0x296bb4,_0x4052ac);var _0x55f55a=[];_0x55f55a[_0x1390('0x55')]({'model':db[_0x1390('0x56')],'as':'Attachment','raw':!![]});var _0x18b4a9=[{'model':db['FaxMessage'],'as':'Messages','attributes':['id','body',_0x1390('0x57')],'include':_0x55f55a}];return db[_0x1390('0x1e')][_0x1390('0x2f')]({'where':{'id':_0x26e152[_0x1390('0x33')]['id']},'include':_0x18b4a9})['then'](handleEntityNotFound(_0xc0079f,null))[_0x1390('0x18')](function(_0x172e71){if(_0x172e71&&_0x172e71[_0x1390('0x58')]){var _0x4a627e=_0x172e71['get']({'plain':!![]});fs[_0x1390('0x59')](_0x280944);for(var _0x5f23ef=0x0;_0x5f23ef<_0x4a627e['Messages'][_0x1390('0x2c')];_0x5f23ef++){var _0x4a77f2=_0x4a627e['Messages'][_0x5f23ef][_0x1390('0x56')];if(_0x4a77f2){var _0x262478=path[_0x1390('0x51')](_0x2736b0,_0x4a77f2['basename']);if(fs[_0x1390('0x5a')](_0x262478)){fs[_0x1390('0x5b')](_0x262478)[_0x1390('0x5c')](fs[_0x1390('0x5d')](path[_0x1390('0x51')](_0x280944,_0x4a77f2[_0x1390('0x5e')])));}}}return BPromise[_0x1390('0x5f')]()[_0x1390('0x18')](function(){return new BPromise(function(_0x4781b9,_0x51970c){zipdir(_0x280944,{'saveTo':_0xc2177b},function(_0x5850fb,_0x41da0f){if(_0x5850fb)return _0x51970c(_0x5850fb);return _0x4781b9(_0x41da0f);});})['then'](function(){return new BPromise(function(_0x3139aa,_0x4a95a8){rimraf(_0x280944,function(_0x3cf861){if(_0x3cf861)_0x4a95a8(_0x3cf861);return _0x3139aa();});});})[_0x1390('0x18')](function(){return _0xc0079f[_0x1390('0x60')](_0xc2177b,_0x4052ac,function(_0x54e0a8){if(_0x54e0a8){console[_0x1390('0x61')]('err',_0x54e0a8);}else{fs[_0x1390('0x62')](_0xc2177b);}});});});}else{return _0xc0079f[_0x1390('0xf')](0xc8);}})['catch'](handleError(_0xc0079f,null));}; \ No newline at end of file +var _0x060b=['FaxInteraction','intersection','fields','attributes','length','includeAll','include','merge','options','create','body','find','describe','addMessage','FaxMessage','omit','ids','keys','filters','nolimit','order','sort','where','pick','FaxInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','spread','Tag','color','emit','removeTags','download','toString','join','root','files','server','attachments','transcript-%d-%s.zip','push','Attachment','Messages','get','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','resolve','log','err','rimraf','zip-dir','moment','bluebird','util','lodash','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','./faxInteraction.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','update','then','destroy','name','index','map','rawAttributes','fieldName','key','findAll','fax','query','user','catch','show','params','model'];(function(_0x1b2916,_0x54c8b8){var _0x386928=function(_0x1064ec){while(--_0x1064ec){_0x1b2916['push'](_0x1b2916['shift']());}};_0x386928(++_0x54c8b8);}(_0x060b,0x105));var _0xb060=function(_0x21f6b8,_0x262dd){_0x21f6b8=_0x21f6b8-0x0;var _0xdeec65=_0x060b[_0x21f6b8];return _0xdeec65;};'use strict';var rimraf=require(_0xb060('0x0'));var zipdir=require(_0xb060('0x1'));var moment=require(_0xb060('0x2'));var BPromise=require(_0xb060('0x3'));var util=require(_0xb060('0x4'));var path=require('path');var fs=require('fs');var _=require(_0xb060('0x5'));var Redis=require('ioredis');var interaction=require(_0xb060('0x6'));var qs=require(_0xb060('0x7'));var logger=require(_0xb060('0x8'))(_0xb060('0x9'));var config=require(_0xb060('0xa'));var db=require(_0xb060('0xb'))['db'];config['redis']=_[_0xb060('0xc')](config[_0xb060('0xd')],{'host':_0xb060('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb060('0xd')]));require(_0xb060('0xf'))[_0xb060('0x10')](socket);function respondWithStatusCode(_0x37ff34,_0x496989){_0x496989=_0x496989||0xcc;return function(_0x3d0b62){if(_0x3d0b62){return _0x37ff34[_0xb060('0x11')](_0x496989);}return _0x37ff34[_0xb060('0x12')](_0x496989)[_0xb060('0x13')]();};}function respondWithResult(_0x239ce0,_0xe8e332){_0xe8e332=_0xe8e332||0xc8;return function(_0x47e132){if(_0x47e132){return _0x239ce0['status'](_0xe8e332)['json'](_0x47e132);}};}function respondWithFilteredResult(_0x52ba8f,_0x5c3e9f){return function(_0x418ea2){if(_0x418ea2){var _0x50e28f=typeof _0x5c3e9f[_0xb060('0x14')]===_0xb060('0x15')&&typeof _0x5c3e9f[_0xb060('0x16')]===_0xb060('0x15');var _0x15b38b=_0x418ea2[_0xb060('0x17')];var _0x2efd94=_0x50e28f?0x0:_0x5c3e9f[_0xb060('0x14')];var _0x300498=_0x50e28f?_0x418ea2[_0xb060('0x17')]:_0x5c3e9f['offset']+_0x5c3e9f[_0xb060('0x16')];var _0x38e5b7;if(_0x300498>=_0x15b38b){_0x300498=_0x15b38b;_0x38e5b7=0xc8;}else{_0x38e5b7=0xce;}_0x52ba8f[_0xb060('0x12')](_0x38e5b7);return _0x52ba8f[_0xb060('0x18')]('Content-Range',_0x2efd94+'-'+_0x300498+'/'+_0x15b38b)['json'](_0x418ea2);}return null;};}function saveUpdates(_0x5d9c65){return function(_0x59b6bf){if(_0x59b6bf){return _0x59b6bf[_0xb060('0x19')](_0x5d9c65)[_0xb060('0x1a')](function(_0x2e6726){return _0x2e6726;});}return null;};}function removeEntity(_0x284baa){return function(_0x2fd4b7){if(_0x2fd4b7){return _0x2fd4b7[_0xb060('0x1b')]()[_0xb060('0x1a')](function(){_0x284baa[_0xb060('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d943e){return function(_0x5536f9){if(!_0x5536f9){_0x1d943e[_0xb060('0x11')](0x194);}return _0x5536f9;};}function handleError(_0xa9fd08,_0x573d39){_0x573d39=_0x573d39||0x1f4;return function(_0x1bc34f){logger['error'](_0x1bc34f['stack']);if(_0x1bc34f['name']){delete _0x1bc34f[_0xb060('0x1c')];}_0xa9fd08[_0xb060('0x12')](_0x573d39)['send'](_0x1bc34f);};}exports[_0xb060('0x1d')]=function(_0x3d110c,_0x24121f){var _0x5a1a46={};var _0x2ffe3b=_[_0xb060('0x1e')](db['FaxInteraction'][_0xb060('0x1f')],function(_0x10e6b1){return{'name':_0x10e6b1[_0xb060('0x20')],'type':_0x10e6b1['type'][_0xb060('0x21')]};});_0x5a1a46=qs['getOptions'](_0x2ffe3b,_0x3d110c);return interaction[_0xb060('0x22')](_0xb060('0x23'),_0x3d110c[_0xb060('0x24')],_0x3d110c[_0xb060('0x25')],_0x5a1a46,_0x2ffe3b)[_0xb060('0x1a')](respondWithFilteredResult(_0x24121f,_0x5a1a46))[_0xb060('0x26')](handleError(_0x24121f,null));};exports[_0xb060('0x27')]=function(_0x318814,_0x15f1d5){var _0x38aae9={'raw':![],'where':{'id':_0x318814[_0xb060('0x28')]['id']}},_0x307212={};_0x307212[_0xb060('0x29')]=_['keys'](db[_0xb060('0x2a')][_0xb060('0x1f')]);_0x307212[_0xb060('0x24')]=_['keys'](_0x318814['query']);_0x307212['filters']=_[_0xb060('0x2b')](_0x307212[_0xb060('0x29')],_0x307212[_0xb060('0x24')]);_0x38aae9['attributes']=_['intersection'](_0x307212[_0xb060('0x29')],qs[_0xb060('0x2c')](_0x318814['query'][_0xb060('0x2c')]));_0x38aae9[_0xb060('0x2d')]=_0x38aae9[_0xb060('0x2d')][_0xb060('0x2e')]?_0x38aae9['attributes']:_0x307212[_0xb060('0x29')];if(_0x318814[_0xb060('0x24')][_0xb060('0x2f')]){_0x38aae9[_0xb060('0x30')]=[{'all':!![]}];}_0x38aae9=_[_0xb060('0x31')]({},_0x38aae9,_0x318814[_0xb060('0x32')]);return db[_0xb060('0x2a')]['find'](_0x38aae9)[_0xb060('0x1a')](handleEntityNotFound(_0x15f1d5,null))[_0xb060('0x1a')](respondWithResult(_0x15f1d5,null))[_0xb060('0x26')](handleError(_0x15f1d5,null));};exports['create']=function(_0x34b377,_0x2b6b5e){return db[_0xb060('0x2a')][_0xb060('0x33')](_0x34b377['body'],{})[_0xb060('0x1a')](respondWithResult(_0x2b6b5e,0xc9))[_0xb060('0x26')](handleError(_0x2b6b5e,null));};exports[_0xb060('0x19')]=function(_0x467041,_0x453c0d){if(_0x467041[_0xb060('0x34')]['id']){delete _0x467041[_0xb060('0x34')]['id'];}return db['FaxInteraction']['find']({'where':{'id':_0x467041[_0xb060('0x28')]['id']}})[_0xb060('0x1a')](handleEntityNotFound(_0x453c0d,null))['then'](saveUpdates(_0x467041[_0xb060('0x34')],null))[_0xb060('0x1a')](respondWithResult(_0x453c0d,null))[_0xb060('0x26')](handleError(_0x453c0d,null));};exports[_0xb060('0x1b')]=function(_0x4e471e,_0x28436c){return db[_0xb060('0x2a')][_0xb060('0x35')]({'where':{'id':_0x4e471e[_0xb060('0x28')]['id']}})[_0xb060('0x1a')](handleEntityNotFound(_0x28436c,null))[_0xb060('0x1a')](removeEntity(_0x28436c,null))[_0xb060('0x26')](handleError(_0x28436c,null));};exports[_0xb060('0x36')]=function(_0x1fc5ab,_0x550b50){return db['FaxInteraction'][_0xb060('0x36')]()[_0xb060('0x1a')](respondWithResult(_0x550b50,null))[_0xb060('0x26')](handleError(_0x550b50,null));};exports[_0xb060('0x37')]=function(_0x5eb88b,_0x122726){return db[_0xb060('0x38')]['find']({'where':{'id':_0x5eb88b['params']['id']}})['then'](handleEntityNotFound(_0x122726,null))[_0xb060('0x1a')](function(_0x3e66bd){if(_0x3e66bd){return _0x3e66bd[_0xb060('0x37')](_0x5eb88b[_0xb060('0x34')]['ids'],_[_0xb060('0x39')](_0x5eb88b[_0xb060('0x34')],[_0xb060('0x3a'),'id'])||{});}})[_0xb060('0x1a')](respondWithResult(_0x122726,null))[_0xb060('0x26')](handleError(_0x122726,null));};exports['getMessages']=function(_0x3f543f,_0x50ab88){var _0x18e671={'raw':![],'where':{}};var _0x2668d7={};var _0x5a1ce3={'count':0x0,'rows':[]};return db[_0xb060('0x2a')]['findOne']({'where':{'id':_0x3f543f[_0xb060('0x28')]['id']}})[_0xb060('0x1a')](handleEntityNotFound(_0x50ab88,null))[_0xb060('0x1a')](function(_0x376e6a){if(_0x376e6a){_0x2668d7[_0xb060('0x29')]=_['keys'](db[_0xb060('0x38')][_0xb060('0x1f')]);_0x2668d7[_0xb060('0x24')]=_[_0xb060('0x3b')](_0x3f543f[_0xb060('0x24')]);_0x2668d7[_0xb060('0x3c')]=_[_0xb060('0x2b')](_0x2668d7[_0xb060('0x29')],_0x2668d7[_0xb060('0x24')]);_0x18e671[_0xb060('0x2d')]=_[_0xb060('0x2b')](_0x2668d7[_0xb060('0x29')],qs['fields'](_0x3f543f[_0xb060('0x24')][_0xb060('0x2c')]));_0x18e671[_0xb060('0x2d')]=_0x18e671[_0xb060('0x2d')][_0xb060('0x2e')]?_0x18e671['attributes']:_0x2668d7[_0xb060('0x29')];if(!_0x3f543f[_0xb060('0x24')]['hasOwnProperty'](_0xb060('0x3d'))){_0x18e671[_0xb060('0x16')]=qs[_0xb060('0x16')](_0x3f543f['query'][_0xb060('0x16')]);_0x18e671[_0xb060('0x14')]=qs['offset'](_0x3f543f[_0xb060('0x24')][_0xb060('0x14')]);}_0x18e671[_0xb060('0x3e')]=qs[_0xb060('0x3f')](_0x3f543f[_0xb060('0x24')][_0xb060('0x3f')]);_0x18e671[_0xb060('0x40')]=qs[_0xb060('0x3c')](_[_0xb060('0x41')](_0x3f543f['query'],_0x2668d7[_0xb060('0x3c')]));_0x18e671[_0xb060('0x40')][_0xb060('0x42')]=_0x376e6a['id'];if(_0x3f543f[_0xb060('0x24')][_0xb060('0x43')]){_0x18e671[_0xb060('0x40')]=_[_0xb060('0x31')](_0x18e671['where'],{'$or':_['map'](_0x18e671[_0xb060('0x2d')],function(_0x583a86){var _0x3ce2a4={};_0x3ce2a4[_0x583a86]={'$like':'%'+_0x3f543f[_0xb060('0x24')][_0xb060('0x43')]+'%'};return _0x3ce2a4;})});}if(_0x3f543f[_0xb060('0x24')][_0xb060('0x44')]){var _0x783f7a=_0x3f543f[_0xb060('0x24')]['$gte'][_0xb060('0x45')](',');var _0x1bdd08={};_0x1bdd08[_0x783f7a[0x0]]={'$gte':moment(_0x783f7a[0x1])[_0xb060('0x46')](_0xb060('0x47'))};_0x18e671['where']=_[_0xb060('0x31')](_0x18e671['where'],_0x1bdd08);}_0x18e671=_[_0xb060('0x31')]({},_0x18e671,_0x3f543f['options']);return db['FaxMessage'][_0xb060('0x17')]({'where':_0x18e671[_0xb060('0x40')]})[_0xb060('0x1a')](function(_0x3b9d1c){_0x5a1ce3[_0xb060('0x17')]=_0x3b9d1c;if(_0x3f543f['query']['includeAll']){_0x18e671[_0xb060('0x30')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x18e671);})[_0xb060('0x1a')](function(_0x471de0){_0x5a1ce3[_0xb060('0x48')]=_0x471de0;return _0x5a1ce3;});}})[_0xb060('0x1a')](respondWithFilteredResult(_0x50ab88,_0x18e671))[_0xb060('0x26')](handleError(_0x50ab88,null));};exports[_0xb060('0x49')]=function(_0x43c927,_0x2e3215){return db[_0xb060('0x2a')]['find']({'where':{'id':_0x43c927['params']['id']}})[_0xb060('0x1a')](handleEntityNotFound(_0x2e3215,null))[_0xb060('0x1a')](function(_0x33d43e){if(_0x33d43e){return _0x33d43e[_0xb060('0x4a')](_0x43c927[_0xb060('0x34')][_0xb060('0x3a')],_[_0xb060('0x39')](_0x43c927[_0xb060('0x34')],[_0xb060('0x3a'),'id'])||{})[_0xb060('0x4b')](function(){return db[_0xb060('0x4c')][_0xb060('0x22')]({'attributes':['id','name',_0xb060('0x4d')],'where':{'id':_0x43c927[_0xb060('0x34')]['ids']}});})[_0xb060('0x1a')](function(_0x4c0d6b){socket[_0xb060('0x4e')]('faxInteractionTags:save',{'id':Number(_0x43c927[_0xb060('0x28')]['id']),'tags':_0x4c0d6b||[]});return{'id':Number(_0x43c927[_0xb060('0x28')]['id']),'tags':_0x4c0d6b||[]};});}})['then'](respondWithResult(_0x2e3215,null))[_0xb060('0x26')](handleError(_0x2e3215,null));};exports[_0xb060('0x4f')]=function(_0x560e9a,_0x114e4d){return db['FaxInteraction']['find']({'where':{'id':_0x560e9a['params']['id']}})['then'](handleEntityNotFound(_0x114e4d,null))['then'](function(_0x4bc1f4){if(_0x4bc1f4){return _0x4bc1f4[_0xb060('0x4f')](_0x560e9a[_0xb060('0x24')][_0xb060('0x3a')]);}})[_0xb060('0x1a')](respondWithStatusCode(_0x114e4d,null))[_0xb060('0x26')](handleError(_0x114e4d,null));};exports[_0xb060('0x50')]=function(_0x43f46c,_0x3a5acb){var _0x5e1127=moment()['unix']()[_0xb060('0x51')]();var _0x3f30fa=path[_0xb060('0x52')](config[_0xb060('0x53')],'server',_0xb060('0x54'),'tmp');var _0x3dcb43=path[_0xb060('0x52')](config[_0xb060('0x53')],_0xb060('0x55'),_0xb060('0x54'),_0xb060('0x56'));var _0x572184=path[_0xb060('0x52')](_0x3f30fa,_0x5e1127);var _0x269d25=util['format'](_0xb060('0x57'),_0x43f46c[_0xb060('0x28')]['id'],_0x5e1127);var _0x3cac84=path[_0xb060('0x52')](_0x3f30fa,_0x269d25);var _0x190cc7=[];_0x190cc7[_0xb060('0x58')]({'model':db[_0xb060('0x59')],'as':_0xb060('0x59'),'raw':!![]});var _0x46fe97=[{'model':db[_0xb060('0x38')],'as':_0xb060('0x5a'),'attributes':['id',_0xb060('0x34'),'createdAt'],'include':_0x190cc7}];return db[_0xb060('0x2a')][_0xb060('0x35')]({'where':{'id':_0x43f46c[_0xb060('0x28')]['id']},'include':_0x46fe97})[_0xb060('0x1a')](handleEntityNotFound(_0x3a5acb,null))[_0xb060('0x1a')](function(_0x4f3a59){if(_0x4f3a59&&_0x4f3a59[_0xb060('0x5a')]){var _0x532b78=_0x4f3a59[_0xb060('0x5b')]({'plain':!![]});fs[_0xb060('0x5c')](_0x572184);for(var _0x436846=0x0;_0x436846<_0x532b78[_0xb060('0x5a')]['length'];_0x436846++){var _0x174579=_0x532b78[_0xb060('0x5a')][_0x436846][_0xb060('0x59')];if(_0x174579){var _0x42203c=path[_0xb060('0x52')](_0x3dcb43,_0x174579[_0xb060('0x5d')]);if(fs[_0xb060('0x5e')](_0x42203c)){fs[_0xb060('0x5f')](_0x42203c)[_0xb060('0x60')](fs[_0xb060('0x61')](path[_0xb060('0x52')](_0x572184,_0x174579[_0xb060('0x5d')])));}}}return BPromise[_0xb060('0x62')]()[_0xb060('0x1a')](function(){return new BPromise(function(_0x235a9c,_0x2370c2){zipdir(_0x572184,{'saveTo':_0x3cac84},function(_0x18f4ad,_0x4eaaea){if(_0x18f4ad)return _0x2370c2(_0x18f4ad);return _0x235a9c(_0x4eaaea);});})[_0xb060('0x1a')](function(){return new BPromise(function(_0x1730b8,_0x315983){rimraf(_0x572184,function(_0xf39fbf){if(_0xf39fbf)_0x315983(_0xf39fbf);return _0x1730b8();});});})[_0xb060('0x1a')](function(){return _0x3a5acb[_0xb060('0x50')](_0x3cac84,_0x269d25,function(_0x4b06a6){if(_0x4b06a6){console[_0xb060('0x63')](_0xb060('0x64'),_0x4b06a6);}else{fs['unlinkSync'](_0x3cac84);}});});});}else{return _0x3a5acb[_0xb060('0x11')](0xc8);}})[_0xb060('0x26')](handleError(_0x3a5acb,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index e1d1c81..9ec9a2a 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 _0x0bfc=['length','emit','catch','hook','exports','FaxInteraction','FaxMessage','update','remove','getUsers','then','map','setDataValue','unreadMessages'];(function(_0x4f8c11,_0x397cd5){var _0x4a8d6e=function(_0x4fbd44){while(--_0x4fbd44){_0x4f8c11['push'](_0x4f8c11['shift']());}};_0x4a8d6e(++_0x397cd5);}(_0x0bfc,0x19b));var _0xc0bf=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x0bfc[_0x24237f];return _0x48298e;};'use strict';var EventEmitter=require('events');var FaxInteraction=require('../../mysqldb')['db'][_0xc0bf('0x0')];var FaxMessage=require('../../mysqldb')['db'][_0xc0bf('0x1')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xc0bf('0x2'),'afterDestroy':_0xc0bf('0x3')};function emitEvent(_0x4b7c46){return function(_0x47d174,_0x3bebe,_0x40ce5c){_0x47d174[_0xc0bf('0x4')]({'attributes':['id'],'raw':!![]})[_0xc0bf('0x5')](function(_0x5deaa6){_0x47d174['setDataValue']('Users',_0x5deaa6[_0xc0bf('0x6')](function(_0x282242){return{'id':_0x282242['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x47d174['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc0bf('0x5')](function(_0x44d50f){_0x47d174[_0xc0bf('0x7')](_0xc0bf('0x8'),_0x44d50f[_0xc0bf('0x9')]);FaxInteractionEvents['emit'](_0x4b7c46+':'+_0x47d174['id'],_0x47d174);FaxInteractionEvents[_0xc0bf('0xa')](_0x4b7c46,_0x47d174);_0x40ce5c(null);})[_0xc0bf('0xb')](_0x40ce5c(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0xc0bf('0xc')](e,emitEvent(event));}}module[_0xc0bf('0xd')]=FaxInteractionEvents; \ No newline at end of file +var _0xfb6c=['hasOwnProperty','hook','events','FaxMessage','setMaxListeners','save','getUsers','setDataValue','Users','findAll','then','unreadMessages','length','emit','catch'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0xfb6c,0x6b));var _0xcfb6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfb6c[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xcfb6('0x0'));var FaxInteraction=require('../../mysqldb')['db']['FaxInteraction'];var FaxMessage=require('../../mysqldb')['db'][_0xcfb6('0x1')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xcfb6('0x2')](0x0);var events={'afterCreate':_0xcfb6('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2dfb9a){return function(_0x184bbf,_0x2beb12,_0x5bee83){_0x184bbf[_0xcfb6('0x4')]({'attributes':['id'],'raw':!![]})['then'](function(_0x238715){_0x184bbf[_0xcfb6('0x5')](_0xcfb6('0x6'),_0x238715['map'](function(_0x1867ed){return{'id':_0x1867ed['id']};}));return FaxMessage[_0xcfb6('0x7')]({'where':{'FaxInteractionId':_0x184bbf['id'],'direction':'in','read':![]},'raw':!![]});})[_0xcfb6('0x8')](function(_0x55c367){_0x184bbf[_0xcfb6('0x5')](_0xcfb6('0x9'),_0x55c367[_0xcfb6('0xa')]);FaxInteractionEvents[_0xcfb6('0xb')](_0x2dfb9a+':'+_0x184bbf['id'],_0x184bbf);FaxInteractionEvents[_0xcfb6('0xb')](_0x2dfb9a,_0x184bbf);_0x5bee83(null);})[_0xcfb6('0xc')](_0x5bee83(null));};}for(var e in events){if(events[_0xcfb6('0xd')](e)){var event=events[e];FaxInteraction[_0xcfb6('0xe')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 1adea0c..2c0cfac 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 _0x142c=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./faxInteraction.attributes','exports','define','fax_interactions','changed','closed','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0xf73c09,_0x4e424e){var _0xa8923c=function(_0x4831c1){while(--_0x4831c1){_0xf73c09['push'](_0xf73c09['shift']());}};_0xa8923c(++_0x4e424e);}(_0x142c,0x8f));var _0xc142=function(_0x459219,_0x1cb666){_0x459219=_0x459219-0x0;var _0x36d8e1=_0x142c[_0x459219];return _0x36d8e1;};'use strict';var _=require(_0xc142('0x0'));var util=require(_0xc142('0x1'));var logger=require(_0xc142('0x2'))(_0xc142('0x3'));var moment=require(_0xc142('0x4'));var BPromise=require(_0xc142('0x5'));var rp=require(_0xc142('0x6'));var fs=require('fs');var path=require(_0xc142('0x7'));var rimraf=require('rimraf');var config=require(_0xc142('0x8'));var attributes=require(_0xc142('0x9'));module[_0xc142('0xa')]=function(_0x46bff1,_0x4ff85e){return _0x46bff1[_0xc142('0xb')]('FaxInteraction',attributes,{'tableName':_0xc142('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2e8d46,_0x4794dc,_0x1cd3e1){if(_0x2e8d46[_0xc142('0xd')](_0xc142('0xe'))){_0x2e8d46['closedAt']=moment()['format'](_0xc142('0xf'));}_0x1cd3e1(null,_0x2e8d46);}}});}; \ No newline at end of file +var _0x18d4=['lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x236ed6,_0x562e24){var _0x2507e4=function(_0x1fdd4b){while(--_0x1fdd4b){_0x236ed6['push'](_0x236ed6['shift']());}};_0x2507e4(++_0x562e24);}(_0x18d4,0x19e));var _0x418d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x18d4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x418d('0x0'));var util=require(_0x418d('0x1'));var logger=require(_0x418d('0x2'))('api');var moment=require('moment');var BPromise=require(_0x418d('0x3'));var rp=require(_0x418d('0x4'));var fs=require('fs');var path=require(_0x418d('0x5'));var rimraf=require(_0x418d('0x6'));var config=require(_0x418d('0x7'));var attributes=require(_0x418d('0x8'));module[_0x418d('0x9')]=function(_0x2c0785,_0x27e1c0){return _0x2c0785[_0x418d('0xa')](_0x418d('0xb'),attributes,{'tableName':_0x418d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x37e2d2,_0x152235,_0xf39286){if(_0x37e2d2[_0x418d('0xd')](_0x418d('0xe'))){_0x37e2d2[_0x418d('0xf')]=moment()[_0x418d('0x10')](_0x418d('0x11'));}_0xf39286(null,_0x37e2d2);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index c66aab2..a58cdd9 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 _0xce4f=['catch','FaxInteraction','update','body','options','raw','where','attributes','limit','UpdateFaxInteraction','stringify','AddTagsToFaxInteraction','ids','omit','spread','AddTags','util','bluebird','ioredis','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','request','then','info','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','FaxInteraction,\x20%s,\x20%s','message','error','request\x20sent','result'];(function(_0x573acb,_0x2108ae){var _0x1d3422=function(_0x1bbb36){while(--_0x1bbb36){_0x573acb['push'](_0x573acb['shift']());}};_0x1d3422(++_0x2108ae);}(_0xce4f,0x1ec));var _0xfce4=function(_0x30072b,_0x4e0e60){_0x30072b=_0x30072b-0x0;var _0x4cd9fb=_0xce4f[_0x30072b];return _0x4cd9fb;};'use strict';var _=require('lodash');var util=require(_0xfce4('0x0'));var moment=require('moment');var BPromise=require(_0xfce4('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfce4('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xfce4('0x3'));var jayson=require(_0xfce4('0x4'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xfce4('0x5')],{'host':_0xfce4('0x6'),'port':0x18eb});var socket=require(_0xfce4('0x7'))(new Redis(config[_0xfce4('0x5')]));require('./faxInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x2a7a52,_0xa20b26,_0x2ae742){return new BPromise(function(_0xfbb7ff,_0x1947fb){return client[_0xfce4('0x8')](_0x2a7a52,_0x2ae742)[_0xfce4('0x9')](function(_0x3721f7){logger[_0xfce4('0xa')]('FaxInteraction,\x20%s,\x20%s',_0xa20b26,'request\x20sent');logger[_0xfce4('0xb')](_0xfce4('0xc'),_0xa20b26,'request\x20sent',JSON['stringify'](_0x3721f7));if(_0x3721f7['error']){if(_0x3721f7['error']['code']===0x1f4){logger['error'](_0xfce4('0xd'),_0xa20b26,_0x3721f7['error'][_0xfce4('0xe')]);return _0x1947fb(_0x3721f7[_0xfce4('0xf')][_0xfce4('0xe')]);}logger[_0xfce4('0xf')]('FaxInteraction,\x20%s,\x20%s',_0xa20b26,_0x3721f7['error'][_0xfce4('0xe')]);return _0xfbb7ff(_0x3721f7[_0xfce4('0xf')][_0xfce4('0xe')]);}else{logger[_0xfce4('0xa')](_0xfce4('0xd'),_0xa20b26,_0xfce4('0x10'));_0xfbb7ff(_0x3721f7[_0xfce4('0x11')][_0xfce4('0xe')]);}})[_0xfce4('0x12')](function(_0x13cd6b){logger[_0xfce4('0xf')](_0xfce4('0xd'),_0xa20b26,_0x13cd6b);_0x1947fb(_0x13cd6b);});});}exports['UpdateFaxInteraction']=function(_0xf78a18){var _0xf4fed2=this;return new Promise(function(_0x432bab,_0x1c68d5){return db[_0xfce4('0x13')][_0xfce4('0x14')](_0xf78a18[_0xfce4('0x15')],{'raw':_0xf78a18['options']?_0xf78a18[_0xfce4('0x16')][_0xfce4('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf78a18[_0xfce4('0x16')]?_0xf78a18[_0xfce4('0x16')][_0xfce4('0x18')]||null:null,'attributes':_0xf78a18[_0xfce4('0x16')]?_0xf78a18[_0xfce4('0x16')][_0xfce4('0x19')]||null:null,'limit':_0xf78a18[_0xfce4('0x16')]?_0xf78a18[_0xfce4('0x16')][_0xfce4('0x1a')]||null:null})[_0xfce4('0x9')](function(_0x322505){logger['info'](_0xfce4('0x1b'),_0xf78a18);logger['debug'](_0xfce4('0x1b'),_0xf78a18,JSON[_0xfce4('0x1c')](_0x322505));_0x432bab(_0x322505);})[_0xfce4('0x12')](function(_0x210496){logger['error'](_0xfce4('0x1b'),_0x210496[_0xfce4('0xe')],_0xf78a18);_0x1c68d5(_0xf4fed2[_0xfce4('0xf')](0x1f4,_0x210496[_0xfce4('0xe')]));});});};exports[_0xfce4('0x1d')]=function(_0x1addb1){return new Promise(function(_0x17c498,_0x227bc6){return db['FaxInteraction']['find']({'where':_0x1addb1[_0xfce4('0x16')]?_0x1addb1[_0xfce4('0x16')][_0xfce4('0x18')]||null:null})[_0xfce4('0x9')](function(_0x4d6e76){if(_0x4d6e76){return _0x4d6e76['addTags'](_0x1addb1[_0xfce4('0x15')][_0xfce4('0x1e')],_[_0xfce4('0x1f')](_0x1addb1[_0xfce4('0x15')],[_0xfce4('0x1e'),'id'])||{});}})[_0xfce4('0x20')](function(_0x33a563){logger[_0xfce4('0xa')](_0xfce4('0x21'),_0x1addb1);logger[_0xfce4('0xb')](_0xfce4('0x21'),_0x1addb1,JSON['stringify'](_0x33a563));_0x17c498(_0x33a563);})['catch'](function(_0x43d53d){logger['error']('AddTags',_0x43d53d[_0xfce4('0xe')],_0x1addb1);_0x227bc6(_this['error'](0x1f4,_0x43d53d[_0xfce4('0xe')]));});});}; \ No newline at end of file +var _0x1eaf=['redis','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','attributes','limit','debug','AddTagsToFaxInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','socket.io-emitter'];(function(_0x4b2d3e,_0x3e6fc0){var _0x5e51f1=function(_0x28088e){while(--_0x28088e){_0x4b2d3e['push'](_0x4b2d3e['shift']());}};_0x5e51f1(++_0x3e6fc0);}(_0x1eaf,0x177));var _0xf1ea=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x1eaf[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xf1ea('0x0'));var util=require(_0xf1ea('0x1'));var moment=require(_0xf1ea('0x2'));var BPromise=require(_0xf1ea('0x3'));var rs=require(_0xf1ea('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf1ea('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf1ea('0x6'));var config=require(_0xf1ea('0x7'));var jayson=require(_0xf1ea('0x8'));var client=jayson[_0xf1ea('0x9')][_0xf1ea('0xa')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf1ea('0xb'))(new Redis(config[_0xf1ea('0xc')]));require(_0xf1ea('0xd'))[_0xf1ea('0xe')](socket);function respondWithRpcPromise(_0x2fb687,_0x25752f,_0x319d04){return new BPromise(function(_0x4b036d,_0x1371a4){return client[_0xf1ea('0xf')](_0x2fb687,_0x319d04)[_0xf1ea('0x10')](function(_0x3db4dc){logger[_0xf1ea('0x11')](_0xf1ea('0x12'),_0x25752f,_0xf1ea('0x13'));logger['debug'](_0xf1ea('0x14'),_0x25752f,_0xf1ea('0x13'),JSON[_0xf1ea('0x15')](_0x3db4dc));if(_0x3db4dc[_0xf1ea('0x16')]){if(_0x3db4dc[_0xf1ea('0x16')]['code']===0x1f4){logger[_0xf1ea('0x16')]('FaxInteraction,\x20%s,\x20%s',_0x25752f,_0x3db4dc[_0xf1ea('0x16')]['message']);return _0x1371a4(_0x3db4dc[_0xf1ea('0x16')]['message']);}logger[_0xf1ea('0x16')](_0xf1ea('0x12'),_0x25752f,_0x3db4dc['error'][_0xf1ea('0x17')]);return _0x4b036d(_0x3db4dc[_0xf1ea('0x16')][_0xf1ea('0x17')]);}else{logger[_0xf1ea('0x11')](_0xf1ea('0x12'),_0x25752f,'request\x20sent');_0x4b036d(_0x3db4dc[_0xf1ea('0x18')][_0xf1ea('0x17')]);}})[_0xf1ea('0x19')](function(_0x13861d){logger[_0xf1ea('0x16')](_0xf1ea('0x12'),_0x25752f,_0x13861d);_0x1371a4(_0x13861d);});});}exports[_0xf1ea('0x1a')]=function(_0x208510){var _0x3bd06e=this;return new Promise(function(_0x12c4d9,_0x1a2692){return db[_0xf1ea('0x1b')][_0xf1ea('0x1c')](_0x208510[_0xf1ea('0x1d')],{'raw':_0x208510[_0xf1ea('0x1e')]?_0x208510[_0xf1ea('0x1e')][_0xf1ea('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x208510[_0xf1ea('0x1e')]?_0x208510['options'][_0xf1ea('0x20')]||null:null,'attributes':_0x208510[_0xf1ea('0x1e')]?_0x208510[_0xf1ea('0x1e')][_0xf1ea('0x21')]||null:null,'limit':_0x208510[_0xf1ea('0x1e')]?_0x208510[_0xf1ea('0x1e')][_0xf1ea('0x22')]||null:null})[_0xf1ea('0x10')](function(_0x3d8bf5){logger['info'](_0xf1ea('0x1a'),_0x208510);logger[_0xf1ea('0x23')](_0xf1ea('0x1a'),_0x208510,JSON[_0xf1ea('0x15')](_0x3d8bf5));_0x12c4d9(_0x3d8bf5);})['catch'](function(_0x4f9807){logger[_0xf1ea('0x16')](_0xf1ea('0x1a'),_0x4f9807[_0xf1ea('0x17')],_0x208510);_0x1a2692(_0x3bd06e[_0xf1ea('0x16')](0x1f4,_0x4f9807[_0xf1ea('0x17')]));});});};exports[_0xf1ea('0x24')]=function(_0x1fb279){return new Promise(function(_0x1b46e6,_0x19c40d){return db[_0xf1ea('0x1b')][_0xf1ea('0x25')]({'where':_0x1fb279['options']?_0x1fb279[_0xf1ea('0x1e')][_0xf1ea('0x20')]||null:null})[_0xf1ea('0x10')](function(_0xe41b63){if(_0xe41b63){return _0xe41b63[_0xf1ea('0x26')](_0x1fb279[_0xf1ea('0x1d')][_0xf1ea('0x27')],_[_0xf1ea('0x28')](_0x1fb279['body'],[_0xf1ea('0x27'),'id'])||{});}})[_0xf1ea('0x29')](function(_0x2e328d){logger[_0xf1ea('0x11')](_0xf1ea('0x2a'),_0x1fb279);logger[_0xf1ea('0x23')](_0xf1ea('0x2a'),_0x1fb279,JSON[_0xf1ea('0x15')](_0x2e328d));_0x1b46e6(_0x2e328d);})[_0xf1ea('0x19')](function(_0x396f14){logger[_0xf1ea('0x16')]('AddTags',_0x396f14[_0xf1ea('0x17')],_0x1fb279);_0x19c40d(_this[_0xf1ea('0x16')](0x1f4,_0x396f14[_0xf1ea('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 8446074..fe5c18a 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 _0x4071=['removeListener','register','length','faxInteraction:','./faxInteraction.events','save','update'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x4071,0xeb));var _0x1407=function(_0x38e34e,_0x27527e){_0x38e34e=_0x38e34e-0x0;var _0x68ab01=_0x4071[_0x38e34e];return _0x68ab01;};'use strict';var FaxInteractionEvents=require(_0x1407('0x0'));var events=[_0x1407('0x1'),'remove',_0x1407('0x2')];function createListener(_0xa22137,_0x50eec3){return function(_0x12d938){_0x50eec3['emit'](_0xa22137,_0x12d938);};}function removeListener(_0x57f318,_0x53d8fd){return function(){FaxInteractionEvents[_0x1407('0x3')](_0x57f318,_0x53d8fd);};}exports[_0x1407('0x4')]=function(_0x261301){for(var _0x4af100=0x0,_0x542206=events[_0x1407('0x5')];_0x4af100<_0x542206;_0x4af100++){var _0x385d63=events[_0x4af100];var _0x32ffdc=createListener(_0x1407('0x6')+_0x385d63,_0x261301);FaxInteractionEvents['on'](_0x385d63,_0x32ffdc);}}; \ No newline at end of file +var _0x4e92=['removeListener','length','faxInteraction:','./faxInteraction.events','save','remove','update','emit'];(function(_0x2e409c,_0x5c7e99){var _0x51cdf5=function(_0x3569e9){while(--_0x3569e9){_0x2e409c['push'](_0x2e409c['shift']());}};_0x51cdf5(++_0x5c7e99);}(_0x4e92,0xf3));var _0x24e9=function(_0x4c315a,_0x187fc3){_0x4c315a=_0x4c315a-0x0;var _0x2310d8=_0x4e92[_0x4c315a];return _0x2310d8;};'use strict';var FaxInteractionEvents=require(_0x24e9('0x0'));var events=[_0x24e9('0x1'),_0x24e9('0x2'),_0x24e9('0x3')];function createListener(_0xa5f485,_0x1751b7){return function(_0x1fbbaa){_0x1751b7[_0x24e9('0x4')](_0xa5f485,_0x1fbbaa);};}function removeListener(_0x3b3e70,_0x1a8a83){return function(){FaxInteractionEvents[_0x24e9('0x5')](_0x3b3e70,_0x1a8a83);};}exports['register']=function(_0x16a480){for(var _0x211674=0x0,_0x4e41a6=events[_0x24e9('0x6')];_0x211674<_0x4e41a6;_0x211674++){var _0x5be82b=events[_0x211674];var _0x1975b9=createListener(_0x24e9('0x7')+_0x5be82b,_0x16a480);FaxInteractionEvents['on'](_0x5be82b,_0x1975b9);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 5367b60..9d216a4 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 _0xa44c=['post','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','put','/:id','update','delete','faxinteraction:destroy','destroy','removeTags','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','/describe','isAuthenticated','show','/:id/messages','getMessages','download','create'];(function(_0x443c91,_0x333e16){var _0x407830=function(_0x357dfb){while(--_0x357dfb){_0x443c91['push'](_0x443c91['shift']());}};_0x407830(++_0x333e16);}(_0xa44c,0xc2));var _0xca44=function(_0x1dc15e,_0x46d926){_0x1dc15e=_0x1dc15e-0x0;var _0x137395=_0xa44c[_0x1dc15e];return _0x137395;};'use strict';var multer=require(_0xca44('0x0'));var util=require(_0xca44('0x1'));var path=require('path');var timeout=require(_0xca44('0x2'));var express=require(_0xca44('0x3'));var router=express[_0xca44('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xca44('0x5'));var config=require(_0xca44('0x6'));var controller=require(_0xca44('0x7'));router[_0xca44('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xca44('0x8')](_0xca44('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0xca44('0x8')]('/:id',auth[_0xca44('0xa')](),controller[_0xca44('0xb')]);router[_0xca44('0x8')](_0xca44('0xc'),auth[_0xca44('0xa')](),controller[_0xca44('0xd')]);router[_0xca44('0x8')]('/:id/download',auth[_0xca44('0xa')](),controller[_0xca44('0xe')]);router['post']('/',auth[_0xca44('0xa')](),controller[_0xca44('0xf')]);router[_0xca44('0x10')](_0xca44('0xc'),auth[_0xca44('0xa')](),controller[_0xca44('0x11')]);router[_0xca44('0x10')](_0xca44('0x12'),auth[_0xca44('0xa')](),interaction[_0xca44('0x13')](_0xca44('0x14'),_0xca44('0x15')),controller['addTags']);router[_0xca44('0x16')](_0xca44('0x17'),auth[_0xca44('0xa')](),interaction[_0xca44('0x13')](_0xca44('0x14'),'faxinteraction:update'),controller[_0xca44('0x18')]);router[_0xca44('0x19')](_0xca44('0x17'),auth[_0xca44('0xa')](),interaction[_0xca44('0x13')](_0xca44('0x14'),_0xca44('0x1a')),controller[_0xca44('0x1b')]);router[_0xca44('0x19')](_0xca44('0x12'),auth['isAuthenticated'](),controller[_0xca44('0x1c')]);module[_0xca44('0x1d')]=router; \ No newline at end of file +var _0x302e=['download','post','create','/:id/messages','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','removeTags','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','getMessages','/:id/download'];(function(_0x219cc6,_0x528658){var _0x1eddf7=function(_0x4f9dcf){while(--_0x4f9dcf){_0x219cc6['push'](_0x219cc6['shift']());}};_0x1eddf7(++_0x528658);}(_0x302e,0x187));var _0xe302=function(_0x1cb057,_0x3b039e){_0x1cb057=_0x1cb057-0x0;var _0x51d4fa=_0x302e[_0x1cb057];return _0x51d4fa;};'use strict';var multer=require(_0xe302('0x0'));var util=require(_0xe302('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe302('0x2'));var router=express[_0xe302('0x3')]();var fs_extra=require(_0xe302('0x4'));var auth=require(_0xe302('0x5'));var interaction=require(_0xe302('0x6'));var config=require(_0xe302('0x7'));var controller=require('./faxInteraction.controller');router[_0xe302('0x8')]('/',auth[_0xe302('0x9')](),controller[_0xe302('0xa')]);router[_0xe302('0x8')](_0xe302('0xb'),auth[_0xe302('0x9')](),controller[_0xe302('0xc')]);router['get'](_0xe302('0xd'),auth[_0xe302('0x9')](),controller[_0xe302('0xe')]);router[_0xe302('0x8')]('/:id/messages',auth[_0xe302('0x9')](),controller[_0xe302('0xf')]);router[_0xe302('0x8')](_0xe302('0x10'),auth[_0xe302('0x9')](),controller[_0xe302('0x11')]);router[_0xe302('0x12')]('/',auth['isAuthenticated'](),controller[_0xe302('0x13')]);router['post'](_0xe302('0x14'),auth[_0xe302('0x9')](),controller['addMessage']);router[_0xe302('0x12')](_0xe302('0x15'),auth[_0xe302('0x9')](),interaction[_0xe302('0x16')](_0xe302('0x17'),_0xe302('0x18')),controller[_0xe302('0x19')]);router[_0xe302('0x1a')](_0xe302('0xd'),auth[_0xe302('0x9')](),interaction['tracked']('fax',_0xe302('0x1b')),controller[_0xe302('0x1c')]);router[_0xe302('0x1d')](_0xe302('0xd'),auth[_0xe302('0x9')](),interaction[_0xe302('0x16')]('fax',_0xe302('0x1e')),controller[_0xe302('0x1f')]);router[_0xe302('0x1d')](_0xe302('0x15'),auth[_0xe302('0x9')](),controller[_0xe302('0x20')]);module[_0xe302('0x21')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 9d366b4..7cd8338 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 _0xf874=['ENUM','out','DATE','TEXT','medium','BOOLEAN'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0xf874,0xed));var _0x4f87=function(_0x24a5bd,_0x1374f5){_0x24a5bd=_0x24a5bd-0x0;var _0x2f29fb=_0xf874[_0x24a5bd];return _0x2f29fb;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x4f87('0x0')](_0x4f87('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x4f87('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4f87('0x3')]('in',_0x4f87('0x4')),'defaultValue':_0x4f87('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x4f87('0x5')]}}; \ No newline at end of file +var _0x3645=['BOOLEAN','ENUM','out','DATE','exports','TEXT','medium'];(function(_0x1f9969,_0x3108d0){var _0x333666=function(_0x1d09a5){while(--_0x1d09a5){_0x1f9969['push'](_0x1f9969['shift']());}};_0x333666(++_0x3108d0);}(_0x3645,0x154));var _0x5364=function(_0xb8cfbe,_0x2e81b6){_0xb8cfbe=_0xb8cfbe-0x0;var _0x227d51=_0x3645[_0xb8cfbe];return _0x227d51;};'use strict';var Sequelize=require('sequelize');module[_0x5364('0x0')]={'body':{'type':Sequelize[_0x5364('0x1')](_0x5364('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x5364('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5364('0x4')]('in',_0x5364('0x5')),'defaultValue':_0x5364('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x5364('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index fff1f29..6bf3155 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 _0x373b=['end','json','undefined','limit','count','offset','Content-Range','apply','save','update','destroy','stack','name','index','map','FaxMessage','rawAttributes','fieldName','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','filters','pick','filter','merge','where','type','includeAll','include','show','keys','options','find','body','params','describe','fax-interactions','accept','fax','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','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','QueryTypes','contact','User','fullname','internal','manual','interface','format','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','reject','FaxInteraction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','Sequelize','SELECT','email','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','files','attachments','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','client','http','request','then','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxMessage,\x20%s,\x20%s','catch','sendStatus','status'];(function(_0x38147e,_0x24f8f9){var _0x1dfaa9=function(_0x335440){while(--_0x335440){_0x38147e['push'](_0x38147e['shift']());}};_0x1dfaa9(++_0x24f8f9);}(_0x373b,0x64));var _0xb373=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x373b[_0x46aff0];return _0x9d78cf;};'use strict';var emlformat=require(_0xb373('0x0'));var rimraf=require(_0xb373('0x1'));var zipdir=require(_0xb373('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb373('0x3'));var moment=require(_0xb373('0x4'));var BPromise=require(_0xb373('0x5'));var Mustache=require(_0xb373('0x6'));var util=require(_0xb373('0x7'));var path=require('path');var sox=require(_0xb373('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb373('0x9'));var _=require(_0xb373('0xa'));var squel=require('squel');var crypto=require(_0xb373('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb373('0xc'));var toCsv=require(_0xb373('0xd'));var querystring=require(_0xb373('0xe'));var Papa=require(_0xb373('0xf'));var Redis=require(_0xb373('0x10'));var authService=require(_0xb373('0x11'));var qs=require(_0xb373('0x12'));var as=require(_0xb373('0x13'));var hardwareService=require(_0xb373('0x14'));var logger=require(_0xb373('0x15'))('api');var utils=require(_0xb373('0x16'));var config=require(_0xb373('0x17'));var licenseUtil=require(_0xb373('0x18'));var db=require('../../mysqldb')['db'];config[_0xb373('0x19')]=_[_0xb373('0x1a')](config[_0xb373('0x19')],{'host':_0xb373('0x1b'),'port':0x18eb});var socket=require(_0xb373('0x1c'))(new Redis(config[_0xb373('0x19')]));require(_0xb373('0x1d'))[_0xb373('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0xb373('0x1f')][_0xb373('0x20')]({'port':0x232c});var client9002=jayson['client'][_0xb373('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x494904,_0xed7fa5,_0x9f3326,_0x10c00b){return new BPromise(function(_0xca2fb3,_0x23c812){var _0x38f454=_0x10c00b||client;return _0x38f454[_0xb373('0x21')](_0x494904,_0x9f3326)[_0xb373('0x22')](function(_0x114363){logger[_0xb373('0x23')]('FaxMessage,\x20%s,\x20%s',_0xed7fa5,_0xb373('0x24'));logger[_0xb373('0x25')](_0xb373('0x26'),_0xed7fa5,_0xb373('0x24'),JSON[_0xb373('0x27')](_0x114363));if(_0x114363[_0xb373('0x28')]){if(_0x114363['error'][_0xb373('0x29')]===0x1f4){logger[_0xb373('0x28')]('FaxMessage,\x20%s,\x20%s',_0xed7fa5,_0x114363['error'][_0xb373('0x2a')]);return _0x23c812(_0x114363[_0xb373('0x28')][_0xb373('0x2a')]);}logger[_0xb373('0x28')](_0xb373('0x2b'),_0xed7fa5,_0x114363['error'][_0xb373('0x2a')]);return _0xca2fb3(_0x114363['error'][_0xb373('0x2a')]);}else{logger['info'](_0xb373('0x2b'),_0xed7fa5,_0xb373('0x24'));_0xca2fb3(_0x114363['result'][_0xb373('0x2a')]);}})[_0xb373('0x2c')](function(_0x3da477){logger[_0xb373('0x28')](_0xb373('0x2b'),_0xed7fa5,_0x3da477);_0x23c812(_0x3da477);});});}function respondWithStatusCode(_0x49a9d6,_0x8d6057){_0x8d6057=_0x8d6057||0xcc;return function(_0x3e1609){if(_0x3e1609){return _0x49a9d6[_0xb373('0x2d')](_0x8d6057);}return _0x49a9d6[_0xb373('0x2e')](_0x8d6057)[_0xb373('0x2f')]();};}function respondWithResult(_0x97b279,_0x355ff2){_0x355ff2=_0x355ff2||0xc8;return function(_0x36617e){if(_0x36617e){return _0x97b279[_0xb373('0x2e')](_0x355ff2)[_0xb373('0x30')](_0x36617e);}};}function respondWithFilteredResult(_0x405193,_0x2bc1c2){return function(_0x4dae16){if(_0x4dae16){var _0x130e13=typeof _0x2bc1c2['offset']===_0xb373('0x31')&&typeof _0x2bc1c2[_0xb373('0x32')]==='undefined';var _0x3abf7f=_0x4dae16[_0xb373('0x33')];var _0x17e3f3=_0x130e13?0x0:_0x2bc1c2['offset'];var _0x1bc60d=_0x130e13?_0x4dae16[_0xb373('0x33')]:_0x2bc1c2[_0xb373('0x34')]+_0x2bc1c2[_0xb373('0x32')];var _0xdf53cc;if(_0x1bc60d>=_0x3abf7f){_0x1bc60d=_0x3abf7f;_0xdf53cc=0xc8;}else{_0xdf53cc=0xce;}_0x405193[_0xb373('0x2e')](_0xdf53cc);return _0x405193['set'](_0xb373('0x35'),_0x17e3f3+'-'+_0x1bc60d+'/'+_0x3abf7f)[_0xb373('0x30')](_0x4dae16);}return null;};}function patchUpdates(_0x5ae573){return function(_0x258160){try{jsonpatch[_0xb373('0x36')](_0x258160,_0x5ae573,!![]);}catch(_0x767dd3){return BPromise['reject'](_0x767dd3);}return _0x258160[_0xb373('0x37')]();};}function saveUpdates(_0x549d65,_0x587cfd){return function(_0x1e3a68){if(_0x1e3a68){return _0x1e3a68[_0xb373('0x38')](_0x549d65)['then'](function(_0x41c484){return _0x41c484;});}return null;};}function removeEntity(_0x269e77,_0x25558c){return function(_0x5827b3){if(_0x5827b3){return _0x5827b3[_0xb373('0x39')]()[_0xb373('0x22')](function(){_0x269e77[_0xb373('0x2e')](0xcc)[_0xb373('0x2f')]();});}};}function handleEntityNotFound(_0x1846ce,_0x4213b0){return function(_0x138a74){if(!_0x138a74){_0x1846ce[_0xb373('0x2d')](0x194);}return _0x138a74;};}function handleError(_0x161dc0,_0x454b34){_0x454b34=_0x454b34||0x1f4;return function(_0x569d78){logger['error'](_0x569d78[_0xb373('0x3a')]);if(_0x569d78['name']){delete _0x569d78[_0xb373('0x3b')];}_0x161dc0[_0xb373('0x2e')](_0x454b34)['send'](_0x569d78);};}exports[_0xb373('0x3c')]=function(_0x3d6089,_0x2d9690){var _0x4c3b2d={},_0x2b2c16={},_0x497a80={'count':0x0,'rows':[]};var _0x5026b1=_[_0xb373('0x3d')](db[_0xb373('0x3e')][_0xb373('0x3f')],function(_0x2c616d){return{'name':_0x2c616d[_0xb373('0x40')],'type':_0x2c616d['type']['key']};});_0x2b2c16[_0xb373('0x41')]=_[_0xb373('0x3d')](_0x5026b1,_0xb373('0x3b'));_0x2b2c16['query']=_['keys'](_0x3d6089[_0xb373('0x42')]);_0x2b2c16['filters']=_[_0xb373('0x43')](_0x2b2c16[_0xb373('0x41')],_0x2b2c16[_0xb373('0x42')]);_0x4c3b2d[_0xb373('0x44')]=_[_0xb373('0x43')](_0x2b2c16['model'],qs[_0xb373('0x45')](_0x3d6089[_0xb373('0x42')][_0xb373('0x45')]));_0x4c3b2d[_0xb373('0x44')]=_0x4c3b2d['attributes'][_0xb373('0x46')]?_0x4c3b2d[_0xb373('0x44')]:_0x2b2c16[_0xb373('0x41')];if(!_0x3d6089[_0xb373('0x42')][_0xb373('0x47')](_0xb373('0x48'))){_0x4c3b2d['limit']=qs['limit'](_0x3d6089[_0xb373('0x42')][_0xb373('0x32')]);_0x4c3b2d[_0xb373('0x34')]=qs['offset'](_0x3d6089[_0xb373('0x42')]['offset']);}_0x4c3b2d[_0xb373('0x49')]=qs['sort'](_0x3d6089[_0xb373('0x42')]['sort']);_0x4c3b2d['where']=qs[_0xb373('0x4a')](_[_0xb373('0x4b')](_0x3d6089[_0xb373('0x42')],_0x2b2c16[_0xb373('0x4a')]),_0x5026b1);if(_0x3d6089[_0xb373('0x42')][_0xb373('0x4c')]){_0x4c3b2d['where']=_[_0xb373('0x4d')](_0x4c3b2d[_0xb373('0x4e')],{'$or':_[_0xb373('0x3d')](_0x5026b1,function(_0x242d38){if(_0x242d38[_0xb373('0x4f')]!=='VIRTUAL'){var _0x423368={};_0x423368[_0x242d38[_0xb373('0x3b')]]={'$like':'%'+_0x3d6089[_0xb373('0x42')][_0xb373('0x4c')]+'%'};return _0x423368;}})});}_0x4c3b2d=_[_0xb373('0x4d')]({},_0x4c3b2d,_0x3d6089['options']);var _0x7b0b53={'where':_0x4c3b2d['where']};return db[_0xb373('0x3e')][_0xb373('0x33')](_0x7b0b53)[_0xb373('0x22')](function(_0x4f008d){_0x497a80['count']=_0x4f008d;if(_0x3d6089[_0xb373('0x42')][_0xb373('0x50')]){_0x4c3b2d[_0xb373('0x51')]=[{'all':!![]}];}return db[_0xb373('0x3e')]['findAll'](_0x4c3b2d);})[_0xb373('0x22')](function(_0x2e94f4){_0x497a80['rows']=_0x2e94f4;return _0x497a80;})[_0xb373('0x22')](respondWithFilteredResult(_0x2d9690,_0x4c3b2d))[_0xb373('0x2c')](handleError(_0x2d9690,null));};exports[_0xb373('0x52')]=function(_0x5a3759,_0x47bf68){var _0x1afcb9={'raw':!![],'where':{'id':_0x5a3759['params']['id']}},_0x4f53af={};_0x4f53af[_0xb373('0x41')]=_[_0xb373('0x53')](db['FaxMessage'][_0xb373('0x3f')]);_0x4f53af[_0xb373('0x42')]=_[_0xb373('0x53')](_0x5a3759[_0xb373('0x42')]);_0x4f53af['filters']=_[_0xb373('0x43')](_0x4f53af[_0xb373('0x41')],_0x4f53af['query']);_0x1afcb9[_0xb373('0x44')]=_[_0xb373('0x43')](_0x4f53af[_0xb373('0x41')],qs[_0xb373('0x45')](_0x5a3759['query']['fields']));_0x1afcb9['attributes']=_0x1afcb9[_0xb373('0x44')][_0xb373('0x46')]?_0x1afcb9[_0xb373('0x44')]:_0x4f53af['model'];if(_0x5a3759['query'][_0xb373('0x50')]){_0x1afcb9[_0xb373('0x51')]=[{'all':!![]}];}_0x1afcb9=_[_0xb373('0x4d')]({},_0x1afcb9,_0x5a3759[_0xb373('0x54')]);return db[_0xb373('0x3e')][_0xb373('0x55')](_0x1afcb9)[_0xb373('0x22')](handleEntityNotFound(_0x47bf68,null))[_0xb373('0x22')](respondWithResult(_0x47bf68,null))[_0xb373('0x2c')](handleError(_0x47bf68,null));};exports[_0xb373('0x38')]=function(_0x40f7de,_0x6a7ad){if(_0x40f7de[_0xb373('0x56')]['id']){delete _0x40f7de[_0xb373('0x56')]['id'];}return db[_0xb373('0x3e')]['find']({'where':{'id':_0x40f7de['params']['id']}})[_0xb373('0x22')](handleEntityNotFound(_0x6a7ad,null))['then'](saveUpdates(_0x40f7de[_0xb373('0x56')],null))[_0xb373('0x22')](respondWithResult(_0x6a7ad,null))[_0xb373('0x2c')](handleError(_0x6a7ad,null));};exports[_0xb373('0x39')]=function(_0x5315f0,_0x3abc04){return db[_0xb373('0x3e')]['find']({'where':{'id':_0x5315f0[_0xb373('0x57')]['id']}})[_0xb373('0x22')](handleEntityNotFound(_0x3abc04,null))[_0xb373('0x22')](removeEntity(_0x3abc04,null))['catch'](handleError(_0x3abc04,null));};exports[_0xb373('0x58')]=function(_0x48f39f,_0x1871f0){return db['FaxMessage']['describe']()[_0xb373('0x22')](respondWithResult(_0x1871f0,null))[_0xb373('0x2c')](handleError(_0x1871f0,null));};var interaction_log=require(_0xb373('0x15'))(_0xb373('0x59'));exports[_0xb373('0x5a')]=function(_0x266f19,_0x43a896,_0x52a7e7){var _0x3f8d08={'agent':{},'channel':_0xb373('0x5b')};if(_0x266f19[_0xb373('0x56')]['id']){delete _0x266f19[_0xb373('0x56')]['id'];}_0x266f19[_0xb373('0x56')][_0xb373('0x5c')]=!![];_0x266f19[_0xb373('0x56')]['readAt']=moment()['format'](_0xb373('0x5d'));_0x266f19[_0xb373('0x56')][_0xb373('0x5e')]=_0x266f19[_0xb373('0x56')][_0xb373('0x5e')]||_0x266f19[_0xb373('0x5f')]['id'];_0x3f8d08[_0xb373('0x60')]['id']=_0x266f19[_0xb373('0x56')][_0xb373('0x5e')];return db['FaxMessage'][_0xb373('0x55')]({'where':{'id':_0x266f19[_0xb373('0x57')]['id'],'UserId':null}})[_0xb373('0x22')](handleEntityNotFound(_0x43a896,null))['then'](saveUpdates(_0x266f19[_0xb373('0x56')],null))[_0xb373('0x22')](function(_0x5b7d29){if(_0x5b7d29){_0x3f8d08['message']=_0x5b7d29[_0xb373('0x61')]({'plain':!![]});return db['FaxInteraction'][_0xb373('0x55')]({'where':{'id':_0x5b7d29[_0xb373('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x43a896,null))[_0xb373('0x22')](function(_0x39801){if(_0x39801){return _0x39801[_0xb373('0x38')]({'UserId':_0x266f19[_0xb373('0x56')]['UserId'],'read1stAt':_[_0xb373('0x63')](_0x39801[_0xb373('0x64')])?moment()['format'](_0xb373('0x5d')):undefined});}return null;})[_0xb373('0x22')](function(_0x17f149){if(_0x17f149){_0x3f8d08[_0xb373('0x65')]=_0x17f149['get']({'plain':!![]});interaction_log['info'](_0xb373('0x66'),_0x266f19['user']['id'],_0x266f19[_0xb373('0x5f')][_0xb373('0x3b')],_0x266f19['user'][_0xb373('0x67')],_0x3f8d08[_0xb373('0x65')]['id'],_0x266f19[_0xb373('0x56')]?JSON[_0xb373('0x27')](_0x266f19[_0xb373('0x56')]):_0xb373('0x68'));return respondWithRpcPromise(_0xb373('0x69'),_0xb373('0x6a'),_0x3f8d08);}return null;})[_0xb373('0x22')](function(_0x51ea4b){var _0x4fa60f=_0xb373('0x6b')+_0x51ea4b['message'][_0xb373('0x6c')];return db[_0xb373('0x6d')][_0xb373('0x42')](_0x4fa60f,{'type':db['Sequelize'][_0xb373('0x6e')]['SELECT'],'raw':!![]})[_0xb373('0x22')](function(_0x209dc8){return _0x209dc8;});})[_0xb373('0x22')](function(_0x4552a3){if(_0x4552a3){_0x3f8d08[_0xb373('0x2a')][_0xb373('0x6f')]=_0x4552a3[0x0];if(!_0x266f19[_0xb373('0x56')][_0xb373('0x5e')])return;return db[_0xb373('0x70')][_0xb373('0x55')]({'where':{'id':_0x266f19[_0xb373('0x56')][_0xb373('0x5e')],'role':'agent'},'attributes':['id',_0xb373('0x3b'),_0xb373('0x71'),'email',_0xb373('0x72')],'raw':!![]});}return null;})[_0xb373('0x22')](function(_0x3936d9){if(!_0x3936d9)return null;_0x3f8d08[_0xb373('0x2a')][_0xb373('0x60')]=_0x3936d9;return _0x3f8d08;})[_0xb373('0x22')](function(_0xf47867){if(_0xf47867){if(_0x266f19[_0xb373('0x56')][_0xb373('0x73')]){_0x3f8d08[_0xb373('0x2a')][_0xb373('0x74')]=util[_0xb373('0x75')](_0xb373('0x76'),_0x266f19[_0xb373('0x5f')]['name']);_0x3f8d08[_0xb373('0x2a')][_0xb373('0x77')]=_0x3f8d08[_0xb373('0x77')];_0x3f8d08[_0xb373('0x2a')][_0xb373('0x78')]=_0x3f8d08[_0xb373('0x77')];_0x3f8d08[_0xb373('0x2a')][_0xb373('0x79')]=_0xb373('0x5a');return respondWithRpcPromise('EventManager',_0xb373('0x7a'),{'event':_0xb373('0x7b'),'message':_0x3f8d08[_0xb373('0x2a')]},client9002)['then'](function(){return _0x3f8d08;});}return _0x3f8d08;}return null;})[_0xb373('0x22')](respondWithResult(_0x43a896,null))[_0xb373('0x2c')](handleError(_0x43a896,null));};var interaction_log=require(_0xb373('0x15'))(_0xb373('0x59'));exports[_0xb373('0x7c')]=function(_0x511304,_0x50124a,_0x4d49ab){var _0x1ba8d0={'agent':{},'channel':'fax'};if(_0x511304[_0xb373('0x56')]['id']){delete _0x511304['body']['id'];}_0x511304[_0xb373('0x56')][_0xb373('0x5e')]=_0x511304[_0xb373('0x56')][_0xb373('0x5e')]||_0x511304[_0xb373('0x5f')]['id'];_0x1ba8d0[_0xb373('0x60')]['id']=_0x511304[_0xb373('0x56')][_0xb373('0x5e')];return db[_0xb373('0x3e')]['find']({'where':{'id':_0x511304[_0xb373('0x57')]['id'],'UserId':null}})[_0xb373('0x22')](handleEntityNotFound(_0x50124a,null))[_0xb373('0x22')](function(_0x346b82){if(_0x346b82){_0x1ba8d0[_0xb373('0x2a')]=_0x346b82[_0xb373('0x61')]({'plain':!![]});return db[_0xb373('0x7d')][_0xb373('0x55')]({'where':{'id':_0x346b82[_0xb373('0x62')]}});}return null;})[_0xb373('0x22')](handleEntityNotFound(_0x50124a,null))[_0xb373('0x22')](function(_0x216605){if(_0x216605){_0x1ba8d0[_0xb373('0x65')]=_0x216605[_0xb373('0x61')]({'plain':!![]});interaction_log[_0xb373('0x23')](_0xb373('0x7e'),_0x511304[_0xb373('0x5f')]['id'],_0x511304['user'][_0xb373('0x3b')],_0x511304[_0xb373('0x5f')]['role'],_0x1ba8d0[_0xb373('0x65')]['id'],_0x511304[_0xb373('0x56')]?JSON[_0xb373('0x27')](_0x511304[_0xb373('0x56')]):_0xb373('0x68'));return respondWithRpcPromise('RejectMessage',_0xb373('0x7f'),_0x1ba8d0);}return null;})['then'](function(_0x212d95){var _0x4e1830=_0xb373('0x6b')+_0x212d95[_0xb373('0x2a')][_0xb373('0x6c')];return db[_0xb373('0x6d')][_0xb373('0x42')](_0x4e1830,{'type':db[_0xb373('0x80')][_0xb373('0x6e')][_0xb373('0x81')],'raw':!![]})[_0xb373('0x22')](function(_0x428644){return _0x428644;});})['then'](function(_0x5201c6){if(_0x5201c6){_0x1ba8d0[_0xb373('0x2a')][_0xb373('0x6f')]=_0x5201c6[0x0];if(!_0x511304['body'][_0xb373('0x5e')])return;return db[_0xb373('0x70')][_0xb373('0x55')]({'where':{'id':_0x511304[_0xb373('0x56')][_0xb373('0x5e')],'role':_0xb373('0x60')},'attributes':['id',_0xb373('0x3b'),'fullname',_0xb373('0x82'),_0xb373('0x72')],'raw':!![]});}return null;})[_0xb373('0x22')](function(_0x543570){if(!_0x543570)return null;_0x1ba8d0[_0xb373('0x2a')]['agent']=_0x543570;return _0x1ba8d0;})[_0xb373('0x22')](function(_0x1e64e2){if(_0x1e64e2){_0x1e64e2[_0xb373('0x2a')][_0xb373('0x74')]=util[_0xb373('0x75')](_0xb373('0x76'),_0x511304[_0xb373('0x5f')][_0xb373('0x3b')]);_0x1e64e2[_0xb373('0x2a')][_0xb373('0x77')]=_0x1ba8d0[_0xb373('0x77')];_0x1e64e2[_0xb373('0x2a')][_0xb373('0x78')]=_0x1ba8d0[_0xb373('0x77')];_0x1e64e2[_0xb373('0x2a')]['event']=_0xb373('0x7c');respondWithRpcPromise('EventManager',_0xb373('0x7a'),{'event':_0xb373('0x83'),'message':_0x1e64e2[_0xb373('0x2a')]},client9002);return _0x1ba8d0;}return null;})[_0xb373('0x22')](respondWithResult(_0x50124a,null))[_0xb373('0x2c')](handleError(_0x50124a,null));};exports[_0xb373('0x84')]=function(_0x203c14,_0x3e75a1){var _0x163392;return db[_0xb373('0x3e')]['create'](_0x203c14[_0xb373('0x56')],{})['then'](function(_0x1c85c3){_0x163392=_0x1c85c3;return db[_0xb373('0x85')][_0xb373('0x86')]({'where':{'id':_0x163392[_0xb373('0x6c')]}});})[_0xb373('0x22')](function(_0x127767){if(_[_0xb373('0x63')](_0x127767)){return;}else{_0x163392['fax']=_0x127767[_0xb373('0x5b')];return db[_0xb373('0x87')][_0xb373('0x86')]({'where':{'id':_0x163392[_0xb373('0x88')]}});}})[_0xb373('0x22')](function(_0x2a15d0){return respondWithRpcPromise(_0xb373('0x89'),_0xb373('0x89'),{'FaxAccountId':_['isNil'](_0x203c14['body'])?undefined:_0x203c14[_0xb373('0x56')][_0xb373('0x8a')],'path':_[_0xb373('0x63')](_0x2a15d0)?undefined:util[_0xb373('0x75')](_0xb373('0x8b'),_0x2a15d0[_0xb373('0x8c')]),'fax':_[_0xb373('0x63')](_0x163392['fax'])?undefined:_0x163392[_0xb373('0x5b')],'AttachmentId':_0x163392[_0xb373('0x88')]},client9002);})['then'](respondWithResult(_0x3e75a1,0xc9))[_0xb373('0x2c')](handleError(_0x3e75a1,null));};exports[_0xb373('0x8d')]=function(_0x6242d5,_0x50fec8){var _0x1102bc=path[_0xb373('0x8e')](config[_0xb373('0x8f')],_0xb373('0x90'),_0xb373('0x91'),_0xb373('0x92'));return db[_0xb373('0x3e')][_0xb373('0x55')]({'where':{'id':_0x6242d5[_0xb373('0x57')]['id']},'include':[{'model':db[_0xb373('0x87')],'as':'Attachment'}]})['then'](handleEntityNotFound(_0x50fec8,null))[_0xb373('0x22')](function(_0x24b072){if(_0x24b072){return _0x50fec8[_0xb373('0x8d')](path[_0xb373('0x8e')](_0x1102bc,_0x24b072[_0xb373('0x87')]['basename']));}})['catch'](handleError(_0x50fec8,null));}; \ No newline at end of file +var _0x20af=['rawAttributes','length','includeAll','find','body','params','describe','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','event','rejectmessage','findOne','Attachment','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','AttachmentId','download','join','root','server','files','attachments','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','redis','localhost','./faxMessage.socket','register','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','send','index','map','FaxMessage','fieldName','key','model','name','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','include','findAll','rows'];(function(_0x147c0d,_0x41c033){var _0x5dd0f7=function(_0x1b8a6c){while(--_0x1b8a6c){_0x147c0d['push'](_0x147c0d['shift']());}};_0x5dd0f7(++_0x41c033);}(_0x20af,0x164));var _0xf20a=function(_0x5189f9,_0x21f269){_0x5189f9=_0x5189f9-0x0;var _0xfc19d2=_0x20af[_0x5189f9];return _0xfc19d2;};'use strict';var emlformat=require(_0xf20a('0x0'));var rimraf=require(_0xf20a('0x1'));var zipdir=require(_0xf20a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf20a('0x3'));var BPromise=require(_0xf20a('0x4'));var Mustache=require(_0xf20a('0x5'));var util=require(_0xf20a('0x6'));var path=require(_0xf20a('0x7'));var sox=require(_0xf20a('0x8'));var csv=require(_0xf20a('0x9'));var ejs=require(_0xf20a('0xa'));var fs=require('fs');var fs_extra=require(_0xf20a('0xb'));var _=require(_0xf20a('0xc'));var squel=require('squel');var crypto=require(_0xf20a('0xd'));var jsforce=require(_0xf20a('0xe'));var deskjs=require(_0xf20a('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf20a('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf20a('0x11'));var qs=require(_0xf20a('0x12'));var as=require(_0xf20a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf20a('0x14'))(_0xf20a('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf20a('0x16'));var db=require(_0xf20a('0x17'))['db'];config[_0xf20a('0x18')]=_['defaults'](config[_0xf20a('0x18')],{'host':_0xf20a('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf20a('0x18')]));require(_0xf20a('0x1a'))[_0xf20a('0x1b')](socket);var jayson=require(_0xf20a('0x1c'));var client=jayson[_0xf20a('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0xf20a('0x1d')][_0xf20a('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x26f017,_0x32ae2a,_0x40771f,_0x533007){return new BPromise(function(_0xfc57c9,_0x5d93bf){var _0x3eed98=_0x533007||client;return _0x3eed98[_0xf20a('0x1f')](_0x26f017,_0x40771f)[_0xf20a('0x20')](function(_0x10fb5b){logger[_0xf20a('0x21')](_0xf20a('0x22'),_0x32ae2a,_0xf20a('0x23'));logger['debug'](_0xf20a('0x24'),_0x32ae2a,'request\x20sent',JSON[_0xf20a('0x25')](_0x10fb5b));if(_0x10fb5b[_0xf20a('0x26')]){if(_0x10fb5b[_0xf20a('0x26')][_0xf20a('0x27')]===0x1f4){logger[_0xf20a('0x26')](_0xf20a('0x22'),_0x32ae2a,_0x10fb5b['error'][_0xf20a('0x28')]);return _0x5d93bf(_0x10fb5b[_0xf20a('0x26')][_0xf20a('0x28')]);}logger[_0xf20a('0x26')](_0xf20a('0x22'),_0x32ae2a,_0x10fb5b[_0xf20a('0x26')][_0xf20a('0x28')]);return _0xfc57c9(_0x10fb5b['error'][_0xf20a('0x28')]);}else{logger[_0xf20a('0x21')](_0xf20a('0x22'),_0x32ae2a,'request\x20sent');_0xfc57c9(_0x10fb5b[_0xf20a('0x29')]['message']);}})[_0xf20a('0x2a')](function(_0x13150b){logger[_0xf20a('0x26')](_0xf20a('0x22'),_0x32ae2a,_0x13150b);_0x5d93bf(_0x13150b);});});}function respondWithStatusCode(_0x32174b,_0x5f2c95){_0x5f2c95=_0x5f2c95||0xcc;return function(_0x387641){if(_0x387641){return _0x32174b[_0xf20a('0x2b')](_0x5f2c95);}return _0x32174b[_0xf20a('0x2c')](_0x5f2c95)[_0xf20a('0x2d')]();};}function respondWithResult(_0x136261,_0x273580){_0x273580=_0x273580||0xc8;return function(_0x48092d){if(_0x48092d){return _0x136261[_0xf20a('0x2c')](_0x273580)[_0xf20a('0x2e')](_0x48092d);}};}function respondWithFilteredResult(_0x20ddf1,_0x2d75fa){return function(_0x22f5c0){if(_0x22f5c0){var _0x2a48bc=typeof _0x2d75fa[_0xf20a('0x2f')]==='undefined'&&typeof _0x2d75fa[_0xf20a('0x30')]==='undefined';var _0x1bad97=_0x22f5c0['count'];var _0x48e0ff=_0x2a48bc?0x0:_0x2d75fa[_0xf20a('0x2f')];var _0x1ec46a=_0x2a48bc?_0x22f5c0[_0xf20a('0x31')]:_0x2d75fa['offset']+_0x2d75fa['limit'];var _0x143c89;if(_0x1ec46a>=_0x1bad97){_0x1ec46a=_0x1bad97;_0x143c89=0xc8;}else{_0x143c89=0xce;}_0x20ddf1[_0xf20a('0x2c')](_0x143c89);return _0x20ddf1[_0xf20a('0x32')](_0xf20a('0x33'),_0x48e0ff+'-'+_0x1ec46a+'/'+_0x1bad97)[_0xf20a('0x2e')](_0x22f5c0);}return null;};}function patchUpdates(_0x451d67){return function(_0x504d89){try{jsonpatch[_0xf20a('0x34')](_0x504d89,_0x451d67,!![]);}catch(_0x19af8c){return BPromise[_0xf20a('0x35')](_0x19af8c);}return _0x504d89[_0xf20a('0x36')]();};}function saveUpdates(_0x185d69,_0x3a2fc3){return function(_0x54e4fb){if(_0x54e4fb){return _0x54e4fb[_0xf20a('0x37')](_0x185d69)[_0xf20a('0x20')](function(_0x28bf86){return _0x28bf86;});}return null;};}function removeEntity(_0x12e237,_0x3bc80f){return function(_0x1e5708){if(_0x1e5708){return _0x1e5708[_0xf20a('0x38')]()['then'](function(){_0x12e237[_0xf20a('0x2c')](0xcc)[_0xf20a('0x2d')]();});}};}function handleEntityNotFound(_0x2b1a3a,_0x13046f){return function(_0x4776e4){if(!_0x4776e4){_0x2b1a3a['sendStatus'](0x194);}return _0x4776e4;};}function handleError(_0x455166,_0x5d609b){_0x5d609b=_0x5d609b||0x1f4;return function(_0x3eeb77){logger['error'](_0x3eeb77[_0xf20a('0x39')]);if(_0x3eeb77['name']){delete _0x3eeb77['name'];}_0x455166['status'](_0x5d609b)[_0xf20a('0x3a')](_0x3eeb77);};}exports[_0xf20a('0x3b')]=function(_0x5139b5,_0x32f5c1){var _0x4e0b04={},_0x276a9a={},_0x366207={'count':0x0,'rows':[]};var _0x5a19f1=_[_0xf20a('0x3c')](db[_0xf20a('0x3d')]['rawAttributes'],function(_0x57abf2){return{'name':_0x57abf2[_0xf20a('0x3e')],'type':_0x57abf2['type'][_0xf20a('0x3f')]};});_0x276a9a[_0xf20a('0x40')]=_[_0xf20a('0x3c')](_0x5a19f1,_0xf20a('0x41'));_0x276a9a[_0xf20a('0x42')]=_[_0xf20a('0x43')](_0x5139b5[_0xf20a('0x42')]);_0x276a9a[_0xf20a('0x44')]=_[_0xf20a('0x45')](_0x276a9a[_0xf20a('0x40')],_0x276a9a[_0xf20a('0x42')]);_0x4e0b04['attributes']=_[_0xf20a('0x45')](_0x276a9a[_0xf20a('0x40')],qs[_0xf20a('0x46')](_0x5139b5[_0xf20a('0x42')][_0xf20a('0x46')]));_0x4e0b04[_0xf20a('0x47')]=_0x4e0b04['attributes']['length']?_0x4e0b04[_0xf20a('0x47')]:_0x276a9a[_0xf20a('0x40')];if(!_0x5139b5[_0xf20a('0x42')][_0xf20a('0x48')](_0xf20a('0x49'))){_0x4e0b04[_0xf20a('0x30')]=qs[_0xf20a('0x30')](_0x5139b5['query'][_0xf20a('0x30')]);_0x4e0b04[_0xf20a('0x2f')]=qs[_0xf20a('0x2f')](_0x5139b5[_0xf20a('0x42')]['offset']);}_0x4e0b04[_0xf20a('0x4a')]=qs['sort'](_0x5139b5['query'][_0xf20a('0x4b')]);_0x4e0b04[_0xf20a('0x4c')]=qs[_0xf20a('0x44')](_[_0xf20a('0x4d')](_0x5139b5[_0xf20a('0x42')],_0x276a9a[_0xf20a('0x44')]),_0x5a19f1);if(_0x5139b5[_0xf20a('0x42')][_0xf20a('0x4e')]){_0x4e0b04[_0xf20a('0x4c')]=_[_0xf20a('0x4f')](_0x4e0b04[_0xf20a('0x4c')],{'$or':_['map'](_0x5a19f1,function(_0x441732){if(_0x441732[_0xf20a('0x50')]!=='VIRTUAL'){var _0x42d06a={};_0x42d06a[_0x441732['name']]={'$like':'%'+_0x5139b5['query'][_0xf20a('0x4e')]+'%'};return _0x42d06a;}})});}_0x4e0b04=_['merge']({},_0x4e0b04,_0x5139b5[_0xf20a('0x51')]);var _0x509522={'where':_0x4e0b04[_0xf20a('0x4c')]};return db[_0xf20a('0x3d')][_0xf20a('0x31')](_0x509522)[_0xf20a('0x20')](function(_0x2deeb4){_0x366207['count']=_0x2deeb4;if(_0x5139b5[_0xf20a('0x42')]['includeAll']){_0x4e0b04[_0xf20a('0x52')]=[{'all':!![]}];}return db[_0xf20a('0x3d')][_0xf20a('0x53')](_0x4e0b04);})[_0xf20a('0x20')](function(_0x496428){_0x366207[_0xf20a('0x54')]=_0x496428;return _0x366207;})['then'](respondWithFilteredResult(_0x32f5c1,_0x4e0b04))[_0xf20a('0x2a')](handleError(_0x32f5c1,null));};exports['show']=function(_0x11f307,_0x2b2a2f){var _0x20b599={'raw':!![],'where':{'id':_0x11f307['params']['id']}},_0x54dfd8={};_0x54dfd8[_0xf20a('0x40')]=_[_0xf20a('0x43')](db['FaxMessage'][_0xf20a('0x55')]);_0x54dfd8[_0xf20a('0x42')]=_[_0xf20a('0x43')](_0x11f307[_0xf20a('0x42')]);_0x54dfd8[_0xf20a('0x44')]=_[_0xf20a('0x45')](_0x54dfd8[_0xf20a('0x40')],_0x54dfd8[_0xf20a('0x42')]);_0x20b599[_0xf20a('0x47')]=_[_0xf20a('0x45')](_0x54dfd8[_0xf20a('0x40')],qs['fields'](_0x11f307[_0xf20a('0x42')]['fields']));_0x20b599['attributes']=_0x20b599[_0xf20a('0x47')][_0xf20a('0x56')]?_0x20b599[_0xf20a('0x47')]:_0x54dfd8['model'];if(_0x11f307[_0xf20a('0x42')][_0xf20a('0x57')]){_0x20b599[_0xf20a('0x52')]=[{'all':!![]}];}_0x20b599=_['merge']({},_0x20b599,_0x11f307[_0xf20a('0x51')]);return db['FaxMessage'][_0xf20a('0x58')](_0x20b599)['then'](handleEntityNotFound(_0x2b2a2f,null))[_0xf20a('0x20')](respondWithResult(_0x2b2a2f,null))['catch'](handleError(_0x2b2a2f,null));};exports[_0xf20a('0x37')]=function(_0x88f0ab,_0x27b055){if(_0x88f0ab['body']['id']){delete _0x88f0ab[_0xf20a('0x59')]['id'];}return db['FaxMessage']['find']({'where':{'id':_0x88f0ab[_0xf20a('0x5a')]['id']}})[_0xf20a('0x20')](handleEntityNotFound(_0x27b055,null))[_0xf20a('0x20')](saveUpdates(_0x88f0ab[_0xf20a('0x59')],null))['then'](respondWithResult(_0x27b055,null))[_0xf20a('0x2a')](handleError(_0x27b055,null));};exports[_0xf20a('0x38')]=function(_0x306bf6,_0x4d9ed1){return db['FaxMessage']['find']({'where':{'id':_0x306bf6[_0xf20a('0x5a')]['id']}})[_0xf20a('0x20')](handleEntityNotFound(_0x4d9ed1,null))[_0xf20a('0x20')](removeEntity(_0x4d9ed1,null))[_0xf20a('0x2a')](handleError(_0x4d9ed1,null));};exports[_0xf20a('0x5b')]=function(_0x323764,_0x348967){return db[_0xf20a('0x3d')][_0xf20a('0x5b')]()['then'](respondWithResult(_0x348967,null))[_0xf20a('0x2a')](handleError(_0x348967,null));};var interaction_log=require(_0xf20a('0x14'))(_0xf20a('0x5c'));exports[_0xf20a('0x5d')]=function(_0x47586a,_0x38636d,_0x1c4536){var _0x4ad0c8={'agent':{},'channel':_0xf20a('0x5e')};if(_0x47586a[_0xf20a('0x59')]['id']){delete _0x47586a['body']['id'];}_0x47586a[_0xf20a('0x59')][_0xf20a('0x5f')]=!![];_0x47586a[_0xf20a('0x59')][_0xf20a('0x60')]=moment()[_0xf20a('0x61')](_0xf20a('0x62'));_0x47586a[_0xf20a('0x59')][_0xf20a('0x63')]=_0x47586a[_0xf20a('0x59')][_0xf20a('0x63')]||_0x47586a[_0xf20a('0x64')]['id'];_0x4ad0c8['agent']['id']=_0x47586a['body'][_0xf20a('0x63')];return db[_0xf20a('0x3d')][_0xf20a('0x58')]({'where':{'id':_0x47586a[_0xf20a('0x5a')]['id'],'UserId':null}})[_0xf20a('0x20')](handleEntityNotFound(_0x38636d,null))[_0xf20a('0x20')](saveUpdates(_0x47586a['body'],null))[_0xf20a('0x20')](function(_0x49ae55){if(_0x49ae55){_0x4ad0c8[_0xf20a('0x28')]=_0x49ae55[_0xf20a('0x65')]({'plain':!![]});return db[_0xf20a('0x66')][_0xf20a('0x58')]({'where':{'id':_0x49ae55[_0xf20a('0x67')]}});}return null;})[_0xf20a('0x20')](handleEntityNotFound(_0x38636d,null))[_0xf20a('0x20')](function(_0x84fa7b){if(_0x84fa7b){return _0x84fa7b['update']({'UserId':_0x47586a[_0xf20a('0x59')][_0xf20a('0x63')],'read1stAt':_[_0xf20a('0x68')](_0x84fa7b[_0xf20a('0x69')])?moment()['format'](_0xf20a('0x62')):undefined});}return null;})['then'](function(_0x409ce2){if(_0x409ce2){_0x4ad0c8['interaction']=_0x409ce2[_0xf20a('0x65')]({'plain':!![]});interaction_log['info'](_0xf20a('0x6a'),_0x47586a['user']['id'],_0x47586a[_0xf20a('0x64')][_0xf20a('0x41')],_0x47586a[_0xf20a('0x64')][_0xf20a('0x6b')],_0x4ad0c8[_0xf20a('0x6c')]['id'],_0x47586a['body']?JSON[_0xf20a('0x25')](_0x47586a[_0xf20a('0x59')]):'null');return respondWithRpcPromise(_0xf20a('0x6d'),_0xf20a('0x6e'),_0x4ad0c8);}return null;})[_0xf20a('0x20')](function(_0x42c9cb){var _0x49da9c=_0xf20a('0x6f')+_0x42c9cb['message']['ContactId'];return db[_0xf20a('0x70')][_0xf20a('0x42')](_0x49da9c,{'type':db[_0xf20a('0x71')][_0xf20a('0x72')][_0xf20a('0x73')],'raw':!![]})['then'](function(_0x5acf20){return _0x5acf20;});})[_0xf20a('0x20')](function(_0x4e016b){if(_0x4e016b){_0x4ad0c8[_0xf20a('0x28')]['contact']=_0x4e016b[0x0];if(!_0x47586a[_0xf20a('0x59')][_0xf20a('0x63')])return;return db[_0xf20a('0x74')][_0xf20a('0x58')]({'where':{'id':_0x47586a[_0xf20a('0x59')][_0xf20a('0x63')],'role':_0xf20a('0x75')},'attributes':['id',_0xf20a('0x41'),_0xf20a('0x76'),_0xf20a('0x77'),_0xf20a('0x78')],'raw':!![]});}return null;})[_0xf20a('0x20')](function(_0x4c91fe){if(!_0x4c91fe)return null;_0x4ad0c8['message'][_0xf20a('0x75')]=_0x4c91fe;return _0x4ad0c8;})[_0xf20a('0x20')](function(_0x2bd0c2){if(_0x2bd0c2){if(_0x47586a['body'][_0xf20a('0x79')]){_0x4ad0c8[_0xf20a('0x28')][_0xf20a('0x7a')]=util[_0xf20a('0x61')](_0xf20a('0x7b'),_0x47586a[_0xf20a('0x64')][_0xf20a('0x41')]);_0x4ad0c8['message'][_0xf20a('0x7c')]=_0x4ad0c8[_0xf20a('0x7c')];_0x4ad0c8['message'][_0xf20a('0x7d')]=_0x4ad0c8[_0xf20a('0x7c')];_0x4ad0c8[_0xf20a('0x28')]['event']='accept';return respondWithRpcPromise(_0xf20a('0x7e'),_0xf20a('0x7e'),{'event':_0xf20a('0x7f'),'message':_0x4ad0c8[_0xf20a('0x28')]},client9002)[_0xf20a('0x20')](function(){return _0x4ad0c8;});}return _0x4ad0c8;}return null;})[_0xf20a('0x20')](respondWithResult(_0x38636d,null))['catch'](handleError(_0x38636d,null));};var interaction_log=require(_0xf20a('0x14'))(_0xf20a('0x5c'));exports[_0xf20a('0x35')]=function(_0x431e4a,_0x29c06c,_0xce482e){var _0x4edee3={'agent':{},'channel':'fax'};if(_0x431e4a[_0xf20a('0x59')]['id']){delete _0x431e4a[_0xf20a('0x59')]['id'];}_0x431e4a[_0xf20a('0x59')][_0xf20a('0x63')]=_0x431e4a[_0xf20a('0x59')][_0xf20a('0x63')]||_0x431e4a[_0xf20a('0x64')]['id'];_0x4edee3[_0xf20a('0x75')]['id']=_0x431e4a[_0xf20a('0x59')][_0xf20a('0x63')];return db[_0xf20a('0x3d')][_0xf20a('0x58')]({'where':{'id':_0x431e4a[_0xf20a('0x5a')]['id'],'UserId':null}})[_0xf20a('0x20')](handleEntityNotFound(_0x29c06c,null))['then'](function(_0x21835a){if(_0x21835a){_0x4edee3[_0xf20a('0x28')]=_0x21835a['get']({'plain':!![]});return db[_0xf20a('0x66')][_0xf20a('0x58')]({'where':{'id':_0x21835a[_0xf20a('0x67')]}});}return null;})[_0xf20a('0x20')](handleEntityNotFound(_0x29c06c,null))[_0xf20a('0x20')](function(_0x4a8e90){if(_0x4a8e90){_0x4edee3[_0xf20a('0x6c')]=_0x4a8e90[_0xf20a('0x65')]({'plain':!![]});interaction_log['info'](_0xf20a('0x80'),_0x431e4a[_0xf20a('0x64')]['id'],_0x431e4a[_0xf20a('0x64')][_0xf20a('0x41')],_0x431e4a['user']['role'],_0x4edee3['interaction']['id'],_0x431e4a[_0xf20a('0x59')]?JSON[_0xf20a('0x25')](_0x431e4a[_0xf20a('0x59')]):'null');return respondWithRpcPromise(_0xf20a('0x81'),_0xf20a('0x82'),_0x4edee3);}return null;})[_0xf20a('0x20')](function(_0xbfbb3b){var _0x3b4cee='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xbfbb3b[_0xf20a('0x28')][_0xf20a('0x83')];return db['sequelize']['query'](_0x3b4cee,{'type':db[_0xf20a('0x71')][_0xf20a('0x72')][_0xf20a('0x73')],'raw':!![]})[_0xf20a('0x20')](function(_0x28d5cb){return _0x28d5cb;});})[_0xf20a('0x20')](function(_0x2a707a){if(_0x2a707a){_0x4edee3[_0xf20a('0x28')]['contact']=_0x2a707a[0x0];if(!_0x431e4a[_0xf20a('0x59')][_0xf20a('0x63')])return;return db[_0xf20a('0x74')]['find']({'where':{'id':_0x431e4a[_0xf20a('0x59')][_0xf20a('0x63')],'role':_0xf20a('0x75')},'attributes':['id',_0xf20a('0x41'),_0xf20a('0x76'),'email',_0xf20a('0x78')],'raw':!![]});}return null;})['then'](function(_0x4a250d){if(!_0x4a250d)return null;_0x4edee3[_0xf20a('0x28')][_0xf20a('0x75')]=_0x4a250d;return _0x4edee3;})[_0xf20a('0x20')](function(_0x2c958c){if(_0x2c958c){_0x2c958c['message'][_0xf20a('0x7a')]=util[_0xf20a('0x61')](_0xf20a('0x7b'),_0x431e4a['user'][_0xf20a('0x41')]);_0x2c958c[_0xf20a('0x28')][_0xf20a('0x7c')]=_0x4edee3[_0xf20a('0x7c')];_0x2c958c[_0xf20a('0x28')][_0xf20a('0x7d')]=_0x4edee3[_0xf20a('0x7c')];_0x2c958c[_0xf20a('0x28')][_0xf20a('0x84')]=_0xf20a('0x35');respondWithRpcPromise('EventManager',_0xf20a('0x7e'),{'event':_0xf20a('0x85'),'message':_0x2c958c[_0xf20a('0x28')]},client9002);return _0x4edee3;}return null;})[_0xf20a('0x20')](respondWithResult(_0x29c06c,null))[_0xf20a('0x2a')](handleError(_0x29c06c,null));};exports['create']=function(_0x3c815f,_0x6cf901){var _0x4e95e5;return db['FaxMessage']['create'](_0x3c815f[_0xf20a('0x59')],{})[_0xf20a('0x20')](function(_0x33c87d){_0x4e95e5=_0x33c87d;return db['CmContact'][_0xf20a('0x86')]({'where':{'id':_0x4e95e5[_0xf20a('0x83')]}});})[_0xf20a('0x20')](function(_0x15e503){if(_['isNil'](_0x15e503)){return;}else{_0x4e95e5[_0xf20a('0x5e')]=_0x15e503[_0xf20a('0x5e')];return db[_0xf20a('0x87')][_0xf20a('0x86')]({'where':{'id':_0x4e95e5['AttachmentId']}});}})[_0xf20a('0x20')](function(_0x569ea4){return respondWithRpcPromise(_0xf20a('0x88'),_0xf20a('0x88'),{'FaxAccountId':_[_0xf20a('0x68')](_0x3c815f['body'])?undefined:_0x3c815f[_0xf20a('0x59')][_0xf20a('0x89')],'path':_['isNil'](_0x569ea4)?undefined:util[_0xf20a('0x61')](_0xf20a('0x8a'),_0x569ea4[_0xf20a('0x8b')]),'fax':_[_0xf20a('0x68')](_0x4e95e5[_0xf20a('0x5e')])?undefined:_0x4e95e5[_0xf20a('0x5e')],'AttachmentId':_0x4e95e5[_0xf20a('0x8c')]},client9002);})[_0xf20a('0x20')](respondWithResult(_0x6cf901,0xc9))[_0xf20a('0x2a')](handleError(_0x6cf901,null));};exports[_0xf20a('0x8d')]=function(_0x3f7dd7,_0x881180){var _0x3d778d=path[_0xf20a('0x8e')](config[_0xf20a('0x8f')],_0xf20a('0x90'),_0xf20a('0x91'),_0xf20a('0x92'));return db[_0xf20a('0x3d')][_0xf20a('0x58')]({'where':{'id':_0x3f7dd7[_0xf20a('0x5a')]['id']},'include':[{'model':db[_0xf20a('0x87')],'as':'Attachment'}]})['then'](handleEntityNotFound(_0x881180,null))['then'](function(_0x87fd60){if(_0x87fd60){return _0x881180[_0xf20a('0x8d')](path[_0xf20a('0x8e')](_0x3d778d,_0x87fd60['Attachment'][_0xf20a('0x8b')]));}})[_0xf20a('0x2a')](handleError(_0x881180,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 405b5e8..bb3766d 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 _0xd991=['FaxMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x28f361,_0x12707a){var _0x4c54e2=function(_0x3cc9a8){while(--_0x3cc9a8){_0x28f361['push'](_0x28f361['shift']());}};_0x4c54e2(++_0x12707a);}(_0xd991,0x115));var _0x1d99=function(_0x343ff2,_0x521684){_0x343ff2=_0x343ff2-0x0;var _0x49df11=_0xd991[_0x343ff2];return _0x49df11;};'use strict';var EventEmitter=require(_0x1d99('0x0'));var FaxMessage=require(_0x1d99('0x1'))['db'][_0x1d99('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x1d99('0x3')](0x0);var events={'afterCreate':_0x1d99('0x4'),'afterUpdate':'update','afterDestroy':_0x1d99('0x5')};function emitEvent(_0xe9aefb){return function(_0xf03459,_0x1f6da3,_0x300c32){FaxMessageEvents[_0x1d99('0x6')](_0xe9aefb+':'+_0xf03459['id'],_0xf03459);FaxMessageEvents['emit'](_0xe9aefb,_0xf03459);_0x300c32(null);};}for(var e in events){if(events[_0x1d99('0x7')](e)){var event=events[e];FaxMessage[_0x1d99('0x8')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file +var _0xc43c=['hook','exports','events','../../mysqldb','FaxMessage','remove','emit'];(function(_0x55a76a,_0x2d0203){var _0x45885a=function(_0x4348d5){while(--_0x4348d5){_0x55a76a['push'](_0x55a76a['shift']());}};_0x45885a(++_0x2d0203);}(_0xc43c,0xd4));var _0xcc43=function(_0x155f88,_0x6ea6d7){_0x155f88=_0x155f88-0x0;var _0xdb8f9e=_0xc43c[_0x155f88];return _0xdb8f9e;};'use strict';var EventEmitter=require(_0xcc43('0x0'));var FaxMessage=require(_0xcc43('0x1'))['db'][_0xcc43('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xcc43('0x3')};function emitEvent(_0x482ebc){return function(_0x484b53,_0x4c59cc,_0x37e84f){FaxMessageEvents[_0xcc43('0x4')](_0x482ebc+':'+_0x484b53['id'],_0x484b53);FaxMessageEvents[_0xcc43('0x4')](_0x482ebc,_0x484b53);_0x37e84f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0xcc43('0x5')](e,emitEvent(event));}}module[_0xcc43('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 5f8a8ce..c9f03ae 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 _0xedd8=['FaxInteraction','FaxInteractionId','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./faxMessage.attributes','exports','fax_messages','fti_fax_messages','body','get','toLowerCase','direction','out','secret'];(function(_0x5f46e7,_0x62f9f8){var _0x567e95=function(_0x5cb693){while(--_0x5cb693){_0x5f46e7['push'](_0x5f46e7['shift']());}};_0x567e95(++_0x62f9f8);}(_0xedd8,0x8a));var _0x8edd=function(_0x48a96f,_0x530059){_0x48a96f=_0x48a96f-0x0;var _0x3ff3ef=_0xedd8[_0x48a96f];return _0x3ff3ef;};'use strict';var _=require(_0x8edd('0x0'));var util=require(_0x8edd('0x1'));var logger=require(_0x8edd('0x2'))('api');var moment=require(_0x8edd('0x3'));var BPromise=require(_0x8edd('0x4'));var rp=require(_0x8edd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8edd('0x6'));var config=require(_0x8edd('0x7'));var attributes=require(_0x8edd('0x8'));module[_0x8edd('0x9')]=function(_0x41ab35,_0x3e5bef){return _0x41ab35['define']('FaxMessage',attributes,{'tableName':_0x8edd('0xa'),'paranoid':![],'indexes':[{'name':_0x8edd('0xb'),'fields':[_0x8edd('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5c1b18,_0x569895,_0x15175d){var _0x4899a7=_0x41ab35['models'];var _0x47511f=_0x5c1b18[_0x8edd('0xd')]({'plain':!![]});if(_0x47511f['direction'][_0x8edd('0xe')]()==='in'||_0x47511f[_0x8edd('0xf')][_0x8edd('0xe')]()===_0x8edd('0x10')&&!_0x47511f[_0x8edd('0x11')]&&!_['isNil'](_0x47511f['UserId'])){_0x4899a7[_0x8edd('0x12')]['findOne']({'where':{'id':_0x47511f[_0x8edd('0x13')]}})[_0x8edd('0x14')](function(_0x41be02){if(_0x41be02){_0x41be02[_0x8edd('0x15')]({'lastMsgAt':_0x47511f['createdAt'],'lastMsgDirection':_0x47511f[_0x8edd('0xf')][_0x8edd('0xe')]()});}})[_0x8edd('0x16')](function(_0x49507e){console[_0x8edd('0x17')](_0x49507e);});}_0x15175d();}},'charset':_0x8edd('0x18'),'collate':_0x8edd('0x19')});}; \ No newline at end of file +var _0x7d8e=['get','direction','toLowerCase','out','isNil','FaxInteraction','FaxInteractionId','then','createdAt','error','utf8mb4','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models'];(function(_0x2b8eb3,_0x10c689){var _0x5c99e2=function(_0x5ed412){while(--_0x5ed412){_0x2b8eb3['push'](_0x2b8eb3['shift']());}};_0x5c99e2(++_0x10c689);}(_0x7d8e,0x177));var _0xe7d8=function(_0x59befa,_0x4af99b){_0x59befa=_0x59befa-0x0;var _0x1dd63d=_0x7d8e[_0x59befa];return _0x1dd63d;};'use strict';var _=require('lodash');var util=require(_0xe7d8('0x0'));var logger=require(_0xe7d8('0x1'))(_0xe7d8('0x2'));var moment=require(_0xe7d8('0x3'));var BPromise=require('bluebird');var rp=require(_0xe7d8('0x4'));var fs=require('fs');var path=require(_0xe7d8('0x5'));var rimraf=require(_0xe7d8('0x6'));var config=require(_0xe7d8('0x7'));var attributes=require(_0xe7d8('0x8'));module[_0xe7d8('0x9')]=function(_0x161572,_0x4696b4){return _0x161572[_0xe7d8('0xa')](_0xe7d8('0xb'),attributes,{'tableName':_0xe7d8('0xc'),'paranoid':![],'indexes':[{'name':_0xe7d8('0xd'),'fields':[_0xe7d8('0xe')],'type':_0xe7d8('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5002e4,_0x5e00b1,_0x1c2846){var _0x2bbb2c=_0x161572[_0xe7d8('0x10')];var _0x183173=_0x5002e4[_0xe7d8('0x11')]({'plain':!![]});if(_0x183173[_0xe7d8('0x12')][_0xe7d8('0x13')]()==='in'||_0x183173[_0xe7d8('0x12')][_0xe7d8('0x13')]()===_0xe7d8('0x14')&&!_0x183173['secret']&&!_[_0xe7d8('0x15')](_0x183173['UserId'])){_0x2bbb2c[_0xe7d8('0x16')]['findOne']({'where':{'id':_0x183173[_0xe7d8('0x17')]}})[_0xe7d8('0x18')](function(_0x39249c){if(_0x39249c){_0x39249c['update']({'lastMsgAt':_0x183173[_0xe7d8('0x19')],'lastMsgDirection':_0x183173[_0xe7d8('0x12')][_0xe7d8('0x13')]()});}})['catch'](function(_0x57bcde){console[_0xe7d8('0x1a')](_0x57bcde);});}_0x1c2846();}},'charset':_0xe7d8('0x1b'),'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 efd1551..df1d6fd 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 _0x2d17=['create','catch','UpdateFaxMessage','FaxMessage','body','options','where','attributes','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CreateFaxMessage'];(function(_0x228d41,_0x2f3f79){var _0x3ec383=function(_0x573254){while(--_0x573254){_0x228d41['push'](_0x228d41['shift']());}};_0x3ec383(++_0x2f3f79);}(_0x2d17,0x17e));var _0x72d1=function(_0xa4a99e,_0x51df5a){_0xa4a99e=_0xa4a99e-0x0;var _0x489613=_0x2d17[_0xa4a99e];return _0x489613;};'use strict';var _=require(_0x72d1('0x0'));var util=require(_0x72d1('0x1'));var moment=require('moment');var BPromise=require(_0x72d1('0x2'));var rs=require(_0x72d1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72d1('0x4'))['db'];var utils=require(_0x72d1('0x5'));var logger=require('../../config/logger')(_0x72d1('0x6'));var config=require('../../config/environment');var jayson=require(_0x72d1('0x7'));var client=jayson['client'][_0x72d1('0x8')]({'port':0x232a});config[_0x72d1('0x9')]=_['defaults'](config[_0x72d1('0x9')],{'host':_0x72d1('0xa'),'port':0x18eb});var socket=require(_0x72d1('0xb'))(new Redis(config['redis']));require(_0x72d1('0xc'))[_0x72d1('0xd')](socket);function respondWithRpcPromise(_0x283775,_0x593c91,_0x1d7520){return new BPromise(function(_0x3a35c6,_0x45eb4a){return client[_0x72d1('0xe')](_0x283775,_0x1d7520)[_0x72d1('0xf')](function(_0x3916f2){logger[_0x72d1('0x10')](_0x72d1('0x11'),_0x593c91,_0x72d1('0x12'));logger[_0x72d1('0x13')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x593c91,_0x72d1('0x12'),JSON[_0x72d1('0x14')](_0x3916f2));if(_0x3916f2[_0x72d1('0x15')]){if(_0x3916f2[_0x72d1('0x15')][_0x72d1('0x16')]===0x1f4){logger[_0x72d1('0x15')](_0x72d1('0x11'),_0x593c91,_0x3916f2[_0x72d1('0x15')][_0x72d1('0x17')]);return _0x45eb4a(_0x3916f2[_0x72d1('0x15')][_0x72d1('0x17')]);}logger[_0x72d1('0x15')](_0x72d1('0x11'),_0x593c91,_0x3916f2['error'][_0x72d1('0x17')]);return _0x3a35c6(_0x3916f2['error'][_0x72d1('0x17')]);}else{logger[_0x72d1('0x10')]('FaxMessage,\x20%s,\x20%s',_0x593c91,_0x72d1('0x12'));_0x3a35c6(_0x3916f2[_0x72d1('0x18')][_0x72d1('0x17')]);}})['catch'](function(_0x4925f6){logger[_0x72d1('0x15')](_0x72d1('0x11'),_0x593c91,_0x4925f6);_0x45eb4a(_0x4925f6);});});}exports[_0x72d1('0x19')]=function(_0x1865c1){var _0x8d6890=this;return new Promise(function(_0x2253fd,_0x1e2411){return db['FaxMessage'][_0x72d1('0x1a')](_0x1865c1['body'],{'raw':_0x1865c1['options']?_0x1865c1['options']['raw']===undefined?!![]:![]:!![]})[_0x72d1('0xf')](function(_0x374602){logger['info'](_0x72d1('0x19'),_0x1865c1);logger[_0x72d1('0x13')](_0x72d1('0x19'),_0x1865c1,JSON[_0x72d1('0x14')](_0x374602));_0x2253fd(_0x374602);})[_0x72d1('0x1b')](function(_0x4e6acd){logger['error'](_0x72d1('0x19'),_0x4e6acd[_0x72d1('0x17')],_0x1865c1);_0x1e2411(_0x8d6890[_0x72d1('0x15')](0x1f4,_0x4e6acd[_0x72d1('0x17')]));});});};exports[_0x72d1('0x1c')]=function(_0x33d530){var _0x163bec=this;return new Promise(function(_0x589f7c,_0x57ec9e){return db[_0x72d1('0x1d')]['update'](_0x33d530[_0x72d1('0x1e')],{'raw':_0x33d530[_0x72d1('0x1f')]?_0x33d530[_0x72d1('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33d530[_0x72d1('0x1f')]?_0x33d530['options'][_0x72d1('0x20')]||null:null,'attributes':_0x33d530[_0x72d1('0x1f')]?_0x33d530[_0x72d1('0x1f')][_0x72d1('0x21')]||null:null,'limit':_0x33d530['options']?_0x33d530[_0x72d1('0x1f')]['limit']||null:null})[_0x72d1('0xf')](function(_0x32dc5e){logger['info'](_0x72d1('0x1c'),_0x33d530);logger[_0x72d1('0x13')](_0x72d1('0x1c'),_0x33d530,JSON[_0x72d1('0x14')](_0x32dc5e));_0x589f7c(_0x32dc5e);})[_0x72d1('0x1b')](function(_0x52511f){logger[_0x72d1('0x15')](_0x72d1('0x1c'),_0x52511f[_0x72d1('0x17')],_0x33d530);_0x57ec9e(_0x163bec['error'](0x1f4,_0x52511f[_0x72d1('0x17')]));});});}; \ No newline at end of file +var _0xd0bb=['CreateFaxMessage','FaxMessage','create','body','options','update','raw','where','attributes','limit','UpdateFaxMessage','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x393d69,_0x3a8c83){var _0x3cee37=function(_0x462682){while(--_0x462682){_0x393d69['push'](_0x393d69['shift']());}};_0x3cee37(++_0x3a8c83);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x5dff0c,_0x2bdeb4){_0x5dff0c=_0x5dff0c-0x0;var _0x15615f=_0xd0bb[_0x5dff0c];return _0x15615f;};'use strict';var _=require(_0xbd0b('0x0'));var util=require(_0xbd0b('0x1'));var moment=require(_0xbd0b('0x2'));var BPromise=require('bluebird');var rs=require(_0xbd0b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbd0b('0x4'))['db'];var utils=require(_0xbd0b('0x5'));var logger=require('../../config/logger')(_0xbd0b('0x6'));var config=require('../../config/environment');var jayson=require(_0xbd0b('0x7'));var client=jayson[_0xbd0b('0x8')][_0xbd0b('0x9')]({'port':0x232a});config[_0xbd0b('0xa')]=_[_0xbd0b('0xb')](config['redis'],{'host':_0xbd0b('0xc'),'port':0x18eb});var socket=require(_0xbd0b('0xd'))(new Redis(config[_0xbd0b('0xa')]));require(_0xbd0b('0xe'))[_0xbd0b('0xf')](socket);function respondWithRpcPromise(_0x53d5e8,_0x51cf98,_0x14bc5b){return new BPromise(function(_0x110cf1,_0x4a69ff){return client[_0xbd0b('0x10')](_0x53d5e8,_0x14bc5b)[_0xbd0b('0x11')](function(_0x526258){logger[_0xbd0b('0x12')](_0xbd0b('0x13'),_0x51cf98,_0xbd0b('0x14'));logger[_0xbd0b('0x15')](_0xbd0b('0x16'),_0x51cf98,_0xbd0b('0x14'),JSON[_0xbd0b('0x17')](_0x526258));if(_0x526258[_0xbd0b('0x18')]){if(_0x526258[_0xbd0b('0x18')][_0xbd0b('0x19')]===0x1f4){logger[_0xbd0b('0x18')]('FaxMessage,\x20%s,\x20%s',_0x51cf98,_0x526258[_0xbd0b('0x18')]['message']);return _0x4a69ff(_0x526258['error'][_0xbd0b('0x1a')]);}logger[_0xbd0b('0x18')](_0xbd0b('0x13'),_0x51cf98,_0x526258[_0xbd0b('0x18')][_0xbd0b('0x1a')]);return _0x110cf1(_0x526258['error']['message']);}else{logger[_0xbd0b('0x12')](_0xbd0b('0x13'),_0x51cf98,_0xbd0b('0x14'));_0x110cf1(_0x526258[_0xbd0b('0x1b')][_0xbd0b('0x1a')]);}})[_0xbd0b('0x1c')](function(_0x5aeb79){logger[_0xbd0b('0x18')]('FaxMessage,\x20%s,\x20%s',_0x51cf98,_0x5aeb79);_0x4a69ff(_0x5aeb79);});});}exports[_0xbd0b('0x1d')]=function(_0x475801){var _0x2d02d0=this;return new Promise(function(_0x3053bb,_0x4b312d){return db[_0xbd0b('0x1e')][_0xbd0b('0x1f')](_0x475801[_0xbd0b('0x20')],{'raw':_0x475801['options']?_0x475801[_0xbd0b('0x21')]['raw']===undefined?!![]:![]:!![]})[_0xbd0b('0x11')](function(_0x3c4938){logger[_0xbd0b('0x12')](_0xbd0b('0x1d'),_0x475801);logger[_0xbd0b('0x15')]('CreateFaxMessage',_0x475801,JSON[_0xbd0b('0x17')](_0x3c4938));_0x3053bb(_0x3c4938);})['catch'](function(_0x3e7e9c){logger[_0xbd0b('0x18')](_0xbd0b('0x1d'),_0x3e7e9c[_0xbd0b('0x1a')],_0x475801);_0x4b312d(_0x2d02d0[_0xbd0b('0x18')](0x1f4,_0x3e7e9c[_0xbd0b('0x1a')]));});});};exports['UpdateFaxMessage']=function(_0x382f76){var _0x1b46a3=this;return new Promise(function(_0x33b752,_0x1b5a00){return db[_0xbd0b('0x1e')][_0xbd0b('0x22')](_0x382f76['body'],{'raw':_0x382f76[_0xbd0b('0x21')]?_0x382f76[_0xbd0b('0x21')][_0xbd0b('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x382f76['options']?_0x382f76['options'][_0xbd0b('0x24')]||null:null,'attributes':_0x382f76[_0xbd0b('0x21')]?_0x382f76[_0xbd0b('0x21')][_0xbd0b('0x25')]||null:null,'limit':_0x382f76[_0xbd0b('0x21')]?_0x382f76[_0xbd0b('0x21')][_0xbd0b('0x26')]||null:null})['then'](function(_0x45f7d6){logger[_0xbd0b('0x12')]('UpdateFaxMessage',_0x382f76);logger['debug'](_0xbd0b('0x27'),_0x382f76,JSON[_0xbd0b('0x17')](_0x45f7d6));_0x33b752(_0x45f7d6);})['catch'](function(_0x31bdd3){logger[_0xbd0b('0x18')](_0xbd0b('0x27'),_0x31bdd3[_0xbd0b('0x1a')],_0x382f76);_0x1b5a00(_0x1b46a3[_0xbd0b('0x18')](0x1f4,_0x31bdd3[_0xbd0b('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index b98ac93..7e0de53 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 _0x0058=['length','faxMessage:','./faxMessage.events','save','update','emit'];(function(_0x1b33fe,_0x2149c7){var _0x5aa05c=function(_0x42bdd9){while(--_0x42bdd9){_0x1b33fe['push'](_0x1b33fe['shift']());}};_0x5aa05c(++_0x2149c7);}(_0x0058,0xb0));var _0x8005=function(_0x2b2bc1,_0x265cea){_0x2b2bc1=_0x2b2bc1-0x0;var _0x584606=_0x0058[_0x2b2bc1];return _0x584606;};'use strict';var FaxMessageEvents=require(_0x8005('0x0'));var events=[_0x8005('0x1'),'remove',_0x8005('0x2')];function createListener(_0x1f9a60,_0x84fc4e){return function(_0x5a60b6){_0x84fc4e[_0x8005('0x3')](_0x1f9a60,_0x5a60b6);};}function removeListener(_0x1bb87c,_0x378dd2){return function(){FaxMessageEvents['removeListener'](_0x1bb87c,_0x378dd2);};}exports['register']=function(_0x372f97){for(var _0x5a1c0c=0x0,_0x268951=events[_0x8005('0x4')];_0x5a1c0c<_0x268951;_0x5a1c0c++){var _0x2658e1=events[_0x5a1c0c];var _0x23ac9e=createListener(_0x8005('0x5')+_0x2658e1,_0x372f97);FaxMessageEvents['on'](_0x2658e1,_0x23ac9e);}}; \ No newline at end of file +var _0x1016=['emit','removeListener','length','./faxMessage.events','save','remove'];(function(_0x59710f,_0x44c7f0){var _0xaae66a=function(_0x1c2397){while(--_0x1c2397){_0x59710f['push'](_0x59710f['shift']());}};_0xaae66a(++_0x44c7f0);}(_0x1016,0x87));var _0x6101=function(_0x435821,_0xeed5fc){_0x435821=_0x435821-0x0;var _0x5284ad=_0x1016[_0x435821];return _0x5284ad;};'use strict';var FaxMessageEvents=require(_0x6101('0x0'));var events=[_0x6101('0x1'),_0x6101('0x2'),'update'];function createListener(_0x3eff24,_0x4c5d7b){return function(_0x1be3b2){_0x4c5d7b[_0x6101('0x3')](_0x3eff24,_0x1be3b2);};}function removeListener(_0x158396,_0x352790){return function(){FaxMessageEvents[_0x6101('0x4')](_0x158396,_0x352790);};}exports['register']=function(_0x4a565b){for(var _0x4e688e=0x0,_0x19bb5b=events[_0x6101('0x5')];_0x4e688e<_0x19bb5b;_0x4e688e++){var _0x567a7b=events[_0x4e688e];var _0x3adaca=createListener('faxMessage:'+_0x567a7b,_0x4a565b);FaxMessageEvents['on'](_0x567a7b,_0x3adaca);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index daf98c7..360bb44 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 _0xb821=['path','Router','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/download','download','post','tracked','fax','faxmessage:create','put','update','/:id/accept','reject','exports','util'];(function(_0x54e846,_0xed36a5){var _0x45fb1c=function(_0xe8f8ed){while(--_0xe8f8ed){_0x54e846['push'](_0x54e846['shift']());}};_0x45fb1c(++_0xed36a5);}(_0xb821,0xa7));var _0x1b82=function(_0x4aa33a,_0x2e0f6e){_0x4aa33a=_0x4aa33a-0x0;var _0x9ed4e9=_0xb821[_0x4aa33a];return _0x9ed4e9;};'use strict';var multer=require('multer');var util=require(_0x1b82('0x0'));var path=require(_0x1b82('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1b82('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1b82('0x3'));var config=require(_0x1b82('0x4'));var controller=require(_0x1b82('0x5'));router[_0x1b82('0x6')]('/',auth['isAuthenticated'](),controller[_0x1b82('0x7')]);router[_0x1b82('0x6')](_0x1b82('0x8'),auth[_0x1b82('0x9')](),controller[_0x1b82('0xa')]);router[_0x1b82('0x6')](_0x1b82('0xb'),auth[_0x1b82('0x9')](),controller[_0x1b82('0xc')]);router['get'](_0x1b82('0xd'),auth[_0x1b82('0x9')](),controller[_0x1b82('0xe')]);router[_0x1b82('0xf')]('/',auth[_0x1b82('0x9')](),interaction[_0x1b82('0x10')](_0x1b82('0x11'),_0x1b82('0x12')),controller['create']);router[_0x1b82('0x13')](_0x1b82('0xb'),auth[_0x1b82('0x9')](),controller[_0x1b82('0x14')]);router['put'](_0x1b82('0x15'),auth['isAuthenticated'](),controller['accept']);router[_0x1b82('0x13')]('/:id/reject',auth[_0x1b82('0x9')](),controller[_0x1b82('0x16')]);router['delete'](_0x1b82('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x1b82('0x17')]=router; \ No newline at end of file +var _0x4483=['download','post','tracked','fax','faxmessage:create','/:id','put','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxMessage.controller','get','isAuthenticated','index','/describe','describe','show','/:id/download'];(function(_0x235bf2,_0x391a60){var _0x13775e=function(_0xfae10f){while(--_0xfae10f){_0x235bf2['push'](_0x235bf2['shift']());}};_0x13775e(++_0x391a60);}(_0x4483,0x1a3));var _0x3448=function(_0x2ce991,_0x1d97fd){_0x2ce991=_0x2ce991-0x0;var _0x3451a1=_0x4483[_0x2ce991];return _0x3451a1;};'use strict';var multer=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var path=require(_0x3448('0x2'));var timeout=require('connect-timeout');var express=require(_0x3448('0x3'));var router=express[_0x3448('0x4')]();var fs_extra=require(_0x3448('0x5'));var auth=require(_0x3448('0x6'));var interaction=require(_0x3448('0x7'));var config=require('../../config/environment');var controller=require(_0x3448('0x8'));router[_0x3448('0x9')]('/',auth[_0x3448('0xa')](),controller[_0x3448('0xb')]);router[_0x3448('0x9')](_0x3448('0xc'),auth[_0x3448('0xa')](),controller[_0x3448('0xd')]);router['get']('/:id',auth[_0x3448('0xa')](),controller[_0x3448('0xe')]);router[_0x3448('0x9')](_0x3448('0xf'),auth[_0x3448('0xa')](),controller[_0x3448('0x10')]);router[_0x3448('0x11')]('/',auth[_0x3448('0xa')](),interaction[_0x3448('0x12')](_0x3448('0x13'),_0x3448('0x14')),controller['create']);router['put'](_0x3448('0x15'),auth[_0x3448('0xa')](),controller['update']);router[_0x3448('0x16')](_0x3448('0x17'),auth[_0x3448('0xa')](),controller['accept']);router[_0x3448('0x16')](_0x3448('0x18'),auth['isAuthenticated'](),controller[_0x3448('0x19')]);router[_0x3448('0x1a')](_0x3448('0x15'),auth['isAuthenticated'](),controller[_0x3448('0x1b')]);module[_0x3448('0x1c')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index bd6f37c..ecbf25d 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 _0xe056=['name','ENUM','beepall','roundrobin','STRING'];(function(_0x59a4d9,_0x4e2e42){var _0x402f8a=function(_0x2363ad){while(--_0x2363ad){_0x59a4d9['push'](_0x59a4d9['shift']());}};_0x402f8a(++_0x4e2e42);}(_0xe056,0xdb));var _0x6e05=function(_0x4b12ae,_0xf2b3b){_0x4b12ae=_0x4b12ae-0x0;var _0x16957b=_0xe056[_0x4b12ae];return _0x16957b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6e05('0x0')],'unique':_0x6e05('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6e05('0x0')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6e05('0x2')]('rrmemory',_0x6e05('0x3'),_0x6e05('0x4')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x20b6=['sequelize','exports','STRING','name','ENUM','beepall','INTEGER'];(function(_0x32f9f1,_0x3fce96){var _0x451dbc=function(_0x5d1f8a){while(--_0x5d1f8a){_0x32f9f1['push'](_0x32f9f1['shift']());}};_0x451dbc(++_0x3fce96);}(_0x20b6,0x1ab));var _0x620b=function(_0x174a72,_0x46034c){_0x174a72=_0x174a72-0x0;var _0x32cecd=_0x20b6[_0x174a72];return _0x32cecd;};'use strict';var Sequelize=require(_0x620b('0x0'));module[_0x620b('0x1')]={'name':{'type':Sequelize[_0x620b('0x2')],'unique':_0x620b('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x620b('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x620b('0x4')]('rrmemory',_0x620b('0x5'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x620b('0x6')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index 86163c5..6ff767d 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 _0xecb2=['addAgents','spread','isArray','getAgents','bluebird','squel','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','./faxQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','FaxQueues','UserProfileResource','error','stack','name','map','FaxQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','rows','catch','params','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','describe','getMembers','findOne','UserFaxQueue','hasOwnProperty','nolimit','order','sort','pick','filter','findAll','User','findAndCountAll','UserId','faxPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','Team','addTeams','ids','Agents','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','userFaxQueue:remove'];(function(_0x4f027d,_0x3f9587){var _0xc46890=function(_0x27d06c){while(--_0x27d06c){_0x4f027d['push'](_0x4f027d['shift']());}};_0xc46890(++_0x3f9587);}(_0xecb2,0xf6));var _0x2ecb=function(_0x170904,_0x1403e9){_0x170904=_0x170904-0x0;var _0x29a058=_0xecb2[_0x170904];return _0x29a058;};'use strict';var BPromise=require(_0x2ecb('0x0'));var util=require('util');var _=require('lodash');var squel=require(_0x2ecb('0x1'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x2ecb('0x2'))(_0x2ecb('0x3'));var config=require(_0x2ecb('0x4'));var db=require(_0x2ecb('0x5'))['db'];config[_0x2ecb('0x6')]=_[_0x2ecb('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2ecb('0x6')]));require(_0x2ecb('0x8'))[_0x2ecb('0x9')](socket);function respondWithStatusCode(_0x3bd683,_0x40d20a){_0x40d20a=_0x40d20a||0xcc;return function(_0x4fe275){if(_0x4fe275){return _0x3bd683[_0x2ecb('0xa')](_0x40d20a);}return _0x3bd683[_0x2ecb('0xb')](_0x40d20a)[_0x2ecb('0xc')]();};}function respondWithResult(_0x500735,_0x1e213c){_0x1e213c=_0x1e213c||0xc8;return function(_0x442482){if(_0x442482){return _0x500735[_0x2ecb('0xb')](_0x1e213c)[_0x2ecb('0xd')](_0x442482);}};}function respondWithFilteredResult(_0x9f045a,_0x5b8044){return function(_0x268ef4){if(_0x268ef4){var _0x2c771c=typeof _0x5b8044[_0x2ecb('0xe')]===_0x2ecb('0xf')&&typeof _0x5b8044[_0x2ecb('0x10')]===_0x2ecb('0xf');var _0x32d3c6=_0x268ef4['count'];var _0x10bc58=_0x2c771c?0x0:_0x5b8044[_0x2ecb('0xe')];var _0x48505e=_0x2c771c?_0x268ef4[_0x2ecb('0x11')]:_0x5b8044[_0x2ecb('0xe')]+_0x5b8044[_0x2ecb('0x10')];var _0x3fda3b;if(_0x48505e>=_0x32d3c6){_0x48505e=_0x32d3c6;_0x3fda3b=0xc8;}else{_0x3fda3b=0xce;}_0x9f045a[_0x2ecb('0xb')](_0x3fda3b);return _0x9f045a[_0x2ecb('0x12')](_0x2ecb('0x13'),_0x10bc58+'-'+_0x48505e+'/'+_0x32d3c6)[_0x2ecb('0xd')](_0x268ef4);}return null;};}function saveUpdates(_0x662ef2){return function(_0x5ade76){if(_0x5ade76){return _0x5ade76[_0x2ecb('0x14')](_0x662ef2)[_0x2ecb('0x15')](function(_0x5a1d41){return _0x5a1d41;});}return null;};}function removeEntity(_0x46e3bc){return function(_0x4c17cf){if(_0x4c17cf){return _0x4c17cf[_0x2ecb('0x16')]()[_0x2ecb('0x15')](function(){var _0xfa744e=_0x4c17cf[_0x2ecb('0x17')]({'plain':!![]});var _0x3363b0=_0x2ecb('0x18');return db[_0x2ecb('0x19')]['destroy']({'where':{'type':_0x3363b0,'resourceId':_0xfa744e['id']}})[_0x2ecb('0x15')](function(){return _0x4c17cf;});})[_0x2ecb('0x15')](function(){_0x46e3bc[_0x2ecb('0xb')](0xcc)['end']();});}};}function handleEntityNotFound(_0x110b69){return function(_0x2b7aae){if(!_0x2b7aae){_0x110b69['sendStatus'](0x194);}return _0x2b7aae;};}function handleError(_0x5b9d50,_0x2db610){_0x2db610=_0x2db610||0x1f4;return function(_0x5544ce){logger[_0x2ecb('0x1a')](_0x5544ce[_0x2ecb('0x1b')]);if(_0x5544ce[_0x2ecb('0x1c')]){delete _0x5544ce[_0x2ecb('0x1c')];}_0x5b9d50[_0x2ecb('0xb')](_0x2db610)['send'](_0x5544ce);};}exports['index']=function(_0x2e38ee,_0x5e072e){var _0x3fa13f={};var _0x8f21c={'count':0x0,'rows':[]};var _0x45249b=_[_0x2ecb('0x1d')](db[_0x2ecb('0x1e')][_0x2ecb('0x1f')],function(_0x171259){return{'name':_0x171259[_0x2ecb('0x20')],'type':_0x171259[_0x2ecb('0x21')][_0x2ecb('0x22')]};});_0x3fa13f=qs[_0x2ecb('0x23')](_0x45249b,_0x2e38ee);var _0x2fc4fe={'where':_0x3fa13f[_0x2ecb('0x24')]};return db[_0x2ecb('0x1e')][_0x2ecb('0x11')](_0x2fc4fe)[_0x2ecb('0x15')](function(_0x46092e){_0x8f21c[_0x2ecb('0x11')]=_0x46092e;_0x3fa13f[_0x2ecb('0x25')]=qs[_0x2ecb('0x25')](_0x2e38ee[_0x2ecb('0x26')]);return db[_0x2ecb('0x1e')]['findAll'](_0x3fa13f);})['then'](function(_0x354734){_0x8f21c[_0x2ecb('0x27')]=_0x354734;return _0x8f21c;})[_0x2ecb('0x15')](respondWithFilteredResult(_0x5e072e,_0x3fa13f))[_0x2ecb('0x28')](handleError(_0x5e072e,null));};exports['show']=function(_0x2c13f4,_0x1eec30){var _0x3142b0={'raw':!![],'where':{'id':_0x2c13f4[_0x2ecb('0x29')]['id']}},_0x257d2f={};_0x257d2f[_0x2ecb('0x2a')]=_['keys'](db[_0x2ecb('0x1e')]['rawAttributes']);_0x257d2f[_0x2ecb('0x26')]=_[_0x2ecb('0x2b')](_0x2c13f4[_0x2ecb('0x26')]);_0x257d2f[_0x2ecb('0x2c')]=_[_0x2ecb('0x2d')](_0x257d2f[_0x2ecb('0x2a')],_0x257d2f[_0x2ecb('0x26')]);_0x3142b0[_0x2ecb('0x2e')]=_[_0x2ecb('0x2d')](_0x257d2f['model'],qs[_0x2ecb('0x2f')](_0x2c13f4[_0x2ecb('0x26')][_0x2ecb('0x2f')]));_0x3142b0['attributes']=_0x3142b0[_0x2ecb('0x2e')][_0x2ecb('0x30')]?_0x3142b0[_0x2ecb('0x2e')]:_0x257d2f['model'];if(_0x2c13f4[_0x2ecb('0x26')][_0x2ecb('0x31')]){_0x3142b0[_0x2ecb('0x25')]=[{'all':!![]}];}_0x3142b0=_[_0x2ecb('0x32')]({},_0x3142b0,_0x2c13f4[_0x2ecb('0x33')]);return db[_0x2ecb('0x1e')][_0x2ecb('0x34')](_0x3142b0)[_0x2ecb('0x15')](handleEntityNotFound(_0x1eec30,null))[_0x2ecb('0x15')](respondWithResult(_0x1eec30,null))[_0x2ecb('0x28')](handleError(_0x1eec30,null));};exports['create']=function(_0xf9e0b2,_0x5d9252){return db[_0x2ecb('0x1e')][_0x2ecb('0x35')](_0xf9e0b2[_0x2ecb('0x36')],{})[_0x2ecb('0x15')](function(_0x3b2765){var _0x369f44=_0xf9e0b2['user'][_0x2ecb('0x17')]({'plain':!![]});if(!_0x369f44)throw new Error(_0x2ecb('0x37'));if(_0x369f44[_0x2ecb('0x38')]===_0x2ecb('0x39')){var _0x1278b3=_0x3b2765[_0x2ecb('0x17')]({'plain':!![]});var _0x36f308=_0x2ecb('0x18');return db[_0x2ecb('0x3a')][_0x2ecb('0x34')]({'where':{'name':_0x36f308,'userProfileId':_0x369f44[_0x2ecb('0x3b')]},'raw':!![]})[_0x2ecb('0x15')](function(_0xa90974){if(_0xa90974&&_0xa90974['autoAssociation']===0x0){return db[_0x2ecb('0x19')]['create']({'name':_0x1278b3['name'],'resourceId':_0x1278b3['id'],'type':_0xa90974[_0x2ecb('0x1c')],'sectionId':_0xa90974['id']},{})[_0x2ecb('0x15')](function(){return _0x3b2765;});}else{return _0x3b2765;}})[_0x2ecb('0x28')](function(_0x818b70){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x818b70);throw _0x818b70;});}return _0x3b2765;})['then'](respondWithResult(_0x5d9252,0xc9))[_0x2ecb('0x28')](handleError(_0x5d9252,null));};exports['update']=function(_0x5d566e,_0x231076){if(_0x5d566e[_0x2ecb('0x36')]['id']){delete _0x5d566e[_0x2ecb('0x36')]['id'];}return db[_0x2ecb('0x1e')][_0x2ecb('0x34')]({'where':{'id':_0x5d566e[_0x2ecb('0x29')]['id']}})[_0x2ecb('0x15')](handleEntityNotFound(_0x231076,null))[_0x2ecb('0x15')](saveUpdates(_0x5d566e[_0x2ecb('0x36')],null))[_0x2ecb('0x15')](respondWithResult(_0x231076,null))[_0x2ecb('0x28')](handleError(_0x231076,null));};exports['destroy']=function(_0x11c877,_0x3e0a98){return db['FaxQueue'][_0x2ecb('0x34')]({'where':{'id':_0x11c877[_0x2ecb('0x29')]['id']}})[_0x2ecb('0x15')](handleEntityNotFound(_0x3e0a98,null))['then'](removeEntity(_0x3e0a98,null))['catch'](handleError(_0x3e0a98,null));};exports[_0x2ecb('0x3c')]=function(_0x176770,_0xf5edc8){return db[_0x2ecb('0x1e')]['describe']()[_0x2ecb('0x15')](respondWithResult(_0xf5edc8,null))[_0x2ecb('0x28')](handleError(_0xf5edc8,null));};exports[_0x2ecb('0x3d')]=function(_0x1ee483,_0x22bba5){var _0x4f15dc={'raw':!![],'where':{}},_0x428b9d={},_0xa51d2f;return db[_0x2ecb('0x1e')][_0x2ecb('0x3e')]({'where':{'id':_0x1ee483['params']['id']}})[_0x2ecb('0x15')](handleEntityNotFound(_0x22bba5,null))['then'](function(_0x25eea2){if(_0x25eea2){_0xa51d2f=_0x25eea2[_0x2ecb('0x17')]({'plain':!![]});_0x428b9d[_0x2ecb('0x2a')]=_['keys'](db[_0x2ecb('0x3f')][_0x2ecb('0x1f')]);_0x428b9d['query']=_[_0x2ecb('0x2b')](_0x1ee483[_0x2ecb('0x26')]);_0x428b9d['filters']=_['intersection'](_0x428b9d[_0x2ecb('0x2a')],_0x428b9d[_0x2ecb('0x26')]);_0x4f15dc[_0x2ecb('0x2e')]=_['intersection'](_0x428b9d[_0x2ecb('0x2a')],qs['fields'](_0x1ee483['query'][_0x2ecb('0x2f')]));_0x4f15dc[_0x2ecb('0x2e')]=_0x4f15dc[_0x2ecb('0x2e')]['length']?_0x4f15dc[_0x2ecb('0x2e')]:_0x428b9d['model'];if(!_0x1ee483[_0x2ecb('0x26')][_0x2ecb('0x40')](_0x2ecb('0x41'))){_0x4f15dc[_0x2ecb('0x10')]=qs[_0x2ecb('0x10')](_0x1ee483['query'][_0x2ecb('0x10')]);_0x4f15dc['offset']=qs['offset'](_0x1ee483[_0x2ecb('0x26')][_0x2ecb('0xe')]);}_0x4f15dc[_0x2ecb('0x42')]=qs[_0x2ecb('0x43')](_0x1ee483[_0x2ecb('0x26')][_0x2ecb('0x43')]);_0x4f15dc[_0x2ecb('0x24')]=qs[_0x2ecb('0x2c')](_[_0x2ecb('0x44')](_0x1ee483[_0x2ecb('0x26')],_0x428b9d[_0x2ecb('0x2c')]));_0x4f15dc[_0x2ecb('0x24')]['FaxQueueId']=_0x25eea2['id'];if(_0x1ee483[_0x2ecb('0x26')][_0x2ecb('0x45')]){_0x4f15dc[_0x2ecb('0x24')]=_[_0x2ecb('0x32')](_0x4f15dc['where'],{'$or':_[_0x2ecb('0x1d')](_0x4f15dc[_0x2ecb('0x2e')],function(_0x6dc83a){var _0x5f4586={};_0x5f4586[_0x6dc83a]={'$like':'%'+_0x1ee483['query']['filter']+'%'};return _0x5f4586;})});}_0x4f15dc=_[_0x2ecb('0x32')]({},_0x4f15dc,_0x1ee483[_0x2ecb('0x33')]);return db['UserFaxQueue'][_0x2ecb('0x46')](_0x4f15dc);}})[_0x2ecb('0x15')](function(_0x47a6b1){if(_0x47a6b1){return db[_0x2ecb('0x47')][_0x2ecb('0x48')]({'where':{'id':_[_0x2ecb('0x1d')](_0x47a6b1,_0x2ecb('0x49')),'role':'agent'},'attributes':['id',_0x2ecb('0x1c'),_0x2ecb('0x4a'),'updatedAt',_0x2ecb('0x4b')]});}})[_0x2ecb('0x15')](function(_0x5c6ff2){if(_0x5c6ff2){return{'count':_0x5c6ff2[_0x2ecb('0x11')],'rows':_[_0x2ecb('0x1d')](_0x5c6ff2[_0x2ecb('0x27')],function(_0x30d297){return{'membername':_0x30d297['name'],'UserId':_0x30d297['id'],'queue_name':_0xa51d2f[_0x2ecb('0x1c')],'FaxQueueId':_0xa51d2f['id'],'interface':util[_0x2ecb('0x4c')](_0x2ecb('0x4d'),_0x2ecb('0x4e'),_0x30d297['name']),'penalty':0x0,'paused':_0x30d297[_0x2ecb('0x4a')],'createdAt':_0x30d297[_0x2ecb('0x4b')],'updatedAt':_0x30d297[_0x2ecb('0x4f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2ecb('0x15')](respondWithFilteredResult(_0x22bba5,_0x4f15dc))[_0x2ecb('0x28')](handleError(_0x22bba5,null));};exports[_0x2ecb('0x50')]=function(_0x57430c,_0x27bf14){var _0x11b4db={};var _0x236e8c={};var _0x1ea868;var _0x9cb921;return db[_0x2ecb('0x1e')][_0x2ecb('0x3e')]({'where':{'id':_0x57430c[_0x2ecb('0x29')]['id']}})[_0x2ecb('0x15')](handleEntityNotFound(_0x27bf14,null))[_0x2ecb('0x15')](function(_0x834be3){if(_0x834be3){_0x1ea868=_0x834be3;_0x236e8c[_0x2ecb('0x2a')]=_[_0x2ecb('0x2b')](db[_0x2ecb('0x51')][_0x2ecb('0x1f')]);_0x236e8c['query']=_[_0x2ecb('0x2b')](_0x57430c[_0x2ecb('0x26')]);_0x236e8c[_0x2ecb('0x2c')]=_[_0x2ecb('0x2d')](_0x236e8c['model'],_0x236e8c[_0x2ecb('0x26')]);_0x11b4db['attributes']=_[_0x2ecb('0x2d')](_0x236e8c[_0x2ecb('0x2a')],qs[_0x2ecb('0x2f')](_0x57430c['query'][_0x2ecb('0x2f')]));_0x11b4db[_0x2ecb('0x2e')]=_0x11b4db[_0x2ecb('0x2e')]['length']?_0x11b4db[_0x2ecb('0x2e')]:_0x236e8c['model'];_0x11b4db[_0x2ecb('0x42')]=qs['sort'](_0x57430c['query']['sort']);_0x11b4db[_0x2ecb('0x24')]=qs[_0x2ecb('0x2c')](_[_0x2ecb('0x44')](_0x57430c[_0x2ecb('0x26')],_0x236e8c[_0x2ecb('0x2c')]));if(_0x57430c[_0x2ecb('0x26')][_0x2ecb('0x45')]){_0x11b4db[_0x2ecb('0x24')]=_[_0x2ecb('0x32')](_0x11b4db[_0x2ecb('0x24')],{'$or':_[_0x2ecb('0x1d')](_0x11b4db['attributes'],function(_0x25b526){var _0x5cca0d={};_0x5cca0d[_0x25b526]={'$like':'%'+_0x57430c[_0x2ecb('0x26')][_0x2ecb('0x45')]+'%'};return _0x5cca0d;})});}_0x11b4db=_[_0x2ecb('0x32')]({},_0x11b4db,_0x57430c[_0x2ecb('0x33')]);return _0x1ea868[_0x2ecb('0x50')](_0x11b4db);}})[_0x2ecb('0x15')](function(_0x418278){if(_0x418278){_0x9cb921=_0x418278['length'];if(!_0x57430c[_0x2ecb('0x26')][_0x2ecb('0x40')]('nolimit')){_0x11b4db[_0x2ecb('0x10')]=qs[_0x2ecb('0x10')](_0x57430c['query'][_0x2ecb('0x10')]);_0x11b4db[_0x2ecb('0xe')]=qs['offset'](_0x57430c[_0x2ecb('0x26')][_0x2ecb('0xe')]);}return _0x1ea868[_0x2ecb('0x50')](_0x11b4db);}})[_0x2ecb('0x15')](function(_0xb40b39){if(_0xb40b39){return _0xb40b39?{'count':_0x9cb921,'rows':_0xb40b39}:null;}})['then'](respondWithResult(_0x27bf14,null))['catch'](handleError(_0x27bf14,null));};exports[_0x2ecb('0x52')]=function(_0x282632,_0x232a4e){var _0x2be125=_0x282632['body'][_0x2ecb('0x53')];return db[_0x2ecb('0x51')][_0x2ecb('0x46')]({'where':{'id':_0x2be125},'attributes':['id'],'include':[{'model':db[_0x2ecb('0x47')],'as':_0x2ecb('0x54'),'attributes':['id','name','online',_0x2ecb('0x55'),_0x2ecb('0x56')],'raw':!![]}]})[_0x2ecb('0x15')](function(_0x1655e7){if(_0x1655e7){var _0x5df865=_[_0x2ecb('0x57')](_0x1655e7,function(_0x3c0e1e){var _0x161478=_0x3c0e1e[_0x2ecb('0x17')]({'plain':!![]});return _0x161478[_0x2ecb('0x54')];});return db['FaxQueue'][_0x2ecb('0x34')]({'where':{'id':_0x282632[_0x2ecb('0x29')]['id']}})[_0x2ecb('0x15')](function(_0x247c33){return db[_0x2ecb('0x58')][_0x2ecb('0x59')](function(_0x47d1aa){return _0x247c33[_0x2ecb('0x52')](_0x2be125,{'transaction':_0x47d1aa})[_0x2ecb('0x15')](function(){return BPromise[_0x2ecb('0x5a')](_0x5df865,function(_0x285b16){return db[_0x2ecb('0x3f')][_0x2ecb('0x5b')]({'where':{'UserId':_0x285b16['id'],'FaxQueueId':_0x282632['params']['id']},'transaction':_0x47d1aa});});})['then'](function(){_0x5df865[_0x2ecb('0x5c')](function(_0x224625){socket[_0x2ecb('0x5d')](_0x2ecb('0x5e'),{'UserId':_0x224625['id'],'FaxQueueId':_0x247c33['id']});});});});});}})[_0x2ecb('0x15')](respondWithStatusCode(_0x232a4e,null))[_0x2ecb('0x28')](handleError(_0x232a4e,null));};exports[_0x2ecb('0x5f')]=function(_0x26e9a5,_0x57cbad){return db[_0x2ecb('0x51')][_0x2ecb('0x46')]({'where':{'id':_0x26e9a5[_0x2ecb('0x26')][_0x2ecb('0x53')]},'attributes':['id'],'include':[{'model':db[_0x2ecb('0x47')],'as':_0x2ecb('0x54'),'attributes':['id'],'raw':!![]}]})[_0x2ecb('0x15')](handleEntityNotFound(_0x57cbad,null))['then'](function(_0x10092e){var _0x5491b0=_['map'](_0x10092e,'id');var _0x5e63ee=[];var _0x5433a7=[];var _0xea354b=squel[_0x2ecb('0x60')]();_0xea354b[_0x2ecb('0x61')](_0x2ecb('0x62'))[_0x2ecb('0x63')](_0x2ecb('0x64'),'tq')[_0x2ecb('0x65')](_0x2ecb('0x66'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x2ecb('0x24')]('FaxQueueId\x20=\x20?',_0x26e9a5['params']['id']);for(var _0x3a3a4a=0x0;_0x3a3a4a<_0x10092e['length'];_0x3a3a4a+=0x1){let _0x7a2723=_0x10092e[_0x3a3a4a];for(var _0x5d2fbd=0x0;_0x5d2fbd<_0x7a2723[_0x2ecb('0x54')][_0x2ecb('0x30')];_0x5d2fbd+=0x1){let _0x5ab2b2=_0x7a2723[_0x2ecb('0x54')][_0x5d2fbd];var _0x5c56be=_0xea354b['clone']();_0x5c56be['where'](_0x2ecb('0x67'),_0x5ab2b2['id']);_0x5433a7[_0x2ecb('0x68')](db[_0x2ecb('0x58')][_0x2ecb('0x26')](_0x5c56be[_0x2ecb('0x69')](),{'type':db[_0x2ecb('0x58')][_0x2ecb('0x6a')][_0x2ecb('0x6b')]})[_0x2ecb('0x15')](function(_0x197b8e){if(_0x197b8e[_0x2ecb('0x30')]===0x1){return _0x5ab2b2['id'];}else{var _0x289fe9=_[_0x2ecb('0x6c')](_[_0x2ecb('0x1d')](_0x197b8e,_0x2ecb('0x6d')),function(_0x175c92){return _[_0x2ecb('0x6e')](_0x5491b0,_0x175c92);});if(_0x289fe9){return _0x5ab2b2['id'];}}}));}}return BPromise[_0x2ecb('0x6f')](_0x5433a7)[_0x2ecb('0x15')](function(_0x51e42c){_0x5e63ee=_(_0x5e63ee)['union'](_0x51e42c)[_0x2ecb('0x70')]()[_0x2ecb('0x71')]();return db['FaxQueue'][_0x2ecb('0x34')]({'where':{'id':_0x26e9a5['params']['id']}})['then'](function(_0x1c4d42){return db['sequelize'][_0x2ecb('0x59')](function(_0x153688){return _0x1c4d42[_0x2ecb('0x5f')](_0x26e9a5[_0x2ecb('0x26')]['ids'],{'transaction':_0x153688})[_0x2ecb('0x15')](function(){if(!_[_0x2ecb('0x72')](_0x5e63ee)){return _0x1c4d42[_0x2ecb('0x73')](_0x5e63ee,{'transaction':_0x153688});}})[_0x2ecb('0x15')](function(){_0x5e63ee[_0x2ecb('0x5c')](function(_0x3325e5){socket[_0x2ecb('0x5d')](_0x2ecb('0x74'),{'UserId':_0x3325e5,'FaxQueueId':_0x1c4d42['id']});});});});});});})[_0x2ecb('0x15')](respondWithStatusCode(_0x57cbad,null))[_0x2ecb('0x28')](handleError(_0x57cbad,null));};exports[_0x2ecb('0x75')]=function(_0x16f4a6,_0x3c6eb4){return db[_0x2ecb('0x1e')][_0x2ecb('0x34')]({'where':{'id':_0x16f4a6['params']['id']}})[_0x2ecb('0x15')](handleEntityNotFound(_0x3c6eb4,null))[_0x2ecb('0x15')](function(_0xdc692f){if(_0xdc692f){return _0xdc692f[_0x2ecb('0x75')](_0x16f4a6[_0x2ecb('0x36')]['ids'],_['omit'](_0x16f4a6[_0x2ecb('0x36')],['ids','id'])||{})[_0x2ecb('0x76')](function(_0x5c3a3a){for(var _0xcfa03d=0x0;_0xcfa03d<_0x16f4a6['body'][_0x2ecb('0x53')][_0x2ecb('0x30')];_0xcfa03d+=0x1){socket['emit'](_0x2ecb('0x5e'),{'UserId':Number(_0x16f4a6['body'][_0x2ecb('0x53')][_0xcfa03d]),'FaxQueueId':Number(_0x16f4a6['params']['id'])});}return _0x5c3a3a;});}})[_0x2ecb('0x15')](respondWithResult(_0x3c6eb4,null))[_0x2ecb('0x28')](handleError(_0x3c6eb4,null));};exports[_0x2ecb('0x73')]=function(_0x142cf7,_0x5e33c2){return db['FaxQueue'][_0x2ecb('0x34')]({'where':{'id':_0x142cf7[_0x2ecb('0x29')]['id']}})[_0x2ecb('0x15')](handleEntityNotFound(_0x5e33c2,null))[_0x2ecb('0x15')](function(_0x4556c5){if(_0x4556c5){return _0x4556c5['removeAgents'](_0x142cf7[_0x2ecb('0x26')][_0x2ecb('0x53')])[_0x2ecb('0x15')](function(){if(_[_0x2ecb('0x77')](_0x142cf7[_0x2ecb('0x26')][_0x2ecb('0x53')])){for(var _0x3b053a=0x0;_0x3b053a<_0x142cf7[_0x2ecb('0x26')][_0x2ecb('0x53')]['length'];_0x3b053a+=0x1){socket[_0x2ecb('0x5d')](_0x2ecb('0x74'),{'UserId':Number(_0x142cf7['query'][_0x2ecb('0x53')][_0x3b053a]),'FaxQueueId':Number(_0x142cf7[_0x2ecb('0x29')]['id'])});}}else{socket[_0x2ecb('0x5d')](_0x2ecb('0x74'),{'UserId':Number(_0x142cf7[_0x2ecb('0x26')][_0x2ecb('0x53')]),'FaxQueueId':Number(_0x142cf7[_0x2ecb('0x29')]['id'])});}});}})[_0x2ecb('0x15')](respondWithStatusCode(_0x5e33c2,null))[_0x2ecb('0x28')](handleError(_0x5e33c2,null));};exports['getAgents']=function(_0x50c0f6,_0x4e3474){var _0xb7f8da={};var _0x4ce32f={};var _0x32ed5c;var _0x43e4ef;return db['FaxQueue'][_0x2ecb('0x3e')]({'where':{'id':_0x50c0f6[_0x2ecb('0x29')]['id']}})[_0x2ecb('0x15')](handleEntityNotFound(_0x4e3474,null))[_0x2ecb('0x15')](function(_0x1654e9){if(_0x1654e9){_0x32ed5c=_0x1654e9;_0x4ce32f[_0x2ecb('0x2a')]=_['keys'](db[_0x2ecb('0x47')][_0x2ecb('0x1f')]);_0x4ce32f['query']=_[_0x2ecb('0x2b')](_0x50c0f6[_0x2ecb('0x26')]);_0x4ce32f[_0x2ecb('0x2c')]=_[_0x2ecb('0x2d')](_0x4ce32f[_0x2ecb('0x2a')],_0x4ce32f[_0x2ecb('0x26')]);_0xb7f8da[_0x2ecb('0x2e')]=_[_0x2ecb('0x2d')](_0x4ce32f[_0x2ecb('0x2a')],qs[_0x2ecb('0x2f')](_0x50c0f6[_0x2ecb('0x26')][_0x2ecb('0x2f')]));_0xb7f8da[_0x2ecb('0x2e')]=_0xb7f8da[_0x2ecb('0x2e')][_0x2ecb('0x30')]?_0xb7f8da[_0x2ecb('0x2e')]:_0x4ce32f[_0x2ecb('0x2a')];_0xb7f8da[_0x2ecb('0x42')]=qs['sort'](_0x50c0f6['query']['sort']);_0xb7f8da[_0x2ecb('0x24')]=qs[_0x2ecb('0x2c')](_['pick'](_0x50c0f6['query'],_0x4ce32f[_0x2ecb('0x2c')]));if(_0x50c0f6[_0x2ecb('0x26')][_0x2ecb('0x45')]){_0xb7f8da[_0x2ecb('0x24')]=_[_0x2ecb('0x32')](_0xb7f8da['where'],{'$or':_['map'](_0xb7f8da[_0x2ecb('0x2e')],function(_0x5a7431){var _0x1d4109={};_0x1d4109[_0x5a7431]={'$like':'%'+_0x50c0f6[_0x2ecb('0x26')]['filter']+'%'};return _0x1d4109;})});}_0xb7f8da=_[_0x2ecb('0x32')]({},_0xb7f8da,_0x50c0f6[_0x2ecb('0x33')]);return _0x32ed5c[_0x2ecb('0x78')](_0xb7f8da);}})[_0x2ecb('0x15')](function(_0x191107){if(_0x191107){_0x43e4ef=_0x191107['length'];if(!_0x50c0f6[_0x2ecb('0x26')][_0x2ecb('0x40')]('nolimit')){_0xb7f8da[_0x2ecb('0x10')]=qs['limit'](_0x50c0f6[_0x2ecb('0x26')]['limit']);_0xb7f8da[_0x2ecb('0xe')]=qs[_0x2ecb('0xe')](_0x50c0f6[_0x2ecb('0x26')]['offset']);}return _0x32ed5c[_0x2ecb('0x78')](_0xb7f8da);}})[_0x2ecb('0x15')](function(_0x303111){if(_0x303111){return _0x303111?{'count':_0x43e4ef,'rows':_0x303111}:null;}})[_0x2ecb('0x15')](respondWithResult(_0x4e3474,null))[_0x2ecb('0x28')](handleError(_0x4e3474,null));}; \ No newline at end of file +var _0x0eeb=['map','FaxQueue','rawAttributes','fieldName','type','key','getOptions','query','findAll','rows','catch','show','params','model','keys','filters','intersection','fields','attributes','include','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','length','hasOwnProperty','order','sort','pick','where','FaxQueueId','options','User','findAndCountAll','UserId','agent','createdAt','SIP','faxPause','updatedAt','getTeams','Team','filter','ids','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','select','tq.TeamId','from','join','user_has_teams','FaxQueueId\x20=\x20?','push','TeamId','value','removeAgents','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','sendStatus','status','end','offset','limit','count','set','Content-Range','json','update','then','get','FaxQueues','UserProfileResource','destroy','error','stack','name','send','index'];(function(_0x295f7f,_0x561913){var _0x5cd7ab=function(_0x5e44cd){while(--_0x5e44cd){_0x295f7f['push'](_0x295f7f['shift']());}};_0x5cd7ab(++_0x561913);}(_0x0eeb,0xc5));var _0xb0ee=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x0eeb[_0x4a9fb1];return _0x348672;};'use strict';var BPromise=require(_0xb0ee('0x0'));var util=require(_0xb0ee('0x1'));var _=require(_0xb0ee('0x2'));var squel=require(_0xb0ee('0x3'));var Redis=require(_0xb0ee('0x4'));var qs=require(_0xb0ee('0x5'));var logger=require('../../config/logger')('api');var config=require(_0xb0ee('0x6'));var db=require(_0xb0ee('0x7'))['db'];config[_0xb0ee('0x8')]=_[_0xb0ee('0x9')](config[_0xb0ee('0x8')],{'host':_0xb0ee('0xa'),'port':0x18eb});var socket=require(_0xb0ee('0xb'))(new Redis(config['redis']));require(_0xb0ee('0xc'))['register'](socket);function respondWithStatusCode(_0x13c198,_0x3fb986){_0x3fb986=_0x3fb986||0xcc;return function(_0x22ce80){if(_0x22ce80){return _0x13c198[_0xb0ee('0xd')](_0x3fb986);}return _0x13c198[_0xb0ee('0xe')](_0x3fb986)[_0xb0ee('0xf')]();};}function respondWithResult(_0x5516d4,_0x4a7766){_0x4a7766=_0x4a7766||0xc8;return function(_0x74f27){if(_0x74f27){return _0x5516d4[_0xb0ee('0xe')](_0x4a7766)['json'](_0x74f27);}};}function respondWithFilteredResult(_0x5b449c,_0x27dc02){return function(_0x3bf4f5){if(_0x3bf4f5){var _0x3024bc=typeof _0x27dc02[_0xb0ee('0x10')]==='undefined'&&typeof _0x27dc02[_0xb0ee('0x11')]==='undefined';var _0x478f98=_0x3bf4f5['count'];var _0x49e7d3=_0x3024bc?0x0:_0x27dc02[_0xb0ee('0x10')];var _0x5386b0=_0x3024bc?_0x3bf4f5[_0xb0ee('0x12')]:_0x27dc02[_0xb0ee('0x10')]+_0x27dc02[_0xb0ee('0x11')];var _0xe78334;if(_0x5386b0>=_0x478f98){_0x5386b0=_0x478f98;_0xe78334=0xc8;}else{_0xe78334=0xce;}_0x5b449c[_0xb0ee('0xe')](_0xe78334);return _0x5b449c[_0xb0ee('0x13')](_0xb0ee('0x14'),_0x49e7d3+'-'+_0x5386b0+'/'+_0x478f98)[_0xb0ee('0x15')](_0x3bf4f5);}return null;};}function saveUpdates(_0x549e64){return function(_0x4e74b4){if(_0x4e74b4){return _0x4e74b4[_0xb0ee('0x16')](_0x549e64)['then'](function(_0x1a2018){return _0x1a2018;});}return null;};}function removeEntity(_0x35ec11){return function(_0x480e51){if(_0x480e51){return _0x480e51['destroy']()[_0xb0ee('0x17')](function(){var _0x2bd14a=_0x480e51[_0xb0ee('0x18')]({'plain':!![]});var _0x4ce528=_0xb0ee('0x19');return db[_0xb0ee('0x1a')][_0xb0ee('0x1b')]({'where':{'type':_0x4ce528,'resourceId':_0x2bd14a['id']}})[_0xb0ee('0x17')](function(){return _0x480e51;});})['then'](function(){_0x35ec11[_0xb0ee('0xe')](0xcc)[_0xb0ee('0xf')]();});}};}function handleEntityNotFound(_0x26a3ee){return function(_0x2c8ef3){if(!_0x2c8ef3){_0x26a3ee[_0xb0ee('0xd')](0x194);}return _0x2c8ef3;};}function handleError(_0x2073ef,_0x320956){_0x320956=_0x320956||0x1f4;return function(_0x2b19f2){logger[_0xb0ee('0x1c')](_0x2b19f2[_0xb0ee('0x1d')]);if(_0x2b19f2[_0xb0ee('0x1e')]){delete _0x2b19f2[_0xb0ee('0x1e')];}_0x2073ef[_0xb0ee('0xe')](_0x320956)[_0xb0ee('0x1f')](_0x2b19f2);};}exports[_0xb0ee('0x20')]=function(_0x5a1197,_0x151188){var _0x4c4433={};var _0x53bccd={'count':0x0,'rows':[]};var _0x3442b7=_[_0xb0ee('0x21')](db[_0xb0ee('0x22')][_0xb0ee('0x23')],function(_0x560e40){return{'name':_0x560e40[_0xb0ee('0x24')],'type':_0x560e40[_0xb0ee('0x25')][_0xb0ee('0x26')]};});_0x4c4433=qs[_0xb0ee('0x27')](_0x3442b7,_0x5a1197);var _0x4b5308={'where':_0x4c4433['where']};return db[_0xb0ee('0x22')][_0xb0ee('0x12')](_0x4b5308)[_0xb0ee('0x17')](function(_0x561f37){_0x53bccd[_0xb0ee('0x12')]=_0x561f37;_0x4c4433['include']=qs['include'](_0x5a1197[_0xb0ee('0x28')]);return db[_0xb0ee('0x22')][_0xb0ee('0x29')](_0x4c4433);})[_0xb0ee('0x17')](function(_0x1f0db8){_0x53bccd[_0xb0ee('0x2a')]=_0x1f0db8;return _0x53bccd;})[_0xb0ee('0x17')](respondWithFilteredResult(_0x151188,_0x4c4433))[_0xb0ee('0x2b')](handleError(_0x151188,null));};exports[_0xb0ee('0x2c')]=function(_0x559c98,_0x698d9f){var _0x450f5b={'raw':!![],'where':{'id':_0x559c98[_0xb0ee('0x2d')]['id']}},_0x1a4b5e={};_0x1a4b5e[_0xb0ee('0x2e')]=_[_0xb0ee('0x2f')](db[_0xb0ee('0x22')][_0xb0ee('0x23')]);_0x1a4b5e['query']=_[_0xb0ee('0x2f')](_0x559c98['query']);_0x1a4b5e[_0xb0ee('0x30')]=_[_0xb0ee('0x31')](_0x1a4b5e[_0xb0ee('0x2e')],_0x1a4b5e['query']);_0x450f5b['attributes']=_['intersection'](_0x1a4b5e['model'],qs[_0xb0ee('0x32')](_0x559c98[_0xb0ee('0x28')]['fields']));_0x450f5b[_0xb0ee('0x33')]=_0x450f5b['attributes']['length']?_0x450f5b[_0xb0ee('0x33')]:_0x1a4b5e['model'];if(_0x559c98['query']['includeAll']){_0x450f5b[_0xb0ee('0x34')]=[{'all':!![]}];}_0x450f5b=_[_0xb0ee('0x35')]({},_0x450f5b,_0x559c98['options']);return db[_0xb0ee('0x22')][_0xb0ee('0x36')](_0x450f5b)[_0xb0ee('0x17')](handleEntityNotFound(_0x698d9f,null))[_0xb0ee('0x17')](respondWithResult(_0x698d9f,null))[_0xb0ee('0x2b')](handleError(_0x698d9f,null));};exports[_0xb0ee('0x37')]=function(_0x208b7e,_0x3b3d22){return db[_0xb0ee('0x22')][_0xb0ee('0x37')](_0x208b7e[_0xb0ee('0x38')],{})[_0xb0ee('0x17')](function(_0x2e4f98){var _0x297d83=_0x208b7e[_0xb0ee('0x39')][_0xb0ee('0x18')]({'plain':!![]});if(!_0x297d83)throw new Error(_0xb0ee('0x3a'));if(_0x297d83[_0xb0ee('0x3b')]===_0xb0ee('0x39')){var _0x30eddc=_0x2e4f98[_0xb0ee('0x18')]({'plain':!![]});var _0x594230='FaxQueues';return db[_0xb0ee('0x3c')]['find']({'where':{'name':_0x594230,'userProfileId':_0x297d83[_0xb0ee('0x3d')]},'raw':!![]})[_0xb0ee('0x17')](function(_0x223eaf){if(_0x223eaf&&_0x223eaf[_0xb0ee('0x3e')]===0x0){return db[_0xb0ee('0x1a')]['create']({'name':_0x30eddc[_0xb0ee('0x1e')],'resourceId':_0x30eddc['id'],'type':_0x223eaf[_0xb0ee('0x1e')],'sectionId':_0x223eaf['id']},{})['then'](function(){return _0x2e4f98;});}else{return _0x2e4f98;}})[_0xb0ee('0x2b')](function(_0x37f30a){logger[_0xb0ee('0x1c')](_0xb0ee('0x3f'),_0x37f30a);throw _0x37f30a;});}return _0x2e4f98;})[_0xb0ee('0x17')](respondWithResult(_0x3b3d22,0xc9))[_0xb0ee('0x2b')](handleError(_0x3b3d22,null));};exports[_0xb0ee('0x16')]=function(_0x5cc3f2,_0x583a31){if(_0x5cc3f2[_0xb0ee('0x38')]['id']){delete _0x5cc3f2['body']['id'];}return db[_0xb0ee('0x22')]['find']({'where':{'id':_0x5cc3f2[_0xb0ee('0x2d')]['id']}})['then'](handleEntityNotFound(_0x583a31,null))[_0xb0ee('0x17')](saveUpdates(_0x5cc3f2['body'],null))[_0xb0ee('0x17')](respondWithResult(_0x583a31,null))[_0xb0ee('0x2b')](handleError(_0x583a31,null));};exports[_0xb0ee('0x1b')]=function(_0x1bcce1,_0x402189){return db[_0xb0ee('0x22')][_0xb0ee('0x36')]({'where':{'id':_0x1bcce1[_0xb0ee('0x2d')]['id']}})[_0xb0ee('0x17')](handleEntityNotFound(_0x402189,null))[_0xb0ee('0x17')](removeEntity(_0x402189,null))[_0xb0ee('0x2b')](handleError(_0x402189,null));};exports[_0xb0ee('0x40')]=function(_0x17f3b6,_0x3283e1){return db[_0xb0ee('0x22')][_0xb0ee('0x40')]()['then'](respondWithResult(_0x3283e1,null))['catch'](handleError(_0x3283e1,null));};exports[_0xb0ee('0x41')]=function(_0x1c9b6f,_0x50104a){var _0x3ef149={'raw':!![],'where':{}},_0x524e15={},_0x36ff08;return db[_0xb0ee('0x22')][_0xb0ee('0x42')]({'where':{'id':_0x1c9b6f[_0xb0ee('0x2d')]['id']}})[_0xb0ee('0x17')](handleEntityNotFound(_0x50104a,null))[_0xb0ee('0x17')](function(_0x40dadd){if(_0x40dadd){_0x36ff08=_0x40dadd[_0xb0ee('0x18')]({'plain':!![]});_0x524e15[_0xb0ee('0x2e')]=_[_0xb0ee('0x2f')](db[_0xb0ee('0x43')]['rawAttributes']);_0x524e15['query']=_['keys'](_0x1c9b6f[_0xb0ee('0x28')]);_0x524e15[_0xb0ee('0x30')]=_['intersection'](_0x524e15[_0xb0ee('0x2e')],_0x524e15[_0xb0ee('0x28')]);_0x3ef149[_0xb0ee('0x33')]=_[_0xb0ee('0x31')](_0x524e15[_0xb0ee('0x2e')],qs[_0xb0ee('0x32')](_0x1c9b6f['query'][_0xb0ee('0x32')]));_0x3ef149[_0xb0ee('0x33')]=_0x3ef149['attributes'][_0xb0ee('0x44')]?_0x3ef149['attributes']:_0x524e15[_0xb0ee('0x2e')];if(!_0x1c9b6f[_0xb0ee('0x28')][_0xb0ee('0x45')]('nolimit')){_0x3ef149['limit']=qs[_0xb0ee('0x11')](_0x1c9b6f['query'][_0xb0ee('0x11')]);_0x3ef149[_0xb0ee('0x10')]=qs[_0xb0ee('0x10')](_0x1c9b6f[_0xb0ee('0x28')][_0xb0ee('0x10')]);}_0x3ef149[_0xb0ee('0x46')]=qs['sort'](_0x1c9b6f[_0xb0ee('0x28')][_0xb0ee('0x47')]);_0x3ef149['where']=qs[_0xb0ee('0x30')](_[_0xb0ee('0x48')](_0x1c9b6f[_0xb0ee('0x28')],_0x524e15[_0xb0ee('0x30')]));_0x3ef149[_0xb0ee('0x49')][_0xb0ee('0x4a')]=_0x40dadd['id'];if(_0x1c9b6f[_0xb0ee('0x28')]['filter']){_0x3ef149[_0xb0ee('0x49')]=_[_0xb0ee('0x35')](_0x3ef149[_0xb0ee('0x49')],{'$or':_['map'](_0x3ef149[_0xb0ee('0x33')],function(_0x2b64ae){var _0x92aba7={};_0x92aba7[_0x2b64ae]={'$like':'%'+_0x1c9b6f[_0xb0ee('0x28')]['filter']+'%'};return _0x92aba7;})});}_0x3ef149=_[_0xb0ee('0x35')]({},_0x3ef149,_0x1c9b6f[_0xb0ee('0x4b')]);return db[_0xb0ee('0x43')]['findAll'](_0x3ef149);}})[_0xb0ee('0x17')](function(_0x3c3acd){if(_0x3c3acd){return db[_0xb0ee('0x4c')][_0xb0ee('0x4d')]({'where':{'id':_[_0xb0ee('0x21')](_0x3c3acd,_0xb0ee('0x4e')),'role':_0xb0ee('0x4f')},'attributes':['id',_0xb0ee('0x1e'),'faxPause','updatedAt',_0xb0ee('0x50')]});}})[_0xb0ee('0x17')](function(_0x1ba436){if(_0x1ba436){return{'count':_0x1ba436[_0xb0ee('0x12')],'rows':_[_0xb0ee('0x21')](_0x1ba436['rows'],function(_0x2f6d08){return{'membername':_0x2f6d08['name'],'UserId':_0x2f6d08['id'],'queue_name':_0x36ff08[_0xb0ee('0x1e')],'FaxQueueId':_0x36ff08['id'],'interface':util['format']('%s/%s',_0xb0ee('0x51'),_0x2f6d08[_0xb0ee('0x1e')]),'penalty':0x0,'paused':_0x2f6d08[_0xb0ee('0x52')],'createdAt':_0x2f6d08[_0xb0ee('0x50')],'updatedAt':_0x2f6d08[_0xb0ee('0x53')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb0ee('0x17')](respondWithFilteredResult(_0x50104a,_0x3ef149))[_0xb0ee('0x2b')](handleError(_0x50104a,null));};exports[_0xb0ee('0x54')]=function(_0x155a88,_0x42645d){var _0x22870d={};var _0x5af70b={};var _0x499bfe;var _0x5194f9;return db[_0xb0ee('0x22')]['findOne']({'where':{'id':_0x155a88[_0xb0ee('0x2d')]['id']}})['then'](handleEntityNotFound(_0x42645d,null))['then'](function(_0xf5d411){if(_0xf5d411){_0x499bfe=_0xf5d411;_0x5af70b[_0xb0ee('0x2e')]=_['keys'](db[_0xb0ee('0x55')][_0xb0ee('0x23')]);_0x5af70b[_0xb0ee('0x28')]=_['keys'](_0x155a88[_0xb0ee('0x28')]);_0x5af70b[_0xb0ee('0x30')]=_[_0xb0ee('0x31')](_0x5af70b[_0xb0ee('0x2e')],_0x5af70b[_0xb0ee('0x28')]);_0x22870d[_0xb0ee('0x33')]=_[_0xb0ee('0x31')](_0x5af70b['model'],qs['fields'](_0x155a88[_0xb0ee('0x28')][_0xb0ee('0x32')]));_0x22870d[_0xb0ee('0x33')]=_0x22870d[_0xb0ee('0x33')][_0xb0ee('0x44')]?_0x22870d[_0xb0ee('0x33')]:_0x5af70b['model'];_0x22870d[_0xb0ee('0x46')]=qs['sort'](_0x155a88[_0xb0ee('0x28')][_0xb0ee('0x47')]);_0x22870d[_0xb0ee('0x49')]=qs['filters'](_['pick'](_0x155a88[_0xb0ee('0x28')],_0x5af70b[_0xb0ee('0x30')]));if(_0x155a88[_0xb0ee('0x28')][_0xb0ee('0x56')]){_0x22870d[_0xb0ee('0x49')]=_[_0xb0ee('0x35')](_0x22870d[_0xb0ee('0x49')],{'$or':_[_0xb0ee('0x21')](_0x22870d[_0xb0ee('0x33')],function(_0x3791de){var _0x8c10f0={};_0x8c10f0[_0x3791de]={'$like':'%'+_0x155a88['query'][_0xb0ee('0x56')]+'%'};return _0x8c10f0;})});}_0x22870d=_['merge']({},_0x22870d,_0x155a88[_0xb0ee('0x4b')]);return _0x499bfe[_0xb0ee('0x54')](_0x22870d);}})[_0xb0ee('0x17')](function(_0x46faf5){if(_0x46faf5){_0x5194f9=_0x46faf5[_0xb0ee('0x44')];if(!_0x155a88[_0xb0ee('0x28')][_0xb0ee('0x45')]('nolimit')){_0x22870d[_0xb0ee('0x11')]=qs[_0xb0ee('0x11')](_0x155a88[_0xb0ee('0x28')]['limit']);_0x22870d[_0xb0ee('0x10')]=qs[_0xb0ee('0x10')](_0x155a88[_0xb0ee('0x28')][_0xb0ee('0x10')]);}return _0x499bfe['getTeams'](_0x22870d);}})[_0xb0ee('0x17')](function(_0x181c0b){if(_0x181c0b){return _0x181c0b?{'count':_0x5194f9,'rows':_0x181c0b}:null;}})['then'](respondWithResult(_0x42645d,null))[_0xb0ee('0x2b')](handleError(_0x42645d,null));};exports['addTeams']=function(_0x102cff,_0x29f28b){var _0xe02a15=_0x102cff[_0xb0ee('0x38')][_0xb0ee('0x57')];return db[_0xb0ee('0x55')][_0xb0ee('0x29')]({'where':{'id':_0xe02a15},'attributes':['id'],'include':[{'model':db[_0xb0ee('0x4c')],'as':_0xb0ee('0x58'),'attributes':['id',_0xb0ee('0x1e'),_0xb0ee('0x59'),'voicePause',_0xb0ee('0x5a')],'raw':!![]}]})['then'](function(_0x1494f3){if(_0x1494f3){var _0x4d6fc7=_[_0xb0ee('0x5b')](_0x1494f3,function(_0x3b52b0){var _0x1d39b7=_0x3b52b0[_0xb0ee('0x18')]({'plain':!![]});return _0x1d39b7['Agents'];});return db[_0xb0ee('0x22')]['find']({'where':{'id':_0x102cff['params']['id']}})[_0xb0ee('0x17')](function(_0x4fecd8){return db[_0xb0ee('0x5c')][_0xb0ee('0x5d')](function(_0x3b2f87){return _0x4fecd8['addTeams'](_0xe02a15,{'transaction':_0x3b2f87})[_0xb0ee('0x17')](function(){return BPromise[_0xb0ee('0x5e')](_0x4d6fc7,function(_0xd22729){return db[_0xb0ee('0x43')][_0xb0ee('0x5f')]({'where':{'UserId':_0xd22729['id'],'FaxQueueId':_0x102cff[_0xb0ee('0x2d')]['id']},'transaction':_0x3b2f87});});})[_0xb0ee('0x17')](function(){_0x4d6fc7[_0xb0ee('0x60')](function(_0xa42bf2){socket[_0xb0ee('0x61')](_0xb0ee('0x62'),{'UserId':_0xa42bf2['id'],'FaxQueueId':_0x4fecd8['id']});});});});});}})[_0xb0ee('0x17')](respondWithStatusCode(_0x29f28b,null))['catch'](handleError(_0x29f28b,null));};exports['removeTeams']=function(_0x2effd1,_0x2e4f05){return db[_0xb0ee('0x55')][_0xb0ee('0x29')]({'where':{'id':_0x2effd1[_0xb0ee('0x28')]['ids']},'attributes':['id'],'include':[{'model':db[_0xb0ee('0x4c')],'as':_0xb0ee('0x58'),'attributes':['id'],'raw':!![]}]})[_0xb0ee('0x17')](handleEntityNotFound(_0x2e4f05,null))[_0xb0ee('0x17')](function(_0x40b397){var _0x3aa5b8=_[_0xb0ee('0x21')](_0x40b397,'id');var _0x31aa28=[];var _0x58a6f2=[];var _0x469126=squel[_0xb0ee('0x63')]();_0x469126['field'](_0xb0ee('0x64'))[_0xb0ee('0x65')]('team_has_fax_queues','tq')[_0xb0ee('0x66')](_0xb0ee('0x67'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xb0ee('0x49')](_0xb0ee('0x68'),_0x2effd1[_0xb0ee('0x2d')]['id']);for(var _0x4dba02=0x0;_0x4dba02<_0x40b397['length'];_0x4dba02+=0x1){let _0x1c6558=_0x40b397[_0x4dba02];for(var _0x32ea73=0x0;_0x32ea73<_0x1c6558[_0xb0ee('0x58')]['length'];_0x32ea73+=0x1){let _0xaf2cc0=_0x1c6558[_0xb0ee('0x58')][_0x32ea73];var _0x49a4e6=_0x469126['clone']();_0x49a4e6['where']('ut.UserId\x20=\x20?',_0xaf2cc0['id']);_0x58a6f2[_0xb0ee('0x69')](db[_0xb0ee('0x5c')][_0xb0ee('0x28')](_0x49a4e6['toString'](),{'type':db[_0xb0ee('0x5c')]['QueryTypes']['SELECT']})['then'](function(_0x59cc81){if(_0x59cc81[_0xb0ee('0x44')]===0x1){return _0xaf2cc0['id'];}else{var _0x345eb7=_['every'](_['map'](_0x59cc81,_0xb0ee('0x6a')),function(_0x12e203){return _['includes'](_0x3aa5b8,_0x12e203);});if(_0x345eb7){return _0xaf2cc0['id'];}}}));}}return BPromise['all'](_0x58a6f2)[_0xb0ee('0x17')](function(_0x4608f4){_0x31aa28=_(_0x31aa28)['union'](_0x4608f4)['compact']()[_0xb0ee('0x6b')]();return db['FaxQueue']['find']({'where':{'id':_0x2effd1[_0xb0ee('0x2d')]['id']}})[_0xb0ee('0x17')](function(_0x471e4a){return db[_0xb0ee('0x5c')][_0xb0ee('0x5d')](function(_0x146609){return _0x471e4a['removeTeams'](_0x2effd1[_0xb0ee('0x28')][_0xb0ee('0x57')],{'transaction':_0x146609})[_0xb0ee('0x17')](function(){if(!_['isEmpty'](_0x31aa28)){return _0x471e4a[_0xb0ee('0x6c')](_0x31aa28,{'transaction':_0x146609});}})['then'](function(){_0x31aa28[_0xb0ee('0x60')](function(_0x50d3c7){socket['emit'](_0xb0ee('0x6d'),{'UserId':_0x50d3c7,'FaxQueueId':_0x471e4a['id']});});});});});});})[_0xb0ee('0x17')](respondWithStatusCode(_0x2e4f05,null))['catch'](handleError(_0x2e4f05,null));};exports[_0xb0ee('0x6e')]=function(_0x1726ad,_0x30b111){return db[_0xb0ee('0x22')][_0xb0ee('0x36')]({'where':{'id':_0x1726ad[_0xb0ee('0x2d')]['id']}})[_0xb0ee('0x17')](handleEntityNotFound(_0x30b111,null))[_0xb0ee('0x17')](function(_0x222491){if(_0x222491){return _0x222491[_0xb0ee('0x6e')](_0x1726ad[_0xb0ee('0x38')][_0xb0ee('0x57')],_[_0xb0ee('0x6f')](_0x1726ad[_0xb0ee('0x38')],['ids','id'])||{})[_0xb0ee('0x70')](function(_0x2ba486){for(var _0x4a0b5b=0x0;_0x4a0b5b<_0x1726ad[_0xb0ee('0x38')]['ids'][_0xb0ee('0x44')];_0x4a0b5b+=0x1){socket['emit'](_0xb0ee('0x62'),{'UserId':Number(_0x1726ad['body'][_0xb0ee('0x57')][_0x4a0b5b]),'FaxQueueId':Number(_0x1726ad[_0xb0ee('0x2d')]['id'])});}return _0x2ba486;});}})[_0xb0ee('0x17')](respondWithResult(_0x30b111,null))[_0xb0ee('0x2b')](handleError(_0x30b111,null));};exports[_0xb0ee('0x6c')]=function(_0xf74391,_0x50a7c0){return db[_0xb0ee('0x22')][_0xb0ee('0x36')]({'where':{'id':_0xf74391[_0xb0ee('0x2d')]['id']}})[_0xb0ee('0x17')](handleEntityNotFound(_0x50a7c0,null))['then'](function(_0x351c45){if(_0x351c45){return _0x351c45['removeAgents'](_0xf74391[_0xb0ee('0x28')][_0xb0ee('0x57')])['then'](function(){if(_[_0xb0ee('0x71')](_0xf74391[_0xb0ee('0x28')]['ids'])){for(var _0x249c57=0x0;_0x249c57<_0xf74391['query'][_0xb0ee('0x57')][_0xb0ee('0x44')];_0x249c57+=0x1){socket['emit']('userFaxQueue:remove',{'UserId':Number(_0xf74391[_0xb0ee('0x28')][_0xb0ee('0x57')][_0x249c57]),'FaxQueueId':Number(_0xf74391[_0xb0ee('0x2d')]['id'])});}}else{socket[_0xb0ee('0x61')]('userFaxQueue:remove',{'UserId':Number(_0xf74391[_0xb0ee('0x28')][_0xb0ee('0x57')]),'FaxQueueId':Number(_0xf74391[_0xb0ee('0x2d')]['id'])});}});}})[_0xb0ee('0x17')](respondWithStatusCode(_0x50a7c0,null))[_0xb0ee('0x2b')](handleError(_0x50a7c0,null));};exports['getAgents']=function(_0x57872f,_0x10f6fa){var _0x51c4ed={};var _0x15f66f={};var _0x168d17;var _0x2e1d1a;return db[_0xb0ee('0x22')]['findOne']({'where':{'id':_0x57872f[_0xb0ee('0x2d')]['id']}})[_0xb0ee('0x17')](handleEntityNotFound(_0x10f6fa,null))[_0xb0ee('0x17')](function(_0x482ac5){if(_0x482ac5){_0x168d17=_0x482ac5;_0x15f66f[_0xb0ee('0x2e')]=_[_0xb0ee('0x2f')](db[_0xb0ee('0x4c')][_0xb0ee('0x23')]);_0x15f66f[_0xb0ee('0x28')]=_[_0xb0ee('0x2f')](_0x57872f['query']);_0x15f66f[_0xb0ee('0x30')]=_[_0xb0ee('0x31')](_0x15f66f[_0xb0ee('0x2e')],_0x15f66f[_0xb0ee('0x28')]);_0x51c4ed[_0xb0ee('0x33')]=_[_0xb0ee('0x31')](_0x15f66f[_0xb0ee('0x2e')],qs[_0xb0ee('0x32')](_0x57872f['query']['fields']));_0x51c4ed[_0xb0ee('0x33')]=_0x51c4ed[_0xb0ee('0x33')][_0xb0ee('0x44')]?_0x51c4ed['attributes']:_0x15f66f[_0xb0ee('0x2e')];_0x51c4ed[_0xb0ee('0x46')]=qs[_0xb0ee('0x47')](_0x57872f[_0xb0ee('0x28')]['sort']);_0x51c4ed['where']=qs['filters'](_[_0xb0ee('0x48')](_0x57872f[_0xb0ee('0x28')],_0x15f66f['filters']));if(_0x57872f[_0xb0ee('0x28')][_0xb0ee('0x56')]){_0x51c4ed[_0xb0ee('0x49')]=_[_0xb0ee('0x35')](_0x51c4ed[_0xb0ee('0x49')],{'$or':_['map'](_0x51c4ed[_0xb0ee('0x33')],function(_0x5e8e2f){var _0x21c451={};_0x21c451[_0x5e8e2f]={'$like':'%'+_0x57872f[_0xb0ee('0x28')]['filter']+'%'};return _0x21c451;})});}_0x51c4ed=_[_0xb0ee('0x35')]({},_0x51c4ed,_0x57872f[_0xb0ee('0x4b')]);return _0x168d17[_0xb0ee('0x72')](_0x51c4ed);}})[_0xb0ee('0x17')](function(_0x39ed3d){if(_0x39ed3d){_0x2e1d1a=_0x39ed3d['length'];if(!_0x57872f[_0xb0ee('0x28')][_0xb0ee('0x45')]('nolimit')){_0x51c4ed[_0xb0ee('0x11')]=qs[_0xb0ee('0x11')](_0x57872f[_0xb0ee('0x28')][_0xb0ee('0x11')]);_0x51c4ed[_0xb0ee('0x10')]=qs['offset'](_0x57872f['query']['offset']);}return _0x168d17[_0xb0ee('0x72')](_0x51c4ed);}})[_0xb0ee('0x17')](function(_0x3d9453){if(_0x3d9453){return _0x3d9453?{'count':_0x2e1d1a,'rows':_0x3d9453}:null;}})[_0xb0ee('0x17')](respondWithResult(_0x10f6fa,null))[_0xb0ee('0x2b')](handleError(_0x10f6fa,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 240deec..6c09aea 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 _0x9476=['remove','emit','hook','exports','events','../../mysqldb','FaxQueue','setMaxListeners','save','update'];(function(_0x325a7f,_0x34fca4){var _0x38e775=function(_0x3aa5c6){while(--_0x3aa5c6){_0x325a7f['push'](_0x325a7f['shift']());}};_0x38e775(++_0x34fca4);}(_0x9476,0x180));var _0x6947=function(_0x26e51e,_0x4938fe){_0x26e51e=_0x26e51e-0x0;var _0x29ff05=_0x9476[_0x26e51e];return _0x29ff05;};'use strict';var EventEmitter=require(_0x6947('0x0'));var FaxQueue=require(_0x6947('0x1'))['db'][_0x6947('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x6947('0x3')](0x0);var events={'afterCreate':_0x6947('0x4'),'afterUpdate':_0x6947('0x5'),'afterDestroy':_0x6947('0x6')};function emitEvent(_0x49b703){return function(_0x21f50a,_0x33f975,_0x43ef79){FaxQueueEvents[_0x6947('0x7')](_0x49b703+':'+_0x21f50a['id'],_0x21f50a);FaxQueueEvents['emit'](_0x49b703,_0x21f50a);_0x43ef79(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0x6947('0x8')](e,emitEvent(event));}}module[_0x6947('0x9')]=FaxQueueEvents; \ No newline at end of file +var _0x0cd0=['exports','../../mysqldb','FaxQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x9ea933,_0x565d76){var _0x4fdcd0=function(_0x1b1b59){while(--_0x1b1b59){_0x9ea933['push'](_0x9ea933['shift']());}};_0x4fdcd0(++_0x565d76);}(_0x0cd0,0x133));var _0x00cd=function(_0x45155d,_0xc2befc){_0x45155d=_0x45155d-0x0;var _0x1cd9cf=_0x0cd0[_0x45155d];return _0x1cd9cf;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x00cd('0x0'))['db'][_0x00cd('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x00cd('0x2')](0x0);var events={'afterCreate':_0x00cd('0x3'),'afterUpdate':_0x00cd('0x4'),'afterDestroy':_0x00cd('0x5')};function emitEvent(_0x559f73){return function(_0x203a02,_0x5ca169,_0x10bf29){FaxQueueEvents['emit'](_0x559f73+':'+_0x203a02['id'],_0x203a02);FaxQueueEvents[_0x00cd('0x6')](_0x559f73,_0x203a02);_0x10bf29(null);};}for(var e in events){if(events[_0x00cd('0x7')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0x00cd('0x8')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 9a9d777..0cc5065 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 _0x2be7=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','exports','FaxQueue','fax_queues'];(function(_0x139e6a,_0x443ab7){var _0x19c2ba=function(_0x5be05b){while(--_0x5be05b){_0x139e6a['push'](_0x139e6a['shift']());}};_0x19c2ba(++_0x443ab7);}(_0x2be7,0x1ba));var _0x72be=function(_0x206f02,_0x36f322){_0x206f02=_0x206f02-0x0;var _0x8a2663=_0x2be7[_0x206f02];return _0x8a2663;};'use strict';var _=require(_0x72be('0x0'));var util=require('util');var logger=require(_0x72be('0x1'))(_0x72be('0x2'));var moment=require(_0x72be('0x3'));var BPromise=require(_0x72be('0x4'));var rp=require(_0x72be('0x5'));var fs=require('fs');var path=require(_0x72be('0x6'));var rimraf=require(_0x72be('0x7'));var config=require(_0x72be('0x8'));var attributes=require(_0x72be('0x9'));module[_0x72be('0xa')]=function(_0x2ea9c1,_0x4f716b){return _0x2ea9c1['define'](_0x72be('0xb'),attributes,{'tableName':_0x72be('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x648a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','lodash','../../config/logger','api'];(function(_0x3a9a6a,_0x51afcd){var _0xc860c8=function(_0x4578b6){while(--_0x4578b6){_0x3a9a6a['push'](_0x3a9a6a['shift']());}};_0xc860c8(++_0x51afcd);}(_0x648a,0x1b9));var _0xa648=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x648a[_0x29d915];return _0x160f86;};'use strict';var _=require(_0xa648('0x0'));var util=require('util');var logger=require(_0xa648('0x1'))(_0xa648('0x2'));var moment=require(_0xa648('0x3'));var BPromise=require(_0xa648('0x4'));var rp=require(_0xa648('0x5'));var fs=require('fs');var path=require(_0xa648('0x6'));var rimraf=require(_0xa648('0x7'));var config=require(_0xa648('0x8'));var attributes=require(_0xa648('0x9'));module[_0xa648('0xa')]=function(_0x17d79a,_0x115270){return _0x17d79a[_0xa648('0xb')]('FaxQueue',attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index 570d882..45395a0 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 _0xcd77=['http','redis','localhost','./faxQueue.socket','register','then','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','include','map','model','attributes','ShowFaxQueue','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1f2412,_0x54f6e4){var _0x5df5af=function(_0x3a06f1){while(--_0x3a06f1){_0x1f2412['push'](_0x1f2412['shift']());}};_0x5df5af(++_0x54f6e4);}(_0xcd77,0xf9));var _0x7cd7=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xcd77[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var util=require(_0x7cd7('0x0'));var moment=require(_0x7cd7('0x1'));var BPromise=require(_0x7cd7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7cd7('0x3'));var db=require(_0x7cd7('0x4'))['db'];var utils=require(_0x7cd7('0x5'));var logger=require(_0x7cd7('0x6'))(_0x7cd7('0x7'));var config=require(_0x7cd7('0x8'));var jayson=require(_0x7cd7('0x9'));var client=jayson['client'][_0x7cd7('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x7cd7('0xb')],{'host':_0x7cd7('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7cd7('0xd'))[_0x7cd7('0xe')](socket);function respondWithRpcPromise(_0x32d229,_0x5b6fa1,_0x1e4193){return new BPromise(function(_0xc7bedd,_0x162692){return client['request'](_0x32d229,_0x1e4193)[_0x7cd7('0xf')](function(_0x363582){logger['info'](_0x7cd7('0x10'),_0x5b6fa1,_0x7cd7('0x11'));logger[_0x7cd7('0x12')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x5b6fa1,_0x7cd7('0x11'),JSON[_0x7cd7('0x13')](_0x363582));if(_0x363582[_0x7cd7('0x14')]){if(_0x363582[_0x7cd7('0x14')][_0x7cd7('0x15')]===0x1f4){logger['error']('FaxQueue,\x20%s,\x20%s',_0x5b6fa1,_0x363582['error'][_0x7cd7('0x16')]);return _0x162692(_0x363582[_0x7cd7('0x14')][_0x7cd7('0x16')]);}logger[_0x7cd7('0x14')](_0x7cd7('0x10'),_0x5b6fa1,_0x363582[_0x7cd7('0x14')]['message']);return _0xc7bedd(_0x363582[_0x7cd7('0x14')][_0x7cd7('0x16')]);}else{logger[_0x7cd7('0x17')](_0x7cd7('0x10'),_0x5b6fa1,_0x7cd7('0x11'));_0xc7bedd(_0x363582[_0x7cd7('0x18')][_0x7cd7('0x16')]);}})[_0x7cd7('0x19')](function(_0x1bbd46){logger[_0x7cd7('0x14')](_0x7cd7('0x10'),_0x5b6fa1,_0x1bbd46);_0x162692(_0x1bbd46);});});}exports[_0x7cd7('0x1a')]=function(_0x5e747f){var _0x40da64=this;return new Promise(function(_0x97a6aa,_0x15f023){return db[_0x7cd7('0x1b')][_0x7cd7('0x1c')]({'raw':_0x5e747f[_0x7cd7('0x1d')]?_0x5e747f[_0x7cd7('0x1d')][_0x7cd7('0x1e')]===undefined?!![]:![]:!![],'where':_0x5e747f[_0x7cd7('0x1d')]?_0x5e747f[_0x7cd7('0x1d')][_0x7cd7('0x1f')]||null:null,'attributes':_0x5e747f['options']?_0x5e747f[_0x7cd7('0x1d')]['attributes']||null:null,'limit':_0x5e747f[_0x7cd7('0x1d')]?_0x5e747f[_0x7cd7('0x1d')]['limit']||null:null,'include':_0x5e747f[_0x7cd7('0x1d')]?_0x5e747f[_0x7cd7('0x1d')][_0x7cd7('0x20')]?_[_0x7cd7('0x21')](_0x5e747f['options'][_0x7cd7('0x20')],function(_0x271f44){return{'model':db[_0x271f44[_0x7cd7('0x22')]],'as':_0x271f44['as'],'attributes':_0x271f44[_0x7cd7('0x23')],'include':_0x271f44[_0x7cd7('0x20')]?_['map'](_0x271f44[_0x7cd7('0x20')],function(_0x46ff23){return{'model':db[_0x46ff23[_0x7cd7('0x22')]],'as':_0x46ff23['as'],'attributes':_0x46ff23['attributes'],'include':_0x46ff23[_0x7cd7('0x20')]?_[_0x7cd7('0x21')](_0x46ff23['include'],function(_0x15ea9a){return{'model':db[_0x15ea9a['model']],'as':_0x15ea9a['as'],'attributes':_0x15ea9a['attributes']};}):[]};}):[]};}):[]:[]})[_0x7cd7('0xf')](function(_0x17b7d9){logger[_0x7cd7('0x17')](_0x7cd7('0x1a'),_0x5e747f);logger[_0x7cd7('0x12')](_0x7cd7('0x1a'),_0x5e747f,JSON[_0x7cd7('0x13')](_0x17b7d9));_0x97a6aa(_0x17b7d9);})[_0x7cd7('0x19')](function(_0x45dac1){logger[_0x7cd7('0x14')]('GetFaxQueue',_0x45dac1[_0x7cd7('0x16')],_0x5e747f);_0x15f023(_0x40da64[_0x7cd7('0x14')](0x1f4,_0x45dac1[_0x7cd7('0x16')]));});});};exports[_0x7cd7('0x24')]=function(_0x170588){var _0x164ae6=this;return new Promise(function(_0x40f80e,_0x2a6d37){return db[_0x7cd7('0x1b')]['find']({'raw':_0x170588[_0x7cd7('0x1d')]?_0x170588['options'][_0x7cd7('0x1e')]===undefined?!![]:![]:!![],'where':_0x170588[_0x7cd7('0x1d')]?_0x170588['options']['where']||null:null,'attributes':_0x170588[_0x7cd7('0x1d')]?_0x170588['options']['attributes']||null:null,'include':_0x170588[_0x7cd7('0x1d')]?_0x170588[_0x7cd7('0x1d')]['include']?_['map'](_0x170588[_0x7cd7('0x1d')][_0x7cd7('0x20')],function(_0x4cdc83){return{'model':db[_0x4cdc83[_0x7cd7('0x22')]],'as':_0x4cdc83['as'],'attributes':_0x4cdc83[_0x7cd7('0x23')],'include':_0x4cdc83[_0x7cd7('0x20')]?_[_0x7cd7('0x21')](_0x4cdc83[_0x7cd7('0x20')],function(_0x5e33f5){return{'model':db[_0x5e33f5['model']],'as':_0x5e33f5['as'],'attributes':_0x5e33f5[_0x7cd7('0x23')],'include':_0x5e33f5['include']?_['map'](_0x5e33f5[_0x7cd7('0x20')],function(_0x30af76){return{'model':db[_0x30af76['model']],'as':_0x30af76['as'],'attributes':_0x30af76[_0x7cd7('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x39445d){logger[_0x7cd7('0x17')](_0x7cd7('0x24'),_0x170588);logger[_0x7cd7('0x12')](_0x7cd7('0x24'),_0x170588,JSON[_0x7cd7('0x13')](_0x39445d));_0x40f80e(_0x39445d);})[_0x7cd7('0x19')](function(_0x57b0a8){logger[_0x7cd7('0x14')]('ShowFaxQueue',_0x57b0a8[_0x7cd7('0x16')],_0x170588);_0x2a6d37(_0x164ae6['error'](0x1f4,_0x57b0a8[_0x7cd7('0x16')]));});});}; \ No newline at end of file +var _0x6dc9=['options','raw','attributes','map','include','model','catch','ShowFaxQueue','FaxQueue','find','where','lodash','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetFaxQueue','findAll'];(function(_0x4d2012,_0x563a22){var _0x3bdc94=function(_0x1400c9){while(--_0x1400c9){_0x4d2012['push'](_0x4d2012['shift']());}};_0x3bdc94(++_0x563a22);}(_0x6dc9,0x11c));var _0x96dc=function(_0x5c62fc,_0x41431a){_0x5c62fc=_0x5c62fc-0x0;var _0x14c817=_0x6dc9[_0x5c62fc];return _0x14c817;};'use strict';var _=require(_0x96dc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x96dc('0x1'));var fs=require('fs');var Redis=require(_0x96dc('0x2'));var db=require(_0x96dc('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x96dc('0x4'))(_0x96dc('0x5'));var config=require('../../config/environment');var jayson=require(_0x96dc('0x6'));var client=jayson[_0x96dc('0x7')][_0x96dc('0x8')]({'port':0x232a});config[_0x96dc('0x9')]=_[_0x96dc('0xa')](config['redis'],{'host':_0x96dc('0xb'),'port':0x18eb});var socket=require(_0x96dc('0xc'))(new Redis(config[_0x96dc('0x9')]));require(_0x96dc('0xd'))[_0x96dc('0xe')](socket);function respondWithRpcPromise(_0x3c5543,_0x164504,_0x796f36){return new BPromise(function(_0x51508c,_0x329443){return client[_0x96dc('0xf')](_0x3c5543,_0x796f36)[_0x96dc('0x10')](function(_0x5bb42a){logger[_0x96dc('0x11')](_0x96dc('0x12'),_0x164504,_0x96dc('0x13'));logger[_0x96dc('0x14')](_0x96dc('0x15'),_0x164504,_0x96dc('0x13'),JSON[_0x96dc('0x16')](_0x5bb42a));if(_0x5bb42a[_0x96dc('0x17')]){if(_0x5bb42a[_0x96dc('0x17')]['code']===0x1f4){logger[_0x96dc('0x17')](_0x96dc('0x12'),_0x164504,_0x5bb42a[_0x96dc('0x17')][_0x96dc('0x18')]);return _0x329443(_0x5bb42a[_0x96dc('0x17')][_0x96dc('0x18')]);}logger['error'](_0x96dc('0x12'),_0x164504,_0x5bb42a[_0x96dc('0x17')][_0x96dc('0x18')]);return _0x51508c(_0x5bb42a[_0x96dc('0x17')][_0x96dc('0x18')]);}else{logger[_0x96dc('0x11')]('FaxQueue,\x20%s,\x20%s',_0x164504,_0x96dc('0x13'));_0x51508c(_0x5bb42a[_0x96dc('0x19')][_0x96dc('0x18')]);}})['catch'](function(_0x377af7){logger[_0x96dc('0x17')](_0x96dc('0x12'),_0x164504,_0x377af7);_0x329443(_0x377af7);});});}exports[_0x96dc('0x1a')]=function(_0x5e602d){var _0x524e2a=this;return new Promise(function(_0x94f29a,_0x1d9f9f){return db['FaxQueue'][_0x96dc('0x1b')]({'raw':_0x5e602d[_0x96dc('0x1c')]?_0x5e602d[_0x96dc('0x1c')][_0x96dc('0x1d')]===undefined?!![]:![]:!![],'where':_0x5e602d[_0x96dc('0x1c')]?_0x5e602d['options']['where']||null:null,'attributes':_0x5e602d[_0x96dc('0x1c')]?_0x5e602d['options'][_0x96dc('0x1e')]||null:null,'limit':_0x5e602d['options']?_0x5e602d['options']['limit']||null:null,'include':_0x5e602d[_0x96dc('0x1c')]?_0x5e602d[_0x96dc('0x1c')]['include']?_[_0x96dc('0x1f')](_0x5e602d[_0x96dc('0x1c')][_0x96dc('0x20')],function(_0x52dbbd){return{'model':db[_0x52dbbd[_0x96dc('0x21')]],'as':_0x52dbbd['as'],'attributes':_0x52dbbd[_0x96dc('0x1e')],'include':_0x52dbbd['include']?_['map'](_0x52dbbd[_0x96dc('0x20')],function(_0x388083){return{'model':db[_0x388083['model']],'as':_0x388083['as'],'attributes':_0x388083[_0x96dc('0x1e')],'include':_0x388083['include']?_['map'](_0x388083[_0x96dc('0x20')],function(_0x3d3835){return{'model':db[_0x3d3835[_0x96dc('0x21')]],'as':_0x3d3835['as'],'attributes':_0x3d3835['attributes']};}):[]};}):[]};}):[]:[]})[_0x96dc('0x10')](function(_0x5f025a){logger[_0x96dc('0x11')]('GetFaxQueue',_0x5e602d);logger[_0x96dc('0x14')](_0x96dc('0x1a'),_0x5e602d,JSON[_0x96dc('0x16')](_0x5f025a));_0x94f29a(_0x5f025a);})[_0x96dc('0x22')](function(_0x6bacef){logger[_0x96dc('0x17')](_0x96dc('0x1a'),_0x6bacef['message'],_0x5e602d);_0x1d9f9f(_0x524e2a['error'](0x1f4,_0x6bacef['message']));});});};exports[_0x96dc('0x23')]=function(_0x52e0b7){var _0x3c55e9=this;return new Promise(function(_0x3eb1f1,_0x4c6b36){return db[_0x96dc('0x24')][_0x96dc('0x25')]({'raw':_0x52e0b7[_0x96dc('0x1c')]?_0x52e0b7[_0x96dc('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x52e0b7[_0x96dc('0x1c')]?_0x52e0b7[_0x96dc('0x1c')][_0x96dc('0x26')]||null:null,'attributes':_0x52e0b7['options']?_0x52e0b7[_0x96dc('0x1c')][_0x96dc('0x1e')]||null:null,'include':_0x52e0b7[_0x96dc('0x1c')]?_0x52e0b7[_0x96dc('0x1c')]['include']?_[_0x96dc('0x1f')](_0x52e0b7[_0x96dc('0x1c')][_0x96dc('0x20')],function(_0x468b2d){return{'model':db[_0x468b2d[_0x96dc('0x21')]],'as':_0x468b2d['as'],'attributes':_0x468b2d[_0x96dc('0x1e')],'include':_0x468b2d[_0x96dc('0x20')]?_[_0x96dc('0x1f')](_0x468b2d[_0x96dc('0x20')],function(_0x15b485){return{'model':db[_0x15b485[_0x96dc('0x21')]],'as':_0x15b485['as'],'attributes':_0x15b485[_0x96dc('0x1e')],'include':_0x15b485[_0x96dc('0x20')]?_[_0x96dc('0x1f')](_0x15b485[_0x96dc('0x20')],function(_0x3af672){return{'model':db[_0x3af672[_0x96dc('0x21')]],'as':_0x3af672['as'],'attributes':_0x3af672[_0x96dc('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x96dc('0x10')](function(_0x2a048b){logger[_0x96dc('0x11')](_0x96dc('0x23'),_0x52e0b7);logger[_0x96dc('0x14')](_0x96dc('0x23'),_0x52e0b7,JSON[_0x96dc('0x16')](_0x2a048b));_0x3eb1f1(_0x2a048b);})[_0x96dc('0x22')](function(_0x5b2498){logger[_0x96dc('0x17')](_0x96dc('0x23'),_0x5b2498['message'],_0x52e0b7);_0x4c6b36(_0x3c55e9[_0x96dc('0x17')](0x1f4,_0x5b2498[_0x96dc('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 0359047..f0019dc 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 _0x34e7=['length','faxQueue:','save','update','emit','removeListener'];(function(_0x363f49,_0x10fc31){var _0x333549=function(_0x560411){while(--_0x560411){_0x363f49['push'](_0x363f49['shift']());}};_0x333549(++_0x10fc31);}(_0x34e7,0x1be));var _0x734e=function(_0x53bec3,_0x550a58){_0x53bec3=_0x53bec3-0x0;var _0x159317=_0x34e7[_0x53bec3];return _0x159317;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0x734e('0x0'),'remove',_0x734e('0x1')];function createListener(_0x406401,_0x140beb){return function(_0x211af6){_0x140beb[_0x734e('0x2')](_0x406401,_0x211af6);};}function removeListener(_0x595fe5,_0x17e092){return function(){FaxQueueEvents[_0x734e('0x3')](_0x595fe5,_0x17e092);};}exports['register']=function(_0x316150){for(var _0x2fbc34=0x0,_0x2548c6=events[_0x734e('0x4')];_0x2fbc34<_0x2548c6;_0x2fbc34++){var _0x162a30=events[_0x2fbc34];var _0x2dde76=createListener(_0x734e('0x5')+_0x162a30,_0x316150);FaxQueueEvents['on'](_0x162a30,_0x2dde76);}}; \ No newline at end of file +var _0xc521=['remove','update','emit','removeListener','register','length','faxQueue:','./faxQueue.events'];(function(_0x2e4048,_0x374fcf){var _0x150fee=function(_0x12d210){while(--_0x12d210){_0x2e4048['push'](_0x2e4048['shift']());}};_0x150fee(++_0x374fcf);}(_0xc521,0x67));var _0x1c52=function(_0x340d00,_0x577752){_0x340d00=_0x340d00-0x0;var _0x426eaf=_0xc521[_0x340d00];return _0x426eaf;};'use strict';var FaxQueueEvents=require(_0x1c52('0x0'));var events=['save',_0x1c52('0x1'),_0x1c52('0x2')];function createListener(_0x4b232d,_0x1d7fe8){return function(_0x5f320d){_0x1d7fe8[_0x1c52('0x3')](_0x4b232d,_0x5f320d);};}function removeListener(_0xbc2573,_0x1a4968){return function(){FaxQueueEvents[_0x1c52('0x4')](_0xbc2573,_0x1a4968);};}exports[_0x1c52('0x5')]=function(_0x10bb97){for(var _0x200a88=0x0,_0x14b2c6=events[_0x1c52('0x6')];_0x200a88<_0x14b2c6;_0x200a88++){var _0x5dedab=events[_0x200a88];var _0x4b89c4=createListener(_0x1c52('0x7')+_0x5dedab,_0x10bb97);FaxQueueEvents['on'](_0x5dedab,_0x4b89c4);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 5098370..5a3dad7 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 _0x4991=['addAgents','put','update','destroy','delete','/:id/teams','removeAgents','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/members','getMembers','getTeams','getAgents','post','create','addTeams','/:id/users'];(function(_0x3906f7,_0x234aad){var _0x5e0623=function(_0x523ec1){while(--_0x523ec1){_0x3906f7['push'](_0x3906f7['shift']());}};_0x5e0623(++_0x234aad);}(_0x4991,0xf7));var _0x1499=function(_0x1342db,_0x4df1f1){_0x1342db=_0x1342db-0x0;var _0x39170e=_0x4991[_0x1342db];return _0x39170e;};'use strict';var multer=require(_0x1499('0x0'));var util=require('util');var path=require(_0x1499('0x1'));var timeout=require('connect-timeout');var express=require(_0x1499('0x2'));var router=express[_0x1499('0x3')]();var fs_extra=require(_0x1499('0x4'));var auth=require(_0x1499('0x5'));var interaction=require(_0x1499('0x6'));var config=require(_0x1499('0x7'));var controller=require(_0x1499('0x8'));router[_0x1499('0x9')]('/',auth['isAuthenticated'](),controller[_0x1499('0xa')]);router[_0x1499('0x9')](_0x1499('0xb'),auth[_0x1499('0xc')](),controller[_0x1499('0xd')]);router[_0x1499('0x9')](_0x1499('0xe'),auth[_0x1499('0xc')](),controller['show']);router[_0x1499('0x9')](_0x1499('0xf'),auth['isAuthenticated'](),controller[_0x1499('0x10')]);router[_0x1499('0x9')]('/:id/teams',auth[_0x1499('0xc')](),controller[_0x1499('0x11')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x1499('0x12')]);router[_0x1499('0x13')]('/',auth[_0x1499('0xc')](),controller[_0x1499('0x14')]);router[_0x1499('0x13')]('/:id/teams',auth['isAuthenticated'](),controller[_0x1499('0x15')]);router['post'](_0x1499('0x16'),auth[_0x1499('0xc')](),controller[_0x1499('0x17')]);router[_0x1499('0x18')]('/:id',auth[_0x1499('0xc')](),controller[_0x1499('0x19')]);router['delete'](_0x1499('0xe'),auth[_0x1499('0xc')](),controller[_0x1499('0x1a')]);router[_0x1499('0x1b')](_0x1499('0x1c'),auth[_0x1499('0xc')](),controller['removeTeams']);router['delete']('/:id/users',auth[_0x1499('0xc')](),controller[_0x1499('0x1d')]);module['exports']=router; \ No newline at end of file +var _0xcf98=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','/:id','destroy','removeTeams','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','show'];(function(_0x3616bb,_0x86fe00){var _0x1c0994=function(_0x46a1d4){while(--_0x46a1d4){_0x3616bb['push'](_0x3616bb['shift']());}};_0x1c0994(++_0x86fe00);}(_0xcf98,0x8d));var _0x8cf9=function(_0x2bbd08,_0x4e8b4f){_0x2bbd08=_0x2bbd08-0x0;var _0x536c93=_0xcf98[_0x2bbd08];return _0x536c93;};'use strict';var multer=require('multer');var util=require(_0x8cf9('0x0'));var path=require(_0x8cf9('0x1'));var timeout=require(_0x8cf9('0x2'));var express=require(_0x8cf9('0x3'));var router=express[_0x8cf9('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8cf9('0x5'));var config=require(_0x8cf9('0x6'));var controller=require(_0x8cf9('0x7'));router[_0x8cf9('0x8')]('/',auth[_0x8cf9('0x9')](),controller[_0x8cf9('0xa')]);router[_0x8cf9('0x8')](_0x8cf9('0xb'),auth[_0x8cf9('0x9')](),controller[_0x8cf9('0xc')]);router[_0x8cf9('0x8')]('/:id',auth[_0x8cf9('0x9')](),controller[_0x8cf9('0xd')]);router['get'](_0x8cf9('0xe'),auth['isAuthenticated'](),controller[_0x8cf9('0xf')]);router[_0x8cf9('0x8')](_0x8cf9('0x10'),auth[_0x8cf9('0x9')](),controller[_0x8cf9('0x11')]);router[_0x8cf9('0x8')](_0x8cf9('0x12'),auth['isAuthenticated'](),controller[_0x8cf9('0x13')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x8cf9('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x8cf9('0x15')]);router[_0x8cf9('0x14')](_0x8cf9('0x12'),auth['isAuthenticated'](),controller[_0x8cf9('0x16')]);router[_0x8cf9('0x17')]('/:id',auth[_0x8cf9('0x9')](),controller[_0x8cf9('0x18')]);router[_0x8cf9('0x19')](_0x8cf9('0x1a'),auth[_0x8cf9('0x9')](),controller[_0x8cf9('0x1b')]);router[_0x8cf9('0x19')](_0x8cf9('0x10'),auth[_0x8cf9('0x9')](),controller[_0x8cf9('0x1c')]);router[_0x8cf9('0x19')](_0x8cf9('0x12'),auth[_0x8cf9('0x9')](),controller[_0x8cf9('0x1d')]);module[_0x8cf9('0x1e')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index f65a9a5..181acd8 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 _0x85da=['STRING','DATE','moment','exports'];(function(_0x428f32,_0xba79ad){var _0x9e6f89=function(_0x5cf6c8){while(--_0x5cf6c8){_0x428f32['push'](_0x428f32['shift']());}};_0x9e6f89(++_0xba79ad);}(_0x85da,0x1ae));var _0xa85d=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x85da[_0x57b54c];return _0x59cc19;};'use strict';var moment=require(_0xa85d('0x0'));var Sequelize=require('sequelize');module[_0xa85d('0x1')]={'uniqueid':{'type':Sequelize[_0xa85d('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xa85d('0x2')]},'joinAt':{'type':Sequelize[_0xa85d('0x3')]},'leaveAt':{'type':Sequelize[_0xa85d('0x3')]},'acceptAt':{'type':Sequelize[_0xa85d('0x3')]},'exitAt':{'type':Sequelize[_0xa85d('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4b12=['STRING','DATE','moment','sequelize'];(function(_0x27480c,_0x55cde9){var _0x425b8d=function(_0x1cc97d){while(--_0x1cc97d){_0x27480c['push'](_0x27480c['shift']());}};_0x425b8d(++_0x55cde9);}(_0x4b12,0x14a));var _0x24b1=function(_0x3eb922,_0x30769a){_0x3eb922=_0x3eb922-0x0;var _0x4c8769=_0x4b12[_0x3eb922];return _0x4c8769;};'use strict';var moment=require(_0x24b1('0x0'));var Sequelize=require(_0x24b1('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x24b1('0x2')]},'joinAt':{'type':Sequelize[_0x24b1('0x3')]},'leaveAt':{'type':Sequelize[_0x24b1('0x3')]},'acceptAt':{'type':Sequelize[_0x24b1('0x3')]},'exitAt':{'type':Sequelize[_0x24b1('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 725c054..e5dd50f 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 _0x422f=['FaxQueueReport','fieldName','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','type','VIRTUAL','findAll','rows','show','params','rawAttributes','length','includeAll','include','merge','options','find','body','catch','describe','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','map'];(function(_0x44c14b,_0x29b7e4){var _0xcf6b96=function(_0x5eef5b){while(--_0x5eef5b){_0x44c14b['push'](_0x44c14b['shift']());}};_0xcf6b96(++_0x29b7e4);}(_0x422f,0x1c7));var _0xf422=function(_0x261960,_0x4e66d1){_0x261960=_0x261960-0x0;var _0x14526d=_0x422f[_0x261960];return _0x14526d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf422('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf422('0x1'));var rp=require(_0xf422('0x2'));var moment=require('moment');var BPromise=require(_0xf422('0x3'));var Mustache=require(_0xf422('0x4'));var util=require(_0xf422('0x5'));var path=require(_0xf422('0x6'));var sox=require(_0xf422('0x7'));var csv=require(_0xf422('0x8'));var ejs=require(_0xf422('0x9'));var fs=require('fs');var fs_extra=require(_0xf422('0xa'));var _=require(_0xf422('0xb'));var squel=require('squel');var crypto=require(_0xf422('0xc'));var jsforce=require(_0xf422('0xd'));var deskjs=require(_0xf422('0xe'));var toCsv=require(_0xf422('0x8'));var querystring=require(_0xf422('0xf'));var Papa=require('papaparse');var Redis=require(_0xf422('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf422('0x11'));var hardwareService=require(_0xf422('0x12'));var logger=require(_0xf422('0x13'))(_0xf422('0x14'));var utils=require(_0xf422('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf422('0x16'));var db=require(_0xf422('0x17'))['db'];function respondWithStatusCode(_0x4d56d1,_0x133a6a){_0x133a6a=_0x133a6a||0xcc;return function(_0x8aa9cc){if(_0x8aa9cc){return _0x4d56d1[_0xf422('0x18')](_0x133a6a);}return _0x4d56d1[_0xf422('0x19')](_0x133a6a)[_0xf422('0x1a')]();};}function respondWithResult(_0x28a6a8,_0x223b21){_0x223b21=_0x223b21||0xc8;return function(_0x272430){if(_0x272430){return _0x28a6a8[_0xf422('0x19')](_0x223b21)['json'](_0x272430);}};}function respondWithFilteredResult(_0x54bb9c,_0x52f96b){return function(_0x1c81e1){if(_0x1c81e1){var _0x30b70a=typeof _0x52f96b[_0xf422('0x1b')]===_0xf422('0x1c')&&typeof _0x52f96b['limit']===_0xf422('0x1c');var _0x264964=_0x1c81e1[_0xf422('0x1d')];var _0x2ae133=_0x30b70a?0x0:_0x52f96b[_0xf422('0x1b')];var _0x29b0b1=_0x30b70a?_0x1c81e1['count']:_0x52f96b['offset']+_0x52f96b[_0xf422('0x1e')];var _0x4b657;if(_0x29b0b1>=_0x264964){_0x29b0b1=_0x264964;_0x4b657=0xc8;}else{_0x4b657=0xce;}_0x54bb9c[_0xf422('0x19')](_0x4b657);return _0x54bb9c['set'](_0xf422('0x1f'),_0x2ae133+'-'+_0x29b0b1+'/'+_0x264964)['json'](_0x1c81e1);}return null;};}function patchUpdates(_0x22afe7){return function(_0x15833b){try{jsonpatch[_0xf422('0x20')](_0x15833b,_0x22afe7,!![]);}catch(_0x4d6717){return BPromise[_0xf422('0x21')](_0x4d6717);}return _0x15833b[_0xf422('0x22')]();};}function saveUpdates(_0x511529,_0x4b80a0){return function(_0x268575){if(_0x268575){return _0x268575[_0xf422('0x23')](_0x511529)['then'](function(_0x25b6a5){return _0x25b6a5;});}return null;};}function removeEntity(_0x570ea2,_0x3b21a5){return function(_0x32ceee){if(_0x32ceee){return _0x32ceee[_0xf422('0x24')]()[_0xf422('0x25')](function(){_0x570ea2[_0xf422('0x19')](0xcc)[_0xf422('0x1a')]();});}};}function handleEntityNotFound(_0xd8d70f,_0x11d10b){return function(_0x5dcab4){if(!_0x5dcab4){_0xd8d70f[_0xf422('0x18')](0x194);}return _0x5dcab4;};}function handleError(_0x59d03d,_0x2f0f9f){_0x2f0f9f=_0x2f0f9f||0x1f4;return function(_0x7d36e7){logger[_0xf422('0x26')](_0x7d36e7[_0xf422('0x27')]);if(_0x7d36e7[_0xf422('0x28')]){delete _0x7d36e7[_0xf422('0x28')];}_0x59d03d[_0xf422('0x19')](_0x2f0f9f)['send'](_0x7d36e7);};}exports['index']=function(_0x35d1fa,_0x10d51b){var _0x266fb8={},_0x33ef63={},_0xefb99e={'count':0x0,'rows':[]};var _0x48e0c7=_[_0xf422('0x29')](db[_0xf422('0x2a')]['rawAttributes'],function(_0x5f0186){return{'name':_0x5f0186[_0xf422('0x2b')],'type':_0x5f0186['type']['key']};});_0x33ef63[_0xf422('0x2c')]=_[_0xf422('0x29')](_0x48e0c7,'name');_0x33ef63[_0xf422('0x2d')]=_[_0xf422('0x2e')](_0x35d1fa[_0xf422('0x2d')]);_0x33ef63[_0xf422('0x2f')]=_[_0xf422('0x30')](_0x33ef63['model'],_0x33ef63[_0xf422('0x2d')]);_0x266fb8['attributes']=_[_0xf422('0x30')](_0x33ef63[_0xf422('0x2c')],qs[_0xf422('0x31')](_0x35d1fa[_0xf422('0x2d')][_0xf422('0x31')]));_0x266fb8[_0xf422('0x32')]=_0x266fb8[_0xf422('0x32')]['length']?_0x266fb8['attributes']:_0x33ef63[_0xf422('0x2c')];if(!_0x35d1fa[_0xf422('0x2d')]['hasOwnProperty'](_0xf422('0x33'))){_0x266fb8[_0xf422('0x1e')]=qs[_0xf422('0x1e')](_0x35d1fa[_0xf422('0x2d')][_0xf422('0x1e')]);_0x266fb8[_0xf422('0x1b')]=qs[_0xf422('0x1b')](_0x35d1fa[_0xf422('0x2d')][_0xf422('0x1b')]);}_0x266fb8[_0xf422('0x34')]=qs[_0xf422('0x35')](_0x35d1fa[_0xf422('0x2d')][_0xf422('0x35')]);_0x266fb8[_0xf422('0x36')]=qs['filters'](_['pick'](_0x35d1fa['query'],_0x33ef63[_0xf422('0x2f')]),_0x48e0c7);if(_0x35d1fa[_0xf422('0x2d')]['filter']){_0x266fb8[_0xf422('0x36')]=_['merge'](_0x266fb8[_0xf422('0x36')],{'$or':_[_0xf422('0x29')](_0x48e0c7,function(_0x55ac68){if(_0x55ac68[_0xf422('0x37')]!==_0xf422('0x38')){var _0x174f6f={};_0x174f6f[_0x55ac68['name']]={'$like':'%'+_0x35d1fa[_0xf422('0x2d')]['filter']+'%'};return _0x174f6f;}})});}_0x266fb8=_['merge']({},_0x266fb8,_0x35d1fa['options']);var _0x112bce={'where':_0x266fb8[_0xf422('0x36')]};return db[_0xf422('0x2a')][_0xf422('0x1d')](_0x112bce)[_0xf422('0x25')](function(_0x2f82a0){_0xefb99e[_0xf422('0x1d')]=_0x2f82a0;if(_0x35d1fa[_0xf422('0x2d')]['includeAll']){_0x266fb8['include']=[{'all':!![]}];}return db[_0xf422('0x2a')][_0xf422('0x39')](_0x266fb8);})[_0xf422('0x25')](function(_0xb3955){_0xefb99e[_0xf422('0x3a')]=_0xb3955;return _0xefb99e;})[_0xf422('0x25')](respondWithFilteredResult(_0x10d51b,_0x266fb8))['catch'](handleError(_0x10d51b,null));};exports[_0xf422('0x3b')]=function(_0x4f453a,_0x17c1f2){var _0x391e3c={'raw':!![],'where':{'id':_0x4f453a[_0xf422('0x3c')]['id']}},_0x564041={};_0x564041[_0xf422('0x2c')]=_[_0xf422('0x2e')](db[_0xf422('0x2a')][_0xf422('0x3d')]);_0x564041['query']=_[_0xf422('0x2e')](_0x4f453a[_0xf422('0x2d')]);_0x564041[_0xf422('0x2f')]=_[_0xf422('0x30')](_0x564041[_0xf422('0x2c')],_0x564041['query']);_0x391e3c[_0xf422('0x32')]=_[_0xf422('0x30')](_0x564041['model'],qs[_0xf422('0x31')](_0x4f453a['query'][_0xf422('0x31')]));_0x391e3c[_0xf422('0x32')]=_0x391e3c[_0xf422('0x32')][_0xf422('0x3e')]?_0x391e3c[_0xf422('0x32')]:_0x564041[_0xf422('0x2c')];if(_0x4f453a[_0xf422('0x2d')][_0xf422('0x3f')]){_0x391e3c[_0xf422('0x40')]=[{'all':!![]}];}_0x391e3c=_[_0xf422('0x41')]({},_0x391e3c,_0x4f453a[_0xf422('0x42')]);return db[_0xf422('0x2a')][_0xf422('0x43')](_0x391e3c)[_0xf422('0x25')](handleEntityNotFound(_0x17c1f2,null))[_0xf422('0x25')](respondWithResult(_0x17c1f2,null))['catch'](handleError(_0x17c1f2,null));};exports['create']=function(_0x3c59dd,_0x2c2ce9){return db[_0xf422('0x2a')]['create'](_0x3c59dd[_0xf422('0x44')],{})[_0xf422('0x25')](respondWithResult(_0x2c2ce9,0xc9))[_0xf422('0x45')](handleError(_0x2c2ce9,null));};exports[_0xf422('0x23')]=function(_0x1f3a30,_0x259e24){if(_0x1f3a30[_0xf422('0x44')]['id']){delete _0x1f3a30['body']['id'];}return db[_0xf422('0x2a')]['find']({'where':{'id':_0x1f3a30[_0xf422('0x3c')]['id']}})[_0xf422('0x25')](handleEntityNotFound(_0x259e24,null))['then'](saveUpdates(_0x1f3a30[_0xf422('0x44')],null))[_0xf422('0x25')](respondWithResult(_0x259e24,null))[_0xf422('0x45')](handleError(_0x259e24,null));};exports[_0xf422('0x24')]=function(_0x2df71a,_0x5c3cb8){return db['FaxQueueReport'][_0xf422('0x43')]({'where':{'id':_0x2df71a['params']['id']}})[_0xf422('0x25')](handleEntityNotFound(_0x5c3cb8,null))[_0xf422('0x25')](removeEntity(_0x5c3cb8,null))[_0xf422('0x45')](handleError(_0x5c3cb8,null));};exports[_0xf422('0x46')]=function(_0x4b4de4,_0x4b8b1f){return db[_0xf422('0x2a')][_0xf422('0x46')]()[_0xf422('0x25')](respondWithResult(_0x4b8b1f,null))[_0xf422('0x45')](handleError(_0x4b8b1f,null));}; \ No newline at end of file +var _0x1789=['create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','FaxQueueReport','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','map','VIRTUAL','merge','options','includeAll','findAll','find','catch'];(function(_0x14bbf1,_0xb3abf7){var _0x69e8e=function(_0x4c7fc8){while(--_0x4c7fc8){_0x14bbf1['push'](_0x14bbf1['shift']());}};_0x69e8e(++_0xb3abf7);}(_0x1789,0x92));var _0x9178=function(_0x487177,_0x1ddcd6){_0x487177=_0x487177-0x0;var _0x147202=_0x1789[_0x487177];return _0x147202;};'use strict';var emlformat=require(_0x9178('0x0'));var rimraf=require(_0x9178('0x1'));var zipdir=require(_0x9178('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9178('0x3'));var moment=require(_0x9178('0x4'));var BPromise=require(_0x9178('0x5'));var Mustache=require(_0x9178('0x6'));var util=require(_0x9178('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x9178('0x8'));var ejs=require(_0x9178('0x9'));var fs=require('fs');var fs_extra=require(_0x9178('0xa'));var _=require(_0x9178('0xb'));var squel=require('squel');var crypto=require(_0x9178('0xc'));var jsforce=require(_0x9178('0xd'));var deskjs=require(_0x9178('0xe'));var toCsv=require(_0x9178('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9178('0xf'));var qs=require(_0x9178('0x10'));var as=require(_0x9178('0x11'));var hardwareService=require(_0x9178('0x12'));var logger=require('../../config/logger')(_0x9178('0x13'));var utils=require(_0x9178('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1400a4,_0x321d98){_0x321d98=_0x321d98||0xcc;return function(_0x593e69){if(_0x593e69){return _0x1400a4[_0x9178('0x15')](_0x321d98);}return _0x1400a4[_0x9178('0x16')](_0x321d98)[_0x9178('0x17')]();};}function respondWithResult(_0x496489,_0x2daff3){_0x2daff3=_0x2daff3||0xc8;return function(_0x17f1be){if(_0x17f1be){return _0x496489['status'](_0x2daff3)[_0x9178('0x18')](_0x17f1be);}};}function respondWithFilteredResult(_0x4d931e,_0x4281aa){return function(_0x703536){if(_0x703536){var _0x26eeb9=typeof _0x4281aa[_0x9178('0x19')]===_0x9178('0x1a')&&typeof _0x4281aa[_0x9178('0x1b')]===_0x9178('0x1a');var _0x22b462=_0x703536[_0x9178('0x1c')];var _0x3f3dd4=_0x26eeb9?0x0:_0x4281aa[_0x9178('0x19')];var _0x4393f3=_0x26eeb9?_0x703536[_0x9178('0x1c')]:_0x4281aa[_0x9178('0x19')]+_0x4281aa['limit'];var _0xae00cc;if(_0x4393f3>=_0x22b462){_0x4393f3=_0x22b462;_0xae00cc=0xc8;}else{_0xae00cc=0xce;}_0x4d931e[_0x9178('0x16')](_0xae00cc);return _0x4d931e['set'](_0x9178('0x1d'),_0x3f3dd4+'-'+_0x4393f3+'/'+_0x22b462)['json'](_0x703536);}return null;};}function patchUpdates(_0x94c136){return function(_0x1de1a2){try{jsonpatch[_0x9178('0x1e')](_0x1de1a2,_0x94c136,!![]);}catch(_0x273953){return BPromise[_0x9178('0x1f')](_0x273953);}return _0x1de1a2[_0x9178('0x20')]();};}function saveUpdates(_0x327b4b,_0x4c13cf){return function(_0x48e47b){if(_0x48e47b){return _0x48e47b[_0x9178('0x21')](_0x327b4b)['then'](function(_0x497c06){return _0x497c06;});}return null;};}function removeEntity(_0x2c40c1,_0x19aafe){return function(_0x15471a){if(_0x15471a){return _0x15471a[_0x9178('0x22')]()[_0x9178('0x23')](function(){_0x2c40c1[_0x9178('0x16')](0xcc)[_0x9178('0x17')]();});}};}function handleEntityNotFound(_0x23c04a,_0x1b39c5){return function(_0x2114ec){if(!_0x2114ec){_0x23c04a[_0x9178('0x15')](0x194);}return _0x2114ec;};}function handleError(_0x1b3cc7,_0x3dccbf){_0x3dccbf=_0x3dccbf||0x1f4;return function(_0x3af74d){logger['error'](_0x3af74d[_0x9178('0x24')]);if(_0x3af74d[_0x9178('0x25')]){delete _0x3af74d['name'];}_0x1b3cc7[_0x9178('0x16')](_0x3dccbf)[_0x9178('0x26')](_0x3af74d);};}exports[_0x9178('0x27')]=function(_0x2b977b,_0x23e54c){var _0x3b2487={},_0x5d9747={},_0x267f42={'count':0x0,'rows':[]};var _0x47201c=_['map'](db[_0x9178('0x28')][_0x9178('0x29')],function(_0x262068){return{'name':_0x262068[_0x9178('0x2a')],'type':_0x262068[_0x9178('0x2b')][_0x9178('0x2c')]};});_0x5d9747[_0x9178('0x2d')]=_['map'](_0x47201c,_0x9178('0x25'));_0x5d9747['query']=_[_0x9178('0x2e')](_0x2b977b[_0x9178('0x2f')]);_0x5d9747['filters']=_[_0x9178('0x30')](_0x5d9747[_0x9178('0x2d')],_0x5d9747[_0x9178('0x2f')]);_0x3b2487[_0x9178('0x31')]=_['intersection'](_0x5d9747[_0x9178('0x2d')],qs[_0x9178('0x32')](_0x2b977b[_0x9178('0x2f')][_0x9178('0x32')]));_0x3b2487[_0x9178('0x31')]=_0x3b2487[_0x9178('0x31')][_0x9178('0x33')]?_0x3b2487[_0x9178('0x31')]:_0x5d9747['model'];if(!_0x2b977b[_0x9178('0x2f')][_0x9178('0x34')]('nolimit')){_0x3b2487[_0x9178('0x1b')]=qs['limit'](_0x2b977b[_0x9178('0x2f')]['limit']);_0x3b2487['offset']=qs[_0x9178('0x19')](_0x2b977b[_0x9178('0x2f')]['offset']);}_0x3b2487[_0x9178('0x35')]=qs[_0x9178('0x36')](_0x2b977b['query']['sort']);_0x3b2487[_0x9178('0x37')]=qs[_0x9178('0x38')](_[_0x9178('0x39')](_0x2b977b[_0x9178('0x2f')],_0x5d9747['filters']),_0x47201c);if(_0x2b977b['query'][_0x9178('0x3a')]){_0x3b2487['where']=_['merge'](_0x3b2487[_0x9178('0x37')],{'$or':_[_0x9178('0x3b')](_0x47201c,function(_0x312c1e){if(_0x312c1e['type']!==_0x9178('0x3c')){var _0x19a5ec={};_0x19a5ec[_0x312c1e[_0x9178('0x25')]]={'$like':'%'+_0x2b977b['query'][_0x9178('0x3a')]+'%'};return _0x19a5ec;}})});}_0x3b2487=_[_0x9178('0x3d')]({},_0x3b2487,_0x2b977b[_0x9178('0x3e')]);var _0x36e839={'where':_0x3b2487[_0x9178('0x37')]};return db[_0x9178('0x28')][_0x9178('0x1c')](_0x36e839)['then'](function(_0xd76aa7){_0x267f42[_0x9178('0x1c')]=_0xd76aa7;if(_0x2b977b[_0x9178('0x2f')][_0x9178('0x3f')]){_0x3b2487['include']=[{'all':!![]}];}return db[_0x9178('0x28')][_0x9178('0x40')](_0x3b2487);})[_0x9178('0x23')](function(_0x34d812){_0x267f42['rows']=_0x34d812;return _0x267f42;})[_0x9178('0x23')](respondWithFilteredResult(_0x23e54c,_0x3b2487))['catch'](handleError(_0x23e54c,null));};exports['show']=function(_0x432c5d,_0x1bd23a){var _0x20f9c7={'raw':!![],'where':{'id':_0x432c5d['params']['id']}},_0x69ad3c={};_0x69ad3c[_0x9178('0x2d')]=_[_0x9178('0x2e')](db[_0x9178('0x28')]['rawAttributes']);_0x69ad3c[_0x9178('0x2f')]=_[_0x9178('0x2e')](_0x432c5d[_0x9178('0x2f')]);_0x69ad3c['filters']=_[_0x9178('0x30')](_0x69ad3c[_0x9178('0x2d')],_0x69ad3c[_0x9178('0x2f')]);_0x20f9c7['attributes']=_[_0x9178('0x30')](_0x69ad3c[_0x9178('0x2d')],qs['fields'](_0x432c5d[_0x9178('0x2f')][_0x9178('0x32')]));_0x20f9c7['attributes']=_0x20f9c7[_0x9178('0x31')][_0x9178('0x33')]?_0x20f9c7[_0x9178('0x31')]:_0x69ad3c['model'];if(_0x432c5d['query'][_0x9178('0x3f')]){_0x20f9c7['include']=[{'all':!![]}];}_0x20f9c7=_[_0x9178('0x3d')]({},_0x20f9c7,_0x432c5d[_0x9178('0x3e')]);return db[_0x9178('0x28')][_0x9178('0x41')](_0x20f9c7)[_0x9178('0x23')](handleEntityNotFound(_0x1bd23a,null))['then'](respondWithResult(_0x1bd23a,null))[_0x9178('0x42')](handleError(_0x1bd23a,null));};exports[_0x9178('0x43')]=function(_0x5cd77b,_0x42acef){return db[_0x9178('0x28')]['create'](_0x5cd77b[_0x9178('0x44')],{})['then'](respondWithResult(_0x42acef,0xc9))[_0x9178('0x42')](handleError(_0x42acef,null));};exports[_0x9178('0x21')]=function(_0x322f19,_0x101ee0){if(_0x322f19[_0x9178('0x44')]['id']){delete _0x322f19[_0x9178('0x44')]['id'];}return db['FaxQueueReport'][_0x9178('0x41')]({'where':{'id':_0x322f19[_0x9178('0x45')]['id']}})[_0x9178('0x23')](handleEntityNotFound(_0x101ee0,null))[_0x9178('0x23')](saveUpdates(_0x322f19[_0x9178('0x44')],null))[_0x9178('0x23')](respondWithResult(_0x101ee0,null))[_0x9178('0x42')](handleError(_0x101ee0,null));};exports[_0x9178('0x22')]=function(_0x44808d,_0x4624e9){return db['FaxQueueReport'][_0x9178('0x41')]({'where':{'id':_0x44808d[_0x9178('0x45')]['id']}})[_0x9178('0x23')](handleEntityNotFound(_0x4624e9,null))[_0x9178('0x23')](removeEntity(_0x4624e9,null))[_0x9178('0x42')](handleError(_0x4624e9,null));};exports[_0x9178('0x46')]=function(_0x3bd3da,_0x4fc7d5){return db[_0x9178('0x28')][_0x9178('0x46')]()[_0x9178('0x23')](respondWithResult(_0x4fc7d5,null))[_0x9178('0x42')](handleError(_0x4fc7d5,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 0234456..d87045c 100644 --- a/server/api/faxQueueReport/faxQueueReport.model.js +++ b/server/api/faxQueueReport/faxQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x53ec=['path','../../config/environment','./faxQueueReport.attributes','define','FaxQueueReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x88c6da,_0xa6b57e){var _0x1b234d=function(_0x336c69){while(--_0x336c69){_0x88c6da['push'](_0x88c6da['shift']());}};_0x1b234d(++_0xa6b57e);}(_0x53ec,0x192));var _0xc53e=function(_0x18a529,_0x2bea53){_0x18a529=_0x18a529-0x0;var _0x216fb8=_0x53ec[_0x18a529];return _0x216fb8;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xc53e('0xb'),'fields':[_0xc53e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['report_fax_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport'];(function(_0x24b850,_0x526b8f){var _0x5b6367=function(_0x4bff72){while(--_0x4bff72){_0x24b850['push'](_0x24b850['shift']());}};_0x5b6367(++_0x526b8f);}(_0x7a54,0x106));var _0x47a5=function(_0x5f0381,_0x3b3749){_0x5f0381=_0x5f0381-0x0;var _0x4ae14c=_0x7a54[_0x5f0381];return _0x4ae14c;};'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/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 4655df8..9ebe37e 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 _0x156d=['info','FaxQueueReport,\x20%s,\x20%s','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','where','attributes','UpdateFaxQueueReport','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x46ae5a,_0x2a38d0){var _0x434986=function(_0x22735d){while(--_0x22735d){_0x46ae5a['push'](_0x46ae5a['shift']());}};_0x434986(++_0x2a38d0);}(_0x156d,0x12a));var _0xd156=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x156d[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xd156('0x0'));var moment=require('moment');var BPromise=require(_0xd156('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd156('0x2'));var db=require(_0xd156('0x3'))['db'];var utils=require(_0xd156('0x4'));var logger=require(_0xd156('0x5'))('rpc');var config=require(_0xd156('0x6'));var jayson=require(_0xd156('0x7'));var client=jayson[_0xd156('0x8')][_0xd156('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd36325,_0x49dfaf,_0x954b05){return new BPromise(function(_0x478f60,_0x4d0b43){return client[_0xd156('0xa')](_0xd36325,_0x954b05)[_0xd156('0xb')](function(_0x4c0cad){logger[_0xd156('0xc')](_0xd156('0xd'),_0x49dfaf,'request\x20sent');logger[_0xd156('0xe')](_0xd156('0xf'),_0x49dfaf,_0xd156('0x10'),JSON[_0xd156('0x11')](_0x4c0cad));if(_0x4c0cad['error']){if(_0x4c0cad[_0xd156('0x12')]['code']===0x1f4){logger[_0xd156('0x12')](_0xd156('0xd'),_0x49dfaf,_0x4c0cad['error'][_0xd156('0x13')]);return _0x4d0b43(_0x4c0cad[_0xd156('0x12')][_0xd156('0x13')]);}logger['error'](_0xd156('0xd'),_0x49dfaf,_0x4c0cad[_0xd156('0x12')][_0xd156('0x13')]);return _0x478f60(_0x4c0cad[_0xd156('0x12')]['message']);}else{logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x49dfaf,'request\x20sent');_0x478f60(_0x4c0cad[_0xd156('0x14')][_0xd156('0x13')]);}})[_0xd156('0x15')](function(_0x5b78cc){logger['error'](_0xd156('0xd'),_0x49dfaf,_0x5b78cc);_0x4d0b43(_0x5b78cc);});});}exports[_0xd156('0x16')]=function(_0x49e458){var _0x26be6d=this;return new Promise(function(_0x145827,_0x4c7731){return db[_0xd156('0x17')][_0xd156('0x18')](_0x49e458[_0xd156('0x19')],{'raw':_0x49e458[_0xd156('0x1a')]?_0x49e458[_0xd156('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xd156('0xb')](function(_0x14c874){logger[_0xd156('0xc')](_0xd156('0x16'),_0x49e458);logger['debug']('CreateFaxQueueReport',_0x49e458,JSON[_0xd156('0x11')](_0x14c874));_0x145827(_0x14c874);})[_0xd156('0x15')](function(_0x30e69e){logger['error'](_0xd156('0x16'),_0x30e69e[_0xd156('0x13')],_0x49e458);_0x4c7731(_0x26be6d[_0xd156('0x12')](0x1f4,_0x30e69e[_0xd156('0x13')]));});});};exports['UpdateFaxQueueReport']=function(_0x16c235){var _0x51cfd1=this;return new Promise(function(_0x4990d7,_0xf7a9f2){return db[_0xd156('0x17')]['update'](_0x16c235[_0xd156('0x19')],{'raw':_0x16c235[_0xd156('0x1a')]?_0x16c235[_0xd156('0x1a')][_0xd156('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16c235[_0xd156('0x1a')]?_0x16c235[_0xd156('0x1a')][_0xd156('0x1c')]||null:null,'attributes':_0x16c235['options']?_0x16c235[_0xd156('0x1a')][_0xd156('0x1d')]||null:null,'limit':_0x16c235[_0xd156('0x1a')]?_0x16c235['options']['limit']||null:null})[_0xd156('0xb')](function(_0x28493e){logger['info'](_0xd156('0x1e'),_0x16c235);logger[_0xd156('0xe')](_0xd156('0x1e'),_0x16c235,JSON[_0xd156('0x11')](_0x28493e));_0x4990d7(_0x28493e);})['catch'](function(_0x559b9e){logger[_0xd156('0x12')](_0xd156('0x1e'),_0x559b9e[_0xd156('0x13')],_0x16c235);_0xf7a9f2(_0x51cfd1['error'](0x1f4,_0x559b9e[_0xd156('0x13')]));});});}; \ No newline at end of file +var _0x2b5e=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','UpdateFaxQueueReport','where','attributes','limit','catch','lodash','util'];(function(_0x3182f0,_0x22236d){var _0x5adfc1=function(_0x28f6e5){while(--_0x28f6e5){_0x3182f0['push'](_0x3182f0['shift']());}};_0x5adfc1(++_0x22236d);}(_0x2b5e,0x196));var _0xe2b5=function(_0x416840,_0x59a299){_0x416840=_0x416840-0x0;var _0x118276=_0x2b5e[_0x416840];return _0x118276;};'use strict';var _=require(_0xe2b5('0x0'));var util=require(_0xe2b5('0x1'));var moment=require(_0xe2b5('0x2'));var BPromise=require(_0xe2b5('0x3'));var rs=require(_0xe2b5('0x4'));var fs=require('fs');var Redis=require(_0xe2b5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe2b5('0x6'));var logger=require(_0xe2b5('0x7'))(_0xe2b5('0x8'));var config=require('../../config/environment');var jayson=require(_0xe2b5('0x9'));var client=jayson[_0xe2b5('0xa')][_0xe2b5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x313d88,_0x3b0092,_0x2d6e95){return new BPromise(function(_0x5ac61b,_0xe517de){return client[_0xe2b5('0xc')](_0x313d88,_0x2d6e95)[_0xe2b5('0xd')](function(_0x2f40f7){logger['info'](_0xe2b5('0xe'),_0x3b0092,_0xe2b5('0xf'));logger[_0xe2b5('0x10')](_0xe2b5('0x11'),_0x3b0092,_0xe2b5('0xf'),JSON[_0xe2b5('0x12')](_0x2f40f7));if(_0x2f40f7[_0xe2b5('0x13')]){if(_0x2f40f7[_0xe2b5('0x13')]['code']===0x1f4){logger[_0xe2b5('0x13')](_0xe2b5('0xe'),_0x3b0092,_0x2f40f7[_0xe2b5('0x13')][_0xe2b5('0x14')]);return _0xe517de(_0x2f40f7[_0xe2b5('0x13')][_0xe2b5('0x14')]);}logger[_0xe2b5('0x13')](_0xe2b5('0xe'),_0x3b0092,_0x2f40f7[_0xe2b5('0x13')][_0xe2b5('0x14')]);return _0x5ac61b(_0x2f40f7[_0xe2b5('0x13')][_0xe2b5('0x14')]);}else{logger[_0xe2b5('0x15')](_0xe2b5('0xe'),_0x3b0092,_0xe2b5('0xf'));_0x5ac61b(_0x2f40f7[_0xe2b5('0x16')][_0xe2b5('0x14')]);}})['catch'](function(_0xc704ec){logger['error'](_0xe2b5('0xe'),_0x3b0092,_0xc704ec);_0xe517de(_0xc704ec);});});}exports[_0xe2b5('0x17')]=function(_0x1b2049){var _0x58927f=this;return new Promise(function(_0x29b369,_0x491a35){return db[_0xe2b5('0x18')][_0xe2b5('0x19')](_0x1b2049[_0xe2b5('0x1a')],{'raw':_0x1b2049[_0xe2b5('0x1b')]?_0x1b2049[_0xe2b5('0x1b')][_0xe2b5('0x1c')]===undefined?!![]:![]:!![]})[_0xe2b5('0xd')](function(_0x207533){logger['info']('CreateFaxQueueReport',_0x1b2049);logger[_0xe2b5('0x10')](_0xe2b5('0x17'),_0x1b2049,JSON['stringify'](_0x207533));_0x29b369(_0x207533);})['catch'](function(_0x153a2d){logger['error'](_0xe2b5('0x17'),_0x153a2d[_0xe2b5('0x14')],_0x1b2049);_0x491a35(_0x58927f[_0xe2b5('0x13')](0x1f4,_0x153a2d[_0xe2b5('0x14')]));});});};exports[_0xe2b5('0x1d')]=function(_0x6581d7){var _0x3f4053=this;return new Promise(function(_0x2b4184,_0x2485b8){return db[_0xe2b5('0x18')]['update'](_0x6581d7[_0xe2b5('0x1a')],{'raw':_0x6581d7[_0xe2b5('0x1b')]?_0x6581d7[_0xe2b5('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x6581d7[_0xe2b5('0x1b')]?_0x6581d7[_0xe2b5('0x1b')][_0xe2b5('0x1e')]||null:null,'attributes':_0x6581d7['options']?_0x6581d7[_0xe2b5('0x1b')][_0xe2b5('0x1f')]||null:null,'limit':_0x6581d7[_0xe2b5('0x1b')]?_0x6581d7[_0xe2b5('0x1b')][_0xe2b5('0x20')]||null:null})[_0xe2b5('0xd')](function(_0x17d7be){logger[_0xe2b5('0x15')]('UpdateFaxQueueReport',_0x6581d7);logger[_0xe2b5('0x10')](_0xe2b5('0x1d'),_0x6581d7,JSON[_0xe2b5('0x12')](_0x17d7be));_0x2b4184(_0x17d7be);})[_0xe2b5('0x21')](function(_0x4745aa){logger[_0xe2b5('0x13')]('UpdateFaxQueueReport',_0x4745aa['message'],_0x6581d7);_0x2485b8(_0x3f4053['error'](0x1f4,_0x4745aa[_0xe2b5('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index d5a4ee7..35307ba 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 _0xd62f=['create','update','delete','/:id','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','post'];(function(_0x36d8d9,_0x17b58a){var _0x1ac3a2=function(_0x392196){while(--_0x392196){_0x36d8d9['push'](_0x36d8d9['shift']());}};_0x1ac3a2(++_0x17b58a);}(_0xd62f,0x1a8));var _0xfd62=function(_0x400b8f,_0x160b91){_0x400b8f=_0x400b8f-0x0;var _0x50d48d=_0xd62f[_0x400b8f];return _0x50d48d;};'use strict';var multer=require(_0xfd62('0x0'));var util=require('util');var path=require(_0xfd62('0x1'));var timeout=require(_0xfd62('0x2'));var express=require(_0xfd62('0x3'));var router=express[_0xfd62('0x4')]();var fs_extra=require(_0xfd62('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfd62('0x6'));var config=require(_0xfd62('0x7'));var controller=require(_0xfd62('0x8'));router[_0xfd62('0x9')]('/',auth[_0xfd62('0xa')](),controller[_0xfd62('0xb')]);router['get'](_0xfd62('0xc'),auth[_0xfd62('0xa')](),controller[_0xfd62('0xd')]);router[_0xfd62('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xfd62('0xe')]);router[_0xfd62('0xf')]('/',auth[_0xfd62('0xa')](),controller[_0xfd62('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xfd62('0x11')]);router[_0xfd62('0x12')](_0xfd62('0x13'),auth['isAuthenticated'](),controller[_0xfd62('0x14')]);module[_0xfd62('0x15')]=router; \ No newline at end of file +var _0x6d92=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','/describe','/:id','show','post','create','put','update','destroy','multer','util'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x6d92,0x10c));var _0x26d9=function(_0x52753e,_0x1718bc){_0x52753e=_0x52753e-0x0;var _0x5b2cd5=_0x6d92[_0x52753e];return _0x5b2cd5;};'use strict';var multer=require(_0x26d9('0x0'));var util=require(_0x26d9('0x1'));var path=require('path');var timeout=require(_0x26d9('0x2'));var express=require(_0x26d9('0x3'));var router=express[_0x26d9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x26d9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x26d9('0x6'));var controller=require(_0x26d9('0x7'));router[_0x26d9('0x8')]('/',auth[_0x26d9('0x9')](),controller['index']);router[_0x26d9('0x8')](_0x26d9('0xa'),auth[_0x26d9('0x9')](),controller['describe']);router[_0x26d9('0x8')](_0x26d9('0xb'),auth['isAuthenticated'](),controller[_0x26d9('0xc')]);router[_0x26d9('0xd')]('/',auth[_0x26d9('0x9')](),controller[_0x26d9('0xe')]);router[_0x26d9('0xf')](_0x26d9('0xb'),auth[_0x26d9('0x9')](),controller[_0x26d9('0x10')]);router['delete'](_0x26d9('0xb'),auth[_0x26d9('0x9')](),controller[_0x26d9('0x11')]);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 25d7e5d..9a2b70c 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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x35de8a,_0x35346e){var _0x2ac42f=function(_0x6ca2fc){while(--_0x6ca2fc){_0x35de8a['push'](_0x35de8a['shift']());}};_0x2ac42f(++_0x35346e);}(_0xaa88,0x137));var _0x8aa8=function(_0x19b84f,_0x48765e){_0x19b84f=_0x19b84f-0x0;var _0x18067b=_0xaa88[_0x19b84f];return _0x18067b;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file +var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x5da50c,_0x2c35fe){var _0x523092=function(_0x29c4f6){while(--_0x29c4f6){_0x5da50c['push'](_0x5da50c['shift']());}};_0x523092(++_0x2c35fe);}(_0xf4eb,0xec));var _0xbf4e=function(_0x397170,_0x23a003){_0x397170=_0x397170-0x0;var _0x163c6a=_0xf4eb[_0x397170];return _0x163c6a;};'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/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index f6a7b66..3eb6f57 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 _0xf5b9=['name','send','index','map','FaxTransferReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','options','findAll','rows','catch','show','keys','includeAll','include','create','body','update','find','params','describe','eml-format','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','then','end','error','stack'];(function(_0x86c6cb,_0x30bb53){var _0x1b1592=function(_0x19e1c9){while(--_0x19e1c9){_0x86c6cb['push'](_0x86c6cb['shift']());}};_0x1b1592(++_0x30bb53);}(_0xf5b9,0x106));var _0x9f5b=function(_0x534907,_0x455d91){_0x534907=_0x534907-0x0;var _0x1d775e=_0xf5b9[_0x534907];return _0x1d775e;};'use strict';var emlformat=require(_0x9f5b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9f5b('0x1'));var rp=require('request-promise');var moment=require(_0x9f5b('0x2'));var BPromise=require(_0x9f5b('0x3'));var Mustache=require(_0x9f5b('0x4'));var util=require(_0x9f5b('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x9f5b('0x6'));var ejs=require(_0x9f5b('0x7'));var fs=require('fs');var fs_extra=require(_0x9f5b('0x8'));var _=require(_0x9f5b('0x9'));var squel=require('squel');var crypto=require(_0x9f5b('0xa'));var jsforce=require(_0x9f5b('0xb'));var deskjs=require(_0x9f5b('0xc'));var toCsv=require(_0x9f5b('0x6'));var querystring=require(_0x9f5b('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9f5b('0xe'));var qs=require(_0x9f5b('0xf'));var as=require(_0x9f5b('0x10'));var hardwareService=require(_0x9f5b('0x11'));var logger=require('../../config/logger')(_0x9f5b('0x12'));var utils=require(_0x9f5b('0x13'));var config=require(_0x9f5b('0x14'));var licenseUtil=require(_0x9f5b('0x15'));var db=require(_0x9f5b('0x16'))['db'];function respondWithStatusCode(_0x11a266,_0x3513e6){_0x3513e6=_0x3513e6||0xcc;return function(_0x535a9b){if(_0x535a9b){return _0x11a266[_0x9f5b('0x17')](_0x3513e6);}return _0x11a266[_0x9f5b('0x18')](_0x3513e6)['end']();};}function respondWithResult(_0x5b7d78,_0x2aeb8c){_0x2aeb8c=_0x2aeb8c||0xc8;return function(_0x219866){if(_0x219866){return _0x5b7d78[_0x9f5b('0x18')](_0x2aeb8c)['json'](_0x219866);}};}function respondWithFilteredResult(_0x61497d,_0x5ced5c){return function(_0x426928){if(_0x426928){var _0x5e8911=typeof _0x5ced5c[_0x9f5b('0x19')]===_0x9f5b('0x1a')&&typeof _0x5ced5c[_0x9f5b('0x1b')]===_0x9f5b('0x1a');var _0xe565ba=_0x426928['count'];var _0x27944a=_0x5e8911?0x0:_0x5ced5c['offset'];var _0x6a44e6=_0x5e8911?_0x426928[_0x9f5b('0x1c')]:_0x5ced5c[_0x9f5b('0x19')]+_0x5ced5c[_0x9f5b('0x1b')];var _0x4538bc;if(_0x6a44e6>=_0xe565ba){_0x6a44e6=_0xe565ba;_0x4538bc=0xc8;}else{_0x4538bc=0xce;}_0x61497d[_0x9f5b('0x18')](_0x4538bc);return _0x61497d[_0x9f5b('0x1d')](_0x9f5b('0x1e'),_0x27944a+'-'+_0x6a44e6+'/'+_0xe565ba)['json'](_0x426928);}return null;};}function patchUpdates(_0x4aaa76){return function(_0x596c2e){try{jsonpatch[_0x9f5b('0x1f')](_0x596c2e,_0x4aaa76,!![]);}catch(_0x25db8d){return BPromise['reject'](_0x25db8d);}return _0x596c2e[_0x9f5b('0x20')]();};}function saveUpdates(_0x11ef5d,_0x5ecfdf){return function(_0x2039c5){if(_0x2039c5){return _0x2039c5['update'](_0x11ef5d)['then'](function(_0x100028){return _0x100028;});}return null;};}function removeEntity(_0x3f3042,_0x1b775a){return function(_0x15df0d){if(_0x15df0d){return _0x15df0d[_0x9f5b('0x21')]()[_0x9f5b('0x22')](function(){_0x3f3042[_0x9f5b('0x18')](0xcc)[_0x9f5b('0x23')]();});}};}function handleEntityNotFound(_0x5b8c85,_0x487bd5){return function(_0x13f9bb){if(!_0x13f9bb){_0x5b8c85[_0x9f5b('0x17')](0x194);}return _0x13f9bb;};}function handleError(_0x118d8d,_0x2acc33){_0x2acc33=_0x2acc33||0x1f4;return function(_0xb63db){logger[_0x9f5b('0x24')](_0xb63db[_0x9f5b('0x25')]);if(_0xb63db[_0x9f5b('0x26')]){delete _0xb63db[_0x9f5b('0x26')];}_0x118d8d['status'](_0x2acc33)[_0x9f5b('0x27')](_0xb63db);};}exports[_0x9f5b('0x28')]=function(_0x11efcc,_0x23d684){var _0x40e70b={},_0x59ef34={},_0x51675c={'count':0x0,'rows':[]};var _0x2f2552=_[_0x9f5b('0x29')](db[_0x9f5b('0x2a')][_0x9f5b('0x2b')],function(_0x301e9d){return{'name':_0x301e9d[_0x9f5b('0x2c')],'type':_0x301e9d[_0x9f5b('0x2d')][_0x9f5b('0x2e')]};});_0x59ef34[_0x9f5b('0x2f')]=_[_0x9f5b('0x29')](_0x2f2552,_0x9f5b('0x26'));_0x59ef34[_0x9f5b('0x30')]=_['keys'](_0x11efcc['query']);_0x59ef34[_0x9f5b('0x31')]=_['intersection'](_0x59ef34[_0x9f5b('0x2f')],_0x59ef34[_0x9f5b('0x30')]);_0x40e70b[_0x9f5b('0x32')]=_[_0x9f5b('0x33')](_0x59ef34[_0x9f5b('0x2f')],qs['fields'](_0x11efcc['query'][_0x9f5b('0x34')]));_0x40e70b[_0x9f5b('0x32')]=_0x40e70b[_0x9f5b('0x32')][_0x9f5b('0x35')]?_0x40e70b['attributes']:_0x59ef34['model'];if(!_0x11efcc[_0x9f5b('0x30')]['hasOwnProperty'](_0x9f5b('0x36'))){_0x40e70b[_0x9f5b('0x1b')]=qs[_0x9f5b('0x1b')](_0x11efcc['query'][_0x9f5b('0x1b')]);_0x40e70b[_0x9f5b('0x19')]=qs[_0x9f5b('0x19')](_0x11efcc[_0x9f5b('0x30')][_0x9f5b('0x19')]);}_0x40e70b[_0x9f5b('0x37')]=qs[_0x9f5b('0x38')](_0x11efcc['query'][_0x9f5b('0x38')]);_0x40e70b[_0x9f5b('0x39')]=qs[_0x9f5b('0x31')](_[_0x9f5b('0x3a')](_0x11efcc[_0x9f5b('0x30')],_0x59ef34[_0x9f5b('0x31')]),_0x2f2552);if(_0x11efcc['query']['filter']){_0x40e70b[_0x9f5b('0x39')]=_[_0x9f5b('0x3b')](_0x40e70b[_0x9f5b('0x39')],{'$or':_[_0x9f5b('0x29')](_0x2f2552,function(_0x1dc451){if(_0x1dc451[_0x9f5b('0x2d')]!==_0x9f5b('0x3c')){var _0x2413aa={};_0x2413aa[_0x1dc451[_0x9f5b('0x26')]]={'$like':'%'+_0x11efcc[_0x9f5b('0x30')]['filter']+'%'};return _0x2413aa;}})});}_0x40e70b=_[_0x9f5b('0x3b')]({},_0x40e70b,_0x11efcc[_0x9f5b('0x3d')]);var _0x5b2488={'where':_0x40e70b[_0x9f5b('0x39')]};return db[_0x9f5b('0x2a')][_0x9f5b('0x1c')](_0x5b2488)['then'](function(_0x36240a){_0x51675c[_0x9f5b('0x1c')]=_0x36240a;if(_0x11efcc[_0x9f5b('0x30')]['includeAll']){_0x40e70b['include']=[{'all':!![]}];}return db[_0x9f5b('0x2a')][_0x9f5b('0x3e')](_0x40e70b);})[_0x9f5b('0x22')](function(_0x452ffd){_0x51675c[_0x9f5b('0x3f')]=_0x452ffd;return _0x51675c;})[_0x9f5b('0x22')](respondWithFilteredResult(_0x23d684,_0x40e70b))[_0x9f5b('0x40')](handleError(_0x23d684,null));};exports[_0x9f5b('0x41')]=function(_0x2e5447,_0xb5a42e){var _0x29fe2c={'raw':!![],'where':{'id':_0x2e5447['params']['id']}},_0x109da2={};_0x109da2[_0x9f5b('0x2f')]=_['keys'](db['FaxTransferReport'][_0x9f5b('0x2b')]);_0x109da2[_0x9f5b('0x30')]=_[_0x9f5b('0x42')](_0x2e5447[_0x9f5b('0x30')]);_0x109da2[_0x9f5b('0x31')]=_[_0x9f5b('0x33')](_0x109da2[_0x9f5b('0x2f')],_0x109da2[_0x9f5b('0x30')]);_0x29fe2c[_0x9f5b('0x32')]=_[_0x9f5b('0x33')](_0x109da2[_0x9f5b('0x2f')],qs['fields'](_0x2e5447['query'][_0x9f5b('0x34')]));_0x29fe2c['attributes']=_0x29fe2c[_0x9f5b('0x32')]['length']?_0x29fe2c[_0x9f5b('0x32')]:_0x109da2['model'];if(_0x2e5447[_0x9f5b('0x30')][_0x9f5b('0x43')]){_0x29fe2c[_0x9f5b('0x44')]=[{'all':!![]}];}_0x29fe2c=_[_0x9f5b('0x3b')]({},_0x29fe2c,_0x2e5447[_0x9f5b('0x3d')]);return db['FaxTransferReport']['find'](_0x29fe2c)['then'](handleEntityNotFound(_0xb5a42e,null))[_0x9f5b('0x22')](respondWithResult(_0xb5a42e,null))['catch'](handleError(_0xb5a42e,null));};exports[_0x9f5b('0x45')]=function(_0x4937e9,_0x4eb55d){return db[_0x9f5b('0x2a')][_0x9f5b('0x45')](_0x4937e9[_0x9f5b('0x46')],{})[_0x9f5b('0x22')](respondWithResult(_0x4eb55d,0xc9))[_0x9f5b('0x40')](handleError(_0x4eb55d,null));};exports[_0x9f5b('0x47')]=function(_0x3b2c0c,_0x2cef93){if(_0x3b2c0c['body']['id']){delete _0x3b2c0c[_0x9f5b('0x46')]['id'];}return db[_0x9f5b('0x2a')][_0x9f5b('0x48')]({'where':{'id':_0x3b2c0c[_0x9f5b('0x49')]['id']}})[_0x9f5b('0x22')](handleEntityNotFound(_0x2cef93,null))['then'](saveUpdates(_0x3b2c0c[_0x9f5b('0x46')],null))[_0x9f5b('0x22')](respondWithResult(_0x2cef93,null))[_0x9f5b('0x40')](handleError(_0x2cef93,null));};exports['destroy']=function(_0x1aea6d,_0x3826d3){return db[_0x9f5b('0x2a')][_0x9f5b('0x48')]({'where':{'id':_0x1aea6d[_0x9f5b('0x49')]['id']}})['then'](handleEntityNotFound(_0x3826d3,null))[_0x9f5b('0x22')](removeEntity(_0x3826d3,null))['catch'](handleError(_0x3826d3,null));};exports[_0x9f5b('0x4a')]=function(_0x5a4fc9,_0x3fd739){return db[_0x9f5b('0x2a')]['describe']()[_0x9f5b('0x22')](respondWithResult(_0x3fd739,null))[_0x9f5b('0x40')](handleError(_0x3fd739,null));}; \ No newline at end of file +var _0x8ce0=['rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','catch','show','params','fields','includeAll','find','create','body','update','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','limit','count','status','set','Content-Range','apply','reject','then','sendStatus','error','stack','name','send','index','FaxTransferReport'];(function(_0x38da9f,_0xe3d9bb){var _0x384494=function(_0x265884){while(--_0x265884){_0x38da9f['push'](_0x38da9f['shift']());}};_0x384494(++_0xe3d9bb);}(_0x8ce0,0x1e8));var _0x08ce=function(_0x5627e1,_0x1b2dbf){_0x5627e1=_0x5627e1-0x0;var _0x2f013f=_0x8ce0[_0x5627e1];return _0x2f013f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x08ce('0x0'));var zipdir=require(_0x08ce('0x1'));var jsonpatch=require(_0x08ce('0x2'));var rp=require(_0x08ce('0x3'));var moment=require(_0x08ce('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x08ce('0x5'));var util=require(_0x08ce('0x6'));var path=require(_0x08ce('0x7'));var sox=require(_0x08ce('0x8'));var csv=require('to-csv');var ejs=require(_0x08ce('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x08ce('0xa'));var squel=require('squel');var crypto=require(_0x08ce('0xb'));var jsforce=require(_0x08ce('0xc'));var deskjs=require(_0x08ce('0xd'));var toCsv=require(_0x08ce('0xe'));var querystring=require('querystring');var Papa=require(_0x08ce('0xf'));var Redis=require(_0x08ce('0x10'));var authService=require(_0x08ce('0x11'));var qs=require(_0x08ce('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x08ce('0x13'));var logger=require(_0x08ce('0x14'))(_0x08ce('0x15'));var utils=require(_0x08ce('0x16'));var config=require(_0x08ce('0x17'));var licenseUtil=require(_0x08ce('0x18'));var db=require(_0x08ce('0x19'))['db'];function respondWithStatusCode(_0x589078,_0x541b2d){_0x541b2d=_0x541b2d||0xcc;return function(_0x1393a3){if(_0x1393a3){return _0x589078['sendStatus'](_0x541b2d);}return _0x589078['status'](_0x541b2d)[_0x08ce('0x1a')]();};}function respondWithResult(_0x448731,_0x560817){_0x560817=_0x560817||0xc8;return function(_0x4f94f4){if(_0x4f94f4){return _0x448731['status'](_0x560817)[_0x08ce('0x1b')](_0x4f94f4);}};}function respondWithFilteredResult(_0x4aef6d,_0x1daf23){return function(_0x465b0e){if(_0x465b0e){var _0x3cd6f9=typeof _0x1daf23[_0x08ce('0x1c')]==='undefined'&&typeof _0x1daf23[_0x08ce('0x1d')]==='undefined';var _0x19196d=_0x465b0e[_0x08ce('0x1e')];var _0x517d4b=_0x3cd6f9?0x0:_0x1daf23[_0x08ce('0x1c')];var _0xe586dc=_0x3cd6f9?_0x465b0e[_0x08ce('0x1e')]:_0x1daf23[_0x08ce('0x1c')]+_0x1daf23[_0x08ce('0x1d')];var _0x1782ab;if(_0xe586dc>=_0x19196d){_0xe586dc=_0x19196d;_0x1782ab=0xc8;}else{_0x1782ab=0xce;}_0x4aef6d[_0x08ce('0x1f')](_0x1782ab);return _0x4aef6d[_0x08ce('0x20')](_0x08ce('0x21'),_0x517d4b+'-'+_0xe586dc+'/'+_0x19196d)['json'](_0x465b0e);}return null;};}function patchUpdates(_0x30ec6d){return function(_0x85574d){try{jsonpatch[_0x08ce('0x22')](_0x85574d,_0x30ec6d,!![]);}catch(_0x504fa0){return BPromise[_0x08ce('0x23')](_0x504fa0);}return _0x85574d['save']();};}function saveUpdates(_0x121537,_0x5e2caa){return function(_0x10e992){if(_0x10e992){return _0x10e992['update'](_0x121537)['then'](function(_0x1d59a2){return _0x1d59a2;});}return null;};}function removeEntity(_0x5a91d6,_0x3949c2){return function(_0x29b8db){if(_0x29b8db){return _0x29b8db['destroy']()[_0x08ce('0x24')](function(){_0x5a91d6[_0x08ce('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1522b7,_0x2e32f2){return function(_0x28a3c9){if(!_0x28a3c9){_0x1522b7[_0x08ce('0x25')](0x194);}return _0x28a3c9;};}function handleError(_0x5b34af,_0x191b31){_0x191b31=_0x191b31||0x1f4;return function(_0x1c60a0){logger[_0x08ce('0x26')](_0x1c60a0[_0x08ce('0x27')]);if(_0x1c60a0[_0x08ce('0x28')]){delete _0x1c60a0[_0x08ce('0x28')];}_0x5b34af['status'](_0x191b31)[_0x08ce('0x29')](_0x1c60a0);};}exports[_0x08ce('0x2a')]=function(_0x25ed6d,_0x3d8e71){var _0x33f249={},_0x2fb3d6={},_0x3d0c32={'count':0x0,'rows':[]};var _0x10836e=_['map'](db[_0x08ce('0x2b')][_0x08ce('0x2c')],function(_0x19ec34){return{'name':_0x19ec34[_0x08ce('0x2d')],'type':_0x19ec34[_0x08ce('0x2e')][_0x08ce('0x2f')]};});_0x2fb3d6[_0x08ce('0x30')]=_[_0x08ce('0x31')](_0x10836e,_0x08ce('0x28'));_0x2fb3d6['query']=_[_0x08ce('0x32')](_0x25ed6d[_0x08ce('0x33')]);_0x2fb3d6[_0x08ce('0x34')]=_[_0x08ce('0x35')](_0x2fb3d6[_0x08ce('0x30')],_0x2fb3d6['query']);_0x33f249[_0x08ce('0x36')]=_[_0x08ce('0x35')](_0x2fb3d6[_0x08ce('0x30')],qs['fields'](_0x25ed6d[_0x08ce('0x33')]['fields']));_0x33f249[_0x08ce('0x36')]=_0x33f249[_0x08ce('0x36')][_0x08ce('0x37')]?_0x33f249[_0x08ce('0x36')]:_0x2fb3d6[_0x08ce('0x30')];if(!_0x25ed6d['query']['hasOwnProperty'](_0x08ce('0x38'))){_0x33f249[_0x08ce('0x1d')]=qs['limit'](_0x25ed6d['query'][_0x08ce('0x1d')]);_0x33f249[_0x08ce('0x1c')]=qs[_0x08ce('0x1c')](_0x25ed6d['query'][_0x08ce('0x1c')]);}_0x33f249[_0x08ce('0x39')]=qs[_0x08ce('0x3a')](_0x25ed6d[_0x08ce('0x33')]['sort']);_0x33f249[_0x08ce('0x3b')]=qs[_0x08ce('0x34')](_[_0x08ce('0x3c')](_0x25ed6d[_0x08ce('0x33')],_0x2fb3d6[_0x08ce('0x34')]),_0x10836e);if(_0x25ed6d[_0x08ce('0x33')][_0x08ce('0x3d')]){_0x33f249[_0x08ce('0x3b')]=_['merge'](_0x33f249[_0x08ce('0x3b')],{'$or':_[_0x08ce('0x31')](_0x10836e,function(_0x5e28d2){if(_0x5e28d2[_0x08ce('0x2e')]!==_0x08ce('0x3e')){var _0x38c386={};_0x38c386[_0x5e28d2[_0x08ce('0x28')]]={'$like':'%'+_0x25ed6d[_0x08ce('0x33')]['filter']+'%'};return _0x38c386;}})});}_0x33f249=_[_0x08ce('0x3f')]({},_0x33f249,_0x25ed6d[_0x08ce('0x40')]);var _0x1d173e={'where':_0x33f249[_0x08ce('0x3b')]};return db[_0x08ce('0x2b')][_0x08ce('0x1e')](_0x1d173e)[_0x08ce('0x24')](function(_0x23cd66){_0x3d0c32[_0x08ce('0x1e')]=_0x23cd66;if(_0x25ed6d['query']['includeAll']){_0x33f249[_0x08ce('0x41')]=[{'all':!![]}];}return db[_0x08ce('0x2b')]['findAll'](_0x33f249);})[_0x08ce('0x24')](function(_0x608f82){_0x3d0c32['rows']=_0x608f82;return _0x3d0c32;})[_0x08ce('0x24')](respondWithFilteredResult(_0x3d8e71,_0x33f249))[_0x08ce('0x42')](handleError(_0x3d8e71,null));};exports[_0x08ce('0x43')]=function(_0x4f721b,_0x2cfdd){var _0x53912c={'raw':!![],'where':{'id':_0x4f721b[_0x08ce('0x44')]['id']}},_0xe27410={};_0xe27410[_0x08ce('0x30')]=_[_0x08ce('0x32')](db[_0x08ce('0x2b')][_0x08ce('0x2c')]);_0xe27410[_0x08ce('0x33')]=_['keys'](_0x4f721b[_0x08ce('0x33')]);_0xe27410[_0x08ce('0x34')]=_[_0x08ce('0x35')](_0xe27410[_0x08ce('0x30')],_0xe27410[_0x08ce('0x33')]);_0x53912c[_0x08ce('0x36')]=_['intersection'](_0xe27410[_0x08ce('0x30')],qs[_0x08ce('0x45')](_0x4f721b['query']['fields']));_0x53912c['attributes']=_0x53912c[_0x08ce('0x36')][_0x08ce('0x37')]?_0x53912c[_0x08ce('0x36')]:_0xe27410[_0x08ce('0x30')];if(_0x4f721b['query'][_0x08ce('0x46')]){_0x53912c[_0x08ce('0x41')]=[{'all':!![]}];}_0x53912c=_[_0x08ce('0x3f')]({},_0x53912c,_0x4f721b[_0x08ce('0x40')]);return db[_0x08ce('0x2b')][_0x08ce('0x47')](_0x53912c)[_0x08ce('0x24')](handleEntityNotFound(_0x2cfdd,null))['then'](respondWithResult(_0x2cfdd,null))[_0x08ce('0x42')](handleError(_0x2cfdd,null));};exports[_0x08ce('0x48')]=function(_0x3cc852,_0x4e1a56){return db[_0x08ce('0x2b')][_0x08ce('0x48')](_0x3cc852[_0x08ce('0x49')],{})['then'](respondWithResult(_0x4e1a56,0xc9))[_0x08ce('0x42')](handleError(_0x4e1a56,null));};exports[_0x08ce('0x4a')]=function(_0x3b55a5,_0x12cbf3){if(_0x3b55a5[_0x08ce('0x49')]['id']){delete _0x3b55a5[_0x08ce('0x49')]['id'];}return db[_0x08ce('0x2b')]['find']({'where':{'id':_0x3b55a5['params']['id']}})[_0x08ce('0x24')](handleEntityNotFound(_0x12cbf3,null))[_0x08ce('0x24')](saveUpdates(_0x3b55a5[_0x08ce('0x49')],null))[_0x08ce('0x24')](respondWithResult(_0x12cbf3,null))[_0x08ce('0x42')](handleError(_0x12cbf3,null));};exports[_0x08ce('0x4b')]=function(_0x59a79e,_0xb74f57){return db['FaxTransferReport'][_0x08ce('0x47')]({'where':{'id':_0x59a79e[_0x08ce('0x44')]['id']}})['then'](handleEntityNotFound(_0xb74f57,null))['then'](removeEntity(_0xb74f57,null))['catch'](handleError(_0xb74f57,null));};exports['describe']=function(_0x3fa7c6,_0x46cdc2){return db[_0x08ce('0x2b')]['describe']()['then'](respondWithResult(_0x46cdc2,null))[_0x08ce('0x42')](handleError(_0x46cdc2,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 1fdd562..0d7eded 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 _0xea35=['bluebird','request-promise','path','rimraf','./faxTransferReport.attributes','exports','define','report_fax_transfer','uniqueid','lodash','util','../../config/logger','moment'];(function(_0x4d90ec,_0xda482b){var _0x2eca10=function(_0x3ea9d5){while(--_0x3ea9d5){_0x4d90ec['push'](_0x4d90ec['shift']());}};_0x2eca10(++_0xda482b);}(_0xea35,0x11a));var _0x5ea3=function(_0x3bd05b,_0x586c38){_0x3bd05b=_0x3bd05b-0x0;var _0x22274f=_0xea35[_0x3bd05b];return _0x22274f;};'use strict';var _=require(_0x5ea3('0x0'));var util=require(_0x5ea3('0x1'));var logger=require(_0x5ea3('0x2'))('api');var moment=require(_0x5ea3('0x3'));var BPromise=require(_0x5ea3('0x4'));var rp=require(_0x5ea3('0x5'));var fs=require('fs');var path=require(_0x5ea3('0x6'));var rimraf=require(_0x5ea3('0x7'));var config=require('../../config/environment');var attributes=require(_0x5ea3('0x8'));module[_0x5ea3('0x9')]=function(_0x29f582,_0x12ed4c){return _0x29f582[_0x5ea3('0xa')]('FaxTransferReport',attributes,{'tableName':_0x5ea3('0xb'),'paranoid':![],'indexes':[{'name':_0x5ea3('0xc'),'fields':[_0x5ea3('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8ed9=['report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','define','FaxTransferReport'];(function(_0x43530b,_0x474059){var _0xd1b236=function(_0x20cad8){while(--_0x20cad8){_0x43530b['push'](_0x43530b['shift']());}};_0xd1b236(++_0x474059);}(_0x8ed9,0x16a));var _0x98ed=function(_0x5338d3,_0x470835){_0x5338d3=_0x5338d3-0x0;var _0x8beb32=_0x8ed9[_0x5338d3];return _0x8beb32;};'use strict';var _=require(_0x98ed('0x0'));var util=require(_0x98ed('0x1'));var logger=require(_0x98ed('0x2'))(_0x98ed('0x3'));var moment=require(_0x98ed('0x4'));var BPromise=require(_0x98ed('0x5'));var rp=require(_0x98ed('0x6'));var fs=require('fs');var path=require(_0x98ed('0x7'));var rimraf=require(_0x98ed('0x8'));var config=require(_0x98ed('0x9'));var attributes=require(_0x98ed('0xa'));module['exports']=function(_0x59fd22,_0x11e200){return _0x59fd22[_0x98ed('0xb')](_0x98ed('0xc'),attributes,{'tableName':_0x98ed('0xd'),'paranoid':![],'indexes':[{'name':_0x98ed('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 6f6046e..cdb71ab 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 _0x1b57=['util','moment','randomstring','../../config/logger','rpc','client','request','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0xb60674,_0xa4e08a){var _0x2514a0=function(_0x5bfc26){while(--_0x5bfc26){_0xb60674['push'](_0xb60674['shift']());}};_0x2514a0(++_0xa4e08a);}(_0x1b57,0xe0));var _0x71b5=function(_0x2c0208,_0x15e3ae){_0x2c0208=_0x2c0208-0x0;var _0x57d973=_0x1b57[_0x2c0208];return _0x57d973;};'use strict';var _=require('lodash');var util=require(_0x71b5('0x0'));var moment=require(_0x71b5('0x1'));var BPromise=require('bluebird');var rs=require(_0x71b5('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x71b5('0x3'))(_0x71b5('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x71b5('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40c119,_0x3c6926,_0xdd680a){return new BPromise(function(_0x19cd6a,_0x5884be){return client[_0x71b5('0x6')](_0x40c119,_0xdd680a)['then'](function(_0x8252a3){logger[_0x71b5('0x7')](_0x71b5('0x8'),_0x3c6926,_0x71b5('0x9'));logger['debug'](_0x71b5('0xa'),_0x3c6926,_0x71b5('0x9'),JSON[_0x71b5('0xb')](_0x8252a3));if(_0x8252a3['error']){if(_0x8252a3[_0x71b5('0xc')][_0x71b5('0xd')]===0x1f4){logger[_0x71b5('0xc')](_0x71b5('0x8'),_0x3c6926,_0x8252a3[_0x71b5('0xc')][_0x71b5('0xe')]);return _0x5884be(_0x8252a3[_0x71b5('0xc')][_0x71b5('0xe')]);}logger[_0x71b5('0xc')](_0x71b5('0x8'),_0x3c6926,_0x8252a3[_0x71b5('0xc')][_0x71b5('0xe')]);return _0x19cd6a(_0x8252a3[_0x71b5('0xc')][_0x71b5('0xe')]);}else{logger[_0x71b5('0x7')]('FaxTransferReport,\x20%s,\x20%s',_0x3c6926,_0x71b5('0x9'));_0x19cd6a(_0x8252a3['result'][_0x71b5('0xe')]);}})[_0x71b5('0xf')](function(_0x595dbd){logger[_0x71b5('0xc')](_0x71b5('0x8'),_0x3c6926,_0x595dbd);_0x5884be(_0x595dbd);});});} \ No newline at end of file +var _0xfcf3=['FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xfcf3,0xdf));var _0x3fcf=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xfcf3[_0x164eca];return _0x2ce562;};'use strict';var _=require(_0x3fcf('0x0'));var util=require(_0x3fcf('0x1'));var moment=require(_0x3fcf('0x2'));var BPromise=require(_0x3fcf('0x3'));var rs=require(_0x3fcf('0x4'));var fs=require('fs');var Redis=require(_0x3fcf('0x5'));var db=require(_0x3fcf('0x6'))['db'];var utils=require(_0x3fcf('0x7'));var logger=require('../../config/logger')(_0x3fcf('0x8'));var config=require('../../config/environment');var jayson=require(_0x3fcf('0x9'));var client=jayson['client'][_0x3fcf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4429dc,_0x516133,_0x5805a4){return new BPromise(function(_0x531617,_0x3cb301){return client[_0x3fcf('0xb')](_0x4429dc,_0x5805a4)[_0x3fcf('0xc')](function(_0x240177){logger[_0x3fcf('0xd')](_0x3fcf('0xe'),_0x516133,_0x3fcf('0xf'));logger[_0x3fcf('0x10')](_0x3fcf('0x11'),_0x516133,'request\x20sent',JSON[_0x3fcf('0x12')](_0x240177));if(_0x240177[_0x3fcf('0x13')]){if(_0x240177[_0x3fcf('0x13')][_0x3fcf('0x14')]===0x1f4){logger[_0x3fcf('0x13')](_0x3fcf('0xe'),_0x516133,_0x240177[_0x3fcf('0x13')]['message']);return _0x3cb301(_0x240177['error'][_0x3fcf('0x15')]);}logger[_0x3fcf('0x13')]('FaxTransferReport,\x20%s,\x20%s',_0x516133,_0x240177[_0x3fcf('0x13')][_0x3fcf('0x15')]);return _0x531617(_0x240177[_0x3fcf('0x13')][_0x3fcf('0x15')]);}else{logger['info'](_0x3fcf('0xe'),_0x516133,_0x3fcf('0xf'));_0x531617(_0x240177[_0x3fcf('0x16')][_0x3fcf('0x15')]);}})[_0x3fcf('0x17')](function(_0xcec25){logger[_0x3fcf('0x13')]('FaxTransferReport,\x20%s,\x20%s',_0x516133,_0xcec25);_0x3cb301(_0xcec25);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 882f666..222b476 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 _0x0d8c=['../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','/:id','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x51935e,_0x575bdc){var _0x4fc584=function(_0xae3f00){while(--_0xae3f00){_0x51935e['push'](_0x51935e['shift']());}};_0x4fc584(++_0x575bdc);}(_0x0d8c,0x1d3));var _0xc0d8=function(_0xad39e5,_0x12a222){_0xad39e5=_0xad39e5-0x0;var _0xdf003d=_0x0d8c[_0xad39e5];return _0xdf003d;};'use strict';var multer=require(_0xc0d8('0x0'));var util=require(_0xc0d8('0x1'));var path=require(_0xc0d8('0x2'));var timeout=require(_0xc0d8('0x3'));var express=require(_0xc0d8('0x4'));var router=express[_0xc0d8('0x5')]();var fs_extra=require(_0xc0d8('0x6'));var auth=require(_0xc0d8('0x7'));var interaction=require(_0xc0d8('0x8'));var config=require(_0xc0d8('0x9'));var controller=require('./faxTransferReport.controller');router['get']('/',auth[_0xc0d8('0xa')](),controller[_0xc0d8('0xb')]);router[_0xc0d8('0xc')](_0xc0d8('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0xc0d8('0xc')](_0xc0d8('0xe'),auth[_0xc0d8('0xa')](),controller['show']);router['post']('/',auth[_0xc0d8('0xa')](),controller['create']);router[_0xc0d8('0xf')](_0xc0d8('0xe'),auth[_0xc0d8('0xa')](),controller[_0xc0d8('0x10')]);router[_0xc0d8('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xc0d8('0x12')]);module['exports']=router; \ No newline at end of file +var _0x5e27=['put','update','delete','destroy','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','./faxTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create'];(function(_0x559a80,_0x3d193d){var _0x42f555=function(_0x24e596){while(--_0x24e596){_0x559a80['push'](_0x559a80['shift']());}};_0x42f555(++_0x3d193d);}(_0x5e27,0x1f2));var _0x75e2=function(_0x4e9fb4,_0xdfa600){_0x4e9fb4=_0x4e9fb4-0x0;var _0x96004e=_0x5e27[_0x4e9fb4];return _0x96004e;};'use strict';var multer=require(_0x75e2('0x0'));var util=require(_0x75e2('0x1'));var path=require('path');var timeout=require(_0x75e2('0x2'));var express=require('express');var router=express[_0x75e2('0x3')]();var fs_extra=require(_0x75e2('0x4'));var auth=require(_0x75e2('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x75e2('0x6'));router[_0x75e2('0x7')]('/',auth[_0x75e2('0x8')](),controller['index']);router[_0x75e2('0x7')](_0x75e2('0x9'),auth[_0x75e2('0x8')](),controller[_0x75e2('0xa')]);router[_0x75e2('0x7')](_0x75e2('0xb'),auth[_0x75e2('0x8')](),controller[_0x75e2('0xc')]);router[_0x75e2('0xd')]('/',auth[_0x75e2('0x8')](),controller[_0x75e2('0xe')]);router[_0x75e2('0xf')]('/:id',auth[_0x75e2('0x8')](),controller[_0x75e2('0x10')]);router[_0x75e2('0x11')](_0x75e2('0xb'),auth[_0x75e2('0x8')](),controller[_0x75e2('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 54fdea9..f82cf7f 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 _0xd4fa=['/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','show'];(function(_0x3c90ad,_0x292c85){var _0x4f39da=function(_0xe9ad2){while(--_0xe9ad2){_0x3c90ad['push'](_0x3c90ad['shift']());}};_0x4f39da(++_0x292c85);}(_0xd4fa,0x110));var _0xad4f=function(_0x1a7edf,_0x5c4e04){_0x1a7edf=_0x1a7edf-0x0;var _0x56c1d9=_0xd4fa[_0x1a7edf];return _0x56c1d9;};'use strict';var multer=require(_0xad4f('0x0'));var util=require(_0xad4f('0x1'));var path=require(_0xad4f('0x2'));var timeout=require('connect-timeout');var express=require(_0xad4f('0x3'));var router=express[_0xad4f('0x4')]();var fs_extra=require(_0xad4f('0x5'));var auth=require(_0xad4f('0x6'));var interaction=require(_0xad4f('0x7'));var config=require(_0xad4f('0x8'));var controller=require(_0xad4f('0x9'));router[_0xad4f('0xa')]('/',auth[_0xad4f('0xb')](),controller[_0xad4f('0xc')]);router['get']('/:id',auth[_0xad4f('0xb')](),controller[_0xad4f('0xd')]);router[_0xad4f('0xa')](_0xad4f('0xe'),auth[_0xad4f('0xb')](),controller[_0xad4f('0xf')]);router[_0xad4f('0xa')](_0xad4f('0x10'),auth[_0xad4f('0xb')](),controller[_0xad4f('0x11')]);router[_0xad4f('0x12')]('/',auth[_0xad4f('0xb')](),controller[_0xad4f('0x13')]);router[_0xad4f('0x12')](_0xad4f('0xe'),auth['isAuthenticated'](),controller[_0xad4f('0x14')]);router[_0xad4f('0x15')](_0xad4f('0x16'),auth[_0xad4f('0xb')](),controller['update']);router[_0xad4f('0x17')](_0xad4f('0x16'),auth[_0xad4f('0xb')](),controller[_0xad4f('0x18')]);module[_0xad4f('0x19')]=router; \ No newline at end of file +var _0xdabf=['delete','destroy','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','index','get','/:id','isAuthenticated','show','/:id/configurations','getFields','post','update'];(function(_0x1b33ec,_0x4c5bb3){var _0x36c0a4=function(_0x4845cb){while(--_0x4845cb){_0x1b33ec['push'](_0x1b33ec['shift']());}};_0x36c0a4(++_0x4c5bb3);}(_0xdabf,0x156));var _0xfdab=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xdabf[_0x173441];return _0x2423a8;};'use strict';var multer=require(_0xfdab('0x0'));var util=require(_0xfdab('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfdab('0x2'));var router=express[_0xfdab('0x3')]();var fs_extra=require(_0xfdab('0x4'));var auth=require(_0xfdab('0x5'));var interaction=require(_0xfdab('0x6'));var config=require(_0xfdab('0x7'));var controller=require(_0xfdab('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xfdab('0x9')]);router[_0xfdab('0xa')](_0xfdab('0xb'),auth[_0xfdab('0xc')](),controller[_0xfdab('0xd')]);router[_0xfdab('0xa')](_0xfdab('0xe'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xfdab('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xfdab('0xf')]);router[_0xfdab('0x10')]('/',auth[_0xfdab('0xc')](),controller['create']);router[_0xfdab('0x10')]('/:id/configurations',auth[_0xfdab('0xc')](),controller['addConfiguration']);router['put'](_0xfdab('0xb'),auth['isAuthenticated'](),controller[_0xfdab('0x11')]);router[_0xfdab('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xfdab('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 494a7b7..9458847 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 _0xac66=['integrationTab','newTab','sequelize','exports','STRING','ENUM','basic'];(function(_0x276abb,_0x392a48){var _0x492b5b=function(_0x4ac35a){while(--_0x4ac35a){_0x276abb['push'](_0x276abb['shift']());}};_0x492b5b(++_0x392a48);}(_0xac66,0x10c));var _0x6ac6=function(_0x3a1618,_0x312db6){_0x3a1618=_0x3a1618-0x0;var _0x4cff80=_0xac66[_0x3a1618];return _0x4cff80;};'use strict';var Sequelize=require(_0x6ac6('0x0'));module[_0x6ac6('0x1')]={'name':{'type':Sequelize[_0x6ac6('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x6ac6('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0x6ac6('0x3')]('basic'),'defaultValue':_0x6ac6('0x4')},'password':{'type':Sequelize[_0x6ac6('0x2')]},'consumerKey':{'type':Sequelize[_0x6ac6('0x2')]},'consumerSecret':{'type':Sequelize[_0x6ac6('0x2')]},'token':{'type':Sequelize[_0x6ac6('0x2')]},'tokenSecret':{'type':Sequelize[_0x6ac6('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6ac6('0x3')](_0x6ac6('0x5'),_0x6ac6('0x6')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xba98=['ENUM','basic','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x4011c7,_0x4d3d71){var _0x32a078=function(_0x2aaede){while(--_0x2aaede){_0x4011c7['push'](_0x4011c7['shift']());}};_0x32a078(++_0x4d3d71);}(_0xba98,0xeb));var _0x8ba9=function(_0x126df7,_0x4be784){_0x126df7=_0x126df7-0x0;var _0x1cf5fb=_0xba98[_0x126df7];return _0x1cf5fb;};'use strict';var Sequelize=require(_0x8ba9('0x0'));module[_0x8ba9('0x1')]={'name':{'type':Sequelize[_0x8ba9('0x2')]},'description':{'type':Sequelize[_0x8ba9('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0x8ba9('0x3')](_0x8ba9('0x4')),'defaultValue':_0x8ba9('0x4')},'password':{'type':Sequelize[_0x8ba9('0x2')]},'consumerKey':{'type':Sequelize[_0x8ba9('0x2')]},'consumerSecret':{'type':Sequelize[_0x8ba9('0x2')]},'token':{'type':Sequelize[_0x8ba9('0x2')]},'tokenSecret':{'type':Sequelize[_0x8ba9('0x2')]},'serverUrl':{'type':Sequelize[_0x8ba9('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x8ba9('0x3')](_0x8ba9('0x5'),_0x8ba9('0x6')),'defaultValue':_0x8ba9('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index fa1fe17..9510043 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 _0xfb0a=['util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','limit','count','set','reject','save','update','destroy','then','end','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','nolimit','offset','order','sort','where','pick','merge','VIRTUAL','filter','DeskAccount','include','findAll','catch','params','keys','length','includeAll','options','find','create','body','getConfigurations','findOne','DeskConfiguration','hasOwnProperty','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','DeskField','getFields','priority','remoteUri','authType','username','consumerKey','token','tokenSecret','slice','substring','lastIndexOf','format','%s/custom_fields','application/json','basic','headers','Authorization','%s:%s','password','base64','_embedded','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x4e1657,_0x607b35){var _0x55c5a4=function(_0x361b45){while(--_0x361b45){_0x4e1657['push'](_0x4e1657['shift']());}};_0x55c5a4(++_0x607b35);}(_0xfb0a,0x1bc));var _0xafb0=function(_0x3a7634,_0x2db384){_0x3a7634=_0x3a7634-0x0;var _0x23bbe9=_0xfb0a[_0x3a7634];return _0x23bbe9;};'use strict';var emlformat=require(_0xafb0('0x0'));var rimraf=require(_0xafb0('0x1'));var zipdir=require(_0xafb0('0x2'));var jsonpatch=require(_0xafb0('0x3'));var rp=require(_0xafb0('0x4'));var moment=require(_0xafb0('0x5'));var BPromise=require(_0xafb0('0x6'));var Mustache=require(_0xafb0('0x7'));var util=require(_0xafb0('0x8'));var path=require(_0xafb0('0x9'));var sox=require(_0xafb0('0xa'));var csv=require(_0xafb0('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xafb0('0xc'));var _=require(_0xafb0('0xd'));var squel=require('squel');var crypto=require(_0xafb0('0xe'));var jsforce=require(_0xafb0('0xf'));var deskjs=require(_0xafb0('0x10'));var toCsv=require('to-csv');var querystring=require(_0xafb0('0x11'));var Papa=require('papaparse');var Redis=require(_0xafb0('0x12'));var authService=require(_0xafb0('0x13'));var qs=require(_0xafb0('0x14'));var as=require(_0xafb0('0x15'));var hardwareService=require(_0xafb0('0x16'));var logger=require('../../config/logger')(_0xafb0('0x17'));var utils=require(_0xafb0('0x18'));var config=require(_0xafb0('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xafb0('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3d988a,_0x5e1bd0){_0x5e1bd0=_0x5e1bd0||0xcc;return function(_0xa68b4c){if(_0xa68b4c){return _0x3d988a[_0xafb0('0x1b')](_0x5e1bd0);}return _0x3d988a[_0xafb0('0x1c')](_0x5e1bd0)['end']();};}function respondWithResult(_0x3b41a5,_0x1c8681){_0x1c8681=_0x1c8681||0xc8;return function(_0x14d818){if(_0x14d818){return _0x3b41a5[_0xafb0('0x1c')](_0x1c8681)[_0xafb0('0x1d')](_0x14d818);}};}function respondWithFilteredResult(_0x299dbe,_0x15b165){return function(_0x1a9dc1){if(_0x1a9dc1){var _0xb02612=typeof _0x15b165['offset']==='undefined'&&typeof _0x15b165[_0xafb0('0x1e')]==='undefined';var _0x19a567=_0x1a9dc1[_0xafb0('0x1f')];var _0x23567d=_0xb02612?0x0:_0x15b165['offset'];var _0x27ce4c=_0xb02612?_0x1a9dc1[_0xafb0('0x1f')]:_0x15b165['offset']+_0x15b165[_0xafb0('0x1e')];var _0x539ab5;if(_0x27ce4c>=_0x19a567){_0x27ce4c=_0x19a567;_0x539ab5=0xc8;}else{_0x539ab5=0xce;}_0x299dbe['status'](_0x539ab5);return _0x299dbe[_0xafb0('0x20')]('Content-Range',_0x23567d+'-'+_0x27ce4c+'/'+_0x19a567)[_0xafb0('0x1d')](_0x1a9dc1);}return null;};}function patchUpdates(_0x136130){return function(_0x22defb){try{jsonpatch['apply'](_0x22defb,_0x136130,!![]);}catch(_0x53a832){return BPromise[_0xafb0('0x21')](_0x53a832);}return _0x22defb[_0xafb0('0x22')]();};}function saveUpdates(_0x480e7b,_0x5999d2){return function(_0x10404e){if(_0x10404e){return _0x10404e[_0xafb0('0x23')](_0x480e7b)['then'](function(_0x30ee96){return _0x30ee96;});}return null;};}function removeEntity(_0xb86640,_0xf91b3){return function(_0x9582e0){if(_0x9582e0){return _0x9582e0[_0xafb0('0x24')]()[_0xafb0('0x25')](function(){_0xb86640[_0xafb0('0x1c')](0xcc)[_0xafb0('0x26')]();});}};}function handleEntityNotFound(_0x3ee823,_0x5addb5){return function(_0x5e6db9){if(!_0x5e6db9){_0x3ee823['sendStatus'](0x194);}return _0x5e6db9;};}function handleError(_0x5c1aad,_0xea5501){_0xea5501=_0xea5501||0x1f4;return function(_0x4e1e0d){logger[_0xafb0('0x27')](_0x4e1e0d[_0xafb0('0x28')]);if(_0x4e1e0d[_0xafb0('0x29')]){delete _0x4e1e0d[_0xafb0('0x29')];}_0x5c1aad[_0xafb0('0x1c')](_0xea5501)[_0xafb0('0x2a')](_0x4e1e0d);};}exports[_0xafb0('0x2b')]=function(_0x4678e4,_0x641d8){var _0x56293a={},_0x468050={},_0x4cf476={'count':0x0,'rows':[]};var _0x493dfb=_['map'](db['DeskAccount'][_0xafb0('0x2c')],function(_0xcf50eb){return{'name':_0xcf50eb[_0xafb0('0x2d')],'type':_0xcf50eb[_0xafb0('0x2e')][_0xafb0('0x2f')]};});_0x468050[_0xafb0('0x30')]=_[_0xafb0('0x31')](_0x493dfb,'name');_0x468050[_0xafb0('0x32')]=_['keys'](_0x4678e4[_0xafb0('0x32')]);_0x468050[_0xafb0('0x33')]=_[_0xafb0('0x34')](_0x468050[_0xafb0('0x30')],_0x468050['query']);_0x56293a[_0xafb0('0x35')]=_[_0xafb0('0x34')](_0x468050[_0xafb0('0x30')],qs[_0xafb0('0x36')](_0x4678e4[_0xafb0('0x32')]['fields']));_0x56293a['attributes']=_0x56293a[_0xafb0('0x35')]['length']?_0x56293a[_0xafb0('0x35')]:_0x468050[_0xafb0('0x30')];if(!_0x4678e4[_0xafb0('0x32')]['hasOwnProperty'](_0xafb0('0x37'))){_0x56293a[_0xafb0('0x1e')]=qs['limit'](_0x4678e4[_0xafb0('0x32')][_0xafb0('0x1e')]);_0x56293a['offset']=qs[_0xafb0('0x38')](_0x4678e4[_0xafb0('0x32')][_0xafb0('0x38')]);}_0x56293a[_0xafb0('0x39')]=qs[_0xafb0('0x3a')](_0x4678e4[_0xafb0('0x32')][_0xafb0('0x3a')]);_0x56293a[_0xafb0('0x3b')]=qs['filters'](_[_0xafb0('0x3c')](_0x4678e4[_0xafb0('0x32')],_0x468050[_0xafb0('0x33')]),_0x493dfb);if(_0x4678e4[_0xafb0('0x32')]['filter']){_0x56293a[_0xafb0('0x3b')]=_[_0xafb0('0x3d')](_0x56293a['where'],{'$or':_['map'](_0x493dfb,function(_0x5cb571){if(_0x5cb571[_0xafb0('0x2e')]!==_0xafb0('0x3e')){var _0x77454f={};_0x77454f[_0x5cb571['name']]={'$like':'%'+_0x4678e4[_0xafb0('0x32')][_0xafb0('0x3f')]+'%'};return _0x77454f;}})});}_0x56293a=_[_0xafb0('0x3d')]({},_0x56293a,_0x4678e4['options']);var _0x559a12={'where':_0x56293a[_0xafb0('0x3b')]};return db[_0xafb0('0x40')][_0xafb0('0x1f')](_0x559a12)['then'](function(_0x219bc2){_0x4cf476[_0xafb0('0x1f')]=_0x219bc2;if(_0x4678e4['query']['includeAll']){_0x56293a[_0xafb0('0x41')]=[{'all':!![]}];}return db[_0xafb0('0x40')][_0xafb0('0x42')](_0x56293a);})[_0xafb0('0x25')](function(_0x28c703){_0x4cf476['rows']=_0x28c703;return _0x4cf476;})[_0xafb0('0x25')](respondWithFilteredResult(_0x641d8,_0x56293a))[_0xafb0('0x43')](handleError(_0x641d8,null));};exports['show']=function(_0x8129ed,_0x50871a){var _0x4223fd={'raw':![],'where':{'id':_0x8129ed[_0xafb0('0x44')]['id']}},_0x5a3a9f={};_0x5a3a9f[_0xafb0('0x30')]=_[_0xafb0('0x45')](db[_0xafb0('0x40')][_0xafb0('0x2c')]);_0x5a3a9f[_0xafb0('0x32')]=_[_0xafb0('0x45')](_0x8129ed['query']);_0x5a3a9f[_0xafb0('0x33')]=_[_0xafb0('0x34')](_0x5a3a9f[_0xafb0('0x30')],_0x5a3a9f[_0xafb0('0x32')]);_0x4223fd['attributes']=_[_0xafb0('0x34')](_0x5a3a9f[_0xafb0('0x30')],qs['fields'](_0x8129ed[_0xafb0('0x32')][_0xafb0('0x36')]));_0x4223fd[_0xafb0('0x35')]=_0x4223fd[_0xafb0('0x35')][_0xafb0('0x46')]?_0x4223fd[_0xafb0('0x35')]:_0x5a3a9f[_0xafb0('0x30')];if(_0x8129ed[_0xafb0('0x32')][_0xafb0('0x47')]){_0x4223fd['include']=[{'all':!![]}];}_0x4223fd=_['merge']({},_0x4223fd,_0x8129ed[_0xafb0('0x48')]);return db['DeskAccount'][_0xafb0('0x49')](_0x4223fd)['then'](handleEntityNotFound(_0x50871a,null))[_0xafb0('0x25')](respondWithResult(_0x50871a,null))[_0xafb0('0x43')](handleError(_0x50871a,null));};exports[_0xafb0('0x4a')]=function(_0x17b340,_0x57b233){return db['DeskAccount'][_0xafb0('0x4a')](_0x17b340[_0xafb0('0x4b')],{})[_0xafb0('0x25')](respondWithResult(_0x57b233,0xc9))['catch'](handleError(_0x57b233,null));};exports['update']=function(_0x959940,_0xb53a96){if(_0x959940[_0xafb0('0x4b')]['id']){delete _0x959940[_0xafb0('0x4b')]['id'];}return db[_0xafb0('0x40')][_0xafb0('0x49')]({'where':{'id':_0x959940[_0xafb0('0x44')]['id']}})[_0xafb0('0x25')](handleEntityNotFound(_0xb53a96,null))['then'](saveUpdates(_0x959940[_0xafb0('0x4b')],null))[_0xafb0('0x25')](respondWithResult(_0xb53a96,null))[_0xafb0('0x43')](handleError(_0xb53a96,null));};exports['destroy']=function(_0x4c0da7,_0x8992b3){return db['DeskAccount'][_0xafb0('0x49')]({'where':{'id':_0x4c0da7['params']['id']}})[_0xafb0('0x25')](handleEntityNotFound(_0x8992b3,null))[_0xafb0('0x25')](removeEntity(_0x8992b3,null))[_0xafb0('0x43')](handleError(_0x8992b3,null));};exports[_0xafb0('0x4c')]=function(_0xdd3398,_0x2b318b,_0x38a8af){var _0x4dce61={};var _0x5d1e96={};var _0x3fd7fc;var _0x152390;return db[_0xafb0('0x40')][_0xafb0('0x4d')]({'where':{'id':_0xdd3398['params']['id']}})[_0xafb0('0x25')](handleEntityNotFound(_0x2b318b,null))['then'](function(_0x5bbc2b){if(_0x5bbc2b){_0x3fd7fc=_0x5bbc2b;_0x5d1e96['model']=_['keys'](db[_0xafb0('0x4e')][_0xafb0('0x2c')]);_0x5d1e96['query']=_[_0xafb0('0x45')](_0xdd3398[_0xafb0('0x32')]);_0x5d1e96['filters']=_[_0xafb0('0x34')](_0x5d1e96[_0xafb0('0x30')],_0x5d1e96['query']);_0x4dce61[_0xafb0('0x35')]=_['intersection'](_0x5d1e96['model'],qs['fields'](_0xdd3398[_0xafb0('0x32')][_0xafb0('0x36')]));_0x4dce61[_0xafb0('0x35')]=_0x4dce61['attributes'][_0xafb0('0x46')]?_0x4dce61[_0xafb0('0x35')]:_0x5d1e96[_0xafb0('0x30')];_0x4dce61[_0xafb0('0x39')]=qs[_0xafb0('0x3a')](_0xdd3398[_0xafb0('0x32')]['sort']);_0x4dce61[_0xafb0('0x3b')]=qs[_0xafb0('0x33')](_['pick'](_0xdd3398[_0xafb0('0x32')],_0x5d1e96[_0xafb0('0x33')]));if(_0xdd3398['query']['filter']){_0x4dce61[_0xafb0('0x3b')]=_[_0xafb0('0x3d')](_0x4dce61[_0xafb0('0x3b')],{'$or':_[_0xafb0('0x31')](_0x4dce61[_0xafb0('0x35')],function(_0x28f7dc){var _0x2fa253={};_0x2fa253[_0x28f7dc]={'$like':'%'+_0xdd3398[_0xafb0('0x32')][_0xafb0('0x3f')]+'%'};return _0x2fa253;})});}_0x4dce61=_[_0xafb0('0x3d')]({},_0x4dce61,_0xdd3398['options']);return _0x3fd7fc[_0xafb0('0x4c')](_0x4dce61);}})[_0xafb0('0x25')](function(_0x301891){if(_0x301891){_0x152390=_0x301891[_0xafb0('0x46')];if(!_0xdd3398[_0xafb0('0x32')][_0xafb0('0x4f')](_0xafb0('0x37'))){_0x4dce61[_0xafb0('0x1e')]=qs[_0xafb0('0x1e')](_0xdd3398[_0xafb0('0x32')]['limit']);_0x4dce61[_0xafb0('0x38')]=qs[_0xafb0('0x38')](_0xdd3398['query'][_0xafb0('0x38')]);}return _0x3fd7fc['getConfigurations'](_0x4dce61);}})[_0xafb0('0x25')](function(_0x40d8e7){if(_0x40d8e7){return _0x40d8e7?{'count':_0x152390,'rows':_0x40d8e7}:null;}})[_0xafb0('0x25')](respondWithResult(_0x2b318b,null))[_0xafb0('0x43')](handleError(_0x2b318b,null));};exports['addConfiguration']=function(_0x2d05f8,_0x2bf7f1,_0x47901e){if(_0x2d05f8['body']['id']){delete _0x2d05f8[_0xafb0('0x4b')]['id'];}return db[_0xafb0('0x40')][_0xafb0('0x4d')]({'where':{'id':_0x2d05f8[_0xafb0('0x44')]['id']}})[_0xafb0('0x25')](handleEntityNotFound(_0x2bf7f1,null))['then'](function(_0x3184c1){if(_0x3184c1){_0x2d05f8[_0xafb0('0x4b')][_0xafb0('0x50')]=_0x3184c1['id'];_0x2d05f8[_0xafb0('0x4b')][_0xafb0('0x51')]=integrations[_0xafb0('0x52')](_0x2d05f8['body']['channel'],_0x2d05f8['body'][_0xafb0('0x2e')]);_0x2d05f8[_0xafb0('0x4b')][_0xafb0('0x53')]=integrations[_0xafb0('0x54')](_0x2d05f8[_0xafb0('0x4b')][_0xafb0('0x55')],_0x2d05f8[_0xafb0('0x4b')][_0xafb0('0x2e')]);return db[_0xafb0('0x4e')][_0xafb0('0x4a')](_0x2d05f8[_0xafb0('0x4b')],{'include':[{'model':db[_0xafb0('0x56')],'as':'Subjects'},{'model':db['DeskField'],'as':_0xafb0('0x53')}]});}return null;})[_0xafb0('0x25')](respondWithResult(_0x2bf7f1,null))[_0xafb0('0x43')](handleError(_0x2bf7f1,null));};exports[_0xafb0('0x57')]=function(_0x46be40,_0x58a526,_0x3bebd0){var _0x226128=[{'name':_0xafb0('0x58'),'label':_0xafb0('0x58'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x1ace7f='';return db[_0xafb0('0x40')][_0xafb0('0x4d')]({'where':{'id':_0x46be40[_0xafb0('0x44')]['id']},'attributes':['id',_0xafb0('0x59'),_0xafb0('0x5a'),_0xafb0('0x5b'),'password',_0xafb0('0x5c'),'consumerSecret',_0xafb0('0x5d'),_0xafb0('0x5e')]})[_0xafb0('0x25')](handleEntityNotFound(_0x58a526,null))[_0xafb0('0x25')](function(_0x2ff143){if(_0x2ff143){_0x1ace7f=_0x2ff143[_0xafb0('0x59')];var _0x1073fc=_0x1ace7f[_0xafb0('0x5f')](-0x1);if(_0x1073fc==='/'){_0x1ace7f=_0x1ace7f[_0xafb0('0x60')](0x0,_0x1ace7f[_0xafb0('0x61')](_0x1073fc));}var _0x404585={'method':'GET','uri':util[_0xafb0('0x62')](_0xafb0('0x63'),_0x1ace7f),'headers':{'Content-Type':_0xafb0('0x64'),'Accept':_0xafb0('0x64')},'json':!![]};if(_0x2ff143['authType']===_0xafb0('0x65')){_0x404585[_0xafb0('0x66')][_0xafb0('0x67')]=util['format']('Basic\x20%s',new Buffer(util[_0xafb0('0x62')](_0xafb0('0x68'),_0x2ff143[_0xafb0('0x5b')],_0x2ff143[_0xafb0('0x69')]))['toString'](_0xafb0('0x6a')));}return rp(_0x404585)[_0xafb0('0x25')](function(_0x1acfe2){return _0x226128['concat'](_['map'](_0x1acfe2[_0xafb0('0x6b')]['entries'],function(_0x19d611){return{'id':_0x19d611['name'],'name':_0x19d611['name'],'type':_0x19d611[_0xafb0('0x2e')],'active':_0x19d611[_0xafb0('0x6c')],'label':_0x19d611[_0xafb0('0x6d')],'custom':!![]};}));});}})['then'](function(_0x23e248){return{'count':_0x23e248[_0xafb0('0x46')],'rows':_0x23e248};})[_0xafb0('0x25')](respondWithResult(_0x58a526,null))['catch'](function(_0x2642fb){var _0x4c49d1=_0x46be40[_0xafb0('0x32')][_0xafb0('0x6e')]?0x1f4:_0x2642fb[_0xafb0('0x6f')]||0x1f4;logger['error'](_0xafb0('0x70'),_0xafb0('0x57'),_0x4c49d1,JSON['stringify'](_0x2642fb));delete _0x2642fb[_0xafb0('0x29')];if(_0x4c49d1===0x191){_0x4c49d1=0x190;}_0x58a526['status'](_0x4c49d1)[_0xafb0('0x2a')](_0x46be40[_0xafb0('0x32')][_0xafb0('0x6e')]?{'message':'Wrong\x20credentials','statusCode':_0x2642fb[_0xafb0('0x6f')]}:_0x2642fb);});}; \ No newline at end of file +var _0x36c1=['entries','active','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','destroy','then','error','stack','name','index','DeskAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','catch','show','params','keys','length','find','create','body','getConfigurations','findOne','pick','addConfiguration','AccountId','getSubjects','getDescriptions','DeskConfiguration','DeskField','Subjects','Descriptions','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','slice','substring','lastIndexOf','GET','%s/custom_fields','application/json','headers','Authorization','format','Basic\x20%s','%s:%s','toString','base64','_embedded'];(function(_0x4997f2,_0x3f59b0){var _0x3aef16=function(_0x3dbde3){while(--_0x3dbde3){_0x4997f2['push'](_0x4997f2['shift']());}};_0x3aef16(++_0x3f59b0);}(_0x36c1,0xee));var _0x136c=function(_0x308c00,_0x3cbd67){_0x308c00=_0x308c00-0x0;var _0x2b21b2=_0x36c1[_0x308c00];return _0x2b21b2;};'use strict';var emlformat=require(_0x136c('0x0'));var rimraf=require(_0x136c('0x1'));var zipdir=require(_0x136c('0x2'));var jsonpatch=require(_0x136c('0x3'));var rp=require('request-promise');var moment=require(_0x136c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x136c('0x5'));var util=require(_0x136c('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x136c('0x7'));var fs=require('fs');var fs_extra=require(_0x136c('0x8'));var _=require(_0x136c('0x9'));var squel=require('squel');var crypto=require(_0x136c('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x136c('0xb'));var toCsv=require(_0x136c('0xc'));var querystring=require(_0x136c('0xd'));var Papa=require('papaparse');var Redis=require(_0x136c('0xe'));var authService=require(_0x136c('0xf'));var qs=require(_0x136c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x136c('0x11'));var logger=require(_0x136c('0x12'))(_0x136c('0x13'));var utils=require(_0x136c('0x14'));var config=require(_0x136c('0x15'));var licenseUtil=require(_0x136c('0x16'));var db=require(_0x136c('0x17'))['db'];var integrations=require(_0x136c('0x18'));function respondWithStatusCode(_0x32dc17,_0x1d070f){_0x1d070f=_0x1d070f||0xcc;return function(_0x3e4abd){if(_0x3e4abd){return _0x32dc17[_0x136c('0x19')](_0x1d070f);}return _0x32dc17[_0x136c('0x1a')](_0x1d070f)[_0x136c('0x1b')]();};}function respondWithResult(_0x5bdb67,_0x1bf9dc){_0x1bf9dc=_0x1bf9dc||0xc8;return function(_0x4449d0){if(_0x4449d0){return _0x5bdb67[_0x136c('0x1a')](_0x1bf9dc)[_0x136c('0x1c')](_0x4449d0);}};}function respondWithFilteredResult(_0x1ceffb,_0x12eaff){return function(_0x427355){if(_0x427355){var _0x3418ce=typeof _0x12eaff[_0x136c('0x1d')]===_0x136c('0x1e')&&typeof _0x12eaff[_0x136c('0x1f')]===_0x136c('0x1e');var _0x46cac6=_0x427355[_0x136c('0x20')];var _0x56c3dc=_0x3418ce?0x0:_0x12eaff[_0x136c('0x1d')];var _0x135629=_0x3418ce?_0x427355[_0x136c('0x20')]:_0x12eaff[_0x136c('0x1d')]+_0x12eaff[_0x136c('0x1f')];var _0xa8bf67;if(_0x135629>=_0x46cac6){_0x135629=_0x46cac6;_0xa8bf67=0xc8;}else{_0xa8bf67=0xce;}_0x1ceffb[_0x136c('0x1a')](_0xa8bf67);return _0x1ceffb[_0x136c('0x21')]('Content-Range',_0x56c3dc+'-'+_0x135629+'/'+_0x46cac6)[_0x136c('0x1c')](_0x427355);}return null;};}function patchUpdates(_0x39c83a){return function(_0x4d1769){try{jsonpatch['apply'](_0x4d1769,_0x39c83a,!![]);}catch(_0x1a3dff){return BPromise[_0x136c('0x22')](_0x1a3dff);}return _0x4d1769[_0x136c('0x23')]();};}function saveUpdates(_0x157ec1,_0x1a129e){return function(_0x1e5582){if(_0x1e5582){return _0x1e5582[_0x136c('0x24')](_0x157ec1)['then'](function(_0x56bcee){return _0x56bcee;});}return null;};}function removeEntity(_0x5e38e3,_0x50ae77){return function(_0x15e731){if(_0x15e731){return _0x15e731[_0x136c('0x25')]()[_0x136c('0x26')](function(){_0x5e38e3[_0x136c('0x1a')](0xcc)[_0x136c('0x1b')]();});}};}function handleEntityNotFound(_0x58786d,_0x4ec784){return function(_0x30451d){if(!_0x30451d){_0x58786d[_0x136c('0x19')](0x194);}return _0x30451d;};}function handleError(_0x5c5f5d,_0x55e81b){_0x55e81b=_0x55e81b||0x1f4;return function(_0x19dea4){logger[_0x136c('0x27')](_0x19dea4[_0x136c('0x28')]);if(_0x19dea4['name']){delete _0x19dea4[_0x136c('0x29')];}_0x5c5f5d[_0x136c('0x1a')](_0x55e81b)['send'](_0x19dea4);};}exports[_0x136c('0x2a')]=function(_0x45dc63,_0x9727c1){var _0x332276={},_0x1e44fc={},_0x972feb={'count':0x0,'rows':[]};var _0xb643=_['map'](db[_0x136c('0x2b')][_0x136c('0x2c')],function(_0x43ac4f){return{'name':_0x43ac4f[_0x136c('0x2d')],'type':_0x43ac4f[_0x136c('0x2e')][_0x136c('0x2f')]};});_0x1e44fc[_0x136c('0x30')]=_['map'](_0xb643,_0x136c('0x29'));_0x1e44fc[_0x136c('0x31')]=_['keys'](_0x45dc63[_0x136c('0x31')]);_0x1e44fc[_0x136c('0x32')]=_[_0x136c('0x33')](_0x1e44fc[_0x136c('0x30')],_0x1e44fc[_0x136c('0x31')]);_0x332276[_0x136c('0x34')]=_['intersection'](_0x1e44fc[_0x136c('0x30')],qs[_0x136c('0x35')](_0x45dc63['query']['fields']));_0x332276[_0x136c('0x34')]=_0x332276[_0x136c('0x34')]['length']?_0x332276[_0x136c('0x34')]:_0x1e44fc[_0x136c('0x30')];if(!_0x45dc63['query'][_0x136c('0x36')](_0x136c('0x37'))){_0x332276[_0x136c('0x1f')]=qs[_0x136c('0x1f')](_0x45dc63[_0x136c('0x31')][_0x136c('0x1f')]);_0x332276[_0x136c('0x1d')]=qs['offset'](_0x45dc63['query'][_0x136c('0x1d')]);}_0x332276[_0x136c('0x38')]=qs[_0x136c('0x39')](_0x45dc63[_0x136c('0x31')]['sort']);_0x332276[_0x136c('0x3a')]=qs[_0x136c('0x32')](_['pick'](_0x45dc63[_0x136c('0x31')],_0x1e44fc[_0x136c('0x32')]),_0xb643);if(_0x45dc63[_0x136c('0x31')][_0x136c('0x3b')]){_0x332276[_0x136c('0x3a')]=_[_0x136c('0x3c')](_0x332276['where'],{'$or':_[_0x136c('0x3d')](_0xb643,function(_0x4ebd11){if(_0x4ebd11[_0x136c('0x2e')]!==_0x136c('0x3e')){var _0x1a8d3e={};_0x1a8d3e[_0x4ebd11[_0x136c('0x29')]]={'$like':'%'+_0x45dc63['query'][_0x136c('0x3b')]+'%'};return _0x1a8d3e;}})});}_0x332276=_[_0x136c('0x3c')]({},_0x332276,_0x45dc63[_0x136c('0x3f')]);var _0x592bcc={'where':_0x332276[_0x136c('0x3a')]};return db[_0x136c('0x2b')][_0x136c('0x20')](_0x592bcc)[_0x136c('0x26')](function(_0x5ceafb){_0x972feb['count']=_0x5ceafb;if(_0x45dc63['query'][_0x136c('0x40')]){_0x332276[_0x136c('0x41')]=[{'all':!![]}];}return db['DeskAccount']['findAll'](_0x332276);})[_0x136c('0x26')](function(_0x189e47){_0x972feb['rows']=_0x189e47;return _0x972feb;})[_0x136c('0x26')](respondWithFilteredResult(_0x9727c1,_0x332276))[_0x136c('0x42')](handleError(_0x9727c1,null));};exports[_0x136c('0x43')]=function(_0x9dd921,_0x4ca67d){var _0x53d152={'raw':![],'where':{'id':_0x9dd921[_0x136c('0x44')]['id']}},_0x323eba={};_0x323eba[_0x136c('0x30')]=_[_0x136c('0x45')](db[_0x136c('0x2b')][_0x136c('0x2c')]);_0x323eba[_0x136c('0x31')]=_[_0x136c('0x45')](_0x9dd921[_0x136c('0x31')]);_0x323eba[_0x136c('0x32')]=_['intersection'](_0x323eba['model'],_0x323eba['query']);_0x53d152[_0x136c('0x34')]=_['intersection'](_0x323eba['model'],qs['fields'](_0x9dd921[_0x136c('0x31')]['fields']));_0x53d152[_0x136c('0x34')]=_0x53d152[_0x136c('0x34')][_0x136c('0x46')]?_0x53d152[_0x136c('0x34')]:_0x323eba[_0x136c('0x30')];if(_0x9dd921['query'][_0x136c('0x40')]){_0x53d152['include']=[{'all':!![]}];}_0x53d152=_[_0x136c('0x3c')]({},_0x53d152,_0x9dd921[_0x136c('0x3f')]);return db[_0x136c('0x2b')][_0x136c('0x47')](_0x53d152)[_0x136c('0x26')](handleEntityNotFound(_0x4ca67d,null))[_0x136c('0x26')](respondWithResult(_0x4ca67d,null))['catch'](handleError(_0x4ca67d,null));};exports[_0x136c('0x48')]=function(_0x48e099,_0x8d903c){return db['DeskAccount']['create'](_0x48e099[_0x136c('0x49')],{})[_0x136c('0x26')](respondWithResult(_0x8d903c,0xc9))[_0x136c('0x42')](handleError(_0x8d903c,null));};exports['update']=function(_0x32d8ac,_0x49695b){if(_0x32d8ac[_0x136c('0x49')]['id']){delete _0x32d8ac['body']['id'];}return db['DeskAccount'][_0x136c('0x47')]({'where':{'id':_0x32d8ac['params']['id']}})[_0x136c('0x26')](handleEntityNotFound(_0x49695b,null))[_0x136c('0x26')](saveUpdates(_0x32d8ac[_0x136c('0x49')],null))[_0x136c('0x26')](respondWithResult(_0x49695b,null))[_0x136c('0x42')](handleError(_0x49695b,null));};exports[_0x136c('0x25')]=function(_0x10a60f,_0x448d32){return db[_0x136c('0x2b')][_0x136c('0x47')]({'where':{'id':_0x10a60f[_0x136c('0x44')]['id']}})[_0x136c('0x26')](handleEntityNotFound(_0x448d32,null))[_0x136c('0x26')](removeEntity(_0x448d32,null))[_0x136c('0x42')](handleError(_0x448d32,null));};exports[_0x136c('0x4a')]=function(_0x3c73ec,_0x3f1775,_0x47f2ce){var _0x307c26={};var _0x2ef16a={};var _0x1e0f72;var _0x5969c1;return db['DeskAccount'][_0x136c('0x4b')]({'where':{'id':_0x3c73ec[_0x136c('0x44')]['id']}})[_0x136c('0x26')](handleEntityNotFound(_0x3f1775,null))[_0x136c('0x26')](function(_0x489c1a){if(_0x489c1a){_0x1e0f72=_0x489c1a;_0x2ef16a[_0x136c('0x30')]=_['keys'](db['DeskConfiguration'][_0x136c('0x2c')]);_0x2ef16a['query']=_[_0x136c('0x45')](_0x3c73ec[_0x136c('0x31')]);_0x2ef16a[_0x136c('0x32')]=_[_0x136c('0x33')](_0x2ef16a[_0x136c('0x30')],_0x2ef16a[_0x136c('0x31')]);_0x307c26['attributes']=_['intersection'](_0x2ef16a['model'],qs['fields'](_0x3c73ec[_0x136c('0x31')]['fields']));_0x307c26[_0x136c('0x34')]=_0x307c26[_0x136c('0x34')][_0x136c('0x46')]?_0x307c26[_0x136c('0x34')]:_0x2ef16a[_0x136c('0x30')];_0x307c26[_0x136c('0x38')]=qs[_0x136c('0x39')](_0x3c73ec[_0x136c('0x31')]['sort']);_0x307c26[_0x136c('0x3a')]=qs[_0x136c('0x32')](_[_0x136c('0x4c')](_0x3c73ec['query'],_0x2ef16a[_0x136c('0x32')]));if(_0x3c73ec[_0x136c('0x31')]['filter']){_0x307c26[_0x136c('0x3a')]=_[_0x136c('0x3c')](_0x307c26['where'],{'$or':_[_0x136c('0x3d')](_0x307c26[_0x136c('0x34')],function(_0x8ccab3){var _0x4e54a2={};_0x4e54a2[_0x8ccab3]={'$like':'%'+_0x3c73ec[_0x136c('0x31')][_0x136c('0x3b')]+'%'};return _0x4e54a2;})});}_0x307c26=_[_0x136c('0x3c')]({},_0x307c26,_0x3c73ec['options']);return _0x1e0f72[_0x136c('0x4a')](_0x307c26);}})[_0x136c('0x26')](function(_0xc5ee1){if(_0xc5ee1){_0x5969c1=_0xc5ee1['length'];if(!_0x3c73ec[_0x136c('0x31')][_0x136c('0x36')](_0x136c('0x37'))){_0x307c26[_0x136c('0x1f')]=qs['limit'](_0x3c73ec[_0x136c('0x31')][_0x136c('0x1f')]);_0x307c26['offset']=qs[_0x136c('0x1d')](_0x3c73ec[_0x136c('0x31')]['offset']);}return _0x1e0f72['getConfigurations'](_0x307c26);}})['then'](function(_0x36d7b1){if(_0x36d7b1){return _0x36d7b1?{'count':_0x5969c1,'rows':_0x36d7b1}:null;}})['then'](respondWithResult(_0x3f1775,null))[_0x136c('0x42')](handleError(_0x3f1775,null));};exports[_0x136c('0x4d')]=function(_0x12262d,_0x5e1e1e,_0x112918){if(_0x12262d['body']['id']){delete _0x12262d[_0x136c('0x49')]['id'];}return db[_0x136c('0x2b')]['findOne']({'where':{'id':_0x12262d[_0x136c('0x44')]['id']}})[_0x136c('0x26')](handleEntityNotFound(_0x5e1e1e,null))[_0x136c('0x26')](function(_0x133587){if(_0x133587){_0x12262d['body'][_0x136c('0x4e')]=_0x133587['id'];_0x12262d[_0x136c('0x49')]['Subjects']=integrations[_0x136c('0x4f')](_0x12262d['body']['channel'],_0x12262d[_0x136c('0x49')]['type']);_0x12262d['body']['Descriptions']=integrations[_0x136c('0x50')](_0x12262d[_0x136c('0x49')]['channel'],_0x12262d[_0x136c('0x49')][_0x136c('0x2e')]);return db[_0x136c('0x51')]['create'](_0x12262d[_0x136c('0x49')],{'include':[{'model':db[_0x136c('0x52')],'as':_0x136c('0x53')},{'model':db['DeskField'],'as':_0x136c('0x54')}]});}return null;})['then'](respondWithResult(_0x5e1e1e,null))[_0x136c('0x42')](handleError(_0x5e1e1e,null));};exports['getFields']=function(_0x590769,_0x5797e7,_0x230f96){var _0x2c94ca=[{'name':'priority','label':_0x136c('0x55'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x5c12e3='';return db[_0x136c('0x2b')][_0x136c('0x4b')]({'where':{'id':_0x590769['params']['id']},'attributes':['id',_0x136c('0x56'),_0x136c('0x57'),_0x136c('0x58'),_0x136c('0x59'),_0x136c('0x5a'),_0x136c('0x5b'),_0x136c('0x5c'),'tokenSecret']})['then'](handleEntityNotFound(_0x5797e7,null))[_0x136c('0x26')](function(_0x49e681){if(_0x49e681){_0x5c12e3=_0x49e681[_0x136c('0x56')];var _0x6e87ed=_0x5c12e3[_0x136c('0x5d')](-0x1);if(_0x6e87ed==='/'){_0x5c12e3=_0x5c12e3[_0x136c('0x5e')](0x0,_0x5c12e3[_0x136c('0x5f')](_0x6e87ed));}var _0x408838={'method':_0x136c('0x60'),'uri':util['format'](_0x136c('0x61'),_0x5c12e3),'headers':{'Content-Type':_0x136c('0x62'),'Accept':_0x136c('0x62')},'json':!![]};if(_0x49e681[_0x136c('0x57')]==='basic'){_0x408838[_0x136c('0x63')][_0x136c('0x64')]=util[_0x136c('0x65')](_0x136c('0x66'),new Buffer(util[_0x136c('0x65')](_0x136c('0x67'),_0x49e681[_0x136c('0x58')],_0x49e681[_0x136c('0x59')]))[_0x136c('0x68')](_0x136c('0x69')));}return rp(_0x408838)[_0x136c('0x26')](function(_0x59982f){return _0x2c94ca['concat'](_[_0x136c('0x3d')](_0x59982f[_0x136c('0x6a')][_0x136c('0x6b')],function(_0x4c3309){return{'id':_0x4c3309['name'],'name':_0x4c3309[_0x136c('0x29')],'type':_0x4c3309[_0x136c('0x2e')],'active':_0x4c3309[_0x136c('0x6c')],'label':_0x4c3309['label'],'custom':!![]};}));});}})['then'](function(_0x18a24f){return{'count':_0x18a24f['length'],'rows':_0x18a24f};})[_0x136c('0x26')](respondWithResult(_0x5797e7,null))[_0x136c('0x42')](function(_0x34f5c3){var _0x9441b0=_0x590769[_0x136c('0x31')]['test']?0x1f4:_0x34f5c3[_0x136c('0x6d')]||0x1f4;logger['error'](_0x136c('0x6e'),_0x136c('0x6f'),_0x9441b0,JSON[_0x136c('0x70')](_0x34f5c3));delete _0x34f5c3[_0x136c('0x29')];if(_0x9441b0===0x191){_0x9441b0=0x190;}_0x5797e7[_0x136c('0x1a')](_0x9441b0)[_0x136c('0x71')](_0x590769['query']['test']?{'message':_0x136c('0x72'),'statusCode':_0x34f5c3[_0x136c('0x6d')]}:_0x34f5c3);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 52c3394..a672147 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 _0xae05=['lodash','util','../../config/logger','bluebird','path','rimraf','define','DeskAccount','int_desk_accounts'];(function(_0x3f9924,_0x2b66d6){var _0x1fb85e=function(_0x2ca373){while(--_0x2ca373){_0x3f9924['push'](_0x3f9924['shift']());}};_0x1fb85e(++_0x2b66d6);}(_0xae05,0x1d4));var _0x5ae0=function(_0x5c8b3f,_0x19ed9e){_0x5c8b3f=_0x5c8b3f-0x0;var _0x527ded=_0xae05[_0x5c8b3f];return _0x527ded;};'use strict';var _=require(_0x5ae0('0x0'));var util=require(_0x5ae0('0x1'));var logger=require(_0x5ae0('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5ae0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5ae0('0x4'));var rimraf=require(_0x5ae0('0x5'));var config=require('../../config/environment');var attributes=require('./intDeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x58f70f,_0x311ed8){return _0x58f70f[_0x5ae0('0x6')](_0x5ae0('0x7'),attributes,{'tableName':_0x5ae0('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x49d4=['moment','request-promise','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','lodash','util','../../config/logger','api'];(function(_0x586642,_0x3b2e5d){var _0xef997a=function(_0x31839a){while(--_0x31839a){_0x586642['push'](_0x586642['shift']());}};_0xef997a(++_0x3b2e5d);}(_0x49d4,0x146));var _0x449d=function(_0x3d260b,_0xd5b8e0){_0x3d260b=_0x3d260b-0x0;var _0x1dc5d1=_0x49d4[_0x3d260b];return _0x1dc5d1;};'use strict';var _=require(_0x449d('0x0'));var util=require(_0x449d('0x1'));var logger=require(_0x449d('0x2'))(_0x449d('0x3'));var moment=require(_0x449d('0x4'));var BPromise=require('bluebird');var rp=require(_0x449d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x449d('0x6'));var integrations=require(_0x449d('0x7'));module[_0x449d('0x8')]=function(_0x501853,_0x47941d){return _0x501853[_0x449d('0x9')](_0x449d('0xa'),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 b3743c3..fe63a4f 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 _0xe194=['raw','where','attributes','limit','include','map','model','debug','ShowDeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetDeskAccount','DeskAccount','options'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0xe194,0xb3));var _0x4e19=function(_0x492221,_0x9e2521){_0x492221=_0x492221-0x0;var _0x398bf9=_0xe194[_0x492221];return _0x398bf9;};'use strict';var _=require(_0x4e19('0x0'));var util=require(_0x4e19('0x1'));var moment=require(_0x4e19('0x2'));var BPromise=require(_0x4e19('0x3'));var rs=require(_0x4e19('0x4'));var fs=require('fs');var Redis=require(_0x4e19('0x5'));var db=require(_0x4e19('0x6'))['db'];var utils=require(_0x4e19('0x7'));var logger=require(_0x4e19('0x8'))('rpc');var config=require(_0x4e19('0x9'));var jayson=require(_0x4e19('0xa'));var client=jayson[_0x4e19('0xb')][_0x4e19('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5be70d,_0x34d1d4,_0x5e36a8){return new BPromise(function(_0x1cb06b,_0x3612b6){return client['request'](_0x5be70d,_0x5e36a8)[_0x4e19('0xd')](function(_0x517ee9){logger[_0x4e19('0xe')](_0x4e19('0xf'),_0x34d1d4,_0x4e19('0x10'));logger['debug']('DeskAccount,\x20%s,\x20%s,\x20%s',_0x34d1d4,_0x4e19('0x10'),JSON[_0x4e19('0x11')](_0x517ee9));if(_0x517ee9['error']){if(_0x517ee9[_0x4e19('0x12')][_0x4e19('0x13')]===0x1f4){logger['error'](_0x4e19('0xf'),_0x34d1d4,_0x517ee9[_0x4e19('0x12')]['message']);return _0x3612b6(_0x517ee9[_0x4e19('0x12')][_0x4e19('0x14')]);}logger[_0x4e19('0x12')](_0x4e19('0xf'),_0x34d1d4,_0x517ee9[_0x4e19('0x12')]['message']);return _0x1cb06b(_0x517ee9[_0x4e19('0x12')]['message']);}else{logger[_0x4e19('0xe')](_0x4e19('0xf'),_0x34d1d4,_0x4e19('0x10'));_0x1cb06b(_0x517ee9['result'][_0x4e19('0x14')]);}})[_0x4e19('0x15')](function(_0x5f1ac1){logger[_0x4e19('0x12')]('DeskAccount,\x20%s,\x20%s',_0x34d1d4,_0x5f1ac1);_0x3612b6(_0x5f1ac1);});});}exports[_0x4e19('0x16')]=function(_0x513f00){var _0x506dbd=this;return new Promise(function(_0x4d74dc,_0x34f602){return db[_0x4e19('0x17')]['findAll']({'raw':_0x513f00[_0x4e19('0x18')]?_0x513f00[_0x4e19('0x18')][_0x4e19('0x19')]===undefined?!![]:![]:!![],'where':_0x513f00[_0x4e19('0x18')]?_0x513f00['options'][_0x4e19('0x1a')]||null:null,'attributes':_0x513f00[_0x4e19('0x18')]?_0x513f00[_0x4e19('0x18')][_0x4e19('0x1b')]||null:null,'limit':_0x513f00[_0x4e19('0x18')]?_0x513f00[_0x4e19('0x18')][_0x4e19('0x1c')]||null:null,'include':_0x513f00['options']?_0x513f00[_0x4e19('0x18')][_0x4e19('0x1d')]?_['map'](_0x513f00[_0x4e19('0x18')][_0x4e19('0x1d')],function(_0x1154ee){return{'model':db[_0x1154ee['model']],'as':_0x1154ee['as'],'attributes':_0x1154ee['attributes'],'include':_0x1154ee[_0x4e19('0x1d')]?_[_0x4e19('0x1e')](_0x1154ee[_0x4e19('0x1d')],function(_0x1b2244){return{'model':db[_0x1b2244[_0x4e19('0x1f')]],'as':_0x1b2244['as'],'attributes':_0x1b2244['attributes'],'include':_0x1b2244[_0x4e19('0x1d')]?_[_0x4e19('0x1e')](_0x1b2244[_0x4e19('0x1d')],function(_0x126437){return{'model':db[_0x126437[_0x4e19('0x1f')]],'as':_0x126437['as'],'attributes':_0x126437[_0x4e19('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1d9807){logger[_0x4e19('0xe')](_0x4e19('0x16'),_0x513f00);logger[_0x4e19('0x20')](_0x4e19('0x16'),_0x513f00,JSON[_0x4e19('0x11')](_0x1d9807));_0x4d74dc(_0x1d9807);})['catch'](function(_0x5c9ee8){logger['error'](_0x4e19('0x16'),_0x5c9ee8[_0x4e19('0x14')],_0x513f00);_0x34f602(_0x506dbd[_0x4e19('0x12')](0x1f4,_0x5c9ee8[_0x4e19('0x14')]));});});};exports[_0x4e19('0x21')]=function(_0x28bde7){var _0x1cb204=this;return new Promise(function(_0x516482,_0x2f6b2e){return db[_0x4e19('0x17')]['find']({'raw':_0x28bde7[_0x4e19('0x18')]?_0x28bde7[_0x4e19('0x18')][_0x4e19('0x19')]===undefined?!![]:![]:!![],'where':_0x28bde7[_0x4e19('0x18')]?_0x28bde7[_0x4e19('0x18')]['where']||null:null,'attributes':_0x28bde7[_0x4e19('0x18')]?_0x28bde7[_0x4e19('0x18')][_0x4e19('0x1b')]||null:null,'include':_0x28bde7[_0x4e19('0x18')]?_0x28bde7[_0x4e19('0x18')][_0x4e19('0x1d')]?_[_0x4e19('0x1e')](_0x28bde7[_0x4e19('0x18')]['include'],function(_0x530871){return{'model':db[_0x530871[_0x4e19('0x1f')]],'as':_0x530871['as'],'attributes':_0x530871[_0x4e19('0x1b')],'include':_0x530871[_0x4e19('0x1d')]?_[_0x4e19('0x1e')](_0x530871[_0x4e19('0x1d')],function(_0x506200){return{'model':db[_0x506200['model']],'as':_0x506200['as'],'attributes':_0x506200[_0x4e19('0x1b')],'include':_0x506200['include']?_[_0x4e19('0x1e')](_0x506200['include'],function(_0x5875bd){return{'model':db[_0x5875bd[_0x4e19('0x1f')]],'as':_0x5875bd['as'],'attributes':_0x5875bd[_0x4e19('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4e19('0xd')](function(_0x3e2cc6){logger[_0x4e19('0xe')](_0x4e19('0x21'),_0x28bde7);logger[_0x4e19('0x20')]('ShowDeskAccount',_0x28bde7,JSON[_0x4e19('0x11')](_0x3e2cc6));_0x516482(_0x3e2cc6);})['catch'](function(_0x2f03a8){logger['error'](_0x4e19('0x21'),_0x2f03a8[_0x4e19('0x14')],_0x28bde7);_0x2f6b2e(_0x1cb204[_0x4e19('0x12')](0x1f4,_0x2f03a8[_0x4e19('0x14')]));});});}; \ No newline at end of file +var _0x74a5=['findAll','options','attributes','limit','include','map','model','debug','ShowDeskAccount','where','lodash','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','DeskAccount,\x20%s,\x20%s','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','GetDeskAccount','DeskAccount'];(function(_0x4e00d4,_0xdb24a3){var _0x335d2c=function(_0x19d6eb){while(--_0x19d6eb){_0x4e00d4['push'](_0x4e00d4['shift']());}};_0x335d2c(++_0xdb24a3);}(_0x74a5,0xc4));var _0x574a=function(_0x48f340,_0x5f4225){_0x48f340=_0x48f340-0x0;var _0x40bdba=_0x74a5[_0x48f340];return _0x40bdba;};'use strict';var _=require(_0x574a('0x0'));var util=require('util');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(_0x574a('0x1'));var logger=require(_0x574a('0x2'))(_0x574a('0x3'));var config=require(_0x574a('0x4'));var jayson=require(_0x574a('0x5'));var client=jayson[_0x574a('0x6')][_0x574a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2c30a8,_0x21b0c1,_0xaaae57){return new BPromise(function(_0x524554,_0x405139){return client['request'](_0x2c30a8,_0xaaae57)[_0x574a('0x8')](function(_0x1d36e1){logger['info'](_0x574a('0x9'),_0x21b0c1,_0x574a('0xa'));logger['debug'](_0x574a('0xb'),_0x21b0c1,_0x574a('0xa'),JSON[_0x574a('0xc')](_0x1d36e1));if(_0x1d36e1['error']){if(_0x1d36e1['error'][_0x574a('0xd')]===0x1f4){logger[_0x574a('0xe')](_0x574a('0x9'),_0x21b0c1,_0x1d36e1[_0x574a('0xe')][_0x574a('0xf')]);return _0x405139(_0x1d36e1[_0x574a('0xe')][_0x574a('0xf')]);}logger[_0x574a('0xe')](_0x574a('0x9'),_0x21b0c1,_0x1d36e1[_0x574a('0xe')]['message']);return _0x524554(_0x1d36e1[_0x574a('0xe')]['message']);}else{logger[_0x574a('0x10')](_0x574a('0x9'),_0x21b0c1,'request\x20sent');_0x524554(_0x1d36e1[_0x574a('0x11')]['message']);}})[_0x574a('0x12')](function(_0x4c820c){logger[_0x574a('0xe')](_0x574a('0x9'),_0x21b0c1,_0x4c820c);_0x405139(_0x4c820c);});});}exports[_0x574a('0x13')]=function(_0x4dc68a){var _0x3aba5e=this;return new Promise(function(_0x4e8704,_0x463cfc){return db[_0x574a('0x14')][_0x574a('0x15')]({'raw':_0x4dc68a['options']?_0x4dc68a[_0x574a('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x4dc68a[_0x574a('0x16')]?_0x4dc68a[_0x574a('0x16')]['where']||null:null,'attributes':_0x4dc68a[_0x574a('0x16')]?_0x4dc68a[_0x574a('0x16')][_0x574a('0x17')]||null:null,'limit':_0x4dc68a[_0x574a('0x16')]?_0x4dc68a[_0x574a('0x16')][_0x574a('0x18')]||null:null,'include':_0x4dc68a[_0x574a('0x16')]?_0x4dc68a['options'][_0x574a('0x19')]?_[_0x574a('0x1a')](_0x4dc68a[_0x574a('0x16')][_0x574a('0x19')],function(_0x470bdf){return{'model':db[_0x470bdf[_0x574a('0x1b')]],'as':_0x470bdf['as'],'attributes':_0x470bdf[_0x574a('0x17')],'include':_0x470bdf[_0x574a('0x19')]?_['map'](_0x470bdf['include'],function(_0x16bb59){return{'model':db[_0x16bb59['model']],'as':_0x16bb59['as'],'attributes':_0x16bb59[_0x574a('0x17')],'include':_0x16bb59[_0x574a('0x19')]?_['map'](_0x16bb59[_0x574a('0x19')],function(_0x16c4ed){return{'model':db[_0x16c4ed[_0x574a('0x1b')]],'as':_0x16c4ed['as'],'attributes':_0x16c4ed[_0x574a('0x17')]};}):[]};}):[]};}):[]:[]})[_0x574a('0x8')](function(_0x22b36f){logger[_0x574a('0x10')]('GetDeskAccount',_0x4dc68a);logger[_0x574a('0x1c')](_0x574a('0x13'),_0x4dc68a,JSON[_0x574a('0xc')](_0x22b36f));_0x4e8704(_0x22b36f);})[_0x574a('0x12')](function(_0x81112e){logger[_0x574a('0xe')]('GetDeskAccount',_0x81112e['message'],_0x4dc68a);_0x463cfc(_0x3aba5e[_0x574a('0xe')](0x1f4,_0x81112e[_0x574a('0xf')]));});});};exports[_0x574a('0x1d')]=function(_0x10c19b){var _0x457917=this;return new Promise(function(_0xc52e3e,_0x32e40e){return db[_0x574a('0x14')]['find']({'raw':_0x10c19b['options']?_0x10c19b['options']['raw']===undefined?!![]:![]:!![],'where':_0x10c19b[_0x574a('0x16')]?_0x10c19b['options'][_0x574a('0x1e')]||null:null,'attributes':_0x10c19b['options']?_0x10c19b[_0x574a('0x16')][_0x574a('0x17')]||null:null,'include':_0x10c19b['options']?_0x10c19b[_0x574a('0x16')][_0x574a('0x19')]?_[_0x574a('0x1a')](_0x10c19b[_0x574a('0x16')]['include'],function(_0x5debde){return{'model':db[_0x5debde[_0x574a('0x1b')]],'as':_0x5debde['as'],'attributes':_0x5debde[_0x574a('0x17')],'include':_0x5debde[_0x574a('0x19')]?_[_0x574a('0x1a')](_0x5debde[_0x574a('0x19')],function(_0x396266){return{'model':db[_0x396266[_0x574a('0x1b')]],'as':_0x396266['as'],'attributes':_0x396266[_0x574a('0x17')],'include':_0x396266[_0x574a('0x19')]?_[_0x574a('0x1a')](_0x396266[_0x574a('0x19')],function(_0x4e5d4b){return{'model':db[_0x4e5d4b[_0x574a('0x1b')]],'as':_0x4e5d4b['as'],'attributes':_0x4e5d4b[_0x574a('0x17')]};}):[]};}):[]};}):[]:[]})[_0x574a('0x8')](function(_0x1f65bb){logger['info'](_0x574a('0x1d'),_0x10c19b);logger['debug'](_0x574a('0x1d'),_0x10c19b,JSON['stringify'](_0x1f65bb));_0xc52e3e(_0x1f65bb);})[_0x574a('0x12')](function(_0x16749c){logger[_0x574a('0xe')](_0x574a('0x1d'),_0x16749c[_0x574a('0xf')],_0x10c19b);_0x32e40e(_0x457917[_0x574a('0xe')](0x1f4,_0x16749c[_0x574a('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index f29016c..673378e 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 _0x3e74=['show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','getTags','post','/:id/tags','setTags','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x5aa0d1,_0x2e4b77){var _0xd6c2cb=function(_0x4c92f1){while(--_0x4c92f1){_0x5aa0d1['push'](_0x5aa0d1['shift']());}};_0xd6c2cb(++_0x2e4b77);}(_0x3e74,0x175));var _0x43e7=function(_0x4a07c6,_0x214d78){_0x4a07c6=_0x4a07c6-0x0;var _0x2603a6=_0x3e74[_0x4a07c6];return _0x2603a6;};'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/subjects',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/tags',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0x13'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router['put']('/:id',auth[_0x43e7('0x8')](),controller[_0x43e7('0x15')]);router[_0x43e7('0x16')](_0x43e7('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x43e7('0x17')]=router; \ No newline at end of file +var _0xedd9=['getTags','post','create','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','/:id/descriptions','/:id/tags'];(function(_0x441840,_0x4ec610){var _0x4f4ad8=function(_0x4b2fa7){while(--_0x4b2fa7){_0x441840['push'](_0x441840['shift']());}};_0x4f4ad8(++_0x4ec610);}(_0xedd9,0xfc));var _0x9edd=function(_0x104608,_0x5d19af){_0x104608=_0x104608-0x0;var _0x3eca37=_0xedd9[_0x104608];return _0x3eca37;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['getFields']);router[_0x9edd('0x9')]('/:id/subjects',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['get'](_0x9edd('0x10'),auth[_0x9edd('0xa')](),controller['getDescriptions']);router[_0x9edd('0x9')](_0x9edd('0x11'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')]('/:id/tags',auth[_0x9edd('0xa')](),controller[_0x9edd('0x15')]);router[_0x9edd('0x16')](_0x9edd('0xc'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x17')]);router[_0x9edd('0x18')](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x19')]);module[_0x9edd('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index cf1a8f8..aca1306 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 _0x1778=['sequelize','exports','STRING'];(function(_0x186d34,_0x417387){var _0x859d84=function(_0x55d105){while(--_0x55d105){_0x186d34['push'](_0x186d34['shift']());}};_0x859d84(++_0x417387);}(_0x1778,0x1f2));var _0x8177=function(_0x1d570a,_0xdabdba){_0x1d570a=_0x1d570a-0x0;var _0x3a0b6f=_0x1778[_0x1d570a];return _0x3a0b6f;};'use strict';var Sequelize=require(_0x8177('0x0'));module[_0x8177('0x1')]={'name':{'type':Sequelize[_0x8177('0x2')]},'description':{'type':Sequelize[_0x8177('0x2')]}}; \ No newline at end of file +var _0x965f=['STRING','exports'];(function(_0x4fe5a7,_0x147749){var _0x4800ef=function(_0x97c8e8){while(--_0x97c8e8){_0x4fe5a7['push'](_0x4fe5a7['shift']());}};_0x4800ef(++_0x147749);}(_0x965f,0x15d));var _0xf965=function(_0x57a5c6,_0x41657f){_0x57a5c6=_0x57a5c6-0x0;var _0x86844e=_0x965f[_0x57a5c6];return _0x86844e;};'use strict';var Sequelize=require('sequelize');module[_0xf965('0x0')]={'name':{'type':Sequelize[_0xf965('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index c252c1c..3a710f7 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 _0x44e2=['rawAttributes','fieldName','type','key','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','where','merge','VIRTUAL','filter','options','DeskConfiguration','includeAll','include','findAll','catch','show','params','find','create','body','getFields','findOne','DeskField','pick','nolimit','getSubjects','getDescriptions','getTags','Tag','setTags','ids','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index'];(function(_0x1e396c,_0x3526f8){var _0x5ecab3=function(_0x4b5a3e){while(--_0x4b5a3e){_0x1e396c['push'](_0x1e396c['shift']());}};_0x5ecab3(++_0x3526f8);}(_0x44e2,0xd6));var _0x244e=function(_0x1bdd02,_0x37f8c3){_0x1bdd02=_0x1bdd02-0x0;var _0x49e054=_0x44e2[_0x1bdd02];return _0x49e054;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x244e('0x0'));var zipdir=require(_0x244e('0x1'));var jsonpatch=require(_0x244e('0x2'));var rp=require('request-promise');var moment=require(_0x244e('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x244e('0x4'));var path=require(_0x244e('0x5'));var sox=require(_0x244e('0x6'));var csv=require('to-csv');var ejs=require(_0x244e('0x7'));var fs=require('fs');var fs_extra=require(_0x244e('0x8'));var _=require(_0x244e('0x9'));var squel=require(_0x244e('0xa'));var crypto=require(_0x244e('0xb'));var jsforce=require(_0x244e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x244e('0xd'));var querystring=require(_0x244e('0xe'));var Papa=require(_0x244e('0xf'));var Redis=require(_0x244e('0x10'));var authService=require(_0x244e('0x11'));var qs=require(_0x244e('0x12'));var as=require(_0x244e('0x13'));var hardwareService=require(_0x244e('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x244e('0x15'));var licenseUtil=require(_0x244e('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13ab7f,_0x3f636d){_0x3f636d=_0x3f636d||0xcc;return function(_0x57fa52){if(_0x57fa52){return _0x13ab7f[_0x244e('0x17')](_0x3f636d);}return _0x13ab7f[_0x244e('0x18')](_0x3f636d)[_0x244e('0x19')]();};}function respondWithResult(_0x4f2876,_0xbc6628){_0xbc6628=_0xbc6628||0xc8;return function(_0x4bd5c2){if(_0x4bd5c2){return _0x4f2876[_0x244e('0x18')](_0xbc6628)[_0x244e('0x1a')](_0x4bd5c2);}};}function respondWithFilteredResult(_0x169a20,_0x427e2c){return function(_0x4987f1){if(_0x4987f1){var _0x275a90=typeof _0x427e2c[_0x244e('0x1b')]===_0x244e('0x1c')&&typeof _0x427e2c[_0x244e('0x1d')]===_0x244e('0x1c');var _0x387672=_0x4987f1['count'];var _0xf8b2b=_0x275a90?0x0:_0x427e2c[_0x244e('0x1b')];var _0x1161e7=_0x275a90?_0x4987f1[_0x244e('0x1e')]:_0x427e2c['offset']+_0x427e2c[_0x244e('0x1d')];var _0x3b6a65;if(_0x1161e7>=_0x387672){_0x1161e7=_0x387672;_0x3b6a65=0xc8;}else{_0x3b6a65=0xce;}_0x169a20[_0x244e('0x18')](_0x3b6a65);return _0x169a20[_0x244e('0x1f')](_0x244e('0x20'),_0xf8b2b+'-'+_0x1161e7+'/'+_0x387672)[_0x244e('0x1a')](_0x4987f1);}return null;};}function patchUpdates(_0x588ad0){return function(_0x1e21ec){try{jsonpatch[_0x244e('0x21')](_0x1e21ec,_0x588ad0,!![]);}catch(_0x148dc8){return BPromise[_0x244e('0x22')](_0x148dc8);}return _0x1e21ec[_0x244e('0x23')]();};}function saveUpdates(_0x2e2371,_0x39e685){return function(_0x203b50){if(_0x203b50){return _0x203b50[_0x244e('0x24')](_0x2e2371)[_0x244e('0x25')](function(_0x1afa09){return _0x1afa09;});}return null;};}function removeEntity(_0x153785,_0x2c607f){return function(_0x22293d){if(_0x22293d){return _0x22293d[_0x244e('0x26')]()[_0x244e('0x25')](function(){_0x153785[_0x244e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ea800,_0x362cc8){return function(_0x4de8bf){if(!_0x4de8bf){_0x4ea800[_0x244e('0x17')](0x194);}return _0x4de8bf;};}function handleError(_0x3d26bc,_0x9b08de){_0x9b08de=_0x9b08de||0x1f4;return function(_0xa8614d){logger[_0x244e('0x27')](_0xa8614d[_0x244e('0x28')]);if(_0xa8614d[_0x244e('0x29')]){delete _0xa8614d[_0x244e('0x29')];}_0x3d26bc[_0x244e('0x18')](_0x9b08de)[_0x244e('0x2a')](_0xa8614d);};}exports[_0x244e('0x2b')]=function(_0x13b9f9,_0x1c151e){var _0x39511c={},_0x454273={},_0x48797b={'count':0x0,'rows':[]};var _0x3b2068=_['map'](db['DeskConfiguration'][_0x244e('0x2c')],function(_0x4cf6e6){return{'name':_0x4cf6e6[_0x244e('0x2d')],'type':_0x4cf6e6[_0x244e('0x2e')][_0x244e('0x2f')]};});_0x454273[_0x244e('0x30')]=_[_0x244e('0x31')](_0x3b2068,_0x244e('0x29'));_0x454273['query']=_[_0x244e('0x32')](_0x13b9f9[_0x244e('0x33')]);_0x454273['filters']=_[_0x244e('0x34')](_0x454273[_0x244e('0x30')],_0x454273[_0x244e('0x33')]);_0x39511c[_0x244e('0x35')]=_[_0x244e('0x34')](_0x454273[_0x244e('0x30')],qs['fields'](_0x13b9f9['query'][_0x244e('0x36')]));_0x39511c[_0x244e('0x35')]=_0x39511c[_0x244e('0x35')][_0x244e('0x37')]?_0x39511c[_0x244e('0x35')]:_0x454273['model'];if(!_0x13b9f9[_0x244e('0x33')][_0x244e('0x38')]('nolimit')){_0x39511c['limit']=qs[_0x244e('0x1d')](_0x13b9f9[_0x244e('0x33')]['limit']);_0x39511c[_0x244e('0x1b')]=qs[_0x244e('0x1b')](_0x13b9f9[_0x244e('0x33')][_0x244e('0x1b')]);}_0x39511c[_0x244e('0x39')]=qs[_0x244e('0x3a')](_0x13b9f9['query'][_0x244e('0x3a')]);_0x39511c['where']=qs[_0x244e('0x3b')](_['pick'](_0x13b9f9[_0x244e('0x33')],_0x454273[_0x244e('0x3b')]),_0x3b2068);if(_0x13b9f9[_0x244e('0x33')]['filter']){_0x39511c[_0x244e('0x3c')]=_[_0x244e('0x3d')](_0x39511c['where'],{'$or':_[_0x244e('0x31')](_0x3b2068,function(_0x1a2bec){if(_0x1a2bec[_0x244e('0x2e')]!==_0x244e('0x3e')){var _0xb9c775={};_0xb9c775[_0x1a2bec[_0x244e('0x29')]]={'$like':'%'+_0x13b9f9[_0x244e('0x33')][_0x244e('0x3f')]+'%'};return _0xb9c775;}})});}_0x39511c=_[_0x244e('0x3d')]({},_0x39511c,_0x13b9f9[_0x244e('0x40')]);var _0x2165fd={'where':_0x39511c[_0x244e('0x3c')]};return db[_0x244e('0x41')][_0x244e('0x1e')](_0x2165fd)[_0x244e('0x25')](function(_0x1e4934){_0x48797b[_0x244e('0x1e')]=_0x1e4934;if(_0x13b9f9[_0x244e('0x33')][_0x244e('0x42')]){_0x39511c[_0x244e('0x43')]=[{'all':!![]}];}return db[_0x244e('0x41')][_0x244e('0x44')](_0x39511c);})[_0x244e('0x25')](function(_0x2c093c){_0x48797b['rows']=_0x2c093c;return _0x48797b;})[_0x244e('0x25')](respondWithFilteredResult(_0x1c151e,_0x39511c))[_0x244e('0x45')](handleError(_0x1c151e,null));};exports[_0x244e('0x46')]=function(_0x4fde28,_0x322ab4){var _0x26b257={'raw':![],'where':{'id':_0x4fde28[_0x244e('0x47')]['id']}},_0x1991ea={};_0x1991ea[_0x244e('0x30')]=_[_0x244e('0x32')](db['DeskConfiguration'][_0x244e('0x2c')]);_0x1991ea[_0x244e('0x33')]=_[_0x244e('0x32')](_0x4fde28[_0x244e('0x33')]);_0x1991ea['filters']=_[_0x244e('0x34')](_0x1991ea[_0x244e('0x30')],_0x1991ea[_0x244e('0x33')]);_0x26b257[_0x244e('0x35')]=_[_0x244e('0x34')](_0x1991ea['model'],qs['fields'](_0x4fde28[_0x244e('0x33')]['fields']));_0x26b257[_0x244e('0x35')]=_0x26b257[_0x244e('0x35')][_0x244e('0x37')]?_0x26b257[_0x244e('0x35')]:_0x1991ea[_0x244e('0x30')];if(_0x4fde28[_0x244e('0x33')][_0x244e('0x42')]){_0x26b257[_0x244e('0x43')]=[{'all':!![]}];}_0x26b257=_['merge']({},_0x26b257,_0x4fde28[_0x244e('0x40')]);return db['DeskConfiguration'][_0x244e('0x48')](_0x26b257)['then'](handleEntityNotFound(_0x322ab4,null))[_0x244e('0x25')](respondWithResult(_0x322ab4,null))[_0x244e('0x45')](handleError(_0x322ab4,null));};exports[_0x244e('0x49')]=function(_0x5a7dcd,_0x2810cb){return db[_0x244e('0x41')][_0x244e('0x49')](_0x5a7dcd[_0x244e('0x4a')],{})[_0x244e('0x25')](respondWithResult(_0x2810cb,0xc9))[_0x244e('0x45')](handleError(_0x2810cb,null));};exports[_0x244e('0x24')]=function(_0x4145a0,_0x1daa1b){if(_0x4145a0[_0x244e('0x4a')]['id']){delete _0x4145a0[_0x244e('0x4a')]['id'];}return db[_0x244e('0x41')]['find']({'where':{'id':_0x4145a0[_0x244e('0x47')]['id']}})['then'](handleEntityNotFound(_0x1daa1b,null))[_0x244e('0x25')](saveUpdates(_0x4145a0[_0x244e('0x4a')],null))[_0x244e('0x25')](respondWithResult(_0x1daa1b,null))['catch'](handleError(_0x1daa1b,null));};exports['destroy']=function(_0x4632b8,_0xa67337){return db[_0x244e('0x41')][_0x244e('0x48')]({'where':{'id':_0x4632b8[_0x244e('0x47')]['id']}})['then'](handleEntityNotFound(_0xa67337,null))[_0x244e('0x25')](removeEntity(_0xa67337,null))[_0x244e('0x45')](handleError(_0xa67337,null));};exports[_0x244e('0x4b')]=function(_0x5b0a9f,_0x5d2853,_0x2eab53){var _0xaf3aa6={};var _0x766b44={};var _0x390b3f;var _0x8245f;return db[_0x244e('0x41')][_0x244e('0x4c')]({'where':{'id':_0x5b0a9f[_0x244e('0x47')]['id']}})[_0x244e('0x25')](handleEntityNotFound(_0x5d2853,null))[_0x244e('0x25')](function(_0x4e5dfc){if(_0x4e5dfc){_0x390b3f=_0x4e5dfc;_0x766b44[_0x244e('0x30')]=_[_0x244e('0x32')](db[_0x244e('0x4d')][_0x244e('0x2c')]);_0x766b44[_0x244e('0x33')]=_[_0x244e('0x32')](_0x5b0a9f[_0x244e('0x33')]);_0x766b44[_0x244e('0x3b')]=_[_0x244e('0x34')](_0x766b44['model'],_0x766b44[_0x244e('0x33')]);_0xaf3aa6['attributes']=_['intersection'](_0x766b44[_0x244e('0x30')],qs[_0x244e('0x36')](_0x5b0a9f[_0x244e('0x33')][_0x244e('0x36')]));_0xaf3aa6[_0x244e('0x35')]=_0xaf3aa6[_0x244e('0x35')][_0x244e('0x37')]?_0xaf3aa6[_0x244e('0x35')]:_0x766b44[_0x244e('0x30')];_0xaf3aa6[_0x244e('0x39')]=qs[_0x244e('0x3a')](_0x5b0a9f[_0x244e('0x33')][_0x244e('0x3a')]);_0xaf3aa6['where']=qs[_0x244e('0x3b')](_[_0x244e('0x4e')](_0x5b0a9f[_0x244e('0x33')],_0x766b44['filters']));if(_0x5b0a9f[_0x244e('0x33')][_0x244e('0x3f')]){_0xaf3aa6['where']=_[_0x244e('0x3d')](_0xaf3aa6[_0x244e('0x3c')],{'$or':_[_0x244e('0x31')](_0xaf3aa6[_0x244e('0x35')],function(_0x54f97c){var _0xe2c7d5={};_0xe2c7d5[_0x54f97c]={'$like':'%'+_0x5b0a9f[_0x244e('0x33')][_0x244e('0x3f')]+'%'};return _0xe2c7d5;})});}_0xaf3aa6=_[_0x244e('0x3d')]({},_0xaf3aa6,_0x5b0a9f[_0x244e('0x40')]);return _0x390b3f[_0x244e('0x4b')](_0xaf3aa6);}})[_0x244e('0x25')](function(_0x33d6de){if(_0x33d6de){_0x8245f=_0x33d6de['length'];if(!_0x5b0a9f[_0x244e('0x33')][_0x244e('0x38')](_0x244e('0x4f'))){_0xaf3aa6[_0x244e('0x1d')]=qs[_0x244e('0x1d')](_0x5b0a9f[_0x244e('0x33')][_0x244e('0x1d')]);_0xaf3aa6[_0x244e('0x1b')]=qs['offset'](_0x5b0a9f[_0x244e('0x33')][_0x244e('0x1b')]);}return _0x390b3f['getFields'](_0xaf3aa6);}})[_0x244e('0x25')](function(_0x139347){if(_0x139347){return _0x139347?{'count':_0x8245f,'rows':_0x139347}:null;}})[_0x244e('0x25')](respondWithResult(_0x5d2853,null))[_0x244e('0x45')](handleError(_0x5d2853,null));};exports[_0x244e('0x50')]=function(_0x55766b,_0x2cdbd6,_0x2eb596){var _0xc4d1cf={};var _0xbc9591={};var _0x5296b8;var _0x42dea5;return db[_0x244e('0x41')][_0x244e('0x4c')]({'where':{'id':_0x55766b[_0x244e('0x47')]['id']}})[_0x244e('0x25')](handleEntityNotFound(_0x2cdbd6,null))[_0x244e('0x25')](function(_0x48eccd){if(_0x48eccd){_0x5296b8=_0x48eccd;_0xbc9591['model']=_[_0x244e('0x32')](db[_0x244e('0x4d')]['rawAttributes']);_0xbc9591['query']=_[_0x244e('0x32')](_0x55766b[_0x244e('0x33')]);_0xbc9591['filters']=_['intersection'](_0xbc9591[_0x244e('0x30')],_0xbc9591[_0x244e('0x33')]);_0xc4d1cf[_0x244e('0x35')]=_['intersection'](_0xbc9591[_0x244e('0x30')],qs[_0x244e('0x36')](_0x55766b[_0x244e('0x33')]['fields']));_0xc4d1cf[_0x244e('0x35')]=_0xc4d1cf['attributes'][_0x244e('0x37')]?_0xc4d1cf[_0x244e('0x35')]:_0xbc9591[_0x244e('0x30')];_0xc4d1cf['order']=qs[_0x244e('0x3a')](_0x55766b[_0x244e('0x33')][_0x244e('0x3a')]);_0xc4d1cf[_0x244e('0x3c')]=qs['filters'](_[_0x244e('0x4e')](_0x55766b[_0x244e('0x33')],_0xbc9591[_0x244e('0x3b')]));if(_0x55766b[_0x244e('0x33')][_0x244e('0x3f')]){_0xc4d1cf[_0x244e('0x3c')]=_[_0x244e('0x3d')](_0xc4d1cf[_0x244e('0x3c')],{'$or':_[_0x244e('0x31')](_0xc4d1cf[_0x244e('0x35')],function(_0x47c93a){var _0x306a63={};_0x306a63[_0x47c93a]={'$like':'%'+_0x55766b['query'][_0x244e('0x3f')]+'%'};return _0x306a63;})});}_0xc4d1cf=_[_0x244e('0x3d')]({},_0xc4d1cf,_0x55766b[_0x244e('0x40')]);return _0x5296b8['getSubjects'](_0xc4d1cf);}})[_0x244e('0x25')](function(_0x2220d2){if(_0x2220d2){_0x42dea5=_0x2220d2[_0x244e('0x37')];if(!_0x55766b[_0x244e('0x33')][_0x244e('0x38')](_0x244e('0x4f'))){_0xc4d1cf[_0x244e('0x1d')]=qs['limit'](_0x55766b[_0x244e('0x33')][_0x244e('0x1d')]);_0xc4d1cf['offset']=qs['offset'](_0x55766b[_0x244e('0x33')][_0x244e('0x1b')]);}return _0x5296b8[_0x244e('0x50')](_0xc4d1cf);}})[_0x244e('0x25')](function(_0x20b1de){if(_0x20b1de){return _0x20b1de?{'count':_0x42dea5,'rows':_0x20b1de}:null;}})[_0x244e('0x25')](respondWithResult(_0x2cdbd6,null))[_0x244e('0x45')](handleError(_0x2cdbd6,null));};exports[_0x244e('0x51')]=function(_0x34a67c,_0x356785,_0x59fabd){var _0x24a5c9={};var _0x1a9994={};var _0x50352e;var _0x48dd8c;return db[_0x244e('0x41')][_0x244e('0x4c')]({'where':{'id':_0x34a67c['params']['id']}})[_0x244e('0x25')](handleEntityNotFound(_0x356785,null))[_0x244e('0x25')](function(_0x37d8c6){if(_0x37d8c6){_0x50352e=_0x37d8c6;_0x1a9994[_0x244e('0x30')]=_[_0x244e('0x32')](db['DeskField'][_0x244e('0x2c')]);_0x1a9994['query']=_[_0x244e('0x32')](_0x34a67c[_0x244e('0x33')]);_0x1a9994[_0x244e('0x3b')]=_[_0x244e('0x34')](_0x1a9994[_0x244e('0x30')],_0x1a9994[_0x244e('0x33')]);_0x24a5c9[_0x244e('0x35')]=_['intersection'](_0x1a9994[_0x244e('0x30')],qs['fields'](_0x34a67c['query'][_0x244e('0x36')]));_0x24a5c9[_0x244e('0x35')]=_0x24a5c9[_0x244e('0x35')][_0x244e('0x37')]?_0x24a5c9[_0x244e('0x35')]:_0x1a9994[_0x244e('0x30')];_0x24a5c9[_0x244e('0x39')]=qs[_0x244e('0x3a')](_0x34a67c[_0x244e('0x33')]['sort']);_0x24a5c9[_0x244e('0x3c')]=qs['filters'](_[_0x244e('0x4e')](_0x34a67c[_0x244e('0x33')],_0x1a9994[_0x244e('0x3b')]));if(_0x34a67c[_0x244e('0x33')][_0x244e('0x3f')]){_0x24a5c9[_0x244e('0x3c')]=_[_0x244e('0x3d')](_0x24a5c9[_0x244e('0x3c')],{'$or':_['map'](_0x24a5c9[_0x244e('0x35')],function(_0x2aad1c){var _0x191c2f={};_0x191c2f[_0x2aad1c]={'$like':'%'+_0x34a67c[_0x244e('0x33')]['filter']+'%'};return _0x191c2f;})});}_0x24a5c9=_[_0x244e('0x3d')]({},_0x24a5c9,_0x34a67c[_0x244e('0x40')]);return _0x50352e[_0x244e('0x51')](_0x24a5c9);}})['then'](function(_0x4bcff4){if(_0x4bcff4){_0x48dd8c=_0x4bcff4[_0x244e('0x37')];if(!_0x34a67c[_0x244e('0x33')][_0x244e('0x38')](_0x244e('0x4f'))){_0x24a5c9[_0x244e('0x1d')]=qs[_0x244e('0x1d')](_0x34a67c[_0x244e('0x33')]['limit']);_0x24a5c9[_0x244e('0x1b')]=qs[_0x244e('0x1b')](_0x34a67c[_0x244e('0x33')][_0x244e('0x1b')]);}return _0x50352e[_0x244e('0x51')](_0x24a5c9);}})['then'](function(_0x35ef1e){if(_0x35ef1e){return _0x35ef1e?{'count':_0x48dd8c,'rows':_0x35ef1e}:null;}})['then'](respondWithResult(_0x356785,null))[_0x244e('0x45')](handleError(_0x356785,null));};exports[_0x244e('0x52')]=function(_0x49dfe9,_0x1728f0,_0x20978c){var _0x434f50={};var _0x1a49f5={};var _0x43de9c;var _0x188677;return db[_0x244e('0x41')]['findOne']({'where':{'id':_0x49dfe9[_0x244e('0x47')]['id']}})[_0x244e('0x25')](handleEntityNotFound(_0x1728f0,null))[_0x244e('0x25')](function(_0x455550){if(_0x455550){_0x43de9c=_0x455550;_0x1a49f5[_0x244e('0x30')]=_[_0x244e('0x32')](db[_0x244e('0x53')]['rawAttributes']);_0x1a49f5[_0x244e('0x33')]=_[_0x244e('0x32')](_0x49dfe9['query']);_0x1a49f5[_0x244e('0x3b')]=_[_0x244e('0x34')](_0x1a49f5[_0x244e('0x30')],_0x1a49f5[_0x244e('0x33')]);_0x434f50[_0x244e('0x35')]=_[_0x244e('0x34')](_0x1a49f5[_0x244e('0x30')],qs[_0x244e('0x36')](_0x49dfe9[_0x244e('0x33')]['fields']));_0x434f50['attributes']=_0x434f50['attributes'][_0x244e('0x37')]?_0x434f50[_0x244e('0x35')]:_0x1a49f5[_0x244e('0x30')];_0x434f50[_0x244e('0x39')]=qs['sort'](_0x49dfe9[_0x244e('0x33')][_0x244e('0x3a')]);_0x434f50['where']=qs['filters'](_[_0x244e('0x4e')](_0x49dfe9[_0x244e('0x33')],_0x1a49f5[_0x244e('0x3b')]));if(_0x49dfe9[_0x244e('0x33')][_0x244e('0x3f')]){_0x434f50[_0x244e('0x3c')]=_[_0x244e('0x3d')](_0x434f50[_0x244e('0x3c')],{'$or':_[_0x244e('0x31')](_0x434f50['attributes'],function(_0x4760f7){var _0xbd2db={};_0xbd2db[_0x4760f7]={'$like':'%'+_0x49dfe9[_0x244e('0x33')][_0x244e('0x3f')]+'%'};return _0xbd2db;})});}_0x434f50=_[_0x244e('0x3d')]({},_0x434f50,_0x49dfe9[_0x244e('0x40')]);return _0x43de9c[_0x244e('0x52')](_0x434f50);}})[_0x244e('0x25')](function(_0x5c0da5){if(_0x5c0da5){_0x188677=_0x5c0da5[_0x244e('0x37')];if(!_0x49dfe9[_0x244e('0x33')][_0x244e('0x38')](_0x244e('0x4f'))){_0x434f50[_0x244e('0x1d')]=qs['limit'](_0x49dfe9[_0x244e('0x33')][_0x244e('0x1d')]);_0x434f50[_0x244e('0x1b')]=qs[_0x244e('0x1b')](_0x49dfe9['query']['offset']);}return _0x43de9c[_0x244e('0x52')](_0x434f50);}})[_0x244e('0x25')](function(_0x283e30){if(_0x283e30){return _0x283e30?{'count':_0x188677,'rows':_0x283e30}:null;}})[_0x244e('0x25')](respondWithResult(_0x1728f0,null))[_0x244e('0x45')](handleError(_0x1728f0,null));};exports['setTags']=function(_0x1c1c81,_0x1032a7,_0x494a98){if(_0x1c1c81[_0x244e('0x4a')]['id']){delete _0x1c1c81['body']['id'];}return db['DeskConfiguration']['findOne']({'where':{'id':_0x1c1c81['params']['id']}})[_0x244e('0x25')](handleEntityNotFound(_0x1032a7,null))['then'](function(_0x4f0137){if(_0x4f0137){return _0x4f0137[_0x244e('0x54')](_0x1c1c81[_0x244e('0x4a')][_0x244e('0x55')]||[]);}return null;})[_0x244e('0x25')](respondWithResult(_0x1032a7,null))[_0x244e('0x45')](handleError(_0x1032a7,null));}; \ No newline at end of file +var _0x8e75=['sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','end','error','stack','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','show','find','create','body','catch','update','params','getFields','DeskField','pick','getSubjects','findOne','getDescriptions','getTags','Tag','setTags','ids','rimraf','zip-dir','request-promise','bluebird','util'];(function(_0xf1c923,_0x455bcd){var _0xeeb9d2=function(_0x56f773){while(--_0x56f773){_0xf1c923['push'](_0xf1c923['shift']());}};_0xeeb9d2(++_0x455bcd);}(_0x8e75,0xf4));var _0x58e7=function(_0x1d2c3a,_0x249200){_0x1d2c3a=_0x1d2c3a-0x0;var _0x3b5128=_0x8e75[_0x1d2c3a];return _0x3b5128;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x58e7('0x0'));var zipdir=require(_0x58e7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x58e7('0x2'));var moment=require('moment');var BPromise=require(_0x58e7('0x3'));var Mustache=require('mustache');var util=require(_0x58e7('0x4'));var path=require('path');var sox=require(_0x58e7('0x5'));var csv=require(_0x58e7('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x58e7('0x7'));var _=require(_0x58e7('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x58e7('0x9'));var deskjs=require(_0x58e7('0xa'));var toCsv=require(_0x58e7('0x6'));var querystring=require(_0x58e7('0xb'));var Papa=require(_0x58e7('0xc'));var Redis=require(_0x58e7('0xd'));var authService=require(_0x58e7('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x58e7('0xf'));var logger=require(_0x58e7('0x10'))('api');var utils=require(_0x58e7('0x11'));var config=require(_0x58e7('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x58e7('0x13'))['db'];function respondWithStatusCode(_0x2c2666,_0x31743f){_0x31743f=_0x31743f||0xcc;return function(_0xde519a){if(_0xde519a){return _0x2c2666[_0x58e7('0x14')](_0x31743f);}return _0x2c2666[_0x58e7('0x15')](_0x31743f)['end']();};}function respondWithResult(_0x5b1469,_0x31f0da){_0x31f0da=_0x31f0da||0xc8;return function(_0x2f5c48){if(_0x2f5c48){return _0x5b1469[_0x58e7('0x15')](_0x31f0da)[_0x58e7('0x16')](_0x2f5c48);}};}function respondWithFilteredResult(_0xe19bca,_0x1fd1af){return function(_0x2a7cf7){if(_0x2a7cf7){var _0x31ec8c=typeof _0x1fd1af[_0x58e7('0x17')]===_0x58e7('0x18')&&typeof _0x1fd1af[_0x58e7('0x19')]==='undefined';var _0x274867=_0x2a7cf7[_0x58e7('0x1a')];var _0x3c215d=_0x31ec8c?0x0:_0x1fd1af[_0x58e7('0x17')];var _0x3ac90a=_0x31ec8c?_0x2a7cf7[_0x58e7('0x1a')]:_0x1fd1af[_0x58e7('0x17')]+_0x1fd1af[_0x58e7('0x19')];var _0x3ddf36;if(_0x3ac90a>=_0x274867){_0x3ac90a=_0x274867;_0x3ddf36=0xc8;}else{_0x3ddf36=0xce;}_0xe19bca['status'](_0x3ddf36);return _0xe19bca[_0x58e7('0x1b')](_0x58e7('0x1c'),_0x3c215d+'-'+_0x3ac90a+'/'+_0x274867)[_0x58e7('0x16')](_0x2a7cf7);}return null;};}function patchUpdates(_0x29d9f3){return function(_0x88b5da){try{jsonpatch[_0x58e7('0x1d')](_0x88b5da,_0x29d9f3,!![]);}catch(_0x56064c){return BPromise[_0x58e7('0x1e')](_0x56064c);}return _0x88b5da['save']();};}function saveUpdates(_0x59df84,_0x183011){return function(_0x26fde3){if(_0x26fde3){return _0x26fde3['update'](_0x59df84)['then'](function(_0x538d22){return _0x538d22;});}return null;};}function removeEntity(_0x552758,_0x461c16){return function(_0x1fbe17){if(_0x1fbe17){return _0x1fbe17[_0x58e7('0x1f')]()['then'](function(){_0x552758[_0x58e7('0x15')](0xcc)[_0x58e7('0x20')]();});}};}function handleEntityNotFound(_0x3076ae,_0x5dfd5e){return function(_0x27c789){if(!_0x27c789){_0x3076ae[_0x58e7('0x14')](0x194);}return _0x27c789;};}function handleError(_0x3746f8,_0x35882e){_0x35882e=_0x35882e||0x1f4;return function(_0x5b7fe4){logger[_0x58e7('0x21')](_0x5b7fe4[_0x58e7('0x22')]);if(_0x5b7fe4[_0x58e7('0x23')]){delete _0x5b7fe4[_0x58e7('0x23')];}_0x3746f8[_0x58e7('0x15')](_0x35882e)[_0x58e7('0x24')](_0x5b7fe4);};}exports[_0x58e7('0x25')]=function(_0x5c5c68,_0x4ad03a){var _0x3896d0={},_0x25462f={},_0x447810={'count':0x0,'rows':[]};var _0x37049a=_[_0x58e7('0x26')](db[_0x58e7('0x27')][_0x58e7('0x28')],function(_0x36d184){return{'name':_0x36d184[_0x58e7('0x29')],'type':_0x36d184[_0x58e7('0x2a')][_0x58e7('0x2b')]};});_0x25462f[_0x58e7('0x2c')]=_[_0x58e7('0x26')](_0x37049a,_0x58e7('0x23'));_0x25462f[_0x58e7('0x2d')]=_[_0x58e7('0x2e')](_0x5c5c68[_0x58e7('0x2d')]);_0x25462f[_0x58e7('0x2f')]=_[_0x58e7('0x30')](_0x25462f[_0x58e7('0x2c')],_0x25462f[_0x58e7('0x2d')]);_0x3896d0[_0x58e7('0x31')]=_[_0x58e7('0x30')](_0x25462f[_0x58e7('0x2c')],qs[_0x58e7('0x32')](_0x5c5c68['query'][_0x58e7('0x32')]));_0x3896d0[_0x58e7('0x31')]=_0x3896d0[_0x58e7('0x31')][_0x58e7('0x33')]?_0x3896d0['attributes']:_0x25462f[_0x58e7('0x2c')];if(!_0x5c5c68[_0x58e7('0x2d')][_0x58e7('0x34')](_0x58e7('0x35'))){_0x3896d0['limit']=qs[_0x58e7('0x19')](_0x5c5c68['query'][_0x58e7('0x19')]);_0x3896d0[_0x58e7('0x17')]=qs[_0x58e7('0x17')](_0x5c5c68['query']['offset']);}_0x3896d0[_0x58e7('0x36')]=qs[_0x58e7('0x37')](_0x5c5c68['query'][_0x58e7('0x37')]);_0x3896d0[_0x58e7('0x38')]=qs['filters'](_['pick'](_0x5c5c68['query'],_0x25462f[_0x58e7('0x2f')]),_0x37049a);if(_0x5c5c68[_0x58e7('0x2d')][_0x58e7('0x39')]){_0x3896d0[_0x58e7('0x38')]=_[_0x58e7('0x3a')](_0x3896d0[_0x58e7('0x38')],{'$or':_['map'](_0x37049a,function(_0x22deb8){if(_0x22deb8[_0x58e7('0x2a')]!==_0x58e7('0x3b')){var _0x389cfa={};_0x389cfa[_0x22deb8['name']]={'$like':'%'+_0x5c5c68[_0x58e7('0x2d')][_0x58e7('0x39')]+'%'};return _0x389cfa;}})});}_0x3896d0=_[_0x58e7('0x3a')]({},_0x3896d0,_0x5c5c68[_0x58e7('0x3c')]);var _0x21ee03={'where':_0x3896d0[_0x58e7('0x38')]};return db[_0x58e7('0x27')][_0x58e7('0x1a')](_0x21ee03)[_0x58e7('0x3d')](function(_0xb87431){_0x447810[_0x58e7('0x1a')]=_0xb87431;if(_0x5c5c68['query'][_0x58e7('0x3e')]){_0x3896d0[_0x58e7('0x3f')]=[{'all':!![]}];}return db[_0x58e7('0x27')][_0x58e7('0x40')](_0x3896d0);})[_0x58e7('0x3d')](function(_0x192ad2){_0x447810[_0x58e7('0x41')]=_0x192ad2;return _0x447810;})[_0x58e7('0x3d')](respondWithFilteredResult(_0x4ad03a,_0x3896d0))['catch'](handleError(_0x4ad03a,null));};exports[_0x58e7('0x42')]=function(_0x593884,_0x4b0fd4){var _0xc966c5={'raw':![],'where':{'id':_0x593884['params']['id']}},_0x157ead={};_0x157ead[_0x58e7('0x2c')]=_['keys'](db[_0x58e7('0x27')][_0x58e7('0x28')]);_0x157ead[_0x58e7('0x2d')]=_[_0x58e7('0x2e')](_0x593884[_0x58e7('0x2d')]);_0x157ead[_0x58e7('0x2f')]=_[_0x58e7('0x30')](_0x157ead[_0x58e7('0x2c')],_0x157ead[_0x58e7('0x2d')]);_0xc966c5[_0x58e7('0x31')]=_[_0x58e7('0x30')](_0x157ead['model'],qs['fields'](_0x593884[_0x58e7('0x2d')][_0x58e7('0x32')]));_0xc966c5[_0x58e7('0x31')]=_0xc966c5[_0x58e7('0x31')][_0x58e7('0x33')]?_0xc966c5[_0x58e7('0x31')]:_0x157ead[_0x58e7('0x2c')];if(_0x593884[_0x58e7('0x2d')][_0x58e7('0x3e')]){_0xc966c5['include']=[{'all':!![]}];}_0xc966c5=_[_0x58e7('0x3a')]({},_0xc966c5,_0x593884[_0x58e7('0x3c')]);return db['DeskConfiguration'][_0x58e7('0x43')](_0xc966c5)[_0x58e7('0x3d')](handleEntityNotFound(_0x4b0fd4,null))[_0x58e7('0x3d')](respondWithResult(_0x4b0fd4,null))['catch'](handleError(_0x4b0fd4,null));};exports['create']=function(_0x3f2eb7,_0x1f7394){return db[_0x58e7('0x27')][_0x58e7('0x44')](_0x3f2eb7[_0x58e7('0x45')],{})[_0x58e7('0x3d')](respondWithResult(_0x1f7394,0xc9))[_0x58e7('0x46')](handleError(_0x1f7394,null));};exports[_0x58e7('0x47')]=function(_0x5f449c,_0x3c1c2d){if(_0x5f449c['body']['id']){delete _0x5f449c[_0x58e7('0x45')]['id'];}return db[_0x58e7('0x27')][_0x58e7('0x43')]({'where':{'id':_0x5f449c[_0x58e7('0x48')]['id']}})[_0x58e7('0x3d')](handleEntityNotFound(_0x3c1c2d,null))[_0x58e7('0x3d')](saveUpdates(_0x5f449c['body'],null))[_0x58e7('0x3d')](respondWithResult(_0x3c1c2d,null))[_0x58e7('0x46')](handleError(_0x3c1c2d,null));};exports[_0x58e7('0x1f')]=function(_0x251e15,_0x3e9f5a){return db[_0x58e7('0x27')][_0x58e7('0x43')]({'where':{'id':_0x251e15[_0x58e7('0x48')]['id']}})['then'](handleEntityNotFound(_0x3e9f5a,null))[_0x58e7('0x3d')](removeEntity(_0x3e9f5a,null))[_0x58e7('0x46')](handleError(_0x3e9f5a,null));};exports[_0x58e7('0x49')]=function(_0x129f56,_0x48a017,_0x530a23){var _0x30115e={};var _0x2334a3={};var _0x59d450;var _0x1a5a08;return db[_0x58e7('0x27')]['findOne']({'where':{'id':_0x129f56[_0x58e7('0x48')]['id']}})[_0x58e7('0x3d')](handleEntityNotFound(_0x48a017,null))['then'](function(_0x8127de){if(_0x8127de){_0x59d450=_0x8127de;_0x2334a3['model']=_[_0x58e7('0x2e')](db[_0x58e7('0x4a')]['rawAttributes']);_0x2334a3[_0x58e7('0x2d')]=_[_0x58e7('0x2e')](_0x129f56[_0x58e7('0x2d')]);_0x2334a3[_0x58e7('0x2f')]=_[_0x58e7('0x30')](_0x2334a3[_0x58e7('0x2c')],_0x2334a3['query']);_0x30115e[_0x58e7('0x31')]=_[_0x58e7('0x30')](_0x2334a3[_0x58e7('0x2c')],qs['fields'](_0x129f56[_0x58e7('0x2d')]['fields']));_0x30115e['attributes']=_0x30115e[_0x58e7('0x31')][_0x58e7('0x33')]?_0x30115e[_0x58e7('0x31')]:_0x2334a3[_0x58e7('0x2c')];_0x30115e[_0x58e7('0x36')]=qs[_0x58e7('0x37')](_0x129f56['query'][_0x58e7('0x37')]);_0x30115e[_0x58e7('0x38')]=qs['filters'](_[_0x58e7('0x4b')](_0x129f56[_0x58e7('0x2d')],_0x2334a3[_0x58e7('0x2f')]));if(_0x129f56['query']['filter']){_0x30115e[_0x58e7('0x38')]=_['merge'](_0x30115e[_0x58e7('0x38')],{'$or':_['map'](_0x30115e[_0x58e7('0x31')],function(_0x4d5567){var _0xd1c74c={};_0xd1c74c[_0x4d5567]={'$like':'%'+_0x129f56[_0x58e7('0x2d')][_0x58e7('0x39')]+'%'};return _0xd1c74c;})});}_0x30115e=_['merge']({},_0x30115e,_0x129f56['options']);return _0x59d450[_0x58e7('0x49')](_0x30115e);}})[_0x58e7('0x3d')](function(_0x2c18a8){if(_0x2c18a8){_0x1a5a08=_0x2c18a8['length'];if(!_0x129f56[_0x58e7('0x2d')]['hasOwnProperty'](_0x58e7('0x35'))){_0x30115e['limit']=qs[_0x58e7('0x19')](_0x129f56[_0x58e7('0x2d')][_0x58e7('0x19')]);_0x30115e[_0x58e7('0x17')]=qs[_0x58e7('0x17')](_0x129f56[_0x58e7('0x2d')][_0x58e7('0x17')]);}return _0x59d450[_0x58e7('0x49')](_0x30115e);}})[_0x58e7('0x3d')](function(_0x5f1b11){if(_0x5f1b11){return _0x5f1b11?{'count':_0x1a5a08,'rows':_0x5f1b11}:null;}})[_0x58e7('0x3d')](respondWithResult(_0x48a017,null))['catch'](handleError(_0x48a017,null));};exports[_0x58e7('0x4c')]=function(_0x24c7ba,_0x33ea42,_0x4170b1){var _0x43f4ef={};var _0x33944d={};var _0x552c39;var _0xa55197;return db['DeskConfiguration'][_0x58e7('0x4d')]({'where':{'id':_0x24c7ba['params']['id']}})[_0x58e7('0x3d')](handleEntityNotFound(_0x33ea42,null))[_0x58e7('0x3d')](function(_0x3e1f48){if(_0x3e1f48){_0x552c39=_0x3e1f48;_0x33944d['model']=_[_0x58e7('0x2e')](db['DeskField']['rawAttributes']);_0x33944d[_0x58e7('0x2d')]=_['keys'](_0x24c7ba[_0x58e7('0x2d')]);_0x33944d[_0x58e7('0x2f')]=_['intersection'](_0x33944d[_0x58e7('0x2c')],_0x33944d[_0x58e7('0x2d')]);_0x43f4ef[_0x58e7('0x31')]=_[_0x58e7('0x30')](_0x33944d[_0x58e7('0x2c')],qs['fields'](_0x24c7ba[_0x58e7('0x2d')]['fields']));_0x43f4ef[_0x58e7('0x31')]=_0x43f4ef['attributes'][_0x58e7('0x33')]?_0x43f4ef[_0x58e7('0x31')]:_0x33944d[_0x58e7('0x2c')];_0x43f4ef[_0x58e7('0x36')]=qs[_0x58e7('0x37')](_0x24c7ba[_0x58e7('0x2d')][_0x58e7('0x37')]);_0x43f4ef[_0x58e7('0x38')]=qs[_0x58e7('0x2f')](_[_0x58e7('0x4b')](_0x24c7ba[_0x58e7('0x2d')],_0x33944d[_0x58e7('0x2f')]));if(_0x24c7ba[_0x58e7('0x2d')]['filter']){_0x43f4ef[_0x58e7('0x38')]=_[_0x58e7('0x3a')](_0x43f4ef[_0x58e7('0x38')],{'$or':_[_0x58e7('0x26')](_0x43f4ef[_0x58e7('0x31')],function(_0x542428){var _0x3d81ce={};_0x3d81ce[_0x542428]={'$like':'%'+_0x24c7ba['query'][_0x58e7('0x39')]+'%'};return _0x3d81ce;})});}_0x43f4ef=_[_0x58e7('0x3a')]({},_0x43f4ef,_0x24c7ba[_0x58e7('0x3c')]);return _0x552c39[_0x58e7('0x4c')](_0x43f4ef);}})[_0x58e7('0x3d')](function(_0x2a8715){if(_0x2a8715){_0xa55197=_0x2a8715[_0x58e7('0x33')];if(!_0x24c7ba[_0x58e7('0x2d')][_0x58e7('0x34')](_0x58e7('0x35'))){_0x43f4ef[_0x58e7('0x19')]=qs['limit'](_0x24c7ba[_0x58e7('0x2d')][_0x58e7('0x19')]);_0x43f4ef[_0x58e7('0x17')]=qs['offset'](_0x24c7ba[_0x58e7('0x2d')][_0x58e7('0x17')]);}return _0x552c39[_0x58e7('0x4c')](_0x43f4ef);}})[_0x58e7('0x3d')](function(_0x105efc){if(_0x105efc){return _0x105efc?{'count':_0xa55197,'rows':_0x105efc}:null;}})[_0x58e7('0x3d')](respondWithResult(_0x33ea42,null))[_0x58e7('0x46')](handleError(_0x33ea42,null));};exports['getDescriptions']=function(_0x9f57e4,_0x12ab24,_0x56f817){var _0x4486de={};var _0x37e03b={};var _0x1c0c7f;var _0x3c3ba3;return db[_0x58e7('0x27')][_0x58e7('0x4d')]({'where':{'id':_0x9f57e4['params']['id']}})[_0x58e7('0x3d')](handleEntityNotFound(_0x12ab24,null))[_0x58e7('0x3d')](function(_0x3606de){if(_0x3606de){_0x1c0c7f=_0x3606de;_0x37e03b[_0x58e7('0x2c')]=_[_0x58e7('0x2e')](db[_0x58e7('0x4a')][_0x58e7('0x28')]);_0x37e03b[_0x58e7('0x2d')]=_[_0x58e7('0x2e')](_0x9f57e4[_0x58e7('0x2d')]);_0x37e03b[_0x58e7('0x2f')]=_[_0x58e7('0x30')](_0x37e03b[_0x58e7('0x2c')],_0x37e03b[_0x58e7('0x2d')]);_0x4486de[_0x58e7('0x31')]=_[_0x58e7('0x30')](_0x37e03b[_0x58e7('0x2c')],qs['fields'](_0x9f57e4[_0x58e7('0x2d')][_0x58e7('0x32')]));_0x4486de[_0x58e7('0x31')]=_0x4486de[_0x58e7('0x31')][_0x58e7('0x33')]?_0x4486de['attributes']:_0x37e03b[_0x58e7('0x2c')];_0x4486de['order']=qs[_0x58e7('0x37')](_0x9f57e4[_0x58e7('0x2d')]['sort']);_0x4486de[_0x58e7('0x38')]=qs[_0x58e7('0x2f')](_[_0x58e7('0x4b')](_0x9f57e4[_0x58e7('0x2d')],_0x37e03b[_0x58e7('0x2f')]));if(_0x9f57e4[_0x58e7('0x2d')]['filter']){_0x4486de['where']=_[_0x58e7('0x3a')](_0x4486de['where'],{'$or':_['map'](_0x4486de['attributes'],function(_0x282930){var _0x4ddb01={};_0x4ddb01[_0x282930]={'$like':'%'+_0x9f57e4[_0x58e7('0x2d')]['filter']+'%'};return _0x4ddb01;})});}_0x4486de=_[_0x58e7('0x3a')]({},_0x4486de,_0x9f57e4[_0x58e7('0x3c')]);return _0x1c0c7f[_0x58e7('0x4e')](_0x4486de);}})[_0x58e7('0x3d')](function(_0x3fa37b){if(_0x3fa37b){_0x3c3ba3=_0x3fa37b['length'];if(!_0x9f57e4['query'][_0x58e7('0x34')](_0x58e7('0x35'))){_0x4486de[_0x58e7('0x19')]=qs[_0x58e7('0x19')](_0x9f57e4['query'][_0x58e7('0x19')]);_0x4486de[_0x58e7('0x17')]=qs['offset'](_0x9f57e4['query']['offset']);}return _0x1c0c7f[_0x58e7('0x4e')](_0x4486de);}})[_0x58e7('0x3d')](function(_0x339f09){if(_0x339f09){return _0x339f09?{'count':_0x3c3ba3,'rows':_0x339f09}:null;}})[_0x58e7('0x3d')](respondWithResult(_0x12ab24,null))[_0x58e7('0x46')](handleError(_0x12ab24,null));};exports[_0x58e7('0x4f')]=function(_0x5439df,_0x9ff53a,_0x268c0b){var _0x5e1c53={};var _0x561a87={};var _0x165512;var _0x5e1884;return db[_0x58e7('0x27')][_0x58e7('0x4d')]({'where':{'id':_0x5439df[_0x58e7('0x48')]['id']}})[_0x58e7('0x3d')](handleEntityNotFound(_0x9ff53a,null))['then'](function(_0x26ebcf){if(_0x26ebcf){_0x165512=_0x26ebcf;_0x561a87[_0x58e7('0x2c')]=_[_0x58e7('0x2e')](db[_0x58e7('0x50')][_0x58e7('0x28')]);_0x561a87['query']=_[_0x58e7('0x2e')](_0x5439df[_0x58e7('0x2d')]);_0x561a87['filters']=_['intersection'](_0x561a87[_0x58e7('0x2c')],_0x561a87[_0x58e7('0x2d')]);_0x5e1c53['attributes']=_[_0x58e7('0x30')](_0x561a87[_0x58e7('0x2c')],qs[_0x58e7('0x32')](_0x5439df[_0x58e7('0x2d')][_0x58e7('0x32')]));_0x5e1c53[_0x58e7('0x31')]=_0x5e1c53[_0x58e7('0x31')][_0x58e7('0x33')]?_0x5e1c53[_0x58e7('0x31')]:_0x561a87[_0x58e7('0x2c')];_0x5e1c53['order']=qs['sort'](_0x5439df['query']['sort']);_0x5e1c53[_0x58e7('0x38')]=qs[_0x58e7('0x2f')](_[_0x58e7('0x4b')](_0x5439df[_0x58e7('0x2d')],_0x561a87[_0x58e7('0x2f')]));if(_0x5439df[_0x58e7('0x2d')][_0x58e7('0x39')]){_0x5e1c53['where']=_['merge'](_0x5e1c53['where'],{'$or':_[_0x58e7('0x26')](_0x5e1c53['attributes'],function(_0x13a772){var _0x56c3a5={};_0x56c3a5[_0x13a772]={'$like':'%'+_0x5439df[_0x58e7('0x2d')][_0x58e7('0x39')]+'%'};return _0x56c3a5;})});}_0x5e1c53=_[_0x58e7('0x3a')]({},_0x5e1c53,_0x5439df[_0x58e7('0x3c')]);return _0x165512['getTags'](_0x5e1c53);}})[_0x58e7('0x3d')](function(_0x4edec8){if(_0x4edec8){_0x5e1884=_0x4edec8[_0x58e7('0x33')];if(!_0x5439df['query'][_0x58e7('0x34')](_0x58e7('0x35'))){_0x5e1c53['limit']=qs[_0x58e7('0x19')](_0x5439df[_0x58e7('0x2d')][_0x58e7('0x19')]);_0x5e1c53[_0x58e7('0x17')]=qs[_0x58e7('0x17')](_0x5439df[_0x58e7('0x2d')][_0x58e7('0x17')]);}return _0x165512[_0x58e7('0x4f')](_0x5e1c53);}})[_0x58e7('0x3d')](function(_0x10ff8a){if(_0x10ff8a){return _0x10ff8a?{'count':_0x5e1884,'rows':_0x10ff8a}:null;}})[_0x58e7('0x3d')](respondWithResult(_0x9ff53a,null))[_0x58e7('0x46')](handleError(_0x9ff53a,null));};exports[_0x58e7('0x51')]=function(_0x7f8133,_0x3dfe9b,_0x4b1a04){if(_0x7f8133[_0x58e7('0x45')]['id']){delete _0x7f8133[_0x58e7('0x45')]['id'];}return db[_0x58e7('0x27')][_0x58e7('0x4d')]({'where':{'id':_0x7f8133[_0x58e7('0x48')]['id']}})[_0x58e7('0x3d')](handleEntityNotFound(_0x3dfe9b,null))[_0x58e7('0x3d')](function(_0x52e97f){if(_0x52e97f){return _0x52e97f['setTags'](_0x7f8133[_0x58e7('0x45')][_0x58e7('0x52')]||[]);}return null;})[_0x58e7('0x3d')](respondWithResult(_0x3dfe9b,null))[_0x58e7('0x46')](handleError(_0x3dfe9b,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 7fc838c..4e514a4 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 _0xfbf2=['path','rimraf','./intDeskConfiguration.attributes','define','DeskConfiguration','int_desk_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x599b7b,_0x5d7a61){var _0x3e4f69=function(_0x327ef3){while(--_0x327ef3){_0x599b7b['push'](_0x599b7b['shift']());}};_0x3e4f69(++_0x5d7a61);}(_0xfbf2,0x102));var _0x2fbf=function(_0x175d59,_0x20204e){_0x175d59=_0x175d59-0x0;var _0x9cf48c=_0xfbf2[_0x175d59];return _0x9cf48c;};'use strict';var _=require(_0x2fbf('0x0'));var util=require('util');var logger=require(_0x2fbf('0x1'))(_0x2fbf('0x2'));var moment=require(_0x2fbf('0x3'));var BPromise=require(_0x2fbf('0x4'));var rp=require(_0x2fbf('0x5'));var fs=require('fs');var path=require(_0x2fbf('0x6'));var rimraf=require(_0x2fbf('0x7'));var config=require('../../config/environment');var attributes=require(_0x2fbf('0x8'));module['exports']=function(_0x3cb940,_0x38e936){return _0x3cb940[_0x2fbf('0x9')](_0x2fbf('0xa'),attributes,{'tableName':_0x2fbf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf93d=['int_desk_configurations','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes'];(function(_0x2f415e,_0x5963ac){var _0x3c1178=function(_0x5ea27f){while(--_0x5ea27f){_0x2f415e['push'](_0x2f415e['shift']());}};_0x3c1178(++_0x5963ac);}(_0xf93d,0x11f));var _0xdf93=function(_0x13c576,_0x4de04c){_0x13c576=_0x13c576-0x0;var _0x329db2=_0xf93d[_0x13c576];return _0x329db2;};'use strict';var _=require('lodash');var util=require(_0xdf93('0x0'));var logger=require(_0xdf93('0x1'))(_0xdf93('0x2'));var moment=require(_0xdf93('0x3'));var BPromise=require(_0xdf93('0x4'));var rp=require(_0xdf93('0x5'));var fs=require('fs');var path=require(_0xdf93('0x6'));var rimraf=require(_0xdf93('0x7'));var config=require(_0xdf93('0x8'));var attributes=require(_0xdf93('0x9'));module['exports']=function(_0x5194ad,_0x378b83){return _0x5194ad['define']('DeskConfiguration',attributes,{'tableName':_0xdf93('0xa'),'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 cf8ddd9..5765651 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 _0xce9e=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring'];(function(_0x54dd2b,_0x8048ae){var _0x2e9579=function(_0x41ca2a){while(--_0x41ca2a){_0x54dd2b['push'](_0x54dd2b['shift']());}};_0x2e9579(++_0x8048ae);}(_0xce9e,0x1c8));var _0xece9=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xce9e[_0x34bc30];return _0x5706de;};'use strict';var _=require(_0xece9('0x0'));var util=require(_0xece9('0x1'));var moment=require(_0xece9('0x2'));var BPromise=require('bluebird');var rs=require(_0xece9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xece9('0x4'));var logger=require('../../config/logger')(_0xece9('0x5'));var config=require(_0xece9('0x6'));var jayson=require(_0xece9('0x7'));var client=jayson[_0xece9('0x8')][_0xece9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xa03386,_0x398671,_0x4a6553){return new BPromise(function(_0x5c2d59,_0x3180c0){return client[_0xece9('0xa')](_0xa03386,_0x4a6553)[_0xece9('0xb')](function(_0x214e2d){logger[_0xece9('0xc')](_0xece9('0xd'),_0x398671,_0xece9('0xe'));logger[_0xece9('0xf')](_0xece9('0x10'),_0x398671,_0xece9('0xe'),JSON[_0xece9('0x11')](_0x214e2d));if(_0x214e2d[_0xece9('0x12')]){if(_0x214e2d[_0xece9('0x12')][_0xece9('0x13')]===0x1f4){logger[_0xece9('0x12')](_0xece9('0xd'),_0x398671,_0x214e2d[_0xece9('0x12')][_0xece9('0x14')]);return _0x3180c0(_0x214e2d['error'][_0xece9('0x14')]);}logger[_0xece9('0x12')](_0xece9('0xd'),_0x398671,_0x214e2d[_0xece9('0x12')][_0xece9('0x14')]);return _0x5c2d59(_0x214e2d[_0xece9('0x12')][_0xece9('0x14')]);}else{logger[_0xece9('0xc')](_0xece9('0xd'),_0x398671,_0xece9('0xe'));_0x5c2d59(_0x214e2d[_0xece9('0x15')][_0xece9('0x14')]);}})[_0xece9('0x16')](function(_0x1e9422){logger[_0xece9('0x12')](_0xece9('0xd'),_0x398671,_0x1e9422);_0x3180c0(_0x1e9422);});});} \ No newline at end of file +var _0xedd7=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring'];(function(_0x4b3189,_0x253132){var _0x58b5eb=function(_0x45554c){while(--_0x45554c){_0x4b3189['push'](_0x4b3189['shift']());}};_0x58b5eb(++_0x253132);}(_0xedd7,0x6f));var _0x7edd=function(_0x2af053,_0x4f6d28){_0x2af053=_0x2af053-0x0;var _0x4b4001=_0xedd7[_0x2af053];return _0x4b4001;};'use strict';var _=require('lodash');var util=require(_0x7edd('0x0'));var moment=require(_0x7edd('0x1'));var BPromise=require(_0x7edd('0x2'));var rs=require(_0x7edd('0x3'));var fs=require('fs');var Redis=require(_0x7edd('0x4'));var db=require(_0x7edd('0x5'))['db'];var utils=require(_0x7edd('0x6'));var logger=require('../../config/logger')(_0x7edd('0x7'));var config=require(_0x7edd('0x8'));var jayson=require(_0x7edd('0x9'));var client=jayson['client'][_0x7edd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd943ba,_0x578582,_0x22e2d3){return new BPromise(function(_0x2ed6c5,_0xe81b82){return client[_0x7edd('0xb')](_0xd943ba,_0x22e2d3)[_0x7edd('0xc')](function(_0x4c804f){logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x578582,_0x7edd('0xd'));logger['debug'](_0x7edd('0xe'),_0x578582,_0x7edd('0xd'),JSON[_0x7edd('0xf')](_0x4c804f));if(_0x4c804f[_0x7edd('0x10')]){if(_0x4c804f[_0x7edd('0x10')][_0x7edd('0x11')]===0x1f4){logger[_0x7edd('0x10')](_0x7edd('0x12'),_0x578582,_0x4c804f[_0x7edd('0x10')]['message']);return _0xe81b82(_0x4c804f[_0x7edd('0x10')][_0x7edd('0x13')]);}logger[_0x7edd('0x10')](_0x7edd('0x12'),_0x578582,_0x4c804f[_0x7edd('0x10')][_0x7edd('0x13')]);return _0x2ed6c5(_0x4c804f[_0x7edd('0x10')]['message']);}else{logger[_0x7edd('0x14')]('DeskConfiguration,\x20%s,\x20%s',_0x578582,_0x7edd('0xd'));_0x2ed6c5(_0x4c804f[_0x7edd('0x15')][_0x7edd('0x13')]);}})[_0x7edd('0x16')](function(_0x2b6e67){logger[_0x7edd('0x10')](_0x7edd('0x12'),_0x578582,_0x2b6e67);_0xe81b82(_0x2b6e67);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 99354a4..ce4f203 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 _0xa000=['../../components/auth/service','get','isAuthenticated','index','show','post','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x324f55,_0x2e6ca4){var _0x284952=function(_0x36ceae){while(--_0x36ceae){_0x324f55['push'](_0x324f55['shift']());}};_0x284952(++_0x2e6ca4);}(_0xa000,0x162));var _0x0a00=function(_0x36d2f4,_0x11c126){_0x36d2f4=_0x36d2f4-0x0;var _0x588872=_0xa000[_0x36d2f4];return _0x588872;};'use strict';var multer=require(_0x0a00('0x0'));var util=require(_0x0a00('0x1'));var path=require(_0x0a00('0x2'));var timeout=require(_0x0a00('0x3'));var express=require(_0x0a00('0x4'));var router=express[_0x0a00('0x5')]();var fs_extra=require(_0x0a00('0x6'));var auth=require(_0x0a00('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intDeskField.controller');router[_0x0a00('0x8')]('/',auth[_0x0a00('0x9')](),controller[_0x0a00('0xa')]);router[_0x0a00('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a00('0xb')]);router[_0x0a00('0xc')]('/',auth[_0x0a00('0x9')](),controller[_0x0a00('0xd')]);router[_0x0a00('0xe')](_0x0a00('0xf'),auth[_0x0a00('0x9')](),controller[_0x0a00('0x10')]);router['delete']('/:id',auth[_0x0a00('0x9')](),controller[_0x0a00('0x11')]);module[_0x0a00('0x12')]=router; \ No newline at end of file +var _0x1e5a=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskField.controller','isAuthenticated','index','get','/:id','show','create','update','delete'];(function(_0x352713,_0x737610){var _0x46a4ea=function(_0x379929){while(--_0x379929){_0x352713['push'](_0x352713['shift']());}};_0x46a4ea(++_0x737610);}(_0x1e5a,0xb5));var _0xa1e5=function(_0x5459c6,_0x4f3f18){_0x5459c6=_0x5459c6-0x0;var _0x3380e0=_0x1e5a[_0x5459c6];return _0x3380e0;};'use strict';var multer=require(_0xa1e5('0x0'));var util=require(_0xa1e5('0x1'));var path=require(_0xa1e5('0x2'));var timeout=require(_0xa1e5('0x3'));var express=require(_0xa1e5('0x4'));var router=express['Router']();var fs_extra=require(_0xa1e5('0x5'));var auth=require(_0xa1e5('0x6'));var interaction=require(_0xa1e5('0x7'));var config=require('../../config/environment');var controller=require(_0xa1e5('0x8'));router['get']('/',auth[_0xa1e5('0x9')](),controller[_0xa1e5('0xa')]);router[_0xa1e5('0xb')](_0xa1e5('0xc'),auth[_0xa1e5('0x9')](),controller[_0xa1e5('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa1e5('0xe')]);router['put'](_0xa1e5('0xc'),auth[_0xa1e5('0x9')](),controller[_0xa1e5('0xf')]);router[_0xa1e5('0x10')](_0xa1e5('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xa1e5('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 1ad4b95..28db84d 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 _0x1f74=['customVariable','keyValue','picklist','STRING','BOOLEAN','ENUM','string','variable'];(function(_0x1663e2,_0x250ef5){var _0x5c4b21=function(_0x1b7752){while(--_0x1b7752){_0x1663e2['push'](_0x1663e2['shift']());}};_0x5c4b21(++_0x250ef5);}(_0x1f74,0x12d));var _0x41f7=function(_0x3cee22,_0x54ad32){_0x3cee22=_0x3cee22-0x0;var _0x286fa5=_0x1f74[_0x3cee22];return _0x286fa5;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x41f7('0x0')](_0x41f7('0x1'),_0x41f7('0x2'),_0x41f7('0x3'),_0x41f7('0x4'),_0x41f7('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x41f7('0x6')]},'key':{'type':Sequelize[_0x41f7('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x41f7('0x1'),_0x41f7('0x2'),_0x41f7('0x3'))},'keyContent':{'type':Sequelize[_0x41f7('0x6')]},'idField':{'type':Sequelize[_0x41f7('0x6')]},'nameField':{'type':Sequelize[_0x41f7('0x6')]},'customField':{'type':Sequelize[_0x41f7('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x41f7('0x6')]}}; \ No newline at end of file +var _0xc3b4=['string','variable','customVariable','STRING','BOOLEAN','sequelize','exports'];(function(_0x1024cc,_0x3c2798){var _0x26c30f=function(_0x1687c8){while(--_0x1687c8){_0x1024cc['push'](_0x1024cc['shift']());}};_0x26c30f(++_0x3c2798);}(_0xc3b4,0x116));var _0x4c3b=function(_0x232eb7,_0x199b07){_0x232eb7=_0x232eb7-0x0;var _0xd7fb8=_0xc3b4[_0x232eb7];return _0xd7fb8;};'use strict';var Sequelize=require(_0x4c3b('0x0'));module[_0x4c3b('0x1')]={'type':{'type':Sequelize['ENUM'](_0x4c3b('0x2'),_0x4c3b('0x3'),_0x4c3b('0x4'),'keyValue','picklist'),'defaultValue':_0x4c3b('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x4c3b('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x4c3b('0x2'),_0x4c3b('0x3'),_0x4c3b('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x4c3b('0x5')]},'customField':{'type':Sequelize[_0x4c3b('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4c3b('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 6752b35..afc9a9a 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 _0x0c85=['options','includeAll','include','catch','show','params','length','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','sendStatus','name','send','index','DeskField','rawAttributes','type','model','map','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','merge','VIRTUAL','filter'];(function(_0x21cce9,_0x231204){var _0x503721=function(_0xd1c1e4){while(--_0xd1c1e4){_0x21cce9['push'](_0x21cce9['shift']());}};_0x503721(++_0x231204);}(_0x0c85,0x14f));var _0x50c8=function(_0x2a4147,_0x8fc38c){_0x2a4147=_0x2a4147-0x0;var _0x477c6c=_0x0c85[_0x2a4147];return _0x477c6c;};'use strict';var emlformat=require(_0x50c8('0x0'));var rimraf=require(_0x50c8('0x1'));var zipdir=require(_0x50c8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x50c8('0x3'));var moment=require(_0x50c8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x50c8('0x5'));var util=require(_0x50c8('0x6'));var path=require(_0x50c8('0x7'));var sox=require(_0x50c8('0x8'));var csv=require('to-csv');var ejs=require(_0x50c8('0x9'));var fs=require('fs');var fs_extra=require(_0x50c8('0xa'));var _=require('lodash');var squel=require(_0x50c8('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x50c8('0xc'));var querystring=require(_0x50c8('0xd'));var Papa=require('papaparse');var Redis=require(_0x50c8('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x50c8('0xf'));var as=require(_0x50c8('0x10'));var hardwareService=require(_0x50c8('0x11'));var logger=require(_0x50c8('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x50c8('0x13'));var licenseUtil=require(_0x50c8('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2131bd,_0x4756a1){_0x4756a1=_0x4756a1||0xcc;return function(_0x13d751){if(_0x13d751){return _0x2131bd['sendStatus'](_0x4756a1);}return _0x2131bd[_0x50c8('0x15')](_0x4756a1)[_0x50c8('0x16')]();};}function respondWithResult(_0x84e7ef,_0x287de5){_0x287de5=_0x287de5||0xc8;return function(_0x20375a){if(_0x20375a){return _0x84e7ef[_0x50c8('0x15')](_0x287de5)['json'](_0x20375a);}};}function respondWithFilteredResult(_0x318023,_0x51b85c){return function(_0x50d756){if(_0x50d756){var _0x219f2a=typeof _0x51b85c['offset']==='undefined'&&typeof _0x51b85c['limit']==='undefined';var _0x965510=_0x50d756[_0x50c8('0x17')];var _0xded764=_0x219f2a?0x0:_0x51b85c[_0x50c8('0x18')];var _0x171da5=_0x219f2a?_0x50d756[_0x50c8('0x17')]:_0x51b85c[_0x50c8('0x18')]+_0x51b85c[_0x50c8('0x19')];var _0x1dc9ac;if(_0x171da5>=_0x965510){_0x171da5=_0x965510;_0x1dc9ac=0xc8;}else{_0x1dc9ac=0xce;}_0x318023['status'](_0x1dc9ac);return _0x318023[_0x50c8('0x1a')](_0x50c8('0x1b'),_0xded764+'-'+_0x171da5+'/'+_0x965510)[_0x50c8('0x1c')](_0x50d756);}return null;};}function patchUpdates(_0x33f365){return function(_0x2bd0ef){try{jsonpatch[_0x50c8('0x1d')](_0x2bd0ef,_0x33f365,!![]);}catch(_0x582b73){return BPromise[_0x50c8('0x1e')](_0x582b73);}return _0x2bd0ef[_0x50c8('0x1f')]();};}function saveUpdates(_0xfa01e4,_0x2983d5){return function(_0x2fc53a){if(_0x2fc53a){return _0x2fc53a[_0x50c8('0x20')](_0xfa01e4)[_0x50c8('0x21')](function(_0x49ed6d){return _0x49ed6d;});}return null;};}function removeEntity(_0xeda590,_0x49ef15){return function(_0xb6d831){if(_0xb6d831){return _0xb6d831['destroy']()['then'](function(){_0xeda590['status'](0xcc)[_0x50c8('0x16')]();});}};}function handleEntityNotFound(_0x45990e,_0x50c930){return function(_0x4f3829){if(!_0x4f3829){_0x45990e[_0x50c8('0x22')](0x194);}return _0x4f3829;};}function handleError(_0x2640be,_0x21fa12){_0x21fa12=_0x21fa12||0x1f4;return function(_0x2dbeb8){logger['error'](_0x2dbeb8['stack']);if(_0x2dbeb8[_0x50c8('0x23')]){delete _0x2dbeb8['name'];}_0x2640be['status'](_0x21fa12)[_0x50c8('0x24')](_0x2dbeb8);};}exports[_0x50c8('0x25')]=function(_0x22dd1a,_0x55cb14){var _0x97e52b={},_0x23b5fb={},_0x5d2133={'count':0x0,'rows':[]};var _0x4d6774=_['map'](db[_0x50c8('0x26')][_0x50c8('0x27')],function(_0x135a97){return{'name':_0x135a97['fieldName'],'type':_0x135a97[_0x50c8('0x28')]['key']};});_0x23b5fb[_0x50c8('0x29')]=_[_0x50c8('0x2a')](_0x4d6774,'name');_0x23b5fb[_0x50c8('0x2b')]=_[_0x50c8('0x2c')](_0x22dd1a[_0x50c8('0x2b')]);_0x23b5fb[_0x50c8('0x2d')]=_[_0x50c8('0x2e')](_0x23b5fb[_0x50c8('0x29')],_0x23b5fb[_0x50c8('0x2b')]);_0x97e52b[_0x50c8('0x2f')]=_[_0x50c8('0x2e')](_0x23b5fb[_0x50c8('0x29')],qs[_0x50c8('0x30')](_0x22dd1a['query'][_0x50c8('0x30')]));_0x97e52b[_0x50c8('0x2f')]=_0x97e52b[_0x50c8('0x2f')]['length']?_0x97e52b[_0x50c8('0x2f')]:_0x23b5fb[_0x50c8('0x29')];if(!_0x22dd1a[_0x50c8('0x2b')]['hasOwnProperty'](_0x50c8('0x31'))){_0x97e52b[_0x50c8('0x19')]=qs['limit'](_0x22dd1a[_0x50c8('0x2b')][_0x50c8('0x19')]);_0x97e52b['offset']=qs[_0x50c8('0x18')](_0x22dd1a[_0x50c8('0x2b')][_0x50c8('0x18')]);}_0x97e52b['order']=qs['sort'](_0x22dd1a[_0x50c8('0x2b')][_0x50c8('0x32')]);_0x97e52b[_0x50c8('0x33')]=qs['filters'](_['pick'](_0x22dd1a[_0x50c8('0x2b')],_0x23b5fb[_0x50c8('0x2d')]),_0x4d6774);if(_0x22dd1a['query']['filter']){_0x97e52b[_0x50c8('0x33')]=_[_0x50c8('0x34')](_0x97e52b['where'],{'$or':_[_0x50c8('0x2a')](_0x4d6774,function(_0x24dc1b){if(_0x24dc1b[_0x50c8('0x28')]!==_0x50c8('0x35')){var _0x39565d={};_0x39565d[_0x24dc1b[_0x50c8('0x23')]]={'$like':'%'+_0x22dd1a['query'][_0x50c8('0x36')]+'%'};return _0x39565d;}})});}_0x97e52b=_[_0x50c8('0x34')]({},_0x97e52b,_0x22dd1a[_0x50c8('0x37')]);var _0xa5f046={'where':_0x97e52b[_0x50c8('0x33')]};return db[_0x50c8('0x26')][_0x50c8('0x17')](_0xa5f046)[_0x50c8('0x21')](function(_0x2dab32){_0x5d2133[_0x50c8('0x17')]=_0x2dab32;if(_0x22dd1a[_0x50c8('0x2b')][_0x50c8('0x38')]){_0x97e52b[_0x50c8('0x39')]=[{'all':!![]}];}return db['DeskField']['findAll'](_0x97e52b);})[_0x50c8('0x21')](function(_0x462cb2){_0x5d2133['rows']=_0x462cb2;return _0x5d2133;})[_0x50c8('0x21')](respondWithFilteredResult(_0x55cb14,_0x97e52b))[_0x50c8('0x3a')](handleError(_0x55cb14,null));};exports[_0x50c8('0x3b')]=function(_0x558e38,_0x22a361){var _0x24db1d={'raw':!![],'where':{'id':_0x558e38[_0x50c8('0x3c')]['id']}},_0x4eac97={};_0x4eac97[_0x50c8('0x29')]=_['keys'](db[_0x50c8('0x26')]['rawAttributes']);_0x4eac97[_0x50c8('0x2b')]=_[_0x50c8('0x2c')](_0x558e38[_0x50c8('0x2b')]);_0x4eac97[_0x50c8('0x2d')]=_[_0x50c8('0x2e')](_0x4eac97['model'],_0x4eac97['query']);_0x24db1d['attributes']=_['intersection'](_0x4eac97['model'],qs[_0x50c8('0x30')](_0x558e38[_0x50c8('0x2b')][_0x50c8('0x30')]));_0x24db1d['attributes']=_0x24db1d['attributes'][_0x50c8('0x3d')]?_0x24db1d[_0x50c8('0x2f')]:_0x4eac97[_0x50c8('0x29')];if(_0x558e38[_0x50c8('0x2b')][_0x50c8('0x38')]){_0x24db1d[_0x50c8('0x39')]=[{'all':!![]}];}_0x24db1d=_[_0x50c8('0x34')]({},_0x24db1d,_0x558e38['options']);return db[_0x50c8('0x26')][_0x50c8('0x3e')](_0x24db1d)[_0x50c8('0x21')](handleEntityNotFound(_0x22a361,null))[_0x50c8('0x21')](respondWithResult(_0x22a361,null))[_0x50c8('0x3a')](handleError(_0x22a361,null));};exports[_0x50c8('0x3f')]=function(_0x44f172,_0x5a23cd){return db[_0x50c8('0x26')]['create'](_0x44f172[_0x50c8('0x40')],{})[_0x50c8('0x21')](respondWithResult(_0x5a23cd,0xc9))[_0x50c8('0x3a')](handleError(_0x5a23cd,null));};exports[_0x50c8('0x20')]=function(_0x1167b0,_0x5deb78){if(_0x1167b0[_0x50c8('0x40')]['id']){delete _0x1167b0[_0x50c8('0x40')]['id'];}return db[_0x50c8('0x26')][_0x50c8('0x3e')]({'where':{'id':_0x1167b0[_0x50c8('0x3c')]['id']}})['then'](handleEntityNotFound(_0x5deb78,null))[_0x50c8('0x21')](saveUpdates(_0x1167b0[_0x50c8('0x40')],null))[_0x50c8('0x21')](respondWithResult(_0x5deb78,null))[_0x50c8('0x3a')](handleError(_0x5deb78,null));};exports['destroy']=function(_0x502e0f,_0x16e3ab){return db['DeskField'][_0x50c8('0x3e')]({'where':{'id':_0x502e0f[_0x50c8('0x3c')]['id']}})[_0x50c8('0x21')](handleEntityNotFound(_0x16e3ab,null))['then'](removeEntity(_0x16e3ab,null))[_0x50c8('0x3a')](handleError(_0x16e3ab,null));}; \ No newline at end of file +var _0x14f5=['fields','length','hasOwnProperty','limit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','reject','update','destroy','then','error','stack','name','send','index','map','DeskField','rawAttributes','key','query','keys','attributes','intersection','model'];(function(_0x262736,_0x1c6067){var _0x5e018a=function(_0x5e96fc){while(--_0x5e96fc){_0x262736['push'](_0x262736['shift']());}};_0x5e018a(++_0x1c6067);}(_0x14f5,0xae));var _0x514f=function(_0x597332,_0x3f5a39){_0x597332=_0x597332-0x0;var _0x433222=_0x14f5[_0x597332];return _0x433222;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x514f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x514f('0x1'));var rp=require(_0x514f('0x2'));var moment=require(_0x514f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x514f('0x4'));var util=require(_0x514f('0x5'));var path=require('path');var sox=require(_0x514f('0x6'));var csv=require(_0x514f('0x7'));var ejs=require(_0x514f('0x8'));var fs=require('fs');var fs_extra=require(_0x514f('0x9'));var _=require(_0x514f('0xa'));var squel=require(_0x514f('0xb'));var crypto=require(_0x514f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x514f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x514f('0xe'));var Papa=require(_0x514f('0xf'));var Redis=require(_0x514f('0x10'));var authService=require(_0x514f('0x11'));var qs=require(_0x514f('0x12'));var as=require(_0x514f('0x13'));var hardwareService=require(_0x514f('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x514f('0x15'));var licenseUtil=require(_0x514f('0x16'));var db=require(_0x514f('0x17'))['db'];function respondWithStatusCode(_0x321914,_0x3eed49){_0x3eed49=_0x3eed49||0xcc;return function(_0x2ed1b7){if(_0x2ed1b7){return _0x321914[_0x514f('0x18')](_0x3eed49);}return _0x321914[_0x514f('0x19')](_0x3eed49)[_0x514f('0x1a')]();};}function respondWithResult(_0x4124bf,_0x46e552){_0x46e552=_0x46e552||0xc8;return function(_0x3fc905){if(_0x3fc905){return _0x4124bf[_0x514f('0x19')](_0x46e552)[_0x514f('0x1b')](_0x3fc905);}};}function respondWithFilteredResult(_0x1694b3,_0x5865d1){return function(_0x70d2b4){if(_0x70d2b4){var _0x1f0cbe=typeof _0x5865d1['offset']===_0x514f('0x1c')&&typeof _0x5865d1['limit']===_0x514f('0x1c');var _0x309ce0=_0x70d2b4[_0x514f('0x1d')];var _0x5a5641=_0x1f0cbe?0x0:_0x5865d1[_0x514f('0x1e')];var _0x3673a4=_0x1f0cbe?_0x70d2b4[_0x514f('0x1d')]:_0x5865d1[_0x514f('0x1e')]+_0x5865d1['limit'];var _0x4f9193;if(_0x3673a4>=_0x309ce0){_0x3673a4=_0x309ce0;_0x4f9193=0xc8;}else{_0x4f9193=0xce;}_0x1694b3[_0x514f('0x19')](_0x4f9193);return _0x1694b3[_0x514f('0x1f')](_0x514f('0x20'),_0x5a5641+'-'+_0x3673a4+'/'+_0x309ce0)['json'](_0x70d2b4);}return null;};}function patchUpdates(_0x43fcf9){return function(_0x7248e8){try{jsonpatch['apply'](_0x7248e8,_0x43fcf9,!![]);}catch(_0x186417){return BPromise[_0x514f('0x21')](_0x186417);}return _0x7248e8['save']();};}function saveUpdates(_0xd093a1,_0x18a430){return function(_0xd89aa2){if(_0xd89aa2){return _0xd89aa2[_0x514f('0x22')](_0xd093a1)['then'](function(_0x58861e){return _0x58861e;});}return null;};}function removeEntity(_0x4b0245,_0x5d80cb){return function(_0x1c16f9){if(_0x1c16f9){return _0x1c16f9[_0x514f('0x23')]()[_0x514f('0x24')](function(){_0x4b0245[_0x514f('0x19')](0xcc)[_0x514f('0x1a')]();});}};}function handleEntityNotFound(_0x26df04,_0x2c6bb1){return function(_0x101742){if(!_0x101742){_0x26df04[_0x514f('0x18')](0x194);}return _0x101742;};}function handleError(_0x5f2da2,_0x8c8bdf){_0x8c8bdf=_0x8c8bdf||0x1f4;return function(_0x37b3db){logger[_0x514f('0x25')](_0x37b3db[_0x514f('0x26')]);if(_0x37b3db[_0x514f('0x27')]){delete _0x37b3db[_0x514f('0x27')];}_0x5f2da2[_0x514f('0x19')](_0x8c8bdf)[_0x514f('0x28')](_0x37b3db);};}exports[_0x514f('0x29')]=function(_0x594a50,_0x2c4c4b){var _0x488c17={},_0x2b43e0={},_0x51beda={'count':0x0,'rows':[]};var _0x40ac5e=_[_0x514f('0x2a')](db[_0x514f('0x2b')][_0x514f('0x2c')],function(_0xdc0bcc){return{'name':_0xdc0bcc['fieldName'],'type':_0xdc0bcc['type'][_0x514f('0x2d')]};});_0x2b43e0['model']=_[_0x514f('0x2a')](_0x40ac5e,_0x514f('0x27'));_0x2b43e0[_0x514f('0x2e')]=_[_0x514f('0x2f')](_0x594a50[_0x514f('0x2e')]);_0x2b43e0['filters']=_['intersection'](_0x2b43e0['model'],_0x2b43e0[_0x514f('0x2e')]);_0x488c17[_0x514f('0x30')]=_[_0x514f('0x31')](_0x2b43e0[_0x514f('0x32')],qs[_0x514f('0x33')](_0x594a50[_0x514f('0x2e')][_0x514f('0x33')]));_0x488c17[_0x514f('0x30')]=_0x488c17[_0x514f('0x30')][_0x514f('0x34')]?_0x488c17['attributes']:_0x2b43e0['model'];if(!_0x594a50['query'][_0x514f('0x35')]('nolimit')){_0x488c17[_0x514f('0x36')]=qs['limit'](_0x594a50[_0x514f('0x2e')]['limit']);_0x488c17['offset']=qs[_0x514f('0x1e')](_0x594a50['query'][_0x514f('0x1e')]);}_0x488c17[_0x514f('0x37')]=qs[_0x514f('0x38')](_0x594a50[_0x514f('0x2e')][_0x514f('0x38')]);_0x488c17['where']=qs[_0x514f('0x39')](_[_0x514f('0x3a')](_0x594a50[_0x514f('0x2e')],_0x2b43e0[_0x514f('0x39')]),_0x40ac5e);if(_0x594a50['query'][_0x514f('0x3b')]){_0x488c17[_0x514f('0x3c')]=_[_0x514f('0x3d')](_0x488c17[_0x514f('0x3c')],{'$or':_['map'](_0x40ac5e,function(_0x1c1a24){if(_0x1c1a24[_0x514f('0x3e')]!==_0x514f('0x3f')){var _0x281d39={};_0x281d39[_0x1c1a24['name']]={'$like':'%'+_0x594a50[_0x514f('0x2e')]['filter']+'%'};return _0x281d39;}})});}_0x488c17=_[_0x514f('0x3d')]({},_0x488c17,_0x594a50[_0x514f('0x40')]);var _0x18969b={'where':_0x488c17['where']};return db['DeskField'][_0x514f('0x1d')](_0x18969b)['then'](function(_0x10259a){_0x51beda[_0x514f('0x1d')]=_0x10259a;if(_0x594a50[_0x514f('0x2e')][_0x514f('0x41')]){_0x488c17[_0x514f('0x42')]=[{'all':!![]}];}return db[_0x514f('0x2b')][_0x514f('0x43')](_0x488c17);})['then'](function(_0x48914e){_0x51beda[_0x514f('0x44')]=_0x48914e;return _0x51beda;})['then'](respondWithFilteredResult(_0x2c4c4b,_0x488c17))[_0x514f('0x45')](handleError(_0x2c4c4b,null));};exports[_0x514f('0x46')]=function(_0x48d82a,_0x203af2){var _0x326ea6={'raw':!![],'where':{'id':_0x48d82a[_0x514f('0x47')]['id']}},_0x51e50b={};_0x51e50b['model']=_['keys'](db[_0x514f('0x2b')][_0x514f('0x2c')]);_0x51e50b[_0x514f('0x2e')]=_[_0x514f('0x2f')](_0x48d82a[_0x514f('0x2e')]);_0x51e50b['filters']=_['intersection'](_0x51e50b[_0x514f('0x32')],_0x51e50b[_0x514f('0x2e')]);_0x326ea6[_0x514f('0x30')]=_[_0x514f('0x31')](_0x51e50b[_0x514f('0x32')],qs['fields'](_0x48d82a[_0x514f('0x2e')]['fields']));_0x326ea6['attributes']=_0x326ea6[_0x514f('0x30')]['length']?_0x326ea6[_0x514f('0x30')]:_0x51e50b['model'];if(_0x48d82a['query'][_0x514f('0x41')]){_0x326ea6[_0x514f('0x42')]=[{'all':!![]}];}_0x326ea6=_['merge']({},_0x326ea6,_0x48d82a['options']);return db[_0x514f('0x2b')][_0x514f('0x48')](_0x326ea6)[_0x514f('0x24')](handleEntityNotFound(_0x203af2,null))[_0x514f('0x24')](respondWithResult(_0x203af2,null))[_0x514f('0x45')](handleError(_0x203af2,null));};exports[_0x514f('0x49')]=function(_0xa5259e,_0x1b33b2){return db[_0x514f('0x2b')]['create'](_0xa5259e[_0x514f('0x4a')],{})[_0x514f('0x24')](respondWithResult(_0x1b33b2,0xc9))[_0x514f('0x45')](handleError(_0x1b33b2,null));};exports[_0x514f('0x22')]=function(_0x33b658,_0x2e6971){if(_0x33b658[_0x514f('0x4a')]['id']){delete _0x33b658['body']['id'];}return db[_0x514f('0x2b')]['find']({'where':{'id':_0x33b658[_0x514f('0x47')]['id']}})[_0x514f('0x24')](handleEntityNotFound(_0x2e6971,null))[_0x514f('0x24')](saveUpdates(_0x33b658[_0x514f('0x4a')],null))[_0x514f('0x24')](respondWithResult(_0x2e6971,null))['catch'](handleError(_0x2e6971,null));};exports['destroy']=function(_0x38e237,_0x5e6e97){return db[_0x514f('0x2b')]['find']({'where':{'id':_0x38e237[_0x514f('0x47')]['id']}})[_0x514f('0x24')](handleEntityNotFound(_0x5e6e97,null))[_0x514f('0x24')](removeEntity(_0x5e6e97,null))['catch'](handleError(_0x5e6e97,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 1355a10..e510924 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 _0x33e6=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','exports','define','DeskField','desk_unique_index','idField','lodash','util'];(function(_0xf2634a,_0x31c7de){var _0x5b60ab=function(_0x496031){while(--_0x496031){_0xf2634a['push'](_0xf2634a['shift']());}};_0x5b60ab(++_0x31c7de);}(_0x33e6,0xfd));var _0x633e=function(_0x29231d,_0x47cdc3){_0x29231d=_0x29231d-0x0;var _0x7daa0d=_0x33e6[_0x29231d];return _0x7daa0d;};'use strict';var _=require(_0x633e('0x0'));var util=require(_0x633e('0x1'));var logger=require(_0x633e('0x2'))(_0x633e('0x3'));var moment=require(_0x633e('0x4'));var BPromise=require('bluebird');var rp=require(_0x633e('0x5'));var fs=require('fs');var path=require(_0x633e('0x6'));var rimraf=require(_0x633e('0x7'));var config=require(_0x633e('0x8'));var attributes=require(_0x633e('0x9'));module[_0x633e('0xa')]=function(_0x454169,_0x44826a){return _0x454169[_0x633e('0xb')](_0x633e('0xc'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x633e('0xd'),'fields':[_0x633e('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1fa9=['path','rimraf','../../config/environment','define','DeskField','int_desk_fields','desk_unique_index','FieldId','lodash','bluebird','request-promise'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0x1fa9,0x8c));var _0x91fa=function(_0x13ffb6,_0x51fcfc){_0x13ffb6=_0x13ffb6-0x0;var _0x1aa170=_0x1fa9[_0x13ffb6];return _0x1aa170;};'use strict';var _=require(_0x91fa('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x91fa('0x1'));var rp=require(_0x91fa('0x2'));var fs=require('fs');var path=require(_0x91fa('0x3'));var rimraf=require(_0x91fa('0x4'));var config=require(_0x91fa('0x5'));var attributes=require('./intDeskField.attributes');module['exports']=function(_0x40e26a,_0x411fc6){return _0x40e26a[_0x91fa('0x6')](_0x91fa('0x7'),attributes,{'tableName':_0x91fa('0x8'),'paranoid':![],'indexes':[{'name':_0x91fa('0x9'),'fields':['idField',_0x91fa('0xa')],'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 a40aad5..365d5ba 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 _0x1769=['request','then','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3c06c6,_0x21a8f0){var _0x3fcb33=function(_0x25344c){while(--_0x25344c){_0x3c06c6['push'](_0x3c06c6['shift']());}};_0x3fcb33(++_0x21a8f0);}(_0x1769,0x19d));var _0x9176=function(_0x565f59,_0x58f11a){_0x565f59=_0x565f59-0x0;var _0x54dbf4=_0x1769[_0x565f59];return _0x54dbf4;};'use strict';var _=require(_0x9176('0x0'));var util=require(_0x9176('0x1'));var moment=require('moment');var BPromise=require(_0x9176('0x2'));var rs=require(_0x9176('0x3'));var fs=require('fs');var Redis=require(_0x9176('0x4'));var db=require(_0x9176('0x5'))['db'];var utils=require(_0x9176('0x6'));var logger=require(_0x9176('0x7'))(_0x9176('0x8'));var config=require(_0x9176('0x9'));var jayson=require(_0x9176('0xa'));var client=jayson['client'][_0x9176('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x293612,_0x33f1d7,_0xf38cf3){return new BPromise(function(_0x85e692,_0x47116b){return client[_0x9176('0xc')](_0x293612,_0xf38cf3)[_0x9176('0xd')](function(_0x3290e6){logger['info'](_0x9176('0xe'),_0x33f1d7,_0x9176('0xf'));logger[_0x9176('0x10')](_0x9176('0x11'),_0x33f1d7,_0x9176('0xf'),JSON[_0x9176('0x12')](_0x3290e6));if(_0x3290e6[_0x9176('0x13')]){if(_0x3290e6[_0x9176('0x13')][_0x9176('0x14')]===0x1f4){logger[_0x9176('0x13')](_0x9176('0xe'),_0x33f1d7,_0x3290e6[_0x9176('0x13')][_0x9176('0x15')]);return _0x47116b(_0x3290e6['error']['message']);}logger[_0x9176('0x13')](_0x9176('0xe'),_0x33f1d7,_0x3290e6['error']['message']);return _0x85e692(_0x3290e6[_0x9176('0x13')][_0x9176('0x15')]);}else{logger[_0x9176('0x16')](_0x9176('0xe'),_0x33f1d7,_0x9176('0xf'));_0x85e692(_0x3290e6[_0x9176('0x17')][_0x9176('0x15')]);}})[_0x9176('0x18')](function(_0x4a486d){logger[_0x9176('0x13')](_0x9176('0xe'),_0x33f1d7,_0x4a486d);_0x47116b(_0x4a486d);});});} \ No newline at end of file +var _0xafb6=['jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0xa11fd5,_0x238e93){var _0x21886e=function(_0x1b254d){while(--_0x1b254d){_0xa11fd5['push'](_0xa11fd5['shift']());}};_0x21886e(++_0x238e93);}(_0xafb6,0x1a7));var _0x6afb=function(_0x3ae2b2,_0x2d936f){_0x3ae2b2=_0x3ae2b2-0x0;var _0x1dbf00=_0xafb6[_0x3ae2b2];return _0x1dbf00;};'use strict';var _=require(_0x6afb('0x0'));var util=require(_0x6afb('0x1'));var moment=require('moment');var BPromise=require(_0x6afb('0x2'));var rs=require(_0x6afb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6afb('0x4'))['db'];var utils=require(_0x6afb('0x5'));var logger=require(_0x6afb('0x6'))(_0x6afb('0x7'));var config=require(_0x6afb('0x8'));var jayson=require(_0x6afb('0x9'));var client=jayson[_0x6afb('0xa')][_0x6afb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x30003e,_0x2fdfb1,_0x1e8cb6){return new BPromise(function(_0x3a5321,_0x338ea3){return client[_0x6afb('0xc')](_0x30003e,_0x1e8cb6)[_0x6afb('0xd')](function(_0x105fb7){logger[_0x6afb('0xe')](_0x6afb('0xf'),_0x2fdfb1,'request\x20sent');logger[_0x6afb('0x10')](_0x6afb('0x11'),_0x2fdfb1,'request\x20sent',JSON[_0x6afb('0x12')](_0x105fb7));if(_0x105fb7[_0x6afb('0x13')]){if(_0x105fb7[_0x6afb('0x13')]['code']===0x1f4){logger['error'](_0x6afb('0xf'),_0x2fdfb1,_0x105fb7[_0x6afb('0x13')]['message']);return _0x338ea3(_0x105fb7['error'][_0x6afb('0x14')]);}logger[_0x6afb('0x13')]('DeskField,\x20%s,\x20%s',_0x2fdfb1,_0x105fb7['error']['message']);return _0x3a5321(_0x105fb7['error']['message']);}else{logger[_0x6afb('0xe')](_0x6afb('0xf'),_0x2fdfb1,_0x6afb('0x15'));_0x3a5321(_0x105fb7[_0x6afb('0x16')][_0x6afb('0x14')]);}})[_0x6afb('0x17')](function(_0x4ea6c5){logger[_0x6afb('0x13')](_0x6afb('0xf'),_0x2fdfb1,_0x4ea6c5);_0x338ea3(_0x4ea6c5);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index f16d02a..ae4ad00 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 _0x30a6=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','/:id/configurations','post','create','addConfiguration','put','update','delete','exports','multer','util','path'];(function(_0x173300,_0x41de8d){var _0x2c7581=function(_0x365231){while(--_0x365231){_0x173300['push'](_0x173300['shift']());}};_0x2c7581(++_0x41de8d);}(_0x30a6,0x107));var _0x630a=function(_0x4b2a54,_0x1a077f){_0x4b2a54=_0x4b2a54-0x0;var _0x4ce90c=_0x30a6[_0x4b2a54];return _0x4ce90c;};'use strict';var multer=require(_0x630a('0x0'));var util=require(_0x630a('0x1'));var path=require(_0x630a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x630a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x630a('0x4'));var interaction=require(_0x630a('0x5'));var config=require(_0x630a('0x6'));var controller=require('./intDynamics365Account.controller');router['get']('/',auth[_0x630a('0x7')](),controller['index']);router[_0x630a('0x8')](_0x630a('0x9'),auth['isAuthenticated'](),controller[_0x630a('0xa')]);router[_0x630a('0x8')](_0x630a('0xb'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x630a('0x8')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x630a('0xc')]('/',auth[_0x630a('0x7')](),controller[_0x630a('0xd')]);router[_0x630a('0xc')]('/:id/configurations',auth[_0x630a('0x7')](),controller[_0x630a('0xe')]);router[_0x630a('0xf')]('/:id',auth[_0x630a('0x7')](),controller[_0x630a('0x10')]);router[_0x630a('0x11')]('/:id',auth[_0x630a('0x7')](),controller['destroy']);module[_0x630a('0x12')]=router; \ No newline at end of file +var _0xc404=['getFields','post','create','addConfiguration','put','delete','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x5366ea,_0x11dcea){var _0x5e248a=function(_0x1be5d2){while(--_0x1be5d2){_0x5366ea['push'](_0x5366ea['shift']());}};_0x5e248a(++_0x11dcea);}(_0xc404,0x110));var _0x4c40=function(_0x20ab30,_0x13a3c4){_0x20ab30=_0x20ab30-0x0;var _0x2a3aa2=_0xc404[_0x20ab30];return _0x2a3aa2;};'use strict';var multer=require(_0x4c40('0x0'));var util=require(_0x4c40('0x1'));var path=require('path');var timeout=require(_0x4c40('0x2'));var express=require(_0x4c40('0x3'));var router=express[_0x4c40('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4c40('0x5'));var interaction=require(_0x4c40('0x6'));var config=require('../../config/environment');var controller=require('./intDynamics365Account.controller');router[_0x4c40('0x7')]('/',auth[_0x4c40('0x8')](),controller['index']);router['get'](_0x4c40('0x9'),auth[_0x4c40('0x8')](),controller['show']);router[_0x4c40('0x7')](_0x4c40('0xa'),auth['isAuthenticated'](),controller[_0x4c40('0xb')]);router['get'](_0x4c40('0xc'),auth[_0x4c40('0x8')](),controller[_0x4c40('0xd')]);router[_0x4c40('0xe')]('/',auth[_0x4c40('0x8')](),controller[_0x4c40('0xf')]);router[_0x4c40('0xe')](_0x4c40('0xa'),auth[_0x4c40('0x8')](),controller[_0x4c40('0x10')]);router[_0x4c40('0x11')]('/:id',auth[_0x4c40('0x8')](),controller['update']);router[_0x4c40('0x12')](_0x4c40('0x9'),auth[_0x4c40('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index bd89c0d..83a4778 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 _0xd0c9=['STRING','sequelize','exports'];(function(_0xcb8fde,_0x24399c){var _0x16dd77=function(_0x27cab4){while(--_0x27cab4){_0xcb8fde['push'](_0xcb8fde['shift']());}};_0x16dd77(++_0x24399c);}(_0xd0c9,0xe2));var _0x9d0c=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xd0c9[_0x1cc8fe];return _0x230054;};'use strict';var Sequelize=require(_0x9d0c('0x0'));module[_0x9d0c('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x9d0c('0x2')]},'tenantId':{'type':Sequelize[_0x9d0c('0x2')]},'clientId':{'type':Sequelize[_0x9d0c('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x9d0c('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x2d72=['sequelize','exports','STRING','BOOLEAN'];(function(_0x3c461d,_0x1c9038){var _0x2acbf9=function(_0xe30957){while(--_0xe30957){_0x3c461d['push'](_0x3c461d['shift']());}};_0x2acbf9(++_0x1c9038);}(_0x2d72,0xa8));var _0x22d7=function(_0x4448ac,_0x4101b5){_0x4448ac=_0x4448ac-0x0;var _0xe71cc8=_0x2d72[_0x4448ac];return _0xe71cc8;};'use strict';var Sequelize=require(_0x22d7('0x0'));module[_0x22d7('0x1')]={'name':{'type':Sequelize[_0x22d7('0x2')]},'username':{'type':Sequelize[_0x22d7('0x2')]},'password':{'type':Sequelize[_0x22d7('0x2')]},'remoteUri':{'type':Sequelize[_0x22d7('0x2')]},'tenantId':{'type':Sequelize[_0x22d7('0x2')]},'clientId':{'type':Sequelize[_0x22d7('0x2')]},'clientSecret':{'type':Sequelize[_0x22d7('0x2')]},'serverUrl':{'type':Sequelize[_0x22d7('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x22d7('0x2')]},'modernAuthentication':{'type':Sequelize[_0x22d7('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 9a8bd81..95d5f59 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 _0x0c3b=['MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','includes','LogicalName','forEach','@odata.type','lastIndexOf','all','isNil','BooleanAttributeMetadata','push','StringAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','stack','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','UserLocalizedLabel','Label','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','TrueOption','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','offset','count','set','Content-Range','json','update','destroy','then','end','sendStatus','error','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','merge','VIRTUAL','options','Dynamics365Account','includeAll','include','findAll','rows','params','find','catch','create','body','getConfigurations','findOne','Dynamics365Configuration','filter','Subjects','Descriptions','getDescriptions','channel','Dynamics365Field','slice','substring','format','%s/api/data/v9.0/','getFields','ticketType','incident','PhoneCall','title','description','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidyominame','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','importsequencenumber','influencescore','lastonholdtime','masteridname','modifiedbyname','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','onholdtime','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','concat','username','password','tenantId','clientId','modernAuthentication','CloudProvider','data5','data7','access_token','remoteUri','POST','https://login.microsoftonline.com/','/oauth2/token','clientSecret','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value'];(function(_0x3eb713,_0x437874){var _0x1d7128=function(_0x2b9cea){while(--_0x2b9cea){_0x3eb713['push'](_0x3eb713['shift']());}};_0x1d7128(++_0x437874);}(_0x0c3b,0x1a9));var _0xb0c3=function(_0x7c95e1,_0x373a2d){_0x7c95e1=_0x7c95e1-0x0;var _0x42819d=_0x0c3b[_0x7c95e1];return _0x42819d;};'use strict';var rp=require(_0xb0c3('0x0'));var util=require('util');var _=require(_0xb0c3('0x1'));var qs=require(_0xb0c3('0x2'));var logger=require(_0xb0c3('0x3'))(_0xb0c3('0x4'));var db=require(_0xb0c3('0x5'))['db'];var integrations=require(_0xb0c3('0x6'));function respondWithResult(_0x6801c,_0x2fb101){_0x2fb101=_0x2fb101||0xc8;return function(_0x467e52){if(_0x467e52){return _0x6801c[_0xb0c3('0x7')](_0x2fb101)['json'](_0x467e52);}};}function respondWithFilteredResult(_0x492356,_0x5db482){return function(_0x2b30be){if(_0x2b30be){var _0x40b9b5=typeof _0x5db482[_0xb0c3('0x8')]==='undefined'&&typeof _0x5db482['limit']==='undefined';var _0x56342b=_0x2b30be[_0xb0c3('0x9')];var _0x1b183e=_0x40b9b5?0x0:_0x5db482['offset'];var _0x28cd0d=_0x40b9b5?_0x2b30be[_0xb0c3('0x9')]:_0x5db482[_0xb0c3('0x8')]+_0x5db482['limit'];var _0x4cfc21;if(_0x28cd0d>=_0x56342b){_0x28cd0d=_0x56342b;_0x4cfc21=0xc8;}else{_0x4cfc21=0xce;}_0x492356[_0xb0c3('0x7')](_0x4cfc21);return _0x492356[_0xb0c3('0xa')](_0xb0c3('0xb'),_0x1b183e+'-'+_0x28cd0d+'/'+_0x56342b)[_0xb0c3('0xc')](_0x2b30be);}return null;};}function saveUpdates(_0x10e5bb){return function(_0x5b763b){if(_0x5b763b){return _0x5b763b[_0xb0c3('0xd')](_0x10e5bb)['then'](function(_0xf71186){return _0xf71186;});}return null;};}function removeEntity(_0x10bf41){return function(_0x32d52f){if(_0x32d52f){return _0x32d52f[_0xb0c3('0xe')]()[_0xb0c3('0xf')](function(){_0x10bf41['status'](0xcc)[_0xb0c3('0x10')]();});}};}function handleEntityNotFound(_0xd8b13d){return function(_0x3eb92f){if(!_0x3eb92f){_0xd8b13d[_0xb0c3('0x11')](0x194);}return _0x3eb92f;};}function handleError(_0x5a5023,_0x28d867){_0x28d867=_0x28d867||0x1f4;return function(_0x16c893){logger[_0xb0c3('0x12')](_0x16c893['stack']);if(_0x16c893[_0xb0c3('0x13')]){delete _0x16c893['name'];}_0x5a5023['status'](_0x28d867)[_0xb0c3('0x14')](_0x16c893);};}exports[_0xb0c3('0x15')]=function(_0x192285,_0x28549a){var _0x2474f3={},_0xde3e91={},_0x13f94b={'count':0x0,'rows':[]};var _0x546bba=_['map'](db['Dynamics365Account'][_0xb0c3('0x16')],function(_0x47fd7b){return{'name':_0x47fd7b[_0xb0c3('0x17')],'type':_0x47fd7b[_0xb0c3('0x18')][_0xb0c3('0x19')]};});_0xde3e91[_0xb0c3('0x1a')]=_[_0xb0c3('0x1b')](_0x546bba,_0xb0c3('0x13'));_0xde3e91[_0xb0c3('0x1c')]=_[_0xb0c3('0x1d')](_0x192285[_0xb0c3('0x1c')]);_0xde3e91[_0xb0c3('0x1e')]=_['intersection'](_0xde3e91[_0xb0c3('0x1a')],_0xde3e91[_0xb0c3('0x1c')]);_0x2474f3[_0xb0c3('0x1f')]=_[_0xb0c3('0x20')](_0xde3e91[_0xb0c3('0x1a')],qs[_0xb0c3('0x21')](_0x192285[_0xb0c3('0x1c')][_0xb0c3('0x21')]));_0x2474f3['attributes']=_0x2474f3[_0xb0c3('0x1f')][_0xb0c3('0x22')]?_0x2474f3[_0xb0c3('0x1f')]:_0xde3e91[_0xb0c3('0x1a')];if(!_0x192285['query'][_0xb0c3('0x23')](_0xb0c3('0x24'))){_0x2474f3['limit']=qs[_0xb0c3('0x25')](_0x192285[_0xb0c3('0x1c')][_0xb0c3('0x25')]);_0x2474f3[_0xb0c3('0x8')]=qs[_0xb0c3('0x8')](_0x192285['query'][_0xb0c3('0x8')]);}_0x2474f3['order']=qs[_0xb0c3('0x26')](_0x192285[_0xb0c3('0x1c')][_0xb0c3('0x26')]);_0x2474f3[_0xb0c3('0x27')]=qs['filters'](_[_0xb0c3('0x28')](_0x192285[_0xb0c3('0x1c')],_0xde3e91['filters']),_0x546bba);if(_0x192285[_0xb0c3('0x1c')]['filter']){_0x2474f3['where']=_[_0xb0c3('0x29')](_0x2474f3[_0xb0c3('0x27')],{'$or':_[_0xb0c3('0x1b')](_0x546bba,function(_0x4e2e76){if(_0x4e2e76[_0xb0c3('0x18')]!==_0xb0c3('0x2a')){var _0xe13c05={};_0xe13c05[_0x4e2e76[_0xb0c3('0x13')]]={'$like':'%'+_0x192285['query']['filter']+'%'};return _0xe13c05;}})});}_0x2474f3=_[_0xb0c3('0x29')]({},_0x2474f3,_0x192285[_0xb0c3('0x2b')]);var _0x213f2a={'where':_0x2474f3[_0xb0c3('0x27')]};return db[_0xb0c3('0x2c')][_0xb0c3('0x9')](_0x213f2a)['then'](function(_0x42273b){_0x13f94b[_0xb0c3('0x9')]=_0x42273b;if(_0x192285[_0xb0c3('0x1c')][_0xb0c3('0x2d')]){_0x2474f3[_0xb0c3('0x2e')]=[{'all':!![]}];}return db[_0xb0c3('0x2c')][_0xb0c3('0x2f')](_0x2474f3);})[_0xb0c3('0xf')](function(_0x30c9d2){_0x13f94b[_0xb0c3('0x30')]=_0x30c9d2;return _0x13f94b;})[_0xb0c3('0xf')](respondWithFilteredResult(_0x28549a,_0x2474f3))['catch'](handleError(_0x28549a,null));};exports['show']=function(_0xaadc25,_0x54fb6f){var _0x5de8e8={'raw':![],'where':{'id':_0xaadc25[_0xb0c3('0x31')]['id']}},_0xe76a2f={};_0xe76a2f[_0xb0c3('0x1a')]=_['keys'](db[_0xb0c3('0x2c')][_0xb0c3('0x16')]);_0xe76a2f[_0xb0c3('0x1c')]=_[_0xb0c3('0x1d')](_0xaadc25[_0xb0c3('0x1c')]);_0xe76a2f[_0xb0c3('0x1e')]=_[_0xb0c3('0x20')](_0xe76a2f[_0xb0c3('0x1a')],_0xe76a2f['query']);_0x5de8e8[_0xb0c3('0x1f')]=_[_0xb0c3('0x20')](_0xe76a2f[_0xb0c3('0x1a')],qs[_0xb0c3('0x21')](_0xaadc25[_0xb0c3('0x1c')][_0xb0c3('0x21')]));_0x5de8e8['attributes']=_0x5de8e8[_0xb0c3('0x1f')][_0xb0c3('0x22')]?_0x5de8e8[_0xb0c3('0x1f')]:_0xe76a2f[_0xb0c3('0x1a')];if(_0xaadc25[_0xb0c3('0x1c')][_0xb0c3('0x2d')]){_0x5de8e8[_0xb0c3('0x2e')]=[{'all':!![]}];}_0x5de8e8=_['merge']({},_0x5de8e8,_0xaadc25['options']);return db[_0xb0c3('0x2c')][_0xb0c3('0x32')](_0x5de8e8)[_0xb0c3('0xf')](handleEntityNotFound(_0x54fb6f,null))['then'](respondWithResult(_0x54fb6f,null))[_0xb0c3('0x33')](handleError(_0x54fb6f,null));};exports['create']=function(_0x278a02,_0xd6539f){return db[_0xb0c3('0x2c')][_0xb0c3('0x34')](_0x278a02[_0xb0c3('0x35')],{})['then'](respondWithResult(_0xd6539f,0xc9))[_0xb0c3('0x33')](handleError(_0xd6539f,null));};exports[_0xb0c3('0xd')]=function(_0x45eb5f,_0x47bc1a){if(_0x45eb5f['body']['id']){delete _0x45eb5f[_0xb0c3('0x35')]['id'];}return db['Dynamics365Account'][_0xb0c3('0x32')]({'where':{'id':_0x45eb5f['params']['id']}})[_0xb0c3('0xf')](handleEntityNotFound(_0x47bc1a,null))[_0xb0c3('0xf')](saveUpdates(_0x45eb5f['body'],null))[_0xb0c3('0xf')](respondWithResult(_0x47bc1a,null))['catch'](handleError(_0x47bc1a,null));};exports[_0xb0c3('0xe')]=function(_0x15901d,_0x2ba480){return db['Dynamics365Account']['find']({'where':{'id':_0x15901d[_0xb0c3('0x31')]['id']}})[_0xb0c3('0xf')](handleEntityNotFound(_0x2ba480,null))['then'](removeEntity(_0x2ba480,null))[_0xb0c3('0x33')](handleError(_0x2ba480,null));};exports[_0xb0c3('0x36')]=function(_0x5d3371,_0x30a5bc){var _0x5b1e4f={};var _0x32a342={};var _0x131690;var _0x268e86;return db[_0xb0c3('0x2c')][_0xb0c3('0x37')]({'where':{'id':_0x5d3371['params']['id']}})[_0xb0c3('0xf')](handleEntityNotFound(_0x30a5bc,null))[_0xb0c3('0xf')](function(_0x980af3){if(_0x980af3){_0x131690=_0x980af3;_0x32a342[_0xb0c3('0x1a')]=_[_0xb0c3('0x1d')](db[_0xb0c3('0x38')][_0xb0c3('0x16')]);_0x32a342[_0xb0c3('0x1c')]=_[_0xb0c3('0x1d')](_0x5d3371[_0xb0c3('0x1c')]);_0x32a342['filters']=_[_0xb0c3('0x20')](_0x32a342[_0xb0c3('0x1a')],_0x32a342[_0xb0c3('0x1c')]);_0x5b1e4f[_0xb0c3('0x1f')]=_[_0xb0c3('0x20')](_0x32a342[_0xb0c3('0x1a')],qs[_0xb0c3('0x21')](_0x5d3371[_0xb0c3('0x1c')][_0xb0c3('0x21')]));_0x5b1e4f['attributes']=_0x5b1e4f[_0xb0c3('0x1f')]['length']?_0x5b1e4f[_0xb0c3('0x1f')]:_0x32a342[_0xb0c3('0x1a')];_0x5b1e4f['order']=qs[_0xb0c3('0x26')](_0x5d3371[_0xb0c3('0x1c')]['sort']);_0x5b1e4f['where']=qs['filters'](_[_0xb0c3('0x28')](_0x5d3371['query'],_0x32a342[_0xb0c3('0x1e')]));if(_0x5d3371['query']['filter']){_0x5b1e4f[_0xb0c3('0x27')]=_['merge'](_0x5b1e4f[_0xb0c3('0x27')],{'$or':_[_0xb0c3('0x1b')](_0x5b1e4f[_0xb0c3('0x1f')],function(_0x4dc764){var _0xc26614={};_0xc26614[_0x4dc764]={'$like':'%'+_0x5d3371[_0xb0c3('0x1c')][_0xb0c3('0x39')]+'%'};return _0xc26614;})});}_0x5b1e4f=_['merge']({},_0x5b1e4f,_0x5d3371['options']);return _0x131690['getConfigurations'](_0x5b1e4f);}})[_0xb0c3('0xf')](function(_0x5a9fe8){if(_0x5a9fe8){_0x268e86=_0x5a9fe8[_0xb0c3('0x22')];if(!_0x5d3371['query'][_0xb0c3('0x23')](_0xb0c3('0x24'))){_0x5b1e4f[_0xb0c3('0x25')]=qs[_0xb0c3('0x25')](_0x5d3371[_0xb0c3('0x1c')]['limit']);_0x5b1e4f[_0xb0c3('0x8')]=qs[_0xb0c3('0x8')](_0x5d3371[_0xb0c3('0x1c')][_0xb0c3('0x8')]);}return _0x131690[_0xb0c3('0x36')](_0x5b1e4f);}})[_0xb0c3('0xf')](function(_0x5e4403){if(_0x5e4403){return _0x5e4403?{'count':_0x268e86,'rows':_0x5e4403}:null;}})[_0xb0c3('0xf')](respondWithResult(_0x30a5bc,null))['catch'](handleError(_0x30a5bc,null));};exports['addConfiguration']=function(_0x3af8c2,_0x31b273){if(_0x3af8c2[_0xb0c3('0x35')]['id']){delete _0x3af8c2[_0xb0c3('0x35')]['id'];}return db['Dynamics365Account'][_0xb0c3('0x37')]({'where':{'id':_0x3af8c2[_0xb0c3('0x31')]['id']}})['then'](handleEntityNotFound(_0x31b273,null))[_0xb0c3('0xf')](function(_0x3a4501){if(_0x3a4501){_0x3af8c2[_0xb0c3('0x35')]['AccountId']=_0x3a4501['id'];_0x3af8c2['body'][_0xb0c3('0x3a')]=integrations['getSubjects'](_0x3af8c2[_0xb0c3('0x35')]['channel'],_0x3af8c2[_0xb0c3('0x35')]['type']);_0x3af8c2['body'][_0xb0c3('0x3b')]=integrations[_0xb0c3('0x3c')](_0x3af8c2['body'][_0xb0c3('0x3d')],_0x3af8c2[_0xb0c3('0x35')][_0xb0c3('0x18')]);return db[_0xb0c3('0x38')][_0xb0c3('0x34')](_0x3af8c2[_0xb0c3('0x35')],{'include':[{'model':db[_0xb0c3('0x3e')],'as':_0xb0c3('0x3a')},{'model':db[_0xb0c3('0x3e')],'as':'Descriptions'}]});}return null;})[_0xb0c3('0xf')](respondWithResult(_0x31b273,null))[_0xb0c3('0x33')](handleError(_0x31b273,null));};function sanitizeRemoteUri(_0x409c64){var _0x39f32d=_0x409c64[_0xb0c3('0x3f')](-0x1);if(_0x39f32d==='/')return _0x409c64[_0xb0c3('0x40')](0x0,_0x409c64['lastIndexOf'](_0x39f32d));return _0x409c64;}function getWebApiUrl(_0x22f9a3){return util[_0xb0c3('0x41')](_0xb0c3('0x42'),_0x22f9a3);}exports[_0xb0c3('0x43')]=function(_0x560b05,_0x33f21b){var _0x182544=_0x560b05['query'][_0xb0c3('0x44')];var _0x5c54cb=_0x182544===_0xb0c3('0x45')?'Incident':_0xb0c3('0x46');var _0x4a533d='';var _0x55d3e1='';var _0x33ee9b='';var _0x3f7a62='';var _0x3f1f9e='';var _0xe7a31d='';var _0xf9c671='';var _0x371766='';var _0x24a217=[_0xb0c3('0x47'),_0xb0c3('0x48'),'customerid',_0xb0c3('0x49'),_0xb0c3('0x4a'),_0xb0c3('0x4b'),_0xb0c3('0x4c'),_0xb0c3('0x4d'),_0xb0c3('0x4e'),_0xb0c3('0x4f')];var _0xdea594=['accountidname',_0xb0c3('0x50'),'actualserviceunits',_0xb0c3('0x51'),_0xb0c3('0x52'),_0xb0c3('0x53'),_0xb0c3('0x54'),_0xb0c3('0x55'),'createdbyexternalpartyname',_0xb0c3('0x56'),_0xb0c3('0x57'),_0xb0c3('0x58'),_0xb0c3('0x59'),_0xb0c3('0x5a'),_0xb0c3('0x5b'),_0xb0c3('0x5c'),_0xb0c3('0x5d'),_0xb0c3('0x5e'),_0xb0c3('0x5f'),_0xb0c3('0x60'),_0xb0c3('0x61'),_0xb0c3('0x62'),_0xb0c3('0x63'),_0xb0c3('0x64'),'firstresponsebykpiidname','followupby',_0xb0c3('0x65'),_0xb0c3('0x66'),'kbarticleidname',_0xb0c3('0x67'),_0xb0c3('0x68'),'modifiedbyexternalpartyname','modifiedbyexternalpartyyominame',_0xb0c3('0x69'),'modifiedbyyominame','modifiedon',_0xb0c3('0x6a'),_0xb0c3('0x6b'),_0xb0c3('0x6c'),_0xb0c3('0x6d'),'numberofchildincidents',_0xb0c3('0x6e'),'overriddencreatedon',_0xb0c3('0x6f'),_0xb0c3('0x70'),_0xb0c3('0x71'),_0xb0c3('0x72'),_0xb0c3('0x73'),_0xb0c3('0x74'),_0xb0c3('0x75'),_0xb0c3('0x76'),_0xb0c3('0x77'),_0xb0c3('0x78'),_0xb0c3('0x79'),_0xb0c3('0x7a'),'responsiblecontactidname',_0xb0c3('0x7b'),_0xb0c3('0x7c'),_0xb0c3('0x7d'),_0xb0c3('0x7e'),_0xb0c3('0x7f'),_0xb0c3('0x80'),'statuscode',_0xb0c3('0x81'),_0xb0c3('0x82'),_0xb0c3('0x83'),_0xb0c3('0x84'),_0xb0c3('0x85'),'utcconversiontimezonecode','versionnumber'];var _0x253a79=_0x24a217[_0xb0c3('0x86')](_0xdea594);return db['Dynamics365Account'][_0xb0c3('0x37')]({'where':{'id':_0x560b05[_0xb0c3('0x31')]['id']},'attributes':['id',_0xb0c3('0x87'),_0xb0c3('0x88'),'remoteUri',_0xb0c3('0x89'),_0xb0c3('0x8a'),'clientSecret',_0xb0c3('0x8b')],'include':[{'model':db['CloudProvider'],'as':_0xb0c3('0x8c'),'attributes':['id',_0xb0c3('0x8d'),_0xb0c3('0x8e')]}]})[_0xb0c3('0xf')](handleEntityNotFound(_0x33f21b,null))['then'](function(_0x15d774){if(_0x15d774){if(_0x15d774[_0xb0c3('0x8b')]){_0x15d774[_0xb0c3('0x8f')]=_0x15d774[_0xb0c3('0x8c')][_0xb0c3('0x8d')];_0x371766=sanitizeRemoteUri(_0x15d774['CloudProvider']['data7']);_0xf9c671=getWebApiUrl(_0x371766);return _0x15d774;}_0x371766=sanitizeRemoteUri(_0x15d774[_0xb0c3('0x90')]);_0xf9c671=getWebApiUrl(_0x371766);var _0x360ba6={'method':_0xb0c3('0x91'),'uri':_0xb0c3('0x92')+_0x15d774['tenantId']+_0xb0c3('0x93'),'form':{'client_id':_0x15d774[_0xb0c3('0x8a')],'resource':_0x371766,'username':_0x15d774['username'],'password':_0x15d774['password'],'grant_type':_0xb0c3('0x88'),'client_secret':_0x15d774[_0xb0c3('0x94')]},'json':!![]};return rp(_0x360ba6);}})[_0xb0c3('0xf')](function(_0x5011fd){_0xe7a31d=_0x5011fd['access_token'];var _0x2ac0c4={'method':_0xb0c3('0x95'),'uri':encodeURI(_0xf9c671+_0xb0c3('0x96')+_0x5c54cb+'\x27'),'headers':{'Authorization':_0xb0c3('0x97')+_0xe7a31d,'If-None-Match':null,'OData-Version':_0xb0c3('0x98')},'json':!![]};return rp(_0x2ac0c4);})[_0xb0c3('0xf')](function(_0x4be9c2){var _0x59487d=_0x4be9c2[_0xb0c3('0x99')][0x0];var _0x1e182f=_0x59487d[_0xb0c3('0x9a')];var _0x309d1e={'method':_0xb0c3('0x95'),'uri':_0xf9c671+_0xb0c3('0x9b')+_0x1e182f+_0xb0c3('0x9c'),'headers':{'Authorization':_0xb0c3('0x97')+_0xe7a31d,'If-None-Match':null,'OData-Version':_0xb0c3('0x98')},'json':!![]};return rp(_0x309d1e);})[_0xb0c3('0xf')](function(_0x589c08){_0x4a533d=_0x589c08;_0x55d3e1=_0x4a533d[_0xb0c3('0x9d')];_0x55d3e1=_['remove'](_0x55d3e1,function(_0x4cd06a){return!_0x253a79[_0xb0c3('0x9e')](_0x4cd06a[_0xb0c3('0x9f')]);});var _0x459483=[];var _0x2aeeb0=[];_0x55d3e1[_0xb0c3('0xa0')](function(_0x436a9e){if(_0x436a9e['@odata.type']){var _0x55fa00=_0x436a9e[_0xb0c3('0xa1')][_0xb0c3('0x40')](_0x436a9e[_0xb0c3('0xa1')][_0xb0c3('0xa2')]('.')+0x1);if(_0x55fa00==='PicklistAttributeMetadata'){_0x459483['push'](getSelectList(_0xf9c671,_0x182544,_0x2aeeb0,_0x4a533d['MetadataId'],_0x436a9e[_0xb0c3('0x9a')],_0xe7a31d));}}});return Promise[_0xb0c3('0xa3')](_0x459483);})['then'](function(_0x48bdf3){_0x33ee9b=_0x48bdf3[0x0];var _0x5ebb71=[];var _0x1399a4=[];_0x55d3e1[_0xb0c3('0xa0')](function(_0x3d4607){if(!_[_0xb0c3('0xa4')](_0x3d4607[_0xb0c3('0xa1')])){var _0x3f0d56=_0x3d4607[_0xb0c3('0xa1')][_0xb0c3('0x40')](_0x3d4607[_0xb0c3('0xa1')][_0xb0c3('0xa2')]('.')+0x1);if(_0x3f0d56===_0xb0c3('0xa5')){_0x5ebb71[_0xb0c3('0xa6')](getBooleanList(_0xf9c671,_0x182544,_0x1399a4,_0x4a533d[_0xb0c3('0x9a')],_0x3d4607[_0xb0c3('0x9a')],_0xe7a31d));}}});return Promise[_0xb0c3('0xa3')](_0x5ebb71);})[_0xb0c3('0xf')](function(_0x5726d7){_0x3f7a62=_0x5726d7[0x0];var _0x1bbec8=[];var _0x5a9801=[];_0x55d3e1[_0xb0c3('0xa0')](function(_0x5c0546){if(_0x5c0546['@odata.type']){var _0x20337c=_0x5c0546[_0xb0c3('0xa1')][_0xb0c3('0x40')](_0x5c0546[_0xb0c3('0xa1')][_0xb0c3('0xa2')]('.')+0x1);if(_0x20337c===_0xb0c3('0xa7')||_0x20337c===_0xb0c3('0xa8')||_0x20337c==='BigIntAttributeMetadata'||_0x20337c===_0xb0c3('0xa9')||_0x20337c===_0xb0c3('0xaa')||_0x20337c===_0xb0c3('0xab')||_0x20337c===_0xb0c3('0xac')||_0x20337c==='EntityNameAttributeMetadata'||_0x20337c===_0xb0c3('0xad')||_0x20337c===_0xb0c3('0xae')){_0x1bbec8[_0xb0c3('0xa6')](getInputList(_0xf9c671,_0x182544,_0x20337c,_0x5a9801,_0x4a533d['MetadataId'],_0x5c0546[_0xb0c3('0x9a')],_0xe7a31d));}}});return Promise[_0xb0c3('0xa3')](_0x1bbec8);})[_0xb0c3('0xf')](function(_0x43cc7d){_0x3f1f9e=_0x43cc7d[0x0];var _0x168bbc=_0x33ee9b['concat'](_0x3f7a62)[_0xb0c3('0x86')](_0x3f1f9e);var _0x387875={'count':_0x168bbc[_0xb0c3('0x22')],'rows':_0x168bbc};return _0x387875;})['then'](respondWithResult(_0x33f21b,null))[_0xb0c3('0x33')](function(_0x3676ee){var _0x2b546d=_0x560b05[_0xb0c3('0x1c')][_0xb0c3('0xaf')]?0x1f4:_0x3676ee[_0xb0c3('0xb0')]||0x1f4;logger[_0xb0c3('0x12')](_0x3676ee[_0xb0c3('0xb1')]);delete _0x3676ee[_0xb0c3('0x13')];if(_0x2b546d===0x191){_0x2b546d=0x190;}_0x33f21b[_0xb0c3('0x7')](_0x2b546d)[_0xb0c3('0x14')](_0x560b05[_0xb0c3('0x1c')]['test']?{'message':_0xb0c3('0xb2'),'statusCode':_0x3676ee['statusCode']}:_0x3676ee);});};function getSelectList(_0x2b75af,_0x217c6e,_0x3a4060,_0x5b7721,_0x41ce02,_0x5b1bd9){var _0x203d47={'method':_0xb0c3('0x95'),'uri':_0x2b75af+_0xb0c3('0x9b')+_0x5b7721+_0xb0c3('0xb3')+_0x41ce02+_0xb0c3('0xb4')+_0xb0c3('0xb5'),'headers':{'Authorization':_0xb0c3('0x97')+_0x5b1bd9,'If-None-Match':null,'OData-Version':_0xb0c3('0x98')},'json':!![]};return rp(_0x203d47)['then'](function(_0x13fd22){var _0x31723a=[];var _0x221c7a=_0x13fd22['OptionSet']['Options'];_0x221c7a[_0xb0c3('0xa0')](function(_0x5720f3){_0x31723a[_0xb0c3('0xa6')]({'name':_0x5720f3['Label'][_0xb0c3('0xb6')][_0xb0c3('0xb7')],'value':String(_0x5720f3[_0xb0c3('0xb8')])});});var _0x8f105e={'id':_0x217c6e+'_'+_0x13fd22[_0xb0c3('0x9f')],'name':_0x13fd22[_0xb0c3('0xb9')][_0xb0c3('0xb6')][_0xb0c3('0xb7')],'custom':![],'options':_0x31723a};_0x3a4060[_0xb0c3('0xa6')](_0x8f105e);return _0x3a4060;});}function getBooleanList(_0xff759,_0x306fdf,_0x194742,_0x5190ae,_0x38024b,_0x36708f){var _0x2422d9={'method':_0xb0c3('0x95'),'uri':_0xff759+_0xb0c3('0x9b')+_0x5190ae+_0xb0c3('0xb3')+_0x38024b+_0xb0c3('0xba'),'headers':{'Authorization':_0xb0c3('0x97')+_0x36708f,'If-None-Match':null,'OData-Version':_0xb0c3('0x98')},'json':!![]};return rp(_0x2422d9)[_0xb0c3('0xf')](function(_0x49cd73){var _0x3747fd=[];_0x3747fd[_0xb0c3('0xa6')]({'name':_0x49cd73[_0xb0c3('0xbb')][_0xb0c3('0xbc')][_0xb0c3('0xb7')][_0xb0c3('0xb6')][_0xb0c3('0xb7')],'value':'true'},{'name':_0x49cd73[_0xb0c3('0xbb')][_0xb0c3('0xbd')][_0xb0c3('0xb7')][_0xb0c3('0xb6')][_0xb0c3('0xb7')],'value':_0xb0c3('0xbe')});var _0x382f68={'id':_0x306fdf+'_'+_0x49cd73[_0xb0c3('0x9f')],'name':_0x49cd73[_0xb0c3('0xb9')]['UserLocalizedLabel'][_0xb0c3('0xb7')],'custom':![],'options':_0x3747fd};_0x194742[_0xb0c3('0xa6')](_0x382f68);return _0x194742;});}function getInputList(_0x3b007f,_0x8ccc04,_0x205ff3,_0x586eaa,_0xf83cdb,_0x25684c,_0x2ad71d){var _0x50995d={'method':_0xb0c3('0x95'),'uri':_0x3b007f+'EntityDefinitions('+_0xf83cdb+')/Attributes('+_0x25684c+_0xb0c3('0xbf')+_0x205ff3+_0xb0c3('0xc0'),'headers':{'Authorization':_0xb0c3('0x97')+_0x2ad71d,'If-None-Match':null,'OData-Version':_0xb0c3('0x98')},'json':!![]};return rp(_0x50995d)[_0xb0c3('0xf')](function(_0x35538e){var _0x12b6e2={'id':_0x8ccc04+'_'+_0x35538e[_0xb0c3('0x9f')],'name':_0x35538e['DisplayName']['UserLocalizedLabel']?_0x35538e[_0xb0c3('0xb9')][_0xb0c3('0xb6')]['Label']:_0x35538e[_0xb0c3('0x9f')],'custom':![],'options':[]};_0x586eaa['push'](_0x12b6e2);return _0x586eaa;});} \ No newline at end of file +var _0x8469=['isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','test','statusCode','error','send','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','OptionSet','Label','UserLocalizedLabel','Value','DisplayName','TrueOption','true','FalseOption',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','util','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','sendStatus','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','options','Dynamics365Account','includeAll','include','findAll','rows','catch','show','find','create','body','params','getConfigurations','findOne','Dynamics365Configuration','pick','nolimit','addConfiguration','Descriptions','channel','Dynamics365Field','Subjects','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType','incident','Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','regardingobjectid','directioncode','accountidname','actualserviceunits','billedserviceunits','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridyominame','emailaddress','entityimage_url','escalatedon','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','onholdtime','owneridname','owneridtype','owneridyominame','primarycontactidname','prioritycodename','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','concat','password','remoteUri','tenantId','CloudProvider','data7','modernAuthentication','access_token','data5','POST','https://login.microsoftonline.com/','username','clientSecret','GET','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','@odata.type','PicklistAttributeMetadata','push','all','forEach'];(function(_0x41ecb2,_0x306e02){var _0x1137d9=function(_0x4be3ef){while(--_0x4be3ef){_0x41ecb2['push'](_0x41ecb2['shift']());}};_0x1137d9(++_0x306e02);}(_0x8469,0xd9));var _0x9846=function(_0x5cc3d4,_0xbcbf9b){_0x5cc3d4=_0x5cc3d4-0x0;var _0x17ca31=_0x8469[_0x5cc3d4];return _0x17ca31;};'use strict';var rp=require('request-promise');var util=require(_0x9846('0x0'));var _=require('lodash');var qs=require('../../components/parsers/qs');var logger=require(_0x9846('0x1'))(_0x9846('0x2'));var db=require(_0x9846('0x3'))['db'];var integrations=require(_0x9846('0x4'));function respondWithResult(_0x3f24c0,_0x207aee){_0x207aee=_0x207aee||0xc8;return function(_0x5c19a9){if(_0x5c19a9){return _0x3f24c0[_0x9846('0x5')](_0x207aee)[_0x9846('0x6')](_0x5c19a9);}};}function respondWithFilteredResult(_0x5c4557,_0x20e5ed){return function(_0x169952){if(_0x169952){var _0x4537c4=typeof _0x20e5ed[_0x9846('0x7')]===_0x9846('0x8')&&typeof _0x20e5ed[_0x9846('0x9')]==='undefined';var _0x34f4c0=_0x169952[_0x9846('0xa')];var _0x198896=_0x4537c4?0x0:_0x20e5ed[_0x9846('0x7')];var _0x199d52=_0x4537c4?_0x169952[_0x9846('0xa')]:_0x20e5ed[_0x9846('0x7')]+_0x20e5ed[_0x9846('0x9')];var _0x5a82ba;if(_0x199d52>=_0x34f4c0){_0x199d52=_0x34f4c0;_0x5a82ba=0xc8;}else{_0x5a82ba=0xce;}_0x5c4557[_0x9846('0x5')](_0x5a82ba);return _0x5c4557[_0x9846('0xb')](_0x9846('0xc'),_0x198896+'-'+_0x199d52+'/'+_0x34f4c0)[_0x9846('0x6')](_0x169952);}return null;};}function saveUpdates(_0x52357f){return function(_0xb8ed52){if(_0xb8ed52){return _0xb8ed52[_0x9846('0xd')](_0x52357f)[_0x9846('0xe')](function(_0x5db492){return _0x5db492;});}return null;};}function removeEntity(_0x15c359){return function(_0xb20a5){if(_0xb20a5){return _0xb20a5[_0x9846('0xf')]()['then'](function(){_0x15c359[_0x9846('0x5')](0xcc)[_0x9846('0x10')]();});}};}function handleEntityNotFound(_0x24a906){return function(_0x592707){if(!_0x592707){_0x24a906[_0x9846('0x11')](0x194);}return _0x592707;};}function handleError(_0xd12a3f,_0x2c5dc2){_0x2c5dc2=_0x2c5dc2||0x1f4;return function(_0x5b14be){logger['error'](_0x5b14be[_0x9846('0x12')]);if(_0x5b14be[_0x9846('0x13')]){delete _0x5b14be['name'];}_0xd12a3f['status'](_0x2c5dc2)['send'](_0x5b14be);};}exports[_0x9846('0x14')]=function(_0x2b77da,_0x5a24c8){var _0x3e8e67={},_0x3ff596={},_0x21ca49={'count':0x0,'rows':[]};var _0x2e71a7=_[_0x9846('0x15')](db['Dynamics365Account'][_0x9846('0x16')],function(_0x222e64){return{'name':_0x222e64[_0x9846('0x17')],'type':_0x222e64[_0x9846('0x18')][_0x9846('0x19')]};});_0x3ff596[_0x9846('0x1a')]=_[_0x9846('0x15')](_0x2e71a7,_0x9846('0x13'));_0x3ff596[_0x9846('0x1b')]=_[_0x9846('0x1c')](_0x2b77da[_0x9846('0x1b')]);_0x3ff596['filters']=_[_0x9846('0x1d')](_0x3ff596[_0x9846('0x1a')],_0x3ff596[_0x9846('0x1b')]);_0x3e8e67[_0x9846('0x1e')]=_['intersection'](_0x3ff596[_0x9846('0x1a')],qs[_0x9846('0x1f')](_0x2b77da[_0x9846('0x1b')]['fields']));_0x3e8e67[_0x9846('0x1e')]=_0x3e8e67[_0x9846('0x1e')][_0x9846('0x20')]?_0x3e8e67[_0x9846('0x1e')]:_0x3ff596[_0x9846('0x1a')];if(!_0x2b77da[_0x9846('0x1b')][_0x9846('0x21')]('nolimit')){_0x3e8e67[_0x9846('0x9')]=qs[_0x9846('0x9')](_0x2b77da[_0x9846('0x1b')][_0x9846('0x9')]);_0x3e8e67[_0x9846('0x7')]=qs['offset'](_0x2b77da[_0x9846('0x1b')][_0x9846('0x7')]);}_0x3e8e67[_0x9846('0x22')]=qs[_0x9846('0x23')](_0x2b77da[_0x9846('0x1b')]['sort']);_0x3e8e67[_0x9846('0x24')]=qs['filters'](_['pick'](_0x2b77da[_0x9846('0x1b')],_0x3ff596[_0x9846('0x25')]),_0x2e71a7);if(_0x2b77da[_0x9846('0x1b')][_0x9846('0x26')]){_0x3e8e67['where']=_[_0x9846('0x27')](_0x3e8e67[_0x9846('0x24')],{'$or':_[_0x9846('0x15')](_0x2e71a7,function(_0x1735a8){if(_0x1735a8[_0x9846('0x18')]!=='VIRTUAL'){var _0x352985={};_0x352985[_0x1735a8['name']]={'$like':'%'+_0x2b77da[_0x9846('0x1b')][_0x9846('0x26')]+'%'};return _0x352985;}})});}_0x3e8e67=_['merge']({},_0x3e8e67,_0x2b77da[_0x9846('0x28')]);var _0x5959a4={'where':_0x3e8e67[_0x9846('0x24')]};return db[_0x9846('0x29')][_0x9846('0xa')](_0x5959a4)[_0x9846('0xe')](function(_0x530a73){_0x21ca49['count']=_0x530a73;if(_0x2b77da[_0x9846('0x1b')][_0x9846('0x2a')]){_0x3e8e67[_0x9846('0x2b')]=[{'all':!![]}];}return db[_0x9846('0x29')][_0x9846('0x2c')](_0x3e8e67);})['then'](function(_0x19a719){_0x21ca49[_0x9846('0x2d')]=_0x19a719;return _0x21ca49;})[_0x9846('0xe')](respondWithFilteredResult(_0x5a24c8,_0x3e8e67))[_0x9846('0x2e')](handleError(_0x5a24c8,null));};exports[_0x9846('0x2f')]=function(_0x549233,_0x53f0a7){var _0x20e011={'raw':![],'where':{'id':_0x549233['params']['id']}},_0x5d21b4={};_0x5d21b4[_0x9846('0x1a')]=_[_0x9846('0x1c')](db[_0x9846('0x29')][_0x9846('0x16')]);_0x5d21b4[_0x9846('0x1b')]=_[_0x9846('0x1c')](_0x549233['query']);_0x5d21b4[_0x9846('0x25')]=_[_0x9846('0x1d')](_0x5d21b4['model'],_0x5d21b4[_0x9846('0x1b')]);_0x20e011[_0x9846('0x1e')]=_['intersection'](_0x5d21b4[_0x9846('0x1a')],qs[_0x9846('0x1f')](_0x549233[_0x9846('0x1b')][_0x9846('0x1f')]));_0x20e011['attributes']=_0x20e011[_0x9846('0x1e')][_0x9846('0x20')]?_0x20e011[_0x9846('0x1e')]:_0x5d21b4[_0x9846('0x1a')];if(_0x549233['query'][_0x9846('0x2a')]){_0x20e011['include']=[{'all':!![]}];}_0x20e011=_[_0x9846('0x27')]({},_0x20e011,_0x549233[_0x9846('0x28')]);return db[_0x9846('0x29')][_0x9846('0x30')](_0x20e011)[_0x9846('0xe')](handleEntityNotFound(_0x53f0a7,null))[_0x9846('0xe')](respondWithResult(_0x53f0a7,null))['catch'](handleError(_0x53f0a7,null));};exports['create']=function(_0x4e359d,_0x488d5d){return db['Dynamics365Account'][_0x9846('0x31')](_0x4e359d[_0x9846('0x32')],{})[_0x9846('0xe')](respondWithResult(_0x488d5d,0xc9))[_0x9846('0x2e')](handleError(_0x488d5d,null));};exports[_0x9846('0xd')]=function(_0x371757,_0x23d121){if(_0x371757[_0x9846('0x32')]['id']){delete _0x371757[_0x9846('0x32')]['id'];}return db[_0x9846('0x29')][_0x9846('0x30')]({'where':{'id':_0x371757[_0x9846('0x33')]['id']}})[_0x9846('0xe')](handleEntityNotFound(_0x23d121,null))[_0x9846('0xe')](saveUpdates(_0x371757[_0x9846('0x32')],null))[_0x9846('0xe')](respondWithResult(_0x23d121,null))[_0x9846('0x2e')](handleError(_0x23d121,null));};exports['destroy']=function(_0x2d13bd,_0x9f61ed){return db['Dynamics365Account'][_0x9846('0x30')]({'where':{'id':_0x2d13bd[_0x9846('0x33')]['id']}})['then'](handleEntityNotFound(_0x9f61ed,null))[_0x9846('0xe')](removeEntity(_0x9f61ed,null))[_0x9846('0x2e')](handleError(_0x9f61ed,null));};exports[_0x9846('0x34')]=function(_0x16e4b1,_0x322b7b){var _0x3344b6={};var _0x58eafd={};var _0x132f37;var _0x1c5c95;return db[_0x9846('0x29')][_0x9846('0x35')]({'where':{'id':_0x16e4b1[_0x9846('0x33')]['id']}})['then'](handleEntityNotFound(_0x322b7b,null))[_0x9846('0xe')](function(_0x2bc565){if(_0x2bc565){_0x132f37=_0x2bc565;_0x58eafd[_0x9846('0x1a')]=_[_0x9846('0x1c')](db[_0x9846('0x36')]['rawAttributes']);_0x58eafd[_0x9846('0x1b')]=_[_0x9846('0x1c')](_0x16e4b1['query']);_0x58eafd[_0x9846('0x25')]=_[_0x9846('0x1d')](_0x58eafd[_0x9846('0x1a')],_0x58eafd['query']);_0x3344b6[_0x9846('0x1e')]=_['intersection'](_0x58eafd['model'],qs[_0x9846('0x1f')](_0x16e4b1[_0x9846('0x1b')][_0x9846('0x1f')]));_0x3344b6[_0x9846('0x1e')]=_0x3344b6[_0x9846('0x1e')]['length']?_0x3344b6[_0x9846('0x1e')]:_0x58eafd[_0x9846('0x1a')];_0x3344b6['order']=qs['sort'](_0x16e4b1[_0x9846('0x1b')][_0x9846('0x23')]);_0x3344b6['where']=qs[_0x9846('0x25')](_[_0x9846('0x37')](_0x16e4b1[_0x9846('0x1b')],_0x58eafd['filters']));if(_0x16e4b1[_0x9846('0x1b')][_0x9846('0x26')]){_0x3344b6[_0x9846('0x24')]=_[_0x9846('0x27')](_0x3344b6['where'],{'$or':_[_0x9846('0x15')](_0x3344b6[_0x9846('0x1e')],function(_0x19e801){var _0x5f361c={};_0x5f361c[_0x19e801]={'$like':'%'+_0x16e4b1['query'][_0x9846('0x26')]+'%'};return _0x5f361c;})});}_0x3344b6=_['merge']({},_0x3344b6,_0x16e4b1[_0x9846('0x28')]);return _0x132f37[_0x9846('0x34')](_0x3344b6);}})['then'](function(_0x1a259b){if(_0x1a259b){_0x1c5c95=_0x1a259b[_0x9846('0x20')];if(!_0x16e4b1[_0x9846('0x1b')][_0x9846('0x21')](_0x9846('0x38'))){_0x3344b6[_0x9846('0x9')]=qs[_0x9846('0x9')](_0x16e4b1[_0x9846('0x1b')][_0x9846('0x9')]);_0x3344b6['offset']=qs['offset'](_0x16e4b1[_0x9846('0x1b')][_0x9846('0x7')]);}return _0x132f37[_0x9846('0x34')](_0x3344b6);}})[_0x9846('0xe')](function(_0x2f46c7){if(_0x2f46c7){return _0x2f46c7?{'count':_0x1c5c95,'rows':_0x2f46c7}:null;}})[_0x9846('0xe')](respondWithResult(_0x322b7b,null))[_0x9846('0x2e')](handleError(_0x322b7b,null));};exports[_0x9846('0x39')]=function(_0x316221,_0x48806b){if(_0x316221[_0x9846('0x32')]['id']){delete _0x316221['body']['id'];}return db['Dynamics365Account']['findOne']({'where':{'id':_0x316221[_0x9846('0x33')]['id']}})[_0x9846('0xe')](handleEntityNotFound(_0x48806b,null))[_0x9846('0xe')](function(_0x396406){if(_0x396406){_0x316221['body']['AccountId']=_0x396406['id'];_0x316221[_0x9846('0x32')]['Subjects']=integrations['getSubjects'](_0x316221['body']['channel'],_0x316221['body'][_0x9846('0x18')]);_0x316221[_0x9846('0x32')][_0x9846('0x3a')]=integrations['getDescriptions'](_0x316221[_0x9846('0x32')][_0x9846('0x3b')],_0x316221['body'][_0x9846('0x18')]);return db[_0x9846('0x36')][_0x9846('0x31')](_0x316221[_0x9846('0x32')],{'include':[{'model':db[_0x9846('0x3c')],'as':_0x9846('0x3d')},{'model':db['Dynamics365Field'],'as':_0x9846('0x3a')}]});}return null;})[_0x9846('0xe')](respondWithResult(_0x48806b,null))[_0x9846('0x2e')](handleError(_0x48806b,null));};function sanitizeRemoteUri(_0x4ca8b3){var _0x2e6c26=_0x4ca8b3[_0x9846('0x3e')](-0x1);if(_0x2e6c26==='/')return _0x4ca8b3[_0x9846('0x3f')](0x0,_0x4ca8b3[_0x9846('0x40')](_0x2e6c26));return _0x4ca8b3;}function getWebApiUrl(_0x2c7956){return util[_0x9846('0x41')](_0x9846('0x42'),_0x2c7956);}exports[_0x9846('0x43')]=function(_0x9d6497,_0x363330){var _0xf26ee2=_0x9d6497['query'][_0x9846('0x44')];var _0x3ffef8=_0xf26ee2===_0x9846('0x45')?_0x9846('0x46'):_0x9846('0x47');var _0x275441='';var _0x3dcc62='';var _0x43688a='';var _0x22cb2a='';var _0x563666='';var _0x5656e8='';var _0x1b0d72='';var _0x257ad0='';var _0x569f73=[_0x9846('0x48'),_0x9846('0x49'),_0x9846('0x4a'),_0x9846('0x4b'),_0x9846('0x4c'),_0x9846('0x4d'),'phonenumber',_0x9846('0x4e'),_0x9846('0x4f'),'phonecall_activity_parties'];var _0x1a2545=[_0x9846('0x50'),'accountidyominame',_0x9846('0x51'),_0x9846('0x52'),'contactidname',_0x9846('0x53'),_0x9846('0x54'),_0x9846('0x55'),_0x9846('0x56'),_0x9846('0x57'),_0x9846('0x58'),_0x9846('0x59'),_0x9846('0x5a'),_0x9846('0x5b'),_0x9846('0x5c'),_0x9846('0x5d'),'customeridtype',_0x9846('0x5e'),_0x9846('0x5f'),'entitlementidname','entityimage_timestamp',_0x9846('0x60'),_0x9846('0x61'),'exchangerate',_0x9846('0x62'),_0x9846('0x63'),_0x9846('0x64'),_0x9846('0x65'),_0x9846('0x66'),_0x9846('0x67'),_0x9846('0x68'),_0x9846('0x69'),_0x9846('0x6a'),_0x9846('0x6b'),_0x9846('0x6c'),_0x9846('0x6d'),_0x9846('0x6e'),'modifiedonbehalfbyyominame',_0x9846('0x6f'),'msdyn_iotalertname','numberofchildincidents',_0x9846('0x70'),'overriddencreatedon',_0x9846('0x71'),_0x9846('0x72'),_0x9846('0x73'),'parentcaseidname',_0x9846('0x74'),'primarycontactidyominame',_0x9846('0x75'),'productidname',_0x9846('0x76'),_0x9846('0x77'),_0x9846('0x78'),_0x9846('0x79'),_0x9846('0x7a'),_0x9846('0x7b'),_0x9846('0x7c'),_0x9846('0x7d'),_0x9846('0x7e'),_0x9846('0x7f'),'statecode','statuscode',_0x9846('0x80'),_0x9846('0x81'),_0x9846('0x82'),_0x9846('0x83'),_0x9846('0x84'),_0x9846('0x85'),'versionnumber'];var _0xd4b70f=_0x569f73[_0x9846('0x86')](_0x1a2545);return db[_0x9846('0x29')][_0x9846('0x35')]({'where':{'id':_0x9d6497[_0x9846('0x33')]['id']},'attributes':['id','username',_0x9846('0x87'),_0x9846('0x88'),_0x9846('0x89'),'clientId','clientSecret','modernAuthentication'],'include':[{'model':db[_0x9846('0x8a')],'as':_0x9846('0x8a'),'attributes':['id','data5',_0x9846('0x8b')]}]})[_0x9846('0xe')](handleEntityNotFound(_0x363330,null))[_0x9846('0xe')](function(_0x43ac3c){if(_0x43ac3c){if(_0x43ac3c[_0x9846('0x8c')]){_0x43ac3c[_0x9846('0x8d')]=_0x43ac3c[_0x9846('0x8a')][_0x9846('0x8e')];_0x257ad0=sanitizeRemoteUri(_0x43ac3c[_0x9846('0x8a')][_0x9846('0x8b')]);_0x1b0d72=getWebApiUrl(_0x257ad0);return _0x43ac3c;}_0x257ad0=sanitizeRemoteUri(_0x43ac3c[_0x9846('0x88')]);_0x1b0d72=getWebApiUrl(_0x257ad0);var _0x110c65={'method':_0x9846('0x8f'),'uri':_0x9846('0x90')+_0x43ac3c[_0x9846('0x89')]+'/oauth2/token','form':{'client_id':_0x43ac3c['clientId'],'resource':_0x257ad0,'username':_0x43ac3c[_0x9846('0x91')],'password':_0x43ac3c['password'],'grant_type':_0x9846('0x87'),'client_secret':_0x43ac3c[_0x9846('0x92')]},'json':!![]};return rp(_0x110c65);}})[_0x9846('0xe')](function(_0x42973f){_0x5656e8=_0x42973f[_0x9846('0x8d')];var _0x1d56a0={'method':_0x9846('0x93'),'uri':encodeURI(_0x1b0d72+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x3ffef8+'\x27'),'headers':{'Authorization':_0x9846('0x94')+_0x5656e8,'If-None-Match':null,'OData-Version':_0x9846('0x95')},'json':!![]};return rp(_0x1d56a0);})['then'](function(_0x2c6ff7){var _0x5b5ff1=_0x2c6ff7[_0x9846('0x96')][0x0];var _0x4c356a=_0x5b5ff1[_0x9846('0x97')];var _0x5e73df={'method':_0x9846('0x93'),'uri':_0x1b0d72+_0x9846('0x98')+_0x4c356a+_0x9846('0x99'),'headers':{'Authorization':_0x9846('0x94')+_0x5656e8,'If-None-Match':null,'OData-Version':_0x9846('0x95')},'json':!![]};return rp(_0x5e73df);})[_0x9846('0xe')](function(_0x20772){_0x275441=_0x20772;_0x3dcc62=_0x275441[_0x9846('0x9a')];_0x3dcc62=_[_0x9846('0x9b')](_0x3dcc62,function(_0x1a7367){return!_0xd4b70f[_0x9846('0x9c')](_0x1a7367[_0x9846('0x9d')]);});var _0x2159cc=[];var _0x18cfd0=[];_0x3dcc62['forEach'](function(_0x2ade47){if(_0x2ade47['@odata.type']){var _0x2ec12f=_0x2ade47[_0x9846('0x9e')][_0x9846('0x3f')](_0x2ade47[_0x9846('0x9e')][_0x9846('0x40')]('.')+0x1);if(_0x2ec12f===_0x9846('0x9f')){_0x2159cc[_0x9846('0xa0')](getSelectList(_0x1b0d72,_0xf26ee2,_0x18cfd0,_0x275441[_0x9846('0x97')],_0x2ade47[_0x9846('0x97')],_0x5656e8));}}});return Promise[_0x9846('0xa1')](_0x2159cc);})['then'](function(_0xfe1bde){_0x43688a=_0xfe1bde[0x0];var _0x4a914d=[];var _0x5cb05f=[];_0x3dcc62[_0x9846('0xa2')](function(_0x1f8979){if(!_[_0x9846('0xa3')](_0x1f8979[_0x9846('0x9e')])){var _0x48356f=_0x1f8979[_0x9846('0x9e')][_0x9846('0x3f')](_0x1f8979[_0x9846('0x9e')][_0x9846('0x40')]('.')+0x1);if(_0x48356f===_0x9846('0xa4')){_0x4a914d[_0x9846('0xa0')](getBooleanList(_0x1b0d72,_0xf26ee2,_0x5cb05f,_0x275441['MetadataId'],_0x1f8979[_0x9846('0x97')],_0x5656e8));}}});return Promise['all'](_0x4a914d);})[_0x9846('0xe')](function(_0x528aea){_0x22cb2a=_0x528aea[0x0];var _0x1a32b4=[];var _0x5a054b=[];_0x3dcc62['forEach'](function(_0x594cc2){if(_0x594cc2[_0x9846('0x9e')]){var _0x2ac255=_0x594cc2[_0x9846('0x9e')][_0x9846('0x3f')](_0x594cc2['@odata.type'][_0x9846('0x40')]('.')+0x1);if(_0x2ac255===_0x9846('0xa5')||_0x2ac255===_0x9846('0xa6')||_0x2ac255===_0x9846('0xa7')||_0x2ac255===_0x9846('0xa8')||_0x2ac255===_0x9846('0xa9')||_0x2ac255===_0x9846('0xaa')||_0x2ac255===_0x9846('0xab')||_0x2ac255==='EntityNameAttributeMetadata'||_0x2ac255===_0x9846('0xac')||_0x2ac255==='DecimalAttributeMetadata'){_0x1a32b4['push'](getInputList(_0x1b0d72,_0xf26ee2,_0x2ac255,_0x5a054b,_0x275441[_0x9846('0x97')],_0x594cc2['MetadataId'],_0x5656e8));}}});return Promise[_0x9846('0xa1')](_0x1a32b4);})[_0x9846('0xe')](function(_0x33e958){_0x563666=_0x33e958[0x0];var _0x2dbae9=_0x43688a[_0x9846('0x86')](_0x22cb2a)[_0x9846('0x86')](_0x563666);var _0x1ab9d4={'count':_0x2dbae9[_0x9846('0x20')],'rows':_0x2dbae9};return _0x1ab9d4;})[_0x9846('0xe')](respondWithResult(_0x363330,null))[_0x9846('0x2e')](function(_0x573d98){var _0x1e0a70=_0x9d6497['query'][_0x9846('0xad')]?0x1f4:_0x573d98[_0x9846('0xae')]||0x1f4;logger[_0x9846('0xaf')](_0x573d98['stack']);delete _0x573d98['name'];if(_0x1e0a70===0x191){_0x1e0a70=0x190;}_0x363330[_0x9846('0x5')](_0x1e0a70)[_0x9846('0xb0')](_0x9d6497[_0x9846('0x1b')][_0x9846('0xad')]?{'message':_0x9846('0xb1'),'statusCode':_0x573d98['statusCode']}:_0x573d98);});};function getSelectList(_0x2e8e17,_0x170c1c,_0x5b1711,_0x32ea4a,_0x15c672,_0x23d38e){var _0x2e984d={'method':_0x9846('0x93'),'uri':_0x2e8e17+_0x9846('0x98')+_0x32ea4a+_0x9846('0xb2')+_0x15c672+_0x9846('0xb3')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':'Bearer\x20'+_0x23d38e,'If-None-Match':null,'OData-Version':_0x9846('0x95')},'json':!![]};return rp(_0x2e984d)[_0x9846('0xe')](function(_0x340439){var _0x1e86dd=[];var _0x1848e2=_0x340439[_0x9846('0xb4')]['Options'];_0x1848e2[_0x9846('0xa2')](function(_0xaf4bf){_0x1e86dd[_0x9846('0xa0')]({'name':_0xaf4bf[_0x9846('0xb5')][_0x9846('0xb6')][_0x9846('0xb5')],'value':String(_0xaf4bf[_0x9846('0xb7')])});});var _0x2a72db={'id':_0x170c1c+'_'+_0x340439[_0x9846('0x9d')],'name':_0x340439[_0x9846('0xb8')]['UserLocalizedLabel'][_0x9846('0xb5')],'custom':![],'options':_0x1e86dd};_0x5b1711['push'](_0x2a72db);return _0x5b1711;});}function getBooleanList(_0x1304e4,_0xbb3628,_0x3031c2,_0x4e9a47,_0x2ed4eb,_0x34a2f3){var _0x3bfb14={'method':'GET','uri':_0x1304e4+_0x9846('0x98')+_0x4e9a47+_0x9846('0xb2')+_0x2ed4eb+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0x9846('0x94')+_0x34a2f3,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3bfb14)[_0x9846('0xe')](function(_0x3ae59f){var _0x42f015=[];_0x42f015[_0x9846('0xa0')]({'name':_0x3ae59f[_0x9846('0xb4')][_0x9846('0xb9')][_0x9846('0xb5')][_0x9846('0xb6')][_0x9846('0xb5')],'value':_0x9846('0xba')},{'name':_0x3ae59f[_0x9846('0xb4')][_0x9846('0xbb')][_0x9846('0xb5')][_0x9846('0xb6')][_0x9846('0xb5')],'value':'false'});var _0x1fecb0={'id':_0xbb3628+'_'+_0x3ae59f['LogicalName'],'name':_0x3ae59f['DisplayName']['UserLocalizedLabel'][_0x9846('0xb5')],'custom':![],'options':_0x42f015};_0x3031c2[_0x9846('0xa0')](_0x1fecb0);return _0x3031c2;});}function getInputList(_0x24773b,_0x5c3431,_0xeccf8d,_0x284982,_0x99a60,_0x2eb7a6,_0x151ec3){var _0x5743f8={'method':_0x9846('0x93'),'uri':_0x24773b+_0x9846('0x98')+_0x99a60+_0x9846('0xb2')+_0x2eb7a6+_0x9846('0xbc')+_0xeccf8d+_0x9846('0xbd'),'headers':{'Authorization':'Bearer\x20'+_0x151ec3,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5743f8)['then'](function(_0x507dc5){var _0x100179={'id':_0x5c3431+'_'+_0x507dc5[_0x9846('0x9d')],'name':_0x507dc5['DisplayName'][_0x9846('0xb6')]?_0x507dc5[_0x9846('0xb8')]['UserLocalizedLabel'][_0x9846('0xb5')]:_0x507dc5[_0x9846('0x9d')],'custom':![],'options':[]};_0x284982[_0x9846('0xa0')](_0x100179);return _0x284982;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index cfc712d..1496e25 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.model.js +++ b/server/api/intDynamics365Account/intDynamics365Account.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','util'];(function(_0x4aa7bd,_0x477ceb){var _0x5a4ff9=function(_0x391590){while(--_0x391590){_0x4aa7bd['push'](_0x4aa7bd['shift']());}};_0x5a4ff9(++_0x477ceb);}(_0xe706,0xa3));var _0x6e70=function(_0x175a55,_0x4082fd){_0x175a55=_0x175a55-0x0;var _0x167adf=_0xe706[_0x175a55];return _0x167adf;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));var integrations=require(_0x6e70('0xa'));module[_0x6e70('0xb')]=function(_0x4381d1,_0x36357b){return _0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'),attributes,{'tableName':_0x6e70('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['exports','Dynamics365Account','int_dynamics365_accounts','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xfd3ac5,_0x421540){var _0xe932fc=function(_0x5220f9){while(--_0x5220f9){_0xfd3ac5['push'](_0xfd3ac5['shift']());}};_0xe932fc(++_0x421540);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./intDynamics365Account.attributes');var integrations=require('../../components/integrations/configuration');module[_0x0d8b('0x7')]=function(_0x227c63,_0x39f43a){return _0x227c63['define'](_0x0d8b('0x8'),attributes,{'tableName':_0x0d8b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 781bfa8..ea9a838 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 _0xe95d=['where','attributes','include','map','model','ShowDynamics365Account','find','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Dynamics365Account,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','options'];(function(_0x34bc94,_0x74f0fd){var _0xee41e7=function(_0x424111){while(--_0x424111){_0x34bc94['push'](_0x34bc94['shift']());}};_0xee41e7(++_0x74f0fd);}(_0xe95d,0xee));var _0xde95=function(_0x22bdd3,_0x552e50){_0x22bdd3=_0x22bdd3-0x0;var _0x44d9d9=_0xe95d[_0x22bdd3];return _0x44d9d9;};'use strict';var _=require(_0xde95('0x0'));var util=require('util');var moment=require(_0xde95('0x1'));var BPromise=require('bluebird');var rs=require(_0xde95('0x2'));var fs=require('fs');var Redis=require(_0xde95('0x3'));var db=require(_0xde95('0x4'))['db'];var utils=require(_0xde95('0x5'));var logger=require(_0xde95('0x6'))(_0xde95('0x7'));var config=require(_0xde95('0x8'));var jayson=require(_0xde95('0x9'));var client=jayson[_0xde95('0xa')][_0xde95('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x38b7e3,_0x44f228,_0x5b7799){return new BPromise(function(_0x335aa7,_0x28c740){return client['request'](_0x38b7e3,_0x5b7799)[_0xde95('0xc')](function(_0x3a63fc){logger[_0xde95('0xd')](_0xde95('0xe'),_0x44f228,'request\x20sent');logger[_0xde95('0xf')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x44f228,_0xde95('0x10'),JSON[_0xde95('0x11')](_0x3a63fc));if(_0x3a63fc['error']){if(_0x3a63fc[_0xde95('0x12')][_0xde95('0x13')]===0x1f4){logger[_0xde95('0x12')](_0xde95('0xe'),_0x44f228,_0x3a63fc['error'][_0xde95('0x14')]);return _0x28c740(_0x3a63fc['error'][_0xde95('0x14')]);}logger[_0xde95('0x12')](_0xde95('0xe'),_0x44f228,_0x3a63fc[_0xde95('0x12')][_0xde95('0x14')]);return _0x335aa7(_0x3a63fc[_0xde95('0x12')][_0xde95('0x14')]);}else{logger['info'](_0xde95('0xe'),_0x44f228,_0xde95('0x10'));_0x335aa7(_0x3a63fc[_0xde95('0x15')]['message']);}})[_0xde95('0x16')](function(_0x46c08e){logger[_0xde95('0x12')](_0xde95('0xe'),_0x44f228,_0x46c08e);_0x28c740(_0x46c08e);});});}exports[_0xde95('0x17')]=function(_0x79bfa1){var _0x123dfc=this;return new Promise(function(_0x2f3067,_0x4e4528){return db[_0xde95('0x18')]['findAll']({'raw':_0x79bfa1[_0xde95('0x19')]?_0x79bfa1[_0xde95('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x79bfa1[_0xde95('0x19')]?_0x79bfa1['options'][_0xde95('0x1a')]||null:null,'attributes':_0x79bfa1['options']?_0x79bfa1[_0xde95('0x19')][_0xde95('0x1b')]||null:null,'limit':_0x79bfa1[_0xde95('0x19')]?_0x79bfa1[_0xde95('0x19')]['limit']||null:null,'include':_0x79bfa1['options']?_0x79bfa1[_0xde95('0x19')][_0xde95('0x1c')]?_[_0xde95('0x1d')](_0x79bfa1[_0xde95('0x19')][_0xde95('0x1c')],function(_0x169535){return{'model':db[_0x169535[_0xde95('0x1e')]],'as':_0x169535['as'],'attributes':_0x169535[_0xde95('0x1b')],'include':_0x169535[_0xde95('0x1c')]?_[_0xde95('0x1d')](_0x169535[_0xde95('0x1c')],function(_0x6cb58a){return{'model':db[_0x6cb58a[_0xde95('0x1e')]],'as':_0x6cb58a['as'],'attributes':_0x6cb58a['attributes'],'include':_0x6cb58a['include']?_[_0xde95('0x1d')](_0x6cb58a[_0xde95('0x1c')],function(_0x273dd7){return{'model':db[_0x273dd7[_0xde95('0x1e')]],'as':_0x273dd7['as'],'attributes':_0x273dd7[_0xde95('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xde95('0xc')](function(_0x43c08e){logger[_0xde95('0xd')](_0xde95('0x17'),_0x79bfa1);logger[_0xde95('0xf')](_0xde95('0x17'),_0x79bfa1,JSON[_0xde95('0x11')](_0x43c08e));_0x2f3067(_0x43c08e);})[_0xde95('0x16')](function(_0x59d135){logger['error']('GetDynamics365Account',_0x59d135['message'],_0x79bfa1);_0x4e4528(_0x123dfc[_0xde95('0x12')](0x1f4,_0x59d135[_0xde95('0x14')]));});});};exports[_0xde95('0x1f')]=function(_0x338e0e){var _0x2a6411=this;return new Promise(function(_0xf0e0e1,_0x2c18dc){return db['Dynamics365Account'][_0xde95('0x20')]({'raw':_0x338e0e['options']?_0x338e0e['options']['raw']===undefined?!![]:![]:!![],'where':_0x338e0e[_0xde95('0x19')]?_0x338e0e[_0xde95('0x19')]['where']||null:null,'attributes':_0x338e0e[_0xde95('0x19')]?_0x338e0e[_0xde95('0x19')][_0xde95('0x1b')]||null:null,'include':_0x338e0e[_0xde95('0x19')]?_0x338e0e['options'][_0xde95('0x1c')]?_[_0xde95('0x1d')](_0x338e0e['options']['include'],function(_0x801eda){return{'model':db[_0x801eda['model']],'as':_0x801eda['as'],'attributes':_0x801eda[_0xde95('0x1b')],'include':_0x801eda[_0xde95('0x1c')]?_[_0xde95('0x1d')](_0x801eda['include'],function(_0x113ff9){return{'model':db[_0x113ff9['model']],'as':_0x113ff9['as'],'attributes':_0x113ff9[_0xde95('0x1b')],'include':_0x113ff9[_0xde95('0x1c')]?_[_0xde95('0x1d')](_0x113ff9[_0xde95('0x1c')],function(_0x42c917){return{'model':db[_0x42c917['model']],'as':_0x42c917['as'],'attributes':_0x42c917[_0xde95('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xde95('0xc')](function(_0x4a6018){logger[_0xde95('0xd')]('ShowDynamics365Account',_0x338e0e);logger[_0xde95('0xf')]('ShowDynamics365Account',_0x338e0e,JSON[_0xde95('0x11')](_0x4a6018));_0xf0e0e1(_0x4a6018);})[_0xde95('0x16')](function(_0x28a081){logger[_0xde95('0x12')]('ShowDynamics365Account',_0x28a081[_0xde95('0x14')],_0x338e0e);_0x2c18dc(_0x2a6411[_0xde95('0x12')](0x1f4,_0x28a081[_0xde95('0x14')]));});});}; \ No newline at end of file +var _0xafd0=['map','model','attributes','GetDynamics365Account','Dynamics365Account','find','ShowDynamics365Account','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','catch','findAll','options','raw','where','limit','include'];(function(_0x425b1b,_0x2e7b10){var _0x5c12d1=function(_0xa9f6ff){while(--_0xa9f6ff){_0x425b1b['push'](_0x425b1b['shift']());}};_0x5c12d1(++_0x2e7b10);}(_0xafd0,0xb1));var _0x0afd=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xafd0[_0x255d5b];return _0x3e141a;};'use strict';var _=require(_0x0afd('0x0'));var util=require('util');var moment=require(_0x0afd('0x1'));var BPromise=require('bluebird');var rs=require(_0x0afd('0x2'));var fs=require('fs');var Redis=require(_0x0afd('0x3'));var db=require(_0x0afd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0afd('0x5'))(_0x0afd('0x6'));var config=require(_0x0afd('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0afd('0x8')][_0x0afd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x796cb0,_0x512fa2,_0x3384f7){return new BPromise(function(_0x3b0ac2,_0x4cfffa){return client[_0x0afd('0xa')](_0x796cb0,_0x3384f7)[_0x0afd('0xb')](function(_0x4522de){logger[_0x0afd('0xc')](_0x0afd('0xd'),_0x512fa2,'request\x20sent');logger[_0x0afd('0xe')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x512fa2,'request\x20sent',JSON['stringify'](_0x4522de));if(_0x4522de[_0x0afd('0xf')]){if(_0x4522de['error'][_0x0afd('0x10')]===0x1f4){logger[_0x0afd('0xf')](_0x0afd('0xd'),_0x512fa2,_0x4522de[_0x0afd('0xf')][_0x0afd('0x11')]);return _0x4cfffa(_0x4522de[_0x0afd('0xf')][_0x0afd('0x11')]);}logger['error'](_0x0afd('0xd'),_0x512fa2,_0x4522de[_0x0afd('0xf')][_0x0afd('0x11')]);return _0x3b0ac2(_0x4522de[_0x0afd('0xf')]['message']);}else{logger[_0x0afd('0xc')](_0x0afd('0xd'),_0x512fa2,_0x0afd('0x12'));_0x3b0ac2(_0x4522de[_0x0afd('0x13')][_0x0afd('0x11')]);}})[_0x0afd('0x14')](function(_0x3c5d6b){logger[_0x0afd('0xf')](_0x0afd('0xd'),_0x512fa2,_0x3c5d6b);_0x4cfffa(_0x3c5d6b);});});}exports['GetDynamics365Account']=function(_0x100567){var _0x17ebef=this;return new Promise(function(_0xc598fa,_0x4fc0a1){return db['Dynamics365Account'][_0x0afd('0x15')]({'raw':_0x100567[_0x0afd('0x16')]?_0x100567['options'][_0x0afd('0x17')]===undefined?!![]:![]:!![],'where':_0x100567['options']?_0x100567[_0x0afd('0x16')][_0x0afd('0x18')]||null:null,'attributes':_0x100567[_0x0afd('0x16')]?_0x100567[_0x0afd('0x16')]['attributes']||null:null,'limit':_0x100567[_0x0afd('0x16')]?_0x100567['options'][_0x0afd('0x19')]||null:null,'include':_0x100567[_0x0afd('0x16')]?_0x100567[_0x0afd('0x16')][_0x0afd('0x1a')]?_[_0x0afd('0x1b')](_0x100567[_0x0afd('0x16')][_0x0afd('0x1a')],function(_0x397e99){return{'model':db[_0x397e99[_0x0afd('0x1c')]],'as':_0x397e99['as'],'attributes':_0x397e99[_0x0afd('0x1d')],'include':_0x397e99['include']?_[_0x0afd('0x1b')](_0x397e99['include'],function(_0x2eb267){return{'model':db[_0x2eb267[_0x0afd('0x1c')]],'as':_0x2eb267['as'],'attributes':_0x2eb267[_0x0afd('0x1d')],'include':_0x2eb267[_0x0afd('0x1a')]?_[_0x0afd('0x1b')](_0x2eb267[_0x0afd('0x1a')],function(_0x4d299e){return{'model':db[_0x4d299e['model']],'as':_0x4d299e['as'],'attributes':_0x4d299e['attributes']};}):[]};}):[]};}):[]:[]})[_0x0afd('0xb')](function(_0x237834){logger[_0x0afd('0xc')](_0x0afd('0x1e'),_0x100567);logger[_0x0afd('0xe')](_0x0afd('0x1e'),_0x100567,JSON['stringify'](_0x237834));_0xc598fa(_0x237834);})[_0x0afd('0x14')](function(_0x3eabab){logger['error'](_0x0afd('0x1e'),_0x3eabab['message'],_0x100567);_0x4fc0a1(_0x17ebef['error'](0x1f4,_0x3eabab[_0x0afd('0x11')]));});});};exports['ShowDynamics365Account']=function(_0x132248){var _0x25327f=this;return new Promise(function(_0x9194ab,_0x1ae24c){return db[_0x0afd('0x1f')][_0x0afd('0x20')]({'raw':_0x132248['options']?_0x132248[_0x0afd('0x16')][_0x0afd('0x17')]===undefined?!![]:![]:!![],'where':_0x132248[_0x0afd('0x16')]?_0x132248[_0x0afd('0x16')][_0x0afd('0x18')]||null:null,'attributes':_0x132248[_0x0afd('0x16')]?_0x132248[_0x0afd('0x16')][_0x0afd('0x1d')]||null:null,'include':_0x132248[_0x0afd('0x16')]?_0x132248['options'][_0x0afd('0x1a')]?_[_0x0afd('0x1b')](_0x132248[_0x0afd('0x16')][_0x0afd('0x1a')],function(_0x34d2d1){return{'model':db[_0x34d2d1['model']],'as':_0x34d2d1['as'],'attributes':_0x34d2d1[_0x0afd('0x1d')],'include':_0x34d2d1[_0x0afd('0x1a')]?_[_0x0afd('0x1b')](_0x34d2d1['include'],function(_0x423aaa){return{'model':db[_0x423aaa[_0x0afd('0x1c')]],'as':_0x423aaa['as'],'attributes':_0x423aaa[_0x0afd('0x1d')],'include':_0x423aaa['include']?_[_0x0afd('0x1b')](_0x423aaa[_0x0afd('0x1a')],function(_0x2e3745){return{'model':db[_0x2e3745['model']],'as':_0x2e3745['as'],'attributes':_0x2e3745[_0x0afd('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x15416e){logger['info'](_0x0afd('0x21'),_0x132248);logger[_0x0afd('0xe')]('ShowDynamics365Account',_0x132248,JSON['stringify'](_0x15416e));_0x9194ab(_0x15416e);})['catch'](function(_0x5bb57e){logger[_0x0afd('0xf')]('ShowDynamics365Account',_0x5bb57e['message'],_0x132248);_0x1ae24c(_0x25327f[_0x0afd('0xf')](0x1f4,_0x5bb57e['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 0cf1be6..1ce6b43 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 _0x671e=['post','create','update','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x57aa6a,_0x26a3ff){var _0x378d4a=function(_0x399f6c){while(--_0x399f6c){_0x57aa6a['push'](_0x57aa6a['shift']());}};_0x378d4a(++_0x26a3ff);}(_0x671e,0xd6));var _0xe671=function(_0x2be004,_0x26fc49){_0x2be004=_0x2be004-0x0;var _0x55cfba=_0x671e[_0x2be004];return _0x55cfba;};'use strict';var multer=require(_0xe671('0x0'));var util=require(_0xe671('0x1'));var path=require(_0xe671('0x2'));var timeout=require('connect-timeout');var express=require(_0xe671('0x3'));var router=express[_0xe671('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe671('0x5'));var interaction=require(_0xe671('0x6'));var config=require(_0xe671('0x7'));var controller=require('./intDynamics365Configuration.controller');router[_0xe671('0x8')]('/',auth[_0xe671('0x9')](),controller['index']);router[_0xe671('0x8')](_0xe671('0xa'),auth[_0xe671('0x9')](),controller[_0xe671('0xb')]);router['get'](_0xe671('0xc'),auth[_0xe671('0x9')](),controller[_0xe671('0xd')]);router[_0xe671('0x8')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xe671('0xe')]);router[_0xe671('0x8')](_0xe671('0xf'),auth['isAuthenticated'](),controller[_0xe671('0x10')]);router[_0xe671('0x11')]('/',auth[_0xe671('0x9')](),controller[_0xe671('0x12')]);router['put'](_0xe671('0xa'),auth['isAuthenticated'](),controller[_0xe671('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xe671('0x14')]=router; \ No newline at end of file +var _0x94e7=['delete','/:id','destroy','exports','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','update'];(function(_0x221f58,_0x3a8787){var _0x156312=function(_0x126b82){while(--_0x126b82){_0x221f58['push'](_0x221f58['shift']());}};_0x156312(++_0x3a8787);}(_0x94e7,0x7c));var _0x794e=function(_0x11c8e4,_0x4e9823){_0x11c8e4=_0x11c8e4-0x0;var _0x58961d=_0x94e7[_0x11c8e4];return _0x58961d;};'use strict';var multer=require('multer');var util=require(_0x794e('0x0'));var path=require(_0x794e('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x794e('0x2')]();var fs_extra=require(_0x794e('0x3'));var auth=require(_0x794e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x794e('0x5'));var controller=require(_0x794e('0x6'));router[_0x794e('0x7')]('/',auth[_0x794e('0x8')](),controller[_0x794e('0x9')]);router[_0x794e('0x7')]('/:id',auth[_0x794e('0x8')](),controller[_0x794e('0xa')]);router['get'](_0x794e('0xb'),auth['isAuthenticated'](),controller[_0x794e('0xc')]);router['get'](_0x794e('0xd'),auth[_0x794e('0x8')](),controller[_0x794e('0xe')]);router[_0x794e('0x7')](_0x794e('0xf'),auth[_0x794e('0x8')](),controller[_0x794e('0x10')]);router[_0x794e('0x11')]('/',auth[_0x794e('0x8')](),controller['create']);router[_0x794e('0x12')]('/:id',auth[_0x794e('0x8')](),controller[_0x794e('0x13')]);router[_0x794e('0x14')](_0x794e('0x15'),auth[_0x794e('0x8')](),controller[_0x794e('0x16')]);module[_0x794e('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index a680a8b..42de3f2 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 _0x176d=['ENUM','incident','phonecall','contact','nothing','BOOLEAN','sequelize','exports','STRING'];(function(_0x4cd03f,_0x34e866){var _0x4b7233=function(_0x32d8f6){while(--_0x32d8f6){_0x4cd03f['push'](_0x4cd03f['shift']());}};_0x4b7233(++_0x34e866);}(_0x176d,0x1ad));var _0xd176=function(_0x56c2b7,_0x46b107){_0x56c2b7=_0x56c2b7-0x0;var _0x566a41=_0x176d[_0x56c2b7];return _0x566a41;};'use strict';var Sequelize=require(_0xd176('0x0'));module[_0xd176('0x1')]={'name':{'type':Sequelize[_0xd176('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xd176('0x3')](_0xd176('0x4'),_0xd176('0x5')),'defaultValue':_0xd176('0x4')},'moduleCreate':{'type':Sequelize[_0xd176('0x3')](_0xd176('0x6'),_0xd176('0x7')),'defaultValue':_0xd176('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xd176('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xd176('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0xdb57=['phonecall','contact','nothing','BOOLEAN','sequelize','exports','STRING','ENUM'];(function(_0x210123,_0x466d04){var _0x106edd=function(_0x43f295){while(--_0x43f295){_0x210123['push'](_0x210123['shift']());}};_0x106edd(++_0x466d04);}(_0xdb57,0x15c));var _0x7db5=function(_0x5602b9,_0x4cdc14){_0x5602b9=_0x5602b9-0x0;var _0x3f2750=_0xdb57[_0x5602b9];return _0x3f2750;};'use strict';var Sequelize=require(_0x7db5('0x0'));module[_0x7db5('0x1')]={'name':{'type':Sequelize[_0x7db5('0x2')]},'description':{'type':Sequelize[_0x7db5('0x2')]},'ticketType':{'type':Sequelize[_0x7db5('0x3')]('incident',_0x7db5('0x4')),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize['ENUM'](_0x7db5('0x5'),_0x7db5('0x6')),'defaultValue':_0x7db5('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x7db5('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x7db5('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 91cc834..185db9b 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 _0x57f9=['rows','catch','show','rawAttributes','include','find','create','body','params','getFields','findOne','keys','hasOwnProperty','getSubjects','Dynamics365Field','getDescriptions','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','Dynamics365Configuration','fieldName','type','model','map','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll'];(function(_0x3e509b,_0xf48fca){var _0x52ed81=function(_0x24adbb){while(--_0x24adbb){_0x3e509b['push'](_0x3e509b['shift']());}};_0x52ed81(++_0xf48fca);}(_0x57f9,0x1aa));var _0x957f=function(_0x1d4281,_0x1ff1cf){_0x1d4281=_0x1d4281-0x0;var _0x17c250=_0x57f9[_0x1d4281];return _0x17c250;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x957f('0x0'));var jsonpatch=require(_0x957f('0x1'));var rp=require('request-promise');var moment=require(_0x957f('0x2'));var BPromise=require(_0x957f('0x3'));var Mustache=require(_0x957f('0x4'));var util=require('util');var path=require(_0x957f('0x5'));var sox=require('sox');var csv=require(_0x957f('0x6'));var ejs=require(_0x957f('0x7'));var fs=require('fs');var fs_extra=require(_0x957f('0x8'));var _=require(_0x957f('0x9'));var squel=require(_0x957f('0xa'));var crypto=require(_0x957f('0xb'));var jsforce=require(_0x957f('0xc'));var deskjs=require(_0x957f('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x957f('0xe'));var Redis=require('ioredis');var authService=require(_0x957f('0xf'));var qs=require(_0x957f('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x957f('0x11'));var logger=require(_0x957f('0x12'))(_0x957f('0x13'));var utils=require(_0x957f('0x14'));var config=require(_0x957f('0x15'));var licenseUtil=require(_0x957f('0x16'));var db=require(_0x957f('0x17'))['db'];function respondWithStatusCode(_0x226ea7,_0x4e20ee){_0x4e20ee=_0x4e20ee||0xcc;return function(_0x5bee1){if(_0x5bee1){return _0x226ea7[_0x957f('0x18')](_0x4e20ee);}return _0x226ea7[_0x957f('0x19')](_0x4e20ee)[_0x957f('0x1a')]();};}function respondWithResult(_0x56b6a1,_0x319f4f){_0x319f4f=_0x319f4f||0xc8;return function(_0x3c20dd){if(_0x3c20dd){return _0x56b6a1['status'](_0x319f4f)['json'](_0x3c20dd);}};}function respondWithFilteredResult(_0x19d275,_0x29119e){return function(_0x3b1873){if(_0x3b1873){var _0x17c9da=typeof _0x29119e[_0x957f('0x1b')]==='undefined'&&typeof _0x29119e['limit']===_0x957f('0x1c');var _0x6923a5=_0x3b1873[_0x957f('0x1d')];var _0x83ea3d=_0x17c9da?0x0:_0x29119e[_0x957f('0x1b')];var _0x29d9f8=_0x17c9da?_0x3b1873[_0x957f('0x1d')]:_0x29119e['offset']+_0x29119e[_0x957f('0x1e')];var _0x4eeaf0;if(_0x29d9f8>=_0x6923a5){_0x29d9f8=_0x6923a5;_0x4eeaf0=0xc8;}else{_0x4eeaf0=0xce;}_0x19d275[_0x957f('0x19')](_0x4eeaf0);return _0x19d275[_0x957f('0x1f')](_0x957f('0x20'),_0x83ea3d+'-'+_0x29d9f8+'/'+_0x6923a5)['json'](_0x3b1873);}return null;};}function patchUpdates(_0x52e6ca){return function(_0xcba871){try{jsonpatch[_0x957f('0x21')](_0xcba871,_0x52e6ca,!![]);}catch(_0x41b996){return BPromise[_0x957f('0x22')](_0x41b996);}return _0xcba871[_0x957f('0x23')]();};}function saveUpdates(_0x53a819,_0x1df88e){return function(_0x45f2e5){if(_0x45f2e5){return _0x45f2e5[_0x957f('0x24')](_0x53a819)[_0x957f('0x25')](function(_0x4b3616){return _0x4b3616;});}return null;};}function removeEntity(_0x4e8e79,_0x3935bb){return function(_0x1cec39){if(_0x1cec39){return _0x1cec39[_0x957f('0x26')]()['then'](function(){_0x4e8e79[_0x957f('0x19')](0xcc)[_0x957f('0x1a')]();});}};}function handleEntityNotFound(_0xd42370,_0x2bdd78){return function(_0x396f59){if(!_0x396f59){_0xd42370[_0x957f('0x18')](0x194);}return _0x396f59;};}function handleError(_0x3920fc,_0x142296){_0x142296=_0x142296||0x1f4;return function(_0x496a1f){logger[_0x957f('0x27')](_0x496a1f[_0x957f('0x28')]);if(_0x496a1f['name']){delete _0x496a1f[_0x957f('0x29')];}_0x3920fc['status'](_0x142296)[_0x957f('0x2a')](_0x496a1f);};}exports[_0x957f('0x2b')]=function(_0x4efb9f,_0x5a464e){var _0x3494c8={},_0x3eec8b={},_0x3ca0aa={'count':0x0,'rows':[]};var _0x39e761=_['map'](db[_0x957f('0x2c')]['rawAttributes'],function(_0x23a753){return{'name':_0x23a753[_0x957f('0x2d')],'type':_0x23a753[_0x957f('0x2e')]['key']};});_0x3eec8b[_0x957f('0x2f')]=_[_0x957f('0x30')](_0x39e761,_0x957f('0x29'));_0x3eec8b['query']=_['keys'](_0x4efb9f[_0x957f('0x31')]);_0x3eec8b['filters']=_[_0x957f('0x32')](_0x3eec8b['model'],_0x3eec8b[_0x957f('0x31')]);_0x3494c8['attributes']=_[_0x957f('0x32')](_0x3eec8b[_0x957f('0x2f')],qs[_0x957f('0x33')](_0x4efb9f[_0x957f('0x31')]['fields']));_0x3494c8[_0x957f('0x34')]=_0x3494c8['attributes'][_0x957f('0x35')]?_0x3494c8[_0x957f('0x34')]:_0x3eec8b[_0x957f('0x2f')];if(!_0x4efb9f['query']['hasOwnProperty'](_0x957f('0x36'))){_0x3494c8[_0x957f('0x1e')]=qs[_0x957f('0x1e')](_0x4efb9f[_0x957f('0x31')][_0x957f('0x1e')]);_0x3494c8[_0x957f('0x1b')]=qs[_0x957f('0x1b')](_0x4efb9f[_0x957f('0x31')][_0x957f('0x1b')]);}_0x3494c8[_0x957f('0x37')]=qs[_0x957f('0x38')](_0x4efb9f[_0x957f('0x31')][_0x957f('0x38')]);_0x3494c8[_0x957f('0x39')]=qs[_0x957f('0x3a')](_[_0x957f('0x3b')](_0x4efb9f[_0x957f('0x31')],_0x3eec8b['filters']),_0x39e761);if(_0x4efb9f[_0x957f('0x31')][_0x957f('0x3c')]){_0x3494c8[_0x957f('0x39')]=_[_0x957f('0x3d')](_0x3494c8[_0x957f('0x39')],{'$or':_[_0x957f('0x30')](_0x39e761,function(_0x5548d3){if(_0x5548d3[_0x957f('0x2e')]!==_0x957f('0x3e')){var _0x403d3e={};_0x403d3e[_0x5548d3[_0x957f('0x29')]]={'$like':'%'+_0x4efb9f['query'][_0x957f('0x3c')]+'%'};return _0x403d3e;}})});}_0x3494c8=_[_0x957f('0x3d')]({},_0x3494c8,_0x4efb9f[_0x957f('0x3f')]);var _0x59f238={'where':_0x3494c8[_0x957f('0x39')]};return db['Dynamics365Configuration']['count'](_0x59f238)['then'](function(_0x52bf4c){_0x3ca0aa[_0x957f('0x1d')]=_0x52bf4c;if(_0x4efb9f[_0x957f('0x31')][_0x957f('0x40')]){_0x3494c8['include']=[{'all':!![]}];}return db[_0x957f('0x2c')][_0x957f('0x41')](_0x3494c8);})[_0x957f('0x25')](function(_0x2ace98){_0x3ca0aa[_0x957f('0x42')]=_0x2ace98;return _0x3ca0aa;})[_0x957f('0x25')](respondWithFilteredResult(_0x5a464e,_0x3494c8))[_0x957f('0x43')](handleError(_0x5a464e,null));};exports[_0x957f('0x44')]=function(_0x35b13c,_0x100440){var _0x34a4a6={'raw':![],'where':{'id':_0x35b13c['params']['id']}},_0x39959b={};_0x39959b[_0x957f('0x2f')]=_['keys'](db[_0x957f('0x2c')][_0x957f('0x45')]);_0x39959b[_0x957f('0x31')]=_['keys'](_0x35b13c['query']);_0x39959b[_0x957f('0x3a')]=_[_0x957f('0x32')](_0x39959b[_0x957f('0x2f')],_0x39959b[_0x957f('0x31')]);_0x34a4a6[_0x957f('0x34')]=_[_0x957f('0x32')](_0x39959b[_0x957f('0x2f')],qs[_0x957f('0x33')](_0x35b13c[_0x957f('0x31')]['fields']));_0x34a4a6[_0x957f('0x34')]=_0x34a4a6[_0x957f('0x34')][_0x957f('0x35')]?_0x34a4a6[_0x957f('0x34')]:_0x39959b['model'];if(_0x35b13c[_0x957f('0x31')][_0x957f('0x40')]){_0x34a4a6[_0x957f('0x46')]=[{'all':!![]}];}_0x34a4a6=_[_0x957f('0x3d')]({},_0x34a4a6,_0x35b13c[_0x957f('0x3f')]);return db[_0x957f('0x2c')][_0x957f('0x47')](_0x34a4a6)[_0x957f('0x25')](handleEntityNotFound(_0x100440,null))['then'](respondWithResult(_0x100440,null))[_0x957f('0x43')](handleError(_0x100440,null));};exports['create']=function(_0x455811,_0x26c7b7){return db['Dynamics365Configuration'][_0x957f('0x48')](_0x455811[_0x957f('0x49')],{})[_0x957f('0x25')](respondWithResult(_0x26c7b7,0xc9))['catch'](handleError(_0x26c7b7,null));};exports[_0x957f('0x24')]=function(_0x3333b0,_0x2369bb){if(_0x3333b0[_0x957f('0x49')]['id']){delete _0x3333b0[_0x957f('0x49')]['id'];}return db[_0x957f('0x2c')][_0x957f('0x47')]({'where':{'id':_0x3333b0['params']['id']}})[_0x957f('0x25')](handleEntityNotFound(_0x2369bb,null))[_0x957f('0x25')](saveUpdates(_0x3333b0[_0x957f('0x49')],null))['then'](respondWithResult(_0x2369bb,null))['catch'](handleError(_0x2369bb,null));};exports[_0x957f('0x26')]=function(_0xba1199,_0x311046){return db[_0x957f('0x2c')][_0x957f('0x47')]({'where':{'id':_0xba1199[_0x957f('0x4a')]['id']}})[_0x957f('0x25')](handleEntityNotFound(_0x311046,null))[_0x957f('0x25')](removeEntity(_0x311046,null))[_0x957f('0x43')](handleError(_0x311046,null));};exports[_0x957f('0x4b')]=function(_0x15dc14,_0x445ca7,_0x1fd8de){var _0x4f6431={};var _0x311321={};var _0x38273a;var _0x3a6edc;return db[_0x957f('0x2c')][_0x957f('0x4c')]({'where':{'id':_0x15dc14[_0x957f('0x4a')]['id']}})[_0x957f('0x25')](handleEntityNotFound(_0x445ca7,null))[_0x957f('0x25')](function(_0x56a3ef){if(_0x56a3ef){_0x38273a=_0x56a3ef;_0x311321[_0x957f('0x2f')]=_[_0x957f('0x4d')](db['Dynamics365Field'][_0x957f('0x45')]);_0x311321['query']=_['keys'](_0x15dc14[_0x957f('0x31')]);_0x311321['filters']=_[_0x957f('0x32')](_0x311321[_0x957f('0x2f')],_0x311321[_0x957f('0x31')]);_0x4f6431['attributes']=_['intersection'](_0x311321['model'],qs[_0x957f('0x33')](_0x15dc14[_0x957f('0x31')][_0x957f('0x33')]));_0x4f6431['attributes']=_0x4f6431[_0x957f('0x34')][_0x957f('0x35')]?_0x4f6431[_0x957f('0x34')]:_0x311321[_0x957f('0x2f')];_0x4f6431[_0x957f('0x37')]=qs[_0x957f('0x38')](_0x15dc14[_0x957f('0x31')]['sort']);_0x4f6431[_0x957f('0x39')]=qs[_0x957f('0x3a')](_[_0x957f('0x3b')](_0x15dc14[_0x957f('0x31')],_0x311321[_0x957f('0x3a')]));if(_0x15dc14['query']['filter']){_0x4f6431[_0x957f('0x39')]=_[_0x957f('0x3d')](_0x4f6431[_0x957f('0x39')],{'$or':_[_0x957f('0x30')](_0x4f6431[_0x957f('0x34')],function(_0x2ca0a2){var _0x15fb5c={};_0x15fb5c[_0x2ca0a2]={'$like':'%'+_0x15dc14['query'][_0x957f('0x3c')]+'%'};return _0x15fb5c;})});}_0x4f6431=_['merge']({},_0x4f6431,_0x15dc14[_0x957f('0x3f')]);return _0x38273a[_0x957f('0x4b')](_0x4f6431);}})[_0x957f('0x25')](function(_0x581529){if(_0x581529){_0x3a6edc=_0x581529[_0x957f('0x35')];if(!_0x15dc14[_0x957f('0x31')][_0x957f('0x4e')](_0x957f('0x36'))){_0x4f6431['limit']=qs[_0x957f('0x1e')](_0x15dc14[_0x957f('0x31')][_0x957f('0x1e')]);_0x4f6431['offset']=qs[_0x957f('0x1b')](_0x15dc14[_0x957f('0x31')][_0x957f('0x1b')]);}return _0x38273a[_0x957f('0x4b')](_0x4f6431);}})[_0x957f('0x25')](function(_0x5a7529){if(_0x5a7529){return _0x5a7529?{'count':_0x3a6edc,'rows':_0x5a7529}:null;}})['then'](respondWithResult(_0x445ca7,null))[_0x957f('0x43')](handleError(_0x445ca7,null));};exports[_0x957f('0x4f')]=function(_0x4126d0,_0x357cf9,_0x5677d4){var _0x268a5b={};var _0x54a0e5={};var _0xdfd4a7;var _0x48fbea;return db[_0x957f('0x2c')]['findOne']({'where':{'id':_0x4126d0[_0x957f('0x4a')]['id']}})[_0x957f('0x25')](handleEntityNotFound(_0x357cf9,null))[_0x957f('0x25')](function(_0x5e7a53){if(_0x5e7a53){_0xdfd4a7=_0x5e7a53;_0x54a0e5[_0x957f('0x2f')]=_[_0x957f('0x4d')](db[_0x957f('0x50')][_0x957f('0x45')]);_0x54a0e5['query']=_[_0x957f('0x4d')](_0x4126d0['query']);_0x54a0e5[_0x957f('0x3a')]=_[_0x957f('0x32')](_0x54a0e5[_0x957f('0x2f')],_0x54a0e5['query']);_0x268a5b[_0x957f('0x34')]=_[_0x957f('0x32')](_0x54a0e5['model'],qs[_0x957f('0x33')](_0x4126d0[_0x957f('0x31')][_0x957f('0x33')]));_0x268a5b[_0x957f('0x34')]=_0x268a5b[_0x957f('0x34')][_0x957f('0x35')]?_0x268a5b[_0x957f('0x34')]:_0x54a0e5[_0x957f('0x2f')];_0x268a5b[_0x957f('0x37')]=qs['sort'](_0x4126d0[_0x957f('0x31')][_0x957f('0x38')]);_0x268a5b[_0x957f('0x39')]=qs[_0x957f('0x3a')](_['pick'](_0x4126d0[_0x957f('0x31')],_0x54a0e5['filters']));if(_0x4126d0[_0x957f('0x31')]['filter']){_0x268a5b['where']=_[_0x957f('0x3d')](_0x268a5b[_0x957f('0x39')],{'$or':_[_0x957f('0x30')](_0x268a5b[_0x957f('0x34')],function(_0x2d0cc6){var _0xf37e95={};_0xf37e95[_0x2d0cc6]={'$like':'%'+_0x4126d0[_0x957f('0x31')][_0x957f('0x3c')]+'%'};return _0xf37e95;})});}_0x268a5b=_[_0x957f('0x3d')]({},_0x268a5b,_0x4126d0[_0x957f('0x3f')]);return _0xdfd4a7[_0x957f('0x4f')](_0x268a5b);}})[_0x957f('0x25')](function(_0x215654){if(_0x215654){_0x48fbea=_0x215654['length'];if(!_0x4126d0[_0x957f('0x31')][_0x957f('0x4e')](_0x957f('0x36'))){_0x268a5b['limit']=qs['limit'](_0x4126d0[_0x957f('0x31')][_0x957f('0x1e')]);_0x268a5b[_0x957f('0x1b')]=qs[_0x957f('0x1b')](_0x4126d0['query'][_0x957f('0x1b')]);}return _0xdfd4a7[_0x957f('0x4f')](_0x268a5b);}})[_0x957f('0x25')](function(_0x1c9fe3){if(_0x1c9fe3){return _0x1c9fe3?{'count':_0x48fbea,'rows':_0x1c9fe3}:null;}})[_0x957f('0x25')](respondWithResult(_0x357cf9,null))[_0x957f('0x43')](handleError(_0x357cf9,null));};exports['getDescriptions']=function(_0x314699,_0x1310a1,_0x3bcaa5){var _0x10d064={};var _0x3473c7={};var _0x589319;var _0x438da6;return db[_0x957f('0x2c')][_0x957f('0x4c')]({'where':{'id':_0x314699[_0x957f('0x4a')]['id']}})[_0x957f('0x25')](handleEntityNotFound(_0x1310a1,null))[_0x957f('0x25')](function(_0x563646){if(_0x563646){_0x589319=_0x563646;_0x3473c7[_0x957f('0x2f')]=_[_0x957f('0x4d')](db[_0x957f('0x50')][_0x957f('0x45')]);_0x3473c7[_0x957f('0x31')]=_[_0x957f('0x4d')](_0x314699[_0x957f('0x31')]);_0x3473c7[_0x957f('0x3a')]=_[_0x957f('0x32')](_0x3473c7[_0x957f('0x2f')],_0x3473c7[_0x957f('0x31')]);_0x10d064['attributes']=_['intersection'](_0x3473c7[_0x957f('0x2f')],qs['fields'](_0x314699[_0x957f('0x31')][_0x957f('0x33')]));_0x10d064[_0x957f('0x34')]=_0x10d064[_0x957f('0x34')][_0x957f('0x35')]?_0x10d064[_0x957f('0x34')]:_0x3473c7[_0x957f('0x2f')];_0x10d064['order']=qs[_0x957f('0x38')](_0x314699['query']['sort']);_0x10d064[_0x957f('0x39')]=qs['filters'](_[_0x957f('0x3b')](_0x314699['query'],_0x3473c7['filters']));if(_0x314699[_0x957f('0x31')]['filter']){_0x10d064[_0x957f('0x39')]=_[_0x957f('0x3d')](_0x10d064[_0x957f('0x39')],{'$or':_[_0x957f('0x30')](_0x10d064[_0x957f('0x34')],function(_0x4d531b){var _0x2f7bd6={};_0x2f7bd6[_0x4d531b]={'$like':'%'+_0x314699[_0x957f('0x31')]['filter']+'%'};return _0x2f7bd6;})});}_0x10d064=_['merge']({},_0x10d064,_0x314699[_0x957f('0x3f')]);return _0x589319[_0x957f('0x51')](_0x10d064);}})['then'](function(_0x414593){if(_0x414593){_0x438da6=_0x414593['length'];if(!_0x314699[_0x957f('0x31')][_0x957f('0x4e')]('nolimit')){_0x10d064[_0x957f('0x1e')]=qs[_0x957f('0x1e')](_0x314699[_0x957f('0x31')][_0x957f('0x1e')]);_0x10d064[_0x957f('0x1b')]=qs[_0x957f('0x1b')](_0x314699['query'][_0x957f('0x1b')]);}return _0x589319[_0x957f('0x51')](_0x10d064);}})[_0x957f('0x25')](function(_0x483ecd){if(_0x483ecd){return _0x483ecd?{'count':_0x438da6,'rows':_0x483ecd}:null;}})['then'](respondWithResult(_0x1310a1,null))[_0x957f('0x43')](handleError(_0x1310a1,null));}; \ No newline at end of file +var _0xe82d=['catch','show','params','length','options','find','create','body','destroy','getFields','findOne','Dynamics365Field','order','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','end','stack','name','Dynamics365Configuration','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows'];(function(_0x5eaa0b,_0x433b2f){var _0x28b295=function(_0x5e4f6d){while(--_0x5e4f6d){_0x5eaa0b['push'](_0x5eaa0b['shift']());}};_0x28b295(++_0x433b2f);}(_0xe82d,0x14f));var _0xde82=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xe82d[_0x934425];return _0x31d596;};'use strict';var emlformat=require(_0xde82('0x0'));var rimraf=require(_0xde82('0x1'));var zipdir=require(_0xde82('0x2'));var jsonpatch=require(_0xde82('0x3'));var rp=require('request-promise');var moment=require(_0xde82('0x4'));var BPromise=require(_0xde82('0x5'));var Mustache=require(_0xde82('0x6'));var util=require('util');var path=require('path');var sox=require(_0xde82('0x7'));var csv=require(_0xde82('0x8'));var ejs=require(_0xde82('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xde82('0xa'));var squel=require(_0xde82('0xb'));var crypto=require(_0xde82('0xc'));var jsforce=require(_0xde82('0xd'));var deskjs=require(_0xde82('0xe'));var toCsv=require('to-csv');var querystring=require(_0xde82('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xde82('0x10'));var qs=require(_0xde82('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xde82('0x12'));var logger=require(_0xde82('0x13'))(_0xde82('0x14'));var utils=require(_0xde82('0x15'));var config=require(_0xde82('0x16'));var licenseUtil=require(_0xde82('0x17'));var db=require(_0xde82('0x18'))['db'];function respondWithStatusCode(_0x5258ea,_0x45f26c){_0x45f26c=_0x45f26c||0xcc;return function(_0x5cf53c){if(_0x5cf53c){return _0x5258ea[_0xde82('0x19')](_0x45f26c);}return _0x5258ea[_0xde82('0x1a')](_0x45f26c)['end']();};}function respondWithResult(_0x39af41,_0x1184fc){_0x1184fc=_0x1184fc||0xc8;return function(_0x3258f2){if(_0x3258f2){return _0x39af41[_0xde82('0x1a')](_0x1184fc)[_0xde82('0x1b')](_0x3258f2);}};}function respondWithFilteredResult(_0x3abf57,_0x28e5bf){return function(_0x35f547){if(_0x35f547){var _0x402ff2=typeof _0x28e5bf[_0xde82('0x1c')]===_0xde82('0x1d')&&typeof _0x28e5bf[_0xde82('0x1e')]===_0xde82('0x1d');var _0x56054c=_0x35f547[_0xde82('0x1f')];var _0x561222=_0x402ff2?0x0:_0x28e5bf[_0xde82('0x1c')];var _0x452d44=_0x402ff2?_0x35f547[_0xde82('0x1f')]:_0x28e5bf[_0xde82('0x1c')]+_0x28e5bf[_0xde82('0x1e')];var _0x507318;if(_0x452d44>=_0x56054c){_0x452d44=_0x56054c;_0x507318=0xc8;}else{_0x507318=0xce;}_0x3abf57[_0xde82('0x1a')](_0x507318);return _0x3abf57[_0xde82('0x20')](_0xde82('0x21'),_0x561222+'-'+_0x452d44+'/'+_0x56054c)[_0xde82('0x1b')](_0x35f547);}return null;};}function patchUpdates(_0x2cd4e0){return function(_0x4253f2){try{jsonpatch[_0xde82('0x22')](_0x4253f2,_0x2cd4e0,!![]);}catch(_0x5e825b){return BPromise[_0xde82('0x23')](_0x5e825b);}return _0x4253f2['save']();};}function saveUpdates(_0x3b4c8e,_0x2ccf50){return function(_0x16f4e5){if(_0x16f4e5){return _0x16f4e5[_0xde82('0x24')](_0x3b4c8e)['then'](function(_0x57a45a){return _0x57a45a;});}return null;};}function removeEntity(_0x32dbfb,_0xd243c7){return function(_0x1c0175){if(_0x1c0175){return _0x1c0175['destroy']()[_0xde82('0x25')](function(){_0x32dbfb[_0xde82('0x1a')](0xcc)[_0xde82('0x26')]();});}};}function handleEntityNotFound(_0xf07674,_0x33fd57){return function(_0x25f876){if(!_0x25f876){_0xf07674[_0xde82('0x19')](0x194);}return _0x25f876;};}function handleError(_0x139678,_0x40b960){_0x40b960=_0x40b960||0x1f4;return function(_0x421843){logger['error'](_0x421843[_0xde82('0x27')]);if(_0x421843[_0xde82('0x28')]){delete _0x421843[_0xde82('0x28')];}_0x139678[_0xde82('0x1a')](_0x40b960)['send'](_0x421843);};}exports['index']=function(_0x333ec3,_0x5b310b){var _0x42a409={},_0x3a8609={},_0x928209={'count':0x0,'rows':[]};var _0x58e98d=_['map'](db[_0xde82('0x29')][_0xde82('0x2a')],function(_0x2d48b3){return{'name':_0x2d48b3[_0xde82('0x2b')],'type':_0x2d48b3[_0xde82('0x2c')]['key']};});_0x3a8609[_0xde82('0x2d')]=_[_0xde82('0x2e')](_0x58e98d,'name');_0x3a8609[_0xde82('0x2f')]=_[_0xde82('0x30')](_0x333ec3[_0xde82('0x2f')]);_0x3a8609[_0xde82('0x31')]=_['intersection'](_0x3a8609[_0xde82('0x2d')],_0x3a8609['query']);_0x42a409[_0xde82('0x32')]=_[_0xde82('0x33')](_0x3a8609['model'],qs['fields'](_0x333ec3['query'][_0xde82('0x34')]));_0x42a409[_0xde82('0x32')]=_0x42a409[_0xde82('0x32')]['length']?_0x42a409[_0xde82('0x32')]:_0x3a8609[_0xde82('0x2d')];if(!_0x333ec3[_0xde82('0x2f')][_0xde82('0x35')](_0xde82('0x36'))){_0x42a409[_0xde82('0x1e')]=qs[_0xde82('0x1e')](_0x333ec3[_0xde82('0x2f')][_0xde82('0x1e')]);_0x42a409[_0xde82('0x1c')]=qs['offset'](_0x333ec3[_0xde82('0x2f')][_0xde82('0x1c')]);}_0x42a409['order']=qs['sort'](_0x333ec3[_0xde82('0x2f')][_0xde82('0x37')]);_0x42a409[_0xde82('0x38')]=qs[_0xde82('0x31')](_[_0xde82('0x39')](_0x333ec3[_0xde82('0x2f')],_0x3a8609[_0xde82('0x31')]),_0x58e98d);if(_0x333ec3['query'][_0xde82('0x3a')]){_0x42a409[_0xde82('0x38')]=_[_0xde82('0x3b')](_0x42a409['where'],{'$or':_[_0xde82('0x2e')](_0x58e98d,function(_0x741f13){if(_0x741f13[_0xde82('0x2c')]!==_0xde82('0x3c')){var _0x3f187f={};_0x3f187f[_0x741f13['name']]={'$like':'%'+_0x333ec3[_0xde82('0x2f')][_0xde82('0x3a')]+'%'};return _0x3f187f;}})});}_0x42a409=_[_0xde82('0x3b')]({},_0x42a409,_0x333ec3['options']);var _0x468f44={'where':_0x42a409[_0xde82('0x38')]};return db[_0xde82('0x29')][_0xde82('0x1f')](_0x468f44)[_0xde82('0x25')](function(_0x539cd2){_0x928209['count']=_0x539cd2;if(_0x333ec3[_0xde82('0x2f')][_0xde82('0x3d')]){_0x42a409[_0xde82('0x3e')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0xde82('0x3f')](_0x42a409);})[_0xde82('0x25')](function(_0x2a9a27){_0x928209[_0xde82('0x40')]=_0x2a9a27;return _0x928209;})[_0xde82('0x25')](respondWithFilteredResult(_0x5b310b,_0x42a409))[_0xde82('0x41')](handleError(_0x5b310b,null));};exports[_0xde82('0x42')]=function(_0x25133b,_0x2a2cf6){var _0x4905b8={'raw':![],'where':{'id':_0x25133b[_0xde82('0x43')]['id']}},_0x1d88a6={};_0x1d88a6[_0xde82('0x2d')]=_['keys'](db[_0xde82('0x29')][_0xde82('0x2a')]);_0x1d88a6['query']=_[_0xde82('0x30')](_0x25133b[_0xde82('0x2f')]);_0x1d88a6[_0xde82('0x31')]=_[_0xde82('0x33')](_0x1d88a6[_0xde82('0x2d')],_0x1d88a6[_0xde82('0x2f')]);_0x4905b8[_0xde82('0x32')]=_['intersection'](_0x1d88a6[_0xde82('0x2d')],qs[_0xde82('0x34')](_0x25133b[_0xde82('0x2f')][_0xde82('0x34')]));_0x4905b8[_0xde82('0x32')]=_0x4905b8[_0xde82('0x32')][_0xde82('0x44')]?_0x4905b8[_0xde82('0x32')]:_0x1d88a6[_0xde82('0x2d')];if(_0x25133b[_0xde82('0x2f')]['includeAll']){_0x4905b8[_0xde82('0x3e')]=[{'all':!![]}];}_0x4905b8=_[_0xde82('0x3b')]({},_0x4905b8,_0x25133b[_0xde82('0x45')]);return db[_0xde82('0x29')][_0xde82('0x46')](_0x4905b8)[_0xde82('0x25')](handleEntityNotFound(_0x2a2cf6,null))[_0xde82('0x25')](respondWithResult(_0x2a2cf6,null))[_0xde82('0x41')](handleError(_0x2a2cf6,null));};exports[_0xde82('0x47')]=function(_0x2ec0c1,_0x4d045c){return db[_0xde82('0x29')][_0xde82('0x47')](_0x2ec0c1[_0xde82('0x48')],{})[_0xde82('0x25')](respondWithResult(_0x4d045c,0xc9))[_0xde82('0x41')](handleError(_0x4d045c,null));};exports[_0xde82('0x24')]=function(_0x5b97b8,_0x481150){if(_0x5b97b8['body']['id']){delete _0x5b97b8[_0xde82('0x48')]['id'];}return db[_0xde82('0x29')][_0xde82('0x46')]({'where':{'id':_0x5b97b8[_0xde82('0x43')]['id']}})[_0xde82('0x25')](handleEntityNotFound(_0x481150,null))[_0xde82('0x25')](saveUpdates(_0x5b97b8[_0xde82('0x48')],null))[_0xde82('0x25')](respondWithResult(_0x481150,null))[_0xde82('0x41')](handleError(_0x481150,null));};exports[_0xde82('0x49')]=function(_0x475410,_0x48d230){return db[_0xde82('0x29')][_0xde82('0x46')]({'where':{'id':_0x475410['params']['id']}})[_0xde82('0x25')](handleEntityNotFound(_0x48d230,null))[_0xde82('0x25')](removeEntity(_0x48d230,null))[_0xde82('0x41')](handleError(_0x48d230,null));};exports[_0xde82('0x4a')]=function(_0xc63021,_0x41e741,_0x2acbf1){var _0x328a09={};var _0xd584b3={};var _0x2ea102;var _0x3e89d4;return db[_0xde82('0x29')][_0xde82('0x4b')]({'where':{'id':_0xc63021[_0xde82('0x43')]['id']}})[_0xde82('0x25')](handleEntityNotFound(_0x41e741,null))[_0xde82('0x25')](function(_0x2fed16){if(_0x2fed16){_0x2ea102=_0x2fed16;_0xd584b3[_0xde82('0x2d')]=_['keys'](db[_0xde82('0x4c')][_0xde82('0x2a')]);_0xd584b3[_0xde82('0x2f')]=_[_0xde82('0x30')](_0xc63021[_0xde82('0x2f')]);_0xd584b3[_0xde82('0x31')]=_[_0xde82('0x33')](_0xd584b3[_0xde82('0x2d')],_0xd584b3[_0xde82('0x2f')]);_0x328a09[_0xde82('0x32')]=_[_0xde82('0x33')](_0xd584b3[_0xde82('0x2d')],qs[_0xde82('0x34')](_0xc63021[_0xde82('0x2f')][_0xde82('0x34')]));_0x328a09[_0xde82('0x32')]=_0x328a09[_0xde82('0x32')]['length']?_0x328a09['attributes']:_0xd584b3[_0xde82('0x2d')];_0x328a09[_0xde82('0x4d')]=qs[_0xde82('0x37')](_0xc63021[_0xde82('0x2f')][_0xde82('0x37')]);_0x328a09[_0xde82('0x38')]=qs[_0xde82('0x31')](_[_0xde82('0x39')](_0xc63021[_0xde82('0x2f')],_0xd584b3[_0xde82('0x31')]));if(_0xc63021['query'][_0xde82('0x3a')]){_0x328a09[_0xde82('0x38')]=_['merge'](_0x328a09[_0xde82('0x38')],{'$or':_[_0xde82('0x2e')](_0x328a09[_0xde82('0x32')],function(_0x13b6b1){var _0x5d594a={};_0x5d594a[_0x13b6b1]={'$like':'%'+_0xc63021[_0xde82('0x2f')][_0xde82('0x3a')]+'%'};return _0x5d594a;})});}_0x328a09=_[_0xde82('0x3b')]({},_0x328a09,_0xc63021[_0xde82('0x45')]);return _0x2ea102[_0xde82('0x4a')](_0x328a09);}})[_0xde82('0x25')](function(_0x1faf0e){if(_0x1faf0e){_0x3e89d4=_0x1faf0e['length'];if(!_0xc63021[_0xde82('0x2f')][_0xde82('0x35')](_0xde82('0x36'))){_0x328a09[_0xde82('0x1e')]=qs[_0xde82('0x1e')](_0xc63021['query'][_0xde82('0x1e')]);_0x328a09[_0xde82('0x1c')]=qs[_0xde82('0x1c')](_0xc63021[_0xde82('0x2f')]['offset']);}return _0x2ea102[_0xde82('0x4a')](_0x328a09);}})['then'](function(_0x25243e){if(_0x25243e){return _0x25243e?{'count':_0x3e89d4,'rows':_0x25243e}:null;}})[_0xde82('0x25')](respondWithResult(_0x41e741,null))[_0xde82('0x41')](handleError(_0x41e741,null));};exports[_0xde82('0x4e')]=function(_0xd76d42,_0x1ae44b,_0x512e18){var _0x14bdcf={};var _0x1084f2={};var _0x16eff4;var _0x2c9852;return db[_0xde82('0x29')][_0xde82('0x4b')]({'where':{'id':_0xd76d42[_0xde82('0x43')]['id']}})[_0xde82('0x25')](handleEntityNotFound(_0x1ae44b,null))['then'](function(_0x45dba9){if(_0x45dba9){_0x16eff4=_0x45dba9;_0x1084f2['model']=_[_0xde82('0x30')](db[_0xde82('0x4c')][_0xde82('0x2a')]);_0x1084f2[_0xde82('0x2f')]=_[_0xde82('0x30')](_0xd76d42['query']);_0x1084f2[_0xde82('0x31')]=_[_0xde82('0x33')](_0x1084f2['model'],_0x1084f2[_0xde82('0x2f')]);_0x14bdcf[_0xde82('0x32')]=_['intersection'](_0x1084f2[_0xde82('0x2d')],qs[_0xde82('0x34')](_0xd76d42['query'][_0xde82('0x34')]));_0x14bdcf[_0xde82('0x32')]=_0x14bdcf[_0xde82('0x32')][_0xde82('0x44')]?_0x14bdcf[_0xde82('0x32')]:_0x1084f2[_0xde82('0x2d')];_0x14bdcf[_0xde82('0x4d')]=qs[_0xde82('0x37')](_0xd76d42[_0xde82('0x2f')]['sort']);_0x14bdcf['where']=qs['filters'](_[_0xde82('0x39')](_0xd76d42['query'],_0x1084f2['filters']));if(_0xd76d42['query'][_0xde82('0x3a')]){_0x14bdcf[_0xde82('0x38')]=_[_0xde82('0x3b')](_0x14bdcf[_0xde82('0x38')],{'$or':_['map'](_0x14bdcf[_0xde82('0x32')],function(_0x1721e1){var _0x376557={};_0x376557[_0x1721e1]={'$like':'%'+_0xd76d42['query'][_0xde82('0x3a')]+'%'};return _0x376557;})});}_0x14bdcf=_[_0xde82('0x3b')]({},_0x14bdcf,_0xd76d42[_0xde82('0x45')]);return _0x16eff4[_0xde82('0x4e')](_0x14bdcf);}})[_0xde82('0x25')](function(_0x19f7c1){if(_0x19f7c1){_0x2c9852=_0x19f7c1[_0xde82('0x44')];if(!_0xd76d42[_0xde82('0x2f')][_0xde82('0x35')](_0xde82('0x36'))){_0x14bdcf[_0xde82('0x1e')]=qs[_0xde82('0x1e')](_0xd76d42[_0xde82('0x2f')][_0xde82('0x1e')]);_0x14bdcf[_0xde82('0x1c')]=qs[_0xde82('0x1c')](_0xd76d42[_0xde82('0x2f')][_0xde82('0x1c')]);}return _0x16eff4[_0xde82('0x4e')](_0x14bdcf);}})[_0xde82('0x25')](function(_0x35a060){if(_0x35a060){return _0x35a060?{'count':_0x2c9852,'rows':_0x35a060}:null;}})[_0xde82('0x25')](respondWithResult(_0x1ae44b,null))[_0xde82('0x41')](handleError(_0x1ae44b,null));};exports[_0xde82('0x4f')]=function(_0x1c7d93,_0x180229,_0x4d8d4d){var _0x2bd9e5={};var _0x5deabb={};var _0x17275a;var _0x39ca2d;return db[_0xde82('0x29')][_0xde82('0x4b')]({'where':{'id':_0x1c7d93['params']['id']}})[_0xde82('0x25')](handleEntityNotFound(_0x180229,null))[_0xde82('0x25')](function(_0x4f890a){if(_0x4f890a){_0x17275a=_0x4f890a;_0x5deabb[_0xde82('0x2d')]=_[_0xde82('0x30')](db['Dynamics365Field'][_0xde82('0x2a')]);_0x5deabb[_0xde82('0x2f')]=_[_0xde82('0x30')](_0x1c7d93['query']);_0x5deabb['filters']=_['intersection'](_0x5deabb[_0xde82('0x2d')],_0x5deabb[_0xde82('0x2f')]);_0x2bd9e5[_0xde82('0x32')]=_['intersection'](_0x5deabb[_0xde82('0x2d')],qs['fields'](_0x1c7d93['query']['fields']));_0x2bd9e5[_0xde82('0x32')]=_0x2bd9e5[_0xde82('0x32')][_0xde82('0x44')]?_0x2bd9e5[_0xde82('0x32')]:_0x5deabb['model'];_0x2bd9e5[_0xde82('0x4d')]=qs['sort'](_0x1c7d93[_0xde82('0x2f')][_0xde82('0x37')]);_0x2bd9e5[_0xde82('0x38')]=qs['filters'](_[_0xde82('0x39')](_0x1c7d93['query'],_0x5deabb[_0xde82('0x31')]));if(_0x1c7d93['query'][_0xde82('0x3a')]){_0x2bd9e5['where']=_[_0xde82('0x3b')](_0x2bd9e5[_0xde82('0x38')],{'$or':_['map'](_0x2bd9e5[_0xde82('0x32')],function(_0x37c116){var _0x44e11d={};_0x44e11d[_0x37c116]={'$like':'%'+_0x1c7d93[_0xde82('0x2f')]['filter']+'%'};return _0x44e11d;})});}_0x2bd9e5=_[_0xde82('0x3b')]({},_0x2bd9e5,_0x1c7d93[_0xde82('0x45')]);return _0x17275a[_0xde82('0x4f')](_0x2bd9e5);}})['then'](function(_0x1ca920){if(_0x1ca920){_0x39ca2d=_0x1ca920['length'];if(!_0x1c7d93['query'][_0xde82('0x35')](_0xde82('0x36'))){_0x2bd9e5['limit']=qs[_0xde82('0x1e')](_0x1c7d93[_0xde82('0x2f')][_0xde82('0x1e')]);_0x2bd9e5[_0xde82('0x1c')]=qs[_0xde82('0x1c')](_0x1c7d93['query']['offset']);}return _0x17275a[_0xde82('0x4f')](_0x2bd9e5);}})['then'](function(_0x3e74a3){if(_0x3e74a3){return _0x3e74a3?{'count':_0x39ca2d,'rows':_0x3e74a3}:null;}})[_0xde82('0x25')](respondWithResult(_0x180229,null))[_0xde82('0x41')](handleError(_0x180229,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index f379713..dba00c7 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 _0xbec5=['request-promise','path','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','api','moment','bluebird'];(function(_0x5eba8b,_0x2317c2){var _0xcef121=function(_0x37bf83){while(--_0x37bf83){_0x5eba8b['push'](_0x5eba8b['shift']());}};_0xcef121(++_0x2317c2);}(_0xbec5,0xe5));var _0x5bec=function(_0x4c6d6f,_0x291557){_0x4c6d6f=_0x4c6d6f-0x0;var _0x2d4478=_0xbec5[_0x4c6d6f];return _0x2d4478;};'use strict';var _=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var logger=require('../../config/logger')(_0x5bec('0x2'));var moment=require(_0x5bec('0x3'));var BPromise=require(_0x5bec('0x4'));var rp=require(_0x5bec('0x5'));var fs=require('fs');var path=require(_0x5bec('0x6'));var rimraf=require('rimraf');var config=require(_0x5bec('0x7'));var attributes=require(_0x5bec('0x8'));module[_0x5bec('0x9')]=function(_0x4aaac6,_0x3ed67a){return _0x4aaac6[_0x5bec('0xa')](_0x5bec('0xb'),attributes,{'tableName':_0x5bec('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x00bb=['util','../../config/logger','moment','request-promise','path','../../config/environment','./intDynamics365Configuration.attributes','define','Dynamics365Configuration','int_dynamics365_configurations','lodash'];(function(_0x4a6f58,_0x5cb68e){var _0x25e7bd=function(_0x37a36a){while(--_0x37a36a){_0x4a6f58['push'](_0x4a6f58['shift']());}};_0x25e7bd(++_0x5cb68e);}(_0x00bb,0x1d8));var _0xb00b=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x00bb[_0x550d12];return _0x12103d;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var logger=require(_0xb00b('0x2'))('api');var moment=require(_0xb00b('0x3'));var BPromise=require('bluebird');var rp=require(_0xb00b('0x4'));var fs=require('fs');var path=require(_0xb00b('0x5'));var rimraf=require('rimraf');var config=require(_0xb00b('0x6'));var attributes=require(_0xb00b('0x7'));module['exports']=function(_0x574cf8,_0x532ffb){return _0x574cf8[_0xb00b('0x8')](_0xb00b('0x9'),attributes,{'tableName':_0xb00b('0xa'),'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 bb390fe..8e758ef 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 _0xeacf=['message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x102b0c,_0x33dee4){var _0x9b15ca=function(_0x42d504){while(--_0x42d504){_0x102b0c['push'](_0x102b0c['shift']());}};_0x9b15ca(++_0x33dee4);}(_0xeacf,0x133));var _0xfeac=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xeacf[_0x3ce3c];return _0x55a2c9;};'use strict';var _=require(_0xfeac('0x0'));var util=require('util');var moment=require(_0xfeac('0x1'));var BPromise=require(_0xfeac('0x2'));var rs=require(_0xfeac('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfeac('0x4'))['db'];var utils=require(_0xfeac('0x5'));var logger=require(_0xfeac('0x6'))(_0xfeac('0x7'));var config=require('../../config/environment');var jayson=require(_0xfeac('0x8'));var client=jayson[_0xfeac('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d9e48,_0x5a4a4e,_0x32d301){return new BPromise(function(_0x4321d1,_0x1e76e8){return client[_0xfeac('0xa')](_0x5d9e48,_0x32d301)[_0xfeac('0xb')](function(_0x2ca313){logger['info'](_0xfeac('0xc'),_0x5a4a4e,_0xfeac('0xd'));logger['debug']('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x5a4a4e,'request\x20sent',JSON[_0xfeac('0xe')](_0x2ca313));if(_0x2ca313[_0xfeac('0xf')]){if(_0x2ca313[_0xfeac('0xf')]['code']===0x1f4){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x5a4a4e,_0x2ca313['error'][_0xfeac('0x10')]);return _0x1e76e8(_0x2ca313['error']['message']);}logger[_0xfeac('0xf')](_0xfeac('0xc'),_0x5a4a4e,_0x2ca313['error'][_0xfeac('0x10')]);return _0x4321d1(_0x2ca313[_0xfeac('0xf')]['message']);}else{logger['info'](_0xfeac('0xc'),_0x5a4a4e,_0xfeac('0xd'));_0x4321d1(_0x2ca313[_0xfeac('0x11')]['message']);}})[_0xfeac('0x12')](function(_0x390a65){logger[_0xfeac('0xf')](_0xfeac('0xc'),_0x5a4a4e,_0x390a65);_0x1e76e8(_0x390a65);});});} \ No newline at end of file +var _0xba66=['../../config/environment','jayson/promise','client','http','request','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x2b98d4,_0x1de753){var _0x76ce5b=function(_0x5bfe11){while(--_0x5bfe11){_0x2b98d4['push'](_0x2b98d4['shift']());}};_0x76ce5b(++_0x1de753);}(_0xba66,0x1dc));var _0x6ba6=function(_0x5df640,_0x3f7d9b){_0x5df640=_0x5df640-0x0;var _0x228afb=_0xba66[_0x5df640];return _0x228afb;};'use strict';var _=require(_0x6ba6('0x0'));var util=require('util');var moment=require(_0x6ba6('0x1'));var BPromise=require(_0x6ba6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6ba6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6ba6('0x4'));var logger=require(_0x6ba6('0x5'))(_0x6ba6('0x6'));var config=require(_0x6ba6('0x7'));var jayson=require(_0x6ba6('0x8'));var client=jayson[_0x6ba6('0x9')][_0x6ba6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a7800,_0x2901e0,_0x1ed82f){return new BPromise(function(_0x59f70b,_0x561b9b){return client[_0x6ba6('0xb')](_0x2a7800,_0x1ed82f)[_0x6ba6('0xc')](function(_0x53989d){logger['info'](_0x6ba6('0xd'),_0x2901e0,_0x6ba6('0xe'));logger['debug'](_0x6ba6('0xf'),_0x2901e0,_0x6ba6('0xe'),JSON[_0x6ba6('0x10')](_0x53989d));if(_0x53989d[_0x6ba6('0x11')]){if(_0x53989d[_0x6ba6('0x11')][_0x6ba6('0x12')]===0x1f4){logger[_0x6ba6('0x11')](_0x6ba6('0xd'),_0x2901e0,_0x53989d[_0x6ba6('0x11')][_0x6ba6('0x13')]);return _0x561b9b(_0x53989d[_0x6ba6('0x11')][_0x6ba6('0x13')]);}logger['error'](_0x6ba6('0xd'),_0x2901e0,_0x53989d[_0x6ba6('0x11')]['message']);return _0x59f70b(_0x53989d[_0x6ba6('0x11')][_0x6ba6('0x13')]);}else{logger[_0x6ba6('0x14')](_0x6ba6('0xd'),_0x2901e0,'request\x20sent');_0x59f70b(_0x53989d[_0x6ba6('0x15')][_0x6ba6('0x13')]);}})[_0x6ba6('0x16')](function(_0x15ae9a){logger[_0x6ba6('0x11')](_0x6ba6('0xd'),_0x2901e0,_0x15ae9a);_0x561b9b(_0x15ae9a);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 87f3ed3..7350e98 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 _0xd271=['get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller'];(function(_0x495d69,_0x223b85){var _0x47b629=function(_0x134173){while(--_0x134173){_0x495d69['push'](_0x495d69['shift']());}};_0x47b629(++_0x223b85);}(_0xd271,0xd1));var _0x1d27=function(_0x529d6e,_0x221b7f){_0x529d6e=_0x529d6e-0x0;var _0x2574bd=_0xd271[_0x529d6e];return _0x2574bd;};'use strict';var multer=require(_0x1d27('0x0'));var util=require(_0x1d27('0x1'));var path=require(_0x1d27('0x2'));var timeout=require(_0x1d27('0x3'));var express=require(_0x1d27('0x4'));var router=express[_0x1d27('0x5')]();var fs_extra=require(_0x1d27('0x6'));var auth=require(_0x1d27('0x7'));var interaction=require(_0x1d27('0x8'));var config=require(_0x1d27('0x9'));var controller=require(_0x1d27('0xa'));router[_0x1d27('0xb')]('/',auth[_0x1d27('0xc')](),controller[_0x1d27('0xd')]);router['get'](_0x1d27('0xe'),auth[_0x1d27('0xc')](),controller[_0x1d27('0xf')]);router[_0x1d27('0x10')]('/',auth[_0x1d27('0xc')](),controller[_0x1d27('0x11')]);router[_0x1d27('0x12')]('/:id',auth[_0x1d27('0xc')](),controller[_0x1d27('0x13')]);router[_0x1d27('0x14')](_0x1d27('0xe'),auth[_0x1d27('0xc')](),controller[_0x1d27('0x15')]);module['exports']=router; \ No newline at end of file +var _0xca8f=['/:id','post','put','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xca8f,0x1d3));var _0xfca8=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xca8f[_0x13e741];return _0x3f8bb3;};'use strict';var multer=require(_0xfca8('0x0'));var util=require('util');var path=require(_0xfca8('0x1'));var timeout=require(_0xfca8('0x2'));var express=require(_0xfca8('0x3'));var router=express['Router']();var fs_extra=require(_0xfca8('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xfca8('0x5'));var config=require(_0xfca8('0x6'));var controller=require('./intDynamics365Field.controller');router[_0xfca8('0x7')]('/',auth[_0xfca8('0x8')](),controller['index']);router[_0xfca8('0x7')](_0xfca8('0x9'),auth[_0xfca8('0x8')](),controller['show']);router[_0xfca8('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0xfca8('0xb')](_0xfca8('0x9'),auth[_0xfca8('0x8')](),controller['update']);router[_0xfca8('0xc')]('/:id',auth[_0xfca8('0x8')](),controller[_0xfca8('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 449e259..2ab6f5f 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 _0xeb86=['ENUM','string','keyValue','picklist','STRING','variable','customVariable','sequelize','exports'];(function(_0x5878fd,_0x4cad4c){var _0x280120=function(_0x29a726){while(--_0x29a726){_0x5878fd['push'](_0x5878fd['shift']());}};_0x280120(++_0x4cad4c);}(_0xeb86,0x1b7));var _0x6eb8=function(_0x562748,_0x1b2d6b){_0x562748=_0x562748-0x0;var _0x1f7815=_0xeb86[_0x562748];return _0x1f7815;};'use strict';var Sequelize=require(_0x6eb8('0x0'));module[_0x6eb8('0x1')]={'type':{'type':Sequelize[_0x6eb8('0x2')](_0x6eb8('0x3'),'variable','customVariable',_0x6eb8('0x4'),_0x6eb8('0x5')),'defaultValue':_0x6eb8('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x6eb8('0x6')]},'keyType':{'type':Sequelize[_0x6eb8('0x2')](_0x6eb8('0x3'),_0x6eb8('0x7'),_0x6eb8('0x8'))},'keyContent':{'type':Sequelize[_0x6eb8('0x6')]},'idField':{'type':Sequelize[_0x6eb8('0x6')]},'nameField':{'type':Sequelize[_0x6eb8('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6eb8('0x6')]}}; \ No newline at end of file +var _0x7ef8=['STRING','BOOLEAN','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x3e25c1,_0x1d15f9){var _0x52e7f2=function(_0x597a5a){while(--_0x597a5a){_0x3e25c1['push'](_0x3e25c1['shift']());}};_0x52e7f2(++_0x1d15f9);}(_0x7ef8,0x1a2));var _0x87ef=function(_0x1dc78e,_0x3eb207){_0x1dc78e=_0x1dc78e-0x0;var _0x26b975=_0x7ef8[_0x1dc78e];return _0x26b975;};'use strict';var Sequelize=require('sequelize');module[_0x87ef('0x0')]={'type':{'type':Sequelize[_0x87ef('0x1')](_0x87ef('0x2'),_0x87ef('0x3'),_0x87ef('0x4'),_0x87ef('0x5'),'picklist'),'defaultValue':_0x87ef('0x2')},'content':{'type':Sequelize[_0x87ef('0x6')]},'key':{'type':Sequelize[_0x87ef('0x6')]},'keyType':{'type':Sequelize[_0x87ef('0x1')](_0x87ef('0x2'),'variable',_0x87ef('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x87ef('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x87ef('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x87ef('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 0e0acc8..0674648 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 _0x9a46=['jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','reject','save','update','destroy','error','name','map','Dynamics365Field','fieldName','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','then','rows','catch','params','rawAttributes','intersection','include','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel'];(function(_0x1e1d80,_0xf36cef){var _0x41ba56=function(_0x694a39){while(--_0x694a39){_0x1e1d80['push'](_0x1e1d80['shift']());}};_0x41ba56(++_0xf36cef);}(_0x9a46,0x19e));var _0x69a4=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9a46[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x69a4('0x0'));var rimraf=require(_0x69a4('0x1'));var zipdir=require(_0x69a4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x69a4('0x3'));var moment=require(_0x69a4('0x4'));var BPromise=require(_0x69a4('0x5'));var Mustache=require('mustache');var util=require(_0x69a4('0x6'));var path=require(_0x69a4('0x7'));var sox=require(_0x69a4('0x8'));var csv=require('to-csv');var ejs=require(_0x69a4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x69a4('0xa'));var squel=require(_0x69a4('0xb'));var crypto=require('crypto');var jsforce=require(_0x69a4('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x69a4('0xd'));var querystring=require('querystring');var Papa=require(_0x69a4('0xe'));var Redis=require('ioredis');var authService=require(_0x69a4('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x69a4('0x10'));var hardwareService=require(_0x69a4('0x11'));var logger=require(_0x69a4('0x12'))(_0x69a4('0x13'));var utils=require(_0x69a4('0x14'));var config=require(_0x69a4('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x69a4('0x16'))['db'];function respondWithStatusCode(_0x31e19a,_0x2cd796){_0x2cd796=_0x2cd796||0xcc;return function(_0x52c382){if(_0x52c382){return _0x31e19a[_0x69a4('0x17')](_0x2cd796);}return _0x31e19a[_0x69a4('0x18')](_0x2cd796)[_0x69a4('0x19')]();};}function respondWithResult(_0x2bb567,_0x5be671){_0x5be671=_0x5be671||0xc8;return function(_0x280ba8){if(_0x280ba8){return _0x2bb567[_0x69a4('0x18')](_0x5be671)[_0x69a4('0x1a')](_0x280ba8);}};}function respondWithFilteredResult(_0x5e7e90,_0x4edb43){return function(_0x1c5993){if(_0x1c5993){var _0x33f0fb=typeof _0x4edb43[_0x69a4('0x1b')]==='undefined'&&typeof _0x4edb43[_0x69a4('0x1c')]===_0x69a4('0x1d');var _0x3ff21e=_0x1c5993['count'];var _0x1b41ad=_0x33f0fb?0x0:_0x4edb43[_0x69a4('0x1b')];var _0xcd2dae=_0x33f0fb?_0x1c5993[_0x69a4('0x1e')]:_0x4edb43[_0x69a4('0x1b')]+_0x4edb43['limit'];var _0x1c7f9a;if(_0xcd2dae>=_0x3ff21e){_0xcd2dae=_0x3ff21e;_0x1c7f9a=0xc8;}else{_0x1c7f9a=0xce;}_0x5e7e90['status'](_0x1c7f9a);return _0x5e7e90[_0x69a4('0x1f')]('Content-Range',_0x1b41ad+'-'+_0xcd2dae+'/'+_0x3ff21e)[_0x69a4('0x1a')](_0x1c5993);}return null;};}function patchUpdates(_0x51e8fa){return function(_0x5e1b3f){try{jsonpatch['apply'](_0x5e1b3f,_0x51e8fa,!![]);}catch(_0x4e8c06){return BPromise[_0x69a4('0x20')](_0x4e8c06);}return _0x5e1b3f[_0x69a4('0x21')]();};}function saveUpdates(_0x1e9d5d,_0x3aef02){return function(_0x2dfed5){if(_0x2dfed5){return _0x2dfed5[_0x69a4('0x22')](_0x1e9d5d)['then'](function(_0x24d6c7){return _0x24d6c7;});}return null;};}function removeEntity(_0x2fe8c9,_0x50aa3f){return function(_0x3c6a5c){if(_0x3c6a5c){return _0x3c6a5c[_0x69a4('0x23')]()['then'](function(){_0x2fe8c9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x19c111,_0x5a0c8a){return function(_0x1ba1d5){if(!_0x1ba1d5){_0x19c111[_0x69a4('0x17')](0x194);}return _0x1ba1d5;};}function handleError(_0x2dd794,_0x5ec2bd){_0x5ec2bd=_0x5ec2bd||0x1f4;return function(_0x3137c9){logger[_0x69a4('0x24')](_0x3137c9['stack']);if(_0x3137c9[_0x69a4('0x25')]){delete _0x3137c9[_0x69a4('0x25')];}_0x2dd794['status'](_0x5ec2bd)['send'](_0x3137c9);};}exports['index']=function(_0x38536b,_0x400108){var _0x39363b={},_0x3843a6={},_0x3755ab={'count':0x0,'rows':[]};var _0x144e4b=_[_0x69a4('0x26')](db[_0x69a4('0x27')]['rawAttributes'],function(_0x47d8a7){return{'name':_0x47d8a7[_0x69a4('0x28')],'type':_0x47d8a7[_0x69a4('0x29')]['key']};});_0x3843a6[_0x69a4('0x2a')]=_['map'](_0x144e4b,_0x69a4('0x25'));_0x3843a6[_0x69a4('0x2b')]=_[_0x69a4('0x2c')](_0x38536b['query']);_0x3843a6[_0x69a4('0x2d')]=_['intersection'](_0x3843a6['model'],_0x3843a6[_0x69a4('0x2b')]);_0x39363b[_0x69a4('0x2e')]=_['intersection'](_0x3843a6[_0x69a4('0x2a')],qs[_0x69a4('0x2f')](_0x38536b[_0x69a4('0x2b')]['fields']));_0x39363b['attributes']=_0x39363b[_0x69a4('0x2e')][_0x69a4('0x30')]?_0x39363b['attributes']:_0x3843a6[_0x69a4('0x2a')];if(!_0x38536b[_0x69a4('0x2b')][_0x69a4('0x31')](_0x69a4('0x32'))){_0x39363b['limit']=qs[_0x69a4('0x1c')](_0x38536b[_0x69a4('0x2b')][_0x69a4('0x1c')]);_0x39363b[_0x69a4('0x1b')]=qs[_0x69a4('0x1b')](_0x38536b[_0x69a4('0x2b')]['offset']);}_0x39363b[_0x69a4('0x33')]=qs[_0x69a4('0x34')](_0x38536b[_0x69a4('0x2b')][_0x69a4('0x34')]);_0x39363b[_0x69a4('0x35')]=qs[_0x69a4('0x2d')](_[_0x69a4('0x36')](_0x38536b['query'],_0x3843a6[_0x69a4('0x2d')]),_0x144e4b);if(_0x38536b[_0x69a4('0x2b')][_0x69a4('0x37')]){_0x39363b[_0x69a4('0x35')]=_[_0x69a4('0x38')](_0x39363b[_0x69a4('0x35')],{'$or':_['map'](_0x144e4b,function(_0x3ba68b){if(_0x3ba68b[_0x69a4('0x29')]!==_0x69a4('0x39')){var _0x168677={};_0x168677[_0x3ba68b[_0x69a4('0x25')]]={'$like':'%'+_0x38536b['query']['filter']+'%'};return _0x168677;}})});}_0x39363b=_[_0x69a4('0x38')]({},_0x39363b,_0x38536b[_0x69a4('0x3a')]);var _0x165a4a={'where':_0x39363b['where']};return db['Dynamics365Field'][_0x69a4('0x1e')](_0x165a4a)['then'](function(_0x2eefb1){_0x3755ab[_0x69a4('0x1e')]=_0x2eefb1;if(_0x38536b[_0x69a4('0x2b')][_0x69a4('0x3b')]){_0x39363b['include']=[{'all':!![]}];}return db[_0x69a4('0x27')][_0x69a4('0x3c')](_0x39363b);})[_0x69a4('0x3d')](function(_0x4b5825){_0x3755ab[_0x69a4('0x3e')]=_0x4b5825;return _0x3755ab;})[_0x69a4('0x3d')](respondWithFilteredResult(_0x400108,_0x39363b))[_0x69a4('0x3f')](handleError(_0x400108,null));};exports['show']=function(_0x3128ca,_0x1fe0ed){var _0x1a05cd={'raw':!![],'where':{'id':_0x3128ca[_0x69a4('0x40')]['id']}},_0x4c081a={};_0x4c081a['model']=_[_0x69a4('0x2c')](db[_0x69a4('0x27')][_0x69a4('0x41')]);_0x4c081a[_0x69a4('0x2b')]=_[_0x69a4('0x2c')](_0x3128ca[_0x69a4('0x2b')]);_0x4c081a[_0x69a4('0x2d')]=_[_0x69a4('0x42')](_0x4c081a[_0x69a4('0x2a')],_0x4c081a[_0x69a4('0x2b')]);_0x1a05cd[_0x69a4('0x2e')]=_[_0x69a4('0x42')](_0x4c081a[_0x69a4('0x2a')],qs[_0x69a4('0x2f')](_0x3128ca[_0x69a4('0x2b')][_0x69a4('0x2f')]));_0x1a05cd[_0x69a4('0x2e')]=_0x1a05cd['attributes'][_0x69a4('0x30')]?_0x1a05cd[_0x69a4('0x2e')]:_0x4c081a['model'];if(_0x3128ca[_0x69a4('0x2b')]['includeAll']){_0x1a05cd[_0x69a4('0x43')]=[{'all':!![]}];}_0x1a05cd=_[_0x69a4('0x38')]({},_0x1a05cd,_0x3128ca[_0x69a4('0x3a')]);return db[_0x69a4('0x27')][_0x69a4('0x44')](_0x1a05cd)[_0x69a4('0x3d')](handleEntityNotFound(_0x1fe0ed,null))[_0x69a4('0x3d')](respondWithResult(_0x1fe0ed,null))[_0x69a4('0x3f')](handleError(_0x1fe0ed,null));};exports[_0x69a4('0x45')]=function(_0x13cd00,_0x1f07c5){return db[_0x69a4('0x27')]['create'](_0x13cd00[_0x69a4('0x46')],{})[_0x69a4('0x3d')](respondWithResult(_0x1f07c5,0xc9))[_0x69a4('0x3f')](handleError(_0x1f07c5,null));};exports[_0x69a4('0x22')]=function(_0x1a12b0,_0x10a708){if(_0x1a12b0[_0x69a4('0x46')]['id']){delete _0x1a12b0[_0x69a4('0x46')]['id'];}return db[_0x69a4('0x27')]['find']({'where':{'id':_0x1a12b0[_0x69a4('0x40')]['id']}})[_0x69a4('0x3d')](handleEntityNotFound(_0x10a708,null))[_0x69a4('0x3d')](saveUpdates(_0x1a12b0[_0x69a4('0x46')],null))[_0x69a4('0x3d')](respondWithResult(_0x10a708,null))[_0x69a4('0x3f')](handleError(_0x10a708,null));};exports[_0x69a4('0x23')]=function(_0x2cfb32,_0x4a5ae7){return db['Dynamics365Field'][_0x69a4('0x44')]({'where':{'id':_0x2cfb32[_0x69a4('0x40')]['id']}})[_0x69a4('0x3d')](handleEntityNotFound(_0x4a5ae7,null))[_0x69a4('0x3d')](removeEntity(_0x4a5ae7,null))[_0x69a4('0x3f')](handleError(_0x4a5ae7,null));}; \ No newline at end of file +var _0xff6f=['stack','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','rows','params','keys','length','find','catch','create','body','rimraf','request-promise','moment','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/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','update','then','destroy','error'];(function(_0x96f571,_0x1a2934){var _0x362fff=function(_0x43045d){while(--_0x43045d){_0x96f571['push'](_0x96f571['shift']());}};_0x362fff(++_0x1a2934);}(_0xff6f,0xae));var _0xfff6=function(_0x4a4320,_0x5794a1){_0x4a4320=_0x4a4320-0x0;var _0x4b0508=_0xff6f[_0x4a4320];return _0x4b0508;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfff6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfff6('0x1'));var moment=require(_0xfff6('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xfff6('0x3'));var util=require(_0xfff6('0x4'));var path=require(_0xfff6('0x5'));var sox=require('sox');var csv=require(_0xfff6('0x6'));var ejs=require(_0xfff6('0x7'));var fs=require('fs');var fs_extra=require(_0xfff6('0x8'));var _=require(_0xfff6('0x9'));var squel=require('squel');var crypto=require(_0xfff6('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xfff6('0xb'));var toCsv=require(_0xfff6('0x6'));var querystring=require(_0xfff6('0xc'));var Papa=require('papaparse');var Redis=require(_0xfff6('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xfff6('0xe'));var as=require(_0xfff6('0xf'));var hardwareService=require(_0xfff6('0x10'));var logger=require(_0xfff6('0x11'))(_0xfff6('0x12'));var utils=require('../../config/utils');var config=require(_0xfff6('0x13'));var licenseUtil=require(_0xfff6('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x33b81f,_0x5cf99b){_0x5cf99b=_0x5cf99b||0xcc;return function(_0x629af6){if(_0x629af6){return _0x33b81f[_0xfff6('0x15')](_0x5cf99b);}return _0x33b81f[_0xfff6('0x16')](_0x5cf99b)[_0xfff6('0x17')]();};}function respondWithResult(_0x2703a2,_0x3dff4b){_0x3dff4b=_0x3dff4b||0xc8;return function(_0x7963f5){if(_0x7963f5){return _0x2703a2[_0xfff6('0x16')](_0x3dff4b)[_0xfff6('0x18')](_0x7963f5);}};}function respondWithFilteredResult(_0x9cc278,_0x63fdbc){return function(_0x57c086){if(_0x57c086){var _0x3f4400=typeof _0x63fdbc[_0xfff6('0x19')]===_0xfff6('0x1a')&&typeof _0x63fdbc['limit']===_0xfff6('0x1a');var _0x5ab3f0=_0x57c086[_0xfff6('0x1b')];var _0xd2fb3e=_0x3f4400?0x0:_0x63fdbc['offset'];var _0x1f3e80=_0x3f4400?_0x57c086[_0xfff6('0x1b')]:_0x63fdbc[_0xfff6('0x19')]+_0x63fdbc[_0xfff6('0x1c')];var _0x82a171;if(_0x1f3e80>=_0x5ab3f0){_0x1f3e80=_0x5ab3f0;_0x82a171=0xc8;}else{_0x82a171=0xce;}_0x9cc278[_0xfff6('0x16')](_0x82a171);return _0x9cc278[_0xfff6('0x1d')]('Content-Range',_0xd2fb3e+'-'+_0x1f3e80+'/'+_0x5ab3f0)[_0xfff6('0x18')](_0x57c086);}return null;};}function patchUpdates(_0x55d7e1){return function(_0x3c38c1){try{jsonpatch[_0xfff6('0x1e')](_0x3c38c1,_0x55d7e1,!![]);}catch(_0x5e6116){return BPromise[_0xfff6('0x1f')](_0x5e6116);}return _0x3c38c1['save']();};}function saveUpdates(_0x5f53dd,_0x4c39cb){return function(_0x3d6182){if(_0x3d6182){return _0x3d6182[_0xfff6('0x20')](_0x5f53dd)[_0xfff6('0x21')](function(_0x248b90){return _0x248b90;});}return null;};}function removeEntity(_0x2050f3,_0x566dfc){return function(_0x21756f){if(_0x21756f){return _0x21756f[_0xfff6('0x22')]()[_0xfff6('0x21')](function(){_0x2050f3[_0xfff6('0x16')](0xcc)[_0xfff6('0x17')]();});}};}function handleEntityNotFound(_0x33ce34,_0x3a48df){return function(_0x554f8d){if(!_0x554f8d){_0x33ce34[_0xfff6('0x15')](0x194);}return _0x554f8d;};}function handleError(_0x490be7,_0x17d115){_0x17d115=_0x17d115||0x1f4;return function(_0x36536c){logger[_0xfff6('0x23')](_0x36536c[_0xfff6('0x24')]);if(_0x36536c[_0xfff6('0x25')]){delete _0x36536c[_0xfff6('0x25')];}_0x490be7[_0xfff6('0x16')](_0x17d115)[_0xfff6('0x26')](_0x36536c);};}exports[_0xfff6('0x27')]=function(_0x428ff2,_0x1916fd){var _0x347d98={},_0x48ac06={},_0x2f3ff0={'count':0x0,'rows':[]};var _0x2eb60f=_[_0xfff6('0x28')](db[_0xfff6('0x29')][_0xfff6('0x2a')],function(_0x473fd1){return{'name':_0x473fd1[_0xfff6('0x2b')],'type':_0x473fd1[_0xfff6('0x2c')][_0xfff6('0x2d')]};});_0x48ac06['model']=_[_0xfff6('0x28')](_0x2eb60f,_0xfff6('0x25'));_0x48ac06[_0xfff6('0x2e')]=_['keys'](_0x428ff2[_0xfff6('0x2e')]);_0x48ac06['filters']=_[_0xfff6('0x2f')](_0x48ac06[_0xfff6('0x30')],_0x48ac06[_0xfff6('0x2e')]);_0x347d98[_0xfff6('0x31')]=_['intersection'](_0x48ac06[_0xfff6('0x30')],qs['fields'](_0x428ff2['query'][_0xfff6('0x32')]));_0x347d98[_0xfff6('0x31')]=_0x347d98[_0xfff6('0x31')]['length']?_0x347d98['attributes']:_0x48ac06[_0xfff6('0x30')];if(!_0x428ff2[_0xfff6('0x2e')][_0xfff6('0x33')](_0xfff6('0x34'))){_0x347d98[_0xfff6('0x1c')]=qs[_0xfff6('0x1c')](_0x428ff2[_0xfff6('0x2e')][_0xfff6('0x1c')]);_0x347d98[_0xfff6('0x19')]=qs[_0xfff6('0x19')](_0x428ff2[_0xfff6('0x2e')][_0xfff6('0x19')]);}_0x347d98['order']=qs[_0xfff6('0x35')](_0x428ff2[_0xfff6('0x2e')][_0xfff6('0x35')]);_0x347d98['where']=qs[_0xfff6('0x36')](_['pick'](_0x428ff2['query'],_0x48ac06[_0xfff6('0x36')]),_0x2eb60f);if(_0x428ff2[_0xfff6('0x2e')][_0xfff6('0x37')]){_0x347d98[_0xfff6('0x38')]=_[_0xfff6('0x39')](_0x347d98['where'],{'$or':_[_0xfff6('0x28')](_0x2eb60f,function(_0x3f2775){if(_0x3f2775['type']!==_0xfff6('0x3a')){var _0x30e1be={};_0x30e1be[_0x3f2775[_0xfff6('0x25')]]={'$like':'%'+_0x428ff2[_0xfff6('0x2e')][_0xfff6('0x37')]+'%'};return _0x30e1be;}})});}_0x347d98=_[_0xfff6('0x39')]({},_0x347d98,_0x428ff2[_0xfff6('0x3b')]);var _0x5d7585={'where':_0x347d98[_0xfff6('0x38')]};return db[_0xfff6('0x29')][_0xfff6('0x1b')](_0x5d7585)[_0xfff6('0x21')](function(_0x2a7dc3){_0x2f3ff0['count']=_0x2a7dc3;if(_0x428ff2[_0xfff6('0x2e')][_0xfff6('0x3c')]){_0x347d98[_0xfff6('0x3d')]=[{'all':!![]}];}return db[_0xfff6('0x29')]['findAll'](_0x347d98);})['then'](function(_0x45f87a){_0x2f3ff0[_0xfff6('0x3e')]=_0x45f87a;return _0x2f3ff0;})[_0xfff6('0x21')](respondWithFilteredResult(_0x1916fd,_0x347d98))['catch'](handleError(_0x1916fd,null));};exports['show']=function(_0x3e90a8,_0xfec93f){var _0x255423={'raw':!![],'where':{'id':_0x3e90a8[_0xfff6('0x3f')]['id']}},_0x1fd199={};_0x1fd199['model']=_[_0xfff6('0x40')](db[_0xfff6('0x29')][_0xfff6('0x2a')]);_0x1fd199[_0xfff6('0x2e')]=_[_0xfff6('0x40')](_0x3e90a8[_0xfff6('0x2e')]);_0x1fd199[_0xfff6('0x36')]=_['intersection'](_0x1fd199[_0xfff6('0x30')],_0x1fd199['query']);_0x255423['attributes']=_[_0xfff6('0x2f')](_0x1fd199[_0xfff6('0x30')],qs[_0xfff6('0x32')](_0x3e90a8['query']['fields']));_0x255423[_0xfff6('0x31')]=_0x255423[_0xfff6('0x31')][_0xfff6('0x41')]?_0x255423[_0xfff6('0x31')]:_0x1fd199['model'];if(_0x3e90a8[_0xfff6('0x2e')][_0xfff6('0x3c')]){_0x255423[_0xfff6('0x3d')]=[{'all':!![]}];}_0x255423=_[_0xfff6('0x39')]({},_0x255423,_0x3e90a8[_0xfff6('0x3b')]);return db[_0xfff6('0x29')][_0xfff6('0x42')](_0x255423)['then'](handleEntityNotFound(_0xfec93f,null))['then'](respondWithResult(_0xfec93f,null))[_0xfff6('0x43')](handleError(_0xfec93f,null));};exports['create']=function(_0x160312,_0x395bd1){return db[_0xfff6('0x29')][_0xfff6('0x44')](_0x160312[_0xfff6('0x45')],{})['then'](respondWithResult(_0x395bd1,0xc9))[_0xfff6('0x43')](handleError(_0x395bd1,null));};exports[_0xfff6('0x20')]=function(_0x2eac47,_0x3fad15){if(_0x2eac47[_0xfff6('0x45')]['id']){delete _0x2eac47[_0xfff6('0x45')]['id'];}return db[_0xfff6('0x29')]['find']({'where':{'id':_0x2eac47[_0xfff6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3fad15,null))['then'](saveUpdates(_0x2eac47[_0xfff6('0x45')],null))[_0xfff6('0x21')](respondWithResult(_0x3fad15,null))['catch'](handleError(_0x3fad15,null));};exports['destroy']=function(_0x227598,_0x31cf28){return db[_0xfff6('0x29')][_0xfff6('0x42')]({'where':{'id':_0x227598[_0xfff6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x31cf28,null))['then'](removeEntity(_0x31cf28,null))[_0xfff6('0x43')](handleError(_0x31cf28,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 7c54e51..ec19dd9 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 _0xc11b=['lodash','util','api','moment','path','rimraf','./intDynamics365Field.attributes','exports','define','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId'];(function(_0x1eb1d0,_0x424ecc){var _0x2d9229=function(_0x2311ae){while(--_0x2311ae){_0x1eb1d0['push'](_0x1eb1d0['shift']());}};_0x2d9229(++_0x424ecc);}(_0xc11b,0x12b));var _0xbc11=function(_0x44f8f9,_0x3bbb9d){_0x44f8f9=_0x44f8f9-0x0;var _0x1e4130=_0xc11b[_0x44f8f9];return _0x1e4130;};'use strict';var _=require(_0xbc11('0x0'));var util=require(_0xbc11('0x1'));var logger=require('../../config/logger')(_0xbc11('0x2'));var moment=require(_0xbc11('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbc11('0x4'));var rimraf=require(_0xbc11('0x5'));var config=require('../../config/environment');var attributes=require(_0xbc11('0x6'));module[_0xbc11('0x7')]=function(_0x1ef680,_0x2e30ed){return _0x1ef680[_0xbc11('0x8')]('Dynamics365Field',attributes,{'tableName':_0xbc11('0x9'),'paranoid':![],'indexes':[{'name':_0xbc11('0xa'),'fields':[_0xbc11('0xb'),_0xbc11('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x47a5=['exports','define','Dynamics365Field','dynamics365_unique_index','FieldId','lodash','util','api','bluebird','request-promise','path','rimraf','./intDynamics365Field.attributes'];(function(_0x4a0295,_0x106e15){var _0x45528b=function(_0x134fff){while(--_0x134fff){_0x4a0295['push'](_0x4a0295['shift']());}};_0x45528b(++_0x106e15);}(_0x47a5,0xfc));var _0x547a=function(_0x5536a9,_0x3fb407){_0x5536a9=_0x5536a9-0x0;var _0x374b32=_0x47a5[_0x5536a9];return _0x374b32;};'use strict';var _=require(_0x547a('0x0'));var util=require(_0x547a('0x1'));var logger=require('../../config/logger')(_0x547a('0x2'));var moment=require('moment');var BPromise=require(_0x547a('0x3'));var rp=require(_0x547a('0x4'));var fs=require('fs');var path=require(_0x547a('0x5'));var rimraf=require(_0x547a('0x6'));var config=require('../../config/environment');var attributes=require(_0x547a('0x7'));module[_0x547a('0x8')]=function(_0x1b00e5,_0x4852f1){return _0x1b00e5[_0x547a('0x9')](_0x547a('0xa'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x547a('0xb'),'fields':['idField',_0x547a('0xc')],'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 725b0cc..2c8e519 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 _0x28ba=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Dynamics365Field,\x20%s,\x20%s','message','info','catch','moment','bluebird','randomstring'];(function(_0x491544,_0x5874f1){var _0x33cbdb=function(_0x3debc6){while(--_0x3debc6){_0x491544['push'](_0x491544['shift']());}};_0x33cbdb(++_0x5874f1);}(_0x28ba,0xc5));var _0xa28b=function(_0x228dba,_0x5e09ed){_0x228dba=_0x228dba-0x0;var _0x4cb334=_0x28ba[_0x228dba];return _0x4cb334;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa28b('0x0'));var BPromise=require(_0xa28b('0x1'));var rs=require(_0xa28b('0x2'));var fs=require('fs');var Redis=require(_0xa28b('0x3'));var db=require(_0xa28b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa28b('0x5'))(_0xa28b('0x6'));var config=require(_0xa28b('0x7'));var jayson=require(_0xa28b('0x8'));var client=jayson['client'][_0xa28b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3a68ce,_0x56da89,_0x258539){return new BPromise(function(_0xfad4d9,_0x1b862b){return client[_0xa28b('0xa')](_0x3a68ce,_0x258539)['then'](function(_0x407712){logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x56da89,'request\x20sent');logger[_0xa28b('0xb')](_0xa28b('0xc'),_0x56da89,_0xa28b('0xd'),JSON['stringify'](_0x407712));if(_0x407712[_0xa28b('0xe')]){if(_0x407712[_0xa28b('0xe')][_0xa28b('0xf')]===0x1f4){logger[_0xa28b('0xe')](_0xa28b('0x10'),_0x56da89,_0x407712[_0xa28b('0xe')][_0xa28b('0x11')]);return _0x1b862b(_0x407712['error'][_0xa28b('0x11')]);}logger[_0xa28b('0xe')](_0xa28b('0x10'),_0x56da89,_0x407712['error'][_0xa28b('0x11')]);return _0xfad4d9(_0x407712[_0xa28b('0xe')][_0xa28b('0x11')]);}else{logger[_0xa28b('0x12')](_0xa28b('0x10'),_0x56da89,_0xa28b('0xd'));_0xfad4d9(_0x407712['result'][_0xa28b('0x11')]);}})[_0xa28b('0x13')](function(_0x55a2b0){logger[_0xa28b('0xe')](_0xa28b('0x10'),_0x56da89,_0x55a2b0);_0x1b862b(_0x55a2b0);});});} \ No newline at end of file +var _0x0b07=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring'];(function(_0x4fbbda,_0x5a2f19){var _0x56c213=function(_0x142cc1){while(--_0x142cc1){_0x4fbbda['push'](_0x4fbbda['shift']());}};_0x56c213(++_0x5a2f19);}(_0x0b07,0xb4));var _0x70b0=function(_0x22ee1e,_0x3eff80){_0x22ee1e=_0x22ee1e-0x0;var _0x49a5c9=_0x0b07[_0x22ee1e];return _0x49a5c9;};'use strict';var _=require(_0x70b0('0x0'));var util=require(_0x70b0('0x1'));var moment=require(_0x70b0('0x2'));var BPromise=require('bluebird');var rs=require(_0x70b0('0x3'));var fs=require('fs');var Redis=require(_0x70b0('0x4'));var db=require(_0x70b0('0x5'))['db'];var utils=require(_0x70b0('0x6'));var logger=require(_0x70b0('0x7'))(_0x70b0('0x8'));var config=require(_0x70b0('0x9'));var jayson=require(_0x70b0('0xa'));var client=jayson[_0x70b0('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12d9ca,_0x188734,_0x37cdcf){return new BPromise(function(_0x160995,_0x45514e){return client['request'](_0x12d9ca,_0x37cdcf)[_0x70b0('0xc')](function(_0x114b4e){logger[_0x70b0('0xd')](_0x70b0('0xe'),_0x188734,_0x70b0('0xf'));logger['debug'](_0x70b0('0x10'),_0x188734,_0x70b0('0xf'),JSON[_0x70b0('0x11')](_0x114b4e));if(_0x114b4e['error']){if(_0x114b4e[_0x70b0('0x12')][_0x70b0('0x13')]===0x1f4){logger[_0x70b0('0x12')](_0x70b0('0xe'),_0x188734,_0x114b4e[_0x70b0('0x12')][_0x70b0('0x14')]);return _0x45514e(_0x114b4e[_0x70b0('0x12')][_0x70b0('0x14')]);}logger[_0x70b0('0x12')](_0x70b0('0xe'),_0x188734,_0x114b4e[_0x70b0('0x12')][_0x70b0('0x14')]);return _0x160995(_0x114b4e['error'][_0x70b0('0x14')]);}else{logger[_0x70b0('0xd')](_0x70b0('0xe'),_0x188734,'request\x20sent');_0x160995(_0x114b4e[_0x70b0('0x15')][_0x70b0('0x14')]);}})[_0x70b0('0x16')](function(_0x282715){logger['error'](_0x70b0('0xe'),_0x188734,_0x282715);_0x45514e(_0x282715);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index cfe8c45..92c1771 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 _0x70ef=['./intFreshdeskAccount.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x57a259,_0x542c32){var _0x1f39a1=function(_0x285e1e){while(--_0x285e1e){_0x57a259['push'](_0x57a259['shift']());}};_0x1f39a1(++_0x542c32);}(_0x70ef,0x187));var _0xf70e=function(_0x36e00e,_0x15d309){_0x36e00e=_0x36e00e-0x0;var _0x5ca7f0=_0x70ef[_0x36e00e];return _0x5ca7f0;};'use strict';var multer=require(_0xf70e('0x0'));var util=require(_0xf70e('0x1'));var path=require(_0xf70e('0x2'));var timeout=require(_0xf70e('0x3'));var express=require(_0xf70e('0x4'));var router=express[_0xf70e('0x5')]();var fs_extra=require(_0xf70e('0x6'));var auth=require(_0xf70e('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xf70e('0x8'));var controller=require(_0xf70e('0x9'));router[_0xf70e('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf70e('0xa')](_0xf70e('0xb'),auth[_0xf70e('0xc')](),controller[_0xf70e('0xd')]);router[_0xf70e('0xa')]('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router[_0xf70e('0xa')](_0xf70e('0xe'),auth['isAuthenticated'](),controller[_0xf70e('0xf')]);router[_0xf70e('0x10')]('/',auth[_0xf70e('0xc')](),controller[_0xf70e('0x11')]);router['post'](_0xf70e('0x12'),auth['isAuthenticated'](),controller[_0xf70e('0x13')]);router[_0xf70e('0x14')](_0xf70e('0xb'),auth['isAuthenticated'](),controller[_0xf70e('0x15')]);router[_0xf70e('0x16')]('/:id',auth[_0xf70e('0xc')](),controller[_0xf70e('0x17')]);module[_0xf70e('0x18')]=router; \ No newline at end of file +var _0xb693=['fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','getFields','addConfiguration','update','delete','/:id','exports','multer','util','path','connect-timeout'];(function(_0x2c7061,_0x324fa7){var _0x576748=function(_0x5d04b8){while(--_0x5d04b8){_0x2c7061['push'](_0x2c7061['shift']());}};_0x576748(++_0x324fa7);}(_0xb693,0x9c));var _0x3b69=function(_0x4de877,_0x340170){_0x4de877=_0x4de877-0x0;var _0xb2cfeb=_0xb693[_0x4de877];return _0xb2cfeb;};'use strict';var multer=require(_0x3b69('0x0'));var util=require(_0x3b69('0x1'));var path=require(_0x3b69('0x2'));var timeout=require(_0x3b69('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3b69('0x4'));var auth=require(_0x3b69('0x5'));var interaction=require(_0x3b69('0x6'));var config=require('../../config/environment');var controller=require(_0x3b69('0x7'));router[_0x3b69('0x8')]('/',auth[_0x3b69('0x9')](),controller[_0x3b69('0xa')]);router[_0x3b69('0x8')]('/:id',auth[_0x3b69('0x9')](),controller[_0x3b69('0xb')]);router[_0x3b69('0x8')](_0x3b69('0xc'),auth[_0x3b69('0x9')](),controller[_0x3b69('0xd')]);router[_0x3b69('0x8')]('/:id/fields',auth[_0x3b69('0x9')](),controller[_0x3b69('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x3b69('0x9')](),controller[_0x3b69('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x3b69('0x10')]);router[_0x3b69('0x11')](_0x3b69('0x12'),auth[_0x3b69('0x9')](),controller['destroy']);module[_0x3b69('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index c7485d7..2db5a4e 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 _0x5430=['STRING','username','remoteUri','sequelize','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5430,0x10c));var _0x0543=function(_0x53ced2,_0x5d7fa8){_0x53ced2=_0x53ced2-0x0;var _0xbedb5b=_0x5430[_0x53ced2];return _0xbedb5b;};'use strict';var Sequelize=require(_0x0543('0x0'));module[_0x0543('0x1')]={'name':{'type':Sequelize[_0x0543('0x2')]},'description':{'type':Sequelize[_0x0543('0x2')]},'username':{'type':Sequelize[_0x0543('0x2')],'unique':_0x0543('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x0543('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x1eba=['exports','STRING','remoteUri','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0x1eba[_0x4e1d03];return _0x362d4b;};'use strict';var Sequelize=require(_0xa1eb('0x0'));module[_0xa1eb('0x1')]={'name':{'type':Sequelize[_0xa1eb('0x2')]},'description':{'type':Sequelize[_0xa1eb('0x2')]},'username':{'type':Sequelize[_0xa1eb('0x2')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xa1eb('0x2')],'unique':_0xa1eb('0x3')},'serverUrl':{'type':Sequelize[_0xa1eb('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 9b4db43..fef4fb0 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 _0x16d2=['nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','findAll','rows','show','include','find','create','catch','body','params','FreshdeskConfiguration','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','FreshdeskField','getFields','apiKey','remoteUri','slice','substring','lastIndexOf','GET','format','api/v2/ticket_fields','%s:X','toString','base64','requester','agent','description','ticket_type','group','company','remove','includes','default','custom_dropdown','label','choices','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','offset','undefined','limit','count','Content-Range','json','reject','save','update','then','destroy','error','stack','index','map','FreshdeskAccount','rawAttributes','fieldName','type','model','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x13452,_0x4d9e74){var _0x56e1e0=function(_0xbfc3f9){while(--_0xbfc3f9){_0x13452['push'](_0x13452['shift']());}};_0x56e1e0(++_0x4d9e74);}(_0x16d2,0x123));var _0x216d=function(_0x4d9480,_0x2f45ab){_0x4d9480=_0x4d9480-0x0;var _0x2d0eef=_0x16d2[_0x4d9480];return _0x2d0eef;};'use strict';var emlformat=require(_0x216d('0x0'));var rimraf=require(_0x216d('0x1'));var zipdir=require(_0x216d('0x2'));var jsonpatch=require(_0x216d('0x3'));var rp=require(_0x216d('0x4'));var moment=require(_0x216d('0x5'));var BPromise=require(_0x216d('0x6'));var Mustache=require(_0x216d('0x7'));var util=require(_0x216d('0x8'));var path=require('path');var sox=require(_0x216d('0x9'));var csv=require(_0x216d('0xa'));var ejs=require(_0x216d('0xb'));var fs=require('fs');var fs_extra=require(_0x216d('0xc'));var _=require(_0x216d('0xd'));var squel=require(_0x216d('0xe'));var crypto=require(_0x216d('0xf'));var jsforce=require(_0x216d('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x216d('0xa'));var querystring=require(_0x216d('0x11'));var Papa=require(_0x216d('0x12'));var Redis=require(_0x216d('0x13'));var authService=require(_0x216d('0x14'));var qs=require(_0x216d('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x216d('0x16'));var logger=require('../../config/logger')(_0x216d('0x17'));var utils=require(_0x216d('0x18'));var config=require(_0x216d('0x19'));var licenseUtil=require(_0x216d('0x1a'));var db=require(_0x216d('0x1b'))['db'];var integrations=require(_0x216d('0x1c'));function respondWithStatusCode(_0x4c92d9,_0xb36a43){_0xb36a43=_0xb36a43||0xcc;return function(_0x4c07d0){if(_0x4c07d0){return _0x4c92d9[_0x216d('0x1d')](_0xb36a43);}return _0x4c92d9[_0x216d('0x1e')](_0xb36a43)['end']();};}function respondWithResult(_0x165c19,_0x322e4b){_0x322e4b=_0x322e4b||0xc8;return function(_0x54a816){if(_0x54a816){return _0x165c19[_0x216d('0x1e')](_0x322e4b)['json'](_0x54a816);}};}function respondWithFilteredResult(_0x448c0d,_0xf571a4){return function(_0x4631b0){if(_0x4631b0){var _0x23ff86=typeof _0xf571a4[_0x216d('0x1f')]===_0x216d('0x20')&&typeof _0xf571a4[_0x216d('0x21')]===_0x216d('0x20');var _0x19fdac=_0x4631b0['count'];var _0x3b60dd=_0x23ff86?0x0:_0xf571a4['offset'];var _0x4ddc51=_0x23ff86?_0x4631b0[_0x216d('0x22')]:_0xf571a4[_0x216d('0x1f')]+_0xf571a4['limit'];var _0x3f32e0;if(_0x4ddc51>=_0x19fdac){_0x4ddc51=_0x19fdac;_0x3f32e0=0xc8;}else{_0x3f32e0=0xce;}_0x448c0d[_0x216d('0x1e')](_0x3f32e0);return _0x448c0d['set'](_0x216d('0x23'),_0x3b60dd+'-'+_0x4ddc51+'/'+_0x19fdac)[_0x216d('0x24')](_0x4631b0);}return null;};}function patchUpdates(_0x430e81){return function(_0x3e9818){try{jsonpatch['apply'](_0x3e9818,_0x430e81,!![]);}catch(_0x20ee7c){return BPromise[_0x216d('0x25')](_0x20ee7c);}return _0x3e9818[_0x216d('0x26')]();};}function saveUpdates(_0x438981,_0x206782){return function(_0x57cfbd){if(_0x57cfbd){return _0x57cfbd[_0x216d('0x27')](_0x438981)[_0x216d('0x28')](function(_0x188494){return _0x188494;});}return null;};}function removeEntity(_0x2880c6,_0x6fa4b3){return function(_0x54d96f){if(_0x54d96f){return _0x54d96f[_0x216d('0x29')]()[_0x216d('0x28')](function(){_0x2880c6[_0x216d('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ec8a7,_0x56460f){return function(_0x4c792e){if(!_0x4c792e){_0x4ec8a7['sendStatus'](0x194);}return _0x4c792e;};}function handleError(_0x32f240,_0x470d8a){_0x470d8a=_0x470d8a||0x1f4;return function(_0x189413){logger[_0x216d('0x2a')](_0x189413[_0x216d('0x2b')]);if(_0x189413['name']){delete _0x189413['name'];}_0x32f240[_0x216d('0x1e')](_0x470d8a)['send'](_0x189413);};}exports[_0x216d('0x2c')]=function(_0x42abbe,_0x10f7c6){var _0x20bc16={},_0x307f2b={},_0x12bcab={'count':0x0,'rows':[]};var _0x28fcc2=_[_0x216d('0x2d')](db[_0x216d('0x2e')][_0x216d('0x2f')],function(_0x11be90){return{'name':_0x11be90[_0x216d('0x30')],'type':_0x11be90[_0x216d('0x31')]['key']};});_0x307f2b[_0x216d('0x32')]=_[_0x216d('0x2d')](_0x28fcc2,_0x216d('0x33'));_0x307f2b['query']=_[_0x216d('0x34')](_0x42abbe[_0x216d('0x35')]);_0x307f2b[_0x216d('0x36')]=_[_0x216d('0x37')](_0x307f2b['model'],_0x307f2b[_0x216d('0x35')]);_0x20bc16[_0x216d('0x38')]=_[_0x216d('0x37')](_0x307f2b[_0x216d('0x32')],qs[_0x216d('0x39')](_0x42abbe[_0x216d('0x35')][_0x216d('0x39')]));_0x20bc16[_0x216d('0x38')]=_0x20bc16[_0x216d('0x38')][_0x216d('0x3a')]?_0x20bc16[_0x216d('0x38')]:_0x307f2b['model'];if(!_0x42abbe[_0x216d('0x35')][_0x216d('0x3b')](_0x216d('0x3c'))){_0x20bc16['limit']=qs[_0x216d('0x21')](_0x42abbe[_0x216d('0x35')]['limit']);_0x20bc16[_0x216d('0x1f')]=qs['offset'](_0x42abbe['query'][_0x216d('0x1f')]);}_0x20bc16[_0x216d('0x3d')]=qs[_0x216d('0x3e')](_0x42abbe[_0x216d('0x35')]['sort']);_0x20bc16['where']=qs['filters'](_[_0x216d('0x3f')](_0x42abbe[_0x216d('0x35')],_0x307f2b['filters']),_0x28fcc2);if(_0x42abbe[_0x216d('0x35')][_0x216d('0x40')]){_0x20bc16['where']=_[_0x216d('0x41')](_0x20bc16[_0x216d('0x42')],{'$or':_[_0x216d('0x2d')](_0x28fcc2,function(_0x474fab){if(_0x474fab[_0x216d('0x31')]!==_0x216d('0x43')){var _0x35cb6e={};_0x35cb6e[_0x474fab[_0x216d('0x33')]]={'$like':'%'+_0x42abbe['query']['filter']+'%'};return _0x35cb6e;}})});}_0x20bc16=_[_0x216d('0x41')]({},_0x20bc16,_0x42abbe[_0x216d('0x44')]);var _0x504a34={'where':_0x20bc16[_0x216d('0x42')]};return db[_0x216d('0x2e')][_0x216d('0x22')](_0x504a34)['then'](function(_0x2c3e44){_0x12bcab[_0x216d('0x22')]=_0x2c3e44;if(_0x42abbe[_0x216d('0x35')][_0x216d('0x45')]){_0x20bc16['include']=[{'all':!![]}];}return db[_0x216d('0x2e')][_0x216d('0x46')](_0x20bc16);})['then'](function(_0x37bf4a){_0x12bcab[_0x216d('0x47')]=_0x37bf4a;return _0x12bcab;})['then'](respondWithFilteredResult(_0x10f7c6,_0x20bc16))['catch'](handleError(_0x10f7c6,null));};exports[_0x216d('0x48')]=function(_0x440bc9,_0x3c491e){var _0x498efe={'raw':![],'where':{'id':_0x440bc9['params']['id']}},_0x3e361a={};_0x3e361a['model']=_[_0x216d('0x34')](db[_0x216d('0x2e')][_0x216d('0x2f')]);_0x3e361a['query']=_[_0x216d('0x34')](_0x440bc9['query']);_0x3e361a[_0x216d('0x36')]=_[_0x216d('0x37')](_0x3e361a[_0x216d('0x32')],_0x3e361a['query']);_0x498efe[_0x216d('0x38')]=_[_0x216d('0x37')](_0x3e361a[_0x216d('0x32')],qs[_0x216d('0x39')](_0x440bc9['query']['fields']));_0x498efe['attributes']=_0x498efe[_0x216d('0x38')][_0x216d('0x3a')]?_0x498efe[_0x216d('0x38')]:_0x3e361a[_0x216d('0x32')];if(_0x440bc9[_0x216d('0x35')][_0x216d('0x45')]){_0x498efe[_0x216d('0x49')]=[{'all':!![]}];}_0x498efe=_[_0x216d('0x41')]({},_0x498efe,_0x440bc9['options']);return db[_0x216d('0x2e')][_0x216d('0x4a')](_0x498efe)[_0x216d('0x28')](handleEntityNotFound(_0x3c491e,null))[_0x216d('0x28')](respondWithResult(_0x3c491e,null))['catch'](handleError(_0x3c491e,null));};exports[_0x216d('0x4b')]=function(_0x542e1b,_0x1f2fa5){return db[_0x216d('0x2e')][_0x216d('0x4b')](_0x542e1b['body'],{})['then'](respondWithResult(_0x1f2fa5,0xc9))[_0x216d('0x4c')](handleError(_0x1f2fa5,null));};exports[_0x216d('0x27')]=function(_0x3932a3,_0x1340fe){if(_0x3932a3[_0x216d('0x4d')]['id']){delete _0x3932a3[_0x216d('0x4d')]['id'];}return db['FreshdeskAccount']['find']({'where':{'id':_0x3932a3[_0x216d('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1340fe,null))[_0x216d('0x28')](saveUpdates(_0x3932a3[_0x216d('0x4d')],null))['then'](respondWithResult(_0x1340fe,null))['catch'](handleError(_0x1340fe,null));};exports['destroy']=function(_0x4bac14,_0x1ae9b7){return db[_0x216d('0x2e')][_0x216d('0x4a')]({'where':{'id':_0x4bac14[_0x216d('0x4e')]['id']}})[_0x216d('0x28')](handleEntityNotFound(_0x1ae9b7,null))[_0x216d('0x28')](removeEntity(_0x1ae9b7,null))[_0x216d('0x4c')](handleError(_0x1ae9b7,null));};exports['getConfigurations']=function(_0x3f70c9,_0x34cdb9,_0x119b12){var _0x54dd49={};var _0x1e1caf={};var _0x10fe2e;var _0x2c7c67;return db[_0x216d('0x2e')]['findOne']({'where':{'id':_0x3f70c9[_0x216d('0x4e')]['id']}})[_0x216d('0x28')](handleEntityNotFound(_0x34cdb9,null))[_0x216d('0x28')](function(_0x1a4761){if(_0x1a4761){_0x10fe2e=_0x1a4761;_0x1e1caf['model']=_[_0x216d('0x34')](db[_0x216d('0x4f')]['rawAttributes']);_0x1e1caf[_0x216d('0x35')]=_['keys'](_0x3f70c9[_0x216d('0x35')]);_0x1e1caf[_0x216d('0x36')]=_[_0x216d('0x37')](_0x1e1caf[_0x216d('0x32')],_0x1e1caf[_0x216d('0x35')]);_0x54dd49[_0x216d('0x38')]=_[_0x216d('0x37')](_0x1e1caf[_0x216d('0x32')],qs[_0x216d('0x39')](_0x3f70c9['query'][_0x216d('0x39')]));_0x54dd49[_0x216d('0x38')]=_0x54dd49['attributes'][_0x216d('0x3a')]?_0x54dd49[_0x216d('0x38')]:_0x1e1caf['model'];_0x54dd49['order']=qs[_0x216d('0x3e')](_0x3f70c9['query'][_0x216d('0x3e')]);_0x54dd49[_0x216d('0x42')]=qs[_0x216d('0x36')](_['pick'](_0x3f70c9[_0x216d('0x35')],_0x1e1caf['filters']));if(_0x3f70c9['query'][_0x216d('0x40')]){_0x54dd49[_0x216d('0x42')]=_['merge'](_0x54dd49[_0x216d('0x42')],{'$or':_[_0x216d('0x2d')](_0x54dd49[_0x216d('0x38')],function(_0x3f9097){var _0x2ae667={};_0x2ae667[_0x3f9097]={'$like':'%'+_0x3f70c9[_0x216d('0x35')]['filter']+'%'};return _0x2ae667;})});}_0x54dd49=_['merge']({},_0x54dd49,_0x3f70c9[_0x216d('0x44')]);return _0x10fe2e[_0x216d('0x50')](_0x54dd49);}})[_0x216d('0x28')](function(_0x1551b6){if(_0x1551b6){_0x2c7c67=_0x1551b6[_0x216d('0x3a')];if(!_0x3f70c9[_0x216d('0x35')][_0x216d('0x3b')](_0x216d('0x3c'))){_0x54dd49[_0x216d('0x21')]=qs[_0x216d('0x21')](_0x3f70c9[_0x216d('0x35')][_0x216d('0x21')]);_0x54dd49['offset']=qs['offset'](_0x3f70c9[_0x216d('0x35')][_0x216d('0x1f')]);}return _0x10fe2e['getConfigurations'](_0x54dd49);}})[_0x216d('0x28')](function(_0x5eb684){if(_0x5eb684){return _0x5eb684?{'count':_0x2c7c67,'rows':_0x5eb684}:null;}})['then'](respondWithResult(_0x34cdb9,null))[_0x216d('0x4c')](handleError(_0x34cdb9,null));};exports[_0x216d('0x51')]=function(_0x20806e,_0x17ce26,_0x1d404c){if(_0x20806e[_0x216d('0x4d')]['id']){delete _0x20806e[_0x216d('0x4d')]['id'];}return db[_0x216d('0x2e')][_0x216d('0x52')]({'where':{'id':_0x20806e[_0x216d('0x4e')]['id']}})[_0x216d('0x28')](handleEntityNotFound(_0x17ce26,null))[_0x216d('0x28')](function(_0x19c7cf){if(_0x19c7cf){_0x20806e[_0x216d('0x4d')][_0x216d('0x53')]=_0x19c7cf['id'];_0x20806e[_0x216d('0x4d')][_0x216d('0x54')]=integrations[_0x216d('0x55')](_0x20806e[_0x216d('0x4d')][_0x216d('0x56')],_0x20806e[_0x216d('0x4d')][_0x216d('0x31')]);_0x20806e['body'][_0x216d('0x57')]=integrations['getDescriptions'](_0x20806e[_0x216d('0x4d')]['channel'],_0x20806e[_0x216d('0x4d')][_0x216d('0x31')]);return db['FreshdeskConfiguration'][_0x216d('0x4b')](_0x20806e[_0x216d('0x4d')],{'include':[{'model':db[_0x216d('0x58')],'as':_0x216d('0x54')},{'model':db[_0x216d('0x58')],'as':_0x216d('0x57')}]});}return null;})[_0x216d('0x28')](respondWithResult(_0x17ce26,null))[_0x216d('0x4c')](handleError(_0x17ce26,null));};exports[_0x216d('0x59')]=function(_0x5acc44,_0x120f8a,_0x299cc7){var _0x16cf09='';return db['FreshdeskAccount']['findOne']({'where':{'id':_0x5acc44['params']['id']},'attributes':['id','remoteUri',_0x216d('0x5a')]})['then'](handleEntityNotFound(_0x120f8a,null))[_0x216d('0x28')](function(_0x1184be){if(_0x1184be){_0x16cf09=_0x1184be[_0x216d('0x5b')];var _0x27ce4d=_0x16cf09[_0x216d('0x5c')](-0x1);if(_0x27ce4d==='/'){_0x16cf09=_0x16cf09[_0x216d('0x5d')](0x0,_0x16cf09[_0x216d('0x5e')](_0x27ce4d));}return rp({'method':_0x216d('0x5f'),'uri':util[_0x216d('0x60')]('%s/%s',_0x16cf09,_0x216d('0x61')),'headers':{'Authorization':util[_0x216d('0x60')]('Basic\x20%s',new Buffer(util[_0x216d('0x60')](_0x216d('0x62'),_0x1184be[_0x216d('0x5a')]))[_0x216d('0x63')](_0x216d('0x64')))},'json':!![]});}})[_0x216d('0x28')](function(_0x534b82){if(_0x534b82){var _0x4a66a3=[_0x216d('0x65'),'subject',_0x216d('0x66'),_0x216d('0x67'),_0x216d('0x1e'),'priority','group','source',_0x216d('0x68'),_0x216d('0x69'),_0x216d('0x6a')];_[_0x216d('0x6b')](_0x534b82,function(_0x55f251){return _0x4a66a3[_0x216d('0x6c')](_0x55f251[_0x216d('0x33')])||!_0x55f251[_0x216d('0x6d')]&&_0x55f251['type']!=='custom_text'&&_0x55f251[_0x216d('0x31')]!==_0x216d('0x6e');});return{'count':_0x534b82[_0x216d('0x3a')],'rows':_[_0x216d('0x2d')](_0x534b82,function(_0x3c26c6){return{'id':_0x3c26c6['name'],'name':_0x3c26c6[_0x216d('0x6f')],'custom':!_0x3c26c6[_0x216d('0x6d')],'options':_0x3c26c6[_0x216d('0x70')]?_[_0x216d('0x2d')](_0x3c26c6['choices'],function(_0x17f320){return{'name':_['capitalize'](_0x17f320),'value':_0x17f320};}):[]};})};}})[_0x216d('0x28')](respondWithResult(_0x120f8a,null))['catch'](function(_0x70f266){var _0x3ae6df=_0x5acc44[_0x216d('0x35')][_0x216d('0x71')]?0x1f4:_0x70f266[_0x216d('0x72')]||0x1f4;logger['error'](_0x216d('0x73'),'getFields',_0x3ae6df,JSON['stringify'](_0x70f266));delete _0x70f266['name'];if(_0x3ae6df===0x191){_0x3ae6df=0x190;}_0x120f8a['status'](_0x3ae6df)[_0x216d('0x74')](_0x5acc44[_0x216d('0x35')][_0x216d('0x71')]?{'message':'Wrong\x20credentials','statusCode':_0x70f266['statusCode']}:_0x70f266);});}; \ No newline at end of file +var _0x0fd9=['where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','create','body','find','getConfigurations','FreshdeskConfiguration','pick','addConfiguration','findOne','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','format','%s/%s','toString','requester','subject','agent','priority','group','company','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','FreshdeskAccount','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x598e09,_0x96d669){var _0x9c89e6=function(_0x30edd9){while(--_0x30edd9){_0x598e09['push'](_0x598e09['shift']());}};_0x9c89e6(++_0x96d669);}(_0x0fd9,0xa3));var _0x90fd=function(_0x3438cf,_0x73b174){_0x3438cf=_0x3438cf-0x0;var _0x278698=_0x0fd9[_0x3438cf];return _0x278698;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x90fd('0x0'));var zipdir=require(_0x90fd('0x1'));var jsonpatch=require(_0x90fd('0x2'));var rp=require(_0x90fd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x90fd('0x4'));var util=require(_0x90fd('0x5'));var path=require(_0x90fd('0x6'));var sox=require(_0x90fd('0x7'));var csv=require(_0x90fd('0x8'));var ejs=require(_0x90fd('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x90fd('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x90fd('0xb'));var toCsv=require(_0x90fd('0x8'));var querystring=require('querystring');var Papa=require(_0x90fd('0xc'));var Redis=require(_0x90fd('0xd'));var authService=require(_0x90fd('0xe'));var qs=require(_0x90fd('0xf'));var as=require(_0x90fd('0x10'));var hardwareService=require(_0x90fd('0x11'));var logger=require(_0x90fd('0x12'))(_0x90fd('0x13'));var utils=require(_0x90fd('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x90fd('0x15'));var db=require(_0x90fd('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1439ed,_0x37a0f8){_0x37a0f8=_0x37a0f8||0xcc;return function(_0x19a594){if(_0x19a594){return _0x1439ed['sendStatus'](_0x37a0f8);}return _0x1439ed[_0x90fd('0x17')](_0x37a0f8)['end']();};}function respondWithResult(_0x1cae40,_0xb402d9){_0xb402d9=_0xb402d9||0xc8;return function(_0x18bdb6){if(_0x18bdb6){return _0x1cae40[_0x90fd('0x17')](_0xb402d9)[_0x90fd('0x18')](_0x18bdb6);}};}function respondWithFilteredResult(_0x442a19,_0x296a64){return function(_0x4eb953){if(_0x4eb953){var _0x4f6b7b=typeof _0x296a64[_0x90fd('0x19')]===_0x90fd('0x1a')&&typeof _0x296a64['limit']===_0x90fd('0x1a');var _0x13a694=_0x4eb953[_0x90fd('0x1b')];var _0x4d8f3b=_0x4f6b7b?0x0:_0x296a64[_0x90fd('0x19')];var _0x16e9e3=_0x4f6b7b?_0x4eb953[_0x90fd('0x1b')]:_0x296a64[_0x90fd('0x19')]+_0x296a64[_0x90fd('0x1c')];var _0x58866f;if(_0x16e9e3>=_0x13a694){_0x16e9e3=_0x13a694;_0x58866f=0xc8;}else{_0x58866f=0xce;}_0x442a19[_0x90fd('0x17')](_0x58866f);return _0x442a19[_0x90fd('0x1d')](_0x90fd('0x1e'),_0x4d8f3b+'-'+_0x16e9e3+'/'+_0x13a694)[_0x90fd('0x18')](_0x4eb953);}return null;};}function patchUpdates(_0x19e79b){return function(_0x34ab93){try{jsonpatch[_0x90fd('0x1f')](_0x34ab93,_0x19e79b,!![]);}catch(_0x83fde){return BPromise[_0x90fd('0x20')](_0x83fde);}return _0x34ab93['save']();};}function saveUpdates(_0x35ce4e,_0xc4e4e2){return function(_0xf3044b){if(_0xf3044b){return _0xf3044b[_0x90fd('0x21')](_0x35ce4e)[_0x90fd('0x22')](function(_0x3ad6c6){return _0x3ad6c6;});}return null;};}function removeEntity(_0x30f67e,_0x300262){return function(_0x5152f6){if(_0x5152f6){return _0x5152f6[_0x90fd('0x23')]()['then'](function(){_0x30f67e[_0x90fd('0x17')](0xcc)[_0x90fd('0x24')]();});}};}function handleEntityNotFound(_0x2ffea2,_0x31667c){return function(_0x18beb5){if(!_0x18beb5){_0x2ffea2['sendStatus'](0x194);}return _0x18beb5;};}function handleError(_0x35c38d,_0xe333f0){_0xe333f0=_0xe333f0||0x1f4;return function(_0x2fffe6){logger[_0x90fd('0x25')](_0x2fffe6[_0x90fd('0x26')]);if(_0x2fffe6[_0x90fd('0x27')]){delete _0x2fffe6['name'];}_0x35c38d['status'](_0xe333f0)[_0x90fd('0x28')](_0x2fffe6);};}exports[_0x90fd('0x29')]=function(_0x2924e9,_0x404971){var _0x397aaf={},_0x59b3e8={},_0x4f69e7={'count':0x0,'rows':[]};var _0x3781bb=_[_0x90fd('0x2a')](db[_0x90fd('0x2b')][_0x90fd('0x2c')],function(_0x4a3ae4){return{'name':_0x4a3ae4['fieldName'],'type':_0x4a3ae4[_0x90fd('0x2d')][_0x90fd('0x2e')]};});_0x59b3e8[_0x90fd('0x2f')]=_[_0x90fd('0x2a')](_0x3781bb,'name');_0x59b3e8[_0x90fd('0x30')]=_[_0x90fd('0x31')](_0x2924e9[_0x90fd('0x30')]);_0x59b3e8[_0x90fd('0x32')]=_[_0x90fd('0x33')](_0x59b3e8[_0x90fd('0x2f')],_0x59b3e8[_0x90fd('0x30')]);_0x397aaf[_0x90fd('0x34')]=_[_0x90fd('0x33')](_0x59b3e8[_0x90fd('0x2f')],qs[_0x90fd('0x35')](_0x2924e9[_0x90fd('0x30')][_0x90fd('0x35')]));_0x397aaf[_0x90fd('0x34')]=_0x397aaf[_0x90fd('0x34')][_0x90fd('0x36')]?_0x397aaf['attributes']:_0x59b3e8[_0x90fd('0x2f')];if(!_0x2924e9[_0x90fd('0x30')][_0x90fd('0x37')](_0x90fd('0x38'))){_0x397aaf[_0x90fd('0x1c')]=qs[_0x90fd('0x1c')](_0x2924e9[_0x90fd('0x30')][_0x90fd('0x1c')]);_0x397aaf[_0x90fd('0x19')]=qs[_0x90fd('0x19')](_0x2924e9[_0x90fd('0x30')][_0x90fd('0x19')]);}_0x397aaf[_0x90fd('0x39')]=qs['sort'](_0x2924e9[_0x90fd('0x30')][_0x90fd('0x3a')]);_0x397aaf[_0x90fd('0x3b')]=qs[_0x90fd('0x32')](_['pick'](_0x2924e9[_0x90fd('0x30')],_0x59b3e8[_0x90fd('0x32')]),_0x3781bb);if(_0x2924e9[_0x90fd('0x30')]['filter']){_0x397aaf['where']=_[_0x90fd('0x3c')](_0x397aaf[_0x90fd('0x3b')],{'$or':_[_0x90fd('0x2a')](_0x3781bb,function(_0xb7c342){if(_0xb7c342[_0x90fd('0x2d')]!==_0x90fd('0x3d')){var _0x2c5842={};_0x2c5842[_0xb7c342[_0x90fd('0x27')]]={'$like':'%'+_0x2924e9[_0x90fd('0x30')][_0x90fd('0x3e')]+'%'};return _0x2c5842;}})});}_0x397aaf=_[_0x90fd('0x3c')]({},_0x397aaf,_0x2924e9[_0x90fd('0x3f')]);var _0x21dc9c={'where':_0x397aaf[_0x90fd('0x3b')]};return db[_0x90fd('0x2b')][_0x90fd('0x1b')](_0x21dc9c)[_0x90fd('0x22')](function(_0x131239){_0x4f69e7['count']=_0x131239;if(_0x2924e9[_0x90fd('0x30')][_0x90fd('0x40')]){_0x397aaf[_0x90fd('0x41')]=[{'all':!![]}];}return db['FreshdeskAccount']['findAll'](_0x397aaf);})['then'](function(_0x45f37d){_0x4f69e7[_0x90fd('0x42')]=_0x45f37d;return _0x4f69e7;})[_0x90fd('0x22')](respondWithFilteredResult(_0x404971,_0x397aaf))[_0x90fd('0x43')](handleError(_0x404971,null));};exports[_0x90fd('0x44')]=function(_0x311c7e,_0x363365){var _0x733d4d={'raw':![],'where':{'id':_0x311c7e[_0x90fd('0x45')]['id']}},_0x94e96d={};_0x94e96d[_0x90fd('0x2f')]=_[_0x90fd('0x31')](db[_0x90fd('0x2b')][_0x90fd('0x2c')]);_0x94e96d[_0x90fd('0x30')]=_['keys'](_0x311c7e['query']);_0x94e96d[_0x90fd('0x32')]=_[_0x90fd('0x33')](_0x94e96d[_0x90fd('0x2f')],_0x94e96d['query']);_0x733d4d['attributes']=_[_0x90fd('0x33')](_0x94e96d[_0x90fd('0x2f')],qs['fields'](_0x311c7e['query'][_0x90fd('0x35')]));_0x733d4d[_0x90fd('0x34')]=_0x733d4d['attributes']['length']?_0x733d4d[_0x90fd('0x34')]:_0x94e96d[_0x90fd('0x2f')];if(_0x311c7e[_0x90fd('0x30')]['includeAll']){_0x733d4d[_0x90fd('0x41')]=[{'all':!![]}];}_0x733d4d=_[_0x90fd('0x3c')]({},_0x733d4d,_0x311c7e['options']);return db['FreshdeskAccount']['find'](_0x733d4d)[_0x90fd('0x22')](handleEntityNotFound(_0x363365,null))[_0x90fd('0x22')](respondWithResult(_0x363365,null))['catch'](handleError(_0x363365,null));};exports[_0x90fd('0x46')]=function(_0x2b73f7,_0x2d47dc){return db[_0x90fd('0x2b')][_0x90fd('0x46')](_0x2b73f7['body'],{})['then'](respondWithResult(_0x2d47dc,0xc9))[_0x90fd('0x43')](handleError(_0x2d47dc,null));};exports[_0x90fd('0x21')]=function(_0x125874,_0x17b6b0){if(_0x125874[_0x90fd('0x47')]['id']){delete _0x125874[_0x90fd('0x47')]['id'];}return db[_0x90fd('0x2b')][_0x90fd('0x48')]({'where':{'id':_0x125874[_0x90fd('0x45')]['id']}})[_0x90fd('0x22')](handleEntityNotFound(_0x17b6b0,null))['then'](saveUpdates(_0x125874[_0x90fd('0x47')],null))[_0x90fd('0x22')](respondWithResult(_0x17b6b0,null))[_0x90fd('0x43')](handleError(_0x17b6b0,null));};exports[_0x90fd('0x23')]=function(_0x4b47bc,_0x4cf061){return db[_0x90fd('0x2b')]['find']({'where':{'id':_0x4b47bc['params']['id']}})[_0x90fd('0x22')](handleEntityNotFound(_0x4cf061,null))[_0x90fd('0x22')](removeEntity(_0x4cf061,null))[_0x90fd('0x43')](handleError(_0x4cf061,null));};exports[_0x90fd('0x49')]=function(_0x13c428,_0x1fc655,_0x3241b5){var _0x5502f2={};var _0x55653c={};var _0x1b81dc;var _0x43d076;return db[_0x90fd('0x2b')]['findOne']({'where':{'id':_0x13c428[_0x90fd('0x45')]['id']}})[_0x90fd('0x22')](handleEntityNotFound(_0x1fc655,null))[_0x90fd('0x22')](function(_0x3494f7){if(_0x3494f7){_0x1b81dc=_0x3494f7;_0x55653c[_0x90fd('0x2f')]=_[_0x90fd('0x31')](db[_0x90fd('0x4a')][_0x90fd('0x2c')]);_0x55653c['query']=_['keys'](_0x13c428[_0x90fd('0x30')]);_0x55653c[_0x90fd('0x32')]=_[_0x90fd('0x33')](_0x55653c['model'],_0x55653c[_0x90fd('0x30')]);_0x5502f2[_0x90fd('0x34')]=_[_0x90fd('0x33')](_0x55653c[_0x90fd('0x2f')],qs[_0x90fd('0x35')](_0x13c428[_0x90fd('0x30')]['fields']));_0x5502f2[_0x90fd('0x34')]=_0x5502f2['attributes'][_0x90fd('0x36')]?_0x5502f2['attributes']:_0x55653c[_0x90fd('0x2f')];_0x5502f2[_0x90fd('0x39')]=qs[_0x90fd('0x3a')](_0x13c428[_0x90fd('0x30')]['sort']);_0x5502f2[_0x90fd('0x3b')]=qs[_0x90fd('0x32')](_[_0x90fd('0x4b')](_0x13c428[_0x90fd('0x30')],_0x55653c[_0x90fd('0x32')]));if(_0x13c428[_0x90fd('0x30')]['filter']){_0x5502f2['where']=_['merge'](_0x5502f2['where'],{'$or':_['map'](_0x5502f2[_0x90fd('0x34')],function(_0x3b98e2){var _0x278db5={};_0x278db5[_0x3b98e2]={'$like':'%'+_0x13c428[_0x90fd('0x30')][_0x90fd('0x3e')]+'%'};return _0x278db5;})});}_0x5502f2=_['merge']({},_0x5502f2,_0x13c428['options']);return _0x1b81dc['getConfigurations'](_0x5502f2);}})[_0x90fd('0x22')](function(_0x24ad4d){if(_0x24ad4d){_0x43d076=_0x24ad4d['length'];if(!_0x13c428[_0x90fd('0x30')][_0x90fd('0x37')](_0x90fd('0x38'))){_0x5502f2[_0x90fd('0x1c')]=qs[_0x90fd('0x1c')](_0x13c428[_0x90fd('0x30')][_0x90fd('0x1c')]);_0x5502f2[_0x90fd('0x19')]=qs[_0x90fd('0x19')](_0x13c428['query'][_0x90fd('0x19')]);}return _0x1b81dc[_0x90fd('0x49')](_0x5502f2);}})[_0x90fd('0x22')](function(_0x53e2bb){if(_0x53e2bb){return _0x53e2bb?{'count':_0x43d076,'rows':_0x53e2bb}:null;}})['then'](respondWithResult(_0x1fc655,null))[_0x90fd('0x43')](handleError(_0x1fc655,null));};exports[_0x90fd('0x4c')]=function(_0x479c8c,_0x5f4645,_0x4d761c){if(_0x479c8c['body']['id']){delete _0x479c8c[_0x90fd('0x47')]['id'];}return db[_0x90fd('0x2b')][_0x90fd('0x4d')]({'where':{'id':_0x479c8c[_0x90fd('0x45')]['id']}})[_0x90fd('0x22')](handleEntityNotFound(_0x5f4645,null))[_0x90fd('0x22')](function(_0x321cfb){if(_0x321cfb){_0x479c8c[_0x90fd('0x47')]['AccountId']=_0x321cfb['id'];_0x479c8c[_0x90fd('0x47')][_0x90fd('0x4e')]=integrations[_0x90fd('0x4f')](_0x479c8c['body'][_0x90fd('0x50')],_0x479c8c[_0x90fd('0x47')]['type']);_0x479c8c['body'][_0x90fd('0x51')]=integrations[_0x90fd('0x52')](_0x479c8c[_0x90fd('0x47')]['channel'],_0x479c8c[_0x90fd('0x47')]['type']);return db['FreshdeskConfiguration'][_0x90fd('0x46')](_0x479c8c['body'],{'include':[{'model':db[_0x90fd('0x53')],'as':_0x90fd('0x4e')},{'model':db['FreshdeskField'],'as':_0x90fd('0x51')}]});}return null;})[_0x90fd('0x22')](respondWithResult(_0x5f4645,null))[_0x90fd('0x43')](handleError(_0x5f4645,null));};exports[_0x90fd('0x54')]=function(_0x6a7a62,_0xd1ecc,_0x4d2436){var _0x4c5fd3='';return db['FreshdeskAccount']['findOne']({'where':{'id':_0x6a7a62[_0x90fd('0x45')]['id']},'attributes':['id',_0x90fd('0x55'),_0x90fd('0x56')]})['then'](handleEntityNotFound(_0xd1ecc,null))[_0x90fd('0x22')](function(_0x4204be){if(_0x4204be){_0x4c5fd3=_0x4204be['remoteUri'];var _0x44465e=_0x4c5fd3[_0x90fd('0x57')](-0x1);if(_0x44465e==='/'){_0x4c5fd3=_0x4c5fd3[_0x90fd('0x58')](0x0,_0x4c5fd3[_0x90fd('0x59')](_0x44465e));}return rp({'method':'GET','uri':util[_0x90fd('0x5a')](_0x90fd('0x5b'),_0x4c5fd3,'api/v2/ticket_fields'),'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x90fd('0x5a')]('%s:X',_0x4204be['apiKey']))[_0x90fd('0x5c')]('base64'))},'json':!![]});}})[_0x90fd('0x22')](function(_0x4aed6d){if(_0x4aed6d){var _0x126a71=[_0x90fd('0x5d'),_0x90fd('0x5e'),_0x90fd('0x5f'),'description',_0x90fd('0x17'),_0x90fd('0x60'),_0x90fd('0x61'),'source','ticket_type',_0x90fd('0x61'),_0x90fd('0x62')];_[_0x90fd('0x63')](_0x4aed6d,function(_0x2789d1){return _0x126a71[_0x90fd('0x64')](_0x2789d1[_0x90fd('0x27')])||!_0x2789d1[_0x90fd('0x65')]&&_0x2789d1[_0x90fd('0x2d')]!==_0x90fd('0x66')&&_0x2789d1[_0x90fd('0x2d')]!==_0x90fd('0x67');});return{'count':_0x4aed6d[_0x90fd('0x36')],'rows':_[_0x90fd('0x2a')](_0x4aed6d,function(_0x34a33a){return{'id':_0x34a33a[_0x90fd('0x27')],'name':_0x34a33a[_0x90fd('0x68')],'custom':!_0x34a33a[_0x90fd('0x65')],'options':_0x34a33a['choices']?_[_0x90fd('0x2a')](_0x34a33a[_0x90fd('0x69')],function(_0x1e309e){return{'name':_[_0x90fd('0x6a')](_0x1e309e),'value':_0x1e309e};}):[]};})};}})[_0x90fd('0x22')](respondWithResult(_0xd1ecc,null))[_0x90fd('0x43')](function(_0x19d0bf){var _0x4935db=_0x6a7a62[_0x90fd('0x30')][_0x90fd('0x6b')]?0x1f4:_0x19d0bf[_0x90fd('0x6c')]||0x1f4;logger[_0x90fd('0x25')]('getFields,\x20%s,\x20%s,\x20%s',_0x90fd('0x54'),_0x4935db,JSON[_0x90fd('0x6d')](_0x19d0bf));delete _0x19d0bf[_0x90fd('0x27')];if(_0x4935db===0x191){_0x4935db=0x190;}_0xd1ecc[_0x90fd('0x17')](_0x4935db)[_0x90fd('0x28')](_0x6a7a62['query']['test']?{'message':_0x90fd('0x6e'),'statusCode':_0x19d0bf[_0x90fd('0x6c')]}:_0x19d0bf);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 6169436..59c3db1 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 _0xda12=['api','moment','bluebird','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','int_freshdesk_accounts','lodash','../../config/logger'];(function(_0x378720,_0xa711f1){var _0x47920a=function(_0xc5056){while(--_0xc5056){_0x378720['push'](_0x378720['shift']());}};_0x47920a(++_0xa711f1);}(_0xda12,0xf5));var _0x2da1=function(_0x44946b,_0xf874ec){_0x44946b=_0x44946b-0x0;var _0x249bc4=_0xda12[_0x44946b];return _0x249bc4;};'use strict';var _=require(_0x2da1('0x0'));var util=require('util');var logger=require(_0x2da1('0x1'))(_0x2da1('0x2'));var moment=require(_0x2da1('0x3'));var BPromise=require(_0x2da1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2da1('0x5'));var rimraf=require(_0x2da1('0x6'));var config=require(_0x2da1('0x7'));var attributes=require(_0x2da1('0x8'));var integrations=require(_0x2da1('0x9'));module[_0x2da1('0xa')]=function(_0x4ec5d4,_0x49b888){return _0x4ec5d4[_0x2da1('0xb')]('FreshdeskAccount',attributes,{'tableName':_0x2da1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x359b=['moment','rimraf','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util'];(function(_0x249bee,_0x12a3f1){var _0x4b790a=function(_0xa24396){while(--_0xa24396){_0x249bee['push'](_0x249bee['shift']());}};_0x4b790a(++_0x12a3f1);}(_0x359b,0x1ac));var _0xb359=function(_0x18d0f5,_0x1df574){_0x18d0f5=_0x18d0f5-0x0;var _0x269d19=_0x359b[_0x18d0f5];return _0x269d19;};'use strict';var _=require(_0xb359('0x0'));var util=require(_0xb359('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb359('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb359('0x3'));var config=require('../../config/environment');var attributes=require(_0xb359('0x4'));var integrations=require(_0xb359('0x5'));module[_0xb359('0x6')]=function(_0x4397d1,_0x545da6){return _0x4397d1[_0xb359('0x7')](_0xb359('0x8'),attributes,{'tableName':_0xb359('0x9'),'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 592cfd0..11fe48a 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 _0x8d1f=['find','util','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','request','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetFreshdeskAccount','options','raw','where','attributes','limit','include','model','map','stringify','ShowFreshdeskAccount','FreshdeskAccount'];(function(_0x5b2861,_0x3fa9c1){var _0x1aae6e=function(_0x5d1230){while(--_0x5d1230){_0x5b2861['push'](_0x5b2861['shift']());}};_0x1aae6e(++_0x3fa9c1);}(_0x8d1f,0x137));var _0xf8d1=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x8d1f[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0xf8d1('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf8d1('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf8d1('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xf8d1('0x3'))('rpc');var config=require(_0xf8d1('0x4'));var jayson=require(_0xf8d1('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1a4125,_0xeab5b1,_0x117924){return new BPromise(function(_0x1fab63,_0x423f1){return client[_0xf8d1('0x6')](_0x1a4125,_0x117924)[_0xf8d1('0x7')](function(_0x143a50){logger['info'](_0xf8d1('0x8'),_0xeab5b1,_0xf8d1('0x9'));logger[_0xf8d1('0xa')](_0xf8d1('0xb'),_0xeab5b1,_0xf8d1('0x9'),JSON['stringify'](_0x143a50));if(_0x143a50[_0xf8d1('0xc')]){if(_0x143a50[_0xf8d1('0xc')][_0xf8d1('0xd')]===0x1f4){logger[_0xf8d1('0xc')](_0xf8d1('0x8'),_0xeab5b1,_0x143a50[_0xf8d1('0xc')][_0xf8d1('0xe')]);return _0x423f1(_0x143a50[_0xf8d1('0xc')]['message']);}logger[_0xf8d1('0xc')]('FreshdeskAccount,\x20%s,\x20%s',_0xeab5b1,_0x143a50['error']['message']);return _0x1fab63(_0x143a50[_0xf8d1('0xc')][_0xf8d1('0xe')]);}else{logger[_0xf8d1('0xf')](_0xf8d1('0x8'),_0xeab5b1,_0xf8d1('0x9'));_0x1fab63(_0x143a50[_0xf8d1('0x10')]['message']);}})[_0xf8d1('0x11')](function(_0x320a3f){logger[_0xf8d1('0xc')](_0xf8d1('0x8'),_0xeab5b1,_0x320a3f);_0x423f1(_0x320a3f);});});}exports[_0xf8d1('0x12')]=function(_0xba9738){var _0xfd74ed=this;return new Promise(function(_0x13a158,_0x5c9ace){return db['FreshdeskAccount']['findAll']({'raw':_0xba9738[_0xf8d1('0x13')]?_0xba9738[_0xf8d1('0x13')][_0xf8d1('0x14')]===undefined?!![]:![]:!![],'where':_0xba9738[_0xf8d1('0x13')]?_0xba9738[_0xf8d1('0x13')][_0xf8d1('0x15')]||null:null,'attributes':_0xba9738[_0xf8d1('0x13')]?_0xba9738[_0xf8d1('0x13')][_0xf8d1('0x16')]||null:null,'limit':_0xba9738[_0xf8d1('0x13')]?_0xba9738['options'][_0xf8d1('0x17')]||null:null,'include':_0xba9738[_0xf8d1('0x13')]?_0xba9738[_0xf8d1('0x13')]['include']?_['map'](_0xba9738['options'][_0xf8d1('0x18')],function(_0x5e466c){return{'model':db[_0x5e466c[_0xf8d1('0x19')]],'as':_0x5e466c['as'],'attributes':_0x5e466c[_0xf8d1('0x16')],'include':_0x5e466c[_0xf8d1('0x18')]?_[_0xf8d1('0x1a')](_0x5e466c[_0xf8d1('0x18')],function(_0x14c1ca){return{'model':db[_0x14c1ca[_0xf8d1('0x19')]],'as':_0x14c1ca['as'],'attributes':_0x14c1ca[_0xf8d1('0x16')],'include':_0x14c1ca[_0xf8d1('0x18')]?_[_0xf8d1('0x1a')](_0x14c1ca[_0xf8d1('0x18')],function(_0x5fd118){return{'model':db[_0x5fd118[_0xf8d1('0x19')]],'as':_0x5fd118['as'],'attributes':_0x5fd118[_0xf8d1('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3163fe){logger[_0xf8d1('0xf')](_0xf8d1('0x12'),_0xba9738);logger[_0xf8d1('0xa')](_0xf8d1('0x12'),_0xba9738,JSON[_0xf8d1('0x1b')](_0x3163fe));_0x13a158(_0x3163fe);})['catch'](function(_0x1d8b96){logger[_0xf8d1('0xc')](_0xf8d1('0x12'),_0x1d8b96[_0xf8d1('0xe')],_0xba9738);_0x5c9ace(_0xfd74ed[_0xf8d1('0xc')](0x1f4,_0x1d8b96[_0xf8d1('0xe')]));});});};exports[_0xf8d1('0x1c')]=function(_0x3d0b27){var _0x1f1895=this;return new Promise(function(_0x1a2135,_0x5c5dae){return db[_0xf8d1('0x1d')][_0xf8d1('0x1e')]({'raw':_0x3d0b27['options']?_0x3d0b27[_0xf8d1('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x3d0b27[_0xf8d1('0x13')]?_0x3d0b27[_0xf8d1('0x13')][_0xf8d1('0x15')]||null:null,'attributes':_0x3d0b27[_0xf8d1('0x13')]?_0x3d0b27[_0xf8d1('0x13')]['attributes']||null:null,'include':_0x3d0b27['options']?_0x3d0b27[_0xf8d1('0x13')][_0xf8d1('0x18')]?_['map'](_0x3d0b27[_0xf8d1('0x13')]['include'],function(_0x5f31a6){return{'model':db[_0x5f31a6[_0xf8d1('0x19')]],'as':_0x5f31a6['as'],'attributes':_0x5f31a6[_0xf8d1('0x16')],'include':_0x5f31a6[_0xf8d1('0x18')]?_[_0xf8d1('0x1a')](_0x5f31a6[_0xf8d1('0x18')],function(_0x59bcc9){return{'model':db[_0x59bcc9['model']],'as':_0x59bcc9['as'],'attributes':_0x59bcc9[_0xf8d1('0x16')],'include':_0x59bcc9[_0xf8d1('0x18')]?_[_0xf8d1('0x1a')](_0x59bcc9[_0xf8d1('0x18')],function(_0xb33b94){return{'model':db[_0xb33b94['model']],'as':_0xb33b94['as'],'attributes':_0xb33b94[_0xf8d1('0x16')]};}):[]};}):[]};}):[]:[]})[_0xf8d1('0x7')](function(_0xc4c88d){logger['info']('ShowFreshdeskAccount',_0x3d0b27);logger[_0xf8d1('0xa')]('ShowFreshdeskAccount',_0x3d0b27,JSON[_0xf8d1('0x1b')](_0xc4c88d));_0x1a2135(_0xc4c88d);})[_0xf8d1('0x11')](function(_0x413f30){logger[_0xf8d1('0xc')](_0xf8d1('0x1c'),_0x413f30['message'],_0x3d0b27);_0x5c5dae(_0x1f1895[_0xf8d1('0xc')](0x1f4,_0x413f30[_0xf8d1('0xe')]));});});}; \ No newline at end of file +var _0x94c4=['client','http','request','then','FreshdeskAccount,\x20%s,\x20%s','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','FreshdeskAccount','findAll','options','raw','where','limit','include','map','model','attributes','GetFreshdeskAccount','stringify','catch','ShowFreshdeskAccount','find','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x422976,_0x254c92){var _0x5248d1=function(_0x989f2){while(--_0x989f2){_0x422976['push'](_0x422976['shift']());}};_0x5248d1(++_0x254c92);}(_0x94c4,0x11a));var _0x494c=function(_0xa1cc57,_0x514a84){_0xa1cc57=_0xa1cc57-0x0;var _0x122dff=_0x94c4[_0xa1cc57];return _0x122dff;};'use strict';var _=require(_0x494c('0x0'));var util=require(_0x494c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x494c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x494c('0x3'))['db'];var utils=require(_0x494c('0x4'));var logger=require(_0x494c('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x494c('0x6')][_0x494c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5f4d98,_0x329106,_0x4df6ac){return new BPromise(function(_0x12dcfd,_0x32917f){return client[_0x494c('0x8')](_0x5f4d98,_0x4df6ac)[_0x494c('0x9')](function(_0x816fe7){logger['info'](_0x494c('0xa'),_0x329106,'request\x20sent');logger[_0x494c('0xb')](_0x494c('0xc'),_0x329106,_0x494c('0xd'),JSON['stringify'](_0x816fe7));if(_0x816fe7['error']){if(_0x816fe7[_0x494c('0xe')]['code']===0x1f4){logger[_0x494c('0xe')]('FreshdeskAccount,\x20%s,\x20%s',_0x329106,_0x816fe7[_0x494c('0xe')][_0x494c('0xf')]);return _0x32917f(_0x816fe7[_0x494c('0xe')][_0x494c('0xf')]);}logger[_0x494c('0xe')]('FreshdeskAccount,\x20%s,\x20%s',_0x329106,_0x816fe7[_0x494c('0xe')]['message']);return _0x12dcfd(_0x816fe7['error'][_0x494c('0xf')]);}else{logger[_0x494c('0x10')](_0x494c('0xa'),_0x329106,'request\x20sent');_0x12dcfd(_0x816fe7['result'][_0x494c('0xf')]);}})['catch'](function(_0x43e17f){logger[_0x494c('0xe')](_0x494c('0xa'),_0x329106,_0x43e17f);_0x32917f(_0x43e17f);});});}exports['GetFreshdeskAccount']=function(_0x2ef31e){var _0x28eabc=this;return new Promise(function(_0x6a0940,_0x4aaed3){return db[_0x494c('0x11')][_0x494c('0x12')]({'raw':_0x2ef31e[_0x494c('0x13')]?_0x2ef31e[_0x494c('0x13')][_0x494c('0x14')]===undefined?!![]:![]:!![],'where':_0x2ef31e[_0x494c('0x13')]?_0x2ef31e[_0x494c('0x13')][_0x494c('0x15')]||null:null,'attributes':_0x2ef31e[_0x494c('0x13')]?_0x2ef31e[_0x494c('0x13')]['attributes']||null:null,'limit':_0x2ef31e[_0x494c('0x13')]?_0x2ef31e['options'][_0x494c('0x16')]||null:null,'include':_0x2ef31e[_0x494c('0x13')]?_0x2ef31e[_0x494c('0x13')][_0x494c('0x17')]?_[_0x494c('0x18')](_0x2ef31e[_0x494c('0x13')]['include'],function(_0x31e3b6){return{'model':db[_0x31e3b6[_0x494c('0x19')]],'as':_0x31e3b6['as'],'attributes':_0x31e3b6[_0x494c('0x1a')],'include':_0x31e3b6[_0x494c('0x17')]?_['map'](_0x31e3b6['include'],function(_0x1df907){return{'model':db[_0x1df907[_0x494c('0x19')]],'as':_0x1df907['as'],'attributes':_0x1df907[_0x494c('0x1a')],'include':_0x1df907[_0x494c('0x17')]?_[_0x494c('0x18')](_0x1df907[_0x494c('0x17')],function(_0x1e23f3){return{'model':db[_0x1e23f3[_0x494c('0x19')]],'as':_0x1e23f3['as'],'attributes':_0x1e23f3[_0x494c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x494c('0x9')](function(_0x225691){logger[_0x494c('0x10')](_0x494c('0x1b'),_0x2ef31e);logger[_0x494c('0xb')](_0x494c('0x1b'),_0x2ef31e,JSON[_0x494c('0x1c')](_0x225691));_0x6a0940(_0x225691);})[_0x494c('0x1d')](function(_0x40de05){logger['error']('GetFreshdeskAccount',_0x40de05[_0x494c('0xf')],_0x2ef31e);_0x4aaed3(_0x28eabc[_0x494c('0xe')](0x1f4,_0x40de05[_0x494c('0xf')]));});});};exports[_0x494c('0x1e')]=function(_0x530235){var _0x19430e=this;return new Promise(function(_0x321829,_0x56cdd5){return db['FreshdeskAccount'][_0x494c('0x1f')]({'raw':_0x530235['options']?_0x530235[_0x494c('0x13')][_0x494c('0x14')]===undefined?!![]:![]:!![],'where':_0x530235[_0x494c('0x13')]?_0x530235[_0x494c('0x13')][_0x494c('0x15')]||null:null,'attributes':_0x530235[_0x494c('0x13')]?_0x530235[_0x494c('0x13')][_0x494c('0x1a')]||null:null,'include':_0x530235[_0x494c('0x13')]?_0x530235[_0x494c('0x13')][_0x494c('0x17')]?_[_0x494c('0x18')](_0x530235['options'][_0x494c('0x17')],function(_0xac51b3){return{'model':db[_0xac51b3['model']],'as':_0xac51b3['as'],'attributes':_0xac51b3[_0x494c('0x1a')],'include':_0xac51b3[_0x494c('0x17')]?_['map'](_0xac51b3['include'],function(_0x2043fc){return{'model':db[_0x2043fc[_0x494c('0x19')]],'as':_0x2043fc['as'],'attributes':_0x2043fc['attributes'],'include':_0x2043fc[_0x494c('0x17')]?_['map'](_0x2043fc[_0x494c('0x17')],function(_0x2ea6d1){return{'model':db[_0x2ea6d1[_0x494c('0x19')]],'as':_0x2ea6d1['as'],'attributes':_0x2ea6d1[_0x494c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x494c('0x9')](function(_0x5ddbc0){logger[_0x494c('0x10')](_0x494c('0x1e'),_0x530235);logger[_0x494c('0xb')]('ShowFreshdeskAccount',_0x530235,JSON[_0x494c('0x1c')](_0x5ddbc0));_0x321829(_0x5ddbc0);})[_0x494c('0x1d')](function(_0x4ec9b0){logger[_0x494c('0xe')](_0x494c('0x1e'),_0x4ec9b0[_0x494c('0xf')],_0x530235);_0x56cdd5(_0x19430e[_0x494c('0xe')](0x1f4,_0x4ec9b0[_0x494c('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index d6fe815..0fc1269 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 _0x6281=['/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','./intFreshdeskConfiguration.controller','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6281,0x87));var _0x1628=function(_0x371d83,_0x49a0ce){_0x371d83=_0x371d83-0x0;var _0x27a8b8=_0x6281[_0x371d83];return _0x27a8b8;};'use strict';var multer=require(_0x1628('0x0'));var util=require('util');var path=require(_0x1628('0x1'));var timeout=require(_0x1628('0x2'));var express=require(_0x1628('0x3'));var router=express[_0x1628('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1628('0x5'));var config=require('../../config/environment');var controller=require(_0x1628('0x6'));router[_0x1628('0x7')]('/',auth[_0x1628('0x8')](),controller['index']);router['get']('/:id',auth[_0x1628('0x8')](),controller['show']);router[_0x1628('0x7')](_0x1628('0x9'),auth['isAuthenticated'](),controller[_0x1628('0xa')]);router[_0x1628('0x7')](_0x1628('0xb'),auth[_0x1628('0x8')](),controller[_0x1628('0xc')]);router[_0x1628('0x7')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x1628('0xd')]);router[_0x1628('0x7')](_0x1628('0xe'),auth[_0x1628('0x8')](),controller[_0x1628('0xf')]);router[_0x1628('0x10')]('/',auth[_0x1628('0x8')](),controller[_0x1628('0x11')]);router[_0x1628('0x10')]('/:id/tags',auth[_0x1628('0x8')](),controller[_0x1628('0x12')]);router['put'](_0x1628('0x13'),auth[_0x1628('0x8')](),controller[_0x1628('0x14')]);router[_0x1628('0x15')](_0x1628('0x13'),auth['isAuthenticated'](),controller[_0x1628('0x16')]);module[_0x1628('0x17')]=router; \ No newline at end of file +var _0x5688=['create','put','update','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/tags','getTags'];(function(_0x1e2080,_0x53283b){var _0x260111=function(_0x15da5e){while(--_0x15da5e){_0x1e2080['push'](_0x1e2080['shift']());}};_0x260111(++_0x53283b);}(_0x5688,0x1e8));var _0x8568=function(_0x16eb61,_0x43dfa2){_0x16eb61=_0x16eb61-0x0;var _0x46905c=_0x5688[_0x16eb61];return _0x46905c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8568('0x0'));var timeout=require(_0x8568('0x1'));var express=require(_0x8568('0x2'));var router=express[_0x8568('0x3')]();var fs_extra=require(_0x8568('0x4'));var auth=require(_0x8568('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8568('0x6'));var controller=require(_0x8568('0x7'));router[_0x8568('0x8')]('/',auth[_0x8568('0x9')](),controller[_0x8568('0xa')]);router['get'](_0x8568('0xb'),auth[_0x8568('0x9')](),controller[_0x8568('0xc')]);router[_0x8568('0x8')](_0x8568('0xd'),auth['isAuthenticated'](),controller[_0x8568('0xe')]);router['get'](_0x8568('0xf'),auth[_0x8568('0x9')](),controller['getSubjects']);router[_0x8568('0x8')]('/:id/descriptions',auth[_0x8568('0x9')](),controller['getDescriptions']);router[_0x8568('0x8')](_0x8568('0x10'),auth['isAuthenticated'](),controller[_0x8568('0x11')]);router['post']('/',auth[_0x8568('0x9')](),controller[_0x8568('0x12')]);router['post'](_0x8568('0x10'),auth[_0x8568('0x9')](),controller['setTags']);router[_0x8568('0x13')](_0x8568('0xb'),auth['isAuthenticated'](),controller[_0x8568('0x14')]);router['delete'](_0x8568('0xb'),auth[_0x8568('0x9')](),controller[_0x8568('0x15')]);module[_0x8568('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 5630bd0..5687408 100644 --- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js +++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2321=['sequelize','STRING'];(function(_0x17e990,_0x45d0d3){var _0x38c5c9=function(_0x5f3249){while(--_0x5f3249){_0x17e990['push'](_0x17e990['shift']());}};_0x38c5c9(++_0x45d0d3);}(_0x2321,0xfe));var _0x1232=function(_0x26b80e,_0x5c9333){_0x26b80e=_0x26b80e-0x0;var _0x84a8a8=_0x2321[_0x26b80e];return _0x84a8a8;};'use strict';var Sequelize=require(_0x1232('0x0'));module['exports']={'name':{'type':Sequelize[_0x1232('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x56fc=['STRING','sequelize','exports'];(function(_0x3740fe,_0x6c543c){var _0x55492b=function(_0x1f851f){while(--_0x1f851f){_0x3740fe['push'](_0x3740fe['shift']());}};_0x55492b(++_0x6c543c);}(_0x56fc,0x1cc));var _0xc56f=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x56fc[_0xa1e3e3];return _0xc980e9;};'use strict';var Sequelize=require(_0xc56f('0x0'));module[_0xc56f('0x1')]={'name':{'type':Sequelize[_0xc56f('0x2')]},'description':{'type':Sequelize[_0xc56f('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index bd24c6b..b329562 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 _0x8b1a=['setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','Content-Range','apply','reject','destroy','then','error','stack','name','send','index','map','FreshdeskConfiguration','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','rawAttributes','intersection','find','catch','create','body','update','getFields','findOne','FreshdeskField','nolimit','getSubjects','getDescriptions','getTags','Tag'];(function(_0x5408c2,_0xb736e8){var _0x55f181=function(_0x24cb95){while(--_0x24cb95){_0x5408c2['push'](_0x5408c2['shift']());}};_0x55f181(++_0xb736e8);}(_0x8b1a,0xa6));var _0xa8b1=function(_0xc90b0f,_0xdbeac7){_0xc90b0f=_0xc90b0f-0x0;var _0x3c66a3=_0x8b1a[_0xc90b0f];return _0x3c66a3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa8b1('0x0'));var zipdir=require(_0xa8b1('0x1'));var jsonpatch=require(_0xa8b1('0x2'));var rp=require(_0xa8b1('0x3'));var moment=require('moment');var BPromise=require(_0xa8b1('0x4'));var Mustache=require(_0xa8b1('0x5'));var util=require(_0xa8b1('0x6'));var path=require(_0xa8b1('0x7'));var sox=require(_0xa8b1('0x8'));var csv=require(_0xa8b1('0x9'));var ejs=require(_0xa8b1('0xa'));var fs=require('fs');var fs_extra=require(_0xa8b1('0xb'));var _=require(_0xa8b1('0xc'));var squel=require(_0xa8b1('0xd'));var crypto=require(_0xa8b1('0xe'));var jsforce=require(_0xa8b1('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa8b1('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa8b1('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa8b1('0x12'));var hardwareService=require(_0xa8b1('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa8b1('0x14'));var db=require(_0xa8b1('0x15'))['db'];function respondWithStatusCode(_0xc0be4d,_0x3b8b0b){_0x3b8b0b=_0x3b8b0b||0xcc;return function(_0x139b9e){if(_0x139b9e){return _0xc0be4d[_0xa8b1('0x16')](_0x3b8b0b);}return _0xc0be4d[_0xa8b1('0x17')](_0x3b8b0b)[_0xa8b1('0x18')]();};}function respondWithResult(_0xe3e0eb,_0x23ac4b){_0x23ac4b=_0x23ac4b||0xc8;return function(_0x1c9455){if(_0x1c9455){return _0xe3e0eb[_0xa8b1('0x17')](_0x23ac4b)['json'](_0x1c9455);}};}function respondWithFilteredResult(_0x523052,_0x3b67ad){return function(_0x48671b){if(_0x48671b){var _0x545520=typeof _0x3b67ad[_0xa8b1('0x19')]==='undefined'&&typeof _0x3b67ad['limit']===_0xa8b1('0x1a');var _0x7b554=_0x48671b['count'];var _0x22b1d6=_0x545520?0x0:_0x3b67ad[_0xa8b1('0x19')];var _0x497d2b=_0x545520?_0x48671b['count']:_0x3b67ad[_0xa8b1('0x19')]+_0x3b67ad[_0xa8b1('0x1b')];var _0x1b65b1;if(_0x497d2b>=_0x7b554){_0x497d2b=_0x7b554;_0x1b65b1=0xc8;}else{_0x1b65b1=0xce;}_0x523052[_0xa8b1('0x17')](_0x1b65b1);return _0x523052['set'](_0xa8b1('0x1c'),_0x22b1d6+'-'+_0x497d2b+'/'+_0x7b554)['json'](_0x48671b);}return null;};}function patchUpdates(_0x582e76){return function(_0x1a540c){try{jsonpatch[_0xa8b1('0x1d')](_0x1a540c,_0x582e76,!![]);}catch(_0x39486f){return BPromise[_0xa8b1('0x1e')](_0x39486f);}return _0x1a540c['save']();};}function saveUpdates(_0x136155,_0xdfe608){return function(_0x33eb4e){if(_0x33eb4e){return _0x33eb4e['update'](_0x136155)['then'](function(_0x40d52a){return _0x40d52a;});}return null;};}function removeEntity(_0x2771fa,_0x31af54){return function(_0xebbc84){if(_0xebbc84){return _0xebbc84[_0xa8b1('0x1f')]()[_0xa8b1('0x20')](function(){_0x2771fa['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e9fa3,_0xf1ce53){return function(_0x3f8f64){if(!_0x3f8f64){_0x3e9fa3['sendStatus'](0x194);}return _0x3f8f64;};}function handleError(_0xba92ef,_0x4989d6){_0x4989d6=_0x4989d6||0x1f4;return function(_0x42ac1e){logger[_0xa8b1('0x21')](_0x42ac1e[_0xa8b1('0x22')]);if(_0x42ac1e[_0xa8b1('0x23')]){delete _0x42ac1e[_0xa8b1('0x23')];}_0xba92ef[_0xa8b1('0x17')](_0x4989d6)[_0xa8b1('0x24')](_0x42ac1e);};}exports[_0xa8b1('0x25')]=function(_0x3479df,_0x155f82){var _0x592ca1={},_0x20418e={},_0x435aec={'count':0x0,'rows':[]};var _0x506a45=_[_0xa8b1('0x26')](db[_0xa8b1('0x27')]['rawAttributes'],function(_0x5e3096){return{'name':_0x5e3096[_0xa8b1('0x28')],'type':_0x5e3096[_0xa8b1('0x29')][_0xa8b1('0x2a')]};});_0x20418e[_0xa8b1('0x2b')]=_[_0xa8b1('0x26')](_0x506a45,_0xa8b1('0x23'));_0x20418e[_0xa8b1('0x2c')]=_['keys'](_0x3479df['query']);_0x20418e[_0xa8b1('0x2d')]=_['intersection'](_0x20418e[_0xa8b1('0x2b')],_0x20418e[_0xa8b1('0x2c')]);_0x592ca1[_0xa8b1('0x2e')]=_['intersection'](_0x20418e[_0xa8b1('0x2b')],qs[_0xa8b1('0x2f')](_0x3479df[_0xa8b1('0x2c')][_0xa8b1('0x2f')]));_0x592ca1['attributes']=_0x592ca1[_0xa8b1('0x2e')][_0xa8b1('0x30')]?_0x592ca1[_0xa8b1('0x2e')]:_0x20418e[_0xa8b1('0x2b')];if(!_0x3479df[_0xa8b1('0x2c')][_0xa8b1('0x31')]('nolimit')){_0x592ca1['limit']=qs[_0xa8b1('0x1b')](_0x3479df['query']['limit']);_0x592ca1[_0xa8b1('0x19')]=qs[_0xa8b1('0x19')](_0x3479df[_0xa8b1('0x2c')][_0xa8b1('0x19')]);}_0x592ca1[_0xa8b1('0x32')]=qs['sort'](_0x3479df['query'][_0xa8b1('0x33')]);_0x592ca1[_0xa8b1('0x34')]=qs[_0xa8b1('0x2d')](_[_0xa8b1('0x35')](_0x3479df[_0xa8b1('0x2c')],_0x20418e[_0xa8b1('0x2d')]),_0x506a45);if(_0x3479df[_0xa8b1('0x2c')][_0xa8b1('0x36')]){_0x592ca1[_0xa8b1('0x34')]=_[_0xa8b1('0x37')](_0x592ca1[_0xa8b1('0x34')],{'$or':_[_0xa8b1('0x26')](_0x506a45,function(_0x3cac28){if(_0x3cac28[_0xa8b1('0x29')]!==_0xa8b1('0x38')){var _0x3749e8={};_0x3749e8[_0x3cac28[_0xa8b1('0x23')]]={'$like':'%'+_0x3479df[_0xa8b1('0x2c')]['filter']+'%'};return _0x3749e8;}})});}_0x592ca1=_[_0xa8b1('0x37')]({},_0x592ca1,_0x3479df[_0xa8b1('0x39')]);var _0xa0318e={'where':_0x592ca1[_0xa8b1('0x34')]};return db[_0xa8b1('0x27')]['count'](_0xa0318e)[_0xa8b1('0x20')](function(_0x1ee721){_0x435aec['count']=_0x1ee721;if(_0x3479df[_0xa8b1('0x2c')][_0xa8b1('0x3a')]){_0x592ca1[_0xa8b1('0x3b')]=[{'all':!![]}];}return db[_0xa8b1('0x27')][_0xa8b1('0x3c')](_0x592ca1);})[_0xa8b1('0x20')](function(_0x1c25a8){_0x435aec[_0xa8b1('0x3d')]=_0x1c25a8;return _0x435aec;})[_0xa8b1('0x20')](respondWithFilteredResult(_0x155f82,_0x592ca1))['catch'](handleError(_0x155f82,null));};exports[_0xa8b1('0x3e')]=function(_0x5e7e66,_0x18cff7){var _0x1a4022={'raw':![],'where':{'id':_0x5e7e66[_0xa8b1('0x3f')]['id']}},_0x434b5f={};_0x434b5f[_0xa8b1('0x2b')]=_[_0xa8b1('0x40')](db['FreshdeskConfiguration'][_0xa8b1('0x41')]);_0x434b5f[_0xa8b1('0x2c')]=_[_0xa8b1('0x40')](_0x5e7e66[_0xa8b1('0x2c')]);_0x434b5f[_0xa8b1('0x2d')]=_[_0xa8b1('0x42')](_0x434b5f['model'],_0x434b5f[_0xa8b1('0x2c')]);_0x1a4022[_0xa8b1('0x2e')]=_['intersection'](_0x434b5f[_0xa8b1('0x2b')],qs[_0xa8b1('0x2f')](_0x5e7e66['query'][_0xa8b1('0x2f')]));_0x1a4022[_0xa8b1('0x2e')]=_0x1a4022['attributes'][_0xa8b1('0x30')]?_0x1a4022[_0xa8b1('0x2e')]:_0x434b5f[_0xa8b1('0x2b')];if(_0x5e7e66[_0xa8b1('0x2c')][_0xa8b1('0x3a')]){_0x1a4022['include']=[{'all':!![]}];}_0x1a4022=_[_0xa8b1('0x37')]({},_0x1a4022,_0x5e7e66[_0xa8b1('0x39')]);return db[_0xa8b1('0x27')][_0xa8b1('0x43')](_0x1a4022)[_0xa8b1('0x20')](handleEntityNotFound(_0x18cff7,null))[_0xa8b1('0x20')](respondWithResult(_0x18cff7,null))[_0xa8b1('0x44')](handleError(_0x18cff7,null));};exports[_0xa8b1('0x45')]=function(_0x478a92,_0x1cc120){return db[_0xa8b1('0x27')][_0xa8b1('0x45')](_0x478a92[_0xa8b1('0x46')],{})[_0xa8b1('0x20')](respondWithResult(_0x1cc120,0xc9))[_0xa8b1('0x44')](handleError(_0x1cc120,null));};exports[_0xa8b1('0x47')]=function(_0x17523a,_0x354911){if(_0x17523a[_0xa8b1('0x46')]['id']){delete _0x17523a[_0xa8b1('0x46')]['id'];}return db[_0xa8b1('0x27')]['find']({'where':{'id':_0x17523a[_0xa8b1('0x3f')]['id']}})[_0xa8b1('0x20')](handleEntityNotFound(_0x354911,null))[_0xa8b1('0x20')](saveUpdates(_0x17523a[_0xa8b1('0x46')],null))[_0xa8b1('0x20')](respondWithResult(_0x354911,null))[_0xa8b1('0x44')](handleError(_0x354911,null));};exports[_0xa8b1('0x1f')]=function(_0x3d762d,_0x337e03){return db[_0xa8b1('0x27')]['find']({'where':{'id':_0x3d762d[_0xa8b1('0x3f')]['id']}})[_0xa8b1('0x20')](handleEntityNotFound(_0x337e03,null))['then'](removeEntity(_0x337e03,null))[_0xa8b1('0x44')](handleError(_0x337e03,null));};exports[_0xa8b1('0x48')]=function(_0x10c9e2,_0xe89ea1,_0x4648a0){var _0xd72b9b={};var _0x341c4a={};var _0x31ad17;var _0x40cddd;return db[_0xa8b1('0x27')][_0xa8b1('0x49')]({'where':{'id':_0x10c9e2[_0xa8b1('0x3f')]['id']}})[_0xa8b1('0x20')](handleEntityNotFound(_0xe89ea1,null))[_0xa8b1('0x20')](function(_0x451453){if(_0x451453){_0x31ad17=_0x451453;_0x341c4a[_0xa8b1('0x2b')]=_[_0xa8b1('0x40')](db[_0xa8b1('0x4a')][_0xa8b1('0x41')]);_0x341c4a[_0xa8b1('0x2c')]=_[_0xa8b1('0x40')](_0x10c9e2[_0xa8b1('0x2c')]);_0x341c4a[_0xa8b1('0x2d')]=_[_0xa8b1('0x42')](_0x341c4a[_0xa8b1('0x2b')],_0x341c4a[_0xa8b1('0x2c')]);_0xd72b9b[_0xa8b1('0x2e')]=_[_0xa8b1('0x42')](_0x341c4a[_0xa8b1('0x2b')],qs[_0xa8b1('0x2f')](_0x10c9e2['query'][_0xa8b1('0x2f')]));_0xd72b9b[_0xa8b1('0x2e')]=_0xd72b9b[_0xa8b1('0x2e')][_0xa8b1('0x30')]?_0xd72b9b['attributes']:_0x341c4a[_0xa8b1('0x2b')];_0xd72b9b[_0xa8b1('0x32')]=qs[_0xa8b1('0x33')](_0x10c9e2[_0xa8b1('0x2c')][_0xa8b1('0x33')]);_0xd72b9b[_0xa8b1('0x34')]=qs['filters'](_[_0xa8b1('0x35')](_0x10c9e2[_0xa8b1('0x2c')],_0x341c4a['filters']));if(_0x10c9e2['query']['filter']){_0xd72b9b[_0xa8b1('0x34')]=_[_0xa8b1('0x37')](_0xd72b9b[_0xa8b1('0x34')],{'$or':_[_0xa8b1('0x26')](_0xd72b9b[_0xa8b1('0x2e')],function(_0x31da9f){var _0x374449={};_0x374449[_0x31da9f]={'$like':'%'+_0x10c9e2[_0xa8b1('0x2c')]['filter']+'%'};return _0x374449;})});}_0xd72b9b=_[_0xa8b1('0x37')]({},_0xd72b9b,_0x10c9e2[_0xa8b1('0x39')]);return _0x31ad17[_0xa8b1('0x48')](_0xd72b9b);}})['then'](function(_0x556ebe){if(_0x556ebe){_0x40cddd=_0x556ebe[_0xa8b1('0x30')];if(!_0x10c9e2['query'][_0xa8b1('0x31')](_0xa8b1('0x4b'))){_0xd72b9b['limit']=qs[_0xa8b1('0x1b')](_0x10c9e2[_0xa8b1('0x2c')][_0xa8b1('0x1b')]);_0xd72b9b[_0xa8b1('0x19')]=qs[_0xa8b1('0x19')](_0x10c9e2[_0xa8b1('0x2c')]['offset']);}return _0x31ad17[_0xa8b1('0x48')](_0xd72b9b);}})[_0xa8b1('0x20')](function(_0xb86165){if(_0xb86165){return _0xb86165?{'count':_0x40cddd,'rows':_0xb86165}:null;}})[_0xa8b1('0x20')](respondWithResult(_0xe89ea1,null))[_0xa8b1('0x44')](handleError(_0xe89ea1,null));};exports[_0xa8b1('0x4c')]=function(_0x53544c,_0x158afe,_0x1bf2bc){var _0x59940a={};var _0x3b6570={};var _0x145cda;var _0x4d709;return db[_0xa8b1('0x27')][_0xa8b1('0x49')]({'where':{'id':_0x53544c[_0xa8b1('0x3f')]['id']}})[_0xa8b1('0x20')](handleEntityNotFound(_0x158afe,null))[_0xa8b1('0x20')](function(_0x46cf26){if(_0x46cf26){_0x145cda=_0x46cf26;_0x3b6570['model']=_[_0xa8b1('0x40')](db['FreshdeskField'][_0xa8b1('0x41')]);_0x3b6570[_0xa8b1('0x2c')]=_['keys'](_0x53544c[_0xa8b1('0x2c')]);_0x3b6570[_0xa8b1('0x2d')]=_[_0xa8b1('0x42')](_0x3b6570[_0xa8b1('0x2b')],_0x3b6570[_0xa8b1('0x2c')]);_0x59940a['attributes']=_['intersection'](_0x3b6570['model'],qs[_0xa8b1('0x2f')](_0x53544c[_0xa8b1('0x2c')][_0xa8b1('0x2f')]));_0x59940a[_0xa8b1('0x2e')]=_0x59940a[_0xa8b1('0x2e')][_0xa8b1('0x30')]?_0x59940a['attributes']:_0x3b6570[_0xa8b1('0x2b')];_0x59940a[_0xa8b1('0x32')]=qs[_0xa8b1('0x33')](_0x53544c[_0xa8b1('0x2c')][_0xa8b1('0x33')]);_0x59940a[_0xa8b1('0x34')]=qs['filters'](_['pick'](_0x53544c[_0xa8b1('0x2c')],_0x3b6570[_0xa8b1('0x2d')]));if(_0x53544c[_0xa8b1('0x2c')][_0xa8b1('0x36')]){_0x59940a[_0xa8b1('0x34')]=_[_0xa8b1('0x37')](_0x59940a[_0xa8b1('0x34')],{'$or':_[_0xa8b1('0x26')](_0x59940a[_0xa8b1('0x2e')],function(_0x535758){var _0x3c92cb={};_0x3c92cb[_0x535758]={'$like':'%'+_0x53544c[_0xa8b1('0x2c')][_0xa8b1('0x36')]+'%'};return _0x3c92cb;})});}_0x59940a=_[_0xa8b1('0x37')]({},_0x59940a,_0x53544c['options']);return _0x145cda[_0xa8b1('0x4c')](_0x59940a);}})[_0xa8b1('0x20')](function(_0x3e328b){if(_0x3e328b){_0x4d709=_0x3e328b[_0xa8b1('0x30')];if(!_0x53544c[_0xa8b1('0x2c')]['hasOwnProperty'](_0xa8b1('0x4b'))){_0x59940a['limit']=qs[_0xa8b1('0x1b')](_0x53544c['query'][_0xa8b1('0x1b')]);_0x59940a[_0xa8b1('0x19')]=qs[_0xa8b1('0x19')](_0x53544c['query'][_0xa8b1('0x19')]);}return _0x145cda[_0xa8b1('0x4c')](_0x59940a);}})[_0xa8b1('0x20')](function(_0x80e72f){if(_0x80e72f){return _0x80e72f?{'count':_0x4d709,'rows':_0x80e72f}:null;}})[_0xa8b1('0x20')](respondWithResult(_0x158afe,null))['catch'](handleError(_0x158afe,null));};exports[_0xa8b1('0x4d')]=function(_0x2a4128,_0x31337c,_0x136914){var _0x52035b={};var _0x59e5d7={};var _0xa6ba71;var _0x3d3f7f;return db[_0xa8b1('0x27')][_0xa8b1('0x49')]({'where':{'id':_0x2a4128['params']['id']}})[_0xa8b1('0x20')](handleEntityNotFound(_0x31337c,null))[_0xa8b1('0x20')](function(_0x5e9fa3){if(_0x5e9fa3){_0xa6ba71=_0x5e9fa3;_0x59e5d7[_0xa8b1('0x2b')]=_[_0xa8b1('0x40')](db['FreshdeskField'][_0xa8b1('0x41')]);_0x59e5d7['query']=_[_0xa8b1('0x40')](_0x2a4128[_0xa8b1('0x2c')]);_0x59e5d7[_0xa8b1('0x2d')]=_[_0xa8b1('0x42')](_0x59e5d7[_0xa8b1('0x2b')],_0x59e5d7[_0xa8b1('0x2c')]);_0x52035b[_0xa8b1('0x2e')]=_['intersection'](_0x59e5d7['model'],qs['fields'](_0x2a4128[_0xa8b1('0x2c')]['fields']));_0x52035b[_0xa8b1('0x2e')]=_0x52035b[_0xa8b1('0x2e')][_0xa8b1('0x30')]?_0x52035b[_0xa8b1('0x2e')]:_0x59e5d7[_0xa8b1('0x2b')];_0x52035b[_0xa8b1('0x32')]=qs[_0xa8b1('0x33')](_0x2a4128[_0xa8b1('0x2c')][_0xa8b1('0x33')]);_0x52035b[_0xa8b1('0x34')]=qs[_0xa8b1('0x2d')](_['pick'](_0x2a4128[_0xa8b1('0x2c')],_0x59e5d7['filters']));if(_0x2a4128[_0xa8b1('0x2c')][_0xa8b1('0x36')]){_0x52035b[_0xa8b1('0x34')]=_[_0xa8b1('0x37')](_0x52035b[_0xa8b1('0x34')],{'$or':_[_0xa8b1('0x26')](_0x52035b['attributes'],function(_0x2e3215){var _0x3202fc={};_0x3202fc[_0x2e3215]={'$like':'%'+_0x2a4128[_0xa8b1('0x2c')]['filter']+'%'};return _0x3202fc;})});}_0x52035b=_[_0xa8b1('0x37')]({},_0x52035b,_0x2a4128['options']);return _0xa6ba71[_0xa8b1('0x4d')](_0x52035b);}})['then'](function(_0x5bf0a9){if(_0x5bf0a9){_0x3d3f7f=_0x5bf0a9[_0xa8b1('0x30')];if(!_0x2a4128[_0xa8b1('0x2c')][_0xa8b1('0x31')](_0xa8b1('0x4b'))){_0x52035b[_0xa8b1('0x1b')]=qs[_0xa8b1('0x1b')](_0x2a4128[_0xa8b1('0x2c')]['limit']);_0x52035b[_0xa8b1('0x19')]=qs[_0xa8b1('0x19')](_0x2a4128[_0xa8b1('0x2c')]['offset']);}return _0xa6ba71[_0xa8b1('0x4d')](_0x52035b);}})[_0xa8b1('0x20')](function(_0x5559d9){if(_0x5559d9){return _0x5559d9?{'count':_0x3d3f7f,'rows':_0x5559d9}:null;}})['then'](respondWithResult(_0x31337c,null))[_0xa8b1('0x44')](handleError(_0x31337c,null));};exports[_0xa8b1('0x4e')]=function(_0x1782b1,_0x24d64c,_0x40d5c5){var _0x31fdc9={};var _0x1b41d1={};var _0x109ae6;var _0x1d2c6a;return db[_0xa8b1('0x27')][_0xa8b1('0x49')]({'where':{'id':_0x1782b1[_0xa8b1('0x3f')]['id']}})['then'](handleEntityNotFound(_0x24d64c,null))[_0xa8b1('0x20')](function(_0x28d101){if(_0x28d101){_0x109ae6=_0x28d101;_0x1b41d1[_0xa8b1('0x2b')]=_['keys'](db[_0xa8b1('0x4f')]['rawAttributes']);_0x1b41d1[_0xa8b1('0x2c')]=_['keys'](_0x1782b1[_0xa8b1('0x2c')]);_0x1b41d1[_0xa8b1('0x2d')]=_['intersection'](_0x1b41d1[_0xa8b1('0x2b')],_0x1b41d1[_0xa8b1('0x2c')]);_0x31fdc9[_0xa8b1('0x2e')]=_['intersection'](_0x1b41d1[_0xa8b1('0x2b')],qs[_0xa8b1('0x2f')](_0x1782b1[_0xa8b1('0x2c')][_0xa8b1('0x2f')]));_0x31fdc9['attributes']=_0x31fdc9['attributes']['length']?_0x31fdc9[_0xa8b1('0x2e')]:_0x1b41d1[_0xa8b1('0x2b')];_0x31fdc9['order']=qs[_0xa8b1('0x33')](_0x1782b1[_0xa8b1('0x2c')][_0xa8b1('0x33')]);_0x31fdc9['where']=qs[_0xa8b1('0x2d')](_[_0xa8b1('0x35')](_0x1782b1['query'],_0x1b41d1[_0xa8b1('0x2d')]));if(_0x1782b1['query']['filter']){_0x31fdc9[_0xa8b1('0x34')]=_['merge'](_0x31fdc9[_0xa8b1('0x34')],{'$or':_[_0xa8b1('0x26')](_0x31fdc9[_0xa8b1('0x2e')],function(_0x599d8){var _0x33cc1b={};_0x33cc1b[_0x599d8]={'$like':'%'+_0x1782b1['query'][_0xa8b1('0x36')]+'%'};return _0x33cc1b;})});}_0x31fdc9=_[_0xa8b1('0x37')]({},_0x31fdc9,_0x1782b1[_0xa8b1('0x39')]);return _0x109ae6[_0xa8b1('0x4e')](_0x31fdc9);}})[_0xa8b1('0x20')](function(_0x5a38c3){if(_0x5a38c3){_0x1d2c6a=_0x5a38c3[_0xa8b1('0x30')];if(!_0x1782b1['query'][_0xa8b1('0x31')](_0xa8b1('0x4b'))){_0x31fdc9[_0xa8b1('0x1b')]=qs[_0xa8b1('0x1b')](_0x1782b1[_0xa8b1('0x2c')][_0xa8b1('0x1b')]);_0x31fdc9['offset']=qs['offset'](_0x1782b1['query'][_0xa8b1('0x19')]);}return _0x109ae6[_0xa8b1('0x4e')](_0x31fdc9);}})[_0xa8b1('0x20')](function(_0x3ce434){if(_0x3ce434){return _0x3ce434?{'count':_0x1d2c6a,'rows':_0x3ce434}:null;}})[_0xa8b1('0x20')](respondWithResult(_0x24d64c,null))[_0xa8b1('0x44')](handleError(_0x24d64c,null));};exports[_0xa8b1('0x50')]=function(_0x214ab8,_0x20f25f,_0xbbc2ce){if(_0x214ab8[_0xa8b1('0x46')]['id']){delete _0x214ab8[_0xa8b1('0x46')]['id'];}return db[_0xa8b1('0x27')][_0xa8b1('0x49')]({'where':{'id':_0x214ab8[_0xa8b1('0x3f')]['id']}})[_0xa8b1('0x20')](handleEntityNotFound(_0x20f25f,null))[_0xa8b1('0x20')](function(_0x17dc0f){if(_0x17dc0f){return _0x17dc0f[_0xa8b1('0x50')](_0x214ab8['body'][_0xa8b1('0x51')]||[]);}return null;})[_0xa8b1('0x20')](respondWithResult(_0x20f25f,null))[_0xa8b1('0x44')](handleError(_0x20f25f,null));}; \ No newline at end of file +var _0xd602=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','name','send','index','map','FreshdeskConfiguration','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','catch','update','FreshdeskField','pick','nolimit','getFields','getSubjects','findOne','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x33f643,_0x2e5fdb){var _0x3e188d=function(_0x33bdb6){while(--_0x33bdb6){_0x33f643['push'](_0x33f643['shift']());}};_0x3e188d(++_0x2e5fdb);}(_0xd602,0x1d6));var _0x2d60=function(_0x316cc7,_0x464dd0){_0x316cc7=_0x316cc7-0x0;var _0x32cf26=_0xd602[_0x316cc7];return _0x32cf26;};'use strict';var emlformat=require(_0x2d60('0x0'));var rimraf=require(_0x2d60('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2d60('0x2'));var BPromise=require(_0x2d60('0x3'));var Mustache=require(_0x2d60('0x4'));var util=require(_0x2d60('0x5'));var path=require('path');var sox=require(_0x2d60('0x6'));var csv=require(_0x2d60('0x7'));var ejs=require(_0x2d60('0x8'));var fs=require('fs');var fs_extra=require(_0x2d60('0x9'));var _=require('lodash');var squel=require(_0x2d60('0xa'));var crypto=require(_0x2d60('0xb'));var jsforce=require(_0x2d60('0xc'));var deskjs=require(_0x2d60('0xd'));var toCsv=require(_0x2d60('0x7'));var querystring=require(_0x2d60('0xe'));var Papa=require(_0x2d60('0xf'));var Redis=require(_0x2d60('0x10'));var authService=require(_0x2d60('0x11'));var qs=require(_0x2d60('0x12'));var as=require(_0x2d60('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2d60('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x2d60('0x15'));var licenseUtil=require(_0x2d60('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3930d1,_0x254927){_0x254927=_0x254927||0xcc;return function(_0x175257){if(_0x175257){return _0x3930d1['sendStatus'](_0x254927);}return _0x3930d1['status'](_0x254927)['end']();};}function respondWithResult(_0x252a16,_0x23e444){_0x23e444=_0x23e444||0xc8;return function(_0x28e7f2){if(_0x28e7f2){return _0x252a16[_0x2d60('0x17')](_0x23e444)[_0x2d60('0x18')](_0x28e7f2);}};}function respondWithFilteredResult(_0x3b290c,_0x193cf9){return function(_0x269981){if(_0x269981){var _0x1f8e9b=typeof _0x193cf9[_0x2d60('0x19')]===_0x2d60('0x1a')&&typeof _0x193cf9[_0x2d60('0x1b')]===_0x2d60('0x1a');var _0x45b6c0=_0x269981[_0x2d60('0x1c')];var _0x1164fd=_0x1f8e9b?0x0:_0x193cf9[_0x2d60('0x19')];var _0x2fbccb=_0x1f8e9b?_0x269981['count']:_0x193cf9[_0x2d60('0x19')]+_0x193cf9[_0x2d60('0x1b')];var _0x472d3b;if(_0x2fbccb>=_0x45b6c0){_0x2fbccb=_0x45b6c0;_0x472d3b=0xc8;}else{_0x472d3b=0xce;}_0x3b290c[_0x2d60('0x17')](_0x472d3b);return _0x3b290c[_0x2d60('0x1d')](_0x2d60('0x1e'),_0x1164fd+'-'+_0x2fbccb+'/'+_0x45b6c0)[_0x2d60('0x18')](_0x269981);}return null;};}function patchUpdates(_0x1a252e){return function(_0x2cc4e9){try{jsonpatch[_0x2d60('0x1f')](_0x2cc4e9,_0x1a252e,!![]);}catch(_0x598853){return BPromise[_0x2d60('0x20')](_0x598853);}return _0x2cc4e9[_0x2d60('0x21')]();};}function saveUpdates(_0x34bdea,_0x13e024){return function(_0x4624d8){if(_0x4624d8){return _0x4624d8['update'](_0x34bdea)['then'](function(_0x1b644b){return _0x1b644b;});}return null;};}function removeEntity(_0x4238a,_0x54990e){return function(_0x33dfd9){if(_0x33dfd9){return _0x33dfd9[_0x2d60('0x22')]()[_0x2d60('0x23')](function(){_0x4238a[_0x2d60('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2dd75c,_0x8b8df3){return function(_0x129d06){if(!_0x129d06){_0x2dd75c['sendStatus'](0x194);}return _0x129d06;};}function handleError(_0x2a2942,_0x1d1ec3){_0x1d1ec3=_0x1d1ec3||0x1f4;return function(_0x1262c8){logger['error'](_0x1262c8['stack']);if(_0x1262c8[_0x2d60('0x24')]){delete _0x1262c8[_0x2d60('0x24')];}_0x2a2942[_0x2d60('0x17')](_0x1d1ec3)[_0x2d60('0x25')](_0x1262c8);};}exports[_0x2d60('0x26')]=function(_0x43ea58,_0x4f368d){var _0x25456e={},_0x6b918e={},_0x42b621={'count':0x0,'rows':[]};var _0x280b95=_[_0x2d60('0x27')](db[_0x2d60('0x28')][_0x2d60('0x29')],function(_0x3d2bbf){return{'name':_0x3d2bbf['fieldName'],'type':_0x3d2bbf[_0x2d60('0x2a')]['key']};});_0x6b918e['model']=_[_0x2d60('0x27')](_0x280b95,_0x2d60('0x24'));_0x6b918e[_0x2d60('0x2b')]=_[_0x2d60('0x2c')](_0x43ea58[_0x2d60('0x2b')]);_0x6b918e[_0x2d60('0x2d')]=_[_0x2d60('0x2e')](_0x6b918e[_0x2d60('0x2f')],_0x6b918e['query']);_0x25456e[_0x2d60('0x30')]=_[_0x2d60('0x2e')](_0x6b918e['model'],qs[_0x2d60('0x31')](_0x43ea58[_0x2d60('0x2b')][_0x2d60('0x31')]));_0x25456e['attributes']=_0x25456e[_0x2d60('0x30')][_0x2d60('0x32')]?_0x25456e['attributes']:_0x6b918e[_0x2d60('0x2f')];if(!_0x43ea58[_0x2d60('0x2b')][_0x2d60('0x33')]('nolimit')){_0x25456e[_0x2d60('0x1b')]=qs[_0x2d60('0x1b')](_0x43ea58[_0x2d60('0x2b')][_0x2d60('0x1b')]);_0x25456e[_0x2d60('0x19')]=qs[_0x2d60('0x19')](_0x43ea58[_0x2d60('0x2b')][_0x2d60('0x19')]);}_0x25456e[_0x2d60('0x34')]=qs[_0x2d60('0x35')](_0x43ea58[_0x2d60('0x2b')][_0x2d60('0x35')]);_0x25456e[_0x2d60('0x36')]=qs[_0x2d60('0x2d')](_['pick'](_0x43ea58[_0x2d60('0x2b')],_0x6b918e['filters']),_0x280b95);if(_0x43ea58['query'][_0x2d60('0x37')]){_0x25456e[_0x2d60('0x36')]=_[_0x2d60('0x38')](_0x25456e[_0x2d60('0x36')],{'$or':_[_0x2d60('0x27')](_0x280b95,function(_0x1e0145){if(_0x1e0145[_0x2d60('0x2a')]!==_0x2d60('0x39')){var _0x1c964d={};_0x1c964d[_0x1e0145[_0x2d60('0x24')]]={'$like':'%'+_0x43ea58[_0x2d60('0x2b')][_0x2d60('0x37')]+'%'};return _0x1c964d;}})});}_0x25456e=_[_0x2d60('0x38')]({},_0x25456e,_0x43ea58[_0x2d60('0x3a')]);var _0xd0f706={'where':_0x25456e[_0x2d60('0x36')]};return db[_0x2d60('0x28')][_0x2d60('0x1c')](_0xd0f706)[_0x2d60('0x23')](function(_0x439df9){_0x42b621[_0x2d60('0x1c')]=_0x439df9;if(_0x43ea58[_0x2d60('0x2b')][_0x2d60('0x3b')]){_0x25456e[_0x2d60('0x3c')]=[{'all':!![]}];}return db[_0x2d60('0x28')][_0x2d60('0x3d')](_0x25456e);})['then'](function(_0x115d78){_0x42b621[_0x2d60('0x3e')]=_0x115d78;return _0x42b621;})['then'](respondWithFilteredResult(_0x4f368d,_0x25456e))['catch'](handleError(_0x4f368d,null));};exports[_0x2d60('0x3f')]=function(_0xbf1d4,_0x476477){var _0x2e3b79={'raw':![],'where':{'id':_0xbf1d4[_0x2d60('0x40')]['id']}},_0x18d516={};_0x18d516[_0x2d60('0x2f')]=_[_0x2d60('0x2c')](db[_0x2d60('0x28')]['rawAttributes']);_0x18d516[_0x2d60('0x2b')]=_[_0x2d60('0x2c')](_0xbf1d4[_0x2d60('0x2b')]);_0x18d516[_0x2d60('0x2d')]=_[_0x2d60('0x2e')](_0x18d516[_0x2d60('0x2f')],_0x18d516[_0x2d60('0x2b')]);_0x2e3b79[_0x2d60('0x30')]=_[_0x2d60('0x2e')](_0x18d516['model'],qs['fields'](_0xbf1d4[_0x2d60('0x2b')][_0x2d60('0x31')]));_0x2e3b79['attributes']=_0x2e3b79[_0x2d60('0x30')][_0x2d60('0x32')]?_0x2e3b79[_0x2d60('0x30')]:_0x18d516[_0x2d60('0x2f')];if(_0xbf1d4[_0x2d60('0x2b')][_0x2d60('0x3b')]){_0x2e3b79['include']=[{'all':!![]}];}_0x2e3b79=_[_0x2d60('0x38')]({},_0x2e3b79,_0xbf1d4[_0x2d60('0x3a')]);return db[_0x2d60('0x28')][_0x2d60('0x41')](_0x2e3b79)[_0x2d60('0x23')](handleEntityNotFound(_0x476477,null))[_0x2d60('0x23')](respondWithResult(_0x476477,null))['catch'](handleError(_0x476477,null));};exports[_0x2d60('0x42')]=function(_0x4ad612,_0x3023c1){return db['FreshdeskConfiguration'][_0x2d60('0x42')](_0x4ad612[_0x2d60('0x43')],{})[_0x2d60('0x23')](respondWithResult(_0x3023c1,0xc9))[_0x2d60('0x44')](handleError(_0x3023c1,null));};exports[_0x2d60('0x45')]=function(_0x484fff,_0x1132b9){if(_0x484fff[_0x2d60('0x43')]['id']){delete _0x484fff[_0x2d60('0x43')]['id'];}return db[_0x2d60('0x28')][_0x2d60('0x41')]({'where':{'id':_0x484fff[_0x2d60('0x40')]['id']}})[_0x2d60('0x23')](handleEntityNotFound(_0x1132b9,null))[_0x2d60('0x23')](saveUpdates(_0x484fff[_0x2d60('0x43')],null))[_0x2d60('0x23')](respondWithResult(_0x1132b9,null))[_0x2d60('0x44')](handleError(_0x1132b9,null));};exports['destroy']=function(_0x1db1cb,_0x3b8bb4){return db[_0x2d60('0x28')][_0x2d60('0x41')]({'where':{'id':_0x1db1cb[_0x2d60('0x40')]['id']}})[_0x2d60('0x23')](handleEntityNotFound(_0x3b8bb4,null))[_0x2d60('0x23')](removeEntity(_0x3b8bb4,null))['catch'](handleError(_0x3b8bb4,null));};exports['getFields']=function(_0x3850d5,_0x4acda0,_0x53f15b){var _0x4c0d31={};var _0x389ae6={};var _0x2413a5;var _0x5691c7;return db[_0x2d60('0x28')]['findOne']({'where':{'id':_0x3850d5[_0x2d60('0x40')]['id']}})[_0x2d60('0x23')](handleEntityNotFound(_0x4acda0,null))[_0x2d60('0x23')](function(_0x14dca1){if(_0x14dca1){_0x2413a5=_0x14dca1;_0x389ae6[_0x2d60('0x2f')]=_[_0x2d60('0x2c')](db[_0x2d60('0x46')]['rawAttributes']);_0x389ae6['query']=_[_0x2d60('0x2c')](_0x3850d5[_0x2d60('0x2b')]);_0x389ae6[_0x2d60('0x2d')]=_['intersection'](_0x389ae6[_0x2d60('0x2f')],_0x389ae6[_0x2d60('0x2b')]);_0x4c0d31[_0x2d60('0x30')]=_[_0x2d60('0x2e')](_0x389ae6['model'],qs['fields'](_0x3850d5['query']['fields']));_0x4c0d31[_0x2d60('0x30')]=_0x4c0d31[_0x2d60('0x30')][_0x2d60('0x32')]?_0x4c0d31['attributes']:_0x389ae6[_0x2d60('0x2f')];_0x4c0d31[_0x2d60('0x34')]=qs[_0x2d60('0x35')](_0x3850d5[_0x2d60('0x2b')][_0x2d60('0x35')]);_0x4c0d31[_0x2d60('0x36')]=qs[_0x2d60('0x2d')](_[_0x2d60('0x47')](_0x3850d5[_0x2d60('0x2b')],_0x389ae6[_0x2d60('0x2d')]));if(_0x3850d5[_0x2d60('0x2b')][_0x2d60('0x37')]){_0x4c0d31[_0x2d60('0x36')]=_['merge'](_0x4c0d31[_0x2d60('0x36')],{'$or':_[_0x2d60('0x27')](_0x4c0d31['attributes'],function(_0x442fad){var _0x5924a7={};_0x5924a7[_0x442fad]={'$like':'%'+_0x3850d5[_0x2d60('0x2b')]['filter']+'%'};return _0x5924a7;})});}_0x4c0d31=_[_0x2d60('0x38')]({},_0x4c0d31,_0x3850d5[_0x2d60('0x3a')]);return _0x2413a5['getFields'](_0x4c0d31);}})[_0x2d60('0x23')](function(_0x2b5d5f){if(_0x2b5d5f){_0x5691c7=_0x2b5d5f[_0x2d60('0x32')];if(!_0x3850d5['query'][_0x2d60('0x33')](_0x2d60('0x48'))){_0x4c0d31[_0x2d60('0x1b')]=qs[_0x2d60('0x1b')](_0x3850d5['query'][_0x2d60('0x1b')]);_0x4c0d31[_0x2d60('0x19')]=qs[_0x2d60('0x19')](_0x3850d5[_0x2d60('0x2b')][_0x2d60('0x19')]);}return _0x2413a5[_0x2d60('0x49')](_0x4c0d31);}})['then'](function(_0x384f13){if(_0x384f13){return _0x384f13?{'count':_0x5691c7,'rows':_0x384f13}:null;}})[_0x2d60('0x23')](respondWithResult(_0x4acda0,null))['catch'](handleError(_0x4acda0,null));};exports[_0x2d60('0x4a')]=function(_0xb83e1,_0x509a31,_0x23742d){var _0x48bd11={};var _0x2a8aec={};var _0x305c5e;var _0x4e2d3a;return db[_0x2d60('0x28')][_0x2d60('0x4b')]({'where':{'id':_0xb83e1[_0x2d60('0x40')]['id']}})[_0x2d60('0x23')](handleEntityNotFound(_0x509a31,null))[_0x2d60('0x23')](function(_0x3c4e9e){if(_0x3c4e9e){_0x305c5e=_0x3c4e9e;_0x2a8aec[_0x2d60('0x2f')]=_[_0x2d60('0x2c')](db[_0x2d60('0x46')][_0x2d60('0x29')]);_0x2a8aec[_0x2d60('0x2b')]=_['keys'](_0xb83e1[_0x2d60('0x2b')]);_0x2a8aec[_0x2d60('0x2d')]=_[_0x2d60('0x2e')](_0x2a8aec['model'],_0x2a8aec[_0x2d60('0x2b')]);_0x48bd11[_0x2d60('0x30')]=_['intersection'](_0x2a8aec['model'],qs[_0x2d60('0x31')](_0xb83e1[_0x2d60('0x2b')]['fields']));_0x48bd11['attributes']=_0x48bd11['attributes'][_0x2d60('0x32')]?_0x48bd11[_0x2d60('0x30')]:_0x2a8aec[_0x2d60('0x2f')];_0x48bd11[_0x2d60('0x34')]=qs['sort'](_0xb83e1[_0x2d60('0x2b')]['sort']);_0x48bd11[_0x2d60('0x36')]=qs[_0x2d60('0x2d')](_[_0x2d60('0x47')](_0xb83e1[_0x2d60('0x2b')],_0x2a8aec[_0x2d60('0x2d')]));if(_0xb83e1['query'][_0x2d60('0x37')]){_0x48bd11[_0x2d60('0x36')]=_[_0x2d60('0x38')](_0x48bd11[_0x2d60('0x36')],{'$or':_[_0x2d60('0x27')](_0x48bd11[_0x2d60('0x30')],function(_0x1a6620){var _0x436b14={};_0x436b14[_0x1a6620]={'$like':'%'+_0xb83e1[_0x2d60('0x2b')][_0x2d60('0x37')]+'%'};return _0x436b14;})});}_0x48bd11=_[_0x2d60('0x38')]({},_0x48bd11,_0xb83e1[_0x2d60('0x3a')]);return _0x305c5e[_0x2d60('0x4a')](_0x48bd11);}})[_0x2d60('0x23')](function(_0x58f4e3){if(_0x58f4e3){_0x4e2d3a=_0x58f4e3[_0x2d60('0x32')];if(!_0xb83e1[_0x2d60('0x2b')][_0x2d60('0x33')](_0x2d60('0x48'))){_0x48bd11['limit']=qs[_0x2d60('0x1b')](_0xb83e1['query']['limit']);_0x48bd11[_0x2d60('0x19')]=qs['offset'](_0xb83e1[_0x2d60('0x2b')][_0x2d60('0x19')]);}return _0x305c5e[_0x2d60('0x4a')](_0x48bd11);}})[_0x2d60('0x23')](function(_0x19ea1f){if(_0x19ea1f){return _0x19ea1f?{'count':_0x4e2d3a,'rows':_0x19ea1f}:null;}})[_0x2d60('0x23')](respondWithResult(_0x509a31,null))['catch'](handleError(_0x509a31,null));};exports[_0x2d60('0x4c')]=function(_0x3d3690,_0x142348,_0x18f938){var _0x11ab5a={};var _0x4f3f12={};var _0x490df6;var _0xee8cd6;return db[_0x2d60('0x28')]['findOne']({'where':{'id':_0x3d3690['params']['id']}})[_0x2d60('0x23')](handleEntityNotFound(_0x142348,null))['then'](function(_0x1d55f0){if(_0x1d55f0){_0x490df6=_0x1d55f0;_0x4f3f12[_0x2d60('0x2f')]=_[_0x2d60('0x2c')](db[_0x2d60('0x46')]['rawAttributes']);_0x4f3f12[_0x2d60('0x2b')]=_[_0x2d60('0x2c')](_0x3d3690['query']);_0x4f3f12[_0x2d60('0x2d')]=_['intersection'](_0x4f3f12[_0x2d60('0x2f')],_0x4f3f12[_0x2d60('0x2b')]);_0x11ab5a[_0x2d60('0x30')]=_[_0x2d60('0x2e')](_0x4f3f12['model'],qs[_0x2d60('0x31')](_0x3d3690[_0x2d60('0x2b')][_0x2d60('0x31')]));_0x11ab5a[_0x2d60('0x30')]=_0x11ab5a[_0x2d60('0x30')][_0x2d60('0x32')]?_0x11ab5a['attributes']:_0x4f3f12[_0x2d60('0x2f')];_0x11ab5a[_0x2d60('0x34')]=qs[_0x2d60('0x35')](_0x3d3690[_0x2d60('0x2b')][_0x2d60('0x35')]);_0x11ab5a[_0x2d60('0x36')]=qs['filters'](_[_0x2d60('0x47')](_0x3d3690['query'],_0x4f3f12['filters']));if(_0x3d3690['query'][_0x2d60('0x37')]){_0x11ab5a['where']=_[_0x2d60('0x38')](_0x11ab5a['where'],{'$or':_[_0x2d60('0x27')](_0x11ab5a[_0x2d60('0x30')],function(_0x10cc40){var _0x3b0f0f={};_0x3b0f0f[_0x10cc40]={'$like':'%'+_0x3d3690[_0x2d60('0x2b')][_0x2d60('0x37')]+'%'};return _0x3b0f0f;})});}_0x11ab5a=_[_0x2d60('0x38')]({},_0x11ab5a,_0x3d3690[_0x2d60('0x3a')]);return _0x490df6['getDescriptions'](_0x11ab5a);}})[_0x2d60('0x23')](function(_0xabb800){if(_0xabb800){_0xee8cd6=_0xabb800['length'];if(!_0x3d3690[_0x2d60('0x2b')][_0x2d60('0x33')](_0x2d60('0x48'))){_0x11ab5a['limit']=qs['limit'](_0x3d3690['query'][_0x2d60('0x1b')]);_0x11ab5a[_0x2d60('0x19')]=qs[_0x2d60('0x19')](_0x3d3690[_0x2d60('0x2b')][_0x2d60('0x19')]);}return _0x490df6['getDescriptions'](_0x11ab5a);}})[_0x2d60('0x23')](function(_0x191175){if(_0x191175){return _0x191175?{'count':_0xee8cd6,'rows':_0x191175}:null;}})['then'](respondWithResult(_0x142348,null))[_0x2d60('0x44')](handleError(_0x142348,null));};exports['getTags']=function(_0x5931b4,_0x14ca34,_0x5e3e93){var _0x5b64d0={};var _0xc3cc07={};var _0x57518e;var _0x3916ff;return db['FreshdeskConfiguration'][_0x2d60('0x4b')]({'where':{'id':_0x5931b4[_0x2d60('0x40')]['id']}})['then'](handleEntityNotFound(_0x14ca34,null))[_0x2d60('0x23')](function(_0x112d49){if(_0x112d49){_0x57518e=_0x112d49;_0xc3cc07[_0x2d60('0x2f')]=_[_0x2d60('0x2c')](db[_0x2d60('0x4d')][_0x2d60('0x29')]);_0xc3cc07[_0x2d60('0x2b')]=_[_0x2d60('0x2c')](_0x5931b4[_0x2d60('0x2b')]);_0xc3cc07[_0x2d60('0x2d')]=_[_0x2d60('0x2e')](_0xc3cc07[_0x2d60('0x2f')],_0xc3cc07[_0x2d60('0x2b')]);_0x5b64d0[_0x2d60('0x30')]=_[_0x2d60('0x2e')](_0xc3cc07[_0x2d60('0x2f')],qs[_0x2d60('0x31')](_0x5931b4[_0x2d60('0x2b')][_0x2d60('0x31')]));_0x5b64d0[_0x2d60('0x30')]=_0x5b64d0[_0x2d60('0x30')][_0x2d60('0x32')]?_0x5b64d0[_0x2d60('0x30')]:_0xc3cc07['model'];_0x5b64d0[_0x2d60('0x34')]=qs[_0x2d60('0x35')](_0x5931b4[_0x2d60('0x2b')][_0x2d60('0x35')]);_0x5b64d0['where']=qs[_0x2d60('0x2d')](_['pick'](_0x5931b4[_0x2d60('0x2b')],_0xc3cc07[_0x2d60('0x2d')]));if(_0x5931b4[_0x2d60('0x2b')][_0x2d60('0x37')]){_0x5b64d0['where']=_['merge'](_0x5b64d0[_0x2d60('0x36')],{'$or':_['map'](_0x5b64d0['attributes'],function(_0x4bf1ce){var _0x313ec6={};_0x313ec6[_0x4bf1ce]={'$like':'%'+_0x5931b4[_0x2d60('0x2b')][_0x2d60('0x37')]+'%'};return _0x313ec6;})});}_0x5b64d0=_[_0x2d60('0x38')]({},_0x5b64d0,_0x5931b4['options']);return _0x57518e['getTags'](_0x5b64d0);}})[_0x2d60('0x23')](function(_0x503391){if(_0x503391){_0x3916ff=_0x503391[_0x2d60('0x32')];if(!_0x5931b4[_0x2d60('0x2b')][_0x2d60('0x33')](_0x2d60('0x48'))){_0x5b64d0[_0x2d60('0x1b')]=qs[_0x2d60('0x1b')](_0x5931b4[_0x2d60('0x2b')][_0x2d60('0x1b')]);_0x5b64d0[_0x2d60('0x19')]=qs['offset'](_0x5931b4[_0x2d60('0x2b')][_0x2d60('0x19')]);}return _0x57518e[_0x2d60('0x4e')](_0x5b64d0);}})[_0x2d60('0x23')](function(_0x47161a){if(_0x47161a){return _0x47161a?{'count':_0x3916ff,'rows':_0x47161a}:null;}})['then'](respondWithResult(_0x14ca34,null))[_0x2d60('0x44')](handleError(_0x14ca34,null));};exports['setTags']=function(_0x3143d2,_0x3bb719,_0x8aa995){if(_0x3143d2[_0x2d60('0x43')]['id']){delete _0x3143d2['body']['id'];}return db[_0x2d60('0x28')]['findOne']({'where':{'id':_0x3143d2[_0x2d60('0x40')]['id']}})[_0x2d60('0x23')](handleEntityNotFound(_0x3bb719,null))[_0x2d60('0x23')](function(_0x3494e8){if(_0x3494e8){return _0x3494e8[_0x2d60('0x4f')](_0x3143d2[_0x2d60('0x43')][_0x2d60('0x50')]||[]);}return null;})[_0x2d60('0x23')](respondWithResult(_0x3bb719,null))[_0x2d60('0x44')](handleError(_0x3bb719,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 624cc8b..46d531b 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 _0x526d=['../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','util','moment','bluebird','request-promise','path'];(function(_0x9c3c56,_0x169b56){var _0x2dd782=function(_0x386962){while(--_0x386962){_0x9c3c56['push'](_0x9c3c56['shift']());}};_0x2dd782(++_0x169b56);}(_0x526d,0xed));var _0xd526=function(_0x28bf0c,_0xb50710){_0x28bf0c=_0x28bf0c-0x0;var _0x53795e=_0x526d[_0x28bf0c];return _0x53795e;};'use strict';var _=require('lodash');var util=require(_0xd526('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xd526('0x1'));var BPromise=require(_0xd526('0x2'));var rp=require(_0xd526('0x3'));var fs=require('fs');var path=require(_0xd526('0x4'));var rimraf=require('rimraf');var config=require(_0xd526('0x5'));var attributes=require(_0xd526('0x6'));module[_0xd526('0x7')]=function(_0x2574c1,_0x3ad607){return _0x2574c1[_0xd526('0x8')](_0xd526('0x9'),attributes,{'tableName':_0xd526('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1ce1=['./intFreshdeskConfiguration.attributes','exports','define','int_freshdesk_configurations','lodash','../../config/logger','moment','request-promise','path','../../config/environment'];(function(_0x7243a5,_0x56f8ad){var _0x390c91=function(_0x8be647){while(--_0x8be647){_0x7243a5['push'](_0x7243a5['shift']());}};_0x390c91(++_0x56f8ad);}(_0x1ce1,0x14e));var _0x11ce=function(_0x5c0de5,_0x30df16){_0x5c0de5=_0x5c0de5-0x0;var _0x4a612c=_0x1ce1[_0x5c0de5];return _0x4a612c;};'use strict';var _=require(_0x11ce('0x0'));var util=require('util');var logger=require(_0x11ce('0x1'))('api');var moment=require(_0x11ce('0x2'));var BPromise=require('bluebird');var rp=require(_0x11ce('0x3'));var fs=require('fs');var path=require(_0x11ce('0x4'));var rimraf=require('rimraf');var config=require(_0x11ce('0x5'));var attributes=require(_0x11ce('0x6'));module[_0x11ce('0x7')]=function(_0x44c1d6,_0x63fd80){return _0x44c1d6[_0x11ce('0x8')]('FreshdeskConfiguration',attributes,{'tableName':_0x11ce('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 f3b97ff..d05ac13 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 _0x89f6=['http','request','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x477001,_0x2a9aa4){var _0x3f7576=function(_0x4ea24f){while(--_0x4ea24f){_0x477001['push'](_0x477001['shift']());}};_0x3f7576(++_0x2a9aa4);}(_0x89f6,0xd3));var _0x689f=function(_0x3f0b30,_0x159bc8){_0x3f0b30=_0x3f0b30-0x0;var _0x2748a5=_0x89f6[_0x3f0b30];return _0x2748a5;};'use strict';var _=require(_0x689f('0x0'));var util=require('util');var moment=require(_0x689f('0x1'));var BPromise=require(_0x689f('0x2'));var rs=require(_0x689f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x689f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x689f('0x5'))('rpc');var config=require(_0x689f('0x6'));var jayson=require(_0x689f('0x7'));var client=jayson[_0x689f('0x8')][_0x689f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ef78a,_0x4a2498,_0x5d2db6){return new BPromise(function(_0x4098b4,_0x117e8b){return client[_0x689f('0xa')](_0x3ef78a,_0x5d2db6)[_0x689f('0xb')](function(_0x376bdd){logger['info'](_0x689f('0xc'),_0x4a2498,_0x689f('0xd'));logger[_0x689f('0xe')](_0x689f('0xf'),_0x4a2498,_0x689f('0xd'),JSON[_0x689f('0x10')](_0x376bdd));if(_0x376bdd['error']){if(_0x376bdd[_0x689f('0x11')][_0x689f('0x12')]===0x1f4){logger[_0x689f('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x4a2498,_0x376bdd[_0x689f('0x11')]['message']);return _0x117e8b(_0x376bdd[_0x689f('0x11')]['message']);}logger[_0x689f('0x11')](_0x689f('0xc'),_0x4a2498,_0x376bdd[_0x689f('0x11')][_0x689f('0x13')]);return _0x4098b4(_0x376bdd[_0x689f('0x11')][_0x689f('0x13')]);}else{logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x4a2498,'request\x20sent');_0x4098b4(_0x376bdd[_0x689f('0x14')]['message']);}})[_0x689f('0x15')](function(_0x23108c){logger[_0x689f('0x11')](_0x689f('0xc'),_0x4a2498,_0x23108c);_0x117e8b(_0x23108c);});});} \ No newline at end of file +var _0x8734=['code','FreshdeskConfiguration,\x20%s,\x20%s','message','result','catch','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','debug','request\x20sent','stringify','error'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x8734,0x7d));var _0x4873=function(_0x4a5356,_0x20f134){_0x4a5356=_0x4a5356-0x0;var _0x4beb93=_0x8734[_0x4a5356];return _0x4beb93;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4873('0x0'));var BPromise=require(_0x4873('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4873('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x4873('0x3'));var logger=require(_0x4873('0x4'))('rpc');var config=require(_0x4873('0x5'));var jayson=require(_0x4873('0x6'));var client=jayson[_0x4873('0x7')][_0x4873('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x25a7e4,_0x319540,_0x57e88b){return new BPromise(function(_0x4b7e62,_0x261954){return client[_0x4873('0x9')](_0x25a7e4,_0x57e88b)['then'](function(_0xe976ff){logger[_0x4873('0xa')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x319540,'request\x20sent');logger[_0x4873('0xb')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x319540,_0x4873('0xc'),JSON[_0x4873('0xd')](_0xe976ff));if(_0xe976ff[_0x4873('0xe')]){if(_0xe976ff[_0x4873('0xe')][_0x4873('0xf')]===0x1f4){logger['error'](_0x4873('0x10'),_0x319540,_0xe976ff[_0x4873('0xe')][_0x4873('0x11')]);return _0x261954(_0xe976ff['error'][_0x4873('0x11')]);}logger[_0x4873('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x319540,_0xe976ff[_0x4873('0xe')][_0x4873('0x11')]);return _0x4b7e62(_0xe976ff[_0x4873('0xe')][_0x4873('0x11')]);}else{logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x319540,'request\x20sent');_0x4b7e62(_0xe976ff[_0x4873('0x12')][_0x4873('0x11')]);}})[_0x4873('0x13')](function(_0xe4a676){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x319540,_0xe4a676);_0x261954(_0xe4a676);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 7d56dfb..9aef44c 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 _0x4fbc=['/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskField.controller','get','index'];(function(_0x31879d,_0x329f43){var _0x4b20e6=function(_0x5d1775){while(--_0x5d1775){_0x31879d['push'](_0x31879d['shift']());}};_0x4b20e6(++_0x329f43);}(_0x4fbc,0xb1));var _0xc4fb=function(_0x37373b,_0x27a75f){_0x37373b=_0x37373b-0x0;var _0x4eca20=_0x4fbc[_0x37373b];return _0x4eca20;};'use strict';var multer=require(_0xc4fb('0x0'));var util=require(_0xc4fb('0x1'));var path=require(_0xc4fb('0x2'));var timeout=require(_0xc4fb('0x3'));var express=require(_0xc4fb('0x4'));var router=express[_0xc4fb('0x5')]();var fs_extra=require(_0xc4fb('0x6'));var auth=require(_0xc4fb('0x7'));var interaction=require(_0xc4fb('0x8'));var config=require('../../config/environment');var controller=require(_0xc4fb('0x9'));router[_0xc4fb('0xa')]('/',auth['isAuthenticated'](),controller[_0xc4fb('0xb')]);router[_0xc4fb('0xa')](_0xc4fb('0xc'),auth['isAuthenticated'](),controller[_0xc4fb('0xd')]);router[_0xc4fb('0xe')]('/',auth['isAuthenticated'](),controller[_0xc4fb('0xf')]);router[_0xc4fb('0x10')](_0xc4fb('0xc'),auth['isAuthenticated'](),controller[_0xc4fb('0x11')]);router[_0xc4fb('0x12')](_0xc4fb('0xc'),auth['isAuthenticated'](),controller[_0xc4fb('0x13')]);module[_0xc4fb('0x14')]=router; \ No newline at end of file +var _0x7003=['./intFreshdeskField.controller','get','index','/:id','isAuthenticated','show','post','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra'];(function(_0x4a4aaa,_0x48cc0f){var _0x4b9edd=function(_0x397697){while(--_0x397697){_0x4a4aaa['push'](_0x4a4aaa['shift']());}};_0x4b9edd(++_0x48cc0f);}(_0x7003,0x64));var _0x3700=function(_0x281e5e,_0xf320e2){_0x281e5e=_0x281e5e-0x0;var _0x5a22d2=_0x7003[_0x281e5e];return _0x5a22d2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3700('0x0'));var timeout=require(_0x3700('0x1'));var express=require(_0x3700('0x2'));var router=express[_0x3700('0x3')]();var fs_extra=require(_0x3700('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3700('0x5'));router[_0x3700('0x6')]('/',auth['isAuthenticated'](),controller[_0x3700('0x7')]);router[_0x3700('0x6')](_0x3700('0x8'),auth[_0x3700('0x9')](),controller[_0x3700('0xa')]);router[_0x3700('0xb')]('/',auth[_0x3700('0x9')](),controller['create']);router['put'](_0x3700('0x8'),auth[_0x3700('0x9')](),controller['update']);router[_0x3700('0xc')]('/:id',auth[_0x3700('0x9')](),controller[_0x3700('0xd')]);module[_0x3700('0xe')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index efd791b..628c91b 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 _0x0f27=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','exports'];(function(_0x221b90,_0x2117d8){var _0x5c3753=function(_0x3586cb){while(--_0x3586cb){_0x221b90['push'](_0x221b90['shift']());}};_0x5c3753(++_0x2117d8);}(_0x0f27,0x1b8));var _0x70f2=function(_0x45cd59,_0x5be7c0){_0x45cd59=_0x45cd59-0x0;var _0x39541a=_0x0f27[_0x45cd59];return _0x39541a;};'use strict';var Sequelize=require('sequelize');module[_0x70f2('0x0')]={'type':{'type':Sequelize[_0x70f2('0x1')](_0x70f2('0x2'),_0x70f2('0x3'),_0x70f2('0x4'),_0x70f2('0x5'),_0x70f2('0x6')),'defaultValue':_0x70f2('0x2')},'content':{'type':Sequelize[_0x70f2('0x7')]},'key':{'type':Sequelize[_0x70f2('0x7')]},'keyType':{'type':Sequelize['ENUM']('string',_0x70f2('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x70f2('0x7')]},'nameField':{'type':Sequelize[_0x70f2('0x7')]},'customField':{'type':Sequelize[_0x70f2('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x70f2('0x7')]}}; \ No newline at end of file +var _0x9fa0=['STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable','keyValue','picklist','string'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9fa0,0x98));var _0x09fa=function(_0xd7b0a4,_0x53c7d3){_0xd7b0a4=_0xd7b0a4-0x0;var _0x184e9e=_0x9fa0[_0xd7b0a4];return _0x184e9e;};'use strict';var Sequelize=require(_0x09fa('0x0'));module[_0x09fa('0x1')]={'type':{'type':Sequelize[_0x09fa('0x2')]('string',_0x09fa('0x3'),_0x09fa('0x4'),_0x09fa('0x5'),_0x09fa('0x6')),'defaultValue':_0x09fa('0x7')},'content':{'type':Sequelize[_0x09fa('0x8')]},'key':{'type':Sequelize[_0x09fa('0x8')]},'keyType':{'type':Sequelize[_0x09fa('0x2')]('string',_0x09fa('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x09fa('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x09fa('0x8')]},'customField':{'type':Sequelize[_0x09fa('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 94939ed..234bfa4 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 _0x0db9=['where','filter','merge','FreshdeskField','includeAll','include','findAll','rows','catch','show','keys','options','find','create','body','params','destroy','eml-format','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort'];(function(_0x23b612,_0x440ea6){var _0x104bcb=function(_0x37f7a4){while(--_0x37f7a4){_0x23b612['push'](_0x23b612['shift']());}};_0x104bcb(++_0x440ea6);}(_0x0db9,0xa3));var _0x90db=function(_0xa041de,_0x3600e2){_0xa041de=_0xa041de-0x0;var _0x1d654c=_0x0db9[_0xa041de];return _0x1d654c;};'use strict';var emlformat=require(_0x90db('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x90db('0x1'));var moment=require(_0x90db('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x90db('0x3'));var util=require('util');var path=require(_0x90db('0x4'));var sox=require(_0x90db('0x5'));var csv=require('to-csv');var ejs=require(_0x90db('0x6'));var fs=require('fs');var fs_extra=require(_0x90db('0x7'));var _=require(_0x90db('0x8'));var squel=require(_0x90db('0x9'));var crypto=require(_0x90db('0xa'));var jsforce=require(_0x90db('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x90db('0xc'));var querystring=require(_0x90db('0xd'));var Papa=require(_0x90db('0xe'));var Redis=require(_0x90db('0xf'));var authService=require(_0x90db('0x10'));var qs=require(_0x90db('0x11'));var as=require(_0x90db('0x12'));var hardwareService=require(_0x90db('0x13'));var logger=require(_0x90db('0x14'))(_0x90db('0x15'));var utils=require(_0x90db('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x90db('0x17'));var db=require(_0x90db('0x18'))['db'];function respondWithStatusCode(_0x45ad3c,_0x436327){_0x436327=_0x436327||0xcc;return function(_0x1b410d){if(_0x1b410d){return _0x45ad3c[_0x90db('0x19')](_0x436327);}return _0x45ad3c[_0x90db('0x1a')](_0x436327)[_0x90db('0x1b')]();};}function respondWithResult(_0x7826f7,_0x309aea){_0x309aea=_0x309aea||0xc8;return function(_0x334e22){if(_0x334e22){return _0x7826f7[_0x90db('0x1a')](_0x309aea)[_0x90db('0x1c')](_0x334e22);}};}function respondWithFilteredResult(_0xda2abe,_0x544226){return function(_0x3124d4){if(_0x3124d4){var _0x5ef456=typeof _0x544226[_0x90db('0x1d')]===_0x90db('0x1e')&&typeof _0x544226[_0x90db('0x1f')]===_0x90db('0x1e');var _0x32ff04=_0x3124d4[_0x90db('0x20')];var _0x15e33e=_0x5ef456?0x0:_0x544226[_0x90db('0x1d')];var _0x24a16a=_0x5ef456?_0x3124d4[_0x90db('0x20')]:_0x544226['offset']+_0x544226[_0x90db('0x1f')];var _0x445a22;if(_0x24a16a>=_0x32ff04){_0x24a16a=_0x32ff04;_0x445a22=0xc8;}else{_0x445a22=0xce;}_0xda2abe['status'](_0x445a22);return _0xda2abe['set'](_0x90db('0x21'),_0x15e33e+'-'+_0x24a16a+'/'+_0x32ff04)[_0x90db('0x1c')](_0x3124d4);}return null;};}function patchUpdates(_0x300dc2){return function(_0x3a58c4){try{jsonpatch[_0x90db('0x22')](_0x3a58c4,_0x300dc2,!![]);}catch(_0x168eaf){return BPromise[_0x90db('0x23')](_0x168eaf);}return _0x3a58c4['save']();};}function saveUpdates(_0xb45340,_0x1aeab9){return function(_0x23934a){if(_0x23934a){return _0x23934a[_0x90db('0x24')](_0xb45340)['then'](function(_0x43028e){return _0x43028e;});}return null;};}function removeEntity(_0x5a98f6,_0x459068){return function(_0x19f9c6){if(_0x19f9c6){return _0x19f9c6['destroy']()[_0x90db('0x25')](function(){_0x5a98f6[_0x90db('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f8469,_0x3e3fbd){return function(_0x5b3c09){if(!_0x5b3c09){_0x2f8469[_0x90db('0x19')](0x194);}return _0x5b3c09;};}function handleError(_0xe026cf,_0x1cc660){_0x1cc660=_0x1cc660||0x1f4;return function(_0x94cd84){logger['error'](_0x94cd84[_0x90db('0x26')]);if(_0x94cd84[_0x90db('0x27')]){delete _0x94cd84[_0x90db('0x27')];}_0xe026cf[_0x90db('0x1a')](_0x1cc660)[_0x90db('0x28')](_0x94cd84);};}exports[_0x90db('0x29')]=function(_0x44b5b6,_0x3c7f67){var _0x4c6311={},_0x3489d1={},_0x552c2e={'count':0x0,'rows':[]};var _0xa2bb=_[_0x90db('0x2a')](db['FreshdeskField'][_0x90db('0x2b')],function(_0xfc4ceb){return{'name':_0xfc4ceb[_0x90db('0x2c')],'type':_0xfc4ceb[_0x90db('0x2d')]['key']};});_0x3489d1[_0x90db('0x2e')]=_[_0x90db('0x2a')](_0xa2bb,_0x90db('0x27'));_0x3489d1['query']=_['keys'](_0x44b5b6[_0x90db('0x2f')]);_0x3489d1[_0x90db('0x30')]=_[_0x90db('0x31')](_0x3489d1['model'],_0x3489d1[_0x90db('0x2f')]);_0x4c6311[_0x90db('0x32')]=_['intersection'](_0x3489d1[_0x90db('0x2e')],qs[_0x90db('0x33')](_0x44b5b6['query'][_0x90db('0x33')]));_0x4c6311[_0x90db('0x32')]=_0x4c6311[_0x90db('0x32')][_0x90db('0x34')]?_0x4c6311['attributes']:_0x3489d1['model'];if(!_0x44b5b6[_0x90db('0x2f')]['hasOwnProperty'](_0x90db('0x35'))){_0x4c6311[_0x90db('0x1f')]=qs[_0x90db('0x1f')](_0x44b5b6['query'][_0x90db('0x1f')]);_0x4c6311['offset']=qs[_0x90db('0x1d')](_0x44b5b6[_0x90db('0x2f')]['offset']);}_0x4c6311[_0x90db('0x36')]=qs[_0x90db('0x37')](_0x44b5b6[_0x90db('0x2f')][_0x90db('0x37')]);_0x4c6311[_0x90db('0x38')]=qs[_0x90db('0x30')](_['pick'](_0x44b5b6[_0x90db('0x2f')],_0x3489d1[_0x90db('0x30')]),_0xa2bb);if(_0x44b5b6['query'][_0x90db('0x39')]){_0x4c6311[_0x90db('0x38')]=_[_0x90db('0x3a')](_0x4c6311['where'],{'$or':_[_0x90db('0x2a')](_0xa2bb,function(_0x2c9f57){if(_0x2c9f57['type']!=='VIRTUAL'){var _0x57c06b={};_0x57c06b[_0x2c9f57['name']]={'$like':'%'+_0x44b5b6[_0x90db('0x2f')][_0x90db('0x39')]+'%'};return _0x57c06b;}})});}_0x4c6311=_[_0x90db('0x3a')]({},_0x4c6311,_0x44b5b6['options']);var _0x55b0b2={'where':_0x4c6311[_0x90db('0x38')]};return db[_0x90db('0x3b')]['count'](_0x55b0b2)[_0x90db('0x25')](function(_0x592c01){_0x552c2e[_0x90db('0x20')]=_0x592c01;if(_0x44b5b6[_0x90db('0x2f')][_0x90db('0x3c')]){_0x4c6311[_0x90db('0x3d')]=[{'all':!![]}];}return db[_0x90db('0x3b')][_0x90db('0x3e')](_0x4c6311);})[_0x90db('0x25')](function(_0x1d6f9a){_0x552c2e[_0x90db('0x3f')]=_0x1d6f9a;return _0x552c2e;})['then'](respondWithFilteredResult(_0x3c7f67,_0x4c6311))[_0x90db('0x40')](handleError(_0x3c7f67,null));};exports[_0x90db('0x41')]=function(_0x2e1fc8,_0xd45db3){var _0x4611f1={'raw':!![],'where':{'id':_0x2e1fc8['params']['id']}},_0x4f0b46={};_0x4f0b46[_0x90db('0x2e')]=_['keys'](db[_0x90db('0x3b')][_0x90db('0x2b')]);_0x4f0b46[_0x90db('0x2f')]=_[_0x90db('0x42')](_0x2e1fc8[_0x90db('0x2f')]);_0x4f0b46['filters']=_['intersection'](_0x4f0b46['model'],_0x4f0b46[_0x90db('0x2f')]);_0x4611f1[_0x90db('0x32')]=_[_0x90db('0x31')](_0x4f0b46['model'],qs[_0x90db('0x33')](_0x2e1fc8[_0x90db('0x2f')][_0x90db('0x33')]));_0x4611f1[_0x90db('0x32')]=_0x4611f1['attributes'][_0x90db('0x34')]?_0x4611f1[_0x90db('0x32')]:_0x4f0b46[_0x90db('0x2e')];if(_0x2e1fc8[_0x90db('0x2f')]['includeAll']){_0x4611f1['include']=[{'all':!![]}];}_0x4611f1=_[_0x90db('0x3a')]({},_0x4611f1,_0x2e1fc8[_0x90db('0x43')]);return db[_0x90db('0x3b')][_0x90db('0x44')](_0x4611f1)['then'](handleEntityNotFound(_0xd45db3,null))[_0x90db('0x25')](respondWithResult(_0xd45db3,null))['catch'](handleError(_0xd45db3,null));};exports[_0x90db('0x45')]=function(_0x2e4a8a,_0x576449){return db[_0x90db('0x3b')][_0x90db('0x45')](_0x2e4a8a[_0x90db('0x46')],{})[_0x90db('0x25')](respondWithResult(_0x576449,0xc9))[_0x90db('0x40')](handleError(_0x576449,null));};exports[_0x90db('0x24')]=function(_0x407f50,_0x62b965){if(_0x407f50[_0x90db('0x46')]['id']){delete _0x407f50[_0x90db('0x46')]['id'];}return db[_0x90db('0x3b')]['find']({'where':{'id':_0x407f50[_0x90db('0x47')]['id']}})[_0x90db('0x25')](handleEntityNotFound(_0x62b965,null))[_0x90db('0x25')](saveUpdates(_0x407f50[_0x90db('0x46')],null))[_0x90db('0x25')](respondWithResult(_0x62b965,null))[_0x90db('0x40')](handleError(_0x62b965,null));};exports[_0x90db('0x48')]=function(_0x3a768b,_0x43c760){return db[_0x90db('0x3b')][_0x90db('0x44')]({'where':{'id':_0x3a768b[_0x90db('0x47')]['id']}})['then'](handleEntityNotFound(_0x43c760,null))[_0x90db('0x25')](removeEntity(_0x43c760,null))['catch'](handleError(_0x43c760,null));}; \ No newline at end of file +var _0xdace=['../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','map','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','FreshdeskField','includeAll','include','findAll','rows','catch','show','params','rawAttributes','body','find','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xdace,0xc5));var _0xedac=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0xdace[_0x2f1762];return _0x8ab21;};'use strict';var emlformat=require(_0xedac('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xedac('0x1'));var jsonpatch=require(_0xedac('0x2'));var rp=require(_0xedac('0x3'));var moment=require('moment');var BPromise=require(_0xedac('0x4'));var Mustache=require(_0xedac('0x5'));var util=require(_0xedac('0x6'));var path=require(_0xedac('0x7'));var sox=require('sox');var csv=require(_0xedac('0x8'));var ejs=require(_0xedac('0x9'));var fs=require('fs');var fs_extra=require(_0xedac('0xa'));var _=require('lodash');var squel=require(_0xedac('0xb'));var crypto=require(_0xedac('0xc'));var jsforce=require(_0xedac('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xedac('0x8'));var querystring=require(_0xedac('0xe'));var Papa=require(_0xedac('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xedac('0x10'));var as=require(_0xedac('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xedac('0x12'));var utils=require(_0xedac('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xedac('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21c6ae,_0x1b0503){_0x1b0503=_0x1b0503||0xcc;return function(_0x306af5){if(_0x306af5){return _0x21c6ae[_0xedac('0x15')](_0x1b0503);}return _0x21c6ae[_0xedac('0x16')](_0x1b0503)[_0xedac('0x17')]();};}function respondWithResult(_0x28444a,_0x11f0b0){_0x11f0b0=_0x11f0b0||0xc8;return function(_0x593030){if(_0x593030){return _0x28444a[_0xedac('0x16')](_0x11f0b0)[_0xedac('0x18')](_0x593030);}};}function respondWithFilteredResult(_0x2f0c7c,_0x2676c3){return function(_0x15068){if(_0x15068){var _0x590e9b=typeof _0x2676c3[_0xedac('0x19')]==='undefined'&&typeof _0x2676c3[_0xedac('0x1a')]===_0xedac('0x1b');var _0xdad128=_0x15068[_0xedac('0x1c')];var _0x4fb540=_0x590e9b?0x0:_0x2676c3['offset'];var _0x2d02d7=_0x590e9b?_0x15068[_0xedac('0x1c')]:_0x2676c3[_0xedac('0x19')]+_0x2676c3[_0xedac('0x1a')];var _0x5a5438;if(_0x2d02d7>=_0xdad128){_0x2d02d7=_0xdad128;_0x5a5438=0xc8;}else{_0x5a5438=0xce;}_0x2f0c7c['status'](_0x5a5438);return _0x2f0c7c[_0xedac('0x1d')](_0xedac('0x1e'),_0x4fb540+'-'+_0x2d02d7+'/'+_0xdad128)[_0xedac('0x18')](_0x15068);}return null;};}function patchUpdates(_0xcc1605){return function(_0x2f5eee){try{jsonpatch[_0xedac('0x1f')](_0x2f5eee,_0xcc1605,!![]);}catch(_0x160be7){return BPromise[_0xedac('0x20')](_0x160be7);}return _0x2f5eee['save']();};}function saveUpdates(_0x4593e8,_0x510005){return function(_0x29cd40){if(_0x29cd40){return _0x29cd40[_0xedac('0x21')](_0x4593e8)['then'](function(_0x46e09d){return _0x46e09d;});}return null;};}function removeEntity(_0x404b8d,_0x1c87bf){return function(_0x1e5e47){if(_0x1e5e47){return _0x1e5e47[_0xedac('0x22')]()[_0xedac('0x23')](function(){_0x404b8d['status'](0xcc)[_0xedac('0x17')]();});}};}function handleEntityNotFound(_0x87d343,_0x37563f){return function(_0x41ad8d){if(!_0x41ad8d){_0x87d343[_0xedac('0x15')](0x194);}return _0x41ad8d;};}function handleError(_0x453a3c,_0x40ba53){_0x40ba53=_0x40ba53||0x1f4;return function(_0x26c6f7){logger[_0xedac('0x24')](_0x26c6f7[_0xedac('0x25')]);if(_0x26c6f7['name']){delete _0x26c6f7[_0xedac('0x26')];}_0x453a3c[_0xedac('0x16')](_0x40ba53)[_0xedac('0x27')](_0x26c6f7);};}exports['index']=function(_0x313e06,_0x4f81f6){var _0x524514={},_0x3e28bf={},_0x457d81={'count':0x0,'rows':[]};var _0x44ac60=_[_0xedac('0x28')](db['FreshdeskField']['rawAttributes'],function(_0xe813e6){return{'name':_0xe813e6[_0xedac('0x29')],'type':_0xe813e6[_0xedac('0x2a')][_0xedac('0x2b')]};});_0x3e28bf[_0xedac('0x2c')]=_[_0xedac('0x28')](_0x44ac60,_0xedac('0x26'));_0x3e28bf['query']=_[_0xedac('0x2d')](_0x313e06[_0xedac('0x2e')]);_0x3e28bf[_0xedac('0x2f')]=_['intersection'](_0x3e28bf[_0xedac('0x2c')],_0x3e28bf[_0xedac('0x2e')]);_0x524514['attributes']=_[_0xedac('0x30')](_0x3e28bf[_0xedac('0x2c')],qs['fields'](_0x313e06[_0xedac('0x2e')][_0xedac('0x31')]));_0x524514[_0xedac('0x32')]=_0x524514[_0xedac('0x32')][_0xedac('0x33')]?_0x524514[_0xedac('0x32')]:_0x3e28bf[_0xedac('0x2c')];if(!_0x313e06[_0xedac('0x2e')][_0xedac('0x34')](_0xedac('0x35'))){_0x524514['limit']=qs[_0xedac('0x1a')](_0x313e06[_0xedac('0x2e')][_0xedac('0x1a')]);_0x524514[_0xedac('0x19')]=qs[_0xedac('0x19')](_0x313e06[_0xedac('0x2e')][_0xedac('0x19')]);}_0x524514[_0xedac('0x36')]=qs[_0xedac('0x37')](_0x313e06[_0xedac('0x2e')][_0xedac('0x37')]);_0x524514[_0xedac('0x38')]=qs[_0xedac('0x2f')](_[_0xedac('0x39')](_0x313e06[_0xedac('0x2e')],_0x3e28bf['filters']),_0x44ac60);if(_0x313e06[_0xedac('0x2e')][_0xedac('0x3a')]){_0x524514[_0xedac('0x38')]=_[_0xedac('0x3b')](_0x524514['where'],{'$or':_[_0xedac('0x28')](_0x44ac60,function(_0x1cee42){if(_0x1cee42[_0xedac('0x2a')]!=='VIRTUAL'){var _0x159145={};_0x159145[_0x1cee42[_0xedac('0x26')]]={'$like':'%'+_0x313e06[_0xedac('0x2e')]['filter']+'%'};return _0x159145;}})});}_0x524514=_[_0xedac('0x3b')]({},_0x524514,_0x313e06[_0xedac('0x3c')]);var _0x47f7c7={'where':_0x524514[_0xedac('0x38')]};return db[_0xedac('0x3d')]['count'](_0x47f7c7)[_0xedac('0x23')](function(_0x534ad3){_0x457d81[_0xedac('0x1c')]=_0x534ad3;if(_0x313e06[_0xedac('0x2e')][_0xedac('0x3e')]){_0x524514[_0xedac('0x3f')]=[{'all':!![]}];}return db[_0xedac('0x3d')][_0xedac('0x40')](_0x524514);})['then'](function(_0x2370aa){_0x457d81[_0xedac('0x41')]=_0x2370aa;return _0x457d81;})[_0xedac('0x23')](respondWithFilteredResult(_0x4f81f6,_0x524514))[_0xedac('0x42')](handleError(_0x4f81f6,null));};exports[_0xedac('0x43')]=function(_0xa3a919,_0x2e9eef){var _0x6a17a9={'raw':!![],'where':{'id':_0xa3a919[_0xedac('0x44')]['id']}},_0x2dcff4={};_0x2dcff4[_0xedac('0x2c')]=_[_0xedac('0x2d')](db[_0xedac('0x3d')][_0xedac('0x45')]);_0x2dcff4[_0xedac('0x2e')]=_[_0xedac('0x2d')](_0xa3a919['query']);_0x2dcff4[_0xedac('0x2f')]=_[_0xedac('0x30')](_0x2dcff4[_0xedac('0x2c')],_0x2dcff4['query']);_0x6a17a9['attributes']=_['intersection'](_0x2dcff4[_0xedac('0x2c')],qs[_0xedac('0x31')](_0xa3a919['query'][_0xedac('0x31')]));_0x6a17a9['attributes']=_0x6a17a9[_0xedac('0x32')]['length']?_0x6a17a9[_0xedac('0x32')]:_0x2dcff4[_0xedac('0x2c')];if(_0xa3a919[_0xedac('0x2e')][_0xedac('0x3e')]){_0x6a17a9[_0xedac('0x3f')]=[{'all':!![]}];}_0x6a17a9=_['merge']({},_0x6a17a9,_0xa3a919['options']);return db[_0xedac('0x3d')]['find'](_0x6a17a9)[_0xedac('0x23')](handleEntityNotFound(_0x2e9eef,null))[_0xedac('0x23')](respondWithResult(_0x2e9eef,null))[_0xedac('0x42')](handleError(_0x2e9eef,null));};exports['create']=function(_0x29a707,_0x45189f){return db[_0xedac('0x3d')]['create'](_0x29a707[_0xedac('0x46')],{})[_0xedac('0x23')](respondWithResult(_0x45189f,0xc9))[_0xedac('0x42')](handleError(_0x45189f,null));};exports['update']=function(_0x5e6079,_0x2cb3ca){if(_0x5e6079[_0xedac('0x46')]['id']){delete _0x5e6079['body']['id'];}return db['FreshdeskField'][_0xedac('0x47')]({'where':{'id':_0x5e6079[_0xedac('0x44')]['id']}})['then'](handleEntityNotFound(_0x2cb3ca,null))[_0xedac('0x23')](saveUpdates(_0x5e6079['body'],null))[_0xedac('0x23')](respondWithResult(_0x2cb3ca,null))[_0xedac('0x42')](handleError(_0x2cb3ca,null));};exports[_0xedac('0x22')]=function(_0x104842,_0x126bd3){return db[_0xedac('0x3d')]['find']({'where':{'id':_0x104842[_0xedac('0x44')]['id']}})[_0xedac('0x23')](handleEntityNotFound(_0x126bd3,null))['then'](removeEntity(_0x126bd3,null))[_0xedac('0x42')](handleError(_0x126bd3,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 60a4069..c6d6cda 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 _0x06b0=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intFreshdeskField.attributes','exports','int_freshdesk_fields','freshdesk_unique_index','idField','lodash'];(function(_0xdeb09f,_0xf88fb4){var _0x9f5c22=function(_0x2eafe2){while(--_0x2eafe2){_0xdeb09f['push'](_0xdeb09f['shift']());}};_0x9f5c22(++_0xf88fb4);}(_0x06b0,0x74));var _0x006b=function(_0xda8967,_0x2b3d45){_0xda8967=_0xda8967-0x0;var _0x266d4a=_0x06b0[_0xda8967];return _0x266d4a;};'use strict';var _=require(_0x006b('0x0'));var util=require('util');var logger=require(_0x006b('0x1'))(_0x006b('0x2'));var moment=require(_0x006b('0x3'));var BPromise=require(_0x006b('0x4'));var rp=require(_0x006b('0x5'));var fs=require('fs');var path=require(_0x006b('0x6'));var rimraf=require('rimraf');var config=require(_0x006b('0x7'));var attributes=require(_0x006b('0x8'));module[_0x006b('0x9')]=function(_0x5e021a,_0x1f9838){return _0x5e021a['define']('FreshdeskField',attributes,{'tableName':_0x006b('0xa'),'paranoid':![],'indexes':[{'name':_0x006b('0xb'),'fields':[_0x006b('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2bc6=['rimraf','../../config/environment','./intFreshdeskField.attributes','define','FreshdeskField','freshdesk_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x2522a7,_0x3b367a){var _0x4a4924=function(_0x331acd){while(--_0x331acd){_0x2522a7['push'](_0x2522a7['shift']());}};_0x4a4924(++_0x3b367a);}(_0x2bc6,0xf6));var _0x62bc=function(_0x14352b,_0x83c5e3){_0x14352b=_0x14352b-0x0;var _0x5e9af2=_0x2bc6[_0x14352b];return _0x5e9af2;};'use strict';var _=require(_0x62bc('0x0'));var util=require(_0x62bc('0x1'));var logger=require(_0x62bc('0x2'))('api');var moment=require(_0x62bc('0x3'));var BPromise=require(_0x62bc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x62bc('0x5'));var rimraf=require(_0x62bc('0x6'));var config=require(_0x62bc('0x7'));var attributes=require(_0x62bc('0x8'));module['exports']=function(_0x56a3c8,_0x8ec5bb){return _0x56a3c8[_0x62bc('0x9')](_0x62bc('0xa'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x62bc('0xb'),'fields':[_0x62bc('0xc'),_0x62bc('0xd')],'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 7a1999b..8468cf4 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 _0x746f=['then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x524379,_0x21ff2c){var _0x1ef2cc=function(_0x5f431c){while(--_0x5f431c){_0x524379['push'](_0x524379['shift']());}};_0x1ef2cc(++_0x21ff2c);}(_0x746f,0x1c3));var _0xf746=function(_0x17e4b0,_0x562736){_0x17e4b0=_0x17e4b0-0x0;var _0x98c50c=_0x746f[_0x17e4b0];return _0x98c50c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf746('0x0'));var BPromise=require(_0xf746('0x1'));var rs=require(_0xf746('0x2'));var fs=require('fs');var Redis=require(_0xf746('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf746('0x4'));var logger=require(_0xf746('0x5'))(_0xf746('0x6'));var config=require('../../config/environment');var jayson=require(_0xf746('0x7'));var client=jayson[_0xf746('0x8')][_0xf746('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d15ab,_0x410539,_0x30d8b2){return new BPromise(function(_0x3cb6cc,_0x863cfc){return client[_0xf746('0xa')](_0x5d15ab,_0x30d8b2)[_0xf746('0xb')](function(_0x8ab7cb){logger[_0xf746('0xc')](_0xf746('0xd'),_0x410539,_0xf746('0xe'));logger['debug'](_0xf746('0xf'),_0x410539,'request\x20sent',JSON[_0xf746('0x10')](_0x8ab7cb));if(_0x8ab7cb[_0xf746('0x11')]){if(_0x8ab7cb[_0xf746('0x11')][_0xf746('0x12')]===0x1f4){logger[_0xf746('0x11')](_0xf746('0xd'),_0x410539,_0x8ab7cb['error'][_0xf746('0x13')]);return _0x863cfc(_0x8ab7cb['error'][_0xf746('0x13')]);}logger[_0xf746('0x11')](_0xf746('0xd'),_0x410539,_0x8ab7cb[_0xf746('0x11')][_0xf746('0x13')]);return _0x3cb6cc(_0x8ab7cb['error'][_0xf746('0x13')]);}else{logger[_0xf746('0xc')](_0xf746('0xd'),_0x410539,_0xf746('0xe'));_0x3cb6cc(_0x8ab7cb[_0xf746('0x14')][_0xf746('0x13')]);}})[_0xf746('0x15')](function(_0x1dc293){logger['error'](_0xf746('0xd'),_0x410539,_0x1dc293);_0x863cfc(_0x1dc293);});});} \ No newline at end of file +var _0xbd9b=['request','info','FreshdeskField,\x20%s,\x20%s','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0xbd9b,0x1d7));var _0xbbd9=function(_0x128194,_0x30d4a6){_0x128194=_0x128194-0x0;var _0x315906=_0xbd9b[_0x128194];return _0x315906;};'use strict';var _=require(_0xbbd9('0x0'));var util=require(_0xbbd9('0x1'));var moment=require(_0xbbd9('0x2'));var BPromise=require(_0xbbd9('0x3'));var rs=require(_0xbbd9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbbd9('0x5'))['db'];var utils=require(_0xbbd9('0x6'));var logger=require(_0xbbd9('0x7'))(_0xbbd9('0x8'));var config=require(_0xbbd9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xbbd9('0xa')][_0xbbd9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xfa6fcf,_0x3de1a9,_0x338b7a){return new BPromise(function(_0x35ffee,_0x57fca1){return client[_0xbbd9('0xc')](_0xfa6fcf,_0x338b7a)['then'](function(_0x5aa961){logger[_0xbbd9('0xd')](_0xbbd9('0xe'),_0x3de1a9,'request\x20sent');logger[_0xbbd9('0xf')](_0xbbd9('0x10'),_0x3de1a9,'request\x20sent',JSON[_0xbbd9('0x11')](_0x5aa961));if(_0x5aa961['error']){if(_0x5aa961[_0xbbd9('0x12')]['code']===0x1f4){logger['error'](_0xbbd9('0xe'),_0x3de1a9,_0x5aa961[_0xbbd9('0x12')][_0xbbd9('0x13')]);return _0x57fca1(_0x5aa961[_0xbbd9('0x12')][_0xbbd9('0x13')]);}logger[_0xbbd9('0x12')]('FreshdeskField,\x20%s,\x20%s',_0x3de1a9,_0x5aa961[_0xbbd9('0x12')]['message']);return _0x35ffee(_0x5aa961[_0xbbd9('0x12')][_0xbbd9('0x13')]);}else{logger[_0xbbd9('0xd')](_0xbbd9('0xe'),_0x3de1a9,_0xbbd9('0x14'));_0x35ffee(_0x5aa961[_0xbbd9('0x15')][_0xbbd9('0x13')]);}})[_0xbbd9('0x16')](function(_0x666c47){logger[_0xbbd9('0x12')](_0xbbd9('0xe'),_0x3de1a9,_0x666c47);_0x57fca1(_0x666c47);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index a030712..55f4ada 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 _0x6324=['isAuthenticated','index','show','getConfigurations','getFields','post','create','/:id/configurations','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get'];(function(_0xf06c54,_0x174350){var _0x3dbd4e=function(_0x2ad9c4){while(--_0x2ad9c4){_0xf06c54['push'](_0xf06c54['shift']());}};_0x3dbd4e(++_0x174350);}(_0x6324,0x142));var _0x4632=function(_0x11155f,_0x57b687){_0x11155f=_0x11155f-0x0;var _0xd07e48=_0x6324[_0x11155f];return _0xd07e48;};'use strict';var multer=require(_0x4632('0x0'));var util=require(_0x4632('0x1'));var path=require(_0x4632('0x2'));var timeout=require(_0x4632('0x3'));var express=require('express');var router=express[_0x4632('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4632('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4632('0x6'));var controller=require('./intFreshsalesAccount.controller');router[_0x4632('0x7')]('/',auth[_0x4632('0x8')](),controller[_0x4632('0x9')]);router[_0x4632('0x7')]('/:id',auth[_0x4632('0x8')](),controller[_0x4632('0xa')]);router[_0x4632('0x7')]('/:id/configurations',auth[_0x4632('0x8')](),controller[_0x4632('0xb')]);router['get']('/:id/fields',auth[_0x4632('0x8')](),controller[_0x4632('0xc')]);router[_0x4632('0xd')]('/',auth[_0x4632('0x8')](),controller[_0x4632('0xe')]);router[_0x4632('0xd')](_0x4632('0xf'),auth[_0x4632('0x8')](),controller['addConfiguration']);router[_0x4632('0x10')]('/:id',auth[_0x4632('0x8')](),controller[_0x4632('0x11')]);router[_0x4632('0x12')](_0x4632('0x13'),auth['isAuthenticated'](),controller[_0x4632('0x14')]);module[_0x4632('0x15')]=router; \ No newline at end of file +var _0x13f6=['./intFreshsalesAccount.controller','isAuthenticated','index','get','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','update','delete','/:id','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x563450,_0x4d1fdd){var _0xeebb0c=function(_0x1bd1d3){while(--_0x1bd1d3){_0x563450['push'](_0x563450['shift']());}};_0xeebb0c(++_0x4d1fdd);}(_0x13f6,0x124));var _0x613f=function(_0xf2af92,_0xa9baed){_0xf2af92=_0xf2af92-0x0;var _0x563666=_0x13f6[_0xf2af92];return _0x563666;};'use strict';var multer=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x613f('0x2'));var router=express[_0x613f('0x3')]();var fs_extra=require(_0x613f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x613f('0x5'));var config=require(_0x613f('0x6'));var controller=require(_0x613f('0x7'));router['get']('/',auth[_0x613f('0x8')](),controller[_0x613f('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x613f('0xa')](_0x613f('0xb'),auth[_0x613f('0x8')](),controller[_0x613f('0xc')]);router['get'](_0x613f('0xd'),auth[_0x613f('0x8')](),controller[_0x613f('0xe')]);router['post']('/',auth[_0x613f('0x8')](),controller[_0x613f('0xf')]);router[_0x613f('0x10')]('/:id/configurations',auth[_0x613f('0x8')](),controller[_0x613f('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x613f('0x12')]);router[_0x613f('0x13')](_0x613f('0x14'),auth[_0x613f('0x8')](),controller[_0x613f('0x15')]);module[_0x613f('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 1c2d950..452fed3 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 _0xf61e=['remoteUri','sequelize','exports','STRING','username'];(function(_0x526e9f,_0xb70342){var _0x353069=function(_0x138d19){while(--_0x138d19){_0x526e9f['push'](_0x526e9f['shift']());}};_0x353069(++_0xb70342);}(_0xf61e,0x191));var _0xef61=function(_0x405116,_0x42a884){_0x405116=_0x405116-0x0;var _0x56cbdc=_0xf61e[_0x405116];return _0x56cbdc;};'use strict';var Sequelize=require(_0xef61('0x0'));module[_0xef61('0x1')]={'name':{'type':Sequelize[_0xef61('0x2')]},'description':{'type':Sequelize[_0xef61('0x2')]},'username':{'type':Sequelize[_0xef61('0x2')],'unique':_0xef61('0x3')},'apiKey':{'type':Sequelize[_0xef61('0x2')]},'remoteUri':{'type':Sequelize[_0xef61('0x2')],'unique':_0xef61('0x4')},'serverUrl':{'type':Sequelize[_0xef61('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x3a6d=['exports','STRING','username','sequelize'];(function(_0x5305dc,_0x3a0acc){var _0x47b203=function(_0x53f023){while(--_0x53f023){_0x5305dc['push'](_0x5305dc['shift']());}};_0x47b203(++_0x3a0acc);}(_0x3a6d,0x143));var _0xd3a6=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x3a6d[_0x51020b];return _0x371e47;};'use strict';var Sequelize=require(_0xd3a6('0x0'));module[_0xd3a6('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd3a6('0x2')]},'username':{'type':Sequelize[_0xd3a6('0x2')],'unique':_0xd3a6('0x3')},'apiKey':{'type':Sequelize[_0xd3a6('0x2')]},'remoteUri':{'type':Sequelize[_0xd3a6('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xd3a6('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index a8187c5..097ccfb 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 _0x1527=['merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','create','body','catch','find','getConfigurations','findOne','FreshsalesConfiguration','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','username','remoteUri','apiKey','slice','substring','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','FreshsalesAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x1527,0xff));var _0x7152=function(_0xdd82b4,_0x5cd8b8){_0xdd82b4=_0xdd82b4-0x0;var _0x549bb2=_0x1527[_0xdd82b4];return _0x549bb2;};'use strict';var emlformat=require(_0x7152('0x0'));var rimraf=require(_0x7152('0x1'));var zipdir=require(_0x7152('0x2'));var jsonpatch=require(_0x7152('0x3'));var rp=require(_0x7152('0x4'));var moment=require(_0x7152('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7152('0x6'));var util=require(_0x7152('0x7'));var path=require(_0x7152('0x8'));var sox=require(_0x7152('0x9'));var csv=require(_0x7152('0xa'));var ejs=require(_0x7152('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7152('0xc'));var squel=require(_0x7152('0xd'));var crypto=require(_0x7152('0xe'));var jsforce=require(_0x7152('0xf'));var deskjs=require(_0x7152('0x10'));var toCsv=require(_0x7152('0xa'));var querystring=require('querystring');var Papa=require(_0x7152('0x11'));var Redis=require(_0x7152('0x12'));var authService=require(_0x7152('0x13'));var qs=require(_0x7152('0x14'));var as=require(_0x7152('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7152('0x16'));var utils=require(_0x7152('0x17'));var config=require(_0x7152('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x7152('0x19'));function respondWithStatusCode(_0x3551e5,_0x2cc411){_0x2cc411=_0x2cc411||0xcc;return function(_0x443103){if(_0x443103){return _0x3551e5[_0x7152('0x1a')](_0x2cc411);}return _0x3551e5[_0x7152('0x1b')](_0x2cc411)[_0x7152('0x1c')]();};}function respondWithResult(_0x4ee9c5,_0x4e3782){_0x4e3782=_0x4e3782||0xc8;return function(_0x545715){if(_0x545715){return _0x4ee9c5[_0x7152('0x1b')](_0x4e3782)[_0x7152('0x1d')](_0x545715);}};}function respondWithFilteredResult(_0x29563b,_0x504a44){return function(_0x18f272){if(_0x18f272){var _0x4f0072=typeof _0x504a44['offset']==='undefined'&&typeof _0x504a44[_0x7152('0x1e')]===_0x7152('0x1f');var _0x402074=_0x18f272[_0x7152('0x20')];var _0x48bfc5=_0x4f0072?0x0:_0x504a44['offset'];var _0x295c55=_0x4f0072?_0x18f272[_0x7152('0x20')]:_0x504a44[_0x7152('0x21')]+_0x504a44[_0x7152('0x1e')];var _0x34e212;if(_0x295c55>=_0x402074){_0x295c55=_0x402074;_0x34e212=0xc8;}else{_0x34e212=0xce;}_0x29563b[_0x7152('0x1b')](_0x34e212);return _0x29563b[_0x7152('0x22')](_0x7152('0x23'),_0x48bfc5+'-'+_0x295c55+'/'+_0x402074)['json'](_0x18f272);}return null;};}function patchUpdates(_0x98346d){return function(_0xd199f4){try{jsonpatch[_0x7152('0x24')](_0xd199f4,_0x98346d,!![]);}catch(_0x488ae9){return BPromise[_0x7152('0x25')](_0x488ae9);}return _0xd199f4[_0x7152('0x26')]();};}function saveUpdates(_0xf2520d,_0x41666d){return function(_0x1f9380){if(_0x1f9380){return _0x1f9380[_0x7152('0x27')](_0xf2520d)[_0x7152('0x28')](function(_0x326e5e){return _0x326e5e;});}return null;};}function removeEntity(_0x576705,_0xd6b260){return function(_0x5ea7ee){if(_0x5ea7ee){return _0x5ea7ee[_0x7152('0x29')]()['then'](function(){_0x576705[_0x7152('0x1b')](0xcc)[_0x7152('0x1c')]();});}};}function handleEntityNotFound(_0x26a577,_0x102217){return function(_0x38adac){if(!_0x38adac){_0x26a577['sendStatus'](0x194);}return _0x38adac;};}function handleError(_0x447adc,_0x5ca4c7){_0x5ca4c7=_0x5ca4c7||0x1f4;return function(_0x4e1a1c){logger[_0x7152('0x2a')](_0x4e1a1c['stack']);if(_0x4e1a1c['name']){delete _0x4e1a1c[_0x7152('0x2b')];}_0x447adc['status'](_0x5ca4c7)[_0x7152('0x2c')](_0x4e1a1c);};}exports['index']=function(_0x2675ae,_0xcda829){var _0x5c7298={},_0x4e854d={},_0x31a78c={'count':0x0,'rows':[]};var _0x200966=_['map'](db[_0x7152('0x2d')][_0x7152('0x2e')],function(_0x3a0069){return{'name':_0x3a0069[_0x7152('0x2f')],'type':_0x3a0069[_0x7152('0x30')][_0x7152('0x31')]};});_0x4e854d[_0x7152('0x32')]=_[_0x7152('0x33')](_0x200966,_0x7152('0x2b'));_0x4e854d[_0x7152('0x34')]=_[_0x7152('0x35')](_0x2675ae[_0x7152('0x34')]);_0x4e854d[_0x7152('0x36')]=_[_0x7152('0x37')](_0x4e854d[_0x7152('0x32')],_0x4e854d[_0x7152('0x34')]);_0x5c7298['attributes']=_['intersection'](_0x4e854d['model'],qs[_0x7152('0x38')](_0x2675ae[_0x7152('0x34')]['fields']));_0x5c7298['attributes']=_0x5c7298[_0x7152('0x39')][_0x7152('0x3a')]?_0x5c7298['attributes']:_0x4e854d[_0x7152('0x32')];if(!_0x2675ae[_0x7152('0x34')][_0x7152('0x3b')](_0x7152('0x3c'))){_0x5c7298[_0x7152('0x1e')]=qs[_0x7152('0x1e')](_0x2675ae[_0x7152('0x34')][_0x7152('0x1e')]);_0x5c7298[_0x7152('0x21')]=qs['offset'](_0x2675ae['query'][_0x7152('0x21')]);}_0x5c7298[_0x7152('0x3d')]=qs[_0x7152('0x3e')](_0x2675ae[_0x7152('0x34')][_0x7152('0x3e')]);_0x5c7298['where']=qs['filters'](_[_0x7152('0x3f')](_0x2675ae[_0x7152('0x34')],_0x4e854d[_0x7152('0x36')]),_0x200966);if(_0x2675ae[_0x7152('0x34')][_0x7152('0x40')]){_0x5c7298[_0x7152('0x41')]=_[_0x7152('0x42')](_0x5c7298[_0x7152('0x41')],{'$or':_[_0x7152('0x33')](_0x200966,function(_0x3482c4){if(_0x3482c4[_0x7152('0x30')]!==_0x7152('0x43')){var _0x59e800={};_0x59e800[_0x3482c4[_0x7152('0x2b')]]={'$like':'%'+_0x2675ae[_0x7152('0x34')][_0x7152('0x40')]+'%'};return _0x59e800;}})});}_0x5c7298=_['merge']({},_0x5c7298,_0x2675ae[_0x7152('0x44')]);var _0x53574c={'where':_0x5c7298['where']};return db['FreshsalesAccount'][_0x7152('0x20')](_0x53574c)[_0x7152('0x28')](function(_0x5982c6){_0x31a78c['count']=_0x5982c6;if(_0x2675ae[_0x7152('0x34')][_0x7152('0x45')]){_0x5c7298[_0x7152('0x46')]=[{'all':!![]}];}return db[_0x7152('0x2d')][_0x7152('0x47')](_0x5c7298);})[_0x7152('0x28')](function(_0x298b00){_0x31a78c[_0x7152('0x48')]=_0x298b00;return _0x31a78c;})[_0x7152('0x28')](respondWithFilteredResult(_0xcda829,_0x5c7298))['catch'](handleError(_0xcda829,null));};exports[_0x7152('0x49')]=function(_0x40ed3d,_0x52ff77){var _0x20ad04={'raw':![],'where':{'id':_0x40ed3d[_0x7152('0x4a')]['id']}},_0x972b5b={};_0x972b5b[_0x7152('0x32')]=_['keys'](db[_0x7152('0x2d')]['rawAttributes']);_0x972b5b[_0x7152('0x34')]=_[_0x7152('0x35')](_0x40ed3d[_0x7152('0x34')]);_0x972b5b['filters']=_[_0x7152('0x37')](_0x972b5b[_0x7152('0x32')],_0x972b5b[_0x7152('0x34')]);_0x20ad04[_0x7152('0x39')]=_[_0x7152('0x37')](_0x972b5b[_0x7152('0x32')],qs[_0x7152('0x38')](_0x40ed3d['query'][_0x7152('0x38')]));_0x20ad04['attributes']=_0x20ad04[_0x7152('0x39')][_0x7152('0x3a')]?_0x20ad04[_0x7152('0x39')]:_0x972b5b[_0x7152('0x32')];if(_0x40ed3d[_0x7152('0x34')][_0x7152('0x45')]){_0x20ad04[_0x7152('0x46')]=[{'all':!![]}];}_0x20ad04=_['merge']({},_0x20ad04,_0x40ed3d[_0x7152('0x44')]);return db['FreshsalesAccount']['find'](_0x20ad04)['then'](handleEntityNotFound(_0x52ff77,null))[_0x7152('0x28')](respondWithResult(_0x52ff77,null))['catch'](handleError(_0x52ff77,null));};exports['create']=function(_0x5a0468,_0x252657){return db[_0x7152('0x2d')][_0x7152('0x4b')](_0x5a0468[_0x7152('0x4c')],{})[_0x7152('0x28')](respondWithResult(_0x252657,0xc9))[_0x7152('0x4d')](handleError(_0x252657,null));};exports[_0x7152('0x27')]=function(_0x4e097b,_0x631ab7){if(_0x4e097b[_0x7152('0x4c')]['id']){delete _0x4e097b['body']['id'];}return db[_0x7152('0x2d')][_0x7152('0x4e')]({'where':{'id':_0x4e097b['params']['id']}})[_0x7152('0x28')](handleEntityNotFound(_0x631ab7,null))['then'](saveUpdates(_0x4e097b[_0x7152('0x4c')],null))[_0x7152('0x28')](respondWithResult(_0x631ab7,null))[_0x7152('0x4d')](handleError(_0x631ab7,null));};exports[_0x7152('0x29')]=function(_0x60571a,_0x334725){return db[_0x7152('0x2d')][_0x7152('0x4e')]({'where':{'id':_0x60571a[_0x7152('0x4a')]['id']}})[_0x7152('0x28')](handleEntityNotFound(_0x334725,null))['then'](removeEntity(_0x334725,null))[_0x7152('0x4d')](handleError(_0x334725,null));};exports[_0x7152('0x4f')]=function(_0x47fdbb,_0x4bc691,_0x53e887){var _0x21ceb1={};var _0x4a888e={};var _0x52521c;var _0x1ea028;return db[_0x7152('0x2d')][_0x7152('0x50')]({'where':{'id':_0x47fdbb[_0x7152('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4bc691,null))['then'](function(_0x245bdc){if(_0x245bdc){_0x52521c=_0x245bdc;_0x4a888e['model']=_[_0x7152('0x35')](db[_0x7152('0x51')][_0x7152('0x2e')]);_0x4a888e['query']=_[_0x7152('0x35')](_0x47fdbb[_0x7152('0x34')]);_0x4a888e[_0x7152('0x36')]=_[_0x7152('0x37')](_0x4a888e[_0x7152('0x32')],_0x4a888e['query']);_0x21ceb1[_0x7152('0x39')]=_['intersection'](_0x4a888e['model'],qs['fields'](_0x47fdbb[_0x7152('0x34')][_0x7152('0x38')]));_0x21ceb1[_0x7152('0x39')]=_0x21ceb1[_0x7152('0x39')][_0x7152('0x3a')]?_0x21ceb1[_0x7152('0x39')]:_0x4a888e['model'];_0x21ceb1[_0x7152('0x3d')]=qs['sort'](_0x47fdbb['query'][_0x7152('0x3e')]);_0x21ceb1[_0x7152('0x41')]=qs[_0x7152('0x36')](_[_0x7152('0x3f')](_0x47fdbb[_0x7152('0x34')],_0x4a888e['filters']));if(_0x47fdbb[_0x7152('0x34')]['filter']){_0x21ceb1[_0x7152('0x41')]=_[_0x7152('0x42')](_0x21ceb1[_0x7152('0x41')],{'$or':_[_0x7152('0x33')](_0x21ceb1[_0x7152('0x39')],function(_0x3db7ad){var _0x36ea34={};_0x36ea34[_0x3db7ad]={'$like':'%'+_0x47fdbb[_0x7152('0x34')][_0x7152('0x40')]+'%'};return _0x36ea34;})});}_0x21ceb1=_[_0x7152('0x42')]({},_0x21ceb1,_0x47fdbb['options']);return _0x52521c[_0x7152('0x4f')](_0x21ceb1);}})[_0x7152('0x28')](function(_0x184de6){if(_0x184de6){_0x1ea028=_0x184de6[_0x7152('0x3a')];if(!_0x47fdbb['query'][_0x7152('0x3b')]('nolimit')){_0x21ceb1[_0x7152('0x1e')]=qs[_0x7152('0x1e')](_0x47fdbb[_0x7152('0x34')][_0x7152('0x1e')]);_0x21ceb1[_0x7152('0x21')]=qs['offset'](_0x47fdbb[_0x7152('0x34')]['offset']);}return _0x52521c[_0x7152('0x4f')](_0x21ceb1);}})[_0x7152('0x28')](function(_0x21536e){if(_0x21536e){return _0x21536e?{'count':_0x1ea028,'rows':_0x21536e}:null;}})['then'](respondWithResult(_0x4bc691,null))['catch'](handleError(_0x4bc691,null));};exports[_0x7152('0x52')]=function(_0x3c673c,_0x402149,_0x16af86){if(_0x3c673c['body']['id']){delete _0x3c673c[_0x7152('0x4c')]['id'];}return db[_0x7152('0x2d')][_0x7152('0x50')]({'where':{'id':_0x3c673c[_0x7152('0x4a')]['id']}})[_0x7152('0x28')](handleEntityNotFound(_0x402149,null))[_0x7152('0x28')](function(_0x615aed){if(_0x615aed){_0x3c673c[_0x7152('0x4c')][_0x7152('0x53')]=_0x615aed['id'];_0x3c673c[_0x7152('0x4c')][_0x7152('0x54')]=integrations['getSubjects'](_0x3c673c['body'][_0x7152('0x55')],_0x3c673c[_0x7152('0x4c')][_0x7152('0x30')]);_0x3c673c['body'][_0x7152('0x56')]=integrations[_0x7152('0x57')](_0x3c673c['body']['channel'],_0x3c673c['body'][_0x7152('0x30')]);return db[_0x7152('0x51')][_0x7152('0x4b')](_0x3c673c['body'],{'include':[{'model':db[_0x7152('0x58')],'as':_0x7152('0x54')},{'model':db[_0x7152('0x58')],'as':_0x7152('0x56')}]});}return null;})['then'](respondWithResult(_0x402149,null))[_0x7152('0x4d')](handleError(_0x402149,null));};exports[_0x7152('0x59')]=function(_0x1b0f69,_0x3ba8b7,_0x57e742){var _0x544cd5='';var _0x16b312='';return db[_0x7152('0x2d')]['findOne']({'where':{'id':_0x1b0f69[_0x7152('0x4a')]['id']},'attributes':['id',_0x7152('0x5a'),_0x7152('0x5b'),_0x7152('0x5c')]})[_0x7152('0x28')](handleEntityNotFound(_0x3ba8b7,null))[_0x7152('0x28')](function(_0x5ca981){if(_0x5ca981){_0x16b312=_0x5ca981[_0x7152('0x5a')];_0x544cd5=_0x5ca981[_0x7152('0x5b')];var _0x70460c=_0x5ca981['remoteUri'][_0x7152('0x5d')](-0x1);if(_0x70460c==='/'){_0x544cd5=_0x544cd5[_0x7152('0x5e')](0x0,_0x544cd5['lastIndexOf'](_0x70460c));}return rp({'method':_0x7152('0x5f'),'uri':util[_0x7152('0x60')](_0x7152('0x61'),_0x544cd5,_0x7152('0x62')),'headers':{'Authorization':_0x7152('0x63')+_0x5ca981[_0x7152('0x5c')]},'json':!![]});}})[_0x7152('0x28')](function(_0x1f24ec){if(_0x1f24ec){var _0x22ad28=_0x1f24ec[_0x7152('0x64')];var _0x5bc849=![];var _0x40c431=null;for(_0x40c431=0x0;_0x40c431<_0x22ad28[_0x7152('0x3a')];_0x40c431++){if(_0x22ad28[_0x40c431][_0x7152('0x65')]===_0x16b312){_0x5bc849=!![];}}if(_0x5bc849){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x7152('0x66')});}}})[_0x7152('0x28')](respondWithResult(_0x3ba8b7,null))[_0x7152('0x4d')](function(_0x50eee5){var _0x5bfbc6=_0x1b0f69['query']['test']?0x1f4:_0x50eee5[_0x7152('0x67')]||0x1f4;logger['error'](_0x7152('0x68'),_0x7152('0x59'),_0x5bfbc6,JSON['stringify'](_0x50eee5));delete _0x50eee5[_0x7152('0x2b')];if(_0x5bfbc6===0x191){_0x5bfbc6=0x190;}_0x3ba8b7[_0x7152('0x1b')](_0x5bfbc6)[_0x7152('0x2c')](_0x1b0f69[_0x7152('0x34')][_0x7152('0x69')]?{'message':_0x7152('0x6a'),'statusCode':_0x50eee5['statusCode']}:_0x50eee5);});}; \ No newline at end of file +var _0x3a43=['length','model','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','create','body','find','findOne','FreshsalesConfiguration','rawAttributes','pick','getConfigurations','AccountId','getSubjects','channel','Descriptions','Subjects','FreshsalesField','getFields','username','remoteUri','slice','substring','lastIndexOf','GET','%s%s','/api/selector/owners','Token\x20token=','users','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshsalesAccount','fieldName','type','query','filters','intersection','attributes','fields'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x3a43,0xfc));var _0x33a4=function(_0x3474ac,_0x22d0f7){_0x3474ac=_0x3474ac-0x0;var _0x5345ec=_0x3a43[_0x3474ac];return _0x5345ec;};'use strict';var emlformat=require(_0x33a4('0x0'));var rimraf=require(_0x33a4('0x1'));var zipdir=require(_0x33a4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x33a4('0x3'));var BPromise=require(_0x33a4('0x4'));var Mustache=require(_0x33a4('0x5'));var util=require(_0x33a4('0x6'));var path=require(_0x33a4('0x7'));var sox=require(_0x33a4('0x8'));var csv=require(_0x33a4('0x9'));var ejs=require(_0x33a4('0xa'));var fs=require('fs');var fs_extra=require(_0x33a4('0xb'));var _=require('lodash');var squel=require(_0x33a4('0xc'));var crypto=require(_0x33a4('0xd'));var jsforce=require(_0x33a4('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x33a4('0x9'));var querystring=require(_0x33a4('0xf'));var Papa=require(_0x33a4('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x33a4('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x33a4('0x12'));var logger=require(_0x33a4('0x13'))(_0x33a4('0x14'));var utils=require(_0x33a4('0x15'));var config=require(_0x33a4('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x33a4('0x17'))['db'];var integrations=require(_0x33a4('0x18'));function respondWithStatusCode(_0x76c2c7,_0x301f79){_0x301f79=_0x301f79||0xcc;return function(_0xa00274){if(_0xa00274){return _0x76c2c7[_0x33a4('0x19')](_0x301f79);}return _0x76c2c7[_0x33a4('0x1a')](_0x301f79)[_0x33a4('0x1b')]();};}function respondWithResult(_0x259aad,_0x323155){_0x323155=_0x323155||0xc8;return function(_0x1da201){if(_0x1da201){return _0x259aad[_0x33a4('0x1a')](_0x323155)[_0x33a4('0x1c')](_0x1da201);}};}function respondWithFilteredResult(_0x3713b6,_0x1965ea){return function(_0x277eb6){if(_0x277eb6){var _0x123b98=typeof _0x1965ea[_0x33a4('0x1d')]===_0x33a4('0x1e')&&typeof _0x1965ea[_0x33a4('0x1f')]==='undefined';var _0xb286d7=_0x277eb6[_0x33a4('0x20')];var _0x1c41f2=_0x123b98?0x0:_0x1965ea['offset'];var _0xe65db3=_0x123b98?_0x277eb6[_0x33a4('0x20')]:_0x1965ea[_0x33a4('0x1d')]+_0x1965ea[_0x33a4('0x1f')];var _0x2643f2;if(_0xe65db3>=_0xb286d7){_0xe65db3=_0xb286d7;_0x2643f2=0xc8;}else{_0x2643f2=0xce;}_0x3713b6[_0x33a4('0x1a')](_0x2643f2);return _0x3713b6['set'](_0x33a4('0x21'),_0x1c41f2+'-'+_0xe65db3+'/'+_0xb286d7)[_0x33a4('0x1c')](_0x277eb6);}return null;};}function patchUpdates(_0x52a596){return function(_0x317c84){try{jsonpatch[_0x33a4('0x22')](_0x317c84,_0x52a596,!![]);}catch(_0x125bc9){return BPromise[_0x33a4('0x23')](_0x125bc9);}return _0x317c84[_0x33a4('0x24')]();};}function saveUpdates(_0xecb40e,_0xc9d1a8){return function(_0x59d875){if(_0x59d875){return _0x59d875[_0x33a4('0x25')](_0xecb40e)[_0x33a4('0x26')](function(_0x49721c){return _0x49721c;});}return null;};}function removeEntity(_0x492b56,_0x31e829){return function(_0xcd47ef){if(_0xcd47ef){return _0xcd47ef[_0x33a4('0x27')]()['then'](function(){_0x492b56['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x46d542,_0x45d276){return function(_0x3cc114){if(!_0x3cc114){_0x46d542['sendStatus'](0x194);}return _0x3cc114;};}function handleError(_0x3d5111,_0x1316e1){_0x1316e1=_0x1316e1||0x1f4;return function(_0x30479d){logger[_0x33a4('0x28')](_0x30479d[_0x33a4('0x29')]);if(_0x30479d[_0x33a4('0x2a')]){delete _0x30479d[_0x33a4('0x2a')];}_0x3d5111[_0x33a4('0x1a')](_0x1316e1)[_0x33a4('0x2b')](_0x30479d);};}exports[_0x33a4('0x2c')]=function(_0x55252c,_0x48fba3){var _0x127924={},_0x1720b6={},_0x39e92a={'count':0x0,'rows':[]};var _0x1a0a5d=_[_0x33a4('0x2d')](db[_0x33a4('0x2e')]['rawAttributes'],function(_0x2a5a5c){return{'name':_0x2a5a5c[_0x33a4('0x2f')],'type':_0x2a5a5c[_0x33a4('0x30')]['key']};});_0x1720b6['model']=_[_0x33a4('0x2d')](_0x1a0a5d,_0x33a4('0x2a'));_0x1720b6[_0x33a4('0x31')]=_['keys'](_0x55252c['query']);_0x1720b6[_0x33a4('0x32')]=_[_0x33a4('0x33')](_0x1720b6['model'],_0x1720b6[_0x33a4('0x31')]);_0x127924[_0x33a4('0x34')]=_['intersection'](_0x1720b6['model'],qs[_0x33a4('0x35')](_0x55252c['query'][_0x33a4('0x35')]));_0x127924[_0x33a4('0x34')]=_0x127924[_0x33a4('0x34')][_0x33a4('0x36')]?_0x127924[_0x33a4('0x34')]:_0x1720b6[_0x33a4('0x37')];if(!_0x55252c[_0x33a4('0x31')][_0x33a4('0x38')](_0x33a4('0x39'))){_0x127924[_0x33a4('0x1f')]=qs[_0x33a4('0x1f')](_0x55252c[_0x33a4('0x31')][_0x33a4('0x1f')]);_0x127924['offset']=qs[_0x33a4('0x1d')](_0x55252c[_0x33a4('0x31')][_0x33a4('0x1d')]);}_0x127924[_0x33a4('0x3a')]=qs['sort'](_0x55252c['query'][_0x33a4('0x3b')]);_0x127924['where']=qs[_0x33a4('0x32')](_['pick'](_0x55252c[_0x33a4('0x31')],_0x1720b6[_0x33a4('0x32')]),_0x1a0a5d);if(_0x55252c[_0x33a4('0x31')][_0x33a4('0x3c')]){_0x127924[_0x33a4('0x3d')]=_[_0x33a4('0x3e')](_0x127924['where'],{'$or':_[_0x33a4('0x2d')](_0x1a0a5d,function(_0x119ea9){if(_0x119ea9[_0x33a4('0x30')]!==_0x33a4('0x3f')){var _0x5e8334={};_0x5e8334[_0x119ea9[_0x33a4('0x2a')]]={'$like':'%'+_0x55252c[_0x33a4('0x31')]['filter']+'%'};return _0x5e8334;}})});}_0x127924=_['merge']({},_0x127924,_0x55252c[_0x33a4('0x40')]);var _0x5c80bf={'where':_0x127924[_0x33a4('0x3d')]};return db[_0x33a4('0x2e')][_0x33a4('0x20')](_0x5c80bf)[_0x33a4('0x26')](function(_0x2a4b27){_0x39e92a[_0x33a4('0x20')]=_0x2a4b27;if(_0x55252c['query'][_0x33a4('0x41')]){_0x127924[_0x33a4('0x42')]=[{'all':!![]}];}return db[_0x33a4('0x2e')]['findAll'](_0x127924);})[_0x33a4('0x26')](function(_0x2d231d){_0x39e92a[_0x33a4('0x43')]=_0x2d231d;return _0x39e92a;})['then'](respondWithFilteredResult(_0x48fba3,_0x127924))[_0x33a4('0x44')](handleError(_0x48fba3,null));};exports[_0x33a4('0x45')]=function(_0x4bc01f,_0x3a1b1f){var _0x5cb946={'raw':![],'where':{'id':_0x4bc01f[_0x33a4('0x46')]['id']}},_0x400546={};_0x400546[_0x33a4('0x37')]=_[_0x33a4('0x47')](db[_0x33a4('0x2e')]['rawAttributes']);_0x400546[_0x33a4('0x31')]=_[_0x33a4('0x47')](_0x4bc01f['query']);_0x400546['filters']=_[_0x33a4('0x33')](_0x400546[_0x33a4('0x37')],_0x400546[_0x33a4('0x31')]);_0x5cb946[_0x33a4('0x34')]=_[_0x33a4('0x33')](_0x400546[_0x33a4('0x37')],qs[_0x33a4('0x35')](_0x4bc01f['query'][_0x33a4('0x35')]));_0x5cb946[_0x33a4('0x34')]=_0x5cb946[_0x33a4('0x34')][_0x33a4('0x36')]?_0x5cb946[_0x33a4('0x34')]:_0x400546[_0x33a4('0x37')];if(_0x4bc01f['query']['includeAll']){_0x5cb946[_0x33a4('0x42')]=[{'all':!![]}];}_0x5cb946=_[_0x33a4('0x3e')]({},_0x5cb946,_0x4bc01f[_0x33a4('0x40')]);return db[_0x33a4('0x2e')]['find'](_0x5cb946)['then'](handleEntityNotFound(_0x3a1b1f,null))[_0x33a4('0x26')](respondWithResult(_0x3a1b1f,null))['catch'](handleError(_0x3a1b1f,null));};exports['create']=function(_0x537522,_0x10a35b){return db[_0x33a4('0x2e')][_0x33a4('0x48')](_0x537522[_0x33a4('0x49')],{})[_0x33a4('0x26')](respondWithResult(_0x10a35b,0xc9))[_0x33a4('0x44')](handleError(_0x10a35b,null));};exports['update']=function(_0xc3d3a8,_0x470a05){if(_0xc3d3a8['body']['id']){delete _0xc3d3a8[_0x33a4('0x49')]['id'];}return db[_0x33a4('0x2e')][_0x33a4('0x4a')]({'where':{'id':_0xc3d3a8[_0x33a4('0x46')]['id']}})['then'](handleEntityNotFound(_0x470a05,null))[_0x33a4('0x26')](saveUpdates(_0xc3d3a8[_0x33a4('0x49')],null))[_0x33a4('0x26')](respondWithResult(_0x470a05,null))[_0x33a4('0x44')](handleError(_0x470a05,null));};exports[_0x33a4('0x27')]=function(_0x2f353f,_0x55b6fb){return db[_0x33a4('0x2e')][_0x33a4('0x4a')]({'where':{'id':_0x2f353f[_0x33a4('0x46')]['id']}})[_0x33a4('0x26')](handleEntityNotFound(_0x55b6fb,null))[_0x33a4('0x26')](removeEntity(_0x55b6fb,null))['catch'](handleError(_0x55b6fb,null));};exports['getConfigurations']=function(_0x263442,_0x106263,_0xc8d495){var _0x88e579={};var _0xb2897e={};var _0x398a6b;var _0x5d4cee;return db[_0x33a4('0x2e')][_0x33a4('0x4b')]({'where':{'id':_0x263442['params']['id']}})[_0x33a4('0x26')](handleEntityNotFound(_0x106263,null))[_0x33a4('0x26')](function(_0x5b3a21){if(_0x5b3a21){_0x398a6b=_0x5b3a21;_0xb2897e[_0x33a4('0x37')]=_[_0x33a4('0x47')](db[_0x33a4('0x4c')][_0x33a4('0x4d')]);_0xb2897e[_0x33a4('0x31')]=_[_0x33a4('0x47')](_0x263442['query']);_0xb2897e['filters']=_['intersection'](_0xb2897e['model'],_0xb2897e['query']);_0x88e579['attributes']=_['intersection'](_0xb2897e[_0x33a4('0x37')],qs[_0x33a4('0x35')](_0x263442[_0x33a4('0x31')][_0x33a4('0x35')]));_0x88e579[_0x33a4('0x34')]=_0x88e579[_0x33a4('0x34')][_0x33a4('0x36')]?_0x88e579['attributes']:_0xb2897e['model'];_0x88e579[_0x33a4('0x3a')]=qs[_0x33a4('0x3b')](_0x263442['query'][_0x33a4('0x3b')]);_0x88e579[_0x33a4('0x3d')]=qs[_0x33a4('0x32')](_[_0x33a4('0x4e')](_0x263442[_0x33a4('0x31')],_0xb2897e[_0x33a4('0x32')]));if(_0x263442[_0x33a4('0x31')][_0x33a4('0x3c')]){_0x88e579[_0x33a4('0x3d')]=_[_0x33a4('0x3e')](_0x88e579[_0x33a4('0x3d')],{'$or':_[_0x33a4('0x2d')](_0x88e579['attributes'],function(_0x5b72d3){var _0x2b625b={};_0x2b625b[_0x5b72d3]={'$like':'%'+_0x263442[_0x33a4('0x31')]['filter']+'%'};return _0x2b625b;})});}_0x88e579=_[_0x33a4('0x3e')]({},_0x88e579,_0x263442['options']);return _0x398a6b[_0x33a4('0x4f')](_0x88e579);}})[_0x33a4('0x26')](function(_0x1a4380){if(_0x1a4380){_0x5d4cee=_0x1a4380[_0x33a4('0x36')];if(!_0x263442[_0x33a4('0x31')]['hasOwnProperty']('nolimit')){_0x88e579['limit']=qs['limit'](_0x263442[_0x33a4('0x31')]['limit']);_0x88e579[_0x33a4('0x1d')]=qs['offset'](_0x263442[_0x33a4('0x31')][_0x33a4('0x1d')]);}return _0x398a6b[_0x33a4('0x4f')](_0x88e579);}})[_0x33a4('0x26')](function(_0x2c28a0){if(_0x2c28a0){return _0x2c28a0?{'count':_0x5d4cee,'rows':_0x2c28a0}:null;}})['then'](respondWithResult(_0x106263,null))['catch'](handleError(_0x106263,null));};exports['addConfiguration']=function(_0x23b3b6,_0x51553f,_0x4da8f6){if(_0x23b3b6[_0x33a4('0x49')]['id']){delete _0x23b3b6['body']['id'];}return db[_0x33a4('0x2e')][_0x33a4('0x4b')]({'where':{'id':_0x23b3b6[_0x33a4('0x46')]['id']}})[_0x33a4('0x26')](handleEntityNotFound(_0x51553f,null))[_0x33a4('0x26')](function(_0x42fad0){if(_0x42fad0){_0x23b3b6['body'][_0x33a4('0x50')]=_0x42fad0['id'];_0x23b3b6[_0x33a4('0x49')]['Subjects']=integrations[_0x33a4('0x51')](_0x23b3b6[_0x33a4('0x49')][_0x33a4('0x52')],_0x23b3b6[_0x33a4('0x49')][_0x33a4('0x30')]);_0x23b3b6['body'][_0x33a4('0x53')]=integrations['getDescriptions'](_0x23b3b6[_0x33a4('0x49')][_0x33a4('0x52')],_0x23b3b6['body'][_0x33a4('0x30')]);return db[_0x33a4('0x4c')][_0x33a4('0x48')](_0x23b3b6[_0x33a4('0x49')],{'include':[{'model':db['FreshsalesField'],'as':_0x33a4('0x54')},{'model':db[_0x33a4('0x55')],'as':'Descriptions'}]});}return null;})[_0x33a4('0x26')](respondWithResult(_0x51553f,null))[_0x33a4('0x44')](handleError(_0x51553f,null));};exports[_0x33a4('0x56')]=function(_0x406623,_0xfaf086,_0x226c96){var _0x34b203='';var _0x54156b='';return db[_0x33a4('0x2e')][_0x33a4('0x4b')]({'where':{'id':_0x406623[_0x33a4('0x46')]['id']},'attributes':['id',_0x33a4('0x57'),_0x33a4('0x58'),'apiKey']})['then'](handleEntityNotFound(_0xfaf086,null))[_0x33a4('0x26')](function(_0x27f9e8){if(_0x27f9e8){_0x54156b=_0x27f9e8[_0x33a4('0x57')];_0x34b203=_0x27f9e8[_0x33a4('0x58')];var _0x1d4ffd=_0x27f9e8[_0x33a4('0x58')][_0x33a4('0x59')](-0x1);if(_0x1d4ffd==='/'){_0x34b203=_0x34b203[_0x33a4('0x5a')](0x0,_0x34b203[_0x33a4('0x5b')](_0x1d4ffd));}return rp({'method':_0x33a4('0x5c'),'uri':util['format'](_0x33a4('0x5d'),_0x34b203,_0x33a4('0x5e')),'headers':{'Authorization':_0x33a4('0x5f')+_0x27f9e8['apiKey']},'json':!![]});}})['then'](function(_0x1ca0b7){if(_0x1ca0b7){var _0x17f955=_0x1ca0b7[_0x33a4('0x60')];var _0x159568=![];var _0x570a8d=null;for(_0x570a8d=0x0;_0x570a8d<_0x17f955[_0x33a4('0x36')];_0x570a8d++){if(_0x17f955[_0x570a8d]['email']===_0x54156b){_0x159568=!![];}}if(_0x159568){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x33a4('0x61')});}}})[_0x33a4('0x26')](respondWithResult(_0xfaf086,null))['catch'](function(_0x236473){var _0x2f744e=_0x406623['query'][_0x33a4('0x62')]?0x1f4:_0x236473[_0x33a4('0x63')]||0x1f4;logger['error'](_0x33a4('0x64'),_0x33a4('0x56'),_0x2f744e,JSON[_0x33a4('0x65')](_0x236473));delete _0x236473[_0x33a4('0x2a')];if(_0x2f744e===0x191){_0x2f744e=0x190;}_0xfaf086[_0x33a4('0x1a')](_0x2f744e)['send'](_0x406623[_0x33a4('0x31')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x236473[_0x33a4('0x63')]}:_0x236473);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 406851b..839474f 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 _0x6050=['moment','bluebird','path','rimraf','../../config/environment','int_freshsales_accounts','lodash','util','../../config/logger','api'];(function(_0x3463bf,_0x64ea1e){var _0xd4c007=function(_0x252828){while(--_0x252828){_0x3463bf['push'](_0x3463bf['shift']());}};_0xd4c007(++_0x64ea1e);}(_0x6050,0x196));var _0x0605=function(_0x419197,_0x24b110){_0x419197=_0x419197-0x0;var _0x19282a=_0x6050[_0x419197];return _0x19282a;};'use strict';var _=require(_0x0605('0x0'));var util=require(_0x0605('0x1'));var logger=require(_0x0605('0x2'))(_0x0605('0x3'));var moment=require(_0x0605('0x4'));var BPromise=require(_0x0605('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0605('0x6'));var rimraf=require(_0x0605('0x7'));var config=require(_0x0605('0x8'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0xd78d96,_0x578623){return _0xd78d96['define']('FreshsalesAccount',attributes,{'tableName':_0x0605('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6455=['request-promise','path','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','lodash','../../config/logger','api','moment','bluebird'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x6455,0x97));var _0x5645=function(_0x668930,_0x4d5ebc){_0x668930=_0x668930-0x0;var _0xc79ae4=_0x6455[_0x668930];return _0xc79ae4;};'use strict';var _=require(_0x5645('0x0'));var util=require('util');var logger=require(_0x5645('0x1'))(_0x5645('0x2'));var moment=require(_0x5645('0x3'));var BPromise=require(_0x5645('0x4'));var rp=require(_0x5645('0x5'));var fs=require('fs');var path=require(_0x5645('0x6'));var rimraf=require('rimraf');var config=require(_0x5645('0x7'));var attributes=require(_0x5645('0x8'));var integrations=require(_0x5645('0x9'));module[_0x5645('0xa')]=function(_0x3a635d,_0x37d672){return _0x3a635d[_0x5645('0xb')](_0x5645('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 5a8e68d..a1a3e3c 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 _0x3a6d=['client','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetFreshsalesAccount','FreshsalesAccount','findAll','options','where','attributes','limit','include','model','map','debug','ShowFreshsalesAccount','find','raw','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x54e4b2,_0x404f55){var _0x163bee=function(_0xbb725e){while(--_0xbb725e){_0x54e4b2['push'](_0x54e4b2['shift']());}};_0x163bee(++_0x404f55);}(_0x3a6d,0x143));var _0xd3a6=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x3a6d[_0x5f1391];return _0x50ebe3;};'use strict';var _=require(_0xd3a6('0x0'));var util=require(_0xd3a6('0x1'));var moment=require('moment');var BPromise=require(_0xd3a6('0x2'));var rs=require(_0xd3a6('0x3'));var fs=require('fs');var Redis=require(_0xd3a6('0x4'));var db=require(_0xd3a6('0x5'))['db'];var utils=require(_0xd3a6('0x6'));var logger=require('../../config/logger')(_0xd3a6('0x7'));var config=require(_0xd3a6('0x8'));var jayson=require(_0xd3a6('0x9'));var client=jayson[_0xd3a6('0xa')][_0xd3a6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x282cb1,_0x58d83a,_0x121bd2){return new BPromise(function(_0x134dd3,_0x16858){return client[_0xd3a6('0xc')](_0x282cb1,_0x121bd2)[_0xd3a6('0xd')](function(_0xa67661){logger[_0xd3a6('0xe')](_0xd3a6('0xf'),_0x58d83a,_0xd3a6('0x10'));logger['debug'](_0xd3a6('0x11'),_0x58d83a,_0xd3a6('0x10'),JSON[_0xd3a6('0x12')](_0xa67661));if(_0xa67661[_0xd3a6('0x13')]){if(_0xa67661[_0xd3a6('0x13')]['code']===0x1f4){logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x58d83a,_0xa67661[_0xd3a6('0x13')][_0xd3a6('0x14')]);return _0x16858(_0xa67661[_0xd3a6('0x13')][_0xd3a6('0x14')]);}logger[_0xd3a6('0x13')](_0xd3a6('0xf'),_0x58d83a,_0xa67661[_0xd3a6('0x13')]['message']);return _0x134dd3(_0xa67661[_0xd3a6('0x13')][_0xd3a6('0x14')]);}else{logger[_0xd3a6('0xe')]('FreshsalesAccount,\x20%s,\x20%s',_0x58d83a,_0xd3a6('0x10'));_0x134dd3(_0xa67661[_0xd3a6('0x15')][_0xd3a6('0x14')]);}})['catch'](function(_0x3498d5){logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x58d83a,_0x3498d5);_0x16858(_0x3498d5);});});}exports[_0xd3a6('0x16')]=function(_0x8d1286){var _0x32683f=this;return new Promise(function(_0xbe58b4,_0x22fb05){return db[_0xd3a6('0x17')][_0xd3a6('0x18')]({'raw':_0x8d1286['options']?_0x8d1286[_0xd3a6('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x8d1286[_0xd3a6('0x19')]?_0x8d1286[_0xd3a6('0x19')][_0xd3a6('0x1a')]||null:null,'attributes':_0x8d1286[_0xd3a6('0x19')]?_0x8d1286[_0xd3a6('0x19')][_0xd3a6('0x1b')]||null:null,'limit':_0x8d1286['options']?_0x8d1286[_0xd3a6('0x19')][_0xd3a6('0x1c')]||null:null,'include':_0x8d1286['options']?_0x8d1286['options']['include']?_['map'](_0x8d1286['options'][_0xd3a6('0x1d')],function(_0x400982){return{'model':db[_0x400982[_0xd3a6('0x1e')]],'as':_0x400982['as'],'attributes':_0x400982['attributes'],'include':_0x400982[_0xd3a6('0x1d')]?_['map'](_0x400982[_0xd3a6('0x1d')],function(_0x16afc8){return{'model':db[_0x16afc8[_0xd3a6('0x1e')]],'as':_0x16afc8['as'],'attributes':_0x16afc8['attributes'],'include':_0x16afc8[_0xd3a6('0x1d')]?_[_0xd3a6('0x1f')](_0x16afc8[_0xd3a6('0x1d')],function(_0x219e32){return{'model':db[_0x219e32[_0xd3a6('0x1e')]],'as':_0x219e32['as'],'attributes':_0x219e32[_0xd3a6('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x30df90){logger[_0xd3a6('0xe')](_0xd3a6('0x16'),_0x8d1286);logger[_0xd3a6('0x20')](_0xd3a6('0x16'),_0x8d1286,JSON[_0xd3a6('0x12')](_0x30df90));_0xbe58b4(_0x30df90);})['catch'](function(_0x535bd4){logger[_0xd3a6('0x13')](_0xd3a6('0x16'),_0x535bd4[_0xd3a6('0x14')],_0x8d1286);_0x22fb05(_0x32683f[_0xd3a6('0x13')](0x1f4,_0x535bd4['message']));});});};exports[_0xd3a6('0x21')]=function(_0xa4efd){var _0x4d322a=this;return new Promise(function(_0x14381c,_0x5d9867){return db[_0xd3a6('0x17')][_0xd3a6('0x22')]({'raw':_0xa4efd[_0xd3a6('0x19')]?_0xa4efd[_0xd3a6('0x19')][_0xd3a6('0x23')]===undefined?!![]:![]:!![],'where':_0xa4efd[_0xd3a6('0x19')]?_0xa4efd[_0xd3a6('0x19')]['where']||null:null,'attributes':_0xa4efd['options']?_0xa4efd[_0xd3a6('0x19')][_0xd3a6('0x1b')]||null:null,'include':_0xa4efd[_0xd3a6('0x19')]?_0xa4efd['options'][_0xd3a6('0x1d')]?_[_0xd3a6('0x1f')](_0xa4efd[_0xd3a6('0x19')][_0xd3a6('0x1d')],function(_0x3ebd0d){return{'model':db[_0x3ebd0d[_0xd3a6('0x1e')]],'as':_0x3ebd0d['as'],'attributes':_0x3ebd0d[_0xd3a6('0x1b')],'include':_0x3ebd0d[_0xd3a6('0x1d')]?_['map'](_0x3ebd0d[_0xd3a6('0x1d')],function(_0x41981c){return{'model':db[_0x41981c[_0xd3a6('0x1e')]],'as':_0x41981c['as'],'attributes':_0x41981c[_0xd3a6('0x1b')],'include':_0x41981c[_0xd3a6('0x1d')]?_[_0xd3a6('0x1f')](_0x41981c['include'],function(_0x16a30a){return{'model':db[_0x16a30a['model']],'as':_0x16a30a['as'],'attributes':_0x16a30a[_0xd3a6('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd3a6('0xd')](function(_0x180bb9){logger[_0xd3a6('0xe')]('ShowFreshsalesAccount',_0xa4efd);logger['debug'](_0xd3a6('0x21'),_0xa4efd,JSON[_0xd3a6('0x12')](_0x180bb9));_0x14381c(_0x180bb9);})[_0xd3a6('0x24')](function(_0x5188e1){logger[_0xd3a6('0x13')](_0xd3a6('0x21'),_0x5188e1['message'],_0xa4efd);_0x5d9867(_0x4d322a[_0xd3a6('0x13')](0x1f4,_0x5188e1['message']));});});}; \ No newline at end of file +var _0x0a6b=['find','map','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','limit','include','model','then','debug','stringify','catch','ShowFreshsalesAccount'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0x0a6b,0x18e));var _0xb0a6=function(_0x4fa3b3,_0x3c7487){_0x4fa3b3=_0x4fa3b3-0x0;var _0x3a37f8=_0x0a6b[_0x4fa3b3];return _0x3a37f8;};'use strict';var _=require(_0xb0a6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb0a6('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb0a6('0x2'))['db'];var utils=require(_0xb0a6('0x3'));var logger=require(_0xb0a6('0x4'))('rpc');var config=require(_0xb0a6('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xb0a6('0x6')][_0xb0a6('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5e2d2d,_0x11cd5b,_0x24515c){return new BPromise(function(_0x2a8516,_0x530c05){return client['request'](_0x5e2d2d,_0x24515c)['then'](function(_0x2ded05){logger[_0xb0a6('0x8')](_0xb0a6('0x9'),_0x11cd5b,_0xb0a6('0xa'));logger['debug'](_0xb0a6('0xb'),_0x11cd5b,_0xb0a6('0xa'),JSON['stringify'](_0x2ded05));if(_0x2ded05[_0xb0a6('0xc')]){if(_0x2ded05[_0xb0a6('0xc')][_0xb0a6('0xd')]===0x1f4){logger[_0xb0a6('0xc')](_0xb0a6('0x9'),_0x11cd5b,_0x2ded05[_0xb0a6('0xc')][_0xb0a6('0xe')]);return _0x530c05(_0x2ded05[_0xb0a6('0xc')][_0xb0a6('0xe')]);}logger[_0xb0a6('0xc')]('FreshsalesAccount,\x20%s,\x20%s',_0x11cd5b,_0x2ded05[_0xb0a6('0xc')]['message']);return _0x2a8516(_0x2ded05[_0xb0a6('0xc')]['message']);}else{logger[_0xb0a6('0x8')]('FreshsalesAccount,\x20%s,\x20%s',_0x11cd5b,_0xb0a6('0xa'));_0x2a8516(_0x2ded05[_0xb0a6('0xf')][_0xb0a6('0xe')]);}})['catch'](function(_0x56b594){logger[_0xb0a6('0xc')](_0xb0a6('0x9'),_0x11cd5b,_0x56b594);_0x530c05(_0x56b594);});});}exports[_0xb0a6('0x10')]=function(_0x18f994){var _0x10f504=this;return new Promise(function(_0x13a1c8,_0x567dd5){return db[_0xb0a6('0x11')][_0xb0a6('0x12')]({'raw':_0x18f994[_0xb0a6('0x13')]?_0x18f994[_0xb0a6('0x13')][_0xb0a6('0x14')]===undefined?!![]:![]:!![],'where':_0x18f994[_0xb0a6('0x13')]?_0x18f994['options'][_0xb0a6('0x15')]||null:null,'attributes':_0x18f994[_0xb0a6('0x13')]?_0x18f994[_0xb0a6('0x13')][_0xb0a6('0x16')]||null:null,'limit':_0x18f994[_0xb0a6('0x13')]?_0x18f994[_0xb0a6('0x13')][_0xb0a6('0x17')]||null:null,'include':_0x18f994[_0xb0a6('0x13')]?_0x18f994['options'][_0xb0a6('0x18')]?_['map'](_0x18f994[_0xb0a6('0x13')][_0xb0a6('0x18')],function(_0x4997df){return{'model':db[_0x4997df['model']],'as':_0x4997df['as'],'attributes':_0x4997df[_0xb0a6('0x16')],'include':_0x4997df[_0xb0a6('0x18')]?_['map'](_0x4997df[_0xb0a6('0x18')],function(_0x24574a){return{'model':db[_0x24574a[_0xb0a6('0x19')]],'as':_0x24574a['as'],'attributes':_0x24574a[_0xb0a6('0x16')],'include':_0x24574a['include']?_['map'](_0x24574a[_0xb0a6('0x18')],function(_0x1e9947){return{'model':db[_0x1e9947[_0xb0a6('0x19')]],'as':_0x1e9947['as'],'attributes':_0x1e9947['attributes']};}):[]};}):[]};}):[]:[]})[_0xb0a6('0x1a')](function(_0x3347ac){logger[_0xb0a6('0x8')](_0xb0a6('0x10'),_0x18f994);logger[_0xb0a6('0x1b')](_0xb0a6('0x10'),_0x18f994,JSON[_0xb0a6('0x1c')](_0x3347ac));_0x13a1c8(_0x3347ac);})[_0xb0a6('0x1d')](function(_0x4255b9){logger['error'](_0xb0a6('0x10'),_0x4255b9[_0xb0a6('0xe')],_0x18f994);_0x567dd5(_0x10f504[_0xb0a6('0xc')](0x1f4,_0x4255b9['message']));});});};exports[_0xb0a6('0x1e')]=function(_0x582fc2){var _0x131e46=this;return new Promise(function(_0x309a91,_0x114f91){return db[_0xb0a6('0x11')][_0xb0a6('0x1f')]({'raw':_0x582fc2[_0xb0a6('0x13')]?_0x582fc2[_0xb0a6('0x13')][_0xb0a6('0x14')]===undefined?!![]:![]:!![],'where':_0x582fc2[_0xb0a6('0x13')]?_0x582fc2[_0xb0a6('0x13')]['where']||null:null,'attributes':_0x582fc2['options']?_0x582fc2[_0xb0a6('0x13')][_0xb0a6('0x16')]||null:null,'include':_0x582fc2[_0xb0a6('0x13')]?_0x582fc2[_0xb0a6('0x13')][_0xb0a6('0x18')]?_[_0xb0a6('0x20')](_0x582fc2[_0xb0a6('0x13')][_0xb0a6('0x18')],function(_0x4b0479){return{'model':db[_0x4b0479[_0xb0a6('0x19')]],'as':_0x4b0479['as'],'attributes':_0x4b0479[_0xb0a6('0x16')],'include':_0x4b0479['include']?_[_0xb0a6('0x20')](_0x4b0479[_0xb0a6('0x18')],function(_0x52e397){return{'model':db[_0x52e397['model']],'as':_0x52e397['as'],'attributes':_0x52e397[_0xb0a6('0x16')],'include':_0x52e397[_0xb0a6('0x18')]?_[_0xb0a6('0x20')](_0x52e397[_0xb0a6('0x18')],function(_0x4310ae){return{'model':db[_0x4310ae[_0xb0a6('0x19')]],'as':_0x4310ae['as'],'attributes':_0x4310ae['attributes']};}):[]};}):[]};}):[]:[]})[_0xb0a6('0x1a')](function(_0x5c280e){logger[_0xb0a6('0x8')](_0xb0a6('0x1e'),_0x582fc2);logger['debug']('ShowFreshsalesAccount',_0x582fc2,JSON['stringify'](_0x5c280e));_0x309a91(_0x5c280e);})[_0xb0a6('0x1d')](function(_0xd484f){logger[_0xb0a6('0xc')](_0xb0a6('0x1e'),_0xd484f[_0xb0a6('0xe')],_0x582fc2);_0x114f91(_0x131e46['error'](0x1f4,_0xd484f[_0xb0a6('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 807852b..8e678e6 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 _0x2e1f=['multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/subjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','create','put','delete','destroy','exports'];(function(_0x55fc11,_0x5c466a){var _0x2513cd=function(_0x50fcd7){while(--_0x50fcd7){_0x55fc11['push'](_0x55fc11['shift']());}};_0x2513cd(++_0x5c466a);}(_0x2e1f,0x142));var _0xf2e1=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x2e1f[_0x88cd7b];return _0x56fcc8;};'use strict';var multer=require(_0xf2e1('0x0'));var util=require(_0xf2e1('0x1'));var path=require('path');var timeout=require(_0xf2e1('0x2'));var express=require('express');var router=express[_0xf2e1('0x3')]();var fs_extra=require(_0xf2e1('0x4'));var auth=require(_0xf2e1('0x5'));var interaction=require(_0xf2e1('0x6'));var config=require(_0xf2e1('0x7'));var controller=require('./intFreshsalesConfiguration.controller');router['get']('/',auth[_0xf2e1('0x8')](),controller[_0xf2e1('0x9')]);router[_0xf2e1('0xa')](_0xf2e1('0xb'),auth[_0xf2e1('0x8')](),controller[_0xf2e1('0xc')]);router[_0xf2e1('0xa')](_0xf2e1('0xd'),auth['isAuthenticated'](),controller['getSubjects']);router[_0xf2e1('0xa')](_0xf2e1('0xe'),auth[_0xf2e1('0x8')](),controller[_0xf2e1('0xf')]);router[_0xf2e1('0xa')](_0xf2e1('0x10'),auth[_0xf2e1('0x8')](),controller[_0xf2e1('0x11')]);router['post']('/',auth[_0xf2e1('0x8')](),controller[_0xf2e1('0x12')]);router[_0xf2e1('0x13')](_0xf2e1('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xf2e1('0x14')](_0xf2e1('0xb'),auth['isAuthenticated'](),controller[_0xf2e1('0x15')]);module[_0xf2e1('0x16')]=router; \ No newline at end of file +var _0xe390=['getSubjects','/:id/descriptions','getDescriptions','/:id/fields','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','index','/:id','show','isAuthenticated'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xe390,0x104));var _0x0e39=function(_0x1d8412,_0xe42cdc){_0x1d8412=_0x1d8412-0x0;var _0x21c9a0=_0xe390[_0x1d8412];return _0x21c9a0;};'use strict';var multer=require(_0x0e39('0x0'));var util=require(_0x0e39('0x1'));var path=require(_0x0e39('0x2'));var timeout=require('connect-timeout');var express=require(_0x0e39('0x3'));var router=express[_0x0e39('0x4')]();var fs_extra=require(_0x0e39('0x5'));var auth=require(_0x0e39('0x6'));var interaction=require(_0x0e39('0x7'));var config=require(_0x0e39('0x8'));var controller=require(_0x0e39('0x9'));router[_0x0e39('0xa')]('/',auth['isAuthenticated'](),controller[_0x0e39('0xb')]);router['get'](_0x0e39('0xc'),auth['isAuthenticated'](),controller[_0x0e39('0xd')]);router[_0x0e39('0xa')]('/:id/subjects',auth[_0x0e39('0xe')](),controller[_0x0e39('0xf')]);router['get'](_0x0e39('0x10'),auth['isAuthenticated'](),controller[_0x0e39('0x11')]);router['get'](_0x0e39('0x12'),auth[_0x0e39('0xe')](),controller['getFields']);router['post']('/',auth[_0x0e39('0xe')](),controller[_0x0e39('0x13')]);router[_0x0e39('0x14')](_0x0e39('0xc'),auth[_0x0e39('0xe')](),controller[_0x0e39('0x15')]);router[_0x0e39('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x0e39('0x17')]);module[_0x0e39('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 62cd154..3bb3298 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 _0x202e=['sequelize','exports'];(function(_0x187eb3,_0x5f6fe3){var _0x2bcc36=function(_0x13a4bb){while(--_0x13a4bb){_0x187eb3['push'](_0x187eb3['shift']());}};_0x2bcc36(++_0x5f6fe3);}(_0x202e,0x7a));var _0xe202=function(_0x1ce683,_0x261780){_0x1ce683=_0x1ce683-0x0;var _0x5a1b0e=_0x202e[_0x1ce683];return _0x5a1b0e;};'use strict';var Sequelize=require(_0xe202('0x0'));module[_0xe202('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9cc4=['STRING'];(function(_0x3ad563,_0x518f0e){var _0x1ef30b=function(_0x115849){while(--_0x115849){_0x3ad563['push'](_0x3ad563['shift']());}};_0x1ef30b(++_0x518f0e);}(_0x9cc4,0x1d8));var _0x49cc=function(_0x2396c3,_0x2b1820){_0x2396c3=_0x2396c3-0x0;var _0x5bdb45=_0x9cc4[_0x2396c3];return _0x5bdb45;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x49cc('0x0')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index cae24e0..eb5b807 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 _0x4f51=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','map','FreshsalesConfiguration','fieldName','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','where','pick','type','includeAll','include','findAll','rows','catch','show','params','model','rawAttributes','length','merge','options','find','create','body','update','getSubjects','findOne','sort','filter','getDescriptions','FreshsalesField','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4f51,0x1ea));var _0x14f5=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x4f51[_0x47a7d0];return _0xb9bd08;};'use strict';var emlformat=require(_0x14f5('0x0'));var rimraf=require(_0x14f5('0x1'));var zipdir=require(_0x14f5('0x2'));var jsonpatch=require(_0x14f5('0x3'));var rp=require(_0x14f5('0x4'));var moment=require(_0x14f5('0x5'));var BPromise=require(_0x14f5('0x6'));var Mustache=require(_0x14f5('0x7'));var util=require(_0x14f5('0x8'));var path=require(_0x14f5('0x9'));var sox=require(_0x14f5('0xa'));var csv=require(_0x14f5('0xb'));var ejs=require(_0x14f5('0xc'));var fs=require('fs');var fs_extra=require(_0x14f5('0xd'));var _=require(_0x14f5('0xe'));var squel=require(_0x14f5('0xf'));var crypto=require('crypto');var jsforce=require(_0x14f5('0x10'));var deskjs=require(_0x14f5('0x11'));var toCsv=require(_0x14f5('0xb'));var querystring=require(_0x14f5('0x12'));var Papa=require(_0x14f5('0x13'));var Redis=require(_0x14f5('0x14'));var authService=require(_0x14f5('0x15'));var qs=require(_0x14f5('0x16'));var as=require(_0x14f5('0x17'));var hardwareService=require(_0x14f5('0x18'));var logger=require(_0x14f5('0x19'))(_0x14f5('0x1a'));var utils=require(_0x14f5('0x1b'));var config=require(_0x14f5('0x1c'));var licenseUtil=require(_0x14f5('0x1d'));var db=require(_0x14f5('0x1e'))['db'];function respondWithStatusCode(_0x36039e,_0x332766){_0x332766=_0x332766||0xcc;return function(_0x1e00b2){if(_0x1e00b2){return _0x36039e[_0x14f5('0x1f')](_0x332766);}return _0x36039e[_0x14f5('0x20')](_0x332766)['end']();};}function respondWithResult(_0x2e6893,_0x1b470b){_0x1b470b=_0x1b470b||0xc8;return function(_0x231476){if(_0x231476){return _0x2e6893[_0x14f5('0x20')](_0x1b470b)[_0x14f5('0x21')](_0x231476);}};}function respondWithFilteredResult(_0x12ee3c,_0x4a125a){return function(_0xbd8a17){if(_0xbd8a17){var _0x3cf0ba=typeof _0x4a125a[_0x14f5('0x22')]===_0x14f5('0x23')&&typeof _0x4a125a[_0x14f5('0x24')]==='undefined';var _0x3775bd=_0xbd8a17[_0x14f5('0x25')];var _0x4ba47e=_0x3cf0ba?0x0:_0x4a125a[_0x14f5('0x22')];var _0x1daa76=_0x3cf0ba?_0xbd8a17[_0x14f5('0x25')]:_0x4a125a[_0x14f5('0x22')]+_0x4a125a[_0x14f5('0x24')];var _0xc94310;if(_0x1daa76>=_0x3775bd){_0x1daa76=_0x3775bd;_0xc94310=0xc8;}else{_0xc94310=0xce;}_0x12ee3c[_0x14f5('0x20')](_0xc94310);return _0x12ee3c['set'](_0x14f5('0x26'),_0x4ba47e+'-'+_0x1daa76+'/'+_0x3775bd)[_0x14f5('0x21')](_0xbd8a17);}return null;};}function patchUpdates(_0x54f220){return function(_0x122556){try{jsonpatch[_0x14f5('0x27')](_0x122556,_0x54f220,!![]);}catch(_0x57a0cb){return BPromise[_0x14f5('0x28')](_0x57a0cb);}return _0x122556[_0x14f5('0x29')]();};}function saveUpdates(_0x34cc4a,_0xe26007){return function(_0x1c781e){if(_0x1c781e){return _0x1c781e['update'](_0x34cc4a)[_0x14f5('0x2a')](function(_0x1b8e3a){return _0x1b8e3a;});}return null;};}function removeEntity(_0x40cdc1,_0x1e6f46){return function(_0x1f88ff){if(_0x1f88ff){return _0x1f88ff[_0x14f5('0x2b')]()[_0x14f5('0x2a')](function(){_0x40cdc1[_0x14f5('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53fd66,_0x2c133c){return function(_0x2dc74a){if(!_0x2dc74a){_0x53fd66[_0x14f5('0x1f')](0x194);}return _0x2dc74a;};}function handleError(_0x388da1,_0x1ff9d3){_0x1ff9d3=_0x1ff9d3||0x1f4;return function(_0x58396f){logger[_0x14f5('0x2c')](_0x58396f[_0x14f5('0x2d')]);if(_0x58396f[_0x14f5('0x2e')]){delete _0x58396f[_0x14f5('0x2e')];}_0x388da1[_0x14f5('0x20')](_0x1ff9d3)['send'](_0x58396f);};}exports[_0x14f5('0x2f')]=function(_0x5085e4,_0x59003b){var _0x2acb8f={},_0xb16594={},_0x389829={'count':0x0,'rows':[]};var _0x528209=_[_0x14f5('0x30')](db[_0x14f5('0x31')]['rawAttributes'],function(_0xd8674f){return{'name':_0xd8674f[_0x14f5('0x32')],'type':_0xd8674f['type']['key']};});_0xb16594['model']=_[_0x14f5('0x30')](_0x528209,_0x14f5('0x2e'));_0xb16594[_0x14f5('0x33')]=_[_0x14f5('0x34')](_0x5085e4[_0x14f5('0x33')]);_0xb16594[_0x14f5('0x35')]=_['intersection'](_0xb16594['model'],_0xb16594[_0x14f5('0x33')]);_0x2acb8f['attributes']=_[_0x14f5('0x36')](_0xb16594['model'],qs['fields'](_0x5085e4[_0x14f5('0x33')][_0x14f5('0x37')]));_0x2acb8f['attributes']=_0x2acb8f[_0x14f5('0x38')]['length']?_0x2acb8f['attributes']:_0xb16594['model'];if(!_0x5085e4[_0x14f5('0x33')][_0x14f5('0x39')](_0x14f5('0x3a'))){_0x2acb8f[_0x14f5('0x24')]=qs['limit'](_0x5085e4[_0x14f5('0x33')][_0x14f5('0x24')]);_0x2acb8f['offset']=qs[_0x14f5('0x22')](_0x5085e4[_0x14f5('0x33')][_0x14f5('0x22')]);}_0x2acb8f[_0x14f5('0x3b')]=qs['sort'](_0x5085e4[_0x14f5('0x33')]['sort']);_0x2acb8f[_0x14f5('0x3c')]=qs[_0x14f5('0x35')](_[_0x14f5('0x3d')](_0x5085e4['query'],_0xb16594[_0x14f5('0x35')]),_0x528209);if(_0x5085e4[_0x14f5('0x33')]['filter']){_0x2acb8f['where']=_['merge'](_0x2acb8f['where'],{'$or':_['map'](_0x528209,function(_0x67b778){if(_0x67b778[_0x14f5('0x3e')]!=='VIRTUAL'){var _0x290371={};_0x290371[_0x67b778[_0x14f5('0x2e')]]={'$like':'%'+_0x5085e4[_0x14f5('0x33')]['filter']+'%'};return _0x290371;}})});}_0x2acb8f=_['merge']({},_0x2acb8f,_0x5085e4['options']);var _0x194a63={'where':_0x2acb8f[_0x14f5('0x3c')]};return db[_0x14f5('0x31')]['count'](_0x194a63)[_0x14f5('0x2a')](function(_0x21aeb1){_0x389829[_0x14f5('0x25')]=_0x21aeb1;if(_0x5085e4[_0x14f5('0x33')][_0x14f5('0x3f')]){_0x2acb8f[_0x14f5('0x40')]=[{'all':!![]}];}return db[_0x14f5('0x31')][_0x14f5('0x41')](_0x2acb8f);})[_0x14f5('0x2a')](function(_0x851691){_0x389829[_0x14f5('0x42')]=_0x851691;return _0x389829;})[_0x14f5('0x2a')](respondWithFilteredResult(_0x59003b,_0x2acb8f))[_0x14f5('0x43')](handleError(_0x59003b,null));};exports[_0x14f5('0x44')]=function(_0x43b9fb,_0x2104e5){var _0x75efef={'raw':![],'where':{'id':_0x43b9fb[_0x14f5('0x45')]['id']}},_0x464cb0={};_0x464cb0[_0x14f5('0x46')]=_[_0x14f5('0x34')](db[_0x14f5('0x31')][_0x14f5('0x47')]);_0x464cb0['query']=_[_0x14f5('0x34')](_0x43b9fb[_0x14f5('0x33')]);_0x464cb0[_0x14f5('0x35')]=_[_0x14f5('0x36')](_0x464cb0[_0x14f5('0x46')],_0x464cb0[_0x14f5('0x33')]);_0x75efef['attributes']=_['intersection'](_0x464cb0[_0x14f5('0x46')],qs[_0x14f5('0x37')](_0x43b9fb[_0x14f5('0x33')][_0x14f5('0x37')]));_0x75efef[_0x14f5('0x38')]=_0x75efef[_0x14f5('0x38')][_0x14f5('0x48')]?_0x75efef[_0x14f5('0x38')]:_0x464cb0[_0x14f5('0x46')];if(_0x43b9fb['query'][_0x14f5('0x3f')]){_0x75efef[_0x14f5('0x40')]=[{'all':!![]}];}_0x75efef=_[_0x14f5('0x49')]({},_0x75efef,_0x43b9fb[_0x14f5('0x4a')]);return db[_0x14f5('0x31')][_0x14f5('0x4b')](_0x75efef)[_0x14f5('0x2a')](handleEntityNotFound(_0x2104e5,null))[_0x14f5('0x2a')](respondWithResult(_0x2104e5,null))[_0x14f5('0x43')](handleError(_0x2104e5,null));};exports[_0x14f5('0x4c')]=function(_0x465767,_0x2ebbfd){return db[_0x14f5('0x31')][_0x14f5('0x4c')](_0x465767[_0x14f5('0x4d')],{})[_0x14f5('0x2a')](respondWithResult(_0x2ebbfd,0xc9))[_0x14f5('0x43')](handleError(_0x2ebbfd,null));};exports[_0x14f5('0x4e')]=function(_0x8c116d,_0x5ac596){if(_0x8c116d[_0x14f5('0x4d')]['id']){delete _0x8c116d['body']['id'];}return db[_0x14f5('0x31')]['find']({'where':{'id':_0x8c116d['params']['id']}})['then'](handleEntityNotFound(_0x5ac596,null))['then'](saveUpdates(_0x8c116d[_0x14f5('0x4d')],null))['then'](respondWithResult(_0x5ac596,null))['catch'](handleError(_0x5ac596,null));};exports['destroy']=function(_0x5adcdb,_0x9bbacf){return db[_0x14f5('0x31')]['find']({'where':{'id':_0x5adcdb[_0x14f5('0x45')]['id']}})['then'](handleEntityNotFound(_0x9bbacf,null))[_0x14f5('0x2a')](removeEntity(_0x9bbacf,null))[_0x14f5('0x43')](handleError(_0x9bbacf,null));};exports[_0x14f5('0x4f')]=function(_0x4f3a30,_0x2fcf78,_0x37eb75){var _0x5e2c6={};var _0x3192f4={};var _0xc687a9;var _0x5a6822;return db[_0x14f5('0x31')][_0x14f5('0x50')]({'where':{'id':_0x4f3a30[_0x14f5('0x45')]['id']}})[_0x14f5('0x2a')](handleEntityNotFound(_0x2fcf78,null))[_0x14f5('0x2a')](function(_0x43ec23){if(_0x43ec23){_0xc687a9=_0x43ec23;_0x3192f4[_0x14f5('0x46')]=_[_0x14f5('0x34')](db['FreshsalesField'][_0x14f5('0x47')]);_0x3192f4[_0x14f5('0x33')]=_[_0x14f5('0x34')](_0x4f3a30[_0x14f5('0x33')]);_0x3192f4[_0x14f5('0x35')]=_[_0x14f5('0x36')](_0x3192f4[_0x14f5('0x46')],_0x3192f4['query']);_0x5e2c6['attributes']=_[_0x14f5('0x36')](_0x3192f4[_0x14f5('0x46')],qs['fields'](_0x4f3a30[_0x14f5('0x33')][_0x14f5('0x37')]));_0x5e2c6['attributes']=_0x5e2c6[_0x14f5('0x38')][_0x14f5('0x48')]?_0x5e2c6[_0x14f5('0x38')]:_0x3192f4[_0x14f5('0x46')];_0x5e2c6[_0x14f5('0x3b')]=qs[_0x14f5('0x51')](_0x4f3a30[_0x14f5('0x33')][_0x14f5('0x51')]);_0x5e2c6['where']=qs[_0x14f5('0x35')](_[_0x14f5('0x3d')](_0x4f3a30['query'],_0x3192f4[_0x14f5('0x35')]));if(_0x4f3a30['query'][_0x14f5('0x52')]){_0x5e2c6[_0x14f5('0x3c')]=_[_0x14f5('0x49')](_0x5e2c6['where'],{'$or':_[_0x14f5('0x30')](_0x5e2c6['attributes'],function(_0x4ee6fb){var _0x8fa454={};_0x8fa454[_0x4ee6fb]={'$like':'%'+_0x4f3a30[_0x14f5('0x33')][_0x14f5('0x52')]+'%'};return _0x8fa454;})});}_0x5e2c6=_[_0x14f5('0x49')]({},_0x5e2c6,_0x4f3a30['options']);return _0xc687a9[_0x14f5('0x4f')](_0x5e2c6);}})[_0x14f5('0x2a')](function(_0x2928b4){if(_0x2928b4){_0x5a6822=_0x2928b4[_0x14f5('0x48')];if(!_0x4f3a30['query'][_0x14f5('0x39')](_0x14f5('0x3a'))){_0x5e2c6['limit']=qs[_0x14f5('0x24')](_0x4f3a30[_0x14f5('0x33')][_0x14f5('0x24')]);_0x5e2c6['offset']=qs['offset'](_0x4f3a30[_0x14f5('0x33')]['offset']);}return _0xc687a9[_0x14f5('0x4f')](_0x5e2c6);}})[_0x14f5('0x2a')](function(_0x14a915){if(_0x14a915){return _0x14a915?{'count':_0x5a6822,'rows':_0x14a915}:null;}})[_0x14f5('0x2a')](respondWithResult(_0x2fcf78,null))[_0x14f5('0x43')](handleError(_0x2fcf78,null));};exports[_0x14f5('0x53')]=function(_0x3efd55,_0x1b5f97,_0x166229){var _0x17f68f={};var _0x4408aa={};var _0x532909;var _0x51fc14;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x3efd55[_0x14f5('0x45')]['id']}})[_0x14f5('0x2a')](handleEntityNotFound(_0x1b5f97,null))[_0x14f5('0x2a')](function(_0x3076b4){if(_0x3076b4){_0x532909=_0x3076b4;_0x4408aa[_0x14f5('0x46')]=_[_0x14f5('0x34')](db[_0x14f5('0x54')][_0x14f5('0x47')]);_0x4408aa['query']=_[_0x14f5('0x34')](_0x3efd55[_0x14f5('0x33')]);_0x4408aa['filters']=_[_0x14f5('0x36')](_0x4408aa[_0x14f5('0x46')],_0x4408aa[_0x14f5('0x33')]);_0x17f68f[_0x14f5('0x38')]=_[_0x14f5('0x36')](_0x4408aa[_0x14f5('0x46')],qs['fields'](_0x3efd55['query'][_0x14f5('0x37')]));_0x17f68f[_0x14f5('0x38')]=_0x17f68f[_0x14f5('0x38')][_0x14f5('0x48')]?_0x17f68f[_0x14f5('0x38')]:_0x4408aa[_0x14f5('0x46')];_0x17f68f[_0x14f5('0x3b')]=qs[_0x14f5('0x51')](_0x3efd55[_0x14f5('0x33')][_0x14f5('0x51')]);_0x17f68f['where']=qs['filters'](_['pick'](_0x3efd55[_0x14f5('0x33')],_0x4408aa[_0x14f5('0x35')]));if(_0x3efd55[_0x14f5('0x33')]['filter']){_0x17f68f[_0x14f5('0x3c')]=_[_0x14f5('0x49')](_0x17f68f[_0x14f5('0x3c')],{'$or':_['map'](_0x17f68f[_0x14f5('0x38')],function(_0x2ff4e7){var _0x29ab25={};_0x29ab25[_0x2ff4e7]={'$like':'%'+_0x3efd55[_0x14f5('0x33')][_0x14f5('0x52')]+'%'};return _0x29ab25;})});}_0x17f68f=_[_0x14f5('0x49')]({},_0x17f68f,_0x3efd55['options']);return _0x532909[_0x14f5('0x53')](_0x17f68f);}})[_0x14f5('0x2a')](function(_0x257edd){if(_0x257edd){_0x51fc14=_0x257edd[_0x14f5('0x48')];if(!_0x3efd55[_0x14f5('0x33')][_0x14f5('0x39')]('nolimit')){_0x17f68f['limit']=qs['limit'](_0x3efd55['query']['limit']);_0x17f68f[_0x14f5('0x22')]=qs[_0x14f5('0x22')](_0x3efd55[_0x14f5('0x33')][_0x14f5('0x22')]);}return _0x532909[_0x14f5('0x53')](_0x17f68f);}})['then'](function(_0x353815){if(_0x353815){return _0x353815?{'count':_0x51fc14,'rows':_0x353815}:null;}})[_0x14f5('0x2a')](respondWithResult(_0x1b5f97,null))[_0x14f5('0x43')](handleError(_0x1b5f97,null));};exports[_0x14f5('0x55')]=function(_0x22994a,_0x500acc,_0x22fff3){var _0x57ead8={};var _0x4f7bd1={};var _0x1cdb99;var _0x3a920c;return db['FreshsalesConfiguration'][_0x14f5('0x50')]({'where':{'id':_0x22994a[_0x14f5('0x45')]['id']}})[_0x14f5('0x2a')](handleEntityNotFound(_0x500acc,null))[_0x14f5('0x2a')](function(_0x2a2441){if(_0x2a2441){_0x1cdb99=_0x2a2441;_0x4f7bd1[_0x14f5('0x46')]=_[_0x14f5('0x34')](db['FreshsalesField']['rawAttributes']);_0x4f7bd1[_0x14f5('0x33')]=_[_0x14f5('0x34')](_0x22994a[_0x14f5('0x33')]);_0x4f7bd1[_0x14f5('0x35')]=_['intersection'](_0x4f7bd1[_0x14f5('0x46')],_0x4f7bd1[_0x14f5('0x33')]);_0x57ead8['attributes']=_[_0x14f5('0x36')](_0x4f7bd1[_0x14f5('0x46')],qs[_0x14f5('0x37')](_0x22994a[_0x14f5('0x33')][_0x14f5('0x37')]));_0x57ead8['attributes']=_0x57ead8[_0x14f5('0x38')][_0x14f5('0x48')]?_0x57ead8['attributes']:_0x4f7bd1[_0x14f5('0x46')];_0x57ead8['order']=qs[_0x14f5('0x51')](_0x22994a['query']['sort']);_0x57ead8[_0x14f5('0x3c')]=qs[_0x14f5('0x35')](_[_0x14f5('0x3d')](_0x22994a[_0x14f5('0x33')],_0x4f7bd1['filters']));if(_0x22994a[_0x14f5('0x33')]['filter']){_0x57ead8[_0x14f5('0x3c')]=_[_0x14f5('0x49')](_0x57ead8['where'],{'$or':_['map'](_0x57ead8['attributes'],function(_0x5d583b){var _0x3a7070={};_0x3a7070[_0x5d583b]={'$like':'%'+_0x22994a[_0x14f5('0x33')]['filter']+'%'};return _0x3a7070;})});}_0x57ead8=_[_0x14f5('0x49')]({},_0x57ead8,_0x22994a['options']);return _0x1cdb99[_0x14f5('0x55')](_0x57ead8);}})['then'](function(_0x465185){if(_0x465185){_0x3a920c=_0x465185[_0x14f5('0x48')];if(!_0x22994a[_0x14f5('0x33')]['hasOwnProperty'](_0x14f5('0x3a'))){_0x57ead8['limit']=qs[_0x14f5('0x24')](_0x22994a[_0x14f5('0x33')][_0x14f5('0x24')]);_0x57ead8[_0x14f5('0x22')]=qs[_0x14f5('0x22')](_0x22994a[_0x14f5('0x33')][_0x14f5('0x22')]);}return _0x1cdb99[_0x14f5('0x55')](_0x57ead8);}})[_0x14f5('0x2a')](function(_0x22832b){if(_0x22832b){return _0x22832b?{'count':_0x3a920c,'rows':_0x22832b}:null;}})[_0x14f5('0x2a')](respondWithResult(_0x500acc,null))[_0x14f5('0x43')](handleError(_0x500acc,null));}; \ No newline at end of file +var _0xd9e3=['reject','save','update','then','destroy','error','stack','name','send','index','map','FreshsalesConfiguration','key','keys','query','filters','attributes','fields','length','model','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','include','options','find','create','body','getSubjects','findOne','sort','FreshsalesField','getDescriptions','getFields','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xd9e3,0x167));var _0x3d9e=function(_0x3da0d5,_0x4c370c){_0x3da0d5=_0x3da0d5-0x0;var _0x145a47=_0xd9e3[_0x3da0d5];return _0x145a47;};'use strict';var emlformat=require(_0x3d9e('0x0'));var rimraf=require(_0x3d9e('0x1'));var zipdir=require(_0x3d9e('0x2'));var jsonpatch=require(_0x3d9e('0x3'));var rp=require('request-promise');var moment=require(_0x3d9e('0x4'));var BPromise=require(_0x3d9e('0x5'));var Mustache=require(_0x3d9e('0x6'));var util=require(_0x3d9e('0x7'));var path=require('path');var sox=require(_0x3d9e('0x8'));var csv=require(_0x3d9e('0x9'));var ejs=require(_0x3d9e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3d9e('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3d9e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3d9e('0x9'));var querystring=require(_0x3d9e('0xd'));var Papa=require('papaparse');var Redis=require(_0x3d9e('0xe'));var authService=require(_0x3d9e('0xf'));var qs=require(_0x3d9e('0x10'));var as=require(_0x3d9e('0x11'));var hardwareService=require(_0x3d9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x3d9e('0x13'));var licenseUtil=require(_0x3d9e('0x14'));var db=require(_0x3d9e('0x15'))['db'];function respondWithStatusCode(_0x6524c6,_0x6b9c75){_0x6b9c75=_0x6b9c75||0xcc;return function(_0x1f3e40){if(_0x1f3e40){return _0x6524c6[_0x3d9e('0x16')](_0x6b9c75);}return _0x6524c6[_0x3d9e('0x17')](_0x6b9c75)[_0x3d9e('0x18')]();};}function respondWithResult(_0x411b08,_0x4f7b43){_0x4f7b43=_0x4f7b43||0xc8;return function(_0x636c54){if(_0x636c54){return _0x411b08[_0x3d9e('0x17')](_0x4f7b43)[_0x3d9e('0x19')](_0x636c54);}};}function respondWithFilteredResult(_0x850e21,_0x3eefda){return function(_0x56e39c){if(_0x56e39c){var _0x47a6db=typeof _0x3eefda[_0x3d9e('0x1a')]===_0x3d9e('0x1b')&&typeof _0x3eefda[_0x3d9e('0x1c')]===_0x3d9e('0x1b');var _0x3df454=_0x56e39c[_0x3d9e('0x1d')];var _0x2dcec6=_0x47a6db?0x0:_0x3eefda['offset'];var _0x1143b5=_0x47a6db?_0x56e39c[_0x3d9e('0x1d')]:_0x3eefda[_0x3d9e('0x1a')]+_0x3eefda[_0x3d9e('0x1c')];var _0x32da01;if(_0x1143b5>=_0x3df454){_0x1143b5=_0x3df454;_0x32da01=0xc8;}else{_0x32da01=0xce;}_0x850e21['status'](_0x32da01);return _0x850e21['set'](_0x3d9e('0x1e'),_0x2dcec6+'-'+_0x1143b5+'/'+_0x3df454)[_0x3d9e('0x19')](_0x56e39c);}return null;};}function patchUpdates(_0x399f60){return function(_0x4ee5ef){try{jsonpatch['apply'](_0x4ee5ef,_0x399f60,!![]);}catch(_0x55514a){return BPromise[_0x3d9e('0x1f')](_0x55514a);}return _0x4ee5ef[_0x3d9e('0x20')]();};}function saveUpdates(_0x3d23d1,_0x472b67){return function(_0x35b703){if(_0x35b703){return _0x35b703[_0x3d9e('0x21')](_0x3d23d1)[_0x3d9e('0x22')](function(_0x1429a9){return _0x1429a9;});}return null;};}function removeEntity(_0x597c14,_0x59eee6){return function(_0x3b8eb8){if(_0x3b8eb8){return _0x3b8eb8[_0x3d9e('0x23')]()[_0x3d9e('0x22')](function(){_0x597c14[_0x3d9e('0x17')](0xcc)[_0x3d9e('0x18')]();});}};}function handleEntityNotFound(_0x19731f,_0x59f110){return function(_0x3206d5){if(!_0x3206d5){_0x19731f['sendStatus'](0x194);}return _0x3206d5;};}function handleError(_0x92e53c,_0x21f26c){_0x21f26c=_0x21f26c||0x1f4;return function(_0x581bef){logger[_0x3d9e('0x24')](_0x581bef[_0x3d9e('0x25')]);if(_0x581bef[_0x3d9e('0x26')]){delete _0x581bef[_0x3d9e('0x26')];}_0x92e53c[_0x3d9e('0x17')](_0x21f26c)[_0x3d9e('0x27')](_0x581bef);};}exports[_0x3d9e('0x28')]=function(_0x5b1915,_0x2db3fb){var _0x433e17={},_0x167922={},_0x4fd9d1={'count':0x0,'rows':[]};var _0xaa0364=_[_0x3d9e('0x29')](db[_0x3d9e('0x2a')]['rawAttributes'],function(_0x3f66c1){return{'name':_0x3f66c1['fieldName'],'type':_0x3f66c1['type'][_0x3d9e('0x2b')]};});_0x167922['model']=_[_0x3d9e('0x29')](_0xaa0364,_0x3d9e('0x26'));_0x167922['query']=_[_0x3d9e('0x2c')](_0x5b1915[_0x3d9e('0x2d')]);_0x167922[_0x3d9e('0x2e')]=_['intersection'](_0x167922['model'],_0x167922[_0x3d9e('0x2d')]);_0x433e17[_0x3d9e('0x2f')]=_['intersection'](_0x167922['model'],qs[_0x3d9e('0x30')](_0x5b1915[_0x3d9e('0x2d')][_0x3d9e('0x30')]));_0x433e17['attributes']=_0x433e17[_0x3d9e('0x2f')][_0x3d9e('0x31')]?_0x433e17[_0x3d9e('0x2f')]:_0x167922[_0x3d9e('0x32')];if(!_0x5b1915[_0x3d9e('0x2d')][_0x3d9e('0x33')](_0x3d9e('0x34'))){_0x433e17[_0x3d9e('0x1c')]=qs[_0x3d9e('0x1c')](_0x5b1915[_0x3d9e('0x2d')][_0x3d9e('0x1c')]);_0x433e17[_0x3d9e('0x1a')]=qs[_0x3d9e('0x1a')](_0x5b1915[_0x3d9e('0x2d')][_0x3d9e('0x1a')]);}_0x433e17[_0x3d9e('0x35')]=qs['sort'](_0x5b1915[_0x3d9e('0x2d')]['sort']);_0x433e17[_0x3d9e('0x36')]=qs[_0x3d9e('0x2e')](_[_0x3d9e('0x37')](_0x5b1915['query'],_0x167922['filters']),_0xaa0364);if(_0x5b1915[_0x3d9e('0x2d')][_0x3d9e('0x38')]){_0x433e17[_0x3d9e('0x36')]=_[_0x3d9e('0x39')](_0x433e17[_0x3d9e('0x36')],{'$or':_['map'](_0xaa0364,function(_0x5541f1){if(_0x5541f1['type']!==_0x3d9e('0x3a')){var _0x3828bb={};_0x3828bb[_0x5541f1[_0x3d9e('0x26')]]={'$like':'%'+_0x5b1915[_0x3d9e('0x2d')][_0x3d9e('0x38')]+'%'};return _0x3828bb;}})});}_0x433e17=_[_0x3d9e('0x39')]({},_0x433e17,_0x5b1915['options']);var _0x44bd29={'where':_0x433e17[_0x3d9e('0x36')]};return db['FreshsalesConfiguration'][_0x3d9e('0x1d')](_0x44bd29)['then'](function(_0xc885e9){_0x4fd9d1[_0x3d9e('0x1d')]=_0xc885e9;if(_0x5b1915[_0x3d9e('0x2d')][_0x3d9e('0x3b')]){_0x433e17['include']=[{'all':!![]}];}return db[_0x3d9e('0x2a')][_0x3d9e('0x3c')](_0x433e17);})[_0x3d9e('0x22')](function(_0x4a17b6){_0x4fd9d1[_0x3d9e('0x3d')]=_0x4a17b6;return _0x4fd9d1;})[_0x3d9e('0x22')](respondWithFilteredResult(_0x2db3fb,_0x433e17))[_0x3d9e('0x3e')](handleError(_0x2db3fb,null));};exports[_0x3d9e('0x3f')]=function(_0x320c51,_0x47b81b){var _0x141c13={'raw':![],'where':{'id':_0x320c51[_0x3d9e('0x40')]['id']}},_0x291c73={};_0x291c73[_0x3d9e('0x32')]=_[_0x3d9e('0x2c')](db[_0x3d9e('0x2a')][_0x3d9e('0x41')]);_0x291c73['query']=_[_0x3d9e('0x2c')](_0x320c51[_0x3d9e('0x2d')]);_0x291c73[_0x3d9e('0x2e')]=_[_0x3d9e('0x42')](_0x291c73[_0x3d9e('0x32')],_0x291c73['query']);_0x141c13[_0x3d9e('0x2f')]=_[_0x3d9e('0x42')](_0x291c73[_0x3d9e('0x32')],qs[_0x3d9e('0x30')](_0x320c51['query'][_0x3d9e('0x30')]));_0x141c13[_0x3d9e('0x2f')]=_0x141c13[_0x3d9e('0x2f')][_0x3d9e('0x31')]?_0x141c13['attributes']:_0x291c73[_0x3d9e('0x32')];if(_0x320c51['query'][_0x3d9e('0x3b')]){_0x141c13[_0x3d9e('0x43')]=[{'all':!![]}];}_0x141c13=_[_0x3d9e('0x39')]({},_0x141c13,_0x320c51[_0x3d9e('0x44')]);return db[_0x3d9e('0x2a')][_0x3d9e('0x45')](_0x141c13)['then'](handleEntityNotFound(_0x47b81b,null))[_0x3d9e('0x22')](respondWithResult(_0x47b81b,null))[_0x3d9e('0x3e')](handleError(_0x47b81b,null));};exports[_0x3d9e('0x46')]=function(_0x308bd3,_0x5bdafe){return db[_0x3d9e('0x2a')]['create'](_0x308bd3[_0x3d9e('0x47')],{})[_0x3d9e('0x22')](respondWithResult(_0x5bdafe,0xc9))[_0x3d9e('0x3e')](handleError(_0x5bdafe,null));};exports[_0x3d9e('0x21')]=function(_0x270ba8,_0xcfd278){if(_0x270ba8[_0x3d9e('0x47')]['id']){delete _0x270ba8['body']['id'];}return db['FreshsalesConfiguration'][_0x3d9e('0x45')]({'where':{'id':_0x270ba8[_0x3d9e('0x40')]['id']}})[_0x3d9e('0x22')](handleEntityNotFound(_0xcfd278,null))[_0x3d9e('0x22')](saveUpdates(_0x270ba8['body'],null))[_0x3d9e('0x22')](respondWithResult(_0xcfd278,null))[_0x3d9e('0x3e')](handleError(_0xcfd278,null));};exports[_0x3d9e('0x23')]=function(_0x12ad69,_0x5a013e){return db['FreshsalesConfiguration'][_0x3d9e('0x45')]({'where':{'id':_0x12ad69[_0x3d9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x5a013e,null))[_0x3d9e('0x22')](removeEntity(_0x5a013e,null))[_0x3d9e('0x3e')](handleError(_0x5a013e,null));};exports[_0x3d9e('0x48')]=function(_0x1951a5,_0x243529,_0x18e0dd){var _0x44eb56={};var _0x35f49c={};var _0x353d3c;var _0x36b279;return db[_0x3d9e('0x2a')][_0x3d9e('0x49')]({'where':{'id':_0x1951a5[_0x3d9e('0x40')]['id']}})[_0x3d9e('0x22')](handleEntityNotFound(_0x243529,null))[_0x3d9e('0x22')](function(_0x321c31){if(_0x321c31){_0x353d3c=_0x321c31;_0x35f49c[_0x3d9e('0x32')]=_[_0x3d9e('0x2c')](db['FreshsalesField'][_0x3d9e('0x41')]);_0x35f49c[_0x3d9e('0x2d')]=_['keys'](_0x1951a5[_0x3d9e('0x2d')]);_0x35f49c[_0x3d9e('0x2e')]=_[_0x3d9e('0x42')](_0x35f49c[_0x3d9e('0x32')],_0x35f49c[_0x3d9e('0x2d')]);_0x44eb56['attributes']=_[_0x3d9e('0x42')](_0x35f49c[_0x3d9e('0x32')],qs['fields'](_0x1951a5[_0x3d9e('0x2d')][_0x3d9e('0x30')]));_0x44eb56['attributes']=_0x44eb56[_0x3d9e('0x2f')][_0x3d9e('0x31')]?_0x44eb56[_0x3d9e('0x2f')]:_0x35f49c[_0x3d9e('0x32')];_0x44eb56[_0x3d9e('0x35')]=qs[_0x3d9e('0x4a')](_0x1951a5[_0x3d9e('0x2d')][_0x3d9e('0x4a')]);_0x44eb56[_0x3d9e('0x36')]=qs[_0x3d9e('0x2e')](_[_0x3d9e('0x37')](_0x1951a5[_0x3d9e('0x2d')],_0x35f49c[_0x3d9e('0x2e')]));if(_0x1951a5[_0x3d9e('0x2d')][_0x3d9e('0x38')]){_0x44eb56[_0x3d9e('0x36')]=_['merge'](_0x44eb56[_0x3d9e('0x36')],{'$or':_[_0x3d9e('0x29')](_0x44eb56['attributes'],function(_0x4d323c){var _0x413e14={};_0x413e14[_0x4d323c]={'$like':'%'+_0x1951a5[_0x3d9e('0x2d')][_0x3d9e('0x38')]+'%'};return _0x413e14;})});}_0x44eb56=_[_0x3d9e('0x39')]({},_0x44eb56,_0x1951a5[_0x3d9e('0x44')]);return _0x353d3c[_0x3d9e('0x48')](_0x44eb56);}})['then'](function(_0x12615e){if(_0x12615e){_0x36b279=_0x12615e[_0x3d9e('0x31')];if(!_0x1951a5['query'][_0x3d9e('0x33')](_0x3d9e('0x34'))){_0x44eb56['limit']=qs[_0x3d9e('0x1c')](_0x1951a5[_0x3d9e('0x2d')][_0x3d9e('0x1c')]);_0x44eb56[_0x3d9e('0x1a')]=qs[_0x3d9e('0x1a')](_0x1951a5[_0x3d9e('0x2d')]['offset']);}return _0x353d3c['getSubjects'](_0x44eb56);}})[_0x3d9e('0x22')](function(_0x131331){if(_0x131331){return _0x131331?{'count':_0x36b279,'rows':_0x131331}:null;}})[_0x3d9e('0x22')](respondWithResult(_0x243529,null))[_0x3d9e('0x3e')](handleError(_0x243529,null));};exports['getDescriptions']=function(_0x5c9d67,_0x598ca8,_0x997244){var _0x45c4de={};var _0x5e9a25={};var _0x547e92;var _0x1abdb5;return db[_0x3d9e('0x2a')][_0x3d9e('0x49')]({'where':{'id':_0x5c9d67[_0x3d9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x598ca8,null))[_0x3d9e('0x22')](function(_0x396d79){if(_0x396d79){_0x547e92=_0x396d79;_0x5e9a25[_0x3d9e('0x32')]=_[_0x3d9e('0x2c')](db[_0x3d9e('0x4b')][_0x3d9e('0x41')]);_0x5e9a25[_0x3d9e('0x2d')]=_[_0x3d9e('0x2c')](_0x5c9d67[_0x3d9e('0x2d')]);_0x5e9a25[_0x3d9e('0x2e')]=_[_0x3d9e('0x42')](_0x5e9a25[_0x3d9e('0x32')],_0x5e9a25[_0x3d9e('0x2d')]);_0x45c4de['attributes']=_[_0x3d9e('0x42')](_0x5e9a25[_0x3d9e('0x32')],qs[_0x3d9e('0x30')](_0x5c9d67[_0x3d9e('0x2d')][_0x3d9e('0x30')]));_0x45c4de[_0x3d9e('0x2f')]=_0x45c4de[_0x3d9e('0x2f')][_0x3d9e('0x31')]?_0x45c4de[_0x3d9e('0x2f')]:_0x5e9a25[_0x3d9e('0x32')];_0x45c4de[_0x3d9e('0x35')]=qs[_0x3d9e('0x4a')](_0x5c9d67[_0x3d9e('0x2d')]['sort']);_0x45c4de[_0x3d9e('0x36')]=qs[_0x3d9e('0x2e')](_[_0x3d9e('0x37')](_0x5c9d67['query'],_0x5e9a25[_0x3d9e('0x2e')]));if(_0x5c9d67[_0x3d9e('0x2d')][_0x3d9e('0x38')]){_0x45c4de[_0x3d9e('0x36')]=_[_0x3d9e('0x39')](_0x45c4de[_0x3d9e('0x36')],{'$or':_[_0x3d9e('0x29')](_0x45c4de['attributes'],function(_0x3812bc){var _0x508986={};_0x508986[_0x3812bc]={'$like':'%'+_0x5c9d67[_0x3d9e('0x2d')][_0x3d9e('0x38')]+'%'};return _0x508986;})});}_0x45c4de=_[_0x3d9e('0x39')]({},_0x45c4de,_0x5c9d67[_0x3d9e('0x44')]);return _0x547e92[_0x3d9e('0x4c')](_0x45c4de);}})['then'](function(_0x492ab1){if(_0x492ab1){_0x1abdb5=_0x492ab1[_0x3d9e('0x31')];if(!_0x5c9d67[_0x3d9e('0x2d')][_0x3d9e('0x33')](_0x3d9e('0x34'))){_0x45c4de[_0x3d9e('0x1c')]=qs['limit'](_0x5c9d67[_0x3d9e('0x2d')][_0x3d9e('0x1c')]);_0x45c4de[_0x3d9e('0x1a')]=qs[_0x3d9e('0x1a')](_0x5c9d67[_0x3d9e('0x2d')][_0x3d9e('0x1a')]);}return _0x547e92[_0x3d9e('0x4c')](_0x45c4de);}})['then'](function(_0x296787){if(_0x296787){return _0x296787?{'count':_0x1abdb5,'rows':_0x296787}:null;}})[_0x3d9e('0x22')](respondWithResult(_0x598ca8,null))[_0x3d9e('0x3e')](handleError(_0x598ca8,null));};exports[_0x3d9e('0x4d')]=function(_0x3034a2,_0x6017fb,_0x11c7dc){var _0x349305={};var _0x58a4c7={};var _0x13188d;var _0x26011f;return db[_0x3d9e('0x2a')][_0x3d9e('0x49')]({'where':{'id':_0x3034a2[_0x3d9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x6017fb,null))['then'](function(_0x2d6be3){if(_0x2d6be3){_0x13188d=_0x2d6be3;_0x58a4c7['model']=_[_0x3d9e('0x2c')](db[_0x3d9e('0x4b')][_0x3d9e('0x41')]);_0x58a4c7['query']=_[_0x3d9e('0x2c')](_0x3034a2[_0x3d9e('0x2d')]);_0x58a4c7['filters']=_[_0x3d9e('0x42')](_0x58a4c7[_0x3d9e('0x32')],_0x58a4c7[_0x3d9e('0x2d')]);_0x349305[_0x3d9e('0x2f')]=_['intersection'](_0x58a4c7['model'],qs[_0x3d9e('0x30')](_0x3034a2[_0x3d9e('0x2d')]['fields']));_0x349305['attributes']=_0x349305[_0x3d9e('0x2f')]['length']?_0x349305[_0x3d9e('0x2f')]:_0x58a4c7[_0x3d9e('0x32')];_0x349305['order']=qs[_0x3d9e('0x4a')](_0x3034a2['query']['sort']);_0x349305[_0x3d9e('0x36')]=qs[_0x3d9e('0x2e')](_['pick'](_0x3034a2[_0x3d9e('0x2d')],_0x58a4c7[_0x3d9e('0x2e')]));if(_0x3034a2[_0x3d9e('0x2d')]['filter']){_0x349305[_0x3d9e('0x36')]=_[_0x3d9e('0x39')](_0x349305['where'],{'$or':_['map'](_0x349305[_0x3d9e('0x2f')],function(_0x40e194){var _0x539850={};_0x539850[_0x40e194]={'$like':'%'+_0x3034a2[_0x3d9e('0x2d')][_0x3d9e('0x38')]+'%'};return _0x539850;})});}_0x349305=_[_0x3d9e('0x39')]({},_0x349305,_0x3034a2['options']);return _0x13188d[_0x3d9e('0x4d')](_0x349305);}})[_0x3d9e('0x22')](function(_0x221684){if(_0x221684){_0x26011f=_0x221684[_0x3d9e('0x31')];if(!_0x3034a2[_0x3d9e('0x2d')][_0x3d9e('0x33')](_0x3d9e('0x34'))){_0x349305[_0x3d9e('0x1c')]=qs[_0x3d9e('0x1c')](_0x3034a2[_0x3d9e('0x2d')]['limit']);_0x349305['offset']=qs['offset'](_0x3034a2['query'][_0x3d9e('0x1a')]);}return _0x13188d[_0x3d9e('0x4d')](_0x349305);}})[_0x3d9e('0x22')](function(_0x5408d5){if(_0x5408d5){return _0x5408d5?{'count':_0x26011f,'rows':_0x5408d5}:null;}})[_0x3d9e('0x22')](respondWithResult(_0x6017fb,null))[_0x3d9e('0x3e')](handleError(_0x6017fb,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index d5ca546..d07cbd8 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 _0xc799=['rimraf','exports','define','FreshsalesConfiguration','util','../../config/logger','api','moment','bluebird','path'];(function(_0x51cacd,_0x2ecd85){var _0x5eaec6=function(_0x227e3e){while(--_0x227e3e){_0x51cacd['push'](_0x51cacd['shift']());}};_0x5eaec6(++_0x2ecd85);}(_0xc799,0xe0));var _0x9c79=function(_0x1f03fc,_0x5296e9){_0x1f03fc=_0x1f03fc-0x0;var _0x1d33b8=_0xc799[_0x1f03fc];return _0x1d33b8;};'use strict';var _=require('lodash');var util=require(_0x9c79('0x0'));var logger=require(_0x9c79('0x1'))(_0x9c79('0x2'));var moment=require(_0x9c79('0x3'));var BPromise=require(_0x9c79('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9c79('0x5'));var rimraf=require(_0x9c79('0x6'));var config=require('../../config/environment');var attributes=require('./intFreshsalesConfiguration.attributes');module[_0x9c79('0x7')]=function(_0xbe56e9,_0x25e7df){return _0xbe56e9[_0x9c79('0x8')](_0x9c79('0x9'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x07fb=['define','int_freshsales_configurations','lodash','util','../../config/logger','api','moment','path','../../config/environment','./intFreshsalesConfiguration.attributes','exports'];(function(_0x44fe76,_0x4b11ba){var _0x572e54=function(_0x2492b1){while(--_0x2492b1){_0x44fe76['push'](_0x44fe76['shift']());}};_0x572e54(++_0x4b11ba);}(_0x07fb,0x1e6));var _0xb07f=function(_0x4bbde5,_0x5c838b){_0x4bbde5=_0x4bbde5-0x0;var _0x2e97b8=_0x07fb[_0x4bbde5];return _0x2e97b8;};'use strict';var _=require(_0xb07f('0x0'));var util=require(_0xb07f('0x1'));var logger=require(_0xb07f('0x2'))(_0xb07f('0x3'));var moment=require(_0xb07f('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb07f('0x5'));var rimraf=require('rimraf');var config=require(_0xb07f('0x6'));var attributes=require(_0xb07f('0x7'));module[_0xb07f('0x8')]=function(_0x5f3a12,_0x3891a1){return _0x5f3a12[_0xb07f('0x9')]('FreshsalesConfiguration',attributes,{'tableName':_0xb07f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index 4712ae3..4cbac0a 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 _0x4eb7=['message','info','request\x20sent','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','FreshsalesConfiguration,\x20%s,\x20%s','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','code','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4eb7,0x1df));var _0x74eb=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0x4eb7[_0x455c6c];return _0x488242;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x74eb('0x0'));var BPromise=require(_0x74eb('0x1'));var rs=require(_0x74eb('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x74eb('0x3'))['db'];var utils=require(_0x74eb('0x4'));var logger=require(_0x74eb('0x5'))(_0x74eb('0x6'));var config=require('../../config/environment');var jayson=require(_0x74eb('0x7'));var client=jayson[_0x74eb('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x105aa7,_0x3c024f,_0x10dbbd){return new BPromise(function(_0x5f5842,_0xc13fac){return client[_0x74eb('0x9')](_0x105aa7,_0x10dbbd)['then'](function(_0x1e8471){logger['info'](_0x74eb('0xa'),_0x3c024f,'request\x20sent');logger[_0x74eb('0xb')](_0x74eb('0xc'),_0x3c024f,'request\x20sent',JSON['stringify'](_0x1e8471));if(_0x1e8471['error']){if(_0x1e8471['error'][_0x74eb('0xd')]===0x1f4){logger['error'](_0x74eb('0xa'),_0x3c024f,_0x1e8471[_0x74eb('0xe')][_0x74eb('0xf')]);return _0xc13fac(_0x1e8471[_0x74eb('0xe')][_0x74eb('0xf')]);}logger['error'](_0x74eb('0xa'),_0x3c024f,_0x1e8471['error'][_0x74eb('0xf')]);return _0x5f5842(_0x1e8471['error'][_0x74eb('0xf')]);}else{logger[_0x74eb('0x10')](_0x74eb('0xa'),_0x3c024f,_0x74eb('0x11'));_0x5f5842(_0x1e8471['result'][_0x74eb('0xf')]);}})[_0x74eb('0x12')](function(_0x5e3d7f){logger[_0x74eb('0xe')](_0x74eb('0xa'),_0x3c024f,_0x5e3d7f);_0xc13fac(_0x5e3d7f);});});} \ No newline at end of file +var _0xae28=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x483eb9,_0x304d99){var _0x377b32=function(_0x4dcbdb){while(--_0x4dcbdb){_0x483eb9['push'](_0x483eb9['shift']());}};_0x377b32(++_0x304d99);}(_0xae28,0xbd));var _0x8ae2=function(_0x434ddf,_0x1d40e5){_0x434ddf=_0x434ddf-0x0;var _0x38b1ac=_0xae28[_0x434ddf];return _0x38b1ac;};'use strict';var _=require(_0x8ae2('0x0'));var util=require(_0x8ae2('0x1'));var moment=require(_0x8ae2('0x2'));var BPromise=require(_0x8ae2('0x3'));var rs=require(_0x8ae2('0x4'));var fs=require('fs');var Redis=require(_0x8ae2('0x5'));var db=require(_0x8ae2('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8ae2('0x7'));var config=require(_0x8ae2('0x8'));var jayson=require(_0x8ae2('0x9'));var client=jayson[_0x8ae2('0xa')][_0x8ae2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x378fc0,_0x2e03fd,_0x52a4fb){return new BPromise(function(_0x3db8c3,_0x4ad4ec){return client['request'](_0x378fc0,_0x52a4fb)['then'](function(_0x5084da){logger[_0x8ae2('0xc')](_0x8ae2('0xd'),_0x2e03fd,_0x8ae2('0xe'));logger[_0x8ae2('0xf')](_0x8ae2('0x10'),_0x2e03fd,_0x8ae2('0xe'),JSON[_0x8ae2('0x11')](_0x5084da));if(_0x5084da[_0x8ae2('0x12')]){if(_0x5084da[_0x8ae2('0x12')][_0x8ae2('0x13')]===0x1f4){logger['error'](_0x8ae2('0xd'),_0x2e03fd,_0x5084da['error'][_0x8ae2('0x14')]);return _0x4ad4ec(_0x5084da[_0x8ae2('0x12')][_0x8ae2('0x14')]);}logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x2e03fd,_0x5084da['error'][_0x8ae2('0x14')]);return _0x3db8c3(_0x5084da[_0x8ae2('0x12')][_0x8ae2('0x14')]);}else{logger[_0x8ae2('0xc')](_0x8ae2('0xd'),_0x2e03fd,_0x8ae2('0xe'));_0x3db8c3(_0x5084da[_0x8ae2('0x15')]['message']);}})[_0x8ae2('0x16')](function(_0x567a93){logger['error'](_0x8ae2('0xd'),_0x2e03fd,_0x567a93);_0x4ad4ec(_0x567a93);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 6922e60..e06e906 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 _0xfaa4=['post','create','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','isAuthenticated','index','get'];(function(_0x16dcc2,_0x1323f2){var _0x41d2ef=function(_0x4b3085){while(--_0x4b3085){_0x16dcc2['push'](_0x16dcc2['shift']());}};_0x41d2ef(++_0x1323f2);}(_0xfaa4,0x1a8));var _0x4faa=function(_0x54e23f,_0x5a9d4e){_0x54e23f=_0x54e23f-0x0;var _0x31f5d6=_0xfaa4[_0x54e23f];return _0x31f5d6;};'use strict';var multer=require(_0x4faa('0x0'));var util=require(_0x4faa('0x1'));var path=require(_0x4faa('0x2'));var timeout=require(_0x4faa('0x3'));var express=require(_0x4faa('0x4'));var router=express[_0x4faa('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4faa('0x6'));var interaction=require(_0x4faa('0x7'));var config=require(_0x4faa('0x8'));var controller=require(_0x4faa('0x9'));router['get']('/',auth[_0x4faa('0xa')](),controller[_0x4faa('0xb')]);router[_0x4faa('0xc')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x4faa('0xd')]('/',auth[_0x4faa('0xa')](),controller[_0x4faa('0xe')]);router['put'](_0x4faa('0xf'),auth[_0x4faa('0xa')](),controller[_0x4faa('0x10')]);router[_0x4faa('0x11')](_0x4faa('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x4faa('0x12')]=router; \ No newline at end of file +var _0xc17f=['put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','isAuthenticated','index','get','/:id','show','post'];(function(_0x53dd98,_0x3c2ee3){var _0x406877=function(_0x33e01e){while(--_0x33e01e){_0x53dd98['push'](_0x53dd98['shift']());}};_0x406877(++_0x3c2ee3);}(_0xc17f,0xb8));var _0xfc17=function(_0x5b2c7e,_0x3d22f0){_0x5b2c7e=_0x5b2c7e-0x0;var _0x5ec399=_0xc17f[_0x5b2c7e];return _0x5ec399;};'use strict';var multer=require(_0xfc17('0x0'));var util=require(_0xfc17('0x1'));var path=require(_0xfc17('0x2'));var timeout=require(_0xfc17('0x3'));var express=require(_0xfc17('0x4'));var router=express[_0xfc17('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xfc17('0x6'));var interaction=require(_0xfc17('0x7'));var config=require(_0xfc17('0x8'));var controller=require(_0xfc17('0x9'));router['get']('/',auth[_0xfc17('0xa')](),controller[_0xfc17('0xb')]);router[_0xfc17('0xc')](_0xfc17('0xd'),auth[_0xfc17('0xa')](),controller[_0xfc17('0xe')]);router[_0xfc17('0xf')]('/',auth[_0xfc17('0xa')](),controller['create']);router[_0xfc17('0x10')](_0xfc17('0xd'),auth[_0xfc17('0xa')](),controller[_0xfc17('0x11')]);router['delete']('/:id',auth[_0xfc17('0xa')](),controller[_0xfc17('0x12')]);module[_0xfc17('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 516ed66..f62d2a9 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 _0x85db=['string','STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable','keyValue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x85db,0xe4));var _0xb85d=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0x85db[_0x3e44fa];return _0x2a0aba;};'use strict';var Sequelize=require(_0xb85d('0x0'));module[_0xb85d('0x1')]={'type':{'type':Sequelize[_0xb85d('0x2')]('string',_0xb85d('0x3'),_0xb85d('0x4'),_0xb85d('0x5'),'picklist'),'defaultValue':_0xb85d('0x6')},'content':{'type':Sequelize[_0xb85d('0x7')]},'key':{'type':Sequelize[_0xb85d('0x7')]},'keyType':{'type':Sequelize[_0xb85d('0x2')](_0xb85d('0x6'),_0xb85d('0x3'),_0xb85d('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xb85d('0x7')]},'nameField':{'type':Sequelize[_0xb85d('0x7')]},'customField':{'type':Sequelize[_0xb85d('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb85d('0x7')]}}; \ No newline at end of file +var _0x56a1=['keyValue','picklist','string','STRING','BOOLEAN','exports','ENUM','variable','customVariable'];(function(_0x166d93,_0x301f09){var _0xba708=function(_0x349bf7){while(--_0x349bf7){_0x166d93['push'](_0x166d93['shift']());}};_0xba708(++_0x301f09);}(_0x56a1,0xcb));var _0x156a=function(_0x5cd675,_0x352cca){_0x5cd675=_0x5cd675-0x0;var _0x2379b0=_0x56a1[_0x5cd675];return _0x2379b0;};'use strict';var Sequelize=require('sequelize');module[_0x156a('0x0')]={'type':{'type':Sequelize[_0x156a('0x1')]('string',_0x156a('0x2'),_0x156a('0x3'),_0x156a('0x4'),_0x156a('0x5')),'defaultValue':_0x156a('0x6')},'content':{'type':Sequelize[_0x156a('0x7')]},'key':{'type':Sequelize[_0x156a('0x7')]},'keyType':{'type':Sequelize[_0x156a('0x1')](_0x156a('0x6'),_0x156a('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x156a('0x7')]},'idField':{'type':Sequelize[_0x156a('0x7')]},'nameField':{'type':Sequelize[_0x156a('0x7')]},'customField':{'type':Sequelize[_0x156a('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x156a('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index e1a04a5..9ea9ccc 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 _0xa875=['count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','catch','show','params','keys','FreshsalesField','includeAll','create','find','body','eml-format','zip-dir','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit'];(function(_0x5b4a98,_0x376257){var _0x222b95=function(_0x2013e6){while(--_0x2013e6){_0x5b4a98['push'](_0x5b4a98['shift']());}};_0x222b95(++_0x376257);}(_0xa875,0x154));var _0x5a87=function(_0x18f152,_0x41585a){_0x18f152=_0x18f152-0x0;var _0xa10b34=_0xa875[_0x18f152];return _0xa10b34;};'use strict';var emlformat=require(_0x5a87('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5a87('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5a87('0x2'));var BPromise=require(_0x5a87('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x5a87('0x4'));var csv=require(_0x5a87('0x5'));var ejs=require(_0x5a87('0x6'));var fs=require('fs');var fs_extra=require(_0x5a87('0x7'));var _=require(_0x5a87('0x8'));var squel=require(_0x5a87('0x9'));var crypto=require(_0x5a87('0xa'));var jsforce=require(_0x5a87('0xb'));var deskjs=require(_0x5a87('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5a87('0xd'));var Redis=require(_0x5a87('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x5a87('0xf'));var as=require(_0x5a87('0x10'));var hardwareService=require(_0x5a87('0x11'));var logger=require(_0x5a87('0x12'))(_0x5a87('0x13'));var utils=require(_0x5a87('0x14'));var config=require(_0x5a87('0x15'));var licenseUtil=require(_0x5a87('0x16'));var db=require(_0x5a87('0x17'))['db'];function respondWithStatusCode(_0x26adaf,_0x3fe735){_0x3fe735=_0x3fe735||0xcc;return function(_0x14aca9){if(_0x14aca9){return _0x26adaf[_0x5a87('0x18')](_0x3fe735);}return _0x26adaf['status'](_0x3fe735)[_0x5a87('0x19')]();};}function respondWithResult(_0x5265dc,_0x30eb8f){_0x30eb8f=_0x30eb8f||0xc8;return function(_0x2100d2){if(_0x2100d2){return _0x5265dc[_0x5a87('0x1a')](_0x30eb8f)[_0x5a87('0x1b')](_0x2100d2);}};}function respondWithFilteredResult(_0x3fba5a,_0x2dcd46){return function(_0x20ad62){if(_0x20ad62){var _0x31fade=typeof _0x2dcd46['offset']===_0x5a87('0x1c')&&typeof _0x2dcd46[_0x5a87('0x1d')]==='undefined';var _0x5a874d=_0x20ad62[_0x5a87('0x1e')];var _0x13a1fc=_0x31fade?0x0:_0x2dcd46[_0x5a87('0x1f')];var _0x3dfebc=_0x31fade?_0x20ad62['count']:_0x2dcd46[_0x5a87('0x1f')]+_0x2dcd46['limit'];var _0x1ab5e9;if(_0x3dfebc>=_0x5a874d){_0x3dfebc=_0x5a874d;_0x1ab5e9=0xc8;}else{_0x1ab5e9=0xce;}_0x3fba5a[_0x5a87('0x1a')](_0x1ab5e9);return _0x3fba5a[_0x5a87('0x20')](_0x5a87('0x21'),_0x13a1fc+'-'+_0x3dfebc+'/'+_0x5a874d)[_0x5a87('0x1b')](_0x20ad62);}return null;};}function patchUpdates(_0x52669f){return function(_0x3f61a2){try{jsonpatch[_0x5a87('0x22')](_0x3f61a2,_0x52669f,!![]);}catch(_0x130fdf){return BPromise[_0x5a87('0x23')](_0x130fdf);}return _0x3f61a2[_0x5a87('0x24')]();};}function saveUpdates(_0x2ea521,_0x21b2ae){return function(_0x2ce788){if(_0x2ce788){return _0x2ce788[_0x5a87('0x25')](_0x2ea521)[_0x5a87('0x26')](function(_0x25d3b3){return _0x25d3b3;});}return null;};}function removeEntity(_0x597cf4,_0x1a1d90){return function(_0x259212){if(_0x259212){return _0x259212[_0x5a87('0x27')]()['then'](function(){_0x597cf4[_0x5a87('0x1a')](0xcc)[_0x5a87('0x19')]();});}};}function handleEntityNotFound(_0x34a1ad,_0x4a6c70){return function(_0xba986){if(!_0xba986){_0x34a1ad[_0x5a87('0x18')](0x194);}return _0xba986;};}function handleError(_0x33112a,_0x1c2a80){_0x1c2a80=_0x1c2a80||0x1f4;return function(_0x442008){logger[_0x5a87('0x28')](_0x442008[_0x5a87('0x29')]);if(_0x442008[_0x5a87('0x2a')]){delete _0x442008[_0x5a87('0x2a')];}_0x33112a[_0x5a87('0x1a')](_0x1c2a80)['send'](_0x442008);};}exports['index']=function(_0x40bcfa,_0x2546a5){var _0x2aa51e={},_0x2eca15={},_0x571127={'count':0x0,'rows':[]};var _0x32d70a=_[_0x5a87('0x2b')](db['FreshsalesField'][_0x5a87('0x2c')],function(_0x31744b){return{'name':_0x31744b[_0x5a87('0x2d')],'type':_0x31744b['type'][_0x5a87('0x2e')]};});_0x2eca15[_0x5a87('0x2f')]=_[_0x5a87('0x2b')](_0x32d70a,'name');_0x2eca15[_0x5a87('0x30')]=_['keys'](_0x40bcfa[_0x5a87('0x30')]);_0x2eca15[_0x5a87('0x31')]=_[_0x5a87('0x32')](_0x2eca15[_0x5a87('0x2f')],_0x2eca15[_0x5a87('0x30')]);_0x2aa51e[_0x5a87('0x33')]=_[_0x5a87('0x32')](_0x2eca15[_0x5a87('0x2f')],qs[_0x5a87('0x34')](_0x40bcfa[_0x5a87('0x30')][_0x5a87('0x34')]));_0x2aa51e['attributes']=_0x2aa51e['attributes']['length']?_0x2aa51e['attributes']:_0x2eca15[_0x5a87('0x2f')];if(!_0x40bcfa[_0x5a87('0x30')]['hasOwnProperty'](_0x5a87('0x35'))){_0x2aa51e['limit']=qs[_0x5a87('0x1d')](_0x40bcfa[_0x5a87('0x30')][_0x5a87('0x1d')]);_0x2aa51e[_0x5a87('0x1f')]=qs[_0x5a87('0x1f')](_0x40bcfa[_0x5a87('0x30')]['offset']);}_0x2aa51e[_0x5a87('0x36')]=qs[_0x5a87('0x37')](_0x40bcfa[_0x5a87('0x30')][_0x5a87('0x37')]);_0x2aa51e[_0x5a87('0x38')]=qs[_0x5a87('0x31')](_[_0x5a87('0x39')](_0x40bcfa[_0x5a87('0x30')],_0x2eca15[_0x5a87('0x31')]),_0x32d70a);if(_0x40bcfa[_0x5a87('0x30')][_0x5a87('0x3a')]){_0x2aa51e[_0x5a87('0x38')]=_[_0x5a87('0x3b')](_0x2aa51e[_0x5a87('0x38')],{'$or':_['map'](_0x32d70a,function(_0x21af06){if(_0x21af06[_0x5a87('0x3c')]!==_0x5a87('0x3d')){var _0x4aae7c={};_0x4aae7c[_0x21af06['name']]={'$like':'%'+_0x40bcfa[_0x5a87('0x30')][_0x5a87('0x3a')]+'%'};return _0x4aae7c;}})});}_0x2aa51e=_[_0x5a87('0x3b')]({},_0x2aa51e,_0x40bcfa[_0x5a87('0x3e')]);var _0x344086={'where':_0x2aa51e[_0x5a87('0x38')]};return db['FreshsalesField'][_0x5a87('0x1e')](_0x344086)[_0x5a87('0x26')](function(_0x211e01){_0x571127[_0x5a87('0x1e')]=_0x211e01;if(_0x40bcfa['query']['includeAll']){_0x2aa51e[_0x5a87('0x3f')]=[{'all':!![]}];}return db['FreshsalesField'][_0x5a87('0x40')](_0x2aa51e);})[_0x5a87('0x26')](function(_0x4fe8b1){_0x571127['rows']=_0x4fe8b1;return _0x571127;})[_0x5a87('0x26')](respondWithFilteredResult(_0x2546a5,_0x2aa51e))[_0x5a87('0x41')](handleError(_0x2546a5,null));};exports[_0x5a87('0x42')]=function(_0x29c13e,_0x2ec049){var _0x225a6e={'raw':!![],'where':{'id':_0x29c13e[_0x5a87('0x43')]['id']}},_0x2224ac={};_0x2224ac[_0x5a87('0x2f')]=_[_0x5a87('0x44')](db[_0x5a87('0x45')][_0x5a87('0x2c')]);_0x2224ac[_0x5a87('0x30')]=_['keys'](_0x29c13e[_0x5a87('0x30')]);_0x2224ac[_0x5a87('0x31')]=_[_0x5a87('0x32')](_0x2224ac[_0x5a87('0x2f')],_0x2224ac[_0x5a87('0x30')]);_0x225a6e[_0x5a87('0x33')]=_[_0x5a87('0x32')](_0x2224ac[_0x5a87('0x2f')],qs[_0x5a87('0x34')](_0x29c13e[_0x5a87('0x30')][_0x5a87('0x34')]));_0x225a6e[_0x5a87('0x33')]=_0x225a6e[_0x5a87('0x33')]['length']?_0x225a6e['attributes']:_0x2224ac[_0x5a87('0x2f')];if(_0x29c13e[_0x5a87('0x30')][_0x5a87('0x46')]){_0x225a6e[_0x5a87('0x3f')]=[{'all':!![]}];}_0x225a6e=_[_0x5a87('0x3b')]({},_0x225a6e,_0x29c13e[_0x5a87('0x3e')]);return db[_0x5a87('0x45')]['find'](_0x225a6e)[_0x5a87('0x26')](handleEntityNotFound(_0x2ec049,null))[_0x5a87('0x26')](respondWithResult(_0x2ec049,null))[_0x5a87('0x41')](handleError(_0x2ec049,null));};exports[_0x5a87('0x47')]=function(_0x1cebdc,_0x1ded6d){return db[_0x5a87('0x45')]['create'](_0x1cebdc['body'],{})[_0x5a87('0x26')](respondWithResult(_0x1ded6d,0xc9))[_0x5a87('0x41')](handleError(_0x1ded6d,null));};exports[_0x5a87('0x25')]=function(_0x1a194d,_0x4d487d){if(_0x1a194d['body']['id']){delete _0x1a194d['body']['id'];}return db['FreshsalesField'][_0x5a87('0x48')]({'where':{'id':_0x1a194d[_0x5a87('0x43')]['id']}})[_0x5a87('0x26')](handleEntityNotFound(_0x4d487d,null))[_0x5a87('0x26')](saveUpdates(_0x1a194d[_0x5a87('0x49')],null))[_0x5a87('0x26')](respondWithResult(_0x4d487d,null))[_0x5a87('0x41')](handleError(_0x4d487d,null));};exports[_0x5a87('0x27')]=function(_0x501953,_0x2f692a){return db['FreshsalesField'][_0x5a87('0x48')]({'where':{'id':_0x501953['params']['id']}})[_0x5a87('0x26')](handleEntityNotFound(_0x2f692a,null))[_0x5a87('0x26')](removeEntity(_0x2f692a,null))[_0x5a87('0x41')](handleError(_0x2f692a,null));}; \ No newline at end of file +var _0x36f9=['squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','apply','update','then','destroy','name','send','index','map','fieldName','key','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','FreshsalesField','findAll','rows','catch','show','params','rawAttributes','include','create','body','find','eml-format','rimraf','zip-dir','moment','util','path','to-csv','ejs','fs-extra'];(function(_0x321562,_0x2a8afd){var _0x321535=function(_0x4bbe75){while(--_0x4bbe75){_0x321562['push'](_0x321562['shift']());}};_0x321535(++_0x2a8afd);}(_0x36f9,0x83));var _0x936f=function(_0x434a4d,_0x2903f2){_0x434a4d=_0x434a4d-0x0;var _0x3de6e8=_0x36f9[_0x434a4d];return _0x3de6e8;};'use strict';var emlformat=require(_0x936f('0x0'));var rimraf=require(_0x936f('0x1'));var zipdir=require(_0x936f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x936f('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x936f('0x4'));var path=require(_0x936f('0x5'));var sox=require('sox');var csv=require(_0x936f('0x6'));var ejs=require(_0x936f('0x7'));var fs=require('fs');var fs_extra=require(_0x936f('0x8'));var _=require('lodash');var squel=require(_0x936f('0x9'));var crypto=require('crypto');var jsforce=require(_0x936f('0xa'));var deskjs=require(_0x936f('0xb'));var toCsv=require('to-csv');var querystring=require(_0x936f('0xc'));var Papa=require('papaparse');var Redis=require(_0x936f('0xd'));var authService=require(_0x936f('0xe'));var qs=require(_0x936f('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x936f('0x10'))(_0x936f('0x11'));var utils=require(_0x936f('0x12'));var config=require(_0x936f('0x13'));var licenseUtil=require(_0x936f('0x14'));var db=require(_0x936f('0x15'))['db'];function respondWithStatusCode(_0x18b100,_0x571c0d){_0x571c0d=_0x571c0d||0xcc;return function(_0x4d803a){if(_0x4d803a){return _0x18b100[_0x936f('0x16')](_0x571c0d);}return _0x18b100['status'](_0x571c0d)[_0x936f('0x17')]();};}function respondWithResult(_0x38f9b0,_0xc3aa39){_0xc3aa39=_0xc3aa39||0xc8;return function(_0x387ba2){if(_0x387ba2){return _0x38f9b0[_0x936f('0x18')](_0xc3aa39)[_0x936f('0x19')](_0x387ba2);}};}function respondWithFilteredResult(_0x209477,_0x2e6678){return function(_0x40e3dc){if(_0x40e3dc){var _0x2d173f=typeof _0x2e6678[_0x936f('0x1a')]===_0x936f('0x1b')&&typeof _0x2e6678[_0x936f('0x1c')]===_0x936f('0x1b');var _0x56a9b2=_0x40e3dc[_0x936f('0x1d')];var _0x15e388=_0x2d173f?0x0:_0x2e6678[_0x936f('0x1a')];var _0x12cabf=_0x2d173f?_0x40e3dc['count']:_0x2e6678[_0x936f('0x1a')]+_0x2e6678['limit'];var _0x169f72;if(_0x12cabf>=_0x56a9b2){_0x12cabf=_0x56a9b2;_0x169f72=0xc8;}else{_0x169f72=0xce;}_0x209477['status'](_0x169f72);return _0x209477['set']('Content-Range',_0x15e388+'-'+_0x12cabf+'/'+_0x56a9b2)[_0x936f('0x19')](_0x40e3dc);}return null;};}function patchUpdates(_0x3c343d){return function(_0x4cbaaf){try{jsonpatch[_0x936f('0x1e')](_0x4cbaaf,_0x3c343d,!![]);}catch(_0x1b33dd){return BPromise['reject'](_0x1b33dd);}return _0x4cbaaf['save']();};}function saveUpdates(_0x33338e,_0x204d10){return function(_0x53d942){if(_0x53d942){return _0x53d942[_0x936f('0x1f')](_0x33338e)[_0x936f('0x20')](function(_0x25455d){return _0x25455d;});}return null;};}function removeEntity(_0xe9388a,_0x524a16){return function(_0x27eca8){if(_0x27eca8){return _0x27eca8[_0x936f('0x21')]()['then'](function(){_0xe9388a['status'](0xcc)[_0x936f('0x17')]();});}};}function handleEntityNotFound(_0x2fb141,_0x2a93d6){return function(_0x252868){if(!_0x252868){_0x2fb141[_0x936f('0x16')](0x194);}return _0x252868;};}function handleError(_0x5ae0b3,_0x17ad2d){_0x17ad2d=_0x17ad2d||0x1f4;return function(_0xbbc834){logger['error'](_0xbbc834['stack']);if(_0xbbc834[_0x936f('0x22')]){delete _0xbbc834[_0x936f('0x22')];}_0x5ae0b3['status'](_0x17ad2d)[_0x936f('0x23')](_0xbbc834);};}exports[_0x936f('0x24')]=function(_0x21491a,_0x33ca87){var _0x1a9561={},_0x18fc75={},_0x49f6b3={'count':0x0,'rows':[]};var _0x2a4310=_[_0x936f('0x25')](db['FreshsalesField']['rawAttributes'],function(_0x497d13){return{'name':_0x497d13[_0x936f('0x26')],'type':_0x497d13['type'][_0x936f('0x27')]};});_0x18fc75['model']=_['map'](_0x2a4310,_0x936f('0x22'));_0x18fc75['query']=_[_0x936f('0x28')](_0x21491a[_0x936f('0x29')]);_0x18fc75[_0x936f('0x2a')]=_['intersection'](_0x18fc75[_0x936f('0x2b')],_0x18fc75[_0x936f('0x29')]);_0x1a9561[_0x936f('0x2c')]=_[_0x936f('0x2d')](_0x18fc75[_0x936f('0x2b')],qs[_0x936f('0x2e')](_0x21491a['query'][_0x936f('0x2e')]));_0x1a9561[_0x936f('0x2c')]=_0x1a9561['attributes'][_0x936f('0x2f')]?_0x1a9561[_0x936f('0x2c')]:_0x18fc75['model'];if(!_0x21491a[_0x936f('0x29')][_0x936f('0x30')](_0x936f('0x31'))){_0x1a9561['limit']=qs[_0x936f('0x1c')](_0x21491a[_0x936f('0x29')]['limit']);_0x1a9561['offset']=qs[_0x936f('0x1a')](_0x21491a[_0x936f('0x29')]['offset']);}_0x1a9561[_0x936f('0x32')]=qs[_0x936f('0x33')](_0x21491a[_0x936f('0x29')][_0x936f('0x33')]);_0x1a9561[_0x936f('0x34')]=qs['filters'](_[_0x936f('0x35')](_0x21491a[_0x936f('0x29')],_0x18fc75[_0x936f('0x2a')]),_0x2a4310);if(_0x21491a[_0x936f('0x29')]['filter']){_0x1a9561[_0x936f('0x34')]=_[_0x936f('0x36')](_0x1a9561['where'],{'$or':_[_0x936f('0x25')](_0x2a4310,function(_0x5c14ec){if(_0x5c14ec[_0x936f('0x37')]!==_0x936f('0x38')){var _0x3c25f4={};_0x3c25f4[_0x5c14ec[_0x936f('0x22')]]={'$like':'%'+_0x21491a[_0x936f('0x29')][_0x936f('0x39')]+'%'};return _0x3c25f4;}})});}_0x1a9561=_[_0x936f('0x36')]({},_0x1a9561,_0x21491a[_0x936f('0x3a')]);var _0x40f732={'where':_0x1a9561[_0x936f('0x34')]};return db['FreshsalesField']['count'](_0x40f732)[_0x936f('0x20')](function(_0x427505){_0x49f6b3[_0x936f('0x1d')]=_0x427505;if(_0x21491a['query']['includeAll']){_0x1a9561['include']=[{'all':!![]}];}return db[_0x936f('0x3b')][_0x936f('0x3c')](_0x1a9561);})[_0x936f('0x20')](function(_0x1ec564){_0x49f6b3[_0x936f('0x3d')]=_0x1ec564;return _0x49f6b3;})[_0x936f('0x20')](respondWithFilteredResult(_0x33ca87,_0x1a9561))[_0x936f('0x3e')](handleError(_0x33ca87,null));};exports[_0x936f('0x3f')]=function(_0x2db8c3,_0x146ab3){var _0x28c5a5={'raw':!![],'where':{'id':_0x2db8c3[_0x936f('0x40')]['id']}},_0x5e5f78={};_0x5e5f78[_0x936f('0x2b')]=_['keys'](db[_0x936f('0x3b')][_0x936f('0x41')]);_0x5e5f78[_0x936f('0x29')]=_['keys'](_0x2db8c3[_0x936f('0x29')]);_0x5e5f78[_0x936f('0x2a')]=_[_0x936f('0x2d')](_0x5e5f78['model'],_0x5e5f78[_0x936f('0x29')]);_0x28c5a5['attributes']=_[_0x936f('0x2d')](_0x5e5f78[_0x936f('0x2b')],qs[_0x936f('0x2e')](_0x2db8c3[_0x936f('0x29')][_0x936f('0x2e')]));_0x28c5a5[_0x936f('0x2c')]=_0x28c5a5[_0x936f('0x2c')][_0x936f('0x2f')]?_0x28c5a5[_0x936f('0x2c')]:_0x5e5f78['model'];if(_0x2db8c3[_0x936f('0x29')]['includeAll']){_0x28c5a5[_0x936f('0x42')]=[{'all':!![]}];}_0x28c5a5=_[_0x936f('0x36')]({},_0x28c5a5,_0x2db8c3['options']);return db['FreshsalesField']['find'](_0x28c5a5)['then'](handleEntityNotFound(_0x146ab3,null))[_0x936f('0x20')](respondWithResult(_0x146ab3,null))[_0x936f('0x3e')](handleError(_0x146ab3,null));};exports[_0x936f('0x43')]=function(_0x450105,_0x21b47c){return db[_0x936f('0x3b')][_0x936f('0x43')](_0x450105[_0x936f('0x44')],{})['then'](respondWithResult(_0x21b47c,0xc9))[_0x936f('0x3e')](handleError(_0x21b47c,null));};exports[_0x936f('0x1f')]=function(_0x30d2d5,_0x2616f7){if(_0x30d2d5[_0x936f('0x44')]['id']){delete _0x30d2d5[_0x936f('0x44')]['id'];}return db[_0x936f('0x3b')][_0x936f('0x45')]({'where':{'id':_0x30d2d5['params']['id']}})[_0x936f('0x20')](handleEntityNotFound(_0x2616f7,null))[_0x936f('0x20')](saveUpdates(_0x30d2d5[_0x936f('0x44')],null))[_0x936f('0x20')](respondWithResult(_0x2616f7,null))[_0x936f('0x3e')](handleError(_0x2616f7,null));};exports[_0x936f('0x21')]=function(_0xebed9a,_0x13280d){return db[_0x936f('0x3b')][_0x936f('0x45')]({'where':{'id':_0xebed9a['params']['id']}})[_0x936f('0x20')](handleEntityNotFound(_0x13280d,null))[_0x936f('0x20')](removeEntity(_0x13280d,null))[_0x936f('0x3e')](handleError(_0x13280d,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 90f39be..d079f4a 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 _0xfb11=['bluebird','path','../../config/environment','./intFreshsalesField.attributes','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','../../config/logger','api'];(function(_0x76453b,_0x5debe0){var _0x4c3dc3=function(_0x4a18d4){while(--_0x4a18d4){_0x76453b['push'](_0x76453b['shift']());}};_0x4c3dc3(++_0x5debe0);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xfb11[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0x1fb1('0x0'));var util=require('util');var logger=require(_0x1fb1('0x1'))(_0x1fb1('0x2'));var moment=require('moment');var BPromise=require(_0x1fb1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1fb1('0x4'));var rimraf=require('rimraf');var config=require(_0x1fb1('0x5'));var attributes=require(_0x1fb1('0x6'));module['exports']=function(_0x25d44f,_0x133727){return _0x25d44f['define'](_0x1fb1('0x7'),attributes,{'tableName':_0x1fb1('0x8'),'paranoid':![],'indexes':[{'name':_0x1fb1('0x9'),'fields':[_0x1fb1('0xa'),_0x1fb1('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1219=['define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intFreshsalesField.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1219,0x17c));var _0x9121=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1219[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9121('0x0'));var util=require(_0x9121('0x1'));var logger=require(_0x9121('0x2'))(_0x9121('0x3'));var moment=require(_0x9121('0x4'));var BPromise=require('bluebird');var rp=require(_0x9121('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9121('0x6'));var config=require(_0x9121('0x7'));var attributes=require(_0x9121('0x8'));module[_0x9121('0x9')]=function(_0x420b62,_0x430583){return _0x420b62[_0x9121('0xa')](_0x9121('0xb'),attributes,{'tableName':_0x9121('0xc'),'paranoid':![],'indexes':[{'name':_0x9121('0xd'),'fields':[_0x9121('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index b1002d4..07bdb4a 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 _0xc1c6=['lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch'];(function(_0x396e82,_0x2c4c1a){var _0x2d927b=function(_0xd7ddb7){while(--_0xd7ddb7){_0x396e82['push'](_0x396e82['shift']());}};_0x2d927b(++_0x2c4c1a);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x36ae3a,_0x39d3e5){_0x36ae3a=_0x36ae3a-0x0;var _0x11cd9a=_0xc1c6[_0x36ae3a];return _0x11cd9a;};'use strict';var _=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var moment=require(_0x6c1c('0x2'));var BPromise=require('bluebird');var rs=require(_0x6c1c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6c1c('0x4'))['db'];var utils=require(_0x6c1c('0x5'));var logger=require(_0x6c1c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6c1c('0x7'));var client=jayson['client'][_0x6c1c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x582bec,_0xe510ca,_0x2eb1ba){return new BPromise(function(_0x38369d,_0x2cec58){return client['request'](_0x582bec,_0x2eb1ba)[_0x6c1c('0x9')](function(_0x3ca985){logger['info'](_0x6c1c('0xa'),_0xe510ca,_0x6c1c('0xb'));logger[_0x6c1c('0xc')](_0x6c1c('0xd'),_0xe510ca,'request\x20sent',JSON[_0x6c1c('0xe')](_0x3ca985));if(_0x3ca985[_0x6c1c('0xf')]){if(_0x3ca985[_0x6c1c('0xf')]['code']===0x1f4){logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x3ca985[_0x6c1c('0xf')]['message']);return _0x2cec58(_0x3ca985[_0x6c1c('0xf')]['message']);}logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x3ca985[_0x6c1c('0xf')][_0x6c1c('0x10')]);return _0x38369d(_0x3ca985[_0x6c1c('0xf')][_0x6c1c('0x10')]);}else{logger[_0x6c1c('0x11')](_0x6c1c('0xa'),_0xe510ca,_0x6c1c('0xb'));_0x38369d(_0x3ca985['result'][_0x6c1c('0x10')]);}})[_0x6c1c('0x12')](function(_0x5214ee){logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x5214ee);_0x2cec58(_0x5214ee);});});} \ No newline at end of file +var _0x524e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','moment','bluebird'];(function(_0x47f7ec,_0x369f9d){var _0x415101=function(_0x41317a){while(--_0x41317a){_0x47f7ec['push'](_0x47f7ec['shift']());}};_0x415101(++_0x369f9d);}(_0x524e,0x15e));var _0xe524=function(_0x3cd89f,_0x3b2a72){_0x3cd89f=_0x3cd89f-0x0;var _0x5c3fc1=_0x524e[_0x3cd89f];return _0x5c3fc1;};'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')]('FreshsalesField,\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')]('FreshsalesField,\x20%s,\x20%s',_0x347bed,_0xe524('0xf'));_0x384935(_0x991924['result'][_0xe524('0x15')]);}})['catch'](function(_0x29a031){logger['error']('FreshsalesField,\x20%s,\x20%s',_0x347bed,_0x29a031);_0x3e4cda(_0x29a031);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index d9faa30..0787f67 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x5dc0aa,_0xad3f41){var _0x4bbd2a=function(_0x51b2b4){while(--_0x51b2b4){_0x5dc0aa['push'](_0x5dc0aa['shift']());}};_0x4bbd2a(++_0xad3f41);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x327895,_0x2be52b){var _0x196cd0=function(_0x422e97){while(--_0x422e97){_0x327895['push'](_0x327895['shift']());}};_0x196cd0(++_0x2be52b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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 a714efa..cdd2f6f 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 _0x65cb=['STRING','ENUM','integrationTab','newTab','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x65cb,0xa4));var _0xb65c=function(_0x1fafd5,_0x3a03a5){_0x1fafd5=_0x1fafd5-0x0;var _0x2ce5a6=_0x65cb[_0x1fafd5];return _0x2ce5a6;};'use strict';var Sequelize=require(_0xb65c('0x0'));module['exports']={'name':{'type':Sequelize[_0xb65c('0x1')]},'description':{'type':Sequelize[_0xb65c('0x1')]},'username':{'type':Sequelize[_0xb65c('0x1')],'unique':'username'},'remoteUri':{'type':Sequelize[_0xb65c('0x1')]},'password':{'type':Sequelize[_0xb65c('0x1')]},'clientId':{'type':Sequelize[_0xb65c('0x1')]},'clientSecret':{'type':Sequelize[_0xb65c('0x1')]},'securityToken':{'type':Sequelize[_0xb65c('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb65c('0x2')](_0xb65c('0x3'),_0xb65c('0x4')),'defaultValue':_0xb65c('0x3')}}; \ No newline at end of file +var _0xf65d=['STRING','username','integrationTab','newTab','sequelize'];(function(_0x660237,_0x465a6f){var _0x218abd=function(_0x5b70af){while(--_0x5b70af){_0x660237['push'](_0x660237['shift']());}};_0x218abd(++_0x465a6f);}(_0xf65d,0x9f));var _0xdf65=function(_0x322522,_0x4db288){_0x322522=_0x322522-0x0;var _0x293bcf=_0xf65d[_0x322522];return _0x293bcf;};'use strict';var Sequelize=require(_0xdf65('0x0'));module['exports']={'name':{'type':Sequelize[_0xdf65('0x1')]},'description':{'type':Sequelize[_0xdf65('0x1')]},'username':{'type':Sequelize[_0xdf65('0x1')],'unique':_0xdf65('0x2')},'remoteUri':{'type':Sequelize[_0xdf65('0x1')]},'password':{'type':Sequelize[_0xdf65('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xdf65('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xdf65('0x3'),_0xdf65('0x4')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index edc71ad..1d576d8 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 _0xa3dc=['findOne','SalesforceConfiguration','rawAttributes','pick','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','Task','remoteUri','clientId','username','password','securityToken','Connection','clientSecret','login','isNil','sobject','OwnerId','ActivityDate','IsReminderSet','Subject','Description','string','int','boolean','phone','remove','includes','label','custom','picklistValues','value','True','False','false','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','end','status','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','map','SalesforceAccount','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','getConfigurations'];(function(_0x30bfba,_0xd6037c){var _0x259e95=function(_0x414a24){while(--_0x414a24){_0x30bfba['push'](_0x30bfba['shift']());}};_0x259e95(++_0xd6037c);}(_0xa3dc,0x192));var _0xca3d=function(_0x5a0f3e,_0x187a6e){_0x5a0f3e=_0x5a0f3e-0x0;var _0x52fffe=_0xa3dc[_0x5a0f3e];return _0x52fffe;};'use strict';var emlformat=require(_0xca3d('0x0'));var rimraf=require(_0xca3d('0x1'));var zipdir=require(_0xca3d('0x2'));var jsonpatch=require(_0xca3d('0x3'));var rp=require(_0xca3d('0x4'));var moment=require(_0xca3d('0x5'));var BPromise=require(_0xca3d('0x6'));var Mustache=require('mustache');var util=require(_0xca3d('0x7'));var path=require('path');var sox=require(_0xca3d('0x8'));var csv=require(_0xca3d('0x9'));var ejs=require(_0xca3d('0xa'));var fs=require('fs');var fs_extra=require(_0xca3d('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xca3d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xca3d('0xd'));var toCsv=require(_0xca3d('0x9'));var querystring=require(_0xca3d('0xe'));var Papa=require('papaparse');var Redis=require(_0xca3d('0xf'));var authService=require(_0xca3d('0x10'));var qs=require(_0xca3d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xca3d('0x12'));var logger=require(_0xca3d('0x13'))('api');var utils=require(_0xca3d('0x14'));var config=require(_0xca3d('0x15'));var licenseUtil=require(_0xca3d('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0xca3d('0x17'));function respondWithStatusCode(_0x3e3162,_0x503c03){_0x503c03=_0x503c03||0xcc;return function(_0x38745c){if(_0x38745c){return _0x3e3162['sendStatus'](_0x503c03);}return _0x3e3162['status'](_0x503c03)[_0xca3d('0x18')]();};}function respondWithResult(_0x30129f,_0x53ff4d){_0x53ff4d=_0x53ff4d||0xc8;return function(_0x19ea40){if(_0x19ea40){return _0x30129f[_0xca3d('0x19')](_0x53ff4d)[_0xca3d('0x1a')](_0x19ea40);}};}function respondWithFilteredResult(_0x4d13d3,_0x53b4f2){return function(_0x5d08aa){if(_0x5d08aa){var _0x3913ab=typeof _0x53b4f2['offset']===_0xca3d('0x1b')&&typeof _0x53b4f2['limit']===_0xca3d('0x1b');var _0x1a18a2=_0x5d08aa['count'];var _0x3cac2b=_0x3913ab?0x0:_0x53b4f2[_0xca3d('0x1c')];var _0x1274e5=_0x3913ab?_0x5d08aa[_0xca3d('0x1d')]:_0x53b4f2[_0xca3d('0x1c')]+_0x53b4f2[_0xca3d('0x1e')];var _0xadd7f5;if(_0x1274e5>=_0x1a18a2){_0x1274e5=_0x1a18a2;_0xadd7f5=0xc8;}else{_0xadd7f5=0xce;}_0x4d13d3['status'](_0xadd7f5);return _0x4d13d3[_0xca3d('0x1f')](_0xca3d('0x20'),_0x3cac2b+'-'+_0x1274e5+'/'+_0x1a18a2)['json'](_0x5d08aa);}return null;};}function patchUpdates(_0x4ad744){return function(_0x3a3658){try{jsonpatch[_0xca3d('0x21')](_0x3a3658,_0x4ad744,!![]);}catch(_0xeb14d6){return BPromise[_0xca3d('0x22')](_0xeb14d6);}return _0x3a3658[_0xca3d('0x23')]();};}function saveUpdates(_0x40e43a,_0x39d1ba){return function(_0x3919e4){if(_0x3919e4){return _0x3919e4['update'](_0x40e43a)[_0xca3d('0x24')](function(_0x25dec4){return _0x25dec4;});}return null;};}function removeEntity(_0x1534c9,_0x55e161){return function(_0x35925e){if(_0x35925e){return _0x35925e[_0xca3d('0x25')]()[_0xca3d('0x24')](function(){_0x1534c9[_0xca3d('0x19')](0xcc)[_0xca3d('0x18')]();});}};}function handleEntityNotFound(_0x3ea7ec,_0x43abc4){return function(_0xa0f514){if(!_0xa0f514){_0x3ea7ec['sendStatus'](0x194);}return _0xa0f514;};}function handleError(_0x643e9c,_0x429c73){_0x429c73=_0x429c73||0x1f4;return function(_0x521fe3){logger[_0xca3d('0x26')](_0x521fe3[_0xca3d('0x27')]);if(_0x521fe3['name']){delete _0x521fe3[_0xca3d('0x28')];}_0x643e9c['status'](_0x429c73)['send'](_0x521fe3);};}exports[_0xca3d('0x29')]=function(_0x490dcc,_0x52fa6d){var _0x557825={},_0x1748cf={},_0x25645f={'count':0x0,'rows':[]};var _0x380acf=_[_0xca3d('0x2a')](db[_0xca3d('0x2b')]['rawAttributes'],function(_0x3b23d2){return{'name':_0x3b23d2[_0xca3d('0x2c')],'type':_0x3b23d2[_0xca3d('0x2d')][_0xca3d('0x2e')]};});_0x1748cf[_0xca3d('0x2f')]=_[_0xca3d('0x2a')](_0x380acf,_0xca3d('0x28'));_0x1748cf['query']=_[_0xca3d('0x30')](_0x490dcc[_0xca3d('0x31')]);_0x1748cf[_0xca3d('0x32')]=_[_0xca3d('0x33')](_0x1748cf[_0xca3d('0x2f')],_0x1748cf['query']);_0x557825[_0xca3d('0x34')]=_['intersection'](_0x1748cf['model'],qs[_0xca3d('0x35')](_0x490dcc[_0xca3d('0x31')]['fields']));_0x557825[_0xca3d('0x34')]=_0x557825[_0xca3d('0x34')][_0xca3d('0x36')]?_0x557825['attributes']:_0x1748cf['model'];if(!_0x490dcc[_0xca3d('0x31')][_0xca3d('0x37')](_0xca3d('0x38'))){_0x557825[_0xca3d('0x1e')]=qs['limit'](_0x490dcc['query'][_0xca3d('0x1e')]);_0x557825[_0xca3d('0x1c')]=qs[_0xca3d('0x1c')](_0x490dcc[_0xca3d('0x31')][_0xca3d('0x1c')]);}_0x557825[_0xca3d('0x39')]=qs[_0xca3d('0x3a')](_0x490dcc[_0xca3d('0x31')][_0xca3d('0x3a')]);_0x557825[_0xca3d('0x3b')]=qs[_0xca3d('0x32')](_['pick'](_0x490dcc[_0xca3d('0x31')],_0x1748cf[_0xca3d('0x32')]),_0x380acf);if(_0x490dcc[_0xca3d('0x31')][_0xca3d('0x3c')]){_0x557825['where']=_[_0xca3d('0x3d')](_0x557825['where'],{'$or':_[_0xca3d('0x2a')](_0x380acf,function(_0x230316){if(_0x230316[_0xca3d('0x2d')]!==_0xca3d('0x3e')){var _0x251cd2={};_0x251cd2[_0x230316[_0xca3d('0x28')]]={'$like':'%'+_0x490dcc[_0xca3d('0x31')][_0xca3d('0x3c')]+'%'};return _0x251cd2;}})});}_0x557825=_[_0xca3d('0x3d')]({},_0x557825,_0x490dcc[_0xca3d('0x3f')]);var _0x5cdfb5={'where':_0x557825['where']};return db['SalesforceAccount'][_0xca3d('0x1d')](_0x5cdfb5)['then'](function(_0x20f2d5){_0x25645f['count']=_0x20f2d5;if(_0x490dcc[_0xca3d('0x31')]['includeAll']){_0x557825[_0xca3d('0x40')]=[{'all':!![]}];}return db[_0xca3d('0x2b')][_0xca3d('0x41')](_0x557825);})[_0xca3d('0x24')](function(_0x54175b){_0x25645f['rows']=_0x54175b;return _0x25645f;})[_0xca3d('0x24')](respondWithFilteredResult(_0x52fa6d,_0x557825))[_0xca3d('0x42')](handleError(_0x52fa6d,null));};exports[_0xca3d('0x43')]=function(_0x316fa5,_0x166d8f){var _0x324d02={'raw':![],'where':{'id':_0x316fa5[_0xca3d('0x44')]['id']}},_0x986404={};_0x986404[_0xca3d('0x2f')]=_[_0xca3d('0x30')](db[_0xca3d('0x2b')]['rawAttributes']);_0x986404[_0xca3d('0x31')]=_[_0xca3d('0x30')](_0x316fa5[_0xca3d('0x31')]);_0x986404[_0xca3d('0x32')]=_['intersection'](_0x986404['model'],_0x986404['query']);_0x324d02['attributes']=_[_0xca3d('0x33')](_0x986404['model'],qs[_0xca3d('0x35')](_0x316fa5[_0xca3d('0x31')]['fields']));_0x324d02[_0xca3d('0x34')]=_0x324d02['attributes'][_0xca3d('0x36')]?_0x324d02[_0xca3d('0x34')]:_0x986404[_0xca3d('0x2f')];if(_0x316fa5[_0xca3d('0x31')][_0xca3d('0x45')]){_0x324d02[_0xca3d('0x40')]=[{'all':!![]}];}_0x324d02=_['merge']({},_0x324d02,_0x316fa5[_0xca3d('0x3f')]);return db[_0xca3d('0x2b')][_0xca3d('0x46')](_0x324d02)[_0xca3d('0x24')](handleEntityNotFound(_0x166d8f,null))[_0xca3d('0x24')](respondWithResult(_0x166d8f,null))[_0xca3d('0x42')](handleError(_0x166d8f,null));};exports[_0xca3d('0x47')]=function(_0x5ea1cb,_0x1c4e27){return db[_0xca3d('0x2b')][_0xca3d('0x47')](_0x5ea1cb[_0xca3d('0x48')],{})[_0xca3d('0x24')](respondWithResult(_0x1c4e27,0xc9))[_0xca3d('0x42')](handleError(_0x1c4e27,null));};exports['update']=function(_0x214071,_0x18aeff){if(_0x214071[_0xca3d('0x48')]['id']){delete _0x214071[_0xca3d('0x48')]['id'];}return db[_0xca3d('0x2b')][_0xca3d('0x46')]({'where':{'id':_0x214071[_0xca3d('0x44')]['id']}})[_0xca3d('0x24')](handleEntityNotFound(_0x18aeff,null))[_0xca3d('0x24')](saveUpdates(_0x214071[_0xca3d('0x48')],null))['then'](respondWithResult(_0x18aeff,null))['catch'](handleError(_0x18aeff,null));};exports[_0xca3d('0x25')]=function(_0x35f824,_0x435b5d){return db['SalesforceAccount'][_0xca3d('0x46')]({'where':{'id':_0x35f824['params']['id']}})[_0xca3d('0x24')](handleEntityNotFound(_0x435b5d,null))['then'](removeEntity(_0x435b5d,null))['catch'](handleError(_0x435b5d,null));};exports[_0xca3d('0x49')]=function(_0x58d371,_0x3e1f54,_0x1ae285){var _0x3d3b7b={};var _0xea4ae0={};var _0x33352a;var _0x59cf7f;return db[_0xca3d('0x2b')][_0xca3d('0x4a')]({'where':{'id':_0x58d371[_0xca3d('0x44')]['id']}})[_0xca3d('0x24')](handleEntityNotFound(_0x3e1f54,null))[_0xca3d('0x24')](function(_0x27b4c4){if(_0x27b4c4){_0x33352a=_0x27b4c4;_0xea4ae0[_0xca3d('0x2f')]=_[_0xca3d('0x30')](db[_0xca3d('0x4b')][_0xca3d('0x4c')]);_0xea4ae0[_0xca3d('0x31')]=_[_0xca3d('0x30')](_0x58d371[_0xca3d('0x31')]);_0xea4ae0[_0xca3d('0x32')]=_[_0xca3d('0x33')](_0xea4ae0[_0xca3d('0x2f')],_0xea4ae0[_0xca3d('0x31')]);_0x3d3b7b[_0xca3d('0x34')]=_[_0xca3d('0x33')](_0xea4ae0['model'],qs[_0xca3d('0x35')](_0x58d371[_0xca3d('0x31')][_0xca3d('0x35')]));_0x3d3b7b[_0xca3d('0x34')]=_0x3d3b7b[_0xca3d('0x34')][_0xca3d('0x36')]?_0x3d3b7b[_0xca3d('0x34')]:_0xea4ae0['model'];_0x3d3b7b[_0xca3d('0x39')]=qs['sort'](_0x58d371[_0xca3d('0x31')][_0xca3d('0x3a')]);_0x3d3b7b[_0xca3d('0x3b')]=qs['filters'](_[_0xca3d('0x4d')](_0x58d371['query'],_0xea4ae0[_0xca3d('0x32')]));if(_0x58d371[_0xca3d('0x31')][_0xca3d('0x3c')]){_0x3d3b7b[_0xca3d('0x3b')]=_['merge'](_0x3d3b7b[_0xca3d('0x3b')],{'$or':_[_0xca3d('0x2a')](_0x3d3b7b[_0xca3d('0x34')],function(_0x5da206){var _0x457e70={};_0x457e70[_0x5da206]={'$like':'%'+_0x58d371['query'][_0xca3d('0x3c')]+'%'};return _0x457e70;})});}_0x3d3b7b=_[_0xca3d('0x3d')]({},_0x3d3b7b,_0x58d371[_0xca3d('0x3f')]);return _0x33352a[_0xca3d('0x49')](_0x3d3b7b);}})['then'](function(_0x47d3ec){if(_0x47d3ec){_0x59cf7f=_0x47d3ec[_0xca3d('0x36')];if(!_0x58d371[_0xca3d('0x31')][_0xca3d('0x37')](_0xca3d('0x38'))){_0x3d3b7b[_0xca3d('0x1e')]=qs[_0xca3d('0x1e')](_0x58d371[_0xca3d('0x31')][_0xca3d('0x1e')]);_0x3d3b7b[_0xca3d('0x1c')]=qs[_0xca3d('0x1c')](_0x58d371[_0xca3d('0x31')][_0xca3d('0x1c')]);}return _0x33352a[_0xca3d('0x49')](_0x3d3b7b);}})['then'](function(_0x398d09){if(_0x398d09){return _0x398d09?{'count':_0x59cf7f,'rows':_0x398d09}:null;}})[_0xca3d('0x24')](respondWithResult(_0x3e1f54,null))[_0xca3d('0x42')](handleError(_0x3e1f54,null));};exports[_0xca3d('0x4e')]=function(_0x24712a,_0x395096,_0x4d453b){if(_0x24712a[_0xca3d('0x48')]['id']){delete _0x24712a[_0xca3d('0x48')]['id'];}return db[_0xca3d('0x2b')]['findOne']({'where':{'id':_0x24712a[_0xca3d('0x44')]['id']}})[_0xca3d('0x24')](handleEntityNotFound(_0x395096,null))['then'](function(_0x2b83f1){if(_0x2b83f1){_0x24712a['body'][_0xca3d('0x4f')]=_0x2b83f1['id'];_0x24712a[_0xca3d('0x48')][_0xca3d('0x50')]=integrations['getSubjects'](_0x24712a[_0xca3d('0x48')][_0xca3d('0x51')],_0x24712a[_0xca3d('0x48')][_0xca3d('0x2d')]);_0x24712a[_0xca3d('0x48')][_0xca3d('0x52')]=integrations[_0xca3d('0x53')](_0x24712a['body'][_0xca3d('0x51')],_0x24712a[_0xca3d('0x48')]['type']);return db[_0xca3d('0x4b')][_0xca3d('0x47')](_0x24712a[_0xca3d('0x48')],{'include':[{'model':db[_0xca3d('0x54')],'as':_0xca3d('0x50')},{'model':db[_0xca3d('0x54')],'as':'Descriptions'}]});}return null;})[_0xca3d('0x24')](respondWithResult(_0x395096,null))[_0xca3d('0x42')](handleError(_0x395096,null));};exports[_0xca3d('0x55')]=function(_0x1a6e2e,_0x3036cc,_0x44fc62){var _0x43eb29;var _0x3f4d3b='';var _0x43b4b0=_0xca3d('0x56');return db['SalesforceAccount'][_0xca3d('0x4a')]({'where':{'id':_0x1a6e2e[_0xca3d('0x44')]['id']},'attributes':['id',_0xca3d('0x57'),_0xca3d('0x58'),'clientSecret',_0xca3d('0x59'),_0xca3d('0x5a'),_0xca3d('0x5b')]})[_0xca3d('0x24')](handleEntityNotFound(_0x3036cc,null))[_0xca3d('0x24')](function(_0x19253b){if(_0x19253b){_0x3f4d3b=_0x19253b[_0xca3d('0x57')];var _0x528303=_0x3f4d3b['slice'](-0x1);if(_0x528303==='/'){_0x3f4d3b=_0x3f4d3b['substring'](0x0,_0x3f4d3b['lastIndexOf'](_0x528303));}_0x43eb29=new jsforce[(_0xca3d('0x5c'))]({'oauth2':{'loginUrl':_0x3f4d3b,'clientId':_0x19253b[_0xca3d('0x58')],'clientSecret':_0x19253b[_0xca3d('0x5d')]}});return _0x43eb29[_0xca3d('0x5e')](_0x19253b[_0xca3d('0x59')],_0x19253b[_0xca3d('0x5a')]['concat'](_0x19253b[_0xca3d('0x5b')]));}})[_0xca3d('0x24')](function(_0x5819ce){if(_0x5819ce){if(!_[_0xca3d('0x5f')](_0x1a6e2e[_0xca3d('0x31')]['ticketType'])){_0x43b4b0=_0x1a6e2e[_0xca3d('0x31')]['ticketType'];}return _0x43eb29[_0xca3d('0x60')](_0x43b4b0)['describe']();}})['then'](function(_0x2a304e){var _0x1fbc9b=[_0xca3d('0x61'),_0xca3d('0x62'),_0xca3d('0x63'),'IsRecurrence',_0xca3d('0x64'),_0xca3d('0x65')];var _0x572159=[_0xca3d('0x66'),_0xca3d('0x67'),'picklist',_0xca3d('0x68'),'email','textarea',_0xca3d('0x69')];if(_0x2a304e){_[_0xca3d('0x6a')](_0x2a304e[_0xca3d('0x35')],function(_0x41f567){return _0x1fbc9b[_0xca3d('0x6b')](_0x41f567[_0xca3d('0x28')])||!_0x572159[_0xca3d('0x6b')](_0x41f567['type']);});return{'count':_0x2a304e[_0xca3d('0x35')][_0xca3d('0x36')],'rows':_[_0xca3d('0x2a')](_0x2a304e[_0xca3d('0x35')],function(_0x316824){return{'id':_0x316824[_0xca3d('0x28')],'name':_0x316824[_0xca3d('0x6c')],'custom':_0x316824[_0xca3d('0x6d')],'options':_0x316824[_0xca3d('0x6e')][_0xca3d('0x36')]>0x0?_['map'](_0x316824[_0xca3d('0x6e')],function(_0x21f77b){return{'name':_0x21f77b[_0xca3d('0x6c')],'value':_0x21f77b[_0xca3d('0x6f')]};}):_0x316824[_0xca3d('0x2d')]=='boolean'?[{'name':_0xca3d('0x70'),'value':'true'},{'name':_0xca3d('0x71'),'value':_0xca3d('0x72')}]:[]};})};}})[_0xca3d('0x24')](respondWithResult(_0x3036cc,null))[_0xca3d('0x42')](function(_0x25bf2f){var _0x572e9c=_0x1a6e2e[_0xca3d('0x31')]['test']?0x1f4:_0x25bf2f[_0xca3d('0x73')]||0x1f4;logger[_0xca3d('0x26')](_0xca3d('0x74'),_0xca3d('0x55'),_0x572e9c,JSON[_0xca3d('0x75')](_0x25bf2f));delete _0x25bf2f[_0xca3d('0x28')];if(_0x572e9c===0x191){_0x572e9c=0x190;}_0x3036cc['status'](_0x572e9c)['send'](_0x1a6e2e[_0xca3d('0x31')][_0xca3d('0x76')]?{'message':'Wrong\x20credentials','statusCode':_0x25bf2f[_0xca3d('0x73')]}:_0x25bf2f);});}; \ No newline at end of file +var _0x9e65=['OwnerId','Description','string','int','picklist','boolean','email','textarea','includes','label','picklistValues','value','true','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','count','offset','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','includeAll','include','findAll','rows','catch','params','SalesforceAccount','options','create','body','find','getConfigurations','SalesforceConfiguration','length','addConfiguration','findOne','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','remoteUri','clientId','clientSecret','username','password','securityToken','slice','lastIndexOf','login','concat','ticketType','describe'];(function(_0x3ba527,_0x446a5e){var _0x5ee6ad=function(_0x5978c7){while(--_0x5978c7){_0x3ba527['push'](_0x3ba527['shift']());}};_0x5ee6ad(++_0x446a5e);}(_0x9e65,0x1e3));var _0x59e6=function(_0x4b432a,_0x578c42){_0x4b432a=_0x4b432a-0x0;var _0x505158=_0x9e65[_0x4b432a];return _0x505158;};'use strict';var emlformat=require(_0x59e6('0x0'));var rimraf=require(_0x59e6('0x1'));var zipdir=require(_0x59e6('0x2'));var jsonpatch=require(_0x59e6('0x3'));var rp=require('request-promise');var moment=require(_0x59e6('0x4'));var BPromise=require(_0x59e6('0x5'));var Mustache=require(_0x59e6('0x6'));var util=require(_0x59e6('0x7'));var path=require(_0x59e6('0x8'));var sox=require(_0x59e6('0x9'));var csv=require(_0x59e6('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x59e6('0xb'));var squel=require('squel');var crypto=require(_0x59e6('0xc'));var jsforce=require(_0x59e6('0xd'));var deskjs=require(_0x59e6('0xe'));var toCsv=require(_0x59e6('0xa'));var querystring=require(_0x59e6('0xf'));var Papa=require(_0x59e6('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x59e6('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x59e6('0x12'))(_0x59e6('0x13'));var utils=require(_0x59e6('0x14'));var config=require(_0x59e6('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x59e6('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1d286a,_0x2e8a7f){_0x2e8a7f=_0x2e8a7f||0xcc;return function(_0x4a5574){if(_0x4a5574){return _0x1d286a[_0x59e6('0x17')](_0x2e8a7f);}return _0x1d286a[_0x59e6('0x18')](_0x2e8a7f)['end']();};}function respondWithResult(_0xfc15b6,_0xa6ec17){_0xa6ec17=_0xa6ec17||0xc8;return function(_0x904ce0){if(_0x904ce0){return _0xfc15b6[_0x59e6('0x18')](_0xa6ec17)[_0x59e6('0x19')](_0x904ce0);}};}function respondWithFilteredResult(_0x275a7c,_0x484857){return function(_0x219e10){if(_0x219e10){var _0x276047=typeof _0x484857['offset']===_0x59e6('0x1a')&&typeof _0x484857['limit']===_0x59e6('0x1a');var _0x424142=_0x219e10[_0x59e6('0x1b')];var _0x3b97d1=_0x276047?0x0:_0x484857[_0x59e6('0x1c')];var _0x169e76=_0x276047?_0x219e10[_0x59e6('0x1b')]:_0x484857['offset']+_0x484857['limit'];var _0x50ac4b;if(_0x169e76>=_0x424142){_0x169e76=_0x424142;_0x50ac4b=0xc8;}else{_0x50ac4b=0xce;}_0x275a7c[_0x59e6('0x18')](_0x50ac4b);return _0x275a7c[_0x59e6('0x1d')](_0x59e6('0x1e'),_0x3b97d1+'-'+_0x169e76+'/'+_0x424142)[_0x59e6('0x19')](_0x219e10);}return null;};}function patchUpdates(_0x310eb5){return function(_0x3787b9){try{jsonpatch[_0x59e6('0x1f')](_0x3787b9,_0x310eb5,!![]);}catch(_0x3f984f){return BPromise[_0x59e6('0x20')](_0x3f984f);}return _0x3787b9['save']();};}function saveUpdates(_0x142cf9,_0x13be3d){return function(_0x53a2ef){if(_0x53a2ef){return _0x53a2ef[_0x59e6('0x21')](_0x142cf9)[_0x59e6('0x22')](function(_0x1851d7){return _0x1851d7;});}return null;};}function removeEntity(_0x1759e3,_0x3c110c){return function(_0x158efe){if(_0x158efe){return _0x158efe[_0x59e6('0x23')]()[_0x59e6('0x22')](function(){_0x1759e3[_0x59e6('0x18')](0xcc)[_0x59e6('0x24')]();});}};}function handleEntityNotFound(_0x4a2c0,_0x2eb3a3){return function(_0x36a1b0){if(!_0x36a1b0){_0x4a2c0[_0x59e6('0x17')](0x194);}return _0x36a1b0;};}function handleError(_0x247be6,_0x7d1bac){_0x7d1bac=_0x7d1bac||0x1f4;return function(_0x46ff2a){logger[_0x59e6('0x25')](_0x46ff2a[_0x59e6('0x26')]);if(_0x46ff2a[_0x59e6('0x27')]){delete _0x46ff2a[_0x59e6('0x27')];}_0x247be6[_0x59e6('0x18')](_0x7d1bac)[_0x59e6('0x28')](_0x46ff2a);};}exports[_0x59e6('0x29')]=function(_0x35d741,_0x1702be){var _0x27668c={},_0x47a1be={},_0x598373={'count':0x0,'rows':[]};var _0xf4b714=_[_0x59e6('0x2a')](db['SalesforceAccount'][_0x59e6('0x2b')],function(_0x2247c6){return{'name':_0x2247c6['fieldName'],'type':_0x2247c6[_0x59e6('0x2c')][_0x59e6('0x2d')]};});_0x47a1be[_0x59e6('0x2e')]=_[_0x59e6('0x2a')](_0xf4b714,_0x59e6('0x27'));_0x47a1be[_0x59e6('0x2f')]=_[_0x59e6('0x30')](_0x35d741[_0x59e6('0x2f')]);_0x47a1be[_0x59e6('0x31')]=_[_0x59e6('0x32')](_0x47a1be[_0x59e6('0x2e')],_0x47a1be[_0x59e6('0x2f')]);_0x27668c[_0x59e6('0x33')]=_[_0x59e6('0x32')](_0x47a1be[_0x59e6('0x2e')],qs[_0x59e6('0x34')](_0x35d741['query']['fields']));_0x27668c[_0x59e6('0x33')]=_0x27668c[_0x59e6('0x33')]['length']?_0x27668c['attributes']:_0x47a1be[_0x59e6('0x2e')];if(!_0x35d741[_0x59e6('0x2f')][_0x59e6('0x35')](_0x59e6('0x36'))){_0x27668c['limit']=qs['limit'](_0x35d741[_0x59e6('0x2f')][_0x59e6('0x37')]);_0x27668c[_0x59e6('0x1c')]=qs[_0x59e6('0x1c')](_0x35d741[_0x59e6('0x2f')][_0x59e6('0x1c')]);}_0x27668c[_0x59e6('0x38')]=qs[_0x59e6('0x39')](_0x35d741['query'][_0x59e6('0x39')]);_0x27668c['where']=qs['filters'](_[_0x59e6('0x3a')](_0x35d741[_0x59e6('0x2f')],_0x47a1be['filters']),_0xf4b714);if(_0x35d741['query'][_0x59e6('0x3b')]){_0x27668c[_0x59e6('0x3c')]=_[_0x59e6('0x3d')](_0x27668c['where'],{'$or':_['map'](_0xf4b714,function(_0x139009){if(_0x139009[_0x59e6('0x2c')]!=='VIRTUAL'){var _0x4d9c52={};_0x4d9c52[_0x139009['name']]={'$like':'%'+_0x35d741[_0x59e6('0x2f')][_0x59e6('0x3b')]+'%'};return _0x4d9c52;}})});}_0x27668c=_[_0x59e6('0x3d')]({},_0x27668c,_0x35d741['options']);var _0x5a2d48={'where':_0x27668c[_0x59e6('0x3c')]};return db['SalesforceAccount'][_0x59e6('0x1b')](_0x5a2d48)[_0x59e6('0x22')](function(_0x91c4f4){_0x598373[_0x59e6('0x1b')]=_0x91c4f4;if(_0x35d741[_0x59e6('0x2f')][_0x59e6('0x3e')]){_0x27668c[_0x59e6('0x3f')]=[{'all':!![]}];}return db['SalesforceAccount'][_0x59e6('0x40')](_0x27668c);})[_0x59e6('0x22')](function(_0x3eca2d){_0x598373[_0x59e6('0x41')]=_0x3eca2d;return _0x598373;})[_0x59e6('0x22')](respondWithFilteredResult(_0x1702be,_0x27668c))[_0x59e6('0x42')](handleError(_0x1702be,null));};exports['show']=function(_0x498c12,_0x32a982){var _0x5a8441={'raw':![],'where':{'id':_0x498c12[_0x59e6('0x43')]['id']}},_0x9f9e74={};_0x9f9e74[_0x59e6('0x2e')]=_[_0x59e6('0x30')](db[_0x59e6('0x44')][_0x59e6('0x2b')]);_0x9f9e74[_0x59e6('0x2f')]=_[_0x59e6('0x30')](_0x498c12['query']);_0x9f9e74[_0x59e6('0x31')]=_[_0x59e6('0x32')](_0x9f9e74['model'],_0x9f9e74[_0x59e6('0x2f')]);_0x5a8441['attributes']=_[_0x59e6('0x32')](_0x9f9e74['model'],qs[_0x59e6('0x34')](_0x498c12[_0x59e6('0x2f')]['fields']));_0x5a8441[_0x59e6('0x33')]=_0x5a8441[_0x59e6('0x33')]['length']?_0x5a8441['attributes']:_0x9f9e74[_0x59e6('0x2e')];if(_0x498c12[_0x59e6('0x2f')][_0x59e6('0x3e')]){_0x5a8441[_0x59e6('0x3f')]=[{'all':!![]}];}_0x5a8441=_['merge']({},_0x5a8441,_0x498c12[_0x59e6('0x45')]);return db[_0x59e6('0x44')]['find'](_0x5a8441)[_0x59e6('0x22')](handleEntityNotFound(_0x32a982,null))[_0x59e6('0x22')](respondWithResult(_0x32a982,null))[_0x59e6('0x42')](handleError(_0x32a982,null));};exports['create']=function(_0x44ba37,_0x1ae1a8){return db[_0x59e6('0x44')][_0x59e6('0x46')](_0x44ba37[_0x59e6('0x47')],{})[_0x59e6('0x22')](respondWithResult(_0x1ae1a8,0xc9))[_0x59e6('0x42')](handleError(_0x1ae1a8,null));};exports['update']=function(_0xd8c8e3,_0x3c1629){if(_0xd8c8e3[_0x59e6('0x47')]['id']){delete _0xd8c8e3['body']['id'];}return db[_0x59e6('0x44')][_0x59e6('0x48')]({'where':{'id':_0xd8c8e3[_0x59e6('0x43')]['id']}})[_0x59e6('0x22')](handleEntityNotFound(_0x3c1629,null))[_0x59e6('0x22')](saveUpdates(_0xd8c8e3['body'],null))['then'](respondWithResult(_0x3c1629,null))[_0x59e6('0x42')](handleError(_0x3c1629,null));};exports[_0x59e6('0x23')]=function(_0x9a42a2,_0x4a70e9){return db['SalesforceAccount']['find']({'where':{'id':_0x9a42a2[_0x59e6('0x43')]['id']}})[_0x59e6('0x22')](handleEntityNotFound(_0x4a70e9,null))['then'](removeEntity(_0x4a70e9,null))['catch'](handleError(_0x4a70e9,null));};exports[_0x59e6('0x49')]=function(_0x29bff0,_0x17f26c,_0x35e980){var _0x2de5c8={};var _0x20fa05={};var _0x5abab0;var _0x195e24;return db[_0x59e6('0x44')]['findOne']({'where':{'id':_0x29bff0[_0x59e6('0x43')]['id']}})[_0x59e6('0x22')](handleEntityNotFound(_0x17f26c,null))[_0x59e6('0x22')](function(_0x1ea5de){if(_0x1ea5de){_0x5abab0=_0x1ea5de;_0x20fa05[_0x59e6('0x2e')]=_[_0x59e6('0x30')](db[_0x59e6('0x4a')][_0x59e6('0x2b')]);_0x20fa05[_0x59e6('0x2f')]=_[_0x59e6('0x30')](_0x29bff0[_0x59e6('0x2f')]);_0x20fa05[_0x59e6('0x31')]=_['intersection'](_0x20fa05[_0x59e6('0x2e')],_0x20fa05[_0x59e6('0x2f')]);_0x2de5c8[_0x59e6('0x33')]=_[_0x59e6('0x32')](_0x20fa05[_0x59e6('0x2e')],qs[_0x59e6('0x34')](_0x29bff0['query'][_0x59e6('0x34')]));_0x2de5c8[_0x59e6('0x33')]=_0x2de5c8['attributes'][_0x59e6('0x4b')]?_0x2de5c8[_0x59e6('0x33')]:_0x20fa05[_0x59e6('0x2e')];_0x2de5c8['order']=qs[_0x59e6('0x39')](_0x29bff0['query'][_0x59e6('0x39')]);_0x2de5c8['where']=qs['filters'](_[_0x59e6('0x3a')](_0x29bff0[_0x59e6('0x2f')],_0x20fa05['filters']));if(_0x29bff0[_0x59e6('0x2f')][_0x59e6('0x3b')]){_0x2de5c8['where']=_[_0x59e6('0x3d')](_0x2de5c8[_0x59e6('0x3c')],{'$or':_[_0x59e6('0x2a')](_0x2de5c8[_0x59e6('0x33')],function(_0x22d237){var _0x2b01fe={};_0x2b01fe[_0x22d237]={'$like':'%'+_0x29bff0['query'][_0x59e6('0x3b')]+'%'};return _0x2b01fe;})});}_0x2de5c8=_[_0x59e6('0x3d')]({},_0x2de5c8,_0x29bff0[_0x59e6('0x45')]);return _0x5abab0[_0x59e6('0x49')](_0x2de5c8);}})[_0x59e6('0x22')](function(_0x33db3c){if(_0x33db3c){_0x195e24=_0x33db3c[_0x59e6('0x4b')];if(!_0x29bff0[_0x59e6('0x2f')][_0x59e6('0x35')](_0x59e6('0x36'))){_0x2de5c8[_0x59e6('0x37')]=qs[_0x59e6('0x37')](_0x29bff0[_0x59e6('0x2f')][_0x59e6('0x37')]);_0x2de5c8[_0x59e6('0x1c')]=qs[_0x59e6('0x1c')](_0x29bff0[_0x59e6('0x2f')][_0x59e6('0x1c')]);}return _0x5abab0[_0x59e6('0x49')](_0x2de5c8);}})[_0x59e6('0x22')](function(_0x264a82){if(_0x264a82){return _0x264a82?{'count':_0x195e24,'rows':_0x264a82}:null;}})[_0x59e6('0x22')](respondWithResult(_0x17f26c,null))[_0x59e6('0x42')](handleError(_0x17f26c,null));};exports[_0x59e6('0x4c')]=function(_0x22807b,_0x13abd1,_0x2403cd){if(_0x22807b['body']['id']){delete _0x22807b[_0x59e6('0x47')]['id'];}return db[_0x59e6('0x44')][_0x59e6('0x4d')]({'where':{'id':_0x22807b[_0x59e6('0x43')]['id']}})['then'](handleEntityNotFound(_0x13abd1,null))['then'](function(_0x2a9765){if(_0x2a9765){_0x22807b[_0x59e6('0x47')]['AccountId']=_0x2a9765['id'];_0x22807b['body'][_0x59e6('0x4e')]=integrations[_0x59e6('0x4f')](_0x22807b[_0x59e6('0x47')][_0x59e6('0x50')],_0x22807b[_0x59e6('0x47')]['type']);_0x22807b[_0x59e6('0x47')][_0x59e6('0x51')]=integrations[_0x59e6('0x52')](_0x22807b['body'][_0x59e6('0x50')],_0x22807b[_0x59e6('0x47')][_0x59e6('0x2c')]);return db[_0x59e6('0x4a')]['create'](_0x22807b[_0x59e6('0x47')],{'include':[{'model':db[_0x59e6('0x53')],'as':_0x59e6('0x4e')},{'model':db[_0x59e6('0x53')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x13abd1,null))[_0x59e6('0x42')](handleError(_0x13abd1,null));};exports[_0x59e6('0x54')]=function(_0x1682f5,_0x5bbe3c,_0x3e3580){var _0x4e7557;var _0x484f89='';var _0x6334ae='Task';return db['SalesforceAccount'][_0x59e6('0x4d')]({'where':{'id':_0x1682f5[_0x59e6('0x43')]['id']},'attributes':['id',_0x59e6('0x55'),_0x59e6('0x56'),_0x59e6('0x57'),_0x59e6('0x58'),_0x59e6('0x59'),_0x59e6('0x5a')]})[_0x59e6('0x22')](handleEntityNotFound(_0x5bbe3c,null))[_0x59e6('0x22')](function(_0x40db6f){if(_0x40db6f){_0x484f89=_0x40db6f['remoteUri'];var _0x5a3d2a=_0x484f89[_0x59e6('0x5b')](-0x1);if(_0x5a3d2a==='/'){_0x484f89=_0x484f89['substring'](0x0,_0x484f89[_0x59e6('0x5c')](_0x5a3d2a));}_0x4e7557=new jsforce['Connection']({'oauth2':{'loginUrl':_0x484f89,'clientId':_0x40db6f['clientId'],'clientSecret':_0x40db6f[_0x59e6('0x57')]}});return _0x4e7557[_0x59e6('0x5d')](_0x40db6f[_0x59e6('0x58')],_0x40db6f[_0x59e6('0x59')][_0x59e6('0x5e')](_0x40db6f['securityToken']));}})['then'](function(_0x3af512){if(_0x3af512){if(!_['isNil'](_0x1682f5['query']['ticketType'])){_0x6334ae=_0x1682f5[_0x59e6('0x2f')][_0x59e6('0x5f')];}return _0x4e7557['sobject'](_0x6334ae)[_0x59e6('0x60')]();}})[_0x59e6('0x22')](function(_0x12df82){var _0xfb9768=[_0x59e6('0x61'),'ActivityDate','IsReminderSet','IsRecurrence','Subject',_0x59e6('0x62')];var _0x5dac6c=[_0x59e6('0x63'),_0x59e6('0x64'),_0x59e6('0x65'),_0x59e6('0x66'),_0x59e6('0x67'),_0x59e6('0x68'),'phone'];if(_0x12df82){_['remove'](_0x12df82['fields'],function(_0xfd7676){return _0xfb9768[_0x59e6('0x69')](_0xfd7676[_0x59e6('0x27')])||!_0x5dac6c[_0x59e6('0x69')](_0xfd7676['type']);});return{'count':_0x12df82[_0x59e6('0x34')]['length'],'rows':_['map'](_0x12df82[_0x59e6('0x34')],function(_0x2c7a97){return{'id':_0x2c7a97['name'],'name':_0x2c7a97[_0x59e6('0x6a')],'custom':_0x2c7a97['custom'],'options':_0x2c7a97['picklistValues']['length']>0x0?_[_0x59e6('0x2a')](_0x2c7a97[_0x59e6('0x6b')],function(_0x59eaea){return{'name':_0x59eaea[_0x59e6('0x6a')],'value':_0x59eaea[_0x59e6('0x6c')]};}):_0x2c7a97[_0x59e6('0x2c')]=='boolean'?[{'name':'True','value':_0x59e6('0x6d')},{'name':'False','value':_0x59e6('0x6e')}]:[]};})};}})[_0x59e6('0x22')](respondWithResult(_0x5bbe3c,null))[_0x59e6('0x42')](function(_0x2abe61){var _0x51e618=_0x1682f5['query'][_0x59e6('0x6f')]?0x1f4:_0x2abe61[_0x59e6('0x70')]||0x1f4;logger['error'](_0x59e6('0x71'),'getFields',_0x51e618,JSON[_0x59e6('0x72')](_0x2abe61));delete _0x2abe61[_0x59e6('0x27')];if(_0x51e618===0x191){_0x51e618=0x190;}_0x5bbe3c[_0x59e6('0x18')](_0x51e618)[_0x59e6('0x28')](_0x1682f5['query'][_0x59e6('0x6f')]?{'message':_0x59e6('0x73'),'statusCode':_0x2abe61['statusCode']}:_0x2abe61);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 732a81f..ea775c9 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 _0xf4f3=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../components/integrations/configuration','exports','define','SalesforceAccount','lodash'];(function(_0x53a8d5,_0x207317){var _0x560194=function(_0x1a24ba){while(--_0x1a24ba){_0x53a8d5['push'](_0x53a8d5['shift']());}};_0x560194(++_0x207317);}(_0xf4f3,0x9b));var _0x3f4f=function(_0x42de57,_0x54ab83){_0x42de57=_0x42de57-0x0;var _0x54fc28=_0xf4f3[_0x42de57];return _0x54fc28;};'use strict';var _=require(_0x3f4f('0x0'));var util=require(_0x3f4f('0x1'));var logger=require(_0x3f4f('0x2'))(_0x3f4f('0x3'));var moment=require(_0x3f4f('0x4'));var BPromise=require('bluebird');var rp=require(_0x3f4f('0x5'));var fs=require('fs');var path=require(_0x3f4f('0x6'));var rimraf=require(_0x3f4f('0x7'));var config=require('../../config/environment');var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0x3f4f('0x8'));module[_0x3f4f('0x9')]=function(_0x1c7569,_0x565ea8){return _0x1c7569[_0x3f4f('0xa')](_0x3f4f('0xb'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x500a=['request-promise','path','rimraf','../../config/environment','exports','define','SalesforceAccount','util','api'];(function(_0x5d64aa,_0x1ead10){var _0x424b97=function(_0x30754b){while(--_0x30754b){_0x5d64aa['push'](_0x5d64aa['shift']());}};_0x424b97(++_0x1ead10);}(_0x500a,0xd6));var _0xa500=function(_0x9ed65d,_0x3e95f3){_0x9ed65d=_0x9ed65d-0x0;var _0xfa14ef=_0x500a[_0x9ed65d];return _0xfa14ef;};'use strict';var _=require('lodash');var util=require(_0xa500('0x0'));var logger=require('../../config/logger')(_0xa500('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa500('0x2'));var fs=require('fs');var path=require(_0xa500('0x3'));var rimraf=require(_0xa500('0x4'));var config=require(_0xa500('0x5'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xa500('0x6')]=function(_0x4333a3,_0x3781b0){return _0x4333a3[_0xa500('0x7')](_0xa500('0x8'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index c9dedc9..54f6cfa 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 _0xb37e=['raw','where','attributes','limit','include','map','model','ShowSalesforceAccount','find','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','options'];(function(_0x54a284,_0x2c0d40){var _0x371aa5=function(_0x2a9e93){while(--_0x2a9e93){_0x54a284['push'](_0x54a284['shift']());}};_0x371aa5(++_0x2c0d40);}(_0xb37e,0x6f));var _0xeb37=function(_0x3b4596,_0x5ab4bb){_0x3b4596=_0x3b4596-0x0;var _0x314dec=_0xb37e[_0x3b4596];return _0x314dec;};'use strict';var _=require(_0xeb37('0x0'));var util=require(_0xeb37('0x1'));var moment=require('moment');var BPromise=require(_0xeb37('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeb37('0x3'));var db=require(_0xeb37('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xeb37('0x5'))(_0xeb37('0x6'));var config=require(_0xeb37('0x7'));var jayson=require(_0xeb37('0x8'));var client=jayson['client'][_0xeb37('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2145d5,_0x30eede,_0x5047dc){return new BPromise(function(_0x165a4e,_0x89371a){return client['request'](_0x2145d5,_0x5047dc)[_0xeb37('0xa')](function(_0x424be6){logger[_0xeb37('0xb')](_0xeb37('0xc'),_0x30eede,'request\x20sent');logger[_0xeb37('0xd')](_0xeb37('0xe'),_0x30eede,_0xeb37('0xf'),JSON[_0xeb37('0x10')](_0x424be6));if(_0x424be6[_0xeb37('0x11')]){if(_0x424be6[_0xeb37('0x11')][_0xeb37('0x12')]===0x1f4){logger[_0xeb37('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0x30eede,_0x424be6[_0xeb37('0x11')][_0xeb37('0x13')]);return _0x89371a(_0x424be6[_0xeb37('0x11')][_0xeb37('0x13')]);}logger[_0xeb37('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0x30eede,_0x424be6['error'][_0xeb37('0x13')]);return _0x165a4e(_0x424be6[_0xeb37('0x11')][_0xeb37('0x13')]);}else{logger[_0xeb37('0xb')](_0xeb37('0xc'),_0x30eede,_0xeb37('0xf'));_0x165a4e(_0x424be6[_0xeb37('0x14')][_0xeb37('0x13')]);}})[_0xeb37('0x15')](function(_0x28a209){logger[_0xeb37('0x11')](_0xeb37('0xc'),_0x30eede,_0x28a209);_0x89371a(_0x28a209);});});}exports[_0xeb37('0x16')]=function(_0x4efa54){var _0x1232c8=this;return new Promise(function(_0x739f0,_0x23dbb7){return db[_0xeb37('0x17')]['findAll']({'raw':_0x4efa54[_0xeb37('0x18')]?_0x4efa54[_0xeb37('0x18')][_0xeb37('0x19')]===undefined?!![]:![]:!![],'where':_0x4efa54[_0xeb37('0x18')]?_0x4efa54[_0xeb37('0x18')][_0xeb37('0x1a')]||null:null,'attributes':_0x4efa54[_0xeb37('0x18')]?_0x4efa54[_0xeb37('0x18')][_0xeb37('0x1b')]||null:null,'limit':_0x4efa54[_0xeb37('0x18')]?_0x4efa54[_0xeb37('0x18')][_0xeb37('0x1c')]||null:null,'include':_0x4efa54[_0xeb37('0x18')]?_0x4efa54[_0xeb37('0x18')][_0xeb37('0x1d')]?_[_0xeb37('0x1e')](_0x4efa54[_0xeb37('0x18')][_0xeb37('0x1d')],function(_0x5d2dca){return{'model':db[_0x5d2dca[_0xeb37('0x1f')]],'as':_0x5d2dca['as'],'attributes':_0x5d2dca[_0xeb37('0x1b')],'include':_0x5d2dca[_0xeb37('0x1d')]?_['map'](_0x5d2dca[_0xeb37('0x1d')],function(_0x4ff01f){return{'model':db[_0x4ff01f[_0xeb37('0x1f')]],'as':_0x4ff01f['as'],'attributes':_0x4ff01f[_0xeb37('0x1b')],'include':_0x4ff01f['include']?_[_0xeb37('0x1e')](_0x4ff01f[_0xeb37('0x1d')],function(_0x5a207e){return{'model':db[_0x5a207e['model']],'as':_0x5a207e['as'],'attributes':_0x5a207e[_0xeb37('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2700b8){logger[_0xeb37('0xb')](_0xeb37('0x16'),_0x4efa54);logger['debug'](_0xeb37('0x16'),_0x4efa54,JSON[_0xeb37('0x10')](_0x2700b8));_0x739f0(_0x2700b8);})[_0xeb37('0x15')](function(_0x2f51ea){logger[_0xeb37('0x11')](_0xeb37('0x16'),_0x2f51ea[_0xeb37('0x13')],_0x4efa54);_0x23dbb7(_0x1232c8[_0xeb37('0x11')](0x1f4,_0x2f51ea[_0xeb37('0x13')]));});});};exports[_0xeb37('0x20')]=function(_0x3ca5b3){var _0x1d76e7=this;return new Promise(function(_0x192bb3,_0x218c32){return db[_0xeb37('0x17')][_0xeb37('0x21')]({'raw':_0x3ca5b3[_0xeb37('0x18')]?_0x3ca5b3['options'][_0xeb37('0x19')]===undefined?!![]:![]:!![],'where':_0x3ca5b3['options']?_0x3ca5b3['options'][_0xeb37('0x1a')]||null:null,'attributes':_0x3ca5b3[_0xeb37('0x18')]?_0x3ca5b3['options'][_0xeb37('0x1b')]||null:null,'include':_0x3ca5b3[_0xeb37('0x18')]?_0x3ca5b3['options']['include']?_[_0xeb37('0x1e')](_0x3ca5b3[_0xeb37('0x18')][_0xeb37('0x1d')],function(_0x5757d3){return{'model':db[_0x5757d3[_0xeb37('0x1f')]],'as':_0x5757d3['as'],'attributes':_0x5757d3[_0xeb37('0x1b')],'include':_0x5757d3[_0xeb37('0x1d')]?_[_0xeb37('0x1e')](_0x5757d3[_0xeb37('0x1d')],function(_0x178d9b){return{'model':db[_0x178d9b[_0xeb37('0x1f')]],'as':_0x178d9b['as'],'attributes':_0x178d9b['attributes'],'include':_0x178d9b[_0xeb37('0x1d')]?_['map'](_0x178d9b[_0xeb37('0x1d')],function(_0x11dfb9){return{'model':db[_0x11dfb9[_0xeb37('0x1f')]],'as':_0x11dfb9['as'],'attributes':_0x11dfb9[_0xeb37('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x189ad0){logger['info'](_0xeb37('0x20'),_0x3ca5b3);logger[_0xeb37('0xd')](_0xeb37('0x20'),_0x3ca5b3,JSON[_0xeb37('0x10')](_0x189ad0));_0x192bb3(_0x189ad0);})[_0xeb37('0x15')](function(_0x1f1be0){logger[_0xeb37('0x11')]('ShowSalesforceAccount',_0x1f1be0[_0xeb37('0x13')],_0x3ca5b3);_0x218c32(_0x1d76e7[_0xeb37('0x11')](0x1f4,_0x1f1be0[_0xeb37('0x13')]));});});}; \ No newline at end of file +var _0x6d14=['../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','attributes','include','map','model','info','catch','ShowSalesforceAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x35accf,_0x1cc545){var _0x6e4c1=function(_0x18de99){while(--_0x18de99){_0x35accf['push'](_0x35accf['shift']());}};_0x6e4c1(++_0x1cc545);}(_0x6d14,0x134));var _0x46d1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6d14[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x46d1('0x0'));var util=require(_0x46d1('0x1'));var moment=require(_0x46d1('0x2'));var BPromise=require(_0x46d1('0x3'));var rs=require(_0x46d1('0x4'));var fs=require('fs');var Redis=require(_0x46d1('0x5'));var db=require(_0x46d1('0x6'))['db'];var utils=require(_0x46d1('0x7'));var logger=require('../../config/logger')(_0x46d1('0x8'));var config=require(_0x46d1('0x9'));var jayson=require(_0x46d1('0xa'));var client=jayson[_0x46d1('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f0838,_0x35be91,_0x11328f){return new BPromise(function(_0x1647b1,_0x3f6e99){return client[_0x46d1('0xc')](_0x3f0838,_0x11328f)[_0x46d1('0xd')](function(_0x55eccd){logger['info'](_0x46d1('0xe'),_0x35be91,_0x46d1('0xf'));logger[_0x46d1('0x10')](_0x46d1('0x11'),_0x35be91,_0x46d1('0xf'),JSON[_0x46d1('0x12')](_0x55eccd));if(_0x55eccd[_0x46d1('0x13')]){if(_0x55eccd['error']['code']===0x1f4){logger['error'](_0x46d1('0xe'),_0x35be91,_0x55eccd[_0x46d1('0x13')][_0x46d1('0x14')]);return _0x3f6e99(_0x55eccd[_0x46d1('0x13')][_0x46d1('0x14')]);}logger[_0x46d1('0x13')](_0x46d1('0xe'),_0x35be91,_0x55eccd['error'][_0x46d1('0x14')]);return _0x1647b1(_0x55eccd[_0x46d1('0x13')][_0x46d1('0x14')]);}else{logger['info'](_0x46d1('0xe'),_0x35be91,_0x46d1('0xf'));_0x1647b1(_0x55eccd[_0x46d1('0x15')]['message']);}})['catch'](function(_0x572291){logger[_0x46d1('0x13')](_0x46d1('0xe'),_0x35be91,_0x572291);_0x3f6e99(_0x572291);});});}exports[_0x46d1('0x16')]=function(_0x52dd82){var _0x54d874=this;return new Promise(function(_0x1678ed,_0xbca974){return db[_0x46d1('0x17')][_0x46d1('0x18')]({'raw':_0x52dd82[_0x46d1('0x19')]?_0x52dd82['options'][_0x46d1('0x1a')]===undefined?!![]:![]:!![],'where':_0x52dd82[_0x46d1('0x19')]?_0x52dd82[_0x46d1('0x19')][_0x46d1('0x1b')]||null:null,'attributes':_0x52dd82[_0x46d1('0x19')]?_0x52dd82[_0x46d1('0x19')][_0x46d1('0x1c')]||null:null,'limit':_0x52dd82[_0x46d1('0x19')]?_0x52dd82[_0x46d1('0x19')]['limit']||null:null,'include':_0x52dd82['options']?_0x52dd82[_0x46d1('0x19')][_0x46d1('0x1d')]?_[_0x46d1('0x1e')](_0x52dd82['options'][_0x46d1('0x1d')],function(_0xbf1b7f){return{'model':db[_0xbf1b7f[_0x46d1('0x1f')]],'as':_0xbf1b7f['as'],'attributes':_0xbf1b7f[_0x46d1('0x1c')],'include':_0xbf1b7f[_0x46d1('0x1d')]?_[_0x46d1('0x1e')](_0xbf1b7f[_0x46d1('0x1d')],function(_0x3fc657){return{'model':db[_0x3fc657[_0x46d1('0x1f')]],'as':_0x3fc657['as'],'attributes':_0x3fc657[_0x46d1('0x1c')],'include':_0x3fc657[_0x46d1('0x1d')]?_[_0x46d1('0x1e')](_0x3fc657[_0x46d1('0x1d')],function(_0x113986){return{'model':db[_0x113986[_0x46d1('0x1f')]],'as':_0x113986['as'],'attributes':_0x113986['attributes']};}):[]};}):[]};}):[]:[]})[_0x46d1('0xd')](function(_0x36d0ca){logger[_0x46d1('0x20')](_0x46d1('0x16'),_0x52dd82);logger[_0x46d1('0x10')](_0x46d1('0x16'),_0x52dd82,JSON['stringify'](_0x36d0ca));_0x1678ed(_0x36d0ca);})[_0x46d1('0x21')](function(_0x592ef3){logger[_0x46d1('0x13')](_0x46d1('0x16'),_0x592ef3[_0x46d1('0x14')],_0x52dd82);_0xbca974(_0x54d874['error'](0x1f4,_0x592ef3[_0x46d1('0x14')]));});});};exports['ShowSalesforceAccount']=function(_0x3d0344){var _0x476d42=this;return new Promise(function(_0x15f6f4,_0x1943ae){return db[_0x46d1('0x17')]['find']({'raw':_0x3d0344[_0x46d1('0x19')]?_0x3d0344[_0x46d1('0x19')][_0x46d1('0x1a')]===undefined?!![]:![]:!![],'where':_0x3d0344[_0x46d1('0x19')]?_0x3d0344['options'][_0x46d1('0x1b')]||null:null,'attributes':_0x3d0344[_0x46d1('0x19')]?_0x3d0344[_0x46d1('0x19')][_0x46d1('0x1c')]||null:null,'include':_0x3d0344[_0x46d1('0x19')]?_0x3d0344['options']['include']?_[_0x46d1('0x1e')](_0x3d0344[_0x46d1('0x19')][_0x46d1('0x1d')],function(_0x2a8e95){return{'model':db[_0x2a8e95[_0x46d1('0x1f')]],'as':_0x2a8e95['as'],'attributes':_0x2a8e95[_0x46d1('0x1c')],'include':_0x2a8e95[_0x46d1('0x1d')]?_['map'](_0x2a8e95['include'],function(_0x4dc039){return{'model':db[_0x4dc039[_0x46d1('0x1f')]],'as':_0x4dc039['as'],'attributes':_0x4dc039[_0x46d1('0x1c')],'include':_0x4dc039[_0x46d1('0x1d')]?_[_0x46d1('0x1e')](_0x4dc039[_0x46d1('0x1d')],function(_0x5365aa){return{'model':db[_0x5365aa[_0x46d1('0x1f')]],'as':_0x5365aa['as'],'attributes':_0x5365aa[_0x46d1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x46d1('0xd')](function(_0x5eab5b){logger['info'](_0x46d1('0x22'),_0x3d0344);logger['debug'](_0x46d1('0x22'),_0x3d0344,JSON['stringify'](_0x5eab5b));_0x15f6f4(_0x5eab5b);})[_0x46d1('0x21')](function(_0x5078ea){logger[_0x46d1('0x13')]('ShowSalesforceAccount',_0x5078ea[_0x46d1('0x14')],_0x3d0344);_0x1943ae(_0x476d42['error'](0x1f4,_0x5078ea[_0x46d1('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 3ea23bf..3507115 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 _0x0b0e=['post','create','put','/:id','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions'];(function(_0x2ef44b,_0x553359){var _0x2405b9=function(_0x278290){while(--_0x278290){_0x2ef44b['push'](_0x2ef44b['shift']());}};_0x2405b9(++_0x553359);}(_0x0b0e,0x187));var _0xe0b0=function(_0xf79bae,_0x263b2a){_0xf79bae=_0xf79bae-0x0;var _0x5d2cb7=_0x0b0e[_0xf79bae];return _0x5d2cb7;};'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('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['getFields']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/descriptions',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')]('/',auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);router[_0xe0b0('0x13')](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x15')]);router['delete'](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x16')]);module[_0xe0b0('0x17')]=router; \ No newline at end of file +var _0xadb5=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','util','connect-timeout','express'];(function(_0x220ab4,_0x5cf193){var _0x3125b5=function(_0x306ac7){while(--_0x306ac7){_0x220ab4['push'](_0x220ab4['shift']());}};_0x3125b5(++_0x5cf193);}(_0xadb5,0xad));var _0x5adb=function(_0x5f3ed6,_0x3d5e7f){_0x5f3ed6=_0x5f3ed6-0x0;var _0x5461a2=_0xadb5[_0x5f3ed6];return _0x5461a2;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0x7')](_0x5adb('0xe'),auth[_0x5adb('0x8')](),controller['getSubjects']);router['get'](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router['post']('/',auth[_0x5adb('0x8')](),controller['create']);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x12')]);router[_0x5adb('0x13')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x14')]);module[_0x5adb('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 58a8a39..787a1da 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 _0xc336=['account','STRING','sequelize','exports','ENUM','Task','contact_lead','contact','lead'];(function(_0x20a5ac,_0x42c101){var _0x3dc266=function(_0x55b1c4){while(--_0x55b1c4){_0x20a5ac['push'](_0x20a5ac['shift']());}};_0x3dc266(++_0x42c101);}(_0xc336,0x1d6));var _0x6c33=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xc336[_0x18a79d];return _0x4f8848;};'use strict';var Sequelize=require(_0x6c33('0x0'));module[_0x6c33('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x6c33('0x2')]('Task','Case'),'defaultValue':_0x6c33('0x3')},'moduleSearch':{'type':Sequelize[_0x6c33('0x2')](_0x6c33('0x4'),_0x6c33('0x5'),_0x6c33('0x6'),'account_contact_lead','account'),'defaultValue':_0x6c33('0x4')},'moduleCreate':{'type':Sequelize[_0x6c33('0x2')]('nothing',_0x6c33('0x5'),_0x6c33('0x6'),_0x6c33('0x7')),'defaultValue':_0x6c33('0x6')},'leadId':{'type':Sequelize[_0x6c33('0x8')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0x6c33('0x8')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6c9f=['STRING','ENUM','Task','Case','contact_lead','lead','account_contact_lead','account','nothing','contact','sequelize'];(function(_0xae0eec,_0x5a9086){var _0x515df4=function(_0x3749f4){while(--_0x3749f4){_0xae0eec['push'](_0xae0eec['shift']());}};_0x515df4(++_0x5a9086);}(_0x6c9f,0x16a));var _0xf6c9=function(_0x2e155d,_0x271afc){_0x2e155d=_0x2e155d-0x0;var _0x3b72c4=_0x6c9f[_0x2e155d];return _0x3b72c4;};'use strict';var Sequelize=require(_0xf6c9('0x0'));module['exports']={'name':{'type':Sequelize[_0xf6c9('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xf6c9('0x2')](_0xf6c9('0x3'),_0xf6c9('0x4')),'defaultValue':_0xf6c9('0x3')},'moduleSearch':{'type':Sequelize[_0xf6c9('0x2')](_0xf6c9('0x5'),'contact',_0xf6c9('0x6'),_0xf6c9('0x7'),_0xf6c9('0x8')),'defaultValue':_0xf6c9('0x5')},'moduleCreate':{'type':Sequelize[_0xf6c9('0x2')](_0xf6c9('0x9'),_0xf6c9('0xa'),_0xf6c9('0x6'),_0xf6c9('0x8')),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0xf6c9('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0xf6c9('0x1')]},'additionalSearchContact':{'type':Sequelize[_0xf6c9('0x1')]},'additionalSearchLead':{'type':Sequelize[_0xf6c9('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index e8918e1..53af4fa 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 _0x7ba0=['rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','status','error','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','includeAll','include','then','rows','catch','show','params','find','create','body','getFields','findOne','SalesforceField','pick','getSubjects','getDescriptions','eml-format'];(function(_0x2b7b56,_0x5dddcc){var _0x17bfbb=function(_0x5b9e1f){while(--_0x5b9e1f){_0x2b7b56['push'](_0x2b7b56['shift']());}};_0x17bfbb(++_0x5dddcc);}(_0x7ba0,0x1e5));var _0x07ba=function(_0x758927,_0x391d53){_0x758927=_0x758927-0x0;var _0x214a6a=_0x7ba0[_0x758927];return _0x214a6a;};'use strict';var emlformat=require(_0x07ba('0x0'));var rimraf=require(_0x07ba('0x1'));var zipdir=require(_0x07ba('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x07ba('0x3'));var moment=require(_0x07ba('0x4'));var BPromise=require(_0x07ba('0x5'));var Mustache=require('mustache');var util=require(_0x07ba('0x6'));var path=require('path');var sox=require(_0x07ba('0x7'));var csv=require(_0x07ba('0x8'));var ejs=require(_0x07ba('0x9'));var fs=require('fs');var fs_extra=require(_0x07ba('0xa'));var _=require(_0x07ba('0xb'));var squel=require(_0x07ba('0xc'));var crypto=require('crypto');var jsforce=require(_0x07ba('0xd'));var deskjs=require(_0x07ba('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x07ba('0xf'));var Redis=require(_0x07ba('0x10'));var authService=require(_0x07ba('0x11'));var qs=require(_0x07ba('0x12'));var as=require(_0x07ba('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x07ba('0x14'))(_0x07ba('0x15'));var utils=require(_0x07ba('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x07ba('0x17'));var db=require(_0x07ba('0x18'))['db'];function respondWithStatusCode(_0x9d511a,_0xf1f473){_0xf1f473=_0xf1f473||0xcc;return function(_0x28990e){if(_0x28990e){return _0x9d511a[_0x07ba('0x19')](_0xf1f473);}return _0x9d511a['status'](_0xf1f473)[_0x07ba('0x1a')]();};}function respondWithResult(_0xaf451b,_0x555e19){_0x555e19=_0x555e19||0xc8;return function(_0x32ac9a){if(_0x32ac9a){return _0xaf451b['status'](_0x555e19)['json'](_0x32ac9a);}};}function respondWithFilteredResult(_0x2bf9e7,_0x518459){return function(_0x1b2556){if(_0x1b2556){var _0x4a472e=typeof _0x518459[_0x07ba('0x1b')]===_0x07ba('0x1c')&&typeof _0x518459[_0x07ba('0x1d')]==='undefined';var _0x496a45=_0x1b2556[_0x07ba('0x1e')];var _0x3e0cc4=_0x4a472e?0x0:_0x518459[_0x07ba('0x1b')];var _0xa838a3=_0x4a472e?_0x1b2556[_0x07ba('0x1e')]:_0x518459['offset']+_0x518459['limit'];var _0x27f398;if(_0xa838a3>=_0x496a45){_0xa838a3=_0x496a45;_0x27f398=0xc8;}else{_0x27f398=0xce;}_0x2bf9e7['status'](_0x27f398);return _0x2bf9e7[_0x07ba('0x1f')](_0x07ba('0x20'),_0x3e0cc4+'-'+_0xa838a3+'/'+_0x496a45)[_0x07ba('0x21')](_0x1b2556);}return null;};}function patchUpdates(_0x4b3c23){return function(_0x59d4f2){try{jsonpatch['apply'](_0x59d4f2,_0x4b3c23,!![]);}catch(_0x55f0d){return BPromise[_0x07ba('0x22')](_0x55f0d);}return _0x59d4f2[_0x07ba('0x23')]();};}function saveUpdates(_0xc3ec29,_0x5ee961){return function(_0x3d3605){if(_0x3d3605){return _0x3d3605[_0x07ba('0x24')](_0xc3ec29)['then'](function(_0x477781){return _0x477781;});}return null;};}function removeEntity(_0xd8b1b2,_0x4fac10){return function(_0x111c8f){if(_0x111c8f){return _0x111c8f['destroy']()['then'](function(){_0xd8b1b2[_0x07ba('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x325a1b,_0x84fd7b){return function(_0x452768){if(!_0x452768){_0x325a1b[_0x07ba('0x19')](0x194);}return _0x452768;};}function handleError(_0xb8c028,_0x47af80){_0x47af80=_0x47af80||0x1f4;return function(_0x5678b5){logger[_0x07ba('0x26')](_0x5678b5[_0x07ba('0x27')]);if(_0x5678b5[_0x07ba('0x28')]){delete _0x5678b5[_0x07ba('0x28')];}_0xb8c028[_0x07ba('0x25')](_0x47af80)[_0x07ba('0x29')](_0x5678b5);};}exports[_0x07ba('0x2a')]=function(_0x36fea0,_0x534388){var _0x576ed2={},_0x30623d={},_0x3e0e3f={'count':0x0,'rows':[]};var _0xa2d275=_[_0x07ba('0x2b')](db[_0x07ba('0x2c')][_0x07ba('0x2d')],function(_0x313e85){return{'name':_0x313e85[_0x07ba('0x2e')],'type':_0x313e85[_0x07ba('0x2f')][_0x07ba('0x30')]};});_0x30623d['model']=_[_0x07ba('0x2b')](_0xa2d275,_0x07ba('0x28'));_0x30623d[_0x07ba('0x31')]=_[_0x07ba('0x32')](_0x36fea0[_0x07ba('0x31')]);_0x30623d[_0x07ba('0x33')]=_[_0x07ba('0x34')](_0x30623d['model'],_0x30623d[_0x07ba('0x31')]);_0x576ed2['attributes']=_[_0x07ba('0x34')](_0x30623d[_0x07ba('0x35')],qs['fields'](_0x36fea0[_0x07ba('0x31')][_0x07ba('0x36')]));_0x576ed2[_0x07ba('0x37')]=_0x576ed2[_0x07ba('0x37')][_0x07ba('0x38')]?_0x576ed2[_0x07ba('0x37')]:_0x30623d[_0x07ba('0x35')];if(!_0x36fea0[_0x07ba('0x31')][_0x07ba('0x39')](_0x07ba('0x3a'))){_0x576ed2[_0x07ba('0x1d')]=qs[_0x07ba('0x1d')](_0x36fea0[_0x07ba('0x31')]['limit']);_0x576ed2['offset']=qs['offset'](_0x36fea0[_0x07ba('0x31')]['offset']);}_0x576ed2[_0x07ba('0x3b')]=qs[_0x07ba('0x3c')](_0x36fea0[_0x07ba('0x31')][_0x07ba('0x3c')]);_0x576ed2[_0x07ba('0x3d')]=qs[_0x07ba('0x33')](_['pick'](_0x36fea0['query'],_0x30623d[_0x07ba('0x33')]),_0xa2d275);if(_0x36fea0[_0x07ba('0x31')]['filter']){_0x576ed2[_0x07ba('0x3d')]=_[_0x07ba('0x3e')](_0x576ed2[_0x07ba('0x3d')],{'$or':_['map'](_0xa2d275,function(_0x52d887){if(_0x52d887[_0x07ba('0x2f')]!=='VIRTUAL'){var _0x12aae7={};_0x12aae7[_0x52d887[_0x07ba('0x28')]]={'$like':'%'+_0x36fea0[_0x07ba('0x31')][_0x07ba('0x3f')]+'%'};return _0x12aae7;}})});}_0x576ed2=_[_0x07ba('0x3e')]({},_0x576ed2,_0x36fea0[_0x07ba('0x40')]);var _0x49efc8={'where':_0x576ed2[_0x07ba('0x3d')]};return db[_0x07ba('0x2c')][_0x07ba('0x1e')](_0x49efc8)['then'](function(_0x32abd4){_0x3e0e3f[_0x07ba('0x1e')]=_0x32abd4;if(_0x36fea0[_0x07ba('0x31')][_0x07ba('0x41')]){_0x576ed2[_0x07ba('0x42')]=[{'all':!![]}];}return db[_0x07ba('0x2c')]['findAll'](_0x576ed2);})[_0x07ba('0x43')](function(_0x331b9c){_0x3e0e3f[_0x07ba('0x44')]=_0x331b9c;return _0x3e0e3f;})['then'](respondWithFilteredResult(_0x534388,_0x576ed2))[_0x07ba('0x45')](handleError(_0x534388,null));};exports[_0x07ba('0x46')]=function(_0xa5cc4d,_0x2f540f){var _0x316554={'raw':![],'where':{'id':_0xa5cc4d[_0x07ba('0x47')]['id']}},_0x173c5b={};_0x173c5b['model']=_[_0x07ba('0x32')](db['SalesforceConfiguration']['rawAttributes']);_0x173c5b[_0x07ba('0x31')]=_[_0x07ba('0x32')](_0xa5cc4d[_0x07ba('0x31')]);_0x173c5b[_0x07ba('0x33')]=_[_0x07ba('0x34')](_0x173c5b[_0x07ba('0x35')],_0x173c5b[_0x07ba('0x31')]);_0x316554[_0x07ba('0x37')]=_[_0x07ba('0x34')](_0x173c5b[_0x07ba('0x35')],qs[_0x07ba('0x36')](_0xa5cc4d[_0x07ba('0x31')][_0x07ba('0x36')]));_0x316554['attributes']=_0x316554['attributes'][_0x07ba('0x38')]?_0x316554[_0x07ba('0x37')]:_0x173c5b[_0x07ba('0x35')];if(_0xa5cc4d[_0x07ba('0x31')]['includeAll']){_0x316554['include']=[{'all':!![]}];}_0x316554=_['merge']({},_0x316554,_0xa5cc4d[_0x07ba('0x40')]);return db[_0x07ba('0x2c')][_0x07ba('0x48')](_0x316554)[_0x07ba('0x43')](handleEntityNotFound(_0x2f540f,null))[_0x07ba('0x43')](respondWithResult(_0x2f540f,null))[_0x07ba('0x45')](handleError(_0x2f540f,null));};exports[_0x07ba('0x49')]=function(_0x4d241e,_0xecbc2f){return db[_0x07ba('0x2c')][_0x07ba('0x49')](_0x4d241e[_0x07ba('0x4a')],{})[_0x07ba('0x43')](respondWithResult(_0xecbc2f,0xc9))[_0x07ba('0x45')](handleError(_0xecbc2f,null));};exports[_0x07ba('0x24')]=function(_0x2b9b18,_0x2349a0){if(_0x2b9b18['body']['id']){delete _0x2b9b18['body']['id'];}return db[_0x07ba('0x2c')][_0x07ba('0x48')]({'where':{'id':_0x2b9b18['params']['id']}})[_0x07ba('0x43')](handleEntityNotFound(_0x2349a0,null))['then'](saveUpdates(_0x2b9b18[_0x07ba('0x4a')],null))[_0x07ba('0x43')](respondWithResult(_0x2349a0,null))[_0x07ba('0x45')](handleError(_0x2349a0,null));};exports['destroy']=function(_0x581de4,_0x25698e){return db['SalesforceConfiguration'][_0x07ba('0x48')]({'where':{'id':_0x581de4[_0x07ba('0x47')]['id']}})[_0x07ba('0x43')](handleEntityNotFound(_0x25698e,null))[_0x07ba('0x43')](removeEntity(_0x25698e,null))[_0x07ba('0x45')](handleError(_0x25698e,null));};exports[_0x07ba('0x4b')]=function(_0x471029,_0x5a417c,_0x343e3f){var _0x5adae2={};var _0x591193={};var _0x56f912;var _0x2ceb81;return db['SalesforceConfiguration'][_0x07ba('0x4c')]({'where':{'id':_0x471029[_0x07ba('0x47')]['id']}})[_0x07ba('0x43')](handleEntityNotFound(_0x5a417c,null))[_0x07ba('0x43')](function(_0x315d72){if(_0x315d72){_0x56f912=_0x315d72;_0x591193[_0x07ba('0x35')]=_[_0x07ba('0x32')](db[_0x07ba('0x4d')][_0x07ba('0x2d')]);_0x591193[_0x07ba('0x31')]=_[_0x07ba('0x32')](_0x471029[_0x07ba('0x31')]);_0x591193[_0x07ba('0x33')]=_['intersection'](_0x591193['model'],_0x591193[_0x07ba('0x31')]);_0x5adae2[_0x07ba('0x37')]=_['intersection'](_0x591193[_0x07ba('0x35')],qs[_0x07ba('0x36')](_0x471029[_0x07ba('0x31')][_0x07ba('0x36')]));_0x5adae2[_0x07ba('0x37')]=_0x5adae2[_0x07ba('0x37')][_0x07ba('0x38')]?_0x5adae2[_0x07ba('0x37')]:_0x591193[_0x07ba('0x35')];_0x5adae2['order']=qs[_0x07ba('0x3c')](_0x471029[_0x07ba('0x31')][_0x07ba('0x3c')]);_0x5adae2[_0x07ba('0x3d')]=qs[_0x07ba('0x33')](_[_0x07ba('0x4e')](_0x471029[_0x07ba('0x31')],_0x591193[_0x07ba('0x33')]));if(_0x471029['query'][_0x07ba('0x3f')]){_0x5adae2[_0x07ba('0x3d')]=_[_0x07ba('0x3e')](_0x5adae2['where'],{'$or':_[_0x07ba('0x2b')](_0x5adae2[_0x07ba('0x37')],function(_0x532ae1){var _0x2aab99={};_0x2aab99[_0x532ae1]={'$like':'%'+_0x471029[_0x07ba('0x31')][_0x07ba('0x3f')]+'%'};return _0x2aab99;})});}_0x5adae2=_[_0x07ba('0x3e')]({},_0x5adae2,_0x471029['options']);return _0x56f912[_0x07ba('0x4b')](_0x5adae2);}})[_0x07ba('0x43')](function(_0x562678){if(_0x562678){_0x2ceb81=_0x562678[_0x07ba('0x38')];if(!_0x471029[_0x07ba('0x31')]['hasOwnProperty'](_0x07ba('0x3a'))){_0x5adae2[_0x07ba('0x1d')]=qs[_0x07ba('0x1d')](_0x471029[_0x07ba('0x31')]['limit']);_0x5adae2[_0x07ba('0x1b')]=qs[_0x07ba('0x1b')](_0x471029['query'][_0x07ba('0x1b')]);}return _0x56f912[_0x07ba('0x4b')](_0x5adae2);}})[_0x07ba('0x43')](function(_0x38d7bd){if(_0x38d7bd){return _0x38d7bd?{'count':_0x2ceb81,'rows':_0x38d7bd}:null;}})[_0x07ba('0x43')](respondWithResult(_0x5a417c,null))['catch'](handleError(_0x5a417c,null));};exports['getSubjects']=function(_0x4d59c3,_0xcd308e,_0x274d07){var _0x5a5036={};var _0x165ab0={};var _0x338022;var _0x1267ff;return db[_0x07ba('0x2c')][_0x07ba('0x4c')]({'where':{'id':_0x4d59c3[_0x07ba('0x47')]['id']}})[_0x07ba('0x43')](handleEntityNotFound(_0xcd308e,null))[_0x07ba('0x43')](function(_0x1668f9){if(_0x1668f9){_0x338022=_0x1668f9;_0x165ab0[_0x07ba('0x35')]=_['keys'](db['SalesforceField'][_0x07ba('0x2d')]);_0x165ab0['query']=_['keys'](_0x4d59c3[_0x07ba('0x31')]);_0x165ab0[_0x07ba('0x33')]=_[_0x07ba('0x34')](_0x165ab0[_0x07ba('0x35')],_0x165ab0['query']);_0x5a5036[_0x07ba('0x37')]=_[_0x07ba('0x34')](_0x165ab0[_0x07ba('0x35')],qs[_0x07ba('0x36')](_0x4d59c3[_0x07ba('0x31')][_0x07ba('0x36')]));_0x5a5036[_0x07ba('0x37')]=_0x5a5036[_0x07ba('0x37')][_0x07ba('0x38')]?_0x5a5036[_0x07ba('0x37')]:_0x165ab0[_0x07ba('0x35')];_0x5a5036[_0x07ba('0x3b')]=qs[_0x07ba('0x3c')](_0x4d59c3[_0x07ba('0x31')][_0x07ba('0x3c')]);_0x5a5036[_0x07ba('0x3d')]=qs[_0x07ba('0x33')](_['pick'](_0x4d59c3['query'],_0x165ab0[_0x07ba('0x33')]));if(_0x4d59c3[_0x07ba('0x31')][_0x07ba('0x3f')]){_0x5a5036['where']=_[_0x07ba('0x3e')](_0x5a5036[_0x07ba('0x3d')],{'$or':_[_0x07ba('0x2b')](_0x5a5036[_0x07ba('0x37')],function(_0x43f84d){var _0x362d64={};_0x362d64[_0x43f84d]={'$like':'%'+_0x4d59c3[_0x07ba('0x31')][_0x07ba('0x3f')]+'%'};return _0x362d64;})});}_0x5a5036=_['merge']({},_0x5a5036,_0x4d59c3[_0x07ba('0x40')]);return _0x338022[_0x07ba('0x4f')](_0x5a5036);}})['then'](function(_0x26bf82){if(_0x26bf82){_0x1267ff=_0x26bf82[_0x07ba('0x38')];if(!_0x4d59c3['query']['hasOwnProperty'](_0x07ba('0x3a'))){_0x5a5036[_0x07ba('0x1d')]=qs[_0x07ba('0x1d')](_0x4d59c3[_0x07ba('0x31')][_0x07ba('0x1d')]);_0x5a5036[_0x07ba('0x1b')]=qs[_0x07ba('0x1b')](_0x4d59c3[_0x07ba('0x31')]['offset']);}return _0x338022[_0x07ba('0x4f')](_0x5a5036);}})[_0x07ba('0x43')](function(_0x5016ff){if(_0x5016ff){return _0x5016ff?{'count':_0x1267ff,'rows':_0x5016ff}:null;}})['then'](respondWithResult(_0xcd308e,null))[_0x07ba('0x45')](handleError(_0xcd308e,null));};exports[_0x07ba('0x50')]=function(_0xb91eb4,_0x28cb34,_0x2fc2cc){var _0x275c21={};var _0x1c172b={};var _0x5da1ed;var _0x296c7c;return db[_0x07ba('0x2c')]['findOne']({'where':{'id':_0xb91eb4['params']['id']}})[_0x07ba('0x43')](handleEntityNotFound(_0x28cb34,null))['then'](function(_0x345896){if(_0x345896){_0x5da1ed=_0x345896;_0x1c172b['model']=_[_0x07ba('0x32')](db[_0x07ba('0x4d')][_0x07ba('0x2d')]);_0x1c172b[_0x07ba('0x31')]=_[_0x07ba('0x32')](_0xb91eb4[_0x07ba('0x31')]);_0x1c172b[_0x07ba('0x33')]=_['intersection'](_0x1c172b[_0x07ba('0x35')],_0x1c172b[_0x07ba('0x31')]);_0x275c21[_0x07ba('0x37')]=_[_0x07ba('0x34')](_0x1c172b[_0x07ba('0x35')],qs[_0x07ba('0x36')](_0xb91eb4[_0x07ba('0x31')][_0x07ba('0x36')]));_0x275c21[_0x07ba('0x37')]=_0x275c21[_0x07ba('0x37')][_0x07ba('0x38')]?_0x275c21[_0x07ba('0x37')]:_0x1c172b[_0x07ba('0x35')];_0x275c21['order']=qs[_0x07ba('0x3c')](_0xb91eb4[_0x07ba('0x31')]['sort']);_0x275c21[_0x07ba('0x3d')]=qs[_0x07ba('0x33')](_[_0x07ba('0x4e')](_0xb91eb4[_0x07ba('0x31')],_0x1c172b[_0x07ba('0x33')]));if(_0xb91eb4[_0x07ba('0x31')][_0x07ba('0x3f')]){_0x275c21[_0x07ba('0x3d')]=_['merge'](_0x275c21['where'],{'$or':_['map'](_0x275c21[_0x07ba('0x37')],function(_0x3636ad){var _0x575a00={};_0x575a00[_0x3636ad]={'$like':'%'+_0xb91eb4[_0x07ba('0x31')][_0x07ba('0x3f')]+'%'};return _0x575a00;})});}_0x275c21=_['merge']({},_0x275c21,_0xb91eb4[_0x07ba('0x40')]);return _0x5da1ed[_0x07ba('0x50')](_0x275c21);}})['then'](function(_0x534044){if(_0x534044){_0x296c7c=_0x534044['length'];if(!_0xb91eb4[_0x07ba('0x31')][_0x07ba('0x39')](_0x07ba('0x3a'))){_0x275c21[_0x07ba('0x1d')]=qs[_0x07ba('0x1d')](_0xb91eb4[_0x07ba('0x31')][_0x07ba('0x1d')]);_0x275c21[_0x07ba('0x1b')]=qs['offset'](_0xb91eb4[_0x07ba('0x31')][_0x07ba('0x1b')]);}return _0x5da1ed['getDescriptions'](_0x275c21);}})[_0x07ba('0x43')](function(_0x38c63a){if(_0x38c63a){return _0x38c63a?{'count':_0x296c7c,'rows':_0x38c63a}:null;}})[_0x07ba('0x43')](respondWithResult(_0x28cb34,null))[_0x07ba('0x45')](handleError(_0x28cb34,null));}; \ No newline at end of file +var _0xd89a=['intersection','attributes','fields','length','order','sort','where','pick','filter','merge','options','then','includeAll','SalesforceConfiguration','rows','catch','params','keys','find','create','body','destroy','getFields','SalesforceField','hasOwnProperty','getSubjects','findOne','nolimit','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','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','end','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters'];(function(_0x34fd7f,_0xda422a){var _0x1cb075=function(_0x2dbe84){while(--_0x2dbe84){_0x34fd7f['push'](_0x34fd7f['shift']());}};_0x1cb075(++_0xda422a);}(_0xd89a,0x6e));var _0xad89=function(_0x512126,_0x8db5c2){_0x512126=_0x512126-0x0;var _0x19cbe4=_0xd89a[_0x512126];return _0x19cbe4;};'use strict';var emlformat=require(_0xad89('0x0'));var rimraf=require(_0xad89('0x1'));var zipdir=require(_0xad89('0x2'));var jsonpatch=require(_0xad89('0x3'));var rp=require(_0xad89('0x4'));var moment=require(_0xad89('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xad89('0x6'));var util=require(_0xad89('0x7'));var path=require(_0xad89('0x8'));var sox=require(_0xad89('0x9'));var csv=require(_0xad89('0xa'));var ejs=require(_0xad89('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xad89('0xc'));var squel=require(_0xad89('0xd'));var crypto=require(_0xad89('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xad89('0xf'));var toCsv=require(_0xad89('0xa'));var querystring=require(_0xad89('0x10'));var Papa=require(_0xad89('0x11'));var Redis=require(_0xad89('0x12'));var authService=require(_0xad89('0x13'));var qs=require(_0xad89('0x14'));var as=require(_0xad89('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xad89('0x16'))(_0xad89('0x17'));var utils=require(_0xad89('0x18'));var config=require(_0xad89('0x19'));var licenseUtil=require(_0xad89('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3426de,_0xec1e6b){_0xec1e6b=_0xec1e6b||0xcc;return function(_0x9fea45){if(_0x9fea45){return _0x3426de[_0xad89('0x1b')](_0xec1e6b);}return _0x3426de['status'](_0xec1e6b)[_0xad89('0x1c')]();};}function respondWithResult(_0x1769c3,_0x29e058){_0x29e058=_0x29e058||0xc8;return function(_0x4f9019){if(_0x4f9019){return _0x1769c3[_0xad89('0x1d')](_0x29e058)[_0xad89('0x1e')](_0x4f9019);}};}function respondWithFilteredResult(_0x4c5aeb,_0xef6970){return function(_0x415939){if(_0x415939){var _0x49e703=typeof _0xef6970[_0xad89('0x1f')]===_0xad89('0x20')&&typeof _0xef6970[_0xad89('0x21')]===_0xad89('0x20');var _0x33068e=_0x415939[_0xad89('0x22')];var _0x4876bf=_0x49e703?0x0:_0xef6970[_0xad89('0x1f')];var _0xbf9574=_0x49e703?_0x415939['count']:_0xef6970[_0xad89('0x1f')]+_0xef6970[_0xad89('0x21')];var _0x4d28cc;if(_0xbf9574>=_0x33068e){_0xbf9574=_0x33068e;_0x4d28cc=0xc8;}else{_0x4d28cc=0xce;}_0x4c5aeb[_0xad89('0x1d')](_0x4d28cc);return _0x4c5aeb['set'](_0xad89('0x23'),_0x4876bf+'-'+_0xbf9574+'/'+_0x33068e)[_0xad89('0x1e')](_0x415939);}return null;};}function patchUpdates(_0x903a64){return function(_0x5bbfec){try{jsonpatch['apply'](_0x5bbfec,_0x903a64,!![]);}catch(_0xc2571f){return BPromise[_0xad89('0x24')](_0xc2571f);}return _0x5bbfec[_0xad89('0x25')]();};}function saveUpdates(_0x516dfc,_0x136740){return function(_0x343021){if(_0x343021){return _0x343021[_0xad89('0x26')](_0x516dfc)['then'](function(_0x2e2c2f){return _0x2e2c2f;});}return null;};}function removeEntity(_0x5cc2b9,_0x16d401){return function(_0x525d10){if(_0x525d10){return _0x525d10['destroy']()['then'](function(){_0x5cc2b9[_0xad89('0x1d')](0xcc)[_0xad89('0x1c')]();});}};}function handleEntityNotFound(_0x5f2550,_0x1651db){return function(_0x49ce65){if(!_0x49ce65){_0x5f2550[_0xad89('0x1b')](0x194);}return _0x49ce65;};}function handleError(_0x50f1a5,_0x1e60fd){_0x1e60fd=_0x1e60fd||0x1f4;return function(_0xfb61cb){logger[_0xad89('0x27')](_0xfb61cb[_0xad89('0x28')]);if(_0xfb61cb[_0xad89('0x29')]){delete _0xfb61cb[_0xad89('0x29')];}_0x50f1a5[_0xad89('0x1d')](_0x1e60fd)[_0xad89('0x2a')](_0xfb61cb);};}exports[_0xad89('0x2b')]=function(_0x3ce048,_0x39dd97){var _0x302623={},_0x43f7d7={},_0x231761={'count':0x0,'rows':[]};var _0x405dc7=_[_0xad89('0x2c')](db['SalesforceConfiguration'][_0xad89('0x2d')],function(_0x617199){return{'name':_0x617199[_0xad89('0x2e')],'type':_0x617199[_0xad89('0x2f')][_0xad89('0x30')]};});_0x43f7d7[_0xad89('0x31')]=_['map'](_0x405dc7,_0xad89('0x29'));_0x43f7d7[_0xad89('0x32')]=_['keys'](_0x3ce048['query']);_0x43f7d7[_0xad89('0x33')]=_[_0xad89('0x34')](_0x43f7d7[_0xad89('0x31')],_0x43f7d7[_0xad89('0x32')]);_0x302623[_0xad89('0x35')]=_['intersection'](_0x43f7d7['model'],qs[_0xad89('0x36')](_0x3ce048[_0xad89('0x32')][_0xad89('0x36')]));_0x302623[_0xad89('0x35')]=_0x302623['attributes'][_0xad89('0x37')]?_0x302623['attributes']:_0x43f7d7[_0xad89('0x31')];if(!_0x3ce048[_0xad89('0x32')]['hasOwnProperty']('nolimit')){_0x302623[_0xad89('0x21')]=qs[_0xad89('0x21')](_0x3ce048[_0xad89('0x32')]['limit']);_0x302623[_0xad89('0x1f')]=qs['offset'](_0x3ce048['query'][_0xad89('0x1f')]);}_0x302623[_0xad89('0x38')]=qs['sort'](_0x3ce048['query'][_0xad89('0x39')]);_0x302623[_0xad89('0x3a')]=qs[_0xad89('0x33')](_[_0xad89('0x3b')](_0x3ce048[_0xad89('0x32')],_0x43f7d7['filters']),_0x405dc7);if(_0x3ce048['query'][_0xad89('0x3c')]){_0x302623[_0xad89('0x3a')]=_[_0xad89('0x3d')](_0x302623[_0xad89('0x3a')],{'$or':_[_0xad89('0x2c')](_0x405dc7,function(_0x4dbca2){if(_0x4dbca2[_0xad89('0x2f')]!=='VIRTUAL'){var _0x39e4aa={};_0x39e4aa[_0x4dbca2[_0xad89('0x29')]]={'$like':'%'+_0x3ce048[_0xad89('0x32')]['filter']+'%'};return _0x39e4aa;}})});}_0x302623=_[_0xad89('0x3d')]({},_0x302623,_0x3ce048[_0xad89('0x3e')]);var _0x31a2f5={'where':_0x302623[_0xad89('0x3a')]};return db['SalesforceConfiguration'][_0xad89('0x22')](_0x31a2f5)[_0xad89('0x3f')](function(_0x213dfe){_0x231761[_0xad89('0x22')]=_0x213dfe;if(_0x3ce048[_0xad89('0x32')][_0xad89('0x40')]){_0x302623['include']=[{'all':!![]}];}return db[_0xad89('0x41')]['findAll'](_0x302623);})['then'](function(_0x4681b4){_0x231761[_0xad89('0x42')]=_0x4681b4;return _0x231761;})[_0xad89('0x3f')](respondWithFilteredResult(_0x39dd97,_0x302623))[_0xad89('0x43')](handleError(_0x39dd97,null));};exports['show']=function(_0x25bd03,_0x948a19){var _0x3ae5c5={'raw':![],'where':{'id':_0x25bd03[_0xad89('0x44')]['id']}},_0x35f410={};_0x35f410[_0xad89('0x31')]=_[_0xad89('0x45')](db[_0xad89('0x41')][_0xad89('0x2d')]);_0x35f410[_0xad89('0x32')]=_[_0xad89('0x45')](_0x25bd03['query']);_0x35f410[_0xad89('0x33')]=_['intersection'](_0x35f410[_0xad89('0x31')],_0x35f410['query']);_0x3ae5c5['attributes']=_['intersection'](_0x35f410[_0xad89('0x31')],qs[_0xad89('0x36')](_0x25bd03[_0xad89('0x32')][_0xad89('0x36')]));_0x3ae5c5['attributes']=_0x3ae5c5[_0xad89('0x35')][_0xad89('0x37')]?_0x3ae5c5[_0xad89('0x35')]:_0x35f410[_0xad89('0x31')];if(_0x25bd03[_0xad89('0x32')][_0xad89('0x40')]){_0x3ae5c5['include']=[{'all':!![]}];}_0x3ae5c5=_[_0xad89('0x3d')]({},_0x3ae5c5,_0x25bd03[_0xad89('0x3e')]);return db[_0xad89('0x41')][_0xad89('0x46')](_0x3ae5c5)[_0xad89('0x3f')](handleEntityNotFound(_0x948a19,null))[_0xad89('0x3f')](respondWithResult(_0x948a19,null))[_0xad89('0x43')](handleError(_0x948a19,null));};exports[_0xad89('0x47')]=function(_0xd13a6e,_0xaf7ca3){return db[_0xad89('0x41')][_0xad89('0x47')](_0xd13a6e['body'],{})[_0xad89('0x3f')](respondWithResult(_0xaf7ca3,0xc9))[_0xad89('0x43')](handleError(_0xaf7ca3,null));};exports[_0xad89('0x26')]=function(_0x44de2e,_0x33447c){if(_0x44de2e[_0xad89('0x48')]['id']){delete _0x44de2e['body']['id'];}return db[_0xad89('0x41')][_0xad89('0x46')]({'where':{'id':_0x44de2e[_0xad89('0x44')]['id']}})[_0xad89('0x3f')](handleEntityNotFound(_0x33447c,null))['then'](saveUpdates(_0x44de2e[_0xad89('0x48')],null))[_0xad89('0x3f')](respondWithResult(_0x33447c,null))[_0xad89('0x43')](handleError(_0x33447c,null));};exports[_0xad89('0x49')]=function(_0xf330cb,_0x2879b){return db[_0xad89('0x41')][_0xad89('0x46')]({'where':{'id':_0xf330cb[_0xad89('0x44')]['id']}})['then'](handleEntityNotFound(_0x2879b,null))[_0xad89('0x3f')](removeEntity(_0x2879b,null))[_0xad89('0x43')](handleError(_0x2879b,null));};exports[_0xad89('0x4a')]=function(_0x2b91f0,_0x1b9e58,_0x361bce){var _0x5c23b9={};var _0x355810={};var _0x4c9813;var _0x95108c;return db[_0xad89('0x41')]['findOne']({'where':{'id':_0x2b91f0[_0xad89('0x44')]['id']}})[_0xad89('0x3f')](handleEntityNotFound(_0x1b9e58,null))[_0xad89('0x3f')](function(_0x3eef2f){if(_0x3eef2f){_0x4c9813=_0x3eef2f;_0x355810['model']=_[_0xad89('0x45')](db[_0xad89('0x4b')][_0xad89('0x2d')]);_0x355810[_0xad89('0x32')]=_['keys'](_0x2b91f0[_0xad89('0x32')]);_0x355810['filters']=_[_0xad89('0x34')](_0x355810[_0xad89('0x31')],_0x355810[_0xad89('0x32')]);_0x5c23b9['attributes']=_[_0xad89('0x34')](_0x355810[_0xad89('0x31')],qs[_0xad89('0x36')](_0x2b91f0[_0xad89('0x32')]['fields']));_0x5c23b9['attributes']=_0x5c23b9[_0xad89('0x35')][_0xad89('0x37')]?_0x5c23b9[_0xad89('0x35')]:_0x355810[_0xad89('0x31')];_0x5c23b9['order']=qs[_0xad89('0x39')](_0x2b91f0[_0xad89('0x32')]['sort']);_0x5c23b9[_0xad89('0x3a')]=qs['filters'](_[_0xad89('0x3b')](_0x2b91f0[_0xad89('0x32')],_0x355810[_0xad89('0x33')]));if(_0x2b91f0['query'][_0xad89('0x3c')]){_0x5c23b9[_0xad89('0x3a')]=_[_0xad89('0x3d')](_0x5c23b9[_0xad89('0x3a')],{'$or':_[_0xad89('0x2c')](_0x5c23b9['attributes'],function(_0x1a0896){var _0x1a7cc1={};_0x1a7cc1[_0x1a0896]={'$like':'%'+_0x2b91f0[_0xad89('0x32')]['filter']+'%'};return _0x1a7cc1;})});}_0x5c23b9=_[_0xad89('0x3d')]({},_0x5c23b9,_0x2b91f0['options']);return _0x4c9813[_0xad89('0x4a')](_0x5c23b9);}})[_0xad89('0x3f')](function(_0x1e0031){if(_0x1e0031){_0x95108c=_0x1e0031[_0xad89('0x37')];if(!_0x2b91f0[_0xad89('0x32')][_0xad89('0x4c')]('nolimit')){_0x5c23b9[_0xad89('0x21')]=qs[_0xad89('0x21')](_0x2b91f0[_0xad89('0x32')][_0xad89('0x21')]);_0x5c23b9['offset']=qs['offset'](_0x2b91f0[_0xad89('0x32')][_0xad89('0x1f')]);}return _0x4c9813['getFields'](_0x5c23b9);}})['then'](function(_0x360d79){if(_0x360d79){return _0x360d79?{'count':_0x95108c,'rows':_0x360d79}:null;}})['then'](respondWithResult(_0x1b9e58,null))[_0xad89('0x43')](handleError(_0x1b9e58,null));};exports[_0xad89('0x4d')]=function(_0x23d2f3,_0x243e0d,_0x168eb1){var _0x5920f5={};var _0x46eed3={};var _0x4af91f;var _0xe73b00;return db[_0xad89('0x41')][_0xad89('0x4e')]({'where':{'id':_0x23d2f3['params']['id']}})[_0xad89('0x3f')](handleEntityNotFound(_0x243e0d,null))[_0xad89('0x3f')](function(_0x56f4d9){if(_0x56f4d9){_0x4af91f=_0x56f4d9;_0x46eed3['model']=_[_0xad89('0x45')](db[_0xad89('0x4b')][_0xad89('0x2d')]);_0x46eed3[_0xad89('0x32')]=_[_0xad89('0x45')](_0x23d2f3[_0xad89('0x32')]);_0x46eed3['filters']=_[_0xad89('0x34')](_0x46eed3[_0xad89('0x31')],_0x46eed3[_0xad89('0x32')]);_0x5920f5['attributes']=_[_0xad89('0x34')](_0x46eed3[_0xad89('0x31')],qs[_0xad89('0x36')](_0x23d2f3[_0xad89('0x32')][_0xad89('0x36')]));_0x5920f5['attributes']=_0x5920f5['attributes'][_0xad89('0x37')]?_0x5920f5[_0xad89('0x35')]:_0x46eed3['model'];_0x5920f5[_0xad89('0x38')]=qs[_0xad89('0x39')](_0x23d2f3['query'][_0xad89('0x39')]);_0x5920f5[_0xad89('0x3a')]=qs[_0xad89('0x33')](_['pick'](_0x23d2f3[_0xad89('0x32')],_0x46eed3['filters']));if(_0x23d2f3[_0xad89('0x32')][_0xad89('0x3c')]){_0x5920f5[_0xad89('0x3a')]=_[_0xad89('0x3d')](_0x5920f5['where'],{'$or':_[_0xad89('0x2c')](_0x5920f5['attributes'],function(_0x347069){var _0x53cdb1={};_0x53cdb1[_0x347069]={'$like':'%'+_0x23d2f3[_0xad89('0x32')]['filter']+'%'};return _0x53cdb1;})});}_0x5920f5=_['merge']({},_0x5920f5,_0x23d2f3[_0xad89('0x3e')]);return _0x4af91f[_0xad89('0x4d')](_0x5920f5);}})['then'](function(_0x10cc4a){if(_0x10cc4a){_0xe73b00=_0x10cc4a[_0xad89('0x37')];if(!_0x23d2f3['query'][_0xad89('0x4c')](_0xad89('0x4f'))){_0x5920f5['limit']=qs['limit'](_0x23d2f3[_0xad89('0x32')][_0xad89('0x21')]);_0x5920f5[_0xad89('0x1f')]=qs[_0xad89('0x1f')](_0x23d2f3[_0xad89('0x32')][_0xad89('0x1f')]);}return _0x4af91f['getSubjects'](_0x5920f5);}})[_0xad89('0x3f')](function(_0x1d29b0){if(_0x1d29b0){return _0x1d29b0?{'count':_0xe73b00,'rows':_0x1d29b0}:null;}})['then'](respondWithResult(_0x243e0d,null))[_0xad89('0x43')](handleError(_0x243e0d,null));};exports[_0xad89('0x50')]=function(_0x42fcc0,_0x3f8f66,_0x1daac3){var _0x40ae64={};var _0x1f2b03={};var _0xcc9d89;var _0x17a81b;return db['SalesforceConfiguration'][_0xad89('0x4e')]({'where':{'id':_0x42fcc0[_0xad89('0x44')]['id']}})[_0xad89('0x3f')](handleEntityNotFound(_0x3f8f66,null))[_0xad89('0x3f')](function(_0x448b3a){if(_0x448b3a){_0xcc9d89=_0x448b3a;_0x1f2b03[_0xad89('0x31')]=_[_0xad89('0x45')](db[_0xad89('0x4b')][_0xad89('0x2d')]);_0x1f2b03[_0xad89('0x32')]=_[_0xad89('0x45')](_0x42fcc0['query']);_0x1f2b03[_0xad89('0x33')]=_[_0xad89('0x34')](_0x1f2b03[_0xad89('0x31')],_0x1f2b03[_0xad89('0x32')]);_0x40ae64[_0xad89('0x35')]=_[_0xad89('0x34')](_0x1f2b03['model'],qs['fields'](_0x42fcc0[_0xad89('0x32')][_0xad89('0x36')]));_0x40ae64[_0xad89('0x35')]=_0x40ae64[_0xad89('0x35')][_0xad89('0x37')]?_0x40ae64['attributes']:_0x1f2b03[_0xad89('0x31')];_0x40ae64[_0xad89('0x38')]=qs['sort'](_0x42fcc0[_0xad89('0x32')]['sort']);_0x40ae64[_0xad89('0x3a')]=qs[_0xad89('0x33')](_[_0xad89('0x3b')](_0x42fcc0['query'],_0x1f2b03[_0xad89('0x33')]));if(_0x42fcc0[_0xad89('0x32')][_0xad89('0x3c')]){_0x40ae64['where']=_['merge'](_0x40ae64[_0xad89('0x3a')],{'$or':_[_0xad89('0x2c')](_0x40ae64[_0xad89('0x35')],function(_0x2e25bd){var _0x229e0d={};_0x229e0d[_0x2e25bd]={'$like':'%'+_0x42fcc0[_0xad89('0x32')][_0xad89('0x3c')]+'%'};return _0x229e0d;})});}_0x40ae64=_[_0xad89('0x3d')]({},_0x40ae64,_0x42fcc0[_0xad89('0x3e')]);return _0xcc9d89[_0xad89('0x50')](_0x40ae64);}})[_0xad89('0x3f')](function(_0x2d7215){if(_0x2d7215){_0x17a81b=_0x2d7215[_0xad89('0x37')];if(!_0x42fcc0['query']['hasOwnProperty']('nolimit')){_0x40ae64[_0xad89('0x21')]=qs[_0xad89('0x21')](_0x42fcc0[_0xad89('0x32')]['limit']);_0x40ae64[_0xad89('0x1f')]=qs['offset'](_0x42fcc0[_0xad89('0x32')][_0xad89('0x1f')]);}return _0xcc9d89['getDescriptions'](_0x40ae64);}})['then'](function(_0x4c4146){if(_0x4c4146){return _0x4c4146?{'count':_0x17a81b,'rows':_0x4c4146}:null;}})[_0xad89('0x3f')](respondWithResult(_0x3f8f66,null))[_0xad89('0x43')](handleError(_0x3f8f66,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index ae1cc34..2c72a49 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 _0xf9c3=['../../config/environment','./intSalesforceConfiguration.attributes','exports','SalesforceConfiguration','lodash','api','moment','path','rimraf'];(function(_0x5c9d9e,_0xea8a64){var _0x43606e=function(_0x574cd1){while(--_0x574cd1){_0x5c9d9e['push'](_0x5c9d9e['shift']());}};_0x43606e(++_0xea8a64);}(_0xf9c3,0x1ab));var _0x3f9c=function(_0x547890,_0x593741){_0x547890=_0x547890-0x0;var _0x2c8daa=_0xf9c3[_0x547890];return _0x2c8daa;};'use strict';var _=require(_0x3f9c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3f9c('0x1'));var moment=require(_0x3f9c('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3f9c('0x3'));var rimraf=require(_0x3f9c('0x4'));var config=require(_0x3f9c('0x5'));var attributes=require(_0x3f9c('0x6'));module[_0x3f9c('0x7')]=function(_0x9307c6,_0x39ca3a){return _0x9307c6['define'](_0x3f9c('0x8'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1e22=['lodash','moment','rimraf','./intSalesforceConfiguration.attributes','exports'];(function(_0x385530,_0x54c517){var _0x3790c0=function(_0x5e9c9e){while(--_0x5e9c9e){_0x385530['push'](_0x385530['shift']());}};_0x3790c0(++_0x54c517);}(_0x1e22,0x140));var _0x21e2=function(_0x211158,_0x5edf3c){_0x211158=_0x211158-0x0;var _0x197bef=_0x1e22[_0x211158];return _0x197bef;};'use strict';var _=require(_0x21e2('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x21e2('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x21e2('0x2'));var config=require('../../config/environment');var attributes=require(_0x21e2('0x3'));module[_0x21e2('0x4')]=function(_0x574e14,_0x242880){return _0x574e14['define']('SalesforceConfiguration',attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index 2a8b32d..f8d9310 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 _0x2c8b=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','SalesforceConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment'];(function(_0x37f67f,_0x33c870){var _0x15650c=function(_0x143ad3){while(--_0x143ad3){_0x37f67f['push'](_0x37f67f['shift']());}};_0x15650c(++_0x33c870);}(_0x2c8b,0x1b5));var _0xb2c8=function(_0x5ae8fd,_0x5014b0){_0x5ae8fd=_0x5ae8fd-0x0;var _0x4e5d72=_0x2c8b[_0x5ae8fd];return _0x4e5d72;};'use strict';var _=require(_0xb2c8('0x0'));var util=require(_0xb2c8('0x1'));var moment=require(_0xb2c8('0x2'));var BPromise=require('bluebird');var rs=require(_0xb2c8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb2c8('0x4'))['db'];var utils=require(_0xb2c8('0x5'));var logger=require(_0xb2c8('0x6'))(_0xb2c8('0x7'));var config=require('../../config/environment');var jayson=require(_0xb2c8('0x8'));var client=jayson[_0xb2c8('0x9')][_0xb2c8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe545,_0x376bc4,_0x53679c){return new BPromise(function(_0x1c43ce,_0x4b2986){return client['request'](_0xe545,_0x53679c)[_0xb2c8('0xb')](function(_0x9e8e9){logger['info'](_0xb2c8('0xc'),_0x376bc4,'request\x20sent');logger[_0xb2c8('0xd')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x376bc4,_0xb2c8('0xe'),JSON[_0xb2c8('0xf')](_0x9e8e9));if(_0x9e8e9[_0xb2c8('0x10')]){if(_0x9e8e9['error'][_0xb2c8('0x11')]===0x1f4){logger[_0xb2c8('0x10')](_0xb2c8('0xc'),_0x376bc4,_0x9e8e9['error'][_0xb2c8('0x12')]);return _0x4b2986(_0x9e8e9[_0xb2c8('0x10')][_0xb2c8('0x12')]);}logger[_0xb2c8('0x10')](_0xb2c8('0xc'),_0x376bc4,_0x9e8e9[_0xb2c8('0x10')][_0xb2c8('0x12')]);return _0x1c43ce(_0x9e8e9[_0xb2c8('0x10')][_0xb2c8('0x12')]);}else{logger[_0xb2c8('0x13')](_0xb2c8('0xc'),_0x376bc4,_0xb2c8('0xe'));_0x1c43ce(_0x9e8e9[_0xb2c8('0x14')]['message']);}})[_0xb2c8('0x15')](function(_0x38557b){logger[_0xb2c8('0x10')](_0xb2c8('0xc'),_0x376bc4,_0x38557b);_0x4b2986(_0x38557b);});});} \ No newline at end of file +var _0x26e0=['error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x26e0,0x88));var _0x026e=function(_0x2cc711,_0x300328){_0x2cc711=_0x2cc711-0x0;var _0x31a52e=_0x26e0[_0x2cc711];return _0x31a52e;};'use strict';var _=require(_0x026e('0x0'));var util=require(_0x026e('0x1'));var moment=require(_0x026e('0x2'));var BPromise=require(_0x026e('0x3'));var rs=require(_0x026e('0x4'));var fs=require('fs');var Redis=require(_0x026e('0x5'));var db=require(_0x026e('0x6'))['db'];var utils=require(_0x026e('0x7'));var logger=require(_0x026e('0x8'))(_0x026e('0x9'));var config=require(_0x026e('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x026e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23508b,_0xadfe4f,_0x57888e){return new BPromise(function(_0x1a0ff3,_0x28ced8){return client[_0x026e('0xc')](_0x23508b,_0x57888e)['then'](function(_0x2b2fbd){logger[_0x026e('0xd')](_0x026e('0xe'),_0xadfe4f,_0x026e('0xf'));logger['debug'](_0x026e('0x10'),_0xadfe4f,'request\x20sent',JSON[_0x026e('0x11')](_0x2b2fbd));if(_0x2b2fbd['error']){if(_0x2b2fbd[_0x026e('0x12')][_0x026e('0x13')]===0x1f4){logger[_0x026e('0x12')](_0x026e('0xe'),_0xadfe4f,_0x2b2fbd['error']['message']);return _0x28ced8(_0x2b2fbd[_0x026e('0x12')][_0x026e('0x14')]);}logger[_0x026e('0x12')](_0x026e('0xe'),_0xadfe4f,_0x2b2fbd[_0x026e('0x12')]['message']);return _0x1a0ff3(_0x2b2fbd[_0x026e('0x12')][_0x026e('0x14')]);}else{logger[_0x026e('0xd')](_0x026e('0xe'),_0xadfe4f,_0x026e('0xf'));_0x1a0ff3(_0x2b2fbd['result'][_0x026e('0x14')]);}})[_0x026e('0x15')](function(_0x58045d){logger['error'](_0x026e('0xe'),_0xadfe4f,_0x58045d);_0x28ced8(_0x58045d);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 3bdfc95..87134d5 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 _0x2501=['show','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intSalesforceField.controller','isAuthenticated','index','get','/:id'];(function(_0x42763d,_0x3db4ce){var _0x256cb1=function(_0x3ffe40){while(--_0x3ffe40){_0x42763d['push'](_0x42763d['shift']());}};_0x256cb1(++_0x3db4ce);}(_0x2501,0x1bb));var _0x1250=function(_0x24f3d1,_0x22b158){_0x24f3d1=_0x24f3d1-0x0;var _0xd4e465=_0x2501[_0x24f3d1];return _0xd4e465;};'use strict';var multer=require(_0x1250('0x0'));var util=require(_0x1250('0x1'));var path=require(_0x1250('0x2'));var timeout=require(_0x1250('0x3'));var express=require(_0x1250('0x4'));var router=express[_0x1250('0x5')]();var fs_extra=require(_0x1250('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1250('0x7'));var controller=require(_0x1250('0x8'));router['get']('/',auth[_0x1250('0x9')](),controller[_0x1250('0xa')]);router[_0x1250('0xb')](_0x1250('0xc'),auth[_0x1250('0x9')](),controller[_0x1250('0xd')]);router[_0x1250('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x1250('0xc'),auth[_0x1250('0x9')](),controller[_0x1250('0xf')]);router[_0x1250('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x1250('0x11')]);module[_0x1250('0x12')]=router; \ No newline at end of file +var _0x98b2=['path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intSalesforceField.controller','isAuthenticated','index','get','/:id','create','put','update','delete','destroy','exports','multer','util'];(function(_0xec3cab,_0x3d89a1){var _0x2e4e51=function(_0xfd6c89){while(--_0xfd6c89){_0xec3cab['push'](_0xec3cab['shift']());}};_0x2e4e51(++_0x3d89a1);}(_0x98b2,0x11b));var _0x298b=function(_0x54ef32,_0x3528f0){_0x54ef32=_0x54ef32-0x0;var _0x3e2158=_0x98b2[_0x54ef32];return _0x3e2158;};'use strict';var multer=require(_0x298b('0x0'));var util=require(_0x298b('0x1'));var path=require(_0x298b('0x2'));var timeout=require('connect-timeout');var express=require(_0x298b('0x3'));var router=express[_0x298b('0x4')]();var fs_extra=require(_0x298b('0x5'));var auth=require(_0x298b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x298b('0x7'));var controller=require(_0x298b('0x8'));router['get']('/',auth[_0x298b('0x9')](),controller[_0x298b('0xa')]);router[_0x298b('0xb')](_0x298b('0xc'),auth[_0x298b('0x9')](),controller['show']);router['post']('/',auth[_0x298b('0x9')](),controller[_0x298b('0xd')]);router[_0x298b('0xe')](_0x298b('0xc'),auth['isAuthenticated'](),controller[_0x298b('0xf')]);router[_0x298b('0x10')](_0x298b('0xc'),auth[_0x298b('0x9')](),controller[_0x298b('0x11')]);module[_0x298b('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 49a7c0f..43d1531 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 _0xdffb=['exports','string','variable','keyValue','picklist','STRING','sequelize'];(function(_0x3db260,_0x415b80){var _0x5b1ca8=function(_0x451b8a){while(--_0x451b8a){_0x3db260['push'](_0x3db260['shift']());}};_0x5b1ca8(++_0x415b80);}(_0xdffb,0x1b8));var _0xbdff=function(_0xfbb18b,_0x37f528){_0xfbb18b=_0xfbb18b-0x0;var _0x3aea74=_0xdffb[_0xfbb18b];return _0x3aea74;};'use strict';var Sequelize=require(_0xbdff('0x0'));module[_0xbdff('0x1')]={'type':{'type':Sequelize['ENUM'](_0xbdff('0x2'),_0xbdff('0x3'),'customVariable',_0xbdff('0x4'),_0xbdff('0x5')),'defaultValue':_0xbdff('0x2')},'content':{'type':Sequelize[_0xbdff('0x6')]},'key':{'type':Sequelize[_0xbdff('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0xbdff('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xbdff('0x6')]},'idField':{'type':Sequelize[_0xbdff('0x6')]},'variableName':{'type':Sequelize[_0xbdff('0x6')]}}; \ No newline at end of file +var _0x72ab=['exports','string','variable','customVariable','STRING','ENUM'];(function(_0x1bcb17,_0x492d13){var _0x21432d=function(_0x11b25a){while(--_0x11b25a){_0x1bcb17['push'](_0x1bcb17['shift']());}};_0x21432d(++_0x492d13);}(_0x72ab,0x1b0));var _0xb72a=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x72ab[_0x5f09c5];return _0x426ad9;};'use strict';var Sequelize=require('sequelize');module[_0xb72a('0x0')]={'type':{'type':Sequelize['ENUM'](_0xb72a('0x1'),_0xb72a('0x2'),_0xb72a('0x3'),'keyValue','picklist'),'defaultValue':_0xb72a('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xb72a('0x4')]},'keyType':{'type':Sequelize[_0xb72a('0x5')](_0xb72a('0x1'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0xb72a('0x4')]},'idField':{'type':Sequelize[_0xb72a('0x4')]},'variableName':{'type':Sequelize[_0xb72a('0x4')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 5c6ec8c..f14f0a5 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 _0x5603=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','apply','update','then','error','stack','name','send','map','SalesforceField','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis'];(function(_0x36ea5e,_0x8445d5){var _0x5bec0e=function(_0x7618a0){while(--_0x7618a0){_0x36ea5e['push'](_0x36ea5e['shift']());}};_0x5bec0e(++_0x8445d5);}(_0x5603,0x1aa));var _0x3560=function(_0x37dacf,_0x4ee16f){_0x37dacf=_0x37dacf-0x0;var _0xe407f2=_0x5603[_0x37dacf];return _0xe407f2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3560('0x0'));var zipdir=require(_0x3560('0x1'));var jsonpatch=require(_0x3560('0x2'));var rp=require('request-promise');var moment=require(_0x3560('0x3'));var BPromise=require(_0x3560('0x4'));var Mustache=require(_0x3560('0x5'));var util=require(_0x3560('0x6'));var path=require(_0x3560('0x7'));var sox=require(_0x3560('0x8'));var csv=require(_0x3560('0x9'));var ejs=require(_0x3560('0xa'));var fs=require('fs');var fs_extra=require(_0x3560('0xb'));var _=require('lodash');var squel=require(_0x3560('0xc'));var crypto=require(_0x3560('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3560('0xe'));var toCsv=require(_0x3560('0x9'));var querystring=require(_0x3560('0xf'));var Papa=require(_0x3560('0x10'));var Redis=require(_0x3560('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x3560('0x12'));var as=require(_0x3560('0x13'));var hardwareService=require(_0x3560('0x14'));var logger=require(_0x3560('0x15'))(_0x3560('0x16'));var utils=require(_0x3560('0x17'));var config=require(_0x3560('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x482c5f,_0x1d0c11){_0x1d0c11=_0x1d0c11||0xcc;return function(_0x211d1c){if(_0x211d1c){return _0x482c5f[_0x3560('0x19')](_0x1d0c11);}return _0x482c5f[_0x3560('0x1a')](_0x1d0c11)[_0x3560('0x1b')]();};}function respondWithResult(_0x4c4c21,_0x680648){_0x680648=_0x680648||0xc8;return function(_0x1c1362){if(_0x1c1362){return _0x4c4c21[_0x3560('0x1a')](_0x680648)['json'](_0x1c1362);}};}function respondWithFilteredResult(_0x3befbc,_0x484c84){return function(_0x318f3d){if(_0x318f3d){var _0x16b8cc=typeof _0x484c84[_0x3560('0x1c')]==='undefined'&&typeof _0x484c84[_0x3560('0x1d')]===_0x3560('0x1e');var _0x2926ea=_0x318f3d[_0x3560('0x1f')];var _0x3acdd7=_0x16b8cc?0x0:_0x484c84['offset'];var _0x14972f=_0x16b8cc?_0x318f3d[_0x3560('0x1f')]:_0x484c84['offset']+_0x484c84[_0x3560('0x1d')];var _0xcba14c;if(_0x14972f>=_0x2926ea){_0x14972f=_0x2926ea;_0xcba14c=0xc8;}else{_0xcba14c=0xce;}_0x3befbc['status'](_0xcba14c);return _0x3befbc['set'](_0x3560('0x20'),_0x3acdd7+'-'+_0x14972f+'/'+_0x2926ea)[_0x3560('0x21')](_0x318f3d);}return null;};}function patchUpdates(_0x4ddb24){return function(_0x29a7bb){try{jsonpatch[_0x3560('0x22')](_0x29a7bb,_0x4ddb24,!![]);}catch(_0x484c4c){return BPromise['reject'](_0x484c4c);}return _0x29a7bb['save']();};}function saveUpdates(_0xf0962,_0x210a30){return function(_0x2e6513){if(_0x2e6513){return _0x2e6513[_0x3560('0x23')](_0xf0962)[_0x3560('0x24')](function(_0x14abc8){return _0x14abc8;});}return null;};}function removeEntity(_0x50e7b0,_0x275fee){return function(_0x4e4841){if(_0x4e4841){return _0x4e4841['destroy']()['then'](function(){_0x50e7b0[_0x3560('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x579f5b,_0x230db2){return function(_0x4a8ed3){if(!_0x4a8ed3){_0x579f5b[_0x3560('0x19')](0x194);}return _0x4a8ed3;};}function handleError(_0x4cb784,_0xe1ad3a){_0xe1ad3a=_0xe1ad3a||0x1f4;return function(_0x48639c){logger[_0x3560('0x25')](_0x48639c[_0x3560('0x26')]);if(_0x48639c[_0x3560('0x27')]){delete _0x48639c['name'];}_0x4cb784[_0x3560('0x1a')](_0xe1ad3a)[_0x3560('0x28')](_0x48639c);};}exports['index']=function(_0xdfb532,_0x49b745){var _0x28aaf8={},_0x5f55c4={},_0x5128bc={'count':0x0,'rows':[]};var _0x13ee76=_[_0x3560('0x29')](db[_0x3560('0x2a')][_0x3560('0x2b')],function(_0x4626b1){return{'name':_0x4626b1[_0x3560('0x2c')],'type':_0x4626b1[_0x3560('0x2d')][_0x3560('0x2e')]};});_0x5f55c4[_0x3560('0x2f')]=_[_0x3560('0x29')](_0x13ee76,_0x3560('0x27'));_0x5f55c4[_0x3560('0x30')]=_['keys'](_0xdfb532[_0x3560('0x30')]);_0x5f55c4[_0x3560('0x31')]=_[_0x3560('0x32')](_0x5f55c4[_0x3560('0x2f')],_0x5f55c4[_0x3560('0x30')]);_0x28aaf8[_0x3560('0x33')]=_[_0x3560('0x32')](_0x5f55c4[_0x3560('0x2f')],qs[_0x3560('0x34')](_0xdfb532[_0x3560('0x30')]['fields']));_0x28aaf8['attributes']=_0x28aaf8[_0x3560('0x33')][_0x3560('0x35')]?_0x28aaf8[_0x3560('0x33')]:_0x5f55c4[_0x3560('0x2f')];if(!_0xdfb532[_0x3560('0x30')][_0x3560('0x36')](_0x3560('0x37'))){_0x28aaf8[_0x3560('0x1d')]=qs[_0x3560('0x1d')](_0xdfb532[_0x3560('0x30')][_0x3560('0x1d')]);_0x28aaf8[_0x3560('0x1c')]=qs[_0x3560('0x1c')](_0xdfb532[_0x3560('0x30')]['offset']);}_0x28aaf8[_0x3560('0x38')]=qs['sort'](_0xdfb532['query']['sort']);_0x28aaf8[_0x3560('0x39')]=qs[_0x3560('0x31')](_[_0x3560('0x3a')](_0xdfb532[_0x3560('0x30')],_0x5f55c4[_0x3560('0x31')]),_0x13ee76);if(_0xdfb532[_0x3560('0x30')][_0x3560('0x3b')]){_0x28aaf8[_0x3560('0x39')]=_['merge'](_0x28aaf8[_0x3560('0x39')],{'$or':_['map'](_0x13ee76,function(_0x79f47d){if(_0x79f47d['type']!==_0x3560('0x3c')){var _0x191bff={};_0x191bff[_0x79f47d[_0x3560('0x27')]]={'$like':'%'+_0xdfb532['query'][_0x3560('0x3b')]+'%'};return _0x191bff;}})});}_0x28aaf8=_[_0x3560('0x3d')]({},_0x28aaf8,_0xdfb532[_0x3560('0x3e')]);var _0x39dfee={'where':_0x28aaf8[_0x3560('0x39')]};return db[_0x3560('0x2a')][_0x3560('0x1f')](_0x39dfee)['then'](function(_0xd2c9c){_0x5128bc['count']=_0xd2c9c;if(_0xdfb532[_0x3560('0x30')][_0x3560('0x3f')]){_0x28aaf8[_0x3560('0x40')]=[{'all':!![]}];}return db['SalesforceField'][_0x3560('0x41')](_0x28aaf8);})['then'](function(_0x4fcc6d){_0x5128bc[_0x3560('0x42')]=_0x4fcc6d;return _0x5128bc;})[_0x3560('0x24')](respondWithFilteredResult(_0x49b745,_0x28aaf8))['catch'](handleError(_0x49b745,null));};exports[_0x3560('0x43')]=function(_0x58a975,_0x4e3259){var _0x34ec47={'raw':!![],'where':{'id':_0x58a975[_0x3560('0x44')]['id']}},_0xab3742={};_0xab3742[_0x3560('0x2f')]=_[_0x3560('0x45')](db['SalesforceField'][_0x3560('0x2b')]);_0xab3742['query']=_[_0x3560('0x45')](_0x58a975[_0x3560('0x30')]);_0xab3742[_0x3560('0x31')]=_[_0x3560('0x32')](_0xab3742['model'],_0xab3742['query']);_0x34ec47[_0x3560('0x33')]=_[_0x3560('0x32')](_0xab3742['model'],qs[_0x3560('0x34')](_0x58a975[_0x3560('0x30')]['fields']));_0x34ec47[_0x3560('0x33')]=_0x34ec47[_0x3560('0x33')][_0x3560('0x35')]?_0x34ec47[_0x3560('0x33')]:_0xab3742[_0x3560('0x2f')];if(_0x58a975[_0x3560('0x30')]['includeAll']){_0x34ec47[_0x3560('0x40')]=[{'all':!![]}];}_0x34ec47=_['merge']({},_0x34ec47,_0x58a975[_0x3560('0x3e')]);return db[_0x3560('0x2a')][_0x3560('0x46')](_0x34ec47)[_0x3560('0x24')](handleEntityNotFound(_0x4e3259,null))[_0x3560('0x24')](respondWithResult(_0x4e3259,null))[_0x3560('0x47')](handleError(_0x4e3259,null));};exports[_0x3560('0x48')]=function(_0x649ddf,_0x420c45){return db[_0x3560('0x2a')][_0x3560('0x48')](_0x649ddf[_0x3560('0x49')],{})[_0x3560('0x24')](respondWithResult(_0x420c45,0xc9))['catch'](handleError(_0x420c45,null));};exports[_0x3560('0x23')]=function(_0x3a5971,_0x344d0b){if(_0x3a5971[_0x3560('0x49')]['id']){delete _0x3a5971['body']['id'];}return db[_0x3560('0x2a')][_0x3560('0x46')]({'where':{'id':_0x3a5971[_0x3560('0x44')]['id']}})[_0x3560('0x24')](handleEntityNotFound(_0x344d0b,null))['then'](saveUpdates(_0x3a5971[_0x3560('0x49')],null))[_0x3560('0x24')](respondWithResult(_0x344d0b,null))[_0x3560('0x47')](handleError(_0x344d0b,null));};exports['destroy']=function(_0x57a998,_0x1e0da6){return db[_0x3560('0x2a')]['find']({'where':{'id':_0x57a998[_0x3560('0x44')]['id']}})[_0x3560('0x24')](handleEntityNotFound(_0x1e0da6,null))[_0x3560('0x24')](removeEntity(_0x1e0da6,null))['catch'](handleError(_0x1e0da6,null));}; \ No newline at end of file +var _0xf02a=['where','pick','map','VIRTUAL','filter','merge','options','SalesforceField','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../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','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0xf02a,0xf2));var _0xaf02=function(_0x6a0266,_0x1552d6){_0x6a0266=_0x6a0266-0x0;var _0x309e00=_0xf02a[_0x6a0266];return _0x309e00;};'use strict';var emlformat=require(_0xaf02('0x0'));var rimraf=require(_0xaf02('0x1'));var zipdir=require(_0xaf02('0x2'));var jsonpatch=require(_0xaf02('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xaf02('0x4'));var util=require(_0xaf02('0x5'));var path=require(_0xaf02('0x6'));var sox=require(_0xaf02('0x7'));var csv=require(_0xaf02('0x8'));var ejs=require(_0xaf02('0x9'));var fs=require('fs');var fs_extra=require(_0xaf02('0xa'));var _=require(_0xaf02('0xb'));var squel=require('squel');var crypto=require(_0xaf02('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xaf02('0xd'));var toCsv=require(_0xaf02('0x8'));var querystring=require(_0xaf02('0xe'));var Papa=require('papaparse');var Redis=require(_0xaf02('0xf'));var authService=require(_0xaf02('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xaf02('0x11'));var hardwareService=require(_0xaf02('0x12'));var logger=require(_0xaf02('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xaf02('0x14'));var licenseUtil=require(_0xaf02('0x15'));var db=require(_0xaf02('0x16'))['db'];function respondWithStatusCode(_0x19c7d5,_0x6072d){_0x6072d=_0x6072d||0xcc;return function(_0x2c5714){if(_0x2c5714){return _0x19c7d5[_0xaf02('0x17')](_0x6072d);}return _0x19c7d5[_0xaf02('0x18')](_0x6072d)[_0xaf02('0x19')]();};}function respondWithResult(_0x240cb0,_0x551497){_0x551497=_0x551497||0xc8;return function(_0x43f852){if(_0x43f852){return _0x240cb0[_0xaf02('0x18')](_0x551497)[_0xaf02('0x1a')](_0x43f852);}};}function respondWithFilteredResult(_0x3b1d59,_0x1298fb){return function(_0x485893){if(_0x485893){var _0x59dc83=typeof _0x1298fb[_0xaf02('0x1b')]===_0xaf02('0x1c')&&typeof _0x1298fb[_0xaf02('0x1d')]===_0xaf02('0x1c');var _0x3a17af=_0x485893[_0xaf02('0x1e')];var _0x51f650=_0x59dc83?0x0:_0x1298fb[_0xaf02('0x1b')];var _0xb2467f=_0x59dc83?_0x485893[_0xaf02('0x1e')]:_0x1298fb[_0xaf02('0x1b')]+_0x1298fb[_0xaf02('0x1d')];var _0x578a58;if(_0xb2467f>=_0x3a17af){_0xb2467f=_0x3a17af;_0x578a58=0xc8;}else{_0x578a58=0xce;}_0x3b1d59['status'](_0x578a58);return _0x3b1d59['set'](_0xaf02('0x1f'),_0x51f650+'-'+_0xb2467f+'/'+_0x3a17af)[_0xaf02('0x1a')](_0x485893);}return null;};}function patchUpdates(_0xe0d528){return function(_0x2f6ab3){try{jsonpatch[_0xaf02('0x20')](_0x2f6ab3,_0xe0d528,!![]);}catch(_0x4c8c66){return BPromise[_0xaf02('0x21')](_0x4c8c66);}return _0x2f6ab3['save']();};}function saveUpdates(_0x2f5c0c,_0x264081){return function(_0x101125){if(_0x101125){return _0x101125[_0xaf02('0x22')](_0x2f5c0c)[_0xaf02('0x23')](function(_0x5e8002){return _0x5e8002;});}return null;};}function removeEntity(_0x151aeb,_0x47dcbd){return function(_0x5278a0){if(_0x5278a0){return _0x5278a0[_0xaf02('0x24')]()[_0xaf02('0x23')](function(){_0x151aeb[_0xaf02('0x18')](0xcc)[_0xaf02('0x19')]();});}};}function handleEntityNotFound(_0xcf34f0,_0x556f86){return function(_0x29eb30){if(!_0x29eb30){_0xcf34f0[_0xaf02('0x17')](0x194);}return _0x29eb30;};}function handleError(_0x57b925,_0x2571b7){_0x2571b7=_0x2571b7||0x1f4;return function(_0x5575cb){logger[_0xaf02('0x25')](_0x5575cb[_0xaf02('0x26')]);if(_0x5575cb[_0xaf02('0x27')]){delete _0x5575cb[_0xaf02('0x27')];}_0x57b925[_0xaf02('0x18')](_0x2571b7)[_0xaf02('0x28')](_0x5575cb);};}exports[_0xaf02('0x29')]=function(_0x3d24fd,_0x40bf60){var _0x239132={},_0x565a8a={},_0x4411e2={'count':0x0,'rows':[]};var _0x1dcd60=_['map'](db['SalesforceField'][_0xaf02('0x2a')],function(_0x59cf2c){return{'name':_0x59cf2c[_0xaf02('0x2b')],'type':_0x59cf2c[_0xaf02('0x2c')][_0xaf02('0x2d')]};});_0x565a8a[_0xaf02('0x2e')]=_['map'](_0x1dcd60,_0xaf02('0x27'));_0x565a8a[_0xaf02('0x2f')]=_[_0xaf02('0x30')](_0x3d24fd[_0xaf02('0x2f')]);_0x565a8a[_0xaf02('0x31')]=_[_0xaf02('0x32')](_0x565a8a['model'],_0x565a8a['query']);_0x239132[_0xaf02('0x33')]=_[_0xaf02('0x32')](_0x565a8a[_0xaf02('0x2e')],qs[_0xaf02('0x34')](_0x3d24fd[_0xaf02('0x2f')][_0xaf02('0x34')]));_0x239132[_0xaf02('0x33')]=_0x239132['attributes'][_0xaf02('0x35')]?_0x239132[_0xaf02('0x33')]:_0x565a8a[_0xaf02('0x2e')];if(!_0x3d24fd['query'][_0xaf02('0x36')](_0xaf02('0x37'))){_0x239132[_0xaf02('0x1d')]=qs[_0xaf02('0x1d')](_0x3d24fd[_0xaf02('0x2f')][_0xaf02('0x1d')]);_0x239132[_0xaf02('0x1b')]=qs[_0xaf02('0x1b')](_0x3d24fd[_0xaf02('0x2f')]['offset']);}_0x239132[_0xaf02('0x38')]=qs[_0xaf02('0x39')](_0x3d24fd[_0xaf02('0x2f')][_0xaf02('0x39')]);_0x239132[_0xaf02('0x3a')]=qs[_0xaf02('0x31')](_[_0xaf02('0x3b')](_0x3d24fd[_0xaf02('0x2f')],_0x565a8a[_0xaf02('0x31')]),_0x1dcd60);if(_0x3d24fd['query']['filter']){_0x239132['where']=_['merge'](_0x239132[_0xaf02('0x3a')],{'$or':_[_0xaf02('0x3c')](_0x1dcd60,function(_0x1357db){if(_0x1357db['type']!==_0xaf02('0x3d')){var _0x214b29={};_0x214b29[_0x1357db['name']]={'$like':'%'+_0x3d24fd['query'][_0xaf02('0x3e')]+'%'};return _0x214b29;}})});}_0x239132=_[_0xaf02('0x3f')]({},_0x239132,_0x3d24fd[_0xaf02('0x40')]);var _0x3d206d={'where':_0x239132[_0xaf02('0x3a')]};return db[_0xaf02('0x41')][_0xaf02('0x1e')](_0x3d206d)[_0xaf02('0x23')](function(_0xbcc322){_0x4411e2['count']=_0xbcc322;if(_0x3d24fd[_0xaf02('0x2f')]['includeAll']){_0x239132[_0xaf02('0x42')]=[{'all':!![]}];}return db[_0xaf02('0x41')][_0xaf02('0x43')](_0x239132);})['then'](function(_0x11d355){_0x4411e2[_0xaf02('0x44')]=_0x11d355;return _0x4411e2;})[_0xaf02('0x23')](respondWithFilteredResult(_0x40bf60,_0x239132))[_0xaf02('0x45')](handleError(_0x40bf60,null));};exports[_0xaf02('0x46')]=function(_0x40adca,_0x2d9973){var _0x126202={'raw':!![],'where':{'id':_0x40adca[_0xaf02('0x47')]['id']}},_0x383138={};_0x383138['model']=_[_0xaf02('0x30')](db[_0xaf02('0x41')][_0xaf02('0x2a')]);_0x383138[_0xaf02('0x2f')]=_[_0xaf02('0x30')](_0x40adca[_0xaf02('0x2f')]);_0x383138['filters']=_[_0xaf02('0x32')](_0x383138[_0xaf02('0x2e')],_0x383138[_0xaf02('0x2f')]);_0x126202[_0xaf02('0x33')]=_[_0xaf02('0x32')](_0x383138[_0xaf02('0x2e')],qs['fields'](_0x40adca['query'][_0xaf02('0x34')]));_0x126202[_0xaf02('0x33')]=_0x126202[_0xaf02('0x33')][_0xaf02('0x35')]?_0x126202[_0xaf02('0x33')]:_0x383138[_0xaf02('0x2e')];if(_0x40adca[_0xaf02('0x2f')]['includeAll']){_0x126202[_0xaf02('0x42')]=[{'all':!![]}];}_0x126202=_[_0xaf02('0x3f')]({},_0x126202,_0x40adca['options']);return db['SalesforceField'][_0xaf02('0x48')](_0x126202)[_0xaf02('0x23')](handleEntityNotFound(_0x2d9973,null))['then'](respondWithResult(_0x2d9973,null))[_0xaf02('0x45')](handleError(_0x2d9973,null));};exports['create']=function(_0x50ab20,_0x1d92c6){return db[_0xaf02('0x41')][_0xaf02('0x49')](_0x50ab20[_0xaf02('0x4a')],{})[_0xaf02('0x23')](respondWithResult(_0x1d92c6,0xc9))[_0xaf02('0x45')](handleError(_0x1d92c6,null));};exports[_0xaf02('0x22')]=function(_0x5909d4,_0x1dfde1){if(_0x5909d4[_0xaf02('0x4a')]['id']){delete _0x5909d4[_0xaf02('0x4a')]['id'];}return db['SalesforceField']['find']({'where':{'id':_0x5909d4['params']['id']}})[_0xaf02('0x23')](handleEntityNotFound(_0x1dfde1,null))[_0xaf02('0x23')](saveUpdates(_0x5909d4[_0xaf02('0x4a')],null))[_0xaf02('0x23')](respondWithResult(_0x1dfde1,null))[_0xaf02('0x45')](handleError(_0x1dfde1,null));};exports['destroy']=function(_0x1595be,_0x492bdc){return db[_0xaf02('0x41')][_0xaf02('0x48')]({'where':{'id':_0x1595be[_0xaf02('0x47')]['id']}})[_0xaf02('0x23')](handleEntityNotFound(_0x492bdc,null))[_0xaf02('0x23')](removeEntity(_0x492bdc,null))['catch'](handleError(_0x492bdc,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 292fa50..438c48c 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 _0x5611=['exports','define','int_salesforce_fields','salesforce_unique_index','util','moment','request-promise','rimraf','../../config/environment'];(function(_0xf6aec0,_0x51ffd6){var _0x59a51b=function(_0x57adc6){while(--_0x57adc6){_0xf6aec0['push'](_0xf6aec0['shift']());}};_0x59a51b(++_0x51ffd6);}(_0x5611,0x1b4));var _0x1561=function(_0x366a13,_0x537fd7){_0x366a13=_0x366a13-0x0;var _0x348ac1=_0x5611[_0x366a13];return _0x348ac1;};'use strict';var _=require('lodash');var util=require(_0x1561('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x1561('0x1'));var BPromise=require('bluebird');var rp=require(_0x1561('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1561('0x3'));var config=require(_0x1561('0x4'));var attributes=require('./intSalesforceField.attributes');module[_0x1561('0x5')]=function(_0x3609fd,_0x993163){return _0x3609fd[_0x1561('0x6')]('SalesforceField',attributes,{'tableName':_0x1561('0x7'),'paranoid':![],'indexes':[{'name':_0x1561('0x8'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xde61=['util','api','moment','bluebird','path','rimraf','../../config/environment','exports','SalesforceField','int_salesforce_fields','idField','lodash'];(function(_0x1c6089,_0x3816e2){var _0x4d97c1=function(_0x3e631b){while(--_0x3e631b){_0x1c6089['push'](_0x1c6089['shift']());}};_0x4d97c1(++_0x3816e2);}(_0xde61,0x12b));var _0x1de6=function(_0x4856bd,_0x3a74fb){_0x4856bd=_0x4856bd-0x0;var _0x1d047e=_0xde61[_0x4856bd];return _0x1d047e;};'use strict';var _=require(_0x1de6('0x0'));var util=require(_0x1de6('0x1'));var logger=require('../../config/logger')(_0x1de6('0x2'));var moment=require(_0x1de6('0x3'));var BPromise=require(_0x1de6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1de6('0x5'));var rimraf=require(_0x1de6('0x6'));var config=require(_0x1de6('0x7'));var attributes=require('./intSalesforceField.attributes');module[_0x1de6('0x8')]=function(_0x3d0576,_0x751c0a){return _0x3d0576['define'](_0x1de6('0x9'),attributes,{'tableName':_0x1de6('0xa'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x1de6('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index d0c0a01..0afe716 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 _0xbe75=['client','http','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise'];(function(_0x41375f,_0x362c5a){var _0x330d52=function(_0x2be416){while(--_0x2be416){_0x41375f['push'](_0x41375f['shift']());}};_0x330d52(++_0x362c5a);}(_0xbe75,0x98));var _0x5be7=function(_0x2210f4,_0x5512f1){_0x2210f4=_0x2210f4-0x0;var _0x318846=_0xbe75[_0x2210f4];return _0x318846;};'use strict';var _=require(_0x5be7('0x0'));var util=require(_0x5be7('0x1'));var moment=require(_0x5be7('0x2'));var BPromise=require('bluebird');var rs=require(_0x5be7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5be7('0x4'))['db'];var utils=require(_0x5be7('0x5'));var logger=require('../../config/logger')(_0x5be7('0x6'));var config=require('../../config/environment');var jayson=require(_0x5be7('0x7'));var client=jayson[_0x5be7('0x8')][_0x5be7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x127c51,_0x3578a2,_0x144e18){return new BPromise(function(_0x4b10a9,_0x377bce){return client['request'](_0x127c51,_0x144e18)[_0x5be7('0xa')](function(_0xa8852f){logger[_0x5be7('0xb')](_0x5be7('0xc'),_0x3578a2,_0x5be7('0xd'));logger[_0x5be7('0xe')](_0x5be7('0xf'),_0x3578a2,'request\x20sent',JSON[_0x5be7('0x10')](_0xa8852f));if(_0xa8852f[_0x5be7('0x11')]){if(_0xa8852f[_0x5be7('0x11')]['code']===0x1f4){logger[_0x5be7('0x11')](_0x5be7('0xc'),_0x3578a2,_0xa8852f[_0x5be7('0x11')][_0x5be7('0x12')]);return _0x377bce(_0xa8852f[_0x5be7('0x11')][_0x5be7('0x12')]);}logger[_0x5be7('0x11')](_0x5be7('0xc'),_0x3578a2,_0xa8852f['error']['message']);return _0x4b10a9(_0xa8852f[_0x5be7('0x11')]['message']);}else{logger['info'](_0x5be7('0xc'),_0x3578a2,_0x5be7('0xd'));_0x4b10a9(_0xa8852f['result'][_0x5be7('0x12')]);}})[_0x5be7('0x13')](function(_0x365055){logger['error'](_0x5be7('0xc'),_0x3578a2,_0x365055);_0x377bce(_0x365055);});});} \ No newline at end of file +var _0xd7b8=['message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0xae1aa1,_0x4ff696){var _0x45af45=function(_0x515587){while(--_0x515587){_0xae1aa1['push'](_0xae1aa1['shift']());}};_0x45af45(++_0x4ff696);}(_0xd7b8,0x122));var _0x8d7b=function(_0x59dc49,_0x3fb71a){_0x59dc49=_0x59dc49-0x0;var _0x3ed89b=_0xd7b8[_0x59dc49];return _0x3ed89b;};'use strict';var _=require(_0x8d7b('0x0'));var util=require(_0x8d7b('0x1'));var moment=require(_0x8d7b('0x2'));var BPromise=require(_0x8d7b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8d7b('0x4'));var db=require(_0x8d7b('0x5'))['db'];var utils=require(_0x8d7b('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x8d7b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8d7b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f1366,_0x53c6f9,_0x5966cf){return new BPromise(function(_0x4bde09,_0x4468f){return client[_0x8d7b('0x9')](_0x1f1366,_0x5966cf)[_0x8d7b('0xa')](function(_0x524af2){logger[_0x8d7b('0xb')](_0x8d7b('0xc'),_0x53c6f9,_0x8d7b('0xd'));logger[_0x8d7b('0xe')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x53c6f9,_0x8d7b('0xd'),JSON['stringify'](_0x524af2));if(_0x524af2[_0x8d7b('0xf')]){if(_0x524af2['error']['code']===0x1f4){logger[_0x8d7b('0xf')](_0x8d7b('0xc'),_0x53c6f9,_0x524af2[_0x8d7b('0xf')][_0x8d7b('0x10')]);return _0x4468f(_0x524af2[_0x8d7b('0xf')][_0x8d7b('0x10')]);}logger[_0x8d7b('0xf')]('SalesforceField,\x20%s,\x20%s',_0x53c6f9,_0x524af2[_0x8d7b('0xf')][_0x8d7b('0x10')]);return _0x4bde09(_0x524af2[_0x8d7b('0xf')]['message']);}else{logger[_0x8d7b('0xb')]('SalesforceField,\x20%s,\x20%s',_0x53c6f9,'request\x20sent');_0x4bde09(_0x524af2['result'][_0x8d7b('0x10')]);}})[_0x8d7b('0x11')](function(_0x4d6eba){logger[_0x8d7b('0xf')](_0x8d7b('0xc'),_0x53c6f9,_0x4d6eba);_0x4468f(_0x4d6eba);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 0b5e037..88e503a 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 _0x64e6=['addConfiguration','/:id','update','delete','destroy','util','path','connect-timeout','express','fs-extra','../../components/auth/service','get','index','isAuthenticated','show','/:id/configurations','getConfigurations','getFields','post','create'];(function(_0x3819c3,_0x4c5e9a){var _0x1ce0f5=function(_0x3d1251){while(--_0x3d1251){_0x3819c3['push'](_0x3819c3['shift']());}};_0x1ce0f5(++_0x4c5e9a);}(_0x64e6,0xcd));var _0x664e=function(_0x3275e2,_0x26a574){_0x3275e2=_0x3275e2-0x0;var _0xce0d78=_0x64e6[_0x3275e2];return _0xce0d78;};'use strict';var multer=require('multer');var util=require(_0x664e('0x0'));var path=require(_0x664e('0x1'));var timeout=require(_0x664e('0x2'));var express=require(_0x664e('0x3'));var router=express['Router']();var fs_extra=require(_0x664e('0x4'));var auth=require(_0x664e('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intServicenowAccount.controller');router[_0x664e('0x6')]('/',auth['isAuthenticated'](),controller[_0x664e('0x7')]);router[_0x664e('0x6')]('/:id',auth[_0x664e('0x8')](),controller[_0x664e('0x9')]);router[_0x664e('0x6')](_0x664e('0xa'),auth[_0x664e('0x8')](),controller[_0x664e('0xb')]);router['get']('/:id/fields',auth[_0x664e('0x8')](),controller[_0x664e('0xc')]);router[_0x664e('0xd')]('/',auth[_0x664e('0x8')](),controller[_0x664e('0xe')]);router[_0x664e('0xd')]('/:id/configurations',auth[_0x664e('0x8')](),controller[_0x664e('0xf')]);router['put'](_0x664e('0x10'),auth['isAuthenticated'](),controller[_0x664e('0x11')]);router[_0x664e('0x12')](_0x664e('0x10'),auth['isAuthenticated'](),controller[_0x664e('0x13')]);module['exports']=router; \ No newline at end of file +var _0x56c6=['../../config/environment','get','index','isAuthenticated','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5d2c89,_0x1fa506){var _0x28a602=function(_0x58d941){while(--_0x58d941){_0x5d2c89['push'](_0x5d2c89['shift']());}};_0x28a602(++_0x1fa506);}(_0x56c6,0x116));var _0x656c=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x56c6[_0x465a0c];return _0x1e202e;};'use strict';var multer=require(_0x656c('0x0'));var util=require(_0x656c('0x1'));var path=require(_0x656c('0x2'));var timeout=require(_0x656c('0x3'));var express=require(_0x656c('0x4'));var router=express['Router']();var fs_extra=require(_0x656c('0x5'));var auth=require(_0x656c('0x6'));var interaction=require(_0x656c('0x7'));var config=require(_0x656c('0x8'));var controller=require('./intServicenowAccount.controller');router[_0x656c('0x9')]('/',auth['isAuthenticated'](),controller[_0x656c('0xa')]);router['get']('/:id',auth[_0x656c('0xb')](),controller['show']);router[_0x656c('0x9')](_0x656c('0xc'),auth[_0x656c('0xb')](),controller[_0x656c('0xd')]);router[_0x656c('0x9')]('/:id/fields',auth[_0x656c('0xb')](),controller[_0x656c('0xe')]);router[_0x656c('0xf')]('/',auth[_0x656c('0xb')](),controller[_0x656c('0x10')]);router[_0x656c('0xf')]('/:id/configurations',auth[_0x656c('0xb')](),controller[_0x656c('0x11')]);router['put'](_0x656c('0x12'),auth['isAuthenticated'](),controller[_0x656c('0x13')]);router[_0x656c('0x14')](_0x656c('0x12'),auth['isAuthenticated'](),controller[_0x656c('0x15')]);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 0c5074b..d349159 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 _0x81fd=['STRING','username','remoteUri'];(function(_0x47d91e,_0x3e5da9){var _0x1be66b=function(_0x3fd2ca){while(--_0x3fd2ca){_0x47d91e['push'](_0x47d91e['shift']());}};_0x1be66b(++_0x3e5da9);}(_0x81fd,0xed));var _0xd81f=function(_0x177223,_0x10957e){_0x177223=_0x177223-0x0;var _0x5aefae=_0x81fd[_0x177223];return _0x5aefae;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd81f('0x0')]},'description':{'type':Sequelize[_0xd81f('0x0')]},'username':{'type':Sequelize[_0xd81f('0x0')],'unique':_0xd81f('0x1')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xd81f('0x0')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xd81f('0x2')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xbcbb=['STRING','username'];(function(_0x48d3fa,_0x3808a6){var _0x4c4995=function(_0x3fab11){while(--_0x3fab11){_0x48d3fa['push'](_0x48d3fa['shift']());}};_0x4c4995(++_0x3808a6);}(_0xbcbb,0x112));var _0xbbcb=function(_0x34edec,_0x228935){_0x34edec=_0x34edec-0x0;var _0x2d276d=_0xbcbb[_0x34edec];return _0x2d276d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xbbcb('0x0')]},'description':{'type':Sequelize[_0xbbcb('0x0')]},'username':{'type':Sequelize[_0xbbcb('0x0')],'unique':_0xbbcb('0x1')},'password':{'type':Sequelize[_0xbbcb('0x0')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xbbcb('0x0')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 45050bf..e539b32 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 _0x050f=['update','then','error','stack','name','send','index','map','ServicenowAccount','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','include','find','create','body','params','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','getSubjects','channel','Subjects','ServicenowField','Descriptions','getFields','made_sla','hold_reason','subcategory','notify','category','parent','watch_list','sys_updated_on','child_incidents','approval_history','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','sys_created_by','knowledge','calendar_stc','cmdb_ci','delivery_plan','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','opened_at','business_duration','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','close_code','correlation_display','delivery_task','work_start','business_stc','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','contact_type','reopened_by','incident_state','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','remoteUri','serverUrl','substring','lastIndexOf','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','assign','remove','includes','forEach','label','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','internalType','ServiceNow\x20error:\x20','statusCode','test','Wrong\x20credentials','boolean','True','true','false','inactive','value','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../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','reject','save'];(function(_0x47b2ae,_0xe2b899){var _0x59aa34=function(_0x26e08d){while(--_0x26e08d){_0x47b2ae['push'](_0x47b2ae['shift']());}};_0x59aa34(++_0xe2b899);}(_0x050f,0x14a));var _0xf050=function(_0x393381,_0x48f453){_0x393381=_0x393381-0x0;var _0x4e1985=_0x050f[_0x393381];return _0x4e1985;};'use strict';var emlformat=require(_0xf050('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf050('0x1'));var jsonpatch=require(_0xf050('0x2'));var rp=require('request-promise');var moment=require(_0xf050('0x3'));var BPromise=require(_0xf050('0x4'));var Mustache=require('mustache');var util=require(_0xf050('0x5'));var path=require(_0xf050('0x6'));var sox=require(_0xf050('0x7'));var csv=require(_0xf050('0x8'));var ejs=require(_0xf050('0x9'));var fs=require('fs');var fs_extra=require(_0xf050('0xa'));var _=require(_0xf050('0xb'));var squel=require(_0xf050('0xc'));var crypto=require(_0xf050('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf050('0xe'));var toCsv=require(_0xf050('0x8'));var querystring=require('querystring');var Papa=require(_0xf050('0xf'));var Redis=require(_0xf050('0x10'));var authService=require(_0xf050('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf050('0x12'));var hardwareService=require(_0xf050('0x13'));var logger=require(_0xf050('0x14'))(_0xf050('0x15'));var utils=require(_0xf050('0x16'));var config=require(_0xf050('0x17'));var licenseUtil=require(_0xf050('0x18'));var db=require(_0xf050('0x19'))['db'];var integrations=require(_0xf050('0x1a'));function respondWithStatusCode(_0x15c038,_0xe41732){_0xe41732=_0xe41732||0xcc;return function(_0xe6d10){if(_0xe6d10){return _0x15c038[_0xf050('0x1b')](_0xe41732);}return _0x15c038['status'](_0xe41732)[_0xf050('0x1c')]();};}function respondWithResult(_0x52aaae,_0x2f5ded){_0x2f5ded=_0x2f5ded||0xc8;return function(_0xcc8644){if(_0xcc8644){return _0x52aaae[_0xf050('0x1d')](_0x2f5ded)[_0xf050('0x1e')](_0xcc8644);}};}function respondWithFilteredResult(_0x16a5d9,_0xd8a746){return function(_0x8946ca){if(_0x8946ca){var _0x81b963=typeof _0xd8a746[_0xf050('0x1f')]===_0xf050('0x20')&&typeof _0xd8a746[_0xf050('0x21')]===_0xf050('0x20');var _0x503822=_0x8946ca[_0xf050('0x22')];var _0x1a44d0=_0x81b963?0x0:_0xd8a746['offset'];var _0x1f87e5=_0x81b963?_0x8946ca['count']:_0xd8a746[_0xf050('0x1f')]+_0xd8a746[_0xf050('0x21')];var _0xb414c9;if(_0x1f87e5>=_0x503822){_0x1f87e5=_0x503822;_0xb414c9=0xc8;}else{_0xb414c9=0xce;}_0x16a5d9[_0xf050('0x1d')](_0xb414c9);return _0x16a5d9[_0xf050('0x23')]('Content-Range',_0x1a44d0+'-'+_0x1f87e5+'/'+_0x503822)[_0xf050('0x1e')](_0x8946ca);}return null;};}function patchUpdates(_0x9cb35e){return function(_0x534eba){try{jsonpatch['apply'](_0x534eba,_0x9cb35e,!![]);}catch(_0x15e19b){return BPromise[_0xf050('0x24')](_0x15e19b);}return _0x534eba[_0xf050('0x25')]();};}function saveUpdates(_0x13a3e1,_0x508bd8){return function(_0x9edf72){if(_0x9edf72){return _0x9edf72[_0xf050('0x26')](_0x13a3e1)[_0xf050('0x27')](function(_0x1b1871){return _0x1b1871;});}return null;};}function removeEntity(_0x56a556,_0x5ef06d){return function(_0x1cef5d){if(_0x1cef5d){return _0x1cef5d['destroy']()['then'](function(){_0x56a556[_0xf050('0x1d')](0xcc)[_0xf050('0x1c')]();});}};}function handleEntityNotFound(_0x5561ff,_0xe2bbe3){return function(_0x1ab76a){if(!_0x1ab76a){_0x5561ff['sendStatus'](0x194);}return _0x1ab76a;};}function handleError(_0x40e484,_0x18939d){_0x18939d=_0x18939d||0x1f4;return function(_0x26ebc6){logger[_0xf050('0x28')](_0x26ebc6[_0xf050('0x29')]);if(_0x26ebc6[_0xf050('0x2a')]){delete _0x26ebc6[_0xf050('0x2a')];}_0x40e484[_0xf050('0x1d')](_0x18939d)[_0xf050('0x2b')](_0x26ebc6);};}exports[_0xf050('0x2c')]=function(_0x2fcdbf,_0x126ad6){var _0x519142={},_0x106e41={},_0x227285={'count':0x0,'rows':[]};var _0x204090=_[_0xf050('0x2d')](db[_0xf050('0x2e')][_0xf050('0x2f')],function(_0x6c5ebf){return{'name':_0x6c5ebf['fieldName'],'type':_0x6c5ebf[_0xf050('0x30')]['key']};});_0x106e41['model']=_['map'](_0x204090,_0xf050('0x2a'));_0x106e41[_0xf050('0x31')]=_[_0xf050('0x32')](_0x2fcdbf[_0xf050('0x31')]);_0x106e41[_0xf050('0x33')]=_[_0xf050('0x34')](_0x106e41[_0xf050('0x35')],_0x106e41[_0xf050('0x31')]);_0x519142[_0xf050('0x36')]=_['intersection'](_0x106e41[_0xf050('0x35')],qs[_0xf050('0x37')](_0x2fcdbf[_0xf050('0x31')][_0xf050('0x37')]));_0x519142[_0xf050('0x36')]=_0x519142[_0xf050('0x36')][_0xf050('0x38')]?_0x519142[_0xf050('0x36')]:_0x106e41[_0xf050('0x35')];if(!_0x2fcdbf['query'][_0xf050('0x39')](_0xf050('0x3a'))){_0x519142[_0xf050('0x21')]=qs[_0xf050('0x21')](_0x2fcdbf[_0xf050('0x31')]['limit']);_0x519142['offset']=qs[_0xf050('0x1f')](_0x2fcdbf[_0xf050('0x31')][_0xf050('0x1f')]);}_0x519142[_0xf050('0x3b')]=qs[_0xf050('0x3c')](_0x2fcdbf[_0xf050('0x31')][_0xf050('0x3c')]);_0x519142[_0xf050('0x3d')]=qs[_0xf050('0x33')](_[_0xf050('0x3e')](_0x2fcdbf['query'],_0x106e41[_0xf050('0x33')]),_0x204090);if(_0x2fcdbf[_0xf050('0x31')][_0xf050('0x3f')]){_0x519142[_0xf050('0x3d')]=_['merge'](_0x519142['where'],{'$or':_[_0xf050('0x2d')](_0x204090,function(_0x57dd03){if(_0x57dd03[_0xf050('0x30')]!=='VIRTUAL'){var _0x4afe57={};_0x4afe57[_0x57dd03[_0xf050('0x2a')]]={'$like':'%'+_0x2fcdbf[_0xf050('0x31')][_0xf050('0x3f')]+'%'};return _0x4afe57;}})});}_0x519142=_[_0xf050('0x40')]({},_0x519142,_0x2fcdbf[_0xf050('0x41')]);var _0x370e7c={'where':_0x519142[_0xf050('0x3d')]};return db[_0xf050('0x2e')][_0xf050('0x22')](_0x370e7c)[_0xf050('0x27')](function(_0x598fcc){_0x227285[_0xf050('0x22')]=_0x598fcc;if(_0x2fcdbf[_0xf050('0x31')][_0xf050('0x42')]){_0x519142['include']=[{'all':!![]}];}return db[_0xf050('0x2e')][_0xf050('0x43')](_0x519142);})[_0xf050('0x27')](function(_0x87d293){_0x227285[_0xf050('0x44')]=_0x87d293;return _0x227285;})[_0xf050('0x27')](respondWithFilteredResult(_0x126ad6,_0x519142))[_0xf050('0x45')](handleError(_0x126ad6,null));};exports[_0xf050('0x46')]=function(_0x1f685c,_0x36de09){var _0x26e3c8={'raw':![],'where':{'id':_0x1f685c['params']['id']}},_0x1b9b94={};_0x1b9b94[_0xf050('0x35')]=_[_0xf050('0x32')](db[_0xf050('0x2e')][_0xf050('0x2f')]);_0x1b9b94['query']=_[_0xf050('0x32')](_0x1f685c[_0xf050('0x31')]);_0x1b9b94[_0xf050('0x33')]=_[_0xf050('0x34')](_0x1b9b94[_0xf050('0x35')],_0x1b9b94[_0xf050('0x31')]);_0x26e3c8[_0xf050('0x36')]=_[_0xf050('0x34')](_0x1b9b94[_0xf050('0x35')],qs['fields'](_0x1f685c[_0xf050('0x31')][_0xf050('0x37')]));_0x26e3c8[_0xf050('0x36')]=_0x26e3c8[_0xf050('0x36')][_0xf050('0x38')]?_0x26e3c8[_0xf050('0x36')]:_0x1b9b94[_0xf050('0x35')];if(_0x1f685c[_0xf050('0x31')][_0xf050('0x42')]){_0x26e3c8[_0xf050('0x47')]=[{'all':!![]}];}_0x26e3c8=_['merge']({},_0x26e3c8,_0x1f685c[_0xf050('0x41')]);return db[_0xf050('0x2e')][_0xf050('0x48')](_0x26e3c8)['then'](handleEntityNotFound(_0x36de09,null))[_0xf050('0x27')](respondWithResult(_0x36de09,null))[_0xf050('0x45')](handleError(_0x36de09,null));};exports[_0xf050('0x49')]=function(_0x53ac31,_0x1fc4dd){return db['ServicenowAccount']['create'](_0x53ac31[_0xf050('0x4a')],{})[_0xf050('0x27')](respondWithResult(_0x1fc4dd,0xc9))[_0xf050('0x45')](handleError(_0x1fc4dd,null));};exports[_0xf050('0x26')]=function(_0x28eb3c,_0x34d205){if(_0x28eb3c['body']['id']){delete _0x28eb3c[_0xf050('0x4a')]['id'];}return db[_0xf050('0x2e')][_0xf050('0x48')]({'where':{'id':_0x28eb3c['params']['id']}})[_0xf050('0x27')](handleEntityNotFound(_0x34d205,null))[_0xf050('0x27')](saveUpdates(_0x28eb3c[_0xf050('0x4a')],null))[_0xf050('0x27')](respondWithResult(_0x34d205,null))[_0xf050('0x45')](handleError(_0x34d205,null));};exports['destroy']=function(_0x30582b,_0x20ed9a){return db[_0xf050('0x2e')]['find']({'where':{'id':_0x30582b[_0xf050('0x4b')]['id']}})[_0xf050('0x27')](handleEntityNotFound(_0x20ed9a,null))[_0xf050('0x27')](removeEntity(_0x20ed9a,null))[_0xf050('0x45')](handleError(_0x20ed9a,null));};exports[_0xf050('0x4c')]=function(_0x1f7a9e,_0xacbb64,_0x141b22){var _0x533610={};var _0x552c8={};var _0x27db1e;var _0xd6c75f;return db[_0xf050('0x2e')][_0xf050('0x4d')]({'where':{'id':_0x1f7a9e[_0xf050('0x4b')]['id']}})[_0xf050('0x27')](handleEntityNotFound(_0xacbb64,null))[_0xf050('0x27')](function(_0x5e7461){if(_0x5e7461){_0x27db1e=_0x5e7461;_0x552c8[_0xf050('0x35')]=_[_0xf050('0x32')](db[_0xf050('0x4e')][_0xf050('0x2f')]);_0x552c8[_0xf050('0x31')]=_[_0xf050('0x32')](_0x1f7a9e[_0xf050('0x31')]);_0x552c8[_0xf050('0x33')]=_[_0xf050('0x34')](_0x552c8['model'],_0x552c8[_0xf050('0x31')]);_0x533610['attributes']=_[_0xf050('0x34')](_0x552c8['model'],qs['fields'](_0x1f7a9e['query']['fields']));_0x533610[_0xf050('0x36')]=_0x533610[_0xf050('0x36')][_0xf050('0x38')]?_0x533610[_0xf050('0x36')]:_0x552c8[_0xf050('0x35')];_0x533610['order']=qs[_0xf050('0x3c')](_0x1f7a9e[_0xf050('0x31')]['sort']);_0x533610['where']=qs[_0xf050('0x33')](_['pick'](_0x1f7a9e[_0xf050('0x31')],_0x552c8[_0xf050('0x33')]));if(_0x1f7a9e['query'][_0xf050('0x3f')]){_0x533610['where']=_[_0xf050('0x40')](_0x533610[_0xf050('0x3d')],{'$or':_['map'](_0x533610['attributes'],function(_0x12ae07){var _0x3ddce2={};_0x3ddce2[_0x12ae07]={'$like':'%'+_0x1f7a9e[_0xf050('0x31')][_0xf050('0x3f')]+'%'};return _0x3ddce2;})});}_0x533610=_[_0xf050('0x40')]({},_0x533610,_0x1f7a9e['options']);return _0x27db1e['getConfigurations'](_0x533610);}})[_0xf050('0x27')](function(_0x4fcd8c){if(_0x4fcd8c){_0xd6c75f=_0x4fcd8c[_0xf050('0x38')];if(!_0x1f7a9e[_0xf050('0x31')][_0xf050('0x39')]('nolimit')){_0x533610['limit']=qs[_0xf050('0x21')](_0x1f7a9e[_0xf050('0x31')][_0xf050('0x21')]);_0x533610[_0xf050('0x1f')]=qs[_0xf050('0x1f')](_0x1f7a9e[_0xf050('0x31')][_0xf050('0x1f')]);}return _0x27db1e['getConfigurations'](_0x533610);}})[_0xf050('0x27')](function(_0x2e1eb3){if(_0x2e1eb3){return _0x2e1eb3?{'count':_0xd6c75f,'rows':_0x2e1eb3}:null;}})[_0xf050('0x27')](respondWithResult(_0xacbb64,null))['catch'](handleError(_0xacbb64,null));};exports[_0xf050('0x4f')]=function(_0x3e9dd3,_0x21f402,_0x1b3639){if(_0x3e9dd3[_0xf050('0x4a')]['id']){delete _0x3e9dd3['body']['id'];}return db[_0xf050('0x2e')]['findOne']({'where':{'id':_0x3e9dd3[_0xf050('0x4b')]['id']}})[_0xf050('0x27')](handleEntityNotFound(_0x21f402,null))[_0xf050('0x27')](function(_0xd6de79){if(_0xd6de79){_0x3e9dd3[_0xf050('0x4a')]['AccountId']=_0xd6de79['id'];_0x3e9dd3['body']['Subjects']=integrations[_0xf050('0x50')](_0x3e9dd3[_0xf050('0x4a')][_0xf050('0x51')],_0x3e9dd3[_0xf050('0x4a')]['type']);_0x3e9dd3[_0xf050('0x4a')]['Descriptions']=integrations['getDescriptions'](_0x3e9dd3[_0xf050('0x4a')][_0xf050('0x51')],_0x3e9dd3['body']['type']);return db[_0xf050('0x4e')][_0xf050('0x49')](_0x3e9dd3[_0xf050('0x4a')],{'include':[{'model':db['ServicenowField'],'as':_0xf050('0x52')},{'model':db[_0xf050('0x53')],'as':_0xf050('0x54')}]});}return null;})[_0xf050('0x27')](respondWithResult(_0x21f402,null))[_0xf050('0x45')](handleError(_0x21f402,null));};exports[_0xf050('0x55')]=function(_0x1475e6,_0x17f57b,_0x1d47c8){var _0x4dd5bd=[_0xf050('0x56'),_0xf050('0x57'),'knowledge',_0xf050('0x58'),'close_code',_0xf050('0x59'),'incident_state','severity',_0xf050('0x5a')];var _0xbbb915=[_0xf050('0x5b'),_0xf050('0x56'),'caused_by',_0xf050('0x5c'),'upon_reject',_0xf050('0x5d'),_0xf050('0x5e'),_0xf050('0x57'),_0xf050('0x5f'),'number','resolved_by',_0xf050('0x60'),_0xf050('0x61'),_0xf050('0x62'),_0xf050('0x63'),_0xf050('0x64'),'state',_0xf050('0x65'),_0xf050('0x66'),_0xf050('0x3b'),_0xf050('0x67'),'closed_at',_0xf050('0x68'),_0xf050('0x69'),'impact',_0xf050('0x6a'),_0xf050('0x6b'),_0xf050('0x6c'),_0xf050('0x6d'),_0xf050('0x6e'),_0xf050('0x6f'),_0xf050('0x70'),'expected_start',_0xf050('0x71'),_0xf050('0x72'),'group_list',_0xf050('0x73'),_0xf050('0x74'),_0xf050('0x75'),_0xf050('0x76'),_0xf050('0x77'),'subcategory',_0xf050('0x78'),_0xf050('0x79'),_0xf050('0x7a'),_0xf050('0x7b'),_0xf050('0x7c'),_0xf050('0x7d'),'assignment_group',_0xf050('0x7e'),'additional_assignee_list','description',_0xf050('0x7f'),'notify',_0xf050('0x80'),_0xf050('0x81'),_0xf050('0x82'),_0xf050('0x83'),_0xf050('0x84'),'sys_id',_0xf050('0x85'),_0xf050('0x86'),_0xf050('0x87'),'urgency',_0xf050('0x88'),_0xf050('0x89'),_0xf050('0x8a'),_0xf050('0x8b'),_0xf050('0x8c'),'severity',_0xf050('0x8d'),_0xf050('0x8e'),_0xf050('0x8f'),_0xf050('0x90'),'due_date',_0xf050('0x91'),_0xf050('0x92'),_0xf050('0x93'),_0xf050('0x94'),_0xf050('0x95'),_0xf050('0x96'),_0xf050('0x97'),_0xf050('0x5a')];var _0x3f2e74='';var _0x1628aa='';var _0x392a72=[];var _0x25b2a5='';var _0x582cc7='';var _0x3a25a3=[];var _0xebcd00='';var _0x1050c0='';var _0x5249e8={};var _0x27acf1='';return db[_0xf050('0x2e')][_0xf050('0x4d')]({'where':{'id':_0x1475e6['params']['id']},'attributes':['id',_0xf050('0x98'),_0xf050('0x99'),'email',_0xf050('0x9a'),_0xf050('0x9b')]})[_0xf050('0x27')](handleEntityNotFound(_0x17f57b,null))[_0xf050('0x27')](function(_0x395674){if(_0x395674){_0x27acf1=_0x395674['remoteUri'];var _0x3aa46d=_0x27acf1['slice'](-0x1);if(_0x3aa46d==='/'){_0x27acf1=_0x27acf1[_0xf050('0x9c')](0x0,_0x27acf1[_0xf050('0x9d')](_0x3aa46d));}_0x1050c0=util[_0xf050('0x9e')]('%s/api/now/doc/table/schema/',_0x27acf1);_0xebcd00=util[_0xf050('0x9e')](_0xf050('0x9f'),_0x27acf1);_0x5249e8={'user':_0x395674[_0xf050('0x98')],'pass':_0x395674[_0xf050('0x99')]};var _0x4fb5de={'method':_0xf050('0xa0'),'uri':_0x1050c0+_0xf050('0xa1'),'auth':_0x5249e8,'json':!![]};return rp(_0x4fb5de);}})[_0xf050('0x27')](function(_0x392f15){if(_0x392f15[_0xf050('0xa2')]['length']>0x0){_0x3f2e74=_0x392f15[_0xf050('0xa2')];}console[_0xf050('0xa3')]('incident\x20table\x20objects',_0x3f2e74);_0x3a25a3=[];_0x1628aa=Object[_0xf050('0xa4')]([],_0x3f2e74);_[_0xf050('0xa5')](_0x1628aa,function(_0x57b12c){return!_0x4dd5bd[_0xf050('0xa6')](_0x57b12c[_0xf050('0x2a')]);});_0x1628aa[_0xf050('0xa7')](function(_0x12334){var _0x12b6c2=createFieldObject(_0xebcd00,_0x5249e8,_0x12334['internalType'],_0x12334[_0xf050('0x2a')],_0x12334[_0xf050('0xa8')],![]);_0x3a25a3[_0xf050('0xa9')](_0x12b6c2);});return Promise[_0xf050('0xaa')](_0x3a25a3);})[_0xf050('0x27')](function(_0xce0500){_0x392a72=_0xce0500;_0x25b2a5=Object[_0xf050('0xa4')]([],_0x3f2e74);console['log'](_0xf050('0xab'),_0x3f2e74);_['remove'](_0x25b2a5,function(_0x42607e){return _0xbbb915['includes'](_0x42607e[_0xf050('0x2a')]);});console[_0xf050('0xa3')](_0xf050('0xac'),_0x25b2a5);_0x3a25a3=[];_0x25b2a5['forEach'](function(_0x4462ba){var _0xe6ae87=createFieldObject(_0xebcd00,_0x5249e8,_0x4462ba[_0xf050('0xad')],_0x4462ba[_0xf050('0x2a')],_0x4462ba[_0xf050('0xa8')],!![]);_0x3a25a3[_0xf050('0xa9')](_0xe6ae87);});return Promise['all'](_0x3a25a3);})[_0xf050('0x27')](function(_0x5bd8cf){_0x582cc7=_0x5bd8cf;var _0x36bc16=_0x392a72['concat'](_0x582cc7);return{'count':_0x36bc16[_0xf050('0x38')],'rows':_0x36bc16};})[_0xf050('0x27')](respondWithResult(_0x17f57b,null))[_0xf050('0x45')](function(_0x482ded){console['log'](_0xf050('0xae')+_0x482ded);var _0x542ba7=_0x1475e6[_0xf050('0x31')]['test']?0x1f4:_0x482ded[_0xf050('0xaf')]||0x1f4;logger[_0xf050('0x28')](_0x482ded['stack']);delete _0x482ded[_0xf050('0x2a')];if(_0x542ba7===0x191){_0x542ba7=0x190;}_0x17f57b['status'](_0x542ba7)[_0xf050('0x2b')](_0x1475e6[_0xf050('0x31')][_0xf050('0xb0')]?{'message':_0xf050('0xb1'),'statusCode':_0x482ded[_0xf050('0xaf')]}:_0x482ded);});};function createFieldObject(_0x39c22f,_0x4a05ef,_0x3197e5,_0x3db8fb,_0xdab274,_0x31fee5){return new Promise(function(_0x42fa85,_0x412a7a){var _0x45223e={'id':_0x3db8fb,'name':_0xdab274,'custom':_0x31fee5};if(_0x3197e5===_0xf050('0xb2')){_0x45223e[_0xf050('0x41')]=[{'name':_0xf050('0xb3'),'value':_0xf050('0xb4')},{'name':'False','value':_0xf050('0xb5')}];_0x42fa85(_0x45223e);}else{var _0x75f9a5={'method':_0xf050('0xa0'),'uri':_0x39c22f+'sys_choice?sysparm_query=name=incident^element='+_0x3db8fb,'auth':_0x4a05ef,'json':!![]};return rp(_0x75f9a5)[_0xf050('0x27')](function(_0x555468){var _0x3035ea=[];if(_0x555468[_0xf050('0xa2')][_0xf050('0x38')]>0x0){_0x555468['result'][_0xf050('0xa7')](function(_0x3d7658){if(_0x3d7658[_0xf050('0xb6')]===_0xf050('0xb5')){var _0x451e86={'name':_0x3d7658[_0xf050('0xa8')],'value':_0x3d7658[_0xf050('0xb7')]};_0x3035ea[_0xf050('0xa9')](_0x451e86);}});}_0x45223e['options']=_0x3035ea;if(_0x45223e['options']['length']>0x0){_0x42fa85(_0x45223e);}else{if(_0x31fee5==![]){_0x42fa85();}else{_0x42fa85(_0x45223e);}}});}});} \ No newline at end of file +var _0x86f9=['json','undefined','limit','offset','count','Content-Range','apply','reject','save','update','then','destroy','status','error','stack','name','send','index','ServicenowAccount','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','include','rows','show','fields','find','catch','create','body','params','getConfigurations','findOne','ServicenowConfiguration','order','AccountId','getSubjects','channel','ServicenowField','Descriptions','getFields','made_sla','hold_reason','knowledge','close_code','notify','severity','category','parent','caused_by','sys_updated_on','child_incidents','approval_history','number','sys_updated_by','user_input','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','active','business_service','priority','rfc','time_worked','expected_start','opened_at','business_duration','work_end','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','incident_state','urgency','problem_id','company','reassignment_count','assigned_to','comments','sla_due','approval','sys_mod_count','sys_tags','correlation_id','password','email','remoteUri','serverUrl','slice','lastIndexOf','%s/api/now/doc/table/schema/','format','username','GET','result','log','incident\x20table\x20objects','assign','includes','internalType','label','push','all','TCL:\x20_object','remove','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','concat','ServiceNow\x20error:\x20','statusCode','Wrong\x20credentials','boolean','True','true','sys_choice?sysparm_query=name=incident^element=','inactive','false','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end'];(function(_0x4bf8df,_0x50309a){var _0x1657ee=function(_0x21e58e){while(--_0x21e58e){_0x4bf8df['push'](_0x4bf8df['shift']());}};_0x1657ee(++_0x50309a);}(_0x86f9,0x156));var _0x986f=function(_0x3181cc,_0x28447f){_0x3181cc=_0x3181cc-0x0;var _0x547a4a=_0x86f9[_0x3181cc];return _0x547a4a;};'use strict';var emlformat=require(_0x986f('0x0'));var rimraf=require(_0x986f('0x1'));var zipdir=require(_0x986f('0x2'));var jsonpatch=require(_0x986f('0x3'));var rp=require(_0x986f('0x4'));var moment=require('moment');var BPromise=require(_0x986f('0x5'));var Mustache=require(_0x986f('0x6'));var util=require(_0x986f('0x7'));var path=require(_0x986f('0x8'));var sox=require(_0x986f('0x9'));var csv=require(_0x986f('0xa'));var ejs=require(_0x986f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x986f('0xc'));var squel=require(_0x986f('0xd'));var crypto=require(_0x986f('0xe'));var jsforce=require(_0x986f('0xf'));var deskjs=require(_0x986f('0x10'));var toCsv=require(_0x986f('0xa'));var querystring=require(_0x986f('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x986f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x986f('0x13'));var hardwareService=require(_0x986f('0x14'));var logger=require(_0x986f('0x15'))(_0x986f('0x16'));var utils=require(_0x986f('0x17'));var config=require(_0x986f('0x18'));var licenseUtil=require(_0x986f('0x19'));var db=require(_0x986f('0x1a'))['db'];var integrations=require(_0x986f('0x1b'));function respondWithStatusCode(_0x264dd0,_0x380fac){_0x380fac=_0x380fac||0xcc;return function(_0x403576){if(_0x403576){return _0x264dd0[_0x986f('0x1c')](_0x380fac);}return _0x264dd0['status'](_0x380fac)[_0x986f('0x1d')]();};}function respondWithResult(_0x19b396,_0x1a502b){_0x1a502b=_0x1a502b||0xc8;return function(_0x3637ab){if(_0x3637ab){return _0x19b396['status'](_0x1a502b)[_0x986f('0x1e')](_0x3637ab);}};}function respondWithFilteredResult(_0x303c90,_0x5df5a3){return function(_0x5a87c2){if(_0x5a87c2){var _0x385a6b=typeof _0x5df5a3['offset']===_0x986f('0x1f')&&typeof _0x5df5a3[_0x986f('0x20')]===_0x986f('0x1f');var _0x5dd58b=_0x5a87c2['count'];var _0xe921e0=_0x385a6b?0x0:_0x5df5a3[_0x986f('0x21')];var _0x3b9aa0=_0x385a6b?_0x5a87c2[_0x986f('0x22')]:_0x5df5a3[_0x986f('0x21')]+_0x5df5a3[_0x986f('0x20')];var _0x5abded;if(_0x3b9aa0>=_0x5dd58b){_0x3b9aa0=_0x5dd58b;_0x5abded=0xc8;}else{_0x5abded=0xce;}_0x303c90['status'](_0x5abded);return _0x303c90['set'](_0x986f('0x23'),_0xe921e0+'-'+_0x3b9aa0+'/'+_0x5dd58b)['json'](_0x5a87c2);}return null;};}function patchUpdates(_0x498981){return function(_0x3721f7){try{jsonpatch[_0x986f('0x24')](_0x3721f7,_0x498981,!![]);}catch(_0x6a001c){return BPromise[_0x986f('0x25')](_0x6a001c);}return _0x3721f7[_0x986f('0x26')]();};}function saveUpdates(_0x1ba901,_0x5dd6ed){return function(_0xd5d736){if(_0xd5d736){return _0xd5d736[_0x986f('0x27')](_0x1ba901)[_0x986f('0x28')](function(_0x58cc9a){return _0x58cc9a;});}return null;};}function removeEntity(_0x4e8b76,_0x4ecaf1){return function(_0x1c0e7c){if(_0x1c0e7c){return _0x1c0e7c[_0x986f('0x29')]()[_0x986f('0x28')](function(){_0x4e8b76[_0x986f('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e5268,_0x3e0121){return function(_0x414a5b){if(!_0x414a5b){_0x1e5268[_0x986f('0x1c')](0x194);}return _0x414a5b;};}function handleError(_0x103faf,_0x30f5b8){_0x30f5b8=_0x30f5b8||0x1f4;return function(_0x6f21be){logger[_0x986f('0x2b')](_0x6f21be[_0x986f('0x2c')]);if(_0x6f21be['name']){delete _0x6f21be[_0x986f('0x2d')];}_0x103faf[_0x986f('0x2a')](_0x30f5b8)[_0x986f('0x2e')](_0x6f21be);};}exports[_0x986f('0x2f')]=function(_0x479c04,_0x3e229a){var _0x8e1bd4={},_0x495be9={},_0x29c800={'count':0x0,'rows':[]};var _0x5b8501=_['map'](db[_0x986f('0x30')][_0x986f('0x31')],function(_0x456c8e){return{'name':_0x456c8e[_0x986f('0x32')],'type':_0x456c8e[_0x986f('0x33')][_0x986f('0x34')]};});_0x495be9[_0x986f('0x35')]=_[_0x986f('0x36')](_0x5b8501,_0x986f('0x2d'));_0x495be9[_0x986f('0x37')]=_[_0x986f('0x38')](_0x479c04[_0x986f('0x37')]);_0x495be9['filters']=_[_0x986f('0x39')](_0x495be9['model'],_0x495be9[_0x986f('0x37')]);_0x8e1bd4[_0x986f('0x3a')]=_[_0x986f('0x39')](_0x495be9['model'],qs['fields'](_0x479c04[_0x986f('0x37')]['fields']));_0x8e1bd4[_0x986f('0x3a')]=_0x8e1bd4[_0x986f('0x3a')][_0x986f('0x3b')]?_0x8e1bd4[_0x986f('0x3a')]:_0x495be9[_0x986f('0x35')];if(!_0x479c04[_0x986f('0x37')][_0x986f('0x3c')](_0x986f('0x3d'))){_0x8e1bd4[_0x986f('0x20')]=qs[_0x986f('0x20')](_0x479c04[_0x986f('0x37')][_0x986f('0x20')]);_0x8e1bd4[_0x986f('0x21')]=qs['offset'](_0x479c04[_0x986f('0x37')][_0x986f('0x21')]);}_0x8e1bd4['order']=qs[_0x986f('0x3e')](_0x479c04[_0x986f('0x37')][_0x986f('0x3e')]);_0x8e1bd4[_0x986f('0x3f')]=qs[_0x986f('0x40')](_[_0x986f('0x41')](_0x479c04[_0x986f('0x37')],_0x495be9['filters']),_0x5b8501);if(_0x479c04['query']['filter']){_0x8e1bd4['where']=_['merge'](_0x8e1bd4[_0x986f('0x3f')],{'$or':_['map'](_0x5b8501,function(_0x2dcd91){if(_0x2dcd91[_0x986f('0x33')]!=='VIRTUAL'){var _0x53c8c0={};_0x53c8c0[_0x2dcd91['name']]={'$like':'%'+_0x479c04[_0x986f('0x37')][_0x986f('0x42')]+'%'};return _0x53c8c0;}})});}_0x8e1bd4=_[_0x986f('0x43')]({},_0x8e1bd4,_0x479c04[_0x986f('0x44')]);var _0x33377e={'where':_0x8e1bd4[_0x986f('0x3f')]};return db[_0x986f('0x30')][_0x986f('0x22')](_0x33377e)[_0x986f('0x28')](function(_0x112957){_0x29c800[_0x986f('0x22')]=_0x112957;if(_0x479c04[_0x986f('0x37')][_0x986f('0x45')]){_0x8e1bd4[_0x986f('0x46')]=[{'all':!![]}];}return db['ServicenowAccount']['findAll'](_0x8e1bd4);})[_0x986f('0x28')](function(_0x5eadd9){_0x29c800[_0x986f('0x47')]=_0x5eadd9;return _0x29c800;})[_0x986f('0x28')](respondWithFilteredResult(_0x3e229a,_0x8e1bd4))['catch'](handleError(_0x3e229a,null));};exports[_0x986f('0x48')]=function(_0x2773fd,_0x5b4c99){var _0x275494={'raw':![],'where':{'id':_0x2773fd['params']['id']}},_0x172f73={};_0x172f73[_0x986f('0x35')]=_[_0x986f('0x38')](db[_0x986f('0x30')][_0x986f('0x31')]);_0x172f73[_0x986f('0x37')]=_[_0x986f('0x38')](_0x2773fd[_0x986f('0x37')]);_0x172f73['filters']=_[_0x986f('0x39')](_0x172f73[_0x986f('0x35')],_0x172f73[_0x986f('0x37')]);_0x275494[_0x986f('0x3a')]=_['intersection'](_0x172f73[_0x986f('0x35')],qs['fields'](_0x2773fd[_0x986f('0x37')][_0x986f('0x49')]));_0x275494[_0x986f('0x3a')]=_0x275494[_0x986f('0x3a')]['length']?_0x275494[_0x986f('0x3a')]:_0x172f73[_0x986f('0x35')];if(_0x2773fd[_0x986f('0x37')]['includeAll']){_0x275494[_0x986f('0x46')]=[{'all':!![]}];}_0x275494=_[_0x986f('0x43')]({},_0x275494,_0x2773fd['options']);return db[_0x986f('0x30')][_0x986f('0x4a')](_0x275494)[_0x986f('0x28')](handleEntityNotFound(_0x5b4c99,null))['then'](respondWithResult(_0x5b4c99,null))[_0x986f('0x4b')](handleError(_0x5b4c99,null));};exports[_0x986f('0x4c')]=function(_0x3640b0,_0xc528d8){return db[_0x986f('0x30')]['create'](_0x3640b0[_0x986f('0x4d')],{})[_0x986f('0x28')](respondWithResult(_0xc528d8,0xc9))[_0x986f('0x4b')](handleError(_0xc528d8,null));};exports[_0x986f('0x27')]=function(_0x5d4ace,_0x198313){if(_0x5d4ace[_0x986f('0x4d')]['id']){delete _0x5d4ace['body']['id'];}return db[_0x986f('0x30')][_0x986f('0x4a')]({'where':{'id':_0x5d4ace[_0x986f('0x4e')]['id']}})[_0x986f('0x28')](handleEntityNotFound(_0x198313,null))[_0x986f('0x28')](saveUpdates(_0x5d4ace[_0x986f('0x4d')],null))['then'](respondWithResult(_0x198313,null))[_0x986f('0x4b')](handleError(_0x198313,null));};exports['destroy']=function(_0x4d9f73,_0x383f14){return db[_0x986f('0x30')]['find']({'where':{'id':_0x4d9f73['params']['id']}})[_0x986f('0x28')](handleEntityNotFound(_0x383f14,null))[_0x986f('0x28')](removeEntity(_0x383f14,null))['catch'](handleError(_0x383f14,null));};exports[_0x986f('0x4f')]=function(_0x594179,_0x578755,_0xf44557){var _0x1efde2={};var _0x505c8f={};var _0x1877f3;var _0x311270;return db[_0x986f('0x30')][_0x986f('0x50')]({'where':{'id':_0x594179['params']['id']}})[_0x986f('0x28')](handleEntityNotFound(_0x578755,null))[_0x986f('0x28')](function(_0x16eaec){if(_0x16eaec){_0x1877f3=_0x16eaec;_0x505c8f[_0x986f('0x35')]=_[_0x986f('0x38')](db[_0x986f('0x51')][_0x986f('0x31')]);_0x505c8f[_0x986f('0x37')]=_[_0x986f('0x38')](_0x594179[_0x986f('0x37')]);_0x505c8f[_0x986f('0x40')]=_[_0x986f('0x39')](_0x505c8f[_0x986f('0x35')],_0x505c8f[_0x986f('0x37')]);_0x1efde2[_0x986f('0x3a')]=_[_0x986f('0x39')](_0x505c8f['model'],qs[_0x986f('0x49')](_0x594179[_0x986f('0x37')][_0x986f('0x49')]));_0x1efde2[_0x986f('0x3a')]=_0x1efde2[_0x986f('0x3a')][_0x986f('0x3b')]?_0x1efde2[_0x986f('0x3a')]:_0x505c8f[_0x986f('0x35')];_0x1efde2[_0x986f('0x52')]=qs[_0x986f('0x3e')](_0x594179[_0x986f('0x37')][_0x986f('0x3e')]);_0x1efde2[_0x986f('0x3f')]=qs[_0x986f('0x40')](_[_0x986f('0x41')](_0x594179[_0x986f('0x37')],_0x505c8f['filters']));if(_0x594179['query'][_0x986f('0x42')]){_0x1efde2[_0x986f('0x3f')]=_['merge'](_0x1efde2[_0x986f('0x3f')],{'$or':_[_0x986f('0x36')](_0x1efde2[_0x986f('0x3a')],function(_0x2f0b28){var _0x477d83={};_0x477d83[_0x2f0b28]={'$like':'%'+_0x594179['query'][_0x986f('0x42')]+'%'};return _0x477d83;})});}_0x1efde2=_['merge']({},_0x1efde2,_0x594179['options']);return _0x1877f3[_0x986f('0x4f')](_0x1efde2);}})[_0x986f('0x28')](function(_0xef02c3){if(_0xef02c3){_0x311270=_0xef02c3['length'];if(!_0x594179['query'][_0x986f('0x3c')](_0x986f('0x3d'))){_0x1efde2[_0x986f('0x20')]=qs[_0x986f('0x20')](_0x594179[_0x986f('0x37')][_0x986f('0x20')]);_0x1efde2['offset']=qs[_0x986f('0x21')](_0x594179[_0x986f('0x37')][_0x986f('0x21')]);}return _0x1877f3[_0x986f('0x4f')](_0x1efde2);}})[_0x986f('0x28')](function(_0x1b0f62){if(_0x1b0f62){return _0x1b0f62?{'count':_0x311270,'rows':_0x1b0f62}:null;}})[_0x986f('0x28')](respondWithResult(_0x578755,null))[_0x986f('0x4b')](handleError(_0x578755,null));};exports['addConfiguration']=function(_0x5f5200,_0x27473f,_0x3417b8){if(_0x5f5200[_0x986f('0x4d')]['id']){delete _0x5f5200[_0x986f('0x4d')]['id'];}return db[_0x986f('0x30')]['findOne']({'where':{'id':_0x5f5200['params']['id']}})['then'](handleEntityNotFound(_0x27473f,null))[_0x986f('0x28')](function(_0x2bbf06){if(_0x2bbf06){_0x5f5200[_0x986f('0x4d')][_0x986f('0x53')]=_0x2bbf06['id'];_0x5f5200['body']['Subjects']=integrations[_0x986f('0x54')](_0x5f5200[_0x986f('0x4d')][_0x986f('0x55')],_0x5f5200[_0x986f('0x4d')][_0x986f('0x33')]);_0x5f5200[_0x986f('0x4d')]['Descriptions']=integrations['getDescriptions'](_0x5f5200['body'][_0x986f('0x55')],_0x5f5200[_0x986f('0x4d')]['type']);return db[_0x986f('0x51')][_0x986f('0x4c')](_0x5f5200['body'],{'include':[{'model':db[_0x986f('0x56')],'as':'Subjects'},{'model':db[_0x986f('0x56')],'as':_0x986f('0x57')}]});}return null;})[_0x986f('0x28')](respondWithResult(_0x27473f,null))[_0x986f('0x4b')](handleError(_0x27473f,null));};exports[_0x986f('0x58')]=function(_0x43f177,_0x1746a9,_0x2ff767){var _0x550dbc=[_0x986f('0x59'),_0x986f('0x5a'),_0x986f('0x5b'),'subcategory',_0x986f('0x5c'),_0x986f('0x5d'),'incident_state',_0x986f('0x5e'),_0x986f('0x5f')];var _0xc4d2b9=[_0x986f('0x60'),_0x986f('0x59'),_0x986f('0x61'),'watch_list','upon_reject',_0x986f('0x62'),_0x986f('0x63'),'hold_reason',_0x986f('0x64'),_0x986f('0x65'),'resolved_by',_0x986f('0x66'),'opened_by',_0x986f('0x67'),_0x986f('0x68'),_0x986f('0x69'),_0x986f('0x6a'),_0x986f('0x6b'),_0x986f('0x5b'),_0x986f('0x52'),_0x986f('0x6c'),_0x986f('0x6d'),_0x986f('0x6e'),_0x986f('0x6f'),'impact',_0x986f('0x70'),'work_notes_list',_0x986f('0x71'),_0x986f('0x72'),'sys_domain_path',_0x986f('0x73'),_0x986f('0x74'),_0x986f('0x75'),_0x986f('0x76'),_0x986f('0x77'),'group_list',_0x986f('0x78'),'reopened_time',_0x986f('0x79'),_0x986f('0x7a'),_0x986f('0x7b'),'subcategory',_0x986f('0x7c'),_0x986f('0x7d'),_0x986f('0x5c'),_0x986f('0x7e'),_0x986f('0x7f'),_0x986f('0x80'),_0x986f('0x81'),_0x986f('0x82'),_0x986f('0x83'),_0x986f('0x84'),_0x986f('0x85'),_0x986f('0x5d'),'sys_class_name','close_notes',_0x986f('0x86'),_0x986f('0x87'),_0x986f('0x88'),_0x986f('0x89'),_0x986f('0x8a'),_0x986f('0x8b'),_0x986f('0x8c'),_0x986f('0x8d'),_0x986f('0x8e'),_0x986f('0x8f'),_0x986f('0x90'),'activity_due',_0x986f('0x91'),_0x986f('0x5e'),_0x986f('0x92'),_0x986f('0x93'),_0x986f('0x94'),'comments_and_work_notes','due_date',_0x986f('0x95'),'reopen_count',_0x986f('0x96'),'escalation','upon_approval',_0x986f('0x97'),'location',_0x986f('0x5f')];var _0x318a56='';var _0x52e286='';var _0x71e824=[];var _0x59cbee='';var _0x5b9a73='';var _0x510cfa=[];var _0x2b5eca='';var _0x479ac4='';var _0x498aca={};var _0x48f086='';return db['ServicenowAccount'][_0x986f('0x50')]({'where':{'id':_0x43f177['params']['id']},'attributes':['id','username',_0x986f('0x98'),_0x986f('0x99'),_0x986f('0x9a'),_0x986f('0x9b')]})[_0x986f('0x28')](handleEntityNotFound(_0x1746a9,null))['then'](function(_0x592809){if(_0x592809){_0x48f086=_0x592809['remoteUri'];var _0x3ce96a=_0x48f086[_0x986f('0x9c')](-0x1);if(_0x3ce96a==='/'){_0x48f086=_0x48f086['substring'](0x0,_0x48f086[_0x986f('0x9d')](_0x3ce96a));}_0x479ac4=util['format'](_0x986f('0x9e'),_0x48f086);_0x2b5eca=util[_0x986f('0x9f')]('%s/api/now/table/',_0x48f086);_0x498aca={'user':_0x592809[_0x986f('0xa0')],'pass':_0x592809[_0x986f('0x98')]};var _0x4f71dc={'method':_0x986f('0xa1'),'uri':_0x479ac4+'incident?sysparm_display_value=all','auth':_0x498aca,'json':!![]};return rp(_0x4f71dc);}})['then'](function(_0x5e6c6c){if(_0x5e6c6c['result'][_0x986f('0x3b')]>0x0){_0x318a56=_0x5e6c6c[_0x986f('0xa2')];}console[_0x986f('0xa3')](_0x986f('0xa4'),_0x318a56);_0x510cfa=[];_0x52e286=Object[_0x986f('0xa5')]([],_0x318a56);_['remove'](_0x52e286,function(_0x4ea2c7){return!_0x550dbc[_0x986f('0xa6')](_0x4ea2c7[_0x986f('0x2d')]);});_0x52e286['forEach'](function(_0x17d00d){var _0x13b3c8=createFieldObject(_0x2b5eca,_0x498aca,_0x17d00d[_0x986f('0xa7')],_0x17d00d['name'],_0x17d00d[_0x986f('0xa8')],![]);_0x510cfa[_0x986f('0xa9')](_0x13b3c8);});return Promise[_0x986f('0xaa')](_0x510cfa);})['then'](function(_0x28d565){_0x71e824=_0x28d565;_0x59cbee=Object[_0x986f('0xa5')]([],_0x318a56);console['log'](_0x986f('0xab'),_0x318a56);_[_0x986f('0xac')](_0x59cbee,function(_0x5d2d27){return _0xc4d2b9[_0x986f('0xa6')](_0x5d2d27['name']);});console[_0x986f('0xa3')](_0x986f('0xad'),_0x59cbee);_0x510cfa=[];_0x59cbee[_0x986f('0xae')](function(_0x42b46c){var _0x32708b=createFieldObject(_0x2b5eca,_0x498aca,_0x42b46c[_0x986f('0xa7')],_0x42b46c['name'],_0x42b46c[_0x986f('0xa8')],!![]);_0x510cfa[_0x986f('0xa9')](_0x32708b);});return Promise[_0x986f('0xaa')](_0x510cfa);})[_0x986f('0x28')](function(_0x2723ba){_0x5b9a73=_0x2723ba;var _0x38d0cb=_0x71e824[_0x986f('0xaf')](_0x5b9a73);return{'count':_0x38d0cb['length'],'rows':_0x38d0cb};})[_0x986f('0x28')](respondWithResult(_0x1746a9,null))[_0x986f('0x4b')](function(_0x4e2895){console[_0x986f('0xa3')](_0x986f('0xb0')+_0x4e2895);var _0x1c6318=_0x43f177[_0x986f('0x37')]['test']?0x1f4:_0x4e2895[_0x986f('0xb1')]||0x1f4;logger['error'](_0x4e2895[_0x986f('0x2c')]);delete _0x4e2895['name'];if(_0x1c6318===0x191){_0x1c6318=0x190;}_0x1746a9[_0x986f('0x2a')](_0x1c6318)[_0x986f('0x2e')](_0x43f177[_0x986f('0x37')]['test']?{'message':_0x986f('0xb2'),'statusCode':_0x4e2895[_0x986f('0xb1')]}:_0x4e2895);});};function createFieldObject(_0x88f512,_0x2f958d,_0x1ee87c,_0x3ceadf,_0x41a6ee,_0x2bbcda){return new Promise(function(_0x4a46a5,_0x2e9eff){var _0x2413ca={'id':_0x3ceadf,'name':_0x41a6ee,'custom':_0x2bbcda};if(_0x1ee87c===_0x986f('0xb3')){_0x2413ca[_0x986f('0x44')]=[{'name':_0x986f('0xb4'),'value':_0x986f('0xb5')},{'name':'False','value':'false'}];_0x4a46a5(_0x2413ca);}else{var _0x5527ca={'method':'GET','uri':_0x88f512+_0x986f('0xb6')+_0x3ceadf,'auth':_0x2f958d,'json':!![]};return rp(_0x5527ca)[_0x986f('0x28')](function(_0x495288){var _0x2a2754=[];if(_0x495288[_0x986f('0xa2')][_0x986f('0x3b')]>0x0){_0x495288[_0x986f('0xa2')][_0x986f('0xae')](function(_0x5aa519){if(_0x5aa519[_0x986f('0xb7')]===_0x986f('0xb8')){var _0x140a39={'name':_0x5aa519[_0x986f('0xa8')],'value':_0x5aa519[_0x986f('0xb9')]};_0x2a2754['push'](_0x140a39);}});}_0x2413ca[_0x986f('0x44')]=_0x2a2754;if(_0x2413ca[_0x986f('0x44')][_0x986f('0x3b')]>0x0){_0x4a46a5(_0x2413ca);}else{if(_0x2bbcda==![]){_0x4a46a5();}else{_0x4a46a5(_0x2413ca);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 9affd41..32f83a8 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 _0x5075=['bluebird','request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x7cb955,_0x1f5509){var _0xef2fde=function(_0x2cfd64){while(--_0x2cfd64){_0x7cb955['push'](_0x7cb955['shift']());}};_0xef2fde(++_0x1f5509);}(_0x5075,0x73));var _0x5507=function(_0x1597e2,_0x388d3e){_0x1597e2=_0x1597e2-0x0;var _0x4c8c0a=_0x5075[_0x1597e2];return _0x4c8c0a;};'use strict';var _=require(_0x5507('0x0'));var util=require(_0x5507('0x1'));var logger=require(_0x5507('0x2'))(_0x5507('0x3'));var moment=require(_0x5507('0x4'));var BPromise=require(_0x5507('0x5'));var rp=require(_0x5507('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5507('0x7'));var config=require(_0x5507('0x8'));var attributes=require(_0x5507('0x9'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x2cd9ee,_0x773559){return _0x2cd9ee['define'](_0x5507('0xa'),attributes,{'tableName':_0x5507('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc1c6=['rimraf','../../components/integrations/configuration','define','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x25b910,_0x1da017){var _0x48a05e=function(_0x1e6128){while(--_0x1e6128){_0x25b910['push'](_0x25b910['shift']());}};_0x48a05e(++_0x1da017);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x2e65cf,_0x5a68d9){_0x2e65cf=_0x2e65cf-0x0;var _0x17230a=_0xc1c6[_0x2e65cf];return _0x17230a;};'use strict';var _=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var logger=require(_0x6c1c('0x2'))('api');var moment=require(_0x6c1c('0x3'));var BPromise=require('bluebird');var rp=require(_0x6c1c('0x4'));var fs=require('fs');var path=require(_0x6c1c('0x5'));var rimraf=require(_0x6c1c('0x6'));var config=require('../../config/environment');var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0x6c1c('0x7'));module['exports']=function(_0x50c1bb,_0x582bec){return _0x50c1bb[_0x6c1c('0x8')](_0x6c1c('0x9'),attributes,{'tableName':_0x6c1c('0xa'),'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 d1981a4..10e63bc 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 _0xe50a=['map','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','request','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','GetServicenowAccount','ServicenowAccount','findAll','options','where','include','attributes','model','then','catch','ShowServicenowAccount','find'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe50a,0x1c2));var _0xae50=function(_0x5a1a51,_0x144c79){_0x5a1a51=_0x5a1a51-0x0;var _0x47edd7=_0xe50a[_0x5a1a51];return _0x47edd7;};'use strict';var _=require(_0xae50('0x0'));var util=require(_0xae50('0x1'));var moment=require(_0xae50('0x2'));var BPromise=require(_0xae50('0x3'));var rs=require(_0xae50('0x4'));var fs=require('fs');var Redis=require(_0xae50('0x5'));var db=require(_0xae50('0x6'))['db'];var utils=require(_0xae50('0x7'));var logger=require(_0xae50('0x8'))('rpc');var config=require(_0xae50('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x201875,_0x48b1d9,_0x46cc96){return new BPromise(function(_0xfd1379,_0x465c45){return client[_0xae50('0xa')](_0x201875,_0x46cc96)['then'](function(_0x188740){logger[_0xae50('0xb')](_0xae50('0xc'),_0x48b1d9,_0xae50('0xd'));logger['debug'](_0xae50('0xe'),_0x48b1d9,_0xae50('0xd'),JSON[_0xae50('0xf')](_0x188740));if(_0x188740[_0xae50('0x10')]){if(_0x188740[_0xae50('0x10')]['code']===0x1f4){logger[_0xae50('0x10')](_0xae50('0xc'),_0x48b1d9,_0x188740[_0xae50('0x10')][_0xae50('0x11')]);return _0x465c45(_0x188740[_0xae50('0x10')][_0xae50('0x11')]);}logger[_0xae50('0x10')](_0xae50('0xc'),_0x48b1d9,_0x188740['error']['message']);return _0xfd1379(_0x188740[_0xae50('0x10')]['message']);}else{logger[_0xae50('0xb')](_0xae50('0xc'),_0x48b1d9,'request\x20sent');_0xfd1379(_0x188740['result'][_0xae50('0x11')]);}})['catch'](function(_0x3b8a13){logger[_0xae50('0x10')](_0xae50('0xc'),_0x48b1d9,_0x3b8a13);_0x465c45(_0x3b8a13);});});}exports[_0xae50('0x12')]=function(_0x44b274){var _0x3975ea=this;return new Promise(function(_0x4f3555,_0x37e714){return db[_0xae50('0x13')][_0xae50('0x14')]({'raw':_0x44b274[_0xae50('0x15')]?_0x44b274[_0xae50('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x44b274['options']?_0x44b274[_0xae50('0x15')][_0xae50('0x16')]||null:null,'attributes':_0x44b274[_0xae50('0x15')]?_0x44b274[_0xae50('0x15')]['attributes']||null:null,'limit':_0x44b274['options']?_0x44b274[_0xae50('0x15')]['limit']||null:null,'include':_0x44b274[_0xae50('0x15')]?_0x44b274[_0xae50('0x15')][_0xae50('0x17')]?_['map'](_0x44b274[_0xae50('0x15')]['include'],function(_0x482737){return{'model':db[_0x482737['model']],'as':_0x482737['as'],'attributes':_0x482737[_0xae50('0x18')],'include':_0x482737['include']?_['map'](_0x482737[_0xae50('0x17')],function(_0x5a7c7e){return{'model':db[_0x5a7c7e[_0xae50('0x19')]],'as':_0x5a7c7e['as'],'attributes':_0x5a7c7e['attributes'],'include':_0x5a7c7e['include']?_['map'](_0x5a7c7e['include'],function(_0x4460df){return{'model':db[_0x4460df['model']],'as':_0x4460df['as'],'attributes':_0x4460df[_0xae50('0x18')]};}):[]};}):[]};}):[]:[]})[_0xae50('0x1a')](function(_0x5c1530){logger['info'](_0xae50('0x12'),_0x44b274);logger['debug'](_0xae50('0x12'),_0x44b274,JSON[_0xae50('0xf')](_0x5c1530));_0x4f3555(_0x5c1530);})[_0xae50('0x1b')](function(_0x1f0d2a){logger[_0xae50('0x10')](_0xae50('0x12'),_0x1f0d2a[_0xae50('0x11')],_0x44b274);_0x37e714(_0x3975ea[_0xae50('0x10')](0x1f4,_0x1f0d2a[_0xae50('0x11')]));});});};exports[_0xae50('0x1c')]=function(_0x31e2aa){var _0x342bce=this;return new Promise(function(_0x2eeac2,_0x495bc1){return db[_0xae50('0x13')][_0xae50('0x1d')]({'raw':_0x31e2aa[_0xae50('0x15')]?_0x31e2aa['options']['raw']===undefined?!![]:![]:!![],'where':_0x31e2aa[_0xae50('0x15')]?_0x31e2aa[_0xae50('0x15')][_0xae50('0x16')]||null:null,'attributes':_0x31e2aa[_0xae50('0x15')]?_0x31e2aa[_0xae50('0x15')]['attributes']||null:null,'include':_0x31e2aa['options']?_0x31e2aa[_0xae50('0x15')][_0xae50('0x17')]?_[_0xae50('0x1e')](_0x31e2aa[_0xae50('0x15')]['include'],function(_0x1d305a){return{'model':db[_0x1d305a[_0xae50('0x19')]],'as':_0x1d305a['as'],'attributes':_0x1d305a[_0xae50('0x18')],'include':_0x1d305a[_0xae50('0x17')]?_[_0xae50('0x1e')](_0x1d305a[_0xae50('0x17')],function(_0x46c73e){return{'model':db[_0x46c73e[_0xae50('0x19')]],'as':_0x46c73e['as'],'attributes':_0x46c73e['attributes'],'include':_0x46c73e[_0xae50('0x17')]?_[_0xae50('0x1e')](_0x46c73e[_0xae50('0x17')],function(_0x2e86a2){return{'model':db[_0x2e86a2[_0xae50('0x19')]],'as':_0x2e86a2['as'],'attributes':_0x2e86a2[_0xae50('0x18')]};}):[]};}):[]};}):[]:[]})[_0xae50('0x1a')](function(_0x2f5471){logger[_0xae50('0xb')]('ShowServicenowAccount',_0x31e2aa);logger[_0xae50('0x1f')](_0xae50('0x1c'),_0x31e2aa,JSON['stringify'](_0x2f5471));_0x2eeac2(_0x2f5471);})['catch'](function(_0x46140d){logger[_0xae50('0x10')](_0xae50('0x1c'),_0x46140d[_0xae50('0x11')],_0x31e2aa);_0x495bc1(_0x342bce[_0xae50('0x10')](0x1f4,_0x46140d[_0xae50('0x11')]));});});}; \ No newline at end of file +var _0x06a9=['then','info','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowAccount,\x20%s,\x20%s','message','catch','ServicenowAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetServicenowAccount','debug','ShowServicenowAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','request'];(function(_0x554b1f,_0x2a93ee){var _0x2aac48=function(_0x28b440){while(--_0x28b440){_0x554b1f['push'](_0x554b1f['shift']());}};_0x2aac48(++_0x2a93ee);}(_0x06a9,0x153));var _0x906a=function(_0x5a21a4,_0xc836c4){_0x5a21a4=_0x5a21a4-0x0;var _0x3dc8d7=_0x06a9[_0x5a21a4];return _0x3dc8d7;};'use strict';var _=require(_0x906a('0x0'));var util=require(_0x906a('0x1'));var moment=require(_0x906a('0x2'));var BPromise=require(_0x906a('0x3'));var rs=require(_0x906a('0x4'));var fs=require('fs');var Redis=require(_0x906a('0x5'));var db=require(_0x906a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x906a('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x906a('0x8'));var client=jayson[_0x906a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15fd85,_0x5b63b4,_0x3cab48){return new BPromise(function(_0x30e9aa,_0x20f9ab){return client[_0x906a('0xa')](_0x15fd85,_0x3cab48)[_0x906a('0xb')](function(_0x589b74){logger[_0x906a('0xc')]('ServicenowAccount,\x20%s,\x20%s',_0x5b63b4,_0x906a('0xd'));logger['debug'](_0x906a('0xe'),_0x5b63b4,_0x906a('0xd'),JSON[_0x906a('0xf')](_0x589b74));if(_0x589b74[_0x906a('0x10')]){if(_0x589b74['error'][_0x906a('0x11')]===0x1f4){logger['error'](_0x906a('0x12'),_0x5b63b4,_0x589b74[_0x906a('0x10')][_0x906a('0x13')]);return _0x20f9ab(_0x589b74[_0x906a('0x10')][_0x906a('0x13')]);}logger[_0x906a('0x10')](_0x906a('0x12'),_0x5b63b4,_0x589b74[_0x906a('0x10')][_0x906a('0x13')]);return _0x30e9aa(_0x589b74[_0x906a('0x10')]['message']);}else{logger[_0x906a('0xc')]('ServicenowAccount,\x20%s,\x20%s',_0x5b63b4,_0x906a('0xd'));_0x30e9aa(_0x589b74['result'][_0x906a('0x13')]);}})[_0x906a('0x14')](function(_0x83a547){logger[_0x906a('0x10')](_0x906a('0x12'),_0x5b63b4,_0x83a547);_0x20f9ab(_0x83a547);});});}exports['GetServicenowAccount']=function(_0x18447d){var _0x43bc76=this;return new Promise(function(_0xbc116d,_0x1d4a2f){return db[_0x906a('0x15')][_0x906a('0x16')]({'raw':_0x18447d[_0x906a('0x17')]?_0x18447d['options'][_0x906a('0x18')]===undefined?!![]:![]:!![],'where':_0x18447d[_0x906a('0x17')]?_0x18447d[_0x906a('0x17')][_0x906a('0x19')]||null:null,'attributes':_0x18447d['options']?_0x18447d[_0x906a('0x17')][_0x906a('0x1a')]||null:null,'limit':_0x18447d[_0x906a('0x17')]?_0x18447d[_0x906a('0x17')][_0x906a('0x1b')]||null:null,'include':_0x18447d[_0x906a('0x17')]?_0x18447d[_0x906a('0x17')][_0x906a('0x1c')]?_[_0x906a('0x1d')](_0x18447d[_0x906a('0x17')][_0x906a('0x1c')],function(_0x4fec48){return{'model':db[_0x4fec48[_0x906a('0x1e')]],'as':_0x4fec48['as'],'attributes':_0x4fec48[_0x906a('0x1a')],'include':_0x4fec48['include']?_[_0x906a('0x1d')](_0x4fec48[_0x906a('0x1c')],function(_0x570d37){return{'model':db[_0x570d37['model']],'as':_0x570d37['as'],'attributes':_0x570d37[_0x906a('0x1a')],'include':_0x570d37[_0x906a('0x1c')]?_[_0x906a('0x1d')](_0x570d37['include'],function(_0x132165){return{'model':db[_0x132165[_0x906a('0x1e')]],'as':_0x132165['as'],'attributes':_0x132165[_0x906a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x906a('0xb')](function(_0x58578d){logger['info'](_0x906a('0x1f'),_0x18447d);logger[_0x906a('0x20')]('GetServicenowAccount',_0x18447d,JSON[_0x906a('0xf')](_0x58578d));_0xbc116d(_0x58578d);})[_0x906a('0x14')](function(_0x2191b8){logger[_0x906a('0x10')](_0x906a('0x1f'),_0x2191b8[_0x906a('0x13')],_0x18447d);_0x1d4a2f(_0x43bc76[_0x906a('0x10')](0x1f4,_0x2191b8[_0x906a('0x13')]));});});};exports[_0x906a('0x21')]=function(_0x2ddc0e){var _0x2d81a5=this;return new Promise(function(_0x451521,_0x500450){return db[_0x906a('0x15')][_0x906a('0x22')]({'raw':_0x2ddc0e[_0x906a('0x17')]?_0x2ddc0e[_0x906a('0x17')][_0x906a('0x18')]===undefined?!![]:![]:!![],'where':_0x2ddc0e[_0x906a('0x17')]?_0x2ddc0e[_0x906a('0x17')]['where']||null:null,'attributes':_0x2ddc0e['options']?_0x2ddc0e[_0x906a('0x17')][_0x906a('0x1a')]||null:null,'include':_0x2ddc0e['options']?_0x2ddc0e[_0x906a('0x17')][_0x906a('0x1c')]?_[_0x906a('0x1d')](_0x2ddc0e[_0x906a('0x17')]['include'],function(_0x3e540e){return{'model':db[_0x3e540e[_0x906a('0x1e')]],'as':_0x3e540e['as'],'attributes':_0x3e540e[_0x906a('0x1a')],'include':_0x3e540e['include']?_[_0x906a('0x1d')](_0x3e540e['include'],function(_0x5c2e5e){return{'model':db[_0x5c2e5e['model']],'as':_0x5c2e5e['as'],'attributes':_0x5c2e5e[_0x906a('0x1a')],'include':_0x5c2e5e[_0x906a('0x1c')]?_['map'](_0x5c2e5e[_0x906a('0x1c')],function(_0x39757c){return{'model':db[_0x39757c['model']],'as':_0x39757c['as'],'attributes':_0x39757c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c5972){logger[_0x906a('0xc')](_0x906a('0x21'),_0x2ddc0e);logger['debug'](_0x906a('0x21'),_0x2ddc0e,JSON[_0x906a('0xf')](_0x1c5972));_0x451521(_0x1c5972);})['catch'](function(_0x5d3dbd){logger['error']('ShowServicenowAccount',_0x5d3dbd['message'],_0x2ddc0e);_0x500450(_0x2d81a5[_0x906a('0x10')](0x1f4,_0x5d3dbd[_0x906a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index cab8fa7..803d7a0 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 _0xf5c6=['express','Router','../../components/auth/service','./intServicenowConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x443330,_0xbdd961){var _0x2c7914=function(_0x1f143a){while(--_0x1f143a){_0x443330['push'](_0x443330['shift']());}};_0x2c7914(++_0xbdd961);}(_0xf5c6,0xfb));var _0x6f5c=function(_0x143e5f,_0x5a1d9a){_0x143e5f=_0x143e5f-0x0;var _0x3d15c9=_0xf5c6[_0x143e5f];return _0x3d15c9;};'use strict';var multer=require(_0x6f5c('0x0'));var util=require(_0x6f5c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6f5c('0x2'));var router=express[_0x6f5c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6f5c('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6f5c('0x5'));router[_0x6f5c('0x6')]('/',auth['isAuthenticated'](),controller[_0x6f5c('0x7')]);router['get'](_0x6f5c('0x8'),auth[_0x6f5c('0x9')](),controller[_0x6f5c('0xa')]);router['get'](_0x6f5c('0xb'),auth[_0x6f5c('0x9')](),controller[_0x6f5c('0xc')]);router[_0x6f5c('0x6')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x6f5c('0xd')]);router[_0x6f5c('0x6')](_0x6f5c('0xe'),auth[_0x6f5c('0x9')](),controller[_0x6f5c('0xf')]);router[_0x6f5c('0x10')]('/',auth['isAuthenticated'](),controller[_0x6f5c('0x11')]);router[_0x6f5c('0x12')](_0x6f5c('0x8'),auth[_0x6f5c('0x9')](),controller[_0x6f5c('0x13')]);router[_0x6f5c('0x14')](_0x6f5c('0x8'),auth['isAuthenticated'](),controller[_0x6f5c('0x15')]);module[_0x6f5c('0x16')]=router; \ No newline at end of file +var _0x88a3=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/descriptions','getDescriptions','post','put','update','delete'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x88a3,0x1b6));var _0x388a=function(_0x3b59ed,_0x281a70){_0x3b59ed=_0x3b59ed-0x0;var _0x5cf829=_0x88a3[_0x3b59ed];return _0x5cf829;};'use strict';var multer=require(_0x388a('0x0'));var util=require(_0x388a('0x1'));var path=require(_0x388a('0x2'));var timeout=require(_0x388a('0x3'));var express=require(_0x388a('0x4'));var router=express[_0x388a('0x5')]();var fs_extra=require(_0x388a('0x6'));var auth=require(_0x388a('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x388a('0x8'));router[_0x388a('0x9')]('/',auth[_0x388a('0xa')](),controller[_0x388a('0xb')]);router['get'](_0x388a('0xc'),auth[_0x388a('0xa')](),controller[_0x388a('0xd')]);router[_0x388a('0x9')](_0x388a('0xe'),auth[_0x388a('0xa')](),controller[_0x388a('0xf')]);router[_0x388a('0x9')]('/:id/subjects',auth[_0x388a('0xa')](),controller['getSubjects']);router['get'](_0x388a('0x10'),auth['isAuthenticated'](),controller[_0x388a('0x11')]);router[_0x388a('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x388a('0x13')](_0x388a('0xc'),auth[_0x388a('0xa')](),controller[_0x388a('0x14')]);router[_0x388a('0x15')](_0x388a('0xc'),auth[_0x388a('0xa')](),controller['destroy']);module[_0x388a('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index a52c95e..f12828b 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 _0x0b93=['STRING','exports'];(function(_0x1f6739,_0x160c84){var _0x21015b=function(_0x139b3c){while(--_0x139b3c){_0x1f6739['push'](_0x1f6739['shift']());}};_0x21015b(++_0x160c84);}(_0x0b93,0x1cb));var _0x30b9=function(_0xe4d157,_0x1010a8){_0xe4d157=_0xe4d157-0x0;var _0x45405b=_0x0b93[_0xe4d157];return _0x45405b;};'use strict';var Sequelize=require('sequelize');module[_0x30b9('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x30b9('0x1')]}}; \ No newline at end of file +var _0xa8d9=['STRING','sequelize','exports'];(function(_0x2afa54,_0x2238da){var _0x9d584=function(_0x58ed0e){while(--_0x58ed0e){_0x2afa54['push'](_0x2afa54['shift']());}};_0x9d584(++_0x2238da);}(_0xa8d9,0x193));var _0x9a8d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa8d9[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x9a8d('0x0'));module[_0x9a8d('0x1')]={'name':{'type':Sequelize[_0x9a8d('0x2')]},'description':{'type':Sequelize[_0x9a8d('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index d7bf6bb..fdc4b0a 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 _0xc0a0=['model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','ServicenowConfiguration','include','findAll','rows','catch','show','params','keys','length','includeAll','create','body','find','findOne','ServicenowField','order','pick','getFields','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','then','stack','name','send','map','rawAttributes','key'];(function(_0x44c4e9,_0x3896fb){var _0x43dc2a=function(_0x5c2f96){while(--_0x5c2f96){_0x44c4e9['push'](_0x44c4e9['shift']());}};_0x43dc2a(++_0x3896fb);}(_0xc0a0,0x74));var _0x0c0a=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xc0a0[_0x5bd426];return _0x23a7eb;};'use strict';var emlformat=require(_0x0c0a('0x0'));var rimraf=require(_0x0c0a('0x1'));var zipdir=require(_0x0c0a('0x2'));var jsonpatch=require(_0x0c0a('0x3'));var rp=require(_0x0c0a('0x4'));var moment=require(_0x0c0a('0x5'));var BPromise=require(_0x0c0a('0x6'));var Mustache=require('mustache');var util=require(_0x0c0a('0x7'));var path=require(_0x0c0a('0x8'));var sox=require(_0x0c0a('0x9'));var csv=require(_0x0c0a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0c0a('0xb'));var _=require(_0x0c0a('0xc'));var squel=require(_0x0c0a('0xd'));var crypto=require(_0x0c0a('0xe'));var jsforce=require(_0x0c0a('0xf'));var deskjs=require(_0x0c0a('0x10'));var toCsv=require(_0x0c0a('0xa'));var querystring=require(_0x0c0a('0x11'));var Papa=require(_0x0c0a('0x12'));var Redis=require(_0x0c0a('0x13'));var authService=require(_0x0c0a('0x14'));var qs=require(_0x0c0a('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0c0a('0x16'));var logger=require(_0x0c0a('0x17'))(_0x0c0a('0x18'));var utils=require(_0x0c0a('0x19'));var config=require(_0x0c0a('0x1a'));var licenseUtil=require(_0x0c0a('0x1b'));var db=require(_0x0c0a('0x1c'))['db'];function respondWithStatusCode(_0x475c3d,_0x3cb04f){_0x3cb04f=_0x3cb04f||0xcc;return function(_0x38a3ff){if(_0x38a3ff){return _0x475c3d[_0x0c0a('0x1d')](_0x3cb04f);}return _0x475c3d[_0x0c0a('0x1e')](_0x3cb04f)[_0x0c0a('0x1f')]();};}function respondWithResult(_0x5156a4,_0x54fb93){_0x54fb93=_0x54fb93||0xc8;return function(_0x48fe9f){if(_0x48fe9f){return _0x5156a4[_0x0c0a('0x1e')](_0x54fb93)[_0x0c0a('0x20')](_0x48fe9f);}};}function respondWithFilteredResult(_0x5ecb68,_0x4c7470){return function(_0x446623){if(_0x446623){var _0x43dddf=typeof _0x4c7470[_0x0c0a('0x21')]==='undefined'&&typeof _0x4c7470[_0x0c0a('0x22')]===_0x0c0a('0x23');var _0x1e54c4=_0x446623[_0x0c0a('0x24')];var _0x1475ff=_0x43dddf?0x0:_0x4c7470[_0x0c0a('0x21')];var _0x28d465=_0x43dddf?_0x446623[_0x0c0a('0x24')]:_0x4c7470[_0x0c0a('0x21')]+_0x4c7470['limit'];var _0x2c0fa4;if(_0x28d465>=_0x1e54c4){_0x28d465=_0x1e54c4;_0x2c0fa4=0xc8;}else{_0x2c0fa4=0xce;}_0x5ecb68[_0x0c0a('0x1e')](_0x2c0fa4);return _0x5ecb68[_0x0c0a('0x25')](_0x0c0a('0x26'),_0x1475ff+'-'+_0x28d465+'/'+_0x1e54c4)[_0x0c0a('0x20')](_0x446623);}return null;};}function patchUpdates(_0x53f8b7){return function(_0x415a33){try{jsonpatch['apply'](_0x415a33,_0x53f8b7,!![]);}catch(_0x5881cf){return BPromise[_0x0c0a('0x27')](_0x5881cf);}return _0x415a33[_0x0c0a('0x28')]();};}function saveUpdates(_0x5a1e8a,_0x3f5ae7){return function(_0x37a338){if(_0x37a338){return _0x37a338[_0x0c0a('0x29')](_0x5a1e8a)['then'](function(_0x3c31fa){return _0x3c31fa;});}return null;};}function removeEntity(_0x14643f,_0xac5883){return function(_0x5d0d44){if(_0x5d0d44){return _0x5d0d44[_0x0c0a('0x2a')]()[_0x0c0a('0x2b')](function(){_0x14643f[_0x0c0a('0x1e')](0xcc)[_0x0c0a('0x1f')]();});}};}function handleEntityNotFound(_0x107f93,_0x181994){return function(_0x5e0c10){if(!_0x5e0c10){_0x107f93[_0x0c0a('0x1d')](0x194);}return _0x5e0c10;};}function handleError(_0x316d28,_0x35e710){_0x35e710=_0x35e710||0x1f4;return function(_0x3c1564){logger['error'](_0x3c1564[_0x0c0a('0x2c')]);if(_0x3c1564['name']){delete _0x3c1564[_0x0c0a('0x2d')];}_0x316d28[_0x0c0a('0x1e')](_0x35e710)[_0x0c0a('0x2e')](_0x3c1564);};}exports['index']=function(_0x43266a,_0x20669a){var _0x1a7ff3={},_0x566353={},_0x4e565f={'count':0x0,'rows':[]};var _0x52a601=_[_0x0c0a('0x2f')](db['ServicenowConfiguration'][_0x0c0a('0x30')],function(_0x5f6708){return{'name':_0x5f6708['fieldName'],'type':_0x5f6708['type'][_0x0c0a('0x31')]};});_0x566353[_0x0c0a('0x32')]=_[_0x0c0a('0x2f')](_0x52a601,_0x0c0a('0x2d'));_0x566353[_0x0c0a('0x33')]=_['keys'](_0x43266a[_0x0c0a('0x33')]);_0x566353[_0x0c0a('0x34')]=_[_0x0c0a('0x35')](_0x566353['model'],_0x566353[_0x0c0a('0x33')]);_0x1a7ff3[_0x0c0a('0x36')]=_['intersection'](_0x566353[_0x0c0a('0x32')],qs[_0x0c0a('0x37')](_0x43266a[_0x0c0a('0x33')][_0x0c0a('0x37')]));_0x1a7ff3[_0x0c0a('0x36')]=_0x1a7ff3['attributes']['length']?_0x1a7ff3[_0x0c0a('0x36')]:_0x566353[_0x0c0a('0x32')];if(!_0x43266a[_0x0c0a('0x33')][_0x0c0a('0x38')](_0x0c0a('0x39'))){_0x1a7ff3[_0x0c0a('0x22')]=qs[_0x0c0a('0x22')](_0x43266a['query']['limit']);_0x1a7ff3['offset']=qs['offset'](_0x43266a['query'][_0x0c0a('0x21')]);}_0x1a7ff3['order']=qs['sort'](_0x43266a['query'][_0x0c0a('0x3a')]);_0x1a7ff3[_0x0c0a('0x3b')]=qs['filters'](_['pick'](_0x43266a[_0x0c0a('0x33')],_0x566353[_0x0c0a('0x34')]),_0x52a601);if(_0x43266a[_0x0c0a('0x33')][_0x0c0a('0x3c')]){_0x1a7ff3[_0x0c0a('0x3b')]=_['merge'](_0x1a7ff3[_0x0c0a('0x3b')],{'$or':_['map'](_0x52a601,function(_0x562bd5){if(_0x562bd5['type']!==_0x0c0a('0x3d')){var _0x5b112e={};_0x5b112e[_0x562bd5[_0x0c0a('0x2d')]]={'$like':'%'+_0x43266a[_0x0c0a('0x33')]['filter']+'%'};return _0x5b112e;}})});}_0x1a7ff3=_[_0x0c0a('0x3e')]({},_0x1a7ff3,_0x43266a[_0x0c0a('0x3f')]);var _0x281a1d={'where':_0x1a7ff3['where']};return db[_0x0c0a('0x40')][_0x0c0a('0x24')](_0x281a1d)[_0x0c0a('0x2b')](function(_0x46a576){_0x4e565f[_0x0c0a('0x24')]=_0x46a576;if(_0x43266a[_0x0c0a('0x33')]['includeAll']){_0x1a7ff3[_0x0c0a('0x41')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x0c0a('0x42')](_0x1a7ff3);})['then'](function(_0x57fe4a){_0x4e565f[_0x0c0a('0x43')]=_0x57fe4a;return _0x4e565f;})['then'](respondWithFilteredResult(_0x20669a,_0x1a7ff3))[_0x0c0a('0x44')](handleError(_0x20669a,null));};exports[_0x0c0a('0x45')]=function(_0x42b9af,_0x794919){var _0x3e597b={'raw':![],'where':{'id':_0x42b9af[_0x0c0a('0x46')]['id']}},_0x597563={};_0x597563[_0x0c0a('0x32')]=_[_0x0c0a('0x47')](db['ServicenowConfiguration'][_0x0c0a('0x30')]);_0x597563[_0x0c0a('0x33')]=_['keys'](_0x42b9af[_0x0c0a('0x33')]);_0x597563[_0x0c0a('0x34')]=_['intersection'](_0x597563[_0x0c0a('0x32')],_0x597563[_0x0c0a('0x33')]);_0x3e597b[_0x0c0a('0x36')]=_[_0x0c0a('0x35')](_0x597563[_0x0c0a('0x32')],qs[_0x0c0a('0x37')](_0x42b9af['query'][_0x0c0a('0x37')]));_0x3e597b['attributes']=_0x3e597b['attributes'][_0x0c0a('0x48')]?_0x3e597b[_0x0c0a('0x36')]:_0x597563[_0x0c0a('0x32')];if(_0x42b9af[_0x0c0a('0x33')][_0x0c0a('0x49')]){_0x3e597b[_0x0c0a('0x41')]=[{'all':!![]}];}_0x3e597b=_[_0x0c0a('0x3e')]({},_0x3e597b,_0x42b9af[_0x0c0a('0x3f')]);return db[_0x0c0a('0x40')]['find'](_0x3e597b)[_0x0c0a('0x2b')](handleEntityNotFound(_0x794919,null))['then'](respondWithResult(_0x794919,null))[_0x0c0a('0x44')](handleError(_0x794919,null));};exports[_0x0c0a('0x4a')]=function(_0x1b353e,_0x5f2e88){return db[_0x0c0a('0x40')][_0x0c0a('0x4a')](_0x1b353e[_0x0c0a('0x4b')],{})['then'](respondWithResult(_0x5f2e88,0xc9))[_0x0c0a('0x44')](handleError(_0x5f2e88,null));};exports[_0x0c0a('0x29')]=function(_0x3fa2b9,_0x12cdf9){if(_0x3fa2b9['body']['id']){delete _0x3fa2b9[_0x0c0a('0x4b')]['id'];}return db[_0x0c0a('0x40')][_0x0c0a('0x4c')]({'where':{'id':_0x3fa2b9[_0x0c0a('0x46')]['id']}})[_0x0c0a('0x2b')](handleEntityNotFound(_0x12cdf9,null))['then'](saveUpdates(_0x3fa2b9[_0x0c0a('0x4b')],null))[_0x0c0a('0x2b')](respondWithResult(_0x12cdf9,null))[_0x0c0a('0x44')](handleError(_0x12cdf9,null));};exports['destroy']=function(_0x42be92,_0x9e1e65){return db[_0x0c0a('0x40')][_0x0c0a('0x4c')]({'where':{'id':_0x42be92['params']['id']}})[_0x0c0a('0x2b')](handleEntityNotFound(_0x9e1e65,null))[_0x0c0a('0x2b')](removeEntity(_0x9e1e65,null))['catch'](handleError(_0x9e1e65,null));};exports['getFields']=function(_0x391eb1,_0x2f794e,_0xf91e15){var _0x417e0b={};var _0x390460={};var _0x2bc923;var _0x1030d3;return db['ServicenowConfiguration'][_0x0c0a('0x4d')]({'where':{'id':_0x391eb1[_0x0c0a('0x46')]['id']}})['then'](handleEntityNotFound(_0x2f794e,null))[_0x0c0a('0x2b')](function(_0x4a3957){if(_0x4a3957){_0x2bc923=_0x4a3957;_0x390460[_0x0c0a('0x32')]=_[_0x0c0a('0x47')](db[_0x0c0a('0x4e')][_0x0c0a('0x30')]);_0x390460['query']=_[_0x0c0a('0x47')](_0x391eb1['query']);_0x390460['filters']=_[_0x0c0a('0x35')](_0x390460['model'],_0x390460[_0x0c0a('0x33')]);_0x417e0b[_0x0c0a('0x36')]=_['intersection'](_0x390460[_0x0c0a('0x32')],qs[_0x0c0a('0x37')](_0x391eb1[_0x0c0a('0x33')][_0x0c0a('0x37')]));_0x417e0b[_0x0c0a('0x36')]=_0x417e0b[_0x0c0a('0x36')][_0x0c0a('0x48')]?_0x417e0b[_0x0c0a('0x36')]:_0x390460[_0x0c0a('0x32')];_0x417e0b[_0x0c0a('0x4f')]=qs[_0x0c0a('0x3a')](_0x391eb1['query'][_0x0c0a('0x3a')]);_0x417e0b[_0x0c0a('0x3b')]=qs[_0x0c0a('0x34')](_[_0x0c0a('0x50')](_0x391eb1[_0x0c0a('0x33')],_0x390460[_0x0c0a('0x34')]));if(_0x391eb1[_0x0c0a('0x33')]['filter']){_0x417e0b[_0x0c0a('0x3b')]=_[_0x0c0a('0x3e')](_0x417e0b[_0x0c0a('0x3b')],{'$or':_['map'](_0x417e0b[_0x0c0a('0x36')],function(_0x5c71a7){var _0x369130={};_0x369130[_0x5c71a7]={'$like':'%'+_0x391eb1[_0x0c0a('0x33')][_0x0c0a('0x3c')]+'%'};return _0x369130;})});}_0x417e0b=_[_0x0c0a('0x3e')]({},_0x417e0b,_0x391eb1[_0x0c0a('0x3f')]);return _0x2bc923[_0x0c0a('0x51')](_0x417e0b);}})[_0x0c0a('0x2b')](function(_0x547adc){if(_0x547adc){_0x1030d3=_0x547adc['length'];if(!_0x391eb1[_0x0c0a('0x33')][_0x0c0a('0x38')](_0x0c0a('0x39'))){_0x417e0b[_0x0c0a('0x22')]=qs[_0x0c0a('0x22')](_0x391eb1[_0x0c0a('0x33')]['limit']);_0x417e0b['offset']=qs[_0x0c0a('0x21')](_0x391eb1[_0x0c0a('0x33')]['offset']);}return _0x2bc923[_0x0c0a('0x51')](_0x417e0b);}})[_0x0c0a('0x2b')](function(_0x549ac8){if(_0x549ac8){return _0x549ac8?{'count':_0x1030d3,'rows':_0x549ac8}:null;}})[_0x0c0a('0x2b')](respondWithResult(_0x2f794e,null))['catch'](handleError(_0x2f794e,null));};exports['getSubjects']=function(_0x349054,_0x14eac4,_0x327e04){var _0x3b416b={};var _0x2057bd={};var _0x3a3af4;var _0x34201e;return db[_0x0c0a('0x40')]['findOne']({'where':{'id':_0x349054[_0x0c0a('0x46')]['id']}})[_0x0c0a('0x2b')](handleEntityNotFound(_0x14eac4,null))['then'](function(_0x54fa3d){if(_0x54fa3d){_0x3a3af4=_0x54fa3d;_0x2057bd[_0x0c0a('0x32')]=_[_0x0c0a('0x47')](db[_0x0c0a('0x4e')][_0x0c0a('0x30')]);_0x2057bd['query']=_[_0x0c0a('0x47')](_0x349054[_0x0c0a('0x33')]);_0x2057bd[_0x0c0a('0x34')]=_['intersection'](_0x2057bd[_0x0c0a('0x32')],_0x2057bd[_0x0c0a('0x33')]);_0x3b416b[_0x0c0a('0x36')]=_[_0x0c0a('0x35')](_0x2057bd['model'],qs['fields'](_0x349054[_0x0c0a('0x33')]['fields']));_0x3b416b[_0x0c0a('0x36')]=_0x3b416b[_0x0c0a('0x36')][_0x0c0a('0x48')]?_0x3b416b[_0x0c0a('0x36')]:_0x2057bd[_0x0c0a('0x32')];_0x3b416b[_0x0c0a('0x4f')]=qs[_0x0c0a('0x3a')](_0x349054['query'][_0x0c0a('0x3a')]);_0x3b416b['where']=qs[_0x0c0a('0x34')](_['pick'](_0x349054[_0x0c0a('0x33')],_0x2057bd['filters']));if(_0x349054[_0x0c0a('0x33')][_0x0c0a('0x3c')]){_0x3b416b['where']=_[_0x0c0a('0x3e')](_0x3b416b[_0x0c0a('0x3b')],{'$or':_[_0x0c0a('0x2f')](_0x3b416b['attributes'],function(_0x2538cc){var _0x45f569={};_0x45f569[_0x2538cc]={'$like':'%'+_0x349054['query'][_0x0c0a('0x3c')]+'%'};return _0x45f569;})});}_0x3b416b=_['merge']({},_0x3b416b,_0x349054[_0x0c0a('0x3f')]);return _0x3a3af4['getSubjects'](_0x3b416b);}})[_0x0c0a('0x2b')](function(_0x165143){if(_0x165143){_0x34201e=_0x165143['length'];if(!_0x349054[_0x0c0a('0x33')]['hasOwnProperty'](_0x0c0a('0x39'))){_0x3b416b['limit']=qs[_0x0c0a('0x22')](_0x349054[_0x0c0a('0x33')][_0x0c0a('0x22')]);_0x3b416b[_0x0c0a('0x21')]=qs[_0x0c0a('0x21')](_0x349054[_0x0c0a('0x33')][_0x0c0a('0x21')]);}return _0x3a3af4['getSubjects'](_0x3b416b);}})[_0x0c0a('0x2b')](function(_0x1d249f){if(_0x1d249f){return _0x1d249f?{'count':_0x34201e,'rows':_0x1d249f}:null;}})[_0x0c0a('0x2b')](respondWithResult(_0x14eac4,null))[_0x0c0a('0x44')](handleError(_0x14eac4,null));};exports[_0x0c0a('0x52')]=function(_0x7ebb00,_0x2c8384,_0x53840c){var _0x1048c9={};var _0x24b240={};var _0x1bc863;var _0x141a2b;return db[_0x0c0a('0x40')][_0x0c0a('0x4d')]({'where':{'id':_0x7ebb00[_0x0c0a('0x46')]['id']}})[_0x0c0a('0x2b')](handleEntityNotFound(_0x2c8384,null))[_0x0c0a('0x2b')](function(_0x15057c){if(_0x15057c){_0x1bc863=_0x15057c;_0x24b240[_0x0c0a('0x32')]=_[_0x0c0a('0x47')](db[_0x0c0a('0x4e')][_0x0c0a('0x30')]);_0x24b240[_0x0c0a('0x33')]=_[_0x0c0a('0x47')](_0x7ebb00[_0x0c0a('0x33')]);_0x24b240['filters']=_['intersection'](_0x24b240[_0x0c0a('0x32')],_0x24b240[_0x0c0a('0x33')]);_0x1048c9[_0x0c0a('0x36')]=_['intersection'](_0x24b240[_0x0c0a('0x32')],qs[_0x0c0a('0x37')](_0x7ebb00[_0x0c0a('0x33')]['fields']));_0x1048c9[_0x0c0a('0x36')]=_0x1048c9['attributes'][_0x0c0a('0x48')]?_0x1048c9['attributes']:_0x24b240['model'];_0x1048c9['order']=qs[_0x0c0a('0x3a')](_0x7ebb00['query'][_0x0c0a('0x3a')]);_0x1048c9[_0x0c0a('0x3b')]=qs[_0x0c0a('0x34')](_[_0x0c0a('0x50')](_0x7ebb00[_0x0c0a('0x33')],_0x24b240[_0x0c0a('0x34')]));if(_0x7ebb00['query']['filter']){_0x1048c9[_0x0c0a('0x3b')]=_['merge'](_0x1048c9['where'],{'$or':_[_0x0c0a('0x2f')](_0x1048c9[_0x0c0a('0x36')],function(_0x2bd03d){var _0x1302a5={};_0x1302a5[_0x2bd03d]={'$like':'%'+_0x7ebb00[_0x0c0a('0x33')]['filter']+'%'};return _0x1302a5;})});}_0x1048c9=_[_0x0c0a('0x3e')]({},_0x1048c9,_0x7ebb00[_0x0c0a('0x3f')]);return _0x1bc863[_0x0c0a('0x52')](_0x1048c9);}})[_0x0c0a('0x2b')](function(_0xa175a){if(_0xa175a){_0x141a2b=_0xa175a['length'];if(!_0x7ebb00['query'][_0x0c0a('0x38')](_0x0c0a('0x39'))){_0x1048c9[_0x0c0a('0x22')]=qs[_0x0c0a('0x22')](_0x7ebb00[_0x0c0a('0x33')]['limit']);_0x1048c9[_0x0c0a('0x21')]=qs[_0x0c0a('0x21')](_0x7ebb00['query']['offset']);}return _0x1bc863[_0x0c0a('0x52')](_0x1048c9);}})[_0x0c0a('0x2b')](function(_0x233f11){if(_0x233f11){return _0x233f11?{'count':_0x141a2b,'rows':_0x233f11}:null;}})['then'](respondWithResult(_0x2c8384,null))[_0x0c0a('0x44')](handleError(_0x2c8384,null));}; \ No newline at end of file +var _0xc8e5=['fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','filter','options','findAll','catch','params','includeAll','include','create','body','find','getFields','findOne','ServicenowField','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','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','destroy','then','sendStatus','error','name','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes'];(function(_0x32e7ab,_0x27e140){var _0xefc69c=function(_0xbe3ea1){while(--_0xbe3ea1){_0x32e7ab['push'](_0x32e7ab['shift']());}};_0xefc69c(++_0x27e140);}(_0xc8e5,0x116));var _0x5c8e=function(_0x445d09,_0x9630c7){_0x445d09=_0x445d09-0x0;var _0x4033ce=_0xc8e5[_0x445d09];return _0x4033ce;};'use strict';var emlformat=require(_0x5c8e('0x0'));var rimraf=require(_0x5c8e('0x1'));var zipdir=require(_0x5c8e('0x2'));var jsonpatch=require(_0x5c8e('0x3'));var rp=require(_0x5c8e('0x4'));var moment=require(_0x5c8e('0x5'));var BPromise=require(_0x5c8e('0x6'));var Mustache=require(_0x5c8e('0x7'));var util=require(_0x5c8e('0x8'));var path=require(_0x5c8e('0x9'));var sox=require(_0x5c8e('0xa'));var csv=require(_0x5c8e('0xb'));var ejs=require(_0x5c8e('0xc'));var fs=require('fs');var fs_extra=require(_0x5c8e('0xd'));var _=require(_0x5c8e('0xe'));var squel=require(_0x5c8e('0xf'));var crypto=require(_0x5c8e('0x10'));var jsforce=require(_0x5c8e('0x11'));var deskjs=require(_0x5c8e('0x12'));var toCsv=require(_0x5c8e('0xb'));var querystring=require(_0x5c8e('0x13'));var Papa=require(_0x5c8e('0x14'));var Redis=require(_0x5c8e('0x15'));var authService=require('../../components/auth/service');var qs=require(_0x5c8e('0x16'));var as=require(_0x5c8e('0x17'));var hardwareService=require(_0x5c8e('0x18'));var logger=require(_0x5c8e('0x19'))(_0x5c8e('0x1a'));var utils=require(_0x5c8e('0x1b'));var config=require(_0x5c8e('0x1c'));var licenseUtil=require(_0x5c8e('0x1d'));var db=require(_0x5c8e('0x1e'))['db'];function respondWithStatusCode(_0x4910b5,_0x43914a){_0x43914a=_0x43914a||0xcc;return function(_0xe57719){if(_0xe57719){return _0x4910b5['sendStatus'](_0x43914a);}return _0x4910b5[_0x5c8e('0x1f')](_0x43914a)[_0x5c8e('0x20')]();};}function respondWithResult(_0x462675,_0x198b40){_0x198b40=_0x198b40||0xc8;return function(_0x3a5ac8){if(_0x3a5ac8){return _0x462675[_0x5c8e('0x1f')](_0x198b40)[_0x5c8e('0x21')](_0x3a5ac8);}};}function respondWithFilteredResult(_0x35ab5b,_0x409b8f){return function(_0x480b6d){if(_0x480b6d){var _0x3f461e=typeof _0x409b8f[_0x5c8e('0x22')]===_0x5c8e('0x23')&&typeof _0x409b8f['limit']===_0x5c8e('0x23');var _0x3d2a02=_0x480b6d[_0x5c8e('0x24')];var _0x232345=_0x3f461e?0x0:_0x409b8f['offset'];var _0x12d1e7=_0x3f461e?_0x480b6d[_0x5c8e('0x24')]:_0x409b8f['offset']+_0x409b8f[_0x5c8e('0x25')];var _0x2c68da;if(_0x12d1e7>=_0x3d2a02){_0x12d1e7=_0x3d2a02;_0x2c68da=0xc8;}else{_0x2c68da=0xce;}_0x35ab5b[_0x5c8e('0x1f')](_0x2c68da);return _0x35ab5b[_0x5c8e('0x26')]('Content-Range',_0x232345+'-'+_0x12d1e7+'/'+_0x3d2a02)[_0x5c8e('0x21')](_0x480b6d);}return null;};}function patchUpdates(_0x3bb7dd){return function(_0x168f29){try{jsonpatch[_0x5c8e('0x27')](_0x168f29,_0x3bb7dd,!![]);}catch(_0x48bb61){return BPromise['reject'](_0x48bb61);}return _0x168f29[_0x5c8e('0x28')]();};}function saveUpdates(_0x53aabe,_0x2399db){return function(_0x3958ad){if(_0x3958ad){return _0x3958ad[_0x5c8e('0x29')](_0x53aabe)['then'](function(_0x38409b){return _0x38409b;});}return null;};}function removeEntity(_0x4c5d64,_0x134107){return function(_0x529ea6){if(_0x529ea6){return _0x529ea6[_0x5c8e('0x2a')]()[_0x5c8e('0x2b')](function(){_0x4c5d64[_0x5c8e('0x1f')](0xcc)[_0x5c8e('0x20')]();});}};}function handleEntityNotFound(_0xced6f6,_0x683bb){return function(_0x5196c7){if(!_0x5196c7){_0xced6f6[_0x5c8e('0x2c')](0x194);}return _0x5196c7;};}function handleError(_0xbbb6e0,_0x40cb1a){_0x40cb1a=_0x40cb1a||0x1f4;return function(_0x4337a9){logger[_0x5c8e('0x2d')](_0x4337a9['stack']);if(_0x4337a9[_0x5c8e('0x2e')]){delete _0x4337a9[_0x5c8e('0x2e')];}_0xbbb6e0[_0x5c8e('0x1f')](_0x40cb1a)['send'](_0x4337a9);};}exports['index']=function(_0x91367f,_0x1afc76){var _0x13e155={},_0x17aa14={},_0xbf95cf={'count':0x0,'rows':[]};var _0x2ed6a3=_[_0x5c8e('0x2f')](db[_0x5c8e('0x30')][_0x5c8e('0x31')],function(_0xd54d34){return{'name':_0xd54d34[_0x5c8e('0x32')],'type':_0xd54d34[_0x5c8e('0x33')][_0x5c8e('0x34')]};});_0x17aa14[_0x5c8e('0x35')]=_[_0x5c8e('0x2f')](_0x2ed6a3,_0x5c8e('0x2e'));_0x17aa14[_0x5c8e('0x36')]=_[_0x5c8e('0x37')](_0x91367f[_0x5c8e('0x36')]);_0x17aa14['filters']=_[_0x5c8e('0x38')](_0x17aa14[_0x5c8e('0x35')],_0x17aa14[_0x5c8e('0x36')]);_0x13e155[_0x5c8e('0x39')]=_[_0x5c8e('0x38')](_0x17aa14['model'],qs[_0x5c8e('0x3a')](_0x91367f[_0x5c8e('0x36')][_0x5c8e('0x3a')]));_0x13e155[_0x5c8e('0x39')]=_0x13e155[_0x5c8e('0x39')][_0x5c8e('0x3b')]?_0x13e155[_0x5c8e('0x39')]:_0x17aa14[_0x5c8e('0x35')];if(!_0x91367f['query'][_0x5c8e('0x3c')](_0x5c8e('0x3d'))){_0x13e155[_0x5c8e('0x25')]=qs[_0x5c8e('0x25')](_0x91367f[_0x5c8e('0x36')][_0x5c8e('0x25')]);_0x13e155[_0x5c8e('0x22')]=qs[_0x5c8e('0x22')](_0x91367f['query'][_0x5c8e('0x22')]);}_0x13e155[_0x5c8e('0x3e')]=qs[_0x5c8e('0x3f')](_0x91367f['query'][_0x5c8e('0x3f')]);_0x13e155['where']=qs[_0x5c8e('0x40')](_[_0x5c8e('0x41')](_0x91367f[_0x5c8e('0x36')],_0x17aa14[_0x5c8e('0x40')]),_0x2ed6a3);if(_0x91367f[_0x5c8e('0x36')]['filter']){_0x13e155[_0x5c8e('0x42')]=_[_0x5c8e('0x43')](_0x13e155['where'],{'$or':_[_0x5c8e('0x2f')](_0x2ed6a3,function(_0x195734){if(_0x195734[_0x5c8e('0x33')]!==_0x5c8e('0x44')){var _0x4d0e2d={};_0x4d0e2d[_0x195734[_0x5c8e('0x2e')]]={'$like':'%'+_0x91367f[_0x5c8e('0x36')][_0x5c8e('0x45')]+'%'};return _0x4d0e2d;}})});}_0x13e155=_['merge']({},_0x13e155,_0x91367f[_0x5c8e('0x46')]);var _0x478fa7={'where':_0x13e155['where']};return db[_0x5c8e('0x30')][_0x5c8e('0x24')](_0x478fa7)[_0x5c8e('0x2b')](function(_0x506b10){_0xbf95cf[_0x5c8e('0x24')]=_0x506b10;if(_0x91367f[_0x5c8e('0x36')]['includeAll']){_0x13e155['include']=[{'all':!![]}];}return db[_0x5c8e('0x30')][_0x5c8e('0x47')](_0x13e155);})[_0x5c8e('0x2b')](function(_0x26bfa5){_0xbf95cf['rows']=_0x26bfa5;return _0xbf95cf;})[_0x5c8e('0x2b')](respondWithFilteredResult(_0x1afc76,_0x13e155))[_0x5c8e('0x48')](handleError(_0x1afc76,null));};exports['show']=function(_0x34e3c5,_0xed0d84){var _0x4c67b2={'raw':![],'where':{'id':_0x34e3c5[_0x5c8e('0x49')]['id']}},_0x235a0c={};_0x235a0c[_0x5c8e('0x35')]=_[_0x5c8e('0x37')](db[_0x5c8e('0x30')][_0x5c8e('0x31')]);_0x235a0c[_0x5c8e('0x36')]=_[_0x5c8e('0x37')](_0x34e3c5['query']);_0x235a0c[_0x5c8e('0x40')]=_['intersection'](_0x235a0c['model'],_0x235a0c[_0x5c8e('0x36')]);_0x4c67b2['attributes']=_[_0x5c8e('0x38')](_0x235a0c[_0x5c8e('0x35')],qs[_0x5c8e('0x3a')](_0x34e3c5[_0x5c8e('0x36')]['fields']));_0x4c67b2[_0x5c8e('0x39')]=_0x4c67b2[_0x5c8e('0x39')][_0x5c8e('0x3b')]?_0x4c67b2[_0x5c8e('0x39')]:_0x235a0c['model'];if(_0x34e3c5[_0x5c8e('0x36')][_0x5c8e('0x4a')]){_0x4c67b2[_0x5c8e('0x4b')]=[{'all':!![]}];}_0x4c67b2=_[_0x5c8e('0x43')]({},_0x4c67b2,_0x34e3c5[_0x5c8e('0x46')]);return db[_0x5c8e('0x30')]['find'](_0x4c67b2)[_0x5c8e('0x2b')](handleEntityNotFound(_0xed0d84,null))[_0x5c8e('0x2b')](respondWithResult(_0xed0d84,null))[_0x5c8e('0x48')](handleError(_0xed0d84,null));};exports[_0x5c8e('0x4c')]=function(_0x20c523,_0xf60890){return db[_0x5c8e('0x30')][_0x5c8e('0x4c')](_0x20c523[_0x5c8e('0x4d')],{})[_0x5c8e('0x2b')](respondWithResult(_0xf60890,0xc9))[_0x5c8e('0x48')](handleError(_0xf60890,null));};exports['update']=function(_0x2dc062,_0x4741f5){if(_0x2dc062['body']['id']){delete _0x2dc062[_0x5c8e('0x4d')]['id'];}return db[_0x5c8e('0x30')][_0x5c8e('0x4e')]({'where':{'id':_0x2dc062[_0x5c8e('0x49')]['id']}})['then'](handleEntityNotFound(_0x4741f5,null))[_0x5c8e('0x2b')](saveUpdates(_0x2dc062[_0x5c8e('0x4d')],null))[_0x5c8e('0x2b')](respondWithResult(_0x4741f5,null))[_0x5c8e('0x48')](handleError(_0x4741f5,null));};exports[_0x5c8e('0x2a')]=function(_0x4713bf,_0x1f5a84){return db[_0x5c8e('0x30')][_0x5c8e('0x4e')]({'where':{'id':_0x4713bf[_0x5c8e('0x49')]['id']}})['then'](handleEntityNotFound(_0x1f5a84,null))[_0x5c8e('0x2b')](removeEntity(_0x1f5a84,null))[_0x5c8e('0x48')](handleError(_0x1f5a84,null));};exports[_0x5c8e('0x4f')]=function(_0x2f30f6,_0x4a8e41,_0x327ddb){var _0x547a6f={};var _0x2cb1fa={};var _0x1abd00;var _0x20980e;return db[_0x5c8e('0x30')][_0x5c8e('0x50')]({'where':{'id':_0x2f30f6['params']['id']}})[_0x5c8e('0x2b')](handleEntityNotFound(_0x4a8e41,null))[_0x5c8e('0x2b')](function(_0x524694){if(_0x524694){_0x1abd00=_0x524694;_0x2cb1fa[_0x5c8e('0x35')]=_['keys'](db[_0x5c8e('0x51')]['rawAttributes']);_0x2cb1fa[_0x5c8e('0x36')]=_['keys'](_0x2f30f6[_0x5c8e('0x36')]);_0x2cb1fa[_0x5c8e('0x40')]=_[_0x5c8e('0x38')](_0x2cb1fa[_0x5c8e('0x35')],_0x2cb1fa['query']);_0x547a6f['attributes']=_[_0x5c8e('0x38')](_0x2cb1fa[_0x5c8e('0x35')],qs[_0x5c8e('0x3a')](_0x2f30f6[_0x5c8e('0x36')]['fields']));_0x547a6f[_0x5c8e('0x39')]=_0x547a6f[_0x5c8e('0x39')][_0x5c8e('0x3b')]?_0x547a6f[_0x5c8e('0x39')]:_0x2cb1fa[_0x5c8e('0x35')];_0x547a6f[_0x5c8e('0x3e')]=qs[_0x5c8e('0x3f')](_0x2f30f6[_0x5c8e('0x36')]['sort']);_0x547a6f[_0x5c8e('0x42')]=qs['filters'](_[_0x5c8e('0x41')](_0x2f30f6[_0x5c8e('0x36')],_0x2cb1fa[_0x5c8e('0x40')]));if(_0x2f30f6[_0x5c8e('0x36')][_0x5c8e('0x45')]){_0x547a6f[_0x5c8e('0x42')]=_[_0x5c8e('0x43')](_0x547a6f[_0x5c8e('0x42')],{'$or':_[_0x5c8e('0x2f')](_0x547a6f[_0x5c8e('0x39')],function(_0x5b82b3){var _0x22a4f9={};_0x22a4f9[_0x5b82b3]={'$like':'%'+_0x2f30f6['query'][_0x5c8e('0x45')]+'%'};return _0x22a4f9;})});}_0x547a6f=_[_0x5c8e('0x43')]({},_0x547a6f,_0x2f30f6[_0x5c8e('0x46')]);return _0x1abd00[_0x5c8e('0x4f')](_0x547a6f);}})[_0x5c8e('0x2b')](function(_0xb66d26){if(_0xb66d26){_0x20980e=_0xb66d26['length'];if(!_0x2f30f6[_0x5c8e('0x36')][_0x5c8e('0x3c')](_0x5c8e('0x3d'))){_0x547a6f[_0x5c8e('0x25')]=qs[_0x5c8e('0x25')](_0x2f30f6['query'][_0x5c8e('0x25')]);_0x547a6f['offset']=qs[_0x5c8e('0x22')](_0x2f30f6[_0x5c8e('0x36')][_0x5c8e('0x22')]);}return _0x1abd00['getFields'](_0x547a6f);}})[_0x5c8e('0x2b')](function(_0x31b669){if(_0x31b669){return _0x31b669?{'count':_0x20980e,'rows':_0x31b669}:null;}})[_0x5c8e('0x2b')](respondWithResult(_0x4a8e41,null))[_0x5c8e('0x48')](handleError(_0x4a8e41,null));};exports['getSubjects']=function(_0x38392b,_0x1d3dda,_0x59e941){var _0x130021={};var _0x21233f={};var _0x13acd5;var _0x10b980;return db[_0x5c8e('0x30')][_0x5c8e('0x50')]({'where':{'id':_0x38392b['params']['id']}})[_0x5c8e('0x2b')](handleEntityNotFound(_0x1d3dda,null))['then'](function(_0x255949){if(_0x255949){_0x13acd5=_0x255949;_0x21233f[_0x5c8e('0x35')]=_[_0x5c8e('0x37')](db[_0x5c8e('0x51')][_0x5c8e('0x31')]);_0x21233f[_0x5c8e('0x36')]=_[_0x5c8e('0x37')](_0x38392b[_0x5c8e('0x36')]);_0x21233f[_0x5c8e('0x40')]=_[_0x5c8e('0x38')](_0x21233f['model'],_0x21233f[_0x5c8e('0x36')]);_0x130021[_0x5c8e('0x39')]=_[_0x5c8e('0x38')](_0x21233f[_0x5c8e('0x35')],qs['fields'](_0x38392b[_0x5c8e('0x36')][_0x5c8e('0x3a')]));_0x130021[_0x5c8e('0x39')]=_0x130021[_0x5c8e('0x39')][_0x5c8e('0x3b')]?_0x130021[_0x5c8e('0x39')]:_0x21233f['model'];_0x130021[_0x5c8e('0x3e')]=qs['sort'](_0x38392b['query'][_0x5c8e('0x3f')]);_0x130021[_0x5c8e('0x42')]=qs[_0x5c8e('0x40')](_[_0x5c8e('0x41')](_0x38392b[_0x5c8e('0x36')],_0x21233f['filters']));if(_0x38392b[_0x5c8e('0x36')][_0x5c8e('0x45')]){_0x130021[_0x5c8e('0x42')]=_['merge'](_0x130021['where'],{'$or':_[_0x5c8e('0x2f')](_0x130021[_0x5c8e('0x39')],function(_0x5335d3){var _0x23959f={};_0x23959f[_0x5335d3]={'$like':'%'+_0x38392b['query']['filter']+'%'};return _0x23959f;})});}_0x130021=_[_0x5c8e('0x43')]({},_0x130021,_0x38392b[_0x5c8e('0x46')]);return _0x13acd5[_0x5c8e('0x52')](_0x130021);}})[_0x5c8e('0x2b')](function(_0x491872){if(_0x491872){_0x10b980=_0x491872[_0x5c8e('0x3b')];if(!_0x38392b[_0x5c8e('0x36')][_0x5c8e('0x3c')](_0x5c8e('0x3d'))){_0x130021[_0x5c8e('0x25')]=qs['limit'](_0x38392b[_0x5c8e('0x36')][_0x5c8e('0x25')]);_0x130021['offset']=qs[_0x5c8e('0x22')](_0x38392b[_0x5c8e('0x36')][_0x5c8e('0x22')]);}return _0x13acd5[_0x5c8e('0x52')](_0x130021);}})[_0x5c8e('0x2b')](function(_0x9887b3){if(_0x9887b3){return _0x9887b3?{'count':_0x10b980,'rows':_0x9887b3}:null;}})['then'](respondWithResult(_0x1d3dda,null))['catch'](handleError(_0x1d3dda,null));};exports[_0x5c8e('0x53')]=function(_0x3a7e65,_0x54d716,_0x1cb5b8){var _0x281cf6={};var _0x4e2fa1={};var _0x4adb4f;var _0x5116ce;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x3a7e65[_0x5c8e('0x49')]['id']}})[_0x5c8e('0x2b')](handleEntityNotFound(_0x54d716,null))[_0x5c8e('0x2b')](function(_0x153633){if(_0x153633){_0x4adb4f=_0x153633;_0x4e2fa1['model']=_[_0x5c8e('0x37')](db[_0x5c8e('0x51')][_0x5c8e('0x31')]);_0x4e2fa1[_0x5c8e('0x36')]=_[_0x5c8e('0x37')](_0x3a7e65['query']);_0x4e2fa1[_0x5c8e('0x40')]=_[_0x5c8e('0x38')](_0x4e2fa1[_0x5c8e('0x35')],_0x4e2fa1['query']);_0x281cf6[_0x5c8e('0x39')]=_[_0x5c8e('0x38')](_0x4e2fa1[_0x5c8e('0x35')],qs[_0x5c8e('0x3a')](_0x3a7e65[_0x5c8e('0x36')][_0x5c8e('0x3a')]));_0x281cf6[_0x5c8e('0x39')]=_0x281cf6['attributes'][_0x5c8e('0x3b')]?_0x281cf6[_0x5c8e('0x39')]:_0x4e2fa1['model'];_0x281cf6[_0x5c8e('0x3e')]=qs[_0x5c8e('0x3f')](_0x3a7e65[_0x5c8e('0x36')]['sort']);_0x281cf6[_0x5c8e('0x42')]=qs[_0x5c8e('0x40')](_[_0x5c8e('0x41')](_0x3a7e65['query'],_0x4e2fa1[_0x5c8e('0x40')]));if(_0x3a7e65[_0x5c8e('0x36')][_0x5c8e('0x45')]){_0x281cf6['where']=_['merge'](_0x281cf6['where'],{'$or':_[_0x5c8e('0x2f')](_0x281cf6[_0x5c8e('0x39')],function(_0x2f3aa9){var _0xf402f1={};_0xf402f1[_0x2f3aa9]={'$like':'%'+_0x3a7e65['query'][_0x5c8e('0x45')]+'%'};return _0xf402f1;})});}_0x281cf6=_[_0x5c8e('0x43')]({},_0x281cf6,_0x3a7e65[_0x5c8e('0x46')]);return _0x4adb4f[_0x5c8e('0x53')](_0x281cf6);}})[_0x5c8e('0x2b')](function(_0x42db4e){if(_0x42db4e){_0x5116ce=_0x42db4e[_0x5c8e('0x3b')];if(!_0x3a7e65[_0x5c8e('0x36')]['hasOwnProperty'](_0x5c8e('0x3d'))){_0x281cf6[_0x5c8e('0x25')]=qs[_0x5c8e('0x25')](_0x3a7e65['query']['limit']);_0x281cf6[_0x5c8e('0x22')]=qs[_0x5c8e('0x22')](_0x3a7e65[_0x5c8e('0x36')]['offset']);}return _0x4adb4f[_0x5c8e('0x53')](_0x281cf6);}})[_0x5c8e('0x2b')](function(_0x52c190){if(_0x52c190){return _0x52c190?{'count':_0x5116ce,'rows':_0x52c190}:null;}})[_0x5c8e('0x2b')](respondWithResult(_0x54d716,null))[_0x5c8e('0x48')](handleError(_0x54d716,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 7922d14..aeb2d29 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 _0x7a52=['int_servicenow_configurations','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','ServicenowConfiguration'];(function(_0x9ee11e,_0x2a0fb5){var _0x18e2aa=function(_0x585dad){while(--_0x585dad){_0x9ee11e['push'](_0x9ee11e['shift']());}};_0x18e2aa(++_0x2a0fb5);}(_0x7a52,0x1bd));var _0x27a5=function(_0x2eff37,_0x30af74){_0x2eff37=_0x2eff37-0x0;var _0x321d11=_0x7a52[_0x2eff37];return _0x321d11;};'use strict';var _=require(_0x27a5('0x0'));var util=require('util');var logger=require(_0x27a5('0x1'))(_0x27a5('0x2'));var moment=require(_0x27a5('0x3'));var BPromise=require(_0x27a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x27a5('0x5'));var rimraf=require(_0x27a5('0x6'));var config=require(_0x27a5('0x7'));var attributes=require(_0x27a5('0x8'));module[_0x27a5('0x9')]=function(_0x393c55,_0x23fc7e){return _0x393c55['define'](_0x27a5('0xa'),attributes,{'tableName':_0x27a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2136=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','ServicenowConfiguration','lodash'];(function(_0x1b83e3,_0x24d77a){var _0x8d7834=function(_0x3c3313){while(--_0x3c3313){_0x1b83e3['push'](_0x1b83e3['shift']());}};_0x8d7834(++_0x24d77a);}(_0x2136,0x1eb));var _0x6213=function(_0x94dd49,_0x2661bc){_0x94dd49=_0x94dd49-0x0;var _0x44571f=_0x2136[_0x94dd49];return _0x44571f;};'use strict';var _=require(_0x6213('0x0'));var util=require(_0x6213('0x1'));var logger=require(_0x6213('0x2'))(_0x6213('0x3'));var moment=require(_0x6213('0x4'));var BPromise=require(_0x6213('0x5'));var rp=require(_0x6213('0x6'));var fs=require('fs');var path=require(_0x6213('0x7'));var rimraf=require(_0x6213('0x8'));var config=require(_0x6213('0x9'));var attributes=require('./intServicenowConfiguration.attributes');module[_0x6213('0xa')]=function(_0x41b760,_0x1ae2cc){return _0x41b760['define'](_0x6213('0xb'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index ebb7d38..a120d7c 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 _0x3e5b=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x3c8c3b,_0x3dfa6b){var _0x1144c1=function(_0x40ddff){while(--_0x40ddff){_0x3c8c3b['push'](_0x3c8c3b['shift']());}};_0x1144c1(++_0x3dfa6b);}(_0x3e5b,0x188));var _0xb3e5=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x3e5b[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xb3e5('0x0'));var util=require(_0xb3e5('0x1'));var moment=require(_0xb3e5('0x2'));var BPromise=require(_0xb3e5('0x3'));var rs=require(_0xb3e5('0x4'));var fs=require('fs');var Redis=require(_0xb3e5('0x5'));var db=require(_0xb3e5('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb3e5('0x7'))(_0xb3e5('0x8'));var config=require(_0xb3e5('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb3e5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x393dc4,_0x3b4227,_0x32e19d){return new BPromise(function(_0x458ff1,_0xa808bc){return client[_0xb3e5('0xb')](_0x393dc4,_0x32e19d)[_0xb3e5('0xc')](function(_0x12f665){logger[_0xb3e5('0xd')](_0xb3e5('0xe'),_0x3b4227,_0xb3e5('0xf'));logger['debug'](_0xb3e5('0x10'),_0x3b4227,_0xb3e5('0xf'),JSON['stringify'](_0x12f665));if(_0x12f665[_0xb3e5('0x11')]){if(_0x12f665['error'][_0xb3e5('0x12')]===0x1f4){logger[_0xb3e5('0x11')](_0xb3e5('0xe'),_0x3b4227,_0x12f665['error'][_0xb3e5('0x13')]);return _0xa808bc(_0x12f665['error'][_0xb3e5('0x13')]);}logger[_0xb3e5('0x11')](_0xb3e5('0xe'),_0x3b4227,_0x12f665[_0xb3e5('0x11')]['message']);return _0x458ff1(_0x12f665[_0xb3e5('0x11')][_0xb3e5('0x13')]);}else{logger[_0xb3e5('0xd')](_0xb3e5('0xe'),_0x3b4227,_0xb3e5('0xf'));_0x458ff1(_0x12f665[_0xb3e5('0x14')][_0xb3e5('0x13')]);}})[_0xb3e5('0x15')](function(_0x517749){logger[_0xb3e5('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x3b4227,_0x517749);_0xa808bc(_0x517749);});});} \ No newline at end of file +var _0x3087=['info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','then'];(function(_0x54782e,_0x28cce9){var _0x1389b6=function(_0x3eb9b4){while(--_0x3eb9b4){_0x54782e['push'](_0x54782e['shift']());}};_0x1389b6(++_0x28cce9);}(_0x3087,0xd1));var _0x7308=function(_0x5b2d20,_0x361dcc){_0x5b2d20=_0x5b2d20-0x0;var _0x55eb77=_0x3087[_0x5b2d20];return _0x55eb77;};'use strict';var _=require(_0x7308('0x0'));var util=require(_0x7308('0x1'));var moment=require('moment');var BPromise=require(_0x7308('0x2'));var rs=require(_0x7308('0x3'));var fs=require('fs');var Redis=require(_0x7308('0x4'));var db=require(_0x7308('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7308('0x6'));var config=require(_0x7308('0x7'));var jayson=require(_0x7308('0x8'));var client=jayson['client'][_0x7308('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8f7a7a,_0x28a85b,_0x3a53fd){return new BPromise(function(_0x15c480,_0x2e13a5){return client['request'](_0x8f7a7a,_0x3a53fd)[_0x7308('0xa')](function(_0x4b5ee4){logger[_0x7308('0xb')](_0x7308('0xc'),_0x28a85b,_0x7308('0xd'));logger[_0x7308('0xe')](_0x7308('0xf'),_0x28a85b,_0x7308('0xd'),JSON[_0x7308('0x10')](_0x4b5ee4));if(_0x4b5ee4[_0x7308('0x11')]){if(_0x4b5ee4[_0x7308('0x11')][_0x7308('0x12')]===0x1f4){logger[_0x7308('0x11')](_0x7308('0xc'),_0x28a85b,_0x4b5ee4[_0x7308('0x11')][_0x7308('0x13')]);return _0x2e13a5(_0x4b5ee4[_0x7308('0x11')]['message']);}logger[_0x7308('0x11')](_0x7308('0xc'),_0x28a85b,_0x4b5ee4[_0x7308('0x11')]['message']);return _0x15c480(_0x4b5ee4[_0x7308('0x11')][_0x7308('0x13')]);}else{logger[_0x7308('0xb')](_0x7308('0xc'),_0x28a85b,_0x7308('0xd'));_0x15c480(_0x4b5ee4['result']['message']);}})['catch'](function(_0x53031d){logger[_0x7308('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x28a85b,_0x53031d);_0x2e13a5(_0x53031d);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 93318a4..21f13fc 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 _0x1603=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowField.controller','get','isAuthenticated','index','/:id','show','create','destroy','exports','multer','util'];(function(_0x527aa9,_0x52ed2d){var _0x59430e=function(_0x40863b){while(--_0x40863b){_0x527aa9['push'](_0x527aa9['shift']());}};_0x59430e(++_0x52ed2d);}(_0x1603,0xd6));var _0x3160=function(_0x3f812c,_0x1915e8){_0x3f812c=_0x3f812c-0x0;var _0x1498e4=_0x1603[_0x3f812c];return _0x1498e4;};'use strict';var multer=require(_0x3160('0x0'));var util=require(_0x3160('0x1'));var path=require(_0x3160('0x2'));var timeout=require(_0x3160('0x3'));var express=require(_0x3160('0x4'));var router=express[_0x3160('0x5')]();var fs_extra=require(_0x3160('0x6'));var auth=require(_0x3160('0x7'));var interaction=require(_0x3160('0x8'));var config=require('../../config/environment');var controller=require(_0x3160('0x9'));router[_0x3160('0xa')]('/',auth[_0x3160('0xb')](),controller[_0x3160('0xc')]);router['get'](_0x3160('0xd'),auth['isAuthenticated'](),controller[_0x3160('0xe')]);router['post']('/',auth[_0x3160('0xb')](),controller[_0x3160('0xf')]);router['put'](_0x3160('0xd'),auth[_0x3160('0xb')](),controller['update']);router['delete'](_0x3160('0xd'),auth[_0x3160('0xb')](),controller[_0x3160('0x10')]);module[_0x3160('0x11')]=router; \ No newline at end of file +var _0x69c3=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','isAuthenticated','get','/:id','show','post','create','put','update','exports','multer','path','connect-timeout','Router'];(function(_0x21dea2,_0x12388e){var _0x30800b=function(_0x4cbb1d){while(--_0x4cbb1d){_0x21dea2['push'](_0x21dea2['shift']());}};_0x30800b(++_0x12388e);}(_0x69c3,0x188));var _0x369c=function(_0x2d2885,_0x667d70){_0x2d2885=_0x2d2885-0x0;var _0x2cea6=_0x69c3[_0x2d2885];return _0x2cea6;};'use strict';var multer=require(_0x369c('0x0'));var util=require('util');var path=require(_0x369c('0x1'));var timeout=require(_0x369c('0x2'));var express=require('express');var router=express[_0x369c('0x3')]();var fs_extra=require(_0x369c('0x4'));var auth=require(_0x369c('0x5'));var interaction=require(_0x369c('0x6'));var config=require(_0x369c('0x7'));var controller=require(_0x369c('0x8'));router['get']('/',auth[_0x369c('0x9')](),controller['index']);router[_0x369c('0xa')](_0x369c('0xb'),auth['isAuthenticated'](),controller[_0x369c('0xc')]);router[_0x369c('0xd')]('/',auth['isAuthenticated'](),controller[_0x369c('0xe')]);router[_0x369c('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x369c('0x10')]);router['delete']('/:id',auth[_0x369c('0x9')](),controller['destroy']);module[_0x369c('0x11')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 1387394..c9433e6 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 _0x3ac8=['BOOLEAN','sequelize','exports','string','variable','customVariable','picklist','STRING','ENUM'];(function(_0x453dfb,_0x30e629){var _0x571474=function(_0x1cad3c){while(--_0x1cad3c){_0x453dfb['push'](_0x453dfb['shift']());}};_0x571474(++_0x30e629);}(_0x3ac8,0xac));var _0x83ac=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3ac8[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x83ac('0x0'));module[_0x83ac('0x1')]={'type':{'type':Sequelize['ENUM'](_0x83ac('0x2'),_0x83ac('0x3'),_0x83ac('0x4'),'keyValue',_0x83ac('0x5')),'defaultValue':_0x83ac('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x83ac('0x6')]},'keyType':{'type':Sequelize[_0x83ac('0x7')](_0x83ac('0x2'),_0x83ac('0x3'),_0x83ac('0x4'))},'keyContent':{'type':Sequelize[_0x83ac('0x6')]},'idField':{'type':Sequelize[_0x83ac('0x6')]},'nameField':{'type':Sequelize[_0x83ac('0x6')]},'customField':{'type':Sequelize[_0x83ac('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x83ac('0x6')]}}; \ No newline at end of file +var _0xef37=['variable','keyValue','picklist','string','STRING','customVariable','BOOLEAN','sequelize','ENUM'];(function(_0x343c3e,_0x203cce){var _0x48bcbd=function(_0x4ac51d){while(--_0x4ac51d){_0x343c3e['push'](_0x343c3e['shift']());}};_0x48bcbd(++_0x203cce);}(_0xef37,0xbb));var _0x7ef3=function(_0x44f481,_0x4ed8b3){_0x44f481=_0x44f481-0x0;var _0x5b39b1=_0xef37[_0x44f481];return _0x5b39b1;};'use strict';var Sequelize=require(_0x7ef3('0x0'));module['exports']={'type':{'type':Sequelize[_0x7ef3('0x1')]('string',_0x7ef3('0x2'),'customVariable',_0x7ef3('0x3'),_0x7ef3('0x4')),'defaultValue':_0x7ef3('0x5')},'content':{'type':Sequelize[_0x7ef3('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x7ef3('0x1')](_0x7ef3('0x5'),_0x7ef3('0x2'),_0x7ef3('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x7ef3('0x6')]},'nameField':{'type':Sequelize[_0x7ef3('0x6')]},'customField':{'type':Sequelize[_0x7ef3('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7ef3('0x6')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index b0a353c..0457979 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 _0xc1d3=['includeAll','include','catch','length','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','nolimit','order','sort','where','filters','pick','merge','filter','options','count'];(function(_0x114cae,_0x97b726){var _0x2db7d4=function(_0x5238b4){while(--_0x5238b4){_0x114cae['push'](_0x114cae['shift']());}};_0x2db7d4(++_0x97b726);}(_0xc1d3,0x17f));var _0x3c1d=function(_0x31ac1e,_0x135e94){_0x31ac1e=_0x31ac1e-0x0;var _0x2c42be=_0xc1d3[_0x31ac1e];return _0x2c42be;};'use strict';var emlformat=require(_0x3c1d('0x0'));var rimraf=require(_0x3c1d('0x1'));var zipdir=require(_0x3c1d('0x2'));var jsonpatch=require(_0x3c1d('0x3'));var rp=require(_0x3c1d('0x4'));var moment=require(_0x3c1d('0x5'));var BPromise=require(_0x3c1d('0x6'));var Mustache=require(_0x3c1d('0x7'));var util=require(_0x3c1d('0x8'));var path=require(_0x3c1d('0x9'));var sox=require(_0x3c1d('0xa'));var csv=require(_0x3c1d('0xb'));var ejs=require(_0x3c1d('0xc'));var fs=require('fs');var fs_extra=require(_0x3c1d('0xd'));var _=require('lodash');var squel=require(_0x3c1d('0xe'));var crypto=require(_0x3c1d('0xf'));var jsforce=require(_0x3c1d('0x10'));var deskjs=require(_0x3c1d('0x11'));var toCsv=require(_0x3c1d('0xb'));var querystring=require(_0x3c1d('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3c1d('0x13'));var qs=require(_0x3c1d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3c1d('0x15'))(_0x3c1d('0x16'));var utils=require(_0x3c1d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x3c1d('0x18'));var db=require(_0x3c1d('0x19'))['db'];function respondWithStatusCode(_0x5b68f1,_0x1e01c4){_0x1e01c4=_0x1e01c4||0xcc;return function(_0x551c61){if(_0x551c61){return _0x5b68f1[_0x3c1d('0x1a')](_0x1e01c4);}return _0x5b68f1[_0x3c1d('0x1b')](_0x1e01c4)[_0x3c1d('0x1c')]();};}function respondWithResult(_0x287571,_0x41a8aa){_0x41a8aa=_0x41a8aa||0xc8;return function(_0x39425a){if(_0x39425a){return _0x287571[_0x3c1d('0x1b')](_0x41a8aa)[_0x3c1d('0x1d')](_0x39425a);}};}function respondWithFilteredResult(_0x382c97,_0x5dbea2){return function(_0x1c2603){if(_0x1c2603){var _0x4aeec9=typeof _0x5dbea2['offset']===_0x3c1d('0x1e')&&typeof _0x5dbea2[_0x3c1d('0x1f')]===_0x3c1d('0x1e');var _0x3ba39f=_0x1c2603['count'];var _0x323bee=_0x4aeec9?0x0:_0x5dbea2[_0x3c1d('0x20')];var _0x311012=_0x4aeec9?_0x1c2603['count']:_0x5dbea2[_0x3c1d('0x20')]+_0x5dbea2[_0x3c1d('0x1f')];var _0x4ef7bb;if(_0x311012>=_0x3ba39f){_0x311012=_0x3ba39f;_0x4ef7bb=0xc8;}else{_0x4ef7bb=0xce;}_0x382c97[_0x3c1d('0x1b')](_0x4ef7bb);return _0x382c97[_0x3c1d('0x21')](_0x3c1d('0x22'),_0x323bee+'-'+_0x311012+'/'+_0x3ba39f)[_0x3c1d('0x1d')](_0x1c2603);}return null;};}function patchUpdates(_0x1a2be9){return function(_0x282362){try{jsonpatch[_0x3c1d('0x23')](_0x282362,_0x1a2be9,!![]);}catch(_0x283f85){return BPromise[_0x3c1d('0x24')](_0x283f85);}return _0x282362[_0x3c1d('0x25')]();};}function saveUpdates(_0x350ff8,_0x236cba){return function(_0x59c95d){if(_0x59c95d){return _0x59c95d[_0x3c1d('0x26')](_0x350ff8)[_0x3c1d('0x27')](function(_0x5b0c11){return _0x5b0c11;});}return null;};}function removeEntity(_0x12fd5c,_0x413fa8){return function(_0x59d68f){if(_0x59d68f){return _0x59d68f['destroy']()['then'](function(){_0x12fd5c[_0x3c1d('0x1b')](0xcc)[_0x3c1d('0x1c')]();});}};}function handleEntityNotFound(_0x193a0e,_0x5e2f9d){return function(_0x56b377){if(!_0x56b377){_0x193a0e['sendStatus'](0x194);}return _0x56b377;};}function handleError(_0x3e34b9,_0xe6c49d){_0xe6c49d=_0xe6c49d||0x1f4;return function(_0x60895b){logger[_0x3c1d('0x28')](_0x60895b[_0x3c1d('0x29')]);if(_0x60895b[_0x3c1d('0x2a')]){delete _0x60895b[_0x3c1d('0x2a')];}_0x3e34b9[_0x3c1d('0x1b')](_0xe6c49d)[_0x3c1d('0x2b')](_0x60895b);};}exports[_0x3c1d('0x2c')]=function(_0x45ab5d,_0x4e039b){var _0x31d347={},_0x3d8c92={},_0x25c710={'count':0x0,'rows':[]};var _0x582b91=_[_0x3c1d('0x2d')](db[_0x3c1d('0x2e')][_0x3c1d('0x2f')],function(_0x28e73c){return{'name':_0x28e73c[_0x3c1d('0x30')],'type':_0x28e73c[_0x3c1d('0x31')][_0x3c1d('0x32')]};});_0x3d8c92[_0x3c1d('0x33')]=_[_0x3c1d('0x2d')](_0x582b91,_0x3c1d('0x2a'));_0x3d8c92['query']=_[_0x3c1d('0x34')](_0x45ab5d[_0x3c1d('0x35')]);_0x3d8c92['filters']=_[_0x3c1d('0x36')](_0x3d8c92[_0x3c1d('0x33')],_0x3d8c92[_0x3c1d('0x35')]);_0x31d347['attributes']=_['intersection'](_0x3d8c92[_0x3c1d('0x33')],qs[_0x3c1d('0x37')](_0x45ab5d[_0x3c1d('0x35')]['fields']));_0x31d347[_0x3c1d('0x38')]=_0x31d347[_0x3c1d('0x38')]['length']?_0x31d347[_0x3c1d('0x38')]:_0x3d8c92[_0x3c1d('0x33')];if(!_0x45ab5d[_0x3c1d('0x35')]['hasOwnProperty'](_0x3c1d('0x39'))){_0x31d347[_0x3c1d('0x1f')]=qs[_0x3c1d('0x1f')](_0x45ab5d[_0x3c1d('0x35')][_0x3c1d('0x1f')]);_0x31d347[_0x3c1d('0x20')]=qs[_0x3c1d('0x20')](_0x45ab5d[_0x3c1d('0x35')][_0x3c1d('0x20')]);}_0x31d347[_0x3c1d('0x3a')]=qs[_0x3c1d('0x3b')](_0x45ab5d[_0x3c1d('0x35')][_0x3c1d('0x3b')]);_0x31d347[_0x3c1d('0x3c')]=qs[_0x3c1d('0x3d')](_[_0x3c1d('0x3e')](_0x45ab5d['query'],_0x3d8c92[_0x3c1d('0x3d')]),_0x582b91);if(_0x45ab5d[_0x3c1d('0x35')]['filter']){_0x31d347['where']=_[_0x3c1d('0x3f')](_0x31d347['where'],{'$or':_['map'](_0x582b91,function(_0x5ad41e){if(_0x5ad41e['type']!=='VIRTUAL'){var _0x3eeaeb={};_0x3eeaeb[_0x5ad41e[_0x3c1d('0x2a')]]={'$like':'%'+_0x45ab5d[_0x3c1d('0x35')][_0x3c1d('0x40')]+'%'};return _0x3eeaeb;}})});}_0x31d347=_[_0x3c1d('0x3f')]({},_0x31d347,_0x45ab5d[_0x3c1d('0x41')]);var _0x23f03f={'where':_0x31d347['where']};return db['ServicenowField'][_0x3c1d('0x42')](_0x23f03f)[_0x3c1d('0x27')](function(_0x562fdb){_0x25c710[_0x3c1d('0x42')]=_0x562fdb;if(_0x45ab5d[_0x3c1d('0x35')][_0x3c1d('0x43')]){_0x31d347[_0x3c1d('0x44')]=[{'all':!![]}];}return db['ServicenowField']['findAll'](_0x31d347);})[_0x3c1d('0x27')](function(_0x1121bf){_0x25c710['rows']=_0x1121bf;return _0x25c710;})['then'](respondWithFilteredResult(_0x4e039b,_0x31d347))[_0x3c1d('0x45')](handleError(_0x4e039b,null));};exports['show']=function(_0x4e3b14,_0x23d044){var _0xfb15e6={'raw':!![],'where':{'id':_0x4e3b14['params']['id']}},_0x25ee55={};_0x25ee55[_0x3c1d('0x33')]=_['keys'](db['ServicenowField']['rawAttributes']);_0x25ee55[_0x3c1d('0x35')]=_[_0x3c1d('0x34')](_0x4e3b14[_0x3c1d('0x35')]);_0x25ee55[_0x3c1d('0x3d')]=_['intersection'](_0x25ee55['model'],_0x25ee55[_0x3c1d('0x35')]);_0xfb15e6[_0x3c1d('0x38')]=_[_0x3c1d('0x36')](_0x25ee55[_0x3c1d('0x33')],qs[_0x3c1d('0x37')](_0x4e3b14[_0x3c1d('0x35')]['fields']));_0xfb15e6[_0x3c1d('0x38')]=_0xfb15e6[_0x3c1d('0x38')][_0x3c1d('0x46')]?_0xfb15e6[_0x3c1d('0x38')]:_0x25ee55['model'];if(_0x4e3b14[_0x3c1d('0x35')][_0x3c1d('0x43')]){_0xfb15e6[_0x3c1d('0x44')]=[{'all':!![]}];}_0xfb15e6=_[_0x3c1d('0x3f')]({},_0xfb15e6,_0x4e3b14['options']);return db['ServicenowField'][_0x3c1d('0x47')](_0xfb15e6)[_0x3c1d('0x27')](handleEntityNotFound(_0x23d044,null))[_0x3c1d('0x27')](respondWithResult(_0x23d044,null))[_0x3c1d('0x45')](handleError(_0x23d044,null));};exports[_0x3c1d('0x48')]=function(_0x578937,_0x354da0){return db['ServicenowField'][_0x3c1d('0x48')](_0x578937[_0x3c1d('0x49')],{})[_0x3c1d('0x27')](respondWithResult(_0x354da0,0xc9))['catch'](handleError(_0x354da0,null));};exports['update']=function(_0x1c2565,_0x46c2d4){if(_0x1c2565[_0x3c1d('0x49')]['id']){delete _0x1c2565[_0x3c1d('0x49')]['id'];}return db[_0x3c1d('0x2e')][_0x3c1d('0x47')]({'where':{'id':_0x1c2565['params']['id']}})['then'](handleEntityNotFound(_0x46c2d4,null))[_0x3c1d('0x27')](saveUpdates(_0x1c2565[_0x3c1d('0x49')],null))[_0x3c1d('0x27')](respondWithResult(_0x46c2d4,null))[_0x3c1d('0x45')](handleError(_0x46c2d4,null));};exports[_0x3c1d('0x4a')]=function(_0x3cb620,_0x268482){return db[_0x3c1d('0x2e')][_0x3c1d('0x47')]({'where':{'id':_0x3cb620['params']['id']}})[_0x3c1d('0x27')](handleEntityNotFound(_0x268482,null))['then'](removeEntity(_0x268482,null))[_0x3c1d('0x45')](handleError(_0x268482,null));}; \ No newline at end of file +var _0xf8e2=['filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','type','VIRTUAL','merge','options','ServicenowField','includeAll','include','findAll','catch','show','rawAttributes','find','body','update','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','fieldName','model','query','keys'];(function(_0x489138,_0x4a9966){var _0x3d2433=function(_0x4c7940){while(--_0x4c7940){_0x489138['push'](_0x489138['shift']());}};_0x3d2433(++_0x4a9966);}(_0xf8e2,0x1d5));var _0x2f8e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xf8e2[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2f8e('0x0'));var zipdir=require(_0x2f8e('0x1'));var jsonpatch=require(_0x2f8e('0x2'));var rp=require(_0x2f8e('0x3'));var moment=require('moment');var BPromise=require(_0x2f8e('0x4'));var Mustache=require(_0x2f8e('0x5'));var util=require(_0x2f8e('0x6'));var path=require(_0x2f8e('0x7'));var sox=require(_0x2f8e('0x8'));var csv=require('to-csv');var ejs=require(_0x2f8e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2f8e('0xa'));var squel=require(_0x2f8e('0xb'));var crypto=require(_0x2f8e('0xc'));var jsforce=require(_0x2f8e('0xd'));var deskjs=require(_0x2f8e('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2f8e('0xf'));var Papa=require('papaparse');var Redis=require(_0x2f8e('0x10'));var authService=require(_0x2f8e('0x11'));var qs=require(_0x2f8e('0x12'));var as=require(_0x2f8e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2f8e('0x14'))(_0x2f8e('0x15'));var utils=require(_0x2f8e('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2f8e('0x17'))['db'];function respondWithStatusCode(_0x3856a6,_0x466e6f){_0x466e6f=_0x466e6f||0xcc;return function(_0xad5845){if(_0xad5845){return _0x3856a6[_0x2f8e('0x18')](_0x466e6f);}return _0x3856a6['status'](_0x466e6f)['end']();};}function respondWithResult(_0x168ac6,_0x33581a){_0x33581a=_0x33581a||0xc8;return function(_0x1d2073){if(_0x1d2073){return _0x168ac6[_0x2f8e('0x19')](_0x33581a)[_0x2f8e('0x1a')](_0x1d2073);}};}function respondWithFilteredResult(_0x4658a6,_0xf083bc){return function(_0x11d72c){if(_0x11d72c){var _0x1c338f=typeof _0xf083bc['offset']===_0x2f8e('0x1b')&&typeof _0xf083bc[_0x2f8e('0x1c')]===_0x2f8e('0x1b');var _0x4f3239=_0x11d72c['count'];var _0x1a35b5=_0x1c338f?0x0:_0xf083bc[_0x2f8e('0x1d')];var _0x32c245=_0x1c338f?_0x11d72c[_0x2f8e('0x1e')]:_0xf083bc['offset']+_0xf083bc['limit'];var _0x4db4ab;if(_0x32c245>=_0x4f3239){_0x32c245=_0x4f3239;_0x4db4ab=0xc8;}else{_0x4db4ab=0xce;}_0x4658a6[_0x2f8e('0x19')](_0x4db4ab);return _0x4658a6[_0x2f8e('0x1f')](_0x2f8e('0x20'),_0x1a35b5+'-'+_0x32c245+'/'+_0x4f3239)[_0x2f8e('0x1a')](_0x11d72c);}return null;};}function patchUpdates(_0x143c27){return function(_0x27b162){try{jsonpatch[_0x2f8e('0x21')](_0x27b162,_0x143c27,!![]);}catch(_0x388313){return BPromise[_0x2f8e('0x22')](_0x388313);}return _0x27b162[_0x2f8e('0x23')]();};}function saveUpdates(_0x1ee26d,_0x6b6be3){return function(_0x140cdd){if(_0x140cdd){return _0x140cdd['update'](_0x1ee26d)[_0x2f8e('0x24')](function(_0x527d21){return _0x527d21;});}return null;};}function removeEntity(_0x61cb25,_0x913a12){return function(_0x28509c){if(_0x28509c){return _0x28509c[_0x2f8e('0x25')]()[_0x2f8e('0x24')](function(){_0x61cb25[_0x2f8e('0x19')](0xcc)[_0x2f8e('0x26')]();});}};}function handleEntityNotFound(_0x503149,_0x879278){return function(_0x2e6908){if(!_0x2e6908){_0x503149[_0x2f8e('0x18')](0x194);}return _0x2e6908;};}function handleError(_0x48a019,_0x55edc7){_0x55edc7=_0x55edc7||0x1f4;return function(_0x5b0b7f){logger[_0x2f8e('0x27')](_0x5b0b7f[_0x2f8e('0x28')]);if(_0x5b0b7f[_0x2f8e('0x29')]){delete _0x5b0b7f['name'];}_0x48a019[_0x2f8e('0x19')](_0x55edc7)[_0x2f8e('0x2a')](_0x5b0b7f);};}exports[_0x2f8e('0x2b')]=function(_0xa5b518,_0x48fcfb){var _0x504131={},_0x548c82={},_0xd39250={'count':0x0,'rows':[]};var _0x2d92b6=_[_0x2f8e('0x2c')](db['ServicenowField']['rawAttributes'],function(_0x12f66f){return{'name':_0x12f66f[_0x2f8e('0x2d')],'type':_0x12f66f['type']['key']};});_0x548c82[_0x2f8e('0x2e')]=_[_0x2f8e('0x2c')](_0x2d92b6,_0x2f8e('0x29'));_0x548c82[_0x2f8e('0x2f')]=_[_0x2f8e('0x30')](_0xa5b518[_0x2f8e('0x2f')]);_0x548c82[_0x2f8e('0x31')]=_[_0x2f8e('0x32')](_0x548c82[_0x2f8e('0x2e')],_0x548c82[_0x2f8e('0x2f')]);_0x504131[_0x2f8e('0x33')]=_[_0x2f8e('0x32')](_0x548c82['model'],qs[_0x2f8e('0x34')](_0xa5b518[_0x2f8e('0x2f')][_0x2f8e('0x34')]));_0x504131[_0x2f8e('0x33')]=_0x504131[_0x2f8e('0x33')][_0x2f8e('0x35')]?_0x504131[_0x2f8e('0x33')]:_0x548c82['model'];if(!_0xa5b518[_0x2f8e('0x2f')][_0x2f8e('0x36')]('nolimit')){_0x504131[_0x2f8e('0x1c')]=qs[_0x2f8e('0x1c')](_0xa5b518['query'][_0x2f8e('0x1c')]);_0x504131[_0x2f8e('0x1d')]=qs[_0x2f8e('0x1d')](_0xa5b518['query'][_0x2f8e('0x1d')]);}_0x504131[_0x2f8e('0x37')]=qs['sort'](_0xa5b518[_0x2f8e('0x2f')][_0x2f8e('0x38')]);_0x504131[_0x2f8e('0x39')]=qs[_0x2f8e('0x31')](_[_0x2f8e('0x3a')](_0xa5b518['query'],_0x548c82[_0x2f8e('0x31')]),_0x2d92b6);if(_0xa5b518[_0x2f8e('0x2f')][_0x2f8e('0x3b')]){_0x504131['where']=_['merge'](_0x504131[_0x2f8e('0x39')],{'$or':_[_0x2f8e('0x2c')](_0x2d92b6,function(_0x53df39){if(_0x53df39[_0x2f8e('0x3c')]!==_0x2f8e('0x3d')){var _0x5642fa={};_0x5642fa[_0x53df39['name']]={'$like':'%'+_0xa5b518[_0x2f8e('0x2f')][_0x2f8e('0x3b')]+'%'};return _0x5642fa;}})});}_0x504131=_[_0x2f8e('0x3e')]({},_0x504131,_0xa5b518[_0x2f8e('0x3f')]);var _0x5b9d7e={'where':_0x504131[_0x2f8e('0x39')]};return db[_0x2f8e('0x40')][_0x2f8e('0x1e')](_0x5b9d7e)[_0x2f8e('0x24')](function(_0x51e545){_0xd39250[_0x2f8e('0x1e')]=_0x51e545;if(_0xa5b518['query'][_0x2f8e('0x41')]){_0x504131[_0x2f8e('0x42')]=[{'all':!![]}];}return db[_0x2f8e('0x40')][_0x2f8e('0x43')](_0x504131);})[_0x2f8e('0x24')](function(_0x180085){_0xd39250['rows']=_0x180085;return _0xd39250;})[_0x2f8e('0x24')](respondWithFilteredResult(_0x48fcfb,_0x504131))[_0x2f8e('0x44')](handleError(_0x48fcfb,null));};exports[_0x2f8e('0x45')]=function(_0x3da100,_0x55a22b){var _0xe7d1ba={'raw':!![],'where':{'id':_0x3da100['params']['id']}},_0x40778c={};_0x40778c['model']=_[_0x2f8e('0x30')](db[_0x2f8e('0x40')][_0x2f8e('0x46')]);_0x40778c[_0x2f8e('0x2f')]=_[_0x2f8e('0x30')](_0x3da100[_0x2f8e('0x2f')]);_0x40778c[_0x2f8e('0x31')]=_[_0x2f8e('0x32')](_0x40778c[_0x2f8e('0x2e')],_0x40778c[_0x2f8e('0x2f')]);_0xe7d1ba[_0x2f8e('0x33')]=_[_0x2f8e('0x32')](_0x40778c['model'],qs[_0x2f8e('0x34')](_0x3da100[_0x2f8e('0x2f')][_0x2f8e('0x34')]));_0xe7d1ba[_0x2f8e('0x33')]=_0xe7d1ba[_0x2f8e('0x33')][_0x2f8e('0x35')]?_0xe7d1ba['attributes']:_0x40778c['model'];if(_0x3da100[_0x2f8e('0x2f')][_0x2f8e('0x41')]){_0xe7d1ba['include']=[{'all':!![]}];}_0xe7d1ba=_[_0x2f8e('0x3e')]({},_0xe7d1ba,_0x3da100[_0x2f8e('0x3f')]);return db['ServicenowField'][_0x2f8e('0x47')](_0xe7d1ba)[_0x2f8e('0x24')](handleEntityNotFound(_0x55a22b,null))[_0x2f8e('0x24')](respondWithResult(_0x55a22b,null))[_0x2f8e('0x44')](handleError(_0x55a22b,null));};exports['create']=function(_0x168ff1,_0x28dbe9){return db['ServicenowField']['create'](_0x168ff1[_0x2f8e('0x48')],{})[_0x2f8e('0x24')](respondWithResult(_0x28dbe9,0xc9))[_0x2f8e('0x44')](handleError(_0x28dbe9,null));};exports[_0x2f8e('0x49')]=function(_0xd9db3a,_0x112488){if(_0xd9db3a['body']['id']){delete _0xd9db3a[_0x2f8e('0x48')]['id'];}return db[_0x2f8e('0x40')][_0x2f8e('0x47')]({'where':{'id':_0xd9db3a['params']['id']}})[_0x2f8e('0x24')](handleEntityNotFound(_0x112488,null))[_0x2f8e('0x24')](saveUpdates(_0xd9db3a['body'],null))[_0x2f8e('0x24')](respondWithResult(_0x112488,null))[_0x2f8e('0x44')](handleError(_0x112488,null));};exports[_0x2f8e('0x25')]=function(_0x418ea9,_0x432ae2){return db[_0x2f8e('0x40')][_0x2f8e('0x47')]({'where':{'id':_0x418ea9['params']['id']}})[_0x2f8e('0x24')](handleEntityNotFound(_0x432ae2,null))[_0x2f8e('0x24')](removeEntity(_0x432ae2,null))[_0x2f8e('0x44')](handleError(_0x432ae2,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 6a03e50..ced5141 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 _0xdfdc=['request-promise','rimraf','../../config/environment','exports','idField','FieldId','lodash','util','../../config/logger','bluebird'];(function(_0x57df32,_0x3d1b4f){var _0x4d6b2c=function(_0x1d8bb6){while(--_0x1d8bb6){_0x57df32['push'](_0x57df32['shift']());}};_0x4d6b2c(++_0x3d1b4f);}(_0xdfdc,0x10a));var _0xcdfd=function(_0x23da66,_0x5c380d){_0x23da66=_0x23da66-0x0;var _0x111d31=_0xdfdc[_0x23da66];return _0x111d31;};'use strict';var _=require(_0xcdfd('0x0'));var util=require(_0xcdfd('0x1'));var logger=require(_0xcdfd('0x2'))('api');var moment=require('moment');var BPromise=require(_0xcdfd('0x3'));var rp=require(_0xcdfd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcdfd('0x5'));var config=require(_0xcdfd('0x6'));var attributes=require('./intServicenowField.attributes');module[_0xcdfd('0x7')]=function(_0x4c6463,_0x4e6741){return _0x4c6463['define']('ServicenowField',attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0xcdfd('0x8'),_0xcdfd('0x9')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x98b9=['exports','define','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment','./intServicenowField.attributes'];(function(_0x52ce1a,_0x3cf476){var _0x5e32e4=function(_0x30b960){while(--_0x30b960){_0x52ce1a['push'](_0x52ce1a['shift']());}};_0x5e32e4(++_0x3cf476);}(_0x98b9,0x164));var _0x998b=function(_0x49fa4f,_0x1d71ba){_0x49fa4f=_0x49fa4f-0x0;var _0x147edf=_0x98b9[_0x49fa4f];return _0x147edf;};'use strict';var _=require(_0x998b('0x0'));var util=require(_0x998b('0x1'));var logger=require(_0x998b('0x2'))('api');var moment=require(_0x998b('0x3'));var BPromise=require('bluebird');var rp=require(_0x998b('0x4'));var fs=require('fs');var path=require(_0x998b('0x5'));var rimraf=require('rimraf');var config=require(_0x998b('0x6'));var attributes=require(_0x998b('0x7'));module[_0x998b('0x8')]=function(_0x50a973,_0x341af1){return _0x50a973[_0x998b('0x9')]('ServicenowField',attributes,{'tableName':_0x998b('0xa'),'paranoid':![],'indexes':[{'name':_0x998b('0xb'),'fields':[_0x998b('0xc'),_0x998b('0xd')],'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 64eda14..3d8ad98 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 _0xe706=['http','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\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(_0x411080,_0x17a760){var _0x5b882f=function(_0x247e7d){while(--_0x247e7d){_0x411080['push'](_0x411080['shift']());}};_0x5b882f(++_0x17a760);}(_0xe706,0xa3));var _0x6e70=function(_0x1c2051,_0x4cb6b9){_0x1c2051=_0x1c2051-0x0;var _0x2b58a0=_0xe706[_0x1c2051];return _0x2b58a0;};'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']('ServicenowField,\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']('ServicenowField,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file +var _0xa9e0=['http','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4b9c8e,_0x44439d){var _0x11876c=function(_0x13ec06){while(--_0x13ec06){_0x4b9c8e['push'](_0x4b9c8e['shift']());}};_0x11876c(++_0x44439d);}(_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 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/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 67ed9bb..4a63286 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(_0x1b4c7b,_0xdad80a){var _0x39fba3=function(_0xb720b9){while(--_0xb720b9){_0x1b4c7b['push'](_0x1b4c7b['shift']());}};_0x39fba3(++_0xdad80a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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(_0x5b0d79,_0x2c8262){var _0x359ab5=function(_0x1b76b5){while(--_0x1b76b5){_0x5b0d79['push'](_0x5b0d79['shift']());}};_0x359ab5(++_0x2c8262);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'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 6272610..c6105b1 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(_0x4df636,_0x4b835e){var _0x5e4d16=function(_0x34e8b3){while(--_0x34e8b3){_0x4df636['push'](_0x4df636['shift']());}};_0x5e4d16(++_0x4b835e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'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(_0x22a94e,_0x123dd9){var _0x532942=function(_0x3f398d){while(--_0x3f398d){_0x22a94e['push'](_0x22a94e['shift']());}};_0x532942(++_0x123dd9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'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 a3b8e95..330d4b4 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 _0x2b3e=['Invalid\x20Login','Password\x20Expired','format','get_module_fields','module_fields','remove','includes','value','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','save','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','SugarcrmAccount','includeAll','include','findAll','show','params','catch','create','update','body','find','findOne','SugarcrmConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','SugarcrmField','getFields','assigned_user_id','created_by','description','duration_hours','duration_minutes','parent_name','direction','password','remoteUri','slice','substring','lastIndexOf','POST','%s%s','/service/v4_1/rest.php','login','JSON','stringify','username','xCALLY\x20Motion\x20Integration'];(function(_0x1e7600,_0x11348d){var _0x80b052=function(_0x276413){while(--_0x276413){_0x1e7600['push'](_0x1e7600['shift']());}};_0x80b052(++_0x11348d);}(_0x2b3e,0x83));var _0xe2b3=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x2b3e[_0xb0f7c3];return _0x28ea68;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe2b3('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe2b3('0x1'));var rp=require(_0xe2b3('0x2'));var moment=require(_0xe2b3('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe2b3('0x4'));var util=require('util');var path=require(_0xe2b3('0x5'));var sox=require(_0xe2b3('0x6'));var csv=require(_0xe2b3('0x7'));var ejs=require(_0xe2b3('0x8'));var fs=require('fs');var fs_extra=require(_0xe2b3('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe2b3('0xa'));var jsforce=require(_0xe2b3('0xb'));var deskjs=require(_0xe2b3('0xc'));var toCsv=require(_0xe2b3('0x7'));var querystring=require(_0xe2b3('0xd'));var Papa=require(_0xe2b3('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe2b3('0xf'));var as=require(_0xe2b3('0x10'));var hardwareService=require(_0xe2b3('0x11'));var logger=require(_0xe2b3('0x12'))('api');var utils=require(_0xe2b3('0x13'));var config=require(_0xe2b3('0x14'));var licenseUtil=require(_0xe2b3('0x15'));var db=require(_0xe2b3('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x49283f,_0x14c03e){_0x14c03e=_0x14c03e||0xcc;return function(_0x54e3e7){if(_0x54e3e7){return _0x49283f[_0xe2b3('0x17')](_0x14c03e);}return _0x49283f[_0xe2b3('0x18')](_0x14c03e)[_0xe2b3('0x19')]();};}function respondWithResult(_0x5c7bba,_0x56e00f){_0x56e00f=_0x56e00f||0xc8;return function(_0x528780){if(_0x528780){return _0x5c7bba['status'](_0x56e00f)[_0xe2b3('0x1a')](_0x528780);}};}function respondWithFilteredResult(_0x3cec43,_0x5618cd){return function(_0x38caf2){if(_0x38caf2){var _0x49b6b1=typeof _0x5618cd[_0xe2b3('0x1b')]===_0xe2b3('0x1c')&&typeof _0x5618cd[_0xe2b3('0x1d')]===_0xe2b3('0x1c');var _0x1dbcc9=_0x38caf2[_0xe2b3('0x1e')];var _0x42d1e5=_0x49b6b1?0x0:_0x5618cd[_0xe2b3('0x1b')];var _0x2f3aeb=_0x49b6b1?_0x38caf2['count']:_0x5618cd[_0xe2b3('0x1b')]+_0x5618cd[_0xe2b3('0x1d')];var _0x5265a7;if(_0x2f3aeb>=_0x1dbcc9){_0x2f3aeb=_0x1dbcc9;_0x5265a7=0xc8;}else{_0x5265a7=0xce;}_0x3cec43[_0xe2b3('0x18')](_0x5265a7);return _0x3cec43['set'](_0xe2b3('0x1f'),_0x42d1e5+'-'+_0x2f3aeb+'/'+_0x1dbcc9)['json'](_0x38caf2);}return null;};}function patchUpdates(_0x4aba87){return function(_0x99723a){try{jsonpatch['apply'](_0x99723a,_0x4aba87,!![]);}catch(_0x1b1adb){return BPromise['reject'](_0x1b1adb);}return _0x99723a[_0xe2b3('0x20')]();};}function saveUpdates(_0x2d1c60,_0x34819e){return function(_0x4a1028){if(_0x4a1028){return _0x4a1028['update'](_0x2d1c60)[_0xe2b3('0x21')](function(_0x573684){return _0x573684;});}return null;};}function removeEntity(_0x49c44d,_0x289d87){return function(_0xd32207){if(_0xd32207){return _0xd32207[_0xe2b3('0x22')]()[_0xe2b3('0x21')](function(){_0x49c44d[_0xe2b3('0x18')](0xcc)[_0xe2b3('0x19')]();});}};}function handleEntityNotFound(_0x3185fa,_0x5dc4e9){return function(_0x508fd6){if(!_0x508fd6){_0x3185fa[_0xe2b3('0x17')](0x194);}return _0x508fd6;};}function handleError(_0x16c65d,_0x202790){_0x202790=_0x202790||0x1f4;return function(_0x325c19){logger['error'](_0x325c19[_0xe2b3('0x23')]);if(_0x325c19[_0xe2b3('0x24')]){delete _0x325c19[_0xe2b3('0x24')];}_0x16c65d[_0xe2b3('0x18')](_0x202790)[_0xe2b3('0x25')](_0x325c19);};}exports[_0xe2b3('0x26')]=function(_0x2b718b,_0x5a29c3){var _0x43ebd9={},_0x462a64={},_0x5385b4={'count':0x0,'rows':[]};var _0xcdb14=_[_0xe2b3('0x27')](db['SugarcrmAccount'][_0xe2b3('0x28')],function(_0x185cb6){return{'name':_0x185cb6[_0xe2b3('0x29')],'type':_0x185cb6[_0xe2b3('0x2a')][_0xe2b3('0x2b')]};});_0x462a64[_0xe2b3('0x2c')]=_[_0xe2b3('0x27')](_0xcdb14,_0xe2b3('0x24'));_0x462a64[_0xe2b3('0x2d')]=_[_0xe2b3('0x2e')](_0x2b718b[_0xe2b3('0x2d')]);_0x462a64[_0xe2b3('0x2f')]=_[_0xe2b3('0x30')](_0x462a64[_0xe2b3('0x2c')],_0x462a64['query']);_0x43ebd9[_0xe2b3('0x31')]=_['intersection'](_0x462a64[_0xe2b3('0x2c')],qs[_0xe2b3('0x32')](_0x2b718b[_0xe2b3('0x2d')]['fields']));_0x43ebd9['attributes']=_0x43ebd9[_0xe2b3('0x31')][_0xe2b3('0x33')]?_0x43ebd9[_0xe2b3('0x31')]:_0x462a64[_0xe2b3('0x2c')];if(!_0x2b718b[_0xe2b3('0x2d')][_0xe2b3('0x34')](_0xe2b3('0x35'))){_0x43ebd9['limit']=qs[_0xe2b3('0x1d')](_0x2b718b[_0xe2b3('0x2d')][_0xe2b3('0x1d')]);_0x43ebd9['offset']=qs[_0xe2b3('0x1b')](_0x2b718b[_0xe2b3('0x2d')][_0xe2b3('0x1b')]);}_0x43ebd9[_0xe2b3('0x36')]=qs[_0xe2b3('0x37')](_0x2b718b['query']['sort']);_0x43ebd9['where']=qs[_0xe2b3('0x2f')](_[_0xe2b3('0x38')](_0x2b718b[_0xe2b3('0x2d')],_0x462a64[_0xe2b3('0x2f')]),_0xcdb14);if(_0x2b718b['query'][_0xe2b3('0x39')]){_0x43ebd9[_0xe2b3('0x3a')]=_[_0xe2b3('0x3b')](_0x43ebd9[_0xe2b3('0x3a')],{'$or':_[_0xe2b3('0x27')](_0xcdb14,function(_0x394030){if(_0x394030[_0xe2b3('0x2a')]!==_0xe2b3('0x3c')){var _0x2439a7={};_0x2439a7[_0x394030['name']]={'$like':'%'+_0x2b718b['query']['filter']+'%'};return _0x2439a7;}})});}_0x43ebd9=_[_0xe2b3('0x3b')]({},_0x43ebd9,_0x2b718b[_0xe2b3('0x3d')]);var _0x212b69={'where':_0x43ebd9[_0xe2b3('0x3a')]};return db[_0xe2b3('0x3e')][_0xe2b3('0x1e')](_0x212b69)['then'](function(_0x5c4a6a){_0x5385b4[_0xe2b3('0x1e')]=_0x5c4a6a;if(_0x2b718b['query'][_0xe2b3('0x3f')]){_0x43ebd9[_0xe2b3('0x40')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0xe2b3('0x41')](_0x43ebd9);})[_0xe2b3('0x21')](function(_0x350636){_0x5385b4['rows']=_0x350636;return _0x5385b4;})[_0xe2b3('0x21')](respondWithFilteredResult(_0x5a29c3,_0x43ebd9))['catch'](handleError(_0x5a29c3,null));};exports[_0xe2b3('0x42')]=function(_0x33a190,_0x115ed7){var _0xe81988={'raw':![],'where':{'id':_0x33a190[_0xe2b3('0x43')]['id']}},_0x4cbe69={};_0x4cbe69[_0xe2b3('0x2c')]=_['keys'](db['SugarcrmAccount'][_0xe2b3('0x28')]);_0x4cbe69[_0xe2b3('0x2d')]=_[_0xe2b3('0x2e')](_0x33a190[_0xe2b3('0x2d')]);_0x4cbe69[_0xe2b3('0x2f')]=_['intersection'](_0x4cbe69['model'],_0x4cbe69[_0xe2b3('0x2d')]);_0xe81988[_0xe2b3('0x31')]=_[_0xe2b3('0x30')](_0x4cbe69[_0xe2b3('0x2c')],qs['fields'](_0x33a190['query'][_0xe2b3('0x32')]));_0xe81988['attributes']=_0xe81988[_0xe2b3('0x31')]['length']?_0xe81988[_0xe2b3('0x31')]:_0x4cbe69[_0xe2b3('0x2c')];if(_0x33a190['query'][_0xe2b3('0x3f')]){_0xe81988[_0xe2b3('0x40')]=[{'all':!![]}];}_0xe81988=_[_0xe2b3('0x3b')]({},_0xe81988,_0x33a190[_0xe2b3('0x3d')]);return db['SugarcrmAccount']['find'](_0xe81988)[_0xe2b3('0x21')](handleEntityNotFound(_0x115ed7,null))[_0xe2b3('0x21')](respondWithResult(_0x115ed7,null))[_0xe2b3('0x44')](handleError(_0x115ed7,null));};exports[_0xe2b3('0x45')]=function(_0x287d26,_0x295e34){return db[_0xe2b3('0x3e')][_0xe2b3('0x45')](_0x287d26['body'],{})[_0xe2b3('0x21')](respondWithResult(_0x295e34,0xc9))[_0xe2b3('0x44')](handleError(_0x295e34,null));};exports[_0xe2b3('0x46')]=function(_0x316588,_0x18ca02){if(_0x316588[_0xe2b3('0x47')]['id']){delete _0x316588['body']['id'];}return db[_0xe2b3('0x3e')][_0xe2b3('0x48')]({'where':{'id':_0x316588[_0xe2b3('0x43')]['id']}})[_0xe2b3('0x21')](handleEntityNotFound(_0x18ca02,null))[_0xe2b3('0x21')](saveUpdates(_0x316588[_0xe2b3('0x47')],null))['then'](respondWithResult(_0x18ca02,null))[_0xe2b3('0x44')](handleError(_0x18ca02,null));};exports['destroy']=function(_0x31071c,_0x151f20){return db[_0xe2b3('0x3e')]['find']({'where':{'id':_0x31071c['params']['id']}})['then'](handleEntityNotFound(_0x151f20,null))['then'](removeEntity(_0x151f20,null))[_0xe2b3('0x44')](handleError(_0x151f20,null));};exports['getConfigurations']=function(_0x23076c,_0x1693a2,_0x2c93c1){var _0x59fdf3={};var _0x8e3ed={};var _0x5ce38f;var _0x4ba964;return db[_0xe2b3('0x3e')][_0xe2b3('0x49')]({'where':{'id':_0x23076c[_0xe2b3('0x43')]['id']}})['then'](handleEntityNotFound(_0x1693a2,null))[_0xe2b3('0x21')](function(_0x1490ba){if(_0x1490ba){_0x5ce38f=_0x1490ba;_0x8e3ed[_0xe2b3('0x2c')]=_['keys'](db[_0xe2b3('0x4a')][_0xe2b3('0x28')]);_0x8e3ed[_0xe2b3('0x2d')]=_[_0xe2b3('0x2e')](_0x23076c[_0xe2b3('0x2d')]);_0x8e3ed[_0xe2b3('0x2f')]=_[_0xe2b3('0x30')](_0x8e3ed[_0xe2b3('0x2c')],_0x8e3ed[_0xe2b3('0x2d')]);_0x59fdf3[_0xe2b3('0x31')]=_['intersection'](_0x8e3ed[_0xe2b3('0x2c')],qs[_0xe2b3('0x32')](_0x23076c[_0xe2b3('0x2d')][_0xe2b3('0x32')]));_0x59fdf3['attributes']=_0x59fdf3[_0xe2b3('0x31')]['length']?_0x59fdf3[_0xe2b3('0x31')]:_0x8e3ed[_0xe2b3('0x2c')];_0x59fdf3[_0xe2b3('0x36')]=qs[_0xe2b3('0x37')](_0x23076c[_0xe2b3('0x2d')][_0xe2b3('0x37')]);_0x59fdf3[_0xe2b3('0x3a')]=qs[_0xe2b3('0x2f')](_[_0xe2b3('0x38')](_0x23076c[_0xe2b3('0x2d')],_0x8e3ed[_0xe2b3('0x2f')]));if(_0x23076c[_0xe2b3('0x2d')][_0xe2b3('0x39')]){_0x59fdf3[_0xe2b3('0x3a')]=_[_0xe2b3('0x3b')](_0x59fdf3[_0xe2b3('0x3a')],{'$or':_[_0xe2b3('0x27')](_0x59fdf3[_0xe2b3('0x31')],function(_0x1f9f92){var _0x5ee215={};_0x5ee215[_0x1f9f92]={'$like':'%'+_0x23076c[_0xe2b3('0x2d')][_0xe2b3('0x39')]+'%'};return _0x5ee215;})});}_0x59fdf3=_['merge']({},_0x59fdf3,_0x23076c[_0xe2b3('0x3d')]);return _0x5ce38f['getConfigurations'](_0x59fdf3);}})[_0xe2b3('0x21')](function(_0x20db3e){if(_0x20db3e){_0x4ba964=_0x20db3e['length'];if(!_0x23076c[_0xe2b3('0x2d')][_0xe2b3('0x34')](_0xe2b3('0x35'))){_0x59fdf3[_0xe2b3('0x1d')]=qs['limit'](_0x23076c[_0xe2b3('0x2d')][_0xe2b3('0x1d')]);_0x59fdf3[_0xe2b3('0x1b')]=qs[_0xe2b3('0x1b')](_0x23076c[_0xe2b3('0x2d')][_0xe2b3('0x1b')]);}return _0x5ce38f[_0xe2b3('0x4b')](_0x59fdf3);}})[_0xe2b3('0x21')](function(_0x460eda){if(_0x460eda){return _0x460eda?{'count':_0x4ba964,'rows':_0x460eda}:null;}})[_0xe2b3('0x21')](respondWithResult(_0x1693a2,null))[_0xe2b3('0x44')](handleError(_0x1693a2,null));};exports[_0xe2b3('0x4c')]=function(_0x5785c1,_0x4c8458,_0x394eeb){if(_0x5785c1[_0xe2b3('0x47')]['id']){delete _0x5785c1[_0xe2b3('0x47')]['id'];}return db[_0xe2b3('0x3e')][_0xe2b3('0x49')]({'where':{'id':_0x5785c1[_0xe2b3('0x43')]['id']}})['then'](handleEntityNotFound(_0x4c8458,null))[_0xe2b3('0x21')](function(_0x49e0d1){if(_0x49e0d1){_0x5785c1['body'][_0xe2b3('0x4d')]=_0x49e0d1['id'];_0x5785c1[_0xe2b3('0x47')][_0xe2b3('0x4e')]=integrations[_0xe2b3('0x4f')](_0x5785c1[_0xe2b3('0x47')]['channel'],_0x5785c1['body'][_0xe2b3('0x2a')]);_0x5785c1[_0xe2b3('0x47')][_0xe2b3('0x50')]=integrations[_0xe2b3('0x51')](_0x5785c1['body'][_0xe2b3('0x52')],_0x5785c1['body']['type']);return db[_0xe2b3('0x4a')][_0xe2b3('0x45')](_0x5785c1[_0xe2b3('0x47')],{'include':[{'model':db[_0xe2b3('0x53')],'as':_0xe2b3('0x4e')},{'model':db[_0xe2b3('0x53')],'as':_0xe2b3('0x50')}]});}return null;})[_0xe2b3('0x21')](respondWithResult(_0x4c8458,null))[_0xe2b3('0x44')](handleError(_0x4c8458,null));};exports[_0xe2b3('0x54')]=function(_0x3036a1,_0x2428e4,_0x137f00){var _0x1b2e5d='';var _0x31a224=['id',_0xe2b3('0x24'),_0xe2b3('0x55'),_0xe2b3('0x56'),_0xe2b3('0x57'),'date_start',_0xe2b3('0x58'),_0xe2b3('0x59'),'parent_id','parent_type',_0xe2b3('0x5a'),_0xe2b3('0x5b')];return db['SugarcrmAccount'][_0xe2b3('0x49')]({'where':{'id':_0x3036a1['params']['id']},'attributes':['id','username',_0xe2b3('0x5c'),_0xe2b3('0x5d')]})[_0xe2b3('0x21')](handleEntityNotFound(_0x2428e4,null))[_0xe2b3('0x21')](function(_0x40708b){if(_0x40708b){_0x1b2e5d=_0x40708b[_0xe2b3('0x5d')];var _0x212567=_0x1b2e5d[_0xe2b3('0x5e')](-0x1);if(_0x212567==='/'){_0x1b2e5d=_0x1b2e5d[_0xe2b3('0x5f')](0x0,_0x1b2e5d[_0xe2b3('0x60')](_0x212567));}return rp({'method':_0xe2b3('0x61'),'uri':util['format'](_0xe2b3('0x62'),_0x1b2e5d,_0xe2b3('0x63')),'json':!![],'form':{'method':_0xe2b3('0x64'),'input_type':'JSON','response_type':_0xe2b3('0x65'),'rest_data':JSON[_0xe2b3('0x66')]({'user_auth':{'user_name':_0x40708b[_0xe2b3('0x67')],'password':_0x40708b[_0xe2b3('0x5c')],'encryption':'PLAIN'},'application':_0xe2b3('0x68')})}});}})[_0xe2b3('0x21')](function(_0x3ee6da){if(_0x3ee6da&&_0x3ee6da[_0xe2b3('0x24')]!==_0xe2b3('0x69')&&_0x3ee6da['name']!==_0xe2b3('0x6a')){return rp({'method':'POST','uri':util[_0xe2b3('0x6b')](_0xe2b3('0x62'),_0x1b2e5d,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xe2b3('0x6c'),'input_type':_0xe2b3('0x65'),'response_type':'JSON','rest_data':JSON[_0xe2b3('0x66')]({'session':_0x3ee6da['id'],'module_name':'Calls'})}})[_0xe2b3('0x21')](function(_0x2b78d9){if(_0x2b78d9){var _0x56b993=_['values'](_0x2b78d9[_0xe2b3('0x6d')]);_[_0xe2b3('0x6e')](_0x56b993,function(_0x2a7a47){return _0x31a224[_0xe2b3('0x6f')](_0x2a7a47[_0xe2b3('0x24')]);});return{'count':_0x56b993[_0xe2b3('0x33')],'rows':_[_0xe2b3('0x27')](_0x56b993,function(_0x397ac2){return{'id':_0x397ac2[_0xe2b3('0x24')],'name':_0x397ac2['label'],'custom':_['endsWith'](_0x397ac2[_0xe2b3('0x24')],'_c')?!![]:![],'options':_0x397ac2['options']?_[_0xe2b3('0x27')](_['values'](_0x397ac2[_0xe2b3('0x3d')]),function(_0x5ddd81){return{'name':_0x5ddd81[_0xe2b3('0x70')],'value':_0x5ddd81[_0xe2b3('0x24')]};}):[]};})};}})[_0xe2b3('0x21')](respondWithResult(_0x2428e4,null))[_0xe2b3('0x44')](function(_0x537054){var _0xa74062=_0x3036a1[_0xe2b3('0x2d')][_0xe2b3('0x71')]?0x1f4:_0x537054[_0xe2b3('0x72')]||0x1f4;logger[_0xe2b3('0x73')](_0xe2b3('0x74'),'getFields',_0xa74062,JSON[_0xe2b3('0x66')](_0x537054));delete _0x537054[_0xe2b3('0x24')];if(_0xa74062===0x191){_0xa74062=0x190;}_0x2428e4[_0xe2b3('0x18')](_0xa74062)[_0xe2b3('0x25')](_0x3036a1[_0xe2b3('0x2d')][_0xe2b3('0x71')]?{'message':_0xe2b3('0x75'),'statusCode':_0x537054[_0xe2b3('0x72')]}:_0x537054);});}else{var _0x2a7387=0x1f4;_0x2428e4[_0xe2b3('0x18')](_0x2a7387)['send']({'message':_0xe2b3('0x75'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x8a37=['login','JSON','stringify','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','format','get_module_fields','values','module_fields','includes','label','endsWith','value','getFields,\x20%s,\x20%s,\x20%s','send','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','catch','params','includeAll','include','create','body','find','getConfigurations','findOne','SugarcrmConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','SugarcrmField','Descriptions','getFields','assigned_user_id','created_by','description','date_start','parent_id','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','%s%s','/service/v4_1/rest.php'];(function(_0x2a4dbc,_0x3b608b){var _0x47e5c9=function(_0xbcbef2){while(--_0xbcbef2){_0x2a4dbc['push'](_0x2a4dbc['shift']());}};_0x47e5c9(++_0x3b608b);}(_0x8a37,0x8a));var _0x78a3=function(_0x42d0c6,_0x48b78b){_0x42d0c6=_0x42d0c6-0x0;var _0x5799b1=_0x8a37[_0x42d0c6];return _0x5799b1;};'use strict';var emlformat=require(_0x78a3('0x0'));var rimraf=require(_0x78a3('0x1'));var zipdir=require(_0x78a3('0x2'));var jsonpatch=require(_0x78a3('0x3'));var rp=require(_0x78a3('0x4'));var moment=require('moment');var BPromise=require(_0x78a3('0x5'));var Mustache=require('mustache');var util=require(_0x78a3('0x6'));var path=require(_0x78a3('0x7'));var sox=require(_0x78a3('0x8'));var csv=require(_0x78a3('0x9'));var ejs=require(_0x78a3('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x78a3('0xb'));var squel=require('squel');var crypto=require(_0x78a3('0xc'));var jsforce=require(_0x78a3('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x78a3('0x9'));var querystring=require('querystring');var Papa=require(_0x78a3('0xe'));var Redis=require(_0x78a3('0xf'));var authService=require(_0x78a3('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x78a3('0x11'));var hardwareService=require(_0x78a3('0x12'));var logger=require(_0x78a3('0x13'))('api');var utils=require(_0x78a3('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x78a3('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0x78a3('0x16'));function respondWithStatusCode(_0x2c63b0,_0xd6006d){_0xd6006d=_0xd6006d||0xcc;return function(_0x1b72ff){if(_0x1b72ff){return _0x2c63b0[_0x78a3('0x17')](_0xd6006d);}return _0x2c63b0[_0x78a3('0x18')](_0xd6006d)[_0x78a3('0x19')]();};}function respondWithResult(_0x331b24,_0x233dbb){_0x233dbb=_0x233dbb||0xc8;return function(_0x51e569){if(_0x51e569){return _0x331b24[_0x78a3('0x18')](_0x233dbb)[_0x78a3('0x1a')](_0x51e569);}};}function respondWithFilteredResult(_0x2734a6,_0x4c1121){return function(_0x2c127e){if(_0x2c127e){var _0x66daca=typeof _0x4c1121[_0x78a3('0x1b')]===_0x78a3('0x1c')&&typeof _0x4c1121[_0x78a3('0x1d')]===_0x78a3('0x1c');var _0x5f4cdd=_0x2c127e['count'];var _0x2185d9=_0x66daca?0x0:_0x4c1121[_0x78a3('0x1b')];var _0x4eacea=_0x66daca?_0x2c127e[_0x78a3('0x1e')]:_0x4c1121[_0x78a3('0x1b')]+_0x4c1121['limit'];var _0x4cc8a8;if(_0x4eacea>=_0x5f4cdd){_0x4eacea=_0x5f4cdd;_0x4cc8a8=0xc8;}else{_0x4cc8a8=0xce;}_0x2734a6[_0x78a3('0x18')](_0x4cc8a8);return _0x2734a6[_0x78a3('0x1f')](_0x78a3('0x20'),_0x2185d9+'-'+_0x4eacea+'/'+_0x5f4cdd)[_0x78a3('0x1a')](_0x2c127e);}return null;};}function patchUpdates(_0xb8642a){return function(_0x254fa8){try{jsonpatch[_0x78a3('0x21')](_0x254fa8,_0xb8642a,!![]);}catch(_0x47c365){return BPromise[_0x78a3('0x22')](_0x47c365);}return _0x254fa8['save']();};}function saveUpdates(_0x505ef0,_0x5634e1){return function(_0x248134){if(_0x248134){return _0x248134[_0x78a3('0x23')](_0x505ef0)[_0x78a3('0x24')](function(_0x20b019){return _0x20b019;});}return null;};}function removeEntity(_0x19b7e6,_0x1b4f4a){return function(_0x5ed0ac){if(_0x5ed0ac){return _0x5ed0ac[_0x78a3('0x25')]()[_0x78a3('0x24')](function(){_0x19b7e6['status'](0xcc)[_0x78a3('0x19')]();});}};}function handleEntityNotFound(_0x36f8b6,_0x442069){return function(_0x3f91c1){if(!_0x3f91c1){_0x36f8b6['sendStatus'](0x194);}return _0x3f91c1;};}function handleError(_0x474648,_0x4abcba){_0x4abcba=_0x4abcba||0x1f4;return function(_0x27d5eb){logger[_0x78a3('0x26')](_0x27d5eb[_0x78a3('0x27')]);if(_0x27d5eb[_0x78a3('0x28')]){delete _0x27d5eb[_0x78a3('0x28')];}_0x474648[_0x78a3('0x18')](_0x4abcba)['send'](_0x27d5eb);};}exports[_0x78a3('0x29')]=function(_0x2041e9,_0x4d6c72){var _0x3abace={},_0x2df35e={},_0x69c6a0={'count':0x0,'rows':[]};var _0x487125=_[_0x78a3('0x2a')](db[_0x78a3('0x2b')][_0x78a3('0x2c')],function(_0x3a92ef){return{'name':_0x3a92ef[_0x78a3('0x2d')],'type':_0x3a92ef[_0x78a3('0x2e')][_0x78a3('0x2f')]};});_0x2df35e[_0x78a3('0x30')]=_[_0x78a3('0x2a')](_0x487125,_0x78a3('0x28'));_0x2df35e[_0x78a3('0x31')]=_[_0x78a3('0x32')](_0x2041e9[_0x78a3('0x31')]);_0x2df35e[_0x78a3('0x33')]=_[_0x78a3('0x34')](_0x2df35e[_0x78a3('0x30')],_0x2df35e[_0x78a3('0x31')]);_0x3abace[_0x78a3('0x35')]=_[_0x78a3('0x34')](_0x2df35e[_0x78a3('0x30')],qs[_0x78a3('0x36')](_0x2041e9[_0x78a3('0x31')]['fields']));_0x3abace[_0x78a3('0x35')]=_0x3abace['attributes'][_0x78a3('0x37')]?_0x3abace[_0x78a3('0x35')]:_0x2df35e[_0x78a3('0x30')];if(!_0x2041e9['query'][_0x78a3('0x38')](_0x78a3('0x39'))){_0x3abace[_0x78a3('0x1d')]=qs['limit'](_0x2041e9[_0x78a3('0x31')][_0x78a3('0x1d')]);_0x3abace['offset']=qs[_0x78a3('0x1b')](_0x2041e9['query'][_0x78a3('0x1b')]);}_0x3abace[_0x78a3('0x3a')]=qs[_0x78a3('0x3b')](_0x2041e9[_0x78a3('0x31')][_0x78a3('0x3b')]);_0x3abace[_0x78a3('0x3c')]=qs['filters'](_['pick'](_0x2041e9[_0x78a3('0x31')],_0x2df35e[_0x78a3('0x33')]),_0x487125);if(_0x2041e9[_0x78a3('0x31')][_0x78a3('0x3d')]){_0x3abace['where']=_[_0x78a3('0x3e')](_0x3abace[_0x78a3('0x3c')],{'$or':_['map'](_0x487125,function(_0x207695){if(_0x207695[_0x78a3('0x2e')]!==_0x78a3('0x3f')){var _0x596037={};_0x596037[_0x207695[_0x78a3('0x28')]]={'$like':'%'+_0x2041e9[_0x78a3('0x31')][_0x78a3('0x3d')]+'%'};return _0x596037;}})});}_0x3abace=_[_0x78a3('0x3e')]({},_0x3abace,_0x2041e9[_0x78a3('0x40')]);var _0x386f6d={'where':_0x3abace[_0x78a3('0x3c')]};return db[_0x78a3('0x2b')][_0x78a3('0x1e')](_0x386f6d)[_0x78a3('0x24')](function(_0x3b92f1){_0x69c6a0[_0x78a3('0x1e')]=_0x3b92f1;if(_0x2041e9[_0x78a3('0x31')]['includeAll']){_0x3abace['include']=[{'all':!![]}];}return db[_0x78a3('0x2b')]['findAll'](_0x3abace);})[_0x78a3('0x24')](function(_0x1fe563){_0x69c6a0['rows']=_0x1fe563;return _0x69c6a0;})[_0x78a3('0x24')](respondWithFilteredResult(_0x4d6c72,_0x3abace))[_0x78a3('0x41')](handleError(_0x4d6c72,null));};exports['show']=function(_0x51c4a6,_0x4d0ea3){var _0x4b3555={'raw':![],'where':{'id':_0x51c4a6[_0x78a3('0x42')]['id']}},_0x8a9ec4={};_0x8a9ec4[_0x78a3('0x30')]=_['keys'](db[_0x78a3('0x2b')][_0x78a3('0x2c')]);_0x8a9ec4['query']=_[_0x78a3('0x32')](_0x51c4a6[_0x78a3('0x31')]);_0x8a9ec4[_0x78a3('0x33')]=_[_0x78a3('0x34')](_0x8a9ec4[_0x78a3('0x30')],_0x8a9ec4['query']);_0x4b3555[_0x78a3('0x35')]=_['intersection'](_0x8a9ec4[_0x78a3('0x30')],qs[_0x78a3('0x36')](_0x51c4a6[_0x78a3('0x31')][_0x78a3('0x36')]));_0x4b3555[_0x78a3('0x35')]=_0x4b3555[_0x78a3('0x35')][_0x78a3('0x37')]?_0x4b3555[_0x78a3('0x35')]:_0x8a9ec4[_0x78a3('0x30')];if(_0x51c4a6[_0x78a3('0x31')][_0x78a3('0x43')]){_0x4b3555[_0x78a3('0x44')]=[{'all':!![]}];}_0x4b3555=_[_0x78a3('0x3e')]({},_0x4b3555,_0x51c4a6[_0x78a3('0x40')]);return db[_0x78a3('0x2b')]['find'](_0x4b3555)[_0x78a3('0x24')](handleEntityNotFound(_0x4d0ea3,null))['then'](respondWithResult(_0x4d0ea3,null))[_0x78a3('0x41')](handleError(_0x4d0ea3,null));};exports[_0x78a3('0x45')]=function(_0x24149e,_0x5f1b67){return db[_0x78a3('0x2b')][_0x78a3('0x45')](_0x24149e[_0x78a3('0x46')],{})[_0x78a3('0x24')](respondWithResult(_0x5f1b67,0xc9))[_0x78a3('0x41')](handleError(_0x5f1b67,null));};exports[_0x78a3('0x23')]=function(_0x2f564d,_0x31a1ec){if(_0x2f564d['body']['id']){delete _0x2f564d[_0x78a3('0x46')]['id'];}return db[_0x78a3('0x2b')]['find']({'where':{'id':_0x2f564d[_0x78a3('0x42')]['id']}})['then'](handleEntityNotFound(_0x31a1ec,null))['then'](saveUpdates(_0x2f564d[_0x78a3('0x46')],null))[_0x78a3('0x24')](respondWithResult(_0x31a1ec,null))['catch'](handleError(_0x31a1ec,null));};exports[_0x78a3('0x25')]=function(_0x5e2ff3,_0x13f3fe){return db[_0x78a3('0x2b')][_0x78a3('0x47')]({'where':{'id':_0x5e2ff3[_0x78a3('0x42')]['id']}})[_0x78a3('0x24')](handleEntityNotFound(_0x13f3fe,null))[_0x78a3('0x24')](removeEntity(_0x13f3fe,null))['catch'](handleError(_0x13f3fe,null));};exports[_0x78a3('0x48')]=function(_0xa8e512,_0x176c2e,_0x11ac67){var _0x3efd0a={};var _0x13e94f={};var _0x3e68b7;var _0x4efa8b;return db['SugarcrmAccount'][_0x78a3('0x49')]({'where':{'id':_0xa8e512[_0x78a3('0x42')]['id']}})[_0x78a3('0x24')](handleEntityNotFound(_0x176c2e,null))[_0x78a3('0x24')](function(_0x5a58d4){if(_0x5a58d4){_0x3e68b7=_0x5a58d4;_0x13e94f[_0x78a3('0x30')]=_[_0x78a3('0x32')](db[_0x78a3('0x4a')][_0x78a3('0x2c')]);_0x13e94f[_0x78a3('0x31')]=_[_0x78a3('0x32')](_0xa8e512['query']);_0x13e94f[_0x78a3('0x33')]=_[_0x78a3('0x34')](_0x13e94f[_0x78a3('0x30')],_0x13e94f[_0x78a3('0x31')]);_0x3efd0a[_0x78a3('0x35')]=_[_0x78a3('0x34')](_0x13e94f[_0x78a3('0x30')],qs[_0x78a3('0x36')](_0xa8e512[_0x78a3('0x31')][_0x78a3('0x36')]));_0x3efd0a[_0x78a3('0x35')]=_0x3efd0a['attributes']['length']?_0x3efd0a[_0x78a3('0x35')]:_0x13e94f[_0x78a3('0x30')];_0x3efd0a[_0x78a3('0x3a')]=qs[_0x78a3('0x3b')](_0xa8e512[_0x78a3('0x31')][_0x78a3('0x3b')]);_0x3efd0a[_0x78a3('0x3c')]=qs[_0x78a3('0x33')](_['pick'](_0xa8e512[_0x78a3('0x31')],_0x13e94f[_0x78a3('0x33')]));if(_0xa8e512[_0x78a3('0x31')]['filter']){_0x3efd0a['where']=_[_0x78a3('0x3e')](_0x3efd0a[_0x78a3('0x3c')],{'$or':_[_0x78a3('0x2a')](_0x3efd0a[_0x78a3('0x35')],function(_0x16f4a2){var _0x56833f={};_0x56833f[_0x16f4a2]={'$like':'%'+_0xa8e512[_0x78a3('0x31')]['filter']+'%'};return _0x56833f;})});}_0x3efd0a=_[_0x78a3('0x3e')]({},_0x3efd0a,_0xa8e512[_0x78a3('0x40')]);return _0x3e68b7[_0x78a3('0x48')](_0x3efd0a);}})[_0x78a3('0x24')](function(_0x526a74){if(_0x526a74){_0x4efa8b=_0x526a74[_0x78a3('0x37')];if(!_0xa8e512[_0x78a3('0x31')][_0x78a3('0x38')](_0x78a3('0x39'))){_0x3efd0a[_0x78a3('0x1d')]=qs[_0x78a3('0x1d')](_0xa8e512[_0x78a3('0x31')]['limit']);_0x3efd0a['offset']=qs[_0x78a3('0x1b')](_0xa8e512[_0x78a3('0x31')][_0x78a3('0x1b')]);}return _0x3e68b7[_0x78a3('0x48')](_0x3efd0a);}})[_0x78a3('0x24')](function(_0x1d67e8){if(_0x1d67e8){return _0x1d67e8?{'count':_0x4efa8b,'rows':_0x1d67e8}:null;}})[_0x78a3('0x24')](respondWithResult(_0x176c2e,null))[_0x78a3('0x41')](handleError(_0x176c2e,null));};exports[_0x78a3('0x4b')]=function(_0x41f80d,_0x22d3b9,_0x47edbd){if(_0x41f80d[_0x78a3('0x46')]['id']){delete _0x41f80d[_0x78a3('0x46')]['id'];}return db['SugarcrmAccount']['findOne']({'where':{'id':_0x41f80d[_0x78a3('0x42')]['id']}})['then'](handleEntityNotFound(_0x22d3b9,null))[_0x78a3('0x24')](function(_0x423fd9){if(_0x423fd9){_0x41f80d[_0x78a3('0x46')][_0x78a3('0x4c')]=_0x423fd9['id'];_0x41f80d[_0x78a3('0x46')][_0x78a3('0x4d')]=integrations[_0x78a3('0x4e')](_0x41f80d[_0x78a3('0x46')][_0x78a3('0x4f')],_0x41f80d['body'][_0x78a3('0x2e')]);_0x41f80d[_0x78a3('0x46')]['Descriptions']=integrations[_0x78a3('0x50')](_0x41f80d[_0x78a3('0x46')]['channel'],_0x41f80d[_0x78a3('0x46')]['type']);return db[_0x78a3('0x4a')][_0x78a3('0x45')](_0x41f80d['body'],{'include':[{'model':db['SugarcrmField'],'as':_0x78a3('0x4d')},{'model':db[_0x78a3('0x51')],'as':_0x78a3('0x52')}]});}return null;})[_0x78a3('0x24')](respondWithResult(_0x22d3b9,null))[_0x78a3('0x41')](handleError(_0x22d3b9,null));};exports[_0x78a3('0x53')]=function(_0x5831fb,_0x300cec,_0xea96bd){var _0x21b53e='';var _0xbe2a6c=['id','name',_0x78a3('0x54'),_0x78a3('0x55'),_0x78a3('0x56'),_0x78a3('0x57'),'duration_hours','duration_minutes',_0x78a3('0x58'),'parent_type',_0x78a3('0x59'),_0x78a3('0x5a')];return db[_0x78a3('0x2b')][_0x78a3('0x49')]({'where':{'id':_0x5831fb['params']['id']},'attributes':['id',_0x78a3('0x5b'),_0x78a3('0x5c'),_0x78a3('0x5d')]})[_0x78a3('0x24')](handleEntityNotFound(_0x300cec,null))[_0x78a3('0x24')](function(_0x38a8da){if(_0x38a8da){_0x21b53e=_0x38a8da['remoteUri'];var _0x3e286a=_0x21b53e[_0x78a3('0x5e')](-0x1);if(_0x3e286a==='/'){_0x21b53e=_0x21b53e[_0x78a3('0x5f')](0x0,_0x21b53e[_0x78a3('0x60')](_0x3e286a));}return rp({'method':_0x78a3('0x61'),'uri':util['format'](_0x78a3('0x62'),_0x21b53e,_0x78a3('0x63')),'json':!![],'form':{'method':_0x78a3('0x64'),'input_type':_0x78a3('0x65'),'response_type':_0x78a3('0x65'),'rest_data':JSON[_0x78a3('0x66')]({'user_auth':{'user_name':_0x38a8da[_0x78a3('0x5b')],'password':_0x38a8da[_0x78a3('0x5c')],'encryption':'PLAIN'},'application':_0x78a3('0x67')})}});}})['then'](function(_0x3bb7f6){if(_0x3bb7f6&&_0x3bb7f6['name']!==_0x78a3('0x68')&&_0x3bb7f6['name']!==_0x78a3('0x69')){return rp({'method':_0x78a3('0x61'),'uri':util[_0x78a3('0x6a')]('%s%s',_0x21b53e,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x78a3('0x6b'),'input_type':_0x78a3('0x65'),'response_type':'JSON','rest_data':JSON[_0x78a3('0x66')]({'session':_0x3bb7f6['id'],'module_name':'Calls'})}})[_0x78a3('0x24')](function(_0x43fe43){if(_0x43fe43){var _0x2bf02c=_[_0x78a3('0x6c')](_0x43fe43[_0x78a3('0x6d')]);_['remove'](_0x2bf02c,function(_0x33ef77){return _0xbe2a6c[_0x78a3('0x6e')](_0x33ef77[_0x78a3('0x28')]);});return{'count':_0x2bf02c['length'],'rows':_[_0x78a3('0x2a')](_0x2bf02c,function(_0x39b863){return{'id':_0x39b863['name'],'name':_0x39b863[_0x78a3('0x6f')],'custom':_[_0x78a3('0x70')](_0x39b863[_0x78a3('0x28')],'_c')?!![]:![],'options':_0x39b863[_0x78a3('0x40')]?_['map'](_[_0x78a3('0x6c')](_0x39b863[_0x78a3('0x40')]),function(_0x537999){return{'name':_0x537999[_0x78a3('0x71')],'value':_0x537999[_0x78a3('0x28')]};}):[]};})};}})[_0x78a3('0x24')](respondWithResult(_0x300cec,null))[_0x78a3('0x41')](function(_0x1747d9){var _0x31ceae=_0x5831fb[_0x78a3('0x31')]['test']?0x1f4:_0x1747d9['statusCode']||0x1f4;logger['error'](_0x78a3('0x72'),_0x78a3('0x53'),_0x31ceae,JSON['stringify'](_0x1747d9));delete _0x1747d9[_0x78a3('0x28')];if(_0x31ceae===0x191){_0x31ceae=0x190;}_0x300cec[_0x78a3('0x18')](_0x31ceae)[_0x78a3('0x73')](_0x5831fb[_0x78a3('0x31')][_0x78a3('0x74')]?{'message':_0x78a3('0x75'),'statusCode':_0x1747d9[_0x78a3('0x76')]}:_0x1747d9);});}else{var _0x198ce5=0x1f4;_0x300cec[_0x78a3('0x18')](_0x198ce5)['send']({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index afbf982..57773c8 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 _0x0767=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','SugarcrmAccount','int_sugarcrm_accounts','lodash'];(function(_0x564b1e,_0x4ec4df){var _0x1fcbd3=function(_0x5e5f93){while(--_0x5e5f93){_0x564b1e['push'](_0x564b1e['shift']());}};_0x1fcbd3(++_0x4ec4df);}(_0x0767,0x1bf));var _0x7076=function(_0x327dd3,_0x4b859c){_0x327dd3=_0x327dd3-0x0;var _0x286b7a=_0x0767[_0x327dd3];return _0x286b7a;};'use strict';var _=require(_0x7076('0x0'));var util=require(_0x7076('0x1'));var logger=require(_0x7076('0x2'))(_0x7076('0x3'));var moment=require(_0x7076('0x4'));var BPromise=require(_0x7076('0x5'));var rp=require(_0x7076('0x6'));var fs=require('fs');var path=require(_0x7076('0x7'));var rimraf=require(_0x7076('0x8'));var config=require(_0x7076('0x9'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x7076('0xa'));module[_0x7076('0xb')]=function(_0x32d055,_0x4353be){return _0x32d055['define'](_0x7076('0xc'),attributes,{'tableName':_0x7076('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2935=['moment','bluebird','request-promise','rimraf','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','api'];(function(_0x485afc,_0x33f8ad){var _0x1993a2=function(_0x5eb16f){while(--_0x5eb16f){_0x485afc['push'](_0x485afc['shift']());}};_0x1993a2(++_0x33f8ad);}(_0x2935,0xda));var _0x5293=function(_0x27f4cd,_0x1235a5){_0x27f4cd=_0x27f4cd-0x0;var _0x261a56=_0x2935[_0x27f4cd];return _0x261a56;};'use strict';var _=require(_0x5293('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5293('0x1'));var moment=require(_0x5293('0x2'));var BPromise=require(_0x5293('0x3'));var rp=require(_0x5293('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5293('0x5'));var config=require('../../config/environment');var attributes=require('./intSugarcrmAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x5293('0x6')]=function(_0x5ef467,_0x96471f){return _0x5ef467[_0x5293('0x7')](_0x5293('0x8'),attributes,{'tableName':_0x5293('0x9'),'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 1c5e8ab..0c39b0a 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 _0xde6c=['http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','where','include','map','model','attributes','debug','ShowSugarcrmAccount','raw','lodash','util','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x1185ce,_0x220ea1){var _0x1a62a7=function(_0x13b70a){while(--_0x13b70a){_0x1185ce['push'](_0x1185ce['shift']());}};_0x1a62a7(++_0x220ea1);}(_0xde6c,0x1d8));var _0xcde6=function(_0x34b64f,_0x2cbd48){_0x34b64f=_0x34b64f-0x0;var _0x40c2c7=_0xde6c[_0x34b64f];return _0x40c2c7;};'use strict';var _=require(_0xcde6('0x0'));var util=require(_0xcde6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcde6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcde6('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xcde6('0x4'))('rpc');var config=require(_0xcde6('0x5'));var jayson=require(_0xcde6('0x6'));var client=jayson[_0xcde6('0x7')][_0xcde6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x29f9c7,_0x285fd6,_0x2e3106){return new BPromise(function(_0x2374a9,_0x42aa0e){return client[_0xcde6('0x9')](_0x29f9c7,_0x2e3106)[_0xcde6('0xa')](function(_0x3eddab){logger[_0xcde6('0xb')](_0xcde6('0xc'),_0x285fd6,_0xcde6('0xd'));logger['debug'](_0xcde6('0xe'),_0x285fd6,_0xcde6('0xd'),JSON[_0xcde6('0xf')](_0x3eddab));if(_0x3eddab[_0xcde6('0x10')]){if(_0x3eddab[_0xcde6('0x10')]['code']===0x1f4){logger['error'](_0xcde6('0xc'),_0x285fd6,_0x3eddab[_0xcde6('0x10')][_0xcde6('0x11')]);return _0x42aa0e(_0x3eddab[_0xcde6('0x10')][_0xcde6('0x11')]);}logger[_0xcde6('0x10')](_0xcde6('0xc'),_0x285fd6,_0x3eddab[_0xcde6('0x10')][_0xcde6('0x11')]);return _0x2374a9(_0x3eddab[_0xcde6('0x10')][_0xcde6('0x11')]);}else{logger[_0xcde6('0xb')](_0xcde6('0xc'),_0x285fd6,'request\x20sent');_0x2374a9(_0x3eddab[_0xcde6('0x12')][_0xcde6('0x11')]);}})[_0xcde6('0x13')](function(_0x502e7b){logger[_0xcde6('0x10')](_0xcde6('0xc'),_0x285fd6,_0x502e7b);_0x42aa0e(_0x502e7b);});});}exports[_0xcde6('0x14')]=function(_0x31ddc2){var _0x14a61a=this;return new Promise(function(_0x50fe7a,_0x167ac4){return db[_0xcde6('0x15')][_0xcde6('0x16')]({'raw':_0x31ddc2[_0xcde6('0x17')]?_0x31ddc2[_0xcde6('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x31ddc2['options']?_0x31ddc2[_0xcde6('0x17')][_0xcde6('0x18')]||null:null,'attributes':_0x31ddc2[_0xcde6('0x17')]?_0x31ddc2[_0xcde6('0x17')]['attributes']||null:null,'limit':_0x31ddc2[_0xcde6('0x17')]?_0x31ddc2[_0xcde6('0x17')]['limit']||null:null,'include':_0x31ddc2[_0xcde6('0x17')]?_0x31ddc2[_0xcde6('0x17')][_0xcde6('0x19')]?_[_0xcde6('0x1a')](_0x31ddc2[_0xcde6('0x17')]['include'],function(_0x46188c){return{'model':db[_0x46188c[_0xcde6('0x1b')]],'as':_0x46188c['as'],'attributes':_0x46188c[_0xcde6('0x1c')],'include':_0x46188c[_0xcde6('0x19')]?_[_0xcde6('0x1a')](_0x46188c[_0xcde6('0x19')],function(_0x50f241){return{'model':db[_0x50f241['model']],'as':_0x50f241['as'],'attributes':_0x50f241[_0xcde6('0x1c')],'include':_0x50f241[_0xcde6('0x19')]?_[_0xcde6('0x1a')](_0x50f241[_0xcde6('0x19')],function(_0x58bad3){return{'model':db[_0x58bad3[_0xcde6('0x1b')]],'as':_0x58bad3['as'],'attributes':_0x58bad3[_0xcde6('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xcde6('0xa')](function(_0x5915af){logger[_0xcde6('0xb')](_0xcde6('0x14'),_0x31ddc2);logger[_0xcde6('0x1d')]('GetSugarcrmAccount',_0x31ddc2,JSON['stringify'](_0x5915af));_0x50fe7a(_0x5915af);})[_0xcde6('0x13')](function(_0x11eceb){logger[_0xcde6('0x10')](_0xcde6('0x14'),_0x11eceb['message'],_0x31ddc2);_0x167ac4(_0x14a61a[_0xcde6('0x10')](0x1f4,_0x11eceb[_0xcde6('0x11')]));});});};exports[_0xcde6('0x1e')]=function(_0x325ab8){var _0x5825ad=this;return new Promise(function(_0x1d8f41,_0x23b78e){return db[_0xcde6('0x15')]['find']({'raw':_0x325ab8['options']?_0x325ab8[_0xcde6('0x17')][_0xcde6('0x1f')]===undefined?!![]:![]:!![],'where':_0x325ab8[_0xcde6('0x17')]?_0x325ab8[_0xcde6('0x17')][_0xcde6('0x18')]||null:null,'attributes':_0x325ab8[_0xcde6('0x17')]?_0x325ab8[_0xcde6('0x17')]['attributes']||null:null,'include':_0x325ab8[_0xcde6('0x17')]?_0x325ab8[_0xcde6('0x17')][_0xcde6('0x19')]?_[_0xcde6('0x1a')](_0x325ab8[_0xcde6('0x17')][_0xcde6('0x19')],function(_0x16f579){return{'model':db[_0x16f579[_0xcde6('0x1b')]],'as':_0x16f579['as'],'attributes':_0x16f579[_0xcde6('0x1c')],'include':_0x16f579[_0xcde6('0x19')]?_[_0xcde6('0x1a')](_0x16f579[_0xcde6('0x19')],function(_0x158567){return{'model':db[_0x158567['model']],'as':_0x158567['as'],'attributes':_0x158567[_0xcde6('0x1c')],'include':_0x158567[_0xcde6('0x19')]?_[_0xcde6('0x1a')](_0x158567[_0xcde6('0x19')],function(_0x39bfa1){return{'model':db[_0x39bfa1[_0xcde6('0x1b')]],'as':_0x39bfa1['as'],'attributes':_0x39bfa1[_0xcde6('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xcde6('0xa')](function(_0x29c3b3){logger['info']('ShowSugarcrmAccount',_0x325ab8);logger['debug'](_0xcde6('0x1e'),_0x325ab8,JSON[_0xcde6('0xf')](_0x29c3b3));_0x1d8f41(_0x29c3b3);})['catch'](function(_0x48d401){logger[_0xcde6('0x10')]('ShowSugarcrmAccount',_0x48d401[_0xcde6('0x11')],_0x325ab8);_0x23b78e(_0x5825ad[_0xcde6('0x10')](0x1f4,_0x48d401[_0xcde6('0x11')]));});});}; \ No newline at end of file +var _0x17d4=['catch','GetSugarcrmAccount','SugarcrmAccount','raw','options','limit','include','map','model','attributes','ShowSugarcrmAccount','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0xe0429d,_0x3736ff){var _0x3c7cab=function(_0x1f54fe){while(--_0x1f54fe){_0xe0429d['push'](_0xe0429d['shift']());}};_0x3c7cab(++_0x3736ff);}(_0x17d4,0x148));var _0x417d=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x17d4[_0x29d94e];return _0x106237;};'use strict';var _=require(_0x417d('0x0'));var util=require(_0x417d('0x1'));var moment=require(_0x417d('0x2'));var BPromise=require(_0x417d('0x3'));var rs=require(_0x417d('0x4'));var fs=require('fs');var Redis=require(_0x417d('0x5'));var db=require(_0x417d('0x6'))['db'];var utils=require(_0x417d('0x7'));var logger=require(_0x417d('0x8'))(_0x417d('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x417d('0xa')][_0x417d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x15e0a1,_0x958b15,_0x4be7f3){return new BPromise(function(_0x44a460,_0x31a93e){return client[_0x417d('0xc')](_0x15e0a1,_0x4be7f3)[_0x417d('0xd')](function(_0x2c4d19){logger[_0x417d('0xe')](_0x417d('0xf'),_0x958b15,_0x417d('0x10'));logger[_0x417d('0x11')](_0x417d('0x12'),_0x958b15,_0x417d('0x10'),JSON[_0x417d('0x13')](_0x2c4d19));if(_0x2c4d19[_0x417d('0x14')]){if(_0x2c4d19[_0x417d('0x14')]['code']===0x1f4){logger[_0x417d('0x14')]('SugarcrmAccount,\x20%s,\x20%s',_0x958b15,_0x2c4d19[_0x417d('0x14')][_0x417d('0x15')]);return _0x31a93e(_0x2c4d19[_0x417d('0x14')][_0x417d('0x15')]);}logger[_0x417d('0x14')](_0x417d('0xf'),_0x958b15,_0x2c4d19[_0x417d('0x14')][_0x417d('0x15')]);return _0x44a460(_0x2c4d19[_0x417d('0x14')][_0x417d('0x15')]);}else{logger['info'](_0x417d('0xf'),_0x958b15,_0x417d('0x10'));_0x44a460(_0x2c4d19['result']['message']);}})[_0x417d('0x16')](function(_0x3d64ac){logger[_0x417d('0x14')]('SugarcrmAccount,\x20%s,\x20%s',_0x958b15,_0x3d64ac);_0x31a93e(_0x3d64ac);});});}exports[_0x417d('0x17')]=function(_0x576737){var _0x11c3f4=this;return new Promise(function(_0x1a4fe8,_0x17963b){return db[_0x417d('0x18')]['findAll']({'raw':_0x576737['options']?_0x576737['options'][_0x417d('0x19')]===undefined?!![]:![]:!![],'where':_0x576737[_0x417d('0x1a')]?_0x576737[_0x417d('0x1a')]['where']||null:null,'attributes':_0x576737['options']?_0x576737[_0x417d('0x1a')]['attributes']||null:null,'limit':_0x576737['options']?_0x576737[_0x417d('0x1a')][_0x417d('0x1b')]||null:null,'include':_0x576737[_0x417d('0x1a')]?_0x576737[_0x417d('0x1a')][_0x417d('0x1c')]?_[_0x417d('0x1d')](_0x576737[_0x417d('0x1a')]['include'],function(_0x244425){return{'model':db[_0x244425[_0x417d('0x1e')]],'as':_0x244425['as'],'attributes':_0x244425[_0x417d('0x1f')],'include':_0x244425[_0x417d('0x1c')]?_[_0x417d('0x1d')](_0x244425[_0x417d('0x1c')],function(_0x800ef7){return{'model':db[_0x800ef7[_0x417d('0x1e')]],'as':_0x800ef7['as'],'attributes':_0x800ef7['attributes'],'include':_0x800ef7[_0x417d('0x1c')]?_['map'](_0x800ef7[_0x417d('0x1c')],function(_0x1df733){return{'model':db[_0x1df733[_0x417d('0x1e')]],'as':_0x1df733['as'],'attributes':_0x1df733['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3b30d2){logger[_0x417d('0xe')](_0x417d('0x17'),_0x576737);logger[_0x417d('0x11')](_0x417d('0x17'),_0x576737,JSON['stringify'](_0x3b30d2));_0x1a4fe8(_0x3b30d2);})[_0x417d('0x16')](function(_0x35a0f3){logger[_0x417d('0x14')]('GetSugarcrmAccount',_0x35a0f3[_0x417d('0x15')],_0x576737);_0x17963b(_0x11c3f4['error'](0x1f4,_0x35a0f3[_0x417d('0x15')]));});});};exports[_0x417d('0x20')]=function(_0x150086){var _0x4e0b0d=this;return new Promise(function(_0x785684,_0x1b6279){return db[_0x417d('0x18')][_0x417d('0x21')]({'raw':_0x150086[_0x417d('0x1a')]?_0x150086[_0x417d('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x150086[_0x417d('0x1a')]?_0x150086[_0x417d('0x1a')][_0x417d('0x22')]||null:null,'attributes':_0x150086[_0x417d('0x1a')]?_0x150086[_0x417d('0x1a')][_0x417d('0x1f')]||null:null,'include':_0x150086[_0x417d('0x1a')]?_0x150086[_0x417d('0x1a')][_0x417d('0x1c')]?_[_0x417d('0x1d')](_0x150086['options']['include'],function(_0x8c9c53){return{'model':db[_0x8c9c53[_0x417d('0x1e')]],'as':_0x8c9c53['as'],'attributes':_0x8c9c53[_0x417d('0x1f')],'include':_0x8c9c53[_0x417d('0x1c')]?_[_0x417d('0x1d')](_0x8c9c53[_0x417d('0x1c')],function(_0xe0ae6f){return{'model':db[_0xe0ae6f[_0x417d('0x1e')]],'as':_0xe0ae6f['as'],'attributes':_0xe0ae6f[_0x417d('0x1f')],'include':_0xe0ae6f[_0x417d('0x1c')]?_['map'](_0xe0ae6f[_0x417d('0x1c')],function(_0x1dc7b5){return{'model':db[_0x1dc7b5[_0x417d('0x1e')]],'as':_0x1dc7b5['as'],'attributes':_0x1dc7b5[_0x417d('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x417d('0xd')](function(_0x9a7918){logger[_0x417d('0xe')](_0x417d('0x20'),_0x150086);logger['debug']('ShowSugarcrmAccount',_0x150086,JSON['stringify'](_0x9a7918));_0x785684(_0x9a7918);})[_0x417d('0x16')](function(_0x439934){logger[_0x417d('0x14')](_0x417d('0x20'),_0x439934[_0x417d('0x15')],_0x150086);_0x1b6279(_0x4e0b0d[_0x417d('0x14')](0x1f4,_0x439934[_0x417d('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 57f18d9..7f31681 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 _0x0ce1=['isAuthenticated','index','/:id','show','/:id/descriptions','getDescriptions','post','create','update','multer','util','path','../../components/interaction/service','../../config/environment','get'];(function(_0x1ed544,_0x4bb547){var _0x29412d=function(_0x239274){while(--_0x239274){_0x1ed544['push'](_0x1ed544['shift']());}};_0x29412d(++_0x4bb547);}(_0x0ce1,0xae));var _0x10ce=function(_0x2f8431,_0x2850c8){_0x2f8431=_0x2f8431-0x0;var _0x313498=_0x0ce1[_0x2f8431];return _0x313498;};'use strict';var multer=require(_0x10ce('0x0'));var util=require(_0x10ce('0x1'));var path=require(_0x10ce('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x10ce('0x3'));var config=require(_0x10ce('0x4'));var controller=require('./intSugarcrmConfiguration.controller');router[_0x10ce('0x5')]('/',auth[_0x10ce('0x6')](),controller[_0x10ce('0x7')]);router[_0x10ce('0x5')](_0x10ce('0x8'),auth[_0x10ce('0x6')](),controller[_0x10ce('0x9')]);router[_0x10ce('0x5')]('/:id/fields',auth[_0x10ce('0x6')](),controller['getFields']);router['get']('/:id/subjects',auth[_0x10ce('0x6')](),controller['getSubjects']);router[_0x10ce('0x5')](_0x10ce('0xa'),auth['isAuthenticated'](),controller[_0x10ce('0xb')]);router[_0x10ce('0xc')]('/',auth[_0x10ce('0x6')](),controller[_0x10ce('0xd')]);router['put']('/:id',auth[_0x10ce('0x6')](),controller[_0x10ce('0xe')]);router['delete'](_0x10ce('0x8'),auth[_0x10ce('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1316=['./intSugarcrmConfiguration.controller','isAuthenticated','index','get','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','update','delete','/:id','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x25c077,_0x409eb4){var _0x5934f1=function(_0xd6e146){while(--_0xd6e146){_0x25c077['push'](_0x25c077['shift']());}};_0x5934f1(++_0x409eb4);}(_0x1316,0x191));var _0x6131=function(_0x3b91bd,_0x5242a0){_0x3b91bd=_0x3b91bd-0x0;var _0x5bf715=_0x1316[_0x3b91bd];return _0x5bf715;};'use strict';var multer=require(_0x6131('0x0'));var util=require(_0x6131('0x1'));var path=require('path');var timeout=require(_0x6131('0x2'));var express=require(_0x6131('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6131('0x4'));var interaction=require(_0x6131('0x5'));var config=require(_0x6131('0x6'));var controller=require(_0x6131('0x7'));router['get']('/',auth[_0x6131('0x8')](),controller[_0x6131('0x9')]);router[_0x6131('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x6131('0xb')]);router[_0x6131('0xa')]('/:id/fields',auth[_0x6131('0x8')](),controller[_0x6131('0xc')]);router[_0x6131('0xa')](_0x6131('0xd'),auth[_0x6131('0x8')](),controller[_0x6131('0xe')]);router[_0x6131('0xa')](_0x6131('0xf'),auth[_0x6131('0x8')](),controller[_0x6131('0x10')]);router[_0x6131('0x11')]('/',auth[_0x6131('0x8')](),controller[_0x6131('0x12')]);router['put']('/:id',auth[_0x6131('0x8')](),controller[_0x6131('0x13')]);router[_0x6131('0x14')](_0x6131('0x15'),auth[_0x6131('0x8')](),controller[_0x6131('0x16')]);module[_0x6131('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 17523ef..3274c91 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 _0x11e1=['sequelize','exports','STRING'];(function(_0x11f6ea,_0x483106){var _0x3abbb3=function(_0x5c2d2c){while(--_0x5c2d2c){_0x11f6ea['push'](_0x11f6ea['shift']());}};_0x3abbb3(++_0x483106);}(_0x11e1,0x84));var _0x111e=function(_0x55c394,_0xedbf15){_0x55c394=_0x55c394-0x0;var _0x50678b=_0x11e1[_0x55c394];return _0x50678b;};'use strict';var Sequelize=require(_0x111e('0x0'));module[_0x111e('0x1')]={'name':{'type':Sequelize[_0x111e('0x2')]},'description':{'type':Sequelize[_0x111e('0x2')]}}; \ No newline at end of file +var _0x0bb9=['STRING','sequelize','exports'];(function(_0x53bbb0,_0x2dbaf1){var _0x23041a=function(_0x4ad729){while(--_0x4ad729){_0x53bbb0['push'](_0x53bbb0['shift']());}};_0x23041a(++_0x2dbaf1);}(_0x0bb9,0x67));var _0x90bb=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x0bb9[_0x27af45];return _0x18df21;};'use strict';var Sequelize=require(_0x90bb('0x0'));module[_0x90bb('0x1')]={'name':{'type':Sequelize[_0x90bb('0x2')]},'description':{'type':Sequelize[_0x90bb('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index c2b26b2..3da1e99 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 _0xf12e=['findOne','getDescriptions','order','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','set','Content-Range','json','apply','save','then','destroy','error','stack','name','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','merge','options','count','findAll','catch','includeAll','include','find','create','body','params','SugarcrmField','filter','getFields','getSubjects'];(function(_0x270112,_0x210b9b){var _0x4fb276=function(_0x280b36){while(--_0x280b36){_0x270112['push'](_0x270112['shift']());}};_0x4fb276(++_0x210b9b);}(_0xf12e,0x1d7));var _0xef12=function(_0x5e4cd6,_0xfb732a){_0x5e4cd6=_0x5e4cd6-0x0;var _0xd7c226=_0xf12e[_0x5e4cd6];return _0xd7c226;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xef12('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xef12('0x1'));var rp=require(_0xef12('0x2'));var moment=require(_0xef12('0x3'));var BPromise=require(_0xef12('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xef12('0x5'));var sox=require(_0xef12('0x6'));var csv=require(_0xef12('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xef12('0x8'));var _=require('lodash');var squel=require(_0xef12('0x9'));var crypto=require(_0xef12('0xa'));var jsforce=require(_0xef12('0xb'));var deskjs=require(_0xef12('0xc'));var toCsv=require('to-csv');var querystring=require(_0xef12('0xd'));var Papa=require(_0xef12('0xe'));var Redis=require(_0xef12('0xf'));var authService=require(_0xef12('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xef12('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xef12('0x12'))(_0xef12('0x13'));var utils=require(_0xef12('0x14'));var config=require(_0xef12('0x15'));var licenseUtil=require(_0xef12('0x16'));var db=require(_0xef12('0x17'))['db'];function respondWithStatusCode(_0x3bbf6b,_0x3aebbf){_0x3aebbf=_0x3aebbf||0xcc;return function(_0x5b3096){if(_0x5b3096){return _0x3bbf6b['sendStatus'](_0x3aebbf);}return _0x3bbf6b['status'](_0x3aebbf)[_0xef12('0x18')]();};}function respondWithResult(_0x466821,_0x1ffba8){_0x1ffba8=_0x1ffba8||0xc8;return function(_0x60dbb2){if(_0x60dbb2){return _0x466821[_0xef12('0x19')](_0x1ffba8)['json'](_0x60dbb2);}};}function respondWithFilteredResult(_0x17b65c,_0x3248a7){return function(_0x4e2a17){if(_0x4e2a17){var _0x1de3d1=typeof _0x3248a7[_0xef12('0x1a')]===_0xef12('0x1b')&&typeof _0x3248a7[_0xef12('0x1c')]==='undefined';var _0x6fc6f=_0x4e2a17['count'];var _0x2e7ad3=_0x1de3d1?0x0:_0x3248a7[_0xef12('0x1a')];var _0x213be7=_0x1de3d1?_0x4e2a17['count']:_0x3248a7[_0xef12('0x1a')]+_0x3248a7[_0xef12('0x1c')];var _0x18571f;if(_0x213be7>=_0x6fc6f){_0x213be7=_0x6fc6f;_0x18571f=0xc8;}else{_0x18571f=0xce;}_0x17b65c[_0xef12('0x19')](_0x18571f);return _0x17b65c[_0xef12('0x1d')](_0xef12('0x1e'),_0x2e7ad3+'-'+_0x213be7+'/'+_0x6fc6f)[_0xef12('0x1f')](_0x4e2a17);}return null;};}function patchUpdates(_0x9b8a55){return function(_0xb0d8da){try{jsonpatch[_0xef12('0x20')](_0xb0d8da,_0x9b8a55,!![]);}catch(_0x1f5b90){return BPromise['reject'](_0x1f5b90);}return _0xb0d8da[_0xef12('0x21')]();};}function saveUpdates(_0x2eb1c5,_0x48bcf2){return function(_0x1733ff){if(_0x1733ff){return _0x1733ff['update'](_0x2eb1c5)[_0xef12('0x22')](function(_0x43ad77){return _0x43ad77;});}return null;};}function removeEntity(_0x14cf7d,_0x2734c8){return function(_0x3fcc84){if(_0x3fcc84){return _0x3fcc84[_0xef12('0x23')]()['then'](function(){_0x14cf7d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f2918,_0x45177f){return function(_0x397278){if(!_0x397278){_0x1f2918['sendStatus'](0x194);}return _0x397278;};}function handleError(_0x3a19ff,_0x3072c1){_0x3072c1=_0x3072c1||0x1f4;return function(_0x22c70e){logger[_0xef12('0x24')](_0x22c70e[_0xef12('0x25')]);if(_0x22c70e[_0xef12('0x26')]){delete _0x22c70e[_0xef12('0x26')];}_0x3a19ff['status'](_0x3072c1)['send'](_0x22c70e);};}exports[_0xef12('0x27')]=function(_0x4942e7,_0x55a604){var _0x443706={},_0x3e6c74={},_0x136242={'count':0x0,'rows':[]};var _0x32733f=_[_0xef12('0x28')](db[_0xef12('0x29')][_0xef12('0x2a')],function(_0x1aa15a){return{'name':_0x1aa15a[_0xef12('0x2b')],'type':_0x1aa15a[_0xef12('0x2c')][_0xef12('0x2d')]};});_0x3e6c74[_0xef12('0x2e')]=_['map'](_0x32733f,_0xef12('0x26'));_0x3e6c74['query']=_[_0xef12('0x2f')](_0x4942e7[_0xef12('0x30')]);_0x3e6c74[_0xef12('0x31')]=_['intersection'](_0x3e6c74[_0xef12('0x2e')],_0x3e6c74[_0xef12('0x30')]);_0x443706[_0xef12('0x32')]=_[_0xef12('0x33')](_0x3e6c74['model'],qs[_0xef12('0x34')](_0x4942e7[_0xef12('0x30')][_0xef12('0x34')]));_0x443706[_0xef12('0x32')]=_0x443706[_0xef12('0x32')][_0xef12('0x35')]?_0x443706['attributes']:_0x3e6c74[_0xef12('0x2e')];if(!_0x4942e7[_0xef12('0x30')][_0xef12('0x36')](_0xef12('0x37'))){_0x443706[_0xef12('0x1c')]=qs[_0xef12('0x1c')](_0x4942e7['query'][_0xef12('0x1c')]);_0x443706[_0xef12('0x1a')]=qs['offset'](_0x4942e7['query'][_0xef12('0x1a')]);}_0x443706['order']=qs[_0xef12('0x38')](_0x4942e7['query']['sort']);_0x443706[_0xef12('0x39')]=qs[_0xef12('0x31')](_[_0xef12('0x3a')](_0x4942e7['query'],_0x3e6c74[_0xef12('0x31')]),_0x32733f);if(_0x4942e7[_0xef12('0x30')]['filter']){_0x443706[_0xef12('0x39')]=_['merge'](_0x443706[_0xef12('0x39')],{'$or':_[_0xef12('0x28')](_0x32733f,function(_0x55e81d){if(_0x55e81d[_0xef12('0x2c')]!==_0xef12('0x3b')){var _0x5935bd={};_0x5935bd[_0x55e81d[_0xef12('0x26')]]={'$like':'%'+_0x4942e7[_0xef12('0x30')]['filter']+'%'};return _0x5935bd;}})});}_0x443706=_[_0xef12('0x3c')]({},_0x443706,_0x4942e7[_0xef12('0x3d')]);var _0x438543={'where':_0x443706[_0xef12('0x39')]};return db[_0xef12('0x29')][_0xef12('0x3e')](_0x438543)[_0xef12('0x22')](function(_0x4fc9e2){_0x136242[_0xef12('0x3e')]=_0x4fc9e2;if(_0x4942e7[_0xef12('0x30')]['includeAll']){_0x443706['include']=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0xef12('0x3f')](_0x443706);})['then'](function(_0x5b3b00){_0x136242['rows']=_0x5b3b00;return _0x136242;})['then'](respondWithFilteredResult(_0x55a604,_0x443706))[_0xef12('0x40')](handleError(_0x55a604,null));};exports['show']=function(_0x3a14d0,_0x27ae12){var _0x5b88b8={'raw':![],'where':{'id':_0x3a14d0['params']['id']}},_0x675e22={};_0x675e22[_0xef12('0x2e')]=_['keys'](db['SugarcrmConfiguration'][_0xef12('0x2a')]);_0x675e22['query']=_[_0xef12('0x2f')](_0x3a14d0[_0xef12('0x30')]);_0x675e22[_0xef12('0x31')]=_[_0xef12('0x33')](_0x675e22['model'],_0x675e22['query']);_0x5b88b8[_0xef12('0x32')]=_['intersection'](_0x675e22[_0xef12('0x2e')],qs['fields'](_0x3a14d0[_0xef12('0x30')][_0xef12('0x34')]));_0x5b88b8[_0xef12('0x32')]=_0x5b88b8['attributes'][_0xef12('0x35')]?_0x5b88b8[_0xef12('0x32')]:_0x675e22[_0xef12('0x2e')];if(_0x3a14d0['query'][_0xef12('0x41')]){_0x5b88b8[_0xef12('0x42')]=[{'all':!![]}];}_0x5b88b8=_['merge']({},_0x5b88b8,_0x3a14d0[_0xef12('0x3d')]);return db[_0xef12('0x29')][_0xef12('0x43')](_0x5b88b8)['then'](handleEntityNotFound(_0x27ae12,null))[_0xef12('0x22')](respondWithResult(_0x27ae12,null))[_0xef12('0x40')](handleError(_0x27ae12,null));};exports[_0xef12('0x44')]=function(_0x4155e7,_0x364f16){return db[_0xef12('0x29')]['create'](_0x4155e7['body'],{})[_0xef12('0x22')](respondWithResult(_0x364f16,0xc9))[_0xef12('0x40')](handleError(_0x364f16,null));};exports['update']=function(_0x4a696c,_0x15a76c){if(_0x4a696c[_0xef12('0x45')]['id']){delete _0x4a696c[_0xef12('0x45')]['id'];}return db[_0xef12('0x29')][_0xef12('0x43')]({'where':{'id':_0x4a696c['params']['id']}})[_0xef12('0x22')](handleEntityNotFound(_0x15a76c,null))[_0xef12('0x22')](saveUpdates(_0x4a696c[_0xef12('0x45')],null))[_0xef12('0x22')](respondWithResult(_0x15a76c,null))['catch'](handleError(_0x15a76c,null));};exports[_0xef12('0x23')]=function(_0x2adca0,_0x26de89){return db['SugarcrmConfiguration'][_0xef12('0x43')]({'where':{'id':_0x2adca0[_0xef12('0x46')]['id']}})[_0xef12('0x22')](handleEntityNotFound(_0x26de89,null))[_0xef12('0x22')](removeEntity(_0x26de89,null))['catch'](handleError(_0x26de89,null));};exports['getFields']=function(_0x2089fa,_0x16bd1b,_0x47a6f3){var _0x59d7fd={};var _0x5d2fb6={};var _0x4da50d;var _0x402b3b;return db[_0xef12('0x29')]['findOne']({'where':{'id':_0x2089fa[_0xef12('0x46')]['id']}})['then'](handleEntityNotFound(_0x16bd1b,null))[_0xef12('0x22')](function(_0x4f8da4){if(_0x4f8da4){_0x4da50d=_0x4f8da4;_0x5d2fb6[_0xef12('0x2e')]=_[_0xef12('0x2f')](db[_0xef12('0x47')][_0xef12('0x2a')]);_0x5d2fb6[_0xef12('0x30')]=_['keys'](_0x2089fa[_0xef12('0x30')]);_0x5d2fb6[_0xef12('0x31')]=_[_0xef12('0x33')](_0x5d2fb6['model'],_0x5d2fb6[_0xef12('0x30')]);_0x59d7fd[_0xef12('0x32')]=_[_0xef12('0x33')](_0x5d2fb6['model'],qs['fields'](_0x2089fa['query'][_0xef12('0x34')]));_0x59d7fd[_0xef12('0x32')]=_0x59d7fd[_0xef12('0x32')][_0xef12('0x35')]?_0x59d7fd[_0xef12('0x32')]:_0x5d2fb6[_0xef12('0x2e')];_0x59d7fd['order']=qs[_0xef12('0x38')](_0x2089fa['query'][_0xef12('0x38')]);_0x59d7fd[_0xef12('0x39')]=qs['filters'](_[_0xef12('0x3a')](_0x2089fa[_0xef12('0x30')],_0x5d2fb6['filters']));if(_0x2089fa[_0xef12('0x30')][_0xef12('0x48')]){_0x59d7fd[_0xef12('0x39')]=_[_0xef12('0x3c')](_0x59d7fd[_0xef12('0x39')],{'$or':_[_0xef12('0x28')](_0x59d7fd[_0xef12('0x32')],function(_0x4c0aa3){var _0x4f0331={};_0x4f0331[_0x4c0aa3]={'$like':'%'+_0x2089fa[_0xef12('0x30')][_0xef12('0x48')]+'%'};return _0x4f0331;})});}_0x59d7fd=_[_0xef12('0x3c')]({},_0x59d7fd,_0x2089fa['options']);return _0x4da50d[_0xef12('0x49')](_0x59d7fd);}})[_0xef12('0x22')](function(_0x2e6ad4){if(_0x2e6ad4){_0x402b3b=_0x2e6ad4[_0xef12('0x35')];if(!_0x2089fa['query'][_0xef12('0x36')](_0xef12('0x37'))){_0x59d7fd[_0xef12('0x1c')]=qs['limit'](_0x2089fa[_0xef12('0x30')][_0xef12('0x1c')]);_0x59d7fd['offset']=qs[_0xef12('0x1a')](_0x2089fa[_0xef12('0x30')][_0xef12('0x1a')]);}return _0x4da50d[_0xef12('0x49')](_0x59d7fd);}})['then'](function(_0x8e3225){if(_0x8e3225){return _0x8e3225?{'count':_0x402b3b,'rows':_0x8e3225}:null;}})[_0xef12('0x22')](respondWithResult(_0x16bd1b,null))[_0xef12('0x40')](handleError(_0x16bd1b,null));};exports[_0xef12('0x4a')]=function(_0x2f5ec6,_0x4863f6,_0x1c4307){var _0x454eec={};var _0x23812e={};var _0x491670;var _0x76e442;return db[_0xef12('0x29')][_0xef12('0x4b')]({'where':{'id':_0x2f5ec6[_0xef12('0x46')]['id']}})[_0xef12('0x22')](handleEntityNotFound(_0x4863f6,null))['then'](function(_0x53a581){if(_0x53a581){_0x491670=_0x53a581;_0x23812e['model']=_[_0xef12('0x2f')](db[_0xef12('0x47')]['rawAttributes']);_0x23812e[_0xef12('0x30')]=_[_0xef12('0x2f')](_0x2f5ec6[_0xef12('0x30')]);_0x23812e[_0xef12('0x31')]=_[_0xef12('0x33')](_0x23812e[_0xef12('0x2e')],_0x23812e[_0xef12('0x30')]);_0x454eec[_0xef12('0x32')]=_[_0xef12('0x33')](_0x23812e[_0xef12('0x2e')],qs[_0xef12('0x34')](_0x2f5ec6['query'][_0xef12('0x34')]));_0x454eec[_0xef12('0x32')]=_0x454eec[_0xef12('0x32')][_0xef12('0x35')]?_0x454eec[_0xef12('0x32')]:_0x23812e['model'];_0x454eec['order']=qs[_0xef12('0x38')](_0x2f5ec6[_0xef12('0x30')][_0xef12('0x38')]);_0x454eec[_0xef12('0x39')]=qs[_0xef12('0x31')](_[_0xef12('0x3a')](_0x2f5ec6[_0xef12('0x30')],_0x23812e['filters']));if(_0x2f5ec6[_0xef12('0x30')]['filter']){_0x454eec['where']=_['merge'](_0x454eec['where'],{'$or':_[_0xef12('0x28')](_0x454eec[_0xef12('0x32')],function(_0x5e8b75){var _0x20c6a7={};_0x20c6a7[_0x5e8b75]={'$like':'%'+_0x2f5ec6[_0xef12('0x30')][_0xef12('0x48')]+'%'};return _0x20c6a7;})});}_0x454eec=_[_0xef12('0x3c')]({},_0x454eec,_0x2f5ec6[_0xef12('0x3d')]);return _0x491670[_0xef12('0x4a')](_0x454eec);}})[_0xef12('0x22')](function(_0xec1507){if(_0xec1507){_0x76e442=_0xec1507[_0xef12('0x35')];if(!_0x2f5ec6[_0xef12('0x30')][_0xef12('0x36')](_0xef12('0x37'))){_0x454eec[_0xef12('0x1c')]=qs[_0xef12('0x1c')](_0x2f5ec6[_0xef12('0x30')][_0xef12('0x1c')]);_0x454eec['offset']=qs['offset'](_0x2f5ec6[_0xef12('0x30')][_0xef12('0x1a')]);}return _0x491670[_0xef12('0x4a')](_0x454eec);}})[_0xef12('0x22')](function(_0x3ed326){if(_0x3ed326){return _0x3ed326?{'count':_0x76e442,'rows':_0x3ed326}:null;}})[_0xef12('0x22')](respondWithResult(_0x4863f6,null))[_0xef12('0x40')](handleError(_0x4863f6,null));};exports[_0xef12('0x4c')]=function(_0x1cb113,_0x4f6a66,_0x2e7776){var _0x4d6708={};var _0xdb9a44={};var _0x2406c5;var _0x1088f3;return db[_0xef12('0x29')]['findOne']({'where':{'id':_0x1cb113[_0xef12('0x46')]['id']}})['then'](handleEntityNotFound(_0x4f6a66,null))[_0xef12('0x22')](function(_0x5df705){if(_0x5df705){_0x2406c5=_0x5df705;_0xdb9a44[_0xef12('0x2e')]=_[_0xef12('0x2f')](db[_0xef12('0x47')][_0xef12('0x2a')]);_0xdb9a44[_0xef12('0x30')]=_['keys'](_0x1cb113[_0xef12('0x30')]);_0xdb9a44[_0xef12('0x31')]=_[_0xef12('0x33')](_0xdb9a44[_0xef12('0x2e')],_0xdb9a44['query']);_0x4d6708['attributes']=_[_0xef12('0x33')](_0xdb9a44[_0xef12('0x2e')],qs[_0xef12('0x34')](_0x1cb113[_0xef12('0x30')][_0xef12('0x34')]));_0x4d6708[_0xef12('0x32')]=_0x4d6708[_0xef12('0x32')]['length']?_0x4d6708[_0xef12('0x32')]:_0xdb9a44[_0xef12('0x2e')];_0x4d6708[_0xef12('0x4d')]=qs[_0xef12('0x38')](_0x1cb113[_0xef12('0x30')][_0xef12('0x38')]);_0x4d6708[_0xef12('0x39')]=qs[_0xef12('0x31')](_['pick'](_0x1cb113['query'],_0xdb9a44[_0xef12('0x31')]));if(_0x1cb113[_0xef12('0x30')][_0xef12('0x48')]){_0x4d6708[_0xef12('0x39')]=_[_0xef12('0x3c')](_0x4d6708[_0xef12('0x39')],{'$or':_[_0xef12('0x28')](_0x4d6708[_0xef12('0x32')],function(_0x328b83){var _0x5e6a5a={};_0x5e6a5a[_0x328b83]={'$like':'%'+_0x1cb113['query'][_0xef12('0x48')]+'%'};return _0x5e6a5a;})});}_0x4d6708=_['merge']({},_0x4d6708,_0x1cb113[_0xef12('0x3d')]);return _0x2406c5['getDescriptions'](_0x4d6708);}})[_0xef12('0x22')](function(_0x1510e7){if(_0x1510e7){_0x1088f3=_0x1510e7[_0xef12('0x35')];if(!_0x1cb113[_0xef12('0x30')]['hasOwnProperty'](_0xef12('0x37'))){_0x4d6708[_0xef12('0x1c')]=qs[_0xef12('0x1c')](_0x1cb113[_0xef12('0x30')][_0xef12('0x1c')]);_0x4d6708[_0xef12('0x1a')]=qs[_0xef12('0x1a')](_0x1cb113[_0xef12('0x30')][_0xef12('0x1a')]);}return _0x2406c5[_0xef12('0x4c')](_0x4d6708);}})[_0xef12('0x22')](function(_0x9c6843){if(_0x9c6843){return _0x9c6843?{'count':_0x1088f3,'rows':_0x9c6843}:null;}})[_0xef12('0x22')](respondWithResult(_0x4f6a66,null))[_0xef12('0x40')](handleError(_0x4f6a66,null));}; \ No newline at end of file +var _0x64c6=['stack','name','send','map','SugarcrmConfiguration','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','create','body','find','getFields','findOne','SugarcrmField','sort','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','apply','save','update','then','destroy','sendStatus','error'];(function(_0x287cc5,_0x2f5c71){var _0xe7212a=function(_0x96666){while(--_0x96666){_0x287cc5['push'](_0x287cc5['shift']());}};_0xe7212a(++_0x2f5c71);}(_0x64c6,0x1a9));var _0x664c=function(_0x22c684,_0x753309){_0x22c684=_0x22c684-0x0;var _0x39fcbb=_0x64c6[_0x22c684];return _0x39fcbb;};'use strict';var emlformat=require(_0x664c('0x0'));var rimraf=require(_0x664c('0x1'));var zipdir=require(_0x664c('0x2'));var jsonpatch=require(_0x664c('0x3'));var rp=require(_0x664c('0x4'));var moment=require('moment');var BPromise=require(_0x664c('0x5'));var Mustache=require(_0x664c('0x6'));var util=require(_0x664c('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x664c('0x8'));var fs=require('fs');var fs_extra=require(_0x664c('0x9'));var _=require(_0x664c('0xa'));var squel=require('squel');var crypto=require(_0x664c('0xb'));var jsforce=require(_0x664c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x664c('0xd'));var querystring=require(_0x664c('0xe'));var Papa=require('papaparse');var Redis=require(_0x664c('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x664c('0x10'));var hardwareService=require(_0x664c('0x11'));var logger=require(_0x664c('0x12'))(_0x664c('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x664c('0x14'));var db=require(_0x664c('0x15'))['db'];function respondWithStatusCode(_0x490b1c,_0x165e25){_0x165e25=_0x165e25||0xcc;return function(_0xc86f85){if(_0xc86f85){return _0x490b1c['sendStatus'](_0x165e25);}return _0x490b1c[_0x664c('0x16')](_0x165e25)[_0x664c('0x17')]();};}function respondWithResult(_0x5e5a82,_0x5e4922){_0x5e4922=_0x5e4922||0xc8;return function(_0x2e867d){if(_0x2e867d){return _0x5e5a82['status'](_0x5e4922)[_0x664c('0x18')](_0x2e867d);}};}function respondWithFilteredResult(_0x489f16,_0x17f5af){return function(_0x379944){if(_0x379944){var _0x346627=typeof _0x17f5af[_0x664c('0x19')]==='undefined'&&typeof _0x17f5af[_0x664c('0x1a')]===_0x664c('0x1b');var _0x5bd2e1=_0x379944[_0x664c('0x1c')];var _0x5cf31b=_0x346627?0x0:_0x17f5af[_0x664c('0x19')];var _0x5afb9c=_0x346627?_0x379944[_0x664c('0x1c')]:_0x17f5af[_0x664c('0x19')]+_0x17f5af['limit'];var _0x27cd24;if(_0x5afb9c>=_0x5bd2e1){_0x5afb9c=_0x5bd2e1;_0x27cd24=0xc8;}else{_0x27cd24=0xce;}_0x489f16[_0x664c('0x16')](_0x27cd24);return _0x489f16['set'](_0x664c('0x1d'),_0x5cf31b+'-'+_0x5afb9c+'/'+_0x5bd2e1)[_0x664c('0x18')](_0x379944);}return null;};}function patchUpdates(_0x3326d2){return function(_0x3517f5){try{jsonpatch[_0x664c('0x1e')](_0x3517f5,_0x3326d2,!![]);}catch(_0x506958){return BPromise['reject'](_0x506958);}return _0x3517f5[_0x664c('0x1f')]();};}function saveUpdates(_0x192be6,_0x566473){return function(_0x449ade){if(_0x449ade){return _0x449ade[_0x664c('0x20')](_0x192be6)[_0x664c('0x21')](function(_0x125968){return _0x125968;});}return null;};}function removeEntity(_0x1ade01,_0x49a651){return function(_0x59f24d){if(_0x59f24d){return _0x59f24d[_0x664c('0x22')]()[_0x664c('0x21')](function(){_0x1ade01[_0x664c('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b75d5,_0xe0cad4){return function(_0x335956){if(!_0x335956){_0x2b75d5[_0x664c('0x23')](0x194);}return _0x335956;};}function handleError(_0x59715c,_0x21f3e4){_0x21f3e4=_0x21f3e4||0x1f4;return function(_0x2ed992){logger[_0x664c('0x24')](_0x2ed992[_0x664c('0x25')]);if(_0x2ed992[_0x664c('0x26')]){delete _0x2ed992[_0x664c('0x26')];}_0x59715c[_0x664c('0x16')](_0x21f3e4)[_0x664c('0x27')](_0x2ed992);};}exports['index']=function(_0x11890a,_0x1dbf0a){var _0x51df9c={},_0x12f948={},_0x4cd747={'count':0x0,'rows':[]};var _0x5c5002=_[_0x664c('0x28')](db[_0x664c('0x29')][_0x664c('0x2a')],function(_0x2f68d1){return{'name':_0x2f68d1['fieldName'],'type':_0x2f68d1[_0x664c('0x2b')]['key']};});_0x12f948[_0x664c('0x2c')]=_[_0x664c('0x28')](_0x5c5002,'name');_0x12f948[_0x664c('0x2d')]=_[_0x664c('0x2e')](_0x11890a['query']);_0x12f948['filters']=_[_0x664c('0x2f')](_0x12f948['model'],_0x12f948[_0x664c('0x2d')]);_0x51df9c[_0x664c('0x30')]=_[_0x664c('0x2f')](_0x12f948[_0x664c('0x2c')],qs['fields'](_0x11890a['query'][_0x664c('0x31')]));_0x51df9c[_0x664c('0x30')]=_0x51df9c[_0x664c('0x30')][_0x664c('0x32')]?_0x51df9c[_0x664c('0x30')]:_0x12f948[_0x664c('0x2c')];if(!_0x11890a[_0x664c('0x2d')][_0x664c('0x33')](_0x664c('0x34'))){_0x51df9c[_0x664c('0x1a')]=qs[_0x664c('0x1a')](_0x11890a[_0x664c('0x2d')][_0x664c('0x1a')]);_0x51df9c['offset']=qs[_0x664c('0x19')](_0x11890a[_0x664c('0x2d')][_0x664c('0x19')]);}_0x51df9c[_0x664c('0x35')]=qs['sort'](_0x11890a[_0x664c('0x2d')]['sort']);_0x51df9c[_0x664c('0x36')]=qs['filters'](_[_0x664c('0x37')](_0x11890a[_0x664c('0x2d')],_0x12f948[_0x664c('0x38')]),_0x5c5002);if(_0x11890a[_0x664c('0x2d')][_0x664c('0x39')]){_0x51df9c[_0x664c('0x36')]=_[_0x664c('0x3a')](_0x51df9c[_0x664c('0x36')],{'$or':_[_0x664c('0x28')](_0x5c5002,function(_0x3374ec){if(_0x3374ec[_0x664c('0x2b')]!==_0x664c('0x3b')){var _0x2116e8={};_0x2116e8[_0x3374ec[_0x664c('0x26')]]={'$like':'%'+_0x11890a[_0x664c('0x2d')][_0x664c('0x39')]+'%'};return _0x2116e8;}})});}_0x51df9c=_['merge']({},_0x51df9c,_0x11890a[_0x664c('0x3c')]);var _0x108068={'where':_0x51df9c[_0x664c('0x36')]};return db[_0x664c('0x29')][_0x664c('0x1c')](_0x108068)[_0x664c('0x21')](function(_0x549909){_0x4cd747['count']=_0x549909;if(_0x11890a[_0x664c('0x2d')][_0x664c('0x3d')]){_0x51df9c['include']=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x664c('0x3e')](_0x51df9c);})[_0x664c('0x21')](function(_0x243595){_0x4cd747[_0x664c('0x3f')]=_0x243595;return _0x4cd747;})['then'](respondWithFilteredResult(_0x1dbf0a,_0x51df9c))[_0x664c('0x40')](handleError(_0x1dbf0a,null));};exports[_0x664c('0x41')]=function(_0x4d1baa,_0x1035af){var _0x24e54b={'raw':![],'where':{'id':_0x4d1baa[_0x664c('0x42')]['id']}},_0x2f0324={};_0x2f0324[_0x664c('0x2c')]=_[_0x664c('0x2e')](db[_0x664c('0x29')][_0x664c('0x2a')]);_0x2f0324['query']=_['keys'](_0x4d1baa[_0x664c('0x2d')]);_0x2f0324['filters']=_[_0x664c('0x2f')](_0x2f0324['model'],_0x2f0324['query']);_0x24e54b[_0x664c('0x30')]=_[_0x664c('0x2f')](_0x2f0324[_0x664c('0x2c')],qs[_0x664c('0x31')](_0x4d1baa[_0x664c('0x2d')][_0x664c('0x31')]));_0x24e54b['attributes']=_0x24e54b[_0x664c('0x30')][_0x664c('0x32')]?_0x24e54b[_0x664c('0x30')]:_0x2f0324[_0x664c('0x2c')];if(_0x4d1baa[_0x664c('0x2d')][_0x664c('0x3d')]){_0x24e54b[_0x664c('0x43')]=[{'all':!![]}];}_0x24e54b=_[_0x664c('0x3a')]({},_0x24e54b,_0x4d1baa[_0x664c('0x3c')]);return db[_0x664c('0x29')]['find'](_0x24e54b)[_0x664c('0x21')](handleEntityNotFound(_0x1035af,null))['then'](respondWithResult(_0x1035af,null))['catch'](handleError(_0x1035af,null));};exports[_0x664c('0x44')]=function(_0x254d81,_0x17161d){return db['SugarcrmConfiguration'][_0x664c('0x44')](_0x254d81[_0x664c('0x45')],{})['then'](respondWithResult(_0x17161d,0xc9))[_0x664c('0x40')](handleError(_0x17161d,null));};exports[_0x664c('0x20')]=function(_0x577cf7,_0x5022e7){if(_0x577cf7[_0x664c('0x45')]['id']){delete _0x577cf7['body']['id'];}return db[_0x664c('0x29')][_0x664c('0x46')]({'where':{'id':_0x577cf7[_0x664c('0x42')]['id']}})[_0x664c('0x21')](handleEntityNotFound(_0x5022e7,null))[_0x664c('0x21')](saveUpdates(_0x577cf7[_0x664c('0x45')],null))['then'](respondWithResult(_0x5022e7,null))['catch'](handleError(_0x5022e7,null));};exports[_0x664c('0x22')]=function(_0x2e88af,_0x41eea2){return db['SugarcrmConfiguration'][_0x664c('0x46')]({'where':{'id':_0x2e88af['params']['id']}})['then'](handleEntityNotFound(_0x41eea2,null))[_0x664c('0x21')](removeEntity(_0x41eea2,null))[_0x664c('0x40')](handleError(_0x41eea2,null));};exports[_0x664c('0x47')]=function(_0x5dbf64,_0x4a59ea,_0x14b7c9){var _0x37c011={};var _0x81419e={};var _0x133c47;var _0x3ab456;return db[_0x664c('0x29')][_0x664c('0x48')]({'where':{'id':_0x5dbf64[_0x664c('0x42')]['id']}})[_0x664c('0x21')](handleEntityNotFound(_0x4a59ea,null))['then'](function(_0x42e001){if(_0x42e001){_0x133c47=_0x42e001;_0x81419e['model']=_[_0x664c('0x2e')](db[_0x664c('0x49')][_0x664c('0x2a')]);_0x81419e[_0x664c('0x2d')]=_['keys'](_0x5dbf64[_0x664c('0x2d')]);_0x81419e[_0x664c('0x38')]=_['intersection'](_0x81419e['model'],_0x81419e[_0x664c('0x2d')]);_0x37c011[_0x664c('0x30')]=_[_0x664c('0x2f')](_0x81419e[_0x664c('0x2c')],qs[_0x664c('0x31')](_0x5dbf64['query']['fields']));_0x37c011[_0x664c('0x30')]=_0x37c011['attributes'][_0x664c('0x32')]?_0x37c011[_0x664c('0x30')]:_0x81419e[_0x664c('0x2c')];_0x37c011['order']=qs[_0x664c('0x4a')](_0x5dbf64[_0x664c('0x2d')][_0x664c('0x4a')]);_0x37c011['where']=qs[_0x664c('0x38')](_['pick'](_0x5dbf64[_0x664c('0x2d')],_0x81419e[_0x664c('0x38')]));if(_0x5dbf64[_0x664c('0x2d')][_0x664c('0x39')]){_0x37c011[_0x664c('0x36')]=_[_0x664c('0x3a')](_0x37c011[_0x664c('0x36')],{'$or':_[_0x664c('0x28')](_0x37c011[_0x664c('0x30')],function(_0x7d8877){var _0x40d5de={};_0x40d5de[_0x7d8877]={'$like':'%'+_0x5dbf64[_0x664c('0x2d')]['filter']+'%'};return _0x40d5de;})});}_0x37c011=_['merge']({},_0x37c011,_0x5dbf64[_0x664c('0x3c')]);return _0x133c47[_0x664c('0x47')](_0x37c011);}})[_0x664c('0x21')](function(_0x522e66){if(_0x522e66){_0x3ab456=_0x522e66['length'];if(!_0x5dbf64[_0x664c('0x2d')][_0x664c('0x33')](_0x664c('0x34'))){_0x37c011[_0x664c('0x1a')]=qs[_0x664c('0x1a')](_0x5dbf64['query']['limit']);_0x37c011['offset']=qs['offset'](_0x5dbf64['query'][_0x664c('0x19')]);}return _0x133c47[_0x664c('0x47')](_0x37c011);}})['then'](function(_0x2f8c99){if(_0x2f8c99){return _0x2f8c99?{'count':_0x3ab456,'rows':_0x2f8c99}:null;}})['then'](respondWithResult(_0x4a59ea,null))[_0x664c('0x40')](handleError(_0x4a59ea,null));};exports['getSubjects']=function(_0x3889fe,_0x196070,_0xf94481){var _0x2a0cde={};var _0x1165fb={};var _0x3056c8;var _0x276da8;return db['SugarcrmConfiguration'][_0x664c('0x48')]({'where':{'id':_0x3889fe[_0x664c('0x42')]['id']}})[_0x664c('0x21')](handleEntityNotFound(_0x196070,null))[_0x664c('0x21')](function(_0x133f4c){if(_0x133f4c){_0x3056c8=_0x133f4c;_0x1165fb['model']=_[_0x664c('0x2e')](db['SugarcrmField'][_0x664c('0x2a')]);_0x1165fb[_0x664c('0x2d')]=_[_0x664c('0x2e')](_0x3889fe[_0x664c('0x2d')]);_0x1165fb['filters']=_[_0x664c('0x2f')](_0x1165fb[_0x664c('0x2c')],_0x1165fb[_0x664c('0x2d')]);_0x2a0cde[_0x664c('0x30')]=_['intersection'](_0x1165fb[_0x664c('0x2c')],qs['fields'](_0x3889fe[_0x664c('0x2d')][_0x664c('0x31')]));_0x2a0cde[_0x664c('0x30')]=_0x2a0cde[_0x664c('0x30')][_0x664c('0x32')]?_0x2a0cde[_0x664c('0x30')]:_0x1165fb[_0x664c('0x2c')];_0x2a0cde[_0x664c('0x35')]=qs[_0x664c('0x4a')](_0x3889fe[_0x664c('0x2d')][_0x664c('0x4a')]);_0x2a0cde[_0x664c('0x36')]=qs['filters'](_[_0x664c('0x37')](_0x3889fe[_0x664c('0x2d')],_0x1165fb[_0x664c('0x38')]));if(_0x3889fe[_0x664c('0x2d')][_0x664c('0x39')]){_0x2a0cde[_0x664c('0x36')]=_[_0x664c('0x3a')](_0x2a0cde[_0x664c('0x36')],{'$or':_[_0x664c('0x28')](_0x2a0cde[_0x664c('0x30')],function(_0x4e2c79){var _0x534f90={};_0x534f90[_0x4e2c79]={'$like':'%'+_0x3889fe[_0x664c('0x2d')][_0x664c('0x39')]+'%'};return _0x534f90;})});}_0x2a0cde=_[_0x664c('0x3a')]({},_0x2a0cde,_0x3889fe[_0x664c('0x3c')]);return _0x3056c8[_0x664c('0x4b')](_0x2a0cde);}})[_0x664c('0x21')](function(_0x3b8cdc){if(_0x3b8cdc){_0x276da8=_0x3b8cdc[_0x664c('0x32')];if(!_0x3889fe[_0x664c('0x2d')][_0x664c('0x33')](_0x664c('0x34'))){_0x2a0cde[_0x664c('0x1a')]=qs['limit'](_0x3889fe[_0x664c('0x2d')]['limit']);_0x2a0cde[_0x664c('0x19')]=qs[_0x664c('0x19')](_0x3889fe[_0x664c('0x2d')][_0x664c('0x19')]);}return _0x3056c8[_0x664c('0x4b')](_0x2a0cde);}})[_0x664c('0x21')](function(_0x271a09){if(_0x271a09){return _0x271a09?{'count':_0x276da8,'rows':_0x271a09}:null;}})[_0x664c('0x21')](respondWithResult(_0x196070,null))[_0x664c('0x40')](handleError(_0x196070,null));};exports[_0x664c('0x4c')]=function(_0x2bffc6,_0x18f584,_0x1a50d1){var _0x24ee74={};var _0x5be77b={};var _0x59e598;var _0xbf32d;return db[_0x664c('0x29')][_0x664c('0x48')]({'where':{'id':_0x2bffc6[_0x664c('0x42')]['id']}})[_0x664c('0x21')](handleEntityNotFound(_0x18f584,null))[_0x664c('0x21')](function(_0x44ec0b){if(_0x44ec0b){_0x59e598=_0x44ec0b;_0x5be77b[_0x664c('0x2c')]=_['keys'](db[_0x664c('0x49')][_0x664c('0x2a')]);_0x5be77b['query']=_[_0x664c('0x2e')](_0x2bffc6[_0x664c('0x2d')]);_0x5be77b[_0x664c('0x38')]=_['intersection'](_0x5be77b['model'],_0x5be77b[_0x664c('0x2d')]);_0x24ee74['attributes']=_['intersection'](_0x5be77b[_0x664c('0x2c')],qs[_0x664c('0x31')](_0x2bffc6['query'][_0x664c('0x31')]));_0x24ee74['attributes']=_0x24ee74[_0x664c('0x30')][_0x664c('0x32')]?_0x24ee74[_0x664c('0x30')]:_0x5be77b[_0x664c('0x2c')];_0x24ee74['order']=qs[_0x664c('0x4a')](_0x2bffc6[_0x664c('0x2d')][_0x664c('0x4a')]);_0x24ee74[_0x664c('0x36')]=qs[_0x664c('0x38')](_[_0x664c('0x37')](_0x2bffc6['query'],_0x5be77b[_0x664c('0x38')]));if(_0x2bffc6[_0x664c('0x2d')][_0x664c('0x39')]){_0x24ee74['where']=_['merge'](_0x24ee74[_0x664c('0x36')],{'$or':_[_0x664c('0x28')](_0x24ee74[_0x664c('0x30')],function(_0x10cda1){var _0x497bd4={};_0x497bd4[_0x10cda1]={'$like':'%'+_0x2bffc6['query'][_0x664c('0x39')]+'%'};return _0x497bd4;})});}_0x24ee74=_[_0x664c('0x3a')]({},_0x24ee74,_0x2bffc6['options']);return _0x59e598[_0x664c('0x4c')](_0x24ee74);}})[_0x664c('0x21')](function(_0x3e276c){if(_0x3e276c){_0xbf32d=_0x3e276c['length'];if(!_0x2bffc6[_0x664c('0x2d')][_0x664c('0x33')](_0x664c('0x34'))){_0x24ee74[_0x664c('0x1a')]=qs[_0x664c('0x1a')](_0x2bffc6[_0x664c('0x2d')][_0x664c('0x1a')]);_0x24ee74[_0x664c('0x19')]=qs[_0x664c('0x19')](_0x2bffc6[_0x664c('0x2d')]['offset']);}return _0x59e598['getDescriptions'](_0x24ee74);}})['then'](function(_0xbf999f){if(_0xbf999f){return _0xbf999f?{'count':_0xbf32d,'rows':_0xbf999f}:null;}})[_0x664c('0x21')](respondWithResult(_0x18f584,null))['catch'](handleError(_0x18f584,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 26824c9..539978a 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 _0x43e4=['rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','api','moment','bluebird','request-promise'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0x43e4,0x1be));var _0x443e=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x43e4[_0xbd08b4];return _0x314f1e;};'use strict';var _=require(_0x443e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x443e('0x1'));var moment=require(_0x443e('0x2'));var BPromise=require(_0x443e('0x3'));var rp=require(_0x443e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x443e('0x5'));var config=require(_0x443e('0x6'));var attributes=require(_0x443e('0x7'));module[_0x443e('0x8')]=function(_0x5386f1,_0x17c4f6){return _0x5386f1['define'](_0x443e('0x9'),attributes,{'tableName':_0x443e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd3da=['./intSugarcrmConfiguration.attributes','exports','int_sugarcrm_configurations','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x54ef9d,_0x53647d){var _0x7e2dc5=function(_0x4ee61e){while(--_0x4ee61e){_0x54ef9d['push'](_0x54ef9d['shift']());}};_0x7e2dc5(++_0x53647d);}(_0xd3da,0x7c));var _0xad3d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd3da[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xad3d('0x0'));var util=require(_0xad3d('0x1'));var logger=require(_0xad3d('0x2'))(_0xad3d('0x3'));var moment=require(_0xad3d('0x4'));var BPromise=require('bluebird');var rp=require(_0xad3d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xad3d('0x6'));var config=require(_0xad3d('0x7'));var attributes=require(_0xad3d('0x8'));module[_0xad3d('0x9')]=function(_0x466469,_0x1a1a3b){return _0x466469['define']('SugarcrmConfiguration',attributes,{'tableName':_0xad3d('0xa'),'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 741daea..58b8bc7 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 _0x2c99=['error','message','result','catch','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5ee860,_0x16961f){var _0x115945=function(_0x397b02){while(--_0x397b02){_0x5ee860['push'](_0x5ee860['shift']());}};_0x115945(++_0x16961f);}(_0x2c99,0x194));var _0x92c9=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x2c99[_0x2064e5];return _0x21a233;};'use strict';var _=require(_0x92c9('0x0'));var util=require(_0x92c9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x92c9('0x2'));var db=require(_0x92c9('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x92c9('0x4'))(_0x92c9('0x5'));var config=require(_0x92c9('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x92c9('0x7')][_0x92c9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2b147b,_0x1ecc28,_0xead99a){return new BPromise(function(_0x3bfb92,_0x4ccad3){return client['request'](_0x2b147b,_0xead99a)[_0x92c9('0x9')](function(_0x422747){logger[_0x92c9('0xa')](_0x92c9('0xb'),_0x1ecc28,_0x92c9('0xc'));logger[_0x92c9('0xd')](_0x92c9('0xe'),_0x1ecc28,_0x92c9('0xc'),JSON[_0x92c9('0xf')](_0x422747));if(_0x422747[_0x92c9('0x10')]){if(_0x422747[_0x92c9('0x10')]['code']===0x1f4){logger[_0x92c9('0x10')](_0x92c9('0xb'),_0x1ecc28,_0x422747[_0x92c9('0x10')][_0x92c9('0x11')]);return _0x4ccad3(_0x422747[_0x92c9('0x10')]['message']);}logger[_0x92c9('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x1ecc28,_0x422747['error'][_0x92c9('0x11')]);return _0x3bfb92(_0x422747[_0x92c9('0x10')][_0x92c9('0x11')]);}else{logger['info'](_0x92c9('0xb'),_0x1ecc28,'request\x20sent');_0x3bfb92(_0x422747[_0x92c9('0x12')][_0x92c9('0x11')]);}})[_0x92c9('0x13')](function(_0xd3b479){logger['error'](_0x92c9('0xb'),_0x1ecc28,_0xd3b479);_0x4ccad3(_0xd3b479);});});} \ No newline at end of file +var _0xf084=['rpc','../../config/environment','jayson/promise','client','http','request','then','SugarcrmConfiguration,\x20%s,\x20%s','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf084,0x119));var _0x4f08=function(_0x12c925,_0x1af1e2){_0x12c925=_0x12c925-0x0;var _0x38d50e=_0xf084[_0x12c925];return _0x38d50e;};'use strict';var _=require(_0x4f08('0x0'));var util=require(_0x4f08('0x1'));var moment=require(_0x4f08('0x2'));var BPromise=require(_0x4f08('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4f08('0x4'));var db=require(_0x4f08('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4f08('0x6'))(_0x4f08('0x7'));var config=require(_0x4f08('0x8'));var jayson=require(_0x4f08('0x9'));var client=jayson[_0x4f08('0xa')][_0x4f08('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x42d2dd,_0xa7c8b2,_0x51f865){return new BPromise(function(_0x1869a4,_0x1f5c3f){return client[_0x4f08('0xc')](_0x42d2dd,_0x51f865)[_0x4f08('0xd')](function(_0x3cac13){logger['info'](_0x4f08('0xe'),_0xa7c8b2,'request\x20sent');logger['debug'](_0x4f08('0xf'),_0xa7c8b2,_0x4f08('0x10'),JSON[_0x4f08('0x11')](_0x3cac13));if(_0x3cac13[_0x4f08('0x12')]){if(_0x3cac13[_0x4f08('0x12')][_0x4f08('0x13')]===0x1f4){logger[_0x4f08('0x12')](_0x4f08('0xe'),_0xa7c8b2,_0x3cac13['error'][_0x4f08('0x14')]);return _0x1f5c3f(_0x3cac13['error'][_0x4f08('0x14')]);}logger[_0x4f08('0x12')](_0x4f08('0xe'),_0xa7c8b2,_0x3cac13[_0x4f08('0x12')]['message']);return _0x1869a4(_0x3cac13[_0x4f08('0x12')]['message']);}else{logger[_0x4f08('0x15')](_0x4f08('0xe'),_0xa7c8b2,_0x4f08('0x10'));_0x1869a4(_0x3cac13[_0x4f08('0x16')][_0x4f08('0x14')]);}})[_0x4f08('0x17')](function(_0x552bac){logger[_0x4f08('0x12')](_0x4f08('0xe'),_0xa7c8b2,_0x552bac);_0x1f5c3f(_0x552bac);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 06bb0c5..9d0e07d 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 _0x939a=['express','Router','fs-extra','../../config/environment','./intSugarcrmField.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','exports','path','connect-timeout'];(function(_0x5ad5a3,_0x381e49){var _0x5e1f3b=function(_0x1a0154){while(--_0x1a0154){_0x5ad5a3['push'](_0x5ad5a3['shift']());}};_0x5e1f3b(++_0x381e49);}(_0x939a,0x185));var _0xa939=function(_0x5181c6,_0x5d8b26){_0x5181c6=_0x5181c6-0x0;var _0xa31280=_0x939a[_0x5181c6];return _0xa31280;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa939('0x0'));var timeout=require(_0xa939('0x1'));var express=require(_0xa939('0x2'));var router=express[_0xa939('0x3')]();var fs_extra=require(_0xa939('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa939('0x5'));var controller=require(_0xa939('0x6'));router['get']('/',auth[_0xa939('0x7')](),controller[_0xa939('0x8')]);router[_0xa939('0x9')](_0xa939('0xa'),auth['isAuthenticated'](),controller[_0xa939('0xb')]);router[_0xa939('0xc')]('/',auth[_0xa939('0x7')](),controller[_0xa939('0xd')]);router[_0xa939('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xa939('0xf')]);router['delete'](_0xa939('0xa'),auth[_0xa939('0x7')](),controller['destroy']);module[_0xa939('0x10')]=router; \ No newline at end of file +var _0x3c1b=['index','/:id','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated'];(function(_0x343e44,_0x519af9){var _0xa5130e=function(_0xae1fa0){while(--_0xae1fa0){_0x343e44['push'](_0x343e44['shift']());}};_0xa5130e(++_0x519af9);}(_0x3c1b,0x137));var _0xb3c1=function(_0x215c5a,_0x1d971){_0x215c5a=_0x215c5a-0x0;var _0x28368b=_0x3c1b[_0x215c5a];return _0x28368b;};'use strict';var multer=require(_0xb3c1('0x0'));var util=require(_0xb3c1('0x1'));var path=require(_0xb3c1('0x2'));var timeout=require(_0xb3c1('0x3'));var express=require(_0xb3c1('0x4'));var router=express[_0xb3c1('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb3c1('0x6'));var interaction=require(_0xb3c1('0x7'));var config=require(_0xb3c1('0x8'));var controller=require(_0xb3c1('0x9'));router[_0xb3c1('0xa')]('/',auth[_0xb3c1('0xb')](),controller[_0xb3c1('0xc')]);router[_0xb3c1('0xa')](_0xb3c1('0xd'),auth[_0xb3c1('0xb')](),controller['show']);router['post']('/',auth[_0xb3c1('0xb')](),controller[_0xb3c1('0xe')]);router['put']('/:id',auth[_0xb3c1('0xb')](),controller[_0xb3c1('0xf')]);router[_0xb3c1('0x10')](_0xb3c1('0xd'),auth[_0xb3c1('0xb')](),controller[_0xb3c1('0x11')]);module[_0xb3c1('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index cd59988..addab11 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 _0x5a91=['ENUM','string','customVariable','keyValue','picklist','STRING','exports'];(function(_0x27a900,_0x1cc305){var _0xea9b1f=function(_0xaddd55){while(--_0xaddd55){_0x27a900['push'](_0x27a900['shift']());}};_0xea9b1f(++_0x1cc305);}(_0x5a91,0x99));var _0x15a9=function(_0x41521f,_0x3809ba){_0x41521f=_0x41521f-0x0;var _0x4c91a3=_0x5a91[_0x41521f];return _0x4c91a3;};'use strict';var Sequelize=require('sequelize');module[_0x15a9('0x0')]={'type':{'type':Sequelize[_0x15a9('0x1')](_0x15a9('0x2'),'variable',_0x15a9('0x3'),_0x15a9('0x4'),_0x15a9('0x5')),'defaultValue':_0x15a9('0x2')},'content':{'type':Sequelize[_0x15a9('0x6')]},'key':{'type':Sequelize[_0x15a9('0x6')]},'keyType':{'type':Sequelize[_0x15a9('0x1')](_0x15a9('0x2'),'variable',_0x15a9('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x15a9('0x6')]},'nameField':{'type':Sequelize[_0x15a9('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x15a9('0x6')]}}; \ No newline at end of file +var _0x8c23=['ENUM','string','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize'];(function(_0x1c87c6,_0x211d15){var _0xc67c07=function(_0x38dc69){while(--_0x38dc69){_0x1c87c6['push'](_0x1c87c6['shift']());}};_0xc67c07(++_0x211d15);}(_0x8c23,0x11f));var _0x38c2=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x8c23[_0x160c73];return _0xd9302;};'use strict';var Sequelize=require(_0x38c2('0x0'));module['exports']={'type':{'type':Sequelize[_0x38c2('0x1')](_0x38c2('0x2'),'variable',_0x38c2('0x3'),_0x38c2('0x4'),_0x38c2('0x5')),'defaultValue':_0x38c2('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x38c2('0x6')]},'keyType':{'type':Sequelize[_0x38c2('0x1')](_0x38c2('0x2'),'variable',_0x38c2('0x3'))},'keyContent':{'type':Sequelize[_0x38c2('0x6')]},'idField':{'type':Sequelize[_0x38c2('0x6')]},'nameField':{'type':Sequelize[_0x38c2('0x6')]},'customField':{'type':Sequelize[_0x38c2('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x38c2('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 08b01a1..d665c51 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 _0x0ce5=['mustache','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','undefined','offset','count','limit','Content-Range','json','apply','save','update','then','destroy','sendStatus','error','name','send','index','map','SugarcrmField','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','catch','params','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x116567,_0x1ddd43){var _0x233c6a=function(_0x51e3ce){while(--_0x51e3ce){_0x116567['push'](_0x116567['shift']());}};_0x233c6a(++_0x1ddd43);}(_0x0ce5,0x89));var _0x50ce=function(_0x39bf21,_0x5c2e3f){_0x39bf21=_0x39bf21-0x0;var _0x19c6e9=_0x0ce5[_0x39bf21];return _0x19c6e9;};'use strict';var emlformat=require(_0x50ce('0x0'));var rimraf=require(_0x50ce('0x1'));var zipdir=require(_0x50ce('0x2'));var jsonpatch=require(_0x50ce('0x3'));var rp=require(_0x50ce('0x4'));var moment=require(_0x50ce('0x5'));var BPromise=require(_0x50ce('0x6'));var Mustache=require(_0x50ce('0x7'));var util=require('util');var path=require(_0x50ce('0x8'));var sox=require(_0x50ce('0x9'));var csv=require(_0x50ce('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x50ce('0xb'));var _=require('lodash');var squel=require(_0x50ce('0xc'));var crypto=require('crypto');var jsforce=require(_0x50ce('0xd'));var deskjs=require(_0x50ce('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x50ce('0xf'));var Redis=require(_0x50ce('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x50ce('0x11'));var as=require(_0x50ce('0x12'));var hardwareService=require(_0x50ce('0x13'));var logger=require('../../config/logger')(_0x50ce('0x14'));var utils=require('../../config/utils');var config=require(_0x50ce('0x15'));var licenseUtil=require(_0x50ce('0x16'));var db=require(_0x50ce('0x17'))['db'];function respondWithStatusCode(_0x45a306,_0x26f05e){_0x26f05e=_0x26f05e||0xcc;return function(_0x4afca9){if(_0x4afca9){return _0x45a306['sendStatus'](_0x26f05e);}return _0x45a306['status'](_0x26f05e)[_0x50ce('0x18')]();};}function respondWithResult(_0x3b39d0,_0x4fdf29){_0x4fdf29=_0x4fdf29||0xc8;return function(_0x49ee96){if(_0x49ee96){return _0x3b39d0[_0x50ce('0x19')](_0x4fdf29)['json'](_0x49ee96);}};}function respondWithFilteredResult(_0x2609bc,_0x46ddf2){return function(_0x5a3241){if(_0x5a3241){var _0x743a7d=typeof _0x46ddf2['offset']===_0x50ce('0x1a')&&typeof _0x46ddf2['limit']==='undefined';var _0x2993ac=_0x5a3241['count'];var _0x4db8d9=_0x743a7d?0x0:_0x46ddf2[_0x50ce('0x1b')];var _0x7a534b=_0x743a7d?_0x5a3241[_0x50ce('0x1c')]:_0x46ddf2[_0x50ce('0x1b')]+_0x46ddf2[_0x50ce('0x1d')];var _0x399276;if(_0x7a534b>=_0x2993ac){_0x7a534b=_0x2993ac;_0x399276=0xc8;}else{_0x399276=0xce;}_0x2609bc[_0x50ce('0x19')](_0x399276);return _0x2609bc['set'](_0x50ce('0x1e'),_0x4db8d9+'-'+_0x7a534b+'/'+_0x2993ac)[_0x50ce('0x1f')](_0x5a3241);}return null;};}function patchUpdates(_0x2f7954){return function(_0x3aa403){try{jsonpatch[_0x50ce('0x20')](_0x3aa403,_0x2f7954,!![]);}catch(_0x4c45b5){return BPromise['reject'](_0x4c45b5);}return _0x3aa403[_0x50ce('0x21')]();};}function saveUpdates(_0x3b840f,_0x114951){return function(_0x2e1d0c){if(_0x2e1d0c){return _0x2e1d0c[_0x50ce('0x22')](_0x3b840f)[_0x50ce('0x23')](function(_0x44333d){return _0x44333d;});}return null;};}function removeEntity(_0x366b31,_0x48e7ac){return function(_0x27e1a0){if(_0x27e1a0){return _0x27e1a0[_0x50ce('0x24')]()[_0x50ce('0x23')](function(){_0x366b31[_0x50ce('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a3229,_0x5275b1){return function(_0x26db6e){if(!_0x26db6e){_0x5a3229[_0x50ce('0x25')](0x194);}return _0x26db6e;};}function handleError(_0x63d156,_0x21d741){_0x21d741=_0x21d741||0x1f4;return function(_0x7b395a){logger[_0x50ce('0x26')](_0x7b395a['stack']);if(_0x7b395a[_0x50ce('0x27')]){delete _0x7b395a[_0x50ce('0x27')];}_0x63d156[_0x50ce('0x19')](_0x21d741)[_0x50ce('0x28')](_0x7b395a);};}exports[_0x50ce('0x29')]=function(_0x811e1c,_0x1f8bad){var _0x43f767={},_0x37420e={},_0x25e929={'count':0x0,'rows':[]};var _0x193825=_[_0x50ce('0x2a')](db[_0x50ce('0x2b')][_0x50ce('0x2c')],function(_0x1c78cc){return{'name':_0x1c78cc[_0x50ce('0x2d')],'type':_0x1c78cc['type'][_0x50ce('0x2e')]};});_0x37420e['model']=_['map'](_0x193825,_0x50ce('0x27'));_0x37420e[_0x50ce('0x2f')]=_[_0x50ce('0x30')](_0x811e1c[_0x50ce('0x2f')]);_0x37420e[_0x50ce('0x31')]=_[_0x50ce('0x32')](_0x37420e[_0x50ce('0x33')],_0x37420e[_0x50ce('0x2f')]);_0x43f767[_0x50ce('0x34')]=_[_0x50ce('0x32')](_0x37420e[_0x50ce('0x33')],qs['fields'](_0x811e1c[_0x50ce('0x2f')][_0x50ce('0x35')]));_0x43f767[_0x50ce('0x34')]=_0x43f767[_0x50ce('0x34')]['length']?_0x43f767['attributes']:_0x37420e[_0x50ce('0x33')];if(!_0x811e1c[_0x50ce('0x2f')][_0x50ce('0x36')](_0x50ce('0x37'))){_0x43f767['limit']=qs[_0x50ce('0x1d')](_0x811e1c[_0x50ce('0x2f')]['limit']);_0x43f767[_0x50ce('0x1b')]=qs[_0x50ce('0x1b')](_0x811e1c[_0x50ce('0x2f')][_0x50ce('0x1b')]);}_0x43f767[_0x50ce('0x38')]=qs['sort'](_0x811e1c[_0x50ce('0x2f')][_0x50ce('0x39')]);_0x43f767[_0x50ce('0x3a')]=qs[_0x50ce('0x31')](_['pick'](_0x811e1c[_0x50ce('0x2f')],_0x37420e[_0x50ce('0x31')]),_0x193825);if(_0x811e1c[_0x50ce('0x2f')][_0x50ce('0x3b')]){_0x43f767[_0x50ce('0x3a')]=_[_0x50ce('0x3c')](_0x43f767[_0x50ce('0x3a')],{'$or':_[_0x50ce('0x2a')](_0x193825,function(_0x5aeef9){if(_0x5aeef9[_0x50ce('0x3d')]!==_0x50ce('0x3e')){var _0x7db1e8={};_0x7db1e8[_0x5aeef9[_0x50ce('0x27')]]={'$like':'%'+_0x811e1c[_0x50ce('0x2f')]['filter']+'%'};return _0x7db1e8;}})});}_0x43f767=_[_0x50ce('0x3c')]({},_0x43f767,_0x811e1c[_0x50ce('0x3f')]);var _0x5ad95b={'where':_0x43f767[_0x50ce('0x3a')]};return db['SugarcrmField'][_0x50ce('0x1c')](_0x5ad95b)[_0x50ce('0x23')](function(_0x5ea40d){_0x25e929[_0x50ce('0x1c')]=_0x5ea40d;if(_0x811e1c[_0x50ce('0x2f')][_0x50ce('0x40')]){_0x43f767[_0x50ce('0x41')]=[{'all':!![]}];}return db[_0x50ce('0x2b')]['findAll'](_0x43f767);})['then'](function(_0x5257ae){_0x25e929['rows']=_0x5257ae;return _0x25e929;})[_0x50ce('0x23')](respondWithFilteredResult(_0x1f8bad,_0x43f767))[_0x50ce('0x42')](handleError(_0x1f8bad,null));};exports['show']=function(_0x992261,_0x34c9be){var _0xee3126={'raw':!![],'where':{'id':_0x992261[_0x50ce('0x43')]['id']}},_0x105e7b={};_0x105e7b[_0x50ce('0x33')]=_[_0x50ce('0x30')](db[_0x50ce('0x2b')][_0x50ce('0x2c')]);_0x105e7b[_0x50ce('0x2f')]=_[_0x50ce('0x30')](_0x992261['query']);_0x105e7b[_0x50ce('0x31')]=_[_0x50ce('0x32')](_0x105e7b[_0x50ce('0x33')],_0x105e7b[_0x50ce('0x2f')]);_0xee3126['attributes']=_[_0x50ce('0x32')](_0x105e7b[_0x50ce('0x33')],qs['fields'](_0x992261[_0x50ce('0x2f')]['fields']));_0xee3126[_0x50ce('0x34')]=_0xee3126[_0x50ce('0x34')][_0x50ce('0x44')]?_0xee3126['attributes']:_0x105e7b[_0x50ce('0x33')];if(_0x992261['query'][_0x50ce('0x40')]){_0xee3126[_0x50ce('0x41')]=[{'all':!![]}];}_0xee3126=_[_0x50ce('0x3c')]({},_0xee3126,_0x992261[_0x50ce('0x3f')]);return db[_0x50ce('0x2b')][_0x50ce('0x45')](_0xee3126)[_0x50ce('0x23')](handleEntityNotFound(_0x34c9be,null))['then'](respondWithResult(_0x34c9be,null))['catch'](handleError(_0x34c9be,null));};exports['create']=function(_0x370f02,_0x1eb585){return db[_0x50ce('0x2b')][_0x50ce('0x46')](_0x370f02['body'],{})['then'](respondWithResult(_0x1eb585,0xc9))[_0x50ce('0x42')](handleError(_0x1eb585,null));};exports['update']=function(_0x455b0a,_0x37c61c){if(_0x455b0a[_0x50ce('0x47')]['id']){delete _0x455b0a[_0x50ce('0x47')]['id'];}return db[_0x50ce('0x2b')][_0x50ce('0x45')]({'where':{'id':_0x455b0a[_0x50ce('0x43')]['id']}})[_0x50ce('0x23')](handleEntityNotFound(_0x37c61c,null))[_0x50ce('0x23')](saveUpdates(_0x455b0a['body'],null))[_0x50ce('0x23')](respondWithResult(_0x37c61c,null))[_0x50ce('0x42')](handleError(_0x37c61c,null));};exports[_0x50ce('0x24')]=function(_0x53e98a,_0x495a93){return db['SugarcrmField'][_0x50ce('0x45')]({'where':{'id':_0x53e98a[_0x50ce('0x43')]['id']}})[_0x50ce('0x23')](handleEntityNotFound(_0x495a93,null))['then'](removeEntity(_0x495a93,null))[_0x50ce('0x42')](handleError(_0x495a93,null));}; \ No newline at end of file +var _0xa229=['filters','model','attributes','fields','length','nolimit','sort','where','pick','type','VIRTUAL','filter','options','includeAll','include','rows','catch','params','intersection','merge','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','undefined','limit','offset','count','apply','reject','save','update','then','error','stack','name','send','index','SugarcrmField','rawAttributes','fieldName','key','map','query','keys'];(function(_0x37259e,_0x44bea5){var _0x73927f=function(_0xc20b32){while(--_0xc20b32){_0x37259e['push'](_0x37259e['shift']());}};_0x73927f(++_0x44bea5);}(_0xa229,0xac));var _0x9a22=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa229[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x9a22('0x0'));var rimraf=require(_0x9a22('0x1'));var zipdir=require(_0x9a22('0x2'));var jsonpatch=require(_0x9a22('0x3'));var rp=require(_0x9a22('0x4'));var moment=require('moment');var BPromise=require(_0x9a22('0x5'));var Mustache=require(_0x9a22('0x6'));var util=require('util');var path=require(_0x9a22('0x7'));var sox=require(_0x9a22('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9a22('0x9'));var _=require(_0x9a22('0xa'));var squel=require(_0x9a22('0xb'));var crypto=require(_0x9a22('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9a22('0xd'));var toCsv=require(_0x9a22('0xe'));var querystring=require(_0x9a22('0xf'));var Papa=require(_0x9a22('0x10'));var Redis=require(_0x9a22('0x11'));var authService=require(_0x9a22('0x12'));var qs=require(_0x9a22('0x13'));var as=require(_0x9a22('0x14'));var hardwareService=require(_0x9a22('0x15'));var logger=require('../../config/logger')(_0x9a22('0x16'));var utils=require(_0x9a22('0x17'));var config=require(_0x9a22('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x9a22('0x19'))['db'];function respondWithStatusCode(_0x321247,_0xba1ea5){_0xba1ea5=_0xba1ea5||0xcc;return function(_0x13f491){if(_0x13f491){return _0x321247['sendStatus'](_0xba1ea5);}return _0x321247[_0x9a22('0x1a')](_0xba1ea5)[_0x9a22('0x1b')]();};}function respondWithResult(_0x5f0778,_0x1acef5){_0x1acef5=_0x1acef5||0xc8;return function(_0x4a6bc2){if(_0x4a6bc2){return _0x5f0778[_0x9a22('0x1a')](_0x1acef5)[_0x9a22('0x1c')](_0x4a6bc2);}};}function respondWithFilteredResult(_0x5a76bb,_0x32bcef){return function(_0x255e99){if(_0x255e99){var _0x253a39=typeof _0x32bcef['offset']===_0x9a22('0x1d')&&typeof _0x32bcef[_0x9a22('0x1e')]==='undefined';var _0x2bc067=_0x255e99['count'];var _0x5abe7c=_0x253a39?0x0:_0x32bcef[_0x9a22('0x1f')];var _0x3c9a27=_0x253a39?_0x255e99[_0x9a22('0x20')]:_0x32bcef[_0x9a22('0x1f')]+_0x32bcef[_0x9a22('0x1e')];var _0x53facb;if(_0x3c9a27>=_0x2bc067){_0x3c9a27=_0x2bc067;_0x53facb=0xc8;}else{_0x53facb=0xce;}_0x5a76bb[_0x9a22('0x1a')](_0x53facb);return _0x5a76bb['set']('Content-Range',_0x5abe7c+'-'+_0x3c9a27+'/'+_0x2bc067)['json'](_0x255e99);}return null;};}function patchUpdates(_0x4a6018){return function(_0x5980bf){try{jsonpatch[_0x9a22('0x21')](_0x5980bf,_0x4a6018,!![]);}catch(_0x2bde71){return BPromise[_0x9a22('0x22')](_0x2bde71);}return _0x5980bf[_0x9a22('0x23')]();};}function saveUpdates(_0x1dba6c,_0x101d52){return function(_0x112f50){if(_0x112f50){return _0x112f50[_0x9a22('0x24')](_0x1dba6c)[_0x9a22('0x25')](function(_0xc06007){return _0xc06007;});}return null;};}function removeEntity(_0x19bcb6,_0x4adf60){return function(_0x37c36b){if(_0x37c36b){return _0x37c36b['destroy']()[_0x9a22('0x25')](function(){_0x19bcb6[_0x9a22('0x1a')](0xcc)[_0x9a22('0x1b')]();});}};}function handleEntityNotFound(_0x1dbcaa,_0x22cdc9){return function(_0x44f9d7){if(!_0x44f9d7){_0x1dbcaa['sendStatus'](0x194);}return _0x44f9d7;};}function handleError(_0x96944a,_0x4744f5){_0x4744f5=_0x4744f5||0x1f4;return function(_0x2b274b){logger[_0x9a22('0x26')](_0x2b274b[_0x9a22('0x27')]);if(_0x2b274b['name']){delete _0x2b274b[_0x9a22('0x28')];}_0x96944a[_0x9a22('0x1a')](_0x4744f5)[_0x9a22('0x29')](_0x2b274b);};}exports[_0x9a22('0x2a')]=function(_0x5b665f,_0x56090d){var _0x1dcbe3={},_0x83a686={},_0x13c7ce={'count':0x0,'rows':[]};var _0x219372=_['map'](db[_0x9a22('0x2b')][_0x9a22('0x2c')],function(_0x153f3c){return{'name':_0x153f3c[_0x9a22('0x2d')],'type':_0x153f3c['type'][_0x9a22('0x2e')]};});_0x83a686['model']=_[_0x9a22('0x2f')](_0x219372,'name');_0x83a686[_0x9a22('0x30')]=_[_0x9a22('0x31')](_0x5b665f[_0x9a22('0x30')]);_0x83a686[_0x9a22('0x32')]=_['intersection'](_0x83a686[_0x9a22('0x33')],_0x83a686[_0x9a22('0x30')]);_0x1dcbe3[_0x9a22('0x34')]=_['intersection'](_0x83a686[_0x9a22('0x33')],qs[_0x9a22('0x35')](_0x5b665f[_0x9a22('0x30')][_0x9a22('0x35')]));_0x1dcbe3['attributes']=_0x1dcbe3['attributes'][_0x9a22('0x36')]?_0x1dcbe3[_0x9a22('0x34')]:_0x83a686[_0x9a22('0x33')];if(!_0x5b665f[_0x9a22('0x30')]['hasOwnProperty'](_0x9a22('0x37'))){_0x1dcbe3[_0x9a22('0x1e')]=qs[_0x9a22('0x1e')](_0x5b665f[_0x9a22('0x30')][_0x9a22('0x1e')]);_0x1dcbe3['offset']=qs[_0x9a22('0x1f')](_0x5b665f[_0x9a22('0x30')][_0x9a22('0x1f')]);}_0x1dcbe3['order']=qs[_0x9a22('0x38')](_0x5b665f[_0x9a22('0x30')]['sort']);_0x1dcbe3[_0x9a22('0x39')]=qs[_0x9a22('0x32')](_[_0x9a22('0x3a')](_0x5b665f['query'],_0x83a686[_0x9a22('0x32')]),_0x219372);if(_0x5b665f[_0x9a22('0x30')]['filter']){_0x1dcbe3['where']=_['merge'](_0x1dcbe3[_0x9a22('0x39')],{'$or':_[_0x9a22('0x2f')](_0x219372,function(_0x650762){if(_0x650762[_0x9a22('0x3b')]!==_0x9a22('0x3c')){var _0x44fb3d={};_0x44fb3d[_0x650762[_0x9a22('0x28')]]={'$like':'%'+_0x5b665f[_0x9a22('0x30')][_0x9a22('0x3d')]+'%'};return _0x44fb3d;}})});}_0x1dcbe3=_['merge']({},_0x1dcbe3,_0x5b665f[_0x9a22('0x3e')]);var _0x297cba={'where':_0x1dcbe3[_0x9a22('0x39')]};return db[_0x9a22('0x2b')][_0x9a22('0x20')](_0x297cba)[_0x9a22('0x25')](function(_0x25196b){_0x13c7ce[_0x9a22('0x20')]=_0x25196b;if(_0x5b665f['query'][_0x9a22('0x3f')]){_0x1dcbe3[_0x9a22('0x40')]=[{'all':!![]}];}return db[_0x9a22('0x2b')]['findAll'](_0x1dcbe3);})[_0x9a22('0x25')](function(_0xd67681){_0x13c7ce[_0x9a22('0x41')]=_0xd67681;return _0x13c7ce;})['then'](respondWithFilteredResult(_0x56090d,_0x1dcbe3))[_0x9a22('0x42')](handleError(_0x56090d,null));};exports['show']=function(_0x7782b8,_0x409690){var _0x14deaf={'raw':!![],'where':{'id':_0x7782b8[_0x9a22('0x43')]['id']}},_0x36ae5d={};_0x36ae5d[_0x9a22('0x33')]=_[_0x9a22('0x31')](db[_0x9a22('0x2b')]['rawAttributes']);_0x36ae5d[_0x9a22('0x30')]=_[_0x9a22('0x31')](_0x7782b8[_0x9a22('0x30')]);_0x36ae5d[_0x9a22('0x32')]=_[_0x9a22('0x44')](_0x36ae5d[_0x9a22('0x33')],_0x36ae5d[_0x9a22('0x30')]);_0x14deaf[_0x9a22('0x34')]=_[_0x9a22('0x44')](_0x36ae5d[_0x9a22('0x33')],qs[_0x9a22('0x35')](_0x7782b8['query'][_0x9a22('0x35')]));_0x14deaf[_0x9a22('0x34')]=_0x14deaf[_0x9a22('0x34')][_0x9a22('0x36')]?_0x14deaf[_0x9a22('0x34')]:_0x36ae5d[_0x9a22('0x33')];if(_0x7782b8[_0x9a22('0x30')][_0x9a22('0x3f')]){_0x14deaf[_0x9a22('0x40')]=[{'all':!![]}];}_0x14deaf=_[_0x9a22('0x45')]({},_0x14deaf,_0x7782b8['options']);return db[_0x9a22('0x2b')]['find'](_0x14deaf)[_0x9a22('0x25')](handleEntityNotFound(_0x409690,null))[_0x9a22('0x25')](respondWithResult(_0x409690,null))[_0x9a22('0x42')](handleError(_0x409690,null));};exports[_0x9a22('0x46')]=function(_0xc28a61,_0x22fed0){return db[_0x9a22('0x2b')][_0x9a22('0x46')](_0xc28a61['body'],{})['then'](respondWithResult(_0x22fed0,0xc9))[_0x9a22('0x42')](handleError(_0x22fed0,null));};exports['update']=function(_0x5c097f,_0x173679){if(_0x5c097f[_0x9a22('0x47')]['id']){delete _0x5c097f[_0x9a22('0x47')]['id'];}return db['SugarcrmField'][_0x9a22('0x48')]({'where':{'id':_0x5c097f['params']['id']}})['then'](handleEntityNotFound(_0x173679,null))[_0x9a22('0x25')](saveUpdates(_0x5c097f['body'],null))[_0x9a22('0x25')](respondWithResult(_0x173679,null))['catch'](handleError(_0x173679,null));};exports[_0x9a22('0x49')]=function(_0x19067d,_0x249b09){return db['SugarcrmField'][_0x9a22('0x48')]({'where':{'id':_0x19067d[_0x9a22('0x43')]['id']}})[_0x9a22('0x25')](handleEntityNotFound(_0x249b09,null))[_0x9a22('0x25')](removeEntity(_0x249b09,null))[_0x9a22('0x42')](handleError(_0x249b09,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index d8aa8c8..92fb1dc 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 _0x37bb=['sugarcrm_unique_index','idField','FieldId','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','SugarcrmField','int_sugarcrm_fields'];(function(_0x495344,_0x3bbfe5){var _0x2f3b52=function(_0x5ab18f){while(--_0x5ab18f){_0x495344['push'](_0x495344['shift']());}};_0x2f3b52(++_0x3bbfe5);}(_0x37bb,0x153));var _0xb37b=function(_0x129527,_0x43bfd2){_0x129527=_0x129527-0x0;var _0x434b37=_0x37bb[_0x129527];return _0x434b37;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xb37b('0x0'));var moment=require(_0xb37b('0x1'));var BPromise=require(_0xb37b('0x2'));var rp=require(_0xb37b('0x3'));var fs=require('fs');var path=require(_0xb37b('0x4'));var rimraf=require(_0xb37b('0x5'));var config=require(_0xb37b('0x6'));var attributes=require('./intSugarcrmField.attributes');module['exports']=function(_0x2d397b,_0x2930dc){return _0x2d397b['define'](_0xb37b('0x7'),attributes,{'tableName':_0xb37b('0x8'),'paranoid':![],'indexes':[{'name':_0xb37b('0x9'),'fields':[_0xb37b('0xa'),_0xb37b('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa32b=['lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','FieldId'];(function(_0x41aff9,_0x396c2d){var _0x5b0773=function(_0x244801){while(--_0x244801){_0x41aff9['push'](_0x41aff9['shift']());}};_0x5b0773(++_0x396c2d);}(_0xa32b,0xa9));var _0xba32=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0xa32b[_0x381589];return _0x2a075d;};'use strict';var _=require(_0xba32('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xba32('0x1'));var BPromise=require(_0xba32('0x2'));var rp=require(_0xba32('0x3'));var fs=require('fs');var path=require(_0xba32('0x4'));var rimraf=require(_0xba32('0x5'));var config=require(_0xba32('0x6'));var attributes=require(_0xba32('0x7'));module[_0xba32('0x8')]=function(_0xbc6d1b,_0x1b708f){return _0xbc6d1b['define'](_0xba32('0x9'),attributes,{'tableName':_0xba32('0xa'),'paranoid':![],'indexes':[{'name':_0xba32('0xb'),'fields':['idField',_0xba32('0xc')],'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 dcf7cfc..8450e86 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 _0x3075=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x237602,_0x4311af){var _0x2052cc=function(_0x5c7ee0){while(--_0x5c7ee0){_0x237602['push'](_0x237602['shift']());}};_0x2052cc(++_0x4311af);}(_0x3075,0x157));var _0x5307=function(_0x36d802,_0x33129c){_0x36d802=_0x36d802-0x0;var _0x471df5=_0x3075[_0x36d802];return _0x471df5;};'use strict';var _=require(_0x5307('0x0'));var util=require(_0x5307('0x1'));var moment=require(_0x5307('0x2'));var BPromise=require(_0x5307('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5307('0x4'));var db=require(_0x5307('0x5'))['db'];var utils=require(_0x5307('0x6'));var logger=require(_0x5307('0x7'))(_0x5307('0x8'));var config=require(_0x5307('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5307('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27707e,_0x40d290,_0x4bd020){return new BPromise(function(_0x16e0f2,_0x1aee66){return client['request'](_0x27707e,_0x4bd020)[_0x5307('0xb')](function(_0x439e46){logger[_0x5307('0xc')](_0x5307('0xd'),_0x40d290,_0x5307('0xe'));logger[_0x5307('0xf')](_0x5307('0x10'),_0x40d290,_0x5307('0xe'),JSON[_0x5307('0x11')](_0x439e46));if(_0x439e46[_0x5307('0x12')]){if(_0x439e46[_0x5307('0x12')][_0x5307('0x13')]===0x1f4){logger['error'](_0x5307('0xd'),_0x40d290,_0x439e46[_0x5307('0x12')]['message']);return _0x1aee66(_0x439e46['error']['message']);}logger[_0x5307('0x12')](_0x5307('0xd'),_0x40d290,_0x439e46[_0x5307('0x12')][_0x5307('0x14')]);return _0x16e0f2(_0x439e46[_0x5307('0x12')][_0x5307('0x14')]);}else{logger[_0x5307('0xc')](_0x5307('0xd'),_0x40d290,_0x5307('0xe'));_0x16e0f2(_0x439e46[_0x5307('0x15')][_0x5307('0x14')]);}})[_0x5307('0x16')](function(_0x535662){logger[_0x5307('0x12')](_0x5307('0xd'),_0x40d290,_0x535662);_0x1aee66(_0x535662);});});} \ No newline at end of file +var _0x4197=['rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error','code','SugarcrmField,\x20%s,\x20%s','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3ebc6e,_0x4bb6e0){var _0x2bf58a=function(_0x13f241){while(--_0x13f241){_0x3ebc6e['push'](_0x3ebc6e['shift']());}};_0x2bf58a(++_0x4bb6e0);}(_0x4197,0x1c0));var _0x7419=function(_0x52e02b,_0x3e13b7){_0x52e02b=_0x52e02b-0x0;var _0x412815=_0x4197[_0x52e02b];return _0x412815;};'use strict';var _=require(_0x7419('0x0'));var util=require(_0x7419('0x1'));var moment=require('moment');var BPromise=require(_0x7419('0x2'));var rs=require(_0x7419('0x3'));var fs=require('fs');var Redis=require(_0x7419('0x4'));var db=require(_0x7419('0x5'))['db'];var utils=require(_0x7419('0x6'));var logger=require(_0x7419('0x7'))(_0x7419('0x8'));var config=require(_0x7419('0x9'));var jayson=require(_0x7419('0xa'));var client=jayson['client'][_0x7419('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x36a8ab,_0x560e9a,_0x2c485d){return new BPromise(function(_0x14374c,_0x10abee){return client[_0x7419('0xc')](_0x36a8ab,_0x2c485d)[_0x7419('0xd')](function(_0x3d05d3){logger['info']('SugarcrmField,\x20%s,\x20%s',_0x560e9a,_0x7419('0xe'));logger[_0x7419('0xf')](_0x7419('0x10'),_0x560e9a,_0x7419('0xe'),JSON['stringify'](_0x3d05d3));if(_0x3d05d3['error']){if(_0x3d05d3[_0x7419('0x11')][_0x7419('0x12')]===0x1f4){logger[_0x7419('0x11')](_0x7419('0x13'),_0x560e9a,_0x3d05d3[_0x7419('0x11')][_0x7419('0x14')]);return _0x10abee(_0x3d05d3[_0x7419('0x11')][_0x7419('0x14')]);}logger['error'](_0x7419('0x13'),_0x560e9a,_0x3d05d3[_0x7419('0x11')][_0x7419('0x14')]);return _0x14374c(_0x3d05d3[_0x7419('0x11')][_0x7419('0x14')]);}else{logger[_0x7419('0x15')](_0x7419('0x13'),_0x560e9a,_0x7419('0xe'));_0x14374c(_0x3d05d3[_0x7419('0x16')][_0x7419('0x14')]);}})[_0x7419('0x17')](function(_0x967ba8){logger[_0x7419('0x11')]('SugarcrmField,\x20%s,\x20%s',_0x560e9a,_0x967ba8);_0x10abee(_0x967ba8);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 97ca1e4..b3cd7f2 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 _0xd3c6=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','update'];(function(_0x250ed7,_0x3da8b0){var _0x362c1e=function(_0x349f07){while(--_0x349f07){_0x250ed7['push'](_0x250ed7['shift']());}};_0x362c1e(++_0x3da8b0);}(_0xd3c6,0x121));var _0x6d3c=function(_0x46a976,_0x27526d){_0x46a976=_0x46a976-0x0;var _0x3b1eaf=_0xd3c6[_0x46a976];return _0x3b1eaf;};'use strict';var multer=require(_0x6d3c('0x0'));var util=require(_0x6d3c('0x1'));var path=require(_0x6d3c('0x2'));var timeout=require(_0x6d3c('0x3'));var express=require(_0x6d3c('0x4'));var router=express[_0x6d3c('0x5')]();var fs_extra=require(_0x6d3c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x6d3c('0x7'));var config=require(_0x6d3c('0x8'));var controller=require('./intVtigerAccount.controller');router[_0x6d3c('0x9')]('/',auth[_0x6d3c('0xa')](),controller[_0x6d3c('0xb')]);router[_0x6d3c('0x9')](_0x6d3c('0xc'),auth[_0x6d3c('0xa')](),controller[_0x6d3c('0xd')]);router[_0x6d3c('0x9')](_0x6d3c('0xe'),auth[_0x6d3c('0xa')](),controller[_0x6d3c('0xf')]);router[_0x6d3c('0x9')](_0x6d3c('0x10'),auth[_0x6d3c('0xa')](),controller[_0x6d3c('0x11')]);router['post']('/',auth[_0x6d3c('0xa')](),controller[_0x6d3c('0x12')]);router[_0x6d3c('0x13')](_0x6d3c('0xe'),auth[_0x6d3c('0xa')](),controller[_0x6d3c('0x14')]);router[_0x6d3c('0x15')](_0x6d3c('0xc'),auth[_0x6d3c('0xa')](),controller[_0x6d3c('0x16')]);router[_0x6d3c('0x17')](_0x6d3c('0xc'),auth[_0x6d3c('0xa')](),controller[_0x6d3c('0x18')]);module[_0x6d3c('0x19')]=router; \ No newline at end of file +var _0x5096=['/:id','/:id/configurations','getConfigurations','getFields','create','post','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index'];(function(_0x249358,_0x63fd36){var _0x533960=function(_0x82fa09){while(--_0x82fa09){_0x249358['push'](_0x249358['shift']());}};_0x533960(++_0x63fd36);}(_0x5096,0x6c));var _0x6509=function(_0x3eb998,_0x4f5cee){_0x3eb998=_0x3eb998-0x0;var _0x272be1=_0x5096[_0x3eb998];return _0x272be1;};'use strict';var multer=require(_0x6509('0x0'));var util=require(_0x6509('0x1'));var path=require(_0x6509('0x2'));var timeout=require(_0x6509('0x3'));var express=require(_0x6509('0x4'));var router=express['Router']();var fs_extra=require(_0x6509('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6509('0x6'));var config=require(_0x6509('0x7'));var controller=require(_0x6509('0x8'));router[_0x6509('0x9')]('/',auth[_0x6509('0xa')](),controller[_0x6509('0xb')]);router['get'](_0x6509('0xc'),auth[_0x6509('0xa')](),controller['show']);router[_0x6509('0x9')](_0x6509('0xd'),auth[_0x6509('0xa')](),controller[_0x6509('0xe')]);router[_0x6509('0x9')]('/:id/fields',auth[_0x6509('0xa')](),controller[_0x6509('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6509('0x10')]);router[_0x6509('0x11')](_0x6509('0xd'),auth[_0x6509('0xa')](),controller[_0x6509('0x12')]);router[_0x6509('0x13')](_0x6509('0xc'),auth[_0x6509('0xa')](),controller[_0x6509('0x14')]);router[_0x6509('0x15')]('/:id',auth[_0x6509('0xa')](),controller[_0x6509('0x16')]);module[_0x6509('0x17')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index aad38dc..b53a6f7 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 _0xa70f=['STRING','HelpDesk'];(function(_0x4687df,_0x12099c){var _0x32eaef=function(_0x2387db){while(--_0x2387db){_0x4687df['push'](_0x4687df['shift']());}};_0x32eaef(++_0x12099c);}(_0xa70f,0x1a8));var _0xfa70=function(_0x5c3619,_0x5409fc){_0x5c3619=_0x5c3619-0x0;var _0xafd480=_0xa70f[_0x5c3619];return _0xafd480;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xfa70('0x0')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xfa70('0x0')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xfa70('0x1')},'remoteUri':{'type':Sequelize[_0xfa70('0x0')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xfa70('0x0')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xb885=['STRING','HelpDesk','exports'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0xb885,0x71));var _0x5b88=function(_0x5f12fd,_0x33c70d){_0x5f12fd=_0x5f12fd-0x0;var _0x58bd80=_0xb885[_0x5f12fd];return _0x58bd80;};'use strict';var Sequelize=require('sequelize');module[_0x5b88('0x0')]={'name':{'type':Sequelize[_0x5b88('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x5b88('0x1')]},'username':{'type':Sequelize[_0x5b88('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5b88('0x2')},'remoteUri':{'type':Sequelize[_0x5b88('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0x5b88('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 183f11e..ee66a26 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 _0xbe55=['offset','reject','save','then','error','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','merge','options','includeAll','findAll','catch','params','keys','include','find','create','body','update','destroy','getConfigurations','VtigerConfiguration','filter','addConfiguration','AccountId','Descriptions','getDescriptions','channel','VtigerField','Subjects','getFields','description','moduleName','remoteUri','accessKey','username','slice','substring','lastIndexOf','%s/webservice.php','success','POST','login','result','token','GET','describe','autogenerated','owner','remove','includes','editable','false','label','startsWith','picklist','picklistValues','value','log','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0xbe55,0x149));var _0x5be5=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xbe55[_0x55e08b];return _0xd1a7ff;};'use strict';var emlformat=require(_0x5be5('0x0'));var rimraf=require(_0x5be5('0x1'));var zipdir=require(_0x5be5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5be5('0x3'));var BPromise=require(_0x5be5('0x4'));var Mustache=require(_0x5be5('0x5'));var util=require(_0x5be5('0x6'));var path=require('path');var sox=require(_0x5be5('0x7'));var csv=require(_0x5be5('0x8'));var ejs=require(_0x5be5('0x9'));var fs=require('fs');var fs_extra=require(_0x5be5('0xa'));var _=require(_0x5be5('0xb'));var squel=require(_0x5be5('0xc'));var crypto=require(_0x5be5('0xd'));var jsforce=require(_0x5be5('0xe'));var deskjs=require(_0x5be5('0xf'));var toCsv=require('to-csv');var querystring=require(_0x5be5('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5be5('0x11'));var as=require(_0x5be5('0x12'));var hardwareService=require(_0x5be5('0x13'));var logger=require(_0x5be5('0x14'))(_0x5be5('0x15'));var utils=require(_0x5be5('0x16'));var config=require(_0x5be5('0x17'));var licenseUtil=require(_0x5be5('0x18'));var db=require(_0x5be5('0x19'))['db'];var integrations=require(_0x5be5('0x1a'));function respondWithStatusCode(_0x360997,_0x1266d0){_0x1266d0=_0x1266d0||0xcc;return function(_0x1606f9){if(_0x1606f9){return _0x360997[_0x5be5('0x1b')](_0x1266d0);}return _0x360997[_0x5be5('0x1c')](_0x1266d0)[_0x5be5('0x1d')]();};}function respondWithResult(_0x259662,_0x497625){_0x497625=_0x497625||0xc8;return function(_0x3558f0){if(_0x3558f0){return _0x259662[_0x5be5('0x1c')](_0x497625)[_0x5be5('0x1e')](_0x3558f0);}};}function respondWithFilteredResult(_0x5c9479,_0x3a834e){return function(_0x3d67d2){if(_0x3d67d2){var _0x21fa8d=typeof _0x3a834e['offset']===_0x5be5('0x1f')&&typeof _0x3a834e[_0x5be5('0x20')]===_0x5be5('0x1f');var _0x2404ef=_0x3d67d2[_0x5be5('0x21')];var _0xcb8d86=_0x21fa8d?0x0:_0x3a834e['offset'];var _0x3e6899=_0x21fa8d?_0x3d67d2[_0x5be5('0x21')]:_0x3a834e[_0x5be5('0x22')]+_0x3a834e[_0x5be5('0x20')];var _0x54c4e8;if(_0x3e6899>=_0x2404ef){_0x3e6899=_0x2404ef;_0x54c4e8=0xc8;}else{_0x54c4e8=0xce;}_0x5c9479['status'](_0x54c4e8);return _0x5c9479['set']('Content-Range',_0xcb8d86+'-'+_0x3e6899+'/'+_0x2404ef)[_0x5be5('0x1e')](_0x3d67d2);}return null;};}function patchUpdates(_0x587a4e){return function(_0x598b89){try{jsonpatch['apply'](_0x598b89,_0x587a4e,!![]);}catch(_0x1a72c1){return BPromise[_0x5be5('0x23')](_0x1a72c1);}return _0x598b89[_0x5be5('0x24')]();};}function saveUpdates(_0x101627,_0x5239db){return function(_0x5c6930){if(_0x5c6930){return _0x5c6930['update'](_0x101627)[_0x5be5('0x25')](function(_0x19f498){return _0x19f498;});}return null;};}function removeEntity(_0x380260,_0x4caeac){return function(_0x31c92c){if(_0x31c92c){return _0x31c92c['destroy']()[_0x5be5('0x25')](function(){_0x380260[_0x5be5('0x1c')](0xcc)[_0x5be5('0x1d')]();});}};}function handleEntityNotFound(_0x5ef91e,_0x4e7629){return function(_0x5ade33){if(!_0x5ade33){_0x5ef91e[_0x5be5('0x1b')](0x194);}return _0x5ade33;};}function handleError(_0x414dbb,_0xdb3826){_0xdb3826=_0xdb3826||0x1f4;return function(_0x221f16){logger[_0x5be5('0x26')](_0x221f16[_0x5be5('0x27')]);if(_0x221f16[_0x5be5('0x28')]){delete _0x221f16[_0x5be5('0x28')];}_0x414dbb[_0x5be5('0x1c')](_0xdb3826)[_0x5be5('0x29')](_0x221f16);};}exports[_0x5be5('0x2a')]=function(_0x335120,_0x269478){var _0x25ee5b={},_0x212788={},_0x50e1df={'count':0x0,'rows':[]};var _0x181669=_[_0x5be5('0x2b')](db[_0x5be5('0x2c')][_0x5be5('0x2d')],function(_0x3f8432){return{'name':_0x3f8432[_0x5be5('0x2e')],'type':_0x3f8432[_0x5be5('0x2f')][_0x5be5('0x30')]};});_0x212788[_0x5be5('0x31')]=_[_0x5be5('0x2b')](_0x181669,'name');_0x212788[_0x5be5('0x32')]=_['keys'](_0x335120[_0x5be5('0x32')]);_0x212788[_0x5be5('0x33')]=_[_0x5be5('0x34')](_0x212788[_0x5be5('0x31')],_0x212788[_0x5be5('0x32')]);_0x25ee5b[_0x5be5('0x35')]=_[_0x5be5('0x34')](_0x212788[_0x5be5('0x31')],qs[_0x5be5('0x36')](_0x335120[_0x5be5('0x32')]['fields']));_0x25ee5b[_0x5be5('0x35')]=_0x25ee5b[_0x5be5('0x35')][_0x5be5('0x37')]?_0x25ee5b[_0x5be5('0x35')]:_0x212788['model'];if(!_0x335120[_0x5be5('0x32')][_0x5be5('0x38')](_0x5be5('0x39'))){_0x25ee5b['limit']=qs['limit'](_0x335120[_0x5be5('0x32')][_0x5be5('0x20')]);_0x25ee5b[_0x5be5('0x22')]=qs['offset'](_0x335120['query'][_0x5be5('0x22')]);}_0x25ee5b[_0x5be5('0x3a')]=qs[_0x5be5('0x3b')](_0x335120[_0x5be5('0x32')]['sort']);_0x25ee5b['where']=qs[_0x5be5('0x33')](_[_0x5be5('0x3c')](_0x335120['query'],_0x212788[_0x5be5('0x33')]),_0x181669);if(_0x335120[_0x5be5('0x32')]['filter']){_0x25ee5b[_0x5be5('0x3d')]=_['merge'](_0x25ee5b[_0x5be5('0x3d')],{'$or':_['map'](_0x181669,function(_0x3289a4){if(_0x3289a4[_0x5be5('0x2f')]!==_0x5be5('0x3e')){var _0x16d5d8={};_0x16d5d8[_0x3289a4[_0x5be5('0x28')]]={'$like':'%'+_0x335120['query']['filter']+'%'};return _0x16d5d8;}})});}_0x25ee5b=_[_0x5be5('0x3f')]({},_0x25ee5b,_0x335120[_0x5be5('0x40')]);var _0x1d3819={'where':_0x25ee5b[_0x5be5('0x3d')]};return db['VtigerAccount'][_0x5be5('0x21')](_0x1d3819)[_0x5be5('0x25')](function(_0x32cd9a){_0x50e1df[_0x5be5('0x21')]=_0x32cd9a;if(_0x335120['query'][_0x5be5('0x41')]){_0x25ee5b['include']=[{'all':!![]}];}return db[_0x5be5('0x2c')][_0x5be5('0x42')](_0x25ee5b);})[_0x5be5('0x25')](function(_0x303fae){_0x50e1df['rows']=_0x303fae;return _0x50e1df;})['then'](respondWithFilteredResult(_0x269478,_0x25ee5b))[_0x5be5('0x43')](handleError(_0x269478,null));};exports['show']=function(_0x3a96c4,_0x370dd9){var _0x5b37a1={'raw':![],'where':{'id':_0x3a96c4[_0x5be5('0x44')]['id']}},_0x462a95={};_0x462a95[_0x5be5('0x31')]=_[_0x5be5('0x45')](db[_0x5be5('0x2c')][_0x5be5('0x2d')]);_0x462a95[_0x5be5('0x32')]=_['keys'](_0x3a96c4[_0x5be5('0x32')]);_0x462a95['filters']=_[_0x5be5('0x34')](_0x462a95[_0x5be5('0x31')],_0x462a95['query']);_0x5b37a1[_0x5be5('0x35')]=_[_0x5be5('0x34')](_0x462a95[_0x5be5('0x31')],qs['fields'](_0x3a96c4[_0x5be5('0x32')][_0x5be5('0x36')]));_0x5b37a1[_0x5be5('0x35')]=_0x5b37a1[_0x5be5('0x35')][_0x5be5('0x37')]?_0x5b37a1[_0x5be5('0x35')]:_0x462a95[_0x5be5('0x31')];if(_0x3a96c4[_0x5be5('0x32')][_0x5be5('0x41')]){_0x5b37a1[_0x5be5('0x46')]=[{'all':!![]}];}_0x5b37a1=_[_0x5be5('0x3f')]({},_0x5b37a1,_0x3a96c4[_0x5be5('0x40')]);return db[_0x5be5('0x2c')][_0x5be5('0x47')](_0x5b37a1)[_0x5be5('0x25')](handleEntityNotFound(_0x370dd9,null))['then'](respondWithResult(_0x370dd9,null))['catch'](handleError(_0x370dd9,null));};exports[_0x5be5('0x48')]=function(_0x2d992e,_0x228c27){return db[_0x5be5('0x2c')][_0x5be5('0x48')](_0x2d992e[_0x5be5('0x49')],{})[_0x5be5('0x25')](respondWithResult(_0x228c27,0xc9))[_0x5be5('0x43')](handleError(_0x228c27,null));};exports[_0x5be5('0x4a')]=function(_0x4f8fac,_0x20f1ae){if(_0x4f8fac['body']['id']){delete _0x4f8fac[_0x5be5('0x49')]['id'];}return db[_0x5be5('0x2c')][_0x5be5('0x47')]({'where':{'id':_0x4f8fac['params']['id']}})['then'](handleEntityNotFound(_0x20f1ae,null))[_0x5be5('0x25')](saveUpdates(_0x4f8fac['body'],null))[_0x5be5('0x25')](respondWithResult(_0x20f1ae,null))[_0x5be5('0x43')](handleError(_0x20f1ae,null));};exports[_0x5be5('0x4b')]=function(_0x236154,_0x23dbf8){return db[_0x5be5('0x2c')][_0x5be5('0x47')]({'where':{'id':_0x236154[_0x5be5('0x44')]['id']}})[_0x5be5('0x25')](handleEntityNotFound(_0x23dbf8,null))[_0x5be5('0x25')](removeEntity(_0x23dbf8,null))['catch'](handleError(_0x23dbf8,null));};exports[_0x5be5('0x4c')]=function(_0x1173b7,_0x3ecbda,_0x33a2d7){var _0x2c6423={};var _0x12d7c8={};var _0x2a1f95;var _0x67288c;return db[_0x5be5('0x2c')]['findOne']({'where':{'id':_0x1173b7[_0x5be5('0x44')]['id']}})[_0x5be5('0x25')](handleEntityNotFound(_0x3ecbda,null))[_0x5be5('0x25')](function(_0x5ddad7){if(_0x5ddad7){_0x2a1f95=_0x5ddad7;_0x12d7c8[_0x5be5('0x31')]=_[_0x5be5('0x45')](db[_0x5be5('0x4d')][_0x5be5('0x2d')]);_0x12d7c8[_0x5be5('0x32')]=_[_0x5be5('0x45')](_0x1173b7[_0x5be5('0x32')]);_0x12d7c8['filters']=_[_0x5be5('0x34')](_0x12d7c8[_0x5be5('0x31')],_0x12d7c8[_0x5be5('0x32')]);_0x2c6423[_0x5be5('0x35')]=_['intersection'](_0x12d7c8[_0x5be5('0x31')],qs[_0x5be5('0x36')](_0x1173b7[_0x5be5('0x32')][_0x5be5('0x36')]));_0x2c6423[_0x5be5('0x35')]=_0x2c6423[_0x5be5('0x35')][_0x5be5('0x37')]?_0x2c6423['attributes']:_0x12d7c8[_0x5be5('0x31')];_0x2c6423[_0x5be5('0x3a')]=qs[_0x5be5('0x3b')](_0x1173b7['query'][_0x5be5('0x3b')]);_0x2c6423['where']=qs[_0x5be5('0x33')](_[_0x5be5('0x3c')](_0x1173b7[_0x5be5('0x32')],_0x12d7c8['filters']));if(_0x1173b7[_0x5be5('0x32')][_0x5be5('0x4e')]){_0x2c6423['where']=_['merge'](_0x2c6423[_0x5be5('0x3d')],{'$or':_[_0x5be5('0x2b')](_0x2c6423[_0x5be5('0x35')],function(_0x5349f4){var _0x5da6a4={};_0x5da6a4[_0x5349f4]={'$like':'%'+_0x1173b7[_0x5be5('0x32')][_0x5be5('0x4e')]+'%'};return _0x5da6a4;})});}_0x2c6423=_[_0x5be5('0x3f')]({},_0x2c6423,_0x1173b7[_0x5be5('0x40')]);return _0x2a1f95[_0x5be5('0x4c')](_0x2c6423);}})[_0x5be5('0x25')](function(_0x45081a){if(_0x45081a){_0x67288c=_0x45081a['length'];if(!_0x1173b7[_0x5be5('0x32')]['hasOwnProperty']('nolimit')){_0x2c6423['limit']=qs[_0x5be5('0x20')](_0x1173b7[_0x5be5('0x32')]['limit']);_0x2c6423['offset']=qs[_0x5be5('0x22')](_0x1173b7[_0x5be5('0x32')]['offset']);}return _0x2a1f95[_0x5be5('0x4c')](_0x2c6423);}})[_0x5be5('0x25')](function(_0x3b0e68){if(_0x3b0e68){return _0x3b0e68?{'count':_0x67288c,'rows':_0x3b0e68}:null;}})[_0x5be5('0x25')](respondWithResult(_0x3ecbda,null))['catch'](handleError(_0x3ecbda,null));};exports[_0x5be5('0x4f')]=function(_0x33f5a1,_0x2932cd,_0x238031){if(_0x33f5a1[_0x5be5('0x49')]['id']){delete _0x33f5a1[_0x5be5('0x49')]['id'];}return db[_0x5be5('0x2c')]['findOne']({'where':{'id':_0x33f5a1[_0x5be5('0x44')]['id']}})[_0x5be5('0x25')](handleEntityNotFound(_0x2932cd,null))[_0x5be5('0x25')](function(_0x5267c5){if(_0x5267c5){_0x33f5a1[_0x5be5('0x49')][_0x5be5('0x50')]=_0x5267c5['id'];_0x33f5a1['body']['Subjects']=integrations['getSubjects'](_0x33f5a1['body']['channel'],_0x33f5a1[_0x5be5('0x49')][_0x5be5('0x2f')]);_0x33f5a1['body'][_0x5be5('0x51')]=integrations[_0x5be5('0x52')](_0x33f5a1[_0x5be5('0x49')][_0x5be5('0x53')],_0x33f5a1[_0x5be5('0x49')]['type']);return db[_0x5be5('0x4d')][_0x5be5('0x48')](_0x33f5a1[_0x5be5('0x49')],{'include':[{'model':db[_0x5be5('0x54')],'as':_0x5be5('0x55')},{'model':db['VtigerField'],'as':_0x5be5('0x51')}]});}return null;})[_0x5be5('0x25')](respondWithResult(_0x2932cd,null))[_0x5be5('0x43')](handleError(_0x2932cd,null));};var md5=require('md5');exports[_0x5be5('0x56')]=function(_0x1a12ba,_0x4677ba,_0x5a8bae){var _0x3e9b18=null;var _0x34982f=null;var _0x4f0c66=null;var _0x51c35e=null;var _0x10f230='';return db[_0x5be5('0x2c')]['findOne']({'where':{'id':_0x1a12ba['params']['id']},'attributes':['id',_0x5be5('0x28'),'username',_0x5be5('0x57'),_0x5be5('0x58'),_0x5be5('0x59'),'serverUrl',_0x5be5('0x5a')]})[_0x5be5('0x25')](handleEntityNotFound(_0x4677ba,null))['then'](function(_0x19da4e){if(_0x19da4e){_0x3e9b18=_0x19da4e[_0x5be5('0x5b')];_0x34982f=_0x19da4e[_0x5be5('0x5a')];_0x4f0c66=_0x19da4e['moduleName'];_0x10f230=_0x19da4e[_0x5be5('0x59')];var _0xbcd4e1=_0x10f230[_0x5be5('0x5c')](-0x1);if(_0xbcd4e1==='/'){_0x10f230=_0x10f230[_0x5be5('0x5d')](0x0,_0x10f230[_0x5be5('0x5e')](_0xbcd4e1));}_0x51c35e=util['format'](_0x5be5('0x5f'),_0x10f230);var _0x491cce={'method':'GET','uri':_0x51c35e,'qs':{'operation':'getchallenge','username':_0x19da4e['username']},'json':!![]};return rp(_0x491cce);}})[_0x5be5('0x25')](function(_0xea46a0){if(_0xea46a0[_0x5be5('0x60')]){var _0x5eea11={'method':_0x5be5('0x61'),'uri':_0x51c35e,'form':{'operation':_0x5be5('0x62'),'username':_0x3e9b18,'accessKey':md5(_0xea46a0[_0x5be5('0x63')][_0x5be5('0x64')]+_0x34982f)},'json':!![]};return rp(_0x5eea11);}})['then'](function(_0xe07478){if(_0xe07478['success']){var _0x557a62={'method':_0x5be5('0x65'),'uri':_0x51c35e,'qs':{'operation':_0x5be5('0x66'),'username':_0x3e9b18,'sessionName':_0xe07478[_0x5be5('0x63')]['sessionName'],'elementType':_0x4f0c66},'json':!![]};return rp(_0x557a62);}})[_0x5be5('0x25')](function(_0x233331){if(_0x233331[_0x5be5('0x60')]){var _0x1e2c9b=[_0x5be5('0x67'),'reference',_0x5be5('0x68')];_[_0x5be5('0x69')](_0x233331[_0x5be5('0x63')][_0x5be5('0x36')],function(_0x246d41){return _0x1e2c9b[_0x5be5('0x6a')](_0x246d41[_0x5be5('0x2f')][_0x5be5('0x28')]);});_['remove'](_0x233331[_0x5be5('0x63')][_0x5be5('0x36')],function(_0x51a66e){return _0x51a66e[_0x5be5('0x6b')]===_0x5be5('0x6c');});return{'count':_0x233331['result'][_0x5be5('0x36')]['length'],'rows':_[_0x5be5('0x2b')](_0x233331['result']['fields'],function(_0xd90646){return{'id':_0xd90646['name'],'name':_0xd90646[_0x5be5('0x6d')],'custom':_[_0x5be5('0x6e')](_0xd90646[_0x5be5('0x28')],'cf_')?!![]:![],'options':_0xd90646[_0x5be5('0x2f')]['name']===_0x5be5('0x6f')&&_0xd90646[_0x5be5('0x2f')][_0x5be5('0x70')][_0x5be5('0x37')]>0x0?_[_0x5be5('0x2b')](_0xd90646['type'][_0x5be5('0x70')],function(_0x1c17a9){return{'name':_0x1c17a9[_0x5be5('0x6d')],'value':_0x1c17a9[_0x5be5('0x71')]};}):[]};})};}})[_0x5be5('0x25')](respondWithResult(_0x4677ba,null))['catch'](function(_0xfbd393){console[_0x5be5('0x72')](_0x5be5('0x73')+_0xfbd393);var _0x334571=_0x1a12ba['query']['test']?0x1f4:_0xfbd393[_0x5be5('0x74')]||0x1f4;logger['error'](_0x5be5('0x75'),'getFields',_0x334571,JSON[_0x5be5('0x76')](_0xfbd393));delete _0xfbd393[_0x5be5('0x28')];if(_0x334571===0x191){_0x334571=0x190;}_0x4677ba[_0x5be5('0x1c')](_0x334571)['send'](_0x1a12ba[_0x5be5('0x32')][_0x5be5('0x77')]?{'message':_0x5be5('0x78'),'statusCode':_0xfbd393[_0x5be5('0x74')]}:_0xfbd393);});}; \ No newline at end of file +var _0xc259=['path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','keys','catch','create','body','find','getConfigurations','VtigerConfiguration','length','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','VtigerField','md5','username','description','moduleName','serverUrl','accessKey','remoteUri','slice','substring','lastIndexOf','GET','getchallenge','success','POST','login','result','token','describe','sessionName','autogenerated','owner','remove','false','label','startsWith','cf_','picklistValues','value','log','vTiger\x20error:\x20','test','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','statusCode','zip-dir','fast-json-patch','request-promise','moment','bluebird','util'];(function(_0x162246,_0x4e5038){var _0x32ac95=function(_0x22270b){while(--_0x22270b){_0x162246['push'](_0x162246['shift']());}};_0x32ac95(++_0x4e5038);}(_0xc259,0x16e));var _0x9c25=function(_0x57c7cf,_0x1bb32f){_0x57c7cf=_0x57c7cf-0x0;var _0x335c10=_0xc259[_0x57c7cf];return _0x335c10;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9c25('0x0'));var jsonpatch=require(_0x9c25('0x1'));var rp=require(_0x9c25('0x2'));var moment=require(_0x9c25('0x3'));var BPromise=require(_0x9c25('0x4'));var Mustache=require('mustache');var util=require(_0x9c25('0x5'));var path=require(_0x9c25('0x6'));var sox=require(_0x9c25('0x7'));var csv=require(_0x9c25('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9c25('0x9'));var _=require(_0x9c25('0xa'));var squel=require(_0x9c25('0xb'));var crypto=require(_0x9c25('0xc'));var jsforce=require(_0x9c25('0xd'));var deskjs=require(_0x9c25('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9c25('0xf'));var Papa=require(_0x9c25('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9c25('0x11'));var as=require(_0x9c25('0x12'));var hardwareService=require(_0x9c25('0x13'));var logger=require(_0x9c25('0x14'))(_0x9c25('0x15'));var utils=require(_0x9c25('0x16'));var config=require(_0x9c25('0x17'));var licenseUtil=require(_0x9c25('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x9c25('0x19'));function respondWithStatusCode(_0x138063,_0xfeb517){_0xfeb517=_0xfeb517||0xcc;return function(_0x1608d3){if(_0x1608d3){return _0x138063['sendStatus'](_0xfeb517);}return _0x138063[_0x9c25('0x1a')](_0xfeb517)[_0x9c25('0x1b')]();};}function respondWithResult(_0xb634d6,_0x433a71){_0x433a71=_0x433a71||0xc8;return function(_0x4bf79e){if(_0x4bf79e){return _0xb634d6[_0x9c25('0x1a')](_0x433a71)[_0x9c25('0x1c')](_0x4bf79e);}};}function respondWithFilteredResult(_0x110e9d,_0x34d3dc){return function(_0xb49147){if(_0xb49147){var _0x1283b1=typeof _0x34d3dc[_0x9c25('0x1d')]===_0x9c25('0x1e')&&typeof _0x34d3dc[_0x9c25('0x1f')]===_0x9c25('0x1e');var _0x19eab9=_0xb49147['count'];var _0x2e3070=_0x1283b1?0x0:_0x34d3dc[_0x9c25('0x1d')];var _0x3da89f=_0x1283b1?_0xb49147[_0x9c25('0x20')]:_0x34d3dc[_0x9c25('0x1d')]+_0x34d3dc['limit'];var _0x3a9482;if(_0x3da89f>=_0x19eab9){_0x3da89f=_0x19eab9;_0x3a9482=0xc8;}else{_0x3a9482=0xce;}_0x110e9d[_0x9c25('0x1a')](_0x3a9482);return _0x110e9d['set'](_0x9c25('0x21'),_0x2e3070+'-'+_0x3da89f+'/'+_0x19eab9)['json'](_0xb49147);}return null;};}function patchUpdates(_0x3295a7){return function(_0x2c818e){try{jsonpatch[_0x9c25('0x22')](_0x2c818e,_0x3295a7,!![]);}catch(_0x57f07b){return BPromise[_0x9c25('0x23')](_0x57f07b);}return _0x2c818e[_0x9c25('0x24')]();};}function saveUpdates(_0x1ca1e9,_0x547342){return function(_0x482a11){if(_0x482a11){return _0x482a11[_0x9c25('0x25')](_0x1ca1e9)['then'](function(_0x3cd7bb){return _0x3cd7bb;});}return null;};}function removeEntity(_0x4b8602,_0x5c5c74){return function(_0x214e3f){if(_0x214e3f){return _0x214e3f[_0x9c25('0x26')]()[_0x9c25('0x27')](function(){_0x4b8602[_0x9c25('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x176986,_0x2b89ce){return function(_0x1ed60e){if(!_0x1ed60e){_0x176986['sendStatus'](0x194);}return _0x1ed60e;};}function handleError(_0x49c439,_0x139bf7){_0x139bf7=_0x139bf7||0x1f4;return function(_0x7ae2a7){logger[_0x9c25('0x28')](_0x7ae2a7[_0x9c25('0x29')]);if(_0x7ae2a7[_0x9c25('0x2a')]){delete _0x7ae2a7['name'];}_0x49c439[_0x9c25('0x1a')](_0x139bf7)[_0x9c25('0x2b')](_0x7ae2a7);};}exports[_0x9c25('0x2c')]=function(_0x17bcc4,_0x3e6e3d){var _0x17a6cc={},_0x4ad041={},_0x185b8b={'count':0x0,'rows':[]};var _0x148832=_[_0x9c25('0x2d')](db[_0x9c25('0x2e')][_0x9c25('0x2f')],function(_0x188e15){return{'name':_0x188e15[_0x9c25('0x30')],'type':_0x188e15[_0x9c25('0x31')][_0x9c25('0x32')]};});_0x4ad041[_0x9c25('0x33')]=_[_0x9c25('0x2d')](_0x148832,_0x9c25('0x2a'));_0x4ad041[_0x9c25('0x34')]=_['keys'](_0x17bcc4[_0x9c25('0x34')]);_0x4ad041['filters']=_[_0x9c25('0x35')](_0x4ad041[_0x9c25('0x33')],_0x4ad041[_0x9c25('0x34')]);_0x17a6cc['attributes']=_[_0x9c25('0x35')](_0x4ad041[_0x9c25('0x33')],qs[_0x9c25('0x36')](_0x17bcc4[_0x9c25('0x34')][_0x9c25('0x36')]));_0x17a6cc['attributes']=_0x17a6cc[_0x9c25('0x37')]['length']?_0x17a6cc[_0x9c25('0x37')]:_0x4ad041[_0x9c25('0x33')];if(!_0x17bcc4[_0x9c25('0x34')]['hasOwnProperty'](_0x9c25('0x38'))){_0x17a6cc[_0x9c25('0x1f')]=qs[_0x9c25('0x1f')](_0x17bcc4[_0x9c25('0x34')]['limit']);_0x17a6cc['offset']=qs[_0x9c25('0x1d')](_0x17bcc4[_0x9c25('0x34')][_0x9c25('0x1d')]);}_0x17a6cc[_0x9c25('0x39')]=qs[_0x9c25('0x3a')](_0x17bcc4['query'][_0x9c25('0x3a')]);_0x17a6cc[_0x9c25('0x3b')]=qs[_0x9c25('0x3c')](_[_0x9c25('0x3d')](_0x17bcc4[_0x9c25('0x34')],_0x4ad041[_0x9c25('0x3c')]),_0x148832);if(_0x17bcc4[_0x9c25('0x34')][_0x9c25('0x3e')]){_0x17a6cc[_0x9c25('0x3b')]=_[_0x9c25('0x3f')](_0x17a6cc[_0x9c25('0x3b')],{'$or':_[_0x9c25('0x2d')](_0x148832,function(_0x35d0d5){if(_0x35d0d5[_0x9c25('0x31')]!==_0x9c25('0x40')){var _0x4b8de9={};_0x4b8de9[_0x35d0d5[_0x9c25('0x2a')]]={'$like':'%'+_0x17bcc4[_0x9c25('0x34')][_0x9c25('0x3e')]+'%'};return _0x4b8de9;}})});}_0x17a6cc=_[_0x9c25('0x3f')]({},_0x17a6cc,_0x17bcc4[_0x9c25('0x41')]);var _0x356d12={'where':_0x17a6cc[_0x9c25('0x3b')]};return db[_0x9c25('0x2e')][_0x9c25('0x20')](_0x356d12)[_0x9c25('0x27')](function(_0x6f4be6){_0x185b8b[_0x9c25('0x20')]=_0x6f4be6;if(_0x17bcc4[_0x9c25('0x34')][_0x9c25('0x42')]){_0x17a6cc[_0x9c25('0x43')]=[{'all':!![]}];}return db[_0x9c25('0x2e')]['findAll'](_0x17a6cc);})['then'](function(_0x311493){_0x185b8b[_0x9c25('0x44')]=_0x311493;return _0x185b8b;})[_0x9c25('0x27')](respondWithFilteredResult(_0x3e6e3d,_0x17a6cc))['catch'](handleError(_0x3e6e3d,null));};exports[_0x9c25('0x45')]=function(_0x17a44b,_0x4e594a){var _0x58b231={'raw':![],'where':{'id':_0x17a44b[_0x9c25('0x46')]['id']}},_0x46eadc={};_0x46eadc['model']=_[_0x9c25('0x47')](db[_0x9c25('0x2e')][_0x9c25('0x2f')]);_0x46eadc[_0x9c25('0x34')]=_[_0x9c25('0x47')](_0x17a44b[_0x9c25('0x34')]);_0x46eadc[_0x9c25('0x3c')]=_[_0x9c25('0x35')](_0x46eadc[_0x9c25('0x33')],_0x46eadc[_0x9c25('0x34')]);_0x58b231['attributes']=_[_0x9c25('0x35')](_0x46eadc[_0x9c25('0x33')],qs[_0x9c25('0x36')](_0x17a44b[_0x9c25('0x34')][_0x9c25('0x36')]));_0x58b231[_0x9c25('0x37')]=_0x58b231[_0x9c25('0x37')]['length']?_0x58b231[_0x9c25('0x37')]:_0x46eadc[_0x9c25('0x33')];if(_0x17a44b['query'][_0x9c25('0x42')]){_0x58b231[_0x9c25('0x43')]=[{'all':!![]}];}_0x58b231=_[_0x9c25('0x3f')]({},_0x58b231,_0x17a44b[_0x9c25('0x41')]);return db[_0x9c25('0x2e')]['find'](_0x58b231)[_0x9c25('0x27')](handleEntityNotFound(_0x4e594a,null))[_0x9c25('0x27')](respondWithResult(_0x4e594a,null))[_0x9c25('0x48')](handleError(_0x4e594a,null));};exports[_0x9c25('0x49')]=function(_0x2021e7,_0x59497e){return db[_0x9c25('0x2e')][_0x9c25('0x49')](_0x2021e7['body'],{})[_0x9c25('0x27')](respondWithResult(_0x59497e,0xc9))['catch'](handleError(_0x59497e,null));};exports[_0x9c25('0x25')]=function(_0x23b985,_0x21ae22){if(_0x23b985['body']['id']){delete _0x23b985['body']['id'];}return db[_0x9c25('0x2e')]['find']({'where':{'id':_0x23b985[_0x9c25('0x46')]['id']}})[_0x9c25('0x27')](handleEntityNotFound(_0x21ae22,null))[_0x9c25('0x27')](saveUpdates(_0x23b985[_0x9c25('0x4a')],null))[_0x9c25('0x27')](respondWithResult(_0x21ae22,null))['catch'](handleError(_0x21ae22,null));};exports[_0x9c25('0x26')]=function(_0x2cbab5,_0x2fa99b){return db[_0x9c25('0x2e')][_0x9c25('0x4b')]({'where':{'id':_0x2cbab5[_0x9c25('0x46')]['id']}})[_0x9c25('0x27')](handleEntityNotFound(_0x2fa99b,null))[_0x9c25('0x27')](removeEntity(_0x2fa99b,null))[_0x9c25('0x48')](handleError(_0x2fa99b,null));};exports[_0x9c25('0x4c')]=function(_0x492f93,_0x44742f,_0x233230){var _0x17c15c={};var _0x3ffc5b={};var _0x21634c;var _0x873aa5;return db[_0x9c25('0x2e')]['findOne']({'where':{'id':_0x492f93[_0x9c25('0x46')]['id']}})[_0x9c25('0x27')](handleEntityNotFound(_0x44742f,null))[_0x9c25('0x27')](function(_0x476e15){if(_0x476e15){_0x21634c=_0x476e15;_0x3ffc5b[_0x9c25('0x33')]=_[_0x9c25('0x47')](db[_0x9c25('0x4d')][_0x9c25('0x2f')]);_0x3ffc5b[_0x9c25('0x34')]=_[_0x9c25('0x47')](_0x492f93['query']);_0x3ffc5b[_0x9c25('0x3c')]=_[_0x9c25('0x35')](_0x3ffc5b[_0x9c25('0x33')],_0x3ffc5b['query']);_0x17c15c[_0x9c25('0x37')]=_['intersection'](_0x3ffc5b['model'],qs['fields'](_0x492f93[_0x9c25('0x34')][_0x9c25('0x36')]));_0x17c15c[_0x9c25('0x37')]=_0x17c15c[_0x9c25('0x37')][_0x9c25('0x4e')]?_0x17c15c[_0x9c25('0x37')]:_0x3ffc5b[_0x9c25('0x33')];_0x17c15c[_0x9c25('0x39')]=qs[_0x9c25('0x3a')](_0x492f93[_0x9c25('0x34')][_0x9c25('0x3a')]);_0x17c15c[_0x9c25('0x3b')]=qs['filters'](_[_0x9c25('0x3d')](_0x492f93[_0x9c25('0x34')],_0x3ffc5b[_0x9c25('0x3c')]));if(_0x492f93[_0x9c25('0x34')]['filter']){_0x17c15c[_0x9c25('0x3b')]=_['merge'](_0x17c15c[_0x9c25('0x3b')],{'$or':_['map'](_0x17c15c['attributes'],function(_0x1e5d81){var _0x3a7ca9={};_0x3a7ca9[_0x1e5d81]={'$like':'%'+_0x492f93[_0x9c25('0x34')]['filter']+'%'};return _0x3a7ca9;})});}_0x17c15c=_[_0x9c25('0x3f')]({},_0x17c15c,_0x492f93['options']);return _0x21634c[_0x9c25('0x4c')](_0x17c15c);}})[_0x9c25('0x27')](function(_0x36128d){if(_0x36128d){_0x873aa5=_0x36128d[_0x9c25('0x4e')];if(!_0x492f93[_0x9c25('0x34')][_0x9c25('0x4f')](_0x9c25('0x38'))){_0x17c15c[_0x9c25('0x1f')]=qs[_0x9c25('0x1f')](_0x492f93[_0x9c25('0x34')]['limit']);_0x17c15c[_0x9c25('0x1d')]=qs[_0x9c25('0x1d')](_0x492f93['query'][_0x9c25('0x1d')]);}return _0x21634c[_0x9c25('0x4c')](_0x17c15c);}})[_0x9c25('0x27')](function(_0x292604){if(_0x292604){return _0x292604?{'count':_0x873aa5,'rows':_0x292604}:null;}})[_0x9c25('0x27')](respondWithResult(_0x44742f,null))[_0x9c25('0x48')](handleError(_0x44742f,null));};exports[_0x9c25('0x50')]=function(_0x371760,_0xb35348,_0x18d577){if(_0x371760[_0x9c25('0x4a')]['id']){delete _0x371760[_0x9c25('0x4a')]['id'];}return db[_0x9c25('0x2e')][_0x9c25('0x51')]({'where':{'id':_0x371760['params']['id']}})[_0x9c25('0x27')](handleEntityNotFound(_0xb35348,null))[_0x9c25('0x27')](function(_0x41ea02){if(_0x41ea02){_0x371760[_0x9c25('0x4a')][_0x9c25('0x52')]=_0x41ea02['id'];_0x371760[_0x9c25('0x4a')][_0x9c25('0x53')]=integrations[_0x9c25('0x54')](_0x371760[_0x9c25('0x4a')]['channel'],_0x371760[_0x9c25('0x4a')][_0x9c25('0x31')]);_0x371760[_0x9c25('0x4a')][_0x9c25('0x55')]=integrations[_0x9c25('0x56')](_0x371760[_0x9c25('0x4a')][_0x9c25('0x57')],_0x371760[_0x9c25('0x4a')][_0x9c25('0x31')]);return db['VtigerConfiguration'][_0x9c25('0x49')](_0x371760[_0x9c25('0x4a')],{'include':[{'model':db['VtigerField'],'as':_0x9c25('0x53')},{'model':db[_0x9c25('0x58')],'as':'Descriptions'}]});}return null;})[_0x9c25('0x27')](respondWithResult(_0xb35348,null))[_0x9c25('0x48')](handleError(_0xb35348,null));};var md5=require(_0x9c25('0x59'));exports['getFields']=function(_0x1c2875,_0x113f63,_0x5a539f){var _0x30715a=null;var _0x4a6580=null;var _0x3ea013=null;var _0x35d691=null;var _0x2d9d63='';return db[_0x9c25('0x2e')][_0x9c25('0x51')]({'where':{'id':_0x1c2875['params']['id']},'attributes':['id',_0x9c25('0x2a'),_0x9c25('0x5a'),_0x9c25('0x5b'),_0x9c25('0x5c'),'remoteUri',_0x9c25('0x5d'),_0x9c25('0x5e')]})['then'](handleEntityNotFound(_0x113f63,null))[_0x9c25('0x27')](function(_0x2f9c11){if(_0x2f9c11){_0x30715a=_0x2f9c11[_0x9c25('0x5a')];_0x4a6580=_0x2f9c11[_0x9c25('0x5e')];_0x3ea013=_0x2f9c11['moduleName'];_0x2d9d63=_0x2f9c11[_0x9c25('0x5f')];var _0x33bc61=_0x2d9d63[_0x9c25('0x60')](-0x1);if(_0x33bc61==='/'){_0x2d9d63=_0x2d9d63[_0x9c25('0x61')](0x0,_0x2d9d63[_0x9c25('0x62')](_0x33bc61));}_0x35d691=util['format']('%s/webservice.php',_0x2d9d63);var _0x1a7ee0={'method':_0x9c25('0x63'),'uri':_0x35d691,'qs':{'operation':_0x9c25('0x64'),'username':_0x2f9c11[_0x9c25('0x5a')]},'json':!![]};return rp(_0x1a7ee0);}})[_0x9c25('0x27')](function(_0x2d571){if(_0x2d571[_0x9c25('0x65')]){var _0x602076={'method':_0x9c25('0x66'),'uri':_0x35d691,'form':{'operation':_0x9c25('0x67'),'username':_0x30715a,'accessKey':md5(_0x2d571[_0x9c25('0x68')][_0x9c25('0x69')]+_0x4a6580)},'json':!![]};return rp(_0x602076);}})['then'](function(_0x26d483){if(_0x26d483[_0x9c25('0x65')]){var _0x176dca={'method':'GET','uri':_0x35d691,'qs':{'operation':_0x9c25('0x6a'),'username':_0x30715a,'sessionName':_0x26d483[_0x9c25('0x68')][_0x9c25('0x6b')],'elementType':_0x3ea013},'json':!![]};return rp(_0x176dca);}})[_0x9c25('0x27')](function(_0x869aef){if(_0x869aef['success']){var _0x4ea127=[_0x9c25('0x6c'),'reference',_0x9c25('0x6d')];_[_0x9c25('0x6e')](_0x869aef[_0x9c25('0x68')][_0x9c25('0x36')],function(_0x1276f3){return _0x4ea127['includes'](_0x1276f3[_0x9c25('0x31')][_0x9c25('0x2a')]);});_[_0x9c25('0x6e')](_0x869aef['result']['fields'],function(_0x321194){return _0x321194['editable']===_0x9c25('0x6f');});return{'count':_0x869aef[_0x9c25('0x68')][_0x9c25('0x36')][_0x9c25('0x4e')],'rows':_[_0x9c25('0x2d')](_0x869aef[_0x9c25('0x68')][_0x9c25('0x36')],function(_0x1635ad){return{'id':_0x1635ad[_0x9c25('0x2a')],'name':_0x1635ad[_0x9c25('0x70')],'custom':_[_0x9c25('0x71')](_0x1635ad[_0x9c25('0x2a')],_0x9c25('0x72'))?!![]:![],'options':_0x1635ad[_0x9c25('0x31')][_0x9c25('0x2a')]==='picklist'&&_0x1635ad['type']['picklistValues'][_0x9c25('0x4e')]>0x0?_[_0x9c25('0x2d')](_0x1635ad['type'][_0x9c25('0x73')],function(_0x400e25){return{'name':_0x400e25[_0x9c25('0x70')],'value':_0x400e25[_0x9c25('0x74')]};}):[]};})};}})[_0x9c25('0x27')](respondWithResult(_0x113f63,null))[_0x9c25('0x48')](function(_0x4af10b){console[_0x9c25('0x75')](_0x9c25('0x76')+_0x4af10b);var _0x2d70cd=_0x1c2875[_0x9c25('0x34')][_0x9c25('0x77')]?0x1f4:_0x4af10b['statusCode']||0x1f4;logger[_0x9c25('0x28')](_0x9c25('0x78'),_0x9c25('0x79'),_0x2d70cd,JSON['stringify'](_0x4af10b));delete _0x4af10b[_0x9c25('0x2a')];if(_0x2d70cd===0x191){_0x2d70cd=0x190;}_0x113f63[_0x9c25('0x1a')](_0x2d70cd)[_0x9c25('0x2b')](_0x1c2875['query'][_0x9c25('0x77')]?{'message':_0x9c25('0x7a'),'statusCode':_0x4af10b[_0x9c25('0x7b')]}:_0x4af10b);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 5f2d135..987240e 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 _0x8212=['int_vtiger_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define'];(function(_0x171dd9,_0x143a71){var _0x937ee6=function(_0x4dbb3f){while(--_0x4dbb3f){_0x171dd9['push'](_0x171dd9['shift']());}};_0x937ee6(++_0x143a71);}(_0x8212,0x1d5));var _0x2821=function(_0x45fa67,_0x54f9c8){_0x45fa67=_0x45fa67-0x0;var _0x2eddaf=_0x8212[_0x45fa67];return _0x2eddaf;};'use strict';var _=require(_0x2821('0x0'));var util=require(_0x2821('0x1'));var logger=require(_0x2821('0x2'))(_0x2821('0x3'));var moment=require(_0x2821('0x4'));var BPromise=require(_0x2821('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2821('0x6'));var rimraf=require(_0x2821('0x7'));var config=require(_0x2821('0x8'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x2821('0x9'));module[_0x2821('0xa')]=function(_0x14bc76,_0x8aa326){return _0x14bc76[_0x2821('0xb')]('VtigerAccount',attributes,{'tableName':_0x2821('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5366=['../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','api','moment','path','rimraf'];(function(_0x3dbe73,_0x3fc9f0){var _0x12106c=function(_0x36cf4f){while(--_0x36cf4f){_0x3dbe73['push'](_0x3dbe73['shift']());}};_0x12106c(++_0x3fc9f0);}(_0x5366,0x13b));var _0x6536=function(_0x3e2fcf,_0x579110){_0x3e2fcf=_0x3e2fcf-0x0;var _0x497db7=_0x5366[_0x3e2fcf];return _0x497db7;};'use strict';var _=require(_0x6536('0x0'));var util=require(_0x6536('0x1'));var logger=require(_0x6536('0x2'))(_0x6536('0x3'));var moment=require(_0x6536('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6536('0x5'));var rimraf=require(_0x6536('0x6'));var config=require(_0x6536('0x7'));var attributes=require(_0x6536('0x8'));var integrations=require(_0x6536('0x9'));module[_0x6536('0xa')]=function(_0x218393,_0x458541){return _0x218393[_0x6536('0xb')](_0x6536('0xc'),attributes,{'tableName':_0x6536('0xd'),'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 8ea7d2a..57e3899 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 _0x34b7=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes','map','include','model','then','ShowVtigerAccount','find','moment','bluebird'];(function(_0x1fe390,_0x166ff8){var _0x2fc907=function(_0x1c6bdf){while(--_0x1c6bdf){_0x1fe390['push'](_0x1fe390['shift']());}};_0x2fc907(++_0x166ff8);}(_0x34b7,0x196));var _0x734b=function(_0x24f66d,_0x261e88){_0x24f66d=_0x24f66d-0x0;var _0x147cdb=_0x34b7[_0x24f66d];return _0x147cdb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x734b('0x0'));var BPromise=require(_0x734b('0x1'));var rs=require(_0x734b('0x2'));var fs=require('fs');var Redis=require(_0x734b('0x3'));var db=require(_0x734b('0x4'))['db'];var utils=require(_0x734b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x734b('0x6'));var jayson=require(_0x734b('0x7'));var client=jayson[_0x734b('0x8')][_0x734b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x28918a,_0x35d685,_0x58e2f1){return new BPromise(function(_0x1eb803,_0x2e7932){return client['request'](_0x28918a,_0x58e2f1)['then'](function(_0x5f4b3a){logger[_0x734b('0xa')]('VtigerAccount,\x20%s,\x20%s',_0x35d685,_0x734b('0xb'));logger[_0x734b('0xc')](_0x734b('0xd'),_0x35d685,_0x734b('0xb'),JSON[_0x734b('0xe')](_0x5f4b3a));if(_0x5f4b3a[_0x734b('0xf')]){if(_0x5f4b3a[_0x734b('0xf')][_0x734b('0x10')]===0x1f4){logger[_0x734b('0xf')](_0x734b('0x11'),_0x35d685,_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);return _0x2e7932(_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);}logger['error'](_0x734b('0x11'),_0x35d685,_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);return _0x1eb803(_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);}else{logger[_0x734b('0xa')](_0x734b('0x11'),_0x35d685,_0x734b('0xb'));_0x1eb803(_0x5f4b3a[_0x734b('0x13')][_0x734b('0x12')]);}})[_0x734b('0x14')](function(_0x4d2d23){logger[_0x734b('0xf')](_0x734b('0x11'),_0x35d685,_0x4d2d23);_0x2e7932(_0x4d2d23);});});}exports[_0x734b('0x15')]=function(_0x5edbe9){var _0x4d3b9c=this;return new Promise(function(_0x56a95c,_0xcd12a1){return db[_0x734b('0x16')][_0x734b('0x17')]({'raw':_0x5edbe9[_0x734b('0x18')]?_0x5edbe9[_0x734b('0x18')][_0x734b('0x19')]===undefined?!![]:![]:!![],'where':_0x5edbe9[_0x734b('0x18')]?_0x5edbe9[_0x734b('0x18')][_0x734b('0x1a')]||null:null,'attributes':_0x5edbe9[_0x734b('0x18')]?_0x5edbe9[_0x734b('0x18')][_0x734b('0x1b')]||null:null,'limit':_0x5edbe9[_0x734b('0x18')]?_0x5edbe9[_0x734b('0x18')]['limit']||null:null,'include':_0x5edbe9[_0x734b('0x18')]?_0x5edbe9[_0x734b('0x18')]['include']?_[_0x734b('0x1c')](_0x5edbe9[_0x734b('0x18')][_0x734b('0x1d')],function(_0x11fb8e){return{'model':db[_0x11fb8e[_0x734b('0x1e')]],'as':_0x11fb8e['as'],'attributes':_0x11fb8e[_0x734b('0x1b')],'include':_0x11fb8e[_0x734b('0x1d')]?_[_0x734b('0x1c')](_0x11fb8e[_0x734b('0x1d')],function(_0x3abbe6){return{'model':db[_0x3abbe6[_0x734b('0x1e')]],'as':_0x3abbe6['as'],'attributes':_0x3abbe6[_0x734b('0x1b')],'include':_0x3abbe6[_0x734b('0x1d')]?_['map'](_0x3abbe6['include'],function(_0x13cc5a){return{'model':db[_0x13cc5a[_0x734b('0x1e')]],'as':_0x13cc5a['as'],'attributes':_0x13cc5a['attributes']};}):[]};}):[]};}):[]:[]})[_0x734b('0x1f')](function(_0x2dd51a){logger[_0x734b('0xa')](_0x734b('0x15'),_0x5edbe9);logger[_0x734b('0xc')](_0x734b('0x15'),_0x5edbe9,JSON[_0x734b('0xe')](_0x2dd51a));_0x56a95c(_0x2dd51a);})['catch'](function(_0x1f3652){logger[_0x734b('0xf')](_0x734b('0x15'),_0x1f3652[_0x734b('0x12')],_0x5edbe9);_0xcd12a1(_0x4d3b9c[_0x734b('0xf')](0x1f4,_0x1f3652[_0x734b('0x12')]));});});};exports[_0x734b('0x20')]=function(_0x21ed3c){var _0x371ead=this;return new Promise(function(_0x3065b0,_0x5dcabf){return db[_0x734b('0x16')][_0x734b('0x21')]({'raw':_0x21ed3c['options']?_0x21ed3c[_0x734b('0x18')][_0x734b('0x19')]===undefined?!![]:![]:!![],'where':_0x21ed3c[_0x734b('0x18')]?_0x21ed3c[_0x734b('0x18')][_0x734b('0x1a')]||null:null,'attributes':_0x21ed3c[_0x734b('0x18')]?_0x21ed3c[_0x734b('0x18')][_0x734b('0x1b')]||null:null,'include':_0x21ed3c[_0x734b('0x18')]?_0x21ed3c[_0x734b('0x18')][_0x734b('0x1d')]?_[_0x734b('0x1c')](_0x21ed3c[_0x734b('0x18')][_0x734b('0x1d')],function(_0x4512fc){return{'model':db[_0x4512fc['model']],'as':_0x4512fc['as'],'attributes':_0x4512fc[_0x734b('0x1b')],'include':_0x4512fc['include']?_[_0x734b('0x1c')](_0x4512fc[_0x734b('0x1d')],function(_0x3413bf){return{'model':db[_0x3413bf[_0x734b('0x1e')]],'as':_0x3413bf['as'],'attributes':_0x3413bf[_0x734b('0x1b')],'include':_0x3413bf[_0x734b('0x1d')]?_['map'](_0x3413bf['include'],function(_0x3460a0){return{'model':db[_0x3460a0['model']],'as':_0x3460a0['as'],'attributes':_0x3460a0[_0x734b('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2de959){logger['info'](_0x734b('0x20'),_0x21ed3c);logger['debug'](_0x734b('0x20'),_0x21ed3c,JSON[_0x734b('0xe')](_0x2de959));_0x3065b0(_0x2de959);})[_0x734b('0x14')](function(_0x34a504){logger[_0x734b('0xf')](_0x734b('0x20'),_0x34a504[_0x734b('0x12')],_0x21ed3c);_0x5dcabf(_0x371ead['error'](0x1f4,_0x34a504[_0x734b('0x12')]));});});}; \ No newline at end of file +var _0x2547=['../../config/logger','../../config/environment','jayson/promise','client','http','request','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowVtigerAccount','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x19bd3c,_0x259168){var _0x5844ba=function(_0x37875c){while(--_0x37875c){_0x19bd3c['push'](_0x19bd3c['shift']());}};_0x5844ba(++_0x259168);}(_0x2547,0x1cd));var _0x7254=function(_0x4d879f,_0x2bbb87){_0x4d879f=_0x4d879f-0x0;var _0x5c9251=_0x2547[_0x4d879f];return _0x5c9251;};'use strict';var _=require('lodash');var util=require(_0x7254('0x0'));var moment=require(_0x7254('0x1'));var BPromise=require(_0x7254('0x2'));var rs=require(_0x7254('0x3'));var fs=require('fs');var Redis=require(_0x7254('0x4'));var db=require(_0x7254('0x5'))['db'];var utils=require(_0x7254('0x6'));var logger=require(_0x7254('0x7'))('rpc');var config=require(_0x7254('0x8'));var jayson=require(_0x7254('0x9'));var client=jayson[_0x7254('0xa')][_0x7254('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b845f,_0x253b1e,_0x6e3d84){return new BPromise(function(_0x395913,_0x5da1ec){return client[_0x7254('0xc')](_0x4b845f,_0x6e3d84)['then'](function(_0x50925f){logger['info'](_0x7254('0xd'),_0x253b1e,_0x7254('0xe'));logger[_0x7254('0xf')](_0x7254('0x10'),_0x253b1e,_0x7254('0xe'),JSON[_0x7254('0x11')](_0x50925f));if(_0x50925f['error']){if(_0x50925f[_0x7254('0x12')]['code']===0x1f4){logger[_0x7254('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x253b1e,_0x50925f[_0x7254('0x12')][_0x7254('0x13')]);return _0x5da1ec(_0x50925f[_0x7254('0x12')][_0x7254('0x13')]);}logger[_0x7254('0x12')](_0x7254('0xd'),_0x253b1e,_0x50925f[_0x7254('0x12')][_0x7254('0x13')]);return _0x395913(_0x50925f[_0x7254('0x12')][_0x7254('0x13')]);}else{logger[_0x7254('0x14')](_0x7254('0xd'),_0x253b1e,_0x7254('0xe'));_0x395913(_0x50925f['result'][_0x7254('0x13')]);}})[_0x7254('0x15')](function(_0xf47255){logger[_0x7254('0x12')](_0x7254('0xd'),_0x253b1e,_0xf47255);_0x5da1ec(_0xf47255);});});}exports[_0x7254('0x16')]=function(_0x2737e0){var _0x5dd23b=this;return new Promise(function(_0x1f48f6,_0x2283b7){return db[_0x7254('0x17')][_0x7254('0x18')]({'raw':_0x2737e0[_0x7254('0x19')]?_0x2737e0[_0x7254('0x19')][_0x7254('0x1a')]===undefined?!![]:![]:!![],'where':_0x2737e0[_0x7254('0x19')]?_0x2737e0[_0x7254('0x19')][_0x7254('0x1b')]||null:null,'attributes':_0x2737e0[_0x7254('0x19')]?_0x2737e0[_0x7254('0x19')][_0x7254('0x1c')]||null:null,'limit':_0x2737e0[_0x7254('0x19')]?_0x2737e0[_0x7254('0x19')][_0x7254('0x1d')]||null:null,'include':_0x2737e0[_0x7254('0x19')]?_0x2737e0[_0x7254('0x19')][_0x7254('0x1e')]?_[_0x7254('0x1f')](_0x2737e0[_0x7254('0x19')]['include'],function(_0x493bfd){return{'model':db[_0x493bfd[_0x7254('0x20')]],'as':_0x493bfd['as'],'attributes':_0x493bfd[_0x7254('0x1c')],'include':_0x493bfd[_0x7254('0x1e')]?_[_0x7254('0x1f')](_0x493bfd[_0x7254('0x1e')],function(_0x36b5d5){return{'model':db[_0x36b5d5[_0x7254('0x20')]],'as':_0x36b5d5['as'],'attributes':_0x36b5d5['attributes'],'include':_0x36b5d5[_0x7254('0x1e')]?_[_0x7254('0x1f')](_0x36b5d5[_0x7254('0x1e')],function(_0x494cdb){return{'model':db[_0x494cdb[_0x7254('0x20')]],'as':_0x494cdb['as'],'attributes':_0x494cdb['attributes']};}):[]};}):[]};}):[]:[]})[_0x7254('0x21')](function(_0x134a9e){logger['info'](_0x7254('0x16'),_0x2737e0);logger[_0x7254('0xf')]('GetVtigerAccount',_0x2737e0,JSON[_0x7254('0x11')](_0x134a9e));_0x1f48f6(_0x134a9e);})[_0x7254('0x15')](function(_0x37cb5c){logger[_0x7254('0x12')](_0x7254('0x16'),_0x37cb5c[_0x7254('0x13')],_0x2737e0);_0x2283b7(_0x5dd23b['error'](0x1f4,_0x37cb5c[_0x7254('0x13')]));});});};exports[_0x7254('0x22')]=function(_0x5569be){var _0x2f75ea=this;return new Promise(function(_0x1279cd,_0x2be5fc){return db['VtigerAccount'][_0x7254('0x23')]({'raw':_0x5569be[_0x7254('0x19')]?_0x5569be[_0x7254('0x19')][_0x7254('0x1a')]===undefined?!![]:![]:!![],'where':_0x5569be[_0x7254('0x19')]?_0x5569be[_0x7254('0x19')][_0x7254('0x1b')]||null:null,'attributes':_0x5569be['options']?_0x5569be[_0x7254('0x19')]['attributes']||null:null,'include':_0x5569be['options']?_0x5569be[_0x7254('0x19')][_0x7254('0x1e')]?_[_0x7254('0x1f')](_0x5569be[_0x7254('0x19')][_0x7254('0x1e')],function(_0x430420){return{'model':db[_0x430420[_0x7254('0x20')]],'as':_0x430420['as'],'attributes':_0x430420[_0x7254('0x1c')],'include':_0x430420[_0x7254('0x1e')]?_[_0x7254('0x1f')](_0x430420[_0x7254('0x1e')],function(_0x3b0abd){return{'model':db[_0x3b0abd[_0x7254('0x20')]],'as':_0x3b0abd['as'],'attributes':_0x3b0abd[_0x7254('0x1c')],'include':_0x3b0abd['include']?_[_0x7254('0x1f')](_0x3b0abd[_0x7254('0x1e')],function(_0x2ea976){return{'model':db[_0x2ea976[_0x7254('0x20')]],'as':_0x2ea976['as'],'attributes':_0x2ea976[_0x7254('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x140bb2){logger['info'](_0x7254('0x22'),_0x5569be);logger[_0x7254('0xf')](_0x7254('0x22'),_0x5569be,JSON[_0x7254('0x11')](_0x140bb2));_0x1279cd(_0x140bb2);})[_0x7254('0x15')](function(_0x4e6213){logger[_0x7254('0x12')]('ShowVtigerAccount',_0x4e6213[_0x7254('0x13')],_0x5569be);_0x2be5fc(_0x2f75ea[_0x7254('0x12')](0x1f4,_0x4e6213['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 7b5338f..6967ab9 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 _0xfa74=['fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x203372,_0x26e9d6){var _0x12ae1c=function(_0x226d89){while(--_0x226d89){_0x203372['push'](_0x203372['shift']());}};_0x12ae1c(++_0x26e9d6);}(_0xfa74,0x126));var _0x4fa7=function(_0x99181b,_0x7ec23a){_0x99181b=_0x99181b-0x0;var _0x31eb30=_0xfa74[_0x99181b];return _0x31eb30;};'use strict';var multer=require(_0x4fa7('0x0'));var util=require(_0x4fa7('0x1'));var path=require('path');var timeout=require(_0x4fa7('0x2'));var express=require(_0x4fa7('0x3'));var router=express[_0x4fa7('0x4')]();var fs_extra=require(_0x4fa7('0x5'));var auth=require(_0x4fa7('0x6'));var interaction=require(_0x4fa7('0x7'));var config=require('../../config/environment');var controller=require(_0x4fa7('0x8'));router[_0x4fa7('0x9')]('/',auth[_0x4fa7('0xa')](),controller[_0x4fa7('0xb')]);router['get'](_0x4fa7('0xc'),auth[_0x4fa7('0xa')](),controller['show']);router['get'](_0x4fa7('0xd'),auth[_0x4fa7('0xa')](),controller[_0x4fa7('0xe')]);router[_0x4fa7('0x9')]('/:id/subjects',auth[_0x4fa7('0xa')](),controller['getSubjects']);router['get']('/:id/descriptions',auth[_0x4fa7('0xa')](),controller[_0x4fa7('0xf')]);router[_0x4fa7('0x10')]('/',auth[_0x4fa7('0xa')](),controller[_0x4fa7('0x11')]);router[_0x4fa7('0x12')](_0x4fa7('0xc'),auth['isAuthenticated'](),controller[_0x4fa7('0x13')]);router[_0x4fa7('0x14')](_0x4fa7('0xc'),auth[_0x4fa7('0xa')](),controller[_0x4fa7('0x15')]);module[_0x4fa7('0x16')]=router; \ No newline at end of file +var _0xd5a9=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x14742a,_0x263c95){var _0x23c233=function(_0x3b04bb){while(--_0x3b04bb){_0x14742a['push'](_0x14742a['shift']());}};_0x23c233(++_0x263c95);}(_0xd5a9,0x8a));var _0x9d5a=function(_0x310648,_0x166d5c){_0x310648=_0x310648-0x0;var _0x98e886=_0xd5a9[_0x310648];return _0x98e886;};'use strict';var multer=require(_0x9d5a('0x0'));var util=require(_0x9d5a('0x1'));var path=require(_0x9d5a('0x2'));var timeout=require(_0x9d5a('0x3'));var express=require(_0x9d5a('0x4'));var router=express[_0x9d5a('0x5')]();var fs_extra=require(_0x9d5a('0x6'));var auth=require(_0x9d5a('0x7'));var interaction=require(_0x9d5a('0x8'));var config=require(_0x9d5a('0x9'));var controller=require('./intVtigerConfiguration.controller');router[_0x9d5a('0xa')]('/',auth[_0x9d5a('0xb')](),controller[_0x9d5a('0xc')]);router['get'](_0x9d5a('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x9d5a('0xa')](_0x9d5a('0xe'),auth[_0x9d5a('0xb')](),controller['getFields']);router['get']('/:id/subjects',auth[_0x9d5a('0xb')](),controller[_0x9d5a('0xf')]);router[_0x9d5a('0xa')](_0x9d5a('0x10'),auth[_0x9d5a('0xb')](),controller[_0x9d5a('0x11')]);router[_0x9d5a('0x12')]('/',auth[_0x9d5a('0xb')](),controller[_0x9d5a('0x13')]);router[_0x9d5a('0x14')](_0x9d5a('0xd'),auth[_0x9d5a('0xb')](),controller[_0x9d5a('0x15')]);router['delete'](_0x9d5a('0xd'),auth[_0x9d5a('0xb')](),controller[_0x9d5a('0x16')]);module[_0x9d5a('0x17')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index a5d6219..e078abc 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 _0x0efe=['sequelize','STRING'];(function(_0x3c0c51,_0x120f20){var _0x2442fe=function(_0x5e3c91){while(--_0x5e3c91){_0x3c0c51['push'](_0x3c0c51['shift']());}};_0x2442fe(++_0x120f20);}(_0x0efe,0x10e));var _0xe0ef=function(_0x2c14d9,_0x4180dd){_0x2c14d9=_0x2c14d9-0x0;var _0x6906e=_0x0efe[_0x2c14d9];return _0x6906e;};'use strict';var Sequelize=require(_0xe0ef('0x0'));module['exports']={'name':{'type':Sequelize[_0xe0ef('0x1')]},'description':{'type':Sequelize[_0xe0ef('0x1')]}}; \ No newline at end of file +var _0x3b9b=['exports','sequelize'];(function(_0x230248,_0x3ef2f8){var _0x25b1ae=function(_0x33a059){while(--_0x33a059){_0x230248['push'](_0x230248['shift']());}};_0x25b1ae(++_0x3ef2f8);}(_0x3b9b,0x1ef));var _0xb3b9=function(_0x36cc5e,_0x42dbde){_0x36cc5e=_0x36cc5e-0x0;var _0x100154=_0x3b9b[_0x36cc5e];return _0x100154;};'use strict';var Sequelize=require(_0xb3b9('0x0'));module[_0xb3b9('0x1')]={'name':{'type':Sequelize['STRING']},'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 eca88b7..8d0570e 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 _0x7aa0=['fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','getFields','findOne','VtigerField','pick','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','sendStatus','error','name','send','map','VtigerConfiguration','rawAttributes'];(function(_0x4ed17b,_0x2b1745){var _0x24b248=function(_0x136ab1){while(--_0x136ab1){_0x4ed17b['push'](_0x4ed17b['shift']());}};_0x24b248(++_0x2b1745);}(_0x7aa0,0x1b9));var _0x07aa=function(_0x399040,_0x264ef9){_0x399040=_0x399040-0x0;var _0x368e1d=_0x7aa0[_0x399040];return _0x368e1d;};'use strict';var emlformat=require(_0x07aa('0x0'));var rimraf=require(_0x07aa('0x1'));var zipdir=require(_0x07aa('0x2'));var jsonpatch=require(_0x07aa('0x3'));var rp=require(_0x07aa('0x4'));var moment=require('moment');var BPromise=require(_0x07aa('0x5'));var Mustache=require(_0x07aa('0x6'));var util=require(_0x07aa('0x7'));var path=require(_0x07aa('0x8'));var sox=require(_0x07aa('0x9'));var csv=require(_0x07aa('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x07aa('0xb'));var _=require(_0x07aa('0xc'));var squel=require(_0x07aa('0xd'));var crypto=require(_0x07aa('0xe'));var jsforce=require(_0x07aa('0xf'));var deskjs=require(_0x07aa('0x10'));var toCsv=require(_0x07aa('0xa'));var querystring=require(_0x07aa('0x11'));var Papa=require('papaparse');var Redis=require(_0x07aa('0x12'));var authService=require(_0x07aa('0x13'));var qs=require(_0x07aa('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x07aa('0x15'));var logger=require(_0x07aa('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x07aa('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x07aa('0x18'))['db'];function respondWithStatusCode(_0x1009d5,_0x535faa){_0x535faa=_0x535faa||0xcc;return function(_0x258e9f){if(_0x258e9f){return _0x1009d5['sendStatus'](_0x535faa);}return _0x1009d5[_0x07aa('0x19')](_0x535faa)[_0x07aa('0x1a')]();};}function respondWithResult(_0x54047d,_0x99f53c){_0x99f53c=_0x99f53c||0xc8;return function(_0x51f5f3){if(_0x51f5f3){return _0x54047d['status'](_0x99f53c)[_0x07aa('0x1b')](_0x51f5f3);}};}function respondWithFilteredResult(_0x36cac4,_0x1034ec){return function(_0x18e93e){if(_0x18e93e){var _0x2c1e3b=typeof _0x1034ec['offset']===_0x07aa('0x1c')&&typeof _0x1034ec[_0x07aa('0x1d')]===_0x07aa('0x1c');var _0x426b2a=_0x18e93e[_0x07aa('0x1e')];var _0x34a89f=_0x2c1e3b?0x0:_0x1034ec['offset'];var _0x228c1f=_0x2c1e3b?_0x18e93e[_0x07aa('0x1e')]:_0x1034ec[_0x07aa('0x1f')]+_0x1034ec[_0x07aa('0x1d')];var _0xee0fec;if(_0x228c1f>=_0x426b2a){_0x228c1f=_0x426b2a;_0xee0fec=0xc8;}else{_0xee0fec=0xce;}_0x36cac4[_0x07aa('0x19')](_0xee0fec);return _0x36cac4[_0x07aa('0x20')](_0x07aa('0x21'),_0x34a89f+'-'+_0x228c1f+'/'+_0x426b2a)[_0x07aa('0x1b')](_0x18e93e);}return null;};}function patchUpdates(_0x1514c5){return function(_0x3b67c9){try{jsonpatch[_0x07aa('0x22')](_0x3b67c9,_0x1514c5,!![]);}catch(_0x433071){return BPromise['reject'](_0x433071);}return _0x3b67c9['save']();};}function saveUpdates(_0x3b4a66,_0x403b64){return function(_0xa2be5b){if(_0xa2be5b){return _0xa2be5b[_0x07aa('0x23')](_0x3b4a66)[_0x07aa('0x24')](function(_0x3b8fc8){return _0x3b8fc8;});}return null;};}function removeEntity(_0x6453e7,_0x5ed7fd){return function(_0x38578f){if(_0x38578f){return _0x38578f[_0x07aa('0x25')]()[_0x07aa('0x24')](function(){_0x6453e7[_0x07aa('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5175c8,_0x599680){return function(_0x4e11af){if(!_0x4e11af){_0x5175c8[_0x07aa('0x26')](0x194);}return _0x4e11af;};}function handleError(_0x39cf12,_0xdf0e11){_0xdf0e11=_0xdf0e11||0x1f4;return function(_0x412674){logger[_0x07aa('0x27')](_0x412674['stack']);if(_0x412674[_0x07aa('0x28')]){delete _0x412674[_0x07aa('0x28')];}_0x39cf12[_0x07aa('0x19')](_0xdf0e11)[_0x07aa('0x29')](_0x412674);};}exports['index']=function(_0x4920e2,_0xd73898){var _0x2a254d={},_0x5712ed={},_0x53ee43={'count':0x0,'rows':[]};var _0x2e8486=_[_0x07aa('0x2a')](db[_0x07aa('0x2b')][_0x07aa('0x2c')],function(_0x26d99a){return{'name':_0x26d99a[_0x07aa('0x2d')],'type':_0x26d99a[_0x07aa('0x2e')][_0x07aa('0x2f')]};});_0x5712ed['model']=_['map'](_0x2e8486,_0x07aa('0x28'));_0x5712ed[_0x07aa('0x30')]=_['keys'](_0x4920e2[_0x07aa('0x30')]);_0x5712ed[_0x07aa('0x31')]=_[_0x07aa('0x32')](_0x5712ed[_0x07aa('0x33')],_0x5712ed[_0x07aa('0x30')]);_0x2a254d['attributes']=_[_0x07aa('0x32')](_0x5712ed[_0x07aa('0x33')],qs[_0x07aa('0x34')](_0x4920e2[_0x07aa('0x30')][_0x07aa('0x34')]));_0x2a254d[_0x07aa('0x35')]=_0x2a254d[_0x07aa('0x35')][_0x07aa('0x36')]?_0x2a254d[_0x07aa('0x35')]:_0x5712ed[_0x07aa('0x33')];if(!_0x4920e2[_0x07aa('0x30')][_0x07aa('0x37')](_0x07aa('0x38'))){_0x2a254d['limit']=qs[_0x07aa('0x1d')](_0x4920e2[_0x07aa('0x30')][_0x07aa('0x1d')]);_0x2a254d['offset']=qs[_0x07aa('0x1f')](_0x4920e2[_0x07aa('0x30')][_0x07aa('0x1f')]);}_0x2a254d[_0x07aa('0x39')]=qs[_0x07aa('0x3a')](_0x4920e2[_0x07aa('0x30')][_0x07aa('0x3a')]);_0x2a254d[_0x07aa('0x3b')]=qs[_0x07aa('0x31')](_['pick'](_0x4920e2[_0x07aa('0x30')],_0x5712ed[_0x07aa('0x31')]),_0x2e8486);if(_0x4920e2[_0x07aa('0x30')][_0x07aa('0x3c')]){_0x2a254d['where']=_[_0x07aa('0x3d')](_0x2a254d['where'],{'$or':_[_0x07aa('0x2a')](_0x2e8486,function(_0x540554){if(_0x540554[_0x07aa('0x2e')]!==_0x07aa('0x3e')){var _0x4550ba={};_0x4550ba[_0x540554[_0x07aa('0x28')]]={'$like':'%'+_0x4920e2['query'][_0x07aa('0x3c')]+'%'};return _0x4550ba;}})});}_0x2a254d=_['merge']({},_0x2a254d,_0x4920e2[_0x07aa('0x3f')]);var _0x42a6c1={'where':_0x2a254d['where']};return db[_0x07aa('0x2b')][_0x07aa('0x1e')](_0x42a6c1)[_0x07aa('0x24')](function(_0x400b82){_0x53ee43[_0x07aa('0x1e')]=_0x400b82;if(_0x4920e2[_0x07aa('0x30')][_0x07aa('0x40')]){_0x2a254d[_0x07aa('0x41')]=[{'all':!![]}];}return db[_0x07aa('0x2b')][_0x07aa('0x42')](_0x2a254d);})['then'](function(_0x5e60a3){_0x53ee43[_0x07aa('0x43')]=_0x5e60a3;return _0x53ee43;})[_0x07aa('0x24')](respondWithFilteredResult(_0xd73898,_0x2a254d))[_0x07aa('0x44')](handleError(_0xd73898,null));};exports[_0x07aa('0x45')]=function(_0x4cbd1d,_0xee763b){var _0x2d2429={'raw':![],'where':{'id':_0x4cbd1d[_0x07aa('0x46')]['id']}},_0xf702ae={};_0xf702ae[_0x07aa('0x33')]=_[_0x07aa('0x47')](db[_0x07aa('0x2b')]['rawAttributes']);_0xf702ae[_0x07aa('0x30')]=_[_0x07aa('0x47')](_0x4cbd1d[_0x07aa('0x30')]);_0xf702ae[_0x07aa('0x31')]=_['intersection'](_0xf702ae[_0x07aa('0x33')],_0xf702ae[_0x07aa('0x30')]);_0x2d2429[_0x07aa('0x35')]=_[_0x07aa('0x32')](_0xf702ae['model'],qs['fields'](_0x4cbd1d[_0x07aa('0x30')][_0x07aa('0x34')]));_0x2d2429[_0x07aa('0x35')]=_0x2d2429['attributes'][_0x07aa('0x36')]?_0x2d2429[_0x07aa('0x35')]:_0xf702ae['model'];if(_0x4cbd1d[_0x07aa('0x30')]['includeAll']){_0x2d2429[_0x07aa('0x41')]=[{'all':!![]}];}_0x2d2429=_[_0x07aa('0x3d')]({},_0x2d2429,_0x4cbd1d[_0x07aa('0x3f')]);return db[_0x07aa('0x2b')]['find'](_0x2d2429)['then'](handleEntityNotFound(_0xee763b,null))[_0x07aa('0x24')](respondWithResult(_0xee763b,null))[_0x07aa('0x44')](handleError(_0xee763b,null));};exports[_0x07aa('0x48')]=function(_0x1c9522,_0xb46e87){return db['VtigerConfiguration'][_0x07aa('0x48')](_0x1c9522[_0x07aa('0x49')],{})[_0x07aa('0x24')](respondWithResult(_0xb46e87,0xc9))['catch'](handleError(_0xb46e87,null));};exports['update']=function(_0x13b4c6,_0x502749){if(_0x13b4c6[_0x07aa('0x49')]['id']){delete _0x13b4c6[_0x07aa('0x49')]['id'];}return db['VtigerConfiguration'][_0x07aa('0x4a')]({'where':{'id':_0x13b4c6['params']['id']}})[_0x07aa('0x24')](handleEntityNotFound(_0x502749,null))[_0x07aa('0x24')](saveUpdates(_0x13b4c6[_0x07aa('0x49')],null))[_0x07aa('0x24')](respondWithResult(_0x502749,null))[_0x07aa('0x44')](handleError(_0x502749,null));};exports['destroy']=function(_0x4c0005,_0x4efd86){return db[_0x07aa('0x2b')][_0x07aa('0x4a')]({'where':{'id':_0x4c0005[_0x07aa('0x46')]['id']}})['then'](handleEntityNotFound(_0x4efd86,null))[_0x07aa('0x24')](removeEntity(_0x4efd86,null))['catch'](handleError(_0x4efd86,null));};exports[_0x07aa('0x4b')]=function(_0x4ba6d3,_0x448bc6,_0x3a25c3){var _0x2220c5={};var _0x399a1f={};var _0x4d9637;var _0x5dfdaf;return db[_0x07aa('0x2b')][_0x07aa('0x4c')]({'where':{'id':_0x4ba6d3[_0x07aa('0x46')]['id']}})[_0x07aa('0x24')](handleEntityNotFound(_0x448bc6,null))[_0x07aa('0x24')](function(_0x4b8101){if(_0x4b8101){_0x4d9637=_0x4b8101;_0x399a1f['model']=_[_0x07aa('0x47')](db[_0x07aa('0x4d')][_0x07aa('0x2c')]);_0x399a1f[_0x07aa('0x30')]=_[_0x07aa('0x47')](_0x4ba6d3[_0x07aa('0x30')]);_0x399a1f[_0x07aa('0x31')]=_[_0x07aa('0x32')](_0x399a1f[_0x07aa('0x33')],_0x399a1f['query']);_0x2220c5[_0x07aa('0x35')]=_['intersection'](_0x399a1f[_0x07aa('0x33')],qs[_0x07aa('0x34')](_0x4ba6d3[_0x07aa('0x30')][_0x07aa('0x34')]));_0x2220c5['attributes']=_0x2220c5['attributes']['length']?_0x2220c5[_0x07aa('0x35')]:_0x399a1f['model'];_0x2220c5['order']=qs['sort'](_0x4ba6d3['query'][_0x07aa('0x3a')]);_0x2220c5[_0x07aa('0x3b')]=qs[_0x07aa('0x31')](_[_0x07aa('0x4e')](_0x4ba6d3[_0x07aa('0x30')],_0x399a1f[_0x07aa('0x31')]));if(_0x4ba6d3[_0x07aa('0x30')][_0x07aa('0x3c')]){_0x2220c5[_0x07aa('0x3b')]=_[_0x07aa('0x3d')](_0x2220c5[_0x07aa('0x3b')],{'$or':_[_0x07aa('0x2a')](_0x2220c5['attributes'],function(_0x47f7aa){var _0x2371d6={};_0x2371d6[_0x47f7aa]={'$like':'%'+_0x4ba6d3['query'][_0x07aa('0x3c')]+'%'};return _0x2371d6;})});}_0x2220c5=_[_0x07aa('0x3d')]({},_0x2220c5,_0x4ba6d3[_0x07aa('0x3f')]);return _0x4d9637[_0x07aa('0x4b')](_0x2220c5);}})[_0x07aa('0x24')](function(_0x4dc7a8){if(_0x4dc7a8){_0x5dfdaf=_0x4dc7a8[_0x07aa('0x36')];if(!_0x4ba6d3['query'][_0x07aa('0x37')](_0x07aa('0x38'))){_0x2220c5[_0x07aa('0x1d')]=qs['limit'](_0x4ba6d3['query']['limit']);_0x2220c5['offset']=qs[_0x07aa('0x1f')](_0x4ba6d3['query']['offset']);}return _0x4d9637[_0x07aa('0x4b')](_0x2220c5);}})[_0x07aa('0x24')](function(_0x4df15e){if(_0x4df15e){return _0x4df15e?{'count':_0x5dfdaf,'rows':_0x4df15e}:null;}})['then'](respondWithResult(_0x448bc6,null))['catch'](handleError(_0x448bc6,null));};exports[_0x07aa('0x4f')]=function(_0x531e58,_0x297759,_0x2cb429){var _0x58b9e9={};var _0x24d16b={};var _0x45c58e;var _0x332863;return db[_0x07aa('0x2b')][_0x07aa('0x4c')]({'where':{'id':_0x531e58['params']['id']}})[_0x07aa('0x24')](handleEntityNotFound(_0x297759,null))['then'](function(_0x93a8b7){if(_0x93a8b7){_0x45c58e=_0x93a8b7;_0x24d16b[_0x07aa('0x33')]=_['keys'](db[_0x07aa('0x4d')][_0x07aa('0x2c')]);_0x24d16b['query']=_[_0x07aa('0x47')](_0x531e58[_0x07aa('0x30')]);_0x24d16b['filters']=_[_0x07aa('0x32')](_0x24d16b[_0x07aa('0x33')],_0x24d16b[_0x07aa('0x30')]);_0x58b9e9['attributes']=_[_0x07aa('0x32')](_0x24d16b[_0x07aa('0x33')],qs[_0x07aa('0x34')](_0x531e58[_0x07aa('0x30')][_0x07aa('0x34')]));_0x58b9e9[_0x07aa('0x35')]=_0x58b9e9[_0x07aa('0x35')]['length']?_0x58b9e9['attributes']:_0x24d16b['model'];_0x58b9e9['order']=qs['sort'](_0x531e58[_0x07aa('0x30')][_0x07aa('0x3a')]);_0x58b9e9[_0x07aa('0x3b')]=qs['filters'](_['pick'](_0x531e58[_0x07aa('0x30')],_0x24d16b['filters']));if(_0x531e58[_0x07aa('0x30')][_0x07aa('0x3c')]){_0x58b9e9[_0x07aa('0x3b')]=_[_0x07aa('0x3d')](_0x58b9e9[_0x07aa('0x3b')],{'$or':_[_0x07aa('0x2a')](_0x58b9e9['attributes'],function(_0x3ccadd){var _0x598dac={};_0x598dac[_0x3ccadd]={'$like':'%'+_0x531e58[_0x07aa('0x30')][_0x07aa('0x3c')]+'%'};return _0x598dac;})});}_0x58b9e9=_[_0x07aa('0x3d')]({},_0x58b9e9,_0x531e58[_0x07aa('0x3f')]);return _0x45c58e[_0x07aa('0x4f')](_0x58b9e9);}})[_0x07aa('0x24')](function(_0x4d9bf0){if(_0x4d9bf0){_0x332863=_0x4d9bf0[_0x07aa('0x36')];if(!_0x531e58['query'][_0x07aa('0x37')](_0x07aa('0x38'))){_0x58b9e9[_0x07aa('0x1d')]=qs[_0x07aa('0x1d')](_0x531e58[_0x07aa('0x30')][_0x07aa('0x1d')]);_0x58b9e9[_0x07aa('0x1f')]=qs[_0x07aa('0x1f')](_0x531e58['query'][_0x07aa('0x1f')]);}return _0x45c58e[_0x07aa('0x4f')](_0x58b9e9);}})[_0x07aa('0x24')](function(_0x6765b7){if(_0x6765b7){return _0x6765b7?{'count':_0x332863,'rows':_0x6765b7}:null;}})['then'](respondWithResult(_0x297759,null))[_0x07aa('0x44')](handleError(_0x297759,null));};exports[_0x07aa('0x50')]=function(_0x5159f2,_0x4cb632,_0x2fcb59){var _0x5068be={};var _0x4969ef={};var _0x3870a7;var _0x1b304c;return db[_0x07aa('0x2b')][_0x07aa('0x4c')]({'where':{'id':_0x5159f2[_0x07aa('0x46')]['id']}})[_0x07aa('0x24')](handleEntityNotFound(_0x4cb632,null))[_0x07aa('0x24')](function(_0x222256){if(_0x222256){_0x3870a7=_0x222256;_0x4969ef[_0x07aa('0x33')]=_[_0x07aa('0x47')](db[_0x07aa('0x4d')]['rawAttributes']);_0x4969ef[_0x07aa('0x30')]=_[_0x07aa('0x47')](_0x5159f2[_0x07aa('0x30')]);_0x4969ef['filters']=_['intersection'](_0x4969ef[_0x07aa('0x33')],_0x4969ef[_0x07aa('0x30')]);_0x5068be['attributes']=_[_0x07aa('0x32')](_0x4969ef[_0x07aa('0x33')],qs['fields'](_0x5159f2['query'][_0x07aa('0x34')]));_0x5068be['attributes']=_0x5068be['attributes'][_0x07aa('0x36')]?_0x5068be['attributes']:_0x4969ef[_0x07aa('0x33')];_0x5068be[_0x07aa('0x39')]=qs[_0x07aa('0x3a')](_0x5159f2[_0x07aa('0x30')][_0x07aa('0x3a')]);_0x5068be[_0x07aa('0x3b')]=qs[_0x07aa('0x31')](_[_0x07aa('0x4e')](_0x5159f2[_0x07aa('0x30')],_0x4969ef['filters']));if(_0x5159f2[_0x07aa('0x30')]['filter']){_0x5068be[_0x07aa('0x3b')]=_[_0x07aa('0x3d')](_0x5068be[_0x07aa('0x3b')],{'$or':_[_0x07aa('0x2a')](_0x5068be[_0x07aa('0x35')],function(_0x1d4019){var _0x429100={};_0x429100[_0x1d4019]={'$like':'%'+_0x5159f2['query'][_0x07aa('0x3c')]+'%'};return _0x429100;})});}_0x5068be=_[_0x07aa('0x3d')]({},_0x5068be,_0x5159f2[_0x07aa('0x3f')]);return _0x3870a7[_0x07aa('0x50')](_0x5068be);}})['then'](function(_0x1c5ed1){if(_0x1c5ed1){_0x1b304c=_0x1c5ed1[_0x07aa('0x36')];if(!_0x5159f2[_0x07aa('0x30')][_0x07aa('0x37')](_0x07aa('0x38'))){_0x5068be[_0x07aa('0x1d')]=qs[_0x07aa('0x1d')](_0x5159f2[_0x07aa('0x30')][_0x07aa('0x1d')]);_0x5068be[_0x07aa('0x1f')]=qs[_0x07aa('0x1f')](_0x5159f2[_0x07aa('0x30')][_0x07aa('0x1f')]);}return _0x3870a7[_0x07aa('0x50')](_0x5068be);}})[_0x07aa('0x24')](function(_0x33ec64){if(_0x33ec64){return _0x33ec64?{'count':_0x1b304c,'rows':_0x33ec64}:null;}})[_0x07aa('0x24')](respondWithResult(_0x4cb632,null))['catch'](handleError(_0x4cb632,null));}; \ No newline at end of file +var _0xd1e4=['limit','set','Content-Range','reject','save','then','destroy','name','VtigerConfiguration','fieldName','type','key','map','query','filters','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','rows','catch','show','params','keys','rawAttributes','intersection','includeAll','include','body','update','find','getFields','findOne','length','getSubjects','VtigerField','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset'];(function(_0x352d28,_0x444033){var _0x387d7e=function(_0x40be0e){while(--_0x40be0e){_0x352d28['push'](_0x352d28['shift']());}};_0x387d7e(++_0x444033);}(_0xd1e4,0xc5));var _0x4d1e=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xd1e4[_0x1cc8fe];return _0x230054;};'use strict';var emlformat=require(_0x4d1e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4d1e('0x1'));var jsonpatch=require(_0x4d1e('0x2'));var rp=require(_0x4d1e('0x3'));var moment=require(_0x4d1e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4d1e('0x5'));var path=require(_0x4d1e('0x6'));var sox=require('sox');var csv=require(_0x4d1e('0x7'));var ejs=require(_0x4d1e('0x8'));var fs=require('fs');var fs_extra=require(_0x4d1e('0x9'));var _=require(_0x4d1e('0xa'));var squel=require(_0x4d1e('0xb'));var crypto=require(_0x4d1e('0xc'));var jsforce=require(_0x4d1e('0xd'));var deskjs=require(_0x4d1e('0xe'));var toCsv=require(_0x4d1e('0x7'));var querystring=require('querystring');var Papa=require(_0x4d1e('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4d1e('0x10'));var as=require(_0x4d1e('0x11'));var hardwareService=require(_0x4d1e('0x12'));var logger=require(_0x4d1e('0x13'))(_0x4d1e('0x14'));var utils=require(_0x4d1e('0x15'));var config=require(_0x4d1e('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1282c5,_0x543070){_0x543070=_0x543070||0xcc;return function(_0x4bb0df){if(_0x4bb0df){return _0x1282c5[_0x4d1e('0x17')](_0x543070);}return _0x1282c5[_0x4d1e('0x18')](_0x543070)[_0x4d1e('0x19')]();};}function respondWithResult(_0x53aec0,_0x31ce9d){_0x31ce9d=_0x31ce9d||0xc8;return function(_0x5c8421){if(_0x5c8421){return _0x53aec0[_0x4d1e('0x18')](_0x31ce9d)[_0x4d1e('0x1a')](_0x5c8421);}};}function respondWithFilteredResult(_0x3c36cd,_0x42e67e){return function(_0x453106){if(_0x453106){var _0x2f4f87=typeof _0x42e67e[_0x4d1e('0x1b')]==='undefined'&&typeof _0x42e67e[_0x4d1e('0x1c')]==='undefined';var _0x401623=_0x453106['count'];var _0x160985=_0x2f4f87?0x0:_0x42e67e[_0x4d1e('0x1b')];var _0x537193=_0x2f4f87?_0x453106['count']:_0x42e67e[_0x4d1e('0x1b')]+_0x42e67e[_0x4d1e('0x1c')];var _0x2d9d94;if(_0x537193>=_0x401623){_0x537193=_0x401623;_0x2d9d94=0xc8;}else{_0x2d9d94=0xce;}_0x3c36cd[_0x4d1e('0x18')](_0x2d9d94);return _0x3c36cd[_0x4d1e('0x1d')](_0x4d1e('0x1e'),_0x160985+'-'+_0x537193+'/'+_0x401623)['json'](_0x453106);}return null;};}function patchUpdates(_0x147935){return function(_0x322c5e){try{jsonpatch['apply'](_0x322c5e,_0x147935,!![]);}catch(_0x4f8e47){return BPromise[_0x4d1e('0x1f')](_0x4f8e47);}return _0x322c5e[_0x4d1e('0x20')]();};}function saveUpdates(_0x2c7a34,_0x415ce2){return function(_0x217e19){if(_0x217e19){return _0x217e19['update'](_0x2c7a34)[_0x4d1e('0x21')](function(_0x3d8b9b){return _0x3d8b9b;});}return null;};}function removeEntity(_0x2e3d5f,_0xfed69d){return function(_0xd57781){if(_0xd57781){return _0xd57781[_0x4d1e('0x22')]()[_0x4d1e('0x21')](function(){_0x2e3d5f['status'](0xcc)[_0x4d1e('0x19')]();});}};}function handleEntityNotFound(_0x44749f,_0x3e2851){return function(_0x2f3942){if(!_0x2f3942){_0x44749f[_0x4d1e('0x17')](0x194);}return _0x2f3942;};}function handleError(_0x305494,_0x2aa9b4){_0x2aa9b4=_0x2aa9b4||0x1f4;return function(_0x126b84){logger['error'](_0x126b84['stack']);if(_0x126b84[_0x4d1e('0x23')]){delete _0x126b84['name'];}_0x305494['status'](_0x2aa9b4)['send'](_0x126b84);};}exports['index']=function(_0xe1225,_0x11c303){var _0x3673c8={},_0x40261d={},_0x40d366={'count':0x0,'rows':[]};var _0x5221f2=_['map'](db[_0x4d1e('0x24')]['rawAttributes'],function(_0x40daf1){return{'name':_0x40daf1[_0x4d1e('0x25')],'type':_0x40daf1[_0x4d1e('0x26')][_0x4d1e('0x27')]};});_0x40261d['model']=_[_0x4d1e('0x28')](_0x5221f2,'name');_0x40261d[_0x4d1e('0x29')]=_['keys'](_0xe1225['query']);_0x40261d[_0x4d1e('0x2a')]=_['intersection'](_0x40261d[_0x4d1e('0x2b')],_0x40261d['query']);_0x3673c8[_0x4d1e('0x2c')]=_['intersection'](_0x40261d[_0x4d1e('0x2b')],qs[_0x4d1e('0x2d')](_0xe1225[_0x4d1e('0x29')][_0x4d1e('0x2d')]));_0x3673c8['attributes']=_0x3673c8['attributes']['length']?_0x3673c8[_0x4d1e('0x2c')]:_0x40261d[_0x4d1e('0x2b')];if(!_0xe1225[_0x4d1e('0x29')][_0x4d1e('0x2e')](_0x4d1e('0x2f'))){_0x3673c8[_0x4d1e('0x1c')]=qs[_0x4d1e('0x1c')](_0xe1225[_0x4d1e('0x29')][_0x4d1e('0x1c')]);_0x3673c8['offset']=qs[_0x4d1e('0x1b')](_0xe1225[_0x4d1e('0x29')][_0x4d1e('0x1b')]);}_0x3673c8[_0x4d1e('0x30')]=qs['sort'](_0xe1225[_0x4d1e('0x29')][_0x4d1e('0x31')]);_0x3673c8[_0x4d1e('0x32')]=qs['filters'](_[_0x4d1e('0x33')](_0xe1225[_0x4d1e('0x29')],_0x40261d[_0x4d1e('0x2a')]),_0x5221f2);if(_0xe1225['query'][_0x4d1e('0x34')]){_0x3673c8[_0x4d1e('0x32')]=_[_0x4d1e('0x35')](_0x3673c8[_0x4d1e('0x32')],{'$or':_['map'](_0x5221f2,function(_0x3cf58d){if(_0x3cf58d['type']!==_0x4d1e('0x36')){var _0x381725={};_0x381725[_0x3cf58d[_0x4d1e('0x23')]]={'$like':'%'+_0xe1225['query'][_0x4d1e('0x34')]+'%'};return _0x381725;}})});}_0x3673c8=_[_0x4d1e('0x35')]({},_0x3673c8,_0xe1225[_0x4d1e('0x37')]);var _0x3e9330={'where':_0x3673c8[_0x4d1e('0x32')]};return db[_0x4d1e('0x24')][_0x4d1e('0x38')](_0x3e9330)[_0x4d1e('0x21')](function(_0x29c2a1){_0x40d366['count']=_0x29c2a1;if(_0xe1225[_0x4d1e('0x29')]['includeAll']){_0x3673c8['include']=[{'all':!![]}];}return db[_0x4d1e('0x24')]['findAll'](_0x3673c8);})[_0x4d1e('0x21')](function(_0x21e180){_0x40d366[_0x4d1e('0x39')]=_0x21e180;return _0x40d366;})[_0x4d1e('0x21')](respondWithFilteredResult(_0x11c303,_0x3673c8))[_0x4d1e('0x3a')](handleError(_0x11c303,null));};exports[_0x4d1e('0x3b')]=function(_0x1f83d1,_0x47db86){var _0x288fd9={'raw':![],'where':{'id':_0x1f83d1[_0x4d1e('0x3c')]['id']}},_0x362e2f={};_0x362e2f[_0x4d1e('0x2b')]=_[_0x4d1e('0x3d')](db[_0x4d1e('0x24')][_0x4d1e('0x3e')]);_0x362e2f[_0x4d1e('0x29')]=_[_0x4d1e('0x3d')](_0x1f83d1['query']);_0x362e2f['filters']=_[_0x4d1e('0x3f')](_0x362e2f[_0x4d1e('0x2b')],_0x362e2f[_0x4d1e('0x29')]);_0x288fd9[_0x4d1e('0x2c')]=_[_0x4d1e('0x3f')](_0x362e2f['model'],qs[_0x4d1e('0x2d')](_0x1f83d1[_0x4d1e('0x29')][_0x4d1e('0x2d')]));_0x288fd9[_0x4d1e('0x2c')]=_0x288fd9[_0x4d1e('0x2c')]['length']?_0x288fd9[_0x4d1e('0x2c')]:_0x362e2f[_0x4d1e('0x2b')];if(_0x1f83d1[_0x4d1e('0x29')][_0x4d1e('0x40')]){_0x288fd9[_0x4d1e('0x41')]=[{'all':!![]}];}_0x288fd9=_[_0x4d1e('0x35')]({},_0x288fd9,_0x1f83d1[_0x4d1e('0x37')]);return db['VtigerConfiguration']['find'](_0x288fd9)[_0x4d1e('0x21')](handleEntityNotFound(_0x47db86,null))['then'](respondWithResult(_0x47db86,null))[_0x4d1e('0x3a')](handleError(_0x47db86,null));};exports['create']=function(_0x46028,_0x182a42){return db[_0x4d1e('0x24')]['create'](_0x46028[_0x4d1e('0x42')],{})['then'](respondWithResult(_0x182a42,0xc9))[_0x4d1e('0x3a')](handleError(_0x182a42,null));};exports[_0x4d1e('0x43')]=function(_0x3d70e0,_0x42d633){if(_0x3d70e0[_0x4d1e('0x42')]['id']){delete _0x3d70e0[_0x4d1e('0x42')]['id'];}return db['VtigerConfiguration'][_0x4d1e('0x44')]({'where':{'id':_0x3d70e0[_0x4d1e('0x3c')]['id']}})[_0x4d1e('0x21')](handleEntityNotFound(_0x42d633,null))[_0x4d1e('0x21')](saveUpdates(_0x3d70e0[_0x4d1e('0x42')],null))[_0x4d1e('0x21')](respondWithResult(_0x42d633,null))[_0x4d1e('0x3a')](handleError(_0x42d633,null));};exports[_0x4d1e('0x22')]=function(_0x3b996e,_0x427782){return db[_0x4d1e('0x24')][_0x4d1e('0x44')]({'where':{'id':_0x3b996e[_0x4d1e('0x3c')]['id']}})[_0x4d1e('0x21')](handleEntityNotFound(_0x427782,null))[_0x4d1e('0x21')](removeEntity(_0x427782,null))[_0x4d1e('0x3a')](handleError(_0x427782,null));};exports[_0x4d1e('0x45')]=function(_0x3d1628,_0x2d80e9,_0x34c122){var _0xc632af={};var _0x3a41a4={};var _0xd82daa;var _0x31536b;return db[_0x4d1e('0x24')][_0x4d1e('0x46')]({'where':{'id':_0x3d1628[_0x4d1e('0x3c')]['id']}})[_0x4d1e('0x21')](handleEntityNotFound(_0x2d80e9,null))[_0x4d1e('0x21')](function(_0x1480f1){if(_0x1480f1){_0xd82daa=_0x1480f1;_0x3a41a4[_0x4d1e('0x2b')]=_['keys'](db['VtigerField'][_0x4d1e('0x3e')]);_0x3a41a4[_0x4d1e('0x29')]=_[_0x4d1e('0x3d')](_0x3d1628[_0x4d1e('0x29')]);_0x3a41a4[_0x4d1e('0x2a')]=_['intersection'](_0x3a41a4['model'],_0x3a41a4['query']);_0xc632af['attributes']=_['intersection'](_0x3a41a4[_0x4d1e('0x2b')],qs['fields'](_0x3d1628[_0x4d1e('0x29')][_0x4d1e('0x2d')]));_0xc632af['attributes']=_0xc632af[_0x4d1e('0x2c')][_0x4d1e('0x47')]?_0xc632af['attributes']:_0x3a41a4[_0x4d1e('0x2b')];_0xc632af['order']=qs[_0x4d1e('0x31')](_0x3d1628['query'][_0x4d1e('0x31')]);_0xc632af[_0x4d1e('0x32')]=qs[_0x4d1e('0x2a')](_[_0x4d1e('0x33')](_0x3d1628['query'],_0x3a41a4[_0x4d1e('0x2a')]));if(_0x3d1628[_0x4d1e('0x29')][_0x4d1e('0x34')]){_0xc632af[_0x4d1e('0x32')]=_[_0x4d1e('0x35')](_0xc632af[_0x4d1e('0x32')],{'$or':_[_0x4d1e('0x28')](_0xc632af['attributes'],function(_0x1dc6f9){var _0x3a0248={};_0x3a0248[_0x1dc6f9]={'$like':'%'+_0x3d1628[_0x4d1e('0x29')][_0x4d1e('0x34')]+'%'};return _0x3a0248;})});}_0xc632af=_[_0x4d1e('0x35')]({},_0xc632af,_0x3d1628[_0x4d1e('0x37')]);return _0xd82daa[_0x4d1e('0x45')](_0xc632af);}})[_0x4d1e('0x21')](function(_0xe46ee8){if(_0xe46ee8){_0x31536b=_0xe46ee8['length'];if(!_0x3d1628['query'][_0x4d1e('0x2e')]('nolimit')){_0xc632af['limit']=qs[_0x4d1e('0x1c')](_0x3d1628[_0x4d1e('0x29')]['limit']);_0xc632af[_0x4d1e('0x1b')]=qs[_0x4d1e('0x1b')](_0x3d1628['query'][_0x4d1e('0x1b')]);}return _0xd82daa[_0x4d1e('0x45')](_0xc632af);}})['then'](function(_0x2dff4d){if(_0x2dff4d){return _0x2dff4d?{'count':_0x31536b,'rows':_0x2dff4d}:null;}})[_0x4d1e('0x21')](respondWithResult(_0x2d80e9,null))[_0x4d1e('0x3a')](handleError(_0x2d80e9,null));};exports[_0x4d1e('0x48')]=function(_0x48edce,_0x56176d,_0x1fad35){var _0x492c7c={};var _0x43c2f3={};var _0x2b82f1;var _0x126997;return db[_0x4d1e('0x24')][_0x4d1e('0x46')]({'where':{'id':_0x48edce[_0x4d1e('0x3c')]['id']}})['then'](handleEntityNotFound(_0x56176d,null))[_0x4d1e('0x21')](function(_0x465a02){if(_0x465a02){_0x2b82f1=_0x465a02;_0x43c2f3['model']=_['keys'](db[_0x4d1e('0x49')][_0x4d1e('0x3e')]);_0x43c2f3[_0x4d1e('0x29')]=_[_0x4d1e('0x3d')](_0x48edce[_0x4d1e('0x29')]);_0x43c2f3[_0x4d1e('0x2a')]=_[_0x4d1e('0x3f')](_0x43c2f3['model'],_0x43c2f3['query']);_0x492c7c[_0x4d1e('0x2c')]=_['intersection'](_0x43c2f3[_0x4d1e('0x2b')],qs['fields'](_0x48edce[_0x4d1e('0x29')][_0x4d1e('0x2d')]));_0x492c7c[_0x4d1e('0x2c')]=_0x492c7c[_0x4d1e('0x2c')][_0x4d1e('0x47')]?_0x492c7c[_0x4d1e('0x2c')]:_0x43c2f3[_0x4d1e('0x2b')];_0x492c7c[_0x4d1e('0x30')]=qs[_0x4d1e('0x31')](_0x48edce['query'][_0x4d1e('0x31')]);_0x492c7c['where']=qs[_0x4d1e('0x2a')](_[_0x4d1e('0x33')](_0x48edce[_0x4d1e('0x29')],_0x43c2f3['filters']));if(_0x48edce[_0x4d1e('0x29')][_0x4d1e('0x34')]){_0x492c7c[_0x4d1e('0x32')]=_[_0x4d1e('0x35')](_0x492c7c[_0x4d1e('0x32')],{'$or':_['map'](_0x492c7c[_0x4d1e('0x2c')],function(_0x111b0d){var _0x17ca90={};_0x17ca90[_0x111b0d]={'$like':'%'+_0x48edce[_0x4d1e('0x29')]['filter']+'%'};return _0x17ca90;})});}_0x492c7c=_['merge']({},_0x492c7c,_0x48edce[_0x4d1e('0x37')]);return _0x2b82f1[_0x4d1e('0x48')](_0x492c7c);}})[_0x4d1e('0x21')](function(_0x2aba8a){if(_0x2aba8a){_0x126997=_0x2aba8a[_0x4d1e('0x47')];if(!_0x48edce[_0x4d1e('0x29')][_0x4d1e('0x2e')](_0x4d1e('0x2f'))){_0x492c7c[_0x4d1e('0x1c')]=qs[_0x4d1e('0x1c')](_0x48edce[_0x4d1e('0x29')]['limit']);_0x492c7c[_0x4d1e('0x1b')]=qs[_0x4d1e('0x1b')](_0x48edce[_0x4d1e('0x29')][_0x4d1e('0x1b')]);}return _0x2b82f1[_0x4d1e('0x48')](_0x492c7c);}})[_0x4d1e('0x21')](function(_0x52790a){if(_0x52790a){return _0x52790a?{'count':_0x126997,'rows':_0x52790a}:null;}})[_0x4d1e('0x21')](respondWithResult(_0x56176d,null))[_0x4d1e('0x3a')](handleError(_0x56176d,null));};exports[_0x4d1e('0x4a')]=function(_0x218d55,_0x509654,_0x4e69e){var _0x31fa34={};var _0x36854c={};var _0x659d8;var _0x2c0c92;return db[_0x4d1e('0x24')][_0x4d1e('0x46')]({'where':{'id':_0x218d55['params']['id']}})[_0x4d1e('0x21')](handleEntityNotFound(_0x509654,null))[_0x4d1e('0x21')](function(_0x399649){if(_0x399649){_0x659d8=_0x399649;_0x36854c['model']=_[_0x4d1e('0x3d')](db[_0x4d1e('0x49')][_0x4d1e('0x3e')]);_0x36854c[_0x4d1e('0x29')]=_[_0x4d1e('0x3d')](_0x218d55[_0x4d1e('0x29')]);_0x36854c[_0x4d1e('0x2a')]=_[_0x4d1e('0x3f')](_0x36854c['model'],_0x36854c[_0x4d1e('0x29')]);_0x31fa34['attributes']=_[_0x4d1e('0x3f')](_0x36854c['model'],qs[_0x4d1e('0x2d')](_0x218d55[_0x4d1e('0x29')]['fields']));_0x31fa34[_0x4d1e('0x2c')]=_0x31fa34[_0x4d1e('0x2c')][_0x4d1e('0x47')]?_0x31fa34[_0x4d1e('0x2c')]:_0x36854c['model'];_0x31fa34['order']=qs[_0x4d1e('0x31')](_0x218d55[_0x4d1e('0x29')][_0x4d1e('0x31')]);_0x31fa34['where']=qs[_0x4d1e('0x2a')](_['pick'](_0x218d55[_0x4d1e('0x29')],_0x36854c['filters']));if(_0x218d55[_0x4d1e('0x29')][_0x4d1e('0x34')]){_0x31fa34[_0x4d1e('0x32')]=_['merge'](_0x31fa34['where'],{'$or':_[_0x4d1e('0x28')](_0x31fa34[_0x4d1e('0x2c')],function(_0x1bd50e){var _0x41f742={};_0x41f742[_0x1bd50e]={'$like':'%'+_0x218d55[_0x4d1e('0x29')][_0x4d1e('0x34')]+'%'};return _0x41f742;})});}_0x31fa34=_['merge']({},_0x31fa34,_0x218d55[_0x4d1e('0x37')]);return _0x659d8['getDescriptions'](_0x31fa34);}})[_0x4d1e('0x21')](function(_0x2b6c3f){if(_0x2b6c3f){_0x2c0c92=_0x2b6c3f[_0x4d1e('0x47')];if(!_0x218d55['query']['hasOwnProperty'](_0x4d1e('0x2f'))){_0x31fa34[_0x4d1e('0x1c')]=qs[_0x4d1e('0x1c')](_0x218d55['query'][_0x4d1e('0x1c')]);_0x31fa34['offset']=qs[_0x4d1e('0x1b')](_0x218d55[_0x4d1e('0x29')][_0x4d1e('0x1b')]);}return _0x659d8[_0x4d1e('0x4a')](_0x31fa34);}})[_0x4d1e('0x21')](function(_0x436f60){if(_0x436f60){return _0x436f60?{'count':_0x2c0c92,'rows':_0x436f60}:null;}})['then'](respondWithResult(_0x509654,null))[_0x4d1e('0x3a')](handleError(_0x509654,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 7578f2c..a9915e4 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 _0xcf81=['define','VtigerConfiguration','int_vtiger_configurations','lodash','util','api','bluebird','request-promise','../../config/environment'];(function(_0x5c0b13,_0x63fd29){var _0x1337fb=function(_0x941c7f){while(--_0x941c7f){_0x5c0b13['push'](_0x5c0b13['shift']());}};_0x1337fb(++_0x63fd29);}(_0xcf81,0x198));var _0x1cf8=function(_0x4bc9bd,_0x443400){_0x4bc9bd=_0x4bc9bd-0x0;var _0x2a8910=_0xcf81[_0x4bc9bd];return _0x2a8910;};'use strict';var _=require(_0x1cf8('0x0'));var util=require(_0x1cf8('0x1'));var logger=require('../../config/logger')(_0x1cf8('0x2'));var moment=require('moment');var BPromise=require(_0x1cf8('0x3'));var rp=require(_0x1cf8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1cf8('0x5'));var attributes=require('./intVtigerConfiguration.attributes');module['exports']=function(_0x5aab88,_0x2c7f4f){return _0x5aab88[_0x1cf8('0x6')](_0x1cf8('0x7'),attributes,{'tableName':_0x1cf8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4cd3=['bluebird','request-promise','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','api'];(function(_0x1f5857,_0x43b0b7){var _0x1d752a=function(_0x3c638f){while(--_0x3c638f){_0x1f5857['push'](_0x1f5857['shift']());}};_0x1d752a(++_0x43b0b7);}(_0x4cd3,0xbd));var _0x34cd=function(_0x117821,_0xaa1933){_0x117821=_0x117821-0x0;var _0x4ae9ff=_0x4cd3[_0x117821];return _0x4ae9ff;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x34cd('0x0'));var moment=require('moment');var BPromise=require(_0x34cd('0x1'));var rp=require(_0x34cd('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x34cd('0x3'));var config=require(_0x34cd('0x4'));var attributes=require(_0x34cd('0x5'));module[_0x34cd('0x6')]=function(_0x80d22d,_0x394a46){return _0x80d22d[_0x34cd('0x7')](_0x34cd('0x8'),attributes,{'tableName':_0x34cd('0x9'),'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 d15e1ce..a97baca 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 _0x446d=['VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0x446d,0x71));var _0xd446=function(_0x24853d,_0x16931f){_0x24853d=_0x24853d-0x0;var _0x4c5cff=_0x446d[_0x24853d];return _0x4c5cff;};'use strict';var _=require(_0xd446('0x0'));var util=require(_0xd446('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd446('0x2'));var fs=require('fs');var Redis=require(_0xd446('0x3'));var db=require(_0xd446('0x4'))['db'];var utils=require(_0xd446('0x5'));var logger=require(_0xd446('0x6'))(_0xd446('0x7'));var config=require(_0xd446('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd446('0x9')][_0xd446('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x346359,_0x4c9de5,_0x28fa3e){return new BPromise(function(_0x4cf8ee,_0x345415){return client[_0xd446('0xb')](_0x346359,_0x28fa3e)['then'](function(_0x296522){logger[_0xd446('0xc')](_0xd446('0xd'),_0x4c9de5,_0xd446('0xe'));logger[_0xd446('0xf')](_0xd446('0x10'),_0x4c9de5,_0xd446('0xe'),JSON['stringify'](_0x296522));if(_0x296522['error']){if(_0x296522[_0xd446('0x11')][_0xd446('0x12')]===0x1f4){logger['error'](_0xd446('0xd'),_0x4c9de5,_0x296522[_0xd446('0x11')][_0xd446('0x13')]);return _0x345415(_0x296522['error'][_0xd446('0x13')]);}logger[_0xd446('0x11')](_0xd446('0xd'),_0x4c9de5,_0x296522[_0xd446('0x11')][_0xd446('0x13')]);return _0x4cf8ee(_0x296522[_0xd446('0x11')]['message']);}else{logger[_0xd446('0xc')](_0xd446('0xd'),_0x4c9de5,_0xd446('0xe'));_0x4cf8ee(_0x296522['result'][_0xd446('0x13')]);}})[_0xd446('0x14')](function(_0x403ae9){logger['error'](_0xd446('0xd'),_0x4c9de5,_0x403ae9);_0x345415(_0x403ae9);});});} \ No newline at end of file +var _0xaaa4=['VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info'];(function(_0x1943fe,_0x4c8650){var _0x140bc6=function(_0x1e736d){while(--_0x1e736d){_0x1943fe['push'](_0x1943fe['shift']());}};_0x140bc6(++_0x4c8650);}(_0xaaa4,0x8d));var _0x4aaa=function(_0x2a8229,_0xa46401){_0x2a8229=_0x2a8229-0x0;var _0x524b55=_0xaaa4[_0x2a8229];return _0x524b55;};'use strict';var _=require(_0x4aaa('0x0'));var util=require(_0x4aaa('0x1'));var moment=require(_0x4aaa('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4aaa('0x3'));var db=require(_0x4aaa('0x4'))['db'];var utils=require(_0x4aaa('0x5'));var logger=require(_0x4aaa('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4aaa('0x7'));var client=jayson[_0x4aaa('0x8')][_0x4aaa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c1bcd,_0x483409,_0x217f82){return new BPromise(function(_0x410d3e,_0x1ff38){return client[_0x4aaa('0xa')](_0x4c1bcd,_0x217f82)[_0x4aaa('0xb')](function(_0x40927c){logger[_0x4aaa('0xc')](_0x4aaa('0xd'),_0x483409,_0x4aaa('0xe'));logger[_0x4aaa('0xf')](_0x4aaa('0x10'),_0x483409,_0x4aaa('0xe'),JSON[_0x4aaa('0x11')](_0x40927c));if(_0x40927c[_0x4aaa('0x12')]){if(_0x40927c[_0x4aaa('0x12')][_0x4aaa('0x13')]===0x1f4){logger[_0x4aaa('0x12')]('VtigerConfiguration,\x20%s,\x20%s',_0x483409,_0x40927c[_0x4aaa('0x12')]['message']);return _0x1ff38(_0x40927c[_0x4aaa('0x12')][_0x4aaa('0x14')]);}logger[_0x4aaa('0x12')](_0x4aaa('0xd'),_0x483409,_0x40927c[_0x4aaa('0x12')][_0x4aaa('0x14')]);return _0x410d3e(_0x40927c[_0x4aaa('0x12')][_0x4aaa('0x14')]);}else{logger[_0x4aaa('0xc')]('VtigerConfiguration,\x20%s,\x20%s',_0x483409,'request\x20sent');_0x410d3e(_0x40927c[_0x4aaa('0x15')][_0x4aaa('0x14')]);}})['catch'](function(_0x54b91e){logger[_0x4aaa('0x12')]('VtigerConfiguration,\x20%s,\x20%s',_0x483409,_0x54b91e);_0x1ff38(_0x54b91e);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 941bd03..cf2708f 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 _0xb6f4=['post','create','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','index','/:id','isAuthenticated','show'];(function(_0x1a9e2c,_0x790e8f){var _0x3cbe5e=function(_0x154f9f){while(--_0x154f9f){_0x1a9e2c['push'](_0x1a9e2c['shift']());}};_0x3cbe5e(++_0x790e8f);}(_0xb6f4,0xd9));var _0x4b6f=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xb6f4[_0x1b828b];return _0x98da1a;};'use strict';var multer=require('multer');var util=require(_0x4b6f('0x0'));var path=require(_0x4b6f('0x1'));var timeout=require('connect-timeout');var express=require(_0x4b6f('0x2'));var router=express[_0x4b6f('0x3')]();var fs_extra=require(_0x4b6f('0x4'));var auth=require(_0x4b6f('0x5'));var interaction=require(_0x4b6f('0x6'));var config=require(_0x4b6f('0x7'));var controller=require(_0x4b6f('0x8'));router[_0x4b6f('0x9')]('/',auth['isAuthenticated'](),controller[_0x4b6f('0xa')]);router['get'](_0x4b6f('0xb'),auth[_0x4b6f('0xc')](),controller[_0x4b6f('0xd')]);router[_0x4b6f('0xe')]('/',auth['isAuthenticated'](),controller[_0x4b6f('0xf')]);router[_0x4b6f('0x10')](_0x4b6f('0xb'),auth[_0x4b6f('0xc')](),controller[_0x4b6f('0x11')]);router[_0x4b6f('0x12')]('/:id',auth[_0x4b6f('0xc')](),controller[_0x4b6f('0x13')]);module[_0x4b6f('0x14')]=router; \ No newline at end of file +var _0x46ea=['create','put','update','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','/:id','show','post'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x46ea,0x1ba));var _0xa46e=function(_0x1b8f78,_0x2ff2cb){_0x1b8f78=_0x1b8f78-0x0;var _0x284476=_0x46ea[_0x1b8f78];return _0x284476;};'use strict';var multer=require(_0xa46e('0x0'));var util=require(_0xa46e('0x1'));var path=require(_0xa46e('0x2'));var timeout=require(_0xa46e('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa46e('0x4'));var auth=require(_0xa46e('0x5'));var interaction=require(_0xa46e('0x6'));var config=require(_0xa46e('0x7'));var controller=require(_0xa46e('0x8'));router[_0xa46e('0x9')]('/',auth[_0xa46e('0xa')](),controller['index']);router[_0xa46e('0x9')](_0xa46e('0xb'),auth['isAuthenticated'](),controller[_0xa46e('0xc')]);router[_0xa46e('0xd')]('/',auth[_0xa46e('0xa')](),controller[_0xa46e('0xe')]);router[_0xa46e('0xf')](_0xa46e('0xb'),auth[_0xa46e('0xa')](),controller[_0xa46e('0x10')]);router[_0xa46e('0x11')](_0xa46e('0xb'),auth[_0xa46e('0xa')](),controller['destroy']);module[_0xa46e('0x12')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index b567410..59cd3a2 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 _0x6ea6=['string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','ENUM'];(function(_0x562d1d,_0x3a7512){var _0x419147=function(_0x496a37){while(--_0x496a37){_0x562d1d['push'](_0x562d1d['shift']());}};_0x419147(++_0x3a7512);}(_0x6ea6,0x6e));var _0x66ea=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x6ea6[_0x29d94e];return _0x106237;};'use strict';var Sequelize=require(_0x66ea('0x0'));module['exports']={'type':{'type':Sequelize[_0x66ea('0x1')](_0x66ea('0x2'),_0x66ea('0x3'),_0x66ea('0x4'),_0x66ea('0x5'),'picklist'),'defaultValue':_0x66ea('0x2')},'content':{'type':Sequelize[_0x66ea('0x6')]},'key':{'type':Sequelize[_0x66ea('0x6')]},'keyType':{'type':Sequelize[_0x66ea('0x1')]('string',_0x66ea('0x3'),_0x66ea('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x66ea('0x6')]},'nameField':{'type':Sequelize[_0x66ea('0x6')]},'customField':{'type':Sequelize[_0x66ea('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x66ea('0x6')]}}; \ No newline at end of file +var _0xa519=['picklist','STRING','variable','BOOLEAN','sequelize','exports','ENUM','string','customVariable','keyValue'];(function(_0x1d4923,_0x4e222f){var _0x14ea9a=function(_0x54e138){while(--_0x54e138){_0x1d4923['push'](_0x1d4923['shift']());}};_0x14ea9a(++_0x4e222f);}(_0xa519,0x176));var _0x9a51=function(_0x3e2eb2,_0x1d2327){_0x3e2eb2=_0x3e2eb2-0x0;var _0xeb1bce=_0xa519[_0x3e2eb2];return _0xeb1bce;};'use strict';var Sequelize=require(_0x9a51('0x0'));module[_0x9a51('0x1')]={'type':{'type':Sequelize[_0x9a51('0x2')](_0x9a51('0x3'),'variable',_0x9a51('0x4'),_0x9a51('0x5'),_0x9a51('0x6')),'defaultValue':_0x9a51('0x3')},'content':{'type':Sequelize[_0x9a51('0x7')]},'key':{'type':Sequelize[_0x9a51('0x7')]},'keyType':{'type':Sequelize['ENUM']('string',_0x9a51('0x8'),_0x9a51('0x4'))},'keyContent':{'type':Sequelize[_0x9a51('0x7')]},'idField':{'type':Sequelize[_0x9a51('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x9a51('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9a51('0x7')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index b532662..2f4b465 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 _0x9378=['rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','VIRTUAL','merge','options','findAll','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','destroy','end','error','stack','name','index','VtigerField'];(function(_0x2bf66e,_0xfb08f0){var _0x10179b=function(_0x2da9cb){while(--_0x2da9cb){_0x2bf66e['push'](_0x2bf66e['shift']());}};_0x10179b(++_0xfb08f0);}(_0x9378,0xa9));var _0x8937=function(_0x483354,_0x139dd1){_0x483354=_0x483354-0x0;var _0x34b5ba=_0x9378[_0x483354];return _0x34b5ba;};'use strict';var emlformat=require(_0x8937('0x0'));var rimraf=require(_0x8937('0x1'));var zipdir=require(_0x8937('0x2'));var jsonpatch=require(_0x8937('0x3'));var rp=require(_0x8937('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8937('0x5'));var util=require(_0x8937('0x6'));var path=require(_0x8937('0x7'));var sox=require(_0x8937('0x8'));var csv=require(_0x8937('0x9'));var ejs=require(_0x8937('0xa'));var fs=require('fs');var fs_extra=require(_0x8937('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8937('0xc'));var jsforce=require(_0x8937('0xd'));var deskjs=require(_0x8937('0xe'));var toCsv=require(_0x8937('0x9'));var querystring=require('querystring');var Papa=require(_0x8937('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8937('0x10'));var as=require(_0x8937('0x11'));var hardwareService=require(_0x8937('0x12'));var logger=require(_0x8937('0x13'))(_0x8937('0x14'));var utils=require(_0x8937('0x15'));var config=require(_0x8937('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8937('0x17'))['db'];function respondWithStatusCode(_0x54ab5c,_0x25c5f5){_0x25c5f5=_0x25c5f5||0xcc;return function(_0x5379bc){if(_0x5379bc){return _0x54ab5c[_0x8937('0x18')](_0x25c5f5);}return _0x54ab5c[_0x8937('0x19')](_0x25c5f5)['end']();};}function respondWithResult(_0x2092d5,_0x5b1508){_0x5b1508=_0x5b1508||0xc8;return function(_0x38a552){if(_0x38a552){return _0x2092d5[_0x8937('0x19')](_0x5b1508)['json'](_0x38a552);}};}function respondWithFilteredResult(_0x400ecc,_0x29351d){return function(_0x211525){if(_0x211525){var _0x4f7dc7=typeof _0x29351d[_0x8937('0x1a')]===_0x8937('0x1b')&&typeof _0x29351d['limit']===_0x8937('0x1b');var _0x21f37d=_0x211525[_0x8937('0x1c')];var _0x5b25b2=_0x4f7dc7?0x0:_0x29351d[_0x8937('0x1a')];var _0x2b4437=_0x4f7dc7?_0x211525['count']:_0x29351d[_0x8937('0x1a')]+_0x29351d[_0x8937('0x1d')];var _0x26ca18;if(_0x2b4437>=_0x21f37d){_0x2b4437=_0x21f37d;_0x26ca18=0xc8;}else{_0x26ca18=0xce;}_0x400ecc[_0x8937('0x19')](_0x26ca18);return _0x400ecc[_0x8937('0x1e')](_0x8937('0x1f'),_0x5b25b2+'-'+_0x2b4437+'/'+_0x21f37d)[_0x8937('0x20')](_0x211525);}return null;};}function patchUpdates(_0xf53efa){return function(_0xe2da4f){try{jsonpatch['apply'](_0xe2da4f,_0xf53efa,!![]);}catch(_0x225019){return BPromise[_0x8937('0x21')](_0x225019);}return _0xe2da4f[_0x8937('0x22')]();};}function saveUpdates(_0x1eefda,_0x47ff9a){return function(_0x19462f){if(_0x19462f){return _0x19462f[_0x8937('0x23')](_0x1eefda)[_0x8937('0x24')](function(_0x24f964){return _0x24f964;});}return null;};}function removeEntity(_0xfe8639,_0x34f7ea){return function(_0xc9078e){if(_0xc9078e){return _0xc9078e[_0x8937('0x25')]()['then'](function(){_0xfe8639[_0x8937('0x19')](0xcc)[_0x8937('0x26')]();});}};}function handleEntityNotFound(_0x552f0b,_0x2a32a6){return function(_0x55572f){if(!_0x55572f){_0x552f0b[_0x8937('0x18')](0x194);}return _0x55572f;};}function handleError(_0x2a579e,_0x455c53){_0x455c53=_0x455c53||0x1f4;return function(_0xf74fb3){logger[_0x8937('0x27')](_0xf74fb3[_0x8937('0x28')]);if(_0xf74fb3[_0x8937('0x29')]){delete _0xf74fb3['name'];}_0x2a579e[_0x8937('0x19')](_0x455c53)['send'](_0xf74fb3);};}exports[_0x8937('0x2a')]=function(_0x506741,_0x6d5710){var _0x23bc99={},_0x20dd6d={},_0x323fac={'count':0x0,'rows':[]};var _0x11848b=_['map'](db[_0x8937('0x2b')][_0x8937('0x2c')],function(_0x1e3b5b){return{'name':_0x1e3b5b[_0x8937('0x2d')],'type':_0x1e3b5b[_0x8937('0x2e')]['key']};});_0x20dd6d[_0x8937('0x2f')]=_[_0x8937('0x30')](_0x11848b,_0x8937('0x29'));_0x20dd6d['query']=_[_0x8937('0x31')](_0x506741[_0x8937('0x32')]);_0x20dd6d[_0x8937('0x33')]=_[_0x8937('0x34')](_0x20dd6d[_0x8937('0x2f')],_0x20dd6d[_0x8937('0x32')]);_0x23bc99['attributes']=_['intersection'](_0x20dd6d[_0x8937('0x2f')],qs[_0x8937('0x35')](_0x506741['query'][_0x8937('0x35')]));_0x23bc99[_0x8937('0x36')]=_0x23bc99[_0x8937('0x36')][_0x8937('0x37')]?_0x23bc99[_0x8937('0x36')]:_0x20dd6d[_0x8937('0x2f')];if(!_0x506741[_0x8937('0x32')]['hasOwnProperty'](_0x8937('0x38'))){_0x23bc99[_0x8937('0x1d')]=qs[_0x8937('0x1d')](_0x506741['query'][_0x8937('0x1d')]);_0x23bc99['offset']=qs[_0x8937('0x1a')](_0x506741['query'][_0x8937('0x1a')]);}_0x23bc99[_0x8937('0x39')]=qs[_0x8937('0x3a')](_0x506741[_0x8937('0x32')][_0x8937('0x3a')]);_0x23bc99[_0x8937('0x3b')]=qs[_0x8937('0x33')](_[_0x8937('0x3c')](_0x506741[_0x8937('0x32')],_0x20dd6d['filters']),_0x11848b);if(_0x506741[_0x8937('0x32')]['filter']){_0x23bc99[_0x8937('0x3b')]=_['merge'](_0x23bc99[_0x8937('0x3b')],{'$or':_[_0x8937('0x30')](_0x11848b,function(_0x3dd49b){if(_0x3dd49b[_0x8937('0x2e')]!==_0x8937('0x3d')){var _0x2602af={};_0x2602af[_0x3dd49b['name']]={'$like':'%'+_0x506741[_0x8937('0x32')]['filter']+'%'};return _0x2602af;}})});}_0x23bc99=_[_0x8937('0x3e')]({},_0x23bc99,_0x506741[_0x8937('0x3f')]);var _0x23e42b={'where':_0x23bc99['where']};return db[_0x8937('0x2b')][_0x8937('0x1c')](_0x23e42b)[_0x8937('0x24')](function(_0x5166b9){_0x323fac[_0x8937('0x1c')]=_0x5166b9;if(_0x506741[_0x8937('0x32')]['includeAll']){_0x23bc99['include']=[{'all':!![]}];}return db[_0x8937('0x2b')][_0x8937('0x40')](_0x23bc99);})[_0x8937('0x24')](function(_0x4438b5){_0x323fac['rows']=_0x4438b5;return _0x323fac;})[_0x8937('0x24')](respondWithFilteredResult(_0x6d5710,_0x23bc99))[_0x8937('0x41')](handleError(_0x6d5710,null));};exports[_0x8937('0x42')]=function(_0x165515,_0x20e545){var _0x14d959={'raw':!![],'where':{'id':_0x165515[_0x8937('0x43')]['id']}},_0x2220d8={};_0x2220d8['model']=_[_0x8937('0x31')](db[_0x8937('0x2b')][_0x8937('0x2c')]);_0x2220d8['query']=_[_0x8937('0x31')](_0x165515['query']);_0x2220d8[_0x8937('0x33')]=_[_0x8937('0x34')](_0x2220d8[_0x8937('0x2f')],_0x2220d8[_0x8937('0x32')]);_0x14d959[_0x8937('0x36')]=_['intersection'](_0x2220d8[_0x8937('0x2f')],qs[_0x8937('0x35')](_0x165515[_0x8937('0x32')][_0x8937('0x35')]));_0x14d959[_0x8937('0x36')]=_0x14d959[_0x8937('0x36')][_0x8937('0x37')]?_0x14d959[_0x8937('0x36')]:_0x2220d8[_0x8937('0x2f')];if(_0x165515[_0x8937('0x32')]['includeAll']){_0x14d959['include']=[{'all':!![]}];}_0x14d959=_[_0x8937('0x3e')]({},_0x14d959,_0x165515[_0x8937('0x3f')]);return db['VtigerField'][_0x8937('0x44')](_0x14d959)[_0x8937('0x24')](handleEntityNotFound(_0x20e545,null))['then'](respondWithResult(_0x20e545,null))[_0x8937('0x41')](handleError(_0x20e545,null));};exports[_0x8937('0x45')]=function(_0x206b7f,_0x1e4810){return db[_0x8937('0x2b')][_0x8937('0x45')](_0x206b7f[_0x8937('0x46')],{})[_0x8937('0x24')](respondWithResult(_0x1e4810,0xc9))['catch'](handleError(_0x1e4810,null));};exports[_0x8937('0x23')]=function(_0x591215,_0x43374f){if(_0x591215[_0x8937('0x46')]['id']){delete _0x591215[_0x8937('0x46')]['id'];}return db[_0x8937('0x2b')][_0x8937('0x44')]({'where':{'id':_0x591215['params']['id']}})[_0x8937('0x24')](handleEntityNotFound(_0x43374f,null))[_0x8937('0x24')](saveUpdates(_0x591215[_0x8937('0x46')],null))[_0x8937('0x24')](respondWithResult(_0x43374f,null))[_0x8937('0x41')](handleError(_0x43374f,null));};exports['destroy']=function(_0x28ecfd,_0x2492ca){return db[_0x8937('0x2b')][_0x8937('0x44')]({'where':{'id':_0x28ecfd[_0x8937('0x43')]['id']}})[_0x8937('0x24')](handleEntityNotFound(_0x2492ca,null))[_0x8937('0x24')](removeEntity(_0x2492ca,null))[_0x8937('0x41')](handleError(_0x2492ca,null));}; \ No newline at end of file +var _0x031b=['length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','find','catch','create','body','destroy','params','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','then','sendStatus','stack','name','index','map','VtigerField','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields'];(function(_0x1d9ab1,_0x1e731c){var _0x2a4664=function(_0x39b77f){while(--_0x39b77f){_0x1d9ab1['push'](_0x1d9ab1['shift']());}};_0x2a4664(++_0x1e731c);}(_0x031b,0x9f));var _0xb031=function(_0x312f62,_0x1b22b2){_0x312f62=_0x312f62-0x0;var _0x160ac1=_0x031b[_0x312f62];return _0x160ac1;};'use strict';var emlformat=require(_0xb031('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb031('0x1'));var jsonpatch=require(_0xb031('0x2'));var rp=require(_0xb031('0x3'));var moment=require('moment');var BPromise=require(_0xb031('0x4'));var Mustache=require(_0xb031('0x5'));var util=require('util');var path=require('path');var sox=require(_0xb031('0x6'));var csv=require(_0xb031('0x7'));var ejs=require(_0xb031('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb031('0x9'));var squel=require(_0xb031('0xa'));var crypto=require('crypto');var jsforce=require(_0xb031('0xb'));var deskjs=require(_0xb031('0xc'));var toCsv=require(_0xb031('0x7'));var querystring=require(_0xb031('0xd'));var Papa=require('papaparse');var Redis=require(_0xb031('0xe'));var authService=require(_0xb031('0xf'));var qs=require(_0xb031('0x10'));var as=require(_0xb031('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb031('0x12'))(_0xb031('0x13'));var utils=require(_0xb031('0x14'));var config=require(_0xb031('0x15'));var licenseUtil=require(_0xb031('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x47b01f,_0xd3728c){_0xd3728c=_0xd3728c||0xcc;return function(_0x3c5182){if(_0x3c5182){return _0x47b01f['sendStatus'](_0xd3728c);}return _0x47b01f[_0xb031('0x17')](_0xd3728c)[_0xb031('0x18')]();};}function respondWithResult(_0x3670b1,_0x570b51){_0x570b51=_0x570b51||0xc8;return function(_0x3a43b7){if(_0x3a43b7){return _0x3670b1[_0xb031('0x17')](_0x570b51)['json'](_0x3a43b7);}};}function respondWithFilteredResult(_0x269b4a,_0x4a2d64){return function(_0x5b20e1){if(_0x5b20e1){var _0xa61264=typeof _0x4a2d64[_0xb031('0x19')]===_0xb031('0x1a')&&typeof _0x4a2d64[_0xb031('0x1b')]==='undefined';var _0x43fc47=_0x5b20e1[_0xb031('0x1c')];var _0x8cf243=_0xa61264?0x0:_0x4a2d64[_0xb031('0x19')];var _0x50c337=_0xa61264?_0x5b20e1[_0xb031('0x1c')]:_0x4a2d64['offset']+_0x4a2d64[_0xb031('0x1b')];var _0x4e137d;if(_0x50c337>=_0x43fc47){_0x50c337=_0x43fc47;_0x4e137d=0xc8;}else{_0x4e137d=0xce;}_0x269b4a[_0xb031('0x17')](_0x4e137d);return _0x269b4a[_0xb031('0x1d')](_0xb031('0x1e'),_0x8cf243+'-'+_0x50c337+'/'+_0x43fc47)['json'](_0x5b20e1);}return null;};}function patchUpdates(_0xcf3d5c){return function(_0x52f3db){try{jsonpatch[_0xb031('0x1f')](_0x52f3db,_0xcf3d5c,!![]);}catch(_0x4c9b88){return BPromise[_0xb031('0x20')](_0x4c9b88);}return _0x52f3db['save']();};}function saveUpdates(_0x517070,_0x2574e6){return function(_0x8ac87c){if(_0x8ac87c){return _0x8ac87c['update'](_0x517070)[_0xb031('0x21')](function(_0x2d6ad4){return _0x2d6ad4;});}return null;};}function removeEntity(_0x39ae37,_0x1b6928){return function(_0x2306c7){if(_0x2306c7){return _0x2306c7['destroy']()[_0xb031('0x21')](function(){_0x39ae37[_0xb031('0x17')](0xcc)[_0xb031('0x18')]();});}};}function handleEntityNotFound(_0x491dd8,_0x47b477){return function(_0x97fc57){if(!_0x97fc57){_0x491dd8[_0xb031('0x22')](0x194);}return _0x97fc57;};}function handleError(_0x335b2d,_0x490aa1){_0x490aa1=_0x490aa1||0x1f4;return function(_0x48870d){logger['error'](_0x48870d[_0xb031('0x23')]);if(_0x48870d[_0xb031('0x24')]){delete _0x48870d[_0xb031('0x24')];}_0x335b2d[_0xb031('0x17')](_0x490aa1)['send'](_0x48870d);};}exports[_0xb031('0x25')]=function(_0x55bcc6,_0x3aa9c){var _0x3248a6={},_0x5a1e88={},_0x52aa4={'count':0x0,'rows':[]};var _0x255aea=_[_0xb031('0x26')](db[_0xb031('0x27')][_0xb031('0x28')],function(_0x513dc5){return{'name':_0x513dc5[_0xb031('0x29')],'type':_0x513dc5[_0xb031('0x2a')][_0xb031('0x2b')]};});_0x5a1e88[_0xb031('0x2c')]=_[_0xb031('0x26')](_0x255aea,_0xb031('0x24'));_0x5a1e88['query']=_[_0xb031('0x2d')](_0x55bcc6['query']);_0x5a1e88[_0xb031('0x2e')]=_[_0xb031('0x2f')](_0x5a1e88[_0xb031('0x2c')],_0x5a1e88[_0xb031('0x30')]);_0x3248a6[_0xb031('0x31')]=_[_0xb031('0x2f')](_0x5a1e88[_0xb031('0x2c')],qs['fields'](_0x55bcc6[_0xb031('0x30')][_0xb031('0x32')]));_0x3248a6['attributes']=_0x3248a6[_0xb031('0x31')][_0xb031('0x33')]?_0x3248a6['attributes']:_0x5a1e88['model'];if(!_0x55bcc6[_0xb031('0x30')][_0xb031('0x34')]('nolimit')){_0x3248a6[_0xb031('0x1b')]=qs[_0xb031('0x1b')](_0x55bcc6[_0xb031('0x30')][_0xb031('0x1b')]);_0x3248a6[_0xb031('0x19')]=qs[_0xb031('0x19')](_0x55bcc6[_0xb031('0x30')][_0xb031('0x19')]);}_0x3248a6['order']=qs[_0xb031('0x35')](_0x55bcc6[_0xb031('0x30')][_0xb031('0x35')]);_0x3248a6[_0xb031('0x36')]=qs[_0xb031('0x2e')](_[_0xb031('0x37')](_0x55bcc6[_0xb031('0x30')],_0x5a1e88[_0xb031('0x2e')]),_0x255aea);if(_0x55bcc6[_0xb031('0x30')]['filter']){_0x3248a6[_0xb031('0x36')]=_[_0xb031('0x38')](_0x3248a6[_0xb031('0x36')],{'$or':_[_0xb031('0x26')](_0x255aea,function(_0x3e7524){if(_0x3e7524[_0xb031('0x2a')]!==_0xb031('0x39')){var _0x3c7396={};_0x3c7396[_0x3e7524['name']]={'$like':'%'+_0x55bcc6[_0xb031('0x30')][_0xb031('0x3a')]+'%'};return _0x3c7396;}})});}_0x3248a6=_['merge']({},_0x3248a6,_0x55bcc6[_0xb031('0x3b')]);var _0x3777cf={'where':_0x3248a6[_0xb031('0x36')]};return db[_0xb031('0x27')][_0xb031('0x1c')](_0x3777cf)['then'](function(_0x5e6398){_0x52aa4[_0xb031('0x1c')]=_0x5e6398;if(_0x55bcc6[_0xb031('0x30')][_0xb031('0x3c')]){_0x3248a6[_0xb031('0x3d')]=[{'all':!![]}];}return db[_0xb031('0x27')][_0xb031('0x3e')](_0x3248a6);})[_0xb031('0x21')](function(_0x1db395){_0x52aa4['rows']=_0x1db395;return _0x52aa4;})[_0xb031('0x21')](respondWithFilteredResult(_0x3aa9c,_0x3248a6))['catch'](handleError(_0x3aa9c,null));};exports[_0xb031('0x3f')]=function(_0x5836a8,_0x524807){var _0x1c71cc={'raw':!![],'where':{'id':_0x5836a8['params']['id']}},_0xe3486d={};_0xe3486d[_0xb031('0x2c')]=_[_0xb031('0x2d')](db[_0xb031('0x27')][_0xb031('0x28')]);_0xe3486d[_0xb031('0x30')]=_['keys'](_0x5836a8[_0xb031('0x30')]);_0xe3486d[_0xb031('0x2e')]=_['intersection'](_0xe3486d[_0xb031('0x2c')],_0xe3486d[_0xb031('0x30')]);_0x1c71cc[_0xb031('0x31')]=_[_0xb031('0x2f')](_0xe3486d[_0xb031('0x2c')],qs[_0xb031('0x32')](_0x5836a8[_0xb031('0x30')]['fields']));_0x1c71cc[_0xb031('0x31')]=_0x1c71cc[_0xb031('0x31')][_0xb031('0x33')]?_0x1c71cc[_0xb031('0x31')]:_0xe3486d[_0xb031('0x2c')];if(_0x5836a8[_0xb031('0x30')][_0xb031('0x3c')]){_0x1c71cc[_0xb031('0x3d')]=[{'all':!![]}];}_0x1c71cc=_[_0xb031('0x38')]({},_0x1c71cc,_0x5836a8[_0xb031('0x3b')]);return db[_0xb031('0x27')][_0xb031('0x40')](_0x1c71cc)['then'](handleEntityNotFound(_0x524807,null))[_0xb031('0x21')](respondWithResult(_0x524807,null))[_0xb031('0x41')](handleError(_0x524807,null));};exports['create']=function(_0x4ecbd2,_0x20a34f){return db[_0xb031('0x27')][_0xb031('0x42')](_0x4ecbd2[_0xb031('0x43')],{})[_0xb031('0x21')](respondWithResult(_0x20a34f,0xc9))[_0xb031('0x41')](handleError(_0x20a34f,null));};exports['update']=function(_0x1a1417,_0x3076b5){if(_0x1a1417['body']['id']){delete _0x1a1417[_0xb031('0x43')]['id'];}return db['VtigerField'][_0xb031('0x40')]({'where':{'id':_0x1a1417['params']['id']}})[_0xb031('0x21')](handleEntityNotFound(_0x3076b5,null))[_0xb031('0x21')](saveUpdates(_0x1a1417[_0xb031('0x43')],null))[_0xb031('0x21')](respondWithResult(_0x3076b5,null))[_0xb031('0x41')](handleError(_0x3076b5,null));};exports[_0xb031('0x44')]=function(_0x415ea7,_0x49c69c){return db[_0xb031('0x27')][_0xb031('0x40')]({'where':{'id':_0x415ea7[_0xb031('0x45')]['id']}})[_0xb031('0x21')](handleEntityNotFound(_0x49c69c,null))[_0xb031('0x21')](removeEntity(_0x49c69c,null))[_0xb031('0x41')](handleError(_0x49c69c,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index d1092b3..e463e9c 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 _0x3540=['VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','rimraf','./intVtigerField.attributes','exports','define'];(function(_0x1261ac,_0x357a74){var _0x363168=function(_0x45c05c){while(--_0x45c05c){_0x1261ac['push'](_0x1261ac['shift']());}};_0x363168(++_0x357a74);}(_0x3540,0x1d6));var _0x0354=function(_0x125a8a,_0x490d31){_0x125a8a=_0x125a8a-0x0;var _0xe767a5=_0x3540[_0x125a8a];return _0xe767a5;};'use strict';var _=require(_0x0354('0x0'));var util=require(_0x0354('0x1'));var logger=require(_0x0354('0x2'))(_0x0354('0x3'));var moment=require(_0x0354('0x4'));var BPromise=require(_0x0354('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0354('0x6'));var config=require('../../config/environment');var attributes=require(_0x0354('0x7'));module[_0x0354('0x8')]=function(_0x58654c,_0x40bad3){return _0x58654c[_0x0354('0x9')](_0x0354('0xa'),attributes,{'tableName':_0x0354('0xb'),'paranoid':![],'indexes':[{'name':_0x0354('0xc'),'fields':[_0x0354('0xd'),_0x0354('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9449=['idField','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','VtigerField','int_vtiger_fields','vtiger_unique_index'];(function(_0x4697fa,_0x21c841){var _0x390950=function(_0x3deb8a){while(--_0x3deb8a){_0x4697fa['push'](_0x4697fa['shift']());}};_0x390950(++_0x21c841);}(_0x9449,0x1f1));var _0x9944=function(_0x2d0092,_0x29189f){_0x2d0092=_0x2d0092-0x0;var _0x4aee73=_0x9449[_0x2d0092];return _0x4aee73;};'use strict';var _=require(_0x9944('0x0'));var util=require(_0x9944('0x1'));var logger=require(_0x9944('0x2'))(_0x9944('0x3'));var moment=require(_0x9944('0x4'));var BPromise=require(_0x9944('0x5'));var rp=require(_0x9944('0x6'));var fs=require('fs');var path=require(_0x9944('0x7'));var rimraf=require(_0x9944('0x8'));var config=require(_0x9944('0x9'));var attributes=require(_0x9944('0xa'));module[_0x9944('0xb')]=function(_0x2f97f2,_0xcd5713){return _0x2f97f2['define'](_0x9944('0xc'),attributes,{'tableName':_0x9944('0xd'),'paranoid':![],'indexes':[{'name':_0x9944('0xe'),'fields':[_0x9944('0xf'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index 474c449..934b15c 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 _0xa052=['info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1e3c04,_0x25efd9){var _0x230ba9=function(_0x54212e){while(--_0x54212e){_0x1e3c04['push'](_0x1e3c04['shift']());}};_0x230ba9(++_0x25efd9);}(_0xa052,0x99));var _0x2a05=function(_0x54e085,_0x2e1b67){_0x54e085=_0x54e085-0x0;var _0x5d262c=_0xa052[_0x54e085];return _0x5d262c;};'use strict';var _=require(_0x2a05('0x0'));var util=require(_0x2a05('0x1'));var moment=require(_0x2a05('0x2'));var BPromise=require('bluebird');var rs=require(_0x2a05('0x3'));var fs=require('fs');var Redis=require(_0x2a05('0x4'));var db=require(_0x2a05('0x5'))['db'];var utils=require(_0x2a05('0x6'));var logger=require(_0x2a05('0x7'))(_0x2a05('0x8'));var config=require(_0x2a05('0x9'));var jayson=require(_0x2a05('0xa'));var client=jayson[_0x2a05('0xb')][_0x2a05('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3db819,_0xbafe7e,_0x5562cd){return new BPromise(function(_0x156d30,_0x270f43){return client[_0x2a05('0xd')](_0x3db819,_0x5562cd)['then'](function(_0x4759f3){logger['info'](_0x2a05('0xe'),_0xbafe7e,_0x2a05('0xf'));logger[_0x2a05('0x10')](_0x2a05('0x11'),_0xbafe7e,_0x2a05('0xf'),JSON[_0x2a05('0x12')](_0x4759f3));if(_0x4759f3['error']){if(_0x4759f3[_0x2a05('0x13')][_0x2a05('0x14')]===0x1f4){logger['error'](_0x2a05('0xe'),_0xbafe7e,_0x4759f3[_0x2a05('0x13')][_0x2a05('0x15')]);return _0x270f43(_0x4759f3[_0x2a05('0x13')][_0x2a05('0x15')]);}logger[_0x2a05('0x13')](_0x2a05('0xe'),_0xbafe7e,_0x4759f3[_0x2a05('0x13')][_0x2a05('0x15')]);return _0x156d30(_0x4759f3[_0x2a05('0x13')][_0x2a05('0x15')]);}else{logger[_0x2a05('0x16')](_0x2a05('0xe'),_0xbafe7e,_0x2a05('0xf'));_0x156d30(_0x4759f3[_0x2a05('0x17')][_0x2a05('0x15')]);}})[_0x2a05('0x18')](function(_0xa9c86d){logger[_0x2a05('0x13')](_0x2a05('0xe'),_0xbafe7e,_0xa9c86d);_0x270f43(_0xa9c86d);});});} \ No newline at end of file +var _0x9573=['../../config/utils','../../config/logger','rpc','http','request','then','info','request\x20sent','stringify','code','error','VtigerField,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0xe620cf,_0x501fbc){var _0x528e37=function(_0x4d060c){while(--_0x4d060c){_0xe620cf['push'](_0xe620cf['shift']());}};_0x528e37(++_0x501fbc);}(_0x9573,0x1da));var _0x3957=function(_0x213d74,_0x429a81){_0x213d74=_0x213d74-0x0;var _0x4262fa=_0x9573[_0x213d74];return _0x4262fa;};'use strict';var _=require(_0x3957('0x0'));var util=require(_0x3957('0x1'));var moment=require(_0x3957('0x2'));var BPromise=require('bluebird');var rs=require(_0x3957('0x3'));var fs=require('fs');var Redis=require(_0x3957('0x4'));var db=require(_0x3957('0x5'))['db'];var utils=require(_0x3957('0x6'));var logger=require(_0x3957('0x7'))(_0x3957('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x3957('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3fc25b,_0xf0e893,_0x33e478){return new BPromise(function(_0x492edf,_0x30fd1b){return client[_0x3957('0xa')](_0x3fc25b,_0x33e478)[_0x3957('0xb')](function(_0x57e93a){logger[_0x3957('0xc')]('VtigerField,\x20%s,\x20%s',_0xf0e893,'request\x20sent');logger['debug']('VtigerField,\x20%s,\x20%s,\x20%s',_0xf0e893,_0x3957('0xd'),JSON[_0x3957('0xe')](_0x57e93a));if(_0x57e93a['error']){if(_0x57e93a['error'][_0x3957('0xf')]===0x1f4){logger[_0x3957('0x10')](_0x3957('0x11'),_0xf0e893,_0x57e93a[_0x3957('0x10')][_0x3957('0x12')]);return _0x30fd1b(_0x57e93a[_0x3957('0x10')]['message']);}logger['error'](_0x3957('0x11'),_0xf0e893,_0x57e93a[_0x3957('0x10')][_0x3957('0x12')]);return _0x492edf(_0x57e93a[_0x3957('0x10')][_0x3957('0x12')]);}else{logger[_0x3957('0xc')]('VtigerField,\x20%s,\x20%s',_0xf0e893,_0x3957('0xd'));_0x492edf(_0x57e93a[_0x3957('0x13')][_0x3957('0x12')]);}})['catch'](function(_0x5e50de){logger[_0x3957('0x10')](_0x3957('0x11'),_0xf0e893,_0x5e50de);_0x30fd1b(_0x5e50de);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index f23dd75..cf2efdb 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 _0x7ee1=['post','create','put','/:id','update','delete','destroy','exports','multer','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','index','isAuthenticated','/:id/configurations'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0x7ee1,0x8d));var _0x17ee=function(_0x63b888,_0x5a7464){_0x63b888=_0x63b888-0x0;var _0x47c897=_0x7ee1[_0x63b888];return _0x47c897;};'use strict';var multer=require(_0x17ee('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x17ee('0x1'));var router=express[_0x17ee('0x2')]();var fs_extra=require(_0x17ee('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x17ee('0x4'));var config=require(_0x17ee('0x5'));var controller=require(_0x17ee('0x6'));router[_0x17ee('0x7')]('/',auth['isAuthenticated'](),controller[_0x17ee('0x8')]);router[_0x17ee('0x7')]('/:id',auth[_0x17ee('0x9')](),controller['show']);router[_0x17ee('0x7')](_0x17ee('0xa'),auth[_0x17ee('0x9')](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0x17ee('0x9')](),controller['getFields']);router[_0x17ee('0xb')]('/',auth[_0x17ee('0x9')](),controller[_0x17ee('0xc')]);router[_0x17ee('0xb')]('/:id/configurations',auth[_0x17ee('0x9')](),controller['addConfiguration']);router[_0x17ee('0xd')](_0x17ee('0xe'),auth[_0x17ee('0x9')](),controller[_0x17ee('0xf')]);router[_0x17ee('0x10')](_0x17ee('0xe'),auth[_0x17ee('0x9')](),controller[_0x17ee('0x11')]);module[_0x17ee('0x12')]=router; \ No newline at end of file +var _0x0913=['delete','destroy','exports','multer','util','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update'];(function(_0x766986,_0x4b8f01){var _0x484a4f=function(_0xfe6fcf){while(--_0xfe6fcf){_0x766986['push'](_0x766986['shift']());}};_0x484a4f(++_0x4b8f01);}(_0x0913,0x1a5));var _0x3091=function(_0x1013a3,_0x156610){_0x1013a3=_0x1013a3-0x0;var _0x2e7886=_0x0913[_0x1013a3];return _0x2e7886;};'use strict';var multer=require(_0x3091('0x0'));var util=require(_0x3091('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x3091('0x2'));var auth=require(_0x3091('0x3'));var interaction=require(_0x3091('0x4'));var config=require(_0x3091('0x5'));var controller=require('./intZendeskAccount.controller');router[_0x3091('0x6')]('/',auth[_0x3091('0x7')](),controller[_0x3091('0x8')]);router[_0x3091('0x6')](_0x3091('0x9'),auth['isAuthenticated'](),controller[_0x3091('0xa')]);router[_0x3091('0x6')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x3091('0xb')]);router['get'](_0x3091('0xc'),auth[_0x3091('0x7')](),controller[_0x3091('0xd')]);router[_0x3091('0xe')]('/',auth[_0x3091('0x7')](),controller[_0x3091('0xf')]);router[_0x3091('0xe')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x3091('0x10')]);router[_0x3091('0x11')]('/:id',auth[_0x3091('0x7')](),controller[_0x3091('0x12')]);router[_0x3091('0x13')](_0x3091('0x9'),auth[_0x3091('0x7')](),controller[_0x3091('0x14')]);module[_0x3091('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index f00f545..ba956e5 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 _0xe2bc=['username','ENUM','password','token','integrationTab','newTab','sequelize','STRING'];(function(_0x5beed7,_0x169e03){var _0x51deb2=function(_0x20e948){while(--_0x20e948){_0x5beed7['push'](_0x5beed7['shift']());}};_0x51deb2(++_0x169e03);}(_0xe2bc,0x1a6));var _0xce2b=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0xe2bc[_0x56916d];return _0x2b7f1f;};'use strict';var Sequelize=require(_0xce2b('0x0'));module['exports']={'name':{'type':Sequelize[_0xce2b('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xce2b('0x1')],'unique':_0xce2b('0x2')},'password':{'type':Sequelize[_0xce2b('0x1')]},'token':{'type':Sequelize[_0xce2b('0x1')]},'remoteUri':{'type':Sequelize[_0xce2b('0x1')],'unique':'remoteUri'},'authType':{'type':Sequelize[_0xce2b('0x3')](_0xce2b('0x4'),_0xce2b('0x5')),'defaultValue':_0xce2b('0x4')},'serverUrl':{'type':Sequelize[_0xce2b('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xce2b('0x6'),_0xce2b('0x7')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x7046=['sequelize','exports','STRING','username','remoteUri','ENUM','password','token','integrationTab'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0x7046,0x144));var _0x6704=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x7046[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0x6704('0x0'));module[_0x6704('0x1')]={'name':{'type':Sequelize[_0x6704('0x2')]},'description':{'type':Sequelize[_0x6704('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x6704('0x3')},'password':{'type':Sequelize[_0x6704('0x2')]},'token':{'type':Sequelize[_0x6704('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x6704('0x4')},'authType':{'type':Sequelize[_0x6704('0x5')](_0x6704('0x6'),_0x6704('0x7')),'defaultValue':_0x6704('0x6')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6704('0x5')]('integrationTab','newTab'),'defaultValue':_0x6704('0x8')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 95a68b3..4d1e975 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 _0x1d2d=['position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','json','apply','reject','save','update','then','destroy','error','stack','send','index','ZendeskAccount','rawAttributes','type','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','order','sort','where','merge','filter','options','findAll','catch','includeAll','find','create','body','params','getConfigurations','ZendeskConfiguration','hasOwnProperty','findOne','AccountId','Subjects','getSubjects','channel','ZendeskField','Descriptions','username','token','substring','lastIndexOf','GET','format','%s/%s','authType','password','headers','Basic\x20%s','%s:%s','toString','%s/token:%s','base64','Sequelize','subject','description','group','assignee','ticket_fields','includes'];(function(_0x788fd3,_0x3def7c){var _0x3cb706=function(_0x3306a9){while(--_0x3306a9){_0x788fd3['push'](_0x788fd3['shift']());}};_0x3cb706(++_0x3def7c);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x4536e3,_0xbe4d32){_0x4536e3=_0x4536e3-0x0;var _0x3e59bd=_0x1d2d[_0x4536e3];return _0x3e59bd;};'use strict';var emlformat=require(_0xd1d2('0x0'));var rimraf=require(_0xd1d2('0x1'));var zipdir=require(_0xd1d2('0x2'));var jsonpatch=require(_0xd1d2('0x3'));var rp=require(_0xd1d2('0x4'));var moment=require('moment');var BPromise=require(_0xd1d2('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd1d2('0x6'));var sox=require(_0xd1d2('0x7'));var csv=require(_0xd1d2('0x8'));var ejs=require(_0xd1d2('0x9'));var fs=require('fs');var fs_extra=require(_0xd1d2('0xa'));var _=require(_0xd1d2('0xb'));var squel=require('squel');var crypto=require(_0xd1d2('0xc'));var jsforce=require(_0xd1d2('0xd'));var deskjs=require(_0xd1d2('0xe'));var toCsv=require(_0xd1d2('0x8'));var querystring=require(_0xd1d2('0xf'));var Papa=require(_0xd1d2('0x10'));var Redis=require(_0xd1d2('0x11'));var authService=require(_0xd1d2('0x12'));var qs=require(_0xd1d2('0x13'));var as=require(_0xd1d2('0x14'));var hardwareService=require(_0xd1d2('0x15'));var logger=require(_0xd1d2('0x16'))(_0xd1d2('0x17'));var utils=require('../../config/utils');var config=require(_0xd1d2('0x18'));var licenseUtil=require(_0xd1d2('0x19'));var db=require(_0xd1d2('0x1a'))['db'];var integrations=require(_0xd1d2('0x1b'));function respondWithStatusCode(_0x129d8f,_0xc3ee82){_0xc3ee82=_0xc3ee82||0xcc;return function(_0x2df8a5){if(_0x2df8a5){return _0x129d8f[_0xd1d2('0x1c')](_0xc3ee82);}return _0x129d8f[_0xd1d2('0x1d')](_0xc3ee82)[_0xd1d2('0x1e')]();};}function respondWithResult(_0x4cf702,_0x2e7fec){_0x2e7fec=_0x2e7fec||0xc8;return function(_0x3c0296){if(_0x3c0296){return _0x4cf702[_0xd1d2('0x1d')](_0x2e7fec)['json'](_0x3c0296);}};}function respondWithFilteredResult(_0x35381b,_0xc36ce){return function(_0x208425){if(_0x208425){var _0x2f4cf9=typeof _0xc36ce[_0xd1d2('0x1f')]===_0xd1d2('0x20')&&typeof _0xc36ce[_0xd1d2('0x21')]==='undefined';var _0x539d5a=_0x208425[_0xd1d2('0x22')];var _0x55320b=_0x2f4cf9?0x0:_0xc36ce[_0xd1d2('0x1f')];var _0x42565b=_0x2f4cf9?_0x208425[_0xd1d2('0x22')]:_0xc36ce[_0xd1d2('0x1f')]+_0xc36ce['limit'];var _0x4f1201;if(_0x42565b>=_0x539d5a){_0x42565b=_0x539d5a;_0x4f1201=0xc8;}else{_0x4f1201=0xce;}_0x35381b[_0xd1d2('0x1d')](_0x4f1201);return _0x35381b['set']('Content-Range',_0x55320b+'-'+_0x42565b+'/'+_0x539d5a)[_0xd1d2('0x23')](_0x208425);}return null;};}function patchUpdates(_0x27e26b){return function(_0x3414ce){try{jsonpatch[_0xd1d2('0x24')](_0x3414ce,_0x27e26b,!![]);}catch(_0x596cd8){return BPromise[_0xd1d2('0x25')](_0x596cd8);}return _0x3414ce[_0xd1d2('0x26')]();};}function saveUpdates(_0x24b8db,_0x4eb082){return function(_0x59e72c){if(_0x59e72c){return _0x59e72c[_0xd1d2('0x27')](_0x24b8db)[_0xd1d2('0x28')](function(_0x19d535){return _0x19d535;});}return null;};}function removeEntity(_0x2f92ee,_0x3f229c){return function(_0x33a171){if(_0x33a171){return _0x33a171[_0xd1d2('0x29')]()['then'](function(){_0x2f92ee[_0xd1d2('0x1d')](0xcc)[_0xd1d2('0x1e')]();});}};}function handleEntityNotFound(_0x41330f,_0x2e1709){return function(_0x5d3ee1){if(!_0x5d3ee1){_0x41330f[_0xd1d2('0x1c')](0x194);}return _0x5d3ee1;};}function handleError(_0x28b8be,_0x34faf7){_0x34faf7=_0x34faf7||0x1f4;return function(_0xe6ef3c){logger[_0xd1d2('0x2a')](_0xe6ef3c[_0xd1d2('0x2b')]);if(_0xe6ef3c['name']){delete _0xe6ef3c['name'];}_0x28b8be[_0xd1d2('0x1d')](_0x34faf7)[_0xd1d2('0x2c')](_0xe6ef3c);};}exports[_0xd1d2('0x2d')]=function(_0x2b4c1f,_0xc815ea){var _0x48ade1={},_0x39d694={},_0x41171c={'count':0x0,'rows':[]};var _0x383947=_['map'](db[_0xd1d2('0x2e')][_0xd1d2('0x2f')],function(_0xbd855a){return{'name':_0xbd855a['fieldName'],'type':_0xbd855a[_0xd1d2('0x30')][_0xd1d2('0x31')]};});_0x39d694[_0xd1d2('0x32')]=_[_0xd1d2('0x33')](_0x383947,_0xd1d2('0x34'));_0x39d694[_0xd1d2('0x35')]=_[_0xd1d2('0x36')](_0x2b4c1f[_0xd1d2('0x35')]);_0x39d694[_0xd1d2('0x37')]=_[_0xd1d2('0x38')](_0x39d694[_0xd1d2('0x32')],_0x39d694[_0xd1d2('0x35')]);_0x48ade1[_0xd1d2('0x39')]=_[_0xd1d2('0x38')](_0x39d694[_0xd1d2('0x32')],qs[_0xd1d2('0x3a')](_0x2b4c1f[_0xd1d2('0x35')][_0xd1d2('0x3a')]));_0x48ade1['attributes']=_0x48ade1[_0xd1d2('0x39')][_0xd1d2('0x3b')]?_0x48ade1[_0xd1d2('0x39')]:_0x39d694['model'];if(!_0x2b4c1f[_0xd1d2('0x35')]['hasOwnProperty']('nolimit')){_0x48ade1[_0xd1d2('0x21')]=qs[_0xd1d2('0x21')](_0x2b4c1f[_0xd1d2('0x35')][_0xd1d2('0x21')]);_0x48ade1[_0xd1d2('0x1f')]=qs[_0xd1d2('0x1f')](_0x2b4c1f['query'][_0xd1d2('0x1f')]);}_0x48ade1[_0xd1d2('0x3c')]=qs['sort'](_0x2b4c1f[_0xd1d2('0x35')][_0xd1d2('0x3d')]);_0x48ade1[_0xd1d2('0x3e')]=qs[_0xd1d2('0x37')](_['pick'](_0x2b4c1f['query'],_0x39d694[_0xd1d2('0x37')]),_0x383947);if(_0x2b4c1f['query']['filter']){_0x48ade1['where']=_[_0xd1d2('0x3f')](_0x48ade1['where'],{'$or':_[_0xd1d2('0x33')](_0x383947,function(_0x4e7640){if(_0x4e7640['type']!=='VIRTUAL'){var _0x2dabfa={};_0x2dabfa[_0x4e7640[_0xd1d2('0x34')]]={'$like':'%'+_0x2b4c1f[_0xd1d2('0x35')][_0xd1d2('0x40')]+'%'};return _0x2dabfa;}})});}_0x48ade1=_[_0xd1d2('0x3f')]({},_0x48ade1,_0x2b4c1f[_0xd1d2('0x41')]);var _0x178f8b={'where':_0x48ade1[_0xd1d2('0x3e')]};return db[_0xd1d2('0x2e')][_0xd1d2('0x22')](_0x178f8b)[_0xd1d2('0x28')](function(_0x1fb5b5){_0x41171c[_0xd1d2('0x22')]=_0x1fb5b5;if(_0x2b4c1f[_0xd1d2('0x35')]['includeAll']){_0x48ade1['include']=[{'all':!![]}];}return db[_0xd1d2('0x2e')][_0xd1d2('0x42')](_0x48ade1);})[_0xd1d2('0x28')](function(_0x4d0fd9){_0x41171c['rows']=_0x4d0fd9;return _0x41171c;})[_0xd1d2('0x28')](respondWithFilteredResult(_0xc815ea,_0x48ade1))[_0xd1d2('0x43')](handleError(_0xc815ea,null));};exports['show']=function(_0x2fe92a,_0x4c5d49){var _0x5a3790={'raw':![],'where':{'id':_0x2fe92a['params']['id']}},_0x21eb24={};_0x21eb24['model']=_[_0xd1d2('0x36')](db[_0xd1d2('0x2e')][_0xd1d2('0x2f')]);_0x21eb24['query']=_[_0xd1d2('0x36')](_0x2fe92a[_0xd1d2('0x35')]);_0x21eb24[_0xd1d2('0x37')]=_[_0xd1d2('0x38')](_0x21eb24['model'],_0x21eb24[_0xd1d2('0x35')]);_0x5a3790[_0xd1d2('0x39')]=_['intersection'](_0x21eb24[_0xd1d2('0x32')],qs['fields'](_0x2fe92a[_0xd1d2('0x35')][_0xd1d2('0x3a')]));_0x5a3790[_0xd1d2('0x39')]=_0x5a3790[_0xd1d2('0x39')][_0xd1d2('0x3b')]?_0x5a3790['attributes']:_0x21eb24['model'];if(_0x2fe92a[_0xd1d2('0x35')][_0xd1d2('0x44')]){_0x5a3790['include']=[{'all':!![]}];}_0x5a3790=_[_0xd1d2('0x3f')]({},_0x5a3790,_0x2fe92a[_0xd1d2('0x41')]);return db[_0xd1d2('0x2e')][_0xd1d2('0x45')](_0x5a3790)[_0xd1d2('0x28')](handleEntityNotFound(_0x4c5d49,null))[_0xd1d2('0x28')](respondWithResult(_0x4c5d49,null))[_0xd1d2('0x43')](handleError(_0x4c5d49,null));};exports['create']=function(_0xed9e9,_0xc10c10){return db['ZendeskAccount'][_0xd1d2('0x46')](_0xed9e9[_0xd1d2('0x47')],{})['then'](respondWithResult(_0xc10c10,0xc9))['catch'](handleError(_0xc10c10,null));};exports[_0xd1d2('0x27')]=function(_0x182ea8,_0x4cb376){if(_0x182ea8[_0xd1d2('0x47')]['id']){delete _0x182ea8[_0xd1d2('0x47')]['id'];}return db[_0xd1d2('0x2e')][_0xd1d2('0x45')]({'where':{'id':_0x182ea8[_0xd1d2('0x48')]['id']}})['then'](handleEntityNotFound(_0x4cb376,null))['then'](saveUpdates(_0x182ea8[_0xd1d2('0x47')],null))['then'](respondWithResult(_0x4cb376,null))[_0xd1d2('0x43')](handleError(_0x4cb376,null));};exports[_0xd1d2('0x29')]=function(_0x4f4cb9,_0x389fcb){return db[_0xd1d2('0x2e')]['find']({'where':{'id':_0x4f4cb9['params']['id']}})[_0xd1d2('0x28')](handleEntityNotFound(_0x389fcb,null))[_0xd1d2('0x28')](removeEntity(_0x389fcb,null))[_0xd1d2('0x43')](handleError(_0x389fcb,null));};exports[_0xd1d2('0x49')]=function(_0xa013ce,_0x34a793,_0x1f6150){var _0x3411c8={};var _0x33e332={};var _0x5e15cb;var _0x1958f3;return db['ZendeskAccount']['findOne']({'where':{'id':_0xa013ce[_0xd1d2('0x48')]['id']}})[_0xd1d2('0x28')](handleEntityNotFound(_0x34a793,null))[_0xd1d2('0x28')](function(_0x47417f){if(_0x47417f){_0x5e15cb=_0x47417f;_0x33e332[_0xd1d2('0x32')]=_[_0xd1d2('0x36')](db[_0xd1d2('0x4a')][_0xd1d2('0x2f')]);_0x33e332[_0xd1d2('0x35')]=_[_0xd1d2('0x36')](_0xa013ce[_0xd1d2('0x35')]);_0x33e332[_0xd1d2('0x37')]=_[_0xd1d2('0x38')](_0x33e332['model'],_0x33e332['query']);_0x3411c8[_0xd1d2('0x39')]=_[_0xd1d2('0x38')](_0x33e332[_0xd1d2('0x32')],qs[_0xd1d2('0x3a')](_0xa013ce[_0xd1d2('0x35')][_0xd1d2('0x3a')]));_0x3411c8[_0xd1d2('0x39')]=_0x3411c8[_0xd1d2('0x39')][_0xd1d2('0x3b')]?_0x3411c8[_0xd1d2('0x39')]:_0x33e332[_0xd1d2('0x32')];_0x3411c8['order']=qs['sort'](_0xa013ce[_0xd1d2('0x35')][_0xd1d2('0x3d')]);_0x3411c8[_0xd1d2('0x3e')]=qs[_0xd1d2('0x37')](_['pick'](_0xa013ce[_0xd1d2('0x35')],_0x33e332[_0xd1d2('0x37')]));if(_0xa013ce[_0xd1d2('0x35')][_0xd1d2('0x40')]){_0x3411c8[_0xd1d2('0x3e')]=_[_0xd1d2('0x3f')](_0x3411c8[_0xd1d2('0x3e')],{'$or':_['map'](_0x3411c8[_0xd1d2('0x39')],function(_0x24d92c){var _0x1d8788={};_0x1d8788[_0x24d92c]={'$like':'%'+_0xa013ce['query']['filter']+'%'};return _0x1d8788;})});}_0x3411c8=_[_0xd1d2('0x3f')]({},_0x3411c8,_0xa013ce[_0xd1d2('0x41')]);return _0x5e15cb[_0xd1d2('0x49')](_0x3411c8);}})[_0xd1d2('0x28')](function(_0x598e6c){if(_0x598e6c){_0x1958f3=_0x598e6c[_0xd1d2('0x3b')];if(!_0xa013ce[_0xd1d2('0x35')][_0xd1d2('0x4b')]('nolimit')){_0x3411c8[_0xd1d2('0x21')]=qs[_0xd1d2('0x21')](_0xa013ce['query'][_0xd1d2('0x21')]);_0x3411c8[_0xd1d2('0x1f')]=qs[_0xd1d2('0x1f')](_0xa013ce[_0xd1d2('0x35')]['offset']);}return _0x5e15cb[_0xd1d2('0x49')](_0x3411c8);}})[_0xd1d2('0x28')](function(_0xd82d10){if(_0xd82d10){return _0xd82d10?{'count':_0x1958f3,'rows':_0xd82d10}:null;}})[_0xd1d2('0x28')](respondWithResult(_0x34a793,null))[_0xd1d2('0x43')](handleError(_0x34a793,null));};exports['addConfiguration']=function(_0x47aa13,_0x500465,_0x541676){if(_0x47aa13['body']['id']){delete _0x47aa13[_0xd1d2('0x47')]['id'];}return db[_0xd1d2('0x2e')][_0xd1d2('0x4c')]({'where':{'id':_0x47aa13['params']['id']}})[_0xd1d2('0x28')](handleEntityNotFound(_0x500465,null))[_0xd1d2('0x28')](function(_0x22d617){if(_0x22d617){_0x47aa13['body'][_0xd1d2('0x4d')]=_0x22d617['id'];_0x47aa13[_0xd1d2('0x47')][_0xd1d2('0x4e')]=integrations[_0xd1d2('0x4f')](_0x47aa13[_0xd1d2('0x47')][_0xd1d2('0x50')],_0x47aa13['body'][_0xd1d2('0x30')]);_0x47aa13[_0xd1d2('0x47')]['Descriptions']=integrations['getDescriptions'](_0x47aa13[_0xd1d2('0x47')][_0xd1d2('0x50')],_0x47aa13[_0xd1d2('0x47')][_0xd1d2('0x30')]);return db['ZendeskConfiguration'][_0xd1d2('0x46')](_0x47aa13[_0xd1d2('0x47')],{'include':[{'model':db[_0xd1d2('0x51')],'as':_0xd1d2('0x4e')},{'model':db['ZendeskField'],'as':_0xd1d2('0x52')}]});}return null;})[_0xd1d2('0x28')](respondWithResult(_0x500465,null))[_0xd1d2('0x43')](handleError(_0x500465,null));};exports['getFields']=function(_0x46ff4d,_0x1ae9af,_0x4c35cb){var _0x2175ab='';return db[_0xd1d2('0x2e')][_0xd1d2('0x4c')]({'where':{'id':_0x46ff4d[_0xd1d2('0x48')]['id']},'attributes':['id',_0xd1d2('0x53'),'password',_0xd1d2('0x54'),'authType','remoteUri']})['then'](handleEntityNotFound(_0x1ae9af,null))['then'](function(_0x89ec63){if(_0x89ec63){_0x2175ab=_0x89ec63['remoteUri'];var _0x37591f=_0x2175ab['slice'](-0x1);if(_0x37591f==='/'){_0x2175ab=_0x2175ab[_0xd1d2('0x55')](0x0,_0x2175ab[_0xd1d2('0x56')](_0x37591f));}var _0x16cc6c={'method':_0xd1d2('0x57'),'uri':util[_0xd1d2('0x58')](_0xd1d2('0x59'),_0x2175ab,'ticket_fields'),'json':!![]};switch(_0x89ec63[_0xd1d2('0x5a')]){case _0xd1d2('0x5b'):_0x16cc6c[_0xd1d2('0x5c')]={'Authorization':util[_0xd1d2('0x58')](_0xd1d2('0x5d'),new Buffer(util[_0xd1d2('0x58')](_0xd1d2('0x5e'),_0x89ec63[_0xd1d2('0x53')],_0x89ec63[_0xd1d2('0x5b')]))[_0xd1d2('0x5f')]('base64'))};break;case _0xd1d2('0x54'):_0x16cc6c[_0xd1d2('0x5c')]={'Authorization':util[_0xd1d2('0x58')](_0xd1d2('0x5d'),new Buffer(util['format'](_0xd1d2('0x60'),_0x89ec63[_0xd1d2('0x53')],_0x89ec63[_0xd1d2('0x54')]))['toString'](_0xd1d2('0x61')))};break;default:throw new db[(_0xd1d2('0x62'))]['ValidationError']('Unknown\x20authentication\x20type');}return rp(_0x16cc6c);}})[_0xd1d2('0x28')](function(_0x268d6d){if(_0x268d6d){var _0x3fbd87=[_0xd1d2('0x63'),_0xd1d2('0x64'),_0xd1d2('0x65'),_0xd1d2('0x66')];_['remove'](_0x268d6d[_0xd1d2('0x67')],function(_0x9a98d4){return _0x3fbd87[_0xd1d2('0x68')](_0x9a98d4[_0xd1d2('0x30')]);});return{'count':_0x268d6d[_0xd1d2('0x67')][_0xd1d2('0x3b')],'rows':_[_0xd1d2('0x33')](_0x268d6d[_0xd1d2('0x67')],function(_0x44409e){return{'id':_0x44409e['id'],'name':_0x44409e[_0xd1d2('0x69')]>0x7?_0x44409e[_0xd1d2('0x6a')]:_0x44409e[_0xd1d2('0x30')],'custom':_0x44409e[_0xd1d2('0x69')]>0x7?!![]:![],'options':_0x44409e[_0xd1d2('0x6b')]?_0x44409e['system_field_options']:_0x44409e[_0xd1d2('0x6c')]?_0x44409e[_0xd1d2('0x6c')]:[]};})};}})[_0xd1d2('0x28')](respondWithResult(_0x1ae9af,null))[_0xd1d2('0x43')](function(_0x20a3f0){var _0x32c294=_0x46ff4d[_0xd1d2('0x35')][_0xd1d2('0x6d')]?0x1f4:_0x20a3f0[_0xd1d2('0x6e')]||0x1f4;logger[_0xd1d2('0x2a')](_0xd1d2('0x6f'),_0xd1d2('0x70'),_0x32c294,JSON[_0xd1d2('0x71')](_0x20a3f0));delete _0x20a3f0['name'];if(_0x32c294===0x191){_0x32c294=0x190;}_0x1ae9af[_0xd1d2('0x1d')](_0x32c294)[_0xd1d2('0x2c')](_0x46ff4d[_0xd1d2('0x35')][_0xd1d2('0x6d')]?{'message':_0xd1d2('0x72'),'statusCode':_0x20a3f0[_0xd1d2('0x6e')]}:_0x20a3f0);});}; \ No newline at end of file +var _0xa74f=['Subjects','getSubjects','channel','type','Descriptions','getDescriptions','ZendeskField','getFields','username','password','token','authType','remoteUri','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','headers','Basic\x20%s','toString','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','test','zip-dir','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','end','json','offset','undefined','count','limit','Content-Range','reject','save','then','destroy','sendStatus','stack','name','index','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','ZendeskAccount','findAll','rows','params','length','find','catch','create','body','findOne','getConfigurations','addConfiguration'];(function(_0x226ad1,_0x2858e2){var _0x16b625=function(_0x4dc555){while(--_0x4dc555){_0x226ad1['push'](_0x226ad1['shift']());}};_0x16b625(++_0x2858e2);}(_0xa74f,0x9a));var _0xfa74=function(_0xdefbc3,_0x1ea49a){_0xdefbc3=_0xdefbc3-0x0;var _0x367798=_0xa74f[_0xdefbc3];return _0x367798;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfa74('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfa74('0x1'));var BPromise=require(_0xfa74('0x2'));var Mustache=require(_0xfa74('0x3'));var util=require(_0xfa74('0x4'));var path=require('path');var sox=require(_0xfa74('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfa74('0x6'));var _=require(_0xfa74('0x7'));var squel=require(_0xfa74('0x8'));var crypto=require(_0xfa74('0x9'));var jsforce=require(_0xfa74('0xa'));var deskjs=require(_0xfa74('0xb'));var toCsv=require('to-csv');var querystring=require(_0xfa74('0xc'));var Papa=require(_0xfa74('0xd'));var Redis=require(_0xfa74('0xe'));var authService=require(_0xfa74('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xfa74('0x10'));var hardwareService=require(_0xfa74('0x11'));var logger=require('../../config/logger')(_0xfa74('0x12'));var utils=require(_0xfa74('0x13'));var config=require(_0xfa74('0x14'));var licenseUtil=require(_0xfa74('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0xfa74('0x16'));function respondWithStatusCode(_0x998585,_0x78173f){_0x78173f=_0x78173f||0xcc;return function(_0x278e8b){if(_0x278e8b){return _0x998585['sendStatus'](_0x78173f);}return _0x998585[_0xfa74('0x17')](_0x78173f)[_0xfa74('0x18')]();};}function respondWithResult(_0x3eb49b,_0x3947ca){_0x3947ca=_0x3947ca||0xc8;return function(_0xe3c97e){if(_0xe3c97e){return _0x3eb49b['status'](_0x3947ca)[_0xfa74('0x19')](_0xe3c97e);}};}function respondWithFilteredResult(_0x13d911,_0x947da6){return function(_0x1f1de0){if(_0x1f1de0){var _0x3867f8=typeof _0x947da6[_0xfa74('0x1a')]===_0xfa74('0x1b')&&typeof _0x947da6['limit']===_0xfa74('0x1b');var _0xe0e33d=_0x1f1de0['count'];var _0x4928b6=_0x3867f8?0x0:_0x947da6[_0xfa74('0x1a')];var _0x25a36b=_0x3867f8?_0x1f1de0[_0xfa74('0x1c')]:_0x947da6['offset']+_0x947da6[_0xfa74('0x1d')];var _0x2edebb;if(_0x25a36b>=_0xe0e33d){_0x25a36b=_0xe0e33d;_0x2edebb=0xc8;}else{_0x2edebb=0xce;}_0x13d911[_0xfa74('0x17')](_0x2edebb);return _0x13d911['set'](_0xfa74('0x1e'),_0x4928b6+'-'+_0x25a36b+'/'+_0xe0e33d)[_0xfa74('0x19')](_0x1f1de0);}return null;};}function patchUpdates(_0x2e6c33){return function(_0x4a5ee4){try{jsonpatch['apply'](_0x4a5ee4,_0x2e6c33,!![]);}catch(_0x100851){return BPromise[_0xfa74('0x1f')](_0x100851);}return _0x4a5ee4[_0xfa74('0x20')]();};}function saveUpdates(_0xeaaa19,_0x1a453d){return function(_0x554e0e){if(_0x554e0e){return _0x554e0e['update'](_0xeaaa19)[_0xfa74('0x21')](function(_0x5aa8a7){return _0x5aa8a7;});}return null;};}function removeEntity(_0x48cbd3,_0x529810){return function(_0x42c439){if(_0x42c439){return _0x42c439[_0xfa74('0x22')]()[_0xfa74('0x21')](function(){_0x48cbd3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x9eb68c,_0xeb6c11){return function(_0x5ed1c8){if(!_0x5ed1c8){_0x9eb68c[_0xfa74('0x23')](0x194);}return _0x5ed1c8;};}function handleError(_0x5d3b26,_0x1a8cf7){_0x1a8cf7=_0x1a8cf7||0x1f4;return function(_0x153b2a){logger['error'](_0x153b2a[_0xfa74('0x24')]);if(_0x153b2a[_0xfa74('0x25')]){delete _0x153b2a[_0xfa74('0x25')];}_0x5d3b26[_0xfa74('0x17')](_0x1a8cf7)['send'](_0x153b2a);};}exports[_0xfa74('0x26')]=function(_0x2f7cd7,_0x204e01){var _0x57d90e={},_0x4d4bed={},_0x1322a4={'count':0x0,'rows':[]};var _0x8b706e=_['map'](db['ZendeskAccount'][_0xfa74('0x27')],function(_0x564060){return{'name':_0x564060[_0xfa74('0x28')],'type':_0x564060['type'][_0xfa74('0x29')]};});_0x4d4bed[_0xfa74('0x2a')]=_[_0xfa74('0x2b')](_0x8b706e,_0xfa74('0x25'));_0x4d4bed['query']=_[_0xfa74('0x2c')](_0x2f7cd7[_0xfa74('0x2d')]);_0x4d4bed[_0xfa74('0x2e')]=_[_0xfa74('0x2f')](_0x4d4bed[_0xfa74('0x2a')],_0x4d4bed[_0xfa74('0x2d')]);_0x57d90e[_0xfa74('0x30')]=_['intersection'](_0x4d4bed[_0xfa74('0x2a')],qs['fields'](_0x2f7cd7[_0xfa74('0x2d')][_0xfa74('0x31')]));_0x57d90e[_0xfa74('0x30')]=_0x57d90e[_0xfa74('0x30')]['length']?_0x57d90e['attributes']:_0x4d4bed[_0xfa74('0x2a')];if(!_0x2f7cd7[_0xfa74('0x2d')][_0xfa74('0x32')](_0xfa74('0x33'))){_0x57d90e['limit']=qs[_0xfa74('0x1d')](_0x2f7cd7[_0xfa74('0x2d')]['limit']);_0x57d90e['offset']=qs['offset'](_0x2f7cd7['query']['offset']);}_0x57d90e[_0xfa74('0x34')]=qs[_0xfa74('0x35')](_0x2f7cd7[_0xfa74('0x2d')][_0xfa74('0x35')]);_0x57d90e[_0xfa74('0x36')]=qs[_0xfa74('0x2e')](_[_0xfa74('0x37')](_0x2f7cd7[_0xfa74('0x2d')],_0x4d4bed[_0xfa74('0x2e')]),_0x8b706e);if(_0x2f7cd7['query'][_0xfa74('0x38')]){_0x57d90e[_0xfa74('0x36')]=_[_0xfa74('0x39')](_0x57d90e[_0xfa74('0x36')],{'$or':_[_0xfa74('0x2b')](_0x8b706e,function(_0x186126){if(_0x186126['type']!==_0xfa74('0x3a')){var _0x1f0806={};_0x1f0806[_0x186126[_0xfa74('0x25')]]={'$like':'%'+_0x2f7cd7[_0xfa74('0x2d')]['filter']+'%'};return _0x1f0806;}})});}_0x57d90e=_[_0xfa74('0x39')]({},_0x57d90e,_0x2f7cd7[_0xfa74('0x3b')]);var _0xe8491b={'where':_0x57d90e[_0xfa74('0x36')]};return db['ZendeskAccount'][_0xfa74('0x1c')](_0xe8491b)[_0xfa74('0x21')](function(_0x3dacc2){_0x1322a4['count']=_0x3dacc2;if(_0x2f7cd7['query'][_0xfa74('0x3c')]){_0x57d90e[_0xfa74('0x3d')]=[{'all':!![]}];}return db[_0xfa74('0x3e')][_0xfa74('0x3f')](_0x57d90e);})['then'](function(_0x1ab026){_0x1322a4[_0xfa74('0x40')]=_0x1ab026;return _0x1322a4;})['then'](respondWithFilteredResult(_0x204e01,_0x57d90e))['catch'](handleError(_0x204e01,null));};exports['show']=function(_0x492c7d,_0x95c891){var _0x3098ca={'raw':![],'where':{'id':_0x492c7d[_0xfa74('0x41')]['id']}},_0x3f92b2={};_0x3f92b2[_0xfa74('0x2a')]=_[_0xfa74('0x2c')](db[_0xfa74('0x3e')]['rawAttributes']);_0x3f92b2[_0xfa74('0x2d')]=_[_0xfa74('0x2c')](_0x492c7d[_0xfa74('0x2d')]);_0x3f92b2[_0xfa74('0x2e')]=_[_0xfa74('0x2f')](_0x3f92b2['model'],_0x3f92b2[_0xfa74('0x2d')]);_0x3098ca[_0xfa74('0x30')]=_[_0xfa74('0x2f')](_0x3f92b2[_0xfa74('0x2a')],qs[_0xfa74('0x31')](_0x492c7d[_0xfa74('0x2d')][_0xfa74('0x31')]));_0x3098ca[_0xfa74('0x30')]=_0x3098ca[_0xfa74('0x30')][_0xfa74('0x42')]?_0x3098ca['attributes']:_0x3f92b2[_0xfa74('0x2a')];if(_0x492c7d['query'][_0xfa74('0x3c')]){_0x3098ca[_0xfa74('0x3d')]=[{'all':!![]}];}_0x3098ca=_[_0xfa74('0x39')]({},_0x3098ca,_0x492c7d[_0xfa74('0x3b')]);return db['ZendeskAccount'][_0xfa74('0x43')](_0x3098ca)[_0xfa74('0x21')](handleEntityNotFound(_0x95c891,null))['then'](respondWithResult(_0x95c891,null))[_0xfa74('0x44')](handleError(_0x95c891,null));};exports[_0xfa74('0x45')]=function(_0x5cbb70,_0x2be89f){return db[_0xfa74('0x3e')][_0xfa74('0x45')](_0x5cbb70[_0xfa74('0x46')],{})[_0xfa74('0x21')](respondWithResult(_0x2be89f,0xc9))['catch'](handleError(_0x2be89f,null));};exports['update']=function(_0x36f6ca,_0x91df44){if(_0x36f6ca['body']['id']){delete _0x36f6ca[_0xfa74('0x46')]['id'];}return db[_0xfa74('0x3e')][_0xfa74('0x43')]({'where':{'id':_0x36f6ca['params']['id']}})['then'](handleEntityNotFound(_0x91df44,null))[_0xfa74('0x21')](saveUpdates(_0x36f6ca[_0xfa74('0x46')],null))[_0xfa74('0x21')](respondWithResult(_0x91df44,null))[_0xfa74('0x44')](handleError(_0x91df44,null));};exports[_0xfa74('0x22')]=function(_0x3cb23d,_0x2d217d){return db[_0xfa74('0x3e')]['find']({'where':{'id':_0x3cb23d[_0xfa74('0x41')]['id']}})[_0xfa74('0x21')](handleEntityNotFound(_0x2d217d,null))[_0xfa74('0x21')](removeEntity(_0x2d217d,null))[_0xfa74('0x44')](handleError(_0x2d217d,null));};exports['getConfigurations']=function(_0x4ec218,_0x3146de,_0x5b3404){var _0x152eaa={};var _0x221dc7={};var _0x427469;var _0x33e31e;return db[_0xfa74('0x3e')][_0xfa74('0x47')]({'where':{'id':_0x4ec218[_0xfa74('0x41')]['id']}})['then'](handleEntityNotFound(_0x3146de,null))[_0xfa74('0x21')](function(_0x4bcee3){if(_0x4bcee3){_0x427469=_0x4bcee3;_0x221dc7[_0xfa74('0x2a')]=_['keys'](db['ZendeskConfiguration'][_0xfa74('0x27')]);_0x221dc7[_0xfa74('0x2d')]=_['keys'](_0x4ec218['query']);_0x221dc7[_0xfa74('0x2e')]=_[_0xfa74('0x2f')](_0x221dc7[_0xfa74('0x2a')],_0x221dc7[_0xfa74('0x2d')]);_0x152eaa[_0xfa74('0x30')]=_[_0xfa74('0x2f')](_0x221dc7[_0xfa74('0x2a')],qs[_0xfa74('0x31')](_0x4ec218[_0xfa74('0x2d')][_0xfa74('0x31')]));_0x152eaa['attributes']=_0x152eaa[_0xfa74('0x30')][_0xfa74('0x42')]?_0x152eaa['attributes']:_0x221dc7['model'];_0x152eaa[_0xfa74('0x34')]=qs[_0xfa74('0x35')](_0x4ec218[_0xfa74('0x2d')][_0xfa74('0x35')]);_0x152eaa[_0xfa74('0x36')]=qs['filters'](_[_0xfa74('0x37')](_0x4ec218['query'],_0x221dc7[_0xfa74('0x2e')]));if(_0x4ec218[_0xfa74('0x2d')][_0xfa74('0x38')]){_0x152eaa['where']=_['merge'](_0x152eaa[_0xfa74('0x36')],{'$or':_[_0xfa74('0x2b')](_0x152eaa[_0xfa74('0x30')],function(_0x1b3484){var _0x53eca4={};_0x53eca4[_0x1b3484]={'$like':'%'+_0x4ec218[_0xfa74('0x2d')][_0xfa74('0x38')]+'%'};return _0x53eca4;})});}_0x152eaa=_['merge']({},_0x152eaa,_0x4ec218[_0xfa74('0x3b')]);return _0x427469[_0xfa74('0x48')](_0x152eaa);}})[_0xfa74('0x21')](function(_0x1681e7){if(_0x1681e7){_0x33e31e=_0x1681e7['length'];if(!_0x4ec218[_0xfa74('0x2d')]['hasOwnProperty'](_0xfa74('0x33'))){_0x152eaa[_0xfa74('0x1d')]=qs[_0xfa74('0x1d')](_0x4ec218[_0xfa74('0x2d')][_0xfa74('0x1d')]);_0x152eaa[_0xfa74('0x1a')]=qs[_0xfa74('0x1a')](_0x4ec218[_0xfa74('0x2d')][_0xfa74('0x1a')]);}return _0x427469[_0xfa74('0x48')](_0x152eaa);}})[_0xfa74('0x21')](function(_0x930728){if(_0x930728){return _0x930728?{'count':_0x33e31e,'rows':_0x930728}:null;}})[_0xfa74('0x21')](respondWithResult(_0x3146de,null))[_0xfa74('0x44')](handleError(_0x3146de,null));};exports[_0xfa74('0x49')]=function(_0x512b58,_0x2361d2,_0x3b0dd5){if(_0x512b58['body']['id']){delete _0x512b58['body']['id'];}return db[_0xfa74('0x3e')]['findOne']({'where':{'id':_0x512b58[_0xfa74('0x41')]['id']}})[_0xfa74('0x21')](handleEntityNotFound(_0x2361d2,null))[_0xfa74('0x21')](function(_0x529921){if(_0x529921){_0x512b58[_0xfa74('0x46')]['AccountId']=_0x529921['id'];_0x512b58['body'][_0xfa74('0x4a')]=integrations[_0xfa74('0x4b')](_0x512b58[_0xfa74('0x46')][_0xfa74('0x4c')],_0x512b58[_0xfa74('0x46')][_0xfa74('0x4d')]);_0x512b58[_0xfa74('0x46')][_0xfa74('0x4e')]=integrations[_0xfa74('0x4f')](_0x512b58[_0xfa74('0x46')][_0xfa74('0x4c')],_0x512b58['body'][_0xfa74('0x4d')]);return db['ZendeskConfiguration'][_0xfa74('0x45')](_0x512b58[_0xfa74('0x46')],{'include':[{'model':db[_0xfa74('0x50')],'as':'Subjects'},{'model':db[_0xfa74('0x50')],'as':_0xfa74('0x4e')}]});}return null;})[_0xfa74('0x21')](respondWithResult(_0x2361d2,null))['catch'](handleError(_0x2361d2,null));};exports[_0xfa74('0x51')]=function(_0x34e772,_0x474462,_0x1105e5){var _0x10e5f5='';return db['ZendeskAccount'][_0xfa74('0x47')]({'where':{'id':_0x34e772[_0xfa74('0x41')]['id']},'attributes':['id',_0xfa74('0x52'),_0xfa74('0x53'),_0xfa74('0x54'),_0xfa74('0x55'),_0xfa74('0x56')]})[_0xfa74('0x21')](handleEntityNotFound(_0x474462,null))[_0xfa74('0x21')](function(_0x3526d7){if(_0x3526d7){_0x10e5f5=_0x3526d7[_0xfa74('0x56')];var _0x30aec7=_0x10e5f5['slice'](-0x1);if(_0x30aec7==='/'){_0x10e5f5=_0x10e5f5[_0xfa74('0x57')](0x0,_0x10e5f5[_0xfa74('0x58')](_0x30aec7));}var _0xdffc88={'method':_0xfa74('0x59'),'uri':util[_0xfa74('0x5a')](_0xfa74('0x5b'),_0x10e5f5,_0xfa74('0x5c')),'json':!![]};switch(_0x3526d7[_0xfa74('0x55')]){case'password':_0xdffc88[_0xfa74('0x5d')]={'Authorization':util[_0xfa74('0x5a')](_0xfa74('0x5e'),new Buffer(util[_0xfa74('0x5a')]('%s:%s',_0x3526d7[_0xfa74('0x52')],_0x3526d7[_0xfa74('0x53')]))[_0xfa74('0x5f')](_0xfa74('0x60')))};break;case'token':_0xdffc88[_0xfa74('0x5d')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0xfa74('0x5a')]('%s/token:%s',_0x3526d7[_0xfa74('0x52')],_0x3526d7[_0xfa74('0x54')]))['toString']('base64'))};break;default:throw new db[(_0xfa74('0x61'))][(_0xfa74('0x62'))](_0xfa74('0x63'));}return rp(_0xdffc88);}})[_0xfa74('0x21')](function(_0x4f1acc){if(_0x4f1acc){var _0x5acb9b=['subject',_0xfa74('0x64'),_0xfa74('0x65'),_0xfa74('0x66')];_[_0xfa74('0x67')](_0x4f1acc[_0xfa74('0x5c')],function(_0x52e8ac){return _0x5acb9b[_0xfa74('0x68')](_0x52e8ac[_0xfa74('0x4d')]);});return{'count':_0x4f1acc[_0xfa74('0x5c')][_0xfa74('0x42')],'rows':_[_0xfa74('0x2b')](_0x4f1acc[_0xfa74('0x5c')],function(_0x358db2){return{'id':_0x358db2['id'],'name':_0x358db2[_0xfa74('0x69')]>0x7?_0x358db2[_0xfa74('0x6a')]:_0x358db2['type'],'custom':_0x358db2['position']>0x7?!![]:![],'options':_0x358db2['system_field_options']?_0x358db2[_0xfa74('0x6b')]:_0x358db2[_0xfa74('0x6c')]?_0x358db2[_0xfa74('0x6c')]:[]};})};}})[_0xfa74('0x21')](respondWithResult(_0x474462,null))[_0xfa74('0x44')](function(_0x533649){var _0x3e4323=_0x34e772[_0xfa74('0x2d')]['test']?0x1f4:_0x533649[_0xfa74('0x6d')]||0x1f4;logger['error'](_0xfa74('0x6e'),_0xfa74('0x51'),_0x3e4323,JSON[_0xfa74('0x6f')](_0x533649));delete _0x533649[_0xfa74('0x25')];if(_0x3e4323===0x191){_0x3e4323=0x190;}_0x474462[_0xfa74('0x17')](_0x3e4323)[_0xfa74('0x70')](_0x34e772[_0xfa74('0x2d')][_0xfa74('0x71')]?{'message':'Wrong\x20credentials','statusCode':_0x533649['statusCode']}:_0x533649);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 6901693..6f588f4 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 _0x1ceb=['int_zendesk_accounts','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount'];(function(_0x41982d,_0x3e9af4){var _0x48d4c4=function(_0x5baf59){while(--_0x5baf59){_0x41982d['push'](_0x41982d['shift']());}};_0x48d4c4(++_0x3e9af4);}(_0x1ceb,0xde));var _0xb1ce=function(_0x3f47ec,_0x453adc){_0x3f47ec=_0x3f47ec-0x0;var _0x39696c=_0x1ceb[_0x3f47ec];return _0x39696c;};'use strict';var _=require(_0xb1ce('0x0'));var util=require('util');var logger=require(_0xb1ce('0x1'))('api');var moment=require(_0xb1ce('0x2'));var BPromise=require(_0xb1ce('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb1ce('0x4'));var rimraf=require(_0xb1ce('0x5'));var config=require(_0xb1ce('0x6'));var attributes=require(_0xb1ce('0x7'));var integrations=require(_0xb1ce('0x8'));module[_0xb1ce('0x9')]=function(_0x5f133d,_0xc814b7){return _0x5f133d[_0xb1ce('0xa')](_0xb1ce('0xb'),attributes,{'tableName':_0xb1ce('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf206=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intZendeskAccount.attributes','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util'];(function(_0x3312ee,_0x686154){var _0x5e5fbf=function(_0x3941db){while(--_0x3941db){_0x3312ee['push'](_0x3312ee['shift']());}};_0x5e5fbf(++_0x686154);}(_0xf206,0x8d));var _0x6f20=function(_0x25eb96,_0x15af3){_0x25eb96=_0x25eb96-0x0;var _0x64c42b=_0xf206[_0x25eb96];return _0x64c42b;};'use strict';var _=require(_0x6f20('0x0'));var util=require(_0x6f20('0x1'));var logger=require(_0x6f20('0x2'))(_0x6f20('0x3'));var moment=require(_0x6f20('0x4'));var BPromise=require('bluebird');var rp=require(_0x6f20('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6f20('0x6'));var config=require(_0x6f20('0x7'));var attributes=require(_0x6f20('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x6f20('0x9')]=function(_0x5d115b,_0x7d2118){return _0x5d115b[_0x6f20('0xa')](_0x6f20('0xb'),attributes,{'tableName':_0x6f20('0xc'),'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 0773c76..9d45a25 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 _0xa8d8=['moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ZendeskAccount','options','where','attributes','limit','map','include','model','GetZendeskAccount','debug','stringify','find','raw','ShowZendeskAccount','lodash'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xa8d8,0x1c6));var _0x8a8d=function(_0x27a824,_0x50dc82){_0x27a824=_0x27a824-0x0;var _0x5a1a7b=_0xa8d8[_0x27a824];return _0x5a1a7b;};'use strict';var _=require(_0x8a8d('0x0'));var util=require('util');var moment=require(_0x8a8d('0x1'));var BPromise=require('bluebird');var rs=require(_0x8a8d('0x2'));var fs=require('fs');var Redis=require(_0x8a8d('0x3'));var db=require(_0x8a8d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8a8d('0x5'))(_0x8a8d('0x6'));var config=require(_0x8a8d('0x7'));var jayson=require(_0x8a8d('0x8'));var client=jayson[_0x8a8d('0x9')][_0x8a8d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35f3ef,_0x3bccbe,_0x27140c){return new BPromise(function(_0x37884a,_0x2a8cc1){return client['request'](_0x35f3ef,_0x27140c)[_0x8a8d('0xb')](function(_0x83a24d){logger[_0x8a8d('0xc')](_0x8a8d('0xd'),_0x3bccbe,_0x8a8d('0xe'));logger['debug'](_0x8a8d('0xf'),_0x3bccbe,_0x8a8d('0xe'),JSON['stringify'](_0x83a24d));if(_0x83a24d[_0x8a8d('0x10')]){if(_0x83a24d[_0x8a8d('0x10')][_0x8a8d('0x11')]===0x1f4){logger['error'](_0x8a8d('0xd'),_0x3bccbe,_0x83a24d[_0x8a8d('0x10')][_0x8a8d('0x12')]);return _0x2a8cc1(_0x83a24d[_0x8a8d('0x10')]['message']);}logger[_0x8a8d('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x3bccbe,_0x83a24d[_0x8a8d('0x10')][_0x8a8d('0x12')]);return _0x37884a(_0x83a24d['error'][_0x8a8d('0x12')]);}else{logger[_0x8a8d('0xc')](_0x8a8d('0xd'),_0x3bccbe,_0x8a8d('0xe'));_0x37884a(_0x83a24d[_0x8a8d('0x13')][_0x8a8d('0x12')]);}})[_0x8a8d('0x14')](function(_0x12d976){logger[_0x8a8d('0x10')](_0x8a8d('0xd'),_0x3bccbe,_0x12d976);_0x2a8cc1(_0x12d976);});});}exports['GetZendeskAccount']=function(_0x3076c9){var _0x4a5172=this;return new Promise(function(_0x5e11c5,_0x479b06){return db[_0x8a8d('0x15')]['findAll']({'raw':_0x3076c9[_0x8a8d('0x16')]?_0x3076c9['options']['raw']===undefined?!![]:![]:!![],'where':_0x3076c9[_0x8a8d('0x16')]?_0x3076c9[_0x8a8d('0x16')][_0x8a8d('0x17')]||null:null,'attributes':_0x3076c9[_0x8a8d('0x16')]?_0x3076c9[_0x8a8d('0x16')][_0x8a8d('0x18')]||null:null,'limit':_0x3076c9['options']?_0x3076c9['options'][_0x8a8d('0x19')]||null:null,'include':_0x3076c9[_0x8a8d('0x16')]?_0x3076c9['options']['include']?_[_0x8a8d('0x1a')](_0x3076c9['options'][_0x8a8d('0x1b')],function(_0x3312f1){return{'model':db[_0x3312f1[_0x8a8d('0x1c')]],'as':_0x3312f1['as'],'attributes':_0x3312f1[_0x8a8d('0x18')],'include':_0x3312f1[_0x8a8d('0x1b')]?_['map'](_0x3312f1['include'],function(_0x15a733){return{'model':db[_0x15a733[_0x8a8d('0x1c')]],'as':_0x15a733['as'],'attributes':_0x15a733['attributes'],'include':_0x15a733[_0x8a8d('0x1b')]?_[_0x8a8d('0x1a')](_0x15a733[_0x8a8d('0x1b')],function(_0x1c7625){return{'model':db[_0x1c7625['model']],'as':_0x1c7625['as'],'attributes':_0x1c7625['attributes']};}):[]};}):[]};}):[]:[]})[_0x8a8d('0xb')](function(_0x5e5dfb){logger[_0x8a8d('0xc')](_0x8a8d('0x1d'),_0x3076c9);logger[_0x8a8d('0x1e')](_0x8a8d('0x1d'),_0x3076c9,JSON[_0x8a8d('0x1f')](_0x5e5dfb));_0x5e11c5(_0x5e5dfb);})[_0x8a8d('0x14')](function(_0x2df574){logger['error']('GetZendeskAccount',_0x2df574['message'],_0x3076c9);_0x479b06(_0x4a5172[_0x8a8d('0x10')](0x1f4,_0x2df574[_0x8a8d('0x12')]));});});};exports['ShowZendeskAccount']=function(_0x2237b7){var _0x13d995=this;return new Promise(function(_0x3cc074,_0x479d50){return db[_0x8a8d('0x15')][_0x8a8d('0x20')]({'raw':_0x2237b7[_0x8a8d('0x16')]?_0x2237b7[_0x8a8d('0x16')][_0x8a8d('0x21')]===undefined?!![]:![]:!![],'where':_0x2237b7[_0x8a8d('0x16')]?_0x2237b7[_0x8a8d('0x16')][_0x8a8d('0x17')]||null:null,'attributes':_0x2237b7[_0x8a8d('0x16')]?_0x2237b7[_0x8a8d('0x16')]['attributes']||null:null,'include':_0x2237b7[_0x8a8d('0x16')]?_0x2237b7[_0x8a8d('0x16')][_0x8a8d('0x1b')]?_[_0x8a8d('0x1a')](_0x2237b7['options'][_0x8a8d('0x1b')],function(_0x3930e8){return{'model':db[_0x3930e8[_0x8a8d('0x1c')]],'as':_0x3930e8['as'],'attributes':_0x3930e8['attributes'],'include':_0x3930e8['include']?_[_0x8a8d('0x1a')](_0x3930e8[_0x8a8d('0x1b')],function(_0x2ddfed){return{'model':db[_0x2ddfed[_0x8a8d('0x1c')]],'as':_0x2ddfed['as'],'attributes':_0x2ddfed[_0x8a8d('0x18')],'include':_0x2ddfed['include']?_[_0x8a8d('0x1a')](_0x2ddfed['include'],function(_0x156add){return{'model':db[_0x156add[_0x8a8d('0x1c')]],'as':_0x156add['as'],'attributes':_0x156add['attributes']};}):[]};}):[]};}):[]:[]})[_0x8a8d('0xb')](function(_0x3a1431){logger['info'](_0x8a8d('0x22'),_0x2237b7);logger['debug'](_0x8a8d('0x22'),_0x2237b7,JSON['stringify'](_0x3a1431));_0x3cc074(_0x3a1431);})['catch'](function(_0xd0a4c5){logger[_0x8a8d('0x10')](_0x8a8d('0x22'),_0xd0a4c5[_0x8a8d('0x12')],_0x2237b7);_0x479d50(_0x13d995[_0x8a8d('0x10')](0x1f4,_0xd0a4c5['message']));});});}; \ No newline at end of file +var _0x7182=['../../config/logger','rpc','../../config/environment','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','map','include','model','ShowZendeskAccount','find','lodash','util','moment','ioredis','../../config/utils'];(function(_0xf04c6d,_0xe98786){var _0x4a804e=function(_0x431a0a){while(--_0x431a0a){_0xf04c6d['push'](_0xf04c6d['shift']());}};_0x4a804e(++_0xe98786);}(_0x7182,0x187));var _0x2718=function(_0x4adfcc,_0x16efca){_0x4adfcc=_0x4adfcc-0x0;var _0x2be552=_0x7182[_0x4adfcc];return _0x2be552;};'use strict';var _=require(_0x2718('0x0'));var util=require(_0x2718('0x1'));var moment=require(_0x2718('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2718('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2718('0x4'));var logger=require(_0x2718('0x5'))(_0x2718('0x6'));var config=require(_0x2718('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2718('0x8')][_0x2718('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e5e1b,_0x3ca7e0,_0x9b3f25){return new BPromise(function(_0x2b9e33,_0x17d40f){return client[_0x2718('0xa')](_0x1e5e1b,_0x9b3f25)[_0x2718('0xb')](function(_0xc42cc5){logger[_0x2718('0xc')](_0x2718('0xd'),_0x3ca7e0,_0x2718('0xe'));logger[_0x2718('0xf')](_0x2718('0x10'),_0x3ca7e0,'request\x20sent',JSON[_0x2718('0x11')](_0xc42cc5));if(_0xc42cc5['error']){if(_0xc42cc5['error']['code']===0x1f4){logger[_0x2718('0x12')](_0x2718('0xd'),_0x3ca7e0,_0xc42cc5['error'][_0x2718('0x13')]);return _0x17d40f(_0xc42cc5[_0x2718('0x12')]['message']);}logger['error'](_0x2718('0xd'),_0x3ca7e0,_0xc42cc5['error']['message']);return _0x2b9e33(_0xc42cc5[_0x2718('0x12')]['message']);}else{logger[_0x2718('0xc')](_0x2718('0xd'),_0x3ca7e0,_0x2718('0xe'));_0x2b9e33(_0xc42cc5['result']['message']);}})[_0x2718('0x14')](function(_0x27dfce){logger[_0x2718('0x12')](_0x2718('0xd'),_0x3ca7e0,_0x27dfce);_0x17d40f(_0x27dfce);});});}exports[_0x2718('0x15')]=function(_0x15fbbf){var _0x4cde94=this;return new Promise(function(_0x3b9feb,_0x58f0eb){return db[_0x2718('0x16')][_0x2718('0x17')]({'raw':_0x15fbbf[_0x2718('0x18')]?_0x15fbbf[_0x2718('0x18')][_0x2718('0x19')]===undefined?!![]:![]:!![],'where':_0x15fbbf[_0x2718('0x18')]?_0x15fbbf[_0x2718('0x18')][_0x2718('0x1a')]||null:null,'attributes':_0x15fbbf[_0x2718('0x18')]?_0x15fbbf[_0x2718('0x18')][_0x2718('0x1b')]||null:null,'limit':_0x15fbbf[_0x2718('0x18')]?_0x15fbbf[_0x2718('0x18')]['limit']||null:null,'include':_0x15fbbf[_0x2718('0x18')]?_0x15fbbf[_0x2718('0x18')]['include']?_[_0x2718('0x1c')](_0x15fbbf['options'][_0x2718('0x1d')],function(_0x51edc5){return{'model':db[_0x51edc5[_0x2718('0x1e')]],'as':_0x51edc5['as'],'attributes':_0x51edc5['attributes'],'include':_0x51edc5['include']?_[_0x2718('0x1c')](_0x51edc5[_0x2718('0x1d')],function(_0x21bde4){return{'model':db[_0x21bde4['model']],'as':_0x21bde4['as'],'attributes':_0x21bde4['attributes'],'include':_0x21bde4['include']?_['map'](_0x21bde4[_0x2718('0x1d')],function(_0x5e8ee2){return{'model':db[_0x5e8ee2['model']],'as':_0x5e8ee2['as'],'attributes':_0x5e8ee2[_0x2718('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2718('0xb')](function(_0x38cd16){logger[_0x2718('0xc')](_0x2718('0x15'),_0x15fbbf);logger[_0x2718('0xf')]('GetZendeskAccount',_0x15fbbf,JSON[_0x2718('0x11')](_0x38cd16));_0x3b9feb(_0x38cd16);})[_0x2718('0x14')](function(_0x4f3736){logger[_0x2718('0x12')]('GetZendeskAccount',_0x4f3736['message'],_0x15fbbf);_0x58f0eb(_0x4cde94[_0x2718('0x12')](0x1f4,_0x4f3736[_0x2718('0x13')]));});});};exports[_0x2718('0x1f')]=function(_0x20a302){var _0x1fa3c5=this;return new Promise(function(_0x3e0aa5,_0x37f30e){return db['ZendeskAccount'][_0x2718('0x20')]({'raw':_0x20a302[_0x2718('0x18')]?_0x20a302[_0x2718('0x18')][_0x2718('0x19')]===undefined?!![]:![]:!![],'where':_0x20a302[_0x2718('0x18')]?_0x20a302[_0x2718('0x18')]['where']||null:null,'attributes':_0x20a302[_0x2718('0x18')]?_0x20a302[_0x2718('0x18')][_0x2718('0x1b')]||null:null,'include':_0x20a302[_0x2718('0x18')]?_0x20a302[_0x2718('0x18')]['include']?_[_0x2718('0x1c')](_0x20a302[_0x2718('0x18')]['include'],function(_0xe2580b){return{'model':db[_0xe2580b['model']],'as':_0xe2580b['as'],'attributes':_0xe2580b['attributes'],'include':_0xe2580b[_0x2718('0x1d')]?_['map'](_0xe2580b[_0x2718('0x1d')],function(_0x50e1dc){return{'model':db[_0x50e1dc['model']],'as':_0x50e1dc['as'],'attributes':_0x50e1dc['attributes'],'include':_0x50e1dc[_0x2718('0x1d')]?_[_0x2718('0x1c')](_0x50e1dc[_0x2718('0x1d')],function(_0x2dd2bd){return{'model':db[_0x2dd2bd['model']],'as':_0x2dd2bd['as'],'attributes':_0x2dd2bd['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x26baff){logger[_0x2718('0xc')]('ShowZendeskAccount',_0x20a302);logger[_0x2718('0xf')](_0x2718('0x1f'),_0x20a302,JSON[_0x2718('0x11')](_0x26baff));_0x3e0aa5(_0x26baff);})[_0x2718('0x14')](function(_0x5de60a){logger[_0x2718('0x12')](_0x2718('0x1f'),_0x5de60a['message'],_0x20a302);_0x37f30e(_0x1fa3c5['error'](0x1f4,_0x5de60a[_0x2718('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 1288a5d..8556553 100644 --- a/server/api/intZendeskConfiguration/index.js +++ b/server/api/intZendeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4fc2=['get','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskConfiguration.controller','isAuthenticated','index','/:id','show'];(function(_0x3fc01f,_0x40857c){var _0x484473=function(_0x29b1ee){while(--_0x29b1ee){_0x3fc01f['push'](_0x3fc01f['shift']());}};_0x484473(++_0x40857c);}(_0x4fc2,0x111));var _0x24fc=function(_0x56aa6c,_0x360d1c){_0x56aa6c=_0x56aa6c-0x0;var _0x580b72=_0x4fc2[_0x56aa6c];return _0x580b72;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var fs_extra=require(_0x24fc('0x5'));var auth=require(_0x24fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24fc('0x7'));var controller=require(_0x24fc('0x8'));router['get']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xa')]);router['get'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xc')]);router[_0x24fc('0xd')](_0x24fc('0xe'),auth[_0x24fc('0x9')](),controller['getFields']);router[_0x24fc('0xd')](_0x24fc('0xf'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x10')]);router[_0x24fc('0xd')](_0x24fc('0x11'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x12')]);router['get'](_0x24fc('0x13'),auth[_0x24fc('0x9')](),controller['getTags']);router[_0x24fc('0x14')]('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0x15')]);router[_0x24fc('0x14')](_0x24fc('0x13'),auth[_0x24fc('0x9')](),controller['setTags']);router[_0x24fc('0x16')](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x17')]);router['delete'](_0x24fc('0xb'),auth['isAuthenticated'](),controller[_0x24fc('0x18')]);module[_0x24fc('0x19')]=router; \ No newline at end of file +var _0xcb91=['get','index','isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','create','post','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intZendeskConfiguration.controller'];(function(_0x5b984b,_0x355e68){var _0x52e07d=function(_0x5b5064){while(--_0x5b5064){_0x5b984b['push'](_0x5b984b['shift']());}};_0x52e07d(++_0x355e68);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x19d350,_0x3c843f){_0x19d350=_0x19d350-0x0;var _0x3bfc8d=_0xcb91[_0x19d350];return _0x3bfc8d;};'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')]('/:id',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['getFields']);router[_0x1cb9('0x7')](_0x1cb9('0xc'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xd')]);router[_0x1cb9('0x7')]('/:id/descriptions',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xe')]);router[_0x1cb9('0x7')](_0x1cb9('0xf'),auth[_0x1cb9('0x9')](),controller['getTags']);router['post']('/',auth['isAuthenticated'](),controller[_0x1cb9('0x10')]);router[_0x1cb9('0x11')](_0x1cb9('0xf'),auth[_0x1cb9('0x9')](),controller['setTags']);router[_0x1cb9('0x12')](_0x1cb9('0x13'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x14')]);router[_0x1cb9('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x1cb9('0x16')]);module[_0x1cb9('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index aa1bc6c..7208dc3 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 _0x7e2e=['sequelize','STRING'];(function(_0xeed318,_0x860c42){var _0x38e1f9=function(_0x20daa4){while(--_0x20daa4){_0xeed318['push'](_0xeed318['shift']());}};_0x38e1f9(++_0x860c42);}(_0x7e2e,0x1f0));var _0xe7e2=function(_0x1a01b0,_0x4c393f){_0x1a01b0=_0x1a01b0-0x0;var _0x23f44b=_0x7e2e[_0x1a01b0];return _0x23f44b;};'use strict';var Sequelize=require(_0xe7e2('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe7e2('0x1')]}}; \ No newline at end of file +var _0x015d=['sequelize','exports','STRING'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x015d,0x11d));var _0xd015=function(_0x2ad008,_0x45c253){_0x2ad008=_0x2ad008-0x0;var _0x4538cf=_0x015d[_0x2ad008];return _0x4538cf;};'use strict';var Sequelize=require(_0xd015('0x0'));module[_0xd015('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd015('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index acecf2a..e840e8b 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 _0x9678=['attributes','length','hasOwnProperty','order','sort','where','pick','merge','filter','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','intersection','getFields','nolimit','findOne','ZendeskField','getSubjects','getDescriptions','Tag','getTags','setTags','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','ZendeskConfiguration','rawAttributes','fieldName','type','model','map','query','keys','filters','fields'];(function(_0x470a29,_0x5c33fd){var _0x1f98d9=function(_0x5f5d52){while(--_0x5f5d52){_0x470a29['push'](_0x470a29['shift']());}};_0x1f98d9(++_0x5c33fd);}(_0x9678,0x1b3));var _0x8967=function(_0x32d004,_0x17e605){_0x32d004=_0x32d004-0x0;var _0x787d39=_0x9678[_0x32d004];return _0x787d39;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8967('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8967('0x1'));var moment=require('moment');var BPromise=require(_0x8967('0x2'));var Mustache=require(_0x8967('0x3'));var util=require(_0x8967('0x4'));var path=require(_0x8967('0x5'));var sox=require(_0x8967('0x6'));var csv=require(_0x8967('0x7'));var ejs=require(_0x8967('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8967('0x9'));var squel=require(_0x8967('0xa'));var crypto=require(_0x8967('0xb'));var jsforce=require(_0x8967('0xc'));var deskjs=require(_0x8967('0xd'));var toCsv=require(_0x8967('0x7'));var querystring=require(_0x8967('0xe'));var Papa=require(_0x8967('0xf'));var Redis=require(_0x8967('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8967('0x11'));var as=require(_0x8967('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8967('0x13'));var utils=require(_0x8967('0x14'));var config=require(_0x8967('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x33fa6d,_0x36de03){_0x36de03=_0x36de03||0xcc;return function(_0xa5efad){if(_0xa5efad){return _0x33fa6d[_0x8967('0x16')](_0x36de03);}return _0x33fa6d['status'](_0x36de03)[_0x8967('0x17')]();};}function respondWithResult(_0x1bc0da,_0x52289a){_0x52289a=_0x52289a||0xc8;return function(_0x3603dd){if(_0x3603dd){return _0x1bc0da[_0x8967('0x18')](_0x52289a)[_0x8967('0x19')](_0x3603dd);}};}function respondWithFilteredResult(_0x23d943,_0x5d8efa){return function(_0x26b10b){if(_0x26b10b){var _0x1c8e51=typeof _0x5d8efa[_0x8967('0x1a')]===_0x8967('0x1b')&&typeof _0x5d8efa[_0x8967('0x1c')]===_0x8967('0x1b');var _0x606ef7=_0x26b10b[_0x8967('0x1d')];var _0x4ab11c=_0x1c8e51?0x0:_0x5d8efa['offset'];var _0x282a47=_0x1c8e51?_0x26b10b[_0x8967('0x1d')]:_0x5d8efa['offset']+_0x5d8efa['limit'];var _0x2fe0c9;if(_0x282a47>=_0x606ef7){_0x282a47=_0x606ef7;_0x2fe0c9=0xc8;}else{_0x2fe0c9=0xce;}_0x23d943['status'](_0x2fe0c9);return _0x23d943[_0x8967('0x1e')](_0x8967('0x1f'),_0x4ab11c+'-'+_0x282a47+'/'+_0x606ef7)[_0x8967('0x19')](_0x26b10b);}return null;};}function patchUpdates(_0x5c6647){return function(_0x453ecb){try{jsonpatch[_0x8967('0x20')](_0x453ecb,_0x5c6647,!![]);}catch(_0xe8680e){return BPromise[_0x8967('0x21')](_0xe8680e);}return _0x453ecb[_0x8967('0x22')]();};}function saveUpdates(_0x10a487,_0x4d6baa){return function(_0x424341){if(_0x424341){return _0x424341[_0x8967('0x23')](_0x10a487)[_0x8967('0x24')](function(_0x442984){return _0x442984;});}return null;};}function removeEntity(_0x4e7f8b,_0x19cd70){return function(_0xa24c16){if(_0xa24c16){return _0xa24c16[_0x8967('0x25')]()['then'](function(){_0x4e7f8b['status'](0xcc)[_0x8967('0x17')]();});}};}function handleEntityNotFound(_0x2c6ea0,_0x589219){return function(_0x3f035b){if(!_0x3f035b){_0x2c6ea0[_0x8967('0x16')](0x194);}return _0x3f035b;};}function handleError(_0xf95c31,_0x4d61f3){_0x4d61f3=_0x4d61f3||0x1f4;return function(_0x30ac68){logger['error'](_0x30ac68[_0x8967('0x26')]);if(_0x30ac68['name']){delete _0x30ac68[_0x8967('0x27')];}_0xf95c31['status'](_0x4d61f3)['send'](_0x30ac68);};}exports[_0x8967('0x28')]=function(_0x300d36,_0x1da382){var _0x5ba116={},_0x81b606={},_0x949711={'count':0x0,'rows':[]};var _0x50e59f=_['map'](db[_0x8967('0x29')][_0x8967('0x2a')],function(_0x544eec){return{'name':_0x544eec[_0x8967('0x2b')],'type':_0x544eec[_0x8967('0x2c')]['key']};});_0x81b606[_0x8967('0x2d')]=_[_0x8967('0x2e')](_0x50e59f,_0x8967('0x27'));_0x81b606[_0x8967('0x2f')]=_[_0x8967('0x30')](_0x300d36[_0x8967('0x2f')]);_0x81b606[_0x8967('0x31')]=_['intersection'](_0x81b606[_0x8967('0x2d')],_0x81b606[_0x8967('0x2f')]);_0x5ba116['attributes']=_['intersection'](_0x81b606['model'],qs[_0x8967('0x32')](_0x300d36[_0x8967('0x2f')][_0x8967('0x32')]));_0x5ba116[_0x8967('0x33')]=_0x5ba116['attributes'][_0x8967('0x34')]?_0x5ba116[_0x8967('0x33')]:_0x81b606[_0x8967('0x2d')];if(!_0x300d36[_0x8967('0x2f')][_0x8967('0x35')]('nolimit')){_0x5ba116[_0x8967('0x1c')]=qs[_0x8967('0x1c')](_0x300d36[_0x8967('0x2f')][_0x8967('0x1c')]);_0x5ba116[_0x8967('0x1a')]=qs[_0x8967('0x1a')](_0x300d36[_0x8967('0x2f')][_0x8967('0x1a')]);}_0x5ba116[_0x8967('0x36')]=qs['sort'](_0x300d36[_0x8967('0x2f')][_0x8967('0x37')]);_0x5ba116[_0x8967('0x38')]=qs[_0x8967('0x31')](_[_0x8967('0x39')](_0x300d36[_0x8967('0x2f')],_0x81b606[_0x8967('0x31')]),_0x50e59f);if(_0x300d36['query']['filter']){_0x5ba116['where']=_[_0x8967('0x3a')](_0x5ba116[_0x8967('0x38')],{'$or':_[_0x8967('0x2e')](_0x50e59f,function(_0x472dce){if(_0x472dce['type']!=='VIRTUAL'){var _0x4e3cc5={};_0x4e3cc5[_0x472dce[_0x8967('0x27')]]={'$like':'%'+_0x300d36[_0x8967('0x2f')][_0x8967('0x3b')]+'%'};return _0x4e3cc5;}})});}_0x5ba116=_[_0x8967('0x3a')]({},_0x5ba116,_0x300d36['options']);var _0xed92e0={'where':_0x5ba116[_0x8967('0x38')]};return db[_0x8967('0x29')][_0x8967('0x1d')](_0xed92e0)[_0x8967('0x24')](function(_0x28b335){_0x949711[_0x8967('0x1d')]=_0x28b335;if(_0x300d36[_0x8967('0x2f')]['includeAll']){_0x5ba116[_0x8967('0x3c')]=[{'all':!![]}];}return db[_0x8967('0x29')][_0x8967('0x3d')](_0x5ba116);})['then'](function(_0x7abbd4){_0x949711[_0x8967('0x3e')]=_0x7abbd4;return _0x949711;})['then'](respondWithFilteredResult(_0x1da382,_0x5ba116))[_0x8967('0x3f')](handleError(_0x1da382,null));};exports[_0x8967('0x40')]=function(_0x172a8a,_0x2ab50b){var _0x2a6761={'raw':![],'where':{'id':_0x172a8a[_0x8967('0x41')]['id']}},_0x5ca6c1={};_0x5ca6c1[_0x8967('0x2d')]=_[_0x8967('0x30')](db[_0x8967('0x29')]['rawAttributes']);_0x5ca6c1[_0x8967('0x2f')]=_[_0x8967('0x30')](_0x172a8a[_0x8967('0x2f')]);_0x5ca6c1[_0x8967('0x31')]=_['intersection'](_0x5ca6c1[_0x8967('0x2d')],_0x5ca6c1[_0x8967('0x2f')]);_0x2a6761[_0x8967('0x33')]=_['intersection'](_0x5ca6c1[_0x8967('0x2d')],qs[_0x8967('0x32')](_0x172a8a[_0x8967('0x2f')]['fields']));_0x2a6761[_0x8967('0x33')]=_0x2a6761[_0x8967('0x33')][_0x8967('0x34')]?_0x2a6761[_0x8967('0x33')]:_0x5ca6c1[_0x8967('0x2d')];if(_0x172a8a[_0x8967('0x2f')][_0x8967('0x42')]){_0x2a6761[_0x8967('0x3c')]=[{'all':!![]}];}_0x2a6761=_[_0x8967('0x3a')]({},_0x2a6761,_0x172a8a[_0x8967('0x43')]);return db[_0x8967('0x29')][_0x8967('0x44')](_0x2a6761)['then'](handleEntityNotFound(_0x2ab50b,null))[_0x8967('0x24')](respondWithResult(_0x2ab50b,null))[_0x8967('0x3f')](handleError(_0x2ab50b,null));};exports['create']=function(_0x388dc5,_0x2a1532){return db[_0x8967('0x29')][_0x8967('0x45')](_0x388dc5[_0x8967('0x46')],{})['then'](respondWithResult(_0x2a1532,0xc9))[_0x8967('0x3f')](handleError(_0x2a1532,null));};exports[_0x8967('0x23')]=function(_0x210e92,_0xd7c929){if(_0x210e92[_0x8967('0x46')]['id']){delete _0x210e92[_0x8967('0x46')]['id'];}return db[_0x8967('0x29')][_0x8967('0x44')]({'where':{'id':_0x210e92[_0x8967('0x41')]['id']}})[_0x8967('0x24')](handleEntityNotFound(_0xd7c929,null))[_0x8967('0x24')](saveUpdates(_0x210e92['body'],null))[_0x8967('0x24')](respondWithResult(_0xd7c929,null))[_0x8967('0x3f')](handleError(_0xd7c929,null));};exports[_0x8967('0x25')]=function(_0xc10cd2,_0x287384){return db[_0x8967('0x29')]['find']({'where':{'id':_0xc10cd2['params']['id']}})[_0x8967('0x24')](handleEntityNotFound(_0x287384,null))[_0x8967('0x24')](removeEntity(_0x287384,null))['catch'](handleError(_0x287384,null));};exports['getFields']=function(_0x3c03d7,_0x4b7c02,_0x346ed8){var _0x279f63={};var _0x417814={};var _0x41271c;var _0x5e0d33;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x3c03d7['params']['id']}})[_0x8967('0x24')](handleEntityNotFound(_0x4b7c02,null))['then'](function(_0x2bd05c){if(_0x2bd05c){_0x41271c=_0x2bd05c;_0x417814[_0x8967('0x2d')]=_['keys'](db['ZendeskField'][_0x8967('0x2a')]);_0x417814['query']=_[_0x8967('0x30')](_0x3c03d7['query']);_0x417814[_0x8967('0x31')]=_['intersection'](_0x417814[_0x8967('0x2d')],_0x417814['query']);_0x279f63['attributes']=_[_0x8967('0x47')](_0x417814[_0x8967('0x2d')],qs[_0x8967('0x32')](_0x3c03d7['query'][_0x8967('0x32')]));_0x279f63[_0x8967('0x33')]=_0x279f63['attributes'][_0x8967('0x34')]?_0x279f63[_0x8967('0x33')]:_0x417814[_0x8967('0x2d')];_0x279f63['order']=qs[_0x8967('0x37')](_0x3c03d7['query'][_0x8967('0x37')]);_0x279f63[_0x8967('0x38')]=qs[_0x8967('0x31')](_[_0x8967('0x39')](_0x3c03d7[_0x8967('0x2f')],_0x417814['filters']));if(_0x3c03d7[_0x8967('0x2f')]['filter']){_0x279f63[_0x8967('0x38')]=_[_0x8967('0x3a')](_0x279f63['where'],{'$or':_[_0x8967('0x2e')](_0x279f63[_0x8967('0x33')],function(_0x43ace5){var _0x3d7023={};_0x3d7023[_0x43ace5]={'$like':'%'+_0x3c03d7[_0x8967('0x2f')][_0x8967('0x3b')]+'%'};return _0x3d7023;})});}_0x279f63=_['merge']({},_0x279f63,_0x3c03d7[_0x8967('0x43')]);return _0x41271c[_0x8967('0x48')](_0x279f63);}})[_0x8967('0x24')](function(_0x384235){if(_0x384235){_0x5e0d33=_0x384235['length'];if(!_0x3c03d7[_0x8967('0x2f')][_0x8967('0x35')](_0x8967('0x49'))){_0x279f63[_0x8967('0x1c')]=qs[_0x8967('0x1c')](_0x3c03d7['query'][_0x8967('0x1c')]);_0x279f63['offset']=qs[_0x8967('0x1a')](_0x3c03d7[_0x8967('0x2f')][_0x8967('0x1a')]);}return _0x41271c[_0x8967('0x48')](_0x279f63);}})[_0x8967('0x24')](function(_0x3492bb){if(_0x3492bb){return _0x3492bb?{'count':_0x5e0d33,'rows':_0x3492bb}:null;}})[_0x8967('0x24')](respondWithResult(_0x4b7c02,null))['catch'](handleError(_0x4b7c02,null));};exports['getSubjects']=function(_0x38a45b,_0x10cfc2,_0x39f815){var _0x15336c={};var _0x114218={};var _0x523501;var _0x2a59de;return db[_0x8967('0x29')][_0x8967('0x4a')]({'where':{'id':_0x38a45b['params']['id']}})['then'](handleEntityNotFound(_0x10cfc2,null))[_0x8967('0x24')](function(_0x5971c4){if(_0x5971c4){_0x523501=_0x5971c4;_0x114218[_0x8967('0x2d')]=_[_0x8967('0x30')](db[_0x8967('0x4b')]['rawAttributes']);_0x114218[_0x8967('0x2f')]=_['keys'](_0x38a45b['query']);_0x114218['filters']=_[_0x8967('0x47')](_0x114218[_0x8967('0x2d')],_0x114218['query']);_0x15336c[_0x8967('0x33')]=_[_0x8967('0x47')](_0x114218[_0x8967('0x2d')],qs[_0x8967('0x32')](_0x38a45b[_0x8967('0x2f')][_0x8967('0x32')]));_0x15336c[_0x8967('0x33')]=_0x15336c[_0x8967('0x33')][_0x8967('0x34')]?_0x15336c[_0x8967('0x33')]:_0x114218[_0x8967('0x2d')];_0x15336c[_0x8967('0x36')]=qs['sort'](_0x38a45b[_0x8967('0x2f')][_0x8967('0x37')]);_0x15336c['where']=qs[_0x8967('0x31')](_['pick'](_0x38a45b['query'],_0x114218[_0x8967('0x31')]));if(_0x38a45b[_0x8967('0x2f')]['filter']){_0x15336c[_0x8967('0x38')]=_[_0x8967('0x3a')](_0x15336c[_0x8967('0x38')],{'$or':_[_0x8967('0x2e')](_0x15336c[_0x8967('0x33')],function(_0x143f9d){var _0x100332={};_0x100332[_0x143f9d]={'$like':'%'+_0x38a45b[_0x8967('0x2f')][_0x8967('0x3b')]+'%'};return _0x100332;})});}_0x15336c=_[_0x8967('0x3a')]({},_0x15336c,_0x38a45b[_0x8967('0x43')]);return _0x523501['getSubjects'](_0x15336c);}})[_0x8967('0x24')](function(_0x3b69bd){if(_0x3b69bd){_0x2a59de=_0x3b69bd[_0x8967('0x34')];if(!_0x38a45b['query']['hasOwnProperty'](_0x8967('0x49'))){_0x15336c[_0x8967('0x1c')]=qs[_0x8967('0x1c')](_0x38a45b[_0x8967('0x2f')][_0x8967('0x1c')]);_0x15336c['offset']=qs[_0x8967('0x1a')](_0x38a45b[_0x8967('0x2f')][_0x8967('0x1a')]);}return _0x523501[_0x8967('0x4c')](_0x15336c);}})[_0x8967('0x24')](function(_0x59cbea){if(_0x59cbea){return _0x59cbea?{'count':_0x2a59de,'rows':_0x59cbea}:null;}})[_0x8967('0x24')](respondWithResult(_0x10cfc2,null))[_0x8967('0x3f')](handleError(_0x10cfc2,null));};exports['getDescriptions']=function(_0x58f956,_0x3b128f,_0x10ab2c){var _0x2bd84c={};var _0x1d2285={};var _0x8664de;var _0x2afd1b;return db[_0x8967('0x29')][_0x8967('0x4a')]({'where':{'id':_0x58f956['params']['id']}})[_0x8967('0x24')](handleEntityNotFound(_0x3b128f,null))[_0x8967('0x24')](function(_0xd8f9b0){if(_0xd8f9b0){_0x8664de=_0xd8f9b0;_0x1d2285[_0x8967('0x2d')]=_[_0x8967('0x30')](db[_0x8967('0x4b')]['rawAttributes']);_0x1d2285['query']=_[_0x8967('0x30')](_0x58f956[_0x8967('0x2f')]);_0x1d2285[_0x8967('0x31')]=_['intersection'](_0x1d2285['model'],_0x1d2285[_0x8967('0x2f')]);_0x2bd84c[_0x8967('0x33')]=_[_0x8967('0x47')](_0x1d2285[_0x8967('0x2d')],qs[_0x8967('0x32')](_0x58f956[_0x8967('0x2f')][_0x8967('0x32')]));_0x2bd84c['attributes']=_0x2bd84c[_0x8967('0x33')]['length']?_0x2bd84c[_0x8967('0x33')]:_0x1d2285[_0x8967('0x2d')];_0x2bd84c[_0x8967('0x36')]=qs[_0x8967('0x37')](_0x58f956['query'][_0x8967('0x37')]);_0x2bd84c[_0x8967('0x38')]=qs[_0x8967('0x31')](_[_0x8967('0x39')](_0x58f956[_0x8967('0x2f')],_0x1d2285[_0x8967('0x31')]));if(_0x58f956[_0x8967('0x2f')]['filter']){_0x2bd84c[_0x8967('0x38')]=_[_0x8967('0x3a')](_0x2bd84c[_0x8967('0x38')],{'$or':_[_0x8967('0x2e')](_0x2bd84c[_0x8967('0x33')],function(_0x5588d3){var _0x14a6aa={};_0x14a6aa[_0x5588d3]={'$like':'%'+_0x58f956[_0x8967('0x2f')][_0x8967('0x3b')]+'%'};return _0x14a6aa;})});}_0x2bd84c=_[_0x8967('0x3a')]({},_0x2bd84c,_0x58f956[_0x8967('0x43')]);return _0x8664de[_0x8967('0x4d')](_0x2bd84c);}})['then'](function(_0x2915d4){if(_0x2915d4){_0x2afd1b=_0x2915d4['length'];if(!_0x58f956[_0x8967('0x2f')]['hasOwnProperty'](_0x8967('0x49'))){_0x2bd84c[_0x8967('0x1c')]=qs[_0x8967('0x1c')](_0x58f956['query'][_0x8967('0x1c')]);_0x2bd84c[_0x8967('0x1a')]=qs[_0x8967('0x1a')](_0x58f956[_0x8967('0x2f')][_0x8967('0x1a')]);}return _0x8664de[_0x8967('0x4d')](_0x2bd84c);}})[_0x8967('0x24')](function(_0x1dc8d4){if(_0x1dc8d4){return _0x1dc8d4?{'count':_0x2afd1b,'rows':_0x1dc8d4}:null;}})[_0x8967('0x24')](respondWithResult(_0x3b128f,null))[_0x8967('0x3f')](handleError(_0x3b128f,null));};exports['getTags']=function(_0x63b4e8,_0x4e8949,_0x500d9c){var _0x51cd2d={};var _0x16ba9e={};var _0x5b9dd0;var _0x1d8ea9;return db['ZendeskConfiguration'][_0x8967('0x4a')]({'where':{'id':_0x63b4e8['params']['id']}})[_0x8967('0x24')](handleEntityNotFound(_0x4e8949,null))[_0x8967('0x24')](function(_0x5d142c){if(_0x5d142c){_0x5b9dd0=_0x5d142c;_0x16ba9e[_0x8967('0x2d')]=_[_0x8967('0x30')](db[_0x8967('0x4e')]['rawAttributes']);_0x16ba9e[_0x8967('0x2f')]=_[_0x8967('0x30')](_0x63b4e8[_0x8967('0x2f')]);_0x16ba9e['filters']=_['intersection'](_0x16ba9e[_0x8967('0x2d')],_0x16ba9e[_0x8967('0x2f')]);_0x51cd2d[_0x8967('0x33')]=_[_0x8967('0x47')](_0x16ba9e['model'],qs[_0x8967('0x32')](_0x63b4e8['query']['fields']));_0x51cd2d[_0x8967('0x33')]=_0x51cd2d[_0x8967('0x33')]['length']?_0x51cd2d[_0x8967('0x33')]:_0x16ba9e[_0x8967('0x2d')];_0x51cd2d[_0x8967('0x36')]=qs[_0x8967('0x37')](_0x63b4e8[_0x8967('0x2f')][_0x8967('0x37')]);_0x51cd2d[_0x8967('0x38')]=qs[_0x8967('0x31')](_[_0x8967('0x39')](_0x63b4e8[_0x8967('0x2f')],_0x16ba9e[_0x8967('0x31')]));if(_0x63b4e8[_0x8967('0x2f')]['filter']){_0x51cd2d[_0x8967('0x38')]=_['merge'](_0x51cd2d[_0x8967('0x38')],{'$or':_[_0x8967('0x2e')](_0x51cd2d['attributes'],function(_0x2bd9a8){var _0x79d53e={};_0x79d53e[_0x2bd9a8]={'$like':'%'+_0x63b4e8['query'][_0x8967('0x3b')]+'%'};return _0x79d53e;})});}_0x51cd2d=_['merge']({},_0x51cd2d,_0x63b4e8[_0x8967('0x43')]);return _0x5b9dd0[_0x8967('0x4f')](_0x51cd2d);}})['then'](function(_0x29ff60){if(_0x29ff60){_0x1d8ea9=_0x29ff60[_0x8967('0x34')];if(!_0x63b4e8[_0x8967('0x2f')][_0x8967('0x35')](_0x8967('0x49'))){_0x51cd2d[_0x8967('0x1c')]=qs[_0x8967('0x1c')](_0x63b4e8[_0x8967('0x2f')][_0x8967('0x1c')]);_0x51cd2d['offset']=qs[_0x8967('0x1a')](_0x63b4e8['query'][_0x8967('0x1a')]);}return _0x5b9dd0[_0x8967('0x4f')](_0x51cd2d);}})['then'](function(_0x4fac89){if(_0x4fac89){return _0x4fac89?{'count':_0x1d8ea9,'rows':_0x4fac89}:null;}})[_0x8967('0x24')](respondWithResult(_0x4e8949,null))['catch'](handleError(_0x4e8949,null));};exports[_0x8967('0x50')]=function(_0x3f55ec,_0x27d24d,_0x1eda10){if(_0x3f55ec[_0x8967('0x46')]['id']){delete _0x3f55ec[_0x8967('0x46')]['id'];}return db[_0x8967('0x29')]['findOne']({'where':{'id':_0x3f55ec['params']['id']}})[_0x8967('0x24')](handleEntityNotFound(_0x27d24d,null))['then'](function(_0x310945){if(_0x310945){return _0x310945['setTags'](_0x3f55ec[_0x8967('0x46')]['ids']||[]);}return null;})[_0x8967('0x24')](respondWithResult(_0x27d24d,null))[_0x8967('0x3f')](handleError(_0x27d24d,null));}; \ No newline at end of file +var _0x67a7=['params','catch','body','find','destroy','findOne','keys','ZendeskField','order','getFields','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show'];(function(_0x2a0350,_0x249319){var _0x425220=function(_0x1d5f78){while(--_0x1d5f78){_0x2a0350['push'](_0x2a0350['shift']());}};_0x425220(++_0x249319);}(_0x67a7,0x1b4));var _0x767a=function(_0x86d292,_0x27c200){_0x86d292=_0x86d292-0x0;var _0x51eb56=_0x67a7[_0x86d292];return _0x51eb56;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x767a('0x0'));var zipdir=require(_0x767a('0x1'));var jsonpatch=require(_0x767a('0x2'));var rp=require('request-promise');var moment=require(_0x767a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x767a('0x4'));var util=require(_0x767a('0x5'));var path=require('path');var sox=require(_0x767a('0x6'));var csv=require(_0x767a('0x7'));var ejs=require(_0x767a('0x8'));var fs=require('fs');var fs_extra=require(_0x767a('0x9'));var _=require(_0x767a('0xa'));var squel=require(_0x767a('0xb'));var crypto=require('crypto');var jsforce=require(_0x767a('0xc'));var deskjs=require(_0x767a('0xd'));var toCsv=require(_0x767a('0x7'));var querystring=require(_0x767a('0xe'));var Papa=require(_0x767a('0xf'));var Redis=require(_0x767a('0x10'));var authService=require(_0x767a('0x11'));var qs=require(_0x767a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x767a('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x767a('0x14'));var config=require(_0x767a('0x15'));var licenseUtil=require(_0x767a('0x16'));var db=require(_0x767a('0x17'))['db'];function respondWithStatusCode(_0x506bf2,_0x484486){_0x484486=_0x484486||0xcc;return function(_0xdea7b8){if(_0xdea7b8){return _0x506bf2['sendStatus'](_0x484486);}return _0x506bf2[_0x767a('0x18')](_0x484486)[_0x767a('0x19')]();};}function respondWithResult(_0x22a788,_0x5925a5){_0x5925a5=_0x5925a5||0xc8;return function(_0x268e9b){if(_0x268e9b){return _0x22a788[_0x767a('0x18')](_0x5925a5)[_0x767a('0x1a')](_0x268e9b);}};}function respondWithFilteredResult(_0x52ef82,_0x424819){return function(_0xb9dca1){if(_0xb9dca1){var _0xa801c7=typeof _0x424819['offset']==='undefined'&&typeof _0x424819[_0x767a('0x1b')]===_0x767a('0x1c');var _0xc4d59f=_0xb9dca1[_0x767a('0x1d')];var _0x52b67e=_0xa801c7?0x0:_0x424819['offset'];var _0x265a43=_0xa801c7?_0xb9dca1[_0x767a('0x1d')]:_0x424819[_0x767a('0x1e')]+_0x424819['limit'];var _0x290703;if(_0x265a43>=_0xc4d59f){_0x265a43=_0xc4d59f;_0x290703=0xc8;}else{_0x290703=0xce;}_0x52ef82[_0x767a('0x18')](_0x290703);return _0x52ef82[_0x767a('0x1f')](_0x767a('0x20'),_0x52b67e+'-'+_0x265a43+'/'+_0xc4d59f)[_0x767a('0x1a')](_0xb9dca1);}return null;};}function patchUpdates(_0x13e0d5){return function(_0xc70b2b){try{jsonpatch[_0x767a('0x21')](_0xc70b2b,_0x13e0d5,!![]);}catch(_0x5c1b61){return BPromise[_0x767a('0x22')](_0x5c1b61);}return _0xc70b2b[_0x767a('0x23')]();};}function saveUpdates(_0x5c8486,_0x4a4a9c){return function(_0x135667){if(_0x135667){return _0x135667[_0x767a('0x24')](_0x5c8486)['then'](function(_0x52630f){return _0x52630f;});}return null;};}function removeEntity(_0x4afa6f,_0x52485d){return function(_0x1a0644){if(_0x1a0644){return _0x1a0644['destroy']()[_0x767a('0x25')](function(){_0x4afa6f[_0x767a('0x18')](0xcc)[_0x767a('0x19')]();});}};}function handleEntityNotFound(_0x180554,_0x37f6b4){return function(_0x4a979d){if(!_0x4a979d){_0x180554['sendStatus'](0x194);}return _0x4a979d;};}function handleError(_0x10d11d,_0x3de293){_0x3de293=_0x3de293||0x1f4;return function(_0x416959){logger['error'](_0x416959[_0x767a('0x26')]);if(_0x416959[_0x767a('0x27')]){delete _0x416959[_0x767a('0x27')];}_0x10d11d[_0x767a('0x18')](_0x3de293)[_0x767a('0x28')](_0x416959);};}exports[_0x767a('0x29')]=function(_0x38165c,_0x5df241){var _0x3542d9={},_0x16a371={},_0x5a6610={'count':0x0,'rows':[]};var _0x25c756=_[_0x767a('0x2a')](db[_0x767a('0x2b')][_0x767a('0x2c')],function(_0x2f0beb){return{'name':_0x2f0beb[_0x767a('0x2d')],'type':_0x2f0beb[_0x767a('0x2e')][_0x767a('0x2f')]};});_0x16a371['model']=_[_0x767a('0x2a')](_0x25c756,_0x767a('0x27'));_0x16a371['query']=_['keys'](_0x38165c[_0x767a('0x30')]);_0x16a371[_0x767a('0x31')]=_[_0x767a('0x32')](_0x16a371[_0x767a('0x33')],_0x16a371[_0x767a('0x30')]);_0x3542d9[_0x767a('0x34')]=_[_0x767a('0x32')](_0x16a371[_0x767a('0x33')],qs[_0x767a('0x35')](_0x38165c[_0x767a('0x30')][_0x767a('0x35')]));_0x3542d9['attributes']=_0x3542d9[_0x767a('0x34')][_0x767a('0x36')]?_0x3542d9[_0x767a('0x34')]:_0x16a371[_0x767a('0x33')];if(!_0x38165c[_0x767a('0x30')]['hasOwnProperty'](_0x767a('0x37'))){_0x3542d9['limit']=qs[_0x767a('0x1b')](_0x38165c[_0x767a('0x30')]['limit']);_0x3542d9['offset']=qs[_0x767a('0x1e')](_0x38165c['query'][_0x767a('0x1e')]);}_0x3542d9['order']=qs[_0x767a('0x38')](_0x38165c[_0x767a('0x30')][_0x767a('0x38')]);_0x3542d9[_0x767a('0x39')]=qs[_0x767a('0x31')](_[_0x767a('0x3a')](_0x38165c[_0x767a('0x30')],_0x16a371[_0x767a('0x31')]),_0x25c756);if(_0x38165c['query']['filter']){_0x3542d9[_0x767a('0x39')]=_[_0x767a('0x3b')](_0x3542d9['where'],{'$or':_['map'](_0x25c756,function(_0x4f643f){if(_0x4f643f['type']!==_0x767a('0x3c')){var _0x2d3a86={};_0x2d3a86[_0x4f643f[_0x767a('0x27')]]={'$like':'%'+_0x38165c[_0x767a('0x30')][_0x767a('0x3d')]+'%'};return _0x2d3a86;}})});}_0x3542d9=_[_0x767a('0x3b')]({},_0x3542d9,_0x38165c[_0x767a('0x3e')]);var _0x538348={'where':_0x3542d9[_0x767a('0x39')]};return db[_0x767a('0x2b')][_0x767a('0x1d')](_0x538348)[_0x767a('0x25')](function(_0x383e0a){_0x5a6610[_0x767a('0x1d')]=_0x383e0a;if(_0x38165c['query'][_0x767a('0x3f')]){_0x3542d9[_0x767a('0x40')]=[{'all':!![]}];}return db[_0x767a('0x2b')][_0x767a('0x41')](_0x3542d9);})['then'](function(_0x26504a){_0x5a6610[_0x767a('0x42')]=_0x26504a;return _0x5a6610;})['then'](respondWithFilteredResult(_0x5df241,_0x3542d9))['catch'](handleError(_0x5df241,null));};exports[_0x767a('0x43')]=function(_0x333b79,_0x395617){var _0x3cbbd5={'raw':![],'where':{'id':_0x333b79[_0x767a('0x44')]['id']}},_0x484ae1={};_0x484ae1[_0x767a('0x33')]=_['keys'](db[_0x767a('0x2b')][_0x767a('0x2c')]);_0x484ae1[_0x767a('0x30')]=_['keys'](_0x333b79['query']);_0x484ae1['filters']=_[_0x767a('0x32')](_0x484ae1[_0x767a('0x33')],_0x484ae1['query']);_0x3cbbd5[_0x767a('0x34')]=_[_0x767a('0x32')](_0x484ae1[_0x767a('0x33')],qs[_0x767a('0x35')](_0x333b79['query'][_0x767a('0x35')]));_0x3cbbd5[_0x767a('0x34')]=_0x3cbbd5['attributes']['length']?_0x3cbbd5['attributes']:_0x484ae1[_0x767a('0x33')];if(_0x333b79[_0x767a('0x30')]['includeAll']){_0x3cbbd5[_0x767a('0x40')]=[{'all':!![]}];}_0x3cbbd5=_[_0x767a('0x3b')]({},_0x3cbbd5,_0x333b79[_0x767a('0x3e')]);return db[_0x767a('0x2b')]['find'](_0x3cbbd5)[_0x767a('0x25')](handleEntityNotFound(_0x395617,null))[_0x767a('0x25')](respondWithResult(_0x395617,null))[_0x767a('0x45')](handleError(_0x395617,null));};exports['create']=function(_0x5d3519,_0x29396a){return db[_0x767a('0x2b')]['create'](_0x5d3519['body'],{})[_0x767a('0x25')](respondWithResult(_0x29396a,0xc9))['catch'](handleError(_0x29396a,null));};exports[_0x767a('0x24')]=function(_0x280d16,_0x384f4a){if(_0x280d16[_0x767a('0x46')]['id']){delete _0x280d16[_0x767a('0x46')]['id'];}return db[_0x767a('0x2b')][_0x767a('0x47')]({'where':{'id':_0x280d16[_0x767a('0x44')]['id']}})['then'](handleEntityNotFound(_0x384f4a,null))[_0x767a('0x25')](saveUpdates(_0x280d16[_0x767a('0x46')],null))[_0x767a('0x25')](respondWithResult(_0x384f4a,null))['catch'](handleError(_0x384f4a,null));};exports[_0x767a('0x48')]=function(_0x310de0,_0x20fc66){return db[_0x767a('0x2b')]['find']({'where':{'id':_0x310de0[_0x767a('0x44')]['id']}})[_0x767a('0x25')](handleEntityNotFound(_0x20fc66,null))[_0x767a('0x25')](removeEntity(_0x20fc66,null))['catch'](handleError(_0x20fc66,null));};exports['getFields']=function(_0xa7ff97,_0x2fb7f8,_0x567c05){var _0x2d31d3={};var _0x350ca1={};var _0x4f1ec3;var _0x5e2c45;return db[_0x767a('0x2b')][_0x767a('0x49')]({'where':{'id':_0xa7ff97[_0x767a('0x44')]['id']}})[_0x767a('0x25')](handleEntityNotFound(_0x2fb7f8,null))[_0x767a('0x25')](function(_0xed087b){if(_0xed087b){_0x4f1ec3=_0xed087b;_0x350ca1[_0x767a('0x33')]=_[_0x767a('0x4a')](db[_0x767a('0x4b')][_0x767a('0x2c')]);_0x350ca1[_0x767a('0x30')]=_[_0x767a('0x4a')](_0xa7ff97[_0x767a('0x30')]);_0x350ca1['filters']=_['intersection'](_0x350ca1[_0x767a('0x33')],_0x350ca1[_0x767a('0x30')]);_0x2d31d3['attributes']=_[_0x767a('0x32')](_0x350ca1['model'],qs[_0x767a('0x35')](_0xa7ff97[_0x767a('0x30')][_0x767a('0x35')]));_0x2d31d3[_0x767a('0x34')]=_0x2d31d3[_0x767a('0x34')][_0x767a('0x36')]?_0x2d31d3['attributes']:_0x350ca1[_0x767a('0x33')];_0x2d31d3[_0x767a('0x4c')]=qs['sort'](_0xa7ff97['query']['sort']);_0x2d31d3['where']=qs['filters'](_[_0x767a('0x3a')](_0xa7ff97[_0x767a('0x30')],_0x350ca1[_0x767a('0x31')]));if(_0xa7ff97[_0x767a('0x30')][_0x767a('0x3d')]){_0x2d31d3[_0x767a('0x39')]=_[_0x767a('0x3b')](_0x2d31d3['where'],{'$or':_[_0x767a('0x2a')](_0x2d31d3[_0x767a('0x34')],function(_0x4c9f83){var _0x5839e9={};_0x5839e9[_0x4c9f83]={'$like':'%'+_0xa7ff97[_0x767a('0x30')]['filter']+'%'};return _0x5839e9;})});}_0x2d31d3=_[_0x767a('0x3b')]({},_0x2d31d3,_0xa7ff97[_0x767a('0x3e')]);return _0x4f1ec3[_0x767a('0x4d')](_0x2d31d3);}})[_0x767a('0x25')](function(_0x5f305f){if(_0x5f305f){_0x5e2c45=_0x5f305f[_0x767a('0x36')];if(!_0xa7ff97['query'][_0x767a('0x4e')]('nolimit')){_0x2d31d3[_0x767a('0x1b')]=qs[_0x767a('0x1b')](_0xa7ff97[_0x767a('0x30')][_0x767a('0x1b')]);_0x2d31d3['offset']=qs[_0x767a('0x1e')](_0xa7ff97[_0x767a('0x30')][_0x767a('0x1e')]);}return _0x4f1ec3[_0x767a('0x4d')](_0x2d31d3);}})[_0x767a('0x25')](function(_0x399237){if(_0x399237){return _0x399237?{'count':_0x5e2c45,'rows':_0x399237}:null;}})[_0x767a('0x25')](respondWithResult(_0x2fb7f8,null))[_0x767a('0x45')](handleError(_0x2fb7f8,null));};exports[_0x767a('0x4f')]=function(_0x19ffbc,_0x4e9b9b,_0x1f1ade){var _0x2010db={};var _0x56a1b4={};var _0x2406bc;var _0x477e09;return db[_0x767a('0x2b')][_0x767a('0x49')]({'where':{'id':_0x19ffbc['params']['id']}})[_0x767a('0x25')](handleEntityNotFound(_0x4e9b9b,null))[_0x767a('0x25')](function(_0x5c4846){if(_0x5c4846){_0x2406bc=_0x5c4846;_0x56a1b4[_0x767a('0x33')]=_[_0x767a('0x4a')](db[_0x767a('0x4b')]['rawAttributes']);_0x56a1b4[_0x767a('0x30')]=_[_0x767a('0x4a')](_0x19ffbc[_0x767a('0x30')]);_0x56a1b4[_0x767a('0x31')]=_[_0x767a('0x32')](_0x56a1b4[_0x767a('0x33')],_0x56a1b4[_0x767a('0x30')]);_0x2010db[_0x767a('0x34')]=_[_0x767a('0x32')](_0x56a1b4[_0x767a('0x33')],qs[_0x767a('0x35')](_0x19ffbc[_0x767a('0x30')]['fields']));_0x2010db[_0x767a('0x34')]=_0x2010db[_0x767a('0x34')][_0x767a('0x36')]?_0x2010db[_0x767a('0x34')]:_0x56a1b4[_0x767a('0x33')];_0x2010db[_0x767a('0x4c')]=qs[_0x767a('0x38')](_0x19ffbc[_0x767a('0x30')]['sort']);_0x2010db['where']=qs[_0x767a('0x31')](_[_0x767a('0x3a')](_0x19ffbc[_0x767a('0x30')],_0x56a1b4['filters']));if(_0x19ffbc[_0x767a('0x30')]['filter']){_0x2010db[_0x767a('0x39')]=_[_0x767a('0x3b')](_0x2010db[_0x767a('0x39')],{'$or':_['map'](_0x2010db['attributes'],function(_0x360de8){var _0x4d171c={};_0x4d171c[_0x360de8]={'$like':'%'+_0x19ffbc[_0x767a('0x30')][_0x767a('0x3d')]+'%'};return _0x4d171c;})});}_0x2010db=_[_0x767a('0x3b')]({},_0x2010db,_0x19ffbc[_0x767a('0x3e')]);return _0x2406bc['getSubjects'](_0x2010db);}})['then'](function(_0x3ae467){if(_0x3ae467){_0x477e09=_0x3ae467[_0x767a('0x36')];if(!_0x19ffbc['query'][_0x767a('0x4e')](_0x767a('0x37'))){_0x2010db['limit']=qs[_0x767a('0x1b')](_0x19ffbc[_0x767a('0x30')]['limit']);_0x2010db[_0x767a('0x1e')]=qs[_0x767a('0x1e')](_0x19ffbc[_0x767a('0x30')][_0x767a('0x1e')]);}return _0x2406bc[_0x767a('0x4f')](_0x2010db);}})[_0x767a('0x25')](function(_0x83de39){if(_0x83de39){return _0x83de39?{'count':_0x477e09,'rows':_0x83de39}:null;}})['then'](respondWithResult(_0x4e9b9b,null))[_0x767a('0x45')](handleError(_0x4e9b9b,null));};exports[_0x767a('0x50')]=function(_0x25bffd,_0x441d3e,_0x43a900){var _0x3723bf={};var _0x457290={};var _0x54ea64;var _0x17f8b1;return db['ZendeskConfiguration'][_0x767a('0x49')]({'where':{'id':_0x25bffd[_0x767a('0x44')]['id']}})['then'](handleEntityNotFound(_0x441d3e,null))[_0x767a('0x25')](function(_0x1d0bb1){if(_0x1d0bb1){_0x54ea64=_0x1d0bb1;_0x457290['model']=_[_0x767a('0x4a')](db[_0x767a('0x4b')][_0x767a('0x2c')]);_0x457290[_0x767a('0x30')]=_[_0x767a('0x4a')](_0x25bffd[_0x767a('0x30')]);_0x457290[_0x767a('0x31')]=_[_0x767a('0x32')](_0x457290[_0x767a('0x33')],_0x457290[_0x767a('0x30')]);_0x3723bf[_0x767a('0x34')]=_[_0x767a('0x32')](_0x457290[_0x767a('0x33')],qs['fields'](_0x25bffd[_0x767a('0x30')][_0x767a('0x35')]));_0x3723bf['attributes']=_0x3723bf[_0x767a('0x34')][_0x767a('0x36')]?_0x3723bf[_0x767a('0x34')]:_0x457290[_0x767a('0x33')];_0x3723bf[_0x767a('0x4c')]=qs[_0x767a('0x38')](_0x25bffd[_0x767a('0x30')][_0x767a('0x38')]);_0x3723bf['where']=qs[_0x767a('0x31')](_[_0x767a('0x3a')](_0x25bffd[_0x767a('0x30')],_0x457290[_0x767a('0x31')]));if(_0x25bffd['query'][_0x767a('0x3d')]){_0x3723bf[_0x767a('0x39')]=_[_0x767a('0x3b')](_0x3723bf[_0x767a('0x39')],{'$or':_[_0x767a('0x2a')](_0x3723bf[_0x767a('0x34')],function(_0x49356c){var _0x11c082={};_0x11c082[_0x49356c]={'$like':'%'+_0x25bffd[_0x767a('0x30')][_0x767a('0x3d')]+'%'};return _0x11c082;})});}_0x3723bf=_[_0x767a('0x3b')]({},_0x3723bf,_0x25bffd[_0x767a('0x3e')]);return _0x54ea64[_0x767a('0x50')](_0x3723bf);}})[_0x767a('0x25')](function(_0x251c89){if(_0x251c89){_0x17f8b1=_0x251c89[_0x767a('0x36')];if(!_0x25bffd[_0x767a('0x30')][_0x767a('0x4e')]('nolimit')){_0x3723bf['limit']=qs[_0x767a('0x1b')](_0x25bffd[_0x767a('0x30')][_0x767a('0x1b')]);_0x3723bf['offset']=qs[_0x767a('0x1e')](_0x25bffd['query']['offset']);}return _0x54ea64[_0x767a('0x50')](_0x3723bf);}})['then'](function(_0x11d9bc){if(_0x11d9bc){return _0x11d9bc?{'count':_0x17f8b1,'rows':_0x11d9bc}:null;}})['then'](respondWithResult(_0x441d3e,null))[_0x767a('0x45')](handleError(_0x441d3e,null));};exports[_0x767a('0x51')]=function(_0x5daa82,_0x2cfe18,_0xc2876b){var _0x390af2={};var _0x3cfa8a={};var _0x36fe62;var _0x507cef;return db[_0x767a('0x2b')][_0x767a('0x49')]({'where':{'id':_0x5daa82[_0x767a('0x44')]['id']}})[_0x767a('0x25')](handleEntityNotFound(_0x2cfe18,null))[_0x767a('0x25')](function(_0x265a23){if(_0x265a23){_0x36fe62=_0x265a23;_0x3cfa8a[_0x767a('0x33')]=_[_0x767a('0x4a')](db[_0x767a('0x52')]['rawAttributes']);_0x3cfa8a[_0x767a('0x30')]=_['keys'](_0x5daa82['query']);_0x3cfa8a[_0x767a('0x31')]=_[_0x767a('0x32')](_0x3cfa8a[_0x767a('0x33')],_0x3cfa8a[_0x767a('0x30')]);_0x390af2[_0x767a('0x34')]=_[_0x767a('0x32')](_0x3cfa8a[_0x767a('0x33')],qs[_0x767a('0x35')](_0x5daa82[_0x767a('0x30')]['fields']));_0x390af2[_0x767a('0x34')]=_0x390af2[_0x767a('0x34')]['length']?_0x390af2[_0x767a('0x34')]:_0x3cfa8a['model'];_0x390af2['order']=qs['sort'](_0x5daa82[_0x767a('0x30')][_0x767a('0x38')]);_0x390af2[_0x767a('0x39')]=qs[_0x767a('0x31')](_[_0x767a('0x3a')](_0x5daa82[_0x767a('0x30')],_0x3cfa8a[_0x767a('0x31')]));if(_0x5daa82[_0x767a('0x30')][_0x767a('0x3d')]){_0x390af2[_0x767a('0x39')]=_[_0x767a('0x3b')](_0x390af2['where'],{'$or':_[_0x767a('0x2a')](_0x390af2['attributes'],function(_0x99fb22){var _0x35d299={};_0x35d299[_0x99fb22]={'$like':'%'+_0x5daa82[_0x767a('0x30')][_0x767a('0x3d')]+'%'};return _0x35d299;})});}_0x390af2=_[_0x767a('0x3b')]({},_0x390af2,_0x5daa82[_0x767a('0x3e')]);return _0x36fe62[_0x767a('0x51')](_0x390af2);}})[_0x767a('0x25')](function(_0x51480f){if(_0x51480f){_0x507cef=_0x51480f[_0x767a('0x36')];if(!_0x5daa82[_0x767a('0x30')][_0x767a('0x4e')](_0x767a('0x37'))){_0x390af2[_0x767a('0x1b')]=qs[_0x767a('0x1b')](_0x5daa82[_0x767a('0x30')]['limit']);_0x390af2[_0x767a('0x1e')]=qs[_0x767a('0x1e')](_0x5daa82[_0x767a('0x30')][_0x767a('0x1e')]);}return _0x36fe62[_0x767a('0x51')](_0x390af2);}})[_0x767a('0x25')](function(_0x1753ff){if(_0x1753ff){return _0x1753ff?{'count':_0x507cef,'rows':_0x1753ff}:null;}})[_0x767a('0x25')](respondWithResult(_0x2cfe18,null))[_0x767a('0x45')](handleError(_0x2cfe18,null));};exports[_0x767a('0x53')]=function(_0x1e1cea,_0x562666,_0x1d5d9b){if(_0x1e1cea['body']['id']){delete _0x1e1cea[_0x767a('0x46')]['id'];}return db[_0x767a('0x2b')][_0x767a('0x49')]({'where':{'id':_0x1e1cea['params']['id']}})[_0x767a('0x25')](handleEntityNotFound(_0x562666,null))[_0x767a('0x25')](function(_0x919e0a){if(_0x919e0a){return _0x919e0a[_0x767a('0x53')](_0x1e1cea[_0x767a('0x46')]['ids']||[]);}return null;})[_0x767a('0x25')](respondWithResult(_0x562666,null))[_0x767a('0x45')](handleError(_0x562666,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 3975e30..2d90002 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 _0x80ed=['api','moment','request-promise','path','rimraf','../../config/environment','exports','ZendeskConfiguration','int_zendesk_configurations','lodash','../../config/logger'];(function(_0x332699,_0xe10120){var _0x3efa4a=function(_0x3679a8){while(--_0x3679a8){_0x332699['push'](_0x332699['shift']());}};_0x3efa4a(++_0xe10120);}(_0x80ed,0x11c));var _0xd80e=function(_0x344ab4,_0x48b8b7){_0x344ab4=_0x344ab4-0x0;var _0x3c1b77=_0x80ed[_0x344ab4];return _0x3c1b77;};'use strict';var _=require(_0xd80e('0x0'));var util=require('util');var logger=require(_0xd80e('0x1'))(_0xd80e('0x2'));var moment=require(_0xd80e('0x3'));var BPromise=require('bluebird');var rp=require(_0xd80e('0x4'));var fs=require('fs');var path=require(_0xd80e('0x5'));var rimraf=require(_0xd80e('0x6'));var config=require(_0xd80e('0x7'));var attributes=require('./intZendeskConfiguration.attributes');module[_0xd80e('0x8')]=function(_0x2b4742,_0x252fec){return _0x2b4742['define'](_0xd80e('0x9'),attributes,{'tableName':_0xd80e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6b20=['lodash','util','api','bluebird','request-promise','path','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration'];(function(_0x5da0a9,_0x4d50cb){var _0x3f83dd=function(_0x1df254){while(--_0x1df254){_0x5da0a9['push'](_0x5da0a9['shift']());}};_0x3f83dd(++_0x4d50cb);}(_0x6b20,0xd1));var _0x06b2=function(_0x53db7f,_0x5988ee){_0x53db7f=_0x53db7f-0x0;var _0x198452=_0x6b20[_0x53db7f];return _0x198452;};'use strict';var _=require(_0x06b2('0x0'));var util=require(_0x06b2('0x1'));var logger=require('../../config/logger')(_0x06b2('0x2'));var moment=require('moment');var BPromise=require(_0x06b2('0x3'));var rp=require(_0x06b2('0x4'));var fs=require('fs');var path=require(_0x06b2('0x5'));var rimraf=require('rimraf');var config=require(_0x06b2('0x6'));var attributes=require(_0x06b2('0x7'));module[_0x06b2('0x8')]=function(_0x30d39c,_0x3b792b){return _0x30d39c[_0x06b2('0x9')](_0x06b2('0xa'),attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index ee4e065..d0b0da3 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 _0x8a9e=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x20e214,_0x3afe50){var _0x2661ed=function(_0x41b276){while(--_0x41b276){_0x20e214['push'](_0x20e214['shift']());}};_0x2661ed(++_0x3afe50);}(_0x8a9e,0x159));var _0xe8a9=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x8a9e[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xe8a9('0x0'));var util=require('util');var moment=require(_0xe8a9('0x1'));var BPromise=require(_0xe8a9('0x2'));var rs=require(_0xe8a9('0x3'));var fs=require('fs');var Redis=require(_0xe8a9('0x4'));var db=require(_0xe8a9('0x5'))['db'];var utils=require(_0xe8a9('0x6'));var logger=require(_0xe8a9('0x7'))(_0xe8a9('0x8'));var config=require(_0xe8a9('0x9'));var jayson=require(_0xe8a9('0xa'));var client=jayson['client'][_0xe8a9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa0a5d1,_0xc5ef9f,_0x4665d0){return new BPromise(function(_0x4c4198,_0x537cf8){return client[_0xe8a9('0xc')](_0xa0a5d1,_0x4665d0)[_0xe8a9('0xd')](function(_0x589813){logger[_0xe8a9('0xe')](_0xe8a9('0xf'),_0xc5ef9f,_0xe8a9('0x10'));logger[_0xe8a9('0x11')](_0xe8a9('0x12'),_0xc5ef9f,_0xe8a9('0x10'),JSON[_0xe8a9('0x13')](_0x589813));if(_0x589813[_0xe8a9('0x14')]){if(_0x589813[_0xe8a9('0x14')][_0xe8a9('0x15')]===0x1f4){logger[_0xe8a9('0x14')](_0xe8a9('0xf'),_0xc5ef9f,_0x589813['error']['message']);return _0x537cf8(_0x589813['error'][_0xe8a9('0x16')]);}logger[_0xe8a9('0x14')](_0xe8a9('0xf'),_0xc5ef9f,_0x589813['error'][_0xe8a9('0x16')]);return _0x4c4198(_0x589813[_0xe8a9('0x14')]['message']);}else{logger['info'](_0xe8a9('0xf'),_0xc5ef9f,'request\x20sent');_0x4c4198(_0x589813[_0xe8a9('0x17')][_0xe8a9('0x16')]);}})[_0xe8a9('0x18')](function(_0x352272){logger[_0xe8a9('0x14')](_0xe8a9('0xf'),_0xc5ef9f,_0x352272);_0x537cf8(_0x352272);});});} \ No newline at end of file +var _0xfd7a=['ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x5b7024,_0x5553a3){var _0x24f0cf=function(_0x14abb2){while(--_0x14abb2){_0x5b7024['push'](_0x5b7024['shift']());}};_0x24f0cf(++_0x5553a3);}(_0xfd7a,0xa7));var _0xafd7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd7a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xafd7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xafd7('0x1'));var fs=require('fs');var Redis=require(_0xafd7('0x2'));var db=require(_0xafd7('0x3'))['db'];var utils=require(_0xafd7('0x4'));var logger=require(_0xafd7('0x5'))(_0xafd7('0x6'));var config=require(_0xafd7('0x7'));var jayson=require(_0xafd7('0x8'));var client=jayson[_0xafd7('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x47b380,_0x1b7153,_0x1d1d2c){return new BPromise(function(_0x1a4237,_0x19bcf6){return client[_0xafd7('0xa')](_0x47b380,_0x1d1d2c)[_0xafd7('0xb')](function(_0x37a7a5){logger[_0xafd7('0xc')](_0xafd7('0xd'),_0x1b7153,_0xafd7('0xe'));logger[_0xafd7('0xf')](_0xafd7('0x10'),_0x1b7153,'request\x20sent',JSON['stringify'](_0x37a7a5));if(_0x37a7a5[_0xafd7('0x11')]){if(_0x37a7a5[_0xafd7('0x11')]['code']===0x1f4){logger[_0xafd7('0x11')](_0xafd7('0xd'),_0x1b7153,_0x37a7a5['error']['message']);return _0x19bcf6(_0x37a7a5['error'][_0xafd7('0x12')]);}logger[_0xafd7('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x1b7153,_0x37a7a5[_0xafd7('0x11')][_0xafd7('0x12')]);return _0x1a4237(_0x37a7a5[_0xafd7('0x11')]['message']);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x1b7153,_0xafd7('0xe'));_0x1a4237(_0x37a7a5['result']['message']);}})[_0xafd7('0x13')](function(_0x1a4b10){logger[_0xafd7('0x11')](_0xafd7('0xd'),_0x1b7153,_0x1a4b10);_0x19bcf6(_0x1a4b10);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 36fbb8f..f1ff331 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 _0x8358=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskField.controller','isAuthenticated','index','get','/:id','show','post'];(function(_0x277d6c,_0x1a8963){var _0x5a67d2=function(_0x5cdbc3){while(--_0x5cdbc3){_0x277d6c['push'](_0x277d6c['shift']());}};_0x5a67d2(++_0x1a8963);}(_0x8358,0xcc));var _0x8835=function(_0x197672,_0x549267){_0x197672=_0x197672-0x0;var _0x2b81d9=_0x8358[_0x197672];return _0x2b81d9;};'use strict';var multer=require(_0x8835('0x0'));var util=require(_0x8835('0x1'));var path=require(_0x8835('0x2'));var timeout=require(_0x8835('0x3'));var express=require(_0x8835('0x4'));var router=express[_0x8835('0x5')]();var fs_extra=require(_0x8835('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8835('0x7'));var config=require(_0x8835('0x8'));var controller=require(_0x8835('0x9'));router['get']('/',auth[_0x8835('0xa')](),controller[_0x8835('0xb')]);router[_0x8835('0xc')](_0x8835('0xd'),auth[_0x8835('0xa')](),controller[_0x8835('0xe')]);router[_0x8835('0xf')]('/',auth[_0x8835('0xa')](),controller[_0x8835('0x10')]);router[_0x8835('0x11')](_0x8835('0xd'),auth[_0x8835('0xa')](),controller[_0x8835('0x12')]);router[_0x8835('0x13')](_0x8835('0xd'),auth['isAuthenticated'](),controller[_0x8835('0x14')]);module[_0x8835('0x15')]=router; \ No newline at end of file +var _0xded7=['isAuthenticated','show','post','put','update','delete','destroy','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','index','/:id'];(function(_0xf0bcac,_0x531755){var _0x4e4c65=function(_0x35a77a){while(--_0x35a77a){_0xf0bcac['push'](_0xf0bcac['shift']());}};_0x4e4c65(++_0x531755);}(_0xded7,0x193));var _0x7ded=function(_0x2efb24,_0xd515e9){_0x2efb24=_0x2efb24-0x0;var _0x187e58=_0xded7[_0x2efb24];return _0x187e58;};'use strict';var multer=require(_0x7ded('0x0'));var util=require(_0x7ded('0x1'));var path=require('path');var timeout=require(_0x7ded('0x2'));var express=require('express');var router=express[_0x7ded('0x3')]();var fs_extra=require(_0x7ded('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7ded('0x5'));var config=require(_0x7ded('0x6'));var controller=require(_0x7ded('0x7'));router[_0x7ded('0x8')]('/',auth['isAuthenticated'](),controller[_0x7ded('0x9')]);router[_0x7ded('0x8')](_0x7ded('0xa'),auth[_0x7ded('0xb')](),controller[_0x7ded('0xc')]);router[_0x7ded('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7ded('0xe')](_0x7ded('0xa'),auth[_0x7ded('0xb')](),controller[_0x7ded('0xf')]);router[_0x7ded('0x10')]('/:id',auth[_0x7ded('0xb')](),controller[_0x7ded('0x11')]);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 28f81aa..f11f896 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 _0xab2c=['customVariable','keyValue','string','STRING','variable','BOOLEAN','sequelize','exports','ENUM'];(function(_0x2fac71,_0x2ae81d){var _0x28cb27=function(_0x348dc6){while(--_0x348dc6){_0x2fac71['push'](_0x2fac71['shift']());}};_0x28cb27(++_0x2ae81d);}(_0xab2c,0x7b));var _0xcab2=function(_0x44e016,_0x2a4ac3){_0x44e016=_0x44e016-0x0;var _0x5bc0a0=_0xab2c[_0x44e016];return _0x5bc0a0;};'use strict';var Sequelize=require(_0xcab2('0x0'));module[_0xcab2('0x1')]={'type':{'type':Sequelize[_0xcab2('0x2')]('string','variable',_0xcab2('0x3'),_0xcab2('0x4'),'picklist'),'defaultValue':_0xcab2('0x5')},'content':{'type':Sequelize[_0xcab2('0x6')]},'key':{'type':Sequelize[_0xcab2('0x6')]},'keyType':{'type':Sequelize[_0xcab2('0x2')](_0xcab2('0x5'),_0xcab2('0x7'),_0xcab2('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xcab2('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xcab2('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xcab2('0x6')]}}; \ No newline at end of file +var _0xa5fe=['customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN','sequelize','string','variable'];(function(_0x7c888d,_0x103ced){var _0x47c7df=function(_0x120a2a){while(--_0x120a2a){_0x7c888d['push'](_0x7c888d['shift']());}};_0x47c7df(++_0x103ced);}(_0xa5fe,0x114));var _0xea5f=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xa5fe[_0x5f09c5];return _0x426ad9;};'use strict';var Sequelize=require(_0xea5f('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xea5f('0x1'),_0xea5f('0x2'),_0xea5f('0x3'),_0xea5f('0x4'),_0xea5f('0x5')),'defaultValue':_0xea5f('0x1')},'content':{'type':Sequelize[_0xea5f('0x6')]},'key':{'type':Sequelize[_0xea5f('0x6')]},'keyType':{'type':Sequelize[_0xea5f('0x7')]('string',_0xea5f('0x2'),_0xea5f('0x3'))},'keyContent':{'type':Sequelize[_0xea5f('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xea5f('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xea5f('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 99e8499..9d47658 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 _0x3385=['path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','apply','reject','save','update','then','destroy','error','stack','name','ZendeskField','rawAttributes','fieldName','key','model','map','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','include','catch','params','keys','intersection','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x915439,_0x15543c){var _0x4e1ea6=function(_0x404bcb){while(--_0x404bcb){_0x915439['push'](_0x915439['shift']());}};_0x4e1ea6(++_0x15543c);}(_0x3385,0x1ae));var _0x5338=function(_0x36909d,_0x2795f1){_0x36909d=_0x36909d-0x0;var _0x1fd29d=_0x3385[_0x36909d];return _0x1fd29d;};'use strict';var emlformat=require(_0x5338('0x0'));var rimraf=require(_0x5338('0x1'));var zipdir=require(_0x5338('0x2'));var jsonpatch=require(_0x5338('0x3'));var rp=require(_0x5338('0x4'));var moment=require(_0x5338('0x5'));var BPromise=require(_0x5338('0x6'));var Mustache=require(_0x5338('0x7'));var util=require('util');var path=require(_0x5338('0x8'));var sox=require(_0x5338('0x9'));var csv=require(_0x5338('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5338('0xb'));var _=require(_0x5338('0xc'));var squel=require('squel');var crypto=require(_0x5338('0xd'));var jsforce=require(_0x5338('0xe'));var deskjs=require(_0x5338('0xf'));var toCsv=require(_0x5338('0xa'));var querystring=require(_0x5338('0x10'));var Papa=require(_0x5338('0x11'));var Redis=require(_0x5338('0x12'));var authService=require(_0x5338('0x13'));var qs=require(_0x5338('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5338('0x15'));var utils=require('../../config/utils');var config=require(_0x5338('0x16'));var licenseUtil=require(_0x5338('0x17'));var db=require(_0x5338('0x18'))['db'];function respondWithStatusCode(_0x4a0625,_0x1c243e){_0x1c243e=_0x1c243e||0xcc;return function(_0x303db0){if(_0x303db0){return _0x4a0625[_0x5338('0x19')](_0x1c243e);}return _0x4a0625[_0x5338('0x1a')](_0x1c243e)[_0x5338('0x1b')]();};}function respondWithResult(_0x1af914,_0xba9bac){_0xba9bac=_0xba9bac||0xc8;return function(_0x55c0b7){if(_0x55c0b7){return _0x1af914[_0x5338('0x1a')](_0xba9bac)[_0x5338('0x1c')](_0x55c0b7);}};}function respondWithFilteredResult(_0x50b3c3,_0x4765e4){return function(_0x3857f5){if(_0x3857f5){var _0x4b3eb0=typeof _0x4765e4['offset']===_0x5338('0x1d')&&typeof _0x4765e4['limit']==='undefined';var _0x5cef72=_0x3857f5[_0x5338('0x1e')];var _0x5e7e21=_0x4b3eb0?0x0:_0x4765e4['offset'];var _0x4c17b2=_0x4b3eb0?_0x3857f5['count']:_0x4765e4[_0x5338('0x1f')]+_0x4765e4[_0x5338('0x20')];var _0x8bf017;if(_0x4c17b2>=_0x5cef72){_0x4c17b2=_0x5cef72;_0x8bf017=0xc8;}else{_0x8bf017=0xce;}_0x50b3c3[_0x5338('0x1a')](_0x8bf017);return _0x50b3c3[_0x5338('0x21')]('Content-Range',_0x5e7e21+'-'+_0x4c17b2+'/'+_0x5cef72)[_0x5338('0x1c')](_0x3857f5);}return null;};}function patchUpdates(_0x5ef9d3){return function(_0x2dd28e){try{jsonpatch[_0x5338('0x22')](_0x2dd28e,_0x5ef9d3,!![]);}catch(_0x372408){return BPromise[_0x5338('0x23')](_0x372408);}return _0x2dd28e[_0x5338('0x24')]();};}function saveUpdates(_0x4a1f33,_0x3515ac){return function(_0x399feb){if(_0x399feb){return _0x399feb[_0x5338('0x25')](_0x4a1f33)[_0x5338('0x26')](function(_0x51ea07){return _0x51ea07;});}return null;};}function removeEntity(_0xb48ce4,_0x3bd1ae){return function(_0x2463af){if(_0x2463af){return _0x2463af[_0x5338('0x27')]()[_0x5338('0x26')](function(){_0xb48ce4[_0x5338('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe6d6e,_0x4170fb){return function(_0x530fd7){if(!_0x530fd7){_0xe6d6e[_0x5338('0x19')](0x194);}return _0x530fd7;};}function handleError(_0x1f48b0,_0x31f303){_0x31f303=_0x31f303||0x1f4;return function(_0xbe6c2f){logger[_0x5338('0x28')](_0xbe6c2f[_0x5338('0x29')]);if(_0xbe6c2f[_0x5338('0x2a')]){delete _0xbe6c2f[_0x5338('0x2a')];}_0x1f48b0[_0x5338('0x1a')](_0x31f303)['send'](_0xbe6c2f);};}exports['index']=function(_0x36aba2,_0x6fc0fc){var _0x3eea26={},_0x5d24b2={},_0x205186={'count':0x0,'rows':[]};var _0x5879de=_['map'](db[_0x5338('0x2b')][_0x5338('0x2c')],function(_0x28911c){return{'name':_0x28911c[_0x5338('0x2d')],'type':_0x28911c['type'][_0x5338('0x2e')]};});_0x5d24b2[_0x5338('0x2f')]=_[_0x5338('0x30')](_0x5879de,_0x5338('0x2a'));_0x5d24b2['query']=_['keys'](_0x36aba2[_0x5338('0x31')]);_0x5d24b2[_0x5338('0x32')]=_['intersection'](_0x5d24b2[_0x5338('0x2f')],_0x5d24b2['query']);_0x3eea26[_0x5338('0x33')]=_['intersection'](_0x5d24b2[_0x5338('0x2f')],qs['fields'](_0x36aba2[_0x5338('0x31')][_0x5338('0x34')]));_0x3eea26[_0x5338('0x33')]=_0x3eea26['attributes'][_0x5338('0x35')]?_0x3eea26[_0x5338('0x33')]:_0x5d24b2[_0x5338('0x2f')];if(!_0x36aba2[_0x5338('0x31')][_0x5338('0x36')](_0x5338('0x37'))){_0x3eea26[_0x5338('0x20')]=qs['limit'](_0x36aba2['query'][_0x5338('0x20')]);_0x3eea26['offset']=qs['offset'](_0x36aba2[_0x5338('0x31')][_0x5338('0x1f')]);}_0x3eea26[_0x5338('0x38')]=qs[_0x5338('0x39')](_0x36aba2[_0x5338('0x31')]['sort']);_0x3eea26[_0x5338('0x3a')]=qs['filters'](_['pick'](_0x36aba2[_0x5338('0x31')],_0x5d24b2[_0x5338('0x32')]),_0x5879de);if(_0x36aba2[_0x5338('0x31')][_0x5338('0x3b')]){_0x3eea26[_0x5338('0x3a')]=_[_0x5338('0x3c')](_0x3eea26[_0x5338('0x3a')],{'$or':_[_0x5338('0x30')](_0x5879de,function(_0x3708bb){if(_0x3708bb[_0x5338('0x3d')]!==_0x5338('0x3e')){var _0x30b4a7={};_0x30b4a7[_0x3708bb['name']]={'$like':'%'+_0x36aba2[_0x5338('0x31')][_0x5338('0x3b')]+'%'};return _0x30b4a7;}})});}_0x3eea26=_[_0x5338('0x3c')]({},_0x3eea26,_0x36aba2[_0x5338('0x3f')]);var _0x69e392={'where':_0x3eea26[_0x5338('0x3a')]};return db[_0x5338('0x2b')]['count'](_0x69e392)['then'](function(_0x1be80b){_0x205186[_0x5338('0x1e')]=_0x1be80b;if(_0x36aba2[_0x5338('0x31')]['includeAll']){_0x3eea26[_0x5338('0x40')]=[{'all':!![]}];}return db['ZendeskField']['findAll'](_0x3eea26);})[_0x5338('0x26')](function(_0x37bed4){_0x205186['rows']=_0x37bed4;return _0x205186;})[_0x5338('0x26')](respondWithFilteredResult(_0x6fc0fc,_0x3eea26))[_0x5338('0x41')](handleError(_0x6fc0fc,null));};exports['show']=function(_0x42ce7a,_0x5ccfdf){var _0x151ebc={'raw':!![],'where':{'id':_0x42ce7a[_0x5338('0x42')]['id']}},_0x19c31e={};_0x19c31e[_0x5338('0x2f')]=_[_0x5338('0x43')](db[_0x5338('0x2b')]['rawAttributes']);_0x19c31e[_0x5338('0x31')]=_['keys'](_0x42ce7a[_0x5338('0x31')]);_0x19c31e[_0x5338('0x32')]=_[_0x5338('0x44')](_0x19c31e[_0x5338('0x2f')],_0x19c31e[_0x5338('0x31')]);_0x151ebc[_0x5338('0x33')]=_[_0x5338('0x44')](_0x19c31e['model'],qs[_0x5338('0x34')](_0x42ce7a[_0x5338('0x31')][_0x5338('0x34')]));_0x151ebc['attributes']=_0x151ebc[_0x5338('0x33')][_0x5338('0x35')]?_0x151ebc[_0x5338('0x33')]:_0x19c31e[_0x5338('0x2f')];if(_0x42ce7a[_0x5338('0x31')][_0x5338('0x45')]){_0x151ebc[_0x5338('0x40')]=[{'all':!![]}];}_0x151ebc=_[_0x5338('0x3c')]({},_0x151ebc,_0x42ce7a[_0x5338('0x3f')]);return db['ZendeskField'][_0x5338('0x46')](_0x151ebc)[_0x5338('0x26')](handleEntityNotFound(_0x5ccfdf,null))['then'](respondWithResult(_0x5ccfdf,null))[_0x5338('0x41')](handleError(_0x5ccfdf,null));};exports[_0x5338('0x47')]=function(_0x3e8c83,_0x57f9cb){return db[_0x5338('0x2b')][_0x5338('0x47')](_0x3e8c83['body'],{})[_0x5338('0x26')](respondWithResult(_0x57f9cb,0xc9))[_0x5338('0x41')](handleError(_0x57f9cb,null));};exports['update']=function(_0x10e411,_0x57fb9c){if(_0x10e411[_0x5338('0x48')]['id']){delete _0x10e411[_0x5338('0x48')]['id'];}return db['ZendeskField'][_0x5338('0x46')]({'where':{'id':_0x10e411[_0x5338('0x42')]['id']}})[_0x5338('0x26')](handleEntityNotFound(_0x57fb9c,null))[_0x5338('0x26')](saveUpdates(_0x10e411[_0x5338('0x48')],null))[_0x5338('0x26')](respondWithResult(_0x57fb9c,null))[_0x5338('0x41')](handleError(_0x57fb9c,null));};exports['destroy']=function(_0x32e87c,_0x2f576c){return db['ZendeskField'][_0x5338('0x46')]({'where':{'id':_0x32e87c[_0x5338('0x42')]['id']}})[_0x5338('0x26')](handleEntityNotFound(_0x2f576c,null))['then'](removeEntity(_0x2f576c,null))['catch'](handleError(_0x2f576c,null));}; \ No newline at end of file +var _0xb3ea=['offset','undefined','count','limit','status','set','Content-Range','apply','save','update','then','sendStatus','error','name','send','index','ZendeskField','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','includeAll','options','find','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','end','json'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb3ea,0xc5));var _0xab3e=function(_0x323122,_0x15fc5d){_0x323122=_0x323122-0x0;var _0xe0032a=_0xb3ea[_0x323122];return _0xe0032a;};'use strict';var emlformat=require(_0xab3e('0x0'));var rimraf=require(_0xab3e('0x1'));var zipdir=require(_0xab3e('0x2'));var jsonpatch=require(_0xab3e('0x3'));var rp=require(_0xab3e('0x4'));var moment=require(_0xab3e('0x5'));var BPromise=require(_0xab3e('0x6'));var Mustache=require('mustache');var util=require(_0xab3e('0x7'));var path=require(_0xab3e('0x8'));var sox=require('sox');var csv=require(_0xab3e('0x9'));var ejs=require(_0xab3e('0xa'));var fs=require('fs');var fs_extra=require(_0xab3e('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xab3e('0xc'));var jsforce=require(_0xab3e('0xd'));var deskjs=require(_0xab3e('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xab3e('0xf'));var Redis=require(_0xab3e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xab3e('0x11'));var as=require(_0xab3e('0x12'));var hardwareService=require(_0xab3e('0x13'));var logger=require(_0xab3e('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xab3e('0x15'));var db=require(_0xab3e('0x16'))['db'];function respondWithStatusCode(_0x32d520,_0x17480e){_0x17480e=_0x17480e||0xcc;return function(_0x526483){if(_0x526483){return _0x32d520['sendStatus'](_0x17480e);}return _0x32d520['status'](_0x17480e)[_0xab3e('0x17')]();};}function respondWithResult(_0x4df63c,_0xacde5d){_0xacde5d=_0xacde5d||0xc8;return function(_0x271af5){if(_0x271af5){return _0x4df63c['status'](_0xacde5d)[_0xab3e('0x18')](_0x271af5);}};}function respondWithFilteredResult(_0x43467c,_0x14d386){return function(_0x3978cf){if(_0x3978cf){var _0x5513d8=typeof _0x14d386[_0xab3e('0x19')]==='undefined'&&typeof _0x14d386['limit']===_0xab3e('0x1a');var _0x374a05=_0x3978cf['count'];var _0x7e0832=_0x5513d8?0x0:_0x14d386[_0xab3e('0x19')];var _0x59aa69=_0x5513d8?_0x3978cf[_0xab3e('0x1b')]:_0x14d386[_0xab3e('0x19')]+_0x14d386[_0xab3e('0x1c')];var _0x2d07a1;if(_0x59aa69>=_0x374a05){_0x59aa69=_0x374a05;_0x2d07a1=0xc8;}else{_0x2d07a1=0xce;}_0x43467c[_0xab3e('0x1d')](_0x2d07a1);return _0x43467c[_0xab3e('0x1e')](_0xab3e('0x1f'),_0x7e0832+'-'+_0x59aa69+'/'+_0x374a05)[_0xab3e('0x18')](_0x3978cf);}return null;};}function patchUpdates(_0x55827e){return function(_0x1221d6){try{jsonpatch[_0xab3e('0x20')](_0x1221d6,_0x55827e,!![]);}catch(_0x2b72a2){return BPromise['reject'](_0x2b72a2);}return _0x1221d6[_0xab3e('0x21')]();};}function saveUpdates(_0x1d000f,_0x13f781){return function(_0x208534){if(_0x208534){return _0x208534[_0xab3e('0x22')](_0x1d000f)[_0xab3e('0x23')](function(_0x4efd58){return _0x4efd58;});}return null;};}function removeEntity(_0x3e8c92,_0x2a622c){return function(_0x562aec){if(_0x562aec){return _0x562aec['destroy']()['then'](function(){_0x3e8c92[_0xab3e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11cc77,_0x3cc9cc){return function(_0xc8d742){if(!_0xc8d742){_0x11cc77[_0xab3e('0x24')](0x194);}return _0xc8d742;};}function handleError(_0xdeb1e3,_0x8d1588){_0x8d1588=_0x8d1588||0x1f4;return function(_0x5ecf34){logger[_0xab3e('0x25')](_0x5ecf34['stack']);if(_0x5ecf34[_0xab3e('0x26')]){delete _0x5ecf34[_0xab3e('0x26')];}_0xdeb1e3[_0xab3e('0x1d')](_0x8d1588)[_0xab3e('0x27')](_0x5ecf34);};}exports[_0xab3e('0x28')]=function(_0x3ac28d,_0x10aaa9){var _0x1f88de={},_0x13db3c={},_0x2527de={'count':0x0,'rows':[]};var _0x4037ce=_['map'](db[_0xab3e('0x29')][_0xab3e('0x2a')],function(_0x172cd0){return{'name':_0x172cd0[_0xab3e('0x2b')],'type':_0x172cd0[_0xab3e('0x2c')][_0xab3e('0x2d')]};});_0x13db3c[_0xab3e('0x2e')]=_[_0xab3e('0x2f')](_0x4037ce,_0xab3e('0x26'));_0x13db3c['query']=_[_0xab3e('0x30')](_0x3ac28d[_0xab3e('0x31')]);_0x13db3c[_0xab3e('0x32')]=_[_0xab3e('0x33')](_0x13db3c[_0xab3e('0x2e')],_0x13db3c[_0xab3e('0x31')]);_0x1f88de[_0xab3e('0x34')]=_[_0xab3e('0x33')](_0x13db3c[_0xab3e('0x2e')],qs['fields'](_0x3ac28d[_0xab3e('0x31')][_0xab3e('0x35')]));_0x1f88de[_0xab3e('0x34')]=_0x1f88de['attributes'][_0xab3e('0x36')]?_0x1f88de[_0xab3e('0x34')]:_0x13db3c[_0xab3e('0x2e')];if(!_0x3ac28d[_0xab3e('0x31')]['hasOwnProperty']('nolimit')){_0x1f88de['limit']=qs[_0xab3e('0x1c')](_0x3ac28d[_0xab3e('0x31')][_0xab3e('0x1c')]);_0x1f88de[_0xab3e('0x19')]=qs[_0xab3e('0x19')](_0x3ac28d['query'][_0xab3e('0x19')]);}_0x1f88de[_0xab3e('0x37')]=qs['sort'](_0x3ac28d[_0xab3e('0x31')][_0xab3e('0x38')]);_0x1f88de[_0xab3e('0x39')]=qs[_0xab3e('0x32')](_[_0xab3e('0x3a')](_0x3ac28d[_0xab3e('0x31')],_0x13db3c[_0xab3e('0x32')]),_0x4037ce);if(_0x3ac28d[_0xab3e('0x31')][_0xab3e('0x3b')]){_0x1f88de[_0xab3e('0x39')]=_[_0xab3e('0x3c')](_0x1f88de[_0xab3e('0x39')],{'$or':_[_0xab3e('0x2f')](_0x4037ce,function(_0x2162a3){if(_0x2162a3[_0xab3e('0x2c')]!==_0xab3e('0x3d')){var _0x350b23={};_0x350b23[_0x2162a3[_0xab3e('0x26')]]={'$like':'%'+_0x3ac28d[_0xab3e('0x31')][_0xab3e('0x3b')]+'%'};return _0x350b23;}})});}_0x1f88de=_[_0xab3e('0x3c')]({},_0x1f88de,_0x3ac28d['options']);var _0xb49d78={'where':_0x1f88de['where']};return db[_0xab3e('0x29')][_0xab3e('0x1b')](_0xb49d78)[_0xab3e('0x23')](function(_0x5d49cd){_0x2527de[_0xab3e('0x1b')]=_0x5d49cd;if(_0x3ac28d[_0xab3e('0x31')]['includeAll']){_0x1f88de[_0xab3e('0x3e')]=[{'all':!![]}];}return db[_0xab3e('0x29')][_0xab3e('0x3f')](_0x1f88de);})[_0xab3e('0x23')](function(_0x1a5eaf){_0x2527de[_0xab3e('0x40')]=_0x1a5eaf;return _0x2527de;})[_0xab3e('0x23')](respondWithFilteredResult(_0x10aaa9,_0x1f88de))[_0xab3e('0x41')](handleError(_0x10aaa9,null));};exports[_0xab3e('0x42')]=function(_0x5581fd,_0xebbf4a){var _0x277da9={'raw':!![],'where':{'id':_0x5581fd['params']['id']}},_0x5cb3cf={};_0x5cb3cf[_0xab3e('0x2e')]=_[_0xab3e('0x30')](db['ZendeskField'][_0xab3e('0x2a')]);_0x5cb3cf[_0xab3e('0x31')]=_[_0xab3e('0x30')](_0x5581fd[_0xab3e('0x31')]);_0x5cb3cf['filters']=_[_0xab3e('0x33')](_0x5cb3cf['model'],_0x5cb3cf[_0xab3e('0x31')]);_0x277da9[_0xab3e('0x34')]=_[_0xab3e('0x33')](_0x5cb3cf[_0xab3e('0x2e')],qs['fields'](_0x5581fd[_0xab3e('0x31')]['fields']));_0x277da9[_0xab3e('0x34')]=_0x277da9['attributes'][_0xab3e('0x36')]?_0x277da9[_0xab3e('0x34')]:_0x5cb3cf[_0xab3e('0x2e')];if(_0x5581fd[_0xab3e('0x31')][_0xab3e('0x43')]){_0x277da9[_0xab3e('0x3e')]=[{'all':!![]}];}_0x277da9=_[_0xab3e('0x3c')]({},_0x277da9,_0x5581fd[_0xab3e('0x44')]);return db['ZendeskField'][_0xab3e('0x45')](_0x277da9)[_0xab3e('0x23')](handleEntityNotFound(_0xebbf4a,null))['then'](respondWithResult(_0xebbf4a,null))[_0xab3e('0x41')](handleError(_0xebbf4a,null));};exports[_0xab3e('0x46')]=function(_0x18e4a7,_0x1c3b21){return db[_0xab3e('0x29')][_0xab3e('0x46')](_0x18e4a7['body'],{})[_0xab3e('0x23')](respondWithResult(_0x1c3b21,0xc9))[_0xab3e('0x41')](handleError(_0x1c3b21,null));};exports[_0xab3e('0x22')]=function(_0x12abf0,_0x2153fa){if(_0x12abf0[_0xab3e('0x47')]['id']){delete _0x12abf0[_0xab3e('0x47')]['id'];}return db[_0xab3e('0x29')][_0xab3e('0x45')]({'where':{'id':_0x12abf0[_0xab3e('0x48')]['id']}})[_0xab3e('0x23')](handleEntityNotFound(_0x2153fa,null))[_0xab3e('0x23')](saveUpdates(_0x12abf0[_0xab3e('0x47')],null))[_0xab3e('0x23')](respondWithResult(_0x2153fa,null))[_0xab3e('0x41')](handleError(_0x2153fa,null));};exports[_0xab3e('0x49')]=function(_0x17d85f,_0xc055b8){return db[_0xab3e('0x29')]['find']({'where':{'id':_0x17d85f[_0xab3e('0x48')]['id']}})[_0xab3e('0x23')](handleEntityNotFound(_0xc055b8,null))[_0xab3e('0x23')](removeEntity(_0xc055b8,null))['catch'](handleError(_0xc055b8,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index b6a19ee..5588760 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 _0xfa2b=['lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','zendesk_unique_index','FieldId'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xfa2b,0x75));var _0xbfa2=function(_0x175127,_0x1207b1){_0x175127=_0x175127-0x0;var _0x4374f1=_0xfa2b[_0x175127];return _0x4374f1;};'use strict';var _=require(_0xbfa2('0x0'));var util=require('util');var logger=require(_0xbfa2('0x1'))('api');var moment=require(_0xbfa2('0x2'));var BPromise=require(_0xbfa2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbfa2('0x4'));var rimraf=require(_0xbfa2('0x5'));var config=require(_0xbfa2('0x6'));var attributes=require(_0xbfa2('0x7'));module[_0xbfa2('0x8')]=function(_0x5dcecf,_0x29c47d){return _0x5dcecf[_0xbfa2('0x9')](_0xbfa2('0xa'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0xbfa2('0xb'),'fields':['idField',_0xbfa2('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x669a=['int_zendesk_fields','zendesk_unique_index','idField','FieldId','util','../../config/logger','api','moment','request-promise','rimraf','exports','define'];(function(_0x2625a3,_0x268105){var _0x2943f2=function(_0x5d6c0c){while(--_0x5d6c0c){_0x2625a3['push'](_0x2625a3['shift']());}};_0x2943f2(++_0x268105);}(_0x669a,0x154));var _0xa669=function(_0x113195,_0x3f2b31){_0x113195=_0x113195-0x0;var _0x2c482c=_0x669a[_0x113195];return _0x2c482c;};'use strict';var _=require('lodash');var util=require(_0xa669('0x0'));var logger=require(_0xa669('0x1'))(_0xa669('0x2'));var moment=require(_0xa669('0x3'));var BPromise=require('bluebird');var rp=require(_0xa669('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa669('0x5'));var config=require('../../config/environment');var attributes=require('./intZendeskField.attributes');module[_0xa669('0x6')]=function(_0x5d0781,_0x472c23){return _0x5d0781[_0xa669('0x7')]('ZendeskField',attributes,{'tableName':_0xa669('0x8'),'paranoid':![],'indexes':[{'name':_0xa669('0x9'),'fields':[_0xa669('0xa'),_0xa669('0xb')],'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 4601c3f..151496c 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 _0xc3ef=['then','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','message','info','result','lodash','util','moment','bluebird','client','http'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xc3ef,0x9a));var _0xfc3e=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xc3ef[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xfc3e('0x0'));var util=require(_0xfc3e('0x1'));var moment=require(_0xfc3e('0x2'));var BPromise=require(_0xfc3e('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('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfc3e('0x4')][_0xfc3e('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x15d3bf,_0x4ce2cc,_0x54a5f8){return new BPromise(function(_0x5cfc68,_0x148cf9){return client['request'](_0x15d3bf,_0x54a5f8)[_0xfc3e('0x6')](function(_0x275bc8){logger['info'](_0xfc3e('0x7'),_0x4ce2cc,_0xfc3e('0x8'));logger[_0xfc3e('0x9')](_0xfc3e('0xa'),_0x4ce2cc,_0xfc3e('0x8'),JSON['stringify'](_0x275bc8));if(_0x275bc8[_0xfc3e('0xb')]){if(_0x275bc8[_0xfc3e('0xb')][_0xfc3e('0xc')]===0x1f4){logger['error'](_0xfc3e('0x7'),_0x4ce2cc,_0x275bc8[_0xfc3e('0xb')][_0xfc3e('0xd')]);return _0x148cf9(_0x275bc8[_0xfc3e('0xb')][_0xfc3e('0xd')]);}logger['error'](_0xfc3e('0x7'),_0x4ce2cc,_0x275bc8['error'][_0xfc3e('0xd')]);return _0x5cfc68(_0x275bc8[_0xfc3e('0xb')][_0xfc3e('0xd')]);}else{logger[_0xfc3e('0xe')](_0xfc3e('0x7'),_0x4ce2cc,_0xfc3e('0x8'));_0x5cfc68(_0x275bc8[_0xfc3e('0xf')][_0xfc3e('0xd')]);}})['catch'](function(_0xc74332){logger['error'](_0xfc3e('0x7'),_0x4ce2cc,_0xc74332);_0x148cf9(_0xc74332);});});} \ No newline at end of file +var _0x4fab=['ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x25638b,_0x10bef0){var _0x2ade8e=function(_0x30a39a){while(--_0x30a39a){_0x25638b['push'](_0x25638b['shift']());}};_0x2ade8e(++_0x10bef0);}(_0x4fab,0x1d4));var _0xb4fa=function(_0x50b9b8,_0x17f6f8){_0x50b9b8=_0x50b9b8-0x0;var _0x59cb57=_0x4fab[_0x50b9b8];return _0x59cb57;};'use strict';var _=require(_0xb4fa('0x0'));var util=require(_0xb4fa('0x1'));var moment=require(_0xb4fa('0x2'));var BPromise=require(_0xb4fa('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb4fa('0x4'));var db=require(_0xb4fa('0x5'))['db'];var utils=require(_0xb4fa('0x6'));var logger=require(_0xb4fa('0x7'))(_0xb4fa('0x8'));var config=require(_0xb4fa('0x9'));var jayson=require(_0xb4fa('0xa'));var client=jayson[_0xb4fa('0xb')][_0xb4fa('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x401715,_0x96cedf,_0x581e7a){return new BPromise(function(_0x43cc49,_0x57e33c){return client['request'](_0x401715,_0x581e7a)[_0xb4fa('0xd')](function(_0x9da263){logger[_0xb4fa('0xe')](_0xb4fa('0xf'),_0x96cedf,_0xb4fa('0x10'));logger[_0xb4fa('0x11')](_0xb4fa('0x12'),_0x96cedf,'request\x20sent',JSON['stringify'](_0x9da263));if(_0x9da263[_0xb4fa('0x13')]){if(_0x9da263[_0xb4fa('0x13')][_0xb4fa('0x14')]===0x1f4){logger[_0xb4fa('0x13')](_0xb4fa('0xf'),_0x96cedf,_0x9da263['error']['message']);return _0x57e33c(_0x9da263[_0xb4fa('0x13')]['message']);}logger[_0xb4fa('0x13')](_0xb4fa('0xf'),_0x96cedf,_0x9da263[_0xb4fa('0x13')]['message']);return _0x43cc49(_0x9da263['error'][_0xb4fa('0x15')]);}else{logger[_0xb4fa('0xe')](_0xb4fa('0xf'),_0x96cedf,_0xb4fa('0x10'));_0x43cc49(_0x9da263['result'][_0xb4fa('0x15')]);}})[_0xb4fa('0x16')](function(_0x7e7a9b){logger[_0xb4fa('0x13')](_0xb4fa('0xf'),_0x96cedf,_0x7e7a9b);_0x57e33c(_0x7e7a9b);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index fd0228b..be44197 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 _0xf14b=['post','create','addConfiguration','put','update','delete','destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0xf14b,0xb8));var _0xbf14=function(_0x60290f,_0x1da37a){_0x60290f=_0x60290f-0x0;var _0x38eaa0=_0xf14b[_0x60290f];return _0x38eaa0;};'use strict';var multer=require('multer');var util=require(_0xbf14('0x0'));var path=require('path');var timeout=require(_0xbf14('0x1'));var express=require(_0xbf14('0x2'));var router=express['Router']();var fs_extra=require(_0xbf14('0x3'));var auth=require(_0xbf14('0x4'));var interaction=require(_0xbf14('0x5'));var config=require(_0xbf14('0x6'));var controller=require(_0xbf14('0x7'));router['get']('/',auth[_0xbf14('0x8')](),controller[_0xbf14('0x9')]);router[_0xbf14('0xa')](_0xbf14('0xb'),auth['isAuthenticated'](),controller[_0xbf14('0xc')]);router[_0xbf14('0xa')](_0xbf14('0xd'),auth['isAuthenticated'](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0xbf14('0x8')](),controller['getFields']);router[_0xbf14('0xe')]('/',auth[_0xbf14('0x8')](),controller[_0xbf14('0xf')]);router[_0xbf14('0xe')](_0xbf14('0xd'),auth[_0xbf14('0x8')](),controller[_0xbf14('0x10')]);router[_0xbf14('0x11')](_0xbf14('0xb'),auth[_0xbf14('0x8')](),controller[_0xbf14('0x12')]);router[_0xbf14('0x13')](_0xbf14('0xb'),auth[_0xbf14('0x8')](),controller[_0xbf14('0x14')]);module[_0xbf14('0x15')]=router; \ No newline at end of file +var _0x0b14=['isAuthenticated','index','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get'];(function(_0x1f38cf,_0x79d55e){var _0x21947d=function(_0x1179ea){while(--_0x1179ea){_0x1f38cf['push'](_0x1f38cf['shift']());}};_0x21947d(++_0x79d55e);}(_0x0b14,0x121));var _0x40b1=function(_0x66b46c,_0x5dba04){_0x66b46c=_0x66b46c-0x0;var _0x113fba=_0x0b14[_0x66b46c];return _0x113fba;};'use strict';var multer=require('multer');var util=require(_0x40b1('0x0'));var path=require(_0x40b1('0x1'));var timeout=require(_0x40b1('0x2'));var express=require(_0x40b1('0x3'));var router=express[_0x40b1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x40b1('0x5'));var interaction=require(_0x40b1('0x6'));var config=require(_0x40b1('0x7'));var controller=require(_0x40b1('0x8'));router[_0x40b1('0x9')]('/',auth[_0x40b1('0xa')](),controller[_0x40b1('0xb')]);router[_0x40b1('0x9')]('/:id',auth[_0x40b1('0xa')](),controller['show']);router[_0x40b1('0x9')](_0x40b1('0xc'),auth[_0x40b1('0xa')](),controller[_0x40b1('0xd')]);router[_0x40b1('0x9')](_0x40b1('0xe'),auth['isAuthenticated'](),controller[_0x40b1('0xf')]);router['post']('/',auth[_0x40b1('0xa')](),controller['create']);router[_0x40b1('0x10')](_0x40b1('0xc'),auth[_0x40b1('0xa')](),controller[_0x40b1('0x11')]);router['put'](_0x40b1('0x12'),auth[_0x40b1('0xa')](),controller[_0x40b1('0x13')]);router[_0x40b1('0x14')](_0x40b1('0x12'),auth['isAuthenticated'](),controller[_0x40b1('0x15')]);module[_0x40b1('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 0b4147f..40048da 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 _0xedd9=['exports','STRING'];(function(_0x134061,_0x4a7337){var _0x4f0ff5=function(_0x47dc5b){while(--_0x47dc5b){_0x134061['push'](_0x134061['shift']());}};_0x4f0ff5(++_0x4a7337);}(_0xedd9,0xfc));var _0x9edd=function(_0x4584f1,_0x566d68){_0x4584f1=_0x4584f1-0x0;var _0x34fe53=_0xedd9[_0x4584f1];return _0x34fe53;};'use strict';var Sequelize=require('sequelize');module[_0x9edd('0x0')]={'name':{'type':Sequelize[_0x9edd('0x1')]},'description':{'type':Sequelize[_0x9edd('0x1')]},'host':{'type':Sequelize[_0x9edd('0x1')]},'zone':{'type':Sequelize[_0x9edd('0x1')]},'clientId':{'type':Sequelize[_0x9edd('0x1')]},'clientSecret':{'type':Sequelize[_0x9edd('0x1')]},'serverUrl':{'type':Sequelize[_0x9edd('0x1')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x9edd('0x1')]}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','sequelize'];(function(_0x1ffde1,_0x2e2ca5){var _0x1f644e=function(_0x168110){while(--_0x168110){_0x1ffde1['push'](_0x1ffde1['shift']());}};_0x1f644e(++_0x2e2ca5);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x5400a1,_0x2275aa){_0x5400a1=_0x5400a1-0x0;var _0x4006c7=_0xf3cd[_0x5400a1];return _0x4006c7;};'use strict';var Sequelize=require(_0xdf3c('0x0'));module[_0xdf3c('0x1')]={'name':{'type':Sequelize[_0xdf3c('0x2')]},'description':{'type':Sequelize[_0xdf3c('0x2')]},'host':{'type':Sequelize[_0xdf3c('0x2')]},'zone':{'type':Sequelize[_0xdf3c('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xdf3c('0x2')]},'serverUrl':{'type':Sequelize[_0xdf3c('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0xdf3c('0x2')]},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index f5fde87..aba26db 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 _0x4aad=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','undefined','limit','count','offset','status','Content-Range','apply','reject','update','then','destroy','error','name','send','index','map','ZohoAccount','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','findOne','getConfigurations','hasOwnProperty','AccountId','Subjects','getSubjects','getDescriptions','ZohoConfiguration','ZohoField','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','host','zone','serverUrl','code','zoho.eu','com','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','response','message','Owner','Subject','Description','Call_Duration','Call_Result','remove','includes','push','display_label','custom_field','data_type','pick_list_values','test','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','statusCode','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x160b87,_0x53a09a){var _0x3ff5a6=function(_0x1b14d2){while(--_0x1b14d2){_0x160b87['push'](_0x160b87['shift']());}};_0x3ff5a6(++_0x53a09a);}(_0x4aad,0x69));var _0xd4aa=function(_0x363ef8,_0x4ecb1a){_0x363ef8=_0x363ef8-0x0;var _0x148822=_0x4aad[_0x363ef8];return _0x148822;};'use strict';var emlformat=require(_0xd4aa('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd4aa('0x1'));var rp=require('request-promise');var moment=require(_0xd4aa('0x2'));var BPromise=require(_0xd4aa('0x3'));var Mustache=require(_0xd4aa('0x4'));var util=require(_0xd4aa('0x5'));var path=require(_0xd4aa('0x6'));var sox=require('sox');var csv=require(_0xd4aa('0x7'));var ejs=require(_0xd4aa('0x8'));var fs=require('fs');var fs_extra=require(_0xd4aa('0x9'));var _=require('lodash');var squel=require(_0xd4aa('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd4aa('0xb'));var toCsv=require('to-csv');var querystring=require(_0xd4aa('0xc'));var Papa=require(_0xd4aa('0xd'));var Redis=require('ioredis');var authService=require(_0xd4aa('0xe'));var qs=require(_0xd4aa('0xf'));var as=require(_0xd4aa('0x10'));var hardwareService=require(_0xd4aa('0x11'));var logger=require(_0xd4aa('0x12'))(_0xd4aa('0x13'));var utils=require(_0xd4aa('0x14'));var config=require(_0xd4aa('0x15'));var licenseUtil=require(_0xd4aa('0x16'));var db=require(_0xd4aa('0x17'))['db'];var integrations=require(_0xd4aa('0x18'));function respondWithStatusCode(_0x5ec86c,_0xbc951f){_0xbc951f=_0xbc951f||0xcc;return function(_0x36c90a){if(_0x36c90a){return _0x5ec86c[_0xd4aa('0x19')](_0xbc951f);}return _0x5ec86c['status'](_0xbc951f)[_0xd4aa('0x1a')]();};}function respondWithResult(_0x237b09,_0x1d3e22){_0x1d3e22=_0x1d3e22||0xc8;return function(_0x5aed30){if(_0x5aed30){return _0x237b09['status'](_0x1d3e22)['json'](_0x5aed30);}};}function respondWithFilteredResult(_0x23180a,_0x5d885e){return function(_0x52cecf){if(_0x52cecf){var _0x59e434=typeof _0x5d885e['offset']===_0xd4aa('0x1b')&&typeof _0x5d885e[_0xd4aa('0x1c')]==='undefined';var _0xecc728=_0x52cecf[_0xd4aa('0x1d')];var _0x32790c=_0x59e434?0x0:_0x5d885e[_0xd4aa('0x1e')];var _0x12e557=_0x59e434?_0x52cecf['count']:_0x5d885e['offset']+_0x5d885e[_0xd4aa('0x1c')];var _0x3a0f27;if(_0x12e557>=_0xecc728){_0x12e557=_0xecc728;_0x3a0f27=0xc8;}else{_0x3a0f27=0xce;}_0x23180a[_0xd4aa('0x1f')](_0x3a0f27);return _0x23180a['set'](_0xd4aa('0x20'),_0x32790c+'-'+_0x12e557+'/'+_0xecc728)['json'](_0x52cecf);}return null;};}function patchUpdates(_0x4286b1){return function(_0x3dd3e6){try{jsonpatch[_0xd4aa('0x21')](_0x3dd3e6,_0x4286b1,!![]);}catch(_0x3e44a8){return BPromise[_0xd4aa('0x22')](_0x3e44a8);}return _0x3dd3e6['save']();};}function saveUpdates(_0x38f7f9,_0x1ebfd6){return function(_0x35b077){if(_0x35b077){return _0x35b077[_0xd4aa('0x23')](_0x38f7f9)[_0xd4aa('0x24')](function(_0x48deb5){return _0x48deb5;});}return null;};}function removeEntity(_0x7b72e,_0x2dbc93){return function(_0x2cebfb){if(_0x2cebfb){return _0x2cebfb[_0xd4aa('0x25')]()[_0xd4aa('0x24')](function(){_0x7b72e[_0xd4aa('0x1f')](0xcc)[_0xd4aa('0x1a')]();});}};}function handleEntityNotFound(_0x471e54,_0x3a49c5){return function(_0x3d5381){if(!_0x3d5381){_0x471e54[_0xd4aa('0x19')](0x194);}return _0x3d5381;};}function handleError(_0x456001,_0x16af48){_0x16af48=_0x16af48||0x1f4;return function(_0x250553){logger[_0xd4aa('0x26')](_0x250553['stack']);if(_0x250553[_0xd4aa('0x27')]){delete _0x250553[_0xd4aa('0x27')];}_0x456001[_0xd4aa('0x1f')](_0x16af48)[_0xd4aa('0x28')](_0x250553);};}exports[_0xd4aa('0x29')]=function(_0x5d0038,_0x55b4d1){var _0x220f2c={},_0x3f8525={},_0x222b93={'count':0x0,'rows':[]};var _0x35390b=_[_0xd4aa('0x2a')](db[_0xd4aa('0x2b')][_0xd4aa('0x2c')],function(_0x2c01ad){return{'name':_0x2c01ad[_0xd4aa('0x2d')],'type':_0x2c01ad['type'][_0xd4aa('0x2e')]};});_0x3f8525[_0xd4aa('0x2f')]=_[_0xd4aa('0x2a')](_0x35390b,_0xd4aa('0x27'));_0x3f8525[_0xd4aa('0x30')]=_[_0xd4aa('0x31')](_0x5d0038[_0xd4aa('0x30')]);_0x3f8525['filters']=_[_0xd4aa('0x32')](_0x3f8525[_0xd4aa('0x2f')],_0x3f8525['query']);_0x220f2c['attributes']=_['intersection'](_0x3f8525[_0xd4aa('0x2f')],qs[_0xd4aa('0x33')](_0x5d0038[_0xd4aa('0x30')][_0xd4aa('0x33')]));_0x220f2c[_0xd4aa('0x34')]=_0x220f2c[_0xd4aa('0x34')][_0xd4aa('0x35')]?_0x220f2c['attributes']:_0x3f8525['model'];if(!_0x5d0038[_0xd4aa('0x30')]['hasOwnProperty'](_0xd4aa('0x36'))){_0x220f2c[_0xd4aa('0x1c')]=qs[_0xd4aa('0x1c')](_0x5d0038[_0xd4aa('0x30')][_0xd4aa('0x1c')]);_0x220f2c['offset']=qs[_0xd4aa('0x1e')](_0x5d0038[_0xd4aa('0x30')][_0xd4aa('0x1e')]);}_0x220f2c[_0xd4aa('0x37')]=qs[_0xd4aa('0x38')](_0x5d0038['query'][_0xd4aa('0x38')]);_0x220f2c[_0xd4aa('0x39')]=qs[_0xd4aa('0x3a')](_[_0xd4aa('0x3b')](_0x5d0038[_0xd4aa('0x30')],_0x3f8525[_0xd4aa('0x3a')]),_0x35390b);if(_0x5d0038[_0xd4aa('0x30')][_0xd4aa('0x3c')]){_0x220f2c[_0xd4aa('0x39')]=_[_0xd4aa('0x3d')](_0x220f2c['where'],{'$or':_[_0xd4aa('0x2a')](_0x35390b,function(_0x5c7e0b){if(_0x5c7e0b[_0xd4aa('0x3e')]!==_0xd4aa('0x3f')){var _0x5ebd52={};_0x5ebd52[_0x5c7e0b[_0xd4aa('0x27')]]={'$like':'%'+_0x5d0038[_0xd4aa('0x30')][_0xd4aa('0x3c')]+'%'};return _0x5ebd52;}})});}_0x220f2c=_[_0xd4aa('0x3d')]({},_0x220f2c,_0x5d0038[_0xd4aa('0x40')]);var _0x3baa02={'where':_0x220f2c['where']};return db[_0xd4aa('0x2b')]['count'](_0x3baa02)[_0xd4aa('0x24')](function(_0x5378cc){_0x222b93[_0xd4aa('0x1d')]=_0x5378cc;if(_0x5d0038[_0xd4aa('0x30')][_0xd4aa('0x41')]){_0x220f2c[_0xd4aa('0x42')]=[{'all':!![]}];}return db[_0xd4aa('0x2b')][_0xd4aa('0x43')](_0x220f2c);})['then'](function(_0x3b056e){_0x222b93['rows']=_0x3b056e;return _0x222b93;})[_0xd4aa('0x24')](respondWithFilteredResult(_0x55b4d1,_0x220f2c))[_0xd4aa('0x44')](handleError(_0x55b4d1,null));};exports['show']=function(_0x1f40ad,_0x4bcb6d){var _0x4e9cd3={'raw':![],'where':{'id':_0x1f40ad[_0xd4aa('0x45')]['id']}},_0x4a72f7={};_0x4a72f7['model']=_[_0xd4aa('0x31')](db['ZohoAccount']['rawAttributes']);_0x4a72f7[_0xd4aa('0x30')]=_[_0xd4aa('0x31')](_0x1f40ad[_0xd4aa('0x30')]);_0x4a72f7[_0xd4aa('0x3a')]=_[_0xd4aa('0x32')](_0x4a72f7[_0xd4aa('0x2f')],_0x4a72f7[_0xd4aa('0x30')]);_0x4e9cd3[_0xd4aa('0x34')]=_[_0xd4aa('0x32')](_0x4a72f7[_0xd4aa('0x2f')],qs[_0xd4aa('0x33')](_0x1f40ad['query'][_0xd4aa('0x33')]));_0x4e9cd3[_0xd4aa('0x34')]=_0x4e9cd3[_0xd4aa('0x34')][_0xd4aa('0x35')]?_0x4e9cd3[_0xd4aa('0x34')]:_0x4a72f7[_0xd4aa('0x2f')];if(_0x1f40ad['query'][_0xd4aa('0x41')]){_0x4e9cd3[_0xd4aa('0x42')]=[{'all':!![]}];}_0x4e9cd3=_[_0xd4aa('0x3d')]({},_0x4e9cd3,_0x1f40ad['options']);return db['ZohoAccount'][_0xd4aa('0x46')](_0x4e9cd3)[_0xd4aa('0x24')](handleEntityNotFound(_0x4bcb6d,null))['then'](respondWithResult(_0x4bcb6d,null))[_0xd4aa('0x44')](handleError(_0x4bcb6d,null));};exports[_0xd4aa('0x47')]=function(_0x341f9f,_0x3efa7a){return db[_0xd4aa('0x2b')][_0xd4aa('0x47')](_0x341f9f[_0xd4aa('0x48')],{})['then'](respondWithResult(_0x3efa7a,0xc9))[_0xd4aa('0x44')](handleError(_0x3efa7a,null));};exports[_0xd4aa('0x23')]=function(_0x390781,_0x25c17e){if(_0x390781['body']['id']){delete _0x390781[_0xd4aa('0x48')]['id'];}return db['ZohoAccount'][_0xd4aa('0x46')]({'where':{'id':_0x390781[_0xd4aa('0x45')]['id']}})['then'](handleEntityNotFound(_0x25c17e,null))[_0xd4aa('0x24')](saveUpdates(_0x390781['body'],null))[_0xd4aa('0x24')](respondWithResult(_0x25c17e,null))[_0xd4aa('0x44')](handleError(_0x25c17e,null));};exports['destroy']=function(_0x1d9a61,_0x3a35aa){return db['ZohoAccount'][_0xd4aa('0x46')]({'where':{'id':_0x1d9a61[_0xd4aa('0x45')]['id']}})[_0xd4aa('0x24')](handleEntityNotFound(_0x3a35aa,null))[_0xd4aa('0x24')](removeEntity(_0x3a35aa,null))['catch'](handleError(_0x3a35aa,null));};exports['getConfigurations']=function(_0x45a8ef,_0x1e1e28,_0x38f1a3){var _0x134844={};var _0x41f37f={};var _0x1b53da;var _0x3bcb6c;return db[_0xd4aa('0x2b')][_0xd4aa('0x49')]({'where':{'id':_0x45a8ef[_0xd4aa('0x45')]['id']}})[_0xd4aa('0x24')](handleEntityNotFound(_0x1e1e28,null))[_0xd4aa('0x24')](function(_0x279165){if(_0x279165){_0x1b53da=_0x279165;_0x41f37f[_0xd4aa('0x2f')]=_['keys'](db['ZohoConfiguration'][_0xd4aa('0x2c')]);_0x41f37f['query']=_['keys'](_0x45a8ef[_0xd4aa('0x30')]);_0x41f37f[_0xd4aa('0x3a')]=_['intersection'](_0x41f37f[_0xd4aa('0x2f')],_0x41f37f['query']);_0x134844[_0xd4aa('0x34')]=_[_0xd4aa('0x32')](_0x41f37f['model'],qs[_0xd4aa('0x33')](_0x45a8ef['query']['fields']));_0x134844[_0xd4aa('0x34')]=_0x134844[_0xd4aa('0x34')][_0xd4aa('0x35')]?_0x134844[_0xd4aa('0x34')]:_0x41f37f['model'];_0x134844[_0xd4aa('0x37')]=qs[_0xd4aa('0x38')](_0x45a8ef[_0xd4aa('0x30')][_0xd4aa('0x38')]);_0x134844[_0xd4aa('0x39')]=qs[_0xd4aa('0x3a')](_[_0xd4aa('0x3b')](_0x45a8ef['query'],_0x41f37f[_0xd4aa('0x3a')]));if(_0x45a8ef[_0xd4aa('0x30')]['filter']){_0x134844[_0xd4aa('0x39')]=_[_0xd4aa('0x3d')](_0x134844['where'],{'$or':_['map'](_0x134844['attributes'],function(_0x31017b){var _0xb25cac={};_0xb25cac[_0x31017b]={'$like':'%'+_0x45a8ef['query'][_0xd4aa('0x3c')]+'%'};return _0xb25cac;})});}_0x134844=_['merge']({},_0x134844,_0x45a8ef['options']);return _0x1b53da[_0xd4aa('0x4a')](_0x134844);}})['then'](function(_0x10efe3){if(_0x10efe3){_0x3bcb6c=_0x10efe3[_0xd4aa('0x35')];if(!_0x45a8ef['query'][_0xd4aa('0x4b')](_0xd4aa('0x36'))){_0x134844[_0xd4aa('0x1c')]=qs[_0xd4aa('0x1c')](_0x45a8ef[_0xd4aa('0x30')][_0xd4aa('0x1c')]);_0x134844[_0xd4aa('0x1e')]=qs[_0xd4aa('0x1e')](_0x45a8ef[_0xd4aa('0x30')][_0xd4aa('0x1e')]);}return _0x1b53da[_0xd4aa('0x4a')](_0x134844);}})[_0xd4aa('0x24')](function(_0x533cb5){if(_0x533cb5){return _0x533cb5?{'count':_0x3bcb6c,'rows':_0x533cb5}:null;}})[_0xd4aa('0x24')](respondWithResult(_0x1e1e28,null))['catch'](handleError(_0x1e1e28,null));};exports['addConfiguration']=function(_0x3017f5,_0x485a05,_0x2d78bc){if(_0x3017f5[_0xd4aa('0x48')]['id']){delete _0x3017f5[_0xd4aa('0x48')]['id'];}return db[_0xd4aa('0x2b')][_0xd4aa('0x49')]({'where':{'id':_0x3017f5[_0xd4aa('0x45')]['id']}})['then'](handleEntityNotFound(_0x485a05,null))['then'](function(_0x3fdd3c){if(_0x3fdd3c){_0x3017f5[_0xd4aa('0x48')][_0xd4aa('0x4c')]=_0x3fdd3c['id'];_0x3017f5[_0xd4aa('0x48')][_0xd4aa('0x4d')]=integrations[_0xd4aa('0x4e')](_0x3017f5[_0xd4aa('0x48')]['channel'],_0x3017f5['body'][_0xd4aa('0x3e')]);_0x3017f5['body']['Descriptions']=integrations[_0xd4aa('0x4f')](_0x3017f5['body']['channel'],_0x3017f5[_0xd4aa('0x48')][_0xd4aa('0x3e')]);return db[_0xd4aa('0x50')][_0xd4aa('0x47')](_0x3017f5[_0xd4aa('0x48')],{'include':[{'model':db[_0xd4aa('0x51')],'as':_0xd4aa('0x4d')},{'model':db[_0xd4aa('0x51')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x485a05,null))['catch'](handleError(_0x485a05,null));};function getAccessToken(_0x405939){return new Promise(function(_0x1a1262,_0x378211){var _0x197dc9;switch(_0x405939['zone']){case'US':_0x197dc9=_0xd4aa('0x52');break;case'AU':_0x197dc9='https://accounts.zoho.com.au';break;case'EU':_0x197dc9=_0xd4aa('0x53');break;case'IN':_0x197dc9='https://accounts.zoho.in';break;case'CN':_0x197dc9=_0xd4aa('0x54');break;default:_0x197dc9=_0xd4aa('0x53');break;}var _0x1c4725={'method':'POST','uri':_0x197dc9+_0xd4aa('0x55'),'qs':{'refresh_token':_0x405939[_0xd4aa('0x56')],'client_id':_0x405939[_0xd4aa('0x57')],'client_secret':_0x405939[_0xd4aa('0x58')],'grant_type':_0xd4aa('0x59')},'json':!![]};return rp(_0x1c4725)[_0xd4aa('0x24')](function(_0x1697af){if(_0x1697af[_0xd4aa('0x5a')]){_0x1a1262(_0x1697af['access_token']);}else{_0x378211('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0xd4aa('0x44')](function(_0x23fd27){_0x378211(_0x23fd27);});});}exports['getFields']=function(_0x2d6fed,_0x35cddc,_0x52e513){var _0x5925ce,_0x3ee9e6,_0x43f2f7,_0x2c1e93,_0x354892;return db[_0xd4aa('0x2b')][_0xd4aa('0x49')]({'where':{'id':_0x2d6fed[_0xd4aa('0x45')]['id']},'attributes':['id',_0xd4aa('0x5b'),_0xd4aa('0x5c'),_0xd4aa('0x57'),_0xd4aa('0x58'),_0xd4aa('0x5d'),_0xd4aa('0x5e'),'refreshToken']})[_0xd4aa('0x24')](handleEntityNotFound(_0x35cddc,null))[_0xd4aa('0x24')](function(_0x415fe2){_0x354892=_0x415fe2;_0x5925ce=_0x354892[_0xd4aa('0x5b')];_0x3ee9e6=_0x5925ce===_0xd4aa('0x5f')?'eu':_0xd4aa('0x60');_0x43f2f7=_0x354892['serverUrl'];var _0x564df8=_0x43f2f7['slice'](-0x1);if(_0x564df8==='/'||_0x564df8==='\x5c'||_0x564df8===':'){_0x43f2f7=_0x43f2f7[_0xd4aa('0x61')](0x0,_0x43f2f7[_0xd4aa('0x62')](_0x564df8));}if(!_0x354892['refreshToken']){throw new Error(_0xd4aa('0x63'));}return getAccessToken(_0x354892);})['then'](function(_0x3b8993){if(_0x3b8993){return rp({'method':'GET','uri':util['format'](_0xd4aa('0x64'),_0x3ee9e6),'qs':{'module':_0xd4aa('0x65')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x3b8993},'json':!![]});}})['then'](function(_0x1cd865){if(_0x1cd865){if(_0x1cd865[_0xd4aa('0x66')]&&_0x1cd865[_0xd4aa('0x66')][_0xd4aa('0x26')]){throw new Error(_0x1cd865[_0xd4aa('0x66')]['error'][_0xd4aa('0x67')]);}var _0x56cb91=[];var _0x5b6ba1=[];var _0x17246e=[_0xd4aa('0x68'),_0xd4aa('0x69'),_0xd4aa('0x6a'),'WhoId',_0xd4aa('0x6b'),_0xd4aa('0x6c'),'Call_Start_Time','Call_Type'];_0x5b6ba1=_[_0xd4aa('0x6d')](_0x1cd865['fields'],function(_0x50b852){return _0x17246e[_0xd4aa('0x6e')](_0x50b852['api_name']);});for(var _0x1a095c=0x0;_0x1a095c<_0x5b6ba1[_0xd4aa('0x35')];_0x1a095c++){if(_0x5b6ba1[_0x1a095c]['system_mandatory']===![]){_0x56cb91[_0xd4aa('0x6f')]({'id':_0x5b6ba1[_0x1a095c]['id'],'name':_0x5b6ba1[_0x1a095c][_0xd4aa('0x70')],'custom':_0x5b6ba1[_0x1a095c][_0xd4aa('0x71')],'options':_0x5b6ba1[_0x1a095c][_0xd4aa('0x72')]==='picklist'&&_0x5b6ba1[_0x1a095c][_0xd4aa('0x73')][_0xd4aa('0x35')]>-0x1?_['map'](_0x5b6ba1[_0x1a095c][_0xd4aa('0x73')],function(_0x1a3c74){return{'name':_0x1a3c74,'value':_0x1a3c74};}):[]});}}return{'count':_0x56cb91[_0xd4aa('0x35')],'rows':_0x56cb91};}else{return{'count':0x0,'rows':[]};}})[_0xd4aa('0x24')](respondWithResult(_0x35cddc,null))[_0xd4aa('0x44')](function(_0x18d500){var _0x16bb3a=_0x2d6fed['query'][_0xd4aa('0x74')]?0x1f4:_0x18d500['statusCode']||0x1f4;logger[_0xd4aa('0x26')](_0xd4aa('0x75'),_0xd4aa('0x76'),_0x16bb3a,JSON[_0xd4aa('0x77')](_0x18d500));delete _0x18d500[_0xd4aa('0x27')];if(_0x16bb3a===0x191){_0x16bb3a=0x190;}_0x35cddc[_0xd4aa('0x1f')](_0x16bb3a)[_0xd4aa('0x28')](_0x2d6fed[_0xd4aa('0x30')][_0xd4aa('0x74')]?{'message':_0xd4aa('0x78'),'statusCode':_0x18d500[_0xd4aa('0x79')]}:_0x18d500);});}; \ No newline at end of file +var _0x5f3b=['includeAll','include','findAll','rows','show','catch','create','body','find','params','getConfigurations','ZohoConfiguration','hasOwnProperty','addConfiguration','findOne','Subjects','Descriptions','getDescriptions','channel','ZohoField','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','serverUrl','code','host','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','remove','system_mandatory','push','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','name','send','ZohoAccount','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options'];(function(_0x291c70,_0x50c9dd){var _0x34179f=function(_0x496d88){while(--_0x496d88){_0x291c70['push'](_0x291c70['shift']());}};_0x34179f(++_0x50c9dd);}(_0x5f3b,0x14d));var _0xb5f3=function(_0x57805d,_0x549356){_0x57805d=_0x57805d-0x0;var _0x9643ed=_0x5f3b[_0x57805d];return _0x9643ed;};'use strict';var emlformat=require(_0xb5f3('0x0'));var rimraf=require(_0xb5f3('0x1'));var zipdir=require(_0xb5f3('0x2'));var jsonpatch=require(_0xb5f3('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb5f3('0x4'));var Mustache=require(_0xb5f3('0x5'));var util=require(_0xb5f3('0x6'));var path=require(_0xb5f3('0x7'));var sox=require(_0xb5f3('0x8'));var csv=require('to-csv');var ejs=require(_0xb5f3('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb5f3('0xa'));var squel=require(_0xb5f3('0xb'));var crypto=require(_0xb5f3('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb5f3('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb5f3('0xe'));var Papa=require(_0xb5f3('0xf'));var Redis=require(_0xb5f3('0x10'));var authService=require(_0xb5f3('0x11'));var qs=require(_0xb5f3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb5f3('0x13'));var logger=require('../../config/logger')(_0xb5f3('0x14'));var utils=require(_0xb5f3('0x15'));var config=require(_0xb5f3('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xb5f3('0x17'))['db'];var integrations=require(_0xb5f3('0x18'));function respondWithStatusCode(_0x5c40ce,_0x491f7d){_0x491f7d=_0x491f7d||0xcc;return function(_0x36fa0a){if(_0x36fa0a){return _0x5c40ce[_0xb5f3('0x19')](_0x491f7d);}return _0x5c40ce['status'](_0x491f7d)['end']();};}function respondWithResult(_0x1ecbd6,_0x900f0){_0x900f0=_0x900f0||0xc8;return function(_0x104b1a){if(_0x104b1a){return _0x1ecbd6[_0xb5f3('0x1a')](_0x900f0)[_0xb5f3('0x1b')](_0x104b1a);}};}function respondWithFilteredResult(_0x4e8082,_0x4977ef){return function(_0x415bc7){if(_0x415bc7){var _0x2c38af=typeof _0x4977ef[_0xb5f3('0x1c')]===_0xb5f3('0x1d')&&typeof _0x4977ef['limit']===_0xb5f3('0x1d');var _0x52e9ae=_0x415bc7['count'];var _0x1e0edf=_0x2c38af?0x0:_0x4977ef[_0xb5f3('0x1c')];var _0x31ae18=_0x2c38af?_0x415bc7[_0xb5f3('0x1e')]:_0x4977ef[_0xb5f3('0x1c')]+_0x4977ef[_0xb5f3('0x1f')];var _0x24d8a7;if(_0x31ae18>=_0x52e9ae){_0x31ae18=_0x52e9ae;_0x24d8a7=0xc8;}else{_0x24d8a7=0xce;}_0x4e8082[_0xb5f3('0x1a')](_0x24d8a7);return _0x4e8082[_0xb5f3('0x20')](_0xb5f3('0x21'),_0x1e0edf+'-'+_0x31ae18+'/'+_0x52e9ae)[_0xb5f3('0x1b')](_0x415bc7);}return null;};}function patchUpdates(_0x18c4c2){return function(_0x103e2f){try{jsonpatch[_0xb5f3('0x22')](_0x103e2f,_0x18c4c2,!![]);}catch(_0x2f74d1){return BPromise[_0xb5f3('0x23')](_0x2f74d1);}return _0x103e2f[_0xb5f3('0x24')]();};}function saveUpdates(_0x131eb5,_0x35f560){return function(_0x47b24a){if(_0x47b24a){return _0x47b24a[_0xb5f3('0x25')](_0x131eb5)[_0xb5f3('0x26')](function(_0x44821a){return _0x44821a;});}return null;};}function removeEntity(_0x10d6fc,_0x3a1f9b){return function(_0x2ff462){if(_0x2ff462){return _0x2ff462[_0xb5f3('0x27')]()[_0xb5f3('0x26')](function(){_0x10d6fc[_0xb5f3('0x1a')](0xcc)[_0xb5f3('0x28')]();});}};}function handleEntityNotFound(_0xc22464,_0xa5ba8e){return function(_0x3c870d){if(!_0x3c870d){_0xc22464[_0xb5f3('0x19')](0x194);}return _0x3c870d;};}function handleError(_0x3ce17d,_0x8b4f4c){_0x8b4f4c=_0x8b4f4c||0x1f4;return function(_0x57205d){logger['error'](_0x57205d['stack']);if(_0x57205d['name']){delete _0x57205d[_0xb5f3('0x29')];}_0x3ce17d[_0xb5f3('0x1a')](_0x8b4f4c)[_0xb5f3('0x2a')](_0x57205d);};}exports['index']=function(_0x1f7540,_0x5713c7){var _0x3cbd08={},_0x8b1f2d={},_0x2fdaef={'count':0x0,'rows':[]};var _0x263dfa=_['map'](db[_0xb5f3('0x2b')][_0xb5f3('0x2c')],function(_0x5783ef){return{'name':_0x5783ef[_0xb5f3('0x2d')],'type':_0x5783ef[_0xb5f3('0x2e')][_0xb5f3('0x2f')]};});_0x8b1f2d[_0xb5f3('0x30')]=_[_0xb5f3('0x31')](_0x263dfa,_0xb5f3('0x29'));_0x8b1f2d[_0xb5f3('0x32')]=_[_0xb5f3('0x33')](_0x1f7540[_0xb5f3('0x32')]);_0x8b1f2d['filters']=_[_0xb5f3('0x34')](_0x8b1f2d[_0xb5f3('0x30')],_0x8b1f2d[_0xb5f3('0x32')]);_0x3cbd08[_0xb5f3('0x35')]=_['intersection'](_0x8b1f2d[_0xb5f3('0x30')],qs['fields'](_0x1f7540[_0xb5f3('0x32')][_0xb5f3('0x36')]));_0x3cbd08['attributes']=_0x3cbd08[_0xb5f3('0x35')][_0xb5f3('0x37')]?_0x3cbd08['attributes']:_0x8b1f2d[_0xb5f3('0x30')];if(!_0x1f7540[_0xb5f3('0x32')]['hasOwnProperty'](_0xb5f3('0x38'))){_0x3cbd08[_0xb5f3('0x1f')]=qs[_0xb5f3('0x1f')](_0x1f7540[_0xb5f3('0x32')]['limit']);_0x3cbd08[_0xb5f3('0x1c')]=qs['offset'](_0x1f7540[_0xb5f3('0x32')][_0xb5f3('0x1c')]);}_0x3cbd08[_0xb5f3('0x39')]=qs[_0xb5f3('0x3a')](_0x1f7540[_0xb5f3('0x32')][_0xb5f3('0x3a')]);_0x3cbd08[_0xb5f3('0x3b')]=qs[_0xb5f3('0x3c')](_[_0xb5f3('0x3d')](_0x1f7540['query'],_0x8b1f2d['filters']),_0x263dfa);if(_0x1f7540[_0xb5f3('0x32')][_0xb5f3('0x3e')]){_0x3cbd08[_0xb5f3('0x3b')]=_[_0xb5f3('0x3f')](_0x3cbd08[_0xb5f3('0x3b')],{'$or':_['map'](_0x263dfa,function(_0x1aac10){if(_0x1aac10[_0xb5f3('0x2e')]!==_0xb5f3('0x40')){var _0x3f9cae={};_0x3f9cae[_0x1aac10['name']]={'$like':'%'+_0x1f7540[_0xb5f3('0x32')][_0xb5f3('0x3e')]+'%'};return _0x3f9cae;}})});}_0x3cbd08=_[_0xb5f3('0x3f')]({},_0x3cbd08,_0x1f7540[_0xb5f3('0x41')]);var _0x6215ff={'where':_0x3cbd08[_0xb5f3('0x3b')]};return db['ZohoAccount']['count'](_0x6215ff)[_0xb5f3('0x26')](function(_0x75b129){_0x2fdaef[_0xb5f3('0x1e')]=_0x75b129;if(_0x1f7540['query'][_0xb5f3('0x42')]){_0x3cbd08[_0xb5f3('0x43')]=[{'all':!![]}];}return db[_0xb5f3('0x2b')][_0xb5f3('0x44')](_0x3cbd08);})[_0xb5f3('0x26')](function(_0x3e0e00){_0x2fdaef[_0xb5f3('0x45')]=_0x3e0e00;return _0x2fdaef;})[_0xb5f3('0x26')](respondWithFilteredResult(_0x5713c7,_0x3cbd08))['catch'](handleError(_0x5713c7,null));};exports[_0xb5f3('0x46')]=function(_0x492f23,_0x2175a6){var _0x19b0f9={'raw':![],'where':{'id':_0x492f23['params']['id']}},_0x291a2b={};_0x291a2b[_0xb5f3('0x30')]=_[_0xb5f3('0x33')](db[_0xb5f3('0x2b')][_0xb5f3('0x2c')]);_0x291a2b[_0xb5f3('0x32')]=_['keys'](_0x492f23['query']);_0x291a2b[_0xb5f3('0x3c')]=_[_0xb5f3('0x34')](_0x291a2b[_0xb5f3('0x30')],_0x291a2b[_0xb5f3('0x32')]);_0x19b0f9[_0xb5f3('0x35')]=_[_0xb5f3('0x34')](_0x291a2b[_0xb5f3('0x30')],qs[_0xb5f3('0x36')](_0x492f23[_0xb5f3('0x32')]['fields']));_0x19b0f9['attributes']=_0x19b0f9['attributes']['length']?_0x19b0f9[_0xb5f3('0x35')]:_0x291a2b[_0xb5f3('0x30')];if(_0x492f23[_0xb5f3('0x32')]['includeAll']){_0x19b0f9['include']=[{'all':!![]}];}_0x19b0f9=_[_0xb5f3('0x3f')]({},_0x19b0f9,_0x492f23[_0xb5f3('0x41')]);return db[_0xb5f3('0x2b')]['find'](_0x19b0f9)[_0xb5f3('0x26')](handleEntityNotFound(_0x2175a6,null))[_0xb5f3('0x26')](respondWithResult(_0x2175a6,null))[_0xb5f3('0x47')](handleError(_0x2175a6,null));};exports['create']=function(_0x54c693,_0x10e4ef){return db[_0xb5f3('0x2b')][_0xb5f3('0x48')](_0x54c693[_0xb5f3('0x49')],{})[_0xb5f3('0x26')](respondWithResult(_0x10e4ef,0xc9))[_0xb5f3('0x47')](handleError(_0x10e4ef,null));};exports['update']=function(_0x60ea11,_0x33a582){if(_0x60ea11['body']['id']){delete _0x60ea11['body']['id'];}return db[_0xb5f3('0x2b')][_0xb5f3('0x4a')]({'where':{'id':_0x60ea11[_0xb5f3('0x4b')]['id']}})['then'](handleEntityNotFound(_0x33a582,null))[_0xb5f3('0x26')](saveUpdates(_0x60ea11[_0xb5f3('0x49')],null))[_0xb5f3('0x26')](respondWithResult(_0x33a582,null))[_0xb5f3('0x47')](handleError(_0x33a582,null));};exports[_0xb5f3('0x27')]=function(_0x10419b,_0x30dc6c){return db[_0xb5f3('0x2b')][_0xb5f3('0x4a')]({'where':{'id':_0x10419b[_0xb5f3('0x4b')]['id']}})[_0xb5f3('0x26')](handleEntityNotFound(_0x30dc6c,null))[_0xb5f3('0x26')](removeEntity(_0x30dc6c,null))[_0xb5f3('0x47')](handleError(_0x30dc6c,null));};exports[_0xb5f3('0x4c')]=function(_0x41ab9d,_0x456252,_0x41900a){var _0xc57f61={};var _0x27f389={};var _0x347deb;var _0x252868;return db[_0xb5f3('0x2b')]['findOne']({'where':{'id':_0x41ab9d[_0xb5f3('0x4b')]['id']}})[_0xb5f3('0x26')](handleEntityNotFound(_0x456252,null))[_0xb5f3('0x26')](function(_0x1836d9){if(_0x1836d9){_0x347deb=_0x1836d9;_0x27f389[_0xb5f3('0x30')]=_[_0xb5f3('0x33')](db[_0xb5f3('0x4d')][_0xb5f3('0x2c')]);_0x27f389['query']=_['keys'](_0x41ab9d['query']);_0x27f389['filters']=_[_0xb5f3('0x34')](_0x27f389['model'],_0x27f389[_0xb5f3('0x32')]);_0xc57f61['attributes']=_['intersection'](_0x27f389[_0xb5f3('0x30')],qs['fields'](_0x41ab9d['query'][_0xb5f3('0x36')]));_0xc57f61[_0xb5f3('0x35')]=_0xc57f61[_0xb5f3('0x35')][_0xb5f3('0x37')]?_0xc57f61['attributes']:_0x27f389[_0xb5f3('0x30')];_0xc57f61[_0xb5f3('0x39')]=qs[_0xb5f3('0x3a')](_0x41ab9d[_0xb5f3('0x32')][_0xb5f3('0x3a')]);_0xc57f61[_0xb5f3('0x3b')]=qs[_0xb5f3('0x3c')](_[_0xb5f3('0x3d')](_0x41ab9d[_0xb5f3('0x32')],_0x27f389[_0xb5f3('0x3c')]));if(_0x41ab9d[_0xb5f3('0x32')][_0xb5f3('0x3e')]){_0xc57f61['where']=_[_0xb5f3('0x3f')](_0xc57f61['where'],{'$or':_['map'](_0xc57f61[_0xb5f3('0x35')],function(_0x42629a){var _0x46d84a={};_0x46d84a[_0x42629a]={'$like':'%'+_0x41ab9d[_0xb5f3('0x32')][_0xb5f3('0x3e')]+'%'};return _0x46d84a;})});}_0xc57f61=_[_0xb5f3('0x3f')]({},_0xc57f61,_0x41ab9d[_0xb5f3('0x41')]);return _0x347deb[_0xb5f3('0x4c')](_0xc57f61);}})[_0xb5f3('0x26')](function(_0x4533ac){if(_0x4533ac){_0x252868=_0x4533ac[_0xb5f3('0x37')];if(!_0x41ab9d[_0xb5f3('0x32')][_0xb5f3('0x4e')](_0xb5f3('0x38'))){_0xc57f61[_0xb5f3('0x1f')]=qs[_0xb5f3('0x1f')](_0x41ab9d[_0xb5f3('0x32')]['limit']);_0xc57f61[_0xb5f3('0x1c')]=qs[_0xb5f3('0x1c')](_0x41ab9d[_0xb5f3('0x32')][_0xb5f3('0x1c')]);}return _0x347deb[_0xb5f3('0x4c')](_0xc57f61);}})['then'](function(_0x5305b5){if(_0x5305b5){return _0x5305b5?{'count':_0x252868,'rows':_0x5305b5}:null;}})[_0xb5f3('0x26')](respondWithResult(_0x456252,null))[_0xb5f3('0x47')](handleError(_0x456252,null));};exports[_0xb5f3('0x4f')]=function(_0x403e63,_0x40d709,_0x49374a){if(_0x403e63[_0xb5f3('0x49')]['id']){delete _0x403e63[_0xb5f3('0x49')]['id'];}return db['ZohoAccount'][_0xb5f3('0x50')]({'where':{'id':_0x403e63[_0xb5f3('0x4b')]['id']}})[_0xb5f3('0x26')](handleEntityNotFound(_0x40d709,null))[_0xb5f3('0x26')](function(_0x5135b6){if(_0x5135b6){_0x403e63[_0xb5f3('0x49')]['AccountId']=_0x5135b6['id'];_0x403e63[_0xb5f3('0x49')][_0xb5f3('0x51')]=integrations['getSubjects'](_0x403e63[_0xb5f3('0x49')]['channel'],_0x403e63[_0xb5f3('0x49')][_0xb5f3('0x2e')]);_0x403e63[_0xb5f3('0x49')][_0xb5f3('0x52')]=integrations[_0xb5f3('0x53')](_0x403e63['body'][_0xb5f3('0x54')],_0x403e63[_0xb5f3('0x49')][_0xb5f3('0x2e')]);return db[_0xb5f3('0x4d')][_0xb5f3('0x48')](_0x403e63[_0xb5f3('0x49')],{'include':[{'model':db[_0xb5f3('0x55')],'as':_0xb5f3('0x51')},{'model':db[_0xb5f3('0x55')],'as':_0xb5f3('0x52')}]});}return null;})['then'](respondWithResult(_0x40d709,null))['catch'](handleError(_0x40d709,null));};function getAccessToken(_0x45973b){return new Promise(function(_0x2dd8af,_0x2e045e){var _0x49bc53;switch(_0x45973b['zone']){case'US':_0x49bc53=_0xb5f3('0x56');break;case'AU':_0x49bc53=_0xb5f3('0x57');break;case'EU':_0x49bc53=_0xb5f3('0x58');break;case'IN':_0x49bc53=_0xb5f3('0x59');break;case'CN':_0x49bc53=_0xb5f3('0x5a');break;default:_0x49bc53=_0xb5f3('0x58');break;}var _0x894d04={'method':_0xb5f3('0x5b'),'uri':_0x49bc53+'/oauth/v2/token','qs':{'refresh_token':_0x45973b[_0xb5f3('0x5c')],'client_id':_0x45973b[_0xb5f3('0x5d')],'client_secret':_0x45973b[_0xb5f3('0x5e')],'grant_type':_0xb5f3('0x5f')},'json':!![]};return rp(_0x894d04)[_0xb5f3('0x26')](function(_0x26107a){if(_0x26107a[_0xb5f3('0x60')]){_0x2dd8af(_0x26107a[_0xb5f3('0x60')]);}else{_0x2e045e(_0xb5f3('0x61'));}})[_0xb5f3('0x47')](function(_0x145d15){_0x2e045e(_0x145d15);});});}exports[_0xb5f3('0x62')]=function(_0x4ab25b,_0x36dbe2,_0x2593a0){var _0x3bedd5,_0x193d46,_0x347dc2,_0x28c2ed,_0x19b693;return db['ZohoAccount'][_0xb5f3('0x50')]({'where':{'id':_0x4ab25b[_0xb5f3('0x4b')]['id']},'attributes':['id','host','zone',_0xb5f3('0x5d'),_0xb5f3('0x5e'),_0xb5f3('0x63'),_0xb5f3('0x64'),_0xb5f3('0x5c')]})[_0xb5f3('0x26')](handleEntityNotFound(_0x36dbe2,null))[_0xb5f3('0x26')](function(_0x2ec188){_0x19b693=_0x2ec188;_0x3bedd5=_0x19b693[_0xb5f3('0x65')];_0x193d46=_0x3bedd5===_0xb5f3('0x66')?'eu':_0xb5f3('0x67');_0x347dc2=_0x19b693[_0xb5f3('0x63')];var _0x65da7a=_0x347dc2[_0xb5f3('0x68')](-0x1);if(_0x65da7a==='/'||_0x65da7a==='\x5c'||_0x65da7a===':'){_0x347dc2=_0x347dc2[_0xb5f3('0x69')](0x0,_0x347dc2[_0xb5f3('0x6a')](_0x65da7a));}if(!_0x19b693[_0xb5f3('0x5c')]){throw new Error(_0xb5f3('0x6b'));}return getAccessToken(_0x19b693);})[_0xb5f3('0x26')](function(_0x5a561e){if(_0x5a561e){return rp({'method':_0xb5f3('0x6c'),'uri':util[_0xb5f3('0x6d')](_0xb5f3('0x6e'),_0x193d46),'qs':{'module':_0xb5f3('0x6f')},'headers':{'Authorization':_0xb5f3('0x70')+_0x5a561e},'json':!![]});}})[_0xb5f3('0x26')](function(_0x36b88e){if(_0x36b88e){if(_0x36b88e[_0xb5f3('0x71')]&&_0x36b88e[_0xb5f3('0x71')]['error']){throw new Error(_0x36b88e['response']['error'][_0xb5f3('0x72')]);}var _0x5a10d3=[];var _0x2ce0a1=[];var _0xdd4e4d=[_0xb5f3('0x73'),_0xb5f3('0x74'),_0xb5f3('0x75'),_0xb5f3('0x76'),_0xb5f3('0x77'),_0xb5f3('0x78'),'Call_Start_Time','Call_Type'];_0x2ce0a1=_[_0xb5f3('0x79')](_0x36b88e[_0xb5f3('0x36')],function(_0x5e0fbd){return _0xdd4e4d['includes'](_0x5e0fbd['api_name']);});for(var _0x54a042=0x0;_0x54a042<_0x2ce0a1[_0xb5f3('0x37')];_0x54a042++){if(_0x2ce0a1[_0x54a042][_0xb5f3('0x7a')]===![]){_0x5a10d3[_0xb5f3('0x7b')]({'id':_0x2ce0a1[_0x54a042]['id'],'name':_0x2ce0a1[_0x54a042]['display_label'],'custom':_0x2ce0a1[_0x54a042][_0xb5f3('0x7c')],'options':_0x2ce0a1[_0x54a042][_0xb5f3('0x7d')]===_0xb5f3('0x7e')&&_0x2ce0a1[_0x54a042][_0xb5f3('0x7f')]['length']>-0x1?_[_0xb5f3('0x31')](_0x2ce0a1[_0x54a042]['pick_list_values'],function(_0x414de0){return{'name':_0x414de0,'value':_0x414de0};}):[]});}}return{'count':_0x5a10d3[_0xb5f3('0x37')],'rows':_0x5a10d3};}else{return{'count':0x0,'rows':[]};}})[_0xb5f3('0x26')](respondWithResult(_0x36dbe2,null))['catch'](function(_0x5ccc96){var _0x268859=_0x4ab25b['query'][_0xb5f3('0x80')]?0x1f4:_0x5ccc96[_0xb5f3('0x81')]||0x1f4;logger['error'](_0xb5f3('0x82'),_0xb5f3('0x62'),_0x268859,JSON[_0xb5f3('0x83')](_0x5ccc96));delete _0x5ccc96['name'];if(_0x268859===0x191){_0x268859=0x190;}_0x36dbe2['status'](_0x268859)['send'](_0x4ab25b[_0xb5f3('0x32')][_0xb5f3('0x80')]?{'message':_0xb5f3('0x84'),'statusCode':_0x5ccc96[_0xb5f3('0x81')]}:_0x5ccc96);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 4879c2d..cc3bc95 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 _0xf1c6=['../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','define','ZohoAccount','int_zoho_accounts','zone','changed','serverUrl','clientId','code','host','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','authorization_code','clientSecret','application/x-www-form-urlencoded','parse','refresh_token','info','format','name','error','inspect','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','substring','/oauth/v2/token','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','catch','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x4a5806,_0x4d2c4f){var _0xbd7bc0=function(_0x3a302b){while(--_0x3a302b){_0x4a5806['push'](_0x4a5806['shift']());}};_0xbd7bc0(++_0x4d2c4f);}(_0xf1c6,0xf4));var _0x6f1c=function(_0x556b0b,_0x2433e2){_0x556b0b=_0x556b0b-0x0;var _0x148456=_0xf1c6[_0x556b0b];return _0x148456;};'use strict';var _=require(_0x6f1c('0x0'));var util=require(_0x6f1c('0x1'));var logger=require(_0x6f1c('0x2'))(_0x6f1c('0x3'));var moment=require(_0x6f1c('0x4'));var BPromise=require(_0x6f1c('0x5'));var rp=require(_0x6f1c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6f1c('0x7'));var config=require(_0x6f1c('0x8'));var attributes=require(_0x6f1c('0x9'));var integrations=require(_0x6f1c('0xa'));module['exports']=function(_0x57bb67,_0x1a3460){return _0x57bb67[_0x6f1c('0xb')](_0x6f1c('0xc'),attributes,{'tableName':_0x6f1c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x10f531,_0x316e0e,_0x52a2a6){if(_0x10f531['changed'](_0x6f1c('0xe'))||_0x10f531[_0x6f1c('0xf')](_0x6f1c('0x10'))||_0x10f531[_0x6f1c('0xf')](_0x6f1c('0x11'))||_0x10f531[_0x6f1c('0xf')]('clientSecret')||_0x10f531[_0x6f1c('0xf')](_0x6f1c('0x12'))||_0x10f531['changed'](_0x6f1c('0x13'))){var _0x5b3e91,_0x5aa99e;_0x5b3e91=_0x10f531[_0x6f1c('0x10')];var _0x2d5956=_0x5b3e91['slice'](-0x1);if(_0x2d5956==='/'||_0x2d5956==='\x5c'||_0x2d5956===':'){_0x5b3e91=_0x5b3e91['substring'](0x0,_0x5b3e91[_0x6f1c('0x14')](_0x2d5956));}switch(_0x10f531['zone']){case'US':_0x5aa99e=_0x6f1c('0x15');break;case'AU':_0x5aa99e=_0x6f1c('0x16');break;case'IN':_0x5aa99e=_0x6f1c('0x17');break;case'CN':_0x5aa99e=_0x6f1c('0x18');break;default:_0x5aa99e=_0x6f1c('0x19');break;}var _0x229e31={'method':_0x6f1c('0x1a'),'uri':_0x5aa99e+'/oauth/v2/token','form':{'grant_type':_0x6f1c('0x1b'),'client_id':_0x10f531['clientId'],'client_secret':_0x10f531[_0x6f1c('0x1c')],'redirect_uri':_0x10f531['serverUrl'],'code':_0x10f531[_0x6f1c('0x12')]},'headers':{'Content-Type':_0x6f1c('0x1d')}};return rp(_0x229e31)['then'](function(_0x5475d6){var _0x317686=JSON[_0x6f1c('0x1e')](_0x5475d6);if(_0x317686[_0x6f1c('0x1f')]){_0x10f531['refreshToken']=_0x317686[_0x6f1c('0x1f')];logger[_0x6f1c('0x20')](util[_0x6f1c('0x21')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x10f531[_0x6f1c('0x22')],_0x10f531['id']));}else{logger[_0x6f1c('0x23')](util[_0x6f1c('0x21')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x10f531[_0x6f1c('0x22')],_0x10f531['id']),util[_0x6f1c('0x24')](_0x317686,{'showHidden':![],'depth':null}));}return _0x52a2a6(null,_0x316e0e);})['catch'](function(_0x20fd66){logger[_0x6f1c('0x23')](util[_0x6f1c('0x21')](_0x6f1c('0x25'),_0x10f531['name'],_0x10f531['id']),util[_0x6f1c('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x52a2a6(_0x20fd66);});}else{return _0x52a2a6(null,_0x316e0e);}},'beforeUpdate':function(_0xd19a62,_0x235773,_0x241ee7){if(_0xd19a62[_0x6f1c('0xf')](_0x6f1c('0xe'))||_0xd19a62['changed'](_0x6f1c('0x10'))||_0xd19a62[_0x6f1c('0xf')](_0x6f1c('0x11'))||_0xd19a62[_0x6f1c('0xf')](_0x6f1c('0x1c'))||_0xd19a62['changed'](_0x6f1c('0x12'))||_0xd19a62[_0x6f1c('0xf')](_0x6f1c('0x13'))){var _0x1faa4a,_0x31e829;_0x1faa4a=_0xd19a62[_0x6f1c('0x10')];var _0x4d120d=_0x1faa4a['slice'](-0x1);if(_0x4d120d==='/'||_0x4d120d==='\x5c'||_0x4d120d===':'){_0x1faa4a=_0x1faa4a[_0x6f1c('0x26')](0x0,_0x1faa4a[_0x6f1c('0x14')](_0x4d120d));}switch(_0xd19a62[_0x6f1c('0xe')]){case'US':_0x31e829='https://accounts.zoho.com';break;case'AU':_0x31e829=_0x6f1c('0x16');break;case'IN':_0x31e829=_0x6f1c('0x17');break;case'CN':_0x31e829=_0x6f1c('0x18');break;default:_0x31e829=_0x6f1c('0x19');break;}var _0x4d38ad={'method':_0x6f1c('0x1a'),'uri':_0x31e829+_0x6f1c('0x27'),'form':{'grant_type':'authorization_code','client_id':_0xd19a62[_0x6f1c('0x11')],'client_secret':_0xd19a62[_0x6f1c('0x1c')],'redirect_uri':_0xd19a62[_0x6f1c('0x10')],'code':_0xd19a62['code']},'headers':{'Content-Type':_0x6f1c('0x1d')}};return rp(_0x4d38ad)['then'](function(_0x41adda){var _0x2ee3e7=JSON[_0x6f1c('0x1e')](_0x41adda);if(_0x2ee3e7['refresh_token']){_0xd19a62['refreshToken']=_0x2ee3e7[_0x6f1c('0x1f')];logger[_0x6f1c('0x20')](util[_0x6f1c('0x21')](_0x6f1c('0x28'),_0xd19a62[_0x6f1c('0x22')],_0xd19a62['id']));}else{logger[_0x6f1c('0x23')](util[_0x6f1c('0x21')](_0x6f1c('0x25'),_0xd19a62[_0x6f1c('0x22')],_0xd19a62['id']),util[_0x6f1c('0x24')](_0x2ee3e7,{'showHidden':![],'depth':null}));}return _0x241ee7(null,_0x235773);})[_0x6f1c('0x29')](function(_0x2ad9a6){logger[_0x6f1c('0x23')](util[_0x6f1c('0x21')](_0x6f1c('0x25'),_0xd19a62['name'],_0xd19a62['id']),util[_0x6f1c('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x241ee7(_0x2ad9a6);});}else{return _0x241ee7(null,_0x235773);}}}});}; \ No newline at end of file +var _0x54c6=['path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','serverUrl','changed','clientId','clientSecret','code','host','substring','lastIndexOf','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','https://accounts.zoho.eu','POST','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xbef78d,_0x423313){var _0x1330fb=function(_0x207d12){while(--_0x207d12){_0xbef78d['push'](_0xbef78d['shift']());}};_0x1330fb(++_0x423313);}(_0x54c6,0xda));var _0x654c=function(_0x1587a9,_0x124b5a){_0x1587a9=_0x1587a9-0x0;var _0x4e1317=_0x54c6[_0x1587a9];return _0x4e1317;};'use strict';var _=require(_0x654c('0x0'));var util=require(_0x654c('0x1'));var logger=require(_0x654c('0x2'))(_0x654c('0x3'));var moment=require(_0x654c('0x4'));var BPromise=require(_0x654c('0x5'));var rp=require(_0x654c('0x6'));var fs=require('fs');var path=require(_0x654c('0x7'));var rimraf=require(_0x654c('0x8'));var config=require(_0x654c('0x9'));var attributes=require(_0x654c('0xa'));var integrations=require(_0x654c('0xb'));module[_0x654c('0xc')]=function(_0x623f14,_0x1e8968){return _0x623f14[_0x654c('0xd')](_0x654c('0xe'),attributes,{'tableName':_0x654c('0xf'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x41d963,_0x3432ca,_0x288cb7){if(_0x41d963['changed']('zone')||_0x41d963['changed'](_0x654c('0x10'))||_0x41d963[_0x654c('0x11')](_0x654c('0x12'))||_0x41d963[_0x654c('0x11')](_0x654c('0x13'))||_0x41d963['changed'](_0x654c('0x14'))||_0x41d963[_0x654c('0x11')](_0x654c('0x15'))){var _0x703006,_0x2499d0;_0x703006=_0x41d963['serverUrl'];var _0x53e166=_0x703006['slice'](-0x1);if(_0x53e166==='/'||_0x53e166==='\x5c'||_0x53e166===':'){_0x703006=_0x703006[_0x654c('0x16')](0x0,_0x703006[_0x654c('0x17')](_0x53e166));}switch(_0x41d963[_0x654c('0x18')]){case'US':_0x2499d0=_0x654c('0x19');break;case'AU':_0x2499d0=_0x654c('0x1a');break;case'IN':_0x2499d0=_0x654c('0x1b');break;case'CN':_0x2499d0=_0x654c('0x1c');break;default:_0x2499d0='https://accounts.zoho.eu';break;}var _0x1da1f1={'method':'POST','uri':_0x2499d0+_0x654c('0x1d'),'form':{'grant_type':'authorization_code','client_id':_0x41d963[_0x654c('0x12')],'client_secret':_0x41d963['clientSecret'],'redirect_uri':_0x41d963[_0x654c('0x10')],'code':_0x41d963[_0x654c('0x14')]},'headers':{'Content-Type':_0x654c('0x1e')}};return rp(_0x1da1f1)[_0x654c('0x1f')](function(_0x25f1d7){var _0x1cd4c6=JSON[_0x654c('0x20')](_0x25f1d7);if(_0x1cd4c6[_0x654c('0x21')]){_0x41d963[_0x654c('0x22')]=_0x1cd4c6['refresh_token'];logger[_0x654c('0x23')](util[_0x654c('0x24')](_0x654c('0x25'),_0x41d963[_0x654c('0x26')],_0x41d963['id']));}else{logger[_0x654c('0x27')](util[_0x654c('0x24')](_0x654c('0x28'),_0x41d963[_0x654c('0x26')],_0x41d963['id']),util[_0x654c('0x29')](_0x1cd4c6,{'showHidden':![],'depth':null}));}return _0x288cb7(null,_0x3432ca);})[_0x654c('0x2a')](function(_0x2de69b){logger[_0x654c('0x27')](util[_0x654c('0x24')](_0x654c('0x28'),_0x41d963[_0x654c('0x26')],_0x41d963['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x288cb7(_0x2de69b);});}else{return _0x288cb7(null,_0x3432ca);}},'beforeUpdate':function(_0x302950,_0x34048d,_0x34c683){if(_0x302950['changed'](_0x654c('0x18'))||_0x302950[_0x654c('0x11')]('serverUrl')||_0x302950[_0x654c('0x11')](_0x654c('0x12'))||_0x302950['changed'](_0x654c('0x13'))||_0x302950['changed']('code')||_0x302950['changed'](_0x654c('0x15'))){var _0x55df7a,_0x14e0ff;_0x55df7a=_0x302950[_0x654c('0x10')];var _0x1ac9af=_0x55df7a['slice'](-0x1);if(_0x1ac9af==='/'||_0x1ac9af==='\x5c'||_0x1ac9af===':'){_0x55df7a=_0x55df7a['substring'](0x0,_0x55df7a[_0x654c('0x17')](_0x1ac9af));}switch(_0x302950[_0x654c('0x18')]){case'US':_0x14e0ff=_0x654c('0x19');break;case'AU':_0x14e0ff=_0x654c('0x1a');break;case'IN':_0x14e0ff=_0x654c('0x1b');break;case'CN':_0x14e0ff=_0x654c('0x1c');break;default:_0x14e0ff=_0x654c('0x2b');break;}var _0x572744={'method':_0x654c('0x2c'),'uri':_0x14e0ff+_0x654c('0x1d'),'form':{'grant_type':'authorization_code','client_id':_0x302950['clientId'],'client_secret':_0x302950['clientSecret'],'redirect_uri':_0x302950[_0x654c('0x10')],'code':_0x302950[_0x654c('0x14')]},'headers':{'Content-Type':_0x654c('0x1e')}};return rp(_0x572744)[_0x654c('0x1f')](function(_0x22635c){var _0x3ba9c5=JSON[_0x654c('0x20')](_0x22635c);if(_0x3ba9c5[_0x654c('0x21')]){_0x302950[_0x654c('0x22')]=_0x3ba9c5[_0x654c('0x21')];logger['info'](util['format'](_0x654c('0x25'),_0x302950['name'],_0x302950['id']));}else{logger['error'](util[_0x654c('0x24')](_0x654c('0x28'),_0x302950['name'],_0x302950['id']),util[_0x654c('0x29')](_0x3ba9c5,{'showHidden':![],'depth':null}));}return _0x34c683(null,_0x34048d);})[_0x654c('0x2a')](function(_0x40b548){logger[_0x654c('0x27')](util[_0x654c('0x24')](_0x654c('0x28'),_0x302950[_0x654c('0x26')],_0x302950['id']),util[_0x654c('0x29')](parsedResult,{'showHidden':![],'depth':null}));return _0x34c683(_0x40b548);});}else{return _0x34c683(null,_0x34048d);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 7d01fa4..abec5ab 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 _0xc74c=['catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','attributes','include','map','model','debug','find','then','ShowZohoAccount','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xc74c,0x163));var _0xcc74=function(_0xf98b63,_0x338484){_0xf98b63=_0xf98b63-0x0;var _0x390363=_0xc74c[_0xf98b63];return _0x390363;};'use strict';var _=require(_0xcc74('0x0'));var util=require(_0xcc74('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcc74('0x2'));var fs=require('fs');var Redis=require(_0xcc74('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcc74('0x4'));var logger=require(_0xcc74('0x5'))(_0xcc74('0x6'));var config=require(_0xcc74('0x7'));var jayson=require(_0xcc74('0x8'));var client=jayson[_0xcc74('0x9')][_0xcc74('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d46a6,_0x15248f,_0x86f429){return new BPromise(function(_0x1eb886,_0x473308){return client[_0xcc74('0xb')](_0x5d46a6,_0x86f429)['then'](function(_0x4b4534){logger[_0xcc74('0xc')](_0xcc74('0xd'),_0x15248f,_0xcc74('0xe'));logger['debug'](_0xcc74('0xf'),_0x15248f,_0xcc74('0xe'),JSON[_0xcc74('0x10')](_0x4b4534));if(_0x4b4534['error']){if(_0x4b4534[_0xcc74('0x11')]['code']===0x1f4){logger[_0xcc74('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x15248f,_0x4b4534['error']['message']);return _0x473308(_0x4b4534[_0xcc74('0x11')][_0xcc74('0x12')]);}logger[_0xcc74('0x11')](_0xcc74('0xd'),_0x15248f,_0x4b4534[_0xcc74('0x11')]['message']);return _0x1eb886(_0x4b4534[_0xcc74('0x11')][_0xcc74('0x12')]);}else{logger[_0xcc74('0xc')](_0xcc74('0xd'),_0x15248f,_0xcc74('0xe'));_0x1eb886(_0x4b4534['result'][_0xcc74('0x12')]);}})[_0xcc74('0x13')](function(_0xe44014){logger[_0xcc74('0x11')](_0xcc74('0xd'),_0x15248f,_0xe44014);_0x473308(_0xe44014);});});}exports[_0xcc74('0x14')]=function(_0x170583){var _0x45d9bd=this;return new Promise(function(_0x30101f,_0x5a18b3){return db[_0xcc74('0x15')][_0xcc74('0x16')]({'raw':_0x170583[_0xcc74('0x17')]?_0x170583[_0xcc74('0x17')][_0xcc74('0x18')]===undefined?!![]:![]:!![],'where':_0x170583[_0xcc74('0x17')]?_0x170583['options'][_0xcc74('0x19')]||null:null,'attributes':_0x170583[_0xcc74('0x17')]?_0x170583['options'][_0xcc74('0x1a')]||null:null,'limit':_0x170583[_0xcc74('0x17')]?_0x170583[_0xcc74('0x17')]['limit']||null:null,'include':_0x170583[_0xcc74('0x17')]?_0x170583[_0xcc74('0x17')][_0xcc74('0x1b')]?_[_0xcc74('0x1c')](_0x170583['options'][_0xcc74('0x1b')],function(_0x11811d){return{'model':db[_0x11811d[_0xcc74('0x1d')]],'as':_0x11811d['as'],'attributes':_0x11811d['attributes'],'include':_0x11811d[_0xcc74('0x1b')]?_[_0xcc74('0x1c')](_0x11811d[_0xcc74('0x1b')],function(_0x5a9fa6){return{'model':db[_0x5a9fa6['model']],'as':_0x5a9fa6['as'],'attributes':_0x5a9fa6['attributes'],'include':_0x5a9fa6[_0xcc74('0x1b')]?_[_0xcc74('0x1c')](_0x5a9fa6[_0xcc74('0x1b')],function(_0x311cc2){return{'model':db[_0x311cc2[_0xcc74('0x1d')]],'as':_0x311cc2['as'],'attributes':_0x311cc2[_0xcc74('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x393e56){logger[_0xcc74('0xc')](_0xcc74('0x14'),_0x170583);logger[_0xcc74('0x1e')]('GetZohoAccount',_0x170583,JSON[_0xcc74('0x10')](_0x393e56));_0x30101f(_0x393e56);})[_0xcc74('0x13')](function(_0x46e47f){logger[_0xcc74('0x11')](_0xcc74('0x14'),_0x46e47f[_0xcc74('0x12')],_0x170583);_0x5a18b3(_0x45d9bd['error'](0x1f4,_0x46e47f[_0xcc74('0x12')]));});});};exports['ShowZohoAccount']=function(_0x3faeab){var _0x380134=this;return new Promise(function(_0x424718,_0x43513b){return db[_0xcc74('0x15')][_0xcc74('0x1f')]({'raw':_0x3faeab['options']?_0x3faeab['options'][_0xcc74('0x18')]===undefined?!![]:![]:!![],'where':_0x3faeab[_0xcc74('0x17')]?_0x3faeab[_0xcc74('0x17')]['where']||null:null,'attributes':_0x3faeab[_0xcc74('0x17')]?_0x3faeab[_0xcc74('0x17')]['attributes']||null:null,'include':_0x3faeab['options']?_0x3faeab[_0xcc74('0x17')][_0xcc74('0x1b')]?_['map'](_0x3faeab[_0xcc74('0x17')][_0xcc74('0x1b')],function(_0x1a8b20){return{'model':db[_0x1a8b20[_0xcc74('0x1d')]],'as':_0x1a8b20['as'],'attributes':_0x1a8b20[_0xcc74('0x1a')],'include':_0x1a8b20[_0xcc74('0x1b')]?_['map'](_0x1a8b20[_0xcc74('0x1b')],function(_0x2a4634){return{'model':db[_0x2a4634[_0xcc74('0x1d')]],'as':_0x2a4634['as'],'attributes':_0x2a4634[_0xcc74('0x1a')],'include':_0x2a4634[_0xcc74('0x1b')]?_[_0xcc74('0x1c')](_0x2a4634[_0xcc74('0x1b')],function(_0x5a361f){return{'model':db[_0x5a361f[_0xcc74('0x1d')]],'as':_0x5a361f['as'],'attributes':_0x5a361f['attributes']};}):[]};}):[]};}):[]:[]})[_0xcc74('0x20')](function(_0xe7c08b){logger[_0xcc74('0xc')](_0xcc74('0x21'),_0x3faeab);logger[_0xcc74('0x1e')](_0xcc74('0x21'),_0x3faeab,JSON[_0xcc74('0x10')](_0xe7c08b));_0x424718(_0xe7c08b);})[_0xcc74('0x13')](function(_0x11d7d7){logger[_0xcc74('0x11')](_0xcc74('0x21'),_0x11d7d7[_0xcc74('0x12')],_0x3faeab);_0x43513b(_0x380134['error'](0x1f4,_0x11d7d7[_0xcc74('0x12')]));});});}; \ No newline at end of file +var _0x1893=['request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','GetZohoAccount','ZohoAccount','findAll','options','raw','where','attributes','include','map','model','catch','ShowZohoAccount','find','then','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','ZohoAccount,\x20%s,\x20%s'];(function(_0x334e9e,_0x5bd708){var _0x438f6f=function(_0x689211){while(--_0x689211){_0x334e9e['push'](_0x334e9e['shift']());}};_0x438f6f(++_0x5bd708);}(_0x1893,0xa2));var _0x3189=function(_0x543242,_0xeac9fd){_0x543242=_0x543242-0x0;var _0x4c99b6=_0x1893[_0x543242];return _0x4c99b6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3189('0x0'));var BPromise=require(_0x3189('0x1'));var rs=require(_0x3189('0x2'));var fs=require('fs');var Redis=require(_0x3189('0x3'));var db=require(_0x3189('0x4'))['db'];var utils=require(_0x3189('0x5'));var logger=require(_0x3189('0x6'))('rpc');var config=require(_0x3189('0x7'));var jayson=require(_0x3189('0x8'));var client=jayson[_0x3189('0x9')][_0x3189('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x77c566,_0x118970,_0x14d84b){return new BPromise(function(_0x1f6764,_0x5312a3){return client[_0x3189('0xb')](_0x77c566,_0x14d84b)['then'](function(_0x127449){logger['info'](_0x3189('0xc'),_0x118970,_0x3189('0xd'));logger[_0x3189('0xe')](_0x3189('0xf'),_0x118970,'request\x20sent',JSON[_0x3189('0x10')](_0x127449));if(_0x127449[_0x3189('0x11')]){if(_0x127449[_0x3189('0x11')][_0x3189('0x12')]===0x1f4){logger[_0x3189('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x118970,_0x127449[_0x3189('0x11')][_0x3189('0x13')]);return _0x5312a3(_0x127449[_0x3189('0x11')][_0x3189('0x13')]);}logger[_0x3189('0x11')](_0x3189('0xc'),_0x118970,_0x127449[_0x3189('0x11')][_0x3189('0x13')]);return _0x1f6764(_0x127449['error'][_0x3189('0x13')]);}else{logger[_0x3189('0x14')](_0x3189('0xc'),_0x118970,_0x3189('0xd'));_0x1f6764(_0x127449['result'][_0x3189('0x13')]);}})['catch'](function(_0x55f432){logger[_0x3189('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x118970,_0x55f432);_0x5312a3(_0x55f432);});});}exports[_0x3189('0x15')]=function(_0xf8aed7){var _0x22c7ba=this;return new Promise(function(_0x9905c4,_0x4c4d9b){return db[_0x3189('0x16')][_0x3189('0x17')]({'raw':_0xf8aed7[_0x3189('0x18')]?_0xf8aed7['options'][_0x3189('0x19')]===undefined?!![]:![]:!![],'where':_0xf8aed7[_0x3189('0x18')]?_0xf8aed7[_0x3189('0x18')][_0x3189('0x1a')]||null:null,'attributes':_0xf8aed7[_0x3189('0x18')]?_0xf8aed7['options'][_0x3189('0x1b')]||null:null,'limit':_0xf8aed7[_0x3189('0x18')]?_0xf8aed7[_0x3189('0x18')]['limit']||null:null,'include':_0xf8aed7[_0x3189('0x18')]?_0xf8aed7['options'][_0x3189('0x1c')]?_[_0x3189('0x1d')](_0xf8aed7[_0x3189('0x18')][_0x3189('0x1c')],function(_0x1cbe33){return{'model':db[_0x1cbe33[_0x3189('0x1e')]],'as':_0x1cbe33['as'],'attributes':_0x1cbe33['attributes'],'include':_0x1cbe33['include']?_[_0x3189('0x1d')](_0x1cbe33[_0x3189('0x1c')],function(_0x1dc1c8){return{'model':db[_0x1dc1c8[_0x3189('0x1e')]],'as':_0x1dc1c8['as'],'attributes':_0x1dc1c8[_0x3189('0x1b')],'include':_0x1dc1c8[_0x3189('0x1c')]?_[_0x3189('0x1d')](_0x1dc1c8[_0x3189('0x1c')],function(_0x17b540){return{'model':db[_0x17b540[_0x3189('0x1e')]],'as':_0x17b540['as'],'attributes':_0x17b540['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5aa34a){logger[_0x3189('0x14')](_0x3189('0x15'),_0xf8aed7);logger[_0x3189('0xe')](_0x3189('0x15'),_0xf8aed7,JSON[_0x3189('0x10')](_0x5aa34a));_0x9905c4(_0x5aa34a);})[_0x3189('0x1f')](function(_0x4d453a){logger[_0x3189('0x11')](_0x3189('0x15'),_0x4d453a['message'],_0xf8aed7);_0x4c4d9b(_0x22c7ba[_0x3189('0x11')](0x1f4,_0x4d453a[_0x3189('0x13')]));});});};exports[_0x3189('0x20')]=function(_0x5c7a36){var _0x168dc2=this;return new Promise(function(_0x32bba1,_0x23798e){return db['ZohoAccount'][_0x3189('0x21')]({'raw':_0x5c7a36[_0x3189('0x18')]?_0x5c7a36['options'][_0x3189('0x19')]===undefined?!![]:![]:!![],'where':_0x5c7a36[_0x3189('0x18')]?_0x5c7a36[_0x3189('0x18')][_0x3189('0x1a')]||null:null,'attributes':_0x5c7a36[_0x3189('0x18')]?_0x5c7a36['options']['attributes']||null:null,'include':_0x5c7a36[_0x3189('0x18')]?_0x5c7a36['options'][_0x3189('0x1c')]?_[_0x3189('0x1d')](_0x5c7a36[_0x3189('0x18')][_0x3189('0x1c')],function(_0x231d72){return{'model':db[_0x231d72[_0x3189('0x1e')]],'as':_0x231d72['as'],'attributes':_0x231d72[_0x3189('0x1b')],'include':_0x231d72[_0x3189('0x1c')]?_[_0x3189('0x1d')](_0x231d72['include'],function(_0x453e4b){return{'model':db[_0x453e4b[_0x3189('0x1e')]],'as':_0x453e4b['as'],'attributes':_0x453e4b[_0x3189('0x1b')],'include':_0x453e4b[_0x3189('0x1c')]?_[_0x3189('0x1d')](_0x453e4b[_0x3189('0x1c')],function(_0xd1ee0){return{'model':db[_0xd1ee0['model']],'as':_0xd1ee0['as'],'attributes':_0xd1ee0['attributes']};}):[]};}):[]};}):[]:[]})[_0x3189('0x22')](function(_0x580064){logger[_0x3189('0x14')](_0x3189('0x20'),_0x5c7a36);logger['debug'](_0x3189('0x20'),_0x5c7a36,JSON[_0x3189('0x10')](_0x580064));_0x32bba1(_0x580064);})[_0x3189('0x1f')](function(_0x254135){logger['error'](_0x3189('0x20'),_0x254135['message'],_0x5c7a36);_0x23798e(_0x168dc2['error'](0x1f4,_0x254135[_0x3189('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 7583f72..1ddc343 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 _0xaf84=['Router','fs-extra','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','isAuthenticated','index','/:id','get','/:id/fields','getFields','/:id/subjects','getDescriptions','create','put','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x575479,_0x515c31){var _0x367a3f=function(_0x3eccc1){while(--_0x3eccc1){_0x575479['push'](_0x575479['shift']());}};_0x367a3f(++_0x515c31);}(_0xaf84,0x172));var _0x4af8=function(_0x1d87fc,_0x1e5321){_0x1d87fc=_0x1d87fc-0x0;var _0x492b56=_0xaf84[_0x1d87fc];return _0x492b56;};'use strict';var multer=require(_0x4af8('0x0'));var util=require(_0x4af8('0x1'));var path=require(_0x4af8('0x2'));var timeout=require(_0x4af8('0x3'));var express=require('express');var router=express[_0x4af8('0x4')]();var fs_extra=require(_0x4af8('0x5'));var auth=require(_0x4af8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4af8('0x7'));var controller=require(_0x4af8('0x8'));router['get']('/',auth[_0x4af8('0x9')](),controller[_0x4af8('0xa')]);router['get'](_0x4af8('0xb'),auth[_0x4af8('0x9')](),controller['show']);router[_0x4af8('0xc')](_0x4af8('0xd'),auth['isAuthenticated'](),controller[_0x4af8('0xe')]);router[_0x4af8('0xc')](_0x4af8('0xf'),auth[_0x4af8('0x9')](),controller['getSubjects']);router[_0x4af8('0xc')]('/:id/descriptions',auth[_0x4af8('0x9')](),controller[_0x4af8('0x10')]);router['post']('/',auth[_0x4af8('0x9')](),controller[_0x4af8('0x11')]);router[_0x4af8('0x12')](_0x4af8('0xb'),auth['isAuthenticated'](),controller[_0x4af8('0x13')]);router[_0x4af8('0x14')](_0x4af8('0xb'),auth['isAuthenticated'](),controller[_0x4af8('0x15')]);module['exports']=router; \ No newline at end of file +var _0x5e2f=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','delete','destroy','util','path','fs-extra'];(function(_0x3ab353,_0x5d5283){var _0x1e2285=function(_0x55804f){while(--_0x55804f){_0x3ab353['push'](_0x3ab353['shift']());}};_0x1e2285(++_0x5d5283);}(_0x5e2f,0x87));var _0xf5e2=function(_0x1e1cce,_0x2a1a05){_0x1e1cce=_0x1e1cce-0x0;var _0x1ba156=_0x5e2f[_0x1e1cce];return _0x1ba156;};'use strict';var multer=require('multer');var util=require(_0xf5e2('0x0'));var path=require(_0xf5e2('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xf5e2('0x2'));var auth=require(_0xf5e2('0x3'));var interaction=require(_0xf5e2('0x4'));var config=require(_0xf5e2('0x5'));var controller=require(_0xf5e2('0x6'));router[_0xf5e2('0x7')]('/',auth[_0xf5e2('0x8')](),controller[_0xf5e2('0x9')]);router['get'](_0xf5e2('0xa'),auth[_0xf5e2('0x8')](),controller[_0xf5e2('0xb')]);router['get'](_0xf5e2('0xc'),auth[_0xf5e2('0x8')](),controller[_0xf5e2('0xd')]);router[_0xf5e2('0x7')](_0xf5e2('0xe'),auth[_0xf5e2('0x8')](),controller[_0xf5e2('0xf')]);router[_0xf5e2('0x7')](_0xf5e2('0x10'),auth['isAuthenticated'](),controller[_0xf5e2('0x11')]);router[_0xf5e2('0x12')]('/',auth[_0xf5e2('0x8')](),controller[_0xf5e2('0x13')]);router[_0xf5e2('0x14')](_0xf5e2('0xa'),auth[_0xf5e2('0x8')](),controller['update']);router[_0xf5e2('0x15')](_0xf5e2('0xa'),auth[_0xf5e2('0x8')](),controller[_0xf5e2('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 2291130..ebaf609 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 _0x045a=['STRING','sequelize','exports','ENUM','lead','contact','nothing','contact_lead'];(function(_0x3dfdd2,_0x51e9d2){var _0x5675b9=function(_0x38e1e8){while(--_0x38e1e8){_0x3dfdd2['push'](_0x3dfdd2['shift']());}};_0x5675b9(++_0x51e9d2);}(_0x045a,0xf1));var _0xa045=function(_0x1b9c91,_0x25d623){_0x1b9c91=_0x1b9c91-0x0;var _0x36ac06=_0x045a[_0x1b9c91];return _0x36ac06;};'use strict';var Sequelize=require(_0xa045('0x0'));module[_0xa045('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0xa045('0x2')](_0xa045('0x3'),_0xa045('0x4'),_0xa045('0x5')),'defaultValue':_0xa045('0x3')},'moduleSearch':{'type':Sequelize[_0xa045('0x2')](_0xa045('0x6'),_0xa045('0x4'),_0xa045('0x3')),'defaultValue':_0xa045('0x6')},'description':{'type':Sequelize[_0xa045('0x7')]}}; \ No newline at end of file +var _0xc9b4=['ENUM','contact_lead','sequelize','exports','STRING','lead','contact','nothing'];(function(_0x3a7972,_0x1e848f){var _0x34fcac=function(_0x185580){while(--_0x185580){_0x3a7972['push'](_0x3a7972['shift']());}};_0x34fcac(++_0x1e848f);}(_0xc9b4,0xa2));var _0x4c9b=function(_0x12a2a6,_0x374ff1){_0x12a2a6=_0x12a2a6-0x0;var _0x1754ae=_0xc9b4[_0x12a2a6];return _0x1754ae;};'use strict';var Sequelize=require(_0x4c9b('0x0'));module[_0x4c9b('0x1')]={'name':{'type':Sequelize[_0x4c9b('0x2')]},'moduleCreate':{'type':Sequelize['ENUM'](_0x4c9b('0x3'),_0x4c9b('0x4'),_0x4c9b('0x5')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0x4c9b('0x6')](_0x4c9b('0x7'),_0x4c9b('0x4'),_0x4c9b('0x3')),'defaultValue':_0x4c9b('0x7')},'description':{'type':Sequelize[_0x4c9b('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 5667519..aba57c8 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 _0x7e82=['count','set','Content-Range','apply','reject','update','end','sendStatus','error','name','index','map','ZohoConfiguration','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','order','sort','where','pick','filter','type','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','length','merge','find','create','body','destroy','getFields','findOne','hasOwnProperty','getSubjects','ZohoField','nolimit','getDescriptions','rimraf','zip-dir','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','status','json','offset','undefined','limit'];(function(_0x3b9859,_0x52b534){var _0x3bc080=function(_0x5c4e2e){while(--_0x5c4e2e){_0x3b9859['push'](_0x3b9859['shift']());}};_0x3bc080(++_0x52b534);}(_0x7e82,0x11a));var _0x27e8=function(_0x5b00b0,_0x486fa3){_0x5b00b0=_0x5b00b0-0x0;var _0x4f7c9c=_0x7e82[_0x5b00b0];return _0x4f7c9c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x27e8('0x0'));var zipdir=require(_0x27e8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x27e8('0x2'));var moment=require(_0x27e8('0x3'));var BPromise=require(_0x27e8('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x27e8('0x5'));var csv=require(_0x27e8('0x6'));var ejs=require(_0x27e8('0x7'));var fs=require('fs');var fs_extra=require(_0x27e8('0x8'));var _=require(_0x27e8('0x9'));var squel=require('squel');var crypto=require(_0x27e8('0xa'));var jsforce=require(_0x27e8('0xb'));var deskjs=require(_0x27e8('0xc'));var toCsv=require(_0x27e8('0x6'));var querystring=require(_0x27e8('0xd'));var Papa=require('papaparse');var Redis=require(_0x27e8('0xe'));var authService=require(_0x27e8('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x27e8('0x10'));var hardwareService=require(_0x27e8('0x11'));var logger=require('../../config/logger')(_0x27e8('0x12'));var utils=require(_0x27e8('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x27e8('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d690a,_0x45db1e){_0x45db1e=_0x45db1e||0xcc;return function(_0x57032d){if(_0x57032d){return _0x2d690a['sendStatus'](_0x45db1e);}return _0x2d690a[_0x27e8('0x15')](_0x45db1e)['end']();};}function respondWithResult(_0x52a4da,_0x1fcb60){_0x1fcb60=_0x1fcb60||0xc8;return function(_0x4ba54e){if(_0x4ba54e){return _0x52a4da[_0x27e8('0x15')](_0x1fcb60)[_0x27e8('0x16')](_0x4ba54e);}};}function respondWithFilteredResult(_0x1f18bf,_0x419343){return function(_0x4df4f2){if(_0x4df4f2){var _0x165f4e=typeof _0x419343[_0x27e8('0x17')]===_0x27e8('0x18')&&typeof _0x419343[_0x27e8('0x19')]===_0x27e8('0x18');var _0x4e6e77=_0x4df4f2['count'];var _0x50738d=_0x165f4e?0x0:_0x419343['offset'];var _0x358e05=_0x165f4e?_0x4df4f2[_0x27e8('0x1a')]:_0x419343[_0x27e8('0x17')]+_0x419343[_0x27e8('0x19')];var _0x484637;if(_0x358e05>=_0x4e6e77){_0x358e05=_0x4e6e77;_0x484637=0xc8;}else{_0x484637=0xce;}_0x1f18bf[_0x27e8('0x15')](_0x484637);return _0x1f18bf[_0x27e8('0x1b')](_0x27e8('0x1c'),_0x50738d+'-'+_0x358e05+'/'+_0x4e6e77)[_0x27e8('0x16')](_0x4df4f2);}return null;};}function patchUpdates(_0x311ce4){return function(_0x5e8fc1){try{jsonpatch[_0x27e8('0x1d')](_0x5e8fc1,_0x311ce4,!![]);}catch(_0x33f20c){return BPromise[_0x27e8('0x1e')](_0x33f20c);}return _0x5e8fc1['save']();};}function saveUpdates(_0x4542c7,_0x2c28e7){return function(_0x49a8cc){if(_0x49a8cc){return _0x49a8cc[_0x27e8('0x1f')](_0x4542c7)['then'](function(_0x2cda69){return _0x2cda69;});}return null;};}function removeEntity(_0x393d5c,_0x538552){return function(_0x189d83){if(_0x189d83){return _0x189d83['destroy']()['then'](function(){_0x393d5c[_0x27e8('0x15')](0xcc)[_0x27e8('0x20')]();});}};}function handleEntityNotFound(_0x4ee8d3,_0x7e44d7){return function(_0x25b1ff){if(!_0x25b1ff){_0x4ee8d3[_0x27e8('0x21')](0x194);}return _0x25b1ff;};}function handleError(_0x2b64d2,_0x4d9c1a){_0x4d9c1a=_0x4d9c1a||0x1f4;return function(_0x295210){logger[_0x27e8('0x22')](_0x295210['stack']);if(_0x295210[_0x27e8('0x23')]){delete _0x295210['name'];}_0x2b64d2[_0x27e8('0x15')](_0x4d9c1a)['send'](_0x295210);};}exports[_0x27e8('0x24')]=function(_0xc9593f,_0x431105){var _0x3a1327={},_0x1e7ccf={},_0x5b01d5={'count':0x0,'rows':[]};var _0x5088be=_[_0x27e8('0x25')](db[_0x27e8('0x26')][_0x27e8('0x27')],function(_0x199ce9){return{'name':_0x199ce9[_0x27e8('0x28')],'type':_0x199ce9['type']['key']};});_0x1e7ccf[_0x27e8('0x29')]=_[_0x27e8('0x25')](_0x5088be,_0x27e8('0x23'));_0x1e7ccf[_0x27e8('0x2a')]=_[_0x27e8('0x2b')](_0xc9593f[_0x27e8('0x2a')]);_0x1e7ccf[_0x27e8('0x2c')]=_[_0x27e8('0x2d')](_0x1e7ccf[_0x27e8('0x29')],_0x1e7ccf[_0x27e8('0x2a')]);_0x3a1327[_0x27e8('0x2e')]=_[_0x27e8('0x2d')](_0x1e7ccf[_0x27e8('0x29')],qs[_0x27e8('0x2f')](_0xc9593f[_0x27e8('0x2a')]['fields']));_0x3a1327[_0x27e8('0x2e')]=_0x3a1327[_0x27e8('0x2e')]['length']?_0x3a1327[_0x27e8('0x2e')]:_0x1e7ccf[_0x27e8('0x29')];if(!_0xc9593f['query']['hasOwnProperty']('nolimit')){_0x3a1327['limit']=qs[_0x27e8('0x19')](_0xc9593f[_0x27e8('0x2a')][_0x27e8('0x19')]);_0x3a1327[_0x27e8('0x17')]=qs[_0x27e8('0x17')](_0xc9593f[_0x27e8('0x2a')][_0x27e8('0x17')]);}_0x3a1327[_0x27e8('0x30')]=qs[_0x27e8('0x31')](_0xc9593f['query'][_0x27e8('0x31')]);_0x3a1327[_0x27e8('0x32')]=qs[_0x27e8('0x2c')](_[_0x27e8('0x33')](_0xc9593f[_0x27e8('0x2a')],_0x1e7ccf[_0x27e8('0x2c')]),_0x5088be);if(_0xc9593f[_0x27e8('0x2a')][_0x27e8('0x34')]){_0x3a1327[_0x27e8('0x32')]=_['merge'](_0x3a1327[_0x27e8('0x32')],{'$or':_[_0x27e8('0x25')](_0x5088be,function(_0x4003d8){if(_0x4003d8[_0x27e8('0x35')]!==_0x27e8('0x36')){var _0x410992={};_0x410992[_0x4003d8['name']]={'$like':'%'+_0xc9593f[_0x27e8('0x2a')][_0x27e8('0x34')]+'%'};return _0x410992;}})});}_0x3a1327=_['merge']({},_0x3a1327,_0xc9593f[_0x27e8('0x37')]);var _0x3868ab={'where':_0x3a1327[_0x27e8('0x32')]};return db[_0x27e8('0x26')][_0x27e8('0x1a')](_0x3868ab)[_0x27e8('0x38')](function(_0x415ae9){_0x5b01d5['count']=_0x415ae9;if(_0xc9593f['query'][_0x27e8('0x39')]){_0x3a1327[_0x27e8('0x3a')]=[{'all':!![]}];}return db[_0x27e8('0x26')][_0x27e8('0x3b')](_0x3a1327);})[_0x27e8('0x38')](function(_0x5c91cd){_0x5b01d5[_0x27e8('0x3c')]=_0x5c91cd;return _0x5b01d5;})[_0x27e8('0x38')](respondWithFilteredResult(_0x431105,_0x3a1327))[_0x27e8('0x3d')](handleError(_0x431105,null));};exports[_0x27e8('0x3e')]=function(_0x2d0efa,_0x1d2a85){var _0x2658b5={'raw':![],'where':{'id':_0x2d0efa[_0x27e8('0x3f')]['id']}},_0x5953c5={};_0x5953c5[_0x27e8('0x29')]=_['keys'](db['ZohoConfiguration'][_0x27e8('0x27')]);_0x5953c5[_0x27e8('0x2a')]=_['keys'](_0x2d0efa[_0x27e8('0x2a')]);_0x5953c5[_0x27e8('0x2c')]=_['intersection'](_0x5953c5['model'],_0x5953c5[_0x27e8('0x2a')]);_0x2658b5['attributes']=_[_0x27e8('0x2d')](_0x5953c5['model'],qs[_0x27e8('0x2f')](_0x2d0efa['query'][_0x27e8('0x2f')]));_0x2658b5[_0x27e8('0x2e')]=_0x2658b5[_0x27e8('0x2e')][_0x27e8('0x40')]?_0x2658b5[_0x27e8('0x2e')]:_0x5953c5[_0x27e8('0x29')];if(_0x2d0efa[_0x27e8('0x2a')][_0x27e8('0x39')]){_0x2658b5[_0x27e8('0x3a')]=[{'all':!![]}];}_0x2658b5=_[_0x27e8('0x41')]({},_0x2658b5,_0x2d0efa[_0x27e8('0x37')]);return db[_0x27e8('0x26')][_0x27e8('0x42')](_0x2658b5)[_0x27e8('0x38')](handleEntityNotFound(_0x1d2a85,null))[_0x27e8('0x38')](respondWithResult(_0x1d2a85,null))[_0x27e8('0x3d')](handleError(_0x1d2a85,null));};exports[_0x27e8('0x43')]=function(_0x5ec857,_0x29fc41){return db['ZohoConfiguration'][_0x27e8('0x43')](_0x5ec857[_0x27e8('0x44')],{})[_0x27e8('0x38')](respondWithResult(_0x29fc41,0xc9))[_0x27e8('0x3d')](handleError(_0x29fc41,null));};exports[_0x27e8('0x1f')]=function(_0x468c52,_0x3b75e1){if(_0x468c52['body']['id']){delete _0x468c52[_0x27e8('0x44')]['id'];}return db['ZohoConfiguration'][_0x27e8('0x42')]({'where':{'id':_0x468c52[_0x27e8('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3b75e1,null))['then'](saveUpdates(_0x468c52[_0x27e8('0x44')],null))[_0x27e8('0x38')](respondWithResult(_0x3b75e1,null))[_0x27e8('0x3d')](handleError(_0x3b75e1,null));};exports[_0x27e8('0x45')]=function(_0x15a973,_0x51cade){return db['ZohoConfiguration'][_0x27e8('0x42')]({'where':{'id':_0x15a973[_0x27e8('0x3f')]['id']}})['then'](handleEntityNotFound(_0x51cade,null))[_0x27e8('0x38')](removeEntity(_0x51cade,null))['catch'](handleError(_0x51cade,null));};exports[_0x27e8('0x46')]=function(_0x456494,_0x25f6ed,_0x5b1b25){var _0x3678ab={};var _0x2e4135={};var _0xe89622;var _0x486b87;return db['ZohoConfiguration'][_0x27e8('0x47')]({'where':{'id':_0x456494['params']['id']}})['then'](handleEntityNotFound(_0x25f6ed,null))[_0x27e8('0x38')](function(_0x3d149b){if(_0x3d149b){_0xe89622=_0x3d149b;_0x2e4135[_0x27e8('0x29')]=_[_0x27e8('0x2b')](db['ZohoField'][_0x27e8('0x27')]);_0x2e4135[_0x27e8('0x2a')]=_[_0x27e8('0x2b')](_0x456494[_0x27e8('0x2a')]);_0x2e4135[_0x27e8('0x2c')]=_[_0x27e8('0x2d')](_0x2e4135[_0x27e8('0x29')],_0x2e4135[_0x27e8('0x2a')]);_0x3678ab['attributes']=_[_0x27e8('0x2d')](_0x2e4135[_0x27e8('0x29')],qs[_0x27e8('0x2f')](_0x456494[_0x27e8('0x2a')][_0x27e8('0x2f')]));_0x3678ab['attributes']=_0x3678ab[_0x27e8('0x2e')][_0x27e8('0x40')]?_0x3678ab[_0x27e8('0x2e')]:_0x2e4135[_0x27e8('0x29')];_0x3678ab['order']=qs['sort'](_0x456494[_0x27e8('0x2a')][_0x27e8('0x31')]);_0x3678ab[_0x27e8('0x32')]=qs[_0x27e8('0x2c')](_['pick'](_0x456494[_0x27e8('0x2a')],_0x2e4135[_0x27e8('0x2c')]));if(_0x456494[_0x27e8('0x2a')][_0x27e8('0x34')]){_0x3678ab[_0x27e8('0x32')]=_[_0x27e8('0x41')](_0x3678ab[_0x27e8('0x32')],{'$or':_[_0x27e8('0x25')](_0x3678ab[_0x27e8('0x2e')],function(_0x540d61){var _0x2c2000={};_0x2c2000[_0x540d61]={'$like':'%'+_0x456494[_0x27e8('0x2a')]['filter']+'%'};return _0x2c2000;})});}_0x3678ab=_[_0x27e8('0x41')]({},_0x3678ab,_0x456494['options']);return _0xe89622[_0x27e8('0x46')](_0x3678ab);}})[_0x27e8('0x38')](function(_0x39f0db){if(_0x39f0db){_0x486b87=_0x39f0db[_0x27e8('0x40')];if(!_0x456494['query'][_0x27e8('0x48')]('nolimit')){_0x3678ab['limit']=qs[_0x27e8('0x19')](_0x456494['query'][_0x27e8('0x19')]);_0x3678ab[_0x27e8('0x17')]=qs[_0x27e8('0x17')](_0x456494[_0x27e8('0x2a')][_0x27e8('0x17')]);}return _0xe89622[_0x27e8('0x46')](_0x3678ab);}})[_0x27e8('0x38')](function(_0x187d86){if(_0x187d86){return _0x187d86?{'count':_0x486b87,'rows':_0x187d86}:null;}})[_0x27e8('0x38')](respondWithResult(_0x25f6ed,null))[_0x27e8('0x3d')](handleError(_0x25f6ed,null));};exports[_0x27e8('0x49')]=function(_0x5db548,_0x35a488,_0xb2ddb7){var _0x51c516={};var _0xbc419e={};var _0x546f6d;var _0xddc2dd;return db[_0x27e8('0x26')]['findOne']({'where':{'id':_0x5db548[_0x27e8('0x3f')]['id']}})[_0x27e8('0x38')](handleEntityNotFound(_0x35a488,null))[_0x27e8('0x38')](function(_0x308138){if(_0x308138){_0x546f6d=_0x308138;_0xbc419e[_0x27e8('0x29')]=_[_0x27e8('0x2b')](db[_0x27e8('0x4a')]['rawAttributes']);_0xbc419e['query']=_[_0x27e8('0x2b')](_0x5db548[_0x27e8('0x2a')]);_0xbc419e[_0x27e8('0x2c')]=_['intersection'](_0xbc419e[_0x27e8('0x29')],_0xbc419e[_0x27e8('0x2a')]);_0x51c516[_0x27e8('0x2e')]=_[_0x27e8('0x2d')](_0xbc419e[_0x27e8('0x29')],qs['fields'](_0x5db548[_0x27e8('0x2a')][_0x27e8('0x2f')]));_0x51c516[_0x27e8('0x2e')]=_0x51c516[_0x27e8('0x2e')]['length']?_0x51c516[_0x27e8('0x2e')]:_0xbc419e['model'];_0x51c516[_0x27e8('0x30')]=qs[_0x27e8('0x31')](_0x5db548['query'][_0x27e8('0x31')]);_0x51c516['where']=qs['filters'](_[_0x27e8('0x33')](_0x5db548['query'],_0xbc419e[_0x27e8('0x2c')]));if(_0x5db548['query'][_0x27e8('0x34')]){_0x51c516[_0x27e8('0x32')]=_[_0x27e8('0x41')](_0x51c516[_0x27e8('0x32')],{'$or':_[_0x27e8('0x25')](_0x51c516['attributes'],function(_0xa6213){var _0x3cf3cb={};_0x3cf3cb[_0xa6213]={'$like':'%'+_0x5db548[_0x27e8('0x2a')][_0x27e8('0x34')]+'%'};return _0x3cf3cb;})});}_0x51c516=_['merge']({},_0x51c516,_0x5db548[_0x27e8('0x37')]);return _0x546f6d[_0x27e8('0x49')](_0x51c516);}})[_0x27e8('0x38')](function(_0x2cfc76){if(_0x2cfc76){_0xddc2dd=_0x2cfc76[_0x27e8('0x40')];if(!_0x5db548['query'][_0x27e8('0x48')](_0x27e8('0x4b'))){_0x51c516[_0x27e8('0x19')]=qs[_0x27e8('0x19')](_0x5db548[_0x27e8('0x2a')][_0x27e8('0x19')]);_0x51c516[_0x27e8('0x17')]=qs['offset'](_0x5db548[_0x27e8('0x2a')][_0x27e8('0x17')]);}return _0x546f6d[_0x27e8('0x49')](_0x51c516);}})[_0x27e8('0x38')](function(_0x113320){if(_0x113320){return _0x113320?{'count':_0xddc2dd,'rows':_0x113320}:null;}})[_0x27e8('0x38')](respondWithResult(_0x35a488,null))[_0x27e8('0x3d')](handleError(_0x35a488,null));};exports[_0x27e8('0x4c')]=function(_0x2effe4,_0x1cfd47,_0x9a552){var _0x22da8a={};var _0x52385f={};var _0x3e6a9e;var _0x49d2e6;return db[_0x27e8('0x26')][_0x27e8('0x47')]({'where':{'id':_0x2effe4[_0x27e8('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1cfd47,null))['then'](function(_0x14125e){if(_0x14125e){_0x3e6a9e=_0x14125e;_0x52385f[_0x27e8('0x29')]=_[_0x27e8('0x2b')](db['ZohoField'][_0x27e8('0x27')]);_0x52385f['query']=_[_0x27e8('0x2b')](_0x2effe4[_0x27e8('0x2a')]);_0x52385f[_0x27e8('0x2c')]=_[_0x27e8('0x2d')](_0x52385f['model'],_0x52385f[_0x27e8('0x2a')]);_0x22da8a[_0x27e8('0x2e')]=_['intersection'](_0x52385f['model'],qs[_0x27e8('0x2f')](_0x2effe4['query'][_0x27e8('0x2f')]));_0x22da8a[_0x27e8('0x2e')]=_0x22da8a[_0x27e8('0x2e')][_0x27e8('0x40')]?_0x22da8a[_0x27e8('0x2e')]:_0x52385f[_0x27e8('0x29')];_0x22da8a[_0x27e8('0x30')]=qs[_0x27e8('0x31')](_0x2effe4[_0x27e8('0x2a')][_0x27e8('0x31')]);_0x22da8a[_0x27e8('0x32')]=qs[_0x27e8('0x2c')](_[_0x27e8('0x33')](_0x2effe4[_0x27e8('0x2a')],_0x52385f[_0x27e8('0x2c')]));if(_0x2effe4[_0x27e8('0x2a')]['filter']){_0x22da8a[_0x27e8('0x32')]=_[_0x27e8('0x41')](_0x22da8a[_0x27e8('0x32')],{'$or':_['map'](_0x22da8a['attributes'],function(_0x256674){var _0x1ef232={};_0x1ef232[_0x256674]={'$like':'%'+_0x2effe4[_0x27e8('0x2a')][_0x27e8('0x34')]+'%'};return _0x1ef232;})});}_0x22da8a=_[_0x27e8('0x41')]({},_0x22da8a,_0x2effe4[_0x27e8('0x37')]);return _0x3e6a9e[_0x27e8('0x4c')](_0x22da8a);}})['then'](function(_0x33ec64){if(_0x33ec64){_0x49d2e6=_0x33ec64[_0x27e8('0x40')];if(!_0x2effe4[_0x27e8('0x2a')][_0x27e8('0x48')](_0x27e8('0x4b'))){_0x22da8a[_0x27e8('0x19')]=qs[_0x27e8('0x19')](_0x2effe4[_0x27e8('0x2a')][_0x27e8('0x19')]);_0x22da8a[_0x27e8('0x17')]=qs[_0x27e8('0x17')](_0x2effe4[_0x27e8('0x2a')][_0x27e8('0x17')]);}return _0x3e6a9e['getDescriptions'](_0x22da8a);}})[_0x27e8('0x38')](function(_0x4133a0){if(_0x4133a0){return _0x4133a0?{'count':_0x49d2e6,'rows':_0x4133a0}:null;}})[_0x27e8('0x38')](respondWithResult(_0x1cfd47,null))[_0x27e8('0x3d')](handleError(_0x1cfd47,null));}; \ No newline at end of file +var _0x6100=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','update','error','name','send','index','map','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','then','includeAll','ZohoConfiguration','findAll','catch','show','params','rawAttributes','find','create','body','destroy','getFields','findOne','ZohoField','options','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis'];(function(_0x2fcaa3,_0x2ba904){var _0x8f4089=function(_0x581a3b){while(--_0x581a3b){_0x2fcaa3['push'](_0x2fcaa3['shift']());}};_0x8f4089(++_0x2ba904);}(_0x6100,0x130));var _0x0610=function(_0x400504,_0x19f905){_0x400504=_0x400504-0x0;var _0x342b83=_0x6100[_0x400504];return _0x342b83;};'use strict';var emlformat=require(_0x0610('0x0'));var rimraf=require(_0x0610('0x1'));var zipdir=require(_0x0610('0x2'));var jsonpatch=require(_0x0610('0x3'));var rp=require(_0x0610('0x4'));var moment=require(_0x0610('0x5'));var BPromise=require(_0x0610('0x6'));var Mustache=require(_0x0610('0x7'));var util=require(_0x0610('0x8'));var path=require(_0x0610('0x9'));var sox=require(_0x0610('0xa'));var csv=require(_0x0610('0xb'));var ejs=require(_0x0610('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0610('0xd'));var squel=require(_0x0610('0xe'));var crypto=require(_0x0610('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x0610('0x10'));var toCsv=require(_0x0610('0xb'));var querystring=require(_0x0610('0x11'));var Papa=require(_0x0610('0x12'));var Redis=require(_0x0610('0x13'));var authService=require(_0x0610('0x14'));var qs=require(_0x0610('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0610('0x16'));var logger=require('../../config/logger')(_0x0610('0x17'));var utils=require(_0x0610('0x18'));var config=require(_0x0610('0x19'));var licenseUtil=require(_0x0610('0x1a'));var db=require(_0x0610('0x1b'))['db'];function respondWithStatusCode(_0x50e58c,_0x4d85c2){_0x4d85c2=_0x4d85c2||0xcc;return function(_0x5313a3){if(_0x5313a3){return _0x50e58c[_0x0610('0x1c')](_0x4d85c2);}return _0x50e58c[_0x0610('0x1d')](_0x4d85c2)[_0x0610('0x1e')]();};}function respondWithResult(_0x15eaa2,_0x44bbef){_0x44bbef=_0x44bbef||0xc8;return function(_0x339b48){if(_0x339b48){return _0x15eaa2[_0x0610('0x1d')](_0x44bbef)[_0x0610('0x1f')](_0x339b48);}};}function respondWithFilteredResult(_0x5166b5,_0x345d1b){return function(_0xc15010){if(_0xc15010){var _0x29408a=typeof _0x345d1b['offset']===_0x0610('0x20')&&typeof _0x345d1b[_0x0610('0x21')]===_0x0610('0x20');var _0x2c8249=_0xc15010[_0x0610('0x22')];var _0x4d7e3c=_0x29408a?0x0:_0x345d1b['offset'];var _0x2f93fd=_0x29408a?_0xc15010[_0x0610('0x22')]:_0x345d1b[_0x0610('0x23')]+_0x345d1b['limit'];var _0x21ec83;if(_0x2f93fd>=_0x2c8249){_0x2f93fd=_0x2c8249;_0x21ec83=0xc8;}else{_0x21ec83=0xce;}_0x5166b5['status'](_0x21ec83);return _0x5166b5[_0x0610('0x24')](_0x0610('0x25'),_0x4d7e3c+'-'+_0x2f93fd+'/'+_0x2c8249)[_0x0610('0x1f')](_0xc15010);}return null;};}function patchUpdates(_0x2a682c){return function(_0x2c22d7){try{jsonpatch[_0x0610('0x26')](_0x2c22d7,_0x2a682c,!![]);}catch(_0x333d95){return BPromise['reject'](_0x333d95);}return _0x2c22d7['save']();};}function saveUpdates(_0x25baa6,_0x45ec9){return function(_0x46ebc4){if(_0x46ebc4){return _0x46ebc4[_0x0610('0x27')](_0x25baa6)['then'](function(_0x56d827){return _0x56d827;});}return null;};}function removeEntity(_0x2ed480,_0x2d24bc){return function(_0x4ab0e8){if(_0x4ab0e8){return _0x4ab0e8['destroy']()['then'](function(){_0x2ed480[_0x0610('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x493657,_0x36d414){return function(_0x1ab317){if(!_0x1ab317){_0x493657[_0x0610('0x1c')](0x194);}return _0x1ab317;};}function handleError(_0x12d48d,_0x298f43){_0x298f43=_0x298f43||0x1f4;return function(_0x342156){logger[_0x0610('0x28')](_0x342156['stack']);if(_0x342156[_0x0610('0x29')]){delete _0x342156[_0x0610('0x29')];}_0x12d48d[_0x0610('0x1d')](_0x298f43)[_0x0610('0x2a')](_0x342156);};}exports[_0x0610('0x2b')]=function(_0x521cf2,_0x1b6f49){var _0xafa498={},_0x1531f3={},_0x3f3cb3={'count':0x0,'rows':[]};var _0x2722c9=_[_0x0610('0x2c')](db['ZohoConfiguration']['rawAttributes'],function(_0x545373){return{'name':_0x545373['fieldName'],'type':_0x545373['type']['key']};});_0x1531f3[_0x0610('0x2d')]=_[_0x0610('0x2c')](_0x2722c9,_0x0610('0x29'));_0x1531f3['query']=_[_0x0610('0x2e')](_0x521cf2[_0x0610('0x2f')]);_0x1531f3[_0x0610('0x30')]=_[_0x0610('0x31')](_0x1531f3[_0x0610('0x2d')],_0x1531f3[_0x0610('0x2f')]);_0xafa498[_0x0610('0x32')]=_[_0x0610('0x31')](_0x1531f3[_0x0610('0x2d')],qs[_0x0610('0x33')](_0x521cf2['query']['fields']));_0xafa498['attributes']=_0xafa498[_0x0610('0x32')][_0x0610('0x34')]?_0xafa498[_0x0610('0x32')]:_0x1531f3[_0x0610('0x2d')];if(!_0x521cf2[_0x0610('0x2f')][_0x0610('0x35')]('nolimit')){_0xafa498[_0x0610('0x21')]=qs[_0x0610('0x21')](_0x521cf2[_0x0610('0x2f')][_0x0610('0x21')]);_0xafa498['offset']=qs[_0x0610('0x23')](_0x521cf2['query']['offset']);}_0xafa498[_0x0610('0x36')]=qs[_0x0610('0x37')](_0x521cf2['query'][_0x0610('0x37')]);_0xafa498[_0x0610('0x38')]=qs[_0x0610('0x30')](_[_0x0610('0x39')](_0x521cf2[_0x0610('0x2f')],_0x1531f3[_0x0610('0x30')]),_0x2722c9);if(_0x521cf2[_0x0610('0x2f')][_0x0610('0x3a')]){_0xafa498[_0x0610('0x38')]=_[_0x0610('0x3b')](_0xafa498[_0x0610('0x38')],{'$or':_[_0x0610('0x2c')](_0x2722c9,function(_0x8f58cc){if(_0x8f58cc[_0x0610('0x3c')]!==_0x0610('0x3d')){var _0x5123f5={};_0x5123f5[_0x8f58cc[_0x0610('0x29')]]={'$like':'%'+_0x521cf2[_0x0610('0x2f')][_0x0610('0x3a')]+'%'};return _0x5123f5;}})});}_0xafa498=_[_0x0610('0x3b')]({},_0xafa498,_0x521cf2['options']);var _0x229e96={'where':_0xafa498[_0x0610('0x38')]};return db['ZohoConfiguration'][_0x0610('0x22')](_0x229e96)[_0x0610('0x3e')](function(_0x2d1e5d){_0x3f3cb3[_0x0610('0x22')]=_0x2d1e5d;if(_0x521cf2[_0x0610('0x2f')][_0x0610('0x3f')]){_0xafa498['include']=[{'all':!![]}];}return db[_0x0610('0x40')][_0x0610('0x41')](_0xafa498);})[_0x0610('0x3e')](function(_0x4cd9bc){_0x3f3cb3['rows']=_0x4cd9bc;return _0x3f3cb3;})[_0x0610('0x3e')](respondWithFilteredResult(_0x1b6f49,_0xafa498))[_0x0610('0x42')](handleError(_0x1b6f49,null));};exports[_0x0610('0x43')]=function(_0x156e6c,_0x1fffa8){var _0x56726e={'raw':![],'where':{'id':_0x156e6c[_0x0610('0x44')]['id']}},_0x1f3199={};_0x1f3199[_0x0610('0x2d')]=_[_0x0610('0x2e')](db[_0x0610('0x40')][_0x0610('0x45')]);_0x1f3199[_0x0610('0x2f')]=_['keys'](_0x156e6c[_0x0610('0x2f')]);_0x1f3199['filters']=_[_0x0610('0x31')](_0x1f3199[_0x0610('0x2d')],_0x1f3199[_0x0610('0x2f')]);_0x56726e['attributes']=_[_0x0610('0x31')](_0x1f3199[_0x0610('0x2d')],qs[_0x0610('0x33')](_0x156e6c[_0x0610('0x2f')][_0x0610('0x33')]));_0x56726e[_0x0610('0x32')]=_0x56726e[_0x0610('0x32')]['length']?_0x56726e['attributes']:_0x1f3199['model'];if(_0x156e6c['query'][_0x0610('0x3f')]){_0x56726e['include']=[{'all':!![]}];}_0x56726e=_[_0x0610('0x3b')]({},_0x56726e,_0x156e6c['options']);return db[_0x0610('0x40')][_0x0610('0x46')](_0x56726e)[_0x0610('0x3e')](handleEntityNotFound(_0x1fffa8,null))['then'](respondWithResult(_0x1fffa8,null))[_0x0610('0x42')](handleError(_0x1fffa8,null));};exports[_0x0610('0x47')]=function(_0x133bec,_0x17888a){return db[_0x0610('0x40')]['create'](_0x133bec['body'],{})[_0x0610('0x3e')](respondWithResult(_0x17888a,0xc9))['catch'](handleError(_0x17888a,null));};exports[_0x0610('0x27')]=function(_0x51ae78,_0x9739c4){if(_0x51ae78[_0x0610('0x48')]['id']){delete _0x51ae78['body']['id'];}return db[_0x0610('0x40')]['find']({'where':{'id':_0x51ae78['params']['id']}})[_0x0610('0x3e')](handleEntityNotFound(_0x9739c4,null))[_0x0610('0x3e')](saveUpdates(_0x51ae78[_0x0610('0x48')],null))[_0x0610('0x3e')](respondWithResult(_0x9739c4,null))[_0x0610('0x42')](handleError(_0x9739c4,null));};exports[_0x0610('0x49')]=function(_0x40b10b,_0x22b577){return db[_0x0610('0x40')][_0x0610('0x46')]({'where':{'id':_0x40b10b[_0x0610('0x44')]['id']}})['then'](handleEntityNotFound(_0x22b577,null))['then'](removeEntity(_0x22b577,null))['catch'](handleError(_0x22b577,null));};exports[_0x0610('0x4a')]=function(_0x1bda68,_0x430579,_0x3b742d){var _0x4e892f={};var _0x5b574f={};var _0x4a7255;var _0x1ae690;return db[_0x0610('0x40')][_0x0610('0x4b')]({'where':{'id':_0x1bda68[_0x0610('0x44')]['id']}})[_0x0610('0x3e')](handleEntityNotFound(_0x430579,null))['then'](function(_0xa3c8db){if(_0xa3c8db){_0x4a7255=_0xa3c8db;_0x5b574f[_0x0610('0x2d')]=_['keys'](db[_0x0610('0x4c')]['rawAttributes']);_0x5b574f['query']=_[_0x0610('0x2e')](_0x1bda68['query']);_0x5b574f[_0x0610('0x30')]=_['intersection'](_0x5b574f['model'],_0x5b574f[_0x0610('0x2f')]);_0x4e892f['attributes']=_[_0x0610('0x31')](_0x5b574f[_0x0610('0x2d')],qs[_0x0610('0x33')](_0x1bda68['query']['fields']));_0x4e892f[_0x0610('0x32')]=_0x4e892f[_0x0610('0x32')][_0x0610('0x34')]?_0x4e892f[_0x0610('0x32')]:_0x5b574f[_0x0610('0x2d')];_0x4e892f[_0x0610('0x36')]=qs[_0x0610('0x37')](_0x1bda68[_0x0610('0x2f')]['sort']);_0x4e892f['where']=qs[_0x0610('0x30')](_[_0x0610('0x39')](_0x1bda68[_0x0610('0x2f')],_0x5b574f[_0x0610('0x30')]));if(_0x1bda68['query'][_0x0610('0x3a')]){_0x4e892f['where']=_[_0x0610('0x3b')](_0x4e892f['where'],{'$or':_[_0x0610('0x2c')](_0x4e892f[_0x0610('0x32')],function(_0x20673a){var _0x18dc2f={};_0x18dc2f[_0x20673a]={'$like':'%'+_0x1bda68[_0x0610('0x2f')][_0x0610('0x3a')]+'%'};return _0x18dc2f;})});}_0x4e892f=_['merge']({},_0x4e892f,_0x1bda68[_0x0610('0x4d')]);return _0x4a7255[_0x0610('0x4a')](_0x4e892f);}})[_0x0610('0x3e')](function(_0x485f8d){if(_0x485f8d){_0x1ae690=_0x485f8d[_0x0610('0x34')];if(!_0x1bda68[_0x0610('0x2f')][_0x0610('0x35')](_0x0610('0x4e'))){_0x4e892f[_0x0610('0x21')]=qs[_0x0610('0x21')](_0x1bda68[_0x0610('0x2f')][_0x0610('0x21')]);_0x4e892f[_0x0610('0x23')]=qs[_0x0610('0x23')](_0x1bda68['query'][_0x0610('0x23')]);}return _0x4a7255[_0x0610('0x4a')](_0x4e892f);}})[_0x0610('0x3e')](function(_0x2266ee){if(_0x2266ee){return _0x2266ee?{'count':_0x1ae690,'rows':_0x2266ee}:null;}})['then'](respondWithResult(_0x430579,null))['catch'](handleError(_0x430579,null));};exports[_0x0610('0x4f')]=function(_0x32187c,_0x43cdc9,_0x3ecd70){var _0x43dc39={};var _0x4d1b8e={};var _0x950b32;var _0x747a80;return db[_0x0610('0x40')][_0x0610('0x4b')]({'where':{'id':_0x32187c[_0x0610('0x44')]['id']}})[_0x0610('0x3e')](handleEntityNotFound(_0x43cdc9,null))[_0x0610('0x3e')](function(_0x36b7c2){if(_0x36b7c2){_0x950b32=_0x36b7c2;_0x4d1b8e[_0x0610('0x2d')]=_[_0x0610('0x2e')](db[_0x0610('0x4c')][_0x0610('0x45')]);_0x4d1b8e['query']=_[_0x0610('0x2e')](_0x32187c[_0x0610('0x2f')]);_0x4d1b8e['filters']=_[_0x0610('0x31')](_0x4d1b8e[_0x0610('0x2d')],_0x4d1b8e[_0x0610('0x2f')]);_0x43dc39[_0x0610('0x32')]=_['intersection'](_0x4d1b8e[_0x0610('0x2d')],qs[_0x0610('0x33')](_0x32187c[_0x0610('0x2f')][_0x0610('0x33')]));_0x43dc39[_0x0610('0x32')]=_0x43dc39[_0x0610('0x32')][_0x0610('0x34')]?_0x43dc39['attributes']:_0x4d1b8e[_0x0610('0x2d')];_0x43dc39[_0x0610('0x36')]=qs[_0x0610('0x37')](_0x32187c[_0x0610('0x2f')][_0x0610('0x37')]);_0x43dc39[_0x0610('0x38')]=qs['filters'](_[_0x0610('0x39')](_0x32187c[_0x0610('0x2f')],_0x4d1b8e[_0x0610('0x30')]));if(_0x32187c[_0x0610('0x2f')]['filter']){_0x43dc39['where']=_['merge'](_0x43dc39[_0x0610('0x38')],{'$or':_[_0x0610('0x2c')](_0x43dc39[_0x0610('0x32')],function(_0x38423c){var _0x28acf={};_0x28acf[_0x38423c]={'$like':'%'+_0x32187c[_0x0610('0x2f')]['filter']+'%'};return _0x28acf;})});}_0x43dc39=_[_0x0610('0x3b')]({},_0x43dc39,_0x32187c[_0x0610('0x4d')]);return _0x950b32[_0x0610('0x4f')](_0x43dc39);}})[_0x0610('0x3e')](function(_0x2258dd){if(_0x2258dd){_0x747a80=_0x2258dd[_0x0610('0x34')];if(!_0x32187c[_0x0610('0x2f')][_0x0610('0x35')](_0x0610('0x4e'))){_0x43dc39[_0x0610('0x21')]=qs['limit'](_0x32187c['query'][_0x0610('0x21')]);_0x43dc39[_0x0610('0x23')]=qs['offset'](_0x32187c['query']['offset']);}return _0x950b32[_0x0610('0x4f')](_0x43dc39);}})[_0x0610('0x3e')](function(_0xeb90d){if(_0xeb90d){return _0xeb90d?{'count':_0x747a80,'rows':_0xeb90d}:null;}})[_0x0610('0x3e')](respondWithResult(_0x43cdc9,null))[_0x0610('0x42')](handleError(_0x43cdc9,null));};exports[_0x0610('0x50')]=function(_0x2e74f3,_0x636674,_0x26cf28){var _0x320943={};var _0x324d44={};var _0x1505e2;var _0x434662;return db['ZohoConfiguration'][_0x0610('0x4b')]({'where':{'id':_0x2e74f3['params']['id']}})['then'](handleEntityNotFound(_0x636674,null))[_0x0610('0x3e')](function(_0x20ea7b){if(_0x20ea7b){_0x1505e2=_0x20ea7b;_0x324d44[_0x0610('0x2d')]=_[_0x0610('0x2e')](db[_0x0610('0x4c')]['rawAttributes']);_0x324d44['query']=_[_0x0610('0x2e')](_0x2e74f3[_0x0610('0x2f')]);_0x324d44[_0x0610('0x30')]=_[_0x0610('0x31')](_0x324d44[_0x0610('0x2d')],_0x324d44['query']);_0x320943[_0x0610('0x32')]=_[_0x0610('0x31')](_0x324d44[_0x0610('0x2d')],qs['fields'](_0x2e74f3[_0x0610('0x2f')]['fields']));_0x320943[_0x0610('0x32')]=_0x320943[_0x0610('0x32')][_0x0610('0x34')]?_0x320943[_0x0610('0x32')]:_0x324d44[_0x0610('0x2d')];_0x320943['order']=qs[_0x0610('0x37')](_0x2e74f3[_0x0610('0x2f')][_0x0610('0x37')]);_0x320943[_0x0610('0x38')]=qs[_0x0610('0x30')](_[_0x0610('0x39')](_0x2e74f3[_0x0610('0x2f')],_0x324d44[_0x0610('0x30')]));if(_0x2e74f3[_0x0610('0x2f')][_0x0610('0x3a')]){_0x320943['where']=_[_0x0610('0x3b')](_0x320943[_0x0610('0x38')],{'$or':_[_0x0610('0x2c')](_0x320943[_0x0610('0x32')],function(_0x46c7bd){var _0x33ac32={};_0x33ac32[_0x46c7bd]={'$like':'%'+_0x2e74f3[_0x0610('0x2f')][_0x0610('0x3a')]+'%'};return _0x33ac32;})});}_0x320943=_[_0x0610('0x3b')]({},_0x320943,_0x2e74f3[_0x0610('0x4d')]);return _0x1505e2[_0x0610('0x50')](_0x320943);}})[_0x0610('0x3e')](function(_0x207df1){if(_0x207df1){_0x434662=_0x207df1[_0x0610('0x34')];if(!_0x2e74f3[_0x0610('0x2f')][_0x0610('0x35')]('nolimit')){_0x320943['limit']=qs[_0x0610('0x21')](_0x2e74f3['query']['limit']);_0x320943['offset']=qs['offset'](_0x2e74f3[_0x0610('0x2f')][_0x0610('0x23')]);}return _0x1505e2[_0x0610('0x50')](_0x320943);}})[_0x0610('0x3e')](function(_0x1b41dc){if(_0x1b41dc){return _0x1b41dc?{'count':_0x434662,'rows':_0x1b41dc}:null;}})[_0x0610('0x3e')](respondWithResult(_0x636674,null))[_0x0610('0x42')](handleError(_0x636674,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 3b61710..bda411d 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 _0x34f9=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','lodash'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x34f9,0x113));var _0x934f=function(_0x4998e9,_0xf83748){_0x4998e9=_0x4998e9-0x0;var _0x436a60=_0x34f9[_0x4998e9];return _0x436a60;};'use strict';var _=require(_0x934f('0x0'));var util=require(_0x934f('0x1'));var logger=require(_0x934f('0x2'))(_0x934f('0x3'));var moment=require(_0x934f('0x4'));var BPromise=require(_0x934f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x934f('0x6'));var rimraf=require(_0x934f('0x7'));var config=require(_0x934f('0x8'));var attributes=require(_0x934f('0x9'));module[_0x934f('0xa')]=function(_0x45e355,_0x3d6050){return _0x45e355[_0x934f('0xb')]('ZohoConfiguration',attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x546f=['rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','lodash','../../config/logger','api'];(function(_0x4dc0ce,_0x46f78e){var _0x4c1bd2=function(_0x4bd522){while(--_0x4bd522){_0x4dc0ce['push'](_0x4dc0ce['shift']());}};_0x4c1bd2(++_0x46f78e);}(_0x546f,0x1e3));var _0xf546=function(_0x2d00d4,_0x3e7d3d){_0x2d00d4=_0x2d00d4-0x0;var _0x45f2b6=_0x546f[_0x2d00d4];return _0x45f2b6;};'use strict';var _=require(_0xf546('0x0'));var util=require('util');var logger=require(_0xf546('0x1'))(_0xf546('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf546('0x3'));var config=require(_0xf546('0x4'));var attributes=require(_0xf546('0x5'));module[_0xf546('0x6')]=function(_0x3ffb7c,_0x5cb7d0){return _0x3ffb7c[_0xf546('0x7')](_0xf546('0x8'),attributes,{'tableName':'int_zoho_configurations','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 dbdfcb7..d29acf6 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 _0xc2b9=['then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request'];(function(_0x136a6b,_0x5f267a){var _0xeff99d=function(_0x5d48af){while(--_0x5d48af){_0x136a6b['push'](_0x136a6b['shift']());}};_0xeff99d(++_0x5f267a);}(_0xc2b9,0x184));var _0x9c2b=function(_0x3ff8e3,_0x263fb0){_0x3ff8e3=_0x3ff8e3-0x0;var _0x1940a5=_0xc2b9[_0x3ff8e3];return _0x1940a5;};'use strict';var _=require(_0x9c2b('0x0'));var util=require(_0x9c2b('0x1'));var moment=require(_0x9c2b('0x2'));var BPromise=require(_0x9c2b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9c2b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9c2b('0x5'));var logger=require(_0x9c2b('0x6'))('rpc');var config=require(_0x9c2b('0x7'));var jayson=require(_0x9c2b('0x8'));var client=jayson[_0x9c2b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x83f5ce,_0x269fd6,_0x116e1a){return new BPromise(function(_0x16a0c9,_0x5ee7c3){return client[_0x9c2b('0xa')](_0x83f5ce,_0x116e1a)[_0x9c2b('0xb')](function(_0x2cc9a3){logger[_0x9c2b('0xc')](_0x9c2b('0xd'),_0x269fd6,_0x9c2b('0xe'));logger['debug']('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x269fd6,_0x9c2b('0xe'),JSON[_0x9c2b('0xf')](_0x2cc9a3));if(_0x2cc9a3[_0x9c2b('0x10')]){if(_0x2cc9a3[_0x9c2b('0x10')][_0x9c2b('0x11')]===0x1f4){logger[_0x9c2b('0x10')](_0x9c2b('0xd'),_0x269fd6,_0x2cc9a3[_0x9c2b('0x10')][_0x9c2b('0x12')]);return _0x5ee7c3(_0x2cc9a3['error']['message']);}logger[_0x9c2b('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x269fd6,_0x2cc9a3[_0x9c2b('0x10')][_0x9c2b('0x12')]);return _0x16a0c9(_0x2cc9a3['error']['message']);}else{logger['info'](_0x9c2b('0xd'),_0x269fd6,_0x9c2b('0xe'));_0x16a0c9(_0x2cc9a3[_0x9c2b('0x13')][_0x9c2b('0x12')]);}})[_0x9c2b('0x14')](function(_0x41a747){logger[_0x9c2b('0x10')](_0x9c2b('0xd'),_0x269fd6,_0x41a747);_0x5ee7c3(_0x41a747);});});} \ No newline at end of file +var _0xa0ad=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','ioredis'];(function(_0x4356f1,_0x53bdc7){var _0x17acc4=function(_0x49dbe6){while(--_0x49dbe6){_0x4356f1['push'](_0x4356f1['shift']());}};_0x17acc4(++_0x53bdc7);}(_0xa0ad,0x68));var _0xda0a=function(_0x47e7dd,_0x51b041){_0x47e7dd=_0x47e7dd-0x0;var _0x38501f=_0xa0ad[_0x47e7dd];return _0x38501f;};'use strict';var _=require(_0xda0a('0x0'));var util=require(_0xda0a('0x1'));var moment=require(_0xda0a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xda0a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xda0a('0x4'));var logger=require(_0xda0a('0x5'))('rpc');var config=require(_0xda0a('0x6'));var jayson=require(_0xda0a('0x7'));var client=jayson['client'][_0xda0a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4c310d,_0x4e693a,_0x503fc6){return new BPromise(function(_0x46121a,_0xf03396){return client['request'](_0x4c310d,_0x503fc6)[_0xda0a('0x9')](function(_0x545c08){logger[_0xda0a('0xa')](_0xda0a('0xb'),_0x4e693a,_0xda0a('0xc'));logger['debug']('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x4e693a,_0xda0a('0xc'),JSON[_0xda0a('0xd')](_0x545c08));if(_0x545c08[_0xda0a('0xe')]){if(_0x545c08[_0xda0a('0xe')][_0xda0a('0xf')]===0x1f4){logger[_0xda0a('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0x4e693a,_0x545c08['error']['message']);return _0xf03396(_0x545c08[_0xda0a('0xe')][_0xda0a('0x10')]);}logger[_0xda0a('0xe')](_0xda0a('0xb'),_0x4e693a,_0x545c08[_0xda0a('0xe')][_0xda0a('0x10')]);return _0x46121a(_0x545c08['error'][_0xda0a('0x10')]);}else{logger[_0xda0a('0xa')](_0xda0a('0xb'),_0x4e693a,_0xda0a('0xc'));_0x46121a(_0x545c08['result'][_0xda0a('0x10')]);}})[_0xda0a('0x11')](function(_0x4ae859){logger[_0xda0a('0xe')](_0xda0a('0xb'),_0x4e693a,_0x4ae859);_0xf03396(_0x4ae859);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 61c6f7f..bad442f 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 _0x96ef=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','destroy','exports','path','connect-timeout','express','Router','fs-extra'];(function(_0xcf5436,_0x4632c3){var _0xc4f5c8=function(_0x567528){while(--_0x567528){_0xcf5436['push'](_0xcf5436['shift']());}};_0xc4f5c8(++_0x4632c3);}(_0x96ef,0x109));var _0xf96e=function(_0x2bb1d8,_0x3e6566){_0x2bb1d8=_0x2bb1d8-0x0;var _0x3b6df4=_0x96ef[_0x2bb1d8];return _0x3b6df4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf96e('0x0'));var timeout=require(_0xf96e('0x1'));var express=require(_0xf96e('0x2'));var router=express[_0xf96e('0x3')]();var fs_extra=require(_0xf96e('0x4'));var auth=require(_0xf96e('0x5'));var interaction=require(_0xf96e('0x6'));var config=require(_0xf96e('0x7'));var controller=require('./intZohoField.controller');router[_0xf96e('0x8')]('/',auth[_0xf96e('0x9')](),controller[_0xf96e('0xa')]);router[_0xf96e('0x8')](_0xf96e('0xb'),auth[_0xf96e('0x9')](),controller[_0xf96e('0xc')]);router[_0xf96e('0xd')]('/',auth[_0xf96e('0x9')](),controller[_0xf96e('0xe')]);router[_0xf96e('0xf')](_0xf96e('0xb'),auth[_0xf96e('0x9')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xf96e('0x10')]);module[_0xf96e('0x11')]=router; \ No newline at end of file +var _0x0112=['../../components/auth/service','../../components/interaction/service','./intZohoField.controller','get','isAuthenticated','index','/:id','create','put','update','destroy','exports','path','connect-timeout','express','fs-extra'];(function(_0x54ad7a,_0x391ddb){var _0x2a8694=function(_0x26def4){while(--_0x26def4){_0x54ad7a['push'](_0x54ad7a['shift']());}};_0x2a8694(++_0x391ddb);}(_0x0112,0xfc));var _0x2011=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x0112[_0x55e08b];return _0xd1a7ff;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2011('0x0'));var timeout=require(_0x2011('0x1'));var express=require(_0x2011('0x2'));var router=express['Router']();var fs_extra=require(_0x2011('0x3'));var auth=require(_0x2011('0x4'));var interaction=require(_0x2011('0x5'));var config=require('../../config/environment');var controller=require(_0x2011('0x6'));router[_0x2011('0x7')]('/',auth[_0x2011('0x8')](),controller[_0x2011('0x9')]);router['get'](_0x2011('0xa'),auth[_0x2011('0x8')](),controller['show']);router['post']('/',auth[_0x2011('0x8')](),controller[_0x2011('0xb')]);router[_0x2011('0xc')](_0x2011('0xa'),auth[_0x2011('0x8')](),controller[_0x2011('0xd')]);router['delete'](_0x2011('0xa'),auth[_0x2011('0x8')](),controller[_0x2011('0xe')]);module[_0x2011('0xf')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index da5a610..6f8d394 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 _0xd1a7=['keyValue','picklist','STRING','ENUM','string','BOOLEAN','sequelize','variable','customVariable'];(function(_0x435592,_0x363aed){var _0x2d544d=function(_0x57dc9f){while(--_0x57dc9f){_0x435592['push'](_0x435592['shift']());}};_0x2d544d(++_0x363aed);}(_0xd1a7,0x165));var _0x7d1a=function(_0x1dde5c,_0x41f5ad){_0x1dde5c=_0x1dde5c-0x0;var _0x1b9252=_0xd1a7[_0x1dde5c];return _0x1b9252;};'use strict';var Sequelize=require(_0x7d1a('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string',_0x7d1a('0x1'),_0x7d1a('0x2'),_0x7d1a('0x3'),_0x7d1a('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x7d1a('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x7d1a('0x6')](_0x7d1a('0x7'),_0x7d1a('0x1'),_0x7d1a('0x2'))},'keyContent':{'type':Sequelize[_0x7d1a('0x5')]},'idField':{'type':Sequelize[_0x7d1a('0x5')]},'nameField':{'type':Sequelize[_0x7d1a('0x5')]},'customField':{'type':Sequelize[_0x7d1a('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7d1a('0x5')]}}; \ No newline at end of file +var _0xf9a5=['string','STRING','BOOLEAN','exports','ENUM','customVariable'];(function(_0x29c9eb,_0x3d680b){var _0x438352=function(_0x1e5198){while(--_0x1e5198){_0x29c9eb['push'](_0x29c9eb['shift']());}};_0x438352(++_0x3d680b);}(_0xf9a5,0xed));var _0x5f9a=function(_0x1088b0,_0x17f2e8){_0x1088b0=_0x1088b0-0x0;var _0x4e6595=_0xf9a5[_0x1088b0];return _0x4e6595;};'use strict';var Sequelize=require('sequelize');module[_0x5f9a('0x0')]={'type':{'type':Sequelize[_0x5f9a('0x1')]('string','variable',_0x5f9a('0x2'),'keyValue','picklist'),'defaultValue':_0x5f9a('0x3')},'content':{'type':Sequelize[_0x5f9a('0x4')]},'key':{'type':Sequelize[_0x5f9a('0x4')]},'keyType':{'type':Sequelize[_0x5f9a('0x1')](_0x5f9a('0x3'),'variable',_0x5f9a('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x5f9a('0x4')]},'customField':{'type':Sequelize[_0x5f9a('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5f9a('0x4')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 99d9584..73df7d1 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 _0xf5a1=['options','includeAll','include','findAll','rows','catch','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','fs-extra','lodash','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','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','map','ZohoField','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge'];(function(_0x5cd989,_0x59c67e){var _0x18787f=function(_0x570316){while(--_0x570316){_0x5cd989['push'](_0x5cd989['shift']());}};_0x18787f(++_0x59c67e);}(_0xf5a1,0x1bf));var _0x1f5a=function(_0x2a3e90,_0x281229){_0x2a3e90=_0x2a3e90-0x0;var _0x122b4c=_0xf5a1[_0x2a3e90];return _0x122b4c;};'use strict';var emlformat=require(_0x1f5a('0x0'));var rimraf=require(_0x1f5a('0x1'));var zipdir=require(_0x1f5a('0x2'));var jsonpatch=require(_0x1f5a('0x3'));var rp=require('request-promise');var moment=require(_0x1f5a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1f5a('0x5'));var util=require('util');var path=require(_0x1f5a('0x6'));var sox=require(_0x1f5a('0x7'));var csv=require('to-csv');var ejs=require(_0x1f5a('0x8'));var fs=require('fs');var fs_extra=require(_0x1f5a('0x9'));var _=require(_0x1f5a('0xa'));var squel=require('squel');var crypto=require(_0x1f5a('0xb'));var jsforce=require(_0x1f5a('0xc'));var deskjs=require(_0x1f5a('0xd'));var toCsv=require(_0x1f5a('0xe'));var querystring=require(_0x1f5a('0xf'));var Papa=require(_0x1f5a('0x10'));var Redis=require('ioredis');var authService=require(_0x1f5a('0x11'));var qs=require(_0x1f5a('0x12'));var as=require(_0x1f5a('0x13'));var hardwareService=require(_0x1f5a('0x14'));var logger=require(_0x1f5a('0x15'))(_0x1f5a('0x16'));var utils=require(_0x1f5a('0x17'));var config=require(_0x1f5a('0x18'));var licenseUtil=require(_0x1f5a('0x19'));var db=require(_0x1f5a('0x1a'))['db'];function respondWithStatusCode(_0x337555,_0x182a17){_0x182a17=_0x182a17||0xcc;return function(_0x58bc32){if(_0x58bc32){return _0x337555[_0x1f5a('0x1b')](_0x182a17);}return _0x337555[_0x1f5a('0x1c')](_0x182a17)[_0x1f5a('0x1d')]();};}function respondWithResult(_0x5c8139,_0x334cba){_0x334cba=_0x334cba||0xc8;return function(_0x43cd3b){if(_0x43cd3b){return _0x5c8139[_0x1f5a('0x1c')](_0x334cba)[_0x1f5a('0x1e')](_0x43cd3b);}};}function respondWithFilteredResult(_0x2a1eac,_0x49f3aa){return function(_0x3539ba){if(_0x3539ba){var _0x53896f=typeof _0x49f3aa[_0x1f5a('0x1f')]===_0x1f5a('0x20')&&typeof _0x49f3aa[_0x1f5a('0x21')]==='undefined';var _0x4e7b1a=_0x3539ba['count'];var _0x2b50e8=_0x53896f?0x0:_0x49f3aa[_0x1f5a('0x1f')];var _0x5143c9=_0x53896f?_0x3539ba[_0x1f5a('0x22')]:_0x49f3aa['offset']+_0x49f3aa[_0x1f5a('0x21')];var _0x33b9e9;if(_0x5143c9>=_0x4e7b1a){_0x5143c9=_0x4e7b1a;_0x33b9e9=0xc8;}else{_0x33b9e9=0xce;}_0x2a1eac['status'](_0x33b9e9);return _0x2a1eac[_0x1f5a('0x23')](_0x1f5a('0x24'),_0x2b50e8+'-'+_0x5143c9+'/'+_0x4e7b1a)[_0x1f5a('0x1e')](_0x3539ba);}return null;};}function patchUpdates(_0x28c4e0){return function(_0x5985b9){try{jsonpatch['apply'](_0x5985b9,_0x28c4e0,!![]);}catch(_0x5609c9){return BPromise[_0x1f5a('0x25')](_0x5609c9);}return _0x5985b9[_0x1f5a('0x26')]();};}function saveUpdates(_0x8e39d,_0x5d7a42){return function(_0xd6a75e){if(_0xd6a75e){return _0xd6a75e[_0x1f5a('0x27')](_0x8e39d)['then'](function(_0x240d7d){return _0x240d7d;});}return null;};}function removeEntity(_0x815d30,_0x4a2c4a){return function(_0x2347fc){if(_0x2347fc){return _0x2347fc[_0x1f5a('0x28')]()[_0x1f5a('0x29')](function(){_0x815d30[_0x1f5a('0x1c')](0xcc)[_0x1f5a('0x1d')]();});}};}function handleEntityNotFound(_0x509e08,_0x173acb){return function(_0x5a2235){if(!_0x5a2235){_0x509e08[_0x1f5a('0x1b')](0x194);}return _0x5a2235;};}function handleError(_0x10b617,_0x1caa78){_0x1caa78=_0x1caa78||0x1f4;return function(_0x246d12){logger[_0x1f5a('0x2a')](_0x246d12[_0x1f5a('0x2b')]);if(_0x246d12[_0x1f5a('0x2c')]){delete _0x246d12['name'];}_0x10b617[_0x1f5a('0x1c')](_0x1caa78)[_0x1f5a('0x2d')](_0x246d12);};}exports['index']=function(_0x4a6e68,_0x11259c){var _0x411e8e={},_0x24d445={},_0x3b315d={'count':0x0,'rows':[]};var _0x12bc99=_[_0x1f5a('0x2e')](db[_0x1f5a('0x2f')][_0x1f5a('0x30')],function(_0x33868e){return{'name':_0x33868e[_0x1f5a('0x31')],'type':_0x33868e[_0x1f5a('0x32')]['key']};});_0x24d445[_0x1f5a('0x33')]=_[_0x1f5a('0x2e')](_0x12bc99,_0x1f5a('0x2c'));_0x24d445[_0x1f5a('0x34')]=_['keys'](_0x4a6e68[_0x1f5a('0x34')]);_0x24d445[_0x1f5a('0x35')]=_[_0x1f5a('0x36')](_0x24d445[_0x1f5a('0x33')],_0x24d445[_0x1f5a('0x34')]);_0x411e8e['attributes']=_[_0x1f5a('0x36')](_0x24d445[_0x1f5a('0x33')],qs['fields'](_0x4a6e68['query']['fields']));_0x411e8e[_0x1f5a('0x37')]=_0x411e8e[_0x1f5a('0x37')][_0x1f5a('0x38')]?_0x411e8e[_0x1f5a('0x37')]:_0x24d445['model'];if(!_0x4a6e68['query'][_0x1f5a('0x39')](_0x1f5a('0x3a'))){_0x411e8e[_0x1f5a('0x21')]=qs[_0x1f5a('0x21')](_0x4a6e68[_0x1f5a('0x34')]['limit']);_0x411e8e[_0x1f5a('0x1f')]=qs['offset'](_0x4a6e68[_0x1f5a('0x34')][_0x1f5a('0x1f')]);}_0x411e8e[_0x1f5a('0x3b')]=qs[_0x1f5a('0x3c')](_0x4a6e68[_0x1f5a('0x34')][_0x1f5a('0x3c')]);_0x411e8e[_0x1f5a('0x3d')]=qs[_0x1f5a('0x35')](_['pick'](_0x4a6e68[_0x1f5a('0x34')],_0x24d445[_0x1f5a('0x35')]),_0x12bc99);if(_0x4a6e68[_0x1f5a('0x34')][_0x1f5a('0x3e')]){_0x411e8e['where']=_['merge'](_0x411e8e[_0x1f5a('0x3d')],{'$or':_[_0x1f5a('0x2e')](_0x12bc99,function(_0x25c376){if(_0x25c376[_0x1f5a('0x32')]!=='VIRTUAL'){var _0x30dc9c={};_0x30dc9c[_0x25c376[_0x1f5a('0x2c')]]={'$like':'%'+_0x4a6e68[_0x1f5a('0x34')]['filter']+'%'};return _0x30dc9c;}})});}_0x411e8e=_[_0x1f5a('0x3f')]({},_0x411e8e,_0x4a6e68[_0x1f5a('0x40')]);var _0x4e3007={'where':_0x411e8e['where']};return db[_0x1f5a('0x2f')]['count'](_0x4e3007)[_0x1f5a('0x29')](function(_0x39e32e){_0x3b315d[_0x1f5a('0x22')]=_0x39e32e;if(_0x4a6e68[_0x1f5a('0x34')][_0x1f5a('0x41')]){_0x411e8e[_0x1f5a('0x42')]=[{'all':!![]}];}return db[_0x1f5a('0x2f')][_0x1f5a('0x43')](_0x411e8e);})['then'](function(_0xcacb80){_0x3b315d[_0x1f5a('0x44')]=_0xcacb80;return _0x3b315d;})[_0x1f5a('0x29')](respondWithFilteredResult(_0x11259c,_0x411e8e))[_0x1f5a('0x45')](handleError(_0x11259c,null));};exports['show']=function(_0x3655a1,_0xf30114){var _0x421e62={'raw':!![],'where':{'id':_0x3655a1['params']['id']}},_0x78462b={};_0x78462b[_0x1f5a('0x33')]=_['keys'](db[_0x1f5a('0x2f')][_0x1f5a('0x30')]);_0x78462b[_0x1f5a('0x34')]=_['keys'](_0x3655a1[_0x1f5a('0x34')]);_0x78462b[_0x1f5a('0x35')]=_['intersection'](_0x78462b[_0x1f5a('0x33')],_0x78462b[_0x1f5a('0x34')]);_0x421e62['attributes']=_[_0x1f5a('0x36')](_0x78462b[_0x1f5a('0x33')],qs['fields'](_0x3655a1[_0x1f5a('0x34')]['fields']));_0x421e62[_0x1f5a('0x37')]=_0x421e62[_0x1f5a('0x37')]['length']?_0x421e62[_0x1f5a('0x37')]:_0x78462b['model'];if(_0x3655a1[_0x1f5a('0x34')][_0x1f5a('0x41')]){_0x421e62[_0x1f5a('0x42')]=[{'all':!![]}];}_0x421e62=_[_0x1f5a('0x3f')]({},_0x421e62,_0x3655a1[_0x1f5a('0x40')]);return db[_0x1f5a('0x2f')][_0x1f5a('0x46')](_0x421e62)[_0x1f5a('0x29')](handleEntityNotFound(_0xf30114,null))['then'](respondWithResult(_0xf30114,null))[_0x1f5a('0x45')](handleError(_0xf30114,null));};exports[_0x1f5a('0x47')]=function(_0x230819,_0x845cd6){return db[_0x1f5a('0x2f')][_0x1f5a('0x47')](_0x230819[_0x1f5a('0x48')],{})['then'](respondWithResult(_0x845cd6,0xc9))[_0x1f5a('0x45')](handleError(_0x845cd6,null));};exports[_0x1f5a('0x27')]=function(_0x43fc7a,_0x4e0383){if(_0x43fc7a[_0x1f5a('0x48')]['id']){delete _0x43fc7a['body']['id'];}return db['ZohoField'][_0x1f5a('0x46')]({'where':{'id':_0x43fc7a['params']['id']}})[_0x1f5a('0x29')](handleEntityNotFound(_0x4e0383,null))[_0x1f5a('0x29')](saveUpdates(_0x43fc7a[_0x1f5a('0x48')],null))[_0x1f5a('0x29')](respondWithResult(_0x4e0383,null))[_0x1f5a('0x45')](handleError(_0x4e0383,null));};exports[_0x1f5a('0x28')]=function(_0x200709,_0x4f8be8){return db['ZohoField'][_0x1f5a('0x46')]({'where':{'id':_0x200709['params']['id']}})[_0x1f5a('0x29')](handleEntityNotFound(_0x4f8be8,null))[_0x1f5a('0x29')](removeEntity(_0x4f8be8,null))['catch'](handleError(_0x4f8be8,null));}; \ No newline at end of file +var _0x55ea=['VIRTUAL','options','include','rows','catch','params','rawAttributes','attributes','fields','includeAll','find','create','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ZohoField','fieldName','type','key','model','query','keys','filters','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0x60fb10,_0xd27019){var _0x1de1ef=function(_0x3e0eda){while(--_0x3e0eda){_0x60fb10['push'](_0x60fb10['shift']());}};_0x1de1ef(++_0xd27019);}(_0x55ea,0xe2));var _0xa55e=function(_0x5f3897,_0x25fec9){_0x5f3897=_0x5f3897-0x0;var _0xa6e3b8=_0x55ea[_0x5f3897];return _0xa6e3b8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa55e('0x0'));var zipdir=require(_0xa55e('0x1'));var jsonpatch=require(_0xa55e('0x2'));var rp=require('request-promise');var moment=require(_0xa55e('0x3'));var BPromise=require(_0xa55e('0x4'));var Mustache=require(_0xa55e('0x5'));var util=require(_0xa55e('0x6'));var path=require(_0xa55e('0x7'));var sox=require(_0xa55e('0x8'));var csv=require(_0xa55e('0x9'));var ejs=require(_0xa55e('0xa'));var fs=require('fs');var fs_extra=require(_0xa55e('0xb'));var _=require(_0xa55e('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa55e('0xd'));var deskjs=require(_0xa55e('0xe'));var toCsv=require(_0xa55e('0x9'));var querystring=require(_0xa55e('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa55e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa55e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa55e('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c3bee,_0x56b7a6){_0x56b7a6=_0x56b7a6||0xcc;return function(_0x267ea7){if(_0x267ea7){return _0x1c3bee['sendStatus'](_0x56b7a6);}return _0x1c3bee[_0xa55e('0x14')](_0x56b7a6)[_0xa55e('0x15')]();};}function respondWithResult(_0x134961,_0x569d4b){_0x569d4b=_0x569d4b||0xc8;return function(_0x300a44){if(_0x300a44){return _0x134961[_0xa55e('0x14')](_0x569d4b)[_0xa55e('0x16')](_0x300a44);}};}function respondWithFilteredResult(_0x312032,_0xa12196){return function(_0x437c68){if(_0x437c68){var _0x5dc245=typeof _0xa12196[_0xa55e('0x17')]===_0xa55e('0x18')&&typeof _0xa12196[_0xa55e('0x19')]===_0xa55e('0x18');var _0x23d8c4=_0x437c68[_0xa55e('0x1a')];var _0x335e3e=_0x5dc245?0x0:_0xa12196[_0xa55e('0x17')];var _0x2e1cbd=_0x5dc245?_0x437c68[_0xa55e('0x1a')]:_0xa12196['offset']+_0xa12196['limit'];var _0x2e3f7a;if(_0x2e1cbd>=_0x23d8c4){_0x2e1cbd=_0x23d8c4;_0x2e3f7a=0xc8;}else{_0x2e3f7a=0xce;}_0x312032[_0xa55e('0x14')](_0x2e3f7a);return _0x312032[_0xa55e('0x1b')]('Content-Range',_0x335e3e+'-'+_0x2e1cbd+'/'+_0x23d8c4)[_0xa55e('0x16')](_0x437c68);}return null;};}function patchUpdates(_0x3d821c){return function(_0x2ca8b4){try{jsonpatch[_0xa55e('0x1c')](_0x2ca8b4,_0x3d821c,!![]);}catch(_0x2b1164){return BPromise['reject'](_0x2b1164);}return _0x2ca8b4[_0xa55e('0x1d')]();};}function saveUpdates(_0x7b29db,_0x300092){return function(_0x58c2ec){if(_0x58c2ec){return _0x58c2ec[_0xa55e('0x1e')](_0x7b29db)[_0xa55e('0x1f')](function(_0x503d4d){return _0x503d4d;});}return null;};}function removeEntity(_0x3a8130,_0x3e35e2){return function(_0x553808){if(_0x553808){return _0x553808[_0xa55e('0x20')]()[_0xa55e('0x1f')](function(){_0x3a8130[_0xa55e('0x14')](0xcc)[_0xa55e('0x15')]();});}};}function handleEntityNotFound(_0x8b4154,_0xd973df){return function(_0x2b326d){if(!_0x2b326d){_0x8b4154[_0xa55e('0x21')](0x194);}return _0x2b326d;};}function handleError(_0x505ec3,_0x5be330){_0x5be330=_0x5be330||0x1f4;return function(_0x503908){logger[_0xa55e('0x22')](_0x503908[_0xa55e('0x23')]);if(_0x503908[_0xa55e('0x24')]){delete _0x503908['name'];}_0x505ec3[_0xa55e('0x14')](_0x5be330)[_0xa55e('0x25')](_0x503908);};}exports[_0xa55e('0x26')]=function(_0x18cde2,_0x2dc325){var _0x2cc8c9={},_0x3b574e={},_0x3f6bbb={'count':0x0,'rows':[]};var _0x3898a6=_[_0xa55e('0x27')](db[_0xa55e('0x28')]['rawAttributes'],function(_0x2d3c17){return{'name':_0x2d3c17[_0xa55e('0x29')],'type':_0x2d3c17[_0xa55e('0x2a')][_0xa55e('0x2b')]};});_0x3b574e[_0xa55e('0x2c')]=_[_0xa55e('0x27')](_0x3898a6,'name');_0x3b574e[_0xa55e('0x2d')]=_[_0xa55e('0x2e')](_0x18cde2[_0xa55e('0x2d')]);_0x3b574e[_0xa55e('0x2f')]=_[_0xa55e('0x30')](_0x3b574e['model'],_0x3b574e['query']);_0x2cc8c9['attributes']=_['intersection'](_0x3b574e['model'],qs['fields'](_0x18cde2['query']['fields']));_0x2cc8c9['attributes']=_0x2cc8c9['attributes'][_0xa55e('0x31')]?_0x2cc8c9['attributes']:_0x3b574e[_0xa55e('0x2c')];if(!_0x18cde2['query'][_0xa55e('0x32')](_0xa55e('0x33'))){_0x2cc8c9[_0xa55e('0x19')]=qs[_0xa55e('0x19')](_0x18cde2[_0xa55e('0x2d')][_0xa55e('0x19')]);_0x2cc8c9[_0xa55e('0x17')]=qs[_0xa55e('0x17')](_0x18cde2['query'][_0xa55e('0x17')]);}_0x2cc8c9[_0xa55e('0x34')]=qs[_0xa55e('0x35')](_0x18cde2[_0xa55e('0x2d')]['sort']);_0x2cc8c9[_0xa55e('0x36')]=qs['filters'](_[_0xa55e('0x37')](_0x18cde2[_0xa55e('0x2d')],_0x3b574e[_0xa55e('0x2f')]),_0x3898a6);if(_0x18cde2[_0xa55e('0x2d')][_0xa55e('0x38')]){_0x2cc8c9['where']=_[_0xa55e('0x39')](_0x2cc8c9['where'],{'$or':_[_0xa55e('0x27')](_0x3898a6,function(_0x52abec){if(_0x52abec[_0xa55e('0x2a')]!==_0xa55e('0x3a')){var _0x5ab877={};_0x5ab877[_0x52abec[_0xa55e('0x24')]]={'$like':'%'+_0x18cde2[_0xa55e('0x2d')][_0xa55e('0x38')]+'%'};return _0x5ab877;}})});}_0x2cc8c9=_[_0xa55e('0x39')]({},_0x2cc8c9,_0x18cde2[_0xa55e('0x3b')]);var _0x11db91={'where':_0x2cc8c9[_0xa55e('0x36')]};return db[_0xa55e('0x28')]['count'](_0x11db91)[_0xa55e('0x1f')](function(_0x49e2ac){_0x3f6bbb[_0xa55e('0x1a')]=_0x49e2ac;if(_0x18cde2[_0xa55e('0x2d')]['includeAll']){_0x2cc8c9[_0xa55e('0x3c')]=[{'all':!![]}];}return db[_0xa55e('0x28')]['findAll'](_0x2cc8c9);})[_0xa55e('0x1f')](function(_0x5169dc){_0x3f6bbb[_0xa55e('0x3d')]=_0x5169dc;return _0x3f6bbb;})[_0xa55e('0x1f')](respondWithFilteredResult(_0x2dc325,_0x2cc8c9))[_0xa55e('0x3e')](handleError(_0x2dc325,null));};exports['show']=function(_0x4000b5,_0x228ae4){var _0x883030={'raw':!![],'where':{'id':_0x4000b5[_0xa55e('0x3f')]['id']}},_0x12d35b={};_0x12d35b[_0xa55e('0x2c')]=_[_0xa55e('0x2e')](db[_0xa55e('0x28')][_0xa55e('0x40')]);_0x12d35b[_0xa55e('0x2d')]=_['keys'](_0x4000b5[_0xa55e('0x2d')]);_0x12d35b[_0xa55e('0x2f')]=_[_0xa55e('0x30')](_0x12d35b['model'],_0x12d35b['query']);_0x883030[_0xa55e('0x41')]=_[_0xa55e('0x30')](_0x12d35b['model'],qs[_0xa55e('0x42')](_0x4000b5[_0xa55e('0x2d')][_0xa55e('0x42')]));_0x883030[_0xa55e('0x41')]=_0x883030[_0xa55e('0x41')]['length']?_0x883030[_0xa55e('0x41')]:_0x12d35b[_0xa55e('0x2c')];if(_0x4000b5[_0xa55e('0x2d')][_0xa55e('0x43')]){_0x883030[_0xa55e('0x3c')]=[{'all':!![]}];}_0x883030=_['merge']({},_0x883030,_0x4000b5[_0xa55e('0x3b')]);return db['ZohoField'][_0xa55e('0x44')](_0x883030)[_0xa55e('0x1f')](handleEntityNotFound(_0x228ae4,null))[_0xa55e('0x1f')](respondWithResult(_0x228ae4,null))[_0xa55e('0x3e')](handleError(_0x228ae4,null));};exports[_0xa55e('0x45')]=function(_0x1155a9,_0x1b3c94){return db[_0xa55e('0x28')][_0xa55e('0x45')](_0x1155a9[_0xa55e('0x46')],{})[_0xa55e('0x1f')](respondWithResult(_0x1b3c94,0xc9))[_0xa55e('0x3e')](handleError(_0x1b3c94,null));};exports[_0xa55e('0x1e')]=function(_0xf321a8,_0x2e0fd8){if(_0xf321a8[_0xa55e('0x46')]['id']){delete _0xf321a8[_0xa55e('0x46')]['id'];}return db[_0xa55e('0x28')][_0xa55e('0x44')]({'where':{'id':_0xf321a8[_0xa55e('0x3f')]['id']}})[_0xa55e('0x1f')](handleEntityNotFound(_0x2e0fd8,null))[_0xa55e('0x1f')](saveUpdates(_0xf321a8[_0xa55e('0x46')],null))[_0xa55e('0x1f')](respondWithResult(_0x2e0fd8,null))[_0xa55e('0x3e')](handleError(_0x2e0fd8,null));};exports[_0xa55e('0x20')]=function(_0x39520f,_0x2ba2eb){return db[_0xa55e('0x28')]['find']({'where':{'id':_0x39520f[_0xa55e('0x3f')]['id']}})[_0xa55e('0x1f')](handleEntityNotFound(_0x2ba2eb,null))[_0xa55e('0x1f')](removeEntity(_0x2ba2eb,null))[_0xa55e('0x3e')](handleError(_0x2ba2eb,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index fda5365..b66080c 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 _0x0295=['rimraf','../../config/environment','./intZohoField.attributes','exports','define','idField','lodash','api','request-promise','path'];(function(_0x143ff6,_0x31edbf){var _0x36322b=function(_0x2e9e54){while(--_0x2e9e54){_0x143ff6['push'](_0x143ff6['shift']());}};_0x36322b(++_0x31edbf);}(_0x0295,0x1f0));var _0x5029=function(_0x5665b7,_0x634f29){_0x5665b7=_0x5665b7-0x0;var _0x21418c=_0x0295[_0x5665b7];return _0x21418c;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5029('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5029('0x2'));var fs=require('fs');var path=require(_0x5029('0x3'));var rimraf=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var attributes=require(_0x5029('0x6'));module[_0x5029('0x7')]=function(_0x200217,_0x215955){return _0x200217[_0x5029('0x8')]('ZohoField',attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x5029('0x9'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4888=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intZohoField.attributes','exports','define','FieldId'];(function(_0x180e1d,_0x4d336c){var _0x2ff4b8=function(_0x2707b6){while(--_0x2707b6){_0x180e1d['push'](_0x180e1d['shift']());}};_0x2ff4b8(++_0x4d336c);}(_0x4888,0x198));var _0x8488=function(_0x3245f7,_0x26bfad){_0x3245f7=_0x3245f7-0x0;var _0x472f77=_0x4888[_0x3245f7];return _0x472f77;};'use strict';var _=require('lodash');var util=require(_0x8488('0x0'));var logger=require(_0x8488('0x1'))(_0x8488('0x2'));var moment=require(_0x8488('0x3'));var BPromise=require(_0x8488('0x4'));var rp=require(_0x8488('0x5'));var fs=require('fs');var path=require(_0x8488('0x6'));var rimraf=require('rimraf');var config=require(_0x8488('0x7'));var attributes=require(_0x8488('0x8'));module[_0x8488('0x9')]=function(_0x421292,_0x326887){return _0x421292[_0x8488('0xa')]('ZohoField',attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':['idField',_0x8488('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index 818ff89..0ffff10 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 _0x6074=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','moment','bluebird','randomstring','ioredis'];(function(_0x42acb0,_0x636052){var _0x18f6d8=function(_0x3ec1be){while(--_0x3ec1be){_0x42acb0['push'](_0x42acb0['shift']());}};_0x18f6d8(++_0x636052);}(_0x6074,0x161));var _0x4607=function(_0xbf5e16,_0x146ce3){_0xbf5e16=_0xbf5e16-0x0;var _0x5975a5=_0x6074[_0xbf5e16];return _0x5975a5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4607('0x0'));var BPromise=require(_0x4607('0x1'));var rs=require(_0x4607('0x2'));var fs=require('fs');var Redis=require(_0x4607('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4607('0x4'))(_0x4607('0x5'));var config=require(_0x4607('0x6'));var jayson=require(_0x4607('0x7'));var client=jayson[_0x4607('0x8')][_0x4607('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x188537,_0xefde6e,_0x5a3698){return new BPromise(function(_0x549974,_0x372e23){return client[_0x4607('0xa')](_0x188537,_0x5a3698)[_0x4607('0xb')](function(_0x39e8b1){logger[_0x4607('0xc')](_0x4607('0xd'),_0xefde6e,_0x4607('0xe'));logger['debug'](_0x4607('0xf'),_0xefde6e,_0x4607('0xe'),JSON[_0x4607('0x10')](_0x39e8b1));if(_0x39e8b1['error']){if(_0x39e8b1[_0x4607('0x11')][_0x4607('0x12')]===0x1f4){logger['error'](_0x4607('0xd'),_0xefde6e,_0x39e8b1[_0x4607('0x11')]['message']);return _0x372e23(_0x39e8b1[_0x4607('0x11')][_0x4607('0x13')]);}logger['error'](_0x4607('0xd'),_0xefde6e,_0x39e8b1['error']['message']);return _0x549974(_0x39e8b1[_0x4607('0x11')][_0x4607('0x13')]);}else{logger[_0x4607('0xc')](_0x4607('0xd'),_0xefde6e,'request\x20sent');_0x549974(_0x39e8b1[_0x4607('0x14')][_0x4607('0x13')]);}})['catch'](function(_0x799a53){logger[_0x4607('0x11')](_0x4607('0xd'),_0xefde6e,_0x799a53);_0x372e23(_0x799a53);});});} \ No newline at end of file +var _0xbdcc=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','error','message','ZohoField,\x20%s,\x20%s','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x1e9b13,_0x78c34b){var _0x27254f=function(_0x3aa64d){while(--_0x3aa64d){_0x1e9b13['push'](_0x1e9b13['shift']());}};_0x27254f(++_0x78c34b);}(_0xbdcc,0x80));var _0xcbdc=function(_0x576c9f,_0x3aa9c0){_0x576c9f=_0x576c9f-0x0;var _0x1196fe=_0xbdcc[_0x576c9f];return _0x1196fe;};'use strict';var _=require('lodash');var util=require(_0xcbdc('0x0'));var moment=require(_0xcbdc('0x1'));var BPromise=require('bluebird');var rs=require(_0xcbdc('0x2'));var fs=require('fs');var Redis=require(_0xcbdc('0x3'));var db=require(_0xcbdc('0x4'))['db'];var utils=require(_0xcbdc('0x5'));var logger=require(_0xcbdc('0x6'))(_0xcbdc('0x7'));var config=require(_0xcbdc('0x8'));var jayson=require(_0xcbdc('0x9'));var client=jayson[_0xcbdc('0xa')][_0xcbdc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x141785,_0x190a4b,_0x22decf){return new BPromise(function(_0x3489a4,_0x3a8cfd){return client[_0xcbdc('0xc')](_0x141785,_0x22decf)['then'](function(_0x35062c){logger[_0xcbdc('0xd')]('ZohoField,\x20%s,\x20%s',_0x190a4b,_0xcbdc('0xe'));logger[_0xcbdc('0xf')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x190a4b,'request\x20sent',JSON['stringify'](_0x35062c));if(_0x35062c[_0xcbdc('0x10')]){if(_0x35062c[_0xcbdc('0x10')]['code']===0x1f4){logger['error']('ZohoField,\x20%s,\x20%s',_0x190a4b,_0x35062c['error'][_0xcbdc('0x11')]);return _0x3a8cfd(_0x35062c['error']['message']);}logger[_0xcbdc('0x10')](_0xcbdc('0x12'),_0x190a4b,_0x35062c[_0xcbdc('0x10')]['message']);return _0x3489a4(_0x35062c['error'][_0xcbdc('0x11')]);}else{logger[_0xcbdc('0xd')](_0xcbdc('0x12'),_0x190a4b,_0xcbdc('0xe'));_0x3489a4(_0x35062c['result']['message']);}})['catch'](function(_0x46fed0){logger['error']('ZohoField,\x20%s,\x20%s',_0x190a4b,_0x46fed0);_0x3a8cfd(_0x46fed0);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 45435b6..7ceced5 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1bd7a9,_0x24d836){var _0xad8b4c=function(_0x2b5be9){while(--_0x2b5be9){_0x1bd7a9['push'](_0x1bd7a9['shift']());}};_0xad8b4c(++_0x24d836);}(_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(_0x1af68e,_0x10a8f5){var _0x250802=function(_0x3d17b5){while(--_0x3d17b5){_0x1af68e['push'](_0x1af68e['shift']());}};_0x250802(++_0x10a8f5);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x19babd,_0x1d4ef7){_0x19babd=_0x19babd-0x0;var _0x314eaf=_0xcb91[_0x19babd];return _0x314eaf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 688d475..a9fdbbd 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 _0x99e8=['INTEGER','BOOLEAN','state','sequelize','exports','STRING','unique_name_and_version','app.js'];(function(_0x3a5648,_0x58054e){var _0x34126d=function(_0x3a6476){while(--_0x3a6476){_0x3a5648['push'](_0x3a5648['shift']());}};_0x34126d(++_0x58054e);}(_0x99e8,0x11b));var _0x899e=function(_0x2d4d4d,_0x3f0f17){_0x2d4d4d=_0x2d4d4d-0x0;var _0x533e32=_0x99e8[_0x2d4d4d];return _0x533e32;};'use strict';var Sequelize=require(_0x899e('0x0'));module[_0x899e('0x1')]={'name':{'type':Sequelize[_0x899e('0x2')],'allowNull':![],'unique':_0x899e('0x3')},'version':{'type':Sequelize[_0x899e('0x2')],'allowNull':![],'unique':_0x899e('0x3')},'main':{'type':Sequelize[_0x899e('0x2')],'defaultValue':_0x899e('0x4')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x899e('0x2')]},'type':{'type':Sequelize[_0x899e('0x2')]},'size':{'type':Sequelize[_0x899e('0x5')]},'active':{'type':Sequelize[_0x899e('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0x899e('0x2')]},'logo':{'type':Sequelize[_0x899e('0x2')]},'state':{'type':Sequelize[_0x899e('0x2')],'unique':_0x899e('0x7')},'description':{'type':Sequelize[_0x899e('0x2')]},'title':{'type':Sequelize[_0x899e('0x2')]},'remoteUri':{'type':Sequelize[_0x899e('0x2')]},'link':{'type':Sequelize[_0x899e('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0xdb16=['state','sequelize','exports','STRING','unique_name_and_version','INTEGER','BOOLEAN'];(function(_0x1e06f1,_0x59d7e1){var _0x34f77e=function(_0x4f9f26){while(--_0x4f9f26){_0x1e06f1['push'](_0x1e06f1['shift']());}};_0x34f77e(++_0x59d7e1);}(_0xdb16,0x1b3));var _0x6db1=function(_0x5e844d,_0x1a2af2){_0x5e844d=_0x5e844d-0x0;var _0x7760f1=_0xdb16[_0x5e844d];return _0x7760f1;};'use strict';var Sequelize=require(_0x6db1('0x0'));module[_0x6db1('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x6db1('0x2')],'allowNull':![],'unique':_0x6db1('0x3')},'main':{'type':Sequelize['STRING'],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0x6db1('0x2')]},'path':{'type':Sequelize[_0x6db1('0x2')]},'type':{'type':Sequelize[_0x6db1('0x2')]},'size':{'type':Sequelize[_0x6db1('0x4')]},'active':{'type':Sequelize[_0x6db1('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x6db1('0x2')]},'logo':{'type':Sequelize[_0x6db1('0x2')]},'state':{'type':Sequelize['STRING'],'unique':_0x6db1('0x6')},'description':{'type':Sequelize[_0x6db1('0x2')]},'title':{'type':Sequelize[_0x6db1('0x2')]},'remoteUri':{'type':Sequelize[_0x6db1('0x2')]},'link':{'type':Sequelize[_0x6db1('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 0fe0867..ca9015e 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 _0x7880=['set','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','Integration','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','keys','options','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit'];(function(_0x2c4298,_0x27a466){var _0x22f175=function(_0x1d0477){while(--_0x1d0477){_0x2c4298['push'](_0x2c4298['shift']());}};_0x22f175(++_0x27a466);}(_0x7880,0x1f4));var _0x0788=function(_0x54e9cd,_0x16ae73){_0x54e9cd=_0x54e9cd-0x0;var _0x343ae7=_0x7880[_0x54e9cd];return _0x343ae7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0788('0x0'));var zipdir=require(_0x0788('0x1'));var jsonpatch=require(_0x0788('0x2'));var rp=require(_0x0788('0x3'));var moment=require(_0x0788('0x4'));var BPromise=require(_0x0788('0x5'));var Mustache=require('mustache');var util=require(_0x0788('0x6'));var path=require(_0x0788('0x7'));var sox=require(_0x0788('0x8'));var csv=require(_0x0788('0x9'));var ejs=require(_0x0788('0xa'));var fs=require('fs');var fs_extra=require(_0x0788('0xb'));var _=require(_0x0788('0xc'));var squel=require(_0x0788('0xd'));var crypto=require(_0x0788('0xe'));var jsforce=require(_0x0788('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0788('0x9'));var querystring=require('querystring');var Papa=require(_0x0788('0x10'));var Redis=require('ioredis');var authService=require(_0x0788('0x11'));var qs=require(_0x0788('0x12'));var as=require(_0x0788('0x13'));var hardwareService=require(_0x0788('0x14'));var logger=require(_0x0788('0x15'))('api');var utils=require(_0x0788('0x16'));var config=require(_0x0788('0x17'));var licenseUtil=require(_0x0788('0x18'));var db=require(_0x0788('0x19'))['db'];function respondWithStatusCode(_0x311729,_0xce4342){_0xce4342=_0xce4342||0xcc;return function(_0x261ebc){if(_0x261ebc){return _0x311729['sendStatus'](_0xce4342);}return _0x311729[_0x0788('0x1a')](_0xce4342)[_0x0788('0x1b')]();};}function respondWithResult(_0x3bdcdf,_0x13cf07){_0x13cf07=_0x13cf07||0xc8;return function(_0x51e5d3){if(_0x51e5d3){return _0x3bdcdf[_0x0788('0x1a')](_0x13cf07)['json'](_0x51e5d3);}};}function respondWithFilteredResult(_0x195f14,_0x170d56){return function(_0x3fd1e4){if(_0x3fd1e4){var _0xb406fb=typeof _0x170d56[_0x0788('0x1c')]===_0x0788('0x1d')&&typeof _0x170d56['limit']==='undefined';var _0x17d805=_0x3fd1e4[_0x0788('0x1e')];var _0x5b2bdc=_0xb406fb?0x0:_0x170d56[_0x0788('0x1c')];var _0x415f19=_0xb406fb?_0x3fd1e4[_0x0788('0x1e')]:_0x170d56['offset']+_0x170d56[_0x0788('0x1f')];var _0x3fb723;if(_0x415f19>=_0x17d805){_0x415f19=_0x17d805;_0x3fb723=0xc8;}else{_0x3fb723=0xce;}_0x195f14['status'](_0x3fb723);return _0x195f14[_0x0788('0x20')]('Content-Range',_0x5b2bdc+'-'+_0x415f19+'/'+_0x17d805)[_0x0788('0x21')](_0x3fd1e4);}return null;};}function patchUpdates(_0x48bc5f){return function(_0x17cca3){try{jsonpatch[_0x0788('0x22')](_0x17cca3,_0x48bc5f,!![]);}catch(_0x18ff22){return BPromise[_0x0788('0x23')](_0x18ff22);}return _0x17cca3[_0x0788('0x24')]();};}function saveUpdates(_0x4f0005,_0x48ec43){return function(_0x2270d4){if(_0x2270d4){return _0x2270d4[_0x0788('0x25')](_0x4f0005)[_0x0788('0x26')](function(_0x7a99a1){return _0x7a99a1;});}return null;};}function removeEntity(_0x5ba1da,_0x4d5c93){return function(_0x79204e){if(_0x79204e){return _0x79204e[_0x0788('0x27')]()[_0x0788('0x26')](function(){_0x5ba1da['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x240459,_0xa1f7dc){return function(_0x5f2dda){if(!_0x5f2dda){_0x240459['sendStatus'](0x194);}return _0x5f2dda;};}function handleError(_0x5a54a5,_0x44798c){_0x44798c=_0x44798c||0x1f4;return function(_0x57fda1){logger[_0x0788('0x28')](_0x57fda1[_0x0788('0x29')]);if(_0x57fda1[_0x0788('0x2a')]){delete _0x57fda1[_0x0788('0x2a')];}_0x5a54a5[_0x0788('0x1a')](_0x44798c)[_0x0788('0x2b')](_0x57fda1);};}exports[_0x0788('0x2c')]=function(_0x3ffe4f,_0x5b7594){var _0x5a5178={},_0x3c5246={},_0x40d345={'count':0x0,'rows':[]};var _0x54979a=_['map'](db[_0x0788('0x2d')][_0x0788('0x2e')],function(_0x20fcd8){return{'name':_0x20fcd8[_0x0788('0x2f')],'type':_0x20fcd8[_0x0788('0x30')][_0x0788('0x31')]};});_0x3c5246[_0x0788('0x32')]=_[_0x0788('0x33')](_0x54979a,_0x0788('0x2a'));_0x3c5246[_0x0788('0x34')]=_['keys'](_0x3ffe4f[_0x0788('0x34')]);_0x3c5246[_0x0788('0x35')]=_[_0x0788('0x36')](_0x3c5246[_0x0788('0x32')],_0x3c5246[_0x0788('0x34')]);_0x5a5178[_0x0788('0x37')]=_[_0x0788('0x36')](_0x3c5246[_0x0788('0x32')],qs[_0x0788('0x38')](_0x3ffe4f[_0x0788('0x34')]['fields']));_0x5a5178['attributes']=_0x5a5178['attributes']['length']?_0x5a5178['attributes']:_0x3c5246['model'];if(!_0x3ffe4f[_0x0788('0x34')][_0x0788('0x39')](_0x0788('0x3a'))){_0x5a5178['limit']=qs[_0x0788('0x1f')](_0x3ffe4f[_0x0788('0x34')][_0x0788('0x1f')]);_0x5a5178[_0x0788('0x1c')]=qs['offset'](_0x3ffe4f[_0x0788('0x34')]['offset']);}_0x5a5178[_0x0788('0x3b')]=qs['sort'](_0x3ffe4f[_0x0788('0x34')][_0x0788('0x3c')]);_0x5a5178['where']=qs[_0x0788('0x35')](_[_0x0788('0x3d')](_0x3ffe4f['query'],_0x3c5246[_0x0788('0x35')]),_0x54979a);if(_0x3ffe4f['query'][_0x0788('0x3e')]){_0x5a5178['where']=_[_0x0788('0x3f')](_0x5a5178['where'],{'$or':_[_0x0788('0x33')](_0x54979a,function(_0x57fec9){if(_0x57fec9['type']!==_0x0788('0x40')){var _0x68d9d4={};_0x68d9d4[_0x57fec9[_0x0788('0x2a')]]={'$like':'%'+_0x3ffe4f[_0x0788('0x34')][_0x0788('0x3e')]+'%'};return _0x68d9d4;}})});}_0x5a5178=_['merge']({},_0x5a5178,_0x3ffe4f['options']);var _0x530d83={'where':_0x5a5178['where']};return db[_0x0788('0x2d')][_0x0788('0x1e')](_0x530d83)[_0x0788('0x26')](function(_0x358a22){_0x40d345[_0x0788('0x1e')]=_0x358a22;if(_0x3ffe4f['query']['includeAll']){_0x5a5178[_0x0788('0x41')]=[{'all':!![]}];}return db[_0x0788('0x2d')][_0x0788('0x42')](_0x5a5178);})[_0x0788('0x26')](function(_0x236b63){_0x40d345[_0x0788('0x43')]=_0x236b63;return _0x40d345;})[_0x0788('0x26')](respondWithFilteredResult(_0x5b7594,_0x5a5178))[_0x0788('0x44')](handleError(_0x5b7594,null));};exports[_0x0788('0x45')]=function(_0x50e8f5,_0x5581e6){var _0x441aec={'raw':![],'where':{'id':_0x50e8f5[_0x0788('0x46')]['id']}},_0x1d579d={};_0x1d579d['model']=_['keys'](db['Integration'][_0x0788('0x2e')]);_0x1d579d[_0x0788('0x34')]=_[_0x0788('0x47')](_0x50e8f5[_0x0788('0x34')]);_0x1d579d[_0x0788('0x35')]=_[_0x0788('0x36')](_0x1d579d[_0x0788('0x32')],_0x1d579d[_0x0788('0x34')]);_0x441aec['attributes']=_[_0x0788('0x36')](_0x1d579d[_0x0788('0x32')],qs[_0x0788('0x38')](_0x50e8f5[_0x0788('0x34')]['fields']));_0x441aec[_0x0788('0x37')]=_0x441aec[_0x0788('0x37')]['length']?_0x441aec['attributes']:_0x1d579d['model'];if(_0x50e8f5[_0x0788('0x34')]['includeAll']){_0x441aec[_0x0788('0x41')]=[{'all':!![]}];}_0x441aec=_[_0x0788('0x3f')]({},_0x441aec,_0x50e8f5[_0x0788('0x48')]);return db[_0x0788('0x2d')][_0x0788('0x49')](_0x441aec)[_0x0788('0x26')](handleEntityNotFound(_0x5581e6,null))[_0x0788('0x26')](respondWithResult(_0x5581e6,null))[_0x0788('0x44')](handleError(_0x5581e6,null));};exports['create']=function(_0x4c6366,_0x39c3cc){return db[_0x0788('0x2d')][_0x0788('0x4a')](_0x4c6366['body'],{})[_0x0788('0x26')](respondWithResult(_0x39c3cc,0xc9))[_0x0788('0x44')](handleError(_0x39c3cc,null));};exports[_0x0788('0x25')]=function(_0x4563cd,_0x2395ad){if(_0x4563cd['body']['id']){delete _0x4563cd['body']['id'];}return db[_0x0788('0x2d')][_0x0788('0x49')]({'where':{'id':_0x4563cd['params']['id']}})[_0x0788('0x26')](handleEntityNotFound(_0x2395ad,null))['then'](saveUpdates(_0x4563cd[_0x0788('0x4b')],null))[_0x0788('0x26')](respondWithResult(_0x2395ad,null))[_0x0788('0x44')](handleError(_0x2395ad,null));};exports[_0x0788('0x27')]=function(_0x3c757a,_0x379928){return db[_0x0788('0x2d')][_0x0788('0x49')]({'where':{'id':_0x3c757a['params']['id']}})[_0x0788('0x26')](handleEntityNotFound(_0x379928,null))[_0x0788('0x26')](removeEntity(_0x379928,null))[_0x0788('0x44')](handleError(_0x379928,null));}; \ No newline at end of file +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(_0x4c7fb5,_0x2548ef){var _0x2e10ac=function(_0xf7e27c){while(--_0xf7e27c){_0x4c7fb5['push'](_0x4c7fb5['shift']());}};_0x2e10ac(++_0x2548ef);}(_0x5496,0x175));var _0x6549=function(_0x34577c,_0xe7cb97){_0x34577c=_0x34577c-0x0;var _0x19228c=_0x5496[_0x34577c];return _0x19228c;};'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 diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index d4e330e..757c32c 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 _0xed17=['util','api','moment','bluebird','request-promise','rimraf','./integration.attributes','exports','define','Integration','integrations'];(function(_0x47febd,_0x293e09){var _0x58b6f1=function(_0x5d33bf){while(--_0x5d33bf){_0x47febd['push'](_0x47febd['shift']());}};_0x58b6f1(++_0x293e09);}(_0xed17,0x1c3));var _0x7ed1=function(_0x353bbb,_0x56e1ab){_0x353bbb=_0x353bbb-0x0;var _0x4e6a0e=_0xed17[_0x353bbb];return _0x4e6a0e;};'use strict';var _=require('lodash');var util=require(_0x7ed1('0x0'));var logger=require('../../config/logger')(_0x7ed1('0x1'));var moment=require(_0x7ed1('0x2'));var BPromise=require(_0x7ed1('0x3'));var rp=require(_0x7ed1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7ed1('0x5'));var config=require('../../config/environment');var attributes=require(_0x7ed1('0x6'));module[_0x7ed1('0x7')]=function(_0x41d01c,_0xb3042a){return _0x41d01c[_0x7ed1('0x8')](_0x7ed1('0x9'),attributes,{'tableName':_0x7ed1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x75f9=['./integration.attributes','exports','Integration','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x4e9573,_0x115801){var _0x3b4cad=function(_0x1913aa){while(--_0x1913aa){_0x4e9573['push'](_0x4e9573['shift']());}};_0x3b4cad(++_0x115801);}(_0x75f9,0x175));var _0x975f=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0x75f9[_0x4dc7b9];return _0x3ab114;};'use strict';var _=require(_0x975f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x975f('0x1'));var moment=require(_0x975f('0x2'));var BPromise=require(_0x975f('0x3'));var rp=require(_0x975f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x975f('0x5'));var config=require(_0x975f('0x6'));var attributes=require(_0x975f('0x7'));module[_0x975f('0x8')]=function(_0xcd47ac,_0x549d54){return _0xcd47ac['define'](_0x975f('0x9'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 99ac0df..73584c3 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 _0x2542=['info','Integration,\x20%s,\x20%s','debug','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x21b7f5,_0x30e1d9){var _0x12727e=function(_0x1a92ce){while(--_0x1a92ce){_0x21b7f5['push'](_0x21b7f5['shift']());}};_0x12727e(++_0x30e1d9);}(_0x2542,0x169));var _0x2254=function(_0x3e9416,_0x19b129){_0x3e9416=_0x3e9416-0x0;var _0x3b2898=_0x2542[_0x3e9416];return _0x3b2898;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var moment=require(_0x2254('0x2'));var BPromise=require(_0x2254('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2254('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2254('0x5'));var logger=require(_0x2254('0x6'))(_0x2254('0x7'));var config=require(_0x2254('0x8'));var jayson=require(_0x2254('0x9'));var client=jayson['client'][_0x2254('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe8ca50,_0x2ee7ee,_0x3c45ec){return new BPromise(function(_0x1637ad,_0x477b47){return client[_0x2254('0xb')](_0xe8ca50,_0x3c45ec)[_0x2254('0xc')](function(_0xb395da){logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,'request\x20sent');logger[_0x2254('0xf')](_0x2254('0x10'),_0x2ee7ee,_0x2254('0x11'),JSON[_0x2254('0x12')](_0xb395da));if(_0xb395da['error']){if(_0xb395da['error'][_0x2254('0x13')]===0x1f4){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);return _0x477b47(_0xb395da[_0x2254('0x14')]['message']);}logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da['error'][_0x2254('0x15')]);return _0x1637ad(_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);}else{logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,_0x2254('0x11'));_0x1637ad(_0xb395da['result'][_0x2254('0x15')]);}})['catch'](function(_0x327d6d){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0x327d6d);_0x477b47(_0x327d6d);});});} \ No newline at end of file +var _0xda2d=['bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','then','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','util','moment'];(function(_0x43ac7e,_0x69d02){var _0x404460=function(_0x19a005){while(--_0x19a005){_0x43ac7e['push'](_0x43ac7e['shift']());}};_0x404460(++_0x69d02);}(_0xda2d,0x102));var _0xdda2=function(_0x419719,_0x461b48){_0x419719=_0x419719-0x0;var _0x3b2c85=_0xda2d[_0x419719];return _0x3b2c85;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var moment=require(_0xdda2('0x1'));var BPromise=require(_0xdda2('0x2'));var rs=require(_0xdda2('0x3'));var fs=require('fs');var Redis=require(_0xdda2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdda2('0x5'));var config=require(_0xdda2('0x6'));var jayson=require(_0xdda2('0x7'));var client=jayson[_0xdda2('0x8')][_0xdda2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf38e58,_0x2f55dc,_0x436676){return new BPromise(function(_0x2e2523,_0x341c7b){return client['request'](_0xf38e58,_0x436676)[_0xdda2('0xa')](function(_0x22c6e5){logger['info'](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));logger[_0xdda2('0xd')](_0xdda2('0xe'),_0x2f55dc,_0xdda2('0xc'),JSON[_0xdda2('0xf')](_0x22c6e5));if(_0x22c6e5[_0xdda2('0x10')]){if(_0x22c6e5[_0xdda2('0x10')]['code']===0x1f4){logger['error']('Integration,\x20%s,\x20%s',_0x2f55dc,_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);return _0x341c7b(_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);}logger[_0xdda2('0x10')](_0xdda2('0xb'),_0x2f55dc,_0x22c6e5[_0xdda2('0x10')]['message']);return _0x2e2523(_0x22c6e5[_0xdda2('0x10')]['message']);}else{logger[_0xdda2('0x12')](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));_0x2e2523(_0x22c6e5[_0xdda2('0x13')][_0xdda2('0x11')]);}})['catch'](function(_0x55d674){logger[_0xdda2('0x10')]('Integration,\x20%s,\x20%s',_0x2f55dc,_0x55d674);_0x341c7b(_0x55d674);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index ff0c2a2..0e96a9f 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 _0xba34=['exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete'];(function(_0x4dcc75,_0x82e80d){var _0xe3cb6=function(_0x3bd63c){while(--_0x3bd63c){_0x4dcc75['push'](_0x4dcc75['shift']());}};_0xe3cb6(++_0x82e80d);}(_0xba34,0x119));var _0x4ba3=function(_0x3f39b6,_0x3fe3e4){_0x3f39b6=_0x3f39b6-0x0;var _0xe15baa=_0xba34[_0x3f39b6];return _0xe15baa;};'use strict';var multer=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var path=require(_0x4ba3('0x2'));var timeout=require(_0x4ba3('0x3'));var express=require(_0x4ba3('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4ba3('0x5'));var config=require(_0x4ba3('0x6'));var controller=require(_0x4ba3('0x7'));router[_0x4ba3('0x8')]('/',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xa')]);router[_0x4ba3('0x8')]('/describe',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xb')]);router[_0x4ba3('0x8')](_0x4ba3('0xc'),auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xd')]);router[_0x4ba3('0xe')]('/',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xf')]);router[_0x4ba3('0x10')](_0x4ba3('0xc'),auth['isAuthenticated'](),controller[_0x4ba3('0x11')]);router[_0x4ba3('0x12')]('/:id',auth[_0x4ba3('0x9')](),controller['destroy']);module[_0x4ba3('0x13')]=router; \ No newline at end of file +var _0x5f66=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','create','put','update','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x5f66[_0x3947c9];return _0x2e7871;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./integrationReport.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['show']);router['post']('/',auth[_0x65f6('0x8')](),controller[_0x65f6('0xc')]);router[_0x65f6('0xd')](_0x65f6('0xb'),auth['isAuthenticated'](),controller[_0x65f6('0xe')]);router['delete']('/:id',auth[_0x65f6('0x8')](),controller['destroy']);module[_0x65f6('0xf')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index a81d36e..5385b9a 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 _0x04f9=['DATE','BOOLEAN','TEXT','ENUM','SENT','FAILED','sequelize','STRING','INTEGER'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x04f9,0xd5));var _0x904f=function(_0x2f0d60,_0x5df10b){_0x2f0d60=_0x2f0d60-0x0;var _0x3c4400=_0x04f9[_0x2f0d60];return _0x3c4400;};'use strict';var Sequelize=require(_0x904f('0x0'));module['exports']={'integration':{'type':Sequelize[_0x904f('0x1')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x904f('0x1')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x904f('0x2')]},'contacts':{'type':Sequelize[_0x904f('0x1')]},'uniqueid':{'type':Sequelize[_0x904f('0x1')]},'calleridnum':{'type':Sequelize[_0x904f('0x1')]},'calleridname':{'type':Sequelize[_0x904f('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x904f('0x3')]},'agentconnectAt':{'type':Sequelize[_0x904f('0x3')]},'holdtime':{'type':Sequelize[_0x904f('0x2')]},'agentcomplete':{'type':Sequelize[_0x904f('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x904f('0x3')]},'talktime':{'type':Sequelize[_0x904f('0x2')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0x904f('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x904f('0x3')]},'agentdump':{'type':Sequelize[_0x904f('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x904f('0x3')]},'lastevent':{'type':Sequelize[_0x904f('0x1')]},'channel':{'type':Sequelize[_0x904f('0x1')]},'channelstate':{'type':Sequelize[_0x904f('0x2')]},'channelstatedesc':{'type':Sequelize[_0x904f('0x1')]},'connectedlinenum':{'type':Sequelize[_0x904f('0x1')]},'connectedlinename':{'type':Sequelize[_0x904f('0x1')]},'language':{'type':Sequelize[_0x904f('0x1')]},'accountcode':{'type':Sequelize[_0x904f('0x1')]},'context':{'type':Sequelize[_0x904f('0x1')]},'exten':{'type':Sequelize[_0x904f('0x1')]},'priority':{'type':Sequelize[_0x904f('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x904f('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x904f('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x904f('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x904f('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x904f('0x1')]},'destlanguage':{'type':Sequelize[_0x904f('0x1')]},'destaccountcode':{'type':Sequelize[_0x904f('0x1')]},'destcontext':{'type':Sequelize[_0x904f('0x1')]},'destexten':{'type':Sequelize[_0x904f('0x1')]},'destpriority':{'type':Sequelize[_0x904f('0x1')]},'destuniqueid':{'type':Sequelize[_0x904f('0x1')]},'messageId':{'type':Sequelize[_0x904f('0x1')]},'inReplyTo':{'type':Sequelize[_0x904f('0x1')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x904f('0x1')]},'cc':{'type':Sequelize[_0x904f('0x1')]},'attachment':{'type':Sequelize[_0x904f('0x5')]},'html':{'type':Sequelize[_0x904f('0x5')]},'text':{'type':Sequelize[_0x904f('0x5')]},'status':{'type':Sequelize[_0x904f('0x6')](_0x904f('0x7'),'SENDING','RECEIVED',_0x904f('0x8'))},'url':{'type':Sequelize[_0x904f('0x1')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xc3d3=['DATE','BOOLEAN','TEXT','SENT','SENDING','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0xc3d3,0x1b4));var _0x3c3d=function(_0x298763,_0x33fecf){_0x298763=_0x298763-0x0;var _0x5b48c4=_0xc3d3[_0x298763];return _0x5b48c4;};'use strict';var Sequelize=require(_0x3c3d('0x0'));module[_0x3c3d('0x1')]={'integration':{'type':Sequelize[_0x3c3d('0x2')]},'eventChannel':{'type':Sequelize[_0x3c3d('0x2')]},'exitStatus':{'type':Sequelize[_0x3c3d('0x2')]},'ticketId':{'type':Sequelize[_0x3c3d('0x2')]},'integrationId':{'type':Sequelize[_0x3c3d('0x3')]},'contacts':{'type':Sequelize[_0x3c3d('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x3c3d('0x2')]},'calleridname':{'type':Sequelize[_0x3c3d('0x2')]},'queue':{'type':Sequelize[_0x3c3d('0x2')]},'interface':{'type':Sequelize[_0x3c3d('0x2')]},'membername':{'type':Sequelize[_0x3c3d('0x2')]},'agentcalledAt':{'type':Sequelize[_0x3c3d('0x4')]},'agentconnectAt':{'type':Sequelize[_0x3c3d('0x4')]},'holdtime':{'type':Sequelize[_0x3c3d('0x3')]},'agentcomplete':{'type':Sequelize[_0x3c3d('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x3c3d('0x4')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x3c3d('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x3c3d('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x3c3d('0x2')]},'channel':{'type':Sequelize[_0x3c3d('0x2')]},'channelstate':{'type':Sequelize[_0x3c3d('0x3')]},'channelstatedesc':{'type':Sequelize[_0x3c3d('0x2')]},'connectedlinenum':{'type':Sequelize[_0x3c3d('0x2')]},'connectedlinename':{'type':Sequelize[_0x3c3d('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x3c3d('0x2')]},'context':{'type':Sequelize[_0x3c3d('0x2')]},'exten':{'type':Sequelize[_0x3c3d('0x2')]},'priority':{'type':Sequelize[_0x3c3d('0x2')]},'destchannel':{'type':Sequelize[_0x3c3d('0x2')]},'destchannelstate':{'type':Sequelize[_0x3c3d('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x3c3d('0x2')]},'destcalleridnum':{'type':Sequelize[_0x3c3d('0x2')]},'destcalleridname':{'type':Sequelize[_0x3c3d('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x3c3d('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x3c3d('0x2')]},'destlanguage':{'type':Sequelize[_0x3c3d('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x3c3d('0x2')]},'destexten':{'type':Sequelize[_0x3c3d('0x2')]},'destpriority':{'type':Sequelize[_0x3c3d('0x2')]},'destuniqueid':{'type':Sequelize[_0x3c3d('0x2')]},'messageId':{'type':Sequelize[_0x3c3d('0x2')]},'inReplyTo':{'type':Sequelize[_0x3c3d('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x3c3d('0x2')]},'to':{'type':Sequelize[_0x3c3d('0x2')]},'cc':{'type':Sequelize[_0x3c3d('0x2')]},'attachment':{'type':Sequelize[_0x3c3d('0x6')]},'html':{'type':Sequelize[_0x3c3d('0x6')]},'text':{'type':Sequelize[_0x3c3d('0x6')]},'status':{'type':Sequelize['ENUM'](_0x3c3d('0x7'),_0x3c3d('0x8'),_0x3c3d('0x9'),_0x3c3d('0xa'))},'url':{'type':Sequelize[_0x3c3d('0x2')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x3c3d('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index df87c5c..52fd68d 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 _0xac27=['map','rawAttributes','type','key','model','intersection','attributes','length','query','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','merge','VIRTUAL','IntegrationReport','includeAll','include','findAll','rows','catch','params','keys','options','create','body','find','describe','eml-format','rimraf','request-promise','moment','bluebird','util','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','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index'];(function(_0x506401,_0x49d3c8){var _0x3370d0=function(_0x422bc9){while(--_0x422bc9){_0x506401['push'](_0x506401['shift']());}};_0x3370d0(++_0x49d3c8);}(_0xac27,0x1e8));var _0x7ac2=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xac27[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require(_0x7ac2('0x0'));var rimraf=require(_0x7ac2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7ac2('0x2'));var moment=require(_0x7ac2('0x3'));var BPromise=require(_0x7ac2('0x4'));var Mustache=require('mustache');var util=require(_0x7ac2('0x5'));var path=require('path');var sox=require(_0x7ac2('0x6'));var csv=require('to-csv');var ejs=require(_0x7ac2('0x7'));var fs=require('fs');var fs_extra=require(_0x7ac2('0x8'));var _=require(_0x7ac2('0x9'));var squel=require(_0x7ac2('0xa'));var crypto=require(_0x7ac2('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7ac2('0xc'));var toCsv=require(_0x7ac2('0xd'));var querystring=require(_0x7ac2('0xe'));var Papa=require(_0x7ac2('0xf'));var Redis=require(_0x7ac2('0x10'));var authService=require(_0x7ac2('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7ac2('0x12'));var hardwareService=require(_0x7ac2('0x13'));var logger=require(_0x7ac2('0x14'))(_0x7ac2('0x15'));var utils=require(_0x7ac2('0x16'));var config=require(_0x7ac2('0x17'));var licenseUtil=require(_0x7ac2('0x18'));var db=require(_0x7ac2('0x19'))['db'];function respondWithStatusCode(_0x17a036,_0x49b61a){_0x49b61a=_0x49b61a||0xcc;return function(_0xa2925e){if(_0xa2925e){return _0x17a036[_0x7ac2('0x1a')](_0x49b61a);}return _0x17a036[_0x7ac2('0x1b')](_0x49b61a)[_0x7ac2('0x1c')]();};}function respondWithResult(_0x1a0a4e,_0x50763d){_0x50763d=_0x50763d||0xc8;return function(_0x3f5bda){if(_0x3f5bda){return _0x1a0a4e[_0x7ac2('0x1b')](_0x50763d)[_0x7ac2('0x1d')](_0x3f5bda);}};}function respondWithFilteredResult(_0xde92b9,_0x460fa3){return function(_0x3585cb){if(_0x3585cb){var _0xab57e3=typeof _0x460fa3[_0x7ac2('0x1e')]===_0x7ac2('0x1f')&&typeof _0x460fa3['limit']===_0x7ac2('0x1f');var _0x216fbc=_0x3585cb['count'];var _0x5767e8=_0xab57e3?0x0:_0x460fa3[_0x7ac2('0x1e')];var _0x4a856e=_0xab57e3?_0x3585cb[_0x7ac2('0x20')]:_0x460fa3[_0x7ac2('0x1e')]+_0x460fa3['limit'];var _0x3853ce;if(_0x4a856e>=_0x216fbc){_0x4a856e=_0x216fbc;_0x3853ce=0xc8;}else{_0x3853ce=0xce;}_0xde92b9[_0x7ac2('0x1b')](_0x3853ce);return _0xde92b9['set'](_0x7ac2('0x21'),_0x5767e8+'-'+_0x4a856e+'/'+_0x216fbc)[_0x7ac2('0x1d')](_0x3585cb);}return null;};}function patchUpdates(_0x1bd9b4){return function(_0x477710){try{jsonpatch[_0x7ac2('0x22')](_0x477710,_0x1bd9b4,!![]);}catch(_0x2a602e){return BPromise[_0x7ac2('0x23')](_0x2a602e);}return _0x477710[_0x7ac2('0x24')]();};}function saveUpdates(_0x418aac,_0x378b89){return function(_0x5124df){if(_0x5124df){return _0x5124df[_0x7ac2('0x25')](_0x418aac)[_0x7ac2('0x26')](function(_0x509fc2){return _0x509fc2;});}return null;};}function removeEntity(_0x1541e4,_0x482768){return function(_0x77c5dc){if(_0x77c5dc){return _0x77c5dc[_0x7ac2('0x27')]()['then'](function(){_0x1541e4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x53b300,_0xeae080){return function(_0x1c4ad2){if(!_0x1c4ad2){_0x53b300['sendStatus'](0x194);}return _0x1c4ad2;};}function handleError(_0x115dfc,_0x142023){_0x142023=_0x142023||0x1f4;return function(_0x551bec){logger[_0x7ac2('0x28')](_0x551bec['stack']);if(_0x551bec[_0x7ac2('0x29')]){delete _0x551bec[_0x7ac2('0x29')];}_0x115dfc[_0x7ac2('0x1b')](_0x142023)[_0x7ac2('0x2a')](_0x551bec);};}exports[_0x7ac2('0x2b')]=function(_0x5284fa,_0x4281e9){var _0x231cf8={},_0x4483e5={},_0x1965c2={'count':0x0,'rows':[]};var _0x4e2b64=_[_0x7ac2('0x2c')](db['IntegrationReport'][_0x7ac2('0x2d')],function(_0x4f8a1c){return{'name':_0x4f8a1c['fieldName'],'type':_0x4f8a1c[_0x7ac2('0x2e')][_0x7ac2('0x2f')]};});_0x4483e5[_0x7ac2('0x30')]=_['map'](_0x4e2b64,_0x7ac2('0x29'));_0x4483e5['query']=_['keys'](_0x5284fa['query']);_0x4483e5['filters']=_[_0x7ac2('0x31')](_0x4483e5['model'],_0x4483e5['query']);_0x231cf8[_0x7ac2('0x32')]=_['intersection'](_0x4483e5['model'],qs['fields'](_0x5284fa['query']['fields']));_0x231cf8[_0x7ac2('0x32')]=_0x231cf8[_0x7ac2('0x32')][_0x7ac2('0x33')]?_0x231cf8[_0x7ac2('0x32')]:_0x4483e5['model'];if(!_0x5284fa[_0x7ac2('0x34')][_0x7ac2('0x35')](_0x7ac2('0x36'))){_0x231cf8[_0x7ac2('0x37')]=qs['limit'](_0x5284fa[_0x7ac2('0x34')]['limit']);_0x231cf8[_0x7ac2('0x1e')]=qs[_0x7ac2('0x1e')](_0x5284fa[_0x7ac2('0x34')][_0x7ac2('0x1e')]);}_0x231cf8['order']=qs[_0x7ac2('0x38')](_0x5284fa['query'][_0x7ac2('0x38')]);_0x231cf8[_0x7ac2('0x39')]=qs[_0x7ac2('0x3a')](_[_0x7ac2('0x3b')](_0x5284fa[_0x7ac2('0x34')],_0x4483e5['filters']),_0x4e2b64);if(_0x5284fa[_0x7ac2('0x34')][_0x7ac2('0x3c')]){_0x231cf8[_0x7ac2('0x39')]=_[_0x7ac2('0x3d')](_0x231cf8[_0x7ac2('0x39')],{'$or':_[_0x7ac2('0x2c')](_0x4e2b64,function(_0x5ba22d){if(_0x5ba22d[_0x7ac2('0x2e')]!==_0x7ac2('0x3e')){var _0xf6f95e={};_0xf6f95e[_0x5ba22d['name']]={'$like':'%'+_0x5284fa['query'][_0x7ac2('0x3c')]+'%'};return _0xf6f95e;}})});}_0x231cf8=_[_0x7ac2('0x3d')]({},_0x231cf8,_0x5284fa['options']);var _0x3d2363={'where':_0x231cf8['where']};return db[_0x7ac2('0x3f')][_0x7ac2('0x20')](_0x3d2363)[_0x7ac2('0x26')](function(_0x2bf0c2){_0x1965c2[_0x7ac2('0x20')]=_0x2bf0c2;if(_0x5284fa[_0x7ac2('0x34')][_0x7ac2('0x40')]){_0x231cf8[_0x7ac2('0x41')]=[{'all':!![]}];}return db[_0x7ac2('0x3f')][_0x7ac2('0x42')](_0x231cf8);})[_0x7ac2('0x26')](function(_0x3e4180){_0x1965c2[_0x7ac2('0x43')]=_0x3e4180;return _0x1965c2;})['then'](respondWithFilteredResult(_0x4281e9,_0x231cf8))[_0x7ac2('0x44')](handleError(_0x4281e9,null));};exports['show']=function(_0x1f210d,_0x1dd242){var _0x168b2d={'raw':![],'where':{'id':_0x1f210d[_0x7ac2('0x45')]['id']}},_0x36c677={};_0x36c677[_0x7ac2('0x30')]=_[_0x7ac2('0x46')](db['IntegrationReport'][_0x7ac2('0x2d')]);_0x36c677['query']=_[_0x7ac2('0x46')](_0x1f210d[_0x7ac2('0x34')]);_0x36c677[_0x7ac2('0x3a')]=_['intersection'](_0x36c677[_0x7ac2('0x30')],_0x36c677[_0x7ac2('0x34')]);_0x168b2d[_0x7ac2('0x32')]=_[_0x7ac2('0x31')](_0x36c677[_0x7ac2('0x30')],qs['fields'](_0x1f210d['query']['fields']));_0x168b2d[_0x7ac2('0x32')]=_0x168b2d['attributes']['length']?_0x168b2d[_0x7ac2('0x32')]:_0x36c677[_0x7ac2('0x30')];if(_0x1f210d['query']['includeAll']){_0x168b2d[_0x7ac2('0x41')]=[{'all':!![]}];}_0x168b2d=_[_0x7ac2('0x3d')]({},_0x168b2d,_0x1f210d[_0x7ac2('0x47')]);return db[_0x7ac2('0x3f')]['find'](_0x168b2d)[_0x7ac2('0x26')](handleEntityNotFound(_0x1dd242,null))[_0x7ac2('0x26')](respondWithResult(_0x1dd242,null))[_0x7ac2('0x44')](handleError(_0x1dd242,null));};exports[_0x7ac2('0x48')]=function(_0x36e33c,_0x17a0c5){return db[_0x7ac2('0x3f')][_0x7ac2('0x48')](_0x36e33c['body'],{})[_0x7ac2('0x26')](respondWithResult(_0x17a0c5,0xc9))[_0x7ac2('0x44')](handleError(_0x17a0c5,null));};exports[_0x7ac2('0x25')]=function(_0x24145e,_0x2bb94a){if(_0x24145e[_0x7ac2('0x49')]['id']){delete _0x24145e[_0x7ac2('0x49')]['id'];}return db[_0x7ac2('0x3f')][_0x7ac2('0x4a')]({'where':{'id':_0x24145e[_0x7ac2('0x45')]['id']}})[_0x7ac2('0x26')](handleEntityNotFound(_0x2bb94a,null))[_0x7ac2('0x26')](saveUpdates(_0x24145e[_0x7ac2('0x49')],null))[_0x7ac2('0x26')](respondWithResult(_0x2bb94a,null))[_0x7ac2('0x44')](handleError(_0x2bb94a,null));};exports[_0x7ac2('0x27')]=function(_0x5a5f44,_0x5f52b5){return db['IntegrationReport'][_0x7ac2('0x4a')]({'where':{'id':_0x5a5f44['params']['id']}})[_0x7ac2('0x26')](handleEntityNotFound(_0x5f52b5,null))[_0x7ac2('0x26')](removeEntity(_0x5f52b5,null))['catch'](handleError(_0x5f52b5,null));};exports[_0x7ac2('0x4b')]=function(_0x3c5524,_0x51790d){return db['IntegrationReport'][_0x7ac2('0x4b')]()[_0x7ac2('0x26')](respondWithResult(_0x51790d,null))[_0x7ac2('0x44')](handleError(_0x51790d,null));}; \ No newline at end of file +var _0xb467=['include','findAll','rows','catch','show','params','intersection','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','map','IntegrationReport','rawAttributes','fieldName','key','model','name','keys','query','filters','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll'];(function(_0x695fe5,_0x26ab1f){var _0x562d72=function(_0x4d6605){while(--_0x4d6605){_0x695fe5['push'](_0x695fe5['shift']());}};_0x562d72(++_0x26ab1f);}(_0xb467,0xf5));var _0x7b46=function(_0x1f5a63,_0x511504){_0x1f5a63=_0x1f5a63-0x0;var _0x30bb7a=_0xb467[_0x1f5a63];return _0x30bb7a;};'use strict';var emlformat=require(_0x7b46('0x0'));var rimraf=require(_0x7b46('0x1'));var zipdir=require(_0x7b46('0x2'));var jsonpatch=require(_0x7b46('0x3'));var rp=require('request-promise');var moment=require(_0x7b46('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7b46('0x5'));var util=require('util');var path=require('path');var sox=require(_0x7b46('0x6'));var csv=require(_0x7b46('0x7'));var ejs=require(_0x7b46('0x8'));var fs=require('fs');var fs_extra=require(_0x7b46('0x9'));var _=require(_0x7b46('0xa'));var squel=require(_0x7b46('0xb'));var crypto=require(_0x7b46('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7b46('0x7'));var querystring=require(_0x7b46('0xd'));var Papa=require(_0x7b46('0xe'));var Redis=require(_0x7b46('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7b46('0x10'));var as=require(_0x7b46('0x11'));var hardwareService=require(_0x7b46('0x12'));var logger=require('../../config/logger')(_0x7b46('0x13'));var utils=require('../../config/utils');var config=require(_0x7b46('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x7b46('0x15'))['db'];function respondWithStatusCode(_0x7ce80c,_0x1c2c5b){_0x1c2c5b=_0x1c2c5b||0xcc;return function(_0x5547fe){if(_0x5547fe){return _0x7ce80c[_0x7b46('0x16')](_0x1c2c5b);}return _0x7ce80c[_0x7b46('0x17')](_0x1c2c5b)[_0x7b46('0x18')]();};}function respondWithResult(_0xc4828,_0xd8c4f3){_0xd8c4f3=_0xd8c4f3||0xc8;return function(_0x280cdb){if(_0x280cdb){return _0xc4828[_0x7b46('0x17')](_0xd8c4f3)[_0x7b46('0x19')](_0x280cdb);}};}function respondWithFilteredResult(_0x70ac01,_0x565ad8){return function(_0x4f0b3b){if(_0x4f0b3b){var _0x415e14=typeof _0x565ad8[_0x7b46('0x1a')]===_0x7b46('0x1b')&&typeof _0x565ad8[_0x7b46('0x1c')]===_0x7b46('0x1b');var _0x526848=_0x4f0b3b[_0x7b46('0x1d')];var _0x174c38=_0x415e14?0x0:_0x565ad8[_0x7b46('0x1a')];var _0x2dda41=_0x415e14?_0x4f0b3b['count']:_0x565ad8['offset']+_0x565ad8[_0x7b46('0x1c')];var _0x565e06;if(_0x2dda41>=_0x526848){_0x2dda41=_0x526848;_0x565e06=0xc8;}else{_0x565e06=0xce;}_0x70ac01[_0x7b46('0x17')](_0x565e06);return _0x70ac01[_0x7b46('0x1e')](_0x7b46('0x1f'),_0x174c38+'-'+_0x2dda41+'/'+_0x526848)[_0x7b46('0x19')](_0x4f0b3b);}return null;};}function patchUpdates(_0x31731d){return function(_0x542ed3){try{jsonpatch[_0x7b46('0x20')](_0x542ed3,_0x31731d,!![]);}catch(_0x294b2a){return BPromise[_0x7b46('0x21')](_0x294b2a);}return _0x542ed3[_0x7b46('0x22')]();};}function saveUpdates(_0x195253,_0x4e72f9){return function(_0x464d10){if(_0x464d10){return _0x464d10[_0x7b46('0x23')](_0x195253)[_0x7b46('0x24')](function(_0x1e4d1c){return _0x1e4d1c;});}return null;};}function removeEntity(_0x489633,_0x2516c7){return function(_0x57b35a){if(_0x57b35a){return _0x57b35a[_0x7b46('0x25')]()[_0x7b46('0x24')](function(){_0x489633[_0x7b46('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x391f07,_0x44a6ac){return function(_0x3b5ed1){if(!_0x3b5ed1){_0x391f07['sendStatus'](0x194);}return _0x3b5ed1;};}function handleError(_0x5e4af3,_0x2148db){_0x2148db=_0x2148db||0x1f4;return function(_0x32b630){logger[_0x7b46('0x26')](_0x32b630[_0x7b46('0x27')]);if(_0x32b630['name']){delete _0x32b630['name'];}_0x5e4af3[_0x7b46('0x17')](_0x2148db)[_0x7b46('0x28')](_0x32b630);};}exports[_0x7b46('0x29')]=function(_0x4aa243,_0x3223a8){var _0x32b9ec={},_0x419005={},_0x586ae1={'count':0x0,'rows':[]};var _0x1b4e42=_[_0x7b46('0x2a')](db[_0x7b46('0x2b')][_0x7b46('0x2c')],function(_0x16f995){return{'name':_0x16f995[_0x7b46('0x2d')],'type':_0x16f995['type'][_0x7b46('0x2e')]};});_0x419005[_0x7b46('0x2f')]=_[_0x7b46('0x2a')](_0x1b4e42,_0x7b46('0x30'));_0x419005['query']=_[_0x7b46('0x31')](_0x4aa243[_0x7b46('0x32')]);_0x419005[_0x7b46('0x33')]=_['intersection'](_0x419005['model'],_0x419005[_0x7b46('0x32')]);_0x32b9ec['attributes']=_['intersection'](_0x419005['model'],qs['fields'](_0x4aa243[_0x7b46('0x32')][_0x7b46('0x34')]));_0x32b9ec['attributes']=_0x32b9ec['attributes'][_0x7b46('0x35')]?_0x32b9ec[_0x7b46('0x36')]:_0x419005[_0x7b46('0x2f')];if(!_0x4aa243[_0x7b46('0x32')][_0x7b46('0x37')](_0x7b46('0x38'))){_0x32b9ec[_0x7b46('0x1c')]=qs[_0x7b46('0x1c')](_0x4aa243[_0x7b46('0x32')]['limit']);_0x32b9ec[_0x7b46('0x1a')]=qs['offset'](_0x4aa243['query'][_0x7b46('0x1a')]);}_0x32b9ec[_0x7b46('0x39')]=qs[_0x7b46('0x3a')](_0x4aa243[_0x7b46('0x32')][_0x7b46('0x3a')]);_0x32b9ec[_0x7b46('0x3b')]=qs[_0x7b46('0x33')](_[_0x7b46('0x3c')](_0x4aa243[_0x7b46('0x32')],_0x419005['filters']),_0x1b4e42);if(_0x4aa243[_0x7b46('0x32')][_0x7b46('0x3d')]){_0x32b9ec[_0x7b46('0x3b')]=_[_0x7b46('0x3e')](_0x32b9ec[_0x7b46('0x3b')],{'$or':_[_0x7b46('0x2a')](_0x1b4e42,function(_0x1d3ab5){if(_0x1d3ab5[_0x7b46('0x3f')]!==_0x7b46('0x40')){var _0xe1ce93={};_0xe1ce93[_0x1d3ab5['name']]={'$like':'%'+_0x4aa243[_0x7b46('0x32')]['filter']+'%'};return _0xe1ce93;}})});}_0x32b9ec=_[_0x7b46('0x3e')]({},_0x32b9ec,_0x4aa243[_0x7b46('0x41')]);var _0x5a2888={'where':_0x32b9ec[_0x7b46('0x3b')]};return db[_0x7b46('0x2b')][_0x7b46('0x1d')](_0x5a2888)[_0x7b46('0x24')](function(_0x190c83){_0x586ae1[_0x7b46('0x1d')]=_0x190c83;if(_0x4aa243['query'][_0x7b46('0x42')]){_0x32b9ec[_0x7b46('0x43')]=[{'all':!![]}];}return db[_0x7b46('0x2b')][_0x7b46('0x44')](_0x32b9ec);})['then'](function(_0x414b85){_0x586ae1[_0x7b46('0x45')]=_0x414b85;return _0x586ae1;})[_0x7b46('0x24')](respondWithFilteredResult(_0x3223a8,_0x32b9ec))[_0x7b46('0x46')](handleError(_0x3223a8,null));};exports[_0x7b46('0x47')]=function(_0x52fcee,_0x1c843e){var _0x1138ba={'raw':![],'where':{'id':_0x52fcee[_0x7b46('0x48')]['id']}},_0x4ece58={};_0x4ece58[_0x7b46('0x2f')]=_['keys'](db[_0x7b46('0x2b')][_0x7b46('0x2c')]);_0x4ece58[_0x7b46('0x32')]=_[_0x7b46('0x31')](_0x52fcee[_0x7b46('0x32')]);_0x4ece58[_0x7b46('0x33')]=_[_0x7b46('0x49')](_0x4ece58[_0x7b46('0x2f')],_0x4ece58[_0x7b46('0x32')]);_0x1138ba['attributes']=_[_0x7b46('0x49')](_0x4ece58[_0x7b46('0x2f')],qs[_0x7b46('0x34')](_0x52fcee[_0x7b46('0x32')]['fields']));_0x1138ba[_0x7b46('0x36')]=_0x1138ba[_0x7b46('0x36')][_0x7b46('0x35')]?_0x1138ba[_0x7b46('0x36')]:_0x4ece58[_0x7b46('0x2f')];if(_0x52fcee['query'][_0x7b46('0x42')]){_0x1138ba[_0x7b46('0x43')]=[{'all':!![]}];}_0x1138ba=_[_0x7b46('0x3e')]({},_0x1138ba,_0x52fcee['options']);return db[_0x7b46('0x2b')]['find'](_0x1138ba)[_0x7b46('0x24')](handleEntityNotFound(_0x1c843e,null))['then'](respondWithResult(_0x1c843e,null))['catch'](handleError(_0x1c843e,null));};exports[_0x7b46('0x4a')]=function(_0x1face1,_0x244e2b){return db[_0x7b46('0x2b')][_0x7b46('0x4a')](_0x1face1[_0x7b46('0x4b')],{})[_0x7b46('0x24')](respondWithResult(_0x244e2b,0xc9))[_0x7b46('0x46')](handleError(_0x244e2b,null));};exports[_0x7b46('0x23')]=function(_0x4a7a89,_0x6d7485){if(_0x4a7a89[_0x7b46('0x4b')]['id']){delete _0x4a7a89[_0x7b46('0x4b')]['id'];}return db[_0x7b46('0x2b')][_0x7b46('0x4c')]({'where':{'id':_0x4a7a89['params']['id']}})[_0x7b46('0x24')](handleEntityNotFound(_0x6d7485,null))[_0x7b46('0x24')](saveUpdates(_0x4a7a89[_0x7b46('0x4b')],null))[_0x7b46('0x24')](respondWithResult(_0x6d7485,null))['catch'](handleError(_0x6d7485,null));};exports['destroy']=function(_0x62a0d4,_0x4d7493){return db[_0x7b46('0x2b')][_0x7b46('0x4c')]({'where':{'id':_0x62a0d4[_0x7b46('0x48')]['id']}})[_0x7b46('0x24')](handleEntityNotFound(_0x4d7493,null))[_0x7b46('0x24')](removeEntity(_0x4d7493,null))[_0x7b46('0x46')](handleError(_0x4d7493,null));};exports[_0x7b46('0x4d')]=function(_0x3c02e5,_0x5ebae8){return db['IntegrationReport'][_0x7b46('0x4d')]()[_0x7b46('0x24')](respondWithResult(_0x5ebae8,null))['catch'](handleError(_0x5ebae8,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 778da72..57c7994 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 _0x414f=['request-promise','path','rimraf','../../config/environment','exports','define','IntegrationReport','lodash','util','api','moment','bluebird'];(function(_0x2b0690,_0x9b49a6){var _0x3826f5=function(_0x1b17cc){while(--_0x1b17cc){_0x2b0690['push'](_0x2b0690['shift']());}};_0x3826f5(++_0x9b49a6);}(_0x414f,0xd3));var _0xf414=function(_0x25662e,_0x4cec68){_0x25662e=_0x25662e-0x0;var _0x59b7bc=_0x414f[_0x25662e];return _0x59b7bc;};'use strict';var _=require(_0xf414('0x0'));var util=require(_0xf414('0x1'));var logger=require('../../config/logger')(_0xf414('0x2'));var moment=require(_0xf414('0x3'));var BPromise=require(_0xf414('0x4'));var rp=require(_0xf414('0x5'));var fs=require('fs');var path=require(_0xf414('0x6'));var rimraf=require(_0xf414('0x7'));var config=require(_0xf414('0x8'));var attributes=require('./integrationReport.attributes');module[_0xf414('0x9')]=function(_0x2abaf3,_0x32fe13){return _0x2abaf3[_0xf414('0xa')](_0xf414('0xb'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd1fa=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','IntegrationReport','report_integration','lodash','util'];(function(_0x590a38,_0x2bc65c){var _0xf36626=function(_0x551cd1){while(--_0x551cd1){_0x590a38['push'](_0x590a38['shift']());}};_0xf36626(++_0x2bc65c);}(_0xd1fa,0x12a));var _0xad1f=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xd1fa[_0x4c7fb5];return _0x2e10ac;};'use strict';var _=require(_0xad1f('0x0'));var util=require(_0xad1f('0x1'));var logger=require(_0xad1f('0x2'))(_0xad1f('0x3'));var moment=require(_0xad1f('0x4'));var BPromise=require(_0xad1f('0x5'));var rp=require(_0xad1f('0x6'));var fs=require('fs');var path=require(_0xad1f('0x7'));var rimraf=require(_0xad1f('0x8'));var config=require(_0xad1f('0x9'));var attributes=require('./integrationReport.attributes');module['exports']=function(_0x1a3fdd,_0x43f868){return _0x1a3fdd['define'](_0xad1f('0xa'),attributes,{'tableName':_0xad1f('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 e173296..c6b50ed 100644 --- a/server/api/integrationReport/integrationReport.rpc.js +++ b/server/api/integrationReport/integrationReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','IntegrationReport,\x20%s,\x20%s','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x2881e2,_0x341293){var _0x5c1e1f=function(_0x10ba61){while(--_0x10ba61){_0x2881e2['push'](_0x2881e2['shift']());}};_0x5c1e1f(++_0x341293);}(_0x2ef3,0xba));var _0x32ef=function(_0x21f5aa,_0x184cd1){_0x21f5aa=_0x21f5aa-0x0;var _0x418585=_0x2ef3[_0x21f5aa];return _0x418585;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('IntegrationReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('IntegrationReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','IntegrationReport,\x20%s,\x20%s','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x12ca7a,_0x3295bf){var _0x2249df=function(_0x48b046){while(--_0x48b046){_0x12ca7a['push'](_0x12ca7a['shift']());}};_0x2249df(++_0x3295bf);}(_0x2ef3,0xba));var _0x32ef=function(_0x3f17ac,_0x18ff69){_0x3f17ac=_0x3f17ac-0x0;var _0x3aa0cf=_0x2ef3[_0x3f17ac];return _0x3aa0cf;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('IntegrationReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('IntegrationReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index d97d9d3..a4b1af4 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 _0xa29a=['/:id/sub_intervals','getIntervals','create','post','addInterval','/:id/sub_intervals/create_many','addIntervals','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','./interval.controller','get','index','/:id','isAuthenticated','show'];(function(_0x57c540,_0x3bb8fd){var _0x272959=function(_0x5550c7){while(--_0x5550c7){_0x57c540['push'](_0x57c540['shift']());}};_0x272959(++_0x3bb8fd);}(_0xa29a,0x1ee));var _0xaa29=function(_0x54b931,_0x162050){_0x54b931=_0x54b931-0x0;var _0xca41df=_0xa29a[_0x54b931];return _0xca41df;};'use strict';var multer=require(_0xaa29('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xaa29('0x1'));var express=require(_0xaa29('0x2'));var router=express[_0xaa29('0x3')]();var fs_extra=require(_0xaa29('0x4'));var auth=require(_0xaa29('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xaa29('0x6'));router[_0xaa29('0x7')]('/',auth['isAuthenticated'](),controller[_0xaa29('0x8')]);router[_0xaa29('0x7')](_0xaa29('0x9'),auth[_0xaa29('0xa')](),controller[_0xaa29('0xb')]);router[_0xaa29('0x7')](_0xaa29('0xc'),auth[_0xaa29('0xa')](),controller[_0xaa29('0xd')]);router['post']('/',auth[_0xaa29('0xa')](),controller[_0xaa29('0xe')]);router[_0xaa29('0xf')]('/:id/sub_intervals',auth[_0xaa29('0xa')](),controller[_0xaa29('0x10')]);router[_0xaa29('0xf')](_0xaa29('0x11'),auth['isAuthenticated'](),controller[_0xaa29('0x12')]);router['put']('/:id',auth[_0xaa29('0xa')](),controller['update']);router[_0xaa29('0x13')](_0xaa29('0x9'),auth[_0xaa29('0xa')](),controller[_0xaa29('0x14')]);module[_0xaa29('0x15')]=router; \ No newline at end of file +var _0xdcfa=['index','/:id','show','/:id/sub_intervals','post','create','/:id/sub_intervals/create_many','addIntervals','put','update','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0xdcfa,0xad));var _0xadcf=function(_0xc87b06,_0x5850f7){_0xc87b06=_0xc87b06-0x0;var _0x1c0afb=_0xdcfa[_0xc87b06];return _0x1c0afb;};'use strict';var multer=require(_0xadcf('0x0'));var util=require('util');var path=require(_0xadcf('0x1'));var timeout=require('connect-timeout');var express=require(_0xadcf('0x2'));var router=express[_0xadcf('0x3')]();var fs_extra=require(_0xadcf('0x4'));var auth=require(_0xadcf('0x5'));var interaction=require(_0xadcf('0x6'));var config=require(_0xadcf('0x7'));var controller=require(_0xadcf('0x8'));router[_0xadcf('0x9')]('/',auth[_0xadcf('0xa')](),controller[_0xadcf('0xb')]);router[_0xadcf('0x9')](_0xadcf('0xc'),auth['isAuthenticated'](),controller[_0xadcf('0xd')]);router['get'](_0xadcf('0xe'),auth[_0xadcf('0xa')](),controller['getIntervals']);router[_0xadcf('0xf')]('/',auth['isAuthenticated'](),controller[_0xadcf('0x10')]);router['post'](_0xadcf('0xe'),auth[_0xadcf('0xa')](),controller['addInterval']);router[_0xadcf('0xf')](_0xadcf('0x11'),auth[_0xadcf('0xa')](),controller[_0xadcf('0x12')]);router[_0xadcf('0x13')](_0xadcf('0xc'),auth['isAuthenticated'](),controller[_0xadcf('0x14')]);router[_0xadcf('0x15')](_0xadcf('0xc'),auth[_0xadcf('0xa')](),controller[_0xadcf('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index a29c0f4..70a5999 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 _0x3d40=['STRING','sequelize'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x3d40,0xcb));var _0x03d4=function(_0x3eb52d,_0x1bf13e){_0x3eb52d=_0x3eb52d-0x0;var _0x2d748c=_0x3d40[_0x3eb52d];return _0x2d748c;};'use strict';var Sequelize=require(_0x03d4('0x0'));module['exports']={'name':{'type':Sequelize[_0x03d4('0x1')]},'description':{'type':Sequelize[_0x03d4('0x1')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0xd547=['STRING','sequelize','exports'];(function(_0x43723c,_0x263236){var _0x8253d2=function(_0x11da0a){while(--_0x11da0a){_0x43723c['push'](_0x43723c['shift']());}};_0x8253d2(++_0x263236);}(_0xd547,0x1cf));var _0x7d54=function(_0x2072f4,_0x1f2f7e){_0x2072f4=_0x2072f4-0x0;var _0x330448=_0xd547[_0x2072f4];return _0x330448;};'use strict';var Sequelize=require(_0x7d54('0x0'));module[_0x7d54('0x1')]={'name':{'type':Sequelize[_0x7d54('0x2')]},'description':{'type':Sequelize[_0x7d54('0x2')]},'interval':{'type':Sequelize[_0x7d54('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 fd89383..121072d 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 _0x8cba=['then','destroy','get','Intervals','UserProfileResource','stack','name','send','index','map','Interval','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','addInterval','IntervalId','getIntervals','order','filter','addIntervals','findOne','sequelize','transaction','bulkCreate','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','ejs','fs-extra','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update'];(function(_0x3161d5,_0x11a27f){var _0x147680=function(_0x27d4d9){while(--_0x27d4d9){_0x3161d5['push'](_0x3161d5['shift']());}};_0x147680(++_0x11a27f);}(_0x8cba,0x154));var _0xa8cb=function(_0x448bab,_0x25517b){_0x448bab=_0x448bab-0x0;var _0x5dc534=_0x8cba[_0x448bab];return _0x5dc534;};'use strict';var emlformat=require(_0xa8cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa8cb('0x1'));var jsonpatch=require(_0xa8cb('0x2'));var rp=require(_0xa8cb('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa8cb('0x4'));var util=require('util');var path=require(_0xa8cb('0x5'));var sox=require(_0xa8cb('0x6'));var csv=require('to-csv');var ejs=require(_0xa8cb('0x7'));var fs=require('fs');var fs_extra=require(_0xa8cb('0x8'));var _=require('lodash');var squel=require(_0xa8cb('0x9'));var crypto=require(_0xa8cb('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa8cb('0xb'));var Papa=require(_0xa8cb('0xc'));var Redis=require('ioredis');var authService=require(_0xa8cb('0xd'));var qs=require(_0xa8cb('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa8cb('0xf'));var logger=require(_0xa8cb('0x10'))(_0xa8cb('0x11'));var utils=require(_0xa8cb('0x12'));var config=require(_0xa8cb('0x13'));var licenseUtil=require(_0xa8cb('0x14'));var db=require(_0xa8cb('0x15'))['db'];var extensions=require(_0xa8cb('0x16'));function respondWithStatusCode(_0x125fdb,_0x15b790){_0x15b790=_0x15b790||0xcc;return function(_0x1826fe){if(_0x1826fe){return _0x125fdb[_0xa8cb('0x17')](_0x15b790);}return _0x125fdb[_0xa8cb('0x18')](_0x15b790)[_0xa8cb('0x19')]();};}function respondWithResult(_0x114257,_0x39ee7c){_0x39ee7c=_0x39ee7c||0xc8;return function(_0x3ee9fb){if(_0x3ee9fb){return _0x114257[_0xa8cb('0x18')](_0x39ee7c)[_0xa8cb('0x1a')](_0x3ee9fb);}};}function respondWithFilteredResult(_0x1f2db0,_0x2bc39f){return function(_0x4fb0ee){if(_0x4fb0ee){var _0x333d42=typeof _0x2bc39f[_0xa8cb('0x1b')]===_0xa8cb('0x1c')&&typeof _0x2bc39f[_0xa8cb('0x1d')]==='undefined';var _0x14a2af=_0x4fb0ee[_0xa8cb('0x1e')];var _0x5d9a92=_0x333d42?0x0:_0x2bc39f[_0xa8cb('0x1b')];var _0x9411e6=_0x333d42?_0x4fb0ee['count']:_0x2bc39f[_0xa8cb('0x1b')]+_0x2bc39f[_0xa8cb('0x1d')];var _0x5ef63d;if(_0x9411e6>=_0x14a2af){_0x9411e6=_0x14a2af;_0x5ef63d=0xc8;}else{_0x5ef63d=0xce;}_0x1f2db0[_0xa8cb('0x18')](_0x5ef63d);return _0x1f2db0[_0xa8cb('0x1f')]('Content-Range',_0x5d9a92+'-'+_0x9411e6+'/'+_0x14a2af)[_0xa8cb('0x1a')](_0x4fb0ee);}return null;};}function patchUpdates(_0x344100){return function(_0x2403ee){try{jsonpatch[_0xa8cb('0x20')](_0x2403ee,_0x344100,!![]);}catch(_0x1eafd3){return BPromise[_0xa8cb('0x21')](_0x1eafd3);}return _0x2403ee[_0xa8cb('0x22')]();};}function saveUpdates(_0x7eeba6,_0x39d329){return function(_0x5ad771){if(_0x5ad771){return _0x5ad771[_0xa8cb('0x23')](_0x7eeba6)[_0xa8cb('0x24')](function(_0x3cf74c){return _0x3cf74c;});}return null;};}function removeEntity(_0x161dce,_0x5ddf82){return function(_0x69fb0d){if(_0x69fb0d){return _0x69fb0d[_0xa8cb('0x25')]()[_0xa8cb('0x24')](function(){var _0x444aa9=_0x69fb0d[_0xa8cb('0x26')]({'plain':!![]});var _0x2b45fe=_0xa8cb('0x27');return db[_0xa8cb('0x28')][_0xa8cb('0x25')]({'where':{'type':_0x2b45fe,'resourceId':_0x444aa9['id']}})[_0xa8cb('0x24')](function(){return _0x69fb0d;});})[_0xa8cb('0x24')](function(){_0x161dce[_0xa8cb('0x18')](0xcc)[_0xa8cb('0x19')]();});}};}function handleEntityNotFound(_0x16909f,_0x416ed0){return function(_0x269270){if(!_0x269270){_0x16909f[_0xa8cb('0x17')](0x194);}return _0x269270;};}function handleError(_0x28d143,_0x50a5f0){_0x50a5f0=_0x50a5f0||0x1f4;return function(_0x1fc920){logger['error'](_0x1fc920[_0xa8cb('0x29')]);if(_0x1fc920[_0xa8cb('0x2a')]){delete _0x1fc920[_0xa8cb('0x2a')];}_0x28d143[_0xa8cb('0x18')](_0x50a5f0)[_0xa8cb('0x2b')](_0x1fc920);};}exports[_0xa8cb('0x2c')]=function(_0x469269,_0x1cb9fe){var _0x24bdc1={},_0x332fd5={},_0x3b778c={'count':0x0,'rows':[]};var _0x247ac4=_[_0xa8cb('0x2d')](db[_0xa8cb('0x2e')][_0xa8cb('0x2f')],function(_0x1421e0){return{'name':_0x1421e0[_0xa8cb('0x30')],'type':_0x1421e0[_0xa8cb('0x31')][_0xa8cb('0x32')]};});_0x332fd5[_0xa8cb('0x33')]=_[_0xa8cb('0x2d')](_0x247ac4,'name');_0x332fd5[_0xa8cb('0x34')]=_['keys'](_0x469269[_0xa8cb('0x34')]);_0x332fd5['filters']=_[_0xa8cb('0x35')](_0x332fd5[_0xa8cb('0x33')],_0x332fd5[_0xa8cb('0x34')]);_0x24bdc1['attributes']=_['intersection'](_0x332fd5[_0xa8cb('0x33')],qs[_0xa8cb('0x36')](_0x469269[_0xa8cb('0x34')][_0xa8cb('0x36')]));_0x24bdc1[_0xa8cb('0x37')]=_0x24bdc1[_0xa8cb('0x37')]['length']?_0x24bdc1[_0xa8cb('0x37')]:_0x332fd5[_0xa8cb('0x33')];if(!_0x469269[_0xa8cb('0x34')][_0xa8cb('0x38')](_0xa8cb('0x39'))){_0x24bdc1[_0xa8cb('0x1d')]=qs[_0xa8cb('0x1d')](_0x469269['query'][_0xa8cb('0x1d')]);_0x24bdc1[_0xa8cb('0x1b')]=qs[_0xa8cb('0x1b')](_0x469269[_0xa8cb('0x34')][_0xa8cb('0x1b')]);}_0x24bdc1['order']=qs[_0xa8cb('0x3a')](_0x469269[_0xa8cb('0x34')]['sort']);_0x24bdc1[_0xa8cb('0x3b')]=qs[_0xa8cb('0x3c')](_[_0xa8cb('0x3d')](_0x469269[_0xa8cb('0x34')],_0x332fd5[_0xa8cb('0x3c')]),_0x247ac4);if(_0x469269[_0xa8cb('0x34')]['filter']){_0x24bdc1[_0xa8cb('0x3b')]=_[_0xa8cb('0x3e')](_0x24bdc1[_0xa8cb('0x3b')],{'$or':_[_0xa8cb('0x2d')](_0x247ac4,function(_0x5e6c45){if(_0x5e6c45['type']!==_0xa8cb('0x3f')){var _0x2f2060={};_0x2f2060[_0x5e6c45[_0xa8cb('0x2a')]]={'$like':'%'+_0x469269[_0xa8cb('0x34')]['filter']+'%'};return _0x2f2060;}})});}_0x24bdc1=_[_0xa8cb('0x3e')]({},_0x24bdc1,_0x469269[_0xa8cb('0x40')]);var _0xbbeaa1={'where':_0x24bdc1[_0xa8cb('0x3b')]};return db[_0xa8cb('0x2e')][_0xa8cb('0x1e')](_0xbbeaa1)[_0xa8cb('0x24')](function(_0xe1b54d){_0x3b778c[_0xa8cb('0x1e')]=_0xe1b54d;if(_0x469269[_0xa8cb('0x34')][_0xa8cb('0x41')]){_0x24bdc1['include']=[{'all':!![]}];}return db[_0xa8cb('0x2e')][_0xa8cb('0x42')](_0x24bdc1);})['then'](function(_0x1232b8){_0x3b778c[_0xa8cb('0x43')]=_0x1232b8;return _0x3b778c;})[_0xa8cb('0x24')](respondWithFilteredResult(_0x1cb9fe,_0x24bdc1))[_0xa8cb('0x44')](handleError(_0x1cb9fe,null));};exports[_0xa8cb('0x45')]=function(_0x5ce281,_0x2d28ea){var _0x2ab6bd={'raw':!![],'where':{'id':_0x5ce281[_0xa8cb('0x46')]['id']}},_0x5dc777={};_0x5dc777[_0xa8cb('0x33')]=_['keys'](db[_0xa8cb('0x2e')][_0xa8cb('0x2f')]);_0x5dc777[_0xa8cb('0x34')]=_[_0xa8cb('0x47')](_0x5ce281[_0xa8cb('0x34')]);_0x5dc777[_0xa8cb('0x3c')]=_['intersection'](_0x5dc777['model'],_0x5dc777['query']);_0x2ab6bd['attributes']=_[_0xa8cb('0x35')](_0x5dc777['model'],qs[_0xa8cb('0x36')](_0x5ce281[_0xa8cb('0x34')][_0xa8cb('0x36')]));_0x2ab6bd[_0xa8cb('0x37')]=_0x2ab6bd[_0xa8cb('0x37')][_0xa8cb('0x48')]?_0x2ab6bd[_0xa8cb('0x37')]:_0x5dc777['model'];if(_0x5ce281[_0xa8cb('0x34')]['includeAll']){_0x2ab6bd[_0xa8cb('0x49')]=[{'all':!![]}];}_0x2ab6bd=_[_0xa8cb('0x3e')]({},_0x2ab6bd,_0x5ce281['options']);return db[_0xa8cb('0x2e')][_0xa8cb('0x4a')](_0x2ab6bd)['then'](handleEntityNotFound(_0x2d28ea,null))[_0xa8cb('0x24')](respondWithResult(_0x2d28ea,null))['catch'](handleError(_0x2d28ea,null));};exports['create']=function(_0x5c662f,_0x1e2d84){return db['Interval'][_0xa8cb('0x4b')](_0x5c662f[_0xa8cb('0x4c')],{})[_0xa8cb('0x24')](function(_0x5b9f8c){var _0xa9d557=_0x5c662f[_0xa8cb('0x4d')][_0xa8cb('0x26')]({'plain':!![]});if(!_0xa9d557)throw new Error(_0xa8cb('0x4e'));if(_0xa9d557[_0xa8cb('0x4f')]==='user'){var _0x2713e3=_0x5b9f8c[_0xa8cb('0x26')]({'plain':!![]});var _0x3cb78c='Intervals';return db[_0xa8cb('0x50')]['find']({'where':{'name':_0x3cb78c,'userProfileId':_0xa9d557[_0xa8cb('0x51')]},'raw':!![]})['then'](function(_0x12dfd8){if(_0x12dfd8&&_0x12dfd8[_0xa8cb('0x52')]===0x0){return db[_0xa8cb('0x28')][_0xa8cb('0x4b')]({'name':_0x2713e3['name'],'resourceId':_0x2713e3['id'],'type':_0x12dfd8[_0xa8cb('0x2a')],'sectionId':_0x12dfd8['id']},{})['then'](function(){return _0x5b9f8c;});}else{return _0x5b9f8c;}})[_0xa8cb('0x44')](function(_0x14e630){logger[_0xa8cb('0x53')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x14e630);throw _0x14e630;});}return _0x5b9f8c;})[_0xa8cb('0x24')](respondWithResult(_0x1e2d84,0xc9))['catch'](handleError(_0x1e2d84,null));};exports[_0xa8cb('0x23')]=function(_0x39aa3b,_0xad5c3f){if(_0x39aa3b['body']['id']){delete _0x39aa3b[_0xa8cb('0x4c')]['id'];}return db[_0xa8cb('0x2e')]['find']({'where':{'id':_0x39aa3b[_0xa8cb('0x46')]['id']}})[_0xa8cb('0x24')](handleEntityNotFound(_0xad5c3f,null))[_0xa8cb('0x24')](saveUpdates(_0x39aa3b['body'],null))[_0xa8cb('0x24')](respondWithResult(_0xad5c3f,null))[_0xa8cb('0x44')](handleError(_0xad5c3f,null));};exports[_0xa8cb('0x25')]=function(_0x5ae772,_0x562c1b){return db['Interval'][_0xa8cb('0x4a')]({'where':{'id':_0x5ae772['params']['id']}})[_0xa8cb('0x24')](handleEntityNotFound(_0x562c1b,null))[_0xa8cb('0x24')](removeEntity(_0x562c1b,null))['catch'](handleError(_0x562c1b,null));};exports[_0xa8cb('0x54')]=function(_0x1fcf49,_0xdc50de,_0x3ed445){if(_0x1fcf49[_0xa8cb('0x4c')]['id']){delete _0x1fcf49[_0xa8cb('0x4c')]['id'];}return db['Interval'][_0xa8cb('0x4a')]({'where':{'id':_0x1fcf49[_0xa8cb('0x46')]['id']}})[_0xa8cb('0x24')](handleEntityNotFound(_0xdc50de,null))[_0xa8cb('0x24')](function(_0x2d4ce3){if(_0x2d4ce3){_0x1fcf49[_0xa8cb('0x4c')][_0xa8cb('0x55')]=_0x2d4ce3['id'];return db[_0xa8cb('0x2e')][_0xa8cb('0x4b')](_0x1fcf49[_0xa8cb('0x4c')]);}})[_0xa8cb('0x24')](respondWithResult(_0xdc50de,null))['catch'](handleError(_0xdc50de,null));};exports[_0xa8cb('0x56')]=function(_0x4f4d15,_0x3693a9,_0x5725c){var _0x6c49d9={};var _0x3d7aa0={};var _0x543c0d;var _0x1de272;return db[_0xa8cb('0x2e')]['findOne']({'where':{'id':_0x4f4d15[_0xa8cb('0x46')]['id']}})[_0xa8cb('0x24')](handleEntityNotFound(_0x3693a9,null))['then'](function(_0x49f1e3){if(_0x49f1e3){_0x543c0d=_0x49f1e3;_0x3d7aa0[_0xa8cb('0x33')]=_[_0xa8cb('0x47')](db['Interval']['rawAttributes']);_0x3d7aa0[_0xa8cb('0x34')]=_[_0xa8cb('0x47')](_0x4f4d15[_0xa8cb('0x34')]);_0x3d7aa0[_0xa8cb('0x3c')]=_[_0xa8cb('0x35')](_0x3d7aa0[_0xa8cb('0x33')],_0x3d7aa0[_0xa8cb('0x34')]);_0x6c49d9[_0xa8cb('0x37')]=_['intersection'](_0x3d7aa0[_0xa8cb('0x33')],qs[_0xa8cb('0x36')](_0x4f4d15[_0xa8cb('0x34')][_0xa8cb('0x36')]));_0x6c49d9[_0xa8cb('0x37')]=_0x6c49d9[_0xa8cb('0x37')][_0xa8cb('0x48')]?_0x6c49d9[_0xa8cb('0x37')]:_0x3d7aa0[_0xa8cb('0x33')];_0x6c49d9[_0xa8cb('0x57')]=qs[_0xa8cb('0x3a')](_0x4f4d15['query'][_0xa8cb('0x3a')]);_0x6c49d9[_0xa8cb('0x3b')]=qs[_0xa8cb('0x3c')](_['pick'](_0x4f4d15['query'],_0x3d7aa0['filters']));if(_0x4f4d15['query'][_0xa8cb('0x58')]){_0x6c49d9['where']=_[_0xa8cb('0x3e')](_0x6c49d9['where'],{'$or':_[_0xa8cb('0x2d')](_0x6c49d9[_0xa8cb('0x37')],function(_0x57ffed){var _0x12aec9={};_0x12aec9[_0x57ffed]={'$like':'%'+_0x4f4d15[_0xa8cb('0x34')][_0xa8cb('0x58')]+'%'};return _0x12aec9;})});}_0x6c49d9=_[_0xa8cb('0x3e')]({},_0x6c49d9,_0x4f4d15[_0xa8cb('0x40')]);return _0x543c0d[_0xa8cb('0x56')](_0x6c49d9);}})['then'](function(_0x18c904){if(_0x18c904){_0x1de272=_0x18c904['length'];if(!_0x4f4d15[_0xa8cb('0x34')][_0xa8cb('0x38')](_0xa8cb('0x39'))){_0x6c49d9[_0xa8cb('0x1d')]=qs['limit'](_0x4f4d15['query']['limit']);_0x6c49d9[_0xa8cb('0x1b')]=qs['offset'](_0x4f4d15[_0xa8cb('0x34')][_0xa8cb('0x1b')]);}return _0x543c0d[_0xa8cb('0x56')](_0x6c49d9);}})[_0xa8cb('0x24')](function(_0x4ea9ee){if(_0x4ea9ee){return _0x4ea9ee?{'count':_0x1de272,'rows':_0x4ea9ee}:null;}})['then'](respondWithResult(_0x3693a9,null))[_0xa8cb('0x44')](handleError(_0x3693a9,null));};exports[_0xa8cb('0x59')]=function(_0x4e474f,_0x1e5edf,_0x3ba706){return db['Interval'][_0xa8cb('0x5a')]({'where':{'id':_0x4e474f[_0xa8cb('0x46')]['id']}})[_0xa8cb('0x24')](handleEntityNotFound(_0x1e5edf,null))['then'](function(_0x24a009){if(_0x24a009){return db[_0xa8cb('0x5b')][_0xa8cb('0x5c')](function(_0x256291){return db[_0xa8cb('0x2e')][_0xa8cb('0x25')]({'where':{'IntervalId':_0x4e474f['params']['id']},'transaction':_0x256291})[_0xa8cb('0x24')](function(_0x3097d6){var _0x5b3591=_['map'](_0x4e474f[_0xa8cb('0x4c')],function(_0x55923b){delete _0x55923b['id'];_0x55923b[_0xa8cb('0x55')]=_0x4e474f[_0xa8cb('0x46')]['id'];return _0x55923b;});return db['Interval'][_0xa8cb('0x5d')](_0x5b3591,{'transaction':_0x256291});});})[_0xa8cb('0x24')](function(){return db[_0xa8cb('0x2e')][_0xa8cb('0x42')]({'where':{'IntervalId':_0x4e474f[_0xa8cb('0x46')]['id']}});});}})[_0xa8cb('0x24')](respondWithResult(_0x1e5edf,null))[_0xa8cb('0x44')](handleError(_0x1e5edf,null));}; \ No newline at end of file +var _0x3216=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','addInterval','getIntervals','findOne','order','pick','addIntervals','sequelize','transaction','IntervalId','bulkCreate','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','apply','reject','save','destroy','then','get','UserProfileResource','error','name','map','Interval','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filters','filter','merge','type','VIRTUAL','options','count','includeAll','include','rows','catch','length','find'];(function(_0x458709,_0x1981ea){var _0x48cbd7=function(_0x358194){while(--_0x358194){_0x458709['push'](_0x458709['shift']());}};_0x48cbd7(++_0x1981ea);}(_0x3216,0x174));var _0x6321=function(_0x2cb782,_0x19b959){_0x2cb782=_0x2cb782-0x0;var _0x4b292d=_0x3216[_0x2cb782];return _0x4b292d;};'use strict';var emlformat=require(_0x6321('0x0'));var rimraf=require(_0x6321('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6321('0x2'));var moment=require(_0x6321('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6321('0x4'));var util=require(_0x6321('0x5'));var path=require(_0x6321('0x6'));var sox=require(_0x6321('0x7'));var csv=require('to-csv');var ejs=require(_0x6321('0x8'));var fs=require('fs');var fs_extra=require(_0x6321('0x9'));var _=require('lodash');var squel=require(_0x6321('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6321('0xb'));var querystring=require(_0x6321('0xc'));var Papa=require(_0x6321('0xd'));var Redis=require('ioredis');var authService=require(_0x6321('0xe'));var qs=require(_0x6321('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6321('0x10'));var logger=require('../../config/logger')(_0x6321('0x11'));var utils=require(_0x6321('0x12'));var config=require(_0x6321('0x13'));var licenseUtil=require(_0x6321('0x14'));var db=require(_0x6321('0x15'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x1e193b,_0x18656a){_0x18656a=_0x18656a||0xcc;return function(_0xf742f7){if(_0xf742f7){return _0x1e193b[_0x6321('0x16')](_0x18656a);}return _0x1e193b[_0x6321('0x17')](_0x18656a)[_0x6321('0x18')]();};}function respondWithResult(_0x37584e,_0x327d27){_0x327d27=_0x327d27||0xc8;return function(_0x411daf){if(_0x411daf){return _0x37584e[_0x6321('0x17')](_0x327d27)[_0x6321('0x19')](_0x411daf);}};}function respondWithFilteredResult(_0xafda76,_0x21ea60){return function(_0x4a7bc3){if(_0x4a7bc3){var _0x3e111b=typeof _0x21ea60[_0x6321('0x1a')]==='undefined'&&typeof _0x21ea60[_0x6321('0x1b')]===_0x6321('0x1c');var _0xa9ae63=_0x4a7bc3['count'];var _0x34a515=_0x3e111b?0x0:_0x21ea60[_0x6321('0x1a')];var _0x3cbe7a=_0x3e111b?_0x4a7bc3['count']:_0x21ea60['offset']+_0x21ea60[_0x6321('0x1b')];var _0x6917c9;if(_0x3cbe7a>=_0xa9ae63){_0x3cbe7a=_0xa9ae63;_0x6917c9=0xc8;}else{_0x6917c9=0xce;}_0xafda76['status'](_0x6917c9);return _0xafda76[_0x6321('0x1d')](_0x6321('0x1e'),_0x34a515+'-'+_0x3cbe7a+'/'+_0xa9ae63)['json'](_0x4a7bc3);}return null;};}function patchUpdates(_0x5e7dba){return function(_0x45aad7){try{jsonpatch[_0x6321('0x1f')](_0x45aad7,_0x5e7dba,!![]);}catch(_0x280794){return BPromise[_0x6321('0x20')](_0x280794);}return _0x45aad7[_0x6321('0x21')]();};}function saveUpdates(_0x2337ea,_0x1fefb6){return function(_0x3c1fc0){if(_0x3c1fc0){return _0x3c1fc0['update'](_0x2337ea)['then'](function(_0x39564a){return _0x39564a;});}return null;};}function removeEntity(_0x1b4a68,_0x4e9038){return function(_0x273a2b){if(_0x273a2b){return _0x273a2b[_0x6321('0x22')]()[_0x6321('0x23')](function(){var _0x5c4edb=_0x273a2b[_0x6321('0x24')]({'plain':!![]});var _0x1be594='Intervals';return db[_0x6321('0x25')]['destroy']({'where':{'type':_0x1be594,'resourceId':_0x5c4edb['id']}})[_0x6321('0x23')](function(){return _0x273a2b;});})['then'](function(){_0x1b4a68[_0x6321('0x17')](0xcc)[_0x6321('0x18')]();});}};}function handleEntityNotFound(_0xe00ba5,_0xb90e1c){return function(_0x4ddd93){if(!_0x4ddd93){_0xe00ba5[_0x6321('0x16')](0x194);}return _0x4ddd93;};}function handleError(_0x134445,_0xe90d96){_0xe90d96=_0xe90d96||0x1f4;return function(_0x36f7ef){logger[_0x6321('0x26')](_0x36f7ef['stack']);if(_0x36f7ef[_0x6321('0x27')]){delete _0x36f7ef['name'];}_0x134445['status'](_0xe90d96)['send'](_0x36f7ef);};}exports['index']=function(_0x1c02e0,_0x306095){var _0x2fd562={},_0x25d3b6={},_0x105de6={'count':0x0,'rows':[]};var _0x1285ca=_[_0x6321('0x28')](db[_0x6321('0x29')][_0x6321('0x2a')],function(_0xf67806){return{'name':_0xf67806[_0x6321('0x2b')],'type':_0xf67806['type'][_0x6321('0x2c')]};});_0x25d3b6[_0x6321('0x2d')]=_['map'](_0x1285ca,_0x6321('0x27'));_0x25d3b6[_0x6321('0x2e')]=_[_0x6321('0x2f')](_0x1c02e0[_0x6321('0x2e')]);_0x25d3b6['filters']=_['intersection'](_0x25d3b6[_0x6321('0x2d')],_0x25d3b6[_0x6321('0x2e')]);_0x2fd562[_0x6321('0x30')]=_[_0x6321('0x31')](_0x25d3b6[_0x6321('0x2d')],qs[_0x6321('0x32')](_0x1c02e0['query'][_0x6321('0x32')]));_0x2fd562[_0x6321('0x30')]=_0x2fd562[_0x6321('0x30')]['length']?_0x2fd562[_0x6321('0x30')]:_0x25d3b6['model'];if(!_0x1c02e0[_0x6321('0x2e')][_0x6321('0x33')](_0x6321('0x34'))){_0x2fd562[_0x6321('0x1b')]=qs['limit'](_0x1c02e0['query']['limit']);_0x2fd562[_0x6321('0x1a')]=qs[_0x6321('0x1a')](_0x1c02e0[_0x6321('0x2e')]['offset']);}_0x2fd562['order']=qs[_0x6321('0x35')](_0x1c02e0[_0x6321('0x2e')][_0x6321('0x35')]);_0x2fd562[_0x6321('0x36')]=qs[_0x6321('0x37')](_['pick'](_0x1c02e0['query'],_0x25d3b6[_0x6321('0x37')]),_0x1285ca);if(_0x1c02e0[_0x6321('0x2e')][_0x6321('0x38')]){_0x2fd562[_0x6321('0x36')]=_[_0x6321('0x39')](_0x2fd562[_0x6321('0x36')],{'$or':_[_0x6321('0x28')](_0x1285ca,function(_0x1f30d7){if(_0x1f30d7[_0x6321('0x3a')]!==_0x6321('0x3b')){var _0x2f67b4={};_0x2f67b4[_0x1f30d7['name']]={'$like':'%'+_0x1c02e0[_0x6321('0x2e')][_0x6321('0x38')]+'%'};return _0x2f67b4;}})});}_0x2fd562=_[_0x6321('0x39')]({},_0x2fd562,_0x1c02e0[_0x6321('0x3c')]);var _0x20a4ba={'where':_0x2fd562['where']};return db[_0x6321('0x29')][_0x6321('0x3d')](_0x20a4ba)[_0x6321('0x23')](function(_0x56c223){_0x105de6['count']=_0x56c223;if(_0x1c02e0['query'][_0x6321('0x3e')]){_0x2fd562[_0x6321('0x3f')]=[{'all':!![]}];}return db[_0x6321('0x29')]['findAll'](_0x2fd562);})['then'](function(_0x200958){_0x105de6[_0x6321('0x40')]=_0x200958;return _0x105de6;})[_0x6321('0x23')](respondWithFilteredResult(_0x306095,_0x2fd562))[_0x6321('0x41')](handleError(_0x306095,null));};exports['show']=function(_0x24917a,_0x45994f){var _0x499945={'raw':!![],'where':{'id':_0x24917a['params']['id']}},_0x2e1a43={};_0x2e1a43[_0x6321('0x2d')]=_[_0x6321('0x2f')](db[_0x6321('0x29')]['rawAttributes']);_0x2e1a43['query']=_[_0x6321('0x2f')](_0x24917a['query']);_0x2e1a43['filters']=_[_0x6321('0x31')](_0x2e1a43[_0x6321('0x2d')],_0x2e1a43[_0x6321('0x2e')]);_0x499945[_0x6321('0x30')]=_[_0x6321('0x31')](_0x2e1a43[_0x6321('0x2d')],qs[_0x6321('0x32')](_0x24917a['query'][_0x6321('0x32')]));_0x499945[_0x6321('0x30')]=_0x499945['attributes'][_0x6321('0x42')]?_0x499945[_0x6321('0x30')]:_0x2e1a43[_0x6321('0x2d')];if(_0x24917a[_0x6321('0x2e')][_0x6321('0x3e')]){_0x499945[_0x6321('0x3f')]=[{'all':!![]}];}_0x499945=_['merge']({},_0x499945,_0x24917a['options']);return db[_0x6321('0x29')][_0x6321('0x43')](_0x499945)['then'](handleEntityNotFound(_0x45994f,null))[_0x6321('0x23')](respondWithResult(_0x45994f,null))[_0x6321('0x41')](handleError(_0x45994f,null));};exports[_0x6321('0x44')]=function(_0x6642d4,_0x38271e){return db[_0x6321('0x29')][_0x6321('0x44')](_0x6642d4[_0x6321('0x45')],{})['then'](function(_0x1d45d2){var _0x412838=_0x6642d4[_0x6321('0x46')][_0x6321('0x24')]({'plain':!![]});if(!_0x412838)throw new Error(_0x6321('0x47'));if(_0x412838[_0x6321('0x48')]==='user'){var _0x11e6ac=_0x1d45d2[_0x6321('0x24')]({'plain':!![]});var _0xfe8664='Intervals';return db['UserProfileSection']['find']({'where':{'name':_0xfe8664,'userProfileId':_0x412838[_0x6321('0x49')]},'raw':!![]})[_0x6321('0x23')](function(_0x15962c){if(_0x15962c&&_0x15962c[_0x6321('0x4a')]===0x0){return db[_0x6321('0x25')][_0x6321('0x44')]({'name':_0x11e6ac[_0x6321('0x27')],'resourceId':_0x11e6ac['id'],'type':_0x15962c[_0x6321('0x27')],'sectionId':_0x15962c['id']},{})['then'](function(){return _0x1d45d2;});}else{return _0x1d45d2;}})[_0x6321('0x41')](function(_0x1be5e8){logger['error'](_0x6321('0x4b'),_0x1be5e8);throw _0x1be5e8;});}return _0x1d45d2;})[_0x6321('0x23')](respondWithResult(_0x38271e,0xc9))[_0x6321('0x41')](handleError(_0x38271e,null));};exports[_0x6321('0x4c')]=function(_0x1486ae,_0x42e6a2){if(_0x1486ae[_0x6321('0x45')]['id']){delete _0x1486ae[_0x6321('0x45')]['id'];}return db[_0x6321('0x29')]['find']({'where':{'id':_0x1486ae[_0x6321('0x4d')]['id']}})['then'](handleEntityNotFound(_0x42e6a2,null))['then'](saveUpdates(_0x1486ae[_0x6321('0x45')],null))[_0x6321('0x23')](respondWithResult(_0x42e6a2,null))[_0x6321('0x41')](handleError(_0x42e6a2,null));};exports[_0x6321('0x22')]=function(_0x34ba33,_0x24c714){return db['Interval'][_0x6321('0x43')]({'where':{'id':_0x34ba33['params']['id']}})[_0x6321('0x23')](handleEntityNotFound(_0x24c714,null))['then'](removeEntity(_0x24c714,null))[_0x6321('0x41')](handleError(_0x24c714,null));};exports[_0x6321('0x4e')]=function(_0x299665,_0x43b9bc,_0x3fd88b){if(_0x299665[_0x6321('0x45')]['id']){delete _0x299665[_0x6321('0x45')]['id'];}return db[_0x6321('0x29')]['find']({'where':{'id':_0x299665[_0x6321('0x4d')]['id']}})[_0x6321('0x23')](handleEntityNotFound(_0x43b9bc,null))[_0x6321('0x23')](function(_0x401a8a){if(_0x401a8a){_0x299665[_0x6321('0x45')]['IntervalId']=_0x401a8a['id'];return db['Interval'][_0x6321('0x44')](_0x299665[_0x6321('0x45')]);}})[_0x6321('0x23')](respondWithResult(_0x43b9bc,null))[_0x6321('0x41')](handleError(_0x43b9bc,null));};exports[_0x6321('0x4f')]=function(_0x109d27,_0x4bfa62,_0x5baf5a){var _0x460015={};var _0x55ce35={};var _0x28697c;var _0x2c188c;return db[_0x6321('0x29')][_0x6321('0x50')]({'where':{'id':_0x109d27[_0x6321('0x4d')]['id']}})[_0x6321('0x23')](handleEntityNotFound(_0x4bfa62,null))[_0x6321('0x23')](function(_0xd23a1e){if(_0xd23a1e){_0x28697c=_0xd23a1e;_0x55ce35[_0x6321('0x2d')]=_[_0x6321('0x2f')](db['Interval'][_0x6321('0x2a')]);_0x55ce35['query']=_[_0x6321('0x2f')](_0x109d27[_0x6321('0x2e')]);_0x55ce35['filters']=_[_0x6321('0x31')](_0x55ce35[_0x6321('0x2d')],_0x55ce35[_0x6321('0x2e')]);_0x460015[_0x6321('0x30')]=_[_0x6321('0x31')](_0x55ce35[_0x6321('0x2d')],qs[_0x6321('0x32')](_0x109d27[_0x6321('0x2e')][_0x6321('0x32')]));_0x460015[_0x6321('0x30')]=_0x460015[_0x6321('0x30')][_0x6321('0x42')]?_0x460015[_0x6321('0x30')]:_0x55ce35[_0x6321('0x2d')];_0x460015[_0x6321('0x51')]=qs[_0x6321('0x35')](_0x109d27['query'][_0x6321('0x35')]);_0x460015[_0x6321('0x36')]=qs[_0x6321('0x37')](_[_0x6321('0x52')](_0x109d27[_0x6321('0x2e')],_0x55ce35['filters']));if(_0x109d27[_0x6321('0x2e')][_0x6321('0x38')]){_0x460015[_0x6321('0x36')]=_['merge'](_0x460015['where'],{'$or':_[_0x6321('0x28')](_0x460015[_0x6321('0x30')],function(_0x23614e){var _0x37d1e7={};_0x37d1e7[_0x23614e]={'$like':'%'+_0x109d27[_0x6321('0x2e')]['filter']+'%'};return _0x37d1e7;})});}_0x460015=_[_0x6321('0x39')]({},_0x460015,_0x109d27[_0x6321('0x3c')]);return _0x28697c['getIntervals'](_0x460015);}})['then'](function(_0x3329cd){if(_0x3329cd){_0x2c188c=_0x3329cd['length'];if(!_0x109d27[_0x6321('0x2e')]['hasOwnProperty'](_0x6321('0x34'))){_0x460015[_0x6321('0x1b')]=qs[_0x6321('0x1b')](_0x109d27['query'][_0x6321('0x1b')]);_0x460015[_0x6321('0x1a')]=qs[_0x6321('0x1a')](_0x109d27[_0x6321('0x2e')][_0x6321('0x1a')]);}return _0x28697c['getIntervals'](_0x460015);}})[_0x6321('0x23')](function(_0x440f2d){if(_0x440f2d){return _0x440f2d?{'count':_0x2c188c,'rows':_0x440f2d}:null;}})[_0x6321('0x23')](respondWithResult(_0x4bfa62,null))[_0x6321('0x41')](handleError(_0x4bfa62,null));};exports[_0x6321('0x53')]=function(_0x28634d,_0x364f6f,_0x39238c){return db[_0x6321('0x29')][_0x6321('0x50')]({'where':{'id':_0x28634d[_0x6321('0x4d')]['id']}})['then'](handleEntityNotFound(_0x364f6f,null))[_0x6321('0x23')](function(_0x30419e){if(_0x30419e){return db[_0x6321('0x54')][_0x6321('0x55')](function(_0x472d28){return db[_0x6321('0x29')][_0x6321('0x22')]({'where':{'IntervalId':_0x28634d[_0x6321('0x4d')]['id']},'transaction':_0x472d28})[_0x6321('0x23')](function(_0x22f996){var _0x269b8c=_[_0x6321('0x28')](_0x28634d['body'],function(_0x8fbcf8){delete _0x8fbcf8['id'];_0x8fbcf8[_0x6321('0x56')]=_0x28634d[_0x6321('0x4d')]['id'];return _0x8fbcf8;});return db['Interval'][_0x6321('0x57')](_0x269b8c,{'transaction':_0x472d28});});})['then'](function(){return db['Interval']['findAll']({'where':{'IntervalId':_0x28634d[_0x6321('0x4d')]['id']}});});}})[_0x6321('0x23')](respondWithResult(_0x364f6f,null))[_0x6321('0x41')](handleError(_0x364f6f,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index bb68c3a..a92c933 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 _0xe1ff=['then','all','map','ifTime','reduce','./interval.attributes','../../components/extensions/rewrite','../../utils/iftime','iftime','exports','define','tools_intervals','rewrite','interval','string'];(function(_0x48b00c,_0x16690b){var _0x55d181=function(_0x58b5bd){while(--_0x58b5bd){_0x48b00c['push'](_0x48b00c['shift']());}};_0x55d181(++_0x16690b);}(_0xe1ff,0x131));var _0xfe1f=function(_0x53233d,_0x302cb0){_0x53233d=_0x53233d-0x0;var _0x5356ee=_0xe1ff[_0x53233d];return _0x5356ee;};'use strict';var attributes=require(_0xfe1f('0x0'));var extensions=require(_0xfe1f('0x1'));var iftime=require(_0xfe1f('0x2'))[_0xfe1f('0x3')];module[_0xfe1f('0x4')]=function(_0x2c7d3d){return _0x2c7d3d[_0xfe1f('0x5')]('Interval',attributes,{'tableName':_0xfe1f('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x31ca1e){extensions[_0xfe1f('0x7')](_0x2c7d3d,_0x31ca1e);},'afterBulkCreate':function(_0x1fb36d,_0x26ad21,_0x171803){_0x171803();extensions[_0xfe1f('0x7')](_0x2c7d3d,_0x1fb36d[0x0]);},'afterUpdate':function(_0x25e44c){extensions['rewrite'](_0x2c7d3d,_0x25e44c);},'afterDestroy':function(_0x707f03){extensions[_0xfe1f('0x7')](_0x2c7d3d,_0x707f03);}},'instanceMethods':{'ifTime':function(_0x32f215=undefined,_0x39ab6b=new Date()){if(typeof this[_0xfe1f('0x8')]===_0xfe1f('0x9')){return iftime(this[_0xfe1f('0x8')],_0x32f215,_0x39ab6b);}else{return this['getIntervals']()[_0xfe1f('0xa')](function(_0x483e1f){return Promise[_0xfe1f('0xb')](_0x483e1f[_0xfe1f('0xc')](function(_0x5473c1){return _0x5473c1[_0xfe1f('0xd')](_0x32f215,_0x39ab6b);}));})[_0xfe1f('0xa')](function(_0x4a4c2d){return _0x4a4c2d[_0xfe1f('0xe')](function(_0x11bbfc,_0x316750){return _0x11bbfc||_0x316750;},![]);});}}}});}; \ No newline at end of file +var _0x5b0d=['tools_intervals','rewrite','interval','all','map','./interval.attributes','iftime','exports','Interval'];(function(_0xf7d161,_0x1254f5){var _0x4da3a7=function(_0x217d5c){while(--_0x217d5c){_0xf7d161['push'](_0xf7d161['shift']());}};_0x4da3a7(++_0x1254f5);}(_0x5b0d,0xf8));var _0xd5b0=function(_0x191fc9,_0x3fd165){_0x191fc9=_0x191fc9-0x0;var _0xbc22fe=_0x5b0d[_0x191fc9];return _0xbc22fe;};'use strict';var attributes=require(_0xd5b0('0x0'));var extensions=require('../../components/extensions/rewrite');var iftime=require('../../utils/iftime')[_0xd5b0('0x1')];module[_0xd5b0('0x2')]=function(_0x3e462e){return _0x3e462e['define'](_0xd5b0('0x3'),attributes,{'tableName':_0xd5b0('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x488b85){extensions[_0xd5b0('0x5')](_0x3e462e,_0x488b85);},'afterBulkCreate':function(_0x1506a3,_0x3974c5,_0x3e3325){_0x3e3325();extensions[_0xd5b0('0x5')](_0x3e462e,_0x1506a3[0x0]);},'afterUpdate':function(_0x19c677){extensions['rewrite'](_0x3e462e,_0x19c677);},'afterDestroy':function(_0x5115ad){extensions[_0xd5b0('0x5')](_0x3e462e,_0x5115ad);}},'instanceMethods':{'ifTime':function(_0x177dbe=undefined,_0x1f7dd7=new Date()){if(typeof this['interval']==='string'){return iftime(this[_0xd5b0('0x6')],_0x177dbe,_0x1f7dd7);}else{return this['getIntervals']()['then'](function(_0x116bfb){return Promise[_0xd5b0('0x7')](_0x116bfb[_0xd5b0('0x8')](function(_0x30ab0f){return _0x30ab0f['ifTime'](_0x177dbe,_0x1f7dd7);}));})['then'](function(_0x16b716){return _0x16b716['reduce'](function(_0x268c53,_0x1c23a8){return _0x268c53||_0x1c23a8;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 3ad89f6..338ac0a 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 _0x494c=['options','attributes','include','map','model','then','info','debug','stringify','catch','error','message','ShowInterval','find','where','all','ifTime','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','IntervalIftime','intervalIds','isArray','intervals','string','timezone','length','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','silly','resolve','lodash','util','../../mysqldb','../../utils/iftime','../../config/logger','rpc','GetInterval','Interval','findAll','raw'];(function(_0x28d81b,_0x229856){var _0x4213f2=function(_0x860863){while(--_0x860863){_0x28d81b['push'](_0x28d81b['shift']());}};_0x4213f2(++_0x229856);}(_0x494c,0x131));var _0xc494=function(_0x2d3bb8,_0x547b60){_0x2d3bb8=_0x2d3bb8-0x0;var _0x442cf2=_0x494c[_0x2d3bb8];return _0x442cf2;};'use strict';var _=require(_0xc494('0x0'));var util=require(_0xc494('0x1'));var db=require(_0xc494('0x2'))['db'];var iftime=require(_0xc494('0x3'))['iftime'];var logger=require(_0xc494('0x4'))(_0xc494('0x5'));exports[_0xc494('0x6')]=function(_0x295d10){var _0x3a64b7=this;return new Promise(function(_0x3a6deb,_0x1f79bf){return db[_0xc494('0x7')][_0xc494('0x8')]({'raw':_0x295d10['options']?_0x295d10['options'][_0xc494('0x9')]===undefined?!![]:![]:!![],'where':_0x295d10[_0xc494('0xa')]?_0x295d10['options']['where']||null:null,'attributes':_0x295d10['options']?_0x295d10['options'][_0xc494('0xb')]||null:null,'limit':_0x295d10['options']?_0x295d10[_0xc494('0xa')]['limit']||null:null,'include':_0x295d10[_0xc494('0xa')]?_0x295d10['options'][_0xc494('0xc')]?_[_0xc494('0xd')](_0x295d10[_0xc494('0xa')]['include'],function(_0xdcdbcf){return{'model':db[_0xdcdbcf['model']],'as':_0xdcdbcf['as'],'attributes':_0xdcdbcf[_0xc494('0xb')],'include':_0xdcdbcf[_0xc494('0xc')]?_[_0xc494('0xd')](_0xdcdbcf[_0xc494('0xc')],function(_0x187681){return{'model':db[_0x187681[_0xc494('0xe')]],'as':_0x187681['as'],'attributes':_0x187681[_0xc494('0xb')],'include':_0x187681[_0xc494('0xc')]?_[_0xc494('0xd')](_0x187681['include'],function(_0x6ef27d){return{'model':db[_0x6ef27d[_0xc494('0xe')]],'as':_0x6ef27d['as'],'attributes':_0x6ef27d[_0xc494('0xb')]};}):[]};}):[]};}):[]:[]})[_0xc494('0xf')](function(_0xe71d41){logger[_0xc494('0x10')](_0xc494('0x6'),_0x295d10);logger[_0xc494('0x11')](_0xc494('0x6'),_0x295d10,JSON[_0xc494('0x12')](_0xe71d41));_0x3a6deb(_0xe71d41);})[_0xc494('0x13')](function(_0x340dfc){logger[_0xc494('0x14')](_0xc494('0x6'),_0x340dfc['message'],_0x295d10);_0x1f79bf(_0x3a64b7[_0xc494('0x14')](0x1f4,_0x340dfc[_0xc494('0x15')]));});});};exports[_0xc494('0x16')]=function(_0x1fa4df){var _0x46ce71=this;return new Promise(function(_0x14ef75,_0x5cce26){return db['Interval'][_0xc494('0x17')]({'raw':_0x1fa4df[_0xc494('0xa')]?_0x1fa4df[_0xc494('0xa')][_0xc494('0x9')]===undefined?!![]:![]:!![],'where':_0x1fa4df[_0xc494('0xa')]?_0x1fa4df[_0xc494('0xa')][_0xc494('0x18')]||null:null,'attributes':_0x1fa4df[_0xc494('0xa')]?_0x1fa4df[_0xc494('0xa')][_0xc494('0xb')]||null:null,'include':_0x1fa4df[_0xc494('0xa')]?_0x1fa4df[_0xc494('0xa')][_0xc494('0xc')]?_['map'](_0x1fa4df[_0xc494('0xa')]['include'],function(_0x4a40a2){return{'model':db[_0x4a40a2[_0xc494('0xe')]],'as':_0x4a40a2['as'],'attributes':_0x4a40a2['attributes'],'include':_0x4a40a2['include']?_[_0xc494('0xd')](_0x4a40a2['include'],function(_0x2b3946){return{'model':db[_0x2b3946[_0xc494('0xe')]],'as':_0x2b3946['as'],'attributes':_0x2b3946[_0xc494('0xb')],'include':_0x2b3946[_0xc494('0xc')]?_[_0xc494('0xd')](_0x2b3946[_0xc494('0xc')],function(_0x5bc7b1){return{'model':db[_0x5bc7b1[_0xc494('0xe')]],'as':_0x5bc7b1['as'],'attributes':_0x5bc7b1[_0xc494('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b72ba){logger[_0xc494('0x10')](_0xc494('0x16'),_0x1fa4df);logger[_0xc494('0x11')]('ShowInterval',_0x1fa4df,JSON[_0xc494('0x12')](_0x4b72ba));_0x14ef75(_0x4b72ba);})['catch'](function(_0x57eabb){logger[_0xc494('0x14')]('ShowInterval',_0x57eabb[_0xc494('0x15')],_0x1fa4df);_0x5cce26(_0x46ce71[_0xc494('0x14')](0x1f4,_0x57eabb[_0xc494('0x15')]));});});};function checkArrayOfIntervals(_0x304b1d,_0x4dd98b){var _0x56b5be=[];return db[_0xc494('0x7')][_0xc494('0x8')]({'where':{'id':_0x304b1d}})[_0xc494('0xf')](function(_0x18b99b){_0x56b5be=_0x18b99b;return Promise[_0xc494('0x19')](_0x56b5be['map'](function(_0x7d2194){return _0x7d2194[_0xc494('0x1a')](_0x4dd98b);}));})['then'](function(_0x4e87f1){var _0x301880=_0x4e87f1[_0xc494('0x1b')](function(_0x1ae0ec,_0xe3e10b){return _0x1ae0ec||_0xe3e10b;},![]);logger[_0xc494('0x10')](util[_0xc494('0x1c')](_0xc494('0x1d'),_0x56b5be[_0xc494('0xd')](function(_0x313453){return _0x313453[_0xc494('0x1e')];})['join'](',\x20'),_0x56b5be[_0xc494('0xd')](function(_0x182968){return _0x182968['id'];})[_0xc494('0x1f')](',\x20')));return _0x301880;});}function checkSingleInterval(_0x296d4f,_0x29f9a9){return db[_0xc494('0x7')][_0xc494('0x20')](_0x296d4f)[_0xc494('0xf')](function(_0x14d3cc){if(_0x14d3cc){logger[_0xc494('0x10')](util[_0xc494('0x1c')](_0xc494('0x21'),_0x14d3cc[_0xc494('0x1e')],_0x14d3cc['id']));return _0x14d3cc[_0xc494('0x1a')](_0x29f9a9);}});}exports[_0xc494('0x22')]=function(_0x1f0d93){var _0x492347=_0x1f0d93[_0xc494('0x23')];var _0x4ddaf9=Array[_0xc494('0x24')](_0x1f0d93['intervals'])?_0x1f0d93[_0xc494('0x25')]:typeof _0x1f0d93[_0xc494('0x25')]===_0xc494('0x26')?[_0x1f0d93['intervals']]:[];var _0x4dd812=_0x1f0d93[_0xc494('0x27')]||undefined;var _0x243a3b=![];if(_0x4ddaf9[_0xc494('0x28')]){logger[_0xc494('0x10')](util[_0xc494('0x1c')]('IntervalIftime:\x20interval\x20strings\x20=\x20%s',_0x4ddaf9[_0xc494('0x1f')](';\x20')));}if(_0x4dd812){logger[_0xc494('0x10')](util['format'](_0xc494('0x29'),_0x4dd812));}logger[_0xc494('0x11')](_0xc494('0x2a'),_0x243a3b);logger[_0xc494('0x2b')]('IntervalIftime',_0x1f0d93);return Promise[_0xc494('0x2c')]()[_0xc494('0xf')](function(){if(Array[_0xc494('0x24')](_0x492347)){return checkArrayOfIntervals(_0x492347,_0x4dd812);}else if(_0x492347){return checkSingleInterval(_0x492347,_0x4dd812);}})['then'](function(_0x33bab5){var _0x575f83=_0x4ddaf9[_0xc494('0x1b')](function(_0x586b6f,_0x59950c){return _0x586b6f||iftime(_0x59950c,_0x4dd812);},![]);_0x243a3b=_0x33bab5||_0x575f83;return _0x243a3b;})[_0xc494('0x13')](function(_0x2963bb){logger[_0xc494('0x14')]('IntervalIftime',_0x1f0d93,_0x2963bb);throw this[_0xc494('0x14')](0x1f4,_0x2963bb[_0xc494('0x15')]);});}; \ No newline at end of file +var _0x0a06=['where','stringify','then','ifTime','reduce','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','findById','format','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','IntervalIftime','intervalIds','isArray','intervals','string','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','catch','lodash','util','../../mysqldb','iftime','../../config/logger','rpc','findAll','options','raw','limit','map','include','model','attributes','info','debug','error','message','ShowInterval','Interval'];(function(_0x38841c,_0x1af0bf){var _0x500610=function(_0x225955){while(--_0x225955){_0x38841c['push'](_0x38841c['shift']());}};_0x500610(++_0x1af0bf);}(_0x0a06,0x67));var _0x60a0=function(_0x62c646,_0xa08641){_0x62c646=_0x62c646-0x0;var _0x2385f3=_0x0a06[_0x62c646];return _0x2385f3;};'use strict';var _=require(_0x60a0('0x0'));var util=require(_0x60a0('0x1'));var db=require(_0x60a0('0x2'))['db'];var iftime=require('../../utils/iftime')[_0x60a0('0x3')];var logger=require(_0x60a0('0x4'))(_0x60a0('0x5'));exports['GetInterval']=function(_0x277e11){var _0x164c29=this;return new Promise(function(_0x331748,_0x53316e){return db['Interval'][_0x60a0('0x6')]({'raw':_0x277e11[_0x60a0('0x7')]?_0x277e11['options'][_0x60a0('0x8')]===undefined?!![]:![]:!![],'where':_0x277e11[_0x60a0('0x7')]?_0x277e11[_0x60a0('0x7')]['where']||null:null,'attributes':_0x277e11['options']?_0x277e11[_0x60a0('0x7')]['attributes']||null:null,'limit':_0x277e11[_0x60a0('0x7')]?_0x277e11[_0x60a0('0x7')][_0x60a0('0x9')]||null:null,'include':_0x277e11[_0x60a0('0x7')]?_0x277e11[_0x60a0('0x7')]['include']?_[_0x60a0('0xa')](_0x277e11['options'][_0x60a0('0xb')],function(_0x3f666a){return{'model':db[_0x3f666a[_0x60a0('0xc')]],'as':_0x3f666a['as'],'attributes':_0x3f666a[_0x60a0('0xd')],'include':_0x3f666a[_0x60a0('0xb')]?_[_0x60a0('0xa')](_0x3f666a['include'],function(_0x1a9295){return{'model':db[_0x1a9295['model']],'as':_0x1a9295['as'],'attributes':_0x1a9295[_0x60a0('0xd')],'include':_0x1a9295[_0x60a0('0xb')]?_[_0x60a0('0xa')](_0x1a9295[_0x60a0('0xb')],function(_0x5c4a36){return{'model':db[_0x5c4a36[_0x60a0('0xc')]],'as':_0x5c4a36['as'],'attributes':_0x5c4a36[_0x60a0('0xd')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4c0b6c){logger[_0x60a0('0xe')]('GetInterval',_0x277e11);logger[_0x60a0('0xf')]('GetInterval',_0x277e11,JSON['stringify'](_0x4c0b6c));_0x331748(_0x4c0b6c);})['catch'](function(_0x1ca793){logger['error']('GetInterval',_0x1ca793['message'],_0x277e11);_0x53316e(_0x164c29[_0x60a0('0x10')](0x1f4,_0x1ca793[_0x60a0('0x11')]));});});};exports[_0x60a0('0x12')]=function(_0x53e5d7){var _0x2aa731=this;return new Promise(function(_0x2c4fd4,_0x4dccd6){return db[_0x60a0('0x13')]['find']({'raw':_0x53e5d7['options']?_0x53e5d7['options'][_0x60a0('0x8')]===undefined?!![]:![]:!![],'where':_0x53e5d7['options']?_0x53e5d7[_0x60a0('0x7')][_0x60a0('0x14')]||null:null,'attributes':_0x53e5d7[_0x60a0('0x7')]?_0x53e5d7['options']['attributes']||null:null,'include':_0x53e5d7['options']?_0x53e5d7['options']['include']?_[_0x60a0('0xa')](_0x53e5d7[_0x60a0('0x7')][_0x60a0('0xb')],function(_0x3aa277){return{'model':db[_0x3aa277[_0x60a0('0xc')]],'as':_0x3aa277['as'],'attributes':_0x3aa277[_0x60a0('0xd')],'include':_0x3aa277[_0x60a0('0xb')]?_['map'](_0x3aa277[_0x60a0('0xb')],function(_0x31af94){return{'model':db[_0x31af94[_0x60a0('0xc')]],'as':_0x31af94['as'],'attributes':_0x31af94[_0x60a0('0xd')],'include':_0x31af94[_0x60a0('0xb')]?_[_0x60a0('0xa')](_0x31af94[_0x60a0('0xb')],function(_0xf6a456){return{'model':db[_0xf6a456[_0x60a0('0xc')]],'as':_0xf6a456['as'],'attributes':_0xf6a456[_0x60a0('0xd')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x56c991){logger[_0x60a0('0xe')](_0x60a0('0x12'),_0x53e5d7);logger[_0x60a0('0xf')]('ShowInterval',_0x53e5d7,JSON[_0x60a0('0x15')](_0x56c991));_0x2c4fd4(_0x56c991);})['catch'](function(_0x3873d7){logger['error'](_0x60a0('0x12'),_0x3873d7[_0x60a0('0x11')],_0x53e5d7);_0x4dccd6(_0x2aa731[_0x60a0('0x10')](0x1f4,_0x3873d7['message']));});});};function checkArrayOfIntervals(_0x3e2f8d,_0x582440){var _0x5c696a=[];return db[_0x60a0('0x13')]['findAll']({'where':{'id':_0x3e2f8d}})[_0x60a0('0x16')](function(_0x69d7a3){_0x5c696a=_0x69d7a3;return Promise['all'](_0x5c696a[_0x60a0('0xa')](function(_0x1a9465){return _0x1a9465[_0x60a0('0x17')](_0x582440);}));})[_0x60a0('0x16')](function(_0x15f7c9){var _0x38da50=_0x15f7c9[_0x60a0('0x18')](function(_0x4bc07e,_0x261148){return _0x4bc07e||_0x261148;},![]);logger[_0x60a0('0xe')](util['format'](_0x60a0('0x19'),_0x5c696a[_0x60a0('0xa')](function(_0x1276e5){return _0x1276e5[_0x60a0('0x1a')];})[_0x60a0('0x1b')](',\x20'),_0x5c696a['map'](function(_0x5938f9){return _0x5938f9['id'];})[_0x60a0('0x1b')](',\x20')));return _0x38da50;});}function checkSingleInterval(_0x535dca,_0xa58427){return db[_0x60a0('0x13')][_0x60a0('0x1c')](_0x535dca)[_0x60a0('0x16')](function(_0x1b91d1){if(_0x1b91d1){logger['info'](util[_0x60a0('0x1d')](_0x60a0('0x1e'),_0x1b91d1[_0x60a0('0x1a')],_0x1b91d1['id']));return _0x1b91d1['ifTime'](_0xa58427);}});}exports[_0x60a0('0x1f')]=function(_0xc7a820){var _0x5589d9=_0xc7a820[_0x60a0('0x20')];var _0x1bb00d=Array[_0x60a0('0x21')](_0xc7a820['intervals'])?_0xc7a820['intervals']:typeof _0xc7a820[_0x60a0('0x22')]===_0x60a0('0x23')?[_0xc7a820[_0x60a0('0x22')]]:[];var _0x4b86e3=_0xc7a820['timezone']||undefined;var _0x53d2b1=![];if(_0x1bb00d[_0x60a0('0x24')]){logger[_0x60a0('0xe')](util[_0x60a0('0x1d')](_0x60a0('0x25'),_0x1bb00d[_0x60a0('0x1b')](';\x20')));}if(_0x4b86e3){logger[_0x60a0('0xe')](util[_0x60a0('0x1d')](_0x60a0('0x26'),_0x4b86e3));}logger[_0x60a0('0xf')](_0x60a0('0x27'),_0x53d2b1);logger['silly'](_0x60a0('0x1f'),_0xc7a820);return Promise['resolve']()[_0x60a0('0x16')](function(){if(Array[_0x60a0('0x21')](_0x5589d9)){return checkArrayOfIntervals(_0x5589d9,_0x4b86e3);}else if(_0x5589d9){return checkSingleInterval(_0x5589d9,_0x4b86e3);}})[_0x60a0('0x16')](function(_0xc607a9){var _0x4ec7f7=_0x1bb00d[_0x60a0('0x18')](function(_0x282b61,_0x487708){return _0x282b61||iftime(_0x487708,_0x4b86e3);},![]);_0x53d2b1=_0xc607a9||_0x4ec7f7;return _0x53d2b1;})[_0x60a0('0x28')](function(_0x3be8c3){logger[_0x60a0('0x10')](_0x60a0('0x1f'),_0xc7a820,_0x3be8c3);throw this[_0x60a0('0x10')](0x1f4,_0x3be8c3[_0x60a0('0x11')]);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 06d6e54..14241d1 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 _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0x340348,_0x3a83f8){var _0x151c2a=function(_0x54e944){while(--_0x54e944){_0x340348['push'](_0x340348['shift']());}};_0x151c2a(++_0x3a83f8);}(_0xdb28,0x106));var _0x8db2=function(_0x4125d4,_0x2a8255){_0x4125d4=_0x4125d4-0x0;var _0x4668a7=_0xdb28[_0x4125d4];return _0x4668a7;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['post']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);module[_0x8db2('0x6')]=router; \ No newline at end of file +var _0x5f66=['send','exports','Router','./jira.controller','post','isAuthenticated'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x5f66[_0x4243a3];return _0x1b2a33;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);module[_0x65f6('0x5')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 9fdd27f..ece4d04 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 _0x0a16=['email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','customfield_11504','customfield_10102','/rest/api/2/issue','application/json','Basic\x20','toString','request','utf8','data','end','status','statusCode','parse','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','send','body','headers','x-forwarded-for','socket','remoteAddress','../../config/logger','api','MOTGUI','summary','Report','\x20from\x20','stringify','issuetype','Bug','fields','customfield_11500'];(function(_0x5ff027,_0x451702){var _0x2ca147=function(_0x54f4c0){while(--_0x54f4c0){_0x5ff027['push'](_0x5ff027['shift']());}};_0x2ca147(++_0x451702);}(_0x0a16,0x1bd));var _0x60a1=function(_0x3d0cb2,_0x9bcf7c){_0x3d0cb2=_0x3d0cb2-0x0;var _0x579dc8=_0x0a16[_0x3d0cb2];return _0x579dc8;};'use strict';var BPromise=require('bluebird');var https=require('https');var logger=require(_0x60a1('0x0'))(_0x60a1('0x1'));var USERNAME='support';var PASSWORD='3eAmWpBVP0';function openIssue(_0x3454a9,_0x2338a1){var _0x5c8e40={'fields':{'project':{'key':_0x3454a9['key']||_0x60a1('0x2')},'summary':(_0x3454a9[_0x60a1('0x3')]||_0x60a1('0x4'))+_0x60a1('0x5')+_0x3454a9['ip'],'description':_0x3454a9['description']||JSON[_0x60a1('0x6')](_0x3454a9),'issuetype':{'name':_0x3454a9[_0x60a1('0x7')]||_0x60a1('0x8')}}};_0x5c8e40[_0x60a1('0x9')][_0x60a1('0xa')]=_0x3454a9[_0x60a1('0xb')];_0x5c8e40[_0x60a1('0x9')][_0x60a1('0xc')]=_0x3454a9[_0x60a1('0xd')];_0x5c8e40[_0x60a1('0x9')][_0x60a1('0xe')]=_0x3454a9[_0x60a1('0xf')];_0x5c8e40['fields'][_0x60a1('0x10')]=_0x3454a9['name'];_0x5c8e40[_0x60a1('0x9')][_0x60a1('0x11')]=_0x3454a9['reason'];_0x5c8e40[_0x60a1('0x9')][_0x60a1('0x12')]=_0x3454a9['ip'];var _0x9c602c={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x60a1('0x13'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0x60a1('0x14'),'Authorization':_0x60a1('0x15')+new Buffer(USERNAME+':'+PASSWORD)[_0x60a1('0x16')]('base64')}};var _0x3c4023=JSON['stringify'](_0x5c8e40);var _0x49553a=https[_0x60a1('0x17')](_0x9c602c,function(_0x1d1743){_0x1d1743['setEncoding'](_0x60a1('0x18'));var _0x104932='';_0x1d1743['on'](_0x60a1('0x19'),function(_0x5aed80){_0x104932+=_0x5aed80;});_0x1d1743['on'](_0x60a1('0x1a'),function(){if(_0x2338a1){return _0x2338a1[_0x60a1('0x1b')](_0x1d1743[_0x60a1('0x1c')])['json'](JSON[_0x60a1('0x1d')](_0x104932));}});});_0x49553a['on']('error',function(_0xf857ae){if(_0x2338a1){return _0x2338a1['status'](0x1f4)['json']({'errors':[{'message':_0x60a1('0x1e'),'type':_0x60a1('0x1f')}]});}});_0x49553a['write'](_0x3c4023);_0x49553a[_0x60a1('0x1a')]();}exports['openIssue']=openIssue;exports[_0x60a1('0x20')]=function(_0xc79a56,_0x567959){_0xc79a56[_0x60a1('0x21')]['ip']=_0xc79a56[_0x60a1('0x22')][_0x60a1('0x23')]||_0xc79a56['connection']['remoteAddress']||_0xc79a56[_0x60a1('0x24')][_0x60a1('0x25')]||_0xc79a56['connection'][_0x60a1('0x24')][_0x60a1('0x25')];return openIssue(_0xc79a56[_0x60a1('0x21')],_0x567959);}; \ No newline at end of file +var _0x73a6=['name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','POST','application/json','Basic\x20','toString','base64','request','setEncoding','utf8','data','end','status','statusCode','error','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','body','x-forwarded-for','remoteAddress','socket','connection','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','MOTGUI','Report','\x20from\x20','description','stringify','issuetype','fields','customfield_11500','customfield_11501','oldToken','newToken'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x73a6,0x1b1));var _0x673a=function(_0x3b135d,_0x465899){_0x3b135d=_0x3b135d-0x0;var _0x43231a=_0x73a6[_0x3b135d];return _0x43231a;};'use strict';var BPromise=require(_0x673a('0x0'));var https=require(_0x673a('0x1'));var logger=require(_0x673a('0x2'))(_0x673a('0x3'));var USERNAME=_0x673a('0x4');var PASSWORD=_0x673a('0x5');function openIssue(_0x496a88,_0x4da650){var _0xf2e7e5={'fields':{'project':{'key':_0x496a88['key']||_0x673a('0x6')},'summary':(_0x496a88['summary']||_0x673a('0x7'))+_0x673a('0x8')+_0x496a88['ip'],'description':_0x496a88[_0x673a('0x9')]||JSON[_0x673a('0xa')](_0x496a88),'issuetype':{'name':_0x496a88[_0x673a('0xb')]||'Bug'}}};_0xf2e7e5[_0x673a('0xc')][_0x673a('0xd')]=_0x496a88['email'];_0xf2e7e5[_0x673a('0xc')][_0x673a('0xe')]=_0x496a88[_0x673a('0xf')];_0xf2e7e5[_0x673a('0xc')]['customfield_11502']=_0x496a88[_0x673a('0x10')];_0xf2e7e5['fields']['customfield_11503']=_0x496a88[_0x673a('0x11')];_0xf2e7e5[_0x673a('0xc')][_0x673a('0x12')]=_0x496a88[_0x673a('0x13')];_0xf2e7e5[_0x673a('0xc')][_0x673a('0x14')]=_0x496a88['ip'];var _0x2a8385={'host':_0x673a('0x15'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x673a('0x16'),'timeout':0x4e20,'headers':{'Content-Type':_0x673a('0x17'),'Authorization':_0x673a('0x18')+new Buffer(USERNAME+':'+PASSWORD)[_0x673a('0x19')](_0x673a('0x1a'))}};var _0x15c842=JSON[_0x673a('0xa')](_0xf2e7e5);var _0x3d2294=https[_0x673a('0x1b')](_0x2a8385,function(_0x41d7a8){_0x41d7a8[_0x673a('0x1c')](_0x673a('0x1d'));var _0x2b705a='';_0x41d7a8['on'](_0x673a('0x1e'),function(_0x2d296e){_0x2b705a+=_0x2d296e;});_0x41d7a8['on'](_0x673a('0x1f'),function(){if(_0x4da650){return _0x4da650[_0x673a('0x20')](_0x41d7a8[_0x673a('0x21')])['json'](JSON['parse'](_0x2b705a));}});});_0x3d2294['on'](_0x673a('0x22'),function(_0x1fe229){if(_0x4da650){return _0x4da650[_0x673a('0x20')](0x1f4)[_0x673a('0x23')]({'errors':[{'message':_0x673a('0x24'),'type':_0x673a('0x25')}]});}});_0x3d2294[_0x673a('0x26')](_0x15c842);_0x3d2294[_0x673a('0x1f')]();}exports[_0x673a('0x27')]=openIssue;exports['send']=function(_0x1a624f,_0x291862){_0x1a624f[_0x673a('0x28')]['ip']=_0x1a624f['headers'][_0x673a('0x29')]||_0x1a624f['connection'][_0x673a('0x2a')]||_0x1a624f[_0x673a('0x2b')][_0x673a('0x2a')]||_0x1a624f[_0x673a('0x2c')][_0x673a('0x2b')]['remoteAddress'];return openIssue(_0x1a624f['body'],_0x291862);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 6c90599..0c04c19 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 _0x9bde=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','put','delete','destroy','util','connect-timeout','Router'];(function(_0x4dc076,_0x5a92bf){var _0x2a695c=function(_0x201c63){while(--_0x201c63){_0x4dc076['push'](_0x4dc076['shift']());}};_0x2a695c(++_0x5a92bf);}(_0x9bde,0xe1));var _0xe9bd=function(_0x1431f1,_0x385f19){_0x1431f1=_0x1431f1-0x0;var _0x428053=_0x9bde[_0x1431f1];return _0x428053;};'use strict';var multer=require('multer');var util=require(_0xe9bd('0x0'));var path=require('path');var timeout=require(_0xe9bd('0x1'));var express=require('express');var router=express[_0xe9bd('0x2')]();var fs_extra=require(_0xe9bd('0x3'));var auth=require(_0xe9bd('0x4'));var interaction=require(_0xe9bd('0x5'));var config=require(_0xe9bd('0x6'));var controller=require(_0xe9bd('0x7'));router[_0xe9bd('0x8')]('/',auth['isAuthenticated'](),controller[_0xe9bd('0x9')]);router[_0xe9bd('0x8')](_0xe9bd('0xa'),auth[_0xe9bd('0xb')](),controller[_0xe9bd('0xc')]);router[_0xe9bd('0x8')](_0xe9bd('0xd'),auth[_0xe9bd('0xb')](),controller[_0xe9bd('0xe')]);router[_0xe9bd('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe9bd('0x10')](_0xe9bd('0xd'),auth[_0xe9bd('0xb')](),controller['update']);router[_0xe9bd('0x11')](_0xe9bd('0xd'),auth[_0xe9bd('0xb')](),controller[_0xe9bd('0x12')]);module['exports']=router; \ No newline at end of file +var _0x0bb5=['describe','show','post','put','/:id','update','delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','/describe','isAuthenticated'];(function(_0x44bf88,_0x1040b1){var _0x43c5ae=function(_0x4c7d01){while(--_0x4c7d01){_0x44bf88['push'](_0x44bf88['shift']());}};_0x43c5ae(++_0x1040b1);}(_0x0bb5,0x148));var _0x50bb=function(_0x47b984,_0x3d7d2c){_0x47b984=_0x47b984-0x0;var _0x1620d1=_0x0bb5[_0x47b984];return _0x1620d1;};'use strict';var multer=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x50bb('0x2'));var router=express[_0x50bb('0x3')]();var fs_extra=require(_0x50bb('0x4'));var auth=require(_0x50bb('0x5'));var interaction=require(_0x50bb('0x6'));var config=require(_0x50bb('0x7'));var controller=require(_0x50bb('0x8'));router[_0x50bb('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x50bb('0x9')](_0x50bb('0xa'),auth[_0x50bb('0xb')](),controller[_0x50bb('0xc')]);router['get']('/:id',auth[_0x50bb('0xb')](),controller[_0x50bb('0xd')]);router[_0x50bb('0xe')]('/',auth[_0x50bb('0xb')](),controller['create']);router[_0x50bb('0xf')](_0x50bb('0x10'),auth[_0x50bb('0xb')](),controller[_0x50bb('0x11')]);router[_0x50bb('0x12')](_0x50bb('0x10'),auth[_0x50bb('0xb')](),controller['destroy']);module[_0x50bb('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index b63df7e..8f97683 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(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x7a54,0x106));var _0x47a5=function(_0x143ec5,_0x32c441){_0x143ec5=_0x143ec5-0x0;var _0x1dfd54=_0x7a54[_0x143ec5];return _0x1dfd54;};'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(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x7a54,0x106));var _0x47a5=function(_0x5aab92,_0x483ae7){_0x5aab92=_0x5aab92-0x0;var _0x2a6515=_0x7a54[_0x5aab92];return _0x2a6515;};'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 891015f..d6c1536 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 _0x3bd7=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','stack','name','send','index','map','rawAttributes','key','model','keys','filters','intersection','query','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','JscriptyAnswerReport','includeAll','include','findAll','rows','catch','show','params','create','update','body','find','describe','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','squel','to-csv'];(function(_0x225a8,_0x193460){var _0x2da65c=function(_0xf8c447){while(--_0xf8c447){_0x225a8['push'](_0x225a8['shift']());}};_0x2da65c(++_0x193460);}(_0x3bd7,0x199));var _0x73bd=function(_0x154192,_0x2d360f){_0x154192=_0x154192-0x0;var _0x3c2792=_0x3bd7[_0x154192];return _0x3c2792;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x73bd('0x0'));var jsonpatch=require(_0x73bd('0x1'));var rp=require(_0x73bd('0x2'));var moment=require('moment');var BPromise=require(_0x73bd('0x3'));var Mustache=require(_0x73bd('0x4'));var util=require(_0x73bd('0x5'));var path=require('path');var sox=require(_0x73bd('0x6'));var csv=require('to-csv');var ejs=require(_0x73bd('0x7'));var fs=require('fs');var fs_extra=require(_0x73bd('0x8'));var _=require('lodash');var squel=require(_0x73bd('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x73bd('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x73bd('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x73bd('0xc'));var as=require(_0x73bd('0xd'));var hardwareService=require(_0x73bd('0xe'));var logger=require(_0x73bd('0xf'))(_0x73bd('0x10'));var utils=require(_0x73bd('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x73bd('0x12'));var db=require(_0x73bd('0x13'))['db'];function respondWithStatusCode(_0x31c882,_0x41f324){_0x41f324=_0x41f324||0xcc;return function(_0x2a5dea){if(_0x2a5dea){return _0x31c882[_0x73bd('0x14')](_0x41f324);}return _0x31c882['status'](_0x41f324)[_0x73bd('0x15')]();};}function respondWithResult(_0x5c4bc8,_0x189007){_0x189007=_0x189007||0xc8;return function(_0x3eab86){if(_0x3eab86){return _0x5c4bc8[_0x73bd('0x16')](_0x189007)[_0x73bd('0x17')](_0x3eab86);}};}function respondWithFilteredResult(_0x3e628a,_0x5ea8db){return function(_0x41663e){if(_0x41663e){var _0xfdf66=typeof _0x5ea8db[_0x73bd('0x18')]===_0x73bd('0x19')&&typeof _0x5ea8db[_0x73bd('0x1a')]===_0x73bd('0x19');var _0x10e371=_0x41663e[_0x73bd('0x1b')];var _0x21787b=_0xfdf66?0x0:_0x5ea8db['offset'];var _0x1e559b=_0xfdf66?_0x41663e[_0x73bd('0x1b')]:_0x5ea8db[_0x73bd('0x18')]+_0x5ea8db[_0x73bd('0x1a')];var _0x1cb0e3;if(_0x1e559b>=_0x10e371){_0x1e559b=_0x10e371;_0x1cb0e3=0xc8;}else{_0x1cb0e3=0xce;}_0x3e628a[_0x73bd('0x16')](_0x1cb0e3);return _0x3e628a[_0x73bd('0x1c')](_0x73bd('0x1d'),_0x21787b+'-'+_0x1e559b+'/'+_0x10e371)[_0x73bd('0x17')](_0x41663e);}return null;};}function patchUpdates(_0x57d1ec){return function(_0x459965){try{jsonpatch[_0x73bd('0x1e')](_0x459965,_0x57d1ec,!![]);}catch(_0x292f8c){return BPromise['reject'](_0x292f8c);}return _0x459965['save']();};}function saveUpdates(_0x4f23e6,_0x10b388){return function(_0x269e84){if(_0x269e84){return _0x269e84['update'](_0x4f23e6)[_0x73bd('0x1f')](function(_0x22574c){return _0x22574c;});}return null;};}function removeEntity(_0x5b7bbb,_0x325cc1){return function(_0x1e22c5){if(_0x1e22c5){return _0x1e22c5[_0x73bd('0x20')]()[_0x73bd('0x1f')](function(){_0x5b7bbb[_0x73bd('0x16')](0xcc)[_0x73bd('0x15')]();});}};}function handleEntityNotFound(_0x2dd70b,_0x36f7e0){return function(_0x840215){if(!_0x840215){_0x2dd70b[_0x73bd('0x14')](0x194);}return _0x840215;};}function handleError(_0x473527,_0x388698){_0x388698=_0x388698||0x1f4;return function(_0x52e910){logger['error'](_0x52e910[_0x73bd('0x21')]);if(_0x52e910[_0x73bd('0x22')]){delete _0x52e910['name'];}_0x473527[_0x73bd('0x16')](_0x388698)[_0x73bd('0x23')](_0x52e910);};}exports[_0x73bd('0x24')]=function(_0x5ada8d,_0x5ae04e){var _0x2f38fe={},_0x3f15f8={},_0x315318={'count':0x0,'rows':[]};var _0x5be8d6=_[_0x73bd('0x25')](db['JscriptyAnswerReport'][_0x73bd('0x26')],function(_0x2701da){return{'name':_0x2701da['fieldName'],'type':_0x2701da['type'][_0x73bd('0x27')]};});_0x3f15f8[_0x73bd('0x28')]=_[_0x73bd('0x25')](_0x5be8d6,_0x73bd('0x22'));_0x3f15f8['query']=_[_0x73bd('0x29')](_0x5ada8d['query']);_0x3f15f8[_0x73bd('0x2a')]=_[_0x73bd('0x2b')](_0x3f15f8[_0x73bd('0x28')],_0x3f15f8[_0x73bd('0x2c')]);_0x2f38fe['attributes']=_[_0x73bd('0x2b')](_0x3f15f8[_0x73bd('0x28')],qs[_0x73bd('0x2d')](_0x5ada8d[_0x73bd('0x2c')][_0x73bd('0x2d')]));_0x2f38fe[_0x73bd('0x2e')]=_0x2f38fe[_0x73bd('0x2e')][_0x73bd('0x2f')]?_0x2f38fe['attributes']:_0x3f15f8[_0x73bd('0x28')];if(!_0x5ada8d[_0x73bd('0x2c')]['hasOwnProperty'](_0x73bd('0x30'))){_0x2f38fe[_0x73bd('0x1a')]=qs['limit'](_0x5ada8d[_0x73bd('0x2c')]['limit']);_0x2f38fe[_0x73bd('0x18')]=qs['offset'](_0x5ada8d[_0x73bd('0x2c')][_0x73bd('0x18')]);}_0x2f38fe[_0x73bd('0x31')]=qs[_0x73bd('0x32')](_0x5ada8d[_0x73bd('0x2c')][_0x73bd('0x32')]);_0x2f38fe[_0x73bd('0x33')]=qs['filters'](_[_0x73bd('0x34')](_0x5ada8d[_0x73bd('0x2c')],_0x3f15f8['filters']),_0x5be8d6);if(_0x5ada8d[_0x73bd('0x2c')]['filter']){_0x2f38fe[_0x73bd('0x33')]=_[_0x73bd('0x35')](_0x2f38fe[_0x73bd('0x33')],{'$or':_[_0x73bd('0x25')](_0x5be8d6,function(_0x367597){if(_0x367597['type']!==_0x73bd('0x36')){var _0x2de851={};_0x2de851[_0x367597[_0x73bd('0x22')]]={'$like':'%'+_0x5ada8d['query'][_0x73bd('0x37')]+'%'};return _0x2de851;}})});}_0x2f38fe=_[_0x73bd('0x35')]({},_0x2f38fe,_0x5ada8d[_0x73bd('0x38')]);var _0x30e148={'where':_0x2f38fe[_0x73bd('0x33')]};return db[_0x73bd('0x39')][_0x73bd('0x1b')](_0x30e148)[_0x73bd('0x1f')](function(_0x519c3c){_0x315318[_0x73bd('0x1b')]=_0x519c3c;if(_0x5ada8d[_0x73bd('0x2c')][_0x73bd('0x3a')]){_0x2f38fe[_0x73bd('0x3b')]=[{'all':!![]}];}return db[_0x73bd('0x39')][_0x73bd('0x3c')](_0x2f38fe);})[_0x73bd('0x1f')](function(_0x48fed7){_0x315318[_0x73bd('0x3d')]=_0x48fed7;return _0x315318;})[_0x73bd('0x1f')](respondWithFilteredResult(_0x5ae04e,_0x2f38fe))[_0x73bd('0x3e')](handleError(_0x5ae04e,null));};exports[_0x73bd('0x3f')]=function(_0x532afd,_0x142532){var _0x234de7={'raw':!![],'where':{'id':_0x532afd[_0x73bd('0x40')]['id']}},_0xe91596={};_0xe91596[_0x73bd('0x28')]=_['keys'](db[_0x73bd('0x39')]['rawAttributes']);_0xe91596[_0x73bd('0x2c')]=_['keys'](_0x532afd[_0x73bd('0x2c')]);_0xe91596[_0x73bd('0x2a')]=_['intersection'](_0xe91596[_0x73bd('0x28')],_0xe91596[_0x73bd('0x2c')]);_0x234de7[_0x73bd('0x2e')]=_[_0x73bd('0x2b')](_0xe91596[_0x73bd('0x28')],qs['fields'](_0x532afd[_0x73bd('0x2c')][_0x73bd('0x2d')]));_0x234de7[_0x73bd('0x2e')]=_0x234de7[_0x73bd('0x2e')][_0x73bd('0x2f')]?_0x234de7[_0x73bd('0x2e')]:_0xe91596[_0x73bd('0x28')];if(_0x532afd[_0x73bd('0x2c')]['includeAll']){_0x234de7['include']=[{'all':!![]}];}_0x234de7=_[_0x73bd('0x35')]({},_0x234de7,_0x532afd[_0x73bd('0x38')]);return db[_0x73bd('0x39')]['find'](_0x234de7)[_0x73bd('0x1f')](handleEntityNotFound(_0x142532,null))['then'](respondWithResult(_0x142532,null))[_0x73bd('0x3e')](handleError(_0x142532,null));};exports[_0x73bd('0x41')]=function(_0x57df9e,_0x4905a4){return db['JscriptyAnswerReport'][_0x73bd('0x41')](_0x57df9e['body'],{})[_0x73bd('0x1f')](respondWithResult(_0x4905a4,0xc9))['catch'](handleError(_0x4905a4,null));};exports[_0x73bd('0x42')]=function(_0x1e2e28,_0x7b4baf){if(_0x1e2e28[_0x73bd('0x43')]['id']){delete _0x1e2e28['body']['id'];}return db[_0x73bd('0x39')][_0x73bd('0x44')]({'where':{'id':_0x1e2e28[_0x73bd('0x40')]['id']}})[_0x73bd('0x1f')](handleEntityNotFound(_0x7b4baf,null))[_0x73bd('0x1f')](saveUpdates(_0x1e2e28[_0x73bd('0x43')],null))[_0x73bd('0x1f')](respondWithResult(_0x7b4baf,null))[_0x73bd('0x3e')](handleError(_0x7b4baf,null));};exports['destroy']=function(_0x8b88f5,_0x47397d){return db['JscriptyAnswerReport'][_0x73bd('0x44')]({'where':{'id':_0x8b88f5[_0x73bd('0x40')]['id']}})[_0x73bd('0x1f')](handleEntityNotFound(_0x47397d,null))['then'](removeEntity(_0x47397d,null))[_0x73bd('0x3e')](handleError(_0x47397d,null));};exports[_0x73bd('0x45')]=function(_0x23b5ad,_0x2201c7){return db[_0x73bd('0x39')]['describe']()['then'](respondWithResult(_0x2201c7,null))['catch'](handleError(_0x2201c7,null));}; \ No newline at end of file +var _0x37cc=['querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','rows','show','params','includeAll','include','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js'];(function(_0x404e84,_0x137d6d){var _0x516387=function(_0x1bba83){while(--_0x1bba83){_0x404e84['push'](_0x404e84['shift']());}};_0x516387(++_0x137d6d);}(_0x37cc,0x185));var _0xc37c=function(_0x2e9ce5,_0x156a53){_0x2e9ce5=_0x2e9ce5-0x0;var _0x2f2e01=_0x37cc[_0x2e9ce5];return _0x2f2e01;};'use strict';var emlformat=require(_0xc37c('0x0'));var rimraf=require(_0xc37c('0x1'));var zipdir=require(_0xc37c('0x2'));var jsonpatch=require(_0xc37c('0x3'));var rp=require(_0xc37c('0x4'));var moment=require(_0xc37c('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc37c('0x6'));var path=require(_0xc37c('0x7'));var sox=require(_0xc37c('0x8'));var csv=require(_0xc37c('0x9'));var ejs=require(_0xc37c('0xa'));var fs=require('fs');var fs_extra=require(_0xc37c('0xb'));var _=require(_0xc37c('0xc'));var squel=require(_0xc37c('0xd'));var crypto=require(_0xc37c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc37c('0xf'));var toCsv=require(_0xc37c('0x9'));var querystring=require(_0xc37c('0x10'));var Papa=require(_0xc37c('0x11'));var Redis=require(_0xc37c('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xc37c('0x13'));var as=require(_0xc37c('0x14'));var hardwareService=require(_0xc37c('0x15'));var logger=require(_0xc37c('0x16'))(_0xc37c('0x17'));var utils=require(_0xc37c('0x18'));var config=require(_0xc37c('0x19'));var licenseUtil=require(_0xc37c('0x1a'));var db=require(_0xc37c('0x1b'))['db'];function respondWithStatusCode(_0xd90fc8,_0x43392c){_0x43392c=_0x43392c||0xcc;return function(_0x56ce39){if(_0x56ce39){return _0xd90fc8['sendStatus'](_0x43392c);}return _0xd90fc8[_0xc37c('0x1c')](_0x43392c)[_0xc37c('0x1d')]();};}function respondWithResult(_0x2d87c1,_0xac116d){_0xac116d=_0xac116d||0xc8;return function(_0x2dc501){if(_0x2dc501){return _0x2d87c1[_0xc37c('0x1c')](_0xac116d)['json'](_0x2dc501);}};}function respondWithFilteredResult(_0x329793,_0x500a3b){return function(_0x5b05f8){if(_0x5b05f8){var _0x128d81=typeof _0x500a3b[_0xc37c('0x1e')]===_0xc37c('0x1f')&&typeof _0x500a3b[_0xc37c('0x20')]==='undefined';var _0x577165=_0x5b05f8['count'];var _0x2d6129=_0x128d81?0x0:_0x500a3b['offset'];var _0x370c2f=_0x128d81?_0x5b05f8[_0xc37c('0x21')]:_0x500a3b['offset']+_0x500a3b[_0xc37c('0x20')];var _0x438e42;if(_0x370c2f>=_0x577165){_0x370c2f=_0x577165;_0x438e42=0xc8;}else{_0x438e42=0xce;}_0x329793[_0xc37c('0x1c')](_0x438e42);return _0x329793[_0xc37c('0x22')]('Content-Range',_0x2d6129+'-'+_0x370c2f+'/'+_0x577165)[_0xc37c('0x23')](_0x5b05f8);}return null;};}function patchUpdates(_0x4d3aa4){return function(_0x1f941b){try{jsonpatch[_0xc37c('0x24')](_0x1f941b,_0x4d3aa4,!![]);}catch(_0x237cc6){return BPromise[_0xc37c('0x25')](_0x237cc6);}return _0x1f941b[_0xc37c('0x26')]();};}function saveUpdates(_0x5e931a,_0x148334){return function(_0x33aa68){if(_0x33aa68){return _0x33aa68[_0xc37c('0x27')](_0x5e931a)[_0xc37c('0x28')](function(_0x358fc8){return _0x358fc8;});}return null;};}function removeEntity(_0x87a6a6,_0x15a392){return function(_0x70e0b5){if(_0x70e0b5){return _0x70e0b5[_0xc37c('0x29')]()[_0xc37c('0x28')](function(){_0x87a6a6[_0xc37c('0x1c')](0xcc)[_0xc37c('0x1d')]();});}};}function handleEntityNotFound(_0x3076fc,_0x59274a){return function(_0x214d0a){if(!_0x214d0a){_0x3076fc[_0xc37c('0x2a')](0x194);}return _0x214d0a;};}function handleError(_0x1d59fa,_0x484c43){_0x484c43=_0x484c43||0x1f4;return function(_0x53f062){logger[_0xc37c('0x2b')](_0x53f062[_0xc37c('0x2c')]);if(_0x53f062[_0xc37c('0x2d')]){delete _0x53f062[_0xc37c('0x2d')];}_0x1d59fa[_0xc37c('0x1c')](_0x484c43)[_0xc37c('0x2e')](_0x53f062);};}exports[_0xc37c('0x2f')]=function(_0x47266c,_0x5d13b3){var _0x14129d={},_0x466094={},_0x180260={'count':0x0,'rows':[]};var _0x39d78e=_[_0xc37c('0x30')](db[_0xc37c('0x31')][_0xc37c('0x32')],function(_0x1c3e9d){return{'name':_0x1c3e9d[_0xc37c('0x33')],'type':_0x1c3e9d[_0xc37c('0x34')][_0xc37c('0x35')]};});_0x466094[_0xc37c('0x36')]=_[_0xc37c('0x30')](_0x39d78e,'name');_0x466094[_0xc37c('0x37')]=_[_0xc37c('0x38')](_0x47266c['query']);_0x466094['filters']=_[_0xc37c('0x39')](_0x466094[_0xc37c('0x36')],_0x466094[_0xc37c('0x37')]);_0x14129d['attributes']=_[_0xc37c('0x39')](_0x466094['model'],qs[_0xc37c('0x3a')](_0x47266c[_0xc37c('0x37')]['fields']));_0x14129d[_0xc37c('0x3b')]=_0x14129d[_0xc37c('0x3b')][_0xc37c('0x3c')]?_0x14129d[_0xc37c('0x3b')]:_0x466094[_0xc37c('0x36')];if(!_0x47266c[_0xc37c('0x37')][_0xc37c('0x3d')]('nolimit')){_0x14129d['limit']=qs[_0xc37c('0x20')](_0x47266c[_0xc37c('0x37')][_0xc37c('0x20')]);_0x14129d[_0xc37c('0x1e')]=qs['offset'](_0x47266c[_0xc37c('0x37')][_0xc37c('0x1e')]);}_0x14129d[_0xc37c('0x3e')]=qs['sort'](_0x47266c[_0xc37c('0x37')][_0xc37c('0x3f')]);_0x14129d['where']=qs[_0xc37c('0x40')](_[_0xc37c('0x41')](_0x47266c['query'],_0x466094[_0xc37c('0x40')]),_0x39d78e);if(_0x47266c[_0xc37c('0x37')][_0xc37c('0x42')]){_0x14129d[_0xc37c('0x43')]=_[_0xc37c('0x44')](_0x14129d[_0xc37c('0x43')],{'$or':_[_0xc37c('0x30')](_0x39d78e,function(_0xfed425){if(_0xfed425[_0xc37c('0x34')]!==_0xc37c('0x45')){var _0x167b50={};_0x167b50[_0xfed425[_0xc37c('0x2d')]]={'$like':'%'+_0x47266c[_0xc37c('0x37')][_0xc37c('0x42')]+'%'};return _0x167b50;}})});}_0x14129d=_[_0xc37c('0x44')]({},_0x14129d,_0x47266c[_0xc37c('0x46')]);var _0x476231={'where':_0x14129d['where']};return db[_0xc37c('0x31')][_0xc37c('0x21')](_0x476231)[_0xc37c('0x28')](function(_0x4f73e2){_0x180260[_0xc37c('0x21')]=_0x4f73e2;if(_0x47266c['query']['includeAll']){_0x14129d['include']=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0x14129d);})[_0xc37c('0x28')](function(_0x423859){_0x180260[_0xc37c('0x47')]=_0x423859;return _0x180260;})[_0xc37c('0x28')](respondWithFilteredResult(_0x5d13b3,_0x14129d))['catch'](handleError(_0x5d13b3,null));};exports[_0xc37c('0x48')]=function(_0x1b0d35,_0x532bb5){var _0x207310={'raw':!![],'where':{'id':_0x1b0d35[_0xc37c('0x49')]['id']}},_0x1ca536={};_0x1ca536[_0xc37c('0x36')]=_[_0xc37c('0x38')](db[_0xc37c('0x31')][_0xc37c('0x32')]);_0x1ca536['query']=_[_0xc37c('0x38')](_0x1b0d35['query']);_0x1ca536['filters']=_['intersection'](_0x1ca536[_0xc37c('0x36')],_0x1ca536['query']);_0x207310[_0xc37c('0x3b')]=_['intersection'](_0x1ca536[_0xc37c('0x36')],qs[_0xc37c('0x3a')](_0x1b0d35[_0xc37c('0x37')][_0xc37c('0x3a')]));_0x207310[_0xc37c('0x3b')]=_0x207310[_0xc37c('0x3b')]['length']?_0x207310['attributes']:_0x1ca536['model'];if(_0x1b0d35[_0xc37c('0x37')][_0xc37c('0x4a')]){_0x207310[_0xc37c('0x4b')]=[{'all':!![]}];}_0x207310=_[_0xc37c('0x44')]({},_0x207310,_0x1b0d35[_0xc37c('0x46')]);return db[_0xc37c('0x31')][_0xc37c('0x4c')](_0x207310)['then'](handleEntityNotFound(_0x532bb5,null))['then'](respondWithResult(_0x532bb5,null))[_0xc37c('0x4d')](handleError(_0x532bb5,null));};exports[_0xc37c('0x4e')]=function(_0x171376,_0x46661c){return db[_0xc37c('0x31')][_0xc37c('0x4e')](_0x171376[_0xc37c('0x4f')],{})[_0xc37c('0x28')](respondWithResult(_0x46661c,0xc9))[_0xc37c('0x4d')](handleError(_0x46661c,null));};exports[_0xc37c('0x27')]=function(_0x5589c7,_0x73c059){if(_0x5589c7[_0xc37c('0x4f')]['id']){delete _0x5589c7[_0xc37c('0x4f')]['id'];}return db[_0xc37c('0x31')][_0xc37c('0x4c')]({'where':{'id':_0x5589c7['params']['id']}})[_0xc37c('0x28')](handleEntityNotFound(_0x73c059,null))['then'](saveUpdates(_0x5589c7[_0xc37c('0x4f')],null))[_0xc37c('0x28')](respondWithResult(_0x73c059,null))[_0xc37c('0x4d')](handleError(_0x73c059,null));};exports[_0xc37c('0x29')]=function(_0x13552f,_0x1960b6){return db[_0xc37c('0x31')][_0xc37c('0x4c')]({'where':{'id':_0x13552f[_0xc37c('0x49')]['id']}})[_0xc37c('0x28')](handleEntityNotFound(_0x1960b6,null))[_0xc37c('0x28')](removeEntity(_0x1960b6,null))[_0xc37c('0x4d')](handleError(_0x1960b6,null));};exports[_0xc37c('0x50')]=function(_0x361d5e,_0x63a8e8){return db[_0xc37c('0x31')][_0xc37c('0x50')]()[_0xc37c('0x28')](respondWithResult(_0x63a8e8,null))[_0xc37c('0x4d')](handleError(_0x63a8e8,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index d359ec1..34aa8b2 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 _0xee3a=['./jscriptyAnswerReport.attributes','define','JscriptyAnswerReport','report_jscripty_answers','lodash','util','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xee3a,0x93));var _0xaee3=function(_0x1f8f4e,_0x100d83){_0x1f8f4e=_0x1f8f4e-0x0;var _0x4708fb=_0xee3a[_0x1f8f4e];return _0x4708fb;};'use strict';var _=require(_0xaee3('0x0'));var util=require(_0xaee3('0x1'));var logger=require('../../config/logger')(_0xaee3('0x2'));var moment=require(_0xaee3('0x3'));var BPromise=require(_0xaee3('0x4'));var rp=require(_0xaee3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xaee3('0x6'));var attributes=require(_0xaee3('0x7'));module['exports']=function(_0x27409c,_0x1cfbf5){return _0x27409c[_0xaee3('0x8')](_0xaee3('0x9'),attributes,{'tableName':_0xaee3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcbd3=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','lodash','util','../../config/logger','api'];(function(_0x802ee9,_0x3d6908){var _0x456787=function(_0x4ef696){while(--_0x4ef696){_0x802ee9['push'](_0x802ee9['shift']());}};_0x456787(++_0x3d6908);}(_0xcbd3,0x1b8));var _0x3cbd=function(_0x54303b,_0x5af5cf){_0x54303b=_0x54303b-0x0;var _0xd2b2e7=_0xcbd3[_0x54303b];return _0xd2b2e7;};'use strict';var _=require(_0x3cbd('0x0'));var util=require(_0x3cbd('0x1'));var logger=require(_0x3cbd('0x2'))(_0x3cbd('0x3'));var moment=require(_0x3cbd('0x4'));var BPromise=require(_0x3cbd('0x5'));var rp=require(_0x3cbd('0x6'));var fs=require('fs');var path=require(_0x3cbd('0x7'));var rimraf=require(_0x3cbd('0x8'));var config=require(_0x3cbd('0x9'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0x3cbd('0xa')]=function(_0x14cb7c,_0x52a3d8){return _0x14cb7c[_0x3cbd('0xb')]('JscriptyAnswerReport',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 53a3812..ea8a6a0 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 _0xa24d=['http','request','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x155774,_0x3e0b67){var _0x3fe156=function(_0x23bad8){while(--_0x23bad8){_0x155774['push'](_0x155774['shift']());}};_0x3fe156(++_0x3e0b67);}(_0xa24d,0x1c1));var _0xda24=function(_0x2ffee8,_0x126cdd){_0x2ffee8=_0x2ffee8-0x0;var _0x432ebf=_0xa24d[_0x2ffee8];return _0x432ebf;};'use strict';var _=require(_0xda24('0x0'));var util=require(_0xda24('0x1'));var moment=require(_0xda24('0x2'));var BPromise=require(_0xda24('0x3'));var rs=require(_0xda24('0x4'));var fs=require('fs');var Redis=require(_0xda24('0x5'));var db=require(_0xda24('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xda24('0x7'))(_0xda24('0x8'));var config=require(_0xda24('0x9'));var jayson=require(_0xda24('0xa'));var client=jayson['client'][_0xda24('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xdba54e,_0x5868af,_0x3d0ec5){return new BPromise(function(_0x48117a,_0x446e2e){return client[_0xda24('0xc')](_0xdba54e,_0x3d0ec5)[_0xda24('0xd')](function(_0x1dccb2){logger['info'](_0xda24('0xe'),_0x5868af,_0xda24('0xf'));logger[_0xda24('0x10')](_0xda24('0x11'),_0x5868af,_0xda24('0xf'),JSON['stringify'](_0x1dccb2));if(_0x1dccb2[_0xda24('0x12')]){if(_0x1dccb2['error'][_0xda24('0x13')]===0x1f4){logger[_0xda24('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x5868af,_0x1dccb2['error'][_0xda24('0x14')]);return _0x446e2e(_0x1dccb2[_0xda24('0x12')][_0xda24('0x14')]);}logger[_0xda24('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x5868af,_0x1dccb2[_0xda24('0x12')]['message']);return _0x48117a(_0x1dccb2[_0xda24('0x12')][_0xda24('0x14')]);}else{logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0x5868af,_0xda24('0xf'));_0x48117a(_0x1dccb2[_0xda24('0x15')][_0xda24('0x14')]);}})[_0xda24('0x16')](function(_0x3348e0){logger[_0xda24('0x12')](_0xda24('0xe'),_0x5868af,_0x3348e0);_0x446e2e(_0x3348e0);});});} \ No newline at end of file +var _0x2f2e=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../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','message','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x39b859,_0x2315ec){var _0x20c0b2=function(_0x540023){while(--_0x540023){_0x39b859['push'](_0x39b859['shift']());}};_0x20c0b2(++_0x2315ec);}(_0x2f2e,0x1c3));var _0xe2f2=function(_0x255c48,_0x2a4449){_0x255c48=_0x255c48-0x0;var _0xaebda3=_0x2f2e[_0x255c48];return _0xaebda3;};'use strict';var _=require(_0xe2f2('0x0'));var util=require(_0xe2f2('0x1'));var moment=require(_0xe2f2('0x2'));var BPromise=require(_0xe2f2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe2f2('0x4'));var db=require(_0xe2f2('0x5'))['db'];var utils=require(_0xe2f2('0x6'));var logger=require(_0xe2f2('0x7'))(_0xe2f2('0x8'));var config=require(_0xe2f2('0x9'));var jayson=require(_0xe2f2('0xa'));var client=jayson[_0xe2f2('0xb')][_0xe2f2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x28cecf,_0x205a6a,_0xaba7fd){return new BPromise(function(_0x12af2f,_0x5f1682){return client[_0xe2f2('0xd')](_0x28cecf,_0xaba7fd)[_0xe2f2('0xe')](function(_0x7c57d9){logger[_0xe2f2('0xf')](_0xe2f2('0x10'),_0x205a6a,_0xe2f2('0x11'));logger[_0xe2f2('0x12')](_0xe2f2('0x13'),_0x205a6a,_0xe2f2('0x11'),JSON[_0xe2f2('0x14')](_0x7c57d9));if(_0x7c57d9[_0xe2f2('0x15')]){if(_0x7c57d9[_0xe2f2('0x15')]['code']===0x1f4){logger[_0xe2f2('0x15')](_0xe2f2('0x10'),_0x205a6a,_0x7c57d9[_0xe2f2('0x15')][_0xe2f2('0x16')]);return _0x5f1682(_0x7c57d9[_0xe2f2('0x15')][_0xe2f2('0x16')]);}logger[_0xe2f2('0x15')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x205a6a,_0x7c57d9[_0xe2f2('0x15')]['message']);return _0x12af2f(_0x7c57d9[_0xe2f2('0x15')][_0xe2f2('0x16')]);}else{logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0x205a6a,_0xe2f2('0x11'));_0x12af2f(_0x7c57d9['result']['message']);}})[_0xe2f2('0x17')](function(_0x33b1cf){logger[_0xe2f2('0x15')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x205a6a,_0x33b1cf);_0x5f1682(_0x33b1cf);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index b5b73fa..1093fd9 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 _0x13b8=['getSessions','/:id/answers','getAnswers','/:id/summary','30s','create','/:id/clone','clone','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','show','/:id/sessions'];(function(_0x2701d0,_0x337692){var _0x2382a2=function(_0x23f159){while(--_0x23f159){_0x2701d0['push'](_0x2701d0['shift']());}};_0x2382a2(++_0x337692);}(_0x13b8,0x12f));var _0x813b=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0x13b8[_0x3a6efd];return _0x487b9a;};'use strict';var multer=require(_0x813b('0x0'));var util=require(_0x813b('0x1'));var path=require('path');var timeout=require(_0x813b('0x2'));var express=require(_0x813b('0x3'));var router=express[_0x813b('0x4')]();var fs_extra=require(_0x813b('0x5'));var auth=require(_0x813b('0x6'));var interaction=require(_0x813b('0x7'));var config=require(_0x813b('0x8'));var controller=require(_0x813b('0x9'));router[_0x813b('0xa')]('/',auth[_0x813b('0xb')](),controller[_0x813b('0xc')]);router[_0x813b('0xa')](_0x813b('0xd'),auth[_0x813b('0xb')](),controller[_0x813b('0xe')]);router['get'](_0x813b('0xf'),auth[_0x813b('0xb')](),controller[_0x813b('0x10')]);router['get'](_0x813b('0x11'),auth[_0x813b('0xb')](),controller[_0x813b('0x12')]);router[_0x813b('0xa')](_0x813b('0x13'),auth[_0x813b('0xb')](),timeout(_0x813b('0x14')),controller['getSummary']);router['post']('/',auth[_0x813b('0xb')](),controller[_0x813b('0x15')]);router['post'](_0x813b('0x16'),auth['isAuthenticated'](),controller[_0x813b('0x17')]);router[_0x813b('0x18')](_0x813b('0xd'),auth[_0x813b('0xb')](),controller[_0x813b('0x19')]);router[_0x813b('0x1a')]('/:id',auth[_0x813b('0xb')](),controller[_0x813b('0x1b')]);module[_0x813b('0x1c')]=router; \ No newline at end of file +var _0x8a59=['delete','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id/sessions','getSessions','getAnswers','/:id/summary','30s','getSummary','post','create','/:id/clone','clone','/:id','update'];(function(_0x7c819,_0x3e3cec){var _0x16f303=function(_0x44c942){while(--_0x44c942){_0x7c819['push'](_0x7c819['shift']());}};_0x16f303(++_0x3e3cec);}(_0x8a59,0xc1));var _0x98a5=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x8a59[_0xb0f7c3];return _0x28ea68;};'use strict';var multer=require(_0x98a5('0x0'));var util=require('util');var path=require(_0x98a5('0x1'));var timeout=require('connect-timeout');var express=require(_0x98a5('0x2'));var router=express[_0x98a5('0x3')]();var fs_extra=require(_0x98a5('0x4'));var auth=require(_0x98a5('0x5'));var interaction=require(_0x98a5('0x6'));var config=require(_0x98a5('0x7'));var controller=require('./jscriptyProject.controller');router[_0x98a5('0x8')]('/',auth[_0x98a5('0x9')](),controller[_0x98a5('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x98a5('0x8')](_0x98a5('0xb'),auth[_0x98a5('0x9')](),controller[_0x98a5('0xc')]);router[_0x98a5('0x8')]('/:id/answers',auth[_0x98a5('0x9')](),controller[_0x98a5('0xd')]);router['get'](_0x98a5('0xe'),auth[_0x98a5('0x9')](),timeout(_0x98a5('0xf')),controller[_0x98a5('0x10')]);router[_0x98a5('0x11')]('/',auth[_0x98a5('0x9')](),controller[_0x98a5('0x12')]);router['post'](_0x98a5('0x13'),auth[_0x98a5('0x9')](),controller[_0x98a5('0x14')]);router['put'](_0x98a5('0x15'),auth['isAuthenticated'](),controller[_0x98a5('0x16')]);router[_0x98a5('0x17')](_0x98a5('0x15'),auth[_0x98a5('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 770cfa4..f8d1d8d 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 _0x1549=['formData','stringify','isString','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util','exports','STRING','name','long','isObjectLike'];(function(_0x4104ca,_0x2eaf1b){var _0x3a0fd0=function(_0xe642ee){while(--_0xe642ee){_0x4104ca['push'](_0x4104ca['shift']());}};_0x3a0fd0(++_0x2eaf1b);}(_0x1549,0x119));var _0x9154=function(_0x57d370,_0x3ed0f6){_0x57d370=_0x57d370-0x0;var _0x550fd2=_0x1549[_0x57d370];return _0x550fd2;};'use strict';var Sequelize=require(_0x9154('0x0'));var _=require(_0x9154('0x1'));var util=require(_0x9154('0x2'));module[_0x9154('0x3')]={'name':{'type':Sequelize[_0x9154('0x4')],'unique':_0x9154('0x5')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0x9154('0x6')),'set':function(_0x6e0a66){if(_[_0x9154('0x7')](_0x6e0a66)){this['setDataValue'](_0x9154('0x8'),JSON[_0x9154('0x9')](_0x6e0a66));}else if(_[_0x9154('0xa')](_0x6e0a66)){this[_0x9154('0xb')]('formData',_0x6e0a66);}else{this[_0x9154('0xb')](_0x9154('0x8'),util[_0x9154('0xc')](_0x9154('0xd'),this['getDataValue'](_0x9154('0x5'))||'',this[_0x9154('0xe')](_0x9154('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x9154('0x10')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x7b49=['lodash','util','exports','name','STRING','TEXT','isObjectLike','setDataValue','stringify','isString','formData','format','getDataValue','description','BOOLEAN','sequelize'];(function(_0x55d295,_0x5ccd4b){var _0x2747d1=function(_0xca91c2){while(--_0xca91c2){_0x55d295['push'](_0x55d295['shift']());}};_0x2747d1(++_0x5ccd4b);}(_0x7b49,0x15f));var _0x97b4=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x7b49[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x97b4('0x0'));var _=require(_0x97b4('0x1'));var util=require(_0x97b4('0x2'));module[_0x97b4('0x3')]={'name':{'type':Sequelize['STRING'],'unique':_0x97b4('0x4')},'description':{'type':Sequelize[_0x97b4('0x5')]},'formData':{'type':Sequelize[_0x97b4('0x6')]('long'),'set':function(_0x4e00f9){if(_[_0x97b4('0x7')](_0x4e00f9)){this[_0x97b4('0x8')]('formData',JSON[_0x97b4('0x9')](_0x4e00f9));}else if(_[_0x97b4('0xa')](_0x4e00f9)){this[_0x97b4('0x8')](_0x97b4('0xb'),_0x4e00f9);}else{this[_0x97b4('0x8')](_0x97b4('0xb'),util[_0x97b4('0xc')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0x97b4('0xd')]('name')||'',this[_0x97b4('0xd')](_0x97b4('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x97b4('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x97b4('0xf')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 1f59cc4..2b3a5cb 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 _0xd142=['show','params','includeAll','create','user','get','UserProfileSection','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','body','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','getSessions','findOne','ProjectId','JscriptySessionReport','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','starttime','startTime','JscriptyQuestionReport','-createdAt','questionId','question','answer','push','now','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','download','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','Projects','UserProfileResource','destroy','error','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows'];(function(_0x43ad18,_0x21f334){var _0x3bdc6a=function(_0x16fbd5){while(--_0x16fbd5){_0x43ad18['push'](_0x43ad18['shift']());}};_0x3bdc6a(++_0x21f334);}(_0xd142,0x11a));var _0x2d14=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xd142[_0x2576d7];return _0x16a08c;};'use strict';var emlformat=require(_0x2d14('0x0'));var rimraf=require(_0x2d14('0x1'));var zipdir=require(_0x2d14('0x2'));var jsonpatch=require(_0x2d14('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2d14('0x4'));var Mustache=require(_0x2d14('0x5'));var util=require(_0x2d14('0x6'));var path=require(_0x2d14('0x7'));var sox=require(_0x2d14('0x8'));var csv=require(_0x2d14('0x9'));var ejs=require(_0x2d14('0xa'));var fs=require('fs');var fs_extra=require(_0x2d14('0xb'));var _=require(_0x2d14('0xc'));var squel=require(_0x2d14('0xd'));var crypto=require(_0x2d14('0xe'));var jsforce=require(_0x2d14('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x2d14('0x9'));var querystring=require(_0x2d14('0x10'));var Papa=require('papaparse');var Redis=require(_0x2d14('0x11'));var authService=require(_0x2d14('0x12'));var qs=require(_0x2d14('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2d14('0x14'));var logger=require(_0x2d14('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x2d14('0x16'));var licenseUtil=require(_0x2d14('0x17'));var db=require(_0x2d14('0x18'))['db'];function respondWithStatusCode(_0x4d8969,_0x19f79d){_0x19f79d=_0x19f79d||0xcc;return function(_0x227293){if(_0x227293){return _0x4d8969[_0x2d14('0x19')](_0x19f79d);}return _0x4d8969[_0x2d14('0x1a')](_0x19f79d)['end']();};}function respondWithResult(_0x142617,_0x30dfeb){_0x30dfeb=_0x30dfeb||0xc8;return function(_0x488250){if(_0x488250){return _0x142617[_0x2d14('0x1a')](_0x30dfeb)[_0x2d14('0x1b')](_0x488250);}};}function respondWithFilteredResult(_0x2e3302,_0xe9aadc){return function(_0x2dfcd4){if(_0x2dfcd4){var _0x5e6095=typeof _0xe9aadc[_0x2d14('0x1c')]===_0x2d14('0x1d')&&typeof _0xe9aadc[_0x2d14('0x1e')]===_0x2d14('0x1d');var _0x27b6a3=_0x2dfcd4['count'];var _0x427c26=_0x5e6095?0x0:_0xe9aadc[_0x2d14('0x1c')];var _0x449b73=_0x5e6095?_0x2dfcd4[_0x2d14('0x1f')]:_0xe9aadc['offset']+_0xe9aadc['limit'];var _0x21385a;if(_0x449b73>=_0x27b6a3){_0x449b73=_0x27b6a3;_0x21385a=0xc8;}else{_0x21385a=0xce;}_0x2e3302['status'](_0x21385a);return _0x2e3302['set'](_0x2d14('0x20'),_0x427c26+'-'+_0x449b73+'/'+_0x27b6a3)[_0x2d14('0x1b')](_0x2dfcd4);}return null;};}function patchUpdates(_0x17d686){return function(_0x5ca8fa){try{jsonpatch[_0x2d14('0x21')](_0x5ca8fa,_0x17d686,!![]);}catch(_0x3be304){return BPromise['reject'](_0x3be304);}return _0x5ca8fa[_0x2d14('0x22')]();};}function saveUpdates(_0x268d7a,_0x5b117a){return function(_0x18c2b4){if(_0x18c2b4){return _0x18c2b4[_0x2d14('0x23')](_0x268d7a)[_0x2d14('0x24')](function(_0x1ca76f){return _0x1ca76f;});}return null;};}function removeEntity(_0x2c2858,_0x5ecbc0){return function(_0x334ff7){if(_0x334ff7){return _0x334ff7['destroy']()[_0x2d14('0x24')](function(){var _0x5235a7=_0x334ff7['get']({'plain':!![]});var _0x2af2cf=_0x2d14('0x25');return db[_0x2d14('0x26')][_0x2d14('0x27')]({'where':{'type':_0x2af2cf,'resourceId':_0x5235a7['id']}})['then'](function(){return _0x334ff7;});})[_0x2d14('0x24')](function(){_0x2c2858[_0x2d14('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16fa67,_0x35ace8){return function(_0x572720){if(!_0x572720){_0x16fa67[_0x2d14('0x19')](0x194);}return _0x572720;};}function handleError(_0x429c97,_0x5988f1){_0x5988f1=_0x5988f1||0x1f4;return function(_0x2813b1){logger[_0x2d14('0x28')](_0x2813b1[_0x2d14('0x29')]);if(_0x2813b1[_0x2d14('0x2a')]){delete _0x2813b1[_0x2d14('0x2a')];}_0x429c97[_0x2d14('0x1a')](_0x5988f1)[_0x2d14('0x2b')](_0x2813b1);};}exports[_0x2d14('0x2c')]=function(_0x4eee8a,_0xd4edb0){var _0x1415dd={},_0x1a086a={},_0x1da82a={'count':0x0,'rows':[]};var _0x55ccb5=_[_0x2d14('0x2d')](db[_0x2d14('0x2e')][_0x2d14('0x2f')],function(_0x4e8980){return{'name':_0x4e8980[_0x2d14('0x30')],'type':_0x4e8980[_0x2d14('0x31')][_0x2d14('0x32')]};});_0x1a086a[_0x2d14('0x33')]=_[_0x2d14('0x2d')](_0x55ccb5,_0x2d14('0x2a'));_0x1a086a[_0x2d14('0x34')]=_[_0x2d14('0x35')](_0x4eee8a['query']);_0x1a086a[_0x2d14('0x36')]=_[_0x2d14('0x37')](_0x1a086a[_0x2d14('0x33')],_0x1a086a[_0x2d14('0x34')]);_0x1415dd[_0x2d14('0x38')]=_['intersection'](_0x1a086a[_0x2d14('0x33')],qs[_0x2d14('0x39')](_0x4eee8a[_0x2d14('0x34')][_0x2d14('0x39')]));_0x1415dd[_0x2d14('0x38')]=_0x1415dd['attributes'][_0x2d14('0x3a')]?_0x1415dd[_0x2d14('0x38')]:_0x1a086a[_0x2d14('0x33')];if(!_0x4eee8a[_0x2d14('0x34')][_0x2d14('0x3b')](_0x2d14('0x3c'))){_0x1415dd['limit']=qs[_0x2d14('0x1e')](_0x4eee8a['query'][_0x2d14('0x1e')]);_0x1415dd[_0x2d14('0x1c')]=qs[_0x2d14('0x1c')](_0x4eee8a[_0x2d14('0x34')][_0x2d14('0x1c')]);}_0x1415dd[_0x2d14('0x3d')]=qs[_0x2d14('0x3e')](_0x4eee8a['query'][_0x2d14('0x3e')]);_0x1415dd[_0x2d14('0x3f')]=qs[_0x2d14('0x36')](_[_0x2d14('0x40')](_0x4eee8a[_0x2d14('0x34')],_0x1a086a['filters']),_0x55ccb5);if(_0x4eee8a[_0x2d14('0x34')][_0x2d14('0x41')]){_0x1415dd[_0x2d14('0x3f')]=_[_0x2d14('0x42')](_0x1415dd[_0x2d14('0x3f')],{'$or':_[_0x2d14('0x2d')](_0x55ccb5,function(_0x2324d9){if(_0x2324d9[_0x2d14('0x31')]!==_0x2d14('0x43')){var _0xc61860={};_0xc61860[_0x2324d9[_0x2d14('0x2a')]]={'$like':'%'+_0x4eee8a[_0x2d14('0x34')][_0x2d14('0x41')]+'%'};return _0xc61860;}})});}_0x1415dd=_[_0x2d14('0x42')]({},_0x1415dd,_0x4eee8a[_0x2d14('0x44')]);var _0x5f2ef6={'where':_0x1415dd[_0x2d14('0x3f')]};return db[_0x2d14('0x2e')][_0x2d14('0x1f')](_0x5f2ef6)[_0x2d14('0x24')](function(_0x5e106c){_0x1da82a[_0x2d14('0x1f')]=_0x5e106c;if(_0x4eee8a[_0x2d14('0x34')]['includeAll']){_0x1415dd[_0x2d14('0x45')]=[{'all':!![]}];}return db[_0x2d14('0x2e')][_0x2d14('0x46')](_0x1415dd);})[_0x2d14('0x24')](function(_0x27e50e){_0x1da82a[_0x2d14('0x47')]=_0x27e50e;return _0x1da82a;})['then'](respondWithFilteredResult(_0xd4edb0,_0x1415dd))['catch'](handleError(_0xd4edb0,null));};exports[_0x2d14('0x48')]=function(_0x925531,_0x9eec0e){var _0x9b4ab={'raw':![],'where':{'id':_0x925531[_0x2d14('0x49')]['id']}},_0x533220={};_0x533220[_0x2d14('0x33')]=_[_0x2d14('0x35')](db[_0x2d14('0x2e')][_0x2d14('0x2f')]);_0x533220[_0x2d14('0x34')]=_[_0x2d14('0x35')](_0x925531[_0x2d14('0x34')]);_0x533220[_0x2d14('0x36')]=_[_0x2d14('0x37')](_0x533220['model'],_0x533220[_0x2d14('0x34')]);_0x9b4ab[_0x2d14('0x38')]=_[_0x2d14('0x37')](_0x533220[_0x2d14('0x33')],qs['fields'](_0x925531['query'][_0x2d14('0x39')]));_0x9b4ab['attributes']=_0x9b4ab['attributes']['length']?_0x9b4ab[_0x2d14('0x38')]:_0x533220['model'];if(_0x925531[_0x2d14('0x34')][_0x2d14('0x4a')]){_0x9b4ab[_0x2d14('0x45')]=[{'all':!![]}];}_0x9b4ab=_[_0x2d14('0x42')]({},_0x9b4ab,_0x925531['options']);return db[_0x2d14('0x2e')]['find'](_0x9b4ab)[_0x2d14('0x24')](handleEntityNotFound(_0x9eec0e,null))[_0x2d14('0x24')](respondWithResult(_0x9eec0e,null))['catch'](handleError(_0x9eec0e,null));};exports['create']=function(_0x293723,_0x2c16b0){return db[_0x2d14('0x2e')][_0x2d14('0x4b')](_0x293723['body'],{})['then'](function(_0x2691b8){var _0x3920c3=_0x293723[_0x2d14('0x4c')]['get']({'plain':!![]});if(!_0x3920c3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3920c3['role']===_0x2d14('0x4c')){var _0x5c5ec7=_0x2691b8[_0x2d14('0x4d')]({'plain':!![]});var _0xdba428=_0x2d14('0x25');return db[_0x2d14('0x4e')]['find']({'where':{'name':_0xdba428,'userProfileId':_0x3920c3[_0x2d14('0x4f')]},'raw':!![]})['then'](function(_0x4c9655){if(_0x4c9655&&_0x4c9655['autoAssociation']===0x0){return db[_0x2d14('0x26')][_0x2d14('0x4b')]({'name':_0x5c5ec7['name'],'resourceId':_0x5c5ec7['id'],'type':_0x4c9655[_0x2d14('0x2a')],'sectionId':_0x4c9655['id']},{})['then'](function(){return _0x2691b8;});}else{return _0x2691b8;}})[_0x2d14('0x50')](function(_0xa214ea){logger[_0x2d14('0x28')](_0x2d14('0x51'),_0xa214ea);throw _0xa214ea;});}return _0x2691b8;})[_0x2d14('0x24')](respondWithResult(_0x2c16b0,0xc9))['catch'](handleError(_0x2c16b0,null));};exports['clone']=function(_0x41770f,_0x515396){var _0x168bb6={'where':{'id':_0x41770f[_0x2d14('0x49')]['id']}},_0x551c83={};_0x551c83['model']=_[_0x2d14('0x35')](db[_0x2d14('0x2e')]['rawAttributes']);_0x168bb6[_0x2d14('0x38')]=_['intersection'](_0x551c83[_0x2d14('0x33')],qs['fields'](_0x41770f[_0x2d14('0x34')]['fields']));_0x168bb6[_0x2d14('0x38')]=_0x168bb6[_0x2d14('0x38')]['length']?_0x168bb6['attributes']:_0x551c83[_0x2d14('0x33')];if(_0x41770f[_0x2d14('0x34')][_0x2d14('0x4a')]){_0x168bb6[_0x2d14('0x45')]=[{'all':!![]}];}_0x168bb6=_[_0x2d14('0x42')]({},_0x168bb6,_0x41770f[_0x2d14('0x44')]);return db['JscriptyProject']['find'](_0x168bb6)[_0x2d14('0x24')](handleEntityNotFound(_0x515396,null))[_0x2d14('0x24')](function(_0x1a349e){if(_0x1a349e){var _0x48f7f3=_0x1a349e['get']({'plain':!![]});_0x48f7f3=qs[_0x2d14('0x52')](_0x48f7f3,['id',_0x2d14('0x53'),'updatedAt']);_0x41770f[_0x2d14('0x54')]=_[_0x2d14('0x52')](_0x41770f['body'],['id',_0x2d14('0x53'),_0x2d14('0x55')]);return db[_0x2d14('0x2e')][_0x2d14('0x4b')](_[_0x2d14('0x42')](_0x48f7f3,_0x41770f[_0x2d14('0x54')]),{'include':_0x41770f['query'][_0x2d14('0x4a')]?[{'all':!![]}]:undefined})[_0x2d14('0x24')](function(_0x365ae9){var _0x132c8b=_0x41770f[_0x2d14('0x4c')][_0x2d14('0x4d')]({'plain':!![]});if(!_0x132c8b)throw new Error(_0x2d14('0x56'));if(_0x132c8b[_0x2d14('0x57')]==='user'){var _0x5cebfc=_0x365ae9[_0x2d14('0x4d')]({'plain':!![]});var _0x242061=_0x2d14('0x25');return db[_0x2d14('0x4e')][_0x2d14('0x58')]({'where':{'name':_0x242061,'userProfileId':_0x132c8b['userProfileId']},'raw':!![]})['then'](function(_0xe58047){if(_0xe58047&&_0xe58047[_0x2d14('0x59')]===0x0){return db[_0x2d14('0x26')][_0x2d14('0x4b')]({'name':_0x5cebfc[_0x2d14('0x2a')],'resourceId':_0x5cebfc['id'],'type':_0xe58047['name'],'sectionId':_0xe58047['id']},{})[_0x2d14('0x24')](function(){return _0x365ae9;});}else{return _0x365ae9;}})['catch'](function(_0x54bcb1){logger[_0x2d14('0x28')](_0x2d14('0x51'),_0x54bcb1);throw _0x54bcb1;});}return _0x365ae9;});}})[_0x2d14('0x24')](respondWithResult(_0x515396,0xc9))[_0x2d14('0x50')](handleError(_0x515396,null));};exports[_0x2d14('0x23')]=function(_0x4669b6,_0x17e6bc){if(_0x4669b6[_0x2d14('0x54')]['id']){delete _0x4669b6[_0x2d14('0x54')]['id'];}return db[_0x2d14('0x2e')][_0x2d14('0x58')]({'where':{'id':_0x4669b6[_0x2d14('0x49')]['id']}})[_0x2d14('0x24')](handleEntityNotFound(_0x17e6bc,null))[_0x2d14('0x24')](saveUpdates(_0x4669b6[_0x2d14('0x54')],null))[_0x2d14('0x24')](respondWithResult(_0x17e6bc,null))[_0x2d14('0x50')](handleError(_0x17e6bc,null));};exports[_0x2d14('0x27')]=function(_0x2b9295,_0x53765c){return db['JscriptyProject'][_0x2d14('0x58')]({'where':{'id':_0x2b9295[_0x2d14('0x49')]['id']}})[_0x2d14('0x24')](handleEntityNotFound(_0x53765c,null))[_0x2d14('0x24')](removeEntity(_0x53765c,null))['catch'](handleError(_0x53765c,null));};exports[_0x2d14('0x5a')]=function(_0x44d15d,_0x541442,_0x5ca3b1){var _0x2844a4={'raw':!![],'where':{}};var _0x240d9d={};var _0xd8b74={'count':0x0,'rows':[]};return db[_0x2d14('0x2e')][_0x2d14('0x5b')]({'where':{'id':_0x44d15d[_0x2d14('0x49')]['id']}})[_0x2d14('0x24')](handleEntityNotFound(_0x541442,null))['then'](function(_0x1d73f7){if(_0x1d73f7){_0x240d9d[_0x2d14('0x33')]=_[_0x2d14('0x35')](db['JscriptySessionReport'][_0x2d14('0x2f')]);_0x240d9d[_0x2d14('0x34')]=_['keys'](_0x44d15d[_0x2d14('0x34')]);_0x240d9d[_0x2d14('0x36')]=_['intersection'](_0x240d9d['model'],_0x240d9d[_0x2d14('0x34')]);_0x2844a4[_0x2d14('0x38')]=_[_0x2d14('0x37')](_0x240d9d[_0x2d14('0x33')],qs[_0x2d14('0x39')](_0x44d15d[_0x2d14('0x34')][_0x2d14('0x39')]));_0x2844a4['attributes']=_0x2844a4[_0x2d14('0x38')][_0x2d14('0x3a')]?_0x2844a4['attributes']:_0x240d9d['model'];if(!_0x44d15d[_0x2d14('0x34')]['hasOwnProperty'](_0x2d14('0x3c'))){_0x2844a4['limit']=qs['limit'](_0x44d15d[_0x2d14('0x34')][_0x2d14('0x1e')]);_0x2844a4[_0x2d14('0x1c')]=qs[_0x2d14('0x1c')](_0x44d15d[_0x2d14('0x34')]['offset']);}_0x2844a4[_0x2d14('0x3d')]=qs[_0x2d14('0x3e')](_0x44d15d[_0x2d14('0x34')]['sort']);_0x2844a4['where']=qs['filters'](_['pick'](_0x44d15d['query'],_0x240d9d['filters']));_0x2844a4[_0x2d14('0x3f')][_0x2d14('0x5c')]=_0x1d73f7['id'];if(_0x44d15d['query'][_0x2d14('0x41')]){_0x2844a4['where']=_[_0x2d14('0x42')](_0x2844a4[_0x2d14('0x3f')],{'$or':_[_0x2d14('0x2d')](_0x2844a4['attributes'],function(_0x4d3ada){var _0x6f56de={};_0x6f56de[_0x4d3ada]={'$like':'%'+_0x44d15d[_0x2d14('0x34')]['filter']+'%'};return _0x6f56de;})});}_0x2844a4=_[_0x2d14('0x42')]({},_0x2844a4,_0x44d15d['options']);return db[_0x2d14('0x5d')][_0x2d14('0x1f')]({'where':_0x2844a4[_0x2d14('0x3f')]})[_0x2d14('0x24')](function(_0x2e4890){_0xd8b74[_0x2d14('0x1f')]=_0x2e4890;if(_0x44d15d['query'][_0x2d14('0x4a')]){_0x2844a4[_0x2d14('0x45')]=[{'all':!![]}];}return db[_0x2d14('0x5d')][_0x2d14('0x46')](_0x2844a4);})['then'](function(_0x288df1){_0xd8b74[_0x2d14('0x47')]=_0x288df1;return _0xd8b74;});}})[_0x2d14('0x24')](respondWithFilteredResult(_0x541442,_0x2844a4))[_0x2d14('0x50')](handleError(_0x541442,null));};exports['getAnswers']=function(_0x14e6ca,_0x1468c5,_0x5ebc7b){var _0x38524a={'raw':!![],'where':{}};var _0x17e3b2={};var _0x19d24c={'count':0x0,'rows':[]};return db[_0x2d14('0x2e')]['findOne']({'where':{'id':_0x14e6ca[_0x2d14('0x49')]['id']}})['then'](handleEntityNotFound(_0x1468c5,null))['then'](function(_0x4daddf){if(_0x4daddf){_0x17e3b2[_0x2d14('0x33')]=_[_0x2d14('0x35')](db[_0x2d14('0x5e')][_0x2d14('0x2f')]);_0x17e3b2['query']=_['keys'](_0x14e6ca[_0x2d14('0x34')]);_0x17e3b2[_0x2d14('0x36')]=_[_0x2d14('0x37')](_0x17e3b2['model'],_0x17e3b2[_0x2d14('0x34')]);_0x38524a[_0x2d14('0x38')]=_[_0x2d14('0x37')](_0x17e3b2[_0x2d14('0x33')],qs['fields'](_0x14e6ca['query'][_0x2d14('0x39')]));_0x38524a[_0x2d14('0x38')]=_0x38524a['attributes'][_0x2d14('0x3a')]?_0x38524a[_0x2d14('0x38')]:_0x17e3b2[_0x2d14('0x33')];if(!_0x14e6ca[_0x2d14('0x34')]['hasOwnProperty'](_0x2d14('0x3c'))){_0x38524a['limit']=qs['limit'](_0x14e6ca[_0x2d14('0x34')][_0x2d14('0x1e')]);_0x38524a[_0x2d14('0x1c')]=qs[_0x2d14('0x1c')](_0x14e6ca[_0x2d14('0x34')][_0x2d14('0x1c')]);}_0x38524a['order']=qs['sort'](_0x14e6ca[_0x2d14('0x34')][_0x2d14('0x3e')]);_0x38524a[_0x2d14('0x3f')]=qs[_0x2d14('0x36')](_[_0x2d14('0x40')](_0x14e6ca['query'],_0x17e3b2[_0x2d14('0x36')]));_0x38524a[_0x2d14('0x3f')]['ProjectId']=_0x4daddf['id'];if(_0x14e6ca[_0x2d14('0x34')][_0x2d14('0x41')]){_0x38524a[_0x2d14('0x3f')]=_[_0x2d14('0x42')](_0x38524a[_0x2d14('0x3f')],{'$or':_[_0x2d14('0x2d')](_0x38524a[_0x2d14('0x38')],function(_0x384738){var _0x606afe={};_0x606afe[_0x384738]={'$like':'%'+_0x14e6ca['query']['filter']+'%'};return _0x606afe;})});}_0x38524a=_[_0x2d14('0x42')]({},_0x38524a,_0x14e6ca[_0x2d14('0x44')]);return db[_0x2d14('0x5e')][_0x2d14('0x1f')]({'where':_0x38524a[_0x2d14('0x3f')]})['then'](function(_0x1de1a7){_0x19d24c[_0x2d14('0x1f')]=_0x1de1a7;if(_0x14e6ca[_0x2d14('0x34')][_0x2d14('0x4a')]){_0x38524a[_0x2d14('0x45')]=[{'all':!![]}];}return db[_0x2d14('0x5e')][_0x2d14('0x46')](_0x38524a);})[_0x2d14('0x24')](function(_0x53678b){_0x19d24c[_0x2d14('0x47')]=_0x53678b;return _0x19d24c;});}})[_0x2d14('0x24')](respondWithFilteredResult(_0x1468c5,_0x38524a))[_0x2d14('0x50')](handleError(_0x1468c5,null));};function char(_0x15849b){return _0x2d14('0x5f')===typeof _0x15849b?String[_0x2d14('0x60')]['apply'](null,arguments):_0x15849b;}function needsEncapsulation(_0x122b05){return!!_0x122b05&&(_0x122b05[_0x2d14('0x61')]()['indexOf'](char(0xd))>=0x0||_0x122b05[_0x2d14('0x61')]()[_0x2d14('0x62')](char(0xa))>=0x0||_0x122b05[_0x2d14('0x61')]()[_0x2d14('0x62')](char(0x2c))>=0x0||_0x122b05[_0x2d14('0x61')]()[_0x2d14('0x62')](char(0x22))>=0x0);}function encapsulate(_0x55f5fa){var _0x4c803e=char(0x22),_0x2656b5='\x5c'+char(0x22),_0x5889dd=_0x55f5fa[_0x2d14('0x61')]()[_0x2d14('0x63')](new RegExp(_0x4c803e,'g'),_0x2656b5);return _0x4c803e+_0x5889dd+_0x4c803e;}exports[_0x2d14('0x64')]=function(_0x3746ed,_0x22623d,_0x4e9843){var _0x6eb941,_0x18a151;var _0x45a43d={'where':{'ProjectId':_0x3746ed['params']['id']}};if(_0x3746ed['query']['startTime']){_0x45a43d[_0x2d14('0x3f')][_0x2d14('0x65')]=JSON['parse'](_0x3746ed[_0x2d14('0x34')][_0x2d14('0x66')]);}return db[_0x2d14('0x5d')][_0x2d14('0x46')](_0x45a43d)[_0x2d14('0x24')](handleEntityNotFound(_0x22623d,null))[_0x2d14('0x24')](function(_0x2df7a2){if(_0x2df7a2){_0x6eb941=_0x2df7a2;return db[_0x2d14('0x67')][_0x2d14('0x46')]({'where':{'SessionId':{'$in':_[_0x2d14('0x2d')](_0x6eb941,'id')},'ProjectId':_0x3746ed[_0x2d14('0x49')]['id']},'order':_0x2d14('0x68')});}})[_0x2d14('0x24')](handleEntityNotFound(_0x22623d,null))[_0x2d14('0x24')](function(_0x11266f){if(_0x11266f){_0x18a151=_0x11266f;var _0x5b24e4={};for(var _0x28411e=0x0,_0x4c67f6=_0x18a151[_0x2d14('0x3a')];_0x28411e<_0x4c67f6;_0x28411e++){if(!_0x5b24e4[_0x2d14('0x3b')](_0x18a151[_0x28411e]['questionId'])){_0x5b24e4[_0x18a151[_0x28411e][_0x2d14('0x69')]]=needsEncapsulation(_0x18a151[_0x28411e][_0x2d14('0x6a')])?encapsulate(_0x18a151[_0x28411e][_0x2d14('0x6a')]):_0x18a151[_0x28411e]['question'];}}var _0x596ed6=[],_0xbf1156={};for(var _0x4451d8=0x0,_0x50ce28=_0x6eb941['length'];_0x4451d8<_0x50ce28;_0x4451d8++){_0xbf1156={'ProjectId':_0x3746ed[_0x2d14('0x49')]['id'],'SessionId':_0x6eb941[_0x4451d8]['id'],'StartTime':moment(_0x6eb941[_0x4451d8]['starttime'])['format']('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x21ff18=0x0,_0x46ee6d=_0x18a151[_0x2d14('0x3a')];_0x21ff18<_0x46ee6d;_0x21ff18++){if(_0x18a151[_0x21ff18]['SessionId']==_0x6eb941[_0x4451d8]['id']&&_0x5b24e4[_0x2d14('0x3b')](_0x18a151[_0x21ff18]['questionId'])){_0xbf1156[_0x5b24e4[_0x18a151[_0x21ff18]['questionId']]]=_0x18a151[_0x21ff18][_0x2d14('0x6b')];}}for(var _0x8611aa in _0x5b24e4){if(!_0xbf1156[_0x2d14('0x3b')](_0x5b24e4[_0x8611aa])){_0xbf1156[_0x5b24e4[_0x8611aa]]=null;}}_0x596ed6[_0x2d14('0x6c')](_0xbf1156);}return _0x596ed6;}})['then'](function(_0x150056){if(!_['isEmpty'](_0x150056)){var _0x24dd27=toCsv(_0x150056);var _0x1160d7=Date[_0x2d14('0x6d')]();fs['writeFileSync'](util[_0x2d14('0x6e')](_0x2d14('0x6f'),_0x3746ed[_0x2d14('0x49')]['id'],_0x1160d7),_0x24dd27);_0x22623d[_0x2d14('0x70')](_0x2d14('0x71'),_0x2d14('0x72')+util[_0x2d14('0x6e')](_0x2d14('0x73'),_0x3746ed[_0x2d14('0x49')]['id'],_0x1160d7));_0x22623d[_0x2d14('0x70')](_0x2d14('0x74'),'text/csv');return _0x22623d[_0x2d14('0x75')](util[_0x2d14('0x6e')](_0x2d14('0x6f'),_0x3746ed['params']['id'],_0x1160d7));}else{return _0x22623d['sendStatus'](0xcc);}})[_0x2d14('0x50')](handleError(_0x22623d,null));}; \ No newline at end of file +var _0xccde=['createdAt','updatedAt','userProfileId','destroy','JscriptySessionReport','order','ProjectId','rows','getAnswers','JscriptyAnswerReport','number','fromCharCode','apply','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','SessionId','answer','push','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','attachment;\x20filename=','Content-type','eml-format','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','save','then','get','Projects','UserProfileResource','error','stack','name','index','map','JscriptyProject','rawAttributes','fieldName','type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','show','params','merge','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','find'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xccde,0x1e1));var _0xeccd=function(_0x4dcc2d,_0x422839){_0x4dcc2d=_0x4dcc2d-0x0;var _0x1bbd79=_0xccde[_0x4dcc2d];return _0x1bbd79;};'use strict';var emlformat=require(_0xeccd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xeccd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xeccd('0x2'));var moment=require(_0xeccd('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xeccd('0x4'));var path=require(_0xeccd('0x5'));var sox=require(_0xeccd('0x6'));var csv=require(_0xeccd('0x7'));var ejs=require(_0xeccd('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeccd('0x9'));var squel=require(_0xeccd('0xa'));var crypto=require(_0xeccd('0xb'));var jsforce=require(_0xeccd('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xeccd('0x7'));var querystring=require(_0xeccd('0xd'));var Papa=require(_0xeccd('0xe'));var Redis=require(_0xeccd('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xeccd('0x10'))(_0xeccd('0x11'));var utils=require(_0xeccd('0x12'));var config=require(_0xeccd('0x13'));var licenseUtil=require(_0xeccd('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x417bfc,_0x2d7e4c){_0x2d7e4c=_0x2d7e4c||0xcc;return function(_0x377cd7){if(_0x377cd7){return _0x417bfc[_0xeccd('0x15')](_0x2d7e4c);}return _0x417bfc[_0xeccd('0x16')](_0x2d7e4c)[_0xeccd('0x17')]();};}function respondWithResult(_0x4790b3,_0x57516f){_0x57516f=_0x57516f||0xc8;return function(_0x4073e0){if(_0x4073e0){return _0x4790b3[_0xeccd('0x16')](_0x57516f)[_0xeccd('0x18')](_0x4073e0);}};}function respondWithFilteredResult(_0xa03dcc,_0x5a68a6){return function(_0x2500e0){if(_0x2500e0){var _0x3dc35f=typeof _0x5a68a6['offset']==='undefined'&&typeof _0x5a68a6[_0xeccd('0x19')]===_0xeccd('0x1a');var _0x2e96f3=_0x2500e0[_0xeccd('0x1b')];var _0xb0fad7=_0x3dc35f?0x0:_0x5a68a6[_0xeccd('0x1c')];var _0x466d98=_0x3dc35f?_0x2500e0[_0xeccd('0x1b')]:_0x5a68a6['offset']+_0x5a68a6[_0xeccd('0x19')];var _0x61fe23;if(_0x466d98>=_0x2e96f3){_0x466d98=_0x2e96f3;_0x61fe23=0xc8;}else{_0x61fe23=0xce;}_0xa03dcc[_0xeccd('0x16')](_0x61fe23);return _0xa03dcc[_0xeccd('0x1d')](_0xeccd('0x1e'),_0xb0fad7+'-'+_0x466d98+'/'+_0x2e96f3)[_0xeccd('0x18')](_0x2500e0);}return null;};}function patchUpdates(_0x508439){return function(_0x4cced1){try{jsonpatch['apply'](_0x4cced1,_0x508439,!![]);}catch(_0x22976d){return BPromise['reject'](_0x22976d);}return _0x4cced1[_0xeccd('0x1f')]();};}function saveUpdates(_0x20e7b5,_0x54083d){return function(_0x1747af){if(_0x1747af){return _0x1747af['update'](_0x20e7b5)[_0xeccd('0x20')](function(_0x446168){return _0x446168;});}return null;};}function removeEntity(_0x41517f,_0x4537e1){return function(_0x16e97a){if(_0x16e97a){return _0x16e97a['destroy']()[_0xeccd('0x20')](function(){var _0x560659=_0x16e97a[_0xeccd('0x21')]({'plain':!![]});var _0x244d22=_0xeccd('0x22');return db[_0xeccd('0x23')]['destroy']({'where':{'type':_0x244d22,'resourceId':_0x560659['id']}})[_0xeccd('0x20')](function(){return _0x16e97a;});})[_0xeccd('0x20')](function(){_0x41517f[_0xeccd('0x16')](0xcc)[_0xeccd('0x17')]();});}};}function handleEntityNotFound(_0x4fbd3a,_0x71dda5){return function(_0x4240df){if(!_0x4240df){_0x4fbd3a[_0xeccd('0x15')](0x194);}return _0x4240df;};}function handleError(_0x2bf027,_0x49a503){_0x49a503=_0x49a503||0x1f4;return function(_0x1c0a3f){logger[_0xeccd('0x24')](_0x1c0a3f[_0xeccd('0x25')]);if(_0x1c0a3f[_0xeccd('0x26')]){delete _0x1c0a3f['name'];}_0x2bf027[_0xeccd('0x16')](_0x49a503)['send'](_0x1c0a3f);};}exports[_0xeccd('0x27')]=function(_0x1817b7,_0x400128){var _0x28d25a={},_0x330f8d={},_0x46dabd={'count':0x0,'rows':[]};var _0x49858a=_[_0xeccd('0x28')](db[_0xeccd('0x29')][_0xeccd('0x2a')],function(_0x27905b){return{'name':_0x27905b[_0xeccd('0x2b')],'type':_0x27905b[_0xeccd('0x2c')][_0xeccd('0x2d')]};});_0x330f8d['model']=_[_0xeccd('0x28')](_0x49858a,_0xeccd('0x26'));_0x330f8d['query']=_[_0xeccd('0x2e')](_0x1817b7[_0xeccd('0x2f')]);_0x330f8d['filters']=_[_0xeccd('0x30')](_0x330f8d[_0xeccd('0x31')],_0x330f8d[_0xeccd('0x2f')]);_0x28d25a[_0xeccd('0x32')]=_[_0xeccd('0x30')](_0x330f8d[_0xeccd('0x31')],qs[_0xeccd('0x33')](_0x1817b7[_0xeccd('0x2f')][_0xeccd('0x33')]));_0x28d25a['attributes']=_0x28d25a['attributes'][_0xeccd('0x34')]?_0x28d25a[_0xeccd('0x32')]:_0x330f8d[_0xeccd('0x31')];if(!_0x1817b7[_0xeccd('0x2f')][_0xeccd('0x35')](_0xeccd('0x36'))){_0x28d25a[_0xeccd('0x19')]=qs[_0xeccd('0x19')](_0x1817b7[_0xeccd('0x2f')][_0xeccd('0x19')]);_0x28d25a[_0xeccd('0x1c')]=qs[_0xeccd('0x1c')](_0x1817b7['query'][_0xeccd('0x1c')]);}_0x28d25a['order']=qs[_0xeccd('0x37')](_0x1817b7[_0xeccd('0x2f')][_0xeccd('0x37')]);_0x28d25a['where']=qs[_0xeccd('0x38')](_[_0xeccd('0x39')](_0x1817b7['query'],_0x330f8d['filters']),_0x49858a);if(_0x1817b7[_0xeccd('0x2f')][_0xeccd('0x3a')]){_0x28d25a[_0xeccd('0x3b')]=_['merge'](_0x28d25a[_0xeccd('0x3b')],{'$or':_['map'](_0x49858a,function(_0xef011f){if(_0xef011f['type']!==_0xeccd('0x3c')){var _0xbf48b5={};_0xbf48b5[_0xef011f[_0xeccd('0x26')]]={'$like':'%'+_0x1817b7[_0xeccd('0x2f')]['filter']+'%'};return _0xbf48b5;}})});}_0x28d25a=_['merge']({},_0x28d25a,_0x1817b7[_0xeccd('0x3d')]);var _0x572fb5={'where':_0x28d25a[_0xeccd('0x3b')]};return db[_0xeccd('0x29')]['count'](_0x572fb5)['then'](function(_0x1e8e20){_0x46dabd[_0xeccd('0x1b')]=_0x1e8e20;if(_0x1817b7['query'][_0xeccd('0x3e')]){_0x28d25a[_0xeccd('0x3f')]=[{'all':!![]}];}return db[_0xeccd('0x29')][_0xeccd('0x40')](_0x28d25a);})[_0xeccd('0x20')](function(_0x3d740d){_0x46dabd['rows']=_0x3d740d;return _0x46dabd;})[_0xeccd('0x20')](respondWithFilteredResult(_0x400128,_0x28d25a))['catch'](handleError(_0x400128,null));};exports[_0xeccd('0x41')]=function(_0x3ea63e,_0x5c754d){var _0x186dfc={'raw':![],'where':{'id':_0x3ea63e[_0xeccd('0x42')]['id']}},_0x47cc7a={};_0x47cc7a[_0xeccd('0x31')]=_[_0xeccd('0x2e')](db['JscriptyProject'][_0xeccd('0x2a')]);_0x47cc7a[_0xeccd('0x2f')]=_[_0xeccd('0x2e')](_0x3ea63e[_0xeccd('0x2f')]);_0x47cc7a['filters']=_['intersection'](_0x47cc7a[_0xeccd('0x31')],_0x47cc7a[_0xeccd('0x2f')]);_0x186dfc[_0xeccd('0x32')]=_[_0xeccd('0x30')](_0x47cc7a[_0xeccd('0x31')],qs[_0xeccd('0x33')](_0x3ea63e[_0xeccd('0x2f')][_0xeccd('0x33')]));_0x186dfc[_0xeccd('0x32')]=_0x186dfc['attributes']['length']?_0x186dfc[_0xeccd('0x32')]:_0x47cc7a[_0xeccd('0x31')];if(_0x3ea63e[_0xeccd('0x2f')][_0xeccd('0x3e')]){_0x186dfc[_0xeccd('0x3f')]=[{'all':!![]}];}_0x186dfc=_[_0xeccd('0x43')]({},_0x186dfc,_0x3ea63e[_0xeccd('0x3d')]);return db[_0xeccd('0x29')]['find'](_0x186dfc)['then'](handleEntityNotFound(_0x5c754d,null))['then'](respondWithResult(_0x5c754d,null))[_0xeccd('0x44')](handleError(_0x5c754d,null));};exports['create']=function(_0x30777a,_0x2fda76){return db['JscriptyProject'][_0xeccd('0x45')](_0x30777a[_0xeccd('0x46')],{})[_0xeccd('0x20')](function(_0x1cb12e){var _0x5cfd3d=_0x30777a[_0xeccd('0x47')]['get']({'plain':!![]});if(!_0x5cfd3d)throw new Error(_0xeccd('0x48'));if(_0x5cfd3d[_0xeccd('0x49')]===_0xeccd('0x47')){var _0x216881=_0x1cb12e[_0xeccd('0x21')]({'plain':!![]});var _0x4d6c9a=_0xeccd('0x22');return db[_0xeccd('0x4a')]['find']({'where':{'name':_0x4d6c9a,'userProfileId':_0x5cfd3d['userProfileId']},'raw':!![]})[_0xeccd('0x20')](function(_0x48ffda){if(_0x48ffda&&_0x48ffda[_0xeccd('0x4b')]===0x0){return db['UserProfileResource'][_0xeccd('0x45')]({'name':_0x216881[_0xeccd('0x26')],'resourceId':_0x216881['id'],'type':_0x48ffda[_0xeccd('0x26')],'sectionId':_0x48ffda['id']},{})['then'](function(){return _0x1cb12e;});}else{return _0x1cb12e;}})['catch'](function(_0x33c0dd){logger['error'](_0xeccd('0x4c'),_0x33c0dd);throw _0x33c0dd;});}return _0x1cb12e;})['then'](respondWithResult(_0x2fda76,0xc9))['catch'](handleError(_0x2fda76,null));};exports[_0xeccd('0x4d')]=function(_0x45c004,_0x1ba4cc){var _0x557966={'where':{'id':_0x45c004['params']['id']}},_0x37303f={};_0x37303f[_0xeccd('0x31')]=_['keys'](db[_0xeccd('0x29')][_0xeccd('0x2a')]);_0x557966['attributes']=_[_0xeccd('0x30')](_0x37303f[_0xeccd('0x31')],qs[_0xeccd('0x33')](_0x45c004[_0xeccd('0x2f')][_0xeccd('0x33')]));_0x557966[_0xeccd('0x32')]=_0x557966[_0xeccd('0x32')][_0xeccd('0x34')]?_0x557966[_0xeccd('0x32')]:_0x37303f[_0xeccd('0x31')];if(_0x45c004[_0xeccd('0x2f')][_0xeccd('0x3e')]){_0x557966[_0xeccd('0x3f')]=[{'all':!![]}];}_0x557966=_['merge']({},_0x557966,_0x45c004[_0xeccd('0x3d')]);return db[_0xeccd('0x29')][_0xeccd('0x4e')](_0x557966)[_0xeccd('0x20')](handleEntityNotFound(_0x1ba4cc,null))[_0xeccd('0x20')](function(_0x59e656){if(_0x59e656){var _0x20bdcc=_0x59e656[_0xeccd('0x21')]({'plain':!![]});_0x20bdcc=qs['omit'](_0x20bdcc,['id',_0xeccd('0x4f'),_0xeccd('0x50')]);_0x45c004[_0xeccd('0x46')]=_['omit'](_0x45c004[_0xeccd('0x46')],['id',_0xeccd('0x4f'),'updatedAt']);return db[_0xeccd('0x29')][_0xeccd('0x45')](_[_0xeccd('0x43')](_0x20bdcc,_0x45c004['body']),{'include':_0x45c004[_0xeccd('0x2f')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x45a86b){var _0x462f04=_0x45c004[_0xeccd('0x47')][_0xeccd('0x21')]({'plain':!![]});if(!_0x462f04)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x462f04[_0xeccd('0x49')]===_0xeccd('0x47')){var _0x3bb91c=_0x45a86b[_0xeccd('0x21')]({'plain':!![]});var _0x469c82=_0xeccd('0x22');return db[_0xeccd('0x4a')]['find']({'where':{'name':_0x469c82,'userProfileId':_0x462f04[_0xeccd('0x51')]},'raw':!![]})[_0xeccd('0x20')](function(_0x2a4be9){if(_0x2a4be9&&_0x2a4be9[_0xeccd('0x4b')]===0x0){return db[_0xeccd('0x23')][_0xeccd('0x45')]({'name':_0x3bb91c[_0xeccd('0x26')],'resourceId':_0x3bb91c['id'],'type':_0x2a4be9[_0xeccd('0x26')],'sectionId':_0x2a4be9['id']},{})[_0xeccd('0x20')](function(){return _0x45a86b;});}else{return _0x45a86b;}})['catch'](function(_0x25161d){logger[_0xeccd('0x24')](_0xeccd('0x4c'),_0x25161d);throw _0x25161d;});}return _0x45a86b;});}})[_0xeccd('0x20')](respondWithResult(_0x1ba4cc,0xc9))['catch'](handleError(_0x1ba4cc,null));};exports['update']=function(_0x15904a,_0x362fd7){if(_0x15904a[_0xeccd('0x46')]['id']){delete _0x15904a[_0xeccd('0x46')]['id'];}return db['JscriptyProject'][_0xeccd('0x4e')]({'where':{'id':_0x15904a[_0xeccd('0x42')]['id']}})[_0xeccd('0x20')](handleEntityNotFound(_0x362fd7,null))['then'](saveUpdates(_0x15904a[_0xeccd('0x46')],null))[_0xeccd('0x20')](respondWithResult(_0x362fd7,null))[_0xeccd('0x44')](handleError(_0x362fd7,null));};exports[_0xeccd('0x52')]=function(_0x1b5f60,_0x2d1812){return db[_0xeccd('0x29')][_0xeccd('0x4e')]({'where':{'id':_0x1b5f60[_0xeccd('0x42')]['id']}})[_0xeccd('0x20')](handleEntityNotFound(_0x2d1812,null))['then'](removeEntity(_0x2d1812,null))['catch'](handleError(_0x2d1812,null));};exports['getSessions']=function(_0x2c3a39,_0xb4d717,_0x5d9e9d){var _0x14e4d1={'raw':!![],'where':{}};var _0x3d0236={};var _0x111203={'count':0x0,'rows':[]};return db[_0xeccd('0x29')]['findOne']({'where':{'id':_0x2c3a39['params']['id']}})[_0xeccd('0x20')](handleEntityNotFound(_0xb4d717,null))['then'](function(_0x1dda6c){if(_0x1dda6c){_0x3d0236[_0xeccd('0x31')]=_[_0xeccd('0x2e')](db[_0xeccd('0x53')]['rawAttributes']);_0x3d0236[_0xeccd('0x2f')]=_[_0xeccd('0x2e')](_0x2c3a39['query']);_0x3d0236[_0xeccd('0x38')]=_[_0xeccd('0x30')](_0x3d0236[_0xeccd('0x31')],_0x3d0236[_0xeccd('0x2f')]);_0x14e4d1[_0xeccd('0x32')]=_[_0xeccd('0x30')](_0x3d0236[_0xeccd('0x31')],qs['fields'](_0x2c3a39[_0xeccd('0x2f')][_0xeccd('0x33')]));_0x14e4d1[_0xeccd('0x32')]=_0x14e4d1['attributes']['length']?_0x14e4d1['attributes']:_0x3d0236[_0xeccd('0x31')];if(!_0x2c3a39[_0xeccd('0x2f')]['hasOwnProperty'](_0xeccd('0x36'))){_0x14e4d1[_0xeccd('0x19')]=qs[_0xeccd('0x19')](_0x2c3a39[_0xeccd('0x2f')][_0xeccd('0x19')]);_0x14e4d1[_0xeccd('0x1c')]=qs['offset'](_0x2c3a39[_0xeccd('0x2f')][_0xeccd('0x1c')]);}_0x14e4d1[_0xeccd('0x54')]=qs['sort'](_0x2c3a39[_0xeccd('0x2f')][_0xeccd('0x37')]);_0x14e4d1[_0xeccd('0x3b')]=qs[_0xeccd('0x38')](_[_0xeccd('0x39')](_0x2c3a39[_0xeccd('0x2f')],_0x3d0236[_0xeccd('0x38')]));_0x14e4d1[_0xeccd('0x3b')][_0xeccd('0x55')]=_0x1dda6c['id'];if(_0x2c3a39['query'][_0xeccd('0x3a')]){_0x14e4d1['where']=_[_0xeccd('0x43')](_0x14e4d1[_0xeccd('0x3b')],{'$or':_['map'](_0x14e4d1['attributes'],function(_0x3305e0){var _0x4e5545={};_0x4e5545[_0x3305e0]={'$like':'%'+_0x2c3a39['query'][_0xeccd('0x3a')]+'%'};return _0x4e5545;})});}_0x14e4d1=_[_0xeccd('0x43')]({},_0x14e4d1,_0x2c3a39['options']);return db[_0xeccd('0x53')]['count']({'where':_0x14e4d1[_0xeccd('0x3b')]})['then'](function(_0x3e0a55){_0x111203[_0xeccd('0x1b')]=_0x3e0a55;if(_0x2c3a39[_0xeccd('0x2f')][_0xeccd('0x3e')]){_0x14e4d1['include']=[{'all':!![]}];}return db[_0xeccd('0x53')][_0xeccd('0x40')](_0x14e4d1);})[_0xeccd('0x20')](function(_0x380d43){_0x111203[_0xeccd('0x56')]=_0x380d43;return _0x111203;});}})[_0xeccd('0x20')](respondWithFilteredResult(_0xb4d717,_0x14e4d1))['catch'](handleError(_0xb4d717,null));};exports[_0xeccd('0x57')]=function(_0x573646,_0x90810b,_0x4108f5){var _0x5c981a={'raw':!![],'where':{}};var _0x4ca4da={};var _0x428262={'count':0x0,'rows':[]};return db[_0xeccd('0x29')]['findOne']({'where':{'id':_0x573646[_0xeccd('0x42')]['id']}})[_0xeccd('0x20')](handleEntityNotFound(_0x90810b,null))[_0xeccd('0x20')](function(_0x87c8e6){if(_0x87c8e6){_0x4ca4da[_0xeccd('0x31')]=_['keys'](db[_0xeccd('0x58')][_0xeccd('0x2a')]);_0x4ca4da[_0xeccd('0x2f')]=_[_0xeccd('0x2e')](_0x573646[_0xeccd('0x2f')]);_0x4ca4da['filters']=_[_0xeccd('0x30')](_0x4ca4da[_0xeccd('0x31')],_0x4ca4da[_0xeccd('0x2f')]);_0x5c981a['attributes']=_[_0xeccd('0x30')](_0x4ca4da[_0xeccd('0x31')],qs[_0xeccd('0x33')](_0x573646[_0xeccd('0x2f')][_0xeccd('0x33')]));_0x5c981a['attributes']=_0x5c981a[_0xeccd('0x32')][_0xeccd('0x34')]?_0x5c981a[_0xeccd('0x32')]:_0x4ca4da[_0xeccd('0x31')];if(!_0x573646['query'][_0xeccd('0x35')](_0xeccd('0x36'))){_0x5c981a['limit']=qs[_0xeccd('0x19')](_0x573646[_0xeccd('0x2f')][_0xeccd('0x19')]);_0x5c981a['offset']=qs[_0xeccd('0x1c')](_0x573646['query'][_0xeccd('0x1c')]);}_0x5c981a[_0xeccd('0x54')]=qs[_0xeccd('0x37')](_0x573646[_0xeccd('0x2f')]['sort']);_0x5c981a['where']=qs[_0xeccd('0x38')](_[_0xeccd('0x39')](_0x573646[_0xeccd('0x2f')],_0x4ca4da[_0xeccd('0x38')]));_0x5c981a['where'][_0xeccd('0x55')]=_0x87c8e6['id'];if(_0x573646['query']['filter']){_0x5c981a[_0xeccd('0x3b')]=_[_0xeccd('0x43')](_0x5c981a['where'],{'$or':_[_0xeccd('0x28')](_0x5c981a[_0xeccd('0x32')],function(_0x1f59ae){var _0x5d7938={};_0x5d7938[_0x1f59ae]={'$like':'%'+_0x573646['query'][_0xeccd('0x3a')]+'%'};return _0x5d7938;})});}_0x5c981a=_[_0xeccd('0x43')]({},_0x5c981a,_0x573646['options']);return db[_0xeccd('0x58')][_0xeccd('0x1b')]({'where':_0x5c981a[_0xeccd('0x3b')]})[_0xeccd('0x20')](function(_0x2ff021){_0x428262[_0xeccd('0x1b')]=_0x2ff021;if(_0x573646['query']['includeAll']){_0x5c981a[_0xeccd('0x3f')]=[{'all':!![]}];}return db[_0xeccd('0x58')][_0xeccd('0x40')](_0x5c981a);})[_0xeccd('0x20')](function(_0x74dabc){_0x428262[_0xeccd('0x56')]=_0x74dabc;return _0x428262;});}})[_0xeccd('0x20')](respondWithFilteredResult(_0x90810b,_0x5c981a))['catch'](handleError(_0x90810b,null));};function char(_0x48df41){return _0xeccd('0x59')===typeof _0x48df41?String[_0xeccd('0x5a')][_0xeccd('0x5b')](null,arguments):_0x48df41;}function needsEncapsulation(_0x3a023f){return!!_0x3a023f&&(_0x3a023f[_0xeccd('0x5c')]()[_0xeccd('0x5d')](char(0xd))>=0x0||_0x3a023f[_0xeccd('0x5c')]()[_0xeccd('0x5d')](char(0xa))>=0x0||_0x3a023f[_0xeccd('0x5c')]()[_0xeccd('0x5d')](char(0x2c))>=0x0||_0x3a023f[_0xeccd('0x5c')]()[_0xeccd('0x5d')](char(0x22))>=0x0);}function encapsulate(_0x301b1c){var _0x459877=char(0x22),_0x125f64='\x5c'+char(0x22),_0x3e75e0=_0x301b1c['toString']()[_0xeccd('0x5e')](new RegExp(_0x459877,'g'),_0x125f64);return _0x459877+_0x3e75e0+_0x459877;}exports[_0xeccd('0x5f')]=function(_0x51d68b,_0x2dc470,_0x1d899a){var _0x45a18c,_0x558f75;var _0x3b8a03={'where':{'ProjectId':_0x51d68b[_0xeccd('0x42')]['id']}};if(_0x51d68b[_0xeccd('0x2f')][_0xeccd('0x60')]){_0x3b8a03[_0xeccd('0x3b')][_0xeccd('0x61')]=JSON[_0xeccd('0x62')](_0x51d68b[_0xeccd('0x2f')][_0xeccd('0x60')]);}return db[_0xeccd('0x53')][_0xeccd('0x40')](_0x3b8a03)[_0xeccd('0x20')](handleEntityNotFound(_0x2dc470,null))[_0xeccd('0x20')](function(_0x5a991f){if(_0x5a991f){_0x45a18c=_0x5a991f;return db[_0xeccd('0x63')][_0xeccd('0x40')]({'where':{'SessionId':{'$in':_[_0xeccd('0x28')](_0x45a18c,'id')},'ProjectId':_0x51d68b['params']['id']},'order':_0xeccd('0x64')});}})[_0xeccd('0x20')](handleEntityNotFound(_0x2dc470,null))[_0xeccd('0x20')](function(_0x26dda3){if(_0x26dda3){_0x558f75=_0x26dda3;var _0x345615={};for(var _0x5a63f5=0x0,_0x377fee=_0x558f75[_0xeccd('0x34')];_0x5a63f5<_0x377fee;_0x5a63f5++){if(!_0x345615[_0xeccd('0x35')](_0x558f75[_0x5a63f5][_0xeccd('0x65')])){_0x345615[_0x558f75[_0x5a63f5][_0xeccd('0x65')]]=needsEncapsulation(_0x558f75[_0x5a63f5][_0xeccd('0x66')])?encapsulate(_0x558f75[_0x5a63f5][_0xeccd('0x66')]):_0x558f75[_0x5a63f5][_0xeccd('0x66')];}}var _0x1ccc95=[],_0x2a2885={};for(var _0x49ccb4=0x0,_0x290836=_0x45a18c[_0xeccd('0x34')];_0x49ccb4<_0x290836;_0x49ccb4++){_0x2a2885={'ProjectId':_0x51d68b[_0xeccd('0x42')]['id'],'SessionId':_0x45a18c[_0x49ccb4]['id'],'StartTime':moment(_0x45a18c[_0x49ccb4]['starttime'])[_0xeccd('0x67')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x5f3749=0x0,_0x57964d=_0x558f75[_0xeccd('0x34')];_0x5f3749<_0x57964d;_0x5f3749++){if(_0x558f75[_0x5f3749][_0xeccd('0x68')]==_0x45a18c[_0x49ccb4]['id']&&_0x345615[_0xeccd('0x35')](_0x558f75[_0x5f3749]['questionId'])){_0x2a2885[_0x345615[_0x558f75[_0x5f3749][_0xeccd('0x65')]]]=_0x558f75[_0x5f3749][_0xeccd('0x69')];}}for(var _0x16a2d2 in _0x345615){if(!_0x2a2885[_0xeccd('0x35')](_0x345615[_0x16a2d2])){_0x2a2885[_0x345615[_0x16a2d2]]=null;}}_0x1ccc95[_0xeccd('0x6a')](_0x2a2885);}return _0x1ccc95;}})[_0xeccd('0x20')](function(_0x20017e){if(!_['isEmpty'](_0x20017e)){var _0x8b6425=toCsv(_0x20017e);var _0x1f893d=Date[_0xeccd('0x6b')]();fs[_0xeccd('0x6c')](util[_0xeccd('0x67')](_0xeccd('0x6d'),_0x51d68b[_0xeccd('0x42')]['id'],_0x1f893d),_0x8b6425);_0x2dc470['setHeader']('Content-disposition',_0xeccd('0x6e')+util['format']('Jscripty_Project_%d_Summary_%s.csv',_0x51d68b[_0xeccd('0x42')]['id'],_0x1f893d));_0x2dc470['setHeader'](_0xeccd('0x6f'),'text/csv');return _0x2dc470['download'](util[_0xeccd('0x67')](_0xeccd('0x6d'),_0x51d68b[_0xeccd('0x42')]['id'],_0x1f893d));}else{return _0x2dc470[_0xeccd('0x15')](0xcc);}})['catch'](handleError(_0x2dc470,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 5f3e5f3..8001b88 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 _0x3379=['exports','JscriptyProject','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./jscriptyProject.attributes'];(function(_0x4bfaf,_0x3cb3c7){var _0x247a83=function(_0x1ceb28){while(--_0x1ceb28){_0x4bfaf['push'](_0x4bfaf['shift']());}};_0x247a83(++_0x3cb3c7);}(_0x3379,0x115));var _0x9337=function(_0x21ab82,_0x255bb9){_0x21ab82=_0x21ab82-0x0;var _0x1fae6f=_0x3379[_0x21ab82];return _0x1fae6f;};'use strict';var _=require(_0x9337('0x0'));var util=require(_0x9337('0x1'));var logger=require(_0x9337('0x2'))(_0x9337('0x3'));var moment=require('moment');var BPromise=require(_0x9337('0x4'));var rp=require(_0x9337('0x5'));var fs=require('fs');var path=require(_0x9337('0x6'));var rimraf=require(_0x9337('0x7'));var config=require('../../config/environment');var attributes=require(_0x9337('0x8'));module[_0x9337('0x9')]=function(_0x390772,_0x677c38){return _0x390772['define'](_0x9337('0xa'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe700=['../../config/environment','exports','define','JscriptyProject','jscripty_projects','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x369c4c,_0x46ca7a){var _0xd0911c=function(_0xb22095){while(--_0xb22095){_0x369c4c['push'](_0x369c4c['shift']());}};_0xd0911c(++_0x46ca7a);}(_0xe700,0x75));var _0x0e70=function(_0x210653,_0xdcf659){_0x210653=_0x210653-0x0;var _0x460e18=_0xe700[_0x210653];return _0x460e18;};'use strict';var _=require(_0x0e70('0x0'));var util=require(_0x0e70('0x1'));var logger=require(_0x0e70('0x2'))(_0x0e70('0x3'));var moment=require(_0x0e70('0x4'));var BPromise=require(_0x0e70('0x5'));var rp=require(_0x0e70('0x6'));var fs=require('fs');var path=require(_0x0e70('0x7'));var rimraf=require(_0x0e70('0x8'));var config=require(_0x0e70('0x9'));var attributes=require('./jscriptyProject.attributes');module[_0x0e70('0xa')]=function(_0x5e1b28,_0x44a1ee){return _0x5e1b28[_0x0e70('0xb')](_0x0e70('0xc'),attributes,{'tableName':_0x0e70('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index 6b5823d..076a9b4 100644 --- a/server/api/jscriptyProject/jscriptyProject.rpc.js +++ b/server/api/jscriptyProject/jscriptyProject.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9bde=['code','message','JscriptyProject,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x37c488,_0xd26f8d){var _0x1ea973=function(_0x201b46){while(--_0x201b46){_0x37c488['push'](_0x37c488['shift']());}};_0x1ea973(++_0xd26f8d);}(_0x9bde,0xe1));var _0xe9bd=function(_0x129709,_0x130d27){_0x129709=_0x129709-0x0;var _0xe4715f=_0x9bde[_0x129709];return _0xe4715f;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var moment=require('moment');var BPromise=require(_0xe9bd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9bd('0x2'));var db=require(_0xe9bd('0x3'))['db'];var utils=require(_0xe9bd('0x4'));var logger=require(_0xe9bd('0x5'))(_0xe9bd('0x6'));var config=require(_0xe9bd('0x7'));var jayson=require(_0xe9bd('0x8'));var client=jayson['client'][_0xe9bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f18fe,_0x22a438,_0xa66ae2){return new BPromise(function(_0x2d5c75,_0x3ef9e3){return client[_0xe9bd('0xa')](_0x5f18fe,_0xa66ae2)[_0xe9bd('0xb')](function(_0x439abc){logger[_0xe9bd('0xc')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,'request\x20sent');logger[_0xe9bd('0xd')](_0xe9bd('0xe'),_0x22a438,_0xe9bd('0xf'),JSON['stringify'](_0x439abc));if(_0x439abc[_0xe9bd('0x10')]){if(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x11')]===0x1f4){logger[_0xe9bd('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,_0x439abc[_0xe9bd('0x10')]['message']);return _0x3ef9e3(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}logger[_0xe9bd('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,_0x439abc['error'][_0xe9bd('0x12')]);return _0x2d5c75(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}else{logger[_0xe9bd('0xc')](_0xe9bd('0x13'),_0x22a438,_0xe9bd('0xf'));_0x2d5c75(_0x439abc[_0xe9bd('0x14')]['message']);}})[_0xe9bd('0x15')](function(_0x464a1b){logger[_0xe9bd('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,_0x464a1b);_0x3ef9e3(_0x464a1b);});});} \ No newline at end of file +var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s'];(function(_0x50688f,_0x141304){var _0x6ae901=function(_0x210848){while(--_0x210848){_0x50688f['push'](_0x50688f['shift']());}};_0x6ae901(++_0x141304);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xcb91[_0x565c49];return _0x20ca34;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 49b2c93..10c1538 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 _0xb033=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports','connect-timeout'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0xb033,0xc5));var _0x3b03=function(_0xaa99e0,_0x54ec2a){_0xaa99e0=_0xaa99e0-0x0;var _0x655a07=_0xb033[_0xaa99e0];return _0x655a07;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x3b03('0x0'));var express=require(_0x3b03('0x1'));var router=express[_0x3b03('0x2')]();var fs_extra=require(_0x3b03('0x3'));var auth=require(_0x3b03('0x4'));var interaction=require(_0x3b03('0x5'));var config=require(_0x3b03('0x6'));var controller=require(_0x3b03('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x3b03('0x8')]);router[_0x3b03('0x9')](_0x3b03('0xa'),auth[_0x3b03('0xb')](),controller[_0x3b03('0xc')]);router['get'](_0x3b03('0xd'),auth[_0x3b03('0xb')](),controller[_0x3b03('0xe')]);router[_0x3b03('0xf')]('/',auth[_0x3b03('0xb')](),controller[_0x3b03('0x10')]);router[_0x3b03('0x11')]('/:id',auth[_0x3b03('0xb')](),controller[_0x3b03('0x12')]);router[_0x3b03('0x13')](_0x3b03('0xd'),auth[_0x3b03('0xb')](),controller[_0x3b03('0x14')]);module[_0x3b03('0x15')]=router; \ No newline at end of file +var _0xbc7e=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','index','get','/describe','isAuthenticated','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xbc7e,0xf7));var _0xebc7=function(_0x420d81,_0x4c4c54){_0x420d81=_0x420d81-0x0;var _0x17b70b=_0xbc7e[_0x420d81];return _0x17b70b;};'use strict';var multer=require(_0xebc7('0x0'));var util=require(_0xebc7('0x1'));var path=require(_0xebc7('0x2'));var timeout=require(_0xebc7('0x3'));var express=require(_0xebc7('0x4'));var router=express[_0xebc7('0x5')]();var fs_extra=require(_0xebc7('0x6'));var auth=require(_0xebc7('0x7'));var interaction=require(_0xebc7('0x8'));var config=require(_0xebc7('0x9'));var controller=require(_0xebc7('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0xebc7('0xb')]);router[_0xebc7('0xc')](_0xebc7('0xd'),auth[_0xebc7('0xe')](),controller['describe']);router[_0xebc7('0xc')](_0xebc7('0xf'),auth[_0xebc7('0xe')](),controller[_0xebc7('0x10')]);router[_0xebc7('0x11')]('/',auth[_0xebc7('0xe')](),controller[_0xebc7('0x12')]);router['put'](_0xebc7('0xf'),auth[_0xebc7('0xe')](),controller[_0xebc7('0x13')]);router[_0xebc7('0x14')](_0xebc7('0xf'),auth[_0xebc7('0xe')](),controller[_0xebc7('0x15')]);module[_0xebc7('0x16')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index d259bc7..3a6809b 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(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x7a54,0x106));var _0x47a5=function(_0x4a5887,_0x1aa1a3){_0x4a5887=_0x4a5887-0x0;var _0x155dd7=_0x7a54[_0x4a5887];return _0x155dd7;};'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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x7a54,0x106));var _0x47a5=function(_0x567fce,_0x4f951d){_0x567fce=_0x567fce-0x0;var _0x337a9f=_0x7a54[_0x567fce];return _0x337a9f;};'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 a5586fc..cd32dc8 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 _0x0b1b=['then','destroy','end','stack','name','index','JscriptyQuestionReport','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','show','params','length','options','find','catch','create','body','update','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','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','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0b1b,0x6f));var _0xb0b1=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0x0b1b[_0x725b8e];return _0x43ac45;};'use strict';var emlformat=require(_0xb0b1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb0b1('0x1'));var rp=require(_0xb0b1('0x2'));var moment=require(_0xb0b1('0x3'));var BPromise=require(_0xb0b1('0x4'));var Mustache=require(_0xb0b1('0x5'));var util=require(_0xb0b1('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xb0b1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb0b1('0x8'));var _=require(_0xb0b1('0x9'));var squel=require(_0xb0b1('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb0b1('0xb'));var toCsv=require('to-csv');var querystring=require(_0xb0b1('0xc'));var Papa=require(_0xb0b1('0xd'));var Redis=require(_0xb0b1('0xe'));var authService=require(_0xb0b1('0xf'));var qs=require(_0xb0b1('0x10'));var as=require(_0xb0b1('0x11'));var hardwareService=require(_0xb0b1('0x12'));var logger=require('../../config/logger')(_0xb0b1('0x13'));var utils=require(_0xb0b1('0x14'));var config=require(_0xb0b1('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xb0b1('0x16'))['db'];function respondWithStatusCode(_0x390fa1,_0xb0fbd4){_0xb0fbd4=_0xb0fbd4||0xcc;return function(_0x34ab49){if(_0x34ab49){return _0x390fa1[_0xb0b1('0x17')](_0xb0fbd4);}return _0x390fa1[_0xb0b1('0x18')](_0xb0fbd4)['end']();};}function respondWithResult(_0x50488a,_0xa986dc){_0xa986dc=_0xa986dc||0xc8;return function(_0x468b17){if(_0x468b17){return _0x50488a[_0xb0b1('0x18')](_0xa986dc)[_0xb0b1('0x19')](_0x468b17);}};}function respondWithFilteredResult(_0x2d831d,_0x2233dc){return function(_0x531358){if(_0x531358){var _0x18b56d=typeof _0x2233dc[_0xb0b1('0x1a')]==='undefined'&&typeof _0x2233dc[_0xb0b1('0x1b')]===_0xb0b1('0x1c');var _0x274f86=_0x531358[_0xb0b1('0x1d')];var _0xd259b0=_0x18b56d?0x0:_0x2233dc[_0xb0b1('0x1a')];var _0x520ac7=_0x18b56d?_0x531358[_0xb0b1('0x1d')]:_0x2233dc[_0xb0b1('0x1a')]+_0x2233dc[_0xb0b1('0x1b')];var _0x559499;if(_0x520ac7>=_0x274f86){_0x520ac7=_0x274f86;_0x559499=0xc8;}else{_0x559499=0xce;}_0x2d831d['status'](_0x559499);return _0x2d831d[_0xb0b1('0x1e')](_0xb0b1('0x1f'),_0xd259b0+'-'+_0x520ac7+'/'+_0x274f86)[_0xb0b1('0x19')](_0x531358);}return null;};}function patchUpdates(_0x2a5b46){return function(_0x5f5e09){try{jsonpatch[_0xb0b1('0x20')](_0x5f5e09,_0x2a5b46,!![]);}catch(_0x8ba9dd){return BPromise[_0xb0b1('0x21')](_0x8ba9dd);}return _0x5f5e09[_0xb0b1('0x22')]();};}function saveUpdates(_0x21a84b,_0x51220a){return function(_0x577341){if(_0x577341){return _0x577341['update'](_0x21a84b)[_0xb0b1('0x23')](function(_0x10c934){return _0x10c934;});}return null;};}function removeEntity(_0x3eb851,_0x32ae8d){return function(_0x29e1c7){if(_0x29e1c7){return _0x29e1c7[_0xb0b1('0x24')]()['then'](function(){_0x3eb851[_0xb0b1('0x18')](0xcc)[_0xb0b1('0x25')]();});}};}function handleEntityNotFound(_0x3dd492,_0x384e58){return function(_0x1d644e){if(!_0x1d644e){_0x3dd492[_0xb0b1('0x17')](0x194);}return _0x1d644e;};}function handleError(_0x25ff34,_0x183890){_0x183890=_0x183890||0x1f4;return function(_0x5bdd86){logger['error'](_0x5bdd86[_0xb0b1('0x26')]);if(_0x5bdd86[_0xb0b1('0x27')]){delete _0x5bdd86[_0xb0b1('0x27')];}_0x25ff34[_0xb0b1('0x18')](_0x183890)['send'](_0x5bdd86);};}exports[_0xb0b1('0x28')]=function(_0x36947c,_0x39b262){var _0x26865c={},_0x1b1df4={},_0x4364f4={'count':0x0,'rows':[]};var _0xd246dd=_['map'](db[_0xb0b1('0x29')][_0xb0b1('0x2a')],function(_0x31f91){return{'name':_0x31f91[_0xb0b1('0x2b')],'type':_0x31f91[_0xb0b1('0x2c')][_0xb0b1('0x2d')]};});_0x1b1df4['model']=_[_0xb0b1('0x2e')](_0xd246dd,_0xb0b1('0x27'));_0x1b1df4[_0xb0b1('0x2f')]=_[_0xb0b1('0x30')](_0x36947c[_0xb0b1('0x2f')]);_0x1b1df4[_0xb0b1('0x31')]=_[_0xb0b1('0x32')](_0x1b1df4['model'],_0x1b1df4[_0xb0b1('0x2f')]);_0x26865c[_0xb0b1('0x33')]=_['intersection'](_0x1b1df4[_0xb0b1('0x34')],qs[_0xb0b1('0x35')](_0x36947c[_0xb0b1('0x2f')][_0xb0b1('0x35')]));_0x26865c[_0xb0b1('0x33')]=_0x26865c[_0xb0b1('0x33')]['length']?_0x26865c['attributes']:_0x1b1df4['model'];if(!_0x36947c['query'][_0xb0b1('0x36')]('nolimit')){_0x26865c[_0xb0b1('0x1b')]=qs[_0xb0b1('0x1b')](_0x36947c[_0xb0b1('0x2f')][_0xb0b1('0x1b')]);_0x26865c[_0xb0b1('0x1a')]=qs[_0xb0b1('0x1a')](_0x36947c[_0xb0b1('0x2f')][_0xb0b1('0x1a')]);}_0x26865c['order']=qs[_0xb0b1('0x37')](_0x36947c[_0xb0b1('0x2f')][_0xb0b1('0x37')]);_0x26865c[_0xb0b1('0x38')]=qs[_0xb0b1('0x31')](_[_0xb0b1('0x39')](_0x36947c[_0xb0b1('0x2f')],_0x1b1df4['filters']),_0xd246dd);if(_0x36947c[_0xb0b1('0x2f')][_0xb0b1('0x3a')]){_0x26865c[_0xb0b1('0x38')]=_[_0xb0b1('0x3b')](_0x26865c[_0xb0b1('0x38')],{'$or':_[_0xb0b1('0x2e')](_0xd246dd,function(_0x3e6b20){if(_0x3e6b20[_0xb0b1('0x2c')]!==_0xb0b1('0x3c')){var _0x4c93b8={};_0x4c93b8[_0x3e6b20[_0xb0b1('0x27')]]={'$like':'%'+_0x36947c[_0xb0b1('0x2f')][_0xb0b1('0x3a')]+'%'};return _0x4c93b8;}})});}_0x26865c=_['merge']({},_0x26865c,_0x36947c['options']);var _0x450d54={'where':_0x26865c['where']};return db[_0xb0b1('0x29')][_0xb0b1('0x1d')](_0x450d54)[_0xb0b1('0x23')](function(_0x15c03e){_0x4364f4[_0xb0b1('0x1d')]=_0x15c03e;if(_0x36947c[_0xb0b1('0x2f')][_0xb0b1('0x3d')]){_0x26865c[_0xb0b1('0x3e')]=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x26865c);})[_0xb0b1('0x23')](function(_0x441584){_0x4364f4['rows']=_0x441584;return _0x4364f4;})[_0xb0b1('0x23')](respondWithFilteredResult(_0x39b262,_0x26865c))['catch'](handleError(_0x39b262,null));};exports[_0xb0b1('0x3f')]=function(_0x1ee3ec,_0x43a148){var _0x4f72e1={'raw':!![],'where':{'id':_0x1ee3ec[_0xb0b1('0x40')]['id']}},_0x24600e={};_0x24600e[_0xb0b1('0x34')]=_[_0xb0b1('0x30')](db[_0xb0b1('0x29')]['rawAttributes']);_0x24600e[_0xb0b1('0x2f')]=_['keys'](_0x1ee3ec[_0xb0b1('0x2f')]);_0x24600e[_0xb0b1('0x31')]=_[_0xb0b1('0x32')](_0x24600e['model'],_0x24600e[_0xb0b1('0x2f')]);_0x4f72e1[_0xb0b1('0x33')]=_[_0xb0b1('0x32')](_0x24600e['model'],qs[_0xb0b1('0x35')](_0x1ee3ec[_0xb0b1('0x2f')][_0xb0b1('0x35')]));_0x4f72e1[_0xb0b1('0x33')]=_0x4f72e1[_0xb0b1('0x33')][_0xb0b1('0x41')]?_0x4f72e1[_0xb0b1('0x33')]:_0x24600e[_0xb0b1('0x34')];if(_0x1ee3ec[_0xb0b1('0x2f')][_0xb0b1('0x3d')]){_0x4f72e1[_0xb0b1('0x3e')]=[{'all':!![]}];}_0x4f72e1=_[_0xb0b1('0x3b')]({},_0x4f72e1,_0x1ee3ec[_0xb0b1('0x42')]);return db[_0xb0b1('0x29')][_0xb0b1('0x43')](_0x4f72e1)[_0xb0b1('0x23')](handleEntityNotFound(_0x43a148,null))[_0xb0b1('0x23')](respondWithResult(_0x43a148,null))[_0xb0b1('0x44')](handleError(_0x43a148,null));};exports['create']=function(_0xea6f09,_0x1b5c81){return db[_0xb0b1('0x29')][_0xb0b1('0x45')](_0xea6f09[_0xb0b1('0x46')],{})[_0xb0b1('0x23')](respondWithResult(_0x1b5c81,0xc9))[_0xb0b1('0x44')](handleError(_0x1b5c81,null));};exports[_0xb0b1('0x47')]=function(_0x3ce6e4,_0x1fea79){if(_0x3ce6e4[_0xb0b1('0x46')]['id']){delete _0x3ce6e4[_0xb0b1('0x46')]['id'];}return db['JscriptyQuestionReport']['find']({'where':{'id':_0x3ce6e4[_0xb0b1('0x40')]['id']}})[_0xb0b1('0x23')](handleEntityNotFound(_0x1fea79,null))[_0xb0b1('0x23')](saveUpdates(_0x3ce6e4[_0xb0b1('0x46')],null))[_0xb0b1('0x23')](respondWithResult(_0x1fea79,null))[_0xb0b1('0x44')](handleError(_0x1fea79,null));};exports[_0xb0b1('0x24')]=function(_0x204609,_0x33d411){return db[_0xb0b1('0x29')][_0xb0b1('0x43')]({'where':{'id':_0x204609['params']['id']}})['then'](handleEntityNotFound(_0x33d411,null))[_0xb0b1('0x23')](removeEntity(_0x33d411,null))[_0xb0b1('0x44')](handleError(_0x33d411,null));};exports[_0xb0b1('0x48')]=function(_0x420289,_0x44eabf){return db[_0xb0b1('0x29')][_0xb0b1('0x48')]()[_0xb0b1('0x23')](respondWithResult(_0x44eabf,null))[_0xb0b1('0x44')](handleError(_0x44eabf,null));}; \ No newline at end of file +var _0x721b=['model','map','keys','query','intersection','fields','attributes','length','nolimit','order','sort','pick','filters','filter','where','merge','options','includeAll','findAll','rows','catch','show','params','include','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','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','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','JscriptyQuestionReport','rawAttributes','fieldName','type'];(function(_0x5583ce,_0x40defa){var _0x280d0d=function(_0x55517b){while(--_0x55517b){_0x5583ce['push'](_0x5583ce['shift']());}};_0x280d0d(++_0x40defa);}(_0x721b,0x18d));var _0xb721=function(_0x576cff,_0x2115e9){_0x576cff=_0x576cff-0x0;var _0x58f7df=_0x721b[_0x576cff];return _0x58f7df;};'use strict';var emlformat=require(_0xb721('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb721('0x1'));var jsonpatch=require(_0xb721('0x2'));var rp=require('request-promise');var moment=require(_0xb721('0x3'));var BPromise=require(_0xb721('0x4'));var Mustache=require(_0xb721('0x5'));var util=require(_0xb721('0x6'));var path=require(_0xb721('0x7'));var sox=require(_0xb721('0x8'));var csv=require(_0xb721('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb721('0xa'));var squel=require(_0xb721('0xb'));var crypto=require(_0xb721('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb721('0xd'));var toCsv=require(_0xb721('0x9'));var querystring=require(_0xb721('0xe'));var Papa=require('papaparse');var Redis=require(_0xb721('0xf'));var authService=require(_0xb721('0x10'));var qs=require(_0xb721('0x11'));var as=require(_0xb721('0x12'));var hardwareService=require(_0xb721('0x13'));var logger=require(_0xb721('0x14'))(_0xb721('0x15'));var utils=require(_0xb721('0x16'));var config=require(_0xb721('0x17'));var licenseUtil=require(_0xb721('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b492c,_0x37e7b1){_0x37e7b1=_0x37e7b1||0xcc;return function(_0x230524){if(_0x230524){return _0x4b492c['sendStatus'](_0x37e7b1);}return _0x4b492c[_0xb721('0x19')](_0x37e7b1)['end']();};}function respondWithResult(_0x2d7469,_0x4028de){_0x4028de=_0x4028de||0xc8;return function(_0x415150){if(_0x415150){return _0x2d7469[_0xb721('0x19')](_0x4028de)[_0xb721('0x1a')](_0x415150);}};}function respondWithFilteredResult(_0x543d72,_0x40768f){return function(_0x36a9cc){if(_0x36a9cc){var _0x1859e1=typeof _0x40768f[_0xb721('0x1b')]===_0xb721('0x1c')&&typeof _0x40768f[_0xb721('0x1d')]===_0xb721('0x1c');var _0x520abd=_0x36a9cc['count'];var _0xf0bb90=_0x1859e1?0x0:_0x40768f[_0xb721('0x1b')];var _0x336011=_0x1859e1?_0x36a9cc[_0xb721('0x1e')]:_0x40768f[_0xb721('0x1b')]+_0x40768f[_0xb721('0x1d')];var _0x374179;if(_0x336011>=_0x520abd){_0x336011=_0x520abd;_0x374179=0xc8;}else{_0x374179=0xce;}_0x543d72[_0xb721('0x19')](_0x374179);return _0x543d72[_0xb721('0x1f')](_0xb721('0x20'),_0xf0bb90+'-'+_0x336011+'/'+_0x520abd)[_0xb721('0x1a')](_0x36a9cc);}return null;};}function patchUpdates(_0x43619f){return function(_0x9776c9){try{jsonpatch[_0xb721('0x21')](_0x9776c9,_0x43619f,!![]);}catch(_0x23a95a){return BPromise['reject'](_0x23a95a);}return _0x9776c9[_0xb721('0x22')]();};}function saveUpdates(_0x2e27b2,_0x2501ba){return function(_0x30f470){if(_0x30f470){return _0x30f470[_0xb721('0x23')](_0x2e27b2)[_0xb721('0x24')](function(_0x3e6425){return _0x3e6425;});}return null;};}function removeEntity(_0x21e864,_0x36d1f9){return function(_0x835e66){if(_0x835e66){return _0x835e66[_0xb721('0x25')]()['then'](function(){_0x21e864[_0xb721('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xfdbb0e,_0x5585dd){return function(_0x2f2b1c){if(!_0x2f2b1c){_0xfdbb0e[_0xb721('0x26')](0x194);}return _0x2f2b1c;};}function handleError(_0x40f9d2,_0x53d0b6){_0x53d0b6=_0x53d0b6||0x1f4;return function(_0x4ecef4){logger[_0xb721('0x27')](_0x4ecef4[_0xb721('0x28')]);if(_0x4ecef4[_0xb721('0x29')]){delete _0x4ecef4[_0xb721('0x29')];}_0x40f9d2[_0xb721('0x19')](_0x53d0b6)[_0xb721('0x2a')](_0x4ecef4);};}exports['index']=function(_0x2bba71,_0xde3ca2){var _0x4c4186={},_0x35156d={},_0xf46b31={'count':0x0,'rows':[]};var _0x4cd5b2=_['map'](db[_0xb721('0x2b')][_0xb721('0x2c')],function(_0x47511f){return{'name':_0x47511f[_0xb721('0x2d')],'type':_0x47511f[_0xb721('0x2e')]['key']};});_0x35156d[_0xb721('0x2f')]=_[_0xb721('0x30')](_0x4cd5b2,_0xb721('0x29'));_0x35156d['query']=_[_0xb721('0x31')](_0x2bba71[_0xb721('0x32')]);_0x35156d['filters']=_['intersection'](_0x35156d[_0xb721('0x2f')],_0x35156d[_0xb721('0x32')]);_0x4c4186['attributes']=_[_0xb721('0x33')](_0x35156d[_0xb721('0x2f')],qs[_0xb721('0x34')](_0x2bba71[_0xb721('0x32')][_0xb721('0x34')]));_0x4c4186[_0xb721('0x35')]=_0x4c4186[_0xb721('0x35')][_0xb721('0x36')]?_0x4c4186[_0xb721('0x35')]:_0x35156d[_0xb721('0x2f')];if(!_0x2bba71[_0xb721('0x32')]['hasOwnProperty'](_0xb721('0x37'))){_0x4c4186[_0xb721('0x1d')]=qs[_0xb721('0x1d')](_0x2bba71['query']['limit']);_0x4c4186[_0xb721('0x1b')]=qs[_0xb721('0x1b')](_0x2bba71[_0xb721('0x32')][_0xb721('0x1b')]);}_0x4c4186[_0xb721('0x38')]=qs['sort'](_0x2bba71[_0xb721('0x32')][_0xb721('0x39')]);_0x4c4186['where']=qs['filters'](_[_0xb721('0x3a')](_0x2bba71[_0xb721('0x32')],_0x35156d[_0xb721('0x3b')]),_0x4cd5b2);if(_0x2bba71[_0xb721('0x32')][_0xb721('0x3c')]){_0x4c4186[_0xb721('0x3d')]=_[_0xb721('0x3e')](_0x4c4186[_0xb721('0x3d')],{'$or':_['map'](_0x4cd5b2,function(_0x30c9d1){if(_0x30c9d1[_0xb721('0x2e')]!=='VIRTUAL'){var _0x2e21a3={};_0x2e21a3[_0x30c9d1[_0xb721('0x29')]]={'$like':'%'+_0x2bba71['query'][_0xb721('0x3c')]+'%'};return _0x2e21a3;}})});}_0x4c4186=_[_0xb721('0x3e')]({},_0x4c4186,_0x2bba71[_0xb721('0x3f')]);var _0x1911d6={'where':_0x4c4186[_0xb721('0x3d')]};return db[_0xb721('0x2b')][_0xb721('0x1e')](_0x1911d6)[_0xb721('0x24')](function(_0x92e78b){_0xf46b31[_0xb721('0x1e')]=_0x92e78b;if(_0x2bba71[_0xb721('0x32')][_0xb721('0x40')]){_0x4c4186['include']=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xb721('0x41')](_0x4c4186);})[_0xb721('0x24')](function(_0x417461){_0xf46b31[_0xb721('0x42')]=_0x417461;return _0xf46b31;})[_0xb721('0x24')](respondWithFilteredResult(_0xde3ca2,_0x4c4186))[_0xb721('0x43')](handleError(_0xde3ca2,null));};exports[_0xb721('0x44')]=function(_0x3be53e,_0x33db19){var _0x5c7b72={'raw':!![],'where':{'id':_0x3be53e[_0xb721('0x45')]['id']}},_0x42bcc5={};_0x42bcc5[_0xb721('0x2f')]=_[_0xb721('0x31')](db[_0xb721('0x2b')][_0xb721('0x2c')]);_0x42bcc5['query']=_[_0xb721('0x31')](_0x3be53e[_0xb721('0x32')]);_0x42bcc5[_0xb721('0x3b')]=_['intersection'](_0x42bcc5[_0xb721('0x2f')],_0x42bcc5['query']);_0x5c7b72[_0xb721('0x35')]=_[_0xb721('0x33')](_0x42bcc5[_0xb721('0x2f')],qs[_0xb721('0x34')](_0x3be53e['query']['fields']));_0x5c7b72['attributes']=_0x5c7b72[_0xb721('0x35')]['length']?_0x5c7b72[_0xb721('0x35')]:_0x42bcc5[_0xb721('0x2f')];if(_0x3be53e[_0xb721('0x32')]['includeAll']){_0x5c7b72[_0xb721('0x46')]=[{'all':!![]}];}_0x5c7b72=_['merge']({},_0x5c7b72,_0x3be53e[_0xb721('0x3f')]);return db['JscriptyQuestionReport']['find'](_0x5c7b72)[_0xb721('0x24')](handleEntityNotFound(_0x33db19,null))[_0xb721('0x24')](respondWithResult(_0x33db19,null))[_0xb721('0x43')](handleError(_0x33db19,null));};exports[_0xb721('0x47')]=function(_0x570314,_0x4f8ee4){return db[_0xb721('0x2b')][_0xb721('0x47')](_0x570314[_0xb721('0x48')],{})[_0xb721('0x24')](respondWithResult(_0x4f8ee4,0xc9))[_0xb721('0x43')](handleError(_0x4f8ee4,null));};exports[_0xb721('0x23')]=function(_0x5a2284,_0x4dea69){if(_0x5a2284[_0xb721('0x48')]['id']){delete _0x5a2284[_0xb721('0x48')]['id'];}return db[_0xb721('0x2b')]['find']({'where':{'id':_0x5a2284[_0xb721('0x45')]['id']}})[_0xb721('0x24')](handleEntityNotFound(_0x4dea69,null))[_0xb721('0x24')](saveUpdates(_0x5a2284[_0xb721('0x48')],null))[_0xb721('0x24')](respondWithResult(_0x4dea69,null))[_0xb721('0x43')](handleError(_0x4dea69,null));};exports[_0xb721('0x25')]=function(_0x2e538e,_0x189d2e){return db[_0xb721('0x2b')]['find']({'where':{'id':_0x2e538e[_0xb721('0x45')]['id']}})[_0xb721('0x24')](handleEntityNotFound(_0x189d2e,null))[_0xb721('0x24')](removeEntity(_0x189d2e,null))[_0xb721('0x43')](handleError(_0x189d2e,null));};exports[_0xb721('0x49')]=function(_0xd429a7,_0x163c3d){return db[_0xb721('0x2b')][_0xb721('0x49')]()[_0xb721('0x24')](respondWithResult(_0x163c3d,null))['catch'](handleError(_0x163c3d,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 587bfb9..2840d22 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 _0x6cb9=['../../config/environment','./jscriptyQuestionReport.attributes','define','JscriptyQuestionReport','report_jscripty_questions','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x131889,_0x448c0c){var _0x240b84=function(_0x5d7bfe){while(--_0x5d7bfe){_0x131889['push'](_0x131889['shift']());}};_0x240b84(++_0x448c0c);}(_0x6cb9,0x65));var _0x96cb=function(_0x4b1ce4,_0x4aa11f){_0x4b1ce4=_0x4b1ce4-0x0;var _0x569dd5=_0x6cb9[_0x4b1ce4];return _0x569dd5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x96cb('0x0'))(_0x96cb('0x1'));var moment=require(_0x96cb('0x2'));var BPromise=require(_0x96cb('0x3'));var rp=require(_0x96cb('0x4'));var fs=require('fs');var path=require(_0x96cb('0x5'));var rimraf=require(_0x96cb('0x6'));var config=require(_0x96cb('0x7'));var attributes=require(_0x96cb('0x8'));module['exports']=function(_0xbbe7b8,_0x15befd){return _0xbbe7b8[_0x96cb('0x9')](_0x96cb('0xa'),attributes,{'tableName':_0x96cb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2a07=['../../config/logger','api','moment','bluebird','path','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','util'];(function(_0x366928,_0x1e7892){var _0x58afe0=function(_0x20e106){while(--_0x20e106){_0x366928['push'](_0x366928['shift']());}};_0x58afe0(++_0x1e7892);}(_0x2a07,0x83));var _0x72a0=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x2a07[_0x1cc8fe];return _0x230054;};'use strict';var _=require('lodash');var util=require(_0x72a0('0x0'));var logger=require(_0x72a0('0x1'))(_0x72a0('0x2'));var moment=require(_0x72a0('0x3'));var BPromise=require(_0x72a0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x72a0('0x5'));var rimraf=require('rimraf');var config=require(_0x72a0('0x6'));var attributes=require(_0x72a0('0x7'));module[_0x72a0('0x8')]=function(_0x434b5e,_0x5755f0){return _0x434b5e[_0x72a0('0x9')](_0x72a0('0xa'),attributes,{'tableName':_0x72a0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index 4eb049f..ae4afe1 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 _0x98cc=['bluebird','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','catch','moment'];(function(_0x2afbb0,_0x44f16d){var _0x411ff2=function(_0x5edd7e){while(--_0x5edd7e){_0x2afbb0['push'](_0x2afbb0['shift']());}};_0x411ff2(++_0x44f16d);}(_0x98cc,0x84));var _0xc98c=function(_0x59616b,_0x38e534){_0x59616b=_0x59616b-0x0;var _0x5c4523=_0x98cc[_0x59616b];return _0x5c4523;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc98c('0x0'));var BPromise=require(_0xc98c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc98c('0x2'))['db'];var utils=require(_0xc98c('0x3'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xc98c('0x4'));var client=jayson[_0xc98c('0x5')][_0xc98c('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5a2992,_0x46fff4,_0x286e32){return new BPromise(function(_0x54cc8f,_0x4c05d3){return client[_0xc98c('0x7')](_0x5a2992,_0x286e32)[_0xc98c('0x8')](function(_0x4cc143){logger[_0xc98c('0x9')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x46fff4,_0xc98c('0xa'));logger[_0xc98c('0xb')](_0xc98c('0xc'),_0x46fff4,_0xc98c('0xa'),JSON[_0xc98c('0xd')](_0x4cc143));if(_0x4cc143['error']){if(_0x4cc143[_0xc98c('0xe')][_0xc98c('0xf')]===0x1f4){logger[_0xc98c('0xe')](_0xc98c('0x10'),_0x46fff4,_0x4cc143[_0xc98c('0xe')]['message']);return _0x4c05d3(_0x4cc143[_0xc98c('0xe')][_0xc98c('0x11')]);}logger[_0xc98c('0xe')](_0xc98c('0x10'),_0x46fff4,_0x4cc143[_0xc98c('0xe')][_0xc98c('0x11')]);return _0x54cc8f(_0x4cc143[_0xc98c('0xe')][_0xc98c('0x11')]);}else{logger['info'](_0xc98c('0x10'),_0x46fff4,_0xc98c('0xa'));_0x54cc8f(_0x4cc143['result'][_0xc98c('0x11')]);}})[_0xc98c('0x12')](function(_0x21d99b){logger[_0xc98c('0xe')](_0xc98c('0x10'),_0x46fff4,_0x21d99b);_0x4c05d3(_0x21d99b);});});} \ No newline at end of file +var _0xfca3=['request\x20sent','stringify','error','JscriptyQuestionReport,\x20%s,\x20%s','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xfca3,0x1be));var _0x3fca=function(_0x5bb8af,_0x1228cc){_0x5bb8af=_0x5bb8af-0x0;var _0x3fa31f=_0xfca3[_0x5bb8af];return _0x3fa31f;};'use strict';var _=require(_0x3fca('0x0'));var util=require('util');var moment=require(_0x3fca('0x1'));var BPromise=require('bluebird');var rs=require(_0x3fca('0x2'));var fs=require('fs');var Redis=require(_0x3fca('0x3'));var db=require(_0x3fca('0x4'))['db'];var utils=require(_0x3fca('0x5'));var logger=require(_0x3fca('0x6'))(_0x3fca('0x7'));var config=require(_0x3fca('0x8'));var jayson=require(_0x3fca('0x9'));var client=jayson['client'][_0x3fca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4352f3,_0x536ce4,_0xc61e0b){return new BPromise(function(_0x577e87,_0x13e425){return client[_0x3fca('0xb')](_0x4352f3,_0xc61e0b)[_0x3fca('0xc')](function(_0x5cc780){logger[_0x3fca('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x536ce4,'request\x20sent');logger[_0x3fca('0xe')](_0x3fca('0xf'),_0x536ce4,_0x3fca('0x10'),JSON[_0x3fca('0x11')](_0x5cc780));if(_0x5cc780[_0x3fca('0x12')]){if(_0x5cc780['error']['code']===0x1f4){logger[_0x3fca('0x12')](_0x3fca('0x13'),_0x536ce4,_0x5cc780[_0x3fca('0x12')][_0x3fca('0x14')]);return _0x13e425(_0x5cc780['error'][_0x3fca('0x14')]);}logger[_0x3fca('0x12')](_0x3fca('0x13'),_0x536ce4,_0x5cc780['error'][_0x3fca('0x14')]);return _0x577e87(_0x5cc780[_0x3fca('0x12')]['message']);}else{logger[_0x3fca('0xd')](_0x3fca('0x13'),_0x536ce4,'request\x20sent');_0x577e87(_0x5cc780[_0x3fca('0x15')][_0x3fca('0x14')]);}})['catch'](function(_0x234006){logger[_0x3fca('0x12')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x536ce4,_0x234006);_0x13e425(_0x234006);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index a036e03..b72908a 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 _0xc9e7=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','show','/:id/questions','post','put','/:id','update','delete','destroy','exports','multer'];(function(_0x5d104a,_0x579943){var _0x5b391a=function(_0x3c9d69){while(--_0x3c9d69){_0x5d104a['push'](_0x5d104a['shift']());}};_0x5b391a(++_0x579943);}(_0xc9e7,0x1a8));var _0x7c9e=function(_0x4da067,_0x2ebb49){_0x4da067=_0x4da067-0x0;var _0x4cdd71=_0xc9e7[_0x4da067];return _0x4cdd71;};'use strict';var multer=require(_0x7c9e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7c9e('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x7c9e('0x2'));var interaction=require(_0x7c9e('0x3'));var config=require(_0x7c9e('0x4'));var controller=require('./jscriptySessionReport.controller');router[_0x7c9e('0x5')]('/',auth[_0x7c9e('0x6')](),controller['index']);router[_0x7c9e('0x5')]('/describe',auth[_0x7c9e('0x6')](),controller[_0x7c9e('0x7')]);router['get']('/:id',auth[_0x7c9e('0x6')](),controller[_0x7c9e('0x8')]);router[_0x7c9e('0x5')](_0x7c9e('0x9'),auth[_0x7c9e('0x6')](),controller['getQuestions']);router[_0x7c9e('0xa')]('/',auth[_0x7c9e('0x6')](),controller['create']);router[_0x7c9e('0xb')](_0x7c9e('0xc'),auth[_0x7c9e('0x6')](),controller[_0x7c9e('0xd')]);router[_0x7c9e('0xe')](_0x7c9e('0xc'),auth['isAuthenticated'](),controller[_0x7c9e('0xf')]);module[_0x7c9e('0x10')]=router; \ No newline at end of file +var _0x042f=['../../config/environment','get','isAuthenticated','index','/describe','describe','/:id/questions','getQuestions','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4d5131,_0x43e265){var _0x5df536=function(_0x2a9ca0){while(--_0x2a9ca0){_0x4d5131['push'](_0x4d5131['shift']());}};_0x5df536(++_0x43e265);}(_0x042f,0x16e));var _0xf042=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x042f[_0x68c979];return _0x4f0001;};'use strict';var multer=require(_0xf042('0x0'));var util=require(_0xf042('0x1'));var path=require(_0xf042('0x2'));var timeout=require(_0xf042('0x3'));var express=require(_0xf042('0x4'));var router=express[_0xf042('0x5')]();var fs_extra=require(_0xf042('0x6'));var auth=require(_0xf042('0x7'));var interaction=require(_0xf042('0x8'));var config=require(_0xf042('0x9'));var controller=require('./jscriptySessionReport.controller');router[_0xf042('0xa')]('/',auth[_0xf042('0xb')](),controller[_0xf042('0xc')]);router['get'](_0xf042('0xd'),auth['isAuthenticated'](),controller[_0xf042('0xe')]);router[_0xf042('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0xf042('0xf'),auth[_0xf042('0xb')](),controller[_0xf042('0x10')]);router[_0xf042('0x11')]('/',auth['isAuthenticated'](),controller[_0xf042('0x12')]);router[_0xf042('0x13')](_0xf042('0x14'),auth[_0xf042('0xb')](),controller[_0xf042('0x15')]);router[_0xf042('0x16')](_0xf042('0x14'),auth[_0xf042('0xb')](),controller[_0xf042('0x17')]);module[_0xf042('0x18')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 081c238..66afdeb 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 _0x1cd3=['exports','DATE','setDataValue','starttime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize'];(function(_0x28acf6,_0x182a5d){var _0x534d52=function(_0x5c9abf){while(--_0x5c9abf){_0x28acf6['push'](_0x28acf6['shift']());}};_0x534d52(++_0x182a5d);}(_0x1cd3,0xda));var _0x31cd=function(_0xbf7a42,_0x574b64){_0xbf7a42=_0xbf7a42-0x0;var _0x3d186f=_0x1cd3[_0xbf7a42];return _0x3d186f;};'use strict';var moment=require(_0x31cd('0x0'));var Sequelize=require(_0x31cd('0x1'));module[_0x31cd('0x2')]={'starttime':{'type':Sequelize[_0x31cd('0x3')],'set':function(_0x299ab2){this[_0x31cd('0x4')](_0x31cd('0x5'),_0x299ab2);this[_0x31cd('0x4')]('endtime',moment()[_0x31cd('0x6')](_0x31cd('0x7')));}},'endtime':{'type':Sequelize[_0x31cd('0x3')]},'membername':{'type':Sequelize[_0x31cd('0x8')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x31cd('0x8')]},'uniqueid':{'type':Sequelize[_0x31cd('0x8')]},'calleridname':{'type':Sequelize[_0x31cd('0x8')]},'calleridnum':{'type':Sequelize[_0x31cd('0x8')]},'completed':{'type':Sequelize[_0x31cd('0x9')],'defaultValue':![]}}; \ No newline at end of file +var _0x88b5=['setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','exports','DATE'];(function(_0x367d67,_0x5138e0){var _0x1b685f=function(_0x461036){while(--_0x461036){_0x367d67['push'](_0x367d67['shift']());}};_0x1b685f(++_0x5138e0);}(_0x88b5,0x167));var _0x588b=function(_0x3b95e8,_0x38cd9c){_0x3b95e8=_0x3b95e8-0x0;var _0x93b863=_0x88b5[_0x3b95e8];return _0x93b863;};'use strict';var moment=require(_0x588b('0x0'));var Sequelize=require(_0x588b('0x1'));module[_0x588b('0x2')]={'starttime':{'type':Sequelize[_0x588b('0x3')],'set':function(_0x629f2d){this[_0x588b('0x4')](_0x588b('0x5'),_0x629f2d);this[_0x588b('0x4')](_0x588b('0x6'),moment()[_0x588b('0x7')](_0x588b('0x8')));}},'endtime':{'type':Sequelize[_0x588b('0x3')]},'membername':{'type':Sequelize[_0x588b('0x9')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x588b('0x9')]},'uniqueid':{'type':Sequelize[_0x588b('0x9')]},'calleridname':{'type':Sequelize[_0x588b('0x9')]},'calleridnum':{'type':Sequelize[_0x588b('0x9')]},'completed':{'type':Sequelize[_0x588b('0xa')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 769b61d..1206564 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 _0xc5b4=['offset','undefined','count','limit','status','set','apply','save','then','destroy','name','send','index','map','fieldName','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','JscriptySessionReport','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','update','describe','getQuestions','findOne','JscriptyQuestionReport','order','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','json'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xc5b4,0x82));var _0x4c5b=function(_0x3ca549,_0x1a589a){_0x3ca549=_0x3ca549-0x0;var _0x4082b1=_0xc5b4[_0x3ca549];return _0x4082b1;};'use strict';var emlformat=require(_0x4c5b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4c5b('0x1'));var jsonpatch=require(_0x4c5b('0x2'));var rp=require('request-promise');var moment=require(_0x4c5b('0x3'));var BPromise=require(_0x4c5b('0x4'));var Mustache=require(_0x4c5b('0x5'));var util=require(_0x4c5b('0x6'));var path=require(_0x4c5b('0x7'));var sox=require(_0x4c5b('0x8'));var csv=require('to-csv');var ejs=require(_0x4c5b('0x9'));var fs=require('fs');var fs_extra=require(_0x4c5b('0xa'));var _=require(_0x4c5b('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4c5b('0xc'));var deskjs=require(_0x4c5b('0xd'));var toCsv=require(_0x4c5b('0xe'));var querystring=require(_0x4c5b('0xf'));var Papa=require(_0x4c5b('0x10'));var Redis=require(_0x4c5b('0x11'));var authService=require(_0x4c5b('0x12'));var qs=require(_0x4c5b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4c5b('0x14'));var logger=require(_0x4c5b('0x15'))(_0x4c5b('0x16'));var utils=require('../../config/utils');var config=require(_0x4c5b('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x4c5b('0x18'))['db'];function respondWithStatusCode(_0x202129,_0x236b53){_0x236b53=_0x236b53||0xcc;return function(_0x5eae84){if(_0x5eae84){return _0x202129[_0x4c5b('0x19')](_0x236b53);}return _0x202129['status'](_0x236b53)[_0x4c5b('0x1a')]();};}function respondWithResult(_0x4c9817,_0xe8d040){_0xe8d040=_0xe8d040||0xc8;return function(_0x19f648){if(_0x19f648){return _0x4c9817['status'](_0xe8d040)[_0x4c5b('0x1b')](_0x19f648);}};}function respondWithFilteredResult(_0x4ba036,_0x25c22f){return function(_0x42054b){if(_0x42054b){var _0x497abb=typeof _0x25c22f[_0x4c5b('0x1c')]===_0x4c5b('0x1d')&&typeof _0x25c22f['limit']===_0x4c5b('0x1d');var _0x56b505=_0x42054b[_0x4c5b('0x1e')];var _0xa7c2e7=_0x497abb?0x0:_0x25c22f[_0x4c5b('0x1c')];var _0x4f3eb7=_0x497abb?_0x42054b['count']:_0x25c22f[_0x4c5b('0x1c')]+_0x25c22f[_0x4c5b('0x1f')];var _0x3fa6dd;if(_0x4f3eb7>=_0x56b505){_0x4f3eb7=_0x56b505;_0x3fa6dd=0xc8;}else{_0x3fa6dd=0xce;}_0x4ba036[_0x4c5b('0x20')](_0x3fa6dd);return _0x4ba036[_0x4c5b('0x21')]('Content-Range',_0xa7c2e7+'-'+_0x4f3eb7+'/'+_0x56b505)['json'](_0x42054b);}return null;};}function patchUpdates(_0x249af6){return function(_0x171ec6){try{jsonpatch[_0x4c5b('0x22')](_0x171ec6,_0x249af6,!![]);}catch(_0x5a8b9b){return BPromise['reject'](_0x5a8b9b);}return _0x171ec6[_0x4c5b('0x23')]();};}function saveUpdates(_0x597b2f,_0x3fc0ca){return function(_0x347920){if(_0x347920){return _0x347920['update'](_0x597b2f)[_0x4c5b('0x24')](function(_0x408c81){return _0x408c81;});}return null;};}function removeEntity(_0x7743be,_0x1d801e){return function(_0x4552b2){if(_0x4552b2){return _0x4552b2[_0x4c5b('0x25')]()['then'](function(){_0x7743be[_0x4c5b('0x20')](0xcc)[_0x4c5b('0x1a')]();});}};}function handleEntityNotFound(_0x29422c,_0x5b0c72){return function(_0x50639f){if(!_0x50639f){_0x29422c[_0x4c5b('0x19')](0x194);}return _0x50639f;};}function handleError(_0x10443d,_0x556d44){_0x556d44=_0x556d44||0x1f4;return function(_0x5599a2){logger['error'](_0x5599a2['stack']);if(_0x5599a2[_0x4c5b('0x26')]){delete _0x5599a2[_0x4c5b('0x26')];}_0x10443d['status'](_0x556d44)[_0x4c5b('0x27')](_0x5599a2);};}exports[_0x4c5b('0x28')]=function(_0x44adf2,_0xe8491){var _0x503792={},_0x66a709={},_0x54efb7={'count':0x0,'rows':[]};var _0x56fdf5=_[_0x4c5b('0x29')](db['JscriptySessionReport']['rawAttributes'],function(_0x2a9a06){return{'name':_0x2a9a06[_0x4c5b('0x2a')],'type':_0x2a9a06['type']['key']};});_0x66a709['model']=_['map'](_0x56fdf5,'name');_0x66a709['query']=_[_0x4c5b('0x2b')](_0x44adf2[_0x4c5b('0x2c')]);_0x66a709[_0x4c5b('0x2d')]=_[_0x4c5b('0x2e')](_0x66a709[_0x4c5b('0x2f')],_0x66a709[_0x4c5b('0x2c')]);_0x503792['attributes']=_[_0x4c5b('0x2e')](_0x66a709[_0x4c5b('0x2f')],qs['fields'](_0x44adf2[_0x4c5b('0x2c')][_0x4c5b('0x30')]));_0x503792[_0x4c5b('0x31')]=_0x503792['attributes'][_0x4c5b('0x32')]?_0x503792[_0x4c5b('0x31')]:_0x66a709[_0x4c5b('0x2f')];if(!_0x44adf2[_0x4c5b('0x2c')][_0x4c5b('0x33')](_0x4c5b('0x34'))){_0x503792['limit']=qs[_0x4c5b('0x1f')](_0x44adf2[_0x4c5b('0x2c')][_0x4c5b('0x1f')]);_0x503792[_0x4c5b('0x1c')]=qs[_0x4c5b('0x1c')](_0x44adf2[_0x4c5b('0x2c')][_0x4c5b('0x1c')]);}_0x503792['order']=qs['sort'](_0x44adf2[_0x4c5b('0x2c')][_0x4c5b('0x35')]);_0x503792[_0x4c5b('0x36')]=qs[_0x4c5b('0x2d')](_[_0x4c5b('0x37')](_0x44adf2['query'],_0x66a709[_0x4c5b('0x2d')]),_0x56fdf5);if(_0x44adf2[_0x4c5b('0x2c')][_0x4c5b('0x38')]){_0x503792[_0x4c5b('0x36')]=_['merge'](_0x503792['where'],{'$or':_[_0x4c5b('0x29')](_0x56fdf5,function(_0x4e56aa){if(_0x4e56aa[_0x4c5b('0x39')]!==_0x4c5b('0x3a')){var _0x176285={};_0x176285[_0x4e56aa[_0x4c5b('0x26')]]={'$like':'%'+_0x44adf2[_0x4c5b('0x2c')][_0x4c5b('0x38')]+'%'};return _0x176285;}})});}_0x503792=_[_0x4c5b('0x3b')]({},_0x503792,_0x44adf2[_0x4c5b('0x3c')]);var _0x5076ac={'where':_0x503792['where']};return db[_0x4c5b('0x3d')][_0x4c5b('0x1e')](_0x5076ac)[_0x4c5b('0x24')](function(_0x45e22e){_0x54efb7[_0x4c5b('0x1e')]=_0x45e22e;if(_0x44adf2['query'][_0x4c5b('0x3e')]){_0x503792[_0x4c5b('0x3f')]=[{'all':!![]}];}return db[_0x4c5b('0x3d')][_0x4c5b('0x40')](_0x503792);})[_0x4c5b('0x24')](function(_0x46f792){_0x54efb7[_0x4c5b('0x41')]=_0x46f792;return _0x54efb7;})[_0x4c5b('0x24')](respondWithFilteredResult(_0xe8491,_0x503792))['catch'](handleError(_0xe8491,null));};exports[_0x4c5b('0x42')]=function(_0x196092,_0x382139){var _0x4da7b9={'raw':!![],'where':{'id':_0x196092[_0x4c5b('0x43')]['id']}},_0x10976d={};_0x10976d['model']=_[_0x4c5b('0x2b')](db[_0x4c5b('0x3d')][_0x4c5b('0x44')]);_0x10976d['query']=_[_0x4c5b('0x2b')](_0x196092['query']);_0x10976d[_0x4c5b('0x2d')]=_['intersection'](_0x10976d['model'],_0x10976d[_0x4c5b('0x2c')]);_0x4da7b9[_0x4c5b('0x31')]=_[_0x4c5b('0x2e')](_0x10976d['model'],qs[_0x4c5b('0x30')](_0x196092['query'][_0x4c5b('0x30')]));_0x4da7b9[_0x4c5b('0x31')]=_0x4da7b9[_0x4c5b('0x31')][_0x4c5b('0x32')]?_0x4da7b9['attributes']:_0x10976d[_0x4c5b('0x2f')];if(_0x196092['query'][_0x4c5b('0x3e')]){_0x4da7b9[_0x4c5b('0x3f')]=[{'all':!![]}];}_0x4da7b9=_[_0x4c5b('0x3b')]({},_0x4da7b9,_0x196092[_0x4c5b('0x3c')]);return db[_0x4c5b('0x3d')][_0x4c5b('0x45')](_0x4da7b9)['then'](handleEntityNotFound(_0x382139,null))[_0x4c5b('0x24')](respondWithResult(_0x382139,null))[_0x4c5b('0x46')](handleError(_0x382139,null));};exports[_0x4c5b('0x47')]=function(_0x558947,_0x5d0a3c){return db[_0x4c5b('0x3d')][_0x4c5b('0x47')](_0x558947[_0x4c5b('0x48')],{})[_0x4c5b('0x24')](respondWithResult(_0x5d0a3c,0xc9))[_0x4c5b('0x46')](handleError(_0x5d0a3c,null));};exports[_0x4c5b('0x49')]=function(_0x44085b,_0x3fd053){if(_0x44085b[_0x4c5b('0x48')]['id']){delete _0x44085b[_0x4c5b('0x48')]['id'];}return db[_0x4c5b('0x3d')][_0x4c5b('0x45')]({'where':{'id':_0x44085b[_0x4c5b('0x43')]['id']}})[_0x4c5b('0x24')](handleEntityNotFound(_0x3fd053,null))['then'](saveUpdates(_0x44085b['body'],null))['then'](respondWithResult(_0x3fd053,null))['catch'](handleError(_0x3fd053,null));};exports[_0x4c5b('0x25')]=function(_0x23b38b,_0x4cc4b6){return db[_0x4c5b('0x3d')][_0x4c5b('0x45')]({'where':{'id':_0x23b38b[_0x4c5b('0x43')]['id']}})[_0x4c5b('0x24')](handleEntityNotFound(_0x4cc4b6,null))[_0x4c5b('0x24')](removeEntity(_0x4cc4b6,null))[_0x4c5b('0x46')](handleError(_0x4cc4b6,null));};exports[_0x4c5b('0x4a')]=function(_0x4a6ac8,_0x32d6e7){return db[_0x4c5b('0x3d')][_0x4c5b('0x4a')]()[_0x4c5b('0x24')](respondWithResult(_0x32d6e7,null))[_0x4c5b('0x46')](handleError(_0x32d6e7,null));};exports[_0x4c5b('0x4b')]=function(_0x44251c,_0x21de33,_0x2dccdd){var _0xf48351={'raw':!![],'where':{}};var _0x585f17={};var _0x2d7bbc={'count':0x0,'rows':[]};return db[_0x4c5b('0x3d')][_0x4c5b('0x4c')]({'where':{'id':_0x44251c['params']['id']}})[_0x4c5b('0x24')](handleEntityNotFound(_0x21de33,null))['then'](function(_0x17b9e5){if(_0x17b9e5){_0x585f17[_0x4c5b('0x2f')]=_[_0x4c5b('0x2b')](db[_0x4c5b('0x4d')][_0x4c5b('0x44')]);_0x585f17[_0x4c5b('0x2c')]=_['keys'](_0x44251c[_0x4c5b('0x2c')]);_0x585f17[_0x4c5b('0x2d')]=_['intersection'](_0x585f17[_0x4c5b('0x2f')],_0x585f17['query']);_0xf48351[_0x4c5b('0x31')]=_[_0x4c5b('0x2e')](_0x585f17[_0x4c5b('0x2f')],qs[_0x4c5b('0x30')](_0x44251c[_0x4c5b('0x2c')][_0x4c5b('0x30')]));_0xf48351[_0x4c5b('0x31')]=_0xf48351[_0x4c5b('0x31')][_0x4c5b('0x32')]?_0xf48351['attributes']:_0x585f17[_0x4c5b('0x2f')];if(!_0x44251c[_0x4c5b('0x2c')][_0x4c5b('0x33')](_0x4c5b('0x34'))){_0xf48351[_0x4c5b('0x1f')]=qs[_0x4c5b('0x1f')](_0x44251c['query'][_0x4c5b('0x1f')]);_0xf48351[_0x4c5b('0x1c')]=qs['offset'](_0x44251c[_0x4c5b('0x2c')][_0x4c5b('0x1c')]);}_0xf48351[_0x4c5b('0x4e')]=qs[_0x4c5b('0x35')](_0x44251c['query'][_0x4c5b('0x35')]);_0xf48351['where']=qs[_0x4c5b('0x2d')](_[_0x4c5b('0x37')](_0x44251c[_0x4c5b('0x2c')],_0x585f17[_0x4c5b('0x2d')]));_0xf48351[_0x4c5b('0x36')]['SessionId']=_0x17b9e5['id'];if(_0x44251c[_0x4c5b('0x2c')][_0x4c5b('0x38')]){_0xf48351[_0x4c5b('0x36')]=_['merge'](_0xf48351[_0x4c5b('0x36')],{'$or':_['map'](_0xf48351[_0x4c5b('0x31')],function(_0x5e2a7f){var _0x45fb01={};_0x45fb01[_0x5e2a7f]={'$like':'%'+_0x44251c[_0x4c5b('0x2c')][_0x4c5b('0x38')]+'%'};return _0x45fb01;})});}_0xf48351=_[_0x4c5b('0x3b')]({},_0xf48351,_0x44251c[_0x4c5b('0x3c')]);return db[_0x4c5b('0x4d')][_0x4c5b('0x1e')]({'where':_0xf48351[_0x4c5b('0x36')]})[_0x4c5b('0x24')](function(_0x116974){_0x2d7bbc['count']=_0x116974;if(_0x44251c[_0x4c5b('0x2c')]['includeAll']){_0xf48351['include']=[{'all':!![]}];}return db[_0x4c5b('0x4d')][_0x4c5b('0x40')](_0xf48351);})[_0x4c5b('0x24')](function(_0x4a9d3a){_0x2d7bbc[_0x4c5b('0x41')]=_0x4a9d3a;return _0x2d7bbc;});}})['then'](respondWithFilteredResult(_0x21de33,_0xf48351))[_0x4c5b('0x46')](handleError(_0x21de33,null));}; \ No newline at end of file +var _0x79c7=['rimraf','zip-dir','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','apply','update','end','error','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','type','model','query','intersection','attributes','hasOwnProperty','nolimit','order','filters','pick','filter','where','VIRTUAL','options','then','includeAll','include','findAll','catch','params','keys','length','merge','body','find','describe','getQuestions','fields','sort','SessionId','JscriptyQuestionReport','rows','eml-format'];(function(_0x1d7466,_0x161771){var _0x3ebbb6=function(_0x2044f6){while(--_0x2044f6){_0x1d7466['push'](_0x1d7466['shift']());}};_0x3ebbb6(++_0x161771);}(_0x79c7,0x91));var _0x779c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x79c7[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x779c('0x0'));var rimraf=require(_0x779c('0x1'));var zipdir=require(_0x779c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x779c('0x3'));var Mustache=require(_0x779c('0x4'));var util=require(_0x779c('0x5'));var path=require('path');var sox=require(_0x779c('0x6'));var csv=require(_0x779c('0x7'));var ejs=require(_0x779c('0x8'));var fs=require('fs');var fs_extra=require(_0x779c('0x9'));var _=require(_0x779c('0xa'));var squel=require('squel');var crypto=require(_0x779c('0xb'));var jsforce=require(_0x779c('0xc'));var deskjs=require(_0x779c('0xd'));var toCsv=require('to-csv');var querystring=require(_0x779c('0xe'));var Papa=require(_0x779c('0xf'));var Redis=require('ioredis');var authService=require(_0x779c('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x779c('0x11'));var hardwareService=require(_0x779c('0x12'));var logger=require(_0x779c('0x13'))(_0x779c('0x14'));var utils=require('../../config/utils');var config=require(_0x779c('0x15'));var licenseUtil=require(_0x779c('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d364a,_0x497321){_0x497321=_0x497321||0xcc;return function(_0x202bb1){if(_0x202bb1){return _0x1d364a[_0x779c('0x17')](_0x497321);}return _0x1d364a[_0x779c('0x18')](_0x497321)['end']();};}function respondWithResult(_0x2e699b,_0x5998bd){_0x5998bd=_0x5998bd||0xc8;return function(_0x44540a){if(_0x44540a){return _0x2e699b['status'](_0x5998bd)[_0x779c('0x19')](_0x44540a);}};}function respondWithFilteredResult(_0x17b698,_0x5154b8){return function(_0x32359e){if(_0x32359e){var _0x58c4f4=typeof _0x5154b8[_0x779c('0x1a')]===_0x779c('0x1b')&&typeof _0x5154b8[_0x779c('0x1c')]===_0x779c('0x1b');var _0x4b3b6a=_0x32359e['count'];var _0x3bccb0=_0x58c4f4?0x0:_0x5154b8[_0x779c('0x1a')];var _0x4daa65=_0x58c4f4?_0x32359e[_0x779c('0x1d')]:_0x5154b8[_0x779c('0x1a')]+_0x5154b8[_0x779c('0x1c')];var _0x5110f7;if(_0x4daa65>=_0x4b3b6a){_0x4daa65=_0x4b3b6a;_0x5110f7=0xc8;}else{_0x5110f7=0xce;}_0x17b698[_0x779c('0x18')](_0x5110f7);return _0x17b698['set']('Content-Range',_0x3bccb0+'-'+_0x4daa65+'/'+_0x4b3b6a)['json'](_0x32359e);}return null;};}function patchUpdates(_0x529fa2){return function(_0x20bb18){try{jsonpatch[_0x779c('0x1e')](_0x20bb18,_0x529fa2,!![]);}catch(_0x48dd27){return BPromise['reject'](_0x48dd27);}return _0x20bb18['save']();};}function saveUpdates(_0xcdb9f6,_0x2b7beb){return function(_0x2be84d){if(_0x2be84d){return _0x2be84d[_0x779c('0x1f')](_0xcdb9f6)['then'](function(_0x4e46b8){return _0x4e46b8;});}return null;};}function removeEntity(_0x24d6c5,_0x34aa8e){return function(_0x2bc8c3){if(_0x2bc8c3){return _0x2bc8c3['destroy']()['then'](function(){_0x24d6c5['status'](0xcc)[_0x779c('0x20')]();});}};}function handleEntityNotFound(_0x27dfe1,_0x16fda2){return function(_0x1d6a8e){if(!_0x1d6a8e){_0x27dfe1[_0x779c('0x17')](0x194);}return _0x1d6a8e;};}function handleError(_0x4a64a4,_0x303f7c){_0x303f7c=_0x303f7c||0x1f4;return function(_0x4e7d02){logger[_0x779c('0x21')](_0x4e7d02['stack']);if(_0x4e7d02[_0x779c('0x22')]){delete _0x4e7d02[_0x779c('0x22')];}_0x4a64a4[_0x779c('0x18')](_0x303f7c)[_0x779c('0x23')](_0x4e7d02);};}exports[_0x779c('0x24')]=function(_0x3a7e69,_0x4586a4){var _0x1cad80={},_0x5cb11a={},_0xb630d7={'count':0x0,'rows':[]};var _0xeb77bf=_[_0x779c('0x25')](db[_0x779c('0x26')][_0x779c('0x27')],function(_0x2b69ca){return{'name':_0x2b69ca[_0x779c('0x28')],'type':_0x2b69ca[_0x779c('0x29')]['key']};});_0x5cb11a[_0x779c('0x2a')]=_[_0x779c('0x25')](_0xeb77bf,_0x779c('0x22'));_0x5cb11a[_0x779c('0x2b')]=_['keys'](_0x3a7e69['query']);_0x5cb11a['filters']=_[_0x779c('0x2c')](_0x5cb11a[_0x779c('0x2a')],_0x5cb11a[_0x779c('0x2b')]);_0x1cad80[_0x779c('0x2d')]=_[_0x779c('0x2c')](_0x5cb11a['model'],qs['fields'](_0x3a7e69[_0x779c('0x2b')]['fields']));_0x1cad80[_0x779c('0x2d')]=_0x1cad80[_0x779c('0x2d')]['length']?_0x1cad80[_0x779c('0x2d')]:_0x5cb11a[_0x779c('0x2a')];if(!_0x3a7e69['query'][_0x779c('0x2e')](_0x779c('0x2f'))){_0x1cad80[_0x779c('0x1c')]=qs[_0x779c('0x1c')](_0x3a7e69['query'][_0x779c('0x1c')]);_0x1cad80['offset']=qs[_0x779c('0x1a')](_0x3a7e69[_0x779c('0x2b')][_0x779c('0x1a')]);}_0x1cad80[_0x779c('0x30')]=qs['sort'](_0x3a7e69[_0x779c('0x2b')]['sort']);_0x1cad80['where']=qs[_0x779c('0x31')](_[_0x779c('0x32')](_0x3a7e69['query'],_0x5cb11a[_0x779c('0x31')]),_0xeb77bf);if(_0x3a7e69[_0x779c('0x2b')][_0x779c('0x33')]){_0x1cad80[_0x779c('0x34')]=_['merge'](_0x1cad80['where'],{'$or':_['map'](_0xeb77bf,function(_0x21d453){if(_0x21d453[_0x779c('0x29')]!==_0x779c('0x35')){var _0x2ccde3={};_0x2ccde3[_0x21d453[_0x779c('0x22')]]={'$like':'%'+_0x3a7e69[_0x779c('0x2b')]['filter']+'%'};return _0x2ccde3;}})});}_0x1cad80=_['merge']({},_0x1cad80,_0x3a7e69[_0x779c('0x36')]);var _0x1ad119={'where':_0x1cad80[_0x779c('0x34')]};return db[_0x779c('0x26')]['count'](_0x1ad119)[_0x779c('0x37')](function(_0x244acc){_0xb630d7[_0x779c('0x1d')]=_0x244acc;if(_0x3a7e69[_0x779c('0x2b')][_0x779c('0x38')]){_0x1cad80[_0x779c('0x39')]=[{'all':!![]}];}return db[_0x779c('0x26')][_0x779c('0x3a')](_0x1cad80);})[_0x779c('0x37')](function(_0x1ba00d){_0xb630d7['rows']=_0x1ba00d;return _0xb630d7;})[_0x779c('0x37')](respondWithFilteredResult(_0x4586a4,_0x1cad80))[_0x779c('0x3b')](handleError(_0x4586a4,null));};exports['show']=function(_0x368fbf,_0x359ef4){var _0x2f05ee={'raw':!![],'where':{'id':_0x368fbf[_0x779c('0x3c')]['id']}},_0x270c75={};_0x270c75[_0x779c('0x2a')]=_[_0x779c('0x3d')](db[_0x779c('0x26')][_0x779c('0x27')]);_0x270c75['query']=_[_0x779c('0x3d')](_0x368fbf[_0x779c('0x2b')]);_0x270c75[_0x779c('0x31')]=_[_0x779c('0x2c')](_0x270c75[_0x779c('0x2a')],_0x270c75[_0x779c('0x2b')]);_0x2f05ee['attributes']=_[_0x779c('0x2c')](_0x270c75[_0x779c('0x2a')],qs['fields'](_0x368fbf[_0x779c('0x2b')]['fields']));_0x2f05ee['attributes']=_0x2f05ee[_0x779c('0x2d')][_0x779c('0x3e')]?_0x2f05ee[_0x779c('0x2d')]:_0x270c75[_0x779c('0x2a')];if(_0x368fbf['query'][_0x779c('0x38')]){_0x2f05ee[_0x779c('0x39')]=[{'all':!![]}];}_0x2f05ee=_[_0x779c('0x3f')]({},_0x2f05ee,_0x368fbf[_0x779c('0x36')]);return db[_0x779c('0x26')]['find'](_0x2f05ee)[_0x779c('0x37')](handleEntityNotFound(_0x359ef4,null))[_0x779c('0x37')](respondWithResult(_0x359ef4,null))['catch'](handleError(_0x359ef4,null));};exports['create']=function(_0x2c143f,_0x21d79c){return db[_0x779c('0x26')]['create'](_0x2c143f[_0x779c('0x40')],{})[_0x779c('0x37')](respondWithResult(_0x21d79c,0xc9))[_0x779c('0x3b')](handleError(_0x21d79c,null));};exports[_0x779c('0x1f')]=function(_0x418aac,_0xad4354){if(_0x418aac[_0x779c('0x40')]['id']){delete _0x418aac[_0x779c('0x40')]['id'];}return db['JscriptySessionReport'][_0x779c('0x41')]({'where':{'id':_0x418aac['params']['id']}})[_0x779c('0x37')](handleEntityNotFound(_0xad4354,null))[_0x779c('0x37')](saveUpdates(_0x418aac[_0x779c('0x40')],null))[_0x779c('0x37')](respondWithResult(_0xad4354,null))[_0x779c('0x3b')](handleError(_0xad4354,null));};exports['destroy']=function(_0x596b27,_0x3aba32){return db[_0x779c('0x26')][_0x779c('0x41')]({'where':{'id':_0x596b27[_0x779c('0x3c')]['id']}})[_0x779c('0x37')](handleEntityNotFound(_0x3aba32,null))['then'](removeEntity(_0x3aba32,null))[_0x779c('0x3b')](handleError(_0x3aba32,null));};exports['describe']=function(_0x2a7b12,_0x22f020){return db[_0x779c('0x26')][_0x779c('0x42')]()[_0x779c('0x37')](respondWithResult(_0x22f020,null))['catch'](handleError(_0x22f020,null));};exports[_0x779c('0x43')]=function(_0x13f582,_0x5da57d,_0x6e740b){var _0x2e660f={'raw':!![],'where':{}};var _0x13c553={};var _0x1057f8={'count':0x0,'rows':[]};return db[_0x779c('0x26')]['findOne']({'where':{'id':_0x13f582['params']['id']}})[_0x779c('0x37')](handleEntityNotFound(_0x5da57d,null))[_0x779c('0x37')](function(_0x30abf4){if(_0x30abf4){_0x13c553['model']=_[_0x779c('0x3d')](db['JscriptyQuestionReport']['rawAttributes']);_0x13c553[_0x779c('0x2b')]=_[_0x779c('0x3d')](_0x13f582['query']);_0x13c553[_0x779c('0x31')]=_[_0x779c('0x2c')](_0x13c553[_0x779c('0x2a')],_0x13c553[_0x779c('0x2b')]);_0x2e660f[_0x779c('0x2d')]=_[_0x779c('0x2c')](_0x13c553[_0x779c('0x2a')],qs[_0x779c('0x44')](_0x13f582[_0x779c('0x2b')][_0x779c('0x44')]));_0x2e660f[_0x779c('0x2d')]=_0x2e660f[_0x779c('0x2d')]['length']?_0x2e660f['attributes']:_0x13c553[_0x779c('0x2a')];if(!_0x13f582[_0x779c('0x2b')][_0x779c('0x2e')](_0x779c('0x2f'))){_0x2e660f[_0x779c('0x1c')]=qs['limit'](_0x13f582['query']['limit']);_0x2e660f[_0x779c('0x1a')]=qs[_0x779c('0x1a')](_0x13f582[_0x779c('0x2b')]['offset']);}_0x2e660f[_0x779c('0x30')]=qs[_0x779c('0x45')](_0x13f582[_0x779c('0x2b')][_0x779c('0x45')]);_0x2e660f['where']=qs['filters'](_[_0x779c('0x32')](_0x13f582[_0x779c('0x2b')],_0x13c553['filters']));_0x2e660f[_0x779c('0x34')][_0x779c('0x46')]=_0x30abf4['id'];if(_0x13f582['query'][_0x779c('0x33')]){_0x2e660f[_0x779c('0x34')]=_[_0x779c('0x3f')](_0x2e660f['where'],{'$or':_[_0x779c('0x25')](_0x2e660f[_0x779c('0x2d')],function(_0x35dfae){var _0x266f34={};_0x266f34[_0x35dfae]={'$like':'%'+_0x13f582[_0x779c('0x2b')][_0x779c('0x33')]+'%'};return _0x266f34;})});}_0x2e660f=_['merge']({},_0x2e660f,_0x13f582[_0x779c('0x36')]);return db[_0x779c('0x47')][_0x779c('0x1d')]({'where':_0x2e660f['where']})[_0x779c('0x37')](function(_0x5be013){_0x1057f8[_0x779c('0x1d')]=_0x5be013;if(_0x13f582[_0x779c('0x2b')]['includeAll']){_0x2e660f['include']=[{'all':!![]}];}return db[_0x779c('0x47')][_0x779c('0x3a')](_0x2e660f);})[_0x779c('0x37')](function(_0x45c9a0){_0x1057f8[_0x779c('0x48')]=_0x45c9a0;return _0x1057f8;});}})['then'](respondWithFilteredResult(_0x5da57d,_0x2e660f))[_0x779c('0x3b')](handleError(_0x5da57d,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index d08d127..34853c7 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 _0xba34=['rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','report_jscripty_sessions','lodash','util','../../config/logger','api','moment'];(function(_0x2641a8,_0x314bac){var _0x1f1ad3=function(_0x33f0b2){while(--_0x33f0b2){_0x2641a8['push'](_0x2641a8['shift']());}};_0x1f1ad3(++_0x314bac);}(_0xba34,0x119));var _0x4ba3=function(_0x149616,_0x36ebd4){_0x149616=_0x149616-0x0;var _0x538f0f=_0xba34[_0x149616];return _0x538f0f;};'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')]('JscriptySessionReport',attributes,{'tableName':_0x4ba3('0xa'),'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(_0x1eb593,_0x490e1c){var _0x3315d8=function(_0x1f921b){while(--_0x1f921b){_0x1eb593['push'](_0x1eb593['shift']());}};_0x3315d8(++_0x490e1c);}(_0x53ec,0x192));var _0xc53e=function(_0x3bb5b4,_0x128455){_0x3bb5b4=_0x3bb5b4-0x0;var _0x586c60=_0x53ec[_0x3bb5b4];return _0x586c60;};'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 11daad0..e0af0b4 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 _0xe5af=['jayson/promise','client','then','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x5d29e8,_0x30a53b){var _0x3542cc=function(_0x1f06a5){while(--_0x1f06a5){_0x5d29e8['push'](_0x5d29e8['shift']());}};_0x3542cc(++_0x30a53b);}(_0xe5af,0x9c));var _0xfe5a=function(_0x9f7cd4,_0x46d39f){_0x9f7cd4=_0x9f7cd4-0x0;var _0x3a21e9=_0xe5af[_0x9f7cd4];return _0x3a21e9;};'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});function respondWithRpcPromise(_0x5eea2e,_0x356c69,_0x106492){return new BPromise(function(_0xfb4357,_0x3e683c){return client['request'](_0x5eea2e,_0x106492)[_0xfe5a('0x8')](function(_0x5a48ff){logger['info'](_0xfe5a('0x9'),_0x356c69,_0xfe5a('0xa'));logger['debug'](_0xfe5a('0xb'),_0x356c69,_0xfe5a('0xa'),JSON[_0xfe5a('0xc')](_0x5a48ff));if(_0x5a48ff[_0xfe5a('0xd')]){if(_0x5a48ff[_0xfe5a('0xd')]['code']===0x1f4){logger[_0xfe5a('0xd')](_0xfe5a('0x9'),_0x356c69,_0x5a48ff[_0xfe5a('0xd')][_0xfe5a('0xe')]);return _0x3e683c(_0x5a48ff[_0xfe5a('0xd')]['message']);}logger[_0xfe5a('0xd')](_0xfe5a('0x9'),_0x356c69,_0x5a48ff[_0xfe5a('0xd')][_0xfe5a('0xe')]);return _0xfb4357(_0x5a48ff[_0xfe5a('0xd')][_0xfe5a('0xe')]);}else{logger[_0xfe5a('0xf')](_0xfe5a('0x9'),_0x356c69,_0xfe5a('0xa'));_0xfb4357(_0x5a48ff[_0xfe5a('0x10')][_0xfe5a('0xe')]);}})[_0xfe5a('0x11')](function(_0x22afa7){logger[_0xfe5a('0xd')](_0xfe5a('0x9'),_0x356c69,_0x22afa7);_0x3e683c(_0x22afa7);});});} \ No newline at end of file +var _0xc6ac=['http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4f4ec7,_0x723bc5){var _0x584689=function(_0x569c63){while(--_0x569c63){_0x4f4ec7['push'](_0x4f4ec7['shift']());}};_0x584689(++_0x723bc5);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x47cc6c,_0x4dca78){_0x47cc6c=_0x47cc6c-0x0;var _0x51066b=_0xc6ac[_0x47cc6c];return _0x51066b;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var moment=require(_0xcc6a('0x2'));var BPromise=require(_0xcc6a('0x3'));var rs=require(_0xcc6a('0x4'));var fs=require('fs');var Redis=require(_0xcc6a('0x5'));var db=require(_0xcc6a('0x6'))['db'];var utils=require(_0xcc6a('0x7'));var logger=require(_0xcc6a('0x8'))(_0xcc6a('0x9'));var config=require(_0xcc6a('0xa'));var jayson=require(_0xcc6a('0xb'));var client=jayson[_0xcc6a('0xc')][_0xcc6a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5f3887,_0x3dd497,_0x11b919){return new BPromise(function(_0xf02261,_0x560cc4){return client[_0xcc6a('0xe')](_0x5f3887,_0x11b919)[_0xcc6a('0xf')](function(_0x7806a0){logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,'request\x20sent');logger[_0xcc6a('0x12')](_0xcc6a('0x13'),_0x3dd497,_0xcc6a('0x14'),JSON['stringify'](_0x7806a0));if(_0x7806a0[_0xcc6a('0x15')]){if(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x16')]===0x1f4){logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0x560cc4(_0x7806a0[_0xcc6a('0x15')]['message']);}logger['error'](_0xcc6a('0x11'),_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0xf02261(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);}else{logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,_0xcc6a('0x14'));_0xf02261(_0x7806a0['result']['message']);}})['catch'](function(_0x395a55){logger[_0xcc6a('0x15')](_0xcc6a('0x11'),_0x3dd497,_0x395a55);_0x560cc4(_0x395a55);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index d378957..d263267 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 _0x73db=['path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./license.controller','index','update','/download_log_file','downloadLogFile','exports','util'];(function(_0x5da475,_0x23d85b){var _0x68e495=function(_0x1945fb){while(--_0x1945fb){_0x5da475['push'](_0x5da475['shift']());}};_0x68e495(++_0x23d85b);}(_0x73db,0xb5));var _0xb73d=function(_0x44fdb2,_0x35fe89){_0x44fdb2=_0x44fdb2-0x0;var _0x2b53fe=_0x73db[_0x44fdb2];return _0x2b53fe;};'use strict';var multer=require('multer');var util=require(_0xb73d('0x0'));var path=require(_0xb73d('0x1'));var timeout=require('connect-timeout');var express=require(_0xb73d('0x2'));var router=express[_0xb73d('0x3')]();var fs_extra=require(_0xb73d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb73d('0x5'));var config=require(_0xb73d('0x6'));var controller=require(_0xb73d('0x7'));router['get']('/',controller[_0xb73d('0x8')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xb73d('0x9')]);router['get'](_0xb73d('0xa'),auth['isAuthenticated'](),controller[_0xb73d('0xb')]);module[_0xb73d('0xc')]=router; \ No newline at end of file +var _0xef1b=['./license.controller','get','index','put','isAuthenticated','update','/download_log_file','downloadLogFile','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0xef1b,0xe1));var _0xbef1=function(_0x152548,_0x2c5b6d){_0x152548=_0x152548-0x0;var _0x26cd0c=_0xef1b[_0x152548];return _0x26cd0c;};'use strict';var multer=require(_0xbef1('0x0'));var util=require(_0xbef1('0x1'));var path=require(_0xbef1('0x2'));var timeout=require(_0xbef1('0x3'));var express=require(_0xbef1('0x4'));var router=express[_0xbef1('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xbef1('0x6'));var interaction=require(_0xbef1('0x7'));var config=require(_0xbef1('0x8'));var controller=require(_0xbef1('0x9'));router[_0xbef1('0xa')]('/',controller[_0xbef1('0xb')]);router[_0xbef1('0xc')]('/:id',auth[_0xbef1('0xd')](),controller[_0xbef1('0xe')]);router[_0xbef1('0xa')](_0xbef1('0xf'),auth[_0xbef1('0xd')](),controller[_0xbef1('0x10')]);module[_0xbef1('0x11')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index e299a6e..20ea2db 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 _0x3046=['sequelize','TEXT','STRING','INTEGER'];(function(_0xf9dcc5,_0x44aed5){var _0x228d6d=function(_0x970824){while(--_0x970824){_0xf9dcc5['push'](_0xf9dcc5['shift']());}};_0x228d6d(++_0x44aed5);}(_0x3046,0x1ac));var _0x6304=function(_0x1d79d8,_0x5c7014){_0x1d79d8=_0x1d79d8-0x0;var _0x151e9a=_0x3046[_0x1d79d8];return _0x151e9a;};'use strict';var Sequelize=require(_0x6304('0x0'));module['exports']={'license':{'type':Sequelize[_0x6304('0x1')]},'data1':{'type':Sequelize[_0x6304('0x2')]},'data2':{'type':Sequelize[_0x6304('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x6304('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc5e0=['sequelize','exports','STRING','INTEGER'];(function(_0x561e1c,_0xc9e119){var _0x2acef8=function(_0x3d216b){while(--_0x3d216b){_0x561e1c['push'](_0x561e1c['shift']());}};_0x2acef8(++_0xc9e119);}(_0xc5e0,0x130));var _0x0c5e=function(_0xfd2ca4,_0x1e884d){_0xfd2ca4=_0xfd2ca4-0x0;var _0x5392a1=_0xc5e0[_0xfd2ca4];return _0x5392a1;};'use strict';var Sequelize=require(_0x0c5e('0x0'));module[_0x0c5e('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0x0c5e('0x2')]},'data2':{'type':Sequelize[_0x0c5e('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x0c5e('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 8f8533a..af88e63 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 _0x8d4a=['request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','json','update','then','destroy','name','send','index','model','keys','License','rawAttributes','query','filters','intersection','attributes','fields','length','merge','options','body','find','params','checkLicense','key','catch','downloadLogFile','join','/var','xcally','setHeader','Content-disposition','attachment;\x20filename=','set','Content-Type','text/plain','download','rimraf','zip-dir','fast-json-patch'];(function(_0x59d9b3,_0x10090e){var _0x4a3976=function(_0x4c9915){while(--_0x4c9915){_0x59d9b3['push'](_0x59d9b3['shift']());}};_0x4a3976(++_0x10090e);}(_0x8d4a,0x8b));var _0xa8d4=function(_0x5f45a2,_0x43e759){_0x5f45a2=_0x5f45a2-0x0;var _0x5d56a2=_0x8d4a[_0x5f45a2];return _0x5d56a2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa8d4('0x0'));var zipdir=require(_0xa8d4('0x1'));var jsonpatch=require(_0xa8d4('0x2'));var rp=require(_0xa8d4('0x3'));var moment=require(_0xa8d4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa8d4('0x5'));var util=require(_0xa8d4('0x6'));var path=require(_0xa8d4('0x7'));var sox=require(_0xa8d4('0x8'));var csv=require('to-csv');var ejs=require(_0xa8d4('0x9'));var fs=require('fs');var fs_extra=require(_0xa8d4('0xa'));var _=require(_0xa8d4('0xb'));var squel=require(_0xa8d4('0xc'));var crypto=require(_0xa8d4('0xd'));var jsforce=require(_0xa8d4('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa8d4('0xf'));var querystring=require(_0xa8d4('0x10'));var Papa=require(_0xa8d4('0x11'));var Redis=require('ioredis');var authService=require(_0xa8d4('0x12'));var qs=require(_0xa8d4('0x13'));var as=require(_0xa8d4('0x14'));var hardwareService=require(_0xa8d4('0x15'));var logger=require(_0xa8d4('0x16'))(_0xa8d4('0x17'));var utils=require(_0xa8d4('0x18'));var config=require(_0xa8d4('0x19'));var licenseUtil=require(_0xa8d4('0x1a'));var db=require(_0xa8d4('0x1b'))['db'];function respondWithStatusCode(_0x419548,_0x2b128f){_0x2b128f=_0x2b128f||0xcc;return function(_0xca42ca){if(_0xca42ca){return _0x419548[_0xa8d4('0x1c')](_0x2b128f);}return _0x419548[_0xa8d4('0x1d')](_0x2b128f)[_0xa8d4('0x1e')]();};}function respondWithResult(_0x300f65,_0x30c6b){_0x30c6b=_0x30c6b||0xc8;return function(_0x3cb1a3){if(_0x3cb1a3){return _0x300f65[_0xa8d4('0x1d')](_0x30c6b)['json'](_0x3cb1a3);}};}function respondWithFilteredResult(_0x262300,_0x8d2d13){return function(_0x2a1019){if(_0x2a1019){var _0x31502f=typeof _0x8d2d13['offset']===_0xa8d4('0x1f')&&typeof _0x8d2d13['limit']==='undefined';var _0x32caff=_0x2a1019[_0xa8d4('0x20')];var _0x289262=_0x31502f?0x0:_0x8d2d13['offset'];var _0x3705b9=_0x31502f?_0x2a1019[_0xa8d4('0x20')]:_0x8d2d13[_0xa8d4('0x21')]+_0x8d2d13[_0xa8d4('0x22')];var _0x4d6f95;if(_0x3705b9>=_0x32caff){_0x3705b9=_0x32caff;_0x4d6f95=0xc8;}else{_0x4d6f95=0xce;}_0x262300[_0xa8d4('0x1d')](_0x4d6f95);return _0x262300['set']('Content-Range',_0x289262+'-'+_0x3705b9+'/'+_0x32caff)[_0xa8d4('0x23')](_0x2a1019);}return null;};}function patchUpdates(_0x234a48){return function(_0x1bb7ea){try{jsonpatch['apply'](_0x1bb7ea,_0x234a48,!![]);}catch(_0x4d934d){return BPromise['reject'](_0x4d934d);}return _0x1bb7ea['save']();};}function saveUpdates(_0x30dbf5,_0x21b239){return function(_0xfc92ea){if(_0xfc92ea){return _0xfc92ea[_0xa8d4('0x24')](_0x30dbf5)[_0xa8d4('0x25')](function(_0x1f9a47){return _0x1f9a47;});}return null;};}function removeEntity(_0x37d75c,_0x4f9599){return function(_0x177884){if(_0x177884){return _0x177884[_0xa8d4('0x26')]()[_0xa8d4('0x25')](function(){_0x37d75c[_0xa8d4('0x1d')](0xcc)[_0xa8d4('0x1e')]();});}};}function handleEntityNotFound(_0x519c69,_0x20466c){return function(_0x1c4048){if(!_0x1c4048){_0x519c69[_0xa8d4('0x1c')](0x194);}return _0x1c4048;};}function handleError(_0xfcd096,_0x4d85fa){_0x4d85fa=_0x4d85fa||0x1f4;return function(_0x4ea6fd){logger['error'](_0x4ea6fd['stack']);if(_0x4ea6fd[_0xa8d4('0x27')]){delete _0x4ea6fd[_0xa8d4('0x27')];}_0xfcd096[_0xa8d4('0x1d')](_0x4d85fa)[_0xa8d4('0x28')](_0x4ea6fd);};}var utilLicense=require(_0xa8d4('0x1a'));exports[_0xa8d4('0x29')]=function(_0x2e49bc,_0x368196){var _0x1d5747={'raw':!![],'where':{'id':0x1}},_0x2cab41={};_0x2cab41[_0xa8d4('0x2a')]=_[_0xa8d4('0x2b')](db[_0xa8d4('0x2c')][_0xa8d4('0x2d')]);_0x2cab41[_0xa8d4('0x2e')]=_['keys'](_0x2e49bc[_0xa8d4('0x2e')]);_0x2cab41[_0xa8d4('0x2f')]=_[_0xa8d4('0x30')](_0x2cab41[_0xa8d4('0x2a')],_0x2cab41[_0xa8d4('0x2e')]);_0x1d5747[_0xa8d4('0x31')]=_[_0xa8d4('0x30')](_0x2cab41['model'],qs[_0xa8d4('0x32')](_0x2e49bc['query'][_0xa8d4('0x32')]));_0x1d5747['attributes']=_0x1d5747[_0xa8d4('0x31')][_0xa8d4('0x33')]?_0x1d5747['attributes']:_0x2cab41[_0xa8d4('0x2a')];_0x1d5747=_[_0xa8d4('0x34')]({},_0x1d5747,_0x2e49bc[_0xa8d4('0x35')]);return utilLicense['getLicense'](_0x1d5747)[_0xa8d4('0x25')](respondWithResult(_0x368196,null))['catch'](handleError(_0x368196,null));};exports[_0xa8d4('0x24')]=function(_0x2bb56a,_0x2e4ea6){if(_0x2bb56a['body']['id']){delete _0x2bb56a[_0xa8d4('0x36')]['id'];}return db[_0xa8d4('0x2c')][_0xa8d4('0x37')]({'where':{'id':_0x2bb56a[_0xa8d4('0x38')]['id']}})[_0xa8d4('0x25')](handleEntityNotFound(_0x2e4ea6,null))[_0xa8d4('0x25')](function(_0x719047){var _0x332b4c=_0x719047['get']({'plain':!![]});return utilLicense[_0xa8d4('0x39')](_0x332b4c,_0x2bb56a[_0xa8d4('0x36')][_0xa8d4('0x3a')]);})[_0xa8d4('0x25')](function(_0x2ca0b9){if(!_0x2ca0b9['demo']){return saveUpdates(_0x2bb56a[_0xa8d4('0x36')],null);}return _0x2ca0b9;})[_0xa8d4('0x25')](respondWithResult(_0x2e4ea6,null))[_0xa8d4('0x3b')](handleError(_0x2e4ea6,null));};exports[_0xa8d4('0x3c')]=function(_0x20ebe7,_0x2603ee){var _0x52e4f7='license-info.log';var _0x5a752f=path[_0xa8d4('0x3d')](_0xa8d4('0x3e'),'log',_0xa8d4('0x3f'),_0x52e4f7);_0x2603ee[_0xa8d4('0x40')](_0xa8d4('0x41'),_0xa8d4('0x42')+_0x52e4f7);_0x2603ee[_0xa8d4('0x43')](_0xa8d4('0x44'),_0xa8d4('0x45'));_0x2603ee[_0xa8d4('0x46')](_0x5a752f);}; \ No newline at end of file +var _0x7130=['fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','model','keys','License','rawAttributes','query','filters','intersection','attributes','fields','length','merge','options','getLicense','catch','body','find','get','checkLicense','key','demo','license-info.log','join','/var','log','setHeader','set','Content-Type','text/plain','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x4148e0,_0x1e9ceb){var _0x26af68=function(_0x13586f){while(--_0x13586f){_0x4148e0['push'](_0x4148e0['shift']());}};_0x26af68(++_0x1e9ceb);}(_0x7130,0x14e));var _0x0713=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0x7130[_0x58e469];return _0x4c01c5;};'use strict';var emlformat=require(_0x0713('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0713('0x1'));var jsonpatch=require(_0x0713('0x2'));var rp=require('request-promise');var moment=require(_0x0713('0x3'));var BPromise=require(_0x0713('0x4'));var Mustache=require(_0x0713('0x5'));var util=require(_0x0713('0x6'));var path=require(_0x0713('0x7'));var sox=require(_0x0713('0x8'));var csv=require(_0x0713('0x9'));var ejs=require(_0x0713('0xa'));var fs=require('fs');var fs_extra=require(_0x0713('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0713('0xc'));var jsforce=require(_0x0713('0xd'));var deskjs=require(_0x0713('0xe'));var toCsv=require(_0x0713('0x9'));var querystring=require(_0x0713('0xf'));var Papa=require(_0x0713('0x10'));var Redis=require(_0x0713('0x11'));var authService=require(_0x0713('0x12'));var qs=require(_0x0713('0x13'));var as=require(_0x0713('0x14'));var hardwareService=require(_0x0713('0x15'));var logger=require(_0x0713('0x16'))('api');var utils=require(_0x0713('0x17'));var config=require(_0x0713('0x18'));var licenseUtil=require(_0x0713('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26a907,_0x545bca){_0x545bca=_0x545bca||0xcc;return function(_0x418039){if(_0x418039){return _0x26a907[_0x0713('0x1a')](_0x545bca);}return _0x26a907[_0x0713('0x1b')](_0x545bca)[_0x0713('0x1c')]();};}function respondWithResult(_0x1184a5,_0x402c9c){_0x402c9c=_0x402c9c||0xc8;return function(_0x243539){if(_0x243539){return _0x1184a5[_0x0713('0x1b')](_0x402c9c)[_0x0713('0x1d')](_0x243539);}};}function respondWithFilteredResult(_0x499e29,_0x46c492){return function(_0x13c27a){if(_0x13c27a){var _0x293e66=typeof _0x46c492[_0x0713('0x1e')]===_0x0713('0x1f')&&typeof _0x46c492[_0x0713('0x20')]==='undefined';var _0x22e794=_0x13c27a[_0x0713('0x21')];var _0x2be994=_0x293e66?0x0:_0x46c492[_0x0713('0x1e')];var _0x33dcff=_0x293e66?_0x13c27a['count']:_0x46c492['offset']+_0x46c492['limit'];var _0x122459;if(_0x33dcff>=_0x22e794){_0x33dcff=_0x22e794;_0x122459=0xc8;}else{_0x122459=0xce;}_0x499e29[_0x0713('0x1b')](_0x122459);return _0x499e29['set']('Content-Range',_0x2be994+'-'+_0x33dcff+'/'+_0x22e794)[_0x0713('0x1d')](_0x13c27a);}return null;};}function patchUpdates(_0x597e29){return function(_0x62283f){try{jsonpatch[_0x0713('0x22')](_0x62283f,_0x597e29,!![]);}catch(_0x1795d6){return BPromise[_0x0713('0x23')](_0x1795d6);}return _0x62283f[_0x0713('0x24')]();};}function saveUpdates(_0x2ba5ad,_0x167693){return function(_0x3ec8da){if(_0x3ec8da){return _0x3ec8da[_0x0713('0x25')](_0x2ba5ad)[_0x0713('0x26')](function(_0x4a964d){return _0x4a964d;});}return null;};}function removeEntity(_0x3d2113,_0x1a4ca3){return function(_0x5f2df1){if(_0x5f2df1){return _0x5f2df1[_0x0713('0x27')]()[_0x0713('0x26')](function(){_0x3d2113[_0x0713('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x700649,_0x5668b8){return function(_0x4236b1){if(!_0x4236b1){_0x700649[_0x0713('0x1a')](0x194);}return _0x4236b1;};}function handleError(_0x286edb,_0x8fcce0){_0x8fcce0=_0x8fcce0||0x1f4;return function(_0x479d70){logger[_0x0713('0x28')](_0x479d70['stack']);if(_0x479d70['name']){delete _0x479d70['name'];}_0x286edb[_0x0713('0x1b')](_0x8fcce0)['send'](_0x479d70);};}var utilLicense=require('../../config/license/util');exports['index']=function(_0x135d70,_0x40e51b){var _0x1a6d1b={'raw':!![],'where':{'id':0x1}},_0x1f20c0={};_0x1f20c0[_0x0713('0x29')]=_[_0x0713('0x2a')](db[_0x0713('0x2b')][_0x0713('0x2c')]);_0x1f20c0[_0x0713('0x2d')]=_['keys'](_0x135d70[_0x0713('0x2d')]);_0x1f20c0[_0x0713('0x2e')]=_[_0x0713('0x2f')](_0x1f20c0[_0x0713('0x29')],_0x1f20c0[_0x0713('0x2d')]);_0x1a6d1b[_0x0713('0x30')]=_['intersection'](_0x1f20c0[_0x0713('0x29')],qs[_0x0713('0x31')](_0x135d70[_0x0713('0x2d')][_0x0713('0x31')]));_0x1a6d1b['attributes']=_0x1a6d1b[_0x0713('0x30')][_0x0713('0x32')]?_0x1a6d1b[_0x0713('0x30')]:_0x1f20c0[_0x0713('0x29')];_0x1a6d1b=_[_0x0713('0x33')]({},_0x1a6d1b,_0x135d70[_0x0713('0x34')]);return utilLicense[_0x0713('0x35')](_0x1a6d1b)[_0x0713('0x26')](respondWithResult(_0x40e51b,null))[_0x0713('0x36')](handleError(_0x40e51b,null));};exports[_0x0713('0x25')]=function(_0x592819,_0x494024){if(_0x592819[_0x0713('0x37')]['id']){delete _0x592819[_0x0713('0x37')]['id'];}return db['License'][_0x0713('0x38')]({'where':{'id':_0x592819['params']['id']}})[_0x0713('0x26')](handleEntityNotFound(_0x494024,null))[_0x0713('0x26')](function(_0x38899a){var _0x330a7e=_0x38899a[_0x0713('0x39')]({'plain':!![]});return utilLicense[_0x0713('0x3a')](_0x330a7e,_0x592819[_0x0713('0x37')][_0x0713('0x3b')]);})['then'](function(_0x17235c){if(!_0x17235c[_0x0713('0x3c')]){return saveUpdates(_0x592819[_0x0713('0x37')],null);}return _0x17235c;})[_0x0713('0x26')](respondWithResult(_0x494024,null))[_0x0713('0x36')](handleError(_0x494024,null));};exports['downloadLogFile']=function(_0x3693b8,_0x3a393c){var _0x1fe978=_0x0713('0x3d');var _0x3f9890=path[_0x0713('0x3e')](_0x0713('0x3f'),_0x0713('0x40'),'xcally',_0x1fe978);_0x3a393c[_0x0713('0x41')]('Content-disposition','attachment;\x20filename='+_0x1fe978);_0x3a393c[_0x0713('0x42')](_0x0713('0x43'),_0x0713('0x44'));_0x3a393c['download'](_0x3f9890);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index fd86ebc..7a82aaf 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 _0x137c=['util','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','License','license','lodash'];(function(_0x3b6627,_0x2c8acc){var _0x537e99=function(_0x5ccb2e){while(--_0x5ccb2e){_0x3b6627['push'](_0x3b6627['shift']());}};_0x537e99(++_0x2c8acc);}(_0x137c,0x113));var _0xc137=function(_0x6e1239,_0x3562ac){_0x6e1239=_0x6e1239-0x0;var _0x418150=_0x137c[_0x6e1239];return _0x418150;};'use strict';var _=require(_0xc137('0x0'));var util=require(_0xc137('0x1'));var logger=require('../../config/logger')(_0xc137('0x2'));var moment=require(_0xc137('0x3'));var BPromise=require(_0xc137('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc137('0x5'));var rimraf=require(_0xc137('0x6'));var config=require(_0xc137('0x7'));var attributes=require('./license.attributes');module[_0xc137('0x8')]=function(_0x5ca9de,_0x1e18cf){return _0x5ca9de[_0xc137('0x9')](_0xc137('0xa'),attributes,{'tableName':_0xc137('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7f9d=['rimraf','../../config/environment','./license.attributes','exports','License','license','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x5d61b4,_0x4f7b91){var _0x183fc5=function(_0x5ecf92){while(--_0x5ecf92){_0x5d61b4['push'](_0x5d61b4['shift']());}};_0x183fc5(++_0x4f7b91);}(_0x7f9d,0xf0));var _0xd7f9=function(_0x5fc09f,_0x569248){_0x5fc09f=_0x5fc09f-0x0;var _0x4fe52a=_0x7f9d[_0x5fc09f];return _0x4fe52a;};'use strict';var _=require(_0xd7f9('0x0'));var util=require(_0xd7f9('0x1'));var logger=require(_0xd7f9('0x2'))(_0xd7f9('0x3'));var moment=require('moment');var BPromise=require(_0xd7f9('0x4'));var rp=require(_0xd7f9('0x5'));var fs=require('fs');var path=require(_0xd7f9('0x6'));var rimraf=require(_0xd7f9('0x7'));var config=require(_0xd7f9('0x8'));var attributes=require(_0xd7f9('0x9'));module[_0xd7f9('0xa')]=function(_0x281af6,_0x1559c4){return _0x281af6['define'](_0xd7f9('0xb'),attributes,{'tableName':_0xd7f9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index 1f78f1d..4c5040a 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 _0x74ee=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment','randomstring','ioredis'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0x74ee,0x13c));var _0xe74e=function(_0x5b5189,_0x57912e){_0x5b5189=_0x5b5189-0x0;var _0x3d9d03=_0x74ee[_0x5b5189];return _0x3d9d03;};'use strict';var _=require(_0xe74e('0x0'));var util=require('util');var moment=require(_0xe74e('0x1'));var BPromise=require('bluebird');var rs=require(_0xe74e('0x2'));var fs=require('fs');var Redis=require(_0xe74e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe74e('0x4'));var logger=require(_0xe74e('0x5'))('rpc');var config=require(_0xe74e('0x6'));var jayson=require(_0xe74e('0x7'));var client=jayson['client'][_0xe74e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x55c88a,_0x443778,_0x3f4079){return new BPromise(function(_0x2cf4e8,_0x2e97b3){return client[_0xe74e('0x9')](_0x55c88a,_0x3f4079)[_0xe74e('0xa')](function(_0x19aa6b){logger[_0xe74e('0xb')](_0xe74e('0xc'),_0x443778,_0xe74e('0xd'));logger[_0xe74e('0xe')](_0xe74e('0xf'),_0x443778,_0xe74e('0xd'),JSON['stringify'](_0x19aa6b));if(_0x19aa6b[_0xe74e('0x10')]){if(_0x19aa6b[_0xe74e('0x10')][_0xe74e('0x11')]===0x1f4){logger[_0xe74e('0x10')](_0xe74e('0xc'),_0x443778,_0x19aa6b[_0xe74e('0x10')][_0xe74e('0x12')]);return _0x2e97b3(_0x19aa6b[_0xe74e('0x10')][_0xe74e('0x12')]);}logger[_0xe74e('0x10')]('License,\x20%s,\x20%s',_0x443778,_0x19aa6b[_0xe74e('0x10')]['message']);return _0x2cf4e8(_0x19aa6b[_0xe74e('0x10')][_0xe74e('0x12')]);}else{logger['info']('License,\x20%s,\x20%s',_0x443778,_0xe74e('0xd'));_0x2cf4e8(_0x19aa6b['result'][_0xe74e('0x12')]);}})[_0xe74e('0x13')](function(_0x425b30){logger[_0xe74e('0x10')]('License,\x20%s,\x20%s',_0x443778,_0x425b30);_0x2e97b3(_0x425b30);});});} \ No newline at end of file +var _0x6991=['request','then','info','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http'];(function(_0x2e7cb4,_0x18cde5){var _0x17bda2=function(_0x45c554){while(--_0x45c554){_0x2e7cb4['push'](_0x2e7cb4['shift']());}};_0x17bda2(++_0x18cde5);}(_0x6991,0x1c4));var _0x1699=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0x6991[_0x2f3848];return _0x102668;};'use strict';var _=require(_0x1699('0x0'));var util=require('util');var moment=require(_0x1699('0x1'));var BPromise=require('bluebird');var rs=require(_0x1699('0x2'));var fs=require('fs');var Redis=require(_0x1699('0x3'));var db=require(_0x1699('0x4'))['db'];var utils=require(_0x1699('0x5'));var logger=require(_0x1699('0x6'))(_0x1699('0x7'));var config=require('../../config/environment');var jayson=require(_0x1699('0x8'));var client=jayson['client'][_0x1699('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x44e684,_0x233022,_0x475d86){return new BPromise(function(_0xf347cd,_0x5d654b){return client[_0x1699('0xa')](_0x44e684,_0x475d86)[_0x1699('0xb')](function(_0x32cfee){logger[_0x1699('0xc')](_0x1699('0xd'),_0x233022,'request\x20sent');logger[_0x1699('0xe')](_0x1699('0xf'),_0x233022,_0x1699('0x10'),JSON[_0x1699('0x11')](_0x32cfee));if(_0x32cfee[_0x1699('0x12')]){if(_0x32cfee['error']['code']===0x1f4){logger[_0x1699('0x12')](_0x1699('0xd'),_0x233022,_0x32cfee['error'][_0x1699('0x13')]);return _0x5d654b(_0x32cfee[_0x1699('0x12')][_0x1699('0x13')]);}logger[_0x1699('0x12')](_0x1699('0xd'),_0x233022,_0x32cfee[_0x1699('0x12')]['message']);return _0xf347cd(_0x32cfee[_0x1699('0x12')][_0x1699('0x13')]);}else{logger['info']('License,\x20%s,\x20%s',_0x233022,_0x1699('0x10'));_0xf347cd(_0x32cfee[_0x1699('0x14')][_0x1699('0x13')]);}})[_0x1699('0x15')](function(_0x25aff2){logger[_0x1699('0x12')](_0x1699('0xd'),_0x233022,_0x25aff2);_0x5d654b(_0x25aff2);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index f98b5ff..1f3e933 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 _0x726c=['removeDispositions','delete','removeImap','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getImap','/:id/interactions','getInteractions','getApplications','verifySmtp','/:id/users','getAgents','/:id/dispositions','post','addAnswer','/:id/in_servers','addImap','/:id/out_servers','addInteraction','/:id/applications','/:id/send','send','addAgents','put','update'];(function(_0x29472a,_0x46b6c4){var _0x2d8911=function(_0x11c91a){while(--_0x11c91a){_0x29472a['push'](_0x29472a['shift']());}};_0x2d8911(++_0x46b6c4);}(_0x726c,0xb1));var _0xc726=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x726c[_0x3d42d8];return _0x27fc41;};'use strict';var multer=require('multer');var util=require(_0xc726('0x0'));var path=require(_0xc726('0x1'));var timeout=require(_0xc726('0x2'));var express=require(_0xc726('0x3'));var router=express[_0xc726('0x4')]();var fs_extra=require(_0xc726('0x5'));var auth=require(_0xc726('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc726('0x7'));var controller=require(_0xc726('0x8'));router[_0xc726('0x9')]('/',auth[_0xc726('0xa')](),controller[_0xc726('0xb')]);router[_0xc726('0x9')](_0xc726('0xc'),auth[_0xc726('0xa')](),controller[_0xc726('0xd')]);router['get'](_0xc726('0xe'),auth['isAuthenticated'](),controller[_0xc726('0xf')]);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller[_0xc726('0x10')]);router['get'](_0xc726('0x11'),auth['isAuthenticated'](),controller['getAnswers']);router[_0xc726('0x9')]('/:id/in_servers',auth[_0xc726('0xa')](),controller[_0xc726('0x12')]);router[_0xc726('0x9')]('/:id/out_servers',auth[_0xc726('0xa')](),controller['getSmtp']);router['get'](_0xc726('0x13'),auth[_0xc726('0xa')](),controller[_0xc726('0x14')]);router['get']('/:id/applications',auth[_0xc726('0xa')](),controller[_0xc726('0x15')]);router[_0xc726('0x9')]('/:id/messages',auth[_0xc726('0xa')](),controller['getMessages']);router['get']('/:id/verify',auth[_0xc726('0xa')](),controller[_0xc726('0x16')]);router['get'](_0xc726('0x17'),auth[_0xc726('0xa')](),controller[_0xc726('0x18')]);router['post'](_0xc726('0x19'),auth[_0xc726('0xa')](),controller['addDisposition']);router[_0xc726('0x1a')](_0xc726('0x11'),auth[_0xc726('0xa')](),controller[_0xc726('0x1b')]);router['post']('/',auth[_0xc726('0xa')](),controller['create']);router[_0xc726('0x1a')](_0xc726('0x1c'),auth[_0xc726('0xa')](),controller[_0xc726('0x1d')]);router[_0xc726('0x1a')](_0xc726('0x1e'),auth[_0xc726('0xa')](),controller['addSmtp']);router[_0xc726('0x1a')](_0xc726('0x13'),auth['isAuthenticated'](),controller[_0xc726('0x1f')]);router['post'](_0xc726('0x20'),auth['isAuthenticated'](),controller['addApplications']);router[_0xc726('0x1a')](_0xc726('0x21'),auth[_0xc726('0xa')](),controller[_0xc726('0x22')]);router[_0xc726('0x1a')](_0xc726('0x17'),auth[_0xc726('0xa')](),controller[_0xc726('0x23')]);router[_0xc726('0x24')](_0xc726('0xe'),auth[_0xc726('0xa')](),controller[_0xc726('0x25')]);router['delete'](_0xc726('0x19'),auth['isAuthenticated'](),controller[_0xc726('0x26')]);router['delete'](_0xc726('0x11'),auth[_0xc726('0xa')](),controller['removeAnswers']);router[_0xc726('0x27')]('/:id/in_servers',auth[_0xc726('0xa')](),controller[_0xc726('0x28')]);router[_0xc726('0x27')](_0xc726('0x1e'),auth[_0xc726('0xa')](),controller['removeSmtp']);router[_0xc726('0x27')](_0xc726('0xe'),auth[_0xc726('0xa')](),controller['destroy']);router[_0xc726('0x27')](_0xc726('0x17'),auth[_0xc726('0xa')](),controller[_0xc726('0x29')]);module[_0xc726('0x2a')]=router; \ No newline at end of file +var _0x24ea=['../../config/environment','./mailAccount.controller','isAuthenticated','index','get','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/in_servers','getImap','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','/:id/verify','verifySmtp','/:id/users','post','addDisposition','create','/:id/out_servers','addSmtp','addInteraction','addApplications','/:id/send','send','put','delete','removeAnswers','removeSmtp','removeAgents','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x24ea,0x112));var _0xa24e=function(_0x55448c,_0x174be9){_0x55448c=_0x55448c-0x0;var _0x3b6b3a=_0x24ea[_0x55448c];return _0x3b6b3a;};'use strict';var multer=require(_0xa24e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa24e('0x1'));var express=require(_0xa24e('0x2'));var router=express['Router']();var fs_extra=require(_0xa24e('0x3'));var auth=require(_0xa24e('0x4'));var interaction=require(_0xa24e('0x5'));var config=require(_0xa24e('0x6'));var controller=require(_0xa24e('0x7'));router['get']('/',auth[_0xa24e('0x8')](),controller[_0xa24e('0x9')]);router['get']('/describe',auth[_0xa24e('0x8')](),controller['describe']);router[_0xa24e('0xa')](_0xa24e('0xb'),auth[_0xa24e('0x8')](),controller['show']);router[_0xa24e('0xa')](_0xa24e('0xc'),auth[_0xa24e('0x8')](),controller[_0xa24e('0xd')]);router[_0xa24e('0xa')](_0xa24e('0xe'),auth[_0xa24e('0x8')](),controller['getAnswers']);router[_0xa24e('0xa')](_0xa24e('0xf'),auth[_0xa24e('0x8')](),controller[_0xa24e('0x10')]);router[_0xa24e('0xa')]('/:id/out_servers',auth[_0xa24e('0x8')](),controller[_0xa24e('0x11')]);router[_0xa24e('0xa')](_0xa24e('0x12'),auth[_0xa24e('0x8')](),controller[_0xa24e('0x13')]);router[_0xa24e('0xa')](_0xa24e('0x14'),auth[_0xa24e('0x8')](),controller[_0xa24e('0x15')]);router[_0xa24e('0xa')](_0xa24e('0x16'),auth[_0xa24e('0x8')](),controller['getMessages']);router[_0xa24e('0xa')](_0xa24e('0x17'),auth[_0xa24e('0x8')](),controller[_0xa24e('0x18')]);router[_0xa24e('0xa')](_0xa24e('0x19'),auth[_0xa24e('0x8')](),controller['getAgents']);router[_0xa24e('0x1a')](_0xa24e('0xc'),auth[_0xa24e('0x8')](),controller[_0xa24e('0x1b')]);router[_0xa24e('0x1a')](_0xa24e('0xe'),auth['isAuthenticated'](),controller['addAnswer']);router[_0xa24e('0x1a')]('/',auth[_0xa24e('0x8')](),controller[_0xa24e('0x1c')]);router[_0xa24e('0x1a')](_0xa24e('0xf'),auth[_0xa24e('0x8')](),controller['addImap']);router['post'](_0xa24e('0x1d'),auth['isAuthenticated'](),controller[_0xa24e('0x1e')]);router['post'](_0xa24e('0x12'),auth[_0xa24e('0x8')](),controller[_0xa24e('0x1f')]);router[_0xa24e('0x1a')](_0xa24e('0x14'),auth[_0xa24e('0x8')](),controller[_0xa24e('0x20')]);router[_0xa24e('0x1a')](_0xa24e('0x21'),auth[_0xa24e('0x8')](),controller[_0xa24e('0x22')]);router[_0xa24e('0x1a')](_0xa24e('0x19'),auth[_0xa24e('0x8')](),controller['addAgents']);router[_0xa24e('0x23')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xa24e('0x24')]('/:id/dispositions',auth[_0xa24e('0x8')](),controller['removeDispositions']);router['delete'](_0xa24e('0xe'),auth[_0xa24e('0x8')](),controller[_0xa24e('0x25')]);router[_0xa24e('0x24')](_0xa24e('0xf'),auth[_0xa24e('0x8')](),controller['removeImap']);router[_0xa24e('0x24')](_0xa24e('0x1d'),auth[_0xa24e('0x8')](),controller[_0xa24e('0x26')]);router[_0xa24e('0x24')](_0xa24e('0xb'),auth[_0xa24e('0x8')](),controller['destroy']);router['delete'](_0xa24e('0x19'),auth['isAuthenticated'](),controller[_0xa24e('0x27')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 25a9f62..2f3d9a3 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 _0x4115=['setDataValue','sequelize','exports','STRING','BOOLEAN','TEXT','INTEGER','UNSIGNED','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','gmail','yahoo','outlook365','getDataValue','provider','custom'];(function(_0x1c5417,_0x21b96c){var _0x5b2ec0=function(_0x17bdf2){while(--_0x17bdf2){_0x1c5417['push'](_0x1c5417['shift']());}};_0x5b2ec0(++_0x21b96c);}(_0x4115,0xfd));var _0x5411=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x4115[_0x1deb03];return _0x189fe7;};'use strict';var Sequelize=require(_0x5411('0x0'));module[_0x5411('0x1')]={'description':{'type':Sequelize[_0x5411('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x5411('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x5411('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x5411('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x5411('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x5411('0x4')]},'markAsUnread':{'type':Sequelize[_0x5411('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x5411('0x2')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x5411('0x5')](0x2)[_0x5411('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x5411('0x4')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5411('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5411('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x5411('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5411('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5411('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5411('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5411('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x5411('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x5411('0x3')],'defaultValue':![],'comment':_0x5411('0x8'),'set':function(_0xab2f52){if(!_0xab2f52)this['setDataValue'](_0x5411('0x9'),null);this['setDataValue'](_0x5411('0xa'),_0xab2f52);}},'provider':{'type':Sequelize['ENUM'](_0x5411('0xb'),'hotmail',_0x5411('0xc'),_0x5411('0xd')),'defaultValue':null,'get':function(){var _0x1a7271=this[_0x5411('0xe')](_0x5411('0xf'));return _0x1a7271||_0x5411('0x10');},'set':function(_0xed1515){if(_0xed1515==='custom'){_0xed1515=null;}return this[_0x5411('0x11')](_0x5411('0xf'),_0xed1515);}}}; \ No newline at end of file +var _0xe19e=['STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','gmail','hotmail','yahoo','outlook365','getDataValue','provider','custom','sequelize','exports'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xe19e,0x1a2));var _0xee19=function(_0x366549,_0x40d4ce){_0x366549=_0x366549-0x0;var _0x3a2ac6=_0xe19e[_0x366549];return _0x3a2ac6;};'use strict';var Sequelize=require(_0xee19('0x0'));module[_0xee19('0x1')]={'description':{'type':Sequelize[_0xee19('0x2')]},'name':{'type':Sequelize[_0xee19('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0xee19('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xee19('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xee19('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0xee19('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0xee19('0x4')]},'markAsUnread':{'type':Sequelize[_0xee19('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xee19('0x2')],'allowNull':![],'defaultValue':_0xee19('0x5')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0xee19('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xee19('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xee19('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xee19('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xee19('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xee19('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xee19('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xee19('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0xee19('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xee19('0xa'),'set':function(_0x374fce){if(!_0x374fce)this['setDataValue'](_0xee19('0xb'),null);this[_0xee19('0xc')](_0xee19('0xd'),_0x374fce);}},'provider':{'type':Sequelize['ENUM'](_0xee19('0xe'),_0xee19('0xf'),_0xee19('0x10'),_0xee19('0x11')),'defaultValue':null,'get':function(){var _0x5191ad=this[_0xee19('0x12')](_0xee19('0x13'));return _0x5191ad||_0xee19('0x14');},'set':function(_0x3d92a8){if(_0x3d92a8==='custom'){_0x3d92a8=null;}return this[_0xee19('0xc')](_0xee19('0x13'),_0x3d92a8);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index f5ae4bd..52c544e 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 _0xdaa5=['removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Owner','Tag','Tags','tag','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','MailMessage','$gte','split','inlineCss','true','Contacts','updatedAt','DESC','CloudProvider','from','format','%s\x20<%s>','attachments','basename','getSmtpOptions','SendMail','sendMail','List','List\x20not\x20found','messageId','attach','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','removeAgents','isArray','userMailAccount:remove','getAgents','User','bluebird','util','path','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','defaults','redis','./mailAccount.socket','register','jayson/promise','http','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','json','limit','undefined','count','offset','Content-Range','update','destroy','get','MailAccounts','UserProfileResource','stack','name','send','gmail','imap.gmail.com','yahoo','outlook365','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','user','username','pass','password','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','Smtp','index','MailServerIn','Imap','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','params','length','includeAll','find','body','provider','custom','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','Disposition','findOne','removeDispositions','ids','addAnswer','create','getAnswers','CannedAnswer','removeAnswers','key','email','ListId','isNil','active','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp'];(function(_0x4a1868,_0x4ffa3e){var _0x3c53b7=function(_0x3b1799){while(--_0x3b1799){_0x4a1868['push'](_0x4a1868['shift']());}};_0x3c53b7(++_0x4ffa3e);}(_0xdaa5,0x1b6));var _0x5daa=function(_0x90141a,_0x257662){_0x90141a=_0x90141a-0x0;var _0x1e5b34=_0xdaa5[_0x90141a];return _0x1e5b34;};'use strict';var moment=require('moment');var BPromise=require(_0x5daa('0x0'));var util=require(_0x5daa('0x1'));var path=require(_0x5daa('0x2'));var _=require(_0x5daa('0x3'));var juice=require(_0x5daa('0x4'));var Redis=require(_0x5daa('0x5'));var qs=require(_0x5daa('0x6'));var logger=require(_0x5daa('0x7'))(_0x5daa('0x8'));var config=require('../../config/environment');var db=require(_0x5daa('0x9'))['db'];config['redis']=_[_0x5daa('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5daa('0xb')]));require(_0x5daa('0xc'))[_0x5daa('0xd')](socket);var jayson=require(_0x5daa('0xe'));var client=jayson['client'][_0x5daa('0xf')]({'port':0x232b});function respondWithRpcPromise(_0x2764b3,_0x446a72,_0x5423f1,_0x5a9eb4){return new BPromise(function(_0x1b8c5d,_0x1029d2){var _0x52f7ac=_0x5a9eb4||client;return _0x52f7ac[_0x5daa('0x10')](_0x2764b3,_0x5423f1)[_0x5daa('0x11')](function(_0x369823){logger[_0x5daa('0x12')](_0x5daa('0x13'),_0x446a72,_0x5daa('0x14'));logger[_0x5daa('0x15')](_0x5daa('0x16'),_0x446a72,'request\x20sent',JSON[_0x5daa('0x17')](_0x369823));if(_0x369823['error']){if(_0x369823[_0x5daa('0x18')][_0x5daa('0x19')]===0x1f4){logger[_0x5daa('0x18')](_0x5daa('0x13'),_0x446a72,_0x369823[_0x5daa('0x18')]['message']);return _0x1029d2(_0x369823[_0x5daa('0x18')][_0x5daa('0x1a')]);}logger[_0x5daa('0x18')](_0x5daa('0x13'),_0x446a72,_0x369823[_0x5daa('0x18')][_0x5daa('0x1a')]);return _0x1b8c5d(_0x369823[_0x5daa('0x18')][_0x5daa('0x1a')]);}else{logger[_0x5daa('0x12')](_0x5daa('0x13'),_0x446a72,'request\x20sent');_0x1b8c5d(_0x369823[_0x5daa('0x1b')][_0x5daa('0x1a')]);}})[_0x5daa('0x1c')](function(_0x36fcf5){logger[_0x5daa('0x18')](_0x5daa('0x13'),_0x446a72,_0x36fcf5);_0x1029d2(_0x36fcf5);});});}function respondWithStatusCode(_0x30064f,_0x236767){_0x236767=_0x236767||0xcc;return function(_0x3f2658){if(_0x3f2658){return _0x30064f[_0x5daa('0x1d')](_0x236767);}return _0x30064f[_0x5daa('0x1e')](_0x236767)[_0x5daa('0x1f')]();};}function respondWithResult(_0x3e1ecb,_0x5b0b36){_0x5b0b36=_0x5b0b36||0xc8;return function(_0x2e6dba){if(_0x2e6dba){return _0x3e1ecb[_0x5daa('0x1e')](_0x5b0b36)[_0x5daa('0x20')](_0x2e6dba);}};}function respondWithFilteredResult(_0x5efc78,_0x1afaf7){return function(_0xa9afd1){if(_0xa9afd1){var _0x5cee2c=typeof _0x1afaf7['offset']==='undefined'&&typeof _0x1afaf7[_0x5daa('0x21')]===_0x5daa('0x22');var _0x4178a9=_0xa9afd1[_0x5daa('0x23')];var _0x4d2b83=_0x5cee2c?0x0:_0x1afaf7[_0x5daa('0x24')];var _0x47b705=_0x5cee2c?_0xa9afd1[_0x5daa('0x23')]:_0x1afaf7[_0x5daa('0x24')]+_0x1afaf7[_0x5daa('0x21')];var _0x1e57ef;if(_0x47b705>=_0x4178a9){_0x47b705=_0x4178a9;_0x1e57ef=0xc8;}else{_0x1e57ef=0xce;}_0x5efc78[_0x5daa('0x1e')](_0x1e57ef);return _0x5efc78['set'](_0x5daa('0x25'),_0x4d2b83+'-'+_0x47b705+'/'+_0x4178a9)[_0x5daa('0x20')](_0xa9afd1);}return null;};}function saveUpdates(_0x55e582){return function(_0x36d022){if(_0x36d022){return _0x36d022[_0x5daa('0x26')](_0x55e582)['then'](function(_0x26e1c6){return _0x26e1c6;});}return null;};}function removeEntity(_0x121050){return function(_0x340787){if(_0x340787){return _0x340787[_0x5daa('0x27')]()[_0x5daa('0x11')](function(){var _0x10a98e=_0x340787[_0x5daa('0x28')]({'plain':!![]});var _0x52503d=_0x5daa('0x29');return db[_0x5daa('0x2a')]['destroy']({'where':{'type':_0x52503d,'resourceId':_0x10a98e['id']}})[_0x5daa('0x11')](function(){return _0x340787;});})[_0x5daa('0x11')](function(){_0x121050[_0x5daa('0x1e')](0xcc)[_0x5daa('0x1f')]();});}};}function handleEntityNotFound(_0x324bec){return function(_0x562adc){if(!_0x562adc){_0x324bec[_0x5daa('0x1d')](0x194);}return _0x562adc;};}function handleError(_0x590888,_0x3e9cea){_0x3e9cea=_0x3e9cea||0x1f4;return function(_0x2de0f6){logger[_0x5daa('0x18')](_0x2de0f6[_0x5daa('0x2b')]);if(_0x2de0f6[_0x5daa('0x2c')]){delete _0x2de0f6[_0x5daa('0x2c')];}_0x590888[_0x5daa('0x1e')](_0x3e9cea)[_0x5daa('0x2d')](_0x2de0f6);};}function getImapHost(_0x1d02ca){switch(_0x1d02ca){case _0x5daa('0x2e'):return _0x5daa('0x2f');case _0x5daa('0x30'):return'imap.mail.yahoo.com';case'hotmail':return'imap-mail.outlook.com';case _0x5daa('0x31'):return'outlook.office365.com';}throw new Error(_0x5daa('0x32'),_0x1d02ca);}function getSmtpHost(_0x50db24){switch(_0x50db24){case _0x5daa('0x2e'):return _0x5daa('0x33');case _0x5daa('0x30'):return _0x5daa('0x34');case'hotmail':return _0x5daa('0x35');case _0x5daa('0x31'):return'smtp.office365.com';}throw new Error(_0x5daa('0x32'),_0x50db24);}function getAuthenticationOptions(_0x116bb7,_0x1e6222){var _0x5cdffb={};var _0x1d3c6b={};if(_0x116bb7){_0x5cdffb[_0x5daa('0x36')]=_0x1d3c6b[_0x5daa('0x36')]=_0x1e6222[_0x5daa('0x37')];_0x5cdffb['password']=_0x1d3c6b[_0x5daa('0x38')]=_0x1e6222[_0x5daa('0x39')];if(_0x1e6222[_0x5daa('0x3a')]){_0x5cdffb[_0x5daa('0x3a')]=_0x1d3c6b[_0x5daa('0x3a')]=!![];_0x5cdffb[_0x5daa('0x3b')]=_0x1d3c6b[_0x5daa('0x3b')]=_0x1e6222[_0x5daa('0x3b')];_0x5cdffb[_0x5daa('0x39')]=_0x1d3c6b[_0x5daa('0x38')]=null;}else{_0x5cdffb[_0x5daa('0x3b')]=_0x1d3c6b[_0x5daa('0x3b')]=null;}_0x5cdffb[_0x5daa('0x3c')]=getImapHost(_0x116bb7);_0x5cdffb[_0x5daa('0x3d')]=0x3e1;_0x1d3c6b['host']=getSmtpHost(_0x116bb7);_0x1d3c6b[_0x5daa('0x3d')]=0x24b;_0x1d3c6b[_0x5daa('0x3e')]=![];_0x5cdffb[_0x5daa('0x3f')]=_0x1d3c6b[_0x5daa('0x3f')]=null;}else{if(_0x1e6222[_0x5daa('0x40')]){_0x5cdffb['user']=_0x1d3c6b[_0x5daa('0x36')]=_0x1e6222['username'];_0x5cdffb[_0x5daa('0x39')]=_0x1d3c6b[_0x5daa('0x38')]=_0x1e6222[_0x5daa('0x39')];}else{_0x5cdffb[_0x5daa('0x40')]=_0x1d3c6b[_0x5daa('0x40')]=![];_0x5cdffb['user']=_0x1d3c6b[_0x5daa('0x36')]=null;_0x5cdffb[_0x5daa('0x39')]=_0x1d3c6b['pass']=null;}_0x5cdffb[_0x5daa('0x3c')]=_0x1e6222['Imap'][_0x5daa('0x3c')];_0x5cdffb[_0x5daa('0x3d')]=_0x1e6222['Imap'][_0x5daa('0x3d')];_0x1d3c6b['host']=_0x1e6222[_0x5daa('0x41')]['host'];_0x1d3c6b[_0x5daa('0x3d')]=_0x1e6222[_0x5daa('0x41')][_0x5daa('0x3d')];}return{'Imap':_0x5cdffb,'Smtp':_0x1d3c6b};}exports[_0x5daa('0x42')]=function(_0x56559a,_0x47799d){var _0x4d1f38={'include':[{'model':db[_0x5daa('0x43')],'as':_0x5daa('0x44')},{'model':db[_0x5daa('0x45')],'as':'Smtp'},{'model':db[_0x5daa('0x46')],'as':_0x5daa('0x47')}]},_0x1d0b4b={},_0x503f0a={'count':0x0,'rows':[]};var _0x1c970d=_[_0x5daa('0x48')](db[_0x5daa('0x49')][_0x5daa('0x4a')],function(_0x6a639d){return{'name':_0x6a639d[_0x5daa('0x4b')],'type':_0x6a639d[_0x5daa('0x4c')]['key']};});_0x1d0b4b[_0x5daa('0x4d')]=_[_0x5daa('0x48')](_0x1c970d,_0x5daa('0x2c'));_0x1d0b4b[_0x5daa('0x4e')]=_[_0x5daa('0x4f')](_0x56559a[_0x5daa('0x4e')]);_0x1d0b4b[_0x5daa('0x50')]=_[_0x5daa('0x51')](_0x1d0b4b[_0x5daa('0x4d')],_0x1d0b4b[_0x5daa('0x4e')]);_0x4d1f38[_0x5daa('0x52')]=_[_0x5daa('0x51')](_0x1d0b4b[_0x5daa('0x4d')],qs[_0x5daa('0x53')](_0x56559a[_0x5daa('0x4e')][_0x5daa('0x53')]));_0x4d1f38[_0x5daa('0x52')]=_0x4d1f38[_0x5daa('0x52')]['length']?_0x4d1f38[_0x5daa('0x52')]:_0x1d0b4b[_0x5daa('0x4d')];if(!_0x56559a['query'][_0x5daa('0x54')](_0x5daa('0x55'))){_0x4d1f38['limit']=qs['limit'](_0x56559a['query'][_0x5daa('0x21')]);_0x4d1f38[_0x5daa('0x24')]=qs[_0x5daa('0x24')](_0x56559a[_0x5daa('0x4e')][_0x5daa('0x24')]);}_0x4d1f38[_0x5daa('0x56')]=qs[_0x5daa('0x57')](_0x56559a[_0x5daa('0x4e')][_0x5daa('0x57')]);_0x4d1f38[_0x5daa('0x58')]=qs[_0x5daa('0x50')](_[_0x5daa('0x59')](_0x56559a[_0x5daa('0x4e')],_0x1d0b4b['filters']),_0x1c970d);if(_0x56559a['query'][_0x5daa('0x5a')]){_0x4d1f38[_0x5daa('0x58')]=_[_0x5daa('0x5b')](_0x4d1f38[_0x5daa('0x58')],{'$or':_[_0x5daa('0x48')](_0x1c970d,function(_0x1cf1ff){if(_0x1cf1ff['type']!=='VIRTUAL'){var _0x50a4b1={};_0x50a4b1[_0x1cf1ff[_0x5daa('0x2c')]]={'$like':'%'+_0x56559a[_0x5daa('0x4e')]['filter']+'%'};return _0x50a4b1;}})});}_0x4d1f38=_[_0x5daa('0x5b')]({},_0x4d1f38,_0x56559a[_0x5daa('0x5c')]);var _0x399dc6={'where':_0x4d1f38[_0x5daa('0x58')]};return db[_0x5daa('0x49')][_0x5daa('0x23')](_0x399dc6)[_0x5daa('0x11')](function(_0x5b5d73){_0x503f0a[_0x5daa('0x23')]=_0x5b5d73;if(_0x56559a[_0x5daa('0x4e')]['includeAll']){_0x4d1f38[_0x5daa('0x5d')]=[{'all':!![]}];}return db['MailAccount'][_0x5daa('0x5e')](_0x4d1f38);})['then'](function(_0x4fc38c){_0x503f0a[_0x5daa('0x5f')]=_0x4fc38c;return _0x503f0a;})[_0x5daa('0x11')](respondWithFilteredResult(_0x47799d,_0x4d1f38))[_0x5daa('0x1c')](handleError(_0x47799d,null));};exports['show']=function(_0x52992c,_0xc30b00){var _0x521721={'raw':![],'where':{'id':_0x52992c[_0x5daa('0x60')]['id']},'include':[{'model':db[_0x5daa('0x43')],'as':'Imap'},{'model':db[_0x5daa('0x45')],'as':'Smtp'},{'model':db[_0x5daa('0x46')],'as':_0x5daa('0x47')}]},_0xfd8e30={};_0xfd8e30['model']=_[_0x5daa('0x4f')](db['MailAccount'][_0x5daa('0x4a')]);_0xfd8e30[_0x5daa('0x4e')]=_[_0x5daa('0x4f')](_0x52992c[_0x5daa('0x4e')]);_0xfd8e30[_0x5daa('0x50')]=_[_0x5daa('0x51')](_0xfd8e30['model'],_0xfd8e30[_0x5daa('0x4e')]);_0x521721['attributes']=_[_0x5daa('0x51')](_0xfd8e30[_0x5daa('0x4d')],qs[_0x5daa('0x53')](_0x52992c['query']['fields']));_0x521721[_0x5daa('0x52')]=_0x521721[_0x5daa('0x52')][_0x5daa('0x61')]?_0x521721[_0x5daa('0x52')]:_0xfd8e30['model'];if(_0x52992c[_0x5daa('0x4e')][_0x5daa('0x62')]){_0x521721[_0x5daa('0x5d')]=[{'all':!![]}];}_0x521721=_[_0x5daa('0x5b')]({},_0x521721,_0x52992c['options']);return db['MailAccount'][_0x5daa('0x63')](_0x521721)[_0x5daa('0x11')](handleEntityNotFound(_0xc30b00,null))['then'](respondWithResult(_0xc30b00,null))[_0x5daa('0x1c')](handleError(_0xc30b00,null));};exports[_0x5daa('0x26')]=function(_0x1c2780,_0x1d8abc){if(_0x1c2780[_0x5daa('0x64')]['id']){delete _0x1c2780[_0x5daa('0x64')]['id'];}var _0x185d9b=_0x1c2780[_0x5daa('0x64')][_0x5daa('0x65')]===_0x5daa('0x66')?null:_0x1c2780['body'][_0x5daa('0x65')];var _0x5a4ce3=_0x1c2780[_0x5daa('0x64')][_0x5daa('0x44')]||{};var _0x21e5d5=_0x1c2780['body']['Smtp']||{};if(_0x185d9b){_0x5a4ce3['host']=getImapHost(_0x185d9b);_0x5a4ce3[_0x5daa('0x3d')]=0x3e1;_0x21e5d5['host']=getSmtpHost(_0x185d9b);_0x21e5d5[_0x5daa('0x3d')]=0x24b;_0x21e5d5[_0x5daa('0x3e')]=![];}if(_0x21e5d5[_0x5daa('0x3a')]){_0x21e5d5[_0x5daa('0x3e')]=![];}else{_0x21e5d5[_0x5daa('0x3b')]=null;}if(!_0x5a4ce3[_0x5daa('0x3a')])_0x5a4ce3[_0x5daa('0x3b')]=null;_0x1c2780['body']['Imap']=_0x5a4ce3;_0x1c2780[_0x5daa('0x64')][_0x5daa('0x41')]=_0x21e5d5;return db[_0x5daa('0x49')][_0x5daa('0x63')]({'where':{'id':_0x1c2780['params']['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db[_0x5daa('0x45')],'as':_0x5daa('0x41')},{'model':db[_0x5daa('0x46')],'as':_0x5daa('0x47')}]})[_0x5daa('0x11')](handleEntityNotFound(_0x1d8abc,null))[_0x5daa('0x11')](function(_0xa914fb){if(!_0xa914fb)throw new Error(_0x5daa('0x67'));if(_0xa914fb[_0x5daa('0x3f')])delete _0x1c2780['body'][_0x5daa('0x44')];return _0xa914fb;})[_0x5daa('0x11')](saveUpdates(_0x1c2780[_0x5daa('0x64')],null))[_0x5daa('0x11')](function(_0x1dac3f){if(!_0x1c2780[_0x5daa('0x64')][_0x5daa('0x44')])return _0x1dac3f;return db[_0x5daa('0x43')][_0x5daa('0x26')](_0x1c2780['body'][_0x5daa('0x44')],{'where':{'MailAccountId':_0x1dac3f['id']}})[_0x5daa('0x11')](function(){return _0x1dac3f;});})[_0x5daa('0x11')](function(_0x1b805a){if(!_0x1c2780[_0x5daa('0x64')]['Smtp'])return _0x1b805a;return db['MailServerOut'][_0x5daa('0x26')](_0x1c2780[_0x5daa('0x64')][_0x5daa('0x41')],{'where':{'MailAccountId':_0x1b805a['id']}})[_0x5daa('0x11')](function(){return _0x1b805a;});})['then'](respondWithResult(_0x1d8abc,null))[_0x5daa('0x1c')](handleError(_0x1d8abc,null));};exports[_0x5daa('0x68')]=function(_0x5747fc,_0x4f5654){return db[_0x5daa('0x49')][_0x5daa('0x68')]()['then'](respondWithResult(_0x4f5654,null))['catch'](handleError(_0x4f5654,null));};exports[_0x5daa('0x69')]=function(_0x5583c9,_0x1b0af1){if(_0x5583c9['body']['id']){delete _0x5583c9['body']['id'];}return db[_0x5daa('0x49')][_0x5daa('0x63')]({'where':{'id':_0x5583c9[_0x5daa('0x60')]['id']}})[_0x5daa('0x11')](handleEntityNotFound(_0x1b0af1,null))[_0x5daa('0x11')](function(_0x2c419){if(_0x2c419){_0x5583c9[_0x5daa('0x64')][_0x5daa('0x6a')]=_0x2c419['id'];return db[_0x5daa('0x6b')]['create'](_0x5583c9[_0x5daa('0x64')]);}})[_0x5daa('0x11')](respondWithResult(_0x1b0af1,null))['catch'](handleError(_0x1b0af1,null));};exports['getDispositions']=function(_0x30a840,_0x36739a){var _0x43d3cd={'raw':![],'where':{}};var _0x51c643={};var _0x398142={'count':0x0,'rows':[]};return db['MailAccount'][_0x5daa('0x6c')]({'where':{'id':_0x30a840[_0x5daa('0x60')]['id']}})[_0x5daa('0x11')](handleEntityNotFound(_0x36739a,null))[_0x5daa('0x11')](function(_0x2721f9){if(_0x2721f9){_0x51c643['model']=_[_0x5daa('0x4f')](db[_0x5daa('0x6b')][_0x5daa('0x4a')]);_0x51c643[_0x5daa('0x4e')]=_[_0x5daa('0x4f')](_0x30a840[_0x5daa('0x4e')]);_0x51c643[_0x5daa('0x50')]=_['intersection'](_0x51c643['model'],_0x51c643[_0x5daa('0x4e')]);_0x43d3cd[_0x5daa('0x52')]=_[_0x5daa('0x51')](_0x51c643[_0x5daa('0x4d')],qs['fields'](_0x30a840[_0x5daa('0x4e')]['fields']));_0x43d3cd[_0x5daa('0x52')]=_0x43d3cd[_0x5daa('0x52')]['length']?_0x43d3cd[_0x5daa('0x52')]:_0x51c643[_0x5daa('0x4d')];if(!_0x30a840[_0x5daa('0x4e')]['hasOwnProperty'](_0x5daa('0x55'))){_0x43d3cd[_0x5daa('0x21')]=qs['limit'](_0x30a840[_0x5daa('0x4e')][_0x5daa('0x21')]);_0x43d3cd[_0x5daa('0x24')]=qs[_0x5daa('0x24')](_0x30a840[_0x5daa('0x4e')][_0x5daa('0x24')]);}_0x43d3cd[_0x5daa('0x56')]=qs[_0x5daa('0x57')](_0x30a840[_0x5daa('0x4e')][_0x5daa('0x57')]);_0x43d3cd[_0x5daa('0x58')]=qs['filters'](_[_0x5daa('0x59')](_0x30a840[_0x5daa('0x4e')],_0x51c643['filters']));_0x43d3cd[_0x5daa('0x58')]['MailAccountId']=_0x2721f9['id'];if(_0x30a840[_0x5daa('0x4e')][_0x5daa('0x5a')]){_0x43d3cd[_0x5daa('0x58')]=_['merge'](_0x43d3cd[_0x5daa('0x58')],{'$or':_['map'](_0x43d3cd[_0x5daa('0x52')],function(_0x71a78f){var _0x5aa82d={};_0x5aa82d[_0x71a78f]={'$like':'%'+_0x30a840[_0x5daa('0x4e')]['filter']+'%'};return _0x5aa82d;})});}_0x43d3cd=_[_0x5daa('0x5b')]({},_0x43d3cd,_0x30a840[_0x5daa('0x5c')]);return db[_0x5daa('0x6b')][_0x5daa('0x23')]({'where':_0x43d3cd[_0x5daa('0x58')]})[_0x5daa('0x11')](function(_0xa85431){_0x398142['count']=_0xa85431;if(_0x30a840[_0x5daa('0x4e')][_0x5daa('0x62')]){_0x43d3cd[_0x5daa('0x5d')]=[{'all':!![]}];}return db[_0x5daa('0x6b')][_0x5daa('0x5e')](_0x43d3cd);})[_0x5daa('0x11')](function(_0x592c7a){_0x398142[_0x5daa('0x5f')]=_0x592c7a;return _0x398142;});}})['then'](respondWithFilteredResult(_0x36739a,_0x43d3cd))[_0x5daa('0x1c')](handleError(_0x36739a,null));};exports[_0x5daa('0x6d')]=function(_0x4cc875,_0x2455a6){return db['MailAccount'][_0x5daa('0x63')]({'where':{'id':_0x4cc875[_0x5daa('0x60')]['id']}})[_0x5daa('0x11')](handleEntityNotFound(_0x2455a6,null))[_0x5daa('0x11')](function(_0x1e96b7){if(_0x1e96b7){return _0x1e96b7[_0x5daa('0x6d')](_0x4cc875[_0x5daa('0x4e')][_0x5daa('0x6e')]);}})[_0x5daa('0x11')](respondWithStatusCode(_0x2455a6,null))[_0x5daa('0x1c')](handleError(_0x2455a6,null));};exports[_0x5daa('0x6f')]=function(_0x14367d,_0x509d07){if(_0x14367d[_0x5daa('0x64')]['id']){delete _0x14367d['body']['id'];}return db['MailAccount']['find']({'where':{'id':_0x14367d[_0x5daa('0x60')]['id']}})[_0x5daa('0x11')](handleEntityNotFound(_0x509d07,null))[_0x5daa('0x11')](function(_0x2fcd94){if(_0x2fcd94){_0x14367d[_0x5daa('0x64')]['MailAccountId']=_0x2fcd94['id'];return db['CannedAnswer'][_0x5daa('0x70')](_0x14367d[_0x5daa('0x64')]);}})[_0x5daa('0x11')](respondWithResult(_0x509d07,null))[_0x5daa('0x1c')](handleError(_0x509d07,null));};exports[_0x5daa('0x71')]=function(_0xb32778,_0xa6e504){var _0xf077db={'raw':![],'where':{}};var _0x421dab={};var _0x256de8={'count':0x0,'rows':[]};return db['MailAccount'][_0x5daa('0x6c')]({'where':{'id':_0xb32778['params']['id']}})[_0x5daa('0x11')](handleEntityNotFound(_0xa6e504,null))[_0x5daa('0x11')](function(_0x3c95b2){if(_0x3c95b2){_0x421dab['model']=_[_0x5daa('0x4f')](db[_0x5daa('0x72')]['rawAttributes']);_0x421dab[_0x5daa('0x4e')]=_[_0x5daa('0x4f')](_0xb32778[_0x5daa('0x4e')]);_0x421dab['filters']=_[_0x5daa('0x51')](_0x421dab[_0x5daa('0x4d')],_0x421dab[_0x5daa('0x4e')]);_0xf077db[_0x5daa('0x52')]=_[_0x5daa('0x51')](_0x421dab[_0x5daa('0x4d')],qs[_0x5daa('0x53')](_0xb32778[_0x5daa('0x4e')][_0x5daa('0x53')]));_0xf077db[_0x5daa('0x52')]=_0xf077db[_0x5daa('0x52')][_0x5daa('0x61')]?_0xf077db[_0x5daa('0x52')]:_0x421dab[_0x5daa('0x4d')];if(!_0xb32778[_0x5daa('0x4e')][_0x5daa('0x54')](_0x5daa('0x55'))){_0xf077db['limit']=qs['limit'](_0xb32778[_0x5daa('0x4e')][_0x5daa('0x21')]);_0xf077db[_0x5daa('0x24')]=qs[_0x5daa('0x24')](_0xb32778['query']['offset']);}_0xf077db['order']=qs[_0x5daa('0x57')](_0xb32778[_0x5daa('0x4e')]['sort']);_0xf077db[_0x5daa('0x58')]=qs[_0x5daa('0x50')](_[_0x5daa('0x59')](_0xb32778[_0x5daa('0x4e')],_0x421dab[_0x5daa('0x50')]));_0xf077db[_0x5daa('0x58')][_0x5daa('0x6a')]=_0x3c95b2['id'];if(_0xb32778['query'][_0x5daa('0x5a')]){_0xf077db[_0x5daa('0x58')]=_[_0x5daa('0x5b')](_0xf077db[_0x5daa('0x58')],{'$or':_[_0x5daa('0x48')](_0xf077db[_0x5daa('0x52')],function(_0x39351b){var _0x23c635={};_0x23c635[_0x39351b]={'$like':'%'+_0xb32778[_0x5daa('0x4e')]['filter']+'%'};return _0x23c635;})});}_0xf077db=_['merge']({},_0xf077db,_0xb32778[_0x5daa('0x5c')]);return db[_0x5daa('0x72')][_0x5daa('0x23')]({'where':_0xf077db[_0x5daa('0x58')]})[_0x5daa('0x11')](function(_0x4e8b70){_0x256de8[_0x5daa('0x23')]=_0x4e8b70;if(_0xb32778[_0x5daa('0x4e')][_0x5daa('0x62')]){_0xf077db['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x5daa('0x5e')](_0xf077db);})[_0x5daa('0x11')](function(_0x5c8877){_0x256de8[_0x5daa('0x5f')]=_0x5c8877;return _0x256de8;});}})[_0x5daa('0x11')](respondWithFilteredResult(_0xa6e504,_0xf077db))[_0x5daa('0x1c')](handleError(_0xa6e504,null));};exports[_0x5daa('0x73')]=function(_0xb9b3ca,_0x6e4151){return db['MailAccount']['find']({'where':{'id':_0xb9b3ca[_0x5daa('0x60')]['id']}})[_0x5daa('0x11')](handleEntityNotFound(_0x6e4151,null))[_0x5daa('0x11')](function(_0x11e9a3){if(_0x11e9a3){return _0x11e9a3['removeAnswers'](_0xb9b3ca[_0x5daa('0x4e')][_0x5daa('0x6e')]);}})[_0x5daa('0x11')](respondWithStatusCode(_0x6e4151,null))[_0x5daa('0x1c')](handleError(_0x6e4151,null));};exports[_0x5daa('0x70')]=function(_0x40df28,_0x5284d3){var _0x2b8eb8={'name':_0x40df28[_0x5daa('0x64')][_0x5daa('0x2c')],'key':_0x40df28['body'][_0x5daa('0x74')],'provider':_0x40df28[_0x5daa('0x64')][_0x5daa('0x65')]===_0x5daa('0x66')?null:_0x40df28[_0x5daa('0x64')][_0x5daa('0x65')],'email':_0x40df28[_0x5daa('0x64')][_0x5daa('0x75')],'ListId':_0x40df28[_0x5daa('0x64')][_0x5daa('0x76')],'active':!_[_0x5daa('0x77')](_0x40df28[_0x5daa('0x64')][_0x5daa('0x78')])?_0x40df28[_0x5daa('0x64')]['active']:!![],'description':_0x40df28['body']['description']||null};var _0x2a68ce=getAuthenticationOptions(_0x2b8eb8['provider'],_0x40df28[_0x5daa('0x64')]);_0x2b8eb8['Imap']=_0x2a68ce[_0x5daa('0x44')];_0x2b8eb8[_0x5daa('0x41')]=_0x2a68ce[_0x5daa('0x41')];return db['MailAccount']['create'](_0x2b8eb8,{'include':[{'model':db[_0x5daa('0x45')],'as':_0x5daa('0x41')},{'model':db[_0x5daa('0x43')],'as':_0x5daa('0x44')}]})['then'](function(_0x2597d8){var _0x1928c6=_0x40df28[_0x5daa('0x36')][_0x5daa('0x28')]({'plain':!![]});if(!_0x1928c6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1928c6[_0x5daa('0x79')]===_0x5daa('0x36')){var _0x3eb130=_0x2597d8[_0x5daa('0x28')]({'plain':!![]});return db['UserProfileSection'][_0x5daa('0x63')]({'where':{'name':_0x5daa('0x29'),'userProfileId':_0x1928c6[_0x5daa('0x7a')]},'raw':!![]})[_0x5daa('0x11')](function(_0x5e844c){if(_0x5e844c&&_0x5e844c['autoAssociation']===0x0){return db[_0x5daa('0x2a')][_0x5daa('0x70')]({'name':_0x3eb130['name'],'resourceId':_0x3eb130['id'],'type':_0x5e844c['name'],'sectionId':_0x5e844c['id']},{})[_0x5daa('0x11')](function(){return _0x2597d8;});}else{return _0x2597d8;}})[_0x5daa('0x1c')](function(_0xd7b013){logger[_0x5daa('0x18')](_0x5daa('0x7b'),_0xd7b013);throw _0xd7b013;});}return _0x2597d8;})[_0x5daa('0x11')](respondWithResult(_0x5284d3,0xc9))[_0x5daa('0x1c')](handleError(_0x5284d3,null));};exports[_0x5daa('0x7c')]=function(_0x19306a,_0x1b572d){return db['MailAccount'][_0x5daa('0x6c')]({'where':{'id':_0x19306a[_0x5daa('0x60')]['id']}})[_0x5daa('0x11')](handleEntityNotFound(_0x1b572d,null))[_0x5daa('0x11')](function(_0x1ae64f){if(_0x1ae64f){return _0x1ae64f[_0x5daa('0x7c')]();}return null;})[_0x5daa('0x11')](respondWithResult(_0x1b572d,null))[_0x5daa('0x1c')](handleError(_0x1b572d,null));};exports[_0x5daa('0x7d')]=function(_0x14719b,_0x2b0e51){if(_0x14719b[_0x5daa('0x64')]['id']){delete _0x14719b[_0x5daa('0x64')]['id'];}return db[_0x5daa('0x49')][_0x5daa('0x63')]({'where':{'id':_0x14719b['params']['id']}})[_0x5daa('0x11')](handleEntityNotFound(_0x2b0e51,null))[_0x5daa('0x11')](function(_0x2aa06d){if(_0x2aa06d){_0x14719b[_0x5daa('0x64')]['MailAccountId']=_0x2aa06d['id'];return db[_0x5daa('0x43')][_0x5daa('0x70')](_0x14719b['body']);}})['then'](respondWithResult(_0x2b0e51,null))[_0x5daa('0x1c')](handleError(_0x2b0e51,null));};exports[_0x5daa('0x7e')]=function(_0x1f24ab,_0xec7149){return db[_0x5daa('0x49')][_0x5daa('0x6c')]({'where':{'id':_0x1f24ab[_0x5daa('0x60')]['id']}})[_0x5daa('0x11')](handleEntityNotFound(_0xec7149,null))[_0x5daa('0x11')](function(_0x48f754){if(_0x48f754){return _0x48f754[_0x5daa('0x7f')](null);}return null;})[_0x5daa('0x11')](respondWithStatusCode(_0xec7149,null))['catch'](handleError(_0xec7149,null));};exports[_0x5daa('0x80')]=function(_0x562f74,_0x408515){return db['MailAccount'][_0x5daa('0x6c')]({'where':{'id':_0x562f74[_0x5daa('0x60')]['id']}})[_0x5daa('0x11')](handleEntityNotFound(_0x408515,null))[_0x5daa('0x11')](function(_0x47777d){if(_0x47777d){return _0x47777d[_0x5daa('0x80')]();}return null;})[_0x5daa('0x11')](respondWithResult(_0x408515,null))['catch'](handleError(_0x408515,null));};exports['addSmtp']=function(_0x49a786,_0x16374b){if(_0x49a786[_0x5daa('0x64')]['id']){delete _0x49a786[_0x5daa('0x64')]['id'];}return db[_0x5daa('0x49')][_0x5daa('0x63')]({'where':{'id':_0x49a786[_0x5daa('0x60')]['id']}})[_0x5daa('0x11')](handleEntityNotFound(_0x16374b,null))[_0x5daa('0x11')](function(_0x41e60d){if(_0x41e60d){_0x49a786['body'][_0x5daa('0x6a')]=_0x41e60d['id'];return db['MailServerOut'][_0x5daa('0x70')](_0x49a786['body']);}})[_0x5daa('0x11')](respondWithResult(_0x16374b,null))[_0x5daa('0x1c')](handleError(_0x16374b,null));};exports[_0x5daa('0x81')]=function(_0x393d52,_0x362e8b){return db['MailAccount'][_0x5daa('0x6c')]({'where':{'id':_0x393d52[_0x5daa('0x60')]['id']}})[_0x5daa('0x11')](handleEntityNotFound(_0x362e8b,null))[_0x5daa('0x11')](function(_0x1b6b3f){if(_0x1b6b3f){return _0x1b6b3f[_0x5daa('0x82')](null);}return null;})[_0x5daa('0x11')](respondWithStatusCode(_0x362e8b,null))['catch'](handleError(_0x362e8b,null));};exports[_0x5daa('0x83')]=function(_0x569c43,_0x14823e){return db[_0x5daa('0x84')][_0x5daa('0x63')]({'where':{'id':_0x569c43[_0x5daa('0x60')]['id']}})[_0x5daa('0x11')](handleEntityNotFound(_0x14823e,null))['then'](function(_0x9be4c4){if(_0x9be4c4){return _0x9be4c4[_0x5daa('0x83')](_0x569c43[_0x5daa('0x64')][_0x5daa('0x6e')],_[_0x5daa('0x85')](_0x569c43[_0x5daa('0x64')],[_0x5daa('0x6e'),'id'])||{});}})[_0x5daa('0x11')](respondWithResult(_0x14823e,null))[_0x5daa('0x1c')](handleError(_0x14823e,null));};exports[_0x5daa('0x86')]=function(_0x3e11d5,_0x1b92ce){var _0x420ae2={'raw':![],'where':{}};var _0x2359bb={};var _0x35b5f4={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x3e11d5['params']['id']}})[_0x5daa('0x11')](handleEntityNotFound(_0x1b92ce,null))['then'](function(_0x20d02b){if(_0x20d02b){_0x2359bb['model']=_[_0x5daa('0x4f')](db[_0x5daa('0x84')][_0x5daa('0x4a')]);_0x2359bb['query']=_[_0x5daa('0x4f')](_0x3e11d5[_0x5daa('0x4e')]);_0x2359bb[_0x5daa('0x50')]=_[_0x5daa('0x51')](_0x2359bb[_0x5daa('0x4d')],_0x2359bb[_0x5daa('0x4e')]);_0x420ae2['attributes']=_['intersection'](_0x2359bb[_0x5daa('0x4d')],qs[_0x5daa('0x53')](_0x3e11d5[_0x5daa('0x4e')][_0x5daa('0x53')]));_0x420ae2['attributes']=_0x420ae2[_0x5daa('0x52')][_0x5daa('0x61')]?_0x420ae2['attributes']:_0x2359bb[_0x5daa('0x4d')];if(!_0x3e11d5[_0x5daa('0x4e')][_0x5daa('0x54')]('nolimit')){_0x420ae2['limit']=qs[_0x5daa('0x21')](_0x3e11d5[_0x5daa('0x4e')][_0x5daa('0x21')]);_0x420ae2[_0x5daa('0x24')]=qs['offset'](_0x3e11d5[_0x5daa('0x4e')][_0x5daa('0x24')]);}_0x420ae2[_0x5daa('0x56')]=qs[_0x5daa('0x57')](_0x3e11d5[_0x5daa('0x4e')]['sort']);_0x420ae2[_0x5daa('0x58')]=qs['filters'](_[_0x5daa('0x59')](_0x3e11d5[_0x5daa('0x4e')],_0x2359bb[_0x5daa('0x50')]));_0x420ae2['where']['MailAccountId']=_0x20d02b['id'];if(_0x3e11d5[_0x5daa('0x4e')][_0x5daa('0x5a')]){_0x420ae2[_0x5daa('0x58')]=_[_0x5daa('0x5b')](_0x420ae2[_0x5daa('0x58')],{'$or':_[_0x5daa('0x48')](_0x420ae2['attributes'],function(_0x5bf1b5){var _0x2e7226={};_0x2e7226[_0x5bf1b5]={'$like':'%'+_0x3e11d5[_0x5daa('0x4e')][_0x5daa('0x5a')]+'%'};return _0x2e7226;})});}_0x420ae2=_[_0x5daa('0x5b')]({},_0x420ae2,_0x3e11d5[_0x5daa('0x5c')]);return db[_0x5daa('0x84')]['count']({'where':_0x420ae2[_0x5daa('0x58')]})['then'](function(_0x3f91eb){_0x35b5f4[_0x5daa('0x23')]=_0x3f91eb;if(_0x3e11d5['query'][_0x5daa('0x62')]){_0x420ae2['include']=[{'model':db[_0x5daa('0x87')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x5daa('0x88'),'attributes':[_0x5daa('0x2c'),'fullname','internal'],'required':![]},{'model':db[_0x5daa('0x89')],'as':_0x5daa('0x8a'),'attributes':['id',_0x5daa('0x2c'),'color'],'where':_0x3e11d5[_0x5daa('0x4e')][_0x5daa('0x8b')]?{'id':_0x3e11d5[_0x5daa('0x4e')][_0x5daa('0x8b')]}:undefined,'required':_0x3e11d5[_0x5daa('0x4e')]['tag']?!![]:![]}];}return db[_0x5daa('0x84')]['findAll'](_0x420ae2);})[_0x5daa('0x11')](function(_0x4c17bf){_0x35b5f4[_0x5daa('0x5f')]=_0x4c17bf;return _0x35b5f4;});}})[_0x5daa('0x11')](respondWithFilteredResult(_0x1b92ce,_0x420ae2))['catch'](handleError(_0x1b92ce,null));};exports[_0x5daa('0x8c')]=function addApplications(_0x45b572,_0x19e273){var _0x24a993=_0x45b572[_0x5daa('0x60')]['id'];var _0x4adff9=_0x45b572[_0x5daa('0x64')];var _0x11cbf9=0xc8;var _0x4bbb36=null;return db[_0x5daa('0x8d')][_0x5daa('0x8e')]({'isolationLevel':db[_0x5daa('0x8d')]['Transaction'][_0x5daa('0x8f')][_0x5daa('0x90')]},function(_0x59fd7a){return db[_0x5daa('0x49')][_0x5daa('0x6c')]({'where':{'id':_0x24a993},'transaction':_0x59fd7a})[_0x5daa('0x11')](function(_0x5788bf){if(_0x5788bf){return db[_0x5daa('0x91')][_0x5daa('0x27')]({'where':{'MailAccountId':_0x24a993},'transaction':_0x59fd7a})[_0x5daa('0x11')](function(){var _0x17d9d2=_[_0x5daa('0x48')](_0x4adff9,function(_0xe83e5b){_0xe83e5b[_0x5daa('0x6a')]=_0x24a993;return _0xe83e5b;});return db[_0x5daa('0x91')][_0x5daa('0x92')](_0x17d9d2,{'transaction':_0x59fd7a});});}else{_0x11cbf9=0x194;_0x4bbb36=[];}});})[_0x5daa('0x11')](function(){if(_0x11cbf9!==0x194){return db[_0x5daa('0x91')][_0x5daa('0x93')]({'where':{'MailAccountId':_0x24a993},'order':_0x5daa('0x94')})[_0x5daa('0x11')](function(_0x5eefcb){_0x4bbb36=_0x5eefcb;});}})[_0x5daa('0x1c')](function(_0x3aedc4){_0x11cbf9=0x1f4;logger[_0x5daa('0x18')](_0x3aedc4[_0x5daa('0x2b')]);if(_0x3aedc4['name']){delete _0x3aedc4[_0x5daa('0x2c')];}_0x4bbb36=_0x3aedc4;})[_0x5daa('0x95')](function(){if(_0x4bbb36===null){_0x19e273[_0x5daa('0x1d')](_0x11cbf9);}else{if(_0x11cbf9===0x1f4){_0x19e273[_0x5daa('0x1e')](_0x11cbf9)[_0x5daa('0x2d')](_0x4bbb36);}else{_0x19e273[_0x5daa('0x1e')](_0x11cbf9)[_0x5daa('0x20')](_0x4bbb36);}}});};exports[_0x5daa('0x96')]=function(_0x5a45b2,_0x2613e3){var _0x3fc73d={};var _0x124497={};var _0x253a7c;var _0x427271;return db[_0x5daa('0x49')][_0x5daa('0x6c')]({'where':{'id':_0x5a45b2[_0x5daa('0x60')]['id']}})['then'](handleEntityNotFound(_0x2613e3,null))['then'](function(_0x54be3a){if(_0x54be3a){_0x253a7c=_0x54be3a;_0x124497[_0x5daa('0x4d')]=_['keys'](db[_0x5daa('0x91')]['rawAttributes']);_0x124497[_0x5daa('0x4e')]=_[_0x5daa('0x4f')](_0x5a45b2['query']);_0x124497[_0x5daa('0x50')]=_[_0x5daa('0x51')](_0x124497[_0x5daa('0x4d')],_0x124497[_0x5daa('0x4e')]);_0x3fc73d[_0x5daa('0x52')]=_['intersection'](_0x124497[_0x5daa('0x4d')],qs[_0x5daa('0x53')](_0x5a45b2[_0x5daa('0x4e')][_0x5daa('0x53')]));_0x3fc73d[_0x5daa('0x52')]=_0x3fc73d[_0x5daa('0x52')][_0x5daa('0x61')]?_0x3fc73d[_0x5daa('0x52')]:_0x124497[_0x5daa('0x4d')];_0x3fc73d['order']=qs['sort'](_0x5a45b2[_0x5daa('0x4e')]['sort']);_0x3fc73d[_0x5daa('0x58')]=qs['filters'](_[_0x5daa('0x59')](_0x5a45b2[_0x5daa('0x4e')],_0x124497['filters']));if(_0x5a45b2[_0x5daa('0x4e')][_0x5daa('0x5a')]){_0x3fc73d['where']=_[_0x5daa('0x5b')](_0x3fc73d[_0x5daa('0x58')],{'$or':_['map'](_0x3fc73d['attributes'],function(_0x2b9660){var _0x335a85={};_0x335a85[_0x2b9660]={'$like':'%'+_0x5a45b2['query'][_0x5daa('0x5a')]+'%'};return _0x335a85;})});}_0x3fc73d=_[_0x5daa('0x5b')]({},_0x3fc73d,_0x5a45b2[_0x5daa('0x5c')]);return _0x253a7c[_0x5daa('0x96')](_0x3fc73d);}})[_0x5daa('0x11')](function(_0x3b4e08){if(_0x3b4e08){_0x427271=_0x3b4e08[_0x5daa('0x61')];if(!_0x5a45b2[_0x5daa('0x4e')][_0x5daa('0x54')](_0x5daa('0x55'))){_0x3fc73d[_0x5daa('0x21')]=qs['limit'](_0x5a45b2[_0x5daa('0x4e')][_0x5daa('0x21')]);_0x3fc73d[_0x5daa('0x24')]=qs['offset'](_0x5a45b2[_0x5daa('0x4e')][_0x5daa('0x24')]);}return _0x253a7c[_0x5daa('0x96')](_0x3fc73d);}})[_0x5daa('0x11')](function(_0x1b9b76){if(_0x1b9b76){return _0x1b9b76?{'count':_0x427271,'rows':_0x1b9b76}:null;}})[_0x5daa('0x11')](respondWithResult(_0x2613e3,null))['catch'](handleError(_0x2613e3,null));};exports['getMessages']=function(_0x184bb9,_0x58df2a){var _0x378b9f={'raw':!![],'where':{}};var _0x3dd012={};var _0xf1e56c={'count':0x0,'rows':[]};return db[_0x5daa('0x49')]['findOne']({'where':{'id':_0x184bb9[_0x5daa('0x60')]['id']}})['then'](handleEntityNotFound(_0x58df2a,null))['then'](function(_0x24bfcd){if(_0x24bfcd){_0x3dd012['model']=_['keys'](db[_0x5daa('0x97')]['rawAttributes']);_0x3dd012[_0x5daa('0x4e')]=_[_0x5daa('0x4f')](_0x184bb9[_0x5daa('0x4e')]);_0x3dd012[_0x5daa('0x50')]=_[_0x5daa('0x51')](_0x3dd012[_0x5daa('0x4d')],_0x3dd012[_0x5daa('0x4e')]);_0x378b9f['attributes']=_[_0x5daa('0x51')](_0x3dd012[_0x5daa('0x4d')],qs[_0x5daa('0x53')](_0x184bb9[_0x5daa('0x4e')][_0x5daa('0x53')]));_0x378b9f[_0x5daa('0x52')]=_0x378b9f['attributes'][_0x5daa('0x61')]?_0x378b9f[_0x5daa('0x52')]:_0x3dd012[_0x5daa('0x4d')];if(!_0x184bb9[_0x5daa('0x4e')]['hasOwnProperty'](_0x5daa('0x55'))){_0x378b9f[_0x5daa('0x21')]=qs[_0x5daa('0x21')](_0x184bb9[_0x5daa('0x4e')]['limit']);_0x378b9f[_0x5daa('0x24')]=qs[_0x5daa('0x24')](_0x184bb9['query'][_0x5daa('0x24')]);}_0x378b9f[_0x5daa('0x56')]=qs['sort'](_0x184bb9['query'][_0x5daa('0x57')]);_0x378b9f[_0x5daa('0x58')]=qs[_0x5daa('0x50')](_[_0x5daa('0x59')](_0x184bb9['query'],_0x3dd012[_0x5daa('0x50')]));_0x378b9f['where'][_0x5daa('0x6a')]=_0x24bfcd['id'];if(_0x184bb9['query'][_0x5daa('0x5a')]){_0x378b9f[_0x5daa('0x58')]=_[_0x5daa('0x5b')](_0x378b9f[_0x5daa('0x58')],{'$or':_[_0x5daa('0x48')](_0x378b9f[_0x5daa('0x52')],function(_0xab79d8){var _0x2320ea={};_0x2320ea[_0xab79d8]={'$like':'%'+_0x184bb9[_0x5daa('0x4e')][_0x5daa('0x5a')]+'%'};return _0x2320ea;})});}if(_0x184bb9['query'][_0x5daa('0x98')]){var _0x209949=_0x184bb9[_0x5daa('0x4e')][_0x5daa('0x98')][_0x5daa('0x99')](',');var _0x355c52={};_0x355c52[_0x209949[0x0]]={'$gte':moment(_0x209949[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x378b9f[_0x5daa('0x58')]=_[_0x5daa('0x5b')](_0x378b9f[_0x5daa('0x58')],_0x355c52);}_0x378b9f=_[_0x5daa('0x5b')]({},_0x378b9f,_0x184bb9[_0x5daa('0x5c')]);return db[_0x5daa('0x97')][_0x5daa('0x23')]({'where':_0x378b9f[_0x5daa('0x58')]})['then'](function(_0x34ad0e){_0xf1e56c[_0x5daa('0x23')]=_0x34ad0e;if(_0x184bb9[_0x5daa('0x4e')][_0x5daa('0x62')]){_0x378b9f[_0x5daa('0x5d')]=[{'all':!![]}];}return db['MailMessage'][_0x5daa('0x5e')](_0x378b9f);})['then'](function(_0x12da1e){if(_0x184bb9[_0x5daa('0x4e')][_0x5daa('0x9a')]===_0x5daa('0x9b')){for(var _0x124356=0x0;_0x124356<_0x12da1e['length'];_0x124356++){_0x12da1e[_0x124356][_0x5daa('0x64')]=juice(_0x12da1e[_0x124356][_0x5daa('0x64')]);}}_0xf1e56c[_0x5daa('0x5f')]=_0x12da1e;return _0xf1e56c;});}})['then'](respondWithFilteredResult(_0x58df2a,_0x378b9f))[_0x5daa('0x1c')](handleError(_0x58df2a,null));};exports['send']=function(_0x5026c6,_0x14fa1b){var _0x5e6505,_0x1548f2={},_0x50ba55;if(_0x5026c6[_0x5daa('0x64')]['to']){_0x50ba55=_0x5026c6[_0x5daa('0x64')]['to']['split'](',')[0x0];}return db[_0x5daa('0x49')][_0x5daa('0x63')]({'where':{'id':_0x5026c6[_0x5daa('0x60')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x5daa('0x87')],'as':_0x5daa('0x9c'),'where':{'email':_0x50ba55},'limit':0x1,'order':[[_0x5daa('0x9d'),_0x5daa('0x9e')]]}]},{'model':db['MailServerOut'],'as':_0x5daa('0x41'),'raw':!![],'include':[{'model':db[_0x5daa('0x9f')],'as':_0x5daa('0x9f'),'raw':!![]}]}]})[_0x5daa('0x11')](handleEntityNotFound(_0x14fa1b,null))[_0x5daa('0x11')](function(_0xd2f91f){if(!_0xd2f91f)return;_0x5e6505=_0xd2f91f;if(!_0xd2f91f[_0x5daa('0x41')])throw new Error('Smtp\x20configuration\x20not\x20found');if(_[_0x5daa('0x77')](_0x5026c6[_0x5daa('0x64')][_0x5daa('0xa0')])){_0x5026c6[_0x5daa('0x64')]['from']=util[_0x5daa('0xa1')](_0x5daa('0xa2'),_0xd2f91f['name'],_0xd2f91f[_0x5daa('0x75')]||_0xd2f91f[_0x5daa('0x41')][_0x5daa('0x36')]);}if(_0x5026c6[_0x5daa('0x64')][_0x5daa('0xa3')]&&_0x5026c6[_0x5daa('0x64')][_0x5daa('0xa3')][_0x5daa('0x61')]){for(var _0x169fbf=0x0;_0x169fbf<_0x5026c6[_0x5daa('0x64')][_0x5daa('0xa3')][_0x5daa('0x61')];_0x169fbf+=0x1){_0x5026c6[_0x5daa('0x64')]['attachments'][_0x169fbf]={'filename':_0x5026c6[_0x5daa('0x64')][_0x5daa('0xa3')][_0x169fbf]['name'],'path':path['join'](config['root'],'server/files/attachments',_0x5026c6[_0x5daa('0x64')][_0x5daa('0xa3')][_0x169fbf][_0x5daa('0xa4')])};}}var _0x3f58e7=_0xd2f91f[_0x5daa('0xa5')]();return respondWithRpcPromise(_0x5daa('0xa6'),_0x5daa('0xa7'),{'account':_0x3f58e7,'message':_0x5026c6[_0x5daa('0x64')]});})[_0x5daa('0x11')](function(_0x3d2623){if(!_0x3d2623)return;_0x1548f2=_0x3d2623;if(!_0x5e6505[_0x5daa('0xa8')])throw new Error(_0x5daa('0xa9'));if(_0x5e6505[_0x5daa('0xa8')][_0x5daa('0x9c')]['length'])return _0x5e6505[_0x5daa('0xa8')]['Contacts'][0x0];return db[_0x5daa('0x87')][_0x5daa('0x70')](_[_0x5daa('0xa')](_0x5026c6[_0x5daa('0x64')],{'firstName':_0x5026c6['body']['to'],'email':_0x5026c6[_0x5daa('0x64')]['to'],'phone':_0x5026c6['body']['to'],'ListId':_0x5e6505[_0x5daa('0x76')]}));})[_0x5daa('0x11')](function(_0x5ed143){if(!_0x5ed143)return;var _0x461c1a={'UserId':_0x5026c6['user']['id'],'ContactId':_0x5ed143['id'],'MailAccountId':_0x5e6505['id'],'inReplyTo':_0x1548f2[_0x5daa('0xaa')],'to':_0x5026c6['body']['from'],'cc':_0x5026c6[_0x5daa('0x64')]['cc'],'subject':_0x5026c6[_0x5daa('0x64')]['subject'],'attach':_0x5026c6[_0x5daa('0x64')][_0x5daa('0xab')],'firstMsgDirection':_0x5daa('0xac'),'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x5daa('0xac'),'Messages':[_[_0x5daa('0x5b')](_0x5026c6[_0x5daa('0x64')],{'messageId':_0x1548f2['messageId'],'sentAt':moment()['format'](_0x5daa('0xad')),'read':!![],'MailAccountId':_0x5e6505['id'],'UserId':_0x5026c6[_0x5daa('0x36')]['id'],'ContactId':_0x5ed143['id']})]};if(_0x5026c6[_0x5daa('0x64')]['Interaction']){_0x461c1a=_[_0x5daa('0x5b')](_0x461c1a,_0x5026c6[_0x5daa('0x64')][_0x5daa('0xae')]);}return db['MailInteraction'][_0x5daa('0x70')](_0x461c1a,{'include':[{'model':db[_0x5daa('0x97')],'as':_0x5daa('0xaf')}]});})['then'](respondWithResult(_0x14fa1b,null))[_0x5daa('0x1c')](handleError(_0x14fa1b,null));};exports[_0x5daa('0xb0')]=function(_0x8d2eb7,_0x2295e0){return db[_0x5daa('0x49')][_0x5daa('0x63')]({'where':{'id':_0x8d2eb7[_0x5daa('0x60')]['id']},'include':[{'model':db['MailServerOut'],'as':_0x5daa('0x41'),'raw':!![],'include':[{'model':db[_0x5daa('0x9f')],'as':_0x5daa('0x9f'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x2295e0,null))['then'](function(_0x4d1ed7){if(!_0x4d1ed7[_0x5daa('0x41')])return;var _0x46e41b=_0x4d1ed7[_0x5daa('0xa5')]();return respondWithRpcPromise(_0x5daa('0xb1'),_0x5daa('0xb0'),{'account':_0x46e41b});})['then'](respondWithResult(_0x2295e0,null))[_0x5daa('0x1c')](handleError(_0x2295e0,null));};exports[_0x5daa('0x27')]=function(_0x1f5c56,_0x47f52d){return db[_0x5daa('0x49')][_0x5daa('0x63')]({'where':{'id':_0x1f5c56[_0x5daa('0x60')]['id']}})[_0x5daa('0x11')](handleEntityNotFound(_0x47f52d,null))[_0x5daa('0x11')](function(_0x18b93a){if(_0x18b93a&&_0x18b93a[_0x5daa('0x3f')]){throw new db[(_0x5daa('0xb2'))][(_0x5daa('0xb3'))](_0x5daa('0xb4'));}return _0x18b93a;})[_0x5daa('0x11')](removeEntity(_0x47f52d,null))['catch'](handleError(_0x47f52d,null));};exports[_0x5daa('0xb5')]=function(_0x1f01ac,_0x48f96b){return db[_0x5daa('0x49')][_0x5daa('0x63')]({'where':{'id':_0x1f01ac[_0x5daa('0x60')]['id']}})[_0x5daa('0x11')](handleEntityNotFound(_0x48f96b,null))[_0x5daa('0x11')](function(_0x56cbdc){if(_0x56cbdc){return _0x56cbdc[_0x5daa('0xb5')](_0x1f01ac['body'][_0x5daa('0x6e')],_[_0x5daa('0x85')](_0x1f01ac['body'],['ids','id'])||{})[_0x5daa('0xb6')](function(_0x197b1a){for(var _0x4334af=0x0;_0x4334af<_0x1f01ac[_0x5daa('0x64')][_0x5daa('0x6e')]['length'];_0x4334af+=0x1){socket[_0x5daa('0xb7')]('userMailAccount:save',{'UserId':Number(_0x1f01ac[_0x5daa('0x64')]['ids'][_0x4334af]),'MailAccountId':Number(_0x1f01ac['params']['id'])});}return _0x197b1a;});}})[_0x5daa('0x11')](respondWithResult(_0x48f96b,null))['catch'](handleError(_0x48f96b,null));};exports['removeAgents']=function(_0x40878e,_0x3655b1){return db[_0x5daa('0x49')][_0x5daa('0x63')]({'where':{'id':_0x40878e['params']['id']}})[_0x5daa('0x11')](handleEntityNotFound(_0x3655b1,null))[_0x5daa('0x11')](function(_0x4f45aa){if(_0x4f45aa){return _0x4f45aa[_0x5daa('0xb8')](_0x40878e[_0x5daa('0x4e')]['ids'])[_0x5daa('0x11')](function(){if(_[_0x5daa('0xb9')](_0x40878e[_0x5daa('0x4e')][_0x5daa('0x6e')])){for(var _0x25c65c=0x0;_0x25c65c<_0x40878e[_0x5daa('0x4e')][_0x5daa('0x6e')][_0x5daa('0x61')];_0x25c65c+=0x1){socket['emit']('userMailAccount:remove',{'UserId':Number(_0x40878e[_0x5daa('0x4e')][_0x5daa('0x6e')][_0x25c65c]),'MailAccountId':Number(_0x40878e['params']['id'])});}}else{socket[_0x5daa('0xb7')](_0x5daa('0xba'),{'UserId':Number(_0x40878e['query'][_0x5daa('0x6e')]),'MailAccountId':Number(_0x40878e[_0x5daa('0x60')]['id'])});}});}})['then'](respondWithStatusCode(_0x3655b1,null))[_0x5daa('0x1c')](handleError(_0x3655b1,null));};exports[_0x5daa('0xbb')]=function(_0x14824c,_0x57c3ac){var _0x11e2bf={};var _0x585898={};var _0x3d47df;var _0x348718;return db[_0x5daa('0x49')][_0x5daa('0x6c')]({'where':{'id':_0x14824c[_0x5daa('0x60')]['id']}})[_0x5daa('0x11')](handleEntityNotFound(_0x57c3ac,null))[_0x5daa('0x11')](function(_0x4e4ebf){if(_0x4e4ebf){_0x3d47df=_0x4e4ebf;_0x585898[_0x5daa('0x4d')]=_[_0x5daa('0x4f')](db[_0x5daa('0xbc')][_0x5daa('0x4a')]);_0x585898[_0x5daa('0x4e')]=_[_0x5daa('0x4f')](_0x14824c[_0x5daa('0x4e')]);_0x585898[_0x5daa('0x50')]=_[_0x5daa('0x51')](_0x585898[_0x5daa('0x4d')],_0x585898[_0x5daa('0x4e')]);_0x11e2bf[_0x5daa('0x52')]=_[_0x5daa('0x51')](_0x585898['model'],qs[_0x5daa('0x53')](_0x14824c['query'][_0x5daa('0x53')]));_0x11e2bf[_0x5daa('0x52')]=_0x11e2bf['attributes'][_0x5daa('0x61')]?_0x11e2bf['attributes']:_0x585898[_0x5daa('0x4d')];_0x11e2bf[_0x5daa('0x56')]=qs[_0x5daa('0x57')](_0x14824c[_0x5daa('0x4e')]['sort']);_0x11e2bf['where']=qs[_0x5daa('0x50')](_[_0x5daa('0x59')](_0x14824c[_0x5daa('0x4e')],_0x585898[_0x5daa('0x50')]));if(_0x14824c[_0x5daa('0x4e')][_0x5daa('0x5a')]){_0x11e2bf['where']=_[_0x5daa('0x5b')](_0x11e2bf['where'],{'$or':_[_0x5daa('0x48')](_0x11e2bf['attributes'],function(_0x36263c){var _0x3bd4cd={};_0x3bd4cd[_0x36263c]={'$like':'%'+_0x14824c[_0x5daa('0x4e')][_0x5daa('0x5a')]+'%'};return _0x3bd4cd;})});}_0x11e2bf=_['merge']({},_0x11e2bf,_0x14824c[_0x5daa('0x5c')]);return _0x3d47df[_0x5daa('0xbb')](_0x11e2bf);}})['then'](function(_0x7e4a06){if(_0x7e4a06){_0x348718=_0x7e4a06[_0x5daa('0x61')];if(!_0x14824c[_0x5daa('0x4e')][_0x5daa('0x54')]('nolimit')){_0x11e2bf[_0x5daa('0x21')]=qs[_0x5daa('0x21')](_0x14824c['query']['limit']);_0x11e2bf['offset']=qs[_0x5daa('0x24')](_0x14824c[_0x5daa('0x4e')][_0x5daa('0x24')]);}return _0x3d47df['getAgents'](_0x11e2bf);}})[_0x5daa('0x11')](function(_0x2738b8){if(_0x2738b8){return _0x2738b8?{'count':_0x348718,'rows':_0x2738b8}:null;}})['then'](respondWithResult(_0x57c3ac,null))[_0x5daa('0x1c')](handleError(_0x57c3ac,null));}; \ No newline at end of file +var _0x9de3=['offset','limit','undefined','count','set','update','destroy','get','MailAccounts','UserProfileResource','stack','name','send','gmail','imap.gmail.com','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.mail.yahoo.com','smtp-mail.outlook.com','smtp.office365.com','user','username','pass','modernAuthentication','CloudProviderId','password','host','port','service','authentication','Imap','Smtp','index','MailServerIn','MailServerOut','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','findAll','rows','catch','show','params','Pause','includeAll','include','options','find','body','provider','secure','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','Disposition','create','findOne','nolimit','order','pick','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','custom','email','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','addInteraction','MailInteraction','getInteractions','User','Owner','Tag','Tags','color','tag','addApplications','sequelize','Transaction','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','getMessages','$gte','MailMessage','inlineCss','true','split','List','CmContact','updatedAt','DESC','CloudProvider','from','format','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','getSmtpOptions','SendMail','sendMail','Contacts','subject','attach','YYYY-MM-DD\x20HH:mm:ss','Interaction','Messages','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','getAgents','moment','bluebird','util','path','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','sendStatus','status','end','json'];(function(_0x736a1e,_0x5f228a){var _0x370bd8=function(_0xea2f56){while(--_0xea2f56){_0x736a1e['push'](_0x736a1e['shift']());}};_0x370bd8(++_0x5f228a);}(_0x9de3,0x164));var _0x39de=function(_0x56de9f,_0x2ce281){_0x56de9f=_0x56de9f-0x0;var _0x92d09e=_0x9de3[_0x56de9f];return _0x92d09e;};'use strict';var moment=require(_0x39de('0x0'));var BPromise=require(_0x39de('0x1'));var util=require(_0x39de('0x2'));var path=require(_0x39de('0x3'));var _=require(_0x39de('0x4'));var juice=require(_0x39de('0x5'));var Redis=require(_0x39de('0x6'));var qs=require(_0x39de('0x7'));var logger=require(_0x39de('0x8'))(_0x39de('0x9'));var config=require('../../config/environment');var db=require(_0x39de('0xa'))['db'];config[_0x39de('0xb')]=_[_0x39de('0xc')](config[_0x39de('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x39de('0xd'))(new Redis(config[_0x39de('0xb')]));require('./mailAccount.socket')[_0x39de('0xe')](socket);var jayson=require(_0x39de('0xf'));var client=jayson[_0x39de('0x10')][_0x39de('0x11')]({'port':0x232b});function respondWithRpcPromise(_0x2dc074,_0x4d4cf6,_0x2301a2,_0xadc187){return new BPromise(function(_0x2abe29,_0x51ec73){var _0x5f4a80=_0xadc187||client;return _0x5f4a80[_0x39de('0x12')](_0x2dc074,_0x2301a2)[_0x39de('0x13')](function(_0x2b53ff){logger[_0x39de('0x14')](_0x39de('0x15'),_0x4d4cf6,_0x39de('0x16'));logger[_0x39de('0x17')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x4d4cf6,_0x39de('0x16'),JSON[_0x39de('0x18')](_0x2b53ff));if(_0x2b53ff['error']){if(_0x2b53ff[_0x39de('0x19')][_0x39de('0x1a')]===0x1f4){logger[_0x39de('0x19')](_0x39de('0x15'),_0x4d4cf6,_0x2b53ff[_0x39de('0x19')][_0x39de('0x1b')]);return _0x51ec73(_0x2b53ff[_0x39de('0x19')][_0x39de('0x1b')]);}logger[_0x39de('0x19')](_0x39de('0x15'),_0x4d4cf6,_0x2b53ff[_0x39de('0x19')][_0x39de('0x1b')]);return _0x2abe29(_0x2b53ff[_0x39de('0x19')][_0x39de('0x1b')]);}else{logger[_0x39de('0x14')](_0x39de('0x15'),_0x4d4cf6,_0x39de('0x16'));_0x2abe29(_0x2b53ff['result'][_0x39de('0x1b')]);}})['catch'](function(_0x44094c){logger[_0x39de('0x19')](_0x39de('0x15'),_0x4d4cf6,_0x44094c);_0x51ec73(_0x44094c);});});}function respondWithStatusCode(_0x4b4601,_0x1d9751){_0x1d9751=_0x1d9751||0xcc;return function(_0x3f4869){if(_0x3f4869){return _0x4b4601[_0x39de('0x1c')](_0x1d9751);}return _0x4b4601[_0x39de('0x1d')](_0x1d9751)[_0x39de('0x1e')]();};}function respondWithResult(_0x343a53,_0x6d0f2f){_0x6d0f2f=_0x6d0f2f||0xc8;return function(_0x1136fa){if(_0x1136fa){return _0x343a53['status'](_0x6d0f2f)[_0x39de('0x1f')](_0x1136fa);}};}function respondWithFilteredResult(_0x5108c6,_0x4a387d){return function(_0x3f0840){if(_0x3f0840){var _0x569768=typeof _0x4a387d[_0x39de('0x20')]==='undefined'&&typeof _0x4a387d[_0x39de('0x21')]===_0x39de('0x22');var _0x3d6d88=_0x3f0840[_0x39de('0x23')];var _0x477b5c=_0x569768?0x0:_0x4a387d[_0x39de('0x20')];var _0x10ae1d=_0x569768?_0x3f0840[_0x39de('0x23')]:_0x4a387d['offset']+_0x4a387d['limit'];var _0x31c8f9;if(_0x10ae1d>=_0x3d6d88){_0x10ae1d=_0x3d6d88;_0x31c8f9=0xc8;}else{_0x31c8f9=0xce;}_0x5108c6[_0x39de('0x1d')](_0x31c8f9);return _0x5108c6[_0x39de('0x24')]('Content-Range',_0x477b5c+'-'+_0x10ae1d+'/'+_0x3d6d88)[_0x39de('0x1f')](_0x3f0840);}return null;};}function saveUpdates(_0xb3fc5b){return function(_0x3036aa){if(_0x3036aa){return _0x3036aa[_0x39de('0x25')](_0xb3fc5b)[_0x39de('0x13')](function(_0x3319fb){return _0x3319fb;});}return null;};}function removeEntity(_0x264164){return function(_0x226d9f){if(_0x226d9f){return _0x226d9f[_0x39de('0x26')]()[_0x39de('0x13')](function(){var _0x46c012=_0x226d9f[_0x39de('0x27')]({'plain':!![]});var _0x7cf5f9=_0x39de('0x28');return db[_0x39de('0x29')]['destroy']({'where':{'type':_0x7cf5f9,'resourceId':_0x46c012['id']}})[_0x39de('0x13')](function(){return _0x226d9f;});})['then'](function(){_0x264164[_0x39de('0x1d')](0xcc)[_0x39de('0x1e')]();});}};}function handleEntityNotFound(_0x5e2819){return function(_0x40d898){if(!_0x40d898){_0x5e2819[_0x39de('0x1c')](0x194);}return _0x40d898;};}function handleError(_0x39874b,_0x21702e){_0x21702e=_0x21702e||0x1f4;return function(_0x5539a1){logger[_0x39de('0x19')](_0x5539a1[_0x39de('0x2a')]);if(_0x5539a1[_0x39de('0x2b')]){delete _0x5539a1[_0x39de('0x2b')];}_0x39874b['status'](_0x21702e)[_0x39de('0x2c')](_0x5539a1);};}function getImapHost(_0x580a51){switch(_0x580a51){case _0x39de('0x2d'):return _0x39de('0x2e');case'yahoo':return _0x39de('0x2f');case _0x39de('0x30'):return _0x39de('0x31');case _0x39de('0x32'):return _0x39de('0x33');}throw new Error(_0x39de('0x34'),_0x580a51);}function getSmtpHost(_0x118875){switch(_0x118875){case _0x39de('0x2d'):return'smtp.gmail.com';case'yahoo':return _0x39de('0x35');case'hotmail':return _0x39de('0x36');case _0x39de('0x32'):return _0x39de('0x37');}throw new Error(_0x39de('0x34'),_0x118875);}function getAuthenticationOptions(_0x51260c,_0x19855d){var _0x2a1963={};var _0x682803={};if(_0x51260c){_0x2a1963[_0x39de('0x38')]=_0x682803['user']=_0x19855d[_0x39de('0x39')];_0x2a1963['password']=_0x682803[_0x39de('0x3a')]=_0x19855d['password'];if(_0x19855d['modernAuthentication']){_0x2a1963[_0x39de('0x3b')]=_0x682803[_0x39de('0x3b')]=!![];_0x2a1963[_0x39de('0x3c')]=_0x682803[_0x39de('0x3c')]=_0x19855d[_0x39de('0x3c')];_0x2a1963[_0x39de('0x3d')]=_0x682803[_0x39de('0x3a')]=null;}else{_0x2a1963[_0x39de('0x3c')]=_0x682803[_0x39de('0x3c')]=null;}_0x2a1963[_0x39de('0x3e')]=getImapHost(_0x51260c);_0x2a1963[_0x39de('0x3f')]=0x3e1;_0x682803[_0x39de('0x3e')]=getSmtpHost(_0x51260c);_0x682803[_0x39de('0x3f')]=0x24b;_0x682803['secure']=![];_0x2a1963[_0x39de('0x40')]=_0x682803[_0x39de('0x40')]=null;}else{if(_0x19855d[_0x39de('0x41')]){_0x2a1963[_0x39de('0x38')]=_0x682803[_0x39de('0x38')]=_0x19855d['username'];_0x2a1963[_0x39de('0x3d')]=_0x682803[_0x39de('0x3a')]=_0x19855d[_0x39de('0x3d')];}else{_0x2a1963[_0x39de('0x41')]=_0x682803[_0x39de('0x41')]=![];_0x2a1963[_0x39de('0x38')]=_0x682803[_0x39de('0x38')]=null;_0x2a1963[_0x39de('0x3d')]=_0x682803[_0x39de('0x3a')]=null;}_0x2a1963['host']=_0x19855d[_0x39de('0x42')][_0x39de('0x3e')];_0x2a1963[_0x39de('0x3f')]=_0x19855d[_0x39de('0x42')][_0x39de('0x3f')];_0x682803[_0x39de('0x3e')]=_0x19855d[_0x39de('0x43')][_0x39de('0x3e')];_0x682803[_0x39de('0x3f')]=_0x19855d['Smtp']['port'];}return{'Imap':_0x2a1963,'Smtp':_0x682803};}exports[_0x39de('0x44')]=function(_0x3a2d0a,_0xb3aa0){var _0x11b6fc={'include':[{'model':db[_0x39de('0x45')],'as':_0x39de('0x42')},{'model':db[_0x39de('0x46')],'as':_0x39de('0x43')},{'model':db['Pause'],'as':_0x39de('0x47')}]},_0x497260={},_0x1974e8={'count':0x0,'rows':[]};var _0x493034=_[_0x39de('0x48')](db[_0x39de('0x49')][_0x39de('0x4a')],function(_0x45adc9){return{'name':_0x45adc9[_0x39de('0x4b')],'type':_0x45adc9[_0x39de('0x4c')][_0x39de('0x4d')]};});_0x497260[_0x39de('0x4e')]=_[_0x39de('0x48')](_0x493034,_0x39de('0x2b'));_0x497260['query']=_[_0x39de('0x4f')](_0x3a2d0a[_0x39de('0x50')]);_0x497260[_0x39de('0x51')]=_[_0x39de('0x52')](_0x497260[_0x39de('0x4e')],_0x497260[_0x39de('0x50')]);_0x11b6fc['attributes']=_[_0x39de('0x52')](_0x497260[_0x39de('0x4e')],qs[_0x39de('0x53')](_0x3a2d0a[_0x39de('0x50')][_0x39de('0x53')]));_0x11b6fc['attributes']=_0x11b6fc[_0x39de('0x54')][_0x39de('0x55')]?_0x11b6fc[_0x39de('0x54')]:_0x497260[_0x39de('0x4e')];if(!_0x3a2d0a['query'][_0x39de('0x56')]('nolimit')){_0x11b6fc['limit']=qs['limit'](_0x3a2d0a[_0x39de('0x50')]['limit']);_0x11b6fc[_0x39de('0x20')]=qs[_0x39de('0x20')](_0x3a2d0a['query'][_0x39de('0x20')]);}_0x11b6fc['order']=qs['sort'](_0x3a2d0a[_0x39de('0x50')][_0x39de('0x57')]);_0x11b6fc[_0x39de('0x58')]=qs[_0x39de('0x51')](_['pick'](_0x3a2d0a[_0x39de('0x50')],_0x497260[_0x39de('0x51')]),_0x493034);if(_0x3a2d0a['query'][_0x39de('0x59')]){_0x11b6fc[_0x39de('0x58')]=_[_0x39de('0x5a')](_0x11b6fc[_0x39de('0x58')],{'$or':_[_0x39de('0x48')](_0x493034,function(_0x15af71){if(_0x15af71[_0x39de('0x4c')]!==_0x39de('0x5b')){var _0x5aa79c={};_0x5aa79c[_0x15af71['name']]={'$like':'%'+_0x3a2d0a[_0x39de('0x50')]['filter']+'%'};return _0x5aa79c;}})});}_0x11b6fc=_[_0x39de('0x5a')]({},_0x11b6fc,_0x3a2d0a['options']);var _0x2cf23f={'where':_0x11b6fc[_0x39de('0x58')]};return db[_0x39de('0x49')][_0x39de('0x23')](_0x2cf23f)['then'](function(_0x533167){_0x1974e8['count']=_0x533167;if(_0x3a2d0a['query']['includeAll']){_0x11b6fc['include']=[{'all':!![]}];}return db[_0x39de('0x49')][_0x39de('0x5c')](_0x11b6fc);})[_0x39de('0x13')](function(_0x2619b9){_0x1974e8[_0x39de('0x5d')]=_0x2619b9;return _0x1974e8;})['then'](respondWithFilteredResult(_0xb3aa0,_0x11b6fc))[_0x39de('0x5e')](handleError(_0xb3aa0,null));};exports[_0x39de('0x5f')]=function(_0x4f1c99,_0x94459f){var _0x477a68={'raw':![],'where':{'id':_0x4f1c99[_0x39de('0x60')]['id']},'include':[{'model':db[_0x39de('0x45')],'as':'Imap'},{'model':db[_0x39de('0x46')],'as':_0x39de('0x43')},{'model':db[_0x39de('0x61')],'as':_0x39de('0x47')}]},_0x3624f6={};_0x3624f6[_0x39de('0x4e')]=_[_0x39de('0x4f')](db[_0x39de('0x49')]['rawAttributes']);_0x3624f6[_0x39de('0x50')]=_['keys'](_0x4f1c99[_0x39de('0x50')]);_0x3624f6['filters']=_[_0x39de('0x52')](_0x3624f6['model'],_0x3624f6[_0x39de('0x50')]);_0x477a68['attributes']=_[_0x39de('0x52')](_0x3624f6['model'],qs[_0x39de('0x53')](_0x4f1c99[_0x39de('0x50')][_0x39de('0x53')]));_0x477a68[_0x39de('0x54')]=_0x477a68['attributes']['length']?_0x477a68[_0x39de('0x54')]:_0x3624f6[_0x39de('0x4e')];if(_0x4f1c99[_0x39de('0x50')][_0x39de('0x62')]){_0x477a68[_0x39de('0x63')]=[{'all':!![]}];}_0x477a68=_[_0x39de('0x5a')]({},_0x477a68,_0x4f1c99[_0x39de('0x64')]);return db[_0x39de('0x49')][_0x39de('0x65')](_0x477a68)[_0x39de('0x13')](handleEntityNotFound(_0x94459f,null))['then'](respondWithResult(_0x94459f,null))[_0x39de('0x5e')](handleError(_0x94459f,null));};exports[_0x39de('0x25')]=function(_0x5f3ef4,_0x4086c7){if(_0x5f3ef4[_0x39de('0x66')]['id']){delete _0x5f3ef4[_0x39de('0x66')]['id'];}var _0x1f2f90=_0x5f3ef4['body'][_0x39de('0x67')]==='custom'?null:_0x5f3ef4['body']['provider'];var _0x5862bb=_0x5f3ef4[_0x39de('0x66')][_0x39de('0x42')]||{};var _0x4947e6=_0x5f3ef4['body'][_0x39de('0x43')]||{};if(_0x1f2f90){_0x5862bb[_0x39de('0x3e')]=getImapHost(_0x1f2f90);_0x5862bb[_0x39de('0x3f')]=0x3e1;_0x4947e6[_0x39de('0x3e')]=getSmtpHost(_0x1f2f90);_0x4947e6[_0x39de('0x3f')]=0x24b;_0x4947e6[_0x39de('0x68')]=![];}if(_0x4947e6[_0x39de('0x3b')]){_0x4947e6[_0x39de('0x68')]=![];}else{_0x4947e6['CloudProviderId']=null;}if(!_0x5862bb[_0x39de('0x3b')])_0x5862bb[_0x39de('0x3c')]=null;_0x5f3ef4['body'][_0x39de('0x42')]=_0x5862bb;_0x5f3ef4[_0x39de('0x66')]['Smtp']=_0x4947e6;return db[_0x39de('0x49')]['find']({'where':{'id':_0x5f3ef4[_0x39de('0x60')]['id']},'include':[{'model':db[_0x39de('0x45')],'as':_0x39de('0x42')},{'model':db[_0x39de('0x46')],'as':'Smtp'},{'model':db[_0x39de('0x61')],'as':_0x39de('0x47')}]})[_0x39de('0x13')](handleEntityNotFound(_0x4086c7,null))[_0x39de('0x13')](function(_0x47d425){if(!_0x47d425)throw new Error(_0x39de('0x69'));if(_0x47d425['service'])delete _0x5f3ef4[_0x39de('0x66')][_0x39de('0x42')];return _0x47d425;})[_0x39de('0x13')](saveUpdates(_0x5f3ef4[_0x39de('0x66')],null))[_0x39de('0x13')](function(_0xef5707){if(!_0x5f3ef4[_0x39de('0x66')][_0x39de('0x42')])return _0xef5707;return db[_0x39de('0x45')][_0x39de('0x25')](_0x5f3ef4[_0x39de('0x66')][_0x39de('0x42')],{'where':{'MailAccountId':_0xef5707['id']}})[_0x39de('0x13')](function(){return _0xef5707;});})['then'](function(_0x112350){if(!_0x5f3ef4[_0x39de('0x66')][_0x39de('0x43')])return _0x112350;return db['MailServerOut'][_0x39de('0x25')](_0x5f3ef4[_0x39de('0x66')][_0x39de('0x43')],{'where':{'MailAccountId':_0x112350['id']}})[_0x39de('0x13')](function(){return _0x112350;});})['then'](respondWithResult(_0x4086c7,null))['catch'](handleError(_0x4086c7,null));};exports[_0x39de('0x6a')]=function(_0x3345c0,_0x61e40d){return db[_0x39de('0x49')][_0x39de('0x6a')]()[_0x39de('0x13')](respondWithResult(_0x61e40d,null))['catch'](handleError(_0x61e40d,null));};exports[_0x39de('0x6b')]=function(_0x5af419,_0x59456b){if(_0x5af419[_0x39de('0x66')]['id']){delete _0x5af419[_0x39de('0x66')]['id'];}return db[_0x39de('0x49')][_0x39de('0x65')]({'where':{'id':_0x5af419[_0x39de('0x60')]['id']}})[_0x39de('0x13')](handleEntityNotFound(_0x59456b,null))[_0x39de('0x13')](function(_0x3f4079){if(_0x3f4079){_0x5af419[_0x39de('0x66')][_0x39de('0x6c')]=_0x3f4079['id'];return db[_0x39de('0x6d')][_0x39de('0x6e')](_0x5af419[_0x39de('0x66')]);}})[_0x39de('0x13')](respondWithResult(_0x59456b,null))[_0x39de('0x5e')](handleError(_0x59456b,null));};exports['getDispositions']=function(_0xe97584,_0x281205){var _0x3bb4f7={'raw':![],'where':{}};var _0x3ad279={};var _0x42bd18={'count':0x0,'rows':[]};return db[_0x39de('0x49')][_0x39de('0x6f')]({'where':{'id':_0xe97584[_0x39de('0x60')]['id']}})[_0x39de('0x13')](handleEntityNotFound(_0x281205,null))[_0x39de('0x13')](function(_0x5383c7){if(_0x5383c7){_0x3ad279[_0x39de('0x4e')]=_[_0x39de('0x4f')](db['Disposition']['rawAttributes']);_0x3ad279[_0x39de('0x50')]=_['keys'](_0xe97584[_0x39de('0x50')]);_0x3ad279[_0x39de('0x51')]=_[_0x39de('0x52')](_0x3ad279[_0x39de('0x4e')],_0x3ad279[_0x39de('0x50')]);_0x3bb4f7[_0x39de('0x54')]=_[_0x39de('0x52')](_0x3ad279[_0x39de('0x4e')],qs[_0x39de('0x53')](_0xe97584['query'][_0x39de('0x53')]));_0x3bb4f7[_0x39de('0x54')]=_0x3bb4f7[_0x39de('0x54')][_0x39de('0x55')]?_0x3bb4f7[_0x39de('0x54')]:_0x3ad279[_0x39de('0x4e')];if(!_0xe97584[_0x39de('0x50')][_0x39de('0x56')](_0x39de('0x70'))){_0x3bb4f7[_0x39de('0x21')]=qs[_0x39de('0x21')](_0xe97584[_0x39de('0x50')][_0x39de('0x21')]);_0x3bb4f7[_0x39de('0x20')]=qs[_0x39de('0x20')](_0xe97584[_0x39de('0x50')][_0x39de('0x20')]);}_0x3bb4f7[_0x39de('0x71')]=qs[_0x39de('0x57')](_0xe97584[_0x39de('0x50')]['sort']);_0x3bb4f7[_0x39de('0x58')]=qs[_0x39de('0x51')](_[_0x39de('0x72')](_0xe97584[_0x39de('0x50')],_0x3ad279[_0x39de('0x51')]));_0x3bb4f7[_0x39de('0x58')][_0x39de('0x6c')]=_0x5383c7['id'];if(_0xe97584[_0x39de('0x50')][_0x39de('0x59')]){_0x3bb4f7[_0x39de('0x58')]=_[_0x39de('0x5a')](_0x3bb4f7[_0x39de('0x58')],{'$or':_[_0x39de('0x48')](_0x3bb4f7[_0x39de('0x54')],function(_0x475700){var _0x43ec25={};_0x43ec25[_0x475700]={'$like':'%'+_0xe97584[_0x39de('0x50')]['filter']+'%'};return _0x43ec25;})});}_0x3bb4f7=_[_0x39de('0x5a')]({},_0x3bb4f7,_0xe97584[_0x39de('0x64')]);return db['Disposition'][_0x39de('0x23')]({'where':_0x3bb4f7[_0x39de('0x58')]})['then'](function(_0x2892e8){_0x42bd18[_0x39de('0x23')]=_0x2892e8;if(_0xe97584[_0x39de('0x50')][_0x39de('0x62')]){_0x3bb4f7[_0x39de('0x63')]=[{'all':!![]}];}return db[_0x39de('0x6d')][_0x39de('0x5c')](_0x3bb4f7);})['then'](function(_0x5e6d17){_0x42bd18[_0x39de('0x5d')]=_0x5e6d17;return _0x42bd18;});}})[_0x39de('0x13')](respondWithFilteredResult(_0x281205,_0x3bb4f7))['catch'](handleError(_0x281205,null));};exports[_0x39de('0x73')]=function(_0x4b4803,_0x4e261c){return db['MailAccount'][_0x39de('0x65')]({'where':{'id':_0x4b4803[_0x39de('0x60')]['id']}})['then'](handleEntityNotFound(_0x4e261c,null))['then'](function(_0x41d558){if(_0x41d558){return _0x41d558[_0x39de('0x73')](_0x4b4803[_0x39de('0x50')][_0x39de('0x74')]);}})[_0x39de('0x13')](respondWithStatusCode(_0x4e261c,null))[_0x39de('0x5e')](handleError(_0x4e261c,null));};exports[_0x39de('0x75')]=function(_0x579264,_0xb0c406){if(_0x579264[_0x39de('0x66')]['id']){delete _0x579264[_0x39de('0x66')]['id'];}return db['MailAccount'][_0x39de('0x65')]({'where':{'id':_0x579264['params']['id']}})['then'](handleEntityNotFound(_0xb0c406,null))[_0x39de('0x13')](function(_0x7ff4ab){if(_0x7ff4ab){_0x579264[_0x39de('0x66')][_0x39de('0x6c')]=_0x7ff4ab['id'];return db['CannedAnswer']['create'](_0x579264[_0x39de('0x66')]);}})[_0x39de('0x13')](respondWithResult(_0xb0c406,null))['catch'](handleError(_0xb0c406,null));};exports[_0x39de('0x76')]=function(_0x2b78a7,_0x3dff71){var _0x517818={'raw':![],'where':{}};var _0x215b51={};var _0x3e30b0={'count':0x0,'rows':[]};return db['MailAccount'][_0x39de('0x6f')]({'where':{'id':_0x2b78a7[_0x39de('0x60')]['id']}})['then'](handleEntityNotFound(_0x3dff71,null))['then'](function(_0x1d5501){if(_0x1d5501){_0x215b51['model']=_[_0x39de('0x4f')](db['CannedAnswer'][_0x39de('0x4a')]);_0x215b51[_0x39de('0x50')]=_[_0x39de('0x4f')](_0x2b78a7[_0x39de('0x50')]);_0x215b51['filters']=_[_0x39de('0x52')](_0x215b51[_0x39de('0x4e')],_0x215b51[_0x39de('0x50')]);_0x517818[_0x39de('0x54')]=_['intersection'](_0x215b51['model'],qs['fields'](_0x2b78a7['query'][_0x39de('0x53')]));_0x517818['attributes']=_0x517818['attributes'][_0x39de('0x55')]?_0x517818['attributes']:_0x215b51[_0x39de('0x4e')];if(!_0x2b78a7[_0x39de('0x50')][_0x39de('0x56')](_0x39de('0x70'))){_0x517818[_0x39de('0x21')]=qs['limit'](_0x2b78a7[_0x39de('0x50')][_0x39de('0x21')]);_0x517818[_0x39de('0x20')]=qs['offset'](_0x2b78a7[_0x39de('0x50')][_0x39de('0x20')]);}_0x517818[_0x39de('0x71')]=qs['sort'](_0x2b78a7[_0x39de('0x50')][_0x39de('0x57')]);_0x517818[_0x39de('0x58')]=qs[_0x39de('0x51')](_[_0x39de('0x72')](_0x2b78a7[_0x39de('0x50')],_0x215b51[_0x39de('0x51')]));_0x517818[_0x39de('0x58')][_0x39de('0x6c')]=_0x1d5501['id'];if(_0x2b78a7['query'][_0x39de('0x59')]){_0x517818[_0x39de('0x58')]=_[_0x39de('0x5a')](_0x517818['where'],{'$or':_[_0x39de('0x48')](_0x517818[_0x39de('0x54')],function(_0x5a15df){var _0x3cc1e9={};_0x3cc1e9[_0x5a15df]={'$like':'%'+_0x2b78a7['query']['filter']+'%'};return _0x3cc1e9;})});}_0x517818=_['merge']({},_0x517818,_0x2b78a7[_0x39de('0x64')]);return db[_0x39de('0x77')]['count']({'where':_0x517818[_0x39de('0x58')]})[_0x39de('0x13')](function(_0x26fd56){_0x3e30b0['count']=_0x26fd56;if(_0x2b78a7[_0x39de('0x50')]['includeAll']){_0x517818[_0x39de('0x63')]=[{'all':!![]}];}return db[_0x39de('0x77')][_0x39de('0x5c')](_0x517818);})[_0x39de('0x13')](function(_0x3fcd9d){_0x3e30b0[_0x39de('0x5d')]=_0x3fcd9d;return _0x3e30b0;});}})[_0x39de('0x13')](respondWithFilteredResult(_0x3dff71,_0x517818))[_0x39de('0x5e')](handleError(_0x3dff71,null));};exports['removeAnswers']=function(_0x23a7d3,_0x5c4c69){return db['MailAccount'][_0x39de('0x65')]({'where':{'id':_0x23a7d3[_0x39de('0x60')]['id']}})[_0x39de('0x13')](handleEntityNotFound(_0x5c4c69,null))[_0x39de('0x13')](function(_0x1750fd){if(_0x1750fd){return _0x1750fd[_0x39de('0x78')](_0x23a7d3[_0x39de('0x50')][_0x39de('0x74')]);}})[_0x39de('0x13')](respondWithStatusCode(_0x5c4c69,null))[_0x39de('0x5e')](handleError(_0x5c4c69,null));};exports['create']=function(_0x47b770,_0x4a974f){var _0x50e603={'name':_0x47b770[_0x39de('0x66')][_0x39de('0x2b')],'key':_0x47b770[_0x39de('0x66')][_0x39de('0x4d')],'provider':_0x47b770[_0x39de('0x66')][_0x39de('0x67')]===_0x39de('0x79')?null:_0x47b770['body'][_0x39de('0x67')],'email':_0x47b770[_0x39de('0x66')][_0x39de('0x7a')],'ListId':_0x47b770['body']['ListId'],'active':!_[_0x39de('0x7b')](_0x47b770['body']['active'])?_0x47b770[_0x39de('0x66')][_0x39de('0x7c')]:!![],'description':_0x47b770[_0x39de('0x66')][_0x39de('0x7d')]||null};var _0x55e522=getAuthenticationOptions(_0x50e603[_0x39de('0x67')],_0x47b770[_0x39de('0x66')]);_0x50e603[_0x39de('0x42')]=_0x55e522[_0x39de('0x42')];_0x50e603[_0x39de('0x43')]=_0x55e522[_0x39de('0x43')];return db['MailAccount'][_0x39de('0x6e')](_0x50e603,{'include':[{'model':db[_0x39de('0x46')],'as':_0x39de('0x43')},{'model':db['MailServerIn'],'as':_0x39de('0x42')}]})[_0x39de('0x13')](function(_0x2fc52a){var _0x38e1a5=_0x47b770[_0x39de('0x38')][_0x39de('0x27')]({'plain':!![]});if(!_0x38e1a5)throw new Error(_0x39de('0x7e'));if(_0x38e1a5['role']===_0x39de('0x38')){var _0xf0dcd2=_0x2fc52a[_0x39de('0x27')]({'plain':!![]});return db[_0x39de('0x7f')][_0x39de('0x65')]({'where':{'name':_0x39de('0x28'),'userProfileId':_0x38e1a5['userProfileId']},'raw':!![]})[_0x39de('0x13')](function(_0x6e1973){if(_0x6e1973&&_0x6e1973['autoAssociation']===0x0){return db[_0x39de('0x29')][_0x39de('0x6e')]({'name':_0xf0dcd2[_0x39de('0x2b')],'resourceId':_0xf0dcd2['id'],'type':_0x6e1973[_0x39de('0x2b')],'sectionId':_0x6e1973['id']},{})[_0x39de('0x13')](function(){return _0x2fc52a;});}else{return _0x2fc52a;}})[_0x39de('0x5e')](function(_0x2abb9d){logger['error'](_0x39de('0x80'),_0x2abb9d);throw _0x2abb9d;});}return _0x2fc52a;})[_0x39de('0x13')](respondWithResult(_0x4a974f,0xc9))[_0x39de('0x5e')](handleError(_0x4a974f,null));};exports['getImap']=function(_0x215494,_0x306247){return db[_0x39de('0x49')]['findOne']({'where':{'id':_0x215494[_0x39de('0x60')]['id']}})[_0x39de('0x13')](handleEntityNotFound(_0x306247,null))[_0x39de('0x13')](function(_0x13335b){if(_0x13335b){return _0x13335b[_0x39de('0x81')]();}return null;})[_0x39de('0x13')](respondWithResult(_0x306247,null))['catch'](handleError(_0x306247,null));};exports[_0x39de('0x82')]=function(_0x1b9d90,_0x28881f){if(_0x1b9d90[_0x39de('0x66')]['id']){delete _0x1b9d90[_0x39de('0x66')]['id'];}return db[_0x39de('0x49')][_0x39de('0x65')]({'where':{'id':_0x1b9d90['params']['id']}})[_0x39de('0x13')](handleEntityNotFound(_0x28881f,null))['then'](function(_0x2129b6){if(_0x2129b6){_0x1b9d90[_0x39de('0x66')][_0x39de('0x6c')]=_0x2129b6['id'];return db['MailServerIn'][_0x39de('0x6e')](_0x1b9d90[_0x39de('0x66')]);}})['then'](respondWithResult(_0x28881f,null))['catch'](handleError(_0x28881f,null));};exports[_0x39de('0x83')]=function(_0x272c7f,_0x4b7d44){return db['MailAccount'][_0x39de('0x6f')]({'where':{'id':_0x272c7f['params']['id']}})['then'](handleEntityNotFound(_0x4b7d44,null))[_0x39de('0x13')](function(_0xa31393){if(_0xa31393){return _0xa31393[_0x39de('0x84')](null);}return null;})['then'](respondWithStatusCode(_0x4b7d44,null))[_0x39de('0x5e')](handleError(_0x4b7d44,null));};exports[_0x39de('0x85')]=function(_0x4167bb,_0x430611){return db[_0x39de('0x49')][_0x39de('0x6f')]({'where':{'id':_0x4167bb['params']['id']}})['then'](handleEntityNotFound(_0x430611,null))[_0x39de('0x13')](function(_0x102950){if(_0x102950){return _0x102950[_0x39de('0x85')]();}return null;})[_0x39de('0x13')](respondWithResult(_0x430611,null))['catch'](handleError(_0x430611,null));};exports[_0x39de('0x86')]=function(_0x5501e7,_0x12ac64){if(_0x5501e7[_0x39de('0x66')]['id']){delete _0x5501e7[_0x39de('0x66')]['id'];}return db[_0x39de('0x49')][_0x39de('0x65')]({'where':{'id':_0x5501e7[_0x39de('0x60')]['id']}})[_0x39de('0x13')](handleEntityNotFound(_0x12ac64,null))[_0x39de('0x13')](function(_0x386d26){if(_0x386d26){_0x5501e7[_0x39de('0x66')][_0x39de('0x6c')]=_0x386d26['id'];return db[_0x39de('0x46')]['create'](_0x5501e7[_0x39de('0x66')]);}})[_0x39de('0x13')](respondWithResult(_0x12ac64,null))['catch'](handleError(_0x12ac64,null));};exports[_0x39de('0x87')]=function(_0x3f1ecb,_0x560ea1){return db['MailAccount'][_0x39de('0x6f')]({'where':{'id':_0x3f1ecb[_0x39de('0x60')]['id']}})[_0x39de('0x13')](handleEntityNotFound(_0x560ea1,null))['then'](function(_0x4418c7){if(_0x4418c7){return _0x4418c7['setSmtp'](null);}return null;})['then'](respondWithStatusCode(_0x560ea1,null))[_0x39de('0x5e')](handleError(_0x560ea1,null));};exports[_0x39de('0x88')]=function(_0x2830e2,_0x27eb0f){return db[_0x39de('0x89')][_0x39de('0x65')]({'where':{'id':_0x2830e2[_0x39de('0x60')]['id']}})[_0x39de('0x13')](handleEntityNotFound(_0x27eb0f,null))['then'](function(_0x59818e){if(_0x59818e){return _0x59818e['addInteraction'](_0x2830e2['body'][_0x39de('0x74')],_['omit'](_0x2830e2[_0x39de('0x66')],[_0x39de('0x74'),'id'])||{});}})['then'](respondWithResult(_0x27eb0f,null))[_0x39de('0x5e')](handleError(_0x27eb0f,null));};exports[_0x39de('0x8a')]=function(_0x4431e8,_0x53b659){var _0x356f9c={'raw':![],'where':{}};var _0x564929={};var _0x2d65d8={'count':0x0,'rows':[]};return db[_0x39de('0x49')][_0x39de('0x6f')]({'where':{'id':_0x4431e8[_0x39de('0x60')]['id']}})[_0x39de('0x13')](handleEntityNotFound(_0x53b659,null))['then'](function(_0x1aa785){if(_0x1aa785){_0x564929[_0x39de('0x4e')]=_[_0x39de('0x4f')](db[_0x39de('0x89')][_0x39de('0x4a')]);_0x564929[_0x39de('0x50')]=_['keys'](_0x4431e8[_0x39de('0x50')]);_0x564929[_0x39de('0x51')]=_['intersection'](_0x564929[_0x39de('0x4e')],_0x564929['query']);_0x356f9c[_0x39de('0x54')]=_[_0x39de('0x52')](_0x564929[_0x39de('0x4e')],qs[_0x39de('0x53')](_0x4431e8['query'][_0x39de('0x53')]));_0x356f9c[_0x39de('0x54')]=_0x356f9c[_0x39de('0x54')]['length']?_0x356f9c[_0x39de('0x54')]:_0x564929['model'];if(!_0x4431e8[_0x39de('0x50')][_0x39de('0x56')](_0x39de('0x70'))){_0x356f9c[_0x39de('0x21')]=qs[_0x39de('0x21')](_0x4431e8[_0x39de('0x50')]['limit']);_0x356f9c[_0x39de('0x20')]=qs[_0x39de('0x20')](_0x4431e8[_0x39de('0x50')][_0x39de('0x20')]);}_0x356f9c[_0x39de('0x71')]=qs[_0x39de('0x57')](_0x4431e8[_0x39de('0x50')][_0x39de('0x57')]);_0x356f9c[_0x39de('0x58')]=qs[_0x39de('0x51')](_['pick'](_0x4431e8[_0x39de('0x50')],_0x564929[_0x39de('0x51')]));_0x356f9c[_0x39de('0x58')][_0x39de('0x6c')]=_0x1aa785['id'];if(_0x4431e8[_0x39de('0x50')][_0x39de('0x59')]){_0x356f9c[_0x39de('0x58')]=_[_0x39de('0x5a')](_0x356f9c['where'],{'$or':_[_0x39de('0x48')](_0x356f9c[_0x39de('0x54')],function(_0x25c125){var _0x17600f={};_0x17600f[_0x25c125]={'$like':'%'+_0x4431e8[_0x39de('0x50')][_0x39de('0x59')]+'%'};return _0x17600f;})});}_0x356f9c=_[_0x39de('0x5a')]({},_0x356f9c,_0x4431e8[_0x39de('0x64')]);return db[_0x39de('0x89')][_0x39de('0x23')]({'where':_0x356f9c[_0x39de('0x58')]})[_0x39de('0x13')](function(_0x9e1af1){_0x2d65d8['count']=_0x9e1af1;if(_0x4431e8[_0x39de('0x50')][_0x39de('0x62')]){_0x356f9c[_0x39de('0x63')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x39de('0x8b')],'as':_0x39de('0x8c'),'attributes':[_0x39de('0x2b'),'fullname','internal'],'required':![]},{'model':db[_0x39de('0x8d')],'as':_0x39de('0x8e'),'attributes':['id',_0x39de('0x2b'),_0x39de('0x8f')],'where':_0x4431e8[_0x39de('0x50')]['tag']?{'id':_0x4431e8[_0x39de('0x50')]['tag']}:undefined,'required':_0x4431e8[_0x39de('0x50')][_0x39de('0x90')]?!![]:![]}];}return db[_0x39de('0x89')][_0x39de('0x5c')](_0x356f9c);})[_0x39de('0x13')](function(_0x3261a6){_0x2d65d8[_0x39de('0x5d')]=_0x3261a6;return _0x2d65d8;});}})[_0x39de('0x13')](respondWithFilteredResult(_0x53b659,_0x356f9c))['catch'](handleError(_0x53b659,null));};exports[_0x39de('0x91')]=function addApplications(_0x1c4f9a,_0x2dde40){var _0x7a47dc=_0x1c4f9a[_0x39de('0x60')]['id'];var _0x1a657f=_0x1c4f9a[_0x39de('0x66')];var _0x5c8388=0xc8;var _0x1a3aea=null;return db[_0x39de('0x92')]['transaction']({'isolationLevel':db[_0x39de('0x92')][_0x39de('0x93')]['ISOLATION_LEVELS'][_0x39de('0x94')]},function(_0x3eea38){return db[_0x39de('0x49')]['findOne']({'where':{'id':_0x7a47dc},'transaction':_0x3eea38})[_0x39de('0x13')](function(_0x110d22){if(_0x110d22){return db['MailApplication'][_0x39de('0x26')]({'where':{'MailAccountId':_0x7a47dc},'transaction':_0x3eea38})[_0x39de('0x13')](function(){var _0x2534f9=_['map'](_0x1a657f,function(_0xa2e710){_0xa2e710[_0x39de('0x6c')]=_0x7a47dc;return _0xa2e710;});return db[_0x39de('0x95')][_0x39de('0x96')](_0x2534f9,{'transaction':_0x3eea38});});}else{_0x5c8388=0x194;_0x1a3aea=[];}});})[_0x39de('0x13')](function(){if(_0x5c8388!==0x194){return db[_0x39de('0x95')][_0x39de('0x97')]({'where':{'MailAccountId':_0x7a47dc},'order':_0x39de('0x98')})[_0x39de('0x13')](function(_0x1fd36a){_0x1a3aea=_0x1fd36a;});}})[_0x39de('0x5e')](function(_0x28aaf7){_0x5c8388=0x1f4;logger[_0x39de('0x19')](_0x28aaf7[_0x39de('0x2a')]);if(_0x28aaf7[_0x39de('0x2b')]){delete _0x28aaf7[_0x39de('0x2b')];}_0x1a3aea=_0x28aaf7;})[_0x39de('0x99')](function(){if(_0x1a3aea===null){_0x2dde40[_0x39de('0x1c')](_0x5c8388);}else{if(_0x5c8388===0x1f4){_0x2dde40[_0x39de('0x1d')](_0x5c8388)[_0x39de('0x2c')](_0x1a3aea);}else{_0x2dde40[_0x39de('0x1d')](_0x5c8388)[_0x39de('0x1f')](_0x1a3aea);}}});};exports['getApplications']=function(_0x4d1f20,_0x3f5cbe){var _0x5a1ae0={};var _0x1ac4fb={};var _0x47eb93;var _0x87e59b;return db[_0x39de('0x49')][_0x39de('0x6f')]({'where':{'id':_0x4d1f20['params']['id']}})[_0x39de('0x13')](handleEntityNotFound(_0x3f5cbe,null))['then'](function(_0x3176bf){if(_0x3176bf){_0x47eb93=_0x3176bf;_0x1ac4fb[_0x39de('0x4e')]=_[_0x39de('0x4f')](db['MailApplication'][_0x39de('0x4a')]);_0x1ac4fb[_0x39de('0x50')]=_[_0x39de('0x4f')](_0x4d1f20[_0x39de('0x50')]);_0x1ac4fb[_0x39de('0x51')]=_[_0x39de('0x52')](_0x1ac4fb[_0x39de('0x4e')],_0x1ac4fb[_0x39de('0x50')]);_0x5a1ae0['attributes']=_[_0x39de('0x52')](_0x1ac4fb['model'],qs[_0x39de('0x53')](_0x4d1f20[_0x39de('0x50')][_0x39de('0x53')]));_0x5a1ae0['attributes']=_0x5a1ae0[_0x39de('0x54')][_0x39de('0x55')]?_0x5a1ae0[_0x39de('0x54')]:_0x1ac4fb[_0x39de('0x4e')];_0x5a1ae0[_0x39de('0x71')]=qs[_0x39de('0x57')](_0x4d1f20[_0x39de('0x50')][_0x39de('0x57')]);_0x5a1ae0[_0x39de('0x58')]=qs[_0x39de('0x51')](_['pick'](_0x4d1f20['query'],_0x1ac4fb[_0x39de('0x51')]));if(_0x4d1f20['query'][_0x39de('0x59')]){_0x5a1ae0[_0x39de('0x58')]=_[_0x39de('0x5a')](_0x5a1ae0[_0x39de('0x58')],{'$or':_[_0x39de('0x48')](_0x5a1ae0['attributes'],function(_0x352d80){var _0x74d855={};_0x74d855[_0x352d80]={'$like':'%'+_0x4d1f20[_0x39de('0x50')]['filter']+'%'};return _0x74d855;})});}_0x5a1ae0=_['merge']({},_0x5a1ae0,_0x4d1f20['options']);return _0x47eb93[_0x39de('0x9a')](_0x5a1ae0);}})['then'](function(_0xe85665){if(_0xe85665){_0x87e59b=_0xe85665['length'];if(!_0x4d1f20[_0x39de('0x50')][_0x39de('0x56')](_0x39de('0x70'))){_0x5a1ae0[_0x39de('0x21')]=qs['limit'](_0x4d1f20[_0x39de('0x50')]['limit']);_0x5a1ae0[_0x39de('0x20')]=qs[_0x39de('0x20')](_0x4d1f20[_0x39de('0x50')][_0x39de('0x20')]);}return _0x47eb93[_0x39de('0x9a')](_0x5a1ae0);}})[_0x39de('0x13')](function(_0x5813ff){if(_0x5813ff){return _0x5813ff?{'count':_0x87e59b,'rows':_0x5813ff}:null;}})['then'](respondWithResult(_0x3f5cbe,null))[_0x39de('0x5e')](handleError(_0x3f5cbe,null));};exports[_0x39de('0x9b')]=function(_0x253bbb,_0x485d5b){var _0x2b611b={'raw':!![],'where':{}};var _0x4905d6={};var _0x5ea65a={'count':0x0,'rows':[]};return db[_0x39de('0x49')]['findOne']({'where':{'id':_0x253bbb['params']['id']}})[_0x39de('0x13')](handleEntityNotFound(_0x485d5b,null))[_0x39de('0x13')](function(_0x3b6955){if(_0x3b6955){_0x4905d6[_0x39de('0x4e')]=_[_0x39de('0x4f')](db['MailMessage']['rawAttributes']);_0x4905d6[_0x39de('0x50')]=_[_0x39de('0x4f')](_0x253bbb[_0x39de('0x50')]);_0x4905d6[_0x39de('0x51')]=_[_0x39de('0x52')](_0x4905d6['model'],_0x4905d6['query']);_0x2b611b[_0x39de('0x54')]=_[_0x39de('0x52')](_0x4905d6[_0x39de('0x4e')],qs[_0x39de('0x53')](_0x253bbb['query']['fields']));_0x2b611b[_0x39de('0x54')]=_0x2b611b[_0x39de('0x54')]['length']?_0x2b611b[_0x39de('0x54')]:_0x4905d6[_0x39de('0x4e')];if(!_0x253bbb[_0x39de('0x50')][_0x39de('0x56')](_0x39de('0x70'))){_0x2b611b[_0x39de('0x21')]=qs['limit'](_0x253bbb[_0x39de('0x50')]['limit']);_0x2b611b['offset']=qs[_0x39de('0x20')](_0x253bbb[_0x39de('0x50')][_0x39de('0x20')]);}_0x2b611b['order']=qs[_0x39de('0x57')](_0x253bbb[_0x39de('0x50')]['sort']);_0x2b611b[_0x39de('0x58')]=qs[_0x39de('0x51')](_[_0x39de('0x72')](_0x253bbb['query'],_0x4905d6[_0x39de('0x51')]));_0x2b611b[_0x39de('0x58')][_0x39de('0x6c')]=_0x3b6955['id'];if(_0x253bbb[_0x39de('0x50')]['filter']){_0x2b611b[_0x39de('0x58')]=_[_0x39de('0x5a')](_0x2b611b[_0x39de('0x58')],{'$or':_[_0x39de('0x48')](_0x2b611b[_0x39de('0x54')],function(_0x569e2d){var _0x1176c3={};_0x1176c3[_0x569e2d]={'$like':'%'+_0x253bbb[_0x39de('0x50')][_0x39de('0x59')]+'%'};return _0x1176c3;})});}if(_0x253bbb[_0x39de('0x50')]['$gte']){var _0xe3982e=_0x253bbb[_0x39de('0x50')][_0x39de('0x9c')]['split'](',');var _0x193d9e={};_0x193d9e[_0xe3982e[0x0]]={'$gte':moment(_0xe3982e[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x2b611b[_0x39de('0x58')]=_['merge'](_0x2b611b[_0x39de('0x58')],_0x193d9e);}_0x2b611b=_[_0x39de('0x5a')]({},_0x2b611b,_0x253bbb['options']);return db['MailMessage'][_0x39de('0x23')]({'where':_0x2b611b[_0x39de('0x58')]})[_0x39de('0x13')](function(_0x338aae){_0x5ea65a['count']=_0x338aae;if(_0x253bbb[_0x39de('0x50')]['includeAll']){_0x2b611b['include']=[{'all':!![]}];}return db[_0x39de('0x9d')][_0x39de('0x5c')](_0x2b611b);})['then'](function(_0x46eb97){if(_0x253bbb[_0x39de('0x50')][_0x39de('0x9e')]===_0x39de('0x9f')){for(var _0x337fc9=0x0;_0x337fc9<_0x46eb97['length'];_0x337fc9++){_0x46eb97[_0x337fc9][_0x39de('0x66')]=juice(_0x46eb97[_0x337fc9][_0x39de('0x66')]);}}_0x5ea65a['rows']=_0x46eb97;return _0x5ea65a;});}})[_0x39de('0x13')](respondWithFilteredResult(_0x485d5b,_0x2b611b))[_0x39de('0x5e')](handleError(_0x485d5b,null));};exports['send']=function(_0xde0668,_0x281adf){var _0x2eacc0,_0x4f210d={},_0x42ef20;if(_0xde0668[_0x39de('0x66')]['to']){_0x42ef20=_0xde0668['body']['to'][_0x39de('0xa0')](',')[0x0];}return db[_0x39de('0x49')][_0x39de('0x65')]({'where':{'id':_0xde0668[_0x39de('0x60')]['id']},'include':[{'model':db['CmList'],'as':_0x39de('0xa1'),'include':[{'model':db[_0x39de('0xa2')],'as':'Contacts','where':{'email':_0x42ef20},'limit':0x1,'order':[[_0x39de('0xa3'),_0x39de('0xa4')]]}]},{'model':db[_0x39de('0x46')],'as':_0x39de('0x43'),'raw':!![],'include':[{'model':db[_0x39de('0xa5')],'as':_0x39de('0xa5'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x281adf,null))['then'](function(_0x1f8fc7){if(!_0x1f8fc7)return;_0x2eacc0=_0x1f8fc7;if(!_0x1f8fc7[_0x39de('0x43')])throw new Error('Smtp\x20configuration\x20not\x20found');if(_[_0x39de('0x7b')](_0xde0668[_0x39de('0x66')][_0x39de('0xa6')])){_0xde0668[_0x39de('0x66')][_0x39de('0xa6')]=util[_0x39de('0xa7')](_0x39de('0xa8'),_0x1f8fc7['name'],_0x1f8fc7[_0x39de('0x7a')]||_0x1f8fc7[_0x39de('0x43')][_0x39de('0x38')]);}if(_0xde0668[_0x39de('0x66')][_0x39de('0xa9')]&&_0xde0668[_0x39de('0x66')]['attachments'][_0x39de('0x55')]){for(var _0x3c299a=0x0;_0x3c299a<_0xde0668[_0x39de('0x66')][_0x39de('0xa9')][_0x39de('0x55')];_0x3c299a+=0x1){_0xde0668[_0x39de('0x66')][_0x39de('0xa9')][_0x3c299a]={'filename':_0xde0668[_0x39de('0x66')][_0x39de('0xa9')][_0x3c299a][_0x39de('0x2b')],'path':path[_0x39de('0xaa')](config[_0x39de('0xab')],_0x39de('0xac'),_0xde0668[_0x39de('0x66')]['attachments'][_0x3c299a][_0x39de('0xad')])};}}var _0x3b026b=_0x1f8fc7[_0x39de('0xae')]();return respondWithRpcPromise(_0x39de('0xaf'),_0x39de('0xb0'),{'account':_0x3b026b,'message':_0xde0668[_0x39de('0x66')]});})[_0x39de('0x13')](function(_0x5a466f){if(!_0x5a466f)return;_0x4f210d=_0x5a466f;if(!_0x2eacc0[_0x39de('0xa1')])throw new Error('List\x20not\x20found');if(_0x2eacc0[_0x39de('0xa1')][_0x39de('0xb1')][_0x39de('0x55')])return _0x2eacc0[_0x39de('0xa1')]['Contacts'][0x0];return db[_0x39de('0xa2')][_0x39de('0x6e')](_['defaults'](_0xde0668[_0x39de('0x66')],{'firstName':_0xde0668[_0x39de('0x66')]['to'],'email':_0xde0668['body']['to'],'phone':_0xde0668[_0x39de('0x66')]['to'],'ListId':_0x2eacc0['ListId']}));})[_0x39de('0x13')](function(_0x1e96da){if(!_0x1e96da)return;var _0xe25be3={'UserId':_0xde0668['user']['id'],'ContactId':_0x1e96da['id'],'MailAccountId':_0x2eacc0['id'],'inReplyTo':_0x4f210d['messageId'],'to':_0xde0668[_0x39de('0x66')][_0x39de('0xa6')],'cc':_0xde0668[_0x39de('0x66')]['cc'],'subject':_0xde0668[_0x39de('0x66')][_0x39de('0xb2')],'attach':_0xde0668[_0x39de('0x66')][_0x39de('0xb3')],'firstMsgDirection':'out','lastMsgAt':moment()[_0x39de('0xa7')](_0x39de('0xb4')),'lastMsgDirection':'out','Messages':[_[_0x39de('0x5a')](_0xde0668[_0x39de('0x66')],{'messageId':_0x4f210d['messageId'],'sentAt':moment()[_0x39de('0xa7')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x2eacc0['id'],'UserId':_0xde0668[_0x39de('0x38')]['id'],'ContactId':_0x1e96da['id']})]};if(_0xde0668[_0x39de('0x66')][_0x39de('0xb5')]){_0xe25be3=_[_0x39de('0x5a')](_0xe25be3,_0xde0668[_0x39de('0x66')][_0x39de('0xb5')]);}return db['MailInteraction']['create'](_0xe25be3,{'include':[{'model':db[_0x39de('0x9d')],'as':_0x39de('0xb6')}]});})[_0x39de('0x13')](respondWithResult(_0x281adf,null))[_0x39de('0x5e')](handleError(_0x281adf,null));};exports['verifySmtp']=function(_0x229a6a,_0x5d3aed){return db[_0x39de('0x49')][_0x39de('0x65')]({'where':{'id':_0x229a6a[_0x39de('0x60')]['id']},'include':[{'model':db[_0x39de('0x46')],'as':_0x39de('0x43'),'raw':!![],'include':[{'model':db[_0x39de('0xa5')],'as':'CloudProvider','raw':!![]}]}]})[_0x39de('0x13')](handleEntityNotFound(_0x5d3aed,null))[_0x39de('0x13')](function(_0x247a91){if(!_0x247a91[_0x39de('0x43')])return;var _0x422e94=_0x247a91[_0x39de('0xae')]();return respondWithRpcPromise(_0x39de('0xb7'),'verifySmtp',{'account':_0x422e94});})['then'](respondWithResult(_0x5d3aed,null))[_0x39de('0x5e')](handleError(_0x5d3aed,null));};exports[_0x39de('0x26')]=function(_0x3af010,_0x12ea35){return db['MailAccount']['find']({'where':{'id':_0x3af010[_0x39de('0x60')]['id']}})[_0x39de('0x13')](handleEntityNotFound(_0x12ea35,null))[_0x39de('0x13')](function(_0x2eed45){if(_0x2eed45&&_0x2eed45[_0x39de('0x40')]){throw new db[(_0x39de('0xb8'))][(_0x39de('0xb9'))](_0x39de('0xba'));}return _0x2eed45;})[_0x39de('0x13')](removeEntity(_0x12ea35,null))[_0x39de('0x5e')](handleError(_0x12ea35,null));};exports[_0x39de('0xbb')]=function(_0x5356d5,_0x4c59d8){return db[_0x39de('0x49')][_0x39de('0x65')]({'where':{'id':_0x5356d5['params']['id']}})[_0x39de('0x13')](handleEntityNotFound(_0x4c59d8,null))[_0x39de('0x13')](function(_0x1b8880){if(_0x1b8880){return _0x1b8880[_0x39de('0xbb')](_0x5356d5[_0x39de('0x66')][_0x39de('0x74')],_['omit'](_0x5356d5['body'],['ids','id'])||{})[_0x39de('0xbc')](function(_0x457bb7){for(var _0x4666c4=0x0;_0x4666c4<_0x5356d5[_0x39de('0x66')][_0x39de('0x74')][_0x39de('0x55')];_0x4666c4+=0x1){socket[_0x39de('0xbd')](_0x39de('0xbe'),{'UserId':Number(_0x5356d5['body'][_0x39de('0x74')][_0x4666c4]),'MailAccountId':Number(_0x5356d5[_0x39de('0x60')]['id'])});}return _0x457bb7;});}})[_0x39de('0x13')](respondWithResult(_0x4c59d8,null))[_0x39de('0x5e')](handleError(_0x4c59d8,null));};exports['removeAgents']=function(_0x43a00f,_0x23e47a){return db[_0x39de('0x49')]['find']({'where':{'id':_0x43a00f[_0x39de('0x60')]['id']}})[_0x39de('0x13')](handleEntityNotFound(_0x23e47a,null))[_0x39de('0x13')](function(_0x63f9a0){if(_0x63f9a0){return _0x63f9a0[_0x39de('0xbf')](_0x43a00f[_0x39de('0x50')]['ids'])['then'](function(){if(_[_0x39de('0xc0')](_0x43a00f[_0x39de('0x50')][_0x39de('0x74')])){for(var _0x17e5b2=0x0;_0x17e5b2<_0x43a00f[_0x39de('0x50')][_0x39de('0x74')][_0x39de('0x55')];_0x17e5b2+=0x1){socket[_0x39de('0xbd')]('userMailAccount:remove',{'UserId':Number(_0x43a00f[_0x39de('0x50')]['ids'][_0x17e5b2]),'MailAccountId':Number(_0x43a00f[_0x39de('0x60')]['id'])});}}else{socket['emit']('userMailAccount:remove',{'UserId':Number(_0x43a00f[_0x39de('0x50')]['ids']),'MailAccountId':Number(_0x43a00f[_0x39de('0x60')]['id'])});}});}})[_0x39de('0x13')](respondWithStatusCode(_0x23e47a,null))[_0x39de('0x5e')](handleError(_0x23e47a,null));};exports['getAgents']=function(_0x9c5ae1,_0x4a0af5){var _0x42943e={};var _0x4442d3={};var _0x155419;var _0x579645;return db['MailAccount']['findOne']({'where':{'id':_0x9c5ae1[_0x39de('0x60')]['id']}})[_0x39de('0x13')](handleEntityNotFound(_0x4a0af5,null))['then'](function(_0x81e906){if(_0x81e906){_0x155419=_0x81e906;_0x4442d3['model']=_[_0x39de('0x4f')](db[_0x39de('0x8b')][_0x39de('0x4a')]);_0x4442d3['query']=_[_0x39de('0x4f')](_0x9c5ae1[_0x39de('0x50')]);_0x4442d3[_0x39de('0x51')]=_[_0x39de('0x52')](_0x4442d3[_0x39de('0x4e')],_0x4442d3['query']);_0x42943e[_0x39de('0x54')]=_[_0x39de('0x52')](_0x4442d3[_0x39de('0x4e')],qs[_0x39de('0x53')](_0x9c5ae1[_0x39de('0x50')]['fields']));_0x42943e['attributes']=_0x42943e[_0x39de('0x54')]['length']?_0x42943e[_0x39de('0x54')]:_0x4442d3[_0x39de('0x4e')];_0x42943e[_0x39de('0x71')]=qs[_0x39de('0x57')](_0x9c5ae1[_0x39de('0x50')][_0x39de('0x57')]);_0x42943e[_0x39de('0x58')]=qs[_0x39de('0x51')](_[_0x39de('0x72')](_0x9c5ae1[_0x39de('0x50')],_0x4442d3[_0x39de('0x51')]));if(_0x9c5ae1[_0x39de('0x50')]['filter']){_0x42943e['where']=_[_0x39de('0x5a')](_0x42943e['where'],{'$or':_[_0x39de('0x48')](_0x42943e[_0x39de('0x54')],function(_0x3f3b53){var _0x304255={};_0x304255[_0x3f3b53]={'$like':'%'+_0x9c5ae1['query'][_0x39de('0x59')]+'%'};return _0x304255;})});}_0x42943e=_[_0x39de('0x5a')]({},_0x42943e,_0x9c5ae1[_0x39de('0x64')]);return _0x155419[_0x39de('0xc1')](_0x42943e);}})[_0x39de('0x13')](function(_0x209cb7){if(_0x209cb7){_0x579645=_0x209cb7[_0x39de('0x55')];if(!_0x9c5ae1[_0x39de('0x50')][_0x39de('0x56')]('nolimit')){_0x42943e['limit']=qs['limit'](_0x9c5ae1['query'][_0x39de('0x21')]);_0x42943e[_0x39de('0x20')]=qs[_0x39de('0x20')](_0x9c5ae1[_0x39de('0x50')]['offset']);}return _0x155419[_0x39de('0xc1')](_0x42943e);}})['then'](function(_0x4dfa0b){if(_0x4dfa0b){return _0x4dfa0b?{'count':_0x579645,'rows':_0x4dfa0b}:null;}})['then'](respondWithResult(_0x4a0af5,null))['catch'](handleError(_0x4a0af5,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 8babdb8..61c3005 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 _0x40f3=['MailAccount','save','update','emit','hook','exports','../../mysqldb'];(function(_0x423c33,_0x42ec5e){var _0x1e2f06=function(_0x4585cb){while(--_0x4585cb){_0x423c33['push'](_0x423c33['shift']());}};_0x1e2f06(++_0x42ec5e);}(_0x40f3,0x8b));var _0x340f=function(_0x585d81,_0xf6d74f){_0x585d81=_0x585d81-0x0;var _0x1aca0d=_0x40f3[_0x585d81];return _0x1aca0d;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x340f('0x0'))['db'][_0x340f('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x340f('0x2'),'afterUpdate':_0x340f('0x3'),'afterDestroy':'remove'};function emitEvent(_0x541841){return function(_0x42b102,_0x3380ba,_0x5b331a){MailAccountEvents[_0x340f('0x4')](_0x541841+':'+_0x42b102['id'],_0x42b102);MailAccountEvents['emit'](_0x541841,_0x42b102);_0x5b331a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x340f('0x5')](e,emitEvent(event));}}module[_0x340f('0x6')]=MailAccountEvents; \ No newline at end of file +var _0x7008=['hasOwnProperty','hook','events','../../mysqldb','MailAccount','setMaxListeners','update','remove','emit'];(function(_0x1e1f4a,_0x15d8c7){var _0x2221c8=function(_0xd9e618){while(--_0xd9e618){_0x1e1f4a['push'](_0x1e1f4a['shift']());}};_0x2221c8(++_0x15d8c7);}(_0x7008,0x185));var _0x8700=function(_0x5788df,_0x52475c){_0x5788df=_0x5788df-0x0;var _0x2d4258=_0x7008[_0x5788df];return _0x2d4258;};'use strict';var EventEmitter=require(_0x8700('0x0'));var MailAccount=require(_0x8700('0x1'))['db'][_0x8700('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x8700('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8700('0x4'),'afterDestroy':_0x8700('0x5')};function emitEvent(_0x5db5c0){return function(_0x394131,_0x2ebde3,_0x41ec16){MailAccountEvents[_0x8700('0x6')](_0x5db5c0+':'+_0x394131['id'],_0x394131);MailAccountEvents[_0x8700('0x6')](_0x5db5c0,_0x394131);_0x41ec16(null);};}for(var e in events){if(events[_0x8700('0x7')](e)){var event=events[e];MailAccount[_0x8700('0x8')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 04ad1dd..b616304 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 _0xcf94=['OAuth2','user','./mailAccount.attributes','MailAccount','provider','host','Smtp','port','secure','authentication','modernAuthentication','CloudProvider','auth'];(function(_0x4528cf,_0x3b1892){var _0x4bca53=function(_0x47d77b){while(--_0x47d77b){_0x4528cf['push'](_0x4528cf['shift']());}};_0x4bca53(++_0x3b1892);}(_0xcf94,0x120));var _0x4cf9=function(_0x16a607,_0xeb8320){_0x16a607=_0x16a607-0x0;var _0x38422a=_0xcf94[_0x16a607];return _0x38422a;};'use strict';var attributes=require(_0x4cf9('0x0'));module['exports']=function(_0x4f7629){return _0x4f7629['define'](_0x4cf9('0x1'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x3caf95=this;var _0x280b7d={'id':_0x3caf95['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3caf95[_0x4cf9('0x2')]!=='custom'){_0x280b7d['service']=_0x3caf95[_0x4cf9('0x2')];}else{_0x280b7d[_0x4cf9('0x3')]=_0x3caf95[_0x4cf9('0x4')][_0x4cf9('0x3')];_0x280b7d[_0x4cf9('0x5')]=_0x3caf95[_0x4cf9('0x4')]['port'];_0x280b7d[_0x4cf9('0x6')]=_0x3caf95['Smtp']['secure'];}if(_0x3caf95[_0x4cf9('0x4')][_0x4cf9('0x7')]){if(_0x3caf95[_0x4cf9('0x4')][_0x4cf9('0x8')]){if(!_0x3caf95[_0x4cf9('0x4')][_0x4cf9('0x9')])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x280b7d[_0x4cf9('0xa')]={'type':_0x4cf9('0xb'),'user':_0x3caf95[_0x4cf9('0x4')][_0x4cf9('0xc')],'accessToken':_0x3caf95[_0x4cf9('0x4')][_0x4cf9('0x9')]['data5']};}else{_0x280b7d[_0x4cf9('0xa')]={'user':_0x3caf95[_0x4cf9('0x4')][_0x4cf9('0xc')],'pass':_0x3caf95[_0x4cf9('0x4')]['pass']};}}return _0x280b7d;}}});}; \ No newline at end of file +var _0x2828=['host','port','secure','Smtp','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','OAuth2','data5','auth','user','pass','./mailAccount.attributes','define','MailAccount','mail_accounts','custom','service','provider'];(function(_0xcb1017,_0x2c2af1){var _0x3704d6=function(_0x579053){while(--_0x579053){_0xcb1017['push'](_0xcb1017['shift']());}};_0x3704d6(++_0x2c2af1);}(_0x2828,0xe9));var _0x8282=function(_0x5cdae9,_0x5e30a9){_0x5cdae9=_0x5cdae9-0x0;var _0x417701=_0x2828[_0x5cdae9];return _0x417701;};'use strict';var attributes=require(_0x8282('0x0'));module['exports']=function(_0x2ad4b2){return _0x2ad4b2[_0x8282('0x1')](_0x8282('0x2'),attributes,{'tableName':_0x8282('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x3c3c1e=this;var _0x21a424={'id':_0x3c3c1e['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3c3c1e['provider']!==_0x8282('0x4')){_0x21a424[_0x8282('0x5')]=_0x3c3c1e[_0x8282('0x6')];}else{_0x21a424[_0x8282('0x7')]=_0x3c3c1e['Smtp'][_0x8282('0x7')];_0x21a424[_0x8282('0x8')]=_0x3c3c1e['Smtp']['port'];_0x21a424[_0x8282('0x9')]=_0x3c3c1e[_0x8282('0xa')][_0x8282('0x9')];}if(_0x3c3c1e[_0x8282('0xa')][_0x8282('0xb')]){if(_0x3c3c1e['Smtp'][_0x8282('0xc')]){if(!_0x3c3c1e['Smtp'][_0x8282('0xd')])throw new Error(_0x8282('0xe'));_0x21a424['auth']={'type':_0x8282('0xf'),'user':_0x3c3c1e['Smtp']['user'],'accessToken':_0x3c3c1e[_0x8282('0xa')][_0x8282('0xd')][_0x8282('0x10')]};}else{_0x21a424[_0x8282('0x11')]={'user':_0x3c3c1e['Smtp'][_0x8282('0x12')],'pass':_0x3c3c1e[_0x8282('0xa')][_0x8282('0x13')]};}}return _0x21a424;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 4a134a0..ca87d6e 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 _0x1c9a=['./mailAccount.socket','register','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailAccount','MailAccount','findAll','options','raw','limit','map','include','model','attributes','then','ShowMailAccount','find','where','smtp','setDataValue','smtpOptions','NotifyMailAccount','body','keys','createdAt','CompanyId','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','account','CmList','CmContact','Contacts','updatedAt','DESC','Applications','Smtp','CloudProvider','List','get','omit','getSmtpOptions','applications','orderBy','asc','autoclose','push','length','close','*,*,*,*','create','List\x20not\x20found','messageId','generate','subject','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','spread','attach','format','created','attachments','originTo','originCc','bcc','ChatWebsiteId','ChatOfflineMessageId','Attachment','Attachments','interaction','UserId','name','unshift','waitForTheAssignedAgent','MailQueue','queue','waitForTheAssignedQueue','Start','startRouting','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x16248b,_0x335f27){var _0x4c7749=function(_0x1a2fee){while(--_0x1a2fee){_0x16248b['push'](_0x16248b['shift']());}};_0x4c7749(++_0x335f27);}(_0x1c9a,0x1a7));var _0xa1c9=function(_0x497fc7,_0x3fb07d){_0x497fc7=_0x497fc7-0x0;var _0x45c0f2=_0x1c9a[_0x497fc7];return _0x45c0f2;};'use strict';var _=require(_0xa1c9('0x0'));var moment=require(_0xa1c9('0x1'));var BPromise=require('bluebird');var rs=require(_0xa1c9('0x2'));var Redis=require(_0xa1c9('0x3'));var db=require(_0xa1c9('0x4'))['db'];var logger=require(_0xa1c9('0x5'))(_0xa1c9('0x6'));var config=require('../../config/environment');var jayson=require(_0xa1c9('0x7'));var client=jayson['client'][_0xa1c9('0x8')]({'port':0x232c});config[_0xa1c9('0x9')]=_[_0xa1c9('0xa')](config[_0xa1c9('0x9')],{'host':_0xa1c9('0xb'),'port':0x18eb});var socket=require(_0xa1c9('0xc'))(new Redis(config[_0xa1c9('0x9')]));require(_0xa1c9('0xd'))[_0xa1c9('0xe')](socket);function respondWithRpcPromise(_0xfab70b,_0x2fcbcd,_0xb96573){return new BPromise(function(_0x55c191,_0x53140c){return client[_0xa1c9('0xf')](_0xfab70b,_0xb96573)['then'](function(_0x26b475){logger[_0xa1c9('0x10')](_0xa1c9('0x11'),_0x2fcbcd,_0xa1c9('0x12'));logger[_0xa1c9('0x13')](_0xa1c9('0x14'),_0x2fcbcd,_0xa1c9('0x12'),JSON[_0xa1c9('0x15')](_0x26b475));if(_0x26b475[_0xa1c9('0x16')]){if(_0x26b475[_0xa1c9('0x16')][_0xa1c9('0x17')]===0x1f4){logger[_0xa1c9('0x16')](_0xa1c9('0x11'),_0x2fcbcd,_0x26b475[_0xa1c9('0x16')][_0xa1c9('0x18')]);return _0x53140c(_0x26b475[_0xa1c9('0x16')][_0xa1c9('0x18')]);}logger[_0xa1c9('0x16')](_0xa1c9('0x11'),_0x2fcbcd,_0x26b475[_0xa1c9('0x16')]['message']);return _0x55c191(_0x26b475[_0xa1c9('0x16')]['message']);}else{logger[_0xa1c9('0x10')](_0xa1c9('0x11'),_0x2fcbcd,_0xa1c9('0x12'));_0x55c191(_0x26b475[_0xa1c9('0x19')][_0xa1c9('0x18')]);}})[_0xa1c9('0x1a')](function(_0x223932){logger[_0xa1c9('0x16')](_0xa1c9('0x11'),_0x2fcbcd,_0x223932);_0x53140c(_0x223932);});});}exports[_0xa1c9('0x1b')]=function(_0x278ba6){var _0x18c22d=this;return new Promise(function(_0x58b01f,_0x1a5b8e){return db[_0xa1c9('0x1c')][_0xa1c9('0x1d')]({'raw':_0x278ba6[_0xa1c9('0x1e')]?_0x278ba6[_0xa1c9('0x1e')][_0xa1c9('0x1f')]===undefined?!![]:![]:!![],'where':_0x278ba6[_0xa1c9('0x1e')]?_0x278ba6[_0xa1c9('0x1e')]['where']||null:null,'attributes':_0x278ba6[_0xa1c9('0x1e')]?_0x278ba6[_0xa1c9('0x1e')]['attributes']||null:null,'limit':_0x278ba6[_0xa1c9('0x1e')]?_0x278ba6[_0xa1c9('0x1e')][_0xa1c9('0x20')]||null:null,'include':_0x278ba6[_0xa1c9('0x1e')]?_0x278ba6[_0xa1c9('0x1e')]['include']?_[_0xa1c9('0x21')](_0x278ba6[_0xa1c9('0x1e')][_0xa1c9('0x22')],function(_0x484a6b){return{'model':db[_0x484a6b[_0xa1c9('0x23')]],'as':_0x484a6b['as'],'attributes':_0x484a6b[_0xa1c9('0x24')],'include':_0x484a6b[_0xa1c9('0x22')]?_[_0xa1c9('0x21')](_0x484a6b[_0xa1c9('0x22')],function(_0x339dee){return{'model':db[_0x339dee[_0xa1c9('0x23')]],'as':_0x339dee['as'],'attributes':_0x339dee[_0xa1c9('0x24')],'include':_0x339dee[_0xa1c9('0x22')]?_[_0xa1c9('0x21')](_0x339dee[_0xa1c9('0x22')],function(_0x364e70){return{'model':db[_0x364e70[_0xa1c9('0x23')]],'as':_0x364e70['as'],'attributes':_0x364e70[_0xa1c9('0x24')]};}):[]};}):[]};}):[]:[]})[_0xa1c9('0x25')](function(_0xf584e2){logger['info'](_0xa1c9('0x1b'),_0x278ba6);logger[_0xa1c9('0x13')](_0xa1c9('0x1b'),_0x278ba6,JSON[_0xa1c9('0x15')](_0xf584e2));_0x58b01f(_0xf584e2);})[_0xa1c9('0x1a')](function(_0x4c6dd4){logger[_0xa1c9('0x16')](_0xa1c9('0x1b'),_0x4c6dd4['message'],_0x278ba6);_0x1a5b8e(_0x18c22d[_0xa1c9('0x16')](0x1f4,_0x4c6dd4[_0xa1c9('0x18')]));});});};exports[_0xa1c9('0x26')]=function(_0x1339fd){var _0xd1f98e=this;return new Promise(function(_0x386b64,_0x220b63){return db[_0xa1c9('0x1c')][_0xa1c9('0x27')]({'raw':_0x1339fd[_0xa1c9('0x1e')]?_0x1339fd[_0xa1c9('0x1e')][_0xa1c9('0x1f')]===undefined?!![]:![]:!![],'where':_0x1339fd[_0xa1c9('0x1e')]?_0x1339fd[_0xa1c9('0x1e')][_0xa1c9('0x28')]||null:null,'attributes':_0x1339fd['options']?_0x1339fd[_0xa1c9('0x1e')][_0xa1c9('0x24')]||null:null,'include':_0x1339fd[_0xa1c9('0x1e')]?_0x1339fd[_0xa1c9('0x1e')]['include']?_[_0xa1c9('0x21')](_0x1339fd[_0xa1c9('0x1e')]['include'],function(_0x5ab2f2){return{'model':db[_0x5ab2f2[_0xa1c9('0x23')]],'as':_0x5ab2f2['as'],'attributes':_0x5ab2f2[_0xa1c9('0x24')],'include':_0x5ab2f2[_0xa1c9('0x22')]?_[_0xa1c9('0x21')](_0x5ab2f2[_0xa1c9('0x22')],function(_0x2c1825){return{'model':db[_0x2c1825[_0xa1c9('0x23')]],'as':_0x2c1825['as'],'attributes':_0x2c1825[_0xa1c9('0x24')],'include':_0x2c1825[_0xa1c9('0x22')]?_[_0xa1c9('0x21')](_0x2c1825[_0xa1c9('0x22')],function(_0x549afc){return{'model':db[_0x549afc[_0xa1c9('0x23')]],'as':_0x549afc['as'],'attributes':_0x549afc[_0xa1c9('0x24')]};}):[]};}):[]};}):[]:[]})[_0xa1c9('0x25')](function(_0x3df11a){if(_0x1339fd[_0xa1c9('0x1e')][_0xa1c9('0x29')]===!![])_0x3df11a[_0xa1c9('0x2a')](_0xa1c9('0x2b'),_0x3df11a['getSmtpOptions']());logger[_0xa1c9('0x10')](_0xa1c9('0x26'),_0x1339fd);logger[_0xa1c9('0x13')]('ShowMailAccount',_0x1339fd,JSON[_0xa1c9('0x15')](_0x3df11a));_0x386b64(_0x3df11a);})[_0xa1c9('0x1a')](function(_0x23cab5){logger[_0xa1c9('0x16')](_0xa1c9('0x26'),_0x23cab5[_0xa1c9('0x18')],_0x1339fd);_0x220b63(_0xd1f98e[_0xa1c9('0x16')](0x1f4,_0x23cab5['message']));});});};exports[_0xa1c9('0x2c')]=function(_0x5f3084){var _0x1562f8=this;return new Promise(function(_0x4c1a9e,_0x114a21){var _0x313ec7={'body':_0x5f3084[_0xa1c9('0x2d')],'channel':'mail'};var _0x19d1aa=_['difference'](_[_0xa1c9('0x2e')](db['CmContact']['rawAttributes']),[_0xa1c9('0x2f'),'updatedAt',_0xa1c9('0x30'),'ListId']);var _0x550872=![];if(_0x5f3084[_0xa1c9('0x2d')]['id']){delete _0x5f3084[_0xa1c9('0x2d')]['id'];}if(_[_0xa1c9('0x31')](_0x5f3084[_0xa1c9('0x2d')]['from'])){return _0x114a21(_0x1562f8[_0xa1c9('0x16')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0xa1c9('0x31')](_0x5f3084[_0xa1c9('0x2d')][_0xa1c9('0x2d')])||_0x5f3084[_0xa1c9('0x2d')][_0xa1c9('0x2d')]===''){return _0x114a21(_0x1562f8[_0xa1c9('0x16')](0x1f4,_0xa1c9('0x32')));}if(_[_0xa1c9('0x31')](_0x5f3084[_0xa1c9('0x2d')][_0xa1c9('0x33')])){return _0x114a21(_0x1562f8['error'](0x1f4,_0xa1c9('0x34')+_0x19d1aa));}if(!_[_0xa1c9('0x35')](_0x19d1aa,_0x5f3084[_0xa1c9('0x2d')][_0xa1c9('0x33')])){return _0x114a21(_0x1562f8[_0xa1c9('0x16')](0x1f4,_0xa1c9('0x36')+_0x19d1aa));}var _0x227e94={};_0x227e94[_0x5f3084[_0xa1c9('0x2d')][_0xa1c9('0x33')]]=_0x5f3084['body'][_0xa1c9('0x37')];return db[_0xa1c9('0x1c')]['find']({'where':{'id':_0x5f3084[_0xa1c9('0x38')]['id']},'include':[{'model':db[_0xa1c9('0x39')],'as':'List','include':[{'model':db[_0xa1c9('0x3a')],'as':_0xa1c9('0x3b'),'where':_0x227e94,'limit':0x1,'order':[[_0xa1c9('0x3c'),_0xa1c9('0x3d')]]}]},{'model':db['MailApplication'],'as':_0xa1c9('0x3e')},{'model':db['MailServerOut'],'as':_0xa1c9('0x3f'),'include':[{'model':db['CloudProvider'],'as':_0xa1c9('0x40')}]}]})[_0xa1c9('0x25')](function(_0x6d28a1){if(_0x6d28a1&&_0x6d28a1[_0xa1c9('0x41')]){var _0x226a65=_0x6d28a1[_0xa1c9('0x42')]({'plain':!![]});_0x313ec7[_0xa1c9('0x38')]=_[_0xa1c9('0x43')](_0x226a65,[_0xa1c9('0x3e'),_0xa1c9('0x41')]);_0x313ec7[_0xa1c9('0x38')][_0xa1c9('0x2b')]=_0x6d28a1[_0xa1c9('0x44')]();_0x313ec7[_0xa1c9('0x45')]=_0x226a65[_0xa1c9('0x3e')];_0x313ec7['list']=_0x226a65[_0xa1c9('0x41')];_0x313ec7[_0xa1c9('0x45')]=_[_0xa1c9('0x46')](_0x313ec7[_0xa1c9('0x45')],['priority'],[_0xa1c9('0x47')]);if(_0x313ec7[_0xa1c9('0x38')]&&_0x313ec7[_0xa1c9('0x38')][_0xa1c9('0x48')]){_0x313ec7['applications'][_0xa1c9('0x49')]({'id':0x0,'priority':_0x313ec7[_0xa1c9('0x45')][_0xa1c9('0x4a')]+0x1,'app':_0xa1c9('0x4b'),'appdata':_0xa1c9('0x48'),'interval':_0xa1c9('0x4c')});}if(_0x313ec7['account'][_0xa1c9('0x3e')]){delete _0x313ec7[_0xa1c9('0x38')][_0xa1c9('0x3e')];}if(_0x313ec7[_0xa1c9('0x38')][_0xa1c9('0x41')]){delete _0x313ec7[_0xa1c9('0x38')]['List'];}if(_0x226a65['List'][_0xa1c9('0x3b')]['length']){return _0x226a65['List'][_0xa1c9('0x3b')][0x0];}var _0xe162c1=_[_0xa1c9('0xa')](_0x5f3084['body'],{'firstName':_0x5f3084['body'][_0xa1c9('0x37')],'ListId':_0x226a65['ListId']});_0xe162c1[_0x5f3084[_0xa1c9('0x2d')][_0xa1c9('0x33')]]=_0x5f3084[_0xa1c9('0x2d')]['from'];return db[_0xa1c9('0x3a')][_0xa1c9('0x4d')](_0xe162c1);}else{throw new Error(_0xa1c9('0x4e'));}})[_0xa1c9('0x25')](function(_0x5ea7be){_0x313ec7['contact']=_0x5ea7be;if(_0x5ea7be){if(!_0x5f3084[_0xa1c9('0x2d')]['message'][_0xa1c9('0x4f')]){_0x5f3084['body'][_0xa1c9('0x18')][_0xa1c9('0x4f')]=rs[_0xa1c9('0x50')]()+'\x20'+_0x5f3084[_0xa1c9('0x2d')]['message'][_0xa1c9('0x37')];}var _0x519d0f={'ContactId':_0x5ea7be['id'],'MailAccountId':_0x5f3084[_0xa1c9('0x38')]['id'],'inReplyTo':_0x5f3084[_0xa1c9('0x2d')][_0xa1c9('0x18')][_0xa1c9('0x4f')],'to':_0x5f3084[_0xa1c9('0x2d')][_0xa1c9('0x18')][_0xa1c9('0x37')],'cc':_0x5f3084[_0xa1c9('0x2d')][_0xa1c9('0x18')]['cc'],'subject':_0x5f3084[_0xa1c9('0x2d')][_0xa1c9('0x18')][_0xa1c9('0x51')],'attach':_0x5f3084[_0xa1c9('0x2d')][_0xa1c9('0x18')]['attach'],'lastMsgAt':moment()['format'](_0xa1c9('0x52')),'lastMsgDirection':'in'};return db[_0xa1c9('0x53')][_0xa1c9('0x27')]({'where':{'closed':![],'MailAccountId':_0x5f3084[_0xa1c9('0x38')]['id']},'include':[{'model':db[_0xa1c9('0x54')],'as':_0xa1c9('0x55'),'attributes':[_0xa1c9('0x4f')],'where':{'messageId':_0x5f3084[_0xa1c9('0x2d')]['message'][_0xa1c9('0x56')]}}]})[_0xa1c9('0x25')](function(_0x8e6b90){if(_0x8e6b90){return[_0x8e6b90,![]];}return db[_0xa1c9('0x53')]['create'](_0x519d0f)[_0xa1c9('0x25')](function(_0x423a34){return[_0x423a34,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xa1c9('0x57')](function(_0x13f428,_0x25bc30){if(_0x13f428){_0x550872=_0x25bc30;if(!_0x25bc30){return _0x13f428['update']({'inReplyTo':_0x5f3084[_0xa1c9('0x2d')]['message'][_0xa1c9('0x4f')],'to':_0x5f3084[_0xa1c9('0x2d')][_0xa1c9('0x18')][_0xa1c9('0x37')],'cc':_0x5f3084[_0xa1c9('0x2d')][_0xa1c9('0x18')]['cc'],'subject':_0x5f3084['body'][_0xa1c9('0x18')]['subject'],'attach':_0x13f428[_0xa1c9('0x58')]?_0x13f428['attach']:_0x5f3084[_0xa1c9('0x2d')][_0xa1c9('0x18')][_0xa1c9('0x58')],'substatus':null,'substatusAt':moment()[_0xa1c9('0x59')](_0xa1c9('0x52')),'lastMsgAt':moment()[_0xa1c9('0x59')](_0xa1c9('0x52')),'lastMsgDirection':'in'});}else{return _0x13f428;}}})[_0xa1c9('0x25')](function(_0x2852ae){_0x313ec7['interaction']=_0x2852ae['get']({'plain':!![]});_0x313ec7['interaction'][_0xa1c9('0x5a')]=_0x550872;return db[_0xa1c9('0x54')][_0xa1c9('0x4d')]({'body':_0x5f3084[_0xa1c9('0x2d')][_0xa1c9('0x2d')],'MailAccountId':_0x5f3084['account']['id'],'MailInteractionId':_0x2852ae['id'],'direction':'in','ContactId':_0x313ec7['contact']['id'],'messageId':_0x5f3084[_0xa1c9('0x2d')][_0xa1c9('0x18')][_0xa1c9('0x4f')],'from':_0x5f3084[_0xa1c9('0x2d')][_0xa1c9('0x18')][_0xa1c9('0x37')],'to':_0x5f3084[_0xa1c9('0x2d')][_0xa1c9('0x18')]['to'],'cc':_0x5f3084['body']['message']['cc'],'subject':_0x5f3084['body'][_0xa1c9('0x18')][_0xa1c9('0x51')],'attach':_0x5f3084[_0xa1c9('0x2d')][_0xa1c9('0x18')][_0xa1c9('0x58')],'Attachments':_0x5f3084[_0xa1c9('0x2d')][_0xa1c9('0x18')][_0xa1c9('0x5b')],'originTo':_0x5f3084[_0xa1c9('0x2d')][_0xa1c9('0x18')][_0xa1c9('0x5c')],'originCc':_0x5f3084[_0xa1c9('0x2d')][_0xa1c9('0x18')][_0xa1c9('0x5d')],'bcc':_0x5f3084[_0xa1c9('0x2d')][_0xa1c9('0x18')][_0xa1c9('0x5e')],'ChatWebsiteId':_0x5f3084[_0xa1c9('0x2d')]['message'][_0xa1c9('0x5f')]||null,'originChannel':_0x5f3084[_0xa1c9('0x2d')][_0xa1c9('0x18')]['originChannel']||'Email','ChatOfflineMessageId':_0x5f3084[_0xa1c9('0x2d')][_0xa1c9('0x18')][_0xa1c9('0x60')]||null},{'include':[{'model':db[_0xa1c9('0x61')],'as':_0xa1c9('0x62')}]});})[_0xa1c9('0x25')](function(_0x21099a){_0x313ec7['message']=_0x21099a;if(!_0x313ec7[_0xa1c9('0x63')][_0xa1c9('0x64')]){return;}return db['User']['find']({'attributes':['id',_0xa1c9('0x65')],'where':{'id':_0x313ec7[_0xa1c9('0x63')][_0xa1c9('0x64')]}});})['then'](function(_0x168d20){if(_0x168d20){_0x313ec7[_0xa1c9('0x45')][_0xa1c9('0x66')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x168d20['name']+','+(_0x313ec7[_0xa1c9('0x38')][_0xa1c9('0x67')]||0xa),'interval':'*,*,*,*'});}if(!_0x313ec7['interaction']['queueId']){return;}return db[_0xa1c9('0x68')]['find']({'attributes':['id',_0xa1c9('0x65')],'where':{'id':_0x313ec7[_0xa1c9('0x63')]['queueId']}});})[_0xa1c9('0x25')](function(_0x3ca392){if(_0x3ca392){_0x313ec7['applications'][_0xa1c9('0x66')]({'id':0x0,'priority':0x1,'app':_0xa1c9('0x69'),'appdata':_0x3ca392[_0xa1c9('0x65')]+','+(_0x313ec7[_0xa1c9('0x38')][_0xa1c9('0x6a')]||0x12c),'interval':_0xa1c9('0x4c')});}return respondWithRpcPromise(_0xa1c9('0x6b'),_0xa1c9('0x6c'),_0x313ec7);})['then'](function(_0x51ef57){_0x4c1a9e(_0x51ef57);})[_0xa1c9('0x1a')](function(_0x5b7df9){_0x114a21(_0x1562f8[_0xa1c9('0x16')](0x1f4,_0x5b7df9[_0xa1c9('0x18')]));});});}; \ No newline at end of file +var _0xa1f6=['catch','GetMailAccount','MailAccount','findAll','options','where','attributes','include','map','model','debug','ShowMailAccount','raw','smtp','smtpOptions','getSmtpOptions','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','CmList','Contacts','DESC','MailApplication','Applications','Smtp','CloudProvider','List','get','omit','applications','list','orderBy','asc','account','push','close','autoclose','*,*,*,*','length','List\x20not\x20found','contact','messageId','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','create','Contact\x20not\x20found','spread','interaction','created','attachments','originTo','originCc','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachments','name','UserId','unshift','agent','waitForTheAssignedAgent','queueId','waitForTheAssignedQueue','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result'];(function(_0x2a0e29,_0x328670){var _0x1c0c4e=function(_0x5ababa){while(--_0x5ababa){_0x2a0e29['push'](_0x2a0e29['shift']());}};_0x1c0c4e(++_0x328670);}(_0xa1f6,0x19d));var _0x6a1f=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0xa1f6[_0x101e7b];return _0x4995c0;};'use strict';var _=require(_0x6a1f('0x0'));var moment=require(_0x6a1f('0x1'));var BPromise=require(_0x6a1f('0x2'));var rs=require(_0x6a1f('0x3'));var Redis=require(_0x6a1f('0x4'));var db=require(_0x6a1f('0x5'))['db'];var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x6a1f('0x6')]({'port':0x232c});config[_0x6a1f('0x7')]=_[_0x6a1f('0x8')](config[_0x6a1f('0x7')],{'host':_0x6a1f('0x9'),'port':0x18eb});var socket=require(_0x6a1f('0xa'))(new Redis(config[_0x6a1f('0x7')]));require('./mailAccount.socket')[_0x6a1f('0xb')](socket);function respondWithRpcPromise(_0x2950ff,_0x2300b1,_0x287e54){return new BPromise(function(_0x1617b7,_0x5aafd2){return client[_0x6a1f('0xc')](_0x2950ff,_0x287e54)[_0x6a1f('0xd')](function(_0x32a1be){logger[_0x6a1f('0xe')]('MailAccount,\x20%s,\x20%s',_0x2300b1,_0x6a1f('0xf'));logger['debug'](_0x6a1f('0x10'),_0x2300b1,_0x6a1f('0xf'),JSON[_0x6a1f('0x11')](_0x32a1be));if(_0x32a1be[_0x6a1f('0x12')]){if(_0x32a1be[_0x6a1f('0x12')][_0x6a1f('0x13')]===0x1f4){logger[_0x6a1f('0x12')](_0x6a1f('0x14'),_0x2300b1,_0x32a1be[_0x6a1f('0x12')][_0x6a1f('0x15')]);return _0x5aafd2(_0x32a1be[_0x6a1f('0x12')][_0x6a1f('0x15')]);}logger[_0x6a1f('0x12')](_0x6a1f('0x14'),_0x2300b1,_0x32a1be[_0x6a1f('0x12')][_0x6a1f('0x15')]);return _0x1617b7(_0x32a1be[_0x6a1f('0x12')][_0x6a1f('0x15')]);}else{logger[_0x6a1f('0xe')]('MailAccount,\x20%s,\x20%s',_0x2300b1,_0x6a1f('0xf'));_0x1617b7(_0x32a1be[_0x6a1f('0x16')][_0x6a1f('0x15')]);}})[_0x6a1f('0x17')](function(_0x21d268){logger[_0x6a1f('0x12')](_0x6a1f('0x14'),_0x2300b1,_0x21d268);_0x5aafd2(_0x21d268);});});}exports[_0x6a1f('0x18')]=function(_0x5cb044){var _0x640321=this;return new Promise(function(_0x5100f2,_0x203f99){return db[_0x6a1f('0x19')][_0x6a1f('0x1a')]({'raw':_0x5cb044[_0x6a1f('0x1b')]?_0x5cb044[_0x6a1f('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x5cb044[_0x6a1f('0x1b')]?_0x5cb044[_0x6a1f('0x1b')][_0x6a1f('0x1c')]||null:null,'attributes':_0x5cb044[_0x6a1f('0x1b')]?_0x5cb044[_0x6a1f('0x1b')][_0x6a1f('0x1d')]||null:null,'limit':_0x5cb044[_0x6a1f('0x1b')]?_0x5cb044[_0x6a1f('0x1b')]['limit']||null:null,'include':_0x5cb044[_0x6a1f('0x1b')]?_0x5cb044[_0x6a1f('0x1b')]['include']?_['map'](_0x5cb044['options']['include'],function(_0x3ea158){return{'model':db[_0x3ea158['model']],'as':_0x3ea158['as'],'attributes':_0x3ea158['attributes'],'include':_0x3ea158[_0x6a1f('0x1e')]?_[_0x6a1f('0x1f')](_0x3ea158[_0x6a1f('0x1e')],function(_0x1e8db8){return{'model':db[_0x1e8db8[_0x6a1f('0x20')]],'as':_0x1e8db8['as'],'attributes':_0x1e8db8[_0x6a1f('0x1d')],'include':_0x1e8db8[_0x6a1f('0x1e')]?_[_0x6a1f('0x1f')](_0x1e8db8['include'],function(_0x3ca07c){return{'model':db[_0x3ca07c[_0x6a1f('0x20')]],'as':_0x3ca07c['as'],'attributes':_0x3ca07c[_0x6a1f('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1e951c){logger[_0x6a1f('0xe')](_0x6a1f('0x18'),_0x5cb044);logger[_0x6a1f('0x21')](_0x6a1f('0x18'),_0x5cb044,JSON[_0x6a1f('0x11')](_0x1e951c));_0x5100f2(_0x1e951c);})[_0x6a1f('0x17')](function(_0x58d879){logger['error'](_0x6a1f('0x18'),_0x58d879[_0x6a1f('0x15')],_0x5cb044);_0x203f99(_0x640321[_0x6a1f('0x12')](0x1f4,_0x58d879[_0x6a1f('0x15')]));});});};exports[_0x6a1f('0x22')]=function(_0x2ad1d2){var _0x35e5ab=this;return new Promise(function(_0x4cdc6c,_0x3d0f3c){return db[_0x6a1f('0x19')]['find']({'raw':_0x2ad1d2[_0x6a1f('0x1b')]?_0x2ad1d2[_0x6a1f('0x1b')][_0x6a1f('0x23')]===undefined?!![]:![]:!![],'where':_0x2ad1d2['options']?_0x2ad1d2['options'][_0x6a1f('0x1c')]||null:null,'attributes':_0x2ad1d2[_0x6a1f('0x1b')]?_0x2ad1d2[_0x6a1f('0x1b')]['attributes']||null:null,'include':_0x2ad1d2['options']?_0x2ad1d2[_0x6a1f('0x1b')][_0x6a1f('0x1e')]?_[_0x6a1f('0x1f')](_0x2ad1d2[_0x6a1f('0x1b')][_0x6a1f('0x1e')],function(_0xce3845){return{'model':db[_0xce3845[_0x6a1f('0x20')]],'as':_0xce3845['as'],'attributes':_0xce3845['attributes'],'include':_0xce3845[_0x6a1f('0x1e')]?_['map'](_0xce3845[_0x6a1f('0x1e')],function(_0x13057b){return{'model':db[_0x13057b['model']],'as':_0x13057b['as'],'attributes':_0x13057b[_0x6a1f('0x1d')],'include':_0x13057b[_0x6a1f('0x1e')]?_['map'](_0x13057b[_0x6a1f('0x1e')],function(_0x48c033){return{'model':db[_0x48c033[_0x6a1f('0x20')]],'as':_0x48c033['as'],'attributes':_0x48c033['attributes']};}):[]};}):[]};}):[]:[]})[_0x6a1f('0xd')](function(_0x51ba55){if(_0x2ad1d2[_0x6a1f('0x1b')][_0x6a1f('0x24')]===!![])_0x51ba55['setDataValue'](_0x6a1f('0x25'),_0x51ba55[_0x6a1f('0x26')]());logger['info']('ShowMailAccount',_0x2ad1d2);logger[_0x6a1f('0x21')](_0x6a1f('0x22'),_0x2ad1d2,JSON[_0x6a1f('0x11')](_0x51ba55));_0x4cdc6c(_0x51ba55);})[_0x6a1f('0x17')](function(_0x1063d8){logger[_0x6a1f('0x12')]('ShowMailAccount',_0x1063d8[_0x6a1f('0x15')],_0x2ad1d2);_0x3d0f3c(_0x35e5ab[_0x6a1f('0x12')](0x1f4,_0x1063d8[_0x6a1f('0x15')]));});});};exports[_0x6a1f('0x27')]=function(_0xfbb784){var _0x2a6d96=this;return new Promise(function(_0x27be0a,_0x3bb4ec){var _0x16aef7={'body':_0xfbb784[_0x6a1f('0x28')],'channel':_0x6a1f('0x29')};var _0x5b3a49=_[_0x6a1f('0x2a')](_[_0x6a1f('0x2b')](db[_0x6a1f('0x2c')][_0x6a1f('0x2d')]),[_0x6a1f('0x2e'),_0x6a1f('0x2f'),'CompanyId',_0x6a1f('0x30')]);var _0x482c3a=![];if(_0xfbb784[_0x6a1f('0x28')]['id']){delete _0xfbb784[_0x6a1f('0x28')]['id'];}if(_[_0x6a1f('0x31')](_0xfbb784[_0x6a1f('0x28')][_0x6a1f('0x32')])){return _0x3bb4ec(_0x2a6d96[_0x6a1f('0x12')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x6a1f('0x31')](_0xfbb784[_0x6a1f('0x28')][_0x6a1f('0x28')])||_0xfbb784[_0x6a1f('0x28')][_0x6a1f('0x28')]===''){return _0x3bb4ec(_0x2a6d96[_0x6a1f('0x12')](0x1f4,_0x6a1f('0x33')));}if(_[_0x6a1f('0x31')](_0xfbb784[_0x6a1f('0x28')][_0x6a1f('0x34')])){return _0x3bb4ec(_0x2a6d96['error'](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5b3a49));}if(!_['includes'](_0x5b3a49,_0xfbb784[_0x6a1f('0x28')][_0x6a1f('0x34')])){return _0x3bb4ec(_0x2a6d96[_0x6a1f('0x12')](0x1f4,_0x6a1f('0x35')+_0x5b3a49));}var _0x143aaa={};_0x143aaa[_0xfbb784[_0x6a1f('0x28')]['mapKey']]=_0xfbb784[_0x6a1f('0x28')]['from'];return db[_0x6a1f('0x19')][_0x6a1f('0x36')]({'where':{'id':_0xfbb784['account']['id']},'include':[{'model':db[_0x6a1f('0x37')],'as':'List','include':[{'model':db[_0x6a1f('0x2c')],'as':_0x6a1f('0x38'),'where':_0x143aaa,'limit':0x1,'order':[[_0x6a1f('0x2f'),_0x6a1f('0x39')]]}]},{'model':db[_0x6a1f('0x3a')],'as':_0x6a1f('0x3b')},{'model':db['MailServerOut'],'as':_0x6a1f('0x3c'),'include':[{'model':db[_0x6a1f('0x3d')],'as':_0x6a1f('0x3d')}]}]})[_0x6a1f('0xd')](function(_0x34fa17){if(_0x34fa17&&_0x34fa17[_0x6a1f('0x3e')]){var _0x4657ec=_0x34fa17[_0x6a1f('0x3f')]({'plain':!![]});_0x16aef7['account']=_[_0x6a1f('0x40')](_0x4657ec,[_0x6a1f('0x3b'),_0x6a1f('0x3e')]);_0x16aef7['account'][_0x6a1f('0x25')]=_0x34fa17['getSmtpOptions']();_0x16aef7[_0x6a1f('0x41')]=_0x4657ec['Applications'];_0x16aef7[_0x6a1f('0x42')]=_0x4657ec['List'];_0x16aef7[_0x6a1f('0x41')]=_[_0x6a1f('0x43')](_0x16aef7[_0x6a1f('0x41')],['priority'],[_0x6a1f('0x44')]);if(_0x16aef7['account']&&_0x16aef7[_0x6a1f('0x45')]['autoclose']){_0x16aef7['applications'][_0x6a1f('0x46')]({'id':0x0,'priority':_0x16aef7[_0x6a1f('0x41')]['length']+0x1,'app':_0x6a1f('0x47'),'appdata':_0x6a1f('0x48'),'interval':_0x6a1f('0x49')});}if(_0x16aef7['account'][_0x6a1f('0x3b')]){delete _0x16aef7[_0x6a1f('0x45')][_0x6a1f('0x3b')];}if(_0x16aef7[_0x6a1f('0x45')][_0x6a1f('0x3e')]){delete _0x16aef7[_0x6a1f('0x45')]['List'];}if(_0x4657ec[_0x6a1f('0x3e')][_0x6a1f('0x38')][_0x6a1f('0x4a')]){return _0x4657ec[_0x6a1f('0x3e')][_0x6a1f('0x38')][0x0];}var _0x5b27de=_['defaults'](_0xfbb784[_0x6a1f('0x28')],{'firstName':_0xfbb784['body'][_0x6a1f('0x32')],'ListId':_0x4657ec[_0x6a1f('0x30')]});_0x5b27de[_0xfbb784[_0x6a1f('0x28')][_0x6a1f('0x34')]]=_0xfbb784[_0x6a1f('0x28')]['from'];return db[_0x6a1f('0x2c')]['create'](_0x5b27de);}else{throw new Error(_0x6a1f('0x4b'));}})[_0x6a1f('0xd')](function(_0xfa8e60){_0x16aef7[_0x6a1f('0x4c')]=_0xfa8e60;if(_0xfa8e60){if(!_0xfbb784[_0x6a1f('0x28')][_0x6a1f('0x15')]['messageId']){_0xfbb784[_0x6a1f('0x28')]['message']['messageId']=rs['generate']()+'\x20'+_0xfbb784[_0x6a1f('0x28')][_0x6a1f('0x15')]['from'];}var _0x1fc8ae={'ContactId':_0xfa8e60['id'],'MailAccountId':_0xfbb784[_0x6a1f('0x45')]['id'],'inReplyTo':_0xfbb784[_0x6a1f('0x28')]['message'][_0x6a1f('0x4d')],'to':_0xfbb784['body'][_0x6a1f('0x15')][_0x6a1f('0x32')],'cc':_0xfbb784[_0x6a1f('0x28')]['message']['cc'],'subject':_0xfbb784[_0x6a1f('0x28')][_0x6a1f('0x15')][_0x6a1f('0x4e')],'attach':_0xfbb784[_0x6a1f('0x28')][_0x6a1f('0x15')][_0x6a1f('0x4f')],'lastMsgAt':moment()[_0x6a1f('0x50')](_0x6a1f('0x51')),'lastMsgDirection':'in'};return db[_0x6a1f('0x52')][_0x6a1f('0x36')]({'where':{'closed':![],'MailAccountId':_0xfbb784[_0x6a1f('0x45')]['id']},'include':[{'model':db[_0x6a1f('0x53')],'as':_0x6a1f('0x54'),'attributes':[_0x6a1f('0x4d')],'where':{'messageId':_0xfbb784['body'][_0x6a1f('0x15')][_0x6a1f('0x55')]}}]})['then'](function(_0x258a3a){if(_0x258a3a){return[_0x258a3a,![]];}return db[_0x6a1f('0x52')][_0x6a1f('0x56')](_0x1fc8ae)[_0x6a1f('0xd')](function(_0x4322a4){return[_0x4322a4,!![]];});});}else{throw new Error(_0x6a1f('0x57'));}})[_0x6a1f('0x58')](function(_0xb2f609,_0x3aaf8d){if(_0xb2f609){_0x482c3a=_0x3aaf8d;if(!_0x3aaf8d){return _0xb2f609['update']({'inReplyTo':_0xfbb784[_0x6a1f('0x28')][_0x6a1f('0x15')]['messageId'],'to':_0xfbb784['body'][_0x6a1f('0x15')][_0x6a1f('0x32')],'cc':_0xfbb784[_0x6a1f('0x28')][_0x6a1f('0x15')]['cc'],'subject':_0xfbb784[_0x6a1f('0x28')][_0x6a1f('0x15')][_0x6a1f('0x4e')],'attach':_0xb2f609[_0x6a1f('0x4f')]?_0xb2f609['attach']:_0xfbb784[_0x6a1f('0x28')][_0x6a1f('0x15')]['attach'],'substatus':null,'substatusAt':moment()[_0x6a1f('0x50')](_0x6a1f('0x51')),'lastMsgAt':moment()[_0x6a1f('0x50')](_0x6a1f('0x51')),'lastMsgDirection':'in'});}else{return _0xb2f609;}}})['then'](function(_0x205e22){_0x16aef7[_0x6a1f('0x59')]=_0x205e22['get']({'plain':!![]});_0x16aef7[_0x6a1f('0x59')][_0x6a1f('0x5a')]=_0x482c3a;return db['MailMessage']['create']({'body':_0xfbb784[_0x6a1f('0x28')][_0x6a1f('0x28')],'MailAccountId':_0xfbb784[_0x6a1f('0x45')]['id'],'MailInteractionId':_0x205e22['id'],'direction':'in','ContactId':_0x16aef7[_0x6a1f('0x4c')]['id'],'messageId':_0xfbb784[_0x6a1f('0x28')][_0x6a1f('0x15')][_0x6a1f('0x4d')],'from':_0xfbb784['body'][_0x6a1f('0x15')][_0x6a1f('0x32')],'to':_0xfbb784[_0x6a1f('0x28')][_0x6a1f('0x15')]['to'],'cc':_0xfbb784[_0x6a1f('0x28')][_0x6a1f('0x15')]['cc'],'subject':_0xfbb784['body'][_0x6a1f('0x15')][_0x6a1f('0x4e')],'attach':_0xfbb784[_0x6a1f('0x28')][_0x6a1f('0x15')][_0x6a1f('0x4f')],'Attachments':_0xfbb784[_0x6a1f('0x28')][_0x6a1f('0x15')][_0x6a1f('0x5b')],'originTo':_0xfbb784[_0x6a1f('0x28')][_0x6a1f('0x15')][_0x6a1f('0x5c')],'originCc':_0xfbb784[_0x6a1f('0x28')]['message'][_0x6a1f('0x5d')],'bcc':_0xfbb784[_0x6a1f('0x28')][_0x6a1f('0x15')][_0x6a1f('0x5e')],'ChatWebsiteId':_0xfbb784[_0x6a1f('0x28')][_0x6a1f('0x15')][_0x6a1f('0x5f')]||null,'originChannel':_0xfbb784[_0x6a1f('0x28')][_0x6a1f('0x15')][_0x6a1f('0x60')]||_0x6a1f('0x61'),'ChatOfflineMessageId':_0xfbb784[_0x6a1f('0x28')][_0x6a1f('0x15')][_0x6a1f('0x62')]||null},{'include':[{'model':db['Attachment'],'as':_0x6a1f('0x63')}]});})['then'](function(_0x4f4f27){_0x16aef7[_0x6a1f('0x15')]=_0x4f4f27;if(!_0x16aef7['interaction']['UserId']){return;}return db['User']['find']({'attributes':['id',_0x6a1f('0x64')],'where':{'id':_0x16aef7[_0x6a1f('0x59')][_0x6a1f('0x65')]}});})[_0x6a1f('0xd')](function(_0x311e61){if(_0x311e61){_0x16aef7[_0x6a1f('0x41')][_0x6a1f('0x66')]({'id':0x0,'priority':0x0,'app':_0x6a1f('0x67'),'appdata':_0x311e61[_0x6a1f('0x64')]+','+(_0x16aef7[_0x6a1f('0x45')][_0x6a1f('0x68')]||0xa),'interval':_0x6a1f('0x49')});}if(!_0x16aef7['interaction'][_0x6a1f('0x69')]){return;}return db['MailQueue'][_0x6a1f('0x36')]({'attributes':['id','name'],'where':{'id':_0x16aef7[_0x6a1f('0x59')][_0x6a1f('0x69')]}});})['then'](function(_0x217f68){if(_0x217f68){_0x16aef7[_0x6a1f('0x41')]['unshift']({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x217f68[_0x6a1f('0x64')]+','+(_0x16aef7[_0x6a1f('0x45')][_0x6a1f('0x6a')]||0x12c),'interval':_0x6a1f('0x49')});}return respondWithRpcPromise(_0x6a1f('0x6b'),_0x6a1f('0x6c'),_0x16aef7);})['then'](function(_0x555acd){_0x27be0a(_0x555acd);})['catch'](function(_0x5f00c6){_0x3bb4ec(_0x2a6d96['error'](0x1f4,_0x5f00c6[_0x6a1f('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 49d2a1a..03f7fe6 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 _0xa203=['register','length','mailAccount:','./mailAccount.events','save','remove','update','emit','removeListener'];(function(_0x3eb972,_0xf0a068){var _0x35af78=function(_0x1faacd){while(--_0x1faacd){_0x3eb972['push'](_0x3eb972['shift']());}};_0x35af78(++_0xf0a068);}(_0xa203,0xdb));var _0x3a20=function(_0xa825a3,_0x294848){_0xa825a3=_0xa825a3-0x0;var _0x1383b2=_0xa203[_0xa825a3];return _0x1383b2;};'use strict';var MailAccountEvents=require(_0x3a20('0x0'));var events=[_0x3a20('0x1'),_0x3a20('0x2'),_0x3a20('0x3')];function createListener(_0x5c4af3,_0x119794){return function(_0x9cb59e){_0x119794[_0x3a20('0x4')](_0x5c4af3,_0x9cb59e);};}function removeListener(_0x5ab836,_0x1608b6){return function(){MailAccountEvents[_0x3a20('0x5')](_0x5ab836,_0x1608b6);};}exports[_0x3a20('0x6')]=function(_0x16efb3){for(var _0x4018a7=0x0,_0xd8d9fa=events[_0x3a20('0x7')];_0x4018a7<_0xd8d9fa;_0x4018a7++){var _0x3370c7=events[_0x4018a7];var _0x56c175=createListener(_0x3a20('0x8')+_0x3370c7,_0x16efb3);MailAccountEvents['on'](_0x3370c7,_0x56c175);}}; \ No newline at end of file +var _0xe667=['register','length','save','remove','update','emit','removeListener'];(function(_0x4b0ce3,_0x1a589f){var _0x4d9b93=function(_0x53a0a9){while(--_0x53a0a9){_0x4b0ce3['push'](_0x4b0ce3['shift']());}};_0x4d9b93(++_0x1a589f);}(_0xe667,0x17c));var _0x7e66=function(_0x4e235d,_0x30dd48){_0x4e235d=_0x4e235d-0x0;var _0xc2c993=_0xe667[_0x4e235d];return _0xc2c993;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0x7e66('0x0'),_0x7e66('0x1'),_0x7e66('0x2')];function createListener(_0x2593ea,_0x3c47d7){return function(_0x43f2bb){_0x3c47d7[_0x7e66('0x3')](_0x2593ea,_0x43f2bb);};}function removeListener(_0x354f57,_0x176db3){return function(){MailAccountEvents[_0x7e66('0x4')](_0x354f57,_0x176db3);};}exports[_0x7e66('0x5')]=function(_0x32789e){for(var _0x2f8e29=0x0,_0x3ba29a=events[_0x7e66('0x6')];_0x2f8e29<_0x3ba29a;_0x2f8e29++){var _0x23417f=events[_0x2f8e29];var _0x19e707=createListener('mailAccount:'+_0x23417f,_0x32789e);MailAccountEvents['on'](_0x23417f,_0x19e707);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 14bcaeb..02d5c17 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 _0x684f=['/:id','delete','isAuthenticated','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailApplication.controller','show','put'];(function(_0x164db8,_0x3fb7ce){var _0x1aa718=function(_0xfa68b0){while(--_0xfa68b0){_0x164db8['push'](_0x164db8['shift']());}};_0x1aa718(++_0x3fb7ce);}(_0x684f,0xa8));var _0xf684=function(_0x17bdab,_0x199650){_0x17bdab=_0x17bdab-0x0;var _0x4e2989=_0x684f[_0x17bdab];return _0x4e2989;};'use strict';var multer=require(_0xf684('0x0'));var util=require(_0xf684('0x1'));var path=require(_0xf684('0x2'));var timeout=require(_0xf684('0x3'));var express=require(_0xf684('0x4'));var router=express[_0xf684('0x5')]();var fs_extra=require(_0xf684('0x6'));var auth=require(_0xf684('0x7'));var interaction=require(_0xf684('0x8'));var config=require('../../config/environment');var controller=require(_0xf684('0x9'));router['get']('/:id',auth['isAuthenticated'](),controller[_0xf684('0xa')]);router[_0xf684('0xb')](_0xf684('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xf684('0xd')](_0xf684('0xc'),auth[_0xf684('0xe')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x8586=['get','/:id','isAuthenticated','put','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller'];(function(_0x258ce6,_0x272cfb){var _0x4b63fa=function(_0x55ddde){while(--_0x55ddde){_0x258ce6['push'](_0x258ce6['shift']());}};_0x4b63fa(++_0x272cfb);}(_0x8586,0x1e3));var _0x6858=function(_0x2a9548,_0x2742f6){_0x2a9548=_0x2a9548-0x0;var _0xf55c55=_0x8586[_0x2a9548];return _0xf55c55;};'use strict';var multer=require(_0x6858('0x0'));var util=require(_0x6858('0x1'));var path=require(_0x6858('0x2'));var timeout=require('connect-timeout');var express=require(_0x6858('0x3'));var router=express[_0x6858('0x4')]();var fs_extra=require(_0x6858('0x5'));var auth=require(_0x6858('0x6'));var interaction=require(_0x6858('0x7'));var config=require(_0x6858('0x8'));var controller=require(_0x6858('0x9'));router[_0x6858('0xa')](_0x6858('0xb'),auth[_0x6858('0xc')](),controller['show']);router[_0x6858('0xd')](_0x6858('0xb'),auth[_0x6858('0xc')](),controller['update']);router[_0x6858('0xe')](_0x6858('0xb'),auth[_0x6858('0xc')](),controller[_0x6858('0xf')]);module[_0x6858('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 078ba43..3ad3928 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 _0x197c=['sequelize','exports','INTEGER','STRING','noop'];(function(_0x5502d4,_0x4cf776){var _0x282ff4=function(_0x248944){while(--_0x248944){_0x5502d4['push'](_0x5502d4['shift']());}};_0x282ff4(++_0x4cf776);}(_0x197c,0x13b));var _0xc197=function(_0x29cc96,_0x39d612){_0x29cc96=_0x29cc96-0x0;var _0xd403ae=_0x197c[_0x29cc96];return _0xd403ae;};'use strict';var Sequelize=require(_0xc197('0x0'));module[_0xc197('0x1')]={'priority':{'type':Sequelize[_0xc197('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xc197('0x3')],'allowNull':![],'defaultValue':_0xc197('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xc197('0x3')]},'interval':{'type':Sequelize[_0xc197('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x4243=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x55bbfd,_0x3b79a9){var _0x13b979=function(_0x175014){while(--_0x175014){_0x55bbfd['push'](_0x55bbfd['shift']());}};_0x13b979(++_0x3b79a9);}(_0x4243,0x7d));var _0x3424=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4243[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3424('0x0'));module[_0x3424('0x1')]={'priority':{'type':Sequelize[_0x3424('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x3424('0x3')],'allowNull':![],'defaultValue':_0x3424('0x4')},'appdata':{'type':Sequelize[_0x3424('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x3424('0x3')],'defaultValue':_0x3424('0x6')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 3728ad3..80029db 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 _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(_0x2caf41,_0x5b398e){var _0x5ca4de=function(_0x5ae652){while(--_0x5ae652){_0x2caf41['push'](_0x2caf41['shift']());}};_0x5ca4de(++_0x5b398e);}(_0x9c44,0x178));var _0x49c4=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x9c44[_0x543084];return _0x306a57;};'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 +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(_0x22cc16,_0x1f4fa2){_0x22cc16=_0x22cc16-0x0;var _0x399b70=_0xaa88[_0x22cc16];return _0x399b70;};'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 diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index b3412ec..bae4e6c 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 _0x8f15=['request-promise','path','rimraf','./mailApplication.attributes','define','MailApplication','mail_applications','utf8mb4','util','../../config/logger','api','moment','bluebird'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x8f15,0x97));var _0x58f1=function(_0x17c3bb,_0x20327b){_0x17c3bb=_0x17c3bb-0x0;var _0x4faddc=_0x8f15[_0x17c3bb];return _0x4faddc;};'use strict';var _=require('lodash');var util=require(_0x58f1('0x0'));var logger=require(_0x58f1('0x1'))(_0x58f1('0x2'));var moment=require(_0x58f1('0x3'));var BPromise=require(_0x58f1('0x4'));var rp=require(_0x58f1('0x5'));var fs=require('fs');var path=require(_0x58f1('0x6'));var rimraf=require(_0x58f1('0x7'));var config=require('../../config/environment');var attributes=require(_0x58f1('0x8'));module['exports']=function(_0x6d62c9,_0x57a15c){return _0x6d62c9[_0x58f1('0x9')](_0x58f1('0xa'),attributes,{'tableName':_0x58f1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x58f1('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x9b2e=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./mailApplication.attributes','exports','define','MailApplication','utf8mb4'];(function(_0x1d39d2,_0x2c02f8){var _0x4cfc7d=function(_0x590e7a){while(--_0x590e7a){_0x1d39d2['push'](_0x1d39d2['shift']());}};_0x4cfc7d(++_0x2c02f8);}(_0x9b2e,0xef));var _0xe9b2=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x9b2e[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xe9b2('0x0'));var util=require(_0xe9b2('0x1'));var logger=require(_0xe9b2('0x2'))(_0xe9b2('0x3'));var moment=require(_0xe9b2('0x4'));var BPromise=require(_0xe9b2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe9b2('0x6'));var rimraf=require(_0xe9b2('0x7'));var config=require('../../config/environment');var attributes=require(_0xe9b2('0x8'));module[_0xe9b2('0x9')]=function(_0x44cca4,_0x374bb1){return _0x44cca4[_0xe9b2('0xa')](_0xe9b2('0xb'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe9b2('0xc'),'collate':_0xe9b2('0xd')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 0ebb94f..1244088 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 _0x511f=['debug','code','error','message','MailApplication','update','body','options','raw','where','limit','UpdateMailApplication','stringify','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x40988c,_0x162b7c){var _0x360c95=function(_0x301d04){while(--_0x301d04){_0x40988c['push'](_0x40988c['shift']());}};_0x360c95(++_0x162b7c);}(_0x511f,0x1de));var _0xf511=function(_0x4d4a7d,_0x216f61){_0x4d4a7d=_0x4d4a7d-0x0;var _0xa058e3=_0x511f[_0x4d4a7d];return _0xa058e3;};'use strict';var _=require(_0xf511('0x0'));var util=require('util');var moment=require(_0xf511('0x1'));var BPromise=require(_0xf511('0x2'));var rs=require(_0xf511('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf511('0x4'))['db'];var utils=require(_0xf511('0x5'));var logger=require(_0xf511('0x6'))(_0xf511('0x7'));var config=require(_0xf511('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf511('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x477b8b,_0x1507bc,_0x4eab5d){return new BPromise(function(_0x5bf030,_0x4bfbaa){return client[_0xf511('0xa')](_0x477b8b,_0x4eab5d)[_0xf511('0xb')](function(_0x453917){logger[_0xf511('0xc')](_0xf511('0xd'),_0x1507bc,_0xf511('0xe'));logger[_0xf511('0xf')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x1507bc,_0xf511('0xe'),JSON['stringify'](_0x453917));if(_0x453917['error']){if(_0x453917['error'][_0xf511('0x10')]===0x1f4){logger[_0xf511('0x11')](_0xf511('0xd'),_0x1507bc,_0x453917[_0xf511('0x11')][_0xf511('0x12')]);return _0x4bfbaa(_0x453917[_0xf511('0x11')][_0xf511('0x12')]);}logger[_0xf511('0x11')]('MailApplication,\x20%s,\x20%s',_0x1507bc,_0x453917['error'][_0xf511('0x12')]);return _0x5bf030(_0x453917[_0xf511('0x11')][_0xf511('0x12')]);}else{logger[_0xf511('0xc')](_0xf511('0xd'),_0x1507bc,_0xf511('0xe'));_0x5bf030(_0x453917['result'][_0xf511('0x12')]);}})['catch'](function(_0x4c1d43){logger['error'](_0xf511('0xd'),_0x1507bc,_0x4c1d43);_0x4bfbaa(_0x4c1d43);});});}exports['UpdateMailApplication']=function(_0x5085f2){var _0x377142=this;return new Promise(function(_0x59415f,_0x294696){return db[_0xf511('0x13')][_0xf511('0x14')](_0x5085f2[_0xf511('0x15')],{'raw':_0x5085f2[_0xf511('0x16')]?_0x5085f2[_0xf511('0x16')][_0xf511('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5085f2[_0xf511('0x16')]?_0x5085f2['options'][_0xf511('0x18')]||null:null,'attributes':_0x5085f2[_0xf511('0x16')]?_0x5085f2['options']['attributes']||null:null,'limit':_0x5085f2['options']?_0x5085f2[_0xf511('0x16')][_0xf511('0x19')]||null:null})['then'](function(_0x558866){logger['info'](_0xf511('0x1a'),_0x5085f2);logger['debug']('UpdateMailApplication',_0x5085f2,JSON[_0xf511('0x1b')](_0x558866));_0x59415f(_0x558866);})[_0xf511('0x1c')](function(_0x2c3a4c){logger[_0xf511('0x11')](_0xf511('0x1a'),_0x2c3a4c[_0xf511('0x12')],_0x5085f2);_0x294696(_0x377142[_0xf511('0x11')](0x1f4,_0x2c3a4c['message']));});});}; \ No newline at end of file +var _0x457c=['attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','code','error','MailApplication,\x20%s,\x20%s','message','result','catch','UpdateMailApplication','update','body','options','raw'];(function(_0x459963,_0x5a366a){var _0xbe84e3=function(_0x358999){while(--_0x358999){_0x459963['push'](_0x459963['shift']());}};_0xbe84e3(++_0x5a366a);}(_0x457c,0x162));var _0xc457=function(_0x7b7e55,_0x33bfe2){_0x7b7e55=_0x7b7e55-0x0;var _0x1c1bd7=_0x457c[_0x7b7e55];return _0x1c1bd7;};'use strict';var _=require(_0xc457('0x0'));var util=require(_0xc457('0x1'));var moment=require(_0xc457('0x2'));var BPromise=require(_0xc457('0x3'));var rs=require(_0xc457('0x4'));var fs=require('fs');var Redis=require(_0xc457('0x5'));var db=require(_0xc457('0x6'))['db'];var utils=require(_0xc457('0x7'));var logger=require(_0xc457('0x8'))(_0xc457('0x9'));var config=require(_0xc457('0xa'));var jayson=require(_0xc457('0xb'));var client=jayson['client'][_0xc457('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1c2bbd,_0x40b69b,_0x1c3410){return new BPromise(function(_0x2968f1,_0x1aac8d){return client[_0xc457('0xd')](_0x1c2bbd,_0x1c3410)[_0xc457('0xe')](function(_0x308574){logger[_0xc457('0xf')]('MailApplication,\x20%s,\x20%s',_0x40b69b,_0xc457('0x10'));logger[_0xc457('0x11')](_0xc457('0x12'),_0x40b69b,_0xc457('0x10'),JSON['stringify'](_0x308574));if(_0x308574['error']){if(_0x308574['error'][_0xc457('0x13')]===0x1f4){logger[_0xc457('0x14')](_0xc457('0x15'),_0x40b69b,_0x308574[_0xc457('0x14')][_0xc457('0x16')]);return _0x1aac8d(_0x308574[_0xc457('0x14')][_0xc457('0x16')]);}logger[_0xc457('0x14')]('MailApplication,\x20%s,\x20%s',_0x40b69b,_0x308574['error'][_0xc457('0x16')]);return _0x2968f1(_0x308574['error'][_0xc457('0x16')]);}else{logger[_0xc457('0xf')](_0xc457('0x15'),_0x40b69b,'request\x20sent');_0x2968f1(_0x308574[_0xc457('0x17')][_0xc457('0x16')]);}})[_0xc457('0x18')](function(_0x19f007){logger[_0xc457('0x14')](_0xc457('0x15'),_0x40b69b,_0x19f007);_0x1aac8d(_0x19f007);});});}exports[_0xc457('0x19')]=function(_0x19b3da){var _0x3c52c0=this;return new Promise(function(_0x254a94,_0x1c92d4){return db['MailApplication'][_0xc457('0x1a')](_0x19b3da[_0xc457('0x1b')],{'raw':_0x19b3da[_0xc457('0x1c')]?_0x19b3da[_0xc457('0x1c')][_0xc457('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19b3da[_0xc457('0x1c')]?_0x19b3da['options']['where']||null:null,'attributes':_0x19b3da['options']?_0x19b3da['options'][_0xc457('0x1e')]||null:null,'limit':_0x19b3da[_0xc457('0x1c')]?_0x19b3da[_0xc457('0x1c')][_0xc457('0x1f')]||null:null})[_0xc457('0xe')](function(_0x3ee0c6){logger['info']('UpdateMailApplication',_0x19b3da);logger['debug'](_0xc457('0x19'),_0x19b3da,JSON['stringify'](_0x3ee0c6));_0x254a94(_0x3ee0c6);})[_0xc457('0x18')](function(_0x150632){logger[_0xc457('0x14')](_0xc457('0x19'),_0x150632['message'],_0x19b3da);_0x1c92d4(_0x3c52c0[_0xc457('0x14')](0x1f4,_0x150632[_0xc457('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index d1e7ad4..86e7acf 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 _0x2f99=['/:id/messages','download','create','addMessage','post','/:id/tags','tracked','mail','mailinteraction:addtags','put','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','removeTags','exports','express','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','index','get','/describe','isAuthenticated','describe','/:id'];(function(_0x5d01ec,_0x17d179){var _0x10112e=function(_0x4176db){while(--_0x4176db){_0x5d01ec['push'](_0x5d01ec['shift']());}};_0x10112e(++_0x17d179);}(_0x2f99,0x7d));var _0x92f9=function(_0x3729c,_0x1b1faf){_0x3729c=_0x3729c-0x0;var _0x20ce1f=_0x2f99[_0x3729c];return _0x20ce1f;};'use strict';var express=require(_0x92f9('0x0'));var router=express['Router']();var auth=require(_0x92f9('0x1'));var interaction=require(_0x92f9('0x2'));var controller=require(_0x92f9('0x3'));router['get']('/',auth['isAuthenticated'](),controller[_0x92f9('0x4')]);router[_0x92f9('0x5')](_0x92f9('0x6'),auth[_0x92f9('0x7')](),controller[_0x92f9('0x8')]);router[_0x92f9('0x5')](_0x92f9('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x92f9('0x5')](_0x92f9('0xa'),auth['isAuthenticated'](),controller['getMessages']);router[_0x92f9('0x5')]('/:id/download',auth['isAuthenticated'](),controller[_0x92f9('0xb')]);router['post']('/',auth[_0x92f9('0x7')](),controller[_0x92f9('0xc')]);router['post'](_0x92f9('0xa'),auth['isAuthenticated'](),controller[_0x92f9('0xd')]);router[_0x92f9('0xe')](_0x92f9('0xf'),auth['isAuthenticated'](),interaction[_0x92f9('0x10')](_0x92f9('0x11'),_0x92f9('0x12')),controller['addTags']);router[_0x92f9('0x13')]('/:id',auth[_0x92f9('0x7')](),interaction[_0x92f9('0x10')](_0x92f9('0x11'),_0x92f9('0x14')),controller[_0x92f9('0x15')]);router[_0x92f9('0x16')](_0x92f9('0x9'),auth['isAuthenticated'](),interaction[_0x92f9('0x10')](_0x92f9('0x11'),_0x92f9('0x17')),controller[_0x92f9('0x18')]);router[_0x92f9('0x16')](_0x92f9('0xf'),auth[_0x92f9('0x7')](),controller[_0x92f9('0x19')]);module[_0x92f9('0x1a')]=router; \ No newline at end of file +var _0x2a7e=['post','/:id/messages','addMessage','tracked','mail','put','mailinteraction:update','update','mailinteraction:destroy','destroy','delete','/:id/tags','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMessages','download','create'];(function(_0x2ef548,_0x3f534f){var _0x3b1cb9=function(_0x319457){while(--_0x319457){_0x2ef548['push'](_0x2ef548['shift']());}};_0x3b1cb9(++_0x3f534f);}(_0x2a7e,0x9f));var _0xe2a7=function(_0x326974,_0x4444ca){_0x326974=_0x326974-0x0;var _0xf331c2=_0x2a7e[_0x326974];return _0xf331c2;};'use strict';var express=require(_0xe2a7('0x0'));var router=express[_0xe2a7('0x1')]();var auth=require(_0xe2a7('0x2'));var interaction=require(_0xe2a7('0x3'));var controller=require(_0xe2a7('0x4'));router[_0xe2a7('0x5')]('/',auth[_0xe2a7('0x6')](),controller[_0xe2a7('0x7')]);router[_0xe2a7('0x5')](_0xe2a7('0x8'),auth['isAuthenticated'](),controller[_0xe2a7('0x9')]);router[_0xe2a7('0x5')](_0xe2a7('0xa'),auth[_0xe2a7('0x6')](),controller[_0xe2a7('0xb')]);router[_0xe2a7('0x5')]('/:id/messages',auth['isAuthenticated'](),controller[_0xe2a7('0xc')]);router[_0xe2a7('0x5')]('/:id/download',auth[_0xe2a7('0x6')](),controller[_0xe2a7('0xd')]);router['post']('/',auth[_0xe2a7('0x6')](),controller[_0xe2a7('0xe')]);router[_0xe2a7('0xf')](_0xe2a7('0x10'),auth[_0xe2a7('0x6')](),controller[_0xe2a7('0x11')]);router[_0xe2a7('0xf')]('/:id/tags',auth['isAuthenticated'](),interaction[_0xe2a7('0x12')](_0xe2a7('0x13'),'mailinteraction:addtags'),controller['addTags']);router[_0xe2a7('0x14')]('/:id',auth[_0xe2a7('0x6')](),interaction[_0xe2a7('0x12')](_0xe2a7('0x13'),_0xe2a7('0x15')),controller[_0xe2a7('0x16')]);router['delete'](_0xe2a7('0xa'),auth[_0xe2a7('0x6')](),interaction[_0xe2a7('0x12')](_0xe2a7('0x13'),_0xe2a7('0x17')),controller[_0xe2a7('0x18')]);router[_0xe2a7('0x19')](_0xe2a7('0x1a'),auth[_0xe2a7('0x6')](),controller[_0xe2a7('0x1b')]);module[_0xe2a7('0x1c')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 79ce82a..cc449fb 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 _0x8600=['DATE','STRING','TEXT','long','ENUM','out','sequelize','iconv','exports','BOOLEAN'];(function(_0xf382e5,_0x4c8690){var _0x3272b6=function(_0x42a6d2){while(--_0x42a6d2){_0xf382e5['push'](_0xf382e5['shift']());}};_0x3272b6(++_0x4c8690);}(_0x8600,0x6a));var _0x0860=function(_0xb26065,_0x36df08){_0xb26065=_0xb26065-0x0;var _0x974dce=_0x8600[_0xb26065];return _0x974dce;};'use strict';var Sequelize=require(_0x0860('0x0'));var iconv=require(_0x0860('0x1'));module[_0x0860('0x2')]={'closed':{'type':Sequelize[_0x0860('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0860('0x4')]},'disposition':{'type':Sequelize[_0x0860('0x5')]},'secondDisposition':{'type':Sequelize[_0x0860('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x0860('0x5')](0x1fe)},'to':{'type':Sequelize[_0x0860('0x5')]},'cc':{'type':Sequelize[_0x0860('0x6')](_0x0860('0x7'))},'subject':{'type':Sequelize[_0x0860('0x6')]()},'attach':{'type':Sequelize[_0x0860('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x0860('0x4')]},'substatus':{'type':Sequelize[_0x0860('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0x0860('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x0860('0x8')]('in',_0x0860('0x9')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x0860('0x3')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x74b9=['STRING','long','TEXT','DATE','ENUM','out','INTEGER','sequelize','iconv','exports','BOOLEAN'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x74b9,0x1e0));var _0x974b=function(_0x5c5a8c,_0x1f32b1){_0x5c5a8c=_0x5c5a8c-0x0;var _0x5828cf=_0x74b9[_0x5c5a8c];return _0x5828cf;};'use strict';var Sequelize=require(_0x974b('0x0'));var iconv=require(_0x974b('0x1'));module[_0x974b('0x2')]={'closed':{'type':Sequelize[_0x974b('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x974b('0x4')]},'thirdDisposition':{'type':Sequelize[_0x974b('0x4')]},'note':{'type':Sequelize[_0x974b('0x4')]},'inReplyTo':{'type':Sequelize[_0x974b('0x4')](0x1fe)},'to':{'type':Sequelize[_0x974b('0x4')]},'cc':{'type':Sequelize['TEXT'](_0x974b('0x5'))},'subject':{'type':Sequelize[_0x974b('0x6')]()},'attach':{'type':Sequelize[_0x974b('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x974b('0x7')]},'substatus':{'type':Sequelize[_0x974b('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x974b('0x7')]},'firstMsgDirection':{'type':Sequelize[_0x974b('0x8')]('in',_0x974b('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x974b('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x974b('0x3')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x974b('0xa')]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 9bdb458..d55783b 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 _0x5f33=['where','pick','filter','split','format','include','rows','addTags','setTags','spread','color','emit','mailInteractionTags:save','removeTags','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','Attachment','Attachments','Messages','from','bcc','subject','createdAt','get','mkdirSync','decode','headers','Bcc','basename','existsSync','readFileSync','build','writeFileSync','message%d.eml','download','unlinkSync','rimraf','moment','bluebird','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','stack','name','send','map','MailInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','mail','query','user','catch','show','model','keys','filters','attributes','intersection','length','includeAll','merge','options','find','create','body','params','describe','ids','omit','findOne','MailMessage','fields','order','sort'];(function(_0x3dddd8,_0x4a2afc){var _0xda5a01=function(_0x54757a){while(--_0x54757a){_0x3dddd8['push'](_0x3dddd8['shift']());}};_0xda5a01(++_0x4a2afc);}(_0x5f33,0x1e3));var _0x35f3=function(_0x4e9bde,_0x3f5484){_0x4e9bde=_0x4e9bde-0x0;var _0x155ff9=_0x5f33[_0x4e9bde];return _0x155ff9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x35f3('0x0'));var zipdir=require('zip-dir');var moment=require(_0x35f3('0x1'));var BPromise=require(_0x35f3('0x2'));var util=require('util');var path=require('path');var fs=require('fs');var _=require(_0x35f3('0x3'));var juice=require(_0x35f3('0x4'));var Redis=require(_0x35f3('0x5'));var interaction=require('../../components/interaction/service');var qs=require(_0x35f3('0x6'));var logger=require(_0x35f3('0x7'))(_0x35f3('0x8'));var config=require(_0x35f3('0x9'));var db=require(_0x35f3('0xa'))['db'];var htmlEntities=require(_0x35f3('0xb'));config[_0x35f3('0xc')]=_[_0x35f3('0xd')](config[_0x35f3('0xc')],{'host':_0x35f3('0xe'),'port':0x18eb});var socket=require(_0x35f3('0xf'))(new Redis(config['redis']));require(_0x35f3('0x10'))['register'](socket);function respondWithStatusCode(_0x338ba1,_0x96fd85){_0x96fd85=_0x96fd85||0xcc;return function(_0x15a2f5){if(_0x15a2f5){return _0x338ba1[_0x35f3('0x11')](_0x96fd85);}return _0x338ba1[_0x35f3('0x12')](_0x96fd85)[_0x35f3('0x13')]();};}function respondWithResult(_0xb34399,_0x257679){_0x257679=_0x257679||0xc8;return function(_0x131b06){if(_0x131b06){return _0xb34399[_0x35f3('0x12')](_0x257679)[_0x35f3('0x14')](_0x131b06);}};}function respondWithFilteredResult(_0x11cad7,_0x1ee60e){return function(_0xb92722){if(_0xb92722){var _0x357918=typeof _0x1ee60e[_0x35f3('0x15')]===_0x35f3('0x16')&&typeof _0x1ee60e[_0x35f3('0x17')]==='undefined';var _0x28d0e7=_0xb92722[_0x35f3('0x18')];var _0x264fee=_0x357918?0x0:_0x1ee60e[_0x35f3('0x15')];var _0x4ed4e1=_0x357918?_0xb92722[_0x35f3('0x18')]:_0x1ee60e[_0x35f3('0x15')]+_0x1ee60e[_0x35f3('0x17')];var _0x5e5990;if(_0x4ed4e1>=_0x28d0e7){_0x4ed4e1=_0x28d0e7;_0x5e5990=0xc8;}else{_0x5e5990=0xce;}_0x11cad7[_0x35f3('0x12')](_0x5e5990);return _0x11cad7[_0x35f3('0x19')](_0x35f3('0x1a'),_0x264fee+'-'+_0x4ed4e1+'/'+_0x28d0e7)[_0x35f3('0x14')](_0xb92722);}return null;};}function saveUpdates(_0x13e788){return function(_0x4d01b6){if(_0x4d01b6){return _0x4d01b6[_0x35f3('0x1b')](_0x13e788)[_0x35f3('0x1c')](function(_0x2cbb4f){return _0x2cbb4f;});}return null;};}function removeEntity(_0x525a19){return function(_0x27afe8){if(_0x27afe8){return _0x27afe8[_0x35f3('0x1d')]()[_0x35f3('0x1c')](function(){_0x525a19['status'](0xcc)[_0x35f3('0x13')]();});}};}function handleEntityNotFound(_0x33476b){return function(_0x3b06db){if(!_0x3b06db){_0x33476b['sendStatus'](0x194);}return _0x3b06db;};}function handleError(_0x434785,_0x54f2d7){_0x54f2d7=_0x54f2d7||0x1f4;return function(_0x313c99){logger['error'](_0x313c99[_0x35f3('0x1e')]);if(_0x313c99[_0x35f3('0x1f')]){delete _0x313c99[_0x35f3('0x1f')];}_0x434785[_0x35f3('0x12')](_0x54f2d7)[_0x35f3('0x20')](_0x313c99);};}exports['index']=function(_0x205212,_0x22f767){var _0x2a27be={};var _0xfc62f7=_[_0x35f3('0x21')](db[_0x35f3('0x22')][_0x35f3('0x23')],function(_0x218500){return{'name':_0x218500[_0x35f3('0x24')],'type':_0x218500[_0x35f3('0x25')][_0x35f3('0x26')]};});_0x2a27be=qs[_0x35f3('0x27')](_0xfc62f7,_0x205212);return interaction[_0x35f3('0x28')](_0x35f3('0x29'),_0x205212[_0x35f3('0x2a')],_0x205212[_0x35f3('0x2b')],_0x2a27be,_0xfc62f7)[_0x35f3('0x1c')](respondWithFilteredResult(_0x22f767,_0x2a27be))[_0x35f3('0x2c')](handleError(_0x22f767,null));};exports[_0x35f3('0x2d')]=function(_0x27fafb,_0x5571a6){var _0x151495={'raw':![],'where':{'id':_0x27fafb['params']['id']}},_0x3d3e0d={};_0x3d3e0d[_0x35f3('0x2e')]=_[_0x35f3('0x2f')](db['MailInteraction'][_0x35f3('0x23')]);_0x3d3e0d[_0x35f3('0x2a')]=_[_0x35f3('0x2f')](_0x27fafb[_0x35f3('0x2a')]);_0x3d3e0d[_0x35f3('0x30')]=_['intersection'](_0x3d3e0d['model'],_0x3d3e0d['query']);_0x151495[_0x35f3('0x31')]=_[_0x35f3('0x32')](_0x3d3e0d[_0x35f3('0x2e')],qs['fields'](_0x27fafb[_0x35f3('0x2a')]['fields']));_0x151495['attributes']=_0x151495[_0x35f3('0x31')][_0x35f3('0x33')]?_0x151495[_0x35f3('0x31')]:_0x3d3e0d[_0x35f3('0x2e')];if(_0x27fafb['query'][_0x35f3('0x34')]){_0x151495['include']=[{'all':!![]}];}_0x151495=_[_0x35f3('0x35')]({},_0x151495,_0x27fafb[_0x35f3('0x36')]);return db[_0x35f3('0x22')][_0x35f3('0x37')](_0x151495)[_0x35f3('0x1c')](handleEntityNotFound(_0x5571a6,null))[_0x35f3('0x1c')](respondWithResult(_0x5571a6,null))[_0x35f3('0x2c')](handleError(_0x5571a6,null));};exports['create']=function(_0x5d69bf,_0x51af08){return db[_0x35f3('0x22')][_0x35f3('0x38')](_0x5d69bf[_0x35f3('0x39')],{})['then'](respondWithResult(_0x51af08,0xc9))[_0x35f3('0x2c')](handleError(_0x51af08,null));};exports[_0x35f3('0x1b')]=function(_0x198ffb,_0x11d3e8){if(_0x198ffb['body']['id']){delete _0x198ffb['body']['id'];}return db['MailInteraction'][_0x35f3('0x37')]({'where':{'id':_0x198ffb['params']['id']}})[_0x35f3('0x1c')](handleEntityNotFound(_0x11d3e8,null))[_0x35f3('0x1c')](saveUpdates(_0x198ffb['body'],null))['then'](respondWithResult(_0x11d3e8,null))[_0x35f3('0x2c')](handleError(_0x11d3e8,null));};exports[_0x35f3('0x1d')]=function(_0x3af73d,_0x3dcb72){return db[_0x35f3('0x22')]['find']({'where':{'id':_0x3af73d[_0x35f3('0x3a')]['id']}})['then'](handleEntityNotFound(_0x3dcb72,null))[_0x35f3('0x1c')](removeEntity(_0x3dcb72,null))['catch'](handleError(_0x3dcb72,null));};exports['describe']=function(_0x3fc381,_0x304a93){return db[_0x35f3('0x22')][_0x35f3('0x3b')]()[_0x35f3('0x1c')](respondWithResult(_0x304a93,null))[_0x35f3('0x2c')](handleError(_0x304a93,null));};exports['addMessage']=function(_0x2d99c8,_0x196591){return db['MailMessage'][_0x35f3('0x37')]({'where':{'id':_0x2d99c8[_0x35f3('0x3a')]['id']}})[_0x35f3('0x1c')](handleEntityNotFound(_0x196591,null))['then'](function(_0x324104){if(_0x324104){return _0x324104['addMessage'](_0x2d99c8[_0x35f3('0x39')][_0x35f3('0x3c')],_[_0x35f3('0x3d')](_0x2d99c8[_0x35f3('0x39')],[_0x35f3('0x3c'),'id'])||{});}})[_0x35f3('0x1c')](respondWithResult(_0x196591,null))[_0x35f3('0x2c')](handleError(_0x196591,null));};exports['getMessages']=function(_0x45b24f,_0x2d45ab){var _0x3dbdeb={'raw':![],'where':{}};var _0x46d723={};var _0x42a00d={'count':0x0,'rows':[]};return db[_0x35f3('0x22')][_0x35f3('0x3e')]({'where':{'id':_0x45b24f[_0x35f3('0x3a')]['id']}})[_0x35f3('0x1c')](handleEntityNotFound(_0x2d45ab,null))[_0x35f3('0x1c')](function(_0x2adc7f){if(_0x2adc7f){_0x46d723['model']=_[_0x35f3('0x2f')](db[_0x35f3('0x3f')][_0x35f3('0x23')]);_0x46d723[_0x35f3('0x2a')]=_['keys'](_0x45b24f['query']);_0x46d723[_0x35f3('0x30')]=_[_0x35f3('0x32')](_0x46d723[_0x35f3('0x2e')],_0x46d723[_0x35f3('0x2a')]);_0x3dbdeb[_0x35f3('0x31')]=_['intersection'](_0x46d723[_0x35f3('0x2e')],qs[_0x35f3('0x40')](_0x45b24f['query'][_0x35f3('0x40')]));_0x3dbdeb[_0x35f3('0x31')]=_0x3dbdeb[_0x35f3('0x31')][_0x35f3('0x33')]?_0x3dbdeb[_0x35f3('0x31')]:_0x46d723[_0x35f3('0x2e')];if(!_0x45b24f[_0x35f3('0x2a')]['hasOwnProperty']('nolimit')){_0x3dbdeb[_0x35f3('0x17')]=qs[_0x35f3('0x17')](_0x45b24f['query']['limit']);_0x3dbdeb['offset']=qs[_0x35f3('0x15')](_0x45b24f[_0x35f3('0x2a')]['offset']);}_0x3dbdeb[_0x35f3('0x41')]=qs[_0x35f3('0x42')](_0x45b24f[_0x35f3('0x2a')]['sort']);_0x3dbdeb[_0x35f3('0x43')]=qs['filters'](_[_0x35f3('0x44')](_0x45b24f['query'],_0x46d723[_0x35f3('0x30')]));_0x3dbdeb[_0x35f3('0x43')]['MailInteractionId']=_0x2adc7f['id'];if(_0x45b24f[_0x35f3('0x2a')][_0x35f3('0x45')]){_0x3dbdeb[_0x35f3('0x43')]=_['merge'](_0x3dbdeb[_0x35f3('0x43')],{'$or':_['map'](_0x3dbdeb[_0x35f3('0x31')],function(_0xfaa367){var _0x4e8912={};_0x4e8912[_0xfaa367]={'$like':'%'+_0x45b24f[_0x35f3('0x2a')][_0x35f3('0x45')]+'%'};return _0x4e8912;})});}if(_0x45b24f[_0x35f3('0x2a')]['$gte']){var _0x294262=_0x45b24f[_0x35f3('0x2a')]['$gte'][_0x35f3('0x46')](',');var _0x1e29d4={};_0x1e29d4[_0x294262[0x0]]={'$gte':moment(_0x294262[0x1])[_0x35f3('0x47')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3dbdeb[_0x35f3('0x43')]=_[_0x35f3('0x35')](_0x3dbdeb[_0x35f3('0x43')],_0x1e29d4);}_0x3dbdeb=_[_0x35f3('0x35')]({},_0x3dbdeb,_0x45b24f[_0x35f3('0x36')]);return db[_0x35f3('0x3f')][_0x35f3('0x18')]({'where':_0x3dbdeb[_0x35f3('0x43')]})[_0x35f3('0x1c')](function(_0x3b69bb){_0x42a00d[_0x35f3('0x18')]=_0x3b69bb;if(_0x45b24f[_0x35f3('0x2a')][_0x35f3('0x34')]){_0x3dbdeb[_0x35f3('0x48')]=[{'all':!![]}];}return db[_0x35f3('0x3f')][_0x35f3('0x28')](_0x3dbdeb);})[_0x35f3('0x1c')](function(_0xde6888){if(_0x45b24f[_0x35f3('0x2a')]['inlineCss']==='true'){for(var _0x14c308=0x0;_0x14c308<_0xde6888[_0x35f3('0x33')];_0x14c308++){_0xde6888[_0x14c308][_0x35f3('0x39')]=juice(_0xde6888[_0x14c308][_0x35f3('0x39')]);}}_0x42a00d[_0x35f3('0x49')]=_0xde6888;return _0x42a00d;});}})[_0x35f3('0x1c')](respondWithFilteredResult(_0x2d45ab,_0x3dbdeb))[_0x35f3('0x2c')](handleError(_0x2d45ab,null));};exports[_0x35f3('0x4a')]=function(_0x1f44bb,_0x2f236d){return db['MailInteraction'][_0x35f3('0x37')]({'where':{'id':_0x1f44bb[_0x35f3('0x3a')]['id']}})['then'](handleEntityNotFound(_0x2f236d,null))['then'](function(_0x448656){if(_0x448656){return _0x448656[_0x35f3('0x4b')](_0x1f44bb['body'][_0x35f3('0x3c')],_[_0x35f3('0x3d')](_0x1f44bb['body'],['ids','id'])||{})[_0x35f3('0x4c')](function(){return db['Tag']['findAll']({'attributes':['id','name',_0x35f3('0x4d')],'where':{'id':_0x1f44bb[_0x35f3('0x39')]['ids']}});})[_0x35f3('0x1c')](function(_0x308ceb){socket[_0x35f3('0x4e')](_0x35f3('0x4f'),{'id':Number(_0x1f44bb[_0x35f3('0x3a')]['id']),'tags':_0x308ceb||[]});return{'id':Number(_0x1f44bb[_0x35f3('0x3a')]['id']),'tags':_0x308ceb||[]};});}})['then'](respondWithResult(_0x2f236d,null))[_0x35f3('0x2c')](handleError(_0x2f236d,null));};exports[_0x35f3('0x50')]=function(_0x45c3c0,_0x48b6fb){return db[_0x35f3('0x22')][_0x35f3('0x37')]({'where':{'id':_0x45c3c0[_0x35f3('0x3a')]['id']}})['then'](handleEntityNotFound(_0x48b6fb,null))['then'](function(_0x5d3d92){if(_0x5d3d92){return _0x5d3d92[_0x35f3('0x50')](_0x45c3c0['query']['ids']);}})['then'](respondWithStatusCode(_0x48b6fb,null))[_0x35f3('0x2c')](handleError(_0x48b6fb,null));};exports['download']=function(_0x4b3d9b,_0x4468d9){var _0x110f27=moment()[_0x35f3('0x51')]()['toString']();var _0x27f3b1=path[_0x35f3('0x52')](config[_0x35f3('0x53')],_0x35f3('0x54'),_0x35f3('0x55'),_0x35f3('0x56'));var _0x48279b=path[_0x35f3('0x52')](config[_0x35f3('0x53')],'server',_0x35f3('0x55'),_0x35f3('0x57'));var _0x299223=path[_0x35f3('0x52')](_0x27f3b1,_0x110f27);var _0x2104a6=util[_0x35f3('0x47')](_0x35f3('0x58'),_0x4b3d9b[_0x35f3('0x3a')]['id'],_0x110f27);var _0x3298c4=path['join'](_0x27f3b1,_0x2104a6);var _0x2da5fd=[];if(_0x4b3d9b[_0x35f3('0x2a')]['attachments']){_0x2da5fd[_0x35f3('0x59')]({'model':db[_0x35f3('0x5a')],'as':_0x35f3('0x5b'),'raw':!![]});}var _0x3c6ba4=[{'model':db['MailMessage'],'as':_0x35f3('0x5c'),'attributes':['id',_0x35f3('0x39'),_0x35f3('0x5d'),'to','cc',_0x35f3('0x5e'),_0x35f3('0x5f'),_0x35f3('0x60')],'where':{'secret':![]},'order':qs[_0x35f3('0x42')]('id'),'include':_0x2da5fd}];return db[_0x35f3('0x22')][_0x35f3('0x37')]({'where':{'id':_0x4b3d9b[_0x35f3('0x3a')]['id']},'include':_0x3c6ba4})[_0x35f3('0x1c')](handleEntityNotFound(_0x4468d9,null))[_0x35f3('0x1c')](function(_0x56ec6){if(_0x56ec6&&_0x56ec6[_0x35f3('0x5c')]){var _0x534274=_0x56ec6[_0x35f3('0x61')]({'plain':!![]});fs[_0x35f3('0x62')](_0x299223);return BPromise['each'](_0x534274[_0x35f3('0x5c')],function(_0x8798dc,_0x4d09b3){var _0x583cb9={'from':_0x8798dc[_0x35f3('0x5d')],'to':_0x8798dc['to']||'missing.recipient@your.company.com','subject':_0x8798dc[_0x35f3('0x5f')],'html':htmlEntities[_0x35f3('0x63')](_0x8798dc[_0x35f3('0x39')]),'headers':{'Date':moment(_0x8798dc[_0x35f3('0x60')])[_0x35f3('0x47')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x8798dc['cc']){_0x583cb9[_0x35f3('0x64')]['Cc']=_0x8798dc['cc'];}if(_0x8798dc[_0x35f3('0x5e')]){_0x583cb9[_0x35f3('0x64')][_0x35f3('0x65')]=_0x8798dc[_0x35f3('0x5e')];}return new BPromise(function(_0x56f459,_0x175485){if(_0x8798dc[_0x35f3('0x5b')]){for(var _0x1815ac=0x0;_0x1815ac<_0x8798dc[_0x35f3('0x5b')][_0x35f3('0x33')];_0x1815ac++){var _0x49eeee=_0x8798dc[_0x35f3('0x5b')][_0x1815ac];var _0x1b44ba=path['join'](_0x48279b,_0x49eeee[_0x35f3('0x66')]);if(fs[_0x35f3('0x67')](_0x1b44ba)){_0x583cb9[_0x35f3('0x57')][_0x35f3('0x59')]({'name':_0x49eeee[_0x35f3('0x1f')],'contentType':_0x49eeee[_0x35f3('0x25')],'data':fs[_0x35f3('0x68')](_0x1b44ba)});}}}emlformat[_0x35f3('0x69')](_0x583cb9,function(_0x62900d,_0x9616dc){if(_0x62900d)return _0x175485(_0x62900d);fs[_0x35f3('0x6a')](path[_0x35f3('0x52')](_0x299223,util[_0x35f3('0x47')](_0x35f3('0x6b'),_0x4d09b3)),_0x9616dc);return _0x56f459(_0x9616dc);});});})[_0x35f3('0x1c')](function(){return new BPromise(function(_0x368a3,_0x467c01){zipdir(_0x299223,{'saveTo':_0x3298c4},function(_0x2e29b1,_0xba82d5){if(_0x2e29b1)return _0x467c01(_0x2e29b1);return _0x368a3(_0xba82d5);});})['then'](function(){return new BPromise(function(_0x5157ec,_0x5a3fb8){rimraf(_0x299223,function(_0x3a22a5){if(_0x3a22a5)_0x5a3fb8(_0x3a22a5);return _0x5157ec();});});})['then'](function(){return _0x4468d9[_0x35f3('0x6c')](_0x3298c4,_0x2104a6,function(_0x4c3830){if(!_0x4c3830)fs[_0x35f3('0x6d')](_0x3298c4);});});});}else{return _0x4468d9['sendStatus'](0xc8);}})['catch'](handleError(_0x4468d9,null));}; \ No newline at end of file +var _0x9a91=['intersection','fields','attributes','length','model','includeAll','merge','options','find','create','update','body','describe','MailMessage','addMessage','ids','omit','findOne','hasOwnProperty','nolimit','order','sort','where','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','include','inlineCss','rows','addTags','setTags','Tag','color','emit','mailInteractionTags:save','removeTags','unix','toString','join','root','server','files','attachments','push','Attachment','Attachments','Messages','from','bcc','subject','createdAt','mkdirSync','each','missing.recipient@your.company.com','headers','Bcc','basename','existsSync','readFileSync','writeFileSync','message%d.eml','eml-format','rimraf','moment','bluebird','util','path','juice','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','redis','defaults','./mailInteraction.socket','status','end','json','offset','undefined','limit','count','set','then','sendStatus','name','send','map','MailInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','mail','user','catch','show','params','keys','query','filters'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0x9a91,0x1e7));var _0x19a9=function(_0x4f1ae4,_0x24f8ee){_0x4f1ae4=_0x4f1ae4-0x0;var _0x4cd2c6=_0x9a91[_0x4f1ae4];return _0x4cd2c6;};'use strict';var emlformat=require(_0x19a9('0x0'));var rimraf=require(_0x19a9('0x1'));var zipdir=require('zip-dir');var moment=require(_0x19a9('0x2'));var BPromise=require(_0x19a9('0x3'));var util=require(_0x19a9('0x4'));var path=require(_0x19a9('0x5'));var fs=require('fs');var _=require('lodash');var juice=require(_0x19a9('0x6'));var Redis=require(_0x19a9('0x7'));var interaction=require(_0x19a9('0x8'));var qs=require(_0x19a9('0x9'));var logger=require(_0x19a9('0xa'))(_0x19a9('0xb'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var htmlEntities=require('html-entities');config[_0x19a9('0xc')]=_[_0x19a9('0xd')](config[_0x19a9('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x19a9('0xc')]));require(_0x19a9('0xe'))['register'](socket);function respondWithStatusCode(_0xec6552,_0x24dee3){_0x24dee3=_0x24dee3||0xcc;return function(_0x20aba7){if(_0x20aba7){return _0xec6552['sendStatus'](_0x24dee3);}return _0xec6552[_0x19a9('0xf')](_0x24dee3)[_0x19a9('0x10')]();};}function respondWithResult(_0x1055f6,_0x4c821e){_0x4c821e=_0x4c821e||0xc8;return function(_0x32979d){if(_0x32979d){return _0x1055f6[_0x19a9('0xf')](_0x4c821e)[_0x19a9('0x11')](_0x32979d);}};}function respondWithFilteredResult(_0x4d0ac5,_0x2a25e2){return function(_0x52ff90){if(_0x52ff90){var _0x5cbe61=typeof _0x2a25e2[_0x19a9('0x12')]===_0x19a9('0x13')&&typeof _0x2a25e2[_0x19a9('0x14')]==='undefined';var _0x1b0277=_0x52ff90[_0x19a9('0x15')];var _0x5f510f=_0x5cbe61?0x0:_0x2a25e2['offset'];var _0x287d6f=_0x5cbe61?_0x52ff90[_0x19a9('0x15')]:_0x2a25e2[_0x19a9('0x12')]+_0x2a25e2[_0x19a9('0x14')];var _0xac601e;if(_0x287d6f>=_0x1b0277){_0x287d6f=_0x1b0277;_0xac601e=0xc8;}else{_0xac601e=0xce;}_0x4d0ac5[_0x19a9('0xf')](_0xac601e);return _0x4d0ac5[_0x19a9('0x16')]('Content-Range',_0x5f510f+'-'+_0x287d6f+'/'+_0x1b0277)[_0x19a9('0x11')](_0x52ff90);}return null;};}function saveUpdates(_0x6382cd){return function(_0x2f6fe1){if(_0x2f6fe1){return _0x2f6fe1['update'](_0x6382cd)[_0x19a9('0x17')](function(_0x2bd728){return _0x2bd728;});}return null;};}function removeEntity(_0x13b900){return function(_0x24b49d){if(_0x24b49d){return _0x24b49d['destroy']()[_0x19a9('0x17')](function(){_0x13b900[_0x19a9('0xf')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43c4af){return function(_0x56ca6c){if(!_0x56ca6c){_0x43c4af[_0x19a9('0x18')](0x194);}return _0x56ca6c;};}function handleError(_0x4bdfa0,_0x6d939e){_0x6d939e=_0x6d939e||0x1f4;return function(_0x264298){logger['error'](_0x264298['stack']);if(_0x264298[_0x19a9('0x19')]){delete _0x264298['name'];}_0x4bdfa0[_0x19a9('0xf')](_0x6d939e)[_0x19a9('0x1a')](_0x264298);};}exports['index']=function(_0x4587d2,_0x782890){var _0x1e42a0={};var _0x3243c2=_[_0x19a9('0x1b')](db[_0x19a9('0x1c')][_0x19a9('0x1d')],function(_0x51bbe6){return{'name':_0x51bbe6[_0x19a9('0x1e')],'type':_0x51bbe6[_0x19a9('0x1f')][_0x19a9('0x20')]};});_0x1e42a0=qs[_0x19a9('0x21')](_0x3243c2,_0x4587d2);return interaction[_0x19a9('0x22')](_0x19a9('0x23'),_0x4587d2['query'],_0x4587d2[_0x19a9('0x24')],_0x1e42a0,_0x3243c2)[_0x19a9('0x17')](respondWithFilteredResult(_0x782890,_0x1e42a0))[_0x19a9('0x25')](handleError(_0x782890,null));};exports[_0x19a9('0x26')]=function(_0x5dc98f,_0x555a6b){var _0x335e3d={'raw':![],'where':{'id':_0x5dc98f[_0x19a9('0x27')]['id']}},_0x305821={};_0x305821['model']=_['keys'](db[_0x19a9('0x1c')][_0x19a9('0x1d')]);_0x305821['query']=_[_0x19a9('0x28')](_0x5dc98f[_0x19a9('0x29')]);_0x305821[_0x19a9('0x2a')]=_[_0x19a9('0x2b')](_0x305821['model'],_0x305821[_0x19a9('0x29')]);_0x335e3d['attributes']=_[_0x19a9('0x2b')](_0x305821['model'],qs[_0x19a9('0x2c')](_0x5dc98f['query'][_0x19a9('0x2c')]));_0x335e3d[_0x19a9('0x2d')]=_0x335e3d[_0x19a9('0x2d')][_0x19a9('0x2e')]?_0x335e3d[_0x19a9('0x2d')]:_0x305821[_0x19a9('0x2f')];if(_0x5dc98f['query'][_0x19a9('0x30')]){_0x335e3d['include']=[{'all':!![]}];}_0x335e3d=_[_0x19a9('0x31')]({},_0x335e3d,_0x5dc98f[_0x19a9('0x32')]);return db['MailInteraction'][_0x19a9('0x33')](_0x335e3d)[_0x19a9('0x17')](handleEntityNotFound(_0x555a6b,null))['then'](respondWithResult(_0x555a6b,null))[_0x19a9('0x25')](handleError(_0x555a6b,null));};exports[_0x19a9('0x34')]=function(_0x513be1,_0x5cc277){return db[_0x19a9('0x1c')][_0x19a9('0x34')](_0x513be1['body'],{})[_0x19a9('0x17')](respondWithResult(_0x5cc277,0xc9))[_0x19a9('0x25')](handleError(_0x5cc277,null));};exports[_0x19a9('0x35')]=function(_0x515f67,_0x5e40c4){if(_0x515f67[_0x19a9('0x36')]['id']){delete _0x515f67[_0x19a9('0x36')]['id'];}return db[_0x19a9('0x1c')][_0x19a9('0x33')]({'where':{'id':_0x515f67[_0x19a9('0x27')]['id']}})['then'](handleEntityNotFound(_0x5e40c4,null))['then'](saveUpdates(_0x515f67[_0x19a9('0x36')],null))[_0x19a9('0x17')](respondWithResult(_0x5e40c4,null))[_0x19a9('0x25')](handleError(_0x5e40c4,null));};exports['destroy']=function(_0x3d71b6,_0x19eacc){return db[_0x19a9('0x1c')][_0x19a9('0x33')]({'where':{'id':_0x3d71b6[_0x19a9('0x27')]['id']}})[_0x19a9('0x17')](handleEntityNotFound(_0x19eacc,null))[_0x19a9('0x17')](removeEntity(_0x19eacc,null))[_0x19a9('0x25')](handleError(_0x19eacc,null));};exports[_0x19a9('0x37')]=function(_0x752fb5,_0x137824){return db[_0x19a9('0x1c')][_0x19a9('0x37')]()[_0x19a9('0x17')](respondWithResult(_0x137824,null))['catch'](handleError(_0x137824,null));};exports['addMessage']=function(_0x3ef556,_0x1ae2a8){return db[_0x19a9('0x38')][_0x19a9('0x33')]({'where':{'id':_0x3ef556[_0x19a9('0x27')]['id']}})[_0x19a9('0x17')](handleEntityNotFound(_0x1ae2a8,null))[_0x19a9('0x17')](function(_0x14244c){if(_0x14244c){return _0x14244c[_0x19a9('0x39')](_0x3ef556[_0x19a9('0x36')][_0x19a9('0x3a')],_[_0x19a9('0x3b')](_0x3ef556[_0x19a9('0x36')],['ids','id'])||{});}})[_0x19a9('0x17')](respondWithResult(_0x1ae2a8,null))[_0x19a9('0x25')](handleError(_0x1ae2a8,null));};exports['getMessages']=function(_0x4ac600,_0x6f0b78){var _0xaf2308={'raw':![],'where':{}};var _0x3c2cc4={};var _0x25b552={'count':0x0,'rows':[]};return db[_0x19a9('0x1c')][_0x19a9('0x3c')]({'where':{'id':_0x4ac600['params']['id']}})[_0x19a9('0x17')](handleEntityNotFound(_0x6f0b78,null))['then'](function(_0x3a269a){if(_0x3a269a){_0x3c2cc4[_0x19a9('0x2f')]=_[_0x19a9('0x28')](db['MailMessage'][_0x19a9('0x1d')]);_0x3c2cc4[_0x19a9('0x29')]=_[_0x19a9('0x28')](_0x4ac600[_0x19a9('0x29')]);_0x3c2cc4[_0x19a9('0x2a')]=_['intersection'](_0x3c2cc4[_0x19a9('0x2f')],_0x3c2cc4[_0x19a9('0x29')]);_0xaf2308[_0x19a9('0x2d')]=_[_0x19a9('0x2b')](_0x3c2cc4['model'],qs[_0x19a9('0x2c')](_0x4ac600[_0x19a9('0x29')][_0x19a9('0x2c')]));_0xaf2308[_0x19a9('0x2d')]=_0xaf2308['attributes']['length']?_0xaf2308[_0x19a9('0x2d')]:_0x3c2cc4['model'];if(!_0x4ac600[_0x19a9('0x29')][_0x19a9('0x3d')](_0x19a9('0x3e'))){_0xaf2308[_0x19a9('0x14')]=qs[_0x19a9('0x14')](_0x4ac600['query']['limit']);_0xaf2308[_0x19a9('0x12')]=qs['offset'](_0x4ac600['query'][_0x19a9('0x12')]);}_0xaf2308[_0x19a9('0x3f')]=qs[_0x19a9('0x40')](_0x4ac600[_0x19a9('0x29')][_0x19a9('0x40')]);_0xaf2308[_0x19a9('0x41')]=qs[_0x19a9('0x2a')](_['pick'](_0x4ac600[_0x19a9('0x29')],_0x3c2cc4[_0x19a9('0x2a')]));_0xaf2308['where']['MailInteractionId']=_0x3a269a['id'];if(_0x4ac600['query'][_0x19a9('0x42')]){_0xaf2308[_0x19a9('0x41')]=_['merge'](_0xaf2308[_0x19a9('0x41')],{'$or':_['map'](_0xaf2308[_0x19a9('0x2d')],function(_0x2f95e9){var _0x35a2e2={};_0x35a2e2[_0x2f95e9]={'$like':'%'+_0x4ac600[_0x19a9('0x29')][_0x19a9('0x42')]+'%'};return _0x35a2e2;})});}if(_0x4ac600['query']['$gte']){var _0x1ed9c9=_0x4ac600[_0x19a9('0x29')][_0x19a9('0x43')][_0x19a9('0x44')](',');var _0x5cb53d={};_0x5cb53d[_0x1ed9c9[0x0]]={'$gte':moment(_0x1ed9c9[0x1])[_0x19a9('0x45')](_0x19a9('0x46'))};_0xaf2308[_0x19a9('0x41')]=_['merge'](_0xaf2308['where'],_0x5cb53d);}_0xaf2308=_[_0x19a9('0x31')]({},_0xaf2308,_0x4ac600[_0x19a9('0x32')]);return db[_0x19a9('0x38')]['count']({'where':_0xaf2308[_0x19a9('0x41')]})[_0x19a9('0x17')](function(_0x24fa6b){_0x25b552['count']=_0x24fa6b;if(_0x4ac600['query'][_0x19a9('0x30')]){_0xaf2308[_0x19a9('0x47')]=[{'all':!![]}];}return db[_0x19a9('0x38')][_0x19a9('0x22')](_0xaf2308);})[_0x19a9('0x17')](function(_0x37c680){if(_0x4ac600[_0x19a9('0x29')][_0x19a9('0x48')]==='true'){for(var _0x521671=0x0;_0x521671<_0x37c680['length'];_0x521671++){_0x37c680[_0x521671][_0x19a9('0x36')]=juice(_0x37c680[_0x521671][_0x19a9('0x36')]);}}_0x25b552[_0x19a9('0x49')]=_0x37c680;return _0x25b552;});}})[_0x19a9('0x17')](respondWithFilteredResult(_0x6f0b78,_0xaf2308))['catch'](handleError(_0x6f0b78,null));};exports[_0x19a9('0x4a')]=function(_0x295b80,_0xa5d540){return db['MailInteraction'][_0x19a9('0x33')]({'where':{'id':_0x295b80[_0x19a9('0x27')]['id']}})[_0x19a9('0x17')](handleEntityNotFound(_0xa5d540,null))[_0x19a9('0x17')](function(_0x272b58){if(_0x272b58){return _0x272b58[_0x19a9('0x4b')](_0x295b80['body'][_0x19a9('0x3a')],_[_0x19a9('0x3b')](_0x295b80[_0x19a9('0x36')],[_0x19a9('0x3a'),'id'])||{})['spread'](function(){return db[_0x19a9('0x4c')][_0x19a9('0x22')]({'attributes':['id',_0x19a9('0x19'),_0x19a9('0x4d')],'where':{'id':_0x295b80[_0x19a9('0x36')][_0x19a9('0x3a')]}});})[_0x19a9('0x17')](function(_0x4e17c8){socket[_0x19a9('0x4e')](_0x19a9('0x4f'),{'id':Number(_0x295b80[_0x19a9('0x27')]['id']),'tags':_0x4e17c8||[]});return{'id':Number(_0x295b80[_0x19a9('0x27')]['id']),'tags':_0x4e17c8||[]};});}})[_0x19a9('0x17')](respondWithResult(_0xa5d540,null))['catch'](handleError(_0xa5d540,null));};exports[_0x19a9('0x50')]=function(_0x3b4815,_0x22ec4d){return db[_0x19a9('0x1c')][_0x19a9('0x33')]({'where':{'id':_0x3b4815['params']['id']}})[_0x19a9('0x17')](handleEntityNotFound(_0x22ec4d,null))[_0x19a9('0x17')](function(_0x4003b1){if(_0x4003b1){return _0x4003b1[_0x19a9('0x50')](_0x3b4815[_0x19a9('0x29')]['ids']);}})[_0x19a9('0x17')](respondWithStatusCode(_0x22ec4d,null))[_0x19a9('0x25')](handleError(_0x22ec4d,null));};exports['download']=function(_0x2d2c8e,_0x43da19){var _0x4246c2=moment()[_0x19a9('0x51')]()[_0x19a9('0x52')]();var _0x8ddf27=path[_0x19a9('0x53')](config[_0x19a9('0x54')],_0x19a9('0x55'),_0x19a9('0x56'),'tmp');var _0x20c1d4=path[_0x19a9('0x53')](config[_0x19a9('0x54')],'server',_0x19a9('0x56'),_0x19a9('0x57'));var _0xec865e=path[_0x19a9('0x53')](_0x8ddf27,_0x4246c2);var _0x2eb776=util[_0x19a9('0x45')]('transcript-%d-%s.zip',_0x2d2c8e[_0x19a9('0x27')]['id'],_0x4246c2);var _0x4254f3=path[_0x19a9('0x53')](_0x8ddf27,_0x2eb776);var _0x48cb1c=[];if(_0x2d2c8e['query'][_0x19a9('0x57')]){_0x48cb1c[_0x19a9('0x58')]({'model':db[_0x19a9('0x59')],'as':_0x19a9('0x5a'),'raw':!![]});}var _0x28abb1=[{'model':db[_0x19a9('0x38')],'as':_0x19a9('0x5b'),'attributes':['id',_0x19a9('0x36'),_0x19a9('0x5c'),'to','cc',_0x19a9('0x5d'),_0x19a9('0x5e'),_0x19a9('0x5f')],'where':{'secret':![]},'order':qs[_0x19a9('0x40')]('id'),'include':_0x48cb1c}];return db['MailInteraction'][_0x19a9('0x33')]({'where':{'id':_0x2d2c8e['params']['id']},'include':_0x28abb1})[_0x19a9('0x17')](handleEntityNotFound(_0x43da19,null))[_0x19a9('0x17')](function(_0x5917f6){if(_0x5917f6&&_0x5917f6[_0x19a9('0x5b')]){var _0x21438e=_0x5917f6['get']({'plain':!![]});fs[_0x19a9('0x60')](_0xec865e);return BPromise[_0x19a9('0x61')](_0x21438e[_0x19a9('0x5b')],function(_0x2dbb35,_0x83baf1){var _0x943fcf={'from':_0x2dbb35['from'],'to':_0x2dbb35['to']||_0x19a9('0x62'),'subject':_0x2dbb35[_0x19a9('0x5e')],'html':htmlEntities['decode'](_0x2dbb35[_0x19a9('0x36')]),'headers':{'Date':moment(_0x2dbb35[_0x19a9('0x5f')])[_0x19a9('0x45')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x2dbb35['cc']){_0x943fcf[_0x19a9('0x63')]['Cc']=_0x2dbb35['cc'];}if(_0x2dbb35[_0x19a9('0x5d')]){_0x943fcf['headers'][_0x19a9('0x64')]=_0x2dbb35[_0x19a9('0x5d')];}return new BPromise(function(_0x795d82,_0x20cc05){if(_0x2dbb35[_0x19a9('0x5a')]){for(var _0xd6c223=0x0;_0xd6c223<_0x2dbb35['Attachments']['length'];_0xd6c223++){var _0x3e7444=_0x2dbb35[_0x19a9('0x5a')][_0xd6c223];var _0x36f3f3=path[_0x19a9('0x53')](_0x20c1d4,_0x3e7444[_0x19a9('0x65')]);if(fs[_0x19a9('0x66')](_0x36f3f3)){_0x943fcf[_0x19a9('0x57')][_0x19a9('0x58')]({'name':_0x3e7444[_0x19a9('0x19')],'contentType':_0x3e7444['type'],'data':fs[_0x19a9('0x67')](_0x36f3f3)});}}}emlformat['build'](_0x943fcf,function(_0x3d3f1c,_0x1c40e9){if(_0x3d3f1c)return _0x20cc05(_0x3d3f1c);fs[_0x19a9('0x68')](path[_0x19a9('0x53')](_0xec865e,util['format'](_0x19a9('0x69'),_0x83baf1)),_0x1c40e9);return _0x795d82(_0x1c40e9);});});})['then'](function(){return new BPromise(function(_0x17016b,_0x505d6e){zipdir(_0xec865e,{'saveTo':_0x4254f3},function(_0x5cce73,_0x2e998c){if(_0x5cce73)return _0x505d6e(_0x5cce73);return _0x17016b(_0x2e998c);});})[_0x19a9('0x17')](function(){return new BPromise(function(_0x54da7f,_0x314756){rimraf(_0xec865e,function(_0x3ece2f){if(_0x3ece2f)_0x314756(_0x3ece2f);return _0x54da7f();});});})['then'](function(){return _0x43da19['download'](_0x4254f3,_0x2eb776,function(_0x41eb1e){if(!_0x41eb1e)fs['unlinkSync'](_0x4254f3);});});});}else{return _0x43da19['sendStatus'](0xc8);}})['catch'](handleError(_0x43da19,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 728def6..549a7f2 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 _0xf490=['setMaxListeners','update','remove','then','setDataValue','Users','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','MailInteraction'];(function(_0x552436,_0x326a88){var _0x3fa889=function(_0x4631a6){while(--_0x4631a6){_0x552436['push'](_0x552436['shift']());}};_0x3fa889(++_0x326a88);}(_0xf490,0xfc));var _0x0f49=function(_0x316904,_0x1e8b77){_0x316904=_0x316904-0x0;var _0xfa9a21=_0xf490[_0x316904];return _0xfa9a21;};'use strict';var EventEmitter=require(_0x0f49('0x0'));var MailInteraction=require(_0x0f49('0x1'))['db'][_0x0f49('0x2')];var MailMessage=require(_0x0f49('0x1'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x0f49('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0f49('0x4'),'afterDestroy':_0x0f49('0x5')};function emitEvent(_0x9686e8){return function(_0x1639c2,_0x944581,_0x1ea809){_0x1639c2['getUsers']({'attributes':['id'],'raw':!![]})[_0x0f49('0x6')](function(_0xbaf5e1){_0x1639c2[_0x0f49('0x7')](_0x0f49('0x8'),_0xbaf5e1['map'](function(_0x1f5321){return{'id':_0x1f5321['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x1639c2['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0f49('0x6')](function(_0x5c1ac4){_0x1639c2[_0x0f49('0x7')](_0x0f49('0x9'),_0x5c1ac4[_0x0f49('0xa')]);MailInteractionEvents[_0x0f49('0xb')](_0x9686e8+':'+_0x1639c2['id'],_0x1639c2);MailInteractionEvents[_0x0f49('0xb')](_0x9686e8,_0x1639c2);_0x1ea809(null);})[_0x0f49('0xc')](_0x1ea809(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x0f49('0xd')](e,emitEvent(event));}}module[_0x0f49('0xe')]=MailInteractionEvents; \ No newline at end of file +var _0x3dfa=['emit','catch','hasOwnProperty','exports','events','../../mysqldb','MailMessage','save','update','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','length'];(function(_0x21a4e4,_0x10bf07){var _0x212f0f=function(_0x2a549d){while(--_0x2a549d){_0x21a4e4['push'](_0x21a4e4['shift']());}};_0x212f0f(++_0x10bf07);}(_0x3dfa,0x114));var _0xa3df=function(_0x4d1000,_0x219f00){_0x4d1000=_0x4d1000-0x0;var _0x346924=_0x3dfa[_0x4d1000];return _0x346924;};'use strict';var EventEmitter=require(_0xa3df('0x0'));var MailInteraction=require(_0xa3df('0x1'))['db']['MailInteraction'];var MailMessage=require('../../mysqldb')['db'][_0xa3df('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa3df('0x3'),'afterUpdate':_0xa3df('0x4'),'afterDestroy':_0xa3df('0x5')};function emitEvent(_0x242aeb){return function(_0x5f0ff6,_0x5af8cf,_0x2af8b9){_0x5f0ff6[_0xa3df('0x6')]({'attributes':['id'],'raw':!![]})[_0xa3df('0x7')](function(_0x1b9ae5){_0x5f0ff6[_0xa3df('0x8')](_0xa3df('0x9'),_0x1b9ae5['map'](function(_0x1289fb){return{'id':_0x1289fb['id']};}));return MailMessage[_0xa3df('0xa')]({'where':{'MailInteractionId':_0x5f0ff6['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa3df('0x7')](function(_0xa25eab){_0x5f0ff6['setDataValue'](_0xa3df('0xb'),_0xa25eab[_0xa3df('0xc')]);MailInteractionEvents[_0xa3df('0xd')](_0x242aeb+':'+_0x5f0ff6['id'],_0x5f0ff6);MailInteractionEvents[_0xa3df('0xd')](_0x242aeb,_0x5f0ff6);_0x2af8b9(null);})[_0xa3df('0xe')](_0x2af8b9(null));};}for(var e in events){if(events[_0xa3df('0xf')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0xa3df('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 8a5e6f5..0471103 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 _0x6f89=['FULLTEXT','substatusAt','format','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','changed','substatus','models','get','update','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6f89,0x1ea));var _0x96f8=function(_0x3b93ac,_0x1b1796){_0x3b93ac=_0x3b93ac-0x0;var _0x761236=_0x6f89[_0x3b93ac];return _0x761236;};'use strict';var _=require(_0x96f8('0x0'));var util=require(_0x96f8('0x1'));var logger=require('../../config/logger')(_0x96f8('0x2'));var moment=require(_0x96f8('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x96f8('0x4'));var rimraf=require(_0x96f8('0x5'));var config=require(_0x96f8('0x6'));var attributes=require(_0x96f8('0x7'));module[_0x96f8('0x8')]=function(_0x118ae6,_0x41434c){return _0x118ae6[_0x96f8('0x9')](_0x96f8('0xa'),attributes,{'tableName':_0x96f8('0xb'),'paranoid':![],'indexes':[{'name':_0x96f8('0xc'),'fields':[_0x96f8('0xd'),'to'],'type':_0x96f8('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x447108,_0x9d5667,_0x1dfdc3){if(_0x447108['substatus']){_0x447108[_0x96f8('0xf')]=moment()[_0x96f8('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x447108[_0x96f8('0x11')]){_0x447108[_0x96f8('0x12')]=moment()[_0x96f8('0x10')](_0x96f8('0x13'));}_0x1dfdc3(null,_0x9d5667);},'beforeUpdate':function(_0x450b48,_0x87c6f,_0x43ce8c){if(_0x450b48[_0x96f8('0x14')](_0x96f8('0x15'))){_0x450b48[_0x96f8('0xf')]=_0x450b48[_0x96f8('0x15')]?moment()[_0x96f8('0x10')](_0x96f8('0x13')):null;}if(_0x450b48['changed'](_0x96f8('0x11'))){_0x450b48['closedAt']=moment()['format'](_0x96f8('0x13'));_0x450b48[_0x96f8('0x15')]=null;_0x450b48[_0x96f8('0xf')]=null;}_0x43ce8c(null,_0x450b48);},'afterUpdate':function(_0x50bb90,_0x53ed5e,_0x408b6b){var _0x16a42d=_0x118ae6[_0x96f8('0x16')];var _0x3f8e5f=_0x50bb90[_0x96f8('0x17')]({'plain':!![]});if(_0x3f8e5f[_0x96f8('0x11')]){return _0x16a42d['MailMessage'][_0x96f8('0x18')]({'read':!![]},{'where':{'MailInteractionId':_0x3f8e5f['id']}})['then'](function(){_0x408b6b();})[_0x96f8('0x19')](function(_0x3bba6b){_0x408b6b(_0x3bba6b);});}else{_0x408b6b();}}},'charset':_0x96f8('0x1a'),'collate':_0x96f8('0x1b')});}; \ No newline at end of file +var _0x8daa=['catch','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','get','MailMessage','update'];(function(_0x40a675,_0x5634eb){var _0x122c40=function(_0xacfc21){while(--_0xacfc21){_0x40a675['push'](_0x40a675['shift']());}};_0x122c40(++_0x5634eb);}(_0x8daa,0x1dc));var _0xa8da=function(_0x4a8418,_0x39078a){_0x4a8418=_0x4a8418-0x0;var _0x390174=_0x8daa[_0x4a8418];return _0x390174;};'use strict';var _=require(_0xa8da('0x0'));var util=require(_0xa8da('0x1'));var logger=require(_0xa8da('0x2'))(_0xa8da('0x3'));var moment=require(_0xa8da('0x4'));var BPromise=require(_0xa8da('0x5'));var rp=require(_0xa8da('0x6'));var fs=require('fs');var path=require(_0xa8da('0x7'));var rimraf=require(_0xa8da('0x8'));var config=require('../../config/environment');var attributes=require('./mailInteraction.attributes');module[_0xa8da('0x9')]=function(_0x169f12,_0x3d54f9){return _0x169f12[_0xa8da('0xa')]('MailInteraction',attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0xa8da('0xb'),'fields':[_0xa8da('0xc'),'to'],'type':_0xa8da('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2dfff6,_0x1778e1,_0x3587be){if(_0x2dfff6[_0xa8da('0xe')]){_0x2dfff6[_0xa8da('0xf')]=moment()[_0xa8da('0x10')](_0xa8da('0x11'));}if(_0x2dfff6[_0xa8da('0x12')]){_0x2dfff6[_0xa8da('0x13')]=moment()['format'](_0xa8da('0x11'));}_0x3587be(null,_0x1778e1);},'beforeUpdate':function(_0x2929d7,_0x37bf04,_0x317581){if(_0x2929d7[_0xa8da('0x14')](_0xa8da('0xe'))){_0x2929d7['substatusAt']=_0x2929d7[_0xa8da('0xe')]?moment()[_0xa8da('0x10')](_0xa8da('0x11')):null;}if(_0x2929d7[_0xa8da('0x14')](_0xa8da('0x12'))){_0x2929d7['closedAt']=moment()[_0xa8da('0x10')](_0xa8da('0x11'));_0x2929d7[_0xa8da('0xe')]=null;_0x2929d7[_0xa8da('0xf')]=null;}_0x317581(null,_0x2929d7);},'afterUpdate':function(_0x23bf7a,_0x3b7317,_0x2bd2e0){var _0x5ef020=_0x169f12['models'];var _0x47ea71=_0x23bf7a[_0xa8da('0x15')]({'plain':!![]});if(_0x47ea71[_0xa8da('0x12')]){return _0x5ef020[_0xa8da('0x16')][_0xa8da('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x47ea71['id']}})['then'](function(){_0x2bd2e0();})[_0xa8da('0x18')](function(_0x2cfde5){_0x2bd2e0(_0x2cfde5);});}else{_0x2bd2e0();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 345a67a..bf03d06 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 _0x2df7=['limit','catch','addTags','ids','omit','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./mailInteraction.socket','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','UpdateMailInteraction','MailInteraction','update','body','options','where'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x2df7,0x1f4));var _0x72df=function(_0x284f04,_0x1f561e){_0x284f04=_0x284f04-0x0;var _0x33dda0=_0x2df7[_0x284f04];return _0x33dda0;};'use strict';var _=require(_0x72df('0x0'));var util=require('util');var moment=require(_0x72df('0x1'));var BPromise=require(_0x72df('0x2'));var rs=require(_0x72df('0x3'));var fs=require('fs');var Redis=require(_0x72df('0x4'));var db=require(_0x72df('0x5'))['db'];var utils=require(_0x72df('0x6'));var logger=require('../../config/logger')(_0x72df('0x7'));var config=require(_0x72df('0x8'));var jayson=require(_0x72df('0x9'));var client=jayson['client'][_0x72df('0xa')]({'port':0x232a});config[_0x72df('0xb')]=_['defaults'](config['redis'],{'host':_0x72df('0xc'),'port':0x18eb});var socket=require(_0x72df('0xd'))(new Redis(config['redis']));require(_0x72df('0xe'))['register'](socket);function respondWithRpcPromise(_0x5c6c8e,_0x1ed101,_0x29bb65){return new BPromise(function(_0x44664c,_0x320436){return client[_0x72df('0xf')](_0x5c6c8e,_0x29bb65)[_0x72df('0x10')](function(_0x26ccc2){logger[_0x72df('0x11')](_0x72df('0x12'),_0x1ed101,_0x72df('0x13'));logger[_0x72df('0x14')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x1ed101,_0x72df('0x13'),JSON[_0x72df('0x15')](_0x26ccc2));if(_0x26ccc2[_0x72df('0x16')]){if(_0x26ccc2['error'][_0x72df('0x17')]===0x1f4){logger[_0x72df('0x16')](_0x72df('0x12'),_0x1ed101,_0x26ccc2['error'][_0x72df('0x18')]);return _0x320436(_0x26ccc2[_0x72df('0x16')][_0x72df('0x18')]);}logger[_0x72df('0x16')]('MailInteraction,\x20%s,\x20%s',_0x1ed101,_0x26ccc2[_0x72df('0x16')][_0x72df('0x18')]);return _0x44664c(_0x26ccc2[_0x72df('0x16')][_0x72df('0x18')]);}else{logger[_0x72df('0x11')](_0x72df('0x12'),_0x1ed101,_0x72df('0x13'));_0x44664c(_0x26ccc2[_0x72df('0x19')][_0x72df('0x18')]);}})['catch'](function(_0x43214b){logger[_0x72df('0x16')](_0x72df('0x12'),_0x1ed101,_0x43214b);_0x320436(_0x43214b);});});}exports[_0x72df('0x1a')]=function(_0x2c9e0a){var _0x1d6a39=this;return new Promise(function(_0x423970,_0x27e1dd){return db[_0x72df('0x1b')][_0x72df('0x1c')](_0x2c9e0a[_0x72df('0x1d')],{'raw':_0x2c9e0a[_0x72df('0x1e')]?_0x2c9e0a['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c9e0a[_0x72df('0x1e')]?_0x2c9e0a[_0x72df('0x1e')][_0x72df('0x1f')]||null:null,'attributes':_0x2c9e0a[_0x72df('0x1e')]?_0x2c9e0a[_0x72df('0x1e')]['attributes']||null:null,'limit':_0x2c9e0a[_0x72df('0x1e')]?_0x2c9e0a[_0x72df('0x1e')][_0x72df('0x20')]||null:null})['then'](function(_0x102345){logger[_0x72df('0x11')](_0x72df('0x1a'),_0x2c9e0a);logger[_0x72df('0x14')](_0x72df('0x1a'),_0x2c9e0a,JSON[_0x72df('0x15')](_0x102345));_0x423970(_0x102345);})[_0x72df('0x21')](function(_0x167dd9){logger[_0x72df('0x16')](_0x72df('0x1a'),_0x167dd9['message'],_0x2c9e0a);_0x27e1dd(_0x1d6a39['error'](0x1f4,_0x167dd9[_0x72df('0x18')]));});});};exports['AddTagsToMailInteraction']=function(_0xeddd03){return new Promise(function(_0x4b535d,_0x4afed4){return db[_0x72df('0x1b')]['find']({'where':_0xeddd03[_0x72df('0x1e')]?_0xeddd03[_0x72df('0x1e')]['where']||null:null})[_0x72df('0x10')](function(_0x12cee4){if(_0x12cee4){return _0x12cee4[_0x72df('0x22')](_0xeddd03[_0x72df('0x1d')][_0x72df('0x23')],_[_0x72df('0x24')](_0xeddd03[_0x72df('0x1d')],['ids','id'])||{});}})['spread'](function(_0x1f074d){logger[_0x72df('0x11')](_0x72df('0x25'),_0xeddd03);logger['debug'](_0x72df('0x25'),_0xeddd03,JSON[_0x72df('0x15')](_0x1f074d));_0x4b535d(_0x1f074d);})['catch'](function(_0x5f35f4){logger[_0x72df('0x16')](_0x72df('0x25'),_0x5f35f4[_0x72df('0x18')],_0xeddd03);_0x4afed4(_this['error'](0x1f4,_0x5f35f4['message']));});});}; \ No newline at end of file +var _0x82cf=['update','body','options','where','attributes','limit','then','debug','AddTagsToMailInteraction','MailInteraction','find','addTags','omit','ids','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','register','request','MailInteraction,\x20%s,\x20%s','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','UpdateMailInteraction'];(function(_0x2495a6,_0x106ab2){var _0x15d302=function(_0x184ef7){while(--_0x184ef7){_0x2495a6['push'](_0x2495a6['shift']());}};_0x15d302(++_0x106ab2);}(_0x82cf,0xe1));var _0xf82c=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x82cf[_0x273c39];return _0x46d6b5;};'use strict';var _=require(_0xf82c('0x0'));var util=require(_0xf82c('0x1'));var moment=require(_0xf82c('0x2'));var BPromise=require('bluebird');var rs=require(_0xf82c('0x3'));var fs=require('fs');var Redis=require(_0xf82c('0x4'));var db=require(_0xf82c('0x5'))['db'];var utils=require(_0xf82c('0x6'));var logger=require(_0xf82c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf82c('0x8'));var client=jayson[_0xf82c('0x9')][_0xf82c('0xa')]({'port':0x232a});config[_0xf82c('0xb')]=_[_0xf82c('0xc')](config[_0xf82c('0xb')],{'host':_0xf82c('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailInteraction.socket')[_0xf82c('0xe')](socket);function respondWithRpcPromise(_0x8c825f,_0x345141,_0x452815){return new BPromise(function(_0x49c295,_0xc6fd21){return client[_0xf82c('0xf')](_0x8c825f,_0x452815)['then'](function(_0x3ce4a4){logger['info'](_0xf82c('0x10'),_0x345141,'request\x20sent');logger['debug'](_0xf82c('0x11'),_0x345141,_0xf82c('0x12'),JSON[_0xf82c('0x13')](_0x3ce4a4));if(_0x3ce4a4[_0xf82c('0x14')]){if(_0x3ce4a4['error'][_0xf82c('0x15')]===0x1f4){logger[_0xf82c('0x14')](_0xf82c('0x10'),_0x345141,_0x3ce4a4[_0xf82c('0x14')][_0xf82c('0x16')]);return _0xc6fd21(_0x3ce4a4[_0xf82c('0x14')]['message']);}logger[_0xf82c('0x14')](_0xf82c('0x10'),_0x345141,_0x3ce4a4[_0xf82c('0x14')]['message']);return _0x49c295(_0x3ce4a4[_0xf82c('0x14')][_0xf82c('0x16')]);}else{logger[_0xf82c('0x17')]('MailInteraction,\x20%s,\x20%s',_0x345141,_0xf82c('0x12'));_0x49c295(_0x3ce4a4[_0xf82c('0x18')][_0xf82c('0x16')]);}})[_0xf82c('0x19')](function(_0x55ceec){logger['error'](_0xf82c('0x10'),_0x345141,_0x55ceec);_0xc6fd21(_0x55ceec);});});}exports[_0xf82c('0x1a')]=function(_0x2d8f0c){var _0x95d0af=this;return new Promise(function(_0x22e443,_0x261ba2){return db['MailInteraction'][_0xf82c('0x1b')](_0x2d8f0c[_0xf82c('0x1c')],{'raw':_0x2d8f0c[_0xf82c('0x1d')]?_0x2d8f0c['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d8f0c[_0xf82c('0x1d')]?_0x2d8f0c[_0xf82c('0x1d')][_0xf82c('0x1e')]||null:null,'attributes':_0x2d8f0c[_0xf82c('0x1d')]?_0x2d8f0c[_0xf82c('0x1d')][_0xf82c('0x1f')]||null:null,'limit':_0x2d8f0c[_0xf82c('0x1d')]?_0x2d8f0c[_0xf82c('0x1d')][_0xf82c('0x20')]||null:null})[_0xf82c('0x21')](function(_0x420081){logger['info']('UpdateMailInteraction',_0x2d8f0c);logger[_0xf82c('0x22')](_0xf82c('0x1a'),_0x2d8f0c,JSON[_0xf82c('0x13')](_0x420081));_0x22e443(_0x420081);})[_0xf82c('0x19')](function(_0x2560f2){logger['error']('UpdateMailInteraction',_0x2560f2['message'],_0x2d8f0c);_0x261ba2(_0x95d0af[_0xf82c('0x14')](0x1f4,_0x2560f2[_0xf82c('0x16')]));});});};exports[_0xf82c('0x23')]=function(_0x112b41){return new Promise(function(_0x500f85,_0x2f0a01){return db[_0xf82c('0x24')][_0xf82c('0x25')]({'where':_0x112b41[_0xf82c('0x1d')]?_0x112b41[_0xf82c('0x1d')][_0xf82c('0x1e')]||null:null})[_0xf82c('0x21')](function(_0x1fb589){if(_0x1fb589){return _0x1fb589[_0xf82c('0x26')](_0x112b41[_0xf82c('0x1c')]['ids'],_[_0xf82c('0x27')](_0x112b41[_0xf82c('0x1c')],[_0xf82c('0x28'),'id'])||{});}})['spread'](function(_0x3698ac){logger['info'](_0xf82c('0x29'),_0x112b41);logger[_0xf82c('0x22')](_0xf82c('0x29'),_0x112b41,JSON[_0xf82c('0x13')](_0x3698ac));_0x500f85(_0x3698ac);})[_0xf82c('0x19')](function(_0x309c71){logger[_0xf82c('0x14')]('AddTags',_0x309c71[_0xf82c('0x16')],_0x112b41);_0x2f0a01(_this[_0xf82c('0x14')](0x1f4,_0x309c71[_0xf82c('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index f887f10..74d04d8 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 _0x7c24=['register','length','mailInteraction:','./mailInteraction.events','save','remove','update','emit'];(function(_0x14f7ad,_0x536340){var _0x542aff=function(_0x42779a){while(--_0x42779a){_0x14f7ad['push'](_0x14f7ad['shift']());}};_0x542aff(++_0x536340);}(_0x7c24,0x1ab));var _0x47c2=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x7c24[_0x12fc8d];return _0x3f9d04;};'use strict';var MailInteractionEvents=require(_0x47c2('0x0'));var events=[_0x47c2('0x1'),_0x47c2('0x2'),_0x47c2('0x3')];function createListener(_0x4af652,_0x205e32){return function(_0x410f18){_0x205e32[_0x47c2('0x4')](_0x4af652,_0x410f18);};}function removeListener(_0xad3b37,_0x2cc0ba){return function(){MailInteractionEvents['removeListener'](_0xad3b37,_0x2cc0ba);};}exports[_0x47c2('0x5')]=function(_0x53ccd8){for(var _0x3ea1d1=0x0,_0x3ffbcc=events[_0x47c2('0x6')];_0x3ea1d1<_0x3ffbcc;_0x3ea1d1++){var _0x27cc6d=events[_0x3ea1d1];var _0x1c8ffe=createListener(_0x47c2('0x7')+_0x27cc6d,_0x53ccd8);MailInteractionEvents['on'](_0x27cc6d,_0x1c8ffe);}}; \ No newline at end of file +var _0xee53=['emit','removeListener','register','./mailInteraction.events','update'];(function(_0x4b26b5,_0x4f71fd){var _0x4dec71=function(_0x184329){while(--_0x184329){_0x4b26b5['push'](_0x4b26b5['shift']());}};_0x4dec71(++_0x4f71fd);}(_0xee53,0x161));var _0x3ee5=function(_0x2cef86,_0xbae0a6){_0x2cef86=_0x2cef86-0x0;var _0x46dfd6=_0xee53[_0x2cef86];return _0x46dfd6;};'use strict';var MailInteractionEvents=require(_0x3ee5('0x0'));var events=['save','remove',_0x3ee5('0x1')];function createListener(_0x1bb9f8,_0x213b5d){return function(_0x1ebba8){_0x213b5d[_0x3ee5('0x2')](_0x1bb9f8,_0x1ebba8);};}function removeListener(_0x4847e4,_0x2101d6){return function(){MailInteractionEvents[_0x3ee5('0x3')](_0x4847e4,_0x2101d6);};}exports[_0x3ee5('0x4')]=function(_0x5a3a89){for(var _0x4cfd4a=0x0,_0x114340=events['length'];_0x4cfd4a<_0x114340;_0x4cfd4a++){var _0x3b9aef=events[_0x4cfd4a];var _0x29bc61=createListener('mailInteraction:'+_0x3b9aef,_0x5a3a89);MailInteractionEvents['on'](_0x3b9aef,_0x29bc61);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 92c036a..27d4d89 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 _0xad72=['multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./mailMessage.controller','get','/describe','isAuthenticated','describe','/:id','download','post','mail','create','put','update','/:id/accept','accept','/:id/reject','reject','destroy'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xad72,0x198));var _0x2ad7=function(_0x500351,_0xc6b613){_0x500351=_0x500351-0x0;var _0xe20c59=_0xad72[_0x500351];return _0xe20c59;};'use strict';var multer=require(_0x2ad7('0x0'));var util=require(_0x2ad7('0x1'));var path=require(_0x2ad7('0x2'));var timeout=require('connect-timeout');var express=require(_0x2ad7('0x3'));var router=express[_0x2ad7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2ad7('0x5'));var interaction=require(_0x2ad7('0x6'));var config=require('../../config/environment');var controller=require(_0x2ad7('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x2ad7('0x8')](_0x2ad7('0x9'),auth[_0x2ad7('0xa')](),controller[_0x2ad7('0xb')]);router[_0x2ad7('0x8')](_0x2ad7('0xc'),auth[_0x2ad7('0xa')](),controller['show']);router[_0x2ad7('0x8')]('/:id/download',auth[_0x2ad7('0xa')](),controller[_0x2ad7('0xd')]);router[_0x2ad7('0xe')]('/',auth[_0x2ad7('0xa')](),interaction['tracked'](_0x2ad7('0xf'),'mailmessage:create'),controller[_0x2ad7('0x10')]);router[_0x2ad7('0x11')](_0x2ad7('0xc'),auth[_0x2ad7('0xa')](),controller[_0x2ad7('0x12')]);router[_0x2ad7('0x11')](_0x2ad7('0x13'),auth['isAuthenticated'](),controller[_0x2ad7('0x14')]);router[_0x2ad7('0x11')](_0x2ad7('0x15'),auth['isAuthenticated'](),controller[_0x2ad7('0x16')]);router['delete'](_0x2ad7('0xc'),auth[_0x2ad7('0xa')](),controller[_0x2ad7('0x17')]);module['exports']=router; \ No newline at end of file +var _0x976a=['../../config/environment','./mailMessage.controller','get','/describe','isAuthenticated','describe','/:id','show','post','tracked','mail','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x225497,_0x6734f5){var _0x155ad1=function(_0x5815da){while(--_0x5815da){_0x225497['push'](_0x225497['shift']());}};_0x155ad1(++_0x6734f5);}(_0x976a,0xf4));var _0xa976=function(_0x443547,_0x21d7a8){_0x443547=_0x443547-0x0;var _0x1423a8=_0x976a[_0x443547];return _0x1423a8;};'use strict';var multer=require(_0xa976('0x0'));var util=require(_0xa976('0x1'));var path=require(_0xa976('0x2'));var timeout=require('connect-timeout');var express=require(_0xa976('0x3'));var router=express[_0xa976('0x4')]();var fs_extra=require(_0xa976('0x5'));var auth=require(_0xa976('0x6'));var interaction=require(_0xa976('0x7'));var config=require(_0xa976('0x8'));var controller=require(_0xa976('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xa976('0xa')](_0xa976('0xb'),auth[_0xa976('0xc')](),controller[_0xa976('0xd')]);router[_0xa976('0xa')](_0xa976('0xe'),auth[_0xa976('0xc')](),controller[_0xa976('0xf')]);router[_0xa976('0xa')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0xa976('0x10')]('/',auth[_0xa976('0xc')](),interaction[_0xa976('0x11')](_0xa976('0x12'),'mailmessage:create'),controller[_0xa976('0x13')]);router[_0xa976('0x14')](_0xa976('0xe'),auth[_0xa976('0xc')](),controller[_0xa976('0x15')]);router[_0xa976('0x14')]('/:id/accept',auth[_0xa976('0xc')](),controller[_0xa976('0x16')]);router[_0xa976('0x14')](_0xa976('0x17'),auth[_0xa976('0xc')](),controller[_0xa976('0x18')]);router[_0xa976('0x19')](_0xa976('0xe'),auth[_0xa976('0xc')](),controller[_0xa976('0x1a')]);module[_0xa976('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 1f111f5..f15dc4e 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 _0x5edf=['BOOLEAN','out','STRING','DATE','INTEGER','ENUM','Email','Chat','sequelize','exports','TEXT','long'];(function(_0x5bf9cb,_0x3d6db8){var _0x20bd1b=function(_0x3f352c){while(--_0x3f352c){_0x5bf9cb['push'](_0x5bf9cb['shift']());}};_0x20bd1b(++_0x3d6db8);}(_0x5edf,0x188));var _0xf5ed=function(_0x154dff,_0x7a686d){_0x154dff=_0x154dff-0x0;var _0x548fe3=_0x5edf[_0x154dff];return _0x548fe3;};'use strict';var Sequelize=require(_0xf5ed('0x0'));var _=require('lodash');module[_0xf5ed('0x1')]={'body':{'type':Sequelize[_0xf5ed('0x2')](_0xf5ed('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf5ed('0x2')]('medium')},'read':{'type':Sequelize[_0xf5ed('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xf5ed('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xf5ed('0x6')](0x1fe)},'from':{'type':Sequelize[_0xf5ed('0x6')]},'to':{'type':Sequelize['TEXT'](_0xf5ed('0x3'))},'cc':{'type':Sequelize[_0xf5ed('0x2')](_0xf5ed('0x3'))},'bcc':{'type':Sequelize[_0xf5ed('0x2')](_0xf5ed('0x3'))},'subject':{'type':Sequelize[_0xf5ed('0x2')]},'sentAt':{'type':Sequelize[_0xf5ed('0x7')]},'attach':{'type':Sequelize[_0xf5ed('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xf5ed('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0xf5ed('0x2')](_0xf5ed('0x3'))},'originCc':{'type':Sequelize[_0xf5ed('0x2')](_0xf5ed('0x3'))},'originChannel':{'type':Sequelize[_0xf5ed('0x9')](_0xf5ed('0xa'),_0xf5ed('0xb')),'defaultValue':_0xf5ed('0xa'),'allowNull':![]}}; \ No newline at end of file +var _0x84bd=['ENUM','STRING','long','DATE','INTEGER','Email','sequelize','lodash','exports','TEXT','medium','BOOLEAN'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x84bd,0x126));var _0xd84b=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x84bd[_0x5a776b];return _0xbbef59;};'use strict';var Sequelize=require(_0xd84b('0x0'));var _=require(_0xd84b('0x1'));module[_0xd84b('0x2')]={'body':{'type':Sequelize['TEXT']('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xd84b('0x3')](_0xd84b('0x4'))},'read':{'type':Sequelize[_0xd84b('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd84b('0x6')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xd84b('0x7')](0x1fe)},'from':{'type':Sequelize[_0xd84b('0x7')]},'to':{'type':Sequelize['TEXT']('long')},'cc':{'type':Sequelize['TEXT'](_0xd84b('0x8'))},'bcc':{'type':Sequelize[_0xd84b('0x3')]('long')},'subject':{'type':Sequelize[_0xd84b('0x3')]},'sentAt':{'type':Sequelize[_0xd84b('0x9')]},'attach':{'type':Sequelize[_0xd84b('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0xd84b('0x9')]},'originTo':{'type':Sequelize['TEXT'](_0xd84b('0x8'))},'originCc':{'type':Sequelize['TEXT']('long')},'originChannel':{'type':Sequelize[_0xd84b('0x6')](_0xd84b('0xb'),'Chat'),'defaultValue':_0xd84b('0xb'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 545fb17..7a324bf 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 _0x3b02=['get','MailInteraction','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','User','email','internal','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SELECT','fullname','download','unix','toString','join','server','files','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','writeFileSync','eml-format','path','lodash','html-to-text','../../components/parsers/qs','api','../../config/logger','mail-interactions','../../config/environment','redis','defaults','socket.io-emitter','html-entities','./mailMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s','message','result','catch','status','json','limit','undefined','count','offset','update','sendStatus','stack','name','index','map','MailMessage','rawAttributes','fieldName','query','keys','filters','intersection','attributes','model','fields','length','nolimit','sort','pick','filter','merge','type','include','findAll','show','find','body','params','describe','create','direction','out','secret','MailAccount','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','root','server/files/attachments','basename','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','readAt','UserId','user','agent'];(function(_0x5a8d21,_0x463828){var _0x4ddaa7=function(_0x10f309){while(--_0x10f309){_0x5a8d21['push'](_0x5a8d21['shift']());}};_0x4ddaa7(++_0x463828);}(_0x3b02,0x1e4));var _0x23b0=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x3b02[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0x23b0('0x0'));var moment=require('moment');var BPromise=require('bluebird');var util=require('util');var path=require(_0x23b0('0x1'));var fs=require('fs');var _=require(_0x23b0('0x2'));var Redis=require('ioredis');var htmlToText=require(_0x23b0('0x3'));var qs=require(_0x23b0('0x4'));var logger=require('../../config/logger')(_0x23b0('0x5'));var interaction_log=require(_0x23b0('0x6'))(_0x23b0('0x7'));var config=require(_0x23b0('0x8'));var db=require('../../mysqldb')['db'];config[_0x23b0('0x9')]=_[_0x23b0('0xa')](config[_0x23b0('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x23b0('0xb'))(new Redis(config[_0x23b0('0x9')]));var htmlEntities=require(_0x23b0('0xc'));require(_0x23b0('0xd'))[_0x23b0('0xe')](socket);var jayson=require(_0x23b0('0xf'));var client=jayson[_0x23b0('0x10')][_0x23b0('0x11')]({'port':0x232c});var client9003=jayson[_0x23b0('0x10')][_0x23b0('0x11')]({'port':0x232b});var client9002=jayson[_0x23b0('0x10')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f1d2a,_0x4b0196,_0x35d72f,_0x230418){return new BPromise(function(_0x316f67,_0x343f3e){var _0x3c3695=_0x230418||client;return _0x3c3695[_0x23b0('0x12')](_0x4f1d2a,_0x35d72f)[_0x23b0('0x13')](function(_0x26e330){logger[_0x23b0('0x14')]('MailMessage,\x20%s,\x20%s',_0x4b0196,_0x23b0('0x15'));logger[_0x23b0('0x16')](_0x23b0('0x17'),_0x4b0196,_0x23b0('0x15'),JSON[_0x23b0('0x18')](_0x26e330));if(_0x26e330[_0x23b0('0x19')]){if(_0x26e330['error'][_0x23b0('0x1a')]===0x1f4){logger['error'](_0x23b0('0x1b'),_0x4b0196,_0x26e330['error'][_0x23b0('0x1c')]);return _0x343f3e(_0x26e330[_0x23b0('0x19')][_0x23b0('0x1c')]);}logger[_0x23b0('0x19')](_0x23b0('0x1b'),_0x4b0196,_0x26e330['error']['message']);return _0x316f67(_0x26e330['error'][_0x23b0('0x1c')]);}else{logger[_0x23b0('0x14')]('MailMessage,\x20%s,\x20%s',_0x4b0196,'request\x20sent');_0x316f67(_0x26e330[_0x23b0('0x1d')][_0x23b0('0x1c')]);}})[_0x23b0('0x1e')](function(_0x39f0be){logger[_0x23b0('0x19')](_0x23b0('0x1b'),_0x4b0196,_0x39f0be);_0x343f3e(_0x39f0be);});});}function respondWithResult(_0x1c0b95,_0x17db65){_0x17db65=_0x17db65||0xc8;return function(_0x594c31){if(_0x594c31){return _0x1c0b95[_0x23b0('0x1f')](_0x17db65)[_0x23b0('0x20')](_0x594c31);}};}function respondWithFilteredResult(_0x56d627,_0x1965ec){return function(_0x572362){if(_0x572362){var _0x2d4409=typeof _0x1965ec['offset']==='undefined'&&typeof _0x1965ec[_0x23b0('0x21')]===_0x23b0('0x22');var _0x530633=_0x572362[_0x23b0('0x23')];var _0x395ed5=_0x2d4409?0x0:_0x1965ec[_0x23b0('0x24')];var _0x54e0bd=_0x2d4409?_0x572362['count']:_0x1965ec[_0x23b0('0x24')]+_0x1965ec[_0x23b0('0x21')];var _0x25057f;if(_0x54e0bd>=_0x530633){_0x54e0bd=_0x530633;_0x25057f=0xc8;}else{_0x25057f=0xce;}_0x56d627[_0x23b0('0x1f')](_0x25057f);return _0x56d627['set']('Content-Range',_0x395ed5+'-'+_0x54e0bd+'/'+_0x530633)[_0x23b0('0x20')](_0x572362);}return null;};}function saveUpdates(_0x560afc){return function(_0x135000){if(_0x135000){return _0x135000[_0x23b0('0x25')](_0x560afc)[_0x23b0('0x13')](function(_0x390f6a){return _0x390f6a;});}return null;};}function removeEntity(_0x54fe0a){return function(_0x4e1306){if(_0x4e1306){return _0x4e1306['destroy']()[_0x23b0('0x13')](function(){_0x54fe0a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1bb8ed){return function(_0x3ea0a0){if(!_0x3ea0a0){_0x1bb8ed[_0x23b0('0x26')](0x194);}return _0x3ea0a0;};}function handleError(_0x3913fd,_0x7c3113){_0x7c3113=_0x7c3113||0x1f4;return function(_0x5dc201){logger[_0x23b0('0x19')](_0x5dc201[_0x23b0('0x27')]);if(_0x5dc201[_0x23b0('0x28')]){delete _0x5dc201[_0x23b0('0x28')];}_0x3913fd['status'](_0x7c3113)['send'](_0x5dc201);};}exports[_0x23b0('0x29')]=function(_0xec0ab2,_0x3d83d8){var _0x55c0fd={},_0x33cc59={},_0x4daeef={'count':0x0,'rows':[]};var _0x47f4d4=_[_0x23b0('0x2a')](db[_0x23b0('0x2b')][_0x23b0('0x2c')],function(_0x37bd9f){return{'name':_0x37bd9f[_0x23b0('0x2d')],'type':_0x37bd9f['type']['key']};});_0x33cc59['model']=_[_0x23b0('0x2a')](_0x47f4d4,'name');_0x33cc59[_0x23b0('0x2e')]=_[_0x23b0('0x2f')](_0xec0ab2[_0x23b0('0x2e')]);_0x33cc59[_0x23b0('0x30')]=_[_0x23b0('0x31')](_0x33cc59['model'],_0x33cc59['query']);_0x55c0fd[_0x23b0('0x32')]=_[_0x23b0('0x31')](_0x33cc59[_0x23b0('0x33')],qs[_0x23b0('0x34')](_0xec0ab2[_0x23b0('0x2e')][_0x23b0('0x34')]));_0x55c0fd[_0x23b0('0x32')]=_0x55c0fd['attributes'][_0x23b0('0x35')]?_0x55c0fd['attributes']:_0x33cc59[_0x23b0('0x33')];if(!_0xec0ab2['query']['hasOwnProperty'](_0x23b0('0x36'))){_0x55c0fd[_0x23b0('0x21')]=qs[_0x23b0('0x21')](_0xec0ab2[_0x23b0('0x2e')][_0x23b0('0x21')]);_0x55c0fd['offset']=qs['offset'](_0xec0ab2[_0x23b0('0x2e')]['offset']);}_0x55c0fd['order']=qs[_0x23b0('0x37')](_0xec0ab2[_0x23b0('0x2e')][_0x23b0('0x37')]);_0x55c0fd['where']=qs['filters'](_[_0x23b0('0x38')](_0xec0ab2[_0x23b0('0x2e')],_0x33cc59[_0x23b0('0x30')]),_0x47f4d4);if(_0xec0ab2[_0x23b0('0x2e')][_0x23b0('0x39')]){_0x55c0fd['where']=_[_0x23b0('0x3a')](_0x55c0fd['where'],{'$or':_[_0x23b0('0x2a')](_0x47f4d4,function(_0x52d8c0){if(_0x52d8c0[_0x23b0('0x3b')]!=='VIRTUAL'){var _0x317cec={};_0x317cec[_0x52d8c0[_0x23b0('0x28')]]={'$like':'%'+_0xec0ab2[_0x23b0('0x2e')]['filter']+'%'};return _0x317cec;}})});}_0x55c0fd=_[_0x23b0('0x3a')]({},_0x55c0fd,_0xec0ab2['options']);var _0x3385bc={'where':_0x55c0fd['where']};return db['MailMessage'][_0x23b0('0x23')](_0x3385bc)[_0x23b0('0x13')](function(_0x5d5d42){_0x4daeef[_0x23b0('0x23')]=_0x5d5d42;if(_0xec0ab2[_0x23b0('0x2e')]['includeAll']){_0x55c0fd[_0x23b0('0x3c')]=[{'all':!![]}];}return db[_0x23b0('0x2b')][_0x23b0('0x3d')](_0x55c0fd);})[_0x23b0('0x13')](function(_0x436224){_0x4daeef['rows']=_0x436224;return _0x4daeef;})['then'](respondWithFilteredResult(_0x3d83d8,_0x55c0fd))[_0x23b0('0x1e')](handleError(_0x3d83d8,null));};exports[_0x23b0('0x3e')]=function(_0x2a9862,_0x408df7){var _0x28a94e={'raw':!![],'where':{'id':_0x2a9862['params']['id']}},_0x3caa52={};_0x3caa52[_0x23b0('0x33')]=_[_0x23b0('0x2f')](db[_0x23b0('0x2b')]['rawAttributes']);_0x3caa52[_0x23b0('0x2e')]=_[_0x23b0('0x2f')](_0x2a9862['query']);_0x3caa52[_0x23b0('0x30')]=_[_0x23b0('0x31')](_0x3caa52['model'],_0x3caa52[_0x23b0('0x2e')]);_0x28a94e[_0x23b0('0x32')]=_[_0x23b0('0x31')](_0x3caa52['model'],qs[_0x23b0('0x34')](_0x2a9862[_0x23b0('0x2e')]['fields']));_0x28a94e[_0x23b0('0x32')]=_0x28a94e[_0x23b0('0x32')][_0x23b0('0x35')]?_0x28a94e[_0x23b0('0x32')]:_0x3caa52['model'];if(_0x2a9862[_0x23b0('0x2e')]['includeAll']){_0x28a94e[_0x23b0('0x3c')]=[{'all':!![]}];}_0x28a94e=_['merge']({},_0x28a94e,_0x2a9862['options']);return db[_0x23b0('0x2b')][_0x23b0('0x3f')](_0x28a94e)[_0x23b0('0x13')](handleEntityNotFound(_0x408df7,null))[_0x23b0('0x13')](respondWithResult(_0x408df7,null))[_0x23b0('0x1e')](handleError(_0x408df7,null));};exports[_0x23b0('0x25')]=function(_0x201744,_0x213ad4){if(_0x201744[_0x23b0('0x40')]['id']){delete _0x201744[_0x23b0('0x40')]['id'];}return db['MailMessage'][_0x23b0('0x3f')]({'where':{'id':_0x201744[_0x23b0('0x41')]['id']}})['then'](handleEntityNotFound(_0x213ad4,null))[_0x23b0('0x13')](saveUpdates(_0x201744[_0x23b0('0x40')],null))[_0x23b0('0x13')](respondWithResult(_0x213ad4,null))[_0x23b0('0x1e')](handleError(_0x213ad4,null));};exports['destroy']=function(_0x544d47,_0x527418){return db[_0x23b0('0x2b')][_0x23b0('0x3f')]({'where':{'id':_0x544d47[_0x23b0('0x41')]['id']}})[_0x23b0('0x13')](handleEntityNotFound(_0x527418,null))['then'](removeEntity(_0x527418,null))[_0x23b0('0x1e')](handleError(_0x527418,null));};exports['describe']=function(_0x573333,_0x33bad1){return db['MailMessage'][_0x23b0('0x42')]()[_0x23b0('0x13')](respondWithResult(_0x33bad1,null))[_0x23b0('0x1e')](handleError(_0x33bad1,null));};exports['create']=function(_0x3a0b87,_0x681be8){return db[_0x23b0('0x2b')][_0x23b0('0x43')](_0x3a0b87[_0x23b0('0x40')])[_0x23b0('0x13')](function(_0x49c520){if(_0x49c520){if(_0x49c520[_0x23b0('0x44')]===_0x23b0('0x45')&&!_0x49c520[_0x23b0('0x46')]){var _0x10676e,_0x4e16eb,_0x5d4c47;if(_0x3a0b87[_0x23b0('0x40')]['to']){_0x4e16eb=_0x3a0b87[_0x23b0('0x40')]['to']['split'](',')[0x0];}return db[_0x23b0('0x47')]['findOne']({'where':{'id':_0x49c520[_0x23b0('0x48')]},'include':[{'model':db[_0x23b0('0x49')],'as':_0x23b0('0x4a'),'include':[{'model':db[_0x23b0('0x4b')],'as':_0x23b0('0x4c'),'where':{'email':_0x4e16eb},'limit':0x1,'order':[[_0x23b0('0x4d'),_0x23b0('0x4e')]]}]},{'model':db[_0x23b0('0x4f')],'as':_0x23b0('0x50'),'raw':!![],'include':[{'model':db[_0x23b0('0x51')],'as':'CloudProvider','raw':!![]}]}]})['then'](function(_0x31d833){_0x10676e=_0x31d833;if(!_0x10676e||!_0x10676e['Smtp'])return;var _0x53325a=_0x10676e[_0x23b0('0x52')]();if(_0x3a0b87['body'][_0x23b0('0x53')]&&_0x3a0b87['body'][_0x23b0('0x53')][_0x23b0('0x35')]){for(var _0x694a6a=0x0;_0x694a6a<_0x3a0b87['body'][_0x23b0('0x53')]['length'];_0x694a6a+=0x1){_0x3a0b87[_0x23b0('0x40')]['attachments'][_0x694a6a]={'filename':_0x3a0b87['body'][_0x23b0('0x53')][_0x694a6a]['name'],'path':path['join'](config[_0x23b0('0x54')],_0x23b0('0x55'),_0x3a0b87['body'][_0x23b0('0x53')][_0x694a6a][_0x23b0('0x56')])};}}_0x5d4c47={'account':_0x53325a,'message':_0x3a0b87['body']};return;})['then'](function(){if(_0x10676e[_0x23b0('0x4a')]){if(_0x10676e['List'][_0x23b0('0x4c')][_0x23b0('0x35')]){return _0x10676e[_0x23b0('0x4a')]['Contacts'][0x0];}else{return db[_0x23b0('0x4b')][_0x23b0('0x43')](_[_0x23b0('0xa')](_0x3a0b87[_0x23b0('0x40')],{'firstName':_0x3a0b87[_0x23b0('0x40')]['to'],'email':_0x3a0b87[_0x23b0('0x40')]['to'],'phone':_0x3a0b87[_0x23b0('0x40')]['to'],'ListId':_0x10676e[_0x23b0('0x57')]}));}}else{throw new Error(_0x23b0('0x58'));}})['then'](function(){if(_0x5d4c47){return respondWithRpcPromise(_0x23b0('0x59'),_0x23b0('0x5a'),_0x5d4c47,client9003)['then'](function(_0x5c5aa3){return _0x49c520['update']({'read':!![],'messageId':_0x5c5aa3[_0x23b0('0x5b')],'sentAt':moment()[_0x23b0('0x5c')](_0x23b0('0x5d'))});})[_0x23b0('0x1e')](function(_0x28de3a){logger[_0x23b0('0x19')]('%s',JSON['stringify'](_0x28de3a));return _0x49c520;});}return _0x49c520;});}return _0x49c520;}})['then'](respondWithResult(_0x681be8,0xc9))[_0x23b0('0x1e')](handleError(_0x681be8,null));};exports[_0x23b0('0x5e')]=function(_0xd3ae5f,_0x2b4b5e){var _0x3e948d={'agent':{},'channel':_0x23b0('0x5f')};if(_0xd3ae5f[_0x23b0('0x40')]['id']){delete _0xd3ae5f[_0x23b0('0x40')]['id'];}_0xd3ae5f[_0x23b0('0x40')]['read']=!![];_0xd3ae5f[_0x23b0('0x40')][_0x23b0('0x60')]=moment()[_0x23b0('0x5c')](_0x23b0('0x5d'));_0xd3ae5f[_0x23b0('0x40')]['UserId']=_0xd3ae5f[_0x23b0('0x40')][_0x23b0('0x61')]||_0xd3ae5f[_0x23b0('0x62')]['id'];_0x3e948d[_0x23b0('0x63')]['id']=_0xd3ae5f[_0x23b0('0x40')][_0x23b0('0x61')];return db['MailMessage'][_0x23b0('0x3f')]({'where':{'id':_0xd3ae5f[_0x23b0('0x41')]['id'],'UserId':null}})[_0x23b0('0x13')](handleEntityNotFound(_0x2b4b5e,null))[_0x23b0('0x13')](saveUpdates(_0xd3ae5f[_0x23b0('0x40')],null))[_0x23b0('0x13')](function(_0x2c7761){if(_0x2c7761){_0x3e948d[_0x23b0('0x1c')]=_0x2c7761[_0x23b0('0x64')]({'plain':!![]});return db[_0x23b0('0x65')][_0x23b0('0x3f')]({'where':{'id':_0x2c7761['MailInteractionId']}});}return null;})[_0x23b0('0x13')](handleEntityNotFound(_0x2b4b5e,null))[_0x23b0('0x13')](function(_0x3f0448){if(_0x3f0448){return _0x3f0448['update']({'UserId':_0xd3ae5f[_0x23b0('0x40')][_0x23b0('0x61')],'read1stAt':_['isNil'](_0x3f0448[_0x23b0('0x66')])?moment()[_0x23b0('0x5c')](_0x23b0('0x5d')):undefined});}return null;})['then'](function(_0x377b84){if(_0x377b84){_0x3e948d[_0x23b0('0x67')]=_0x377b84[_0x23b0('0x64')]({'plain':!![]});interaction_log[_0x23b0('0x14')](_0x23b0('0x68'),_0xd3ae5f[_0x23b0('0x62')]['id'],_0xd3ae5f[_0x23b0('0x62')][_0x23b0('0x28')],_0xd3ae5f['user'][_0x23b0('0x69')],_0x3e948d['interaction']['id'],_0xd3ae5f[_0x23b0('0x40')]?JSON[_0x23b0('0x18')](_0xd3ae5f[_0x23b0('0x40')]):_0x23b0('0x6a'));return respondWithRpcPromise('AcceptMessage',_0x23b0('0x6b'),_0x3e948d);}return null;})[_0x23b0('0x13')](function(_0x27c21d){var _0xb7f611=_0x23b0('0x6c')+_0x27c21d[_0x23b0('0x1c')]['ContactId'];return db[_0x23b0('0x6d')][_0x23b0('0x2e')](_0xb7f611,{'type':db[_0x23b0('0x6e')][_0x23b0('0x6f')]['SELECT'],'raw':!![]})[_0x23b0('0x13')](function(_0x5ece95){return _0x5ece95;});})['then'](function(_0x17a605){if(_0x17a605){_0x3e948d[_0x23b0('0x1c')]['contact']=_0x17a605[0x0];if(!_0xd3ae5f[_0x23b0('0x40')]['UserId'])return;return db[_0x23b0('0x70')][_0x23b0('0x3f')]({'where':{'id':_0xd3ae5f[_0x23b0('0x40')][_0x23b0('0x61')],'role':_0x23b0('0x63')},'attributes':['id',_0x23b0('0x28'),'fullname',_0x23b0('0x71'),_0x23b0('0x72')],'raw':!![]});}return null;})[_0x23b0('0x13')](function(_0x43404b){if(!_0x43404b)return null;_0x3e948d[_0x23b0('0x1c')][_0x23b0('0x63')]=_0x43404b;return _0x3e948d;})[_0x23b0('0x13')](function(_0x4c5489){if(_0x4c5489){if(_0xd3ae5f[_0x23b0('0x40')]['manual']){_0x3e948d[_0x23b0('0x1c')]['interface']=util['format'](_0x23b0('0x73'),_0xd3ae5f['user'][_0x23b0('0x28')]);_0x3e948d[_0x23b0('0x1c')]['channel']=_0x3e948d[_0x23b0('0x74')];_0x3e948d[_0x23b0('0x1c')][_0x23b0('0x75')]=_0x3e948d[_0x23b0('0x74')];_0x3e948d[_0x23b0('0x1c')][_0x23b0('0x76')]=_0x23b0('0x5e');_0x3e948d[_0x23b0('0x1c')]['body']=htmlToText[_0x23b0('0x77')](_0x3e948d['message']['body']);return respondWithRpcPromise('EventManager',_0x23b0('0x78'),{'event':_0x23b0('0x79'),'message':_0x3e948d['message']},client9002)[_0x23b0('0x13')](function(){return _0x3e948d;});}return _0x3e948d;}return null;})[_0x23b0('0x13')](respondWithResult(_0x2b4b5e,null))['catch'](handleError(_0x2b4b5e,null));};exports[_0x23b0('0x7a')]=function(_0x2b0b7e,_0x21fbba){var _0x4ae9d0={'agent':{},'channel':'mail'};if(_0x2b0b7e[_0x23b0('0x40')]['id']){delete _0x2b0b7e[_0x23b0('0x40')]['id'];}_0x2b0b7e[_0x23b0('0x40')]['UserId']=_0x2b0b7e[_0x23b0('0x40')][_0x23b0('0x61')]||_0x2b0b7e[_0x23b0('0x62')]['id'];_0x4ae9d0[_0x23b0('0x63')]['id']=_0x2b0b7e['body'][_0x23b0('0x61')];return db[_0x23b0('0x2b')][_0x23b0('0x3f')]({'where':{'id':_0x2b0b7e[_0x23b0('0x41')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x21fbba,null))[_0x23b0('0x13')](function(_0x579eab){if(_0x579eab){_0x4ae9d0[_0x23b0('0x1c')]=_0x579eab[_0x23b0('0x64')]({'plain':!![]});return db[_0x23b0('0x65')]['find']({'where':{'id':_0x579eab[_0x23b0('0x7b')]}});}return null;})[_0x23b0('0x13')](handleEntityNotFound(_0x21fbba,null))[_0x23b0('0x13')](function(_0x4ec564){if(_0x4ec564){_0x4ae9d0[_0x23b0('0x67')]=_0x4ec564['get']({'plain':!![]});interaction_log['info'](_0x23b0('0x7c'),_0x2b0b7e['user']['id'],_0x2b0b7e[_0x23b0('0x62')]['name'],_0x2b0b7e[_0x23b0('0x62')][_0x23b0('0x69')],_0x4ae9d0[_0x23b0('0x67')]['id'],_0x2b0b7e[_0x23b0('0x40')]?JSON['stringify'](_0x2b0b7e['body']):_0x23b0('0x6a'));return respondWithRpcPromise(_0x23b0('0x7d'),'rejectMessage',_0x4ae9d0);}return null;})[_0x23b0('0x13')](function(_0x253107){var _0x360695=_0x23b0('0x6c')+_0x253107[_0x23b0('0x1c')]['ContactId'];return db[_0x23b0('0x6d')][_0x23b0('0x2e')](_0x360695,{'type':db[_0x23b0('0x6e')][_0x23b0('0x6f')][_0x23b0('0x7e')],'raw':!![]})[_0x23b0('0x13')](function(_0x6f3958){return _0x6f3958;});})[_0x23b0('0x13')](function(_0x289af1){if(_0x289af1){_0x4ae9d0['message']['contact']=_0x289af1[0x0];if(!_0x2b0b7e[_0x23b0('0x40')]['UserId'])return;return db[_0x23b0('0x70')][_0x23b0('0x3f')]({'where':{'id':_0x2b0b7e[_0x23b0('0x40')][_0x23b0('0x61')],'role':_0x23b0('0x63')},'attributes':['id',_0x23b0('0x28'),_0x23b0('0x7f'),_0x23b0('0x71'),_0x23b0('0x72')],'raw':!![]});}return null;})[_0x23b0('0x13')](function(_0x36ff19){if(!_0x36ff19)return null;_0x4ae9d0[_0x23b0('0x1c')]['agent']=_0x36ff19;return _0x4ae9d0;})[_0x23b0('0x13')](function(_0x2baa20){if(_0x2baa20){_0x2baa20[_0x23b0('0x1c')]['interface']=util[_0x23b0('0x5c')](_0x23b0('0x73'),_0x2b0b7e['user'][_0x23b0('0x28')]);_0x2baa20[_0x23b0('0x1c')][_0x23b0('0x74')]=_0x4ae9d0['channel'];_0x2baa20[_0x23b0('0x1c')][_0x23b0('0x75')]=_0x4ae9d0[_0x23b0('0x74')];_0x2baa20[_0x23b0('0x1c')][_0x23b0('0x76')]=_0x23b0('0x7a');_0x2baa20['message'][_0x23b0('0x40')]=htmlToText['fromString'](_0x4ae9d0[_0x23b0('0x1c')][_0x23b0('0x40')]);respondWithRpcPromise('EventManager',_0x23b0('0x78'),{'event':'rejectmessage','message':_0x2baa20[_0x23b0('0x1c')]},client9002);return _0x4ae9d0;}return null;})[_0x23b0('0x13')](respondWithResult(_0x21fbba,null))['catch'](handleError(_0x21fbba,null));};exports[_0x23b0('0x80')]=function(_0x1f7df2,_0x354498){var _0x5db86c=moment()[_0x23b0('0x81')]()[_0x23b0('0x82')]();var _0x1ef15b=path[_0x23b0('0x83')](config[_0x23b0('0x54')],_0x23b0('0x84'),_0x23b0('0x85'),'tmp');var _0x4b9f39=path['join'](config[_0x23b0('0x54')],_0x23b0('0x84'),_0x23b0('0x85'),_0x23b0('0x53'));var _0x3bbc69=util['format'](_0x23b0('0x86'),_0x5db86c);return db[_0x23b0('0x2b')][_0x23b0('0x3f')]({'where':{'id':_0x1f7df2['params']['id']},'attributes':['id','body',_0x23b0('0x87'),'to','cc',_0x23b0('0x88'),_0x23b0('0x89'),_0x23b0('0x8a')],'include':_0x1f7df2['query']['attachments']?[{'model':db[_0x23b0('0x8b')],'as':_0x23b0('0x8c')}]:undefined})[_0x23b0('0x13')](handleEntityNotFound(_0x354498,null))[_0x23b0('0x13')](function(_0x4ae1c6){if(_0x4ae1c6){var _0x1838b0=_0x4ae1c6;var _0x524f1a={'from':_0x1838b0[_0x23b0('0x87')],'to':_0x1838b0['to'],'subject':_0x1838b0[_0x23b0('0x89')],'html':htmlEntities[_0x23b0('0x8d')](_0x1838b0[_0x23b0('0x40')]),'headers':{'Date':moment(_0x1838b0[_0x23b0('0x8a')])[_0x23b0('0x5c')](_0x23b0('0x8e'))},'attachments':[]};if(_0x4ae1c6['cc']){_0x524f1a[_0x23b0('0x8f')]['Cc']=_0x4ae1c6['cc'];}if(_0x4ae1c6[_0x23b0('0x88')]){_0x524f1a[_0x23b0('0x8f')][_0x23b0('0x90')]=_0x4ae1c6[_0x23b0('0x88')];}return new BPromise(function(_0x668fca,_0x346e06){if(_0x4ae1c6['Attachments']){for(var _0x2e3583=0x0;_0x2e3583<_0x4ae1c6[_0x23b0('0x8c')][_0x23b0('0x35')];_0x2e3583++){var _0x297b70=_0x4ae1c6[_0x23b0('0x8c')][_0x2e3583];var _0x1797ef=path[_0x23b0('0x83')](_0x4b9f39,_0x297b70[_0x23b0('0x56')]);if(fs['existsSync'](_0x1797ef)){_0x524f1a[_0x23b0('0x53')]['push']({'name':_0x297b70[_0x23b0('0x28')],'contentType':_0x297b70[_0x23b0('0x3b')],'data':fs['readFileSync'](_0x1797ef)});}}}emlformat['build'](_0x524f1a,function(_0x50b1d2,_0x2e37b7){if(_0x50b1d2)return _0x346e06(_0x50b1d2);fs[_0x23b0('0x91')](path['join'](_0x1ef15b,_0x3bbc69),_0x2e37b7);return _0x668fca(_0x2e37b7);});});}})[_0x23b0('0x13')](function(_0x5432d3){if(_0x5432d3){return _0x354498[_0x23b0('0x80')](path['join'](_0x1ef15b,_0x3bbc69),_0x3bbc69,function(_0x560ea1){if(!_0x560ea1)fs['unlinkSync'](path[_0x23b0('0x83')](_0x1ef15b,_0x3bbc69));});}})['catch'](handleError(_0x354498,null));}; \ No newline at end of file +var _0x0b9f=['count','set','update','destroy','end','sendStatus','stack','name','send','index','map','MailMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','show','options','body','find','params','describe','create','direction','out','split','MailAccount','findOne','MailAccountId','CmList','List','CmContact','Contacts','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','server/files/attachments','basename','ListId','List\x20not\x20found','SendMail','format','stringify','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','MailInteraction','MailInteractionId','read1stAt','interaction','get','info','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','User','agent','fullname','internal','manual','interface','SIP/%s','channel','event','fromString','EventManager','acceptmessage','reject','mail','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','QueryTypes','contact','email','motionChannel','download','unix','toString','server','files','tmp','message-%s.eml','bcc','subject','createdAt','Attachment','Attachments','from','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','push','readFileSync','build','writeFileSync','unlinkSync','eml-format','moment','bluebird','path','lodash','html-to-text','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','html-entities','./mailMessage.socket','register','jayson/promise','http','client','then','MailMessage,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','status','json','limit','undefined','offset'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0b9f,0x83));var _0xf0b9=function(_0x2f5810,_0x49d3fc){_0x2f5810=_0x2f5810-0x0;var _0x5e823e=_0x0b9f[_0x2f5810];return _0x5e823e;};'use strict';var emlformat=require(_0xf0b9('0x0'));var moment=require(_0xf0b9('0x1'));var BPromise=require(_0xf0b9('0x2'));var util=require('util');var path=require(_0xf0b9('0x3'));var fs=require('fs');var _=require(_0xf0b9('0x4'));var Redis=require('ioredis');var htmlToText=require(_0xf0b9('0x5'));var qs=require(_0xf0b9('0x6'));var logger=require(_0xf0b9('0x7'))('api');var interaction_log=require(_0xf0b9('0x7'))('mail-interactions');var config=require(_0xf0b9('0x8'));var db=require(_0xf0b9('0x9'))['db'];config[_0xf0b9('0xa')]=_[_0xf0b9('0xb')](config[_0xf0b9('0xa')],{'host':_0xf0b9('0xc'),'port':0x18eb});var socket=require(_0xf0b9('0xd'))(new Redis(config[_0xf0b9('0xa')]));var htmlEntities=require(_0xf0b9('0xe'));require(_0xf0b9('0xf'))[_0xf0b9('0x10')](socket);var jayson=require(_0xf0b9('0x11'));var client=jayson['client'][_0xf0b9('0x12')]({'port':0x232c});var client9003=jayson[_0xf0b9('0x13')][_0xf0b9('0x12')]({'port':0x232b});var client9002=jayson[_0xf0b9('0x13')][_0xf0b9('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x319979,_0x42b722,_0x1ee076,_0x53ac70){return new BPromise(function(_0x50a886,_0x13a1ea){var _0x4597b4=_0x53ac70||client;return _0x4597b4['request'](_0x319979,_0x1ee076)[_0xf0b9('0x14')](function(_0x3ea2f8){logger['info'](_0xf0b9('0x15'),_0x42b722,'request\x20sent');logger[_0xf0b9('0x16')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x42b722,_0xf0b9('0x17'),JSON['stringify'](_0x3ea2f8));if(_0x3ea2f8['error']){if(_0x3ea2f8[_0xf0b9('0x18')][_0xf0b9('0x19')]===0x1f4){logger[_0xf0b9('0x18')](_0xf0b9('0x15'),_0x42b722,_0x3ea2f8[_0xf0b9('0x18')][_0xf0b9('0x1a')]);return _0x13a1ea(_0x3ea2f8['error'][_0xf0b9('0x1a')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x42b722,_0x3ea2f8[_0xf0b9('0x18')][_0xf0b9('0x1a')]);return _0x50a886(_0x3ea2f8['error'][_0xf0b9('0x1a')]);}else{logger['info'](_0xf0b9('0x15'),_0x42b722,_0xf0b9('0x17'));_0x50a886(_0x3ea2f8[_0xf0b9('0x1b')][_0xf0b9('0x1a')]);}})[_0xf0b9('0x1c')](function(_0x5262e6){logger[_0xf0b9('0x18')](_0xf0b9('0x15'),_0x42b722,_0x5262e6);_0x13a1ea(_0x5262e6);});});}function respondWithResult(_0x273180,_0x4be0c8){_0x4be0c8=_0x4be0c8||0xc8;return function(_0x574389){if(_0x574389){return _0x273180[_0xf0b9('0x1d')](_0x4be0c8)[_0xf0b9('0x1e')](_0x574389);}};}function respondWithFilteredResult(_0x5060c7,_0x50abc6){return function(_0x4a6dd7){if(_0x4a6dd7){var _0x480b25=typeof _0x50abc6['offset']==='undefined'&&typeof _0x50abc6[_0xf0b9('0x1f')]===_0xf0b9('0x20');var _0x356e16=_0x4a6dd7['count'];var _0x59c4bd=_0x480b25?0x0:_0x50abc6[_0xf0b9('0x21')];var _0x2cfea2=_0x480b25?_0x4a6dd7[_0xf0b9('0x22')]:_0x50abc6[_0xf0b9('0x21')]+_0x50abc6['limit'];var _0x124fbc;if(_0x2cfea2>=_0x356e16){_0x2cfea2=_0x356e16;_0x124fbc=0xc8;}else{_0x124fbc=0xce;}_0x5060c7[_0xf0b9('0x1d')](_0x124fbc);return _0x5060c7[_0xf0b9('0x23')]('Content-Range',_0x59c4bd+'-'+_0x2cfea2+'/'+_0x356e16)[_0xf0b9('0x1e')](_0x4a6dd7);}return null;};}function saveUpdates(_0x3cb991){return function(_0x5b0ef4){if(_0x5b0ef4){return _0x5b0ef4[_0xf0b9('0x24')](_0x3cb991)[_0xf0b9('0x14')](function(_0x17a926){return _0x17a926;});}return null;};}function removeEntity(_0x25bd9c){return function(_0x3b9147){if(_0x3b9147){return _0x3b9147[_0xf0b9('0x25')]()['then'](function(){_0x25bd9c[_0xf0b9('0x1d')](0xcc)[_0xf0b9('0x26')]();});}};}function handleEntityNotFound(_0x5f6b38){return function(_0x3f1dc4){if(!_0x3f1dc4){_0x5f6b38[_0xf0b9('0x27')](0x194);}return _0x3f1dc4;};}function handleError(_0x218ac8,_0x3b6389){_0x3b6389=_0x3b6389||0x1f4;return function(_0x22aaf1){logger[_0xf0b9('0x18')](_0x22aaf1[_0xf0b9('0x28')]);if(_0x22aaf1[_0xf0b9('0x29')]){delete _0x22aaf1[_0xf0b9('0x29')];}_0x218ac8[_0xf0b9('0x1d')](_0x3b6389)[_0xf0b9('0x2a')](_0x22aaf1);};}exports[_0xf0b9('0x2b')]=function(_0x1fd3e9,_0x52fdb6){var _0x3fbe27={},_0x2faf6c={},_0x1691d2={'count':0x0,'rows':[]};var _0xc9aad9=_[_0xf0b9('0x2c')](db[_0xf0b9('0x2d')][_0xf0b9('0x2e')],function(_0x3c944a){return{'name':_0x3c944a[_0xf0b9('0x2f')],'type':_0x3c944a[_0xf0b9('0x30')][_0xf0b9('0x31')]};});_0x2faf6c[_0xf0b9('0x32')]=_[_0xf0b9('0x2c')](_0xc9aad9,_0xf0b9('0x29'));_0x2faf6c[_0xf0b9('0x33')]=_[_0xf0b9('0x34')](_0x1fd3e9[_0xf0b9('0x33')]);_0x2faf6c[_0xf0b9('0x35')]=_[_0xf0b9('0x36')](_0x2faf6c[_0xf0b9('0x32')],_0x2faf6c['query']);_0x3fbe27[_0xf0b9('0x37')]=_[_0xf0b9('0x36')](_0x2faf6c[_0xf0b9('0x32')],qs[_0xf0b9('0x38')](_0x1fd3e9['query']['fields']));_0x3fbe27[_0xf0b9('0x37')]=_0x3fbe27[_0xf0b9('0x37')][_0xf0b9('0x39')]?_0x3fbe27[_0xf0b9('0x37')]:_0x2faf6c[_0xf0b9('0x32')];if(!_0x1fd3e9[_0xf0b9('0x33')][_0xf0b9('0x3a')](_0xf0b9('0x3b'))){_0x3fbe27[_0xf0b9('0x1f')]=qs[_0xf0b9('0x1f')](_0x1fd3e9[_0xf0b9('0x33')][_0xf0b9('0x1f')]);_0x3fbe27[_0xf0b9('0x21')]=qs[_0xf0b9('0x21')](_0x1fd3e9[_0xf0b9('0x33')][_0xf0b9('0x21')]);}_0x3fbe27['order']=qs[_0xf0b9('0x3c')](_0x1fd3e9['query'][_0xf0b9('0x3c')]);_0x3fbe27[_0xf0b9('0x3d')]=qs[_0xf0b9('0x35')](_[_0xf0b9('0x3e')](_0x1fd3e9['query'],_0x2faf6c[_0xf0b9('0x35')]),_0xc9aad9);if(_0x1fd3e9[_0xf0b9('0x33')][_0xf0b9('0x3f')]){_0x3fbe27[_0xf0b9('0x3d')]=_['merge'](_0x3fbe27[_0xf0b9('0x3d')],{'$or':_[_0xf0b9('0x2c')](_0xc9aad9,function(_0x3e1dd5){if(_0x3e1dd5[_0xf0b9('0x30')]!=='VIRTUAL'){var _0x2d79fd={};_0x2d79fd[_0x3e1dd5['name']]={'$like':'%'+_0x1fd3e9[_0xf0b9('0x33')][_0xf0b9('0x3f')]+'%'};return _0x2d79fd;}})});}_0x3fbe27=_[_0xf0b9('0x40')]({},_0x3fbe27,_0x1fd3e9['options']);var _0x277cde={'where':_0x3fbe27['where']};return db['MailMessage'][_0xf0b9('0x22')](_0x277cde)['then'](function(_0x1bc623){_0x1691d2[_0xf0b9('0x22')]=_0x1bc623;if(_0x1fd3e9[_0xf0b9('0x33')][_0xf0b9('0x41')]){_0x3fbe27[_0xf0b9('0x42')]=[{'all':!![]}];}return db[_0xf0b9('0x2d')][_0xf0b9('0x43')](_0x3fbe27);})[_0xf0b9('0x14')](function(_0x5e2b8d){_0x1691d2['rows']=_0x5e2b8d;return _0x1691d2;})[_0xf0b9('0x14')](respondWithFilteredResult(_0x52fdb6,_0x3fbe27))[_0xf0b9('0x1c')](handleError(_0x52fdb6,null));};exports[_0xf0b9('0x44')]=function(_0x2848ca,_0x1826d0){var _0x3dea34={'raw':!![],'where':{'id':_0x2848ca['params']['id']}},_0x51189a={};_0x51189a[_0xf0b9('0x32')]=_[_0xf0b9('0x34')](db['MailMessage'][_0xf0b9('0x2e')]);_0x51189a[_0xf0b9('0x33')]=_[_0xf0b9('0x34')](_0x2848ca[_0xf0b9('0x33')]);_0x51189a[_0xf0b9('0x35')]=_[_0xf0b9('0x36')](_0x51189a[_0xf0b9('0x32')],_0x51189a[_0xf0b9('0x33')]);_0x3dea34[_0xf0b9('0x37')]=_[_0xf0b9('0x36')](_0x51189a[_0xf0b9('0x32')],qs[_0xf0b9('0x38')](_0x2848ca[_0xf0b9('0x33')][_0xf0b9('0x38')]));_0x3dea34[_0xf0b9('0x37')]=_0x3dea34[_0xf0b9('0x37')][_0xf0b9('0x39')]?_0x3dea34['attributes']:_0x51189a[_0xf0b9('0x32')];if(_0x2848ca[_0xf0b9('0x33')][_0xf0b9('0x41')]){_0x3dea34['include']=[{'all':!![]}];}_0x3dea34=_[_0xf0b9('0x40')]({},_0x3dea34,_0x2848ca[_0xf0b9('0x45')]);return db[_0xf0b9('0x2d')]['find'](_0x3dea34)[_0xf0b9('0x14')](handleEntityNotFound(_0x1826d0,null))[_0xf0b9('0x14')](respondWithResult(_0x1826d0,null))[_0xf0b9('0x1c')](handleError(_0x1826d0,null));};exports[_0xf0b9('0x24')]=function(_0x34d540,_0x11c66d){if(_0x34d540[_0xf0b9('0x46')]['id']){delete _0x34d540[_0xf0b9('0x46')]['id'];}return db['MailMessage'][_0xf0b9('0x47')]({'where':{'id':_0x34d540['params']['id']}})[_0xf0b9('0x14')](handleEntityNotFound(_0x11c66d,null))[_0xf0b9('0x14')](saveUpdates(_0x34d540[_0xf0b9('0x46')],null))[_0xf0b9('0x14')](respondWithResult(_0x11c66d,null))[_0xf0b9('0x1c')](handleError(_0x11c66d,null));};exports[_0xf0b9('0x25')]=function(_0x1caff2,_0x3b935b){return db['MailMessage'][_0xf0b9('0x47')]({'where':{'id':_0x1caff2[_0xf0b9('0x48')]['id']}})['then'](handleEntityNotFound(_0x3b935b,null))['then'](removeEntity(_0x3b935b,null))[_0xf0b9('0x1c')](handleError(_0x3b935b,null));};exports[_0xf0b9('0x49')]=function(_0x5a3887,_0x1f19b4){return db[_0xf0b9('0x2d')][_0xf0b9('0x49')]()[_0xf0b9('0x14')](respondWithResult(_0x1f19b4,null))[_0xf0b9('0x1c')](handleError(_0x1f19b4,null));};exports['create']=function(_0xe468f,_0x6be101){return db[_0xf0b9('0x2d')][_0xf0b9('0x4a')](_0xe468f[_0xf0b9('0x46')])['then'](function(_0x5b27e6){if(_0x5b27e6){if(_0x5b27e6[_0xf0b9('0x4b')]===_0xf0b9('0x4c')&&!_0x5b27e6['secret']){var _0x2fe4bf,_0x5218a6,_0x34f05f;if(_0xe468f[_0xf0b9('0x46')]['to']){_0x5218a6=_0xe468f['body']['to'][_0xf0b9('0x4d')](',')[0x0];}return db[_0xf0b9('0x4e')][_0xf0b9('0x4f')]({'where':{'id':_0x5b27e6[_0xf0b9('0x50')]},'include':[{'model':db[_0xf0b9('0x51')],'as':_0xf0b9('0x52'),'include':[{'model':db[_0xf0b9('0x53')],'as':_0xf0b9('0x54'),'where':{'email':_0x5218a6},'limit':0x1,'order':[['updatedAt',_0xf0b9('0x55')]]}]},{'model':db[_0xf0b9('0x56')],'as':_0xf0b9('0x57'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xf0b9('0x58'),'raw':!![]}]}]})[_0xf0b9('0x14')](function(_0x46a36e){_0x2fe4bf=_0x46a36e;if(!_0x2fe4bf||!_0x2fe4bf[_0xf0b9('0x57')])return;var _0x1973eb=_0x2fe4bf[_0xf0b9('0x59')]();if(_0xe468f['body'][_0xf0b9('0x5a')]&&_0xe468f[_0xf0b9('0x46')][_0xf0b9('0x5a')][_0xf0b9('0x39')]){for(var _0x40866b=0x0;_0x40866b<_0xe468f['body'][_0xf0b9('0x5a')][_0xf0b9('0x39')];_0x40866b+=0x1){_0xe468f[_0xf0b9('0x46')][_0xf0b9('0x5a')][_0x40866b]={'filename':_0xe468f[_0xf0b9('0x46')][_0xf0b9('0x5a')][_0x40866b][_0xf0b9('0x29')],'path':path[_0xf0b9('0x5b')](config[_0xf0b9('0x5c')],_0xf0b9('0x5d'),_0xe468f[_0xf0b9('0x46')][_0xf0b9('0x5a')][_0x40866b][_0xf0b9('0x5e')])};}}_0x34f05f={'account':_0x1973eb,'message':_0xe468f[_0xf0b9('0x46')]};return;})[_0xf0b9('0x14')](function(){if(_0x2fe4bf[_0xf0b9('0x52')]){if(_0x2fe4bf[_0xf0b9('0x52')][_0xf0b9('0x54')]['length']){return _0x2fe4bf[_0xf0b9('0x52')][_0xf0b9('0x54')][0x0];}else{return db[_0xf0b9('0x53')][_0xf0b9('0x4a')](_['defaults'](_0xe468f[_0xf0b9('0x46')],{'firstName':_0xe468f['body']['to'],'email':_0xe468f[_0xf0b9('0x46')]['to'],'phone':_0xe468f[_0xf0b9('0x46')]['to'],'ListId':_0x2fe4bf[_0xf0b9('0x5f')]}));}}else{throw new Error(_0xf0b9('0x60'));}})[_0xf0b9('0x14')](function(){if(_0x34f05f){return respondWithRpcPromise(_0xf0b9('0x61'),'sendMail',_0x34f05f,client9003)['then'](function(_0x2066ac){return _0x5b27e6[_0xf0b9('0x24')]({'read':!![],'messageId':_0x2066ac['messageId'],'sentAt':moment()[_0xf0b9('0x62')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xf0b9('0x1c')](function(_0x47eda5){logger[_0xf0b9('0x18')]('%s',JSON[_0xf0b9('0x63')](_0x47eda5));return _0x5b27e6;});}return _0x5b27e6;});}return _0x5b27e6;}})[_0xf0b9('0x14')](respondWithResult(_0x6be101,0xc9))[_0xf0b9('0x1c')](handleError(_0x6be101,null));};exports[_0xf0b9('0x64')]=function(_0x54c857,_0x3214ef){var _0x1e039f={'agent':{},'channel':'mail'};if(_0x54c857['body']['id']){delete _0x54c857['body']['id'];}_0x54c857[_0xf0b9('0x46')][_0xf0b9('0x65')]=!![];_0x54c857[_0xf0b9('0x46')][_0xf0b9('0x66')]=moment()['format'](_0xf0b9('0x67'));_0x54c857[_0xf0b9('0x46')]['UserId']=_0x54c857[_0xf0b9('0x46')][_0xf0b9('0x68')]||_0x54c857[_0xf0b9('0x69')]['id'];_0x1e039f['agent']['id']=_0x54c857[_0xf0b9('0x46')][_0xf0b9('0x68')];return db[_0xf0b9('0x2d')][_0xf0b9('0x47')]({'where':{'id':_0x54c857['params']['id'],'UserId':null}})[_0xf0b9('0x14')](handleEntityNotFound(_0x3214ef,null))[_0xf0b9('0x14')](saveUpdates(_0x54c857['body'],null))[_0xf0b9('0x14')](function(_0x16578e){if(_0x16578e){_0x1e039f['message']=_0x16578e['get']({'plain':!![]});return db[_0xf0b9('0x6a')][_0xf0b9('0x47')]({'where':{'id':_0x16578e[_0xf0b9('0x6b')]}});}return null;})['then'](handleEntityNotFound(_0x3214ef,null))[_0xf0b9('0x14')](function(_0xc5467e){if(_0xc5467e){return _0xc5467e[_0xf0b9('0x24')]({'UserId':_0x54c857[_0xf0b9('0x46')][_0xf0b9('0x68')],'read1stAt':_['isNil'](_0xc5467e[_0xf0b9('0x6c')])?moment()[_0xf0b9('0x62')](_0xf0b9('0x67')):undefined});}return null;})[_0xf0b9('0x14')](function(_0xe876e4){if(_0xe876e4){_0x1e039f[_0xf0b9('0x6d')]=_0xe876e4[_0xf0b9('0x6e')]({'plain':!![]});interaction_log[_0xf0b9('0x6f')](_0xf0b9('0x70'),_0x54c857['user']['id'],_0x54c857[_0xf0b9('0x69')][_0xf0b9('0x29')],_0x54c857[_0xf0b9('0x69')][_0xf0b9('0x71')],_0x1e039f['interaction']['id'],_0x54c857['body']?JSON['stringify'](_0x54c857['body']):'null');return respondWithRpcPromise(_0xf0b9('0x72'),_0xf0b9('0x73'),_0x1e039f);}return null;})['then'](function(_0xe8b20){var _0x503e16=_0xf0b9('0x74')+_0xe8b20[_0xf0b9('0x1a')][_0xf0b9('0x75')];return db[_0xf0b9('0x76')][_0xf0b9('0x33')](_0x503e16,{'type':db[_0xf0b9('0x77')]['QueryTypes'][_0xf0b9('0x78')],'raw':!![]})[_0xf0b9('0x14')](function(_0x3ab72f){return _0x3ab72f;});})[_0xf0b9('0x14')](function(_0x46c300){if(_0x46c300){_0x1e039f['message']['contact']=_0x46c300[0x0];if(!_0x54c857['body'][_0xf0b9('0x68')])return;return db[_0xf0b9('0x79')][_0xf0b9('0x47')]({'where':{'id':_0x54c857[_0xf0b9('0x46')]['UserId'],'role':_0xf0b9('0x7a')},'attributes':['id',_0xf0b9('0x29'),_0xf0b9('0x7b'),'email',_0xf0b9('0x7c')],'raw':!![]});}return null;})[_0xf0b9('0x14')](function(_0x5b1b00){if(!_0x5b1b00)return null;_0x1e039f[_0xf0b9('0x1a')]['agent']=_0x5b1b00;return _0x1e039f;})[_0xf0b9('0x14')](function(_0x3353db){if(_0x3353db){if(_0x54c857['body'][_0xf0b9('0x7d')]){_0x1e039f['message'][_0xf0b9('0x7e')]=util[_0xf0b9('0x62')](_0xf0b9('0x7f'),_0x54c857[_0xf0b9('0x69')][_0xf0b9('0x29')]);_0x1e039f['message'][_0xf0b9('0x80')]=_0x1e039f['channel'];_0x1e039f['message']['motionChannel']=_0x1e039f['channel'];_0x1e039f['message'][_0xf0b9('0x81')]=_0xf0b9('0x64');_0x1e039f['message'][_0xf0b9('0x46')]=htmlToText[_0xf0b9('0x82')](_0x1e039f[_0xf0b9('0x1a')][_0xf0b9('0x46')]);return respondWithRpcPromise('EventManager',_0xf0b9('0x83'),{'event':_0xf0b9('0x84'),'message':_0x1e039f[_0xf0b9('0x1a')]},client9002)['then'](function(){return _0x1e039f;});}return _0x1e039f;}return null;})[_0xf0b9('0x14')](respondWithResult(_0x3214ef,null))['catch'](handleError(_0x3214ef,null));};exports[_0xf0b9('0x85')]=function(_0x5cbfa3,_0x34748b){var _0x35886a={'agent':{},'channel':_0xf0b9('0x86')};if(_0x5cbfa3[_0xf0b9('0x46')]['id']){delete _0x5cbfa3['body']['id'];}_0x5cbfa3[_0xf0b9('0x46')][_0xf0b9('0x68')]=_0x5cbfa3[_0xf0b9('0x46')][_0xf0b9('0x68')]||_0x5cbfa3[_0xf0b9('0x69')]['id'];_0x35886a[_0xf0b9('0x7a')]['id']=_0x5cbfa3[_0xf0b9('0x46')][_0xf0b9('0x68')];return db[_0xf0b9('0x2d')]['find']({'where':{'id':_0x5cbfa3[_0xf0b9('0x48')]['id'],'UserId':null}})[_0xf0b9('0x14')](handleEntityNotFound(_0x34748b,null))[_0xf0b9('0x14')](function(_0x2f8988){if(_0x2f8988){_0x35886a['message']=_0x2f8988[_0xf0b9('0x6e')]({'plain':!![]});return db[_0xf0b9('0x6a')]['find']({'where':{'id':_0x2f8988['MailInteractionId']}});}return null;})[_0xf0b9('0x14')](handleEntityNotFound(_0x34748b,null))[_0xf0b9('0x14')](function(_0x4d6634){if(_0x4d6634){_0x35886a['interaction']=_0x4d6634['get']({'plain':!![]});interaction_log[_0xf0b9('0x6f')](_0xf0b9('0x87'),_0x5cbfa3['user']['id'],_0x5cbfa3[_0xf0b9('0x69')][_0xf0b9('0x29')],_0x5cbfa3[_0xf0b9('0x69')][_0xf0b9('0x71')],_0x35886a['interaction']['id'],_0x5cbfa3[_0xf0b9('0x46')]?JSON[_0xf0b9('0x63')](_0x5cbfa3['body']):_0xf0b9('0x88'));return respondWithRpcPromise(_0xf0b9('0x89'),'rejectMessage',_0x35886a);}return null;})['then'](function(_0x4f3518){var _0x478cb6=_0xf0b9('0x74')+_0x4f3518[_0xf0b9('0x1a')][_0xf0b9('0x75')];return db[_0xf0b9('0x76')]['query'](_0x478cb6,{'type':db['Sequelize'][_0xf0b9('0x8a')][_0xf0b9('0x78')],'raw':!![]})[_0xf0b9('0x14')](function(_0x152ae5){return _0x152ae5;});})[_0xf0b9('0x14')](function(_0x16c9bd){if(_0x16c9bd){_0x35886a[_0xf0b9('0x1a')][_0xf0b9('0x8b')]=_0x16c9bd[0x0];if(!_0x5cbfa3['body']['UserId'])return;return db[_0xf0b9('0x79')]['find']({'where':{'id':_0x5cbfa3[_0xf0b9('0x46')][_0xf0b9('0x68')],'role':_0xf0b9('0x7a')},'attributes':['id','name',_0xf0b9('0x7b'),_0xf0b9('0x8c'),'internal'],'raw':!![]});}return null;})['then'](function(_0x29bf91){if(!_0x29bf91)return null;_0x35886a[_0xf0b9('0x1a')][_0xf0b9('0x7a')]=_0x29bf91;return _0x35886a;})[_0xf0b9('0x14')](function(_0x175ab0){if(_0x175ab0){_0x175ab0[_0xf0b9('0x1a')][_0xf0b9('0x7e')]=util[_0xf0b9('0x62')]('SIP/%s',_0x5cbfa3[_0xf0b9('0x69')][_0xf0b9('0x29')]);_0x175ab0[_0xf0b9('0x1a')][_0xf0b9('0x80')]=_0x35886a[_0xf0b9('0x80')];_0x175ab0[_0xf0b9('0x1a')][_0xf0b9('0x8d')]=_0x35886a[_0xf0b9('0x80')];_0x175ab0[_0xf0b9('0x1a')][_0xf0b9('0x81')]=_0xf0b9('0x85');_0x175ab0[_0xf0b9('0x1a')][_0xf0b9('0x46')]=htmlToText['fromString'](_0x35886a[_0xf0b9('0x1a')][_0xf0b9('0x46')]);respondWithRpcPromise('EventManager',_0xf0b9('0x83'),{'event':'rejectmessage','message':_0x175ab0[_0xf0b9('0x1a')]},client9002);return _0x35886a;}return null;})['then'](respondWithResult(_0x34748b,null))[_0xf0b9('0x1c')](handleError(_0x34748b,null));};exports[_0xf0b9('0x8e')]=function(_0x5d1b2e,_0x21673b){var _0x880fd0=moment()[_0xf0b9('0x8f')]()[_0xf0b9('0x90')]();var _0x2ada87=path[_0xf0b9('0x5b')](config[_0xf0b9('0x5c')],_0xf0b9('0x91'),_0xf0b9('0x92'),_0xf0b9('0x93'));var _0x1379c2=path[_0xf0b9('0x5b')](config[_0xf0b9('0x5c')],_0xf0b9('0x91'),'files',_0xf0b9('0x5a'));var _0x194915=util[_0xf0b9('0x62')](_0xf0b9('0x94'),_0x880fd0);return db[_0xf0b9('0x2d')][_0xf0b9('0x47')]({'where':{'id':_0x5d1b2e[_0xf0b9('0x48')]['id']},'attributes':['id',_0xf0b9('0x46'),'from','to','cc',_0xf0b9('0x95'),_0xf0b9('0x96'),_0xf0b9('0x97')],'include':_0x5d1b2e[_0xf0b9('0x33')][_0xf0b9('0x5a')]?[{'model':db[_0xf0b9('0x98')],'as':_0xf0b9('0x99')}]:undefined})[_0xf0b9('0x14')](handleEntityNotFound(_0x21673b,null))['then'](function(_0x1b25de){if(_0x1b25de){var _0x36625f=_0x1b25de;var _0x3aec82={'from':_0x36625f[_0xf0b9('0x9a')],'to':_0x36625f['to'],'subject':_0x36625f['subject'],'html':htmlEntities[_0xf0b9('0x9b')](_0x36625f[_0xf0b9('0x46')]),'headers':{'Date':moment(_0x36625f[_0xf0b9('0x97')])[_0xf0b9('0x62')](_0xf0b9('0x9c'))},'attachments':[]};if(_0x1b25de['cc']){_0x3aec82[_0xf0b9('0x9d')]['Cc']=_0x1b25de['cc'];}if(_0x1b25de[_0xf0b9('0x95')]){_0x3aec82['headers'][_0xf0b9('0x9e')]=_0x1b25de[_0xf0b9('0x95')];}return new BPromise(function(_0x1891ca,_0x294df7){if(_0x1b25de[_0xf0b9('0x99')]){for(var _0x41af79=0x0;_0x41af79<_0x1b25de[_0xf0b9('0x99')][_0xf0b9('0x39')];_0x41af79++){var _0x161166=_0x1b25de[_0xf0b9('0x99')][_0x41af79];var _0x41312b=path['join'](_0x1379c2,_0x161166[_0xf0b9('0x5e')]);if(fs[_0xf0b9('0x9f')](_0x41312b)){_0x3aec82['attachments'][_0xf0b9('0xa0')]({'name':_0x161166[_0xf0b9('0x29')],'contentType':_0x161166[_0xf0b9('0x30')],'data':fs[_0xf0b9('0xa1')](_0x41312b)});}}}emlformat[_0xf0b9('0xa2')](_0x3aec82,function(_0x12fb3f,_0x255f52){if(_0x12fb3f)return _0x294df7(_0x12fb3f);fs[_0xf0b9('0xa3')](path[_0xf0b9('0x5b')](_0x2ada87,_0x194915),_0x255f52);return _0x1891ca(_0x255f52);});});}})[_0xf0b9('0x14')](function(_0x42caa1){if(_0x42caa1){return _0x21673b['download'](path[_0xf0b9('0x5b')](_0x2ada87,_0x194915),_0x194915,function(_0x23f37b){if(!_0x23f37b)fs[_0xf0b9('0xa4')](path['join'](_0x2ada87,_0x194915));});}})[_0xf0b9('0x1c')](handleError(_0x21673b,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index ca665bc..7c0f867 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 _0x2a3e=['exports','events','../../mysqldb','MailMessage','setMaxListeners','remove','emit','hasOwnProperty'];(function(_0x304242,_0x53276b){var _0x4f6cb3=function(_0x17f1a7){while(--_0x17f1a7){_0x304242['push'](_0x304242['shift']());}};_0x4f6cb3(++_0x53276b);}(_0x2a3e,0x1c1));var _0xe2a3=function(_0x36157b,_0x19dc36){_0x36157b=_0x36157b-0x0;var _0x16aff4=_0x2a3e[_0x36157b];return _0x16aff4;};'use strict';var EventEmitter=require(_0xe2a3('0x0'));var MailMessage=require(_0xe2a3('0x1'))['db'][_0xe2a3('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xe2a3('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xe2a3('0x4')};function emitEvent(_0x230ede){return function(_0x127cbb,_0x477d57,_0x432c2c){MailMessageEvents[_0xe2a3('0x5')](_0x230ede+':'+_0x127cbb['id'],_0x127cbb);MailMessageEvents['emit'](_0x230ede,_0x127cbb);_0x432c2c(null);};}for(var e in events){if(events[_0xe2a3('0x6')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0xe2a3('0x7')]=MailMessageEvents; \ No newline at end of file +var _0x62ec=['exports','../../mysqldb','MailMessage','save','update','emit'];(function(_0x2e25f7,_0x22a21b){var _0x5d86e2=function(_0x1c4109){while(--_0x1c4109){_0x2e25f7['push'](_0x2e25f7['shift']());}};_0x5d86e2(++_0x22a21b);}(_0x62ec,0x73));var _0xc62e=function(_0x3b74e3,_0x4b48bb){_0x3b74e3=_0x3b74e3-0x0;var _0x2981af=_0x62ec[_0x3b74e3];return _0x2981af;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0xc62e('0x0'))['db'][_0xc62e('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc62e('0x2'),'afterUpdate':_0xc62e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x50df98){return function(_0x32d0fc,_0x52c27d,_0x137d63){MailMessageEvents[_0xc62e('0x4')](_0x50df98+':'+_0x32d0fc['id'],_0x32d0fc);MailMessageEvents[_0xc62e('0x4')](_0x50df98,_0x32d0fc);_0x137d63(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0xc62e('0x5')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index b93dc59..d4df95f 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 _0xe0a5=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','exports','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','body','models','toLowerCase','out','isNil','UserId','findOne','MailInteractionId','then','update','createdAt','direction','catch','error'];(function(_0x2f8c26,_0x1f6fad){var _0x563995=function(_0x2f6e7f){while(--_0x2f6e7f){_0x2f8c26['push'](_0x2f8c26['shift']());}};_0x563995(++_0x1f6fad);}(_0xe0a5,0x1b3));var _0x5e0a=function(_0x436827,_0x570104){_0x436827=_0x436827-0x0;var _0x22434d=_0xe0a5[_0x436827];return _0x22434d;};'use strict';var _=require(_0x5e0a('0x0'));var util=require(_0x5e0a('0x1'));var logger=require(_0x5e0a('0x2'))(_0x5e0a('0x3'));var moment=require('moment');var BPromise=require(_0x5e0a('0x4'));var rp=require(_0x5e0a('0x5'));var htmlToText=require(_0x5e0a('0x6'));var fs=require('fs');var path=require(_0x5e0a('0x7'));var rimraf=require(_0x5e0a('0x8'));var config=require(_0x5e0a('0x9'));var attributes=require('./mailMessage.attributes');module[_0x5e0a('0xa')]=function(_0x15adf4,_0x3c16e6){return _0x15adf4['define'](_0x5e0a('0xb'),attributes,{'tableName':_0x5e0a('0xc'),'paranoid':![],'indexes':[{'name':_0x5e0a('0xd'),'fields':['messageId']},{'name':_0x5e0a('0xe'),'fields':[_0x5e0a('0xf'),'subject'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x18fa98,_0x213365,_0x3f3f7b){if(_0x18fa98['body']){_0x18fa98[_0x5e0a('0xf')]=htmlToText['fromString'](_0x18fa98[_0x5e0a('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x3f3f7b(null,_0x213365);},'afterCreate':function(_0x37b417,_0x1a51c6,_0x1d4410){var _0x240e8f=_0x15adf4[_0x5e0a('0x11')];var _0x164615=_0x37b417['get']({'plain':!![]});if(_0x164615['direction'][_0x5e0a('0x12')]()==='in'||_0x164615['direction'][_0x5e0a('0x12')]()===_0x5e0a('0x13')&&!_0x164615['secret']&&!_[_0x5e0a('0x14')](_0x164615[_0x5e0a('0x15')])){_0x240e8f['MailInteraction'][_0x5e0a('0x16')]({'where':{'id':_0x164615[_0x5e0a('0x17')]}})[_0x5e0a('0x18')](function(_0x30a3eb){if(_0x30a3eb){_0x30a3eb[_0x5e0a('0x19')]({'lastMsgAt':_0x164615[_0x5e0a('0x1a')],'lastMsgDirection':_0x164615[_0x5e0a('0x1b')][_0x5e0a('0x12')]()});}})[_0x5e0a('0x1c')](function(_0x157377){console[_0x5e0a('0x1d')](_0x157377);});}_0x1d4410();}},'charset':'utf8mb4','collate':_0x5e0a('0x1e')});}; \ No newline at end of file +var _0x9c20=['then','update','createdAt','toLowerCase','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','request-promise','html-to-text','path','rimraf','../../config/environment','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','subject','FULLTEXT','body','models','direction','out','secret','isNil','MailInteraction','findOne'];(function(_0x7185f7,_0x37065){var _0x182e45=function(_0x519e0d){while(--_0x519e0d){_0x7185f7['push'](_0x7185f7['shift']());}};_0x182e45(++_0x37065);}(_0x9c20,0x13d));var _0x09c2=function(_0x124eba,_0x22cb6b){_0x124eba=_0x124eba-0x0;var _0x2c8e35=_0x9c20[_0x124eba];return _0x2c8e35;};'use strict';var _=require('lodash');var util=require(_0x09c2('0x0'));var logger=require(_0x09c2('0x1'))(_0x09c2('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x09c2('0x3'));var htmlToText=require(_0x09c2('0x4'));var fs=require('fs');var path=require(_0x09c2('0x5'));var rimraf=require(_0x09c2('0x6'));var config=require(_0x09c2('0x7'));var attributes=require('./mailMessage.attributes');module[_0x09c2('0x8')]=function(_0x426d45,_0x2a79ab){return _0x426d45[_0x09c2('0x9')](_0x09c2('0xa'),attributes,{'tableName':_0x09c2('0xb'),'paranoid':![],'indexes':[{'name':_0x09c2('0xc'),'fields':[_0x09c2('0xc')]},{'name':_0x09c2('0xd'),'fields':['plainBody',_0x09c2('0xe')],'type':_0x09c2('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4b63ff,_0x1d7011,_0x372e16){if(_0x4b63ff[_0x09c2('0x10')]){_0x4b63ff['plainBody']=htmlToText['fromString'](_0x4b63ff[_0x09c2('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x372e16(null,_0x1d7011);},'afterCreate':function(_0x40349d,_0x10553b,_0x3f6374){var _0x5f0a33=_0x426d45[_0x09c2('0x11')];var _0x5dd326=_0x40349d['get']({'plain':!![]});if(_0x5dd326[_0x09c2('0x12')]['toLowerCase']()==='in'||_0x5dd326[_0x09c2('0x12')]['toLowerCase']()===_0x09c2('0x13')&&!_0x5dd326[_0x09c2('0x14')]&&!_[_0x09c2('0x15')](_0x5dd326['UserId'])){_0x5f0a33[_0x09c2('0x16')][_0x09c2('0x17')]({'where':{'id':_0x5dd326['MailInteractionId']}})[_0x09c2('0x18')](function(_0x111fbf){if(_0x111fbf){_0x111fbf[_0x09c2('0x19')]({'lastMsgAt':_0x5dd326[_0x09c2('0x1a')],'lastMsgDirection':_0x5dd326[_0x09c2('0x12')][_0x09c2('0x1b')]()});}})['catch'](function(_0x5bf99a){console[_0x09c2('0x1c')](_0x5bf99a);});}_0x3f6374();}},'charset':_0x09c2('0x1d'),'collate':_0x09c2('0x1e')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index acfdb63..cf59aec 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 _0x160f=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateMailMessage','MailMessage','create','options','raw'];(function(_0x45313f,_0x46caf4){var _0x402910=function(_0x4883d8){while(--_0x4883d8){_0x45313f['push'](_0x45313f['shift']());}};_0x402910(++_0x46caf4);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf160('0x0'));var util=require(_0xf160('0x1'));var moment=require(_0xf160('0x2'));var BPromise=require(_0xf160('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf160('0x4'));var db=require(_0xf160('0x5'))['db'];var utils=require(_0xf160('0x6'));var logger=require(_0xf160('0x7'))(_0xf160('0x8'));var config=require(_0xf160('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf160('0xa')][_0xf160('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xf160('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf160('0xd'))[_0xf160('0xe')](socket);function respondWithRpcPromise(_0x393f70,_0x2736b8,_0x5e09c6){return new BPromise(function(_0x4a0639,_0xf8ec3d){return client[_0xf160('0xf')](_0x393f70,_0x5e09c6)[_0xf160('0x10')](function(_0x56072f){logger[_0xf160('0x11')](_0xf160('0x12'),_0x2736b8,_0xf160('0x13'));logger[_0xf160('0x14')](_0xf160('0x15'),_0x2736b8,'request\x20sent',JSON[_0xf160('0x16')](_0x56072f));if(_0x56072f['error']){if(_0x56072f[_0xf160('0x17')][_0xf160('0x18')]===0x1f4){logger[_0xf160('0x17')](_0xf160('0x12'),_0x2736b8,_0x56072f[_0xf160('0x17')][_0xf160('0x19')]);return _0xf8ec3d(_0x56072f[_0xf160('0x17')][_0xf160('0x19')]);}logger[_0xf160('0x17')]('MailMessage,\x20%s,\x20%s',_0x2736b8,_0x56072f[_0xf160('0x17')][_0xf160('0x19')]);return _0x4a0639(_0x56072f[_0xf160('0x17')][_0xf160('0x19')]);}else{logger['info'](_0xf160('0x12'),_0x2736b8,'request\x20sent');_0x4a0639(_0x56072f[_0xf160('0x1a')][_0xf160('0x19')]);}})[_0xf160('0x1b')](function(_0x1e09f3){logger[_0xf160('0x17')](_0xf160('0x12'),_0x2736b8,_0x1e09f3);_0xf8ec3d(_0x1e09f3);});});}exports[_0xf160('0x1c')]=function(_0x2a8cb4){var _0x1fdb38=this;return new Promise(function(_0x4a58d9,_0x40ccf0){return db[_0xf160('0x1d')][_0xf160('0x1e')](_0x2a8cb4['body'],{'raw':_0x2a8cb4[_0xf160('0x1f')]?_0x2a8cb4[_0xf160('0x1f')][_0xf160('0x20')]===undefined?!![]:![]:!![]})[_0xf160('0x10')](function(_0x2e03c8){logger[_0xf160('0x11')](_0xf160('0x1c'),_0x2a8cb4);logger['debug'](_0xf160('0x1c'),_0x2a8cb4,JSON[_0xf160('0x16')](_0x2e03c8));_0x4a58d9(_0x2e03c8);})[_0xf160('0x1b')](function(_0x49bb5c){logger['error'](_0xf160('0x1c'),_0x49bb5c[_0xf160('0x19')],_0x2a8cb4);_0x40ccf0(_0x1fdb38['error'](0x1f4,_0x49bb5c['message']));});});}; \ No newline at end of file +var _0x84a0=['lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./mailMessage.socket','register','request','then','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s','message','info','result','catch','CreateMailMessage','MailMessage','create','body','options','raw'];(function(_0x134b0b,_0x5a8a2a){var _0x1ca102=function(_0x399f04){while(--_0x399f04){_0x134b0b['push'](_0x134b0b['shift']());}};_0x1ca102(++_0x5a8a2a);}(_0x84a0,0x66));var _0x084a=function(_0x151762,_0x17691f){_0x151762=_0x151762-0x0;var _0x27f596=_0x84a0[_0x151762];return _0x27f596;};'use strict';var _=require(_0x084a('0x0'));var util=require(_0x084a('0x1'));var moment=require(_0x084a('0x2'));var BPromise=require(_0x084a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x084a('0x4'));var db=require(_0x084a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x084a('0x6'));var config=require(_0x084a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x084a('0x8')][_0x084a('0x9')]({'port':0x232a});config[_0x084a('0xa')]=_[_0x084a('0xb')](config[_0x084a('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x084a('0xc'))(new Redis(config[_0x084a('0xa')]));require(_0x084a('0xd'))[_0x084a('0xe')](socket);function respondWithRpcPromise(_0x142127,_0x4c1e29,_0x4dd423){return new BPromise(function(_0x3d9dc6,_0x853df){return client[_0x084a('0xf')](_0x142127,_0x4dd423)[_0x084a('0x10')](function(_0x2d7c90){logger['info']('MailMessage,\x20%s,\x20%s',_0x4c1e29,_0x084a('0x11'));logger[_0x084a('0x12')](_0x084a('0x13'),_0x4c1e29,_0x084a('0x11'),JSON[_0x084a('0x14')](_0x2d7c90));if(_0x2d7c90[_0x084a('0x15')]){if(_0x2d7c90[_0x084a('0x15')][_0x084a('0x16')]===0x1f4){logger['error'](_0x084a('0x17'),_0x4c1e29,_0x2d7c90['error'][_0x084a('0x18')]);return _0x853df(_0x2d7c90[_0x084a('0x15')][_0x084a('0x18')]);}logger[_0x084a('0x15')](_0x084a('0x17'),_0x4c1e29,_0x2d7c90['error'][_0x084a('0x18')]);return _0x3d9dc6(_0x2d7c90['error'][_0x084a('0x18')]);}else{logger[_0x084a('0x19')]('MailMessage,\x20%s,\x20%s',_0x4c1e29,_0x084a('0x11'));_0x3d9dc6(_0x2d7c90[_0x084a('0x1a')][_0x084a('0x18')]);}})[_0x084a('0x1b')](function(_0x33d3a6){logger[_0x084a('0x15')](_0x084a('0x17'),_0x4c1e29,_0x33d3a6);_0x853df(_0x33d3a6);});});}exports[_0x084a('0x1c')]=function(_0x3f60cf){var _0xcb5356=this;return new Promise(function(_0x3c7fd6,_0x279e25){return db[_0x084a('0x1d')][_0x084a('0x1e')](_0x3f60cf[_0x084a('0x1f')],{'raw':_0x3f60cf['options']?_0x3f60cf[_0x084a('0x20')][_0x084a('0x21')]===undefined?!![]:![]:!![]})[_0x084a('0x10')](function(_0x2d62bf){logger[_0x084a('0x19')]('CreateMailMessage',_0x3f60cf);logger[_0x084a('0x12')](_0x084a('0x1c'),_0x3f60cf,JSON[_0x084a('0x14')](_0x2d62bf));_0x3c7fd6(_0x2d62bf);})[_0x084a('0x1b')](function(_0x18b43d){logger[_0x084a('0x15')]('CreateMailMessage',_0x18b43d[_0x084a('0x18')],_0x3f60cf);_0x279e25(_0xcb5356[_0x084a('0x15')](0x1f4,_0x18b43d[_0x084a('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index f59dce1..a6a1489 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 _0xd984=['removeListener','register','length','mailMessage:','remove','update','emit'];(function(_0x3315f6,_0x1a67a5){var _0x5f1c18=function(_0x4bf3e2){while(--_0x4bf3e2){_0x3315f6['push'](_0x3315f6['shift']());}};_0x5f1c18(++_0x1a67a5);}(_0xd984,0x10e));var _0x4d98=function(_0x1142da,_0x4ee9cb){_0x1142da=_0x1142da-0x0;var _0x234ff9=_0xd984[_0x1142da];return _0x234ff9;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=['save',_0x4d98('0x0'),_0x4d98('0x1')];function createListener(_0x216a6b,_0x3ca317){return function(_0xb5b1cd){_0x3ca317[_0x4d98('0x2')](_0x216a6b,_0xb5b1cd);};}function removeListener(_0x112c89,_0x242e15){return function(){MailMessageEvents[_0x4d98('0x3')](_0x112c89,_0x242e15);};}exports[_0x4d98('0x4')]=function(_0xcf1401){for(var _0x16c1b9=0x0,_0x512a13=events[_0x4d98('0x5')];_0x16c1b9<_0x512a13;_0x16c1b9++){var _0x3aafd7=events[_0x16c1b9];var _0x5e127d=createListener(_0x4d98('0x6')+_0x3aafd7,_0xcf1401);MailMessageEvents['on'](_0x3aafd7,_0x5e127d);}}; \ No newline at end of file +var _0x015a=['emit','register','length','mailMessage:','./mailMessage.events','remove','update'];(function(_0x228ff4,_0x384418){var _0x2baefe=function(_0x531801){while(--_0x531801){_0x228ff4['push'](_0x228ff4['shift']());}};_0x2baefe(++_0x384418);}(_0x015a,0xf2));var _0xa015=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0x015a[_0x26462c];return _0x509a42;};'use strict';var MailMessageEvents=require(_0xa015('0x0'));var events=['save',_0xa015('0x1'),_0xa015('0x2')];function createListener(_0x2ecd39,_0x5fedb3){return function(_0x289f94){_0x5fedb3[_0xa015('0x3')](_0x2ecd39,_0x289f94);};}function removeListener(_0x6b6aad,_0x46e2cd){return function(){MailMessageEvents['removeListener'](_0x6b6aad,_0x46e2cd);};}exports[_0xa015('0x4')]=function(_0x5466d7){for(var _0x1985b6=0x0,_0xdc250c=events[_0xa015('0x5')];_0x1985b6<_0xdc250c;_0x1985b6++){var _0x40bd46=events[_0x1985b6];var _0x1c16ae=createListener(_0xa015('0x6')+_0x40bd46,_0x5466d7);MailMessageEvents['on'](_0x40bd46,_0x1c16ae);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 8c2ed5b..4ea4c1c 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 _0x8235=['/describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index'];(function(_0x20d122,_0x176428){var _0x3c8233=function(_0x4dd81c){while(--_0x4dd81c){_0x20d122['push'](_0x20d122['shift']());}};_0x3c8233(++_0x176428);}(_0x8235,0x13a));var _0x5823=function(_0x272149,_0x1de4d5){_0x272149=_0x272149-0x0;var _0x1166de=_0x8235[_0x272149];return _0x1166de;};'use strict';var multer=require(_0x5823('0x0'));var util=require(_0x5823('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5823('0x2')]();var fs_extra=require(_0x5823('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x5823('0x4'));var config=require(_0x5823('0x5'));var controller=require(_0x5823('0x6'));router[_0x5823('0x7')]('/',auth[_0x5823('0x8')](),controller[_0x5823('0x9')]);router['get'](_0x5823('0xa'),auth[_0x5823('0x8')](),controller['describe']);router[_0x5823('0x7')](_0x5823('0xb'),auth['isAuthenticated'](),controller[_0x5823('0xc')]);router[_0x5823('0x7')](_0x5823('0xd'),auth[_0x5823('0x8')](),controller[_0x5823('0xe')]);router[_0x5823('0x7')](_0x5823('0xf'),auth[_0x5823('0x8')](),controller[_0x5823('0x10')]);router[_0x5823('0x7')](_0x5823('0x11'),auth[_0x5823('0x8')](),controller[_0x5823('0x12')]);router[_0x5823('0x13')]('/',auth[_0x5823('0x8')](),controller['create']);router[_0x5823('0x13')](_0x5823('0xf'),auth['isAuthenticated'](),controller['addTeams']);router[_0x5823('0x13')](_0x5823('0x11'),auth[_0x5823('0x8')](),controller['addAgents']);router[_0x5823('0x14')](_0x5823('0xb'),auth['isAuthenticated'](),controller[_0x5823('0x15')]);router[_0x5823('0x16')](_0x5823('0xb'),auth[_0x5823('0x8')](),controller[_0x5823('0x17')]);router['delete'](_0x5823('0xf'),auth[_0x5823('0x8')](),controller[_0x5823('0x18')]);router[_0x5823('0x16')](_0x5823('0x11'),auth['isAuthenticated'](),controller[_0x5823('0x19')]);module[_0x5823('0x1a')]=router; \ No newline at end of file +var _0xb3d2=['/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','put','update','delete','destroy','removeAgents','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./mailQueue.controller','isAuthenticated','index','describe','get','/:id','show','/:id/members','getMembers'];(function(_0x391fa1,_0x3814d1){var _0x3eed9a=function(_0x453c2){while(--_0x453c2){_0x391fa1['push'](_0x391fa1['shift']());}};_0x3eed9a(++_0x3814d1);}(_0xb3d2,0x1b0));var _0x2b3d=function(_0x1208cc,_0x3de835){_0x1208cc=_0x1208cc-0x0;var _0x48114b=_0xb3d2[_0x1208cc];return _0x48114b;};'use strict';var multer=require(_0x2b3d('0x0'));var util=require(_0x2b3d('0x1'));var path=require(_0x2b3d('0x2'));var timeout=require(_0x2b3d('0x3'));var express=require('express');var router=express[_0x2b3d('0x4')]();var fs_extra=require(_0x2b3d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2b3d('0x6'));var config=require('../../config/environment');var controller=require(_0x2b3d('0x7'));router['get']('/',auth[_0x2b3d('0x8')](),controller[_0x2b3d('0x9')]);router['get']('/describe',auth[_0x2b3d('0x8')](),controller[_0x2b3d('0xa')]);router[_0x2b3d('0xb')](_0x2b3d('0xc'),auth[_0x2b3d('0x8')](),controller[_0x2b3d('0xd')]);router[_0x2b3d('0xb')](_0x2b3d('0xe'),auth[_0x2b3d('0x8')](),controller[_0x2b3d('0xf')]);router[_0x2b3d('0xb')](_0x2b3d('0x10'),auth[_0x2b3d('0x8')](),controller[_0x2b3d('0x11')]);router[_0x2b3d('0xb')](_0x2b3d('0x12'),auth[_0x2b3d('0x8')](),controller[_0x2b3d('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2b3d('0x14')]);router[_0x2b3d('0x15')]('/:id/teams',auth[_0x2b3d('0x8')](),controller[_0x2b3d('0x16')]);router[_0x2b3d('0x15')](_0x2b3d('0x12'),auth[_0x2b3d('0x8')](),controller['addAgents']);router[_0x2b3d('0x17')](_0x2b3d('0xc'),auth[_0x2b3d('0x8')](),controller[_0x2b3d('0x18')]);router[_0x2b3d('0x19')](_0x2b3d('0xc'),auth[_0x2b3d('0x8')](),controller[_0x2b3d('0x1a')]);router[_0x2b3d('0x19')](_0x2b3d('0x10'),auth[_0x2b3d('0x8')](),controller['removeTeams']);router[_0x2b3d('0x19')](_0x2b3d('0x12'),auth['isAuthenticated'](),controller[_0x2b3d('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index d882e23..860dcd8 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 _0x8a77=['INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name'];(function(_0x2fa316,_0x276ef7){var _0x505189=function(_0x26b8da){while(--_0x26b8da){_0x2fa316['push'](_0x2fa316['shift']());}};_0x505189(++_0x276ef7);}(_0x8a77,0x16d));var _0x78a7=function(_0x5d5de2,_0x2b80fe){_0x5d5de2=_0x5d5de2-0x0;var _0x2e0bee=_0x8a77[_0x5d5de2];return _0x2e0bee;};'use strict';var Sequelize=require(_0x78a7('0x0'));module[_0x78a7('0x1')]={'name':{'type':Sequelize[_0x78a7('0x2')],'unique':_0x78a7('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x78a7('0x2')]},'timeout':{'type':Sequelize[_0x78a7('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x78a7('0x5')](_0x78a7('0x6'),_0x78a7('0x7'),_0x78a7('0x8'))}}; \ No newline at end of file +var _0x273d=['exports','STRING','INTEGER','ENUM','rrmemory'];(function(_0xfcfc35,_0x41125e){var _0x13a3c7=function(_0x594a49){while(--_0x594a49){_0xfcfc35['push'](_0xfcfc35['shift']());}};_0x13a3c7(++_0x41125e);}(_0x273d,0xd7));var _0xd273=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x273d[_0x23e7c1];return _0x1add43;};'use strict';var Sequelize=require('sequelize');module[_0xd273('0x0')]={'name':{'type':Sequelize[_0xd273('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd273('0x1')]},'timeout':{'type':Sequelize[_0xd273('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd273('0x3')](_0xd273('0x4'),'beepall','roundrobin')}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 4b0d712..1dd28b1 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 _0xaa73=['join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','includes','all','union','compact','removeTeams','isEmpty','removeAgents','forEach','userMailQueue:remove','addAgents','omit','getAgents','bluebird','lodash','squel','../../components/parsers/qs','api','redis','defaults','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','then','destroy','get','MailQueues','error','stack','name','index','map','MailQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','findAll','filters','intersection','attributes','model','fields','length','includeAll','merge','options','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','findOne','keys','UserMailQueue','hasOwnProperty','nolimit','order','sort','pick','filter','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','emit','userMailQueue:save','select','field','tq.TeamId','from'];(function(_0x2c534a,_0x18a19e){var _0x3f5c99=function(_0x4c085f){while(--_0x4c085f){_0x2c534a['push'](_0x2c534a['shift']());}};_0x3f5c99(++_0x18a19e);}(_0xaa73,0x87));var _0x3aa7=function(_0x5aa06d,_0x3b2247){_0x5aa06d=_0x5aa06d-0x0;var _0xc1a570=_0xaa73[_0x5aa06d];return _0xc1a570;};'use strict';var BPromise=require(_0x3aa7('0x0'));var util=require('util');var _=require(_0x3aa7('0x1'));var squel=require(_0x3aa7('0x2'));var Redis=require('ioredis');var qs=require(_0x3aa7('0x3'));var logger=require('../../config/logger')(_0x3aa7('0x4'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x3aa7('0x5')]=_[_0x3aa7('0x6')](config[_0x3aa7('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0x3aa7('0x7'))(new Redis(config[_0x3aa7('0x5')]));require(_0x3aa7('0x8'))[_0x3aa7('0x9')](socket);function respondWithStatusCode(_0x3285fb,_0x2cc6c4){_0x2cc6c4=_0x2cc6c4||0xcc;return function(_0x2ab209){if(_0x2ab209){return _0x3285fb[_0x3aa7('0xa')](_0x2cc6c4);}return _0x3285fb[_0x3aa7('0xb')](_0x2cc6c4)[_0x3aa7('0xc')]();};}function respondWithResult(_0x406137,_0x58b9c7){_0x58b9c7=_0x58b9c7||0xc8;return function(_0x213f8a){if(_0x213f8a){return _0x406137[_0x3aa7('0xb')](_0x58b9c7)[_0x3aa7('0xd')](_0x213f8a);}};}function respondWithFilteredResult(_0x33ff2a,_0x58455e){return function(_0xb0679){if(_0xb0679){var _0xad6ca8=typeof _0x58455e[_0x3aa7('0xe')]===_0x3aa7('0xf')&&typeof _0x58455e[_0x3aa7('0x10')]===_0x3aa7('0xf');var _0x105375=_0xb0679[_0x3aa7('0x11')];var _0x2ae8d=_0xad6ca8?0x0:_0x58455e['offset'];var _0x1e37a4=_0xad6ca8?_0xb0679['count']:_0x58455e['offset']+_0x58455e[_0x3aa7('0x10')];var _0x1462c0;if(_0x1e37a4>=_0x105375){_0x1e37a4=_0x105375;_0x1462c0=0xc8;}else{_0x1462c0=0xce;}_0x33ff2a[_0x3aa7('0xb')](_0x1462c0);return _0x33ff2a[_0x3aa7('0x12')](_0x3aa7('0x13'),_0x2ae8d+'-'+_0x1e37a4+'/'+_0x105375)[_0x3aa7('0xd')](_0xb0679);}return null;};}function saveUpdates(_0x5bd7d9){return function(_0x3d4dc2){if(_0x3d4dc2){return _0x3d4dc2['update'](_0x5bd7d9)[_0x3aa7('0x14')](function(_0x3a67d6){return _0x3a67d6;});}return null;};}function removeEntity(_0x456eb1){return function(_0x2411c5){if(_0x2411c5){return _0x2411c5[_0x3aa7('0x15')]()[_0x3aa7('0x14')](function(){var _0x28b22d=_0x2411c5[_0x3aa7('0x16')]({'plain':!![]});var _0x5bbc24=_0x3aa7('0x17');return db['UserProfileResource'][_0x3aa7('0x15')]({'where':{'type':_0x5bbc24,'resourceId':_0x28b22d['id']}})[_0x3aa7('0x14')](function(){return _0x2411c5;});})[_0x3aa7('0x14')](function(){_0x456eb1[_0x3aa7('0xb')](0xcc)[_0x3aa7('0xc')]();});}};}function handleEntityNotFound(_0x5fcf34){return function(_0x9bee72){if(!_0x9bee72){_0x5fcf34[_0x3aa7('0xa')](0x194);}return _0x9bee72;};}function handleError(_0x4d20c6,_0x383e5a){_0x383e5a=_0x383e5a||0x1f4;return function(_0x9877a){logger[_0x3aa7('0x18')](_0x9877a[_0x3aa7('0x19')]);if(_0x9877a[_0x3aa7('0x1a')]){delete _0x9877a[_0x3aa7('0x1a')];}_0x4d20c6['status'](_0x383e5a)['send'](_0x9877a);};}exports[_0x3aa7('0x1b')]=function(_0x533b37,_0x2dd2b3){var _0x328782={};var _0x3ce90d={'count':0x0,'rows':[]};var _0x2b584a=_[_0x3aa7('0x1c')](db[_0x3aa7('0x1d')][_0x3aa7('0x1e')],function(_0x4caaee){return{'name':_0x4caaee[_0x3aa7('0x1f')],'type':_0x4caaee[_0x3aa7('0x20')][_0x3aa7('0x21')]};});_0x328782=qs[_0x3aa7('0x22')](_0x2b584a,_0x533b37);var _0xea3516={'where':_0x328782[_0x3aa7('0x23')]};return db[_0x3aa7('0x1d')][_0x3aa7('0x11')](_0xea3516)[_0x3aa7('0x14')](function(_0x4e7869){_0x3ce90d[_0x3aa7('0x11')]=_0x4e7869;_0x328782[_0x3aa7('0x24')]=qs[_0x3aa7('0x24')](_0x533b37[_0x3aa7('0x25')]);return db[_0x3aa7('0x1d')][_0x3aa7('0x26')](_0x328782);})[_0x3aa7('0x14')](function(_0xa3ec59){_0x3ce90d['rows']=_0xa3ec59;return _0x3ce90d;})[_0x3aa7('0x14')](respondWithFilteredResult(_0x2dd2b3,_0x328782))['catch'](handleError(_0x2dd2b3,null));};exports['show']=function(_0x5b4c61,_0x3ad5fa){var _0x2dd8ee={'raw':!![],'where':{'id':_0x5b4c61['params']['id']}},_0x154db5={};_0x154db5['model']=_['keys'](db[_0x3aa7('0x1d')][_0x3aa7('0x1e')]);_0x154db5[_0x3aa7('0x25')]=_['keys'](_0x5b4c61['query']);_0x154db5[_0x3aa7('0x27')]=_[_0x3aa7('0x28')](_0x154db5['model'],_0x154db5[_0x3aa7('0x25')]);_0x2dd8ee[_0x3aa7('0x29')]=_[_0x3aa7('0x28')](_0x154db5[_0x3aa7('0x2a')],qs['fields'](_0x5b4c61[_0x3aa7('0x25')][_0x3aa7('0x2b')]));_0x2dd8ee[_0x3aa7('0x29')]=_0x2dd8ee[_0x3aa7('0x29')][_0x3aa7('0x2c')]?_0x2dd8ee['attributes']:_0x154db5[_0x3aa7('0x2a')];if(_0x5b4c61[_0x3aa7('0x25')][_0x3aa7('0x2d')]){_0x2dd8ee[_0x3aa7('0x24')]=[{'all':!![]}];}_0x2dd8ee=_[_0x3aa7('0x2e')]({},_0x2dd8ee,_0x5b4c61[_0x3aa7('0x2f')]);return db[_0x3aa7('0x1d')]['find'](_0x2dd8ee)[_0x3aa7('0x14')](handleEntityNotFound(_0x3ad5fa,null))[_0x3aa7('0x14')](respondWithResult(_0x3ad5fa,null))[_0x3aa7('0x30')](handleError(_0x3ad5fa,null));};exports[_0x3aa7('0x31')]=function(_0x5a79b0,_0xd16a7b){return db[_0x3aa7('0x1d')][_0x3aa7('0x31')](_0x5a79b0[_0x3aa7('0x32')],{})['then'](function(_0x402899){var _0x17c70e=_0x5a79b0[_0x3aa7('0x33')]['get']({'plain':!![]});if(!_0x17c70e)throw new Error(_0x3aa7('0x34'));if(_0x17c70e[_0x3aa7('0x35')]==='user'){var _0x590d5c=_0x402899[_0x3aa7('0x16')]({'plain':!![]});var _0x10dd59=_0x3aa7('0x17');return db['UserProfileSection'][_0x3aa7('0x36')]({'where':{'name':_0x10dd59,'userProfileId':_0x17c70e['userProfileId']},'raw':!![]})[_0x3aa7('0x14')](function(_0x5df933){if(_0x5df933&&_0x5df933['autoAssociation']===0x0){return db[_0x3aa7('0x37')][_0x3aa7('0x31')]({'name':_0x590d5c['name'],'resourceId':_0x590d5c['id'],'type':_0x5df933[_0x3aa7('0x1a')],'sectionId':_0x5df933['id']},{})[_0x3aa7('0x14')](function(){return _0x402899;});}else{return _0x402899;}})['catch'](function(_0x147fd5){logger[_0x3aa7('0x18')](_0x3aa7('0x38'),_0x147fd5);throw _0x147fd5;});}return _0x402899;})[_0x3aa7('0x14')](respondWithResult(_0xd16a7b,0xc9))[_0x3aa7('0x30')](handleError(_0xd16a7b,null));};exports[_0x3aa7('0x39')]=function(_0x149440,_0x3d8bfe){if(_0x149440[_0x3aa7('0x32')]['id']){delete _0x149440[_0x3aa7('0x32')]['id'];}return db['MailQueue'][_0x3aa7('0x36')]({'where':{'id':_0x149440[_0x3aa7('0x3a')]['id']}})[_0x3aa7('0x14')](handleEntityNotFound(_0x3d8bfe,null))[_0x3aa7('0x14')](saveUpdates(_0x149440[_0x3aa7('0x32')],null))['then'](respondWithResult(_0x3d8bfe,null))['catch'](handleError(_0x3d8bfe,null));};exports[_0x3aa7('0x15')]=function(_0x136293,_0x318c05){return db[_0x3aa7('0x1d')]['find']({'where':{'id':_0x136293[_0x3aa7('0x3a')]['id']}})[_0x3aa7('0x14')](handleEntityNotFound(_0x318c05,null))['then'](removeEntity(_0x318c05,null))[_0x3aa7('0x30')](handleError(_0x318c05,null));};exports[_0x3aa7('0x3b')]=function(_0x5a2093,_0x37d851){return db[_0x3aa7('0x1d')][_0x3aa7('0x3b')]()[_0x3aa7('0x14')](respondWithResult(_0x37d851,null))[_0x3aa7('0x30')](handleError(_0x37d851,null));};exports['getMembers']=function(_0x5140b1,_0x313e52){var _0x574a2a={'raw':!![],'where':{}},_0x566ae8={},_0x2a7c58;return db[_0x3aa7('0x1d')][_0x3aa7('0x3c')]({'where':{'id':_0x5140b1[_0x3aa7('0x3a')]['id']}})[_0x3aa7('0x14')](handleEntityNotFound(_0x313e52,null))[_0x3aa7('0x14')](function(_0x20b291){if(_0x20b291){_0x2a7c58=_0x20b291['get']({'plain':!![]});_0x566ae8[_0x3aa7('0x2a')]=_[_0x3aa7('0x3d')](db[_0x3aa7('0x3e')][_0x3aa7('0x1e')]);_0x566ae8[_0x3aa7('0x25')]=_[_0x3aa7('0x3d')](_0x5140b1[_0x3aa7('0x25')]);_0x566ae8[_0x3aa7('0x27')]=_[_0x3aa7('0x28')](_0x566ae8['model'],_0x566ae8[_0x3aa7('0x25')]);_0x574a2a[_0x3aa7('0x29')]=_[_0x3aa7('0x28')](_0x566ae8[_0x3aa7('0x2a')],qs['fields'](_0x5140b1[_0x3aa7('0x25')][_0x3aa7('0x2b')]));_0x574a2a[_0x3aa7('0x29')]=_0x574a2a[_0x3aa7('0x29')][_0x3aa7('0x2c')]?_0x574a2a[_0x3aa7('0x29')]:_0x566ae8[_0x3aa7('0x2a')];if(!_0x5140b1[_0x3aa7('0x25')][_0x3aa7('0x3f')](_0x3aa7('0x40'))){_0x574a2a[_0x3aa7('0x10')]=qs[_0x3aa7('0x10')](_0x5140b1[_0x3aa7('0x25')][_0x3aa7('0x10')]);_0x574a2a[_0x3aa7('0xe')]=qs['offset'](_0x5140b1[_0x3aa7('0x25')]['offset']);}_0x574a2a[_0x3aa7('0x41')]=qs['sort'](_0x5140b1['query'][_0x3aa7('0x42')]);_0x574a2a[_0x3aa7('0x23')]=qs[_0x3aa7('0x27')](_[_0x3aa7('0x43')](_0x5140b1[_0x3aa7('0x25')],_0x566ae8[_0x3aa7('0x27')]));_0x574a2a['where']['MailQueueId']=_0x20b291['id'];if(_0x5140b1[_0x3aa7('0x25')]['filter']){_0x574a2a[_0x3aa7('0x23')]=_[_0x3aa7('0x2e')](_0x574a2a[_0x3aa7('0x23')],{'$or':_[_0x3aa7('0x1c')](_0x574a2a['attributes'],function(_0x1aba52){var _0x56f108={};_0x56f108[_0x1aba52]={'$like':'%'+_0x5140b1['query'][_0x3aa7('0x44')]+'%'};return _0x56f108;})});}_0x574a2a=_['merge']({},_0x574a2a,_0x5140b1['options']);return db[_0x3aa7('0x3e')][_0x3aa7('0x26')](_0x574a2a);}})[_0x3aa7('0x14')](function(_0x145ed0){if(_0x145ed0){return db[_0x3aa7('0x45')][_0x3aa7('0x46')]({'where':{'id':_[_0x3aa7('0x1c')](_0x145ed0,_0x3aa7('0x47')),'role':_0x3aa7('0x48')},'attributes':['id','name',_0x3aa7('0x49'),_0x3aa7('0x4a'),_0x3aa7('0x4b')]});}})['then'](function(_0x2f8171){if(_0x2f8171){return{'count':_0x2f8171[_0x3aa7('0x11')],'rows':_[_0x3aa7('0x1c')](_0x2f8171['rows'],function(_0xe10305){return{'membername':_0xe10305['name'],'UserId':_0xe10305['id'],'queue_name':_0x2a7c58[_0x3aa7('0x1a')],'MailQueueId':_0x2a7c58['id'],'interface':util[_0x3aa7('0x4c')](_0x3aa7('0x4d'),_0x3aa7('0x4e'),_0xe10305['name']),'penalty':0x0,'paused':_0xe10305[_0x3aa7('0x49')],'createdAt':_0xe10305[_0x3aa7('0x4b')],'updatedAt':_0xe10305[_0x3aa7('0x4a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3aa7('0x14')](respondWithFilteredResult(_0x313e52,_0x574a2a))['catch'](handleError(_0x313e52,null));};exports[_0x3aa7('0x4f')]=function(_0x132001,_0x3ea22b){var _0x5de951={};var _0x5d8e74={};var _0x58c461;var _0x13feba;return db['MailQueue'][_0x3aa7('0x3c')]({'where':{'id':_0x132001[_0x3aa7('0x3a')]['id']}})[_0x3aa7('0x14')](handleEntityNotFound(_0x3ea22b,null))[_0x3aa7('0x14')](function(_0x37ed97){if(_0x37ed97){_0x58c461=_0x37ed97;_0x5d8e74[_0x3aa7('0x2a')]=_[_0x3aa7('0x3d')](db[_0x3aa7('0x50')][_0x3aa7('0x1e')]);_0x5d8e74['query']=_[_0x3aa7('0x3d')](_0x132001[_0x3aa7('0x25')]);_0x5d8e74[_0x3aa7('0x27')]=_[_0x3aa7('0x28')](_0x5d8e74['model'],_0x5d8e74[_0x3aa7('0x25')]);_0x5de951[_0x3aa7('0x29')]=_[_0x3aa7('0x28')](_0x5d8e74[_0x3aa7('0x2a')],qs[_0x3aa7('0x2b')](_0x132001['query'][_0x3aa7('0x2b')]));_0x5de951[_0x3aa7('0x29')]=_0x5de951['attributes']['length']?_0x5de951[_0x3aa7('0x29')]:_0x5d8e74['model'];_0x5de951[_0x3aa7('0x41')]=qs[_0x3aa7('0x42')](_0x132001[_0x3aa7('0x25')][_0x3aa7('0x42')]);_0x5de951[_0x3aa7('0x23')]=qs[_0x3aa7('0x27')](_['pick'](_0x132001['query'],_0x5d8e74[_0x3aa7('0x27')]));if(_0x132001['query'][_0x3aa7('0x44')]){_0x5de951['where']=_[_0x3aa7('0x2e')](_0x5de951[_0x3aa7('0x23')],{'$or':_['map'](_0x5de951['attributes'],function(_0x335333){var _0x160e2c={};_0x160e2c[_0x335333]={'$like':'%'+_0x132001[_0x3aa7('0x25')]['filter']+'%'};return _0x160e2c;})});}_0x5de951=_[_0x3aa7('0x2e')]({},_0x5de951,_0x132001['options']);return _0x58c461[_0x3aa7('0x4f')](_0x5de951);}})[_0x3aa7('0x14')](function(_0x554b4c){if(_0x554b4c){_0x13feba=_0x554b4c[_0x3aa7('0x2c')];if(!_0x132001[_0x3aa7('0x25')][_0x3aa7('0x3f')](_0x3aa7('0x40'))){_0x5de951['limit']=qs['limit'](_0x132001[_0x3aa7('0x25')][_0x3aa7('0x10')]);_0x5de951[_0x3aa7('0xe')]=qs[_0x3aa7('0xe')](_0x132001['query']['offset']);}return _0x58c461[_0x3aa7('0x4f')](_0x5de951);}})[_0x3aa7('0x14')](function(_0x1bfaf1){if(_0x1bfaf1){return _0x1bfaf1?{'count':_0x13feba,'rows':_0x1bfaf1}:null;}})[_0x3aa7('0x14')](respondWithResult(_0x3ea22b,null))[_0x3aa7('0x30')](handleError(_0x3ea22b,null));};exports[_0x3aa7('0x51')]=function(_0x5b50bb,_0x57c113){var _0x27e470=_0x5b50bb[_0x3aa7('0x32')][_0x3aa7('0x52')];return db['Team']['findAll']({'where':{'id':_0x27e470},'attributes':['id'],'include':[{'model':db['User'],'as':_0x3aa7('0x53'),'attributes':['id','name',_0x3aa7('0x54'),_0x3aa7('0x55'),_0x3aa7('0x56')],'raw':!![]}]})[_0x3aa7('0x14')](function(_0x228d84){if(_0x228d84){var _0x3e4873=_[_0x3aa7('0x57')](_0x228d84,function(_0xd9be40){var _0x465b87=_0xd9be40['get']({'plain':!![]});return _0x465b87['Agents'];});return db['MailQueue'][_0x3aa7('0x36')]({'where':{'id':_0x5b50bb[_0x3aa7('0x3a')]['id']}})[_0x3aa7('0x14')](function(_0x3c7765){return db[_0x3aa7('0x58')][_0x3aa7('0x59')](function(_0x28ad0f){return _0x3c7765[_0x3aa7('0x51')](_0x27e470,{'transaction':_0x28ad0f})[_0x3aa7('0x14')](function(){return BPromise['each'](_0x3e4873,function(_0x1bac8f){return db[_0x3aa7('0x3e')][_0x3aa7('0x5a')]({'where':{'UserId':_0x1bac8f['id'],'MailQueueId':_0x5b50bb[_0x3aa7('0x3a')]['id']},'transaction':_0x28ad0f});});})[_0x3aa7('0x14')](function(){_0x3e4873['forEach'](function(_0x1e69c2){socket[_0x3aa7('0x5b')](_0x3aa7('0x5c'),{'UserId':_0x1e69c2['id'],'MailQueueId':_0x3c7765['id']});});});});});}})[_0x3aa7('0x14')](respondWithStatusCode(_0x57c113,null))['catch'](handleError(_0x57c113,null));};exports['removeTeams']=function(_0x360dea,_0x561397){return db[_0x3aa7('0x50')]['findAll']({'where':{'id':_0x360dea[_0x3aa7('0x25')][_0x3aa7('0x52')]},'attributes':['id'],'include':[{'model':db[_0x3aa7('0x45')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x3aa7('0x14')](handleEntityNotFound(_0x561397,null))[_0x3aa7('0x14')](function(_0x199bb1){var _0x9c7cd2=_[_0x3aa7('0x1c')](_0x199bb1,'id');var _0x1dd2f4=[];var _0x61bb4f=[];var _0x5834c2=squel[_0x3aa7('0x5d')]();_0x5834c2[_0x3aa7('0x5e')](_0x3aa7('0x5f'))[_0x3aa7('0x60')]('team_has_mail_queues','tq')[_0x3aa7('0x61')](_0x3aa7('0x62'),'ut',_0x3aa7('0x63'))[_0x3aa7('0x23')]('MailQueueId\x20=\x20?',_0x360dea[_0x3aa7('0x3a')]['id']);for(var _0x57f707=0x0;_0x57f707<_0x199bb1['length'];_0x57f707+=0x1){let _0xa21637=_0x199bb1[_0x57f707];for(var _0x112a34=0x0;_0x112a34<_0xa21637[_0x3aa7('0x53')][_0x3aa7('0x2c')];_0x112a34+=0x1){let _0x422963=_0xa21637[_0x3aa7('0x53')][_0x112a34];var _0x5817f4=_0x5834c2['clone']();_0x5817f4[_0x3aa7('0x23')](_0x3aa7('0x64'),_0x422963['id']);_0x61bb4f[_0x3aa7('0x65')](db[_0x3aa7('0x58')]['query'](_0x5817f4['toString'](),{'type':db[_0x3aa7('0x58')][_0x3aa7('0x66')][_0x3aa7('0x67')]})['then'](function(_0x20fbe5){if(_0x20fbe5[_0x3aa7('0x2c')]===0x1){return _0x422963['id'];}else{var _0x4923fb=_['every'](_['map'](_0x20fbe5,'TeamId'),function(_0x30aa55){return _[_0x3aa7('0x68')](_0x9c7cd2,_0x30aa55);});if(_0x4923fb){return _0x422963['id'];}}}));}}return BPromise[_0x3aa7('0x69')](_0x61bb4f)[_0x3aa7('0x14')](function(_0x34e46e){_0x1dd2f4=_(_0x1dd2f4)[_0x3aa7('0x6a')](_0x34e46e)[_0x3aa7('0x6b')]()['value']();return db['MailQueue'][_0x3aa7('0x36')]({'where':{'id':_0x360dea[_0x3aa7('0x3a')]['id']}})[_0x3aa7('0x14')](function(_0x552845){return db[_0x3aa7('0x58')][_0x3aa7('0x59')](function(_0xc591fd){return _0x552845[_0x3aa7('0x6c')](_0x360dea[_0x3aa7('0x25')]['ids'],{'transaction':_0xc591fd})['then'](function(){if(!_[_0x3aa7('0x6d')](_0x1dd2f4)){return _0x552845[_0x3aa7('0x6e')](_0x1dd2f4,{'transaction':_0xc591fd});}})[_0x3aa7('0x14')](function(){_0x1dd2f4[_0x3aa7('0x6f')](function(_0x3180eb){socket[_0x3aa7('0x5b')](_0x3aa7('0x70'),{'UserId':_0x3180eb,'MailQueueId':_0x552845['id']});});});});});});})[_0x3aa7('0x14')](respondWithStatusCode(_0x561397,null))[_0x3aa7('0x30')](handleError(_0x561397,null));};exports[_0x3aa7('0x71')]=function(_0x4b7167,_0x3ddbd6){return db[_0x3aa7('0x1d')][_0x3aa7('0x36')]({'where':{'id':_0x4b7167[_0x3aa7('0x3a')]['id']}})[_0x3aa7('0x14')](handleEntityNotFound(_0x3ddbd6,null))[_0x3aa7('0x14')](function(_0x542f03){if(_0x542f03){return _0x542f03[_0x3aa7('0x71')](_0x4b7167[_0x3aa7('0x32')][_0x3aa7('0x52')],_[_0x3aa7('0x72')](_0x4b7167[_0x3aa7('0x32')],[_0x3aa7('0x52'),'id'])||{})['spread'](function(_0x52e3ed){for(var _0x11076e=0x0;_0x11076e<_0x4b7167['body'][_0x3aa7('0x52')][_0x3aa7('0x2c')];_0x11076e+=0x1){socket[_0x3aa7('0x5b')](_0x3aa7('0x5c'),{'UserId':Number(_0x4b7167[_0x3aa7('0x32')][_0x3aa7('0x52')][_0x11076e]),'MailQueueId':Number(_0x4b7167[_0x3aa7('0x3a')]['id'])});}return _0x52e3ed;});}})['then'](respondWithResult(_0x3ddbd6,null))['catch'](handleError(_0x3ddbd6,null));};exports[_0x3aa7('0x6e')]=function(_0x53b126,_0x485609){return db['MailQueue'][_0x3aa7('0x36')]({'where':{'id':_0x53b126[_0x3aa7('0x3a')]['id']}})[_0x3aa7('0x14')](handleEntityNotFound(_0x485609,null))['then'](function(_0x21b3ab){if(_0x21b3ab){return _0x21b3ab['removeAgents'](_0x53b126[_0x3aa7('0x25')]['ids'])['then'](function(){if(_['isArray'](_0x53b126[_0x3aa7('0x25')]['ids'])){for(var _0x4619c7=0x0;_0x4619c7<_0x53b126['query'][_0x3aa7('0x52')][_0x3aa7('0x2c')];_0x4619c7+=0x1){socket['emit'](_0x3aa7('0x70'),{'UserId':Number(_0x53b126[_0x3aa7('0x25')]['ids'][_0x4619c7]),'MailQueueId':Number(_0x53b126['params']['id'])});}}else{socket[_0x3aa7('0x5b')](_0x3aa7('0x70'),{'UserId':Number(_0x53b126[_0x3aa7('0x25')][_0x3aa7('0x52')]),'MailQueueId':Number(_0x53b126[_0x3aa7('0x3a')]['id'])});}});}})[_0x3aa7('0x14')](respondWithStatusCode(_0x485609,null))[_0x3aa7('0x30')](handleError(_0x485609,null));};exports[_0x3aa7('0x73')]=function(_0x314c07,_0x44f92d){var _0x1d73f5={};var _0x36d4ad={};var _0x14f0d3;var _0xdd7317;return db['MailQueue'][_0x3aa7('0x3c')]({'where':{'id':_0x314c07[_0x3aa7('0x3a')]['id']}})[_0x3aa7('0x14')](handleEntityNotFound(_0x44f92d,null))[_0x3aa7('0x14')](function(_0x4cbcef){if(_0x4cbcef){_0x14f0d3=_0x4cbcef;_0x36d4ad[_0x3aa7('0x2a')]=_[_0x3aa7('0x3d')](db['User']['rawAttributes']);_0x36d4ad[_0x3aa7('0x25')]=_[_0x3aa7('0x3d')](_0x314c07[_0x3aa7('0x25')]);_0x36d4ad['filters']=_[_0x3aa7('0x28')](_0x36d4ad['model'],_0x36d4ad[_0x3aa7('0x25')]);_0x1d73f5['attributes']=_[_0x3aa7('0x28')](_0x36d4ad[_0x3aa7('0x2a')],qs['fields'](_0x314c07['query'][_0x3aa7('0x2b')]));_0x1d73f5[_0x3aa7('0x29')]=_0x1d73f5[_0x3aa7('0x29')][_0x3aa7('0x2c')]?_0x1d73f5[_0x3aa7('0x29')]:_0x36d4ad[_0x3aa7('0x2a')];_0x1d73f5[_0x3aa7('0x41')]=qs[_0x3aa7('0x42')](_0x314c07[_0x3aa7('0x25')][_0x3aa7('0x42')]);_0x1d73f5['where']=qs[_0x3aa7('0x27')](_['pick'](_0x314c07[_0x3aa7('0x25')],_0x36d4ad[_0x3aa7('0x27')]));if(_0x314c07[_0x3aa7('0x25')][_0x3aa7('0x44')]){_0x1d73f5[_0x3aa7('0x23')]=_[_0x3aa7('0x2e')](_0x1d73f5[_0x3aa7('0x23')],{'$or':_[_0x3aa7('0x1c')](_0x1d73f5['attributes'],function(_0x5d8236){var _0x10389c={};_0x10389c[_0x5d8236]={'$like':'%'+_0x314c07[_0x3aa7('0x25')][_0x3aa7('0x44')]+'%'};return _0x10389c;})});}_0x1d73f5=_['merge']({},_0x1d73f5,_0x314c07[_0x3aa7('0x2f')]);return _0x14f0d3['getAgents'](_0x1d73f5);}})[_0x3aa7('0x14')](function(_0x531b8b){if(_0x531b8b){_0xdd7317=_0x531b8b[_0x3aa7('0x2c')];if(!_0x314c07['query'][_0x3aa7('0x3f')]('nolimit')){_0x1d73f5[_0x3aa7('0x10')]=qs[_0x3aa7('0x10')](_0x314c07['query'][_0x3aa7('0x10')]);_0x1d73f5['offset']=qs[_0x3aa7('0xe')](_0x314c07[_0x3aa7('0x25')][_0x3aa7('0xe')]);}return _0x14f0d3[_0x3aa7('0x73')](_0x1d73f5);}})[_0x3aa7('0x14')](function(_0x5da6ee){if(_0x5da6ee){return _0x5da6ee?{'count':_0xdd7317,'rows':_0x5da6ee}:null;}})['then'](respondWithResult(_0x44f92d,null))[_0x3aa7('0x30')](handleError(_0x44f92d,null));}; \ No newline at end of file +var _0x935e=['agent','updatedAt','createdAt','%s/%s','SIP','mailPause','filter','getTeams','addTeams','ids','User','online','voicePause','interface','Agents','transaction','each','findOrCreate','emit','userMailQueue:save','Team','field','tq.TeamId','from','team_has_mail_queues','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','toString','sequelize','QueryTypes','SELECT','every','TeamId','includes','compact','value','isEmpty','removeAgents','forEach','userMailQueue:remove','addAgents','omit','spread','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','MailQueues','UserProfileResource','end','error','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','type','key','where','include','query','findAll','rows','catch','show','params','model','keys','filters','intersection','fields','attributes','length','includeAll','merge','options','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','describe','getMembers','findOne','UserMailQueue','hasOwnProperty','nolimit','order','sort','pick','MailQueueId','findAndCountAll','UserId'];(function(_0x571a17,_0x63fb3d){var _0x3ef337=function(_0x12096b){while(--_0x12096b){_0x571a17['push'](_0x571a17['shift']());}};_0x3ef337(++_0x63fb3d);}(_0x935e,0x128));var _0xe935=function(_0x13bb5c,_0x154cab){_0x13bb5c=_0x13bb5c-0x0;var _0x5075db=_0x935e[_0x13bb5c];return _0x5075db;};'use strict';var BPromise=require(_0xe935('0x0'));var util=require(_0xe935('0x1'));var _=require(_0xe935('0x2'));var squel=require(_0xe935('0x3'));var Redis=require(_0xe935('0x4'));var qs=require(_0xe935('0x5'));var logger=require(_0xe935('0x6'))('api');var config=require(_0xe935('0x7'));var db=require('../../mysqldb')['db'];config[_0xe935('0x8')]=_[_0xe935('0x9')](config[_0xe935('0x8')],{'host':_0xe935('0xa'),'port':0x18eb});var socket=require(_0xe935('0xb'))(new Redis(config[_0xe935('0x8')]));require(_0xe935('0xc'))[_0xe935('0xd')](socket);function respondWithStatusCode(_0x519605,_0x40dfb0){_0x40dfb0=_0x40dfb0||0xcc;return function(_0x1dd8d7){if(_0x1dd8d7){return _0x519605[_0xe935('0xe')](_0x40dfb0);}return _0x519605['status'](_0x40dfb0)['end']();};}function respondWithResult(_0x27d588,_0x26e0d3){_0x26e0d3=_0x26e0d3||0xc8;return function(_0xf62790){if(_0xf62790){return _0x27d588[_0xe935('0xf')](_0x26e0d3)[_0xe935('0x10')](_0xf62790);}};}function respondWithFilteredResult(_0x3e4da9,_0x2b3413){return function(_0x357d12){if(_0x357d12){var _0x46f145=typeof _0x2b3413[_0xe935('0x11')]===_0xe935('0x12')&&typeof _0x2b3413[_0xe935('0x13')]===_0xe935('0x12');var _0x31ec7f=_0x357d12[_0xe935('0x14')];var _0x3ccf06=_0x46f145?0x0:_0x2b3413[_0xe935('0x11')];var _0x5bd398=_0x46f145?_0x357d12[_0xe935('0x14')]:_0x2b3413['offset']+_0x2b3413[_0xe935('0x13')];var _0x145e02;if(_0x5bd398>=_0x31ec7f){_0x5bd398=_0x31ec7f;_0x145e02=0xc8;}else{_0x145e02=0xce;}_0x3e4da9[_0xe935('0xf')](_0x145e02);return _0x3e4da9[_0xe935('0x15')](_0xe935('0x16'),_0x3ccf06+'-'+_0x5bd398+'/'+_0x31ec7f)[_0xe935('0x10')](_0x357d12);}return null;};}function saveUpdates(_0x1990fd){return function(_0x548e34){if(_0x548e34){return _0x548e34[_0xe935('0x17')](_0x1990fd)[_0xe935('0x18')](function(_0xcc94fb){return _0xcc94fb;});}return null;};}function removeEntity(_0x26459e){return function(_0x181656){if(_0x181656){return _0x181656['destroy']()[_0xe935('0x18')](function(){var _0x93aa3a=_0x181656['get']({'plain':!![]});var _0x3c5e55=_0xe935('0x19');return db[_0xe935('0x1a')]['destroy']({'where':{'type':_0x3c5e55,'resourceId':_0x93aa3a['id']}})[_0xe935('0x18')](function(){return _0x181656;});})[_0xe935('0x18')](function(){_0x26459e[_0xe935('0xf')](0xcc)[_0xe935('0x1b')]();});}};}function handleEntityNotFound(_0x56b5fc){return function(_0x25d242){if(!_0x25d242){_0x56b5fc[_0xe935('0xe')](0x194);}return _0x25d242;};}function handleError(_0x429a70,_0x19525c){_0x19525c=_0x19525c||0x1f4;return function(_0x5ca0ad){logger[_0xe935('0x1c')](_0x5ca0ad[_0xe935('0x1d')]);if(_0x5ca0ad[_0xe935('0x1e')]){delete _0x5ca0ad[_0xe935('0x1e')];}_0x429a70[_0xe935('0xf')](_0x19525c)[_0xe935('0x1f')](_0x5ca0ad);};}exports[_0xe935('0x20')]=function(_0x579934,_0x3ebbe9){var _0x4ff825={};var _0x34ca2a={'count':0x0,'rows':[]};var _0x4a8c33=_[_0xe935('0x21')](db[_0xe935('0x22')][_0xe935('0x23')],function(_0x41c1a1){return{'name':_0x41c1a1[_0xe935('0x24')],'type':_0x41c1a1[_0xe935('0x25')][_0xe935('0x26')]};});_0x4ff825=qs['getOptions'](_0x4a8c33,_0x579934);var _0x27768d={'where':_0x4ff825[_0xe935('0x27')]};return db[_0xe935('0x22')][_0xe935('0x14')](_0x27768d)[_0xe935('0x18')](function(_0x1ba73c){_0x34ca2a[_0xe935('0x14')]=_0x1ba73c;_0x4ff825[_0xe935('0x28')]=qs[_0xe935('0x28')](_0x579934[_0xe935('0x29')]);return db['MailQueue'][_0xe935('0x2a')](_0x4ff825);})['then'](function(_0x44bbfc){_0x34ca2a[_0xe935('0x2b')]=_0x44bbfc;return _0x34ca2a;})[_0xe935('0x18')](respondWithFilteredResult(_0x3ebbe9,_0x4ff825))[_0xe935('0x2c')](handleError(_0x3ebbe9,null));};exports[_0xe935('0x2d')]=function(_0x5c5148,_0x24b359){var _0x46d808={'raw':!![],'where':{'id':_0x5c5148[_0xe935('0x2e')]['id']}},_0x48fb96={};_0x48fb96[_0xe935('0x2f')]=_[_0xe935('0x30')](db[_0xe935('0x22')][_0xe935('0x23')]);_0x48fb96['query']=_[_0xe935('0x30')](_0x5c5148['query']);_0x48fb96[_0xe935('0x31')]=_[_0xe935('0x32')](_0x48fb96['model'],_0x48fb96[_0xe935('0x29')]);_0x46d808['attributes']=_[_0xe935('0x32')](_0x48fb96['model'],qs['fields'](_0x5c5148[_0xe935('0x29')][_0xe935('0x33')]));_0x46d808[_0xe935('0x34')]=_0x46d808[_0xe935('0x34')][_0xe935('0x35')]?_0x46d808[_0xe935('0x34')]:_0x48fb96['model'];if(_0x5c5148[_0xe935('0x29')][_0xe935('0x36')]){_0x46d808[_0xe935('0x28')]=[{'all':!![]}];}_0x46d808=_[_0xe935('0x37')]({},_0x46d808,_0x5c5148[_0xe935('0x38')]);return db['MailQueue'][_0xe935('0x39')](_0x46d808)[_0xe935('0x18')](handleEntityNotFound(_0x24b359,null))[_0xe935('0x18')](respondWithResult(_0x24b359,null))[_0xe935('0x2c')](handleError(_0x24b359,null));};exports[_0xe935('0x3a')]=function(_0xeb235c,_0x57b99c){return db[_0xe935('0x22')]['create'](_0xeb235c[_0xe935('0x3b')],{})[_0xe935('0x18')](function(_0xfd8e3d){var _0x30beb7=_0xeb235c[_0xe935('0x3c')]['get']({'plain':!![]});if(!_0x30beb7)throw new Error(_0xe935('0x3d'));if(_0x30beb7[_0xe935('0x3e')]===_0xe935('0x3c')){var _0x3182df=_0xfd8e3d[_0xe935('0x3f')]({'plain':!![]});var _0x47b3d0=_0xe935('0x19');return db['UserProfileSection'][_0xe935('0x39')]({'where':{'name':_0x47b3d0,'userProfileId':_0x30beb7[_0xe935('0x40')]},'raw':!![]})[_0xe935('0x18')](function(_0x1e586f){if(_0x1e586f&&_0x1e586f[_0xe935('0x41')]===0x0){return db['UserProfileResource'][_0xe935('0x3a')]({'name':_0x3182df[_0xe935('0x1e')],'resourceId':_0x3182df['id'],'type':_0x1e586f[_0xe935('0x1e')],'sectionId':_0x1e586f['id']},{})[_0xe935('0x18')](function(){return _0xfd8e3d;});}else{return _0xfd8e3d;}})[_0xe935('0x2c')](function(_0x18c8d1){logger[_0xe935('0x1c')](_0xe935('0x42'),_0x18c8d1);throw _0x18c8d1;});}return _0xfd8e3d;})[_0xe935('0x18')](respondWithResult(_0x57b99c,0xc9))[_0xe935('0x2c')](handleError(_0x57b99c,null));};exports[_0xe935('0x17')]=function(_0xbcc6c8,_0x33ae46){if(_0xbcc6c8[_0xe935('0x3b')]['id']){delete _0xbcc6c8['body']['id'];}return db[_0xe935('0x22')][_0xe935('0x39')]({'where':{'id':_0xbcc6c8[_0xe935('0x2e')]['id']}})[_0xe935('0x18')](handleEntityNotFound(_0x33ae46,null))[_0xe935('0x18')](saveUpdates(_0xbcc6c8[_0xe935('0x3b')],null))[_0xe935('0x18')](respondWithResult(_0x33ae46,null))[_0xe935('0x2c')](handleError(_0x33ae46,null));};exports['destroy']=function(_0x33072b,_0x4363be){return db[_0xe935('0x22')][_0xe935('0x39')]({'where':{'id':_0x33072b[_0xe935('0x2e')]['id']}})['then'](handleEntityNotFound(_0x4363be,null))['then'](removeEntity(_0x4363be,null))[_0xe935('0x2c')](handleError(_0x4363be,null));};exports[_0xe935('0x43')]=function(_0x1862bf,_0x23e785){return db[_0xe935('0x22')][_0xe935('0x43')]()[_0xe935('0x18')](respondWithResult(_0x23e785,null))['catch'](handleError(_0x23e785,null));};exports[_0xe935('0x44')]=function(_0x33409a,_0x19ab02){var _0x52ad42={'raw':!![],'where':{}},_0x11db8b={},_0x2c15b3;return db[_0xe935('0x22')][_0xe935('0x45')]({'where':{'id':_0x33409a[_0xe935('0x2e')]['id']}})['then'](handleEntityNotFound(_0x19ab02,null))[_0xe935('0x18')](function(_0x2f8079){if(_0x2f8079){_0x2c15b3=_0x2f8079['get']({'plain':!![]});_0x11db8b[_0xe935('0x2f')]=_['keys'](db[_0xe935('0x46')][_0xe935('0x23')]);_0x11db8b[_0xe935('0x29')]=_['keys'](_0x33409a['query']);_0x11db8b[_0xe935('0x31')]=_[_0xe935('0x32')](_0x11db8b[_0xe935('0x2f')],_0x11db8b[_0xe935('0x29')]);_0x52ad42[_0xe935('0x34')]=_[_0xe935('0x32')](_0x11db8b[_0xe935('0x2f')],qs[_0xe935('0x33')](_0x33409a['query'][_0xe935('0x33')]));_0x52ad42[_0xe935('0x34')]=_0x52ad42[_0xe935('0x34')][_0xe935('0x35')]?_0x52ad42[_0xe935('0x34')]:_0x11db8b[_0xe935('0x2f')];if(!_0x33409a[_0xe935('0x29')][_0xe935('0x47')](_0xe935('0x48'))){_0x52ad42['limit']=qs[_0xe935('0x13')](_0x33409a['query'][_0xe935('0x13')]);_0x52ad42[_0xe935('0x11')]=qs[_0xe935('0x11')](_0x33409a[_0xe935('0x29')][_0xe935('0x11')]);}_0x52ad42[_0xe935('0x49')]=qs[_0xe935('0x4a')](_0x33409a[_0xe935('0x29')][_0xe935('0x4a')]);_0x52ad42[_0xe935('0x27')]=qs[_0xe935('0x31')](_[_0xe935('0x4b')](_0x33409a['query'],_0x11db8b['filters']));_0x52ad42[_0xe935('0x27')][_0xe935('0x4c')]=_0x2f8079['id'];if(_0x33409a[_0xe935('0x29')]['filter']){_0x52ad42[_0xe935('0x27')]=_[_0xe935('0x37')](_0x52ad42['where'],{'$or':_[_0xe935('0x21')](_0x52ad42[_0xe935('0x34')],function(_0x143431){var _0x5e39f5={};_0x5e39f5[_0x143431]={'$like':'%'+_0x33409a[_0xe935('0x29')]['filter']+'%'};return _0x5e39f5;})});}_0x52ad42=_[_0xe935('0x37')]({},_0x52ad42,_0x33409a[_0xe935('0x38')]);return db[_0xe935('0x46')][_0xe935('0x2a')](_0x52ad42);}})[_0xe935('0x18')](function(_0x3f2ad5){if(_0x3f2ad5){return db['User'][_0xe935('0x4d')]({'where':{'id':_[_0xe935('0x21')](_0x3f2ad5,_0xe935('0x4e')),'role':_0xe935('0x4f')},'attributes':['id',_0xe935('0x1e'),'mailPause',_0xe935('0x50'),_0xe935('0x51')]});}})['then'](function(_0x5ef0d0){if(_0x5ef0d0){return{'count':_0x5ef0d0['count'],'rows':_[_0xe935('0x21')](_0x5ef0d0[_0xe935('0x2b')],function(_0x48aa87){return{'membername':_0x48aa87[_0xe935('0x1e')],'UserId':_0x48aa87['id'],'queue_name':_0x2c15b3[_0xe935('0x1e')],'MailQueueId':_0x2c15b3['id'],'interface':util['format'](_0xe935('0x52'),_0xe935('0x53'),_0x48aa87['name']),'penalty':0x0,'paused':_0x48aa87[_0xe935('0x54')],'createdAt':_0x48aa87[_0xe935('0x51')],'updatedAt':_0x48aa87[_0xe935('0x50')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x19ab02,_0x52ad42))[_0xe935('0x2c')](handleError(_0x19ab02,null));};exports['getTeams']=function(_0x364b08,_0x8b78cf){var _0xc22337={};var _0x363973={};var _0x3b54a0;var _0x612b91;return db['MailQueue']['findOne']({'where':{'id':_0x364b08[_0xe935('0x2e')]['id']}})[_0xe935('0x18')](handleEntityNotFound(_0x8b78cf,null))[_0xe935('0x18')](function(_0x162fbf){if(_0x162fbf){_0x3b54a0=_0x162fbf;_0x363973[_0xe935('0x2f')]=_['keys'](db['Team']['rawAttributes']);_0x363973['query']=_[_0xe935('0x30')](_0x364b08[_0xe935('0x29')]);_0x363973['filters']=_['intersection'](_0x363973['model'],_0x363973['query']);_0xc22337[_0xe935('0x34')]=_[_0xe935('0x32')](_0x363973['model'],qs[_0xe935('0x33')](_0x364b08[_0xe935('0x29')][_0xe935('0x33')]));_0xc22337[_0xe935('0x34')]=_0xc22337[_0xe935('0x34')][_0xe935('0x35')]?_0xc22337[_0xe935('0x34')]:_0x363973[_0xe935('0x2f')];_0xc22337[_0xe935('0x49')]=qs[_0xe935('0x4a')](_0x364b08[_0xe935('0x29')][_0xe935('0x4a')]);_0xc22337[_0xe935('0x27')]=qs['filters'](_[_0xe935('0x4b')](_0x364b08[_0xe935('0x29')],_0x363973[_0xe935('0x31')]));if(_0x364b08[_0xe935('0x29')][_0xe935('0x55')]){_0xc22337[_0xe935('0x27')]=_[_0xe935('0x37')](_0xc22337[_0xe935('0x27')],{'$or':_[_0xe935('0x21')](_0xc22337['attributes'],function(_0x10b488){var _0x54b656={};_0x54b656[_0x10b488]={'$like':'%'+_0x364b08[_0xe935('0x29')][_0xe935('0x55')]+'%'};return _0x54b656;})});}_0xc22337=_[_0xe935('0x37')]({},_0xc22337,_0x364b08['options']);return _0x3b54a0['getTeams'](_0xc22337);}})[_0xe935('0x18')](function(_0x4bfc67){if(_0x4bfc67){_0x612b91=_0x4bfc67['length'];if(!_0x364b08['query'][_0xe935('0x47')](_0xe935('0x48'))){_0xc22337['limit']=qs['limit'](_0x364b08['query'][_0xe935('0x13')]);_0xc22337[_0xe935('0x11')]=qs[_0xe935('0x11')](_0x364b08['query'][_0xe935('0x11')]);}return _0x3b54a0[_0xe935('0x56')](_0xc22337);}})[_0xe935('0x18')](function(_0x3ba190){if(_0x3ba190){return _0x3ba190?{'count':_0x612b91,'rows':_0x3ba190}:null;}})['then'](respondWithResult(_0x8b78cf,null))[_0xe935('0x2c')](handleError(_0x8b78cf,null));};exports[_0xe935('0x57')]=function(_0x2b01f0,_0x4ff9f5){var _0x305490=_0x2b01f0[_0xe935('0x3b')][_0xe935('0x58')];return db['Team']['findAll']({'where':{'id':_0x305490},'attributes':['id'],'include':[{'model':db[_0xe935('0x59')],'as':'Agents','attributes':['id',_0xe935('0x1e'),_0xe935('0x5a'),_0xe935('0x5b'),_0xe935('0x5c')],'raw':!![]}]})[_0xe935('0x18')](function(_0x496d10){if(_0x496d10){var _0x169e6f=_['flatMap'](_0x496d10,function(_0x4b0fec){var _0x451bcd=_0x4b0fec[_0xe935('0x3f')]({'plain':!![]});return _0x451bcd[_0xe935('0x5d')];});return db[_0xe935('0x22')][_0xe935('0x39')]({'where':{'id':_0x2b01f0[_0xe935('0x2e')]['id']}})['then'](function(_0x45b6b5){return db['sequelize'][_0xe935('0x5e')](function(_0xf52d02){return _0x45b6b5[_0xe935('0x57')](_0x305490,{'transaction':_0xf52d02})['then'](function(){return BPromise[_0xe935('0x5f')](_0x169e6f,function(_0x5ba771){return db['UserMailQueue'][_0xe935('0x60')]({'where':{'UserId':_0x5ba771['id'],'MailQueueId':_0x2b01f0[_0xe935('0x2e')]['id']},'transaction':_0xf52d02});});})[_0xe935('0x18')](function(){_0x169e6f['forEach'](function(_0x11b7cb){socket[_0xe935('0x61')](_0xe935('0x62'),{'UserId':_0x11b7cb['id'],'MailQueueId':_0x45b6b5['id']});});});});});}})['then'](respondWithStatusCode(_0x4ff9f5,null))['catch'](handleError(_0x4ff9f5,null));};exports['removeTeams']=function(_0x1be297,_0x14f6bc){return db[_0xe935('0x63')]['findAll']({'where':{'id':_0x1be297[_0xe935('0x29')][_0xe935('0x58')]},'attributes':['id'],'include':[{'model':db[_0xe935('0x59')],'as':_0xe935('0x5d'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x14f6bc,null))[_0xe935('0x18')](function(_0x5d73f0){var _0x4c6ef2=_['map'](_0x5d73f0,'id');var _0xc5fe8d=[];var _0x571d96=[];var _0x3a7d8f=squel['select']();_0x3a7d8f[_0xe935('0x64')](_0xe935('0x65'))[_0xe935('0x66')](_0xe935('0x67'),'tq')[_0xe935('0x68')]('user_has_teams','ut',_0xe935('0x69'))[_0xe935('0x27')](_0xe935('0x6a'),_0x1be297['params']['id']);for(var _0x21be60=0x0;_0x21be60<_0x5d73f0['length'];_0x21be60+=0x1){let _0x4f47da=_0x5d73f0[_0x21be60];for(var _0x30a67e=0x0;_0x30a67e<_0x4f47da[_0xe935('0x5d')][_0xe935('0x35')];_0x30a67e+=0x1){let _0x55fe45=_0x4f47da[_0xe935('0x5d')][_0x30a67e];var _0x2df366=_0x3a7d8f[_0xe935('0x6b')]();_0x2df366['where']('ut.UserId\x20=\x20?',_0x55fe45['id']);_0x571d96['push'](db['sequelize']['query'](_0x2df366[_0xe935('0x6c')](),{'type':db[_0xe935('0x6d')][_0xe935('0x6e')][_0xe935('0x6f')]})[_0xe935('0x18')](function(_0x4f414c){if(_0x4f414c[_0xe935('0x35')]===0x1){return _0x55fe45['id'];}else{var _0x14f1a5=_[_0xe935('0x70')](_[_0xe935('0x21')](_0x4f414c,_0xe935('0x71')),function(_0x2f0980){return _[_0xe935('0x72')](_0x4c6ef2,_0x2f0980);});if(_0x14f1a5){return _0x55fe45['id'];}}}));}}return BPromise['all'](_0x571d96)['then'](function(_0x122dff){_0xc5fe8d=_(_0xc5fe8d)['union'](_0x122dff)[_0xe935('0x73')]()[_0xe935('0x74')]();return db[_0xe935('0x22')][_0xe935('0x39')]({'where':{'id':_0x1be297[_0xe935('0x2e')]['id']}})[_0xe935('0x18')](function(_0x5309f2){return db[_0xe935('0x6d')]['transaction'](function(_0x2078a9){return _0x5309f2['removeTeams'](_0x1be297['query']['ids'],{'transaction':_0x2078a9})[_0xe935('0x18')](function(){if(!_[_0xe935('0x75')](_0xc5fe8d)){return _0x5309f2[_0xe935('0x76')](_0xc5fe8d,{'transaction':_0x2078a9});}})[_0xe935('0x18')](function(){_0xc5fe8d[_0xe935('0x77')](function(_0x4af08b){socket[_0xe935('0x61')](_0xe935('0x78'),{'UserId':_0x4af08b,'MailQueueId':_0x5309f2['id']});});});});});});})[_0xe935('0x18')](respondWithStatusCode(_0x14f6bc,null))[_0xe935('0x2c')](handleError(_0x14f6bc,null));};exports[_0xe935('0x79')]=function(_0x2c54b1,_0x10f9c4){return db[_0xe935('0x22')][_0xe935('0x39')]({'where':{'id':_0x2c54b1['params']['id']}})[_0xe935('0x18')](handleEntityNotFound(_0x10f9c4,null))['then'](function(_0x37c3c5){if(_0x37c3c5){return _0x37c3c5[_0xe935('0x79')](_0x2c54b1['body'][_0xe935('0x58')],_[_0xe935('0x7a')](_0x2c54b1[_0xe935('0x3b')],[_0xe935('0x58'),'id'])||{})[_0xe935('0x7b')](function(_0x106dbf){for(var _0x11a20b=0x0;_0x11a20b<_0x2c54b1[_0xe935('0x3b')][_0xe935('0x58')][_0xe935('0x35')];_0x11a20b+=0x1){socket['emit'](_0xe935('0x62'),{'UserId':Number(_0x2c54b1[_0xe935('0x3b')][_0xe935('0x58')][_0x11a20b]),'MailQueueId':Number(_0x2c54b1[_0xe935('0x2e')]['id'])});}return _0x106dbf;});}})[_0xe935('0x18')](respondWithResult(_0x10f9c4,null))[_0xe935('0x2c')](handleError(_0x10f9c4,null));};exports[_0xe935('0x76')]=function(_0x343dc4,_0x2f8aca){return db['MailQueue'][_0xe935('0x39')]({'where':{'id':_0x343dc4['params']['id']}})[_0xe935('0x18')](handleEntityNotFound(_0x2f8aca,null))[_0xe935('0x18')](function(_0x53168c){if(_0x53168c){return _0x53168c[_0xe935('0x76')](_0x343dc4[_0xe935('0x29')][_0xe935('0x58')])[_0xe935('0x18')](function(){if(_['isArray'](_0x343dc4[_0xe935('0x29')]['ids'])){for(var _0x445609=0x0;_0x445609<_0x343dc4[_0xe935('0x29')][_0xe935('0x58')][_0xe935('0x35')];_0x445609+=0x1){socket['emit']('userMailQueue:remove',{'UserId':Number(_0x343dc4[_0xe935('0x29')][_0xe935('0x58')][_0x445609]),'MailQueueId':Number(_0x343dc4[_0xe935('0x2e')]['id'])});}}else{socket[_0xe935('0x61')](_0xe935('0x78'),{'UserId':Number(_0x343dc4[_0xe935('0x29')][_0xe935('0x58')]),'MailQueueId':Number(_0x343dc4['params']['id'])});}});}})[_0xe935('0x18')](respondWithStatusCode(_0x2f8aca,null))[_0xe935('0x2c')](handleError(_0x2f8aca,null));};exports[_0xe935('0x7c')]=function(_0x441e6b,_0x193254){var _0x4930a1={};var _0x32be5a={};var _0x35b2fa;var _0x47a469;return db['MailQueue']['findOne']({'where':{'id':_0x441e6b[_0xe935('0x2e')]['id']}})[_0xe935('0x18')](handleEntityNotFound(_0x193254,null))[_0xe935('0x18')](function(_0x1f598c){if(_0x1f598c){_0x35b2fa=_0x1f598c;_0x32be5a[_0xe935('0x2f')]=_[_0xe935('0x30')](db['User'][_0xe935('0x23')]);_0x32be5a[_0xe935('0x29')]=_['keys'](_0x441e6b[_0xe935('0x29')]);_0x32be5a[_0xe935('0x31')]=_[_0xe935('0x32')](_0x32be5a[_0xe935('0x2f')],_0x32be5a[_0xe935('0x29')]);_0x4930a1[_0xe935('0x34')]=_[_0xe935('0x32')](_0x32be5a[_0xe935('0x2f')],qs[_0xe935('0x33')](_0x441e6b[_0xe935('0x29')][_0xe935('0x33')]));_0x4930a1[_0xe935('0x34')]=_0x4930a1[_0xe935('0x34')]['length']?_0x4930a1[_0xe935('0x34')]:_0x32be5a[_0xe935('0x2f')];_0x4930a1[_0xe935('0x49')]=qs['sort'](_0x441e6b['query']['sort']);_0x4930a1[_0xe935('0x27')]=qs[_0xe935('0x31')](_['pick'](_0x441e6b[_0xe935('0x29')],_0x32be5a[_0xe935('0x31')]));if(_0x441e6b[_0xe935('0x29')][_0xe935('0x55')]){_0x4930a1[_0xe935('0x27')]=_[_0xe935('0x37')](_0x4930a1['where'],{'$or':_[_0xe935('0x21')](_0x4930a1[_0xe935('0x34')],function(_0x3f7a5f){var _0x2f95ab={};_0x2f95ab[_0x3f7a5f]={'$like':'%'+_0x441e6b[_0xe935('0x29')][_0xe935('0x55')]+'%'};return _0x2f95ab;})});}_0x4930a1=_[_0xe935('0x37')]({},_0x4930a1,_0x441e6b['options']);return _0x35b2fa[_0xe935('0x7c')](_0x4930a1);}})[_0xe935('0x18')](function(_0x25c1e1){if(_0x25c1e1){_0x47a469=_0x25c1e1[_0xe935('0x35')];if(!_0x441e6b[_0xe935('0x29')][_0xe935('0x47')]('nolimit')){_0x4930a1[_0xe935('0x13')]=qs[_0xe935('0x13')](_0x441e6b[_0xe935('0x29')][_0xe935('0x13')]);_0x4930a1['offset']=qs[_0xe935('0x11')](_0x441e6b[_0xe935('0x29')]['offset']);}return _0x35b2fa[_0xe935('0x7c')](_0x4930a1);}})['then'](function(_0x2e4704){if(_0x2e4704){return _0x2e4704?{'count':_0x47a469,'rows':_0x2e4704}:null;}})[_0xe935('0x18')](respondWithResult(_0x193254,null))[_0xe935('0x2c')](handleError(_0x193254,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index caefcf6..b4d516a 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 _0x0a68=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailQueue','setMaxListeners','save','update'];(function(_0x5674fc,_0x2b623b){var _0x2444a5=function(_0x19774c){while(--_0x19774c){_0x5674fc['push'](_0x5674fc['shift']());}};_0x2444a5(++_0x2b623b);}(_0x0a68,0x112));var _0x80a6=function(_0x3fb365,_0x5aa992){_0x3fb365=_0x3fb365-0x0;var _0x14fe71=_0x0a68[_0x3fb365];return _0x14fe71;};'use strict';var EventEmitter=require(_0x80a6('0x0'));var MailQueue=require(_0x80a6('0x1'))['db'][_0x80a6('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x80a6('0x3')](0x0);var events={'afterCreate':_0x80a6('0x4'),'afterUpdate':_0x80a6('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4f0f71){return function(_0x4e9248,_0x5df718,_0x5373ac){MailQueueEvents[_0x80a6('0x6')](_0x4f0f71+':'+_0x4e9248['id'],_0x4e9248);MailQueueEvents[_0x80a6('0x6')](_0x4f0f71,_0x4e9248);_0x5373ac(null);};}for(var e in events){if(events[_0x80a6('0x7')](e)){var event=events[e];MailQueue[_0x80a6('0x8')](e,emitEvent(event));}}module[_0x80a6('0x9')]=MailQueueEvents; \ No newline at end of file +var _0x5269=['setMaxListeners','save','update','remove','hasOwnProperty','hook','exports','events','MailQueue'];(function(_0x14892c,_0x5891e4){var _0x1eb94a=function(_0x3b4266){while(--_0x3b4266){_0x14892c['push'](_0x14892c['shift']());}};_0x1eb94a(++_0x5891e4);}(_0x5269,0x127));var _0x9526=function(_0x27209c,_0x4b1678){_0x27209c=_0x27209c-0x0;var _0xcba5ac=_0x5269[_0x27209c];return _0xcba5ac;};'use strict';var EventEmitter=require(_0x9526('0x0'));var MailQueue=require('../../mysqldb')['db'][_0x9526('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x9526('0x2')](0x0);var events={'afterCreate':_0x9526('0x3'),'afterUpdate':_0x9526('0x4'),'afterDestroy':_0x9526('0x5')};function emitEvent(_0xb6cfe){return function(_0x5751e0,_0x246952,_0x1e8f73){MailQueueEvents['emit'](_0xb6cfe+':'+_0x5751e0['id'],_0x5751e0);MailQueueEvents['emit'](_0xb6cfe,_0x5751e0);_0x1e8f73(null);};}for(var e in events){if(events[_0x9526('0x6')](e)){var event=events[e];MailQueue[_0x9526('0x7')](e,emitEvent(event));}}module[_0x9526('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 328cf84..677b6fe 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 _0xe955=['../../config/environment','./mailQueue.attributes','MailQueue','mail_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xda0909,_0x1e6466){var _0x1bb656=function(_0x3c63b8){while(--_0x3c63b8){_0xda0909['push'](_0xda0909['shift']());}};_0x1bb656(++_0x1e6466);}(_0xe955,0x130));var _0x5e95=function(_0x3f5167,_0x2456ab){_0x3f5167=_0x3f5167-0x0;var _0x33e4af=_0xe955[_0x3f5167];return _0x33e4af;};'use strict';var _=require(_0x5e95('0x0'));var util=require(_0x5e95('0x1'));var logger=require('../../config/logger')(_0x5e95('0x2'));var moment=require(_0x5e95('0x3'));var BPromise=require(_0x5e95('0x4'));var rp=require(_0x5e95('0x5'));var fs=require('fs');var path=require(_0x5e95('0x6'));var rimraf=require(_0x5e95('0x7'));var config=require(_0x5e95('0x8'));var attributes=require(_0x5e95('0x9'));module['exports']=function(_0x4f241f,_0x2d6e2d){return _0x4f241f['define'](_0x5e95('0xa'),attributes,{'tableName':_0x5e95('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1cb6=['lodash','util','api','moment','bluebird','rimraf','../../config/environment','./mailQueue.attributes','exports','define','MailQueue','mail_queues'];(function(_0x1db498,_0x4589c4){var _0x5a171f=function(_0x24dd12){while(--_0x24dd12){_0x1db498['push'](_0x1db498['shift']());}};_0x5a171f(++_0x4589c4);}(_0x1cb6,0x1e0));var _0x61cb=function(_0x4c008f,_0x3c0d7f){_0x4c008f=_0x4c008f-0x0;var _0x3f6da2=_0x1cb6[_0x4c008f];return _0x3f6da2;};'use strict';var _=require(_0x61cb('0x0'));var util=require(_0x61cb('0x1'));var logger=require('../../config/logger')(_0x61cb('0x2'));var moment=require(_0x61cb('0x3'));var BPromise=require(_0x61cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x61cb('0x5'));var config=require(_0x61cb('0x6'));var attributes=require(_0x61cb('0x7'));module[_0x61cb('0x8')]=function(_0x5e9136,_0x3fdd01){return _0x5e9136[_0x61cb('0x9')](_0x61cb('0xa'),attributes,{'tableName':_0x61cb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index d94e0bf..206e089 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 _0x3fb7=['then','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetMailQueue','MailQueue','findAll','options','raw','attributes','limit','include','map','model','info','find','where','ShowMailQueue','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','request'];(function(_0x5580ca,_0x48fbd2){var _0x4012db=function(_0x2366ce){while(--_0x2366ce){_0x5580ca['push'](_0x5580ca['shift']());}};_0x4012db(++_0x48fbd2);}(_0x3fb7,0x189));var _0x73fb=function(_0x1903bb,_0x5723a5){_0x1903bb=_0x1903bb-0x0;var _0x529098=_0x3fb7[_0x1903bb];return _0x529098;};'use strict';var _=require('lodash');var util=require(_0x73fb('0x0'));var moment=require('moment');var BPromise=require(_0x73fb('0x1'));var rs=require(_0x73fb('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x73fb('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x73fb('0x4'))(_0x73fb('0x5'));var config=require(_0x73fb('0x6'));var jayson=require(_0x73fb('0x7'));var client=jayson[_0x73fb('0x8')][_0x73fb('0x9')]({'port':0x232a});config[_0x73fb('0xa')]=_[_0x73fb('0xb')](config[_0x73fb('0xa')],{'host':_0x73fb('0xc'),'port':0x18eb});var socket=require(_0x73fb('0xd'))(new Redis(config[_0x73fb('0xa')]));require(_0x73fb('0xe'))[_0x73fb('0xf')](socket);function respondWithRpcPromise(_0x435d63,_0x419445,_0x3652cd){return new BPromise(function(_0x1052e1,_0x1fbaf1){return client[_0x73fb('0x10')](_0x435d63,_0x3652cd)[_0x73fb('0x11')](function(_0x52d74e){logger['info'](_0x73fb('0x12'),_0x419445,'request\x20sent');logger[_0x73fb('0x13')](_0x73fb('0x14'),_0x419445,_0x73fb('0x15'),JSON[_0x73fb('0x16')](_0x52d74e));if(_0x52d74e[_0x73fb('0x17')]){if(_0x52d74e[_0x73fb('0x17')][_0x73fb('0x18')]===0x1f4){logger[_0x73fb('0x17')](_0x73fb('0x12'),_0x419445,_0x52d74e[_0x73fb('0x17')][_0x73fb('0x19')]);return _0x1fbaf1(_0x52d74e[_0x73fb('0x17')][_0x73fb('0x19')]);}logger['error'](_0x73fb('0x12'),_0x419445,_0x52d74e['error']['message']);return _0x1052e1(_0x52d74e[_0x73fb('0x17')][_0x73fb('0x19')]);}else{logger['info'](_0x73fb('0x12'),_0x419445,_0x73fb('0x15'));_0x1052e1(_0x52d74e[_0x73fb('0x1a')][_0x73fb('0x19')]);}})['catch'](function(_0x518d53){logger[_0x73fb('0x17')](_0x73fb('0x12'),_0x419445,_0x518d53);_0x1fbaf1(_0x518d53);});});}exports[_0x73fb('0x1b')]=function(_0x5da53c){var _0x2de79f=this;return new Promise(function(_0x667a79,_0x25b409){return db[_0x73fb('0x1c')][_0x73fb('0x1d')]({'raw':_0x5da53c[_0x73fb('0x1e')]?_0x5da53c['options'][_0x73fb('0x1f')]===undefined?!![]:![]:!![],'where':_0x5da53c[_0x73fb('0x1e')]?_0x5da53c[_0x73fb('0x1e')]['where']||null:null,'attributes':_0x5da53c['options']?_0x5da53c[_0x73fb('0x1e')][_0x73fb('0x20')]||null:null,'limit':_0x5da53c['options']?_0x5da53c[_0x73fb('0x1e')][_0x73fb('0x21')]||null:null,'include':_0x5da53c[_0x73fb('0x1e')]?_0x5da53c[_0x73fb('0x1e')][_0x73fb('0x22')]?_[_0x73fb('0x23')](_0x5da53c[_0x73fb('0x1e')][_0x73fb('0x22')],function(_0x3d213f){return{'model':db[_0x3d213f['model']],'as':_0x3d213f['as'],'attributes':_0x3d213f['attributes'],'include':_0x3d213f[_0x73fb('0x22')]?_[_0x73fb('0x23')](_0x3d213f[_0x73fb('0x22')],function(_0x302bdb){return{'model':db[_0x302bdb[_0x73fb('0x24')]],'as':_0x302bdb['as'],'attributes':_0x302bdb[_0x73fb('0x20')],'include':_0x302bdb[_0x73fb('0x22')]?_['map'](_0x302bdb[_0x73fb('0x22')],function(_0x281449){return{'model':db[_0x281449[_0x73fb('0x24')]],'as':_0x281449['as'],'attributes':_0x281449[_0x73fb('0x20')]};}):[]};}):[]};}):[]:[]})[_0x73fb('0x11')](function(_0xc3894e){logger[_0x73fb('0x25')](_0x73fb('0x1b'),_0x5da53c);logger['debug'](_0x73fb('0x1b'),_0x5da53c,JSON[_0x73fb('0x16')](_0xc3894e));_0x667a79(_0xc3894e);})['catch'](function(_0x4ae16f){logger[_0x73fb('0x17')](_0x73fb('0x1b'),_0x4ae16f[_0x73fb('0x19')],_0x5da53c);_0x25b409(_0x2de79f[_0x73fb('0x17')](0x1f4,_0x4ae16f[_0x73fb('0x19')]));});});};exports['ShowMailQueue']=function(_0x87c631){var _0x1b9797=this;return new Promise(function(_0xf396df,_0x3bccbb){return db[_0x73fb('0x1c')][_0x73fb('0x26')]({'raw':_0x87c631[_0x73fb('0x1e')]?_0x87c631[_0x73fb('0x1e')][_0x73fb('0x1f')]===undefined?!![]:![]:!![],'where':_0x87c631[_0x73fb('0x1e')]?_0x87c631['options'][_0x73fb('0x27')]||null:null,'attributes':_0x87c631[_0x73fb('0x1e')]?_0x87c631[_0x73fb('0x1e')][_0x73fb('0x20')]||null:null,'include':_0x87c631[_0x73fb('0x1e')]?_0x87c631['options'][_0x73fb('0x22')]?_[_0x73fb('0x23')](_0x87c631['options'][_0x73fb('0x22')],function(_0x512db5){return{'model':db[_0x512db5[_0x73fb('0x24')]],'as':_0x512db5['as'],'attributes':_0x512db5['attributes'],'include':_0x512db5['include']?_[_0x73fb('0x23')](_0x512db5[_0x73fb('0x22')],function(_0x2f29c8){return{'model':db[_0x2f29c8['model']],'as':_0x2f29c8['as'],'attributes':_0x2f29c8[_0x73fb('0x20')],'include':_0x2f29c8[_0x73fb('0x22')]?_[_0x73fb('0x23')](_0x2f29c8[_0x73fb('0x22')],function(_0x3901a9){return{'model':db[_0x3901a9[_0x73fb('0x24')]],'as':_0x3901a9['as'],'attributes':_0x3901a9['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x219eea){logger[_0x73fb('0x25')](_0x73fb('0x28'),_0x87c631);logger[_0x73fb('0x13')](_0x73fb('0x28'),_0x87c631,JSON[_0x73fb('0x16')](_0x219eea));_0xf396df(_0x219eea);})['catch'](function(_0x33a3b3){logger['error'](_0x73fb('0x28'),_0x33a3b3[_0x73fb('0x19')],_0x87c631);_0x3bccbb(_0x1b9797[_0x73fb('0x17')](0x1f4,_0x33a3b3['message']));});});}; \ No newline at end of file +var _0x2617=['localhost','socket.io-emitter','./mailQueue.socket','register','request','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','code','error','message','info','request\x20sent','result','catch','GetMailQueue','MailQueue','options','raw','attributes','limit','include','map','model','stringify','ShowMailQueue','find','where','then','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x2617,0x175));var _0x7261=function(_0x5a774b,_0x4242c4){_0x5a774b=_0x5a774b-0x0;var _0xc329b4=_0x2617[_0x5a774b];return _0xc329b4;};'use strict';var _=require(_0x7261('0x0'));var util=require('util');var moment=require(_0x7261('0x1'));var BPromise=require(_0x7261('0x2'));var rs=require(_0x7261('0x3'));var fs=require('fs');var Redis=require(_0x7261('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7261('0x5'));var logger=require(_0x7261('0x6'))(_0x7261('0x7'));var config=require(_0x7261('0x8'));var jayson=require(_0x7261('0x9'));var client=jayson[_0x7261('0xa')][_0x7261('0xb')]({'port':0x232a});config['redis']=_[_0x7261('0xc')](config[_0x7261('0xd')],{'host':_0x7261('0xe'),'port':0x18eb});var socket=require(_0x7261('0xf'))(new Redis(config['redis']));require(_0x7261('0x10'))[_0x7261('0x11')](socket);function respondWithRpcPromise(_0x363fcb,_0x377c7c,_0x33b24f){return new BPromise(function(_0x5f125f,_0x5a49f4){return client[_0x7261('0x12')](_0x363fcb,_0x33b24f)['then'](function(_0x41b193){logger['info'](_0x7261('0x13'),_0x377c7c,'request\x20sent');logger[_0x7261('0x14')](_0x7261('0x15'),_0x377c7c,'request\x20sent',JSON['stringify'](_0x41b193));if(_0x41b193['error']){if(_0x41b193['error'][_0x7261('0x16')]===0x1f4){logger['error'](_0x7261('0x13'),_0x377c7c,_0x41b193[_0x7261('0x17')][_0x7261('0x18')]);return _0x5a49f4(_0x41b193['error'][_0x7261('0x18')]);}logger[_0x7261('0x17')](_0x7261('0x13'),_0x377c7c,_0x41b193[_0x7261('0x17')][_0x7261('0x18')]);return _0x5f125f(_0x41b193[_0x7261('0x17')][_0x7261('0x18')]);}else{logger[_0x7261('0x19')]('MailQueue,\x20%s,\x20%s',_0x377c7c,_0x7261('0x1a'));_0x5f125f(_0x41b193[_0x7261('0x1b')]['message']);}})[_0x7261('0x1c')](function(_0x346a60){logger[_0x7261('0x17')](_0x7261('0x13'),_0x377c7c,_0x346a60);_0x5a49f4(_0x346a60);});});}exports[_0x7261('0x1d')]=function(_0x62e9d5){var _0x1ca019=this;return new Promise(function(_0x10f4f1,_0x250fb4){return db[_0x7261('0x1e')]['findAll']({'raw':_0x62e9d5[_0x7261('0x1f')]?_0x62e9d5['options'][_0x7261('0x20')]===undefined?!![]:![]:!![],'where':_0x62e9d5[_0x7261('0x1f')]?_0x62e9d5[_0x7261('0x1f')]['where']||null:null,'attributes':_0x62e9d5[_0x7261('0x1f')]?_0x62e9d5[_0x7261('0x1f')][_0x7261('0x21')]||null:null,'limit':_0x62e9d5['options']?_0x62e9d5[_0x7261('0x1f')][_0x7261('0x22')]||null:null,'include':_0x62e9d5[_0x7261('0x1f')]?_0x62e9d5[_0x7261('0x1f')][_0x7261('0x23')]?_[_0x7261('0x24')](_0x62e9d5['options'][_0x7261('0x23')],function(_0xc29d4c){return{'model':db[_0xc29d4c[_0x7261('0x25')]],'as':_0xc29d4c['as'],'attributes':_0xc29d4c[_0x7261('0x21')],'include':_0xc29d4c[_0x7261('0x23')]?_[_0x7261('0x24')](_0xc29d4c['include'],function(_0x441ca7){return{'model':db[_0x441ca7[_0x7261('0x25')]],'as':_0x441ca7['as'],'attributes':_0x441ca7['attributes'],'include':_0x441ca7[_0x7261('0x23')]?_[_0x7261('0x24')](_0x441ca7[_0x7261('0x23')],function(_0x2fba28){return{'model':db[_0x2fba28[_0x7261('0x25')]],'as':_0x2fba28['as'],'attributes':_0x2fba28[_0x7261('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x197ff3){logger[_0x7261('0x19')](_0x7261('0x1d'),_0x62e9d5);logger[_0x7261('0x14')](_0x7261('0x1d'),_0x62e9d5,JSON[_0x7261('0x26')](_0x197ff3));_0x10f4f1(_0x197ff3);})[_0x7261('0x1c')](function(_0x2b3169){logger[_0x7261('0x17')](_0x7261('0x1d'),_0x2b3169[_0x7261('0x18')],_0x62e9d5);_0x250fb4(_0x1ca019[_0x7261('0x17')](0x1f4,_0x2b3169['message']));});});};exports[_0x7261('0x27')]=function(_0x164693){var _0x194074=this;return new Promise(function(_0x20464c,_0x115a34){return db['MailQueue'][_0x7261('0x28')]({'raw':_0x164693['options']?_0x164693[_0x7261('0x1f')][_0x7261('0x20')]===undefined?!![]:![]:!![],'where':_0x164693['options']?_0x164693[_0x7261('0x1f')][_0x7261('0x29')]||null:null,'attributes':_0x164693[_0x7261('0x1f')]?_0x164693['options'][_0x7261('0x21')]||null:null,'include':_0x164693[_0x7261('0x1f')]?_0x164693['options'][_0x7261('0x23')]?_['map'](_0x164693[_0x7261('0x1f')]['include'],function(_0x113e9a){return{'model':db[_0x113e9a[_0x7261('0x25')]],'as':_0x113e9a['as'],'attributes':_0x113e9a[_0x7261('0x21')],'include':_0x113e9a[_0x7261('0x23')]?_['map'](_0x113e9a['include'],function(_0x530211){return{'model':db[_0x530211['model']],'as':_0x530211['as'],'attributes':_0x530211[_0x7261('0x21')],'include':_0x530211[_0x7261('0x23')]?_[_0x7261('0x24')](_0x530211[_0x7261('0x23')],function(_0x548a1a){return{'model':db[_0x548a1a[_0x7261('0x25')]],'as':_0x548a1a['as'],'attributes':_0x548a1a[_0x7261('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7261('0x2a')](function(_0x13e7ed){logger[_0x7261('0x19')](_0x7261('0x27'),_0x164693);logger[_0x7261('0x14')](_0x7261('0x27'),_0x164693,JSON[_0x7261('0x26')](_0x13e7ed));_0x20464c(_0x13e7ed);})[_0x7261('0x1c')](function(_0x4a7c1e){logger['error']('ShowMailQueue',_0x4a7c1e[_0x7261('0x18')],_0x164693);_0x115a34(_0x194074['error'](0x1f4,_0x4a7c1e['message']));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 6424b84..181a82c 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 _0xb0ca=['removeListener','register','./mailQueue.events','update'];(function(_0x2ec5b9,_0x56e0a3){var _0x10dcea=function(_0x1d403d){while(--_0x1d403d){_0x2ec5b9['push'](_0x2ec5b9['shift']());}};_0x10dcea(++_0x56e0a3);}(_0xb0ca,0x72));var _0xab0c=function(_0x1694f3,_0x58d6ba){_0x1694f3=_0x1694f3-0x0;var _0x27372c=_0xb0ca[_0x1694f3];return _0x27372c;};'use strict';var MailQueueEvents=require(_0xab0c('0x0'));var events=['save','remove',_0xab0c('0x1')];function createListener(_0x34030b,_0x1c38c0){return function(_0x33188c){_0x1c38c0['emit'](_0x34030b,_0x33188c);};}function removeListener(_0x5b140a,_0x3077a3){return function(){MailQueueEvents[_0xab0c('0x2')](_0x5b140a,_0x3077a3);};}exports[_0xab0c('0x3')]=function(_0x56de77){for(var _0x33b5b7=0x0,_0x1ed468=events['length'];_0x33b5b7<_0x1ed468;_0x33b5b7++){var _0x32f979=events[_0x33b5b7];var _0x13137b=createListener('mailQueue:'+_0x32f979,_0x56de77);MailQueueEvents['on'](_0x32f979,_0x13137b);}}; \ No newline at end of file +var _0xac99=['./mailQueue.events','save','remove','update','removeListener','register','length','mailQueue:'];(function(_0x584580,_0x3070fd){var _0x5e6cf7=function(_0x21a5ec){while(--_0x21a5ec){_0x584580['push'](_0x584580['shift']());}};_0x5e6cf7(++_0x3070fd);}(_0xac99,0x108));var _0x9ac9=function(_0x2373f5,_0x55fbde){_0x2373f5=_0x2373f5-0x0;var _0x31cf35=_0xac99[_0x2373f5];return _0x31cf35;};'use strict';var MailQueueEvents=require(_0x9ac9('0x0'));var events=[_0x9ac9('0x1'),_0x9ac9('0x2'),_0x9ac9('0x3')];function createListener(_0x54bdca,_0x1e56b6){return function(_0x50f457){_0x1e56b6['emit'](_0x54bdca,_0x50f457);};}function removeListener(_0x4f997a,_0x4103e2){return function(){MailQueueEvents[_0x9ac9('0x4')](_0x4f997a,_0x4103e2);};}exports[_0x9ac9('0x5')]=function(_0x51cc3c){for(var _0x51b31e=0x0,_0x4f7aa8=events[_0x9ac9('0x6')];_0x51b31e<_0x4f7aa8;_0x51b31e++){var _0x835e26=events[_0x51b31e];var _0x2d4db7=createListener(_0x9ac9('0x7')+_0x835e26,_0x51cc3c);MailQueueEvents['on'](_0x835e26,_0x2d4db7);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index fb7f749..b095f22 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 _0xf79f=['update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','post','put'];(function(_0x304c09,_0xdea075){var _0x5c0e5d=function(_0x40c0f0){while(--_0x40c0f0){_0x304c09['push'](_0x304c09['shift']());}};_0x5c0e5d(++_0xdea075);}(_0xf79f,0x192));var _0xff79=function(_0x1e0b23,_0x447f13){_0x1e0b23=_0x1e0b23-0x0;var _0x9e049c=_0xf79f[_0x1e0b23];return _0x9e049c;};'use strict';var multer=require(_0xff79('0x0'));var util=require('util');var path=require(_0xff79('0x1'));var timeout=require(_0xff79('0x2'));var express=require(_0xff79('0x3'));var router=express['Router']();var fs_extra=require(_0xff79('0x4'));var auth=require(_0xff79('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xff79('0x6'));var controller=require(_0xff79('0x7'));router[_0xff79('0x8')]('/',auth[_0xff79('0x9')](),controller[_0xff79('0xa')]);router[_0xff79('0x8')]('/describe',auth[_0xff79('0x9')](),controller[_0xff79('0xb')]);router[_0xff79('0x8')](_0xff79('0xc'),auth['isAuthenticated'](),controller[_0xff79('0xd')]);router[_0xff79('0xe')]('/',auth[_0xff79('0x9')](),controller['create']);router[_0xff79('0xf')](_0xff79('0xc'),auth[_0xff79('0x9')](),controller[_0xff79('0x10')]);router[_0xff79('0x11')](_0xff79('0xc'),auth[_0xff79('0x9')](),controller[_0xff79('0x12')]);module['exports']=router; \ No newline at end of file +var _0x1d69=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','create','put','update','delete','multer','util','express'];(function(_0x43494e,_0x51ec76){var _0x4de522=function(_0x53c301){while(--_0x53c301){_0x43494e['push'](_0x43494e['shift']());}};_0x4de522(++_0x51ec76);}(_0x1d69,0x1bf));var _0x91d6=function(_0x367361,_0x311488){_0x367361=_0x367361-0x0;var _0x195d2d=_0x1d69[_0x367361];return _0x195d2d;};'use strict';var multer=require(_0x91d6('0x0'));var util=require(_0x91d6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x91d6('0x2'));var router=express[_0x91d6('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x91d6('0x4'));var interaction=require(_0x91d6('0x5'));var config=require(_0x91d6('0x6'));var controller=require('./mailQueueReport.controller');router['get']('/',auth[_0x91d6('0x7')](),controller[_0x91d6('0x8')]);router[_0x91d6('0x9')](_0x91d6('0xa'),auth[_0x91d6('0x7')](),controller[_0x91d6('0xb')]);router[_0x91d6('0x9')](_0x91d6('0xc'),auth['isAuthenticated'](),controller[_0x91d6('0xd')]);router['post']('/',auth[_0x91d6('0x7')](),controller[_0x91d6('0xe')]);router[_0x91d6('0xf')](_0x91d6('0xc'),auth[_0x91d6('0x7')](),controller[_0x91d6('0x10')]);router[_0x91d6('0x11')](_0x91d6('0xc'),auth[_0x91d6('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index b20b4be..f126faa 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 _0xcefd=['DATE','moment','sequelize','exports','STRING'];(function(_0xbdb69f,_0x4c318f){var _0x4265ff=function(_0x53a8c8){while(--_0x53a8c8){_0xbdb69f['push'](_0xbdb69f['shift']());}};_0x4265ff(++_0x4c318f);}(_0xcefd,0x1e1));var _0xdcef=function(_0x43d701,_0x4bb2e9){_0x43d701=_0x43d701-0x0;var _0x2ec4c6=_0xcefd[_0x43d701];return _0x2ec4c6;};'use strict';var moment=require(_0xdcef('0x0'));var Sequelize=require(_0xdcef('0x1'));module[_0xdcef('0x2')]={'uniqueid':{'type':Sequelize[_0xdcef('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xdcef('0x3')]},'joinAt':{'type':Sequelize[_0xdcef('0x4')]},'leaveAt':{'type':Sequelize[_0xdcef('0x4')]},'acceptAt':{'type':Sequelize[_0xdcef('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xdcef('0x3')]}}; \ No newline at end of file +var _0x9365=['DATE','sequelize','exports','STRING'];(function(_0x32b9ac,_0xbc95ce){var _0x877e0d=function(_0x118d29){while(--_0x118d29){_0x32b9ac['push'](_0x32b9ac['shift']());}};_0x877e0d(++_0xbc95ce);}(_0x9365,0xe9));var _0x5936=function(_0x23bf2c,_0x152382){_0x23bf2c=_0x23bf2c-0x0;var _0x540e58=_0x9365[_0x23bf2c];return _0x540e58;};'use strict';var moment=require('moment');var Sequelize=require(_0x5936('0x0'));module[_0x5936('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x5936('0x2')]},'joinAt':{'type':Sequelize[_0x5936('0x3')]},'leaveAt':{'type':Sequelize[_0x5936('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x5936('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 5de6bc9..5e24727 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 _0xe5af=['length','nolimit','order','sort','filter','where','merge','type','VIRTUAL','options','MailQueueReport','includeAll','include','findAll','catch','params','create','body','find','describe','rimraf','zip-dir','request-promise','moment','bluebird','util','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','then','error','stack','name','rawAttributes','key','model','map','query','keys','filters','intersection','fields','attributes'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xe5af,0x9c));var _0xfe5a=function(_0x370b64,_0x23ac51){_0x370b64=_0x370b64-0x0;var _0x92fcf=_0xe5af[_0x370b64];return _0x92fcf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfe5a('0x0'));var zipdir=require(_0xfe5a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfe5a('0x2'));var moment=require(_0xfe5a('0x3'));var BPromise=require(_0xfe5a('0x4'));var Mustache=require('mustache');var util=require(_0xfe5a('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xfe5a('0x6'));var ejs=require(_0xfe5a('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfe5a('0x8'));var crypto=require(_0xfe5a('0x9'));var jsforce=require(_0xfe5a('0xa'));var deskjs=require(_0xfe5a('0xb'));var toCsv=require('to-csv');var querystring=require(_0xfe5a('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfe5a('0xd'));var qs=require(_0xfe5a('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfe5a('0xf'));var logger=require(_0xfe5a('0x10'))(_0xfe5a('0x11'));var utils=require(_0xfe5a('0x12'));var config=require(_0xfe5a('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xfe5a('0x14'))['db'];function respondWithStatusCode(_0x9d1f4f,_0x20b206){_0x20b206=_0x20b206||0xcc;return function(_0x374ded){if(_0x374ded){return _0x9d1f4f[_0xfe5a('0x15')](_0x20b206);}return _0x9d1f4f['status'](_0x20b206)[_0xfe5a('0x16')]();};}function respondWithResult(_0x17bbbe,_0x42969b){_0x42969b=_0x42969b||0xc8;return function(_0x362115){if(_0x362115){return _0x17bbbe[_0xfe5a('0x17')](_0x42969b)[_0xfe5a('0x18')](_0x362115);}};}function respondWithFilteredResult(_0x375380,_0xeb454){return function(_0x111d4d){if(_0x111d4d){var _0x18c57b=typeof _0xeb454[_0xfe5a('0x19')]===_0xfe5a('0x1a')&&typeof _0xeb454[_0xfe5a('0x1b')]===_0xfe5a('0x1a');var _0x3edcab=_0x111d4d[_0xfe5a('0x1c')];var _0x5bf597=_0x18c57b?0x0:_0xeb454[_0xfe5a('0x19')];var _0x456707=_0x18c57b?_0x111d4d['count']:_0xeb454[_0xfe5a('0x19')]+_0xeb454[_0xfe5a('0x1b')];var _0x39d905;if(_0x456707>=_0x3edcab){_0x456707=_0x3edcab;_0x39d905=0xc8;}else{_0x39d905=0xce;}_0x375380['status'](_0x39d905);return _0x375380['set'](_0xfe5a('0x1d'),_0x5bf597+'-'+_0x456707+'/'+_0x3edcab)[_0xfe5a('0x18')](_0x111d4d);}return null;};}function patchUpdates(_0xded538){return function(_0x3b3022){try{jsonpatch[_0xfe5a('0x1e')](_0x3b3022,_0xded538,!![]);}catch(_0x355869){return BPromise['reject'](_0x355869);}return _0x3b3022[_0xfe5a('0x1f')]();};}function saveUpdates(_0x592521,_0x3dfa57){return function(_0x39d825){if(_0x39d825){return _0x39d825[_0xfe5a('0x20')](_0x592521)['then'](function(_0x4bbef1){return _0x4bbef1;});}return null;};}function removeEntity(_0x247be4,_0x3e55fd){return function(_0x494df3){if(_0x494df3){return _0x494df3[_0xfe5a('0x21')]()[_0xfe5a('0x22')](function(){_0x247be4['status'](0xcc)[_0xfe5a('0x16')]();});}};}function handleEntityNotFound(_0x3a4f3c,_0x31cc60){return function(_0x2b4f1c){if(!_0x2b4f1c){_0x3a4f3c['sendStatus'](0x194);}return _0x2b4f1c;};}function handleError(_0x42136e,_0x2f5d04){_0x2f5d04=_0x2f5d04||0x1f4;return function(_0x24481f){logger[_0xfe5a('0x23')](_0x24481f[_0xfe5a('0x24')]);if(_0x24481f[_0xfe5a('0x25')]){delete _0x24481f[_0xfe5a('0x25')];}_0x42136e[_0xfe5a('0x17')](_0x2f5d04)['send'](_0x24481f);};}exports['index']=function(_0x712b44,_0x485f9d){var _0xc53869={},_0xfcb05b={},_0x11bf97={'count':0x0,'rows':[]};var _0x482a35=_['map'](db['MailQueueReport'][_0xfe5a('0x26')],function(_0x582f2d){return{'name':_0x582f2d['fieldName'],'type':_0x582f2d['type'][_0xfe5a('0x27')]};});_0xfcb05b[_0xfe5a('0x28')]=_[_0xfe5a('0x29')](_0x482a35,_0xfe5a('0x25'));_0xfcb05b[_0xfe5a('0x2a')]=_[_0xfe5a('0x2b')](_0x712b44[_0xfe5a('0x2a')]);_0xfcb05b[_0xfe5a('0x2c')]=_[_0xfe5a('0x2d')](_0xfcb05b[_0xfe5a('0x28')],_0xfcb05b[_0xfe5a('0x2a')]);_0xc53869['attributes']=_[_0xfe5a('0x2d')](_0xfcb05b[_0xfe5a('0x28')],qs['fields'](_0x712b44[_0xfe5a('0x2a')][_0xfe5a('0x2e')]));_0xc53869[_0xfe5a('0x2f')]=_0xc53869[_0xfe5a('0x2f')][_0xfe5a('0x30')]?_0xc53869['attributes']:_0xfcb05b['model'];if(!_0x712b44[_0xfe5a('0x2a')]['hasOwnProperty'](_0xfe5a('0x31'))){_0xc53869[_0xfe5a('0x1b')]=qs[_0xfe5a('0x1b')](_0x712b44[_0xfe5a('0x2a')]['limit']);_0xc53869[_0xfe5a('0x19')]=qs[_0xfe5a('0x19')](_0x712b44[_0xfe5a('0x2a')]['offset']);}_0xc53869[_0xfe5a('0x32')]=qs[_0xfe5a('0x33')](_0x712b44[_0xfe5a('0x2a')][_0xfe5a('0x33')]);_0xc53869['where']=qs[_0xfe5a('0x2c')](_['pick'](_0x712b44[_0xfe5a('0x2a')],_0xfcb05b[_0xfe5a('0x2c')]),_0x482a35);if(_0x712b44['query'][_0xfe5a('0x34')]){_0xc53869[_0xfe5a('0x35')]=_[_0xfe5a('0x36')](_0xc53869[_0xfe5a('0x35')],{'$or':_['map'](_0x482a35,function(_0x193ce0){if(_0x193ce0[_0xfe5a('0x37')]!==_0xfe5a('0x38')){var _0x560088={};_0x560088[_0x193ce0[_0xfe5a('0x25')]]={'$like':'%'+_0x712b44[_0xfe5a('0x2a')][_0xfe5a('0x34')]+'%'};return _0x560088;}})});}_0xc53869=_[_0xfe5a('0x36')]({},_0xc53869,_0x712b44[_0xfe5a('0x39')]);var _0x162c48={'where':_0xc53869[_0xfe5a('0x35')]};return db[_0xfe5a('0x3a')][_0xfe5a('0x1c')](_0x162c48)[_0xfe5a('0x22')](function(_0x20da14){_0x11bf97['count']=_0x20da14;if(_0x712b44[_0xfe5a('0x2a')][_0xfe5a('0x3b')]){_0xc53869[_0xfe5a('0x3c')]=[{'all':!![]}];}return db[_0xfe5a('0x3a')][_0xfe5a('0x3d')](_0xc53869);})[_0xfe5a('0x22')](function(_0x3475fb){_0x11bf97['rows']=_0x3475fb;return _0x11bf97;})[_0xfe5a('0x22')](respondWithFilteredResult(_0x485f9d,_0xc53869))[_0xfe5a('0x3e')](handleError(_0x485f9d,null));};exports['show']=function(_0x59caa1,_0x252904){var _0x4c17fd={'raw':!![],'where':{'id':_0x59caa1[_0xfe5a('0x3f')]['id']}},_0x54096d={};_0x54096d[_0xfe5a('0x28')]=_['keys'](db[_0xfe5a('0x3a')]['rawAttributes']);_0x54096d[_0xfe5a('0x2a')]=_[_0xfe5a('0x2b')](_0x59caa1[_0xfe5a('0x2a')]);_0x54096d[_0xfe5a('0x2c')]=_[_0xfe5a('0x2d')](_0x54096d[_0xfe5a('0x28')],_0x54096d['query']);_0x4c17fd[_0xfe5a('0x2f')]=_[_0xfe5a('0x2d')](_0x54096d[_0xfe5a('0x28')],qs[_0xfe5a('0x2e')](_0x59caa1[_0xfe5a('0x2a')][_0xfe5a('0x2e')]));_0x4c17fd[_0xfe5a('0x2f')]=_0x4c17fd[_0xfe5a('0x2f')][_0xfe5a('0x30')]?_0x4c17fd[_0xfe5a('0x2f')]:_0x54096d[_0xfe5a('0x28')];if(_0x59caa1[_0xfe5a('0x2a')][_0xfe5a('0x3b')]){_0x4c17fd[_0xfe5a('0x3c')]=[{'all':!![]}];}_0x4c17fd=_['merge']({},_0x4c17fd,_0x59caa1[_0xfe5a('0x39')]);return db[_0xfe5a('0x3a')]['find'](_0x4c17fd)['then'](handleEntityNotFound(_0x252904,null))[_0xfe5a('0x22')](respondWithResult(_0x252904,null))[_0xfe5a('0x3e')](handleError(_0x252904,null));};exports[_0xfe5a('0x40')]=function(_0x3ccf98,_0x3cf1b5){return db[_0xfe5a('0x3a')][_0xfe5a('0x40')](_0x3ccf98['body'],{})[_0xfe5a('0x22')](respondWithResult(_0x3cf1b5,0xc9))['catch'](handleError(_0x3cf1b5,null));};exports[_0xfe5a('0x20')]=function(_0x5a807e,_0x433562){if(_0x5a807e[_0xfe5a('0x41')]['id']){delete _0x5a807e[_0xfe5a('0x41')]['id'];}return db[_0xfe5a('0x3a')]['find']({'where':{'id':_0x5a807e[_0xfe5a('0x3f')]['id']}})[_0xfe5a('0x22')](handleEntityNotFound(_0x433562,null))['then'](saveUpdates(_0x5a807e[_0xfe5a('0x41')],null))['then'](respondWithResult(_0x433562,null))['catch'](handleError(_0x433562,null));};exports[_0xfe5a('0x21')]=function(_0x4e02c9,_0x374ce5){return db[_0xfe5a('0x3a')][_0xfe5a('0x42')]({'where':{'id':_0x4e02c9[_0xfe5a('0x3f')]['id']}})['then'](handleEntityNotFound(_0x374ce5,null))[_0xfe5a('0x22')](removeEntity(_0x374ce5,null))['catch'](handleError(_0x374ce5,null));};exports[_0xfe5a('0x43')]=function(_0x38409b,_0x149132){return db['MailQueueReport'][_0xfe5a('0x43')]()[_0xfe5a('0x22')](respondWithResult(_0x149132,null))['catch'](handleError(_0x149132,null));}; \ No newline at end of file +var _0x5fdc=['papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','MailQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring'];(function(_0xf5d71c,_0x2613a6){var _0x5af672=function(_0x191f52){while(--_0x191f52){_0xf5d71c['push'](_0xf5d71c['shift']());}};_0x5af672(++_0x2613a6);}(_0x5fdc,0x127));var _0xc5fd=function(_0x1ed439,_0x3e5930){_0x1ed439=_0x1ed439-0x0;var _0x438b6d=_0x5fdc[_0x1ed439];return _0x438b6d;};'use strict';var emlformat=require(_0xc5fd('0x0'));var rimraf=require(_0xc5fd('0x1'));var zipdir=require(_0xc5fd('0x2'));var jsonpatch=require(_0xc5fd('0x3'));var rp=require(_0xc5fd('0x4'));var moment=require(_0xc5fd('0x5'));var BPromise=require(_0xc5fd('0x6'));var Mustache=require(_0xc5fd('0x7'));var util=require(_0xc5fd('0x8'));var path=require(_0xc5fd('0x9'));var sox=require(_0xc5fd('0xa'));var csv=require(_0xc5fd('0xb'));var ejs=require(_0xc5fd('0xc'));var fs=require('fs');var fs_extra=require(_0xc5fd('0xd'));var _=require(_0xc5fd('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc5fd('0xf'));var toCsv=require(_0xc5fd('0xb'));var querystring=require(_0xc5fd('0x10'));var Papa=require(_0xc5fd('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc5fd('0x12'));var as=require(_0xc5fd('0x13'));var hardwareService=require(_0xc5fd('0x14'));var logger=require(_0xc5fd('0x15'))(_0xc5fd('0x16'));var utils=require(_0xc5fd('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xc5fd('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x558939,_0x1b1b2b){_0x1b1b2b=_0x1b1b2b||0xcc;return function(_0x1bc6d1){if(_0x1bc6d1){return _0x558939[_0xc5fd('0x19')](_0x1b1b2b);}return _0x558939[_0xc5fd('0x1a')](_0x1b1b2b)[_0xc5fd('0x1b')]();};}function respondWithResult(_0x40b0f8,_0x27447e){_0x27447e=_0x27447e||0xc8;return function(_0xa7a954){if(_0xa7a954){return _0x40b0f8['status'](_0x27447e)[_0xc5fd('0x1c')](_0xa7a954);}};}function respondWithFilteredResult(_0x103c3d,_0x2221da){return function(_0x3404e0){if(_0x3404e0){var _0x4d3636=typeof _0x2221da['offset']==='undefined'&&typeof _0x2221da['limit']==='undefined';var _0x35a9d0=_0x3404e0[_0xc5fd('0x1d')];var _0x27f611=_0x4d3636?0x0:_0x2221da[_0xc5fd('0x1e')];var _0x2ee392=_0x4d3636?_0x3404e0[_0xc5fd('0x1d')]:_0x2221da[_0xc5fd('0x1e')]+_0x2221da['limit'];var _0xb7bab1;if(_0x2ee392>=_0x35a9d0){_0x2ee392=_0x35a9d0;_0xb7bab1=0xc8;}else{_0xb7bab1=0xce;}_0x103c3d[_0xc5fd('0x1a')](_0xb7bab1);return _0x103c3d[_0xc5fd('0x1f')](_0xc5fd('0x20'),_0x27f611+'-'+_0x2ee392+'/'+_0x35a9d0)[_0xc5fd('0x1c')](_0x3404e0);}return null;};}function patchUpdates(_0x48024e){return function(_0x3966a2){try{jsonpatch[_0xc5fd('0x21')](_0x3966a2,_0x48024e,!![]);}catch(_0x18048e){return BPromise[_0xc5fd('0x22')](_0x18048e);}return _0x3966a2['save']();};}function saveUpdates(_0x4c85d5,_0x13cc42){return function(_0x2ab935){if(_0x2ab935){return _0x2ab935[_0xc5fd('0x23')](_0x4c85d5)[_0xc5fd('0x24')](function(_0x334401){return _0x334401;});}return null;};}function removeEntity(_0x311952,_0x56d473){return function(_0x1a3f21){if(_0x1a3f21){return _0x1a3f21[_0xc5fd('0x25')]()[_0xc5fd('0x24')](function(){_0x311952[_0xc5fd('0x1a')](0xcc)[_0xc5fd('0x1b')]();});}};}function handleEntityNotFound(_0x4020af,_0x475b91){return function(_0x527018){if(!_0x527018){_0x4020af[_0xc5fd('0x19')](0x194);}return _0x527018;};}function handleError(_0x48cd1d,_0x2ee700){_0x2ee700=_0x2ee700||0x1f4;return function(_0x231368){logger[_0xc5fd('0x26')](_0x231368[_0xc5fd('0x27')]);if(_0x231368['name']){delete _0x231368[_0xc5fd('0x28')];}_0x48cd1d[_0xc5fd('0x1a')](_0x2ee700)[_0xc5fd('0x29')](_0x231368);};}exports[_0xc5fd('0x2a')]=function(_0x19df33,_0x209975){var _0x541c12={},_0x412ef7={},_0x5d4f70={'count':0x0,'rows':[]};var _0x4859f7=_[_0xc5fd('0x2b')](db[_0xc5fd('0x2c')][_0xc5fd('0x2d')],function(_0x38db1d){return{'name':_0x38db1d[_0xc5fd('0x2e')],'type':_0x38db1d[_0xc5fd('0x2f')][_0xc5fd('0x30')]};});_0x412ef7[_0xc5fd('0x31')]=_['map'](_0x4859f7,_0xc5fd('0x28'));_0x412ef7[_0xc5fd('0x32')]=_[_0xc5fd('0x33')](_0x19df33[_0xc5fd('0x32')]);_0x412ef7[_0xc5fd('0x34')]=_[_0xc5fd('0x35')](_0x412ef7[_0xc5fd('0x31')],_0x412ef7[_0xc5fd('0x32')]);_0x541c12[_0xc5fd('0x36')]=_[_0xc5fd('0x35')](_0x412ef7[_0xc5fd('0x31')],qs[_0xc5fd('0x37')](_0x19df33['query'][_0xc5fd('0x37')]));_0x541c12[_0xc5fd('0x36')]=_0x541c12[_0xc5fd('0x36')][_0xc5fd('0x38')]?_0x541c12[_0xc5fd('0x36')]:_0x412ef7[_0xc5fd('0x31')];if(!_0x19df33[_0xc5fd('0x32')][_0xc5fd('0x39')](_0xc5fd('0x3a'))){_0x541c12['limit']=qs[_0xc5fd('0x3b')](_0x19df33[_0xc5fd('0x32')][_0xc5fd('0x3b')]);_0x541c12[_0xc5fd('0x1e')]=qs[_0xc5fd('0x1e')](_0x19df33[_0xc5fd('0x32')][_0xc5fd('0x1e')]);}_0x541c12['order']=qs[_0xc5fd('0x3c')](_0x19df33[_0xc5fd('0x32')]['sort']);_0x541c12[_0xc5fd('0x3d')]=qs['filters'](_[_0xc5fd('0x3e')](_0x19df33[_0xc5fd('0x32')],_0x412ef7[_0xc5fd('0x34')]),_0x4859f7);if(_0x19df33['query'][_0xc5fd('0x3f')]){_0x541c12[_0xc5fd('0x3d')]=_['merge'](_0x541c12[_0xc5fd('0x3d')],{'$or':_[_0xc5fd('0x2b')](_0x4859f7,function(_0x31b457){if(_0x31b457[_0xc5fd('0x2f')]!==_0xc5fd('0x40')){var _0x33f669={};_0x33f669[_0x31b457['name']]={'$like':'%'+_0x19df33[_0xc5fd('0x32')][_0xc5fd('0x3f')]+'%'};return _0x33f669;}})});}_0x541c12=_[_0xc5fd('0x41')]({},_0x541c12,_0x19df33[_0xc5fd('0x42')]);var _0x5d3fce={'where':_0x541c12['where']};return db['MailQueueReport'][_0xc5fd('0x1d')](_0x5d3fce)[_0xc5fd('0x24')](function(_0x2dd4ca){_0x5d4f70[_0xc5fd('0x1d')]=_0x2dd4ca;if(_0x19df33[_0xc5fd('0x32')][_0xc5fd('0x43')]){_0x541c12[_0xc5fd('0x44')]=[{'all':!![]}];}return db[_0xc5fd('0x2c')][_0xc5fd('0x45')](_0x541c12);})['then'](function(_0x5a2199){_0x5d4f70[_0xc5fd('0x46')]=_0x5a2199;return _0x5d4f70;})['then'](respondWithFilteredResult(_0x209975,_0x541c12))[_0xc5fd('0x47')](handleError(_0x209975,null));};exports[_0xc5fd('0x48')]=function(_0x2259e4,_0x57fd81){var _0x6ebcbf={'raw':!![],'where':{'id':_0x2259e4['params']['id']}},_0x350753={};_0x350753[_0xc5fd('0x31')]=_[_0xc5fd('0x33')](db['MailQueueReport'][_0xc5fd('0x2d')]);_0x350753['query']=_[_0xc5fd('0x33')](_0x2259e4[_0xc5fd('0x32')]);_0x350753['filters']=_[_0xc5fd('0x35')](_0x350753[_0xc5fd('0x31')],_0x350753[_0xc5fd('0x32')]);_0x6ebcbf['attributes']=_[_0xc5fd('0x35')](_0x350753[_0xc5fd('0x31')],qs['fields'](_0x2259e4['query'][_0xc5fd('0x37')]));_0x6ebcbf['attributes']=_0x6ebcbf['attributes']['length']?_0x6ebcbf[_0xc5fd('0x36')]:_0x350753[_0xc5fd('0x31')];if(_0x2259e4[_0xc5fd('0x32')][_0xc5fd('0x43')]){_0x6ebcbf[_0xc5fd('0x44')]=[{'all':!![]}];}_0x6ebcbf=_[_0xc5fd('0x41')]({},_0x6ebcbf,_0x2259e4['options']);return db['MailQueueReport']['find'](_0x6ebcbf)[_0xc5fd('0x24')](handleEntityNotFound(_0x57fd81,null))[_0xc5fd('0x24')](respondWithResult(_0x57fd81,null))[_0xc5fd('0x47')](handleError(_0x57fd81,null));};exports['create']=function(_0x1a2200,_0x51641b){return db[_0xc5fd('0x2c')][_0xc5fd('0x49')](_0x1a2200[_0xc5fd('0x4a')],{})[_0xc5fd('0x24')](respondWithResult(_0x51641b,0xc9))[_0xc5fd('0x47')](handleError(_0x51641b,null));};exports[_0xc5fd('0x23')]=function(_0x54d86c,_0x6b2f77){if(_0x54d86c[_0xc5fd('0x4a')]['id']){delete _0x54d86c['body']['id'];}return db['MailQueueReport'][_0xc5fd('0x4b')]({'where':{'id':_0x54d86c['params']['id']}})['then'](handleEntityNotFound(_0x6b2f77,null))[_0xc5fd('0x24')](saveUpdates(_0x54d86c[_0xc5fd('0x4a')],null))['then'](respondWithResult(_0x6b2f77,null))[_0xc5fd('0x47')](handleError(_0x6b2f77,null));};exports[_0xc5fd('0x25')]=function(_0x5c49e7,_0x21d418){return db[_0xc5fd('0x2c')][_0xc5fd('0x4b')]({'where':{'id':_0x5c49e7[_0xc5fd('0x4c')]['id']}})[_0xc5fd('0x24')](handleEntityNotFound(_0x21d418,null))[_0xc5fd('0x24')](removeEntity(_0x21d418,null))[_0xc5fd('0x47')](handleError(_0x21d418,null));};exports[_0xc5fd('0x4d')]=function(_0x4217f7,_0x32721e){return db[_0xc5fd('0x2c')]['describe']()[_0xc5fd('0x24')](respondWithResult(_0x32721e,null))[_0xc5fd('0x47')](handleError(_0x32721e,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index fa42876..d6625fd 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 _0x6e67=['report_mail_queue','uniqueid','lodash','util','api','path','rimraf','./mailQueueReport.attributes','exports','define','MailQueueReport'];(function(_0x2e236e,_0x16a5ae){var _0x361d5b=function(_0x2c7064){while(--_0x2c7064){_0x2e236e['push'](_0x2e236e['shift']());}};_0x361d5b(++_0x16a5ae);}(_0x6e67,0x136));var _0x76e6=function(_0x5aa0a1,_0x58d7d4){_0x5aa0a1=_0x5aa0a1-0x0;var _0x38934b=_0x6e67[_0x5aa0a1];return _0x38934b;};'use strict';var _=require(_0x76e6('0x0'));var util=require(_0x76e6('0x1'));var logger=require('../../config/logger')(_0x76e6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x76e6('0x3'));var rimraf=require(_0x76e6('0x4'));var config=require('../../config/environment');var attributes=require(_0x76e6('0x5'));module[_0x76e6('0x6')]=function(_0xc94e72,_0x4f9761){return _0xc94e72[_0x76e6('0x7')](_0x76e6('0x8'),attributes,{'tableName':_0x76e6('0x9'),'paranoid':![],'indexes':[{'name':_0x76e6('0xa'),'fields':[_0x76e6('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xadf6=['./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0xadf6,0xf4));var _0x6adf=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0xadf6[_0x2f1762];return _0x8ab21;};'use strict';var _=require('lodash');var util=require(_0x6adf('0x0'));var logger=require(_0x6adf('0x1'))(_0x6adf('0x2'));var moment=require(_0x6adf('0x3'));var BPromise=require('bluebird');var rp=require(_0x6adf('0x4'));var fs=require('fs');var path=require(_0x6adf('0x5'));var rimraf=require(_0x6adf('0x6'));var config=require(_0x6adf('0x7'));var attributes=require(_0x6adf('0x8'));module[_0x6adf('0x9')]=function(_0x4b5cb3,_0x1405b7){return _0x4b5cb3[_0x6adf('0xa')](_0x6adf('0xb'),attributes,{'tableName':_0x6adf('0xc'),'paranoid':![],'indexes':[{'name':_0x6adf('0xd'),'fields':[_0x6adf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index fc4420b..2d8d406 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 _0xdb28=['UpdateMailQueueReport','MailQueueReport','update','raw','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','CreateMailQueueReport','create','body','options'];(function(_0x350744,_0x7d9b13){var _0x14ad39=function(_0x1306dd){while(--_0x1306dd){_0x350744['push'](_0x350744['shift']());}};_0x14ad39(++_0x7d9b13);}(_0xdb28,0x106));var _0x8db2=function(_0x47dd0f,_0x1c192a){_0x47dd0f=_0x47dd0f-0x0;var _0x27508b=_0xdb28[_0x47dd0f];return _0x27508b;};'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')]('MailQueueReport,\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);});});}exports[_0x8db2('0x16')]=function(_0x3fddc2){var _0x2efd06=this;return new Promise(function(_0x46ce14,_0x51d60d){return db['MailQueueReport'][_0x8db2('0x17')](_0x3fddc2[_0x8db2('0x18')],{'raw':_0x3fddc2[_0x8db2('0x19')]?_0x3fddc2[_0x8db2('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x8db2('0xc')](function(_0x36a9ff){logger[_0x8db2('0x14')](_0x8db2('0x16'),_0x3fddc2);logger[_0x8db2('0xf')]('CreateMailQueueReport',_0x3fddc2,JSON[_0x8db2('0x10')](_0x36a9ff));_0x46ce14(_0x36a9ff);})[_0x8db2('0x15')](function(_0x18f69c){logger[_0x8db2('0x11')](_0x8db2('0x16'),_0x18f69c[_0x8db2('0x13')],_0x3fddc2);_0x51d60d(_0x2efd06[_0x8db2('0x11')](0x1f4,_0x18f69c['message']));});});};exports[_0x8db2('0x1a')]=function(_0x4f6516){var _0x5725f0=this;return new Promise(function(_0x52a9ca,_0x4d923c){return db[_0x8db2('0x1b')][_0x8db2('0x1c')](_0x4f6516[_0x8db2('0x18')],{'raw':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f6516['options']?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1e')]||null:null,'attributes':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')]['attributes']||null:null,'limit':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1f')]||null:null})[_0x8db2('0xc')](function(_0xbe5ece){logger[_0x8db2('0x14')](_0x8db2('0x1a'),_0x4f6516);logger[_0x8db2('0xf')](_0x8db2('0x1a'),_0x4f6516,JSON['stringify'](_0xbe5ece));_0x52a9ca(_0xbe5ece);})[_0x8db2('0x15')](function(_0x50b28d){logger['error'](_0x8db2('0x1a'),_0x50b28d[_0x8db2('0x13')],_0x4f6516);_0x4d923c(_0x5725f0[_0x8db2('0x11')](0x1f4,_0x50b28d['message']));});});}; \ No newline at end of file +var _0xadb5=['MailQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailQueueReport','create','options','raw','debug','MailQueueReport','body','attributes','limit','UpdateMailQueueReport','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x184440,_0x2f27e6){var _0x4ff065=function(_0x315e5e){while(--_0x315e5e){_0x184440['push'](_0x184440['shift']());}};_0x4ff065(++_0x2f27e6);}(_0xadb5,0xad));var _0x5adb=function(_0x1bb0ba,_0xde4386){_0x1bb0ba=_0x1bb0ba-0x0;var _0x33a8fa=_0xadb5[_0x1bb0ba];return _0x33a8fa;};'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']('MailQueueReport,\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);});});}exports[_0x5adb('0x15')]=function(_0x529b65){var _0x3fff62=this;return new Promise(function(_0x5de028,_0x1d9e86){return db['MailQueueReport'][_0x5adb('0x16')](_0x529b65['body'],{'raw':_0x529b65['options']?_0x529b65[_0x5adb('0x17')][_0x5adb('0x18')]===undefined?!![]:![]:!![]})[_0x5adb('0xb')](function(_0x1fd4a7){logger[_0x5adb('0xc')]('CreateMailQueueReport',_0x529b65);logger[_0x5adb('0x19')]('CreateMailQueueReport',_0x529b65,JSON['stringify'](_0x1fd4a7));_0x5de028(_0x1fd4a7);})[_0x5adb('0x14')](function(_0x379b33){logger[_0x5adb('0x10')](_0x5adb('0x15'),_0x379b33[_0x5adb('0x12')],_0x529b65);_0x1d9e86(_0x3fff62[_0x5adb('0x10')](0x1f4,_0x379b33[_0x5adb('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x4b1957){var _0x373cc3=this;return new Promise(function(_0x3220cd,_0x3839fb){return db[_0x5adb('0x1a')]['update'](_0x4b1957[_0x5adb('0x1b')],{'raw':_0x4b1957[_0x5adb('0x17')]?_0x4b1957['options'][_0x5adb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')]['where']||null:null,'attributes':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1c')]||null:null,'limit':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1d')]||null:null})['then'](function(_0x49992e){logger['info'](_0x5adb('0x1e'),_0x4b1957);logger[_0x5adb('0x19')](_0x5adb('0x1e'),_0x4b1957,JSON[_0x5adb('0xf')](_0x49992e));_0x3220cd(_0x49992e);})[_0x5adb('0x14')](function(_0x4de310){logger[_0x5adb('0x10')](_0x5adb('0x1e'),_0x4de310[_0x5adb('0x12')],_0x4b1957);_0x3839fb(_0x373cc3[_0x5adb('0x10')](0x1f4,_0x4de310[_0x5adb('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index aa7ad24..93e8aa5 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x437dc2,_0x1d4df0){var _0xfd6a99=function(_0x361431){while(--_0x361431){_0x437dc2['push'](_0x437dc2['shift']());}};_0xfd6a99(++_0x1d4df0);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1cd47d,_0x55bc75){_0x1cd47d=_0x1cd47d-0x0;var _0x29d52f=_0xcb91[_0x1cd47d];return _0x29d52f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x44508f,_0x3d2edc){var _0x3cc7b9=function(_0x362c76){while(--_0x362c76){_0x44508f['push'](_0x44508f['shift']());}};_0x3cc7b9(++_0x3d2edc);}(_0x9c44,0x178));var _0x49c4=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x9c44[_0x3b0731];return _0x4204d7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index f33ca8c..7bfe7d1 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 _0x7893=['sequelize','exports','STRING','BOOLEAN','INTEGER','INBOX'];(function(_0x1168a1,_0xa0d8c9){var _0xcc5ad8=function(_0x217dc3){while(--_0x217dc3){_0x1168a1['push'](_0x1168a1['shift']());}};_0xcc5ad8(++_0xa0d8c9);}(_0x7893,0x1b0));var _0x3789=function(_0xa12e10,_0x1ca99d){_0xa12e10=_0xa12e10-0x0;var _0xecfec5=_0x7893[_0xa12e10];return _0xecfec5;};'use strict';var Sequelize=require(_0x3789('0x0'));module[_0x3789('0x1')]={'description':{'type':Sequelize[_0x3789('0x2')]},'host':{'type':Sequelize[_0x3789('0x2')]},'authentication':{'type':Sequelize[_0x3789('0x3')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x3789('0x4')]},'tls':{'type':Sequelize[_0x3789('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x3789('0x2')],'defaultValue':_0x3789('0x5')},'connTimeout':{'type':Sequelize[_0x3789('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x3789('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0x3789('0x2')]},'modernAuthentication':{'type':Sequelize[_0x3789('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xc97e=['exports','STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x18bb96,_0x165684){var _0x11968d=function(_0xbe5e78){while(--_0xbe5e78){_0x18bb96['push'](_0x18bb96['shift']());}};_0x11968d(++_0x165684);}(_0xc97e,0x176));var _0xec97=function(_0x209fd5,_0x2035a8){_0x209fd5=_0x209fd5-0x0;var _0x1f8f75=_0xc97e[_0x209fd5];return _0x1f8f75;};'use strict';var Sequelize=require(_0xec97('0x0'));module[_0xec97('0x1')]={'description':{'type':Sequelize[_0xec97('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xec97('0x3')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xec97('0x2')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0xec97('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xec97('0x2')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0xec97('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0xec97('0x2')]},'modernAuthentication':{'type':Sequelize[_0xec97('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 084c408..960c3ce 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 _0x4bb8=['mail_servers_in','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./mailServerIn.attributes','define','MailServerIn'];(function(_0x4c37d6,_0x11f378){var _0x1aea04=function(_0x39df5b){while(--_0x39df5b){_0x4c37d6['push'](_0x4c37d6['shift']());}};_0x1aea04(++_0x11f378);}(_0x4bb8,0x199));var _0x84bb=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x4bb8[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x84bb('0x0'));var util=require(_0x84bb('0x1'));var logger=require(_0x84bb('0x2'))(_0x84bb('0x3'));var moment=require(_0x84bb('0x4'));var BPromise=require('bluebird');var rp=require(_0x84bb('0x5'));var fs=require('fs');var path=require(_0x84bb('0x6'));var rimraf=require(_0x84bb('0x7'));var config=require('../../config/environment');var attributes=require(_0x84bb('0x8'));module['exports']=function(_0x7e2d3,_0x3a6fc3){return _0x7e2d3[_0x84bb('0x9')](_0x84bb('0xa'),attributes,{'tableName':_0x84bb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc5e0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','util'];(function(_0x946518,_0x22816f){var _0x909b69=function(_0x2fa5a4){while(--_0x2fa5a4){_0x946518['push'](_0x946518['shift']());}};_0x909b69(++_0x22816f);}(_0xc5e0,0x185));var _0x0c5e=function(_0xb6eb4d,_0x25c9a6){_0xb6eb4d=_0xb6eb4d-0x0;var _0x354862=_0xc5e0[_0xb6eb4d];return _0x354862;};'use strict';var _=require('lodash');var util=require(_0x0c5e('0x0'));var logger=require(_0x0c5e('0x1'))(_0x0c5e('0x2'));var moment=require(_0x0c5e('0x3'));var BPromise=require(_0x0c5e('0x4'));var rp=require(_0x0c5e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0c5e('0x6'));var config=require(_0x0c5e('0x7'));var attributes=require(_0x0c5e('0x8'));module[_0x0c5e('0x9')]=function(_0xe1bf1e,_0x2635cf){return _0xe1bf1e[_0x0c5e('0xa')](_0x0c5e('0xb'),attributes,{'tableName':_0x0c5e('0xc'),'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 e0b8e3e..afb0b6d 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 _0xb9a0=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','message','result','MailServerIn','findAll','options','raw','limit','include','map','model','attributes','GetMailServerIn','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x2cf0ef,_0x3cd5c3){var _0x46a33b=function(_0x26f4a6){while(--_0x26f4a6){_0x2cf0ef['push'](_0x2cf0ef['shift']());}};_0x46a33b(++_0x3cd5c3);}(_0xb9a0,0x186));var _0x0b9a=function(_0x335d51,_0x4f48a1){_0x335d51=_0x335d51-0x0;var _0x54e66d=_0xb9a0[_0x335d51];return _0x54e66d;};'use strict';var _=require(_0x0b9a('0x0'));var util=require(_0x0b9a('0x1'));var moment=require(_0x0b9a('0x2'));var BPromise=require('bluebird');var rs=require(_0x0b9a('0x3'));var fs=require('fs');var Redis=require(_0x0b9a('0x4'));var db=require(_0x0b9a('0x5'))['db'];var utils=require(_0x0b9a('0x6'));var logger=require(_0x0b9a('0x7'))(_0x0b9a('0x8'));var config=require(_0x0b9a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0b9a('0xa')][_0x0b9a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x131a2c,_0x457e80,_0xe430f6){return new BPromise(function(_0x33ce5a,_0x1cec71){return client[_0x0b9a('0xc')](_0x131a2c,_0xe430f6)[_0x0b9a('0xd')](function(_0x2f78b8){logger[_0x0b9a('0xe')](_0x0b9a('0xf'),_0x457e80,_0x0b9a('0x10'));logger['debug'](_0x0b9a('0x11'),_0x457e80,'request\x20sent',JSON[_0x0b9a('0x12')](_0x2f78b8));if(_0x2f78b8['error']){if(_0x2f78b8[_0x0b9a('0x13')]['code']===0x1f4){logger['error'](_0x0b9a('0xf'),_0x457e80,_0x2f78b8[_0x0b9a('0x13')][_0x0b9a('0x14')]);return _0x1cec71(_0x2f78b8[_0x0b9a('0x13')]['message']);}logger[_0x0b9a('0x13')](_0x0b9a('0xf'),_0x457e80,_0x2f78b8[_0x0b9a('0x13')][_0x0b9a('0x14')]);return _0x33ce5a(_0x2f78b8[_0x0b9a('0x13')][_0x0b9a('0x14')]);}else{logger[_0x0b9a('0xe')](_0x0b9a('0xf'),_0x457e80,_0x0b9a('0x10'));_0x33ce5a(_0x2f78b8[_0x0b9a('0x15')][_0x0b9a('0x14')]);}})['catch'](function(_0x102d2e){logger[_0x0b9a('0x13')](_0x0b9a('0xf'),_0x457e80,_0x102d2e);_0x1cec71(_0x102d2e);});});}exports['GetMailServerIn']=function(_0x3fb823){var _0x5f0fd9=this;return new Promise(function(_0x47b9e1,_0x1df5d9){return db[_0x0b9a('0x16')][_0x0b9a('0x17')]({'raw':_0x3fb823[_0x0b9a('0x18')]?_0x3fb823[_0x0b9a('0x18')][_0x0b9a('0x19')]===undefined?!![]:![]:!![],'where':_0x3fb823[_0x0b9a('0x18')]?_0x3fb823[_0x0b9a('0x18')]['where']||null:null,'attributes':_0x3fb823['options']?_0x3fb823[_0x0b9a('0x18')]['attributes']||null:null,'limit':_0x3fb823[_0x0b9a('0x18')]?_0x3fb823[_0x0b9a('0x18')][_0x0b9a('0x1a')]||null:null,'include':_0x3fb823[_0x0b9a('0x18')]?_0x3fb823[_0x0b9a('0x18')][_0x0b9a('0x1b')]?_[_0x0b9a('0x1c')](_0x3fb823[_0x0b9a('0x18')]['include'],function(_0x3e80c2){return{'model':db[_0x3e80c2[_0x0b9a('0x1d')]],'as':_0x3e80c2['as'],'attributes':_0x3e80c2[_0x0b9a('0x1e')],'include':_0x3e80c2[_0x0b9a('0x1b')]?_[_0x0b9a('0x1c')](_0x3e80c2[_0x0b9a('0x1b')],function(_0x535e40){return{'model':db[_0x535e40[_0x0b9a('0x1d')]],'as':_0x535e40['as'],'attributes':_0x535e40['attributes'],'include':_0x535e40['include']?_[_0x0b9a('0x1c')](_0x535e40['include'],function(_0x2cca68){return{'model':db[_0x2cca68[_0x0b9a('0x1d')]],'as':_0x2cca68['as'],'attributes':_0x2cca68[_0x0b9a('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2232d8){logger[_0x0b9a('0xe')](_0x0b9a('0x1f'),_0x3fb823);logger[_0x0b9a('0x20')](_0x0b9a('0x1f'),_0x3fb823,JSON[_0x0b9a('0x12')](_0x2232d8));_0x47b9e1(_0x2232d8);})['catch'](function(_0x3bfe08){logger[_0x0b9a('0x13')](_0x0b9a('0x1f'),_0x3bfe08[_0x0b9a('0x14')],_0x3fb823);_0x1df5d9(_0x5f0fd9[_0x0b9a('0x13')](0x1f4,_0x3bfe08[_0x0b9a('0x14')]));});});}; \ No newline at end of file +var _0xabc7=['ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','findAll','options','raw','attributes','include','model','map','GetMailServerIn','debug','lodash','util','moment','randomstring'];(function(_0x365c11,_0x5812b3){var _0x24b102=function(_0x366955){while(--_0x366955){_0x365c11['push'](_0x365c11['shift']());}};_0x24b102(++_0x5812b3);}(_0xabc7,0xc7));var _0x7abc=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xabc7[_0x49ca18];return _0x145d54;};'use strict';var _=require(_0x7abc('0x0'));var util=require(_0x7abc('0x1'));var moment=require(_0x7abc('0x2'));var BPromise=require('bluebird');var rs=require(_0x7abc('0x3'));var fs=require('fs');var Redis=require(_0x7abc('0x4'));var db=require(_0x7abc('0x5'))['db'];var utils=require(_0x7abc('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x7abc('0x7'));var jayson=require(_0x7abc('0x8'));var client=jayson['client'][_0x7abc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5a0267,_0x4a4f9c,_0x30c2e7){return new BPromise(function(_0x792cb0,_0x2da3cc){return client[_0x7abc('0xa')](_0x5a0267,_0x30c2e7)[_0x7abc('0xb')](function(_0x13985e){logger[_0x7abc('0xc')](_0x7abc('0xd'),_0x4a4f9c,'request\x20sent');logger['debug']('MailServerIn,\x20%s,\x20%s,\x20%s',_0x4a4f9c,_0x7abc('0xe'),JSON[_0x7abc('0xf')](_0x13985e));if(_0x13985e[_0x7abc('0x10')]){if(_0x13985e[_0x7abc('0x10')][_0x7abc('0x11')]===0x1f4){logger[_0x7abc('0x10')](_0x7abc('0xd'),_0x4a4f9c,_0x13985e[_0x7abc('0x10')]['message']);return _0x2da3cc(_0x13985e[_0x7abc('0x10')][_0x7abc('0x12')]);}logger['error'](_0x7abc('0xd'),_0x4a4f9c,_0x13985e[_0x7abc('0x10')][_0x7abc('0x12')]);return _0x792cb0(_0x13985e[_0x7abc('0x10')][_0x7abc('0x12')]);}else{logger[_0x7abc('0xc')]('MailServerIn,\x20%s,\x20%s',_0x4a4f9c,_0x7abc('0xe'));_0x792cb0(_0x13985e['result'][_0x7abc('0x12')]);}})[_0x7abc('0x13')](function(_0x2e7ffa){logger['error'](_0x7abc('0xd'),_0x4a4f9c,_0x2e7ffa);_0x2da3cc(_0x2e7ffa);});});}exports['GetMailServerIn']=function(_0x57dcad){var _0x11c48d=this;return new Promise(function(_0x157c54,_0x267600){return db['MailServerIn'][_0x7abc('0x14')]({'raw':_0x57dcad[_0x7abc('0x15')]?_0x57dcad[_0x7abc('0x15')][_0x7abc('0x16')]===undefined?!![]:![]:!![],'where':_0x57dcad[_0x7abc('0x15')]?_0x57dcad[_0x7abc('0x15')]['where']||null:null,'attributes':_0x57dcad['options']?_0x57dcad[_0x7abc('0x15')][_0x7abc('0x17')]||null:null,'limit':_0x57dcad[_0x7abc('0x15')]?_0x57dcad['options']['limit']||null:null,'include':_0x57dcad['options']?_0x57dcad[_0x7abc('0x15')][_0x7abc('0x18')]?_['map'](_0x57dcad[_0x7abc('0x15')][_0x7abc('0x18')],function(_0x1a902b){return{'model':db[_0x1a902b[_0x7abc('0x19')]],'as':_0x1a902b['as'],'attributes':_0x1a902b[_0x7abc('0x17')],'include':_0x1a902b['include']?_[_0x7abc('0x1a')](_0x1a902b['include'],function(_0x4f9418){return{'model':db[_0x4f9418['model']],'as':_0x4f9418['as'],'attributes':_0x4f9418[_0x7abc('0x17')],'include':_0x4f9418[_0x7abc('0x18')]?_[_0x7abc('0x1a')](_0x4f9418[_0x7abc('0x18')],function(_0x38e10b){return{'model':db[_0x38e10b['model']],'as':_0x38e10b['as'],'attributes':_0x38e10b['attributes']};}):[]};}):[]};}):[]:[]})[_0x7abc('0xb')](function(_0x1fe637){logger['info'](_0x7abc('0x1b'),_0x57dcad);logger[_0x7abc('0x1c')]('GetMailServerIn',_0x57dcad,JSON[_0x7abc('0xf')](_0x1fe637));_0x157c54(_0x1fe637);})[_0x7abc('0x13')](function(_0x50441a){logger[_0x7abc('0x10')]('GetMailServerIn',_0x50441a[_0x7abc('0x12')],_0x57dcad);_0x267600(_0x11c48d[_0x7abc('0x10')](0x1f4,_0x50441a[_0x7abc('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 778c6e7..4e5eaf3 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(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x7a54,0x106));var _0x47a5=function(_0x16fbb3,_0xc2e7c6){_0x16fbb3=_0x16fbb3-0x0;var _0x21fab7=_0x7a54[_0x16fbb3];return _0x21fab7;};'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(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x7a54,0x106));var _0x47a5=function(_0x240f8a,_0xa4cdde){_0x240f8a=_0x240f8a-0x0;var _0x300269=_0x7a54[_0x240f8a];return _0x300269;};'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 2fb6117..79edc3c 100644 --- a/server/api/mailServerOut/mailServerOut.attributes.js +++ b/server/api/mailServerOut/mailServerOut.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5ec6=['INTEGER','BOOLEAN','sequelize','exports','STRING'];(function(_0x5948dd,_0x1f6ac8){var _0xb1f8be=function(_0x31a8d2){while(--_0x31a8d2){_0x5948dd['push'](_0x5948dd['shift']());}};_0xb1f8be(++_0x1f6ac8);}(_0x5ec6,0x7f));var _0x65ec=function(_0x499fed,_0x38b12c){_0x499fed=_0x499fed-0x0;var _0x14ed10=_0x5ec6[_0x499fed];return _0x14ed10;};'use strict';var Sequelize=require(_0x65ec('0x0'));module[_0x65ec('0x1')]={'description':{'type':Sequelize[_0x65ec('0x2')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x65ec('0x2')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x65ec('0x3')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x65ec('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x65ec('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x34b7=['BOOLEAN','STRING','INTEGER'];(function(_0x4ea58d,_0x511d31){var _0x13ec19=function(_0xcee87){while(--_0xcee87){_0x4ea58d['push'](_0x4ea58d['shift']());}};_0x13ec19(++_0x511d31);}(_0x34b7,0x196));var _0x734b=function(_0x2e14f2,_0x377d0d){_0x2e14f2=_0x2e14f2-0x0;var _0x12cc03=_0x34b7[_0x2e14f2];return _0x12cc03;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x734b('0x0')]},'host':{'type':Sequelize[_0x734b('0x0')]},'user':{'type':Sequelize[_0x734b('0x0')]},'pass':{'type':Sequelize[_0x734b('0x0')]},'port':{'type':Sequelize[_0x734b('0x1')]},'secure':{'type':Sequelize[_0x734b('0x2')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x734b('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index e14306e..4b6c0d9 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 _0x5d93=['key','query','keys','filters','fields','attributes','length','model','nolimit','order','sort','where','pick','filter','merge','options','MailServerOut','include','findAll','rows','catch','show','params','intersection','includeAll','find','create','body','eml-format','rimraf','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','json','reject','save','then','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','type'];(function(_0x39a7a6,_0x3935a5){var _0xf74786=function(_0x3c2cdc){while(--_0x3c2cdc){_0x39a7a6['push'](_0x39a7a6['shift']());}};_0xf74786(++_0x3935a5);}(_0x5d93,0x1ba));var _0x35d9=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x5d93[_0x178e48];return _0x440d7e;};'use strict';var emlformat=require(_0x35d9('0x0'));var rimraf=require(_0x35d9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35d9('0x2'));var rp=require('request-promise');var moment=require(_0x35d9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x35d9('0x4'));var util=require(_0x35d9('0x5'));var path=require('path');var sox=require(_0x35d9('0x6'));var csv=require(_0x35d9('0x7'));var ejs=require(_0x35d9('0x8'));var fs=require('fs');var fs_extra=require(_0x35d9('0x9'));var _=require(_0x35d9('0xa'));var squel=require(_0x35d9('0xb'));var crypto=require(_0x35d9('0xc'));var jsforce=require(_0x35d9('0xd'));var deskjs=require(_0x35d9('0xe'));var toCsv=require(_0x35d9('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x35d9('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x35d9('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x35d9('0x11'));var utils=require('../../config/utils');var config=require(_0x35d9('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x35d9('0x13'))['db'];function respondWithStatusCode(_0x4036e8,_0x57e1c7){_0x57e1c7=_0x57e1c7||0xcc;return function(_0x13be1d){if(_0x13be1d){return _0x4036e8[_0x35d9('0x14')](_0x57e1c7);}return _0x4036e8['status'](_0x57e1c7)['end']();};}function respondWithResult(_0x10439f,_0x5af640){_0x5af640=_0x5af640||0xc8;return function(_0x5f166b){if(_0x5f166b){return _0x10439f[_0x35d9('0x15')](_0x5af640)['json'](_0x5f166b);}};}function respondWithFilteredResult(_0xa49bed,_0x170a3e){return function(_0x40c2bd){if(_0x40c2bd){var _0x2fb30d=typeof _0x170a3e[_0x35d9('0x16')]===_0x35d9('0x17')&&typeof _0x170a3e['limit']===_0x35d9('0x17');var _0x4c20b8=_0x40c2bd[_0x35d9('0x18')];var _0xd0daaa=_0x2fb30d?0x0:_0x170a3e[_0x35d9('0x16')];var _0x4cf92a=_0x2fb30d?_0x40c2bd['count']:_0x170a3e[_0x35d9('0x16')]+_0x170a3e[_0x35d9('0x19')];var _0x4c54ea;if(_0x4cf92a>=_0x4c20b8){_0x4cf92a=_0x4c20b8;_0x4c54ea=0xc8;}else{_0x4c54ea=0xce;}_0xa49bed[_0x35d9('0x15')](_0x4c54ea);return _0xa49bed[_0x35d9('0x1a')]('Content-Range',_0xd0daaa+'-'+_0x4cf92a+'/'+_0x4c20b8)[_0x35d9('0x1b')](_0x40c2bd);}return null;};}function patchUpdates(_0x2ce824){return function(_0x47ea3a){try{jsonpatch['apply'](_0x47ea3a,_0x2ce824,!![]);}catch(_0x2aed8b){return BPromise[_0x35d9('0x1c')](_0x2aed8b);}return _0x47ea3a[_0x35d9('0x1d')]();};}function saveUpdates(_0x1c7fa1,_0x65da7d){return function(_0x598969){if(_0x598969){return _0x598969['update'](_0x1c7fa1)[_0x35d9('0x1e')](function(_0x50dbc9){return _0x50dbc9;});}return null;};}function removeEntity(_0x2deecd,_0x45d456){return function(_0xd655ff){if(_0xd655ff){return _0xd655ff[_0x35d9('0x1f')]()['then'](function(){_0x2deecd['status'](0xcc)[_0x35d9('0x20')]();});}};}function handleEntityNotFound(_0x17e46a,_0x3977a9){return function(_0x794ab5){if(!_0x794ab5){_0x17e46a[_0x35d9('0x14')](0x194);}return _0x794ab5;};}function handleError(_0x2b6f6b,_0x42ae70){_0x42ae70=_0x42ae70||0x1f4;return function(_0x52bb9b){logger['error'](_0x52bb9b[_0x35d9('0x21')]);if(_0x52bb9b[_0x35d9('0x22')]){delete _0x52bb9b['name'];}_0x2b6f6b[_0x35d9('0x15')](_0x42ae70)[_0x35d9('0x23')](_0x52bb9b);};}exports[_0x35d9('0x24')]=function(_0x243a5a,_0x3be52a){var _0x5bce88={},_0xf98fa8={},_0x2599b3={'count':0x0,'rows':[]};var _0x54e3b8=_[_0x35d9('0x25')](db['MailServerOut'][_0x35d9('0x26')],function(_0x415686){return{'name':_0x415686[_0x35d9('0x27')],'type':_0x415686[_0x35d9('0x28')][_0x35d9('0x29')]};});_0xf98fa8['model']=_[_0x35d9('0x25')](_0x54e3b8,'name');_0xf98fa8[_0x35d9('0x2a')]=_[_0x35d9('0x2b')](_0x243a5a[_0x35d9('0x2a')]);_0xf98fa8[_0x35d9('0x2c')]=_['intersection'](_0xf98fa8['model'],_0xf98fa8[_0x35d9('0x2a')]);_0x5bce88['attributes']=_['intersection'](_0xf98fa8['model'],qs[_0x35d9('0x2d')](_0x243a5a[_0x35d9('0x2a')][_0x35d9('0x2d')]));_0x5bce88[_0x35d9('0x2e')]=_0x5bce88['attributes'][_0x35d9('0x2f')]?_0x5bce88[_0x35d9('0x2e')]:_0xf98fa8[_0x35d9('0x30')];if(!_0x243a5a[_0x35d9('0x2a')]['hasOwnProperty'](_0x35d9('0x31'))){_0x5bce88[_0x35d9('0x19')]=qs['limit'](_0x243a5a[_0x35d9('0x2a')]['limit']);_0x5bce88[_0x35d9('0x16')]=qs['offset'](_0x243a5a[_0x35d9('0x2a')]['offset']);}_0x5bce88[_0x35d9('0x32')]=qs[_0x35d9('0x33')](_0x243a5a['query'][_0x35d9('0x33')]);_0x5bce88[_0x35d9('0x34')]=qs['filters'](_[_0x35d9('0x35')](_0x243a5a[_0x35d9('0x2a')],_0xf98fa8[_0x35d9('0x2c')]),_0x54e3b8);if(_0x243a5a[_0x35d9('0x2a')][_0x35d9('0x36')]){_0x5bce88[_0x35d9('0x34')]=_[_0x35d9('0x37')](_0x5bce88[_0x35d9('0x34')],{'$or':_[_0x35d9('0x25')](_0x54e3b8,function(_0x1a10b6){if(_0x1a10b6[_0x35d9('0x28')]!=='VIRTUAL'){var _0xacf8b5={};_0xacf8b5[_0x1a10b6[_0x35d9('0x22')]]={'$like':'%'+_0x243a5a[_0x35d9('0x2a')][_0x35d9('0x36')]+'%'};return _0xacf8b5;}})});}_0x5bce88=_[_0x35d9('0x37')]({},_0x5bce88,_0x243a5a[_0x35d9('0x38')]);var _0x7c0234={'where':_0x5bce88[_0x35d9('0x34')]};return db[_0x35d9('0x39')][_0x35d9('0x18')](_0x7c0234)[_0x35d9('0x1e')](function(_0x66a673){_0x2599b3[_0x35d9('0x18')]=_0x66a673;if(_0x243a5a[_0x35d9('0x2a')]['includeAll']){_0x5bce88[_0x35d9('0x3a')]=[{'all':!![]}];}return db['MailServerOut'][_0x35d9('0x3b')](_0x5bce88);})[_0x35d9('0x1e')](function(_0x5a0f9b){_0x2599b3[_0x35d9('0x3c')]=_0x5a0f9b;return _0x2599b3;})[_0x35d9('0x1e')](respondWithFilteredResult(_0x3be52a,_0x5bce88))[_0x35d9('0x3d')](handleError(_0x3be52a,null));};exports[_0x35d9('0x3e')]=function(_0x58078a,_0x3e5517){var _0x34798b={'raw':!![],'where':{'id':_0x58078a[_0x35d9('0x3f')]['id']}},_0xf65d06={};_0xf65d06[_0x35d9('0x30')]=_[_0x35d9('0x2b')](db['MailServerOut'][_0x35d9('0x26')]);_0xf65d06[_0x35d9('0x2a')]=_[_0x35d9('0x2b')](_0x58078a[_0x35d9('0x2a')]);_0xf65d06[_0x35d9('0x2c')]=_['intersection'](_0xf65d06['model'],_0xf65d06[_0x35d9('0x2a')]);_0x34798b[_0x35d9('0x2e')]=_[_0x35d9('0x40')](_0xf65d06['model'],qs[_0x35d9('0x2d')](_0x58078a[_0x35d9('0x2a')][_0x35d9('0x2d')]));_0x34798b[_0x35d9('0x2e')]=_0x34798b[_0x35d9('0x2e')][_0x35d9('0x2f')]?_0x34798b[_0x35d9('0x2e')]:_0xf65d06[_0x35d9('0x30')];if(_0x58078a[_0x35d9('0x2a')][_0x35d9('0x41')]){_0x34798b[_0x35d9('0x3a')]=[{'all':!![]}];}_0x34798b=_[_0x35d9('0x37')]({},_0x34798b,_0x58078a[_0x35d9('0x38')]);return db[_0x35d9('0x39')][_0x35d9('0x42')](_0x34798b)[_0x35d9('0x1e')](handleEntityNotFound(_0x3e5517,null))[_0x35d9('0x1e')](respondWithResult(_0x3e5517,null))[_0x35d9('0x3d')](handleError(_0x3e5517,null));};exports[_0x35d9('0x43')]=function(_0x5e1f71,_0x3b285f){return db[_0x35d9('0x39')][_0x35d9('0x43')](_0x5e1f71[_0x35d9('0x44')],{})['then'](respondWithResult(_0x3b285f,0xc9))[_0x35d9('0x3d')](handleError(_0x3b285f,null));};exports['update']=function(_0x140aac,_0x2afb01){if(_0x140aac[_0x35d9('0x44')]['id']){delete _0x140aac[_0x35d9('0x44')]['id'];}return db['MailServerOut'][_0x35d9('0x42')]({'where':{'id':_0x140aac[_0x35d9('0x3f')]['id']}})[_0x35d9('0x1e')](handleEntityNotFound(_0x2afb01,null))[_0x35d9('0x1e')](saveUpdates(_0x140aac[_0x35d9('0x44')],null))[_0x35d9('0x1e')](respondWithResult(_0x2afb01,null))[_0x35d9('0x3d')](handleError(_0x2afb01,null));};exports['destroy']=function(_0x49cfce,_0x59a998){return db[_0x35d9('0x39')][_0x35d9('0x42')]({'where':{'id':_0x49cfce['params']['id']}})[_0x35d9('0x1e')](handleEntityNotFound(_0x59a998,null))[_0x35d9('0x1e')](removeEntity(_0x59a998,null))[_0x35d9('0x3d')](handleError(_0x59a998,null));}; \ No newline at end of file +var _0x236c=['status','end','json','offset','limit','undefined','count','Content-Range','save','update','error','stack','name','send','index','map','MailServerOut','rawAttributes','fieldName','key','query','keys','intersection','model','fields','attributes','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','then','includeAll','include','catch','show','length','create','body','find','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x35b336,_0x595b01){var _0x69f9b3=function(_0x418dbe){while(--_0x418dbe){_0x35b336['push'](_0x35b336['shift']());}};_0x69f9b3(++_0x595b01);}(_0x236c,0x153));var _0xc236=function(_0x22485d,_0x54ccf7){_0x22485d=_0x22485d-0x0;var _0x44a051=_0x236c[_0x22485d];return _0x44a051;};'use strict';var emlformat=require(_0xc236('0x0'));var rimraf=require(_0xc236('0x1'));var zipdir=require(_0xc236('0x2'));var jsonpatch=require(_0xc236('0x3'));var rp=require(_0xc236('0x4'));var moment=require(_0xc236('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc236('0x6'));var util=require(_0xc236('0x7'));var path=require(_0xc236('0x8'));var sox=require(_0xc236('0x9'));var csv=require(_0xc236('0xa'));var ejs=require(_0xc236('0xb'));var fs=require('fs');var fs_extra=require(_0xc236('0xc'));var _=require('lodash');var squel=require(_0xc236('0xd'));var crypto=require(_0xc236('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc236('0xa'));var querystring=require(_0xc236('0xf'));var Papa=require(_0xc236('0x10'));var Redis=require('ioredis');var authService=require(_0xc236('0x11'));var qs=require(_0xc236('0x12'));var as=require(_0xc236('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc236('0x14'));var utils=require(_0xc236('0x15'));var config=require(_0xc236('0x16'));var licenseUtil=require(_0xc236('0x17'));var db=require(_0xc236('0x18'))['db'];function respondWithStatusCode(_0x39ba56,_0x4fab17){_0x4fab17=_0x4fab17||0xcc;return function(_0x146ad9){if(_0x146ad9){return _0x39ba56[_0xc236('0x19')](_0x4fab17);}return _0x39ba56[_0xc236('0x1a')](_0x4fab17)[_0xc236('0x1b')]();};}function respondWithResult(_0x526bd6,_0x502038){_0x502038=_0x502038||0xc8;return function(_0x5026b9){if(_0x5026b9){return _0x526bd6[_0xc236('0x1a')](_0x502038)[_0xc236('0x1c')](_0x5026b9);}};}function respondWithFilteredResult(_0x135ea2,_0x4bdcbc){return function(_0x109d15){if(_0x109d15){var _0x311228=typeof _0x4bdcbc[_0xc236('0x1d')]==='undefined'&&typeof _0x4bdcbc[_0xc236('0x1e')]===_0xc236('0x1f');var _0x42bc1d=_0x109d15[_0xc236('0x20')];var _0x824fb2=_0x311228?0x0:_0x4bdcbc['offset'];var _0x445321=_0x311228?_0x109d15[_0xc236('0x20')]:_0x4bdcbc[_0xc236('0x1d')]+_0x4bdcbc[_0xc236('0x1e')];var _0x4fe6c1;if(_0x445321>=_0x42bc1d){_0x445321=_0x42bc1d;_0x4fe6c1=0xc8;}else{_0x4fe6c1=0xce;}_0x135ea2[_0xc236('0x1a')](_0x4fe6c1);return _0x135ea2['set'](_0xc236('0x21'),_0x824fb2+'-'+_0x445321+'/'+_0x42bc1d)[_0xc236('0x1c')](_0x109d15);}return null;};}function patchUpdates(_0x3742dd){return function(_0x1928a4){try{jsonpatch['apply'](_0x1928a4,_0x3742dd,!![]);}catch(_0x5b0a68){return BPromise['reject'](_0x5b0a68);}return _0x1928a4[_0xc236('0x22')]();};}function saveUpdates(_0x3907d6,_0x216819){return function(_0x31bafa){if(_0x31bafa){return _0x31bafa[_0xc236('0x23')](_0x3907d6)['then'](function(_0xdb87b0){return _0xdb87b0;});}return null;};}function removeEntity(_0xe837f4,_0x40525b){return function(_0x28cc4b){if(_0x28cc4b){return _0x28cc4b['destroy']()['then'](function(){_0xe837f4[_0xc236('0x1a')](0xcc)[_0xc236('0x1b')]();});}};}function handleEntityNotFound(_0x545091,_0x3e97f4){return function(_0x19afa0){if(!_0x19afa0){_0x545091[_0xc236('0x19')](0x194);}return _0x19afa0;};}function handleError(_0x4d3568,_0x3fc80e){_0x3fc80e=_0x3fc80e||0x1f4;return function(_0x18e1ef){logger[_0xc236('0x24')](_0x18e1ef[_0xc236('0x25')]);if(_0x18e1ef[_0xc236('0x26')]){delete _0x18e1ef['name'];}_0x4d3568[_0xc236('0x1a')](_0x3fc80e)[_0xc236('0x27')](_0x18e1ef);};}exports[_0xc236('0x28')]=function(_0x1f2bae,_0x449611){var _0x59c6c6={},_0x387e8b={},_0x43a787={'count':0x0,'rows':[]};var _0x116ed0=_[_0xc236('0x29')](db[_0xc236('0x2a')][_0xc236('0x2b')],function(_0x43d7fe){return{'name':_0x43d7fe[_0xc236('0x2c')],'type':_0x43d7fe['type'][_0xc236('0x2d')]};});_0x387e8b['model']=_['map'](_0x116ed0,_0xc236('0x26'));_0x387e8b[_0xc236('0x2e')]=_[_0xc236('0x2f')](_0x1f2bae['query']);_0x387e8b['filters']=_[_0xc236('0x30')](_0x387e8b['model'],_0x387e8b[_0xc236('0x2e')]);_0x59c6c6['attributes']=_[_0xc236('0x30')](_0x387e8b[_0xc236('0x31')],qs[_0xc236('0x32')](_0x1f2bae[_0xc236('0x2e')]['fields']));_0x59c6c6[_0xc236('0x33')]=_0x59c6c6[_0xc236('0x33')]['length']?_0x59c6c6[_0xc236('0x33')]:_0x387e8b['model'];if(!_0x1f2bae['query'][_0xc236('0x34')]('nolimit')){_0x59c6c6[_0xc236('0x1e')]=qs[_0xc236('0x1e')](_0x1f2bae[_0xc236('0x2e')][_0xc236('0x1e')]);_0x59c6c6[_0xc236('0x1d')]=qs[_0xc236('0x1d')](_0x1f2bae[_0xc236('0x2e')][_0xc236('0x1d')]);}_0x59c6c6[_0xc236('0x35')]=qs[_0xc236('0x36')](_0x1f2bae[_0xc236('0x2e')]['sort']);_0x59c6c6[_0xc236('0x37')]=qs[_0xc236('0x38')](_[_0xc236('0x39')](_0x1f2bae[_0xc236('0x2e')],_0x387e8b[_0xc236('0x38')]),_0x116ed0);if(_0x1f2bae[_0xc236('0x2e')][_0xc236('0x3a')]){_0x59c6c6['where']=_[_0xc236('0x3b')](_0x59c6c6[_0xc236('0x37')],{'$or':_['map'](_0x116ed0,function(_0x2a1d73){if(_0x2a1d73[_0xc236('0x3c')]!==_0xc236('0x3d')){var _0x264a64={};_0x264a64[_0x2a1d73['name']]={'$like':'%'+_0x1f2bae[_0xc236('0x2e')][_0xc236('0x3a')]+'%'};return _0x264a64;}})});}_0x59c6c6=_[_0xc236('0x3b')]({},_0x59c6c6,_0x1f2bae['options']);var _0x1b1f8a={'where':_0x59c6c6[_0xc236('0x37')]};return db['MailServerOut']['count'](_0x1b1f8a)[_0xc236('0x3e')](function(_0x1cff98){_0x43a787[_0xc236('0x20')]=_0x1cff98;if(_0x1f2bae[_0xc236('0x2e')][_0xc236('0x3f')]){_0x59c6c6[_0xc236('0x40')]=[{'all':!![]}];}return db[_0xc236('0x2a')]['findAll'](_0x59c6c6);})['then'](function(_0x109230){_0x43a787['rows']=_0x109230;return _0x43a787;})[_0xc236('0x3e')](respondWithFilteredResult(_0x449611,_0x59c6c6))[_0xc236('0x41')](handleError(_0x449611,null));};exports[_0xc236('0x42')]=function(_0x5b7bc2,_0x233f0f){var _0x24bd01={'raw':!![],'where':{'id':_0x5b7bc2['params']['id']}},_0x1c9b82={};_0x1c9b82[_0xc236('0x31')]=_[_0xc236('0x2f')](db[_0xc236('0x2a')][_0xc236('0x2b')]);_0x1c9b82['query']=_[_0xc236('0x2f')](_0x5b7bc2[_0xc236('0x2e')]);_0x1c9b82[_0xc236('0x38')]=_['intersection'](_0x1c9b82[_0xc236('0x31')],_0x1c9b82[_0xc236('0x2e')]);_0x24bd01[_0xc236('0x33')]=_[_0xc236('0x30')](_0x1c9b82[_0xc236('0x31')],qs['fields'](_0x5b7bc2[_0xc236('0x2e')]['fields']));_0x24bd01[_0xc236('0x33')]=_0x24bd01['attributes'][_0xc236('0x43')]?_0x24bd01[_0xc236('0x33')]:_0x1c9b82[_0xc236('0x31')];if(_0x5b7bc2[_0xc236('0x2e')][_0xc236('0x3f')]){_0x24bd01[_0xc236('0x40')]=[{'all':!![]}];}_0x24bd01=_[_0xc236('0x3b')]({},_0x24bd01,_0x5b7bc2['options']);return db[_0xc236('0x2a')]['find'](_0x24bd01)[_0xc236('0x3e')](handleEntityNotFound(_0x233f0f,null))[_0xc236('0x3e')](respondWithResult(_0x233f0f,null))[_0xc236('0x41')](handleError(_0x233f0f,null));};exports[_0xc236('0x44')]=function(_0x35741a,_0x1102c4){return db[_0xc236('0x2a')][_0xc236('0x44')](_0x35741a[_0xc236('0x45')],{})[_0xc236('0x3e')](respondWithResult(_0x1102c4,0xc9))[_0xc236('0x41')](handleError(_0x1102c4,null));};exports[_0xc236('0x23')]=function(_0x57e697,_0x2de12f){if(_0x57e697[_0xc236('0x45')]['id']){delete _0x57e697[_0xc236('0x45')]['id'];}return db[_0xc236('0x2a')][_0xc236('0x46')]({'where':{'id':_0x57e697[_0xc236('0x47')]['id']}})[_0xc236('0x3e')](handleEntityNotFound(_0x2de12f,null))[_0xc236('0x3e')](saveUpdates(_0x57e697[_0xc236('0x45')],null))['then'](respondWithResult(_0x2de12f,null))[_0xc236('0x41')](handleError(_0x2de12f,null));};exports[_0xc236('0x48')]=function(_0x35dbec,_0x133ccb){return db[_0xc236('0x2a')][_0xc236('0x46')]({'where':{'id':_0x35dbec[_0xc236('0x47')]['id']}})['then'](handleEntityNotFound(_0x133ccb,null))['then'](removeEntity(_0x133ccb,null))['catch'](handleError(_0x133ccb,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 1546df2..d751f79 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 _0xfe65=['MailServerOut','mail_servers_out','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./mailServerOut.attributes'];(function(_0x592b99,_0x9dce93){var _0x282cd3=function(_0x9fcb0c){while(--_0x9fcb0c){_0x592b99['push'](_0x592b99['shift']());}};_0x282cd3(++_0x9dce93);}(_0xfe65,0x1a4));var _0x5fe6=function(_0x32d21e,_0x2c451f){_0x32d21e=_0x32d21e-0x0;var _0x14dd81=_0xfe65[_0x32d21e];return _0x14dd81;};'use strict';var _=require(_0x5fe6('0x0'));var util=require(_0x5fe6('0x1'));var logger=require(_0x5fe6('0x2'))(_0x5fe6('0x3'));var moment=require(_0x5fe6('0x4'));var BPromise=require(_0x5fe6('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5fe6('0x6'));var config=require(_0x5fe6('0x7'));var attributes=require(_0x5fe6('0x8'));module['exports']=function(_0x24c187,_0x3412ff){return _0x24c187['define'](_0x5fe6('0x9'),attributes,{'tableName':_0x5fe6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e27=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','MailServerOut','lodash','util','../../config/logger','api'];(function(_0x164c3f,_0x4c6b16){var _0x34a2d2=function(_0x3d9469){while(--_0x3d9469){_0x164c3f['push'](_0x164c3f['shift']());}};_0x34a2d2(++_0x4c6b16);}(_0x3e27,0x1ea));var _0x73e2=function(_0x3b6131,_0x1fc9c0){_0x3b6131=_0x3b6131-0x0;var _0xe50553=_0x3e27[_0x3b6131];return _0xe50553;};'use strict';var _=require(_0x73e2('0x0'));var util=require(_0x73e2('0x1'));var logger=require(_0x73e2('0x2'))(_0x73e2('0x3'));var moment=require(_0x73e2('0x4'));var BPromise=require(_0x73e2('0x5'));var rp=require(_0x73e2('0x6'));var fs=require('fs');var path=require(_0x73e2('0x7'));var rimraf=require(_0x73e2('0x8'));var config=require(_0x73e2('0x9'));var attributes=require(_0x73e2('0xa'));module[_0x73e2('0xb')]=function(_0x2bb5a3,_0x1b2959){return _0x2bb5a3['define'](_0x73e2('0xc'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index ccdea20..621f836 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x4bcf38,_0x3c12be){var _0x4a89be=function(_0x3215a6){while(--_0x3215a6){_0x4bcf38['push'](_0x4bcf38['shift']());}};_0x4a89be(++_0x3c12be);}(_0xadb5,0xad));var _0x5adb=function(_0x3164f1,_0x211af0){_0x3164f1=_0x3164f1-0x0;var _0x8e4faa=_0xadb5[_0x3164f1];return _0x8e4faa;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailServerOut,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file +var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x510b98,_0x4c4cbb){var _0x45e775=function(_0x29ec11){while(--_0x29ec11){_0x510b98['push'](_0x510b98['shift']());}};_0x45e775(++_0x4c4cbb);}(_0xadb5,0xad));var _0x5adb=function(_0x4916dc,_0x391111){_0x4916dc=_0x4916dc-0x0;var _0x994115=_0xadb5[_0x4916dc];return _0x994115;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailServerOut,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index b831c8d..591d645 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 _0x0505=['../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','index','/describe','describe','/:id','show','post','isAuthenticated','create','update','delete','destroy','exports','multer','util','path','express'];(function(_0x5aee83,_0x2b6cf9){var _0x9d657c=function(_0x189e50){while(--_0x189e50){_0x5aee83['push'](_0x5aee83['shift']());}};_0x9d657c(++_0x2b6cf9);}(_0x0505,0xe3));var _0x5050=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x0505[_0xb0f7c3];return _0x28ea68;};'use strict';var multer=require(_0x5050('0x0'));var util=require(_0x5050('0x1'));var path=require(_0x5050('0x2'));var timeout=require('connect-timeout');var express=require(_0x5050('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5050('0x4'));var interaction=require(_0x5050('0x5'));var config=require(_0x5050('0x6'));var controller=require(_0x5050('0x7'));router[_0x5050('0x8')]('/',auth['isAuthenticated'](),controller[_0x5050('0x9')]);router[_0x5050('0x8')](_0x5050('0xa'),auth['isAuthenticated'](),controller[_0x5050('0xb')]);router[_0x5050('0x8')](_0x5050('0xc'),auth['isAuthenticated'](),controller[_0x5050('0xd')]);router[_0x5050('0xe')]('/',auth[_0x5050('0xf')](),controller[_0x5050('0x10')]);router['put'](_0x5050('0xc'),auth[_0x5050('0xf')](),controller[_0x5050('0x11')]);router[_0x5050('0x12')](_0x5050('0xc'),auth[_0x5050('0xf')](),controller[_0x5050('0x13')]);module[_0x5050('0x14')]=router; \ No newline at end of file +var _0x5e08=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x1616dc,_0x14a8e1){var _0x6ea16a=function(_0x4a7234){while(--_0x4a7234){_0x1616dc['push'](_0x1616dc['shift']());}};_0x6ea16a(++_0x14a8e1);}(_0x5e08,0xe2));var _0x85e0=function(_0x2199fe,_0x261dd1){_0x2199fe=_0x2199fe-0x0;var _0xf5a1ee=_0x5e08[_0x2199fe];return _0xf5a1ee;};'use strict';var multer=require(_0x85e0('0x0'));var util=require(_0x85e0('0x1'));var path=require(_0x85e0('0x2'));var timeout=require(_0x85e0('0x3'));var express=require('express');var router=express[_0x85e0('0x4')]();var fs_extra=require(_0x85e0('0x5'));var auth=require(_0x85e0('0x6'));var interaction=require(_0x85e0('0x7'));var config=require(_0x85e0('0x8'));var controller=require(_0x85e0('0x9'));router[_0x85e0('0xa')]('/',auth[_0x85e0('0xb')](),controller[_0x85e0('0xc')]);router[_0x85e0('0xa')](_0x85e0('0xd'),auth[_0x85e0('0xb')](),controller[_0x85e0('0xe')]);router['get'](_0x85e0('0xf'),auth[_0x85e0('0xb')](),controller[_0x85e0('0x10')]);router[_0x85e0('0x11')]('/',auth['isAuthenticated'](),controller[_0x85e0('0x12')]);router['put']('/:id',auth[_0x85e0('0xb')](),controller[_0x85e0('0x13')]);router[_0x85e0('0x14')](_0x85e0('0xf'),auth[_0x85e0('0xb')](),controller[_0x85e0('0x15')]);module[_0x85e0('0x16')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index bdf6a94..b4fc7f6 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(_0x4fdbcc,_0xfd5871){var _0x2e6adc=function(_0x3552a2){while(--_0x3552a2){_0x4fdbcc['push'](_0x4fdbcc['shift']());}};_0x2e6adc(++_0xfd5871);}(_0x3831,0x14c));var _0x1383=function(_0x5f52e4,_0x5a69b3){_0x5f52e4=_0x5f52e4-0x0;var _0x25148b=_0x3831[_0x5f52e4];return _0x25148b;};'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 _0x326f=['name','STRING','sequelize'];(function(_0x2454ef,_0x1ed381){var _0x50517e=function(_0x9765d9){while(--_0x9765d9){_0x2454ef['push'](_0x2454ef['shift']());}};_0x50517e(++_0x1ed381);}(_0x326f,0xd1));var _0xf326=function(_0x2d410d,_0xa2e8f3){_0x2d410d=_0x2d410d-0x0;var _0x546840=_0x326f[_0x2d410d];return _0x546840;};'use strict';var Sequelize=require(_0xf326('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xf326('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf326('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 545eaa6..1caada8 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 _0xc5aa=['sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','include','rows','show','find','create','catch','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','Content-Range','apply','reject','then','destroy','error','stack','send','index','map','MailSubstatus','rawAttributes','fieldName','type','model','name','query','keys','intersection','attributes','fields','length','nolimit','order'];(function(_0x3b3a60,_0x5d8d33){var _0x5f5120=function(_0x146644){while(--_0x146644){_0x3b3a60['push'](_0x3b3a60['shift']());}};_0x5f5120(++_0x5d8d33);}(_0xc5aa,0x1e0));var _0xac5a=function(_0xdc8f4d,_0x1029f8){_0xdc8f4d=_0xdc8f4d-0x0;var _0x2a1cd7=_0xc5aa[_0xdc8f4d];return _0x2a1cd7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xac5a('0x0'));var zipdir=require(_0xac5a('0x1'));var jsonpatch=require(_0xac5a('0x2'));var rp=require(_0xac5a('0x3'));var moment=require(_0xac5a('0x4'));var BPromise=require(_0xac5a('0x5'));var Mustache=require(_0xac5a('0x6'));var util=require(_0xac5a('0x7'));var path=require(_0xac5a('0x8'));var sox=require(_0xac5a('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xac5a('0xa'));var _=require(_0xac5a('0xb'));var squel=require('squel');var crypto=require(_0xac5a('0xc'));var jsforce=require(_0xac5a('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xac5a('0xe'));var Papa=require(_0xac5a('0xf'));var Redis=require(_0xac5a('0x10'));var authService=require(_0xac5a('0x11'));var qs=require(_0xac5a('0x12'));var as=require(_0xac5a('0x13'));var hardwareService=require(_0xac5a('0x14'));var logger=require(_0xac5a('0x15'))(_0xac5a('0x16'));var utils=require(_0xac5a('0x17'));var config=require(_0xac5a('0x18'));var licenseUtil=require(_0xac5a('0x19'));var db=require(_0xac5a('0x1a'))['db'];function respondWithStatusCode(_0x5490c9,_0x1721b3){_0x1721b3=_0x1721b3||0xcc;return function(_0x4bd23c){if(_0x4bd23c){return _0x5490c9[_0xac5a('0x1b')](_0x1721b3);}return _0x5490c9['status'](_0x1721b3)[_0xac5a('0x1c')]();};}function respondWithResult(_0x23393a,_0x10c75a){_0x10c75a=_0x10c75a||0xc8;return function(_0xb967ef){if(_0xb967ef){return _0x23393a['status'](_0x10c75a)[_0xac5a('0x1d')](_0xb967ef);}};}function respondWithFilteredResult(_0x594300,_0x5bff6e){return function(_0x10dcac){if(_0x10dcac){var _0xbf3d64=typeof _0x5bff6e[_0xac5a('0x1e')]===_0xac5a('0x1f')&&typeof _0x5bff6e['limit']===_0xac5a('0x1f');var _0x4dcf17=_0x10dcac['count'];var _0x1a69d5=_0xbf3d64?0x0:_0x5bff6e['offset'];var _0xdd5c36=_0xbf3d64?_0x10dcac[_0xac5a('0x20')]:_0x5bff6e[_0xac5a('0x1e')]+_0x5bff6e[_0xac5a('0x21')];var _0x46bbc8;if(_0xdd5c36>=_0x4dcf17){_0xdd5c36=_0x4dcf17;_0x46bbc8=0xc8;}else{_0x46bbc8=0xce;}_0x594300[_0xac5a('0x22')](_0x46bbc8);return _0x594300['set'](_0xac5a('0x23'),_0x1a69d5+'-'+_0xdd5c36+'/'+_0x4dcf17)[_0xac5a('0x1d')](_0x10dcac);}return null;};}function patchUpdates(_0x534bf4){return function(_0x109eeb){try{jsonpatch[_0xac5a('0x24')](_0x109eeb,_0x534bf4,!![]);}catch(_0x1edb8f){return BPromise[_0xac5a('0x25')](_0x1edb8f);}return _0x109eeb['save']();};}function saveUpdates(_0x21da58,_0x2dff6e){return function(_0x2cfb2d){if(_0x2cfb2d){return _0x2cfb2d['update'](_0x21da58)[_0xac5a('0x26')](function(_0x46cd8d){return _0x46cd8d;});}return null;};}function removeEntity(_0x52cd96,_0x3fdbd6){return function(_0x506c20){if(_0x506c20){return _0x506c20[_0xac5a('0x27')]()['then'](function(){_0x52cd96[_0xac5a('0x22')](0xcc)[_0xac5a('0x1c')]();});}};}function handleEntityNotFound(_0x198582,_0x2025f7){return function(_0x2a423e){if(!_0x2a423e){_0x198582['sendStatus'](0x194);}return _0x2a423e;};}function handleError(_0x1307e8,_0x38f7c0){_0x38f7c0=_0x38f7c0||0x1f4;return function(_0x2d4fa5){logger[_0xac5a('0x28')](_0x2d4fa5[_0xac5a('0x29')]);if(_0x2d4fa5['name']){delete _0x2d4fa5['name'];}_0x1307e8[_0xac5a('0x22')](_0x38f7c0)[_0xac5a('0x2a')](_0x2d4fa5);};}exports[_0xac5a('0x2b')]=function(_0x2b857a,_0x474ee4){var _0x43b5cd={},_0x2b03c1={},_0x626d56={'count':0x0,'rows':[]};var _0x37ee85=_[_0xac5a('0x2c')](db[_0xac5a('0x2d')][_0xac5a('0x2e')],function(_0xb4f4ef){return{'name':_0xb4f4ef[_0xac5a('0x2f')],'type':_0xb4f4ef[_0xac5a('0x30')]['key']};});_0x2b03c1[_0xac5a('0x31')]=_['map'](_0x37ee85,_0xac5a('0x32'));_0x2b03c1[_0xac5a('0x33')]=_[_0xac5a('0x34')](_0x2b857a[_0xac5a('0x33')]);_0x2b03c1['filters']=_[_0xac5a('0x35')](_0x2b03c1[_0xac5a('0x31')],_0x2b03c1['query']);_0x43b5cd[_0xac5a('0x36')]=_[_0xac5a('0x35')](_0x2b03c1[_0xac5a('0x31')],qs[_0xac5a('0x37')](_0x2b857a[_0xac5a('0x33')][_0xac5a('0x37')]));_0x43b5cd[_0xac5a('0x36')]=_0x43b5cd[_0xac5a('0x36')][_0xac5a('0x38')]?_0x43b5cd[_0xac5a('0x36')]:_0x2b03c1['model'];if(!_0x2b857a[_0xac5a('0x33')]['hasOwnProperty'](_0xac5a('0x39'))){_0x43b5cd[_0xac5a('0x21')]=qs[_0xac5a('0x21')](_0x2b857a['query'][_0xac5a('0x21')]);_0x43b5cd[_0xac5a('0x1e')]=qs['offset'](_0x2b857a[_0xac5a('0x33')][_0xac5a('0x1e')]);}_0x43b5cd[_0xac5a('0x3a')]=qs['sort'](_0x2b857a[_0xac5a('0x33')][_0xac5a('0x3b')]);_0x43b5cd[_0xac5a('0x3c')]=qs[_0xac5a('0x3d')](_[_0xac5a('0x3e')](_0x2b857a['query'],_0x2b03c1[_0xac5a('0x3d')]),_0x37ee85);if(_0x2b857a[_0xac5a('0x33')]['filter']){_0x43b5cd[_0xac5a('0x3c')]=_['merge'](_0x43b5cd['where'],{'$or':_[_0xac5a('0x2c')](_0x37ee85,function(_0x3180b8){if(_0x3180b8[_0xac5a('0x30')]!==_0xac5a('0x3f')){var _0x3088ee={};_0x3088ee[_0x3180b8['name']]={'$like':'%'+_0x2b857a[_0xac5a('0x33')][_0xac5a('0x40')]+'%'};return _0x3088ee;}})});}_0x43b5cd=_[_0xac5a('0x41')]({},_0x43b5cd,_0x2b857a[_0xac5a('0x42')]);var _0x452470={'where':_0x43b5cd['where']};return db[_0xac5a('0x2d')][_0xac5a('0x20')](_0x452470)[_0xac5a('0x26')](function(_0xe284fe){_0x626d56[_0xac5a('0x20')]=_0xe284fe;if(_0x2b857a[_0xac5a('0x33')][_0xac5a('0x43')]){_0x43b5cd[_0xac5a('0x44')]=[{'all':!![]}];}return db[_0xac5a('0x2d')]['findAll'](_0x43b5cd);})[_0xac5a('0x26')](function(_0x5196f){_0x626d56[_0xac5a('0x45')]=_0x5196f;return _0x626d56;})[_0xac5a('0x26')](respondWithFilteredResult(_0x474ee4,_0x43b5cd))['catch'](handleError(_0x474ee4,null));};exports[_0xac5a('0x46')]=function(_0x2ac458,_0x1ec44d){var _0x52a799={'raw':!![],'where':{'id':_0x2ac458['params']['id']}},_0xc8837d={};_0xc8837d[_0xac5a('0x31')]=_[_0xac5a('0x34')](db[_0xac5a('0x2d')][_0xac5a('0x2e')]);_0xc8837d['query']=_[_0xac5a('0x34')](_0x2ac458[_0xac5a('0x33')]);_0xc8837d[_0xac5a('0x3d')]=_[_0xac5a('0x35')](_0xc8837d[_0xac5a('0x31')],_0xc8837d[_0xac5a('0x33')]);_0x52a799['attributes']=_[_0xac5a('0x35')](_0xc8837d['model'],qs[_0xac5a('0x37')](_0x2ac458[_0xac5a('0x33')][_0xac5a('0x37')]));_0x52a799[_0xac5a('0x36')]=_0x52a799[_0xac5a('0x36')][_0xac5a('0x38')]?_0x52a799[_0xac5a('0x36')]:_0xc8837d[_0xac5a('0x31')];if(_0x2ac458[_0xac5a('0x33')][_0xac5a('0x43')]){_0x52a799[_0xac5a('0x44')]=[{'all':!![]}];}_0x52a799=_[_0xac5a('0x41')]({},_0x52a799,_0x2ac458[_0xac5a('0x42')]);return db[_0xac5a('0x2d')][_0xac5a('0x47')](_0x52a799)[_0xac5a('0x26')](handleEntityNotFound(_0x1ec44d,null))[_0xac5a('0x26')](respondWithResult(_0x1ec44d,null))['catch'](handleError(_0x1ec44d,null));};exports[_0xac5a('0x48')]=function(_0x36e6f3,_0x5bf76a){return db[_0xac5a('0x2d')][_0xac5a('0x48')](_0x36e6f3['body'],{})['then'](respondWithResult(_0x5bf76a,0xc9))[_0xac5a('0x49')](handleError(_0x5bf76a,null));};exports['update']=function(_0x14c1ee,_0x3a2234){if(_0x14c1ee['body']['id']){delete _0x14c1ee[_0xac5a('0x4a')]['id'];}return db[_0xac5a('0x2d')]['find']({'where':{'id':_0x14c1ee['params']['id']}})[_0xac5a('0x26')](handleEntityNotFound(_0x3a2234,null))['then'](saveUpdates(_0x14c1ee[_0xac5a('0x4a')],null))[_0xac5a('0x26')](respondWithResult(_0x3a2234,null))[_0xac5a('0x49')](handleError(_0x3a2234,null));};exports[_0xac5a('0x27')]=function(_0x398577,_0x46ea34){return db[_0xac5a('0x2d')][_0xac5a('0x47')]({'where':{'id':_0x398577[_0xac5a('0x4b')]['id']}})[_0xac5a('0x26')](handleEntityNotFound(_0x46ea34,null))[_0xac5a('0x26')](removeEntity(_0x46ea34,null))[_0xac5a('0x49')](handleError(_0x46ea34,null));};exports[_0xac5a('0x4c')]=function(_0x153024,_0x576e36){return db[_0xac5a('0x2d')][_0xac5a('0x4c')]()['then'](respondWithResult(_0x576e36,null))[_0xac5a('0x49')](handleError(_0x576e36,null));}; \ No newline at end of file +var _0xba4b=['model','filters','intersection','fields','query','attributes','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','length','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','apply','reject','update','destroy','then','sendStatus','error','name','index','map','MailSubstatus','fieldName','type','key'];(function(_0x52a86f,_0x20d050){var _0x46f5ad=function(_0x3d269d){while(--_0x3d269d){_0x52a86f['push'](_0x52a86f['shift']());}};_0x46f5ad(++_0x20d050);}(_0xba4b,0xef));var _0xbba4=function(_0x16f13b,_0xd231df){_0x16f13b=_0x16f13b-0x0;var _0x237932=_0xba4b[_0x16f13b];return _0x237932;};'use strict';var emlformat=require(_0xbba4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbba4('0x1'));var jsonpatch=require(_0xbba4('0x2'));var rp=require(_0xbba4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbba4('0x4'));var util=require(_0xbba4('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xbba4('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbba4('0x7'));var _=require(_0xbba4('0x8'));var squel=require('squel');var crypto=require(_0xbba4('0x9'));var jsforce=require(_0xbba4('0xa'));var deskjs=require(_0xbba4('0xb'));var toCsv=require('to-csv');var querystring=require(_0xbba4('0xc'));var Papa=require(_0xbba4('0xd'));var Redis=require(_0xbba4('0xe'));var authService=require(_0xbba4('0xf'));var qs=require(_0xbba4('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbba4('0x11'));var logger=require(_0xbba4('0x12'))(_0xbba4('0x13'));var utils=require(_0xbba4('0x14'));var config=require(_0xbba4('0x15'));var licenseUtil=require(_0xbba4('0x16'));var db=require(_0xbba4('0x17'))['db'];function respondWithStatusCode(_0x39dced,_0x99f616){_0x99f616=_0x99f616||0xcc;return function(_0x5a9573){if(_0x5a9573){return _0x39dced['sendStatus'](_0x99f616);}return _0x39dced[_0xbba4('0x18')](_0x99f616)[_0xbba4('0x19')]();};}function respondWithResult(_0x48d9de,_0x491fa7){_0x491fa7=_0x491fa7||0xc8;return function(_0x25f376){if(_0x25f376){return _0x48d9de[_0xbba4('0x18')](_0x491fa7)['json'](_0x25f376);}};}function respondWithFilteredResult(_0x7df2d7,_0x7b03d6){return function(_0x739603){if(_0x739603){var _0x4d48b9=typeof _0x7b03d6[_0xbba4('0x1a')]===_0xbba4('0x1b')&&typeof _0x7b03d6[_0xbba4('0x1c')]===_0xbba4('0x1b');var _0x3cc2da=_0x739603[_0xbba4('0x1d')];var _0x148e9f=_0x4d48b9?0x0:_0x7b03d6[_0xbba4('0x1a')];var _0x2a6183=_0x4d48b9?_0x739603[_0xbba4('0x1d')]:_0x7b03d6['offset']+_0x7b03d6['limit'];var _0xc6d31e;if(_0x2a6183>=_0x3cc2da){_0x2a6183=_0x3cc2da;_0xc6d31e=0xc8;}else{_0xc6d31e=0xce;}_0x7df2d7[_0xbba4('0x18')](_0xc6d31e);return _0x7df2d7[_0xbba4('0x1e')]('Content-Range',_0x148e9f+'-'+_0x2a6183+'/'+_0x3cc2da)['json'](_0x739603);}return null;};}function patchUpdates(_0x28746a){return function(_0x26d716){try{jsonpatch[_0xbba4('0x1f')](_0x26d716,_0x28746a,!![]);}catch(_0x317e3e){return BPromise[_0xbba4('0x20')](_0x317e3e);}return _0x26d716['save']();};}function saveUpdates(_0x2b3afa,_0x4a7bd1){return function(_0x2f1350){if(_0x2f1350){return _0x2f1350[_0xbba4('0x21')](_0x2b3afa)['then'](function(_0x166b81){return _0x166b81;});}return null;};}function removeEntity(_0x4b2daf,_0x299277){return function(_0xe2300e){if(_0xe2300e){return _0xe2300e[_0xbba4('0x22')]()[_0xbba4('0x23')](function(){_0x4b2daf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x23fe60,_0x4a1ac4){return function(_0x3a743f){if(!_0x3a743f){_0x23fe60[_0xbba4('0x24')](0x194);}return _0x3a743f;};}function handleError(_0x35d2e1,_0x959b6c){_0x959b6c=_0x959b6c||0x1f4;return function(_0x4c5ff0){logger[_0xbba4('0x25')](_0x4c5ff0['stack']);if(_0x4c5ff0[_0xbba4('0x26')]){delete _0x4c5ff0[_0xbba4('0x26')];}_0x35d2e1[_0xbba4('0x18')](_0x959b6c)['send'](_0x4c5ff0);};}exports[_0xbba4('0x27')]=function(_0xf05ce6,_0x5d01a4){var _0x3db8df={},_0x26e9e5={},_0x137edb={'count':0x0,'rows':[]};var _0x338492=_[_0xbba4('0x28')](db[_0xbba4('0x29')]['rawAttributes'],function(_0x449827){return{'name':_0x449827[_0xbba4('0x2a')],'type':_0x449827[_0xbba4('0x2b')][_0xbba4('0x2c')]};});_0x26e9e5[_0xbba4('0x2d')]=_['map'](_0x338492,_0xbba4('0x26'));_0x26e9e5['query']=_['keys'](_0xf05ce6['query']);_0x26e9e5[_0xbba4('0x2e')]=_[_0xbba4('0x2f')](_0x26e9e5['model'],_0x26e9e5['query']);_0x3db8df['attributes']=_['intersection'](_0x26e9e5[_0xbba4('0x2d')],qs[_0xbba4('0x30')](_0xf05ce6[_0xbba4('0x31')][_0xbba4('0x30')]));_0x3db8df[_0xbba4('0x32')]=_0x3db8df[_0xbba4('0x32')]['length']?_0x3db8df[_0xbba4('0x32')]:_0x26e9e5['model'];if(!_0xf05ce6[_0xbba4('0x31')][_0xbba4('0x33')]('nolimit')){_0x3db8df[_0xbba4('0x1c')]=qs['limit'](_0xf05ce6[_0xbba4('0x31')]['limit']);_0x3db8df[_0xbba4('0x1a')]=qs[_0xbba4('0x1a')](_0xf05ce6['query'][_0xbba4('0x1a')]);}_0x3db8df[_0xbba4('0x34')]=qs[_0xbba4('0x35')](_0xf05ce6[_0xbba4('0x31')][_0xbba4('0x35')]);_0x3db8df['where']=qs[_0xbba4('0x2e')](_[_0xbba4('0x36')](_0xf05ce6[_0xbba4('0x31')],_0x26e9e5[_0xbba4('0x2e')]),_0x338492);if(_0xf05ce6['query'][_0xbba4('0x37')]){_0x3db8df['where']=_['merge'](_0x3db8df[_0xbba4('0x38')],{'$or':_['map'](_0x338492,function(_0x538ada){if(_0x538ada[_0xbba4('0x2b')]!==_0xbba4('0x39')){var _0x5ce6a9={};_0x5ce6a9[_0x538ada[_0xbba4('0x26')]]={'$like':'%'+_0xf05ce6[_0xbba4('0x31')]['filter']+'%'};return _0x5ce6a9;}})});}_0x3db8df=_[_0xbba4('0x3a')]({},_0x3db8df,_0xf05ce6[_0xbba4('0x3b')]);var _0xd32497={'where':_0x3db8df[_0xbba4('0x38')]};return db[_0xbba4('0x29')][_0xbba4('0x1d')](_0xd32497)[_0xbba4('0x23')](function(_0x29a630){_0x137edb[_0xbba4('0x1d')]=_0x29a630;if(_0xf05ce6[_0xbba4('0x31')][_0xbba4('0x3c')]){_0x3db8df[_0xbba4('0x3d')]=[{'all':!![]}];}return db[_0xbba4('0x29')][_0xbba4('0x3e')](_0x3db8df);})[_0xbba4('0x23')](function(_0xa0bce6){_0x137edb['rows']=_0xa0bce6;return _0x137edb;})['then'](respondWithFilteredResult(_0x5d01a4,_0x3db8df))[_0xbba4('0x3f')](handleError(_0x5d01a4,null));};exports[_0xbba4('0x40')]=function(_0x57ceb1,_0x461740){var _0x42d42e={'raw':!![],'where':{'id':_0x57ceb1[_0xbba4('0x41')]['id']}},_0x1f221a={};_0x1f221a[_0xbba4('0x2d')]=_['keys'](db[_0xbba4('0x29')][_0xbba4('0x42')]);_0x1f221a[_0xbba4('0x31')]=_['keys'](_0x57ceb1[_0xbba4('0x31')]);_0x1f221a[_0xbba4('0x2e')]=_[_0xbba4('0x2f')](_0x1f221a[_0xbba4('0x2d')],_0x1f221a[_0xbba4('0x31')]);_0x42d42e[_0xbba4('0x32')]=_[_0xbba4('0x2f')](_0x1f221a[_0xbba4('0x2d')],qs[_0xbba4('0x30')](_0x57ceb1[_0xbba4('0x31')][_0xbba4('0x30')]));_0x42d42e[_0xbba4('0x32')]=_0x42d42e[_0xbba4('0x32')][_0xbba4('0x43')]?_0x42d42e[_0xbba4('0x32')]:_0x1f221a[_0xbba4('0x2d')];if(_0x57ceb1[_0xbba4('0x31')]['includeAll']){_0x42d42e[_0xbba4('0x3d')]=[{'all':!![]}];}_0x42d42e=_[_0xbba4('0x3a')]({},_0x42d42e,_0x57ceb1[_0xbba4('0x3b')]);return db[_0xbba4('0x29')][_0xbba4('0x44')](_0x42d42e)[_0xbba4('0x23')](handleEntityNotFound(_0x461740,null))[_0xbba4('0x23')](respondWithResult(_0x461740,null))[_0xbba4('0x3f')](handleError(_0x461740,null));};exports[_0xbba4('0x45')]=function(_0x3f6362,_0x2d0ab5){return db[_0xbba4('0x29')][_0xbba4('0x45')](_0x3f6362[_0xbba4('0x46')],{})['then'](respondWithResult(_0x2d0ab5,0xc9))[_0xbba4('0x3f')](handleError(_0x2d0ab5,null));};exports[_0xbba4('0x21')]=function(_0x1d9223,_0x59aaf0){if(_0x1d9223[_0xbba4('0x46')]['id']){delete _0x1d9223[_0xbba4('0x46')]['id'];}return db[_0xbba4('0x29')][_0xbba4('0x44')]({'where':{'id':_0x1d9223[_0xbba4('0x41')]['id']}})[_0xbba4('0x23')](handleEntityNotFound(_0x59aaf0,null))['then'](saveUpdates(_0x1d9223[_0xbba4('0x46')],null))[_0xbba4('0x23')](respondWithResult(_0x59aaf0,null))[_0xbba4('0x3f')](handleError(_0x59aaf0,null));};exports[_0xbba4('0x22')]=function(_0x14d489,_0x2290f1){return db['MailSubstatus']['find']({'where':{'id':_0x14d489[_0xbba4('0x41')]['id']}})[_0xbba4('0x23')](handleEntityNotFound(_0x2290f1,null))[_0xbba4('0x23')](removeEntity(_0x2290f1,null))[_0xbba4('0x3f')](handleError(_0x2290f1,null));};exports['describe']=function(_0x381065,_0x5924cf){return db[_0xbba4('0x29')]['describe']()['then'](respondWithResult(_0x5924cf,null))[_0xbba4('0x3f')](handleError(_0x5924cf,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index d89fc41..28ad347 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 _0xeae4=['hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','update','emit'];(function(_0x5c66fc,_0x353e52){var _0x4c2fd7=function(_0x4c5a8a){while(--_0x4c5a8a){_0x5c66fc['push'](_0x5c66fc['shift']());}};_0x4c2fd7(++_0x353e52);}(_0xeae4,0x1d8));var _0x4eae=function(_0x10eeec,_0x410923){_0x10eeec=_0x10eeec-0x0;var _0x1b5c2c=_0xeae4[_0x10eeec];return _0x1b5c2c;};'use strict';var EventEmitter=require('events');var MailSubstatus=require(_0x4eae('0x0'))['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x4eae('0x1')](0x0);var events={'afterUpdate':_0x4eae('0x2')};function emitEvent(_0x204f6a){return function(_0x46af09,_0x492291,_0x3a22c0){MailSubstatusEvents[_0x4eae('0x3')](_0x204f6a+':'+_0x46af09['id'],_0x46af09);MailSubstatusEvents[_0x4eae('0x3')](_0x204f6a,_0x46af09);_0x3a22c0(null);};}for(var e in events){if(events[_0x4eae('0x4')](e)){var event=events[e];MailSubstatus[_0x4eae('0x5')](e,emitEvent(event));}}module[_0x4eae('0x6')]=MailSubstatusEvents; \ No newline at end of file +var _0x4870=['emit','hasOwnProperty','events','setMaxListeners','update'];(function(_0x27db59,_0x2b0dc1){var _0x5ec247=function(_0x3b19aa){while(--_0x3b19aa){_0x27db59['push'](_0x27db59['shift']());}};_0x5ec247(++_0x2b0dc1);}(_0x4870,0x115));var _0x0487=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x4870[_0x4a9fb1];return _0x348672;};'use strict';var EventEmitter=require(_0x0487('0x0'));var MailSubstatus=require('../../mysqldb')['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x0487('0x1')](0x0);var events={'afterUpdate':_0x0487('0x2')};function emitEvent(_0x316ed4){return function(_0x3e2059,_0x45f69d,_0x554dee){MailSubstatusEvents[_0x0487('0x3')](_0x316ed4+':'+_0x3e2059['id'],_0x3e2059);MailSubstatusEvents[_0x0487('0x3')](_0x316ed4,_0x3e2059);_0x554dee(null);};}for(var e in events){if(events[_0x0487('0x4')](e)){var event=events[e];MailSubstatus['hook'](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 a4f2554..69d6da8 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 _0x0d71=['Condition','update','name','mailSubstatus','_previousDataValues','then','catch','./mailSubstatus.attributes','exports','MailSubstatus'];(function(_0x55d298,_0x4492ce){var _0x320d96=function(_0x19f9b6){while(--_0x19f9b6){_0x55d298['push'](_0x55d298['shift']());}};_0x320d96(++_0x4492ce);}(_0x0d71,0x1a1));var _0x10d7=function(_0x7ce5cc,_0x346fb1){_0x7ce5cc=_0x7ce5cc-0x0;var _0x3ff529=_0x0d71[_0x7ce5cc];return _0x3ff529;};'use strict';var attributes=require(_0x10d7('0x0'));module[_0x10d7('0x1')]=function(_0x5d1a90){var _0x57420e=_0x5d1a90['models'];return _0x5d1a90['define'](_0x10d7('0x2'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x33d680,_0x45dec8,_0x2941fa){return _0x57420e[_0x10d7('0x3')][_0x10d7('0x4')]({'value':_0x33d680[_0x10d7('0x5')]},{'where':{'field':_0x10d7('0x6'),'value':_0x33d680[_0x10d7('0x7')][_0x10d7('0x5')]}})[_0x10d7('0x8')](function(){_0x2941fa();})[_0x10d7('0x9')](function(_0x4141ae){_0x2941fa(_0x4141ae);});}}});}; \ No newline at end of file +var _0x21a6=['./mailSubstatus.attributes','exports','models','define','Condition','update','name','mailSubstatus','_previousDataValues','then'];(function(_0x90f58f,_0x2b6c2d){var _0x126741=function(_0x10f52d){while(--_0x10f52d){_0x90f58f['push'](_0x90f58f['shift']());}};_0x126741(++_0x2b6c2d);}(_0x21a6,0xf0));var _0x621a=function(_0xb7b878,_0x5c3b92){_0xb7b878=_0xb7b878-0x0;var _0x3c84b9=_0x21a6[_0xb7b878];return _0x3c84b9;};'use strict';var attributes=require(_0x621a('0x0'));module[_0x621a('0x1')]=function(_0x434ee0){var _0x5ebb80=_0x434ee0[_0x621a('0x2')];return _0x434ee0[_0x621a('0x3')]('MailSubstatus',attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x4ebe5c,_0x55f7b3,_0x5835b7){return _0x5ebb80[_0x621a('0x4')][_0x621a('0x5')]({'value':_0x4ebe5c[_0x621a('0x6')]},{'where':{'field':_0x621a('0x7'),'value':_0x4ebe5c[_0x621a('0x8')][_0x621a('0x6')]}})[_0x621a('0x9')](function(){_0x5835b7();})['catch'](function(_0x352bf7){_0x5835b7(_0x352bf7);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 6c3a2ce..7e93825 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 _0x495f=['bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailSubstatus,\x20%s,\x20%s','message','result','catch','lodash','util','moment'];(function(_0x332df6,_0x4dd5d9){var _0x264c45=function(_0x57de9e){while(--_0x57de9e){_0x332df6['push'](_0x332df6['shift']());}};_0x264c45(++_0x4dd5d9);}(_0x495f,0x111));var _0xf495=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x495f[_0x18ab2a];return _0x16dcee;};'use strict';var _=require(_0xf495('0x0'));var util=require(_0xf495('0x1'));var moment=require(_0xf495('0x2'));var BPromise=require(_0xf495('0x3'));var rs=require(_0xf495('0x4'));var fs=require('fs');var Redis=require(_0xf495('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf495('0x6'))(_0xf495('0x7'));var config=require(_0xf495('0x8'));var jayson=require(_0xf495('0x9'));var client=jayson[_0xf495('0xa')][_0xf495('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2cc589,_0x2cce5c,_0x467785){return new BPromise(function(_0x2b370b,_0x7e663f){return client['request'](_0x2cc589,_0x467785)['then'](function(_0x2355eb){logger[_0xf495('0xc')]('MailSubstatus,\x20%s,\x20%s',_0x2cce5c,'request\x20sent');logger[_0xf495('0xd')](_0xf495('0xe'),_0x2cce5c,_0xf495('0xf'),JSON[_0xf495('0x10')](_0x2355eb));if(_0x2355eb[_0xf495('0x11')]){if(_0x2355eb[_0xf495('0x11')][_0xf495('0x12')]===0x1f4){logger[_0xf495('0x11')](_0xf495('0x13'),_0x2cce5c,_0x2355eb[_0xf495('0x11')][_0xf495('0x14')]);return _0x7e663f(_0x2355eb[_0xf495('0x11')][_0xf495('0x14')]);}logger[_0xf495('0x11')](_0xf495('0x13'),_0x2cce5c,_0x2355eb[_0xf495('0x11')][_0xf495('0x14')]);return _0x2b370b(_0x2355eb[_0xf495('0x11')][_0xf495('0x14')]);}else{logger[_0xf495('0xc')](_0xf495('0x13'),_0x2cce5c,_0xf495('0xf'));_0x2b370b(_0x2355eb[_0xf495('0x15')][_0xf495('0x14')]);}})[_0xf495('0x16')](function(_0x4f87b1){logger[_0xf495('0x11')](_0xf495('0x13'),_0x2cce5c,_0x4f87b1);_0x7e663f(_0x4f87b1);});});} \ No newline at end of file +var _0xdb31=['rpc','../../config/environment','jayson/promise','MailSubstatus,\x20%s,\x20%s','debug','request\x20sent','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x4cad6d,_0x10f219){var _0x16ab42=function(_0x477e11){while(--_0x477e11){_0x4cad6d['push'](_0x4cad6d['shift']());}};_0x16ab42(++_0x10f219);}(_0xdb31,0x9b));var _0x1db3=function(_0xd5709b,_0x101823){_0xd5709b=_0xd5709b-0x0;var _0x3dc484=_0xdb31[_0xd5709b];return _0x3dc484;};'use strict';var _=require(_0x1db3('0x0'));var util=require(_0x1db3('0x1'));var moment=require(_0x1db3('0x2'));var BPromise=require(_0x1db3('0x3'));var rs=require(_0x1db3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1db3('0x5'))['db'];var utils=require(_0x1db3('0x6'));var logger=require('../../config/logger')(_0x1db3('0x7'));var config=require(_0x1db3('0x8'));var jayson=require(_0x1db3('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x504582,_0x4c6819,_0x5ee635){return new BPromise(function(_0x204f7b,_0x4e7e60){return client['request'](_0x504582,_0x5ee635)['then'](function(_0x54977f){logger['info'](_0x1db3('0xa'),_0x4c6819,'request\x20sent');logger[_0x1db3('0xb')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x4c6819,_0x1db3('0xc'),JSON['stringify'](_0x54977f));if(_0x54977f[_0x1db3('0xd')]){if(_0x54977f[_0x1db3('0xd')]['code']===0x1f4){logger[_0x1db3('0xd')](_0x1db3('0xa'),_0x4c6819,_0x54977f[_0x1db3('0xd')][_0x1db3('0xe')]);return _0x4e7e60(_0x54977f['error'][_0x1db3('0xe')]);}logger['error'](_0x1db3('0xa'),_0x4c6819,_0x54977f[_0x1db3('0xd')]['message']);return _0x204f7b(_0x54977f[_0x1db3('0xd')][_0x1db3('0xe')]);}else{logger[_0x1db3('0xf')](_0x1db3('0xa'),_0x4c6819,_0x1db3('0xc'));_0x204f7b(_0x54977f[_0x1db3('0x10')][_0x1db3('0xe')]);}})[_0x1db3('0x11')](function(_0x39d64c){logger[_0x1db3('0xd')](_0x1db3('0xa'),_0x4c6819,_0x39d64c);_0x4e7e60(_0x39d64c);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 4c7a41f..31376b6 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 _0x8014=['./mailTransferReport.controller','isAuthenticated','get','show','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4c5be3,_0x7747da){var _0x2c9979=function(_0x8d5ec6){while(--_0x8d5ec6){_0x4c5be3['push'](_0x4c5be3['shift']());}};_0x2c9979(++_0x7747da);}(_0x8014,0x161));var _0x4801=function(_0x5a2d95,_0xb362e5){_0x5a2d95=_0x5a2d95-0x0;var _0x2c3986=_0x8014[_0x5a2d95];return _0x2c3986;};'use strict';var multer=require(_0x4801('0x0'));var util=require(_0x4801('0x1'));var path=require(_0x4801('0x2'));var timeout=require(_0x4801('0x3'));var express=require('express');var router=express[_0x4801('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4801('0x5'));var interaction=require(_0x4801('0x6'));var config=require(_0x4801('0x7'));var controller=require(_0x4801('0x8'));router['get']('/',auth[_0x4801('0x9')](),controller['index']);router[_0x4801('0xa')]('/describe',auth[_0x4801('0x9')](),controller['describe']);router[_0x4801('0xa')]('/:id',auth[_0x4801('0x9')](),controller[_0x4801('0xb')]);router['post']('/',auth[_0x4801('0x9')](),controller[_0x4801('0xc')]);router[_0x4801('0xd')](_0x4801('0xe'),auth['isAuthenticated'](),controller[_0x4801('0xf')]);router[_0x4801('0x10')](_0x4801('0xe'),auth['isAuthenticated'](),controller[_0x4801('0x11')]);module[_0x4801('0x12')]=router; \ No newline at end of file +var _0x7bd0=['multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','create','update','exports'];(function(_0x1a7550,_0x1edace){var _0x426e22=function(_0x1c10a1){while(--_0x1c10a1){_0x1a7550['push'](_0x1a7550['shift']());}};_0x426e22(++_0x1edace);}(_0x7bd0,0x143));var _0x07bd=function(_0x580b15,_0x28afa4){_0x580b15=_0x580b15-0x0;var _0x1adb1b=_0x7bd0[_0x580b15];return _0x1adb1b;};'use strict';var multer=require(_0x07bd('0x0'));var util=require(_0x07bd('0x1'));var path=require(_0x07bd('0x2'));var timeout=require(_0x07bd('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x07bd('0x4'));var auth=require(_0x07bd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x07bd('0x6'));var controller=require('./mailTransferReport.controller');router[_0x07bd('0x7')]('/',auth[_0x07bd('0x8')](),controller[_0x07bd('0x9')]);router[_0x07bd('0x7')](_0x07bd('0xa'),auth[_0x07bd('0x8')](),controller[_0x07bd('0xb')]);router['get'](_0x07bd('0xc'),auth[_0x07bd('0x8')](),controller[_0x07bd('0xd')]);router['post']('/',auth[_0x07bd('0x8')](),controller[_0x07bd('0xe')]);router['put'](_0x07bd('0xc'),auth[_0x07bd('0x8')](),controller[_0x07bd('0xf')]);router['delete'](_0x07bd('0xc'),auth[_0x07bd('0x8')](),controller['destroy']);module[_0x07bd('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 061dc38..adab3ca 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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x5c914d,_0x4fa524){var _0x4d1492=function(_0x2ead94){while(--_0x2ead94){_0x5c914d['push'](_0x5c914d['shift']());}};_0x4d1492(++_0x4fa524);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4cce65,_0x40021e){_0x4cce65=_0x4cce65-0x0;var _0x4d1b45=_0xcb91[_0x4cce65];return _0x4d1b45;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file +var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x489aa1,_0x18dcfa){var _0x44745b=function(_0x4f8c44){while(--_0x4f8c44){_0x489aa1['push'](_0x489aa1['shift']());}};_0x44745b(++_0x18dcfa);}(_0xaa88,0x137));var _0x8aa8=function(_0x489b87,_0xd51c93){_0x489b87=_0x489b87-0x0;var _0x1823b6=_0xaa88[_0x489b87];return _0x1823b6;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index ae068ed..6d70afd 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 _0xc6c2=['index','map','MailTransferReport','fieldName','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','merge','where','type','VIRTUAL','options','includeAll','include','catch','params','length','find','body','update','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','save','then','sendStatus','error','stack','name'];(function(_0x4a4d48,_0x3adad){var _0x2ed623=function(_0x51fe2e){while(--_0x51fe2e){_0x4a4d48['push'](_0x4a4d48['shift']());}};_0x2ed623(++_0x3adad);}(_0xc6c2,0x147));var _0x2c6c=function(_0x3a6e4b,_0x118cd9){_0x3a6e4b=_0x3a6e4b-0x0;var _0x36572d=_0xc6c2[_0x3a6e4b];return _0x36572d;};'use strict';var emlformat=require(_0x2c6c('0x0'));var rimraf=require(_0x2c6c('0x1'));var zipdir=require(_0x2c6c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2c6c('0x3'));var moment=require(_0x2c6c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2c6c('0x5'));var util=require(_0x2c6c('0x6'));var path=require(_0x2c6c('0x7'));var sox=require(_0x2c6c('0x8'));var csv=require(_0x2c6c('0x9'));var ejs=require(_0x2c6c('0xa'));var fs=require('fs');var fs_extra=require(_0x2c6c('0xb'));var _=require(_0x2c6c('0xc'));var squel=require(_0x2c6c('0xd'));var crypto=require(_0x2c6c('0xe'));var jsforce=require(_0x2c6c('0xf'));var deskjs=require(_0x2c6c('0x10'));var toCsv=require(_0x2c6c('0x9'));var querystring=require('querystring');var Papa=require(_0x2c6c('0x11'));var Redis=require(_0x2c6c('0x12'));var authService=require(_0x2c6c('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2c6c('0x14'));var hardwareService=require(_0x2c6c('0x15'));var logger=require(_0x2c6c('0x16'))(_0x2c6c('0x17'));var utils=require(_0x2c6c('0x18'));var config=require(_0x2c6c('0x19'));var licenseUtil=require(_0x2c6c('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e4689,_0x17528f){_0x17528f=_0x17528f||0xcc;return function(_0x1378a8){if(_0x1378a8){return _0x1e4689['sendStatus'](_0x17528f);}return _0x1e4689[_0x2c6c('0x1b')](_0x17528f)[_0x2c6c('0x1c')]();};}function respondWithResult(_0x1e2679,_0x5112f5){_0x5112f5=_0x5112f5||0xc8;return function(_0x346aa6){if(_0x346aa6){return _0x1e2679[_0x2c6c('0x1b')](_0x5112f5)['json'](_0x346aa6);}};}function respondWithFilteredResult(_0x555c57,_0x44bb96){return function(_0x52eabc){if(_0x52eabc){var _0x5d96d5=typeof _0x44bb96[_0x2c6c('0x1d')]===_0x2c6c('0x1e')&&typeof _0x44bb96['limit']===_0x2c6c('0x1e');var _0x5b1cbc=_0x52eabc['count'];var _0x361ffb=_0x5d96d5?0x0:_0x44bb96[_0x2c6c('0x1d')];var _0x5629d8=_0x5d96d5?_0x52eabc[_0x2c6c('0x1f')]:_0x44bb96[_0x2c6c('0x1d')]+_0x44bb96[_0x2c6c('0x20')];var _0x5c14fe;if(_0x5629d8>=_0x5b1cbc){_0x5629d8=_0x5b1cbc;_0x5c14fe=0xc8;}else{_0x5c14fe=0xce;}_0x555c57['status'](_0x5c14fe);return _0x555c57['set'](_0x2c6c('0x21'),_0x361ffb+'-'+_0x5629d8+'/'+_0x5b1cbc)[_0x2c6c('0x22')](_0x52eabc);}return null;};}function patchUpdates(_0x283704){return function(_0x3ae38e){try{jsonpatch[_0x2c6c('0x23')](_0x3ae38e,_0x283704,!![]);}catch(_0x538b68){return BPromise[_0x2c6c('0x24')](_0x538b68);}return _0x3ae38e[_0x2c6c('0x25')]();};}function saveUpdates(_0x333167,_0x4e721d){return function(_0x1aee33){if(_0x1aee33){return _0x1aee33['update'](_0x333167)[_0x2c6c('0x26')](function(_0x2de4f5){return _0x2de4f5;});}return null;};}function removeEntity(_0x4ba4cb,_0x1457c4){return function(_0x3f055c){if(_0x3f055c){return _0x3f055c['destroy']()[_0x2c6c('0x26')](function(){_0x4ba4cb['status'](0xcc)[_0x2c6c('0x1c')]();});}};}function handleEntityNotFound(_0x51ce86,_0x1c2e3f){return function(_0x2e84c5){if(!_0x2e84c5){_0x51ce86[_0x2c6c('0x27')](0x194);}return _0x2e84c5;};}function handleError(_0x19d163,_0x171dba){_0x171dba=_0x171dba||0x1f4;return function(_0x154c68){logger[_0x2c6c('0x28')](_0x154c68[_0x2c6c('0x29')]);if(_0x154c68[_0x2c6c('0x2a')]){delete _0x154c68[_0x2c6c('0x2a')];}_0x19d163[_0x2c6c('0x1b')](_0x171dba)['send'](_0x154c68);};}exports[_0x2c6c('0x2b')]=function(_0x8175f0,_0x146d52){var _0xebaf3f={},_0x296a3b={},_0xf543f3={'count':0x0,'rows':[]};var _0x4be8b7=_[_0x2c6c('0x2c')](db[_0x2c6c('0x2d')]['rawAttributes'],function(_0x51ec59){return{'name':_0x51ec59[_0x2c6c('0x2e')],'type':_0x51ec59['type']['key']};});_0x296a3b[_0x2c6c('0x2f')]=_['map'](_0x4be8b7,_0x2c6c('0x2a'));_0x296a3b['query']=_[_0x2c6c('0x30')](_0x8175f0[_0x2c6c('0x31')]);_0x296a3b[_0x2c6c('0x32')]=_[_0x2c6c('0x33')](_0x296a3b['model'],_0x296a3b[_0x2c6c('0x31')]);_0xebaf3f[_0x2c6c('0x34')]=_[_0x2c6c('0x33')](_0x296a3b[_0x2c6c('0x2f')],qs[_0x2c6c('0x35')](_0x8175f0[_0x2c6c('0x31')][_0x2c6c('0x35')]));_0xebaf3f[_0x2c6c('0x34')]=_0xebaf3f[_0x2c6c('0x34')]['length']?_0xebaf3f[_0x2c6c('0x34')]:_0x296a3b[_0x2c6c('0x2f')];if(!_0x8175f0['query'][_0x2c6c('0x36')](_0x2c6c('0x37'))){_0xebaf3f['limit']=qs[_0x2c6c('0x20')](_0x8175f0[_0x2c6c('0x31')][_0x2c6c('0x20')]);_0xebaf3f[_0x2c6c('0x1d')]=qs[_0x2c6c('0x1d')](_0x8175f0[_0x2c6c('0x31')]['offset']);}_0xebaf3f['order']=qs[_0x2c6c('0x38')](_0x8175f0[_0x2c6c('0x31')][_0x2c6c('0x38')]);_0xebaf3f['where']=qs[_0x2c6c('0x32')](_[_0x2c6c('0x39')](_0x8175f0[_0x2c6c('0x31')],_0x296a3b[_0x2c6c('0x32')]),_0x4be8b7);if(_0x8175f0[_0x2c6c('0x31')][_0x2c6c('0x3a')]){_0xebaf3f['where']=_[_0x2c6c('0x3b')](_0xebaf3f[_0x2c6c('0x3c')],{'$or':_[_0x2c6c('0x2c')](_0x4be8b7,function(_0x29ebf6){if(_0x29ebf6[_0x2c6c('0x3d')]!==_0x2c6c('0x3e')){var _0x300a86={};_0x300a86[_0x29ebf6[_0x2c6c('0x2a')]]={'$like':'%'+_0x8175f0[_0x2c6c('0x31')][_0x2c6c('0x3a')]+'%'};return _0x300a86;}})});}_0xebaf3f=_[_0x2c6c('0x3b')]({},_0xebaf3f,_0x8175f0[_0x2c6c('0x3f')]);var _0x27735f={'where':_0xebaf3f['where']};return db[_0x2c6c('0x2d')][_0x2c6c('0x1f')](_0x27735f)[_0x2c6c('0x26')](function(_0x39d4f0){_0xf543f3[_0x2c6c('0x1f')]=_0x39d4f0;if(_0x8175f0[_0x2c6c('0x31')][_0x2c6c('0x40')]){_0xebaf3f[_0x2c6c('0x41')]=[{'all':!![]}];}return db['MailTransferReport']['findAll'](_0xebaf3f);})['then'](function(_0x306d8e){_0xf543f3['rows']=_0x306d8e;return _0xf543f3;})[_0x2c6c('0x26')](respondWithFilteredResult(_0x146d52,_0xebaf3f))[_0x2c6c('0x42')](handleError(_0x146d52,null));};exports['show']=function(_0x49546e,_0xba908){var _0x3bd788={'raw':!![],'where':{'id':_0x49546e[_0x2c6c('0x43')]['id']}},_0x2f493f={};_0x2f493f['model']=_[_0x2c6c('0x30')](db[_0x2c6c('0x2d')]['rawAttributes']);_0x2f493f[_0x2c6c('0x31')]=_[_0x2c6c('0x30')](_0x49546e[_0x2c6c('0x31')]);_0x2f493f['filters']=_[_0x2c6c('0x33')](_0x2f493f[_0x2c6c('0x2f')],_0x2f493f['query']);_0x3bd788[_0x2c6c('0x34')]=_[_0x2c6c('0x33')](_0x2f493f['model'],qs[_0x2c6c('0x35')](_0x49546e['query'][_0x2c6c('0x35')]));_0x3bd788[_0x2c6c('0x34')]=_0x3bd788[_0x2c6c('0x34')][_0x2c6c('0x44')]?_0x3bd788[_0x2c6c('0x34')]:_0x2f493f[_0x2c6c('0x2f')];if(_0x49546e['query']['includeAll']){_0x3bd788[_0x2c6c('0x41')]=[{'all':!![]}];}_0x3bd788=_[_0x2c6c('0x3b')]({},_0x3bd788,_0x49546e[_0x2c6c('0x3f')]);return db[_0x2c6c('0x2d')][_0x2c6c('0x45')](_0x3bd788)[_0x2c6c('0x26')](handleEntityNotFound(_0xba908,null))[_0x2c6c('0x26')](respondWithResult(_0xba908,null))[_0x2c6c('0x42')](handleError(_0xba908,null));};exports['create']=function(_0x270a11,_0x2d8596){return db[_0x2c6c('0x2d')]['create'](_0x270a11[_0x2c6c('0x46')],{})[_0x2c6c('0x26')](respondWithResult(_0x2d8596,0xc9))[_0x2c6c('0x42')](handleError(_0x2d8596,null));};exports[_0x2c6c('0x47')]=function(_0x1ae719,_0x2f20a0){if(_0x1ae719['body']['id']){delete _0x1ae719[_0x2c6c('0x46')]['id'];}return db[_0x2c6c('0x2d')][_0x2c6c('0x45')]({'where':{'id':_0x1ae719[_0x2c6c('0x43')]['id']}})['then'](handleEntityNotFound(_0x2f20a0,null))['then'](saveUpdates(_0x1ae719[_0x2c6c('0x46')],null))[_0x2c6c('0x26')](respondWithResult(_0x2f20a0,null))[_0x2c6c('0x42')](handleError(_0x2f20a0,null));};exports[_0x2c6c('0x48')]=function(_0x3fd8f1,_0x4f7344){return db[_0x2c6c('0x2d')][_0x2c6c('0x45')]({'where':{'id':_0x3fd8f1[_0x2c6c('0x43')]['id']}})[_0x2c6c('0x26')](handleEntityNotFound(_0x4f7344,null))[_0x2c6c('0x26')](removeEntity(_0x4f7344,null))['catch'](handleError(_0x4f7344,null));};exports[_0x2c6c('0x49')]=function(_0x10b478,_0x928e13){return db[_0x2c6c('0x2d')][_0x2c6c('0x49')]()['then'](respondWithResult(_0x928e13,null))[_0x2c6c('0x42')](handleError(_0x928e13,null));}; \ No newline at end of file +var _0x9b58=['type','VIRTUAL','includeAll','include','rows','catch','show','params','options','find','create','body','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','name','index','map','MailTransferReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge'];(function(_0xabebad,_0x3d4d0a){var _0x3ce4e5=function(_0x5a52bf){while(--_0x5a52bf){_0xabebad['push'](_0xabebad['shift']());}};_0x3ce4e5(++_0x3d4d0a);}(_0x9b58,0x13c));var _0x89b5=function(_0x3960bf,_0x5791cc){_0x3960bf=_0x3960bf-0x0;var _0x10ba8b=_0x9b58[_0x3960bf];return _0x10ba8b;};'use strict';var emlformat=require(_0x89b5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x89b5('0x1'));var rp=require(_0x89b5('0x2'));var moment=require('moment');var BPromise=require(_0x89b5('0x3'));var Mustache=require(_0x89b5('0x4'));var util=require(_0x89b5('0x5'));var path=require('path');var sox=require(_0x89b5('0x6'));var csv=require(_0x89b5('0x7'));var ejs=require(_0x89b5('0x8'));var fs=require('fs');var fs_extra=require(_0x89b5('0x9'));var _=require(_0x89b5('0xa'));var squel=require(_0x89b5('0xb'));var crypto=require(_0x89b5('0xc'));var jsforce=require(_0x89b5('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x89b5('0x7'));var querystring=require(_0x89b5('0xe'));var Papa=require(_0x89b5('0xf'));var Redis=require(_0x89b5('0x10'));var authService=require(_0x89b5('0x11'));var qs=require(_0x89b5('0x12'));var as=require(_0x89b5('0x13'));var hardwareService=require(_0x89b5('0x14'));var logger=require(_0x89b5('0x15'))(_0x89b5('0x16'));var utils=require(_0x89b5('0x17'));var config=require(_0x89b5('0x18'));var licenseUtil=require(_0x89b5('0x19'));var db=require(_0x89b5('0x1a'))['db'];function respondWithStatusCode(_0x5e3b93,_0x56160e){_0x56160e=_0x56160e||0xcc;return function(_0xb4934d){if(_0xb4934d){return _0x5e3b93[_0x89b5('0x1b')](_0x56160e);}return _0x5e3b93['status'](_0x56160e)[_0x89b5('0x1c')]();};}function respondWithResult(_0x15582f,_0x41cc6f){_0x41cc6f=_0x41cc6f||0xc8;return function(_0x5d4ff6){if(_0x5d4ff6){return _0x15582f[_0x89b5('0x1d')](_0x41cc6f)[_0x89b5('0x1e')](_0x5d4ff6);}};}function respondWithFilteredResult(_0x5da2c9,_0x2e6070){return function(_0x341ffa){if(_0x341ffa){var _0x433800=typeof _0x2e6070['offset']===_0x89b5('0x1f')&&typeof _0x2e6070[_0x89b5('0x20')]===_0x89b5('0x1f');var _0x8d36f6=_0x341ffa[_0x89b5('0x21')];var _0x14fa46=_0x433800?0x0:_0x2e6070[_0x89b5('0x22')];var _0xf97a8f=_0x433800?_0x341ffa['count']:_0x2e6070[_0x89b5('0x22')]+_0x2e6070[_0x89b5('0x20')];var _0x5a2f3b;if(_0xf97a8f>=_0x8d36f6){_0xf97a8f=_0x8d36f6;_0x5a2f3b=0xc8;}else{_0x5a2f3b=0xce;}_0x5da2c9[_0x89b5('0x1d')](_0x5a2f3b);return _0x5da2c9[_0x89b5('0x23')](_0x89b5('0x24'),_0x14fa46+'-'+_0xf97a8f+'/'+_0x8d36f6)['json'](_0x341ffa);}return null;};}function patchUpdates(_0x1d3355){return function(_0xf7a589){try{jsonpatch[_0x89b5('0x25')](_0xf7a589,_0x1d3355,!![]);}catch(_0x214008){return BPromise[_0x89b5('0x26')](_0x214008);}return _0xf7a589[_0x89b5('0x27')]();};}function saveUpdates(_0x288336,_0x364e0c){return function(_0x4ebf4d){if(_0x4ebf4d){return _0x4ebf4d[_0x89b5('0x28')](_0x288336)['then'](function(_0xe11df4){return _0xe11df4;});}return null;};}function removeEntity(_0x2051ce,_0x5607f6){return function(_0x73e82b){if(_0x73e82b){return _0x73e82b[_0x89b5('0x29')]()[_0x89b5('0x2a')](function(){_0x2051ce[_0x89b5('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c479c,_0x3d570c){return function(_0x5a3104){if(!_0x5a3104){_0x5c479c[_0x89b5('0x1b')](0x194);}return _0x5a3104;};}function handleError(_0x1a4ba0,_0xe8ceff){_0xe8ceff=_0xe8ceff||0x1f4;return function(_0x8f866d){logger[_0x89b5('0x2b')](_0x8f866d['stack']);if(_0x8f866d['name']){delete _0x8f866d[_0x89b5('0x2c')];}_0x1a4ba0[_0x89b5('0x1d')](_0xe8ceff)['send'](_0x8f866d);};}exports[_0x89b5('0x2d')]=function(_0x5221f5,_0x30aa4b){var _0x4b6410={},_0x2b73ca={},_0xf67580={'count':0x0,'rows':[]};var _0x49a61e=_[_0x89b5('0x2e')](db[_0x89b5('0x2f')][_0x89b5('0x30')],function(_0x3c9568){return{'name':_0x3c9568['fieldName'],'type':_0x3c9568['type']['key']};});_0x2b73ca[_0x89b5('0x31')]=_[_0x89b5('0x2e')](_0x49a61e,_0x89b5('0x2c'));_0x2b73ca['query']=_[_0x89b5('0x32')](_0x5221f5[_0x89b5('0x33')]);_0x2b73ca[_0x89b5('0x34')]=_[_0x89b5('0x35')](_0x2b73ca[_0x89b5('0x31')],_0x2b73ca['query']);_0x4b6410[_0x89b5('0x36')]=_[_0x89b5('0x35')](_0x2b73ca[_0x89b5('0x31')],qs['fields'](_0x5221f5[_0x89b5('0x33')][_0x89b5('0x37')]));_0x4b6410['attributes']=_0x4b6410[_0x89b5('0x36')][_0x89b5('0x38')]?_0x4b6410[_0x89b5('0x36')]:_0x2b73ca[_0x89b5('0x31')];if(!_0x5221f5[_0x89b5('0x33')][_0x89b5('0x39')](_0x89b5('0x3a'))){_0x4b6410['limit']=qs[_0x89b5('0x20')](_0x5221f5['query'][_0x89b5('0x20')]);_0x4b6410[_0x89b5('0x22')]=qs[_0x89b5('0x22')](_0x5221f5[_0x89b5('0x33')][_0x89b5('0x22')]);}_0x4b6410[_0x89b5('0x3b')]=qs['sort'](_0x5221f5['query']['sort']);_0x4b6410[_0x89b5('0x3c')]=qs[_0x89b5('0x34')](_[_0x89b5('0x3d')](_0x5221f5[_0x89b5('0x33')],_0x2b73ca[_0x89b5('0x34')]),_0x49a61e);if(_0x5221f5['query'][_0x89b5('0x3e')]){_0x4b6410[_0x89b5('0x3c')]=_[_0x89b5('0x3f')](_0x4b6410['where'],{'$or':_[_0x89b5('0x2e')](_0x49a61e,function(_0x556009){if(_0x556009[_0x89b5('0x40')]!==_0x89b5('0x41')){var _0x2ee7c8={};_0x2ee7c8[_0x556009[_0x89b5('0x2c')]]={'$like':'%'+_0x5221f5[_0x89b5('0x33')][_0x89b5('0x3e')]+'%'};return _0x2ee7c8;}})});}_0x4b6410=_['merge']({},_0x4b6410,_0x5221f5['options']);var _0x273637={'where':_0x4b6410['where']};return db['MailTransferReport'][_0x89b5('0x21')](_0x273637)[_0x89b5('0x2a')](function(_0x1d9648){_0xf67580[_0x89b5('0x21')]=_0x1d9648;if(_0x5221f5['query'][_0x89b5('0x42')]){_0x4b6410[_0x89b5('0x43')]=[{'all':!![]}];}return db[_0x89b5('0x2f')]['findAll'](_0x4b6410);})[_0x89b5('0x2a')](function(_0xc7da9e){_0xf67580[_0x89b5('0x44')]=_0xc7da9e;return _0xf67580;})[_0x89b5('0x2a')](respondWithFilteredResult(_0x30aa4b,_0x4b6410))[_0x89b5('0x45')](handleError(_0x30aa4b,null));};exports[_0x89b5('0x46')]=function(_0x5e818f,_0x513e93){var _0x2f08e9={'raw':!![],'where':{'id':_0x5e818f[_0x89b5('0x47')]['id']}},_0x1546c3={};_0x1546c3[_0x89b5('0x31')]=_[_0x89b5('0x32')](db['MailTransferReport'][_0x89b5('0x30')]);_0x1546c3[_0x89b5('0x33')]=_[_0x89b5('0x32')](_0x5e818f[_0x89b5('0x33')]);_0x1546c3[_0x89b5('0x34')]=_[_0x89b5('0x35')](_0x1546c3['model'],_0x1546c3[_0x89b5('0x33')]);_0x2f08e9['attributes']=_[_0x89b5('0x35')](_0x1546c3['model'],qs[_0x89b5('0x37')](_0x5e818f['query'][_0x89b5('0x37')]));_0x2f08e9[_0x89b5('0x36')]=_0x2f08e9['attributes'][_0x89b5('0x38')]?_0x2f08e9['attributes']:_0x1546c3[_0x89b5('0x31')];if(_0x5e818f[_0x89b5('0x33')]['includeAll']){_0x2f08e9['include']=[{'all':!![]}];}_0x2f08e9=_[_0x89b5('0x3f')]({},_0x2f08e9,_0x5e818f[_0x89b5('0x48')]);return db[_0x89b5('0x2f')][_0x89b5('0x49')](_0x2f08e9)[_0x89b5('0x2a')](handleEntityNotFound(_0x513e93,null))['then'](respondWithResult(_0x513e93,null))[_0x89b5('0x45')](handleError(_0x513e93,null));};exports[_0x89b5('0x4a')]=function(_0x460027,_0x26b882){return db['MailTransferReport'][_0x89b5('0x4a')](_0x460027['body'],{})['then'](respondWithResult(_0x26b882,0xc9))[_0x89b5('0x45')](handleError(_0x26b882,null));};exports[_0x89b5('0x28')]=function(_0x3e93b0,_0x5c9996){if(_0x3e93b0[_0x89b5('0x4b')]['id']){delete _0x3e93b0[_0x89b5('0x4b')]['id'];}return db[_0x89b5('0x2f')][_0x89b5('0x49')]({'where':{'id':_0x3e93b0[_0x89b5('0x47')]['id']}})['then'](handleEntityNotFound(_0x5c9996,null))['then'](saveUpdates(_0x3e93b0[_0x89b5('0x4b')],null))[_0x89b5('0x2a')](respondWithResult(_0x5c9996,null))['catch'](handleError(_0x5c9996,null));};exports['destroy']=function(_0x5b1bd7,_0x2cdf58){return db['MailTransferReport']['find']({'where':{'id':_0x5b1bd7['params']['id']}})['then'](handleEntityNotFound(_0x2cdf58,null))[_0x89b5('0x2a')](removeEntity(_0x2cdf58,null))[_0x89b5('0x45')](handleError(_0x2cdf58,null));};exports['describe']=function(_0x41ce48,_0x8f1905){return db[_0x89b5('0x2f')]['describe']()['then'](respondWithResult(_0x8f1905,null))[_0x89b5('0x45')](handleError(_0x8f1905,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 73bbb25..4788a5c 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 _0xf15e=['MailTransferReport','report_mail_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./mailTransferReport.attributes','exports','define'];(function(_0x25aaaf,_0x1d2c78){var _0x4a8b96=function(_0x1c0eb){while(--_0x1c0eb){_0x25aaaf['push'](_0x25aaaf['shift']());}};_0x4a8b96(++_0x1d2c78);}(_0xf15e,0xb9));var _0xef15=function(_0x2b4b57,_0x558363){_0x2b4b57=_0x2b4b57-0x0;var _0x42dd14=_0xf15e[_0x2b4b57];return _0x42dd14;};'use strict';var _=require(_0xef15('0x0'));var util=require('util');var logger=require(_0xef15('0x1'))(_0xef15('0x2'));var moment=require(_0xef15('0x3'));var BPromise=require(_0xef15('0x4'));var rp=require(_0xef15('0x5'));var fs=require('fs');var path=require(_0xef15('0x6'));var rimraf=require('rimraf');var config=require(_0xef15('0x7'));var attributes=require(_0xef15('0x8'));module[_0xef15('0x9')]=function(_0x177b89,_0x58d919){return _0x177b89[_0xef15('0xa')](_0xef15('0xb'),attributes,{'tableName':_0xef15('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xef15('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3248=['util','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MailTransferReport','report_mail_transfer','uniqueid'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3248,0x1bc));var _0x8324=function(_0x120241,_0x388203){_0x120241=_0x120241-0x0;var _0x8d49c=_0x3248[_0x120241];return _0x8d49c;};'use strict';var _=require('lodash');var util=require(_0x8324('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x8324('0x1'));var BPromise=require(_0x8324('0x2'));var rp=require(_0x8324('0x3'));var fs=require('fs');var path=require(_0x8324('0x4'));var rimraf=require(_0x8324('0x5'));var config=require(_0x8324('0x6'));var attributes=require('./mailTransferReport.attributes');module[_0x8324('0x7')]=function(_0x1c5c2a,_0x5157f4){return _0x1c5c2a[_0x8324('0x8')](_0x8324('0x9'),attributes,{'tableName':_0x8324('0xa'),'paranoid':![],'indexes':[{'name':_0x8324('0xb'),'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 2449bb4..27860b2 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 _0xefa2=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailTransferReport,\x20%s,\x20%s','result','catch','lodash','randomstring','ioredis'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0xefa2,0x123));var _0x2efa=function(_0x3fffb3,_0x202e38){_0x3fffb3=_0x3fffb3-0x0;var _0xb587b=_0xefa2[_0x3fffb3];return _0xb587b;};'use strict';var _=require(_0x2efa('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2efa('0x1'));var fs=require('fs');var Redis=require(_0x2efa('0x2'));var db=require(_0x2efa('0x3'))['db'];var utils=require(_0x2efa('0x4'));var logger=require('../../config/logger')(_0x2efa('0x5'));var config=require('../../config/environment');var jayson=require(_0x2efa('0x6'));var client=jayson[_0x2efa('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b278b,_0x56ee81,_0x39e952){return new BPromise(function(_0x18d85f,_0x11b97c){return client[_0x2efa('0x8')](_0x5b278b,_0x39e952)[_0x2efa('0x9')](function(_0x54130b){logger[_0x2efa('0xa')]('MailTransferReport,\x20%s,\x20%s',_0x56ee81,_0x2efa('0xb'));logger[_0x2efa('0xc')](_0x2efa('0xd'),_0x56ee81,_0x2efa('0xb'),JSON[_0x2efa('0xe')](_0x54130b));if(_0x54130b[_0x2efa('0xf')]){if(_0x54130b[_0x2efa('0xf')][_0x2efa('0x10')]===0x1f4){logger[_0x2efa('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x56ee81,_0x54130b[_0x2efa('0xf')][_0x2efa('0x11')]);return _0x11b97c(_0x54130b['error'][_0x2efa('0x11')]);}logger['error'](_0x2efa('0x12'),_0x56ee81,_0x54130b[_0x2efa('0xf')][_0x2efa('0x11')]);return _0x18d85f(_0x54130b[_0x2efa('0xf')][_0x2efa('0x11')]);}else{logger[_0x2efa('0xa')](_0x2efa('0x12'),_0x56ee81,'request\x20sent');_0x18d85f(_0x54130b[_0x2efa('0x13')]['message']);}})[_0x2efa('0x14')](function(_0x25dd59){logger[_0x2efa('0xf')](_0x2efa('0x12'),_0x56ee81,_0x25dd59);_0x11b97c(_0x25dd59);});});} \ No newline at end of file +var _0x8498=['error','code','message','result','catch','MailTransferReport,\x20%s,\x20%s','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','request','then','info','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5f1f6c,_0x36be19){var _0x5562f2=function(_0x4079d7){while(--_0x4079d7){_0x5f1f6c['push'](_0x5f1f6c['shift']());}};_0x5562f2(++_0x36be19);}(_0x8498,0x84));var _0x8849=function(_0x1b4cf1,_0x58164e){_0x1b4cf1=_0x1b4cf1-0x0;var _0x5a3dac=_0x8498[_0x1b4cf1];return _0x5a3dac;};'use strict';var _=require(_0x8849('0x0'));var util=require('util');var moment=require(_0x8849('0x1'));var BPromise=require(_0x8849('0x2'));var rs=require(_0x8849('0x3'));var fs=require('fs');var Redis=require(_0x8849('0x4'));var db=require(_0x8849('0x5'))['db'];var utils=require(_0x8849('0x6'));var logger=require(_0x8849('0x7'))('rpc');var config=require(_0x8849('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x463022,_0x4f0e05,_0x4c678a){return new BPromise(function(_0x4d88fd,_0xdb4505){return client[_0x8849('0x9')](_0x463022,_0x4c678a)[_0x8849('0xa')](function(_0x49acb3){logger[_0x8849('0xb')]('MailTransferReport,\x20%s,\x20%s',_0x4f0e05,_0x8849('0xc'));logger['debug'](_0x8849('0xd'),_0x4f0e05,_0x8849('0xc'),JSON[_0x8849('0xe')](_0x49acb3));if(_0x49acb3[_0x8849('0xf')]){if(_0x49acb3['error'][_0x8849('0x10')]===0x1f4){logger[_0x8849('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x4f0e05,_0x49acb3[_0x8849('0xf')]['message']);return _0xdb4505(_0x49acb3['error'][_0x8849('0x11')]);}logger[_0x8849('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x4f0e05,_0x49acb3[_0x8849('0xf')]['message']);return _0x4d88fd(_0x49acb3['error']['message']);}else{logger['info']('MailTransferReport,\x20%s,\x20%s',_0x4f0e05,_0x8849('0xc'));_0x4d88fd(_0x49acb3[_0x8849('0x12')][_0x8849('0x11')]);}})[_0x8849('0x13')](function(_0x302df2){logger[_0x8849('0xf')](_0x8849('0x14'),_0x4f0e05,_0x302df2);_0xdb4505(_0x302df2);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index a385f16..b6f769f 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 _0x433b=['/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/interaction/service','./memberReport.controller','get','isAuthenticated','index','/describe'];(function(_0x345ac6,_0x43a5de){var _0x4c6fe6=function(_0x433e61){while(--_0x433e61){_0x345ac6['push'](_0x345ac6['shift']());}};_0x4c6fe6(++_0x43a5de);}(_0x433b,0x185));var _0xb433=function(_0x431807,_0x187385){_0x431807=_0x431807-0x0;var _0x51d062=_0x433b[_0x431807];return _0x51d062;};'use strict';var multer=require('multer');var util=require(_0xb433('0x0'));var path=require(_0xb433('0x1'));var timeout=require(_0xb433('0x2'));var express=require('express');var router=express[_0xb433('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb433('0x4'));var config=require('../../config/environment');var controller=require(_0xb433('0x5'));router[_0xb433('0x6')]('/',auth[_0xb433('0x7')](),controller[_0xb433('0x8')]);router['get'](_0xb433('0x9'),auth[_0xb433('0x7')](),controller['describe']);router[_0xb433('0x6')](_0xb433('0xa'),auth[_0xb433('0x7')](),controller[_0xb433('0xb')]);router[_0xb433('0xc')]('/',auth[_0xb433('0x7')](),controller[_0xb433('0xd')]);router[_0xb433('0xe')]('/:id',auth[_0xb433('0x7')](),controller[_0xb433('0xf')]);router[_0xb433('0x10')](_0xb433('0xa'),auth[_0xb433('0x7')](),controller[_0xb433('0x11')]);module[_0xb433('0x12')]=router; \ No newline at end of file +var _0xa828=['/:id','show','post','delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe'];(function(_0x36fe1e,_0x175199){var _0x3368ef=function(_0x74679f){while(--_0x74679f){_0x36fe1e['push'](_0x36fe1e['shift']());}};_0x3368ef(++_0x175199);}(_0xa828,0x1bf));var _0x8a82=function(_0x3902e5,_0x1a20dd){_0x3902e5=_0x3902e5-0x0;var _0x3cd7f4=_0xa828[_0x3902e5];return _0x3cd7f4;};'use strict';var multer=require(_0x8a82('0x0'));var util=require(_0x8a82('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8a82('0x2'));var router=express[_0x8a82('0x3')]();var fs_extra=require(_0x8a82('0x4'));var auth=require(_0x8a82('0x5'));var interaction=require(_0x8a82('0x6'));var config=require(_0x8a82('0x7'));var controller=require('./memberReport.controller');router[_0x8a82('0x8')]('/',auth[_0x8a82('0x9')](),controller['index']);router[_0x8a82('0x8')](_0x8a82('0xa'),auth[_0x8a82('0x9')](),controller[_0x8a82('0xb')]);router[_0x8a82('0x8')](_0x8a82('0xc'),auth['isAuthenticated'](),controller[_0x8a82('0xd')]);router[_0x8a82('0xe')]('/',auth[_0x8a82('0x9')](),controller['create']);router['put'](_0x8a82('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x8a82('0xf')](_0x8a82('0xc'),auth[_0x8a82('0x9')](),controller['destroy']);module[_0x8a82('0x10')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 1e634ce..08e0731 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 _0xae0d=['talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[dial\x20string]','talk:[queue]','INTEGER','sequelize','exports','STRING','DEFAULT\x20PAUSE','DATE','enterAt','diff','seconds','exitAt','setDataValue','duration'];(function(_0x85d5a8,_0x1977be){var _0x20479b=function(_0x125248){while(--_0x125248){_0x85d5a8['push'](_0x85d5a8['shift']());}};_0x20479b(++_0x1977be);}(_0xae0d,0x16c));var _0xdae0=function(_0x56da9c,_0x2af28e){_0x56da9c=_0x56da9c-0x0;var _0x1c11b5=_0xae0d[_0x56da9c];return _0x1c11b5;};'use strict';var Sequelize=require(_0xdae0('0x0'));var moment=require('moment');module[_0xdae0('0x1')]={'channel':{'type':Sequelize[_0xdae0('0x2')]},'membername':{'type':Sequelize[_0xdae0('0x2')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xdae0('0x2')],'defaultValue':_0xdae0('0x3'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0xdae0('0x4')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x120464){var _0x1fb44e=moment(_0x120464);var _0xa61d7e=moment(this['getDataValue'](_0xdae0('0x5')));var _0x2a5f14=_0x1fb44e[_0xdae0('0x6')](_0xa61d7e,_0xdae0('0x7'));this['setDataValue'](_0xdae0('0x8'),_0x120464);this[_0xdae0('0x9')](_0xdae0('0xa'),_0x2a5f14>=0x0?_0x2a5f14:null);}},'data1':{'type':Sequelize[_0xdae0('0x2')],'comment':_0xdae0('0xb')},'data2':{'type':Sequelize[_0xdae0('0x2')],'comment':'talk:[start]'},'data3':{'type':Sequelize['STRING'],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0xdae0('0x2')],'comment':_0xdae0('0xc')},'data5':{'type':Sequelize[_0xdae0('0x2')],'comment':_0xdae0('0xd')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0xdae0('0xe')]},'uniqueid':{'type':Sequelize[_0xdae0('0x2')]}}; \ No newline at end of file +var _0x0c6b=['talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','talk:[inbound,\x20outbound],\x20pause:[reason]'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x0c6b,0x190));var _0xb0c6=function(_0x5e9a9f,_0x1a7164){_0x5e9a9f=_0x5e9a9f-0x0;var _0x398ffa=_0x0c6b[_0x5e9a9f];return _0x398ffa;};'use strict';var Sequelize=require(_0xb0c6('0x0'));var moment=require(_0xb0c6('0x1'));module[_0xb0c6('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xb0c6('0x3')]},'type':{'type':Sequelize[_0xb0c6('0x3')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0xb0c6('0x4')},'duration':{'type':Sequelize[_0xb0c6('0x5')]},'enterAt':{'type':Sequelize[_0xb0c6('0x6')]},'exitAt':{'type':Sequelize[_0xb0c6('0x6')],'set':function(_0x133a24){var _0x365f11=moment(_0x133a24);var _0x5db709=moment(this[_0xb0c6('0x7')](_0xb0c6('0x8')));var _0x19497b=_0x365f11[_0xb0c6('0x9')](_0x5db709,_0xb0c6('0xa'));this[_0xb0c6('0xb')](_0xb0c6('0xc'),_0x133a24);this[_0xb0c6('0xb')]('duration',_0x19497b>=0x0?_0x19497b:null);}},'data1':{'type':Sequelize[_0xb0c6('0x3')],'comment':_0xb0c6('0xd')},'data2':{'type':Sequelize['STRING'],'comment':_0xb0c6('0xe')},'data3':{'type':Sequelize['STRING'],'comment':_0xb0c6('0xf')},'data4':{'type':Sequelize['STRING'],'comment':_0xb0c6('0x10')},'data5':{'type':Sequelize[_0xb0c6('0x3')],'comment':_0xb0c6('0x11')},'role':{'type':Sequelize[_0xb0c6('0x3')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xb0c6('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index b36c120..8aeee54 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 _0x3e74=['show','params','options','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count','status','set','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows'];(function(_0x4109e1,_0x57aa37){var _0x2f33c6=function(_0xc98a59){while(--_0xc98a59){_0x4109e1['push'](_0x4109e1['shift']());}};_0x2f33c6(++_0x57aa37);}(_0x3e74,0x175));var _0x43e7=function(_0x2ffd0d,_0x4b0415){_0x2ffd0d=_0x2ffd0d-0x0;var _0x58078c=_0x3e74[_0x2ffd0d];return _0x58078c;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){_0x454359['status'](0xcc)[_0x43e7('0x15')]();});}};}function handleEntityNotFound(_0x4ca5cf,_0x326dab){return function(_0x5c5e67){if(!_0x5c5e67){_0x4ca5cf[_0x43e7('0x23')](0x194);}return _0x5c5e67;};}function handleError(_0x1b5f50,_0x20888b){_0x20888b=_0x20888b||0x1f4;return function(_0x405f85){logger['error'](_0x405f85['stack']);if(_0x405f85[_0x43e7('0x24')]){delete _0x405f85['name'];}_0x1b5f50[_0x43e7('0x1b')](_0x20888b)[_0x43e7('0x25')](_0x405f85);};}exports[_0x43e7('0x26')]=function(_0xb1fc63,_0x5087d7){var _0x33a1a5={},_0x4690a6={},_0x45b675={'count':0x0,'rows':[]};var _0x50f9f5=_[_0x43e7('0x27')](db[_0x43e7('0x28')][_0x43e7('0x29')],function(_0x31b2a6){return{'name':_0x31b2a6[_0x43e7('0x2a')],'type':_0x31b2a6[_0x43e7('0x2b')][_0x43e7('0x2c')]};});_0x4690a6[_0x43e7('0x2d')]=_[_0x43e7('0x27')](_0x50f9f5,_0x43e7('0x24'));_0x4690a6['query']=_[_0x43e7('0x2e')](_0xb1fc63[_0x43e7('0x2f')]);_0x4690a6[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],_0x4690a6['query']);_0x33a1a5[_0x43e7('0x32')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],qs[_0x43e7('0x33')](_0xb1fc63['query']['fields']));_0x33a1a5['attributes']=_0x33a1a5[_0x43e7('0x32')][_0x43e7('0x34')]?_0x33a1a5[_0x43e7('0x32')]:_0x4690a6[_0x43e7('0x2d')];if(!_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x35')]('nolimit')){_0x33a1a5['limit']=qs['limit'](_0xb1fc63['query']['limit']);_0x33a1a5['offset']=qs['offset'](_0xb1fc63[_0x43e7('0x2f')]['offset']);}_0x33a1a5[_0x43e7('0x36')]=qs[_0x43e7('0x37')](_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x37')]);_0x33a1a5[_0x43e7('0x38')]=qs[_0x43e7('0x30')](_[_0x43e7('0x39')](_0xb1fc63['query'],_0x4690a6['filters']),_0x50f9f5);if(_0xb1fc63['query'][_0x43e7('0x3a')]){_0x33a1a5[_0x43e7('0x38')]=_[_0x43e7('0x3b')](_0x33a1a5[_0x43e7('0x38')],{'$or':_[_0x43e7('0x27')](_0x50f9f5,function(_0x1ed538){if(_0x1ed538[_0x43e7('0x2b')]!==_0x43e7('0x3c')){var _0x55c798={};_0x55c798[_0x1ed538[_0x43e7('0x24')]]={'$like':'%'+_0xb1fc63[_0x43e7('0x2f')]['filter']+'%'};return _0x55c798;}})});}_0x33a1a5=_[_0x43e7('0x3b')]({},_0x33a1a5,_0xb1fc63['options']);var _0x44d8e4={'where':_0x33a1a5[_0x43e7('0x38')]};return db[_0x43e7('0x28')][_0x43e7('0x1a')](_0x44d8e4)[_0x43e7('0x21')](function(_0x234d8f){_0x45b675['count']=_0x234d8f;if(_0xb1fc63['query'][_0x43e7('0x3d')]){_0x33a1a5[_0x43e7('0x3e')]=[{'all':!![]}];}return db[_0x43e7('0x28')][_0x43e7('0x3f')](_0x33a1a5);})[_0x43e7('0x21')](function(_0x4a4a85){_0x45b675[_0x43e7('0x40')]=_0x4a4a85;return _0x45b675;})[_0x43e7('0x21')](respondWithFilteredResult(_0x5087d7,_0x33a1a5))['catch'](handleError(_0x5087d7,null));};exports[_0x43e7('0x41')]=function(_0x51a69c,_0x2ad8ef){var _0x504101={'raw':!![],'where':{'id':_0x51a69c[_0x43e7('0x42')]['id']}},_0x3d81ae={};_0x3d81ae[_0x43e7('0x2d')]=_[_0x43e7('0x2e')](db['MemberReport']['rawAttributes']);_0x3d81ae[_0x43e7('0x2f')]=_[_0x43e7('0x2e')](_0x51a69c[_0x43e7('0x2f')]);_0x3d81ae[_0x43e7('0x30')]=_['intersection'](_0x3d81ae['model'],_0x3d81ae['query']);_0x504101[_0x43e7('0x32')]=_['intersection'](_0x3d81ae[_0x43e7('0x2d')],qs['fields'](_0x51a69c['query'][_0x43e7('0x33')]));_0x504101['attributes']=_0x504101[_0x43e7('0x32')][_0x43e7('0x34')]?_0x504101[_0x43e7('0x32')]:_0x3d81ae[_0x43e7('0x2d')];if(_0x51a69c['query'][_0x43e7('0x3d')]){_0x504101[_0x43e7('0x3e')]=[{'all':!![]}];}_0x504101=_[_0x43e7('0x3b')]({},_0x504101,_0x51a69c[_0x43e7('0x43')]);return db[_0x43e7('0x28')][_0x43e7('0x44')](_0x504101)['then'](handleEntityNotFound(_0x2ad8ef,null))['then'](respondWithResult(_0x2ad8ef,null))[_0x43e7('0x45')](handleError(_0x2ad8ef,null));};exports[_0x43e7('0x46')]=function(_0x212841,_0x4c00a8){return db['MemberReport']['create'](_0x212841[_0x43e7('0x47')],{})[_0x43e7('0x21')](respondWithResult(_0x4c00a8,0xc9))['catch'](handleError(_0x4c00a8,null));};exports[_0x43e7('0x20')]=function(_0x47686e,_0x3c96fe){if(_0x47686e['body']['id']){delete _0x47686e['body']['id'];}return db['MemberReport']['find']({'where':{'id':_0x47686e[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x3c96fe,null))['then'](saveUpdates(_0x47686e[_0x43e7('0x47')],null))[_0x43e7('0x21')](respondWithResult(_0x3c96fe,null))[_0x43e7('0x45')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x22')]=function(_0x4a0ce5,_0x2718d5){return db['MemberReport']['find']({'where':{'id':_0x4a0ce5[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x2718d5,null))[_0x43e7('0x21')](removeEntity(_0x2718d5,null))[_0x43e7('0x45')](handleError(_0x2718d5,null));};exports[_0x43e7('0x48')]=function(_0x2351cf,_0x1cd87c){return db[_0x43e7('0x28')][_0x43e7('0x48')]()[_0x43e7('0x21')](respondWithResult(_0x1cd87c,null))['catch'](handleError(_0x1cd87c,null));}; \ No newline at end of file +var _0x9c44=['catch','params','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','MemberReport','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows'];(function(_0x3208ee,_0x2669d1){var _0x38c9e5=function(_0x4f732a){while(--_0x4f732a){_0x3208ee['push'](_0x3208ee['shift']());}};_0x38c9e5(++_0x2669d1);}(_0x9c44,0x178));var _0x49c4=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x9c44[_0x334841];return _0x5beb4b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={},_0x46e04d={},_0x4f28a2={'count':0x0,'rows':[]};var _0x6329b3=_[_0x49c4('0x29')](db[_0x49c4('0x2a')][_0x49c4('0x2b')],function(_0x17b50f){return{'name':_0x17b50f[_0x49c4('0x2c')],'type':_0x17b50f[_0x49c4('0x2d')]['key']};});_0x46e04d['model']=_['map'](_0x6329b3,_0x49c4('0x26'));_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d[_0x49c4('0x30')]=_['intersection'](_0x46e04d[_0x49c4('0x31')],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x46e04d['model'],qs['fields'](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x2b2793[_0x49c4('0x32')]=_0x2b2793[_0x49c4('0x32')][_0x49c4('0x35')]?_0x2b2793['attributes']:_0x46e04d[_0x49c4('0x31')];if(!_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x36')]('nolimit')){_0x2b2793['limit']=qs[_0x49c4('0x1b')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x1b')]);_0x2b2793[_0x49c4('0x19')]=qs[_0x49c4('0x19')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x19')]);}_0x2b2793[_0x49c4('0x37')]=qs[_0x49c4('0x38')](_0x5987ae['query'][_0x49c4('0x38')]);_0x2b2793['where']=qs[_0x49c4('0x30')](_[_0x49c4('0x39')](_0x5987ae[_0x49c4('0x2e')],_0x46e04d[_0x49c4('0x30')]),_0x6329b3);if(_0x5987ae['query'][_0x49c4('0x3a')]){_0x2b2793[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2b2793['where'],{'$or':_[_0x49c4('0x29')](_0x6329b3,function(_0x21d8c7){if(_0x21d8c7[_0x49c4('0x2d')]!==_0x49c4('0x3d')){var _0x1ba7a0={};_0x1ba7a0[_0x21d8c7[_0x49c4('0x26')]]={'$like':'%'+_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x3a')]+'%'};return _0x1ba7a0;}})});}_0x2b2793=_[_0x49c4('0x3c')]({},_0x2b2793,_0x5987ae[_0x49c4('0x3e')]);var _0x1e506a={'where':_0x2b2793['where']};return db[_0x49c4('0x2a')][_0x49c4('0x1c')](_0x1e506a)[_0x49c4('0x3f')](function(_0x23aa32){_0x4f28a2[_0x49c4('0x1c')]=_0x23aa32;if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x2b2793[_0x49c4('0x41')]=[{'all':!![]}];}return db[_0x49c4('0x2a')][_0x49c4('0x42')](_0x2b2793);})[_0x49c4('0x3f')](function(_0xa3d59e){_0x4f28a2[_0x49c4('0x43')]=_0xa3d59e;return _0x4f28a2;})['then'](respondWithFilteredResult(_0x889909,_0x2b2793))[_0x49c4('0x44')](handleError(_0x889909,null));};exports['show']=function(_0x104efb,_0x4915bc){var _0x28d4fb={'raw':!![],'where':{'id':_0x104efb[_0x49c4('0x45')]['id']}},_0x1480da={};_0x1480da[_0x49c4('0x31')]=_['keys'](db['MemberReport'][_0x49c4('0x2b')]);_0x1480da[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x104efb[_0x49c4('0x2e')]);_0x1480da['filters']=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],_0x1480da[_0x49c4('0x2e')]);_0x28d4fb[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],qs[_0x49c4('0x34')](_0x104efb[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x28d4fb['attributes']=_0x28d4fb[_0x49c4('0x32')]['length']?_0x28d4fb[_0x49c4('0x32')]:_0x1480da[_0x49c4('0x31')];if(_0x104efb[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x28d4fb[_0x49c4('0x41')]=[{'all':!![]}];}_0x28d4fb=_['merge']({},_0x28d4fb,_0x104efb[_0x49c4('0x3e')]);return db[_0x49c4('0x2a')][_0x49c4('0x46')](_0x28d4fb)[_0x49c4('0x3f')](handleEntityNotFound(_0x4915bc,null))[_0x49c4('0x3f')](respondWithResult(_0x4915bc,null))[_0x49c4('0x44')](handleError(_0x4915bc,null));};exports[_0x49c4('0x47')]=function(_0x4d89e0,_0x3bac1b){return db['MemberReport'][_0x49c4('0x47')](_0x4d89e0[_0x49c4('0x48')],{})[_0x49c4('0x3f')](respondWithResult(_0x3bac1b,0xc9))[_0x49c4('0x44')](handleError(_0x3bac1b,null));};exports[_0x49c4('0x22')]=function(_0x30bea5,_0x2c6be1){if(_0x30bea5['body']['id']){delete _0x30bea5[_0x49c4('0x48')]['id'];}return db[_0x49c4('0x2a')]['find']({'where':{'id':_0x30bea5[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x2c6be1,null))[_0x49c4('0x3f')](saveUpdates(_0x30bea5[_0x49c4('0x48')],null))['then'](respondWithResult(_0x2c6be1,null))['catch'](handleError(_0x2c6be1,null));};exports[_0x49c4('0x23')]=function(_0x4e8221,_0x4597c3){return db[_0x49c4('0x2a')][_0x49c4('0x46')]({'where':{'id':_0x4e8221[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x4597c3,null))[_0x49c4('0x3f')](removeEntity(_0x4597c3,null))[_0x49c4('0x44')](handleError(_0x4597c3,null));};exports['describe']=function(_0x1f26c2,_0x1550ce){return db[_0x49c4('0x2a')][_0x49c4('0x49')]()[_0x49c4('0x3f')](respondWithResult(_0x1550ce,null))[_0x49c4('0x44')](handleError(_0x1550ce,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index d712c10..9c17dbd 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 _0x9de8=['MemberReport','membername_interface','membername','interface','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','exports'];(function(_0x41c580,_0x1784b1){var _0x55ae0f=function(_0x33f72a){while(--_0x33f72a){_0x41c580['push'](_0x41c580['shift']());}};_0x55ae0f(++_0x1784b1);}(_0x9de8,0x88));var _0x89de=function(_0x5b0a81,_0x1000f3){_0x5b0a81=_0x5b0a81-0x0;var _0x127e6e=_0x9de8[_0x5b0a81];return _0x127e6e;};'use strict';var _=require(_0x89de('0x0'));var util=require('util');var logger=require(_0x89de('0x1'))(_0x89de('0x2'));var moment=require('moment');var BPromise=require(_0x89de('0x3'));var rp=require(_0x89de('0x4'));var fs=require('fs');var path=require(_0x89de('0x5'));var rimraf=require(_0x89de('0x6'));var config=require('../../config/environment');var attributes=require('./memberReport.attributes');module[_0x89de('0x7')]=function(_0x5247ae,_0x510e1a){return _0x5247ae['define'](_0x89de('0x8'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x89de('0x9'),'fields':[_0x89de('0xa'),_0x89de('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x048f=['exports','define','MemberReport','report_member','membername_interface','membername','interface','lodash','util','api','bluebird','request-promise','rimraf','./memberReport.attributes'];(function(_0x12cdee,_0x546dba){var _0x5840fd=function(_0x2182dd){while(--_0x2182dd){_0x12cdee['push'](_0x12cdee['shift']());}};_0x5840fd(++_0x546dba);}(_0x048f,0x1c7));var _0xf048=function(_0x2b81dc,_0x19be46){_0x2b81dc=_0x2b81dc-0x0;var _0x327f13=_0x048f[_0x2b81dc];return _0x327f13;};'use strict';var _=require(_0xf048('0x0'));var util=require(_0xf048('0x1'));var logger=require('../../config/logger')(_0xf048('0x2'));var moment=require('moment');var BPromise=require(_0xf048('0x3'));var rp=require(_0xf048('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf048('0x5'));var config=require('../../config/environment');var attributes=require(_0xf048('0x6'));module[_0xf048('0x7')]=function(_0x1e40d6,_0x1d354e){return _0x1e40d6[_0xf048('0x8')](_0xf048('0x9'),attributes,{'tableName':_0xf048('0xa'),'paranoid':![],'indexes':[{'name':_0xf048('0xb'),'fields':[_0xf048('0xc'),_0xf048('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 18a1578..4bb3625 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 _0x7c1a=['create','body','UpdateMemberReport','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','MemberReport','findAll','options','raw','where','attributes','limit','map','include','model','GetMemberReport','debug','stringify','CreateMemberReport'];(function(_0x428f39,_0x352a3d){var _0x20135a=function(_0xb9aef8){while(--_0xb9aef8){_0x428f39['push'](_0x428f39['shift']());}};_0x20135a(++_0x352a3d);}(_0x7c1a,0x159));var _0xa7c1=function(_0x24f59c,_0x151e3c){_0x24f59c=_0x24f59c-0x0;var _0x53990e=_0x7c1a[_0x24f59c];return _0x53990e;};'use strict';var _=require(_0xa7c1('0x0'));var util=require(_0xa7c1('0x1'));var moment=require(_0xa7c1('0x2'));var BPromise=require(_0xa7c1('0x3'));var rs=require(_0xa7c1('0x4'));var fs=require('fs');var Redis=require(_0xa7c1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa7c1('0x6'));var logger=require(_0xa7c1('0x7'))('rpc');var config=require(_0xa7c1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa7c1('0x9')][_0xa7c1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3dcfe3,_0x300db9,_0x4fc287){return new BPromise(function(_0x4f97c0,_0x117323){return client[_0xa7c1('0xb')](_0x3dcfe3,_0x4fc287)[_0xa7c1('0xc')](function(_0x5bc155){logger[_0xa7c1('0xd')](_0xa7c1('0xe'),_0x300db9,_0xa7c1('0xf'));logger['debug'](_0xa7c1('0x10'),_0x300db9,_0xa7c1('0xf'),JSON['stringify'](_0x5bc155));if(_0x5bc155[_0xa7c1('0x11')]){if(_0x5bc155[_0xa7c1('0x11')]['code']===0x1f4){logger[_0xa7c1('0x11')](_0xa7c1('0xe'),_0x300db9,_0x5bc155[_0xa7c1('0x11')][_0xa7c1('0x12')]);return _0x117323(_0x5bc155[_0xa7c1('0x11')][_0xa7c1('0x12')]);}logger[_0xa7c1('0x11')](_0xa7c1('0xe'),_0x300db9,_0x5bc155[_0xa7c1('0x11')][_0xa7c1('0x12')]);return _0x4f97c0(_0x5bc155[_0xa7c1('0x11')][_0xa7c1('0x12')]);}else{logger[_0xa7c1('0xd')]('MemberReport,\x20%s,\x20%s',_0x300db9,_0xa7c1('0xf'));_0x4f97c0(_0x5bc155[_0xa7c1('0x13')][_0xa7c1('0x12')]);}})[_0xa7c1('0x14')](function(_0x84244a){logger['error'](_0xa7c1('0xe'),_0x300db9,_0x84244a);_0x117323(_0x84244a);});});}exports['GetMemberReport']=function(_0x440251){var _0x337db4=this;return new Promise(function(_0x5dc8e3,_0x2e23f8){return db[_0xa7c1('0x15')][_0xa7c1('0x16')]({'raw':_0x440251['options']?_0x440251[_0xa7c1('0x17')][_0xa7c1('0x18')]===undefined?!![]:![]:!![],'where':_0x440251[_0xa7c1('0x17')]?_0x440251[_0xa7c1('0x17')][_0xa7c1('0x19')]||null:null,'attributes':_0x440251[_0xa7c1('0x17')]?_0x440251[_0xa7c1('0x17')][_0xa7c1('0x1a')]||null:null,'limit':_0x440251[_0xa7c1('0x17')]?_0x440251['options'][_0xa7c1('0x1b')]||null:null,'include':_0x440251[_0xa7c1('0x17')]?_0x440251[_0xa7c1('0x17')]['include']?_[_0xa7c1('0x1c')](_0x440251[_0xa7c1('0x17')][_0xa7c1('0x1d')],function(_0x2dc42b){return{'model':db[_0x2dc42b[_0xa7c1('0x1e')]],'as':_0x2dc42b['as'],'attributes':_0x2dc42b[_0xa7c1('0x1a')],'include':_0x2dc42b[_0xa7c1('0x1d')]?_['map'](_0x2dc42b['include'],function(_0x48280a){return{'model':db[_0x48280a[_0xa7c1('0x1e')]],'as':_0x48280a['as'],'attributes':_0x48280a[_0xa7c1('0x1a')],'include':_0x48280a[_0xa7c1('0x1d')]?_[_0xa7c1('0x1c')](_0x48280a[_0xa7c1('0x1d')],function(_0x5d62cb){return{'model':db[_0x5d62cb['model']],'as':_0x5d62cb['as'],'attributes':_0x5d62cb[_0xa7c1('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa7c1('0xc')](function(_0xc60f7c){logger['info'](_0xa7c1('0x1f'),_0x440251);logger[_0xa7c1('0x20')](_0xa7c1('0x1f'),_0x440251,JSON[_0xa7c1('0x21')](_0xc60f7c));_0x5dc8e3(_0xc60f7c);})[_0xa7c1('0x14')](function(_0x1cc05c){logger[_0xa7c1('0x11')](_0xa7c1('0x1f'),_0x1cc05c[_0xa7c1('0x12')],_0x440251);_0x2e23f8(_0x337db4[_0xa7c1('0x11')](0x1f4,_0x1cc05c['message']));});});};exports[_0xa7c1('0x22')]=function(_0x924b93){var _0x2a5d5c=this;return new Promise(function(_0x40ad2b,_0x216fd5){return db[_0xa7c1('0x15')][_0xa7c1('0x23')](_0x924b93[_0xa7c1('0x24')],{'raw':_0x924b93[_0xa7c1('0x17')]?_0x924b93['options'][_0xa7c1('0x18')]===undefined?!![]:![]:!![]})[_0xa7c1('0xc')](function(_0x6533b2){logger[_0xa7c1('0xd')]('CreateMemberReport',_0x924b93);logger['debug'](_0xa7c1('0x22'),_0x924b93,JSON[_0xa7c1('0x21')](_0x6533b2));_0x40ad2b(_0x6533b2);})[_0xa7c1('0x14')](function(_0x57b905){logger['error'](_0xa7c1('0x22'),_0x57b905[_0xa7c1('0x12')],_0x924b93);_0x216fd5(_0x2a5d5c['error'](0x1f4,_0x57b905[_0xa7c1('0x12')]));});});};exports['UpdateMemberReport']=function(_0x2c1569){var _0x55b3ea=this;return new Promise(function(_0x46bdb1,_0x44e732){return db['MemberReport']['update'](_0x2c1569[_0xa7c1('0x24')],{'raw':_0x2c1569[_0xa7c1('0x17')]?_0x2c1569[_0xa7c1('0x17')][_0xa7c1('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c1569[_0xa7c1('0x17')]?_0x2c1569[_0xa7c1('0x17')][_0xa7c1('0x19')]||null:null,'attributes':_0x2c1569['options']?_0x2c1569[_0xa7c1('0x17')][_0xa7c1('0x1a')]||null:null,'limit':_0x2c1569[_0xa7c1('0x17')]?_0x2c1569[_0xa7c1('0x17')][_0xa7c1('0x1b')]||null:null})[_0xa7c1('0xc')](function(_0x4b88d4){logger[_0xa7c1('0xd')](_0xa7c1('0x25'),_0x2c1569);logger[_0xa7c1('0x20')](_0xa7c1('0x25'),_0x2c1569,JSON[_0xa7c1('0x21')](_0x4b88d4));_0x46bdb1(_0x4b88d4);})[_0xa7c1('0x14')](function(_0x3b6f7f){logger[_0xa7c1('0x11')]('UpdateMemberReport',_0x3b6f7f[_0xa7c1('0x12')],_0x2c1569);_0x44e732(_0x55b3ea[_0xa7c1('0x11')](0x1f4,_0x3b6f7f[_0xa7c1('0x12')]));});});}; \ No newline at end of file +var _0x55c1=['raw','where','attributes','include','map','model','then','debug','GetMemberReport','CreateMemberReport','create','stringify','catch','UpdateMemberReport','update','body','limit','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','MemberReport,\x20%s,\x20%s','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','error','message','MemberReport','findAll','options'];(function(_0x3853d1,_0x458ea7){var _0x3a8825=function(_0x557dc5){while(--_0x557dc5){_0x3853d1['push'](_0x3853d1['shift']());}};_0x3a8825(++_0x458ea7);}(_0x55c1,0x1e5));var _0x155c=function(_0x356127,_0x4873ac){_0x356127=_0x356127-0x0;var _0x5d4c75=_0x55c1[_0x356127];return _0x5d4c75;};'use strict';var _=require(_0x155c('0x0'));var util=require(_0x155c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x155c('0x2'));var db=require(_0x155c('0x3'))['db'];var utils=require(_0x155c('0x4'));var logger=require(_0x155c('0x5'))(_0x155c('0x6'));var config=require('../../config/environment');var jayson=require(_0x155c('0x7'));var client=jayson[_0x155c('0x8')][_0x155c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4df902,_0x1cdd2f,_0x25b08a){return new BPromise(function(_0x22ed0d,_0x5f4274){return client['request'](_0x4df902,_0x25b08a)['then'](function(_0x330e12){logger[_0x155c('0xa')](_0x155c('0xb'),_0x1cdd2f,_0x155c('0xc'));logger['debug'](_0x155c('0xd'),_0x1cdd2f,_0x155c('0xc'),JSON['stringify'](_0x330e12));if(_0x330e12[_0x155c('0xe')]){if(_0x330e12[_0x155c('0xe')]['code']===0x1f4){logger[_0x155c('0xe')](_0x155c('0xb'),_0x1cdd2f,_0x330e12['error'][_0x155c('0xf')]);return _0x5f4274(_0x330e12[_0x155c('0xe')][_0x155c('0xf')]);}logger['error'](_0x155c('0xb'),_0x1cdd2f,_0x330e12[_0x155c('0xe')][_0x155c('0xf')]);return _0x22ed0d(_0x330e12[_0x155c('0xe')][_0x155c('0xf')]);}else{logger['info'](_0x155c('0xb'),_0x1cdd2f,_0x155c('0xc'));_0x22ed0d(_0x330e12['result'][_0x155c('0xf')]);}})['catch'](function(_0x4570e2){logger[_0x155c('0xe')](_0x155c('0xb'),_0x1cdd2f,_0x4570e2);_0x5f4274(_0x4570e2);});});}exports['GetMemberReport']=function(_0xe800de){var _0x13667b=this;return new Promise(function(_0x224a3d,_0x2f0099){return db[_0x155c('0x10')][_0x155c('0x11')]({'raw':_0xe800de[_0x155c('0x12')]?_0xe800de[_0x155c('0x12')][_0x155c('0x13')]===undefined?!![]:![]:!![],'where':_0xe800de[_0x155c('0x12')]?_0xe800de[_0x155c('0x12')][_0x155c('0x14')]||null:null,'attributes':_0xe800de[_0x155c('0x12')]?_0xe800de[_0x155c('0x12')][_0x155c('0x15')]||null:null,'limit':_0xe800de[_0x155c('0x12')]?_0xe800de[_0x155c('0x12')]['limit']||null:null,'include':_0xe800de[_0x155c('0x12')]?_0xe800de[_0x155c('0x12')][_0x155c('0x16')]?_[_0x155c('0x17')](_0xe800de[_0x155c('0x12')][_0x155c('0x16')],function(_0x4b6d0d){return{'model':db[_0x4b6d0d['model']],'as':_0x4b6d0d['as'],'attributes':_0x4b6d0d[_0x155c('0x15')],'include':_0x4b6d0d[_0x155c('0x16')]?_[_0x155c('0x17')](_0x4b6d0d[_0x155c('0x16')],function(_0x41e24d){return{'model':db[_0x41e24d[_0x155c('0x18')]],'as':_0x41e24d['as'],'attributes':_0x41e24d[_0x155c('0x15')],'include':_0x41e24d[_0x155c('0x16')]?_[_0x155c('0x17')](_0x41e24d[_0x155c('0x16')],function(_0x36be3d){return{'model':db[_0x36be3d[_0x155c('0x18')]],'as':_0x36be3d['as'],'attributes':_0x36be3d[_0x155c('0x15')]};}):[]};}):[]};}):[]:[]})[_0x155c('0x19')](function(_0x115143){logger[_0x155c('0xa')]('GetMemberReport',_0xe800de);logger[_0x155c('0x1a')]('GetMemberReport',_0xe800de,JSON['stringify'](_0x115143));_0x224a3d(_0x115143);})['catch'](function(_0x47c89d){logger[_0x155c('0xe')](_0x155c('0x1b'),_0x47c89d[_0x155c('0xf')],_0xe800de);_0x2f0099(_0x13667b['error'](0x1f4,_0x47c89d[_0x155c('0xf')]));});});};exports[_0x155c('0x1c')]=function(_0x32e5b8){var _0x595d47=this;return new Promise(function(_0x5a0ddf,_0x4ad8b4){return db[_0x155c('0x10')][_0x155c('0x1d')](_0x32e5b8['body'],{'raw':_0x32e5b8[_0x155c('0x12')]?_0x32e5b8[_0x155c('0x12')][_0x155c('0x13')]===undefined?!![]:![]:!![]})['then'](function(_0x2a84e7){logger['info'](_0x155c('0x1c'),_0x32e5b8);logger[_0x155c('0x1a')]('CreateMemberReport',_0x32e5b8,JSON[_0x155c('0x1e')](_0x2a84e7));_0x5a0ddf(_0x2a84e7);})[_0x155c('0x1f')](function(_0x5d575f){logger[_0x155c('0xe')](_0x155c('0x1c'),_0x5d575f['message'],_0x32e5b8);_0x4ad8b4(_0x595d47[_0x155c('0xe')](0x1f4,_0x5d575f[_0x155c('0xf')]));});});};exports[_0x155c('0x20')]=function(_0x306572){var _0x31a174=this;return new Promise(function(_0x2dc388,_0x3ec5fc){return db[_0x155c('0x10')][_0x155c('0x21')](_0x306572[_0x155c('0x22')],{'raw':_0x306572[_0x155c('0x12')]?_0x306572['options'][_0x155c('0x13')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x306572[_0x155c('0x12')]?_0x306572[_0x155c('0x12')]['where']||null:null,'attributes':_0x306572[_0x155c('0x12')]?_0x306572[_0x155c('0x12')]['attributes']||null:null,'limit':_0x306572['options']?_0x306572[_0x155c('0x12')][_0x155c('0x23')]||null:null})[_0x155c('0x19')](function(_0x5ab939){logger[_0x155c('0xa')](_0x155c('0x20'),_0x306572);logger[_0x155c('0x1a')]('UpdateMemberReport',_0x306572,JSON[_0x155c('0x1e')](_0x5ab939));_0x2dc388(_0x5ab939);})['catch'](function(_0x3453a7){logger[_0x155c('0xe')](_0x155c('0x20'),_0x3453a7['message'],_0x306572);_0x3ec5fc(_0x31a174['error'](0x1f4,_0x3453a7[_0x155c('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index df759e1..fdecdd9 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 _0x3568=['../../config/environment','./migration.controller','index','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x5e4acd,_0x5454d6){var _0x4ef74f=function(_0x4b4c9e){while(--_0x4b4c9e){_0x5e4acd['push'](_0x5e4acd['shift']());}};_0x4ef74f(++_0x5454d6);}(_0x3568,0xc2));var _0x8356=function(_0xfde480,_0xd95748){_0xfde480=_0xfde480-0x0;var _0xbe99d4=_0x3568[_0xfde480];return _0xbe99d4;};'use strict';var multer=require(_0x8356('0x0'));var util=require(_0x8356('0x1'));var path=require('path');var timeout=require(_0x8356('0x2'));var express=require(_0x8356('0x3'));var router=express['Router']();var fs_extra=require(_0x8356('0x4'));var auth=require(_0x8356('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8356('0x6'));var controller=require(_0x8356('0x7'));router['get']('/',controller[_0x8356('0x8')]);module[_0x8356('0x9')]=router; \ No newline at end of file +var _0x165d=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','exports'];(function(_0x11e147,_0x1ebec6){var _0x5ae0b1=function(_0x4d5ed4){while(--_0x4d5ed4){_0x11e147['push'](_0x11e147['shift']());}};_0x5ae0b1(++_0x1ebec6);}(_0x165d,0x14a));var _0xd165=function(_0x1e5f77,_0x1e4a0e){_0x1e5f77=_0x1e5f77-0x0;var _0x5a9ece=_0x165d[_0x1e5f77];return _0x5a9ece;};'use strict';var multer=require(_0xd165('0x0'));var util=require(_0xd165('0x1'));var path=require(_0xd165('0x2'));var timeout=require(_0xd165('0x3'));var express=require(_0xd165('0x4'));var router=express[_0xd165('0x5')]();var fs_extra=require(_0xd165('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd165('0x7'));var config=require(_0xd165('0x8'));var controller=require('./migration.controller');router['get']('/',controller['index']);module[_0xd165('0x9')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 1cc4de0..7242c57 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 _0x7bc5=['version','exports','STRING'];(function(_0x64a3b0,_0x3d9dfb){var _0x5af140=function(_0x1cc6e3){while(--_0x1cc6e3){_0x64a3b0['push'](_0x64a3b0['shift']());}};_0x5af140(++_0x3d9dfb);}(_0x7bc5,0x121));var _0x57bc=function(_0x12b683,_0x124186){_0x12b683=_0x12b683-0x0;var _0xfb150b=_0x7bc5[_0x12b683];return _0xfb150b;};'use strict';var Sequelize=require('sequelize');module[_0x57bc('0x0')]={'version':{'type':Sequelize[_0x57bc('0x1')],'unique':_0x57bc('0x2')}}; \ No newline at end of file +var _0xb940=['exports','sequelize'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xb940,0x17b));var _0x0b94=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xb940[_0x3c2a69];return _0x596bc8;};'use strict';var Sequelize=require(_0x0b94('0x0'));module[_0x0b94('0x1')]={'version':{'type':Sequelize['STRING'],'unique':'version'}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 6bf2ec2..6f88523 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 _0xbac8=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','error','stack','name','send','map','Migration','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbac8,0x8e));var _0x8bac=function(_0x55747a,_0x2d49a6){_0x55747a=_0x55747a-0x0;var _0x567ba0=_0xbac8[_0x55747a];return _0x567ba0;};'use strict';var emlformat=require(_0x8bac('0x0'));var rimraf=require(_0x8bac('0x1'));var zipdir=require(_0x8bac('0x2'));var jsonpatch=require(_0x8bac('0x3'));var rp=require('request-promise');var moment=require(_0x8bac('0x4'));var BPromise=require(_0x8bac('0x5'));var Mustache=require(_0x8bac('0x6'));var util=require(_0x8bac('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8bac('0x8'));var fs=require('fs');var fs_extra=require(_0x8bac('0x9'));var _=require(_0x8bac('0xa'));var squel=require(_0x8bac('0xb'));var crypto=require(_0x8bac('0xc'));var jsforce=require(_0x8bac('0xd'));var deskjs=require(_0x8bac('0xe'));var toCsv=require(_0x8bac('0xf'));var querystring=require(_0x8bac('0x10'));var Papa=require(_0x8bac('0x11'));var Redis=require(_0x8bac('0x12'));var authService=require(_0x8bac('0x13'));var qs=require(_0x8bac('0x14'));var as=require(_0x8bac('0x15'));var hardwareService=require(_0x8bac('0x16'));var logger=require(_0x8bac('0x17'))(_0x8bac('0x18'));var utils=require(_0x8bac('0x19'));var config=require(_0x8bac('0x1a'));var licenseUtil=require(_0x8bac('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0123,_0x376f56){_0x376f56=_0x376f56||0xcc;return function(_0x156ddf){if(_0x156ddf){return _0x2a0123[_0x8bac('0x1c')](_0x376f56);}return _0x2a0123['status'](_0x376f56)[_0x8bac('0x1d')]();};}function respondWithResult(_0xd7cd75,_0x523b2d){_0x523b2d=_0x523b2d||0xc8;return function(_0x3787f0){if(_0x3787f0){return _0xd7cd75[_0x8bac('0x1e')](_0x523b2d)[_0x8bac('0x1f')](_0x3787f0);}};}function respondWithFilteredResult(_0x4e78ef,_0x44c799){return function(_0x16479f){if(_0x16479f){var _0x575aac=typeof _0x44c799[_0x8bac('0x20')]===_0x8bac('0x21')&&typeof _0x44c799[_0x8bac('0x22')]==='undefined';var _0x1709d5=_0x16479f[_0x8bac('0x23')];var _0x125af0=_0x575aac?0x0:_0x44c799[_0x8bac('0x20')];var _0x3cd8e4=_0x575aac?_0x16479f[_0x8bac('0x23')]:_0x44c799[_0x8bac('0x20')]+_0x44c799[_0x8bac('0x22')];var _0x1830f5;if(_0x3cd8e4>=_0x1709d5){_0x3cd8e4=_0x1709d5;_0x1830f5=0xc8;}else{_0x1830f5=0xce;}_0x4e78ef[_0x8bac('0x1e')](_0x1830f5);return _0x4e78ef[_0x8bac('0x24')](_0x8bac('0x25'),_0x125af0+'-'+_0x3cd8e4+'/'+_0x1709d5)[_0x8bac('0x1f')](_0x16479f);}return null;};}function patchUpdates(_0x34309d){return function(_0x47aec7){try{jsonpatch[_0x8bac('0x26')](_0x47aec7,_0x34309d,!![]);}catch(_0x35b3a4){return BPromise[_0x8bac('0x27')](_0x35b3a4);}return _0x47aec7['save']();};}function saveUpdates(_0x1f3a3b,_0x3dfdb9){return function(_0x40d0fe){if(_0x40d0fe){return _0x40d0fe['update'](_0x1f3a3b)[_0x8bac('0x28')](function(_0xc6624e){return _0xc6624e;});}return null;};}function removeEntity(_0x5ab925,_0x3aef14){return function(_0xd607ce){if(_0xd607ce){return _0xd607ce['destroy']()['then'](function(){_0x5ab925[_0x8bac('0x1e')](0xcc)[_0x8bac('0x1d')]();});}};}function handleEntityNotFound(_0x2f01a0,_0x5ed563){return function(_0x1f82d0){if(!_0x1f82d0){_0x2f01a0[_0x8bac('0x1c')](0x194);}return _0x1f82d0;};}function handleError(_0x25af27,_0x28b667){_0x28b667=_0x28b667||0x1f4;return function(_0x19fa0c){logger[_0x8bac('0x29')](_0x19fa0c[_0x8bac('0x2a')]);if(_0x19fa0c['name']){delete _0x19fa0c[_0x8bac('0x2b')];}_0x25af27[_0x8bac('0x1e')](_0x28b667)[_0x8bac('0x2c')](_0x19fa0c);};}exports['index']=function(_0xfe023d,_0x15c310){var _0x438eb9={},_0x2caacb={},_0x529260={'count':0x0,'rows':[]};var _0x2d7448=_[_0x8bac('0x2d')](db[_0x8bac('0x2e')]['rawAttributes'],function(_0x738235){return{'name':_0x738235[_0x8bac('0x2f')],'type':_0x738235[_0x8bac('0x30')][_0x8bac('0x31')]};});_0x2caacb[_0x8bac('0x32')]=_[_0x8bac('0x2d')](_0x2d7448,'name');_0x2caacb[_0x8bac('0x33')]=_[_0x8bac('0x34')](_0xfe023d[_0x8bac('0x33')]);_0x2caacb[_0x8bac('0x35')]=_[_0x8bac('0x36')](_0x2caacb[_0x8bac('0x32')],_0x2caacb['query']);_0x438eb9[_0x8bac('0x37')]=_[_0x8bac('0x36')](_0x2caacb['model'],qs[_0x8bac('0x38')](_0xfe023d[_0x8bac('0x33')]['fields']));_0x438eb9[_0x8bac('0x37')]=_0x438eb9[_0x8bac('0x37')][_0x8bac('0x39')]?_0x438eb9[_0x8bac('0x37')]:_0x2caacb[_0x8bac('0x32')];if(!_0xfe023d[_0x8bac('0x33')][_0x8bac('0x3a')](_0x8bac('0x3b'))){_0x438eb9['limit']=qs['limit'](_0xfe023d[_0x8bac('0x33')][_0x8bac('0x22')]);_0x438eb9['offset']=qs[_0x8bac('0x20')](_0xfe023d[_0x8bac('0x33')][_0x8bac('0x20')]);}_0x438eb9[_0x8bac('0x3c')]=qs['sort'](_0xfe023d[_0x8bac('0x33')][_0x8bac('0x3d')]);_0x438eb9[_0x8bac('0x3e')]=qs[_0x8bac('0x35')](_[_0x8bac('0x3f')](_0xfe023d['query'],_0x2caacb[_0x8bac('0x35')]),_0x2d7448);if(_0xfe023d[_0x8bac('0x33')][_0x8bac('0x40')]){_0x438eb9[_0x8bac('0x3e')]=_[_0x8bac('0x41')](_0x438eb9['where'],{'$or':_[_0x8bac('0x2d')](_0x2d7448,function(_0xd68ab0){if(_0xd68ab0[_0x8bac('0x30')]!==_0x8bac('0x42')){var _0x58abd={};_0x58abd[_0xd68ab0[_0x8bac('0x2b')]]={'$like':'%'+_0xfe023d[_0x8bac('0x33')][_0x8bac('0x40')]+'%'};return _0x58abd;}})});}_0x438eb9=_['merge']({},_0x438eb9,_0xfe023d[_0x8bac('0x43')]);var _0x26a8e8={'where':_0x438eb9[_0x8bac('0x3e')]};return db['Migration'][_0x8bac('0x23')](_0x26a8e8)[_0x8bac('0x28')](function(_0x4cf659){_0x529260[_0x8bac('0x23')]=_0x4cf659;if(_0xfe023d[_0x8bac('0x33')]['includeAll']){_0x438eb9['include']=[{'all':!![]}];}return db[_0x8bac('0x2e')][_0x8bac('0x44')](_0x438eb9);})[_0x8bac('0x28')](function(_0x33955a){_0x529260[_0x8bac('0x45')]=_0x33955a;return _0x529260;})[_0x8bac('0x28')](respondWithFilteredResult(_0x15c310,_0x438eb9))[_0x8bac('0x46')](handleError(_0x15c310,null));}; \ No newline at end of file +var _0x3441=['key','model','name','query','keys','filters','fields','length','attributes','nolimit','order','sort','filter','where','merge','type','VIRTUAL','options','include','findAll','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','send','map','Migration','rawAttributes','fieldName'];(function(_0x24328b,_0x3cd87d){var _0x33f429=function(_0x13da7e){while(--_0x13da7e){_0x24328b['push'](_0x24328b['shift']());}};_0x33f429(++_0x3cd87d);}(_0x3441,0x1ba));var _0x1344=function(_0x295317,_0x46aebf){_0x295317=_0x295317-0x0;var _0x458246=_0x3441[_0x295317];return _0x458246;};'use strict';var emlformat=require(_0x1344('0x0'));var rimraf=require(_0x1344('0x1'));var zipdir=require(_0x1344('0x2'));var jsonpatch=require(_0x1344('0x3'));var rp=require('request-promise');var moment=require(_0x1344('0x4'));var BPromise=require(_0x1344('0x5'));var Mustache=require(_0x1344('0x6'));var util=require(_0x1344('0x7'));var path=require(_0x1344('0x8'));var sox=require('sox');var csv=require(_0x1344('0x9'));var ejs=require(_0x1344('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1344('0xb'));var squel=require(_0x1344('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1344('0xd'));var toCsv=require(_0x1344('0x9'));var querystring=require(_0x1344('0xe'));var Papa=require(_0x1344('0xf'));var Redis=require(_0x1344('0x10'));var authService=require(_0x1344('0x11'));var qs=require(_0x1344('0x12'));var as=require(_0x1344('0x13'));var hardwareService=require(_0x1344('0x14'));var logger=require(_0x1344('0x15'))(_0x1344('0x16'));var utils=require(_0x1344('0x17'));var config=require(_0x1344('0x18'));var licenseUtil=require(_0x1344('0x19'));var db=require(_0x1344('0x1a'))['db'];function respondWithStatusCode(_0x4e4522,_0x25ea3e){_0x25ea3e=_0x25ea3e||0xcc;return function(_0x248b4b){if(_0x248b4b){return _0x4e4522['sendStatus'](_0x25ea3e);}return _0x4e4522[_0x1344('0x1b')](_0x25ea3e)[_0x1344('0x1c')]();};}function respondWithResult(_0x1a2617,_0x3396db){_0x3396db=_0x3396db||0xc8;return function(_0x139c51){if(_0x139c51){return _0x1a2617['status'](_0x3396db)[_0x1344('0x1d')](_0x139c51);}};}function respondWithFilteredResult(_0xca3f9,_0x5544bc){return function(_0x4edddd){if(_0x4edddd){var _0x55c3ec=typeof _0x5544bc[_0x1344('0x1e')]===_0x1344('0x1f')&&typeof _0x5544bc[_0x1344('0x20')]===_0x1344('0x1f');var _0x1fe64a=_0x4edddd[_0x1344('0x21')];var _0x48e447=_0x55c3ec?0x0:_0x5544bc[_0x1344('0x1e')];var _0x1471f0=_0x55c3ec?_0x4edddd['count']:_0x5544bc[_0x1344('0x1e')]+_0x5544bc['limit'];var _0x2ae27a;if(_0x1471f0>=_0x1fe64a){_0x1471f0=_0x1fe64a;_0x2ae27a=0xc8;}else{_0x2ae27a=0xce;}_0xca3f9[_0x1344('0x1b')](_0x2ae27a);return _0xca3f9[_0x1344('0x22')](_0x1344('0x23'),_0x48e447+'-'+_0x1471f0+'/'+_0x1fe64a)[_0x1344('0x1d')](_0x4edddd);}return null;};}function patchUpdates(_0x324b87){return function(_0x134afd){try{jsonpatch[_0x1344('0x24')](_0x134afd,_0x324b87,!![]);}catch(_0x5e9ee0){return BPromise[_0x1344('0x25')](_0x5e9ee0);}return _0x134afd['save']();};}function saveUpdates(_0x4c2426,_0x4e01be){return function(_0x17b4d3){if(_0x17b4d3){return _0x17b4d3[_0x1344('0x26')](_0x4c2426)[_0x1344('0x27')](function(_0x261461){return _0x261461;});}return null;};}function removeEntity(_0x353310,_0x383901){return function(_0x4c451e){if(_0x4c451e){return _0x4c451e[_0x1344('0x28')]()['then'](function(){_0x353310[_0x1344('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b7a47,_0x10250c){return function(_0x5be7d7){if(!_0x5be7d7){_0x2b7a47[_0x1344('0x29')](0x194);}return _0x5be7d7;};}function handleError(_0x123072,_0x4124f9){_0x4124f9=_0x4124f9||0x1f4;return function(_0x1d61a0){logger[_0x1344('0x2a')](_0x1d61a0['stack']);if(_0x1d61a0['name']){delete _0x1d61a0['name'];}_0x123072[_0x1344('0x1b')](_0x4124f9)[_0x1344('0x2b')](_0x1d61a0);};}exports['index']=function(_0x4407c4,_0x3bb2d2){var _0x521512={},_0x470e91={},_0x2aaefd={'count':0x0,'rows':[]};var _0x514d71=_[_0x1344('0x2c')](db[_0x1344('0x2d')][_0x1344('0x2e')],function(_0x51bf3c){return{'name':_0x51bf3c[_0x1344('0x2f')],'type':_0x51bf3c['type'][_0x1344('0x30')]};});_0x470e91[_0x1344('0x31')]=_['map'](_0x514d71,_0x1344('0x32'));_0x470e91[_0x1344('0x33')]=_[_0x1344('0x34')](_0x4407c4[_0x1344('0x33')]);_0x470e91[_0x1344('0x35')]=_['intersection'](_0x470e91[_0x1344('0x31')],_0x470e91[_0x1344('0x33')]);_0x521512['attributes']=_['intersection'](_0x470e91[_0x1344('0x31')],qs[_0x1344('0x36')](_0x4407c4['query'][_0x1344('0x36')]));_0x521512['attributes']=_0x521512['attributes'][_0x1344('0x37')]?_0x521512[_0x1344('0x38')]:_0x470e91['model'];if(!_0x4407c4[_0x1344('0x33')]['hasOwnProperty'](_0x1344('0x39'))){_0x521512['limit']=qs[_0x1344('0x20')](_0x4407c4[_0x1344('0x33')][_0x1344('0x20')]);_0x521512[_0x1344('0x1e')]=qs['offset'](_0x4407c4[_0x1344('0x33')][_0x1344('0x1e')]);}_0x521512[_0x1344('0x3a')]=qs[_0x1344('0x3b')](_0x4407c4[_0x1344('0x33')][_0x1344('0x3b')]);_0x521512['where']=qs[_0x1344('0x35')](_['pick'](_0x4407c4['query'],_0x470e91[_0x1344('0x35')]),_0x514d71);if(_0x4407c4[_0x1344('0x33')][_0x1344('0x3c')]){_0x521512[_0x1344('0x3d')]=_[_0x1344('0x3e')](_0x521512[_0x1344('0x3d')],{'$or':_[_0x1344('0x2c')](_0x514d71,function(_0x482646){if(_0x482646[_0x1344('0x3f')]!==_0x1344('0x40')){var _0x51809d={};_0x51809d[_0x482646['name']]={'$like':'%'+_0x4407c4[_0x1344('0x33')][_0x1344('0x3c')]+'%'};return _0x51809d;}})});}_0x521512=_[_0x1344('0x3e')]({},_0x521512,_0x4407c4[_0x1344('0x41')]);var _0x2584d8={'where':_0x521512['where']};return db[_0x1344('0x2d')]['count'](_0x2584d8)[_0x1344('0x27')](function(_0x199444){_0x2aaefd['count']=_0x199444;if(_0x4407c4[_0x1344('0x33')]['includeAll']){_0x521512[_0x1344('0x42')]=[{'all':!![]}];}return db['Migration'][_0x1344('0x43')](_0x521512);})[_0x1344('0x27')](function(_0x4c8886){_0x2aaefd[_0x1344('0x44')]=_0x4c8886;return _0x2aaefd;})[_0x1344('0x27')](respondWithFilteredResult(_0x3bb2d2,_0x521512))[_0x1344('0x45')](handleError(_0x3bb2d2,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index ebc2e2d..61271ab 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 _0xdab1=['rimraf','../../config/environment','define','Migration','migrations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x50fdf5,_0x192c48){var _0x212b05=function(_0x101cd8){while(--_0x101cd8){_0x50fdf5['push'](_0x50fdf5['shift']());}};_0x212b05(++_0x192c48);}(_0xdab1,0x1f3));var _0x1dab=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0xdab1[_0x39c734];return _0xb2a2f9;};'use strict';var _=require(_0x1dab('0x0'));var util=require(_0x1dab('0x1'));var logger=require(_0x1dab('0x2'))(_0x1dab('0x3'));var moment=require(_0x1dab('0x4'));var BPromise=require(_0x1dab('0x5'));var rp=require(_0x1dab('0x6'));var fs=require('fs');var path=require(_0x1dab('0x7'));var rimraf=require(_0x1dab('0x8'));var config=require(_0x1dab('0x9'));var attributes=require('./migration.attributes');module['exports']=function(_0x2cef2c,_0x3e1e9e){return _0x2cef2c[_0x1dab('0xa')](_0x1dab('0xb'),attributes,{'tableName':_0x1dab('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7afd=['migrations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./migration.attributes','exports'];(function(_0x5bbac8,_0x5cf794){var _0x5b003a=function(_0x19067b){while(--_0x19067b){_0x5bbac8['push'](_0x5bbac8['shift']());}};_0x5b003a(++_0x5cf794);}(_0x7afd,0x169));var _0xd7af=function(_0x1dfdd3,_0x3e1a05){_0x1dfdd3=_0x1dfdd3-0x0;var _0x4dbacf=_0x7afd[_0x1dfdd3];return _0x4dbacf;};'use strict';var _=require(_0xd7af('0x0'));var util=require(_0xd7af('0x1'));var logger=require(_0xd7af('0x2'))(_0xd7af('0x3'));var moment=require(_0xd7af('0x4'));var BPromise=require(_0xd7af('0x5'));var rp=require(_0xd7af('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd7af('0x7'));var config=require(_0xd7af('0x8'));var attributes=require(_0xd7af('0x9'));module[_0xd7af('0xa')]=function(_0x55ec8b,_0x39930a){return _0x55ec8b['define']('Migration',attributes,{'tableName':_0xd7af('0xb'),'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 2ae53d2..c1f2617 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 _0xa900=['../../config/environment','jayson/promise','client','http','request','then','Migration,\x20%s,\x20%s','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x40f46f,_0x16bba2){var _0x9d21a=function(_0x2ad948){while(--_0x2ad948){_0x40f46f['push'](_0x40f46f['shift']());}};_0x9d21a(++_0x16bba2);}(_0xa900,0x101));var _0x0a90=function(_0x16d793,_0x22f0f7){_0x16d793=_0x16d793-0x0;var _0x444f4f=_0xa900[_0x16d793];return _0x444f4f;};'use strict';var _=require(_0x0a90('0x0'));var util=require(_0x0a90('0x1'));var moment=require(_0x0a90('0x2'));var BPromise=require(_0x0a90('0x3'));var rs=require(_0x0a90('0x4'));var fs=require('fs');var Redis=require(_0x0a90('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a90('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x0a90('0x7'));var jayson=require(_0x0a90('0x8'));var client=jayson[_0x0a90('0x9')][_0x0a90('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56a1e5,_0x3909ac,_0x4718e9){return new BPromise(function(_0x33e3cf,_0x4f2b58){return client[_0x0a90('0xb')](_0x56a1e5,_0x4718e9)[_0x0a90('0xc')](function(_0x36c82f){logger['info'](_0x0a90('0xd'),_0x3909ac,'request\x20sent');logger[_0x0a90('0xe')](_0x0a90('0xf'),_0x3909ac,'request\x20sent',JSON[_0x0a90('0x10')](_0x36c82f));if(_0x36c82f[_0x0a90('0x11')]){if(_0x36c82f[_0x0a90('0x11')][_0x0a90('0x12')]===0x1f4){logger[_0x0a90('0x11')](_0x0a90('0xd'),_0x3909ac,_0x36c82f[_0x0a90('0x11')][_0x0a90('0x13')]);return _0x4f2b58(_0x36c82f[_0x0a90('0x11')][_0x0a90('0x13')]);}logger[_0x0a90('0x11')](_0x0a90('0xd'),_0x3909ac,_0x36c82f[_0x0a90('0x11')]['message']);return _0x33e3cf(_0x36c82f['error'][_0x0a90('0x13')]);}else{logger[_0x0a90('0x14')](_0x0a90('0xd'),_0x3909ac,_0x0a90('0x15'));_0x33e3cf(_0x36c82f[_0x0a90('0x16')][_0x0a90('0x13')]);}})[_0x0a90('0x17')](function(_0x4c5979){logger[_0x0a90('0x11')](_0x0a90('0xd'),_0x3909ac,_0x4c5979);_0x4f2b58(_0x4c5979);});});} \ No newline at end of file +var _0x0ca5=['request','info','Migration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x34d150,_0x2334ca){var _0x4bd099=function(_0x4c0215){while(--_0x4c0215){_0x34d150['push'](_0x34d150['shift']());}};_0x4bd099(++_0x2334ca);}(_0x0ca5,0xfc));var _0x50ca=function(_0x26be2e,_0x5af106){_0x26be2e=_0x26be2e-0x0;var _0x365860=_0x0ca5[_0x26be2e];return _0x365860;};'use strict';var _=require(_0x50ca('0x0'));var util=require(_0x50ca('0x1'));var moment=require(_0x50ca('0x2'));var BPromise=require(_0x50ca('0x3'));var rs=require(_0x50ca('0x4'));var fs=require('fs');var Redis=require(_0x50ca('0x5'));var db=require(_0x50ca('0x6'))['db'];var utils=require(_0x50ca('0x7'));var logger=require('../../config/logger')(_0x50ca('0x8'));var config=require(_0x50ca('0x9'));var jayson=require(_0x50ca('0xa'));var client=jayson[_0x50ca('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e7d2c,_0x18142d,_0x47e1b1){return new BPromise(function(_0x14709d,_0x56e57a){return client[_0x50ca('0xc')](_0x4e7d2c,_0x47e1b1)['then'](function(_0x3ab7a0){logger[_0x50ca('0xd')](_0x50ca('0xe'),_0x18142d,_0x50ca('0xf'));logger[_0x50ca('0x10')]('Migration,\x20%s,\x20%s,\x20%s',_0x18142d,'request\x20sent',JSON[_0x50ca('0x11')](_0x3ab7a0));if(_0x3ab7a0[_0x50ca('0x12')]){if(_0x3ab7a0[_0x50ca('0x12')][_0x50ca('0x13')]===0x1f4){logger[_0x50ca('0x12')](_0x50ca('0xe'),_0x18142d,_0x3ab7a0[_0x50ca('0x12')][_0x50ca('0x14')]);return _0x56e57a(_0x3ab7a0[_0x50ca('0x12')][_0x50ca('0x14')]);}logger[_0x50ca('0x12')](_0x50ca('0xe'),_0x18142d,_0x3ab7a0[_0x50ca('0x12')][_0x50ca('0x14')]);return _0x14709d(_0x3ab7a0[_0x50ca('0x12')]['message']);}else{logger[_0x50ca('0xd')](_0x50ca('0xe'),_0x18142d,_0x50ca('0xf'));_0x14709d(_0x3ab7a0[_0x50ca('0x15')][_0x50ca('0x14')]);}})['catch'](function(_0x1566f4){logger['error'](_0x50ca('0xe'),_0x18142d,_0x1566f4);_0x56e57a(_0x1566f4);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 7d77b2f..b9911b3 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 _0x0295=['delete','destroy','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','post','create','/:id','update'];(function(_0x41886e,_0x2f9b3e){var _0x10e7f4=function(_0x267c43){while(--_0x267c43){_0x41886e['push'](_0x41886e['shift']());}};_0x10e7f4(++_0x2f9b3e);}(_0x0295,0x1f0));var _0x5029=function(_0x237340,_0x39b15d){_0x237340=_0x237340-0x0;var _0x5542c8=_0x0295[_0x237340];return _0x5542c8;};'use strict';var multer=require(_0x5029('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5029('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5029('0x2'));var auth=require(_0x5029('0x3'));var interaction=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var controller=require(_0x5029('0x6'));router[_0x5029('0x7')]('/',auth[_0x5029('0x8')](),controller[_0x5029('0x9')]);router[_0x5029('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x5029('0xa')]('/',auth['isAuthenticated'](),controller[_0x5029('0xb')]);router['put'](_0x5029('0xc'),auth['isAuthenticated'](),controller[_0x5029('0xd')]);router[_0x5029('0xe')](_0x5029('0xc'),auth['isAuthenticated'](),controller[_0x5029('0xf')]);module[_0x5029('0x10')]=router; \ No newline at end of file +var _0x3d04=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./network.controller','get','isAuthenticated','show','post','create','put','update','destroy','exports'];(function(_0x4d0fdb,_0x3f7b79){var _0x26f1dc=function(_0x3c7b99){while(--_0x3c7b99){_0x4d0fdb['push'](_0x4d0fdb['shift']());}};_0x26f1dc(++_0x3f7b79);}(_0x3d04,0xbe));var _0x43d0=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x3d04[_0x397e5f];return _0x5302b8;};'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('0xd')]('/',auth[_0x43d0('0xb')](),controller[_0x43d0('0xe')]);router[_0x43d0('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x43d0('0x10')]);router['delete']('/:id',auth[_0x43d0('0xb')](),controller[_0x43d0('0x11')]);module[_0x43d0('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 7032b96..3499ce1 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 _0xaf08=['ENUM','localnet','externip','stun','turn','STRING'];(function(_0x40ab41,_0x5d535e){var _0x36962d=function(_0x3300e7){while(--_0x3300e7){_0x40ab41['push'](_0x40ab41['shift']());}};_0x36962d(++_0x5d535e);}(_0xaf08,0x1c2));var _0x8af0=function(_0x420513,_0x30eae3){_0x420513=_0x420513-0x0;var _0x1b44ec=_0xaf08[_0x420513];return _0x1b44ec;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x8af0('0x0')](_0x8af0('0x1'),_0x8af0('0x2'),_0x8af0('0x3'),_0x8af0('0x4'))},'value':{'type':Sequelize[_0x8af0('0x5')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x8af0('0x5')]}}; \ No newline at end of file +var _0x8335=['ENUM','localnet','externip','stun','turn','STRING','sequelize'];(function(_0x1a54c3,_0x2cfbb0){var _0x318492=function(_0x27a156){while(--_0x27a156){_0x1a54c3['push'](_0x1a54c3['shift']());}};_0x318492(++_0x2cfbb0);}(_0x8335,0xfb));var _0x5833=function(_0x2d4bc4,_0x34ac62){_0x2d4bc4=_0x2d4bc4-0x0;var _0x12c144=_0x8335[_0x2d4bc4];return _0x12c144;};'use strict';var Sequelize=require(_0x5833('0x0'));module['exports']={'type':{'type':Sequelize[_0x5833('0x1')](_0x5833('0x2'),_0x5833('0x3'),_0x5833('0x4'),_0x5833('0x5'))},'value':{'type':Sequelize[_0x5833('0x6')]},'username':{'type':Sequelize[_0x5833('0x6')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 25852b5..5c8fbb4 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 _0xf7e7=['model','query','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','filter','options','includeAll','include','Network','findAll','rows','show','params','keys','find','create','body','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','server/files/templates/turn_multiple.ejs','writeFileSync','/etc/asterisk/turn_xcally.conf','render','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','toUpperCase','STUN','server/files/templates/network.ejs','format','ejs','lodash','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','request','then','info','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','json','offset','limit','undefined','count','status','set','Content-Range','update','destroy','end','stack','name','send','index','map','fieldName','type','key'];(function(_0x4dab58,_0x78bb16){var _0x552cec=function(_0x3f2611){while(--_0x3f2611){_0x4dab58['push'](_0x4dab58['shift']());}};_0x552cec(++_0x78bb16);}(_0xf7e7,0x183));var _0x7f7e=function(_0x349871,_0xfbe9e9){_0x349871=_0x349871-0x0;var _0x12583d=_0xf7e7[_0x349871];return _0x12583d;};'use strict';var util=require('util');var path=require('path');var ejs=require(_0x7f7e('0x0'));var fs=require('fs');var _=require(_0x7f7e('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x7f7e('0x2'))(_0x7f7e('0x3'));var config=require(_0x7f7e('0x4'));var db=require(_0x7f7e('0x5'))['db'];var jayson=require(_0x7f7e('0x6'));var client=jayson[_0x7f7e('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2057c3,_0x218f22,_0x3ca7c3,_0x1ccd64){return new Promise(function(_0x4ea1ec,_0x7e51b8){var _0x57da38=_0x1ccd64||client;return _0x57da38[_0x7f7e('0x8')](_0x2057c3,_0x3ca7c3)[_0x7f7e('0x9')](function(_0x3e2869){logger[_0x7f7e('0xa')](_0x7f7e('0xb'),_0x218f22,'request\x20sent');logger[_0x7f7e('0xc')](_0x7f7e('0xd'),_0x218f22,_0x7f7e('0xe'),JSON['stringify'](_0x3e2869));if(_0x3e2869[_0x7f7e('0xf')]){if(_0x3e2869[_0x7f7e('0xf')][_0x7f7e('0x10')]===0x1f4){logger['error'](_0x7f7e('0xb'),_0x218f22,_0x3e2869[_0x7f7e('0xf')][_0x7f7e('0x11')]);return _0x7e51b8(_0x3e2869[_0x7f7e('0xf')][_0x7f7e('0x11')]);}logger[_0x7f7e('0xf')](_0x7f7e('0xb'),_0x218f22,_0x3e2869[_0x7f7e('0xf')][_0x7f7e('0x11')]);return _0x4ea1ec(_0x3e2869[_0x7f7e('0xf')][_0x7f7e('0x11')]);}else{logger[_0x7f7e('0xa')](_0x7f7e('0xb'),_0x218f22,_0x7f7e('0xe'));_0x4ea1ec(_0x3e2869['result'][_0x7f7e('0x11')]);}})[_0x7f7e('0x12')](function(_0x53539f){logger[_0x7f7e('0xf')](_0x7f7e('0xb'),_0x218f22,_0x53539f);_0x7e51b8(_0x53539f);});});}function respondWithResult(_0x4e7b4a,_0x1fc8d2){_0x1fc8d2=_0x1fc8d2||0xc8;return function(_0x32d038){if(_0x32d038){return _0x4e7b4a['status'](_0x1fc8d2)[_0x7f7e('0x13')](_0x32d038);}};}function respondWithFilteredResult(_0x55fed3,_0xa26587){return function(_0x3df391){if(_0x3df391){var _0x26da0f=typeof _0xa26587[_0x7f7e('0x14')]==='undefined'&&typeof _0xa26587[_0x7f7e('0x15')]===_0x7f7e('0x16');var _0x2ba233=_0x3df391[_0x7f7e('0x17')];var _0x58420d=_0x26da0f?0x0:_0xa26587[_0x7f7e('0x14')];var _0x241eb2=_0x26da0f?_0x3df391['count']:_0xa26587[_0x7f7e('0x14')]+_0xa26587[_0x7f7e('0x15')];var _0x5dfc20;if(_0x241eb2>=_0x2ba233){_0x241eb2=_0x2ba233;_0x5dfc20=0xc8;}else{_0x5dfc20=0xce;}_0x55fed3[_0x7f7e('0x18')](_0x5dfc20);return _0x55fed3[_0x7f7e('0x19')](_0x7f7e('0x1a'),_0x58420d+'-'+_0x241eb2+'/'+_0x2ba233)[_0x7f7e('0x13')](_0x3df391);}return null;};}function saveUpdates(_0x2b7e90){return function(_0x2246ec){if(_0x2246ec){return _0x2246ec[_0x7f7e('0x1b')](_0x2b7e90)[_0x7f7e('0x9')](function(_0x2e9d50){return _0x2e9d50;});}return null;};}function removeEntity(_0x156afc){return function(_0x43438e){if(_0x43438e){return _0x43438e[_0x7f7e('0x1c')]()[_0x7f7e('0x9')](function(){_0x156afc[_0x7f7e('0x18')](0xcc)[_0x7f7e('0x1d')]();});}};}function handleEntityNotFound(_0x12a745){return function(_0x86a219){if(!_0x86a219){_0x12a745['sendStatus'](0x194);}return _0x86a219;};}function handleError(_0x190239,_0x5348e5){_0x5348e5=_0x5348e5||0x1f4;return function(_0x2ed6c0){logger[_0x7f7e('0xf')](_0x2ed6c0[_0x7f7e('0x1e')]);if(_0x2ed6c0['name']){delete _0x2ed6c0[_0x7f7e('0x1f')];}_0x190239[_0x7f7e('0x18')](_0x5348e5)[_0x7f7e('0x20')](_0x2ed6c0);};}exports[_0x7f7e('0x21')]=function(_0x570df6,_0x1223cf){var _0x373bd8={},_0x458472={},_0x207433={'count':0x0,'rows':[]};var _0x4d7582=_[_0x7f7e('0x22')](db['Network']['rawAttributes'],function(_0x3cb5e0){return{'name':_0x3cb5e0[_0x7f7e('0x23')],'type':_0x3cb5e0[_0x7f7e('0x24')][_0x7f7e('0x25')]};});_0x458472[_0x7f7e('0x26')]=_[_0x7f7e('0x22')](_0x4d7582,_0x7f7e('0x1f'));_0x458472[_0x7f7e('0x27')]=_['keys'](_0x570df6[_0x7f7e('0x27')]);_0x458472['filters']=_[_0x7f7e('0x28')](_0x458472[_0x7f7e('0x26')],_0x458472[_0x7f7e('0x27')]);_0x373bd8[_0x7f7e('0x29')]=_['intersection'](_0x458472[_0x7f7e('0x26')],qs[_0x7f7e('0x2a')](_0x570df6[_0x7f7e('0x27')]['fields']));_0x373bd8['attributes']=_0x373bd8['attributes'][_0x7f7e('0x2b')]?_0x373bd8[_0x7f7e('0x29')]:_0x458472[_0x7f7e('0x26')];if(!_0x570df6[_0x7f7e('0x27')]['hasOwnProperty'](_0x7f7e('0x2c'))){_0x373bd8[_0x7f7e('0x15')]=qs['limit'](_0x570df6[_0x7f7e('0x27')][_0x7f7e('0x15')]);_0x373bd8[_0x7f7e('0x14')]=qs[_0x7f7e('0x14')](_0x570df6['query']['offset']);}_0x373bd8[_0x7f7e('0x2d')]=qs[_0x7f7e('0x2e')](_0x570df6[_0x7f7e('0x27')]['sort']);_0x373bd8['where']=qs[_0x7f7e('0x2f')](_[_0x7f7e('0x30')](_0x570df6['query'],_0x458472[_0x7f7e('0x2f')]),_0x4d7582);if(_0x570df6[_0x7f7e('0x27')]['filter']){_0x373bd8[_0x7f7e('0x31')]=_[_0x7f7e('0x32')](_0x373bd8[_0x7f7e('0x31')],{'$or':_[_0x7f7e('0x22')](_0x4d7582,function(_0x358386){if(_0x358386[_0x7f7e('0x24')]!==_0x7f7e('0x33')){var _0x2bff48={};_0x2bff48[_0x358386[_0x7f7e('0x1f')]]={'$like':'%'+_0x570df6[_0x7f7e('0x27')][_0x7f7e('0x34')]+'%'};return _0x2bff48;}})});}_0x373bd8=_['merge']({},_0x373bd8,_0x570df6[_0x7f7e('0x35')]);var _0x514169={'where':_0x373bd8['where']};return db['Network'][_0x7f7e('0x17')](_0x514169)[_0x7f7e('0x9')](function(_0x2868df){_0x207433[_0x7f7e('0x17')]=_0x2868df;if(_0x570df6[_0x7f7e('0x27')][_0x7f7e('0x36')]){_0x373bd8[_0x7f7e('0x37')]=[{'all':!![]}];}return db[_0x7f7e('0x38')][_0x7f7e('0x39')](_0x373bd8);})[_0x7f7e('0x9')](function(_0x3e3760){_0x207433[_0x7f7e('0x3a')]=_0x3e3760;return _0x207433;})[_0x7f7e('0x9')](respondWithFilteredResult(_0x1223cf,_0x373bd8))[_0x7f7e('0x12')](handleError(_0x1223cf,null));};exports[_0x7f7e('0x3b')]=function(_0x8137f4,_0x4b5d5a){var _0x4868de={'raw':!![],'where':{'id':_0x8137f4[_0x7f7e('0x3c')]['id']}},_0x153d98={};_0x153d98['model']=_['keys'](db['Network']['rawAttributes']);_0x153d98[_0x7f7e('0x27')]=_[_0x7f7e('0x3d')](_0x8137f4['query']);_0x153d98[_0x7f7e('0x2f')]=_['intersection'](_0x153d98[_0x7f7e('0x26')],_0x153d98[_0x7f7e('0x27')]);_0x4868de[_0x7f7e('0x29')]=_['intersection'](_0x153d98[_0x7f7e('0x26')],qs[_0x7f7e('0x2a')](_0x8137f4['query'][_0x7f7e('0x2a')]));_0x4868de[_0x7f7e('0x29')]=_0x4868de[_0x7f7e('0x29')][_0x7f7e('0x2b')]?_0x4868de['attributes']:_0x153d98['model'];if(_0x8137f4[_0x7f7e('0x27')][_0x7f7e('0x36')]){_0x4868de[_0x7f7e('0x37')]=[{'all':!![]}];}_0x4868de=_[_0x7f7e('0x32')]({},_0x4868de,_0x8137f4[_0x7f7e('0x35')]);return db[_0x7f7e('0x38')][_0x7f7e('0x3e')](_0x4868de)['then'](handleEntityNotFound(_0x4b5d5a,null))[_0x7f7e('0x9')](respondWithResult(_0x4b5d5a,null))[_0x7f7e('0x12')](handleError(_0x4b5d5a,null));};exports[_0x7f7e('0x3f')]=function(_0x3481d3,_0x3e8913){var _0x397bd8;return db[_0x7f7e('0x38')]['create'](_0x3481d3[_0x7f7e('0x40')],{'raw':!![]})[_0x7f7e('0x9')](function(_0x26dab5){_0x397bd8=_0x26dab5;return db[_0x7f7e('0x38')][_0x7f7e('0x39')]({'where':{'type':_0x3481d3[_0x7f7e('0x40')][_0x7f7e('0x24')]},'raw':!![]});})[_0x7f7e('0x9')](function(_0x488ceb){if(_0x397bd8[_0x7f7e('0x24')]['toUpperCase']()=='STUN'){var _0x4bdc5d=fs[_0x7f7e('0x41')](path[_0x7f7e('0x42')](config[_0x7f7e('0x43')],_0x7f7e('0x44')),_0x7f7e('0x45'));var _0x323b59=ejs['render'](_0x4bdc5d,{'networks':_0x488ceb||[]});fs['writeFileSync'](_0x7f7e('0x46'),_0x323b59);return respondWithRpcPromise(_0x7f7e('0x47'),_0x7f7e('0x3f'),{'module':_0x7f7e('0x48')});}else if(_0x397bd8[_0x7f7e('0x24')]['toUpperCase']()==_0x7f7e('0x49')){var _0x3e3850=fs[_0x7f7e('0x41')](path[_0x7f7e('0x42')](config[_0x7f7e('0x43')],_0x7f7e('0x4a')),_0x7f7e('0x45'));var _0xe1538b=ejs['render'](_0x3e3850,{'networks':_0x488ceb||[]});fs[_0x7f7e('0x4b')](_0x7f7e('0x4c'),_0xe1538b);return respondWithRpcPromise('Reload',_0x7f7e('0x3f'),{'module':_0x7f7e('0x48')});}else{var _0x57cf81=fs['readFileSync'](path[_0x7f7e('0x42')](config[_0x7f7e('0x43')],'server/files/templates/network.ejs'),'utf8');var _0x3398a9=ejs[_0x7f7e('0x4d')](_0x57cf81,{'networks':_0x488ceb||[]});fs[_0x7f7e('0x4b')](util['format'](_0x7f7e('0x4e'),_0x3481d3[_0x7f7e('0x40')][_0x7f7e('0x24')][_0x7f7e('0x4f')]()),_0x3398a9);return respondWithRpcPromise(_0x7f7e('0x47'),_0x7f7e('0x3f'),{'module':_0x7f7e('0x50')});}})[_0x7f7e('0x9')](function(){return _0x397bd8;})['then'](respondWithResult(_0x3e8913,0xc9))[_0x7f7e('0x12')](handleError(_0x3e8913,null));};exports['update']=function(_0x32e998,_0x372359){var _0x38aca4;return db[_0x7f7e('0x38')][_0x7f7e('0x3e')]({'where':{'id':_0x32e998[_0x7f7e('0x3c')]['id']}})['then'](handleEntityNotFound(_0x372359,null))[_0x7f7e('0x9')](saveUpdates(_0x32e998[_0x7f7e('0x40')],null))[_0x7f7e('0x9')](function(_0x57d4ea){if(_0x57d4ea){_0x38aca4=_0x57d4ea;return db[_0x7f7e('0x38')][_0x7f7e('0x39')]({'where':{'type':_0x38aca4['type']},'raw':!![]});}return null;})[_0x7f7e('0x9')](function(_0x263796){if(_0x38aca4[_0x7f7e('0x24')][_0x7f7e('0x51')]()==_0x7f7e('0x52')){var _0x5063a8=fs[_0x7f7e('0x41')](path[_0x7f7e('0x42')](config[_0x7f7e('0x43')],'server/files/templates/stun_multiple.ejs'),_0x7f7e('0x45'));var _0x2b22e6=ejs['render'](_0x5063a8,{'networks':_0x263796||[]});fs[_0x7f7e('0x4b')]('/etc/asterisk/stun_xcally.conf',_0x2b22e6);return respondWithRpcPromise(_0x7f7e('0x47'),'update',{'module':_0x7f7e('0x48')});}else if(_0x38aca4[_0x7f7e('0x24')][_0x7f7e('0x51')]()==_0x7f7e('0x49')){var _0x27383e=fs[_0x7f7e('0x41')](path['join'](config['root'],_0x7f7e('0x4a')),_0x7f7e('0x45'));var _0x30f01d=ejs[_0x7f7e('0x4d')](_0x27383e,{'networks':_0x263796||[]});fs[_0x7f7e('0x4b')](_0x7f7e('0x4c'),_0x30f01d);return respondWithRpcPromise('Reload',_0x7f7e('0x1b'),{'module':_0x7f7e('0x48')});}else{var _0x100a67=fs[_0x7f7e('0x41')](path[_0x7f7e('0x42')](config['root'],_0x7f7e('0x53')),_0x7f7e('0x45'));var _0x2c2cc7=ejs['render'](_0x100a67,{'networks':_0x263796||[]});fs[_0x7f7e('0x4b')](util[_0x7f7e('0x54')](_0x7f7e('0x4e'),_0x32e998[_0x7f7e('0x40')][_0x7f7e('0x24')][_0x7f7e('0x4f')]()),_0x2c2cc7);return respondWithRpcPromise(_0x7f7e('0x47'),_0x7f7e('0x1b'),{'module':'chan_sip.so'});}})[_0x7f7e('0x9')](function(_0x2e5e38){if(_0x2e5e38){return _0x38aca4;}return null;})[_0x7f7e('0x9')](respondWithResult(_0x372359,null))['catch'](handleError(_0x372359,null));};exports[_0x7f7e('0x1c')]=function(_0x2bc697,_0x4efd7a){var _0x43bd95;return db[_0x7f7e('0x38')][_0x7f7e('0x3e')]({'where':{'id':_0x2bc697['params']['id']}})[_0x7f7e('0x9')](function(_0x21d598){_0x43bd95=_0x21d598;return _0x21d598;})[_0x7f7e('0x9')](handleEntityNotFound(_0x4efd7a,null))[_0x7f7e('0x9')](removeEntity(_0x4efd7a,null))[_0x7f7e('0x9')](function(){if(_0x43bd95){return db[_0x7f7e('0x38')][_0x7f7e('0x39')]({'where':{'type':_0x43bd95[_0x7f7e('0x24')]},'raw':!![]});}})[_0x7f7e('0x9')](function(_0x470043){if(_0x43bd95[_0x7f7e('0x24')][_0x7f7e('0x51')]()==_0x7f7e('0x52')){var _0x1b8366=fs[_0x7f7e('0x41')](path[_0x7f7e('0x42')](config[_0x7f7e('0x43')],_0x7f7e('0x44')),_0x7f7e('0x45'));var _0x36b454=ejs[_0x7f7e('0x4d')](_0x1b8366,{'networks':_0x470043||[]});fs[_0x7f7e('0x4b')](_0x7f7e('0x46'),_0x36b454);return respondWithRpcPromise(_0x7f7e('0x47'),'destroy',{'module':'res_stun_monitor.so'});}else if(_0x43bd95[_0x7f7e('0x24')][_0x7f7e('0x51')]()==_0x7f7e('0x49')){var _0x23ee91=fs[_0x7f7e('0x41')](path[_0x7f7e('0x42')](config[_0x7f7e('0x43')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x4b3259=ejs[_0x7f7e('0x4d')](_0x23ee91,{'networks':_0x470043||[]});fs[_0x7f7e('0x4b')]('/etc/asterisk/turn_xcally.conf',_0x4b3259);return respondWithRpcPromise(_0x7f7e('0x47'),_0x7f7e('0x1c'),{'module':_0x7f7e('0x48')});}else{var _0x4f272d=fs[_0x7f7e('0x41')](path[_0x7f7e('0x42')](config[_0x7f7e('0x43')],_0x7f7e('0x53')),_0x7f7e('0x45'));var _0x4ddf89=ejs['render'](_0x4f272d,{'networks':_0x470043||[]});fs[_0x7f7e('0x4b')](util[_0x7f7e('0x54')]('/etc/asterisk/sip_xcally_%s.conf',_0x43bd95[_0x7f7e('0x24')][_0x7f7e('0x4f')]()),_0x4ddf89);return respondWithRpcPromise(_0x7f7e('0x47'),_0x7f7e('0x1c'),{'module':_0x7f7e('0x50')});}})[_0x7f7e('0x12')](handleError(_0x4efd7a,null));}; \ No newline at end of file +var _0x676d=['json','offset','undefined','limit','count','set','Content-Range','name','send','map','Network','rawAttributes','key','model','query','keys','intersection','attributes','length','nolimit','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','params','fields','find','create','body','toUpperCase','join','root','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','TURN','readFileSync','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','Reload','res_stun_monitor.so','format','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','update','server/files/templates/network.ejs','toLowerCase','destroy','STUN','server/files/templates/stun_multiple.ejs','path','ejs','lodash','../../components/parsers/qs','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x676d,0x8e));var _0xd676=function(_0x4472d7,_0x3b3366){_0x4472d7=_0x4472d7-0x0;var _0x2a26c1=_0x676d[_0x4472d7];return _0x2a26c1;};'use strict';var util=require('util');var path=require(_0xd676('0x0'));var ejs=require(_0xd676('0x1'));var fs=require('fs');var _=require(_0xd676('0x2'));var qs=require(_0xd676('0x3'));var logger=require(_0xd676('0x4'))('api');var config=require(_0xd676('0x5'));var db=require('../../mysqldb')['db'];var jayson=require(_0xd676('0x6'));var client=jayson[_0xd676('0x7')][_0xd676('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x278172,_0x22f1b8,_0x50eef1,_0x23405e){return new Promise(function(_0x2a3f2b,_0x3f6520){var _0x4530f1=_0x23405e||client;return _0x4530f1[_0xd676('0x9')](_0x278172,_0x50eef1)[_0xd676('0xa')](function(_0x18dce3){logger[_0xd676('0xb')](_0xd676('0xc'),_0x22f1b8,_0xd676('0xd'));logger[_0xd676('0xe')](_0xd676('0xf'),_0x22f1b8,_0xd676('0xd'),JSON[_0xd676('0x10')](_0x18dce3));if(_0x18dce3[_0xd676('0x11')]){if(_0x18dce3[_0xd676('0x11')]['code']===0x1f4){logger['error'](_0xd676('0xc'),_0x22f1b8,_0x18dce3[_0xd676('0x11')][_0xd676('0x12')]);return _0x3f6520(_0x18dce3[_0xd676('0x11')]['message']);}logger[_0xd676('0x11')](_0xd676('0xc'),_0x22f1b8,_0x18dce3[_0xd676('0x11')][_0xd676('0x12')]);return _0x2a3f2b(_0x18dce3[_0xd676('0x11')]['message']);}else{logger['info'](_0xd676('0xc'),_0x22f1b8,'request\x20sent');_0x2a3f2b(_0x18dce3[_0xd676('0x13')][_0xd676('0x12')]);}})[_0xd676('0x14')](function(_0x2ab0da){logger[_0xd676('0x11')](_0xd676('0xc'),_0x22f1b8,_0x2ab0da);_0x3f6520(_0x2ab0da);});});}function respondWithResult(_0x28358d,_0x4bced0){_0x4bced0=_0x4bced0||0xc8;return function(_0x23778a){if(_0x23778a){return _0x28358d[_0xd676('0x15')](_0x4bced0)[_0xd676('0x16')](_0x23778a);}};}function respondWithFilteredResult(_0x46543e,_0x149f15){return function(_0x25730d){if(_0x25730d){var _0x14fe23=typeof _0x149f15[_0xd676('0x17')]===_0xd676('0x18')&&typeof _0x149f15[_0xd676('0x19')]===_0xd676('0x18');var _0x15e881=_0x25730d[_0xd676('0x1a')];var _0x34eb1e=_0x14fe23?0x0:_0x149f15['offset'];var _0xc715e4=_0x14fe23?_0x25730d[_0xd676('0x1a')]:_0x149f15[_0xd676('0x17')]+_0x149f15['limit'];var _0x4841fd;if(_0xc715e4>=_0x15e881){_0xc715e4=_0x15e881;_0x4841fd=0xc8;}else{_0x4841fd=0xce;}_0x46543e[_0xd676('0x15')](_0x4841fd);return _0x46543e[_0xd676('0x1b')](_0xd676('0x1c'),_0x34eb1e+'-'+_0xc715e4+'/'+_0x15e881)[_0xd676('0x16')](_0x25730d);}return null;};}function saveUpdates(_0x2fd825){return function(_0x561801){if(_0x561801){return _0x561801['update'](_0x2fd825)[_0xd676('0xa')](function(_0x23317b){return _0x23317b;});}return null;};}function removeEntity(_0x41cb46){return function(_0x361c47){if(_0x361c47){return _0x361c47['destroy']()['then'](function(){_0x41cb46[_0xd676('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x310095){return function(_0x21873f){if(!_0x21873f){_0x310095['sendStatus'](0x194);}return _0x21873f;};}function handleError(_0x1c46a4,_0x5824a7){_0x5824a7=_0x5824a7||0x1f4;return function(_0x4ad80f){logger[_0xd676('0x11')](_0x4ad80f['stack']);if(_0x4ad80f['name']){delete _0x4ad80f[_0xd676('0x1d')];}_0x1c46a4[_0xd676('0x15')](_0x5824a7)[_0xd676('0x1e')](_0x4ad80f);};}exports['index']=function(_0x4cd5be,_0x2df4ce){var _0x3a1013={},_0x514a29={},_0xf74326={'count':0x0,'rows':[]};var _0x491a21=_[_0xd676('0x1f')](db[_0xd676('0x20')][_0xd676('0x21')],function(_0x5d433c){return{'name':_0x5d433c['fieldName'],'type':_0x5d433c['type'][_0xd676('0x22')]};});_0x514a29[_0xd676('0x23')]=_[_0xd676('0x1f')](_0x491a21,_0xd676('0x1d'));_0x514a29[_0xd676('0x24')]=_[_0xd676('0x25')](_0x4cd5be[_0xd676('0x24')]);_0x514a29['filters']=_['intersection'](_0x514a29[_0xd676('0x23')],_0x514a29[_0xd676('0x24')]);_0x3a1013['attributes']=_[_0xd676('0x26')](_0x514a29[_0xd676('0x23')],qs['fields'](_0x4cd5be['query']['fields']));_0x3a1013[_0xd676('0x27')]=_0x3a1013['attributes'][_0xd676('0x28')]?_0x3a1013[_0xd676('0x27')]:_0x514a29[_0xd676('0x23')];if(!_0x4cd5be['query']['hasOwnProperty'](_0xd676('0x29'))){_0x3a1013[_0xd676('0x19')]=qs[_0xd676('0x19')](_0x4cd5be[_0xd676('0x24')]['limit']);_0x3a1013['offset']=qs[_0xd676('0x17')](_0x4cd5be[_0xd676('0x24')][_0xd676('0x17')]);}_0x3a1013[_0xd676('0x2a')]=qs[_0xd676('0x2b')](_0x4cd5be[_0xd676('0x24')][_0xd676('0x2b')]);_0x3a1013[_0xd676('0x2c')]=qs['filters'](_[_0xd676('0x2d')](_0x4cd5be[_0xd676('0x24')],_0x514a29[_0xd676('0x2e')]),_0x491a21);if(_0x4cd5be[_0xd676('0x24')][_0xd676('0x2f')]){_0x3a1013[_0xd676('0x2c')]=_[_0xd676('0x30')](_0x3a1013[_0xd676('0x2c')],{'$or':_[_0xd676('0x1f')](_0x491a21,function(_0x48bb5b){if(_0x48bb5b[_0xd676('0x31')]!==_0xd676('0x32')){var _0x720b78={};_0x720b78[_0x48bb5b[_0xd676('0x1d')]]={'$like':'%'+_0x4cd5be[_0xd676('0x24')][_0xd676('0x2f')]+'%'};return _0x720b78;}})});}_0x3a1013=_['merge']({},_0x3a1013,_0x4cd5be['options']);var _0x2b047c={'where':_0x3a1013[_0xd676('0x2c')]};return db[_0xd676('0x20')]['count'](_0x2b047c)['then'](function(_0x25dd23){_0xf74326[_0xd676('0x1a')]=_0x25dd23;if(_0x4cd5be[_0xd676('0x24')][_0xd676('0x33')]){_0x3a1013[_0xd676('0x34')]=[{'all':!![]}];}return db[_0xd676('0x20')][_0xd676('0x35')](_0x3a1013);})[_0xd676('0xa')](function(_0x52c099){_0xf74326[_0xd676('0x36')]=_0x52c099;return _0xf74326;})[_0xd676('0xa')](respondWithFilteredResult(_0x2df4ce,_0x3a1013))[_0xd676('0x14')](handleError(_0x2df4ce,null));};exports['show']=function(_0x52b83b,_0x29ae80){var _0x1bf67d={'raw':!![],'where':{'id':_0x52b83b[_0xd676('0x37')]['id']}},_0x1bce9e={};_0x1bce9e[_0xd676('0x23')]=_['keys'](db[_0xd676('0x20')]['rawAttributes']);_0x1bce9e[_0xd676('0x24')]=_[_0xd676('0x25')](_0x52b83b['query']);_0x1bce9e[_0xd676('0x2e')]=_[_0xd676('0x26')](_0x1bce9e[_0xd676('0x23')],_0x1bce9e['query']);_0x1bf67d[_0xd676('0x27')]=_['intersection'](_0x1bce9e['model'],qs[_0xd676('0x38')](_0x52b83b[_0xd676('0x24')][_0xd676('0x38')]));_0x1bf67d['attributes']=_0x1bf67d['attributes'][_0xd676('0x28')]?_0x1bf67d[_0xd676('0x27')]:_0x1bce9e[_0xd676('0x23')];if(_0x52b83b[_0xd676('0x24')][_0xd676('0x33')]){_0x1bf67d[_0xd676('0x34')]=[{'all':!![]}];}_0x1bf67d=_[_0xd676('0x30')]({},_0x1bf67d,_0x52b83b['options']);return db[_0xd676('0x20')][_0xd676('0x39')](_0x1bf67d)['then'](handleEntityNotFound(_0x29ae80,null))['then'](respondWithResult(_0x29ae80,null))[_0xd676('0x14')](handleError(_0x29ae80,null));};exports[_0xd676('0x3a')]=function(_0x56ca76,_0x2af98d){var _0x4b1448;return db['Network']['create'](_0x56ca76[_0xd676('0x3b')],{'raw':!![]})['then'](function(_0x7ede6a){_0x4b1448=_0x7ede6a;return db[_0xd676('0x20')][_0xd676('0x35')]({'where':{'type':_0x56ca76['body']['type']},'raw':!![]});})['then'](function(_0x5173fe){if(_0x4b1448[_0xd676('0x31')][_0xd676('0x3c')]()=='STUN'){var _0x22888e=fs['readFileSync'](path[_0xd676('0x3d')](config[_0xd676('0x3e')],'server/files/templates/stun_multiple.ejs'),_0xd676('0x3f'));var _0x5337cc=ejs[_0xd676('0x40')](_0x22888e,{'networks':_0x5173fe||[]});fs[_0xd676('0x41')](_0xd676('0x42'),_0x5337cc);return respondWithRpcPromise('Reload',_0xd676('0x3a'),{'module':'res_stun_monitor.so'});}else if(_0x4b1448[_0xd676('0x31')][_0xd676('0x3c')]()==_0xd676('0x43')){var _0x5472cf=fs[_0xd676('0x44')](path[_0xd676('0x3d')](config[_0xd676('0x3e')],_0xd676('0x45')),'utf8');var _0x3719d6=ejs[_0xd676('0x40')](_0x5472cf,{'networks':_0x5173fe||[]});fs['writeFileSync'](_0xd676('0x46'),_0x3719d6);return respondWithRpcPromise(_0xd676('0x47'),'create',{'module':_0xd676('0x48')});}else{var _0x2f24ba=fs[_0xd676('0x44')](path[_0xd676('0x3d')](config[_0xd676('0x3e')],'server/files/templates/network.ejs'),'utf8');var _0x2a73d2=ejs['render'](_0x2f24ba,{'networks':_0x5173fe||[]});fs[_0xd676('0x41')](util[_0xd676('0x49')](_0xd676('0x4a'),_0x56ca76[_0xd676('0x3b')]['type']['toLowerCase']()),_0x2a73d2);return respondWithRpcPromise(_0xd676('0x47'),_0xd676('0x3a'),{'module':_0xd676('0x4b')});}})[_0xd676('0xa')](function(){return _0x4b1448;})[_0xd676('0xa')](respondWithResult(_0x2af98d,0xc9))['catch'](handleError(_0x2af98d,null));};exports[_0xd676('0x4c')]=function(_0x4fc8be,_0x180a8d){var _0x581cce;return db[_0xd676('0x20')]['find']({'where':{'id':_0x4fc8be[_0xd676('0x37')]['id']}})[_0xd676('0xa')](handleEntityNotFound(_0x180a8d,null))['then'](saveUpdates(_0x4fc8be[_0xd676('0x3b')],null))[_0xd676('0xa')](function(_0x42747f){if(_0x42747f){_0x581cce=_0x42747f;return db[_0xd676('0x20')]['findAll']({'where':{'type':_0x581cce[_0xd676('0x31')]},'raw':!![]});}return null;})[_0xd676('0xa')](function(_0x4e699c){if(_0x581cce[_0xd676('0x31')]['toUpperCase']()=='STUN'){var _0x54d0d7=fs['readFileSync'](path[_0xd676('0x3d')](config[_0xd676('0x3e')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x1ae5ff=ejs[_0xd676('0x40')](_0x54d0d7,{'networks':_0x4e699c||[]});fs[_0xd676('0x41')]('/etc/asterisk/stun_xcally.conf',_0x1ae5ff);return respondWithRpcPromise(_0xd676('0x47'),_0xd676('0x4c'),{'module':'res_stun_monitor.so'});}else if(_0x581cce['type'][_0xd676('0x3c')]()=='TURN'){var _0x559c97=fs['readFileSync'](path[_0xd676('0x3d')](config['root'],_0xd676('0x45')),_0xd676('0x3f'));var _0x2f4d20=ejs[_0xd676('0x40')](_0x559c97,{'networks':_0x4e699c||[]});fs[_0xd676('0x41')](_0xd676('0x46'),_0x2f4d20);return respondWithRpcPromise(_0xd676('0x47'),'update',{'module':_0xd676('0x48')});}else{var _0x26813c=fs[_0xd676('0x44')](path[_0xd676('0x3d')](config[_0xd676('0x3e')],_0xd676('0x4d')),'utf8');var _0x29a034=ejs['render'](_0x26813c,{'networks':_0x4e699c||[]});fs[_0xd676('0x41')](util['format'](_0xd676('0x4a'),_0x4fc8be['body'][_0xd676('0x31')][_0xd676('0x4e')]()),_0x29a034);return respondWithRpcPromise('Reload','update',{'module':_0xd676('0x4b')});}})[_0xd676('0xa')](function(_0x3c8a60){if(_0x3c8a60){return _0x581cce;}return null;})[_0xd676('0xa')](respondWithResult(_0x180a8d,null))[_0xd676('0x14')](handleError(_0x180a8d,null));};exports[_0xd676('0x4f')]=function(_0x2413b6,_0x2634f2){var _0x97f94;return db[_0xd676('0x20')]['find']({'where':{'id':_0x2413b6[_0xd676('0x37')]['id']}})[_0xd676('0xa')](function(_0xfe5a3a){_0x97f94=_0xfe5a3a;return _0xfe5a3a;})[_0xd676('0xa')](handleEntityNotFound(_0x2634f2,null))[_0xd676('0xa')](removeEntity(_0x2634f2,null))[_0xd676('0xa')](function(){if(_0x97f94){return db[_0xd676('0x20')][_0xd676('0x35')]({'where':{'type':_0x97f94[_0xd676('0x31')]},'raw':!![]});}})['then'](function(_0x560e09){if(_0x97f94[_0xd676('0x31')][_0xd676('0x3c')]()==_0xd676('0x50')){var _0x30242f=fs[_0xd676('0x44')](path['join'](config[_0xd676('0x3e')],_0xd676('0x51')),_0xd676('0x3f'));var _0x3383d2=ejs['render'](_0x30242f,{'networks':_0x560e09||[]});fs[_0xd676('0x41')]('/etc/asterisk/stun_xcally.conf',_0x3383d2);return respondWithRpcPromise('Reload',_0xd676('0x4f'),{'module':'res_stun_monitor.so'});}else if(_0x97f94['type'][_0xd676('0x3c')]()==_0xd676('0x43')){var _0x560d21=fs['readFileSync'](path[_0xd676('0x3d')](config[_0xd676('0x3e')],_0xd676('0x45')),_0xd676('0x3f'));var _0x4bfb9=ejs[_0xd676('0x40')](_0x560d21,{'networks':_0x560e09||[]});fs[_0xd676('0x41')]('/etc/asterisk/turn_xcally.conf',_0x4bfb9);return respondWithRpcPromise(_0xd676('0x47'),_0xd676('0x4f'),{'module':_0xd676('0x48')});}else{var _0x2fc03e=fs['readFileSync'](path['join'](config[_0xd676('0x3e')],_0xd676('0x4d')),'utf8');var _0xaf690=ejs['render'](_0x2fc03e,{'networks':_0x560e09||[]});fs[_0xd676('0x41')](util[_0xd676('0x49')](_0xd676('0x4a'),_0x97f94[_0xd676('0x31')][_0xd676('0x4e')]()),_0xaf690);return respondWithRpcPromise(_0xd676('0x47'),_0xd676('0x4f'),{'module':'chan_sip.so'});}})[_0xd676('0x14')](handleError(_0x2634f2,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index ac5572f..c641e99 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 _0x68fc=['bluebird','path','./network.attributes','exports','network','lodash','util','../../config/logger'];(function(_0x4a01b2,_0x5ebc4){var _0x55b9ba=function(_0x4ed1ae){while(--_0x4ed1ae){_0x4a01b2['push'](_0x4a01b2['shift']());}};_0x55b9ba(++_0x5ebc4);}(_0x68fc,0xa5));var _0xc68f=function(_0x3d3b1a,_0x4e47ae){_0x3d3b1a=_0x3d3b1a-0x0;var _0x83a068=_0x68fc[_0x3d3b1a];return _0x83a068;};'use strict';var _=require(_0xc68f('0x0'));var util=require(_0xc68f('0x1'));var logger=require(_0xc68f('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc68f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc68f('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc68f('0x5'));module[_0xc68f('0x6')]=function(_0x1c6df9,_0x363cdf){return _0x1c6df9['define']('Network',attributes,{'tableName':_0xc68f('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6a24=['util','api','moment','bluebird','request-promise','path','../../config/environment','./network.attributes','network','lodash'];(function(_0x27604f,_0x5ae336){var _0x40d189=function(_0xebacde){while(--_0xebacde){_0x27604f['push'](_0x27604f['shift']());}};_0x40d189(++_0x5ae336);}(_0x6a24,0xd1));var _0x46a2=function(_0x1b046e,_0x2d9b6b){_0x1b046e=_0x1b046e-0x0;var _0x4c31bb=_0x6a24[_0x1b046e];return _0x4c31bb;};'use strict';var _=require(_0x46a2('0x0'));var util=require(_0x46a2('0x1'));var logger=require('../../config/logger')(_0x46a2('0x2'));var moment=require(_0x46a2('0x3'));var BPromise=require(_0x46a2('0x4'));var rp=require(_0x46a2('0x5'));var fs=require('fs');var path=require(_0x46a2('0x6'));var rimraf=require('rimraf');var config=require(_0x46a2('0x7'));var attributes=require(_0x46a2('0x8'));module['exports']=function(_0x22de0d,_0x8b6541){return _0x22de0d['define']('Network',attributes,{'tableName':_0x46a2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index b129f6e..f878d60 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(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x218cc7,_0x4f0ccb){_0x218cc7=_0x218cc7-0x0;var _0x32852f=_0x7a54[_0x218cc7];return _0x32852f;};'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(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x7a54,0x106));var _0x47a5=function(_0x34e86a,_0x405036){_0x34e86a=_0x34e86a-0x0;var _0x3a1a32=_0x7a54[_0x34e86a];return _0x3a1a32;};'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 84d13d0..2e26055 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 _0xda2d=['getDispositions','/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','/:id/users','post','create','addDisposition','/:id/notify','notify','/:id/applications','addApplications','addAgents','put','/:id','delete','destroy','removeDispositions','removeAnswers','util','path','connect-timeout','express','Router','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions'];(function(_0x2bd9db,_0x2f6076){var _0x28441e=function(_0x354695){while(--_0x354695){_0x2bd9db['push'](_0x2bd9db['shift']());}};_0x28441e(++_0x2f6076);}(_0xda2d,0x102));var _0xdda2=function(_0x1d61d4,_0x1b73ec){_0x1d61d4=_0x1d61d4-0x0;var _0x594261=_0xda2d[_0x1d61d4];return _0x594261;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0x7')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xc')]);router['get'](_0xdda2('0xd'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xe')]);router[_0xdda2('0x7')](_0xdda2('0xf'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x10')]);router[_0xdda2('0x7')]('/:id/applications',auth['isAuthenticated'](),controller['getApplications']);router[_0xdda2('0x7')](_0xdda2('0x11'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x12')]);router[_0xdda2('0x7')](_0xdda2('0x13'),auth[_0xdda2('0x8')](),controller['getAgents']);router[_0xdda2('0x14')]('/',auth['isAuthenticated'](),controller[_0xdda2('0x15')]);router[_0xdda2('0x14')](_0xdda2('0xd'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x16')]);router['post']('/:id/canned_answers',auth[_0xdda2('0x8')](),controller['addAnswer']);router[_0xdda2('0x14')](_0xdda2('0x17'),controller[_0xdda2('0x18')]);router[_0xdda2('0x14')](_0xdda2('0x19'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x1a')]);router[_0xdda2('0x14')](_0xdda2('0x13'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x1b')]);router[_0xdda2('0x14')]('/:id/send',auth[_0xdda2('0x8')](),controller['send']);router[_0xdda2('0x1c')](_0xdda2('0x1d'),auth[_0xdda2('0x8')](),controller['update']);router[_0xdda2('0x1e')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0x1f')]);router['delete'](_0xdda2('0xd'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x20')]);router[_0xdda2('0x1e')](_0xdda2('0xf'),auth['isAuthenticated'](),controller[_0xdda2('0x21')]);router[_0xdda2('0x1e')](_0xdda2('0x13'),auth[_0xdda2('0x8')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xb44a=['delete','removeDispositions','path','express','../../components/auth/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','/:id/notify','notify','/:id/users','addAgents','put','update','destroy'];(function(_0x5e649f,_0x16bdb2){var _0x29a25c=function(_0x1cda9d){while(--_0x1cda9d){_0x5e649f['push'](_0x5e649f['shift']());}};_0x29a25c(++_0x16bdb2);}(_0xb44a,0x1c2));var _0xab44=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xb44a[_0x92c450];return _0x2a9599;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xab44('0x0'));var timeout=require('connect-timeout');var express=require(_0xab44('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xab44('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xab44('0x3'));var controller=require(_0xab44('0x4'));router[_0xab44('0x5')]('/',auth[_0xab44('0x6')](),controller[_0xab44('0x7')]);router[_0xab44('0x5')](_0xab44('0x8'),auth[_0xab44('0x6')](),controller[_0xab44('0x9')]);router[_0xab44('0x5')](_0xab44('0xa'),auth[_0xab44('0x6')](),controller[_0xab44('0xb')]);router['get'](_0xab44('0xc'),auth['isAuthenticated'](),controller[_0xab44('0xd')]);router['get']('/:id/canned_answers',auth[_0xab44('0x6')](),controller[_0xab44('0xe')]);router[_0xab44('0x5')](_0xab44('0xf'),auth[_0xab44('0x6')](),controller[_0xab44('0x10')]);router['get']('/:id/interactions',auth[_0xab44('0x6')](),controller['getInteractions']);router[_0xab44('0x5')]('/:id/users',auth[_0xab44('0x6')](),controller[_0xab44('0x11')]);router[_0xab44('0x12')]('/',auth[_0xab44('0x6')](),controller[_0xab44('0x13')]);router[_0xab44('0x12')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xab44('0x14')]);router[_0xab44('0x12')](_0xab44('0x15'),auth[_0xab44('0x6')](),controller[_0xab44('0x16')]);router[_0xab44('0x12')](_0xab44('0x17'),controller[_0xab44('0x18')]);router[_0xab44('0x12')](_0xab44('0xf'),auth[_0xab44('0x6')](),controller['addApplications']);router[_0xab44('0x12')](_0xab44('0x19'),auth[_0xab44('0x6')](),controller[_0xab44('0x1a')]);router[_0xab44('0x12')]('/:id/send',auth[_0xab44('0x6')](),controller['send']);router[_0xab44('0x1b')](_0xab44('0xa'),auth[_0xab44('0x6')](),controller[_0xab44('0x1c')]);router['delete'](_0xab44('0xa'),auth[_0xab44('0x6')](),controller[_0xab44('0x1d')]);router[_0xab44('0x1e')](_0xab44('0xc'),auth[_0xab44('0x6')](),controller[_0xab44('0x1f')]);router['delete']('/:id/canned_answers',auth[_0xab44('0x6')](),controller['removeAnswers']);router[_0xab44('0x1e')]('/:id/users',auth[_0xab44('0x6')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index cc2a59e..a54b11a 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 _0xf690=['TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','STRING','name'];(function(_0xa3217d,_0x2a621f){var _0x10f6cc=function(_0x2d4b58){while(--_0x2d4b58){_0xa3217d['push'](_0xa3217d['shift']());}};_0x10f6cc(++_0x2a621f);}(_0xf690,0x98));var _0x0f69=function(_0x1b6563,_0x3bf0f1){_0x1b6563=_0x1b6563-0x0;var _0xdea7b8=_0xf690[_0x1b6563];return _0xdea7b8;};'use strict';var Sequelize=require(_0x0f69('0x0'));var rs=require(_0x0f69('0x1'));module['exports']={'name':{'type':Sequelize[_0x0f69('0x2')],'unique':_0x0f69('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x0f69('0x2')]},'token':{'type':Sequelize[_0x0f69('0x2')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x0f69('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x0f69('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x0f69('0x4')],'defaultValue':function(){return _0x0f69('0x5');}},'notificationSound':{'type':Sequelize[_0x0f69('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0f69('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0f69('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x0f69('0x2')]},'queueTransfer':{'type':Sequelize[_0x0f69('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0f69('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0f69('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0f69('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x0f69('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x0f69('0x6')],'defaultValue':![],'comment':_0x0f69('0x9'),'set':function(_0x33b657){if(!_0x33b657)this[_0x0f69('0xa')](_0x0f69('0xb'),null);this[_0x0f69('0xa')](_0x0f69('0xc'),_0x33b657);}}}; \ No newline at end of file +var _0xbac6=['BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','STRING','name','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x58746d,_0x5151f6){var _0x584627=function(_0x1c2da7){while(--_0x1c2da7){_0x58746d['push'](_0x58746d['shift']());}};_0x584627(++_0x5151f6);}(_0xbac6,0xc6));var _0x6bac=function(_0x172d4c,_0x143e2d){_0x172d4c=_0x172d4c-0x0;var _0x1245ed=_0xbac6[_0x172d4c];return _0x1245ed;};'use strict';var Sequelize=require(_0x6bac('0x0'));var rs=require(_0x6bac('0x1'));module['exports']={'name':{'type':Sequelize[_0x6bac('0x2')],'unique':_0x6bac('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x6bac('0x2')]},'token':{'type':Sequelize[_0x6bac('0x2')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x6bac('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x6bac('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x6bac('0x4')],'defaultValue':function(){return _0x6bac('0x5');}},'notificationSound':{'type':Sequelize[_0x6bac('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x6bac('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6bac('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6bac('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6bac('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x6bac('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x6bac('0x6')],'defaultValue':![],'comment':_0x6bac('0x9'),'set':function(_0x34f02a){if(!_0x34f02a)this[_0x6bac('0xa')](_0x6bac('0xb'),null);this[_0x6bac('0xa')]('mandatoryDisposition',_0x34f02a);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index f7dde1e..6462b45 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 _0x5162=['createdAt','updatedAt','CompanyId','ListId','isNil','from','Sequelize','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','List','CmContact','Contacts','DESC','OpenchannelApplication','account','applications','Applications','list','orderBy','asc','defaults','contact','lastName','threadId','OpenchannelInteraction','externalUrl','spread','messageId','interaction','created','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','queueId','queue','Start','EventManager','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','getApplications','getInteractions','fullname','internal','Tags','tag','addAgents','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','User','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','out','Messages','dataValues','eml-format','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','request','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','info','catch','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','get','destroy','end','stack','send','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','model','name','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelAccounts','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','notify','ValidationError','no\x20available\x20attributes'];(function(_0x5d221c,_0x18378f){var _0x4dcdea=function(_0x392604){while(--_0x392604){_0x5d221c['push'](_0x5d221c['shift']());}};_0x4dcdea(++_0x18378f);}(_0x5162,0x103));var _0x2516=function(_0x45dafa,_0x171e29){_0x45dafa=_0x45dafa-0x0;var _0xeb385a=_0x5162[_0x45dafa];return _0xeb385a;};'use strict';var emlformat=require(_0x2516('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2516('0x1'));var BPromise=require(_0x2516('0x2'));var Mustache=require(_0x2516('0x3'));var util=require(_0x2516('0x4'));var path=require(_0x2516('0x5'));var sox=require(_0x2516('0x6'));var csv=require(_0x2516('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2516('0x8'));var crypto=require(_0x2516('0x9'));var jsforce=require(_0x2516('0xa'));var deskjs=require(_0x2516('0xb'));var toCsv=require(_0x2516('0x7'));var querystring=require(_0x2516('0xc'));var Papa=require(_0x2516('0xd'));var Redis=require('ioredis');var authService=require(_0x2516('0xe'));var qs=require(_0x2516('0xf'));var as=require(_0x2516('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x2516('0x11'));var licenseUtil=require(_0x2516('0x12'));var db=require(_0x2516('0x13'))['db'];config[_0x2516('0x14')]=_['defaults'](config[_0x2516('0x14')],{'host':_0x2516('0x15'),'port':0x18eb});var socket=require(_0x2516('0x16'))(new Redis(config[_0x2516('0x14')]));require(_0x2516('0x17'))[_0x2516('0x18')](socket);var jayson=require(_0x2516('0x19'));var client=jayson[_0x2516('0x1a')][_0x2516('0x1b')]({'port':0x232c});var client9002=jayson[_0x2516('0x1a')][_0x2516('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x2ec31f,_0x19aacb,_0x5dee15,_0x3543d){return new BPromise(function(_0x5623be,_0x1fdd73){var _0x1ced29=_0x3543d||client;return _0x1ced29[_0x2516('0x1c')](_0x2ec31f,_0x5dee15)['then'](function(_0x1979d7){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x19aacb,_0x2516('0x1d'));logger[_0x2516('0x1e')](_0x2516('0x1f'),_0x19aacb,_0x2516('0x1d'),JSON[_0x2516('0x20')](_0x1979d7));if(_0x1979d7[_0x2516('0x21')]){if(_0x1979d7[_0x2516('0x21')][_0x2516('0x22')]===0x1f4){logger[_0x2516('0x21')](_0x2516('0x23'),_0x19aacb,_0x1979d7[_0x2516('0x21')][_0x2516('0x24')]);return _0x1fdd73(_0x1979d7[_0x2516('0x21')]['message']);}logger['error'](_0x2516('0x23'),_0x19aacb,_0x1979d7[_0x2516('0x21')][_0x2516('0x24')]);return _0x5623be(_0x1979d7[_0x2516('0x21')][_0x2516('0x24')]);}else{logger[_0x2516('0x25')](_0x2516('0x23'),_0x19aacb,_0x2516('0x1d'));_0x5623be(_0x1979d7['result'][_0x2516('0x24')]);}})[_0x2516('0x26')](function(_0x774b60){logger[_0x2516('0x21')]('OpenchannelAccount,\x20%s,\x20%s',_0x19aacb,_0x774b60);_0x1fdd73(_0x774b60);});});}function respondWithStatusCode(_0x399c16,_0x30eeb9){_0x30eeb9=_0x30eeb9||0xcc;return function(_0x1f722c){if(_0x1f722c){return _0x399c16[_0x2516('0x27')](_0x30eeb9);}return _0x399c16[_0x2516('0x28')](_0x30eeb9)['end']();};}function respondWithResult(_0x3c5c3c,_0x1750e7){_0x1750e7=_0x1750e7||0xc8;return function(_0x935035){if(_0x935035){return _0x3c5c3c[_0x2516('0x28')](_0x1750e7)[_0x2516('0x29')](_0x935035);}};}function respondWithFilteredResult(_0x285e67,_0x556f01){return function(_0x136893){if(_0x136893){var _0x20dc9f=typeof _0x556f01['offset']===_0x2516('0x2a')&&typeof _0x556f01[_0x2516('0x2b')]===_0x2516('0x2a');var _0x3b1aa6=_0x136893[_0x2516('0x2c')];var _0x170324=_0x20dc9f?0x0:_0x556f01[_0x2516('0x2d')];var _0x3c1daf=_0x20dc9f?_0x136893[_0x2516('0x2c')]:_0x556f01[_0x2516('0x2d')]+_0x556f01[_0x2516('0x2b')];var _0x2978b2;if(_0x3c1daf>=_0x3b1aa6){_0x3c1daf=_0x3b1aa6;_0x2978b2=0xc8;}else{_0x2978b2=0xce;}_0x285e67[_0x2516('0x28')](_0x2978b2);return _0x285e67[_0x2516('0x2e')](_0x2516('0x2f'),_0x170324+'-'+_0x3c1daf+'/'+_0x3b1aa6)['json'](_0x136893);}return null;};}function patchUpdates(_0x3e7a55){return function(_0x54147b){try{jsonpatch[_0x2516('0x30')](_0x54147b,_0x3e7a55,!![]);}catch(_0x4dff85){return BPromise[_0x2516('0x31')](_0x4dff85);}return _0x54147b['save']();};}function saveUpdates(_0x420219,_0x9133f8){return function(_0x1c26ca){if(_0x1c26ca){return _0x1c26ca[_0x2516('0x32')](_0x420219)[_0x2516('0x33')](function(_0x3947e7){return _0x3947e7;});}return null;};}function removeEntity(_0x38e50a,_0x1c74ca){return function(_0x1ad634){if(_0x1ad634){return _0x1ad634['destroy']()[_0x2516('0x33')](function(){var _0x4578c7=_0x1ad634[_0x2516('0x34')]({'plain':!![]});var _0x22868a='OpenchannelAccounts';return db['UserProfileResource'][_0x2516('0x35')]({'where':{'type':_0x22868a,'resourceId':_0x4578c7['id']}})[_0x2516('0x33')](function(){return _0x1ad634;});})[_0x2516('0x33')](function(){_0x38e50a[_0x2516('0x28')](0xcc)[_0x2516('0x36')]();});}};}function handleEntityNotFound(_0x164f07,_0x1979b5){return function(_0x1bc9ee){if(!_0x1bc9ee){_0x164f07[_0x2516('0x27')](0x194);}return _0x1bc9ee;};}function handleError(_0x3e524c,_0x541d69){_0x541d69=_0x541d69||0x1f4;return function(_0x4844a1){logger[_0x2516('0x21')](_0x4844a1[_0x2516('0x37')]);if(_0x4844a1['name']){delete _0x4844a1['name'];}_0x3e524c[_0x2516('0x28')](_0x541d69)[_0x2516('0x38')](_0x4844a1);};}exports['index']=function(_0x3982ca,_0x52ef6b){var _0x322fb7={'include':[{'model':db[_0x2516('0x39')],'as':_0x2516('0x3a')}]},_0x4412cf={},_0x550ca5={'count':0x0,'rows':[]};var _0x155cf7=_[_0x2516('0x3b')](db[_0x2516('0x3c')][_0x2516('0x3d')],function(_0x2137a4){return{'name':_0x2137a4[_0x2516('0x3e')],'type':_0x2137a4[_0x2516('0x3f')][_0x2516('0x40')]};});_0x4412cf[_0x2516('0x41')]=_[_0x2516('0x3b')](_0x155cf7,_0x2516('0x42'));_0x4412cf['query']=_[_0x2516('0x43')](_0x3982ca[_0x2516('0x44')]);_0x4412cf['filters']=_[_0x2516('0x45')](_0x4412cf[_0x2516('0x41')],_0x4412cf[_0x2516('0x44')]);_0x322fb7[_0x2516('0x46')]=_[_0x2516('0x45')](_0x4412cf['model'],qs[_0x2516('0x47')](_0x3982ca[_0x2516('0x44')][_0x2516('0x47')]));_0x322fb7[_0x2516('0x46')]=_0x322fb7[_0x2516('0x46')][_0x2516('0x48')]?_0x322fb7['attributes']:_0x4412cf[_0x2516('0x41')];if(!_0x3982ca[_0x2516('0x44')][_0x2516('0x49')](_0x2516('0x4a'))){_0x322fb7[_0x2516('0x2b')]=qs[_0x2516('0x2b')](_0x3982ca[_0x2516('0x44')]['limit']);_0x322fb7[_0x2516('0x2d')]=qs['offset'](_0x3982ca[_0x2516('0x44')]['offset']);}_0x322fb7[_0x2516('0x4b')]=qs[_0x2516('0x4c')](_0x3982ca[_0x2516('0x44')]['sort']);_0x322fb7['where']=qs[_0x2516('0x4d')](_[_0x2516('0x4e')](_0x3982ca['query'],_0x4412cf['filters']),_0x155cf7);if(_0x3982ca[_0x2516('0x44')][_0x2516('0x4f')]){_0x322fb7[_0x2516('0x50')]=_['merge'](_0x322fb7[_0x2516('0x50')],{'$or':_['map'](_0x155cf7,function(_0x2c7e2d){if(_0x2c7e2d[_0x2516('0x3f')]!==_0x2516('0x51')){var _0x3af4c9={};_0x3af4c9[_0x2c7e2d['name']]={'$like':'%'+_0x3982ca[_0x2516('0x44')][_0x2516('0x4f')]+'%'};return _0x3af4c9;}})});}_0x322fb7=_[_0x2516('0x52')]({},_0x322fb7,_0x3982ca[_0x2516('0x53')]);var _0x43874c={'where':_0x322fb7['where']};return db[_0x2516('0x3c')][_0x2516('0x2c')](_0x43874c)[_0x2516('0x33')](function(_0x2e359e){_0x550ca5['count']=_0x2e359e;if(_0x3982ca[_0x2516('0x44')][_0x2516('0x54')]){_0x322fb7[_0x2516('0x55')]=[{'all':!![]}];}return db[_0x2516('0x3c')][_0x2516('0x56')](_0x322fb7);})['then'](function(_0x1c4be3){_0x550ca5[_0x2516('0x57')]=_0x1c4be3;return _0x550ca5;})[_0x2516('0x33')](respondWithFilteredResult(_0x52ef6b,_0x322fb7))[_0x2516('0x26')](handleError(_0x52ef6b,null));};exports[_0x2516('0x58')]=function(_0x23875b,_0x52f7f7){var _0x4f3eba={'raw':![],'where':{'id':_0x23875b[_0x2516('0x59')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x54e8df={};_0x54e8df['model']=_[_0x2516('0x43')](db[_0x2516('0x3c')][_0x2516('0x3d')]);_0x54e8df[_0x2516('0x44')]=_[_0x2516('0x43')](_0x23875b['query']);_0x54e8df[_0x2516('0x4d')]=_[_0x2516('0x45')](_0x54e8df[_0x2516('0x41')],_0x54e8df['query']);_0x4f3eba[_0x2516('0x46')]=_[_0x2516('0x45')](_0x54e8df['model'],qs[_0x2516('0x47')](_0x23875b[_0x2516('0x44')][_0x2516('0x47')]));_0x4f3eba[_0x2516('0x46')]=_0x4f3eba[_0x2516('0x46')]['length']?_0x4f3eba['attributes']:_0x54e8df[_0x2516('0x41')];if(_0x23875b['query'][_0x2516('0x54')]){_0x4f3eba['include']=[{'all':!![]}];}_0x4f3eba=_[_0x2516('0x52')]({},_0x4f3eba,_0x23875b[_0x2516('0x53')]);return db[_0x2516('0x3c')][_0x2516('0x5a')](_0x4f3eba)[_0x2516('0x33')](handleEntityNotFound(_0x52f7f7,null))[_0x2516('0x33')](respondWithResult(_0x52f7f7,null))[_0x2516('0x26')](handleError(_0x52f7f7,null));};exports[_0x2516('0x5b')]=function(_0x424027,_0xe6bfc7){return db[_0x2516('0x3c')]['create'](_0x424027[_0x2516('0x5c')],{})[_0x2516('0x33')](function(_0x3adc8c){var _0x48dc96=_0x424027[_0x2516('0x5d')]['get']({'plain':!![]});if(!_0x48dc96)throw new Error(_0x2516('0x5e'));if(_0x48dc96[_0x2516('0x5f')]===_0x2516('0x5d')){var _0x505ccd=_0x3adc8c['get']({'plain':!![]});var _0x5a51c6=_0x2516('0x60');return db[_0x2516('0x61')][_0x2516('0x5a')]({'where':{'name':_0x5a51c6,'userProfileId':_0x48dc96[_0x2516('0x62')]},'raw':!![]})['then'](function(_0x45588d){if(_0x45588d&&_0x45588d[_0x2516('0x63')]===0x0){return db[_0x2516('0x64')]['create']({'name':_0x505ccd[_0x2516('0x42')],'resourceId':_0x505ccd['id'],'type':_0x45588d[_0x2516('0x42')],'sectionId':_0x45588d['id']},{})[_0x2516('0x33')](function(){return _0x3adc8c;});}else{return _0x3adc8c;}})[_0x2516('0x26')](function(_0x27b2ee){logger[_0x2516('0x21')](_0x2516('0x65'),_0x27b2ee);throw _0x27b2ee;});}return _0x3adc8c;})[_0x2516('0x33')](respondWithResult(_0xe6bfc7,0xc9))[_0x2516('0x26')](handleError(_0xe6bfc7,null));};exports[_0x2516('0x32')]=function(_0x4a7054,_0x2de12e){if(_0x4a7054[_0x2516('0x5c')]['id']){delete _0x4a7054['body']['id'];}return db[_0x2516('0x3c')][_0x2516('0x5a')]({'where':{'id':_0x4a7054[_0x2516('0x59')]['id']},'include':[{'model':db[_0x2516('0x39')],'as':_0x2516('0x3a')}]})[_0x2516('0x33')](handleEntityNotFound(_0x2de12e,null))[_0x2516('0x33')](saveUpdates(_0x4a7054['body'],null))[_0x2516('0x33')](respondWithResult(_0x2de12e,null))[_0x2516('0x26')](handleError(_0x2de12e,null));};exports[_0x2516('0x35')]=function(_0x1533ae,_0x6faa52){return db[_0x2516('0x3c')]['find']({'where':{'id':_0x1533ae['params']['id']}})['then'](handleEntityNotFound(_0x6faa52,null))[_0x2516('0x33')](removeEntity(_0x6faa52,null))[_0x2516('0x26')](handleError(_0x6faa52,null));};exports[_0x2516('0x66')]=function(_0x2cc379,_0x58730b){return db['OpenchannelAccount'][_0x2516('0x66')]()['then'](respondWithResult(_0x58730b,null))[_0x2516('0x26')](handleError(_0x58730b,null));};exports[_0x2516('0x67')]=function(_0x572441,_0x1b7769,_0x1bf796){if(_0x572441[_0x2516('0x5c')]['id']){delete _0x572441[_0x2516('0x5c')]['id'];}return db[_0x2516('0x3c')][_0x2516('0x5a')]({'where':{'id':_0x572441[_0x2516('0x59')]['id']}})[_0x2516('0x33')](handleEntityNotFound(_0x1b7769,null))[_0x2516('0x33')](function(_0x4c86a3){if(_0x4c86a3){_0x572441['body'][_0x2516('0x68')]=_0x4c86a3['id'];return db[_0x2516('0x69')][_0x2516('0x5b')](_0x572441['body']);}})[_0x2516('0x33')](respondWithResult(_0x1b7769,null))['catch'](handleError(_0x1b7769,null));};exports[_0x2516('0x6a')]=function(_0x3f6601,_0x1b8c97,_0x274420){var _0xfa4038={'raw':![],'where':{}};var _0x66bf4c={};var _0x3d0d99={'count':0x0,'rows':[]};return db[_0x2516('0x3c')][_0x2516('0x6b')]({'where':{'id':_0x3f6601[_0x2516('0x59')]['id']}})['then'](handleEntityNotFound(_0x1b8c97,null))['then'](function(_0x317942){if(_0x317942){_0x66bf4c['model']=_['keys'](db[_0x2516('0x69')][_0x2516('0x3d')]);_0x66bf4c[_0x2516('0x44')]=_[_0x2516('0x43')](_0x3f6601[_0x2516('0x44')]);_0x66bf4c[_0x2516('0x4d')]=_[_0x2516('0x45')](_0x66bf4c[_0x2516('0x41')],_0x66bf4c[_0x2516('0x44')]);_0xfa4038['attributes']=_[_0x2516('0x45')](_0x66bf4c[_0x2516('0x41')],qs[_0x2516('0x47')](_0x3f6601[_0x2516('0x44')]['fields']));_0xfa4038[_0x2516('0x46')]=_0xfa4038[_0x2516('0x46')][_0x2516('0x48')]?_0xfa4038[_0x2516('0x46')]:_0x66bf4c[_0x2516('0x41')];if(!_0x3f6601[_0x2516('0x44')]['hasOwnProperty'](_0x2516('0x4a'))){_0xfa4038['limit']=qs['limit'](_0x3f6601[_0x2516('0x44')][_0x2516('0x2b')]);_0xfa4038[_0x2516('0x2d')]=qs['offset'](_0x3f6601[_0x2516('0x44')][_0x2516('0x2d')]);}_0xfa4038[_0x2516('0x4b')]=qs[_0x2516('0x4c')](_0x3f6601['query'][_0x2516('0x4c')]);_0xfa4038[_0x2516('0x50')]=qs[_0x2516('0x4d')](_[_0x2516('0x4e')](_0x3f6601['query'],_0x66bf4c[_0x2516('0x4d')]));_0xfa4038[_0x2516('0x50')][_0x2516('0x68')]=_0x317942['id'];if(_0x3f6601['query'][_0x2516('0x4f')]){_0xfa4038['where']=_[_0x2516('0x52')](_0xfa4038[_0x2516('0x50')],{'$or':_[_0x2516('0x3b')](_0xfa4038[_0x2516('0x46')],function(_0x322df6){var _0x502cbf={};_0x502cbf[_0x322df6]={'$like':'%'+_0x3f6601['query']['filter']+'%'};return _0x502cbf;})});}_0xfa4038=_[_0x2516('0x52')]({},_0xfa4038,_0x3f6601[_0x2516('0x53')]);return db['Disposition'][_0x2516('0x2c')]({'where':_0xfa4038[_0x2516('0x50')]})[_0x2516('0x33')](function(_0x44a023){_0x3d0d99[_0x2516('0x2c')]=_0x44a023;if(_0x3f6601[_0x2516('0x44')]['includeAll']){_0xfa4038[_0x2516('0x55')]=[{'all':!![]}];}return db[_0x2516('0x69')][_0x2516('0x56')](_0xfa4038);})['then'](function(_0x51308d){_0x3d0d99['rows']=_0x51308d;return _0x3d0d99;});}})[_0x2516('0x33')](respondWithFilteredResult(_0x1b8c97,_0xfa4038))[_0x2516('0x26')](handleError(_0x1b8c97,null));};exports[_0x2516('0x6c')]=function(_0x1fee50,_0x5bc6ed,_0x4a2158){return db['OpenchannelAccount'][_0x2516('0x5a')]({'where':{'id':_0x1fee50[_0x2516('0x59')]['id']}})[_0x2516('0x33')](handleEntityNotFound(_0x5bc6ed,null))[_0x2516('0x33')](function(_0x30376e){if(_0x30376e){return _0x30376e[_0x2516('0x6c')](_0x1fee50[_0x2516('0x44')][_0x2516('0x6d')]);}})['then'](respondWithStatusCode(_0x5bc6ed,null))[_0x2516('0x26')](handleError(_0x5bc6ed,null));};exports[_0x2516('0x6e')]=function(_0x417f7f,_0x320d38,_0x3e1a27){if(_0x417f7f['body']['id']){delete _0x417f7f[_0x2516('0x5c')]['id'];}return db[_0x2516('0x3c')]['find']({'where':{'id':_0x417f7f[_0x2516('0x59')]['id']}})[_0x2516('0x33')](handleEntityNotFound(_0x320d38,null))[_0x2516('0x33')](function(_0x1b517c){if(_0x1b517c){_0x417f7f[_0x2516('0x5c')][_0x2516('0x68')]=_0x1b517c['id'];return db['CannedAnswer'][_0x2516('0x5b')](_0x417f7f[_0x2516('0x5c')]);}})[_0x2516('0x33')](respondWithResult(_0x320d38,null))[_0x2516('0x26')](handleError(_0x320d38,null));};exports[_0x2516('0x6f')]=function(_0xe93655,_0x43a2ed,_0x4254ad){var _0x33a71f={'raw':![],'where':{}};var _0x559f5d={};var _0x57b13b={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x2516('0x6b')]({'where':{'id':_0xe93655[_0x2516('0x59')]['id']}})['then'](handleEntityNotFound(_0x43a2ed,null))['then'](function(_0x40efc6){if(_0x40efc6){_0x559f5d[_0x2516('0x41')]=_[_0x2516('0x43')](db[_0x2516('0x70')][_0x2516('0x3d')]);_0x559f5d[_0x2516('0x44')]=_[_0x2516('0x43')](_0xe93655[_0x2516('0x44')]);_0x559f5d[_0x2516('0x4d')]=_[_0x2516('0x45')](_0x559f5d[_0x2516('0x41')],_0x559f5d[_0x2516('0x44')]);_0x33a71f[_0x2516('0x46')]=_[_0x2516('0x45')](_0x559f5d[_0x2516('0x41')],qs['fields'](_0xe93655['query'][_0x2516('0x47')]));_0x33a71f[_0x2516('0x46')]=_0x33a71f[_0x2516('0x46')]['length']?_0x33a71f[_0x2516('0x46')]:_0x559f5d[_0x2516('0x41')];if(!_0xe93655[_0x2516('0x44')][_0x2516('0x49')](_0x2516('0x4a'))){_0x33a71f[_0x2516('0x2b')]=qs['limit'](_0xe93655[_0x2516('0x44')][_0x2516('0x2b')]);_0x33a71f[_0x2516('0x2d')]=qs[_0x2516('0x2d')](_0xe93655[_0x2516('0x44')][_0x2516('0x2d')]);}_0x33a71f[_0x2516('0x4b')]=qs[_0x2516('0x4c')](_0xe93655[_0x2516('0x44')][_0x2516('0x4c')]);_0x33a71f[_0x2516('0x50')]=qs[_0x2516('0x4d')](_[_0x2516('0x4e')](_0xe93655[_0x2516('0x44')],_0x559f5d[_0x2516('0x4d')]));_0x33a71f[_0x2516('0x50')]['OpenchannelAccountId']=_0x40efc6['id'];if(_0xe93655['query'][_0x2516('0x4f')]){_0x33a71f[_0x2516('0x50')]=_[_0x2516('0x52')](_0x33a71f[_0x2516('0x50')],{'$or':_[_0x2516('0x3b')](_0x33a71f[_0x2516('0x46')],function(_0x46dbff){var _0x3f25b5={};_0x3f25b5[_0x46dbff]={'$like':'%'+_0xe93655['query'][_0x2516('0x4f')]+'%'};return _0x3f25b5;})});}_0x33a71f=_[_0x2516('0x52')]({},_0x33a71f,_0xe93655[_0x2516('0x53')]);return db['CannedAnswer'][_0x2516('0x2c')]({'where':_0x33a71f['where']})[_0x2516('0x33')](function(_0x48863e){_0x57b13b[_0x2516('0x2c')]=_0x48863e;if(_0xe93655[_0x2516('0x44')]['includeAll']){_0x33a71f[_0x2516('0x55')]=[{'all':!![]}];}return db['CannedAnswer'][_0x2516('0x56')](_0x33a71f);})[_0x2516('0x33')](function(_0x177106){_0x57b13b[_0x2516('0x57')]=_0x177106;return _0x57b13b;});}})[_0x2516('0x33')](respondWithFilteredResult(_0x43a2ed,_0x33a71f))[_0x2516('0x26')](handleError(_0x43a2ed,null));};exports[_0x2516('0x71')]=function(_0x30d6f4,_0x1e40f0,_0x5a6f3d){return db[_0x2516('0x3c')][_0x2516('0x5a')]({'where':{'id':_0x30d6f4[_0x2516('0x59')]['id']}})[_0x2516('0x33')](handleEntityNotFound(_0x1e40f0,null))['then'](function(_0x1c5c46){if(_0x1c5c46){return _0x1c5c46[_0x2516('0x71')](_0x30d6f4[_0x2516('0x44')][_0x2516('0x6d')]);}})[_0x2516('0x33')](respondWithStatusCode(_0x1e40f0,null))['catch'](handleError(_0x1e40f0,null));};exports[_0x2516('0x72')]=function(_0x2e2dac,_0x39d344,_0x1f29d7){var _0x25e35a={'body':_0x2e2dac[_0x2516('0x5c')],'channel':'openchannel'};var _0x8fead9=[];var _0x49a464=[];var _0x17ae1b={};var _0x5f42ff=![];return db['CmContact'][_0x2516('0x66')]()[_0x2516('0x33')](function(_0x2750e4){if(!_0x2750e4){throw new db['Sequelize'][(_0x2516('0x73'))](_0x2516('0x74'));}_0x8fead9=_['difference'](_[_0x2516('0x43')](_0x2750e4),[_0x2516('0x75'),'updatedAt']);_0x49a464=_['difference'](_[_0x2516('0x43')](_0x2750e4),[_0x2516('0x75'),_0x2516('0x76'),_0x2516('0x77'),_0x2516('0x78')]);if(_0x2e2dac[_0x2516('0x5c')]['id']){delete _0x2e2dac['body']['id'];}if(_[_0x2516('0x79')](_0x2e2dac[_0x2516('0x5c')][_0x2516('0x7a')])){throw new db[(_0x2516('0x7b'))]['ValidationError'](_0x2516('0x7c'));}if(_[_0x2516('0x79')](_0x2e2dac[_0x2516('0x5c')][_0x2516('0x5c')])||_0x2e2dac['body'][_0x2516('0x5c')]===''){throw new db[(_0x2516('0x7b'))][(_0x2516('0x73'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x2516('0x79')](_0x2e2dac[_0x2516('0x5c')][_0x2516('0x7d')])){throw new db[(_0x2516('0x7b'))]['ValidationError'](_0x2516('0x7e')+_0x49a464);}if(!_[_0x2516('0x7f')](_0x49a464,_0x2e2dac[_0x2516('0x5c')][_0x2516('0x7d')])){throw new db[(_0x2516('0x7b'))][(_0x2516('0x73'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x49a464);}_0x17ae1b[_0x2e2dac[_0x2516('0x5c')][_0x2516('0x7d')]]=_0x2e2dac[_0x2516('0x5c')]['from'];})[_0x2516('0x33')](function(){return db[_0x2516('0x3c')]['find']({'where':{'id':_0x2e2dac['params']['id']},'include':[{'model':db[_0x2516('0x80')],'as':_0x2516('0x81'),'include':[{'model':db[_0x2516('0x82')],'as':_0x2516('0x83'),'where':_0x17ae1b,'limit':0x1,'order':[[_0x2516('0x76'),_0x2516('0x84')]]}]},{'model':db[_0x2516('0x85')],'as':'Applications'}]});})[_0x2516('0x33')](handleEntityNotFound(_0x39d344,null))[_0x2516('0x33')](function(_0x1354d3){if(_0x1354d3&&_0x1354d3[_0x2516('0x81')]){_0x25e35a[_0x2516('0x86')]=_0x1354d3;_0x25e35a[_0x2516('0x87')]=_0x1354d3[_0x2516('0x88')];_0x25e35a[_0x2516('0x89')]=_0x1354d3[_0x2516('0x81')];_0x25e35a[_0x2516('0x87')]=_[_0x2516('0x8a')](_0x25e35a[_0x2516('0x87')],['priority'],[_0x2516('0x8b')]);if(_0x25e35a[_0x2516('0x86')]['Applications']){delete _0x25e35a[_0x2516('0x86')][_0x2516('0x88')];}if(_0x25e35a[_0x2516('0x86')][_0x2516('0x81')]&&_0x25e35a[_0x2516('0x86')]['List'][_0x2516('0x83')][_0x2516('0x48')]){return _0x25e35a['account'][_0x2516('0x81')]['Contacts'][0x0];}var _0x4cf81d=_[_0x2516('0x8c')](_0x2e2dac[_0x2516('0x5c')],{'firstName':_0x2e2dac[_0x2516('0x5c')]['from'],'ListId':_0x1354d3[_0x2516('0x78')]});_0x4cf81d[_0x2e2dac[_0x2516('0x5c')]['mapKey']]=_0x2e2dac['body'][_0x2516('0x7a')];return db[_0x2516('0x82')][_0x2516('0x5b')](_0x4cf81d,{'fields':_0x8fead9,'raw':!![]});}})[_0x2516('0x33')](handleEntityNotFound(_0x39d344,null))[_0x2516('0x33')](function(_0x21f81c){_0x25e35a[_0x2516('0x8d')]=_0x21f81c;if(_0x21f81c){var _0x324b71={'ContactId':_0x21f81c['id'],'OpenchannelAccountId':_0x2e2dac[_0x2516('0x59')]['id'],'from':(_0x21f81c['firstName']||'')+'\x20'+(_0x21f81c[_0x2516('0x8e')]||'')};var _0x4272ae={'OpenchannelAccountId':_0x2e2dac[_0x2516('0x59')]['id'],'closed':![]};if(_0x2e2dac[_0x2516('0x5c')][_0x2516('0x8f')]){_0x4272ae[_0x2516('0x8f')]=_0x2e2dac['body'][_0x2516('0x8f')];return db[_0x2516('0x90')][_0x2516('0x5a')]({'where':_0x4272ae})[_0x2516('0x33')](function(_0x307987){if(_0x307987){return[_0x307987,![]];}_0x324b71[_0x2516('0x8f')]=_0x2e2dac[_0x2516('0x5c')][_0x2516('0x8f')];_0x324b71[_0x2516('0x91')]=_0x2e2dac[_0x2516('0x5c')][_0x2516('0x91')];return db[_0x2516('0x90')][_0x2516('0x5b')](_0x324b71)['then'](function(_0x304bb8){return[_0x304bb8,!![]];});});}else{_0x4272ae[_0x2516('0x8f')]=null;}_0x4272ae['ContactId']=_0x21f81c['id'];return db['OpenchannelInteraction'][_0x2516('0x5a')]({'where':_0x4272ae})[_0x2516('0x33')](function(_0x2fb9c1){if(_0x2fb9c1){return[_0x2fb9c1,![]];}return db[_0x2516('0x90')][_0x2516('0x5b')](_0x324b71)['then'](function(_0x1800c1){return[_0x1800c1,!![]];});});}})[_0x2516('0x92')](function(_0x433def,_0x109029){if(_0x433def){_0x5f42ff=_0x109029;if(!_0x109029){var _0x59eb11={'from':(_0x25e35a['contact']['firstName']||'')+'\x20'+(_0x25e35a[_0x2516('0x8d')][_0x2516('0x8e')]||'')};if(_0x2e2dac[_0x2516('0x5c')][_0x2516('0x8f')]&&_0x2e2dac['body'][_0x2516('0x93')]&&_0x2e2dac['body'][_0x2516('0x8f')]!=_0x2e2dac[_0x2516('0x5c')]['messageId']){_0x59eb11[_0x2516('0x8f')]=_0x2e2dac[_0x2516('0x5c')][_0x2516('0x93')];}return _0x433def[_0x2516('0x32')](_0x59eb11);}else{return _0x433def;}}})[_0x2516('0x33')](function(_0x320029){_0x25e35a[_0x2516('0x94')]=_0x320029[_0x2516('0x34')]({'plain':!![]});_0x25e35a[_0x2516('0x94')][_0x2516('0x95')]=_0x5f42ff;if(_0x25e35a[_0x2516('0x94')][_0x2516('0x95')]){if(_0x25e35a[_0x2516('0x86')]['autoclose']){_0x25e35a[_0x2516('0x87')][_0x2516('0x96')]({'id':0x0,'priority':_0x25e35a[_0x2516('0x87')]['length']+0x1,'app':_0x2516('0x97'),'appdata':_0x2516('0x98'),'interval':_0x2516('0x99')});}}return db[_0x2516('0x9a')][_0x2516('0x5b')]({'body':_0x2e2dac[_0x2516('0x5c')][_0x2516('0x5c')],'OpenchannelAccountId':_0x2e2dac['params']['id'],'OpenchannelInteractionId':_0x320029['id'],'direction':'in','ContactId':_0x25e35a['contact']['id'],'AttachmentId':_0x2e2dac[_0x2516('0x5c')][_0x2516('0x9b')]});})[_0x2516('0x33')](function(_0x1ab886){_0x25e35a[_0x2516('0x24')]=_0x1ab886;if(!_0x25e35a[_0x2516('0x94')]['UserId'])return;return db['User'][_0x2516('0x5a')]({'attributes':['id',_0x2516('0x42')],'where':{'id':_0x25e35a[_0x2516('0x94')][_0x2516('0x9c')]}});})[_0x2516('0x33')](function(_0x599831){if(_0x599831){_0x25e35a[_0x2516('0x87')][_0x2516('0x9d')]({'id':0x0,'priority':0x0,'app':_0x2516('0x9e'),'appdata':_0x599831[_0x2516('0x42')]+','+(_0x25e35a['account'][_0x2516('0x9f')]||0xa),'interval':'*,*,*,*'});}if(!_0x25e35a[_0x2516('0x94')]['queueId'])return;return db['OpenchannelQueue'][_0x2516('0x5a')]({'attributes':['id',_0x2516('0x42')],'where':{'id':_0x25e35a['interaction'][_0x2516('0xa0')]}});})['then'](function(_0x2b7b53){if(_0x2b7b53){_0x25e35a[_0x2516('0x87')]['unshift']({'id':0x0,'priority':0x1,'app':_0x2516('0xa1'),'appdata':_0x2b7b53[_0x2516('0x42')]+','+(_0x25e35a['account']['waitForTheAssignedQueue']||0x12c),'interval':_0x2516('0x99')});}return respondWithRpcPromise(_0x2516('0xa2'),'startRouting',_0x25e35a);})[_0x2516('0x33')](function(_0x2ea445){respondWithRpcPromise(_0x2516('0xa3'),_0x2516('0xa3'),{'event':_0x2516('0x72'),'message':_0x2ea445},client9002);return _0x2ea445;})[_0x2516('0x33')](respondWithResult(_0x39d344,null))[_0x2516('0x26')](handleError(_0x39d344,null));};exports[_0x2516('0xa4')]=function(_0x1bc708,_0x3a059b){var _0x492a99=_0x1bc708['params']['id'];var _0x5d9331=_0x1bc708[_0x2516('0x5c')];var _0x35bb7c=0xc8;var _0x550e26=null;return db[_0x2516('0xa5')][_0x2516('0xa6')]({'isolationLevel':db[_0x2516('0xa5')]['Transaction'][_0x2516('0xa7')][_0x2516('0xa8')]},function(_0x59043e){return db[_0x2516('0x3c')][_0x2516('0x6b')]({'where':{'id':_0x492a99},'transaction':_0x59043e})[_0x2516('0x33')](function(_0x134256){if(_0x134256){return db[_0x2516('0x85')][_0x2516('0x35')]({'where':{'OpenchannelAccountId':_0x492a99},'transaction':_0x59043e})['then'](function(){var _0xddc88=_[_0x2516('0x3b')](_0x5d9331,function(_0x38e016){_0x38e016[_0x2516('0x68')]=_0x492a99;return _0x38e016;});return db[_0x2516('0x85')][_0x2516('0xa9')](_0xddc88,{'transaction':_0x59043e});});}else{_0x35bb7c=0x194;_0x550e26=[];}});})[_0x2516('0x33')](function(){if(_0x35bb7c!==0x194){return db[_0x2516('0x85')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x492a99},'order':'priority'})[_0x2516('0x33')](function(_0x4621e8){_0x550e26=_0x4621e8;});}})[_0x2516('0x26')](function(_0x253acd){_0x35bb7c=0x1f4;logger['error'](_0x253acd[_0x2516('0x37')]);if(_0x253acd['name']){delete _0x253acd[_0x2516('0x42')];}_0x550e26=_0x253acd;})['finally'](function(){if(_0x550e26===null){_0x3a059b[_0x2516('0x27')](_0x35bb7c);}else{if(_0x35bb7c===0x1f4){_0x3a059b[_0x2516('0x28')](_0x35bb7c)[_0x2516('0x38')](_0x550e26);}else{_0x3a059b[_0x2516('0x28')](_0x35bb7c)[_0x2516('0x29')](_0x550e26);}}});};exports[_0x2516('0xaa')]=function(_0x4586b5,_0x76fed0,_0x45cd5f){var _0x1937bf={};var _0x3dc659={};var _0x4eb308;var _0x788dee;return db[_0x2516('0x3c')][_0x2516('0x6b')]({'where':{'id':_0x4586b5[_0x2516('0x59')]['id']}})['then'](handleEntityNotFound(_0x76fed0,null))[_0x2516('0x33')](function(_0x24887e){if(_0x24887e){_0x4eb308=_0x24887e;_0x3dc659[_0x2516('0x41')]=_[_0x2516('0x43')](db['OpenchannelApplication'][_0x2516('0x3d')]);_0x3dc659[_0x2516('0x44')]=_[_0x2516('0x43')](_0x4586b5[_0x2516('0x44')]);_0x3dc659[_0x2516('0x4d')]=_[_0x2516('0x45')](_0x3dc659[_0x2516('0x41')],_0x3dc659[_0x2516('0x44')]);_0x1937bf[_0x2516('0x46')]=_[_0x2516('0x45')](_0x3dc659[_0x2516('0x41')],qs[_0x2516('0x47')](_0x4586b5[_0x2516('0x44')][_0x2516('0x47')]));_0x1937bf[_0x2516('0x46')]=_0x1937bf[_0x2516('0x46')]['length']?_0x1937bf[_0x2516('0x46')]:_0x3dc659[_0x2516('0x41')];_0x1937bf['order']=qs[_0x2516('0x4c')](_0x4586b5[_0x2516('0x44')][_0x2516('0x4c')]);_0x1937bf[_0x2516('0x50')]=qs[_0x2516('0x4d')](_[_0x2516('0x4e')](_0x4586b5[_0x2516('0x44')],_0x3dc659['filters']));if(_0x4586b5[_0x2516('0x44')]['filter']){_0x1937bf[_0x2516('0x50')]=_[_0x2516('0x52')](_0x1937bf['where'],{'$or':_[_0x2516('0x3b')](_0x1937bf[_0x2516('0x46')],function(_0x7ba682){var _0x479f81={};_0x479f81[_0x7ba682]={'$like':'%'+_0x4586b5[_0x2516('0x44')][_0x2516('0x4f')]+'%'};return _0x479f81;})});}_0x1937bf=_[_0x2516('0x52')]({},_0x1937bf,_0x4586b5[_0x2516('0x53')]);return _0x4eb308[_0x2516('0xaa')](_0x1937bf);}})[_0x2516('0x33')](function(_0x31f6f2){if(_0x31f6f2){_0x788dee=_0x31f6f2[_0x2516('0x48')];if(!_0x4586b5[_0x2516('0x44')]['hasOwnProperty']('nolimit')){_0x1937bf[_0x2516('0x2b')]=qs[_0x2516('0x2b')](_0x4586b5[_0x2516('0x44')][_0x2516('0x2b')]);_0x1937bf[_0x2516('0x2d')]=qs['offset'](_0x4586b5[_0x2516('0x44')][_0x2516('0x2d')]);}return _0x4eb308[_0x2516('0xaa')](_0x1937bf);}})['then'](function(_0x14f121){if(_0x14f121){return _0x14f121?{'count':_0x788dee,'rows':_0x14f121}:null;}})[_0x2516('0x33')](respondWithResult(_0x76fed0,null))[_0x2516('0x26')](handleError(_0x76fed0,null));};exports[_0x2516('0xab')]=function(_0x5a6439,_0x4e3d72,_0x5e62c0){var _0x5c27ff={'raw':![],'where':{}};var _0x12fb58={};var _0x59b6dd={'count':0x0,'rows':[]};return db[_0x2516('0x3c')][_0x2516('0x6b')]({'where':{'id':_0x5a6439['params']['id']}})[_0x2516('0x33')](handleEntityNotFound(_0x4e3d72,null))[_0x2516('0x33')](function(_0x372494){if(_0x372494){_0x12fb58[_0x2516('0x41')]=_[_0x2516('0x43')](db[_0x2516('0x90')][_0x2516('0x3d')]);_0x12fb58['query']=_[_0x2516('0x43')](_0x5a6439[_0x2516('0x44')]);_0x12fb58[_0x2516('0x4d')]=_['intersection'](_0x12fb58[_0x2516('0x41')],_0x12fb58['query']);_0x5c27ff[_0x2516('0x46')]=_[_0x2516('0x45')](_0x12fb58[_0x2516('0x41')],qs['fields'](_0x5a6439[_0x2516('0x44')][_0x2516('0x47')]));_0x5c27ff['attributes']=_0x5c27ff[_0x2516('0x46')][_0x2516('0x48')]?_0x5c27ff[_0x2516('0x46')]:_0x12fb58[_0x2516('0x41')];if(!_0x5a6439['query'][_0x2516('0x49')]('nolimit')){_0x5c27ff[_0x2516('0x2b')]=qs[_0x2516('0x2b')](_0x5a6439[_0x2516('0x44')][_0x2516('0x2b')]);_0x5c27ff[_0x2516('0x2d')]=qs[_0x2516('0x2d')](_0x5a6439['query'][_0x2516('0x2d')]);}_0x5c27ff['order']=qs[_0x2516('0x4c')](_0x5a6439['query'][_0x2516('0x4c')]);_0x5c27ff[_0x2516('0x50')]=qs[_0x2516('0x4d')](_[_0x2516('0x4e')](_0x5a6439[_0x2516('0x44')],_0x12fb58[_0x2516('0x4d')]));_0x5c27ff['where'][_0x2516('0x68')]=_0x372494['id'];if(_0x5a6439[_0x2516('0x44')][_0x2516('0x4f')]){_0x5c27ff[_0x2516('0x50')]=_['merge'](_0x5c27ff[_0x2516('0x50')],{'$or':_['map'](_0x5c27ff['attributes'],function(_0x5c44fd){var _0x48261d={};_0x48261d[_0x5c44fd]={'$like':'%'+_0x5a6439['query']['filter']+'%'};return _0x48261d;})});}_0x5c27ff=_['merge']({},_0x5c27ff,_0x5a6439[_0x2516('0x53')]);return db[_0x2516('0x90')]['count']({'where':_0x5c27ff[_0x2516('0x50')]})[_0x2516('0x33')](function(_0x197ba3){_0x59b6dd['count']=_0x197ba3;if(_0x5a6439['query']['includeAll']){_0x5c27ff[_0x2516('0x55')]=[{'model':db[_0x2516('0x82')],'as':'Contact','required':![]},{'model':db['User'],'as':'Owner','attributes':['name',_0x2516('0xac'),_0x2516('0xad')],'required':![]},{'model':db['Tag'],'as':_0x2516('0xae'),'attributes':['id',_0x2516('0x42'),'color'],'where':_0x5a6439[_0x2516('0x44')]['tag']?{'id':_0x5a6439[_0x2516('0x44')]['tag']}:undefined,'required':_0x5a6439['query'][_0x2516('0xaf')]?!![]:![]}];}return db[_0x2516('0x90')]['findAll'](_0x5c27ff);})[_0x2516('0x33')](function(_0x4ed2bd){_0x59b6dd[_0x2516('0x57')]=_0x4ed2bd;return _0x59b6dd;});}})[_0x2516('0x33')](respondWithFilteredResult(_0x4e3d72,_0x5c27ff))[_0x2516('0x26')](handleError(_0x4e3d72,null));};exports[_0x2516('0xb0')]=function(_0x9a7f5a,_0x575ec8,_0x149da0){return db['OpenchannelAccount'][_0x2516('0x5a')]({'where':{'id':_0x9a7f5a[_0x2516('0x59')]['id']}})[_0x2516('0x33')](handleEntityNotFound(_0x575ec8,null))[_0x2516('0x33')](function(_0x1b71da){if(_0x1b71da){return _0x1b71da['addAgents'](_0x9a7f5a['body'][_0x2516('0x6d')],_['omit'](_0x9a7f5a[_0x2516('0x5c')],[_0x2516('0x6d'),'id'])||{})[_0x2516('0x92')](function(_0x479dae){for(var _0x232ac0=0x0;_0x232ac0<_0x9a7f5a[_0x2516('0x5c')][_0x2516('0x6d')][_0x2516('0x48')];_0x232ac0+=0x1){socket[_0x2516('0xb1')](_0x2516('0xb2'),{'UserId':Number(_0x9a7f5a[_0x2516('0x5c')][_0x2516('0x6d')][_0x232ac0]),'OpenchannelAccountId':Number(_0x9a7f5a[_0x2516('0x59')]['id'])});}return _0x479dae;});}})[_0x2516('0x33')](respondWithResult(_0x575ec8,null))[_0x2516('0x26')](handleError(_0x575ec8,null));};exports[_0x2516('0xb3')]=function(_0x4c1cd8,_0x2db19d,_0x50caaa){return db[_0x2516('0x3c')][_0x2516('0x5a')]({'where':{'id':_0x4c1cd8[_0x2516('0x59')]['id']}})[_0x2516('0x33')](handleEntityNotFound(_0x2db19d,null))['then'](function(_0x5d3435){if(_0x5d3435){return _0x5d3435['removeAgents'](_0x4c1cd8[_0x2516('0x44')][_0x2516('0x6d')])[_0x2516('0x33')](function(){if(_[_0x2516('0xb4')](_0x4c1cd8[_0x2516('0x44')][_0x2516('0x6d')])){for(var _0x2427da=0x0;_0x2427da<_0x4c1cd8[_0x2516('0x44')]['ids'][_0x2516('0x48')];_0x2427da+=0x1){socket['emit']('userOpenchannelAccount:remove',{'UserId':Number(_0x4c1cd8['query'][_0x2516('0x6d')][_0x2427da]),'OpenchannelAccountId':Number(_0x4c1cd8[_0x2516('0x59')]['id'])});}}else{socket['emit'](_0x2516('0xb5'),{'UserId':Number(_0x4c1cd8[_0x2516('0x44')][_0x2516('0x6d')]),'OpenchannelAccountId':Number(_0x4c1cd8['params']['id'])});}});}})[_0x2516('0x33')](respondWithStatusCode(_0x2db19d,null))[_0x2516('0x26')](handleError(_0x2db19d,null));};exports['getAgents']=function(_0x49738b,_0x4214fc,_0x6017cd){var _0x57b5f6={};var _0x5ee24b={};var _0x31b27f;var _0x3a95b8;return db['OpenchannelAccount'][_0x2516('0x6b')]({'where':{'id':_0x49738b[_0x2516('0x59')]['id']}})[_0x2516('0x33')](handleEntityNotFound(_0x4214fc,null))['then'](function(_0x57457c){if(_0x57457c){_0x31b27f=_0x57457c;_0x5ee24b[_0x2516('0x41')]=_['keys'](db[_0x2516('0xb6')][_0x2516('0x3d')]);_0x5ee24b[_0x2516('0x44')]=_['keys'](_0x49738b[_0x2516('0x44')]);_0x5ee24b[_0x2516('0x4d')]=_[_0x2516('0x45')](_0x5ee24b[_0x2516('0x41')],_0x5ee24b[_0x2516('0x44')]);_0x57b5f6[_0x2516('0x46')]=_[_0x2516('0x45')](_0x5ee24b[_0x2516('0x41')],qs[_0x2516('0x47')](_0x49738b[_0x2516('0x44')][_0x2516('0x47')]));_0x57b5f6[_0x2516('0x46')]=_0x57b5f6[_0x2516('0x46')]['length']?_0x57b5f6[_0x2516('0x46')]:_0x5ee24b[_0x2516('0x41')];_0x57b5f6[_0x2516('0x4b')]=qs['sort'](_0x49738b[_0x2516('0x44')][_0x2516('0x4c')]);_0x57b5f6[_0x2516('0x50')]=qs['filters'](_[_0x2516('0x4e')](_0x49738b['query'],_0x5ee24b['filters']));if(_0x49738b[_0x2516('0x44')][_0x2516('0x4f')]){_0x57b5f6['where']=_[_0x2516('0x52')](_0x57b5f6[_0x2516('0x50')],{'$or':_[_0x2516('0x3b')](_0x57b5f6[_0x2516('0x46')],function(_0x543ac8){var _0x116f67={};_0x116f67[_0x543ac8]={'$like':'%'+_0x49738b['query'][_0x2516('0x4f')]+'%'};return _0x116f67;})});}_0x57b5f6=_[_0x2516('0x52')]({},_0x57b5f6,_0x49738b[_0x2516('0x53')]);return _0x31b27f[_0x2516('0xb7')](_0x57b5f6);}})[_0x2516('0x33')](function(_0x2093b1){if(_0x2093b1){_0x3a95b8=_0x2093b1[_0x2516('0x48')];if(!_0x49738b['query'][_0x2516('0x49')](_0x2516('0x4a'))){_0x57b5f6[_0x2516('0x2b')]=qs[_0x2516('0x2b')](_0x49738b['query'][_0x2516('0x2b')]);_0x57b5f6[_0x2516('0x2d')]=qs[_0x2516('0x2d')](_0x49738b['query'][_0x2516('0x2d')]);}return _0x31b27f[_0x2516('0xb7')](_0x57b5f6);}})['then'](function(_0x1c9eae){if(_0x1c9eae){return _0x1c9eae?{'count':_0x3a95b8,'rows':_0x1c9eae}:null;}})[_0x2516('0x33')](respondWithResult(_0x4214fc,null))[_0x2516('0x26')](handleError(_0x4214fc,null));};exports[_0x2516('0x38')]=function(_0x26053c,_0xafed84,_0x2e7bd4){var _0x509137,_0x6c5ed5,_0x4e7598;if(_[_0x2516('0x79')](_0x26053c[_0x2516('0x5c')]['body'])||_0x26053c[_0x2516('0x5c')][_0x2516('0x5c')]===''){throw new db[(_0x2516('0x7b'))]['ValidationError'](_0x2516('0xb8'));}if(_[_0x2516('0x79')](_0x26053c[_0x2516('0x5c')]['to'])){}_0x509137=_0x26053c[_0x2516('0x5c')]['to'];return db[_0x2516('0x3c')]['findOne']({'where':{'id':_0x26053c[_0x2516('0x59')]['id']}})[_0x2516('0x33')](handleEntityNotFound(_0xafed84,null))[_0x2516('0x33')](function(_0x259fbf){if(_0x259fbf){return db[_0x2516('0x3c')]['find']({'where':{'id':_0x259fbf['id']},'include':[{'model':db[_0x2516('0x80')],'as':_0x2516('0x81'),'include':[{'model':db[_0x2516('0x82')],'as':_0x2516('0x83'),'where':{[_0x259fbf[_0x2516('0x7d')]]:_0x509137},'limit':0x1,'order':[[_0x2516('0x76'),_0x2516('0x84')]]}]}]})[_0x2516('0x33')](handleEntityNotFound(_0xafed84,null))[_0x2516('0x33')](function(_0x2988c5){if(_0x2988c5&&_0x2988c5[_0x2516('0x81')]){_0x6c5ed5=_0x2988c5[_0x2516('0x34')]({'plain':!![]});if(_0x6c5ed5[_0x2516('0x81')]&&_0x6c5ed5['List'][_0x2516('0x83')][_0x2516('0x48')]){return _0x6c5ed5[_0x2516('0x81')][_0x2516('0x83')][0x0];}return db['CmContact'][_0x2516('0x5b')](_[_0x2516('0x8c')](_0x26053c[_0x2516('0x5c')],{'firstName':_0x509137,[_0x2988c5['mapKey']]:_0x509137,'phone':_0x509137,'ListId':_0x6c5ed5['ListId']}));}})['then'](handleEntityNotFound(_0xafed84,null))['then'](function(_0x49506e){if(_0x49506e){_0x4e7598=_0x49506e;return db[_0x2516('0x90')]['find']({'where':{'ContactId':_0x4e7598['id'],'closed':![],'OpenchannelAccountId':_0x6c5ed5['id']}})['then'](function(_0x463318){if(_0x463318){return[_0x463318,![]];}return db[_0x2516('0x90')][_0x2516('0x5b')]({'UserId':_0x26053c[_0x2516('0x5d')]['id'],'ContactId':_0x4e7598['id'],'OpenchannelAccountId':_0x6c5ed5['id'],'lastMsgDirection':'out','firstMsgDirection':_0x2516('0xb9'),'Messages':[_[_0x2516('0x52')](_0x26053c[_0x2516('0x5c')],{'read':![],'body':_0x26053c[_0x2516('0x5c')][_0x2516('0x5c')],'OpenchannelAccountId':_0x6c5ed5['id'],'UserId':_0x26053c[_0x2516('0x5d')]['id'],'ContactId':_0x4e7598['id']})]},{'include':[{'model':db[_0x2516('0x9a')],'as':_0x2516('0xba')}]})[_0x2516('0x33')](function(_0x1a905a){return[_0x1a905a,!![]];});});}})[_0x2516('0x92')](function(_0x464632,_0x5c276b){if(_0x5c276b){return _0x464632;}return db[_0x2516('0x9a')][_0x2516('0x5b')](_['merge'](_0x26053c[_0x2516('0x5c')],{'read':![],'body':_0x26053c['body'][_0x2516('0x5c')],'OpenchannelAccountId':_0x6c5ed5['id'],'OpenchannelInteractionId':_0x464632['id'],'UserId':_0x26053c[_0x2516('0x5d')]['id'],'ContactId':_0x4e7598['id']}))[_0x2516('0x33')](function(_0x576b57){_0x464632[_0x2516('0xbb')][_0x2516('0xba')]=[];_0x464632['dataValues'][_0x2516('0xba')][_0x2516('0x96')](_0x576b57['dataValues']);return _0x464632;});});}})['then'](respondWithResult(_0xafed84,null))[_0x2516('0x26')](handleError(_0xafed84,null));}; \ No newline at end of file +var _0xd5da=['debug','request\x20sent','stringify','error','code','message','OpenchannelAccount,\x20%s,\x20%s','catch','sendStatus','status','offset','undefined','limit','count','Content-Range','json','save','update','then','destroy','get','OpenchannelAccounts','UserProfileResource','end','stack','send','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','order','CannedAnswer','rows','removeAnswers','notify','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','isNil','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','Applications','List','account','applications','list','orderBy','priority','asc','defaults','from','firstName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','contact','lastName','messageId','interaction','created','autoclose','push','close','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','OpenchannelQueue','queueId','queue','waitForTheAssignedQueue','startRouting','EventManager','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','OpenchannelApplication','findAndCountAll','getApplications','Contact','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','emit','removeAgents','userOpenchannelAccount:remove','getAgents','DESC','ListId','out','Messages','dataValues','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','redis','socket.io-emitter','./openchannelAccount.socket','jayson/promise','client','http','info'];(function(_0x5a2fbf,_0x13c8da){var _0x2c916b=function(_0x1d4888){while(--_0x1d4888){_0x5a2fbf['push'](_0x5a2fbf['shift']());}};_0x2c916b(++_0x13c8da);}(_0xd5da,0x9f));var _0xad5d=function(_0x3517f4,_0x9a8b5){_0x3517f4=_0x3517f4-0x0;var _0x408c32=_0xd5da[_0x3517f4];return _0x408c32;};'use strict';var emlformat=require(_0xad5d('0x0'));var rimraf=require(_0xad5d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xad5d('0x2'));var rp=require(_0xad5d('0x3'));var moment=require(_0xad5d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xad5d('0x5'));var util=require('util');var path=require(_0xad5d('0x6'));var sox=require(_0xad5d('0x7'));var csv=require(_0xad5d('0x8'));var ejs=require(_0xad5d('0x9'));var fs=require('fs');var fs_extra=require(_0xad5d('0xa'));var _=require(_0xad5d('0xb'));var squel=require(_0xad5d('0xc'));var crypto=require(_0xad5d('0xd'));var jsforce=require(_0xad5d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xad5d('0x8'));var querystring=require(_0xad5d('0xf'));var Papa=require('papaparse');var Redis=require(_0xad5d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xad5d('0x11'));var as=require(_0xad5d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xad5d('0x13'))(_0xad5d('0x14'));var utils=require('../../config/utils');var config=require(_0xad5d('0x15'));var licenseUtil=require(_0xad5d('0x16'));var db=require('../../mysqldb')['db'];config[_0xad5d('0x17')]=_['defaults'](config[_0xad5d('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xad5d('0x18'))(new Redis(config['redis']));require(_0xad5d('0x19'))['register'](socket);var jayson=require(_0xad5d('0x1a'));var client=jayson[_0xad5d('0x1b')]['http']({'port':0x232c});var client9002=jayson['client'][_0xad5d('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x589daa,_0x5061c3,_0x4a2959,_0x8dd67c){return new BPromise(function(_0xd747c3,_0x7f2d47){var _0x4c706e=_0x8dd67c||client;return _0x4c706e['request'](_0x589daa,_0x4a2959)['then'](function(_0x21dff8){logger[_0xad5d('0x1d')]('OpenchannelAccount,\x20%s,\x20%s',_0x5061c3,'request\x20sent');logger[_0xad5d('0x1e')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x5061c3,_0xad5d('0x1f'),JSON[_0xad5d('0x20')](_0x21dff8));if(_0x21dff8['error']){if(_0x21dff8[_0xad5d('0x21')][_0xad5d('0x22')]===0x1f4){logger[_0xad5d('0x21')]('OpenchannelAccount,\x20%s,\x20%s',_0x5061c3,_0x21dff8[_0xad5d('0x21')][_0xad5d('0x23')]);return _0x7f2d47(_0x21dff8[_0xad5d('0x21')][_0xad5d('0x23')]);}logger[_0xad5d('0x21')]('OpenchannelAccount,\x20%s,\x20%s',_0x5061c3,_0x21dff8[_0xad5d('0x21')][_0xad5d('0x23')]);return _0xd747c3(_0x21dff8[_0xad5d('0x21')][_0xad5d('0x23')]);}else{logger[_0xad5d('0x1d')](_0xad5d('0x24'),_0x5061c3,'request\x20sent');_0xd747c3(_0x21dff8['result'][_0xad5d('0x23')]);}})[_0xad5d('0x25')](function(_0xa90fe){logger['error'](_0xad5d('0x24'),_0x5061c3,_0xa90fe);_0x7f2d47(_0xa90fe);});});}function respondWithStatusCode(_0x3ed049,_0x2b63ba){_0x2b63ba=_0x2b63ba||0xcc;return function(_0x210eed){if(_0x210eed){return _0x3ed049[_0xad5d('0x26')](_0x2b63ba);}return _0x3ed049[_0xad5d('0x27')](_0x2b63ba)['end']();};}function respondWithResult(_0x4ecf47,_0x305c82){_0x305c82=_0x305c82||0xc8;return function(_0x1b2b89){if(_0x1b2b89){return _0x4ecf47[_0xad5d('0x27')](_0x305c82)['json'](_0x1b2b89);}};}function respondWithFilteredResult(_0x5754c0,_0x3e0caf){return function(_0x3ca863){if(_0x3ca863){var _0x704d74=typeof _0x3e0caf[_0xad5d('0x28')]===_0xad5d('0x29')&&typeof _0x3e0caf[_0xad5d('0x2a')]===_0xad5d('0x29');var _0x1b55ec=_0x3ca863[_0xad5d('0x2b')];var _0x4916ff=_0x704d74?0x0:_0x3e0caf[_0xad5d('0x28')];var _0x3480e8=_0x704d74?_0x3ca863[_0xad5d('0x2b')]:_0x3e0caf[_0xad5d('0x28')]+_0x3e0caf[_0xad5d('0x2a')];var _0x558fc0;if(_0x3480e8>=_0x1b55ec){_0x3480e8=_0x1b55ec;_0x558fc0=0xc8;}else{_0x558fc0=0xce;}_0x5754c0['status'](_0x558fc0);return _0x5754c0['set'](_0xad5d('0x2c'),_0x4916ff+'-'+_0x3480e8+'/'+_0x1b55ec)[_0xad5d('0x2d')](_0x3ca863);}return null;};}function patchUpdates(_0x404e92){return function(_0x469199){try{jsonpatch['apply'](_0x469199,_0x404e92,!![]);}catch(_0x51d55d){return BPromise['reject'](_0x51d55d);}return _0x469199[_0xad5d('0x2e')]();};}function saveUpdates(_0x1e8109,_0x1df1a7){return function(_0x377fd0){if(_0x377fd0){return _0x377fd0[_0xad5d('0x2f')](_0x1e8109)[_0xad5d('0x30')](function(_0x1b0fe4){return _0x1b0fe4;});}return null;};}function removeEntity(_0x24555d,_0x176e8f){return function(_0x4427d9){if(_0x4427d9){return _0x4427d9[_0xad5d('0x31')]()['then'](function(){var _0x542fdf=_0x4427d9[_0xad5d('0x32')]({'plain':!![]});var _0x4b3d92=_0xad5d('0x33');return db[_0xad5d('0x34')][_0xad5d('0x31')]({'where':{'type':_0x4b3d92,'resourceId':_0x542fdf['id']}})[_0xad5d('0x30')](function(){return _0x4427d9;});})[_0xad5d('0x30')](function(){_0x24555d['status'](0xcc)[_0xad5d('0x35')]();});}};}function handleEntityNotFound(_0x3fdd52,_0x31a799){return function(_0x50f960){if(!_0x50f960){_0x3fdd52[_0xad5d('0x26')](0x194);}return _0x50f960;};}function handleError(_0x3ab190,_0x48c09a){_0x48c09a=_0x48c09a||0x1f4;return function(_0x5c0916){logger[_0xad5d('0x21')](_0x5c0916[_0xad5d('0x36')]);if(_0x5c0916['name']){delete _0x5c0916['name'];}_0x3ab190['status'](_0x48c09a)[_0xad5d('0x37')](_0x5c0916);};}exports['index']=function(_0x4c4bdc,_0x494f50){var _0x5156ef={'include':[{'model':db[_0xad5d('0x38')],'as':_0xad5d('0x39')}]},_0x28e3ef={},_0x25686e={'count':0x0,'rows':[]};var _0x49c217=_[_0xad5d('0x3a')](db[_0xad5d('0x3b')][_0xad5d('0x3c')],function(_0xd856c2){return{'name':_0xd856c2[_0xad5d('0x3d')],'type':_0xd856c2[_0xad5d('0x3e')][_0xad5d('0x3f')]};});_0x28e3ef[_0xad5d('0x40')]=_[_0xad5d('0x3a')](_0x49c217,_0xad5d('0x41'));_0x28e3ef[_0xad5d('0x42')]=_[_0xad5d('0x43')](_0x4c4bdc[_0xad5d('0x42')]);_0x28e3ef[_0xad5d('0x44')]=_[_0xad5d('0x45')](_0x28e3ef[_0xad5d('0x40')],_0x28e3ef[_0xad5d('0x42')]);_0x5156ef['attributes']=_[_0xad5d('0x45')](_0x28e3ef[_0xad5d('0x40')],qs[_0xad5d('0x46')](_0x4c4bdc[_0xad5d('0x42')][_0xad5d('0x46')]));_0x5156ef[_0xad5d('0x47')]=_0x5156ef[_0xad5d('0x47')][_0xad5d('0x48')]?_0x5156ef[_0xad5d('0x47')]:_0x28e3ef[_0xad5d('0x40')];if(!_0x4c4bdc['query'][_0xad5d('0x49')](_0xad5d('0x4a'))){_0x5156ef[_0xad5d('0x2a')]=qs[_0xad5d('0x2a')](_0x4c4bdc[_0xad5d('0x42')]['limit']);_0x5156ef['offset']=qs[_0xad5d('0x28')](_0x4c4bdc[_0xad5d('0x42')][_0xad5d('0x28')]);}_0x5156ef['order']=qs[_0xad5d('0x4b')](_0x4c4bdc['query'][_0xad5d('0x4b')]);_0x5156ef[_0xad5d('0x4c')]=qs[_0xad5d('0x44')](_[_0xad5d('0x4d')](_0x4c4bdc[_0xad5d('0x42')],_0x28e3ef[_0xad5d('0x44')]),_0x49c217);if(_0x4c4bdc['query'][_0xad5d('0x4e')]){_0x5156ef[_0xad5d('0x4c')]=_['merge'](_0x5156ef[_0xad5d('0x4c')],{'$or':_[_0xad5d('0x3a')](_0x49c217,function(_0x4e84d9){if(_0x4e84d9['type']!==_0xad5d('0x4f')){var _0x18f171={};_0x18f171[_0x4e84d9[_0xad5d('0x41')]]={'$like':'%'+_0x4c4bdc[_0xad5d('0x42')][_0xad5d('0x4e')]+'%'};return _0x18f171;}})});}_0x5156ef=_[_0xad5d('0x50')]({},_0x5156ef,_0x4c4bdc[_0xad5d('0x51')]);var _0x34a384={'where':_0x5156ef[_0xad5d('0x4c')]};return db[_0xad5d('0x3b')]['count'](_0x34a384)[_0xad5d('0x30')](function(_0x207695){_0x25686e['count']=_0x207695;if(_0x4c4bdc[_0xad5d('0x42')][_0xad5d('0x52')]){_0x5156ef[_0xad5d('0x53')]=[{'all':!![]}];}return db[_0xad5d('0x3b')][_0xad5d('0x54')](_0x5156ef);})['then'](function(_0x2887b9){_0x25686e['rows']=_0x2887b9;return _0x25686e;})[_0xad5d('0x30')](respondWithFilteredResult(_0x494f50,_0x5156ef))[_0xad5d('0x25')](handleError(_0x494f50,null));};exports[_0xad5d('0x55')]=function(_0x5aeb41,_0x30d859){var _0x1ffea0={'raw':![],'where':{'id':_0x5aeb41['params']['id']},'include':[{'model':db[_0xad5d('0x38')],'as':_0xad5d('0x39')}]},_0x1126b3={};_0x1126b3[_0xad5d('0x40')]=_[_0xad5d('0x43')](db[_0xad5d('0x3b')]['rawAttributes']);_0x1126b3['query']=_[_0xad5d('0x43')](_0x5aeb41[_0xad5d('0x42')]);_0x1126b3['filters']=_[_0xad5d('0x45')](_0x1126b3[_0xad5d('0x40')],_0x1126b3[_0xad5d('0x42')]);_0x1ffea0[_0xad5d('0x47')]=_[_0xad5d('0x45')](_0x1126b3[_0xad5d('0x40')],qs[_0xad5d('0x46')](_0x5aeb41[_0xad5d('0x42')][_0xad5d('0x46')]));_0x1ffea0['attributes']=_0x1ffea0['attributes']['length']?_0x1ffea0[_0xad5d('0x47')]:_0x1126b3[_0xad5d('0x40')];if(_0x5aeb41['query']['includeAll']){_0x1ffea0['include']=[{'all':!![]}];}_0x1ffea0=_[_0xad5d('0x50')]({},_0x1ffea0,_0x5aeb41[_0xad5d('0x51')]);return db['OpenchannelAccount'][_0xad5d('0x56')](_0x1ffea0)[_0xad5d('0x30')](handleEntityNotFound(_0x30d859,null))[_0xad5d('0x30')](respondWithResult(_0x30d859,null))['catch'](handleError(_0x30d859,null));};exports['create']=function(_0x45cb8c,_0x461840){return db[_0xad5d('0x3b')][_0xad5d('0x57')](_0x45cb8c[_0xad5d('0x58')],{})[_0xad5d('0x30')](function(_0x3f70c1){var _0x16b799=_0x45cb8c[_0xad5d('0x59')][_0xad5d('0x32')]({'plain':!![]});if(!_0x16b799)throw new Error(_0xad5d('0x5a'));if(_0x16b799['role']===_0xad5d('0x59')){var _0x38b220=_0x3f70c1[_0xad5d('0x32')]({'plain':!![]});var _0x26cd5c=_0xad5d('0x33');return db[_0xad5d('0x5b')][_0xad5d('0x56')]({'where':{'name':_0x26cd5c,'userProfileId':_0x16b799[_0xad5d('0x5c')]},'raw':!![]})[_0xad5d('0x30')](function(_0x179e33){if(_0x179e33&&_0x179e33[_0xad5d('0x5d')]===0x0){return db[_0xad5d('0x34')][_0xad5d('0x57')]({'name':_0x38b220[_0xad5d('0x41')],'resourceId':_0x38b220['id'],'type':_0x179e33[_0xad5d('0x41')],'sectionId':_0x179e33['id']},{})['then'](function(){return _0x3f70c1;});}else{return _0x3f70c1;}})[_0xad5d('0x25')](function(_0x1cb990){logger[_0xad5d('0x21')](_0xad5d('0x5e'),_0x1cb990);throw _0x1cb990;});}return _0x3f70c1;})[_0xad5d('0x30')](respondWithResult(_0x461840,0xc9))[_0xad5d('0x25')](handleError(_0x461840,null));};exports['update']=function(_0x2f4f74,_0x52a324){if(_0x2f4f74[_0xad5d('0x58')]['id']){delete _0x2f4f74[_0xad5d('0x58')]['id'];}return db['OpenchannelAccount'][_0xad5d('0x56')]({'where':{'id':_0x2f4f74[_0xad5d('0x5f')]['id']},'include':[{'model':db[_0xad5d('0x38')],'as':'mandatoryDispositionPause'}]})[_0xad5d('0x30')](handleEntityNotFound(_0x52a324,null))[_0xad5d('0x30')](saveUpdates(_0x2f4f74[_0xad5d('0x58')],null))['then'](respondWithResult(_0x52a324,null))[_0xad5d('0x25')](handleError(_0x52a324,null));};exports[_0xad5d('0x31')]=function(_0x269537,_0x3dfc69){return db['OpenchannelAccount'][_0xad5d('0x56')]({'where':{'id':_0x269537[_0xad5d('0x5f')]['id']}})[_0xad5d('0x30')](handleEntityNotFound(_0x3dfc69,null))['then'](removeEntity(_0x3dfc69,null))['catch'](handleError(_0x3dfc69,null));};exports[_0xad5d('0x60')]=function(_0x297d7a,_0x429b29){return db[_0xad5d('0x3b')][_0xad5d('0x60')]()[_0xad5d('0x30')](respondWithResult(_0x429b29,null))[_0xad5d('0x25')](handleError(_0x429b29,null));};exports[_0xad5d('0x61')]=function(_0x1ee28b,_0xd2af65,_0x3f9ab1){if(_0x1ee28b['body']['id']){delete _0x1ee28b[_0xad5d('0x58')]['id'];}return db[_0xad5d('0x3b')][_0xad5d('0x56')]({'where':{'id':_0x1ee28b[_0xad5d('0x5f')]['id']}})[_0xad5d('0x30')](handleEntityNotFound(_0xd2af65,null))[_0xad5d('0x30')](function(_0x3791bb){if(_0x3791bb){_0x1ee28b[_0xad5d('0x58')][_0xad5d('0x62')]=_0x3791bb['id'];return db[_0xad5d('0x63')][_0xad5d('0x57')](_0x1ee28b[_0xad5d('0x58')]);}})[_0xad5d('0x30')](respondWithResult(_0xd2af65,null))['catch'](handleError(_0xd2af65,null));};exports[_0xad5d('0x64')]=function(_0x9dac27,_0x50a215,_0x242473){var _0x2e506a={'raw':![],'where':{}};var _0x4186ea={};var _0x3595e8={'count':0x0,'rows':[]};return db[_0xad5d('0x3b')][_0xad5d('0x65')]({'where':{'id':_0x9dac27[_0xad5d('0x5f')]['id']}})[_0xad5d('0x30')](handleEntityNotFound(_0x50a215,null))['then'](function(_0x42aafd){if(_0x42aafd){_0x4186ea['model']=_[_0xad5d('0x43')](db[_0xad5d('0x63')][_0xad5d('0x3c')]);_0x4186ea['query']=_['keys'](_0x9dac27[_0xad5d('0x42')]);_0x4186ea[_0xad5d('0x44')]=_['intersection'](_0x4186ea['model'],_0x4186ea[_0xad5d('0x42')]);_0x2e506a[_0xad5d('0x47')]=_['intersection'](_0x4186ea[_0xad5d('0x40')],qs[_0xad5d('0x46')](_0x9dac27[_0xad5d('0x42')][_0xad5d('0x46')]));_0x2e506a['attributes']=_0x2e506a[_0xad5d('0x47')]['length']?_0x2e506a[_0xad5d('0x47')]:_0x4186ea[_0xad5d('0x40')];if(!_0x9dac27['query'][_0xad5d('0x49')]('nolimit')){_0x2e506a[_0xad5d('0x2a')]=qs[_0xad5d('0x2a')](_0x9dac27[_0xad5d('0x42')][_0xad5d('0x2a')]);_0x2e506a[_0xad5d('0x28')]=qs[_0xad5d('0x28')](_0x9dac27[_0xad5d('0x42')][_0xad5d('0x28')]);}_0x2e506a['order']=qs['sort'](_0x9dac27[_0xad5d('0x42')]['sort']);_0x2e506a['where']=qs[_0xad5d('0x44')](_['pick'](_0x9dac27[_0xad5d('0x42')],_0x4186ea[_0xad5d('0x44')]));_0x2e506a['where'][_0xad5d('0x62')]=_0x42aafd['id'];if(_0x9dac27[_0xad5d('0x42')][_0xad5d('0x4e')]){_0x2e506a[_0xad5d('0x4c')]=_['merge'](_0x2e506a[_0xad5d('0x4c')],{'$or':_[_0xad5d('0x3a')](_0x2e506a[_0xad5d('0x47')],function(_0x259c23){var _0x12d50b={};_0x12d50b[_0x259c23]={'$like':'%'+_0x9dac27[_0xad5d('0x42')][_0xad5d('0x4e')]+'%'};return _0x12d50b;})});}_0x2e506a=_['merge']({},_0x2e506a,_0x9dac27['options']);return db[_0xad5d('0x63')][_0xad5d('0x2b')]({'where':_0x2e506a['where']})[_0xad5d('0x30')](function(_0x5a8f53){_0x3595e8[_0xad5d('0x2b')]=_0x5a8f53;if(_0x9dac27[_0xad5d('0x42')][_0xad5d('0x52')]){_0x2e506a['include']=[{'all':!![]}];}return db['Disposition'][_0xad5d('0x54')](_0x2e506a);})[_0xad5d('0x30')](function(_0x484a08){_0x3595e8['rows']=_0x484a08;return _0x3595e8;});}})[_0xad5d('0x30')](respondWithFilteredResult(_0x50a215,_0x2e506a))['catch'](handleError(_0x50a215,null));};exports['removeDispositions']=function(_0x35520b,_0x3196bc,_0x2db0c7){return db['OpenchannelAccount']['find']({'where':{'id':_0x35520b[_0xad5d('0x5f')]['id']}})[_0xad5d('0x30')](handleEntityNotFound(_0x3196bc,null))[_0xad5d('0x30')](function(_0x12caa5){if(_0x12caa5){return _0x12caa5[_0xad5d('0x66')](_0x35520b[_0xad5d('0x42')][_0xad5d('0x67')]);}})[_0xad5d('0x30')](respondWithStatusCode(_0x3196bc,null))['catch'](handleError(_0x3196bc,null));};exports[_0xad5d('0x68')]=function(_0x3afdbe,_0x20036d,_0x483042){if(_0x3afdbe[_0xad5d('0x58')]['id']){delete _0x3afdbe[_0xad5d('0x58')]['id'];}return db[_0xad5d('0x3b')]['find']({'where':{'id':_0x3afdbe[_0xad5d('0x5f')]['id']}})['then'](handleEntityNotFound(_0x20036d,null))[_0xad5d('0x30')](function(_0x356c37){if(_0x356c37){_0x3afdbe['body'][_0xad5d('0x62')]=_0x356c37['id'];return db['CannedAnswer'][_0xad5d('0x57')](_0x3afdbe[_0xad5d('0x58')]);}})[_0xad5d('0x30')](respondWithResult(_0x20036d,null))[_0xad5d('0x25')](handleError(_0x20036d,null));};exports['getAnswers']=function(_0x7a7fc1,_0x27df3e,_0x1fa7e7){var _0x1c82dd={'raw':![],'where':{}};var _0x460722={};var _0x4a41de={'count':0x0,'rows':[]};return db[_0xad5d('0x3b')][_0xad5d('0x65')]({'where':{'id':_0x7a7fc1[_0xad5d('0x5f')]['id']}})[_0xad5d('0x30')](handleEntityNotFound(_0x27df3e,null))[_0xad5d('0x30')](function(_0x2c9145){if(_0x2c9145){_0x460722[_0xad5d('0x40')]=_[_0xad5d('0x43')](db['CannedAnswer'][_0xad5d('0x3c')]);_0x460722[_0xad5d('0x42')]=_[_0xad5d('0x43')](_0x7a7fc1[_0xad5d('0x42')]);_0x460722[_0xad5d('0x44')]=_[_0xad5d('0x45')](_0x460722[_0xad5d('0x40')],_0x460722[_0xad5d('0x42')]);_0x1c82dd['attributes']=_[_0xad5d('0x45')](_0x460722[_0xad5d('0x40')],qs[_0xad5d('0x46')](_0x7a7fc1[_0xad5d('0x42')][_0xad5d('0x46')]));_0x1c82dd[_0xad5d('0x47')]=_0x1c82dd[_0xad5d('0x47')][_0xad5d('0x48')]?_0x1c82dd['attributes']:_0x460722[_0xad5d('0x40')];if(!_0x7a7fc1[_0xad5d('0x42')]['hasOwnProperty'](_0xad5d('0x4a'))){_0x1c82dd[_0xad5d('0x2a')]=qs['limit'](_0x7a7fc1[_0xad5d('0x42')][_0xad5d('0x2a')]);_0x1c82dd[_0xad5d('0x28')]=qs[_0xad5d('0x28')](_0x7a7fc1['query'][_0xad5d('0x28')]);}_0x1c82dd[_0xad5d('0x69')]=qs[_0xad5d('0x4b')](_0x7a7fc1[_0xad5d('0x42')][_0xad5d('0x4b')]);_0x1c82dd[_0xad5d('0x4c')]=qs[_0xad5d('0x44')](_[_0xad5d('0x4d')](_0x7a7fc1[_0xad5d('0x42')],_0x460722[_0xad5d('0x44')]));_0x1c82dd[_0xad5d('0x4c')][_0xad5d('0x62')]=_0x2c9145['id'];if(_0x7a7fc1[_0xad5d('0x42')][_0xad5d('0x4e')]){_0x1c82dd[_0xad5d('0x4c')]=_[_0xad5d('0x50')](_0x1c82dd['where'],{'$or':_['map'](_0x1c82dd[_0xad5d('0x47')],function(_0x300d24){var _0x53908b={};_0x53908b[_0x300d24]={'$like':'%'+_0x7a7fc1['query'][_0xad5d('0x4e')]+'%'};return _0x53908b;})});}_0x1c82dd=_[_0xad5d('0x50')]({},_0x1c82dd,_0x7a7fc1[_0xad5d('0x51')]);return db[_0xad5d('0x6a')]['count']({'where':_0x1c82dd[_0xad5d('0x4c')]})[_0xad5d('0x30')](function(_0xd93458){_0x4a41de[_0xad5d('0x2b')]=_0xd93458;if(_0x7a7fc1['query'][_0xad5d('0x52')]){_0x1c82dd[_0xad5d('0x53')]=[{'all':!![]}];}return db[_0xad5d('0x6a')]['findAll'](_0x1c82dd);})[_0xad5d('0x30')](function(_0x260dce){_0x4a41de[_0xad5d('0x6b')]=_0x260dce;return _0x4a41de;});}})[_0xad5d('0x30')](respondWithFilteredResult(_0x27df3e,_0x1c82dd))['catch'](handleError(_0x27df3e,null));};exports[_0xad5d('0x6c')]=function(_0x392e88,_0x3e7715,_0x2ff053){return db['OpenchannelAccount'][_0xad5d('0x56')]({'where':{'id':_0x392e88[_0xad5d('0x5f')]['id']}})['then'](handleEntityNotFound(_0x3e7715,null))['then'](function(_0x21e753){if(_0x21e753){return _0x21e753['removeAnswers'](_0x392e88[_0xad5d('0x42')][_0xad5d('0x67')]);}})['then'](respondWithStatusCode(_0x3e7715,null))[_0xad5d('0x25')](handleError(_0x3e7715,null));};exports[_0xad5d('0x6d')]=function(_0x2eb6e1,_0x179d94,_0x8a909){var _0x50d9dc={'body':_0x2eb6e1[_0xad5d('0x58')],'channel':'openchannel'};var _0x2386e8=[];var _0x20913e=[];var _0x4cec2d={};var _0xd0938=![];return db['CmContact'][_0xad5d('0x60')]()[_0xad5d('0x30')](function(_0x2a44e3){if(!_0x2a44e3){throw new db[(_0xad5d('0x6e'))][(_0xad5d('0x6f'))](_0xad5d('0x70'));}_0x2386e8=_['difference'](_[_0xad5d('0x43')](_0x2a44e3),[_0xad5d('0x71'),_0xad5d('0x72')]);_0x20913e=_[_0xad5d('0x73')](_[_0xad5d('0x43')](_0x2a44e3),[_0xad5d('0x71'),_0xad5d('0x72'),_0xad5d('0x74'),'ListId']);if(_0x2eb6e1[_0xad5d('0x58')]['id']){delete _0x2eb6e1[_0xad5d('0x58')]['id'];}if(_[_0xad5d('0x75')](_0x2eb6e1[_0xad5d('0x58')]['from'])){throw new db[(_0xad5d('0x6e'))][(_0xad5d('0x6f'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x2eb6e1['body'][_0xad5d('0x58')])||_0x2eb6e1[_0xad5d('0x58')][_0xad5d('0x58')]===''){throw new db[(_0xad5d('0x6e'))][(_0xad5d('0x6f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xad5d('0x75')](_0x2eb6e1['body'][_0xad5d('0x76')])){throw new db[(_0xad5d('0x6e'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x20913e);}if(!_[_0xad5d('0x77')](_0x20913e,_0x2eb6e1[_0xad5d('0x58')][_0xad5d('0x76')])){throw new db['Sequelize'][(_0xad5d('0x6f'))](_0xad5d('0x78')+_0x20913e);}_0x4cec2d[_0x2eb6e1['body']['mapKey']]=_0x2eb6e1[_0xad5d('0x58')]['from'];})['then'](function(){return db[_0xad5d('0x3b')][_0xad5d('0x56')]({'where':{'id':_0x2eb6e1[_0xad5d('0x5f')]['id']},'include':[{'model':db[_0xad5d('0x79')],'as':'List','include':[{'model':db[_0xad5d('0x7a')],'as':_0xad5d('0x7b'),'where':_0x4cec2d,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db['OpenchannelApplication'],'as':_0xad5d('0x7c')}]});})[_0xad5d('0x30')](handleEntityNotFound(_0x179d94,null))[_0xad5d('0x30')](function(_0x9c1150){if(_0x9c1150&&_0x9c1150[_0xad5d('0x7d')]){_0x50d9dc[_0xad5d('0x7e')]=_0x9c1150;_0x50d9dc[_0xad5d('0x7f')]=_0x9c1150['Applications'];_0x50d9dc[_0xad5d('0x80')]=_0x9c1150[_0xad5d('0x7d')];_0x50d9dc[_0xad5d('0x7f')]=_[_0xad5d('0x81')](_0x50d9dc[_0xad5d('0x7f')],[_0xad5d('0x82')],[_0xad5d('0x83')]);if(_0x50d9dc['account'][_0xad5d('0x7c')]){delete _0x50d9dc[_0xad5d('0x7e')][_0xad5d('0x7c')];}if(_0x50d9dc[_0xad5d('0x7e')][_0xad5d('0x7d')]&&_0x50d9dc[_0xad5d('0x7e')]['List'][_0xad5d('0x7b')][_0xad5d('0x48')]){return _0x50d9dc[_0xad5d('0x7e')][_0xad5d('0x7d')][_0xad5d('0x7b')][0x0];}var _0xb558fd=_[_0xad5d('0x84')](_0x2eb6e1[_0xad5d('0x58')],{'firstName':_0x2eb6e1['body'][_0xad5d('0x85')],'ListId':_0x9c1150['ListId']});_0xb558fd[_0x2eb6e1[_0xad5d('0x58')]['mapKey']]=_0x2eb6e1[_0xad5d('0x58')][_0xad5d('0x85')];return db[_0xad5d('0x7a')]['create'](_0xb558fd,{'fields':_0x2386e8,'raw':!![]});}})[_0xad5d('0x30')](handleEntityNotFound(_0x179d94,null))[_0xad5d('0x30')](function(_0x4cab76){_0x50d9dc['contact']=_0x4cab76;if(_0x4cab76){var _0x15c91c={'ContactId':_0x4cab76['id'],'OpenchannelAccountId':_0x2eb6e1[_0xad5d('0x5f')]['id'],'from':(_0x4cab76[_0xad5d('0x86')]||'')+'\x20'+(_0x4cab76['lastName']||'')};var _0x3ebe47={'OpenchannelAccountId':_0x2eb6e1[_0xad5d('0x5f')]['id'],'closed':![]};if(_0x2eb6e1[_0xad5d('0x58')][_0xad5d('0x87')]){_0x3ebe47[_0xad5d('0x87')]=_0x2eb6e1[_0xad5d('0x58')]['threadId'];return db[_0xad5d('0x88')][_0xad5d('0x56')]({'where':_0x3ebe47})[_0xad5d('0x30')](function(_0x5d254e){if(_0x5d254e){return[_0x5d254e,![]];}_0x15c91c[_0xad5d('0x87')]=_0x2eb6e1['body'][_0xad5d('0x87')];_0x15c91c[_0xad5d('0x89')]=_0x2eb6e1[_0xad5d('0x58')][_0xad5d('0x89')];return db[_0xad5d('0x88')][_0xad5d('0x57')](_0x15c91c)[_0xad5d('0x30')](function(_0x3fa9e3){return[_0x3fa9e3,!![]];});});}else{_0x3ebe47[_0xad5d('0x87')]=null;}_0x3ebe47[_0xad5d('0x8a')]=_0x4cab76['id'];return db['OpenchannelInteraction']['find']({'where':_0x3ebe47})[_0xad5d('0x30')](function(_0x2c089d){if(_0x2c089d){return[_0x2c089d,![]];}return db['OpenchannelInteraction']['create'](_0x15c91c)[_0xad5d('0x30')](function(_0x5f5bbf){return[_0x5f5bbf,!![]];});});}})[_0xad5d('0x8b')](function(_0x252676,_0x83cbca){if(_0x252676){_0xd0938=_0x83cbca;if(!_0x83cbca){var _0x22c00d={'from':(_0x50d9dc[_0xad5d('0x8c')][_0xad5d('0x86')]||'')+'\x20'+(_0x50d9dc[_0xad5d('0x8c')][_0xad5d('0x8d')]||'')};if(_0x2eb6e1[_0xad5d('0x58')]['threadId']&&_0x2eb6e1[_0xad5d('0x58')]['messageId']&&_0x2eb6e1[_0xad5d('0x58')][_0xad5d('0x87')]!=_0x2eb6e1['body'][_0xad5d('0x8e')]){_0x22c00d[_0xad5d('0x87')]=_0x2eb6e1[_0xad5d('0x58')]['messageId'];}return _0x252676[_0xad5d('0x2f')](_0x22c00d);}else{return _0x252676;}}})[_0xad5d('0x30')](function(_0x5cf3d6){_0x50d9dc[_0xad5d('0x8f')]=_0x5cf3d6[_0xad5d('0x32')]({'plain':!![]});_0x50d9dc[_0xad5d('0x8f')][_0xad5d('0x90')]=_0xd0938;if(_0x50d9dc[_0xad5d('0x8f')][_0xad5d('0x90')]){if(_0x50d9dc[_0xad5d('0x7e')][_0xad5d('0x91')]){_0x50d9dc[_0xad5d('0x7f')][_0xad5d('0x92')]({'id':0x0,'priority':_0x50d9dc['applications'][_0xad5d('0x48')]+0x1,'app':_0xad5d('0x93'),'appdata':'unmanaged','interval':_0xad5d('0x94')});}}return db[_0xad5d('0x95')][_0xad5d('0x57')]({'body':_0x2eb6e1['body'][_0xad5d('0x58')],'OpenchannelAccountId':_0x2eb6e1[_0xad5d('0x5f')]['id'],'OpenchannelInteractionId':_0x5cf3d6['id'],'direction':'in','ContactId':_0x50d9dc[_0xad5d('0x8c')]['id'],'AttachmentId':_0x2eb6e1['body'][_0xad5d('0x96')]});})[_0xad5d('0x30')](function(_0x297c9e){_0x50d9dc[_0xad5d('0x23')]=_0x297c9e;if(!_0x50d9dc[_0xad5d('0x8f')][_0xad5d('0x97')])return;return db[_0xad5d('0x98')][_0xad5d('0x56')]({'attributes':['id','name'],'where':{'id':_0x50d9dc[_0xad5d('0x8f')][_0xad5d('0x97')]}});})[_0xad5d('0x30')](function(_0x4874dc){if(_0x4874dc){_0x50d9dc[_0xad5d('0x7f')][_0xad5d('0x99')]({'id':0x0,'priority':0x0,'app':_0xad5d('0x9a'),'appdata':_0x4874dc[_0xad5d('0x41')]+','+(_0x50d9dc[_0xad5d('0x7e')][_0xad5d('0x9b')]||0xa),'interval':_0xad5d('0x94')});}if(!_0x50d9dc[_0xad5d('0x8f')]['queueId'])return;return db[_0xad5d('0x9c')][_0xad5d('0x56')]({'attributes':['id',_0xad5d('0x41')],'where':{'id':_0x50d9dc[_0xad5d('0x8f')][_0xad5d('0x9d')]}});})['then'](function(_0x49149a){if(_0x49149a){_0x50d9dc[_0xad5d('0x7f')]['unshift']({'id':0x0,'priority':0x1,'app':_0xad5d('0x9e'),'appdata':_0x49149a['name']+','+(_0x50d9dc[_0xad5d('0x7e')][_0xad5d('0x9f')]||0x12c),'interval':_0xad5d('0x94')});}return respondWithRpcPromise('Start',_0xad5d('0xa0'),_0x50d9dc);})[_0xad5d('0x30')](function(_0x1c8582){respondWithRpcPromise('EventManager',_0xad5d('0xa1'),{'event':_0xad5d('0x6d'),'message':_0x1c8582},client9002);return _0x1c8582;})[_0xad5d('0x30')](respondWithResult(_0x179d94,null))[_0xad5d('0x25')](handleError(_0x179d94,null));};exports[_0xad5d('0xa2')]=function(_0x5a2184,_0x322e0c){var _0x2c868a=_0x5a2184[_0xad5d('0x5f')]['id'];var _0x47a196=_0x5a2184[_0xad5d('0x58')];var _0x5ac707=0xc8;var _0x13a1fa=null;return db['sequelize'][_0xad5d('0xa3')]({'isolationLevel':db[_0xad5d('0xa4')][_0xad5d('0xa5')][_0xad5d('0xa6')][_0xad5d('0xa7')]},function(_0x4eadf1){return db['OpenchannelAccount']['findOne']({'where':{'id':_0x2c868a},'transaction':_0x4eadf1})[_0xad5d('0x30')](function(_0x17416f){if(_0x17416f){return db[_0xad5d('0xa8')][_0xad5d('0x31')]({'where':{'OpenchannelAccountId':_0x2c868a},'transaction':_0x4eadf1})[_0xad5d('0x30')](function(){var _0x451494=_[_0xad5d('0x3a')](_0x47a196,function(_0x210fdf){_0x210fdf['OpenchannelAccountId']=_0x2c868a;return _0x210fdf;});return db['OpenchannelApplication']['bulkCreate'](_0x451494,{'transaction':_0x4eadf1});});}else{_0x5ac707=0x194;_0x13a1fa=[];}});})[_0xad5d('0x30')](function(){if(_0x5ac707!==0x194){return db[_0xad5d('0xa8')][_0xad5d('0xa9')]({'where':{'OpenchannelAccountId':_0x2c868a},'order':_0xad5d('0x82')})[_0xad5d('0x30')](function(_0x53f03c){_0x13a1fa=_0x53f03c;});}})[_0xad5d('0x25')](function(_0x33cb00){_0x5ac707=0x1f4;logger['error'](_0x33cb00[_0xad5d('0x36')]);if(_0x33cb00[_0xad5d('0x41')]){delete _0x33cb00['name'];}_0x13a1fa=_0x33cb00;})['finally'](function(){if(_0x13a1fa===null){_0x322e0c[_0xad5d('0x26')](_0x5ac707);}else{if(_0x5ac707===0x1f4){_0x322e0c[_0xad5d('0x27')](_0x5ac707)[_0xad5d('0x37')](_0x13a1fa);}else{_0x322e0c[_0xad5d('0x27')](_0x5ac707)[_0xad5d('0x2d')](_0x13a1fa);}}});};exports[_0xad5d('0xaa')]=function(_0xefc56c,_0x397355,_0x2dda09){var _0x5aaf83={};var _0x5833ed={};var _0x7858c8;var _0x30a11c;return db['OpenchannelAccount']['findOne']({'where':{'id':_0xefc56c[_0xad5d('0x5f')]['id']}})[_0xad5d('0x30')](handleEntityNotFound(_0x397355,null))[_0xad5d('0x30')](function(_0x2be4ba){if(_0x2be4ba){_0x7858c8=_0x2be4ba;_0x5833ed['model']=_[_0xad5d('0x43')](db['OpenchannelApplication'][_0xad5d('0x3c')]);_0x5833ed['query']=_[_0xad5d('0x43')](_0xefc56c[_0xad5d('0x42')]);_0x5833ed[_0xad5d('0x44')]=_[_0xad5d('0x45')](_0x5833ed['model'],_0x5833ed[_0xad5d('0x42')]);_0x5aaf83[_0xad5d('0x47')]=_[_0xad5d('0x45')](_0x5833ed[_0xad5d('0x40')],qs[_0xad5d('0x46')](_0xefc56c[_0xad5d('0x42')][_0xad5d('0x46')]));_0x5aaf83['attributes']=_0x5aaf83[_0xad5d('0x47')][_0xad5d('0x48')]?_0x5aaf83['attributes']:_0x5833ed[_0xad5d('0x40')];_0x5aaf83[_0xad5d('0x69')]=qs[_0xad5d('0x4b')](_0xefc56c[_0xad5d('0x42')]['sort']);_0x5aaf83[_0xad5d('0x4c')]=qs['filters'](_['pick'](_0xefc56c[_0xad5d('0x42')],_0x5833ed[_0xad5d('0x44')]));if(_0xefc56c[_0xad5d('0x42')][_0xad5d('0x4e')]){_0x5aaf83[_0xad5d('0x4c')]=_[_0xad5d('0x50')](_0x5aaf83[_0xad5d('0x4c')],{'$or':_[_0xad5d('0x3a')](_0x5aaf83['attributes'],function(_0x4aaffa){var _0x407c5c={};_0x407c5c[_0x4aaffa]={'$like':'%'+_0xefc56c[_0xad5d('0x42')][_0xad5d('0x4e')]+'%'};return _0x407c5c;})});}_0x5aaf83=_[_0xad5d('0x50')]({},_0x5aaf83,_0xefc56c[_0xad5d('0x51')]);return _0x7858c8[_0xad5d('0xaa')](_0x5aaf83);}})[_0xad5d('0x30')](function(_0xa3d0a9){if(_0xa3d0a9){_0x30a11c=_0xa3d0a9[_0xad5d('0x48')];if(!_0xefc56c[_0xad5d('0x42')][_0xad5d('0x49')](_0xad5d('0x4a'))){_0x5aaf83[_0xad5d('0x2a')]=qs[_0xad5d('0x2a')](_0xefc56c['query'][_0xad5d('0x2a')]);_0x5aaf83['offset']=qs['offset'](_0xefc56c[_0xad5d('0x42')][_0xad5d('0x28')]);}return _0x7858c8['getApplications'](_0x5aaf83);}})[_0xad5d('0x30')](function(_0x38466a){if(_0x38466a){return _0x38466a?{'count':_0x30a11c,'rows':_0x38466a}:null;}})[_0xad5d('0x30')](respondWithResult(_0x397355,null))['catch'](handleError(_0x397355,null));};exports['getInteractions']=function(_0x56e7e8,_0x3d233d,_0x7a2e89){var _0x462640={'raw':![],'where':{}};var _0x24179f={};var _0x25e677={'count':0x0,'rows':[]};return db[_0xad5d('0x3b')][_0xad5d('0x65')]({'where':{'id':_0x56e7e8[_0xad5d('0x5f')]['id']}})[_0xad5d('0x30')](handleEntityNotFound(_0x3d233d,null))[_0xad5d('0x30')](function(_0x392f93){if(_0x392f93){_0x24179f[_0xad5d('0x40')]=_['keys'](db[_0xad5d('0x88')]['rawAttributes']);_0x24179f[_0xad5d('0x42')]=_[_0xad5d('0x43')](_0x56e7e8[_0xad5d('0x42')]);_0x24179f[_0xad5d('0x44')]=_[_0xad5d('0x45')](_0x24179f[_0xad5d('0x40')],_0x24179f[_0xad5d('0x42')]);_0x462640[_0xad5d('0x47')]=_[_0xad5d('0x45')](_0x24179f[_0xad5d('0x40')],qs[_0xad5d('0x46')](_0x56e7e8[_0xad5d('0x42')]['fields']));_0x462640[_0xad5d('0x47')]=_0x462640[_0xad5d('0x47')][_0xad5d('0x48')]?_0x462640['attributes']:_0x24179f[_0xad5d('0x40')];if(!_0x56e7e8['query']['hasOwnProperty']('nolimit')){_0x462640[_0xad5d('0x2a')]=qs[_0xad5d('0x2a')](_0x56e7e8[_0xad5d('0x42')][_0xad5d('0x2a')]);_0x462640[_0xad5d('0x28')]=qs[_0xad5d('0x28')](_0x56e7e8[_0xad5d('0x42')][_0xad5d('0x28')]);}_0x462640[_0xad5d('0x69')]=qs['sort'](_0x56e7e8['query'][_0xad5d('0x4b')]);_0x462640['where']=qs['filters'](_[_0xad5d('0x4d')](_0x56e7e8['query'],_0x24179f[_0xad5d('0x44')]));_0x462640[_0xad5d('0x4c')][_0xad5d('0x62')]=_0x392f93['id'];if(_0x56e7e8[_0xad5d('0x42')][_0xad5d('0x4e')]){_0x462640['where']=_[_0xad5d('0x50')](_0x462640[_0xad5d('0x4c')],{'$or':_[_0xad5d('0x3a')](_0x462640[_0xad5d('0x47')],function(_0x254092){var _0x101105={};_0x101105[_0x254092]={'$like':'%'+_0x56e7e8[_0xad5d('0x42')][_0xad5d('0x4e')]+'%'};return _0x101105;})});}_0x462640=_[_0xad5d('0x50')]({},_0x462640,_0x56e7e8[_0xad5d('0x51')]);return db[_0xad5d('0x88')][_0xad5d('0x2b')]({'where':_0x462640[_0xad5d('0x4c')]})[_0xad5d('0x30')](function(_0x16b8ec){_0x25e677[_0xad5d('0x2b')]=_0x16b8ec;if(_0x56e7e8[_0xad5d('0x42')][_0xad5d('0x52')]){_0x462640[_0xad5d('0x53')]=[{'model':db[_0xad5d('0x7a')],'as':_0xad5d('0xab'),'required':![]},{'model':db['User'],'as':_0xad5d('0xac'),'attributes':['name',_0xad5d('0xad'),_0xad5d('0xae')],'required':![]},{'model':db[_0xad5d('0xaf')],'as':_0xad5d('0xb0'),'attributes':['id','name',_0xad5d('0xb1')],'where':_0x56e7e8[_0xad5d('0x42')][_0xad5d('0xb2')]?{'id':_0x56e7e8[_0xad5d('0x42')][_0xad5d('0xb2')]}:undefined,'required':_0x56e7e8[_0xad5d('0x42')][_0xad5d('0xb2')]?!![]:![]}];}return db[_0xad5d('0x88')][_0xad5d('0x54')](_0x462640);})[_0xad5d('0x30')](function(_0x106a34){_0x25e677['rows']=_0x106a34;return _0x25e677;});}})[_0xad5d('0x30')](respondWithFilteredResult(_0x3d233d,_0x462640))[_0xad5d('0x25')](handleError(_0x3d233d,null));};exports[_0xad5d('0xb3')]=function(_0x3dd48c,_0x4d3334,_0x38234d){return db[_0xad5d('0x3b')][_0xad5d('0x56')]({'where':{'id':_0x3dd48c[_0xad5d('0x5f')]['id']}})[_0xad5d('0x30')](handleEntityNotFound(_0x4d3334,null))[_0xad5d('0x30')](function(_0x177ab2){if(_0x177ab2){return _0x177ab2['addAgents'](_0x3dd48c[_0xad5d('0x58')][_0xad5d('0x67')],_['omit'](_0x3dd48c[_0xad5d('0x58')],[_0xad5d('0x67'),'id'])||{})[_0xad5d('0x8b')](function(_0xeba8fe){for(var _0x4626b1=0x0;_0x4626b1<_0x3dd48c['body']['ids']['length'];_0x4626b1+=0x1){socket[_0xad5d('0xb4')]('userOpenchannelAccount:save',{'UserId':Number(_0x3dd48c['body'][_0xad5d('0x67')][_0x4626b1]),'OpenchannelAccountId':Number(_0x3dd48c[_0xad5d('0x5f')]['id'])});}return _0xeba8fe;});}})[_0xad5d('0x30')](respondWithResult(_0x4d3334,null))['catch'](handleError(_0x4d3334,null));};exports[_0xad5d('0xb5')]=function(_0x1bd2a5,_0x538c3f,_0x3f1647){return db['OpenchannelAccount'][_0xad5d('0x56')]({'where':{'id':_0x1bd2a5[_0xad5d('0x5f')]['id']}})[_0xad5d('0x30')](handleEntityNotFound(_0x538c3f,null))[_0xad5d('0x30')](function(_0x24440d){if(_0x24440d){return _0x24440d[_0xad5d('0xb5')](_0x1bd2a5['query']['ids'])[_0xad5d('0x30')](function(){if(_['isArray'](_0x1bd2a5[_0xad5d('0x42')][_0xad5d('0x67')])){for(var _0x32dc91=0x0;_0x32dc91<_0x1bd2a5['query'][_0xad5d('0x67')]['length'];_0x32dc91+=0x1){socket[_0xad5d('0xb4')]('userOpenchannelAccount:remove',{'UserId':Number(_0x1bd2a5[_0xad5d('0x42')][_0xad5d('0x67')][_0x32dc91]),'OpenchannelAccountId':Number(_0x1bd2a5[_0xad5d('0x5f')]['id'])});}}else{socket[_0xad5d('0xb4')](_0xad5d('0xb6'),{'UserId':Number(_0x1bd2a5[_0xad5d('0x42')][_0xad5d('0x67')]),'OpenchannelAccountId':Number(_0x1bd2a5[_0xad5d('0x5f')]['id'])});}});}})[_0xad5d('0x30')](respondWithStatusCode(_0x538c3f,null))[_0xad5d('0x25')](handleError(_0x538c3f,null));};exports['getAgents']=function(_0x5d6058,_0x55e2b5,_0x1c5893){var _0x23bf69={};var _0x3a3fb2={};var _0x14ef91;var _0x5db7f4;return db['OpenchannelAccount']['findOne']({'where':{'id':_0x5d6058[_0xad5d('0x5f')]['id']}})[_0xad5d('0x30')](handleEntityNotFound(_0x55e2b5,null))[_0xad5d('0x30')](function(_0x4a531a){if(_0x4a531a){_0x14ef91=_0x4a531a;_0x3a3fb2[_0xad5d('0x40')]=_['keys'](db[_0xad5d('0x98')][_0xad5d('0x3c')]);_0x3a3fb2[_0xad5d('0x42')]=_[_0xad5d('0x43')](_0x5d6058[_0xad5d('0x42')]);_0x3a3fb2[_0xad5d('0x44')]=_[_0xad5d('0x45')](_0x3a3fb2[_0xad5d('0x40')],_0x3a3fb2['query']);_0x23bf69[_0xad5d('0x47')]=_[_0xad5d('0x45')](_0x3a3fb2[_0xad5d('0x40')],qs['fields'](_0x5d6058[_0xad5d('0x42')][_0xad5d('0x46')]));_0x23bf69['attributes']=_0x23bf69[_0xad5d('0x47')][_0xad5d('0x48')]?_0x23bf69[_0xad5d('0x47')]:_0x3a3fb2[_0xad5d('0x40')];_0x23bf69[_0xad5d('0x69')]=qs[_0xad5d('0x4b')](_0x5d6058[_0xad5d('0x42')]['sort']);_0x23bf69[_0xad5d('0x4c')]=qs[_0xad5d('0x44')](_[_0xad5d('0x4d')](_0x5d6058[_0xad5d('0x42')],_0x3a3fb2[_0xad5d('0x44')]));if(_0x5d6058[_0xad5d('0x42')]['filter']){_0x23bf69[_0xad5d('0x4c')]=_[_0xad5d('0x50')](_0x23bf69[_0xad5d('0x4c')],{'$or':_[_0xad5d('0x3a')](_0x23bf69['attributes'],function(_0xd885b){var _0x565425={};_0x565425[_0xd885b]={'$like':'%'+_0x5d6058[_0xad5d('0x42')][_0xad5d('0x4e')]+'%'};return _0x565425;})});}_0x23bf69=_[_0xad5d('0x50')]({},_0x23bf69,_0x5d6058[_0xad5d('0x51')]);return _0x14ef91['getAgents'](_0x23bf69);}})['then'](function(_0x254cfe){if(_0x254cfe){_0x5db7f4=_0x254cfe[_0xad5d('0x48')];if(!_0x5d6058['query']['hasOwnProperty'](_0xad5d('0x4a'))){_0x23bf69[_0xad5d('0x2a')]=qs[_0xad5d('0x2a')](_0x5d6058[_0xad5d('0x42')][_0xad5d('0x2a')]);_0x23bf69[_0xad5d('0x28')]=qs['offset'](_0x5d6058[_0xad5d('0x42')][_0xad5d('0x28')]);}return _0x14ef91[_0xad5d('0xb7')](_0x23bf69);}})['then'](function(_0x347cd5){if(_0x347cd5){return _0x347cd5?{'count':_0x5db7f4,'rows':_0x347cd5}:null;}})[_0xad5d('0x30')](respondWithResult(_0x55e2b5,null))[_0xad5d('0x25')](handleError(_0x55e2b5,null));};exports[_0xad5d('0x37')]=function(_0x39c436,_0x2922aa,_0x4fc0f6){var _0x5d97b4,_0x2a9124,_0x39a309;if(_[_0xad5d('0x75')](_0x39c436['body'][_0xad5d('0x58')])||_0x39c436['body']['body']===''){throw new db['Sequelize'][(_0xad5d('0x6f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x39c436[_0xad5d('0x58')]['to'])){}_0x5d97b4=_0x39c436[_0xad5d('0x58')]['to'];return db[_0xad5d('0x3b')][_0xad5d('0x65')]({'where':{'id':_0x39c436['params']['id']}})[_0xad5d('0x30')](handleEntityNotFound(_0x2922aa,null))[_0xad5d('0x30')](function(_0x37ce8c){if(_0x37ce8c){return db[_0xad5d('0x3b')]['find']({'where':{'id':_0x37ce8c['id']},'include':[{'model':db[_0xad5d('0x79')],'as':'List','include':[{'model':db[_0xad5d('0x7a')],'as':_0xad5d('0x7b'),'where':{[_0x37ce8c['mapKey']]:_0x5d97b4},'limit':0x1,'order':[[_0xad5d('0x72'),_0xad5d('0xb8')]]}]}]})[_0xad5d('0x30')](handleEntityNotFound(_0x2922aa,null))[_0xad5d('0x30')](function(_0x283b7a){if(_0x283b7a&&_0x283b7a['List']){_0x2a9124=_0x283b7a[_0xad5d('0x32')]({'plain':!![]});if(_0x2a9124[_0xad5d('0x7d')]&&_0x2a9124[_0xad5d('0x7d')][_0xad5d('0x7b')]['length']){return _0x2a9124[_0xad5d('0x7d')]['Contacts'][0x0];}return db[_0xad5d('0x7a')]['create'](_['defaults'](_0x39c436[_0xad5d('0x58')],{'firstName':_0x5d97b4,[_0x283b7a[_0xad5d('0x76')]]:_0x5d97b4,'phone':_0x5d97b4,'ListId':_0x2a9124[_0xad5d('0xb9')]}));}})[_0xad5d('0x30')](handleEntityNotFound(_0x2922aa,null))[_0xad5d('0x30')](function(_0x4e4118){if(_0x4e4118){_0x39a309=_0x4e4118;return db['OpenchannelInteraction'][_0xad5d('0x56')]({'where':{'ContactId':_0x39a309['id'],'closed':![],'OpenchannelAccountId':_0x2a9124['id']}})[_0xad5d('0x30')](function(_0x277e13){if(_0x277e13){return[_0x277e13,![]];}return db[_0xad5d('0x88')][_0xad5d('0x57')]({'UserId':_0x39c436[_0xad5d('0x59')]['id'],'ContactId':_0x39a309['id'],'OpenchannelAccountId':_0x2a9124['id'],'lastMsgDirection':_0xad5d('0xba'),'firstMsgDirection':_0xad5d('0xba'),'Messages':[_[_0xad5d('0x50')](_0x39c436[_0xad5d('0x58')],{'read':![],'body':_0x39c436[_0xad5d('0x58')][_0xad5d('0x58')],'OpenchannelAccountId':_0x2a9124['id'],'UserId':_0x39c436[_0xad5d('0x59')]['id'],'ContactId':_0x39a309['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0xad5d('0xbb')}]})[_0xad5d('0x30')](function(_0x1081a8){return[_0x1081a8,!![]];});});}})[_0xad5d('0x8b')](function(_0x2efb4f,_0xbb8bd){if(_0xbb8bd){return _0x2efb4f;}return db[_0xad5d('0x95')]['create'](_[_0xad5d('0x50')](_0x39c436[_0xad5d('0x58')],{'read':![],'body':_0x39c436[_0xad5d('0x58')][_0xad5d('0x58')],'OpenchannelAccountId':_0x2a9124['id'],'OpenchannelInteractionId':_0x2efb4f['id'],'UserId':_0x39c436['user']['id'],'ContactId':_0x39a309['id']}))['then'](function(_0x4885d0){_0x2efb4f[_0xad5d('0xbc')][_0xad5d('0xbb')]=[];_0x2efb4f['dataValues'][_0xad5d('0xbb')][_0xad5d('0x92')](_0x4885d0['dataValues']);return _0x2efb4f;});});}})[_0xad5d('0x30')](respondWithResult(_0x2922aa,null))[_0xad5d('0x25')](handleError(_0x2922aa,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 1c9b0ca..768f01c 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 _0x668b=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x5ce15c,_0x19c917){var _0x36e4f5=function(_0x50fa90){while(--_0x50fa90){_0x5ce15c['push'](_0x5ce15c['shift']());}};_0x36e4f5(++_0x19c917);}(_0x668b,0x140));var _0xb668=function(_0x54c10d,_0x2f2251){_0x54c10d=_0x54c10d-0x0;var _0x1fa703=_0x668b[_0x54c10d];return _0x1fa703;};'use strict';var EventEmitter=require(_0xb668('0x0'));var OpenchannelAccount=require(_0xb668('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xb668('0x2')](0x0);var events={'afterCreate':_0xb668('0x3'),'afterUpdate':'update','afterDestroy':_0xb668('0x4')};function emitEvent(_0x5e2e83){return function(_0x2fab11,_0x4092a6,_0x2960f5){OpenchannelAccountEvents['emit'](_0x5e2e83+':'+_0x2fab11['id'],_0x2fab11);OpenchannelAccountEvents[_0xb668('0x5')](_0x5e2e83,_0x2fab11);_0x2960f5(null);};}for(var e in events){if(events[_0xb668('0x6')](e)){var event=events[e];OpenchannelAccount[_0xb668('0x7')](e,emitEvent(event));}}module[_0xb668('0x8')]=OpenchannelAccountEvents; \ No newline at end of file +var _0xda3f=['exports','../../mysqldb','OpenchannelAccount','remove','emit'];(function(_0x35007a,_0x58a0d4){var _0x574f68=function(_0xd1c129){while(--_0xd1c129){_0x35007a['push'](_0x35007a['shift']());}};_0x574f68(++_0x58a0d4);}(_0xda3f,0xec));var _0xfda3=function(_0x2d5e83,_0x339eac){_0x2d5e83=_0x2d5e83-0x0;var _0x4ab2a2=_0xda3f[_0x2d5e83];return _0x4ab2a2;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0xfda3('0x0'))['db'][_0xfda3('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xfda3('0x2')};function emitEvent(_0x581693){return function(_0x36dc71,_0x22187d,_0x516500){OpenchannelAccountEvents[_0xfda3('0x3')](_0x581693+':'+_0x36dc71['id'],_0x36dc71);OpenchannelAccountEvents[_0xfda3('0x3')](_0x581693,_0x36dc71);_0x516500(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0xfda3('0x4')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 0112bb2..0d49a56 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(_0x2b0c31,_0x27563e){var _0x503780=function(_0x43cb51){while(--_0x43cb51){_0x2b0c31['push'](_0x2b0c31['shift']());}};_0x503780(++_0x27563e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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(_0x524fe9,_0x4f3aec){var _0x1d783b=function(_0x4452d1){while(--_0x4452d1){_0x524fe9['push'](_0x524fe9['shift']());}};_0x1d783b(++_0x4f3aec);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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 751d98b..f44ea6e 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 _0x94df=['register','request','then','info','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./openchannelAccount.socket'];(function(_0x5bbae4,_0x2a4a4e){var _0x338a50=function(_0x478845){while(--_0x478845){_0x5bbae4['push'](_0x5bbae4['shift']());}};_0x338a50(++_0x2a4a4e);}(_0x94df,0xa3));var _0xf94d=function(_0x137629,_0x3abdcb){_0x137629=_0x137629-0x0;var _0x1b2511=_0x94df[_0x137629];return _0x1b2511;};'use strict';var _=require(_0xf94d('0x0'));var util=require(_0xf94d('0x1'));var moment=require(_0xf94d('0x2'));var BPromise=require(_0xf94d('0x3'));var rs=require(_0xf94d('0x4'));var fs=require('fs');var Redis=require(_0xf94d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf94d('0x6'));var logger=require(_0xf94d('0x7'))(_0xf94d('0x8'));var config=require(_0xf94d('0x9'));var jayson=require(_0xf94d('0xa'));var client=jayson[_0xf94d('0xb')][_0xf94d('0xc')]({'port':0x232a});config[_0xf94d('0xd')]=_[_0xf94d('0xe')](config[_0xf94d('0xd')],{'host':_0xf94d('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf94d('0xd')]));require(_0xf94d('0x10'))[_0xf94d('0x11')](socket);function respondWithRpcPromise(_0x1bde05,_0xdaa8d6,_0x45739c){return new BPromise(function(_0x47efc6,_0x25c68e){return client[_0xf94d('0x12')](_0x1bde05,_0x45739c)[_0xf94d('0x13')](function(_0x19b1de){logger[_0xf94d('0x14')]('OpenchannelAccount,\x20%s,\x20%s',_0xdaa8d6,'request\x20sent');logger[_0xf94d('0x15')](_0xf94d('0x16'),_0xdaa8d6,_0xf94d('0x17'),JSON[_0xf94d('0x18')](_0x19b1de));if(_0x19b1de[_0xf94d('0x19')]){if(_0x19b1de[_0xf94d('0x19')]['code']===0x1f4){logger[_0xf94d('0x19')](_0xf94d('0x1a'),_0xdaa8d6,_0x19b1de[_0xf94d('0x19')][_0xf94d('0x1b')]);return _0x25c68e(_0x19b1de[_0xf94d('0x19')][_0xf94d('0x1b')]);}logger[_0xf94d('0x19')](_0xf94d('0x1a'),_0xdaa8d6,_0x19b1de['error'][_0xf94d('0x1b')]);return _0x47efc6(_0x19b1de['error'][_0xf94d('0x1b')]);}else{logger['info'](_0xf94d('0x1a'),_0xdaa8d6,'request\x20sent');_0x47efc6(_0x19b1de[_0xf94d('0x1c')][_0xf94d('0x1b')]);}})[_0xf94d('0x1d')](function(_0x349de5){logger['error'](_0xf94d('0x1a'),_0xdaa8d6,_0x349de5);_0x25c68e(_0x349de5);});});} \ No newline at end of file +var _0x6f2f=['socket.io-emitter','./openchannelAccount.socket','register','request','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','ioredis','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost'];(function(_0x254ba7,_0x256609){var _0xf04dde=function(_0x52da31){while(--_0x52da31){_0x254ba7['push'](_0x254ba7['shift']());}};_0xf04dde(++_0x256609);}(_0x6f2f,0xbe));var _0xf6f2=function(_0x256b72,_0x340985){_0x256b72=_0x256b72-0x0;var _0x2183e3=_0x6f2f[_0x256b72];return _0x2183e3;};'use strict';var _=require(_0xf6f2('0x0'));var util=require(_0xf6f2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf6f2('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf6f2('0x3'))(_0xf6f2('0x4'));var config=require(_0xf6f2('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf6f2('0x6')]({'port':0x232a});config[_0xf6f2('0x7')]=_[_0xf6f2('0x8')](config[_0xf6f2('0x7')],{'host':_0xf6f2('0x9'),'port':0x18eb});var socket=require(_0xf6f2('0xa'))(new Redis(config[_0xf6f2('0x7')]));require(_0xf6f2('0xb'))[_0xf6f2('0xc')](socket);function respondWithRpcPromise(_0x17ffd2,_0x55a260,_0x109271){return new BPromise(function(_0x266c6e,_0x2a4325){return client[_0xf6f2('0xd')](_0x17ffd2,_0x109271)['then'](function(_0x4ca76a){logger['info'](_0xf6f2('0xe'),_0x55a260,_0xf6f2('0xf'));logger[_0xf6f2('0x10')](_0xf6f2('0x11'),_0x55a260,_0xf6f2('0xf'),JSON[_0xf6f2('0x12')](_0x4ca76a));if(_0x4ca76a['error']){if(_0x4ca76a[_0xf6f2('0x13')][_0xf6f2('0x14')]===0x1f4){logger[_0xf6f2('0x13')](_0xf6f2('0xe'),_0x55a260,_0x4ca76a[_0xf6f2('0x13')]['message']);return _0x2a4325(_0x4ca76a[_0xf6f2('0x13')][_0xf6f2('0x15')]);}logger[_0xf6f2('0x13')](_0xf6f2('0xe'),_0x55a260,_0x4ca76a[_0xf6f2('0x13')][_0xf6f2('0x15')]);return _0x266c6e(_0x4ca76a[_0xf6f2('0x13')][_0xf6f2('0x15')]);}else{logger[_0xf6f2('0x16')](_0xf6f2('0xe'),_0x55a260,_0xf6f2('0xf'));_0x266c6e(_0x4ca76a[_0xf6f2('0x17')][_0xf6f2('0x15')]);}})[_0xf6f2('0x18')](function(_0xb05611){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x55a260,_0xb05611);_0x2a4325(_0xb05611);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 3a00e74..40c80f3 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 _0x2504=['remove','update','emit','removeListener','register','openchannelAccount:','./openchannelAccount.events','save'];(function(_0x1bce91,_0x2b6500){var _0x3c20c2=function(_0x1eeb06){while(--_0x1eeb06){_0x1bce91['push'](_0x1bce91['shift']());}};_0x3c20c2(++_0x2b6500);}(_0x2504,0xee));var _0x4250=function(_0x41d4ce,_0x2aa719){_0x41d4ce=_0x41d4ce-0x0;var _0x1525c0=_0x2504[_0x41d4ce];return _0x1525c0;};'use strict';var OpenchannelAccountEvents=require(_0x4250('0x0'));var events=[_0x4250('0x1'),_0x4250('0x2'),_0x4250('0x3')];function createListener(_0x307ca9,_0x67c47b){return function(_0x41d71d){_0x67c47b[_0x4250('0x4')](_0x307ca9,_0x41d71d);};}function removeListener(_0x17d2d8,_0xc31f3a){return function(){OpenchannelAccountEvents[_0x4250('0x5')](_0x17d2d8,_0xc31f3a);};}exports[_0x4250('0x6')]=function(_0x493da9){for(var _0x473cb8=0x0,_0x4e177e=events['length'];_0x473cb8<_0x4e177e;_0x473cb8++){var _0x370998=events[_0x473cb8];var _0x477312=createListener(_0x4250('0x7')+_0x370998,_0x493da9);OpenchannelAccountEvents['on'](_0x370998,_0x477312);}}; \ No newline at end of file +var _0x5712=['remove','update','emit','length','openchannelAccount:','./openchannelAccount.events','save'];(function(_0x3b5a9a,_0x52a566){var _0x51bb79=function(_0x47f01f){while(--_0x47f01f){_0x3b5a9a['push'](_0x3b5a9a['shift']());}};_0x51bb79(++_0x52a566);}(_0x5712,0x140));var _0x2571=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x5712[_0x1facfa];return _0x9ec701;};'use strict';var OpenchannelAccountEvents=require(_0x2571('0x0'));var events=[_0x2571('0x1'),_0x2571('0x2'),_0x2571('0x3')];function createListener(_0x370563,_0xcd3caf){return function(_0x29c464){_0xcd3caf[_0x2571('0x4')](_0x370563,_0x29c464);};}function removeListener(_0x102dd6,_0x42459b){return function(){OpenchannelAccountEvents['removeListener'](_0x102dd6,_0x42459b);};}exports['register']=function(_0x4713ad){for(var _0x50fc72=0x0,_0x3e19b2=events[_0x2571('0x5')];_0x50fc72<_0x3e19b2;_0x50fc72++){var _0x3ca885=events[_0x50fc72];var _0x204ecc=createListener(_0x2571('0x6')+_0x3ca885,_0x4713ad);OpenchannelAccountEvents['on'](_0x3ca885,_0x204ecc);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index e312464..14b212d 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 _0xa0f0=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','/:id','post','create','put','update','delete','multer','util','path'];(function(_0x3846e4,_0x4be843){var _0x549068=function(_0x5beb84){while(--_0x5beb84){_0x3846e4['push'](_0x3846e4['shift']());}};_0x549068(++_0x4be843);}(_0xa0f0,0x1e3));var _0x0a0f=function(_0x334eb0,_0x3f192d){_0x334eb0=_0x334eb0-0x0;var _0x20f534=_0xa0f0[_0x334eb0];return _0x20f534;};'use strict';var multer=require(_0x0a0f('0x0'));var util=require(_0x0a0f('0x1'));var path=require(_0x0a0f('0x2'));var timeout=require('connect-timeout');var express=require(_0x0a0f('0x3'));var router=express[_0x0a0f('0x4')]();var fs_extra=require(_0x0a0f('0x5'));var auth=require(_0x0a0f('0x6'));var interaction=require(_0x0a0f('0x7'));var config=require(_0x0a0f('0x8'));var controller=require(_0x0a0f('0x9'));router[_0x0a0f('0xa')]('/',auth[_0x0a0f('0xb')](),controller['index']);router['get'](_0x0a0f('0xc'),auth[_0x0a0f('0xb')](),controller['show']);router[_0x0a0f('0xd')]('/',auth[_0x0a0f('0xb')](),controller[_0x0a0f('0xe')]);router[_0x0a0f('0xf')]('/:id',auth[_0x0a0f('0xb')](),controller[_0x0a0f('0x10')]);router[_0x0a0f('0x11')](_0x0a0f('0xc'),auth[_0x0a0f('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x353d=['post','create','put','destroy','exports','util','connect-timeout','Router','../../components/auth/service','get','isAuthenticated','index','/:id','show'];(function(_0x425f4d,_0xe54905){var _0x11c52c=function(_0x2b0cdc){while(--_0x2b0cdc){_0x425f4d['push'](_0x425f4d['shift']());}};_0x11c52c(++_0xe54905);}(_0x353d,0x101));var _0xd353=function(_0x527c30,_0x2a8feb){_0x527c30=_0x527c30-0x0;var _0x34f2b4=_0x353d[_0x527c30];return _0x34f2b4;};'use strict';var multer=require('multer');var util=require(_0xd353('0x0'));var path=require('path');var timeout=require(_0xd353('0x1'));var express=require('express');var router=express[_0xd353('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xd353('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./openchannelApplication.controller');router[_0xd353('0x4')]('/',auth[_0xd353('0x5')](),controller[_0xd353('0x6')]);router[_0xd353('0x4')](_0xd353('0x7'),auth[_0xd353('0x5')](),controller[_0xd353('0x8')]);router[_0xd353('0x9')]('/',auth['isAuthenticated'](),controller[_0xd353('0xa')]);router[_0xd353('0xb')](_0xd353('0x7'),auth[_0xd353('0x5')](),controller['update']);router['delete'](_0xd353('0x7'),auth[_0xd353('0x5')](),controller[_0xd353('0xc')]);module[_0xd353('0xd')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index c32b0e7..14822be 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 _0xc0f8=['TEXT','STRING','*,*,*,*','sequelize','noop'];(function(_0x63e3cd,_0x1e71b5){var _0xfe9dba=function(_0x4ba38b){while(--_0x4ba38b){_0x63e3cd['push'](_0x63e3cd['shift']());}};_0xfe9dba(++_0x1e71b5);}(_0xc0f8,0x1ac));var _0x8c0f=function(_0x4fffc0,_0x2341ec){_0x4fffc0=_0x4fffc0-0x0;var _0x39713e=_0xc0f8[_0x4fffc0];return _0x39713e;};'use strict';var Sequelize=require(_0x8c0f('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8c0f('0x1')},'appdata':{'type':Sequelize[_0x8c0f('0x2')]()},'description':{'type':Sequelize[_0x8c0f('0x3')]},'interval':{'type':Sequelize[_0x8c0f('0x3')],'defaultValue':_0x8c0f('0x4')}}; \ No newline at end of file +var _0xeaa5=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x2f12d2,_0x59c3cd){var _0x442498=function(_0x2b8d4a){while(--_0x2b8d4a){_0x2f12d2['push'](_0x2f12d2['shift']());}};_0x442498(++_0x59c3cd);}(_0xeaa5,0x1cd));var _0x5eaa=function(_0x10e8dd,_0xda50ff){_0x10e8dd=_0x10e8dd-0x0;var _0x22c479=_0xeaa5[_0x10e8dd];return _0x22c479;};'use strict';var Sequelize=require(_0x5eaa('0x0'));module[_0x5eaa('0x1')]={'priority':{'type':Sequelize[_0x5eaa('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x5eaa('0x3')],'allowNull':![],'defaultValue':_0x5eaa('0x4')},'appdata':{'type':Sequelize[_0x5eaa('0x5')]()},'description':{'type':Sequelize[_0x5eaa('0x3')]},'interval':{'type':Sequelize[_0x5eaa('0x3')],'defaultValue':_0x5eaa('0x6')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index c7e4db9..47659c5 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 _0xbb13=['Content-Range','json','save','update','then','stack','index','OpenchannelApplication','fieldName','type','key','model','map','name','query','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','where','merge','VIRTUAL','count','includeAll','findAll','rows','catch','show','keys','rawAttributes','include','options','find','create','body','destroy','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set'];(function(_0x261a4a,_0x389a4f){var _0xc8d5b4=function(_0x5084e9){while(--_0x5084e9){_0x261a4a['push'](_0x261a4a['shift']());}};_0xc8d5b4(++_0x389a4f);}(_0xbb13,0x1da));var _0x3bb1=function(_0x254c42,_0x3ffe09){_0x254c42=_0x254c42-0x0;var _0x381cb7=_0xbb13[_0x254c42];return _0x381cb7;};'use strict';var emlformat=require(_0x3bb1('0x0'));var rimraf=require(_0x3bb1('0x1'));var zipdir=require(_0x3bb1('0x2'));var jsonpatch=require(_0x3bb1('0x3'));var rp=require(_0x3bb1('0x4'));var moment=require('moment');var BPromise=require(_0x3bb1('0x5'));var Mustache=require(_0x3bb1('0x6'));var util=require(_0x3bb1('0x7'));var path=require(_0x3bb1('0x8'));var sox=require('sox');var csv=require(_0x3bb1('0x9'));var ejs=require(_0x3bb1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3bb1('0xb'));var squel=require(_0x3bb1('0xc'));var crypto=require('crypto');var jsforce=require(_0x3bb1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3bb1('0x9'));var querystring=require(_0x3bb1('0xe'));var Papa=require(_0x3bb1('0xf'));var Redis=require(_0x3bb1('0x10'));var authService=require(_0x3bb1('0x11'));var qs=require(_0x3bb1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3bb1('0x13'))('api');var utils=require(_0x3bb1('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3bb1('0x15'));var db=require(_0x3bb1('0x16'))['db'];function respondWithStatusCode(_0x359fff,_0x48af7d){_0x48af7d=_0x48af7d||0xcc;return function(_0x281b34){if(_0x281b34){return _0x359fff[_0x3bb1('0x17')](_0x48af7d);}return _0x359fff[_0x3bb1('0x18')](_0x48af7d)[_0x3bb1('0x19')]();};}function respondWithResult(_0x5d8398,_0x20621a){_0x20621a=_0x20621a||0xc8;return function(_0xff5662){if(_0xff5662){return _0x5d8398[_0x3bb1('0x18')](_0x20621a)['json'](_0xff5662);}};}function respondWithFilteredResult(_0x5002b9,_0x516823){return function(_0x28d2d8){if(_0x28d2d8){var _0x5d937e=typeof _0x516823[_0x3bb1('0x1a')]===_0x3bb1('0x1b')&&typeof _0x516823[_0x3bb1('0x1c')]===_0x3bb1('0x1b');var _0x142e22=_0x28d2d8['count'];var _0x60234a=_0x5d937e?0x0:_0x516823[_0x3bb1('0x1a')];var _0x91be9e=_0x5d937e?_0x28d2d8['count']:_0x516823['offset']+_0x516823['limit'];var _0x5ec9f4;if(_0x91be9e>=_0x142e22){_0x91be9e=_0x142e22;_0x5ec9f4=0xc8;}else{_0x5ec9f4=0xce;}_0x5002b9['status'](_0x5ec9f4);return _0x5002b9[_0x3bb1('0x1d')](_0x3bb1('0x1e'),_0x60234a+'-'+_0x91be9e+'/'+_0x142e22)[_0x3bb1('0x1f')](_0x28d2d8);}return null;};}function patchUpdates(_0x2808e6){return function(_0x3bce59){try{jsonpatch['apply'](_0x3bce59,_0x2808e6,!![]);}catch(_0x1b4f7d){return BPromise['reject'](_0x1b4f7d);}return _0x3bce59[_0x3bb1('0x20')]();};}function saveUpdates(_0x3a330b,_0x4aebf5){return function(_0x4a943a){if(_0x4a943a){return _0x4a943a[_0x3bb1('0x21')](_0x3a330b)[_0x3bb1('0x22')](function(_0x2a4a6e){return _0x2a4a6e;});}return null;};}function removeEntity(_0x2ecbc8,_0x1f1311){return function(_0x34b6af){if(_0x34b6af){return _0x34b6af['destroy']()[_0x3bb1('0x22')](function(){_0x2ecbc8['status'](0xcc)[_0x3bb1('0x19')]();});}};}function handleEntityNotFound(_0x80cabd,_0x2105f5){return function(_0x75b526){if(!_0x75b526){_0x80cabd[_0x3bb1('0x17')](0x194);}return _0x75b526;};}function handleError(_0x294008,_0x3ea9e8){_0x3ea9e8=_0x3ea9e8||0x1f4;return function(_0x2fd452){logger['error'](_0x2fd452[_0x3bb1('0x23')]);if(_0x2fd452['name']){delete _0x2fd452['name'];}_0x294008[_0x3bb1('0x18')](_0x3ea9e8)['send'](_0x2fd452);};}exports[_0x3bb1('0x24')]=function(_0x811819,_0x3f5107){var _0x4b2e04={},_0x5151f8={},_0x52c702={'count':0x0,'rows':[]};var _0x322d87=_['map'](db[_0x3bb1('0x25')]['rawAttributes'],function(_0x47480c){return{'name':_0x47480c[_0x3bb1('0x26')],'type':_0x47480c[_0x3bb1('0x27')][_0x3bb1('0x28')]};});_0x5151f8[_0x3bb1('0x29')]=_[_0x3bb1('0x2a')](_0x322d87,_0x3bb1('0x2b'));_0x5151f8[_0x3bb1('0x2c')]=_['keys'](_0x811819[_0x3bb1('0x2c')]);_0x5151f8[_0x3bb1('0x2d')]=_[_0x3bb1('0x2e')](_0x5151f8[_0x3bb1('0x29')],_0x5151f8[_0x3bb1('0x2c')]);_0x4b2e04[_0x3bb1('0x2f')]=_[_0x3bb1('0x2e')](_0x5151f8[_0x3bb1('0x29')],qs[_0x3bb1('0x30')](_0x811819['query'][_0x3bb1('0x30')]));_0x4b2e04['attributes']=_0x4b2e04[_0x3bb1('0x2f')][_0x3bb1('0x31')]?_0x4b2e04[_0x3bb1('0x2f')]:_0x5151f8[_0x3bb1('0x29')];if(!_0x811819[_0x3bb1('0x2c')]['hasOwnProperty'](_0x3bb1('0x32'))){_0x4b2e04[_0x3bb1('0x1c')]=qs['limit'](_0x811819['query'][_0x3bb1('0x1c')]);_0x4b2e04[_0x3bb1('0x1a')]=qs[_0x3bb1('0x1a')](_0x811819['query'][_0x3bb1('0x1a')]);}_0x4b2e04['order']=qs[_0x3bb1('0x33')](_0x811819[_0x3bb1('0x2c')][_0x3bb1('0x33')]);_0x4b2e04['where']=qs[_0x3bb1('0x2d')](_[_0x3bb1('0x34')](_0x811819['query'],_0x5151f8[_0x3bb1('0x2d')]),_0x322d87);if(_0x811819['query'][_0x3bb1('0x35')]){_0x4b2e04[_0x3bb1('0x36')]=_[_0x3bb1('0x37')](_0x4b2e04[_0x3bb1('0x36')],{'$or':_[_0x3bb1('0x2a')](_0x322d87,function(_0x3682b9){if(_0x3682b9[_0x3bb1('0x27')]!==_0x3bb1('0x38')){var _0x350046={};_0x350046[_0x3682b9[_0x3bb1('0x2b')]]={'$like':'%'+_0x811819[_0x3bb1('0x2c')][_0x3bb1('0x35')]+'%'};return _0x350046;}})});}_0x4b2e04=_['merge']({},_0x4b2e04,_0x811819['options']);var _0x5cfae1={'where':_0x4b2e04[_0x3bb1('0x36')]};return db[_0x3bb1('0x25')][_0x3bb1('0x39')](_0x5cfae1)[_0x3bb1('0x22')](function(_0x3e838c){_0x52c702['count']=_0x3e838c;if(_0x811819[_0x3bb1('0x2c')][_0x3bb1('0x3a')]){_0x4b2e04['include']=[{'all':!![]}];}return db['OpenchannelApplication'][_0x3bb1('0x3b')](_0x4b2e04);})[_0x3bb1('0x22')](function(_0x5ed344){_0x52c702[_0x3bb1('0x3c')]=_0x5ed344;return _0x52c702;})[_0x3bb1('0x22')](respondWithFilteredResult(_0x3f5107,_0x4b2e04))[_0x3bb1('0x3d')](handleError(_0x3f5107,null));};exports[_0x3bb1('0x3e')]=function(_0x531753,_0x2ccdeb){var _0x4210f6={'raw':!![],'where':{'id':_0x531753['params']['id']}},_0x20aea8={};_0x20aea8[_0x3bb1('0x29')]=_[_0x3bb1('0x3f')](db[_0x3bb1('0x25')][_0x3bb1('0x40')]);_0x20aea8['query']=_['keys'](_0x531753[_0x3bb1('0x2c')]);_0x20aea8['filters']=_['intersection'](_0x20aea8[_0x3bb1('0x29')],_0x20aea8[_0x3bb1('0x2c')]);_0x4210f6['attributes']=_[_0x3bb1('0x2e')](_0x20aea8[_0x3bb1('0x29')],qs['fields'](_0x531753[_0x3bb1('0x2c')][_0x3bb1('0x30')]));_0x4210f6[_0x3bb1('0x2f')]=_0x4210f6[_0x3bb1('0x2f')]['length']?_0x4210f6['attributes']:_0x20aea8['model'];if(_0x531753[_0x3bb1('0x2c')][_0x3bb1('0x3a')]){_0x4210f6[_0x3bb1('0x41')]=[{'all':!![]}];}_0x4210f6=_['merge']({},_0x4210f6,_0x531753[_0x3bb1('0x42')]);return db[_0x3bb1('0x25')][_0x3bb1('0x43')](_0x4210f6)[_0x3bb1('0x22')](handleEntityNotFound(_0x2ccdeb,null))[_0x3bb1('0x22')](respondWithResult(_0x2ccdeb,null))['catch'](handleError(_0x2ccdeb,null));};exports['create']=function(_0xb39f45,_0x5abf0a){return db['OpenchannelApplication'][_0x3bb1('0x44')](_0xb39f45['body'],{})[_0x3bb1('0x22')](respondWithResult(_0x5abf0a,0xc9))[_0x3bb1('0x3d')](handleError(_0x5abf0a,null));};exports['update']=function(_0x2ab9f1,_0x3f4df2){if(_0x2ab9f1[_0x3bb1('0x45')]['id']){delete _0x2ab9f1['body']['id'];}return db['OpenchannelApplication'][_0x3bb1('0x43')]({'where':{'id':_0x2ab9f1['params']['id']}})['then'](handleEntityNotFound(_0x3f4df2,null))[_0x3bb1('0x22')](saveUpdates(_0x2ab9f1[_0x3bb1('0x45')],null))['then'](respondWithResult(_0x3f4df2,null))[_0x3bb1('0x3d')](handleError(_0x3f4df2,null));};exports[_0x3bb1('0x46')]=function(_0x34ce29,_0x155ec1){return db[_0x3bb1('0x25')][_0x3bb1('0x43')]({'where':{'id':_0x34ce29[_0x3bb1('0x47')]['id']}})[_0x3bb1('0x22')](handleEntityNotFound(_0x155ec1,null))[_0x3bb1('0x22')](removeEntity(_0x155ec1,null))[_0x3bb1('0x3d')](handleError(_0x155ec1,null));}; \ No newline at end of file +var _0x3fe7=['length','hasOwnProperty','where','pick','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','rawAttributes','keys','include','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','map','OpenchannelApplication','fieldName','type','model','query','filters','intersection','fields','attributes'];(function(_0xcd796a,_0x1e1285){var _0x471bc3=function(_0x43ce42){while(--_0x43ce42){_0xcd796a['push'](_0xcd796a['shift']());}};_0x471bc3(++_0x1e1285);}(_0x3fe7,0x170));var _0x73fe=function(_0x24b245,_0x1b3508){_0x24b245=_0x24b245-0x0;var _0x56f828=_0x3fe7[_0x24b245];return _0x56f828;};'use strict';var emlformat=require(_0x73fe('0x0'));var rimraf=require(_0x73fe('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x73fe('0x2'));var rp=require(_0x73fe('0x3'));var moment=require(_0x73fe('0x4'));var BPromise=require(_0x73fe('0x5'));var Mustache=require(_0x73fe('0x6'));var util=require('util');var path=require(_0x73fe('0x7'));var sox=require(_0x73fe('0x8'));var csv=require('to-csv');var ejs=require(_0x73fe('0x9'));var fs=require('fs');var fs_extra=require(_0x73fe('0xa'));var _=require(_0x73fe('0xb'));var squel=require(_0x73fe('0xc'));var crypto=require('crypto');var jsforce=require(_0x73fe('0xd'));var deskjs=require(_0x73fe('0xe'));var toCsv=require(_0x73fe('0xf'));var querystring=require('querystring');var Papa=require(_0x73fe('0x10'));var Redis=require('ioredis');var authService=require(_0x73fe('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x73fe('0x12'));var hardwareService=require(_0x73fe('0x13'));var logger=require('../../config/logger')(_0x73fe('0x14'));var utils=require(_0x73fe('0x15'));var config=require(_0x73fe('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x430577,_0x1ed50b){_0x1ed50b=_0x1ed50b||0xcc;return function(_0xf2fae6){if(_0xf2fae6){return _0x430577['sendStatus'](_0x1ed50b);}return _0x430577[_0x73fe('0x17')](_0x1ed50b)[_0x73fe('0x18')]();};}function respondWithResult(_0x1bf57f,_0x27c301){_0x27c301=_0x27c301||0xc8;return function(_0x1e947c){if(_0x1e947c){return _0x1bf57f[_0x73fe('0x17')](_0x27c301)[_0x73fe('0x19')](_0x1e947c);}};}function respondWithFilteredResult(_0x433b4c,_0x1f7107){return function(_0x4f423d){if(_0x4f423d){var _0x1d310b=typeof _0x1f7107[_0x73fe('0x1a')]==='undefined'&&typeof _0x1f7107[_0x73fe('0x1b')]===_0x73fe('0x1c');var _0x3153bb=_0x4f423d[_0x73fe('0x1d')];var _0x297c66=_0x1d310b?0x0:_0x1f7107['offset'];var _0x22fcf7=_0x1d310b?_0x4f423d[_0x73fe('0x1d')]:_0x1f7107['offset']+_0x1f7107[_0x73fe('0x1b')];var _0x4ae97a;if(_0x22fcf7>=_0x3153bb){_0x22fcf7=_0x3153bb;_0x4ae97a=0xc8;}else{_0x4ae97a=0xce;}_0x433b4c[_0x73fe('0x17')](_0x4ae97a);return _0x433b4c[_0x73fe('0x1e')](_0x73fe('0x1f'),_0x297c66+'-'+_0x22fcf7+'/'+_0x3153bb)['json'](_0x4f423d);}return null;};}function patchUpdates(_0x9e9b4d){return function(_0x302801){try{jsonpatch[_0x73fe('0x20')](_0x302801,_0x9e9b4d,!![]);}catch(_0x1e87fe){return BPromise[_0x73fe('0x21')](_0x1e87fe);}return _0x302801[_0x73fe('0x22')]();};}function saveUpdates(_0x3e4517,_0x5a9a45){return function(_0x1c4b26){if(_0x1c4b26){return _0x1c4b26[_0x73fe('0x23')](_0x3e4517)[_0x73fe('0x24')](function(_0x3e8f47){return _0x3e8f47;});}return null;};}function removeEntity(_0x1b3731,_0x5d17f1){return function(_0x44d9b4){if(_0x44d9b4){return _0x44d9b4[_0x73fe('0x25')]()[_0x73fe('0x24')](function(){_0x1b3731[_0x73fe('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x66e97a,_0x361c8c){return function(_0x5b80c5){if(!_0x5b80c5){_0x66e97a[_0x73fe('0x26')](0x194);}return _0x5b80c5;};}function handleError(_0x2a8b70,_0x403504){_0x403504=_0x403504||0x1f4;return function(_0x3e09c9){logger['error'](_0x3e09c9[_0x73fe('0x27')]);if(_0x3e09c9[_0x73fe('0x28')]){delete _0x3e09c9['name'];}_0x2a8b70[_0x73fe('0x17')](_0x403504)[_0x73fe('0x29')](_0x3e09c9);};}exports['index']=function(_0x19b618,_0x1adea1){var _0x550acc={},_0x4a6611={},_0x2ecc8f={'count':0x0,'rows':[]};var _0x3c28a5=_[_0x73fe('0x2a')](db[_0x73fe('0x2b')]['rawAttributes'],function(_0x2cbace){return{'name':_0x2cbace[_0x73fe('0x2c')],'type':_0x2cbace[_0x73fe('0x2d')]['key']};});_0x4a6611[_0x73fe('0x2e')]=_[_0x73fe('0x2a')](_0x3c28a5,_0x73fe('0x28'));_0x4a6611[_0x73fe('0x2f')]=_['keys'](_0x19b618['query']);_0x4a6611[_0x73fe('0x30')]=_[_0x73fe('0x31')](_0x4a6611[_0x73fe('0x2e')],_0x4a6611[_0x73fe('0x2f')]);_0x550acc['attributes']=_[_0x73fe('0x31')](_0x4a6611[_0x73fe('0x2e')],qs[_0x73fe('0x32')](_0x19b618[_0x73fe('0x2f')]['fields']));_0x550acc[_0x73fe('0x33')]=_0x550acc[_0x73fe('0x33')][_0x73fe('0x34')]?_0x550acc[_0x73fe('0x33')]:_0x4a6611[_0x73fe('0x2e')];if(!_0x19b618[_0x73fe('0x2f')][_0x73fe('0x35')]('nolimit')){_0x550acc['limit']=qs[_0x73fe('0x1b')](_0x19b618[_0x73fe('0x2f')][_0x73fe('0x1b')]);_0x550acc[_0x73fe('0x1a')]=qs[_0x73fe('0x1a')](_0x19b618[_0x73fe('0x2f')][_0x73fe('0x1a')]);}_0x550acc['order']=qs['sort'](_0x19b618[_0x73fe('0x2f')]['sort']);_0x550acc[_0x73fe('0x36')]=qs['filters'](_[_0x73fe('0x37')](_0x19b618[_0x73fe('0x2f')],_0x4a6611[_0x73fe('0x30')]),_0x3c28a5);if(_0x19b618[_0x73fe('0x2f')]['filter']){_0x550acc['where']=_[_0x73fe('0x38')](_0x550acc['where'],{'$or':_['map'](_0x3c28a5,function(_0xe4558){if(_0xe4558['type']!==_0x73fe('0x39')){var _0x50114d={};_0x50114d[_0xe4558['name']]={'$like':'%'+_0x19b618[_0x73fe('0x2f')]['filter']+'%'};return _0x50114d;}})});}_0x550acc=_[_0x73fe('0x38')]({},_0x550acc,_0x19b618[_0x73fe('0x3a')]);var _0x3cc345={'where':_0x550acc[_0x73fe('0x36')]};return db['OpenchannelApplication'][_0x73fe('0x1d')](_0x3cc345)['then'](function(_0x235d1a){_0x2ecc8f[_0x73fe('0x1d')]=_0x235d1a;if(_0x19b618[_0x73fe('0x2f')][_0x73fe('0x3b')]){_0x550acc['include']=[{'all':!![]}];}return db[_0x73fe('0x2b')][_0x73fe('0x3c')](_0x550acc);})[_0x73fe('0x24')](function(_0x552dbb){_0x2ecc8f['rows']=_0x552dbb;return _0x2ecc8f;})['then'](respondWithFilteredResult(_0x1adea1,_0x550acc))[_0x73fe('0x3d')](handleError(_0x1adea1,null));};exports[_0x73fe('0x3e')]=function(_0xca9d7,_0x2c182d){var _0x130d30={'raw':!![],'where':{'id':_0xca9d7[_0x73fe('0x3f')]['id']}},_0x4c99b6={};_0x4c99b6[_0x73fe('0x2e')]=_['keys'](db[_0x73fe('0x2b')][_0x73fe('0x40')]);_0x4c99b6[_0x73fe('0x2f')]=_[_0x73fe('0x41')](_0xca9d7[_0x73fe('0x2f')]);_0x4c99b6[_0x73fe('0x30')]=_[_0x73fe('0x31')](_0x4c99b6[_0x73fe('0x2e')],_0x4c99b6['query']);_0x130d30['attributes']=_['intersection'](_0x4c99b6['model'],qs['fields'](_0xca9d7[_0x73fe('0x2f')]['fields']));_0x130d30[_0x73fe('0x33')]=_0x130d30[_0x73fe('0x33')]['length']?_0x130d30[_0x73fe('0x33')]:_0x4c99b6[_0x73fe('0x2e')];if(_0xca9d7[_0x73fe('0x2f')]['includeAll']){_0x130d30[_0x73fe('0x42')]=[{'all':!![]}];}_0x130d30=_[_0x73fe('0x38')]({},_0x130d30,_0xca9d7[_0x73fe('0x3a')]);return db[_0x73fe('0x2b')][_0x73fe('0x43')](_0x130d30)[_0x73fe('0x24')](handleEntityNotFound(_0x2c182d,null))[_0x73fe('0x24')](respondWithResult(_0x2c182d,null))[_0x73fe('0x3d')](handleError(_0x2c182d,null));};exports[_0x73fe('0x44')]=function(_0x157a75,_0x1fb122){return db[_0x73fe('0x2b')]['create'](_0x157a75[_0x73fe('0x45')],{})[_0x73fe('0x24')](respondWithResult(_0x1fb122,0xc9))[_0x73fe('0x3d')](handleError(_0x1fb122,null));};exports[_0x73fe('0x23')]=function(_0x2f7eec,_0x3d7e44){if(_0x2f7eec[_0x73fe('0x45')]['id']){delete _0x2f7eec[_0x73fe('0x45')]['id'];}return db[_0x73fe('0x2b')][_0x73fe('0x43')]({'where':{'id':_0x2f7eec[_0x73fe('0x3f')]['id']}})[_0x73fe('0x24')](handleEntityNotFound(_0x3d7e44,null))['then'](saveUpdates(_0x2f7eec[_0x73fe('0x45')],null))[_0x73fe('0x24')](respondWithResult(_0x3d7e44,null))[_0x73fe('0x3d')](handleError(_0x3d7e44,null));};exports[_0x73fe('0x25')]=function(_0x10adbd,_0x327473){return db[_0x73fe('0x2b')][_0x73fe('0x43')]({'where':{'id':_0x10adbd[_0x73fe('0x3f')]['id']}})['then'](handleEntityNotFound(_0x327473,null))[_0x73fe('0x24')](removeEntity(_0x327473,null))[_0x73fe('0x3d')](handleError(_0x327473,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 60a919c..cd9d4ad 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 _0x3a7f=['utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','define','OpenchannelApplication','openchannel_applications'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x3a7f,0x181));var _0xf3a7=function(_0x1cc740,_0x2a6bc){_0x1cc740=_0x1cc740-0x0;var _0x103b21=_0x3a7f[_0x1cc740];return _0x103b21;};'use strict';var _=require('lodash');var util=require(_0xf3a7('0x0'));var logger=require(_0xf3a7('0x1'))(_0xf3a7('0x2'));var moment=require(_0xf3a7('0x3'));var BPromise=require(_0xf3a7('0x4'));var rp=require(_0xf3a7('0x5'));var fs=require('fs');var path=require(_0xf3a7('0x6'));var rimraf=require(_0xf3a7('0x7'));var config=require('../../config/environment');var attributes=require('./openchannelApplication.attributes');module['exports']=function(_0x5ec78e,_0x1b791b){return _0x5ec78e[_0xf3a7('0x8')](_0xf3a7('0x9'),attributes,{'tableName':_0xf3a7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf3a7('0xb')});}; \ No newline at end of file +var _0x2a02=['utf8mb4','utf8mb4_unicode_ci','lodash','util','api','path','rimraf','./openchannelApplication.attributes','exports','OpenchannelApplication'];(function(_0x2d33d5,_0x373405){var _0x2bb1ed=function(_0x4c1101){while(--_0x4c1101){_0x2d33d5['push'](_0x2d33d5['shift']());}};_0x2bb1ed(++_0x373405);}(_0x2a02,0xfc));var _0x22a0=function(_0x4492af,_0x47e25d){_0x4492af=_0x4492af-0x0;var _0x216729=_0x2a02[_0x4492af];return _0x216729;};'use strict';var _=require(_0x22a0('0x0'));var util=require(_0x22a0('0x1'));var logger=require('../../config/logger')(_0x22a0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x22a0('0x3'));var rimraf=require(_0x22a0('0x4'));var config=require('../../config/environment');var attributes=require(_0x22a0('0x5'));module[_0x22a0('0x6')]=function(_0x17e5db,_0x2d78b9){return _0x17e5db['define'](_0x22a0('0x7'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x22a0('0x8'),'collate':_0x22a0('0x9')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 85de568..096d9f2 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 _0xeead=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','options','where','attributes','lodash','moment','bluebird','../../mysqldb'];(function(_0x48c2ac,_0x444cb0){var _0x2f3648=function(_0x44c071){while(--_0x44c071){_0x48c2ac['push'](_0x48c2ac['shift']());}};_0x2f3648(++_0x444cb0);}(_0xeead,0x125));var _0xdeea=function(_0x3fc035,_0x78f4cc){_0x3fc035=_0x3fc035-0x0;var _0x2d1dd8=_0xeead[_0x3fc035];return _0x2d1dd8;};'use strict';var _=require(_0xdeea('0x0'));var util=require('util');var moment=require(_0xdeea('0x1'));var BPromise=require(_0xdeea('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdeea('0x3'))['db'];var utils=require(_0xdeea('0x4'));var logger=require(_0xdeea('0x5'))(_0xdeea('0x6'));var config=require('../../config/environment');var jayson=require(_0xdeea('0x7'));var client=jayson[_0xdeea('0x8')][_0xdeea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x16b857,_0x55c5dd,_0x34a027){return new BPromise(function(_0x276f5f,_0x472507){return client['request'](_0x16b857,_0x34a027)[_0xdeea('0xa')](function(_0x319a45){logger[_0xdeea('0xb')](_0xdeea('0xc'),_0x55c5dd,_0xdeea('0xd'));logger[_0xdeea('0xe')](_0xdeea('0xf'),_0x55c5dd,_0xdeea('0xd'),JSON[_0xdeea('0x10')](_0x319a45));if(_0x319a45['error']){if(_0x319a45[_0xdeea('0x11')]['code']===0x1f4){logger['error'](_0xdeea('0xc'),_0x55c5dd,_0x319a45[_0xdeea('0x11')][_0xdeea('0x12')]);return _0x472507(_0x319a45[_0xdeea('0x11')]['message']);}logger[_0xdeea('0x11')](_0xdeea('0xc'),_0x55c5dd,_0x319a45['error'][_0xdeea('0x12')]);return _0x276f5f(_0x319a45['error'][_0xdeea('0x12')]);}else{logger[_0xdeea('0xb')](_0xdeea('0xc'),_0x55c5dd,_0xdeea('0xd'));_0x276f5f(_0x319a45[_0xdeea('0x13')][_0xdeea('0x12')]);}})[_0xdeea('0x14')](function(_0xf0a945){logger[_0xdeea('0x11')](_0xdeea('0xc'),_0x55c5dd,_0xf0a945);_0x472507(_0xf0a945);});});}exports[_0xdeea('0x15')]=function(_0x3bbd67){var _0x3be747=this;return new Promise(function(_0x403c5d,_0x3a3452){return db[_0xdeea('0x16')][_0xdeea('0x17')](_0x3bbd67['body'],{'raw':_0x3bbd67[_0xdeea('0x18')]?_0x3bbd67[_0xdeea('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3bbd67[_0xdeea('0x18')]?_0x3bbd67['options'][_0xdeea('0x19')]||null:null,'attributes':_0x3bbd67[_0xdeea('0x18')]?_0x3bbd67[_0xdeea('0x18')][_0xdeea('0x1a')]||null:null,'limit':_0x3bbd67['options']?_0x3bbd67[_0xdeea('0x18')]['limit']||null:null})[_0xdeea('0xa')](function(_0x52dbad){logger[_0xdeea('0xb')](_0xdeea('0x15'),_0x3bbd67);logger[_0xdeea('0xe')](_0xdeea('0x15'),_0x3bbd67,JSON[_0xdeea('0x10')](_0x52dbad));_0x403c5d(_0x52dbad);})[_0xdeea('0x14')](function(_0x3f1464){logger['error'](_0xdeea('0x15'),_0x3f1464[_0xdeea('0x12')],_0x3bbd67);_0x3a3452(_0x3be747[_0xdeea('0x11')](0x1f4,_0x3f1464[_0xdeea('0x12')]));});});}; \ No newline at end of file +var _0x57f2=['catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','attributes'];(function(_0x37019d,_0x8dbe21){var _0x38caa8=function(_0x129cef){while(--_0x129cef){_0x37019d['push'](_0x37019d['shift']());}};_0x38caa8(++_0x8dbe21);}(_0x57f2,0xbb));var _0x257f=function(_0x43b747,_0x9b047e){_0x43b747=_0x43b747-0x0;var _0x409315=_0x57f2[_0x43b747];return _0x409315;};'use strict';var _=require(_0x257f('0x0'));var util=require(_0x257f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x257f('0x2'));var fs=require('fs');var Redis=require(_0x257f('0x3'));var db=require(_0x257f('0x4'))['db'];var utils=require(_0x257f('0x5'));var logger=require(_0x257f('0x6'))(_0x257f('0x7'));var config=require('../../config/environment');var jayson=require(_0x257f('0x8'));var client=jayson[_0x257f('0x9')][_0x257f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x525bd5,_0x133aa4,_0x1f112e){return new BPromise(function(_0xbd8f77,_0x904baf){return client[_0x257f('0xb')](_0x525bd5,_0x1f112e)[_0x257f('0xc')](function(_0x43dd45){logger[_0x257f('0xd')](_0x257f('0xe'),_0x133aa4,_0x257f('0xf'));logger[_0x257f('0x10')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x133aa4,_0x257f('0xf'),JSON[_0x257f('0x11')](_0x43dd45));if(_0x43dd45[_0x257f('0x12')]){if(_0x43dd45[_0x257f('0x12')][_0x257f('0x13')]===0x1f4){logger[_0x257f('0x12')](_0x257f('0xe'),_0x133aa4,_0x43dd45[_0x257f('0x12')][_0x257f('0x14')]);return _0x904baf(_0x43dd45['error'][_0x257f('0x14')]);}logger['error'](_0x257f('0xe'),_0x133aa4,_0x43dd45['error'][_0x257f('0x14')]);return _0xbd8f77(_0x43dd45[_0x257f('0x12')][_0x257f('0x14')]);}else{logger[_0x257f('0xd')](_0x257f('0xe'),_0x133aa4,_0x257f('0xf'));_0xbd8f77(_0x43dd45[_0x257f('0x15')][_0x257f('0x14')]);}})['catch'](function(_0x250404){logger['error'](_0x257f('0xe'),_0x133aa4,_0x250404);_0x904baf(_0x250404);});});}exports[_0x257f('0x16')]=function(_0x4786ce){var _0x46da31=this;return new Promise(function(_0x5541ec,_0x224a1e){return db[_0x257f('0x17')][_0x257f('0x18')](_0x4786ce[_0x257f('0x19')],{'raw':_0x4786ce[_0x257f('0x1a')]?_0x4786ce['options'][_0x257f('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4786ce[_0x257f('0x1a')]?_0x4786ce[_0x257f('0x1a')][_0x257f('0x1c')]||null:null,'attributes':_0x4786ce[_0x257f('0x1a')]?_0x4786ce['options'][_0x257f('0x1d')]||null:null,'limit':_0x4786ce[_0x257f('0x1a')]?_0x4786ce[_0x257f('0x1a')]['limit']||null:null})[_0x257f('0xc')](function(_0xaf1274){logger[_0x257f('0xd')](_0x257f('0x16'),_0x4786ce);logger['debug'](_0x257f('0x16'),_0x4786ce,JSON[_0x257f('0x11')](_0xaf1274));_0x5541ec(_0xaf1274);})[_0x257f('0x1e')](function(_0x5f1e3f){logger['error'](_0x257f('0x16'),_0x5f1e3f[_0x257f('0x14')],_0x4786ce);_0x224a1e(_0x46da31[_0x257f('0x12')](0x1f4,_0x5f1e3f[_0x257f('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 76ab9c8..3ba8555 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 _0x845d=['create','addMessage','/:id/tags','tracked','openchannel','put','openchannelinteraction:update','update','openchannelinteraction:destroy','destroy','delete','removeTags','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x845d,0xc7));var _0xd845=function(_0x36d80d,_0x3183be){_0x36d80d=_0x36d80d-0x0;var _0x4b96ed=_0x845d[_0x36d80d];return _0x4b96ed;};'use strict';var multer=require(_0xd845('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd845('0x1'));var express=require(_0xd845('0x2'));var router=express['Router']();var fs_extra=require(_0xd845('0x3'));var auth=require(_0xd845('0x4'));var interaction=require(_0xd845('0x5'));var config=require('../../config/environment');var controller=require('./openchannelInteraction.controller');router[_0xd845('0x6')]('/',auth[_0xd845('0x7')](),controller[_0xd845('0x8')]);router[_0xd845('0x6')](_0xd845('0x9'),auth['isAuthenticated'](),controller[_0xd845('0xa')]);router[_0xd845('0x6')](_0xd845('0xb'),auth[_0xd845('0x7')](),controller[_0xd845('0xc')]);router[_0xd845('0x6')](_0xd845('0xd'),auth['isAuthenticated'](),controller[_0xd845('0xe')]);router['get'](_0xd845('0xf'),auth[_0xd845('0x7')](),controller[_0xd845('0x10')]);router[_0xd845('0x11')]('/',auth[_0xd845('0x7')](),controller[_0xd845('0x12')]);router['post'](_0xd845('0xd'),auth[_0xd845('0x7')](),controller[_0xd845('0x13')]);router['post'](_0xd845('0x14'),auth[_0xd845('0x7')](),interaction[_0xd845('0x15')](_0xd845('0x16'),'openchannelinteraction:addtags'),controller['addTags']);router[_0xd845('0x17')]('/:id',auth[_0xd845('0x7')](),interaction[_0xd845('0x15')](_0xd845('0x16'),_0xd845('0x18')),controller[_0xd845('0x19')]);router['delete'](_0xd845('0xb'),auth[_0xd845('0x7')](),interaction[_0xd845('0x15')](_0xd845('0x16'),_0xd845('0x1a')),controller[_0xd845('0x1b')]);router[_0xd845('0x1c')](_0xd845('0x14'),auth[_0xd845('0x7')](),controller[_0xd845('0x1d')]);module[_0xd845('0x1e')]=router; \ No newline at end of file +var _0x25be=['/:id/download','download','post','create','addMessage','/:id/tags','openchannel','addTags','put','tracked','openchannelinteraction:update','update','delete','removeTags','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/messages','getMessages'];(function(_0x4a45b4,_0x59804f){var _0x1a99c9=function(_0x3aa517){while(--_0x3aa517){_0x4a45b4['push'](_0x4a45b4['shift']());}};_0x1a99c9(++_0x59804f);}(_0x25be,0x14f));var _0xe25b=function(_0x774b54,_0x3b07b7){_0x774b54=_0x774b54-0x0;var _0x59f247=_0x25be[_0x774b54];return _0x59f247;};'use strict';var multer=require(_0xe25b('0x0'));var util=require(_0xe25b('0x1'));var path=require(_0xe25b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe25b('0x3')]();var fs_extra=require(_0xe25b('0x4'));var auth=require(_0xe25b('0x5'));var interaction=require(_0xe25b('0x6'));var config=require(_0xe25b('0x7'));var controller=require(_0xe25b('0x8'));router[_0xe25b('0x9')]('/',auth['isAuthenticated'](),controller[_0xe25b('0xa')]);router[_0xe25b('0x9')](_0xe25b('0xb'),auth[_0xe25b('0xc')](),controller[_0xe25b('0xd')]);router[_0xe25b('0x9')](_0xe25b('0xe'),auth[_0xe25b('0xc')](),controller['show']);router[_0xe25b('0x9')](_0xe25b('0xf'),auth['isAuthenticated'](),controller[_0xe25b('0x10')]);router['get'](_0xe25b('0x11'),auth['isAuthenticated'](),controller[_0xe25b('0x12')]);router[_0xe25b('0x13')]('/',auth[_0xe25b('0xc')](),controller[_0xe25b('0x14')]);router[_0xe25b('0x13')](_0xe25b('0xf'),auth[_0xe25b('0xc')](),controller[_0xe25b('0x15')]);router[_0xe25b('0x13')](_0xe25b('0x16'),auth['isAuthenticated'](),interaction['tracked'](_0xe25b('0x17'),'openchannelinteraction:addtags'),controller[_0xe25b('0x18')]);router[_0xe25b('0x19')]('/:id',auth[_0xe25b('0xc')](),interaction[_0xe25b('0x1a')](_0xe25b('0x17'),_0xe25b('0x1b')),controller[_0xe25b('0x1c')]);router[_0xe25b('0x1d')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0xe25b('0x17'),'openchannelinteraction:destroy'),controller['destroy']);router['delete'](_0xe25b('0x16'),auth['isAuthenticated'](),controller[_0xe25b('0x1e')]);module[_0xe25b('0x1f')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 0949dcf..f135f34 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 _0xcbde=['BOOLEAN','DATE','STRING','ENUM','out','INTEGER','sequelize'];(function(_0x355a4f,_0x34994c){var _0x2d235a=function(_0x2d2b75){while(--_0x2d2b75){_0x355a4f['push'](_0x355a4f['shift']());}};_0x2d235a(++_0x34994c);}(_0xcbde,0x141));var _0xecbd=function(_0x594992,_0x427a78){_0x594992=_0x594992-0x0;var _0x246b93=_0xcbde[_0x594992];return _0x246b93;};'use strict';var Sequelize=require(_0xecbd('0x0'));module['exports']={'closed':{'type':Sequelize[_0xecbd('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xecbd('0x2')]},'disposition':{'type':Sequelize[_0xecbd('0x3')]},'secondDisposition':{'type':Sequelize[_0xecbd('0x3')]},'thirdDisposition':{'type':Sequelize[_0xecbd('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0xecbd('0x3')]},'externalUrl':{'type':Sequelize[_0xecbd('0x3')]},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xecbd('0x4')]('in',_0xecbd('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xecbd('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0xecbd('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xecbd('0x6')]}}; \ No newline at end of file +var _0xed7a=['STRING','out','ENUM','sequelize','exports','DATE'];(function(_0x1e2aae,_0x2349e3){var _0x4d8a43=function(_0x305d4c){while(--_0x305d4c){_0x1e2aae['push'](_0x1e2aae['shift']());}};_0x4d8a43(++_0x2349e3);}(_0xed7a,0x9f));var _0xaed7=function(_0x4a2c86,_0x1f6555){_0x4a2c86=_0x4a2c86-0x0;var _0x22a157=_0xed7a[_0x4a2c86];return _0x22a157;};'use strict';var Sequelize=require(_0xaed7('0x0'));module[_0xaed7('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xaed7('0x2')]},'disposition':{'type':Sequelize[_0xaed7('0x3')]},'secondDisposition':{'type':Sequelize[_0xaed7('0x3')]},'thirdDisposition':{'type':Sequelize[_0xaed7('0x3')]},'note':{'type':Sequelize[_0xaed7('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0xaed7('0x3')]},'externalUrl':{'type':Sequelize[_0xaed7('0x3')]},'lastMsgAt':{'type':Sequelize[_0xaed7('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xaed7('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xaed7('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xaed7('0x3')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 7b4e11a..c9d951d 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 _0x0162=['set','Content-Range','json','update','destroy','then','sendStatus','stack','name','send','OpenchannelInteraction','rawAttributes','type','key','getOptions','findAll','openchannel','catch','show','query','from','params','model','keys','intersection','attributes','fields','length','include','merge','options','find','create','body','describe','addMessage','ids','omit','findOne','OpenchannelMessage','filters','hasOwnProperty','nolimit','order','sort','where','pick','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','spread','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','User','push','CmContact','Contact','firstName','lastName','Attachment','Messages','direction','read','Owner','fullname','get','Openchannel','Account','N.A.','createdAt','closedAt','disposition','threadId','Private','map','basename','existsSync','createReadStream','createWriteStream','out','System','secret','renderFile','downloadInteraction.ejs','transcript-','.pdf','error','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','zip-dir','moment','util','ejs','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','status','end','undefined','limit','count','offset'];(function(_0x4584e2,_0x4c9dfe){var _0x526b80=function(_0x3c3424){while(--_0x3c3424){_0x4584e2['push'](_0x4584e2['shift']());}};_0x526b80(++_0x4c9dfe);}(_0x0162,0x68));var _0x2016=function(_0x21e8d5,_0x4dc503){_0x21e8d5=_0x21e8d5-0x0;var _0x48c160=_0x0162[_0x21e8d5];return _0x48c160;};'use strict';var rimraf=require(_0x2016('0x0'));var zipdir=require(_0x2016('0x1'));var moment=require(_0x2016('0x2'));var util=require(_0x2016('0x3'));var path=require('path');var ejs=require(_0x2016('0x4'));var fs=require('fs');var _=require(_0x2016('0x5'));var Redis=require(_0x2016('0x6'));var interaction=require('../../components/interaction/service');var qs=require(_0x2016('0x7'));var pdf=require(_0x2016('0x8'));var logger=require(_0x2016('0x9'))(_0x2016('0xa'));var config=require(_0x2016('0xb'));var db=require('../../mysqldb')['db'];config[_0x2016('0xc')]=_[_0x2016('0xd')](config[_0x2016('0xc')],{'host':_0x2016('0xe'),'port':0x18eb});var socket=require(_0x2016('0xf'))(new Redis(config[_0x2016('0xc')]));require(_0x2016('0x10'))['register'](socket);function respondWithStatusCode(_0x5331eb,_0x40006b){_0x40006b=_0x40006b||0xcc;return function(_0x3f7303){if(_0x3f7303){return _0x5331eb['sendStatus'](_0x40006b);}return _0x5331eb[_0x2016('0x11')](_0x40006b)[_0x2016('0x12')]();};}function respondWithResult(_0x16a644,_0x191151){_0x191151=_0x191151||0xc8;return function(_0xa30fce){if(_0xa30fce){return _0x16a644[_0x2016('0x11')](_0x191151)['json'](_0xa30fce);}};}function respondWithFilteredResult(_0x2018d0,_0x4c431b){return function(_0x28e34e){if(_0x28e34e){var _0x1b61ce=typeof _0x4c431b['offset']===_0x2016('0x13')&&typeof _0x4c431b[_0x2016('0x14')]===_0x2016('0x13');var _0x211cbb=_0x28e34e[_0x2016('0x15')];var _0x405346=_0x1b61ce?0x0:_0x4c431b[_0x2016('0x16')];var _0x438e19=_0x1b61ce?_0x28e34e[_0x2016('0x15')]:_0x4c431b['offset']+_0x4c431b['limit'];var _0x55d640;if(_0x438e19>=_0x211cbb){_0x438e19=_0x211cbb;_0x55d640=0xc8;}else{_0x55d640=0xce;}_0x2018d0[_0x2016('0x11')](_0x55d640);return _0x2018d0[_0x2016('0x17')](_0x2016('0x18'),_0x405346+'-'+_0x438e19+'/'+_0x211cbb)[_0x2016('0x19')](_0x28e34e);}return null;};}function saveUpdates(_0x4133b2){return function(_0x1b7bdf){if(_0x1b7bdf){return _0x1b7bdf[_0x2016('0x1a')](_0x4133b2)['then'](function(_0x1388a9){return _0x1388a9;});}return null;};}function removeEntity(_0x13f6a6){return function(_0x35cb2c){if(_0x35cb2c){return _0x35cb2c[_0x2016('0x1b')]()[_0x2016('0x1c')](function(){_0x13f6a6[_0x2016('0x11')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2de6ff){return function(_0x1217ec){if(!_0x1217ec){_0x2de6ff[_0x2016('0x1d')](0x194);}return _0x1217ec;};}function handleError(_0xe44d9f,_0x8d8b44){_0x8d8b44=_0x8d8b44||0x1f4;return function(_0x5ec98f){logger['error'](_0x5ec98f[_0x2016('0x1e')]);if(_0x5ec98f[_0x2016('0x1f')]){delete _0x5ec98f['name'];}_0xe44d9f[_0x2016('0x11')](_0x8d8b44)[_0x2016('0x20')](_0x5ec98f);};}exports['index']=function(_0x3da2ba,_0x2a0e30){var _0x412daf={};var _0x2b7b63=_['map'](db[_0x2016('0x21')][_0x2016('0x22')],function(_0x24f79e){return{'name':_0x24f79e['fieldName'],'type':_0x24f79e[_0x2016('0x23')][_0x2016('0x24')]};});_0x412daf=qs[_0x2016('0x25')](_0x2b7b63,_0x3da2ba);return interaction[_0x2016('0x26')](_0x2016('0x27'),_0x3da2ba['query'],_0x3da2ba['user'],_0x412daf,_0x2b7b63)[_0x2016('0x1c')](respondWithFilteredResult(_0x2a0e30,_0x412daf))[_0x2016('0x28')](handleError(_0x2a0e30,null));};exports[_0x2016('0x29')]=function(_0x76acc0,_0x569db8){var _0x2b3441={};if(_0x76acc0[_0x2016('0x2a')][_0x2016('0x23')]&&_0x76acc0['query'][_0x2016('0x23')]===_0x2016('0x2b')){_0x2b3441[_0x2016('0x2b')]=_0x76acc0[_0x2016('0x2c')]['id'];}else{_0x2b3441['id']=_0x76acc0[_0x2016('0x2c')]['id'];}var _0x3d6ea9={'raw':![],'where':_0x2b3441},_0xf63098={};_0xf63098[_0x2016('0x2d')]=_[_0x2016('0x2e')](db[_0x2016('0x21')][_0x2016('0x22')]);_0xf63098[_0x2016('0x2a')]=_[_0x2016('0x2e')](_0x76acc0[_0x2016('0x2a')]);_0xf63098['filters']=_[_0x2016('0x2f')](_0xf63098[_0x2016('0x2d')],_0xf63098[_0x2016('0x2a')]);_0x3d6ea9[_0x2016('0x30')]=_[_0x2016('0x2f')](_0xf63098['model'],qs[_0x2016('0x31')](_0x76acc0[_0x2016('0x2a')]['fields']));_0x3d6ea9[_0x2016('0x30')]=_0x3d6ea9[_0x2016('0x30')][_0x2016('0x32')]?_0x3d6ea9[_0x2016('0x30')]:_0xf63098['model'];if(_0x76acc0[_0x2016('0x2a')]['includeAll']){_0x3d6ea9[_0x2016('0x33')]=[{'all':!![]}];}_0x3d6ea9=_[_0x2016('0x34')]({},_0x3d6ea9,_0x76acc0[_0x2016('0x35')]);return db[_0x2016('0x21')][_0x2016('0x36')](_0x3d6ea9)[_0x2016('0x1c')](handleEntityNotFound(_0x569db8,null))[_0x2016('0x1c')](respondWithResult(_0x569db8,null))['catch'](handleError(_0x569db8,null));};exports[_0x2016('0x37')]=function(_0xa564c5,_0x4902cc){return db['OpenchannelInteraction'][_0x2016('0x37')](_0xa564c5[_0x2016('0x38')],{})[_0x2016('0x1c')](respondWithResult(_0x4902cc,0xc9))[_0x2016('0x28')](handleError(_0x4902cc,null));};exports['update']=function(_0x389174,_0x33b513){if(_0x389174[_0x2016('0x38')]['id']){delete _0x389174[_0x2016('0x38')]['id'];}return db[_0x2016('0x21')][_0x2016('0x36')]({'where':{'id':_0x389174['params']['id']}})['then'](handleEntityNotFound(_0x33b513,null))[_0x2016('0x1c')](saveUpdates(_0x389174[_0x2016('0x38')],null))['then'](respondWithResult(_0x33b513,null))[_0x2016('0x28')](handleError(_0x33b513,null));};exports['destroy']=function(_0x2d3474,_0x2d1ed3){return db['OpenchannelInteraction'][_0x2016('0x36')]({'where':{'id':_0x2d3474[_0x2016('0x2c')]['id']}})[_0x2016('0x1c')](handleEntityNotFound(_0x2d1ed3,null))[_0x2016('0x1c')](removeEntity(_0x2d1ed3,null))[_0x2016('0x28')](handleError(_0x2d1ed3,null));};exports[_0x2016('0x39')]=function(_0x3c01fe,_0x91fc9){return db['OpenchannelInteraction'][_0x2016('0x39')]()[_0x2016('0x1c')](respondWithResult(_0x91fc9,null))[_0x2016('0x28')](handleError(_0x91fc9,null));};exports[_0x2016('0x3a')]=function(_0x32d891,_0x34cd7a){return db['OpenchannelMessage'][_0x2016('0x36')]({'where':{'id':_0x32d891[_0x2016('0x2c')]['id']}})['then'](handleEntityNotFound(_0x34cd7a,null))[_0x2016('0x1c')](function(_0x12c2b6){if(_0x12c2b6){return _0x12c2b6[_0x2016('0x3a')](_0x32d891[_0x2016('0x38')][_0x2016('0x3b')],_[_0x2016('0x3c')](_0x32d891[_0x2016('0x38')],['ids','id'])||{});}})[_0x2016('0x1c')](respondWithResult(_0x34cd7a,null))['catch'](handleError(_0x34cd7a,null));};exports['getMessages']=function(_0x528b61,_0x13a2bb){var _0xea60af={'raw':![],'where':{}};var _0x6ca53f={};var _0x5c1ee6={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0x2016('0x3d')]({'where':{'id':_0x528b61[_0x2016('0x2c')]['id']}})['then'](handleEntityNotFound(_0x13a2bb,null))['then'](function(_0x2fc7d7){if(_0x2fc7d7){_0x6ca53f['model']=_[_0x2016('0x2e')](db[_0x2016('0x3e')][_0x2016('0x22')]);_0x6ca53f[_0x2016('0x2a')]=_['keys'](_0x528b61['query']);_0x6ca53f[_0x2016('0x3f')]=_['intersection'](_0x6ca53f[_0x2016('0x2d')],_0x6ca53f[_0x2016('0x2a')]);_0xea60af[_0x2016('0x30')]=_[_0x2016('0x2f')](_0x6ca53f[_0x2016('0x2d')],qs[_0x2016('0x31')](_0x528b61[_0x2016('0x2a')][_0x2016('0x31')]));_0xea60af[_0x2016('0x30')]=_0xea60af[_0x2016('0x30')][_0x2016('0x32')]?_0xea60af[_0x2016('0x30')]:_0x6ca53f[_0x2016('0x2d')];if(!_0x528b61['query'][_0x2016('0x40')](_0x2016('0x41'))){_0xea60af['limit']=qs['limit'](_0x528b61[_0x2016('0x2a')][_0x2016('0x14')]);_0xea60af[_0x2016('0x16')]=qs[_0x2016('0x16')](_0x528b61['query']['offset']);}_0xea60af[_0x2016('0x42')]=qs[_0x2016('0x43')](_0x528b61[_0x2016('0x2a')][_0x2016('0x43')]);_0xea60af[_0x2016('0x44')]=qs[_0x2016('0x3f')](_[_0x2016('0x45')](_0x528b61[_0x2016('0x2a')],_0x6ca53f[_0x2016('0x3f')]));_0xea60af['where']['OpenchannelInteractionId']=_0x2fc7d7['id'];if(_0x528b61[_0x2016('0x2a')][_0x2016('0x46')]){_0xea60af[_0x2016('0x44')]=_[_0x2016('0x34')](_0xea60af[_0x2016('0x44')],{'$or':_['map'](_0xea60af[_0x2016('0x30')],function(_0x3ff964){var _0x37f1d0={};_0x37f1d0[_0x3ff964]={'$like':'%'+_0x528b61['query'][_0x2016('0x46')]+'%'};return _0x37f1d0;})});}if(_0x528b61[_0x2016('0x2a')]['$gte']){var _0x3d1f3d=_0x528b61['query'][_0x2016('0x47')]['split'](',');var _0x5cbbad={};_0x5cbbad[_0x3d1f3d[0x0]]={'$gte':moment(_0x3d1f3d[0x1])[_0x2016('0x48')](_0x2016('0x49'))};_0xea60af[_0x2016('0x44')]=_[_0x2016('0x34')](_0xea60af[_0x2016('0x44')],_0x5cbbad);}_0xea60af=_[_0x2016('0x34')]({},_0xea60af,_0x528b61[_0x2016('0x35')]);return db[_0x2016('0x3e')][_0x2016('0x15')]({'where':_0xea60af[_0x2016('0x44')]})[_0x2016('0x1c')](function(_0x4922bf){_0x5c1ee6[_0x2016('0x15')]=_0x4922bf;if(_0x528b61[_0x2016('0x2a')]['includeAll']){_0xea60af[_0x2016('0x33')]=[{'all':!![]}];}return db[_0x2016('0x3e')][_0x2016('0x26')](_0xea60af);})[_0x2016('0x1c')](function(_0x42fc28){_0x5c1ee6[_0x2016('0x4a')]=_0x42fc28;return _0x5c1ee6;});}})[_0x2016('0x1c')](respondWithFilteredResult(_0x13a2bb,_0xea60af))[_0x2016('0x28')](handleError(_0x13a2bb,null));};exports[_0x2016('0x4b')]=function(_0x5c9267,_0x46a543){return db[_0x2016('0x21')][_0x2016('0x36')]({'where':{'id':_0x5c9267[_0x2016('0x2c')]['id']}})[_0x2016('0x1c')](handleEntityNotFound(_0x46a543,null))['then'](function(_0x3f9fca){if(_0x3f9fca){return _0x3f9fca[_0x2016('0x4c')](_0x5c9267[_0x2016('0x38')]['ids'],_[_0x2016('0x3c')](_0x5c9267[_0x2016('0x38')],['ids','id'])||{})[_0x2016('0x4d')](function(){return db['Tag'][_0x2016('0x26')]({'attributes':['id',_0x2016('0x1f'),'color'],'where':{'id':_0x5c9267[_0x2016('0x38')]['ids']}});})[_0x2016('0x1c')](function(_0x29d918){socket[_0x2016('0x4e')](_0x2016('0x4f'),{'id':Number(_0x5c9267[_0x2016('0x2c')]['id']),'tags':_0x29d918||[]});return{'id':Number(_0x5c9267[_0x2016('0x2c')]['id']),'tags':_0x29d918||[]};});}})['then'](respondWithResult(_0x46a543,null))[_0x2016('0x28')](handleError(_0x46a543,null));};exports[_0x2016('0x50')]=function(_0x3194c7,_0x58e33c){return db[_0x2016('0x21')]['find']({'where':{'id':_0x3194c7['params']['id']}})[_0x2016('0x1c')](handleEntityNotFound(_0x58e33c,null))[_0x2016('0x1c')](function(_0x194549){if(_0x194549){return _0x194549['removeTags'](_0x3194c7[_0x2016('0x2a')][_0x2016('0x3b')]);}})[_0x2016('0x1c')](respondWithStatusCode(_0x58e33c,null))['catch'](handleError(_0x58e33c,null));};exports[_0x2016('0x51')]=function(_0x314d03,_0x1a30c6){var _0x4c6b0f=moment()[_0x2016('0x52')]()[_0x2016('0x53')]();var _0x1adcdd=path[_0x2016('0x54')](config[_0x2016('0x55')],_0x2016('0x56'),_0x2016('0x57'),_0x2016('0x58'));var _0x56a226=path[_0x2016('0x54')](config[_0x2016('0x55')],_0x2016('0x56'),'files',_0x2016('0x59'));var _0x5d76c8=path[_0x2016('0x54')](_0x1adcdd,_0x4c6b0f);var _0x29d412=util[_0x2016('0x48')](_0x2016('0x5a'),_0x314d03[_0x2016('0x2c')]['id'],_0x4c6b0f);var _0x588675=path[_0x2016('0x54')](_0x1adcdd,_0x29d412);var _0xef684c=[];_0xef684c['push']({'model':db[_0x2016('0x5b')],'as':_0x2016('0x5b'),'attributes':['id','fullname'],'raw':!![]});_0xef684c[_0x2016('0x5c')]({'model':db[_0x2016('0x5d')],'as':_0x2016('0x5e'),'attributes':['id',_0x2016('0x5f'),_0x2016('0x60')],'raw':!![]});if(_0x314d03[_0x2016('0x2a')][_0x2016('0x59')]){_0xef684c[_0x2016('0x5c')]({'model':db['Attachment'],'as':_0x2016('0x61'),'raw':!![]});}var _0x2e99f1=[{'model':db[_0x2016('0x3e')],'as':_0x2016('0x62'),'attributes':['id',_0x2016('0x38'),'createdAt',_0x2016('0x63'),'secret',_0x2016('0x64')],'include':_0xef684c}];_0x2e99f1[_0x2016('0x5c')]({'model':db['OpenchannelAccount'],'as':'Account','attributes':['id',_0x2016('0x1f')]});_0x2e99f1[_0x2016('0x5c')]({'model':db['User'],'as':_0x2016('0x65'),'attributes':['id',_0x2016('0x66')]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x314d03[_0x2016('0x2c')]['id']},'include':_0x2e99f1})[_0x2016('0x1c')](handleEntityNotFound(_0x1a30c6,null))[_0x2016('0x1c')](function(_0x51f68e){if(_0x51f68e){var _0x2ca7e0=_0x51f68e[_0x2016('0x67')]({'plain':!![]});fs['mkdirSync'](_0x5d76c8);var _0x1ce6b0={'channel':_0x2016('0x68'),'account':_0x2ca7e0[_0x2016('0x69')][_0x2016('0x1f')],'agent':_0x2ca7e0['Owner']?_0x2ca7e0[_0x2016('0x65')][_0x2016('0x66')]:_0x2016('0x6a'),'createdAt':moment(_0x2ca7e0[_0x2016('0x6b')])[_0x2016('0x48')](_0x2016('0x49'))[_0x2016('0x53')](),'closedAt':_0x2ca7e0['closed']?moment(_0x2ca7e0[_0x2016('0x6c')])['format'](_0x2016('0x49'))[_0x2016('0x53')]():'','disposition':_0x2ca7e0[_0x2016('0x6d')],'visibility':_0x2ca7e0[_0x2016('0x6e')]?'Public':_0x2016('0x6f'),'messages':_(_0x2ca7e0[_0x2016('0x62')])['filter']({'secret':![]})[_0x2016('0x70')](function(_0x58e6a0){if(_0x58e6a0[_0x2016('0x61')]){var _0x2dade6=path[_0x2016('0x54')](_0x56a226,_0x58e6a0[_0x2016('0x61')][_0x2016('0x71')]);if(fs[_0x2016('0x72')](_0x2dade6)){fs[_0x2016('0x73')](_0x2dade6)['pipe'](fs[_0x2016('0x74')](path[_0x2016('0x54')](_0x5d76c8,_0x58e6a0['Attachment'][_0x2016('0x71')])));}}return{'date':moment(_0x58e6a0[_0x2016('0x6b')])[_0x2016('0x48')]('YYYY-MM-DD\x20HH:mm:ss')[_0x2016('0x53')](),'sender':_0x58e6a0[_0x2016('0x63')]===_0x2016('0x75')?_0x58e6a0[_0x2016('0x5b')]?_0x58e6a0[_0x2016('0x5b')][_0x2016('0x66')]:_0x2016('0x76'):_0x58e6a0[_0x2016('0x5e')]['firstName']+(_0x58e6a0['Contact'][_0x2016('0x60')]?'\x20'+_0x58e6a0['Contact']['lastName']:''),'body':_0x58e6a0[_0x2016('0x61')]?_0x58e6a0[_0x2016('0x61')]['basename']:_0x58e6a0[_0x2016('0x38')],'direction':_0x58e6a0['direction']===_0x2016('0x75')?'A':'C','secret':_0x58e6a0[_0x2016('0x77')],'read':_0x58e6a0['read'],'attachment':_0x58e6a0[_0x2016('0x61')]};})['value']()};return ejs[_0x2016('0x78')](path['join'](config[_0x2016('0x55')],_0x2016('0x56'),'views',_0x2016('0x79')),{'interaction':_0x1ce6b0})[_0x2016('0x1c')](function(_0x1e358c){var _0x56fd8e=path[_0x2016('0x54')](_0x5d76c8,_0x2016('0x7a')+_0x2ca7e0['id']+'-'+_0x4c6b0f+_0x2016('0x7b'));var _0x1401c1={'path':_0x56fd8e,'channel':_0x2016('0x68'),'interactionId':_0x2ca7e0['id']};return pdf['createPdfFromHTML'](_0x1e358c,_0x1401c1);})[_0x2016('0x1c')](function(){return new Promise(function(_0x1edf15,_0x138559){zipdir(_0x5d76c8,{'saveTo':_0x588675},function(_0x1e52a0,_0x4d450c){if(_0x1e52a0)return _0x138559(_0x1e52a0);return _0x1edf15(_0x4d450c);});})[_0x2016('0x1c')](function(){return new Promise(function(_0x490446,_0x14acfa){rimraf(_0x5d76c8,function(_0x2ca8c7){if(_0x2ca8c7)_0x14acfa(_0x2ca8c7);return _0x490446();});});})[_0x2016('0x1c')](function(){return _0x1a30c6['download'](_0x588675,_0x29d412,function(_0x2eae5d){if(_0x2eae5d){logger[_0x2016('0x7c')](_0x2016('0x7d'),_0x2eae5d);}else{fs[_0x2016('0x7e')](_0x588675);}});});});}else{return _0x1a30c6[_0x2016('0x1d')](0xc8);}})[_0x2016('0x28')](handleError(_0x1a30c6,null));}; \ No newline at end of file +var _0x064e=['undefined','limit','count','offset','Content-Range','update','then','destroy','error','stack','name','send','map','OpenchannelInteraction','rawAttributes','type','key','getOptions','findAll','user','show','query','from','params','model','filters','intersection','fields','attributes','includeAll','include','options','find','create','body','catch','describe','addMessage','OpenchannelMessage','ids','omit','findOne','keys','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','spread','Tag','color','removeTags','download','toString','join','root','server','files','attachments','transcript-%d-%s.zip','User','push','CmContact','Contact','firstName','Attachment','Messages','createdAt','OpenchannelAccount','Account','Owner','fullname','get','mkdirSync','Openchannel','N.A.','closed','closedAt','threadId','Private','basename','existsSync','createReadStream','pipe','direction','System','lastName','out','secret','read','value','views','transcript-','.pdf','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','zip-dir','moment','util','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','end','status','json'];(function(_0x3afb54,_0x158348){var _0x13033c=function(_0x7857c5){while(--_0x7857c5){_0x3afb54['push'](_0x3afb54['shift']());}};_0x13033c(++_0x158348);}(_0x064e,0xe8));var _0xe064=function(_0x1d8808,_0x2d5a0a){_0x1d8808=_0x1d8808-0x0;var _0xd03752=_0x064e[_0x1d8808];return _0xd03752;};'use strict';var rimraf=require(_0xe064('0x0'));var zipdir=require(_0xe064('0x1'));var moment=require(_0xe064('0x2'));var util=require(_0xe064('0x3'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0xe064('0x4'));var Redis=require(_0xe064('0x5'));var interaction=require(_0xe064('0x6'));var qs=require(_0xe064('0x7'));var pdf=require('../../components/export/pdf');var logger=require(_0xe064('0x8'))(_0xe064('0x9'));var config=require('../../config/environment');var db=require(_0xe064('0xa'))['db'];config[_0xe064('0xb')]=_['defaults'](config[_0xe064('0xb')],{'host':_0xe064('0xc'),'port':0x18eb});var socket=require(_0xe064('0xd'))(new Redis(config[_0xe064('0xb')]));require(_0xe064('0xe'))[_0xe064('0xf')](socket);function respondWithStatusCode(_0x4b6ef8,_0x28eb0b){_0x28eb0b=_0x28eb0b||0xcc;return function(_0x14cd72){if(_0x14cd72){return _0x4b6ef8[_0xe064('0x10')](_0x28eb0b);}return _0x4b6ef8['status'](_0x28eb0b)[_0xe064('0x11')]();};}function respondWithResult(_0x2db81f,_0x34e0bc){_0x34e0bc=_0x34e0bc||0xc8;return function(_0x52242f){if(_0x52242f){return _0x2db81f[_0xe064('0x12')](_0x34e0bc)[_0xe064('0x13')](_0x52242f);}};}function respondWithFilteredResult(_0x535a8a,_0x3b5899){return function(_0x39db46){if(_0x39db46){var _0x1f1a88=typeof _0x3b5899['offset']===_0xe064('0x14')&&typeof _0x3b5899[_0xe064('0x15')]===_0xe064('0x14');var _0x4d73bf=_0x39db46[_0xe064('0x16')];var _0xc1f4b8=_0x1f1a88?0x0:_0x3b5899[_0xe064('0x17')];var _0x17c417=_0x1f1a88?_0x39db46[_0xe064('0x16')]:_0x3b5899['offset']+_0x3b5899['limit'];var _0x5db882;if(_0x17c417>=_0x4d73bf){_0x17c417=_0x4d73bf;_0x5db882=0xc8;}else{_0x5db882=0xce;}_0x535a8a['status'](_0x5db882);return _0x535a8a['set'](_0xe064('0x18'),_0xc1f4b8+'-'+_0x17c417+'/'+_0x4d73bf)['json'](_0x39db46);}return null;};}function saveUpdates(_0x14fd18){return function(_0x1b7e94){if(_0x1b7e94){return _0x1b7e94[_0xe064('0x19')](_0x14fd18)[_0xe064('0x1a')](function(_0x5e11ab){return _0x5e11ab;});}return null;};}function removeEntity(_0x3f3b84){return function(_0x4c3c47){if(_0x4c3c47){return _0x4c3c47[_0xe064('0x1b')]()[_0xe064('0x1a')](function(){_0x3f3b84['status'](0xcc)[_0xe064('0x11')]();});}};}function handleEntityNotFound(_0x3428ad){return function(_0x48e840){if(!_0x48e840){_0x3428ad['sendStatus'](0x194);}return _0x48e840;};}function handleError(_0x15ee68,_0x46d086){_0x46d086=_0x46d086||0x1f4;return function(_0xa2a7f8){logger[_0xe064('0x1c')](_0xa2a7f8[_0xe064('0x1d')]);if(_0xa2a7f8[_0xe064('0x1e')]){delete _0xa2a7f8[_0xe064('0x1e')];}_0x15ee68['status'](_0x46d086)[_0xe064('0x1f')](_0xa2a7f8);};}exports['index']=function(_0xc69fe7,_0x3780cd){var _0x12c260={};var _0x2280b3=_[_0xe064('0x20')](db[_0xe064('0x21')][_0xe064('0x22')],function(_0x42a479){return{'name':_0x42a479['fieldName'],'type':_0x42a479[_0xe064('0x23')][_0xe064('0x24')]};});_0x12c260=qs[_0xe064('0x25')](_0x2280b3,_0xc69fe7);return interaction[_0xe064('0x26')]('openchannel',_0xc69fe7['query'],_0xc69fe7[_0xe064('0x27')],_0x12c260,_0x2280b3)[_0xe064('0x1a')](respondWithFilteredResult(_0x3780cd,_0x12c260))['catch'](handleError(_0x3780cd,null));};exports[_0xe064('0x28')]=function(_0xc87b75,_0x43c9c2){var _0x5c37d1={};if(_0xc87b75[_0xe064('0x29')][_0xe064('0x23')]&&_0xc87b75[_0xe064('0x29')]['type']===_0xe064('0x2a')){_0x5c37d1[_0xe064('0x2a')]=_0xc87b75[_0xe064('0x2b')]['id'];}else{_0x5c37d1['id']=_0xc87b75[_0xe064('0x2b')]['id'];}var _0x107836={'raw':![],'where':_0x5c37d1},_0x6caa3a={};_0x6caa3a[_0xe064('0x2c')]=_['keys'](db[_0xe064('0x21')][_0xe064('0x22')]);_0x6caa3a[_0xe064('0x29')]=_['keys'](_0xc87b75[_0xe064('0x29')]);_0x6caa3a[_0xe064('0x2d')]=_[_0xe064('0x2e')](_0x6caa3a[_0xe064('0x2c')],_0x6caa3a[_0xe064('0x29')]);_0x107836['attributes']=_[_0xe064('0x2e')](_0x6caa3a[_0xe064('0x2c')],qs[_0xe064('0x2f')](_0xc87b75[_0xe064('0x29')]['fields']));_0x107836['attributes']=_0x107836[_0xe064('0x30')]['length']?_0x107836['attributes']:_0x6caa3a[_0xe064('0x2c')];if(_0xc87b75[_0xe064('0x29')][_0xe064('0x31')]){_0x107836[_0xe064('0x32')]=[{'all':!![]}];}_0x107836=_['merge']({},_0x107836,_0xc87b75[_0xe064('0x33')]);return db['OpenchannelInteraction'][_0xe064('0x34')](_0x107836)['then'](handleEntityNotFound(_0x43c9c2,null))['then'](respondWithResult(_0x43c9c2,null))['catch'](handleError(_0x43c9c2,null));};exports[_0xe064('0x35')]=function(_0x2a579b,_0x3e6f85){return db[_0xe064('0x21')][_0xe064('0x35')](_0x2a579b[_0xe064('0x36')],{})[_0xe064('0x1a')](respondWithResult(_0x3e6f85,0xc9))[_0xe064('0x37')](handleError(_0x3e6f85,null));};exports[_0xe064('0x19')]=function(_0x3870c2,_0x3d8fc3){if(_0x3870c2['body']['id']){delete _0x3870c2[_0xe064('0x36')]['id'];}return db[_0xe064('0x21')][_0xe064('0x34')]({'where':{'id':_0x3870c2['params']['id']}})[_0xe064('0x1a')](handleEntityNotFound(_0x3d8fc3,null))[_0xe064('0x1a')](saveUpdates(_0x3870c2[_0xe064('0x36')],null))[_0xe064('0x1a')](respondWithResult(_0x3d8fc3,null))[_0xe064('0x37')](handleError(_0x3d8fc3,null));};exports[_0xe064('0x1b')]=function(_0x4fdb27,_0x32e831){return db[_0xe064('0x21')]['find']({'where':{'id':_0x4fdb27[_0xe064('0x2b')]['id']}})[_0xe064('0x1a')](handleEntityNotFound(_0x32e831,null))[_0xe064('0x1a')](removeEntity(_0x32e831,null))[_0xe064('0x37')](handleError(_0x32e831,null));};exports[_0xe064('0x38')]=function(_0x501257,_0x538d3c){return db[_0xe064('0x21')][_0xe064('0x38')]()['then'](respondWithResult(_0x538d3c,null))[_0xe064('0x37')](handleError(_0x538d3c,null));};exports[_0xe064('0x39')]=function(_0x53cabd,_0x15c401){return db[_0xe064('0x3a')][_0xe064('0x34')]({'where':{'id':_0x53cabd[_0xe064('0x2b')]['id']}})[_0xe064('0x1a')](handleEntityNotFound(_0x15c401,null))['then'](function(_0x5ce102){if(_0x5ce102){return _0x5ce102['addMessage'](_0x53cabd['body'][_0xe064('0x3b')],_[_0xe064('0x3c')](_0x53cabd[_0xe064('0x36')],[_0xe064('0x3b'),'id'])||{});}})[_0xe064('0x1a')](respondWithResult(_0x15c401,null))[_0xe064('0x37')](handleError(_0x15c401,null));};exports['getMessages']=function(_0x416c20,_0xc3d65c){var _0x33c551={'raw':![],'where':{}};var _0x5cc9ed={};var _0xf1a4fc={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0xe064('0x3d')]({'where':{'id':_0x416c20[_0xe064('0x2b')]['id']}})[_0xe064('0x1a')](handleEntityNotFound(_0xc3d65c,null))[_0xe064('0x1a')](function(_0x2a2997){if(_0x2a2997){_0x5cc9ed[_0xe064('0x2c')]=_[_0xe064('0x3e')](db[_0xe064('0x3a')][_0xe064('0x22')]);_0x5cc9ed[_0xe064('0x29')]=_[_0xe064('0x3e')](_0x416c20['query']);_0x5cc9ed['filters']=_[_0xe064('0x2e')](_0x5cc9ed[_0xe064('0x2c')],_0x5cc9ed[_0xe064('0x29')]);_0x33c551[_0xe064('0x30')]=_[_0xe064('0x2e')](_0x5cc9ed[_0xe064('0x2c')],qs[_0xe064('0x2f')](_0x416c20['query']['fields']));_0x33c551['attributes']=_0x33c551[_0xe064('0x30')][_0xe064('0x3f')]?_0x33c551['attributes']:_0x5cc9ed[_0xe064('0x2c')];if(!_0x416c20[_0xe064('0x29')][_0xe064('0x40')](_0xe064('0x41'))){_0x33c551[_0xe064('0x15')]=qs[_0xe064('0x15')](_0x416c20[_0xe064('0x29')][_0xe064('0x15')]);_0x33c551[_0xe064('0x17')]=qs[_0xe064('0x17')](_0x416c20[_0xe064('0x29')][_0xe064('0x17')]);}_0x33c551[_0xe064('0x42')]=qs['sort'](_0x416c20[_0xe064('0x29')][_0xe064('0x43')]);_0x33c551['where']=qs['filters'](_[_0xe064('0x44')](_0x416c20['query'],_0x5cc9ed[_0xe064('0x2d')]));_0x33c551['where']['OpenchannelInteractionId']=_0x2a2997['id'];if(_0x416c20[_0xe064('0x29')][_0xe064('0x45')]){_0x33c551[_0xe064('0x46')]=_[_0xe064('0x47')](_0x33c551['where'],{'$or':_[_0xe064('0x20')](_0x33c551[_0xe064('0x30')],function(_0x26af45){var _0x1f356a={};_0x1f356a[_0x26af45]={'$like':'%'+_0x416c20['query']['filter']+'%'};return _0x1f356a;})});}if(_0x416c20[_0xe064('0x29')][_0xe064('0x48')]){var _0xb8a87b=_0x416c20[_0xe064('0x29')][_0xe064('0x48')][_0xe064('0x49')](',');var _0x4e74cb={};_0x4e74cb[_0xb8a87b[0x0]]={'$gte':moment(_0xb8a87b[0x1])[_0xe064('0x4a')](_0xe064('0x4b'))};_0x33c551[_0xe064('0x46')]=_['merge'](_0x33c551['where'],_0x4e74cb);}_0x33c551=_[_0xe064('0x47')]({},_0x33c551,_0x416c20[_0xe064('0x33')]);return db['OpenchannelMessage'][_0xe064('0x16')]({'where':_0x33c551[_0xe064('0x46')]})[_0xe064('0x1a')](function(_0x310cab){_0xf1a4fc[_0xe064('0x16')]=_0x310cab;if(_0x416c20[_0xe064('0x29')][_0xe064('0x31')]){_0x33c551['include']=[{'all':!![]}];}return db[_0xe064('0x3a')][_0xe064('0x26')](_0x33c551);})[_0xe064('0x1a')](function(_0x5e6336){_0xf1a4fc[_0xe064('0x4c')]=_0x5e6336;return _0xf1a4fc;});}})['then'](respondWithFilteredResult(_0xc3d65c,_0x33c551))[_0xe064('0x37')](handleError(_0xc3d65c,null));};exports['addTags']=function(_0x1ea739,_0xcddf1){return db[_0xe064('0x21')][_0xe064('0x34')]({'where':{'id':_0x1ea739[_0xe064('0x2b')]['id']}})[_0xe064('0x1a')](handleEntityNotFound(_0xcddf1,null))['then'](function(_0x2d4966){if(_0x2d4966){return _0x2d4966['setTags'](_0x1ea739[_0xe064('0x36')]['ids'],_[_0xe064('0x3c')](_0x1ea739[_0xe064('0x36')],['ids','id'])||{})[_0xe064('0x4d')](function(){return db[_0xe064('0x4e')][_0xe064('0x26')]({'attributes':['id',_0xe064('0x1e'),_0xe064('0x4f')],'where':{'id':_0x1ea739[_0xe064('0x36')][_0xe064('0x3b')]}});})['then'](function(_0x2e588a){socket['emit']('openchannelInteractionTags:save',{'id':Number(_0x1ea739[_0xe064('0x2b')]['id']),'tags':_0x2e588a||[]});return{'id':Number(_0x1ea739[_0xe064('0x2b')]['id']),'tags':_0x2e588a||[]};});}})[_0xe064('0x1a')](respondWithResult(_0xcddf1,null))['catch'](handleError(_0xcddf1,null));};exports[_0xe064('0x50')]=function(_0x1cf891,_0x4c09ed){return db[_0xe064('0x21')][_0xe064('0x34')]({'where':{'id':_0x1cf891['params']['id']}})['then'](handleEntityNotFound(_0x4c09ed,null))['then'](function(_0x2d46fa){if(_0x2d46fa){return _0x2d46fa[_0xe064('0x50')](_0x1cf891[_0xe064('0x29')]['ids']);}})[_0xe064('0x1a')](respondWithStatusCode(_0x4c09ed,null))['catch'](handleError(_0x4c09ed,null));};exports[_0xe064('0x51')]=function(_0x5abf52,_0x349119){var _0x183f06=moment()['unix']()[_0xe064('0x52')]();var _0x554e84=path[_0xe064('0x53')](config[_0xe064('0x54')],_0xe064('0x55'),_0xe064('0x56'),'tmp');var _0x32c892=path[_0xe064('0x53')](config[_0xe064('0x54')],_0xe064('0x55'),'files',_0xe064('0x57'));var _0x2d42f8=path[_0xe064('0x53')](_0x554e84,_0x183f06);var _0x32b8f1=util[_0xe064('0x4a')](_0xe064('0x58'),_0x5abf52['params']['id'],_0x183f06);var _0xfc053=path['join'](_0x554e84,_0x32b8f1);var _0x539f72=[];_0x539f72['push']({'model':db[_0xe064('0x59')],'as':_0xe064('0x59'),'attributes':['id','fullname'],'raw':!![]});_0x539f72[_0xe064('0x5a')]({'model':db[_0xe064('0x5b')],'as':_0xe064('0x5c'),'attributes':['id',_0xe064('0x5d'),'lastName'],'raw':!![]});if(_0x5abf52[_0xe064('0x29')][_0xe064('0x57')]){_0x539f72[_0xe064('0x5a')]({'model':db[_0xe064('0x5e')],'as':_0xe064('0x5e'),'raw':!![]});}var _0x3a9cc1=[{'model':db['OpenchannelMessage'],'as':_0xe064('0x5f'),'attributes':['id','body',_0xe064('0x60'),'direction','secret','read'],'include':_0x539f72}];_0x3a9cc1[_0xe064('0x5a')]({'model':db[_0xe064('0x61')],'as':_0xe064('0x62'),'attributes':['id',_0xe064('0x1e')]});_0x3a9cc1[_0xe064('0x5a')]({'model':db['User'],'as':_0xe064('0x63'),'attributes':['id',_0xe064('0x64')]});return db[_0xe064('0x21')][_0xe064('0x34')]({'where':{'id':_0x5abf52[_0xe064('0x2b')]['id']},'include':_0x3a9cc1})[_0xe064('0x1a')](handleEntityNotFound(_0x349119,null))[_0xe064('0x1a')](function(_0x2dca0b){if(_0x2dca0b){var _0x29cce2=_0x2dca0b[_0xe064('0x65')]({'plain':!![]});fs[_0xe064('0x66')](_0x2d42f8);var _0x5e7490={'channel':_0xe064('0x67'),'account':_0x29cce2['Account'][_0xe064('0x1e')],'agent':_0x29cce2['Owner']?_0x29cce2['Owner'][_0xe064('0x64')]:_0xe064('0x68'),'createdAt':moment(_0x29cce2[_0xe064('0x60')])[_0xe064('0x4a')](_0xe064('0x4b'))[_0xe064('0x52')](),'closedAt':_0x29cce2[_0xe064('0x69')]?moment(_0x29cce2[_0xe064('0x6a')])['format'](_0xe064('0x4b'))['toString']():'','disposition':_0x29cce2['disposition'],'visibility':_0x29cce2[_0xe064('0x6b')]?'Public':_0xe064('0x6c'),'messages':_(_0x29cce2[_0xe064('0x5f')])[_0xe064('0x45')]({'secret':![]})[_0xe064('0x20')](function(_0x242d37){if(_0x242d37[_0xe064('0x5e')]){var _0x13ef2f=path[_0xe064('0x53')](_0x32c892,_0x242d37[_0xe064('0x5e')][_0xe064('0x6d')]);if(fs[_0xe064('0x6e')](_0x13ef2f)){fs[_0xe064('0x6f')](_0x13ef2f)[_0xe064('0x70')](fs['createWriteStream'](path[_0xe064('0x53')](_0x2d42f8,_0x242d37[_0xe064('0x5e')][_0xe064('0x6d')])));}}return{'date':moment(_0x242d37[_0xe064('0x60')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x242d37[_0xe064('0x71')]==='out'?_0x242d37[_0xe064('0x59')]?_0x242d37[_0xe064('0x59')][_0xe064('0x64')]:_0xe064('0x72'):_0x242d37[_0xe064('0x5c')][_0xe064('0x5d')]+(_0x242d37['Contact'][_0xe064('0x73')]?'\x20'+_0x242d37[_0xe064('0x5c')][_0xe064('0x73')]:''),'body':_0x242d37[_0xe064('0x5e')]?_0x242d37[_0xe064('0x5e')][_0xe064('0x6d')]:_0x242d37[_0xe064('0x36')],'direction':_0x242d37[_0xe064('0x71')]===_0xe064('0x74')?'A':'C','secret':_0x242d37[_0xe064('0x75')],'read':_0x242d37[_0xe064('0x76')],'attachment':_0x242d37[_0xe064('0x5e')]};})[_0xe064('0x77')]()};return ejs['renderFile'](path[_0xe064('0x53')](config['root'],'server',_0xe064('0x78'),'downloadInteraction.ejs'),{'interaction':_0x5e7490})[_0xe064('0x1a')](function(_0x87d7af){var _0x5b3f6f=path[_0xe064('0x53')](_0x2d42f8,_0xe064('0x79')+_0x29cce2['id']+'-'+_0x183f06+_0xe064('0x7a'));var _0x37db9e={'path':_0x5b3f6f,'channel':_0xe064('0x67'),'interactionId':_0x29cce2['id']};return pdf[_0xe064('0x7b')](_0x87d7af,_0x37db9e);})[_0xe064('0x1a')](function(){return new Promise(function(_0x20bc09,_0x370c5f){zipdir(_0x2d42f8,{'saveTo':_0xfc053},function(_0xbf5c16,_0x58a77f){if(_0xbf5c16)return _0x370c5f(_0xbf5c16);return _0x20bc09(_0x58a77f);});})['then'](function(){return new Promise(function(_0x556680,_0x1b90ef){rimraf(_0x2d42f8,function(_0x1944ad){if(_0x1944ad)_0x1b90ef(_0x1944ad);return _0x556680();});});})[_0xe064('0x1a')](function(){return _0x349119[_0xe064('0x51')](_0xfc053,_0x32b8f1,function(_0x3e9ad6){if(_0x3e9ad6){logger[_0xe064('0x1c')](_0xe064('0x7c'),_0x3e9ad6);}else{fs[_0xe064('0x7d')](_0xfc053);}});});});}else{return _0x349119[_0xe064('0x10')](0xc8);}})[_0xe064('0x37')](handleError(_0x349119,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 2083b1f..93e986e 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 _0x00a3=['unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','setMaxListeners','save','remove','getUsers','setDataValue','map','findAll'];(function(_0x3c0dcc,_0x18c419){var _0x1a224c=function(_0x238ae7){while(--_0x238ae7){_0x3c0dcc['push'](_0x3c0dcc['shift']());}};_0x1a224c(++_0x18c419);}(_0x00a3,0x15f));var _0x300a=function(_0x36458e,_0x129970){_0x36458e=_0x36458e-0x0;var _0xd759c5=_0x00a3[_0x36458e];return _0xd759c5;};'use strict';var EventEmitter=require(_0x300a('0x0'));var OpenchannelInteraction=require(_0x300a('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x300a('0x1'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x300a('0x2')](0x0);var events={'afterCreate':_0x300a('0x3'),'afterUpdate':'update','afterDestroy':_0x300a('0x4')};function emitEvent(_0x4ca382){return function(_0xd120f,_0x2de492,_0x5ca938){_0xd120f[_0x300a('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4d8250){_0xd120f[_0x300a('0x6')]('Users',_0x4d8250[_0x300a('0x7')](function(_0x3793c1){return{'id':_0x3793c1['id']};}));return OpenchannelMessage[_0x300a('0x8')]({'where':{'OpenchannelInteractionId':_0xd120f['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x19af78){_0xd120f[_0x300a('0x6')](_0x300a('0x9'),_0x19af78[_0x300a('0xa')]);OpenchannelInteractionEvents[_0x300a('0xb')](_0x4ca382+':'+_0xd120f['id'],_0xd120f);OpenchannelInteractionEvents['emit'](_0x4ca382,_0xd120f);_0x5ca938(null);})[_0x300a('0xc')](_0x5ca938(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x300a('0xd')](e,emitEvent(event));}}module[_0x300a('0xe')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0xc283=['unreadMessages','length','emit','hasOwnProperty','hook','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','then','Users','map','findAll'];(function(_0x3f7ef9,_0x3a5362){var _0x236190=function(_0xcad630){while(--_0xcad630){_0x3f7ef9['push'](_0x3f7ef9['shift']());}};_0x236190(++_0x3a5362);}(_0xc283,0x1a9));var _0x3c28=function(_0x5bd011,_0x29f606){_0x5bd011=_0x5bd011-0x0;var _0xd0d44e=_0xc283[_0x5bd011];return _0xd0d44e;};'use strict';var EventEmitter=require(_0x3c28('0x0'));var OpenchannelInteraction=require(_0x3c28('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require('../../mysqldb')['db'][_0x3c28('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x3c28('0x3')](0x0);var events={'afterCreate':_0x3c28('0x4'),'afterUpdate':_0x3c28('0x5'),'afterDestroy':'remove'};function emitEvent(_0xd4e78f){return function(_0x4f943d,_0x44757c,_0x4432e0){_0x4f943d['getUsers']({'attributes':['id'],'raw':!![]})[_0x3c28('0x6')](function(_0x1de1ef){_0x4f943d['setDataValue'](_0x3c28('0x7'),_0x1de1ef[_0x3c28('0x8')](function(_0x48c625){return{'id':_0x48c625['id']};}));return OpenchannelMessage[_0x3c28('0x9')]({'where':{'OpenchannelInteractionId':_0x4f943d['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3c28('0x6')](function(_0x3ecc1f){_0x4f943d['setDataValue'](_0x3c28('0xa'),_0x3ecc1f[_0x3c28('0xb')]);OpenchannelInteractionEvents[_0x3c28('0xc')](_0xd4e78f+':'+_0x4f943d['id'],_0x4f943d);OpenchannelInteractionEvents[_0x3c28('0xc')](_0xd4e78f,_0x4f943d);_0x4432e0(null);})['catch'](_0x4432e0(null));};}for(var e in events){if(events[_0x3c28('0xd')](e)){var event=events[e];OpenchannelInteraction[_0x3c28('0xe')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 0c56307..3a851e8 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 _0x01ef=['exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','format','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelInteraction.attributes'];(function(_0xeb71f6,_0x2eba0e){var _0x37cac4=function(_0x3203c5){while(--_0x3203c5){_0xeb71f6['push'](_0xeb71f6['shift']());}};_0x37cac4(++_0x2eba0e);}(_0x01ef,0x1dd));var _0xf01e=function(_0x115480,_0x2a41b9){_0x115480=_0x115480-0x0;var _0x5d3fbd=_0x01ef[_0x115480];return _0x5d3fbd;};'use strict';var _=require(_0xf01e('0x0'));var util=require('util');var logger=require(_0xf01e('0x1'))(_0xf01e('0x2'));var moment=require(_0xf01e('0x3'));var BPromise=require(_0xf01e('0x4'));var rp=require(_0xf01e('0x5'));var fs=require('fs');var path=require(_0xf01e('0x6'));var rimraf=require('rimraf');var config=require(_0xf01e('0x7'));var attributes=require(_0xf01e('0x8'));module[_0xf01e('0x9')]=function(_0x374762,_0x2a3c36){return _0x374762[_0xf01e('0xa')](_0xf01e('0xb'),attributes,{'tableName':_0xf01e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf01e('0xd'),'collate':_0xf01e('0xe'),'hooks':{'beforeUpdate':function(_0x3969fa,_0x2dd39a,_0x340051){if(_0x3969fa[_0xf01e('0xf')](_0xf01e('0x10'))){_0x3969fa['closedAt']=moment()[_0xf01e('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}_0x340051(null,_0x3969fa);}}});}; \ No newline at end of file +var _0x6876=['util','api','moment','bluebird','request-promise','rimraf','./openchannelInteraction.attributes','exports','utf8mb4','utf8mb4_unicode_ci','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x27fb10,_0x36a980){var _0x1a25a0=function(_0x5cd271){while(--_0x5cd271){_0x27fb10['push'](_0x27fb10['shift']());}};_0x1a25a0(++_0x36a980);}(_0x6876,0x13a));var _0x6687=function(_0x4e46fd,_0x5993bb){_0x4e46fd=_0x4e46fd-0x0;var _0x4dc5cf=_0x6876[_0x4e46fd];return _0x4dc5cf;};'use strict';var _=require(_0x6687('0x0'));var util=require(_0x6687('0x1'));var logger=require('../../config/logger')(_0x6687('0x2'));var moment=require(_0x6687('0x3'));var BPromise=require(_0x6687('0x4'));var rp=require(_0x6687('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6687('0x6'));var config=require('../../config/environment');var attributes=require(_0x6687('0x7'));module[_0x6687('0x8')]=function(_0x518477,_0x43eabd){return _0x518477['define']('OpenchannelInteraction',attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6687('0x9'),'collate':_0x6687('0xa'),'hooks':{'beforeUpdate':function(_0x2b316d,_0x331675,_0x18ef59){if(_0x2b316d[_0x6687('0xb')](_0x6687('0xc'))){_0x2b316d['closedAt']=moment()[_0x6687('0xd')](_0x6687('0xe'));}_0x18ef59(null,_0x2b316d);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 11e7794..4fb0844 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 _0x021b=['options','raw','where','attributes','limit','catch','AddTagsToOpenchannelInteraction','find','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body'];(function(_0x8c6c90,_0x34b62d){var _0x14d235=function(_0x3074c3){while(--_0x3074c3){_0x8c6c90['push'](_0x8c6c90['shift']());}};_0x14d235(++_0x34b62d);}(_0x021b,0x1af));var _0xb021=function(_0x2af692,_0x30438e){_0x2af692=_0x2af692-0x0;var _0x26a3a8=_0x021b[_0x2af692];return _0x26a3a8;};'use strict';var _=require(_0xb021('0x0'));var util=require(_0xb021('0x1'));var moment=require(_0xb021('0x2'));var BPromise=require(_0xb021('0x3'));var rs=require(_0xb021('0x4'));var fs=require('fs');var Redis=require(_0xb021('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb021('0x6'));var logger=require(_0xb021('0x7'))(_0xb021('0x8'));var config=require(_0xb021('0x9'));var jayson=require(_0xb021('0xa'));var client=jayson[_0xb021('0xb')][_0xb021('0xc')]({'port':0x232a});config[_0xb021('0xd')]=_[_0xb021('0xe')](config[_0xb021('0xd')],{'host':_0xb021('0xf'),'port':0x18eb});var socket=require(_0xb021('0x10'))(new Redis(config['redis']));require('./openchannelInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x15cc84,_0x1a2da,_0x486400){return new BPromise(function(_0x35085d,_0x28adb0){return client[_0xb021('0x11')](_0x15cc84,_0x486400)[_0xb021('0x12')](function(_0x59eef3){logger[_0xb021('0x13')](_0xb021('0x14'),_0x1a2da,_0xb021('0x15'));logger[_0xb021('0x16')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x1a2da,_0xb021('0x15'),JSON[_0xb021('0x17')](_0x59eef3));if(_0x59eef3[_0xb021('0x18')]){if(_0x59eef3[_0xb021('0x18')]['code']===0x1f4){logger[_0xb021('0x18')](_0xb021('0x14'),_0x1a2da,_0x59eef3['error'][_0xb021('0x19')]);return _0x28adb0(_0x59eef3['error'][_0xb021('0x19')]);}logger[_0xb021('0x18')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1a2da,_0x59eef3[_0xb021('0x18')]['message']);return _0x35085d(_0x59eef3[_0xb021('0x18')][_0xb021('0x19')]);}else{logger[_0xb021('0x13')](_0xb021('0x14'),_0x1a2da,_0xb021('0x15'));_0x35085d(_0x59eef3[_0xb021('0x1a')]['message']);}})['catch'](function(_0x5516f3){logger['error'](_0xb021('0x14'),_0x1a2da,_0x5516f3);_0x28adb0(_0x5516f3);});});}exports[_0xb021('0x1b')]=function(_0x4e0360){var _0x119080=this;return new Promise(function(_0x28243d,_0x18306b){return db[_0xb021('0x1c')][_0xb021('0x1d')](_0x4e0360[_0xb021('0x1e')],{'raw':_0x4e0360[_0xb021('0x1f')]?_0x4e0360[_0xb021('0x1f')][_0xb021('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e0360[_0xb021('0x1f')]?_0x4e0360['options'][_0xb021('0x21')]||null:null,'attributes':_0x4e0360[_0xb021('0x1f')]?_0x4e0360['options'][_0xb021('0x22')]||null:null,'limit':_0x4e0360[_0xb021('0x1f')]?_0x4e0360['options'][_0xb021('0x23')]||null:null})['then'](function(_0x58300e){logger[_0xb021('0x13')](_0xb021('0x1b'),_0x4e0360);logger[_0xb021('0x16')](_0xb021('0x1b'),_0x4e0360,JSON['stringify'](_0x58300e));_0x28243d(_0x58300e);})[_0xb021('0x24')](function(_0x4a60ce){logger['error']('UpdateOpenchannelInteraction',_0x4a60ce['message'],_0x4e0360);_0x18306b(_0x119080[_0xb021('0x18')](0x1f4,_0x4a60ce['message']));});});};exports[_0xb021('0x25')]=function(_0x2b61c3){return new Promise(function(_0x40507d,_0x24b443){return db[_0xb021('0x1c')][_0xb021('0x26')]({'where':_0x2b61c3['options']?_0x2b61c3[_0xb021('0x1f')][_0xb021('0x21')]||null:null})[_0xb021('0x12')](function(_0x16a919){if(_0x16a919){return _0x16a919['addTags'](_0x2b61c3[_0xb021('0x1e')][_0xb021('0x27')],_[_0xb021('0x28')](_0x2b61c3[_0xb021('0x1e')],[_0xb021('0x27'),'id'])||{});}})['spread'](function(_0x1b8404){logger['info'](_0xb021('0x29'),_0x2b61c3);logger[_0xb021('0x16')](_0xb021('0x29'),_0x2b61c3,JSON[_0xb021('0x17')](_0x1b8404));_0x40507d(_0x1b8404);})[_0xb021('0x24')](function(_0x1d6f63){logger['error'](_0xb021('0x29'),_0x1d6f63[_0xb021('0x19')],_0x2b61c3);_0x24b443(_this[_0xb021('0x18')](0x1f4,_0x1d6f63[_0xb021('0x19')]));});});}; \ No newline at end of file +var _0x10a2=['debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','OpenchannelInteraction','update','options','raw','where','attributes','UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction','find','addTags','body','ids','omit','spread','AddTags','util','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent'];(function(_0x5b7963,_0x10bff5){var _0x57f611=function(_0x28d52e){while(--_0x28d52e){_0x5b7963['push'](_0x5b7963['shift']());}};_0x57f611(++_0x10bff5);}(_0x10a2,0x1d2));var _0x210a=function(_0xf8aca8,_0x4b5ccb){_0xf8aca8=_0xf8aca8-0x0;var _0x426558=_0x10a2[_0xf8aca8];return _0x426558;};'use strict';var _=require('lodash');var util=require(_0x210a('0x0'));var moment=require('moment');var BPromise=require(_0x210a('0x1'));var rs=require(_0x210a('0x2'));var fs=require('fs');var Redis=require(_0x210a('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x210a('0x4'));var jayson=require(_0x210a('0x5'));var client=jayson[_0x210a('0x6')]['http']({'port':0x232a});config[_0x210a('0x7')]=_['defaults'](config[_0x210a('0x7')],{'host':_0x210a('0x8'),'port':0x18eb});var socket=require(_0x210a('0x9'))(new Redis(config[_0x210a('0x7')]));require('./openchannelInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x7520da,_0x1e12c2,_0x26d8e2){return new BPromise(function(_0x5b8a6a,_0x1798f5){return client[_0x210a('0xa')](_0x7520da,_0x26d8e2)[_0x210a('0xb')](function(_0x135ddf){logger[_0x210a('0xc')](_0x210a('0xd'),_0x1e12c2,_0x210a('0xe'));logger[_0x210a('0xf')](_0x210a('0x10'),_0x1e12c2,'request\x20sent',JSON[_0x210a('0x11')](_0x135ddf));if(_0x135ddf[_0x210a('0x12')]){if(_0x135ddf[_0x210a('0x12')][_0x210a('0x13')]===0x1f4){logger[_0x210a('0x12')](_0x210a('0xd'),_0x1e12c2,_0x135ddf[_0x210a('0x12')][_0x210a('0x14')]);return _0x1798f5(_0x135ddf[_0x210a('0x12')][_0x210a('0x14')]);}logger[_0x210a('0x12')](_0x210a('0xd'),_0x1e12c2,_0x135ddf[_0x210a('0x12')][_0x210a('0x14')]);return _0x5b8a6a(_0x135ddf[_0x210a('0x12')]['message']);}else{logger[_0x210a('0xc')](_0x210a('0xd'),_0x1e12c2,_0x210a('0xe'));_0x5b8a6a(_0x135ddf['result']['message']);}})[_0x210a('0x15')](function(_0x609f70){logger[_0x210a('0x12')](_0x210a('0xd'),_0x1e12c2,_0x609f70);_0x1798f5(_0x609f70);});});}exports['UpdateOpenchannelInteraction']=function(_0x35ffed){var _0x5ec4cb=this;return new Promise(function(_0x502fa8,_0x2e944f){return db[_0x210a('0x16')][_0x210a('0x17')](_0x35ffed['body'],{'raw':_0x35ffed[_0x210a('0x18')]?_0x35ffed[_0x210a('0x18')][_0x210a('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35ffed[_0x210a('0x18')]?_0x35ffed[_0x210a('0x18')][_0x210a('0x1a')]||null:null,'attributes':_0x35ffed[_0x210a('0x18')]?_0x35ffed['options'][_0x210a('0x1b')]||null:null,'limit':_0x35ffed[_0x210a('0x18')]?_0x35ffed[_0x210a('0x18')]['limit']||null:null})['then'](function(_0x3377d9){logger[_0x210a('0xc')](_0x210a('0x1c'),_0x35ffed);logger[_0x210a('0xf')](_0x210a('0x1c'),_0x35ffed,JSON[_0x210a('0x11')](_0x3377d9));_0x502fa8(_0x3377d9);})['catch'](function(_0x76b03f){logger[_0x210a('0x12')](_0x210a('0x1c'),_0x76b03f[_0x210a('0x14')],_0x35ffed);_0x2e944f(_0x5ec4cb[_0x210a('0x12')](0x1f4,_0x76b03f[_0x210a('0x14')]));});});};exports[_0x210a('0x1d')]=function(_0x11de52){return new Promise(function(_0x25674f,_0x20bcdc){return db['OpenchannelInteraction'][_0x210a('0x1e')]({'where':_0x11de52[_0x210a('0x18')]?_0x11de52[_0x210a('0x18')][_0x210a('0x1a')]||null:null})[_0x210a('0xb')](function(_0x1f99b4){if(_0x1f99b4){return _0x1f99b4[_0x210a('0x1f')](_0x11de52[_0x210a('0x20')][_0x210a('0x21')],_[_0x210a('0x22')](_0x11de52[_0x210a('0x20')],[_0x210a('0x21'),'id'])||{});}})[_0x210a('0x23')](function(_0x415f26){logger[_0x210a('0xc')](_0x210a('0x24'),_0x11de52);logger['debug']('AddTags',_0x11de52,JSON[_0x210a('0x11')](_0x415f26));_0x25674f(_0x415f26);})['catch'](function(_0x3b078e){logger[_0x210a('0x12')](_0x210a('0x24'),_0x3b078e[_0x210a('0x14')],_0x11de52);_0x20bcdc(_this[_0x210a('0x12')](0x1f4,_0x3b078e[_0x210a('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index ac90c97..0a7659f 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 _0xb593=['update','emit','removeListener','register','length','./openchannelInteraction.events','remove'];(function(_0x484976,_0x450694){var _0x407cd8=function(_0xcefea9){while(--_0xcefea9){_0x484976['push'](_0x484976['shift']());}};_0x407cd8(++_0x450694);}(_0xb593,0x7c));var _0x3b59=function(_0x547587,_0x48cbd9){_0x547587=_0x547587-0x0;var _0x3d7777=_0xb593[_0x547587];return _0x3d7777;};'use strict';var OpenchannelInteractionEvents=require(_0x3b59('0x0'));var events=['save',_0x3b59('0x1'),_0x3b59('0x2')];function createListener(_0x22e1ae,_0x4a0340){return function(_0x20c571){_0x4a0340[_0x3b59('0x3')](_0x22e1ae,_0x20c571);};}function removeListener(_0x50ca3b,_0x490ebd){return function(){OpenchannelInteractionEvents[_0x3b59('0x4')](_0x50ca3b,_0x490ebd);};}exports[_0x3b59('0x5')]=function(_0x50397d){for(var _0x3de5c7=0x0,_0x3b1660=events[_0x3b59('0x6')];_0x3de5c7<_0x3b1660;_0x3de5c7++){var _0x40a934=events[_0x3de5c7];var _0x24117a=createListener('openchannelInteraction:'+_0x40a934,_0x50397d);OpenchannelInteractionEvents['on'](_0x40a934,_0x24117a);}}; \ No newline at end of file +var _0x3b9a=['length','openchannelInteraction:','./openchannelInteraction.events','remove','update','emit','removeListener','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3b9a,0xb2));var _0xa3b9=function(_0x682567,_0x535f6b){_0x682567=_0x682567-0x0;var _0x3fb515=_0x3b9a[_0x682567];return _0x3fb515;};'use strict';var OpenchannelInteractionEvents=require(_0xa3b9('0x0'));var events=['save',_0xa3b9('0x1'),_0xa3b9('0x2')];function createListener(_0x398e7e,_0x470459){return function(_0x169620){_0x470459[_0xa3b9('0x3')](_0x398e7e,_0x169620);};}function removeListener(_0x5eef95,_0x4537eb){return function(){OpenchannelInteractionEvents[_0xa3b9('0x4')](_0x5eef95,_0x4537eb);};}exports[_0xa3b9('0x5')]=function(_0x3ac4b2){for(var _0x1f50b2=0x0,_0x3cbdf4=events[_0xa3b9('0x6')];_0x1f50b2<_0x3cbdf4;_0x1f50b2++){var _0x1df5a6=events[_0x1f50b2];var _0x4f6a8c=createListener(_0xa3b9('0x7')+_0x1df5a6,_0x3ac4b2);OpenchannelInteractionEvents['on'](_0x1df5a6,_0x4f6a8c);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index e771690..8180cc4 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(_0x3a9008,_0x402eea){var _0x2c7e15=function(_0x5bb359){while(--_0x5bb359){_0x3a9008['push'](_0x3a9008['shift']());}};_0x2c7e15(++_0x402eea);}(_0xe706,0xa3));var _0x6e70=function(_0x527c39,_0x3ea2a6){_0x527c39=_0x527c39-0x0;var _0x3f4dd6=_0xe706[_0x527c39];return _0x3f4dd6;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),interaction[_0x6e70('0x12')](_0x6e70('0x13'),_0x6e70('0x14')),controller[_0x6e70('0x15')]);router['put']('/:id',auth[_0x6e70('0xb')](),controller[_0x6e70('0x16')]);router[_0x6e70('0x17')](_0x6e70('0x18'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x19')]);router[_0x6e70('0x17')](_0x6e70('0x1a'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0x6e70('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x6e70('0x1b')]=router; \ No newline at end of file +var _0x9c44=['index','get','/describe','/:id','show','tracked','openchannel','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelMessage.controller','isAuthenticated'];(function(_0x788a54,_0x12450b){var _0x8b73a4=function(_0x3b6271){while(--_0x3b6271){_0x788a54['push'](_0x788a54['shift']());}};_0x8b73a4(++_0x12450b);}(_0x9c44,0x178));var _0x49c4=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x9c44[_0x2064e5];return _0x21a233;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['describe']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x49c4('0xd')](_0x49c4('0xe'),'openchannelmessage:create'),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0x11')]);router[_0x49c4('0x10')]('/:id/accept',auth[_0x49c4('0x7')](),controller[_0x49c4('0x12')]);router['put'](_0x49c4('0x13'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);router[_0x49c4('0x15')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x16')]);module[_0x49c4('0x17')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 87bb602..e4f33ab 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 _0xbbdd=['out','TEXT','exports','medium','BOOLEAN'];(function(_0x52b9c4,_0x1985af){var _0x3a6901=function(_0x4d55d4){while(--_0x4d55d4){_0x52b9c4['push'](_0x52b9c4['shift']());}};_0x3a6901(++_0x1985af);}(_0xbbdd,0x1ba));var _0xdbbd=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xbbdd[_0x346737];return _0x1ade2e;};'use strict';var Sequelize=require('sequelize');module[_0xdbbd('0x0')]={'body':{'type':Sequelize['TEXT'](_0xdbbd('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xdbbd('0x2')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xdbbd('0x3'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xdbbd('0x4')]}}; \ No newline at end of file +var _0x6ae2=['medium','BOOLEAN','ENUM','out','STRING','sequelize','exports','TEXT'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0x6ae2,0x1ed));var _0x26ae=function(_0x1539bb,_0x31701c){_0x1539bb=_0x1539bb-0x0;var _0x32d20d=_0x6ae2[_0x1539bb];return _0x32d20d;};'use strict';var Sequelize=require(_0x26ae('0x0'));module[_0x26ae('0x1')]={'body':{'type':Sequelize[_0x26ae('0x2')](_0x26ae('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x26ae('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x26ae('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x26ae('0x5')]('in',_0x26ae('0x6')),'defaultValue':_0x26ae('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x26ae('0x7')]},'providerResponse':{'type':Sequelize[_0x26ae('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 15e0b78..92adf3e 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 _0x597a=['EventManager','acceptmessage','../../config/logger','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','SELECT','interface','SIP/%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','http','client','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','destroy','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','pick','filter','VIRTUAL','options','OpenchannelMessage','include','findAll','rows','show','params','length','merge','find','create','body','describe','openchannel-interactions','accept','openchannel','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','get','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','interaction','null','AcceptMessage','acceptMessage','sequelize','QueryTypes','contact','User','fullname','email','internal','channel','motionChannel','event'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x597a,0x10e));var _0xa597=function(_0x2b55b5,_0x78505e){_0x2b55b5=_0x2b55b5-0x0;var _0x103d28=_0x597a[_0x2b55b5];return _0x103d28;};'use strict';var emlformat=require(_0xa597('0x0'));var rimraf=require(_0xa597('0x1'));var zipdir=require(_0xa597('0x2'));var jsonpatch=require(_0xa597('0x3'));var rp=require('request-promise');var moment=require(_0xa597('0x4'));var BPromise=require(_0xa597('0x5'));var Mustache=require(_0xa597('0x6'));var util=require('util');var path=require(_0xa597('0x7'));var sox=require(_0xa597('0x8'));var csv=require(_0xa597('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa597('0xa'));var _=require(_0xa597('0xb'));var squel=require('squel');var crypto=require(_0xa597('0xc'));var jsforce=require(_0xa597('0xd'));var deskjs=require(_0xa597('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa597('0xf'));var Papa=require(_0xa597('0x10'));var Redis=require(_0xa597('0x11'));var authService=require(_0xa597('0x12'));var qs=require(_0xa597('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa597('0x14'));var logger=require('../../config/logger')(_0xa597('0x15'));var utils=require('../../config/utils');var config=require(_0xa597('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa597('0x17'))['db'];config[_0xa597('0x18')]=_['defaults'](config[_0xa597('0x18')],{'host':_0xa597('0x19'),'port':0x18eb});var socket=require(_0xa597('0x1a'))(new Redis(config[_0xa597('0x18')]));require('./openchannelMessage.socket')[_0xa597('0x1b')](socket);var jayson=require(_0xa597('0x1c'));var client=jayson['client'][_0xa597('0x1d')]({'port':0x232c});var client9002=jayson[_0xa597('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34e167,_0x1cdef2,_0x1d2631,_0x5e958d){return new BPromise(function(_0x4a2514,_0xf54b6f){var _0x43e25f=_0x5e958d||client;return _0x43e25f[_0xa597('0x1f')](_0x34e167,_0x1d2631)[_0xa597('0x20')](function(_0x84811f){logger[_0xa597('0x21')](_0xa597('0x22'),_0x1cdef2,_0xa597('0x23'));logger['debug'](_0xa597('0x24'),_0x1cdef2,_0xa597('0x23'),JSON[_0xa597('0x25')](_0x84811f));if(_0x84811f[_0xa597('0x26')]){if(_0x84811f[_0xa597('0x26')]['code']===0x1f4){logger[_0xa597('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0x1cdef2,_0x84811f[_0xa597('0x26')][_0xa597('0x27')]);return _0xf54b6f(_0x84811f[_0xa597('0x26')][_0xa597('0x27')]);}logger[_0xa597('0x26')](_0xa597('0x22'),_0x1cdef2,_0x84811f[_0xa597('0x26')][_0xa597('0x27')]);return _0x4a2514(_0x84811f[_0xa597('0x26')][_0xa597('0x27')]);}else{logger[_0xa597('0x21')]('OpenchannelMessage,\x20%s,\x20%s',_0x1cdef2,_0xa597('0x23'));_0x4a2514(_0x84811f[_0xa597('0x28')][_0xa597('0x27')]);}})[_0xa597('0x29')](function(_0x3c5971){logger[_0xa597('0x26')](_0xa597('0x22'),_0x1cdef2,_0x3c5971);_0xf54b6f(_0x3c5971);});});}function respondWithStatusCode(_0x38d06c,_0x423a95){_0x423a95=_0x423a95||0xcc;return function(_0x481418){if(_0x481418){return _0x38d06c[_0xa597('0x2a')](_0x423a95);}return _0x38d06c[_0xa597('0x2b')](_0x423a95)[_0xa597('0x2c')]();};}function respondWithResult(_0x3d68a4,_0x27560d){_0x27560d=_0x27560d||0xc8;return function(_0xfaed4e){if(_0xfaed4e){return _0x3d68a4[_0xa597('0x2b')](_0x27560d)[_0xa597('0x2d')](_0xfaed4e);}};}function respondWithFilteredResult(_0xfd6429,_0x1a7a55){return function(_0x3a8903){if(_0x3a8903){var _0x28c54d=typeof _0x1a7a55[_0xa597('0x2e')]===_0xa597('0x2f')&&typeof _0x1a7a55['limit']===_0xa597('0x2f');var _0x5e6693=_0x3a8903['count'];var _0xd13805=_0x28c54d?0x0:_0x1a7a55['offset'];var _0x2b3c08=_0x28c54d?_0x3a8903[_0xa597('0x30')]:_0x1a7a55[_0xa597('0x2e')]+_0x1a7a55['limit'];var _0x5f1d6c;if(_0x2b3c08>=_0x5e6693){_0x2b3c08=_0x5e6693;_0x5f1d6c=0xc8;}else{_0x5f1d6c=0xce;}_0xfd6429[_0xa597('0x2b')](_0x5f1d6c);return _0xfd6429[_0xa597('0x31')](_0xa597('0x32'),_0xd13805+'-'+_0x2b3c08+'/'+_0x5e6693)[_0xa597('0x2d')](_0x3a8903);}return null;};}function patchUpdates(_0x388023){return function(_0x2d95f6){try{jsonpatch[_0xa597('0x33')](_0x2d95f6,_0x388023,!![]);}catch(_0x4c5f69){return BPromise[_0xa597('0x34')](_0x4c5f69);}return _0x2d95f6['save']();};}function saveUpdates(_0x14de91,_0x264475){return function(_0x4035d4){if(_0x4035d4){return _0x4035d4[_0xa597('0x35')](_0x14de91)['then'](function(_0x87c933){return _0x87c933;});}return null;};}function removeEntity(_0x5d7c38,_0x4e0c6c){return function(_0xb30fb0){if(_0xb30fb0){return _0xb30fb0[_0xa597('0x36')]()[_0xa597('0x20')](function(){_0x5d7c38[_0xa597('0x2b')](0xcc)[_0xa597('0x2c')]();});}};}function handleEntityNotFound(_0x1e4a0d,_0x3d512e){return function(_0x1ee4f7){if(!_0x1ee4f7){_0x1e4a0d['sendStatus'](0x194);}return _0x1ee4f7;};}function handleError(_0x10a97d,_0x4bad7d){_0x4bad7d=_0x4bad7d||0x1f4;return function(_0x48df8f){logger[_0xa597('0x26')](_0x48df8f[_0xa597('0x37')]);if(_0x48df8f[_0xa597('0x38')]){delete _0x48df8f[_0xa597('0x38')];}_0x10a97d[_0xa597('0x2b')](_0x4bad7d)[_0xa597('0x39')](_0x48df8f);};}exports[_0xa597('0x3a')]=function(_0x4f628b,_0xc73386){var _0x3e63db={},_0x2c2052={},_0x163b7b={'count':0x0,'rows':[]};var _0x594000=_[_0xa597('0x3b')](db['OpenchannelMessage'][_0xa597('0x3c')],function(_0x27b9d1){return{'name':_0x27b9d1['fieldName'],'type':_0x27b9d1[_0xa597('0x3d')][_0xa597('0x3e')]};});_0x2c2052[_0xa597('0x3f')]=_['map'](_0x594000,_0xa597('0x38'));_0x2c2052[_0xa597('0x40')]=_[_0xa597('0x41')](_0x4f628b[_0xa597('0x40')]);_0x2c2052[_0xa597('0x42')]=_[_0xa597('0x43')](_0x2c2052['model'],_0x2c2052[_0xa597('0x40')]);_0x3e63db[_0xa597('0x44')]=_['intersection'](_0x2c2052[_0xa597('0x3f')],qs[_0xa597('0x45')](_0x4f628b[_0xa597('0x40')][_0xa597('0x45')]));_0x3e63db[_0xa597('0x44')]=_0x3e63db[_0xa597('0x44')]['length']?_0x3e63db['attributes']:_0x2c2052['model'];if(!_0x4f628b['query'][_0xa597('0x46')](_0xa597('0x47'))){_0x3e63db[_0xa597('0x48')]=qs[_0xa597('0x48')](_0x4f628b[_0xa597('0x40')][_0xa597('0x48')]);_0x3e63db[_0xa597('0x2e')]=qs[_0xa597('0x2e')](_0x4f628b[_0xa597('0x40')][_0xa597('0x2e')]);}_0x3e63db['order']=qs[_0xa597('0x49')](_0x4f628b['query']['sort']);_0x3e63db[_0xa597('0x4a')]=qs['filters'](_[_0xa597('0x4b')](_0x4f628b[_0xa597('0x40')],_0x2c2052[_0xa597('0x42')]),_0x594000);if(_0x4f628b[_0xa597('0x40')][_0xa597('0x4c')]){_0x3e63db[_0xa597('0x4a')]=_['merge'](_0x3e63db[_0xa597('0x4a')],{'$or':_['map'](_0x594000,function(_0x300f40){if(_0x300f40[_0xa597('0x3d')]!==_0xa597('0x4d')){var _0x48df69={};_0x48df69[_0x300f40[_0xa597('0x38')]]={'$like':'%'+_0x4f628b[_0xa597('0x40')][_0xa597('0x4c')]+'%'};return _0x48df69;}})});}_0x3e63db=_['merge']({},_0x3e63db,_0x4f628b[_0xa597('0x4e')]);var _0x2081b2={'where':_0x3e63db[_0xa597('0x4a')]};return db[_0xa597('0x4f')][_0xa597('0x30')](_0x2081b2)[_0xa597('0x20')](function(_0x39889b){_0x163b7b[_0xa597('0x30')]=_0x39889b;if(_0x4f628b[_0xa597('0x40')]['includeAll']){_0x3e63db[_0xa597('0x50')]=[{'all':!![]}];}return db[_0xa597('0x4f')][_0xa597('0x51')](_0x3e63db);})[_0xa597('0x20')](function(_0x1050fe){_0x163b7b[_0xa597('0x52')]=_0x1050fe;return _0x163b7b;})[_0xa597('0x20')](respondWithFilteredResult(_0xc73386,_0x3e63db))[_0xa597('0x29')](handleError(_0xc73386,null));};exports[_0xa597('0x53')]=function(_0x3070fd,_0x1e339a){var _0x1acbc6={'raw':!![],'where':{'id':_0x3070fd[_0xa597('0x54')]['id']}},_0x557576={};_0x557576['model']=_['keys'](db[_0xa597('0x4f')]['rawAttributes']);_0x557576[_0xa597('0x40')]=_[_0xa597('0x41')](_0x3070fd[_0xa597('0x40')]);_0x557576[_0xa597('0x42')]=_[_0xa597('0x43')](_0x557576[_0xa597('0x3f')],_0x557576['query']);_0x1acbc6[_0xa597('0x44')]=_[_0xa597('0x43')](_0x557576[_0xa597('0x3f')],qs['fields'](_0x3070fd[_0xa597('0x40')][_0xa597('0x45')]));_0x1acbc6[_0xa597('0x44')]=_0x1acbc6['attributes'][_0xa597('0x55')]?_0x1acbc6[_0xa597('0x44')]:_0x557576[_0xa597('0x3f')];if(_0x3070fd[_0xa597('0x40')]['includeAll']){_0x1acbc6[_0xa597('0x50')]=[{'all':!![]}];}_0x1acbc6=_[_0xa597('0x56')]({},_0x1acbc6,_0x3070fd[_0xa597('0x4e')]);return db[_0xa597('0x4f')][_0xa597('0x57')](_0x1acbc6)[_0xa597('0x20')](handleEntityNotFound(_0x1e339a,null))[_0xa597('0x20')](respondWithResult(_0x1e339a,null))[_0xa597('0x29')](handleError(_0x1e339a,null));};exports['create']=function(_0x42dac9,_0x3f1c07){return db[_0xa597('0x4f')][_0xa597('0x58')](_0x42dac9[_0xa597('0x59')],{})[_0xa597('0x20')](respondWithResult(_0x3f1c07,0xc9))[_0xa597('0x29')](handleError(_0x3f1c07,null));};exports[_0xa597('0x35')]=function(_0x3c7a4c,_0x1343d2){if(_0x3c7a4c[_0xa597('0x59')]['id']){delete _0x3c7a4c[_0xa597('0x59')]['id'];}return db[_0xa597('0x4f')]['find']({'where':{'id':_0x3c7a4c[_0xa597('0x54')]['id']}})['then'](handleEntityNotFound(_0x1343d2,null))[_0xa597('0x20')](saveUpdates(_0x3c7a4c['body'],null))['then'](respondWithResult(_0x1343d2,null))['catch'](handleError(_0x1343d2,null));};exports[_0xa597('0x36')]=function(_0x514c40,_0x27fd39){return db[_0xa597('0x4f')][_0xa597('0x57')]({'where':{'id':_0x514c40[_0xa597('0x54')]['id']}})[_0xa597('0x20')](handleEntityNotFound(_0x27fd39,null))[_0xa597('0x20')](removeEntity(_0x27fd39,null))['catch'](handleError(_0x27fd39,null));};exports[_0xa597('0x5a')]=function(_0x5edd16,_0x2061f1){return db[_0xa597('0x4f')][_0xa597('0x5a')]()['then'](respondWithResult(_0x2061f1,null))[_0xa597('0x29')](handleError(_0x2061f1,null));};var interaction_log=require('../../config/logger')(_0xa597('0x5b'));exports[_0xa597('0x5c')]=function(_0x508729,_0x30dfec,_0x2d78f0){var _0x54fbc8={'agent':{},'channel':_0xa597('0x5d')};if(_0x508729['body']['id']){delete _0x508729['body']['id'];}_0x508729['body']['read']=!![];_0x508729[_0xa597('0x59')][_0xa597('0x5e')]=moment()[_0xa597('0x5f')](_0xa597('0x60'));_0x508729[_0xa597('0x59')]['UserId']=_0x508729[_0xa597('0x59')][_0xa597('0x61')]||_0x508729['user']['id'];_0x54fbc8[_0xa597('0x62')]['id']=_0x508729[_0xa597('0x59')][_0xa597('0x61')];return db[_0xa597('0x4f')][_0xa597('0x57')]({'where':{'id':_0x508729[_0xa597('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x30dfec,null))[_0xa597('0x20')](saveUpdates(_0x508729['body'],null))[_0xa597('0x20')](function(_0x182874){if(_0x182874){_0x54fbc8[_0xa597('0x27')]=_0x182874['get']({'plain':!![]});return db[_0xa597('0x63')]['find']({'where':{'id':_0x182874[_0xa597('0x64')]}});}return null;})[_0xa597('0x20')](handleEntityNotFound(_0x30dfec,null))['then'](function(_0x39dc52){if(_0x39dc52){return _0x39dc52['update']({'UserId':_0x508729[_0xa597('0x59')]['UserId'],'read1stAt':_[_0xa597('0x65')](_0x39dc52[_0xa597('0x66')])?moment()[_0xa597('0x5f')](_0xa597('0x60')):undefined});}return null;})['then'](function(_0x52098a){if(_0x52098a){_0x54fbc8['interaction']=_0x52098a[_0xa597('0x67')]({'plain':!![]});interaction_log[_0xa597('0x21')](_0xa597('0x68'),_0x508729[_0xa597('0x69')]['id'],_0x508729[_0xa597('0x69')][_0xa597('0x38')],_0x508729[_0xa597('0x69')]['role'],_0x54fbc8[_0xa597('0x6a')]['id'],_0x508729[_0xa597('0x59')]?JSON[_0xa597('0x25')](_0x508729[_0xa597('0x59')]):_0xa597('0x6b'));return respondWithRpcPromise(_0xa597('0x6c'),_0xa597('0x6d'),_0x54fbc8);}return null;})['then'](function(_0x384b48){var _0x12ebbf='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x384b48[_0xa597('0x27')]['ContactId'];return db[_0xa597('0x6e')][_0xa597('0x40')](_0x12ebbf,{'type':db['Sequelize'][_0xa597('0x6f')]['SELECT'],'raw':!![]})[_0xa597('0x20')](function(_0x53422d){return _0x53422d;});})[_0xa597('0x20')](function(_0x3dadb9){if(_0x3dadb9){_0x54fbc8['message'][_0xa597('0x70')]=_0x3dadb9[0x0];if(!_0x508729[_0xa597('0x59')]['UserId'])return;return db[_0xa597('0x71')][_0xa597('0x57')]({'where':{'id':_0x508729[_0xa597('0x59')][_0xa597('0x61')],'role':_0xa597('0x62')},'attributes':['id',_0xa597('0x38'),_0xa597('0x72'),_0xa597('0x73'),_0xa597('0x74')],'raw':!![]});}return null;})[_0xa597('0x20')](function(_0x3ae77d){if(!_0x3ae77d)return null;_0x54fbc8[_0xa597('0x27')][_0xa597('0x62')]=_0x3ae77d;return _0x54fbc8;})[_0xa597('0x20')](function(_0xf57fa0){if(_0xf57fa0){if(_0x508729[_0xa597('0x59')]['manual']){_0x54fbc8[_0xa597('0x27')]['interface']=util['format']('SIP/%s',_0x508729['user'][_0xa597('0x38')]);_0x54fbc8[_0xa597('0x27')][_0xa597('0x75')]=_0x54fbc8[_0xa597('0x75')];_0x54fbc8[_0xa597('0x27')][_0xa597('0x76')]=_0x54fbc8[_0xa597('0x75')];_0x54fbc8[_0xa597('0x27')][_0xa597('0x77')]='accept';return respondWithRpcPromise(_0xa597('0x78'),_0xa597('0x78'),{'event':_0xa597('0x79'),'message':_0x54fbc8[_0xa597('0x27')]},client9002)[_0xa597('0x20')](function(){return _0x54fbc8;});}return _0x54fbc8;}return null;})[_0xa597('0x20')](respondWithResult(_0x30dfec,null))[_0xa597('0x29')](handleError(_0x30dfec,null));};var interaction_log=require(_0xa597('0x7a'))(_0xa597('0x5b'));exports[_0xa597('0x34')]=function(_0x462e3c,_0x2ea9b8,_0x2512e6){var _0x8cf6d8={'agent':{},'channel':_0xa597('0x5d')};if(_0x462e3c[_0xa597('0x59')]['id']){delete _0x462e3c['body']['id'];}_0x462e3c[_0xa597('0x59')]['UserId']=_0x462e3c['body'][_0xa597('0x61')]||_0x462e3c[_0xa597('0x69')]['id'];_0x8cf6d8['agent']['id']=_0x462e3c[_0xa597('0x59')][_0xa597('0x61')];return db[_0xa597('0x4f')][_0xa597('0x57')]({'where':{'id':_0x462e3c['params']['id'],'UserId':null}})[_0xa597('0x20')](handleEntityNotFound(_0x2ea9b8,null))[_0xa597('0x20')](function(_0x206b29){if(_0x206b29){_0x8cf6d8[_0xa597('0x27')]=_0x206b29['get']({'plain':!![]});return db[_0xa597('0x63')]['find']({'where':{'id':_0x206b29['OpenchannelInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x2ea9b8,null))['then'](function(_0x3f043a){if(_0x3f043a){_0x8cf6d8[_0xa597('0x6a')]=_0x3f043a[_0xa597('0x67')]({'plain':!![]});interaction_log[_0xa597('0x21')](_0xa597('0x7b'),_0x462e3c[_0xa597('0x69')]['id'],_0x462e3c[_0xa597('0x69')][_0xa597('0x38')],_0x462e3c['user']['role'],_0x8cf6d8['interaction']['id'],_0x462e3c[_0xa597('0x59')]?JSON[_0xa597('0x25')](_0x462e3c[_0xa597('0x59')]):_0xa597('0x6b'));return respondWithRpcPromise(_0xa597('0x7c'),_0xa597('0x7d'),_0x8cf6d8);}return null;})[_0xa597('0x20')](function(_0xd1628d){var _0x400a99='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xd1628d[_0xa597('0x27')]['ContactId'];return db['sequelize']['query'](_0x400a99,{'type':db[_0xa597('0x7e')][_0xa597('0x6f')][_0xa597('0x7f')],'raw':!![]})['then'](function(_0x2d9aa0){return _0x2d9aa0;});})[_0xa597('0x20')](function(_0x596958){if(_0x596958){_0x8cf6d8[_0xa597('0x27')]['contact']=_0x596958[0x0];if(!_0x462e3c[_0xa597('0x59')][_0xa597('0x61')])return;return db[_0xa597('0x71')][_0xa597('0x57')]({'where':{'id':_0x462e3c[_0xa597('0x59')][_0xa597('0x61')],'role':'agent'},'attributes':['id','name',_0xa597('0x72'),'email',_0xa597('0x74')],'raw':!![]});}return null;})[_0xa597('0x20')](function(_0x3624fe){if(!_0x3624fe)return null;_0x8cf6d8[_0xa597('0x27')][_0xa597('0x62')]=_0x3624fe;return _0x8cf6d8;})[_0xa597('0x20')](function(_0x472602){if(_0x472602){_0x472602['message'][_0xa597('0x80')]=util[_0xa597('0x5f')](_0xa597('0x81'),_0x462e3c[_0xa597('0x69')][_0xa597('0x38')]);_0x472602['message'][_0xa597('0x75')]=_0x8cf6d8[_0xa597('0x75')];_0x472602[_0xa597('0x27')][_0xa597('0x76')]=_0x8cf6d8[_0xa597('0x75')];_0x472602[_0xa597('0x27')][_0xa597('0x77')]=_0xa597('0x34');respondWithRpcPromise(_0xa597('0x78'),_0xa597('0x78'),{'event':'rejectmessage','message':_0x472602[_0xa597('0x27')]},client9002);return _0x8cf6d8;}return null;})[_0xa597('0x20')](respondWithResult(_0x2ea9b8,null))[_0xa597('0x29')](handleError(_0x2ea9b8,null));}; \ No newline at end of file +var _0x2aff=['Sequelize','contact','User','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','reject','openchannel','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','rejectMessage','QueryTypes','SELECT','fullname','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','jayson/promise','client','http','request','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','sendStatus','name','send','index','map','OpenchannelMessage','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','where','merge','type','options','includeAll','include','findAll','rows','show','find','create','body','params','openchannel-interactions','accept','read','readAt','format','UserId','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize'];(function(_0x2da75c,_0x46f9c2){var _0x40f01c=function(_0x13c462){while(--_0x13c462){_0x2da75c['push'](_0x2da75c['shift']());}};_0x40f01c(++_0x46f9c2);}(_0x2aff,0x195));var _0xf2af=function(_0x45c4b0,_0x21507d){_0x45c4b0=_0x45c4b0-0x0;var _0x18994b=_0x2aff[_0x45c4b0];return _0x18994b;};'use strict';var emlformat=require(_0xf2af('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf2af('0x1'));var rp=require('request-promise');var moment=require(_0xf2af('0x2'));var BPromise=require(_0xf2af('0x3'));var Mustache=require(_0xf2af('0x4'));var util=require(_0xf2af('0x5'));var path=require(_0xf2af('0x6'));var sox=require('sox');var csv=require(_0xf2af('0x7'));var ejs=require(_0xf2af('0x8'));var fs=require('fs');var fs_extra=require(_0xf2af('0x9'));var _=require(_0xf2af('0xa'));var squel=require(_0xf2af('0xb'));var crypto=require(_0xf2af('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf2af('0x7'));var querystring=require(_0xf2af('0xd'));var Papa=require(_0xf2af('0xe'));var Redis=require(_0xf2af('0xf'));var authService=require(_0xf2af('0x10'));var qs=require(_0xf2af('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf2af('0x12'));var logger=require(_0xf2af('0x13'))(_0xf2af('0x14'));var utils=require(_0xf2af('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf2af('0x16'));var db=require(_0xf2af('0x17'))['db'];config[_0xf2af('0x18')]=_[_0xf2af('0x19')](config[_0xf2af('0x18')],{'host':_0xf2af('0x1a'),'port':0x18eb});var socket=require(_0xf2af('0x1b'))(new Redis(config[_0xf2af('0x18')]));require(_0xf2af('0x1c'))['register'](socket);var jayson=require(_0xf2af('0x1d'));var client=jayson[_0xf2af('0x1e')][_0xf2af('0x1f')]({'port':0x232c});var client9002=jayson[_0xf2af('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x330b44,_0x4c202d,_0x310e4a,_0x233bf8){return new BPromise(function(_0x231eff,_0x8521d0){var _0x6c589c=_0x233bf8||client;return _0x6c589c[_0xf2af('0x20')](_0x330b44,_0x310e4a)[_0xf2af('0x21')](function(_0x54db5c){logger['info'](_0xf2af('0x22'),_0x4c202d,_0xf2af('0x23'));logger['debug']('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x4c202d,'request\x20sent',JSON['stringify'](_0x54db5c));if(_0x54db5c[_0xf2af('0x24')]){if(_0x54db5c[_0xf2af('0x24')][_0xf2af('0x25')]===0x1f4){logger[_0xf2af('0x24')](_0xf2af('0x22'),_0x4c202d,_0x54db5c['error'][_0xf2af('0x26')]);return _0x8521d0(_0x54db5c['error'][_0xf2af('0x26')]);}logger[_0xf2af('0x24')](_0xf2af('0x22'),_0x4c202d,_0x54db5c[_0xf2af('0x24')][_0xf2af('0x26')]);return _0x231eff(_0x54db5c[_0xf2af('0x24')][_0xf2af('0x26')]);}else{logger[_0xf2af('0x27')](_0xf2af('0x22'),_0x4c202d,'request\x20sent');_0x231eff(_0x54db5c[_0xf2af('0x28')][_0xf2af('0x26')]);}})[_0xf2af('0x29')](function(_0x5d89d1){logger[_0xf2af('0x24')](_0xf2af('0x22'),_0x4c202d,_0x5d89d1);_0x8521d0(_0x5d89d1);});});}function respondWithStatusCode(_0x456ba2,_0xa67795){_0xa67795=_0xa67795||0xcc;return function(_0x4260d9){if(_0x4260d9){return _0x456ba2['sendStatus'](_0xa67795);}return _0x456ba2['status'](_0xa67795)[_0xf2af('0x2a')]();};}function respondWithResult(_0x3f32a5,_0x31c9c5){_0x31c9c5=_0x31c9c5||0xc8;return function(_0x42212b){if(_0x42212b){return _0x3f32a5[_0xf2af('0x2b')](_0x31c9c5)[_0xf2af('0x2c')](_0x42212b);}};}function respondWithFilteredResult(_0x4db57d,_0x32a668){return function(_0x56c306){if(_0x56c306){var _0x1b7810=typeof _0x32a668[_0xf2af('0x2d')]===_0xf2af('0x2e')&&typeof _0x32a668[_0xf2af('0x2f')]===_0xf2af('0x2e');var _0x248efe=_0x56c306[_0xf2af('0x30')];var _0x258e6a=_0x1b7810?0x0:_0x32a668[_0xf2af('0x2d')];var _0x48394d=_0x1b7810?_0x56c306[_0xf2af('0x30')]:_0x32a668[_0xf2af('0x2d')]+_0x32a668['limit'];var _0x231822;if(_0x48394d>=_0x248efe){_0x48394d=_0x248efe;_0x231822=0xc8;}else{_0x231822=0xce;}_0x4db57d['status'](_0x231822);return _0x4db57d['set'](_0xf2af('0x31'),_0x258e6a+'-'+_0x48394d+'/'+_0x248efe)[_0xf2af('0x2c')](_0x56c306);}return null;};}function patchUpdates(_0x40fd56){return function(_0xa50adc){try{jsonpatch[_0xf2af('0x32')](_0xa50adc,_0x40fd56,!![]);}catch(_0x3c9bcc){return BPromise['reject'](_0x3c9bcc);}return _0xa50adc[_0xf2af('0x33')]();};}function saveUpdates(_0x16ac88,_0x5aba5b){return function(_0x3fac10){if(_0x3fac10){return _0x3fac10[_0xf2af('0x34')](_0x16ac88)['then'](function(_0x18c119){return _0x18c119;});}return null;};}function removeEntity(_0x1e002d,_0x4df81a){return function(_0x542d47){if(_0x542d47){return _0x542d47['destroy']()[_0xf2af('0x21')](function(){_0x1e002d[_0xf2af('0x2b')](0xcc)[_0xf2af('0x2a')]();});}};}function handleEntityNotFound(_0x340e70,_0x31cd42){return function(_0x181324){if(!_0x181324){_0x340e70[_0xf2af('0x35')](0x194);}return _0x181324;};}function handleError(_0x22e947,_0x8a147){_0x8a147=_0x8a147||0x1f4;return function(_0x8fb910){logger['error'](_0x8fb910['stack']);if(_0x8fb910[_0xf2af('0x36')]){delete _0x8fb910['name'];}_0x22e947[_0xf2af('0x2b')](_0x8a147)[_0xf2af('0x37')](_0x8fb910);};}exports[_0xf2af('0x38')]=function(_0x47f9ab,_0x114498){var _0x5a9347={},_0x2a2355={},_0x1919e8={'count':0x0,'rows':[]};var _0xe54b27=_[_0xf2af('0x39')](db[_0xf2af('0x3a')][_0xf2af('0x3b')],function(_0x437600){return{'name':_0x437600['fieldName'],'type':_0x437600['type'][_0xf2af('0x3c')]};});_0x2a2355[_0xf2af('0x3d')]=_[_0xf2af('0x39')](_0xe54b27,_0xf2af('0x36'));_0x2a2355[_0xf2af('0x3e')]=_[_0xf2af('0x3f')](_0x47f9ab[_0xf2af('0x3e')]);_0x2a2355[_0xf2af('0x40')]=_[_0xf2af('0x41')](_0x2a2355['model'],_0x2a2355[_0xf2af('0x3e')]);_0x5a9347[_0xf2af('0x42')]=_[_0xf2af('0x41')](_0x2a2355[_0xf2af('0x3d')],qs[_0xf2af('0x43')](_0x47f9ab[_0xf2af('0x3e')][_0xf2af('0x43')]));_0x5a9347[_0xf2af('0x42')]=_0x5a9347[_0xf2af('0x42')][_0xf2af('0x44')]?_0x5a9347['attributes']:_0x2a2355[_0xf2af('0x3d')];if(!_0x47f9ab[_0xf2af('0x3e')]['hasOwnProperty'](_0xf2af('0x45'))){_0x5a9347[_0xf2af('0x2f')]=qs['limit'](_0x47f9ab[_0xf2af('0x3e')][_0xf2af('0x2f')]);_0x5a9347[_0xf2af('0x2d')]=qs[_0xf2af('0x2d')](_0x47f9ab[_0xf2af('0x3e')][_0xf2af('0x2d')]);}_0x5a9347[_0xf2af('0x46')]=qs[_0xf2af('0x47')](_0x47f9ab[_0xf2af('0x3e')][_0xf2af('0x47')]);_0x5a9347['where']=qs['filters'](_['pick'](_0x47f9ab[_0xf2af('0x3e')],_0x2a2355[_0xf2af('0x40')]),_0xe54b27);if(_0x47f9ab[_0xf2af('0x3e')][_0xf2af('0x48')]){_0x5a9347[_0xf2af('0x49')]=_[_0xf2af('0x4a')](_0x5a9347[_0xf2af('0x49')],{'$or':_['map'](_0xe54b27,function(_0xcd7108){if(_0xcd7108[_0xf2af('0x4b')]!=='VIRTUAL'){var _0xf6e1db={};_0xf6e1db[_0xcd7108['name']]={'$like':'%'+_0x47f9ab[_0xf2af('0x3e')][_0xf2af('0x48')]+'%'};return _0xf6e1db;}})});}_0x5a9347=_['merge']({},_0x5a9347,_0x47f9ab[_0xf2af('0x4c')]);var _0x5b9ed9={'where':_0x5a9347['where']};return db[_0xf2af('0x3a')]['count'](_0x5b9ed9)['then'](function(_0x160618){_0x1919e8[_0xf2af('0x30')]=_0x160618;if(_0x47f9ab[_0xf2af('0x3e')][_0xf2af('0x4d')]){_0x5a9347[_0xf2af('0x4e')]=[{'all':!![]}];}return db[_0xf2af('0x3a')][_0xf2af('0x4f')](_0x5a9347);})[_0xf2af('0x21')](function(_0x1d6f75){_0x1919e8[_0xf2af('0x50')]=_0x1d6f75;return _0x1919e8;})[_0xf2af('0x21')](respondWithFilteredResult(_0x114498,_0x5a9347))[_0xf2af('0x29')](handleError(_0x114498,null));};exports[_0xf2af('0x51')]=function(_0x4508f8,_0x750edd){var _0xe64f96={'raw':!![],'where':{'id':_0x4508f8['params']['id']}},_0x518f31={};_0x518f31[_0xf2af('0x3d')]=_['keys'](db[_0xf2af('0x3a')]['rawAttributes']);_0x518f31[_0xf2af('0x3e')]=_['keys'](_0x4508f8['query']);_0x518f31[_0xf2af('0x40')]=_[_0xf2af('0x41')](_0x518f31[_0xf2af('0x3d')],_0x518f31[_0xf2af('0x3e')]);_0xe64f96[_0xf2af('0x42')]=_[_0xf2af('0x41')](_0x518f31[_0xf2af('0x3d')],qs[_0xf2af('0x43')](_0x4508f8[_0xf2af('0x3e')][_0xf2af('0x43')]));_0xe64f96[_0xf2af('0x42')]=_0xe64f96[_0xf2af('0x42')][_0xf2af('0x44')]?_0xe64f96[_0xf2af('0x42')]:_0x518f31[_0xf2af('0x3d')];if(_0x4508f8['query'][_0xf2af('0x4d')]){_0xe64f96['include']=[{'all':!![]}];}_0xe64f96=_[_0xf2af('0x4a')]({},_0xe64f96,_0x4508f8[_0xf2af('0x4c')]);return db['OpenchannelMessage'][_0xf2af('0x52')](_0xe64f96)[_0xf2af('0x21')](handleEntityNotFound(_0x750edd,null))[_0xf2af('0x21')](respondWithResult(_0x750edd,null))[_0xf2af('0x29')](handleError(_0x750edd,null));};exports[_0xf2af('0x53')]=function(_0x4af8db,_0x5b0fbf){return db[_0xf2af('0x3a')]['create'](_0x4af8db[_0xf2af('0x54')],{})[_0xf2af('0x21')](respondWithResult(_0x5b0fbf,0xc9))[_0xf2af('0x29')](handleError(_0x5b0fbf,null));};exports['update']=function(_0x47b67d,_0x4d6bb8){if(_0x47b67d[_0xf2af('0x54')]['id']){delete _0x47b67d[_0xf2af('0x54')]['id'];}return db[_0xf2af('0x3a')]['find']({'where':{'id':_0x47b67d[_0xf2af('0x55')]['id']}})['then'](handleEntityNotFound(_0x4d6bb8,null))['then'](saveUpdates(_0x47b67d[_0xf2af('0x54')],null))['then'](respondWithResult(_0x4d6bb8,null))[_0xf2af('0x29')](handleError(_0x4d6bb8,null));};exports['destroy']=function(_0x37ae11,_0xe3f39a){return db[_0xf2af('0x3a')][_0xf2af('0x52')]({'where':{'id':_0x37ae11[_0xf2af('0x55')]['id']}})[_0xf2af('0x21')](handleEntityNotFound(_0xe3f39a,null))[_0xf2af('0x21')](removeEntity(_0xe3f39a,null))[_0xf2af('0x29')](handleError(_0xe3f39a,null));};exports['describe']=function(_0xa4e0db,_0x863f0a){return db['OpenchannelMessage']['describe']()['then'](respondWithResult(_0x863f0a,null))[_0xf2af('0x29')](handleError(_0x863f0a,null));};var interaction_log=require(_0xf2af('0x13'))(_0xf2af('0x56'));exports[_0xf2af('0x57')]=function(_0xa42f5b,_0x56e51e,_0x2bb38d){var _0x5c5a03={'agent':{},'channel':'openchannel'};if(_0xa42f5b['body']['id']){delete _0xa42f5b['body']['id'];}_0xa42f5b[_0xf2af('0x54')][_0xf2af('0x58')]=!![];_0xa42f5b['body'][_0xf2af('0x59')]=moment()[_0xf2af('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');_0xa42f5b['body']['UserId']=_0xa42f5b[_0xf2af('0x54')][_0xf2af('0x5b')]||_0xa42f5b['user']['id'];_0x5c5a03[_0xf2af('0x5c')]['id']=_0xa42f5b[_0xf2af('0x54')][_0xf2af('0x5b')];return db[_0xf2af('0x3a')][_0xf2af('0x52')]({'where':{'id':_0xa42f5b['params']['id'],'UserId':null}})[_0xf2af('0x21')](handleEntityNotFound(_0x56e51e,null))[_0xf2af('0x21')](saveUpdates(_0xa42f5b[_0xf2af('0x54')],null))['then'](function(_0x443732){if(_0x443732){_0x5c5a03[_0xf2af('0x26')]=_0x443732[_0xf2af('0x5d')]({'plain':!![]});return db[_0xf2af('0x5e')][_0xf2af('0x52')]({'where':{'id':_0x443732[_0xf2af('0x5f')]}});}return null;})[_0xf2af('0x21')](handleEntityNotFound(_0x56e51e,null))[_0xf2af('0x21')](function(_0x283e2f){if(_0x283e2f){return _0x283e2f[_0xf2af('0x34')]({'UserId':_0xa42f5b['body'][_0xf2af('0x5b')],'read1stAt':_[_0xf2af('0x60')](_0x283e2f['read1stAt'])?moment()[_0xf2af('0x5a')](_0xf2af('0x61')):undefined});}return null;})[_0xf2af('0x21')](function(_0x21d02a){if(_0x21d02a){_0x5c5a03[_0xf2af('0x62')]=_0x21d02a[_0xf2af('0x5d')]({'plain':!![]});interaction_log[_0xf2af('0x27')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xa42f5b[_0xf2af('0x63')]['id'],_0xa42f5b[_0xf2af('0x63')]['name'],_0xa42f5b[_0xf2af('0x63')][_0xf2af('0x64')],_0x5c5a03['interaction']['id'],_0xa42f5b['body']?JSON['stringify'](_0xa42f5b[_0xf2af('0x54')]):_0xf2af('0x65'));return respondWithRpcPromise(_0xf2af('0x66'),_0xf2af('0x67'),_0x5c5a03);}return null;})['then'](function(_0xb06650){var _0x38aef1=_0xf2af('0x68')+_0xb06650['message'][_0xf2af('0x69')];return db[_0xf2af('0x6a')][_0xf2af('0x3e')](_0x38aef1,{'type':db[_0xf2af('0x6b')]['QueryTypes']['SELECT'],'raw':!![]})[_0xf2af('0x21')](function(_0x4828e1){return _0x4828e1;});})[_0xf2af('0x21')](function(_0x50c717){if(_0x50c717){_0x5c5a03[_0xf2af('0x26')][_0xf2af('0x6c')]=_0x50c717[0x0];if(!_0xa42f5b[_0xf2af('0x54')][_0xf2af('0x5b')])return;return db[_0xf2af('0x6d')]['find']({'where':{'id':_0xa42f5b[_0xf2af('0x54')]['UserId'],'role':'agent'},'attributes':['id','name','fullname',_0xf2af('0x6e'),_0xf2af('0x6f')],'raw':!![]});}return null;})[_0xf2af('0x21')](function(_0x3383b6){if(!_0x3383b6)return null;_0x5c5a03[_0xf2af('0x26')][_0xf2af('0x5c')]=_0x3383b6;return _0x5c5a03;})[_0xf2af('0x21')](function(_0x24dd64){if(_0x24dd64){if(_0xa42f5b[_0xf2af('0x54')][_0xf2af('0x70')]){_0x5c5a03['message'][_0xf2af('0x71')]=util[_0xf2af('0x5a')](_0xf2af('0x72'),_0xa42f5b[_0xf2af('0x63')][_0xf2af('0x36')]);_0x5c5a03['message']['channel']=_0x5c5a03[_0xf2af('0x73')];_0x5c5a03['message'][_0xf2af('0x74')]=_0x5c5a03['channel'];_0x5c5a03['message'][_0xf2af('0x75')]=_0xf2af('0x57');return respondWithRpcPromise(_0xf2af('0x76'),'EventManager',{'event':_0xf2af('0x77'),'message':_0x5c5a03['message']},client9002)[_0xf2af('0x21')](function(){return _0x5c5a03;});}return _0x5c5a03;}return null;})[_0xf2af('0x21')](respondWithResult(_0x56e51e,null))['catch'](handleError(_0x56e51e,null));};var interaction_log=require(_0xf2af('0x13'))(_0xf2af('0x56'));exports[_0xf2af('0x78')]=function(_0x4e7305,_0x1e8ee0,_0x348c1f){var _0x46968c={'agent':{},'channel':_0xf2af('0x79')};if(_0x4e7305[_0xf2af('0x54')]['id']){delete _0x4e7305[_0xf2af('0x54')]['id'];}_0x4e7305[_0xf2af('0x54')][_0xf2af('0x5b')]=_0x4e7305[_0xf2af('0x54')][_0xf2af('0x5b')]||_0x4e7305[_0xf2af('0x63')]['id'];_0x46968c[_0xf2af('0x5c')]['id']=_0x4e7305[_0xf2af('0x54')][_0xf2af('0x5b')];return db[_0xf2af('0x3a')][_0xf2af('0x52')]({'where':{'id':_0x4e7305[_0xf2af('0x55')]['id'],'UserId':null}})[_0xf2af('0x21')](handleEntityNotFound(_0x1e8ee0,null))[_0xf2af('0x21')](function(_0x16ea4d){if(_0x16ea4d){_0x46968c[_0xf2af('0x26')]=_0x16ea4d[_0xf2af('0x5d')]({'plain':!![]});return db[_0xf2af('0x5e')][_0xf2af('0x52')]({'where':{'id':_0x16ea4d[_0xf2af('0x5f')]}});}return null;})['then'](handleEntityNotFound(_0x1e8ee0,null))[_0xf2af('0x21')](function(_0x45ad86){if(_0x45ad86){_0x46968c[_0xf2af('0x62')]=_0x45ad86[_0xf2af('0x5d')]({'plain':!![]});interaction_log['info'](_0xf2af('0x7a'),_0x4e7305[_0xf2af('0x63')]['id'],_0x4e7305['user'][_0xf2af('0x36')],_0x4e7305[_0xf2af('0x63')][_0xf2af('0x64')],_0x46968c[_0xf2af('0x62')]['id'],_0x4e7305[_0xf2af('0x54')]?JSON[_0xf2af('0x7b')](_0x4e7305[_0xf2af('0x54')]):_0xf2af('0x65'));return respondWithRpcPromise('RejectMessage',_0xf2af('0x7c'),_0x46968c);}return null;})[_0xf2af('0x21')](function(_0x1563d0){var _0x32638d=_0xf2af('0x68')+_0x1563d0[_0xf2af('0x26')]['ContactId'];return db[_0xf2af('0x6a')][_0xf2af('0x3e')](_0x32638d,{'type':db[_0xf2af('0x6b')][_0xf2af('0x7d')][_0xf2af('0x7e')],'raw':!![]})['then'](function(_0x224917){return _0x224917;});})[_0xf2af('0x21')](function(_0x10d948){if(_0x10d948){_0x46968c[_0xf2af('0x26')][_0xf2af('0x6c')]=_0x10d948[0x0];if(!_0x4e7305[_0xf2af('0x54')][_0xf2af('0x5b')])return;return db['User']['find']({'where':{'id':_0x4e7305['body'][_0xf2af('0x5b')],'role':_0xf2af('0x5c')},'attributes':['id',_0xf2af('0x36'),_0xf2af('0x7f'),_0xf2af('0x6e'),_0xf2af('0x6f')],'raw':!![]});}return null;})[_0xf2af('0x21')](function(_0x4f6399){if(!_0x4f6399)return null;_0x46968c[_0xf2af('0x26')][_0xf2af('0x5c')]=_0x4f6399;return _0x46968c;})[_0xf2af('0x21')](function(_0x229629){if(_0x229629){_0x229629['message']['interface']=util[_0xf2af('0x5a')](_0xf2af('0x72'),_0x4e7305['user'][_0xf2af('0x36')]);_0x229629[_0xf2af('0x26')][_0xf2af('0x73')]=_0x46968c[_0xf2af('0x73')];_0x229629['message'][_0xf2af('0x74')]=_0x46968c['channel'];_0x229629['message']['event']=_0xf2af('0x78');respondWithRpcPromise(_0xf2af('0x76'),_0xf2af('0x76'),{'event':'rejectmessage','message':_0x229629[_0xf2af('0x26')]},client9002);return _0x46968c;}return null;})[_0xf2af('0x21')](respondWithResult(_0x1e8ee0,null))[_0xf2af('0x29')](handleError(_0x1e8ee0,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 3a19cf3..d3b1ee1 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 _0xd63e=['emit','hasOwnProperty','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x79cd47,_0x16102d){var _0x3b9484=function(_0x23db95){while(--_0x23db95){_0x79cd47['push'](_0x79cd47['shift']());}};_0x3b9484(++_0x16102d);}(_0xd63e,0x122));var _0xed63=function(_0xc1fc6e,_0x4ad9c3){_0xc1fc6e=_0xc1fc6e-0x0;var _0x163610=_0xd63e[_0xc1fc6e];return _0x163610;};'use strict';var EventEmitter=require(_0xed63('0x0'));var OpenchannelMessage=require(_0xed63('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xed63('0x2')](0x0);var events={'afterCreate':_0xed63('0x3'),'afterUpdate':_0xed63('0x4'),'afterDestroy':_0xed63('0x5')};function emitEvent(_0x316abe){return function(_0x36ded7,_0x30f4bd,_0x32c739){OpenchannelMessageEvents['emit'](_0x316abe+':'+_0x36ded7['id'],_0x36ded7);OpenchannelMessageEvents[_0xed63('0x6')](_0x316abe,_0x36ded7);_0x32c739(null);};}for(var e in events){if(events[_0xed63('0x7')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file +var _0x2b02=['save','update','remove','emit','hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners'];(function(_0x281286,_0x2d4f0e){var _0x4b1b4a=function(_0x33fa9a){while(--_0x33fa9a){_0x281286['push'](_0x281286['shift']());}};_0x4b1b4a(++_0x2d4f0e);}(_0x2b02,0x13c));var _0x22b0=function(_0x493b04,_0x1a4b22){_0x493b04=_0x493b04-0x0;var _0x89fd86=_0x2b02[_0x493b04];return _0x89fd86;};'use strict';var EventEmitter=require(_0x22b0('0x0'));var OpenchannelMessage=require(_0x22b0('0x1'))['db'][_0x22b0('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x22b0('0x3')](0x0);var events={'afterCreate':_0x22b0('0x4'),'afterUpdate':_0x22b0('0x5'),'afterDestroy':_0x22b0('0x6')};function emitEvent(_0x1739fe){return function(_0x190c7f,_0x4374dc,_0x55c927){OpenchannelMessageEvents[_0x22b0('0x7')](_0x1739fe+':'+_0x190c7f['id'],_0x190c7f);OpenchannelMessageEvents['emit'](_0x1739fe,_0x190c7f);_0x55c927(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0x22b0('0x8')](e,emitEvent(event));}}module[_0x22b0('0x9')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index a0c4307..0d2b446 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 _0x11f4=['replyUri','OpenchannelMessage,\x20%s,\x20%s','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','length','Interaction','omit','POST','method','info','afterCreate','format','threadId','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','define','OpenchannelMessage','openchannel_messages','body','FULLTEXT','direction','out','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','update','createdAt','catch','CmContact','describe','then','Contact','keys','get'];(function(_0x1d6768,_0x45c63f){var _0x2b3383=function(_0x3de615){while(--_0x3de615){_0x1d6768['push'](_0x1d6768['shift']());}};_0x2b3383(++_0x45c63f);}(_0x11f4,0x14b));var _0x411f=function(_0x44d62d,_0x128717){_0x44d62d=_0x44d62d-0x0;var _0xd4383f=_0x11f4[_0x44d62d];return _0xd4383f;};'use strict';var _=require(_0x411f('0x0'));var util=require(_0x411f('0x1'));var logger=require(_0x411f('0x2'))(_0x411f('0x3'));var moment=require('moment');var BPromise=require(_0x411f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x411f('0x5'));var rimraf=require(_0x411f('0x6'));var config=require(_0x411f('0x7'));var attributes=require('./openchannelMessage.attributes');module['exports']=function(_0xa456ce,_0x6a01ab){return _0xa456ce[_0x411f('0x8')](_0x411f('0x9'),attributes,{'tableName':_0x411f('0xa'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0x411f('0xb')],'type':_0x411f('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xcf1ac1,_0x150d01,_0x574180){var _0x2938e4=_0xa456ce['models'];var _0x24208f=_0xcf1ac1['get']({'plain':!![]});if(_0x24208f[_0x411f('0xd')]['toLowerCase']()==='in'||_0x24208f[_0x411f('0xd')]['toLowerCase']()===_0x411f('0xe')&&!_0x24208f['secret']&&!_[_0x411f('0xf')](_0x24208f[_0x411f('0x10')])){_0x2938e4[_0x411f('0x11')][_0x411f('0x12')]({'where':{'id':_0x24208f[_0x411f('0x13')]}})['then'](function(_0x4764b6){if(_0x4764b6){_0x4764b6[_0x411f('0x14')]({'lastMsgAt':_0x24208f[_0x411f('0x15')],'lastMsgDirection':_0x24208f['direction']['toLowerCase']()});}})[_0x411f('0x16')](function(_0xc1e34c){console['error'](_0xc1e34c);});}if(_0x24208f[_0x411f('0xd')]===_0x411f('0xe')&&!_0x24208f['secret']){var _0xc7409e;_0x2938e4[_0x411f('0x17')][_0x411f('0x18')]()[_0x411f('0x19')](function(_0x49018a){return _0x2938e4['OpenchannelAccount']['find']({'where':{'id':_0x24208f['OpenchannelAccountId']},'include':[{'model':_0x2938e4[_0x411f('0x11')],'as':'Interactions','where':{'id':_0x24208f[_0x411f('0x13')]},'limit':0x1,'include':[{'model':_0x2938e4[_0x411f('0x17')],'as':_0x411f('0x1a'),'attributes':_[_0x411f('0x1b')](_0x49018a)}]}]});})[_0x411f('0x19')](function(_0x24f201){_0xc7409e=_0x24f201[_0x411f('0x1c')]({'plain':!![]});if(_0xc7409e&&_0xc7409e[_0x411f('0x1d')]){logger['info'](_0x411f('0x1e'),'afterCreate',util['format'](_0x411f('0x1f'),_0x24208f['id'],_0xc7409e[_0x411f('0x1d')]));if(_0xc7409e[_0x411f('0x20')]&&_0xc7409e['Interactions'][_0x411f('0x21')]){_0x24208f[_0x411f('0x22')]=_[_0x411f('0x23')](_0xc7409e[_0x411f('0x20')][0x0],_0x411f('0x1a'));_0x24208f[_0x411f('0x1a')]=_0xc7409e['Interactions'][0x0][_0x411f('0x1a')];}var _0x150d01={'method':_0x411f('0x24'),'uri':encodeURI(_0xc7409e['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x150d01[_0x411f('0x25')]){case'GET':_0x150d01['qs']=_0x24208f;break;case'POST':_0x150d01[_0x411f('0xb')]=_0x24208f;break;}return rp(_0x150d01)['then'](function(_0x2b8943){logger[_0x411f('0x26')](_0x411f('0x1e'),_0x411f('0x27'),util[_0x411f('0x28')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x24208f['id'],_0xc7409e[_0x411f('0x1d')]));if(_0x2b8943[_0x411f('0xb')][_0x411f('0x29')]&&_0x2b8943['body'][_0x411f('0x29')]!=_0x24208f[_0x411f('0x22')][_0x411f('0x29')]){return _0x2938e4[_0x411f('0x11')]['update']({'threadId':_0x2b8943[_0x411f('0xb')]['threadId']},{'where':{'id':_0x24208f[_0x411f('0x22')]['id']}});}else{return;}})[_0x411f('0x19')](function(){return _0xcf1ac1[_0x411f('0x14')]({'read':!![]});})[_0x411f('0x16')](function(_0x2826ac){logger[_0x411f('0x2a')]('OpenchannelMessage,\x20%s,\x20%s',_0x411f('0x27'),util['inspect'](_0x2826ac,{'showHidden':![],'depth':null}));_0x574180();});}else{_0x574180();}})['finally'](function(){_0x574180();});}else{_0x574180();}}},'charset':_0x411f('0x2b'),'collate':_0x411f('0x2c')});}; \ No newline at end of file +var _0x8a5e=['openchannel_messages','fti_openchannel_messages','body','FULLTEXT','get','toLowerCase','direction','secret','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','catch','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','Contact','POST','method','GET','info','threadId','error','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','path','../../config/environment','exports','define','OpenchannelMessage'];(function(_0x1f45f3,_0x435b7d){var _0x5072d0=function(_0x1526ec){while(--_0x1526ec){_0x1f45f3['push'](_0x1f45f3['shift']());}};_0x5072d0(++_0x435b7d);}(_0x8a5e,0xc0));var _0xe8a5=function(_0x102589,_0x476a51){_0x102589=_0x102589-0x0;var _0x3e77de=_0x8a5e[_0x102589];return _0x3e77de;};'use strict';var _=require(_0xe8a5('0x0'));var util=require('util');var logger=require(_0xe8a5('0x1'))(_0xe8a5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe8a5('0x3'));var rimraf=require('rimraf');var config=require(_0xe8a5('0x4'));var attributes=require('./openchannelMessage.attributes');module[_0xe8a5('0x5')]=function(_0x4d503f,_0xd60518){return _0x4d503f[_0xe8a5('0x6')](_0xe8a5('0x7'),attributes,{'tableName':_0xe8a5('0x8'),'paranoid':![],'indexes':[{'name':_0xe8a5('0x9'),'fields':[_0xe8a5('0xa')],'type':_0xe8a5('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5bf3d2,_0x481f78,_0x3460a9){var _0x2cad77=_0x4d503f['models'];var _0x136569=_0x5bf3d2[_0xe8a5('0xc')]({'plain':!![]});if(_0x136569['direction'][_0xe8a5('0xd')]()==='in'||_0x136569[_0xe8a5('0xe')][_0xe8a5('0xd')]()==='out'&&!_0x136569[_0xe8a5('0xf')]&&!_['isNil'](_0x136569[_0xe8a5('0x10')])){_0x2cad77[_0xe8a5('0x11')][_0xe8a5('0x12')]({'where':{'id':_0x136569[_0xe8a5('0x13')]}})[_0xe8a5('0x14')](function(_0x132892){if(_0x132892){_0x132892[_0xe8a5('0x15')]({'lastMsgAt':_0x136569[_0xe8a5('0x16')],'lastMsgDirection':_0x136569['direction'][_0xe8a5('0xd')]()});}})[_0xe8a5('0x17')](function(_0x40ffce){console['error'](_0x40ffce);});}if(_0x136569[_0xe8a5('0xe')]==='out'&&!_0x136569['secret']){var _0x327b98;_0x2cad77[_0xe8a5('0x18')][_0xe8a5('0x19')]()['then'](function(_0x439448){return _0x2cad77[_0xe8a5('0x1a')][_0xe8a5('0x1b')]({'where':{'id':_0x136569[_0xe8a5('0x1c')]},'include':[{'model':_0x2cad77[_0xe8a5('0x11')],'as':_0xe8a5('0x1d'),'where':{'id':_0x136569[_0xe8a5('0x13')]},'limit':0x1,'include':[{'model':_0x2cad77[_0xe8a5('0x18')],'as':'Contact','attributes':_[_0xe8a5('0x1e')](_0x439448)}]}]});})[_0xe8a5('0x14')](function(_0x310bc2){_0x327b98=_0x310bc2[_0xe8a5('0xc')]({'plain':!![]});if(_0x327b98&&_0x327b98[_0xe8a5('0x1f')]){logger['info'](_0xe8a5('0x20'),_0xe8a5('0x21'),util[_0xe8a5('0x22')](_0xe8a5('0x23'),_0x136569['id'],_0x327b98['replyUri']));if(_0x327b98['Interactions']&&_0x327b98[_0xe8a5('0x1d')][_0xe8a5('0x24')]){_0x136569[_0xe8a5('0x25')]=_[_0xe8a5('0x26')](_0x327b98[_0xe8a5('0x1d')][0x0],_0xe8a5('0x27'));_0x136569[_0xe8a5('0x27')]=_0x327b98['Interactions'][0x0]['Contact'];}var _0x481f78={'method':_0xe8a5('0x28'),'uri':encodeURI(_0x327b98[_0xe8a5('0x1f')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x481f78[_0xe8a5('0x29')]){case _0xe8a5('0x2a'):_0x481f78['qs']=_0x136569;break;case _0xe8a5('0x28'):_0x481f78[_0xe8a5('0xa')]=_0x136569;break;}return rp(_0x481f78)[_0xe8a5('0x14')](function(_0x4681ca){logger[_0xe8a5('0x2b')](_0xe8a5('0x20'),_0xe8a5('0x21'),util[_0xe8a5('0x22')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x136569['id'],_0x327b98[_0xe8a5('0x1f')]));if(_0x4681ca['body']['threadId']&&_0x4681ca[_0xe8a5('0xa')]['threadId']!=_0x136569[_0xe8a5('0x25')]['threadId']){return _0x2cad77[_0xe8a5('0x11')][_0xe8a5('0x15')]({'threadId':_0x4681ca[_0xe8a5('0xa')][_0xe8a5('0x2c')]},{'where':{'id':_0x136569[_0xe8a5('0x25')]['id']}});}else{return;}})['then'](function(){return _0x5bf3d2[_0xe8a5('0x15')]({'read':!![]});})[_0xe8a5('0x17')](function(_0x56d49d){logger[_0xe8a5('0x2d')](_0xe8a5('0x20'),_0xe8a5('0x21'),util[_0xe8a5('0x2e')](_0x56d49d,{'showHidden':![],'depth':null}));_0x3460a9();});}else{_0x3460a9();}})[_0xe8a5('0x2f')](function(){_0x3460a9();});}else{_0x3460a9();}}},'charset':_0xe8a5('0x30'),'collate':_0xe8a5('0x31')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 7cfe6e6..3c451db 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 _0x5f2f=['OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','OpenchannelMessage','create','options','raw','CreateOpenchannelMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xd6569e,_0x1d3bf1){var _0x1eb282=function(_0x39c282){while(--_0x39c282){_0xd6569e['push'](_0xd6569e['shift']());}};_0x1eb282(++_0x1d3bf1);}(_0x5f2f,0x73));var _0xf5f2=function(_0x13b110,_0xaed0f2){_0x13b110=_0x13b110-0x0;var _0xd52387=_0x5f2f[_0x13b110];return _0xd52387;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});config[_0xf5f2('0xc')]=_[_0xf5f2('0xd')](config['redis'],{'host':_0xf5f2('0xe'),'port':0x18eb});var socket=require(_0xf5f2('0xf'))(new Redis(config[_0xf5f2('0xc')]));require('./openchannelMessage.socket')[_0xf5f2('0x10')](socket);function respondWithRpcPromise(_0x15dd7c,_0x218ae3,_0x4e0e6b){return new BPromise(function(_0x977a59,_0x4ebbbe){return client['request'](_0x15dd7c,_0x4e0e6b)[_0xf5f2('0x11')](function(_0x151aba){logger['info'](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));logger[_0xf5f2('0x14')](_0xf5f2('0x15'),_0x218ae3,_0xf5f2('0x13'),JSON[_0xf5f2('0x16')](_0x151aba));if(_0x151aba['error']){if(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x18')]===0x1f4){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')]['message']);return _0x4ebbbe(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);return _0x977a59(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}else{logger[_0xf5f2('0x1a')](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));_0x977a59(_0x151aba[_0xf5f2('0x1b')][_0xf5f2('0x19')]);}})[_0xf5f2('0x1c')](function(_0x3cf5ea){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x3cf5ea);_0x4ebbbe(_0x3cf5ea);});});}exports['CreateOpenchannelMessage']=function(_0x34706d){var _0x47101e=this;return new Promise(function(_0x49dac2,_0x47acfc){return db[_0xf5f2('0x1d')][_0xf5f2('0x1e')](_0x34706d['body'],{'raw':_0x34706d[_0xf5f2('0x1f')]?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x20')]===undefined?!![]:![]:!![]})[_0xf5f2('0x11')](function(_0x36f1cb){logger['info'](_0xf5f2('0x21'),_0x34706d);logger[_0xf5f2('0x14')](_0xf5f2('0x21'),_0x34706d,JSON[_0xf5f2('0x16')](_0x36f1cb));_0x49dac2(_0x36f1cb);})[_0xf5f2('0x1c')](function(_0x5bdf4a){logger['error'](_0xf5f2('0x21'),_0x5bdf4a[_0xf5f2('0x19')],_0x34706d);_0x47acfc(_0x47101e[_0xf5f2('0x17')](0x1f4,_0x5bdf4a[_0xf5f2('0x19')]));});});}; \ No newline at end of file +var _0xadb5=['debug','request\x20sent','stringify','error','code','message','info','result','catch','OpenchannelMessage','body','raw','CreateOpenchannelMessage','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x471fcc,_0x176659){var _0x29c926=function(_0x3ed498){while(--_0x3ed498){_0x471fcc['push'](_0x471fcc['shift']());}};_0x29c926(++_0x176659);}(_0xadb5,0xad));var _0x5adb=function(_0x48863f,_0x2260ee){_0x48863f=_0x48863f-0x0;var _0x29ed2a=_0xadb5[_0x48863f];return _0x29ed2a;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});config[_0x5adb('0xa')]=_[_0x5adb('0xb')](config[_0x5adb('0xa')],{'host':_0x5adb('0xc'),'port':0x18eb});var socket=require(_0x5adb('0xd'))(new Redis(config[_0x5adb('0xa')]));require(_0x5adb('0xe'))[_0x5adb('0xf')](socket);function respondWithRpcPromise(_0x336bad,_0x129f5a,_0x275428){return new BPromise(function(_0x563d86,_0x4c268d){return client[_0x5adb('0x10')](_0x336bad,_0x275428)[_0x5adb('0x11')](function(_0x82e67e){logger['info'](_0x5adb('0x12'),_0x129f5a,'request\x20sent');logger[_0x5adb('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x129f5a,_0x5adb('0x14'),JSON[_0x5adb('0x15')](_0x82e67e));if(_0x82e67e[_0x5adb('0x16')]){if(_0x82e67e['error'][_0x5adb('0x17')]===0x1f4){logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e['error'][_0x5adb('0x18')]);return _0x4c268d(_0x82e67e['error'][_0x5adb('0x18')]);}logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);return _0x563d86(_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);}else{logger[_0x5adb('0x19')](_0x5adb('0x12'),_0x129f5a,'request\x20sent');_0x563d86(_0x82e67e[_0x5adb('0x1a')]['message']);}})[_0x5adb('0x1b')](function(_0x558f76){logger[_0x5adb('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x129f5a,_0x558f76);_0x4c268d(_0x558f76);});});}exports['CreateOpenchannelMessage']=function(_0x1fbaa5){var _0x1bed20=this;return new Promise(function(_0x438671,_0x1fd4a7){return db[_0x5adb('0x1c')]['create'](_0x1fbaa5[_0x5adb('0x1d')],{'raw':_0x1fbaa5['options']?_0x1fbaa5['options'][_0x5adb('0x1e')]===undefined?!![]:![]:!![]})[_0x5adb('0x11')](function(_0x1a38d3){logger[_0x5adb('0x19')](_0x5adb('0x1f'),_0x1fbaa5);logger[_0x5adb('0x13')](_0x5adb('0x1f'),_0x1fbaa5,JSON['stringify'](_0x1a38d3));_0x438671(_0x1a38d3);})[_0x5adb('0x1b')](function(_0x373cc3){logger[_0x5adb('0x16')](_0x5adb('0x1f'),_0x373cc3[_0x5adb('0x18')],_0x1fbaa5);_0x1fd4a7(_0x1bed20['error'](0x1f4,_0x373cc3[_0x5adb('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 00c4f87..d2d5173 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 _0x187d=['./openchannelMessage.events','remove','update','emit','removeListener','length','openchannelMessage:'];(function(_0x37a4cc,_0x1531a8){var _0x4ffbbf=function(_0x5d7be5){while(--_0x5d7be5){_0x37a4cc['push'](_0x37a4cc['shift']());}};_0x4ffbbf(++_0x1531a8);}(_0x187d,0x93));var _0xd187=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x187d[_0x46aff0];return _0x9d78cf;};'use strict';var OpenchannelMessageEvents=require(_0xd187('0x0'));var events=['save',_0xd187('0x1'),_0xd187('0x2')];function createListener(_0x44d5f6,_0x1cb41f){return function(_0x18498b){_0x1cb41f[_0xd187('0x3')](_0x44d5f6,_0x18498b);};}function removeListener(_0x58622a,_0x28fa0b){return function(){OpenchannelMessageEvents[_0xd187('0x4')](_0x58622a,_0x28fa0b);};}exports['register']=function(_0x1d2533){for(var _0x58ee7=0x0,_0x444a60=events[_0xd187('0x5')];_0x58ee7<_0x444a60;_0x58ee7++){var _0x28ce2f=events[_0x58ee7];var _0x2d6992=createListener(_0xd187('0x6')+_0x28ce2f,_0x1d2533);OpenchannelMessageEvents['on'](_0x28ce2f,_0x2d6992);}}; \ No newline at end of file +var _0xc57c=['emit','removeListener','register','length','openchannelMessage:','./openchannelMessage.events'];(function(_0x169dff,_0x57be0){var _0x91cf22=function(_0x527498){while(--_0x527498){_0x169dff['push'](_0x169dff['shift']());}};_0x91cf22(++_0x57be0);}(_0xc57c,0x149));var _0xcc57=function(_0x3c5b8d,_0x27681f){_0x3c5b8d=_0x3c5b8d-0x0;var _0x57c57a=_0xc57c[_0x3c5b8d];return _0x57c57a;};'use strict';var OpenchannelMessageEvents=require(_0xcc57('0x0'));var events=['save','remove','update'];function createListener(_0x3befc4,_0x5233e0){return function(_0x4a98ce){_0x5233e0[_0xcc57('0x1')](_0x3befc4,_0x4a98ce);};}function removeListener(_0x589025,_0x163be1){return function(){OpenchannelMessageEvents[_0xcc57('0x2')](_0x589025,_0x163be1);};}exports[_0xcc57('0x3')]=function(_0x2f87ef){for(var _0x4760f4=0x0,_0x2433da=events[_0xcc57('0x4')];_0x4760f4<_0x2433da;_0x4760f4++){var _0x5bd3d8=events[_0x4760f4];var _0x2a81f0=createListener(_0xcc57('0x5')+_0x5bd3d8,_0x2f87ef);OpenchannelMessageEvents['on'](_0x5bd3d8,_0x2a81f0);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index bd4e423..dae9518 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 _0x0049=['removeTeams','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','/:id','update','delete'];(function(_0x146bc8,_0x20ebda){var _0x325eff=function(_0x22bc00){while(--_0x22bc00){_0x146bc8['push'](_0x146bc8['shift']());}};_0x325eff(++_0x20ebda);}(_0x0049,0xe3));var _0x9004=function(_0x13dc99,_0x2e7821){_0x13dc99=_0x13dc99-0x0;var _0x4c8451=_0x0049[_0x13dc99];return _0x4c8451;};'use strict';var multer=require(_0x9004('0x0'));var util=require(_0x9004('0x1'));var path=require(_0x9004('0x2'));var timeout=require(_0x9004('0x3'));var express=require('express');var router=express[_0x9004('0x4')]();var fs_extra=require(_0x9004('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9004('0x6'));var config=require(_0x9004('0x7'));var controller=require(_0x9004('0x8'));router[_0x9004('0x9')]('/',auth[_0x9004('0xa')](),controller[_0x9004('0xb')]);router['get']('/describe',auth[_0x9004('0xa')](),controller['describe']);router['get']('/:id',auth[_0x9004('0xa')](),controller[_0x9004('0xc')]);router[_0x9004('0x9')](_0x9004('0xd'),auth[_0x9004('0xa')](),controller['getMembers']);router[_0x9004('0x9')](_0x9004('0xe'),auth[_0x9004('0xa')](),controller[_0x9004('0xf')]);router['get'](_0x9004('0x10'),auth['isAuthenticated'](),controller[_0x9004('0x11')]);router[_0x9004('0x12')]('/',auth['isAuthenticated'](),controller[_0x9004('0x13')]);router[_0x9004('0x12')](_0x9004('0xe'),auth[_0x9004('0xa')](),controller[_0x9004('0x14')]);router[_0x9004('0x12')](_0x9004('0x10'),auth[_0x9004('0xa')](),controller['addAgents']);router[_0x9004('0x15')](_0x9004('0x16'),auth[_0x9004('0xa')](),controller[_0x9004('0x17')]);router[_0x9004('0x18')](_0x9004('0x16'),auth[_0x9004('0xa')](),controller['destroy']);router[_0x9004('0x18')](_0x9004('0xe'),auth['isAuthenticated'](),controller[_0x9004('0x19')]);router[_0x9004('0x18')](_0x9004('0x10'),auth[_0x9004('0xa')](),controller[_0x9004('0x1a')]);module[_0x9004('0x1b')]=router; \ No newline at end of file +var _0x0529=['./openchannelQueue.controller','get','isAuthenticated','index','/describe','show','/:id/members','/:id/teams','/:id/users','getAgents','post','create','addTeams','put','/:id','update','delete','destroy','removeTeams','exports','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x12e075,_0x2f6b9c){var _0xacd6dd=function(_0x1135c2){while(--_0x1135c2){_0x12e075['push'](_0x12e075['shift']());}};_0xacd6dd(++_0x2f6b9c);}(_0x0529,0x1b4));var _0x9052=function(_0x536208,_0x3fbf7d){_0x536208=_0x536208-0x0;var _0x2b6439=_0x0529[_0x536208];return _0x2b6439;};'use strict';var multer=require('multer');var util=require(_0x9052('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9052('0x1'));var router=express['Router']();var fs_extra=require(_0x9052('0x2'));var auth=require(_0x9052('0x3'));var interaction=require(_0x9052('0x4'));var config=require(_0x9052('0x5'));var controller=require(_0x9052('0x6'));router[_0x9052('0x7')]('/',auth[_0x9052('0x8')](),controller[_0x9052('0x9')]);router[_0x9052('0x7')](_0x9052('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x9052('0x7')]('/:id',auth[_0x9052('0x8')](),controller[_0x9052('0xb')]);router[_0x9052('0x7')](_0x9052('0xc'),auth['isAuthenticated'](),controller['getMembers']);router[_0x9052('0x7')](_0x9052('0xd'),auth[_0x9052('0x8')](),controller['getTeams']);router[_0x9052('0x7')](_0x9052('0xe'),auth[_0x9052('0x8')](),controller[_0x9052('0xf')]);router[_0x9052('0x10')]('/',auth[_0x9052('0x8')](),controller[_0x9052('0x11')]);router[_0x9052('0x10')](_0x9052('0xd'),auth[_0x9052('0x8')](),controller[_0x9052('0x12')]);router['post'](_0x9052('0xe'),auth['isAuthenticated'](),controller['addAgents']);router[_0x9052('0x13')](_0x9052('0x14'),auth['isAuthenticated'](),controller[_0x9052('0x15')]);router[_0x9052('0x16')](_0x9052('0x14'),auth[_0x9052('0x8')](),controller[_0x9052('0x17')]);router[_0x9052('0x16')](_0x9052('0xd'),auth['isAuthenticated'](),controller[_0x9052('0x18')]);router[_0x9052('0x16')](_0x9052('0xe'),auth[_0x9052('0x8')](),controller['removeAgents']);module[_0x9052('0x19')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 225e65f..15d1ca5 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 _0x2908=['name','ENUM','rrmemory','beepall','exports','STRING'];(function(_0x42c9a8,_0x269ad8){var _0xd8d52e=function(_0x1fefdb){while(--_0x1fefdb){_0x42c9a8['push'](_0x42c9a8['shift']());}};_0xd8d52e(++_0x269ad8);}(_0x2908,0x1e4));var _0x8290=function(_0x22d510,_0xd2e473){_0x22d510=_0x22d510-0x0;var _0x506efd=_0x2908[_0x22d510];return _0x506efd;};'use strict';var Sequelize=require('sequelize');module[_0x8290('0x0')]={'name':{'type':Sequelize[_0x8290('0x1')],'unique':_0x8290('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8290('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8290('0x3')](_0x8290('0x4'),_0x8290('0x5'),'roundrobin')}}; \ No newline at end of file +var _0x490e=['ENUM','beepall','roundrobin','sequelize','exports','STRING','name'];(function(_0x5c7798,_0x5327af){var _0x154a57=function(_0x548970){while(--_0x548970){_0x5c7798['push'](_0x5c7798['shift']());}};_0x154a57(++_0x5327af);}(_0x490e,0x1b5));var _0xe490=function(_0x3ddce0,_0x11741e){_0x3ddce0=_0x3ddce0-0x0;var _0x567d64=_0x490e[_0x3ddce0];return _0x567d64;};'use strict';var Sequelize=require(_0xe490('0x0'));module[_0xe490('0x1')]={'name':{'type':Sequelize[_0xe490('0x2')],'unique':_0xe490('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe490('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe490('0x4')]('rrmemory',_0xe490('0x5'),_0xe490('0x6'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 1390a06..243deda 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 _0x8673=['createdAt','findOne','Team','length','pick','hasOwnProperty','nolimit','getTeams','addTeams','ids','Agents','voicePause','flatMap','sequelize','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','push','SELECT','every','TeamId','compact','value','isEmpty','removeAgents','addAgents','spread','isArray','userOpenchannelQueue:remove','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','OpenchannelQueues','UserProfileResource','end','name','send','index','map','OpenchannelQueue','rawAttributes','type','key','where','include','query','rows','show','params','keys','filters','intersection','model','attributes','fields','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserOpenchannelQueue','order','sort','filter','merge','options','findAll','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','format','%s/%s','SIP'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8673,0x117));var _0x3867=function(_0x278b17,_0x5c2384){_0x278b17=_0x278b17-0x0;var _0x2e9822=_0x8673[_0x278b17];return _0x2e9822;};'use strict';var BPromise=require(_0x3867('0x0'));var util=require(_0x3867('0x1'));var _=require(_0x3867('0x2'));var squel=require(_0x3867('0x3'));var Redis=require(_0x3867('0x4'));var qs=require(_0x3867('0x5'));var logger=require(_0x3867('0x6'))(_0x3867('0x7'));var config=require(_0x3867('0x8'));var db=require(_0x3867('0x9'))['db'];config[_0x3867('0xa')]=_[_0x3867('0xb')](config[_0x3867('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x3867('0xc'))(new Redis(config[_0x3867('0xa')]));require('./openchannelQueue.socket')['register'](socket);function respondWithStatusCode(_0x4a9718,_0x324a6b){_0x324a6b=_0x324a6b||0xcc;return function(_0x286e1d){if(_0x286e1d){return _0x4a9718['sendStatus'](_0x324a6b);}return _0x4a9718['status'](_0x324a6b)['end']();};}function respondWithResult(_0x3e745d,_0x37afcf){_0x37afcf=_0x37afcf||0xc8;return function(_0x455d25){if(_0x455d25){return _0x3e745d[_0x3867('0xd')](_0x37afcf)[_0x3867('0xe')](_0x455d25);}};}function respondWithFilteredResult(_0xbd314f,_0x2e0a10){return function(_0x4287ce){if(_0x4287ce){var _0x28e984=typeof _0x2e0a10[_0x3867('0xf')]===_0x3867('0x10')&&typeof _0x2e0a10[_0x3867('0x11')]===_0x3867('0x10');var _0x124df4=_0x4287ce[_0x3867('0x12')];var _0x25c244=_0x28e984?0x0:_0x2e0a10[_0x3867('0xf')];var _0x29cba3=_0x28e984?_0x4287ce[_0x3867('0x12')]:_0x2e0a10[_0x3867('0xf')]+_0x2e0a10[_0x3867('0x11')];var _0x46e716;if(_0x29cba3>=_0x124df4){_0x29cba3=_0x124df4;_0x46e716=0xc8;}else{_0x46e716=0xce;}_0xbd314f[_0x3867('0xd')](_0x46e716);return _0xbd314f[_0x3867('0x13')](_0x3867('0x14'),_0x25c244+'-'+_0x29cba3+'/'+_0x124df4)['json'](_0x4287ce);}return null;};}function saveUpdates(_0x12c834){return function(_0x421543){if(_0x421543){return _0x421543[_0x3867('0x15')](_0x12c834)[_0x3867('0x16')](function(_0x9b3648){return _0x9b3648;});}return null;};}function removeEntity(_0x5e9b36){return function(_0x3f4ed2){if(_0x3f4ed2){return _0x3f4ed2[_0x3867('0x17')]()[_0x3867('0x16')](function(){var _0x1bdfa1=_0x3f4ed2[_0x3867('0x18')]({'plain':!![]});var _0x1a1376=_0x3867('0x19');return db[_0x3867('0x1a')][_0x3867('0x17')]({'where':{'type':_0x1a1376,'resourceId':_0x1bdfa1['id']}})['then'](function(){return _0x3f4ed2;});})[_0x3867('0x16')](function(){_0x5e9b36[_0x3867('0xd')](0xcc)[_0x3867('0x1b')]();});}};}function handleEntityNotFound(_0x37515e){return function(_0x38bda6){if(!_0x38bda6){_0x37515e['sendStatus'](0x194);}return _0x38bda6;};}function handleError(_0x5bb7c0,_0x25ccec){_0x25ccec=_0x25ccec||0x1f4;return function(_0x296286){logger['error'](_0x296286['stack']);if(_0x296286[_0x3867('0x1c')]){delete _0x296286[_0x3867('0x1c')];}_0x5bb7c0[_0x3867('0xd')](_0x25ccec)[_0x3867('0x1d')](_0x296286);};}exports[_0x3867('0x1e')]=function(_0x5f3547,_0x404966){var _0x5e0d58={};var _0x51eb2a={'count':0x0,'rows':[]};var _0x3daae4=_[_0x3867('0x1f')](db[_0x3867('0x20')][_0x3867('0x21')],function(_0x2ec7e4){return{'name':_0x2ec7e4['fieldName'],'type':_0x2ec7e4[_0x3867('0x22')][_0x3867('0x23')]};});_0x5e0d58=qs['getOptions'](_0x3daae4,_0x5f3547);var _0x2909a2={'where':_0x5e0d58[_0x3867('0x24')]};return db[_0x3867('0x20')][_0x3867('0x12')](_0x2909a2)[_0x3867('0x16')](function(_0x465873){_0x51eb2a[_0x3867('0x12')]=_0x465873;_0x5e0d58[_0x3867('0x25')]=qs[_0x3867('0x25')](_0x5f3547[_0x3867('0x26')]);return db[_0x3867('0x20')]['findAll'](_0x5e0d58);})[_0x3867('0x16')](function(_0x2f2cbd){_0x51eb2a[_0x3867('0x27')]=_0x2f2cbd;return _0x51eb2a;})['then'](respondWithFilteredResult(_0x404966,_0x5e0d58))['catch'](handleError(_0x404966,null));};exports[_0x3867('0x28')]=function(_0x44b59c,_0x2887c7){var _0x409364={'raw':!![],'where':{'id':_0x44b59c[_0x3867('0x29')]['id']}},_0x59f19d={};_0x59f19d['model']=_[_0x3867('0x2a')](db[_0x3867('0x20')][_0x3867('0x21')]);_0x59f19d[_0x3867('0x26')]=_[_0x3867('0x2a')](_0x44b59c[_0x3867('0x26')]);_0x59f19d[_0x3867('0x2b')]=_[_0x3867('0x2c')](_0x59f19d[_0x3867('0x2d')],_0x59f19d[_0x3867('0x26')]);_0x409364[_0x3867('0x2e')]=_[_0x3867('0x2c')](_0x59f19d[_0x3867('0x2d')],qs[_0x3867('0x2f')](_0x44b59c[_0x3867('0x26')]['fields']));_0x409364[_0x3867('0x2e')]=_0x409364[_0x3867('0x2e')]['length']?_0x409364['attributes']:_0x59f19d[_0x3867('0x2d')];if(_0x44b59c[_0x3867('0x26')][_0x3867('0x30')]){_0x409364[_0x3867('0x25')]=[{'all':!![]}];}_0x409364=_['merge']({},_0x409364,_0x44b59c['options']);return db['OpenchannelQueue'][_0x3867('0x31')](_0x409364)['then'](handleEntityNotFound(_0x2887c7,null))[_0x3867('0x16')](respondWithResult(_0x2887c7,null))[_0x3867('0x32')](handleError(_0x2887c7,null));};exports[_0x3867('0x33')]=function(_0x35a3a3,_0x142914){return db[_0x3867('0x20')][_0x3867('0x33')](_0x35a3a3[_0x3867('0x34')],{})[_0x3867('0x16')](function(_0x5d832b){var _0x245a2c=_0x35a3a3[_0x3867('0x35')][_0x3867('0x18')]({'plain':!![]});if(!_0x245a2c)throw new Error(_0x3867('0x36'));if(_0x245a2c[_0x3867('0x37')]===_0x3867('0x35')){var _0x4b235c=_0x5d832b[_0x3867('0x18')]({'plain':!![]});var _0x1a427e='OpenchannelQueues';return db['UserProfileSection']['find']({'where':{'name':_0x1a427e,'userProfileId':_0x245a2c[_0x3867('0x38')]},'raw':!![]})[_0x3867('0x16')](function(_0x3b6da5){if(_0x3b6da5&&_0x3b6da5[_0x3867('0x39')]===0x0){return db['UserProfileResource'][_0x3867('0x33')]({'name':_0x4b235c[_0x3867('0x1c')],'resourceId':_0x4b235c['id'],'type':_0x3b6da5[_0x3867('0x1c')],'sectionId':_0x3b6da5['id']},{})[_0x3867('0x16')](function(){return _0x5d832b;});}else{return _0x5d832b;}})['catch'](function(_0x1321ef){logger[_0x3867('0x3a')](_0x3867('0x3b'),_0x1321ef);throw _0x1321ef;});}return _0x5d832b;})[_0x3867('0x16')](respondWithResult(_0x142914,0xc9))[_0x3867('0x32')](handleError(_0x142914,null));};exports[_0x3867('0x15')]=function(_0x2e6ba7,_0x353e58){if(_0x2e6ba7[_0x3867('0x34')]['id']){delete _0x2e6ba7[_0x3867('0x34')]['id'];}return db['OpenchannelQueue'][_0x3867('0x31')]({'where':{'id':_0x2e6ba7[_0x3867('0x29')]['id']}})[_0x3867('0x16')](handleEntityNotFound(_0x353e58,null))[_0x3867('0x16')](saveUpdates(_0x2e6ba7['body'],null))[_0x3867('0x16')](respondWithResult(_0x353e58,null))[_0x3867('0x32')](handleError(_0x353e58,null));};exports[_0x3867('0x17')]=function(_0x558211,_0x3130ac){return db[_0x3867('0x20')]['find']({'where':{'id':_0x558211[_0x3867('0x29')]['id']}})[_0x3867('0x16')](handleEntityNotFound(_0x3130ac,null))['then'](removeEntity(_0x3130ac,null))[_0x3867('0x32')](handleError(_0x3130ac,null));};exports[_0x3867('0x3c')]=function(_0x5c4c4c,_0x1a6f1e){return db['OpenchannelQueue']['describe']()[_0x3867('0x16')](respondWithResult(_0x1a6f1e,null))[_0x3867('0x32')](handleError(_0x1a6f1e,null));};exports[_0x3867('0x3d')]=function(_0x18061b,_0x372078){var _0x5d6872={'raw':!![],'where':{}},_0x27d10f={},_0x3962a8;return db[_0x3867('0x20')]['findOne']({'where':{'id':_0x18061b[_0x3867('0x29')]['id']}})['then'](handleEntityNotFound(_0x372078,null))[_0x3867('0x16')](function(_0x22a19e){if(_0x22a19e){_0x3962a8=_0x22a19e[_0x3867('0x18')]({'plain':!![]});_0x27d10f[_0x3867('0x2d')]=_['keys'](db[_0x3867('0x3e')][_0x3867('0x21')]);_0x27d10f[_0x3867('0x26')]=_['keys'](_0x18061b[_0x3867('0x26')]);_0x27d10f[_0x3867('0x2b')]=_[_0x3867('0x2c')](_0x27d10f[_0x3867('0x2d')],_0x27d10f[_0x3867('0x26')]);_0x5d6872[_0x3867('0x2e')]=_[_0x3867('0x2c')](_0x27d10f[_0x3867('0x2d')],qs[_0x3867('0x2f')](_0x18061b[_0x3867('0x26')]['fields']));_0x5d6872[_0x3867('0x2e')]=_0x5d6872['attributes']['length']?_0x5d6872[_0x3867('0x2e')]:_0x27d10f[_0x3867('0x2d')];if(!_0x18061b[_0x3867('0x26')]['hasOwnProperty']('nolimit')){_0x5d6872[_0x3867('0x11')]=qs[_0x3867('0x11')](_0x18061b[_0x3867('0x26')]['limit']);_0x5d6872[_0x3867('0xf')]=qs['offset'](_0x18061b[_0x3867('0x26')]['offset']);}_0x5d6872[_0x3867('0x3f')]=qs[_0x3867('0x40')](_0x18061b[_0x3867('0x26')][_0x3867('0x40')]);_0x5d6872[_0x3867('0x24')]=qs[_0x3867('0x2b')](_['pick'](_0x18061b[_0x3867('0x26')],_0x27d10f[_0x3867('0x2b')]));_0x5d6872[_0x3867('0x24')]['OpenchannelQueueId']=_0x22a19e['id'];if(_0x18061b[_0x3867('0x26')][_0x3867('0x41')]){_0x5d6872[_0x3867('0x24')]=_[_0x3867('0x42')](_0x5d6872[_0x3867('0x24')],{'$or':_[_0x3867('0x1f')](_0x5d6872[_0x3867('0x2e')],function(_0x431422){var _0x1e4985={};_0x1e4985[_0x431422]={'$like':'%'+_0x18061b['query'][_0x3867('0x41')]+'%'};return _0x1e4985;})});}_0x5d6872=_[_0x3867('0x42')]({},_0x5d6872,_0x18061b[_0x3867('0x43')]);return db[_0x3867('0x3e')][_0x3867('0x44')](_0x5d6872);}})[_0x3867('0x16')](function(_0x42b61d){if(_0x42b61d){return db[_0x3867('0x45')][_0x3867('0x46')]({'where':{'id':_['map'](_0x42b61d,_0x3867('0x47')),'role':_0x3867('0x48')},'attributes':['id',_0x3867('0x1c'),_0x3867('0x49'),_0x3867('0x4a'),'createdAt']});}})[_0x3867('0x16')](function(_0x2c7dc0){if(_0x2c7dc0){return{'count':_0x2c7dc0[_0x3867('0x12')],'rows':_[_0x3867('0x1f')](_0x2c7dc0[_0x3867('0x27')],function(_0x32c6d3){return{'membername':_0x32c6d3[_0x3867('0x1c')],'UserId':_0x32c6d3['id'],'queue_name':_0x3962a8[_0x3867('0x1c')],'OpenchannelQueueId':_0x3962a8['id'],'interface':util[_0x3867('0x4b')](_0x3867('0x4c'),_0x3867('0x4d'),_0x32c6d3['name']),'penalty':0x0,'paused':_0x32c6d3[_0x3867('0x49')],'createdAt':_0x32c6d3[_0x3867('0x4e')],'updatedAt':_0x32c6d3[_0x3867('0x4a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3867('0x16')](respondWithFilteredResult(_0x372078,_0x5d6872))[_0x3867('0x32')](handleError(_0x372078,null));};exports['getTeams']=function(_0x4b11e0,_0x357a27){var _0xee5a3a={};var _0x17deb3={};var _0x248fc3;var _0x38b384;return db[_0x3867('0x20')][_0x3867('0x4f')]({'where':{'id':_0x4b11e0[_0x3867('0x29')]['id']}})[_0x3867('0x16')](handleEntityNotFound(_0x357a27,null))['then'](function(_0x5856d2){if(_0x5856d2){_0x248fc3=_0x5856d2;_0x17deb3[_0x3867('0x2d')]=_[_0x3867('0x2a')](db[_0x3867('0x50')][_0x3867('0x21')]);_0x17deb3[_0x3867('0x26')]=_[_0x3867('0x2a')](_0x4b11e0[_0x3867('0x26')]);_0x17deb3[_0x3867('0x2b')]=_['intersection'](_0x17deb3[_0x3867('0x2d')],_0x17deb3[_0x3867('0x26')]);_0xee5a3a['attributes']=_[_0x3867('0x2c')](_0x17deb3[_0x3867('0x2d')],qs[_0x3867('0x2f')](_0x4b11e0[_0x3867('0x26')][_0x3867('0x2f')]));_0xee5a3a[_0x3867('0x2e')]=_0xee5a3a['attributes'][_0x3867('0x51')]?_0xee5a3a[_0x3867('0x2e')]:_0x17deb3[_0x3867('0x2d')];_0xee5a3a['order']=qs[_0x3867('0x40')](_0x4b11e0[_0x3867('0x26')][_0x3867('0x40')]);_0xee5a3a['where']=qs[_0x3867('0x2b')](_[_0x3867('0x52')](_0x4b11e0[_0x3867('0x26')],_0x17deb3[_0x3867('0x2b')]));if(_0x4b11e0[_0x3867('0x26')][_0x3867('0x41')]){_0xee5a3a[_0x3867('0x24')]=_[_0x3867('0x42')](_0xee5a3a['where'],{'$or':_[_0x3867('0x1f')](_0xee5a3a[_0x3867('0x2e')],function(_0x23e2b6){var _0x194964={};_0x194964[_0x23e2b6]={'$like':'%'+_0x4b11e0['query'][_0x3867('0x41')]+'%'};return _0x194964;})});}_0xee5a3a=_[_0x3867('0x42')]({},_0xee5a3a,_0x4b11e0[_0x3867('0x43')]);return _0x248fc3['getTeams'](_0xee5a3a);}})[_0x3867('0x16')](function(_0x5976e0){if(_0x5976e0){_0x38b384=_0x5976e0['length'];if(!_0x4b11e0[_0x3867('0x26')][_0x3867('0x53')](_0x3867('0x54'))){_0xee5a3a[_0x3867('0x11')]=qs[_0x3867('0x11')](_0x4b11e0['query'][_0x3867('0x11')]);_0xee5a3a[_0x3867('0xf')]=qs[_0x3867('0xf')](_0x4b11e0[_0x3867('0x26')]['offset']);}return _0x248fc3[_0x3867('0x55')](_0xee5a3a);}})[_0x3867('0x16')](function(_0x1d5638){if(_0x1d5638){return _0x1d5638?{'count':_0x38b384,'rows':_0x1d5638}:null;}})['then'](respondWithResult(_0x357a27,null))['catch'](handleError(_0x357a27,null));};exports[_0x3867('0x56')]=function(_0x12aad5,_0x404fce){var _0x1eeb8b=_0x12aad5[_0x3867('0x34')][_0x3867('0x57')];return db[_0x3867('0x50')][_0x3867('0x44')]({'where':{'id':_0x1eeb8b},'attributes':['id'],'include':[{'model':db[_0x3867('0x45')],'as':_0x3867('0x58'),'attributes':['id',_0x3867('0x1c'),'online',_0x3867('0x59'),'interface'],'raw':!![]}]})['then'](function(_0x5babe9){if(_0x5babe9){var _0x451240=_[_0x3867('0x5a')](_0x5babe9,function(_0x5f4e0e){var _0x17e66c=_0x5f4e0e['get']({'plain':!![]});return _0x17e66c[_0x3867('0x58')];});return db[_0x3867('0x20')][_0x3867('0x31')]({'where':{'id':_0x12aad5[_0x3867('0x29')]['id']}})['then'](function(_0x1e6578){return db[_0x3867('0x5b')]['transaction'](function(_0x4679ae){return _0x1e6578[_0x3867('0x56')](_0x1eeb8b,{'transaction':_0x4679ae})[_0x3867('0x16')](function(){return BPromise['each'](_0x451240,function(_0x483041){return db[_0x3867('0x3e')][_0x3867('0x5c')]({'where':{'UserId':_0x483041['id'],'OpenchannelQueueId':_0x12aad5[_0x3867('0x29')]['id']},'transaction':_0x4679ae});});})[_0x3867('0x16')](function(){_0x451240[_0x3867('0x5d')](function(_0x47e081){socket[_0x3867('0x5e')](_0x3867('0x5f'),{'UserId':_0x47e081['id'],'OpenchannelQueueId':_0x1e6578['id']});});});});});}})[_0x3867('0x16')](respondWithStatusCode(_0x404fce,null))[_0x3867('0x32')](handleError(_0x404fce,null));};exports[_0x3867('0x60')]=function(_0x504f70,_0x462b5c){return db[_0x3867('0x50')][_0x3867('0x44')]({'where':{'id':_0x504f70['query'][_0x3867('0x57')]},'attributes':['id'],'include':[{'model':db[_0x3867('0x45')],'as':_0x3867('0x58'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x462b5c,null))[_0x3867('0x16')](function(_0x5c5281){var _0x4075c1=_[_0x3867('0x1f')](_0x5c5281,'id');var _0x33c4c6=[];var _0x7a1d59=[];var _0x4d23ad=squel[_0x3867('0x61')]();_0x4d23ad[_0x3867('0x62')](_0x3867('0x63'))['from'](_0x3867('0x64'),'tq')[_0x3867('0x65')](_0x3867('0x66'),'ut',_0x3867('0x67'))['where'](_0x3867('0x68'),_0x504f70[_0x3867('0x29')]['id']);for(var _0x223335=0x0;_0x223335<_0x5c5281[_0x3867('0x51')];_0x223335+=0x1){let _0x3c5d27=_0x5c5281[_0x223335];for(var _0x22c29f=0x0;_0x22c29f<_0x3c5d27[_0x3867('0x58')][_0x3867('0x51')];_0x22c29f+=0x1){let _0x34a0e4=_0x3c5d27[_0x3867('0x58')][_0x22c29f];var _0x413392=_0x4d23ad[_0x3867('0x69')]();_0x413392[_0x3867('0x24')]('ut.UserId\x20=\x20?',_0x34a0e4['id']);_0x7a1d59[_0x3867('0x6a')](db[_0x3867('0x5b')][_0x3867('0x26')](_0x413392['toString'](),{'type':db[_0x3867('0x5b')]['QueryTypes'][_0x3867('0x6b')]})[_0x3867('0x16')](function(_0x253b1b){if(_0x253b1b[_0x3867('0x51')]===0x1){return _0x34a0e4['id'];}else{var _0x18043f=_[_0x3867('0x6c')](_['map'](_0x253b1b,_0x3867('0x6d')),function(_0x17f4c5){return _['includes'](_0x4075c1,_0x17f4c5);});if(_0x18043f){return _0x34a0e4['id'];}}}));}}return BPromise['all'](_0x7a1d59)[_0x3867('0x16')](function(_0x2f827a){_0x33c4c6=_(_0x33c4c6)['union'](_0x2f827a)[_0x3867('0x6e')]()[_0x3867('0x6f')]();return db[_0x3867('0x20')][_0x3867('0x31')]({'where':{'id':_0x504f70[_0x3867('0x29')]['id']}})[_0x3867('0x16')](function(_0xfd1a5e){return db[_0x3867('0x5b')]['transaction'](function(_0x3a9773){return _0xfd1a5e[_0x3867('0x60')](_0x504f70[_0x3867('0x26')][_0x3867('0x57')],{'transaction':_0x3a9773})[_0x3867('0x16')](function(){if(!_[_0x3867('0x70')](_0x33c4c6)){return _0xfd1a5e[_0x3867('0x71')](_0x33c4c6,{'transaction':_0x3a9773});}})['then'](function(){_0x33c4c6[_0x3867('0x5d')](function(_0x34b832){socket[_0x3867('0x5e')]('userOpenchannelQueue:remove',{'UserId':_0x34b832,'OpenchannelQueueId':_0xfd1a5e['id']});});});});});});})[_0x3867('0x16')](respondWithStatusCode(_0x462b5c,null))[_0x3867('0x32')](handleError(_0x462b5c,null));};exports[_0x3867('0x72')]=function(_0x2e0aab,_0x4e020d){return db[_0x3867('0x20')]['find']({'where':{'id':_0x2e0aab[_0x3867('0x29')]['id']}})[_0x3867('0x16')](handleEntityNotFound(_0x4e020d,null))['then'](function(_0x5aed3f){if(_0x5aed3f){return _0x5aed3f['addAgents'](_0x2e0aab['body'][_0x3867('0x57')],_['omit'](_0x2e0aab[_0x3867('0x34')],[_0x3867('0x57'),'id'])||{})[_0x3867('0x73')](function(_0xb5a0bd){for(var _0x8910f0=0x0;_0x8910f0<_0x2e0aab[_0x3867('0x34')]['ids'][_0x3867('0x51')];_0x8910f0+=0x1){socket['emit'](_0x3867('0x5f'),{'UserId':Number(_0x2e0aab['body'][_0x3867('0x57')][_0x8910f0]),'OpenchannelQueueId':Number(_0x2e0aab[_0x3867('0x29')]['id'])});}return _0xb5a0bd;});}})['then'](respondWithResult(_0x4e020d,null))[_0x3867('0x32')](handleError(_0x4e020d,null));};exports['removeAgents']=function(_0x200b55,_0x56021a){return db[_0x3867('0x20')][_0x3867('0x31')]({'where':{'id':_0x200b55[_0x3867('0x29')]['id']}})[_0x3867('0x16')](handleEntityNotFound(_0x56021a,null))[_0x3867('0x16')](function(_0x451729){if(_0x451729){return _0x451729[_0x3867('0x71')](_0x200b55['query']['ids'])[_0x3867('0x16')](function(){if(_[_0x3867('0x74')](_0x200b55[_0x3867('0x26')][_0x3867('0x57')])){for(var _0x326375=0x0;_0x326375<_0x200b55['query'][_0x3867('0x57')][_0x3867('0x51')];_0x326375+=0x1){socket[_0x3867('0x5e')](_0x3867('0x75'),{'UserId':Number(_0x200b55['query']['ids'][_0x326375]),'OpenchannelQueueId':Number(_0x200b55[_0x3867('0x29')]['id'])});}}else{socket[_0x3867('0x5e')](_0x3867('0x75'),{'UserId':Number(_0x200b55['query'][_0x3867('0x57')]),'OpenchannelQueueId':Number(_0x200b55[_0x3867('0x29')]['id'])});}});}})[_0x3867('0x16')](respondWithStatusCode(_0x56021a,null))[_0x3867('0x32')](handleError(_0x56021a,null));};exports[_0x3867('0x76')]=function(_0x313237,_0x47413e){var _0x1da72b={};var _0x1a1f02={};var _0x213f07;var _0x1c3e25;return db['OpenchannelQueue'][_0x3867('0x4f')]({'where':{'id':_0x313237[_0x3867('0x29')]['id']}})[_0x3867('0x16')](handleEntityNotFound(_0x47413e,null))[_0x3867('0x16')](function(_0x2b6a78){if(_0x2b6a78){_0x213f07=_0x2b6a78;_0x1a1f02[_0x3867('0x2d')]=_[_0x3867('0x2a')](db['User'][_0x3867('0x21')]);_0x1a1f02[_0x3867('0x26')]=_[_0x3867('0x2a')](_0x313237[_0x3867('0x26')]);_0x1a1f02[_0x3867('0x2b')]=_[_0x3867('0x2c')](_0x1a1f02[_0x3867('0x2d')],_0x1a1f02[_0x3867('0x26')]);_0x1da72b[_0x3867('0x2e')]=_[_0x3867('0x2c')](_0x1a1f02[_0x3867('0x2d')],qs[_0x3867('0x2f')](_0x313237[_0x3867('0x26')][_0x3867('0x2f')]));_0x1da72b[_0x3867('0x2e')]=_0x1da72b['attributes'][_0x3867('0x51')]?_0x1da72b[_0x3867('0x2e')]:_0x1a1f02['model'];_0x1da72b[_0x3867('0x3f')]=qs['sort'](_0x313237[_0x3867('0x26')][_0x3867('0x40')]);_0x1da72b[_0x3867('0x24')]=qs[_0x3867('0x2b')](_['pick'](_0x313237[_0x3867('0x26')],_0x1a1f02[_0x3867('0x2b')]));if(_0x313237[_0x3867('0x26')][_0x3867('0x41')]){_0x1da72b[_0x3867('0x24')]=_['merge'](_0x1da72b[_0x3867('0x24')],{'$or':_[_0x3867('0x1f')](_0x1da72b[_0x3867('0x2e')],function(_0x127c12){var _0x1df6e4={};_0x1df6e4[_0x127c12]={'$like':'%'+_0x313237['query']['filter']+'%'};return _0x1df6e4;})});}_0x1da72b=_['merge']({},_0x1da72b,_0x313237[_0x3867('0x43')]);return _0x213f07[_0x3867('0x76')](_0x1da72b);}})['then'](function(_0x55c68){if(_0x55c68){_0x1c3e25=_0x55c68[_0x3867('0x51')];if(!_0x313237[_0x3867('0x26')][_0x3867('0x53')](_0x3867('0x54'))){_0x1da72b[_0x3867('0x11')]=qs[_0x3867('0x11')](_0x313237[_0x3867('0x26')][_0x3867('0x11')]);_0x1da72b[_0x3867('0xf')]=qs[_0x3867('0xf')](_0x313237[_0x3867('0x26')][_0x3867('0xf')]);}return _0x213f07[_0x3867('0x76')](_0x1da72b);}})[_0x3867('0x16')](function(_0x5038a4){if(_0x5038a4){return _0x5038a4?{'count':_0x1c3e25,'rows':_0x5038a4}:null;}})[_0x3867('0x16')](respondWithResult(_0x47413e,null))[_0x3867('0x32')](handleError(_0x47413e,null));}; \ No newline at end of file +var _0x29b0=['TeamId','includes','all','union','compact','value','isEmpty','removeAgents','addAgents','omit','isArray','userOpenchannelQueue:remove','getAgents','bluebird','util','squel','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','status','offset','undefined','limit','count','Content-Range','json','update','destroy','then','get','OpenchannelQueues','UserProfileResource','end','sendStatus','stack','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','key','getOptions','where','include','findAll','catch','model','query','filters','intersection','attributes','fields','length','includeAll','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','findOne','keys','UserOpenchannelQueue','hasOwnProperty','nolimit','order','sort','pick','OpenchannelQueueId','filter','options','User','findAndCountAll','agent','updatedAt','rows','format','%s/%s','SIP','openchannelPause','createdAt','Team','getTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','addTeams','forEach','emit','userOpenchannelQueue:save','removeTeams','select','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every'];(function(_0x592748,_0x337c3d){var _0x426338=function(_0x49dcf6){while(--_0x49dcf6){_0x592748['push'](_0x592748['shift']());}};_0x426338(++_0x337c3d);}(_0x29b0,0x107));var _0x029b=function(_0x43518d,_0xf9e0a5){_0x43518d=_0x43518d-0x0;var _0x3cbaaa=_0x29b0[_0x43518d];return _0x3cbaaa;};'use strict';var BPromise=require(_0x029b('0x0'));var util=require(_0x029b('0x1'));var _=require('lodash');var squel=require(_0x029b('0x2'));var Redis=require(_0x029b('0x3'));var qs=require(_0x029b('0x4'));var logger=require(_0x029b('0x5'))('api');var config=require(_0x029b('0x6'));var db=require(_0x029b('0x7'))['db'];config[_0x029b('0x8')]=_[_0x029b('0x9')](config[_0x029b('0x8')],{'host':_0x029b('0xa'),'port':0x18eb});var socket=require(_0x029b('0xb'))(new Redis(config[_0x029b('0x8')]));require(_0x029b('0xc'))[_0x029b('0xd')](socket);function respondWithStatusCode(_0x11432f,_0x565ed5){_0x565ed5=_0x565ed5||0xcc;return function(_0x5ecc2b){if(_0x5ecc2b){return _0x11432f['sendStatus'](_0x565ed5);}return _0x11432f[_0x029b('0xe')](_0x565ed5)['end']();};}function respondWithResult(_0x339046,_0x22ac34){_0x22ac34=_0x22ac34||0xc8;return function(_0x3b8957){if(_0x3b8957){return _0x339046[_0x029b('0xe')](_0x22ac34)['json'](_0x3b8957);}};}function respondWithFilteredResult(_0x37c338,_0x2a6c21){return function(_0x8bd95){if(_0x8bd95){var _0x6b80be=typeof _0x2a6c21[_0x029b('0xf')]===_0x029b('0x10')&&typeof _0x2a6c21[_0x029b('0x11')]===_0x029b('0x10');var _0x488be2=_0x8bd95[_0x029b('0x12')];var _0x4ae617=_0x6b80be?0x0:_0x2a6c21[_0x029b('0xf')];var _0x3cdc65=_0x6b80be?_0x8bd95['count']:_0x2a6c21['offset']+_0x2a6c21[_0x029b('0x11')];var _0x5cb444;if(_0x3cdc65>=_0x488be2){_0x3cdc65=_0x488be2;_0x5cb444=0xc8;}else{_0x5cb444=0xce;}_0x37c338[_0x029b('0xe')](_0x5cb444);return _0x37c338['set'](_0x029b('0x13'),_0x4ae617+'-'+_0x3cdc65+'/'+_0x488be2)[_0x029b('0x14')](_0x8bd95);}return null;};}function saveUpdates(_0x485c58){return function(_0x17813e){if(_0x17813e){return _0x17813e[_0x029b('0x15')](_0x485c58)['then'](function(_0x487e6a){return _0x487e6a;});}return null;};}function removeEntity(_0x31354a){return function(_0xe73570){if(_0xe73570){return _0xe73570[_0x029b('0x16')]()[_0x029b('0x17')](function(){var _0x51a802=_0xe73570[_0x029b('0x18')]({'plain':!![]});var _0xcb8c78=_0x029b('0x19');return db[_0x029b('0x1a')][_0x029b('0x16')]({'where':{'type':_0xcb8c78,'resourceId':_0x51a802['id']}})[_0x029b('0x17')](function(){return _0xe73570;});})[_0x029b('0x17')](function(){_0x31354a[_0x029b('0xe')](0xcc)[_0x029b('0x1b')]();});}};}function handleEntityNotFound(_0x29393d){return function(_0x5d3b9c){if(!_0x5d3b9c){_0x29393d[_0x029b('0x1c')](0x194);}return _0x5d3b9c;};}function handleError(_0x3ee273,_0x38430a){_0x38430a=_0x38430a||0x1f4;return function(_0x4af801){logger['error'](_0x4af801[_0x029b('0x1d')]);if(_0x4af801[_0x029b('0x1e')]){delete _0x4af801[_0x029b('0x1e')];}_0x3ee273[_0x029b('0xe')](_0x38430a)[_0x029b('0x1f')](_0x4af801);};}exports[_0x029b('0x20')]=function(_0x495b93,_0x4854dd){var _0x3008d={};var _0x22bec4={'count':0x0,'rows':[]};var _0x24198e=_[_0x029b('0x21')](db[_0x029b('0x22')][_0x029b('0x23')],function(_0x4be1f0){return{'name':_0x4be1f0[_0x029b('0x24')],'type':_0x4be1f0['type'][_0x029b('0x25')]};});_0x3008d=qs[_0x029b('0x26')](_0x24198e,_0x495b93);var _0x129620={'where':_0x3008d[_0x029b('0x27')]};return db[_0x029b('0x22')][_0x029b('0x12')](_0x129620)[_0x029b('0x17')](function(_0x5029fd){_0x22bec4['count']=_0x5029fd;_0x3008d['include']=qs[_0x029b('0x28')](_0x495b93['query']);return db[_0x029b('0x22')][_0x029b('0x29')](_0x3008d);})[_0x029b('0x17')](function(_0x1011f7){_0x22bec4['rows']=_0x1011f7;return _0x22bec4;})[_0x029b('0x17')](respondWithFilteredResult(_0x4854dd,_0x3008d))[_0x029b('0x2a')](handleError(_0x4854dd,null));};exports['show']=function(_0x5c88a8,_0x3a64d1){var _0x14d052={'raw':!![],'where':{'id':_0x5c88a8['params']['id']}},_0x4560d0={};_0x4560d0[_0x029b('0x2b')]=_['keys'](db[_0x029b('0x22')][_0x029b('0x23')]);_0x4560d0[_0x029b('0x2c')]=_['keys'](_0x5c88a8['query']);_0x4560d0[_0x029b('0x2d')]=_[_0x029b('0x2e')](_0x4560d0[_0x029b('0x2b')],_0x4560d0[_0x029b('0x2c')]);_0x14d052[_0x029b('0x2f')]=_[_0x029b('0x2e')](_0x4560d0[_0x029b('0x2b')],qs[_0x029b('0x30')](_0x5c88a8['query'][_0x029b('0x30')]));_0x14d052['attributes']=_0x14d052[_0x029b('0x2f')][_0x029b('0x31')]?_0x14d052[_0x029b('0x2f')]:_0x4560d0[_0x029b('0x2b')];if(_0x5c88a8[_0x029b('0x2c')][_0x029b('0x32')]){_0x14d052['include']=[{'all':!![]}];}_0x14d052=_[_0x029b('0x33')]({},_0x14d052,_0x5c88a8['options']);return db[_0x029b('0x22')]['find'](_0x14d052)['then'](handleEntityNotFound(_0x3a64d1,null))[_0x029b('0x17')](respondWithResult(_0x3a64d1,null))[_0x029b('0x2a')](handleError(_0x3a64d1,null));};exports[_0x029b('0x34')]=function(_0x2900be,_0x591413){return db['OpenchannelQueue']['create'](_0x2900be[_0x029b('0x35')],{})['then'](function(_0x2cd5af){var _0x3fe26b=_0x2900be[_0x029b('0x36')][_0x029b('0x18')]({'plain':!![]});if(!_0x3fe26b)throw new Error(_0x029b('0x37'));if(_0x3fe26b[_0x029b('0x38')]===_0x029b('0x36')){var _0x13e44c=_0x2cd5af[_0x029b('0x18')]({'plain':!![]});var _0x58a6ae='OpenchannelQueues';return db[_0x029b('0x39')][_0x029b('0x3a')]({'where':{'name':_0x58a6ae,'userProfileId':_0x3fe26b[_0x029b('0x3b')]},'raw':!![]})[_0x029b('0x17')](function(_0x301ce1){if(_0x301ce1&&_0x301ce1['autoAssociation']===0x0){return db[_0x029b('0x1a')][_0x029b('0x34')]({'name':_0x13e44c[_0x029b('0x1e')],'resourceId':_0x13e44c['id'],'type':_0x301ce1[_0x029b('0x1e')],'sectionId':_0x301ce1['id']},{})['then'](function(){return _0x2cd5af;});}else{return _0x2cd5af;}})[_0x029b('0x2a')](function(_0x23ec1e){logger[_0x029b('0x3c')](_0x029b('0x3d'),_0x23ec1e);throw _0x23ec1e;});}return _0x2cd5af;})[_0x029b('0x17')](respondWithResult(_0x591413,0xc9))[_0x029b('0x2a')](handleError(_0x591413,null));};exports['update']=function(_0x45eed1,_0x1dfdd7){if(_0x45eed1[_0x029b('0x35')]['id']){delete _0x45eed1[_0x029b('0x35')]['id'];}return db[_0x029b('0x22')][_0x029b('0x3a')]({'where':{'id':_0x45eed1[_0x029b('0x3e')]['id']}})[_0x029b('0x17')](handleEntityNotFound(_0x1dfdd7,null))[_0x029b('0x17')](saveUpdates(_0x45eed1[_0x029b('0x35')],null))[_0x029b('0x17')](respondWithResult(_0x1dfdd7,null))['catch'](handleError(_0x1dfdd7,null));};exports[_0x029b('0x16')]=function(_0x830629,_0x4fec77){return db[_0x029b('0x22')][_0x029b('0x3a')]({'where':{'id':_0x830629[_0x029b('0x3e')]['id']}})[_0x029b('0x17')](handleEntityNotFound(_0x4fec77,null))[_0x029b('0x17')](removeEntity(_0x4fec77,null))[_0x029b('0x2a')](handleError(_0x4fec77,null));};exports[_0x029b('0x3f')]=function(_0x3b6c3b,_0x47b6aa){return db[_0x029b('0x22')][_0x029b('0x3f')]()[_0x029b('0x17')](respondWithResult(_0x47b6aa,null))[_0x029b('0x2a')](handleError(_0x47b6aa,null));};exports['getMembers']=function(_0x26a126,_0x120955){var _0x20a0d4={'raw':!![],'where':{}},_0x525ad6={},_0x59de36;return db[_0x029b('0x22')][_0x029b('0x40')]({'where':{'id':_0x26a126[_0x029b('0x3e')]['id']}})[_0x029b('0x17')](handleEntityNotFound(_0x120955,null))[_0x029b('0x17')](function(_0x49e60c){if(_0x49e60c){_0x59de36=_0x49e60c['get']({'plain':!![]});_0x525ad6[_0x029b('0x2b')]=_[_0x029b('0x41')](db[_0x029b('0x42')]['rawAttributes']);_0x525ad6[_0x029b('0x2c')]=_[_0x029b('0x41')](_0x26a126['query']);_0x525ad6['filters']=_[_0x029b('0x2e')](_0x525ad6[_0x029b('0x2b')],_0x525ad6[_0x029b('0x2c')]);_0x20a0d4[_0x029b('0x2f')]=_[_0x029b('0x2e')](_0x525ad6[_0x029b('0x2b')],qs[_0x029b('0x30')](_0x26a126[_0x029b('0x2c')]['fields']));_0x20a0d4[_0x029b('0x2f')]=_0x20a0d4['attributes'][_0x029b('0x31')]?_0x20a0d4['attributes']:_0x525ad6[_0x029b('0x2b')];if(!_0x26a126[_0x029b('0x2c')][_0x029b('0x43')](_0x029b('0x44'))){_0x20a0d4['limit']=qs[_0x029b('0x11')](_0x26a126[_0x029b('0x2c')][_0x029b('0x11')]);_0x20a0d4[_0x029b('0xf')]=qs[_0x029b('0xf')](_0x26a126['query']['offset']);}_0x20a0d4[_0x029b('0x45')]=qs[_0x029b('0x46')](_0x26a126[_0x029b('0x2c')][_0x029b('0x46')]);_0x20a0d4[_0x029b('0x27')]=qs[_0x029b('0x2d')](_[_0x029b('0x47')](_0x26a126['query'],_0x525ad6[_0x029b('0x2d')]));_0x20a0d4[_0x029b('0x27')][_0x029b('0x48')]=_0x49e60c['id'];if(_0x26a126[_0x029b('0x2c')][_0x029b('0x49')]){_0x20a0d4[_0x029b('0x27')]=_[_0x029b('0x33')](_0x20a0d4[_0x029b('0x27')],{'$or':_['map'](_0x20a0d4[_0x029b('0x2f')],function(_0x83d0be){var _0x4423e0={};_0x4423e0[_0x83d0be]={'$like':'%'+_0x26a126[_0x029b('0x2c')][_0x029b('0x49')]+'%'};return _0x4423e0;})});}_0x20a0d4=_[_0x029b('0x33')]({},_0x20a0d4,_0x26a126[_0x029b('0x4a')]);return db[_0x029b('0x42')]['findAll'](_0x20a0d4);}})['then'](function(_0x4373d4){if(_0x4373d4){return db[_0x029b('0x4b')][_0x029b('0x4c')]({'where':{'id':_[_0x029b('0x21')](_0x4373d4,'UserId'),'role':_0x029b('0x4d')},'attributes':['id',_0x029b('0x1e'),'openchannelPause',_0x029b('0x4e'),'createdAt']});}})[_0x029b('0x17')](function(_0x103aa1){if(_0x103aa1){return{'count':_0x103aa1['count'],'rows':_[_0x029b('0x21')](_0x103aa1[_0x029b('0x4f')],function(_0x1069a7){return{'membername':_0x1069a7[_0x029b('0x1e')],'UserId':_0x1069a7['id'],'queue_name':_0x59de36[_0x029b('0x1e')],'OpenchannelQueueId':_0x59de36['id'],'interface':util[_0x029b('0x50')](_0x029b('0x51'),_0x029b('0x52'),_0x1069a7[_0x029b('0x1e')]),'penalty':0x0,'paused':_0x1069a7[_0x029b('0x53')],'createdAt':_0x1069a7[_0x029b('0x54')],'updatedAt':_0x1069a7[_0x029b('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x029b('0x17')](respondWithFilteredResult(_0x120955,_0x20a0d4))[_0x029b('0x2a')](handleError(_0x120955,null));};exports['getTeams']=function(_0x2416d3,_0x4c260e){var _0x5b1d37={};var _0x5eb1f6={};var _0x79dee;var _0x4f5273;return db[_0x029b('0x22')][_0x029b('0x40')]({'where':{'id':_0x2416d3[_0x029b('0x3e')]['id']}})[_0x029b('0x17')](handleEntityNotFound(_0x4c260e,null))[_0x029b('0x17')](function(_0x29f65d){if(_0x29f65d){_0x79dee=_0x29f65d;_0x5eb1f6[_0x029b('0x2b')]=_[_0x029b('0x41')](db[_0x029b('0x55')][_0x029b('0x23')]);_0x5eb1f6[_0x029b('0x2c')]=_[_0x029b('0x41')](_0x2416d3[_0x029b('0x2c')]);_0x5eb1f6[_0x029b('0x2d')]=_[_0x029b('0x2e')](_0x5eb1f6[_0x029b('0x2b')],_0x5eb1f6[_0x029b('0x2c')]);_0x5b1d37[_0x029b('0x2f')]=_[_0x029b('0x2e')](_0x5eb1f6['model'],qs['fields'](_0x2416d3[_0x029b('0x2c')][_0x029b('0x30')]));_0x5b1d37[_0x029b('0x2f')]=_0x5b1d37[_0x029b('0x2f')]['length']?_0x5b1d37['attributes']:_0x5eb1f6[_0x029b('0x2b')];_0x5b1d37[_0x029b('0x45')]=qs['sort'](_0x2416d3[_0x029b('0x2c')][_0x029b('0x46')]);_0x5b1d37[_0x029b('0x27')]=qs[_0x029b('0x2d')](_[_0x029b('0x47')](_0x2416d3[_0x029b('0x2c')],_0x5eb1f6['filters']));if(_0x2416d3[_0x029b('0x2c')][_0x029b('0x49')]){_0x5b1d37[_0x029b('0x27')]=_[_0x029b('0x33')](_0x5b1d37[_0x029b('0x27')],{'$or':_[_0x029b('0x21')](_0x5b1d37[_0x029b('0x2f')],function(_0x502e76){var _0x45fa1f={};_0x45fa1f[_0x502e76]={'$like':'%'+_0x2416d3[_0x029b('0x2c')][_0x029b('0x49')]+'%'};return _0x45fa1f;})});}_0x5b1d37=_['merge']({},_0x5b1d37,_0x2416d3['options']);return _0x79dee['getTeams'](_0x5b1d37);}})[_0x029b('0x17')](function(_0x51fd47){if(_0x51fd47){_0x4f5273=_0x51fd47['length'];if(!_0x2416d3[_0x029b('0x2c')]['hasOwnProperty']('nolimit')){_0x5b1d37['limit']=qs['limit'](_0x2416d3[_0x029b('0x2c')][_0x029b('0x11')]);_0x5b1d37[_0x029b('0xf')]=qs[_0x029b('0xf')](_0x2416d3[_0x029b('0x2c')][_0x029b('0xf')]);}return _0x79dee[_0x029b('0x56')](_0x5b1d37);}})[_0x029b('0x17')](function(_0x16fb32){if(_0x16fb32){return _0x16fb32?{'count':_0x4f5273,'rows':_0x16fb32}:null;}})[_0x029b('0x17')](respondWithResult(_0x4c260e,null))['catch'](handleError(_0x4c260e,null));};exports['addTeams']=function(_0x2da45d,_0x351c7c){var _0x1c9408=_0x2da45d[_0x029b('0x35')][_0x029b('0x57')];return db[_0x029b('0x55')][_0x029b('0x29')]({'where':{'id':_0x1c9408},'attributes':['id'],'include':[{'model':db[_0x029b('0x4b')],'as':_0x029b('0x58'),'attributes':['id','name',_0x029b('0x59'),_0x029b('0x5a'),'interface'],'raw':!![]}]})[_0x029b('0x17')](function(_0x4e0362){if(_0x4e0362){var _0x562270=_[_0x029b('0x5b')](_0x4e0362,function(_0x26eb3b){var _0x3a5bdf=_0x26eb3b[_0x029b('0x18')]({'plain':!![]});return _0x3a5bdf[_0x029b('0x58')];});return db[_0x029b('0x22')][_0x029b('0x3a')]({'where':{'id':_0x2da45d['params']['id']}})[_0x029b('0x17')](function(_0x558585){return db[_0x029b('0x5c')][_0x029b('0x5d')](function(_0x59dd29){return _0x558585[_0x029b('0x5e')](_0x1c9408,{'transaction':_0x59dd29})['then'](function(){return BPromise['each'](_0x562270,function(_0x26dde3){return db[_0x029b('0x42')]['findOrCreate']({'where':{'UserId':_0x26dde3['id'],'OpenchannelQueueId':_0x2da45d[_0x029b('0x3e')]['id']},'transaction':_0x59dd29});});})['then'](function(){_0x562270[_0x029b('0x5f')](function(_0x12b04a){socket[_0x029b('0x60')](_0x029b('0x61'),{'UserId':_0x12b04a['id'],'OpenchannelQueueId':_0x558585['id']});});});});});}})[_0x029b('0x17')](respondWithStatusCode(_0x351c7c,null))[_0x029b('0x2a')](handleError(_0x351c7c,null));};exports[_0x029b('0x62')]=function(_0x1a9b5f,_0x265c3c){return db[_0x029b('0x55')]['findAll']({'where':{'id':_0x1a9b5f[_0x029b('0x2c')][_0x029b('0x57')]},'attributes':['id'],'include':[{'model':db[_0x029b('0x4b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x029b('0x17')](handleEntityNotFound(_0x265c3c,null))[_0x029b('0x17')](function(_0x27b218){var _0xd37e9c=_[_0x029b('0x21')](_0x27b218,'id');var _0x104672=[];var _0x463532=[];var _0xc1f59f=squel[_0x029b('0x63')]();_0xc1f59f['field'](_0x029b('0x64'))[_0x029b('0x65')](_0x029b('0x66'),'tq')[_0x029b('0x67')](_0x029b('0x68'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x029b('0x27')](_0x029b('0x69'),_0x1a9b5f[_0x029b('0x3e')]['id']);for(var _0x43e0dd=0x0;_0x43e0dd<_0x27b218[_0x029b('0x31')];_0x43e0dd+=0x1){let _0x29d434=_0x27b218[_0x43e0dd];for(var _0x1e2074=0x0;_0x1e2074<_0x29d434[_0x029b('0x58')]['length'];_0x1e2074+=0x1){let _0x536dc4=_0x29d434[_0x029b('0x58')][_0x1e2074];var _0x4f15bd=_0xc1f59f['clone']();_0x4f15bd['where'](_0x029b('0x6a'),_0x536dc4['id']);_0x463532[_0x029b('0x6b')](db['sequelize'][_0x029b('0x2c')](_0x4f15bd[_0x029b('0x6c')](),{'type':db[_0x029b('0x5c')][_0x029b('0x6d')][_0x029b('0x6e')]})[_0x029b('0x17')](function(_0x4e9478){if(_0x4e9478[_0x029b('0x31')]===0x1){return _0x536dc4['id'];}else{var _0x50c112=_[_0x029b('0x6f')](_['map'](_0x4e9478,_0x029b('0x70')),function(_0x3cf5e4){return _[_0x029b('0x71')](_0xd37e9c,_0x3cf5e4);});if(_0x50c112){return _0x536dc4['id'];}}}));}}return BPromise[_0x029b('0x72')](_0x463532)[_0x029b('0x17')](function(_0x529346){_0x104672=_(_0x104672)[_0x029b('0x73')](_0x529346)[_0x029b('0x74')]()[_0x029b('0x75')]();return db[_0x029b('0x22')][_0x029b('0x3a')]({'where':{'id':_0x1a9b5f['params']['id']}})[_0x029b('0x17')](function(_0x25030e){return db[_0x029b('0x5c')][_0x029b('0x5d')](function(_0x12855c){return _0x25030e['removeTeams'](_0x1a9b5f[_0x029b('0x2c')][_0x029b('0x57')],{'transaction':_0x12855c})[_0x029b('0x17')](function(){if(!_[_0x029b('0x76')](_0x104672)){return _0x25030e[_0x029b('0x77')](_0x104672,{'transaction':_0x12855c});}})[_0x029b('0x17')](function(){_0x104672['forEach'](function(_0x5cd060){socket[_0x029b('0x60')]('userOpenchannelQueue:remove',{'UserId':_0x5cd060,'OpenchannelQueueId':_0x25030e['id']});});});});});});})[_0x029b('0x17')](respondWithStatusCode(_0x265c3c,null))[_0x029b('0x2a')](handleError(_0x265c3c,null));};exports[_0x029b('0x78')]=function(_0x55b8f8,_0x218956){return db['OpenchannelQueue'][_0x029b('0x3a')]({'where':{'id':_0x55b8f8[_0x029b('0x3e')]['id']}})['then'](handleEntityNotFound(_0x218956,null))[_0x029b('0x17')](function(_0x1a1d01){if(_0x1a1d01){return _0x1a1d01[_0x029b('0x78')](_0x55b8f8['body'][_0x029b('0x57')],_[_0x029b('0x79')](_0x55b8f8[_0x029b('0x35')],[_0x029b('0x57'),'id'])||{})['spread'](function(_0x22f774){for(var _0x32b82a=0x0;_0x32b82a<_0x55b8f8['body']['ids']['length'];_0x32b82a+=0x1){socket['emit']('userOpenchannelQueue:save',{'UserId':Number(_0x55b8f8[_0x029b('0x35')][_0x029b('0x57')][_0x32b82a]),'OpenchannelQueueId':Number(_0x55b8f8[_0x029b('0x3e')]['id'])});}return _0x22f774;});}})[_0x029b('0x17')](respondWithResult(_0x218956,null))[_0x029b('0x2a')](handleError(_0x218956,null));};exports[_0x029b('0x77')]=function(_0x3e4d34,_0x36fca5){return db[_0x029b('0x22')][_0x029b('0x3a')]({'where':{'id':_0x3e4d34[_0x029b('0x3e')]['id']}})['then'](handleEntityNotFound(_0x36fca5,null))[_0x029b('0x17')](function(_0xae5d65){if(_0xae5d65){return _0xae5d65[_0x029b('0x77')](_0x3e4d34[_0x029b('0x2c')]['ids'])[_0x029b('0x17')](function(){if(_[_0x029b('0x7a')](_0x3e4d34['query']['ids'])){for(var _0x330b7c=0x0;_0x330b7c<_0x3e4d34[_0x029b('0x2c')]['ids']['length'];_0x330b7c+=0x1){socket['emit'](_0x029b('0x7b'),{'UserId':Number(_0x3e4d34['query'][_0x029b('0x57')][_0x330b7c]),'OpenchannelQueueId':Number(_0x3e4d34[_0x029b('0x3e')]['id'])});}}else{socket['emit'](_0x029b('0x7b'),{'UserId':Number(_0x3e4d34[_0x029b('0x2c')][_0x029b('0x57')]),'OpenchannelQueueId':Number(_0x3e4d34[_0x029b('0x3e')]['id'])});}});}})[_0x029b('0x17')](respondWithStatusCode(_0x36fca5,null))['catch'](handleError(_0x36fca5,null));};exports[_0x029b('0x7c')]=function(_0xb69a4d,_0x2fd4ab){var _0x12e3b1={};var _0x436f87={};var _0x526d1b;var _0x4234bc;return db[_0x029b('0x22')]['findOne']({'where':{'id':_0xb69a4d[_0x029b('0x3e')]['id']}})[_0x029b('0x17')](handleEntityNotFound(_0x2fd4ab,null))['then'](function(_0xc1b673){if(_0xc1b673){_0x526d1b=_0xc1b673;_0x436f87[_0x029b('0x2b')]=_[_0x029b('0x41')](db[_0x029b('0x4b')]['rawAttributes']);_0x436f87[_0x029b('0x2c')]=_[_0x029b('0x41')](_0xb69a4d[_0x029b('0x2c')]);_0x436f87[_0x029b('0x2d')]=_[_0x029b('0x2e')](_0x436f87[_0x029b('0x2b')],_0x436f87[_0x029b('0x2c')]);_0x12e3b1[_0x029b('0x2f')]=_['intersection'](_0x436f87[_0x029b('0x2b')],qs['fields'](_0xb69a4d['query'][_0x029b('0x30')]));_0x12e3b1[_0x029b('0x2f')]=_0x12e3b1[_0x029b('0x2f')]['length']?_0x12e3b1[_0x029b('0x2f')]:_0x436f87['model'];_0x12e3b1[_0x029b('0x45')]=qs[_0x029b('0x46')](_0xb69a4d[_0x029b('0x2c')]['sort']);_0x12e3b1['where']=qs[_0x029b('0x2d')](_[_0x029b('0x47')](_0xb69a4d[_0x029b('0x2c')],_0x436f87[_0x029b('0x2d')]));if(_0xb69a4d[_0x029b('0x2c')]['filter']){_0x12e3b1[_0x029b('0x27')]=_['merge'](_0x12e3b1[_0x029b('0x27')],{'$or':_[_0x029b('0x21')](_0x12e3b1[_0x029b('0x2f')],function(_0x805a3e){var _0x3ee169={};_0x3ee169[_0x805a3e]={'$like':'%'+_0xb69a4d[_0x029b('0x2c')][_0x029b('0x49')]+'%'};return _0x3ee169;})});}_0x12e3b1=_[_0x029b('0x33')]({},_0x12e3b1,_0xb69a4d[_0x029b('0x4a')]);return _0x526d1b['getAgents'](_0x12e3b1);}})[_0x029b('0x17')](function(_0x51eeaf){if(_0x51eeaf){_0x4234bc=_0x51eeaf['length'];if(!_0xb69a4d['query'][_0x029b('0x43')](_0x029b('0x44'))){_0x12e3b1[_0x029b('0x11')]=qs[_0x029b('0x11')](_0xb69a4d['query'][_0x029b('0x11')]);_0x12e3b1[_0x029b('0xf')]=qs[_0x029b('0xf')](_0xb69a4d[_0x029b('0x2c')][_0x029b('0xf')]);}return _0x526d1b[_0x029b('0x7c')](_0x12e3b1);}})[_0x029b('0x17')](function(_0x4a5182){if(_0x4a5182){return _0x4a5182?{'count':_0x4234bc,'rows':_0x4a5182}:null;}})[_0x029b('0x17')](respondWithResult(_0x2fd4ab,null))[_0x029b('0x2a')](handleError(_0x2fd4ab,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 2ca5f67..3ef8a62 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 _0xce15=['emit','hasOwnProperty','hook','events','OpenchannelQueue','setMaxListeners','save','update','remove'];(function(_0xbd94fa,_0x4eaa10){var _0x475184=function(_0x15a739){while(--_0x15a739){_0xbd94fa['push'](_0xbd94fa['shift']());}};_0x475184(++_0x4eaa10);}(_0xce15,0xa5));var _0x5ce1=function(_0x2e71ba,_0x4e04f4){_0x2e71ba=_0x2e71ba-0x0;var _0x4715d4=_0xce15[_0x2e71ba];return _0x4715d4;};'use strict';var EventEmitter=require(_0x5ce1('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0x5ce1('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x5ce1('0x2')](0x0);var events={'afterCreate':_0x5ce1('0x3'),'afterUpdate':_0x5ce1('0x4'),'afterDestroy':_0x5ce1('0x5')};function emitEvent(_0x5a7973){return function(_0x376938,_0x5c9e4f,_0x1e172f){OpenchannelQueueEvents[_0x5ce1('0x6')](_0x5a7973+':'+_0x376938['id'],_0x376938);OpenchannelQueueEvents['emit'](_0x5a7973,_0x376938);_0x1e172f(null);};}for(var e in events){if(events[_0x5ce1('0x7')](e)){var event=events[e];OpenchannelQueue[_0x5ce1('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0x5bb1=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','OpenchannelQueue'];(function(_0x6d685a,_0x1758d1){var _0x34a945=function(_0x423e20){while(--_0x423e20){_0x6d685a['push'](_0x6d685a['shift']());}};_0x34a945(++_0x1758d1);}(_0x5bb1,0xb1));var _0x15bb=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x5bb1[_0x341e0f];return _0x59555a;};'use strict';var EventEmitter=require(_0x15bb('0x0'));var OpenchannelQueue=require(_0x15bb('0x1'))['db'][_0x15bb('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x15bb('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x15bb('0x4'),'afterDestroy':_0x15bb('0x5')};function emitEvent(_0x5adbd0){return function(_0x4228bd,_0x47df70,_0x5570c8){OpenchannelQueueEvents[_0x15bb('0x6')](_0x5adbd0+':'+_0x4228bd['id'],_0x4228bd);OpenchannelQueueEvents[_0x15bb('0x6')](_0x5adbd0,_0x4228bd);_0x5570c8(null);};}for(var e in events){if(events[_0x15bb('0x7')](e)){var event=events[e];OpenchannelQueue[_0x15bb('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index ab705d0..c480b6b 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 _0x3d0f=['OpenchannelQueue','openchannel_queues','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x3d0f,0x10a));var _0xf3d0=function(_0x55fb83,_0x1d3856){_0x55fb83=_0x55fb83-0x0;var _0x59a87a=_0x3d0f[_0x55fb83];return _0x59a87a;};'use strict';var _=require(_0xf3d0('0x0'));var util=require(_0xf3d0('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf3d0('0x2'));var BPromise=require(_0xf3d0('0x3'));var rp=require(_0xf3d0('0x4'));var fs=require('fs');var path=require(_0xf3d0('0x5'));var rimraf=require(_0xf3d0('0x6'));var config=require(_0xf3d0('0x7'));var attributes=require('./openchannelQueue.attributes');module[_0xf3d0('0x8')]=function(_0xe0533d,_0x2cda66){return _0xe0533d['define'](_0xf3d0('0x9'),attributes,{'tableName':_0xf3d0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcc3d=['../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x5f4c29,_0x15c13b){var _0x175069=function(_0x5b5c46){while(--_0x5b5c46){_0x5f4c29['push'](_0x5f4c29['shift']());}};_0x175069(++_0x15c13b);}(_0xcc3d,0xf0));var _0xdcc3=function(_0x4bdb06,_0x274066){_0x4bdb06=_0x4bdb06-0x0;var _0x400c53=_0xcc3d[_0x4bdb06];return _0x400c53;};'use strict';var _=require('lodash');var util=require(_0xdcc3('0x0'));var logger=require(_0xdcc3('0x1'))(_0xdcc3('0x2'));var moment=require('moment');var BPromise=require(_0xdcc3('0x3'));var rp=require(_0xdcc3('0x4'));var fs=require('fs');var path=require(_0xdcc3('0x5'));var rimraf=require(_0xdcc3('0x6'));var config=require(_0xdcc3('0x7'));var attributes=require(_0xdcc3('0x8'));module[_0xdcc3('0x9')]=function(_0x2e6707,_0x174f09){return _0x2e6707[_0xdcc3('0xa')](_0xdcc3('0xb'),attributes,{'tableName':_0xdcc3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index 9ac3a13..094eb8b 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 _0xe699=['then','ShowOpenchannelQueue','find','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','localhost','socket.io-emitter','request','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','options','raw','where','attributes','limit','include','model','map'];(function(_0x504c88,_0x28d52f){var _0x23d152=function(_0x194084){while(--_0x194084){_0x504c88['push'](_0x504c88['shift']());}};_0x23d152(++_0x28d52f);}(_0xe699,0x1bf));var _0x9e69=function(_0x1f9e35,_0x5497e2){_0x1f9e35=_0x1f9e35-0x0;var _0x55fc95=_0xe699[_0x1f9e35];return _0x55fc95;};'use strict';var _=require('lodash');var util=require(_0x9e69('0x0'));var moment=require(_0x9e69('0x1'));var BPromise=require(_0x9e69('0x2'));var rs=require(_0x9e69('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9e69('0x4'))['db'];var utils=require(_0x9e69('0x5'));var logger=require(_0x9e69('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9e69('0x7'));var client=jayson['client'][_0x9e69('0x8')]({'port':0x232a});config[_0x9e69('0x9')]=_['defaults'](config[_0x9e69('0x9')],{'host':_0x9e69('0xa'),'port':0x18eb});var socket=require(_0x9e69('0xb'))(new Redis(config[_0x9e69('0x9')]));require('./openchannelQueue.socket')['register'](socket);function respondWithRpcPromise(_0x389deb,_0xf84c46,_0x39062a){return new BPromise(function(_0x326a85,_0x3fe7aa){return client[_0x9e69('0xc')](_0x389deb,_0x39062a)['then'](function(_0x271a63){logger[_0x9e69('0xd')](_0x9e69('0xe'),_0xf84c46,_0x9e69('0xf'));logger[_0x9e69('0x10')](_0x9e69('0x11'),_0xf84c46,_0x9e69('0xf'),JSON[_0x9e69('0x12')](_0x271a63));if(_0x271a63[_0x9e69('0x13')]){if(_0x271a63[_0x9e69('0x13')][_0x9e69('0x14')]===0x1f4){logger[_0x9e69('0x13')](_0x9e69('0xe'),_0xf84c46,_0x271a63['error'][_0x9e69('0x15')]);return _0x3fe7aa(_0x271a63['error'][_0x9e69('0x15')]);}logger[_0x9e69('0x13')](_0x9e69('0xe'),_0xf84c46,_0x271a63[_0x9e69('0x13')][_0x9e69('0x15')]);return _0x326a85(_0x271a63[_0x9e69('0x13')][_0x9e69('0x15')]);}else{logger[_0x9e69('0xd')]('OpenchannelQueue,\x20%s,\x20%s',_0xf84c46,_0x9e69('0xf'));_0x326a85(_0x271a63[_0x9e69('0x16')][_0x9e69('0x15')]);}})[_0x9e69('0x17')](function(_0x31fa77){logger[_0x9e69('0x13')](_0x9e69('0xe'),_0xf84c46,_0x31fa77);_0x3fe7aa(_0x31fa77);});});}exports[_0x9e69('0x18')]=function(_0x39924e){var _0x1af791=this;return new Promise(function(_0x539865,_0x194f6c){return db[_0x9e69('0x19')]['findAll']({'raw':_0x39924e['options']?_0x39924e[_0x9e69('0x1a')][_0x9e69('0x1b')]===undefined?!![]:![]:!![],'where':_0x39924e[_0x9e69('0x1a')]?_0x39924e[_0x9e69('0x1a')][_0x9e69('0x1c')]||null:null,'attributes':_0x39924e[_0x9e69('0x1a')]?_0x39924e[_0x9e69('0x1a')][_0x9e69('0x1d')]||null:null,'limit':_0x39924e[_0x9e69('0x1a')]?_0x39924e['options'][_0x9e69('0x1e')]||null:null,'include':_0x39924e['options']?_0x39924e['options'][_0x9e69('0x1f')]?_['map'](_0x39924e[_0x9e69('0x1a')][_0x9e69('0x1f')],function(_0x1bdf60){return{'model':db[_0x1bdf60[_0x9e69('0x20')]],'as':_0x1bdf60['as'],'attributes':_0x1bdf60['attributes'],'include':_0x1bdf60[_0x9e69('0x1f')]?_[_0x9e69('0x21')](_0x1bdf60[_0x9e69('0x1f')],function(_0x586a01){return{'model':db[_0x586a01[_0x9e69('0x20')]],'as':_0x586a01['as'],'attributes':_0x586a01[_0x9e69('0x1d')],'include':_0x586a01[_0x9e69('0x1f')]?_[_0x9e69('0x21')](_0x586a01['include'],function(_0x5bf072){return{'model':db[_0x5bf072[_0x9e69('0x20')]],'as':_0x5bf072['as'],'attributes':_0x5bf072['attributes']};}):[]};}):[]};}):[]:[]})[_0x9e69('0x22')](function(_0x44521a){logger[_0x9e69('0xd')](_0x9e69('0x18'),_0x39924e);logger[_0x9e69('0x10')](_0x9e69('0x18'),_0x39924e,JSON[_0x9e69('0x12')](_0x44521a));_0x539865(_0x44521a);})[_0x9e69('0x17')](function(_0x35f2c5){logger[_0x9e69('0x13')](_0x9e69('0x18'),_0x35f2c5[_0x9e69('0x15')],_0x39924e);_0x194f6c(_0x1af791['error'](0x1f4,_0x35f2c5[_0x9e69('0x15')]));});});};exports[_0x9e69('0x23')]=function(_0x3fe323){var _0x54b345=this;return new Promise(function(_0x75b201,_0x3407db){return db[_0x9e69('0x19')][_0x9e69('0x24')]({'raw':_0x3fe323[_0x9e69('0x1a')]?_0x3fe323[_0x9e69('0x1a')][_0x9e69('0x1b')]===undefined?!![]:![]:!![],'where':_0x3fe323[_0x9e69('0x1a')]?_0x3fe323[_0x9e69('0x1a')][_0x9e69('0x1c')]||null:null,'attributes':_0x3fe323['options']?_0x3fe323[_0x9e69('0x1a')]['attributes']||null:null,'include':_0x3fe323[_0x9e69('0x1a')]?_0x3fe323[_0x9e69('0x1a')][_0x9e69('0x1f')]?_[_0x9e69('0x21')](_0x3fe323[_0x9e69('0x1a')][_0x9e69('0x1f')],function(_0x46a539){return{'model':db[_0x46a539[_0x9e69('0x20')]],'as':_0x46a539['as'],'attributes':_0x46a539[_0x9e69('0x1d')],'include':_0x46a539[_0x9e69('0x1f')]?_[_0x9e69('0x21')](_0x46a539['include'],function(_0x56fcb4){return{'model':db[_0x56fcb4[_0x9e69('0x20')]],'as':_0x56fcb4['as'],'attributes':_0x56fcb4[_0x9e69('0x1d')],'include':_0x56fcb4['include']?_['map'](_0x56fcb4[_0x9e69('0x1f')],function(_0x39eaef){return{'model':db[_0x39eaef[_0x9e69('0x20')]],'as':_0x39eaef['as'],'attributes':_0x39eaef['attributes']};}):[]};}):[]};}):[]:[]})[_0x9e69('0x22')](function(_0x49e55a){logger[_0x9e69('0xd')](_0x9e69('0x23'),_0x3fe323);logger['debug'](_0x9e69('0x23'),_0x3fe323,JSON[_0x9e69('0x12')](_0x49e55a));_0x75b201(_0x49e55a);})[_0x9e69('0x17')](function(_0x19846f){logger[_0x9e69('0x13')](_0x9e69('0x23'),_0x19846f['message'],_0x3fe323);_0x3407db(_0x54b345[_0x9e69('0x13')](0x1f4,_0x19846f['message']));});});}; \ No newline at end of file +var _0xbbbb=['redis','defaults','socket.io-emitter','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','findAll','options','raw','where','attributes','limit','include','model','map','GetOpenchannelQueue','ShowOpenchannelQueue','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x4fcf6d,_0x215ca3){var _0x14c399=function(_0x29f3f7){while(--_0x29f3f7){_0x4fcf6d['push'](_0x4fcf6d['shift']());}};_0x14c399(++_0x215ca3);}(_0xbbbb,0x1d4));var _0xbbbb=function(_0x8d8303,_0x2db427){_0x8d8303=_0x8d8303-0x0;var _0x2df1c6=_0xbbbb[_0x8d8303];return _0x2df1c6;};'use strict';var _=require('lodash');var util=require(_0xbbbb('0x0'));var moment=require(_0xbbbb('0x1'));var BPromise=require(_0xbbbb('0x2'));var rs=require(_0xbbbb('0x3'));var fs=require('fs');var Redis=require(_0xbbbb('0x4'));var db=require(_0xbbbb('0x5'))['db'];var utils=require(_0xbbbb('0x6'));var logger=require(_0xbbbb('0x7'))(_0xbbbb('0x8'));var config=require('../../config/environment');var jayson=require(_0xbbbb('0x9'));var client=jayson[_0xbbbb('0xa')][_0xbbbb('0xb')]({'port':0x232a});config[_0xbbbb('0xc')]=_[_0xbbbb('0xd')](config[_0xbbbb('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xbbbb('0xe'))(new Redis(config['redis']));require('./openchannelQueue.socket')[_0xbbbb('0xf')](socket);function respondWithRpcPromise(_0x2d9c8c,_0x575794,_0x3aca97){return new BPromise(function(_0x5394f2,_0x4961f0){return client[_0xbbbb('0x10')](_0x2d9c8c,_0x3aca97)[_0xbbbb('0x11')](function(_0x2d2452){logger[_0xbbbb('0x12')](_0xbbbb('0x13'),_0x575794,'request\x20sent');logger[_0xbbbb('0x14')](_0xbbbb('0x15'),_0x575794,_0xbbbb('0x16'),JSON[_0xbbbb('0x17')](_0x2d2452));if(_0x2d2452[_0xbbbb('0x18')]){if(_0x2d2452['error'][_0xbbbb('0x19')]===0x1f4){logger[_0xbbbb('0x18')](_0xbbbb('0x13'),_0x575794,_0x2d2452[_0xbbbb('0x18')][_0xbbbb('0x1a')]);return _0x4961f0(_0x2d2452['error'][_0xbbbb('0x1a')]);}logger[_0xbbbb('0x18')]('OpenchannelQueue,\x20%s,\x20%s',_0x575794,_0x2d2452['error'][_0xbbbb('0x1a')]);return _0x5394f2(_0x2d2452[_0xbbbb('0x18')][_0xbbbb('0x1a')]);}else{logger[_0xbbbb('0x12')](_0xbbbb('0x13'),_0x575794,_0xbbbb('0x16'));_0x5394f2(_0x2d2452[_0xbbbb('0x1b')][_0xbbbb('0x1a')]);}})[_0xbbbb('0x1c')](function(_0x54d7c6){logger[_0xbbbb('0x18')]('OpenchannelQueue,\x20%s,\x20%s',_0x575794,_0x54d7c6);_0x4961f0(_0x54d7c6);});});}exports['GetOpenchannelQueue']=function(_0x2c71b5){var _0x2eea45=this;return new Promise(function(_0x1da6ca,_0x2a8194){return db['OpenchannelQueue'][_0xbbbb('0x1d')]({'raw':_0x2c71b5[_0xbbbb('0x1e')]?_0x2c71b5[_0xbbbb('0x1e')][_0xbbbb('0x1f')]===undefined?!![]:![]:!![],'where':_0x2c71b5[_0xbbbb('0x1e')]?_0x2c71b5['options'][_0xbbbb('0x20')]||null:null,'attributes':_0x2c71b5[_0xbbbb('0x1e')]?_0x2c71b5[_0xbbbb('0x1e')][_0xbbbb('0x21')]||null:null,'limit':_0x2c71b5[_0xbbbb('0x1e')]?_0x2c71b5['options'][_0xbbbb('0x22')]||null:null,'include':_0x2c71b5['options']?_0x2c71b5[_0xbbbb('0x1e')][_0xbbbb('0x23')]?_['map'](_0x2c71b5[_0xbbbb('0x1e')]['include'],function(_0x3a2742){return{'model':db[_0x3a2742['model']],'as':_0x3a2742['as'],'attributes':_0x3a2742[_0xbbbb('0x21')],'include':_0x3a2742[_0xbbbb('0x23')]?_['map'](_0x3a2742['include'],function(_0x38ac13){return{'model':db[_0x38ac13[_0xbbbb('0x24')]],'as':_0x38ac13['as'],'attributes':_0x38ac13['attributes'],'include':_0x38ac13[_0xbbbb('0x23')]?_[_0xbbbb('0x25')](_0x38ac13[_0xbbbb('0x23')],function(_0x264219){return{'model':db[_0x264219['model']],'as':_0x264219['as'],'attributes':_0x264219[_0xbbbb('0x21')]};}):[]};}):[]};}):[]:[]})[_0xbbbb('0x11')](function(_0x238a39){logger['info'](_0xbbbb('0x26'),_0x2c71b5);logger['debug'](_0xbbbb('0x26'),_0x2c71b5,JSON[_0xbbbb('0x17')](_0x238a39));_0x1da6ca(_0x238a39);})['catch'](function(_0x180a00){logger[_0xbbbb('0x18')](_0xbbbb('0x26'),_0x180a00[_0xbbbb('0x1a')],_0x2c71b5);_0x2a8194(_0x2eea45[_0xbbbb('0x18')](0x1f4,_0x180a00[_0xbbbb('0x1a')]));});});};exports['ShowOpenchannelQueue']=function(_0x4fec0a){var _0x2c41c6=this;return new Promise(function(_0xa7eddb,_0x4a9aeb){return db['OpenchannelQueue']['find']({'raw':_0x4fec0a[_0xbbbb('0x1e')]?_0x4fec0a['options'][_0xbbbb('0x1f')]===undefined?!![]:![]:!![],'where':_0x4fec0a['options']?_0x4fec0a[_0xbbbb('0x1e')][_0xbbbb('0x20')]||null:null,'attributes':_0x4fec0a[_0xbbbb('0x1e')]?_0x4fec0a[_0xbbbb('0x1e')][_0xbbbb('0x21')]||null:null,'include':_0x4fec0a[_0xbbbb('0x1e')]?_0x4fec0a[_0xbbbb('0x1e')][_0xbbbb('0x23')]?_['map'](_0x4fec0a[_0xbbbb('0x1e')]['include'],function(_0x180219){return{'model':db[_0x180219[_0xbbbb('0x24')]],'as':_0x180219['as'],'attributes':_0x180219[_0xbbbb('0x21')],'include':_0x180219[_0xbbbb('0x23')]?_[_0xbbbb('0x25')](_0x180219[_0xbbbb('0x23')],function(_0x47b0ec){return{'model':db[_0x47b0ec['model']],'as':_0x47b0ec['as'],'attributes':_0x47b0ec[_0xbbbb('0x21')],'include':_0x47b0ec[_0xbbbb('0x23')]?_[_0xbbbb('0x25')](_0x47b0ec[_0xbbbb('0x23')],function(_0x60cd3b){return{'model':db[_0x60cd3b[_0xbbbb('0x24')]],'as':_0x60cd3b['as'],'attributes':_0x60cd3b[_0xbbbb('0x21')]};}):[]};}):[]};}):[]:[]})[_0xbbbb('0x11')](function(_0xb3db2){logger[_0xbbbb('0x12')](_0xbbbb('0x27'),_0x4fec0a);logger[_0xbbbb('0x14')](_0xbbbb('0x27'),_0x4fec0a,JSON['stringify'](_0xb3db2));_0xa7eddb(_0xb3db2);})[_0xbbbb('0x1c')](function(_0x2c1e2e){logger[_0xbbbb('0x18')](_0xbbbb('0x27'),_0x2c1e2e[_0xbbbb('0x1a')],_0x4fec0a);_0x4a9aeb(_0x2c41c6[_0xbbbb('0x18')](0x1f4,_0x2c1e2e[_0xbbbb('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 4e9700f..1d68660 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 _0xd115=['length','save','update','removeListener'];(function(_0x53abe5,_0x33a9e5){var _0xc1c37e=function(_0xd53c6e){while(--_0xd53c6e){_0x53abe5['push'](_0x53abe5['shift']());}};_0xc1c37e(++_0x33a9e5);}(_0xd115,0x195));var _0x5d11=function(_0x31d287,_0x1ea903){_0x31d287=_0x31d287-0x0;var _0x3448e5=_0xd115[_0x31d287];return _0x3448e5;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0x5d11('0x0'),'remove',_0x5d11('0x1')];function createListener(_0x421c39,_0x855c34){return function(_0x22f085){_0x855c34['emit'](_0x421c39,_0x22f085);};}function removeListener(_0x39bfb1,_0x5e692a){return function(){OpenchannelQueueEvents[_0x5d11('0x2')](_0x39bfb1,_0x5e692a);};}exports['register']=function(_0x35a779){for(var _0x128e9f=0x0,_0x2d9021=events[_0x5d11('0x3')];_0x128e9f<_0x2d9021;_0x128e9f++){var _0x39d49f=events[_0x128e9f];var _0x4a0e75=createListener('openchannelQueue:'+_0x39d49f,_0x35a779);OpenchannelQueueEvents['on'](_0x39d49f,_0x4a0e75);}}; \ No newline at end of file +var _0x98b2=['length','save','remove','update','removeListener'];(function(_0x156cfb,_0x430d96){var _0x1609cc=function(_0x2bd6dd){while(--_0x2bd6dd){_0x156cfb['push'](_0x156cfb['shift']());}};_0x1609cc(++_0x430d96);}(_0x98b2,0x1be));var _0x298b=function(_0xe5a274,_0xec90f2){_0xe5a274=_0xe5a274-0x0;var _0x179fd0=_0x98b2[_0xe5a274];return _0x179fd0;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0x298b('0x0'),_0x298b('0x1'),_0x298b('0x2')];function createListener(_0x56df13,_0x10c739){return function(_0x32b6dd){_0x10c739['emit'](_0x56df13,_0x32b6dd);};}function removeListener(_0x3d3e80,_0x83374b){return function(){OpenchannelQueueEvents[_0x298b('0x3')](_0x3d3e80,_0x83374b);};}exports['register']=function(_0x8e8943){for(var _0x5c596b=0x0,_0x418569=events[_0x298b('0x4')];_0x5c596b<_0x418569;_0x5c596b++){var _0x613cd=events[_0x5c596b];var _0x6b1f10=createListener('openchannelQueue:'+_0x613cd,_0x8e8943);OpenchannelQueueEvents['on'](_0x613cd,_0x6b1f10);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 3b8842f..09fc1d4 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 _0x7b95=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','post','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x19212f,_0x2307be){var _0x4fc573=function(_0x55827f){while(--_0x55827f){_0x19212f['push'](_0x19212f['shift']());}};_0x4fc573(++_0x2307be);}(_0x7b95,0xaf));var _0x57b9=function(_0x885fba,_0x32bcda){_0x885fba=_0x885fba-0x0;var _0x5a2c7f=_0x7b95[_0x885fba];return _0x5a2c7f;};'use strict';var multer=require(_0x57b9('0x0'));var util=require(_0x57b9('0x1'));var path=require('path');var timeout=require(_0x57b9('0x2'));var express=require(_0x57b9('0x3'));var router=express[_0x57b9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x57b9('0x5'));var interaction=require(_0x57b9('0x6'));var config=require(_0x57b9('0x7'));var controller=require('./openchannelQueueReport.controller');router[_0x57b9('0x8')]('/',auth['isAuthenticated'](),controller[_0x57b9('0x9')]);router[_0x57b9('0x8')](_0x57b9('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x57b9('0x8')]('/:id',auth[_0x57b9('0xb')](),controller['show']);router[_0x57b9('0xc')]('/',auth[_0x57b9('0xb')](),controller['create']);router['put'](_0x57b9('0xd'),auth[_0x57b9('0xb')](),controller[_0x57b9('0xe')]);router[_0x57b9('0xf')](_0x57b9('0xd'),auth[_0x57b9('0xb')](),controller[_0x57b9('0x10')]);module[_0x57b9('0x11')]=router; \ No newline at end of file +var _0xbb6d=['describe','/:id','show','post','create','put','update','delete','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0xbb6d,0xdb));var _0xdbb6=function(_0x1a669a,_0x40e4cd){_0x1a669a=_0x1a669a-0x0;var _0x4e433a=_0xbb6d[_0x1a669a];return _0x4e433a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xdbb6('0x0'));var timeout=require(_0xdbb6('0x1'));var express=require('express');var router=express[_0xdbb6('0x2')]();var fs_extra=require(_0xdbb6('0x3'));var auth=require(_0xdbb6('0x4'));var interaction=require(_0xdbb6('0x5'));var config=require('../../config/environment');var controller=require('./openchannelQueueReport.controller');router[_0xdbb6('0x6')]('/',auth[_0xdbb6('0x7')](),controller[_0xdbb6('0x8')]);router['get']('/describe',auth[_0xdbb6('0x7')](),controller[_0xdbb6('0x9')]);router[_0xdbb6('0x6')](_0xdbb6('0xa'),auth[_0xdbb6('0x7')](),controller[_0xdbb6('0xb')]);router[_0xdbb6('0xc')]('/',auth['isAuthenticated'](),controller[_0xdbb6('0xd')]);router[_0xdbb6('0xe')]('/:id',auth[_0xdbb6('0x7')](),controller[_0xdbb6('0xf')]);router[_0xdbb6('0x10')](_0xdbb6('0xa'),auth[_0xdbb6('0x7')](),controller[_0xdbb6('0x11')]);module[_0xdbb6('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 2e94b5f..a7ec1ea 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 _0x0223=['moment','sequelize','exports','STRING','DATE'];(function(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0x0223,0xaf));var _0x3022=function(_0x1808b2,_0x35f5a6){_0x1808b2=_0x1808b2-0x0;var _0x498147=_0x0223[_0x1808b2];return _0x498147;};'use strict';var moment=require(_0x3022('0x0'));var Sequelize=require(_0x3022('0x1'));module[_0x3022('0x2')]={'uniqueid':{'type':Sequelize[_0x3022('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x3022('0x4')]},'leaveAt':{'type':Sequelize[_0x3022('0x4')]},'acceptAt':{'type':Sequelize[_0x3022('0x4')]},'exitAt':{'type':Sequelize[_0x3022('0x4')]},'reason':{'type':Sequelize[_0x3022('0x3')]}}; \ No newline at end of file +var _0xb584=['DATE','sequelize','exports','STRING'];(function(_0x3f9498,_0x3a4d31){var _0x748bee=function(_0x34f43f){while(--_0x34f43f){_0x3f9498['push'](_0x3f9498['shift']());}};_0x748bee(++_0x3a4d31);}(_0xb584,0x91));var _0x4b58=function(_0x436115,_0x3c1ad4){_0x436115=_0x436115-0x0;var _0x1f5972=_0xb584[_0x436115];return _0x1f5972;};'use strict';var moment=require('moment');var Sequelize=require(_0x4b58('0x0'));module[_0x4b58('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x4b58('0x2')]},'joinAt':{'type':Sequelize[_0x4b58('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x4b58('0x3')]},'reason':{'type':Sequelize[_0x4b58('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index a8de101..019b079 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 _0xa1a6=['reject','save','then','error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','find','catch','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply'];(function(_0xc7f23c,_0x2be758){var _0x4b4def=function(_0x1b3aab){while(--_0x1b3aab){_0xc7f23c['push'](_0xc7f23c['shift']());}};_0x4b4def(++_0x2be758);}(_0xa1a6,0xc2));var _0x6a1a=function(_0x372515,_0xdd11f){_0x372515=_0x372515-0x0;var _0xa3bf4e=_0xa1a6[_0x372515];return _0xa3bf4e;};'use strict';var emlformat=require(_0x6a1a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6a1a('0x1'));var jsonpatch=require(_0x6a1a('0x2'));var rp=require(_0x6a1a('0x3'));var moment=require(_0x6a1a('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x6a1a('0x5'));var sox=require(_0x6a1a('0x6'));var csv=require(_0x6a1a('0x7'));var ejs=require(_0x6a1a('0x8'));var fs=require('fs');var fs_extra=require(_0x6a1a('0x9'));var _=require(_0x6a1a('0xa'));var squel=require(_0x6a1a('0xb'));var crypto=require(_0x6a1a('0xc'));var jsforce=require(_0x6a1a('0xd'));var deskjs=require(_0x6a1a('0xe'));var toCsv=require(_0x6a1a('0x7'));var querystring=require('querystring');var Papa=require(_0x6a1a('0xf'));var Redis=require(_0x6a1a('0x10'));var authService=require(_0x6a1a('0x11'));var qs=require(_0x6a1a('0x12'));var as=require(_0x6a1a('0x13'));var hardwareService=require(_0x6a1a('0x14'));var logger=require(_0x6a1a('0x15'))(_0x6a1a('0x16'));var utils=require(_0x6a1a('0x17'));var config=require(_0x6a1a('0x18'));var licenseUtil=require(_0x6a1a('0x19'));var db=require(_0x6a1a('0x1a'))['db'];function respondWithStatusCode(_0x8d4d9e,_0x353a3e){_0x353a3e=_0x353a3e||0xcc;return function(_0x33cd66){if(_0x33cd66){return _0x8d4d9e[_0x6a1a('0x1b')](_0x353a3e);}return _0x8d4d9e[_0x6a1a('0x1c')](_0x353a3e)[_0x6a1a('0x1d')]();};}function respondWithResult(_0x31051c,_0x163124){_0x163124=_0x163124||0xc8;return function(_0x768d87){if(_0x768d87){return _0x31051c[_0x6a1a('0x1c')](_0x163124)[_0x6a1a('0x1e')](_0x768d87);}};}function respondWithFilteredResult(_0x2bddea,_0x5c2bad){return function(_0x15c607){if(_0x15c607){var _0x44b5b7=typeof _0x5c2bad[_0x6a1a('0x1f')]===_0x6a1a('0x20')&&typeof _0x5c2bad[_0x6a1a('0x21')]==='undefined';var _0x32080b=_0x15c607['count'];var _0x476042=_0x44b5b7?0x0:_0x5c2bad['offset'];var _0x21ad5c=_0x44b5b7?_0x15c607[_0x6a1a('0x22')]:_0x5c2bad[_0x6a1a('0x1f')]+_0x5c2bad[_0x6a1a('0x21')];var _0x3b1481;if(_0x21ad5c>=_0x32080b){_0x21ad5c=_0x32080b;_0x3b1481=0xc8;}else{_0x3b1481=0xce;}_0x2bddea[_0x6a1a('0x1c')](_0x3b1481);return _0x2bddea['set'](_0x6a1a('0x23'),_0x476042+'-'+_0x21ad5c+'/'+_0x32080b)[_0x6a1a('0x1e')](_0x15c607);}return null;};}function patchUpdates(_0x259937){return function(_0x223f83){try{jsonpatch[_0x6a1a('0x24')](_0x223f83,_0x259937,!![]);}catch(_0x162ae4){return BPromise[_0x6a1a('0x25')](_0x162ae4);}return _0x223f83[_0x6a1a('0x26')]();};}function saveUpdates(_0x14cf4b,_0x4b71b1){return function(_0x23666e){if(_0x23666e){return _0x23666e['update'](_0x14cf4b)[_0x6a1a('0x27')](function(_0x5bc1bc){return _0x5bc1bc;});}return null;};}function removeEntity(_0x1415ab,_0x1fac9d){return function(_0xb23fa){if(_0xb23fa){return _0xb23fa['destroy']()[_0x6a1a('0x27')](function(){_0x1415ab[_0x6a1a('0x1c')](0xcc)[_0x6a1a('0x1d')]();});}};}function handleEntityNotFound(_0xdddc13,_0x49e597){return function(_0x5a3903){if(!_0x5a3903){_0xdddc13['sendStatus'](0x194);}return _0x5a3903;};}function handleError(_0x144ee4,_0x4f6f9e){_0x4f6f9e=_0x4f6f9e||0x1f4;return function(_0x243bed){logger[_0x6a1a('0x28')](_0x243bed[_0x6a1a('0x29')]);if(_0x243bed[_0x6a1a('0x2a')]){delete _0x243bed[_0x6a1a('0x2a')];}_0x144ee4[_0x6a1a('0x1c')](_0x4f6f9e)[_0x6a1a('0x2b')](_0x243bed);};}exports[_0x6a1a('0x2c')]=function(_0x39a7c9,_0x4afde7){var _0x591fc8={},_0x21b5c8={},_0x52e0d1={'count':0x0,'rows':[]};var _0x10cadf=_[_0x6a1a('0x2d')](db[_0x6a1a('0x2e')][_0x6a1a('0x2f')],function(_0x3914e0){return{'name':_0x3914e0['fieldName'],'type':_0x3914e0[_0x6a1a('0x30')]['key']};});_0x21b5c8[_0x6a1a('0x31')]=_[_0x6a1a('0x2d')](_0x10cadf,_0x6a1a('0x2a'));_0x21b5c8[_0x6a1a('0x32')]=_[_0x6a1a('0x33')](_0x39a7c9[_0x6a1a('0x32')]);_0x21b5c8[_0x6a1a('0x34')]=_[_0x6a1a('0x35')](_0x21b5c8[_0x6a1a('0x31')],_0x21b5c8[_0x6a1a('0x32')]);_0x591fc8[_0x6a1a('0x36')]=_[_0x6a1a('0x35')](_0x21b5c8['model'],qs[_0x6a1a('0x37')](_0x39a7c9[_0x6a1a('0x32')][_0x6a1a('0x37')]));_0x591fc8['attributes']=_0x591fc8[_0x6a1a('0x36')][_0x6a1a('0x38')]?_0x591fc8[_0x6a1a('0x36')]:_0x21b5c8[_0x6a1a('0x31')];if(!_0x39a7c9[_0x6a1a('0x32')][_0x6a1a('0x39')]('nolimit')){_0x591fc8[_0x6a1a('0x21')]=qs[_0x6a1a('0x21')](_0x39a7c9['query'][_0x6a1a('0x21')]);_0x591fc8['offset']=qs['offset'](_0x39a7c9['query'][_0x6a1a('0x1f')]);}_0x591fc8[_0x6a1a('0x3a')]=qs['sort'](_0x39a7c9[_0x6a1a('0x32')][_0x6a1a('0x3b')]);_0x591fc8[_0x6a1a('0x3c')]=qs['filters'](_[_0x6a1a('0x3d')](_0x39a7c9[_0x6a1a('0x32')],_0x21b5c8[_0x6a1a('0x34')]),_0x10cadf);if(_0x39a7c9['query'][_0x6a1a('0x3e')]){_0x591fc8[_0x6a1a('0x3c')]=_[_0x6a1a('0x3f')](_0x591fc8[_0x6a1a('0x3c')],{'$or':_['map'](_0x10cadf,function(_0x3e073e){if(_0x3e073e['type']!==_0x6a1a('0x40')){var _0x395320={};_0x395320[_0x3e073e[_0x6a1a('0x2a')]]={'$like':'%'+_0x39a7c9[_0x6a1a('0x32')][_0x6a1a('0x3e')]+'%'};return _0x395320;}})});}_0x591fc8=_[_0x6a1a('0x3f')]({},_0x591fc8,_0x39a7c9[_0x6a1a('0x41')]);var _0x3062cb={'where':_0x591fc8[_0x6a1a('0x3c')]};return db[_0x6a1a('0x2e')][_0x6a1a('0x22')](_0x3062cb)['then'](function(_0x1cb3cb){_0x52e0d1['count']=_0x1cb3cb;if(_0x39a7c9[_0x6a1a('0x32')][_0x6a1a('0x42')]){_0x591fc8['include']=[{'all':!![]}];}return db[_0x6a1a('0x2e')][_0x6a1a('0x43')](_0x591fc8);})[_0x6a1a('0x27')](function(_0x11604d){_0x52e0d1[_0x6a1a('0x44')]=_0x11604d;return _0x52e0d1;})[_0x6a1a('0x27')](respondWithFilteredResult(_0x4afde7,_0x591fc8))['catch'](handleError(_0x4afde7,null));};exports[_0x6a1a('0x45')]=function(_0x566bd1,_0x2bc2ed){var _0x123e43={'raw':!![],'where':{'id':_0x566bd1[_0x6a1a('0x46')]['id']}},_0x5c6363={};_0x5c6363[_0x6a1a('0x31')]=_[_0x6a1a('0x33')](db[_0x6a1a('0x2e')]['rawAttributes']);_0x5c6363[_0x6a1a('0x32')]=_[_0x6a1a('0x33')](_0x566bd1[_0x6a1a('0x32')]);_0x5c6363[_0x6a1a('0x34')]=_['intersection'](_0x5c6363['model'],_0x5c6363['query']);_0x123e43['attributes']=_['intersection'](_0x5c6363[_0x6a1a('0x31')],qs['fields'](_0x566bd1['query'][_0x6a1a('0x37')]));_0x123e43[_0x6a1a('0x36')]=_0x123e43[_0x6a1a('0x36')][_0x6a1a('0x38')]?_0x123e43[_0x6a1a('0x36')]:_0x5c6363['model'];if(_0x566bd1[_0x6a1a('0x32')]['includeAll']){_0x123e43['include']=[{'all':!![]}];}_0x123e43=_[_0x6a1a('0x3f')]({},_0x123e43,_0x566bd1[_0x6a1a('0x41')]);return db['OpenchannelQueueReport'][_0x6a1a('0x47')](_0x123e43)[_0x6a1a('0x27')](handleEntityNotFound(_0x2bc2ed,null))['then'](respondWithResult(_0x2bc2ed,null))[_0x6a1a('0x48')](handleError(_0x2bc2ed,null));};exports[_0x6a1a('0x49')]=function(_0x233f0c,_0x44b083){return db[_0x6a1a('0x2e')][_0x6a1a('0x49')](_0x233f0c[_0x6a1a('0x4a')],{})[_0x6a1a('0x27')](respondWithResult(_0x44b083,0xc9))[_0x6a1a('0x48')](handleError(_0x44b083,null));};exports['update']=function(_0x44b96a,_0xc97a8c){if(_0x44b96a[_0x6a1a('0x4a')]['id']){delete _0x44b96a[_0x6a1a('0x4a')]['id'];}return db['OpenchannelQueueReport'][_0x6a1a('0x47')]({'where':{'id':_0x44b96a[_0x6a1a('0x46')]['id']}})[_0x6a1a('0x27')](handleEntityNotFound(_0xc97a8c,null))['then'](saveUpdates(_0x44b96a[_0x6a1a('0x4a')],null))[_0x6a1a('0x27')](respondWithResult(_0xc97a8c,null))[_0x6a1a('0x48')](handleError(_0xc97a8c,null));};exports[_0x6a1a('0x4b')]=function(_0x2e4ceb,_0x4f4f02){return db[_0x6a1a('0x2e')][_0x6a1a('0x47')]({'where':{'id':_0x2e4ceb[_0x6a1a('0x46')]['id']}})[_0x6a1a('0x27')](handleEntityNotFound(_0x4f4f02,null))[_0x6a1a('0x27')](removeEntity(_0x4f4f02,null))[_0x6a1a('0x48')](handleError(_0x4f4f02,null));};exports['describe']=function(_0x398157,_0x4d6594){return db['OpenchannelQueueReport'][_0x6a1a('0x4c')]()[_0x6a1a('0x27')](respondWithResult(_0x4d6594,null))['catch'](handleError(_0x4d6594,null));}; \ No newline at end of file +var _0xf979=['../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','fields','order','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','length','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util'];(function(_0x502bdd,_0x5d4087){var _0x4811f1=function(_0x1cfb4f){while(--_0x1cfb4f){_0x502bdd['push'](_0x502bdd['shift']());}};_0x4811f1(++_0x5d4087);}(_0xf979,0x77));var _0x9f97=function(_0x27a705,_0x59225c){_0x27a705=_0x27a705-0x0;var _0x5f31be=_0xf979[_0x27a705];return _0x5f31be;};'use strict';var emlformat=require(_0x9f97('0x0'));var rimraf=require(_0x9f97('0x1'));var zipdir=require(_0x9f97('0x2'));var jsonpatch=require(_0x9f97('0x3'));var rp=require(_0x9f97('0x4'));var moment=require('moment');var BPromise=require(_0x9f97('0x5'));var Mustache=require(_0x9f97('0x6'));var util=require(_0x9f97('0x7'));var path=require(_0x9f97('0x8'));var sox=require(_0x9f97('0x9'));var csv=require(_0x9f97('0xa'));var ejs=require(_0x9f97('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9f97('0xc'));var deskjs=require(_0x9f97('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9f97('0xe'));var Papa=require(_0x9f97('0xf'));var Redis=require('ioredis');var authService=require(_0x9f97('0x10'));var qs=require(_0x9f97('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9f97('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x9f97('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x9f97('0x14'));var db=require(_0x9f97('0x15'))['db'];function respondWithStatusCode(_0x5b3e68,_0x2a8792){_0x2a8792=_0x2a8792||0xcc;return function(_0xe4f338){if(_0xe4f338){return _0x5b3e68[_0x9f97('0x16')](_0x2a8792);}return _0x5b3e68[_0x9f97('0x17')](_0x2a8792)['end']();};}function respondWithResult(_0x2e35ed,_0x47e771){_0x47e771=_0x47e771||0xc8;return function(_0x500ec6){if(_0x500ec6){return _0x2e35ed['status'](_0x47e771)[_0x9f97('0x18')](_0x500ec6);}};}function respondWithFilteredResult(_0x714bd2,_0x821d34){return function(_0x2261e6){if(_0x2261e6){var _0x103172=typeof _0x821d34[_0x9f97('0x19')]===_0x9f97('0x1a')&&typeof _0x821d34[_0x9f97('0x1b')]===_0x9f97('0x1a');var _0x4ad855=_0x2261e6[_0x9f97('0x1c')];var _0x12ad11=_0x103172?0x0:_0x821d34[_0x9f97('0x19')];var _0x3c53ea=_0x103172?_0x2261e6[_0x9f97('0x1c')]:_0x821d34[_0x9f97('0x19')]+_0x821d34[_0x9f97('0x1b')];var _0x1c9ace;if(_0x3c53ea>=_0x4ad855){_0x3c53ea=_0x4ad855;_0x1c9ace=0xc8;}else{_0x1c9ace=0xce;}_0x714bd2[_0x9f97('0x17')](_0x1c9ace);return _0x714bd2['set'](_0x9f97('0x1d'),_0x12ad11+'-'+_0x3c53ea+'/'+_0x4ad855)[_0x9f97('0x18')](_0x2261e6);}return null;};}function patchUpdates(_0x2de87a){return function(_0x481beb){try{jsonpatch[_0x9f97('0x1e')](_0x481beb,_0x2de87a,!![]);}catch(_0x1e3a6e){return BPromise[_0x9f97('0x1f')](_0x1e3a6e);}return _0x481beb[_0x9f97('0x20')]();};}function saveUpdates(_0x1f16b3,_0xf66f2b){return function(_0x513f2d){if(_0x513f2d){return _0x513f2d[_0x9f97('0x21')](_0x1f16b3)['then'](function(_0x2b2380){return _0x2b2380;});}return null;};}function removeEntity(_0x11b532,_0x52114f){return function(_0x9d202b){if(_0x9d202b){return _0x9d202b[_0x9f97('0x22')]()[_0x9f97('0x23')](function(){_0x11b532[_0x9f97('0x17')](0xcc)[_0x9f97('0x24')]();});}};}function handleEntityNotFound(_0x4066aa,_0x1dba69){return function(_0x341313){if(!_0x341313){_0x4066aa[_0x9f97('0x16')](0x194);}return _0x341313;};}function handleError(_0x59009d,_0x1a39c0){_0x1a39c0=_0x1a39c0||0x1f4;return function(_0x2d73e6){logger[_0x9f97('0x25')](_0x2d73e6[_0x9f97('0x26')]);if(_0x2d73e6[_0x9f97('0x27')]){delete _0x2d73e6[_0x9f97('0x27')];}_0x59009d[_0x9f97('0x17')](_0x1a39c0)['send'](_0x2d73e6);};}exports['index']=function(_0x54a25d,_0x1dfc4b){var _0x14f0fe={},_0x43af6b={},_0x103024={'count':0x0,'rows':[]};var _0x9d019d=_[_0x9f97('0x28')](db[_0x9f97('0x29')][_0x9f97('0x2a')],function(_0x550775){return{'name':_0x550775[_0x9f97('0x2b')],'type':_0x550775[_0x9f97('0x2c')][_0x9f97('0x2d')]};});_0x43af6b['model']=_[_0x9f97('0x28')](_0x9d019d,'name');_0x43af6b[_0x9f97('0x2e')]=_[_0x9f97('0x2f')](_0x54a25d[_0x9f97('0x2e')]);_0x43af6b['filters']=_['intersection'](_0x43af6b[_0x9f97('0x30')],_0x43af6b[_0x9f97('0x2e')]);_0x14f0fe[_0x9f97('0x31')]=_[_0x9f97('0x32')](_0x43af6b['model'],qs[_0x9f97('0x33')](_0x54a25d[_0x9f97('0x2e')][_0x9f97('0x33')]));_0x14f0fe['attributes']=_0x14f0fe[_0x9f97('0x31')]['length']?_0x14f0fe[_0x9f97('0x31')]:_0x43af6b[_0x9f97('0x30')];if(!_0x54a25d['query']['hasOwnProperty']('nolimit')){_0x14f0fe[_0x9f97('0x1b')]=qs[_0x9f97('0x1b')](_0x54a25d[_0x9f97('0x2e')]['limit']);_0x14f0fe[_0x9f97('0x19')]=qs[_0x9f97('0x19')](_0x54a25d[_0x9f97('0x2e')][_0x9f97('0x19')]);}_0x14f0fe[_0x9f97('0x34')]=qs['sort'](_0x54a25d[_0x9f97('0x2e')]['sort']);_0x14f0fe[_0x9f97('0x35')]=qs[_0x9f97('0x36')](_[_0x9f97('0x37')](_0x54a25d[_0x9f97('0x2e')],_0x43af6b[_0x9f97('0x36')]),_0x9d019d);if(_0x54a25d[_0x9f97('0x2e')][_0x9f97('0x38')]){_0x14f0fe[_0x9f97('0x35')]=_[_0x9f97('0x39')](_0x14f0fe[_0x9f97('0x35')],{'$or':_[_0x9f97('0x28')](_0x9d019d,function(_0x3b500c){if(_0x3b500c[_0x9f97('0x2c')]!==_0x9f97('0x3a')){var _0x56bb79={};_0x56bb79[_0x3b500c[_0x9f97('0x27')]]={'$like':'%'+_0x54a25d[_0x9f97('0x2e')][_0x9f97('0x38')]+'%'};return _0x56bb79;}})});}_0x14f0fe=_[_0x9f97('0x39')]({},_0x14f0fe,_0x54a25d[_0x9f97('0x3b')]);var _0x32c4c5={'where':_0x14f0fe[_0x9f97('0x35')]};return db[_0x9f97('0x29')][_0x9f97('0x1c')](_0x32c4c5)[_0x9f97('0x23')](function(_0x4bbc82){_0x103024[_0x9f97('0x1c')]=_0x4bbc82;if(_0x54a25d[_0x9f97('0x2e')][_0x9f97('0x3c')]){_0x14f0fe[_0x9f97('0x3d')]=[{'all':!![]}];}return db[_0x9f97('0x29')]['findAll'](_0x14f0fe);})[_0x9f97('0x23')](function(_0x3977de){_0x103024[_0x9f97('0x3e')]=_0x3977de;return _0x103024;})[_0x9f97('0x23')](respondWithFilteredResult(_0x1dfc4b,_0x14f0fe))[_0x9f97('0x3f')](handleError(_0x1dfc4b,null));};exports[_0x9f97('0x40')]=function(_0x52331b,_0x5d23f4){var _0x409773={'raw':!![],'where':{'id':_0x52331b[_0x9f97('0x41')]['id']}},_0x4b7f91={};_0x4b7f91['model']=_[_0x9f97('0x2f')](db[_0x9f97('0x29')][_0x9f97('0x2a')]);_0x4b7f91[_0x9f97('0x2e')]=_[_0x9f97('0x2f')](_0x52331b[_0x9f97('0x2e')]);_0x4b7f91['filters']=_[_0x9f97('0x32')](_0x4b7f91[_0x9f97('0x30')],_0x4b7f91[_0x9f97('0x2e')]);_0x409773[_0x9f97('0x31')]=_['intersection'](_0x4b7f91[_0x9f97('0x30')],qs['fields'](_0x52331b[_0x9f97('0x2e')][_0x9f97('0x33')]));_0x409773[_0x9f97('0x31')]=_0x409773['attributes'][_0x9f97('0x42')]?_0x409773[_0x9f97('0x31')]:_0x4b7f91['model'];if(_0x52331b['query'][_0x9f97('0x3c')]){_0x409773[_0x9f97('0x3d')]=[{'all':!![]}];}_0x409773=_['merge']({},_0x409773,_0x52331b[_0x9f97('0x3b')]);return db[_0x9f97('0x29')][_0x9f97('0x43')](_0x409773)[_0x9f97('0x23')](handleEntityNotFound(_0x5d23f4,null))[_0x9f97('0x23')](respondWithResult(_0x5d23f4,null))[_0x9f97('0x3f')](handleError(_0x5d23f4,null));};exports['create']=function(_0x5c9d7e,_0x253921){return db[_0x9f97('0x29')]['create'](_0x5c9d7e[_0x9f97('0x44')],{})[_0x9f97('0x23')](respondWithResult(_0x253921,0xc9))[_0x9f97('0x3f')](handleError(_0x253921,null));};exports[_0x9f97('0x21')]=function(_0x28d359,_0x214ba8){if(_0x28d359[_0x9f97('0x44')]['id']){delete _0x28d359[_0x9f97('0x44')]['id'];}return db[_0x9f97('0x29')][_0x9f97('0x43')]({'where':{'id':_0x28d359['params']['id']}})[_0x9f97('0x23')](handleEntityNotFound(_0x214ba8,null))[_0x9f97('0x23')](saveUpdates(_0x28d359[_0x9f97('0x44')],null))[_0x9f97('0x23')](respondWithResult(_0x214ba8,null))[_0x9f97('0x3f')](handleError(_0x214ba8,null));};exports[_0x9f97('0x22')]=function(_0x5e22fe,_0x4025fd){return db[_0x9f97('0x29')][_0x9f97('0x43')]({'where':{'id':_0x5e22fe[_0x9f97('0x41')]['id']}})[_0x9f97('0x23')](handleEntityNotFound(_0x4025fd,null))[_0x9f97('0x23')](removeEntity(_0x4025fd,null))[_0x9f97('0x3f')](handleError(_0x4025fd,null));};exports[_0x9f97('0x45')]=function(_0x4f7dd8,_0x324c86){return db[_0x9f97('0x29')][_0x9f97('0x45')]()[_0x9f97('0x23')](respondWithResult(_0x324c86,null))[_0x9f97('0x3f')](handleError(_0x324c86,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index ac18b7f..338b8a1 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 _0x2ef3=['define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./openchannelQueueReport.attributes','exports'];(function(_0x437118,_0x4119ff){var _0x28b7e9=function(_0xc34b52){while(--_0xc34b52){_0x437118['push'](_0x437118['shift']());}};_0x28b7e9(++_0x4119ff);}(_0x2ef3,0xba));var _0x32ef=function(_0x191bd8,_0x40dd35){_0x191bd8=_0x191bd8-0x0;var _0x2e5e97=_0x2ef3[_0x191bd8];return _0x2e5e97;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var logger=require(_0x32ef('0x2'))(_0x32ef('0x3'));var moment=require(_0x32ef('0x4'));var BPromise=require(_0x32ef('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x32ef('0x6'));var rimraf=require(_0x32ef('0x7'));var config=require('../../config/environment');var attributes=require(_0x32ef('0x8'));module[_0x32ef('0x9')]=function(_0x4c8104,_0x5dfa09){return _0x4c8104[_0x32ef('0xa')](_0x32ef('0xb'),attributes,{'tableName':_0x32ef('0xc'),'paranoid':![],'indexes':[{'name':_0x32ef('0xd'),'fields':[_0x32ef('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe14b=['bluebird','path','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','moment'];(function(_0x2fce8b,_0x348d13){var _0x361848=function(_0xb5e9c7){while(--_0xb5e9c7){_0x2fce8b['push'](_0x2fce8b['shift']());}};_0x361848(++_0x348d13);}(_0xe14b,0x93));var _0xbe14=function(_0x5c03f5,_0x350d89){_0x5c03f5=_0x5c03f5-0x0;var _0x31502a=_0xe14b[_0x5c03f5];return _0x31502a;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index b082104..4b94244 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 _0x3495=['attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','stringify','UpdateOpenchannelQueueReport','update','where'];(function(_0x46a38b,_0x16ffb5){var _0x346e75=function(_0x34f8d0){while(--_0x34f8d0){_0x46a38b['push'](_0x46a38b['shift']());}};_0x346e75(++_0x16ffb5);}(_0x3495,0x1de));var _0x5349=function(_0x21a647,_0x2305bb){_0x21a647=_0x21a647-0x0;var _0x382f22=_0x3495[_0x21a647];return _0x382f22;};'use strict';var _=require(_0x5349('0x0'));var util=require(_0x5349('0x1'));var moment=require(_0x5349('0x2'));var BPromise=require(_0x5349('0x3'));var rs=require(_0x5349('0x4'));var fs=require('fs');var Redis=require(_0x5349('0x5'));var db=require(_0x5349('0x6'))['db'];var utils=require(_0x5349('0x7'));var logger=require(_0x5349('0x8'))('rpc');var config=require(_0x5349('0x9'));var jayson=require(_0x5349('0xa'));var client=jayson['client'][_0x5349('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x538385,_0x6fb5dc,_0x529323){return new BPromise(function(_0x393873,_0x583cee){return client[_0x5349('0xc')](_0x538385,_0x529323)[_0x5349('0xd')](function(_0x22a3d3){logger[_0x5349('0xe')](_0x5349('0xf'),_0x6fb5dc,_0x5349('0x10'));logger[_0x5349('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x6fb5dc,_0x5349('0x10'),JSON['stringify'](_0x22a3d3));if(_0x22a3d3[_0x5349('0x12')]){if(_0x22a3d3[_0x5349('0x12')][_0x5349('0x13')]===0x1f4){logger[_0x5349('0x12')](_0x5349('0xf'),_0x6fb5dc,_0x22a3d3[_0x5349('0x12')][_0x5349('0x14')]);return _0x583cee(_0x22a3d3[_0x5349('0x12')][_0x5349('0x14')]);}logger[_0x5349('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x6fb5dc,_0x22a3d3[_0x5349('0x12')][_0x5349('0x14')]);return _0x393873(_0x22a3d3['error'][_0x5349('0x14')]);}else{logger[_0x5349('0xe')](_0x5349('0xf'),_0x6fb5dc,'request\x20sent');_0x393873(_0x22a3d3['result']['message']);}})[_0x5349('0x15')](function(_0x5c873d){logger[_0x5349('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x6fb5dc,_0x5c873d);_0x583cee(_0x5c873d);});});}exports[_0x5349('0x16')]=function(_0x2c1f1){var _0x1f5747=this;return new Promise(function(_0x132639,_0x4e128c){return db[_0x5349('0x17')][_0x5349('0x18')](_0x2c1f1[_0x5349('0x19')],{'raw':_0x2c1f1[_0x5349('0x1a')]?_0x2c1f1['options'][_0x5349('0x1b')]===undefined?!![]:![]:!![]})[_0x5349('0xd')](function(_0x4f2cb6){logger['info']('CreateOpenchannelQueueReport',_0x2c1f1);logger[_0x5349('0x11')]('CreateOpenchannelQueueReport',_0x2c1f1,JSON[_0x5349('0x1c')](_0x4f2cb6));_0x132639(_0x4f2cb6);})[_0x5349('0x15')](function(_0x164978){logger[_0x5349('0x12')](_0x5349('0x16'),_0x164978[_0x5349('0x14')],_0x2c1f1);_0x4e128c(_0x1f5747[_0x5349('0x12')](0x1f4,_0x164978[_0x5349('0x14')]));});});};exports[_0x5349('0x1d')]=function(_0x34353f){var _0x1a84ce=this;return new Promise(function(_0x52520,_0x57af6c){return db[_0x5349('0x17')][_0x5349('0x1e')](_0x34353f[_0x5349('0x19')],{'raw':_0x34353f['options']?_0x34353f[_0x5349('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34353f[_0x5349('0x1a')]?_0x34353f[_0x5349('0x1a')][_0x5349('0x1f')]||null:null,'attributes':_0x34353f['options']?_0x34353f[_0x5349('0x1a')][_0x5349('0x20')]||null:null,'limit':_0x34353f[_0x5349('0x1a')]?_0x34353f[_0x5349('0x1a')][_0x5349('0x21')]||null:null})[_0x5349('0xd')](function(_0x3b6faa){logger[_0x5349('0xe')](_0x5349('0x1d'),_0x34353f);logger['debug'](_0x5349('0x1d'),_0x34353f,JSON[_0x5349('0x1c')](_0x3b6faa));_0x52520(_0x3b6faa);})['catch'](function(_0x3cad49){logger['error'](_0x5349('0x1d'),_0x3cad49[_0x5349('0x14')],_0x34353f);_0x57af6c(_0x1a84ce[_0x5349('0x12')](0x1f4,_0x3cad49[_0x5349('0x14')]));});});}; \ No newline at end of file +var _0xaa56=['code','message','result','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','options','raw','catch','UpdateOpenchannelQueueReport','body','limit','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x6b69,_0x1055d6){var _0x207ab2=function(_0x3aa0b4){while(--_0x3aa0b4){_0x6b69['push'](_0x6b69['shift']());}};_0x207ab2(++_0x1055d6);}(_0xaa56,0xc6));var _0x6aa5=function(_0x544976,_0x73511f){_0x544976=_0x544976-0x0;var _0x1eca61=_0xaa56[_0x544976];return _0x1eca61;};'use strict';var _=require('lodash');var util=require(_0x6aa5('0x0'));var moment=require(_0x6aa5('0x1'));var BPromise=require(_0x6aa5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6aa5('0x3'));var db=require(_0x6aa5('0x4'))['db'];var utils=require(_0x6aa5('0x5'));var logger=require(_0x6aa5('0x6'))(_0x6aa5('0x7'));var config=require('../../config/environment');var jayson=require(_0x6aa5('0x8'));var client=jayson['client'][_0x6aa5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20f6ba,_0x5764dc,_0x26fbf5){return new BPromise(function(_0x35dbbc,_0x3a77bb){return client[_0x6aa5('0xa')](_0x20f6ba,_0x26fbf5)[_0x6aa5('0xb')](function(_0x3d50a0){logger[_0x6aa5('0xc')](_0x6aa5('0xd'),_0x5764dc,_0x6aa5('0xe'));logger[_0x6aa5('0xf')](_0x6aa5('0x10'),_0x5764dc,_0x6aa5('0xe'),JSON[_0x6aa5('0x11')](_0x3d50a0));if(_0x3d50a0[_0x6aa5('0x12')]){if(_0x3d50a0['error'][_0x6aa5('0x13')]===0x1f4){logger[_0x6aa5('0x12')](_0x6aa5('0xd'),_0x5764dc,_0x3d50a0[_0x6aa5('0x12')]['message']);return _0x3a77bb(_0x3d50a0['error']['message']);}logger[_0x6aa5('0x12')](_0x6aa5('0xd'),_0x5764dc,_0x3d50a0[_0x6aa5('0x12')]['message']);return _0x35dbbc(_0x3d50a0[_0x6aa5('0x12')][_0x6aa5('0x14')]);}else{logger['info'](_0x6aa5('0xd'),_0x5764dc,_0x6aa5('0xe'));_0x35dbbc(_0x3d50a0[_0x6aa5('0x15')][_0x6aa5('0x14')]);}})['catch'](function(_0x5e5951){logger[_0x6aa5('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x5764dc,_0x5e5951);_0x3a77bb(_0x5e5951);});});}exports[_0x6aa5('0x16')]=function(_0xea319d){var _0x5714da=this;return new Promise(function(_0x556494,_0x1444de){return db[_0x6aa5('0x17')][_0x6aa5('0x18')](_0xea319d['body'],{'raw':_0xea319d[_0x6aa5('0x19')]?_0xea319d['options'][_0x6aa5('0x1a')]===undefined?!![]:![]:!![]})[_0x6aa5('0xb')](function(_0x161dc8){logger[_0x6aa5('0xc')]('CreateOpenchannelQueueReport',_0xea319d);logger[_0x6aa5('0xf')](_0x6aa5('0x16'),_0xea319d,JSON[_0x6aa5('0x11')](_0x161dc8));_0x556494(_0x161dc8);})[_0x6aa5('0x1b')](function(_0x16234b){logger['error'](_0x6aa5('0x16'),_0x16234b['message'],_0xea319d);_0x1444de(_0x5714da[_0x6aa5('0x12')](0x1f4,_0x16234b['message']));});});};exports[_0x6aa5('0x1c')]=function(_0x2e347f){var _0x4c13f9=this;return new Promise(function(_0x4b0137,_0x1dc4df){return db[_0x6aa5('0x17')]['update'](_0x2e347f[_0x6aa5('0x1d')],{'raw':_0x2e347f[_0x6aa5('0x19')]?_0x2e347f[_0x6aa5('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e347f[_0x6aa5('0x19')]?_0x2e347f[_0x6aa5('0x19')]['where']||null:null,'attributes':_0x2e347f[_0x6aa5('0x19')]?_0x2e347f['options']['attributes']||null:null,'limit':_0x2e347f[_0x6aa5('0x19')]?_0x2e347f[_0x6aa5('0x19')][_0x6aa5('0x1e')]||null:null})['then'](function(_0x36127c){logger['info'](_0x6aa5('0x1c'),_0x2e347f);logger['debug']('UpdateOpenchannelQueueReport',_0x2e347f,JSON[_0x6aa5('0x11')](_0x36127c));_0x4b0137(_0x36127c);})[_0x6aa5('0x1b')](function(_0x5be5ab){logger[_0x6aa5('0x12')](_0x6aa5('0x1c'),_0x5be5ab[_0x6aa5('0x14')],_0x2e347f);_0x1dc4df(_0x4c13f9[_0x6aa5('0x12')](0x1f4,_0x5be5ab[_0x6aa5('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index ec92af4..7098d7d 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 _0x11a9=['update','delete','destroy','multer','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','describe','show','create','/:id'];(function(_0xb7ccdb,_0x42e36b){var _0x4aa9c3=function(_0x401941){while(--_0x401941){_0xb7ccdb['push'](_0xb7ccdb['shift']());}};_0x4aa9c3(++_0x42e36b);}(_0x11a9,0x120));var _0x911a=function(_0x46ec3f,_0x72fe5e){_0x46ec3f=_0x46ec3f-0x0;var _0x303e71=_0x11a9[_0x46ec3f];return _0x303e71;};'use strict';var multer=require(_0x911a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x911a('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x911a('0x2'));var auth=require(_0x911a('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x911a('0x4'));var controller=require(_0x911a('0x5'));router[_0x911a('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x911a('0x6')]('/describe',auth[_0x911a('0x7')](),controller[_0x911a('0x8')]);router['get']('/:id',auth[_0x911a('0x7')](),controller[_0x911a('0x9')]);router['post']('/',auth[_0x911a('0x7')](),controller[_0x911a('0xa')]);router['put'](_0x911a('0xb'),auth['isAuthenticated'](),controller[_0x911a('0xc')]);router[_0x911a('0xd')](_0x911a('0xb'),auth[_0x911a('0x7')](),controller[_0x911a('0xe')]);module['exports']=router; \ No newline at end of file +var _0x1ad6=['exports','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','./openchannelTransferReport.controller','isAuthenticated','index','get','/describe','/:id','show','create','update','delete','destroy'];(function(_0x413af6,_0x488341){var _0x859ed9=function(_0x44a969){while(--_0x44a969){_0x413af6['push'](_0x413af6['shift']());}};_0x859ed9(++_0x488341);}(_0x1ad6,0x10f));var _0x61ad=function(_0x1face5,_0x40e068){_0x1face5=_0x1face5-0x0;var _0x3fc0f9=_0x1ad6[_0x1face5];return _0x3fc0f9;};'use strict';var multer=require(_0x61ad('0x0'));var util=require(_0x61ad('0x1'));var path=require(_0x61ad('0x2'));var timeout=require(_0x61ad('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x61ad('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x61ad('0x5'));var controller=require(_0x61ad('0x6'));router['get']('/',auth[_0x61ad('0x7')](),controller[_0x61ad('0x8')]);router[_0x61ad('0x9')](_0x61ad('0xa'),auth[_0x61ad('0x7')](),controller['describe']);router['get'](_0x61ad('0xb'),auth[_0x61ad('0x7')](),controller[_0x61ad('0xc')]);router['post']('/',auth[_0x61ad('0x7')](),controller[_0x61ad('0xd')]);router['put'](_0x61ad('0xb'),auth[_0x61ad('0x7')](),controller[_0x61ad('0xe')]);router[_0x61ad('0xf')](_0x61ad('0xb'),auth[_0x61ad('0x7')](),controller[_0x61ad('0x10')]);module[_0x61ad('0x11')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index e308fac..7cd2765 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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x465d12,_0x1b8e5a){var _0x8aa1d3=function(_0x331219){while(--_0x331219){_0x465d12['push'](_0x465d12['shift']());}};_0x8aa1d3(++_0x1b8e5a);}(_0x00bb,0x1d8));var _0xb00b=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x00bb[_0x5ddb1c];return _0x354adc;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file +var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x258919,_0x1754e6){var _0xfbd68b=function(_0x3bc3e9){while(--_0x3bc3e9){_0x258919['push'](_0x258919['shift']());}};_0xfbd68b(++_0x1754e6);}(_0x9bde,0xe1));var _0xe9bd=function(_0x43f840,_0x205c03){_0x43f840=_0x43f840-0x0;var _0xaffb0d=_0x9bde[_0x43f840];return _0xaffb0d;};'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 diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 7a24493..d09412a 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 _0x83b4=['options','OpenchannelTransferReport','includeAll','rows','catch','show','keys','find','create','body','params','destroy','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','sendStatus','error','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL'];(function(_0x3fbecb,_0x29c9e4){var _0x5dc6b8=function(_0x2bbe8a){while(--_0x2bbe8a){_0x3fbecb['push'](_0x3fbecb['shift']());}};_0x5dc6b8(++_0x29c9e4);}(_0x83b4,0x1c9));var _0x483b=function(_0x4f4a16,_0x778220){_0x4f4a16=_0x4f4a16-0x0;var _0x5f20ba=_0x83b4[_0x4f4a16];return _0x5f20ba;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x483b('0x0'));var jsonpatch=require(_0x483b('0x1'));var rp=require(_0x483b('0x2'));var moment=require(_0x483b('0x3'));var BPromise=require(_0x483b('0x4'));var Mustache=require(_0x483b('0x5'));var util=require(_0x483b('0x6'));var path=require(_0x483b('0x7'));var sox=require(_0x483b('0x8'));var csv=require(_0x483b('0x9'));var ejs=require(_0x483b('0xa'));var fs=require('fs');var fs_extra=require(_0x483b('0xb'));var _=require('lodash');var squel=require(_0x483b('0xc'));var crypto=require(_0x483b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x483b('0xe'));var toCsv=require(_0x483b('0x9'));var querystring=require(_0x483b('0xf'));var Papa=require(_0x483b('0x10'));var Redis=require('ioredis');var authService=require(_0x483b('0x11'));var qs=require(_0x483b('0x12'));var as=require(_0x483b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x483b('0x14'));var utils=require('../../config/utils');var config=require(_0x483b('0x15'));var licenseUtil=require(_0x483b('0x16'));var db=require(_0x483b('0x17'))['db'];function respondWithStatusCode(_0x15e4e8,_0x111ea3){_0x111ea3=_0x111ea3||0xcc;return function(_0x508293){if(_0x508293){return _0x15e4e8['sendStatus'](_0x111ea3);}return _0x15e4e8[_0x483b('0x18')](_0x111ea3)[_0x483b('0x19')]();};}function respondWithResult(_0xe01564,_0x6627d2){_0x6627d2=_0x6627d2||0xc8;return function(_0x105097){if(_0x105097){return _0xe01564[_0x483b('0x18')](_0x6627d2)['json'](_0x105097);}};}function respondWithFilteredResult(_0x5f1b03,_0x15e636){return function(_0x1b2ea5){if(_0x1b2ea5){var _0x25d2ff=typeof _0x15e636[_0x483b('0x1a')]===_0x483b('0x1b')&&typeof _0x15e636[_0x483b('0x1c')]===_0x483b('0x1b');var _0x44fdbd=_0x1b2ea5[_0x483b('0x1d')];var _0x161e01=_0x25d2ff?0x0:_0x15e636[_0x483b('0x1a')];var _0x270764=_0x25d2ff?_0x1b2ea5[_0x483b('0x1d')]:_0x15e636[_0x483b('0x1a')]+_0x15e636['limit'];var _0x212be7;if(_0x270764>=_0x44fdbd){_0x270764=_0x44fdbd;_0x212be7=0xc8;}else{_0x212be7=0xce;}_0x5f1b03[_0x483b('0x18')](_0x212be7);return _0x5f1b03[_0x483b('0x1e')](_0x483b('0x1f'),_0x161e01+'-'+_0x270764+'/'+_0x44fdbd)[_0x483b('0x20')](_0x1b2ea5);}return null;};}function patchUpdates(_0x31fe76){return function(_0x16090b){try{jsonpatch['apply'](_0x16090b,_0x31fe76,!![]);}catch(_0x924f28){return BPromise[_0x483b('0x21')](_0x924f28);}return _0x16090b[_0x483b('0x22')]();};}function saveUpdates(_0x475b1c,_0x33712a){return function(_0x184d98){if(_0x184d98){return _0x184d98[_0x483b('0x23')](_0x475b1c)[_0x483b('0x24')](function(_0x1560ab){return _0x1560ab;});}return null;};}function removeEntity(_0x5e2603,_0x259c62){return function(_0x432dd7){if(_0x432dd7){return _0x432dd7['destroy']()[_0x483b('0x24')](function(){_0x5e2603[_0x483b('0x18')](0xcc)[_0x483b('0x19')]();});}};}function handleEntityNotFound(_0x49a4e9,_0x1af080){return function(_0x27e380){if(!_0x27e380){_0x49a4e9[_0x483b('0x25')](0x194);}return _0x27e380;};}function handleError(_0x5d4380,_0x40417f){_0x40417f=_0x40417f||0x1f4;return function(_0x2179df){logger[_0x483b('0x26')](_0x2179df['stack']);if(_0x2179df[_0x483b('0x27')]){delete _0x2179df[_0x483b('0x27')];}_0x5d4380[_0x483b('0x18')](_0x40417f)[_0x483b('0x28')](_0x2179df);};}exports[_0x483b('0x29')]=function(_0x30981f,_0x457db2){var _0x44698f={},_0x2855ec={},_0x546e50={'count':0x0,'rows':[]};var _0x534e2a=_['map'](db['OpenchannelTransferReport'][_0x483b('0x2a')],function(_0x5f1a87){return{'name':_0x5f1a87[_0x483b('0x2b')],'type':_0x5f1a87[_0x483b('0x2c')][_0x483b('0x2d')]};});_0x2855ec[_0x483b('0x2e')]=_[_0x483b('0x2f')](_0x534e2a,_0x483b('0x27'));_0x2855ec[_0x483b('0x30')]=_['keys'](_0x30981f[_0x483b('0x30')]);_0x2855ec[_0x483b('0x31')]=_[_0x483b('0x32')](_0x2855ec[_0x483b('0x2e')],_0x2855ec[_0x483b('0x30')]);_0x44698f[_0x483b('0x33')]=_['intersection'](_0x2855ec['model'],qs[_0x483b('0x34')](_0x30981f[_0x483b('0x30')][_0x483b('0x34')]));_0x44698f[_0x483b('0x33')]=_0x44698f['attributes'][_0x483b('0x35')]?_0x44698f[_0x483b('0x33')]:_0x2855ec['model'];if(!_0x30981f[_0x483b('0x30')][_0x483b('0x36')](_0x483b('0x37'))){_0x44698f[_0x483b('0x1c')]=qs[_0x483b('0x1c')](_0x30981f[_0x483b('0x30')][_0x483b('0x1c')]);_0x44698f['offset']=qs['offset'](_0x30981f[_0x483b('0x30')]['offset']);}_0x44698f[_0x483b('0x38')]=qs[_0x483b('0x39')](_0x30981f[_0x483b('0x30')][_0x483b('0x39')]);_0x44698f['where']=qs[_0x483b('0x31')](_['pick'](_0x30981f[_0x483b('0x30')],_0x2855ec[_0x483b('0x31')]),_0x534e2a);if(_0x30981f['query']['filter']){_0x44698f[_0x483b('0x3a')]=_[_0x483b('0x3b')](_0x44698f['where'],{'$or':_[_0x483b('0x2f')](_0x534e2a,function(_0x36aa50){if(_0x36aa50['type']!==_0x483b('0x3c')){var _0x2da9b5={};_0x2da9b5[_0x36aa50[_0x483b('0x27')]]={'$like':'%'+_0x30981f['query']['filter']+'%'};return _0x2da9b5;}})});}_0x44698f=_[_0x483b('0x3b')]({},_0x44698f,_0x30981f[_0x483b('0x3d')]);var _0x35d023={'where':_0x44698f[_0x483b('0x3a')]};return db[_0x483b('0x3e')][_0x483b('0x1d')](_0x35d023)[_0x483b('0x24')](function(_0x1d0bf5){_0x546e50[_0x483b('0x1d')]=_0x1d0bf5;if(_0x30981f[_0x483b('0x30')][_0x483b('0x3f')]){_0x44698f['include']=[{'all':!![]}];}return db[_0x483b('0x3e')]['findAll'](_0x44698f);})[_0x483b('0x24')](function(_0x332a69){_0x546e50[_0x483b('0x40')]=_0x332a69;return _0x546e50;})[_0x483b('0x24')](respondWithFilteredResult(_0x457db2,_0x44698f))[_0x483b('0x41')](handleError(_0x457db2,null));};exports[_0x483b('0x42')]=function(_0x5233b9,_0x2c5c11){var _0x3cbc17={'raw':!![],'where':{'id':_0x5233b9['params']['id']}},_0x1aa906={};_0x1aa906[_0x483b('0x2e')]=_['keys'](db[_0x483b('0x3e')][_0x483b('0x2a')]);_0x1aa906['query']=_[_0x483b('0x43')](_0x5233b9[_0x483b('0x30')]);_0x1aa906[_0x483b('0x31')]=_[_0x483b('0x32')](_0x1aa906['model'],_0x1aa906[_0x483b('0x30')]);_0x3cbc17['attributes']=_[_0x483b('0x32')](_0x1aa906['model'],qs['fields'](_0x5233b9['query'][_0x483b('0x34')]));_0x3cbc17['attributes']=_0x3cbc17[_0x483b('0x33')][_0x483b('0x35')]?_0x3cbc17[_0x483b('0x33')]:_0x1aa906[_0x483b('0x2e')];if(_0x5233b9[_0x483b('0x30')][_0x483b('0x3f')]){_0x3cbc17['include']=[{'all':!![]}];}_0x3cbc17=_['merge']({},_0x3cbc17,_0x5233b9[_0x483b('0x3d')]);return db[_0x483b('0x3e')][_0x483b('0x44')](_0x3cbc17)[_0x483b('0x24')](handleEntityNotFound(_0x2c5c11,null))[_0x483b('0x24')](respondWithResult(_0x2c5c11,null))[_0x483b('0x41')](handleError(_0x2c5c11,null));};exports[_0x483b('0x45')]=function(_0x2430de,_0x48d824){return db['OpenchannelTransferReport']['create'](_0x2430de['body'],{})[_0x483b('0x24')](respondWithResult(_0x48d824,0xc9))[_0x483b('0x41')](handleError(_0x48d824,null));};exports['update']=function(_0x44a2f3,_0x5c995d){if(_0x44a2f3[_0x483b('0x46')]['id']){delete _0x44a2f3['body']['id'];}return db[_0x483b('0x3e')][_0x483b('0x44')]({'where':{'id':_0x44a2f3[_0x483b('0x47')]['id']}})[_0x483b('0x24')](handleEntityNotFound(_0x5c995d,null))[_0x483b('0x24')](saveUpdates(_0x44a2f3[_0x483b('0x46')],null))[_0x483b('0x24')](respondWithResult(_0x5c995d,null))[_0x483b('0x41')](handleError(_0x5c995d,null));};exports[_0x483b('0x48')]=function(_0x45b4e9,_0x5baa9d){return db[_0x483b('0x3e')][_0x483b('0x44')]({'where':{'id':_0x45b4e9[_0x483b('0x47')]['id']}})[_0x483b('0x24')](handleEntityNotFound(_0x5baa9d,null))[_0x483b('0x24')](removeEntity(_0x5baa9d,null))[_0x483b('0x41')](handleError(_0x5baa9d,null));};exports[_0x483b('0x49')]=function(_0x2cabd3,_0x2f0510){return db[_0x483b('0x3e')]['describe']()[_0x483b('0x24')](respondWithResult(_0x2f0510,null))[_0x483b('0x41')](handleError(_0x2f0510,null));}; \ No newline at end of file +var _0xfed7=['create','update','body','params','describe','rimraf','zip-dir','request-promise','moment','bluebird','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','destroy','end','error','name','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','OpenchannelTransferReport','include','findAll','rows','show','fields','includeAll','find','catch'];(function(_0x58e202,_0x51bc18){var _0x12193e=function(_0x32d41f){while(--_0x32d41f){_0x58e202['push'](_0x58e202['shift']());}};_0x12193e(++_0x51bc18);}(_0xfed7,0xe6));var _0x7fed=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0xfed7[_0x5317b5];return _0x3b7ce2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7fed('0x0'));var zipdir=require(_0x7fed('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7fed('0x2'));var moment=require(_0x7fed('0x3'));var BPromise=require(_0x7fed('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x7fed('0x5'));var ejs=require(_0x7fed('0x6'));var fs=require('fs');var fs_extra=require(_0x7fed('0x7'));var _=require(_0x7fed('0x8'));var squel=require(_0x7fed('0x9'));var crypto=require(_0x7fed('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x7fed('0xb'));var toCsv=require(_0x7fed('0x5'));var querystring=require(_0x7fed('0xc'));var Papa=require(_0x7fed('0xd'));var Redis=require(_0x7fed('0xe'));var authService=require(_0x7fed('0xf'));var qs=require(_0x7fed('0x10'));var as=require(_0x7fed('0x11'));var hardwareService=require(_0x7fed('0x12'));var logger=require(_0x7fed('0x13'))(_0x7fed('0x14'));var utils=require(_0x7fed('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x7fed('0x16'));var db=require(_0x7fed('0x17'))['db'];function respondWithStatusCode(_0x4595ed,_0x41057d){_0x41057d=_0x41057d||0xcc;return function(_0x423e9d){if(_0x423e9d){return _0x4595ed[_0x7fed('0x18')](_0x41057d);}return _0x4595ed[_0x7fed('0x19')](_0x41057d)['end']();};}function respondWithResult(_0x3d4dfa,_0x3bae91){_0x3bae91=_0x3bae91||0xc8;return function(_0x8c258c){if(_0x8c258c){return _0x3d4dfa[_0x7fed('0x19')](_0x3bae91)[_0x7fed('0x1a')](_0x8c258c);}};}function respondWithFilteredResult(_0x31a89a,_0x38335f){return function(_0x4b4358){if(_0x4b4358){var _0x146b4d=typeof _0x38335f[_0x7fed('0x1b')]==='undefined'&&typeof _0x38335f[_0x7fed('0x1c')]===_0x7fed('0x1d');var _0x7f5487=_0x4b4358[_0x7fed('0x1e')];var _0x39be54=_0x146b4d?0x0:_0x38335f[_0x7fed('0x1b')];var _0x306d30=_0x146b4d?_0x4b4358[_0x7fed('0x1e')]:_0x38335f[_0x7fed('0x1b')]+_0x38335f[_0x7fed('0x1c')];var _0x24a492;if(_0x306d30>=_0x7f5487){_0x306d30=_0x7f5487;_0x24a492=0xc8;}else{_0x24a492=0xce;}_0x31a89a[_0x7fed('0x19')](_0x24a492);return _0x31a89a[_0x7fed('0x1f')](_0x7fed('0x20'),_0x39be54+'-'+_0x306d30+'/'+_0x7f5487)[_0x7fed('0x1a')](_0x4b4358);}return null;};}function patchUpdates(_0xb2b40a){return function(_0xdbca71){try{jsonpatch[_0x7fed('0x21')](_0xdbca71,_0xb2b40a,!![]);}catch(_0x5750ac){return BPromise['reject'](_0x5750ac);}return _0xdbca71[_0x7fed('0x22')]();};}function saveUpdates(_0x4cff90,_0x1fc486){return function(_0x2bce67){if(_0x2bce67){return _0x2bce67['update'](_0x4cff90)[_0x7fed('0x23')](function(_0x54975d){return _0x54975d;});}return null;};}function removeEntity(_0x29efcb,_0x90f9e6){return function(_0x491d60){if(_0x491d60){return _0x491d60[_0x7fed('0x24')]()[_0x7fed('0x23')](function(){_0x29efcb[_0x7fed('0x19')](0xcc)[_0x7fed('0x25')]();});}};}function handleEntityNotFound(_0x5f1dcd,_0x3a0264){return function(_0x3e445e){if(!_0x3e445e){_0x5f1dcd[_0x7fed('0x18')](0x194);}return _0x3e445e;};}function handleError(_0xa15309,_0x130632){_0x130632=_0x130632||0x1f4;return function(_0xc59060){logger[_0x7fed('0x26')](_0xc59060['stack']);if(_0xc59060[_0x7fed('0x27')]){delete _0xc59060[_0x7fed('0x27')];}_0xa15309['status'](_0x130632)['send'](_0xc59060);};}exports[_0x7fed('0x28')]=function(_0x115800,_0xa64a69){var _0x471aad={},_0x57e33b={},_0x5bf9eb={'count':0x0,'rows':[]};var _0x112db7=_[_0x7fed('0x29')](db['OpenchannelTransferReport'][_0x7fed('0x2a')],function(_0x167b59){return{'name':_0x167b59[_0x7fed('0x2b')],'type':_0x167b59['type']['key']};});_0x57e33b[_0x7fed('0x2c')]=_[_0x7fed('0x29')](_0x112db7,_0x7fed('0x27'));_0x57e33b[_0x7fed('0x2d')]=_[_0x7fed('0x2e')](_0x115800[_0x7fed('0x2d')]);_0x57e33b[_0x7fed('0x2f')]=_[_0x7fed('0x30')](_0x57e33b[_0x7fed('0x2c')],_0x57e33b[_0x7fed('0x2d')]);_0x471aad['attributes']=_['intersection'](_0x57e33b[_0x7fed('0x2c')],qs['fields'](_0x115800['query']['fields']));_0x471aad[_0x7fed('0x31')]=_0x471aad[_0x7fed('0x31')][_0x7fed('0x32')]?_0x471aad['attributes']:_0x57e33b['model'];if(!_0x115800[_0x7fed('0x2d')][_0x7fed('0x33')](_0x7fed('0x34'))){_0x471aad[_0x7fed('0x1c')]=qs[_0x7fed('0x1c')](_0x115800[_0x7fed('0x2d')][_0x7fed('0x1c')]);_0x471aad[_0x7fed('0x1b')]=qs['offset'](_0x115800[_0x7fed('0x2d')][_0x7fed('0x1b')]);}_0x471aad[_0x7fed('0x35')]=qs[_0x7fed('0x36')](_0x115800[_0x7fed('0x2d')][_0x7fed('0x36')]);_0x471aad[_0x7fed('0x37')]=qs[_0x7fed('0x2f')](_[_0x7fed('0x38')](_0x115800[_0x7fed('0x2d')],_0x57e33b['filters']),_0x112db7);if(_0x115800[_0x7fed('0x2d')][_0x7fed('0x39')]){_0x471aad[_0x7fed('0x37')]=_[_0x7fed('0x3a')](_0x471aad[_0x7fed('0x37')],{'$or':_[_0x7fed('0x29')](_0x112db7,function(_0x209654){if(_0x209654['type']!==_0x7fed('0x3b')){var _0x517f09={};_0x517f09[_0x209654[_0x7fed('0x27')]]={'$like':'%'+_0x115800[_0x7fed('0x2d')][_0x7fed('0x39')]+'%'};return _0x517f09;}})});}_0x471aad=_['merge']({},_0x471aad,_0x115800[_0x7fed('0x3c')]);var _0x3d8dcf={'where':_0x471aad['where']};return db[_0x7fed('0x3d')][_0x7fed('0x1e')](_0x3d8dcf)['then'](function(_0x2c8dcf){_0x5bf9eb['count']=_0x2c8dcf;if(_0x115800[_0x7fed('0x2d')]['includeAll']){_0x471aad[_0x7fed('0x3e')]=[{'all':!![]}];}return db[_0x7fed('0x3d')][_0x7fed('0x3f')](_0x471aad);})[_0x7fed('0x23')](function(_0x52fff3){_0x5bf9eb[_0x7fed('0x40')]=_0x52fff3;return _0x5bf9eb;})[_0x7fed('0x23')](respondWithFilteredResult(_0xa64a69,_0x471aad))['catch'](handleError(_0xa64a69,null));};exports[_0x7fed('0x41')]=function(_0x2df10a,_0x2bb5f7){var _0x48d61b={'raw':!![],'where':{'id':_0x2df10a['params']['id']}},_0x428887={};_0x428887[_0x7fed('0x2c')]=_[_0x7fed('0x2e')](db[_0x7fed('0x3d')][_0x7fed('0x2a')]);_0x428887[_0x7fed('0x2d')]=_[_0x7fed('0x2e')](_0x2df10a[_0x7fed('0x2d')]);_0x428887[_0x7fed('0x2f')]=_['intersection'](_0x428887[_0x7fed('0x2c')],_0x428887['query']);_0x48d61b[_0x7fed('0x31')]=_[_0x7fed('0x30')](_0x428887[_0x7fed('0x2c')],qs['fields'](_0x2df10a['query'][_0x7fed('0x42')]));_0x48d61b['attributes']=_0x48d61b[_0x7fed('0x31')]['length']?_0x48d61b['attributes']:_0x428887[_0x7fed('0x2c')];if(_0x2df10a[_0x7fed('0x2d')][_0x7fed('0x43')]){_0x48d61b['include']=[{'all':!![]}];}_0x48d61b=_[_0x7fed('0x3a')]({},_0x48d61b,_0x2df10a['options']);return db['OpenchannelTransferReport'][_0x7fed('0x44')](_0x48d61b)['then'](handleEntityNotFound(_0x2bb5f7,null))[_0x7fed('0x23')](respondWithResult(_0x2bb5f7,null))[_0x7fed('0x45')](handleError(_0x2bb5f7,null));};exports['create']=function(_0x5a29f3,_0xd67bf1){return db['OpenchannelTransferReport'][_0x7fed('0x46')](_0x5a29f3['body'],{})[_0x7fed('0x23')](respondWithResult(_0xd67bf1,0xc9))['catch'](handleError(_0xd67bf1,null));};exports[_0x7fed('0x47')]=function(_0x2622cf,_0x117120){if(_0x2622cf['body']['id']){delete _0x2622cf[_0x7fed('0x48')]['id'];}return db['OpenchannelTransferReport']['find']({'where':{'id':_0x2622cf[_0x7fed('0x49')]['id']}})[_0x7fed('0x23')](handleEntityNotFound(_0x117120,null))[_0x7fed('0x23')](saveUpdates(_0x2622cf[_0x7fed('0x48')],null))['then'](respondWithResult(_0x117120,null))['catch'](handleError(_0x117120,null));};exports[_0x7fed('0x24')]=function(_0x36c109,_0x2da304){return db[_0x7fed('0x3d')][_0x7fed('0x44')]({'where':{'id':_0x36c109['params']['id']}})['then'](handleEntityNotFound(_0x2da304,null))[_0x7fed('0x23')](removeEntity(_0x2da304,null))[_0x7fed('0x45')](handleError(_0x2da304,null));};exports[_0x7fed('0x4a')]=function(_0x1b7b4c,_0x34c93e){return db[_0x7fed('0x3d')][_0x7fed('0x4a')]()[_0x7fed('0x23')](respondWithResult(_0x34c93e,null))['catch'](handleError(_0x34c93e,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index e4aed3b..44bbc73 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 _0xcb84=['lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','OpenchannelTransferReport','report_openchannel_transfer','uniqueid'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xcb84,0x1a4));var _0x4cb8=function(_0x4099ee,_0x38495a){_0x4099ee=_0x4099ee-0x0;var _0x1b7bfc=_0xcb84[_0x4099ee];return _0x1b7bfc;};'use strict';var _=require(_0x4cb8('0x0'));var util=require(_0x4cb8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4cb8('0x2'));var BPromise=require(_0x4cb8('0x3'));var rp=require(_0x4cb8('0x4'));var fs=require('fs');var path=require(_0x4cb8('0x5'));var rimraf=require(_0x4cb8('0x6'));var config=require(_0x4cb8('0x7'));var attributes=require(_0x4cb8('0x8'));module['exports']=function(_0x114a4b,_0x398acb){return _0x114a4b['define'](_0x4cb8('0x9'),attributes,{'tableName':_0x4cb8('0xa'),'paranoid':![],'indexes':[{'name':_0x4cb8('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x67ac=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x5923be,_0x3023ae){var _0x303700=function(_0x13d05c){while(--_0x13d05c){_0x5923be['push'](_0x5923be['shift']());}};_0x303700(++_0x3023ae);}(_0x67ac,0x1a1));var _0xc67a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x67ac[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc67a('0x0'));var util=require(_0xc67a('0x1'));var logger=require(_0xc67a('0x2'))('api');var moment=require(_0xc67a('0x3'));var BPromise=require(_0xc67a('0x4'));var rp=require(_0xc67a('0x5'));var fs=require('fs');var path=require(_0xc67a('0x6'));var rimraf=require(_0xc67a('0x7'));var config=require(_0xc67a('0x8'));var attributes=require(_0xc67a('0x9'));module['exports']=function(_0x21c8d4,_0x49f5b2){return _0x21c8d4[_0xc67a('0xa')](_0xc67a('0xb'),attributes,{'tableName':_0xc67a('0xc'),'paranoid':![],'indexes':[{'name':_0xc67a('0xd'),'fields':[_0xc67a('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index d295cb2..75de797 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 _0x2bd8=['info','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','OpenchannelTransferReport,\x20%s,\x20%s','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x48141d,_0x40c99e){var _0x3fd137=function(_0x31562d){while(--_0x31562d){_0x48141d['push'](_0x48141d['shift']());}};_0x3fd137(++_0x40c99e);}(_0x2bd8,0x130));var _0x82bd=function(_0x2632b8,_0x3fbb75){_0x2632b8=_0x2632b8-0x0;var _0x201eb2=_0x2bd8[_0x2632b8];return _0x201eb2;};'use strict';var _=require(_0x82bd('0x0'));var util=require('util');var moment=require(_0x82bd('0x1'));var BPromise=require(_0x82bd('0x2'));var rs=require(_0x82bd('0x3'));var fs=require('fs');var Redis=require(_0x82bd('0x4'));var db=require(_0x82bd('0x5'))['db'];var utils=require(_0x82bd('0x6'));var logger=require(_0x82bd('0x7'))('rpc');var config=require(_0x82bd('0x8'));var jayson=require(_0x82bd('0x9'));var client=jayson[_0x82bd('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19dbb1,_0x77d7a9,_0x226f60){return new BPromise(function(_0x1f7463,_0x4dc3a6){return client[_0x82bd('0xb')](_0x19dbb1,_0x226f60)['then'](function(_0x4a9b2c){logger['info'](_0x82bd('0xc'),_0x77d7a9,'request\x20sent');logger['debug'](_0x82bd('0xd'),_0x77d7a9,'request\x20sent',JSON['stringify'](_0x4a9b2c));if(_0x4a9b2c[_0x82bd('0xe')]){if(_0x4a9b2c[_0x82bd('0xe')]['code']===0x1f4){logger[_0x82bd('0xe')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x77d7a9,_0x4a9b2c[_0x82bd('0xe')]['message']);return _0x4dc3a6(_0x4a9b2c[_0x82bd('0xe')][_0x82bd('0xf')]);}logger[_0x82bd('0xe')](_0x82bd('0xc'),_0x77d7a9,_0x4a9b2c['error'][_0x82bd('0xf')]);return _0x1f7463(_0x4a9b2c[_0x82bd('0xe')]['message']);}else{logger[_0x82bd('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x77d7a9,_0x82bd('0x11'));_0x1f7463(_0x4a9b2c[_0x82bd('0x12')][_0x82bd('0xf')]);}})[_0x82bd('0x13')](function(_0x209081){logger[_0x82bd('0xe')](_0x82bd('0xc'),_0x77d7a9,_0x209081);_0x4dc3a6(_0x209081);});});} \ No newline at end of file +var _0x24ca=['request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s'];(function(_0x14e4ed,_0x16508c){var _0x41f5d4=function(_0x853cfd){while(--_0x853cfd){_0x14e4ed['push'](_0x14e4ed['shift']());}};_0x41f5d4(++_0x16508c);}(_0x24ca,0x1bc));var _0xa24c=function(_0x47c5bf,_0x45977e){_0x47c5bf=_0x47c5bf-0x0;var _0x11b779=_0x24ca[_0x47c5bf];return _0x11b779;};'use strict';var _=require(_0xa24c('0x0'));var util=require('util');var moment=require(_0xa24c('0x1'));var BPromise=require(_0xa24c('0x2'));var rs=require(_0xa24c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa24c('0x4'))['db'];var utils=require(_0xa24c('0x5'));var logger=require(_0xa24c('0x6'))(_0xa24c('0x7'));var config=require(_0xa24c('0x8'));var jayson=require(_0xa24c('0x9'));var client=jayson[_0xa24c('0xa')][_0xa24c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2dd348,_0x257264,_0x9a5013){return new BPromise(function(_0x481196,_0x42d89c){return client[_0xa24c('0xc')](_0x2dd348,_0x9a5013)[_0xa24c('0xd')](function(_0x5eac78){logger[_0xa24c('0xe')](_0xa24c('0xf'),_0x257264,_0xa24c('0x10'));logger[_0xa24c('0x11')](_0xa24c('0x12'),_0x257264,_0xa24c('0x10'),JSON[_0xa24c('0x13')](_0x5eac78));if(_0x5eac78[_0xa24c('0x14')]){if(_0x5eac78[_0xa24c('0x14')]['code']===0x1f4){logger[_0xa24c('0x14')](_0xa24c('0xf'),_0x257264,_0x5eac78[_0xa24c('0x14')][_0xa24c('0x15')]);return _0x42d89c(_0x5eac78['error'][_0xa24c('0x15')]);}logger[_0xa24c('0x14')](_0xa24c('0xf'),_0x257264,_0x5eac78[_0xa24c('0x14')][_0xa24c('0x15')]);return _0x481196(_0x5eac78[_0xa24c('0x14')][_0xa24c('0x15')]);}else{logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x257264,_0xa24c('0x10'));_0x481196(_0x5eac78[_0xa24c('0x16')]['message']);}})['catch'](function(_0x221d21){logger[_0xa24c('0x14')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x257264,_0x221d21);_0x42d89c(_0x221d21);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index ad392a6..c84e3de 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 _0x5da6=['create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','index','/:id','isAuthenticated'];(function(_0x540ec8,_0x2dec3f){var _0x5dec32=function(_0x3287b4){while(--_0x3287b4){_0x540ec8['push'](_0x540ec8['shift']());}};_0x5dec32(++_0x2dec3f);}(_0x5da6,0x1ec));var _0x65da=function(_0x353fb6,_0x4f8fcd){_0x353fb6=_0x353fb6-0x0;var _0x288c33=_0x5da6[_0x353fb6];return _0x288c33;};'use strict';var multer=require(_0x65da('0x0'));var util=require(_0x65da('0x1'));var path=require(_0x65da('0x2'));var timeout=require('connect-timeout');var express=require(_0x65da('0x3'));var router=express[_0x65da('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x65da('0x5'));var interaction=require(_0x65da('0x6'));var config=require(_0x65da('0x7'));var controller=require(_0x65da('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x65da('0x9')]);router['get'](_0x65da('0xa'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x65da('0xb')](),controller[_0x65da('0xc')]);router[_0x65da('0xd')](_0x65da('0xa'),auth[_0x65da('0xb')](),controller[_0x65da('0xe')]);router[_0x65da('0xf')](_0x65da('0xa'),auth[_0x65da('0xb')](),controller[_0x65da('0x10')]);module[_0x65da('0x11')]=router; \ No newline at end of file +var _0xf644=['get','isAuthenticated','/:id','post','update','delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./pause.controller'];(function(_0x57a97a,_0x3672e9){var _0x12a961=function(_0x919b84){while(--_0x919b84){_0x57a97a['push'](_0x57a97a['shift']());}};_0x12a961(++_0x3672e9);}(_0xf644,0x151));var _0x4f64=function(_0x1d5fab,_0x19b541){_0x1d5fab=_0x1d5fab-0x0;var _0x555ec=_0xf644[_0x1d5fab];return _0x555ec;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4f64('0x0'));var timeout=require(_0x4f64('0x1'));var express=require(_0x4f64('0x2'));var router=express[_0x4f64('0x3')]();var fs_extra=require(_0x4f64('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4f64('0x5'));var config=require(_0x4f64('0x6'));var controller=require(_0x4f64('0x7'));router[_0x4f64('0x8')]('/',auth[_0x4f64('0x9')](),controller['index']);router['get'](_0x4f64('0xa'),auth[_0x4f64('0x9')](),controller['show']);router[_0x4f64('0xb')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x4f64('0xa'),auth[_0x4f64('0x9')](),controller[_0x4f64('0xc')]);router[_0x4f64('0xd')](_0x4f64('0xa'),auth[_0x4f64('0x9')](),controller[_0x4f64('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 80ba211..aabd3aa 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 _0x8996=['STRING','name','sequelize','exports'];(function(_0x24679e,_0x22d9d7){var _0x291f21=function(_0x329529){while(--_0x329529){_0x24679e['push'](_0x24679e['shift']());}};_0x291f21(++_0x22d9d7);}(_0x8996,0x146));var _0x6899=function(_0x15a2d8,_0x18f226){_0x15a2d8=_0x15a2d8-0x0;var _0x34c3f8=_0x8996[_0x15a2d8];return _0x34c3f8;};'use strict';var Sequelize=require(_0x6899('0x0'));module[_0x6899('0x1')]={'name':{'type':Sequelize[_0x6899('0x2')],'unique':_0x6899('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x6899('0x2')]}}; \ No newline at end of file +var _0x1f94=['sequelize','exports','STRING','name'];(function(_0xc2737f,_0x4818cc){var _0x1f6178=function(_0x4b547e){while(--_0x4b547e){_0xc2737f['push'](_0xc2737f['shift']());}};_0x1f6178(++_0x4818cc);}(_0x1f94,0x148));var _0x41f9=function(_0x21bdd1,_0x3f7cd8){_0x21bdd1=_0x21bdd1-0x0;var _0x30514e=_0x1f94[_0x21bdd1];return _0x30514e;};'use strict';var Sequelize=require(_0x41f9('0x0'));module[_0x41f9('0x1')]={'name':{'type':Sequelize[_0x41f9('0x2')],'unique':_0x41f9('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x41f9('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 7a7fe27..baa7caf 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 _0x5a3b=['util','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','update','then','destroy','Pauses','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','Pause','includeAll','findAll','rows','catch','show','params','include','find','body','user','get','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x3d6b05,_0x377cb7){var _0x3b58b7=function(_0x4af5e5){while(--_0x4af5e5){_0x3d6b05['push'](_0x3d6b05['shift']());}};_0x3b58b7(++_0x377cb7);}(_0x5a3b,0xf5));var _0xb5a3=function(_0x1f1af6,_0x3ac33a){_0x1f1af6=_0x1f1af6-0x0;var _0x423343=_0x5a3b[_0x1f1af6];return _0x423343;};'use strict';var emlformat=require(_0xb5a3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb5a3('0x1'));var jsonpatch=require(_0xb5a3('0x2'));var rp=require(_0xb5a3('0x3'));var moment=require(_0xb5a3('0x4'));var BPromise=require(_0xb5a3('0x5'));var Mustache=require(_0xb5a3('0x6'));var util=require(_0xb5a3('0x7'));var path=require('path');var sox=require(_0xb5a3('0x8'));var csv=require(_0xb5a3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb5a3('0xa'));var squel=require(_0xb5a3('0xb'));var crypto=require(_0xb5a3('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb5a3('0xd'));var toCsv=require(_0xb5a3('0x9'));var querystring=require(_0xb5a3('0xe'));var Papa=require(_0xb5a3('0xf'));var Redis=require(_0xb5a3('0x10'));var authService=require(_0xb5a3('0x11'));var qs=require(_0xb5a3('0x12'));var as=require(_0xb5a3('0x13'));var hardwareService=require(_0xb5a3('0x14'));var logger=require(_0xb5a3('0x15'))(_0xb5a3('0x16'));var utils=require('../../config/utils');var config=require(_0xb5a3('0x17'));var licenseUtil=require(_0xb5a3('0x18'));var db=require(_0xb5a3('0x19'))['db'];function respondWithStatusCode(_0x40c146,_0x4f9ceb){_0x4f9ceb=_0x4f9ceb||0xcc;return function(_0x1d2058){if(_0x1d2058){return _0x40c146[_0xb5a3('0x1a')](_0x4f9ceb);}return _0x40c146[_0xb5a3('0x1b')](_0x4f9ceb)[_0xb5a3('0x1c')]();};}function respondWithResult(_0x67ce0d,_0x4dd0a0){_0x4dd0a0=_0x4dd0a0||0xc8;return function(_0x35c1d7){if(_0x35c1d7){return _0x67ce0d[_0xb5a3('0x1b')](_0x4dd0a0)['json'](_0x35c1d7);}};}function respondWithFilteredResult(_0x1c0d71,_0x562260){return function(_0xaff143){if(_0xaff143){var _0x4bf4ef=typeof _0x562260[_0xb5a3('0x1d')]===_0xb5a3('0x1e')&&typeof _0x562260[_0xb5a3('0x1f')]===_0xb5a3('0x1e');var _0x593439=_0xaff143[_0xb5a3('0x20')];var _0x38ecd0=_0x4bf4ef?0x0:_0x562260['offset'];var _0x3a6ca5=_0x4bf4ef?_0xaff143[_0xb5a3('0x20')]:_0x562260['offset']+_0x562260['limit'];var _0x3aab08;if(_0x3a6ca5>=_0x593439){_0x3a6ca5=_0x593439;_0x3aab08=0xc8;}else{_0x3aab08=0xce;}_0x1c0d71[_0xb5a3('0x1b')](_0x3aab08);return _0x1c0d71[_0xb5a3('0x21')]('Content-Range',_0x38ecd0+'-'+_0x3a6ca5+'/'+_0x593439)[_0xb5a3('0x22')](_0xaff143);}return null;};}function patchUpdates(_0x18a4d3){return function(_0x23f539){try{jsonpatch[_0xb5a3('0x23')](_0x23f539,_0x18a4d3,!![]);}catch(_0x490308){return BPromise[_0xb5a3('0x24')](_0x490308);}return _0x23f539['save']();};}function saveUpdates(_0x299e21,_0x5c4052){return function(_0x3984f7){if(_0x3984f7){return _0x3984f7[_0xb5a3('0x25')](_0x299e21)[_0xb5a3('0x26')](function(_0x316f33){return _0x316f33;});}return null;};}function removeEntity(_0x35cfe3,_0x343e1f){return function(_0x276c20){if(_0x276c20){return _0x276c20[_0xb5a3('0x27')]()[_0xb5a3('0x26')](function(){var _0xc06586=_0x276c20['get']({'plain':!![]});var _0x1ae271=_0xb5a3('0x28');return db['UserProfileResource'][_0xb5a3('0x27')]({'where':{'type':_0x1ae271,'resourceId':_0xc06586['id']}})[_0xb5a3('0x26')](function(){return _0x276c20;});})[_0xb5a3('0x26')](function(){_0x35cfe3['status'](0xcc)[_0xb5a3('0x1c')]();});}};}function handleEntityNotFound(_0x5c8e7a,_0x46ea42){return function(_0x24f2d2){if(!_0x24f2d2){_0x5c8e7a[_0xb5a3('0x1a')](0x194);}return _0x24f2d2;};}function handleError(_0x4d9651,_0x4241b4){_0x4241b4=_0x4241b4||0x1f4;return function(_0x27f5d2){logger[_0xb5a3('0x29')](_0x27f5d2[_0xb5a3('0x2a')]);if(_0x27f5d2[_0xb5a3('0x2b')]){delete _0x27f5d2[_0xb5a3('0x2b')];}_0x4d9651[_0xb5a3('0x1b')](_0x4241b4)[_0xb5a3('0x2c')](_0x27f5d2);};}exports[_0xb5a3('0x2d')]=function(_0x1a0a81,_0x2d883f){var _0x3a89ad={},_0x437090={},_0x4a5e75={'count':0x0,'rows':[]};var _0x501267=_[_0xb5a3('0x2e')](db['Pause'][_0xb5a3('0x2f')],function(_0x35e37b){return{'name':_0x35e37b[_0xb5a3('0x30')],'type':_0x35e37b['type'][_0xb5a3('0x31')]};});_0x437090[_0xb5a3('0x32')]=_[_0xb5a3('0x2e')](_0x501267,_0xb5a3('0x2b'));_0x437090[_0xb5a3('0x33')]=_[_0xb5a3('0x34')](_0x1a0a81[_0xb5a3('0x33')]);_0x437090['filters']=_[_0xb5a3('0x35')](_0x437090['model'],_0x437090['query']);_0x3a89ad[_0xb5a3('0x36')]=_[_0xb5a3('0x35')](_0x437090[_0xb5a3('0x32')],qs[_0xb5a3('0x37')](_0x1a0a81['query']['fields']));_0x3a89ad[_0xb5a3('0x36')]=_0x3a89ad[_0xb5a3('0x36')][_0xb5a3('0x38')]?_0x3a89ad[_0xb5a3('0x36')]:_0x437090[_0xb5a3('0x32')];if(!_0x1a0a81['query'][_0xb5a3('0x39')](_0xb5a3('0x3a'))){_0x3a89ad['limit']=qs[_0xb5a3('0x1f')](_0x1a0a81[_0xb5a3('0x33')][_0xb5a3('0x1f')]);_0x3a89ad[_0xb5a3('0x1d')]=qs[_0xb5a3('0x1d')](_0x1a0a81[_0xb5a3('0x33')][_0xb5a3('0x1d')]);}_0x3a89ad[_0xb5a3('0x3b')]=qs[_0xb5a3('0x3c')](_0x1a0a81[_0xb5a3('0x33')][_0xb5a3('0x3c')]);_0x3a89ad[_0xb5a3('0x3d')]=qs[_0xb5a3('0x3e')](_[_0xb5a3('0x3f')](_0x1a0a81[_0xb5a3('0x33')],_0x437090[_0xb5a3('0x3e')]),_0x501267);if(_0x1a0a81[_0xb5a3('0x33')][_0xb5a3('0x40')]){_0x3a89ad[_0xb5a3('0x3d')]=_[_0xb5a3('0x41')](_0x3a89ad[_0xb5a3('0x3d')],{'$or':_[_0xb5a3('0x2e')](_0x501267,function(_0x1fe88c){if(_0x1fe88c['type']!==_0xb5a3('0x42')){var _0x28e82b={};_0x28e82b[_0x1fe88c[_0xb5a3('0x2b')]]={'$like':'%'+_0x1a0a81['query'][_0xb5a3('0x40')]+'%'};return _0x28e82b;}})});}_0x3a89ad=_[_0xb5a3('0x41')]({},_0x3a89ad,_0x1a0a81[_0xb5a3('0x43')]);var _0x2e794c={'where':_0x3a89ad[_0xb5a3('0x3d')]};return db[_0xb5a3('0x44')][_0xb5a3('0x20')](_0x2e794c)[_0xb5a3('0x26')](function(_0x1180fb){_0x4a5e75[_0xb5a3('0x20')]=_0x1180fb;if(_0x1a0a81[_0xb5a3('0x33')][_0xb5a3('0x45')]){_0x3a89ad['include']=[{'all':!![]}];}return db['Pause'][_0xb5a3('0x46')](_0x3a89ad);})[_0xb5a3('0x26')](function(_0xfd87ed){_0x4a5e75[_0xb5a3('0x47')]=_0xfd87ed;return _0x4a5e75;})[_0xb5a3('0x26')](respondWithFilteredResult(_0x2d883f,_0x3a89ad))[_0xb5a3('0x48')](handleError(_0x2d883f,null));};exports[_0xb5a3('0x49')]=function(_0x1ea5b6,_0x33319c){var _0x17274d={'raw':!![],'where':{'id':_0x1ea5b6[_0xb5a3('0x4a')]['id']}},_0x5999a4={};_0x5999a4['model']=_[_0xb5a3('0x34')](db[_0xb5a3('0x44')]['rawAttributes']);_0x5999a4[_0xb5a3('0x33')]=_[_0xb5a3('0x34')](_0x1ea5b6[_0xb5a3('0x33')]);_0x5999a4[_0xb5a3('0x3e')]=_[_0xb5a3('0x35')](_0x5999a4[_0xb5a3('0x32')],_0x5999a4[_0xb5a3('0x33')]);_0x17274d[_0xb5a3('0x36')]=_[_0xb5a3('0x35')](_0x5999a4[_0xb5a3('0x32')],qs['fields'](_0x1ea5b6[_0xb5a3('0x33')][_0xb5a3('0x37')]));_0x17274d['attributes']=_0x17274d['attributes']['length']?_0x17274d[_0xb5a3('0x36')]:_0x5999a4[_0xb5a3('0x32')];if(_0x1ea5b6['query'][_0xb5a3('0x45')]){_0x17274d[_0xb5a3('0x4b')]=[{'all':!![]}];}_0x17274d=_[_0xb5a3('0x41')]({},_0x17274d,_0x1ea5b6[_0xb5a3('0x43')]);return db[_0xb5a3('0x44')][_0xb5a3('0x4c')](_0x17274d)[_0xb5a3('0x26')](handleEntityNotFound(_0x33319c,null))[_0xb5a3('0x26')](respondWithResult(_0x33319c,null))['catch'](handleError(_0x33319c,null));};exports['create']=function(_0x30a202,_0x2cf18a){return db[_0xb5a3('0x44')]['create'](_0x30a202[_0xb5a3('0x4d')],{})[_0xb5a3('0x26')](function(_0x5a82d2){var _0x23ae88=_0x30a202[_0xb5a3('0x4e')][_0xb5a3('0x4f')]({'plain':!![]});if(!_0x23ae88)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23ae88['role']===_0xb5a3('0x4e')){var _0x12a106=_0x5a82d2['get']({'plain':!![]});var _0x427cdb=_0xb5a3('0x28');return db[_0xb5a3('0x50')][_0xb5a3('0x4c')]({'where':{'name':_0x427cdb,'userProfileId':_0x23ae88['userProfileId']},'raw':!![]})[_0xb5a3('0x26')](function(_0x4dcf2a){if(_0x4dcf2a&&_0x4dcf2a[_0xb5a3('0x51')]===0x0){return db[_0xb5a3('0x52')]['create']({'name':_0x12a106[_0xb5a3('0x2b')],'resourceId':_0x12a106['id'],'type':_0x4dcf2a[_0xb5a3('0x2b')],'sectionId':_0x4dcf2a['id']},{})[_0xb5a3('0x26')](function(){return _0x5a82d2;});}else{return _0x5a82d2;}})[_0xb5a3('0x48')](function(_0xf2feef){logger[_0xb5a3('0x29')](_0xb5a3('0x53'),_0xf2feef);throw _0xf2feef;});}return _0x5a82d2;})[_0xb5a3('0x26')](respondWithResult(_0x2cf18a,0xc9))['catch'](handleError(_0x2cf18a,null));};exports['update']=function(_0x4b920a,_0x396470){if(_0x4b920a[_0xb5a3('0x4d')]['id']){delete _0x4b920a[_0xb5a3('0x4d')]['id'];}return db[_0xb5a3('0x44')][_0xb5a3('0x4c')]({'where':{'id':_0x4b920a['params']['id']}})[_0xb5a3('0x26')](handleEntityNotFound(_0x396470,null))['then'](saveUpdates(_0x4b920a[_0xb5a3('0x4d')],null))[_0xb5a3('0x26')](respondWithResult(_0x396470,null))[_0xb5a3('0x48')](handleError(_0x396470,null));};exports['destroy']=function(_0x2aaf65,_0x55dc05){return db['Pause'][_0xb5a3('0x4c')]({'where':{'id':_0x2aaf65[_0xb5a3('0x4a')]['id']}})[_0xb5a3('0x26')](handleEntityNotFound(_0x55dc05,null))['then'](removeEntity(_0x55dc05,null))['catch'](handleError(_0x55dc05,null));}; \ No newline at end of file +var _0x90c8=['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','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','then','get','UserProfileResource','end','error','name','send','index','Pause','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','includeAll','include'];(function(_0x1e89a2,_0x3e0802){var _0x138787=function(_0x2cbd93){while(--_0x2cbd93){_0x1e89a2['push'](_0x1e89a2['shift']());}};_0x138787(++_0x3e0802);}(_0x90c8,0x16d));var _0x890c=function(_0x43f881,_0xd6e5a2){_0x43f881=_0x43f881-0x0;var _0x365c14=_0x90c8[_0x43f881];return _0x365c14;};'use strict';var emlformat=require(_0x890c('0x0'));var rimraf=require(_0x890c('0x1'));var zipdir=require(_0x890c('0x2'));var jsonpatch=require(_0x890c('0x3'));var rp=require(_0x890c('0x4'));var moment=require(_0x890c('0x5'));var BPromise=require(_0x890c('0x6'));var Mustache=require(_0x890c('0x7'));var util=require(_0x890c('0x8'));var path=require(_0x890c('0x9'));var sox=require(_0x890c('0xa'));var csv=require('to-csv');var ejs=require(_0x890c('0xb'));var fs=require('fs');var fs_extra=require(_0x890c('0xc'));var _=require(_0x890c('0xd'));var squel=require(_0x890c('0xe'));var crypto=require(_0x890c('0xf'));var jsforce=require(_0x890c('0x10'));var deskjs=require(_0x890c('0x11'));var toCsv=require('to-csv');var querystring=require(_0x890c('0x12'));var Papa=require(_0x890c('0x13'));var Redis=require(_0x890c('0x14'));var authService=require(_0x890c('0x15'));var qs=require(_0x890c('0x16'));var as=require(_0x890c('0x17'));var hardwareService=require(_0x890c('0x18'));var logger=require(_0x890c('0x19'))(_0x890c('0x1a'));var utils=require(_0x890c('0x1b'));var config=require('../../config/environment');var licenseUtil=require(_0x890c('0x1c'));var db=require(_0x890c('0x1d'))['db'];function respondWithStatusCode(_0x332f20,_0x5f6e7b){_0x5f6e7b=_0x5f6e7b||0xcc;return function(_0x1ea918){if(_0x1ea918){return _0x332f20[_0x890c('0x1e')](_0x5f6e7b);}return _0x332f20[_0x890c('0x1f')](_0x5f6e7b)['end']();};}function respondWithResult(_0x49fa95,_0x4e8fdb){_0x4e8fdb=_0x4e8fdb||0xc8;return function(_0x192556){if(_0x192556){return _0x49fa95['status'](_0x4e8fdb)[_0x890c('0x20')](_0x192556);}};}function respondWithFilteredResult(_0x2f72cb,_0x1ea85d){return function(_0x336bdb){if(_0x336bdb){var _0x4c9740=typeof _0x1ea85d[_0x890c('0x21')]===_0x890c('0x22')&&typeof _0x1ea85d['limit']==='undefined';var _0x3645e4=_0x336bdb['count'];var _0x3b4b7a=_0x4c9740?0x0:_0x1ea85d[_0x890c('0x21')];var _0x48c468=_0x4c9740?_0x336bdb[_0x890c('0x23')]:_0x1ea85d[_0x890c('0x21')]+_0x1ea85d[_0x890c('0x24')];var _0x54c314;if(_0x48c468>=_0x3645e4){_0x48c468=_0x3645e4;_0x54c314=0xc8;}else{_0x54c314=0xce;}_0x2f72cb['status'](_0x54c314);return _0x2f72cb[_0x890c('0x25')](_0x890c('0x26'),_0x3b4b7a+'-'+_0x48c468+'/'+_0x3645e4)[_0x890c('0x20')](_0x336bdb);}return null;};}function patchUpdates(_0x575e59){return function(_0x337320){try{jsonpatch['apply'](_0x337320,_0x575e59,!![]);}catch(_0x2e4ac5){return BPromise[_0x890c('0x27')](_0x2e4ac5);}return _0x337320[_0x890c('0x28')]();};}function saveUpdates(_0x3454cb,_0x1291f4){return function(_0x45412b){if(_0x45412b){return _0x45412b[_0x890c('0x29')](_0x3454cb)['then'](function(_0x45b77c){return _0x45b77c;});}return null;};}function removeEntity(_0x909048,_0x41b41a){return function(_0x35c93c){if(_0x35c93c){return _0x35c93c[_0x890c('0x2a')]()[_0x890c('0x2b')](function(){var _0x32c21b=_0x35c93c[_0x890c('0x2c')]({'plain':!![]});var _0x5b0601='Pauses';return db[_0x890c('0x2d')]['destroy']({'where':{'type':_0x5b0601,'resourceId':_0x32c21b['id']}})['then'](function(){return _0x35c93c;});})[_0x890c('0x2b')](function(){_0x909048[_0x890c('0x1f')](0xcc)[_0x890c('0x2e')]();});}};}function handleEntityNotFound(_0x58b971,_0x5e3533){return function(_0xb3128){if(!_0xb3128){_0x58b971[_0x890c('0x1e')](0x194);}return _0xb3128;};}function handleError(_0x144621,_0x295e35){_0x295e35=_0x295e35||0x1f4;return function(_0x4bffa6){logger[_0x890c('0x2f')](_0x4bffa6['stack']);if(_0x4bffa6['name']){delete _0x4bffa6[_0x890c('0x30')];}_0x144621[_0x890c('0x1f')](_0x295e35)[_0x890c('0x31')](_0x4bffa6);};}exports[_0x890c('0x32')]=function(_0x580fe8,_0x22f240){var _0x9aa2d8={},_0x324c59={},_0x59ec80={'count':0x0,'rows':[]};var _0x7fa6ad=_['map'](db[_0x890c('0x33')][_0x890c('0x34')],function(_0x49f5d4){return{'name':_0x49f5d4[_0x890c('0x35')],'type':_0x49f5d4[_0x890c('0x36')][_0x890c('0x37')]};});_0x324c59[_0x890c('0x38')]=_[_0x890c('0x39')](_0x7fa6ad,_0x890c('0x30'));_0x324c59['query']=_[_0x890c('0x3a')](_0x580fe8[_0x890c('0x3b')]);_0x324c59['filters']=_[_0x890c('0x3c')](_0x324c59[_0x890c('0x38')],_0x324c59[_0x890c('0x3b')]);_0x9aa2d8['attributes']=_[_0x890c('0x3c')](_0x324c59['model'],qs[_0x890c('0x3d')](_0x580fe8[_0x890c('0x3b')]['fields']));_0x9aa2d8[_0x890c('0x3e')]=_0x9aa2d8[_0x890c('0x3e')][_0x890c('0x3f')]?_0x9aa2d8['attributes']:_0x324c59[_0x890c('0x38')];if(!_0x580fe8['query'][_0x890c('0x40')](_0x890c('0x41'))){_0x9aa2d8[_0x890c('0x24')]=qs[_0x890c('0x24')](_0x580fe8['query'][_0x890c('0x24')]);_0x9aa2d8[_0x890c('0x21')]=qs[_0x890c('0x21')](_0x580fe8[_0x890c('0x3b')]['offset']);}_0x9aa2d8['order']=qs[_0x890c('0x42')](_0x580fe8[_0x890c('0x3b')][_0x890c('0x42')]);_0x9aa2d8[_0x890c('0x43')]=qs['filters'](_[_0x890c('0x44')](_0x580fe8[_0x890c('0x3b')],_0x324c59[_0x890c('0x45')]),_0x7fa6ad);if(_0x580fe8[_0x890c('0x3b')][_0x890c('0x46')]){_0x9aa2d8['where']=_[_0x890c('0x47')](_0x9aa2d8[_0x890c('0x43')],{'$or':_[_0x890c('0x39')](_0x7fa6ad,function(_0x464e75){if(_0x464e75[_0x890c('0x36')]!==_0x890c('0x48')){var _0x4121ec={};_0x4121ec[_0x464e75['name']]={'$like':'%'+_0x580fe8[_0x890c('0x3b')][_0x890c('0x46')]+'%'};return _0x4121ec;}})});}_0x9aa2d8=_[_0x890c('0x47')]({},_0x9aa2d8,_0x580fe8['options']);var _0xc99bf1={'where':_0x9aa2d8[_0x890c('0x43')]};return db[_0x890c('0x33')][_0x890c('0x23')](_0xc99bf1)['then'](function(_0x2c27bc){_0x59ec80[_0x890c('0x23')]=_0x2c27bc;if(_0x580fe8['query'][_0x890c('0x49')]){_0x9aa2d8[_0x890c('0x4a')]=[{'all':!![]}];}return db['Pause']['findAll'](_0x9aa2d8);})['then'](function(_0x10bd3d){_0x59ec80[_0x890c('0x4b')]=_0x10bd3d;return _0x59ec80;})[_0x890c('0x2b')](respondWithFilteredResult(_0x22f240,_0x9aa2d8))[_0x890c('0x4c')](handleError(_0x22f240,null));};exports[_0x890c('0x4d')]=function(_0x13bdb4,_0x3dc406){var _0xe91447={'raw':!![],'where':{'id':_0x13bdb4[_0x890c('0x4e')]['id']}},_0x4a89fa={};_0x4a89fa[_0x890c('0x38')]=_[_0x890c('0x3a')](db[_0x890c('0x33')][_0x890c('0x34')]);_0x4a89fa[_0x890c('0x3b')]=_[_0x890c('0x3a')](_0x13bdb4['query']);_0x4a89fa[_0x890c('0x45')]=_[_0x890c('0x3c')](_0x4a89fa[_0x890c('0x38')],_0x4a89fa[_0x890c('0x3b')]);_0xe91447[_0x890c('0x3e')]=_['intersection'](_0x4a89fa['model'],qs[_0x890c('0x3d')](_0x13bdb4[_0x890c('0x3b')]['fields']));_0xe91447[_0x890c('0x3e')]=_0xe91447[_0x890c('0x3e')][_0x890c('0x3f')]?_0xe91447[_0x890c('0x3e')]:_0x4a89fa['model'];if(_0x13bdb4['query'][_0x890c('0x49')]){_0xe91447['include']=[{'all':!![]}];}_0xe91447=_[_0x890c('0x47')]({},_0xe91447,_0x13bdb4['options']);return db[_0x890c('0x33')]['find'](_0xe91447)[_0x890c('0x2b')](handleEntityNotFound(_0x3dc406,null))[_0x890c('0x2b')](respondWithResult(_0x3dc406,null))[_0x890c('0x4c')](handleError(_0x3dc406,null));};exports[_0x890c('0x4f')]=function(_0x49d68e,_0x24c009){return db[_0x890c('0x33')][_0x890c('0x4f')](_0x49d68e[_0x890c('0x50')],{})[_0x890c('0x2b')](function(_0x4ac33f){var _0x28d47e=_0x49d68e[_0x890c('0x51')][_0x890c('0x2c')]({'plain':!![]});if(!_0x28d47e)throw new Error(_0x890c('0x52'));if(_0x28d47e[_0x890c('0x53')]==='user'){var _0x941abd=_0x4ac33f[_0x890c('0x2c')]({'plain':!![]});var _0x5c005d='Pauses';return db['UserProfileSection'][_0x890c('0x54')]({'where':{'name':_0x5c005d,'userProfileId':_0x28d47e[_0x890c('0x55')]},'raw':!![]})['then'](function(_0x419f34){if(_0x419f34&&_0x419f34[_0x890c('0x56')]===0x0){return db[_0x890c('0x2d')][_0x890c('0x4f')]({'name':_0x941abd[_0x890c('0x30')],'resourceId':_0x941abd['id'],'type':_0x419f34[_0x890c('0x30')],'sectionId':_0x419f34['id']},{})[_0x890c('0x2b')](function(){return _0x4ac33f;});}else{return _0x4ac33f;}})[_0x890c('0x4c')](function(_0x22e785){logger[_0x890c('0x2f')](_0x890c('0x57'),_0x22e785);throw _0x22e785;});}return _0x4ac33f;})['then'](respondWithResult(_0x24c009,0xc9))[_0x890c('0x4c')](handleError(_0x24c009,null));};exports[_0x890c('0x29')]=function(_0x342100,_0x1c2f38){if(_0x342100[_0x890c('0x50')]['id']){delete _0x342100['body']['id'];}return db[_0x890c('0x33')][_0x890c('0x54')]({'where':{'id':_0x342100[_0x890c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1c2f38,null))[_0x890c('0x2b')](saveUpdates(_0x342100['body'],null))['then'](respondWithResult(_0x1c2f38,null))[_0x890c('0x4c')](handleError(_0x1c2f38,null));};exports[_0x890c('0x2a')]=function(_0x36ac0a,_0x6aa5a0){return db[_0x890c('0x33')]['find']({'where':{'id':_0x36ac0a[_0x890c('0x4e')]['id']}})[_0x890c('0x2b')](handleEntityNotFound(_0x6aa5a0,null))[_0x890c('0x2b')](removeEntity(_0x6aa5a0,null))[_0x890c('0x4c')](handleError(_0x6aa5a0,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 4867f38..3ccc992 100644 --- a/server/api/pause/pause.model.js +++ b/server/api/pause/pause.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['define','Pause','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./pause.attributes','exports'];(function(_0x2ec55d,_0xa889f8){var _0x24fe9f=function(_0x10b074){while(--_0x10b074){_0x2ec55d['push'](_0x2ec55d['shift']());}};_0x24fe9f(++_0xa889f8);}(_0x814b,0x1a2));var _0xb814=function(_0x1f0724,_0x3a58bf){_0x1f0724=_0x1f0724-0x0;var _0x253ffb=_0x814b[_0x1f0724];return _0x253ffb;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x53ec=['bluebird','path','../../config/environment','./pause.attributes','define','Pause','lodash','util','../../config/logger','api','moment'];(function(_0x2df82d,_0xaca12f){var _0x21ef8a=function(_0x42015c){while(--_0x42015c){_0x2df82d['push'](_0x2df82d['shift']());}};_0x21ef8a(++_0xaca12f);}(_0x53ec,0x192));var _0xc53e=function(_0x1152e5,_0x5a8eaf){_0x1152e5=_0x1152e5-0x0;var _0xd1fcdb=_0x53ec[_0x1152e5];return _0xd1fcdb;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index ff5b3d8..5dc97dc 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(_0x918ed6,_0xc297c8){var _0x1cd32e=function(_0x577381){while(--_0x577381){_0x918ed6['push'](_0x918ed6['shift']());}};_0x1cd32e(++_0xc297c8);}(_0xb10b,0x12a));var _0xbb10=function(_0x7033ad,_0x4f191a){_0x7033ad=_0x7033ad-0x0;var _0x4117fb=_0xb10b[_0x7033ad];return _0x4117fb;};'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(_0x51b8e4,_0x45eb2c){var _0x28e19d=function(_0x57e689){while(--_0x57e689){_0x51b8e4['push'](_0x51b8e4['shift']());}};_0x28e19d(++_0x45eb2c);}(_0xb10b,0x12a));var _0xbb10=function(_0x572438,_0x1b94fe){_0x572438=_0x572438-0x0;var _0xc6e9a7=_0xb10b[_0x572438];return _0xc6e9a7;};'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 530100d..9cfe6b5 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 _0x4c6d=['delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./plugin.controller','get','index','/webhook','/:id','isAuthenticated','/:id/download','diskStorage','join','root','originalname','replace','format','%s-%s%s','basename','now','extname','post','single','file','upload','webhookPost','put'];(function(_0x50ef88,_0x5a1ecc){var _0x4ef9a1=function(_0x53b8cd){while(--_0x53b8cd){_0x50ef88['push'](_0x50ef88['shift']());}};_0x4ef9a1(++_0x5a1ecc);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0x314ba5,_0x359dac){_0x314ba5=_0x314ba5-0x0;var _0x81ae10=_0x4c6d[_0x314ba5];return _0x81ae10;};'use strict';var multer=require(_0xd4c6('0x0'));var util=require(_0xd4c6('0x1'));var path=require(_0xd4c6('0x2'));var timeout=require(_0xd4c6('0x3'));var express=require(_0xd4c6('0x4'));var router=express['Router']();var fs_extra=require(_0xd4c6('0x5'));var auth=require(_0xd4c6('0x6'));var interaction=require(_0xd4c6('0x7'));var config=require('../../config/environment');var controller=require(_0xd4c6('0x8'));router[_0xd4c6('0x9')]('/',auth['isAuthenticated'](),controller[_0xd4c6('0xa')]);router[_0xd4c6('0x9')](_0xd4c6('0xb'),controller['webhookGet']);router[_0xd4c6('0x9')](_0xd4c6('0xc'),auth[_0xd4c6('0xd')](),controller['show']);router[_0xd4c6('0x9')](_0xd4c6('0xe'),auth[_0xd4c6('0xd')](),controller['download']);var upload=multer({'storage':multer[_0xd4c6('0xf')]({'destination':function(_0x38f0a6,_0x3eaa96,_0x2790e7){_0x2790e7(null,path[_0xd4c6('0x10')](config[_0xd4c6('0x11')],'server/files/plugins'));},'filename':function(_0x52bbc9,_0x35b902,_0x489171){_0x35b902[_0xd4c6('0x12')]=_0x35b902[_0xd4c6('0x12')][_0xd4c6('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x489171(null,util[_0xd4c6('0x14')](_0xd4c6('0x15'),path[_0xd4c6('0x16')](_0x35b902[_0xd4c6('0x12')],path['extname'](_0x35b902['originalname'])),Date[_0xd4c6('0x17')](),path[_0xd4c6('0x18')](_0x35b902[_0xd4c6('0x12')])));}})});router[_0xd4c6('0x19')]('/',upload[_0xd4c6('0x1a')](_0xd4c6('0x1b')),controller[_0xd4c6('0x1c')]);router['post'](_0xd4c6('0xb'),controller[_0xd4c6('0x1d')]);router[_0xd4c6('0x1e')](_0xd4c6('0xc'),auth[_0xd4c6('0xd')](),controller['update']);router[_0xd4c6('0x1f')](_0xd4c6('0xc'),auth[_0xd4c6('0xd')](),controller['delete']);module[_0xd4c6('0x20')]=router; \ No newline at end of file +var _0xcea2=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./plugin.controller','isAuthenticated','get','/webhook','webhookGet','/:id','/:id/download','download','diskStorage','server/files/plugins','originalname','replace','format','%s-%s%s','extname','post','single','file','upload','put','update','delete','multer','path'];(function(_0xc66596,_0x3d13d6){var _0x3a130f=function(_0x2dc802){while(--_0x2dc802){_0xc66596['push'](_0xc66596['shift']());}};_0x3a130f(++_0x3d13d6);}(_0xcea2,0x15a));var _0x2cea=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xcea2[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0x2cea('0x0'));var util=require('util');var path=require(_0x2cea('0x1'));var timeout=require('connect-timeout');var express=require(_0x2cea('0x2'));var router=express[_0x2cea('0x3')]();var fs_extra=require(_0x2cea('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2cea('0x5'));var config=require(_0x2cea('0x6'));var controller=require(_0x2cea('0x7'));router['get']('/',auth[_0x2cea('0x8')](),controller['index']);router[_0x2cea('0x9')](_0x2cea('0xa'),controller[_0x2cea('0xb')]);router[_0x2cea('0x9')](_0x2cea('0xc'),auth[_0x2cea('0x8')](),controller['show']);router[_0x2cea('0x9')](_0x2cea('0xd'),auth[_0x2cea('0x8')](),controller[_0x2cea('0xe')]);var upload=multer({'storage':multer[_0x2cea('0xf')]({'destination':function(_0x439c4d,_0x4298a4,_0x1c9142){_0x1c9142(null,path['join'](config['root'],_0x2cea('0x10')));},'filename':function(_0x2db0ff,_0x528c1d,_0x4bd265){_0x528c1d[_0x2cea('0x11')]=_0x528c1d['originalname'][_0x2cea('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4bd265(null,util[_0x2cea('0x13')](_0x2cea('0x14'),path['basename'](_0x528c1d['originalname'],path['extname'](_0x528c1d[_0x2cea('0x11')])),Date['now'](),path[_0x2cea('0x15')](_0x528c1d[_0x2cea('0x11')])));}})});router[_0x2cea('0x16')]('/',upload[_0x2cea('0x17')](_0x2cea('0x18')),controller[_0x2cea('0x19')]);router[_0x2cea('0x16')](_0x2cea('0xa'),controller['webhookPost']);router[_0x2cea('0x1a')](_0x2cea('0xc'),auth[_0x2cea('0x8')](),controller[_0x2cea('0x1b')]);router[_0x2cea('0x1c')](_0x2cea('0xc'),auth['isAuthenticated'](),controller[_0x2cea('0x1c')]);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 f896edc..b1fab80 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 _0x2966=['Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','html','script','TEXT','BOOLEAN','ENUM','adminOnly','agentOnly','always','never'];(function(_0x2fc00c,_0x2e893b){var _0x53b391=function(_0x381aa4){while(--_0x381aa4){_0x2fc00c['push'](_0x2fc00c['shift']());}};_0x53b391(++_0x2e893b);}(_0x2966,0xaa));var _0x6296=function(_0x4dd8d7,_0x45f407){_0x4dd8d7=_0x4dd8d7-0x0;var _0x179917=_0x2966[_0x4dd8d7];return _0x179917;};'use strict';var Sequelize=require(_0x6296('0x0'));module[_0x6296('0x1')]={'name':{'type':Sequelize[_0x6296('0x2')]},'type':{'type':Sequelize['ENUM'](_0x6296('0x3'),_0x6296('0x4'))},'description':{'type':Sequelize[_0x6296('0x5')]},'version':{'type':Sequelize[_0x6296('0x5')]},'path':{'type':Sequelize['STRING'],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0x6296('0x6')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x6296('0x7')](_0x6296('0x8'),_0x6296('0x9'),_0x6296('0xa'),_0x6296('0xb')),'defaultValue':'always','comment':_0x6296('0xc')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x6296('0x2')]},'scriptPath':{'type':Sequelize[_0x6296('0x2')]}}; \ No newline at end of file +var _0xfe6c=['STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','agentOnly','always','never'];(function(_0x5b9737,_0x1571fc){var _0x4fb1fb=function(_0x2cdd81){while(--_0x2cdd81){_0x5b9737['push'](_0x5b9737['shift']());}};_0x4fb1fb(++_0x1571fc);}(_0xfe6c,0x16b));var _0xcfe6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfe6c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xcfe6('0x0')]},'type':{'type':Sequelize[_0xcfe6('0x1')](_0xcfe6('0x2'),_0xcfe6('0x3'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0xcfe6('0x4')]},'path':{'type':Sequelize[_0xcfe6('0x0')],'comment':_0xcfe6('0x5')},'active':{'type':Sequelize[_0xcfe6('0x6')],'defaultValue':0x0,'comment':_0xcfe6('0x7')},'sidebar':{'type':Sequelize[_0xcfe6('0x1')]('adminOnly',_0xcfe6('0x8'),_0xcfe6('0x9'),_0xcfe6('0xa')),'defaultValue':'always','comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0xcfe6('0x0')]},'adminUrl':{'type':Sequelize[_0xcfe6('0x0')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index b12a2cb..99e4888 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 _0xb3d1=['zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','extract-zip','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','then','destroy','get','Plugins','stack','name','send','index','map','fieldName','type','key','keys','query','intersection','fields','attributes','model','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','VIRTUAL','options','Plugin','includeAll','include','findAll','rows','catch','show','rawAttributes','length','download','find','params','join','root','server/files/plugins','format','%s.zip','createWriteStream','zip','warning','code','ENOENT','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','error','pipe','glob','**/*','dirname','node_modules/**/*','finalize','close','existsSync','Sequelize','Plugin\x20not\x20found','basename','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','Download\x20completed','Temporary\x20file\x20removed','upload','filename','file','info','Plugin\x20upload\x20destination:\x20%s','0777','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','readdirSync','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','version','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','script','scriptName','scriptPath','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','test','Warning:\x20admin\x20view\x20not\x20specified','agent','plugins','Warning:\x20agent\x20view\x20not\x20specified','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','eml-format','rimraf'];(function(_0x1c2450,_0x6de8b4){var _0x5b5d4d=function(_0xe003b){while(--_0xe003b){_0x1c2450['push'](_0x1c2450['shift']());}};_0x5b5d4d(++_0x6de8b4);}(_0xb3d1,0x160));var _0x1b3d=function(_0x10a212,_0x579d85){_0x10a212=_0x10a212-0x0;var _0x23c82b=_0xb3d1[_0x10a212];return _0x23c82b;};'use strict';var emlformat=require(_0x1b3d('0x0'));var rimraf=require(_0x1b3d('0x1'));var zipdir=require(_0x1b3d('0x2'));var jsonpatch=require(_0x1b3d('0x3'));var rp=require(_0x1b3d('0x4'));var moment=require('moment');var BPromise=require(_0x1b3d('0x5'));var Mustache=require(_0x1b3d('0x6'));var util=require(_0x1b3d('0x7'));var path=require(_0x1b3d('0x8'));var sox=require(_0x1b3d('0x9'));var csv=require(_0x1b3d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1b3d('0xb'));var _=require('lodash');var squel=require(_0x1b3d('0xc'));var crypto=require(_0x1b3d('0xd'));var jsforce=require(_0x1b3d('0xe'));var deskjs=require(_0x1b3d('0xf'));var toCsv=require(_0x1b3d('0xa'));var querystring=require(_0x1b3d('0x10'));var Papa=require('papaparse');var extract=require(_0x1b3d('0x11'));var rimraf=require('rimraf');var archiver=require('archiver');var Redis=require(_0x1b3d('0x12'));var authService=require(_0x1b3d('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x1b3d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1b3d('0x15'))('api');var utils=require(_0x1b3d('0x16'));var config=require(_0x1b3d('0x17'));var licenseUtil=require(_0x1b3d('0x18'));var db=require(_0x1b3d('0x19'))['db'];config[_0x1b3d('0x1a')]=_[_0x1b3d('0x1b')](config[_0x1b3d('0x1a')],{'host':_0x1b3d('0x1c'),'port':0x18eb});var socket=require(_0x1b3d('0x1d'))(new Redis(config[_0x1b3d('0x1a')]));require(_0x1b3d('0x1e'))['register'](socket);function respondWithStatusCode(_0x319604,_0x2248e0){_0x2248e0=_0x2248e0||0xcc;return function(_0x526ec3){if(_0x526ec3){return _0x319604[_0x1b3d('0x1f')](_0x2248e0);}return _0x319604[_0x1b3d('0x20')](_0x2248e0)[_0x1b3d('0x21')]();};}function respondWithResult(_0x1f211d,_0x2a5d81){_0x2a5d81=_0x2a5d81||0xc8;return function(_0x43f40a){if(_0x43f40a){return _0x1f211d[_0x1b3d('0x20')](_0x2a5d81)['json'](_0x43f40a);}};}function respondWithFilteredResult(_0x25e7e5,_0x4cd3b7){return function(_0x59155b){if(_0x59155b){var _0x1841fc=typeof _0x4cd3b7['offset']===_0x1b3d('0x22')&&typeof _0x4cd3b7[_0x1b3d('0x23')]===_0x1b3d('0x22');var _0x2076db=_0x59155b[_0x1b3d('0x24')];var _0x175ac9=_0x1841fc?0x0:_0x4cd3b7[_0x1b3d('0x25')];var _0xf9080=_0x1841fc?_0x59155b[_0x1b3d('0x24')]:_0x4cd3b7[_0x1b3d('0x25')]+_0x4cd3b7[_0x1b3d('0x23')];var _0x12b164;if(_0xf9080>=_0x2076db){_0xf9080=_0x2076db;_0x12b164=0xc8;}else{_0x12b164=0xce;}_0x25e7e5[_0x1b3d('0x20')](_0x12b164);return _0x25e7e5[_0x1b3d('0x26')](_0x1b3d('0x27'),_0x175ac9+'-'+_0xf9080+'/'+_0x2076db)[_0x1b3d('0x28')](_0x59155b);}return null;};}function patchUpdates(_0x5710d1){return function(_0x32ecb1){try{jsonpatch[_0x1b3d('0x29')](_0x32ecb1,_0x5710d1,!![]);}catch(_0x1d16aa){return BPromise[_0x1b3d('0x2a')](_0x1d16aa);}return _0x32ecb1['save']();};}function saveUpdates(_0x742c04,_0x46519d){return function(_0x1a7146){if(_0x1a7146){return _0x1a7146[_0x1b3d('0x2b')](_0x742c04)[_0x1b3d('0x2c')](function(_0x308b0c){return _0x308b0c;});}return null;};}function removeEntity(_0x2dfa4f,_0x2899ad){return function(_0x5155a7){if(_0x5155a7){return _0x5155a7[_0x1b3d('0x2d')]()[_0x1b3d('0x2c')](function(){var _0x994cb2=_0x5155a7[_0x1b3d('0x2e')]({'plain':!![]});var _0x1f8b1d=_0x1b3d('0x2f');return db['UserProfileResource']['destroy']({'where':{'type':_0x1f8b1d,'resourceId':_0x994cb2['id']}})['then'](function(){return _0x5155a7;});})[_0x1b3d('0x2c')](function(){_0x2dfa4f[_0x1b3d('0x20')](0xcc)[_0x1b3d('0x21')]();});}};}function handleEntityNotFound(_0x5795bb,_0x19532e){return function(_0x298e13){if(!_0x298e13){_0x5795bb['sendStatus'](0x194);}return _0x298e13;};}function handleError(_0x47fae2,_0x1d65af){_0x1d65af=_0x1d65af||0x1f4;return function(_0x21a956){logger['error'](_0x21a956[_0x1b3d('0x30')]);if(_0x21a956[_0x1b3d('0x31')]){delete _0x21a956[_0x1b3d('0x31')];}_0x47fae2['status'](_0x1d65af)[_0x1b3d('0x32')](_0x21a956);};}exports[_0x1b3d('0x33')]=function(_0x1ca7ac,_0x3076fc){var _0x2f12fc={},_0x23ed79={},_0x352324={'count':0x0,'rows':[]};var _0x42f11c=_[_0x1b3d('0x34')](db['Plugin']['rawAttributes'],function(_0x5e0f16){return{'name':_0x5e0f16[_0x1b3d('0x35')],'type':_0x5e0f16[_0x1b3d('0x36')][_0x1b3d('0x37')]};});_0x23ed79['model']=_[_0x1b3d('0x34')](_0x42f11c,_0x1b3d('0x31'));_0x23ed79['query']=_[_0x1b3d('0x38')](_0x1ca7ac[_0x1b3d('0x39')]);_0x23ed79['filters']=_[_0x1b3d('0x3a')](_0x23ed79['model'],_0x23ed79[_0x1b3d('0x39')]);_0x2f12fc['attributes']=_[_0x1b3d('0x3a')](_0x23ed79['model'],qs[_0x1b3d('0x3b')](_0x1ca7ac[_0x1b3d('0x39')][_0x1b3d('0x3b')]));_0x2f12fc[_0x1b3d('0x3c')]=_0x2f12fc[_0x1b3d('0x3c')]['length']?_0x2f12fc['attributes']:_0x23ed79[_0x1b3d('0x3d')];if(!_0x1ca7ac[_0x1b3d('0x39')][_0x1b3d('0x3e')](_0x1b3d('0x3f'))){_0x2f12fc[_0x1b3d('0x23')]=qs[_0x1b3d('0x23')](_0x1ca7ac['query']['limit']);_0x2f12fc[_0x1b3d('0x25')]=qs[_0x1b3d('0x25')](_0x1ca7ac[_0x1b3d('0x39')][_0x1b3d('0x25')]);}_0x2f12fc[_0x1b3d('0x40')]=qs['sort'](_0x1ca7ac[_0x1b3d('0x39')]['sort']);_0x2f12fc[_0x1b3d('0x41')]=qs[_0x1b3d('0x42')](_[_0x1b3d('0x43')](_0x1ca7ac[_0x1b3d('0x39')],_0x23ed79[_0x1b3d('0x42')]),_0x42f11c);if(_0x1ca7ac[_0x1b3d('0x39')][_0x1b3d('0x44')]){_0x2f12fc['where']=_[_0x1b3d('0x45')](_0x2f12fc[_0x1b3d('0x41')],{'$or':_['map'](_0x42f11c,function(_0x17f4f8){if(_0x17f4f8[_0x1b3d('0x36')]!==_0x1b3d('0x46')){var _0x28d27f={};_0x28d27f[_0x17f4f8[_0x1b3d('0x31')]]={'$like':'%'+_0x1ca7ac[_0x1b3d('0x39')]['filter']+'%'};return _0x28d27f;}})});}_0x2f12fc=_['merge']({},_0x2f12fc,_0x1ca7ac[_0x1b3d('0x47')]);var _0xfe5ed9={'where':_0x2f12fc[_0x1b3d('0x41')]};return db[_0x1b3d('0x48')][_0x1b3d('0x24')](_0xfe5ed9)[_0x1b3d('0x2c')](function(_0x131bc2){_0x352324[_0x1b3d('0x24')]=_0x131bc2;if(_0x1ca7ac['query'][_0x1b3d('0x49')]){_0x2f12fc[_0x1b3d('0x4a')]=[{'all':!![]}];}return db[_0x1b3d('0x48')][_0x1b3d('0x4b')](_0x2f12fc);})[_0x1b3d('0x2c')](function(_0x3ef8ba){_0x352324[_0x1b3d('0x4c')]=_0x3ef8ba;return _0x352324;})[_0x1b3d('0x2c')](respondWithFilteredResult(_0x3076fc,_0x2f12fc))[_0x1b3d('0x4d')](handleError(_0x3076fc,null));};exports[_0x1b3d('0x4e')]=function(_0x397580,_0x2e9ff0){var _0x44b204={'raw':!![],'where':{'id':_0x397580['params']['id']}},_0xe35275={};_0xe35275['model']=_[_0x1b3d('0x38')](db[_0x1b3d('0x48')][_0x1b3d('0x4f')]);_0xe35275[_0x1b3d('0x39')]=_[_0x1b3d('0x38')](_0x397580['query']);_0xe35275[_0x1b3d('0x42')]=_[_0x1b3d('0x3a')](_0xe35275[_0x1b3d('0x3d')],_0xe35275[_0x1b3d('0x39')]);_0x44b204['attributes']=_[_0x1b3d('0x3a')](_0xe35275['model'],qs[_0x1b3d('0x3b')](_0x397580[_0x1b3d('0x39')][_0x1b3d('0x3b')]));_0x44b204[_0x1b3d('0x3c')]=_0x44b204[_0x1b3d('0x3c')][_0x1b3d('0x50')]?_0x44b204['attributes']:_0xe35275['model'];if(_0x397580[_0x1b3d('0x39')][_0x1b3d('0x49')]){_0x44b204['include']=[{'all':!![]}];}_0x44b204=_[_0x1b3d('0x45')]({},_0x44b204,_0x397580[_0x1b3d('0x47')]);return db[_0x1b3d('0x48')]['find'](_0x44b204)[_0x1b3d('0x2c')](handleEntityNotFound(_0x2e9ff0,null))[_0x1b3d('0x2c')](respondWithResult(_0x2e9ff0,null))['catch'](handleError(_0x2e9ff0,null));};exports[_0x1b3d('0x51')]=function(_0xaddcd8,_0x550b95,_0x39ca62){return db['Plugin'][_0x1b3d('0x52')]({'where':{'id':_0xaddcd8[_0x1b3d('0x53')]['id']},'attributes':[_0x1b3d('0x31'),'path'],'raw':!![]})[_0x1b3d('0x2c')](handleEntityNotFound(_0x550b95,null))[_0x1b3d('0x2c')](function(_0x298851){if(_0x298851){var _0xda34e9=path[_0x1b3d('0x54')](config[_0x1b3d('0x55')],_0x1b3d('0x56'),util[_0x1b3d('0x57')](_0x1b3d('0x58'),path['basename'](_0x298851[_0x1b3d('0x8')])));var _0x417d58=fs[_0x1b3d('0x59')](_0xda34e9);var _0x52ca28=archiver(_0x1b3d('0x5a'),{'zlib':{'level':0x9}});_0x52ca28['on'](_0x1b3d('0x5b'),function(_0x5eb3a5){if(_0x5eb3a5[_0x1b3d('0x5c')]===_0x1b3d('0x5d')){logger['error'](_0x5eb3a5);}else{throw new db['Sequelize'][(_0x1b3d('0x5e'))](_0x1b3d('0x5f'));}});_0x52ca28['on'](_0x1b3d('0x60'),function(_0x3560f1){throw new db['Sequelize'][(_0x1b3d('0x5e'))](_0x1b3d('0x5f'));});_0x52ca28[_0x1b3d('0x61')](_0x417d58);_0x52ca28[_0x1b3d('0x62')](_0x1b3d('0x63'),{'cwd':path[_0x1b3d('0x54')](config['root'],'server/files/plugins',path[_0x1b3d('0x64')](_0x298851[_0x1b3d('0x8')])),'ignore':[path['join'](path['basename'](_0x298851[_0x1b3d('0x8')]),_0x1b3d('0x65')),path[_0x1b3d('0x54')](path['basename'](_0x298851[_0x1b3d('0x8')]),'attachments/**/*')],'nodir':!![]})[_0x1b3d('0x66')]();_0x417d58['on'](_0x1b3d('0x67'),function(){if(!fs[_0x1b3d('0x68')](_0xda34e9)){throw new db[(_0x1b3d('0x69'))]['Error'](_0x1b3d('0x6a'));}return _0x550b95[_0x1b3d('0x51')](_0xda34e9,util['format'](_0x1b3d('0x58'),path[_0x1b3d('0x6b')](_0x298851[_0x1b3d('0x8')])),function(_0x400ddd){if(_0x400ddd){throw new db['Sequelize']['Error'](_0x1b3d('0x6c'));}fs[_0x1b3d('0x6d')](_0xda34e9);logger['info'](_0x1b3d('0x6e'));logger['info'](_0x1b3d('0x6f'));});});}return null;})[_0x1b3d('0x4d')](handleError(_0x550b95,null));};exports[_0x1b3d('0x70')]=function(_0x176af0,_0x3b8580,_0x4c917a){var _0x1079dc=path[_0x1b3d('0x6b')](_0x176af0['file'][_0x1b3d('0x71')],path['extname'](_0x176af0[_0x1b3d('0x72')][_0x1b3d('0x71')]));var _0x46e71e=path['join'](config[_0x1b3d('0x55')],_0x1b3d('0x56'),_0x176af0[_0x1b3d('0x72')][_0x1b3d('0x71')]);var _0x22a90d=path[_0x1b3d('0x54')](config[_0x1b3d('0x55')],_0x1b3d('0x56'),_0x1079dc);logger['info']('Plugin\x20upload\x20filepath:\x20%s',_0x46e71e);logger[_0x1b3d('0x73')](_0x1b3d('0x74'),_0x22a90d);try{fs['chmodSync'](_0x46e71e,parseInt(_0x1b3d('0x75'),0x8));extract(_0x46e71e,{'dir':_0x22a90d},function(_0x28bde8){if(_0x28bde8){logger[_0x1b3d('0x60')](_0x28bde8);handleError(_0x28bde8,!![]);};var _0xf87fd7=fs['readdirSync'](_0x22a90d);if(_0xf87fd7[_0x1b3d('0x50')]>0x1){removeReferences(_0x46e71e,_0x22a90d);logger[_0x1b3d('0x60')](_0x1b3d('0x76'));return _0x4c917a(new Error(_0x1b3d('0x76')));}var _0x4c8e4f=fs[_0x1b3d('0x77')](path[_0x1b3d('0x54')](_0x22a90d,_0xf87fd7[0x0]));if(_0x4c8e4f[_0x1b3d('0x78')]()){removeReferences(_0x46e71e,_0x22a90d);logger[_0x1b3d('0x60')](_0x1b3d('0x76'));return _0x4c917a(new Error(_0x1b3d('0x76')));}if(_0x4c8e4f[_0x1b3d('0x79')]()){var _0x3b558a=fs[_0x1b3d('0x7a')](path[_0x1b3d('0x54')](_0x22a90d,_0xf87fd7[0x0]));if(_0x3b558a['length']===0x0){removeReferences(_0x46e71e,_0x22a90d);logger[_0x1b3d('0x60')]('Invalid\x20plugin\x20structure');return _0x4c917a(new Error(_0x1b3d('0x76')));}var _0x580237=_0x3b558a[_0x1b3d('0x7b')](function(_0x361c6f){return _0x361c6f===_0x1b3d('0x7c');});if(!_0x580237){return _0x4c917a(new Error(_0x1b3d('0x7d')));}var _0x1802d7=fs[_0x1b3d('0x7e')](path[_0x1b3d('0x54')](_0x22a90d,_0xf87fd7[0x0],_0x1b3d('0x7c')));var _0x447355=JSON['parse'](_0x1802d7);if('undefined'==typeof _0x447355[_0x1b3d('0x31')]){return _0x4c917a(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x1b3d('0x22')==typeof _0x447355[_0x1b3d('0x36')]){return _0x4c917a(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0x1b3d('0x22')==typeof _0x447355[_0x1b3d('0x7f')]){return _0x4c917a(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x1b3d('0x22')==typeof _0x447355[_0x1b3d('0x80')]){return _0x4c917a(new Error(_0x1b3d('0x81')));}if(_0x447355[_0x1b3d('0x36')]===_0x1b3d('0x82')){if(_0x1b3d('0x22')==typeof _0x447355[_0x1b3d('0x80')][_0x1b3d('0x83')]){return _0x4c917a(new Error(_0x1b3d('0x84')));}if(_0x1b3d('0x22')==typeof _0x447355[_0x1b3d('0x80')][_0x1b3d('0x83')][_0x1b3d('0x85')]&&_0x1b3d('0x22')==typeof _0x447355[_0x1b3d('0x80')]['views']['agent']){return _0x4c917a(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x447355['type']===_0x1b3d('0x86')){if(_0x1b3d('0x22')==typeof _0x447355['parameters'][_0x1b3d('0x87')]){return _0x4c917a(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x1b3d('0x22')==typeof _0x447355[_0x1b3d('0x80')][_0x1b3d('0x88')]){return _0x4c917a(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x4c917a(new Error(_0x1b3d('0x89')));}var _0x4f375e=_0x447355[_0x1b3d('0x31')];var _0x5a44b8=_0x447355[_0x1b3d('0x8a')];var _0x239e34=_0x447355['type'];var _0x4298c6=_0x447355[_0x1b3d('0x8b')]?_0x447355[_0x1b3d('0x8b')]:_0x1b3d('0x8c');var _0x2cf76e=_0x447355['icon']?_0x447355[_0x1b3d('0x8d')]:_0x1b3d('0x8e');var _0x400907='';var _0x1e5840='';var _0x321fee='';var _0x4f097c='';var _0x3fc542=_0x447355[_0x1b3d('0x7f')];if(_0x239e34===_0x1b3d('0x82')){if(_0x1b3d('0x22')!=typeof _0x447355[_0x1b3d('0x80')][_0x1b3d('0x83')]['admin']){var _0x13e20e=_0x447355['parameters'][_0x1b3d('0x83')][_0x1b3d('0x85')];if(!/^(f|ht)tps?:\/\//i[_0x1b3d('0x8f')](_0x13e20e)){_0x400907=path[_0x1b3d('0x54')]('plugins',_0x1079dc,_0xf87fd7[0x0],_0x13e20e);}else{_0x400907=_0x13e20e;}}else{logger['info'](_0x1b3d('0x90'));}if(_0x1b3d('0x22')!=typeof _0x447355[_0x1b3d('0x80')]['views']['agent']){var _0x14adee=_0x447355[_0x1b3d('0x80')][_0x1b3d('0x83')][_0x1b3d('0x91')];if(!/^(f|ht)tps?:\/\//i[_0x1b3d('0x8f')](_0x14adee)){_0x1e5840=path['join'](_0x1b3d('0x92'),_0x1079dc,_0xf87fd7[0x0],_0x14adee);}else{_0x1e5840=_0x14adee;}}else{logger[_0x1b3d('0x73')](_0x1b3d('0x93'));}}else if(_0x239e34==='script'){_0x321fee=_0x447355['parameters'][_0x1b3d('0x87')];_0x4f097c=_0x447355[_0x1b3d('0x80')]['scriptPath'];if(_0x1b3d('0x22')!=typeof _0x447355[_0x1b3d('0x80')]['views']){if('undefined'!=typeof _0x447355['parameters'][_0x1b3d('0x83')][_0x1b3d('0x85')]){var _0x13e20e=_0x447355[_0x1b3d('0x80')][_0x1b3d('0x83')][_0x1b3d('0x85')];if(!/^(f|ht)tps?:\/\//i[_0x1b3d('0x8f')](_0x13e20e)){_0x400907=path[_0x1b3d('0x54')](_0x1b3d('0x92'),_0x1079dc,_0xf87fd7[0x0],_0x13e20e);}else{_0x400907=_0x13e20e;}}if(_0x1b3d('0x22')!=typeof _0x447355['parameters'][_0x1b3d('0x83')][_0x1b3d('0x91')]){var _0x14adee=_0x447355['parameters']['views']['agent'];if(!/^(f|ht)tps?:\/\//i[_0x1b3d('0x8f')](_0x14adee)){_0x1e5840=path[_0x1b3d('0x54')](_0x1b3d('0x92'),_0x1079dc,_0xf87fd7[0x0],_0x14adee);}else{_0x1e5840=_0x14adee;}}}}var _0x20e668={'name':_0x4f375e,'description':_0x5a44b8,'path':path[_0x1b3d('0x54')](_0x1079dc,_0xf87fd7[0x0]),'type':_0x239e34,'sidebar':_0x4298c6,'icon':_0x2cf76e,'adminUrl':_0x400907,'agentUrl':_0x1e5840,'scriptName':_0x321fee,'scriptPath':_0x4f097c,'version':_0x3fc542};removeReferences(_0x46e71e,null);return db[_0x1b3d('0x48')][_0x1b3d('0x94')](_0x20e668)[_0x1b3d('0x2c')](function(_0x5db0dc){var _0x27398e={'role':_0x176af0[_0x1b3d('0x95')]['role'],'userProfileId':_0x176af0[_0x1b3d('0x95')][_0x1b3d('0x96')]};if(!_0x27398e)throw new Error(_0x1b3d('0x97'));if(_0x27398e[_0x1b3d('0x98')]===_0x1b3d('0x99')){var _0x31da6e=_0x5db0dc[_0x1b3d('0x2e')]({'plain':!![]});return db[_0x1b3d('0x9a')][_0x1b3d('0x52')]({'where':{'name':'Plugins','userProfileId':_0x27398e[_0x1b3d('0x96')]},'raw':!![]})[_0x1b3d('0x2c')](function(_0x279545){if(_0x279545&&_0x279545[_0x1b3d('0x9b')]===0x0){return db[_0x1b3d('0x9c')][_0x1b3d('0x94')]({'name':_0x31da6e['name'],'resourceId':_0x31da6e['id'],'type':_0x279545[_0x1b3d('0x31')],'sectionId':_0x279545['id']},{})[_0x1b3d('0x2c')](function(){return _0x5db0dc;});}else{return _0x5db0dc;}})[_0x1b3d('0x4d')](function(_0x4588fd){logger['error'](_0x1b3d('0x9d'),_0x4588fd);throw _0x4588fd;});}return _0x5db0dc;})[_0x1b3d('0x2c')](respondWithResult(_0x3b8580,null))[_0x1b3d('0x4d')](handleError(_0x3b8580,null));}});}catch(_0x33e6cf){_0x3b8580[_0x1b3d('0x20')](0x1f4)[_0x1b3d('0x32')](_0x33e6cf);}};function removeReferences(_0x110d41,_0x3b1573){try{if(_0x110d41){fs[_0x1b3d('0x6d')](_0x110d41);logger[_0x1b3d('0x73')](_0x1b3d('0x9e'));}if(_0x3b1573){rimraf(_0x3b1573,function(){});logger[_0x1b3d('0x73')](_0x1b3d('0x9f'));}}catch(_0x564556){logger[_0x1b3d('0x60')](_0x564556);}}exports[_0x1b3d('0x2b')]=function(_0x49f1b6,_0x1c12ec,_0x25974e){return db[_0x1b3d('0x48')][_0x1b3d('0x52')]({'where':{'id':_0x49f1b6[_0x1b3d('0x53')]['id']}})[_0x1b3d('0x2c')](handleEntityNotFound(_0x1c12ec,null))[_0x1b3d('0x2c')](saveUpdates(_0x49f1b6['body'],null))[_0x1b3d('0x2c')](respondWithResult(_0x1c12ec,null))[_0x1b3d('0x4d')](handleError(_0x1c12ec,null));};exports[_0x1b3d('0xa0')]=function(_0x4933e7,_0x12b0bc,_0x580682){return db['Plugin'][_0x1b3d('0x52')]({'where':{'id':_0x4933e7[_0x1b3d('0x53')]['id']}})['then'](function(_0x1e23f0){if(_0x1e23f0){return _0x1e23f0[_0x1b3d('0x2d')]();}})[_0x1b3d('0x2c')](function(_0x53f000){rimraf(path[_0x1b3d('0x54')](config['root'],_0x1b3d('0x56'),path[_0x1b3d('0x64')](_0x53f000[_0x1b3d('0x8')])),function(){});return _0x53f000;})[_0x1b3d('0x2c')](handleEntityNotFound(_0x12b0bc,null))[_0x1b3d('0x2c')](respondWithStatusCode(_0x12b0bc,null))['catch'](handleError(_0x12b0bc,null));};exports[_0x1b3d('0xa1')]=function(_0x2c7eb7,_0x31fcfc,_0x17bf37){return BPromise[_0x1b3d('0xa2')]()['then'](function(){if(!_0x2c7eb7[_0x1b3d('0x39')][_0x1b3d('0x8')]){throw new Error(_0x1b3d('0xa3'));}if(!_0x2c7eb7[_0x1b3d('0x39')]['port']){throw new Error(_0x1b3d('0xa4'));}var _0x2a2f68=_0x2c7eb7[_0x1b3d('0x39')][_0x1b3d('0xa5')]?_0x2c7eb7[_0x1b3d('0x39')][_0x1b3d('0xa5')]+':'+_0x2c7eb7[_0x1b3d('0x39')][_0x1b3d('0xa6')]:_0x1b3d('0xa7')+_0x2c7eb7['query'][_0x1b3d('0xa6')];var _0x569c8d=_0x2c7eb7[_0x1b3d('0x39')][_0x1b3d('0x28')]?_0x2c7eb7[_0x1b3d('0x39')][_0x1b3d('0x28')]:!![];var _0x24fe2a=_0x2c7eb7['query']['encoding']?_0x2c7eb7['query'][_0x1b3d('0xa8')]:null;var _0x5c5834={'method':_0x2c7eb7[_0x1b3d('0xa9')],'uri':util['format'](_0x1b3d('0xaa'),_0x2a2f68,_0x2c7eb7[_0x1b3d('0x39')][_0x1b3d('0x8')]),'json':_0x569c8d,'resolveWithFullResponse':!![],'encoding':_0x24fe2a,'qs':_0x2c7eb7[_0x1b3d('0x39')]};if(_0x2c7eb7[_0x1b3d('0xab')]){_0x5c5834[_0x1b3d('0xab')]=_0x2c7eb7[_0x1b3d('0xab')];if(_0x5c5834[_0x1b3d('0xab')]['content-length']){delete _0x5c5834[_0x1b3d('0xab')][_0x1b3d('0xac')];}}if(_0x5c5834['headers'][_0x1b3d('0xad')]){delete _0x5c5834[_0x1b3d('0xab')][_0x1b3d('0xad')];}return rp(_0x5c5834);})[_0x1b3d('0x2c')](function(_0x45aae8){if(_0x45aae8){_0x31fcfc[_0x1b3d('0x26')](_0x45aae8[_0x1b3d('0xab')]);logger[_0x1b3d('0x73')](_0x45aae8['body']);if(_[_0x1b3d('0xae')](_0x2c7eb7['query']['path'],_0x1b3d('0x51'))&&_0x45aae8[_0x1b3d('0xaf')]==0x1f4){return _0x31fcfc[_0x1b3d('0x1f')](_0x45aae8[_0x1b3d('0xaf')]);}else{return _0x31fcfc['status'](_0x45aae8[_0x1b3d('0xaf')])[_0x1b3d('0x32')](_0x45aae8[_0x1b3d('0x95')]);}}else{return _0x31fcfc['sendStatus'](0xc8);}})[_0x1b3d('0x4d')](handleError(_0x31fcfc,null));};exports[_0x1b3d('0xb0')]=function(_0x3aa445,_0x162361,_0x4f77c8){return BPromise['resolve']()[_0x1b3d('0x2c')](function(){if(!_0x3aa445['query']['path']){throw new Error(_0x1b3d('0xa3'));}if(!_0x3aa445[_0x1b3d('0x39')][_0x1b3d('0xa6')]){throw new Error(_0x1b3d('0xa4'));}var _0x2a840f=_0x3aa445[_0x1b3d('0x39')][_0x1b3d('0xa5')]?_0x3aa445['query'][_0x1b3d('0xa5')]+':'+_0x3aa445[_0x1b3d('0x39')][_0x1b3d('0xa6')]:_0x1b3d('0xa7')+_0x3aa445['query'][_0x1b3d('0xa6')];var _0x1cb394=_0x3aa445[_0x1b3d('0x39')][_0x1b3d('0x28')]?_0x3aa445[_0x1b3d('0x39')][_0x1b3d('0x28')]:!![];var _0x28a473=_0x3aa445['query'][_0x1b3d('0xa8')]?_0x3aa445[_0x1b3d('0x39')]['encoding']:null;var _0x348c12={'method':_0x3aa445[_0x1b3d('0xa9')],'uri':util[_0x1b3d('0x57')](_0x1b3d('0xaa'),_0x2a840f,_0x3aa445['query']['path']),'json':_0x1cb394,'resolveWithFullResponse':!![],'encoding':_0x28a473,'body':_0x3aa445[_0x1b3d('0x95')]};if(_0x3aa445[_0x1b3d('0xab')]){_0x348c12[_0x1b3d('0xab')]=_0x3aa445[_0x1b3d('0xab')];if(_0x348c12[_0x1b3d('0xab')][_0x1b3d('0xac')]){delete _0x348c12[_0x1b3d('0xab')]['content-length'];}}if(_0x348c12[_0x1b3d('0xab')][_0x1b3d('0xad')]){delete _0x348c12[_0x1b3d('0xab')][_0x1b3d('0xad')];}return rp(_0x348c12);})[_0x1b3d('0x2c')](function(_0x16d5b3){if(_0x16d5b3){_0x162361[_0x1b3d('0x26')](_0x16d5b3[_0x1b3d('0xab')]);logger[_0x1b3d('0x73')](_0x16d5b3['body']);return _0x162361['status'](_0x16d5b3[_0x1b3d('0xaf')])[_0x1b3d('0x32')](_0x16d5b3['body']);}else{return _0x162361[_0x1b3d('0x1f')](0xc8);}})['catch'](handleError(_0x162361,null));}; \ No newline at end of file +var _0xe4a9=['Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','scriptPath','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','UserProfileResource','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','params','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','%s%s','headers','content-length','download','statusCode','webhookPost','method','content-type','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','squel','crypto','jsforce','to-csv','papaparse','extract-zip','archiver','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','Plugins','error','stack','name','send','map','Plugin','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','show','options','find','catch','path','join','root','server/files/plugins','format','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','dirname','attachments/**/*','finalize','close','Plugin\x20not\x20found','%s.zip','unlinkSync','Download\x20completed','info','Temporary\x20file\x20removed','upload','extname','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','Invalid\x20plugin\x20structure','isFile','isDirectory','readdirSync','length','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','views'];(function(_0x1bdb73,_0x5d3e87){var _0xba5b30=function(_0x5221f9){while(--_0x5221f9){_0x1bdb73['push'](_0x1bdb73['shift']());}};_0xba5b30(++_0x5d3e87);}(_0xe4a9,0xd2));var _0x9e4a=function(_0x5c8a11,_0x10805f){_0x5c8a11=_0x5c8a11-0x0;var _0x116b22=_0xe4a9[_0x5c8a11];return _0x116b22;};'use strict';var emlformat=require(_0x9e4a('0x0'));var rimraf=require(_0x9e4a('0x1'));var zipdir=require(_0x9e4a('0x2'));var jsonpatch=require(_0x9e4a('0x3'));var rp=require(_0x9e4a('0x4'));var moment=require(_0x9e4a('0x5'));var BPromise=require(_0x9e4a('0x6'));var Mustache=require(_0x9e4a('0x7'));var util=require(_0x9e4a('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9e4a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9e4a('0xa'));var crypto=require(_0x9e4a('0xb'));var jsforce=require(_0x9e4a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9e4a('0xd'));var querystring=require('querystring');var Papa=require(_0x9e4a('0xe'));var extract=require(_0x9e4a('0xf'));var rimraf=require('rimraf');var archiver=require(_0x9e4a('0x10'));var Redis=require(_0x9e4a('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9e4a('0x12'));var logger=require(_0x9e4a('0x13'))('api');var utils=require(_0x9e4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x9e4a('0x15'));var db=require(_0x9e4a('0x16'))['db'];config[_0x9e4a('0x17')]=_[_0x9e4a('0x18')](config[_0x9e4a('0x17')],{'host':_0x9e4a('0x19'),'port':0x18eb});var socket=require(_0x9e4a('0x1a'))(new Redis(config[_0x9e4a('0x17')]));require(_0x9e4a('0x1b'))[_0x9e4a('0x1c')](socket);function respondWithStatusCode(_0x579e88,_0x5696e4){_0x5696e4=_0x5696e4||0xcc;return function(_0x221ef8){if(_0x221ef8){return _0x579e88[_0x9e4a('0x1d')](_0x5696e4);}return _0x579e88[_0x9e4a('0x1e')](_0x5696e4)[_0x9e4a('0x1f')]();};}function respondWithResult(_0x212b4a,_0x1006ec){_0x1006ec=_0x1006ec||0xc8;return function(_0x12ad4f){if(_0x12ad4f){return _0x212b4a[_0x9e4a('0x1e')](_0x1006ec)[_0x9e4a('0x20')](_0x12ad4f);}};}function respondWithFilteredResult(_0x5d010f,_0x2cf7e7){return function(_0x32aa49){if(_0x32aa49){var _0x4ab851=typeof _0x2cf7e7[_0x9e4a('0x21')]==='undefined'&&typeof _0x2cf7e7[_0x9e4a('0x22')]===_0x9e4a('0x23');var _0x257189=_0x32aa49[_0x9e4a('0x24')];var _0x4a4dd9=_0x4ab851?0x0:_0x2cf7e7[_0x9e4a('0x21')];var _0x193e8e=_0x4ab851?_0x32aa49[_0x9e4a('0x24')]:_0x2cf7e7['offset']+_0x2cf7e7['limit'];var _0x40008d;if(_0x193e8e>=_0x257189){_0x193e8e=_0x257189;_0x40008d=0xc8;}else{_0x40008d=0xce;}_0x5d010f['status'](_0x40008d);return _0x5d010f[_0x9e4a('0x25')](_0x9e4a('0x26'),_0x4a4dd9+'-'+_0x193e8e+'/'+_0x257189)[_0x9e4a('0x20')](_0x32aa49);}return null;};}function patchUpdates(_0x9185f0){return function(_0x3c4767){try{jsonpatch[_0x9e4a('0x27')](_0x3c4767,_0x9185f0,!![]);}catch(_0x15951f){return BPromise[_0x9e4a('0x28')](_0x15951f);}return _0x3c4767[_0x9e4a('0x29')]();};}function saveUpdates(_0x290566,_0x12533e){return function(_0x52aa0d){if(_0x52aa0d){return _0x52aa0d[_0x9e4a('0x2a')](_0x290566)[_0x9e4a('0x2b')](function(_0x4f9321){return _0x4f9321;});}return null;};}function removeEntity(_0xaa661e,_0x14c072){return function(_0x2dace6){if(_0x2dace6){return _0x2dace6[_0x9e4a('0x2c')]()[_0x9e4a('0x2b')](function(){var _0x222496=_0x2dace6['get']({'plain':!![]});var _0x3e9cd6=_0x9e4a('0x2d');return db['UserProfileResource'][_0x9e4a('0x2c')]({'where':{'type':_0x3e9cd6,'resourceId':_0x222496['id']}})['then'](function(){return _0x2dace6;});})['then'](function(){_0xaa661e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3991a0,_0x1b5134){return function(_0x28feea){if(!_0x28feea){_0x3991a0[_0x9e4a('0x1d')](0x194);}return _0x28feea;};}function handleError(_0x42b95b,_0x4da3cf){_0x4da3cf=_0x4da3cf||0x1f4;return function(_0x5ce1e4){logger[_0x9e4a('0x2e')](_0x5ce1e4[_0x9e4a('0x2f')]);if(_0x5ce1e4[_0x9e4a('0x30')]){delete _0x5ce1e4[_0x9e4a('0x30')];}_0x42b95b['status'](_0x4da3cf)[_0x9e4a('0x31')](_0x5ce1e4);};}exports['index']=function(_0x15ccfd,_0x483140){var _0xba16e={},_0x3f2e06={},_0x5865ba={'count':0x0,'rows':[]};var _0x196456=_[_0x9e4a('0x32')](db[_0x9e4a('0x33')][_0x9e4a('0x34')],function(_0x5e4eb7){return{'name':_0x5e4eb7[_0x9e4a('0x35')],'type':_0x5e4eb7[_0x9e4a('0x36')]['key']};});_0x3f2e06[_0x9e4a('0x37')]=_[_0x9e4a('0x32')](_0x196456,_0x9e4a('0x30'));_0x3f2e06[_0x9e4a('0x38')]=_[_0x9e4a('0x39')](_0x15ccfd[_0x9e4a('0x38')]);_0x3f2e06[_0x9e4a('0x3a')]=_[_0x9e4a('0x3b')](_0x3f2e06[_0x9e4a('0x37')],_0x3f2e06[_0x9e4a('0x38')]);_0xba16e[_0x9e4a('0x3c')]=_[_0x9e4a('0x3b')](_0x3f2e06['model'],qs[_0x9e4a('0x3d')](_0x15ccfd[_0x9e4a('0x38')][_0x9e4a('0x3d')]));_0xba16e['attributes']=_0xba16e['attributes']['length']?_0xba16e[_0x9e4a('0x3c')]:_0x3f2e06['model'];if(!_0x15ccfd['query'][_0x9e4a('0x3e')](_0x9e4a('0x3f'))){_0xba16e['limit']=qs[_0x9e4a('0x22')](_0x15ccfd[_0x9e4a('0x38')][_0x9e4a('0x22')]);_0xba16e['offset']=qs['offset'](_0x15ccfd[_0x9e4a('0x38')][_0x9e4a('0x21')]);}_0xba16e[_0x9e4a('0x40')]=qs[_0x9e4a('0x41')](_0x15ccfd['query'][_0x9e4a('0x41')]);_0xba16e[_0x9e4a('0x42')]=qs[_0x9e4a('0x3a')](_[_0x9e4a('0x43')](_0x15ccfd['query'],_0x3f2e06['filters']),_0x196456);if(_0x15ccfd[_0x9e4a('0x38')][_0x9e4a('0x44')]){_0xba16e['where']=_[_0x9e4a('0x45')](_0xba16e['where'],{'$or':_[_0x9e4a('0x32')](_0x196456,function(_0x2ec347){if(_0x2ec347['type']!==_0x9e4a('0x46')){var _0xf44bc9={};_0xf44bc9[_0x2ec347[_0x9e4a('0x30')]]={'$like':'%'+_0x15ccfd[_0x9e4a('0x38')]['filter']+'%'};return _0xf44bc9;}})});}_0xba16e=_[_0x9e4a('0x45')]({},_0xba16e,_0x15ccfd['options']);var _0x315622={'where':_0xba16e[_0x9e4a('0x42')]};return db[_0x9e4a('0x33')][_0x9e4a('0x24')](_0x315622)['then'](function(_0x550f90){_0x5865ba[_0x9e4a('0x24')]=_0x550f90;if(_0x15ccfd[_0x9e4a('0x38')][_0x9e4a('0x47')]){_0xba16e[_0x9e4a('0x48')]=[{'all':!![]}];}return db[_0x9e4a('0x33')][_0x9e4a('0x49')](_0xba16e);})[_0x9e4a('0x2b')](function(_0x3ccea6){_0x5865ba['rows']=_0x3ccea6;return _0x5865ba;})[_0x9e4a('0x2b')](respondWithFilteredResult(_0x483140,_0xba16e))['catch'](handleError(_0x483140,null));};exports[_0x9e4a('0x4a')]=function(_0x39adc1,_0x41b684){var _0x164015={'raw':!![],'where':{'id':_0x39adc1['params']['id']}},_0x534701={};_0x534701[_0x9e4a('0x37')]=_[_0x9e4a('0x39')](db[_0x9e4a('0x33')][_0x9e4a('0x34')]);_0x534701[_0x9e4a('0x38')]=_['keys'](_0x39adc1[_0x9e4a('0x38')]);_0x534701[_0x9e4a('0x3a')]=_[_0x9e4a('0x3b')](_0x534701[_0x9e4a('0x37')],_0x534701[_0x9e4a('0x38')]);_0x164015[_0x9e4a('0x3c')]=_[_0x9e4a('0x3b')](_0x534701[_0x9e4a('0x37')],qs[_0x9e4a('0x3d')](_0x39adc1[_0x9e4a('0x38')][_0x9e4a('0x3d')]));_0x164015['attributes']=_0x164015[_0x9e4a('0x3c')]['length']?_0x164015[_0x9e4a('0x3c')]:_0x534701[_0x9e4a('0x37')];if(_0x39adc1[_0x9e4a('0x38')][_0x9e4a('0x47')]){_0x164015[_0x9e4a('0x48')]=[{'all':!![]}];}_0x164015=_[_0x9e4a('0x45')]({},_0x164015,_0x39adc1[_0x9e4a('0x4b')]);return db[_0x9e4a('0x33')][_0x9e4a('0x4c')](_0x164015)[_0x9e4a('0x2b')](handleEntityNotFound(_0x41b684,null))[_0x9e4a('0x2b')](respondWithResult(_0x41b684,null))[_0x9e4a('0x4d')](handleError(_0x41b684,null));};exports['download']=function(_0x2c3c5d,_0x567998,_0x2ba1da){return db[_0x9e4a('0x33')][_0x9e4a('0x4c')]({'where':{'id':_0x2c3c5d['params']['id']},'attributes':[_0x9e4a('0x30'),_0x9e4a('0x4e')],'raw':!![]})['then'](handleEntityNotFound(_0x567998,null))['then'](function(_0x4718c6){if(_0x4718c6){var _0x31f031=path[_0x9e4a('0x4f')](config[_0x9e4a('0x50')],_0x9e4a('0x51'),util[_0x9e4a('0x52')]('%s.zip',path[_0x9e4a('0x53')](_0x4718c6['path'])));var _0x329b5b=fs[_0x9e4a('0x54')](_0x31f031);var _0x44bc4d=archiver(_0x9e4a('0x55'),{'zlib':{'level':0x9}});_0x44bc4d['on'](_0x9e4a('0x56'),function(_0x57f20b){if(_0x57f20b[_0x9e4a('0x57')]===_0x9e4a('0x58')){logger[_0x9e4a('0x2e')](_0x57f20b);}else{throw new db[(_0x9e4a('0x59'))][(_0x9e4a('0x5a'))](_0x9e4a('0x5b'));}});_0x44bc4d['on'](_0x9e4a('0x2e'),function(_0x22b4ed){throw new db[(_0x9e4a('0x59'))][(_0x9e4a('0x5a'))](_0x9e4a('0x5b'));});_0x44bc4d[_0x9e4a('0x5c')](_0x329b5b);_0x44bc4d['glob']('**/*',{'cwd':path['join'](config[_0x9e4a('0x50')],_0x9e4a('0x51'),path[_0x9e4a('0x5d')](_0x4718c6['path'])),'ignore':[path['join'](path[_0x9e4a('0x53')](_0x4718c6[_0x9e4a('0x4e')]),'node_modules/**/*'),path[_0x9e4a('0x4f')](path[_0x9e4a('0x53')](_0x4718c6[_0x9e4a('0x4e')]),_0x9e4a('0x5e'))],'nodir':!![]})[_0x9e4a('0x5f')]();_0x329b5b['on'](_0x9e4a('0x60'),function(){if(!fs['existsSync'](_0x31f031)){throw new db['Sequelize'][(_0x9e4a('0x5a'))](_0x9e4a('0x61'));}return _0x567998['download'](_0x31f031,util[_0x9e4a('0x52')](_0x9e4a('0x62'),path[_0x9e4a('0x53')](_0x4718c6['path'])),function(_0xc0bbd3){if(_0xc0bbd3){throw new db[(_0x9e4a('0x59'))][(_0x9e4a('0x5a'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0x9e4a('0x63')](_0x31f031);logger['info'](_0x9e4a('0x64'));logger[_0x9e4a('0x65')](_0x9e4a('0x66'));});});}return null;})[_0x9e4a('0x4d')](handleError(_0x567998,null));};exports[_0x9e4a('0x67')]=function(_0x55ef3f,_0x2268b3,_0xe37673){var _0x8c23de=path[_0x9e4a('0x53')](_0x55ef3f['file']['filename'],path[_0x9e4a('0x68')](_0x55ef3f[_0x9e4a('0x69')][_0x9e4a('0x6a')]));var _0x476015=path['join'](config[_0x9e4a('0x50')],_0x9e4a('0x51'),_0x55ef3f[_0x9e4a('0x69')][_0x9e4a('0x6a')]);var _0x5258ed=path[_0x9e4a('0x4f')](config[_0x9e4a('0x50')],'server/files/plugins',_0x8c23de);logger[_0x9e4a('0x65')](_0x9e4a('0x6b'),_0x476015);logger['info'](_0x9e4a('0x6c'),_0x5258ed);try{fs[_0x9e4a('0x6d')](_0x476015,parseInt(_0x9e4a('0x6e'),0x8));extract(_0x476015,{'dir':_0x5258ed},function(_0x30f963){if(_0x30f963){logger[_0x9e4a('0x2e')](_0x30f963);handleError(_0x30f963,!![]);};var _0x572bdd=fs['readdirSync'](_0x5258ed);if(_0x572bdd['length']>0x1){removeReferences(_0x476015,_0x5258ed);logger['error'](_0x9e4a('0x6f'));return _0xe37673(new Error('Invalid\x20plugin\x20structure'));}var _0x11e18e=fs['lstatSync'](path['join'](_0x5258ed,_0x572bdd[0x0]));if(_0x11e18e[_0x9e4a('0x70')]()){removeReferences(_0x476015,_0x5258ed);logger['error'](_0x9e4a('0x6f'));return _0xe37673(new Error(_0x9e4a('0x6f')));}if(_0x11e18e[_0x9e4a('0x71')]()){var _0x198036=fs[_0x9e4a('0x72')](path[_0x9e4a('0x4f')](_0x5258ed,_0x572bdd[0x0]));if(_0x198036[_0x9e4a('0x73')]===0x0){removeReferences(_0x476015,_0x5258ed);logger[_0x9e4a('0x2e')](_0x9e4a('0x6f'));return _0xe37673(new Error(_0x9e4a('0x6f')));}var _0x5048de=_0x198036[_0x9e4a('0x74')](function(_0x35e8b0){return _0x35e8b0===_0x9e4a('0x75');});if(!_0x5048de){return _0xe37673(new Error(_0x9e4a('0x76')));}var _0x2b33e0=fs[_0x9e4a('0x77')](path[_0x9e4a('0x4f')](_0x5258ed,_0x572bdd[0x0],_0x9e4a('0x75')));var _0x31ee60=JSON['parse'](_0x2b33e0);if(_0x9e4a('0x23')==typeof _0x31ee60[_0x9e4a('0x30')]){return _0xe37673(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x9e4a('0x23')==typeof _0x31ee60[_0x9e4a('0x36')]){return _0xe37673(new Error(_0x9e4a('0x78')));}if(_0x9e4a('0x23')==typeof _0x31ee60[_0x9e4a('0x79')]){return _0xe37673(new Error(_0x9e4a('0x7a')));}if(_0x9e4a('0x23')==typeof _0x31ee60[_0x9e4a('0x7b')]){return _0xe37673(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x31ee60[_0x9e4a('0x36')]===_0x9e4a('0x7c')){if(_0x9e4a('0x23')==typeof _0x31ee60[_0x9e4a('0x7b')][_0x9e4a('0x7d')]){return _0xe37673(new Error(_0x9e4a('0x7e')));}if(_0x9e4a('0x23')==typeof _0x31ee60[_0x9e4a('0x7b')]['views'][_0x9e4a('0x7f')]&&_0x9e4a('0x23')==typeof _0x31ee60[_0x9e4a('0x7b')][_0x9e4a('0x7d')][_0x9e4a('0x80')]){return _0xe37673(new Error(_0x9e4a('0x81')));}}else if(_0x31ee60[_0x9e4a('0x36')]===_0x9e4a('0x82')){if(_0x9e4a('0x23')==typeof _0x31ee60[_0x9e4a('0x7b')][_0x9e4a('0x83')]){return _0xe37673(new Error(_0x9e4a('0x84')));}if(_0x9e4a('0x23')==typeof _0x31ee60['parameters']['scriptPath']){return _0xe37673(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0xe37673(new Error(_0x9e4a('0x85')));}var _0x46de59=_0x31ee60[_0x9e4a('0x30')];var _0xc6074e=_0x31ee60[_0x9e4a('0x86')];var _0x31e338=_0x31ee60['type'];var _0x194e89=_0x31ee60[_0x9e4a('0x87')]?_0x31ee60['sidebar']:_0x9e4a('0x88');var _0x101d99=_0x31ee60[_0x9e4a('0x89')]?_0x31ee60[_0x9e4a('0x89')]:'icon-apps';var _0x1afdca='';var _0x20b643='';var _0x5815a1='';var _0x36c75b='';var _0x1318f3=_0x31ee60['version'];if(_0x31e338===_0x9e4a('0x7c')){if(_0x9e4a('0x23')!=typeof _0x31ee60[_0x9e4a('0x7b')][_0x9e4a('0x7d')][_0x9e4a('0x7f')]){var _0x158c27=_0x31ee60['parameters'][_0x9e4a('0x7d')][_0x9e4a('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0x9e4a('0x8a')](_0x158c27)){_0x1afdca=path[_0x9e4a('0x4f')](_0x9e4a('0x8b'),_0x8c23de,_0x572bdd[0x0],_0x158c27);}else{_0x1afdca=_0x158c27;}}else{logger[_0x9e4a('0x65')](_0x9e4a('0x8c'));}if(_0x9e4a('0x23')!=typeof _0x31ee60['parameters']['views']['agent']){var _0x5485fa=_0x31ee60[_0x9e4a('0x7b')][_0x9e4a('0x7d')][_0x9e4a('0x80')];if(!/^(f|ht)tps?:\/\//i['test'](_0x5485fa)){_0x20b643=path[_0x9e4a('0x4f')](_0x9e4a('0x8b'),_0x8c23de,_0x572bdd[0x0],_0x5485fa);}else{_0x20b643=_0x5485fa;}}else{logger['info']('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x31e338==='script'){_0x5815a1=_0x31ee60[_0x9e4a('0x7b')][_0x9e4a('0x83')];_0x36c75b=_0x31ee60[_0x9e4a('0x7b')][_0x9e4a('0x8d')];if('undefined'!=typeof _0x31ee60['parameters'][_0x9e4a('0x7d')]){if('undefined'!=typeof _0x31ee60[_0x9e4a('0x7b')]['views'][_0x9e4a('0x7f')]){var _0x158c27=_0x31ee60['parameters'][_0x9e4a('0x7d')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x9e4a('0x8a')](_0x158c27)){_0x1afdca=path[_0x9e4a('0x4f')](_0x9e4a('0x8b'),_0x8c23de,_0x572bdd[0x0],_0x158c27);}else{_0x1afdca=_0x158c27;}}if('undefined'!=typeof _0x31ee60[_0x9e4a('0x7b')][_0x9e4a('0x7d')][_0x9e4a('0x80')]){var _0x5485fa=_0x31ee60['parameters'][_0x9e4a('0x7d')][_0x9e4a('0x80')];if(!/^(f|ht)tps?:\/\//i[_0x9e4a('0x8a')](_0x5485fa)){_0x20b643=path[_0x9e4a('0x4f')]('plugins',_0x8c23de,_0x572bdd[0x0],_0x5485fa);}else{_0x20b643=_0x5485fa;}}}}var _0x3a767c={'name':_0x46de59,'description':_0xc6074e,'path':path[_0x9e4a('0x4f')](_0x8c23de,_0x572bdd[0x0]),'type':_0x31e338,'sidebar':_0x194e89,'icon':_0x101d99,'adminUrl':_0x1afdca,'agentUrl':_0x20b643,'scriptName':_0x5815a1,'scriptPath':_0x36c75b,'version':_0x1318f3};removeReferences(_0x476015,null);return db['Plugin'][_0x9e4a('0x8e')](_0x3a767c)['then'](function(_0xf3416e){var _0x39c89f={'role':_0x55ef3f[_0x9e4a('0x8f')][_0x9e4a('0x90')],'userProfileId':_0x55ef3f[_0x9e4a('0x8f')][_0x9e4a('0x91')]};if(!_0x39c89f)throw new Error(_0x9e4a('0x92'));if(_0x39c89f['role']==='user'){var _0x31cf6f=_0xf3416e['get']({'plain':!![]});return db[_0x9e4a('0x93')]['find']({'where':{'name':_0x9e4a('0x2d'),'userProfileId':_0x39c89f[_0x9e4a('0x91')]},'raw':!![]})['then'](function(_0x5d27a7){if(_0x5d27a7&&_0x5d27a7['autoAssociation']===0x0){return db[_0x9e4a('0x94')][_0x9e4a('0x8e')]({'name':_0x31cf6f[_0x9e4a('0x30')],'resourceId':_0x31cf6f['id'],'type':_0x5d27a7[_0x9e4a('0x30')],'sectionId':_0x5d27a7['id']},{})['then'](function(){return _0xf3416e;});}else{return _0xf3416e;}})[_0x9e4a('0x4d')](function(_0x44721d){logger[_0x9e4a('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44721d);throw _0x44721d;});}return _0xf3416e;})[_0x9e4a('0x2b')](respondWithResult(_0x2268b3,null))[_0x9e4a('0x4d')](handleError(_0x2268b3,null));}});}catch(_0x110561){_0x2268b3[_0x9e4a('0x1e')](0x1f4)[_0x9e4a('0x31')](_0x110561);}};function removeReferences(_0xc9f2ad,_0x125210){try{if(_0xc9f2ad){fs[_0x9e4a('0x63')](_0xc9f2ad);logger[_0x9e4a('0x65')](_0x9e4a('0x95'));}if(_0x125210){rimraf(_0x125210,function(){});logger[_0x9e4a('0x65')](_0x9e4a('0x96'));}}catch(_0x1f7ac8){logger[_0x9e4a('0x2e')](_0x1f7ac8);}}exports[_0x9e4a('0x2a')]=function(_0x1d2e2e,_0x1f448f,_0x39dc92){return db[_0x9e4a('0x33')]['find']({'where':{'id':_0x1d2e2e['params']['id']}})[_0x9e4a('0x2b')](handleEntityNotFound(_0x1f448f,null))[_0x9e4a('0x2b')](saveUpdates(_0x1d2e2e[_0x9e4a('0x8f')],null))[_0x9e4a('0x2b')](respondWithResult(_0x1f448f,null))[_0x9e4a('0x4d')](handleError(_0x1f448f,null));};exports[_0x9e4a('0x97')]=function(_0x13e438,_0x431123,_0x1df66a){return db['Plugin'][_0x9e4a('0x4c')]({'where':{'id':_0x13e438[_0x9e4a('0x98')]['id']}})[_0x9e4a('0x2b')](function(_0x5652d4){if(_0x5652d4){return _0x5652d4[_0x9e4a('0x2c')]();}})[_0x9e4a('0x2b')](function(_0x4c9221){rimraf(path[_0x9e4a('0x4f')](config[_0x9e4a('0x50')],'server/files/plugins',path[_0x9e4a('0x5d')](_0x4c9221[_0x9e4a('0x4e')])),function(){});return _0x4c9221;})[_0x9e4a('0x2b')](handleEntityNotFound(_0x431123,null))[_0x9e4a('0x2b')](respondWithStatusCode(_0x431123,null))['catch'](handleError(_0x431123,null));};exports['webhookGet']=function(_0x52cc97,_0x55e0df,_0x3ea02f){return BPromise[_0x9e4a('0x99')]()[_0x9e4a('0x2b')](function(){if(!_0x52cc97[_0x9e4a('0x38')][_0x9e4a('0x4e')]){throw new Error(_0x9e4a('0x9a'));}if(!_0x52cc97['query'][_0x9e4a('0x9b')]){throw new Error(_0x9e4a('0x9c'));}var _0x14fac1=_0x52cc97[_0x9e4a('0x38')]['hostname']?_0x52cc97[_0x9e4a('0x38')][_0x9e4a('0x9d')]+':'+_0x52cc97[_0x9e4a('0x38')]['port']:_0x9e4a('0x9e')+_0x52cc97[_0x9e4a('0x38')]['port'];var _0x2ee0d5=_0x52cc97['query'][_0x9e4a('0x20')]?_0x52cc97['query']['json']:!![];var _0x100ef3=_0x52cc97[_0x9e4a('0x38')][_0x9e4a('0x9f')]?_0x52cc97[_0x9e4a('0x38')][_0x9e4a('0x9f')]:null;var _0x26346c={'method':_0x52cc97['method'],'uri':util[_0x9e4a('0x52')](_0x9e4a('0xa0'),_0x14fac1,_0x52cc97['query'][_0x9e4a('0x4e')]),'json':_0x2ee0d5,'resolveWithFullResponse':!![],'encoding':_0x100ef3,'qs':_0x52cc97[_0x9e4a('0x38')]};if(_0x52cc97[_0x9e4a('0xa1')]){_0x26346c[_0x9e4a('0xa1')]=_0x52cc97[_0x9e4a('0xa1')];if(_0x26346c[_0x9e4a('0xa1')][_0x9e4a('0xa2')]){delete _0x26346c[_0x9e4a('0xa1')][_0x9e4a('0xa2')];}}if(_0x26346c[_0x9e4a('0xa1')]['content-type']){delete _0x26346c[_0x9e4a('0xa1')]['content-type'];}return rp(_0x26346c);})[_0x9e4a('0x2b')](function(_0x59cf73){if(_0x59cf73){_0x55e0df[_0x9e4a('0x25')](_0x59cf73[_0x9e4a('0xa1')]);logger[_0x9e4a('0x65')](_0x59cf73[_0x9e4a('0x8f')]);if(_['endsWith'](_0x52cc97[_0x9e4a('0x38')][_0x9e4a('0x4e')],_0x9e4a('0xa3'))&&_0x59cf73[_0x9e4a('0xa4')]==0x1f4){return _0x55e0df['sendStatus'](_0x59cf73[_0x9e4a('0xa4')]);}else{return _0x55e0df[_0x9e4a('0x1e')](_0x59cf73[_0x9e4a('0xa4')])[_0x9e4a('0x31')](_0x59cf73['body']);}}else{return _0x55e0df[_0x9e4a('0x1d')](0xc8);}})['catch'](handleError(_0x55e0df,null));};exports[_0x9e4a('0xa5')]=function(_0x1396cc,_0x2cea1c,_0x1b4b49){return BPromise[_0x9e4a('0x99')]()[_0x9e4a('0x2b')](function(){if(!_0x1396cc[_0x9e4a('0x38')][_0x9e4a('0x4e')]){throw new Error(_0x9e4a('0x9a'));}if(!_0x1396cc[_0x9e4a('0x38')]['port']){throw new Error(_0x9e4a('0x9c'));}var _0x4812ec=_0x1396cc['query'][_0x9e4a('0x9d')]?_0x1396cc[_0x9e4a('0x38')][_0x9e4a('0x9d')]+':'+_0x1396cc[_0x9e4a('0x38')][_0x9e4a('0x9b')]:_0x9e4a('0x9e')+_0x1396cc['query'][_0x9e4a('0x9b')];var _0x4d5779=_0x1396cc['query'][_0x9e4a('0x20')]?_0x1396cc['query']['json']:!![];var _0x24f55f=_0x1396cc[_0x9e4a('0x38')][_0x9e4a('0x9f')]?_0x1396cc[_0x9e4a('0x38')][_0x9e4a('0x9f')]:null;var _0x4f6297={'method':_0x1396cc[_0x9e4a('0xa6')],'uri':util['format'](_0x9e4a('0xa0'),_0x4812ec,_0x1396cc[_0x9e4a('0x38')][_0x9e4a('0x4e')]),'json':_0x4d5779,'resolveWithFullResponse':!![],'encoding':_0x24f55f,'body':_0x1396cc[_0x9e4a('0x8f')]};if(_0x1396cc['headers']){_0x4f6297[_0x9e4a('0xa1')]=_0x1396cc['headers'];if(_0x4f6297[_0x9e4a('0xa1')][_0x9e4a('0xa2')]){delete _0x4f6297['headers'][_0x9e4a('0xa2')];}}if(_0x4f6297[_0x9e4a('0xa1')][_0x9e4a('0xa7')]){delete _0x4f6297['headers']['content-type'];}return rp(_0x4f6297);})[_0x9e4a('0x2b')](function(_0x3b1954){if(_0x3b1954){_0x2cea1c[_0x9e4a('0x25')](_0x3b1954[_0x9e4a('0xa1')]);logger[_0x9e4a('0x65')](_0x3b1954[_0x9e4a('0x8f')]);return _0x2cea1c[_0x9e4a('0x1e')](_0x3b1954[_0x9e4a('0xa4')])[_0x9e4a('0x31')](_0x3b1954['body']);}else{return _0x2cea1c[_0x9e4a('0x1d')](0xc8);}})[_0x9e4a('0x4d')](handleError(_0x2cea1c,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index ea67726..33a86e2 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 _0x96aa=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0xd05a3e,_0x349ad9){var _0x5e870d=function(_0x124920){while(--_0x124920){_0xd05a3e['push'](_0xd05a3e['shift']());}};_0x5e870d(++_0x349ad9);}(_0x96aa,0x67));var _0xa96a=function(_0x498a0b,_0x59008b){_0x498a0b=_0x498a0b-0x0;var _0x2e432c=_0x96aa[_0x498a0b];return _0x2e432c;};'use strict';var EventEmitter=require(_0xa96a('0x0'));var Plugin=require(_0xa96a('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0xa96a('0x2')](0x0);var events={'afterCreate':_0xa96a('0x3'),'afterUpdate':_0xa96a('0x4'),'afterDestroy':_0xa96a('0x5')};function emitEvent(_0x10a117){return function(_0x4911c8,_0x1ce4a1,_0x1079a5){PluginEvents['emit'](_0x10a117+':'+_0x4911c8['id'],_0x4911c8);PluginEvents[_0xa96a('0x6')](_0x10a117,_0x4911c8);_0x1079a5(null);};}for(var e in events){if(events[_0xa96a('0x7')](e)){var event=events[e];Plugin[_0xa96a('0x8')](e,emitEvent(event));}}module[_0xa96a('0x9')]=PluginEvents; \ No newline at end of file +var _0x9134=['hook','exports','../../mysqldb','Plugin','setMaxListeners','save','emit'];(function(_0x3740fe,_0x6c543c){var _0x55492b=function(_0x1f851f){while(--_0x1f851f){_0x3740fe['push'](_0x3740fe['shift']());}};_0x55492b(++_0x6c543c);}(_0x9134,0x87));var _0x4913=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9134[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x4913('0x0'))['db'][_0x4913('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x4913('0x2')](0x0);var events={'afterCreate':_0x4913('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x352f58){return function(_0x488795,_0x367836,_0x349c8c){PluginEvents[_0x4913('0x4')](_0x352f58+':'+_0x488795['id'],_0x488795);PluginEvents[_0x4913('0x4')](_0x352f58,_0x488795);_0x349c8c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0x4913('0x5')](e,emitEvent(event));}}module[_0x4913('0x6')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 07e48b4..51b8aaa 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 _0x5a47=['lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./plugin.attributes','exports','define','plugins'];(function(_0x125d7f,_0x4bb659){var _0x476b38=function(_0x3935a7){while(--_0x3935a7){_0x125d7f['push'](_0x125d7f['shift']());}};_0x476b38(++_0x4bb659);}(_0x5a47,0x12c));var _0x75a4=function(_0x19155f,_0x1716c4){_0x19155f=_0x19155f-0x0;var _0x4fa447=_0x5a47[_0x19155f];return _0x4fa447;};'use strict';var _=require(_0x75a4('0x0'));var util=require('util');var logger=require(_0x75a4('0x1'))(_0x75a4('0x2'));var moment=require('moment');var BPromise=require(_0x75a4('0x3'));var rp=require(_0x75a4('0x4'));var fs=require('fs');var path=require(_0x75a4('0x5'));var rimraf=require(_0x75a4('0x6'));var config=require(_0x75a4('0x7'));var attributes=require(_0x75a4('0x8'));module[_0x75a4('0x9')]=function(_0x1616a2,_0x179fa2){return _0x1616a2[_0x75a4('0xa')]('Plugin',attributes,{'tableName':_0x75a4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x45ba=['exports','Plugin','plugins','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./plugin.attributes'];(function(_0x483bb3,_0x35f195){var _0x372abf=function(_0x5a0636){while(--_0x5a0636){_0x483bb3['push'](_0x483bb3['shift']());}};_0x372abf(++_0x35f195);}(_0x45ba,0x1d7));var _0xa45b=function(_0x30a51c,_0x17e7d4){_0x30a51c=_0x30a51c-0x0;var _0x58dbe3=_0x45ba[_0x30a51c];return _0x58dbe3;};'use strict';var _=require(_0xa45b('0x0'));var util=require(_0xa45b('0x1'));var logger=require(_0xa45b('0x2'))(_0xa45b('0x3'));var moment=require(_0xa45b('0x4'));var BPromise=require(_0xa45b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa45b('0x6'));var rimraf=require(_0xa45b('0x7'));var config=require(_0xa45b('0x8'));var attributes=require(_0xa45b('0x9'));module[_0xa45b('0xa')]=function(_0xf1eed6,_0x33cfd7){return _0xf1eed6['define'](_0xa45b('0xb'),attributes,{'tableName':_0xa45b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index b714f8a..60f58ed 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 _0x6bb0=['defaults','socket.io-emitter','./plugin.socket','register','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','message','CreatePlugin','Plugin','create','body','options','raw','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis'];(function(_0x4186fa,_0x26a01c){var _0x136990=function(_0x13324f){while(--_0x13324f){_0x4186fa['push'](_0x4186fa['shift']());}};_0x136990(++_0x26a01c);}(_0x6bb0,0x10c));var _0x06bb=function(_0x251ab0,_0x46e532){_0x251ab0=_0x251ab0-0x0;var _0x11848c=_0x6bb0[_0x251ab0];return _0x11848c;};'use strict';var _=require(_0x06bb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x06bb('0x1'));var rs=require(_0x06bb('0x2'));var fs=require('fs');var Redis=require(_0x06bb('0x3'));var db=require(_0x06bb('0x4'))['db'];var utils=require(_0x06bb('0x5'));var logger=require(_0x06bb('0x6'))(_0x06bb('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x06bb('0x8')][_0x06bb('0x9')]({'port':0x232a});config[_0x06bb('0xa')]=_[_0x06bb('0xb')](config[_0x06bb('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x06bb('0xc'))(new Redis(config['redis']));require(_0x06bb('0xd'))[_0x06bb('0xe')](socket);function respondWithRpcPromise(_0x41d9e0,_0x5db15a,_0x354afd){return new BPromise(function(_0x3e1967,_0x34bba1){return client['request'](_0x41d9e0,_0x354afd)[_0x06bb('0xf')](function(_0x43643d){logger[_0x06bb('0x10')](_0x06bb('0x11'),_0x5db15a,_0x06bb('0x12'));logger[_0x06bb('0x13')](_0x06bb('0x14'),_0x5db15a,'request\x20sent',JSON[_0x06bb('0x15')](_0x43643d));if(_0x43643d['error']){if(_0x43643d[_0x06bb('0x16')]['code']===0x1f4){logger[_0x06bb('0x16')](_0x06bb('0x11'),_0x5db15a,_0x43643d[_0x06bb('0x16')][_0x06bb('0x17')]);return _0x34bba1(_0x43643d[_0x06bb('0x16')][_0x06bb('0x17')]);}logger[_0x06bb('0x16')]('Plugin,\x20%s,\x20%s',_0x5db15a,_0x43643d['error'][_0x06bb('0x17')]);return _0x3e1967(_0x43643d['error'][_0x06bb('0x17')]);}else{logger[_0x06bb('0x10')]('Plugin,\x20%s,\x20%s',_0x5db15a,_0x06bb('0x12'));_0x3e1967(_0x43643d['result'][_0x06bb('0x17')]);}})['catch'](function(_0x45e2a3){logger[_0x06bb('0x16')](_0x06bb('0x11'),_0x5db15a,_0x45e2a3);_0x34bba1(_0x45e2a3);});});}exports[_0x06bb('0x18')]=function(_0x581168){var _0x4c8fc0=this;return new Promise(function(_0x2414fa,_0xfc0078){return db[_0x06bb('0x19')][_0x06bb('0x1a')](_0x581168[_0x06bb('0x1b')],{'raw':_0x581168[_0x06bb('0x1c')]?_0x581168[_0x06bb('0x1c')][_0x06bb('0x1d')]===undefined?!![]:![]:!![]})[_0x06bb('0xf')](function(_0xc70dd8){logger[_0x06bb('0x10')](_0x06bb('0x18'),_0x581168);logger[_0x06bb('0x13')]('CreatePlugin',_0x581168,JSON[_0x06bb('0x15')](_0xc70dd8));_0x2414fa(_0xc70dd8);})[_0x06bb('0x1e')](function(_0x477e97){logger[_0x06bb('0x16')](_0x06bb('0x18'),_0x477e97['message'],_0x581168);_0xfc0078(_0x4c8fc0[_0x06bb('0x16')](0x1f4,_0x477e97[_0x06bb('0x17')]));});});}; \ No newline at end of file +var _0x3e04=['rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','then','info','Plugin,\x20%s,\x20%s','debug','Plugin,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreatePlugin','Plugin','create','body','options','raw','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x571039,_0x14b958){var _0x5f18db=function(_0x210751){while(--_0x210751){_0x571039['push'](_0x571039['shift']());}};_0x5f18db(++_0x14b958);}(_0x3e04,0x14d));var _0x43e0=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x3e04[_0xc4001c];return _0x49f7bc;};'use strict';var _=require('lodash');var util=require(_0x43e0('0x0'));var moment=require(_0x43e0('0x1'));var BPromise=require(_0x43e0('0x2'));var rs=require(_0x43e0('0x3'));var fs=require('fs');var Redis=require(_0x43e0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x43e0('0x5'));var logger=require(_0x43e0('0x6'))(_0x43e0('0x7'));var config=require(_0x43e0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x43e0('0x9')][_0x43e0('0xa')]({'port':0x232a});config[_0x43e0('0xb')]=_[_0x43e0('0xc')](config[_0x43e0('0xb')],{'host':_0x43e0('0xd'),'port':0x18eb});var socket=require(_0x43e0('0xe'))(new Redis(config['redis']));require(_0x43e0('0xf'))[_0x43e0('0x10')](socket);function respondWithRpcPromise(_0x5c802a,_0x13238f,_0x3cb329){return new BPromise(function(_0x3f5261,_0x3c3614){return client['request'](_0x5c802a,_0x3cb329)[_0x43e0('0x11')](function(_0x569dec){logger[_0x43e0('0x12')](_0x43e0('0x13'),_0x13238f,'request\x20sent');logger[_0x43e0('0x14')](_0x43e0('0x15'),_0x13238f,_0x43e0('0x16'),JSON[_0x43e0('0x17')](_0x569dec));if(_0x569dec[_0x43e0('0x18')]){if(_0x569dec[_0x43e0('0x18')]['code']===0x1f4){logger[_0x43e0('0x18')]('Plugin,\x20%s,\x20%s',_0x13238f,_0x569dec[_0x43e0('0x18')][_0x43e0('0x19')]);return _0x3c3614(_0x569dec[_0x43e0('0x18')][_0x43e0('0x19')]);}logger['error']('Plugin,\x20%s,\x20%s',_0x13238f,_0x569dec[_0x43e0('0x18')][_0x43e0('0x19')]);return _0x3f5261(_0x569dec['error'][_0x43e0('0x19')]);}else{logger[_0x43e0('0x12')](_0x43e0('0x13'),_0x13238f,'request\x20sent');_0x3f5261(_0x569dec[_0x43e0('0x1a')][_0x43e0('0x19')]);}})[_0x43e0('0x1b')](function(_0x300eda){logger[_0x43e0('0x18')](_0x43e0('0x13'),_0x13238f,_0x300eda);_0x3c3614(_0x300eda);});});}exports[_0x43e0('0x1c')]=function(_0x5b8db5){var _0x5d8de7=this;return new Promise(function(_0x3d3c06,_0x27bce5){return db[_0x43e0('0x1d')][_0x43e0('0x1e')](_0x5b8db5[_0x43e0('0x1f')],{'raw':_0x5b8db5[_0x43e0('0x20')]?_0x5b8db5['options'][_0x43e0('0x21')]===undefined?!![]:![]:!![]})[_0x43e0('0x11')](function(_0x39ddfa){logger[_0x43e0('0x12')](_0x43e0('0x1c'),_0x5b8db5);logger[_0x43e0('0x14')](_0x43e0('0x1c'),_0x5b8db5,JSON['stringify'](_0x39ddfa));_0x3d3c06(_0x39ddfa);})[_0x43e0('0x1b')](function(_0x470679){logger[_0x43e0('0x18')](_0x43e0('0x1c'),_0x470679[_0x43e0('0x19')],_0x5b8db5);_0x27bce5(_0x5d8de7[_0x43e0('0x18')](0x1f4,_0x470679[_0x43e0('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index fdd16b9..ba84dda 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 _0xddd5=['emit','removeListener','register','plugin:','./plugin.events','save','remove','update'];(function(_0x24b446,_0x41cde1){var _0x2a1295=function(_0x658ea8){while(--_0x658ea8){_0x24b446['push'](_0x24b446['shift']());}};_0x2a1295(++_0x41cde1);}(_0xddd5,0x1bc));var _0x5ddd=function(_0x560a68,_0x40a583){_0x560a68=_0x560a68-0x0;var _0x1cdb95=_0xddd5[_0x560a68];return _0x1cdb95;};'use strict';var PluginEvents=require(_0x5ddd('0x0'));var events=[_0x5ddd('0x1'),_0x5ddd('0x2'),_0x5ddd('0x3')];function createListener(_0x104f72,_0x40c47f){return function(_0x36280c){_0x40c47f[_0x5ddd('0x4')](_0x104f72,_0x36280c);};}function removeListener(_0x561f47,_0x35b7cc){return function(){PluginEvents[_0x5ddd('0x5')](_0x561f47,_0x35b7cc);};}exports[_0x5ddd('0x6')]=function(_0x5e773f){for(var _0x20be82=0x0,_0x157761=events['length'];_0x20be82<_0x157761;_0x20be82++){var _0x5acdfd=events[_0x20be82];var _0xff54ee=createListener(_0x5ddd('0x7')+_0x5acdfd,_0x5e773f);PluginEvents['on'](_0x5acdfd,_0xff54ee);}}; \ No newline at end of file +var _0xc6d3=['removeListener','register','length','save','remove','update','emit'];(function(_0x12ec76,_0x45f3b4){var _0x586d4e=function(_0x548f21){while(--_0x548f21){_0x12ec76['push'](_0x12ec76['shift']());}};_0x586d4e(++_0x45f3b4);}(_0xc6d3,0x15a));var _0x3c6d=function(_0x11c4ab,_0x1f97cd){_0x11c4ab=_0x11c4ab-0x0;var _0x3cd175=_0xc6d3[_0x11c4ab];return _0x3cd175;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0x3c6d('0x0'),_0x3c6d('0x1'),_0x3c6d('0x2')];function createListener(_0x562145,_0x4d79c1){return function(_0x2869b2){_0x4d79c1[_0x3c6d('0x3')](_0x562145,_0x2869b2);};}function removeListener(_0x171c3,_0x142825){return function(){PluginEvents[_0x3c6d('0x4')](_0x171c3,_0x142825);};}exports[_0x3c6d('0x5')]=function(_0x4b956d){for(var _0x86158=0x0,_0x40ee25=events[_0x3c6d('0x6')];_0x86158<_0x40ee25;_0x86158++){var _0x368f08=events[_0x86158];var _0x5e949b=createListener('plugin:'+_0x368f08,_0x4b956d);PluginEvents['on'](_0x368f08,_0x5e949b);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 2f46792..997617b 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(_0xec7a27,_0x47c037){var _0x85982a=function(_0x7cc5){while(--_0x7cc5){_0xec7a27['push'](_0xec7a27['shift']());}};_0x85982a(++_0x47c037);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'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(_0x3d1c8,_0x2233ac){var _0x92308d=function(_0x29fd75){while(--_0x29fd75){_0x3d1c8['push'](_0x3d1c8['shift']());}};_0x92308d(++_0x2233ac);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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 f01ac65..0ae600e 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 _0x4fdb=['lodash','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','status','json','error','stack','name','send','npm\x20install','info','index','then','reject','express','motion2','length','catch','show','describe','params','body','script','join','../../files/plugins','cwd','chdir','dump','restart','stop','hasOwnProperty','Unknown\x20status','destroy','Unknown\x20id'];(function(_0x43f8e9,_0x50c6c2){var _0x44cc6a=function(_0x510cbc){while(--_0x510cbc){_0x43f8e9['push'](_0x43f8e9['shift']());}};_0x44cc6a(++_0x50c6c2);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x33040f,_0x3cb23c){_0x33040f=_0x33040f-0x0;var _0x26bc21=_0x4fdb[_0x33040f];return _0x26bc21;};'use strict';var _=require(_0xb4fd('0x0'));var pm2=require(_0xb4fd('0x1'));var logger=require(_0xb4fd('0x2'))(_0xb4fd('0x3'));var path=require(_0xb4fd('0x4'));var exec=require(_0xb4fd('0x5'))[_0xb4fd('0x6')];var BPromise=require(_0xb4fd('0x7'));function handleEntityNotFound(_0x1c0b08,_0x5b73bb){return function(_0x308de6){if(!_0x308de6){_0x1c0b08['sendStatus'](0x194);;}return _0x308de6;};}function respondWithResult(_0x14052b,_0x5d8b39){_0x5d8b39=_0x5d8b39||0xc8;return function(_0x53273f){if(_0x53273f){return _0x14052b[_0xb4fd('0x8')](_0x5d8b39)[_0xb4fd('0x9')](_0x53273f);}return null;};}function handleError(_0x1151b5,_0x52dca2){_0x52dca2=_0x52dca2||0x1f4;return function(_0x526d3b){logger[_0xb4fd('0xa')](_0x526d3b[_0xb4fd('0xb')]);if(_0x526d3b[_0xb4fd('0xc')]){delete _0x526d3b['name'];}_0x1151b5[_0xb4fd('0x8')](_0x52dca2)[_0xb4fd('0xd')](_0x526d3b);};}function execChildProcess(){return new BPromise(function(_0x2148db,_0x23b08f){exec(_0xb4fd('0xe'),function(_0x502379,_0xd05458,_0x1f3e30){logger[_0xb4fd('0xf')](_0xd05458);logger[_0xb4fd('0xf')](_0x1f3e30);if(_0x502379){logger['error'](_0x502379);return _0x23b08f(_0x502379);}return _0x2148db(_0xd05458);});});}exports[_0xb4fd('0x10')]=function(_0x65f08a,_0x345d35){return pm2['list']()[_0xb4fd('0x11')](function(_0x1234d7){if(_0x1234d7){var _0xc35d8d=_[_0xb4fd('0x12')](_0x1234d7,function(_0x36e88f){return _0x36e88f[_0xb4fd('0xc')]===_0xb4fd('0x13')||_0x36e88f['name']===_0xb4fd('0x14');});return{'rows':_0xc35d8d,'count':_0xc35d8d[_0xb4fd('0x15')]};}return null;})[_0xb4fd('0x11')](respondWithResult(_0x345d35,null))[_0xb4fd('0x16')](handleError(_0x345d35,null));};exports[_0xb4fd('0x17')]=function(_0x137e51,_0x1d0812){return pm2[_0xb4fd('0x18')](_0x137e51[_0xb4fd('0x19')]['id'])[_0xb4fd('0x11')](respondWithResult(_0x1d0812,null))[_0xb4fd('0x11')](handleEntityNotFound(_0x1d0812,null))['catch'](handleError(_0x1d0812,null));};exports['create']=function(_0x504e80,_0x5c14c0){if(_0x504e80[_0xb4fd('0x1a')][_0xb4fd('0xc')]&&_0x504e80[_0xb4fd('0x1a')][_0xb4fd('0x1b')]){var _0x458133=path[_0xb4fd('0x1c')](__dirname,_0xb4fd('0x1d'),_0x504e80['body']['script']);var _0x216307=process[_0xb4fd('0x1e')]();process[_0xb4fd('0x1f')](path['dirname'](_0x458133));return execChildProcess()[_0xb4fd('0x11')](function(_0x49d42c){process[_0xb4fd('0x1f')](_0x216307);return pm2['start']({'name':_0x504e80[_0xb4fd('0x1a')][_0xb4fd('0xc')],'script':_0x458133});})[_0xb4fd('0x11')](function(_0x261eda){pm2[_0xb4fd('0x20')]();return _0x261eda[0x0];})[_0xb4fd('0x11')](respondWithResult(_0x5c14c0,0xc9))[_0xb4fd('0x16')](handleError(_0x5c14c0,null));}else{return _0x5c14c0[_0xb4fd('0x8')](0x1f4)['send']({'message':'Missing\x20name\x20and/or\x20path'});}};exports['update']=function(_0x453982,_0x4bad85){if(_0x453982[_0xb4fd('0x1a')]['id']){delete _0x453982['body']['id'];}var _0x5738c2={'online':_0xb4fd('0x21'),'stopped':_0xb4fd('0x22')};if(_0x5738c2[_0xb4fd('0x23')](_0x453982['body'][_0xb4fd('0x8')])){return pm2[_0x5738c2[_0x453982[_0xb4fd('0x1a')][_0xb4fd('0x8')]]](_0x453982[_0xb4fd('0x19')]['id'])['then'](respondWithResult(_0x4bad85,0xc8))[_0xb4fd('0x16')](handleError(_0x4bad85,null));}else{return _0x4bad85[_0xb4fd('0x8')](0x1f4)['send']({'message':_0xb4fd('0x24')});}};exports[_0xb4fd('0x25')]=function(_0xbe7d2c,_0x597874){if(_0xbe7d2c[_0xb4fd('0x1a')]['id']){delete _0xbe7d2c[_0xb4fd('0x1a')]['id'];}if(_0xbe7d2c[_0xb4fd('0x19')]['id']){return pm2['delete'](_0xbe7d2c['params']['id'])['then'](function(_0x5f36e4){pm2[_0xb4fd('0x20')]();return _0x5f36e4[0x0];})[_0xb4fd('0x11')](respondWithResult(_0x597874,null))[_0xb4fd('0x16')](handleError(_0x597874,null));}else{return _0x597874[_0xb4fd('0x8')](0x1f4)[_0xb4fd('0xd')]({'message':_0xb4fd('0x26')});}}; \ No newline at end of file +var _0xb4e6=['express','motion2','length','describe','params','catch','create','body','script','join','cwd','chdir','dirname','dump','update','restart','hasOwnProperty','Unknown\x20status','delete','lodash','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','error','stack','name','status','send','npm\x20install','info','index','then','reject'];(function(_0x2a1953,_0x1dd667){var _0x221af7=function(_0x53bd99){while(--_0x53bd99){_0x2a1953['push'](_0x2a1953['shift']());}};_0x221af7(++_0x1dd667);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x3b90ab,_0x174a22){_0x3b90ab=_0x3b90ab-0x0;var _0x206e92=_0xb4e6[_0x3b90ab];return _0x206e92;};'use strict';var _=require(_0x6b4e('0x0'));var pm2=require('../../config/pm2');var logger=require(_0x6b4e('0x1'))(_0x6b4e('0x2'));var path=require(_0x6b4e('0x3'));var exec=require(_0x6b4e('0x4'))[_0x6b4e('0x5')];var BPromise=require(_0x6b4e('0x6'));function handleEntityNotFound(_0x1929b8,_0x52313b){return function(_0x40da90){if(!_0x40da90){_0x1929b8[_0x6b4e('0x7')](0x194);;}return _0x40da90;};}function respondWithResult(_0x1f67a2,_0x49de51){_0x49de51=_0x49de51||0xc8;return function(_0xd3138f){if(_0xd3138f){return _0x1f67a2['status'](_0x49de51)['json'](_0xd3138f);}return null;};}function handleError(_0x2311d9,_0x48c870){_0x48c870=_0x48c870||0x1f4;return function(_0x53a71f){logger[_0x6b4e('0x8')](_0x53a71f[_0x6b4e('0x9')]);if(_0x53a71f[_0x6b4e('0xa')]){delete _0x53a71f[_0x6b4e('0xa')];}_0x2311d9[_0x6b4e('0xb')](_0x48c870)[_0x6b4e('0xc')](_0x53a71f);};}function execChildProcess(){return new BPromise(function(_0x323487,_0x49c734){exec(_0x6b4e('0xd'),function(_0x3bba86,_0x58c67d,_0x2a4d0f){logger[_0x6b4e('0xe')](_0x58c67d);logger[_0x6b4e('0xe')](_0x2a4d0f);if(_0x3bba86){logger[_0x6b4e('0x8')](_0x3bba86);return _0x49c734(_0x3bba86);}return _0x323487(_0x58c67d);});});}exports[_0x6b4e('0xf')]=function(_0xa3d358,_0x1db513){return pm2['list']()[_0x6b4e('0x10')](function(_0x29bdee){if(_0x29bdee){var _0x4788cf=_[_0x6b4e('0x11')](_0x29bdee,function(_0x4b62ad){return _0x4b62ad[_0x6b4e('0xa')]===_0x6b4e('0x12')||_0x4b62ad[_0x6b4e('0xa')]===_0x6b4e('0x13');});return{'rows':_0x4788cf,'count':_0x4788cf[_0x6b4e('0x14')]};}return null;})[_0x6b4e('0x10')](respondWithResult(_0x1db513,null))['catch'](handleError(_0x1db513,null));};exports['show']=function(_0x67496d,_0x1beb73){return pm2[_0x6b4e('0x15')](_0x67496d[_0x6b4e('0x16')]['id'])[_0x6b4e('0x10')](respondWithResult(_0x1beb73,null))[_0x6b4e('0x10')](handleEntityNotFound(_0x1beb73,null))[_0x6b4e('0x17')](handleError(_0x1beb73,null));};exports[_0x6b4e('0x18')]=function(_0x35aee1,_0x20a178){if(_0x35aee1[_0x6b4e('0x19')]['name']&&_0x35aee1[_0x6b4e('0x19')][_0x6b4e('0x1a')]){var _0x31fb9d=path[_0x6b4e('0x1b')](__dirname,'../../files/plugins',_0x35aee1[_0x6b4e('0x19')]['script']);var _0x2503a5=process[_0x6b4e('0x1c')]();process[_0x6b4e('0x1d')](path[_0x6b4e('0x1e')](_0x31fb9d));return execChildProcess()[_0x6b4e('0x10')](function(_0x346566){process[_0x6b4e('0x1d')](_0x2503a5);return pm2['start']({'name':_0x35aee1[_0x6b4e('0x19')]['name'],'script':_0x31fb9d});})[_0x6b4e('0x10')](function(_0x884b7e){pm2[_0x6b4e('0x1f')]();return _0x884b7e[0x0];})[_0x6b4e('0x10')](respondWithResult(_0x20a178,0xc9))['catch'](handleError(_0x20a178,null));}else{return _0x20a178[_0x6b4e('0xb')](0x1f4)[_0x6b4e('0xc')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x6b4e('0x20')]=function(_0x381ff0,_0x3513b2){if(_0x381ff0[_0x6b4e('0x19')]['id']){delete _0x381ff0['body']['id'];}var _0x2d42be={'online':_0x6b4e('0x21'),'stopped':'stop'};if(_0x2d42be[_0x6b4e('0x22')](_0x381ff0[_0x6b4e('0x19')][_0x6b4e('0xb')])){return pm2[_0x2d42be[_0x381ff0[_0x6b4e('0x19')]['status']]](_0x381ff0[_0x6b4e('0x16')]['id'])[_0x6b4e('0x10')](respondWithResult(_0x3513b2,0xc8))['catch'](handleError(_0x3513b2,null));}else{return _0x3513b2[_0x6b4e('0xb')](0x1f4)[_0x6b4e('0xc')]({'message':_0x6b4e('0x23')});}};exports['destroy']=function(_0x5c2200,_0x11156e){if(_0x5c2200[_0x6b4e('0x19')]['id']){delete _0x5c2200[_0x6b4e('0x19')]['id'];}if(_0x5c2200['params']['id']){return pm2[_0x6b4e('0x24')](_0x5c2200[_0x6b4e('0x16')]['id'])[_0x6b4e('0x10')](function(_0x5c1444){pm2['dump']();return _0x5c1444[0x0];})[_0x6b4e('0x10')](respondWithResult(_0x11156e,null))['catch'](handleError(_0x11156e,null));}else{return _0x11156e[_0x6b4e('0xb')](0x1f4)[_0x6b4e('0xc')]({'message':'Unknown\x20id'});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 39f3654..48238a5 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 _0xea6f=['../../components/auth/service','./realtime.controller','get','/agents','isAuthenticated','getAgents','/queues','getQueues','exports','express'];(function(_0x4c6e4f,_0x99171f){var _0x391f82=function(_0x5840e6){while(--_0x5840e6){_0x4c6e4f['push'](_0x4c6e4f['shift']());}};_0x391f82(++_0x99171f);}(_0xea6f,0x135));var _0xfea6=function(_0x3ceb2d,_0x2cd2ac){_0x3ceb2d=_0x3ceb2d-0x0;var _0x49e709=_0xea6f[_0x3ceb2d];return _0x49e709;};'use strict';var express=require(_0xfea6('0x0'));var router=express['Router']();var auth=require(_0xfea6('0x1'));var controller=require(_0xfea6('0x2'));router[_0xfea6('0x3')](_0xfea6('0x4'),auth[_0xfea6('0x5')](),controller[_0xfea6('0x6')]);router[_0xfea6('0x3')](_0xfea6('0x7'),auth[_0xfea6('0x5')](),controller[_0xfea6('0x8')]);module[_0xfea6('0x9')]=router; \ No newline at end of file +var _0x6959=['get','/agents','isAuthenticated','getAgents','/queues','express','../../components/auth/service','./realtime.controller'];(function(_0x336d7a,_0x26fd5e){var _0x445b51=function(_0x349896){while(--_0x349896){_0x336d7a['push'](_0x336d7a['shift']());}};_0x445b51(++_0x26fd5e);}(_0x6959,0x6d));var _0x9695=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6959[_0x20a584];return _0x4b41a8;};'use strict';var express=require(_0x9695('0x0'));var router=express['Router']();var auth=require(_0x9695('0x1'));var controller=require(_0x9695('0x2'));router[_0x9695('0x3')](_0x9695('0x4'),auth[_0x9695('0x5')](),controller[_0x9695('0x6')]);router['get'](_0x9695('0x7'),auth['isAuthenticated'](),controller['getQueues']);module['exports']=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 99a8853..d782651 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 _0x0508=['talking','Status','getRealtimeAgentsQueryFields','pick','catch','getQueues','startCase','name','voice','dialActive','dialMethod','QueueCampaigns','filter','assign','getRealtimeQueues','initializeQueues','lodash','util','../../components/realtime/agents','../../components/parsers/qs','../../config/utils','../../errors/api','APIBadRequestError','handleError','offset','undefined','limit','count','json','getAgents','getChannels','pauseTypeFilter','pause','resolve','then','query','channel','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','includes','validateSortParameter','fields','join','order','getAgentIdsByQueues','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','map','rawAttributes','fieldName','type','key','role','agent','getOptions','length','literal','FIELD(id,','forEach','*pause','push','Pause','where','merge','user','userProfileId','Agents','online','extraQueryConditions','UserProfile','getResources','findAndCountAll','filterAgentAttributes','globalStatus','getAgentStatus','voiceStatus'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x0508,0x1a0));var _0x8050=function(_0x43a0c3,_0x55b4a1){_0x43a0c3=_0x43a0c3-0x0;var _0x35fc39=_0x0508[_0x43a0c3];return _0x35fc39;};'use strict';var _=require(_0x8050('0x0'));var util=require(_0x8050('0x1'));var rta=require(_0x8050('0x2'));var rtq=require('../../components/realtime/queues');var qs=require(_0x8050('0x3'));var utils=require(_0x8050('0x4'));var db=require('../../mysqldb')['db'];var APIBadRequestError=require(_0x8050('0x5'))[_0x8050('0x6')];var APIHandleError=require(_0x8050('0x5'))[_0x8050('0x7')];function respondWithFilteredResult(_0x219101,_0x3778d6){return function(_0x15f4c9){if(_0x15f4c9){var _0x47e2d8=typeof _0x3778d6[_0x8050('0x8')]===_0x8050('0x9')&&typeof _0x3778d6[_0x8050('0xa')]==='undefined';var _0x159165=_0x15f4c9[_0x8050('0xb')];var _0x398f9f=_0x47e2d8?0x0:_0x3778d6[_0x8050('0x8')];var _0x4f7f6b=_0x47e2d8?_0x15f4c9['count']:_0x3778d6[_0x8050('0x8')]+_0x3778d6[_0x8050('0xa')];var _0x577d16;if(_0x4f7f6b>=_0x159165){_0x4f7f6b=_0x159165;_0x577d16=0xc8;}else{_0x577d16=0xce;}_0x219101['status'](_0x577d16);return _0x219101['set']('Content-Range',_0x398f9f+'-'+_0x4f7f6b+'/'+_0x159165)[_0x8050('0xc')](_0x15f4c9);}return null;};}exports[_0x8050('0xd')]=function(_0xa490dd,_0x47af04){var _0x3549db={'count':0x0,'rows':[]};var _0x1665a6={};var _0x5493f3;var _0x3128c7=utils[_0x8050('0xe')]();var _0x53b3f5;var _0x217a03;var _0xfbb2d6=_0xa490dd['query']['globalQueueFilter'];var _0xe84dcd=_0xa490dd['query']['globalStatusFilter'];var _0x4d0c85=_0xa490dd['query'][_0x8050('0xf')];var _0x2c39c4=_0xe84dcd===_0x8050('0x10')||_0xe84dcd==='*pause'?!![]:![];var _0x4b36f7=[];var _0x2fcc02;var _0x5af447;Promise[_0x8050('0x11')]()[_0x8050('0x12')](function(){if(_0xa490dd[_0x8050('0x13')][_0x8050('0x14')]){if(!utils[_0x8050('0x15')](_0xa490dd['query'][_0x8050('0x14')])){throw new APIBadRequestError(util[_0x8050('0x16')](_0x8050('0x17'),_0xa490dd[_0x8050('0x13')][_0x8050('0x14')]));}_0x5493f3=_0xa490dd[_0x8050('0x13')][_0x8050('0x14')][_0x8050('0x18')]();}if(!_0xa490dd[_0x8050('0x13')]['sort']||!_0xa490dd[_0x8050('0x13')][_0x8050('0x19')][_0x8050('0x1a')]('globalStatus')){_0xa490dd[_0x8050('0x13')][_0x8050('0x19')]=rta[_0x8050('0x1b')](_0xa490dd['query'][_0x8050('0x19')]);return;}var _0x56e9d3=rta['getUpdatedSortOptions'](_0xa490dd['query'][_0x8050('0x19')]);_0xa490dd[_0x8050('0x13')][_0x8050('0x19')]=_0x56e9d3[_0x8050('0x1c')][_0x8050('0x1d')](',');_0x2fcc02=_0x56e9d3[_0x8050('0x1e')];})['then'](function(){if(!_0xfbb2d6){return[];}return rta[_0x8050('0x1f')](_0xfbb2d6,_0x5493f3);})[_0x8050('0x12')](function(_0x4bd816){_0x4b36f7=_0x4bd816;return rta[_0x8050('0x20')]();})['then'](function(_0x169253){_0x217a03=_0x169253[_0x8050('0x21')];if((!_0xe84dcd||_0x2c39c4)&&!_0x2fcc02){return _0x4b36f7;}if(_0x2fcc02&&!_0xe84dcd){return rta[_0x8050('0x22')](_0x217a03,_0x4b36f7,_0x2fcc02);}else{return rta['getAgentIdsByStatus'](_0x217a03,_0x4b36f7,_0xe84dcd);}})['then'](function(_0x3bbe23){_0x4b36f7=_0x3bbe23;var _0x18eee6=![];if(_0x4b36f7['length']===0x0){if(_0xfbb2d6||_0xe84dcd){_0x18eee6=!![];}if(_0x2c39c4){_0x18eee6=![];}}if(_0x18eee6){return _0x3549db;}var _0x574712=_[_0x8050('0x23')](db['User'][_0x8050('0x24')],function(_0x9fc35e){return{'name':_0x9fc35e[_0x8050('0x25')],'type':_0x9fc35e[_0x8050('0x26')][_0x8050('0x27')]};});_0xa490dd[_0x8050('0x13')][_0x8050('0x28')]=_0x8050('0x29');_0x1665a6=qs[_0x8050('0x2a')](_0x574712,_0xa490dd);_0x1665a6['raw']=!![];var _0x3f197d=[];if(_0x4b36f7[_0x8050('0x2b')]>0x0){_0x3f197d['push']({'id':{'$in':_0x4b36f7}});if(_0x2fcc02&&!_0xe84dcd){_0x5af447=[db['sequelize'][_0x8050('0x2c')](_0x8050('0x2d')+_0x4b36f7+')')];_0x1665a6[_0x8050('0x1e')]=_0x5af447;}}if(_0x2c39c4){_0x3128c7[_0x8050('0x2e')](function(_0x346ac0){var _0x114e26=!![];if(_0xe84dcd===_0x8050('0x2f')&&_0x5493f3!==_0x346ac0){_0x114e26=![];}_0x3f197d[_0x8050('0x30')]({[_0x346ac0+_0x8050('0x31')]:_0x114e26});});if(_0x4d0c85){_0x3f197d['push']({'pauseType':_0x4d0c85});}}else if(_0xe84dcd){_0x3128c7[_0x8050('0x2e')](function(_0x9872a0){_0x3f197d[_0x8050('0x30')]({[_0x9872a0+_0x8050('0x31')]:![]});});}_0x1665a6[_0x8050('0x32')]=_[_0x8050('0x33')](_0x1665a6[_0x8050('0x32')],{'$and':_0x3f197d});if(_0xa490dd['user'][_0x8050('0x28')]===_0x8050('0x34')){var _0x589e9b={'params':{'id':_0xa490dd['user'][_0x8050('0x35')]},'query':{'section':_0x8050('0x36'),'role':_0x8050('0x29'),'raw':!![],'ids':_0x4b36f7,'customSorting':_0x5af447}};if(_0xa490dd[_0x8050('0x13')][_0x8050('0x37')]){_0x589e9b[_0x8050('0x13')][_0x8050('0x37')]=!![];}if(_0x2c39c4){_0x589e9b[_0x8050('0x13')][_0x8050('0x38')]=_0x3f197d;}_0x589e9b[_0x8050('0x13')]=Object['assign'](_0x589e9b[_0x8050('0x13')],_0xa490dd['query']);return db[_0x8050('0x39')][_0x8050('0x3a')](_0x589e9b);}return db['User'][_0x8050('0x3b')](_0x1665a6);})[_0x8050('0x12')](function(_0x4aeb9f){_0x3549db[_0x8050('0xb')]=_0x4aeb9f['count'];_0x53b3f5=_0x4aeb9f['rows'];return _0x53b3f5[_0x8050('0x23')](function(_0x5eb63d){var _0x509541=_['find'](_0x217a03,['id',_0x5eb63d['id']]);if(_0x509541){var _0x520b16=rta[_0x8050('0x3c')](_0x509541);_[_0x8050('0x33')](_0x5eb63d,_0x520b16);}_0x5eb63d[_0x8050('0x3d')]=rta[_0x8050('0x3e')](_0x5eb63d);if(_0x5eb63d['globalStatus'][_0x8050('0x1a')](_0x8050('0x10'))){_0x3128c7[_0x8050('0x2e')](function(_0x446463){if(_0x5eb63d[_0x446463+_0x8050('0x31')]){if(_0x446463==='voice'){if(_0x5eb63d[_0x8050('0x3f')]!==_0x8050('0x40')){_0x5eb63d[_0x8050('0x3f')]=_0x8050('0x10');}}else{_0x5eb63d[_0x446463+_0x8050('0x41')]=_0x8050('0x10');}}});}return _0x5eb63d;});})[_0x8050('0x12')](function(_0x4ca547){if(!_0x2fcc02||_0x5af447){return _0x4ca547;}return rta['sortAgentsByStatus'](_0x4ca547,_0x2fcc02);})[_0x8050('0x12')](function(_0x40f1e7){var _0x5aaea4=rta[_0x8050('0x42')]();_0x3549db['rows']=_0x40f1e7[_0x8050('0x23')](function(_0x4db050){return _[_0x8050('0x43')](_0x4db050,_0x5aaea4);});return _0x3549db;})[_0x8050('0x12')](respondWithFilteredResult(_0x47af04,_0x1665a6))[_0x8050('0x44')](APIHandleError(_0x47af04));};exports[_0x8050('0x45')]=function(_0x26d737,_0x4528be){var _0x32febe={'count':0x0,'rows':[]};var _0x2de7bc={};var _0x26af83;var _0x3769a2;var _0x3abc68;Promise[_0x8050('0x11')]()['then'](function(){if(_0x26d737[_0x8050('0x13')]['channel']){if(!utils[_0x8050('0x15')](_0x26d737[_0x8050('0x13')]['channel'])){throw new APIBadRequestError(util[_0x8050('0x16')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x26d737[_0x8050('0x13')]['channel']));}_0x26af83=_0x26d737[_0x8050('0x13')][_0x8050('0x14')]['toLowerCase']();}var _0x52f240=_[_0x8050('0x46')](_0x26af83)+'Queue';var _0x210e19=_[_0x8050('0x23')](db[_0x52f240][_0x8050('0x24')],function(_0x525a45){return{'name':_0x525a45['fieldName'],'type':_0x525a45[_0x8050('0x26')][_0x8050('0x27')]};});if(!_0x26d737[_0x8050('0x13')][_0x8050('0x1c')]){var _0xa50a41=['id',_0x8050('0x47')];if(_0x26af83===_0x8050('0x48')){_0xa50a41['push'](_0x8050('0x26'));if(_0x26d737[_0x8050('0x13')][_0x8050('0x26')]==='outbound'){_0xa50a41[_0x8050('0x30')]([_0x8050('0x49'),_0x8050('0x4a')]);}}_0x26d737['query'][_0x8050('0x1c')]=_0xa50a41[_0x8050('0x1d')](',');}_0x2de7bc=qs['getOptions'](_0x210e19,_0x26d737);if(_0x26d737['user'][_0x8050('0x28')]===_0x8050('0x34')){var _0x4b4abf={'params':{'id':_0x26d737['user'][_0x8050('0x35')]},'query':{'section':_0x26af83===_0x8050('0x48')&&_0x26d737['query'][_0x8050('0x26')]==='outbound'?_0x8050('0x4b'):_['startCase'](_0x26af83)+'Queues','type':_0x26d737[_0x8050('0x13')][_0x8050('0x26')],'nolimit':!![],'sort':_0x8050('0x47'),'filter':_0x26d737['query'][_0x8050('0x4c')]}};_0x4b4abf[_0x8050('0x13')]=Object[_0x8050('0x4d')](_0x4b4abf['query'],_0x26d737['query']);delete _0x4b4abf['query']['id'];return db['UserProfile']['getResources'](_0x4b4abf);}return db[_0x52f240][_0x8050('0x3b')](_0x2de7bc);})[_0x8050('0x12')](function(_0x80bf8b){_0x32febe[_0x8050('0xb')]=_0x80bf8b[_0x8050('0xb')];_0x3769a2=_0x80bf8b['rows'];return rtq[_0x8050('0x4e')](_0x26d737,_0x26af83);})['then'](function(_0x50cbfa){_0x3abc68=_0x50cbfa[_0x8050('0x21')];return rtq[_0x8050('0x4f')](_0x3769a2,_0x3abc68,_0x26af83,_0x26d737[_0x8050('0x13')][_0x8050('0x26')]);})[_0x8050('0x12')](function(_0x12148f){_0x32febe[_0x8050('0x21')]=_0x12148f;return _0x32febe;})['then'](respondWithFilteredResult(_0x4528be,_0x2de7bc))[_0x8050('0x44')](APIHandleError(_0x4528be));}; \ No newline at end of file +var _0xbcb0=['handleError','offset','undefined','limit','count','status','Content-Range','json','getAgents','getChannels','query','globalQueueFilter','globalStatusFilter','pauseTypeFilter','pause','*pause','then','isValidChannel','channel','toLowerCase','sort','includes','globalStatus','getUpdatedSortOptions','fields','join','order','getAgentIdsByQueues','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','map','User','rawAttributes','type','role','getOptions','raw','push','sequelize','FIELD(id,','forEach','Pause','user','userProfileId','Agents','agent','online','extraQueryConditions','assign','getResources','findAndCountAll','find','filterAgentAttributes','merge','getAgentStatus','voice','voiceStatus','talking','Status','sortAgentsByStatus','getRealtimeAgentsQueryFields','pick','catch','getQueues','format','Queue','fieldName','key','outbound','startCase','Queues','name','filter','UserProfile','initializeQueues','lodash','../../components/parsers/qs','../../config/utils','../../mysqldb','../../errors/api'];(function(_0x42a584,_0x2d9ee3){var _0x56be59=function(_0x5809dd){while(--_0x5809dd){_0x42a584['push'](_0x42a584['shift']());}};_0x56be59(++_0x2d9ee3);}(_0xbcb0,0x19a));var _0x0bcb=function(_0x2e16cb,_0x392148){_0x2e16cb=_0x2e16cb-0x0;var _0x14ecc1=_0xbcb0[_0x2e16cb];return _0x14ecc1;};'use strict';var _=require(_0x0bcb('0x0'));var util=require('util');var rta=require('../../components/realtime/agents');var rtq=require('../../components/realtime/queues');var qs=require(_0x0bcb('0x1'));var utils=require(_0x0bcb('0x2'));var db=require(_0x0bcb('0x3'))['db'];var APIBadRequestError=require(_0x0bcb('0x4'))['APIBadRequestError'];var APIHandleError=require(_0x0bcb('0x4'))[_0x0bcb('0x5')];function respondWithFilteredResult(_0x5162cb,_0x362ee1){return function(_0x114f0a){if(_0x114f0a){var _0x4cfc91=typeof _0x362ee1[_0x0bcb('0x6')]===_0x0bcb('0x7')&&typeof _0x362ee1[_0x0bcb('0x8')]===_0x0bcb('0x7');var _0x5362a5=_0x114f0a[_0x0bcb('0x9')];var _0x44a837=_0x4cfc91?0x0:_0x362ee1[_0x0bcb('0x6')];var _0x217ef2=_0x4cfc91?_0x114f0a['count']:_0x362ee1[_0x0bcb('0x6')]+_0x362ee1[_0x0bcb('0x8')];var _0x1c874a;if(_0x217ef2>=_0x5362a5){_0x217ef2=_0x5362a5;_0x1c874a=0xc8;}else{_0x1c874a=0xce;}_0x5162cb[_0x0bcb('0xa')](_0x1c874a);return _0x5162cb['set'](_0x0bcb('0xb'),_0x44a837+'-'+_0x217ef2+'/'+_0x5362a5)[_0x0bcb('0xc')](_0x114f0a);}return null;};}exports[_0x0bcb('0xd')]=function(_0xe802b0,_0x4140f6){var _0x259972={'count':0x0,'rows':[]};var _0x1876bb={};var _0x19877f;var _0x5abcf0=utils[_0x0bcb('0xe')]();var _0xf0d47f;var _0x3aaa01;var _0x229927=_0xe802b0[_0x0bcb('0xf')][_0x0bcb('0x10')];var _0x14b74c=_0xe802b0[_0x0bcb('0xf')][_0x0bcb('0x11')];var _0x5d27fb=_0xe802b0['query'][_0x0bcb('0x12')];var _0x5397f2=_0x14b74c===_0x0bcb('0x13')||_0x14b74c===_0x0bcb('0x14')?!![]:![];var _0x3b321b=[];var _0x250657;var _0x41d9c8;Promise['resolve']()[_0x0bcb('0x15')](function(){if(_0xe802b0[_0x0bcb('0xf')]['channel']){if(!utils[_0x0bcb('0x16')](_0xe802b0[_0x0bcb('0xf')][_0x0bcb('0x17')])){throw new APIBadRequestError(util['format']('Channel\x20parameter\x20%s\x20is\x20invalid',_0xe802b0['query'][_0x0bcb('0x17')]));}_0x19877f=_0xe802b0[_0x0bcb('0xf')][_0x0bcb('0x17')][_0x0bcb('0x18')]();}if(!_0xe802b0[_0x0bcb('0xf')][_0x0bcb('0x19')]||!_0xe802b0[_0x0bcb('0xf')][_0x0bcb('0x19')][_0x0bcb('0x1a')](_0x0bcb('0x1b'))){_0xe802b0[_0x0bcb('0xf')][_0x0bcb('0x19')]=rta['validateSortParameter'](_0xe802b0[_0x0bcb('0xf')][_0x0bcb('0x19')]);return;}var _0x57cf40=rta[_0x0bcb('0x1c')](_0xe802b0[_0x0bcb('0xf')][_0x0bcb('0x19')]);_0xe802b0[_0x0bcb('0xf')]['sort']=_0x57cf40[_0x0bcb('0x1d')][_0x0bcb('0x1e')](',');_0x250657=_0x57cf40[_0x0bcb('0x1f')];})[_0x0bcb('0x15')](function(){if(!_0x229927){return[];}return rta[_0x0bcb('0x20')](_0x229927,_0x19877f);})['then'](function(_0x6e8cbb){_0x3b321b=_0x6e8cbb;return rta[_0x0bcb('0x21')]();})[_0x0bcb('0x15')](function(_0x4066db){_0x3aaa01=_0x4066db[_0x0bcb('0x22')];if((!_0x14b74c||_0x5397f2)&&!_0x250657){return _0x3b321b;}if(_0x250657&&!_0x14b74c){return rta[_0x0bcb('0x23')](_0x3aaa01,_0x3b321b,_0x250657);}else{return rta[_0x0bcb('0x24')](_0x3aaa01,_0x3b321b,_0x14b74c);}})['then'](function(_0xae88d2){_0x3b321b=_0xae88d2;var _0x32140b=![];if(_0x3b321b[_0x0bcb('0x25')]===0x0){if(_0x229927||_0x14b74c){_0x32140b=!![];}if(_0x5397f2){_0x32140b=![];}}if(_0x32140b){return _0x259972;}var _0x47aa5e=_[_0x0bcb('0x26')](db[_0x0bcb('0x27')][_0x0bcb('0x28')],function(_0x46d0eb){return{'name':_0x46d0eb['fieldName'],'type':_0x46d0eb[_0x0bcb('0x29')]['key']};});_0xe802b0[_0x0bcb('0xf')][_0x0bcb('0x2a')]='agent';_0x1876bb=qs[_0x0bcb('0x2b')](_0x47aa5e,_0xe802b0);_0x1876bb[_0x0bcb('0x2c')]=!![];var _0xa52ee2=[];if(_0x3b321b[_0x0bcb('0x25')]>0x0){_0xa52ee2[_0x0bcb('0x2d')]({'id':{'$in':_0x3b321b}});if(_0x250657&&!_0x14b74c){_0x41d9c8=[db[_0x0bcb('0x2e')]['literal'](_0x0bcb('0x2f')+_0x3b321b+')')];_0x1876bb[_0x0bcb('0x1f')]=_0x41d9c8;}}if(_0x5397f2){_0x5abcf0[_0x0bcb('0x30')](function(_0x1bc8ae){var _0x365dcf=!![];if(_0x14b74c===_0x0bcb('0x14')&&_0x19877f!==_0x1bc8ae){_0x365dcf=![];}_0xa52ee2[_0x0bcb('0x2d')]({[_0x1bc8ae+_0x0bcb('0x31')]:_0x365dcf});});if(_0x5d27fb){_0xa52ee2[_0x0bcb('0x2d')]({'pauseType':_0x5d27fb});}}else if(_0x14b74c){_0x5abcf0[_0x0bcb('0x30')](function(_0x45bb03){_0xa52ee2['push']({[_0x45bb03+_0x0bcb('0x31')]:![]});});}_0x1876bb['where']=_['merge'](_0x1876bb['where'],{'$and':_0xa52ee2});if(_0xe802b0[_0x0bcb('0x32')]['role']===_0x0bcb('0x32')){var _0x48016b={'params':{'id':_0xe802b0['user'][_0x0bcb('0x33')]},'query':{'section':_0x0bcb('0x34'),'role':_0x0bcb('0x35'),'raw':!![],'ids':_0x3b321b,'customSorting':_0x41d9c8}};if(_0xe802b0[_0x0bcb('0xf')][_0x0bcb('0x36')]){_0x48016b[_0x0bcb('0xf')]['online']=!![];}if(_0x5397f2){_0x48016b[_0x0bcb('0xf')][_0x0bcb('0x37')]=_0xa52ee2;}_0x48016b['query']=Object[_0x0bcb('0x38')](_0x48016b[_0x0bcb('0xf')],_0xe802b0[_0x0bcb('0xf')]);return db['UserProfile'][_0x0bcb('0x39')](_0x48016b);}return db['User'][_0x0bcb('0x3a')](_0x1876bb);})[_0x0bcb('0x15')](function(_0x48f97b){_0x259972[_0x0bcb('0x9')]=_0x48f97b[_0x0bcb('0x9')];_0xf0d47f=_0x48f97b[_0x0bcb('0x22')];return _0xf0d47f[_0x0bcb('0x26')](function(_0x41ec69){var _0x5053a6=_[_0x0bcb('0x3b')](_0x3aaa01,['id',_0x41ec69['id']]);if(_0x5053a6){var _0x271736=rta[_0x0bcb('0x3c')](_0x5053a6);_[_0x0bcb('0x3d')](_0x41ec69,_0x271736);}_0x41ec69['globalStatus']=rta[_0x0bcb('0x3e')](_0x41ec69);if(_0x41ec69[_0x0bcb('0x1b')][_0x0bcb('0x1a')]('pause')){_0x5abcf0['forEach'](function(_0x19ff31){if(_0x41ec69[_0x19ff31+'Pause']){if(_0x19ff31===_0x0bcb('0x3f')){if(_0x41ec69[_0x0bcb('0x40')]!==_0x0bcb('0x41')){_0x41ec69[_0x0bcb('0x40')]=_0x0bcb('0x13');}}else{_0x41ec69[_0x19ff31+_0x0bcb('0x42')]='pause';}}});}return _0x41ec69;});})['then'](function(_0x5d3adb){if(!_0x250657||_0x41d9c8){return _0x5d3adb;}return rta[_0x0bcb('0x43')](_0x5d3adb,_0x250657);})['then'](function(_0x1af29d){var _0x2ef1c2=rta[_0x0bcb('0x44')]();_0x259972[_0x0bcb('0x22')]=_0x1af29d['map'](function(_0xb62564){return _[_0x0bcb('0x45')](_0xb62564,_0x2ef1c2);});return _0x259972;})[_0x0bcb('0x15')](respondWithFilteredResult(_0x4140f6,_0x1876bb))[_0x0bcb('0x46')](APIHandleError(_0x4140f6));};exports[_0x0bcb('0x47')]=function(_0x990f13,_0x1860e1){var _0xb681d5={'count':0x0,'rows':[]};var _0x3a6372={};var _0x119a91;var _0x3d10b5;var _0x4f4100;Promise['resolve']()[_0x0bcb('0x15')](function(){if(_0x990f13[_0x0bcb('0xf')][_0x0bcb('0x17')]){if(!utils['isValidChannel'](_0x990f13[_0x0bcb('0xf')][_0x0bcb('0x17')])){throw new APIBadRequestError(util[_0x0bcb('0x48')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x990f13[_0x0bcb('0xf')][_0x0bcb('0x17')]));}_0x119a91=_0x990f13[_0x0bcb('0xf')][_0x0bcb('0x17')][_0x0bcb('0x18')]();}var _0x5512b7=_['startCase'](_0x119a91)+_0x0bcb('0x49');var _0x47bcf7=_[_0x0bcb('0x26')](db[_0x5512b7][_0x0bcb('0x28')],function(_0x1c247b){return{'name':_0x1c247b[_0x0bcb('0x4a')],'type':_0x1c247b[_0x0bcb('0x29')][_0x0bcb('0x4b')]};});if(!_0x990f13['query'][_0x0bcb('0x1d')]){var _0x40b1ad=['id','name'];if(_0x119a91===_0x0bcb('0x3f')){_0x40b1ad[_0x0bcb('0x2d')](_0x0bcb('0x29'));if(_0x990f13[_0x0bcb('0xf')]['type']===_0x0bcb('0x4c')){_0x40b1ad[_0x0bcb('0x2d')](['dialActive','dialMethod']);}}_0x990f13['query'][_0x0bcb('0x1d')]=_0x40b1ad[_0x0bcb('0x1e')](',');}_0x3a6372=qs[_0x0bcb('0x2b')](_0x47bcf7,_0x990f13);if(_0x990f13[_0x0bcb('0x32')][_0x0bcb('0x2a')]===_0x0bcb('0x32')){var _0x30bd21={'params':{'id':_0x990f13['user'][_0x0bcb('0x33')]},'query':{'section':_0x119a91==='voice'&&_0x990f13[_0x0bcb('0xf')][_0x0bcb('0x29')]==='outbound'?'QueueCampaigns':_[_0x0bcb('0x4d')](_0x119a91)+_0x0bcb('0x4e'),'type':_0x990f13[_0x0bcb('0xf')]['type'],'nolimit':!![],'sort':_0x0bcb('0x4f'),'filter':_0x990f13['query'][_0x0bcb('0x50')]}};_0x30bd21[_0x0bcb('0xf')]=Object['assign'](_0x30bd21[_0x0bcb('0xf')],_0x990f13[_0x0bcb('0xf')]);delete _0x30bd21[_0x0bcb('0xf')]['id'];return db[_0x0bcb('0x51')][_0x0bcb('0x39')](_0x30bd21);}return db[_0x5512b7]['findAndCountAll'](_0x3a6372);})[_0x0bcb('0x15')](function(_0x4f0a4e){_0xb681d5[_0x0bcb('0x9')]=_0x4f0a4e['count'];_0x3d10b5=_0x4f0a4e[_0x0bcb('0x22')];return rtq['getRealtimeQueues'](_0x990f13,_0x119a91);})[_0x0bcb('0x15')](function(_0x4b6963){_0x4f4100=_0x4b6963[_0x0bcb('0x22')];return rtq[_0x0bcb('0x52')](_0x3d10b5,_0x4f4100,_0x119a91,_0x990f13[_0x0bcb('0xf')][_0x0bcb('0x29')]);})[_0x0bcb('0x15')](function(_0x2e0d9f){_0xb681d5['rows']=_0x2e0d9f;return _0xb681d5;})[_0x0bcb('0x15')](respondWithFilteredResult(_0x1860e1,_0x3a6372))[_0x0bcb('0x46')](APIHandleError(_0x1860e1));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 47a87be..bccf282 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x20076b,_0x4f218e){var _0x1ae3de=function(_0x545d7a){while(--_0x545d7a){_0x20076b['push'](_0x20076b['shift']());}};_0x1ae3de(++_0x4f218e);}(_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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x116edc,_0x3781bc){var _0x1fffc9=function(_0x484bc7){while(--_0x484bc7){_0x116edc['push'](_0x116edc['shift']());}};_0x1fffc9(++_0x3781bc);}(_0xedd9,0xfc));var _0x9edd=function(_0x16c931,_0x3bba34){_0x16c931=_0x16c931-0x0;var _0x5c0b8c=_0xedd9[_0x16c931];return _0x5c0b8c;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 7b6e99a..330e8ae 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 _0xeda8=['sequelize','exports','STRING','DATE','INTEGER'];(function(_0x164ba9,_0x5f1df1){var _0x364ca7=function(_0x43d226){while(--_0x43d226){_0x164ba9['push'](_0x164ba9['shift']());}};_0x364ca7(++_0x5f1df1);}(_0xeda8,0x104));var _0x8eda=function(_0x59de73,_0xad36e1){_0x59de73=_0x59de73-0x0;var _0x269162=_0xeda8[_0x59de73];return _0x269162;};'use strict';var Sequelize=require(_0x8eda('0x0'));module[_0x8eda('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x8eda('0x2')]},'scheduledat':{'type':Sequelize[_0x8eda('0x3')]},'uniqueid':{'type':Sequelize[_0x8eda('0x2')]},'starttime':{'type':Sequelize[_0x8eda('0x3')]},'responsetime':{'type':Sequelize[_0x8eda('0x3')]},'ringtime':{'type':Sequelize[_0x8eda('0x4')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x8eda('0x2')]},'campaigntype':{'type':Sequelize[_0x8eda('0x2')]},'membername':{'type':Sequelize[_0x8eda('0x2')]}}; \ No newline at end of file +var _0x99fb=['STRING','DATE','sequelize','INTEGER'];(function(_0x1a7419,_0x25b185){var _0x1c57c6=function(_0x397f04){while(--_0x397f04){_0x1a7419['push'](_0x1a7419['shift']());}};_0x1c57c6(++_0x25b185);}(_0x99fb,0x92));var _0xb99f=function(_0x5d7cf5,_0x1a6627){_0x5d7cf5=_0x5d7cf5-0x0;var _0x219be7=_0x99fb[_0x5d7cf5];return _0x219be7;};'use strict';var Sequelize=require(_0xb99f('0x0'));module['exports']={'state':{'type':Sequelize[_0xb99f('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xb99f('0x2')]},'scheduledat':{'type':Sequelize[_0xb99f('0x3')]},'uniqueid':{'type':Sequelize[_0xb99f('0x2')]},'starttime':{'type':Sequelize[_0xb99f('0x3')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xb99f('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xb99f('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xb99f('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 51316a2..e274784 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 _0x9369=['exports','define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','moment','path','../../config/environment','./reportAgentPreview.attributes'];(function(_0x287410,_0x452572){var _0x27becb=function(_0x4832c4){while(--_0x4832c4){_0x287410['push'](_0x287410['shift']());}};_0x27becb(++_0x452572);}(_0x9369,0x93));var _0x9936=function(_0x21c3b2,_0x4e79c2){_0x21c3b2=_0x21c3b2-0x0;var _0x41474f=_0x9369[_0x21c3b2];return _0x41474f;};'use strict';var _=require(_0x9936('0x0'));var util=require(_0x9936('0x1'));var logger=require(_0x9936('0x2'))('api');var moment=require(_0x9936('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9936('0x4'));var rimraf=require('rimraf');var config=require(_0x9936('0x5'));var attributes=require(_0x9936('0x6'));module[_0x9936('0x7')]=function(_0x140000,_0x39b52a){return _0x140000[_0x9936('0x8')](_0x9936('0x9'),attributes,{'tableName':_0x9936('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7818=['report_agent_preview','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x7818,0xc7));var _0x8781=function(_0x5d2039,_0x57592a){_0x5d2039=_0x5d2039-0x0;var _0xee4202=_0x7818[_0x5d2039];return _0xee4202;};'use strict';var _=require(_0x8781('0x0'));var util=require('util');var logger=require(_0x8781('0x1'))(_0x8781('0x2'));var moment=require(_0x8781('0x3'));var BPromise=require('bluebird');var rp=require(_0x8781('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8781('0x5'));var config=require(_0x8781('0x6'));var attributes=require('./reportAgentPreview.attributes');module[_0x8781('0x7')]=function(_0x332bc4,_0x504d72){return _0x332bc4['define']('ReportAgentPreview',attributes,{'tableName':_0x8781('0x8'),'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 6b1c8cb..0e22e4b 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 _0x70df=['result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','then','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','ReportAgentPreview,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x70df,0xea));var _0xf70d=function(_0x72628e,_0x21f21d){_0x72628e=_0x72628e-0x0;var _0x5b3fde=_0x70df[_0x72628e];return _0x5b3fde;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xf70d('0x0'));var rs=require(_0xf70d('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf70d('0x2'))['db'];var utils=require(_0xf70d('0x3'));var logger=require(_0xf70d('0x4'))(_0xf70d('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf70d('0x6')][_0xf70d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x349020,_0x2b07b9,_0x3a56e7){return new BPromise(function(_0x2012e4,_0x8cb424){return client[_0xf70d('0x8')](_0x349020,_0x3a56e7)['then'](function(_0x2f359d){logger[_0xf70d('0x9')](_0xf70d('0xa'),_0x2b07b9,'request\x20sent');logger[_0xf70d('0xb')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x2b07b9,_0xf70d('0xc'),JSON[_0xf70d('0xd')](_0x2f359d));if(_0x2f359d[_0xf70d('0xe')]){if(_0x2f359d['error']['code']===0x1f4){logger[_0xf70d('0xe')](_0xf70d('0xa'),_0x2b07b9,_0x2f359d[_0xf70d('0xe')]['message']);return _0x8cb424(_0x2f359d[_0xf70d('0xe')][_0xf70d('0xf')]);}logger[_0xf70d('0xe')](_0xf70d('0xa'),_0x2b07b9,_0x2f359d[_0xf70d('0xe')][_0xf70d('0xf')]);return _0x2012e4(_0x2f359d['error'][_0xf70d('0xf')]);}else{logger['info'](_0xf70d('0xa'),_0x2b07b9,'request\x20sent');_0x2012e4(_0x2f359d[_0xf70d('0x10')][_0xf70d('0xf')]);}})[_0xf70d('0x11')](function(_0x5bf507){logger[_0xf70d('0xe')](_0xf70d('0xa'),_0x2b07b9,_0x5bf507);_0x8cb424(_0x5bf507);});});}exports[_0xf70d('0x12')]=function(_0x2fe233){var _0x11d42e=this;return new Promise(function(_0x4ce380,_0x4502e4){return db[_0xf70d('0x13')][_0xf70d('0x14')](_0x2fe233[_0xf70d('0x15')],{'raw':_0x2fe233[_0xf70d('0x16')]?_0x2fe233['options'][_0xf70d('0x17')]===undefined?!![]:![]:!![]})[_0xf70d('0x18')](function(_0xb3b11c){logger[_0xf70d('0x9')](_0xf70d('0x12'),_0x2fe233);logger[_0xf70d('0xb')](_0xf70d('0x12'),_0x2fe233,JSON[_0xf70d('0xd')](_0xb3b11c));_0x4ce380(_0xb3b11c);})[_0xf70d('0x11')](function(_0x3ff4f3){logger[_0xf70d('0xe')](_0xf70d('0x12'),_0x3ff4f3[_0xf70d('0xf')],_0x2fe233);_0x4502e4(_0x11d42e['error'](0x1f4,_0x3ff4f3['message']));});});}; \ No newline at end of file +var _0x56db=['../../config/environment','client','request','then','info','ReportAgentPreview,\x20%s,\x20%s','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','CreateReportAgentPreview','ReportAgentPreview','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x15cbce,_0xda8402){var _0x257f29=function(_0x388132){while(--_0x388132){_0x15cbce['push'](_0x15cbce['shift']());}};_0x257f29(++_0xda8402);}(_0x56db,0x187));var _0xb56d=function(_0x11cbb5,_0x390441){_0x11cbb5=_0x11cbb5-0x0;var _0x54b8d3=_0x56db[_0x11cbb5];return _0x54b8d3;};'use strict';var _=require(_0xb56d('0x0'));var util=require(_0xb56d('0x1'));var moment=require(_0xb56d('0x2'));var BPromise=require(_0xb56d('0x3'));var rs=require(_0xb56d('0x4'));var fs=require('fs');var Redis=require(_0xb56d('0x5'));var db=require(_0xb56d('0x6'))['db'];var utils=require(_0xb56d('0x7'));var logger=require('../../config/logger')(_0xb56d('0x8'));var config=require(_0xb56d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb56d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a376a,_0x491d27,_0xe04e26){return new BPromise(function(_0x3efd46,_0x5242ad){return client[_0xb56d('0xb')](_0x3a376a,_0xe04e26)[_0xb56d('0xc')](function(_0x4f017d){logger[_0xb56d('0xd')](_0xb56d('0xe'),_0x491d27,'request\x20sent');logger[_0xb56d('0xf')](_0xb56d('0x10'),_0x491d27,_0xb56d('0x11'),JSON[_0xb56d('0x12')](_0x4f017d));if(_0x4f017d[_0xb56d('0x13')]){if(_0x4f017d[_0xb56d('0x13')][_0xb56d('0x14')]===0x1f4){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x491d27,_0x4f017d[_0xb56d('0x13')][_0xb56d('0x15')]);return _0x5242ad(_0x4f017d[_0xb56d('0x13')][_0xb56d('0x15')]);}logger['error'](_0xb56d('0xe'),_0x491d27,_0x4f017d[_0xb56d('0x13')][_0xb56d('0x15')]);return _0x3efd46(_0x4f017d[_0xb56d('0x13')][_0xb56d('0x15')]);}else{logger['info'](_0xb56d('0xe'),_0x491d27,_0xb56d('0x11'));_0x3efd46(_0x4f017d['result'][_0xb56d('0x15')]);}})['catch'](function(_0x1b6161){logger[_0xb56d('0x13')](_0xb56d('0xe'),_0x491d27,_0x1b6161);_0x5242ad(_0x1b6161);});});}exports[_0xb56d('0x16')]=function(_0x1836b8){var _0x3d3a79=this;return new Promise(function(_0x30d37d,_0x592f3a){return db[_0xb56d('0x17')]['create'](_0x1836b8['body'],{'raw':_0x1836b8['options']?_0x1836b8['options'][_0xb56d('0x18')]===undefined?!![]:![]:!![]})[_0xb56d('0xc')](function(_0x29f713){logger[_0xb56d('0xd')](_0xb56d('0x16'),_0x1836b8);logger[_0xb56d('0xf')](_0xb56d('0x16'),_0x1836b8,JSON['stringify'](_0x29f713));_0x30d37d(_0x29f713);})['catch'](function(_0xb41a93){logger[_0xb56d('0x13')](_0xb56d('0x16'),_0xb41a93[_0xb56d('0x15')],_0x1836b8);_0x592f3a(_0x3d3a79[_0xb56d('0x13')](0x1f4,_0xb41a93[_0xb56d('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index e765f07..af1f715 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 _0x3a8d=['/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','outboundChannels','/agents','agents','agentCapacity','/telephones','telephones','/trunks','trunks','campaigns','chatQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','mail','queueNotify','chat','/chat/queues/:id','/fax/queues/:id/notify','fax','showFaxQueues','openchannel','/openchannel/queues/:id','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','util','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup'];(function(_0x5e07cb,_0x1b9bfb){var _0xa136ef=function(_0x503308){while(--_0x503308){_0x5e07cb['push'](_0x5e07cb['shift']());}};_0xa136ef(++_0x1b9bfb);}(_0x3a8d,0xcb));var _0xd3a8=function(_0x52096b,_0x20bab4){_0x52096b=_0x52096b-0x0;var _0x2b1cc7=_0x3a8d[_0x52096b];return _0x2b1cc7;};'use strict';var multer=require('multer');var util=require(_0xd3a8('0x0'));var path=require('path');var express=require(_0xd3a8('0x1'));var router=express[_0xd3a8('0x2')]();var auth=require(_0xd3a8('0x3'));var controller=require(_0xd3a8('0x4'));router[_0xd3a8('0x5')](_0xd3a8('0x6'),auth[_0xd3a8('0x7')](),controller[_0xd3a8('0x8')]);router[_0xd3a8('0x5')]('/voice/channels/:uniqueid/mixmonitor',auth[_0xd3a8('0x7')](),controller[_0xd3a8('0x9')]);router[_0xd3a8('0x5')](_0xd3a8('0xa'),auth['isAuthenticated'](),controller['voiceChannelStopMixMonitor']);router[_0xd3a8('0x5')](_0xd3a8('0xb'),auth['isAuthenticated'](),controller[_0xd3a8('0xc')]);router['get'](_0xd3a8('0xd'),auth[_0xd3a8('0x7')](),controller[_0xd3a8('0xe')]);router[_0xd3a8('0x5')](_0xd3a8('0xf'),auth[_0xd3a8('0x7')](),controller[_0xd3a8('0x10')]);router[_0xd3a8('0x5')](_0xd3a8('0x11'),auth[_0xd3a8('0x7')](),controller[_0xd3a8('0x12')]);router['get'](_0xd3a8('0x13'),auth['isAuthenticated'](),controller[_0xd3a8('0x14')]);router[_0xd3a8('0x5')](_0xd3a8('0x15'),auth[_0xd3a8('0x7')](),controller[_0xd3a8('0x16')]);router[_0xd3a8('0x5')](_0xd3a8('0x17'),auth[_0xd3a8('0x7')](),controller[_0xd3a8('0x18')]);router[_0xd3a8('0x5')](_0xd3a8('0x19'),auth[_0xd3a8('0x7')](),controller['faxQueues']);router[_0xd3a8('0x5')](_0xd3a8('0x1a'),auth[_0xd3a8('0x7')](),controller[_0xd3a8('0x1b')]);router[_0xd3a8('0x5')](_0xd3a8('0x1c'),auth['isAuthenticated'](),controller['voiceQueuesChannels']);router[_0xd3a8('0x5')]('/voice/queues/channels/:uniqueid',auth[_0xd3a8('0x7')](),controller['voiceQueuesChannel']);router[_0xd3a8('0x5')](_0xd3a8('0x1d'),auth[_0xd3a8('0x7')](),controller[_0xd3a8('0x1e')]);router[_0xd3a8('0x5')](_0xd3a8('0x1f'),auth[_0xd3a8('0x7')](),controller[_0xd3a8('0x20')]);router[_0xd3a8('0x5')](_0xd3a8('0x21'),auth[_0xd3a8('0x7')](),controller[_0xd3a8('0x22')]);router[_0xd3a8('0x23')](_0xd3a8('0x21'),auth['isAuthenticated'](),controller[_0xd3a8('0x24')]);router[_0xd3a8('0x5')](_0xd3a8('0x25'),auth[_0xd3a8('0x7')](),controller[_0xd3a8('0x26')]);router[_0xd3a8('0x5')]('/outbound/channels',auth[_0xd3a8('0x7')](),controller[_0xd3a8('0x27')]);router[_0xd3a8('0x5')](_0xd3a8('0x28'),auth[_0xd3a8('0x7')](),controller[_0xd3a8('0x29')]);router[_0xd3a8('0x23')]('/agents/:id/capacity',auth[_0xd3a8('0x7')](),controller[_0xd3a8('0x2a')]);router[_0xd3a8('0x5')](_0xd3a8('0x2b'),auth[_0xd3a8('0x7')](),controller[_0xd3a8('0x2c')]);router['get'](_0xd3a8('0x2d'),auth['isAuthenticated'](),controller[_0xd3a8('0x2e')]);router[_0xd3a8('0x5')]('/campaigns',auth[_0xd3a8('0x7')](),controller[_0xd3a8('0x2f')]);router[_0xd3a8('0x5')]('/fax/accounts',auth[_0xd3a8('0x7')](),controller['faxAccounts']);router[_0xd3a8('0x5')]('/chat/queues/waitinginteractions',auth[_0xd3a8('0x7')](),controller[_0xd3a8('0x30')]);router[_0xd3a8('0x5')]('/mail/queues/waitinginteractions',auth[_0xd3a8('0x7')](),controller['mailQueuesWaitingInteractions']);router[_0xd3a8('0x5')](_0xd3a8('0x31'),auth[_0xd3a8('0x7')](),controller[_0xd3a8('0x32')]);router[_0xd3a8('0x5')](_0xd3a8('0x33'),auth[_0xd3a8('0x7')](),controller[_0xd3a8('0x34')]);router[_0xd3a8('0x5')](_0xd3a8('0x35'),auth[_0xd3a8('0x7')](),controller[_0xd3a8('0x36')]);router[_0xd3a8('0x5')]('/whatsapp/queues/waitinginteractions',auth[_0xd3a8('0x7')](),controller[_0xd3a8('0x37')]);router['get'](_0xd3a8('0x38'),auth[_0xd3a8('0x7')](),controller[_0xd3a8('0x39')]);router[_0xd3a8('0x3a')]('/mail/queues/:id/notify',auth[_0xd3a8('0x7')](),controller['queueNotify'](_0xd3a8('0x3b')));router['get']('/mail/queues/:id',auth[_0xd3a8('0x7')](),controller['showMailQueues']);router[_0xd3a8('0x3a')]('/chat/queues/:id/notify',auth[_0xd3a8('0x7')](),controller[_0xd3a8('0x3c')](_0xd3a8('0x3d')));router[_0xd3a8('0x5')](_0xd3a8('0x3e'),auth[_0xd3a8('0x7')](),controller['showChatQueues']);router[_0xd3a8('0x3a')](_0xd3a8('0x3f'),auth[_0xd3a8('0x7')](),controller[_0xd3a8('0x3c')](_0xd3a8('0x40')));router[_0xd3a8('0x5')]('/fax/queues/:id',auth[_0xd3a8('0x7')](),controller[_0xd3a8('0x41')]);router[_0xd3a8('0x3a')]('/openchannel/queues/:id/notify',auth[_0xd3a8('0x7')](),controller[_0xd3a8('0x3c')](_0xd3a8('0x42')));router[_0xd3a8('0x5')](_0xd3a8('0x43'),auth['isAuthenticated'](),controller['showOpenchannelQueues']);router[_0xd3a8('0x3a')]('/sms/queues/:id/notify',auth['isAuthenticated'](),controller[_0xd3a8('0x3c')](_0xd3a8('0x44')));router['post'](_0xd3a8('0x45'),auth[_0xd3a8('0x7')](),controller['queueNotify'](_0xd3a8('0x46')));router[_0xd3a8('0x5')](_0xd3a8('0x47'),auth['isAuthenticated'](),controller[_0xd3a8('0x48')]);router[_0xd3a8('0x5')](_0xd3a8('0x49'),auth[_0xd3a8('0x7')](),controller[_0xd3a8('0x4a')]);router[_0xd3a8('0x3a')](_0xd3a8('0x4b'),auth[_0xd3a8('0x7')](),controller[_0xd3a8('0x4c')]);module[_0xd3a8('0x4d')]=router; \ No newline at end of file +var _0xfd7e=['/sms/queues/:id/notify','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','express','Router','/voice/channels','isAuthenticated','voiceChannels','get','/voice/channels/:uniqueid/mixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/mail/queues','/mail/accounts','mailAccounts','openchannelQueues','smsQueues','/whatsapp/queues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','/trunks','trunks','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','queueNotify','/chat/queues/:id','showChatQueues','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id'];(function(_0x4b0c3e,_0x50754a){var _0xa99d4e=function(_0x1034a2){while(--_0x1034a2){_0x4b0c3e['push'](_0x4b0c3e['shift']());}};_0xa99d4e(++_0x50754a);}(_0xfd7e,0xf2));var _0xefd7=function(_0x599f2f,_0x1fda75){_0x599f2f=_0x599f2f-0x0;var _0x88e1bc=_0xfd7e[_0x599f2f];return _0x88e1bc;};'use strict';var multer=require(_0xefd7('0x0'));var util=require(_0xefd7('0x1'));var path=require(_0xefd7('0x2'));var express=require(_0xefd7('0x3'));var router=express[_0xefd7('0x4')]();var auth=require('../../components/auth/service');var controller=require('./rpc.controller');router['get'](_0xefd7('0x5'),auth[_0xefd7('0x6')](),controller[_0xefd7('0x7')]);router[_0xefd7('0x8')](_0xefd7('0x9'),auth[_0xefd7('0x6')](),controller['voiceChannelMixMonitor']);router[_0xefd7('0x8')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0xefd7('0x6')](),controller[_0xefd7('0xa')]);router[_0xefd7('0x8')](_0xefd7('0xb'),auth[_0xefd7('0x6')](),controller[_0xefd7('0xc')]);router['get']('/chat/queues',auth[_0xefd7('0x6')](),controller['chatQueues']);router[_0xefd7('0x8')](_0xefd7('0xd'),auth[_0xefd7('0x6')](),controller['mailQueues']);router['get'](_0xefd7('0xe'),auth[_0xefd7('0x6')](),controller[_0xefd7('0xf')]);router['get']('/openchannel/queues',auth[_0xefd7('0x6')](),controller[_0xefd7('0x10')]);router[_0xefd7('0x8')]('/sms/queues',auth[_0xefd7('0x6')](),controller[_0xefd7('0x11')]);router[_0xefd7('0x8')](_0xefd7('0x12'),auth[_0xefd7('0x6')](),controller['whatsappQueues']);router[_0xefd7('0x8')](_0xefd7('0x13'),auth[_0xefd7('0x6')](),controller[_0xefd7('0x14')]);router[_0xefd7('0x8')](_0xefd7('0x15'),auth['isAuthenticated'](),controller[_0xefd7('0x16')]);router['get']('/voice/queues/channels',auth[_0xefd7('0x6')](),controller[_0xefd7('0x17')]);router[_0xefd7('0x8')]('/voice/queues/channels/:uniqueid',auth[_0xefd7('0x6')](),controller[_0xefd7('0x18')]);router['get'](_0xefd7('0x19'),auth[_0xefd7('0x6')](),controller[_0xefd7('0x1a')]);router[_0xefd7('0x8')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0xefd7('0x6')](),controller[_0xefd7('0x1b')]);router[_0xefd7('0x8')](_0xefd7('0x1c'),auth[_0xefd7('0x6')](),controller[_0xefd7('0x1d')]);router[_0xefd7('0x1e')](_0xefd7('0x1c'),auth['isAuthenticated'](),controller[_0xefd7('0x1f')]);router[_0xefd7('0x8')](_0xefd7('0x20'),auth[_0xefd7('0x6')](),controller[_0xefd7('0x21')]);router['get']('/outbound/channels',auth[_0xefd7('0x6')](),controller['outboundChannels']);router[_0xefd7('0x8')](_0xefd7('0x22'),auth['isAuthenticated'](),controller[_0xefd7('0x23')]);router[_0xefd7('0x1e')](_0xefd7('0x24'),auth[_0xefd7('0x6')](),controller[_0xefd7('0x25')]);router[_0xefd7('0x8')](_0xefd7('0x26'),auth[_0xefd7('0x6')](),controller['telephones']);router[_0xefd7('0x8')](_0xefd7('0x27'),auth['isAuthenticated'](),controller[_0xefd7('0x28')]);router[_0xefd7('0x8')]('/campaigns',auth[_0xefd7('0x6')](),controller[_0xefd7('0x29')]);router[_0xefd7('0x8')](_0xefd7('0x2a'),auth[_0xefd7('0x6')](),controller[_0xefd7('0x2b')]);router[_0xefd7('0x8')](_0xefd7('0x2c'),auth['isAuthenticated'](),controller[_0xefd7('0x2d')]);router[_0xefd7('0x8')](_0xefd7('0x2e'),auth[_0xefd7('0x6')](),controller[_0xefd7('0x2f')]);router[_0xefd7('0x8')](_0xefd7('0x30'),auth['isAuthenticated'](),controller['openchannelQueuesWaitingInteractions']);router[_0xefd7('0x8')](_0xefd7('0x31'),auth['isAuthenticated'](),controller[_0xefd7('0x32')]);router[_0xefd7('0x8')](_0xefd7('0x33'),auth['isAuthenticated'](),controller['smsQueuesWaitingInteractions']);router[_0xefd7('0x8')](_0xefd7('0x34'),auth['isAuthenticated'](),controller[_0xefd7('0x35')]);router[_0xefd7('0x8')](_0xefd7('0x36'),auth['isAuthenticated'](),controller[_0xefd7('0x37')]);router[_0xefd7('0x38')](_0xefd7('0x39'),auth[_0xefd7('0x6')](),controller['queueNotify'](_0xefd7('0x3a')));router[_0xefd7('0x8')](_0xefd7('0x3b'),auth[_0xefd7('0x6')](),controller[_0xefd7('0x3c')]);router['post'](_0xefd7('0x3d'),auth[_0xefd7('0x6')](),controller[_0xefd7('0x3e')]('chat'));router[_0xefd7('0x8')](_0xefd7('0x3f'),auth[_0xefd7('0x6')](),controller[_0xefd7('0x40')]);router[_0xefd7('0x38')]('/fax/queues/:id/notify',auth[_0xefd7('0x6')](),controller[_0xefd7('0x3e')](_0xefd7('0x41')));router[_0xefd7('0x8')](_0xefd7('0x42'),auth[_0xefd7('0x6')](),controller[_0xefd7('0x43')]);router['post'](_0xefd7('0x44'),auth[_0xefd7('0x6')](),controller[_0xefd7('0x3e')]('openchannel'));router[_0xefd7('0x8')](_0xefd7('0x45'),auth[_0xefd7('0x6')](),controller['showOpenchannelQueues']);router[_0xefd7('0x38')](_0xefd7('0x46'),auth[_0xefd7('0x6')](),controller[_0xefd7('0x3e')]('sms'));router[_0xefd7('0x38')]('/whatsapp/queues/:id/notify',auth[_0xefd7('0x6')](),controller[_0xefd7('0x3e')]('whatsapp'));router[_0xefd7('0x8')](_0xefd7('0x47'),auth[_0xefd7('0x6')](),controller[_0xefd7('0x48')]);router[_0xefd7('0x8')](_0xefd7('0x49'),auth['isAuthenticated'](),controller[_0xefd7('0x4a')]);router[_0xefd7('0x38')](_0xefd7('0x4b'),auth[_0xefd7('0x6')](),controller[_0xefd7('0x4c')]);module[_0xefd7('0x4d')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 79aa699..50ab1f9 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 _0xb10b=['showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','queue_id','uniq','value','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','Website','Account','Queue','\x20Queue\x20not\x20found','Message','findOne','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','*,*,*,*','agentNotify','channel','chat','User','Agent\x20not\x20found','Start','agentTransferTimeout','bluebird','lodash','util','../../mysqldb','api','jayson/promise','client','http','request','then','error','message','result','status','json','stack','name','send','isNil','rows','find','voiceChannels','query','catch','voiceChannelMixMonitor','merge','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','params','voiceQueues','showVoiceQueues','VoiceQueues','UpdateVoiceQueue','body','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','user','hasOwnProperty','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','MemberReport','findOrCreate','SIP/%s','interface','agent','AgentCapacity','capacity','telephones','Telephones','trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','MailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','faxQueues','FaxQueues'];(function(_0x39531c,_0x4e4dfb){var _0x9dfc07=function(_0x419fb9){while(--_0x419fb9){_0x39531c['push'](_0x39531c['shift']());}};_0x9dfc07(++_0x4e4dfb);}(_0xb10b,0x12a));var _0xbb10=function(_0x15d21f,_0x10997d){_0x15d21f=_0x15d21f-0x0;var _0x50b48d=_0xb10b[_0x15d21f];return _0x50b48d;};'use strict';var BPromise=require(_0xbb10('0x0'));var moment=require('moment');var _=require(_0xbb10('0x1'));var util=require(_0xbb10('0x2'));var db=require(_0xbb10('0x3'))['db'];var logger=require('../../config/logger')(_0xbb10('0x4'));var jayson=require(_0xbb10('0x5'));var amiClient=jayson[_0xbb10('0x6')][_0xbb10('0x7')]({'port':0x232a});var mailClient=jayson[_0xbb10('0x6')][_0xbb10('0x7')]({'port':0x232b});var routingClient=jayson['client'][_0xbb10('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){var _0x1c3ee5=_0x1b9e94?_0x1b9e94:amiClient;return _0x1c3ee5[_0xbb10('0x8')](_0x3cdd53,_0x513741)[_0xbb10('0x9')](function(_0x229887){if(_0x229887[_0xbb10('0xa')]){if(_0x229887['error']['code']===0x1f4){return _0x21370f(_0x229887[_0xbb10('0xa')][_0xbb10('0xb')]);}return _0x3fb675(_0x229887[_0xbb10('0xa')]['message']);}else{_0x3fb675(_0x229887[_0xbb10('0xc')]);}})['catch'](function(_0x44fb19){_0x21370f(_0x44fb19);});});}function respondWithResult(_0x916a32,_0x285009){_0x285009=_0x285009||0xc8;return function(_0x193a27){if(_0x193a27){return _0x916a32[_0xbb10('0xd')](_0x285009)[_0xbb10('0xe')](_0x193a27);}return _0x916a32['sendStatus'](0x194);};}function handleError(_0x26e021,_0x42d7e4){_0x42d7e4=_0x42d7e4||0x1f4;return function(_0x45b9d6){logger[_0xbb10('0xa')](_0x45b9d6[_0xbb10('0xf')]);if(_0x45b9d6[_0xbb10('0x10')]){delete _0x45b9d6[_0xbb10('0x10')];}_0x26e021[_0xbb10('0xd')](_0x42d7e4)[_0xbb10('0x11')](_0x45b9d6);};}function findById(_0x2b184e){return function(_0x4a2bfc){if(!_[_0xbb10('0x12')](_0x2b184e)&&!_[_0xbb10('0x12')](_0x4a2bfc)&&!_[_0xbb10('0x12')](_0x4a2bfc[_0xbb10('0x13')])){return _[_0xbb10('0x14')](_0x4a2bfc[_0xbb10('0x13')],function(_0x575cca){return _0x575cca['id']==_0x2b184e;});}return null;};}exports[_0xbb10('0x15')]=function(_0xbf2906,_0xe1c665){return respondWithRpcPromise('VoiceChannels',_0xbf2906[_0xbb10('0x16')])[_0xbb10('0x9')](respondWithResult(_0xe1c665,null))[_0xbb10('0x17')](handleError(_0xe1c665,null));};exports[_0xbb10('0x18')]=function(_0xdf237d,_0x44e563){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0xbb10('0x19')](_0xdf237d[_0xbb10('0x16')],_0xdf237d['params']))['then'](respondWithResult(_0x44e563,null))[_0xbb10('0x17')](handleError(_0x44e563,null));};exports[_0xbb10('0x1a')]=function(_0x2e911d,_0x317da4){return respondWithRpcPromise(_0xbb10('0x1b'),_[_0xbb10('0x19')](_0x2e911d[_0xbb10('0x16')],_0x2e911d[_0xbb10('0x1c')]))[_0xbb10('0x9')](respondWithResult(_0x317da4,null))[_0xbb10('0x17')](handleError(_0x317da4,null));};exports[_0xbb10('0x1d')]=function(_0x26ad93,_0x537898){return respondWithRpcPromise('VoiceQueues',_0x26ad93['query'])[_0xbb10('0x9')](respondWithResult(_0x537898,null))[_0xbb10('0x17')](handleError(_0x537898,null));};exports[_0xbb10('0x1e')]=function(_0x4e25ff,_0x2fdde9){return respondWithRpcPromise(_0xbb10('0x1f'),_0x4e25ff[_0xbb10('0x16')])[_0xbb10('0x9')](findById(_0x4e25ff[_0xbb10('0x1c')]['id']))[_0xbb10('0x9')](respondWithResult(_0x2fdde9,null))[_0xbb10('0x17')](handleError(_0x2fdde9,null));};exports['updateVoiceQueue']=function(_0x3796c7,_0x21ac54){return respondWithRpcPromise(_0xbb10('0x20'),_[_0xbb10('0x19')](_0x3796c7[_0xbb10('0x21')],_0x3796c7[_0xbb10('0x1c')]))['then'](respondWithResult(_0x21ac54,null))[_0xbb10('0x17')](handleError(_0x21ac54,null));};exports['voiceQueuesPreview']=function(_0x448d5c,_0x56f2da){return respondWithRpcPromise(_0xbb10('0x22'),_[_0xbb10('0x19')](_0x448d5c[_0xbb10('0x16')],_0x448d5c['params']))['then'](respondWithResult(_0x56f2da,null))[_0xbb10('0x17')](handleError(_0x56f2da,null));};exports[_0xbb10('0x23')]=function(_0x4f590d,_0x359ad4){return respondWithRpcPromise(_0xbb10('0x24'),_0x4f590d[_0xbb10('0x16')])[_0xbb10('0x9')](respondWithResult(_0x359ad4,null))[_0xbb10('0x17')](handleError(_0x359ad4,null));};exports[_0xbb10('0x25')]=function(_0xf85197,_0x4975f5){return respondWithRpcPromise(_0xbb10('0x26'),_[_0xbb10('0x19')](_0xf85197[_0xbb10('0x16')],_0xf85197[_0xbb10('0x1c')]))[_0xbb10('0x9')](respondWithResult(_0x4975f5,null))[_0xbb10('0x17')](handleError(_0x4975f5,null));};exports[_0xbb10('0x27')]=function(_0x10202c,_0x3c8d7d){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0xbb10('0x19')](_0x10202c[_0xbb10('0x16')],_0x10202c[_0xbb10('0x1c')]))[_0xbb10('0x9')](respondWithResult(_0x3c8d7d,null))['catch'](handleError(_0x3c8d7d,null));};exports[_0xbb10('0x28')]=function(_0x5de37b,_0x4e2754){return respondWithRpcPromise(_0xbb10('0x29'),_[_0xbb10('0x19')](_0x5de37b[_0xbb10('0x16')],_0x5de37b[_0xbb10('0x1c')]))[_0xbb10('0x9')](respondWithResult(_0x4e2754,null))[_0xbb10('0x17')](handleError(_0x4e2754,null));};exports['outbound']=function(_0x1e5bbd,_0x25d72f){return respondWithRpcPromise('Outbound',_0x1e5bbd['query'])['then'](respondWithResult(_0x25d72f,null))[_0xbb10('0x17')](handleError(_0x25d72f,null));};exports[_0xbb10('0x2a')]=function(_0x2b658a,_0x4d5a9b){return respondWithRpcPromise(_0xbb10('0x2b'),_0x2b658a[_0xbb10('0x16')])[_0xbb10('0x9')](respondWithResult(_0x4d5a9b,null))['catch'](handleError(_0x4d5a9b,null));};exports[_0xbb10('0x2c')]=function(_0x12238a,_0x1dcd38){var _0x446f49;return respondWithRpcPromise('Agents',_0x12238a[_0xbb10('0x16')])[_0xbb10('0x9')](function(_0x5835fd){_0x446f49=_0x5835fd;return respondWithRpcPromise(_0xbb10('0x2d'),_0x12238a[_0xbb10('0x16')],routingClient);})[_0xbb10('0x9')](function(_0x3a9934){return _[_0xbb10('0x19')]({},_0x3a9934,_0x446f49);})[_0xbb10('0x9')](respondWithResult(_0x1dcd38,null))['catch'](handleError(_0x1dcd38,null));};exports[_0xbb10('0x2e')]=function(_0x1c7fae,_0x3e7b4c){if(_0x1c7fae[_0xbb10('0x21')]&&_0x1c7fae['body'][_0xbb10('0x2f')]&&_0x1c7fae[_0xbb10('0x30')]&&_0x1c7fae[_0xbb10('0x30')][_0xbb10('0x10')]){for(var _0x5e2cfa in _0x1c7fae[_0xbb10('0x21')][_0xbb10('0x2f')]){if(_0x1c7fae['body']['interaction'][_0xbb10('0x31')](_0x5e2cfa)){db['MemberReport'][_0xbb10('0x32')]({'where':{'channel':_0x5e2cfa,'membername':_0x1c7fae[_0xbb10('0x30')]['name'],'type':_0xbb10('0x33'),'exitAt':null,'uniqueid':_0x1c7fae[_0xbb10('0x21')][_0xbb10('0x2f')][_0x5e2cfa]&&_0x1c7fae['body'][_0xbb10('0x2f')][_0x5e2cfa][_0xbb10('0x34')]?{'$notIn':_0x1c7fae[_0xbb10('0x21')][_0xbb10('0x2f')][_0x5e2cfa]}:{'$ne':null}}})[_0xbb10('0x9')](function(_0x19f94d){var _0x190781=moment()[_0xbb10('0x35')](_0xbb10('0x36'));for(var _0x43b948=0x0,_0x197871=_0x19f94d[_0xbb10('0x34')];_0x43b948<_0x197871;_0x43b948+=0x1){_0x19f94d[_0x43b948]['updateAttributes']({'exitAt':_0x190781});}});for(var _0x426b95=0x0;_0x426b95<_0x1c7fae[_0xbb10('0x21')]['interaction'][_0x5e2cfa][_0xbb10('0x34')];_0x426b95+=0x1){db[_0xbb10('0x37')][_0xbb10('0x38')]({'where':{'channel':_0x5e2cfa,'membername':_0x1c7fae[_0xbb10('0x30')][_0xbb10('0x10')],'type':_0xbb10('0x33'),'uniqueid':_0x1c7fae[_0xbb10('0x21')]['interaction'][_0x5e2cfa][_0x426b95],'exitAt':null},'defaults':{'channel':_0x5e2cfa,'membername':_0x1c7fae['user'][_0xbb10('0x10')],'interface':_[_0xbb10('0x12')](_0x1c7fae[_0xbb10('0x30')]['interface'])?util['format'](_0xbb10('0x39'),_0x1c7fae[_0xbb10('0x30')][_0xbb10('0x10')]):_0x1c7fae[_0xbb10('0x30')][_0xbb10('0x3a')],'type':_0xbb10('0x33'),'enterAt':moment()[_0xbb10('0x35')](_0xbb10('0x36')),'role':_0xbb10('0x3b'),'internal':_0x1c7fae[_0xbb10('0x30')]['internal'],'uniqueid':_0x1c7fae['body'][_0xbb10('0x2f')][_0x5e2cfa][_0x426b95]}});}}}}return respondWithRpcPromise(_0xbb10('0x3c'),{'id':_0x1c7fae[_0xbb10('0x1c')]['id'],'capacity':_0x1c7fae[_0xbb10('0x21')][_0xbb10('0x3d')]},routingClient)[_0xbb10('0x9')](respondWithResult(_0x3e7b4c,null))[_0xbb10('0x17')](handleError(_0x3e7b4c,null));};exports[_0xbb10('0x3e')]=function(_0x1c0d8f,_0x1214f7){return respondWithRpcPromise(_0xbb10('0x3f'),_0x1c0d8f[_0xbb10('0x16')])[_0xbb10('0x9')](respondWithResult(_0x1214f7,null))[_0xbb10('0x17')](handleError(_0x1214f7,null));};exports[_0xbb10('0x40')]=function(_0x547a7a,_0x124052){return respondWithRpcPromise('Trunks',_0x547a7a[_0xbb10('0x16')])[_0xbb10('0x9')](respondWithResult(_0x124052,null))[_0xbb10('0x17')](handleError(_0x124052,null));};exports[_0xbb10('0x41')]=function(_0x26e66e,_0x32d8e9){return respondWithRpcPromise(_0xbb10('0x42'),_0x26e66e[_0xbb10('0x16')])[_0xbb10('0x9')](respondWithResult(_0x32d8e9,null))[_0xbb10('0x17')](handleError(_0x32d8e9,null));};exports[_0xbb10('0x43')]=function(_0x1c2dce,_0x1d49e1){return respondWithRpcPromise(_0xbb10('0x44'),_0x1c2dce[_0xbb10('0x16')],routingClient)['then'](respondWithResult(_0x1d49e1,null))[_0xbb10('0x17')](handleError(_0x1d49e1,null));};exports[_0xbb10('0x45')]=function(_0x1b83a9,_0x4ce8e7){return respondWithRpcPromise(_0xbb10('0x44'),_0x1b83a9[_0xbb10('0x16')],routingClient)['then'](findById(_0x1b83a9[_0xbb10('0x1c')]['id']))[_0xbb10('0x9')](respondWithResult(_0x4ce8e7,null))[_0xbb10('0x17')](handleError(_0x4ce8e7,null));};exports[_0xbb10('0x46')]=function(_0x432728,_0x22de7f){return respondWithRpcPromise(_0xbb10('0x47'),_0x432728[_0xbb10('0x16')],routingClient)[_0xbb10('0x9')](respondWithResult(_0x22de7f,null))[_0xbb10('0x17')](handleError(_0x22de7f,null));};exports[_0xbb10('0x48')]=function(_0x2a1ce1,_0x16932f){return respondWithRpcPromise('MailQueues',_0x2a1ce1['query'],routingClient)[_0xbb10('0x9')](findById(_0x2a1ce1[_0xbb10('0x1c')]['id']))[_0xbb10('0x9')](respondWithResult(_0x16932f,null))[_0xbb10('0x17')](handleError(_0x16932f,null));};exports['mailAccounts']=function(_0x506498,_0x79411e){return respondWithRpcPromise(_0xbb10('0x49'),_0x506498[_0xbb10('0x16')],mailClient)[_0xbb10('0x9')](respondWithResult(_0x79411e,null))[_0xbb10('0x17')](handleError(_0x79411e,null));};exports[_0xbb10('0x4a')]=function(_0x45c0dc,_0x4a5fb9){return respondWithRpcPromise(_0xbb10('0x4b'),_0x45c0dc[_0xbb10('0x16')],routingClient)['then'](respondWithResult(_0x4a5fb9,null))['catch'](handleError(_0x4a5fb9,null));};exports['showOpenchannelQueues']=function(_0x32c1e8,_0x31c727){return respondWithRpcPromise(_0xbb10('0x4b'),_0x32c1e8['query'],routingClient)['then'](findById(_0x32c1e8['params']['id']))[_0xbb10('0x9')](respondWithResult(_0x31c727,null))[_0xbb10('0x17')](handleError(_0x31c727,null));};exports[_0xbb10('0x4c')]=function(_0x4e9fbd,_0xa1bbd9){return respondWithRpcPromise(_0xbb10('0x4d'),_0x4e9fbd['query'],routingClient)['then'](respondWithResult(_0xa1bbd9,null))[_0xbb10('0x17')](handleError(_0xa1bbd9,null));};exports[_0xbb10('0x4e')]=function(_0xd77753,_0x237246){return respondWithRpcPromise('SmsQueues',_0xd77753[_0xbb10('0x16')],routingClient)[_0xbb10('0x9')](findById(_0xd77753[_0xbb10('0x1c')]['id']))['then'](respondWithResult(_0x237246,null))[_0xbb10('0x17')](handleError(_0x237246,null));};exports[_0xbb10('0x4f')]=function(_0x3e3617,_0x5b2bd4){return respondWithRpcPromise(_0xbb10('0x50'),_0x3e3617[_0xbb10('0x16')],routingClient)[_0xbb10('0x9')](respondWithResult(_0x5b2bd4,null))[_0xbb10('0x17')](handleError(_0x5b2bd4,null));};exports['showWhatsappQueues']=function(_0x251417,_0x258e55){return respondWithRpcPromise(_0xbb10('0x50'),_0x251417[_0xbb10('0x16')],routingClient)['then'](findById(_0x251417[_0xbb10('0x1c')]['id']))[_0xbb10('0x9')](respondWithResult(_0x258e55,null))[_0xbb10('0x17')](handleError(_0x258e55,null));};exports[_0xbb10('0x51')]=function(_0x12f750,_0x17807e){return respondWithRpcPromise(_0xbb10('0x52'),_0x12f750['query'],routingClient)['then'](respondWithResult(_0x17807e,null))['catch'](handleError(_0x17807e,null));};exports[_0xbb10('0x53')]=function(_0x9c672d,_0x3eda96){return respondWithRpcPromise('FaxQueues',_0x9c672d['query'],routingClient)[_0xbb10('0x9')](findById(_0x9c672d[_0xbb10('0x1c')]['id']))[_0xbb10('0x9')](respondWithResult(_0x3eda96,null))[_0xbb10('0x17')](handleError(_0x3eda96,null));};exports[_0xbb10('0x54')]=function(_0x1ad2ed,_0x4cf2f3){return respondWithRpcPromise(_0xbb10('0x55'),_0x1ad2ed[_0xbb10('0x16')])[_0xbb10('0x9')](respondWithResult(_0x4cf2f3,null))[_0xbb10('0x17')](handleError(_0x4cf2f3,null));};exports[_0xbb10('0x56')]=function(_0x5bfc68,_0x56094a){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x5bfc68[_0xbb10('0x16')],routingClient)[_0xbb10('0x9')](respondWithResult(_0x56094a,null))[_0xbb10('0x17')](handleError(_0x56094a,null));};exports[_0xbb10('0x57')]=function(_0x2f7d2a,_0x1d40b8){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x2f7d2a[_0xbb10('0x16')],routingClient)['then'](respondWithResult(_0x1d40b8,null))['catch'](handleError(_0x1d40b8,null));};exports['openchannelQueuesWaitingInteractions']=function(_0xdf634f,_0x13040d){return respondWithRpcPromise(_0xbb10('0x58'),_0xdf634f[_0xbb10('0x16')],routingClient)['then'](respondWithResult(_0x13040d,null))[_0xbb10('0x17')](handleError(_0x13040d,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x576179,_0x165fe9){return respondWithRpcPromise(_0xbb10('0x58'),_0x576179[_0xbb10('0x16')],routingClient)[_0xbb10('0x9')](function(_0xfa3c7c){if(_0x576179['query'][_0xbb10('0x59')]!==undefined){var _0x19fcec=_(_0xfa3c7c[_0xbb10('0x13')])[_0xbb10('0x5a')]([_0x576179[_0xbb10('0x16')][_0xbb10('0x59')],_0x576179[_0xbb10('0x1c')]['id']])['map'](_0xbb10('0x5b'))[_0xbb10('0x5c')]()[_0xbb10('0x5d')]();return _0xfa3c7c[_0xbb10('0x13')][_0xbb10('0x5a')](function(_0x172be3){return _0x19fcec[_0xbb10('0x5e')](_0x172be3[_0xbb10('0x5b')])>-0x1;});}else{return _0xfa3c7c['rows'][_0xbb10('0x5a')](function(_0x218690){return _0x218690[_0xbb10('0x5b')]===parseInt(_0x576179['params']['id']);});}})['then'](respondWithResult(_0x165fe9,null))['catch'](handleError(_0x165fe9,null));};exports[_0xbb10('0x5f')]=function(_0x5a3c44,_0x4e3d6a){return respondWithRpcPromise(_0xbb10('0x60'),_0x5a3c44[_0xbb10('0x16')],routingClient)[_0xbb10('0x9')](respondWithResult(_0x4e3d6a,null))[_0xbb10('0x17')](handleError(_0x4e3d6a,null));};exports[_0xbb10('0x61')]=function(_0x24dca6,_0x33116){return respondWithRpcPromise(_0xbb10('0x62'),_0x24dca6[_0xbb10('0x16')],routingClient)['then'](respondWithResult(_0x33116,null))[_0xbb10('0x17')](handleError(_0x33116,null));};exports[_0xbb10('0x63')]=function(_0x46b6d2,_0x35b811){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x46b6d2['query'],routingClient)[_0xbb10('0x9')](respondWithResult(_0x35b811,null))[_0xbb10('0x17')](handleError(_0x35b811,null));};exports[_0xbb10('0x64')]=function(_0x32bb25){return function(_0x5ee705,_0x17d596){var _0x275bce,_0x3f0d74;var _0xf7b3e1=_[_0xbb10('0x65')](_0x32bb25);var _0x517185=_0x32bb25==='chat'?_0xbb10('0x66'):_0xbb10('0x67');return db[_0xf7b3e1+_0xbb10('0x68')]['findOne']({'raw':!![],'where':{'id':_0x5ee705[_0xbb10('0x1c')]['id']}})[_0xbb10('0x9')](function(_0x50bcc9){if(_['isNil'](_0x50bcc9)){throw new Error(_0xf7b3e1+_0xbb10('0x69'));}_0x275bce=_0x50bcc9;return db[_0xf7b3e1+_0xbb10('0x6a')][_0xbb10('0x6b')]({'where':{'id':_0x5ee705['body'][_0xbb10('0x6c')]},'include':[{'model':db[_0xf7b3e1+_0xbb10('0x6d')],'as':_0xbb10('0x6d')},{'model':db[_0xf7b3e1+_0x517185],'as':_0xbb10('0x67')}]});})[_0xbb10('0x9')](function(_0x5de006){if(_[_0xbb10('0x12')](_0x5de006)){throw new Error(_0xf7b3e1+_0xbb10('0x6e'));}_0x3f0d74=_0x5de006;return _0x5de006[_0xbb10('0x6f')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x3367d4={'uniqueid':_0x32bb25+'.'+_0x3f0d74['id']+'.'+_0x3f0d74[_0xbb10('0x6d')]['id'],'FromUserId':_0x5ee705[_0xbb10('0x30')]['id'],'type':_0xbb10('0x70')};_0x3367d4[_0xf7b3e1+_0xbb10('0x71')]=_0x3f0d74['id'];_0x3367d4[_0xf7b3e1+_0xbb10('0x72')]=_0x3f0d74[_0xbb10('0x6d')]['id'];_0x3367d4[_0xbb10('0x73')+_0xf7b3e1+_0x517185+'Id']=_0x3f0d74[_0xbb10('0x67')]['id'];_0x3367d4['To'+_0xf7b3e1+_0xbb10('0x74')]=_0x275bce['id'];return db[_0xf7b3e1+_0xbb10('0x75')][_0xbb10('0x76')](_0x3367d4);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x32bb25,'interaction':_0x3f0d74[_0xbb10('0x6d')],'message':_0x3f0d74,'account':_0x3f0d74[_0xbb10('0x67')],'applications':[{'id':0x0,'priority':0x1,'app':_0xbb10('0x70'),'appdata':_0x275bce[_0xbb10('0x10')]+','+(_0x3f0d74[_0xbb10('0x67')]['queueTransferTimeout']||0x12c),'interval':_0xbb10('0x77')}],'transfer':!![]},routingClient);})[_0xbb10('0x9')](respondWithResult(_0x17d596,null))[_0xbb10('0x17')](handleError(_0x17d596,null));};};exports[_0xbb10('0x78')]=function(_0x19694d,_0x379d49){var _0x546db5,_0xb25e71;if(_[_0xbb10('0x12')](_0x19694d['body'][_0xbb10('0x79')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0xc53c87=_0x19694d[_0xbb10('0x21')][_0xbb10('0x79')];var _0xa99bf5=_[_0xbb10('0x65')](_0xc53c87);var _0x556d7b=_0xc53c87===_0xbb10('0x7a')?'Website':_0xbb10('0x67');return db[_0xbb10('0x7b')]['findOne']({'raw':!![],'where':{'id':_0x19694d['params']['id'],'role':_0xbb10('0x3b')}})[_0xbb10('0x9')](function(_0x1b77c2){if(_[_0xbb10('0x12')](_0x1b77c2)){throw new Error(_0xbb10('0x7c'));}_0x546db5=_0x1b77c2;return db[_0xa99bf5+_0xbb10('0x6a')][_0xbb10('0x6b')]({'where':{'id':_0x19694d[_0xbb10('0x21')][_0xbb10('0x6c')]},'include':[{'model':db[_0xa99bf5+_0xbb10('0x6d')],'as':_0xbb10('0x6d')},{'model':db[_0xa99bf5+_0x556d7b],'as':'Account'}]});})[_0xbb10('0x9')](function(_0x3eeceb){if(_[_0xbb10('0x12')](_0x3eeceb)){throw new Error(_0xa99bf5+_0xbb10('0x6e'));}_0xb25e71=_0x3eeceb;return _0x3eeceb[_0xbb10('0x6f')]({'read':0x0,'readAt':null,'UserId':null});})[_0xbb10('0x9')](function(){var _0xfefa17={'uniqueid':_0xc53c87+'.'+_0xb25e71['id']+'.'+_0xb25e71[_0xbb10('0x6d')]['id'],'FromUserId':_0x19694d[_0xbb10('0x30')]['id'],'type':_0xbb10('0x3b'),'ToUserId':_0x546db5['id']};_0xfefa17[_0xa99bf5+_0xbb10('0x71')]=_0xb25e71['id'];_0xfefa17[_0xa99bf5+_0xbb10('0x72')]=_0xb25e71['Interaction']['id'];_0xfefa17[_0xbb10('0x73')+_0xa99bf5+_0x556d7b+'Id']=_0xb25e71['Account']['id'];return db[_0xa99bf5+_0xbb10('0x75')][_0xbb10('0x76')](_0xfefa17);})[_0xbb10('0x9')](function(){return respondWithRpcPromise(_0xbb10('0x7d'),{'channel':_0xc53c87,'interaction':_0xb25e71[_0xbb10('0x6d')],'message':_0xb25e71,'account':_0xb25e71['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xbb10('0x3b'),'appdata':_0x546db5[_0xbb10('0x10')]+','+(_0xb25e71[_0xbb10('0x67')][_0xbb10('0x7e')]||0x12c),'interval':_0xbb10('0x77')}],'transfer':!![]},routingClient);})[_0xbb10('0x9')](respondWithResult(_0x379d49,null))['catch'](handleError(_0x379d49,null));}; \ No newline at end of file +var _0xa9e0=['mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','filter','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','chat','Website','Account','findOne','\x20Queue\x20not\x20found','Message','Interaction','\x20Message\x20not\x20found','MessageId','InteractionId','From','QueueId','create','Start','queue','queueTransferTimeout','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','channel','capitalize','User','messageId','update','bluebird','moment','lodash','../../config/logger','jayson/promise','client','http','then','error','code','catch','status','sendStatus','stack','name','send','isNil','find','rows','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','showVoiceQueues','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','INTERACTION','interface','SIP/%s','agent','internal','AgentCapacity','telephones','Telephones','Trunks','campaigns','ChatQueues','mailQueues','showMailQueues','MailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'use strict';var BPromise=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var util=require('util');var db=require('../../mysqldb')['db'];var logger=require(_0x0a9e('0x3'))('api');var jayson=require(_0x0a9e('0x4'));var amiClient=jayson[_0x0a9e('0x5')][_0x0a9e('0x6')]({'port':0x232a});var mailClient=jayson[_0x0a9e('0x5')][_0x0a9e('0x6')]({'port':0x232b});var routingClient=jayson['client'][_0x0a9e('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){var _0x56465b=_0x5f41ea?_0x5f41ea:amiClient;return _0x56465b['request'](_0x441e3a,_0x2cc193)[_0x0a9e('0x7')](function(_0xf81284){if(_0xf81284[_0x0a9e('0x8')]){if(_0xf81284[_0x0a9e('0x8')][_0x0a9e('0x9')]===0x1f4){return _0xe42b77(_0xf81284[_0x0a9e('0x8')]['message']);}return _0x503809(_0xf81284['error']['message']);}else{_0x503809(_0xf81284['result']);}})[_0x0a9e('0xa')](function(_0x36471c){_0xe42b77(_0x36471c);});});}function respondWithResult(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xc8;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0xb')](_0x26d672)['json'](_0x32d742);}return _0xd5b662[_0x0a9e('0xc')](0x194);};}function handleError(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0x1f4;return function(_0x281129){logger[_0x0a9e('0x8')](_0x281129[_0x0a9e('0xd')]);if(_0x281129['name']){delete _0x281129[_0x0a9e('0xe')];}_0x239b12['status'](_0x2b4227)[_0x0a9e('0xf')](_0x281129);};}function findById(_0x519dfd){return function(_0x16033c){if(!_[_0x0a9e('0x10')](_0x519dfd)&&!_['isNil'](_0x16033c)&&!_[_0x0a9e('0x10')](_0x16033c['rows'])){return _[_0x0a9e('0x11')](_0x16033c[_0x0a9e('0x12')],function(_0x106033){return _0x106033['id']==_0x519dfd;});}return null;};}exports[_0x0a9e('0x13')]=function(_0x31b1ca,_0x2eb11f){return respondWithRpcPromise(_0x0a9e('0x14'),_0x31b1ca[_0x0a9e('0x15')])[_0x0a9e('0x7')](respondWithResult(_0x2eb11f,null))[_0x0a9e('0xa')](handleError(_0x2eb11f,null));};exports[_0x0a9e('0x16')]=function(_0x105080,_0x4bb1e3){return respondWithRpcPromise(_0x0a9e('0x17'),_[_0x0a9e('0x18')](_0x105080['query'],_0x105080[_0x0a9e('0x19')]))['then'](respondWithResult(_0x4bb1e3,null))['catch'](handleError(_0x4bb1e3,null));};exports[_0x0a9e('0x1a')]=function(_0x432e56,_0x38e7c4){return respondWithRpcPromise(_0x0a9e('0x1b'),_['merge'](_0x432e56[_0x0a9e('0x15')],_0x432e56[_0x0a9e('0x19')]))[_0x0a9e('0x7')](respondWithResult(_0x38e7c4,null))[_0x0a9e('0xa')](handleError(_0x38e7c4,null));};exports[_0x0a9e('0x1c')]=function(_0x42ac8f,_0x16b1ca){return respondWithRpcPromise('VoiceQueues',_0x42ac8f['query'])[_0x0a9e('0x7')](respondWithResult(_0x16b1ca,null))[_0x0a9e('0xa')](handleError(_0x16b1ca,null));};exports[_0x0a9e('0x1d')]=function(_0x33161b,_0x526cf3){return respondWithRpcPromise(_0x0a9e('0x1e'),_0x33161b['query'])[_0x0a9e('0x7')](findById(_0x33161b['params']['id']))[_0x0a9e('0x7')](respondWithResult(_0x526cf3,null))[_0x0a9e('0xa')](handleError(_0x526cf3,null));};exports[_0x0a9e('0x1f')]=function(_0x14433c,_0x140511){return respondWithRpcPromise(_0x0a9e('0x20'),_[_0x0a9e('0x18')](_0x14433c[_0x0a9e('0x21')],_0x14433c['params']))[_0x0a9e('0x7')](respondWithResult(_0x140511,null))[_0x0a9e('0xa')](handleError(_0x140511,null));};exports[_0x0a9e('0x22')]=function(_0x2ec755,_0x5c877d){return respondWithRpcPromise(_0x0a9e('0x23'),_[_0x0a9e('0x18')](_0x2ec755[_0x0a9e('0x15')],_0x2ec755[_0x0a9e('0x19')]))[_0x0a9e('0x7')](respondWithResult(_0x5c877d,null))[_0x0a9e('0xa')](handleError(_0x5c877d,null));};exports[_0x0a9e('0x24')]=function(_0x2e8759,_0x1dbde2){return respondWithRpcPromise('VoiceQueuesChannels',_0x2e8759[_0x0a9e('0x15')])['then'](respondWithResult(_0x1dbde2,null))[_0x0a9e('0xa')](handleError(_0x1dbde2,null));};exports[_0x0a9e('0x25')]=function(_0x1122db,_0x33bdb7){return respondWithRpcPromise(_0x0a9e('0x26'),_['merge'](_0x1122db[_0x0a9e('0x15')],_0x1122db[_0x0a9e('0x19')]))[_0x0a9e('0x7')](respondWithResult(_0x33bdb7,null))[_0x0a9e('0xa')](handleError(_0x33bdb7,null));};exports[_0x0a9e('0x27')]=function(_0x409319,_0x332d35){return respondWithRpcPromise(_0x0a9e('0x28'),_['merge'](_0x409319[_0x0a9e('0x15')],_0x409319['params']))[_0x0a9e('0x7')](respondWithResult(_0x332d35,null))[_0x0a9e('0xa')](handleError(_0x332d35,null));};exports[_0x0a9e('0x29')]=function(_0x3f3d41,_0x567193){return respondWithRpcPromise(_0x0a9e('0x2a'),_[_0x0a9e('0x18')](_0x3f3d41[_0x0a9e('0x15')],_0x3f3d41[_0x0a9e('0x19')]))['then'](respondWithResult(_0x567193,null))['catch'](handleError(_0x567193,null));};exports[_0x0a9e('0x2b')]=function(_0x5640eb,_0x24936a){return respondWithRpcPromise(_0x0a9e('0x2c'),_0x5640eb[_0x0a9e('0x15')])[_0x0a9e('0x7')](respondWithResult(_0x24936a,null))['catch'](handleError(_0x24936a,null));};exports[_0x0a9e('0x2d')]=function(_0x3bfce8,_0x3cae){return respondWithRpcPromise('OutboundChannels',_0x3bfce8[_0x0a9e('0x15')])[_0x0a9e('0x7')](respondWithResult(_0x3cae,null))[_0x0a9e('0xa')](handleError(_0x3cae,null));};exports['agents']=function(_0x546ef8,_0x11b61d){var _0x40d766;return respondWithRpcPromise('Agents',_0x546ef8[_0x0a9e('0x15')])[_0x0a9e('0x7')](function(_0x2e1b3a){_0x40d766=_0x2e1b3a;return respondWithRpcPromise(_0x0a9e('0x2e'),_0x546ef8['query'],routingClient);})['then'](function(_0x15e37d){return _[_0x0a9e('0x18')]({},_0x15e37d,_0x40d766);})['then'](respondWithResult(_0x11b61d,null))[_0x0a9e('0xa')](handleError(_0x11b61d,null));};exports[_0x0a9e('0x2f')]=function(_0x1459bb,_0x5b4f5e){if(_0x1459bb[_0x0a9e('0x21')]&&_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')]&&_0x1459bb[_0x0a9e('0x31')]&&_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0xe')]){for(var _0x2881b3 in _0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')]){if(_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x0a9e('0x32')](_0x2881b3)){db[_0x0a9e('0x33')][_0x0a9e('0x34')]({'where':{'channel':_0x2881b3,'membername':_0x1459bb[_0x0a9e('0x31')]['name'],'type':'INTERACTION','exitAt':null,'uniqueid':_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x2881b3]&&_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x2881b3][_0x0a9e('0x35')]?{'$notIn':_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x2881b3]}:{'$ne':null}}})[_0x0a9e('0x7')](function(_0x432fcc){var _0x25c6e6=moment()[_0x0a9e('0x36')](_0x0a9e('0x37'));for(var _0x5026aa=0x0,_0x117c99=_0x432fcc[_0x0a9e('0x35')];_0x5026aa<_0x117c99;_0x5026aa+=0x1){_0x432fcc[_0x5026aa][_0x0a9e('0x38')]({'exitAt':_0x25c6e6});}});for(var _0xfbd5ad=0x0;_0xfbd5ad<_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x2881b3][_0x0a9e('0x35')];_0xfbd5ad+=0x1){db[_0x0a9e('0x33')]['findOrCreate']({'where':{'channel':_0x2881b3,'membername':_0x1459bb[_0x0a9e('0x31')]['name'],'type':_0x0a9e('0x39'),'uniqueid':_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x2881b3][_0xfbd5ad],'exitAt':null},'defaults':{'channel':_0x2881b3,'membername':_0x1459bb['user'][_0x0a9e('0xe')],'interface':_[_0x0a9e('0x10')](_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x3a')])?util[_0x0a9e('0x36')](_0x0a9e('0x3b'),_0x1459bb[_0x0a9e('0x31')]['name']):_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x3a')],'type':_0x0a9e('0x39'),'enterAt':moment()[_0x0a9e('0x36')](_0x0a9e('0x37')),'role':_0x0a9e('0x3c'),'internal':_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x3d')],'uniqueid':_0x1459bb[_0x0a9e('0x21')]['interaction'][_0x2881b3][_0xfbd5ad]}});}}}}return respondWithRpcPromise(_0x0a9e('0x3e'),{'id':_0x1459bb[_0x0a9e('0x19')]['id'],'capacity':_0x1459bb['body']['capacity']},routingClient)['then'](respondWithResult(_0x5b4f5e,null))[_0x0a9e('0xa')](handleError(_0x5b4f5e,null));};exports[_0x0a9e('0x3f')]=function(_0x37edaa,_0x11545a){return respondWithRpcPromise(_0x0a9e('0x40'),_0x37edaa[_0x0a9e('0x15')])[_0x0a9e('0x7')](respondWithResult(_0x11545a,null))[_0x0a9e('0xa')](handleError(_0x11545a,null));};exports['trunks']=function(_0x4b1b9f,_0x53975a){return respondWithRpcPromise(_0x0a9e('0x41'),_0x4b1b9f[_0x0a9e('0x15')])[_0x0a9e('0x7')](respondWithResult(_0x53975a,null))['catch'](handleError(_0x53975a,null));};exports[_0x0a9e('0x42')]=function(_0x161aa7,_0x53d113){return respondWithRpcPromise('Campaigns',_0x161aa7[_0x0a9e('0x15')])['then'](respondWithResult(_0x53d113,null))[_0x0a9e('0xa')](handleError(_0x53d113,null));};exports['chatQueues']=function(_0x2e5e62,_0x3c20b2){return respondWithRpcPromise(_0x0a9e('0x43'),_0x2e5e62['query'],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x3c20b2,null))[_0x0a9e('0xa')](handleError(_0x3c20b2,null));};exports['showChatQueues']=function(_0x50f687,_0x128aa6){return respondWithRpcPromise(_0x0a9e('0x43'),_0x50f687['query'],routingClient)[_0x0a9e('0x7')](findById(_0x50f687['params']['id']))[_0x0a9e('0x7')](respondWithResult(_0x128aa6,null))['catch'](handleError(_0x128aa6,null));};exports[_0x0a9e('0x44')]=function(_0x4a6deb,_0x5da27d){return respondWithRpcPromise('MailQueues',_0x4a6deb[_0x0a9e('0x15')],routingClient)['then'](respondWithResult(_0x5da27d,null))[_0x0a9e('0xa')](handleError(_0x5da27d,null));};exports[_0x0a9e('0x45')]=function(_0x3cfd00,_0x19b4df){return respondWithRpcPromise(_0x0a9e('0x46'),_0x3cfd00[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](findById(_0x3cfd00[_0x0a9e('0x19')]['id']))['then'](respondWithResult(_0x19b4df,null))[_0x0a9e('0xa')](handleError(_0x19b4df,null));};exports[_0x0a9e('0x47')]=function(_0x2642bb,_0x30c491){return respondWithRpcPromise(_0x0a9e('0x48'),_0x2642bb[_0x0a9e('0x15')],mailClient)['then'](respondWithResult(_0x30c491,null))[_0x0a9e('0xa')](handleError(_0x30c491,null));};exports[_0x0a9e('0x49')]=function(_0x5239ef,_0x3649cc){return respondWithRpcPromise('OpenchannelQueues',_0x5239ef[_0x0a9e('0x15')],routingClient)['then'](respondWithResult(_0x3649cc,null))['catch'](handleError(_0x3649cc,null));};exports['showOpenchannelQueues']=function(_0x273cb5,_0x49d231){return respondWithRpcPromise(_0x0a9e('0x4a'),_0x273cb5[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](findById(_0x273cb5[_0x0a9e('0x19')]['id']))[_0x0a9e('0x7')](respondWithResult(_0x49d231,null))[_0x0a9e('0xa')](handleError(_0x49d231,null));};exports['smsQueues']=function(_0x1627a7,_0x5854cc){return respondWithRpcPromise(_0x0a9e('0x4b'),_0x1627a7[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x5854cc,null))['catch'](handleError(_0x5854cc,null));};exports[_0x0a9e('0x4c')]=function(_0x156f1c,_0x119677){return respondWithRpcPromise(_0x0a9e('0x4b'),_0x156f1c['query'],routingClient)[_0x0a9e('0x7')](findById(_0x156f1c[_0x0a9e('0x19')]['id']))['then'](respondWithResult(_0x119677,null))[_0x0a9e('0xa')](handleError(_0x119677,null));};exports[_0x0a9e('0x4d')]=function(_0x88dcbf,_0x409b29){return respondWithRpcPromise(_0x0a9e('0x4e'),_0x88dcbf['query'],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x409b29,null))[_0x0a9e('0xa')](handleError(_0x409b29,null));};exports[_0x0a9e('0x4f')]=function(_0x47bb43,_0x3528b7){return respondWithRpcPromise('WhatsappQueues',_0x47bb43['query'],routingClient)[_0x0a9e('0x7')](findById(_0x47bb43[_0x0a9e('0x19')]['id']))[_0x0a9e('0x7')](respondWithResult(_0x3528b7,null))[_0x0a9e('0xa')](handleError(_0x3528b7,null));};exports[_0x0a9e('0x50')]=function(_0xc8c264,_0x387489){return respondWithRpcPromise(_0x0a9e('0x51'),_0xc8c264[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x387489,null))[_0x0a9e('0xa')](handleError(_0x387489,null));};exports[_0x0a9e('0x52')]=function(_0x2bbb86,_0x2b8192){return respondWithRpcPromise(_0x0a9e('0x51'),_0x2bbb86[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](findById(_0x2bbb86[_0x0a9e('0x19')]['id']))['then'](respondWithResult(_0x2b8192,null))[_0x0a9e('0xa')](handleError(_0x2b8192,null));};exports[_0x0a9e('0x53')]=function(_0x243d12,_0x4edbb0){return respondWithRpcPromise(_0x0a9e('0x54'),_0x243d12[_0x0a9e('0x15')])['then'](respondWithResult(_0x4edbb0,null))[_0x0a9e('0xa')](handleError(_0x4edbb0,null));};exports[_0x0a9e('0x55')]=function(_0x3ef315,_0x427946){return respondWithRpcPromise(_0x0a9e('0x56'),_0x3ef315['query'],routingClient)['then'](respondWithResult(_0x427946,null))['catch'](handleError(_0x427946,null));};exports[_0x0a9e('0x57')]=function(_0x18bf5d,_0x1104ad){return respondWithRpcPromise(_0x0a9e('0x58'),_0x18bf5d[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x1104ad,null))[_0x0a9e('0xa')](handleError(_0x1104ad,null));};exports[_0x0a9e('0x59')]=function(_0x5512d1,_0x235f8f){return respondWithRpcPromise(_0x0a9e('0x5a'),_0x5512d1[_0x0a9e('0x15')],routingClient)['then'](respondWithResult(_0x235f8f,null))[_0x0a9e('0xa')](handleError(_0x235f8f,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x4437ff,_0x44351d){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x4437ff[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](function(_0x2cc7a7){if(_0x4437ff[_0x0a9e('0x15')]['type']!==undefined){var _0x1d442c=_(_0x2cc7a7[_0x0a9e('0x12')])[_0x0a9e('0x5b')]([_0x4437ff[_0x0a9e('0x15')]['type'],_0x4437ff[_0x0a9e('0x19')]['id']])[_0x0a9e('0x5c')](_0x0a9e('0x5d'))[_0x0a9e('0x5e')]()['value']();return _0x2cc7a7[_0x0a9e('0x12')][_0x0a9e('0x5b')](function(_0x30a4c7){return _0x1d442c[_0x0a9e('0x5f')](_0x30a4c7[_0x0a9e('0x5d')])>-0x1;});}else{return _0x2cc7a7[_0x0a9e('0x12')][_0x0a9e('0x5b')](function(_0x3df0e3){return _0x3df0e3[_0x0a9e('0x5d')]===parseInt(_0x4437ff[_0x0a9e('0x19')]['id']);});}})[_0x0a9e('0x7')](respondWithResult(_0x44351d,null))[_0x0a9e('0xa')](handleError(_0x44351d,null));};exports[_0x0a9e('0x60')]=function(_0xe0749e,_0x5b35db){return respondWithRpcPromise(_0x0a9e('0x61'),_0xe0749e[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x5b35db,null))['catch'](handleError(_0x5b35db,null));};exports[_0x0a9e('0x62')]=function(_0x33dda0,_0x8cea96){return respondWithRpcPromise(_0x0a9e('0x63'),_0x33dda0['query'],routingClient)['then'](respondWithResult(_0x8cea96,null))[_0x0a9e('0xa')](handleError(_0x8cea96,null));};exports[_0x0a9e('0x64')]=function(_0x4c54fa,_0x45108c){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x4c54fa[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x45108c,null))['catch'](handleError(_0x45108c,null));};exports[_0x0a9e('0x65')]=function(_0x41cf12){return function(_0x2d2286,_0x42b959){var _0x3755fe,_0x1f42a0;var _0x444f1f=_['capitalize'](_0x41cf12);var _0x2973d3=_0x41cf12===_0x0a9e('0x66')?_0x0a9e('0x67'):_0x0a9e('0x68');return db[_0x444f1f+'Queue'][_0x0a9e('0x69')]({'raw':!![],'where':{'id':_0x2d2286[_0x0a9e('0x19')]['id']}})['then'](function(_0x1d6834){if(_['isNil'](_0x1d6834)){throw new Error(_0x444f1f+_0x0a9e('0x6a'));}_0x3755fe=_0x1d6834;return db[_0x444f1f+_0x0a9e('0x6b')][_0x0a9e('0x69')]({'where':{'id':_0x2d2286[_0x0a9e('0x21')]['messageId']},'include':[{'model':db[_0x444f1f+'Interaction'],'as':_0x0a9e('0x6c')},{'model':db[_0x444f1f+_0x2973d3],'as':_0x0a9e('0x68')}]});})[_0x0a9e('0x7')](function(_0x5ac73d){if(_[_0x0a9e('0x10')](_0x5ac73d)){throw new Error(_0x444f1f+_0x0a9e('0x6d'));}_0x1f42a0=_0x5ac73d;return _0x5ac73d['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0xf0a802={'uniqueid':_0x41cf12+'.'+_0x1f42a0['id']+'.'+_0x1f42a0['Interaction']['id'],'FromUserId':_0x2d2286['user']['id'],'type':'queue'};_0xf0a802[_0x444f1f+_0x0a9e('0x6e')]=_0x1f42a0['id'];_0xf0a802[_0x444f1f+_0x0a9e('0x6f')]=_0x1f42a0[_0x0a9e('0x6c')]['id'];_0xf0a802[_0x0a9e('0x70')+_0x444f1f+_0x2973d3+'Id']=_0x1f42a0[_0x0a9e('0x68')]['id'];_0xf0a802['To'+_0x444f1f+_0x0a9e('0x71')]=_0x3755fe['id'];return db[_0x444f1f+'TransferReport'][_0x0a9e('0x72')](_0xf0a802);})['then'](function(){return respondWithRpcPromise(_0x0a9e('0x73'),{'channel':_0x41cf12,'interaction':_0x1f42a0[_0x0a9e('0x6c')],'message':_0x1f42a0,'account':_0x1f42a0[_0x0a9e('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0a9e('0x74'),'appdata':_0x3755fe['name']+','+(_0x1f42a0[_0x0a9e('0x68')][_0x0a9e('0x75')]||0x12c),'interval':_0x0a9e('0x76')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x42b959,null))[_0x0a9e('0xa')](handleError(_0x42b959,null));};};exports[_0x0a9e('0x77')]=function(_0x2a563d,_0x22063c){var _0x255e49,_0x1910bf;if(_[_0x0a9e('0x10')](_0x2a563d[_0x0a9e('0x21')]['channel'])){throw new Error(_0x0a9e('0x78'));}var _0x3325c5=_0x2a563d['body'][_0x0a9e('0x79')];var _0x982340=_[_0x0a9e('0x7a')](_0x3325c5);var _0x5a26c8=_0x3325c5===_0x0a9e('0x66')?'Website':_0x0a9e('0x68');return db[_0x0a9e('0x7b')][_0x0a9e('0x69')]({'raw':!![],'where':{'id':_0x2a563d[_0x0a9e('0x19')]['id'],'role':_0x0a9e('0x3c')}})[_0x0a9e('0x7')](function(_0x16a039){if(_[_0x0a9e('0x10')](_0x16a039)){throw new Error('Agent\x20not\x20found');}_0x255e49=_0x16a039;return db[_0x982340+_0x0a9e('0x6b')][_0x0a9e('0x69')]({'where':{'id':_0x2a563d[_0x0a9e('0x21')][_0x0a9e('0x7c')]},'include':[{'model':db[_0x982340+_0x0a9e('0x6c')],'as':_0x0a9e('0x6c')},{'model':db[_0x982340+_0x5a26c8],'as':_0x0a9e('0x68')}]});})[_0x0a9e('0x7')](function(_0x1808ba){if(_[_0x0a9e('0x10')](_0x1808ba)){throw new Error(_0x982340+_0x0a9e('0x6d'));}_0x1910bf=_0x1808ba;return _0x1808ba[_0x0a9e('0x7d')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0a9e('0x7')](function(){var _0x4989f9={'uniqueid':_0x3325c5+'.'+_0x1910bf['id']+'.'+_0x1910bf[_0x0a9e('0x6c')]['id'],'FromUserId':_0x2a563d[_0x0a9e('0x31')]['id'],'type':_0x0a9e('0x3c'),'ToUserId':_0x255e49['id']};_0x4989f9[_0x982340+_0x0a9e('0x6e')]=_0x1910bf['id'];_0x4989f9[_0x982340+_0x0a9e('0x6f')]=_0x1910bf['Interaction']['id'];_0x4989f9[_0x0a9e('0x70')+_0x982340+_0x5a26c8+'Id']=_0x1910bf[_0x0a9e('0x68')]['id'];return db[_0x982340+'TransferReport'][_0x0a9e('0x72')](_0x4989f9);})['then'](function(){return respondWithRpcPromise(_0x0a9e('0x73'),{'channel':_0x3325c5,'interaction':_0x1910bf[_0x0a9e('0x6c')],'message':_0x1910bf,'account':_0x1910bf[_0x0a9e('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0a9e('0x3c'),'appdata':_0x255e49['name']+','+(_0x1910bf[_0x0a9e('0x68')]['agentTransferTimeout']||0x12c),'interval':_0x0a9e('0x76')}],'transfer':!![]},routingClient);})[_0x0a9e('0x7')](respondWithResult(_0x22063c,null))['catch'](handleError(_0x22063c,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 9cb8533..5cc7047 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 _0x97d9=['post','create','put','/:id','delete','destroy','multer','util','path','connect-timeout','express','../../components/interaction/service','./schedule.controller','isAuthenticated','index','show','get','/:id/run','run'];(function(_0x36977a,_0x163325){var _0x12d782=function(_0x3e84f1){while(--_0x3e84f1){_0x36977a['push'](_0x36977a['shift']());}};_0x12d782(++_0x163325);}(_0x97d9,0x123));var _0x997d=function(_0x3994fb,_0x3568b7){_0x3994fb=_0x3994fb-0x0;var _0x5dadac=_0x97d9[_0x3994fb];return _0x5dadac;};'use strict';var multer=require(_0x997d('0x0'));var util=require(_0x997d('0x1'));var path=require(_0x997d('0x2'));var timeout=require(_0x997d('0x3'));var express=require(_0x997d('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x997d('0x5'));var config=require('../../config/environment');var controller=require(_0x997d('0x6'));router['get']('/',auth[_0x997d('0x7')](),controller[_0x997d('0x8')]);router['get']('/:id',auth[_0x997d('0x7')](),controller[_0x997d('0x9')]);router[_0x997d('0xa')](_0x997d('0xb'),auth['isAuthenticated'](),controller[_0x997d('0xc')]);router[_0x997d('0xd')]('/',auth[_0x997d('0x7')](),controller[_0x997d('0xe')]);router[_0x997d('0xf')](_0x997d('0x10'),auth['isAuthenticated'](),controller['update']);router[_0x997d('0x11')](_0x997d('0x10'),auth[_0x997d('0x7')](),controller[_0x997d('0x12')]);module['exports']=router; \ No newline at end of file +var _0xd3dd=['../../components/interaction/service','../../config/environment','./schedule.controller','isAuthenticated','index','get','/:id','show','/:id/run','run','post','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x4fc1fa,_0x12c167){var _0x131f24=function(_0x5a380e){while(--_0x5a380e){_0x4fc1fa['push'](_0x4fc1fa['shift']());}};_0x131f24(++_0x12c167);}(_0xd3dd,0x16f));var _0xdd3d=function(_0x1d3bf1,_0x234286){_0x1d3bf1=_0x1d3bf1-0x0;var _0x90328a=_0xd3dd[_0x1d3bf1];return _0x90328a;};'use strict';var multer=require(_0xdd3d('0x0'));var util=require(_0xdd3d('0x1'));var path=require(_0xdd3d('0x2'));var timeout=require(_0xdd3d('0x3'));var express=require(_0xdd3d('0x4'));var router=express[_0xdd3d('0x5')]();var fs_extra=require(_0xdd3d('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xdd3d('0x7'));var config=require(_0xdd3d('0x8'));var controller=require(_0xdd3d('0x9'));router['get']('/',auth[_0xdd3d('0xa')](),controller[_0xdd3d('0xb')]);router[_0xdd3d('0xc')](_0xdd3d('0xd'),auth['isAuthenticated'](),controller[_0xdd3d('0xe')]);router[_0xdd3d('0xc')](_0xdd3d('0xf'),auth[_0xdd3d('0xa')](),controller[_0xdd3d('0x10')]);router[_0xdd3d('0x11')]('/',auth[_0xdd3d('0xa')](),controller['create']);router[_0xdd3d('0x12')]('/:id',auth[_0xdd3d('0xa')](),controller[_0xdd3d('0x13')]);router[_0xdd3d('0x14')](_0xdd3d('0xd'),auth[_0xdd3d('0xa')](),controller[_0xdd3d('0x15')]);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 ff15f98..c0128e6 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 _0xba31=['INTEGER','years','quarters','months','days','hours','minutes','ENUM','csv','pdf','xlsx','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE'];(function(_0x312366,_0x424610){var _0x58fc7a=function(_0x20243d){while(--_0x20243d){_0x312366['push'](_0x312366['shift']());}};_0x58fc7a(++_0x424610);}(_0xba31,0x176));var _0x1ba3=function(_0x22c684,_0x753309){_0x22c684=_0x22c684-0x0;var _0x39fcbb=_0xba31[_0x22c684];return _0x39fcbb;};'use strict';var Sequelize=require(_0x1ba3('0x0'));module[_0x1ba3('0x1')]={'name':{'type':Sequelize[_0x1ba3('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x1ba3('0x2')]},'active':{'type':Sequelize[_0x1ba3('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x1ba3('0x2')],'allowNull':![],'defaultValue':_0x1ba3('0x4')},'startAt':{'type':Sequelize[_0x1ba3('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0x1ba3('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x1ba3('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x1ba3('0x7'),_0x1ba3('0x8'),_0x1ba3('0x9'),'weeks',_0x1ba3('0xa'),_0x1ba3('0xb'),_0x1ba3('0xc')),'allowNull':![],'defaultValue':_0x1ba3('0xa')},'output':{'type':Sequelize[_0x1ba3('0xd')](_0x1ba3('0xe'),_0x1ba3('0xf'),_0x1ba3('0x10')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x1ba3('0xd')](_0x1ba3('0x11'),_0x1ba3('0x12')),'allowNull':![],'defaultValue':_0x1ba3('0x11')},'sendMail':{'type':Sequelize[_0x1ba3('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x1ba3('0x13')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x60f5=['pdf','xlsx','default','custom','TEXT','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','months','days','hours','csv'];(function(_0x158235,_0x2bcade){var _0x22b7b1=function(_0x7e5241){while(--_0x7e5241){_0x158235['push'](_0x158235['shift']());}};_0x22b7b1(++_0x2bcade);}(_0x60f5,0x101));var _0x560f=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x60f5[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require('sequelize');module[_0x560f('0x0')]={'name':{'type':Sequelize[_0x560f('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x560f('0x1')]},'active':{'type':Sequelize[_0x560f('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x560f('0x1')],'allowNull':![],'defaultValue':_0x560f('0x3')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x560f('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x560f('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x560f('0x6')](_0x560f('0x7'),_0x560f('0x8'),_0x560f('0x9'),'weeks',_0x560f('0xa'),_0x560f('0xb'),'minutes'),'allowNull':![],'defaultValue':_0x560f('0xa')},'output':{'type':Sequelize['ENUM'](_0x560f('0xc'),_0x560f('0xd'),_0x560f('0xe')),'allowNull':![],'defaultValue':_0x560f('0xc')},'type':{'type':Sequelize[_0x560f('0x6')]('custom',_0x560f('0xf')),'allowNull':![],'defaultValue':_0x560f('0x10')},'sendMail':{'type':Sequelize[_0x560f('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x560f('0x1')]},'cc':{'type':Sequelize[_0x560f('0x11')]},'bcc':{'type':Sequelize[_0x560f('0x11')]},'sendIfEmpty':{'type':Sequelize[_0x560f('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 7176cba..27d2394 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 _0x0b47=['Schedule','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','run','eml-format','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','then','destroy','UserProfileResource','error','stack','name','send','index','map'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x0b47,0x120));var _0x70b4=function(_0x2f863c,_0x5e0b57){_0x2f863c=_0x2f863c-0x0;var _0x395146=_0x0b47[_0x2f863c];return _0x395146;};'use strict';var emlformat=require(_0x70b4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x70b4('0x1'));var rp=require('request-promise');var moment=require(_0x70b4('0x2'));var BPromise=require(_0x70b4('0x3'));var Mustache=require(_0x70b4('0x4'));var util=require(_0x70b4('0x5'));var path=require('path');var sox=require(_0x70b4('0x6'));var csv=require('to-csv');var ejs=require(_0x70b4('0x7'));var fs=require('fs');var fs_extra=require(_0x70b4('0x8'));var _=require(_0x70b4('0x9'));var squel=require(_0x70b4('0xa'));var crypto=require('crypto');var jsforce=require(_0x70b4('0xb'));var deskjs=require(_0x70b4('0xc'));var toCsv=require(_0x70b4('0xd'));var querystring=require(_0x70b4('0xe'));var Papa=require(_0x70b4('0xf'));var Redis=require('ioredis');var authService=require(_0x70b4('0x10'));var qs=require(_0x70b4('0x11'));var as=require(_0x70b4('0x12'));var hardwareService=require(_0x70b4('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x70b4('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x70b4('0x15'));var db=require(_0x70b4('0x16'))['db'];function respondWithStatusCode(_0x363148,_0x3959d0){_0x3959d0=_0x3959d0||0xcc;return function(_0x5ae3b2){if(_0x5ae3b2){return _0x363148[_0x70b4('0x17')](_0x3959d0);}return _0x363148[_0x70b4('0x18')](_0x3959d0)[_0x70b4('0x19')]();};}function respondWithResult(_0x368ca2,_0x251cf2){_0x251cf2=_0x251cf2||0xc8;return function(_0x31fb99){if(_0x31fb99){return _0x368ca2[_0x70b4('0x18')](_0x251cf2)[_0x70b4('0x1a')](_0x31fb99);}};}function respondWithFilteredResult(_0x2db193,_0x5e0393){return function(_0x5c80e5){if(_0x5c80e5){var _0x2c322d=typeof _0x5e0393['offset']===_0x70b4('0x1b')&&typeof _0x5e0393[_0x70b4('0x1c')]===_0x70b4('0x1b');var _0x4e8f08=_0x5c80e5['count'];var _0x2244f8=_0x2c322d?0x0:_0x5e0393[_0x70b4('0x1d')];var _0x4b730b=_0x2c322d?_0x5c80e5[_0x70b4('0x1e')]:_0x5e0393[_0x70b4('0x1d')]+_0x5e0393['limit'];var _0x3dac59;if(_0x4b730b>=_0x4e8f08){_0x4b730b=_0x4e8f08;_0x3dac59=0xc8;}else{_0x3dac59=0xce;}_0x2db193[_0x70b4('0x18')](_0x3dac59);return _0x2db193[_0x70b4('0x1f')](_0x70b4('0x20'),_0x2244f8+'-'+_0x4b730b+'/'+_0x4e8f08)[_0x70b4('0x1a')](_0x5c80e5);}return null;};}function patchUpdates(_0x4a4694){return function(_0x4a225c){try{jsonpatch[_0x70b4('0x21')](_0x4a225c,_0x4a4694,!![]);}catch(_0x1333dc){return BPromise[_0x70b4('0x22')](_0x1333dc);}return _0x4a225c['save']();};}function saveUpdates(_0x12e477,_0x244b15){return function(_0x2dfa45){if(_0x2dfa45){return _0x2dfa45['update'](_0x12e477)[_0x70b4('0x23')](function(_0x4b0372){return _0x4b0372;});}return null;};}function removeEntity(_0x1d5130,_0x31ab2f){return function(_0x8ba9dc){if(_0x8ba9dc){return _0x8ba9dc[_0x70b4('0x24')]()[_0x70b4('0x23')](function(){var _0x42bd3f=_0x8ba9dc['get']({'plain':!![]});var _0x5921f9='Scheduler';return db[_0x70b4('0x25')][_0x70b4('0x24')]({'where':{'type':_0x5921f9,'resourceId':_0x42bd3f['id']}})[_0x70b4('0x23')](function(){return _0x8ba9dc;});})['then'](function(){_0x1d5130[_0x70b4('0x18')](0xcc)[_0x70b4('0x19')]();});}};}function handleEntityNotFound(_0x4b0a89,_0x510650){return function(_0x3cd004){if(!_0x3cd004){_0x4b0a89['sendStatus'](0x194);}return _0x3cd004;};}function handleError(_0x4e455c,_0x5d64c0){_0x5d64c0=_0x5d64c0||0x1f4;return function(_0x25d583){logger[_0x70b4('0x26')](_0x25d583[_0x70b4('0x27')]);if(_0x25d583[_0x70b4('0x28')]){delete _0x25d583[_0x70b4('0x28')];}_0x4e455c[_0x70b4('0x18')](_0x5d64c0)[_0x70b4('0x29')](_0x25d583);};}exports[_0x70b4('0x2a')]=function(_0x27af05,_0x5b0789){var _0x52abd0={},_0x418f74={},_0x5f1c48={'count':0x0,'rows':[]};var _0x74e047=_[_0x70b4('0x2b')](db[_0x70b4('0x2c')]['rawAttributes'],function(_0x249a02){return{'name':_0x249a02[_0x70b4('0x2d')],'type':_0x249a02[_0x70b4('0x2e')][_0x70b4('0x2f')]};});_0x418f74[_0x70b4('0x30')]=_['map'](_0x74e047,_0x70b4('0x28'));_0x418f74[_0x70b4('0x31')]=_[_0x70b4('0x32')](_0x27af05[_0x70b4('0x31')]);_0x418f74[_0x70b4('0x33')]=_['intersection'](_0x418f74[_0x70b4('0x30')],_0x418f74[_0x70b4('0x31')]);_0x52abd0['attributes']=_[_0x70b4('0x34')](_0x418f74[_0x70b4('0x30')],qs[_0x70b4('0x35')](_0x27af05[_0x70b4('0x31')][_0x70b4('0x35')]));_0x52abd0['attributes']=_0x52abd0['attributes'][_0x70b4('0x36')]?_0x52abd0[_0x70b4('0x37')]:_0x418f74['model'];if(!_0x27af05[_0x70b4('0x31')][_0x70b4('0x38')](_0x70b4('0x39'))){_0x52abd0[_0x70b4('0x1c')]=qs[_0x70b4('0x1c')](_0x27af05[_0x70b4('0x31')]['limit']);_0x52abd0['offset']=qs[_0x70b4('0x1d')](_0x27af05['query']['offset']);}_0x52abd0['order']=qs[_0x70b4('0x3a')](_0x27af05[_0x70b4('0x31')][_0x70b4('0x3a')]);_0x52abd0[_0x70b4('0x3b')]=qs[_0x70b4('0x33')](_[_0x70b4('0x3c')](_0x27af05[_0x70b4('0x31')],_0x418f74[_0x70b4('0x33')]),_0x74e047);if(_0x27af05[_0x70b4('0x31')][_0x70b4('0x3d')]){_0x52abd0[_0x70b4('0x3b')]=_[_0x70b4('0x3e')](_0x52abd0[_0x70b4('0x3b')],{'$or':_[_0x70b4('0x2b')](_0x74e047,function(_0x570abe){if(_0x570abe['type']!==_0x70b4('0x3f')){var _0x3950b8={};_0x3950b8[_0x570abe[_0x70b4('0x28')]]={'$like':'%'+_0x27af05[_0x70b4('0x31')]['filter']+'%'};return _0x3950b8;}})});}_0x52abd0=_[_0x70b4('0x3e')]({},_0x52abd0,_0x27af05[_0x70b4('0x40')]);var _0x1b192b={'where':_0x52abd0[_0x70b4('0x3b')]};return db['Schedule'][_0x70b4('0x1e')](_0x1b192b)[_0x70b4('0x23')](function(_0x4f8e39){_0x5f1c48[_0x70b4('0x1e')]=_0x4f8e39;if(_0x27af05['query'][_0x70b4('0x41')]){_0x52abd0['include']=[{'all':!![]}];}return db['Schedule'][_0x70b4('0x42')](_0x52abd0);})[_0x70b4('0x23')](function(_0x4aa404){_0x5f1c48[_0x70b4('0x43')]=_0x4aa404;return _0x5f1c48;})[_0x70b4('0x23')](respondWithFilteredResult(_0x5b0789,_0x52abd0))[_0x70b4('0x44')](handleError(_0x5b0789,null));};exports[_0x70b4('0x45')]=function(_0x220c82,_0x9daf9d){var _0x4cc740={'raw':![],'where':{'id':_0x220c82[_0x70b4('0x46')]['id']}},_0x3a1242={};_0x3a1242[_0x70b4('0x30')]=_['keys'](db[_0x70b4('0x2c')][_0x70b4('0x47')]);_0x3a1242[_0x70b4('0x31')]=_['keys'](_0x220c82[_0x70b4('0x31')]);_0x3a1242[_0x70b4('0x33')]=_['intersection'](_0x3a1242[_0x70b4('0x30')],_0x3a1242[_0x70b4('0x31')]);_0x4cc740[_0x70b4('0x37')]=_[_0x70b4('0x34')](_0x3a1242[_0x70b4('0x30')],qs[_0x70b4('0x35')](_0x220c82['query'][_0x70b4('0x35')]));_0x4cc740['attributes']=_0x4cc740[_0x70b4('0x37')][_0x70b4('0x36')]?_0x4cc740['attributes']:_0x3a1242[_0x70b4('0x30')];if(_0x220c82[_0x70b4('0x31')]['includeAll']){_0x4cc740[_0x70b4('0x48')]=[{'all':!![]}];}_0x4cc740=_[_0x70b4('0x3e')]({},_0x4cc740,_0x220c82[_0x70b4('0x40')]);return db['Schedule'][_0x70b4('0x49')](_0x4cc740)[_0x70b4('0x23')](handleEntityNotFound(_0x9daf9d,null))['then'](respondWithResult(_0x9daf9d,null))[_0x70b4('0x44')](handleError(_0x9daf9d,null));};exports[_0x70b4('0x4a')]=function(_0x354585,_0x365856){return db[_0x70b4('0x2c')][_0x70b4('0x4a')](_0x354585['body'],{})['then'](function(_0x4316dc){var _0x1bbe32=_0x354585['user'][_0x70b4('0x4b')]({'plain':!![]});if(!_0x1bbe32)throw new Error(_0x70b4('0x4c'));if(_0x1bbe32['role']==='user'){var _0x424b58=_0x4316dc['get']({'plain':!![]});var _0x1ef644='Scheduler';return db[_0x70b4('0x4d')][_0x70b4('0x49')]({'where':{'name':_0x1ef644,'userProfileId':_0x1bbe32[_0x70b4('0x4e')]},'raw':!![]})['then'](function(_0x1d875e){if(_0x1d875e&&_0x1d875e['autoAssociation']===0x0){return db['UserProfileResource'][_0x70b4('0x4a')]({'name':_0x424b58[_0x70b4('0x28')],'resourceId':_0x424b58['id'],'type':_0x1d875e['name'],'sectionId':_0x1d875e['id']},{})['then'](function(){return _0x4316dc;});}else{return _0x4316dc;}})[_0x70b4('0x44')](function(_0x3cf1a8){logger[_0x70b4('0x26')](_0x70b4('0x4f'),_0x3cf1a8);throw _0x3cf1a8;});}return _0x4316dc;})[_0x70b4('0x23')](respondWithResult(_0x365856,0xc9))['catch'](handleError(_0x365856,null));};exports[_0x70b4('0x50')]=function(_0x39ed66,_0x4fbf69){if(_0x39ed66[_0x70b4('0x51')]['id']){delete _0x39ed66[_0x70b4('0x51')]['id'];}return db[_0x70b4('0x2c')][_0x70b4('0x49')]({'where':{'id':_0x39ed66[_0x70b4('0x46')]['id']}})[_0x70b4('0x23')](handleEntityNotFound(_0x4fbf69,null))[_0x70b4('0x23')](saveUpdates(_0x39ed66['body'],null))['then'](respondWithResult(_0x4fbf69,null))[_0x70b4('0x44')](handleError(_0x4fbf69,null));};exports[_0x70b4('0x24')]=function(_0x1a8ac7,_0x5a5d5a){return db[_0x70b4('0x2c')][_0x70b4('0x49')]({'where':{'id':_0x1a8ac7[_0x70b4('0x46')]['id']}})[_0x70b4('0x23')](handleEntityNotFound(_0x5a5d5a,null))[_0x70b4('0x23')](removeEntity(_0x5a5d5a,null))[_0x70b4('0x44')](handleError(_0x5a5d5a,null));};exports['run']=function(_0x3ca529,_0x8e7635,_0xb568ad){var _0x362d64=require('../../config/schedule');return db['Schedule'][_0x70b4('0x49')]({'where':{'id':_0x3ca529[_0x70b4('0x46')]['id']},'raw':!![]})[_0x70b4('0x23')](handleEntityNotFound(_0x8e7635,null))[_0x70b4('0x23')](function(){_0x362d64[_0x70b4('0x52')](_0x3ca529[_0x70b4('0x46')]['id']);})['then'](respondWithStatusCode(_0x8e7635,null))[_0x70b4('0x44')](handleError(_0x8e7635,null));}; \ No newline at end of file +var _0x5bc3=['autoAssociation','UserProfileResource','run','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','Content-Range','reject','save','update','then','destroy','get','Scheduler','error','stack','name','index','map','Schedule','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','includeAll','include','catch','show','params','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId'];(function(_0x4941c6,_0x3ca9f8){var _0x4d3654=function(_0x5295c8){while(--_0x5295c8){_0x4941c6['push'](_0x4941c6['shift']());}};_0x4d3654(++_0x3ca9f8);}(_0x5bc3,0xf9));var _0x35bc=function(_0x3b8dae,_0x70d8c){_0x3b8dae=_0x3b8dae-0x0;var _0x15e47d=_0x5bc3[_0x3b8dae];return _0x15e47d;};'use strict';var emlformat=require(_0x35bc('0x0'));var rimraf=require(_0x35bc('0x1'));var zipdir=require(_0x35bc('0x2'));var jsonpatch=require(_0x35bc('0x3'));var rp=require('request-promise');var moment=require(_0x35bc('0x4'));var BPromise=require(_0x35bc('0x5'));var Mustache=require(_0x35bc('0x6'));var util=require(_0x35bc('0x7'));var path=require(_0x35bc('0x8'));var sox=require(_0x35bc('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x35bc('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x35bc('0xb'));var toCsv=require(_0x35bc('0xc'));var querystring=require(_0x35bc('0xd'));var Papa=require(_0x35bc('0xe'));var Redis=require(_0x35bc('0xf'));var authService=require(_0x35bc('0x10'));var qs=require(_0x35bc('0x11'));var as=require(_0x35bc('0x12'));var hardwareService=require(_0x35bc('0x13'));var logger=require(_0x35bc('0x14'))('api');var utils=require(_0x35bc('0x15'));var config=require(_0x35bc('0x16'));var licenseUtil=require(_0x35bc('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x405e55,_0x25db58){_0x25db58=_0x25db58||0xcc;return function(_0x2190cf){if(_0x2190cf){return _0x405e55[_0x35bc('0x18')](_0x25db58);}return _0x405e55['status'](_0x25db58)['end']();};}function respondWithResult(_0x4cebe4,_0x16f841){_0x16f841=_0x16f841||0xc8;return function(_0x6978e1){if(_0x6978e1){return _0x4cebe4[_0x35bc('0x19')](_0x16f841)[_0x35bc('0x1a')](_0x6978e1);}};}function respondWithFilteredResult(_0xa4875c,_0x431e81){return function(_0x2316b9){if(_0x2316b9){var _0x1241eb=typeof _0x431e81[_0x35bc('0x1b')]===_0x35bc('0x1c')&&typeof _0x431e81['limit']===_0x35bc('0x1c');var _0x5eddab=_0x2316b9[_0x35bc('0x1d')];var _0x51a9e9=_0x1241eb?0x0:_0x431e81[_0x35bc('0x1b')];var _0x464dbd=_0x1241eb?_0x2316b9[_0x35bc('0x1d')]:_0x431e81['offset']+_0x431e81[_0x35bc('0x1e')];var _0x32f94b;if(_0x464dbd>=_0x5eddab){_0x464dbd=_0x5eddab;_0x32f94b=0xc8;}else{_0x32f94b=0xce;}_0xa4875c['status'](_0x32f94b);return _0xa4875c['set'](_0x35bc('0x1f'),_0x51a9e9+'-'+_0x464dbd+'/'+_0x5eddab)[_0x35bc('0x1a')](_0x2316b9);}return null;};}function patchUpdates(_0x58510f){return function(_0x2f9f4b){try{jsonpatch['apply'](_0x2f9f4b,_0x58510f,!![]);}catch(_0x49e6f0){return BPromise[_0x35bc('0x20')](_0x49e6f0);}return _0x2f9f4b[_0x35bc('0x21')]();};}function saveUpdates(_0x398fba,_0x3a9e1f){return function(_0x323914){if(_0x323914){return _0x323914[_0x35bc('0x22')](_0x398fba)[_0x35bc('0x23')](function(_0x318d68){return _0x318d68;});}return null;};}function removeEntity(_0x8b102b,_0x135b52){return function(_0x2e0f3f){if(_0x2e0f3f){return _0x2e0f3f[_0x35bc('0x24')]()[_0x35bc('0x23')](function(){var _0x31c534=_0x2e0f3f[_0x35bc('0x25')]({'plain':!![]});var _0x4c7bd1=_0x35bc('0x26');return db['UserProfileResource'][_0x35bc('0x24')]({'where':{'type':_0x4c7bd1,'resourceId':_0x31c534['id']}})[_0x35bc('0x23')](function(){return _0x2e0f3f;});})[_0x35bc('0x23')](function(){_0x8b102b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ac3f7,_0x33e6ab){return function(_0x10ec03){if(!_0x10ec03){_0x5ac3f7[_0x35bc('0x18')](0x194);}return _0x10ec03;};}function handleError(_0x18d198,_0x3a1877){_0x3a1877=_0x3a1877||0x1f4;return function(_0x473b36){logger[_0x35bc('0x27')](_0x473b36[_0x35bc('0x28')]);if(_0x473b36[_0x35bc('0x29')]){delete _0x473b36[_0x35bc('0x29')];}_0x18d198[_0x35bc('0x19')](_0x3a1877)['send'](_0x473b36);};}exports[_0x35bc('0x2a')]=function(_0x24d13d,_0x3fdc37){var _0x5b0dd9={},_0x418586={},_0x568f19={'count':0x0,'rows':[]};var _0x130661=_[_0x35bc('0x2b')](db[_0x35bc('0x2c')][_0x35bc('0x2d')],function(_0x37138b){return{'name':_0x37138b[_0x35bc('0x2e')],'type':_0x37138b[_0x35bc('0x2f')]['key']};});_0x418586[_0x35bc('0x30')]=_[_0x35bc('0x2b')](_0x130661,_0x35bc('0x29'));_0x418586[_0x35bc('0x31')]=_[_0x35bc('0x32')](_0x24d13d[_0x35bc('0x31')]);_0x418586[_0x35bc('0x33')]=_[_0x35bc('0x34')](_0x418586[_0x35bc('0x30')],_0x418586[_0x35bc('0x31')]);_0x5b0dd9[_0x35bc('0x35')]=_[_0x35bc('0x34')](_0x418586['model'],qs[_0x35bc('0x36')](_0x24d13d[_0x35bc('0x31')][_0x35bc('0x36')]));_0x5b0dd9[_0x35bc('0x35')]=_0x5b0dd9['attributes'][_0x35bc('0x37')]?_0x5b0dd9[_0x35bc('0x35')]:_0x418586[_0x35bc('0x30')];if(!_0x24d13d[_0x35bc('0x31')][_0x35bc('0x38')](_0x35bc('0x39'))){_0x5b0dd9[_0x35bc('0x1e')]=qs[_0x35bc('0x1e')](_0x24d13d[_0x35bc('0x31')]['limit']);_0x5b0dd9[_0x35bc('0x1b')]=qs['offset'](_0x24d13d[_0x35bc('0x31')][_0x35bc('0x1b')]);}_0x5b0dd9[_0x35bc('0x3a')]=qs[_0x35bc('0x3b')](_0x24d13d[_0x35bc('0x31')][_0x35bc('0x3b')]);_0x5b0dd9['where']=qs[_0x35bc('0x33')](_[_0x35bc('0x3c')](_0x24d13d['query'],_0x418586['filters']),_0x130661);if(_0x24d13d[_0x35bc('0x31')][_0x35bc('0x3d')]){_0x5b0dd9['where']=_['merge'](_0x5b0dd9[_0x35bc('0x3e')],{'$or':_[_0x35bc('0x2b')](_0x130661,function(_0x5c1888){if(_0x5c1888['type']!==_0x35bc('0x3f')){var _0x2b44c1={};_0x2b44c1[_0x5c1888['name']]={'$like':'%'+_0x24d13d[_0x35bc('0x31')][_0x35bc('0x3d')]+'%'};return _0x2b44c1;}})});}_0x5b0dd9=_['merge']({},_0x5b0dd9,_0x24d13d[_0x35bc('0x40')]);var _0x46617b={'where':_0x5b0dd9[_0x35bc('0x3e')]};return db[_0x35bc('0x2c')]['count'](_0x46617b)[_0x35bc('0x23')](function(_0x1bb155){_0x568f19[_0x35bc('0x1d')]=_0x1bb155;if(_0x24d13d['query'][_0x35bc('0x41')]){_0x5b0dd9[_0x35bc('0x42')]=[{'all':!![]}];}return db[_0x35bc('0x2c')]['findAll'](_0x5b0dd9);})[_0x35bc('0x23')](function(_0x48adb6){_0x568f19['rows']=_0x48adb6;return _0x568f19;})[_0x35bc('0x23')](respondWithFilteredResult(_0x3fdc37,_0x5b0dd9))[_0x35bc('0x43')](handleError(_0x3fdc37,null));};exports[_0x35bc('0x44')]=function(_0x10f556,_0x599cf1){var _0x5f17f7={'raw':![],'where':{'id':_0x10f556[_0x35bc('0x45')]['id']}},_0x32b2d5={};_0x32b2d5[_0x35bc('0x30')]=_[_0x35bc('0x32')](db[_0x35bc('0x2c')][_0x35bc('0x2d')]);_0x32b2d5[_0x35bc('0x31')]=_['keys'](_0x10f556[_0x35bc('0x31')]);_0x32b2d5[_0x35bc('0x33')]=_['intersection'](_0x32b2d5[_0x35bc('0x30')],_0x32b2d5['query']);_0x5f17f7[_0x35bc('0x35')]=_[_0x35bc('0x34')](_0x32b2d5[_0x35bc('0x30')],qs['fields'](_0x10f556['query']['fields']));_0x5f17f7[_0x35bc('0x35')]=_0x5f17f7[_0x35bc('0x35')][_0x35bc('0x37')]?_0x5f17f7[_0x35bc('0x35')]:_0x32b2d5[_0x35bc('0x30')];if(_0x10f556[_0x35bc('0x31')]['includeAll']){_0x5f17f7[_0x35bc('0x42')]=[{'all':!![]}];}_0x5f17f7=_[_0x35bc('0x46')]({},_0x5f17f7,_0x10f556[_0x35bc('0x40')]);return db[_0x35bc('0x2c')][_0x35bc('0x47')](_0x5f17f7)[_0x35bc('0x23')](handleEntityNotFound(_0x599cf1,null))[_0x35bc('0x23')](respondWithResult(_0x599cf1,null))[_0x35bc('0x43')](handleError(_0x599cf1,null));};exports[_0x35bc('0x48')]=function(_0x227148,_0x189ccf){return db[_0x35bc('0x2c')][_0x35bc('0x48')](_0x227148[_0x35bc('0x49')],{})[_0x35bc('0x23')](function(_0x53490f){var _0x570d77=_0x227148[_0x35bc('0x4a')][_0x35bc('0x25')]({'plain':!![]});if(!_0x570d77)throw new Error(_0x35bc('0x4b'));if(_0x570d77[_0x35bc('0x4c')]===_0x35bc('0x4a')){var _0x5d2752=_0x53490f[_0x35bc('0x25')]({'plain':!![]});var _0xb9757b=_0x35bc('0x26');return db[_0x35bc('0x4d')][_0x35bc('0x47')]({'where':{'name':_0xb9757b,'userProfileId':_0x570d77[_0x35bc('0x4e')]},'raw':!![]})[_0x35bc('0x23')](function(_0x4617dc){if(_0x4617dc&&_0x4617dc[_0x35bc('0x4f')]===0x0){return db[_0x35bc('0x50')][_0x35bc('0x48')]({'name':_0x5d2752[_0x35bc('0x29')],'resourceId':_0x5d2752['id'],'type':_0x4617dc[_0x35bc('0x29')],'sectionId':_0x4617dc['id']},{})[_0x35bc('0x23')](function(){return _0x53490f;});}else{return _0x53490f;}})[_0x35bc('0x43')](function(_0x168ce1){logger[_0x35bc('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x168ce1);throw _0x168ce1;});}return _0x53490f;})[_0x35bc('0x23')](respondWithResult(_0x189ccf,0xc9))[_0x35bc('0x43')](handleError(_0x189ccf,null));};exports[_0x35bc('0x22')]=function(_0x349779,_0x1fe224){if(_0x349779[_0x35bc('0x49')]['id']){delete _0x349779[_0x35bc('0x49')]['id'];}return db[_0x35bc('0x2c')][_0x35bc('0x47')]({'where':{'id':_0x349779[_0x35bc('0x45')]['id']}})[_0x35bc('0x23')](handleEntityNotFound(_0x1fe224,null))['then'](saveUpdates(_0x349779[_0x35bc('0x49')],null))['then'](respondWithResult(_0x1fe224,null))['catch'](handleError(_0x1fe224,null));};exports['destroy']=function(_0x439cb5,_0x5972a0){return db[_0x35bc('0x2c')][_0x35bc('0x47')]({'where':{'id':_0x439cb5['params']['id']}})[_0x35bc('0x23')](handleEntityNotFound(_0x5972a0,null))[_0x35bc('0x23')](removeEntity(_0x5972a0,null))[_0x35bc('0x43')](handleError(_0x5972a0,null));};exports[_0x35bc('0x51')]=function(_0x94fd0e,_0x23a138,_0xa6c493){var _0x31c6db=require('../../config/schedule');return db['Schedule'][_0x35bc('0x47')]({'where':{'id':_0x94fd0e['params']['id']},'raw':!![]})[_0x35bc('0x23')](handleEntityNotFound(_0x23a138,null))[_0x35bc('0x23')](function(){_0x31c6db[_0x35bc('0x51')](_0x94fd0e['params']['id']);})[_0x35bc('0x23')](respondWithStatusCode(_0x23a138,null))['catch'](handleError(_0x23a138,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 6dc8b5d..80d3dfc 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 _0xf255=['bluebird','request-promise','path','rimraf','../../config/environment','./schedule.attributes','Schedule','tools_schedules','lodash','util','../../config/logger','api','moment'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xf255,0xcb));var _0x5f25=function(_0x52089d,_0x407abf){_0x52089d=_0x52089d-0x0;var _0x33314c=_0xf255[_0x52089d];return _0x33314c;};'use strict';var _=require(_0x5f25('0x0'));var util=require(_0x5f25('0x1'));var logger=require(_0x5f25('0x2'))(_0x5f25('0x3'));var moment=require(_0x5f25('0x4'));var BPromise=require(_0x5f25('0x5'));var rp=require(_0x5f25('0x6'));var fs=require('fs');var path=require(_0x5f25('0x7'));var rimraf=require(_0x5f25('0x8'));var config=require(_0x5f25('0x9'));var attributes=require(_0x5f25('0xa'));module['exports']=function(_0xd7c18a,_0xd8a8e8){return _0xd7c18a['define'](_0x5f25('0xb'),attributes,{'tableName':_0x5f25('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x48db=['../../config/logger','api','moment','path','rimraf','./schedule.attributes','exports','define','Schedule','tools_schedules','util'];(function(_0x457032,_0x20d111){var _0x287abd=function(_0x459dfa){while(--_0x459dfa){_0x457032['push'](_0x457032['shift']());}};_0x287abd(++_0x20d111);}(_0x48db,0x15f));var _0xb48d=function(_0x4c43b6,_0x48f8a8){_0x4c43b6=_0x4c43b6-0x0;var _0x18ca06=_0x48db[_0x4c43b6];return _0x18ca06;};'use strict';var _=require('lodash');var util=require(_0xb48d('0x0'));var logger=require(_0xb48d('0x1'))(_0xb48d('0x2'));var moment=require(_0xb48d('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb48d('0x4'));var rimraf=require(_0xb48d('0x5'));var config=require('../../config/environment');var attributes=require(_0xb48d('0x6'));module[_0xb48d('0x7')]=function(_0x14961d,_0x331497){return _0x14961d[_0xb48d('0x8')](_0xb48d('0x9'),attributes,{'tableName':_0xb48d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index e0c08d8..b6a9e9f 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 _0x0fe9=['request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x45a980,_0x3b4f78){var _0x49b3a0=function(_0x2ccced){while(--_0x2ccced){_0x45a980['push'](_0x45a980['shift']());}};_0x49b3a0(++_0x3b4f78);}(_0x0fe9,0x15f));var _0x90fe=function(_0x59d23a,_0x9693c9){_0x59d23a=_0x59d23a-0x0;var _0xfb8bee=_0x0fe9[_0x59d23a];return _0xfb8bee;};'use strict';var _=require(_0x90fe('0x0'));var util=require(_0x90fe('0x1'));var moment=require(_0x90fe('0x2'));var BPromise=require('bluebird');var rs=require(_0x90fe('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x90fe('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x90fe('0x5'));var jayson=require(_0x90fe('0x6'));var client=jayson[_0x90fe('0x7')][_0x90fe('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3aca8d,_0x469810,_0x11b6bf){return new BPromise(function(_0x19df30,_0x20ba67){return client[_0x90fe('0x9')](_0x3aca8d,_0x11b6bf)[_0x90fe('0xa')](function(_0xbedb69){logger[_0x90fe('0xb')](_0x90fe('0xc'),_0x469810,_0x90fe('0xd'));logger['debug'](_0x90fe('0xe'),_0x469810,'request\x20sent',JSON[_0x90fe('0xf')](_0xbedb69));if(_0xbedb69[_0x90fe('0x10')]){if(_0xbedb69[_0x90fe('0x10')]['code']===0x1f4){logger[_0x90fe('0x10')](_0x90fe('0xc'),_0x469810,_0xbedb69[_0x90fe('0x10')][_0x90fe('0x11')]);return _0x20ba67(_0xbedb69[_0x90fe('0x10')][_0x90fe('0x11')]);}logger[_0x90fe('0x10')](_0x90fe('0xc'),_0x469810,_0xbedb69[_0x90fe('0x10')][_0x90fe('0x11')]);return _0x19df30(_0xbedb69['error'][_0x90fe('0x11')]);}else{logger['info'](_0x90fe('0xc'),_0x469810,'request\x20sent');_0x19df30(_0xbedb69[_0x90fe('0x12')][_0x90fe('0x11')]);}})[_0x90fe('0x13')](function(_0x4050b6){logger[_0x90fe('0x10')]('Schedule,\x20%s,\x20%s',_0x469810,_0x4050b6);_0x20ba67(_0x4050b6);});});} \ No newline at end of file +var _0x62d8=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x29c6ef,_0x59cdaa){var _0xe9dae1=function(_0x1d6508){while(--_0x1d6508){_0x29c6ef['push'](_0x29c6ef['shift']());}};_0xe9dae1(++_0x59cdaa);}(_0x62d8,0x12c));var _0x862d=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x62d8[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x862d('0x0'));var util=require(_0x862d('0x1'));var moment=require(_0x862d('0x2'));var BPromise=require(_0x862d('0x3'));var rs=require(_0x862d('0x4'));var fs=require('fs');var Redis=require(_0x862d('0x5'));var db=require(_0x862d('0x6'))['db'];var utils=require(_0x862d('0x7'));var logger=require(_0x862d('0x8'))('rpc');var config=require(_0x862d('0x9'));var jayson=require(_0x862d('0xa'));var client=jayson[_0x862d('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4aef9f,_0x764baa,_0x2770ef){return new BPromise(function(_0x48f867,_0x5a4f96){return client[_0x862d('0xc')](_0x4aef9f,_0x2770ef)['then'](function(_0x4f8e5a){logger[_0x862d('0xd')](_0x862d('0xe'),_0x764baa,_0x862d('0xf'));logger[_0x862d('0x10')]('Schedule,\x20%s,\x20%s,\x20%s',_0x764baa,_0x862d('0xf'),JSON[_0x862d('0x11')](_0x4f8e5a));if(_0x4f8e5a[_0x862d('0x12')]){if(_0x4f8e5a[_0x862d('0x12')][_0x862d('0x13')]===0x1f4){logger['error'](_0x862d('0xe'),_0x764baa,_0x4f8e5a[_0x862d('0x12')]['message']);return _0x5a4f96(_0x4f8e5a[_0x862d('0x12')]['message']);}logger[_0x862d('0x12')]('Schedule,\x20%s,\x20%s',_0x764baa,_0x4f8e5a[_0x862d('0x12')][_0x862d('0x14')]);return _0x48f867(_0x4f8e5a['error']['message']);}else{logger[_0x862d('0xd')](_0x862d('0xe'),_0x764baa,_0x862d('0xf'));_0x48f867(_0x4f8e5a[_0x862d('0x15')][_0x862d('0x14')]);}})[_0x862d('0x16')](function(_0x5df498){logger[_0x862d('0x12')](_0x862d('0xe'),_0x764baa,_0x5df498);_0x5a4f96(_0x5df498);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 2ec4e0e..65edb8e 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 _0xfcfa=['exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','index','/describe','isAuthenticated','describe','/:id','show','download','put','update','delete','destroy'];(function(_0xf40252,_0x488947){var _0x1bfd48=function(_0x52961e){while(--_0x52961e){_0xf40252['push'](_0xf40252['shift']());}};_0x1bfd48(++_0x488947);}(_0xfcfa,0xe7));var _0xafcf=function(_0x4ca7ea,_0x1dc29f){_0x4ca7ea=_0x4ca7ea-0x0;var _0x4efe98=_0xfcfa[_0x4ca7ea];return _0x4efe98;};'use strict';var multer=require(_0xafcf('0x0'));var util=require(_0xafcf('0x1'));var path=require(_0xafcf('0x2'));var timeout=require('connect-timeout');var express=require(_0xafcf('0x3'));var router=express[_0xafcf('0x4')]();var fs_extra=require(_0xafcf('0x5'));var auth=require(_0xafcf('0x6'));var interaction=require(_0xafcf('0x7'));var config=require(_0xafcf('0x8'));var controller=require(_0xafcf('0x9'));router[_0xafcf('0xa')]('/',auth['isAuthenticated'](),controller[_0xafcf('0xb')]);router[_0xafcf('0xa')](_0xafcf('0xc'),auth[_0xafcf('0xd')](),controller[_0xafcf('0xe')]);router[_0xafcf('0xa')](_0xafcf('0xf'),auth[_0xafcf('0xd')](),controller[_0xafcf('0x10')]);router[_0xafcf('0xa')]('/:id/download',auth['isAuthenticated'](),controller[_0xafcf('0x11')]);router['post']('/',auth[_0xafcf('0xd')](),controller['create']);router[_0xafcf('0x12')](_0xafcf('0xf'),auth[_0xafcf('0xd')](),controller[_0xafcf('0x13')]);router[_0xafcf('0x14')](_0xafcf('0xf'),auth['isAuthenticated'](),controller[_0xafcf('0x15')]);module[_0xafcf('0x16')]=router; \ No newline at end of file +var _0xcd82=['destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/download','create','put','update'];(function(_0x5d342b,_0x243f10){var _0x3f61f5=function(_0x566a2b){while(--_0x566a2b){_0x5d342b['push'](_0x5d342b['shift']());}};_0x3f61f5(++_0x243f10);}(_0xcd82,0x178));var _0x2cd8=function(_0x2c4c89,_0x105b64){_0x2c4c89=_0x2c4c89-0x0;var _0x44d7df=_0xcd82[_0x2c4c89];return _0x44d7df;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2cd8('0x0'));var timeout=require(_0x2cd8('0x1'));var express=require(_0x2cd8('0x2'));var router=express[_0x2cd8('0x3')]();var fs_extra=require(_0x2cd8('0x4'));var auth=require(_0x2cd8('0x5'));var interaction=require(_0x2cd8('0x6'));var config=require(_0x2cd8('0x7'));var controller=require(_0x2cd8('0x8'));router['get']('/',auth[_0x2cd8('0x9')](),controller[_0x2cd8('0xa')]);router['get'](_0x2cd8('0xb'),auth[_0x2cd8('0x9')](),controller[_0x2cd8('0xc')]);router[_0x2cd8('0xd')](_0x2cd8('0xe'),auth[_0x2cd8('0x9')](),controller[_0x2cd8('0xf')]);router[_0x2cd8('0xd')](_0x2cd8('0x10'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0x2cd8('0x9')](),controller[_0x2cd8('0x11')]);router[_0x2cd8('0x12')](_0x2cd8('0xe'),auth[_0x2cd8('0x9')](),controller[_0x2cd8('0x13')]);router['delete']('/:id',auth[_0x2cd8('0x9')](),controller[_0x2cd8('0x14')]);module[_0x2cd8('0x15')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 1f6d223..0d67d82 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 _0xdef9=['startedAt','subtract','closedAt','duration','DATE','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','format','sequelize','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER'];(function(_0x5f2920,_0x12e236){var _0x42a70f=function(_0x4dd2b6){while(--_0x4dd2b6){_0x5f2920['push'](_0x5f2920['shift']());}};_0x42a70f(++_0x12e236);}(_0xdef9,0x1ed));var _0x9def=function(_0x1d0b74,_0x2b9295){_0x1d0b74=_0x1d0b74-0x0;var _0x1c18e7=_0xdef9[_0x1d0b74];return _0x1c18e7;};'use strict';var Sequelize=require(_0x9def('0x0'));var moment=require(_0x9def('0x1'));var path=require(_0x9def('0x2'));var config=require(_0x9def('0x3'));module[_0x9def('0x4')]={'format':{'type':Sequelize[_0x9def('0x5')],'get':function(){return this[_0x9def('0x6')](_0x9def('0x7'))?path[_0x9def('0x8')](this[_0x9def('0x6')](_0x9def('0x7'))):undefined;}},'interactionid':{'type':Sequelize[_0x9def('0x9')]},'channel':{'type':Sequelize[_0x9def('0x9')]},'value':{'type':Sequelize[_0x9def('0x9')],'set':function(_0x40c607){var _0x25a03e=_0x40c607[_0x9def('0xa')](/\\/g,'/');this[_0x9def('0xb')](_0x9def('0x7'),_0x25a03e);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x9def('0xc')],'set':function(_0x4f0a0d){this['setDataValue'](_0x9def('0xd'),moment()[_0x9def('0xe')](_0x4f0a0d,'ms'));this[_0x9def('0xb')](_0x9def('0xf'),moment());this['setDataValue'](_0x9def('0x10'),_0x4f0a0d);}},'startedAt':{'type':Sequelize[_0x9def('0x11')],'get':function(){return moment(this[_0x9def('0x6')](_0x9def('0xd')))['format'](_0x9def('0x12'))[_0x9def('0x13')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x9def('0x6')]('closedAt'))['format'](_0x9def('0x12'))[_0x9def('0x13')]();}},'createdAt':{'type':Sequelize[_0x9def('0x11')],'get':function(){return moment(this['getDataValue'](_0x9def('0x14')))['format']('MM-DD-YYYY\x20HH:mm')[_0x9def('0x13')]();}},'updatedAt':{'type':Sequelize[_0x9def('0x11')],'get':function(){return moment(this[_0x9def('0x6')](_0x9def('0x15')))[_0x9def('0x16')](_0x9def('0x12'))[_0x9def('0x13')]();}}}; \ No newline at end of file +var _0xb7de=['INTEGER','startedAt','subtract','DATE','format','MM-DD-YYYY\x20HH:mm','toString','closedAt','updatedAt','sequelize','moment','path','exports','VIRTUAL','getDataValue','value','extname','STRING','setDataValue'];(function(_0x322379,_0x42e9f5){var _0x11eeda=function(_0x158d4){while(--_0x158d4){_0x322379['push'](_0x322379['shift']());}};_0x11eeda(++_0x42e9f5);}(_0xb7de,0xc7));var _0xeb7d=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xb7de[_0x2b10c6];return _0x3789d2;};'use strict';var Sequelize=require(_0xeb7d('0x0'));var moment=require(_0xeb7d('0x1'));var path=require(_0xeb7d('0x2'));var config=require('../../config/environment');module[_0xeb7d('0x3')]={'format':{'type':Sequelize[_0xeb7d('0x4')],'get':function(){return this[_0xeb7d('0x5')](_0xeb7d('0x6'))?path[_0xeb7d('0x7')](this['getDataValue'](_0xeb7d('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0xeb7d('0x8')]},'channel':{'type':Sequelize[_0xeb7d('0x8')]},'value':{'type':Sequelize[_0xeb7d('0x8')],'set':function(_0xc8bd99){var _0x593170=_0xc8bd99['replace'](/\\/g,'/');this[_0xeb7d('0x9')](_0xeb7d('0x6'),_0x593170);}},'rating':{'type':Sequelize[_0xeb7d('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xeb7d('0xa')],'set':function(_0x4a880a){this[_0xeb7d('0x9')](_0xeb7d('0xb'),moment()[_0xeb7d('0xc')](_0x4a880a,'ms'));this['setDataValue']('closedAt',moment());this[_0xeb7d('0x9')]('duration',_0x4a880a);}},'startedAt':{'type':Sequelize[_0xeb7d('0xd')],'get':function(){return moment(this[_0xeb7d('0x5')](_0xeb7d('0xb')))[_0xeb7d('0xe')](_0xeb7d('0xf'))[_0xeb7d('0x10')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xeb7d('0x5')](_0xeb7d('0x11')))[_0xeb7d('0xe')](_0xeb7d('0xf'))[_0xeb7d('0x10')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xeb7d('0x5')]('createdAt'))[_0xeb7d('0xe')](_0xeb7d('0xf'))[_0xeb7d('0x10')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0xeb7d('0x12')))[_0xeb7d('0xe')]('MM-DD-YYYY\x20HH:mm')['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 617602c..178f3a3 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 _0xeec6=['options','includeAll','include','findAll','rows','catch','show','params','keys','length','create','body','duration','createdAt','value','describe','../../components/encryptor','uniqueid','find','join','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','recording','root','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','download','message','Not\x20found','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','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','map','ScreenRecording','rawAttributes','fieldName','type','model','format','filters','intersection','query','attributes','fields','nolimit','order','sort','where','pick','filter','merge'];(function(_0x4c8833,_0x14e755){var _0x30df54=function(_0x197811){while(--_0x197811){_0x4c8833['push'](_0x4c8833['shift']());}};_0x30df54(++_0x14e755);}(_0xeec6,0x1c2));var _0x6eec=function(_0x57486e,_0x32283b){_0x57486e=_0x57486e-0x0;var _0x5f110b=_0xeec6[_0x57486e];return _0x5f110b;};'use strict';var emlformat=require(_0x6eec('0x0'));var rimraf=require(_0x6eec('0x1'));var zipdir=require(_0x6eec('0x2'));var jsonpatch=require(_0x6eec('0x3'));var rp=require('request-promise');var moment=require(_0x6eec('0x4'));var BPromise=require(_0x6eec('0x5'));var Mustache=require(_0x6eec('0x6'));var util=require(_0x6eec('0x7'));var path=require(_0x6eec('0x8'));var sox=require(_0x6eec('0x9'));var csv=require('to-csv');var ejs=require(_0x6eec('0xa'));var fs=require('fs');var fs_extra=require(_0x6eec('0xb'));var _=require('lodash');var squel=require(_0x6eec('0xc'));var crypto=require(_0x6eec('0xd'));var jsforce=require(_0x6eec('0xe'));var deskjs=require(_0x6eec('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6eec('0x10'));var Papa=require(_0x6eec('0x11'));var Redis=require(_0x6eec('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6eec('0x13'));var logger=require(_0x6eec('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x6eec('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6eec('0x16'))['db'];function respondWithStatusCode(_0x3387c2,_0x162db1){_0x162db1=_0x162db1||0xcc;return function(_0x3fe94b){if(_0x3fe94b){return _0x3387c2[_0x6eec('0x17')](_0x162db1);}return _0x3387c2['status'](_0x162db1)[_0x6eec('0x18')]();};}function respondWithResult(_0x3b2972,_0x462dbb){_0x462dbb=_0x462dbb||0xc8;return function(_0xc35914){if(_0xc35914){return _0x3b2972[_0x6eec('0x19')](_0x462dbb)[_0x6eec('0x1a')](_0xc35914);}};}function respondWithFilteredResult(_0x345852,_0x393271){return function(_0x34a7fc){if(_0x34a7fc){var _0x2ac797=typeof _0x393271['offset']===_0x6eec('0x1b')&&typeof _0x393271['limit']===_0x6eec('0x1b');var _0x45aa3f=_0x34a7fc['count'];var _0x3ee353=_0x2ac797?0x0:_0x393271[_0x6eec('0x1c')];var _0xb1eab7=_0x2ac797?_0x34a7fc['count']:_0x393271[_0x6eec('0x1c')]+_0x393271[_0x6eec('0x1d')];var _0x3c7152;if(_0xb1eab7>=_0x45aa3f){_0xb1eab7=_0x45aa3f;_0x3c7152=0xc8;}else{_0x3c7152=0xce;}_0x345852[_0x6eec('0x19')](_0x3c7152);return _0x345852[_0x6eec('0x1e')](_0x6eec('0x1f'),_0x3ee353+'-'+_0xb1eab7+'/'+_0x45aa3f)['json'](_0x34a7fc);}return null;};}function patchUpdates(_0x328693){return function(_0x2f843e){try{jsonpatch[_0x6eec('0x20')](_0x2f843e,_0x328693,!![]);}catch(_0x34522a){return BPromise[_0x6eec('0x21')](_0x34522a);}return _0x2f843e[_0x6eec('0x22')]();};}function saveUpdates(_0x52f941,_0x6e40b3){return function(_0x852d08){if(_0x852d08){return _0x852d08[_0x6eec('0x23')](_0x52f941)[_0x6eec('0x24')](function(_0x409b26){return _0x409b26;});}return null;};}function removeEntity(_0x13863c,_0x573249){return function(_0x384586){if(_0x384586){return _0x384586[_0x6eec('0x25')]()[_0x6eec('0x24')](function(){_0x13863c[_0x6eec('0x19')](0xcc)[_0x6eec('0x18')]();});}};}function handleEntityNotFound(_0x1f386c,_0x29879c){return function(_0x20bed3){if(!_0x20bed3){_0x1f386c[_0x6eec('0x17')](0x194);}return _0x20bed3;};}function handleError(_0x58f95c,_0x1d750c){_0x1d750c=_0x1d750c||0x1f4;return function(_0x44b31c){logger[_0x6eec('0x26')](_0x44b31c[_0x6eec('0x27')]);if(_0x44b31c['name']){delete _0x44b31c[_0x6eec('0x28')];}_0x58f95c[_0x6eec('0x19')](_0x1d750c)['send'](_0x44b31c);};}exports['index']=function(_0x3240c3,_0x47ed95){var _0x20a130={},_0xede270={},_0x3bbdf8={'count':0x0,'rows':[]};var _0x34bdea=_[_0x6eec('0x29')](db[_0x6eec('0x2a')][_0x6eec('0x2b')],function(_0x33e4a1){return{'name':_0x33e4a1[_0x6eec('0x2c')],'type':_0x33e4a1[_0x6eec('0x2d')]['key']};});_0xede270[_0x6eec('0x2e')]=_['differenceBy'](_[_0x6eec('0x29')](_0x34bdea,_0x6eec('0x28')),[_0x6eec('0x2f')]);_0xede270['query']=_['keys'](_0x3240c3['query']);_0xede270[_0x6eec('0x30')]=_[_0x6eec('0x31')](_0xede270[_0x6eec('0x2e')],_0xede270[_0x6eec('0x32')]);_0x20a130[_0x6eec('0x33')]=_[_0x6eec('0x31')](_0xede270[_0x6eec('0x2e')],qs[_0x6eec('0x34')](_0x3240c3[_0x6eec('0x32')][_0x6eec('0x34')]));_0x20a130[_0x6eec('0x33')]=_0x20a130[_0x6eec('0x33')]['length']?_0x20a130[_0x6eec('0x33')]:_0xede270[_0x6eec('0x2e')];if(!_0x3240c3[_0x6eec('0x32')]['hasOwnProperty'](_0x6eec('0x35'))){_0x20a130[_0x6eec('0x1d')]=qs[_0x6eec('0x1d')](_0x3240c3[_0x6eec('0x32')][_0x6eec('0x1d')]);_0x20a130[_0x6eec('0x1c')]=qs['offset'](_0x3240c3[_0x6eec('0x32')][_0x6eec('0x1c')]);}_0x20a130[_0x6eec('0x36')]=qs['sort'](_0x3240c3['query'][_0x6eec('0x37')]);_0x20a130[_0x6eec('0x38')]=qs[_0x6eec('0x30')](_[_0x6eec('0x39')](_0x3240c3[_0x6eec('0x32')],_0xede270['filters']),_0x34bdea);if(_0x3240c3[_0x6eec('0x32')][_0x6eec('0x3a')]){_0x20a130[_0x6eec('0x38')]=_[_0x6eec('0x3b')](_0x20a130[_0x6eec('0x38')],{'$or':_[_0x6eec('0x29')](_0x34bdea,function(_0x36cfe1){if(_0x36cfe1[_0x6eec('0x2d')]!=='VIRTUAL'){var _0x2f7a75={};_0x2f7a75[_0x36cfe1[_0x6eec('0x28')]]={'$like':'%'+_0x3240c3['query']['filter']+'%'};return _0x2f7a75;}})});}_0x20a130=_[_0x6eec('0x3b')]({},_0x20a130,_0x3240c3[_0x6eec('0x3c')]);var _0xf056e0={'where':_0x20a130[_0x6eec('0x38')]};return db['ScreenRecording']['count'](_0xf056e0)[_0x6eec('0x24')](function(_0x48fbf6){_0x3bbdf8['count']=_0x48fbf6;if(_0x3240c3[_0x6eec('0x32')][_0x6eec('0x3d')]){_0x20a130[_0x6eec('0x3e')]=[{'all':!![]}];}return db[_0x6eec('0x2a')][_0x6eec('0x3f')](_0x20a130);})['then'](function(_0x931bcf){_0x3bbdf8[_0x6eec('0x40')]=_0x931bcf;return _0x3bbdf8;})['then'](respondWithFilteredResult(_0x47ed95,_0x20a130))[_0x6eec('0x41')](handleError(_0x47ed95,null));};exports[_0x6eec('0x42')]=function(_0x5028a2,_0x2d39bf){var _0x44d75d={'raw':![],'where':{'id':_0x5028a2[_0x6eec('0x43')]['id']}},_0x4e3b1e={};_0x4e3b1e[_0x6eec('0x2e')]=_[_0x6eec('0x44')](db[_0x6eec('0x2a')]['rawAttributes']);_0x4e3b1e[_0x6eec('0x32')]=_[_0x6eec('0x44')](_0x5028a2[_0x6eec('0x32')]);_0x4e3b1e[_0x6eec('0x30')]=_[_0x6eec('0x31')](_0x4e3b1e['model'],_0x4e3b1e['query']);_0x44d75d[_0x6eec('0x33')]=_[_0x6eec('0x31')](_0x4e3b1e[_0x6eec('0x2e')],qs[_0x6eec('0x34')](_0x5028a2[_0x6eec('0x32')]['fields']));_0x44d75d[_0x6eec('0x33')]=_0x44d75d['attributes'][_0x6eec('0x45')]?_0x44d75d[_0x6eec('0x33')]:_0x4e3b1e[_0x6eec('0x2e')];if(_0x5028a2['query'][_0x6eec('0x3d')]){_0x44d75d[_0x6eec('0x3e')]=[{'all':!![]}];}_0x44d75d=_[_0x6eec('0x3b')]({},_0x44d75d,_0x5028a2[_0x6eec('0x3c')]);return db[_0x6eec('0x2a')]['find'](_0x44d75d)[_0x6eec('0x24')](handleEntityNotFound(_0x2d39bf,null))['then'](respondWithResult(_0x2d39bf,null))['catch'](handleError(_0x2d39bf,null));};exports[_0x6eec('0x46')]=function(_0x535d96,_0x245a1b){return db[_0x6eec('0x2a')][_0x6eec('0x46')](_0x535d96['body'],{})['then'](respondWithResult(_0x245a1b,0xc9))[_0x6eec('0x41')](handleError(_0x245a1b,null));};exports[_0x6eec('0x23')]=function(_0x1d6626,_0x2d0fc0){if(_0x1d6626[_0x6eec('0x47')]['id']){delete _0x1d6626[_0x6eec('0x47')]['id'];}delete _0x1d6626[_0x6eec('0x47')][_0x6eec('0x48')];delete _0x1d6626[_0x6eec('0x47')][_0x6eec('0x49')];delete _0x1d6626['body']['closedAt'];delete _0x1d6626[_0x6eec('0x47')][_0x6eec('0x4a')];return db[_0x6eec('0x2a')]['find']({'where':{'id':_0x1d6626[_0x6eec('0x43')]['id']}})[_0x6eec('0x24')](handleEntityNotFound(_0x2d0fc0,null))[_0x6eec('0x24')](saveUpdates(_0x1d6626[_0x6eec('0x47')],null))[_0x6eec('0x24')](respondWithResult(_0x2d0fc0,null))[_0x6eec('0x41')](handleError(_0x2d0fc0,null));};exports[_0x6eec('0x4b')]=function(_0x413de9,_0x5a6e05){return db[_0x6eec('0x2a')][_0x6eec('0x4b')]()[_0x6eec('0x24')](respondWithResult(_0x5a6e05,null))[_0x6eec('0x41')](handleError(_0x5a6e05,null));};exports['download']=function(_0x51fd37,_0x50436d,_0x36c49b){var _0x32b289=require(_0x6eec('0x4c'));var _0x1de626=![];var _0x5178f5={};if(_0x51fd37['query'][_0x6eec('0x2d')]&&_0x51fd37[_0x6eec('0x32')][_0x6eec('0x2d')]==='uniqueid'){_0x5178f5[_0x6eec('0x4d')]=_0x51fd37[_0x6eec('0x43')]['id'];}else{_0x5178f5['id']=_0x51fd37[_0x6eec('0x43')]['id'];}return db[_0x6eec('0x2a')][_0x6eec('0x4e')]({'where':_0x5178f5,'attributes':['id',_0x6eec('0x4a')],'raw':!![]})[_0x6eec('0x24')](handleEntityNotFound(_0x50436d,null))[_0x6eec('0x24')](function(_0x45fed3){if(_0x45fed3){var _0x4e921a=path[_0x6eec('0x4f')](config['root'],_0x6eec('0x50'),_0x45fed3[_0x6eec('0x4a')]);var _0x424962=util[_0x6eec('0x2f')](_0x6eec('0x51'),_0x4e921a);if(fs[_0x6eec('0x52')](_0x424962)){_0x1de626=!![];return _0x32b289[_0x6eec('0x53')](_0x424962,_0x4e921a,config['secrets'][_0x6eec('0x54')])['then'](function(){return _0x45fed3;});}return _0x45fed3;}})[_0x6eec('0x24')](function(_0x5c905f){if(_0x5c905f){var _0x237324=path[_0x6eec('0x4f')](config[_0x6eec('0x55')],_0x6eec('0x50'),_0x5c905f[_0x6eec('0x4a')]);if(!fs[_0x6eec('0x52')](_0x237324)){throw new db[(_0x6eec('0x56'))][(_0x6eec('0x57'))](_0x6eec('0x58'));}if(_0x5c905f[_0x6eec('0x59')]){return _0x50436d['download'](_0x237324,_0x5c905f['filename']+path[_0x6eec('0x5a')](_0x237324),function(){if(_0x1de626){fs[_0x6eec('0x5b')](_0x237324);}});}else{return _0x50436d[_0x6eec('0x5c')](_0x237324,function(_0x2c0644){if(_0x1de626){fs[_0x6eec('0x5b')](_0x237324);}});}}})['catch'](function(_0x1d8fb1){if(_0x1d8fb1[_0x6eec('0x5d')]==='ScreenRecording\x20not\x20found'){_0x50436d['status'](0x194)['send'](_0x6eec('0x5e'));}else{return handleError(_0x50436d,null);}});};exports[_0x6eec('0x25')]=function(_0x4cf859,_0x1d2baf){return db[_0x6eec('0x2a')]['find']({'where':{'id':_0x4cf859[_0x6eec('0x43')]['id']}})[_0x6eec('0x24')](function(_0xc852b3){if(_[_0x6eec('0x5f')](_0xc852b3)){throw new ReferenceError('Entity\x20not\x20found');}return _0xc852b3;})['then'](function(_0x54fcd0){var _0x1230fc=path[_0x6eec('0x4f')](config[_0x6eec('0x55')],_0x6eec('0x50'),_0x54fcd0[_0x6eec('0x4a')]);logger[_0x6eec('0x60')](_0x6eec('0x61'),_0x1230fc);if(!_[_0x6eec('0x5f')](_0x54fcd0[_0x6eec('0x4a')])&&fs[_0x6eec('0x52')](_0x1230fc)){logger[_0x6eec('0x60')](_0x6eec('0x62')+_0x1230fc+_0x6eec('0x63'));fs[_0x6eec('0x64')](_0x1230fc);}_0x1230fc=_0x1230fc+_0x6eec('0x65');if(!_[_0x6eec('0x5f')](_0x54fcd0['value'])&&fs[_0x6eec('0x52')](_0x1230fc)){logger[_0x6eec('0x60')]('File:\x20\x22'+_0x1230fc+_0x6eec('0x63'));fs[_0x6eec('0x64')](_0x1230fc);}return _0x54fcd0;})['then'](function(_0x7dd727){if(!_0x7dd727)throw new InternalError();return _0x7dd727[_0x6eec('0x25')]();})[_0x6eec('0x24')](function(){_0x1d2baf[_0x6eec('0x19')](0xcc)['end']();})[_0x6eec('0x41')](handleError(_0x1d2baf,null));}; \ No newline at end of file +var _0xbd50=['unlinkSync','.cypher','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','error','stack','name','send','index','map','rawAttributes','type','key','model','differenceBy','format','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','ScreenRecording','includeAll','findAll','rows','catch','params','include','find','create','body','update','duration','value','describe','../../components/encryptor','uniqueid','join','root','%s.cypher','existsSync','decryptFile','recording','server/files/screen_recordings','ValidationError','filename','extname','download','unlink','message','destroy','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione'];(function(_0x86ee00,_0x384a9d){var _0x41a66b=function(_0x2cc226){while(--_0x2cc226){_0x86ee00['push'](_0x86ee00['shift']());}};_0x41a66b(++_0x384a9d);}(_0xbd50,0x196));var _0x0bd5=function(_0x58b0cf,_0x23887d){_0x58b0cf=_0x58b0cf-0x0;var _0x449e1e=_0xbd50[_0x58b0cf];return _0x449e1e;};'use strict';var emlformat=require(_0x0bd5('0x0'));var rimraf=require(_0x0bd5('0x1'));var zipdir=require(_0x0bd5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0bd5('0x3'));var moment=require(_0x0bd5('0x4'));var BPromise=require(_0x0bd5('0x5'));var Mustache=require(_0x0bd5('0x6'));var util=require(_0x0bd5('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0bd5('0x8'));var fs=require('fs');var fs_extra=require(_0x0bd5('0x9'));var _=require(_0x0bd5('0xa'));var squel=require(_0x0bd5('0xb'));var crypto=require(_0x0bd5('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0bd5('0xd'));var querystring=require(_0x0bd5('0xe'));var Papa=require(_0x0bd5('0xf'));var Redis=require('ioredis');var authService=require(_0x0bd5('0x10'));var qs=require(_0x0bd5('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0bd5('0x12'));var logger=require(_0x0bd5('0x13'))('api');var utils=require(_0x0bd5('0x14'));var config=require(_0x0bd5('0x15'));var licenseUtil=require(_0x0bd5('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f7a0c,_0x23982f){_0x23982f=_0x23982f||0xcc;return function(_0x2f9588){if(_0x2f9588){return _0x2f7a0c[_0x0bd5('0x17')](_0x23982f);}return _0x2f7a0c[_0x0bd5('0x18')](_0x23982f)[_0x0bd5('0x19')]();};}function respondWithResult(_0x30765e,_0x1e961d){_0x1e961d=_0x1e961d||0xc8;return function(_0x4f485b){if(_0x4f485b){return _0x30765e[_0x0bd5('0x18')](_0x1e961d)[_0x0bd5('0x1a')](_0x4f485b);}};}function respondWithFilteredResult(_0x574315,_0x31349f){return function(_0x23ef4e){if(_0x23ef4e){var _0x3a34e4=typeof _0x31349f[_0x0bd5('0x1b')]==='undefined'&&typeof _0x31349f[_0x0bd5('0x1c')]===_0x0bd5('0x1d');var _0xa890be=_0x23ef4e[_0x0bd5('0x1e')];var _0x833c14=_0x3a34e4?0x0:_0x31349f[_0x0bd5('0x1b')];var _0xc58e12=_0x3a34e4?_0x23ef4e[_0x0bd5('0x1e')]:_0x31349f[_0x0bd5('0x1b')]+_0x31349f[_0x0bd5('0x1c')];var _0x27bc1e;if(_0xc58e12>=_0xa890be){_0xc58e12=_0xa890be;_0x27bc1e=0xc8;}else{_0x27bc1e=0xce;}_0x574315[_0x0bd5('0x18')](_0x27bc1e);return _0x574315[_0x0bd5('0x1f')](_0x0bd5('0x20'),_0x833c14+'-'+_0xc58e12+'/'+_0xa890be)['json'](_0x23ef4e);}return null;};}function patchUpdates(_0x5ba943){return function(_0x596b6a){try{jsonpatch['apply'](_0x596b6a,_0x5ba943,!![]);}catch(_0x47d74a){return BPromise[_0x0bd5('0x21')](_0x47d74a);}return _0x596b6a[_0x0bd5('0x22')]();};}function saveUpdates(_0x13ce46,_0x4a6910){return function(_0x6ee1a8){if(_0x6ee1a8){return _0x6ee1a8['update'](_0x13ce46)[_0x0bd5('0x23')](function(_0x3b235b){return _0x3b235b;});}return null;};}function removeEntity(_0x38c21d,_0x5a8139){return function(_0x5b6dde){if(_0x5b6dde){return _0x5b6dde['destroy']()['then'](function(){_0x38c21d[_0x0bd5('0x18')](0xcc)[_0x0bd5('0x19')]();});}};}function handleEntityNotFound(_0x184db3,_0x4fde84){return function(_0x42428c){if(!_0x42428c){_0x184db3['sendStatus'](0x194);}return _0x42428c;};}function handleError(_0x456e87,_0x3ffb08){_0x3ffb08=_0x3ffb08||0x1f4;return function(_0x18cec3){logger[_0x0bd5('0x24')](_0x18cec3[_0x0bd5('0x25')]);if(_0x18cec3[_0x0bd5('0x26')]){delete _0x18cec3[_0x0bd5('0x26')];}_0x456e87[_0x0bd5('0x18')](_0x3ffb08)[_0x0bd5('0x27')](_0x18cec3);};}exports[_0x0bd5('0x28')]=function(_0x15561b,_0xcbfc51){var _0x2e10ce={},_0x2704ee={},_0x5e5a33={'count':0x0,'rows':[]};var _0x461ae3=_[_0x0bd5('0x29')](db['ScreenRecording'][_0x0bd5('0x2a')],function(_0x8eccc9){return{'name':_0x8eccc9['fieldName'],'type':_0x8eccc9[_0x0bd5('0x2b')][_0x0bd5('0x2c')]};});_0x2704ee[_0x0bd5('0x2d')]=_[_0x0bd5('0x2e')](_['map'](_0x461ae3,_0x0bd5('0x26')),[_0x0bd5('0x2f')]);_0x2704ee[_0x0bd5('0x30')]=_[_0x0bd5('0x31')](_0x15561b[_0x0bd5('0x30')]);_0x2704ee[_0x0bd5('0x32')]=_['intersection'](_0x2704ee[_0x0bd5('0x2d')],_0x2704ee['query']);_0x2e10ce[_0x0bd5('0x33')]=_[_0x0bd5('0x34')](_0x2704ee[_0x0bd5('0x2d')],qs[_0x0bd5('0x35')](_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x35')]));_0x2e10ce[_0x0bd5('0x33')]=_0x2e10ce[_0x0bd5('0x33')][_0x0bd5('0x36')]?_0x2e10ce[_0x0bd5('0x33')]:_0x2704ee[_0x0bd5('0x2d')];if(!_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x37')]('nolimit')){_0x2e10ce[_0x0bd5('0x1c')]=qs[_0x0bd5('0x1c')](_0x15561b['query']['limit']);_0x2e10ce[_0x0bd5('0x1b')]=qs[_0x0bd5('0x1b')](_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x1b')]);}_0x2e10ce[_0x0bd5('0x38')]=qs[_0x0bd5('0x39')](_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x39')]);_0x2e10ce[_0x0bd5('0x3a')]=qs[_0x0bd5('0x32')](_[_0x0bd5('0x3b')](_0x15561b[_0x0bd5('0x30')],_0x2704ee[_0x0bd5('0x32')]),_0x461ae3);if(_0x15561b['query'][_0x0bd5('0x3c')]){_0x2e10ce['where']=_[_0x0bd5('0x3d')](_0x2e10ce[_0x0bd5('0x3a')],{'$or':_[_0x0bd5('0x29')](_0x461ae3,function(_0x1fcc49){if(_0x1fcc49[_0x0bd5('0x2b')]!==_0x0bd5('0x3e')){var _0x53a682={};_0x53a682[_0x1fcc49[_0x0bd5('0x26')]]={'$like':'%'+_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x3c')]+'%'};return _0x53a682;}})});}_0x2e10ce=_[_0x0bd5('0x3d')]({},_0x2e10ce,_0x15561b[_0x0bd5('0x3f')]);var _0x493089={'where':_0x2e10ce[_0x0bd5('0x3a')]};return db[_0x0bd5('0x40')][_0x0bd5('0x1e')](_0x493089)['then'](function(_0x177aa3){_0x5e5a33['count']=_0x177aa3;if(_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x41')]){_0x2e10ce['include']=[{'all':!![]}];}return db[_0x0bd5('0x40')][_0x0bd5('0x42')](_0x2e10ce);})[_0x0bd5('0x23')](function(_0x3ec4b0){_0x5e5a33[_0x0bd5('0x43')]=_0x3ec4b0;return _0x5e5a33;})[_0x0bd5('0x23')](respondWithFilteredResult(_0xcbfc51,_0x2e10ce))[_0x0bd5('0x44')](handleError(_0xcbfc51,null));};exports['show']=function(_0x4d3ca5,_0x994f24){var _0x545b63={'raw':![],'where':{'id':_0x4d3ca5[_0x0bd5('0x45')]['id']}},_0x5dd42b={};_0x5dd42b[_0x0bd5('0x2d')]=_['keys'](db['ScreenRecording']['rawAttributes']);_0x5dd42b[_0x0bd5('0x30')]=_['keys'](_0x4d3ca5['query']);_0x5dd42b[_0x0bd5('0x32')]=_[_0x0bd5('0x34')](_0x5dd42b['model'],_0x5dd42b['query']);_0x545b63[_0x0bd5('0x33')]=_[_0x0bd5('0x34')](_0x5dd42b[_0x0bd5('0x2d')],qs[_0x0bd5('0x35')](_0x4d3ca5['query'][_0x0bd5('0x35')]));_0x545b63[_0x0bd5('0x33')]=_0x545b63[_0x0bd5('0x33')][_0x0bd5('0x36')]?_0x545b63[_0x0bd5('0x33')]:_0x5dd42b[_0x0bd5('0x2d')];if(_0x4d3ca5['query'][_0x0bd5('0x41')]){_0x545b63[_0x0bd5('0x46')]=[{'all':!![]}];}_0x545b63=_[_0x0bd5('0x3d')]({},_0x545b63,_0x4d3ca5['options']);return db[_0x0bd5('0x40')][_0x0bd5('0x47')](_0x545b63)[_0x0bd5('0x23')](handleEntityNotFound(_0x994f24,null))['then'](respondWithResult(_0x994f24,null))[_0x0bd5('0x44')](handleError(_0x994f24,null));};exports[_0x0bd5('0x48')]=function(_0x54cd78,_0x18c7c7){return db[_0x0bd5('0x40')]['create'](_0x54cd78[_0x0bd5('0x49')],{})[_0x0bd5('0x23')](respondWithResult(_0x18c7c7,0xc9))['catch'](handleError(_0x18c7c7,null));};exports[_0x0bd5('0x4a')]=function(_0x20960a,_0x146bdc){if(_0x20960a[_0x0bd5('0x49')]['id']){delete _0x20960a[_0x0bd5('0x49')]['id'];}delete _0x20960a['body'][_0x0bd5('0x4b')];delete _0x20960a[_0x0bd5('0x49')]['createdAt'];delete _0x20960a[_0x0bd5('0x49')]['closedAt'];delete _0x20960a[_0x0bd5('0x49')][_0x0bd5('0x4c')];return db[_0x0bd5('0x40')][_0x0bd5('0x47')]({'where':{'id':_0x20960a['params']['id']}})[_0x0bd5('0x23')](handleEntityNotFound(_0x146bdc,null))['then'](saveUpdates(_0x20960a['body'],null))[_0x0bd5('0x23')](respondWithResult(_0x146bdc,null))[_0x0bd5('0x44')](handleError(_0x146bdc,null));};exports[_0x0bd5('0x4d')]=function(_0x4c9a79,_0x424187){return db['ScreenRecording'][_0x0bd5('0x4d')]()[_0x0bd5('0x23')](respondWithResult(_0x424187,null))[_0x0bd5('0x44')](handleError(_0x424187,null));};exports['download']=function(_0x512fe3,_0x4f0467,_0x122f84){var _0x21db5d=require(_0x0bd5('0x4e'));var _0x5b06c6=![];var _0x2b174a={};if(_0x512fe3[_0x0bd5('0x30')]['type']&&_0x512fe3[_0x0bd5('0x30')]['type']==='uniqueid'){_0x2b174a[_0x0bd5('0x4f')]=_0x512fe3[_0x0bd5('0x45')]['id'];}else{_0x2b174a['id']=_0x512fe3[_0x0bd5('0x45')]['id'];}return db[_0x0bd5('0x40')]['find']({'where':_0x2b174a,'attributes':['id',_0x0bd5('0x4c')],'raw':!![]})[_0x0bd5('0x23')](handleEntityNotFound(_0x4f0467,null))[_0x0bd5('0x23')](function(_0x5cf2f2){if(_0x5cf2f2){var _0x504e46=path[_0x0bd5('0x50')](config[_0x0bd5('0x51')],'server/files/screen_recordings',_0x5cf2f2['value']);var _0x2b11e8=util['format'](_0x0bd5('0x52'),_0x504e46);if(fs[_0x0bd5('0x53')](_0x2b11e8)){_0x5b06c6=!![];return _0x21db5d[_0x0bd5('0x54')](_0x2b11e8,_0x504e46,config['secrets'][_0x0bd5('0x55')])[_0x0bd5('0x23')](function(){return _0x5cf2f2;});}return _0x5cf2f2;}})[_0x0bd5('0x23')](function(_0x38aae5){if(_0x38aae5){var _0x5e93fa=path[_0x0bd5('0x50')](config[_0x0bd5('0x51')],_0x0bd5('0x56'),_0x38aae5[_0x0bd5('0x4c')]);if(!fs[_0x0bd5('0x53')](_0x5e93fa)){throw new db['Sequelize'][(_0x0bd5('0x57'))]('ScreenRecording\x20not\x20found');}if(_0x38aae5[_0x0bd5('0x58')]){return _0x4f0467['download'](_0x5e93fa,_0x38aae5['filename']+path[_0x0bd5('0x59')](_0x5e93fa),function(){if(_0x5b06c6){fs['unlink'](_0x5e93fa);}});}else{return _0x4f0467[_0x0bd5('0x5a')](_0x5e93fa,function(_0x3087de){if(_0x5b06c6){fs[_0x0bd5('0x5b')](_0x5e93fa);}});}}})['catch'](function(_0x4f7e86){if(_0x4f7e86[_0x0bd5('0x5c')]==='ScreenRecording\x20not\x20found'){_0x4f0467[_0x0bd5('0x18')](0x194)[_0x0bd5('0x27')]('Not\x20found');}else{return handleError(_0x4f0467,null);}});};exports[_0x0bd5('0x5d')]=function(_0x5a38b1,_0x45ccf5){return db[_0x0bd5('0x40')][_0x0bd5('0x47')]({'where':{'id':_0x5a38b1[_0x0bd5('0x45')]['id']}})[_0x0bd5('0x23')](function(_0x467488){if(_[_0x0bd5('0x5e')](_0x467488)){throw new ReferenceError('Entity\x20not\x20found');}return _0x467488;})[_0x0bd5('0x23')](function(_0x1e5e7d){var _0x33c5eb=path['join'](config['root'],_0x0bd5('0x56'),_0x1e5e7d[_0x0bd5('0x4c')]);logger[_0x0bd5('0x5f')](_0x0bd5('0x60'),_0x33c5eb);if(!_[_0x0bd5('0x5e')](_0x1e5e7d[_0x0bd5('0x4c')])&&fs[_0x0bd5('0x53')](_0x33c5eb)){logger[_0x0bd5('0x5f')](_0x0bd5('0x61')+_0x33c5eb+_0x0bd5('0x62'));fs[_0x0bd5('0x63')](_0x33c5eb);}_0x33c5eb=_0x33c5eb+_0x0bd5('0x64');if(!_[_0x0bd5('0x5e')](_0x1e5e7d[_0x0bd5('0x4c')])&&fs[_0x0bd5('0x53')](_0x33c5eb)){logger[_0x0bd5('0x5f')](_0x0bd5('0x61')+_0x33c5eb+_0x0bd5('0x62'));fs['unlinkSync'](_0x33c5eb);}return _0x1e5e7d;})[_0x0bd5('0x23')](function(_0x32eaaf){if(!_0x32eaaf)throw new InternalError();return _0x32eaaf['destroy']();})[_0x0bd5('0x23')](function(){_0x45ccf5['status'](0xcc)[_0x0bd5('0x19')]();})[_0x0bd5('0x44')](handleError(_0x45ccf5,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 7b4f839..e298cbc 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 _0x4280=['exports','ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes'];(function(_0x4651ae,_0x3d2bc0){var _0x29a97c=function(_0xf05c25){while(--_0xf05c25){_0x4651ae['push'](_0x4651ae['shift']());}};_0x29a97c(++_0x3d2bc0);}(_0x4280,0x1b1));var _0x0428=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4280[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0428('0x0'));var util=require(_0x0428('0x1'));var logger=require(_0x0428('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0428('0x3'));var rp=require(_0x0428('0x4'));var fs=require('fs');var path=require(_0x0428('0x5'));var rimraf=require(_0x0428('0x6'));var config=require(_0x0428('0x7'));var attributes=require(_0x0428('0x8'));module[_0x0428('0x9')]=function(_0x197e0f,_0x372914){return _0x197e0f['define'](_0x0428('0xa'),attributes,{'tableName':_0x0428('0xb'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0x0428('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xff56=['screen_recordings','interactionid','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./screenRecording.attributes','exports','define'];(function(_0x34def0,_0x554b5b){var _0x2be1c9=function(_0x45b895){while(--_0x45b895){_0x34def0['push'](_0x34def0['shift']());}};_0x2be1c9(++_0x554b5b);}(_0xff56,0x161));var _0x6ff5=function(_0x458c9d,_0x35231a){_0x458c9d=_0x458c9d-0x0;var _0x9fff80=_0xff56[_0x458c9d];return _0x9fff80;};'use strict';var _=require(_0x6ff5('0x0'));var util=require(_0x6ff5('0x1'));var logger=require(_0x6ff5('0x2'))(_0x6ff5('0x3'));var moment=require('moment');var BPromise=require(_0x6ff5('0x4'));var rp=require(_0x6ff5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6ff5('0x6'));var config=require(_0x6ff5('0x7'));var attributes=require(_0x6ff5('0x8'));module[_0x6ff5('0x9')]=function(_0x300f98,_0x4d2682){return _0x300f98[_0x6ff5('0xa')]('ScreenRecording',attributes,{'tableName':_0x6ff5('0xb'),'paranoid':![],'indexes':[{'name':_0x6ff5('0xc'),'fields':[_0x6ff5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 1177cfc..624d1dc 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 _0x5352=['jayson/promise','http','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','ScreenRecording,\x20%s,\x20%s,\x20%s','error','code','message','result','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x39cbdd,_0x32b179){var _0x53bbe8=function(_0x4f66ef){while(--_0x4f66ef){_0x39cbdd['push'](_0x39cbdd['shift']());}};_0x53bbe8(++_0x32b179);}(_0x5352,0x77));var _0x2535=function(_0x50783d,_0x1d4c75){_0x50783d=_0x50783d-0x0;var _0x3c16bc=_0x5352[_0x50783d];return _0x3c16bc;};'use strict';var _=require('lodash');var util=require(_0x2535('0x0'));var moment=require(_0x2535('0x1'));var BPromise=require('bluebird');var rs=require(_0x2535('0x2'));var fs=require('fs');var Redis=require(_0x2535('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2535('0x4'));var logger=require(_0x2535('0x5'))(_0x2535('0x6'));var config=require('../../config/environment');var jayson=require(_0x2535('0x7'));var client=jayson['client'][_0x2535('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x19cafe,_0xb2ddc3,_0x17c642){return new BPromise(function(_0x59d5e6,_0x5264c7){return client['request'](_0x19cafe,_0x17c642)[_0x2535('0x9')](function(_0x1e1327){logger[_0x2535('0xa')](_0x2535('0xb'),_0xb2ddc3,_0x2535('0xc'));logger['debug'](_0x2535('0xd'),_0xb2ddc3,_0x2535('0xc'),JSON['stringify'](_0x1e1327));if(_0x1e1327['error']){if(_0x1e1327[_0x2535('0xe')][_0x2535('0xf')]===0x1f4){logger[_0x2535('0xe')](_0x2535('0xb'),_0xb2ddc3,_0x1e1327['error'][_0x2535('0x10')]);return _0x5264c7(_0x1e1327[_0x2535('0xe')][_0x2535('0x10')]);}logger[_0x2535('0xe')](_0x2535('0xb'),_0xb2ddc3,_0x1e1327[_0x2535('0xe')]['message']);return _0x59d5e6(_0x1e1327[_0x2535('0xe')][_0x2535('0x10')]);}else{logger[_0x2535('0xa')]('ScreenRecording,\x20%s,\x20%s',_0xb2ddc3,_0x2535('0xc'));_0x59d5e6(_0x1e1327[_0x2535('0x11')]['message']);}})['catch'](function(_0x160475){logger[_0x2535('0xe')]('ScreenRecording,\x20%s,\x20%s',_0xb2ddc3,_0x160475);_0x5264c7(_0x160475);});});} \ No newline at end of file +var _0xf041=['code','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','info','ScreenRecording,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x12b122,_0x5ba5c4){var _0x4de756=function(_0x39b43d){while(--_0x39b43d){_0x12b122['push'](_0x12b122['shift']());}};_0x4de756(++_0x5ba5c4);}(_0xf041,0x123));var _0x1f04=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf041[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x1f04('0x0'));var moment=require('moment');var BPromise=require(_0x1f04('0x1'));var rs=require(_0x1f04('0x2'));var fs=require('fs');var Redis=require(_0x1f04('0x3'));var db=require(_0x1f04('0x4'))['db'];var utils=require(_0x1f04('0x5'));var logger=require(_0x1f04('0x6'))('rpc');var config=require(_0x1f04('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1f04('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xafd885,_0x10207f,_0x4e6230){return new BPromise(function(_0x122931,_0x396b62){return client['request'](_0xafd885,_0x4e6230)['then'](function(_0x3e183c){logger[_0x1f04('0x9')](_0x1f04('0xa'),_0x10207f,'request\x20sent');logger[_0x1f04('0xb')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x10207f,_0x1f04('0xc'),JSON[_0x1f04('0xd')](_0x3e183c));if(_0x3e183c[_0x1f04('0xe')]){if(_0x3e183c[_0x1f04('0xe')][_0x1f04('0xf')]===0x1f4){logger[_0x1f04('0xe')]('ScreenRecording,\x20%s,\x20%s',_0x10207f,_0x3e183c[_0x1f04('0xe')][_0x1f04('0x10')]);return _0x396b62(_0x3e183c[_0x1f04('0xe')][_0x1f04('0x10')]);}logger[_0x1f04('0xe')](_0x1f04('0xa'),_0x10207f,_0x3e183c[_0x1f04('0xe')]['message']);return _0x122931(_0x3e183c[_0x1f04('0xe')][_0x1f04('0x10')]);}else{logger[_0x1f04('0x9')]('ScreenRecording,\x20%s,\x20%s',_0x10207f,_0x1f04('0xc'));_0x122931(_0x3e183c['result'][_0x1f04('0x10')]);}})[_0x1f04('0x11')](function(_0x2f052b){logger['error'](_0x1f04('0xa'),_0x10207f,_0x2f052b);_0x396b62(_0x2f052b);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 3c9daab..783b7e4 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 _0x97a2=['addPreferred','addFavicon','put','isAuthenticated','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','index','/now','getDate','/:id','show','getLogo','/:id/logo_login','getLogoLogin','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','join','root','server/files/images/logos/','format','extname','originalname','post','single','file','diskStorage','%s%s','logologin','addLogoLogin','preferred'];(function(_0xdfafa4,_0x19684b){var _0x2ef523=function(_0x5d731a){while(--_0x5d731a){_0xdfafa4['push'](_0xdfafa4['shift']());}};_0x2ef523(++_0x19684b);}(_0x97a2,0x114));var _0x297a=function(_0x5d5c9b,_0x594dfe){_0x5d5c9b=_0x5d5c9b-0x0;var _0x407b3e=_0x97a2[_0x5d5c9b];return _0x407b3e;};'use strict';var multer=require(_0x297a('0x0'));var util=require(_0x297a('0x1'));var path=require(_0x297a('0x2'));var timeout=require(_0x297a('0x3'));var express=require(_0x297a('0x4'));var router=express[_0x297a('0x5')]();var fs_extra=require(_0x297a('0x6'));var auth=require(_0x297a('0x7'));var interaction=require(_0x297a('0x8'));var config=require(_0x297a('0x9'));var controller=require(_0x297a('0xa'));router[_0x297a('0xb')]('/',auth['isAuthenticated'](),controller[_0x297a('0xc')]);router['get'](_0x297a('0xd'),controller[_0x297a('0xe')]);router[_0x297a('0xb')](_0x297a('0xf'),controller[_0x297a('0x10')]);router[_0x297a('0xb')]('/:id/logo',controller[_0x297a('0x11')]);router[_0x297a('0xb')](_0x297a('0x12'),controller[_0x297a('0x13')]);router[_0x297a('0xb')]('/:id/gdpr',controller[_0x297a('0x14')]);router[_0x297a('0xb')](_0x297a('0x15'),controller[_0x297a('0x16')]);router[_0x297a('0xb')](_0x297a('0x17'),controller[_0x297a('0x18')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4ab419,_0x5e9bf7,_0x18d83c){_0x18d83c(null,path[_0x297a('0x19')](config[_0x297a('0x1a')],_0x297a('0x1b')));},'filename':function(_0x50dc67,_0x2bc022,_0x4024ae){_0x4024ae(null,util[_0x297a('0x1c')]('%s%s','logo',path[_0x297a('0x1d')](_0x2bc022[_0x297a('0x1e')])));}})});router[_0x297a('0x1f')]('/:id/logo',upload[_0x297a('0x20')](_0x297a('0x21')),controller['addLogo']);var upload=multer({'storage':multer[_0x297a('0x22')]({'destination':function(_0x6fcd78,_0xbad9e6,_0xd7572){_0xd7572(null,path[_0x297a('0x19')](config[_0x297a('0x1a')],'server/files/images/logos/'));},'filename':function(_0x59e2ef,_0x3bcc9b,_0x14304c){_0x14304c(null,util[_0x297a('0x1c')](_0x297a('0x23'),_0x297a('0x24'),path[_0x297a('0x1d')](_0x3bcc9b['originalname'])));}})});router[_0x297a('0x1f')](_0x297a('0x12'),upload['single']('file'),controller[_0x297a('0x25')]);var upload=multer({'storage':multer[_0x297a('0x22')]({'destination':function(_0x5f54d2,_0x11def1,_0xc74065){_0xc74065(null,path[_0x297a('0x19')](config[_0x297a('0x1a')],_0x297a('0x1b')));},'filename':function(_0xd6ee1d,_0xd68784,_0x157df0){_0x157df0(null,util[_0x297a('0x1c')](_0x297a('0x23'),_0x297a('0x26'),path[_0x297a('0x1d')](_0xd68784[_0x297a('0x1e')])));}})});router['post'](_0x297a('0x15'),upload[_0x297a('0x20')]('file'),controller[_0x297a('0x27')]);var upload=multer({'storage':multer[_0x297a('0x22')]({'destination':function(_0x2ca897,_0x18f669,_0x906810){_0x906810(null,path['join'](config['root'],_0x297a('0x1b')));},'filename':function(_0x19a38f,_0x408ebf,_0x2aa2ea){_0x2aa2ea(null,util[_0x297a('0x1c')](_0x297a('0x23'),'favicon',path[_0x297a('0x1d')](_0x408ebf[_0x297a('0x1e')])));}})});router[_0x297a('0x1f')](_0x297a('0x17'),upload[_0x297a('0x20')](_0x297a('0x21')),controller[_0x297a('0x28')]);router[_0x297a('0x29')](_0x297a('0xf'),auth[_0x297a('0x2a')](),controller[_0x297a('0x2b')]);module[_0x297a('0x2c')]=router; \ No newline at end of file +var _0x950b=['post','/:id/logo','file','format','%s%s','logologin','single','addLogoLogin','server/files/images/logos/','preferred','addPreferred','favicon','addFavicon','put','update','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','getLogo','/:id/logo_login','/:id/gdpr','gdpr','/:id/preferred','/:id/favicon','getFavicon','diskStorage','join','root','extname','originalname'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x950b,0x1aa));var _0xb950=function(_0xbc6566,_0x32d463){_0xbc6566=_0xbc6566-0x0;var _0x4ed128=_0x950b[_0xbc6566];return _0x4ed128;};'use strict';var multer=require('multer');var util=require(_0xb950('0x0'));var path=require(_0xb950('0x1'));var timeout=require(_0xb950('0x2'));var express=require(_0xb950('0x3'));var router=express[_0xb950('0x4')]();var fs_extra=require(_0xb950('0x5'));var auth=require(_0xb950('0x6'));var interaction=require(_0xb950('0x7'));var config=require(_0xb950('0x8'));var controller=require('./setting.controller');router[_0xb950('0x9')]('/',auth[_0xb950('0xa')](),controller['index']);router['get']('/now',controller['getDate']);router[_0xb950('0x9')](_0xb950('0xb'),controller[_0xb950('0xc')]);router['get']('/:id/logo',controller[_0xb950('0xd')]);router['get'](_0xb950('0xe'),controller['getLogoLogin']);router[_0xb950('0x9')](_0xb950('0xf'),controller[_0xb950('0x10')]);router[_0xb950('0x9')](_0xb950('0x11'),controller['getPreferred']);router[_0xb950('0x9')](_0xb950('0x12'),controller[_0xb950('0x13')]);var upload=multer({'storage':multer[_0xb950('0x14')]({'destination':function(_0x4524fe,_0x54cd70,_0x40e100){_0x40e100(null,path[_0xb950('0x15')](config[_0xb950('0x16')],'server/files/images/logos/'));},'filename':function(_0x1eaddd,_0x3aaa1e,_0x1b9c02){_0x1b9c02(null,util['format']('%s%s','logo',path[_0xb950('0x17')](_0x3aaa1e[_0xb950('0x18')])));}})});router[_0xb950('0x19')](_0xb950('0x1a'),upload['single'](_0xb950('0x1b')),controller['addLogo']);var upload=multer({'storage':multer[_0xb950('0x14')]({'destination':function(_0x950dce,_0x526e4d,_0x554455){_0x554455(null,path[_0xb950('0x15')](config[_0xb950('0x16')],'server/files/images/logos/'));},'filename':function(_0x1b6e0c,_0x3dd55f,_0x3fe80d){_0x3fe80d(null,util[_0xb950('0x1c')](_0xb950('0x1d'),_0xb950('0x1e'),path[_0xb950('0x17')](_0x3dd55f[_0xb950('0x18')])));}})});router[_0xb950('0x19')]('/:id/logo_login',upload[_0xb950('0x1f')](_0xb950('0x1b')),controller[_0xb950('0x20')]);var upload=multer({'storage':multer[_0xb950('0x14')]({'destination':function(_0x3cbd92,_0x325969,_0x16d49d){_0x16d49d(null,path['join'](config[_0xb950('0x16')],_0xb950('0x21')));},'filename':function(_0xb7b209,_0x105bcf,_0x510b7e){_0x510b7e(null,util[_0xb950('0x1c')](_0xb950('0x1d'),_0xb950('0x22'),path[_0xb950('0x17')](_0x105bcf[_0xb950('0x18')])));}})});router[_0xb950('0x19')](_0xb950('0x11'),upload[_0xb950('0x1f')]('file'),controller[_0xb950('0x23')]);var upload=multer({'storage':multer[_0xb950('0x14')]({'destination':function(_0x2bf312,_0x3baa13,_0x46e84c){_0x46e84c(null,path['join'](config['root'],'server/files/images/logos/'));},'filename':function(_0x572f4c,_0x492839,_0x3afe44){_0x3afe44(null,util[_0xb950('0x1c')](_0xb950('0x1d'),_0xb950('0x24'),path[_0xb950('0x17')](_0x492839[_0xb950('0x18')])));}})});router[_0xb950('0x19')]('/:id/favicon',upload[_0xb950('0x1f')](_0xb950('0x1b')),controller[_0xb950('0x25')]);router[_0xb950('0x26')]('/:id',auth[_0xb950('0xa')](),controller[_0xb950('0x27')]);module[_0xb950('0x28')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 5005747..42f0dd1 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 _0xf060=['min_mailbox','/var/opt/motion2/server/files/sounds/converted','STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize','exports','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf060,0x7f));var _0x0f06=function(_0x5a120c,_0x2265bc){_0x5a120c=_0x5a120c-0x0;var _0x59e6f0=_0xf060[_0x5a120c];return _0x59e6f0;};'use strict';var Sequelize=require(_0x0f06('0x0'));module[_0x0f06('0x1')]={'min_internal':{'type':Sequelize[_0x0f06('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0f06('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x0f06('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':_0x0f06('0x4')},'logo':{'type':Sequelize[_0x0f06('0x5')]},'defaultLogo':{'type':Sequelize[_0x0f06('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0f06('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0x0f06('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0f06('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0f06('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0f06('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x0f06('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x0f06('0x5')]},'turnaddr':{'type':Sequelize[_0x0f06('0x5')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize[_0x0f06('0x5')]},'pageTitle':{'type':Sequelize[_0x0f06('0x5')]},'defaultPageTitle':{'type':Sequelize[_0x0f06('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0f06('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0f06('0x5')],'defaultValue':_0x0f06('0x7')},'enableEmailPreview':{'type':Sequelize[_0x0f06('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x0f06('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0f06('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0f06('0x5')],'defaultValue':_0x0f06('0x8')},'chatTimeout':{'type':Sequelize[_0x0f06('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0f06('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x0f06('0x5')]},'defaultPreferred':{'type':Sequelize[_0x0f06('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0f06('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0f06('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0x0f06('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0f06('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0f06('0x5')]},'defaultFavicon':{'type':Sequelize[_0x0f06('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0f06('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0f06('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x0f06('0x2')]},'transcribeRegion':{'type':Sequelize[_0x0f06('0x5')]},'sentiment':{'type':Sequelize[_0x0f06('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x0f06('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0f06('0x2')]},'sentimentRegion':{'type':Sequelize[_0x0f06('0x5')]},'language':{'type':Sequelize[_0x0f06('0x5')]},'bucket':{'type':Sequelize[_0x0f06('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0x0f06('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0f06('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0f06('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0f06('0x2')](0x2)[_0x0f06('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0f06('0x2')](0x2)[_0x0f06('0x9')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0f06('0x2')](0x2)[_0x0f06('0x9')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)[_0x0f06('0x9')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0f06('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x0f06('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0f06('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x0f06('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x0f06('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0f06('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0f06('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0f06('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0f06('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize[_0x0f06('0x6')],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0f06('0x2')],'defaultValue':0x14},'filterFullName':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x249b=['min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize','INTEGER'];(function(_0x5d4474,_0x38fab1){var _0x33cb1b=function(_0xf22dbd){while(--_0xf22dbd){_0x5d4474['push'](_0x5d4474['shift']());}};_0x33cb1b(++_0x38fab1);}(_0x249b,0xbc));var _0xb249=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x249b[_0xefd519];return _0x4bb882;};'use strict';var Sequelize=require(_0xb249('0x0'));module['exports']={'min_internal':{'type':Sequelize[_0xb249('0x1')](0xb),'unique':_0xb249('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xb249('0x1')](0xb),'unique':_0xb249('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xb249('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xb249('0x4')],'defaultValue':_0xb249('0x5')},'logo':{'type':Sequelize[_0xb249('0x4')]},'defaultLogo':{'type':Sequelize[_0xb249('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xb249('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xb249('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xb249('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xb249('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xb249('0x4')]},'turnaddr':{'type':Sequelize[_0xb249('0x4')]},'turnusername':{'type':Sequelize[_0xb249('0x4')]},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0xb249('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0xb249('0x1')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xb249('0x4')],'defaultValue':_0xb249('0x7')},'enableEmailPreview':{'type':Sequelize[_0xb249('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0xb249('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xb249('0x1')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xb249('0x1')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xb249('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xb249('0x8')},'chatTimeout':{'type':Sequelize[_0xb249('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xb249('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0xb249('0x4')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xb249('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xb249('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0xb249('0x1')],'defaultValue':0x5},'blockDuration':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'favicon':{'type':Sequelize[_0xb249('0x4')]},'defaultFavicon':{'type':Sequelize[_0xb249('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xb249('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xb249('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0xb249('0x4')]},'sentiment':{'type':Sequelize[_0xb249('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xb249('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xb249('0x1')]},'sentimentRegion':{'type':Sequelize[_0xb249('0x4')]},'language':{'type':Sequelize[_0xb249('0x4')]},'bucket':{'type':Sequelize['STRING']},'googleSsoEnabled':{'type':Sequelize[_0xb249('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xb249('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0xb249('0x1')](0x2)[_0xb249('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0xb249('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize['INTEGER'](0x2)[_0xb249('0x9')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xb249('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xb249('0x1')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0xb249('0x1')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xb249('0x1')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xb249('0x1')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xb249('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0xb249('0x1')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize[_0xb249('0x6')],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0xb249('0x1')],'defaultValue':0x14},'filterFullName':{'type':Sequelize[_0xb249('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 231e297..6d4d080 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 _0xef39=['download','getLogoLogin','server/files/images/logos','loginLogo','defaultPreferred','defaultFavicon','default_loginLogo.svg','gdpr','securePassword','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','request','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','Setting','includeAll','include','findAll','rows','show','params','keys','rawAttributes','body','find','file','filename','logo','addLogoLogin','getLogo','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','existsSync','join','toLower','root','default_logo.svg','default','upperFirst','custom','Sequelize','ValidationError'];(function(_0x229f60,_0xa39be8){var _0xc2a01f=function(_0x5988bc){while(--_0x5988bc){_0x229f60['push'](_0x229f60['shift']());}};_0xc2a01f(++_0xa39be8);}(_0xef39,0x92));var _0x9ef3=function(_0x408c37,_0x18d655){_0x408c37=_0x408c37-0x0;var _0xf563=_0xef39[_0x408c37];return _0xf563;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9ef3('0x0'));var zipdir=require(_0x9ef3('0x1'));var jsonpatch=require(_0x9ef3('0x2'));var rp=require(_0x9ef3('0x3'));var moment=require(_0x9ef3('0x4'));var BPromise=require(_0x9ef3('0x5'));var Mustache=require(_0x9ef3('0x6'));var util=require(_0x9ef3('0x7'));var path=require(_0x9ef3('0x8'));var sox=require(_0x9ef3('0x9'));var csv=require(_0x9ef3('0xa'));var ejs=require(_0x9ef3('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9ef3('0xc'));var squel=require(_0x9ef3('0xd'));var crypto=require(_0x9ef3('0xe'));var jsforce=require(_0x9ef3('0xf'));var deskjs=require(_0x9ef3('0x10'));var toCsv=require(_0x9ef3('0xa'));var querystring=require(_0x9ef3('0x11'));var Papa=require(_0x9ef3('0x12'));var Redis=require(_0x9ef3('0x13'));var authService=require(_0x9ef3('0x14'));var qs=require(_0x9ef3('0x15'));var as=require(_0x9ef3('0x16'));var hardwareService=require(_0x9ef3('0x17'));var logger=require('../../config/logger')(_0x9ef3('0x18'));var utils=require(_0x9ef3('0x19'));var config=require(_0x9ef3('0x1a'));var licenseUtil=require(_0x9ef3('0x1b'));var db=require(_0x9ef3('0x1c'))['db'];var jayson=require(_0x9ef3('0x1d'));var client=jayson['client'][_0x9ef3('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x239082,_0x232fd6,_0x5dd6c1,_0x1c196d){return new BPromise(function(_0xa1cda6,_0x50533b){var _0x36b5b3=_0x1c196d||client;return _0x36b5b3[_0x9ef3('0x1f')](_0x239082,_0x5dd6c1)[_0x9ef3('0x20')](function(_0x236cef){logger[_0x9ef3('0x21')](_0x9ef3('0x22'),_0x232fd6,'request\x20sent');logger[_0x9ef3('0x23')](_0x9ef3('0x24'),_0x232fd6,_0x9ef3('0x25'),JSON['stringify'](_0x236cef));if(_0x236cef[_0x9ef3('0x26')]){if(_0x236cef[_0x9ef3('0x26')]['code']===0x1f4){logger['error']('Setting,\x20%s,\x20%s',_0x232fd6,_0x236cef[_0x9ef3('0x26')][_0x9ef3('0x27')]);return _0x50533b(_0x236cef['error']['message']);}logger['error'](_0x9ef3('0x22'),_0x232fd6,_0x236cef['error'][_0x9ef3('0x27')]);return _0xa1cda6(_0x236cef['error'][_0x9ef3('0x27')]);}else{logger[_0x9ef3('0x21')](_0x9ef3('0x22'),_0x232fd6,'request\x20sent');_0xa1cda6(_0x236cef[_0x9ef3('0x28')][_0x9ef3('0x27')]);}})[_0x9ef3('0x29')](function(_0x47b42b){logger[_0x9ef3('0x26')](_0x9ef3('0x22'),_0x232fd6,_0x47b42b);_0x50533b(_0x47b42b);});});}function respondWithStatusCode(_0x390cca,_0x463181){_0x463181=_0x463181||0xcc;return function(_0xecef8e){if(_0xecef8e){return _0x390cca[_0x9ef3('0x2a')](_0x463181);}return _0x390cca['status'](_0x463181)[_0x9ef3('0x2b')]();};}function respondWithResult(_0x2a6fa3,_0x14a41c){_0x14a41c=_0x14a41c||0xc8;return function(_0x540c9b){if(_0x540c9b){return _0x2a6fa3[_0x9ef3('0x2c')](_0x14a41c)[_0x9ef3('0x2d')](_0x540c9b);}};}function respondWithFilteredResult(_0x2e3f59,_0xfb2f8e){return function(_0x3802a2){if(_0x3802a2){var _0x173eb8=typeof _0xfb2f8e[_0x9ef3('0x2e')]===_0x9ef3('0x2f')&&typeof _0xfb2f8e[_0x9ef3('0x30')]===_0x9ef3('0x2f');var _0x4bd918=_0x3802a2[_0x9ef3('0x31')];var _0x5d3532=_0x173eb8?0x0:_0xfb2f8e[_0x9ef3('0x2e')];var _0x22f32a=_0x173eb8?_0x3802a2[_0x9ef3('0x31')]:_0xfb2f8e[_0x9ef3('0x2e')]+_0xfb2f8e[_0x9ef3('0x30')];var _0x2112f1;if(_0x22f32a>=_0x4bd918){_0x22f32a=_0x4bd918;_0x2112f1=0xc8;}else{_0x2112f1=0xce;}_0x2e3f59[_0x9ef3('0x2c')](_0x2112f1);return _0x2e3f59[_0x9ef3('0x32')](_0x9ef3('0x33'),_0x5d3532+'-'+_0x22f32a+'/'+_0x4bd918)[_0x9ef3('0x2d')](_0x3802a2);}return null;};}function patchUpdates(_0x490d20){return function(_0x13103){try{jsonpatch[_0x9ef3('0x34')](_0x13103,_0x490d20,!![]);}catch(_0x49a5ef){return BPromise[_0x9ef3('0x35')](_0x49a5ef);}return _0x13103[_0x9ef3('0x36')]();};}function saveUpdates(_0x310e62,_0x49fda8){return function(_0x5c4e75){if(_0x5c4e75){return _0x5c4e75[_0x9ef3('0x37')](_0x310e62)[_0x9ef3('0x20')](function(_0x3b2180){return _0x3b2180;});}return null;};}function removeEntity(_0x59f1bc,_0x32f3dc){return function(_0x4708a8){if(_0x4708a8){return _0x4708a8[_0x9ef3('0x38')]()[_0x9ef3('0x20')](function(){_0x59f1bc[_0x9ef3('0x2c')](0xcc)[_0x9ef3('0x2b')]();});}};}function handleEntityNotFound(_0x48e9e8,_0x273b7c){return function(_0x486e8b){if(!_0x486e8b){_0x48e9e8['sendStatus'](0x194);}return _0x486e8b;};}function handleError(_0x510165,_0x2c41fe){_0x2c41fe=_0x2c41fe||0x1f4;return function(_0x500479){logger[_0x9ef3('0x26')](_0x500479[_0x9ef3('0x39')]);if(_0x500479[_0x9ef3('0x3a')]){delete _0x500479[_0x9ef3('0x3a')];}_0x510165[_0x9ef3('0x2c')](_0x2c41fe)[_0x9ef3('0x3b')](_0x500479);};}exports[_0x9ef3('0x3c')]=function(_0x52a6eb,_0x5b1549){var _0x291316={},_0x348263={},_0x337d46={'count':0x0,'rows':[]};var _0x3dffeb=_[_0x9ef3('0x3d')](db['Setting']['rawAttributes'],function(_0x30203c){return{'name':_0x30203c[_0x9ef3('0x3e')],'type':_0x30203c[_0x9ef3('0x3f')][_0x9ef3('0x40')]};});_0x348263[_0x9ef3('0x41')]=_['map'](_0x3dffeb,_0x9ef3('0x3a'));_0x348263[_0x9ef3('0x42')]=_['keys'](_0x52a6eb[_0x9ef3('0x42')]);_0x348263[_0x9ef3('0x43')]=_[_0x9ef3('0x44')](_0x348263[_0x9ef3('0x41')],_0x348263[_0x9ef3('0x42')]);_0x291316[_0x9ef3('0x45')]=_['intersection'](_0x348263['model'],qs[_0x9ef3('0x46')](_0x52a6eb['query'][_0x9ef3('0x46')]));_0x291316['attributes']=_0x291316[_0x9ef3('0x45')][_0x9ef3('0x47')]?_0x291316['attributes']:_0x348263[_0x9ef3('0x41')];if(!_0x52a6eb[_0x9ef3('0x42')][_0x9ef3('0x48')](_0x9ef3('0x49'))){_0x291316['limit']=qs['limit'](_0x52a6eb['query'][_0x9ef3('0x30')]);_0x291316['offset']=qs[_0x9ef3('0x2e')](_0x52a6eb[_0x9ef3('0x42')][_0x9ef3('0x2e')]);}_0x291316['order']=qs[_0x9ef3('0x4a')](_0x52a6eb[_0x9ef3('0x42')][_0x9ef3('0x4a')]);_0x291316[_0x9ef3('0x4b')]=qs['filters'](_[_0x9ef3('0x4c')](_0x52a6eb['query'],_0x348263[_0x9ef3('0x43')]),_0x3dffeb);if(_0x52a6eb[_0x9ef3('0x42')]['filter']){_0x291316[_0x9ef3('0x4b')]=_[_0x9ef3('0x4d')](_0x291316['where'],{'$or':_[_0x9ef3('0x3d')](_0x3dffeb,function(_0x2c26d0){if(_0x2c26d0[_0x9ef3('0x3f')]!==_0x9ef3('0x4e')){var _0x141ed0={};_0x141ed0[_0x2c26d0['name']]={'$like':'%'+_0x52a6eb[_0x9ef3('0x42')][_0x9ef3('0x4f')]+'%'};return _0x141ed0;}})});}_0x291316=_[_0x9ef3('0x4d')]({},_0x291316,_0x52a6eb[_0x9ef3('0x50')]);var _0x6046ac={'where':_0x291316[_0x9ef3('0x4b')]};return db[_0x9ef3('0x51')][_0x9ef3('0x31')](_0x6046ac)[_0x9ef3('0x20')](function(_0x3c88dd){_0x337d46[_0x9ef3('0x31')]=_0x3c88dd;if(_0x52a6eb[_0x9ef3('0x42')][_0x9ef3('0x52')]){_0x291316[_0x9ef3('0x53')]=[{'all':!![]}];}return db[_0x9ef3('0x51')][_0x9ef3('0x54')](_0x291316);})[_0x9ef3('0x20')](function(_0xaac1a1){_0x337d46[_0x9ef3('0x55')]=_0xaac1a1;return _0x337d46;})[_0x9ef3('0x20')](respondWithFilteredResult(_0x5b1549,_0x291316))[_0x9ef3('0x29')](handleError(_0x5b1549,null));};exports[_0x9ef3('0x56')]=function(_0x24dc8e,_0x184b13){var _0x47c9c6={'raw':![],'where':{'id':_0x24dc8e[_0x9ef3('0x57')]['id']}},_0x341670={};_0x341670[_0x9ef3('0x41')]=_[_0x9ef3('0x58')](db[_0x9ef3('0x51')][_0x9ef3('0x59')]);_0x341670[_0x9ef3('0x42')]=_['keys'](_0x24dc8e[_0x9ef3('0x42')]);_0x341670[_0x9ef3('0x43')]=_[_0x9ef3('0x44')](_0x341670[_0x9ef3('0x41')],_0x341670[_0x9ef3('0x42')]);_0x47c9c6[_0x9ef3('0x45')]=_[_0x9ef3('0x44')](_0x341670[_0x9ef3('0x41')],qs['fields'](_0x24dc8e[_0x9ef3('0x42')]['fields']));_0x47c9c6[_0x9ef3('0x45')]=_0x47c9c6[_0x9ef3('0x45')]['length']?_0x47c9c6[_0x9ef3('0x45')]:_0x341670['model'];if(_0x24dc8e[_0x9ef3('0x42')][_0x9ef3('0x52')]){_0x47c9c6[_0x9ef3('0x53')]=[{'all':!![]}];}_0x47c9c6=_['merge']({},_0x47c9c6,_0x24dc8e[_0x9ef3('0x50')]);return db['Setting']['find'](_0x47c9c6)[_0x9ef3('0x20')](handleEntityNotFound(_0x184b13,null))[_0x9ef3('0x20')](respondWithResult(_0x184b13,null))[_0x9ef3('0x29')](handleError(_0x184b13,null));};exports[_0x9ef3('0x37')]=function(_0x4e4eda,_0x31af2a){if(_0x4e4eda[_0x9ef3('0x5a')]['id']){delete _0x4e4eda['body']['id'];}return db[_0x9ef3('0x51')][_0x9ef3('0x5b')]({'where':{'id':_0x4e4eda['params']['id']}})[_0x9ef3('0x20')](handleEntityNotFound(_0x31af2a,null))[_0x9ef3('0x20')](saveUpdates(_0x4e4eda[_0x9ef3('0x5a')],null))[_0x9ef3('0x20')](respondWithResult(_0x31af2a,null))[_0x9ef3('0x29')](handleError(_0x31af2a,null));};exports['addLogo']=function(_0x3cce0c,_0x3ad4db,_0x40f2ca){if(_0x3cce0c[_0x9ef3('0x5c')]&&_0x3cce0c[_0x9ef3('0x5c')][_0x9ef3('0x5d')]){_0x3cce0c[_0x9ef3('0x5a')][_0x9ef3('0x5e')]=_0x3cce0c[_0x9ef3('0x5c')][_0x9ef3('0x5d')];}return db[_0x9ef3('0x51')]['find']({'where':{'id':_0x3cce0c[_0x9ef3('0x57')]['id']}})['then'](handleEntityNotFound(_0x3ad4db,null))[_0x9ef3('0x20')](saveUpdates(_0x3cce0c[_0x9ef3('0x5a')],null))[_0x9ef3('0x20')](respondWithResult(_0x3ad4db,null))['catch'](handleError(_0x3ad4db,null));};exports[_0x9ef3('0x5f')]=function(_0x2d1283,_0x3da1ad,_0x2f93f0){if(_0x2d1283['file']&&_0x2d1283[_0x9ef3('0x5c')][_0x9ef3('0x5d')]){_0x2d1283[_0x9ef3('0x5a')]['loginLogo']=_0x2d1283[_0x9ef3('0x5c')]['filename'];}return db[_0x9ef3('0x51')][_0x9ef3('0x5b')]({'where':{'id':_0x2d1283[_0x9ef3('0x57')]['id']}})[_0x9ef3('0x20')](handleEntityNotFound(_0x3da1ad,null))[_0x9ef3('0x20')](saveUpdates(_0x2d1283[_0x9ef3('0x5a')],null))['then'](respondWithResult(_0x3da1ad,null))[_0x9ef3('0x29')](handleError(_0x3da1ad,null));};var utilLicense=require('../../config/license/util');exports[_0x9ef3('0x60')]=function(_0x4b2d51,_0x2421e0,_0x1a7515){var _0x2980ee='server/files/images/logos';var _0x4a44af={'custom':![]};return utilLicense[_0x9ef3('0x61')]()[_0x9ef3('0x20')](function(_0x346a0d){if(_0x346a0d){_0x4a44af=_0x346a0d;}return db[_0x9ef3('0x51')][_0x9ef3('0x5b')]({'where':{'id':_0x4b2d51[_0x9ef3('0x57')]['id']},'attributes':[_0x9ef3('0x5e'),'loginLogo',_0x9ef3('0x62'),_0x9ef3('0x63'),_0x9ef3('0x64'),_0x9ef3('0x65'),'defaultPreferred','defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x2421e0,null))[_0x9ef3('0x20')](function(_0xc17d87){if(_0xc17d87){var _0x5919d9=_0xc17d87[_0x9ef3('0x5e')]&&fs[_0x9ef3('0x66')](path[_0x9ef3('0x67')](config['root'],_0x2980ee,_[_0x9ef3('0x68')](_0xc17d87[_0x9ef3('0x5e')])))?path[_0x9ef3('0x67')](config[_0x9ef3('0x69')],_0x2980ee,_[_0x9ef3('0x68')](_0xc17d87[_0x9ef3('0x5e')])):path[_0x9ef3('0x67')](config[_0x9ef3('0x69')],_0x2980ee,_['toLower'](_0x9ef3('0x6a')));var _0x4c88ba=_0x9ef3('0x6b')+_[_0x9ef3('0x6c')](_0x9ef3('0x5e'));if(_0xc17d87[_0x4c88ba]||!_0x4a44af[_0x9ef3('0x6d')]){_0x5919d9=path[_0x9ef3('0x67')](config['root'],_0x2980ee,_[_0x9ef3('0x68')]('default_logo.svg'));}if(!fs[_0x9ef3('0x66')](_0x5919d9)){throw new db[(_0x9ef3('0x6e'))][(_0x9ef3('0x6f'))](_[_0x9ef3('0x6c')](_0x9ef3('0x5e'))+'\x20not\x20found');}return _0x2421e0[_0x9ef3('0x70')](_0x5919d9);}})[_0x9ef3('0x29')](handleError(_0x2421e0,null));};var utilLicense=require(_0x9ef3('0x1b'));exports[_0x9ef3('0x71')]=function(_0x13438c,_0x9ae9f,_0x4cfd00){var _0x210d19=_0x9ef3('0x72');var _0x6d56a7={'custom':![]};return utilLicense[_0x9ef3('0x61')]()[_0x9ef3('0x20')](function(_0x45a5db){if(_0x45a5db){_0x6d56a7=_0x45a5db;}return db['Setting'][_0x9ef3('0x5b')]({'where':{'id':_0x13438c[_0x9ef3('0x57')]['id']},'attributes':[_0x9ef3('0x5e'),_0x9ef3('0x73'),_0x9ef3('0x62'),_0x9ef3('0x63'),'defaultLogo',_0x9ef3('0x65'),_0x9ef3('0x74'),_0x9ef3('0x75')],'raw':!![]});})[_0x9ef3('0x20')](handleEntityNotFound(_0x9ae9f,null))['then'](function(_0x2ac3f5){if(_0x2ac3f5){var _0x3c62a8=_0x2ac3f5[_0x9ef3('0x73')]&&fs[_0x9ef3('0x66')](path['join'](config[_0x9ef3('0x69')],_0x210d19,_['toLower'](_0x2ac3f5[_0x9ef3('0x73')])))?path[_0x9ef3('0x67')](config['root'],_0x210d19,_['toLower'](_0x2ac3f5[_0x9ef3('0x73')])):path[_0x9ef3('0x67')](config[_0x9ef3('0x69')],_0x210d19,_[_0x9ef3('0x68')](_0x9ef3('0x76')));var _0x5eb6f5=_0x9ef3('0x6b')+_[_0x9ef3('0x6c')](_0x9ef3('0x73'));if(_0x2ac3f5[_0x5eb6f5]||!_0x6d56a7['custom']){_0x3c62a8=path[_0x9ef3('0x67')](config[_0x9ef3('0x69')],_0x210d19,_[_0x9ef3('0x68')](_0x9ef3('0x76')));}if(!fs['existsSync'](_0x3c62a8)){throw new db[(_0x9ef3('0x6e'))][(_0x9ef3('0x6f'))](_[_0x9ef3('0x6c')](_0x9ef3('0x73'))+'\x20not\x20found');}return _0x9ae9f[_0x9ef3('0x70')](_0x3c62a8);}})[_0x9ef3('0x29')](handleError(_0x9ae9f,null));};exports[_0x9ef3('0x77')]=function(_0x3da80b,_0x10ff4e){return db['Setting'][_0x9ef3('0x5b')]({'where':{'id':_0x3da80b[_0x9ef3('0x57')]['id']},'attributes':[_0x9ef3('0x78')]})[_0x9ef3('0x20')](respondWithResult(_0x10ff4e,null))[_0x9ef3('0x29')](handleError(_0x10ff4e,null));};exports['addPreferred']=function(_0xdfa528,_0x35db34,_0x161ab1){if(_0xdfa528['file']&&_0xdfa528[_0x9ef3('0x5c')]['filename']){_0xdfa528[_0x9ef3('0x5a')][_0x9ef3('0x62')]=_0xdfa528[_0x9ef3('0x5c')]['filename'];}return db[_0x9ef3('0x51')][_0x9ef3('0x5b')]({'where':{'id':_0xdfa528['params']['id']}})[_0x9ef3('0x20')](handleEntityNotFound(_0x35db34,null))[_0x9ef3('0x20')](saveUpdates(_0xdfa528[_0x9ef3('0x5a')],null))['then'](respondWithResult(_0x35db34,null))['catch'](handleError(_0x35db34,null));};var utilLicense=require(_0x9ef3('0x1b'));exports['getPreferred']=function(_0x1069ad,_0x8895d1,_0x2818b4){var _0x2511e9='server/files/images/logos';var _0x4fa62c={'custom':![]};return utilLicense[_0x9ef3('0x61')]()['then'](function(_0x48b92a){if(_0x48b92a){_0x4fa62c=_0x48b92a;}return db[_0x9ef3('0x51')]['find']({'where':{'id':_0x1069ad[_0x9ef3('0x57')]['id']},'attributes':['logo','loginLogo','preferred',_0x9ef3('0x63'),_0x9ef3('0x64'),'defaultLoginLogo',_0x9ef3('0x74'),'defaultFavicon'],'raw':!![]});})[_0x9ef3('0x20')](handleEntityNotFound(_0x8895d1,null))[_0x9ef3('0x20')](function(_0x3d54bd){if(_0x3d54bd){var _0x1d1e7b=_0x3d54bd[_0x9ef3('0x62')]&&fs[_0x9ef3('0x66')](path[_0x9ef3('0x67')](config[_0x9ef3('0x69')],_0x2511e9,_['toLower'](_0x3d54bd['preferred'])))?path[_0x9ef3('0x67')](config['root'],_0x2511e9,_[_0x9ef3('0x68')](_0x3d54bd['preferred'])):path[_0x9ef3('0x67')](config[_0x9ef3('0x69')],_0x2511e9,_[_0x9ef3('0x68')](_0x9ef3('0x79')));var _0x2e5409=_0x9ef3('0x6b')+_['upperFirst']('preferred');if(_0x3d54bd[_0x2e5409]||!_0x4fa62c[_0x9ef3('0x6d')]||!_0x4fa62c[_0x9ef3('0x62')]){_0x1d1e7b=path[_0x9ef3('0x67')](config[_0x9ef3('0x69')],_0x2511e9,_[_0x9ef3('0x68')](_0x9ef3('0x79')));}if(!fs['existsSync'](_0x1d1e7b)){throw new db['Sequelize']['ValidationError'](_['upperFirst'](_0x9ef3('0x62'))+'\x20not\x20found');}return _0x8895d1[_0x9ef3('0x70')](_0x1d1e7b);}})[_0x9ef3('0x29')](handleError(_0x8895d1,null));};exports[_0x9ef3('0x7a')]=function(_0x13094c,_0x2b179f,_0x313728){if(_0x13094c['file']&&_0x13094c[_0x9ef3('0x5c')][_0x9ef3('0x5d')]){_0x13094c[_0x9ef3('0x5a')]['favicon']=_0x13094c[_0x9ef3('0x5c')][_0x9ef3('0x5d')];}return db[_0x9ef3('0x51')]['find']({'where':{'id':_0x13094c[_0x9ef3('0x57')]['id']}})[_0x9ef3('0x20')](handleEntityNotFound(_0x2b179f,null))[_0x9ef3('0x20')](saveUpdates(_0x13094c[_0x9ef3('0x5a')],null))['then'](respondWithResult(_0x2b179f,null))[_0x9ef3('0x29')](handleError(_0x2b179f,null));};var utilLicense=require(_0x9ef3('0x1b'));exports[_0x9ef3('0x7b')]=function(_0x126f0a,_0x186e53,_0x1d487b){var _0x1480a7='server/files/images/logos';var _0x35fab0={'custom':![]};return utilLicense[_0x9ef3('0x61')]()['then'](function(_0x57a98f){if(_0x57a98f){_0x35fab0=_0x57a98f;}return db['Setting'][_0x9ef3('0x5b')]({'where':{'id':_0x126f0a[_0x9ef3('0x57')]['id']},'attributes':[_0x9ef3('0x5e'),_0x9ef3('0x73'),_0x9ef3('0x62'),'favicon',_0x9ef3('0x64'),_0x9ef3('0x65'),_0x9ef3('0x74'),_0x9ef3('0x75')],'raw':!![]});})[_0x9ef3('0x20')](handleEntityNotFound(_0x186e53,null))[_0x9ef3('0x20')](function(_0x2e7555){if(_0x2e7555){var _0x1fb1ee=_0x2e7555[_0x9ef3('0x63')]&&fs[_0x9ef3('0x66')](path[_0x9ef3('0x67')](config[_0x9ef3('0x69')],_0x1480a7,_[_0x9ef3('0x68')](_0x2e7555[_0x9ef3('0x63')])))?path['join'](config[_0x9ef3('0x69')],_0x1480a7,_['toLower'](_0x2e7555[_0x9ef3('0x63')])):path[_0x9ef3('0x67')](config[_0x9ef3('0x69')],_0x1480a7,_['toLower']('default_favicon.ico'));var _0x21bff1=_0x9ef3('0x6b')+_['upperFirst'](_0x9ef3('0x63'));if(_0x2e7555[_0x21bff1]||!_0x35fab0[_0x9ef3('0x6d')]){_0x1fb1ee=path[_0x9ef3('0x67')](config[_0x9ef3('0x69')],_0x1480a7,_[_0x9ef3('0x68')](_0x9ef3('0x7c')));}if(!fs['existsSync'](_0x1fb1ee)){throw new db[(_0x9ef3('0x6e'))]['ValidationError'](_[_0x9ef3('0x6c')](_0x9ef3('0x63'))+'\x20not\x20found');}return _0x186e53['download'](_0x1fb1ee);}})[_0x9ef3('0x29')](handleError(_0x186e53,null));};exports[_0x9ef3('0x7d')]=function(_0xf6ba7e,_0x1960ce){var _0x4853f9={'offset':moment()[_0x9ef3('0x7e')]()};_0x4853f9['now']=moment()[_0x9ef3('0x7e')](_0x4853f9['offset'])[_0x9ef3('0x7f')](_0x9ef3('0x80'));return _0x1960ce['status'](0xc8)[_0x9ef3('0x3b')](_0x4853f9);}; \ No newline at end of file +var _0x18c9=['count','set','apply','reject','save','update','destroy','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','Setting','includeAll','include','findAll','rows','show','params','length','find','body','addLogo','filename','logo','file','loginLogo','getLogo','getLicense','favicon','defaultLogo','defaultLoginLogo','defaultFavicon','join','root','toLower','default_logo.svg','default','custom','Sequelize','\x20not\x20found','download','getLogoLogin','server/files/images/logos','preferred','defaultPreferred','existsSync','default_loginLogo.svg','ValidationError','upperFirst','gdpr','securePassword','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','client','http','request','then','info','request\x20sent','debug','error','code','Setting,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','limit'];(function(_0x52bf81,_0x5c93dc){var _0x45f9b4=function(_0x31b126){while(--_0x31b126){_0x52bf81['push'](_0x52bf81['shift']());}};_0x45f9b4(++_0x5c93dc);}(_0x18c9,0x1bf));var _0x918c=function(_0x8ba19a,_0x1d2b2b){_0x8ba19a=_0x8ba19a-0x0;var _0x2bd8b4=_0x18c9[_0x8ba19a];return _0x2bd8b4;};'use strict';var emlformat=require(_0x918c('0x0'));var rimraf=require(_0x918c('0x1'));var zipdir=require(_0x918c('0x2'));var jsonpatch=require(_0x918c('0x3'));var rp=require(_0x918c('0x4'));var moment=require(_0x918c('0x5'));var BPromise=require(_0x918c('0x6'));var Mustache=require(_0x918c('0x7'));var util=require(_0x918c('0x8'));var path=require(_0x918c('0x9'));var sox=require(_0x918c('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x918c('0xb'));var _=require(_0x918c('0xc'));var squel=require(_0x918c('0xd'));var crypto=require(_0x918c('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x918c('0xf'));var querystring=require(_0x918c('0x10'));var Papa=require(_0x918c('0x11'));var Redis=require(_0x918c('0x12'));var authService=require(_0x918c('0x13'));var qs=require(_0x918c('0x14'));var as=require(_0x918c('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x918c('0x16'))(_0x918c('0x17'));var utils=require('../../config/utils');var config=require(_0x918c('0x18'));var licenseUtil=require(_0x918c('0x19'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x918c('0x1a')][_0x918c('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x4f459e,_0x4d0a66,_0x3545f8,_0x2fe831){return new BPromise(function(_0x4745ea,_0x1476ac){var _0x16ea6c=_0x2fe831||client;return _0x16ea6c[_0x918c('0x1c')](_0x4f459e,_0x3545f8)[_0x918c('0x1d')](function(_0x74b410){logger[_0x918c('0x1e')]('Setting,\x20%s,\x20%s',_0x4d0a66,_0x918c('0x1f'));logger[_0x918c('0x20')]('Setting,\x20%s,\x20%s,\x20%s',_0x4d0a66,_0x918c('0x1f'),JSON['stringify'](_0x74b410));if(_0x74b410[_0x918c('0x21')]){if(_0x74b410['error'][_0x918c('0x22')]===0x1f4){logger[_0x918c('0x21')](_0x918c('0x23'),_0x4d0a66,_0x74b410['error']['message']);return _0x1476ac(_0x74b410[_0x918c('0x21')][_0x918c('0x24')]);}logger[_0x918c('0x21')](_0x918c('0x23'),_0x4d0a66,_0x74b410['error'][_0x918c('0x24')]);return _0x4745ea(_0x74b410['error']['message']);}else{logger['info'](_0x918c('0x23'),_0x4d0a66,_0x918c('0x1f'));_0x4745ea(_0x74b410[_0x918c('0x25')][_0x918c('0x24')]);}})[_0x918c('0x26')](function(_0x5d9d21){logger[_0x918c('0x21')](_0x918c('0x23'),_0x4d0a66,_0x5d9d21);_0x1476ac(_0x5d9d21);});});}function respondWithStatusCode(_0x1b804a,_0x13b4f9){_0x13b4f9=_0x13b4f9||0xcc;return function(_0x57394d){if(_0x57394d){return _0x1b804a[_0x918c('0x27')](_0x13b4f9);}return _0x1b804a[_0x918c('0x28')](_0x13b4f9)['end']();};}function respondWithResult(_0x5df417,_0x1c07eb){_0x1c07eb=_0x1c07eb||0xc8;return function(_0x4c267d){if(_0x4c267d){return _0x5df417[_0x918c('0x28')](_0x1c07eb)[_0x918c('0x29')](_0x4c267d);}};}function respondWithFilteredResult(_0x1c5037,_0x2af8bc){return function(_0x565ae7){if(_0x565ae7){var _0x8cc428=typeof _0x2af8bc[_0x918c('0x2a')]===_0x918c('0x2b')&&typeof _0x2af8bc[_0x918c('0x2c')]===_0x918c('0x2b');var _0x548c85=_0x565ae7[_0x918c('0x2d')];var _0x5d3959=_0x8cc428?0x0:_0x2af8bc[_0x918c('0x2a')];var _0x4eb6a1=_0x8cc428?_0x565ae7[_0x918c('0x2d')]:_0x2af8bc['offset']+_0x2af8bc[_0x918c('0x2c')];var _0xcb5dbe;if(_0x4eb6a1>=_0x548c85){_0x4eb6a1=_0x548c85;_0xcb5dbe=0xc8;}else{_0xcb5dbe=0xce;}_0x1c5037[_0x918c('0x28')](_0xcb5dbe);return _0x1c5037[_0x918c('0x2e')]('Content-Range',_0x5d3959+'-'+_0x4eb6a1+'/'+_0x548c85)['json'](_0x565ae7);}return null;};}function patchUpdates(_0x578a82){return function(_0x40c616){try{jsonpatch[_0x918c('0x2f')](_0x40c616,_0x578a82,!![]);}catch(_0x434e22){return BPromise[_0x918c('0x30')](_0x434e22);}return _0x40c616[_0x918c('0x31')]();};}function saveUpdates(_0x4adebb,_0x362d07){return function(_0x1abc12){if(_0x1abc12){return _0x1abc12[_0x918c('0x32')](_0x4adebb)['then'](function(_0x38178e){return _0x38178e;});}return null;};}function removeEntity(_0x22c0e2,_0x1163b2){return function(_0x324d91){if(_0x324d91){return _0x324d91[_0x918c('0x33')]()[_0x918c('0x1d')](function(){_0x22c0e2[_0x918c('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x288c10,_0x8f78c7){return function(_0x452beb){if(!_0x452beb){_0x288c10['sendStatus'](0x194);}return _0x452beb;};}function handleError(_0x206a8b,_0x40d686){_0x40d686=_0x40d686||0x1f4;return function(_0x5696c5){logger[_0x918c('0x21')](_0x5696c5[_0x918c('0x34')]);if(_0x5696c5[_0x918c('0x35')]){delete _0x5696c5[_0x918c('0x35')];}_0x206a8b[_0x918c('0x28')](_0x40d686)['send'](_0x5696c5);};}exports[_0x918c('0x36')]=function(_0x443a80,_0x1c4a20){var _0x513e08={},_0x75d42e={},_0x554bbb={'count':0x0,'rows':[]};var _0x38411e=_['map'](db['Setting'][_0x918c('0x37')],function(_0x3841dd){return{'name':_0x3841dd[_0x918c('0x38')],'type':_0x3841dd[_0x918c('0x39')][_0x918c('0x3a')]};});_0x75d42e[_0x918c('0x3b')]=_[_0x918c('0x3c')](_0x38411e,_0x918c('0x35'));_0x75d42e[_0x918c('0x3d')]=_[_0x918c('0x3e')](_0x443a80[_0x918c('0x3d')]);_0x75d42e[_0x918c('0x3f')]=_[_0x918c('0x40')](_0x75d42e[_0x918c('0x3b')],_0x75d42e['query']);_0x513e08[_0x918c('0x41')]=_[_0x918c('0x40')](_0x75d42e['model'],qs[_0x918c('0x42')](_0x443a80['query'][_0x918c('0x42')]));_0x513e08['attributes']=_0x513e08[_0x918c('0x41')]['length']?_0x513e08[_0x918c('0x41')]:_0x75d42e[_0x918c('0x3b')];if(!_0x443a80[_0x918c('0x3d')][_0x918c('0x43')](_0x918c('0x44'))){_0x513e08[_0x918c('0x2c')]=qs[_0x918c('0x2c')](_0x443a80['query'][_0x918c('0x2c')]);_0x513e08[_0x918c('0x2a')]=qs['offset'](_0x443a80[_0x918c('0x3d')]['offset']);}_0x513e08[_0x918c('0x45')]=qs[_0x918c('0x46')](_0x443a80['query']['sort']);_0x513e08['where']=qs[_0x918c('0x3f')](_['pick'](_0x443a80[_0x918c('0x3d')],_0x75d42e[_0x918c('0x3f')]),_0x38411e);if(_0x443a80['query'][_0x918c('0x47')]){_0x513e08[_0x918c('0x48')]=_[_0x918c('0x49')](_0x513e08[_0x918c('0x48')],{'$or':_['map'](_0x38411e,function(_0x45bea6){if(_0x45bea6[_0x918c('0x39')]!==_0x918c('0x4a')){var _0x545ecf={};_0x545ecf[_0x45bea6[_0x918c('0x35')]]={'$like':'%'+_0x443a80['query'][_0x918c('0x47')]+'%'};return _0x545ecf;}})});}_0x513e08=_['merge']({},_0x513e08,_0x443a80[_0x918c('0x4b')]);var _0x8a2d0c={'where':_0x513e08[_0x918c('0x48')]};return db[_0x918c('0x4c')][_0x918c('0x2d')](_0x8a2d0c)[_0x918c('0x1d')](function(_0x5b4d75){_0x554bbb[_0x918c('0x2d')]=_0x5b4d75;if(_0x443a80[_0x918c('0x3d')][_0x918c('0x4d')]){_0x513e08[_0x918c('0x4e')]=[{'all':!![]}];}return db[_0x918c('0x4c')][_0x918c('0x4f')](_0x513e08);})['then'](function(_0x52e619){_0x554bbb[_0x918c('0x50')]=_0x52e619;return _0x554bbb;})[_0x918c('0x1d')](respondWithFilteredResult(_0x1c4a20,_0x513e08))[_0x918c('0x26')](handleError(_0x1c4a20,null));};exports[_0x918c('0x51')]=function(_0x481dfa,_0x232a41){var _0x3a9961={'raw':![],'where':{'id':_0x481dfa[_0x918c('0x52')]['id']}},_0x389c0e={};_0x389c0e[_0x918c('0x3b')]=_['keys'](db[_0x918c('0x4c')][_0x918c('0x37')]);_0x389c0e[_0x918c('0x3d')]=_[_0x918c('0x3e')](_0x481dfa['query']);_0x389c0e[_0x918c('0x3f')]=_[_0x918c('0x40')](_0x389c0e[_0x918c('0x3b')],_0x389c0e[_0x918c('0x3d')]);_0x3a9961[_0x918c('0x41')]=_[_0x918c('0x40')](_0x389c0e['model'],qs[_0x918c('0x42')](_0x481dfa['query'][_0x918c('0x42')]));_0x3a9961[_0x918c('0x41')]=_0x3a9961[_0x918c('0x41')][_0x918c('0x53')]?_0x3a9961[_0x918c('0x41')]:_0x389c0e[_0x918c('0x3b')];if(_0x481dfa[_0x918c('0x3d')][_0x918c('0x4d')]){_0x3a9961[_0x918c('0x4e')]=[{'all':!![]}];}_0x3a9961=_[_0x918c('0x49')]({},_0x3a9961,_0x481dfa[_0x918c('0x4b')]);return db[_0x918c('0x4c')][_0x918c('0x54')](_0x3a9961)[_0x918c('0x1d')](handleEntityNotFound(_0x232a41,null))[_0x918c('0x1d')](respondWithResult(_0x232a41,null))[_0x918c('0x26')](handleError(_0x232a41,null));};exports[_0x918c('0x32')]=function(_0x83ba8a,_0xeb66e4){if(_0x83ba8a[_0x918c('0x55')]['id']){delete _0x83ba8a[_0x918c('0x55')]['id'];}return db['Setting'][_0x918c('0x54')]({'where':{'id':_0x83ba8a[_0x918c('0x52')]['id']}})[_0x918c('0x1d')](handleEntityNotFound(_0xeb66e4,null))[_0x918c('0x1d')](saveUpdates(_0x83ba8a[_0x918c('0x55')],null))['then'](respondWithResult(_0xeb66e4,null))[_0x918c('0x26')](handleError(_0xeb66e4,null));};exports[_0x918c('0x56')]=function(_0x21f3dd,_0x2b9870,_0x5a05eb){if(_0x21f3dd['file']&&_0x21f3dd['file'][_0x918c('0x57')]){_0x21f3dd[_0x918c('0x55')][_0x918c('0x58')]=_0x21f3dd['file'][_0x918c('0x57')];}return db[_0x918c('0x4c')][_0x918c('0x54')]({'where':{'id':_0x21f3dd[_0x918c('0x52')]['id']}})[_0x918c('0x1d')](handleEntityNotFound(_0x2b9870,null))[_0x918c('0x1d')](saveUpdates(_0x21f3dd[_0x918c('0x55')],null))['then'](respondWithResult(_0x2b9870,null))[_0x918c('0x26')](handleError(_0x2b9870,null));};exports['addLogoLogin']=function(_0x566a08,_0x312e79,_0x4b4df5){if(_0x566a08[_0x918c('0x59')]&&_0x566a08[_0x918c('0x59')][_0x918c('0x57')]){_0x566a08[_0x918c('0x55')][_0x918c('0x5a')]=_0x566a08[_0x918c('0x59')][_0x918c('0x57')];}return db['Setting'][_0x918c('0x54')]({'where':{'id':_0x566a08[_0x918c('0x52')]['id']}})[_0x918c('0x1d')](handleEntityNotFound(_0x312e79,null))[_0x918c('0x1d')](saveUpdates(_0x566a08[_0x918c('0x55')],null))[_0x918c('0x1d')](respondWithResult(_0x312e79,null))[_0x918c('0x26')](handleError(_0x312e79,null));};var utilLicense=require(_0x918c('0x19'));exports[_0x918c('0x5b')]=function(_0x2f3faa,_0x5c0815,_0x18434e){var _0x2ef6aa='server/files/images/logos';var _0xe8c937={'custom':![]};return utilLicense[_0x918c('0x5c')]()[_0x918c('0x1d')](function(_0x5408cb){if(_0x5408cb){_0xe8c937=_0x5408cb;}return db[_0x918c('0x4c')][_0x918c('0x54')]({'where':{'id':_0x2f3faa[_0x918c('0x52')]['id']},'attributes':['logo',_0x918c('0x5a'),'preferred',_0x918c('0x5d'),_0x918c('0x5e'),_0x918c('0x5f'),'defaultPreferred',_0x918c('0x60')],'raw':!![]});})[_0x918c('0x1d')](handleEntityNotFound(_0x5c0815,null))[_0x918c('0x1d')](function(_0x365d88){if(_0x365d88){var _0x642793=_0x365d88[_0x918c('0x58')]&&fs['existsSync'](path[_0x918c('0x61')](config[_0x918c('0x62')],_0x2ef6aa,_['toLower'](_0x365d88[_0x918c('0x58')])))?path[_0x918c('0x61')](config['root'],_0x2ef6aa,_[_0x918c('0x63')](_0x365d88[_0x918c('0x58')])):path[_0x918c('0x61')](config[_0x918c('0x62')],_0x2ef6aa,_[_0x918c('0x63')](_0x918c('0x64')));var _0x5cfc3e=_0x918c('0x65')+_['upperFirst']('logo');if(_0x365d88[_0x5cfc3e]||!_0xe8c937[_0x918c('0x66')]){_0x642793=path['join'](config['root'],_0x2ef6aa,_[_0x918c('0x63')](_0x918c('0x64')));}if(!fs['existsSync'](_0x642793)){throw new db[(_0x918c('0x67'))]['ValidationError'](_['upperFirst'](_0x918c('0x58'))+_0x918c('0x68'));}return _0x5c0815[_0x918c('0x69')](_0x642793);}})[_0x918c('0x26')](handleError(_0x5c0815,null));};var utilLicense=require(_0x918c('0x19'));exports[_0x918c('0x6a')]=function(_0x20dee6,_0x4178fb,_0x4cbddf){var _0x32dabd=_0x918c('0x6b');var _0x18d90e={'custom':![]};return utilLicense[_0x918c('0x5c')]()['then'](function(_0x524a1f){if(_0x524a1f){_0x18d90e=_0x524a1f;}return db[_0x918c('0x4c')][_0x918c('0x54')]({'where':{'id':_0x20dee6[_0x918c('0x52')]['id']},'attributes':[_0x918c('0x58'),_0x918c('0x5a'),_0x918c('0x6c'),'favicon',_0x918c('0x5e'),_0x918c('0x5f'),_0x918c('0x6d'),'defaultFavicon'],'raw':!![]});})[_0x918c('0x1d')](handleEntityNotFound(_0x4178fb,null))['then'](function(_0x1c10f4){if(_0x1c10f4){var _0x47b3ed=_0x1c10f4[_0x918c('0x5a')]&&fs[_0x918c('0x6e')](path['join'](config[_0x918c('0x62')],_0x32dabd,_[_0x918c('0x63')](_0x1c10f4['loginLogo'])))?path[_0x918c('0x61')](config[_0x918c('0x62')],_0x32dabd,_[_0x918c('0x63')](_0x1c10f4[_0x918c('0x5a')])):path[_0x918c('0x61')](config['root'],_0x32dabd,_[_0x918c('0x63')](_0x918c('0x6f')));var _0x424ecd=_0x918c('0x65')+_['upperFirst'](_0x918c('0x5a'));if(_0x1c10f4[_0x424ecd]||!_0x18d90e[_0x918c('0x66')]){_0x47b3ed=path[_0x918c('0x61')](config[_0x918c('0x62')],_0x32dabd,_[_0x918c('0x63')]('default_loginLogo.svg'));}if(!fs[_0x918c('0x6e')](_0x47b3ed)){throw new db['Sequelize'][(_0x918c('0x70'))](_[_0x918c('0x71')](_0x918c('0x5a'))+_0x918c('0x68'));}return _0x4178fb['download'](_0x47b3ed);}})[_0x918c('0x26')](handleError(_0x4178fb,null));};exports[_0x918c('0x72')]=function(_0x301201,_0x37c065){return db['Setting'][_0x918c('0x54')]({'where':{'id':_0x301201[_0x918c('0x52')]['id']},'attributes':[_0x918c('0x73')]})[_0x918c('0x1d')](respondWithResult(_0x37c065,null))[_0x918c('0x26')](handleError(_0x37c065,null));};exports['addPreferred']=function(_0x167bc3,_0x606b9e,_0x545048){if(_0x167bc3[_0x918c('0x59')]&&_0x167bc3[_0x918c('0x59')][_0x918c('0x57')]){_0x167bc3[_0x918c('0x55')][_0x918c('0x6c')]=_0x167bc3[_0x918c('0x59')]['filename'];}return db[_0x918c('0x4c')][_0x918c('0x54')]({'where':{'id':_0x167bc3[_0x918c('0x52')]['id']}})['then'](handleEntityNotFound(_0x606b9e,null))['then'](saveUpdates(_0x167bc3[_0x918c('0x55')],null))[_0x918c('0x1d')](respondWithResult(_0x606b9e,null))[_0x918c('0x26')](handleError(_0x606b9e,null));};var utilLicense=require('../../config/license/util');exports['getPreferred']=function(_0xfbc857,_0x421c9b,_0x58bb8c){var _0x144994='server/files/images/logos';var _0x2174bc={'custom':![]};return utilLicense['getLicense']()[_0x918c('0x1d')](function(_0x27e8c2){if(_0x27e8c2){_0x2174bc=_0x27e8c2;}return db['Setting']['find']({'where':{'id':_0xfbc857[_0x918c('0x52')]['id']},'attributes':[_0x918c('0x58'),_0x918c('0x5a'),_0x918c('0x6c'),_0x918c('0x5d'),_0x918c('0x5e'),_0x918c('0x5f'),_0x918c('0x6d'),_0x918c('0x60')],'raw':!![]});})[_0x918c('0x1d')](handleEntityNotFound(_0x421c9b,null))[_0x918c('0x1d')](function(_0x421966){if(_0x421966){var _0x279930=_0x421966[_0x918c('0x6c')]&&fs[_0x918c('0x6e')](path[_0x918c('0x61')](config['root'],_0x144994,_['toLower'](_0x421966[_0x918c('0x6c')])))?path[_0x918c('0x61')](config[_0x918c('0x62')],_0x144994,_[_0x918c('0x63')](_0x421966['preferred'])):path[_0x918c('0x61')](config[_0x918c('0x62')],_0x144994,_[_0x918c('0x63')](_0x918c('0x74')));var _0x328855='default'+_[_0x918c('0x71')](_0x918c('0x6c'));if(_0x421966[_0x328855]||!_0x2174bc[_0x918c('0x66')]||!_0x2174bc[_0x918c('0x6c')]){_0x279930=path[_0x918c('0x61')](config['root'],_0x144994,_['toLower'](_0x918c('0x74')));}if(!fs[_0x918c('0x6e')](_0x279930)){throw new db[(_0x918c('0x67'))][(_0x918c('0x70'))](_[_0x918c('0x71')](_0x918c('0x6c'))+_0x918c('0x68'));}return _0x421c9b['download'](_0x279930);}})[_0x918c('0x26')](handleError(_0x421c9b,null));};exports[_0x918c('0x75')]=function(_0xfe7a5a,_0x131253,_0x574cfd){if(_0xfe7a5a[_0x918c('0x59')]&&_0xfe7a5a[_0x918c('0x59')][_0x918c('0x57')]){_0xfe7a5a['body']['favicon']=_0xfe7a5a['file'][_0x918c('0x57')];}return db['Setting'][_0x918c('0x54')]({'where':{'id':_0xfe7a5a['params']['id']}})['then'](handleEntityNotFound(_0x131253,null))[_0x918c('0x1d')](saveUpdates(_0xfe7a5a[_0x918c('0x55')],null))[_0x918c('0x1d')](respondWithResult(_0x131253,null))[_0x918c('0x26')](handleError(_0x131253,null));};var utilLicense=require(_0x918c('0x19'));exports[_0x918c('0x76')]=function(_0x973dfa,_0x96a57e,_0xa5183d){var _0x53d7fa=_0x918c('0x6b');var _0x11720b={'custom':![]};return utilLicense[_0x918c('0x5c')]()['then'](function(_0x395aa5){if(_0x395aa5){_0x11720b=_0x395aa5;}return db[_0x918c('0x4c')]['find']({'where':{'id':_0x973dfa[_0x918c('0x52')]['id']},'attributes':['logo',_0x918c('0x5a'),_0x918c('0x6c'),_0x918c('0x5d'),'defaultLogo','defaultLoginLogo',_0x918c('0x6d'),'defaultFavicon'],'raw':!![]});})[_0x918c('0x1d')](handleEntityNotFound(_0x96a57e,null))[_0x918c('0x1d')](function(_0x598b40){if(_0x598b40){var _0x30577a=_0x598b40[_0x918c('0x5d')]&&fs[_0x918c('0x6e')](path[_0x918c('0x61')](config[_0x918c('0x62')],_0x53d7fa,_[_0x918c('0x63')](_0x598b40[_0x918c('0x5d')])))?path[_0x918c('0x61')](config['root'],_0x53d7fa,_[_0x918c('0x63')](_0x598b40['favicon'])):path[_0x918c('0x61')](config[_0x918c('0x62')],_0x53d7fa,_[_0x918c('0x63')](_0x918c('0x77')));var _0x51596a=_0x918c('0x65')+_[_0x918c('0x71')](_0x918c('0x5d'));if(_0x598b40[_0x51596a]||!_0x11720b[_0x918c('0x66')]){_0x30577a=path[_0x918c('0x61')](config['root'],_0x53d7fa,_['toLower'](_0x918c('0x77')));}if(!fs[_0x918c('0x6e')](_0x30577a)){throw new db['Sequelize'][(_0x918c('0x70'))](_['upperFirst']('favicon')+_0x918c('0x68'));}return _0x96a57e[_0x918c('0x69')](_0x30577a);}})[_0x918c('0x26')](handleError(_0x96a57e,null));};exports[_0x918c('0x78')]=function(_0x4aa9d1,_0x5734be){var _0x8e73bb={'offset':moment()['utcOffset']()};_0x8e73bb['now']=moment()['utcOffset'](_0x8e73bb['offset'])[_0x918c('0x79')](_0x918c('0x7a'));return _0x5734be[_0x918c('0x28')](0xc8)['send'](_0x8e73bb);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 7e8ca8b..5b1544e 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 _0x3e74=['exports','Setting','settings','lodash','../../config/logger','api','moment','path','../../config/environment','./setting.attributes'];(function(_0x3f1710,_0x3877a2){var _0x528458=function(_0x4b5d0f){while(--_0x4b5d0f){_0x3f1710['push'](_0x3f1710['shift']());}};_0x528458(++_0x3877a2);}(_0x3e74,0x175));var _0x43e7=function(_0x2b523f,_0x34690b){_0x2b523f=_0x2b523f-0x0;var _0x3cc746=_0x3e74[_0x2b523f];return _0x3cc746;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Setting','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./setting.attributes'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'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 1571f24..dd7d332 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 _0x6dcc=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Setting,\x20%s,\x20%s','message','result','Setting','options','raw','where','include','map','attributes','model','then','ShowSetting','lodash','util'];(function(_0x245afe,_0x319cde){var _0x4eefde=function(_0x15a1fa){while(--_0x15a1fa){_0x245afe['push'](_0x245afe['shift']());}};_0x4eefde(++_0x319cde);}(_0x6dcc,0xec));var _0xc6dc=function(_0x31af4b,_0x2c2106){_0x31af4b=_0x31af4b-0x0;var _0x496bd8=_0x6dcc[_0x31af4b];return _0x496bd8;};'use strict';var _=require(_0xc6dc('0x0'));var util=require(_0xc6dc('0x1'));var moment=require(_0xc6dc('0x2'));var BPromise=require(_0xc6dc('0x3'));var rs=require(_0xc6dc('0x4'));var fs=require('fs');var Redis=require(_0xc6dc('0x5'));var db=require(_0xc6dc('0x6'))['db'];var utils=require(_0xc6dc('0x7'));var logger=require('../../config/logger')(_0xc6dc('0x8'));var config=require(_0xc6dc('0x9'));var jayson=require(_0xc6dc('0xa'));var client=jayson[_0xc6dc('0xb')][_0xc6dc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5f31ee,_0xd002f1,_0x30205b){return new BPromise(function(_0x5990db,_0x202491){return client[_0xc6dc('0xd')](_0x5f31ee,_0x30205b)['then'](function(_0x37fe6b){logger[_0xc6dc('0xe')]('Setting,\x20%s,\x20%s',_0xd002f1,'request\x20sent');logger[_0xc6dc('0xf')](_0xc6dc('0x10'),_0xd002f1,_0xc6dc('0x11'),JSON[_0xc6dc('0x12')](_0x37fe6b));if(_0x37fe6b[_0xc6dc('0x13')]){if(_0x37fe6b[_0xc6dc('0x13')][_0xc6dc('0x14')]===0x1f4){logger[_0xc6dc('0x13')](_0xc6dc('0x15'),_0xd002f1,_0x37fe6b[_0xc6dc('0x13')][_0xc6dc('0x16')]);return _0x202491(_0x37fe6b[_0xc6dc('0x13')]['message']);}logger[_0xc6dc('0x13')](_0xc6dc('0x15'),_0xd002f1,_0x37fe6b[_0xc6dc('0x13')]['message']);return _0x5990db(_0x37fe6b[_0xc6dc('0x13')][_0xc6dc('0x16')]);}else{logger[_0xc6dc('0xe')](_0xc6dc('0x15'),_0xd002f1,'request\x20sent');_0x5990db(_0x37fe6b[_0xc6dc('0x17')]['message']);}})['catch'](function(_0x5e2925){logger[_0xc6dc('0x13')](_0xc6dc('0x15'),_0xd002f1,_0x5e2925);_0x202491(_0x5e2925);});});}exports['ShowSetting']=function(_0x29831a){var _0x4c6941=this;return new Promise(function(_0x3054db,_0x36e37b){return db[_0xc6dc('0x18')]['find']({'raw':_0x29831a[_0xc6dc('0x19')]?_0x29831a[_0xc6dc('0x19')][_0xc6dc('0x1a')]===undefined?!![]:![]:!![],'where':_0x29831a[_0xc6dc('0x19')]?_0x29831a[_0xc6dc('0x19')][_0xc6dc('0x1b')]||null:null,'attributes':_0x29831a[_0xc6dc('0x19')]?_0x29831a['options']['attributes']||null:null,'include':_0x29831a[_0xc6dc('0x19')]?_0x29831a['options'][_0xc6dc('0x1c')]?_[_0xc6dc('0x1d')](_0x29831a['options'][_0xc6dc('0x1c')],function(_0x556f81){return{'model':db[_0x556f81['model']],'as':_0x556f81['as'],'attributes':_0x556f81[_0xc6dc('0x1e')],'include':_0x556f81[_0xc6dc('0x1c')]?_[_0xc6dc('0x1d')](_0x556f81[_0xc6dc('0x1c')],function(_0x3cb498){return{'model':db[_0x3cb498[_0xc6dc('0x1f')]],'as':_0x3cb498['as'],'attributes':_0x3cb498[_0xc6dc('0x1e')],'include':_0x3cb498[_0xc6dc('0x1c')]?_[_0xc6dc('0x1d')](_0x3cb498[_0xc6dc('0x1c')],function(_0x2ad9bd){return{'model':db[_0x2ad9bd[_0xc6dc('0x1f')]],'as':_0x2ad9bd['as'],'attributes':_0x2ad9bd[_0xc6dc('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc6dc('0x20')](function(_0x2210dc){logger[_0xc6dc('0xe')]('ShowSetting',_0x29831a);logger[_0xc6dc('0xf')](_0xc6dc('0x21'),_0x29831a,JSON[_0xc6dc('0x12')](_0x2210dc));_0x3054db(_0x2210dc);})['catch'](function(_0x31270c){logger[_0xc6dc('0x13')](_0xc6dc('0x21'),_0x31270c[_0xc6dc('0x16')],_0x29831a);_0x36e37b(_0x4c6941['error'](0x1f4,_0x31270c[_0xc6dc('0x16')]));});});}; \ No newline at end of file +var _0x6dc1=['Setting,\x20%s,\x20%s','message','info','result','catch','Setting','find','options','raw','where','attributes','include','map','model','then','ShowSetting','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4b6774,_0xc3fb){var _0x46f1e6=function(_0x39e2b9){while(--_0x39e2b9){_0x4b6774['push'](_0x4b6774['shift']());}};_0x46f1e6(++_0xc3fb);}(_0x6dc1,0x1e0));var _0x16dc=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x6dc1[_0x9df060];return _0x338dfe;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x16dc('0x0'));var rs=require(_0x16dc('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x16dc('0x2'))['db'];var utils=require(_0x16dc('0x3'));var logger=require(_0x16dc('0x4'))(_0x16dc('0x5'));var config=require(_0x16dc('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x16dc('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x205e77,_0x3e9f92,_0x86ba01){return new BPromise(function(_0x5eab84,_0x49bdb4){return client['request'](_0x205e77,_0x86ba01)['then'](function(_0xa10de0){logger['info']('Setting,\x20%s,\x20%s',_0x3e9f92,_0x16dc('0x8'));logger[_0x16dc('0x9')](_0x16dc('0xa'),_0x3e9f92,_0x16dc('0x8'),JSON[_0x16dc('0xb')](_0xa10de0));if(_0xa10de0['error']){if(_0xa10de0[_0x16dc('0xc')]['code']===0x1f4){logger[_0x16dc('0xc')](_0x16dc('0xd'),_0x3e9f92,_0xa10de0[_0x16dc('0xc')]['message']);return _0x49bdb4(_0xa10de0[_0x16dc('0xc')][_0x16dc('0xe')]);}logger[_0x16dc('0xc')]('Setting,\x20%s,\x20%s',_0x3e9f92,_0xa10de0[_0x16dc('0xc')]['message']);return _0x5eab84(_0xa10de0[_0x16dc('0xc')]['message']);}else{logger[_0x16dc('0xf')](_0x16dc('0xd'),_0x3e9f92,_0x16dc('0x8'));_0x5eab84(_0xa10de0[_0x16dc('0x10')][_0x16dc('0xe')]);}})[_0x16dc('0x11')](function(_0x36abc1){logger[_0x16dc('0xc')](_0x16dc('0xd'),_0x3e9f92,_0x36abc1);_0x49bdb4(_0x36abc1);});});}exports['ShowSetting']=function(_0x3ab761){var _0x371bcc=this;return new Promise(function(_0x1d3c8f,_0x2c769c){return db[_0x16dc('0x12')][_0x16dc('0x13')]({'raw':_0x3ab761[_0x16dc('0x14')]?_0x3ab761[_0x16dc('0x14')][_0x16dc('0x15')]===undefined?!![]:![]:!![],'where':_0x3ab761[_0x16dc('0x14')]?_0x3ab761[_0x16dc('0x14')][_0x16dc('0x16')]||null:null,'attributes':_0x3ab761[_0x16dc('0x14')]?_0x3ab761[_0x16dc('0x14')][_0x16dc('0x17')]||null:null,'include':_0x3ab761[_0x16dc('0x14')]?_0x3ab761['options'][_0x16dc('0x18')]?_[_0x16dc('0x19')](_0x3ab761[_0x16dc('0x14')][_0x16dc('0x18')],function(_0x1ef420){return{'model':db[_0x1ef420[_0x16dc('0x1a')]],'as':_0x1ef420['as'],'attributes':_0x1ef420[_0x16dc('0x17')],'include':_0x1ef420[_0x16dc('0x18')]?_[_0x16dc('0x19')](_0x1ef420[_0x16dc('0x18')],function(_0x3cf51a){return{'model':db[_0x3cf51a[_0x16dc('0x1a')]],'as':_0x3cf51a['as'],'attributes':_0x3cf51a[_0x16dc('0x17')],'include':_0x3cf51a[_0x16dc('0x18')]?_['map'](_0x3cf51a[_0x16dc('0x18')],function(_0x185009){return{'model':db[_0x185009[_0x16dc('0x1a')]],'as':_0x185009['as'],'attributes':_0x185009[_0x16dc('0x17')]};}):[]};}):[]};}):[]:[]})[_0x16dc('0x1b')](function(_0x200ffa){logger[_0x16dc('0xf')]('ShowSetting',_0x3ab761);logger['debug'](_0x16dc('0x1c'),_0x3ab761,JSON['stringify'](_0x200ffa));_0x1d3c8f(_0x200ffa);})['catch'](function(_0x4bb8e8){logger[_0x16dc('0xc')](_0x16dc('0x1c'),_0x4bb8e8[_0x16dc('0xe')],_0x3ab761);_0x2c769c(_0x371bcc[_0x16dc('0xc')](0x1f4,_0x4bb8e8['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 120b9a0..6c224c4 100644 --- a/server/api/smsAccount/index.js +++ b/server/api/smsAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['getInteractions','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/status','status','addAgents','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions'];(function(_0x4ab9f0,_0x548c3c){var _0x364cbc=function(_0x193c1c){while(--_0x193c1c){_0x4ab9f0['push'](_0x4ab9f0['shift']());}};_0x364cbc(++_0x548c3c);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/canned_answers',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x9')](_0x7995('0x14'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router['get']('/:id/status',controller[_0x7995('0x16')]);router[_0x7995('0x9')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x1a')]);router['post'](_0x7995('0xf'),auth['isAuthenticated'](),controller[_0x7995('0x1b')]);router[_0x7995('0x19')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router[_0x7995('0x19')]('/:id/notify',controller['notify']);router[_0x7995('0x19')]('/:id/applications',auth['isAuthenticated'](),controller[_0x7995('0x1e')]);router[_0x7995('0x19')]('/:id/send',auth[_0x7995('0xa')](),controller['send']);router['post'](_0x7995('0x1f'),controller[_0x7995('0x20')]);router[_0x7995('0x19')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x21')]);router['put'](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x23')]);router[_0x7995('0x24')](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x25')]);router[_0x7995('0x24')]('/:id/dispositions',auth[_0x7995('0xa')](),controller[_0x7995('0x26')]);router[_0x7995('0x24')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x27')]);router['delete'](_0x7995('0x17'),auth['isAuthenticated'](),controller[_0x7995('0x28')]);module[_0x7995('0x29')]=router; \ No newline at end of file +var _0x7a54=['getInteractions','/:id/status','statusGet','/:id/users','post','create','addAnswer','/:id/notify','notify','addApplications','send','status','addAgents','put','/:id','update','delete','destroy','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','index','/describe','isAuthenticated','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications'];(function(_0x382d48,_0x21a1de){var _0x414973=function(_0x4bda6a){while(--_0x4bda6a){_0x382d48['push'](_0x382d48['shift']());}};_0x414973(++_0x21a1de);}(_0x7a54,0x106));var _0x47a5=function(_0x5b7f4e,_0x49bcdb){_0x5b7f4e=_0x5b7f4e-0x0;var _0x35fde7=_0x7a54[_0x5b7f4e];return _0x35fde7;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['describe']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/canned_answers',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x9')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x9')]('/:id/interactions',auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);router[_0x47a5('0x9')](_0x47a5('0x13'),controller[_0x47a5('0x14')]);router[_0x47a5('0x9')](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller['getAgents']);router[_0x47a5('0x16')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x17')]);router[_0x47a5('0x16')](_0x47a5('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x47a5('0x16')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x47a5('0x18')]);router[_0x47a5('0x16')](_0x47a5('0x19'),controller[_0x47a5('0x1a')]);router[_0x47a5('0x16')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x1b')]);router[_0x47a5('0x16')]('/:id/send',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1c')]);router['post'](_0x47a5('0x13'),controller[_0x47a5('0x1d')]);router[_0x47a5('0x16')]('/:id/users',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1e')]);router[_0x47a5('0x1f')](_0x47a5('0x20'),auth['isAuthenticated'](),controller[_0x47a5('0x21')]);router[_0x47a5('0x22')]('/:id',auth[_0x47a5('0xc')](),controller[_0x47a5('0x23')]);router[_0x47a5('0x22')](_0x47a5('0xd'),auth[_0x47a5('0xc')](),controller['removeDispositions']);router['delete'](_0x47a5('0x24'),auth['isAuthenticated'](),controller[_0x47a5('0x25')]);router['delete'](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x26')]);module[_0x47a5('0x27')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 3286c3a..4a3cccb 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 _0x17e9=['generate','ENUM','skebby','clicksend','clickatell','bandwidth','csc','infobip','intelepeer','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','name'];(function(_0x4ed239,_0x3bb2d8){var _0x19b898=function(_0x302fe8){while(--_0x302fe8){_0x4ed239['push'](_0x4ed239['shift']());}};_0x19b898(++_0x3bb2d8);}(_0x17e9,0x65));var _0x917e=function(_0x5eddca,_0x5ea850){_0x5eddca=_0x5eddca-0x0;var _0x331a16=_0x17e9[_0x5eddca];return _0x331a16;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x917e('0x0'));module[_0x917e('0x1')]={'name':{'type':Sequelize[_0x917e('0x2')],'unique':_0x917e('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x917e('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x917e('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x917e('0x2')],'defaultValue':function(){return rs[_0x917e('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x917e('0x5')]('twilio',_0x917e('0x6'),'connectel',_0x917e('0x7'),'plivo',_0x917e('0x8'),_0x917e('0x9'),_0x917e('0xa'),_0x917e('0xb'),_0x917e('0xc'))},'accountSid':{'type':Sequelize[_0x917e('0x2')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0x917e('0x5')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x917e('0x2')]},'notificationTemplate':{'type':Sequelize[_0x917e('0xd')],'defaultValue':function(){return _0x917e('0xe');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x917e('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x917e('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x917e('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x917e('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x917e('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x917e('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x917e('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x917e('0x10')],'defaultValue':![],'comment':_0x917e('0x11'),'set':function(_0x1ffab0){if(!_0x1ffab0)this[_0x917e('0x12')](_0x917e('0x13'),null);this[_0x917e('0x12')](_0x917e('0x14'),_0x1ffab0);}}}; \ No newline at end of file +var _0x4391=['plivo','clickatell','csc','ENUM','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','sequelize','exports','STRING','name','generate','skebby','connectel','clicksend'];(function(_0x71c5ef,_0x59967c){var _0x31c2fd=function(_0x3a3b10){while(--_0x3a3b10){_0x71c5ef['push'](_0x71c5ef['shift']());}};_0x31c2fd(++_0x59967c);}(_0x4391,0xac));var _0x1439=function(_0x5ad25f,_0x369844){_0x5ad25f=_0x5ad25f-0x0;var _0x5457c8=_0x4391[_0x5ad25f];return _0x5457c8;};'use strict';var Sequelize=require(_0x1439('0x0'));var rs=require('randomstring');module[_0x1439('0x1')]={'name':{'type':Sequelize[_0x1439('0x2')],'unique':_0x1439('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x1439('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x1439('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x1439('0x4')]();}},'phone':{'type':Sequelize[_0x1439('0x2')]},'type':{'type':Sequelize['ENUM']('twilio',_0x1439('0x5'),_0x1439('0x6'),_0x1439('0x7'),_0x1439('0x8'),_0x1439('0x9'),'bandwidth',_0x1439('0xa'),'infobip','intelepeer')},'accountSid':{'type':Sequelize[_0x1439('0x2')]},'authId':{'type':Sequelize[_0x1439('0x2')]},'authToken':{'type':Sequelize[_0x1439('0x2')]},'smsMethod':{'type':Sequelize[_0x1439('0xb')]('SI','TI','GP')},'username':{'type':Sequelize[_0x1439('0x2')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x1439('0x2')]},'applicationId':{'type':Sequelize[_0x1439('0x2')]},'accountId':{'type':Sequelize[_0x1439('0x2')]},'senderString':{'type':Sequelize[_0x1439('0x2')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x1439('0xc')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x1439('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1439('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1439('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x1439('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x1439('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1439('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1439('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1439('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1439('0xe')],'comment':_0x1439('0xf')},'mandatoryDisposition':{'type':Sequelize[_0x1439('0xd')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x26d914){if(!_0x26d914)this[_0x1439('0x10')](_0x1439('0x11'),null);this[_0x1439('0x10')]('mandatoryDisposition',_0x26d914);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 4ac7379..5191f4a 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 _0x4aca=['connectel','clicksend','plivo','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','text','replyMessageId','bandwidth','refid','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','CmContact','Contacts','DESC','list','omit','contact','SmsInteraction','spread','interaction','created','push','close','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','User','unshift','agent','queueId','SmsQueue','queue','waitForTheAssignedQueue','startRouting','receiveMessage','entity\x20found','stringify','Content-Type','text/xml','send','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','SmsApplication','bulkCreate','findAndCountAll','getApplications','getInteractions','fullname','Tag','Tags','tag','to\x20is\x20mandatory','List','out','SmsMessage','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby','skebby_dispatch_id','statusInt','requestid','message_id','status_code','groupName','DELIVERED','redif','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','intelepeer','ACCEPTD','statusGet','message-id','state','addAgents','emit','removeAgents','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','./smsAccount.socket','register','jayson/promise','http','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','SmsAccounts','UserProfileResource','end','stack','name','index','map','SmsAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','VIRTUAL','merge','include','findAll','rows','params','Pause','mandatoryDispositionPause','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','findOne','hasOwnProperty','nolimit','SmsAccountId','options','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','sms','applications','orderBy','Applications','priority','asc','account','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','messageId','MessageSid'];(function(_0x5ac590,_0x3323d1){var _0x24184f=function(_0x42d19e){while(--_0x42d19e){_0x5ac590['push'](_0x5ac590['shift']());}};_0x24184f(++_0x3323d1);}(_0x4aca,0x149));var _0xa4ac=function(_0x2537be,_0x21ae21){_0x2537be=_0x2537be-0x0;var _0x5955fc=_0x4aca[_0x2537be];return _0x5955fc;};'use strict';var emlformat=require(_0xa4ac('0x0'));var rimraf=require(_0xa4ac('0x1'));var zipdir=require(_0xa4ac('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa4ac('0x3'));var moment=require(_0xa4ac('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa4ac('0x5'));var util=require(_0xa4ac('0x6'));var path=require('path');var sox=require(_0xa4ac('0x7'));var csv=require(_0xa4ac('0x8'));var ejs=require(_0xa4ac('0x9'));var fs=require('fs');var fs_extra=require(_0xa4ac('0xa'));var _=require('lodash');var squel=require(_0xa4ac('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa4ac('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa4ac('0xd'));var Papa=require(_0xa4ac('0xe'));var Redis=require(_0xa4ac('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa4ac('0x10'));var as=require(_0xa4ac('0x11'));var hardwareService=require(_0xa4ac('0x12'));var logger=require('../../config/logger')(_0xa4ac('0x13'));var utils=require(_0xa4ac('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa4ac('0x15'));var db=require(_0xa4ac('0x16'))['db'];config['redis']=_[_0xa4ac('0x17')](config[_0xa4ac('0x18')],{'host':_0xa4ac('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa4ac('0x18')]));require(_0xa4ac('0x1a'))[_0xa4ac('0x1b')](socket);var jayson=require(_0xa4ac('0x1c'));var client=jayson['client'][_0xa4ac('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x518e1a,_0x12ac3f,_0x218852,_0x36e583){return new BPromise(function(_0x137d55,_0x71749){var _0x2f1c53=_0x36e583||client;return _0x2f1c53[_0xa4ac('0x1e')](_0x518e1a,_0x218852)[_0xa4ac('0x1f')](function(_0x132bcc){logger['info'](_0xa4ac('0x20'),_0x12ac3f,_0xa4ac('0x21'));logger[_0xa4ac('0x22')](_0xa4ac('0x23'),_0x12ac3f,'request\x20sent',JSON['stringify'](_0x132bcc));if(_0x132bcc[_0xa4ac('0x24')]){if(_0x132bcc[_0xa4ac('0x24')][_0xa4ac('0x25')]===0x1f4){logger[_0xa4ac('0x24')](_0xa4ac('0x20'),_0x12ac3f,_0x132bcc[_0xa4ac('0x24')][_0xa4ac('0x26')]);return _0x71749(_0x132bcc['error'][_0xa4ac('0x26')]);}logger[_0xa4ac('0x24')](_0xa4ac('0x20'),_0x12ac3f,_0x132bcc[_0xa4ac('0x24')][_0xa4ac('0x26')]);return _0x137d55(_0x132bcc['error'][_0xa4ac('0x26')]);}else{logger[_0xa4ac('0x27')](_0xa4ac('0x20'),_0x12ac3f,_0xa4ac('0x21'));_0x137d55(_0x132bcc['result'][_0xa4ac('0x26')]);}})[_0xa4ac('0x28')](function(_0x3ba76b){logger['error'](_0xa4ac('0x20'),_0x12ac3f,_0x3ba76b);_0x71749(_0x3ba76b);});});}function respondWithStatusCode(_0xadf9a6,_0x4fccfc){_0x4fccfc=_0x4fccfc||0xcc;return function(_0x55eed4){if(_0x55eed4){return _0xadf9a6[_0xa4ac('0x29')](_0x4fccfc);}return _0xadf9a6[_0xa4ac('0x2a')](_0x4fccfc)['end']();};}function respondWithResult(_0x1ead92,_0x42a4b6){_0x42a4b6=_0x42a4b6||0xc8;return function(_0xed4c44){if(_0xed4c44){return _0x1ead92[_0xa4ac('0x2a')](_0x42a4b6)[_0xa4ac('0x2b')](_0xed4c44);}};}function respondWithFilteredResult(_0x5ced5a,_0x51b95e){return function(_0x44d993){if(_0x44d993){var _0x1d7b69=typeof _0x51b95e[_0xa4ac('0x2c')]===_0xa4ac('0x2d')&&typeof _0x51b95e[_0xa4ac('0x2e')]===_0xa4ac('0x2d');var _0xebfb1b=_0x44d993['count'];var _0x239eed=_0x1d7b69?0x0:_0x51b95e[_0xa4ac('0x2c')];var _0x41e31d=_0x1d7b69?_0x44d993[_0xa4ac('0x2f')]:_0x51b95e[_0xa4ac('0x2c')]+_0x51b95e[_0xa4ac('0x2e')];var _0x481308;if(_0x41e31d>=_0xebfb1b){_0x41e31d=_0xebfb1b;_0x481308=0xc8;}else{_0x481308=0xce;}_0x5ced5a['status'](_0x481308);return _0x5ced5a[_0xa4ac('0x30')](_0xa4ac('0x31'),_0x239eed+'-'+_0x41e31d+'/'+_0xebfb1b)[_0xa4ac('0x2b')](_0x44d993);}return null;};}function patchUpdates(_0x20704c){return function(_0x116d29){try{jsonpatch[_0xa4ac('0x32')](_0x116d29,_0x20704c,!![]);}catch(_0x150810){return BPromise[_0xa4ac('0x33')](_0x150810);}return _0x116d29[_0xa4ac('0x34')]();};}function saveUpdates(_0x3af0f0,_0x525fdd){return function(_0x1dd144){if(_0x1dd144){return _0x1dd144[_0xa4ac('0x35')](_0x3af0f0)['then'](function(_0x425015){return _0x425015;});}return null;};}function removeEntity(_0x1f20e5,_0x2f3e33){return function(_0x22699a){if(_0x22699a){return _0x22699a[_0xa4ac('0x36')]()[_0xa4ac('0x1f')](function(){var _0x97e84d=_0x22699a['get']({'plain':!![]});var _0x5cee83=_0xa4ac('0x37');return db[_0xa4ac('0x38')][_0xa4ac('0x36')]({'where':{'type':_0x5cee83,'resourceId':_0x97e84d['id']}})[_0xa4ac('0x1f')](function(){return _0x22699a;});})[_0xa4ac('0x1f')](function(){_0x1f20e5[_0xa4ac('0x2a')](0xcc)[_0xa4ac('0x39')]();});}};}function handleEntityNotFound(_0x354731,_0x715852){return function(_0x43bb93){if(!_0x43bb93){_0x354731[_0xa4ac('0x29')](0x194);}return _0x43bb93;};}function handleError(_0xe18699,_0x2a1b45){_0x2a1b45=_0x2a1b45||0x1f4;return function(_0x305234){logger['error'](_0x305234[_0xa4ac('0x3a')]);if(_0x305234[_0xa4ac('0x3b')]){delete _0x305234['name'];}_0xe18699[_0xa4ac('0x2a')](_0x2a1b45)['send'](_0x305234);};}exports[_0xa4ac('0x3c')]=function(_0x49a6ef,_0x176233){var _0xe03d27={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x506dff={},_0x3c972c={'count':0x0,'rows':[]};var _0xa41f47=_[_0xa4ac('0x3d')](db[_0xa4ac('0x3e')][_0xa4ac('0x3f')],function(_0x4a70de){return{'name':_0x4a70de[_0xa4ac('0x40')],'type':_0x4a70de[_0xa4ac('0x41')][_0xa4ac('0x42')]};});_0x506dff[_0xa4ac('0x43')]=_[_0xa4ac('0x3d')](_0xa41f47,_0xa4ac('0x3b'));_0x506dff[_0xa4ac('0x44')]=_[_0xa4ac('0x45')](_0x49a6ef[_0xa4ac('0x44')]);_0x506dff[_0xa4ac('0x46')]=_[_0xa4ac('0x47')](_0x506dff[_0xa4ac('0x43')],_0x506dff[_0xa4ac('0x44')]);_0xe03d27[_0xa4ac('0x48')]=_[_0xa4ac('0x47')](_0x506dff[_0xa4ac('0x43')],qs[_0xa4ac('0x49')](_0x49a6ef[_0xa4ac('0x44')][_0xa4ac('0x49')]));_0xe03d27[_0xa4ac('0x48')]=_0xe03d27[_0xa4ac('0x48')][_0xa4ac('0x4a')]?_0xe03d27[_0xa4ac('0x48')]:_0x506dff[_0xa4ac('0x43')];if(!_0x49a6ef[_0xa4ac('0x44')]['hasOwnProperty']('nolimit')){_0xe03d27[_0xa4ac('0x2e')]=qs['limit'](_0x49a6ef[_0xa4ac('0x44')][_0xa4ac('0x2e')]);_0xe03d27[_0xa4ac('0x2c')]=qs[_0xa4ac('0x2c')](_0x49a6ef[_0xa4ac('0x44')]['offset']);}_0xe03d27[_0xa4ac('0x4b')]=qs[_0xa4ac('0x4c')](_0x49a6ef[_0xa4ac('0x44')]['sort']);_0xe03d27[_0xa4ac('0x4d')]=qs[_0xa4ac('0x46')](_[_0xa4ac('0x4e')](_0x49a6ef[_0xa4ac('0x44')],_0x506dff[_0xa4ac('0x46')]),_0xa41f47);if(_0x49a6ef[_0xa4ac('0x44')][_0xa4ac('0x4f')]){_0xe03d27[_0xa4ac('0x4d')]=_['merge'](_0xe03d27[_0xa4ac('0x4d')],{'$or':_[_0xa4ac('0x3d')](_0xa41f47,function(_0x1f24fa){if(_0x1f24fa[_0xa4ac('0x41')]!==_0xa4ac('0x50')){var _0x23eec6={};_0x23eec6[_0x1f24fa['name']]={'$like':'%'+_0x49a6ef[_0xa4ac('0x44')]['filter']+'%'};return _0x23eec6;}})});}_0xe03d27=_[_0xa4ac('0x51')]({},_0xe03d27,_0x49a6ef['options']);var _0x1dc45e={'where':_0xe03d27[_0xa4ac('0x4d')]};return db[_0xa4ac('0x3e')][_0xa4ac('0x2f')](_0x1dc45e)['then'](function(_0x104087){_0x3c972c[_0xa4ac('0x2f')]=_0x104087;if(_0x49a6ef['query']['includeAll']){_0xe03d27[_0xa4ac('0x52')]=[{'all':!![]}];}return db['SmsAccount'][_0xa4ac('0x53')](_0xe03d27);})[_0xa4ac('0x1f')](function(_0x4f3e74){_0x3c972c[_0xa4ac('0x54')]=_0x4f3e74;return _0x3c972c;})[_0xa4ac('0x1f')](respondWithFilteredResult(_0x176233,_0xe03d27))[_0xa4ac('0x28')](handleError(_0x176233,null));};exports['show']=function(_0x5d3730,_0x475409){var _0x1bdda5={'raw':![],'where':{'id':_0x5d3730[_0xa4ac('0x55')]['id']},'include':[{'model':db[_0xa4ac('0x56')],'as':_0xa4ac('0x57')}]},_0x9ec21b={};_0x9ec21b[_0xa4ac('0x43')]=_[_0xa4ac('0x45')](db[_0xa4ac('0x3e')]['rawAttributes']);_0x9ec21b['query']=_[_0xa4ac('0x45')](_0x5d3730['query']);_0x9ec21b[_0xa4ac('0x46')]=_['intersection'](_0x9ec21b['model'],_0x9ec21b[_0xa4ac('0x44')]);_0x1bdda5[_0xa4ac('0x48')]=_[_0xa4ac('0x47')](_0x9ec21b['model'],qs[_0xa4ac('0x49')](_0x5d3730[_0xa4ac('0x44')][_0xa4ac('0x49')]));_0x1bdda5['attributes']=_0x1bdda5[_0xa4ac('0x48')]['length']?_0x1bdda5['attributes']:_0x9ec21b[_0xa4ac('0x43')];if(_0x5d3730[_0xa4ac('0x44')][_0xa4ac('0x58')]){_0x1bdda5[_0xa4ac('0x52')]=[{'all':!![]}];}_0x1bdda5=_['merge']({},_0x1bdda5,_0x5d3730['options']);return db[_0xa4ac('0x3e')]['find'](_0x1bdda5)[_0xa4ac('0x1f')](handleEntityNotFound(_0x475409,null))[_0xa4ac('0x1f')](respondWithResult(_0x475409,null))[_0xa4ac('0x28')](handleError(_0x475409,null));};exports[_0xa4ac('0x59')]=function(_0x3b625f,_0x3507e4){return db['SmsAccount'][_0xa4ac('0x59')](_0x3b625f[_0xa4ac('0x5a')],{})['then'](function(_0x5b7331){var _0x277add=_0x3b625f[_0xa4ac('0x5b')]['get']({'plain':!![]});if(!_0x277add)throw new Error(_0xa4ac('0x5c'));if(_0x277add[_0xa4ac('0x5d')]==='user'){var _0x119bbf=_0x5b7331[_0xa4ac('0x5e')]({'plain':!![]});var _0x5d0320=_0xa4ac('0x37');return db['UserProfileSection'][_0xa4ac('0x5f')]({'where':{'name':_0x5d0320,'userProfileId':_0x277add[_0xa4ac('0x60')]},'raw':!![]})[_0xa4ac('0x1f')](function(_0xdea79a){if(_0xdea79a&&_0xdea79a[_0xa4ac('0x61')]===0x0){return db[_0xa4ac('0x38')][_0xa4ac('0x59')]({'name':_0x119bbf[_0xa4ac('0x3b')],'resourceId':_0x119bbf['id'],'type':_0xdea79a[_0xa4ac('0x3b')],'sectionId':_0xdea79a['id']},{})[_0xa4ac('0x1f')](function(){return _0x5b7331;});}else{return _0x5b7331;}})[_0xa4ac('0x28')](function(_0x355026){logger['error'](_0xa4ac('0x62'),_0x355026);throw _0x355026;});}return _0x5b7331;})[_0xa4ac('0x1f')](respondWithResult(_0x3507e4,0xc9))[_0xa4ac('0x28')](handleError(_0x3507e4,null));};exports['update']=function(_0x280f92,_0x119814){if(_0x280f92['body']['id']){delete _0x280f92[_0xa4ac('0x5a')]['id'];}return db['SmsAccount'][_0xa4ac('0x5f')]({'where':{'id':_0x280f92[_0xa4ac('0x55')]['id']},'include':[{'model':db['Pause'],'as':_0xa4ac('0x57')}]})[_0xa4ac('0x1f')](handleEntityNotFound(_0x119814,null))[_0xa4ac('0x1f')](saveUpdates(_0x280f92['body'],null))[_0xa4ac('0x1f')](respondWithResult(_0x119814,null))[_0xa4ac('0x28')](handleError(_0x119814,null));};exports[_0xa4ac('0x36')]=function(_0x46b47a,_0x9fc118){return db[_0xa4ac('0x3e')]['find']({'where':{'id':_0x46b47a['params']['id']}})[_0xa4ac('0x1f')](handleEntityNotFound(_0x9fc118,null))[_0xa4ac('0x1f')](removeEntity(_0x9fc118,null))[_0xa4ac('0x28')](handleError(_0x9fc118,null));};exports[_0xa4ac('0x63')]=function(_0xdfed0d,_0x55299d){return db[_0xa4ac('0x3e')]['describe']()['then'](respondWithResult(_0x55299d,null))[_0xa4ac('0x28')](handleError(_0x55299d,null));};exports[_0xa4ac('0x64')]=function(_0x36b431,_0x467ddd,_0x1ba7a1){if(_0x36b431[_0xa4ac('0x5a')]['id']){delete _0x36b431[_0xa4ac('0x5a')]['id'];}return db[_0xa4ac('0x3e')][_0xa4ac('0x5f')]({'where':{'id':_0x36b431[_0xa4ac('0x55')]['id']}})['then'](handleEntityNotFound(_0x467ddd,null))['then'](function(_0x318c6d){if(_0x318c6d){_0x36b431[_0xa4ac('0x5a')]['SmsAccountId']=_0x318c6d['id'];return db[_0xa4ac('0x65')]['create'](_0x36b431[_0xa4ac('0x5a')]);}})[_0xa4ac('0x1f')](respondWithResult(_0x467ddd,null))['catch'](handleError(_0x467ddd,null));};exports['getDispositions']=function(_0x57a042,_0x3bb78e,_0x2b42d1){var _0x510ad8={'raw':![],'where':{}};var _0x581dd2={};var _0x2eafd0={'count':0x0,'rows':[]};return db['SmsAccount'][_0xa4ac('0x66')]({'where':{'id':_0x57a042['params']['id']}})['then'](handleEntityNotFound(_0x3bb78e,null))[_0xa4ac('0x1f')](function(_0x552728){if(_0x552728){_0x581dd2[_0xa4ac('0x43')]=_['keys'](db[_0xa4ac('0x65')][_0xa4ac('0x3f')]);_0x581dd2[_0xa4ac('0x44')]=_[_0xa4ac('0x45')](_0x57a042[_0xa4ac('0x44')]);_0x581dd2[_0xa4ac('0x46')]=_[_0xa4ac('0x47')](_0x581dd2[_0xa4ac('0x43')],_0x581dd2['query']);_0x510ad8[_0xa4ac('0x48')]=_[_0xa4ac('0x47')](_0x581dd2[_0xa4ac('0x43')],qs[_0xa4ac('0x49')](_0x57a042[_0xa4ac('0x44')]['fields']));_0x510ad8['attributes']=_0x510ad8[_0xa4ac('0x48')][_0xa4ac('0x4a')]?_0x510ad8[_0xa4ac('0x48')]:_0x581dd2[_0xa4ac('0x43')];if(!_0x57a042['query'][_0xa4ac('0x67')](_0xa4ac('0x68'))){_0x510ad8[_0xa4ac('0x2e')]=qs[_0xa4ac('0x2e')](_0x57a042[_0xa4ac('0x44')][_0xa4ac('0x2e')]);_0x510ad8[_0xa4ac('0x2c')]=qs['offset'](_0x57a042[_0xa4ac('0x44')][_0xa4ac('0x2c')]);}_0x510ad8[_0xa4ac('0x4b')]=qs['sort'](_0x57a042[_0xa4ac('0x44')][_0xa4ac('0x4c')]);_0x510ad8[_0xa4ac('0x4d')]=qs[_0xa4ac('0x46')](_[_0xa4ac('0x4e')](_0x57a042['query'],_0x581dd2[_0xa4ac('0x46')]));_0x510ad8[_0xa4ac('0x4d')][_0xa4ac('0x69')]=_0x552728['id'];if(_0x57a042[_0xa4ac('0x44')]['filter']){_0x510ad8['where']=_['merge'](_0x510ad8[_0xa4ac('0x4d')],{'$or':_[_0xa4ac('0x3d')](_0x510ad8[_0xa4ac('0x48')],function(_0x2c1d8f){var _0x3d1bf2={};_0x3d1bf2[_0x2c1d8f]={'$like':'%'+_0x57a042['query']['filter']+'%'};return _0x3d1bf2;})});}_0x510ad8=_[_0xa4ac('0x51')]({},_0x510ad8,_0x57a042[_0xa4ac('0x6a')]);return db[_0xa4ac('0x65')][_0xa4ac('0x2f')]({'where':_0x510ad8[_0xa4ac('0x4d')]})[_0xa4ac('0x1f')](function(_0x5b628f){_0x2eafd0[_0xa4ac('0x2f')]=_0x5b628f;if(_0x57a042[_0xa4ac('0x44')]['includeAll']){_0x510ad8['include']=[{'all':!![]}];}return db[_0xa4ac('0x65')][_0xa4ac('0x53')](_0x510ad8);})[_0xa4ac('0x1f')](function(_0x1025d7){_0x2eafd0[_0xa4ac('0x54')]=_0x1025d7;return _0x2eafd0;});}})[_0xa4ac('0x1f')](respondWithFilteredResult(_0x3bb78e,_0x510ad8))[_0xa4ac('0x28')](handleError(_0x3bb78e,null));};exports[_0xa4ac('0x6b')]=function(_0x567dd4,_0x435d2c,_0x3b2b70){return db[_0xa4ac('0x3e')][_0xa4ac('0x5f')]({'where':{'id':_0x567dd4['params']['id']}})['then'](handleEntityNotFound(_0x435d2c,null))[_0xa4ac('0x1f')](function(_0x156f9f){if(_0x156f9f){return _0x156f9f['removeDispositions'](_0x567dd4[_0xa4ac('0x44')][_0xa4ac('0x6c')]);}})[_0xa4ac('0x1f')](respondWithStatusCode(_0x435d2c,null))[_0xa4ac('0x28')](handleError(_0x435d2c,null));};exports[_0xa4ac('0x6d')]=function(_0x62b8eb,_0xa3242f,_0x3c4ea6){if(_0x62b8eb[_0xa4ac('0x5a')]['id']){delete _0x62b8eb[_0xa4ac('0x5a')]['id'];}return db[_0xa4ac('0x3e')][_0xa4ac('0x5f')]({'where':{'id':_0x62b8eb[_0xa4ac('0x55')]['id']}})['then'](handleEntityNotFound(_0xa3242f,null))[_0xa4ac('0x1f')](function(_0x218e52){if(_0x218e52){_0x62b8eb[_0xa4ac('0x5a')]['SmsAccountId']=_0x218e52['id'];return db[_0xa4ac('0x6e')][_0xa4ac('0x59')](_0x62b8eb['body']);}})['then'](respondWithResult(_0xa3242f,null))[_0xa4ac('0x28')](handleError(_0xa3242f,null));};exports[_0xa4ac('0x6f')]=function(_0x28082a,_0x5930d3,_0x2199b1){var _0x1c34b1={'raw':![],'where':{}};var _0x6f6c04={};var _0x49f50b={'count':0x0,'rows':[]};return db[_0xa4ac('0x3e')][_0xa4ac('0x66')]({'where':{'id':_0x28082a['params']['id']}})[_0xa4ac('0x1f')](handleEntityNotFound(_0x5930d3,null))[_0xa4ac('0x1f')](function(_0x27a53c){if(_0x27a53c){_0x6f6c04[_0xa4ac('0x43')]=_[_0xa4ac('0x45')](db[_0xa4ac('0x6e')][_0xa4ac('0x3f')]);_0x6f6c04[_0xa4ac('0x44')]=_[_0xa4ac('0x45')](_0x28082a[_0xa4ac('0x44')]);_0x6f6c04[_0xa4ac('0x46')]=_[_0xa4ac('0x47')](_0x6f6c04[_0xa4ac('0x43')],_0x6f6c04[_0xa4ac('0x44')]);_0x1c34b1[_0xa4ac('0x48')]=_[_0xa4ac('0x47')](_0x6f6c04[_0xa4ac('0x43')],qs['fields'](_0x28082a[_0xa4ac('0x44')][_0xa4ac('0x49')]));_0x1c34b1[_0xa4ac('0x48')]=_0x1c34b1[_0xa4ac('0x48')][_0xa4ac('0x4a')]?_0x1c34b1[_0xa4ac('0x48')]:_0x6f6c04[_0xa4ac('0x43')];if(!_0x28082a['query'][_0xa4ac('0x67')](_0xa4ac('0x68'))){_0x1c34b1[_0xa4ac('0x2e')]=qs[_0xa4ac('0x2e')](_0x28082a[_0xa4ac('0x44')][_0xa4ac('0x2e')]);_0x1c34b1[_0xa4ac('0x2c')]=qs[_0xa4ac('0x2c')](_0x28082a['query'][_0xa4ac('0x2c')]);}_0x1c34b1[_0xa4ac('0x4b')]=qs[_0xa4ac('0x4c')](_0x28082a[_0xa4ac('0x44')][_0xa4ac('0x4c')]);_0x1c34b1[_0xa4ac('0x4d')]=qs[_0xa4ac('0x46')](_['pick'](_0x28082a[_0xa4ac('0x44')],_0x6f6c04[_0xa4ac('0x46')]));_0x1c34b1[_0xa4ac('0x4d')][_0xa4ac('0x69')]=_0x27a53c['id'];if(_0x28082a['query']['filter']){_0x1c34b1['where']=_[_0xa4ac('0x51')](_0x1c34b1[_0xa4ac('0x4d')],{'$or':_[_0xa4ac('0x3d')](_0x1c34b1[_0xa4ac('0x48')],function(_0x5437b6){var _0x136d25={};_0x136d25[_0x5437b6]={'$like':'%'+_0x28082a[_0xa4ac('0x44')]['filter']+'%'};return _0x136d25;})});}_0x1c34b1=_[_0xa4ac('0x51')]({},_0x1c34b1,_0x28082a['options']);return db[_0xa4ac('0x6e')][_0xa4ac('0x2f')]({'where':_0x1c34b1[_0xa4ac('0x4d')]})[_0xa4ac('0x1f')](function(_0x312948){_0x49f50b[_0xa4ac('0x2f')]=_0x312948;if(_0x28082a[_0xa4ac('0x44')]['includeAll']){_0x1c34b1[_0xa4ac('0x52')]=[{'all':!![]}];}return db[_0xa4ac('0x6e')][_0xa4ac('0x53')](_0x1c34b1);})[_0xa4ac('0x1f')](function(_0x13e74a){_0x49f50b[_0xa4ac('0x54')]=_0x13e74a;return _0x49f50b;});}})[_0xa4ac('0x1f')](respondWithFilteredResult(_0x5930d3,_0x1c34b1))[_0xa4ac('0x28')](handleError(_0x5930d3,null));};exports[_0xa4ac('0x70')]=function(_0x42639a,_0xceca77,_0x49efad){return db['SmsAccount'][_0xa4ac('0x5f')]({'where':{'id':_0x42639a[_0xa4ac('0x55')]['id']}})['then'](handleEntityNotFound(_0xceca77,null))[_0xa4ac('0x1f')](function(_0x11f67b){if(_0x11f67b){return _0x11f67b[_0xa4ac('0x70')](_0x42639a[_0xa4ac('0x44')][_0xa4ac('0x6c')]);}})['then'](respondWithStatusCode(_0xceca77,null))['catch'](handleError(_0xceca77,null));};exports[_0xa4ac('0x71')]=function(_0x5e4cef,_0x4cf0ed,_0x404cbc){var _0x1e7c6d={'channel':_0xa4ac('0x72')};var _0x35b62b=[];var _0x298f30=[];var _0xd52ba={};return db['SmsAccount']['find']({'where':{'id':_0x5e4cef['params']['id']},'include':[{'model':db['SmsApplication'],'as':'Applications'}]})[_0xa4ac('0x1f')](handleEntityNotFound(_0x4cf0ed,null))[_0xa4ac('0x1f')](function(_0x2bce2c){_0x1e7c6d['account']=_0x2bce2c;_0x1e7c6d[_0xa4ac('0x73')]=_[_0xa4ac('0x74')](_0x2bce2c[_0xa4ac('0x75')],[_0xa4ac('0x76')],[_0xa4ac('0x77')]);if(_0x1e7c6d[_0xa4ac('0x78')][_0xa4ac('0x75')]){delete _0x1e7c6d[_0xa4ac('0x78')][_0xa4ac('0x75')];}return db['CmContact'][_0xa4ac('0x63')]();})['then'](function(_0x43f1c1){if(!_0x43f1c1){throw new db[(_0xa4ac('0x79'))][(_0xa4ac('0x7a'))](_0xa4ac('0x7b'));}_0x35b62b=_[_0xa4ac('0x7c')](_['keys'](_0x43f1c1),[_0xa4ac('0x7d'),_0xa4ac('0x7e')]);_0x298f30=_['difference'](_['keys'](_0x43f1c1),['createdAt',_0xa4ac('0x7e'),_0xa4ac('0x7f'),_0xa4ac('0x80')]);_0x1e7c6d[_0xa4ac('0x5a')]={'mapKey':_0xa4ac('0x81')};if(_0x1e7c6d[_0xa4ac('0x78')][_0xa4ac('0x41')]){switch(_0x1e7c6d[_0xa4ac('0x78')][_0xa4ac('0x41')]){case _0xa4ac('0x82'):_0x1e7c6d[_0xa4ac('0x5a')][_0xa4ac('0x83')]=_0x5e4cef['body'][_0xa4ac('0x84')];_0x1e7c6d[_0xa4ac('0x5a')][_0xa4ac('0x5a')]=_0x5e4cef[_0xa4ac('0x5a')]['Body'];_0x1e7c6d[_0xa4ac('0x5a')][_0xa4ac('0x85')]=_0x5e4cef[_0xa4ac('0x5a')][_0xa4ac('0x86')];break;case'skebby':_0x1e7c6d['body'][_0xa4ac('0x83')]='+'+_0x5e4cef['body']['sender'];_0x1e7c6d['body'][_0xa4ac('0x5a')]=_0x5e4cef[_0xa4ac('0x5a')]['text'];break;case _0xa4ac('0x87'):_0x1e7c6d['body']['from']=_0x5e4cef['body'][_0xa4ac('0x83')];_0x1e7c6d[_0xa4ac('0x5a')][_0xa4ac('0x5a')]=_0x5e4cef[_0xa4ac('0x5a')][_0xa4ac('0x26')];break;case _0xa4ac('0x88'):_0x1e7c6d[_0xa4ac('0x5a')]['from']=_0x5e4cef[_0xa4ac('0x5a')][_0xa4ac('0x83')];_0x1e7c6d[_0xa4ac('0x5a')][_0xa4ac('0x5a')]=_0x5e4cef[_0xa4ac('0x5a')][_0xa4ac('0x5a')];_0x1e7c6d[_0xa4ac('0x5a')][_0xa4ac('0x85')]=_0x5e4cef[_0xa4ac('0x5a')]['message_id'];break;case _0xa4ac('0x89'):_0x1e7c6d['body']['from']=_0x5e4cef[_0xa4ac('0x5a')][_0xa4ac('0x84')];_0x1e7c6d[_0xa4ac('0x5a')][_0xa4ac('0x5a')]=_0x5e4cef[_0xa4ac('0x5a')]['Text'];_0x1e7c6d['body'][_0xa4ac('0x85')]=_0x5e4cef[_0xa4ac('0x5a')][_0xa4ac('0x8a')];break;case _0xa4ac('0x8b'):_0x1e7c6d[_0xa4ac('0x5a')][_0xa4ac('0x83')]='+'+_0x5e4cef[_0xa4ac('0x5a')][_0xa4ac('0x8c')][0x0][_0xa4ac('0x83')];_0x1e7c6d[_0xa4ac('0x5a')][_0xa4ac('0x5a')]=_0x5e4cef[_0xa4ac('0x5a')]['results'][0x0]['text'];_0x1e7c6d[_0xa4ac('0x5a')][_0xa4ac('0x85')]=_0x5e4cef[_0xa4ac('0x5a')][_0xa4ac('0x8c')][0x0][_0xa4ac('0x85')];break;case _0xa4ac('0x8d'):_0x1e7c6d[_0xa4ac('0x5a')][_0xa4ac('0x83')]=_0x5e4cef['body'][_0xa4ac('0x8e')];_0x1e7c6d['body'][_0xa4ac('0x5a')]=_0x5e4cef[_0xa4ac('0x5a')][_0xa4ac('0x8f')][_0xa4ac('0x26')];break;case _0xa4ac('0x90'):_0x1e7c6d['body'][_0xa4ac('0x83')]=_0x5e4cef[_0xa4ac('0x5a')][_0xa4ac('0x91')];_0x1e7c6d[_0xa4ac('0x5a')][_0xa4ac('0x5a')]=_0x5e4cef[_0xa4ac('0x5a')][_0xa4ac('0x92')];_0x1e7c6d[_0xa4ac('0x5a')][_0xa4ac('0x85')]=_0x5e4cef['body'][_0xa4ac('0x93')];break;case _0xa4ac('0x94'):_0x1e7c6d[_0xa4ac('0x5a')][_0xa4ac('0x85')]=_0x5e4cef['body'][0x0][_0xa4ac('0x26')]['id'];_0x1e7c6d[_0xa4ac('0x5a')]['from']=_0x5e4cef['body'][0x0][_0xa4ac('0x26')][_0xa4ac('0x83')];_0x1e7c6d[_0xa4ac('0x5a')][_0xa4ac('0x5a')]=_0x5e4cef[_0xa4ac('0x5a')][0x0]['message']['text'];break;case'intelepeer':_0x1e7c6d['body'][_0xa4ac('0x83')]=_0x5e4cef[_0xa4ac('0x5a')][_0xa4ac('0x83')];_0x1e7c6d[_0xa4ac('0x5a')][_0xa4ac('0x5a')]=_0x5e4cef[_0xa4ac('0x5a')][_0xa4ac('0x26')];_0x1e7c6d[_0xa4ac('0x5a')][_0xa4ac('0x85')]=_0x5e4cef[_0xa4ac('0x5a')][_0xa4ac('0x95')];break;}}if(_0x1e7c6d['body']['id']){delete _0x1e7c6d[_0xa4ac('0x5a')]['id'];}if(_[_0xa4ac('0x96')](_0x1e7c6d[_0xa4ac('0x5a')][_0xa4ac('0x83')])){throw new db[(_0xa4ac('0x79'))][(_0xa4ac('0x7a'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x1e7c6d['body'][_0xa4ac('0x5a')])||_0x1e7c6d[_0xa4ac('0x5a')][_0xa4ac('0x5a')]===''){throw new db[(_0xa4ac('0x79'))]['ValidationError'](_0xa4ac('0x97'));}if(_[_0xa4ac('0x96')](_0x1e7c6d[_0xa4ac('0x5a')]['mapKey'])){throw new db[(_0xa4ac('0x79'))]['ValidationError'](_0xa4ac('0x98')+_0x298f30);}if(!_[_0xa4ac('0x99')](_0x298f30,_0x1e7c6d[_0xa4ac('0x5a')]['mapKey'])){throw new db[(_0xa4ac('0x79'))]['ValidationError'](_0xa4ac('0x9a')+_0x298f30);}_0xd52ba[_0x1e7c6d[_0xa4ac('0x5a')][_0xa4ac('0x9b')]]=_0x1e7c6d[_0xa4ac('0x5a')][_0xa4ac('0x83')];return db[_0xa4ac('0x9c')][_0xa4ac('0x5f')]({'where':{'id':_0x1e7c6d[_0xa4ac('0x78')]['ListId']},'include':[{'model':db[_0xa4ac('0x9d')],'as':_0xa4ac('0x9e'),'where':_0xd52ba,'limit':0x1,'order':[[_0xa4ac('0x7e'),_0xa4ac('0x9f')]]}]});})[_0xa4ac('0x1f')](handleEntityNotFound(_0x4cf0ed,null))[_0xa4ac('0x1f')](function(_0x3015cd){if(_0x3015cd){_0x1e7c6d[_0xa4ac('0xa0')]=_[_0xa4ac('0xa1')](_0x3015cd,[_0xa4ac('0x9e')]);if(_0x3015cd[_0xa4ac('0x9e')][_0xa4ac('0x4a')]){return _0x3015cd[_0xa4ac('0x9e')][0x0];}var _0x561642=_[_0xa4ac('0x17')](_0x1e7c6d['body'],{'firstName':_0x1e7c6d[_0xa4ac('0x5a')][_0xa4ac('0x83')],'ListId':_0x3015cd['id']});_0x561642[_0x1e7c6d['body'][_0xa4ac('0x9b')]]=_0x1e7c6d['body']['from'];return db[_0xa4ac('0x9d')][_0xa4ac('0x59')](_0x561642,{'fields':_0x35b62b,'raw':!![]});}})[_0xa4ac('0x1f')](handleEntityNotFound(_0x4cf0ed,null))[_0xa4ac('0x1f')](function(_0x486f0d){if(_0x486f0d){_0x1e7c6d[_0xa4ac('0xa2')]=_0x486f0d;var _0x421968={'ContactId':_0x486f0d['id'],'phone':_0x1e7c6d['body'][_0xa4ac('0x83')],'SmsAccountId':_0x5e4cef['params']['id']};var _0x184aa7={'ContactId':_0x486f0d['id'],'SmsAccountId':_0x5e4cef[_0xa4ac('0x55')]['id'],'closed':![]};return db[_0xa4ac('0xa3')][_0xa4ac('0x5f')]({'where':_0x184aa7})[_0xa4ac('0x1f')](function(_0x5569fa){if(_0x5569fa){return[_0x5569fa,![]];}return db['SmsInteraction'][_0xa4ac('0x59')](_0x421968)[_0xa4ac('0x1f')](function(_0xcf4829){return[_0xcf4829,!![]];});});}})[_0xa4ac('0xa4')](function(_0x2010cc,_0x588bf6){_0x1e7c6d[_0xa4ac('0xa5')]=_0x2010cc[_0xa4ac('0x5e')]({'plain':!![]});_0x1e7c6d['interaction'][_0xa4ac('0xa6')]=![];if(_0x588bf6){if(_0x1e7c6d[_0xa4ac('0x78')]['autoclose']){_0x1e7c6d[_0xa4ac('0x73')][_0xa4ac('0xa7')]({'id':0x0,'priority':_0x1e7c6d[_0xa4ac('0x73')][_0xa4ac('0x4a')]+0x1,'app':_0xa4ac('0xa8'),'appdata':_0xa4ac('0xa9'),'interval':_0xa4ac('0xaa')});}_0x1e7c6d[_0xa4ac('0xa5')][_0xa4ac('0xa6')]=!![];}return db['SmsMessage'][_0xa4ac('0x59')]({'phone':_0x1e7c6d[_0xa4ac('0x5a')][_0xa4ac('0x83')],'messageId':_0x1e7c6d['body'][_0xa4ac('0x85')],'body':_0x1e7c6d[_0xa4ac('0x5a')][_0xa4ac('0x5a')],'SmsAccountId':_0x5e4cef['params']['id'],'SmsInteractionId':_0x2010cc['id'],'direction':'in','ContactId':_0x2010cc[_0xa4ac('0xab')],'AttachmentId':_0x1e7c6d[_0xa4ac('0x5a')][_0xa4ac('0xac')]});})[_0xa4ac('0x1f')](function(_0x31b321){_0x1e7c6d['message']=_0x31b321;if(!_0x1e7c6d['interaction'][_0xa4ac('0xad')])return;return db[_0xa4ac('0xae')][_0xa4ac('0x5f')]({'attributes':['id',_0xa4ac('0x3b')],'where':{'id':_0x1e7c6d[_0xa4ac('0xa5')][_0xa4ac('0xad')]}});})[_0xa4ac('0x1f')](function(_0x49e603){if(_0x49e603){_0x1e7c6d['applications'][_0xa4ac('0xaf')]({'id':0x0,'priority':0x0,'app':_0xa4ac('0xb0'),'appdata':_0x49e603['name']+','+(_0x1e7c6d[_0xa4ac('0x78')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}if(!_0x1e7c6d[_0xa4ac('0xa5')][_0xa4ac('0xb1')])return;return db[_0xa4ac('0xb2')][_0xa4ac('0x5f')]({'attributes':['id',_0xa4ac('0x3b')],'where':{'id':_0x1e7c6d[_0xa4ac('0xa5')][_0xa4ac('0xb1')]}});})['then'](function(_0x4b4923){if(_0x4b4923){_0x1e7c6d[_0xa4ac('0x73')]['unshift']({'id':0x0,'priority':0x1,'app':_0xa4ac('0xb3'),'appdata':_0x4b4923['name']+','+(_0x1e7c6d[_0xa4ac('0x78')][_0xa4ac('0xb4')]||0x12c),'interval':_0xa4ac('0xaa')});}return respondWithRpcPromise('Start',_0xa4ac('0xb5'),_0x1e7c6d);})['then'](function(_0x521ef3){if(_0x521ef3){var _0x55cff3=0xc8;var _0x242bae=_0xa4ac('0xb6');logger['info']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x242bae,_0x55cff3,'entity\x20found');logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x242bae,_0x55cff3,_0xa4ac('0xb7'),JSON[_0xa4ac('0xb8')](_0x521ef3));if(_0x1e7c6d['account'][_0xa4ac('0x41')]===_0xa4ac('0x82')){return _0x4cf0ed[_0xa4ac('0x2a')](_0x55cff3)[_0xa4ac('0x30')](_0xa4ac('0xb9'),_0xa4ac('0xba'))[_0xa4ac('0xbb')]('\x0a');}else{return _0x4cf0ed[_0xa4ac('0x2a')](_0x55cff3)[_0xa4ac('0x2b')](_0x521ef3);}}})[_0xa4ac('0x28')](handleError(_0x4cf0ed,null));};exports[_0xa4ac('0xbc')]=function(_0x3ca36a,_0x15e2c8){var _0x2f4080=_0x3ca36a['params']['id'];var _0x461ad3=_0x3ca36a['body'];var _0x44178f=0xc8;var _0x2e2603=null;return db['sequelize'][_0xa4ac('0xbd')]({'isolationLevel':db[_0xa4ac('0xbe')][_0xa4ac('0xbf')][_0xa4ac('0xc0')]['READ_COMMITTED']},function(_0x3cc95d){return db[_0xa4ac('0x3e')][_0xa4ac('0x66')]({'where':{'id':_0x2f4080},'transaction':_0x3cc95d})[_0xa4ac('0x1f')](function(_0x1b94d7){if(_0x1b94d7){return db['SmsApplication'][_0xa4ac('0x36')]({'where':{'SmsAccountId':_0x2f4080},'transaction':_0x3cc95d})['then'](function(){var _0x3e1bc8=_[_0xa4ac('0x3d')](_0x461ad3,function(_0x373198){_0x373198['SmsAccountId']=_0x2f4080;return _0x373198;});return db[_0xa4ac('0xc1')][_0xa4ac('0xc2')](_0x3e1bc8,{'transaction':_0x3cc95d});});}else{_0x44178f=0x194;_0x2e2603=[];}});})[_0xa4ac('0x1f')](function(){if(_0x44178f!==0x194){return db[_0xa4ac('0xc1')][_0xa4ac('0xc3')]({'where':{'SmsAccountId':_0x2f4080},'order':_0xa4ac('0x76')})[_0xa4ac('0x1f')](function(_0x32e1f0){_0x2e2603=_0x32e1f0;});}})[_0xa4ac('0x28')](function(_0x382334){_0x44178f=0x1f4;logger[_0xa4ac('0x24')](_0x382334[_0xa4ac('0x3a')]);if(_0x382334[_0xa4ac('0x3b')]){delete _0x382334[_0xa4ac('0x3b')];}_0x2e2603=_0x382334;})['finally'](function(){if(_0x2e2603===null){_0x15e2c8['sendStatus'](_0x44178f);}else{if(_0x44178f===0x1f4){_0x15e2c8[_0xa4ac('0x2a')](_0x44178f)['send'](_0x2e2603);}else{_0x15e2c8['status'](_0x44178f)[_0xa4ac('0x2b')](_0x2e2603);}}});};exports[_0xa4ac('0xc4')]=function(_0x141a99,_0xf9eb31,_0x31638e){var _0x235a4e={};var _0x5143ae={};var _0x298730;var _0x1b3324;return db[_0xa4ac('0x3e')][_0xa4ac('0x66')]({'where':{'id':_0x141a99[_0xa4ac('0x55')]['id']}})[_0xa4ac('0x1f')](handleEntityNotFound(_0xf9eb31,null))['then'](function(_0x33f4fb){if(_0x33f4fb){_0x298730=_0x33f4fb;_0x5143ae['model']=_[_0xa4ac('0x45')](db[_0xa4ac('0xc1')][_0xa4ac('0x3f')]);_0x5143ae['query']=_[_0xa4ac('0x45')](_0x141a99[_0xa4ac('0x44')]);_0x5143ae[_0xa4ac('0x46')]=_[_0xa4ac('0x47')](_0x5143ae[_0xa4ac('0x43')],_0x5143ae[_0xa4ac('0x44')]);_0x235a4e[_0xa4ac('0x48')]=_[_0xa4ac('0x47')](_0x5143ae[_0xa4ac('0x43')],qs[_0xa4ac('0x49')](_0x141a99['query'][_0xa4ac('0x49')]));_0x235a4e[_0xa4ac('0x48')]=_0x235a4e[_0xa4ac('0x48')]['length']?_0x235a4e[_0xa4ac('0x48')]:_0x5143ae[_0xa4ac('0x43')];_0x235a4e[_0xa4ac('0x4b')]=qs['sort'](_0x141a99[_0xa4ac('0x44')][_0xa4ac('0x4c')]);_0x235a4e['where']=qs[_0xa4ac('0x46')](_[_0xa4ac('0x4e')](_0x141a99[_0xa4ac('0x44')],_0x5143ae[_0xa4ac('0x46')]));if(_0x141a99[_0xa4ac('0x44')][_0xa4ac('0x4f')]){_0x235a4e[_0xa4ac('0x4d')]=_[_0xa4ac('0x51')](_0x235a4e['where'],{'$or':_[_0xa4ac('0x3d')](_0x235a4e['attributes'],function(_0x3451c4){var _0x4000f5={};_0x4000f5[_0x3451c4]={'$like':'%'+_0x141a99[_0xa4ac('0x44')][_0xa4ac('0x4f')]+'%'};return _0x4000f5;})});}_0x235a4e=_[_0xa4ac('0x51')]({},_0x235a4e,_0x141a99['options']);return _0x298730[_0xa4ac('0xc4')](_0x235a4e);}})[_0xa4ac('0x1f')](function(_0x49ecca){if(_0x49ecca){_0x1b3324=_0x49ecca[_0xa4ac('0x4a')];if(!_0x141a99[_0xa4ac('0x44')]['hasOwnProperty'](_0xa4ac('0x68'))){_0x235a4e[_0xa4ac('0x2e')]=qs[_0xa4ac('0x2e')](_0x141a99[_0xa4ac('0x44')][_0xa4ac('0x2e')]);_0x235a4e[_0xa4ac('0x2c')]=qs[_0xa4ac('0x2c')](_0x141a99['query'][_0xa4ac('0x2c')]);}return _0x298730[_0xa4ac('0xc4')](_0x235a4e);}})[_0xa4ac('0x1f')](function(_0x420bee){if(_0x420bee){return _0x420bee?{'count':_0x1b3324,'rows':_0x420bee}:null;}})[_0xa4ac('0x1f')](respondWithResult(_0xf9eb31,null))[_0xa4ac('0x28')](handleError(_0xf9eb31,null));};exports[_0xa4ac('0xc5')]=function(_0x42c4ee,_0x380215,_0x550fc2){var _0x1290c7={'raw':![],'where':{}};var _0x11f656={};var _0xa795c={'count':0x0,'rows':[]};return db[_0xa4ac('0x3e')]['findOne']({'where':{'id':_0x42c4ee[_0xa4ac('0x55')]['id']}})[_0xa4ac('0x1f')](handleEntityNotFound(_0x380215,null))[_0xa4ac('0x1f')](function(_0x3ba0cd){if(_0x3ba0cd){_0x11f656[_0xa4ac('0x43')]=_[_0xa4ac('0x45')](db[_0xa4ac('0xa3')][_0xa4ac('0x3f')]);_0x11f656[_0xa4ac('0x44')]=_[_0xa4ac('0x45')](_0x42c4ee[_0xa4ac('0x44')]);_0x11f656['filters']=_[_0xa4ac('0x47')](_0x11f656['model'],_0x11f656['query']);_0x1290c7[_0xa4ac('0x48')]=_[_0xa4ac('0x47')](_0x11f656['model'],qs[_0xa4ac('0x49')](_0x42c4ee[_0xa4ac('0x44')][_0xa4ac('0x49')]));_0x1290c7[_0xa4ac('0x48')]=_0x1290c7['attributes'][_0xa4ac('0x4a')]?_0x1290c7[_0xa4ac('0x48')]:_0x11f656[_0xa4ac('0x43')];if(!_0x42c4ee[_0xa4ac('0x44')][_0xa4ac('0x67')](_0xa4ac('0x68'))){_0x1290c7[_0xa4ac('0x2e')]=qs[_0xa4ac('0x2e')](_0x42c4ee[_0xa4ac('0x44')][_0xa4ac('0x2e')]);_0x1290c7['offset']=qs['offset'](_0x42c4ee[_0xa4ac('0x44')][_0xa4ac('0x2c')]);}_0x1290c7[_0xa4ac('0x4b')]=qs[_0xa4ac('0x4c')](_0x42c4ee[_0xa4ac('0x44')][_0xa4ac('0x4c')]);_0x1290c7[_0xa4ac('0x4d')]=qs['filters'](_[_0xa4ac('0x4e')](_0x42c4ee[_0xa4ac('0x44')],_0x11f656[_0xa4ac('0x46')]));_0x1290c7[_0xa4ac('0x4d')][_0xa4ac('0x69')]=_0x3ba0cd['id'];if(_0x42c4ee[_0xa4ac('0x44')][_0xa4ac('0x4f')]){_0x1290c7[_0xa4ac('0x4d')]=_['merge'](_0x1290c7[_0xa4ac('0x4d')],{'$or':_[_0xa4ac('0x3d')](_0x1290c7[_0xa4ac('0x48')],function(_0x5eed24){var _0x1d283a={};_0x1d283a[_0x5eed24]={'$like':'%'+_0x42c4ee[_0xa4ac('0x44')][_0xa4ac('0x4f')]+'%'};return _0x1d283a;})});}_0x1290c7=_[_0xa4ac('0x51')]({},_0x1290c7,_0x42c4ee['options']);return db[_0xa4ac('0xa3')][_0xa4ac('0x2f')]({'where':_0x1290c7['where']})[_0xa4ac('0x1f')](function(_0x3a9d50){_0xa795c[_0xa4ac('0x2f')]=_0x3a9d50;if(_0x42c4ee['query'][_0xa4ac('0x58')]){_0x1290c7[_0xa4ac('0x52')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xa4ac('0xae')],'as':'Owner','attributes':[_0xa4ac('0x3b'),_0xa4ac('0xc6'),'internal'],'required':![]},{'model':db[_0xa4ac('0xc7')],'as':_0xa4ac('0xc8'),'attributes':['id',_0xa4ac('0x3b'),'color'],'where':_0x42c4ee[_0xa4ac('0x44')]['tag']?{'id':_0x42c4ee[_0xa4ac('0x44')]['tag']}:undefined,'required':_0x42c4ee[_0xa4ac('0x44')][_0xa4ac('0xc9')]?!![]:![]}];}return db[_0xa4ac('0xa3')][_0xa4ac('0x53')](_0x1290c7);})[_0xa4ac('0x1f')](function(_0xfc85f8){_0xa795c[_0xa4ac('0x54')]=_0xfc85f8;return _0xa795c;});}})['then'](respondWithFilteredResult(_0x380215,_0x1290c7))[_0xa4ac('0x28')](handleError(_0x380215,null));};exports[_0xa4ac('0xbb')]=function(_0x1d40a8,_0x3bc832,_0x1dd60b){var _0x284c8e,_0x76e96d,_0x2f725d;if(_[_0xa4ac('0x96')](_0x1d40a8[_0xa4ac('0x5a')][_0xa4ac('0x5a')])||_0x1d40a8['body'][_0xa4ac('0x5a')]===''){throw new db[(_0xa4ac('0x79'))][(_0xa4ac('0x7a'))](_0xa4ac('0x97'));}if(_[_0xa4ac('0x96')](_0x1d40a8[_0xa4ac('0x5a')]['to'])){throw new db[(_0xa4ac('0x79'))][(_0xa4ac('0x7a'))](_0xa4ac('0xca'));}_0x284c8e=_0x1d40a8[_0xa4ac('0x5a')]['to'];return db[_0xa4ac('0x3e')][_0xa4ac('0x5f')]({'where':{'id':_0x1d40a8[_0xa4ac('0x55')]['id']},'include':[{'model':db['CmList'],'as':_0xa4ac('0xcb'),'include':[{'model':db[_0xa4ac('0x9d')],'as':'Contacts','where':{'mobile':_0x284c8e},'limit':0x1,'order':[['updatedAt',_0xa4ac('0x9f')]]}]}]})['then'](handleEntityNotFound(_0x3bc832,null))[_0xa4ac('0x1f')](function(_0x46c15e){if(_0x46c15e&&_0x46c15e['List']){_0x76e96d=_0x46c15e[_0xa4ac('0x5e')]({'plain':!![]});if(_0x76e96d[_0xa4ac('0xcb')]&&_0x76e96d[_0xa4ac('0xcb')][_0xa4ac('0x9e')][_0xa4ac('0x4a')]){return _0x76e96d[_0xa4ac('0xcb')][_0xa4ac('0x9e')][0x0];}return db['CmContact'][_0xa4ac('0x59')](_[_0xa4ac('0x17')](_0x1d40a8[_0xa4ac('0x5a')],{'firstName':_0x284c8e,'mobile':_0x284c8e,'phone':_0x284c8e,'ListId':_0x76e96d[_0xa4ac('0x80')]}));}})[_0xa4ac('0x1f')](handleEntityNotFound(_0x3bc832,null))[_0xa4ac('0x1f')](function(_0x349c52){if(_0x349c52){_0x2f725d=_0x349c52;return db[_0xa4ac('0xa3')][_0xa4ac('0x5f')]({'where':{'ContactId':_0x2f725d['id'],'closed':![],'SmsAccountId':_0x76e96d['id']}})['then'](function(_0x40e386){if(_0x40e386){return[_0x40e386,![]];}return db['SmsInteraction'][_0xa4ac('0x59')]({'UserId':_0x1d40a8[_0xa4ac('0x5b')]['id'],'ContactId':_0x2f725d['id'],'SmsAccountId':_0x76e96d['id'],'phone':_0x284c8e,'firstMsgDirection':_0xa4ac('0xcc'),'Messages':[_[_0xa4ac('0x51')](_0x1d40a8['body'],{'read':![],'body':_0x1d40a8[_0xa4ac('0x5a')][_0xa4ac('0x5a')],'phone':_0x284c8e,'SmsAccountId':_0x76e96d['id'],'UserId':_0x1d40a8[_0xa4ac('0x5b')]['id'],'ContactId':_0x2f725d['id']})]},{'include':[{'model':db[_0xa4ac('0xcd')],'as':_0xa4ac('0xce')}]})['then'](function(_0x2c2a42){return[_0x2c2a42,!![]];});});}})[_0xa4ac('0xa4')](function(_0x1f1446,_0x3bf227){if(_0x3bf227){return _0x1f1446;}return db['SmsMessage']['create'](_[_0xa4ac('0x51')](_0x1d40a8[_0xa4ac('0x5a')],{'read':![],'body':_0x1d40a8[_0xa4ac('0x5a')][_0xa4ac('0x5a')],'phone':_0x284c8e,'SmsAccountId':_0x76e96d['id'],'SmsInteractionId':_0x1f1446['id'],'UserId':_0x1d40a8[_0xa4ac('0x5b')]['id'],'ContactId':_0x2f725d['id']}))['then'](function(_0x1b87c7){_0x1f1446['dataValues'][_0xa4ac('0xce')]=[];_0x1f1446[_0xa4ac('0xcf')]['Messages'][_0xa4ac('0xa7')](_0x1b87c7[_0xa4ac('0xcf')]);return _0x1f1446;});})[_0xa4ac('0x1f')](respondWithResult(_0x3bc832,null))['catch'](handleError(_0x3bc832,null));};exports[_0xa4ac('0x2a')]=function(_0x36b89c,_0x56b157,_0x33071c){if(_0x36b89c[_0xa4ac('0x5a')]['id']){delete _0x36b89c['body']['id'];}var _0x372858,_0x41e4e0,_0x11166c;return db[_0xa4ac('0x3e')][_0xa4ac('0x5f')]({'where':{'id':_0x36b89c[_0xa4ac('0x55')]['id']}})['then'](handleEntityNotFound(_0x56b157,null))['then'](function(_0x391f1d){if(_0x391f1d){_0x11166c=_0x391f1d;logger['debug'](_0xa4ac('0x23'),'status',_0xa4ac('0xd0'),_0x391f1d[_0xa4ac('0x41')],util[_0xa4ac('0xd1')](_0x36b89c[_0xa4ac('0x5a')],{'showHidden':![],'depth':null}));switch(_0x391f1d['type']){case _0xa4ac('0xd2'):if(_0x36b89c[_0xa4ac('0x5a')][_0xa4ac('0xd3')]&&_0x36b89c[_0xa4ac('0x5a')][_0xa4ac('0x2a')]){_0x41e4e0=_0x36b89c['body'][_0xa4ac('0x2a')];return db['SmsMessage'][_0xa4ac('0x5f')]({'where':{'messageId':_0x36b89c[_0xa4ac('0x5a')][_0xa4ac('0xd3')]}});}break;case _0xa4ac('0x87'):if(_0x36b89c['body']['requestid']&&_0x36b89c['body'][_0xa4ac('0xd4')]){_0x41e4e0=_0x36b89c[_0xa4ac('0x5a')][_0xa4ac('0xd4')];return db[_0xa4ac('0xcd')][_0xa4ac('0x5f')]({'where':{'messageId':_0x36b89c[_0xa4ac('0x5a')][_0xa4ac('0xd5')]}});}break;case _0xa4ac('0x88'):if(_0x36b89c['body'][_0xa4ac('0xd6')]&&_0x36b89c[_0xa4ac('0x5a')][_0xa4ac('0xd7')]){_0x41e4e0=_0x36b89c[_0xa4ac('0x5a')][_0xa4ac('0xd7')];return db['SmsMessage'][_0xa4ac('0x5f')]({'where':{'messageId':_0x36b89c[_0xa4ac('0x5a')][_0xa4ac('0xd6')]}});}break;case _0xa4ac('0x8b'):var _0x53198e=_0x36b89c[_0xa4ac('0x5a')][_0xa4ac('0x8c')][0x0];if(_0x53198e['messageId']&&_0x53198e[_0xa4ac('0x2a')][_0xa4ac('0xd8')]===_0xa4ac('0xd9')){_0x41e4e0=_0x53198e['status'][_0xa4ac('0xd8')];return db[_0xa4ac('0xcd')][_0xa4ac('0x5f')]({'where':{'messageId':_0x53198e[_0xa4ac('0x85')]}});}break;case _0xa4ac('0x90'):if(_0x36b89c[_0xa4ac('0x5a')][_0xa4ac('0x85')]&&_0x36b89c[_0xa4ac('0x5a')][_0xa4ac('0x2a')]){_0x41e4e0=_0x36b89c[_0xa4ac('0x5a')][_0xa4ac('0x2a')];return db['SmsMessage']['find']({'where':{'messageId':_0x36b89c[_0xa4ac('0x5a')][_0xa4ac('0x85')]}});}break;case'bandwidth':if(_0x36b89c[_0xa4ac('0x5a')][0x0][_0xa4ac('0x26')]['id']){_0x41e4e0=_0x36b89c[_0xa4ac('0x5a')][0x0][_0xa4ac('0x41')];return db[_0xa4ac('0xcd')]['find']({'where':{'messageId':_0x36b89c[_0xa4ac('0x5a')][0x0]['message']['id']}});}break;case'intelepeer':if(_0x36b89c[_0xa4ac('0x5a')][_0xa4ac('0xda')]&&_0x36b89c['body'][_0xa4ac('0x2a')]){_0x41e4e0=_0x36b89c[_0xa4ac('0x5a')][_0xa4ac('0x2a')];return db[_0xa4ac('0xcd')][_0xa4ac('0x5f')]({'where':{'messageId':_0x36b89c['body'][_0xa4ac('0xda')]}});}break;}}})[_0xa4ac('0x1f')](handleEntityNotFound(_0x56b157,null))[_0xa4ac('0x1f')](function(_0x5549f3){if(_0x5549f3){_0x372858=_0x5549f3;switch(_0x11166c[_0xa4ac('0x41')]){case _0xa4ac('0xd2'):if(_0x41e4e0===_0xa4ac('0xd9')){return _0x372858['update']({'read':!![]});}else{logger[_0xa4ac('0x24')](_0xa4ac('0x23'),_0xa4ac('0x2a'),'skebby',util[_0xa4ac('0xd1')](_0x36b89c[_0xa4ac('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xa4ac('0x87'):if(_0x41e4e0==='1'){return _0x372858[_0xa4ac('0x35')]({'read':!![]});}else{logger['error'](_0xa4ac('0x23'),_0xa4ac('0x2a'),_0xa4ac('0xd2'),util['inspect'](_0x36b89c[_0xa4ac('0x5a')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x36b89c[_0xa4ac('0x5a')][_0xa4ac('0xdb')]&&_0x41e4e0>=0xc8&&_0x41e4e0<=0xce){return _0x372858[_0xa4ac('0x35')]({'read':!![]});}else{logger[_0xa4ac('0x24')](_0xa4ac('0x23'),_0xa4ac('0x2a'),_0xa4ac('0x88'),util[_0xa4ac('0xd1')](_0x36b89c[_0xa4ac('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xa4ac('0x8b'):var _0x5f1b30=_0x36b89c[_0xa4ac('0x5a')][_0xa4ac('0x8c')][0x0];if(_0x5f1b30['status'][_0xa4ac('0xd8')]===_0xa4ac('0xd9')){return _0x372858[_0xa4ac('0x35')]({'read':!![]});}else{logger['error'](_0xa4ac('0x23'),_0xa4ac('0x2a'),'infobip',util[_0xa4ac('0xd1')](_0x36b89c[_0xa4ac('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xa4ac('0x90'):if(_0x41e4e0==_0xa4ac('0xdc')||_0x41e4e0==_0xa4ac('0xdd')){return _0x372858['update']({'read':!![]});}else{logger[_0xa4ac('0x24')](_0xa4ac('0x23'),_0xa4ac('0x2a'),_0xa4ac('0x90'),util[_0xa4ac('0xd1')](_0x36b89c[_0xa4ac('0x5a')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x41e4e0=='message-delivered'){return _0x372858[_0xa4ac('0x35')]({'read':!![]});}else{logger[_0xa4ac('0x24')](_0xa4ac('0x23'),_0xa4ac('0x2a'),'bandwidth',util[_0xa4ac('0xd1')](_0x36b89c[_0xa4ac('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xa4ac('0xde'):if(_0x41e4e0==='DELIVRD'||_0x41e4e0===_0xa4ac('0xdf')){return _0x372858['update']({'read':!![]});}else{logger[_0xa4ac('0x24')](_0xa4ac('0x23'),_0xa4ac('0x2a'),_0xa4ac('0xde'),util['inspect'](_0x36b89c['body'],{'showHidden':![],'depth':null}));}break;}return _0x372858;}})[_0xa4ac('0x1f')](respondWithResult(_0x56b157,null))[_0xa4ac('0x28')](handleError(_0x56b157,null));};exports[_0xa4ac('0xe0')]=function(_0x2fa012,_0x35020a,_0x544a3d){var _0x310f5e,_0x16fd72,_0x3b4f9a;return db[_0xa4ac('0x3e')]['find']({'where':{'id':_0x2fa012[_0xa4ac('0x55')]['id']}})[_0xa4ac('0x1f')](handleEntityNotFound(_0x35020a,null))[_0xa4ac('0x1f')](function(_0x3beb03){if(_0x3beb03){_0x3b4f9a=_0x3beb03;logger[_0xa4ac('0x22')](_0xa4ac('0x23'),_0xa4ac('0x2a'),_0xa4ac('0xd0'),_0x3beb03[_0xa4ac('0x41')],util[_0xa4ac('0xd1')](_0x2fa012[_0xa4ac('0x44')],{'showHidden':![],'depth':null}));switch(_0x3beb03['type']){case'csc':if(_0x2fa012['query'][_0xa4ac('0xe1')]&&_0x2fa012[_0xa4ac('0x44')][_0xa4ac('0xe2')]){_0x16fd72=_0x2fa012[_0xa4ac('0x44')]['state'];return db['SmsMessage'][_0xa4ac('0x5f')]({'where':{'messageId':_0x2fa012[_0xa4ac('0x44')]['message-id']}});}break;}}})['then'](handleEntityNotFound(_0x35020a,null))[_0xa4ac('0x1f')](function(_0x37bdf0){if(_0x37bdf0){_0x310f5e=_0x37bdf0;switch(_0x3b4f9a['type']){case _0xa4ac('0x8d'):if(_0x16fd72==='2'||_0x16fd72==='6'){return _0x310f5e[_0xa4ac('0x35')]({'read':!![]});}else{logger[_0xa4ac('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xa4ac('0x2a'),_0xa4ac('0x8d'),util[_0xa4ac('0xd1')](_0x2fa012['query'],{'showHidden':![],'depth':null}));};break;}return _0x310f5e;}})['then'](respondWithResult(_0x35020a,null))['catch'](handleError(_0x35020a,null));};exports[_0xa4ac('0xe3')]=function(_0x1e0ed1,_0x21e7b9,_0x138f9a){return db[_0xa4ac('0x3e')][_0xa4ac('0x5f')]({'where':{'id':_0x1e0ed1[_0xa4ac('0x55')]['id']}})['then'](handleEntityNotFound(_0x21e7b9,null))[_0xa4ac('0x1f')](function(_0x1a8082){if(_0x1a8082){return _0x1a8082['addAgents'](_0x1e0ed1[_0xa4ac('0x5a')][_0xa4ac('0x6c')],_[_0xa4ac('0xa1')](_0x1e0ed1[_0xa4ac('0x5a')],[_0xa4ac('0x6c'),'id'])||{})['spread'](function(_0xcface6){for(var _0x12d8cd=0x0;_0x12d8cd<_0x1e0ed1[_0xa4ac('0x5a')][_0xa4ac('0x6c')][_0xa4ac('0x4a')];_0x12d8cd+=0x1){socket[_0xa4ac('0xe4')]('userSmsAccount:save',{'UserId':Number(_0x1e0ed1[_0xa4ac('0x5a')][_0xa4ac('0x6c')][_0x12d8cd]),'SmsAccountId':Number(_0x1e0ed1['params']['id'])});}return _0xcface6;});}})['then'](respondWithResult(_0x21e7b9,null))[_0xa4ac('0x28')](handleError(_0x21e7b9,null));};exports['removeAgents']=function(_0x22aae8,_0xb58cd4,_0x16824e){return db[_0xa4ac('0x3e')][_0xa4ac('0x5f')]({'where':{'id':_0x22aae8[_0xa4ac('0x55')]['id']}})[_0xa4ac('0x1f')](handleEntityNotFound(_0xb58cd4,null))['then'](function(_0x286a59){if(_0x286a59){return _0x286a59[_0xa4ac('0xe5')](_0x22aae8[_0xa4ac('0x44')][_0xa4ac('0x6c')])[_0xa4ac('0x1f')](function(){if(_['isArray'](_0x22aae8[_0xa4ac('0x44')][_0xa4ac('0x6c')])){for(var _0x4f66a7=0x0;_0x4f66a7<_0x22aae8[_0xa4ac('0x44')][_0xa4ac('0x6c')][_0xa4ac('0x4a')];_0x4f66a7+=0x1){socket[_0xa4ac('0xe4')](_0xa4ac('0xe6'),{'UserId':Number(_0x22aae8[_0xa4ac('0x44')]['ids'][_0x4f66a7]),'SmsAccountId':Number(_0x22aae8['params']['id'])});}}else{socket[_0xa4ac('0xe4')]('userSmsAccount:remove',{'UserId':Number(_0x22aae8[_0xa4ac('0x44')][_0xa4ac('0x6c')]),'SmsAccountId':Number(_0x22aae8[_0xa4ac('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0xb58cd4,null))[_0xa4ac('0x28')](handleError(_0xb58cd4,null));};exports[_0xa4ac('0xe7')]=function(_0x29af22,_0x5da7b6,_0x1e12f6){var _0x57509d={};var _0x3b2d1a={};var _0x32ab1b;var _0x22a3a9;return db['SmsAccount']['findOne']({'where':{'id':_0x29af22[_0xa4ac('0x55')]['id']}})['then'](handleEntityNotFound(_0x5da7b6,null))[_0xa4ac('0x1f')](function(_0x564762){if(_0x564762){_0x32ab1b=_0x564762;_0x3b2d1a[_0xa4ac('0x43')]=_[_0xa4ac('0x45')](db[_0xa4ac('0xae')][_0xa4ac('0x3f')]);_0x3b2d1a['query']=_[_0xa4ac('0x45')](_0x29af22[_0xa4ac('0x44')]);_0x3b2d1a[_0xa4ac('0x46')]=_[_0xa4ac('0x47')](_0x3b2d1a[_0xa4ac('0x43')],_0x3b2d1a['query']);_0x57509d[_0xa4ac('0x48')]=_[_0xa4ac('0x47')](_0x3b2d1a[_0xa4ac('0x43')],qs[_0xa4ac('0x49')](_0x29af22[_0xa4ac('0x44')][_0xa4ac('0x49')]));_0x57509d[_0xa4ac('0x48')]=_0x57509d[_0xa4ac('0x48')]['length']?_0x57509d['attributes']:_0x3b2d1a[_0xa4ac('0x43')];_0x57509d[_0xa4ac('0x4b')]=qs[_0xa4ac('0x4c')](_0x29af22[_0xa4ac('0x44')][_0xa4ac('0x4c')]);_0x57509d[_0xa4ac('0x4d')]=qs['filters'](_['pick'](_0x29af22[_0xa4ac('0x44')],_0x3b2d1a[_0xa4ac('0x46')]));if(_0x29af22[_0xa4ac('0x44')][_0xa4ac('0x4f')]){_0x57509d[_0xa4ac('0x4d')]=_[_0xa4ac('0x51')](_0x57509d['where'],{'$or':_[_0xa4ac('0x3d')](_0x57509d[_0xa4ac('0x48')],function(_0x1fa449){var _0x249dcd={};_0x249dcd[_0x1fa449]={'$like':'%'+_0x29af22[_0xa4ac('0x44')][_0xa4ac('0x4f')]+'%'};return _0x249dcd;})});}_0x57509d=_[_0xa4ac('0x51')]({},_0x57509d,_0x29af22['options']);return _0x32ab1b[_0xa4ac('0xe7')](_0x57509d);}})[_0xa4ac('0x1f')](function(_0x1a2dfb){if(_0x1a2dfb){_0x22a3a9=_0x1a2dfb[_0xa4ac('0x4a')];if(!_0x29af22[_0xa4ac('0x44')][_0xa4ac('0x67')](_0xa4ac('0x68'))){_0x57509d[_0xa4ac('0x2e')]=qs[_0xa4ac('0x2e')](_0x29af22[_0xa4ac('0x44')]['limit']);_0x57509d[_0xa4ac('0x2c')]=qs['offset'](_0x29af22[_0xa4ac('0x44')]['offset']);}return _0x32ab1b['getAgents'](_0x57509d);}})['then'](function(_0x128edb){if(_0x128edb){return _0x128edb?{'count':_0x22a3a9,'rows':_0x128edb}:null;}})[_0xa4ac('0x1f')](respondWithResult(_0x5da7b6,null))[_0xa4ac('0x28')](handleError(_0x5da7b6,null));}; \ No newline at end of file +var _0xcd02=['end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','get','SmsAccounts','UserProfileResource','stack','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','VIRTUAL','merge','options','include','rows','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','addDisposition','Disposition','findOne','sort','SmsAccountId','removeDispositions','addAnswer','CannedAnswer','getAnswers','findAll','removeAnswers','ids','notify','sms','account','applications','Applications','priority','asc','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','From','Body','messageId','MessageSid','skebby','from','sender','text','connectel','clicksend','message_id','plivo','Text','MessageUUID','infobip','results','originatingAddress','segmentedMessage','fromNumber','replyMessageId','intelepeer','refid','isNil','Sequelize','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','omit','CmContact','SmsInteraction','spread','interaction','created','autoclose','push','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','User','unshift','queueId','SmsQueue','queue','Start','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','\x0a','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','SmsApplication','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','fullname','Tags','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','SmsMessage','Messages','dataValues','inspect','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','redif','error_code','clickatell','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','bandwidth','DELIVRD','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','csc','message-id','state','addAgents','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','util','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/license/util','../../mysqldb','defaults','./smsAccount.socket','register','client','http','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus'];(function(_0x58497a,_0x4b141c){var _0x58e470=function(_0x309130){while(--_0x309130){_0x58497a['push'](_0x58497a['shift']());}};_0x58e470(++_0x4b141c);}(_0xcd02,0xbe));var _0x2cd0=function(_0x539694,_0x356978){_0x539694=_0x539694-0x0;var _0x34333e=_0xcd02[_0x539694];return _0x34333e;};'use strict';var emlformat=require(_0x2cd0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2cd0('0x1'));var jsonpatch=require(_0x2cd0('0x2'));var rp=require(_0x2cd0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2cd0('0x4'));var path=require(_0x2cd0('0x5'));var sox=require(_0x2cd0('0x6'));var csv=require(_0x2cd0('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2cd0('0x8'));var _=require(_0x2cd0('0x9'));var squel=require('squel');var crypto=require(_0x2cd0('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x2cd0('0xb'));var toCsv=require(_0x2cd0('0x7'));var querystring=require(_0x2cd0('0xc'));var Papa=require(_0x2cd0('0xd'));var Redis=require(_0x2cd0('0xe'));var authService=require(_0x2cd0('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x2cd0('0x10'));var hardwareService=require(_0x2cd0('0x11'));var logger=require(_0x2cd0('0x12'))(_0x2cd0('0x13'));var utils=require(_0x2cd0('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x2cd0('0x15'));var db=require(_0x2cd0('0x16'))['db'];config['redis']=_[_0x2cd0('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2cd0('0x18'))[_0x2cd0('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0x2cd0('0x1a')][_0x2cd0('0x1b')]({'port':0x232c});function respondWithRpcPromise(_0x1fd860,_0x1d3391,_0x5c329b,_0x523c54){return new BPromise(function(_0x8d89f5,_0x263ec6){var _0x2e1514=_0x523c54||client;return _0x2e1514[_0x2cd0('0x1c')](_0x1fd860,_0x5c329b)[_0x2cd0('0x1d')](function(_0x4ecdaf){logger['info'](_0x2cd0('0x1e'),_0x1d3391,_0x2cd0('0x1f'));logger[_0x2cd0('0x20')](_0x2cd0('0x21'),_0x1d3391,_0x2cd0('0x1f'),JSON[_0x2cd0('0x22')](_0x4ecdaf));if(_0x4ecdaf['error']){if(_0x4ecdaf[_0x2cd0('0x23')][_0x2cd0('0x24')]===0x1f4){logger[_0x2cd0('0x23')](_0x2cd0('0x1e'),_0x1d3391,_0x4ecdaf[_0x2cd0('0x23')][_0x2cd0('0x25')]);return _0x263ec6(_0x4ecdaf[_0x2cd0('0x23')][_0x2cd0('0x25')]);}logger[_0x2cd0('0x23')](_0x2cd0('0x1e'),_0x1d3391,_0x4ecdaf['error'][_0x2cd0('0x25')]);return _0x8d89f5(_0x4ecdaf[_0x2cd0('0x23')][_0x2cd0('0x25')]);}else{logger[_0x2cd0('0x26')](_0x2cd0('0x1e'),_0x1d3391,_0x2cd0('0x1f'));_0x8d89f5(_0x4ecdaf[_0x2cd0('0x27')][_0x2cd0('0x25')]);}})[_0x2cd0('0x28')](function(_0x5e3a90){logger['error'](_0x2cd0('0x1e'),_0x1d3391,_0x5e3a90);_0x263ec6(_0x5e3a90);});});}function respondWithStatusCode(_0x3df8a8,_0xa3922c){_0xa3922c=_0xa3922c||0xcc;return function(_0x1ac183){if(_0x1ac183){return _0x3df8a8[_0x2cd0('0x29')](_0xa3922c);}return _0x3df8a8['status'](_0xa3922c)[_0x2cd0('0x2a')]();};}function respondWithResult(_0x69e332,_0x56c28f){_0x56c28f=_0x56c28f||0xc8;return function(_0x52643d){if(_0x52643d){return _0x69e332[_0x2cd0('0x2b')](_0x56c28f)[_0x2cd0('0x2c')](_0x52643d);}};}function respondWithFilteredResult(_0x9fc7a1,_0x9632eb){return function(_0x4876bc){if(_0x4876bc){var _0x4546d3=typeof _0x9632eb[_0x2cd0('0x2d')]===_0x2cd0('0x2e')&&typeof _0x9632eb[_0x2cd0('0x2f')]===_0x2cd0('0x2e');var _0x2d60cc=_0x4876bc[_0x2cd0('0x30')];var _0x346d5b=_0x4546d3?0x0:_0x9632eb[_0x2cd0('0x2d')];var _0x3a144e=_0x4546d3?_0x4876bc['count']:_0x9632eb[_0x2cd0('0x2d')]+_0x9632eb[_0x2cd0('0x2f')];var _0x3ee6e9;if(_0x3a144e>=_0x2d60cc){_0x3a144e=_0x2d60cc;_0x3ee6e9=0xc8;}else{_0x3ee6e9=0xce;}_0x9fc7a1[_0x2cd0('0x2b')](_0x3ee6e9);return _0x9fc7a1[_0x2cd0('0x31')](_0x2cd0('0x32'),_0x346d5b+'-'+_0x3a144e+'/'+_0x2d60cc)[_0x2cd0('0x2c')](_0x4876bc);}return null;};}function patchUpdates(_0x59f9b2){return function(_0x39cdfe){try{jsonpatch[_0x2cd0('0x33')](_0x39cdfe,_0x59f9b2,!![]);}catch(_0x42a28a){return BPromise[_0x2cd0('0x34')](_0x42a28a);}return _0x39cdfe[_0x2cd0('0x35')]();};}function saveUpdates(_0x3ea136,_0x250acc){return function(_0x544083){if(_0x544083){return _0x544083['update'](_0x3ea136)[_0x2cd0('0x1d')](function(_0x3835e6){return _0x3835e6;});}return null;};}function removeEntity(_0x22c374,_0x106315){return function(_0x20f54a){if(_0x20f54a){return _0x20f54a[_0x2cd0('0x36')]()[_0x2cd0('0x1d')](function(){var _0x38b2b0=_0x20f54a[_0x2cd0('0x37')]({'plain':!![]});var _0x1cb56=_0x2cd0('0x38');return db[_0x2cd0('0x39')]['destroy']({'where':{'type':_0x1cb56,'resourceId':_0x38b2b0['id']}})['then'](function(){return _0x20f54a;});})[_0x2cd0('0x1d')](function(){_0x22c374[_0x2cd0('0x2b')](0xcc)[_0x2cd0('0x2a')]();});}};}function handleEntityNotFound(_0x2963ad,_0x4b4ec9){return function(_0x45519c){if(!_0x45519c){_0x2963ad[_0x2cd0('0x29')](0x194);}return _0x45519c;};}function handleError(_0x24fb50,_0x48667b){_0x48667b=_0x48667b||0x1f4;return function(_0xf65cd6){logger[_0x2cd0('0x23')](_0xf65cd6[_0x2cd0('0x3a')]);if(_0xf65cd6['name']){delete _0xf65cd6['name'];}_0x24fb50[_0x2cd0('0x2b')](_0x48667b)[_0x2cd0('0x3b')](_0xf65cd6);};}exports[_0x2cd0('0x3c')]=function(_0x32e1eb,_0x370327){var _0x19c70d={'include':[{'model':db[_0x2cd0('0x3d')],'as':_0x2cd0('0x3e')}]},_0x59bcf0={},_0x584353={'count':0x0,'rows':[]};var _0x4d5cb8=_[_0x2cd0('0x3f')](db[_0x2cd0('0x40')][_0x2cd0('0x41')],function(_0x1b799c){return{'name':_0x1b799c[_0x2cd0('0x42')],'type':_0x1b799c[_0x2cd0('0x43')][_0x2cd0('0x44')]};});_0x59bcf0['model']=_[_0x2cd0('0x3f')](_0x4d5cb8,_0x2cd0('0x45'));_0x59bcf0[_0x2cd0('0x46')]=_[_0x2cd0('0x47')](_0x32e1eb[_0x2cd0('0x46')]);_0x59bcf0[_0x2cd0('0x48')]=_[_0x2cd0('0x49')](_0x59bcf0['model'],_0x59bcf0['query']);_0x19c70d[_0x2cd0('0x4a')]=_['intersection'](_0x59bcf0[_0x2cd0('0x4b')],qs[_0x2cd0('0x4c')](_0x32e1eb[_0x2cd0('0x46')][_0x2cd0('0x4c')]));_0x19c70d[_0x2cd0('0x4a')]=_0x19c70d[_0x2cd0('0x4a')][_0x2cd0('0x4d')]?_0x19c70d[_0x2cd0('0x4a')]:_0x59bcf0['model'];if(!_0x32e1eb['query'][_0x2cd0('0x4e')](_0x2cd0('0x4f'))){_0x19c70d[_0x2cd0('0x2f')]=qs[_0x2cd0('0x2f')](_0x32e1eb[_0x2cd0('0x46')][_0x2cd0('0x2f')]);_0x19c70d[_0x2cd0('0x2d')]=qs[_0x2cd0('0x2d')](_0x32e1eb[_0x2cd0('0x46')][_0x2cd0('0x2d')]);}_0x19c70d[_0x2cd0('0x50')]=qs['sort'](_0x32e1eb[_0x2cd0('0x46')]['sort']);_0x19c70d[_0x2cd0('0x51')]=qs['filters'](_[_0x2cd0('0x52')](_0x32e1eb[_0x2cd0('0x46')],_0x59bcf0['filters']),_0x4d5cb8);if(_0x32e1eb[_0x2cd0('0x46')][_0x2cd0('0x53')]){_0x19c70d[_0x2cd0('0x51')]=_['merge'](_0x19c70d['where'],{'$or':_[_0x2cd0('0x3f')](_0x4d5cb8,function(_0x23dd1c){if(_0x23dd1c[_0x2cd0('0x43')]!==_0x2cd0('0x54')){var _0x21b80f={};_0x21b80f[_0x23dd1c[_0x2cd0('0x45')]]={'$like':'%'+_0x32e1eb['query']['filter']+'%'};return _0x21b80f;}})});}_0x19c70d=_[_0x2cd0('0x55')]({},_0x19c70d,_0x32e1eb[_0x2cd0('0x56')]);var _0x5c2d86={'where':_0x19c70d['where']};return db[_0x2cd0('0x40')][_0x2cd0('0x30')](_0x5c2d86)[_0x2cd0('0x1d')](function(_0x3f4c33){_0x584353[_0x2cd0('0x30')]=_0x3f4c33;if(_0x32e1eb[_0x2cd0('0x46')]['includeAll']){_0x19c70d[_0x2cd0('0x57')]=[{'all':!![]}];}return db['SmsAccount']['findAll'](_0x19c70d);})[_0x2cd0('0x1d')](function(_0x932394){_0x584353[_0x2cd0('0x58')]=_0x932394;return _0x584353;})[_0x2cd0('0x1d')](respondWithFilteredResult(_0x370327,_0x19c70d))[_0x2cd0('0x28')](handleError(_0x370327,null));};exports['show']=function(_0x531236,_0x443f14){var _0x13a008={'raw':![],'where':{'id':_0x531236['params']['id']},'include':[{'model':db[_0x2cd0('0x3d')],'as':_0x2cd0('0x3e')}]},_0x148aed={};_0x148aed[_0x2cd0('0x4b')]=_[_0x2cd0('0x47')](db[_0x2cd0('0x40')]['rawAttributes']);_0x148aed[_0x2cd0('0x46')]=_[_0x2cd0('0x47')](_0x531236[_0x2cd0('0x46')]);_0x148aed[_0x2cd0('0x48')]=_['intersection'](_0x148aed['model'],_0x148aed['query']);_0x13a008[_0x2cd0('0x4a')]=_[_0x2cd0('0x49')](_0x148aed[_0x2cd0('0x4b')],qs[_0x2cd0('0x4c')](_0x531236['query'][_0x2cd0('0x4c')]));_0x13a008[_0x2cd0('0x4a')]=_0x13a008[_0x2cd0('0x4a')][_0x2cd0('0x4d')]?_0x13a008[_0x2cd0('0x4a')]:_0x148aed['model'];if(_0x531236[_0x2cd0('0x46')][_0x2cd0('0x59')]){_0x13a008[_0x2cd0('0x57')]=[{'all':!![]}];}_0x13a008=_[_0x2cd0('0x55')]({},_0x13a008,_0x531236['options']);return db[_0x2cd0('0x40')][_0x2cd0('0x5a')](_0x13a008)['then'](handleEntityNotFound(_0x443f14,null))['then'](respondWithResult(_0x443f14,null))['catch'](handleError(_0x443f14,null));};exports[_0x2cd0('0x5b')]=function(_0x3f5045,_0x1fbb89){return db['SmsAccount'][_0x2cd0('0x5b')](_0x3f5045[_0x2cd0('0x5c')],{})[_0x2cd0('0x1d')](function(_0x5770f8){var _0x27fae9=_0x3f5045['user'][_0x2cd0('0x37')]({'plain':!![]});if(!_0x27fae9)throw new Error(_0x2cd0('0x5d'));if(_0x27fae9['role']===_0x2cd0('0x5e')){var _0x2fbd23=_0x5770f8['get']({'plain':!![]});var _0x5eec36=_0x2cd0('0x38');return db[_0x2cd0('0x5f')][_0x2cd0('0x5a')]({'where':{'name':_0x5eec36,'userProfileId':_0x27fae9[_0x2cd0('0x60')]},'raw':!![]})[_0x2cd0('0x1d')](function(_0x5d98ed){if(_0x5d98ed&&_0x5d98ed['autoAssociation']===0x0){return db['UserProfileResource'][_0x2cd0('0x5b')]({'name':_0x2fbd23[_0x2cd0('0x45')],'resourceId':_0x2fbd23['id'],'type':_0x5d98ed[_0x2cd0('0x45')],'sectionId':_0x5d98ed['id']},{})[_0x2cd0('0x1d')](function(){return _0x5770f8;});}else{return _0x5770f8;}})[_0x2cd0('0x28')](function(_0x2bb2c8){logger[_0x2cd0('0x23')](_0x2cd0('0x61'),_0x2bb2c8);throw _0x2bb2c8;});}return _0x5770f8;})['then'](respondWithResult(_0x1fbb89,0xc9))[_0x2cd0('0x28')](handleError(_0x1fbb89,null));};exports[_0x2cd0('0x62')]=function(_0x35b5cc,_0x5027b8){if(_0x35b5cc['body']['id']){delete _0x35b5cc[_0x2cd0('0x5c')]['id'];}return db[_0x2cd0('0x40')][_0x2cd0('0x5a')]({'where':{'id':_0x35b5cc[_0x2cd0('0x63')]['id']},'include':[{'model':db[_0x2cd0('0x3d')],'as':_0x2cd0('0x3e')}]})[_0x2cd0('0x1d')](handleEntityNotFound(_0x5027b8,null))[_0x2cd0('0x1d')](saveUpdates(_0x35b5cc[_0x2cd0('0x5c')],null))[_0x2cd0('0x1d')](respondWithResult(_0x5027b8,null))[_0x2cd0('0x28')](handleError(_0x5027b8,null));};exports[_0x2cd0('0x36')]=function(_0x406aa9,_0x586b2f){return db[_0x2cd0('0x40')]['find']({'where':{'id':_0x406aa9[_0x2cd0('0x63')]['id']}})[_0x2cd0('0x1d')](handleEntityNotFound(_0x586b2f,null))[_0x2cd0('0x1d')](removeEntity(_0x586b2f,null))['catch'](handleError(_0x586b2f,null));};exports[_0x2cd0('0x64')]=function(_0x190bfb,_0x494d79){return db[_0x2cd0('0x40')][_0x2cd0('0x64')]()['then'](respondWithResult(_0x494d79,null))['catch'](handleError(_0x494d79,null));};exports[_0x2cd0('0x65')]=function(_0x19522a,_0x977ec,_0x4f9a56){if(_0x19522a['body']['id']){delete _0x19522a[_0x2cd0('0x5c')]['id'];}return db[_0x2cd0('0x40')][_0x2cd0('0x5a')]({'where':{'id':_0x19522a[_0x2cd0('0x63')]['id']}})['then'](handleEntityNotFound(_0x977ec,null))['then'](function(_0x2c4003){if(_0x2c4003){_0x19522a[_0x2cd0('0x5c')]['SmsAccountId']=_0x2c4003['id'];return db[_0x2cd0('0x66')][_0x2cd0('0x5b')](_0x19522a[_0x2cd0('0x5c')]);}})['then'](respondWithResult(_0x977ec,null))[_0x2cd0('0x28')](handleError(_0x977ec,null));};exports['getDispositions']=function(_0x51dfcb,_0x5023e9,_0x21f3eb){var _0xc1f96a={'raw':![],'where':{}};var _0x3abadc={};var _0x387346={'count':0x0,'rows':[]};return db[_0x2cd0('0x40')][_0x2cd0('0x67')]({'where':{'id':_0x51dfcb[_0x2cd0('0x63')]['id']}})[_0x2cd0('0x1d')](handleEntityNotFound(_0x5023e9,null))[_0x2cd0('0x1d')](function(_0x1a8c66){if(_0x1a8c66){_0x3abadc['model']=_['keys'](db[_0x2cd0('0x66')][_0x2cd0('0x41')]);_0x3abadc['query']=_[_0x2cd0('0x47')](_0x51dfcb[_0x2cd0('0x46')]);_0x3abadc['filters']=_['intersection'](_0x3abadc[_0x2cd0('0x4b')],_0x3abadc[_0x2cd0('0x46')]);_0xc1f96a['attributes']=_[_0x2cd0('0x49')](_0x3abadc[_0x2cd0('0x4b')],qs[_0x2cd0('0x4c')](_0x51dfcb[_0x2cd0('0x46')][_0x2cd0('0x4c')]));_0xc1f96a[_0x2cd0('0x4a')]=_0xc1f96a['attributes'][_0x2cd0('0x4d')]?_0xc1f96a['attributes']:_0x3abadc[_0x2cd0('0x4b')];if(!_0x51dfcb[_0x2cd0('0x46')][_0x2cd0('0x4e')](_0x2cd0('0x4f'))){_0xc1f96a[_0x2cd0('0x2f')]=qs[_0x2cd0('0x2f')](_0x51dfcb[_0x2cd0('0x46')][_0x2cd0('0x2f')]);_0xc1f96a['offset']=qs['offset'](_0x51dfcb[_0x2cd0('0x46')][_0x2cd0('0x2d')]);}_0xc1f96a[_0x2cd0('0x50')]=qs[_0x2cd0('0x68')](_0x51dfcb[_0x2cd0('0x46')][_0x2cd0('0x68')]);_0xc1f96a[_0x2cd0('0x51')]=qs['filters'](_[_0x2cd0('0x52')](_0x51dfcb[_0x2cd0('0x46')],_0x3abadc[_0x2cd0('0x48')]));_0xc1f96a[_0x2cd0('0x51')][_0x2cd0('0x69')]=_0x1a8c66['id'];if(_0x51dfcb[_0x2cd0('0x46')][_0x2cd0('0x53')]){_0xc1f96a[_0x2cd0('0x51')]=_[_0x2cd0('0x55')](_0xc1f96a[_0x2cd0('0x51')],{'$or':_[_0x2cd0('0x3f')](_0xc1f96a[_0x2cd0('0x4a')],function(_0x2b0e95){var _0x8b63ac={};_0x8b63ac[_0x2b0e95]={'$like':'%'+_0x51dfcb[_0x2cd0('0x46')][_0x2cd0('0x53')]+'%'};return _0x8b63ac;})});}_0xc1f96a=_['merge']({},_0xc1f96a,_0x51dfcb[_0x2cd0('0x56')]);return db[_0x2cd0('0x66')]['count']({'where':_0xc1f96a['where']})[_0x2cd0('0x1d')](function(_0x5d5836){_0x387346[_0x2cd0('0x30')]=_0x5d5836;if(_0x51dfcb[_0x2cd0('0x46')][_0x2cd0('0x59')]){_0xc1f96a[_0x2cd0('0x57')]=[{'all':!![]}];}return db[_0x2cd0('0x66')]['findAll'](_0xc1f96a);})[_0x2cd0('0x1d')](function(_0x40ded7){_0x387346['rows']=_0x40ded7;return _0x387346;});}})['then'](respondWithFilteredResult(_0x5023e9,_0xc1f96a))[_0x2cd0('0x28')](handleError(_0x5023e9,null));};exports[_0x2cd0('0x6a')]=function(_0x579bd9,_0x5d0d0c,_0x5b9c46){return db['SmsAccount'][_0x2cd0('0x5a')]({'where':{'id':_0x579bd9['params']['id']}})[_0x2cd0('0x1d')](handleEntityNotFound(_0x5d0d0c,null))[_0x2cd0('0x1d')](function(_0x1cadca){if(_0x1cadca){return _0x1cadca[_0x2cd0('0x6a')](_0x579bd9[_0x2cd0('0x46')]['ids']);}})[_0x2cd0('0x1d')](respondWithStatusCode(_0x5d0d0c,null))[_0x2cd0('0x28')](handleError(_0x5d0d0c,null));};exports[_0x2cd0('0x6b')]=function(_0x4e7c98,_0xdc96fd,_0x1fcd48){if(_0x4e7c98[_0x2cd0('0x5c')]['id']){delete _0x4e7c98['body']['id'];}return db[_0x2cd0('0x40')][_0x2cd0('0x5a')]({'where':{'id':_0x4e7c98['params']['id']}})[_0x2cd0('0x1d')](handleEntityNotFound(_0xdc96fd,null))[_0x2cd0('0x1d')](function(_0x582034){if(_0x582034){_0x4e7c98[_0x2cd0('0x5c')][_0x2cd0('0x69')]=_0x582034['id'];return db[_0x2cd0('0x6c')][_0x2cd0('0x5b')](_0x4e7c98[_0x2cd0('0x5c')]);}})[_0x2cd0('0x1d')](respondWithResult(_0xdc96fd,null))[_0x2cd0('0x28')](handleError(_0xdc96fd,null));};exports[_0x2cd0('0x6d')]=function(_0x9d2511,_0x5e5370,_0x32efbf){var _0x408eac={'raw':![],'where':{}};var _0x4a6f50={};var _0x4d6091={'count':0x0,'rows':[]};return db[_0x2cd0('0x40')]['findOne']({'where':{'id':_0x9d2511['params']['id']}})['then'](handleEntityNotFound(_0x5e5370,null))[_0x2cd0('0x1d')](function(_0x1dab37){if(_0x1dab37){_0x4a6f50['model']=_[_0x2cd0('0x47')](db['CannedAnswer'][_0x2cd0('0x41')]);_0x4a6f50[_0x2cd0('0x46')]=_['keys'](_0x9d2511['query']);_0x4a6f50['filters']=_[_0x2cd0('0x49')](_0x4a6f50[_0x2cd0('0x4b')],_0x4a6f50[_0x2cd0('0x46')]);_0x408eac['attributes']=_['intersection'](_0x4a6f50[_0x2cd0('0x4b')],qs['fields'](_0x9d2511['query'][_0x2cd0('0x4c')]));_0x408eac[_0x2cd0('0x4a')]=_0x408eac[_0x2cd0('0x4a')][_0x2cd0('0x4d')]?_0x408eac[_0x2cd0('0x4a')]:_0x4a6f50['model'];if(!_0x9d2511[_0x2cd0('0x46')][_0x2cd0('0x4e')](_0x2cd0('0x4f'))){_0x408eac[_0x2cd0('0x2f')]=qs['limit'](_0x9d2511[_0x2cd0('0x46')][_0x2cd0('0x2f')]);_0x408eac[_0x2cd0('0x2d')]=qs['offset'](_0x9d2511[_0x2cd0('0x46')][_0x2cd0('0x2d')]);}_0x408eac[_0x2cd0('0x50')]=qs[_0x2cd0('0x68')](_0x9d2511[_0x2cd0('0x46')][_0x2cd0('0x68')]);_0x408eac[_0x2cd0('0x51')]=qs[_0x2cd0('0x48')](_['pick'](_0x9d2511[_0x2cd0('0x46')],_0x4a6f50[_0x2cd0('0x48')]));_0x408eac[_0x2cd0('0x51')][_0x2cd0('0x69')]=_0x1dab37['id'];if(_0x9d2511[_0x2cd0('0x46')][_0x2cd0('0x53')]){_0x408eac['where']=_[_0x2cd0('0x55')](_0x408eac[_0x2cd0('0x51')],{'$or':_[_0x2cd0('0x3f')](_0x408eac[_0x2cd0('0x4a')],function(_0x4a72cd){var _0x4c3d1b={};_0x4c3d1b[_0x4a72cd]={'$like':'%'+_0x9d2511[_0x2cd0('0x46')][_0x2cd0('0x53')]+'%'};return _0x4c3d1b;})});}_0x408eac=_[_0x2cd0('0x55')]({},_0x408eac,_0x9d2511[_0x2cd0('0x56')]);return db['CannedAnswer'][_0x2cd0('0x30')]({'where':_0x408eac[_0x2cd0('0x51')]})['then'](function(_0x5d851f){_0x4d6091[_0x2cd0('0x30')]=_0x5d851f;if(_0x9d2511['query'][_0x2cd0('0x59')]){_0x408eac[_0x2cd0('0x57')]=[{'all':!![]}];}return db['CannedAnswer'][_0x2cd0('0x6e')](_0x408eac);})[_0x2cd0('0x1d')](function(_0x55cf0e){_0x4d6091[_0x2cd0('0x58')]=_0x55cf0e;return _0x4d6091;});}})[_0x2cd0('0x1d')](respondWithFilteredResult(_0x5e5370,_0x408eac))[_0x2cd0('0x28')](handleError(_0x5e5370,null));};exports['removeAnswers']=function(_0x35d102,_0x15a0fb,_0x2bcdf9){return db['SmsAccount']['find']({'where':{'id':_0x35d102[_0x2cd0('0x63')]['id']}})[_0x2cd0('0x1d')](handleEntityNotFound(_0x15a0fb,null))[_0x2cd0('0x1d')](function(_0x111081){if(_0x111081){return _0x111081[_0x2cd0('0x6f')](_0x35d102[_0x2cd0('0x46')][_0x2cd0('0x70')]);}})['then'](respondWithStatusCode(_0x15a0fb,null))[_0x2cd0('0x28')](handleError(_0x15a0fb,null));};exports[_0x2cd0('0x71')]=function(_0x245ab1,_0x4d6031,_0x5415d9){var _0x4b2107={'channel':_0x2cd0('0x72')};var _0xeda334=[];var _0x32877e=[];var _0x557fe3={};return db[_0x2cd0('0x40')][_0x2cd0('0x5a')]({'where':{'id':_0x245ab1[_0x2cd0('0x63')]['id']},'include':[{'model':db['SmsApplication'],'as':'Applications'}]})[_0x2cd0('0x1d')](handleEntityNotFound(_0x4d6031,null))[_0x2cd0('0x1d')](function(_0x2ee9d8){_0x4b2107[_0x2cd0('0x73')]=_0x2ee9d8;_0x4b2107[_0x2cd0('0x74')]=_['orderBy'](_0x2ee9d8[_0x2cd0('0x75')],[_0x2cd0('0x76')],[_0x2cd0('0x77')]);if(_0x4b2107[_0x2cd0('0x73')][_0x2cd0('0x75')]){delete _0x4b2107[_0x2cd0('0x73')]['Applications'];}return db['CmContact']['describe']();})['then'](function(_0x1d95be){if(!_0x1d95be){throw new db['Sequelize'][(_0x2cd0('0x78'))](_0x2cd0('0x79'));}_0xeda334=_[_0x2cd0('0x7a')](_['keys'](_0x1d95be),[_0x2cd0('0x7b'),_0x2cd0('0x7c')]);_0x32877e=_[_0x2cd0('0x7a')](_[_0x2cd0('0x47')](_0x1d95be),[_0x2cd0('0x7b'),'updatedAt',_0x2cd0('0x7d'),_0x2cd0('0x7e')]);_0x4b2107[_0x2cd0('0x5c')]={'mapKey':_0x2cd0('0x7f')};if(_0x4b2107[_0x2cd0('0x73')][_0x2cd0('0x43')]){switch(_0x4b2107[_0x2cd0('0x73')][_0x2cd0('0x43')]){case _0x2cd0('0x80'):_0x4b2107['body']['from']=_0x245ab1['body'][_0x2cd0('0x81')];_0x4b2107['body']['body']=_0x245ab1[_0x2cd0('0x5c')][_0x2cd0('0x82')];_0x4b2107[_0x2cd0('0x5c')][_0x2cd0('0x83')]=_0x245ab1[_0x2cd0('0x5c')][_0x2cd0('0x84')];break;case _0x2cd0('0x85'):_0x4b2107[_0x2cd0('0x5c')][_0x2cd0('0x86')]='+'+_0x245ab1[_0x2cd0('0x5c')][_0x2cd0('0x87')];_0x4b2107[_0x2cd0('0x5c')][_0x2cd0('0x5c')]=_0x245ab1[_0x2cd0('0x5c')][_0x2cd0('0x88')];break;case _0x2cd0('0x89'):_0x4b2107[_0x2cd0('0x5c')][_0x2cd0('0x86')]=_0x245ab1[_0x2cd0('0x5c')][_0x2cd0('0x86')];_0x4b2107[_0x2cd0('0x5c')][_0x2cd0('0x5c')]=_0x245ab1[_0x2cd0('0x5c')][_0x2cd0('0x25')];break;case _0x2cd0('0x8a'):_0x4b2107[_0x2cd0('0x5c')][_0x2cd0('0x86')]=_0x245ab1[_0x2cd0('0x5c')][_0x2cd0('0x86')];_0x4b2107[_0x2cd0('0x5c')][_0x2cd0('0x5c')]=_0x245ab1[_0x2cd0('0x5c')][_0x2cd0('0x5c')];_0x4b2107[_0x2cd0('0x5c')][_0x2cd0('0x83')]=_0x245ab1['body'][_0x2cd0('0x8b')];break;case _0x2cd0('0x8c'):_0x4b2107['body'][_0x2cd0('0x86')]=_0x245ab1[_0x2cd0('0x5c')][_0x2cd0('0x81')];_0x4b2107['body'][_0x2cd0('0x5c')]=_0x245ab1['body'][_0x2cd0('0x8d')];_0x4b2107[_0x2cd0('0x5c')]['messageId']=_0x245ab1[_0x2cd0('0x5c')][_0x2cd0('0x8e')];break;case _0x2cd0('0x8f'):_0x4b2107['body']['from']='+'+_0x245ab1[_0x2cd0('0x5c')]['results'][0x0][_0x2cd0('0x86')];_0x4b2107['body'][_0x2cd0('0x5c')]=_0x245ab1[_0x2cd0('0x5c')][_0x2cd0('0x90')][0x0][_0x2cd0('0x88')];_0x4b2107[_0x2cd0('0x5c')][_0x2cd0('0x83')]=_0x245ab1['body'][_0x2cd0('0x90')][0x0][_0x2cd0('0x83')];break;case'csc':_0x4b2107[_0x2cd0('0x5c')]['from']=_0x245ab1[_0x2cd0('0x5c')][_0x2cd0('0x91')];_0x4b2107[_0x2cd0('0x5c')][_0x2cd0('0x5c')]=_0x245ab1[_0x2cd0('0x5c')][_0x2cd0('0x92')][_0x2cd0('0x25')];break;case'clickatell':_0x4b2107[_0x2cd0('0x5c')][_0x2cd0('0x86')]=_0x245ab1['body'][_0x2cd0('0x93')];_0x4b2107['body'][_0x2cd0('0x5c')]=_0x245ab1[_0x2cd0('0x5c')][_0x2cd0('0x88')];_0x4b2107[_0x2cd0('0x5c')][_0x2cd0('0x83')]=_0x245ab1[_0x2cd0('0x5c')][_0x2cd0('0x94')];break;case'bandwidth':_0x4b2107['body']['messageId']=_0x245ab1['body'][0x0][_0x2cd0('0x25')]['id'];_0x4b2107['body'][_0x2cd0('0x86')]=_0x245ab1[_0x2cd0('0x5c')][0x0][_0x2cd0('0x25')]['from'];_0x4b2107['body'][_0x2cd0('0x5c')]=_0x245ab1[_0x2cd0('0x5c')][0x0][_0x2cd0('0x25')][_0x2cd0('0x88')];break;case _0x2cd0('0x95'):_0x4b2107['body']['from']=_0x245ab1[_0x2cd0('0x5c')][_0x2cd0('0x86')];_0x4b2107[_0x2cd0('0x5c')]['body']=_0x245ab1['body'][_0x2cd0('0x25')];_0x4b2107[_0x2cd0('0x5c')][_0x2cd0('0x83')]=_0x245ab1[_0x2cd0('0x5c')][_0x2cd0('0x96')];break;}}if(_0x4b2107['body']['id']){delete _0x4b2107[_0x2cd0('0x5c')]['id'];}if(_[_0x2cd0('0x97')](_0x4b2107[_0x2cd0('0x5c')][_0x2cd0('0x86')])){throw new db[(_0x2cd0('0x98'))][(_0x2cd0('0x78'))]('from\x20is\x20mandatory');}if(_[_0x2cd0('0x97')](_0x4b2107[_0x2cd0('0x5c')][_0x2cd0('0x5c')])||_0x4b2107['body'][_0x2cd0('0x5c')]===''){throw new db[(_0x2cd0('0x98'))][(_0x2cd0('0x78'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x2cd0('0x97')](_0x4b2107[_0x2cd0('0x5c')][_0x2cd0('0x99')])){throw new db[(_0x2cd0('0x98'))][(_0x2cd0('0x78'))](_0x2cd0('0x9a')+_0x32877e);}if(!_[_0x2cd0('0x9b')](_0x32877e,_0x4b2107[_0x2cd0('0x5c')][_0x2cd0('0x99')])){throw new db[(_0x2cd0('0x98'))]['ValidationError'](_0x2cd0('0x9c')+_0x32877e);}_0x557fe3[_0x4b2107[_0x2cd0('0x5c')]['mapKey']]=_0x4b2107[_0x2cd0('0x5c')]['from'];return db[_0x2cd0('0x9d')][_0x2cd0('0x5a')]({'where':{'id':_0x4b2107[_0x2cd0('0x73')]['ListId']},'include':[{'model':db['CmContact'],'as':_0x2cd0('0x9e'),'where':_0x557fe3,'limit':0x1,'order':[[_0x2cd0('0x7c'),_0x2cd0('0x9f')]]}]});})[_0x2cd0('0x1d')](handleEntityNotFound(_0x4d6031,null))['then'](function(_0x4c30cd){if(_0x4c30cd){_0x4b2107[_0x2cd0('0xa0')]=_[_0x2cd0('0xa1')](_0x4c30cd,[_0x2cd0('0x9e')]);if(_0x4c30cd[_0x2cd0('0x9e')]['length']){return _0x4c30cd[_0x2cd0('0x9e')][0x0];}var _0x7a0b4b=_['defaults'](_0x4b2107['body'],{'firstName':_0x4b2107[_0x2cd0('0x5c')][_0x2cd0('0x86')],'ListId':_0x4c30cd['id']});_0x7a0b4b[_0x4b2107[_0x2cd0('0x5c')][_0x2cd0('0x99')]]=_0x4b2107['body'][_0x2cd0('0x86')];return db[_0x2cd0('0xa2')]['create'](_0x7a0b4b,{'fields':_0xeda334,'raw':!![]});}})[_0x2cd0('0x1d')](handleEntityNotFound(_0x4d6031,null))['then'](function(_0x28b9a6){if(_0x28b9a6){_0x4b2107['contact']=_0x28b9a6;var _0x4c4029={'ContactId':_0x28b9a6['id'],'phone':_0x4b2107[_0x2cd0('0x5c')][_0x2cd0('0x86')],'SmsAccountId':_0x245ab1['params']['id']};var _0x7f625e={'ContactId':_0x28b9a6['id'],'SmsAccountId':_0x245ab1['params']['id'],'closed':![]};return db[_0x2cd0('0xa3')][_0x2cd0('0x5a')]({'where':_0x7f625e})[_0x2cd0('0x1d')](function(_0x1b57ed){if(_0x1b57ed){return[_0x1b57ed,![]];}return db[_0x2cd0('0xa3')][_0x2cd0('0x5b')](_0x4c4029)[_0x2cd0('0x1d')](function(_0xfc88fb){return[_0xfc88fb,!![]];});});}})[_0x2cd0('0xa4')](function(_0x1dce00,_0x19a717){_0x4b2107['interaction']=_0x1dce00['get']({'plain':!![]});_0x4b2107[_0x2cd0('0xa5')][_0x2cd0('0xa6')]=![];if(_0x19a717){if(_0x4b2107[_0x2cd0('0x73')][_0x2cd0('0xa7')]){_0x4b2107['applications'][_0x2cd0('0xa8')]({'id':0x0,'priority':_0x4b2107['applications'][_0x2cd0('0x4d')]+0x1,'app':'close','appdata':_0x2cd0('0xa9'),'interval':_0x2cd0('0xaa')});}_0x4b2107[_0x2cd0('0xa5')][_0x2cd0('0xa6')]=!![];}return db['SmsMessage']['create']({'phone':_0x4b2107[_0x2cd0('0x5c')][_0x2cd0('0x86')],'messageId':_0x4b2107[_0x2cd0('0x5c')][_0x2cd0('0x83')],'body':_0x4b2107[_0x2cd0('0x5c')][_0x2cd0('0x5c')],'SmsAccountId':_0x245ab1[_0x2cd0('0x63')]['id'],'SmsInteractionId':_0x1dce00['id'],'direction':'in','ContactId':_0x1dce00[_0x2cd0('0xab')],'AttachmentId':_0x4b2107[_0x2cd0('0x5c')][_0x2cd0('0xac')]});})[_0x2cd0('0x1d')](function(_0x53501f){_0x4b2107[_0x2cd0('0x25')]=_0x53501f;if(!_0x4b2107['interaction'][_0x2cd0('0xad')])return;return db[_0x2cd0('0xae')][_0x2cd0('0x5a')]({'attributes':['id','name'],'where':{'id':_0x4b2107[_0x2cd0('0xa5')][_0x2cd0('0xad')]}});})[_0x2cd0('0x1d')](function(_0x23ea37){if(_0x23ea37){_0x4b2107[_0x2cd0('0x74')][_0x2cd0('0xaf')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x23ea37[_0x2cd0('0x45')]+','+(_0x4b2107[_0x2cd0('0x73')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}if(!_0x4b2107[_0x2cd0('0xa5')][_0x2cd0('0xb0')])return;return db[_0x2cd0('0xb1')][_0x2cd0('0x5a')]({'attributes':['id',_0x2cd0('0x45')],'where':{'id':_0x4b2107['interaction'][_0x2cd0('0xb0')]}});})[_0x2cd0('0x1d')](function(_0x21af19){if(_0x21af19){_0x4b2107[_0x2cd0('0x74')][_0x2cd0('0xaf')]({'id':0x0,'priority':0x1,'app':_0x2cd0('0xb2'),'appdata':_0x21af19[_0x2cd0('0x45')]+','+(_0x4b2107[_0x2cd0('0x73')]['waitForTheAssignedQueue']||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x2cd0('0xb3'),'startRouting',_0x4b2107);})['then'](function(_0x5846c4){if(_0x5846c4){var _0x277d30=0xc8;var _0x2da426=_0x2cd0('0xb4');logger[_0x2cd0('0x26')](_0x2cd0('0x21'),_0x2da426,_0x277d30,_0x2cd0('0xb5'));logger[_0x2cd0('0x20')](_0x2cd0('0xb6'),_0x2da426,_0x277d30,_0x2cd0('0xb5'),JSON[_0x2cd0('0x22')](_0x5846c4));if(_0x4b2107['account']['type']===_0x2cd0('0x80')){return _0x4d6031[_0x2cd0('0x2b')](_0x277d30)[_0x2cd0('0x31')](_0x2cd0('0xb7'),'text/xml')[_0x2cd0('0x3b')](_0x2cd0('0xb8'));}else{return _0x4d6031[_0x2cd0('0x2b')](_0x277d30)[_0x2cd0('0x2c')](_0x5846c4);}}})[_0x2cd0('0x28')](handleError(_0x4d6031,null));};exports['addApplications']=function(_0x233bae,_0x16214d){var _0x1cb5e5=_0x233bae['params']['id'];var _0x21a46f=_0x233bae[_0x2cd0('0x5c')];var _0x3c9983=0xc8;var _0x3b1dbe=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x2cd0('0xb9')][_0x2cd0('0xba')][_0x2cd0('0xbb')][_0x2cd0('0xbc')]},function(_0x380627){return db[_0x2cd0('0x40')]['findOne']({'where':{'id':_0x1cb5e5},'transaction':_0x380627})[_0x2cd0('0x1d')](function(_0x911c6a){if(_0x911c6a){return db[_0x2cd0('0xbd')][_0x2cd0('0x36')]({'where':{'SmsAccountId':_0x1cb5e5},'transaction':_0x380627})[_0x2cd0('0x1d')](function(){var _0x4ef539=_['map'](_0x21a46f,function(_0x3666bd){_0x3666bd[_0x2cd0('0x69')]=_0x1cb5e5;return _0x3666bd;});return db[_0x2cd0('0xbd')][_0x2cd0('0xbe')](_0x4ef539,{'transaction':_0x380627});});}else{_0x3c9983=0x194;_0x3b1dbe=[];}});})[_0x2cd0('0x1d')](function(){if(_0x3c9983!==0x194){return db['SmsApplication'][_0x2cd0('0xbf')]({'where':{'SmsAccountId':_0x1cb5e5},'order':'priority'})['then'](function(_0x28e198){_0x3b1dbe=_0x28e198;});}})['catch'](function(_0x5238f9){_0x3c9983=0x1f4;logger[_0x2cd0('0x23')](_0x5238f9[_0x2cd0('0x3a')]);if(_0x5238f9['name']){delete _0x5238f9[_0x2cd0('0x45')];}_0x3b1dbe=_0x5238f9;})[_0x2cd0('0xc0')](function(){if(_0x3b1dbe===null){_0x16214d[_0x2cd0('0x29')](_0x3c9983);}else{if(_0x3c9983===0x1f4){_0x16214d[_0x2cd0('0x2b')](_0x3c9983)['send'](_0x3b1dbe);}else{_0x16214d[_0x2cd0('0x2b')](_0x3c9983)[_0x2cd0('0x2c')](_0x3b1dbe);}}});};exports['getApplications']=function(_0x54da36,_0x1b7e7a,_0x1e6f70){var _0x255c5e={};var _0x2d63ab={};var _0x1a3426;var _0x4aa060;return db[_0x2cd0('0x40')][_0x2cd0('0x67')]({'where':{'id':_0x54da36['params']['id']}})[_0x2cd0('0x1d')](handleEntityNotFound(_0x1b7e7a,null))[_0x2cd0('0x1d')](function(_0x54f0ff){if(_0x54f0ff){_0x1a3426=_0x54f0ff;_0x2d63ab[_0x2cd0('0x4b')]=_[_0x2cd0('0x47')](db[_0x2cd0('0xbd')]['rawAttributes']);_0x2d63ab[_0x2cd0('0x46')]=_[_0x2cd0('0x47')](_0x54da36['query']);_0x2d63ab[_0x2cd0('0x48')]=_[_0x2cd0('0x49')](_0x2d63ab[_0x2cd0('0x4b')],_0x2d63ab[_0x2cd0('0x46')]);_0x255c5e['attributes']=_[_0x2cd0('0x49')](_0x2d63ab[_0x2cd0('0x4b')],qs[_0x2cd0('0x4c')](_0x54da36[_0x2cd0('0x46')][_0x2cd0('0x4c')]));_0x255c5e['attributes']=_0x255c5e[_0x2cd0('0x4a')][_0x2cd0('0x4d')]?_0x255c5e[_0x2cd0('0x4a')]:_0x2d63ab[_0x2cd0('0x4b')];_0x255c5e[_0x2cd0('0x50')]=qs['sort'](_0x54da36[_0x2cd0('0x46')][_0x2cd0('0x68')]);_0x255c5e[_0x2cd0('0x51')]=qs[_0x2cd0('0x48')](_[_0x2cd0('0x52')](_0x54da36[_0x2cd0('0x46')],_0x2d63ab[_0x2cd0('0x48')]));if(_0x54da36['query']['filter']){_0x255c5e[_0x2cd0('0x51')]=_[_0x2cd0('0x55')](_0x255c5e[_0x2cd0('0x51')],{'$or':_['map'](_0x255c5e['attributes'],function(_0x591d42){var _0x5cdf17={};_0x5cdf17[_0x591d42]={'$like':'%'+_0x54da36[_0x2cd0('0x46')][_0x2cd0('0x53')]+'%'};return _0x5cdf17;})});}_0x255c5e=_['merge']({},_0x255c5e,_0x54da36[_0x2cd0('0x56')]);return _0x1a3426[_0x2cd0('0xc1')](_0x255c5e);}})[_0x2cd0('0x1d')](function(_0x2e49c6){if(_0x2e49c6){_0x4aa060=_0x2e49c6[_0x2cd0('0x4d')];if(!_0x54da36[_0x2cd0('0x46')][_0x2cd0('0x4e')](_0x2cd0('0x4f'))){_0x255c5e[_0x2cd0('0x2f')]=qs[_0x2cd0('0x2f')](_0x54da36[_0x2cd0('0x46')][_0x2cd0('0x2f')]);_0x255c5e[_0x2cd0('0x2d')]=qs[_0x2cd0('0x2d')](_0x54da36[_0x2cd0('0x46')][_0x2cd0('0x2d')]);}return _0x1a3426[_0x2cd0('0xc1')](_0x255c5e);}})[_0x2cd0('0x1d')](function(_0x14f920){if(_0x14f920){return _0x14f920?{'count':_0x4aa060,'rows':_0x14f920}:null;}})[_0x2cd0('0x1d')](respondWithResult(_0x1b7e7a,null))['catch'](handleError(_0x1b7e7a,null));};exports[_0x2cd0('0xc2')]=function(_0x504cad,_0x5cdbeb,_0x47be16){var _0x1227d7={'raw':![],'where':{}};var _0x2c4875={};var _0x57a530={'count':0x0,'rows':[]};return db[_0x2cd0('0x40')][_0x2cd0('0x67')]({'where':{'id':_0x504cad['params']['id']}})[_0x2cd0('0x1d')](handleEntityNotFound(_0x5cdbeb,null))[_0x2cd0('0x1d')](function(_0xc2da3b){if(_0xc2da3b){_0x2c4875[_0x2cd0('0x4b')]=_['keys'](db[_0x2cd0('0xa3')][_0x2cd0('0x41')]);_0x2c4875['query']=_[_0x2cd0('0x47')](_0x504cad['query']);_0x2c4875[_0x2cd0('0x48')]=_['intersection'](_0x2c4875[_0x2cd0('0x4b')],_0x2c4875[_0x2cd0('0x46')]);_0x1227d7[_0x2cd0('0x4a')]=_['intersection'](_0x2c4875[_0x2cd0('0x4b')],qs[_0x2cd0('0x4c')](_0x504cad[_0x2cd0('0x46')][_0x2cd0('0x4c')]));_0x1227d7[_0x2cd0('0x4a')]=_0x1227d7['attributes'][_0x2cd0('0x4d')]?_0x1227d7[_0x2cd0('0x4a')]:_0x2c4875['model'];if(!_0x504cad[_0x2cd0('0x46')][_0x2cd0('0x4e')](_0x2cd0('0x4f'))){_0x1227d7['limit']=qs['limit'](_0x504cad['query'][_0x2cd0('0x2f')]);_0x1227d7[_0x2cd0('0x2d')]=qs['offset'](_0x504cad[_0x2cd0('0x46')]['offset']);}_0x1227d7[_0x2cd0('0x50')]=qs[_0x2cd0('0x68')](_0x504cad[_0x2cd0('0x46')][_0x2cd0('0x68')]);_0x1227d7[_0x2cd0('0x51')]=qs[_0x2cd0('0x48')](_['pick'](_0x504cad[_0x2cd0('0x46')],_0x2c4875[_0x2cd0('0x48')]));_0x1227d7['where'][_0x2cd0('0x69')]=_0xc2da3b['id'];if(_0x504cad[_0x2cd0('0x46')][_0x2cd0('0x53')]){_0x1227d7[_0x2cd0('0x51')]=_['merge'](_0x1227d7[_0x2cd0('0x51')],{'$or':_[_0x2cd0('0x3f')](_0x1227d7[_0x2cd0('0x4a')],function(_0x1fb560){var _0x55d8b7={};_0x55d8b7[_0x1fb560]={'$like':'%'+_0x504cad['query']['filter']+'%'};return _0x55d8b7;})});}_0x1227d7=_[_0x2cd0('0x55')]({},_0x1227d7,_0x504cad[_0x2cd0('0x56')]);return db[_0x2cd0('0xa3')][_0x2cd0('0x30')]({'where':_0x1227d7[_0x2cd0('0x51')]})[_0x2cd0('0x1d')](function(_0x117fc0){_0x57a530[_0x2cd0('0x30')]=_0x117fc0;if(_0x504cad['query'][_0x2cd0('0x59')]){_0x1227d7[_0x2cd0('0x57')]=[{'model':db['CmContact'],'as':_0x2cd0('0xc3'),'required':![]},{'model':db[_0x2cd0('0xae')],'as':'Owner','attributes':['name',_0x2cd0('0xc4'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x2cd0('0xc5'),'attributes':['id','name',_0x2cd0('0xc6')],'where':_0x504cad[_0x2cd0('0x46')]['tag']?{'id':_0x504cad[_0x2cd0('0x46')][_0x2cd0('0xc7')]}:undefined,'required':_0x504cad['query'][_0x2cd0('0xc7')]?!![]:![]}];}return db[_0x2cd0('0xa3')][_0x2cd0('0x6e')](_0x1227d7);})[_0x2cd0('0x1d')](function(_0x1c3b81){_0x57a530['rows']=_0x1c3b81;return _0x57a530;});}})[_0x2cd0('0x1d')](respondWithFilteredResult(_0x5cdbeb,_0x1227d7))[_0x2cd0('0x28')](handleError(_0x5cdbeb,null));};exports[_0x2cd0('0x3b')]=function(_0x40d219,_0x259758,_0x449b2e){var _0x59fcc8,_0x481b97,_0x119a7e;if(_[_0x2cd0('0x97')](_0x40d219[_0x2cd0('0x5c')][_0x2cd0('0x5c')])||_0x40d219[_0x2cd0('0x5c')][_0x2cd0('0x5c')]===''){throw new db['Sequelize']['ValidationError'](_0x2cd0('0xc8'));}if(_[_0x2cd0('0x97')](_0x40d219[_0x2cd0('0x5c')]['to'])){throw new db[(_0x2cd0('0x98'))][(_0x2cd0('0x78'))](_0x2cd0('0xc9'));}_0x59fcc8=_0x40d219[_0x2cd0('0x5c')]['to'];return db['SmsAccount'][_0x2cd0('0x5a')]({'where':{'id':_0x40d219[_0x2cd0('0x63')]['id']},'include':[{'model':db[_0x2cd0('0x9d')],'as':'List','include':[{'model':db[_0x2cd0('0xa2')],'as':_0x2cd0('0x9e'),'where':{'mobile':_0x59fcc8},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x2cd0('0x1d')](handleEntityNotFound(_0x259758,null))[_0x2cd0('0x1d')](function(_0x132856){if(_0x132856&&_0x132856[_0x2cd0('0xca')]){_0x481b97=_0x132856[_0x2cd0('0x37')]({'plain':!![]});if(_0x481b97['List']&&_0x481b97[_0x2cd0('0xca')][_0x2cd0('0x9e')][_0x2cd0('0x4d')]){return _0x481b97['List']['Contacts'][0x0];}return db[_0x2cd0('0xa2')][_0x2cd0('0x5b')](_[_0x2cd0('0x17')](_0x40d219['body'],{'firstName':_0x59fcc8,'mobile':_0x59fcc8,'phone':_0x59fcc8,'ListId':_0x481b97[_0x2cd0('0x7e')]}));}})[_0x2cd0('0x1d')](handleEntityNotFound(_0x259758,null))[_0x2cd0('0x1d')](function(_0x345f80){if(_0x345f80){_0x119a7e=_0x345f80;return db[_0x2cd0('0xa3')]['find']({'where':{'ContactId':_0x119a7e['id'],'closed':![],'SmsAccountId':_0x481b97['id']}})[_0x2cd0('0x1d')](function(_0x1a6d9b){if(_0x1a6d9b){return[_0x1a6d9b,![]];}return db[_0x2cd0('0xa3')][_0x2cd0('0x5b')]({'UserId':_0x40d219[_0x2cd0('0x5e')]['id'],'ContactId':_0x119a7e['id'],'SmsAccountId':_0x481b97['id'],'phone':_0x59fcc8,'firstMsgDirection':'out','Messages':[_[_0x2cd0('0x55')](_0x40d219['body'],{'read':![],'body':_0x40d219[_0x2cd0('0x5c')][_0x2cd0('0x5c')],'phone':_0x59fcc8,'SmsAccountId':_0x481b97['id'],'UserId':_0x40d219[_0x2cd0('0x5e')]['id'],'ContactId':_0x119a7e['id']})]},{'include':[{'model':db[_0x2cd0('0xcb')],'as':_0x2cd0('0xcc')}]})[_0x2cd0('0x1d')](function(_0x48709a){return[_0x48709a,!![]];});});}})['spread'](function(_0x16b45e,_0xd050b){if(_0xd050b){return _0x16b45e;}return db['SmsMessage'][_0x2cd0('0x5b')](_['merge'](_0x40d219['body'],{'read':![],'body':_0x40d219[_0x2cd0('0x5c')][_0x2cd0('0x5c')],'phone':_0x59fcc8,'SmsAccountId':_0x481b97['id'],'SmsInteractionId':_0x16b45e['id'],'UserId':_0x40d219[_0x2cd0('0x5e')]['id'],'ContactId':_0x119a7e['id']}))['then'](function(_0x8cb9c9){_0x16b45e[_0x2cd0('0xcd')]['Messages']=[];_0x16b45e['dataValues'][_0x2cd0('0xcc')][_0x2cd0('0xa8')](_0x8cb9c9[_0x2cd0('0xcd')]);return _0x16b45e;});})[_0x2cd0('0x1d')](respondWithResult(_0x259758,null))[_0x2cd0('0x28')](handleError(_0x259758,null));};exports[_0x2cd0('0x2b')]=function(_0xccd9e5,_0xb7b370,_0x5a1004){if(_0xccd9e5['body']['id']){delete _0xccd9e5[_0x2cd0('0x5c')]['id'];}var _0x5d8810,_0x385855,_0xd30898;return db[_0x2cd0('0x40')][_0x2cd0('0x5a')]({'where':{'id':_0xccd9e5[_0x2cd0('0x63')]['id']}})[_0x2cd0('0x1d')](handleEntityNotFound(_0xb7b370,null))[_0x2cd0('0x1d')](function(_0x495d9b){if(_0x495d9b){_0xd30898=_0x495d9b;logger[_0x2cd0('0x20')](_0x2cd0('0x21'),_0x2cd0('0x2b'),'received\x20delivery\x20report\x20from',_0x495d9b[_0x2cd0('0x43')],util[_0x2cd0('0xce')](_0xccd9e5[_0x2cd0('0x5c')],{'showHidden':![],'depth':null}));switch(_0x495d9b['type']){case'skebby':if(_0xccd9e5[_0x2cd0('0x5c')][_0x2cd0('0xcf')]&&_0xccd9e5[_0x2cd0('0x5c')][_0x2cd0('0x2b')]){_0x385855=_0xccd9e5['body'][_0x2cd0('0x2b')];return db['SmsMessage'][_0x2cd0('0x5a')]({'where':{'messageId':_0xccd9e5[_0x2cd0('0x5c')][_0x2cd0('0xcf')]}});}break;case _0x2cd0('0x89'):if(_0xccd9e5[_0x2cd0('0x5c')][_0x2cd0('0xd0')]&&_0xccd9e5[_0x2cd0('0x5c')][_0x2cd0('0xd1')]){_0x385855=_0xccd9e5[_0x2cd0('0x5c')][_0x2cd0('0xd1')];return db[_0x2cd0('0xcb')][_0x2cd0('0x5a')]({'where':{'messageId':_0xccd9e5[_0x2cd0('0x5c')][_0x2cd0('0xd0')]}});}break;case _0x2cd0('0x8a'):if(_0xccd9e5[_0x2cd0('0x5c')]['message_id']&&_0xccd9e5[_0x2cd0('0x5c')][_0x2cd0('0xd2')]){_0x385855=_0xccd9e5[_0x2cd0('0x5c')][_0x2cd0('0xd2')];return db[_0x2cd0('0xcb')]['find']({'where':{'messageId':_0xccd9e5[_0x2cd0('0x5c')][_0x2cd0('0x8b')]}});}break;case _0x2cd0('0x8f'):var _0x44ef31=_0xccd9e5[_0x2cd0('0x5c')]['results'][0x0];if(_0x44ef31[_0x2cd0('0x83')]&&_0x44ef31[_0x2cd0('0x2b')][_0x2cd0('0xd3')]===_0x2cd0('0xd4')){_0x385855=_0x44ef31[_0x2cd0('0x2b')]['groupName'];return db[_0x2cd0('0xcb')][_0x2cd0('0x5a')]({'where':{'messageId':_0x44ef31[_0x2cd0('0x83')]}});}break;case'clickatell':if(_0xccd9e5['body']['messageId']&&_0xccd9e5[_0x2cd0('0x5c')][_0x2cd0('0x2b')]){_0x385855=_0xccd9e5[_0x2cd0('0x5c')][_0x2cd0('0x2b')];return db[_0x2cd0('0xcb')]['find']({'where':{'messageId':_0xccd9e5[_0x2cd0('0x5c')][_0x2cd0('0x83')]}});}break;case'bandwidth':if(_0xccd9e5['body'][0x0][_0x2cd0('0x25')]['id']){_0x385855=_0xccd9e5[_0x2cd0('0x5c')][0x0]['type'];return db[_0x2cd0('0xcb')][_0x2cd0('0x5a')]({'where':{'messageId':_0xccd9e5[_0x2cd0('0x5c')][0x0][_0x2cd0('0x25')]['id']}});}break;case _0x2cd0('0x95'):if(_0xccd9e5[_0x2cd0('0x5c')]['redif']&&_0xccd9e5[_0x2cd0('0x5c')]['status']){_0x385855=_0xccd9e5[_0x2cd0('0x5c')][_0x2cd0('0x2b')];return db[_0x2cd0('0xcb')][_0x2cd0('0x5a')]({'where':{'messageId':_0xccd9e5[_0x2cd0('0x5c')][_0x2cd0('0xd5')]}});}break;}}})['then'](handleEntityNotFound(_0xb7b370,null))[_0x2cd0('0x1d')](function(_0x1b7c16){if(_0x1b7c16){_0x5d8810=_0x1b7c16;switch(_0xd30898['type']){case _0x2cd0('0x85'):if(_0x385855==='DELIVERED'){return _0x5d8810['update']({'read':!![]});}else{logger[_0x2cd0('0x23')](_0x2cd0('0x21'),'status','skebby',util[_0x2cd0('0xce')](_0xccd9e5['body'],{'showHidden':![],'depth':null}));}break;case _0x2cd0('0x89'):if(_0x385855==='1'){return _0x5d8810['update']({'read':!![]});}else{logger[_0x2cd0('0x23')](_0x2cd0('0x21'),'status',_0x2cd0('0x85'),util[_0x2cd0('0xce')](_0xccd9e5[_0x2cd0('0x5c')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0xccd9e5[_0x2cd0('0x5c')][_0x2cd0('0xd6')]&&_0x385855>=0xc8&&_0x385855<=0xce){return _0x5d8810[_0x2cd0('0x62')]({'read':!![]});}else{logger[_0x2cd0('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2cd0('0x2b'),_0x2cd0('0x8a'),util[_0x2cd0('0xce')](_0xccd9e5[_0x2cd0('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x2cd0('0x8f'):var _0x1789f1=_0xccd9e5['body']['results'][0x0];if(_0x1789f1[_0x2cd0('0x2b')]['groupName']===_0x2cd0('0xd4')){return _0x5d8810[_0x2cd0('0x62')]({'read':!![]});}else{logger[_0x2cd0('0x23')](_0x2cd0('0x21'),_0x2cd0('0x2b'),_0x2cd0('0x8f'),util[_0x2cd0('0xce')](_0xccd9e5['body'],{'showHidden':![],'depth':null}));}break;case _0x2cd0('0xd7'):if(_0x385855==_0x2cd0('0xd8')||_0x385855==_0x2cd0('0xd9')){return _0x5d8810['update']({'read':!![]});}else{logger[_0x2cd0('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2cd0('0x2b'),_0x2cd0('0xd7'),util[_0x2cd0('0xce')](_0xccd9e5['body'],{'showHidden':![],'depth':null}));}break;case _0x2cd0('0xda'):if(_0x385855=='message-delivered'){return _0x5d8810[_0x2cd0('0x62')]({'read':!![]});}else{logger['error'](_0x2cd0('0x21'),'status','bandwidth',util[_0x2cd0('0xce')](_0xccd9e5['body'],{'showHidden':![],'depth':null}));}break;case _0x2cd0('0x95'):if(_0x385855===_0x2cd0('0xdb')||_0x385855===_0x2cd0('0xdc')){return _0x5d8810[_0x2cd0('0x62')]({'read':!![]});}else{logger[_0x2cd0('0x23')](_0x2cd0('0x21'),_0x2cd0('0x2b'),_0x2cd0('0x95'),util[_0x2cd0('0xce')](_0xccd9e5[_0x2cd0('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x5d8810;}})[_0x2cd0('0x1d')](respondWithResult(_0xb7b370,null))[_0x2cd0('0x28')](handleError(_0xb7b370,null));};exports[_0x2cd0('0xdd')]=function(_0xa7cf83,_0x3e038b,_0x39e946){var _0x205b4a,_0x1a626b,_0x47a2a2;return db[_0x2cd0('0x40')][_0x2cd0('0x5a')]({'where':{'id':_0xa7cf83['params']['id']}})[_0x2cd0('0x1d')](handleEntityNotFound(_0x3e038b,null))['then'](function(_0x335d01){if(_0x335d01){_0x47a2a2=_0x335d01;logger[_0x2cd0('0x20')](_0x2cd0('0x21'),'status',_0x2cd0('0xde'),_0x335d01[_0x2cd0('0x43')],util['inspect'](_0xa7cf83[_0x2cd0('0x46')],{'showHidden':![],'depth':null}));switch(_0x335d01['type']){case _0x2cd0('0xdf'):if(_0xa7cf83[_0x2cd0('0x46')][_0x2cd0('0xe0')]&&_0xa7cf83[_0x2cd0('0x46')]['state']){_0x1a626b=_0xa7cf83[_0x2cd0('0x46')][_0x2cd0('0xe1')];return db[_0x2cd0('0xcb')][_0x2cd0('0x5a')]({'where':{'messageId':_0xa7cf83[_0x2cd0('0x46')]['message-id']}});}break;}}})[_0x2cd0('0x1d')](handleEntityNotFound(_0x3e038b,null))['then'](function(_0x59e14f){if(_0x59e14f){_0x205b4a=_0x59e14f;switch(_0x47a2a2['type']){case _0x2cd0('0xdf'):if(_0x1a626b==='2'||_0x1a626b==='6'){return _0x205b4a[_0x2cd0('0x62')]({'read':!![]});}else{logger[_0x2cd0('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','csc',util[_0x2cd0('0xce')](_0xa7cf83[_0x2cd0('0x46')],{'showHidden':![],'depth':null}));};break;}return _0x205b4a;}})[_0x2cd0('0x1d')](respondWithResult(_0x3e038b,null))[_0x2cd0('0x28')](handleError(_0x3e038b,null));};exports['addAgents']=function(_0x580b65,_0x1f01ee,_0x37df32){return db['SmsAccount'][_0x2cd0('0x5a')]({'where':{'id':_0x580b65[_0x2cd0('0x63')]['id']}})[_0x2cd0('0x1d')](handleEntityNotFound(_0x1f01ee,null))['then'](function(_0x91bbf8){if(_0x91bbf8){return _0x91bbf8[_0x2cd0('0xe2')](_0x580b65['body'][_0x2cd0('0x70')],_[_0x2cd0('0xa1')](_0x580b65['body'],[_0x2cd0('0x70'),'id'])||{})[_0x2cd0('0xa4')](function(_0x56bc41){for(var _0x11f9e8=0x0;_0x11f9e8<_0x580b65['body'][_0x2cd0('0x70')]['length'];_0x11f9e8+=0x1){socket[_0x2cd0('0xe3')]('userSmsAccount:save',{'UserId':Number(_0x580b65[_0x2cd0('0x5c')][_0x2cd0('0x70')][_0x11f9e8]),'SmsAccountId':Number(_0x580b65[_0x2cd0('0x63')]['id'])});}return _0x56bc41;});}})['then'](respondWithResult(_0x1f01ee,null))[_0x2cd0('0x28')](handleError(_0x1f01ee,null));};exports[_0x2cd0('0xe4')]=function(_0xe77f25,_0x276888,_0x3b1539){return db[_0x2cd0('0x40')][_0x2cd0('0x5a')]({'where':{'id':_0xe77f25[_0x2cd0('0x63')]['id']}})[_0x2cd0('0x1d')](handleEntityNotFound(_0x276888,null))[_0x2cd0('0x1d')](function(_0x5a363e){if(_0x5a363e){return _0x5a363e[_0x2cd0('0xe4')](_0xe77f25[_0x2cd0('0x46')]['ids'])[_0x2cd0('0x1d')](function(){if(_[_0x2cd0('0xe5')](_0xe77f25['query'][_0x2cd0('0x70')])){for(var _0x304c41=0x0;_0x304c41<_0xe77f25['query'][_0x2cd0('0x70')]['length'];_0x304c41+=0x1){socket[_0x2cd0('0xe3')](_0x2cd0('0xe6'),{'UserId':Number(_0xe77f25[_0x2cd0('0x46')][_0x2cd0('0x70')][_0x304c41]),'SmsAccountId':Number(_0xe77f25['params']['id'])});}}else{socket[_0x2cd0('0xe3')](_0x2cd0('0xe6'),{'UserId':Number(_0xe77f25[_0x2cd0('0x46')][_0x2cd0('0x70')]),'SmsAccountId':Number(_0xe77f25[_0x2cd0('0x63')]['id'])});}});}})[_0x2cd0('0x1d')](respondWithStatusCode(_0x276888,null))[_0x2cd0('0x28')](handleError(_0x276888,null));};exports[_0x2cd0('0xe7')]=function(_0x562073,_0x4fdb8b,_0x1350d6){var _0x172344={};var _0x22ef7d={};var _0x217dec;var _0x2b353a;return db[_0x2cd0('0x40')]['findOne']({'where':{'id':_0x562073[_0x2cd0('0x63')]['id']}})[_0x2cd0('0x1d')](handleEntityNotFound(_0x4fdb8b,null))['then'](function(_0x574af9){if(_0x574af9){_0x217dec=_0x574af9;_0x22ef7d[_0x2cd0('0x4b')]=_['keys'](db[_0x2cd0('0xae')][_0x2cd0('0x41')]);_0x22ef7d[_0x2cd0('0x46')]=_['keys'](_0x562073[_0x2cd0('0x46')]);_0x22ef7d[_0x2cd0('0x48')]=_[_0x2cd0('0x49')](_0x22ef7d[_0x2cd0('0x4b')],_0x22ef7d[_0x2cd0('0x46')]);_0x172344[_0x2cd0('0x4a')]=_[_0x2cd0('0x49')](_0x22ef7d[_0x2cd0('0x4b')],qs['fields'](_0x562073[_0x2cd0('0x46')][_0x2cd0('0x4c')]));_0x172344[_0x2cd0('0x4a')]=_0x172344[_0x2cd0('0x4a')]['length']?_0x172344[_0x2cd0('0x4a')]:_0x22ef7d[_0x2cd0('0x4b')];_0x172344[_0x2cd0('0x50')]=qs[_0x2cd0('0x68')](_0x562073[_0x2cd0('0x46')]['sort']);_0x172344[_0x2cd0('0x51')]=qs[_0x2cd0('0x48')](_['pick'](_0x562073[_0x2cd0('0x46')],_0x22ef7d[_0x2cd0('0x48')]));if(_0x562073[_0x2cd0('0x46')]['filter']){_0x172344[_0x2cd0('0x51')]=_[_0x2cd0('0x55')](_0x172344[_0x2cd0('0x51')],{'$or':_['map'](_0x172344[_0x2cd0('0x4a')],function(_0x9d2d13){var _0x4c3adb={};_0x4c3adb[_0x9d2d13]={'$like':'%'+_0x562073[_0x2cd0('0x46')][_0x2cd0('0x53')]+'%'};return _0x4c3adb;})});}_0x172344=_[_0x2cd0('0x55')]({},_0x172344,_0x562073['options']);return _0x217dec[_0x2cd0('0xe7')](_0x172344);}})[_0x2cd0('0x1d')](function(_0x214f2e){if(_0x214f2e){_0x2b353a=_0x214f2e[_0x2cd0('0x4d')];if(!_0x562073['query'][_0x2cd0('0x4e')](_0x2cd0('0x4f'))){_0x172344[_0x2cd0('0x2f')]=qs[_0x2cd0('0x2f')](_0x562073[_0x2cd0('0x46')][_0x2cd0('0x2f')]);_0x172344[_0x2cd0('0x2d')]=qs[_0x2cd0('0x2d')](_0x562073[_0x2cd0('0x46')]['offset']);}return _0x217dec[_0x2cd0('0xe7')](_0x172344);}})[_0x2cd0('0x1d')](function(_0x59eaaa){if(_0x59eaaa){return _0x59eaaa?{'count':_0x2b353a,'rows':_0x59eaaa}:null;}})[_0x2cd0('0x1d')](respondWithResult(_0x4fdb8b,null))[_0x2cd0('0x28')](handleError(_0x4fdb8b,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 8b7d5b2..ffbd693 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 _0xdbfa=['exports','events','../../mysqldb','SmsAccount','update','remove','emit','hasOwnProperty','hook'];(function(_0xffeff7,_0x17b2f5){var _0x5e4869=function(_0x33899e){while(--_0x33899e){_0xffeff7['push'](_0xffeff7['shift']());}};_0x5e4869(++_0x17b2f5);}(_0xdbfa,0x19f));var _0xadbf=function(_0x547891,_0x3328b2){_0x547891=_0x547891-0x0;var _0x3d4f2c=_0xdbfa[_0x547891];return _0x3d4f2c;};'use strict';var EventEmitter=require(_0xadbf('0x0'));var SmsAccount=require(_0xadbf('0x1'))['db'][_0xadbf('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xadbf('0x3'),'afterDestroy':_0xadbf('0x4')};function emitEvent(_0x53bf54){return function(_0x5c9ef2,_0x4223fb,_0x4ddc9f){SmsAccountEvents[_0xadbf('0x5')](_0x53bf54+':'+_0x5c9ef2['id'],_0x5c9ef2);SmsAccountEvents[_0xadbf('0x5')](_0x53bf54,_0x5c9ef2);_0x4ddc9f(null);};}for(var e in events){if(events[_0xadbf('0x6')](e)){var event=events[e];SmsAccount[_0xadbf('0x7')](e,emitEvent(event));}}module[_0xadbf('0x8')]=SmsAccountEvents; \ No newline at end of file +var _0x4096=['emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','update'];(function(_0x274df4,_0x236790){var _0x290c03=function(_0x4124f9){while(--_0x4124f9){_0x274df4['push'](_0x274df4['shift']());}};_0x290c03(++_0x236790);}(_0x4096,0x13f));var _0x6409=function(_0x4bace8,_0x1bbddb){_0x4bace8=_0x4bace8-0x0;var _0x509111=_0x4096[_0x4bace8];return _0x509111;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x6409('0x0'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x6409('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6409('0x2'),'afterDestroy':'remove'};function emitEvent(_0x20c5c2){return function(_0x49aad5,_0x115b96,_0x13d6f3){SmsAccountEvents[_0x6409('0x3')](_0x20c5c2+':'+_0x49aad5['id'],_0x49aad5);SmsAccountEvents[_0x6409('0x3')](_0x20c5c2,_0x49aad5);_0x13d6f3(null);};}for(var e in events){if(events[_0x6409('0x4')](e)){var event=events[e];SmsAccount[_0x6409('0x5')](e,emitEvent(event));}}module[_0x6409('0x6')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index d5a40c5..f68594b 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 _0x0904=['../../config/logger','api','moment','bluebird','request-promise','./smsAccount.attributes','define','SmsAccount','sms_accounts','lodash','util'];(function(_0x5440b9,_0xffabd3){var _0x7664ba=function(_0xf8f19d){while(--_0xf8f19d){_0x5440b9['push'](_0x5440b9['shift']());}};_0x7664ba(++_0xffabd3);}(_0x0904,0x18a));var _0x4090=function(_0x5da440,_0x50fe36){_0x5da440=_0x5da440-0x0;var _0x231f3b=_0x0904[_0x5da440];return _0x231f3b;};'use strict';var _=require(_0x4090('0x0'));var util=require(_0x4090('0x1'));var logger=require(_0x4090('0x2'))(_0x4090('0x3'));var moment=require(_0x4090('0x4'));var BPromise=require(_0x4090('0x5'));var rp=require(_0x4090('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4090('0x7'));module['exports']=function(_0x3caffb,_0x1a9eae){return _0x3caffb[_0x4090('0x8')](_0x4090('0x9'),attributes,{'tableName':_0x4090('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc681=['./smsAccount.attributes','exports','define','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x1fd608,_0x54f8c5){var _0x441f29=function(_0x492402){while(--_0x492402){_0x1fd608['push'](_0x1fd608['shift']());}};_0x441f29(++_0x54f8c5);}(_0xc681,0x7c));var _0x1c68=function(_0x5e2999,_0x3b2e4a){_0x5e2999=_0x5e2999-0x0;var _0x3262c3=_0xc681[_0x5e2999];return _0x3262c3;};'use strict';var _=require(_0x1c68('0x0'));var util=require(_0x1c68('0x1'));var logger=require('../../config/logger')(_0x1c68('0x2'));var moment=require(_0x1c68('0x3'));var BPromise=require('bluebird');var rp=require(_0x1c68('0x4'));var fs=require('fs');var path=require(_0x1c68('0x5'));var rimraf=require(_0x1c68('0x6'));var config=require(_0x1c68('0x7'));var attributes=require(_0x1c68('0x8'));module[_0x1c68('0x9')]=function(_0x3d1f2d,_0x24e53b){return _0x3d1f2d[_0x1c68('0xa')]('SmsAccount',attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index 9a80fb0..26fefad 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 _0x6c9c=['catch','SmsAccount','find','options','raw','where','attributes','include','map','model','ShowSmsAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','./smsAccount.socket','register','request','then','info','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','result'];(function(_0x26093d,_0x576a4a){var _0x41e263=function(_0x4b9fbc){while(--_0x4b9fbc){_0x26093d['push'](_0x26093d['shift']());}};_0x41e263(++_0x576a4a);}(_0x6c9c,0x143));var _0xc6c9=function(_0x21d584,_0x3186a3){_0x21d584=_0x21d584-0x0;var _0x5137a0=_0x6c9c[_0x21d584];return _0x5137a0;};'use strict';var _=require(_0xc6c9('0x0'));var util=require(_0xc6c9('0x1'));var moment=require(_0xc6c9('0x2'));var BPromise=require(_0xc6c9('0x3'));var rs=require(_0xc6c9('0x4'));var fs=require('fs');var Redis=require(_0xc6c9('0x5'));var db=require(_0xc6c9('0x6'))['db'];var utils=require(_0xc6c9('0x7'));var logger=require(_0xc6c9('0x8'))(_0xc6c9('0x9'));var config=require(_0xc6c9('0xa'));var jayson=require(_0xc6c9('0xb'));var client=jayson['client'][_0xc6c9('0xc')]({'port':0x232a});config[_0xc6c9('0xd')]=_['defaults'](config[_0xc6c9('0xd')],{'host':_0xc6c9('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc6c9('0xd')]));require(_0xc6c9('0xf'))[_0xc6c9('0x10')](socket);function respondWithRpcPromise(_0x376c4b,_0x2b1b38,_0x90ddda){return new BPromise(function(_0x34e6b7,_0x5f3745){return client[_0xc6c9('0x11')](_0x376c4b,_0x90ddda)[_0xc6c9('0x12')](function(_0x478d89){logger[_0xc6c9('0x13')]('SmsAccount,\x20%s,\x20%s',_0x2b1b38,_0xc6c9('0x14'));logger['debug'](_0xc6c9('0x15'),_0x2b1b38,_0xc6c9('0x14'),JSON[_0xc6c9('0x16')](_0x478d89));if(_0x478d89[_0xc6c9('0x17')]){if(_0x478d89[_0xc6c9('0x17')][_0xc6c9('0x18')]===0x1f4){logger[_0xc6c9('0x17')](_0xc6c9('0x19'),_0x2b1b38,_0x478d89['error'][_0xc6c9('0x1a')]);return _0x5f3745(_0x478d89[_0xc6c9('0x17')][_0xc6c9('0x1a')]);}logger[_0xc6c9('0x17')](_0xc6c9('0x19'),_0x2b1b38,_0x478d89[_0xc6c9('0x17')]['message']);return _0x34e6b7(_0x478d89[_0xc6c9('0x17')][_0xc6c9('0x1a')]);}else{logger[_0xc6c9('0x13')](_0xc6c9('0x19'),_0x2b1b38,'request\x20sent');_0x34e6b7(_0x478d89[_0xc6c9('0x1b')][_0xc6c9('0x1a')]);}})[_0xc6c9('0x1c')](function(_0x479ab5){logger[_0xc6c9('0x17')]('SmsAccount,\x20%s,\x20%s',_0x2b1b38,_0x479ab5);_0x5f3745(_0x479ab5);});});}exports['ShowSmsAccount']=function(_0x37a0fe){var _0x3b07f6=this;return new Promise(function(_0x7e6b96,_0x50fc19){return db[_0xc6c9('0x1d')][_0xc6c9('0x1e')]({'raw':_0x37a0fe['options']?_0x37a0fe[_0xc6c9('0x1f')][_0xc6c9('0x20')]===undefined?!![]:![]:!![],'where':_0x37a0fe[_0xc6c9('0x1f')]?_0x37a0fe[_0xc6c9('0x1f')][_0xc6c9('0x21')]||null:null,'attributes':_0x37a0fe['options']?_0x37a0fe[_0xc6c9('0x1f')][_0xc6c9('0x22')]||null:null,'include':_0x37a0fe[_0xc6c9('0x1f')]?_0x37a0fe['options'][_0xc6c9('0x23')]?_['map'](_0x37a0fe[_0xc6c9('0x1f')][_0xc6c9('0x23')],function(_0x2d7f49){return{'model':db[_0x2d7f49['model']],'as':_0x2d7f49['as'],'attributes':_0x2d7f49[_0xc6c9('0x22')],'include':_0x2d7f49[_0xc6c9('0x23')]?_[_0xc6c9('0x24')](_0x2d7f49[_0xc6c9('0x23')],function(_0x5d92c8){return{'model':db[_0x5d92c8['model']],'as':_0x5d92c8['as'],'attributes':_0x5d92c8[_0xc6c9('0x22')],'include':_0x5d92c8[_0xc6c9('0x23')]?_['map'](_0x5d92c8[_0xc6c9('0x23')],function(_0xc925f){return{'model':db[_0xc925f[_0xc6c9('0x25')]],'as':_0xc925f['as'],'attributes':_0xc925f['attributes']};}):[]};}):[]};}):[]:[]})[_0xc6c9('0x12')](function(_0x1e5e76){logger['info'](_0xc6c9('0x26'),_0x37a0fe);logger['debug'](_0xc6c9('0x26'),_0x37a0fe,JSON[_0xc6c9('0x16')](_0x1e5e76));_0x7e6b96(_0x1e5e76);})['catch'](function(_0x56007c){logger['error'](_0xc6c9('0x26'),_0x56007c[_0xc6c9('0x1a')],_0x37a0fe);_0x50fc19(_0x3b07f6[_0xc6c9('0x17')](0x1f4,_0x56007c['message']));});});}; \ No newline at end of file +var _0x63c0=['error','message','SmsAccount,\x20%s,\x20%s','catch','ShowSmsAccount','find','options','where','attributes','include','map','model','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','request','then','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x63c0,0x16a));var _0x063c=function(_0x5d340a,_0x2441da){_0x5d340a=_0x5d340a-0x0;var _0x435564=_0x63c0[_0x5d340a];return _0x435564;};'use strict';var _=require(_0x063c('0x0'));var util=require(_0x063c('0x1'));var moment=require(_0x063c('0x2'));var BPromise=require(_0x063c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x063c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x063c('0x5'));var logger=require('../../config/logger')(_0x063c('0x6'));var config=require(_0x063c('0x7'));var jayson=require(_0x063c('0x8'));var client=jayson[_0x063c('0x9')][_0x063c('0xa')]({'port':0x232a});config[_0x063c('0xb')]=_[_0x063c('0xc')](config[_0x063c('0xb')],{'host':_0x063c('0xd'),'port':0x18eb});var socket=require(_0x063c('0xe'))(new Redis(config[_0x063c('0xb')]));require(_0x063c('0xf'))['register'](socket);function respondWithRpcPromise(_0x22e28a,_0x47cb97,_0x573555){return new BPromise(function(_0x440e57,_0x319c56){return client[_0x063c('0x10')](_0x22e28a,_0x573555)[_0x063c('0x11')](function(_0x3b0083){logger[_0x063c('0x12')]('SmsAccount,\x20%s,\x20%s',_0x47cb97,_0x063c('0x13'));logger[_0x063c('0x14')](_0x063c('0x15'),_0x47cb97,_0x063c('0x13'),JSON[_0x063c('0x16')](_0x3b0083));if(_0x3b0083[_0x063c('0x17')]){if(_0x3b0083['error']['code']===0x1f4){logger[_0x063c('0x17')]('SmsAccount,\x20%s,\x20%s',_0x47cb97,_0x3b0083[_0x063c('0x17')]['message']);return _0x319c56(_0x3b0083[_0x063c('0x17')][_0x063c('0x18')]);}logger[_0x063c('0x17')](_0x063c('0x19'),_0x47cb97,_0x3b0083['error'][_0x063c('0x18')]);return _0x440e57(_0x3b0083[_0x063c('0x17')][_0x063c('0x18')]);}else{logger[_0x063c('0x12')]('SmsAccount,\x20%s,\x20%s',_0x47cb97,_0x063c('0x13'));_0x440e57(_0x3b0083['result'][_0x063c('0x18')]);}})[_0x063c('0x1a')](function(_0x9b7e8a){logger[_0x063c('0x17')](_0x063c('0x19'),_0x47cb97,_0x9b7e8a);_0x319c56(_0x9b7e8a);});});}exports[_0x063c('0x1b')]=function(_0x253214){var _0xc48e95=this;return new Promise(function(_0x955d14,_0x1a8b13){return db['SmsAccount'][_0x063c('0x1c')]({'raw':_0x253214['options']?_0x253214[_0x063c('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x253214[_0x063c('0x1d')]?_0x253214['options'][_0x063c('0x1e')]||null:null,'attributes':_0x253214[_0x063c('0x1d')]?_0x253214[_0x063c('0x1d')][_0x063c('0x1f')]||null:null,'include':_0x253214[_0x063c('0x1d')]?_0x253214[_0x063c('0x1d')][_0x063c('0x20')]?_['map'](_0x253214[_0x063c('0x1d')][_0x063c('0x20')],function(_0x4f5e37){return{'model':db[_0x4f5e37['model']],'as':_0x4f5e37['as'],'attributes':_0x4f5e37[_0x063c('0x1f')],'include':_0x4f5e37[_0x063c('0x20')]?_['map'](_0x4f5e37[_0x063c('0x20')],function(_0x3dd22d){return{'model':db[_0x3dd22d['model']],'as':_0x3dd22d['as'],'attributes':_0x3dd22d[_0x063c('0x1f')],'include':_0x3dd22d[_0x063c('0x20')]?_[_0x063c('0x21')](_0x3dd22d[_0x063c('0x20')],function(_0x1421fa){return{'model':db[_0x1421fa[_0x063c('0x22')]],'as':_0x1421fa['as'],'attributes':_0x1421fa['attributes']};}):[]};}):[]};}):[]:[]})[_0x063c('0x11')](function(_0x271f75){logger[_0x063c('0x12')](_0x063c('0x1b'),_0x253214);logger['debug']('ShowSmsAccount',_0x253214,JSON[_0x063c('0x16')](_0x271f75));_0x955d14(_0x271f75);})[_0x063c('0x1a')](function(_0x34a830){logger['error'](_0x063c('0x1b'),_0x34a830[_0x063c('0x18')],_0x253214);_0x1a8b13(_0xc48e95['error'](0x1f4,_0x34a830[_0x063c('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 7bd2ad1..171342d 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index 3a2598b..f354554 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['path','connect-timeout','express','../../components/auth/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer'];(function(_0x201490,_0x235e70){var _0x1479df=function(_0xb018ba){while(--_0xb018ba){_0x201490['push'](_0x201490['shift']());}};_0x1479df(++_0x235e70);}(_0x3e74,0x175));var _0x43e7=function(_0x101036,_0x321f63){_0x101036=_0x101036-0x0;var _0x9713c=_0x3e74[_0x101036];return _0x9713c;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0xc')]('/',auth[_0x43e7('0x8')](),controller['create']);router[_0x43e7('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xf')]('/:id',auth[_0x43e7('0x8')](),controller['destroy']);module[_0x43e7('0x10')]=router; \ No newline at end of file +var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index f090fe7..229c0d2 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 _0x3312=['INTEGER','noop','TEXT','STRING','*,*,*,*','sequelize'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0x3312,0x167));var _0x2331=function(_0x1af930,_0x350170){_0x1af930=_0x1af930-0x0;var _0x4d4672=_0x3312[_0x1af930];return _0x4d4672;};'use strict';var Sequelize=require(_0x2331('0x0'));module['exports']={'priority':{'type':Sequelize[_0x2331('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2331('0x2')},'appdata':{'type':Sequelize[_0x2331('0x3')]()},'description':{'type':Sequelize[_0x2331('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x2331('0x5')}}; \ No newline at end of file +var _0xa1ad=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x9e6147,_0x17cacb){var _0x22e824=function(_0x57f3e6){while(--_0x57f3e6){_0x9e6147['push'](_0x9e6147['shift']());}};_0x22e824(++_0x17cacb);}(_0xa1ad,0xd6));var _0xda1a=function(_0x25bca6,_0xe415ea){_0x25bca6=_0x25bca6-0x0;var _0x3f8d02=_0xa1ad[_0x25bca6];return _0x3f8d02;};'use strict';var Sequelize=require(_0xda1a('0x0'));module[_0xda1a('0x1')]={'priority':{'type':Sequelize[_0xda1a('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xda1a('0x3')],'allowNull':![],'defaultValue':_0xda1a('0x4')},'appdata':{'type':Sequelize[_0xda1a('0x5')]()},'description':{'type':Sequelize[_0xda1a('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xda1a('0x6')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index c89bf51..4a1edf1 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 _0xd30c=['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/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','set','reject','save','update','then','destroy','error','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','count','include','findAll','rows','catch','params','keys','includeAll','create','body','find','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs'];(function(_0x31f14a,_0x5b0358){var _0x3b7054=function(_0x4e2ffb){while(--_0x4e2ffb){_0x31f14a['push'](_0x31f14a['shift']());}};_0x3b7054(++_0x5b0358);}(_0xd30c,0x1bf));var _0xcd30=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0xd30c[_0x500419];return _0x241c1a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcd30('0x0'));var rp=require(_0xcd30('0x1'));var moment=require(_0xcd30('0x2'));var BPromise=require(_0xcd30('0x3'));var Mustache=require(_0xcd30('0x4'));var util=require('util');var path=require(_0xcd30('0x5'));var sox=require(_0xcd30('0x6'));var csv=require(_0xcd30('0x7'));var ejs=require(_0xcd30('0x8'));var fs=require('fs');var fs_extra=require(_0xcd30('0x9'));var _=require('lodash');var squel=require(_0xcd30('0xa'));var crypto=require(_0xcd30('0xb'));var jsforce=require(_0xcd30('0xc'));var deskjs=require(_0xcd30('0xd'));var toCsv=require(_0xcd30('0x7'));var querystring=require(_0xcd30('0xe'));var Papa=require(_0xcd30('0xf'));var Redis=require(_0xcd30('0x10'));var authService=require(_0xcd30('0x11'));var qs=require(_0xcd30('0x12'));var as=require(_0xcd30('0x13'));var hardwareService=require(_0xcd30('0x14'));var logger=require(_0xcd30('0x15'))(_0xcd30('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xcd30('0x17'));var db=require(_0xcd30('0x18'))['db'];function respondWithStatusCode(_0x2d26b6,_0x1f0f0e){_0x1f0f0e=_0x1f0f0e||0xcc;return function(_0xdb5375){if(_0xdb5375){return _0x2d26b6[_0xcd30('0x19')](_0x1f0f0e);}return _0x2d26b6[_0xcd30('0x1a')](_0x1f0f0e)[_0xcd30('0x1b')]();};}function respondWithResult(_0x475580,_0x1cf6d1){_0x1cf6d1=_0x1cf6d1||0xc8;return function(_0x59aade){if(_0x59aade){return _0x475580[_0xcd30('0x1a')](_0x1cf6d1)[_0xcd30('0x1c')](_0x59aade);}};}function respondWithFilteredResult(_0x58d517,_0x10cca7){return function(_0x39da2f){if(_0x39da2f){var _0x478f7a=typeof _0x10cca7[_0xcd30('0x1d')]===_0xcd30('0x1e')&&typeof _0x10cca7['limit']==='undefined';var _0x22a18c=_0x39da2f['count'];var _0x19d757=_0x478f7a?0x0:_0x10cca7[_0xcd30('0x1d')];var _0x5d81cf=_0x478f7a?_0x39da2f['count']:_0x10cca7['offset']+_0x10cca7['limit'];var _0xe31b9e;if(_0x5d81cf>=_0x22a18c){_0x5d81cf=_0x22a18c;_0xe31b9e=0xc8;}else{_0xe31b9e=0xce;}_0x58d517['status'](_0xe31b9e);return _0x58d517[_0xcd30('0x1f')]('Content-Range',_0x19d757+'-'+_0x5d81cf+'/'+_0x22a18c)[_0xcd30('0x1c')](_0x39da2f);}return null;};}function patchUpdates(_0x280b4d){return function(_0x322851){try{jsonpatch['apply'](_0x322851,_0x280b4d,!![]);}catch(_0x786f6d){return BPromise[_0xcd30('0x20')](_0x786f6d);}return _0x322851[_0xcd30('0x21')]();};}function saveUpdates(_0x2b363f,_0x2e7fed){return function(_0x5cf2a8){if(_0x5cf2a8){return _0x5cf2a8[_0xcd30('0x22')](_0x2b363f)[_0xcd30('0x23')](function(_0xf622ef){return _0xf622ef;});}return null;};}function removeEntity(_0x1c055c,_0x3a0fab){return function(_0x328183){if(_0x328183){return _0x328183[_0xcd30('0x24')]()[_0xcd30('0x23')](function(){_0x1c055c[_0xcd30('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d945c,_0x10da3c){return function(_0x22c8ab){if(!_0x22c8ab){_0x3d945c[_0xcd30('0x19')](0x194);}return _0x22c8ab;};}function handleError(_0x38e789,_0x526b02){_0x526b02=_0x526b02||0x1f4;return function(_0x2004e8){logger[_0xcd30('0x25')](_0x2004e8[_0xcd30('0x26')]);if(_0x2004e8['name']){delete _0x2004e8[_0xcd30('0x27')];}_0x38e789[_0xcd30('0x1a')](_0x526b02)[_0xcd30('0x28')](_0x2004e8);};}exports[_0xcd30('0x29')]=function(_0x4388bc,_0x427c4e){var _0x2acb3e={},_0x1edda9={},_0x110128={'count':0x0,'rows':[]};var _0x565ea7=_[_0xcd30('0x2a')](db[_0xcd30('0x2b')][_0xcd30('0x2c')],function(_0x4e6172){return{'name':_0x4e6172[_0xcd30('0x2d')],'type':_0x4e6172[_0xcd30('0x2e')]['key']};});_0x1edda9[_0xcd30('0x2f')]=_[_0xcd30('0x2a')](_0x565ea7,_0xcd30('0x27'));_0x1edda9[_0xcd30('0x30')]=_['keys'](_0x4388bc['query']);_0x1edda9[_0xcd30('0x31')]=_['intersection'](_0x1edda9[_0xcd30('0x2f')],_0x1edda9[_0xcd30('0x30')]);_0x2acb3e[_0xcd30('0x32')]=_[_0xcd30('0x33')](_0x1edda9['model'],qs[_0xcd30('0x34')](_0x4388bc[_0xcd30('0x30')][_0xcd30('0x34')]));_0x2acb3e['attributes']=_0x2acb3e['attributes'][_0xcd30('0x35')]?_0x2acb3e[_0xcd30('0x32')]:_0x1edda9['model'];if(!_0x4388bc[_0xcd30('0x30')][_0xcd30('0x36')](_0xcd30('0x37'))){_0x2acb3e[_0xcd30('0x38')]=qs[_0xcd30('0x38')](_0x4388bc['query'][_0xcd30('0x38')]);_0x2acb3e[_0xcd30('0x1d')]=qs[_0xcd30('0x1d')](_0x4388bc[_0xcd30('0x30')][_0xcd30('0x1d')]);}_0x2acb3e[_0xcd30('0x39')]=qs[_0xcd30('0x3a')](_0x4388bc[_0xcd30('0x30')][_0xcd30('0x3a')]);_0x2acb3e[_0xcd30('0x3b')]=qs[_0xcd30('0x31')](_[_0xcd30('0x3c')](_0x4388bc[_0xcd30('0x30')],_0x1edda9[_0xcd30('0x31')]),_0x565ea7);if(_0x4388bc[_0xcd30('0x30')][_0xcd30('0x3d')]){_0x2acb3e[_0xcd30('0x3b')]=_['merge'](_0x2acb3e[_0xcd30('0x3b')],{'$or':_['map'](_0x565ea7,function(_0x5bc151){if(_0x5bc151[_0xcd30('0x2e')]!==_0xcd30('0x3e')){var _0x4210c1={};_0x4210c1[_0x5bc151[_0xcd30('0x27')]]={'$like':'%'+_0x4388bc[_0xcd30('0x30')][_0xcd30('0x3d')]+'%'};return _0x4210c1;}})});}_0x2acb3e=_[_0xcd30('0x3f')]({},_0x2acb3e,_0x4388bc[_0xcd30('0x40')]);var _0x59323a={'where':_0x2acb3e[_0xcd30('0x3b')]};return db[_0xcd30('0x2b')][_0xcd30('0x41')](_0x59323a)[_0xcd30('0x23')](function(_0x4420c6){_0x110128[_0xcd30('0x41')]=_0x4420c6;if(_0x4388bc['query']['includeAll']){_0x2acb3e[_0xcd30('0x42')]=[{'all':!![]}];}return db[_0xcd30('0x2b')][_0xcd30('0x43')](_0x2acb3e);})[_0xcd30('0x23')](function(_0x10b378){_0x110128[_0xcd30('0x44')]=_0x10b378;return _0x110128;})[_0xcd30('0x23')](respondWithFilteredResult(_0x427c4e,_0x2acb3e))[_0xcd30('0x45')](handleError(_0x427c4e,null));};exports['show']=function(_0x4e49f7,_0x4367df){var _0x23c68f={'raw':!![],'where':{'id':_0x4e49f7[_0xcd30('0x46')]['id']}},_0x195476={};_0x195476[_0xcd30('0x2f')]=_[_0xcd30('0x47')](db['SmsApplication'][_0xcd30('0x2c')]);_0x195476[_0xcd30('0x30')]=_[_0xcd30('0x47')](_0x4e49f7['query']);_0x195476['filters']=_[_0xcd30('0x33')](_0x195476[_0xcd30('0x2f')],_0x195476[_0xcd30('0x30')]);_0x23c68f['attributes']=_['intersection'](_0x195476[_0xcd30('0x2f')],qs[_0xcd30('0x34')](_0x4e49f7[_0xcd30('0x30')][_0xcd30('0x34')]));_0x23c68f[_0xcd30('0x32')]=_0x23c68f[_0xcd30('0x32')][_0xcd30('0x35')]?_0x23c68f['attributes']:_0x195476[_0xcd30('0x2f')];if(_0x4e49f7['query'][_0xcd30('0x48')]){_0x23c68f['include']=[{'all':!![]}];}_0x23c68f=_[_0xcd30('0x3f')]({},_0x23c68f,_0x4e49f7[_0xcd30('0x40')]);return db[_0xcd30('0x2b')]['find'](_0x23c68f)[_0xcd30('0x23')](handleEntityNotFound(_0x4367df,null))[_0xcd30('0x23')](respondWithResult(_0x4367df,null))[_0xcd30('0x45')](handleError(_0x4367df,null));};exports[_0xcd30('0x49')]=function(_0x453850,_0xbd62ba){return db[_0xcd30('0x2b')][_0xcd30('0x49')](_0x453850['body'],{})[_0xcd30('0x23')](respondWithResult(_0xbd62ba,0xc9))['catch'](handleError(_0xbd62ba,null));};exports[_0xcd30('0x22')]=function(_0x335d23,_0x2f5e5f){if(_0x335d23['body']['id']){delete _0x335d23[_0xcd30('0x4a')]['id'];}return db['SmsApplication'][_0xcd30('0x4b')]({'where':{'id':_0x335d23['params']['id']}})[_0xcd30('0x23')](handleEntityNotFound(_0x2f5e5f,null))['then'](saveUpdates(_0x335d23[_0xcd30('0x4a')],null))[_0xcd30('0x23')](respondWithResult(_0x2f5e5f,null))[_0xcd30('0x45')](handleError(_0x2f5e5f,null));};exports[_0xcd30('0x24')]=function(_0x1e95ee,_0x4244a2){return db['SmsApplication']['find']({'where':{'id':_0x1e95ee[_0xcd30('0x46')]['id']}})[_0xcd30('0x23')](handleEntityNotFound(_0x4244a2,null))[_0xcd30('0x23')](removeEntity(_0x4244a2,null))[_0xcd30('0x45')](handleError(_0x4244a2,null));}; \ No newline at end of file +var _0xf11d=['squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','rawAttributes','fieldName','key','map','query','keys','intersection','model','attributes','fields','nolimit','order','sort','pick','filters','filter','where','merge','type','VIRTUAL','SmsApplication','includeAll','include','catch','params','length','create','body','find','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra'];(function(_0x2c8afd,_0x1e40e3){var _0x546aaf=function(_0xbc34c7){while(--_0xbc34c7){_0x2c8afd['push'](_0x2c8afd['shift']());}};_0x546aaf(++_0x1e40e3);}(_0xf11d,0x84));var _0xdf11=function(_0x1f4114,_0x3a87d7){_0x1f4114=_0x1f4114-0x0;var _0x2e1509=_0xf11d[_0x1f4114];return _0x2e1509;};'use strict';var emlformat=require(_0xdf11('0x0'));var rimraf=require(_0xdf11('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdf11('0x2'));var rp=require('request-promise');var moment=require(_0xdf11('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xdf11('0x4'));var util=require(_0xdf11('0x5'));var path=require(_0xdf11('0x6'));var sox=require(_0xdf11('0x7'));var csv=require('to-csv');var ejs=require(_0xdf11('0x8'));var fs=require('fs');var fs_extra=require(_0xdf11('0x9'));var _=require('lodash');var squel=require(_0xdf11('0xa'));var crypto=require(_0xdf11('0xb'));var jsforce=require(_0xdf11('0xc'));var deskjs=require(_0xdf11('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdf11('0xe'));var Papa=require('papaparse');var Redis=require(_0xdf11('0xf'));var authService=require(_0xdf11('0x10'));var qs=require(_0xdf11('0x11'));var as=require(_0xdf11('0x12'));var hardwareService=require(_0xdf11('0x13'));var logger=require(_0xdf11('0x14'))(_0xdf11('0x15'));var utils=require(_0xdf11('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e10a7,_0xd50b8c){_0xd50b8c=_0xd50b8c||0xcc;return function(_0x291954){if(_0x291954){return _0x5e10a7[_0xdf11('0x17')](_0xd50b8c);}return _0x5e10a7[_0xdf11('0x18')](_0xd50b8c)['end']();};}function respondWithResult(_0x203573,_0x2f845a){_0x2f845a=_0x2f845a||0xc8;return function(_0x1ab960){if(_0x1ab960){return _0x203573[_0xdf11('0x18')](_0x2f845a)[_0xdf11('0x19')](_0x1ab960);}};}function respondWithFilteredResult(_0x3dba6e,_0x14f9d2){return function(_0x18b5f1){if(_0x18b5f1){var _0x5181de=typeof _0x14f9d2['offset']==='undefined'&&typeof _0x14f9d2[_0xdf11('0x1a')]===_0xdf11('0x1b');var _0x180bbd=_0x18b5f1[_0xdf11('0x1c')];var _0x2646a1=_0x5181de?0x0:_0x14f9d2['offset'];var _0x1328b2=_0x5181de?_0x18b5f1['count']:_0x14f9d2[_0xdf11('0x1d')]+_0x14f9d2[_0xdf11('0x1a')];var _0x3b99ab;if(_0x1328b2>=_0x180bbd){_0x1328b2=_0x180bbd;_0x3b99ab=0xc8;}else{_0x3b99ab=0xce;}_0x3dba6e[_0xdf11('0x18')](_0x3b99ab);return _0x3dba6e[_0xdf11('0x1e')](_0xdf11('0x1f'),_0x2646a1+'-'+_0x1328b2+'/'+_0x180bbd)[_0xdf11('0x19')](_0x18b5f1);}return null;};}function patchUpdates(_0x5d3c8f){return function(_0x578fa6){try{jsonpatch['apply'](_0x578fa6,_0x5d3c8f,!![]);}catch(_0x1a3b92){return BPromise[_0xdf11('0x20')](_0x1a3b92);}return _0x578fa6[_0xdf11('0x21')]();};}function saveUpdates(_0x25073a,_0x3c5468){return function(_0x30d781){if(_0x30d781){return _0x30d781[_0xdf11('0x22')](_0x25073a)[_0xdf11('0x23')](function(_0x532d95){return _0x532d95;});}return null;};}function removeEntity(_0x11a33a,_0xea580a){return function(_0x1e2f03){if(_0x1e2f03){return _0x1e2f03[_0xdf11('0x24')]()[_0xdf11('0x23')](function(){_0x11a33a[_0xdf11('0x18')](0xcc)[_0xdf11('0x25')]();});}};}function handleEntityNotFound(_0x16ef25,_0x51f0ca){return function(_0x4dae26){if(!_0x4dae26){_0x16ef25[_0xdf11('0x17')](0x194);}return _0x4dae26;};}function handleError(_0x586a41,_0x3eb1fc){_0x3eb1fc=_0x3eb1fc||0x1f4;return function(_0x2181ac){logger[_0xdf11('0x26')](_0x2181ac[_0xdf11('0x27')]);if(_0x2181ac[_0xdf11('0x28')]){delete _0x2181ac[_0xdf11('0x28')];}_0x586a41[_0xdf11('0x18')](_0x3eb1fc)[_0xdf11('0x29')](_0x2181ac);};}exports['index']=function(_0x50c667,_0x1dcf98){var _0x23f373={},_0x10dfab={},_0x15691={'count':0x0,'rows':[]};var _0x414892=_['map'](db['SmsApplication'][_0xdf11('0x2a')],function(_0x4162e2){return{'name':_0x4162e2[_0xdf11('0x2b')],'type':_0x4162e2['type'][_0xdf11('0x2c')]};});_0x10dfab['model']=_[_0xdf11('0x2d')](_0x414892,'name');_0x10dfab[_0xdf11('0x2e')]=_[_0xdf11('0x2f')](_0x50c667[_0xdf11('0x2e')]);_0x10dfab['filters']=_[_0xdf11('0x30')](_0x10dfab[_0xdf11('0x31')],_0x10dfab[_0xdf11('0x2e')]);_0x23f373[_0xdf11('0x32')]=_[_0xdf11('0x30')](_0x10dfab['model'],qs[_0xdf11('0x33')](_0x50c667[_0xdf11('0x2e')][_0xdf11('0x33')]));_0x23f373[_0xdf11('0x32')]=_0x23f373[_0xdf11('0x32')]['length']?_0x23f373[_0xdf11('0x32')]:_0x10dfab[_0xdf11('0x31')];if(!_0x50c667[_0xdf11('0x2e')]['hasOwnProperty'](_0xdf11('0x34'))){_0x23f373[_0xdf11('0x1a')]=qs['limit'](_0x50c667[_0xdf11('0x2e')][_0xdf11('0x1a')]);_0x23f373[_0xdf11('0x1d')]=qs[_0xdf11('0x1d')](_0x50c667[_0xdf11('0x2e')][_0xdf11('0x1d')]);}_0x23f373[_0xdf11('0x35')]=qs[_0xdf11('0x36')](_0x50c667[_0xdf11('0x2e')][_0xdf11('0x36')]);_0x23f373['where']=qs['filters'](_[_0xdf11('0x37')](_0x50c667['query'],_0x10dfab[_0xdf11('0x38')]),_0x414892);if(_0x50c667[_0xdf11('0x2e')][_0xdf11('0x39')]){_0x23f373[_0xdf11('0x3a')]=_[_0xdf11('0x3b')](_0x23f373[_0xdf11('0x3a')],{'$or':_[_0xdf11('0x2d')](_0x414892,function(_0x3146be){if(_0x3146be[_0xdf11('0x3c')]!==_0xdf11('0x3d')){var _0x3d958e={};_0x3d958e[_0x3146be[_0xdf11('0x28')]]={'$like':'%'+_0x50c667['query']['filter']+'%'};return _0x3d958e;}})});}_0x23f373=_['merge']({},_0x23f373,_0x50c667['options']);var _0x5129b1={'where':_0x23f373[_0xdf11('0x3a')]};return db[_0xdf11('0x3e')][_0xdf11('0x1c')](_0x5129b1)[_0xdf11('0x23')](function(_0x585fbe){_0x15691[_0xdf11('0x1c')]=_0x585fbe;if(_0x50c667[_0xdf11('0x2e')][_0xdf11('0x3f')]){_0x23f373[_0xdf11('0x40')]=[{'all':!![]}];}return db[_0xdf11('0x3e')]['findAll'](_0x23f373);})[_0xdf11('0x23')](function(_0x223f50){_0x15691['rows']=_0x223f50;return _0x15691;})[_0xdf11('0x23')](respondWithFilteredResult(_0x1dcf98,_0x23f373))[_0xdf11('0x41')](handleError(_0x1dcf98,null));};exports['show']=function(_0x4200a4,_0x531a90){var _0x3f849d={'raw':!![],'where':{'id':_0x4200a4[_0xdf11('0x42')]['id']}},_0x1237d9={};_0x1237d9[_0xdf11('0x31')]=_[_0xdf11('0x2f')](db[_0xdf11('0x3e')][_0xdf11('0x2a')]);_0x1237d9[_0xdf11('0x2e')]=_[_0xdf11('0x2f')](_0x4200a4[_0xdf11('0x2e')]);_0x1237d9['filters']=_[_0xdf11('0x30')](_0x1237d9[_0xdf11('0x31')],_0x1237d9['query']);_0x3f849d[_0xdf11('0x32')]=_[_0xdf11('0x30')](_0x1237d9[_0xdf11('0x31')],qs[_0xdf11('0x33')](_0x4200a4[_0xdf11('0x2e')]['fields']));_0x3f849d[_0xdf11('0x32')]=_0x3f849d[_0xdf11('0x32')][_0xdf11('0x43')]?_0x3f849d[_0xdf11('0x32')]:_0x1237d9[_0xdf11('0x31')];if(_0x4200a4['query']['includeAll']){_0x3f849d[_0xdf11('0x40')]=[{'all':!![]}];}_0x3f849d=_[_0xdf11('0x3b')]({},_0x3f849d,_0x4200a4['options']);return db[_0xdf11('0x3e')]['find'](_0x3f849d)[_0xdf11('0x23')](handleEntityNotFound(_0x531a90,null))[_0xdf11('0x23')](respondWithResult(_0x531a90,null))[_0xdf11('0x41')](handleError(_0x531a90,null));};exports[_0xdf11('0x44')]=function(_0x21dc27,_0x1e415f){return db[_0xdf11('0x3e')][_0xdf11('0x44')](_0x21dc27[_0xdf11('0x45')],{})[_0xdf11('0x23')](respondWithResult(_0x1e415f,0xc9))[_0xdf11('0x41')](handleError(_0x1e415f,null));};exports['update']=function(_0x22f684,_0x5c7707){if(_0x22f684[_0xdf11('0x45')]['id']){delete _0x22f684['body']['id'];}return db['SmsApplication']['find']({'where':{'id':_0x22f684[_0xdf11('0x42')]['id']}})['then'](handleEntityNotFound(_0x5c7707,null))[_0xdf11('0x23')](saveUpdates(_0x22f684['body'],null))[_0xdf11('0x23')](respondWithResult(_0x5c7707,null))[_0xdf11('0x41')](handleError(_0x5c7707,null));};exports[_0xdf11('0x24')]=function(_0x518827,_0x2fe80f){return db[_0xdf11('0x3e')][_0xdf11('0x46')]({'where':{'id':_0x518827['params']['id']}})[_0xdf11('0x23')](handleEntityNotFound(_0x2fe80f,null))[_0xdf11('0x23')](removeEntity(_0x2fe80f,null))[_0xdf11('0x41')](handleError(_0x2fe80f,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index a93de78..2dfd1e7 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 _0xd5d6=['./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xd5d6,0xcb));var _0x6d5d=function(_0x13ce0c,_0x3f2a0d){_0x13ce0c=_0x13ce0c-0x0;var _0x4388fb=_0xd5d6[_0x13ce0c];return _0x4388fb;};'use strict';var _=require(_0x6d5d('0x0'));var util=require('util');var logger=require(_0x6d5d('0x1'))(_0x6d5d('0x2'));var moment=require(_0x6d5d('0x3'));var BPromise=require(_0x6d5d('0x4'));var rp=require(_0x6d5d('0x5'));var fs=require('fs');var path=require(_0x6d5d('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6d5d('0x7'));module[_0x6d5d('0x8')]=function(_0x44166a,_0x20ed34){return _0x44166a[_0x6d5d('0x9')](_0x6d5d('0xa'),attributes,{'tableName':_0x6d5d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6d5d('0xc'),'collate':_0x6d5d('0xd')});}; \ No newline at end of file +var _0x0ee3=['define','sms_applications','utf8mb4','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports'];(function(_0x50ad67,_0x4b2165){var _0x20426e=function(_0x3379e1){while(--_0x3379e1){_0x50ad67['push'](_0x50ad67['shift']());}};_0x20426e(++_0x4b2165);}(_0x0ee3,0xd5));var _0x30ee=function(_0x3e628e,_0x534d5c){_0x3e628e=_0x3e628e-0x0;var _0x5bc355=_0x0ee3[_0x3e628e];return _0x5bc355;};'use strict';var _=require(_0x30ee('0x0'));var util=require(_0x30ee('0x1'));var logger=require(_0x30ee('0x2'))(_0x30ee('0x3'));var moment=require(_0x30ee('0x4'));var BPromise=require('bluebird');var rp=require(_0x30ee('0x5'));var fs=require('fs');var path=require(_0x30ee('0x6'));var rimraf=require(_0x30ee('0x7'));var config=require(_0x30ee('0x8'));var attributes=require(_0x30ee('0x9'));module[_0x30ee('0xa')]=function(_0x117b51,_0xfaec62){return _0x117b51[_0x30ee('0xb')]('SmsApplication',attributes,{'tableName':_0x30ee('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x30ee('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index f9ffdb7..90bcf92 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 _0xb7e2=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsApplication,\x20%s,\x20%s','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb7e2,0x103));var _0x2b7e=function(_0x339cfd,_0x564618){_0x339cfd=_0x339cfd-0x0;var _0xc769b7=_0xb7e2[_0x339cfd];return _0xc769b7;};'use strict';var _=require(_0x2b7e('0x0'));var util=require('util');var moment=require(_0x2b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x2b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2b7e('0x4'))(_0x2b7e('0x5'));var config=require(_0x2b7e('0x6'));var jayson=require(_0x2b7e('0x7'));var client=jayson[_0x2b7e('0x8')][_0x2b7e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d7a0b,_0xc23ec4,_0x45dc9f){return new BPromise(function(_0x10a31d,_0x49491c){return client[_0x2b7e('0xa')](_0x4d7a0b,_0x45dc9f)[_0x2b7e('0xb')](function(_0x2f5991){logger[_0x2b7e('0xc')](_0x2b7e('0xd'),_0xc23ec4,'request\x20sent');logger['debug'](_0x2b7e('0xe'),_0xc23ec4,_0x2b7e('0xf'),JSON[_0x2b7e('0x10')](_0x2f5991));if(_0x2f5991[_0x2b7e('0x11')]){if(_0x2f5991[_0x2b7e('0x11')][_0x2b7e('0x12')]===0x1f4){logger[_0x2b7e('0x11')]('SmsApplication,\x20%s,\x20%s',_0xc23ec4,_0x2f5991[_0x2b7e('0x11')][_0x2b7e('0x13')]);return _0x49491c(_0x2f5991[_0x2b7e('0x11')][_0x2b7e('0x13')]);}logger['error']('SmsApplication,\x20%s,\x20%s',_0xc23ec4,_0x2f5991['error'][_0x2b7e('0x13')]);return _0x10a31d(_0x2f5991['error'][_0x2b7e('0x13')]);}else{logger['info'](_0x2b7e('0xd'),_0xc23ec4,'request\x20sent');_0x10a31d(_0x2f5991[_0x2b7e('0x14')][_0x2b7e('0x13')]);}})[_0x2b7e('0x15')](function(_0x4d85c3){logger[_0x2b7e('0x11')](_0x2b7e('0xd'),_0xc23ec4,_0x4d85c3);_0x49491c(_0x4d85c3);});});} \ No newline at end of file +var _0x8a5c=['request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x23666d,_0x4efd38){var _0x367689=function(_0x571fc5){while(--_0x571fc5){_0x23666d['push'](_0x23666d['shift']());}};_0x367689(++_0x4efd38);}(_0x8a5c,0x136));var _0xc8a5=function(_0xe9c85b,_0x151eea){_0xe9c85b=_0xe9c85b-0x0;var _0x38c0db=_0x8a5c[_0xe9c85b];return _0x38c0db;};'use strict';var _=require(_0xc8a5('0x0'));var util=require(_0xc8a5('0x1'));var moment=require(_0xc8a5('0x2'));var BPromise=require(_0xc8a5('0x3'));var rs=require(_0xc8a5('0x4'));var fs=require('fs');var Redis=require(_0xc8a5('0x5'));var db=require(_0xc8a5('0x6'))['db'];var utils=require(_0xc8a5('0x7'));var logger=require(_0xc8a5('0x8'))('rpc');var config=require(_0xc8a5('0x9'));var jayson=require(_0xc8a5('0xa'));var client=jayson['client'][_0xc8a5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xcee97e,_0xd6de78,_0xa9f42c){return new BPromise(function(_0x4d25e4,_0x3ecf08){return client[_0xc8a5('0xc')](_0xcee97e,_0xa9f42c)[_0xc8a5('0xd')](function(_0x2c1fe9){logger[_0xc8a5('0xe')](_0xc8a5('0xf'),_0xd6de78,_0xc8a5('0x10'));logger[_0xc8a5('0x11')](_0xc8a5('0x12'),_0xd6de78,'request\x20sent',JSON['stringify'](_0x2c1fe9));if(_0x2c1fe9[_0xc8a5('0x13')]){if(_0x2c1fe9['error'][_0xc8a5('0x14')]===0x1f4){logger[_0xc8a5('0x13')](_0xc8a5('0xf'),_0xd6de78,_0x2c1fe9[_0xc8a5('0x13')][_0xc8a5('0x15')]);return _0x3ecf08(_0x2c1fe9['error'][_0xc8a5('0x15')]);}logger[_0xc8a5('0x13')]('SmsApplication,\x20%s,\x20%s',_0xd6de78,_0x2c1fe9[_0xc8a5('0x13')][_0xc8a5('0x15')]);return _0x4d25e4(_0x2c1fe9[_0xc8a5('0x13')][_0xc8a5('0x15')]);}else{logger[_0xc8a5('0xe')](_0xc8a5('0xf'),_0xd6de78,'request\x20sent');_0x4d25e4(_0x2c1fe9[_0xc8a5('0x16')][_0xc8a5('0x15')]);}})['catch'](function(_0x36a78b){logger[_0xc8a5('0x13')]('SmsApplication,\x20%s,\x20%s',_0xd6de78,_0x36a78b);_0x3ecf08(_0x36a78b);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 93d6cb7..a447454 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 _0xd8b0=['util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','/:id/messages','getMessages','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','smsinteraction:update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer'];(function(_0x4bae55,_0x42870a){var _0x46ecd7=function(_0x2379ea){while(--_0x2379ea){_0x4bae55['push'](_0x4bae55['shift']());}};_0x46ecd7(++_0x42870a);}(_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('./smsInteraction.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('0x9')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0x9')]('/:id/download',auth[_0x0d8b('0x7')](),controller['download']);router[_0x0d8b('0xf')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x10')]);router[_0x0d8b('0xf')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);router[_0x0d8b('0xf')](_0x0d8b('0x12'),auth[_0x0d8b('0x7')](),interaction[_0x0d8b('0x13')](_0x0d8b('0x14'),_0x0d8b('0x15')),controller[_0x0d8b('0x16')]);router['put'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),interaction[_0x0d8b('0x13')](_0x0d8b('0x14'),_0x0d8b('0x17')),controller['update']);router[_0x0d8b('0x18')](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),interaction[_0x0d8b('0x13')](_0x0d8b('0x14'),_0x0d8b('0x19')),controller[_0x0d8b('0x1a')]);router[_0x0d8b('0x18')]('/:id/tags',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x1b')]);module[_0x0d8b('0x1c')]=router; \ No newline at end of file +var _0xe605=['./smsInteraction.controller','get','isAuthenticated','index','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','/:id','update','delete','smsinteraction:destroy','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5dfdf2,_0xf36960){var _0x259de2=function(_0x3e14b0){while(--_0x3e14b0){_0x5dfdf2['push'](_0x5dfdf2['shift']());}};_0x259de2(++_0xf36960);}(_0xe605,0x92));var _0x5e60=function(_0xe9e20,_0x38bb34){_0xe9e20=_0xe9e20-0x0;var _0x1fded8=_0xe605[_0xe9e20];return _0x1fded8;};'use strict';var multer=require(_0x5e60('0x0'));var util=require(_0x5e60('0x1'));var path=require('path');var timeout=require(_0x5e60('0x2'));var express=require(_0x5e60('0x3'));var router=express[_0x5e60('0x4')]();var fs_extra=require(_0x5e60('0x5'));var auth=require(_0x5e60('0x6'));var interaction=require(_0x5e60('0x7'));var config=require(_0x5e60('0x8'));var controller=require(_0x5e60('0x9'));router[_0x5e60('0xa')]('/',auth[_0x5e60('0xb')](),controller[_0x5e60('0xc')]);router[_0x5e60('0xa')]('/describe',auth[_0x5e60('0xb')](),controller['describe']);router['get']('/:id',auth[_0x5e60('0xb')](),controller[_0x5e60('0xd')]);router[_0x5e60('0xa')](_0x5e60('0xe'),auth[_0x5e60('0xb')](),controller[_0x5e60('0xf')]);router['get'](_0x5e60('0x10'),auth['isAuthenticated'](),controller[_0x5e60('0x11')]);router[_0x5e60('0x12')]('/',auth[_0x5e60('0xb')](),controller['create']);router[_0x5e60('0x12')](_0x5e60('0xe'),auth[_0x5e60('0xb')](),controller[_0x5e60('0x13')]);router[_0x5e60('0x12')](_0x5e60('0x14'),auth['isAuthenticated'](),interaction[_0x5e60('0x15')](_0x5e60('0x16'),_0x5e60('0x17')),controller[_0x5e60('0x18')]);router['put'](_0x5e60('0x19'),auth['isAuthenticated'](),interaction[_0x5e60('0x15')](_0x5e60('0x16'),'smsinteraction:update'),controller[_0x5e60('0x1a')]);router[_0x5e60('0x1b')](_0x5e60('0x19'),auth[_0x5e60('0xb')](),interaction['tracked'](_0x5e60('0x16'),_0x5e60('0x1c')),controller['destroy']);router[_0x5e60('0x1b')](_0x5e60('0x14'),auth[_0x5e60('0xb')](),controller[_0x5e60('0x1d')]);module[_0x5e60('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 0db7f21..cf48a3d 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 _0x9a18=['exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x9a18,0x187));var _0x89a1=function(_0x4f36f7,_0x24ba14){_0x4f36f7=_0x4f36f7-0x0;var _0x3ae4fe=_0x9a18[_0x4f36f7];return _0x3ae4fe;};'use strict';var Sequelize=require(_0x89a1('0x0'));var moment=require('moment');module[_0x89a1('0x1')]={'closed':{'type':Sequelize[_0x89a1('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x89a1('0x3')]},'disposition':{'type':Sequelize[_0x89a1('0x4')]},'secondDisposition':{'type':Sequelize[_0x89a1('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x89a1('0x4')]},'phone':{'type':Sequelize[_0x89a1('0x4')]},'read1stAt':{'type':Sequelize[_0x89a1('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x89a1('0x5')]('in',_0x89a1('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x89a1('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x89a1('0x5')]('in',_0x89a1('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xfd7b=['INTEGER','sequelize','moment','exports','DATE','STRING','out','BOOLEAN'];(function(_0x4060ce,_0x3259a5){var _0x4bbecc=function(_0x3b573e){while(--_0x3b573e){_0x4060ce['push'](_0x4060ce['shift']());}};_0x4bbecc(++_0x3259a5);}(_0xfd7b,0xd1));var _0xbfd7=function(_0x3e7e96,_0x5683ca){_0x3e7e96=_0x3e7e96-0x0;var _0x13f6f0=_0xfd7b[_0x3e7e96];return _0x13f6f0;};'use strict';var Sequelize=require(_0xbfd7('0x0'));var moment=require(_0xbfd7('0x1'));module[_0xbfd7('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xbfd7('0x3')]},'disposition':{'type':Sequelize[_0xbfd7('0x4')]},'secondDisposition':{'type':Sequelize[_0xbfd7('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xbfd7('0x4')]},'phone':{'type':Sequelize[_0xbfd7('0x4')]},'read1stAt':{'type':Sequelize[_0xbfd7('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xbfd7('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xbfd7('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xbfd7('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xbfd7('0x6')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xbfd7('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index df93be5..9387d8e 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 _0x8922=['destroy','then','stack','map','SmsInteraction','fieldName','type','key','getOptions','findAll','query','catch','show','params','keys','rawAttributes','filters','intersection','model','attributes','fields','length','merge','options','create','body','find','describe','SmsMessage','addMessage','ids','omit','findOne','nolimit','order','sort','where','pick','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','include','rows','addTags','setTags','spread','name','color','removeTags','unix','toString','server','join','push','User','fullname','CmContact','lastName','Messages','createdAt','direction','secret','read','SmsAccount','Account','Owner','get','mkdirSync','Sms','N.A.','closed','disposition','out','System','Contact','value','renderFile','root','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','ejs','lodash','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./smsInteraction.socket','register','sendStatus','status','end','json','limit','undefined','count','offset','set','update'];(function(_0x41b49d,_0x2379c4){var _0x158c70=function(_0xb94449){while(--_0xb94449){_0x41b49d['push'](_0x41b49d['shift']());}};_0x158c70(++_0x2379c4);}(_0x8922,0xce));var _0x2892=function(_0x5ea6ca,_0xbfc25a){_0x5ea6ca=_0x5ea6ca-0x0;var _0x7984b0=_0x8922[_0x5ea6ca];return _0x7984b0;};'use strict';var rimraf=require(_0x2892('0x0'));var zipdir=require(_0x2892('0x1'));var moment=require(_0x2892('0x2'));var BPromise=require(_0x2892('0x3'));var util=require(_0x2892('0x4'));var path=require(_0x2892('0x5'));var ejs=require(_0x2892('0x6'));var fs=require('fs');var _=require(_0x2892('0x7'));var Redis=require('ioredis');var interaction=require(_0x2892('0x8'));var qs=require('../../components/parsers/qs');var pdf=require(_0x2892('0x9'));var logger=require(_0x2892('0xa'))(_0x2892('0xb'));var config=require(_0x2892('0xc'));var db=require(_0x2892('0xd'))['db'];config[_0x2892('0xe')]=_['defaults'](config[_0x2892('0xe')],{'host':_0x2892('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2892('0x10'))[_0x2892('0x11')](socket);function respondWithStatusCode(_0x35e1d6,_0x3874bc){_0x3874bc=_0x3874bc||0xcc;return function(_0x465032){if(_0x465032){return _0x35e1d6[_0x2892('0x12')](_0x3874bc);}return _0x35e1d6[_0x2892('0x13')](_0x3874bc)[_0x2892('0x14')]();};}function respondWithResult(_0x33f5f2,_0x3c83c0){_0x3c83c0=_0x3c83c0||0xc8;return function(_0x47123f){if(_0x47123f){return _0x33f5f2[_0x2892('0x13')](_0x3c83c0)[_0x2892('0x15')](_0x47123f);}};}function respondWithFilteredResult(_0x5342fe,_0x4a2a57){return function(_0x3790f0){if(_0x3790f0){var _0x87cd30=typeof _0x4a2a57['offset']==='undefined'&&typeof _0x4a2a57[_0x2892('0x16')]===_0x2892('0x17');var _0x563684=_0x3790f0[_0x2892('0x18')];var _0x46da51=_0x87cd30?0x0:_0x4a2a57[_0x2892('0x19')];var _0x57f271=_0x87cd30?_0x3790f0[_0x2892('0x18')]:_0x4a2a57[_0x2892('0x19')]+_0x4a2a57[_0x2892('0x16')];var _0x33dab1;if(_0x57f271>=_0x563684){_0x57f271=_0x563684;_0x33dab1=0xc8;}else{_0x33dab1=0xce;}_0x5342fe['status'](_0x33dab1);return _0x5342fe[_0x2892('0x1a')]('Content-Range',_0x46da51+'-'+_0x57f271+'/'+_0x563684)['json'](_0x3790f0);}return null;};}function saveUpdates(_0x35fc05){return function(_0x220a52){if(_0x220a52){return _0x220a52[_0x2892('0x1b')](_0x35fc05)['then'](function(_0x532bfc){return _0x532bfc;});}return null;};}function removeEntity(_0x3e8d21){return function(_0x443bff){if(_0x443bff){return _0x443bff[_0x2892('0x1c')]()[_0x2892('0x1d')](function(){_0x3e8d21[_0x2892('0x13')](0xcc)[_0x2892('0x14')]();});}};}function handleEntityNotFound(_0x4a8aaf){return function(_0x21da1a){if(!_0x21da1a){_0x4a8aaf[_0x2892('0x12')](0x194);}return _0x21da1a;};}function handleError(_0x4940c6,_0x4ec766){_0x4ec766=_0x4ec766||0x1f4;return function(_0x41bfec){logger['error'](_0x41bfec[_0x2892('0x1e')]);if(_0x41bfec['name']){delete _0x41bfec['name'];}_0x4940c6[_0x2892('0x13')](_0x4ec766)['send'](_0x41bfec);};}exports['index']=function(_0x33c400,_0x5c52a2){var _0x46cdb6={};var _0x59570f=_[_0x2892('0x1f')](db[_0x2892('0x20')]['rawAttributes'],function(_0x430256){return{'name':_0x430256[_0x2892('0x21')],'type':_0x430256[_0x2892('0x22')][_0x2892('0x23')]};});_0x46cdb6=qs[_0x2892('0x24')](_0x59570f,_0x33c400);return interaction[_0x2892('0x25')]('sms',_0x33c400[_0x2892('0x26')],_0x33c400['user'],_0x46cdb6,_0x59570f)[_0x2892('0x1d')](respondWithFilteredResult(_0x5c52a2,_0x46cdb6))[_0x2892('0x27')](handleError(_0x5c52a2,null));};exports[_0x2892('0x28')]=function(_0x454d99,_0x3fe0cc){var _0x1bd13b={'raw':![],'where':{'id':_0x454d99[_0x2892('0x29')]['id']}},_0x43ae38={};_0x43ae38['model']=_[_0x2892('0x2a')](db[_0x2892('0x20')][_0x2892('0x2b')]);_0x43ae38['query']=_[_0x2892('0x2a')](_0x454d99[_0x2892('0x26')]);_0x43ae38[_0x2892('0x2c')]=_[_0x2892('0x2d')](_0x43ae38[_0x2892('0x2e')],_0x43ae38[_0x2892('0x26')]);_0x1bd13b[_0x2892('0x2f')]=_[_0x2892('0x2d')](_0x43ae38[_0x2892('0x2e')],qs[_0x2892('0x30')](_0x454d99[_0x2892('0x26')]['fields']));_0x1bd13b['attributes']=_0x1bd13b['attributes'][_0x2892('0x31')]?_0x1bd13b[_0x2892('0x2f')]:_0x43ae38[_0x2892('0x2e')];if(_0x454d99[_0x2892('0x26')]['includeAll']){_0x1bd13b['include']=[{'all':!![]}];}_0x1bd13b=_[_0x2892('0x32')]({},_0x1bd13b,_0x454d99[_0x2892('0x33')]);return db['SmsInteraction']['find'](_0x1bd13b)['then'](handleEntityNotFound(_0x3fe0cc,null))[_0x2892('0x1d')](respondWithResult(_0x3fe0cc,null))[_0x2892('0x27')](handleError(_0x3fe0cc,null));};exports['create']=function(_0x268ebb,_0x3322b6){return db[_0x2892('0x20')][_0x2892('0x34')](_0x268ebb[_0x2892('0x35')],{})[_0x2892('0x1d')](respondWithResult(_0x3322b6,0xc9))[_0x2892('0x27')](handleError(_0x3322b6,null));};exports['update']=function(_0x4753c7,_0x12d8c4){if(_0x4753c7[_0x2892('0x35')]['id']){delete _0x4753c7[_0x2892('0x35')]['id'];}return db[_0x2892('0x20')][_0x2892('0x36')]({'where':{'id':_0x4753c7['params']['id']}})[_0x2892('0x1d')](handleEntityNotFound(_0x12d8c4,null))[_0x2892('0x1d')](saveUpdates(_0x4753c7['body'],null))[_0x2892('0x1d')](respondWithResult(_0x12d8c4,null))['catch'](handleError(_0x12d8c4,null));};exports[_0x2892('0x1c')]=function(_0x1e76cf,_0x29ad8f){return db[_0x2892('0x20')][_0x2892('0x36')]({'where':{'id':_0x1e76cf[_0x2892('0x29')]['id']}})[_0x2892('0x1d')](handleEntityNotFound(_0x29ad8f,null))['then'](removeEntity(_0x29ad8f,null))[_0x2892('0x27')](handleError(_0x29ad8f,null));};exports[_0x2892('0x37')]=function(_0xb10298,_0x480ee4){return db[_0x2892('0x20')][_0x2892('0x37')]()[_0x2892('0x1d')](respondWithResult(_0x480ee4,null))[_0x2892('0x27')](handleError(_0x480ee4,null));};exports['addMessage']=function(_0x37e479,_0x403860){return db[_0x2892('0x38')][_0x2892('0x36')]({'where':{'id':_0x37e479[_0x2892('0x29')]['id']}})[_0x2892('0x1d')](handleEntityNotFound(_0x403860,null))['then'](function(_0x3ecadb){if(_0x3ecadb){return _0x3ecadb[_0x2892('0x39')](_0x37e479[_0x2892('0x35')][_0x2892('0x3a')],_[_0x2892('0x3b')](_0x37e479[_0x2892('0x35')],[_0x2892('0x3a'),'id'])||{});}})['then'](respondWithResult(_0x403860,null))['catch'](handleError(_0x403860,null));};exports['getMessages']=function(_0x565deb,_0x502852){var _0x43116d={'raw':![],'where':{}};var _0x482fe8={};var _0x1209f0={'count':0x0,'rows':[]};return db[_0x2892('0x20')][_0x2892('0x3c')]({'where':{'id':_0x565deb[_0x2892('0x29')]['id']}})[_0x2892('0x1d')](handleEntityNotFound(_0x502852,null))[_0x2892('0x1d')](function(_0x1588c3){if(_0x1588c3){_0x482fe8['model']=_['keys'](db[_0x2892('0x38')][_0x2892('0x2b')]);_0x482fe8[_0x2892('0x26')]=_[_0x2892('0x2a')](_0x565deb['query']);_0x482fe8[_0x2892('0x2c')]=_[_0x2892('0x2d')](_0x482fe8[_0x2892('0x2e')],_0x482fe8[_0x2892('0x26')]);_0x43116d[_0x2892('0x2f')]=_[_0x2892('0x2d')](_0x482fe8[_0x2892('0x2e')],qs[_0x2892('0x30')](_0x565deb[_0x2892('0x26')][_0x2892('0x30')]));_0x43116d[_0x2892('0x2f')]=_0x43116d[_0x2892('0x2f')][_0x2892('0x31')]?_0x43116d[_0x2892('0x2f')]:_0x482fe8[_0x2892('0x2e')];if(!_0x565deb[_0x2892('0x26')]['hasOwnProperty'](_0x2892('0x3d'))){_0x43116d[_0x2892('0x16')]=qs[_0x2892('0x16')](_0x565deb[_0x2892('0x26')][_0x2892('0x16')]);_0x43116d[_0x2892('0x19')]=qs[_0x2892('0x19')](_0x565deb[_0x2892('0x26')][_0x2892('0x19')]);}_0x43116d[_0x2892('0x3e')]=qs[_0x2892('0x3f')](_0x565deb['query'][_0x2892('0x3f')]);_0x43116d[_0x2892('0x40')]=qs[_0x2892('0x2c')](_[_0x2892('0x41')](_0x565deb[_0x2892('0x26')],_0x482fe8[_0x2892('0x2c')]));_0x43116d[_0x2892('0x40')]['SmsInteractionId']=_0x1588c3['id'];if(_0x565deb[_0x2892('0x26')][_0x2892('0x42')]){_0x43116d['where']=_['merge'](_0x43116d[_0x2892('0x40')],{'$or':_['map'](_0x43116d[_0x2892('0x2f')],function(_0x23f32c){var _0x141e3f={};_0x141e3f[_0x23f32c]={'$like':'%'+_0x565deb[_0x2892('0x26')][_0x2892('0x42')]+'%'};return _0x141e3f;})});}if(_0x565deb[_0x2892('0x26')][_0x2892('0x43')]){var _0x45b220=_0x565deb[_0x2892('0x26')][_0x2892('0x43')][_0x2892('0x44')](',');var _0x4d3594={};_0x4d3594[_0x45b220[0x0]]={'$gte':moment(_0x45b220[0x1])[_0x2892('0x45')](_0x2892('0x46'))};_0x43116d[_0x2892('0x40')]=_['merge'](_0x43116d[_0x2892('0x40')],_0x4d3594);}_0x43116d=_['merge']({},_0x43116d,_0x565deb[_0x2892('0x33')]);return db[_0x2892('0x38')][_0x2892('0x18')]({'where':_0x43116d['where']})['then'](function(_0x50369b){_0x1209f0['count']=_0x50369b;if(_0x565deb[_0x2892('0x26')]['includeAll']){_0x43116d[_0x2892('0x47')]=[{'all':!![]}];}return db['SmsMessage'][_0x2892('0x25')](_0x43116d);})[_0x2892('0x1d')](function(_0x2dd459){_0x1209f0[_0x2892('0x48')]=_0x2dd459;return _0x1209f0;});}})[_0x2892('0x1d')](respondWithFilteredResult(_0x502852,_0x43116d))[_0x2892('0x27')](handleError(_0x502852,null));};exports[_0x2892('0x49')]=function(_0x310dc1,_0x47219c){return db[_0x2892('0x20')][_0x2892('0x36')]({'where':{'id':_0x310dc1[_0x2892('0x29')]['id']}})[_0x2892('0x1d')](handleEntityNotFound(_0x47219c,null))[_0x2892('0x1d')](function(_0xe0a1b7){if(_0xe0a1b7){return _0xe0a1b7[_0x2892('0x4a')](_0x310dc1['body'][_0x2892('0x3a')],_[_0x2892('0x3b')](_0x310dc1[_0x2892('0x35')],[_0x2892('0x3a'),'id'])||{})[_0x2892('0x4b')](function(){return db['Tag'][_0x2892('0x25')]({'attributes':['id',_0x2892('0x4c'),_0x2892('0x4d')],'where':{'id':_0x310dc1[_0x2892('0x35')][_0x2892('0x3a')]}});})[_0x2892('0x1d')](function(_0xfb194f){socket['emit']('smsInteractionTags:save',{'id':Number(_0x310dc1[_0x2892('0x29')]['id']),'tags':_0xfb194f||[]});return{'id':Number(_0x310dc1[_0x2892('0x29')]['id']),'tags':_0xfb194f||[]};});}})['then'](respondWithResult(_0x47219c,null))[_0x2892('0x27')](handleError(_0x47219c,null));};exports[_0x2892('0x4e')]=function(_0x473fd8,_0x3f95b5){return db['SmsInteraction'][_0x2892('0x36')]({'where':{'id':_0x473fd8[_0x2892('0x29')]['id']}})[_0x2892('0x1d')](handleEntityNotFound(_0x3f95b5,null))['then'](function(_0x4df450){if(_0x4df450){return _0x4df450[_0x2892('0x4e')](_0x473fd8['query'][_0x2892('0x3a')]);}})[_0x2892('0x1d')](respondWithStatusCode(_0x3f95b5,null))['catch'](handleError(_0x3f95b5,null));};exports['download']=function(_0x2b7634,_0x437884){var _0x1bd2e7=moment()[_0x2892('0x4f')]()[_0x2892('0x50')]();var _0x245722=path['join'](config['root'],_0x2892('0x51'),'files','tmp');var _0x45fcfb=path['join'](_0x245722,_0x1bd2e7);var _0x36d758=util[_0x2892('0x45')]('transcript-%d-%s.zip',_0x2b7634[_0x2892('0x29')]['id'],_0x1bd2e7);var _0x3047c3=path[_0x2892('0x52')](_0x245722,_0x36d758);var _0x5058cd=[];_0x5058cd[_0x2892('0x53')]({'model':db['User'],'as':_0x2892('0x54'),'attributes':['id',_0x2892('0x55')],'raw':!![]});_0x5058cd[_0x2892('0x53')]({'model':db[_0x2892('0x56')],'as':'Contact','attributes':['id','firstName',_0x2892('0x57')],'raw':!![]});var _0x2ea64f=[{'model':db[_0x2892('0x38')],'as':_0x2892('0x58'),'attributes':['id',_0x2892('0x35'),_0x2892('0x59'),_0x2892('0x5a'),_0x2892('0x5b'),_0x2892('0x5c')],'include':_0x5058cd}];_0x2ea64f[_0x2892('0x53')]({'model':db[_0x2892('0x5d')],'as':_0x2892('0x5e'),'attributes':['id','name']});_0x2ea64f[_0x2892('0x53')]({'model':db[_0x2892('0x54')],'as':_0x2892('0x5f'),'attributes':['id',_0x2892('0x55')]});return db[_0x2892('0x20')][_0x2892('0x36')]({'where':{'id':_0x2b7634['params']['id']},'include':_0x2ea64f})[_0x2892('0x1d')](handleEntityNotFound(_0x437884,null))['then'](function(_0x3046e5){if(_0x3046e5){var _0x5c63d3=_0x3046e5[_0x2892('0x60')]({'plain':!![]});fs[_0x2892('0x61')](_0x45fcfb);var _0x139dbf={'channel':_0x2892('0x62'),'account':_0x5c63d3[_0x2892('0x5e')]['name'],'agent':_0x5c63d3['Owner']?_0x5c63d3['Owner'][_0x2892('0x55')]:_0x2892('0x63'),'createdAt':moment(_0x5c63d3['createdAt'])[_0x2892('0x45')](_0x2892('0x46'))[_0x2892('0x50')](),'closedAt':_0x5c63d3[_0x2892('0x64')]?moment(_0x5c63d3['closedAt'])[_0x2892('0x45')](_0x2892('0x46'))['toString']():'','disposition':_0x5c63d3[_0x2892('0x65')],'messages':_(_0x5c63d3[_0x2892('0x58')])[_0x2892('0x42')]({'secret':![]})[_0x2892('0x1f')](function(_0x287dd2){return{'date':moment(_0x287dd2[_0x2892('0x59')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x2892('0x50')](),'sender':_0x287dd2['direction']===_0x2892('0x66')?_0x287dd2[_0x2892('0x54')]?_0x287dd2[_0x2892('0x54')][_0x2892('0x55')]:_0x2892('0x67'):_0x287dd2['Contact']['firstName']+(_0x287dd2[_0x2892('0x68')][_0x2892('0x57')]?'\x20'+_0x287dd2[_0x2892('0x68')][_0x2892('0x57')]:''),'body':_0x287dd2[_0x2892('0x35')],'direction':_0x287dd2[_0x2892('0x5a')]===_0x2892('0x66')?'A':'C','secret':_0x287dd2[_0x2892('0x5b')],'read':_0x287dd2[_0x2892('0x5c')]};})[_0x2892('0x69')]()};return ejs[_0x2892('0x6a')](path[_0x2892('0x52')](config[_0x2892('0x6b')],_0x2892('0x51'),_0x2892('0x6c'),_0x2892('0x6d')),{'interaction':_0x139dbf})[_0x2892('0x1d')](function(_0x5a4a61){var _0x10c3bf=path[_0x2892('0x52')](_0x45fcfb,_0x2892('0x6e')+_0x5c63d3['id']+'-'+_0x1bd2e7+_0x2892('0x6f'));var _0x40e130={'path':_0x10c3bf,'channel':_0x2892('0x62'),'interactionId':_0x5c63d3['id']};return pdf[_0x2892('0x70')](_0x5a4a61,_0x40e130);})['then'](function(){return new BPromise(function(_0x542a7d,_0x14c79a){zipdir(_0x45fcfb,{'saveTo':_0x3047c3},function(_0x149ab4,_0x43b92d){if(_0x149ab4)return _0x14c79a(_0x149ab4);return _0x542a7d(_0x43b92d);});})['then'](function(){return new BPromise(function(_0xbb7ab,_0x1ee644){rimraf(_0x45fcfb,function(_0x4e6113){if(_0x4e6113)_0x1ee644(_0x4e6113);return _0xbb7ab();});});})[_0x2892('0x1d')](function(){return _0x437884[_0x2892('0x71')](_0x3047c3,_0x36d758,function(_0x4f4fe4){if(_0x4f4fe4){console[_0x2892('0x72')](_0x2892('0x73'),_0x4f4fe4);}else{fs[_0x2892('0x74')](_0x3047c3);}});});});}else{return _0x437884['sendStatus'](0xc8);}})[_0x2892('0x27')](handleError(_0x437884,null));}; \ No newline at end of file +var _0x6e20=['user','catch','show','model','keys','filters','intersection','fields','attributes','length','includeAll','include','merge','find','create','body','params','describe','addMessage','ids','omit','getMessages','findOne','SmsMessage','rawAttributes','hasOwnProperty','nolimit','order','pick','where','SmsInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','rows','addTags','setTags','spread','Tag','emit','removeTags','download','unix','toString','root','server','tmp','join','transcript-%d-%s.zip','push','User','fullname','CmContact','firstName','lastName','Messages','direction','read','SmsAccount','Owner','get','Sms','Account','closed','closedAt','createdAt','out','System','Contact','secret','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','moment','bluebird','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','api','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','offset','limit','count','set','Content-Range','then','destroy','error','stack','name','send','index','map','SmsInteraction','fieldName','findAll','sms','query'];(function(_0x36dfdf,_0x4c9728){var _0x3439a5=function(_0x499650){while(--_0x499650){_0x36dfdf['push'](_0x36dfdf['shift']());}};_0x3439a5(++_0x4c9728);}(_0x6e20,0xcb));var _0x06e2=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x6e20[_0x2e4aa2];return _0x5e6092;};'use strict';var rimraf=require(_0x06e2('0x0'));var zipdir=require(_0x06e2('0x1'));var moment=require(_0x06e2('0x2'));var BPromise=require(_0x06e2('0x3'));var util=require('util');var path=require(_0x06e2('0x4'));var ejs=require(_0x06e2('0x5'));var fs=require('fs');var _=require(_0x06e2('0x6'));var Redis=require(_0x06e2('0x7'));var interaction=require(_0x06e2('0x8'));var qs=require(_0x06e2('0x9'));var pdf=require('../../components/export/pdf');var logger=require('../../config/logger')(_0x06e2('0xa'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x06e2('0xb')]=_[_0x06e2('0xc')](config[_0x06e2('0xb')],{'host':_0x06e2('0xd'),'port':0x18eb});var socket=require(_0x06e2('0xe'))(new Redis(config['redis']));require(_0x06e2('0xf'))[_0x06e2('0x10')](socket);function respondWithStatusCode(_0x14724c,_0x3f5060){_0x3f5060=_0x3f5060||0xcc;return function(_0x5b685c){if(_0x5b685c){return _0x14724c[_0x06e2('0x11')](_0x3f5060);}return _0x14724c[_0x06e2('0x12')](_0x3f5060)[_0x06e2('0x13')]();};}function respondWithResult(_0x45e4ac,_0x1b84ff){_0x1b84ff=_0x1b84ff||0xc8;return function(_0x5c591f){if(_0x5c591f){return _0x45e4ac[_0x06e2('0x12')](_0x1b84ff)[_0x06e2('0x14')](_0x5c591f);}};}function respondWithFilteredResult(_0x372490,_0x47c03c){return function(_0x3ffeb3){if(_0x3ffeb3){var _0x23744e=typeof _0x47c03c[_0x06e2('0x15')]==='undefined'&&typeof _0x47c03c[_0x06e2('0x16')]==='undefined';var _0xc027f5=_0x3ffeb3[_0x06e2('0x17')];var _0x3e416b=_0x23744e?0x0:_0x47c03c[_0x06e2('0x15')];var _0x49fcd3=_0x23744e?_0x3ffeb3[_0x06e2('0x17')]:_0x47c03c['offset']+_0x47c03c[_0x06e2('0x16')];var _0x2149e4;if(_0x49fcd3>=_0xc027f5){_0x49fcd3=_0xc027f5;_0x2149e4=0xc8;}else{_0x2149e4=0xce;}_0x372490[_0x06e2('0x12')](_0x2149e4);return _0x372490[_0x06e2('0x18')](_0x06e2('0x19'),_0x3e416b+'-'+_0x49fcd3+'/'+_0xc027f5)[_0x06e2('0x14')](_0x3ffeb3);}return null;};}function saveUpdates(_0x29aaa8){return function(_0x4452f0){if(_0x4452f0){return _0x4452f0['update'](_0x29aaa8)[_0x06e2('0x1a')](function(_0x512735){return _0x512735;});}return null;};}function removeEntity(_0x44adaa){return function(_0xc3b322){if(_0xc3b322){return _0xc3b322[_0x06e2('0x1b')]()[_0x06e2('0x1a')](function(){_0x44adaa[_0x06e2('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf283ec){return function(_0x52ad94){if(!_0x52ad94){_0xf283ec[_0x06e2('0x11')](0x194);}return _0x52ad94;};}function handleError(_0x47ce49,_0xa57f1){_0xa57f1=_0xa57f1||0x1f4;return function(_0x5b730c){logger[_0x06e2('0x1c')](_0x5b730c[_0x06e2('0x1d')]);if(_0x5b730c[_0x06e2('0x1e')]){delete _0x5b730c[_0x06e2('0x1e')];}_0x47ce49[_0x06e2('0x12')](_0xa57f1)[_0x06e2('0x1f')](_0x5b730c);};}exports[_0x06e2('0x20')]=function(_0x249065,_0x596a3d){var _0x2cd9b0={};var _0x588e95=_[_0x06e2('0x21')](db[_0x06e2('0x22')]['rawAttributes'],function(_0x30cae0){return{'name':_0x30cae0[_0x06e2('0x23')],'type':_0x30cae0['type']['key']};});_0x2cd9b0=qs['getOptions'](_0x588e95,_0x249065);return interaction[_0x06e2('0x24')](_0x06e2('0x25'),_0x249065[_0x06e2('0x26')],_0x249065[_0x06e2('0x27')],_0x2cd9b0,_0x588e95)[_0x06e2('0x1a')](respondWithFilteredResult(_0x596a3d,_0x2cd9b0))[_0x06e2('0x28')](handleError(_0x596a3d,null));};exports[_0x06e2('0x29')]=function(_0x8f64c3,_0xd20106){var _0x4d0b8e={'raw':![],'where':{'id':_0x8f64c3['params']['id']}},_0x483048={};_0x483048[_0x06e2('0x2a')]=_[_0x06e2('0x2b')](db[_0x06e2('0x22')]['rawAttributes']);_0x483048[_0x06e2('0x26')]=_[_0x06e2('0x2b')](_0x8f64c3[_0x06e2('0x26')]);_0x483048[_0x06e2('0x2c')]=_[_0x06e2('0x2d')](_0x483048[_0x06e2('0x2a')],_0x483048['query']);_0x4d0b8e['attributes']=_[_0x06e2('0x2d')](_0x483048[_0x06e2('0x2a')],qs['fields'](_0x8f64c3['query'][_0x06e2('0x2e')]));_0x4d0b8e['attributes']=_0x4d0b8e[_0x06e2('0x2f')][_0x06e2('0x30')]?_0x4d0b8e[_0x06e2('0x2f')]:_0x483048[_0x06e2('0x2a')];if(_0x8f64c3[_0x06e2('0x26')][_0x06e2('0x31')]){_0x4d0b8e[_0x06e2('0x32')]=[{'all':!![]}];}_0x4d0b8e=_[_0x06e2('0x33')]({},_0x4d0b8e,_0x8f64c3['options']);return db[_0x06e2('0x22')][_0x06e2('0x34')](_0x4d0b8e)[_0x06e2('0x1a')](handleEntityNotFound(_0xd20106,null))[_0x06e2('0x1a')](respondWithResult(_0xd20106,null))[_0x06e2('0x28')](handleError(_0xd20106,null));};exports[_0x06e2('0x35')]=function(_0x51751d,_0x7db4b2){return db[_0x06e2('0x22')][_0x06e2('0x35')](_0x51751d['body'],{})[_0x06e2('0x1a')](respondWithResult(_0x7db4b2,0xc9))[_0x06e2('0x28')](handleError(_0x7db4b2,null));};exports['update']=function(_0x1cea6c,_0x14cca6){if(_0x1cea6c['body']['id']){delete _0x1cea6c[_0x06e2('0x36')]['id'];}return db[_0x06e2('0x22')][_0x06e2('0x34')]({'where':{'id':_0x1cea6c[_0x06e2('0x37')]['id']}})['then'](handleEntityNotFound(_0x14cca6,null))[_0x06e2('0x1a')](saveUpdates(_0x1cea6c[_0x06e2('0x36')],null))[_0x06e2('0x1a')](respondWithResult(_0x14cca6,null))['catch'](handleError(_0x14cca6,null));};exports['destroy']=function(_0x1c640f,_0x5d1eb0){return db[_0x06e2('0x22')][_0x06e2('0x34')]({'where':{'id':_0x1c640f[_0x06e2('0x37')]['id']}})['then'](handleEntityNotFound(_0x5d1eb0,null))[_0x06e2('0x1a')](removeEntity(_0x5d1eb0,null))[_0x06e2('0x28')](handleError(_0x5d1eb0,null));};exports[_0x06e2('0x38')]=function(_0x39847d,_0x12d169){return db[_0x06e2('0x22')][_0x06e2('0x38')]()[_0x06e2('0x1a')](respondWithResult(_0x12d169,null))[_0x06e2('0x28')](handleError(_0x12d169,null));};exports[_0x06e2('0x39')]=function(_0x38c6a7,_0x47f9ee){return db['SmsMessage'][_0x06e2('0x34')]({'where':{'id':_0x38c6a7['params']['id']}})[_0x06e2('0x1a')](handleEntityNotFound(_0x47f9ee,null))[_0x06e2('0x1a')](function(_0x5e439f){if(_0x5e439f){return _0x5e439f['addMessage'](_0x38c6a7[_0x06e2('0x36')][_0x06e2('0x3a')],_[_0x06e2('0x3b')](_0x38c6a7[_0x06e2('0x36')],[_0x06e2('0x3a'),'id'])||{});}})[_0x06e2('0x1a')](respondWithResult(_0x47f9ee,null))['catch'](handleError(_0x47f9ee,null));};exports[_0x06e2('0x3c')]=function(_0x54c4a5,_0x248c60){var _0x5f34e2={'raw':![],'where':{}};var _0x1a4e68={};var _0x210d1d={'count':0x0,'rows':[]};return db[_0x06e2('0x22')][_0x06e2('0x3d')]({'where':{'id':_0x54c4a5['params']['id']}})[_0x06e2('0x1a')](handleEntityNotFound(_0x248c60,null))[_0x06e2('0x1a')](function(_0x1a7286){if(_0x1a7286){_0x1a4e68['model']=_[_0x06e2('0x2b')](db[_0x06e2('0x3e')][_0x06e2('0x3f')]);_0x1a4e68['query']=_[_0x06e2('0x2b')](_0x54c4a5['query']);_0x1a4e68[_0x06e2('0x2c')]=_[_0x06e2('0x2d')](_0x1a4e68['model'],_0x1a4e68[_0x06e2('0x26')]);_0x5f34e2[_0x06e2('0x2f')]=_[_0x06e2('0x2d')](_0x1a4e68[_0x06e2('0x2a')],qs[_0x06e2('0x2e')](_0x54c4a5[_0x06e2('0x26')][_0x06e2('0x2e')]));_0x5f34e2[_0x06e2('0x2f')]=_0x5f34e2[_0x06e2('0x2f')][_0x06e2('0x30')]?_0x5f34e2[_0x06e2('0x2f')]:_0x1a4e68[_0x06e2('0x2a')];if(!_0x54c4a5['query'][_0x06e2('0x40')](_0x06e2('0x41'))){_0x5f34e2['limit']=qs[_0x06e2('0x16')](_0x54c4a5[_0x06e2('0x26')][_0x06e2('0x16')]);_0x5f34e2[_0x06e2('0x15')]=qs[_0x06e2('0x15')](_0x54c4a5['query'][_0x06e2('0x15')]);}_0x5f34e2[_0x06e2('0x42')]=qs['sort'](_0x54c4a5[_0x06e2('0x26')]['sort']);_0x5f34e2['where']=qs['filters'](_[_0x06e2('0x43')](_0x54c4a5[_0x06e2('0x26')],_0x1a4e68['filters']));_0x5f34e2[_0x06e2('0x44')][_0x06e2('0x45')]=_0x1a7286['id'];if(_0x54c4a5[_0x06e2('0x26')][_0x06e2('0x46')]){_0x5f34e2[_0x06e2('0x44')]=_[_0x06e2('0x33')](_0x5f34e2[_0x06e2('0x44')],{'$or':_['map'](_0x5f34e2[_0x06e2('0x2f')],function(_0x36ed04){var _0x26a042={};_0x26a042[_0x36ed04]={'$like':'%'+_0x54c4a5[_0x06e2('0x26')][_0x06e2('0x46')]+'%'};return _0x26a042;})});}if(_0x54c4a5[_0x06e2('0x26')]['$gte']){var _0x1ea1f1=_0x54c4a5[_0x06e2('0x26')][_0x06e2('0x47')][_0x06e2('0x48')](',');var _0x456b8c={};_0x456b8c[_0x1ea1f1[0x0]]={'$gte':moment(_0x1ea1f1[0x1])[_0x06e2('0x49')](_0x06e2('0x4a'))};_0x5f34e2[_0x06e2('0x44')]=_['merge'](_0x5f34e2[_0x06e2('0x44')],_0x456b8c);}_0x5f34e2=_[_0x06e2('0x33')]({},_0x5f34e2,_0x54c4a5[_0x06e2('0x4b')]);return db[_0x06e2('0x3e')][_0x06e2('0x17')]({'where':_0x5f34e2[_0x06e2('0x44')]})[_0x06e2('0x1a')](function(_0x1d4eac){_0x210d1d['count']=_0x1d4eac;if(_0x54c4a5[_0x06e2('0x26')][_0x06e2('0x31')]){_0x5f34e2[_0x06e2('0x32')]=[{'all':!![]}];}return db[_0x06e2('0x3e')]['findAll'](_0x5f34e2);})[_0x06e2('0x1a')](function(_0x3550ce){_0x210d1d[_0x06e2('0x4c')]=_0x3550ce;return _0x210d1d;});}})[_0x06e2('0x1a')](respondWithFilteredResult(_0x248c60,_0x5f34e2))['catch'](handleError(_0x248c60,null));};exports[_0x06e2('0x4d')]=function(_0xfc9544,_0x59a597){return db[_0x06e2('0x22')][_0x06e2('0x34')]({'where':{'id':_0xfc9544['params']['id']}})[_0x06e2('0x1a')](handleEntityNotFound(_0x59a597,null))[_0x06e2('0x1a')](function(_0x5d235d){if(_0x5d235d){return _0x5d235d[_0x06e2('0x4e')](_0xfc9544[_0x06e2('0x36')]['ids'],_[_0x06e2('0x3b')](_0xfc9544[_0x06e2('0x36')],[_0x06e2('0x3a'),'id'])||{})[_0x06e2('0x4f')](function(){return db[_0x06e2('0x50')][_0x06e2('0x24')]({'attributes':['id','name','color'],'where':{'id':_0xfc9544[_0x06e2('0x36')][_0x06e2('0x3a')]}});})[_0x06e2('0x1a')](function(_0x4779d7){socket[_0x06e2('0x51')]('smsInteractionTags:save',{'id':Number(_0xfc9544[_0x06e2('0x37')]['id']),'tags':_0x4779d7||[]});return{'id':Number(_0xfc9544[_0x06e2('0x37')]['id']),'tags':_0x4779d7||[]};});}})['then'](respondWithResult(_0x59a597,null))[_0x06e2('0x28')](handleError(_0x59a597,null));};exports[_0x06e2('0x52')]=function(_0x5cfcee,_0x203bcc){return db[_0x06e2('0x22')]['find']({'where':{'id':_0x5cfcee[_0x06e2('0x37')]['id']}})[_0x06e2('0x1a')](handleEntityNotFound(_0x203bcc,null))[_0x06e2('0x1a')](function(_0x16bde2){if(_0x16bde2){return _0x16bde2[_0x06e2('0x52')](_0x5cfcee[_0x06e2('0x26')]['ids']);}})['then'](respondWithStatusCode(_0x203bcc,null))['catch'](handleError(_0x203bcc,null));};exports[_0x06e2('0x53')]=function(_0x2747f4,_0x2718de){var _0x59e1ed=moment()[_0x06e2('0x54')]()[_0x06e2('0x55')]();var _0x20e21f=path['join'](config[_0x06e2('0x56')],_0x06e2('0x57'),'files',_0x06e2('0x58'));var _0x1d3a6c=path[_0x06e2('0x59')](_0x20e21f,_0x59e1ed);var _0x56fca8=util[_0x06e2('0x49')](_0x06e2('0x5a'),_0x2747f4[_0x06e2('0x37')]['id'],_0x59e1ed);var _0x43be5b=path['join'](_0x20e21f,_0x56fca8);var _0x3dd127=[];_0x3dd127[_0x06e2('0x5b')]({'model':db['User'],'as':_0x06e2('0x5c'),'attributes':['id',_0x06e2('0x5d')],'raw':!![]});_0x3dd127[_0x06e2('0x5b')]({'model':db[_0x06e2('0x5e')],'as':'Contact','attributes':['id',_0x06e2('0x5f'),_0x06e2('0x60')],'raw':!![]});var _0x356dfc=[{'model':db[_0x06e2('0x3e')],'as':_0x06e2('0x61'),'attributes':['id',_0x06e2('0x36'),'createdAt',_0x06e2('0x62'),'secret',_0x06e2('0x63')],'include':_0x3dd127}];_0x356dfc[_0x06e2('0x5b')]({'model':db[_0x06e2('0x64')],'as':'Account','attributes':['id','name']});_0x356dfc[_0x06e2('0x5b')]({'model':db[_0x06e2('0x5c')],'as':_0x06e2('0x65'),'attributes':['id','fullname']});return db[_0x06e2('0x22')][_0x06e2('0x34')]({'where':{'id':_0x2747f4['params']['id']},'include':_0x356dfc})[_0x06e2('0x1a')](handleEntityNotFound(_0x2718de,null))['then'](function(_0x59556f){if(_0x59556f){var _0x4de2ba=_0x59556f[_0x06e2('0x66')]({'plain':!![]});fs['mkdirSync'](_0x1d3a6c);var _0x4f4c06={'channel':_0x06e2('0x67'),'account':_0x4de2ba[_0x06e2('0x68')][_0x06e2('0x1e')],'agent':_0x4de2ba[_0x06e2('0x65')]?_0x4de2ba[_0x06e2('0x65')][_0x06e2('0x5d')]:'N.A.','createdAt':moment(_0x4de2ba['createdAt'])[_0x06e2('0x49')](_0x06e2('0x4a'))['toString'](),'closedAt':_0x4de2ba[_0x06e2('0x69')]?moment(_0x4de2ba[_0x06e2('0x6a')])[_0x06e2('0x49')](_0x06e2('0x4a'))['toString']():'','disposition':_0x4de2ba['disposition'],'messages':_(_0x4de2ba[_0x06e2('0x61')])[_0x06e2('0x46')]({'secret':![]})['map'](function(_0x1174a6){return{'date':moment(_0x1174a6[_0x06e2('0x6b')])[_0x06e2('0x49')](_0x06e2('0x4a'))[_0x06e2('0x55')](),'sender':_0x1174a6['direction']===_0x06e2('0x6c')?_0x1174a6[_0x06e2('0x5c')]?_0x1174a6[_0x06e2('0x5c')]['fullname']:_0x06e2('0x6d'):_0x1174a6[_0x06e2('0x6e')][_0x06e2('0x5f')]+(_0x1174a6[_0x06e2('0x6e')][_0x06e2('0x60')]?'\x20'+_0x1174a6[_0x06e2('0x6e')][_0x06e2('0x60')]:''),'body':_0x1174a6[_0x06e2('0x36')],'direction':_0x1174a6[_0x06e2('0x62')]===_0x06e2('0x6c')?'A':'C','secret':_0x1174a6[_0x06e2('0x6f')],'read':_0x1174a6[_0x06e2('0x63')]};})[_0x06e2('0x70')]()};return ejs[_0x06e2('0x71')](path[_0x06e2('0x59')](config[_0x06e2('0x56')],_0x06e2('0x57'),_0x06e2('0x72'),_0x06e2('0x73')),{'interaction':_0x4f4c06})[_0x06e2('0x1a')](function(_0x2f26b1){var _0x17560b=path[_0x06e2('0x59')](_0x1d3a6c,_0x06e2('0x74')+_0x4de2ba['id']+'-'+_0x59e1ed+_0x06e2('0x75'));var _0x4864d5={'path':_0x17560b,'channel':'Sms','interactionId':_0x4de2ba['id']};return pdf[_0x06e2('0x76')](_0x2f26b1,_0x4864d5);})['then'](function(){return new BPromise(function(_0x30b84b,_0x20eccb){zipdir(_0x1d3a6c,{'saveTo':_0x43be5b},function(_0x1cc138,_0x52e503){if(_0x1cc138)return _0x20eccb(_0x1cc138);return _0x30b84b(_0x52e503);});})[_0x06e2('0x1a')](function(){return new BPromise(function(_0xbc17e9,_0x25d2df){rimraf(_0x1d3a6c,function(_0x3ca310){if(_0x3ca310)_0x25d2df(_0x3ca310);return _0xbc17e9();});});})['then'](function(){return _0x2718de[_0x06e2('0x53')](_0x43be5b,_0x56fca8,function(_0x1deff0){if(_0x1deff0){console['log'](_0x06e2('0x77'),_0x1deff0);}else{fs[_0x06e2('0x78')](_0x43be5b);}});});});}else{return _0x2718de[_0x06e2('0x11')](0xc8);}})[_0x06e2('0x28')](handleError(_0x2718de,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 40a658b..d3adb9b 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 _0x8603=['update','remove','getUsers','then','setDataValue','findAll','unreadMessages','emit','hasOwnProperty','hook','../../mysqldb','SmsInteraction','save'];(function(_0x43e4cc,_0x3a58f4){var _0x1b314b=function(_0x58cbdd){while(--_0x58cbdd){_0x43e4cc['push'](_0x43e4cc['shift']());}};_0x1b314b(++_0x3a58f4);}(_0x8603,0x190));var _0x3860=function(_0x13c304,_0x4791de){_0x13c304=_0x13c304-0x0;var _0x12696e=_0x8603[_0x13c304];return _0x12696e;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x3860('0x0'))['db'][_0x3860('0x1')];var SmsMessage=require(_0x3860('0x0'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3860('0x2'),'afterUpdate':_0x3860('0x3'),'afterDestroy':_0x3860('0x4')};function emitEvent(_0x490262){return function(_0x2fc97a,_0x56f8c5,_0xb0fc24){_0x2fc97a[_0x3860('0x5')]({'attributes':['id'],'raw':!![]})[_0x3860('0x6')](function(_0xd3ce26){_0x2fc97a[_0x3860('0x7')]('Users',_0xd3ce26['map'](function(_0x5b1ac8){return{'id':_0x5b1ac8['id']};}));return SmsMessage[_0x3860('0x8')]({'where':{'SmsInteractionId':_0x2fc97a['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3860('0x6')](function(_0x52c277){_0x2fc97a[_0x3860('0x7')](_0x3860('0x9'),_0x52c277['length']);SmsInteractionEvents[_0x3860('0xa')](_0x490262+':'+_0x2fc97a['id'],_0x2fc97a);SmsInteractionEvents[_0x3860('0xa')](_0x490262,_0x2fc97a);_0xb0fc24(null);})['catch'](_0xb0fc24(null));};}for(var e in events){if(events[_0x3860('0xb')](e)){var event=events[e];SmsInteraction[_0x3860('0xc')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file +var _0x25e7=['hasOwnProperty','hook','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','setDataValue','Users','map','findAll','then','unreadMessages','length','emit'];(function(_0x4d3941,_0x5b0bc0){var _0x5c311b=function(_0x2df585){while(--_0x2df585){_0x4d3941['push'](_0x4d3941['shift']());}};_0x5c311b(++_0x5b0bc0);}(_0x25e7,0x1d6));var _0x725e=function(_0x479c68,_0x4f2415){_0x479c68=_0x479c68-0x0;var _0x5215b1=_0x25e7[_0x479c68];return _0x5215b1;};'use strict';var EventEmitter=require(_0x725e('0x0'));var SmsInteraction=require(_0x725e('0x1'))['db'][_0x725e('0x2')];var SmsMessage=require(_0x725e('0x1'))['db'][_0x725e('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x725e('0x4')](0x0);var events={'afterCreate':_0x725e('0x5'),'afterUpdate':_0x725e('0x6'),'afterDestroy':_0x725e('0x7')};function emitEvent(_0x3da706){return function(_0x493364,_0x5e17a9,_0x2497a5){_0x493364['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x111a50){_0x493364[_0x725e('0x8')](_0x725e('0x9'),_0x111a50[_0x725e('0xa')](function(_0x40d238){return{'id':_0x40d238['id']};}));return SmsMessage[_0x725e('0xb')]({'where':{'SmsInteractionId':_0x493364['id'],'direction':'in','read':![]},'raw':!![]});})[_0x725e('0xc')](function(_0x7c40ff){_0x493364[_0x725e('0x8')](_0x725e('0xd'),_0x7c40ff[_0x725e('0xe')]);SmsInteractionEvents[_0x725e('0xf')](_0x3da706+':'+_0x493364['id'],_0x493364);SmsInteractionEvents['emit'](_0x3da706,_0x493364);_0x2497a5(null);})['catch'](_0x2497a5(null));};}for(var e in events){if(events[_0x725e('0x10')](e)){var event=events[e];SmsInteraction[_0x725e('0x11')](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 1ebc5f2..c72b80e 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 _0x71c2=['closed','format','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed'];(function(_0x506be9,_0x3d617d){var _0x40c1a3=function(_0xfb8397){while(--_0xfb8397){_0x506be9['push'](_0x506be9['shift']());}};_0x40c1a3(++_0x3d617d);}(_0x71c2,0x1ab));var _0x271c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x71c2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x271c('0x0'));var util=require(_0x271c('0x1'));var logger=require(_0x271c('0x2'))(_0x271c('0x3'));var moment=require(_0x271c('0x4'));var BPromise=require(_0x271c('0x5'));var rp=require(_0x271c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x271c('0x7'));var config=require(_0x271c('0x8'));var attributes=require(_0x271c('0x9'));module[_0x271c('0xa')]=function(_0x59ec87,_0x55649c){return _0x59ec87[_0x271c('0xb')](_0x271c('0xc'),attributes,{'tableName':_0x271c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x826f59,_0x1660a3,_0x45d7da){if(_0x826f59[_0x271c('0xe')](_0x271c('0xf'))){_0x826f59['closedAt']=moment()[_0x271c('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x45d7da(null,_0x826f59);}}});}; \ No newline at end of file +var _0xba5a=['api','moment','request-promise','../../config/environment','./smsInteraction.attributes','exports','sms_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger'];(function(_0x2d4884,_0x10a24d){var _0xa68beb=function(_0x146b78){while(--_0x146b78){_0x2d4884['push'](_0x2d4884['shift']());}};_0xa68beb(++_0x10a24d);}(_0xba5a,0x131));var _0xaba5=function(_0x353abb,_0x194c80){_0x353abb=_0x353abb-0x0;var _0x43c9c5=_0xba5a[_0x353abb];return _0x43c9c5;};'use strict';var _=require(_0xaba5('0x0'));var util=require(_0xaba5('0x1'));var logger=require(_0xaba5('0x2'))(_0xaba5('0x3'));var moment=require(_0xaba5('0x4'));var BPromise=require('bluebird');var rp=require(_0xaba5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xaba5('0x6'));var attributes=require(_0xaba5('0x7'));module[_0xaba5('0x8')]=function(_0x3dc344,_0x16883a){return _0x3dc344['define']('SmsInteraction',attributes,{'tableName':_0xaba5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2a42e1,_0x3bdfa1,_0x3550ab){if(_0x2a42e1[_0xaba5('0xa')](_0xaba5('0xb'))){_0x2a42e1[_0xaba5('0xc')]=moment()['format'](_0xaba5('0xd'));}_0x3550ab(null,_0x2a42e1);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 800a4ab..4e8e28b 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 _0x577e=['limit','then','stringify','AddTagsToSmsInteraction','find','ids','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./smsInteraction.socket','register','request','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where'];(function(_0x4133f3,_0x1fc472){var _0x2ca5c8=function(_0x400f3d){while(--_0x400f3d){_0x4133f3['push'](_0x4133f3['shift']());}};_0x2ca5c8(++_0x1fc472);}(_0x577e,0xac));var _0xe577=function(_0x3b9d5f,_0x2e9039){_0x3b9d5f=_0x3b9d5f-0x0;var _0x39924e=_0x577e[_0x3b9d5f];return _0x39924e;};'use strict';var _=require(_0xe577('0x0'));var util=require('util');var moment=require(_0xe577('0x1'));var BPromise=require(_0xe577('0x2'));var rs=require(_0xe577('0x3'));var fs=require('fs');var Redis=require(_0xe577('0x4'));var db=require(_0xe577('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe577('0x6'))(_0xe577('0x7'));var config=require(_0xe577('0x8'));var jayson=require(_0xe577('0x9'));var client=jayson[_0xe577('0xa')][_0xe577('0xb')]({'port':0x232a});config[_0xe577('0xc')]=_[_0xe577('0xd')](config[_0xe577('0xc')],{'host':_0xe577('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe577('0xf'))[_0xe577('0x10')](socket);function respondWithRpcPromise(_0x3c30e2,_0x28052c,_0x6a04c3){return new BPromise(function(_0x20f7ea,_0x4b7f42){return client[_0xe577('0x11')](_0x3c30e2,_0x6a04c3)['then'](function(_0xcea33a){logger[_0xe577('0x12')](_0xe577('0x13'),_0x28052c,_0xe577('0x14'));logger[_0xe577('0x15')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x28052c,'request\x20sent',JSON['stringify'](_0xcea33a));if(_0xcea33a[_0xe577('0x16')]){if(_0xcea33a[_0xe577('0x16')][_0xe577('0x17')]===0x1f4){logger[_0xe577('0x16')]('SmsInteraction,\x20%s,\x20%s',_0x28052c,_0xcea33a[_0xe577('0x16')][_0xe577('0x18')]);return _0x4b7f42(_0xcea33a[_0xe577('0x16')][_0xe577('0x18')]);}logger[_0xe577('0x16')](_0xe577('0x13'),_0x28052c,_0xcea33a[_0xe577('0x16')][_0xe577('0x18')]);return _0x20f7ea(_0xcea33a[_0xe577('0x16')][_0xe577('0x18')]);}else{logger['info']('SmsInteraction,\x20%s,\x20%s',_0x28052c,_0xe577('0x14'));_0x20f7ea(_0xcea33a['result'][_0xe577('0x18')]);}})[_0xe577('0x19')](function(_0x116a31){logger[_0xe577('0x16')](_0xe577('0x13'),_0x28052c,_0x116a31);_0x4b7f42(_0x116a31);});});}exports[_0xe577('0x1a')]=function(_0x5a09e5){var _0xea5f72=this;return new Promise(function(_0x13e1e7,_0x27a916){return db[_0xe577('0x1b')][_0xe577('0x1c')](_0x5a09e5[_0xe577('0x1d')],{'raw':_0x5a09e5[_0xe577('0x1e')]?_0x5a09e5[_0xe577('0x1e')][_0xe577('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a09e5[_0xe577('0x1e')]?_0x5a09e5[_0xe577('0x1e')][_0xe577('0x20')]||null:null,'attributes':_0x5a09e5[_0xe577('0x1e')]?_0x5a09e5[_0xe577('0x1e')]['attributes']||null:null,'limit':_0x5a09e5[_0xe577('0x1e')]?_0x5a09e5[_0xe577('0x1e')][_0xe577('0x21')]||null:null})[_0xe577('0x22')](function(_0x251a8c){logger[_0xe577('0x12')](_0xe577('0x1a'),_0x5a09e5);logger[_0xe577('0x15')](_0xe577('0x1a'),_0x5a09e5,JSON[_0xe577('0x23')](_0x251a8c));_0x13e1e7(_0x251a8c);})[_0xe577('0x19')](function(_0x324687){logger[_0xe577('0x16')](_0xe577('0x1a'),_0x324687[_0xe577('0x18')],_0x5a09e5);_0x27a916(_0xea5f72[_0xe577('0x16')](0x1f4,_0x324687['message']));});});};exports[_0xe577('0x24')]=function(_0x59bc0f){return new Promise(function(_0x1a6575,_0x31c4f1){return db[_0xe577('0x1b')][_0xe577('0x25')]({'where':_0x59bc0f[_0xe577('0x1e')]?_0x59bc0f[_0xe577('0x1e')]['where']||null:null})[_0xe577('0x22')](function(_0x4de991){if(_0x4de991){return _0x4de991['addTags'](_0x59bc0f[_0xe577('0x1d')][_0xe577('0x26')],_['omit'](_0x59bc0f['body'],[_0xe577('0x26'),'id'])||{});}})[_0xe577('0x27')](function(_0x27225e){logger[_0xe577('0x12')](_0xe577('0x28'),_0x59bc0f);logger[_0xe577('0x15')](_0xe577('0x28'),_0x59bc0f,JSON[_0xe577('0x23')](_0x27225e));_0x1a6575(_0x27225e);})[_0xe577('0x19')](function(_0x11ce7e){logger[_0xe577('0x16')](_0xe577('0x28'),_0x11ce7e['message'],_0x59bc0f);_0x31c4f1(_this[_0xe577('0x16')](0x1f4,_0x11ce7e[_0xe577('0x18')]));});});}; \ No newline at end of file +var _0x787a=['../../config/utils','../../config/logger','../../config/environment','client','http','redis','localhost','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SmsInteraction','body','options','raw','where','attributes','UpdateSmsInteraction','AddTagsToSmsInteraction','find','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x787a,0x142));var _0xa787=function(_0x164128,_0x52b60f){_0x164128=_0x164128-0x0;var _0x83ff4b=_0x787a[_0x164128];return _0x83ff4b;};'use strict';var _=require(_0xa787('0x0'));var util=require(_0xa787('0x1'));var moment=require(_0xa787('0x2'));var BPromise=require(_0xa787('0x3'));var rs=require(_0xa787('0x4'));var fs=require('fs');var Redis=require(_0xa787('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa787('0x6'));var logger=require(_0xa787('0x7'))('rpc');var config=require(_0xa787('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa787('0x9')][_0xa787('0xa')]({'port':0x232a});config[_0xa787('0xb')]=_['defaults'](config['redis'],{'host':_0xa787('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa787('0xb')]));require(_0xa787('0xd'))[_0xa787('0xe')](socket);function respondWithRpcPromise(_0x5ad036,_0x21eb40,_0x4c1678){return new BPromise(function(_0x595403,_0x176fde){return client[_0xa787('0xf')](_0x5ad036,_0x4c1678)[_0xa787('0x10')](function(_0x1343ca){logger[_0xa787('0x11')](_0xa787('0x12'),_0x21eb40,_0xa787('0x13'));logger[_0xa787('0x14')](_0xa787('0x15'),_0x21eb40,_0xa787('0x13'),JSON[_0xa787('0x16')](_0x1343ca));if(_0x1343ca[_0xa787('0x17')]){if(_0x1343ca[_0xa787('0x17')][_0xa787('0x18')]===0x1f4){logger['error'](_0xa787('0x12'),_0x21eb40,_0x1343ca[_0xa787('0x17')]['message']);return _0x176fde(_0x1343ca[_0xa787('0x17')][_0xa787('0x19')]);}logger[_0xa787('0x17')](_0xa787('0x12'),_0x21eb40,_0x1343ca['error'][_0xa787('0x19')]);return _0x595403(_0x1343ca['error']['message']);}else{logger[_0xa787('0x11')](_0xa787('0x12'),_0x21eb40,_0xa787('0x13'));_0x595403(_0x1343ca[_0xa787('0x1a')][_0xa787('0x19')]);}})[_0xa787('0x1b')](function(_0x1752ca){logger[_0xa787('0x17')](_0xa787('0x12'),_0x21eb40,_0x1752ca);_0x176fde(_0x1752ca);});});}exports['UpdateSmsInteraction']=function(_0x44a0ae){var _0x52861e=this;return new Promise(function(_0x559b95,_0x14cbe3){return db[_0xa787('0x1c')]['update'](_0x44a0ae[_0xa787('0x1d')],{'raw':_0x44a0ae['options']?_0x44a0ae[_0xa787('0x1e')][_0xa787('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44a0ae['options']?_0x44a0ae['options'][_0xa787('0x20')]||null:null,'attributes':_0x44a0ae[_0xa787('0x1e')]?_0x44a0ae['options'][_0xa787('0x21')]||null:null,'limit':_0x44a0ae[_0xa787('0x1e')]?_0x44a0ae['options']['limit']||null:null})[_0xa787('0x10')](function(_0x5a246d){logger['info'](_0xa787('0x22'),_0x44a0ae);logger[_0xa787('0x14')](_0xa787('0x22'),_0x44a0ae,JSON[_0xa787('0x16')](_0x5a246d));_0x559b95(_0x5a246d);})[_0xa787('0x1b')](function(_0x5cc45e){logger['error'](_0xa787('0x22'),_0x5cc45e['message'],_0x44a0ae);_0x14cbe3(_0x52861e[_0xa787('0x17')](0x1f4,_0x5cc45e[_0xa787('0x19')]));});});};exports[_0xa787('0x23')]=function(_0x504955){return new Promise(function(_0x1dd438,_0x541c39){return db[_0xa787('0x1c')][_0xa787('0x24')]({'where':_0x504955[_0xa787('0x1e')]?_0x504955[_0xa787('0x1e')]['where']||null:null})['then'](function(_0x3a4c6b){if(_0x3a4c6b){return _0x3a4c6b['addTags'](_0x504955[_0xa787('0x1d')][_0xa787('0x25')],_[_0xa787('0x26')](_0x504955['body'],['ids','id'])||{});}})[_0xa787('0x27')](function(_0x39609f){logger['info'](_0xa787('0x28'),_0x504955);logger[_0xa787('0x14')]('AddTags',_0x504955,JSON['stringify'](_0x39609f));_0x1dd438(_0x39609f);})[_0xa787('0x1b')](function(_0x2bd143){logger[_0xa787('0x17')](_0xa787('0x28'),_0x2bd143['message'],_0x504955);_0x541c39(_this['error'](0x1f4,_0x2bd143[_0xa787('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 234eed5..3dd313b 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 _0x1a27=['update','removeListener','length','smsInteraction:','./smsInteraction.events','save','remove'];(function(_0x3be455,_0x2c4438){var _0x3c8fa2=function(_0x2560a3){while(--_0x2560a3){_0x3be455['push'](_0x3be455['shift']());}};_0x3c8fa2(++_0x2c4438);}(_0x1a27,0x1af));var _0x71a2=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x1a27[_0x297fd3];return _0x2af381;};'use strict';var SmsInteractionEvents=require(_0x71a2('0x0'));var events=[_0x71a2('0x1'),_0x71a2('0x2'),_0x71a2('0x3')];function createListener(_0xf9aea2,_0x312338){return function(_0x523ece){_0x312338['emit'](_0xf9aea2,_0x523ece);};}function removeListener(_0x11374c,_0xd5702a){return function(){SmsInteractionEvents[_0x71a2('0x4')](_0x11374c,_0xd5702a);};}exports['register']=function(_0x565f27){for(var _0x3c6a54=0x0,_0x39c671=events[_0x71a2('0x5')];_0x3c6a54<_0x39c671;_0x3c6a54++){var _0x321d1c=events[_0x3c6a54];var _0x38c3e7=createListener(_0x71a2('0x6')+_0x321d1c,_0x565f27);SmsInteractionEvents['on'](_0x321d1c,_0x38c3e7);}}; \ No newline at end of file +var _0x1ede=['smsInteraction:','./smsInteraction.events','save','remove','emit','removeListener','register','length'];(function(_0x3d1b89,_0x1f8634){var _0x23f88d=function(_0x15a6f2){while(--_0x15a6f2){_0x3d1b89['push'](_0x3d1b89['shift']());}};_0x23f88d(++_0x1f8634);}(_0x1ede,0x121));var _0xe1ed=function(_0x2822e0,_0x18394b){_0x2822e0=_0x2822e0-0x0;var _0x60b967=_0x1ede[_0x2822e0];return _0x60b967;};'use strict';var SmsInteractionEvents=require(_0xe1ed('0x0'));var events=[_0xe1ed('0x1'),_0xe1ed('0x2'),'update'];function createListener(_0x14fdea,_0x22feba){return function(_0xe45830){_0x22feba[_0xe1ed('0x3')](_0x14fdea,_0xe45830);};}function removeListener(_0x3153b2,_0x53e6af){return function(){SmsInteractionEvents[_0xe1ed('0x4')](_0x3153b2,_0x53e6af);};}exports[_0xe1ed('0x5')]=function(_0x3fd351){for(var _0x5b8f00=0x0,_0x145e56=events[_0xe1ed('0x6')];_0x5b8f00<_0x145e56;_0x5b8f00++){var _0x2671eb=events[_0x5b8f00];var _0x33c8c3=createListener(_0xe1ed('0x7')+_0x2671eb,_0x3fd351);SmsInteractionEvents['on'](_0x2671eb,_0x33c8c3);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index d53bfeb..315964b 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 _0xd2c4=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','/:id','show','post','sms','smsmessage:create','create','/:id/status','status','put','/:id/accept','/:id/reject','reject','delete','destroy'];(function(_0x3073b7,_0x38a224){var _0x509133=function(_0x3d7e15){while(--_0x3d7e15){_0x3073b7['push'](_0x3073b7['shift']());}};_0x509133(++_0x38a224);}(_0xd2c4,0xeb));var _0x4d2c=function(_0x5db313,_0x3c8f0c){_0x5db313=_0x5db313-0x0;var _0x36d503=_0xd2c4[_0x5db313];return _0x36d503;};'use strict';var multer=require(_0x4d2c('0x0'));var util=require(_0x4d2c('0x1'));var path=require('path');var timeout=require(_0x4d2c('0x2'));var express=require(_0x4d2c('0x3'));var router=express[_0x4d2c('0x4')]();var fs_extra=require(_0x4d2c('0x5'));var auth=require(_0x4d2c('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./smsMessage.controller');router[_0x4d2c('0x7')]('/',auth[_0x4d2c('0x8')](),controller[_0x4d2c('0x9')]);router[_0x4d2c('0x7')](_0x4d2c('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x4d2c('0x7')](_0x4d2c('0xb'),auth[_0x4d2c('0x8')](),controller[_0x4d2c('0xc')]);router[_0x4d2c('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x4d2c('0xe'),_0x4d2c('0xf')),controller[_0x4d2c('0x10')]);router['post'](_0x4d2c('0x11'),controller[_0x4d2c('0x12')]);router[_0x4d2c('0x13')](_0x4d2c('0xb'),auth[_0x4d2c('0x8')](),controller['update']);router[_0x4d2c('0x13')](_0x4d2c('0x14'),auth[_0x4d2c('0x8')](),controller['accept']);router['put'](_0x4d2c('0x15'),auth[_0x4d2c('0x8')](),controller[_0x4d2c('0x16')]);router[_0x4d2c('0x17')](_0x4d2c('0xb'),auth['isAuthenticated'](),controller[_0x4d2c('0x18')]);module[_0x4d2c('0x19')]=router; \ No newline at end of file +var _0x51ef=['util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','sms','smsmessage:create','create','put','update','accept','/:id/reject','delete','destroy','exports','multer'];(function(_0x44b8c3,_0x199b1c){var _0x43153b=function(_0x3645d7){while(--_0x3645d7){_0x44b8c3['push'](_0x44b8c3['shift']());}};_0x43153b(++_0x199b1c);}(_0x51ef,0x1db));var _0xf51e=function(_0x4bec33,_0x3b9fba){_0x4bec33=_0x4bec33-0x0;var _0x541a50=_0x51ef[_0x4bec33];return _0x541a50;};'use strict';var multer=require(_0xf51e('0x0'));var util=require(_0xf51e('0x1'));var path=require(_0xf51e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf51e('0x3')]();var fs_extra=require(_0xf51e('0x4'));var auth=require(_0xf51e('0x5'));var interaction=require(_0xf51e('0x6'));var config=require(_0xf51e('0x7'));var controller=require(_0xf51e('0x8'));router[_0xf51e('0x9')]('/',auth[_0xf51e('0xa')](),controller[_0xf51e('0xb')]);router[_0xf51e('0x9')](_0xf51e('0xc'),auth[_0xf51e('0xa')](),controller[_0xf51e('0xd')]);router['get'](_0xf51e('0xe'),auth['isAuthenticated'](),controller[_0xf51e('0xf')]);router[_0xf51e('0x10')]('/',auth[_0xf51e('0xa')](),interaction[_0xf51e('0x11')](_0xf51e('0x12'),_0xf51e('0x13')),controller[_0xf51e('0x14')]);router['post']('/:id/status',controller['status']);router[_0xf51e('0x15')](_0xf51e('0xe'),auth['isAuthenticated'](),controller[_0xf51e('0x16')]);router['put']('/:id/accept',auth[_0xf51e('0xa')](),controller[_0xf51e('0x17')]);router[_0xf51e('0x15')](_0xf51e('0x18'),auth[_0xf51e('0xa')](),controller['reject']);router[_0xf51e('0x19')](_0xf51e('0xe'),auth[_0xf51e('0xa')](),controller[_0xf51e('0x1a')]);module[_0xf51e('0x1b')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index a9ec8ff..78a5ea4 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 _0x9ade=['out','DATE','STRING','TEXT','sequelize','exports','BOOLEAN'];(function(_0x172dca,_0xda5041){var _0x2a887f=function(_0x1a6aa5){while(--_0x1a6aa5){_0x172dca['push'](_0x172dca['shift']());}};_0x2a887f(++_0xda5041);}(_0x9ade,0x107));var _0xe9ad=function(_0x45c48f,_0x4aa891){_0x45c48f=_0x45c48f-0x0;var _0xaf5037=_0x9ade[_0x45c48f];return _0xaf5037;};'use strict';var Sequelize=require(_0xe9ad('0x0'));module[_0xe9ad('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xe9ad('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xe9ad('0x3')),'defaultValue':_0xe9ad('0x3'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xe9ad('0x4')]},'secret':{'type':Sequelize[_0xe9ad('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xe9ad('0x5')]},'providerResponse':{'type':Sequelize[_0xe9ad('0x6')]}}; \ No newline at end of file +var _0x98ac=['TEXT','ENUM','out','STRING','BOOLEAN'];(function(_0x5ec454,_0xfcd77e){var _0x5ebf50=function(_0x29de85){while(--_0x29de85){_0x5ec454['push'](_0x5ec454['shift']());}};_0x5ebf50(++_0xfcd77e);}(_0x98ac,0x1d1));var _0xc98a=function(_0x4b6f6f,_0x59f8e7){_0x4b6f6f=_0x4b6f6f-0x0;var _0x498a75=_0x98ac[_0x4b6f6f];return _0x498a75;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xc98a('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xc98a('0x1')]('in',_0xc98a('0x2')),'defaultValue':_0xc98a('0x2'),'allowNull':![]},'messageId':{'type':Sequelize[_0xc98a('0x3')](0xbe)},'phone':{'type':Sequelize[_0xc98a('0x3')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xc98a('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xc98a('0x3')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 3de787b..0b7dfac 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 _0x5532=['rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./smsMessage.socket','client','http','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','sendStatus','name','send','map','SmsMessage','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','include','show','params','keys','includeAll','options','find','create','body','describe','sms-interactions','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteractionId','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','sequelize','Sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','SmsInteraction','RejectMessage','ContactId','fullname','rejectmessage','SmsAccount','debug','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','MessageUUID','messageId','indexOf','sent','delivered','Status','infobip','groupName','DELIVERED','eml-format'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x5532,0x19a));var _0x2553=function(_0x19d5e5,_0x76f413){_0x19d5e5=_0x19d5e5-0x0;var _0x5a6843=_0x5532[_0x19d5e5];return _0x5a6843;};'use strict';var emlformat=require(_0x2553('0x0'));var rimraf=require(_0x2553('0x1'));var zipdir=require(_0x2553('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2553('0x3'));var moment=require('moment');var BPromise=require(_0x2553('0x4'));var Mustache=require(_0x2553('0x5'));var util=require(_0x2553('0x6'));var path=require('path');var sox=require(_0x2553('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2553('0x8'));var _=require(_0x2553('0x9'));var squel=require('squel');var crypto=require(_0x2553('0xa'));var jsforce=require(_0x2553('0xb'));var deskjs=require(_0x2553('0xc'));var toCsv=require(_0x2553('0xd'));var querystring=require(_0x2553('0xe'));var Papa=require(_0x2553('0xf'));var Redis=require(_0x2553('0x10'));var authService=require(_0x2553('0x11'));var qs=require(_0x2553('0x12'));var as=require(_0x2553('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2553('0x14'))(_0x2553('0x15'));var utils=require(_0x2553('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x2553('0x17'));var db=require(_0x2553('0x18'))['db'];config['redis']=_['defaults'](config[_0x2553('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x2553('0x1a'))(new Redis(config[_0x2553('0x19')]));require(_0x2553('0x1b'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x2553('0x1c')][_0x2553('0x1d')]({'port':0x232c});var client9002=jayson[_0x2553('0x1c')][_0x2553('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x241dfe,_0x31ae8f,_0x486092,_0x244d3e){return new BPromise(function(_0x4db92a,_0x54f78c){var _0x2d7a8b=_0x244d3e||client;return _0x2d7a8b[_0x2553('0x1e')](_0x241dfe,_0x486092)['then'](function(_0x3abe34){logger[_0x2553('0x1f')](_0x2553('0x20'),_0x31ae8f,_0x2553('0x21'));logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x31ae8f,_0x2553('0x21'),JSON[_0x2553('0x22')](_0x3abe34));if(_0x3abe34[_0x2553('0x23')]){if(_0x3abe34['error']['code']===0x1f4){logger[_0x2553('0x23')](_0x2553('0x20'),_0x31ae8f,_0x3abe34[_0x2553('0x23')]['message']);return _0x54f78c(_0x3abe34[_0x2553('0x23')][_0x2553('0x24')]);}logger[_0x2553('0x23')]('SmsMessage,\x20%s,\x20%s',_0x31ae8f,_0x3abe34[_0x2553('0x23')][_0x2553('0x24')]);return _0x4db92a(_0x3abe34[_0x2553('0x23')][_0x2553('0x24')]);}else{logger['info'](_0x2553('0x20'),_0x31ae8f,_0x2553('0x21'));_0x4db92a(_0x3abe34['result'][_0x2553('0x24')]);}})[_0x2553('0x25')](function(_0x57516e){logger[_0x2553('0x23')](_0x2553('0x20'),_0x31ae8f,_0x57516e);_0x54f78c(_0x57516e);});});}function respondWithStatusCode(_0x25b7aa,_0x4aa3fa){_0x4aa3fa=_0x4aa3fa||0xcc;return function(_0x3fdfb1){if(_0x3fdfb1){return _0x25b7aa['sendStatus'](_0x4aa3fa);}return _0x25b7aa[_0x2553('0x26')](_0x4aa3fa)['end']();};}function respondWithResult(_0x49163b,_0x1765a5){_0x1765a5=_0x1765a5||0xc8;return function(_0x4fe54d){if(_0x4fe54d){return _0x49163b[_0x2553('0x26')](_0x1765a5)[_0x2553('0x27')](_0x4fe54d);}};}function respondWithFilteredResult(_0x17ee14,_0x369bfc){return function(_0x54691d){if(_0x54691d){var _0x19fec3=typeof _0x369bfc[_0x2553('0x28')]===_0x2553('0x29')&&typeof _0x369bfc[_0x2553('0x2a')]===_0x2553('0x29');var _0x3abec1=_0x54691d[_0x2553('0x2b')];var _0x3d3224=_0x19fec3?0x0:_0x369bfc[_0x2553('0x28')];var _0x103cd6=_0x19fec3?_0x54691d[_0x2553('0x2b')]:_0x369bfc[_0x2553('0x28')]+_0x369bfc[_0x2553('0x2a')];var _0x26dcec;if(_0x103cd6>=_0x3abec1){_0x103cd6=_0x3abec1;_0x26dcec=0xc8;}else{_0x26dcec=0xce;}_0x17ee14['status'](_0x26dcec);return _0x17ee14[_0x2553('0x2c')](_0x2553('0x2d'),_0x3d3224+'-'+_0x103cd6+'/'+_0x3abec1)['json'](_0x54691d);}return null;};}function patchUpdates(_0x30043b){return function(_0x923f13){try{jsonpatch['apply'](_0x923f13,_0x30043b,!![]);}catch(_0x3222cf){return BPromise[_0x2553('0x2e')](_0x3222cf);}return _0x923f13[_0x2553('0x2f')]();};}function saveUpdates(_0x3c2e4,_0x4ec2eb){return function(_0x399385){if(_0x399385){return _0x399385[_0x2553('0x30')](_0x3c2e4)[_0x2553('0x31')](function(_0x21219f){return _0x21219f;});}return null;};}function removeEntity(_0x16b5af,_0x1cf1a9){return function(_0x260077){if(_0x260077){return _0x260077[_0x2553('0x32')]()[_0x2553('0x31')](function(){_0x16b5af['status'](0xcc)[_0x2553('0x33')]();});}};}function handleEntityNotFound(_0x4beb37,_0x24d297){return function(_0x43b7d5){if(!_0x43b7d5){_0x4beb37[_0x2553('0x34')](0x194);}return _0x43b7d5;};}function handleError(_0x59370b,_0x2df1d6){_0x2df1d6=_0x2df1d6||0x1f4;return function(_0x478a3b){logger['error'](_0x478a3b['stack']);if(_0x478a3b[_0x2553('0x35')]){delete _0x478a3b[_0x2553('0x35')];}_0x59370b[_0x2553('0x26')](_0x2df1d6)[_0x2553('0x36')](_0x478a3b);};}exports['index']=function(_0x2f4840,_0x176b76){var _0x737a01={},_0x48c40e={},_0x2fc35={'count':0x0,'rows':[]};var _0x249c27=_[_0x2553('0x37')](db[_0x2553('0x38')][_0x2553('0x39')],function(_0x2d16a4){return{'name':_0x2d16a4['fieldName'],'type':_0x2d16a4[_0x2553('0x3a')][_0x2553('0x3b')]};});_0x48c40e[_0x2553('0x3c')]=_[_0x2553('0x37')](_0x249c27,_0x2553('0x35'));_0x48c40e[_0x2553('0x3d')]=_['keys'](_0x2f4840['query']);_0x48c40e[_0x2553('0x3e')]=_[_0x2553('0x3f')](_0x48c40e[_0x2553('0x3c')],_0x48c40e[_0x2553('0x3d')]);_0x737a01['attributes']=_[_0x2553('0x3f')](_0x48c40e['model'],qs[_0x2553('0x40')](_0x2f4840[_0x2553('0x3d')][_0x2553('0x40')]));_0x737a01[_0x2553('0x41')]=_0x737a01[_0x2553('0x41')]['length']?_0x737a01[_0x2553('0x41')]:_0x48c40e[_0x2553('0x3c')];if(!_0x2f4840[_0x2553('0x3d')][_0x2553('0x42')]('nolimit')){_0x737a01[_0x2553('0x2a')]=qs['limit'](_0x2f4840['query'][_0x2553('0x2a')]);_0x737a01['offset']=qs[_0x2553('0x28')](_0x2f4840[_0x2553('0x3d')][_0x2553('0x28')]);}_0x737a01[_0x2553('0x43')]=qs['sort'](_0x2f4840['query'][_0x2553('0x44')]);_0x737a01[_0x2553('0x45')]=qs['filters'](_['pick'](_0x2f4840['query'],_0x48c40e['filters']),_0x249c27);if(_0x2f4840['query'][_0x2553('0x46')]){_0x737a01[_0x2553('0x45')]=_[_0x2553('0x47')](_0x737a01[_0x2553('0x45')],{'$or':_['map'](_0x249c27,function(_0x4dafed){if(_0x4dafed['type']!==_0x2553('0x48')){var _0x222095={};_0x222095[_0x4dafed[_0x2553('0x35')]]={'$like':'%'+_0x2f4840[_0x2553('0x3d')][_0x2553('0x46')]+'%'};return _0x222095;}})});}_0x737a01=_[_0x2553('0x47')]({},_0x737a01,_0x2f4840['options']);var _0x386314={'where':_0x737a01[_0x2553('0x45')]};return db[_0x2553('0x38')][_0x2553('0x2b')](_0x386314)[_0x2553('0x31')](function(_0x206c76){_0x2fc35[_0x2553('0x2b')]=_0x206c76;if(_0x2f4840[_0x2553('0x3d')]['includeAll']){_0x737a01[_0x2553('0x49')]=[{'all':!![]}];}return db[_0x2553('0x38')]['findAll'](_0x737a01);})[_0x2553('0x31')](function(_0x3714dc){_0x2fc35['rows']=_0x3714dc;return _0x2fc35;})[_0x2553('0x31')](respondWithFilteredResult(_0x176b76,_0x737a01))['catch'](handleError(_0x176b76,null));};exports[_0x2553('0x4a')]=function(_0x4e1dac,_0x4e7548){var _0x51b47e={'raw':!![],'where':{'id':_0x4e1dac[_0x2553('0x4b')]['id']}},_0x248928={};_0x248928[_0x2553('0x3c')]=_[_0x2553('0x4c')](db['SmsMessage']['rawAttributes']);_0x248928['query']=_[_0x2553('0x4c')](_0x4e1dac['query']);_0x248928[_0x2553('0x3e')]=_[_0x2553('0x3f')](_0x248928[_0x2553('0x3c')],_0x248928[_0x2553('0x3d')]);_0x51b47e['attributes']=_[_0x2553('0x3f')](_0x248928[_0x2553('0x3c')],qs[_0x2553('0x40')](_0x4e1dac[_0x2553('0x3d')][_0x2553('0x40')]));_0x51b47e[_0x2553('0x41')]=_0x51b47e[_0x2553('0x41')]['length']?_0x51b47e[_0x2553('0x41')]:_0x248928['model'];if(_0x4e1dac[_0x2553('0x3d')][_0x2553('0x4d')]){_0x51b47e[_0x2553('0x49')]=[{'all':!![]}];}_0x51b47e=_[_0x2553('0x47')]({},_0x51b47e,_0x4e1dac[_0x2553('0x4e')]);return db[_0x2553('0x38')][_0x2553('0x4f')](_0x51b47e)['then'](handleEntityNotFound(_0x4e7548,null))[_0x2553('0x31')](respondWithResult(_0x4e7548,null))[_0x2553('0x25')](handleError(_0x4e7548,null));};exports[_0x2553('0x50')]=function(_0x1d35ba,_0x5f3a6e){return db[_0x2553('0x38')]['create'](_0x1d35ba[_0x2553('0x51')],{})[_0x2553('0x31')](respondWithResult(_0x5f3a6e,0xc9))[_0x2553('0x25')](handleError(_0x5f3a6e,null));};exports['update']=function(_0x2f3ca4,_0x1b7103){if(_0x2f3ca4['body']['id']){delete _0x2f3ca4[_0x2553('0x51')]['id'];}return db[_0x2553('0x38')][_0x2553('0x4f')]({'where':{'id':_0x2f3ca4[_0x2553('0x4b')]['id']}})[_0x2553('0x31')](handleEntityNotFound(_0x1b7103,null))[_0x2553('0x31')](saveUpdates(_0x2f3ca4[_0x2553('0x51')],null))[_0x2553('0x31')](respondWithResult(_0x1b7103,null))['catch'](handleError(_0x1b7103,null));};exports['destroy']=function(_0x516f74,_0x512f3f){return db[_0x2553('0x38')][_0x2553('0x4f')]({'where':{'id':_0x516f74['params']['id']}})[_0x2553('0x31')](handleEntityNotFound(_0x512f3f,null))['then'](removeEntity(_0x512f3f,null))[_0x2553('0x25')](handleError(_0x512f3f,null));};exports[_0x2553('0x52')]=function(_0x176d8a,_0x2c0258){return db[_0x2553('0x38')][_0x2553('0x52')]()[_0x2553('0x31')](respondWithResult(_0x2c0258,null))[_0x2553('0x25')](handleError(_0x2c0258,null));};var interaction_log=require(_0x2553('0x14'))(_0x2553('0x53'));exports['accept']=function(_0x551f9f,_0x281044,_0x69b98f){var _0x2e35d7={'agent':{},'channel':_0x2553('0x54')};if(_0x551f9f[_0x2553('0x51')]['id']){delete _0x551f9f[_0x2553('0x51')]['id'];}_0x551f9f[_0x2553('0x51')][_0x2553('0x55')]=!![];_0x551f9f['body'][_0x2553('0x56')]=moment()[_0x2553('0x57')](_0x2553('0x58'));_0x551f9f[_0x2553('0x51')]['UserId']=_0x551f9f['body'][_0x2553('0x59')]||_0x551f9f[_0x2553('0x5a')]['id'];_0x2e35d7[_0x2553('0x5b')]['id']=_0x551f9f[_0x2553('0x51')][_0x2553('0x59')];return db[_0x2553('0x38')][_0x2553('0x4f')]({'where':{'id':_0x551f9f[_0x2553('0x4b')]['id'],'UserId':null}})[_0x2553('0x31')](handleEntityNotFound(_0x281044,null))[_0x2553('0x31')](saveUpdates(_0x551f9f['body'],null))[_0x2553('0x31')](function(_0x545dcb){if(_0x545dcb){_0x2e35d7[_0x2553('0x24')]=_0x545dcb[_0x2553('0x5c')]({'plain':!![]});return db['SmsInteraction'][_0x2553('0x4f')]({'where':{'id':_0x545dcb[_0x2553('0x5d')]}});}return null;})['then'](handleEntityNotFound(_0x281044,null))[_0x2553('0x31')](function(_0x26e9fc){if(_0x26e9fc){return _0x26e9fc[_0x2553('0x30')]({'UserId':_0x551f9f['body'][_0x2553('0x59')],'read1stAt':_['isNil'](_0x26e9fc[_0x2553('0x5e')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x2553('0x31')](function(_0x47eb75){if(_0x47eb75){_0x2e35d7[_0x2553('0x5f')]=_0x47eb75[_0x2553('0x5c')]({'plain':!![]});interaction_log[_0x2553('0x1f')](_0x2553('0x60'),_0x551f9f['user']['id'],_0x551f9f['user'][_0x2553('0x35')],_0x551f9f[_0x2553('0x5a')][_0x2553('0x61')],_0x2e35d7[_0x2553('0x5f')]['id'],_0x551f9f[_0x2553('0x51')]?JSON[_0x2553('0x22')](_0x551f9f[_0x2553('0x51')]):_0x2553('0x62'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x2e35d7);}return null;})[_0x2553('0x31')](function(_0x54ea50){var _0x20b5da='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x54ea50[_0x2553('0x24')]['ContactId'];return db[_0x2553('0x63')][_0x2553('0x3d')](_0x20b5da,{'type':db[_0x2553('0x64')][_0x2553('0x65')][_0x2553('0x66')],'raw':!![]})[_0x2553('0x31')](function(_0x44bbad){return _0x44bbad;});})[_0x2553('0x31')](function(_0x14ca35){if(_0x14ca35){_0x2e35d7[_0x2553('0x24')][_0x2553('0x67')]=_0x14ca35[0x0];if(!_0x551f9f[_0x2553('0x51')][_0x2553('0x59')])return;return db[_0x2553('0x68')]['find']({'where':{'id':_0x551f9f['body'][_0x2553('0x59')],'role':_0x2553('0x5b')},'attributes':['id',_0x2553('0x35'),'fullname',_0x2553('0x69'),_0x2553('0x6a')],'raw':!![]});}return null;})['then'](function(_0x2b1b5b){if(!_0x2b1b5b)return null;_0x2e35d7[_0x2553('0x24')][_0x2553('0x5b')]=_0x2b1b5b;return _0x2e35d7;})[_0x2553('0x31')](function(_0x335914){if(_0x335914){if(_0x551f9f[_0x2553('0x51')][_0x2553('0x6b')]){_0x2e35d7[_0x2553('0x24')][_0x2553('0x6c')]=util['format'](_0x2553('0x6d'),_0x551f9f[_0x2553('0x5a')][_0x2553('0x35')]);_0x2e35d7[_0x2553('0x24')][_0x2553('0x6e')]=_0x2e35d7[_0x2553('0x6e')];_0x2e35d7['message'][_0x2553('0x6f')]=_0x2e35d7[_0x2553('0x6e')];_0x2e35d7[_0x2553('0x24')][_0x2553('0x70')]=_0x2553('0x71');return respondWithRpcPromise('EventManager',_0x2553('0x72'),{'event':_0x2553('0x73'),'message':_0x2e35d7['message']},client9002)[_0x2553('0x31')](function(){return _0x2e35d7;});}return _0x2e35d7;}return null;})[_0x2553('0x31')](respondWithResult(_0x281044,null))[_0x2553('0x25')](handleError(_0x281044,null));};var interaction_log=require('../../config/logger')('sms-interactions');exports[_0x2553('0x2e')]=function(_0x18a2b1,_0x3bf57,_0x2ce455){var _0x3b8789={'agent':{},'channel':_0x2553('0x54')};if(_0x18a2b1[_0x2553('0x51')]['id']){delete _0x18a2b1['body']['id'];}_0x18a2b1[_0x2553('0x51')][_0x2553('0x59')]=_0x18a2b1[_0x2553('0x51')]['UserId']||_0x18a2b1[_0x2553('0x5a')]['id'];_0x3b8789[_0x2553('0x5b')]['id']=_0x18a2b1[_0x2553('0x51')][_0x2553('0x59')];return db[_0x2553('0x38')]['find']({'where':{'id':_0x18a2b1[_0x2553('0x4b')]['id'],'UserId':null}})[_0x2553('0x31')](handleEntityNotFound(_0x3bf57,null))[_0x2553('0x31')](function(_0x36e29a){if(_0x36e29a){_0x3b8789[_0x2553('0x24')]=_0x36e29a[_0x2553('0x5c')]({'plain':!![]});return db[_0x2553('0x74')][_0x2553('0x4f')]({'where':{'id':_0x36e29a[_0x2553('0x5d')]}});}return null;})[_0x2553('0x31')](handleEntityNotFound(_0x3bf57,null))['then'](function(_0x20635b){if(_0x20635b){_0x3b8789[_0x2553('0x5f')]=_0x20635b[_0x2553('0x5c')]({'plain':!![]});interaction_log['info']('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x18a2b1['user']['id'],_0x18a2b1[_0x2553('0x5a')][_0x2553('0x35')],_0x18a2b1[_0x2553('0x5a')][_0x2553('0x61')],_0x3b8789['interaction']['id'],_0x18a2b1['body']?JSON[_0x2553('0x22')](_0x18a2b1['body']):_0x2553('0x62'));return respondWithRpcPromise(_0x2553('0x75'),'rejectMessage',_0x3b8789);}return null;})[_0x2553('0x31')](function(_0x59b6f2){var _0x490438='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x59b6f2[_0x2553('0x24')][_0x2553('0x76')];return db[_0x2553('0x63')][_0x2553('0x3d')](_0x490438,{'type':db['Sequelize'][_0x2553('0x65')][_0x2553('0x66')],'raw':!![]})[_0x2553('0x31')](function(_0x456665){return _0x456665;});})[_0x2553('0x31')](function(_0x522db6){if(_0x522db6){_0x3b8789[_0x2553('0x24')][_0x2553('0x67')]=_0x522db6[0x0];if(!_0x18a2b1[_0x2553('0x51')][_0x2553('0x59')])return;return db[_0x2553('0x68')][_0x2553('0x4f')]({'where':{'id':_0x18a2b1[_0x2553('0x51')][_0x2553('0x59')],'role':_0x2553('0x5b')},'attributes':['id',_0x2553('0x35'),_0x2553('0x77'),_0x2553('0x69'),_0x2553('0x6a')],'raw':!![]});}return null;})[_0x2553('0x31')](function(_0x111e41){if(!_0x111e41)return null;_0x3b8789[_0x2553('0x24')][_0x2553('0x5b')]=_0x111e41;return _0x3b8789;})['then'](function(_0x48fcab){if(_0x48fcab){_0x48fcab['message'][_0x2553('0x6c')]=util[_0x2553('0x57')](_0x2553('0x6d'),_0x18a2b1['user']['name']);_0x48fcab['message']['channel']=_0x3b8789[_0x2553('0x6e')];_0x48fcab[_0x2553('0x24')][_0x2553('0x6f')]=_0x3b8789[_0x2553('0x6e')];_0x48fcab[_0x2553('0x24')][_0x2553('0x70')]='reject';respondWithRpcPromise('EventManager',_0x2553('0x72'),{'event':_0x2553('0x78'),'message':_0x48fcab[_0x2553('0x24')]},client9002);return _0x3b8789;}return null;})[_0x2553('0x31')](respondWithResult(_0x3bf57,null))[_0x2553('0x25')](handleError(_0x3bf57,null));};exports[_0x2553('0x26')]=function(_0x5cac34,_0x52f0ec,_0x4249c0){if(_0x5cac34['body']['id']){delete _0x5cac34[_0x2553('0x51')]['id'];}var _0x81c4ea;return db['SmsMessage'][_0x2553('0x4f')]({'where':{'id':_0x5cac34[_0x2553('0x4b')]['id']}})['then'](handleEntityNotFound(_0x52f0ec,null))['then'](function(_0x2eeea8){if(_0x2eeea8){_0x81c4ea=_0x2eeea8;return db[_0x2553('0x79')][_0x2553('0x4f')]({'where':{'id':_0x2eeea8['SmsAccountId']}});}})['then'](handleEntityNotFound(_0x52f0ec,null))[_0x2553('0x31')](function(_0x1b5d9c){if(_0x1b5d9c){logger[_0x2553('0x7a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2553('0x26'),_0x2553('0x7b'),_0x1b5d9c['type'],util[_0x2553('0x7c')](_0x5cac34[_0x2553('0x51')],{'showHidden':![],'depth':null}));switch(_0x1b5d9c[_0x2553('0x3a')]){case _0x2553('0x7d'):if(_0x5cac34[_0x2553('0x51')]['MessageSid']&&_0x5cac34[_0x2553('0x51')][_0x2553('0x7e')]===_0x81c4ea['messageId']){return _0x81c4ea[_0x2553('0x30')]({'read':!![]});}else{logger[_0x2553('0x23')](_0x2553('0x7f'),_0x2553('0x26'),_0x2553('0x7d'),util[_0x2553('0x7c')](_0x5cac34[_0x2553('0x51')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x5cac34[_0x2553('0x51')]['MessageUUID']&&_0x5cac34['body'][_0x2553('0x80')]===_0x81c4ea[_0x2553('0x81')]&&_[_0x2553('0x82')]([_0x2553('0x83'),_0x2553('0x84')],_0x5cac34['body'][_0x2553('0x85')])>=0x0){return _0x81c4ea[_0x2553('0x30')]({'read':!![]});}else{logger[_0x2553('0x23')](_0x2553('0x7f'),_0x2553('0x26'),'plivio',util[_0x2553('0x7c')](_0x5cac34[_0x2553('0x51')],{'showHidden':![],'depth':null}));}break;case _0x2553('0x86'):var _0x2f41fe=_0x5cac34[_0x2553('0x51')]['results'][0x0];if(_0x2f41fe[_0x2553('0x26')][_0x2553('0x87')]===_0x2553('0x88')){return _0x81c4ea[_0x2553('0x30')]({'read':!![]});}else{logger[_0x2553('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','infobip',util[_0x2553('0x7c')](_0x5cac34[_0x2553('0x51')],{'showHidden':![],'depth':null}));}break;}return _0x81c4ea;}})[_0x2553('0x31')](respondWithResult(_0x52f0ec,null))['catch'](handleError(_0x52f0ec,null));}; \ No newline at end of file +var _0xf8fa=['EventManager','acceptmessage','sms-interactions','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','interface','SIP/%s','SmsAccountId','received\x20delivery\x20report\x20from','inspect','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','plivo','MessageUUID','messageId','indexOf','delivered','Status','plivio','infobip','results','groupName','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsMessage.socket','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','sendStatus','name','send','SmsMessage','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','where','merge','type','filter','options','includeAll','include','params','rawAttributes','create','body','find','destroy','describe','accept','sms','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','ContactId','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','format','channel','motionChannel','event'];(function(_0xe7b201,_0x4234cb){var _0xc3d566=function(_0x5516ad){while(--_0x5516ad){_0xe7b201['push'](_0xe7b201['shift']());}};_0xc3d566(++_0x4234cb);}(_0xf8fa,0x13e));var _0xaf8f=function(_0x4fcd28,_0x11d6a2){_0x4fcd28=_0x4fcd28-0x0;var _0x27a969=_0xf8fa[_0x4fcd28];return _0x27a969;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaf8f('0x0'));var zipdir=require(_0xaf8f('0x1'));var jsonpatch=require(_0xaf8f('0x2'));var rp=require(_0xaf8f('0x3'));var moment=require('moment');var BPromise=require(_0xaf8f('0x4'));var Mustache=require('mustache');var util=require(_0xaf8f('0x5'));var path=require(_0xaf8f('0x6'));var sox=require(_0xaf8f('0x7'));var csv=require('to-csv');var ejs=require(_0xaf8f('0x8'));var fs=require('fs');var fs_extra=require(_0xaf8f('0x9'));var _=require(_0xaf8f('0xa'));var squel=require(_0xaf8f('0xb'));var crypto=require(_0xaf8f('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaf8f('0xd'));var Papa=require(_0xaf8f('0xe'));var Redis=require(_0xaf8f('0xf'));var authService=require(_0xaf8f('0x10'));var qs=require(_0xaf8f('0x11'));var as=require(_0xaf8f('0x12'));var hardwareService=require(_0xaf8f('0x13'));var logger=require(_0xaf8f('0x14'))('api');var utils=require(_0xaf8f('0x15'));var config=require(_0xaf8f('0x16'));var licenseUtil=require(_0xaf8f('0x17'));var db=require(_0xaf8f('0x18'))['db'];config[_0xaf8f('0x19')]=_[_0xaf8f('0x1a')](config[_0xaf8f('0x19')],{'host':_0xaf8f('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xaf8f('0x1c'))[_0xaf8f('0x1d')](socket);var jayson=require(_0xaf8f('0x1e'));var client=jayson[_0xaf8f('0x1f')][_0xaf8f('0x20')]({'port':0x232c});var client9002=jayson[_0xaf8f('0x1f')][_0xaf8f('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x6d09b5,_0x115a07,_0x3b6c97,_0x1eca30){return new BPromise(function(_0x5dcd39,_0x1fefe9){var _0x5c9ca9=_0x1eca30||client;return _0x5c9ca9[_0xaf8f('0x21')](_0x6d09b5,_0x3b6c97)[_0xaf8f('0x22')](function(_0x575b0f){logger[_0xaf8f('0x23')](_0xaf8f('0x24'),_0x115a07,_0xaf8f('0x25'));logger[_0xaf8f('0x26')](_0xaf8f('0x27'),_0x115a07,'request\x20sent',JSON[_0xaf8f('0x28')](_0x575b0f));if(_0x575b0f[_0xaf8f('0x29')]){if(_0x575b0f[_0xaf8f('0x29')]['code']===0x1f4){logger[_0xaf8f('0x29')](_0xaf8f('0x24'),_0x115a07,_0x575b0f[_0xaf8f('0x29')][_0xaf8f('0x2a')]);return _0x1fefe9(_0x575b0f[_0xaf8f('0x29')][_0xaf8f('0x2a')]);}logger[_0xaf8f('0x29')]('SmsMessage,\x20%s,\x20%s',_0x115a07,_0x575b0f[_0xaf8f('0x29')][_0xaf8f('0x2a')]);return _0x5dcd39(_0x575b0f[_0xaf8f('0x29')][_0xaf8f('0x2a')]);}else{logger[_0xaf8f('0x23')]('SmsMessage,\x20%s,\x20%s',_0x115a07,_0xaf8f('0x25'));_0x5dcd39(_0x575b0f[_0xaf8f('0x2b')]['message']);}})[_0xaf8f('0x2c')](function(_0x503b4c){logger['error'](_0xaf8f('0x24'),_0x115a07,_0x503b4c);_0x1fefe9(_0x503b4c);});});}function respondWithStatusCode(_0x5b47b3,_0x219b42){_0x219b42=_0x219b42||0xcc;return function(_0x1213b3){if(_0x1213b3){return _0x5b47b3['sendStatus'](_0x219b42);}return _0x5b47b3[_0xaf8f('0x2d')](_0x219b42)[_0xaf8f('0x2e')]();};}function respondWithResult(_0x5a8512,_0x34929b){_0x34929b=_0x34929b||0xc8;return function(_0x20be3e){if(_0x20be3e){return _0x5a8512['status'](_0x34929b)[_0xaf8f('0x2f')](_0x20be3e);}};}function respondWithFilteredResult(_0x18dc27,_0x18dc8b){return function(_0x847716){if(_0x847716){var _0x5ba3a7=typeof _0x18dc8b[_0xaf8f('0x30')]===_0xaf8f('0x31')&&typeof _0x18dc8b[_0xaf8f('0x32')]==='undefined';var _0x4d03f6=_0x847716[_0xaf8f('0x33')];var _0x2ffe83=_0x5ba3a7?0x0:_0x18dc8b[_0xaf8f('0x30')];var _0x35c8f9=_0x5ba3a7?_0x847716['count']:_0x18dc8b[_0xaf8f('0x30')]+_0x18dc8b[_0xaf8f('0x32')];var _0x2510cf;if(_0x35c8f9>=_0x4d03f6){_0x35c8f9=_0x4d03f6;_0x2510cf=0xc8;}else{_0x2510cf=0xce;}_0x18dc27[_0xaf8f('0x2d')](_0x2510cf);return _0x18dc27[_0xaf8f('0x34')](_0xaf8f('0x35'),_0x2ffe83+'-'+_0x35c8f9+'/'+_0x4d03f6)[_0xaf8f('0x2f')](_0x847716);}return null;};}function patchUpdates(_0x8093e3){return function(_0x336323){try{jsonpatch[_0xaf8f('0x36')](_0x336323,_0x8093e3,!![]);}catch(_0x59a914){return BPromise[_0xaf8f('0x37')](_0x59a914);}return _0x336323[_0xaf8f('0x38')]();};}function saveUpdates(_0x1f47e8,_0x5d44c2){return function(_0x2964c0){if(_0x2964c0){return _0x2964c0[_0xaf8f('0x39')](_0x1f47e8)['then'](function(_0xbad50){return _0xbad50;});}return null;};}function removeEntity(_0xd8fb7c,_0x35eb36){return function(_0x1fc777){if(_0x1fc777){return _0x1fc777['destroy']()[_0xaf8f('0x22')](function(){_0xd8fb7c['status'](0xcc)[_0xaf8f('0x2e')]();});}};}function handleEntityNotFound(_0x5a9e59,_0x5ed362){return function(_0x1bb609){if(!_0x1bb609){_0x5a9e59[_0xaf8f('0x3a')](0x194);}return _0x1bb609;};}function handleError(_0x4f0fd0,_0x4eebb3){_0x4eebb3=_0x4eebb3||0x1f4;return function(_0x2e96d1){logger['error'](_0x2e96d1['stack']);if(_0x2e96d1[_0xaf8f('0x3b')]){delete _0x2e96d1['name'];}_0x4f0fd0[_0xaf8f('0x2d')](_0x4eebb3)[_0xaf8f('0x3c')](_0x2e96d1);};}exports['index']=function(_0x397da6,_0x502e95){var _0x4c4861={},_0x2777cd={},_0xcfea56={'count':0x0,'rows':[]};var _0x34300c=_['map'](db[_0xaf8f('0x3d')]['rawAttributes'],function(_0x3bd443){return{'name':_0x3bd443['fieldName'],'type':_0x3bd443['type'][_0xaf8f('0x3e')]};});_0x2777cd[_0xaf8f('0x3f')]=_['map'](_0x34300c,_0xaf8f('0x3b'));_0x2777cd[_0xaf8f('0x40')]=_[_0xaf8f('0x41')](_0x397da6[_0xaf8f('0x40')]);_0x2777cd[_0xaf8f('0x42')]=_[_0xaf8f('0x43')](_0x2777cd[_0xaf8f('0x3f')],_0x2777cd[_0xaf8f('0x40')]);_0x4c4861[_0xaf8f('0x44')]=_[_0xaf8f('0x43')](_0x2777cd[_0xaf8f('0x3f')],qs[_0xaf8f('0x45')](_0x397da6[_0xaf8f('0x40')]['fields']));_0x4c4861[_0xaf8f('0x44')]=_0x4c4861['attributes'][_0xaf8f('0x46')]?_0x4c4861[_0xaf8f('0x44')]:_0x2777cd[_0xaf8f('0x3f')];if(!_0x397da6[_0xaf8f('0x40')][_0xaf8f('0x47')](_0xaf8f('0x48'))){_0x4c4861[_0xaf8f('0x32')]=qs[_0xaf8f('0x32')](_0x397da6[_0xaf8f('0x40')][_0xaf8f('0x32')]);_0x4c4861[_0xaf8f('0x30')]=qs[_0xaf8f('0x30')](_0x397da6[_0xaf8f('0x40')][_0xaf8f('0x30')]);}_0x4c4861[_0xaf8f('0x49')]=qs['sort'](_0x397da6['query']['sort']);_0x4c4861['where']=qs['filters'](_[_0xaf8f('0x4a')](_0x397da6[_0xaf8f('0x40')],_0x2777cd['filters']),_0x34300c);if(_0x397da6[_0xaf8f('0x40')]['filter']){_0x4c4861[_0xaf8f('0x4b')]=_[_0xaf8f('0x4c')](_0x4c4861[_0xaf8f('0x4b')],{'$or':_['map'](_0x34300c,function(_0x3d0d4f){if(_0x3d0d4f[_0xaf8f('0x4d')]!=='VIRTUAL'){var _0x29cb1f={};_0x29cb1f[_0x3d0d4f[_0xaf8f('0x3b')]]={'$like':'%'+_0x397da6[_0xaf8f('0x40')][_0xaf8f('0x4e')]+'%'};return _0x29cb1f;}})});}_0x4c4861=_[_0xaf8f('0x4c')]({},_0x4c4861,_0x397da6[_0xaf8f('0x4f')]);var _0x2384d9={'where':_0x4c4861[_0xaf8f('0x4b')]};return db['SmsMessage'][_0xaf8f('0x33')](_0x2384d9)[_0xaf8f('0x22')](function(_0x4236a0){_0xcfea56[_0xaf8f('0x33')]=_0x4236a0;if(_0x397da6['query'][_0xaf8f('0x50')]){_0x4c4861[_0xaf8f('0x51')]=[{'all':!![]}];}return db[_0xaf8f('0x3d')]['findAll'](_0x4c4861);})[_0xaf8f('0x22')](function(_0x6b119){_0xcfea56['rows']=_0x6b119;return _0xcfea56;})[_0xaf8f('0x22')](respondWithFilteredResult(_0x502e95,_0x4c4861))['catch'](handleError(_0x502e95,null));};exports['show']=function(_0x59820a,_0xcaab58){var _0x2446b8={'raw':!![],'where':{'id':_0x59820a[_0xaf8f('0x52')]['id']}},_0x152ec1={};_0x152ec1[_0xaf8f('0x3f')]=_[_0xaf8f('0x41')](db['SmsMessage'][_0xaf8f('0x53')]);_0x152ec1[_0xaf8f('0x40')]=_[_0xaf8f('0x41')](_0x59820a[_0xaf8f('0x40')]);_0x152ec1['filters']=_['intersection'](_0x152ec1[_0xaf8f('0x3f')],_0x152ec1[_0xaf8f('0x40')]);_0x2446b8['attributes']=_[_0xaf8f('0x43')](_0x152ec1['model'],qs[_0xaf8f('0x45')](_0x59820a[_0xaf8f('0x40')][_0xaf8f('0x45')]));_0x2446b8[_0xaf8f('0x44')]=_0x2446b8[_0xaf8f('0x44')]['length']?_0x2446b8[_0xaf8f('0x44')]:_0x152ec1['model'];if(_0x59820a[_0xaf8f('0x40')]['includeAll']){_0x2446b8[_0xaf8f('0x51')]=[{'all':!![]}];}_0x2446b8=_[_0xaf8f('0x4c')]({},_0x2446b8,_0x59820a[_0xaf8f('0x4f')]);return db[_0xaf8f('0x3d')]['find'](_0x2446b8)[_0xaf8f('0x22')](handleEntityNotFound(_0xcaab58,null))[_0xaf8f('0x22')](respondWithResult(_0xcaab58,null))[_0xaf8f('0x2c')](handleError(_0xcaab58,null));};exports[_0xaf8f('0x54')]=function(_0x9591c3,_0x127d58){return db[_0xaf8f('0x3d')]['create'](_0x9591c3[_0xaf8f('0x55')],{})[_0xaf8f('0x22')](respondWithResult(_0x127d58,0xc9))['catch'](handleError(_0x127d58,null));};exports[_0xaf8f('0x39')]=function(_0x1cca8e,_0x7125ce){if(_0x1cca8e['body']['id']){delete _0x1cca8e['body']['id'];}return db[_0xaf8f('0x3d')][_0xaf8f('0x56')]({'where':{'id':_0x1cca8e[_0xaf8f('0x52')]['id']}})[_0xaf8f('0x22')](handleEntityNotFound(_0x7125ce,null))[_0xaf8f('0x22')](saveUpdates(_0x1cca8e['body'],null))['then'](respondWithResult(_0x7125ce,null))[_0xaf8f('0x2c')](handleError(_0x7125ce,null));};exports[_0xaf8f('0x57')]=function(_0x5a67b9,_0x2c4d6c){return db['SmsMessage']['find']({'where':{'id':_0x5a67b9[_0xaf8f('0x52')]['id']}})[_0xaf8f('0x22')](handleEntityNotFound(_0x2c4d6c,null))[_0xaf8f('0x22')](removeEntity(_0x2c4d6c,null))['catch'](handleError(_0x2c4d6c,null));};exports[_0xaf8f('0x58')]=function(_0x49098a,_0xaf6cca){return db['SmsMessage']['describe']()[_0xaf8f('0x22')](respondWithResult(_0xaf6cca,null))[_0xaf8f('0x2c')](handleError(_0xaf6cca,null));};var interaction_log=require(_0xaf8f('0x14'))('sms-interactions');exports[_0xaf8f('0x59')]=function(_0x1b46a1,_0x151f74,_0x58c4bf){var _0x514cb3={'agent':{},'channel':_0xaf8f('0x5a')};if(_0x1b46a1[_0xaf8f('0x55')]['id']){delete _0x1b46a1['body']['id'];}_0x1b46a1[_0xaf8f('0x55')][_0xaf8f('0x5b')]=!![];_0x1b46a1[_0xaf8f('0x55')][_0xaf8f('0x5c')]=moment()['format'](_0xaf8f('0x5d'));_0x1b46a1[_0xaf8f('0x55')][_0xaf8f('0x5e')]=_0x1b46a1['body'][_0xaf8f('0x5e')]||_0x1b46a1[_0xaf8f('0x5f')]['id'];_0x514cb3[_0xaf8f('0x60')]['id']=_0x1b46a1[_0xaf8f('0x55')][_0xaf8f('0x5e')];return db[_0xaf8f('0x3d')][_0xaf8f('0x56')]({'where':{'id':_0x1b46a1[_0xaf8f('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x151f74,null))[_0xaf8f('0x22')](saveUpdates(_0x1b46a1[_0xaf8f('0x55')],null))[_0xaf8f('0x22')](function(_0x48c30a){if(_0x48c30a){_0x514cb3['message']=_0x48c30a['get']({'plain':!![]});return db[_0xaf8f('0x61')][_0xaf8f('0x56')]({'where':{'id':_0x48c30a[_0xaf8f('0x62')]}});}return null;})[_0xaf8f('0x22')](handleEntityNotFound(_0x151f74,null))[_0xaf8f('0x22')](function(_0x28fa49){if(_0x28fa49){return _0x28fa49[_0xaf8f('0x39')]({'UserId':_0x1b46a1['body'][_0xaf8f('0x5e')],'read1stAt':_[_0xaf8f('0x63')](_0x28fa49[_0xaf8f('0x64')])?moment()['format'](_0xaf8f('0x5d')):undefined});}return null;})[_0xaf8f('0x22')](function(_0x2b8d72){if(_0x2b8d72){_0x514cb3[_0xaf8f('0x65')]=_0x2b8d72[_0xaf8f('0x66')]({'plain':!![]});interaction_log[_0xaf8f('0x23')](_0xaf8f('0x67'),_0x1b46a1[_0xaf8f('0x5f')]['id'],_0x1b46a1[_0xaf8f('0x5f')]['name'],_0x1b46a1[_0xaf8f('0x5f')]['role'],_0x514cb3['interaction']['id'],_0x1b46a1[_0xaf8f('0x55')]?JSON[_0xaf8f('0x28')](_0x1b46a1[_0xaf8f('0x55')]):_0xaf8f('0x68'));return respondWithRpcPromise(_0xaf8f('0x69'),_0xaf8f('0x6a'),_0x514cb3);}return null;})[_0xaf8f('0x22')](function(_0x5e740c){var _0xf83a62='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5e740c[_0xaf8f('0x2a')][_0xaf8f('0x6b')];return db['sequelize'][_0xaf8f('0x40')](_0xf83a62,{'type':db['Sequelize'][_0xaf8f('0x6c')][_0xaf8f('0x6d')],'raw':!![]})[_0xaf8f('0x22')](function(_0x2d09ac){return _0x2d09ac;});})[_0xaf8f('0x22')](function(_0x4a057c){if(_0x4a057c){_0x514cb3['message'][_0xaf8f('0x6e')]=_0x4a057c[0x0];if(!_0x1b46a1[_0xaf8f('0x55')][_0xaf8f('0x5e')])return;return db[_0xaf8f('0x6f')][_0xaf8f('0x56')]({'where':{'id':_0x1b46a1['body'][_0xaf8f('0x5e')],'role':'agent'},'attributes':['id',_0xaf8f('0x3b'),_0xaf8f('0x70'),_0xaf8f('0x71'),_0xaf8f('0x72')],'raw':!![]});}return null;})[_0xaf8f('0x22')](function(_0x2b1c47){if(!_0x2b1c47)return null;_0x514cb3[_0xaf8f('0x2a')][_0xaf8f('0x60')]=_0x2b1c47;return _0x514cb3;})[_0xaf8f('0x22')](function(_0x5c7f04){if(_0x5c7f04){if(_0x1b46a1['body'][_0xaf8f('0x73')]){_0x514cb3[_0xaf8f('0x2a')]['interface']=util[_0xaf8f('0x74')]('SIP/%s',_0x1b46a1[_0xaf8f('0x5f')]['name']);_0x514cb3[_0xaf8f('0x2a')][_0xaf8f('0x75')]=_0x514cb3['channel'];_0x514cb3[_0xaf8f('0x2a')][_0xaf8f('0x76')]=_0x514cb3[_0xaf8f('0x75')];_0x514cb3[_0xaf8f('0x2a')][_0xaf8f('0x77')]='accept';return respondWithRpcPromise(_0xaf8f('0x78'),'EventManager',{'event':_0xaf8f('0x79'),'message':_0x514cb3[_0xaf8f('0x2a')]},client9002)[_0xaf8f('0x22')](function(){return _0x514cb3;});}return _0x514cb3;}return null;})[_0xaf8f('0x22')](respondWithResult(_0x151f74,null))[_0xaf8f('0x2c')](handleError(_0x151f74,null));};var interaction_log=require(_0xaf8f('0x14'))(_0xaf8f('0x7a'));exports['reject']=function(_0x4e9640,_0x3a3e79,_0x518b34){var _0xe447bc={'agent':{},'channel':_0xaf8f('0x5a')};if(_0x4e9640[_0xaf8f('0x55')]['id']){delete _0x4e9640['body']['id'];}_0x4e9640['body']['UserId']=_0x4e9640[_0xaf8f('0x55')][_0xaf8f('0x5e')]||_0x4e9640[_0xaf8f('0x5f')]['id'];_0xe447bc[_0xaf8f('0x60')]['id']=_0x4e9640[_0xaf8f('0x55')][_0xaf8f('0x5e')];return db[_0xaf8f('0x3d')][_0xaf8f('0x56')]({'where':{'id':_0x4e9640['params']['id'],'UserId':null}})[_0xaf8f('0x22')](handleEntityNotFound(_0x3a3e79,null))[_0xaf8f('0x22')](function(_0xc6929f){if(_0xc6929f){_0xe447bc[_0xaf8f('0x2a')]=_0xc6929f[_0xaf8f('0x66')]({'plain':!![]});return db[_0xaf8f('0x61')][_0xaf8f('0x56')]({'where':{'id':_0xc6929f[_0xaf8f('0x62')]}});}return null;})[_0xaf8f('0x22')](handleEntityNotFound(_0x3a3e79,null))[_0xaf8f('0x22')](function(_0x2edf6f){if(_0x2edf6f){_0xe447bc['interaction']=_0x2edf6f[_0xaf8f('0x66')]({'plain':!![]});interaction_log[_0xaf8f('0x23')](_0xaf8f('0x7b'),_0x4e9640['user']['id'],_0x4e9640['user']['name'],_0x4e9640[_0xaf8f('0x5f')][_0xaf8f('0x7c')],_0xe447bc[_0xaf8f('0x65')]['id'],_0x4e9640['body']?JSON[_0xaf8f('0x28')](_0x4e9640[_0xaf8f('0x55')]):_0xaf8f('0x68'));return respondWithRpcPromise('RejectMessage',_0xaf8f('0x7d'),_0xe447bc);}return null;})[_0xaf8f('0x22')](function(_0x42e499){var _0x3b6221=_0xaf8f('0x7e')+_0x42e499[_0xaf8f('0x2a')]['ContactId'];return db['sequelize'][_0xaf8f('0x40')](_0x3b6221,{'type':db[_0xaf8f('0x7f')][_0xaf8f('0x6c')][_0xaf8f('0x6d')],'raw':!![]})[_0xaf8f('0x22')](function(_0x3cf761){return _0x3cf761;});})[_0xaf8f('0x22')](function(_0xc574be){if(_0xc574be){_0xe447bc[_0xaf8f('0x2a')][_0xaf8f('0x6e')]=_0xc574be[0x0];if(!_0x4e9640['body'][_0xaf8f('0x5e')])return;return db[_0xaf8f('0x6f')]['find']({'where':{'id':_0x4e9640[_0xaf8f('0x55')][_0xaf8f('0x5e')],'role':_0xaf8f('0x60')},'attributes':['id','name','fullname',_0xaf8f('0x71'),_0xaf8f('0x72')],'raw':!![]});}return null;})['then'](function(_0x445bf6){if(!_0x445bf6)return null;_0xe447bc['message']['agent']=_0x445bf6;return _0xe447bc;})[_0xaf8f('0x22')](function(_0x47de34){if(_0x47de34){_0x47de34[_0xaf8f('0x2a')][_0xaf8f('0x80')]=util[_0xaf8f('0x74')](_0xaf8f('0x81'),_0x4e9640[_0xaf8f('0x5f')][_0xaf8f('0x3b')]);_0x47de34['message'][_0xaf8f('0x75')]=_0xe447bc[_0xaf8f('0x75')];_0x47de34[_0xaf8f('0x2a')][_0xaf8f('0x76')]=_0xe447bc[_0xaf8f('0x75')];_0x47de34[_0xaf8f('0x2a')][_0xaf8f('0x77')]=_0xaf8f('0x37');respondWithRpcPromise(_0xaf8f('0x78'),_0xaf8f('0x78'),{'event':'rejectmessage','message':_0x47de34[_0xaf8f('0x2a')]},client9002);return _0xe447bc;}return null;})['then'](respondWithResult(_0x3a3e79,null))[_0xaf8f('0x2c')](handleError(_0x3a3e79,null));};exports[_0xaf8f('0x2d')]=function(_0x12cf19,_0x352b8a,_0x154568){if(_0x12cf19[_0xaf8f('0x55')]['id']){delete _0x12cf19[_0xaf8f('0x55')]['id'];}var _0x4db305;return db[_0xaf8f('0x3d')]['find']({'where':{'id':_0x12cf19[_0xaf8f('0x52')]['id']}})[_0xaf8f('0x22')](handleEntityNotFound(_0x352b8a,null))[_0xaf8f('0x22')](function(_0x2b2a88){if(_0x2b2a88){_0x4db305=_0x2b2a88;return db['SmsAccount'][_0xaf8f('0x56')]({'where':{'id':_0x2b2a88[_0xaf8f('0x82')]}});}})[_0xaf8f('0x22')](handleEntityNotFound(_0x352b8a,null))['then'](function(_0x4c2235){if(_0x4c2235){logger[_0xaf8f('0x26')](_0xaf8f('0x27'),_0xaf8f('0x2d'),_0xaf8f('0x83'),_0x4c2235[_0xaf8f('0x4d')],util[_0xaf8f('0x84')](_0x12cf19['body'],{'showHidden':![],'depth':null}));switch(_0x4c2235[_0xaf8f('0x4d')]){case'twilio':if(_0x12cf19['body'][_0xaf8f('0x85')]&&_0x12cf19[_0xaf8f('0x55')][_0xaf8f('0x85')]===_0x4db305['messageId']){return _0x4db305[_0xaf8f('0x39')]({'read':!![]});}else{logger[_0xaf8f('0x29')](_0xaf8f('0x86'),_0xaf8f('0x2d'),_0xaf8f('0x87'),util[_0xaf8f('0x84')](_0x12cf19[_0xaf8f('0x55')],{'showHidden':![],'depth':null}));}break;case _0xaf8f('0x88'):if(_0x12cf19[_0xaf8f('0x55')][_0xaf8f('0x89')]&&_0x12cf19[_0xaf8f('0x55')][_0xaf8f('0x89')]===_0x4db305[_0xaf8f('0x8a')]&&_[_0xaf8f('0x8b')](['sent',_0xaf8f('0x8c')],_0x12cf19[_0xaf8f('0x55')][_0xaf8f('0x8d')])>=0x0){return _0x4db305[_0xaf8f('0x39')]({'read':!![]});}else{logger[_0xaf8f('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xaf8f('0x2d'),_0xaf8f('0x8e'),util[_0xaf8f('0x84')](_0x12cf19[_0xaf8f('0x55')],{'showHidden':![],'depth':null}));}break;case _0xaf8f('0x8f'):var _0x2d6fd3=_0x12cf19[_0xaf8f('0x55')][_0xaf8f('0x90')][0x0];if(_0x2d6fd3[_0xaf8f('0x2d')][_0xaf8f('0x91')]==='DELIVERED'){return _0x4db305[_0xaf8f('0x39')]({'read':!![]});}else{logger[_0xaf8f('0x29')](_0xaf8f('0x86'),_0xaf8f('0x2d'),'infobip',util[_0xaf8f('0x84')](_0x12cf19[_0xaf8f('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x4db305;}})[_0xaf8f('0x22')](respondWithResult(_0x352b8a,null))[_0xaf8f('0x2c')](handleError(_0x352b8a,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index bc527c6..3e04f2a 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 _0xc192=['SmsMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0xbe0439,_0x5399f9){var _0x1c91cf=function(_0xc2837b){while(--_0xc2837b){_0xbe0439['push'](_0xbe0439['shift']());}};_0x1c91cf(++_0x5399f9);}(_0xc192,0x11e));var _0x2c19=function(_0x689bc7,_0x2c045c){_0x689bc7=_0x689bc7-0x0;var _0xeb663d=_0xc192[_0x689bc7];return _0xeb663d;};'use strict';var EventEmitter=require(_0x2c19('0x0'));var SmsMessage=require(_0x2c19('0x1'))['db'][_0x2c19('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x2c19('0x3')](0x0);var events={'afterCreate':_0x2c19('0x4'),'afterUpdate':_0x2c19('0x5'),'afterDestroy':_0x2c19('0x6')};function emitEvent(_0x512565){return function(_0x13ca52,_0x20b6dd,_0x42c662){SmsMessageEvents[_0x2c19('0x7')](_0x512565+':'+_0x13ca52['id'],_0x13ca52);SmsMessageEvents[_0x2c19('0x7')](_0x512565,_0x13ca52);_0x42c662(null);};}for(var e in events){if(events[_0x2c19('0x8')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0xd475=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save'];(function(_0x2f15c1,_0x5b7c3e){var _0x2a8c79=function(_0x1ca9b9){while(--_0x1ca9b9){_0x2f15c1['push'](_0x2f15c1['shift']());}};_0x2a8c79(++_0x5b7c3e);}(_0xd475,0xa5));var _0x5d47=function(_0x36e940,_0x43ff7f){_0x36e940=_0x36e940-0x0;var _0x24946e=_0xd475[_0x36e940];return _0x24946e;};'use strict';var EventEmitter=require(_0x5d47('0x0'));var SmsMessage=require(_0x5d47('0x1'))['db'][_0x5d47('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x5d47('0x3')](0x0);var events={'afterCreate':_0x5d47('0x4'),'afterUpdate':_0x5d47('0x5'),'afterDestroy':_0x5d47('0x6')};function emitEvent(_0x113f83){return function(_0x261716,_0x53d84d,_0x218d3f){SmsMessageEvents[_0x5d47('0x7')](_0x113f83+':'+_0x261716['id'],_0x261716);SmsMessageEvents[_0x5d47('0x7')](_0x113f83,_0x261716);_0x218d3f(null);};}for(var e in events){if(events[_0x5d47('0x8')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0x5d47('0x9')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 9b7942f..595ae54 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 _0xc533=['apiKey','login','text','timestamp','keys','sort','length','createHash','md5','digest','hex','signature=','/external/get/send.php?','id_sms','csc','Missing\x20parameters:\x20apiKey','clickatell','UTF-8','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','intelepeer','Bearer\x20','message','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsMessage.attributes','exports','SmsMessage','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','out','UserId','findOne','SmsInteractionId','then','update','toLowerCase','catch','error','secret','SmsAccount','find','SmsAccountId','type','authToken','phone','accountSid','messages','create','/status?token=','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','twilio','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','GET','split','sms','POST','total_sent','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','connectel','Missing\x20parameters:\x20authToken','clicksend','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','head','clickSend','plivo','authId','remote','/api/sms/messages/','token','https://api.plivo.com/v1/Account/%s/Message/','infobip','baseUrl','/sms/2/text/advanced','application/json','Missing\x20parameters:\x20base_url','crypto'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0xc533,0x9a));var _0x3c53=function(_0x363ef8,_0x4ecb1a){_0x363ef8=_0x363ef8-0x0;var _0x148822=_0xc533[_0x363ef8];return _0x148822;};'use strict';var _=require(_0x3c53('0x0'));var util=require(_0x3c53('0x1'));var logger=require(_0x3c53('0x2'))(_0x3c53('0x3'));var moment=require(_0x3c53('0x4'));var BPromise=require(_0x3c53('0x5'));var rp=require(_0x3c53('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3c53('0x7'));var config=require(_0x3c53('0x8'));var attributes=require(_0x3c53('0x9'));module[_0x3c53('0xa')]=function(_0x2dcc60,_0x1dba46){return _0x2dcc60['define'](_0x3c53('0xb'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x3c53('0xc'),'fields':['messageId']},{'name':_0x3c53('0xd'),'fields':[_0x3c53('0xe')],'type':_0x3c53('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x250683,_0x28b163,_0x16e76d){var _0x4c348a=_0x2dcc60[_0x3c53('0x10')];var _0x29cb8a=_0x250683[_0x3c53('0x11')]({'plain':!![]});if(_0x29cb8a[_0x3c53('0x12')]['toLowerCase']()==='in'||_0x29cb8a[_0x3c53('0x12')]['toLowerCase']()===_0x3c53('0x13')&&!_0x29cb8a['secret']&&!_['isNil'](_0x29cb8a[_0x3c53('0x14')])&&!_['isNil'](_0x29cb8a['SmsInteractionId'])){_0x4c348a['SmsInteraction'][_0x3c53('0x15')]({'where':{'id':_0x29cb8a[_0x3c53('0x16')]}})[_0x3c53('0x17')](function(_0x15806a){if(_0x15806a){_0x15806a[_0x3c53('0x18')]({'lastMsgAt':_0x29cb8a['createdAt'],'lastMsgDirection':_0x29cb8a['direction'][_0x3c53('0x19')]()});}})[_0x3c53('0x1a')](function(_0x4de053){console[_0x3c53('0x1b')](_0x4de053);});}if(_0x29cb8a[_0x3c53('0x12')]===_0x3c53('0x13')&&!_0x29cb8a[_0x3c53('0x1c')]){var _0x466022;_0x4c348a[_0x3c53('0x1d')][_0x3c53('0x1e')]({'where':{'id':_0x29cb8a[_0x3c53('0x1f')]},'raw':!![]})['then'](function(_0x4c1199){_0x466022=_0x4c1199;if(_0x466022&&_0x466022['type']){switch(_0x466022[_0x3c53('0x20')]){case'twilio':var _0x173067=require('twilio');if(_0x466022['accountSid']&&_0x466022[_0x3c53('0x21')]&&_0x466022[_0x3c53('0x22')]){var _0x34b33c=new _0x173067(_0x466022[_0x3c53('0x23')],_0x466022[_0x3c53('0x21')]);_0x34b33c[_0x3c53('0x24')][_0x3c53('0x25')]({'body':_0x29cb8a[_0x3c53('0xe')],'to':_0x29cb8a[_0x3c53('0x22')],'from':_0x466022[_0x3c53('0x22')],'statusCallback':_0x466022['remote']+'/api/sms/messages/'+_0x29cb8a['id']+_0x3c53('0x26')+_0x466022['token']})[_0x3c53('0x17')](function(_0x3b9321){if(_0x3b9321[_0x3c53('0x27')]){return _0x250683[_0x3c53('0x18')]({'messageId':_0x3b9321[_0x3c53('0x27')]});}})[_0x3c53('0x1a')](function(_0x30a639){logger['error'](_0x3c53('0x28'),_0x3c53('0x29'),_0x3c53('0x2a'),util[_0x3c53('0x2b')](_0x30a639,{'showHidden':![],'depth':null}));});}else{logger[_0x3c53('0x1b')](_0x3c53('0x28'),'afterCreate',_0x3c53('0x2a'),_0x3c53('0x2c'));}break;case _0x3c53('0x2d'):var _0x5c5823=_0x3c53('0x2e');if(_0x466022[_0x3c53('0x2f')]&&_0x466022[_0x3c53('0x30')]){var _0x178e14={'recipient':[_0x29cb8a[_0x3c53('0x22')]],'message':_0x29cb8a[_0x3c53('0xe')],'message_type':_0x466022[_0x3c53('0x31')]};if(_0x466022['smsMethod']&&_0x466022['smsMethod']!=='SI'){_0x178e14[_0x3c53('0x32')]=_0x466022[_0x3c53('0x22')];}var _0x52251f={'url':_0x5c5823+_0x3c53('0x33')+_0x466022['username']+_0x3c53('0x34')+_0x466022['password'],'method':_0x3c53('0x35')};rp(_0x52251f)['then'](function(_0x284a9e){var _0x10632a=_0x284a9e[_0x3c53('0x36')](';');var _0x51d677={'user_key':_0x10632a[0x0],'session_key':_0x10632a[0x1]};_0x52251f={'url':_0x5c5823+_0x3c53('0x37'),'method':_0x3c53('0x38'),'headers':{'user_key':_0x51d677['user_key'],'Session_key':_0x51d677['session_key']},'json':!![],'body':_0x178e14};return rp(_0x52251f);})['then'](function(_0x5e5c5f){if(_0x5e5c5f[_0x3c53('0x39')]>=0x1){var _0x2637fc={'messageId':_0x5e5c5f['internal_order_id']};if(_0x466022[_0x3c53('0x31')]!=='GP'||!_0x466022[_0x3c53('0x3a')]){_0x2637fc[_0x3c53('0x3b')]=!![];}return _0x250683['update'](_0x2637fc);}else{return logger['error'](_0x3c53('0x28'),_0x3c53('0x29'),_0x3c53('0x2d'),util[_0x3c53('0x2b')](_0x5e5c5f,{'showHidden':![],'depth':null}));}})['catch'](function(_0x5556e5){return logger[_0x3c53('0x1b')](_0x3c53('0x28'),_0x3c53('0x29'),_0x3c53('0x2d'),util[_0x3c53('0x2b')](_0x5556e5,{'showHidden':![],'depth':null}));});}else{logger[_0x3c53('0x1b')](_0x3c53('0x28'),'afterCreate',_0x3c53('0x2d'),_0x3c53('0x3c'));}break;case'connectel':if(_0x466022[_0x3c53('0x21')]){var _0x5e9f63={'recipient':_0x29cb8a['phone'],'message':_0x29cb8a[_0x3c53('0xe')],'sender':_0x466022[_0x3c53('0x3d')]||_0x466022[_0x3c53('0x22')],'authorization':_0x466022[_0x3c53('0x21')]};var _0x28b163={'method':'POST','uri':_0x3c53('0x3e'),'body':_0x5e9f63,'json':!![]};rp(_0x28b163)['then'](function(_0x1efe87){var _0x3427b2={'messageId':_0x1efe87[_0x3c53('0x3f')]};if(!_0x466022[_0x3c53('0x3a')]){_0x3427b2[_0x3c53('0x3b')]=!![];}return _0x250683[_0x3c53('0x18')](_0x3427b2);})[_0x3c53('0x1a')](function(_0x3a49e9){logger[_0x3c53('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3c53('0x29'),_0x3c53('0x40'),util['inspect'](_0x3a49e9,{'showHidden':![],'depth':null}));});}else{logger[_0x3c53('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3c53('0x29'),_0x3c53('0x40'),_0x3c53('0x41'));}break;case _0x3c53('0x42'):if(_0x466022[_0x3c53('0x2f')]&&_0x466022[_0x3c53('0x30')]){var _0x5e9f63={'messages':[{'source':'xCALLY\x20Motion','to':_0x29cb8a['phone'],'body':_0x29cb8a[_0x3c53('0xe')],'from':_0x466022[_0x3c53('0x3d')]||_0x466022[_0x3c53('0x22')]}]};var _0x5bec21=util[_0x3c53('0x43')](_0x3c53('0x44'),_0x466022[_0x3c53('0x2f')],_0x466022[_0x3c53('0x30')]);var _0x28b163={'method':_0x3c53('0x38'),'uri':_0x3c53('0x45'),'body':_0x5e9f63,'headers':{'Authorization':util[_0x3c53('0x43')](_0x3c53('0x46'),new Buffer(_0x5bec21)[_0x3c53('0x47')](_0x3c53('0x48')))},'json':!![]};rp(_0x28b163)[_0x3c53('0x17')](function(_0x316e6f){if(_0x316e6f[_0x3c53('0x49')]>=0xc8&&_0x316e6f['http_code']<=0xce){if(_0x316e6f[_0x3c53('0x4a')]&&_0x316e6f[_0x3c53('0x4a')][_0x3c53('0x4b')]>0x0){var _0x38930c=_[_0x3c53('0x4c')](_0x316e6f['data'][_0x3c53('0x24')]);var _0x519886={'messageId':_0x38930c['message_id']};if(!_0x466022[_0x3c53('0x3a')]){_0x519886[_0x3c53('0x3b')]=!![];}return _0x250683[_0x3c53('0x18')](_0x519886);}else{logger[_0x3c53('0x1b')](_0x3c53('0x28'),'afterCreate',_0x3c53('0x4d'),util[_0x3c53('0x2b')](_0x316e6f,{'showHidden':![],'depth':null}));}}else{logger[_0x3c53('0x1b')](_0x3c53('0x28'),_0x3c53('0x29'),_0x3c53('0x4d'),util[_0x3c53('0x2b')](_0x316e6f,{'showHidden':![],'depth':null}));}})[_0x3c53('0x1a')](function(_0x2fc157){logger[_0x3c53('0x1b')](_0x3c53('0x28'),_0x3c53('0x29'),_0x3c53('0x4d'),util[_0x3c53('0x2b')](_0x2fc157,{'showHidden':![],'depth':null}));});}else{logger[_0x3c53('0x1b')](_0x3c53('0x28'),_0x3c53('0x29'),_0x3c53('0x4d'),_0x3c53('0x3c'));}break;case _0x3c53('0x4e'):if(_0x466022[_0x3c53('0x4f')]&&_0x466022[_0x3c53('0x21')]){var _0x5e9f63={'dst':_0x29cb8a[_0x3c53('0x22')],'text':_0x29cb8a[_0x3c53('0xe')],'src':_0x466022[_0x3c53('0x3d')]||_0x466022[_0x3c53('0x22')],'url':_0x466022[_0x3c53('0x50')]+_0x3c53('0x51')+_0x29cb8a['id']+_0x3c53('0x26')+_0x466022[_0x3c53('0x52')]};var _0x5bec21=util['format'](_0x3c53('0x44'),_0x466022[_0x3c53('0x4f')],_0x466022[_0x3c53('0x21')]);var _0x28b163={'method':_0x3c53('0x38'),'uri':util['format'](_0x3c53('0x53'),_0x466022['authId']),'body':_0x5e9f63,'headers':{'Authorization':util[_0x3c53('0x43')](_0x3c53('0x46'),new Buffer(_0x5bec21)[_0x3c53('0x47')](_0x3c53('0x48')))},'json':!![]};rp(_0x28b163)[_0x3c53('0x17')](function(_0x3dc3a7){var _0x40fb0e={'messageId':_0x3dc3a7['message_uuid'][0x0]};return _0x250683[_0x3c53('0x18')](_0x40fb0e);})['catch'](function(_0x482b64){logger[_0x3c53('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3c53('0x29'),_0x3c53('0x4e'),util['inspect'](_0x482b64,{'showHidden':![],'depth':null}));});}else{logger[_0x3c53('0x1b')](_0x3c53('0x28'),_0x3c53('0x29'),_0x3c53('0x4e'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0x3c53('0x54'):if(_0x466022[_0x3c53('0x2f')]&&_0x466022['password']){if(_0x466022[_0x3c53('0x55')]){var _0x36b17b={'method':_0x3c53('0x38'),'uri':_0x466022[_0x3c53('0x55')]+'/auth/1/session','body':{'username':_0x466022[_0x3c53('0x2f')],'password':_0x466022[_0x3c53('0x30')]},'json':!![]};return rp(_0x36b17b)[_0x3c53('0x17')](function(_0x193d5c){var _0x31d2cd={'method':_0x3c53('0x38'),'uri':_0x466022[_0x3c53('0x55')]+_0x3c53('0x56'),'body':{'messages':[{'from':_0x466022['phone'],'destinations':[{'to':_0x29cb8a['phone']}],'text':_0x29cb8a['body'],'notifyUrl':_0x466022['remote']+'/api/sms/messages/'+_0x29cb8a['id']+_0x3c53('0x26')+_0x466022[_0x3c53('0x52')],'notifyContentType':_0x3c53('0x57'),'callbackData':_0x466022[_0x3c53('0x22')]+';'+_0x29cb8a['body']}]},'headers':{'Authorization':'IBSSO\x20'+_0x193d5c[_0x3c53('0x52')]},'json':!![]};return rp(_0x31d2cd)[_0x3c53('0x17')](function(_0x353c99){if(_0x353c99[_0x3c53('0x24')]){var _0xa68ce4={'messageId':_0x353c99[_0x3c53('0x24')][0x0][_0x3c53('0xc')]};if(!_0x466022['deliveryReport']){_0xa68ce4[_0x3c53('0x3b')]=!![];}return _0x250683[_0x3c53('0x18')](_0xa68ce4);}else{return logger[_0x3c53('0x1b')](_0x3c53('0x28'),_0x3c53('0x29'),_0x3c53('0x54'),util[_0x3c53('0x2b')](_0x353c99,{'showHidden':![],'depth':null}));}});})[_0x3c53('0x1a')](function(_0xc7f904){return logger[_0x3c53('0x1b')](_0x3c53('0x28'),_0x3c53('0x29'),_0x3c53('0x54'),util[_0x3c53('0x2b')](_0xc7f904,{'showHidden':![],'depth':null}));});}else{logger[_0x3c53('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3c53('0x29'),'infobip',_0x3c53('0x58'));}}else{logger[_0x3c53('0x1b')](_0x3c53('0x28'),_0x3c53('0x29'),_0x3c53('0x54'),_0x3c53('0x3c'));}break;case'csc':var _0x55a0c7=require(_0x3c53('0x59'));if(_0x466022[_0x3c53('0x5a')]){var _0x49acf0={};_0x49acf0[_0x3c53('0x5b')]=_0x466022['username'];_0x49acf0[_0x3c53('0x22')]=_0x29cb8a['phone'];_0x49acf0[_0x3c53('0x32')]=_0x466022[_0x3c53('0x22')];_0x49acf0[_0x3c53('0x5c')]=_0x29cb8a['body'];_0x49acf0[_0x3c53('0x5d')]=+new Date();var _0x56b4d0='';var _0x337206='';var _0x86df56=Object[_0x3c53('0x5e')](_0x49acf0);_0x86df56[_0x3c53('0x5f')]();for(var _0x20afab=0x0;_0x20afab<_0x86df56[_0x3c53('0x60')];_0x20afab++){if(_0x56b4d0!=''){_0x56b4d0+='&';}_0x56b4d0+=_0x86df56[_0x20afab]+'='+encodeURIComponent(_0x49acf0[_0x86df56[_0x20afab]]);_0x337206+=_0x49acf0[_0x86df56[_0x20afab]];}_0x337206+=_0x466022[_0x3c53('0x5a')];_0x337206=_0x55a0c7[_0x3c53('0x61')](_0x3c53('0x62'))[_0x3c53('0x18')](_0x337206)[_0x3c53('0x63')](_0x3c53('0x64'));if(_0x56b4d0!==''){_0x56b4d0+='&';}_0x56b4d0+=_0x3c53('0x65')+_0x337206;var _0x52251f={'method':_0x3c53('0x35'),'uri':_0x466022['baseUrl']+_0x3c53('0x66')+_0x56b4d0,'json':!![]};return rp(_0x52251f)[_0x3c53('0x17')](function(_0x1e8709){var _0x68f552=Object[_0x3c53('0x5e')](_0x1e8709);if(_0x1e8709[_0x68f552[0x0]][_0x3c53('0x1b')]&&parseInt(_0x1e8709[_0x68f552[0x0]][_0x3c53('0x1b')])===0x0){var _0x857d7c={'messageId':_0x1e8709[_0x68f552[0x0]][_0x3c53('0x67')]};if(!_0x466022[_0x3c53('0x3a')]){_0x857d7c[_0x3c53('0x3b')]=!![];}return _0x250683[_0x3c53('0x18')](_0x857d7c);}else{return logger[_0x3c53('0x1b')](_0x3c53('0x28'),_0x3c53('0x29'),_0x3c53('0x68'),util[_0x3c53('0x2b')](_0x1e8709['error'],{'showHidden':![],'depth':null}));}})[_0x3c53('0x1a')](function(_0x2fc3da){return logger[_0x3c53('0x1b')](_0x3c53('0x28'),_0x3c53('0x29'),_0x3c53('0x68'),util['inspect'](_0x2fc3da,{'showHidden':![],'depth':null}));});}else{logger[_0x3c53('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3c53('0x29'),_0x3c53('0x68'),_0x3c53('0x69'));}break;case _0x3c53('0x6a'):if(_0x466022[_0x3c53('0x5a')]){var _0x45c93d={'method':_0x3c53('0x38'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x466022[_0x3c53('0x5a')]},'body':{'content':_0x29cb8a[_0x3c53('0xe')],'to':[_0x29cb8a[_0x3c53('0x22')]],'from':_0x466022[_0x3c53('0x22')],'binary':![],'clientMessageId':'uuid','charset':_0x3c53('0x6b')},'json':!![]};rp(_0x45c93d)[_0x3c53('0x17')](function(_0x2fd176){if(!_0x2fd176['error']){var _0x188f7a={'messageId':_0x2fd176[_0x3c53('0x24')][0x0]['apiMessageId']};if(!_0x466022[_0x3c53('0x3a')]){_0x188f7a[_0x3c53('0x3b')]=!![];}return _0x250683[_0x3c53('0x18')](_0x188f7a);}else{return logger[_0x3c53('0x1b')](_0x3c53('0x28'),_0x3c53('0x29'),_0x3c53('0x6a'),util[_0x3c53('0x2b')](_0x2fd176['error'],{'showHidden':![],'depth':null}));}})[_0x3c53('0x1a')](function(_0x39c68c){return logger[_0x3c53('0x1b')](_0x3c53('0x28'),_0x3c53('0x29'),'clickatell',util[_0x3c53('0x2b')](_0x39c68c,{'showHidden':![],'depth':null}));});}else{logger[_0x3c53('0x1b')](_0x3c53('0x28'),_0x3c53('0x29'),_0x3c53('0x6a'),_0x3c53('0x69'));}break;case _0x3c53('0x6c'):if(_0x466022[_0x3c53('0x2f')]&&_0x466022[_0x3c53('0x30')]){var _0x5bec21=util['format'](_0x3c53('0x44'),_0x466022[_0x3c53('0x2f')],_0x466022[_0x3c53('0x30')]);var _0x28b163={'method':_0x3c53('0x38'),'uri':_0x3c53('0x6d')+_0x466022[_0x3c53('0x6e')]+_0x3c53('0x6f'),'body':{'to':[_0x29cb8a[_0x3c53('0x22')]],'text':_0x29cb8a[_0x3c53('0xe')],'from':_0x466022['phone'],'applicationId':_0x466022[_0x3c53('0x70')]},'headers':{'Authorization':util[_0x3c53('0x43')](_0x3c53('0x46'),new Buffer(_0x5bec21)[_0x3c53('0x47')](_0x3c53('0x48')))},'json':!![]};rp(_0x28b163)[_0x3c53('0x17')](function(_0x2e8885){if(_0x2e8885['id']){var _0x1cfbaf={'messageId':_0x2e8885['id']};return _0x250683[_0x3c53('0x18')](_0x1cfbaf);}else{logger[_0x3c53('0x1b')](_0x3c53('0x28'),_0x3c53('0x29'),_0x3c53('0x6c'),util[_0x3c53('0x2b')](_0x2e8885,{'showHidden':![],'depth':null}));}})[_0x3c53('0x1a')](function(_0x5476f6){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3c53('0x29'),_0x3c53('0x6c'),util[_0x3c53('0x2b')](_0x5476f6,{'showHidden':![],'depth':null}));});}else{logger[_0x3c53('0x1b')](_0x3c53('0x28'),_0x3c53('0x29'),'bandwidth','Missing\x20parameters:\x20username,\x20password');}break;case _0x3c53('0x71'):if(_0x466022[_0x3c53('0x5a')]){var _0x377504={};var _0x52251f={'method':_0x3c53('0x38'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0x3c53('0x72')+_0x466022['apiKey'],'Content-Type':'application/json'},'body':{'from':_0x466022[_0x3c53('0x22')],'to':_0x29cb8a['phone'],'text':_0x29cb8a[_0x3c53('0xe')]},'json':!![]};return rp(_0x52251f)[_0x3c53('0x17')](function(_0x208253){if(_0x208253['code']==0xca){_0x377504[_0x3c53('0x73')]=_0x208253;var _0x29fc03={'method':_0x3c53('0x38'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':'Bearer\x20'+_0x466022['apiKey'],'Content-Type':'application/json'},'body':{'refid':_0x377504[_0x3c53('0x73')][_0x3c53('0x74')]},'json':!![]};return rp(_0x29fc03)[_0x3c53('0x17')](function(_0xdc26d2){_0x377504[_0x3c53('0x75')]=_0xdc26d2;var _0x141eec={'messageId':_0x377504[_0x3c53('0x73')][_0x3c53('0x74')],'read':!![]};return _0x250683[_0x3c53('0x18')](_0x141eec);});}else{return logger[_0x3c53('0x1b')](_0x3c53('0x28'),_0x3c53('0x29'),_0x3c53('0x71'),util[_0x3c53('0x2b')](_0x208253,{'showHidden':![],'depth':null}));}})[_0x3c53('0x1a')](function(_0x587baf){return logger[_0x3c53('0x1b')](_0x3c53('0x28'),'afterCreate',_0x3c53('0x71'),util[_0x3c53('0x2b')](_0x587baf,{'showHidden':![],'depth':null}));});}else{return logger[_0x3c53('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3c53('0x29'),_0x3c53('0x71'),_0x3c53('0x76'));}break;}}})[_0x3c53('0x77')](function(){_0x16e76d();});}else{_0x16e76d();}}},'charset':_0x3c53('0x78'),'collate':_0x3c53('0x79')});}; \ No newline at end of file +var _0xca83=['sms_messages','messageId','body','models','direction','toLowerCase','out','secret','isNil','SmsInteractionId','findOne','then','update','createdAt','error','SmsAccount','find','SmsAccountId','type','twilio','accountSid','phone','authToken','messages','create','remote','/api/sms/messages/','/status?token=','token','sid','catch','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','password','smsMethod','sender','login?username=','&password=','GET','split','sms','POST','user_key','total_sent','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','senderString','format','%s:%s','https://rest.clicksend.com/v3/sms/send','http_code','data','queued_count','message_id','clickSend','authId','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','toString','base64','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/sms/2/text/advanced','application/json','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','username','text','keys','sort','length','createHash','md5','digest','hex','signature=','id_sms','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','Missing\x20parameters:\x20apiKey','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','bandwidth','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','intelepeer','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports'];(function(_0x534c8f,_0x500079){var _0x5a57f5=function(_0x38ec0a){while(--_0x38ec0a){_0x534c8f['push'](_0x534c8f['shift']());}};_0x5a57f5(++_0x500079);}(_0xca83,0x1e2));var _0x3ca8=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0xca83[_0x1a9204];return _0x17ca68;};'use strict';var _=require(_0x3ca8('0x0'));var util=require(_0x3ca8('0x1'));var logger=require('../../config/logger')(_0x3ca8('0x2'));var moment=require(_0x3ca8('0x3'));var BPromise=require('bluebird');var rp=require(_0x3ca8('0x4'));var fs=require('fs');var path=require(_0x3ca8('0x5'));var rimraf=require(_0x3ca8('0x6'));var config=require(_0x3ca8('0x7'));var attributes=require(_0x3ca8('0x8'));module[_0x3ca8('0x9')]=function(_0x2a952a,_0x4ca9fd){return _0x2a952a['define']('SmsMessage',attributes,{'tableName':_0x3ca8('0xa'),'paranoid':![],'indexes':[{'name':_0x3ca8('0xb'),'fields':['messageId']},{'name':'fti_sms_messages','fields':[_0x3ca8('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x379270,_0x27c05f,_0x23da93){var _0x22814b=_0x2a952a[_0x3ca8('0xd')];var _0x92bb7f=_0x379270['get']({'plain':!![]});if(_0x92bb7f[_0x3ca8('0xe')][_0x3ca8('0xf')]()==='in'||_0x92bb7f[_0x3ca8('0xe')][_0x3ca8('0xf')]()===_0x3ca8('0x10')&&!_0x92bb7f[_0x3ca8('0x11')]&&!_[_0x3ca8('0x12')](_0x92bb7f['UserId'])&&!_[_0x3ca8('0x12')](_0x92bb7f[_0x3ca8('0x13')])){_0x22814b['SmsInteraction'][_0x3ca8('0x14')]({'where':{'id':_0x92bb7f['SmsInteractionId']}})[_0x3ca8('0x15')](function(_0x1cf062){if(_0x1cf062){_0x1cf062[_0x3ca8('0x16')]({'lastMsgAt':_0x92bb7f[_0x3ca8('0x17')],'lastMsgDirection':_0x92bb7f['direction'][_0x3ca8('0xf')]()});}})['catch'](function(_0x10a243){console[_0x3ca8('0x18')](_0x10a243);});}if(_0x92bb7f[_0x3ca8('0xe')]==='out'&&!_0x92bb7f[_0x3ca8('0x11')]){var _0xf2fc51;_0x22814b[_0x3ca8('0x19')][_0x3ca8('0x1a')]({'where':{'id':_0x92bb7f[_0x3ca8('0x1b')]},'raw':!![]})['then'](function(_0x25c782){_0xf2fc51=_0x25c782;if(_0xf2fc51&&_0xf2fc51[_0x3ca8('0x1c')]){switch(_0xf2fc51['type']){case _0x3ca8('0x1d'):var _0x547c65=require(_0x3ca8('0x1d'));if(_0xf2fc51[_0x3ca8('0x1e')]&&_0xf2fc51['authToken']&&_0xf2fc51[_0x3ca8('0x1f')]){var _0x2269f4=new _0x547c65(_0xf2fc51[_0x3ca8('0x1e')],_0xf2fc51[_0x3ca8('0x20')]);_0x2269f4[_0x3ca8('0x21')][_0x3ca8('0x22')]({'body':_0x92bb7f[_0x3ca8('0xc')],'to':_0x92bb7f[_0x3ca8('0x1f')],'from':_0xf2fc51[_0x3ca8('0x1f')],'statusCallback':_0xf2fc51[_0x3ca8('0x23')]+_0x3ca8('0x24')+_0x92bb7f['id']+_0x3ca8('0x25')+_0xf2fc51[_0x3ca8('0x26')]})['then'](function(_0x827bcc){if(_0x827bcc[_0x3ca8('0x27')]){return _0x379270['update']({'messageId':_0x827bcc[_0x3ca8('0x27')]});}})[_0x3ca8('0x28')](function(_0x12f758){logger['error'](_0x3ca8('0x29'),_0x3ca8('0x2a'),_0x3ca8('0x1d'),util[_0x3ca8('0x2b')](_0x12f758,{'showHidden':![],'depth':null}));});}else{logger[_0x3ca8('0x18')](_0x3ca8('0x29'),'afterCreate',_0x3ca8('0x1d'),_0x3ca8('0x2c'));}break;case _0x3ca8('0x2d'):var _0x30ccbe=_0x3ca8('0x2e');if(_0xf2fc51['username']&&_0xf2fc51[_0x3ca8('0x2f')]){var _0xbc548b={'recipient':[_0x92bb7f[_0x3ca8('0x1f')]],'message':_0x92bb7f['body'],'message_type':_0xf2fc51[_0x3ca8('0x30')]};if(_0xf2fc51['smsMethod']&&_0xf2fc51[_0x3ca8('0x30')]!=='SI'){_0xbc548b[_0x3ca8('0x31')]=_0xf2fc51[_0x3ca8('0x1f')];}var _0xb76e22={'url':_0x30ccbe+_0x3ca8('0x32')+_0xf2fc51['username']+_0x3ca8('0x33')+_0xf2fc51[_0x3ca8('0x2f')],'method':_0x3ca8('0x34')};rp(_0xb76e22)[_0x3ca8('0x15')](function(_0x4c3b7e){var _0x338fc4=_0x4c3b7e[_0x3ca8('0x35')](';');var _0x561bed={'user_key':_0x338fc4[0x0],'session_key':_0x338fc4[0x1]};_0xb76e22={'url':_0x30ccbe+_0x3ca8('0x36'),'method':_0x3ca8('0x37'),'headers':{'user_key':_0x561bed[_0x3ca8('0x38')],'Session_key':_0x561bed['session_key']},'json':!![],'body':_0xbc548b};return rp(_0xb76e22);})[_0x3ca8('0x15')](function(_0x567e71){if(_0x567e71[_0x3ca8('0x39')]>=0x1){var _0x1e18fe={'messageId':_0x567e71[_0x3ca8('0x3a')]};if(_0xf2fc51['smsMethod']!=='GP'||!_0xf2fc51[_0x3ca8('0x3b')]){_0x1e18fe[_0x3ca8('0x3c')]=!![];}return _0x379270[_0x3ca8('0x16')](_0x1e18fe);}else{return logger['error'](_0x3ca8('0x29'),_0x3ca8('0x2a'),_0x3ca8('0x2d'),util[_0x3ca8('0x2b')](_0x567e71,{'showHidden':![],'depth':null}));}})[_0x3ca8('0x28')](function(_0x19b10a){return logger[_0x3ca8('0x18')](_0x3ca8('0x29'),_0x3ca8('0x2a'),_0x3ca8('0x2d'),util['inspect'](_0x19b10a,{'showHidden':![],'depth':null}));});}else{logger[_0x3ca8('0x18')](_0x3ca8('0x29'),_0x3ca8('0x2a'),_0x3ca8('0x2d'),_0x3ca8('0x3d'));}break;case _0x3ca8('0x3e'):if(_0xf2fc51[_0x3ca8('0x20')]){var _0x48a2ac={'recipient':_0x92bb7f[_0x3ca8('0x1f')],'message':_0x92bb7f['body'],'sender':_0xf2fc51['senderString']||_0xf2fc51[_0x3ca8('0x1f')],'authorization':_0xf2fc51[_0x3ca8('0x20')]};var _0x27c05f={'method':_0x3ca8('0x37'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x48a2ac,'json':!![]};rp(_0x27c05f)['then'](function(_0x4b810e){var _0x53ab49={'messageId':_0x4b810e[_0x3ca8('0x3f')]};if(!_0xf2fc51['deliveryReport']){_0x53ab49[_0x3ca8('0x3c')]=!![];}return _0x379270['update'](_0x53ab49);})['catch'](function(_0x4efc3b){logger['error'](_0x3ca8('0x29'),_0x3ca8('0x2a'),_0x3ca8('0x3e'),util[_0x3ca8('0x2b')](_0x4efc3b,{'showHidden':![],'depth':null}));});}else{logger[_0x3ca8('0x18')](_0x3ca8('0x29'),'afterCreate',_0x3ca8('0x3e'),_0x3ca8('0x40'));}break;case _0x3ca8('0x41'):if(_0xf2fc51['username']&&_0xf2fc51[_0x3ca8('0x2f')]){var _0x48a2ac={'messages':[{'source':_0x3ca8('0x42'),'to':_0x92bb7f[_0x3ca8('0x1f')],'body':_0x92bb7f['body'],'from':_0xf2fc51[_0x3ca8('0x43')]||_0xf2fc51[_0x3ca8('0x1f')]}]};var _0x1916b3=util[_0x3ca8('0x44')](_0x3ca8('0x45'),_0xf2fc51['username'],_0xf2fc51[_0x3ca8('0x2f')]);var _0x27c05f={'method':_0x3ca8('0x37'),'uri':_0x3ca8('0x46'),'body':_0x48a2ac,'headers':{'Authorization':util[_0x3ca8('0x44')]('Basic\x20%s',new Buffer(_0x1916b3)['toString']('base64'))},'json':!![]};rp(_0x27c05f)[_0x3ca8('0x15')](function(_0x443d64){if(_0x443d64['http_code']>=0xc8&&_0x443d64[_0x3ca8('0x47')]<=0xce){if(_0x443d64[_0x3ca8('0x48')]&&_0x443d64[_0x3ca8('0x48')][_0x3ca8('0x49')]>0x0){var _0x950680=_['head'](_0x443d64[_0x3ca8('0x48')][_0x3ca8('0x21')]);var _0x1d2860={'messageId':_0x950680[_0x3ca8('0x4a')]};if(!_0xf2fc51[_0x3ca8('0x3b')]){_0x1d2860['read']=!![];}return _0x379270[_0x3ca8('0x16')](_0x1d2860);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3ca8('0x2a'),'clickSend',util[_0x3ca8('0x2b')](_0x443d64,{'showHidden':![],'depth':null}));}}else{logger[_0x3ca8('0x18')](_0x3ca8('0x29'),'afterCreate',_0x3ca8('0x4b'),util[_0x3ca8('0x2b')](_0x443d64,{'showHidden':![],'depth':null}));}})['catch'](function(_0x1488d0){logger[_0x3ca8('0x18')](_0x3ca8('0x29'),_0x3ca8('0x2a'),_0x3ca8('0x4b'),util[_0x3ca8('0x2b')](_0x1488d0,{'showHidden':![],'depth':null}));});}else{logger[_0x3ca8('0x18')](_0x3ca8('0x29'),'afterCreate',_0x3ca8('0x4b'),_0x3ca8('0x3d'));}break;case'plivo':if(_0xf2fc51[_0x3ca8('0x4c')]&&_0xf2fc51['authToken']){var _0x48a2ac={'dst':_0x92bb7f[_0x3ca8('0x1f')],'text':_0x92bb7f[_0x3ca8('0xc')],'src':_0xf2fc51[_0x3ca8('0x43')]||_0xf2fc51[_0x3ca8('0x1f')],'url':_0xf2fc51['remote']+_0x3ca8('0x24')+_0x92bb7f['id']+_0x3ca8('0x25')+_0xf2fc51[_0x3ca8('0x26')]};var _0x1916b3=util['format']('%s:%s',_0xf2fc51[_0x3ca8('0x4c')],_0xf2fc51[_0x3ca8('0x20')]);var _0x27c05f={'method':_0x3ca8('0x37'),'uri':util[_0x3ca8('0x44')](_0x3ca8('0x4d'),_0xf2fc51['authId']),'body':_0x48a2ac,'headers':{'Authorization':util[_0x3ca8('0x44')](_0x3ca8('0x4e'),new Buffer(_0x1916b3)[_0x3ca8('0x4f')](_0x3ca8('0x50')))},'json':!![]};rp(_0x27c05f)[_0x3ca8('0x15')](function(_0x1123ab){var _0x33db8a={'messageId':_0x1123ab[_0x3ca8('0x51')][0x0]};return _0x379270['update'](_0x33db8a);})[_0x3ca8('0x28')](function(_0x5abe1c){logger[_0x3ca8('0x18')](_0x3ca8('0x29'),_0x3ca8('0x2a'),_0x3ca8('0x52'),util[_0x3ca8('0x2b')](_0x5abe1c,{'showHidden':![],'depth':null}));});}else{logger[_0x3ca8('0x18')](_0x3ca8('0x29'),_0x3ca8('0x2a'),'plivo',_0x3ca8('0x53'));}break;case _0x3ca8('0x54'):if(_0xf2fc51['username']&&_0xf2fc51[_0x3ca8('0x2f')]){if(_0xf2fc51[_0x3ca8('0x55')]){var _0xe1ab23={'method':_0x3ca8('0x37'),'uri':_0xf2fc51['baseUrl']+'/auth/1/session','body':{'username':_0xf2fc51['username'],'password':_0xf2fc51[_0x3ca8('0x2f')]},'json':!![]};return rp(_0xe1ab23)['then'](function(_0x51e561){var _0xb188c5={'method':_0x3ca8('0x37'),'uri':_0xf2fc51[_0x3ca8('0x55')]+_0x3ca8('0x56'),'body':{'messages':[{'from':_0xf2fc51[_0x3ca8('0x1f')],'destinations':[{'to':_0x92bb7f[_0x3ca8('0x1f')]}],'text':_0x92bb7f['body'],'notifyUrl':_0xf2fc51['remote']+_0x3ca8('0x24')+_0x92bb7f['id']+_0x3ca8('0x25')+_0xf2fc51[_0x3ca8('0x26')],'notifyContentType':_0x3ca8('0x57'),'callbackData':_0xf2fc51[_0x3ca8('0x1f')]+';'+_0x92bb7f['body']}]},'headers':{'Authorization':'IBSSO\x20'+_0x51e561[_0x3ca8('0x26')]},'json':!![]};return rp(_0xb188c5)[_0x3ca8('0x15')](function(_0x453795){if(_0x453795['messages']){var _0x227b17={'messageId':_0x453795['messages'][0x0][_0x3ca8('0xb')]};if(!_0xf2fc51[_0x3ca8('0x3b')]){_0x227b17[_0x3ca8('0x3c')]=!![];}return _0x379270['update'](_0x227b17);}else{return logger[_0x3ca8('0x18')](_0x3ca8('0x29'),'afterCreate',_0x3ca8('0x54'),util['inspect'](_0x453795,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x4a3987){return logger[_0x3ca8('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x3ca8('0x54'),util[_0x3ca8('0x2b')](_0x4a3987,{'showHidden':![],'depth':null}));});}else{logger[_0x3ca8('0x18')](_0x3ca8('0x29'),_0x3ca8('0x2a'),_0x3ca8('0x54'),_0x3ca8('0x58'));}}else{logger[_0x3ca8('0x18')](_0x3ca8('0x29'),_0x3ca8('0x2a'),_0x3ca8('0x54'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x3ca8('0x59'):var _0x5de9ea=require(_0x3ca8('0x5a'));if(_0xf2fc51[_0x3ca8('0x5b')]){var _0xc3cdb={};_0xc3cdb[_0x3ca8('0x5c')]=_0xf2fc51[_0x3ca8('0x5d')];_0xc3cdb[_0x3ca8('0x1f')]=_0x92bb7f[_0x3ca8('0x1f')];_0xc3cdb[_0x3ca8('0x31')]=_0xf2fc51['phone'];_0xc3cdb[_0x3ca8('0x5e')]=_0x92bb7f['body'];_0xc3cdb['timestamp']=+new Date();var _0x44d085='';var _0x47da93='';var _0x100844=Object[_0x3ca8('0x5f')](_0xc3cdb);_0x100844[_0x3ca8('0x60')]();for(var _0x42c352=0x0;_0x42c352<_0x100844[_0x3ca8('0x61')];_0x42c352++){if(_0x44d085!=''){_0x44d085+='&';}_0x44d085+=_0x100844[_0x42c352]+'='+encodeURIComponent(_0xc3cdb[_0x100844[_0x42c352]]);_0x47da93+=_0xc3cdb[_0x100844[_0x42c352]];}_0x47da93+=_0xf2fc51['apiKey'];_0x47da93=_0x5de9ea[_0x3ca8('0x62')](_0x3ca8('0x63'))[_0x3ca8('0x16')](_0x47da93)[_0x3ca8('0x64')](_0x3ca8('0x65'));if(_0x44d085!==''){_0x44d085+='&';}_0x44d085+=_0x3ca8('0x66')+_0x47da93;var _0xb76e22={'method':_0x3ca8('0x34'),'uri':_0xf2fc51[_0x3ca8('0x55')]+'/external/get/send.php?'+_0x44d085,'json':!![]};return rp(_0xb76e22)['then'](function(_0x21396f){var _0x589613=Object['keys'](_0x21396f);if(_0x21396f[_0x589613[0x0]]['error']&&parseInt(_0x21396f[_0x589613[0x0]]['error'])===0x0){var _0x4c8b98={'messageId':_0x21396f[_0x589613[0x0]][_0x3ca8('0x67')]};if(!_0xf2fc51[_0x3ca8('0x3b')]){_0x4c8b98[_0x3ca8('0x3c')]=!![];}return _0x379270[_0x3ca8('0x16')](_0x4c8b98);}else{return logger[_0x3ca8('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3ca8('0x2a'),_0x3ca8('0x59'),util[_0x3ca8('0x2b')](_0x21396f[_0x3ca8('0x18')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x33eb2e){return logger[_0x3ca8('0x18')](_0x3ca8('0x29'),'afterCreate',_0x3ca8('0x59'),util['inspect'](_0x33eb2e,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x3ca8('0x59'),'Missing\x20parameters:\x20apiKey');}break;case _0x3ca8('0x68'):if(_0xf2fc51[_0x3ca8('0x5b')]){var _0x405961={'method':_0x3ca8('0x37'),'uri':_0x3ca8('0x69'),'headers':{'Authorization':_0xf2fc51[_0x3ca8('0x5b')]},'body':{'content':_0x92bb7f['body'],'to':[_0x92bb7f[_0x3ca8('0x1f')]],'from':_0xf2fc51[_0x3ca8('0x1f')],'binary':![],'clientMessageId':_0x3ca8('0x6a'),'charset':_0x3ca8('0x6b')},'json':!![]};rp(_0x405961)[_0x3ca8('0x15')](function(_0x5b5f3f){if(!_0x5b5f3f[_0x3ca8('0x18')]){var _0x352d65={'messageId':_0x5b5f3f[_0x3ca8('0x21')][0x0][_0x3ca8('0x6c')]};if(!_0xf2fc51['deliveryReport']){_0x352d65[_0x3ca8('0x3c')]=!![];}return _0x379270['update'](_0x352d65);}else{return logger[_0x3ca8('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3ca8('0x2a'),_0x3ca8('0x68'),util['inspect'](_0x5b5f3f[_0x3ca8('0x18')],{'showHidden':![],'depth':null}));}})[_0x3ca8('0x28')](function(_0x3b3821){return logger[_0x3ca8('0x18')](_0x3ca8('0x29'),_0x3ca8('0x2a'),_0x3ca8('0x68'),util[_0x3ca8('0x2b')](_0x3b3821,{'showHidden':![],'depth':null}));});}else{logger[_0x3ca8('0x18')](_0x3ca8('0x29'),_0x3ca8('0x2a'),'clickatell',_0x3ca8('0x6d'));}break;case'bandwidth':if(_0xf2fc51[_0x3ca8('0x5d')]&&_0xf2fc51[_0x3ca8('0x2f')]){var _0x1916b3=util[_0x3ca8('0x44')](_0x3ca8('0x45'),_0xf2fc51[_0x3ca8('0x5d')],_0xf2fc51[_0x3ca8('0x2f')]);var _0x27c05f={'method':_0x3ca8('0x37'),'uri':_0x3ca8('0x6e')+_0xf2fc51[_0x3ca8('0x6f')]+_0x3ca8('0x70'),'body':{'to':[_0x92bb7f[_0x3ca8('0x1f')]],'text':_0x92bb7f[_0x3ca8('0xc')],'from':_0xf2fc51[_0x3ca8('0x1f')],'applicationId':_0xf2fc51['applicationId']},'headers':{'Authorization':util['format'](_0x3ca8('0x4e'),new Buffer(_0x1916b3)[_0x3ca8('0x4f')](_0x3ca8('0x50')))},'json':!![]};rp(_0x27c05f)[_0x3ca8('0x15')](function(_0x347fe2){if(_0x347fe2['id']){var _0x2d982d={'messageId':_0x347fe2['id']};return _0x379270[_0x3ca8('0x16')](_0x2d982d);}else{logger[_0x3ca8('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x3ca8('0x71'),util['inspect'](_0x347fe2,{'showHidden':![],'depth':null}));}})[_0x3ca8('0x28')](function(_0x402cad){logger[_0x3ca8('0x18')](_0x3ca8('0x29'),'afterCreate',_0x3ca8('0x71'),util[_0x3ca8('0x2b')](_0x402cad,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3ca8('0x29'),_0x3ca8('0x2a'),_0x3ca8('0x71'),_0x3ca8('0x3d'));}break;case'intelepeer':if(_0xf2fc51[_0x3ca8('0x5b')]){var _0x35aa95={};var _0xb76e22={'method':'POST','uri':_0x3ca8('0x72'),'headers':{'Authorization':_0x3ca8('0x73')+_0xf2fc51[_0x3ca8('0x5b')],'Content-Type':_0x3ca8('0x57')},'body':{'from':_0xf2fc51[_0x3ca8('0x1f')],'to':_0x92bb7f[_0x3ca8('0x1f')],'text':_0x92bb7f[_0x3ca8('0xc')]},'json':!![]};return rp(_0xb76e22)[_0x3ca8('0x15')](function(_0x567eb1){if(_0x567eb1[_0x3ca8('0x74')]==0xca){_0x35aa95[_0x3ca8('0x75')]=_0x567eb1;var _0x1a277b={'method':_0x3ca8('0x37'),'uri':_0x3ca8('0x76'),'headers':{'Authorization':_0x3ca8('0x73')+_0xf2fc51[_0x3ca8('0x5b')],'Content-Type':'application/json'},'body':{'refid':_0x35aa95[_0x3ca8('0x75')][_0x3ca8('0x77')]},'json':!![]};return rp(_0x1a277b)[_0x3ca8('0x15')](function(_0x11cd25){_0x35aa95[_0x3ca8('0x78')]=_0x11cd25;var _0x1032b4={'messageId':_0x35aa95['message'][_0x3ca8('0x77')],'read':!![]};return _0x379270[_0x3ca8('0x16')](_0x1032b4);});}else{return logger[_0x3ca8('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','intelepeer',util[_0x3ca8('0x2b')](_0x567eb1,{'showHidden':![],'depth':null}));}})['catch'](function(_0x12e0eb){return logger[_0x3ca8('0x18')](_0x3ca8('0x29'),'afterCreate',_0x3ca8('0x79'),util[_0x3ca8('0x2b')](_0x12e0eb,{'showHidden':![],'depth':null}));});}else{return logger[_0x3ca8('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3ca8('0x2a'),_0x3ca8('0x79'),'Token\x20not\x20received');}break;}}})['finally'](function(){_0x23da93();});}else{_0x23da93();}}},'charset':'utf8mb4','collate':_0x3ca8('0x7a')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index bcda49b..b4f4b0c 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 _0x4efe=['SmsMessage','create','body','options','raw','CreateSmsMessage','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x3c48f0,_0x5f10ae){var _0x148748=function(_0x1b3ed4){while(--_0x1b3ed4){_0x3c48f0['push'](_0x3c48f0['shift']());}};_0x148748(++_0x5f10ae);}(_0x4efe,0x17d));var _0xe4ef=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0x4efe[_0x31a371];return _0x2a5bd6;};'use strict';var _=require(_0xe4ef('0x0'));var util=require(_0xe4ef('0x1'));var moment=require(_0xe4ef('0x2'));var BPromise=require(_0xe4ef('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe4ef('0x4'));var db=require(_0xe4ef('0x5'))['db'];var utils=require(_0xe4ef('0x6'));var logger=require(_0xe4ef('0x7'))(_0xe4ef('0x8'));var config=require(_0xe4ef('0x9'));var jayson=require(_0xe4ef('0xa'));var client=jayson['client'][_0xe4ef('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xe4ef('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xe4ef('0xd'))(new Redis(config[_0xe4ef('0xc')]));require(_0xe4ef('0xe'))[_0xe4ef('0xf')](socket);function respondWithRpcPromise(_0x244e50,_0x2a51a1,_0x6003ea){return new BPromise(function(_0x19cf63,_0x4c46c3){return client[_0xe4ef('0x10')](_0x244e50,_0x6003ea)[_0xe4ef('0x11')](function(_0x2806bb){logger[_0xe4ef('0x12')](_0xe4ef('0x13'),_0x2a51a1,_0xe4ef('0x14'));logger['debug'](_0xe4ef('0x15'),_0x2a51a1,_0xe4ef('0x14'),JSON[_0xe4ef('0x16')](_0x2806bb));if(_0x2806bb['error']){if(_0x2806bb[_0xe4ef('0x17')][_0xe4ef('0x18')]===0x1f4){logger[_0xe4ef('0x17')](_0xe4ef('0x13'),_0x2a51a1,_0x2806bb['error'][_0xe4ef('0x19')]);return _0x4c46c3(_0x2806bb[_0xe4ef('0x17')]['message']);}logger['error'](_0xe4ef('0x13'),_0x2a51a1,_0x2806bb[_0xe4ef('0x17')][_0xe4ef('0x19')]);return _0x19cf63(_0x2806bb['error']['message']);}else{logger[_0xe4ef('0x12')](_0xe4ef('0x13'),_0x2a51a1,_0xe4ef('0x14'));_0x19cf63(_0x2806bb['result'][_0xe4ef('0x19')]);}})[_0xe4ef('0x1a')](function(_0x28a1a3){logger['error'](_0xe4ef('0x13'),_0x2a51a1,_0x28a1a3);_0x4c46c3(_0x28a1a3);});});}exports['CreateSmsMessage']=function(_0x1b55d9){var _0x17cce7=this;return new Promise(function(_0x1fe5f8,_0x423b2b){return db[_0xe4ef('0x1b')][_0xe4ef('0x1c')](_0x1b55d9[_0xe4ef('0x1d')],{'raw':_0x1b55d9[_0xe4ef('0x1e')]?_0x1b55d9[_0xe4ef('0x1e')][_0xe4ef('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0xc94c4a){logger[_0xe4ef('0x12')](_0xe4ef('0x20'),_0x1b55d9);logger[_0xe4ef('0x21')](_0xe4ef('0x20'),_0x1b55d9,JSON[_0xe4ef('0x16')](_0xc94c4a));_0x1fe5f8(_0xc94c4a);})[_0xe4ef('0x1a')](function(_0x104260){logger['error']('CreateSmsMessage',_0x104260[_0xe4ef('0x19')],_0x1b55d9);_0x423b2b(_0x17cce7[_0xe4ef('0x17')](0x1f4,_0x104260[_0xe4ef('0x19')]));});});}; \ No newline at end of file +var _0x819b=['code','message','result','catch','CreateSmsMessage','body','options','raw','lodash','util','bluebird','randomstring','../../mysqldb','rpc','defaults','localhost','redis','./smsMessage.socket','register','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1e4b33,_0x37330b){var _0x2f187b=function(_0x358d75){while(--_0x358d75){_0x1e4b33['push'](_0x1e4b33['shift']());}};_0x2f187b(++_0x37330b);}(_0x819b,0x182));var _0xb819=function(_0x33e402,_0x4933ce){_0x33e402=_0x33e402-0x0;var _0x23f98f=_0x819b[_0x33e402];return _0x23f98f;};'use strict';var _=require(_0xb819('0x0'));var util=require(_0xb819('0x1'));var moment=require('moment');var BPromise=require(_0xb819('0x2'));var rs=require(_0xb819('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb819('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb819('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xb819('0x6')](config['redis'],{'host':_0xb819('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb819('0x8')]));require(_0xb819('0x9'))[_0xb819('0xa')](socket);function respondWithRpcPromise(_0x42a01c,_0x3382ca,_0xeaf1e2){return new BPromise(function(_0x46884e,_0x4e08fb){return client['request'](_0x42a01c,_0xeaf1e2)[_0xb819('0xb')](function(_0x5c7fda){logger[_0xb819('0xc')](_0xb819('0xd'),_0x3382ca,_0xb819('0xe'));logger[_0xb819('0xf')](_0xb819('0x10'),_0x3382ca,_0xb819('0xe'),JSON[_0xb819('0x11')](_0x5c7fda));if(_0x5c7fda[_0xb819('0x12')]){if(_0x5c7fda['error'][_0xb819('0x13')]===0x1f4){logger[_0xb819('0x12')](_0xb819('0xd'),_0x3382ca,_0x5c7fda[_0xb819('0x12')][_0xb819('0x14')]);return _0x4e08fb(_0x5c7fda[_0xb819('0x12')][_0xb819('0x14')]);}logger[_0xb819('0x12')](_0xb819('0xd'),_0x3382ca,_0x5c7fda[_0xb819('0x12')][_0xb819('0x14')]);return _0x46884e(_0x5c7fda[_0xb819('0x12')]['message']);}else{logger[_0xb819('0xc')](_0xb819('0xd'),_0x3382ca,_0xb819('0xe'));_0x46884e(_0x5c7fda[_0xb819('0x15')][_0xb819('0x14')]);}})[_0xb819('0x16')](function(_0x5a67f3){logger[_0xb819('0x12')]('SmsMessage,\x20%s,\x20%s',_0x3382ca,_0x5a67f3);_0x4e08fb(_0x5a67f3);});});}exports[_0xb819('0x17')]=function(_0x10d0fb){var _0x23d1a3=this;return new Promise(function(_0x543756,_0x517e9d){return db['SmsMessage']['create'](_0x10d0fb[_0xb819('0x18')],{'raw':_0x10d0fb[_0xb819('0x19')]?_0x10d0fb[_0xb819('0x19')][_0xb819('0x1a')]===undefined?!![]:![]:!![]})[_0xb819('0xb')](function(_0x3fd92a){logger[_0xb819('0xc')](_0xb819('0x17'),_0x10d0fb);logger['debug']('CreateSmsMessage',_0x10d0fb,JSON[_0xb819('0x11')](_0x3fd92a));_0x543756(_0x3fd92a);})[_0xb819('0x16')](function(_0x17fb90){logger[_0xb819('0x12')](_0xb819('0x17'),_0x17fb90[_0xb819('0x14')],_0x10d0fb);_0x517e9d(_0x23d1a3[_0xb819('0x12')](0x1f4,_0x17fb90[_0xb819('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index c594404..6366355 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 _0x40a1=['update','emit','removeListener','register','length','smsMessage:','save','remove'];(function(_0x1b2ee8,_0x721ef0){var _0x7c43d4=function(_0x14f98b){while(--_0x14f98b){_0x1b2ee8['push'](_0x1b2ee8['shift']());}};_0x7c43d4(++_0x721ef0);}(_0x40a1,0x10e));var _0x140a=function(_0x739802,_0x157395){_0x739802=_0x739802-0x0;var _0x3e7b09=_0x40a1[_0x739802];return _0x3e7b09;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x140a('0x0'),_0x140a('0x1'),_0x140a('0x2')];function createListener(_0x5cd0b1,_0x12f9a6){return function(_0x38d0ba){_0x12f9a6[_0x140a('0x3')](_0x5cd0b1,_0x38d0ba);};}function removeListener(_0x82b272,_0x5dbb5e){return function(){SmsMessageEvents[_0x140a('0x4')](_0x82b272,_0x5dbb5e);};}exports[_0x140a('0x5')]=function(_0x50450c){for(var _0x595ea2=0x0,_0x18dbe2=events[_0x140a('0x6')];_0x595ea2<_0x18dbe2;_0x595ea2++){var _0x5a8048=events[_0x595ea2];var _0x41cea2=createListener(_0x140a('0x7')+_0x5a8048,_0x50450c);SmsMessageEvents['on'](_0x5a8048,_0x41cea2);}}; \ No newline at end of file +var _0xa6a6=['emit','smsMessage:','./smsMessage.events','save','update'];(function(_0x487ee4,_0x3d3e66){var _0x3b0877=function(_0x5fba36){while(--_0x5fba36){_0x487ee4['push'](_0x487ee4['shift']());}};_0x3b0877(++_0x3d3e66);}(_0xa6a6,0xe3));var _0x6a6a=function(_0x53cf8e,_0x3d290f){_0x53cf8e=_0x53cf8e-0x0;var _0x459197=_0xa6a6[_0x53cf8e];return _0x459197;};'use strict';var SmsMessageEvents=require(_0x6a6a('0x0'));var events=[_0x6a6a('0x1'),'remove',_0x6a6a('0x2')];function createListener(_0xf8c6b9,_0x148a2b){return function(_0x59d335){_0x148a2b[_0x6a6a('0x3')](_0xf8c6b9,_0x59d335);};}function removeListener(_0x1a49b7,_0x4f6cde){return function(){SmsMessageEvents['removeListener'](_0x1a49b7,_0x4f6cde);};}exports['register']=function(_0x38835c){for(var _0x44f2b3=0x0,_0x2b2b8a=events['length'];_0x44f2b3<_0x2b2b8a;_0x44f2b3++){var _0x48bc91=events[_0x44f2b3];var _0x549301=createListener(_0x6a6a('0x4')+_0x48bc91,_0x38835c);SmsMessageEvents['on'](_0x48bc91,_0x549301);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index a10b308..b5b71bf 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 _0xf972=['getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','/:id/teams','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x1bae57,_0x285e8f){var _0x555b0e=function(_0x381213){while(--_0x381213){_0x1bae57['push'](_0x1bae57['shift']());}};_0x555b0e(++_0x285e8f);}(_0xf972,0x108));var _0x2f97=function(_0x5812b5,_0x116d39){_0x5812b5=_0x5812b5-0x0;var _0x536c6c=_0xf972[_0x5812b5];return _0x536c6c;};'use strict';var multer=require(_0x2f97('0x0'));var util=require(_0x2f97('0x1'));var path=require(_0x2f97('0x2'));var timeout=require(_0x2f97('0x3'));var express=require('express');var router=express[_0x2f97('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2f97('0x5'));var config=require(_0x2f97('0x6'));var controller=require(_0x2f97('0x7'));router[_0x2f97('0x8')]('/',auth[_0x2f97('0x9')](),controller[_0x2f97('0xa')]);router[_0x2f97('0x8')](_0x2f97('0xb'),auth['isAuthenticated'](),controller[_0x2f97('0xc')]);router[_0x2f97('0x8')](_0x2f97('0xd'),auth[_0x2f97('0x9')](),controller[_0x2f97('0xe')]);router[_0x2f97('0x8')]('/:id/members',auth[_0x2f97('0x9')](),controller[_0x2f97('0xf')]);router[_0x2f97('0x8')]('/:id/teams',auth['isAuthenticated'](),controller[_0x2f97('0x10')]);router[_0x2f97('0x8')](_0x2f97('0x11'),auth['isAuthenticated'](),controller[_0x2f97('0x12')]);router[_0x2f97('0x13')]('/',auth[_0x2f97('0x9')](),controller[_0x2f97('0x14')]);router[_0x2f97('0x13')]('/:id/teams',auth[_0x2f97('0x9')](),controller[_0x2f97('0x15')]);router[_0x2f97('0x13')](_0x2f97('0x11'),auth['isAuthenticated'](),controller[_0x2f97('0x16')]);router[_0x2f97('0x17')]('/:id',auth[_0x2f97('0x9')](),controller[_0x2f97('0x18')]);router[_0x2f97('0x19')](_0x2f97('0xd'),auth['isAuthenticated'](),controller[_0x2f97('0x1a')]);router[_0x2f97('0x19')](_0x2f97('0x1b'),auth[_0x2f97('0x9')](),controller[_0x2f97('0x1c')]);router['delete'](_0x2f97('0x11'),auth['isAuthenticated'](),controller[_0x2f97('0x1d')]);module[_0x2f97('0x1e')]=router; \ No newline at end of file +var _0x6c82=['fs-extra','../../components/interaction/service','../../config/environment','./smsQueue.controller','isAuthenticated','get','describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','destroy','delete','removeTeams','removeAgents','exports','multer','util','path','express','Router'];(function(_0x2babbd,_0x165a2b){var _0x1b7cf3=function(_0x3f1d51){while(--_0x3f1d51){_0x2babbd['push'](_0x2babbd['shift']());}};_0x1b7cf3(++_0x165a2b);}(_0x6c82,0x19f));var _0x26c8=function(_0x4097fa,_0x5b3122){_0x4097fa=_0x4097fa-0x0;var _0x5557ea=_0x6c82[_0x4097fa];return _0x5557ea;};'use strict';var multer=require(_0x26c8('0x0'));var util=require(_0x26c8('0x1'));var path=require(_0x26c8('0x2'));var timeout=require('connect-timeout');var express=require(_0x26c8('0x3'));var router=express[_0x26c8('0x4')]();var fs_extra=require(_0x26c8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x26c8('0x6'));var config=require(_0x26c8('0x7'));var controller=require(_0x26c8('0x8'));router['get']('/',auth[_0x26c8('0x9')](),controller['index']);router[_0x26c8('0xa')]('/describe',auth[_0x26c8('0x9')](),controller[_0x26c8('0xb')]);router[_0x26c8('0xa')](_0x26c8('0xc'),auth[_0x26c8('0x9')](),controller[_0x26c8('0xd')]);router[_0x26c8('0xa')](_0x26c8('0xe'),auth['isAuthenticated'](),controller[_0x26c8('0xf')]);router['get'](_0x26c8('0x10'),auth[_0x26c8('0x9')](),controller['getTeams']);router['get'](_0x26c8('0x11'),auth[_0x26c8('0x9')](),controller[_0x26c8('0x12')]);router[_0x26c8('0x13')]('/',auth[_0x26c8('0x9')](),controller[_0x26c8('0x14')]);router[_0x26c8('0x13')]('/:id/teams',auth[_0x26c8('0x9')](),controller[_0x26c8('0x15')]);router[_0x26c8('0x13')]('/:id/users',auth['isAuthenticated'](),controller[_0x26c8('0x16')]);router[_0x26c8('0x17')](_0x26c8('0xc'),auth[_0x26c8('0x9')](),controller[_0x26c8('0x18')]);router['delete'](_0x26c8('0xc'),auth['isAuthenticated'](),controller[_0x26c8('0x19')]);router[_0x26c8('0x1a')](_0x26c8('0x10'),auth['isAuthenticated'](),controller[_0x26c8('0x1b')]);router[_0x26c8('0x1a')]('/:id/users',auth[_0x26c8('0x9')](),controller[_0x26c8('0x1c')]);module[_0x26c8('0x1d')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 7d8e3d4..87c6673 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 _0x0408=['sequelize','STRING','name','ENUM','beepall'];(function(_0xe51964,_0x433b90){var _0x2c2366=function(_0x1bc95c){while(--_0x1bc95c){_0xe51964['push'](_0xe51964['shift']());}};_0x2c2366(++_0x433b90);}(_0x0408,0x78));var _0x8040=function(_0x2bd9a4,_0x3f6b0b){_0x2bd9a4=_0x2bd9a4-0x0;var _0x4cf03b=_0x0408[_0x2bd9a4];return _0x4cf03b;};'use strict';var Sequelize=require(_0x8040('0x0'));module['exports']={'name':{'type':Sequelize[_0x8040('0x1')],'unique':_0x8040('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8040('0x3')]('rrmemory',_0x8040('0x4'),'roundrobin')}}; \ No newline at end of file +var _0x54b3=['name','INTEGER','sequelize','STRING'];(function(_0x408967,_0x439672){var _0x20a96c=function(_0x2c292e){while(--_0x2c292e){_0x408967['push'](_0x408967['shift']());}};_0x20a96c(++_0x439672);}(_0x54b3,0x126));var _0x354b=function(_0x282fb1,_0x9761ed){_0x282fb1=_0x282fb1-0x0;var _0x400e37=_0x54b3[_0x282fb1];return _0x400e37;};'use strict';var Sequelize=require(_0x354b('0x0'));module['exports']={'name':{'type':Sequelize[_0x354b('0x1')],'unique':_0x354b('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x354b('0x1')]},'timeout':{'type':Sequelize[_0x354b('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory','beepall','roundrobin')}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 3495dc8..149898a 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 _0x0b0e=['userSmsQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_sms_queues','join','clone','ut.UserId\x20=\x20?','push','QueryTypes','every','TeamId','union','value','removeAgents','forEach','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','hasOwnProperty','bluebird','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','json','offset','undefined','limit','count','set','update','SmsQueues','destroy','then','error','stack','name','send','SmsQueue','fieldName','type','key','getOptions','include','query','findAll','rows','show','model','keys','rawAttributes','filters','intersection','attributes','fields','length','includeAll','merge','options','find','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','params','nolimit','order','sort','where','SmsQueueId','filter','map','UserSmsQueue','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','%s/%s','SIP','findOne','Team','pick','getTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','emit'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4b91c4,_0x23f35f){_0x4b91c4=_0x4b91c4-0x0;var _0x25cb80=_0x0b0e[_0x4b91c4];return _0x25cb80;};'use strict';var BPromise=require(_0xe0b0('0x0'));var util=require('util');var _=require(_0xe0b0('0x1'));var squel=require('squel');var Redis=require(_0xe0b0('0x2'));var qs=require(_0xe0b0('0x3'));var logger=require(_0xe0b0('0x4'))(_0xe0b0('0x5'));var config=require(_0xe0b0('0x6'));var db=require(_0xe0b0('0x7'))['db'];config[_0xe0b0('0x8')]=_[_0xe0b0('0x9')](config[_0xe0b0('0x8')],{'host':_0xe0b0('0xa'),'port':0x18eb});var socket=require(_0xe0b0('0xb'))(new Redis(config['redis']));require('./smsQueue.socket')[_0xe0b0('0xc')](socket);function respondWithStatusCode(_0x435060,_0xc4a085){_0xc4a085=_0xc4a085||0xcc;return function(_0x2ac27e){if(_0x2ac27e){return _0x435060['sendStatus'](_0xc4a085);}return _0x435060[_0xe0b0('0xd')](_0xc4a085)[_0xe0b0('0xe')]();};}function respondWithResult(_0x553d4f,_0x1fef28){_0x1fef28=_0x1fef28||0xc8;return function(_0x2f32b6){if(_0x2f32b6){return _0x553d4f['status'](_0x1fef28)[_0xe0b0('0xf')](_0x2f32b6);}};}function respondWithFilteredResult(_0x2cdad2,_0x39b1c2){return function(_0x585615){if(_0x585615){var _0x3068c0=typeof _0x39b1c2[_0xe0b0('0x10')]===_0xe0b0('0x11')&&typeof _0x39b1c2[_0xe0b0('0x12')]===_0xe0b0('0x11');var _0x4d2bf7=_0x585615[_0xe0b0('0x13')];var _0x154de6=_0x3068c0?0x0:_0x39b1c2[_0xe0b0('0x10')];var _0x24babd=_0x3068c0?_0x585615[_0xe0b0('0x13')]:_0x39b1c2['offset']+_0x39b1c2[_0xe0b0('0x12')];var _0x5adb01;if(_0x24babd>=_0x4d2bf7){_0x24babd=_0x4d2bf7;_0x5adb01=0xc8;}else{_0x5adb01=0xce;}_0x2cdad2[_0xe0b0('0xd')](_0x5adb01);return _0x2cdad2[_0xe0b0('0x14')]('Content-Range',_0x154de6+'-'+_0x24babd+'/'+_0x4d2bf7)[_0xe0b0('0xf')](_0x585615);}return null;};}function saveUpdates(_0x4a4cc0){return function(_0x2d6fb6){if(_0x2d6fb6){return _0x2d6fb6[_0xe0b0('0x15')](_0x4a4cc0)['then'](function(_0x54a3eb){return _0x54a3eb;});}return null;};}function removeEntity(_0x46bb44){return function(_0x50a441){if(_0x50a441){return _0x50a441['destroy']()['then'](function(){var _0x1920ee=_0x50a441['get']({'plain':!![]});var _0x52598b=_0xe0b0('0x16');return db['UserProfileResource'][_0xe0b0('0x17')]({'where':{'type':_0x52598b,'resourceId':_0x1920ee['id']}})['then'](function(){return _0x50a441;});})[_0xe0b0('0x18')](function(){_0x46bb44[_0xe0b0('0xd')](0xcc)[_0xe0b0('0xe')]();});}};}function handleEntityNotFound(_0x310a6d){return function(_0x2cf6a1){if(!_0x2cf6a1){_0x310a6d['sendStatus'](0x194);}return _0x2cf6a1;};}function handleError(_0x4cae54,_0x2fa820){_0x2fa820=_0x2fa820||0x1f4;return function(_0x5512bb){logger[_0xe0b0('0x19')](_0x5512bb[_0xe0b0('0x1a')]);if(_0x5512bb['name']){delete _0x5512bb[_0xe0b0('0x1b')];}_0x4cae54['status'](_0x2fa820)[_0xe0b0('0x1c')](_0x5512bb);};}exports['index']=function(_0x28586d,_0x576352){var _0x3e5c88={};var _0x4de537={'count':0x0,'rows':[]};var _0x4700cc=_['map'](db[_0xe0b0('0x1d')]['rawAttributes'],function(_0x362aba){return{'name':_0x362aba[_0xe0b0('0x1e')],'type':_0x362aba[_0xe0b0('0x1f')][_0xe0b0('0x20')]};});_0x3e5c88=qs[_0xe0b0('0x21')](_0x4700cc,_0x28586d);var _0x10745d={'where':_0x3e5c88['where']};return db[_0xe0b0('0x1d')][_0xe0b0('0x13')](_0x10745d)['then'](function(_0x15e13b){_0x4de537[_0xe0b0('0x13')]=_0x15e13b;_0x3e5c88[_0xe0b0('0x22')]=qs[_0xe0b0('0x22')](_0x28586d[_0xe0b0('0x23')]);return db[_0xe0b0('0x1d')][_0xe0b0('0x24')](_0x3e5c88);})['then'](function(_0x1854b8){_0x4de537[_0xe0b0('0x25')]=_0x1854b8;return _0x4de537;})['then'](respondWithFilteredResult(_0x576352,_0x3e5c88))['catch'](handleError(_0x576352,null));};exports[_0xe0b0('0x26')]=function(_0x33e672,_0x422575){var _0x3f81d5={'raw':!![],'where':{'id':_0x33e672['params']['id']}},_0x2ab1b1={};_0x2ab1b1[_0xe0b0('0x27')]=_[_0xe0b0('0x28')](db[_0xe0b0('0x1d')][_0xe0b0('0x29')]);_0x2ab1b1[_0xe0b0('0x23')]=_['keys'](_0x33e672[_0xe0b0('0x23')]);_0x2ab1b1[_0xe0b0('0x2a')]=_[_0xe0b0('0x2b')](_0x2ab1b1[_0xe0b0('0x27')],_0x2ab1b1[_0xe0b0('0x23')]);_0x3f81d5[_0xe0b0('0x2c')]=_[_0xe0b0('0x2b')](_0x2ab1b1[_0xe0b0('0x27')],qs[_0xe0b0('0x2d')](_0x33e672[_0xe0b0('0x23')][_0xe0b0('0x2d')]));_0x3f81d5[_0xe0b0('0x2c')]=_0x3f81d5[_0xe0b0('0x2c')][_0xe0b0('0x2e')]?_0x3f81d5[_0xe0b0('0x2c')]:_0x2ab1b1['model'];if(_0x33e672[_0xe0b0('0x23')][_0xe0b0('0x2f')]){_0x3f81d5[_0xe0b0('0x22')]=[{'all':!![]}];}_0x3f81d5=_[_0xe0b0('0x30')]({},_0x3f81d5,_0x33e672[_0xe0b0('0x31')]);return db[_0xe0b0('0x1d')][_0xe0b0('0x32')](_0x3f81d5)['then'](handleEntityNotFound(_0x422575,null))['then'](respondWithResult(_0x422575,null))['catch'](handleError(_0x422575,null));};exports['create']=function(_0x26137c,_0xc3d967){return db[_0xe0b0('0x1d')]['create'](_0x26137c[_0xe0b0('0x33')],{})[_0xe0b0('0x18')](function(_0x1cd705){var _0x297c64=_0x26137c['user'][_0xe0b0('0x34')]({'plain':!![]});if(!_0x297c64)throw new Error(_0xe0b0('0x35'));if(_0x297c64[_0xe0b0('0x36')]===_0xe0b0('0x37')){var _0x4265e3=_0x1cd705[_0xe0b0('0x34')]({'plain':!![]});var _0x8b745=_0xe0b0('0x16');return db[_0xe0b0('0x38')]['find']({'where':{'name':_0x8b745,'userProfileId':_0x297c64[_0xe0b0('0x39')]},'raw':!![]})['then'](function(_0x34178d){if(_0x34178d&&_0x34178d[_0xe0b0('0x3a')]===0x0){return db[_0xe0b0('0x3b')][_0xe0b0('0x3c')]({'name':_0x4265e3['name'],'resourceId':_0x4265e3['id'],'type':_0x34178d[_0xe0b0('0x1b')],'sectionId':_0x34178d['id']},{})[_0xe0b0('0x18')](function(){return _0x1cd705;});}else{return _0x1cd705;}})[_0xe0b0('0x3d')](function(_0x402a0e){logger[_0xe0b0('0x19')](_0xe0b0('0x3e'),_0x402a0e);throw _0x402a0e;});}return _0x1cd705;})[_0xe0b0('0x18')](respondWithResult(_0xc3d967,0xc9))[_0xe0b0('0x3d')](handleError(_0xc3d967,null));};exports['update']=function(_0x2aad80,_0x309bbf){if(_0x2aad80['body']['id']){delete _0x2aad80['body']['id'];}return db[_0xe0b0('0x1d')][_0xe0b0('0x32')]({'where':{'id':_0x2aad80['params']['id']}})[_0xe0b0('0x18')](handleEntityNotFound(_0x309bbf,null))[_0xe0b0('0x18')](saveUpdates(_0x2aad80[_0xe0b0('0x33')],null))[_0xe0b0('0x18')](respondWithResult(_0x309bbf,null))[_0xe0b0('0x3d')](handleError(_0x309bbf,null));};exports['destroy']=function(_0x5d2fa2,_0x51c580){return db[_0xe0b0('0x1d')][_0xe0b0('0x32')]({'where':{'id':_0x5d2fa2['params']['id']}})[_0xe0b0('0x18')](handleEntityNotFound(_0x51c580,null))[_0xe0b0('0x18')](removeEntity(_0x51c580,null))[_0xe0b0('0x3d')](handleError(_0x51c580,null));};exports[_0xe0b0('0x3f')]=function(_0x16ccca,_0x5c6f94){return db['SmsQueue'][_0xe0b0('0x3f')]()[_0xe0b0('0x18')](respondWithResult(_0x5c6f94,null))[_0xe0b0('0x3d')](handleError(_0x5c6f94,null));};exports[_0xe0b0('0x40')]=function(_0x1bf77d,_0x575c7d){var _0x3b1474={'raw':!![],'where':{}},_0x11d4fd={},_0x534340;return db['SmsQueue']['findOne']({'where':{'id':_0x1bf77d[_0xe0b0('0x41')]['id']}})[_0xe0b0('0x18')](handleEntityNotFound(_0x575c7d,null))[_0xe0b0('0x18')](function(_0x364877){if(_0x364877){_0x534340=_0x364877['get']({'plain':!![]});_0x11d4fd[_0xe0b0('0x27')]=_[_0xe0b0('0x28')](db['UserSmsQueue']['rawAttributes']);_0x11d4fd[_0xe0b0('0x23')]=_[_0xe0b0('0x28')](_0x1bf77d['query']);_0x11d4fd[_0xe0b0('0x2a')]=_[_0xe0b0('0x2b')](_0x11d4fd['model'],_0x11d4fd['query']);_0x3b1474[_0xe0b0('0x2c')]=_['intersection'](_0x11d4fd[_0xe0b0('0x27')],qs[_0xe0b0('0x2d')](_0x1bf77d[_0xe0b0('0x23')][_0xe0b0('0x2d')]));_0x3b1474[_0xe0b0('0x2c')]=_0x3b1474[_0xe0b0('0x2c')]['length']?_0x3b1474['attributes']:_0x11d4fd[_0xe0b0('0x27')];if(!_0x1bf77d['query']['hasOwnProperty'](_0xe0b0('0x42'))){_0x3b1474[_0xe0b0('0x12')]=qs['limit'](_0x1bf77d['query'][_0xe0b0('0x12')]);_0x3b1474[_0xe0b0('0x10')]=qs[_0xe0b0('0x10')](_0x1bf77d[_0xe0b0('0x23')][_0xe0b0('0x10')]);}_0x3b1474[_0xe0b0('0x43')]=qs[_0xe0b0('0x44')](_0x1bf77d['query'][_0xe0b0('0x44')]);_0x3b1474['where']=qs[_0xe0b0('0x2a')](_['pick'](_0x1bf77d['query'],_0x11d4fd[_0xe0b0('0x2a')]));_0x3b1474[_0xe0b0('0x45')][_0xe0b0('0x46')]=_0x364877['id'];if(_0x1bf77d[_0xe0b0('0x23')][_0xe0b0('0x47')]){_0x3b1474[_0xe0b0('0x45')]=_[_0xe0b0('0x30')](_0x3b1474[_0xe0b0('0x45')],{'$or':_[_0xe0b0('0x48')](_0x3b1474['attributes'],function(_0x253ab0){var _0x57ccc9={};_0x57ccc9[_0x253ab0]={'$like':'%'+_0x1bf77d[_0xe0b0('0x23')][_0xe0b0('0x47')]+'%'};return _0x57ccc9;})});}_0x3b1474=_[_0xe0b0('0x30')]({},_0x3b1474,_0x1bf77d[_0xe0b0('0x31')]);return db[_0xe0b0('0x49')][_0xe0b0('0x24')](_0x3b1474);}})['then'](function(_0x1a057c){if(_0x1a057c){return db[_0xe0b0('0x4a')][_0xe0b0('0x4b')]({'where':{'id':_[_0xe0b0('0x48')](_0x1a057c,_0xe0b0('0x4c')),'role':_0xe0b0('0x4d')},'attributes':['id',_0xe0b0('0x1b'),_0xe0b0('0x4e'),_0xe0b0('0x4f'),_0xe0b0('0x50')]});}})[_0xe0b0('0x18')](function(_0x18ab99){if(_0x18ab99){return{'count':_0x18ab99[_0xe0b0('0x13')],'rows':_[_0xe0b0('0x48')](_0x18ab99[_0xe0b0('0x25')],function(_0x34c642){return{'membername':_0x34c642[_0xe0b0('0x1b')],'UserId':_0x34c642['id'],'queue_name':_0x534340[_0xe0b0('0x1b')],'SmsQueueId':_0x534340['id'],'interface':util['format'](_0xe0b0('0x51'),_0xe0b0('0x52'),_0x34c642[_0xe0b0('0x1b')]),'penalty':0x0,'paused':_0x34c642[_0xe0b0('0x4e')],'createdAt':_0x34c642[_0xe0b0('0x50')],'updatedAt':_0x34c642[_0xe0b0('0x4f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe0b0('0x18')](respondWithFilteredResult(_0x575c7d,_0x3b1474))['catch'](handleError(_0x575c7d,null));};exports['getTeams']=function(_0x139014,_0x2a0415){var _0x157556={};var _0x47ecc1={};var _0x117d20;var _0x13fb4b;return db[_0xe0b0('0x1d')][_0xe0b0('0x53')]({'where':{'id':_0x139014[_0xe0b0('0x41')]['id']}})['then'](handleEntityNotFound(_0x2a0415,null))[_0xe0b0('0x18')](function(_0x242120){if(_0x242120){_0x117d20=_0x242120;_0x47ecc1[_0xe0b0('0x27')]=_['keys'](db[_0xe0b0('0x54')][_0xe0b0('0x29')]);_0x47ecc1['query']=_[_0xe0b0('0x28')](_0x139014['query']);_0x47ecc1['filters']=_[_0xe0b0('0x2b')](_0x47ecc1['model'],_0x47ecc1['query']);_0x157556[_0xe0b0('0x2c')]=_[_0xe0b0('0x2b')](_0x47ecc1[_0xe0b0('0x27')],qs[_0xe0b0('0x2d')](_0x139014['query'][_0xe0b0('0x2d')]));_0x157556[_0xe0b0('0x2c')]=_0x157556[_0xe0b0('0x2c')][_0xe0b0('0x2e')]?_0x157556[_0xe0b0('0x2c')]:_0x47ecc1[_0xe0b0('0x27')];_0x157556[_0xe0b0('0x43')]=qs[_0xe0b0('0x44')](_0x139014['query']['sort']);_0x157556[_0xe0b0('0x45')]=qs[_0xe0b0('0x2a')](_[_0xe0b0('0x55')](_0x139014['query'],_0x47ecc1['filters']));if(_0x139014[_0xe0b0('0x23')][_0xe0b0('0x47')]){_0x157556['where']=_['merge'](_0x157556[_0xe0b0('0x45')],{'$or':_[_0xe0b0('0x48')](_0x157556[_0xe0b0('0x2c')],function(_0x29175a){var _0x3b263f={};_0x3b263f[_0x29175a]={'$like':'%'+_0x139014[_0xe0b0('0x23')][_0xe0b0('0x47')]+'%'};return _0x3b263f;})});}_0x157556=_[_0xe0b0('0x30')]({},_0x157556,_0x139014['options']);return _0x117d20[_0xe0b0('0x56')](_0x157556);}})[_0xe0b0('0x18')](function(_0x1673bc){if(_0x1673bc){_0x13fb4b=_0x1673bc['length'];if(!_0x139014['query']['hasOwnProperty']('nolimit')){_0x157556['limit']=qs['limit'](_0x139014[_0xe0b0('0x23')]['limit']);_0x157556['offset']=qs[_0xe0b0('0x10')](_0x139014[_0xe0b0('0x23')][_0xe0b0('0x10')]);}return _0x117d20[_0xe0b0('0x56')](_0x157556);}})[_0xe0b0('0x18')](function(_0xd0629e){if(_0xd0629e){return _0xd0629e?{'count':_0x13fb4b,'rows':_0xd0629e}:null;}})[_0xe0b0('0x18')](respondWithResult(_0x2a0415,null))[_0xe0b0('0x3d')](handleError(_0x2a0415,null));};exports['addTeams']=function(_0x3097fb,_0x5da8fd){var _0x86e90=_0x3097fb[_0xe0b0('0x33')][_0xe0b0('0x57')];return db[_0xe0b0('0x54')][_0xe0b0('0x24')]({'where':{'id':_0x86e90},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe0b0('0x58'),'attributes':['id','name',_0xe0b0('0x59'),_0xe0b0('0x5a'),_0xe0b0('0x5b')],'raw':!![]}]})[_0xe0b0('0x18')](function(_0x4a78f8){if(_0x4a78f8){var _0x311f79=_[_0xe0b0('0x5c')](_0x4a78f8,function(_0x49deef){var _0x4cf60a=_0x49deef[_0xe0b0('0x34')]({'plain':!![]});return _0x4cf60a[_0xe0b0('0x58')];});return db[_0xe0b0('0x1d')][_0xe0b0('0x32')]({'where':{'id':_0x3097fb[_0xe0b0('0x41')]['id']}})[_0xe0b0('0x18')](function(_0x34f4ff){return db[_0xe0b0('0x5d')][_0xe0b0('0x5e')](function(_0x24571b){return _0x34f4ff['addTeams'](_0x86e90,{'transaction':_0x24571b})['then'](function(){return BPromise[_0xe0b0('0x5f')](_0x311f79,function(_0x4880d5){return db['UserSmsQueue']['findOrCreate']({'where':{'UserId':_0x4880d5['id'],'SmsQueueId':_0x3097fb['params']['id']},'transaction':_0x24571b});});})[_0xe0b0('0x18')](function(){_0x311f79['forEach'](function(_0x654d2b){socket[_0xe0b0('0x60')](_0xe0b0('0x61'),{'UserId':_0x654d2b['id'],'SmsQueueId':_0x34f4ff['id']});});});});});}})[_0xe0b0('0x18')](respondWithStatusCode(_0x5da8fd,null))['catch'](handleError(_0x5da8fd,null));};exports[_0xe0b0('0x62')]=function(_0x948708,_0x5a0817){return db[_0xe0b0('0x54')][_0xe0b0('0x24')]({'where':{'id':_0x948708[_0xe0b0('0x23')][_0xe0b0('0x57')]},'attributes':['id'],'include':[{'model':db[_0xe0b0('0x4a')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5a0817,null))['then'](function(_0x545694){var _0x5c258b=_[_0xe0b0('0x48')](_0x545694,'id');var _0x567e1a=[];var _0x3c09af=[];var _0x5f4aaf=squel[_0xe0b0('0x63')]();_0x5f4aaf[_0xe0b0('0x64')](_0xe0b0('0x65'))[_0xe0b0('0x66')](_0xe0b0('0x67'),'tq')[_0xe0b0('0x68')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where']('SmsQueueId\x20=\x20?',_0x948708[_0xe0b0('0x41')]['id']);for(var _0x261381=0x0;_0x261381<_0x545694[_0xe0b0('0x2e')];_0x261381+=0x1){let _0x4377f7=_0x545694[_0x261381];for(var _0x2c1149=0x0;_0x2c1149<_0x4377f7['Agents'][_0xe0b0('0x2e')];_0x2c1149+=0x1){let _0x39a07b=_0x4377f7[_0xe0b0('0x58')][_0x2c1149];var _0xc6090e=_0x5f4aaf[_0xe0b0('0x69')]();_0xc6090e[_0xe0b0('0x45')](_0xe0b0('0x6a'),_0x39a07b['id']);_0x3c09af[_0xe0b0('0x6b')](db[_0xe0b0('0x5d')]['query'](_0xc6090e['toString'](),{'type':db[_0xe0b0('0x5d')][_0xe0b0('0x6c')]['SELECT']})[_0xe0b0('0x18')](function(_0x4593f1){if(_0x4593f1[_0xe0b0('0x2e')]===0x1){return _0x39a07b['id'];}else{var _0x3fcffd=_[_0xe0b0('0x6d')](_[_0xe0b0('0x48')](_0x4593f1,_0xe0b0('0x6e')),function(_0xc8eba3){return _['includes'](_0x5c258b,_0xc8eba3);});if(_0x3fcffd){return _0x39a07b['id'];}}}));}}return BPromise['all'](_0x3c09af)['then'](function(_0xc19743){_0x567e1a=_(_0x567e1a)[_0xe0b0('0x6f')](_0xc19743)['compact']()[_0xe0b0('0x70')]();return db[_0xe0b0('0x1d')][_0xe0b0('0x32')]({'where':{'id':_0x948708[_0xe0b0('0x41')]['id']}})['then'](function(_0x56c4b9){return db['sequelize'][_0xe0b0('0x5e')](function(_0x266835){return _0x56c4b9['removeTeams'](_0x948708[_0xe0b0('0x23')][_0xe0b0('0x57')],{'transaction':_0x266835})['then'](function(){if(!_['isEmpty'](_0x567e1a)){return _0x56c4b9[_0xe0b0('0x71')](_0x567e1a,{'transaction':_0x266835});}})['then'](function(){_0x567e1a[_0xe0b0('0x72')](function(_0x5f06c0){socket[_0xe0b0('0x60')](_0xe0b0('0x73'),{'UserId':_0x5f06c0,'SmsQueueId':_0x56c4b9['id']});});});});});});})[_0xe0b0('0x18')](respondWithStatusCode(_0x5a0817,null))[_0xe0b0('0x3d')](handleError(_0x5a0817,null));};exports[_0xe0b0('0x74')]=function(_0x1ec7c2,_0x434dfa){return db[_0xe0b0('0x1d')][_0xe0b0('0x32')]({'where':{'id':_0x1ec7c2['params']['id']}})[_0xe0b0('0x18')](handleEntityNotFound(_0x434dfa,null))[_0xe0b0('0x18')](function(_0x2b40eb){if(_0x2b40eb){return _0x2b40eb['addAgents'](_0x1ec7c2[_0xe0b0('0x33')]['ids'],_[_0xe0b0('0x75')](_0x1ec7c2[_0xe0b0('0x33')],['ids','id'])||{})[_0xe0b0('0x76')](function(_0x4e4b45){for(var _0x528932=0x0;_0x528932<_0x1ec7c2[_0xe0b0('0x33')]['ids']['length'];_0x528932+=0x1){socket[_0xe0b0('0x60')](_0xe0b0('0x61'),{'UserId':Number(_0x1ec7c2[_0xe0b0('0x33')][_0xe0b0('0x57')][_0x528932]),'SmsQueueId':Number(_0x1ec7c2[_0xe0b0('0x41')]['id'])});}return _0x4e4b45;});}})[_0xe0b0('0x18')](respondWithResult(_0x434dfa,null))['catch'](handleError(_0x434dfa,null));};exports[_0xe0b0('0x71')]=function(_0x4609d5,_0x421b3b){return db['SmsQueue'][_0xe0b0('0x32')]({'where':{'id':_0x4609d5[_0xe0b0('0x41')]['id']}})['then'](handleEntityNotFound(_0x421b3b,null))['then'](function(_0x33f89a){if(_0x33f89a){return _0x33f89a['removeAgents'](_0x4609d5[_0xe0b0('0x23')][_0xe0b0('0x57')])[_0xe0b0('0x18')](function(){if(_[_0xe0b0('0x77')](_0x4609d5[_0xe0b0('0x23')][_0xe0b0('0x57')])){for(var _0x3d70d7=0x0;_0x3d70d7<_0x4609d5['query'][_0xe0b0('0x57')][_0xe0b0('0x2e')];_0x3d70d7+=0x1){socket[_0xe0b0('0x60')](_0xe0b0('0x73'),{'UserId':Number(_0x4609d5[_0xe0b0('0x23')]['ids'][_0x3d70d7]),'SmsQueueId':Number(_0x4609d5['params']['id'])});}}else{socket[_0xe0b0('0x60')](_0xe0b0('0x73'),{'UserId':Number(_0x4609d5[_0xe0b0('0x23')][_0xe0b0('0x57')]),'SmsQueueId':Number(_0x4609d5[_0xe0b0('0x41')]['id'])});}});}})[_0xe0b0('0x18')](respondWithStatusCode(_0x421b3b,null))[_0xe0b0('0x3d')](handleError(_0x421b3b,null));};exports[_0xe0b0('0x78')]=function(_0x932e,_0x1b3f4d){var _0x4fe048={};var _0xac45e6={};var _0x401c4b;var _0x3e18a3;return db[_0xe0b0('0x1d')]['findOne']({'where':{'id':_0x932e[_0xe0b0('0x41')]['id']}})[_0xe0b0('0x18')](handleEntityNotFound(_0x1b3f4d,null))[_0xe0b0('0x18')](function(_0x116c16){if(_0x116c16){_0x401c4b=_0x116c16;_0xac45e6[_0xe0b0('0x27')]=_['keys'](db[_0xe0b0('0x4a')]['rawAttributes']);_0xac45e6[_0xe0b0('0x23')]=_[_0xe0b0('0x28')](_0x932e[_0xe0b0('0x23')]);_0xac45e6[_0xe0b0('0x2a')]=_[_0xe0b0('0x2b')](_0xac45e6['model'],_0xac45e6['query']);_0x4fe048[_0xe0b0('0x2c')]=_['intersection'](_0xac45e6[_0xe0b0('0x27')],qs['fields'](_0x932e[_0xe0b0('0x23')][_0xe0b0('0x2d')]));_0x4fe048[_0xe0b0('0x2c')]=_0x4fe048[_0xe0b0('0x2c')][_0xe0b0('0x2e')]?_0x4fe048[_0xe0b0('0x2c')]:_0xac45e6[_0xe0b0('0x27')];_0x4fe048['order']=qs['sort'](_0x932e[_0xe0b0('0x23')][_0xe0b0('0x44')]);_0x4fe048[_0xe0b0('0x45')]=qs[_0xe0b0('0x2a')](_[_0xe0b0('0x55')](_0x932e[_0xe0b0('0x23')],_0xac45e6[_0xe0b0('0x2a')]));if(_0x932e[_0xe0b0('0x23')][_0xe0b0('0x47')]){_0x4fe048[_0xe0b0('0x45')]=_['merge'](_0x4fe048['where'],{'$or':_[_0xe0b0('0x48')](_0x4fe048[_0xe0b0('0x2c')],function(_0x187465){var _0x3f9e6b={};_0x3f9e6b[_0x187465]={'$like':'%'+_0x932e[_0xe0b0('0x23')][_0xe0b0('0x47')]+'%'};return _0x3f9e6b;})});}_0x4fe048=_[_0xe0b0('0x30')]({},_0x4fe048,_0x932e['options']);return _0x401c4b['getAgents'](_0x4fe048);}})[_0xe0b0('0x18')](function(_0x1ea4d5){if(_0x1ea4d5){_0x3e18a3=_0x1ea4d5[_0xe0b0('0x2e')];if(!_0x932e[_0xe0b0('0x23')][_0xe0b0('0x79')](_0xe0b0('0x42'))){_0x4fe048[_0xe0b0('0x12')]=qs[_0xe0b0('0x12')](_0x932e[_0xe0b0('0x23')][_0xe0b0('0x12')]);_0x4fe048['offset']=qs[_0xe0b0('0x10')](_0x932e[_0xe0b0('0x23')]['offset']);}return _0x401c4b[_0xe0b0('0x78')](_0x4fe048);}})[_0xe0b0('0x18')](function(_0x3615f9){if(_0x3615f9){return _0x3615f9?{'count':_0x3e18a3,'rows':_0x3615f9}:null;}})[_0xe0b0('0x18')](respondWithResult(_0x1b3f4d,null))[_0xe0b0('0x3d')](handleError(_0x1b3f4d,null));}; \ No newline at end of file +var _0x7a54=['transaction','addTeams','each','findOrCreate','userSmsQueue:save','removeTeams','Team','select','field','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','QueryTypes','SELECT','every','includes','all','compact','isEmpty','forEach','userSmsQueue:remove','addAgents','omit','emit','removeAgents','isArray','getAgents','bluebird','util','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsQueue.socket','status','end','json','offset','undefined','count','set','Content-Range','update','destroy','then','get','SmsQueues','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','key','getOptions','where','SmsQueue','include','rows','catch','show','params','model','query','intersection','fields','attributes','includeAll','merge','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserSmsQueue','length','hasOwnProperty','limit','order','sort','filters','pick','filter','User','UserId','createdAt','format','%s/%s','smsPause','getTeams','keys','nolimit','ids','findAll','Agents','online','voicePause','interface','flatMap','sequelize'];(function(_0x1034b9,_0x194091){var _0x3e558e=function(_0x2ab604){while(--_0x2ab604){_0x1034b9['push'](_0x1034b9['shift']());}};_0x3e558e(++_0x194091);}(_0x7a54,0x106));var _0x47a5=function(_0x5e26f4,_0x8f30cc){_0x5e26f4=_0x5e26f4-0x0;var _0x39a74e=_0x7a54[_0x5e26f4];return _0x39a74e;};'use strict';var BPromise=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var _=require(_0x47a5('0x2'));var squel=require('squel');var Redis=require(_0x47a5('0x3'));var qs=require(_0x47a5('0x4'));var logger=require('../../config/logger')(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var db=require(_0x47a5('0x7'))['db'];config[_0x47a5('0x8')]=_[_0x47a5('0x9')](config['redis'],{'host':_0x47a5('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x47a5('0x8')]));require(_0x47a5('0xb'))['register'](socket);function respondWithStatusCode(_0x194fb0,_0x5077f3){_0x5077f3=_0x5077f3||0xcc;return function(_0x5d90b3){if(_0x5d90b3){return _0x194fb0['sendStatus'](_0x5077f3);}return _0x194fb0[_0x47a5('0xc')](_0x5077f3)[_0x47a5('0xd')]();};}function respondWithResult(_0x5e31dd,_0x2eb0dd){_0x2eb0dd=_0x2eb0dd||0xc8;return function(_0x49e844){if(_0x49e844){return _0x5e31dd['status'](_0x2eb0dd)[_0x47a5('0xe')](_0x49e844);}};}function respondWithFilteredResult(_0x69e4d4,_0x2f399b){return function(_0x250fad){if(_0x250fad){var _0xd612dd=typeof _0x2f399b[_0x47a5('0xf')]===_0x47a5('0x10')&&typeof _0x2f399b['limit']===_0x47a5('0x10');var _0x221b54=_0x250fad[_0x47a5('0x11')];var _0x711793=_0xd612dd?0x0:_0x2f399b[_0x47a5('0xf')];var _0x620ee9=_0xd612dd?_0x250fad[_0x47a5('0x11')]:_0x2f399b[_0x47a5('0xf')]+_0x2f399b['limit'];var _0x362359;if(_0x620ee9>=_0x221b54){_0x620ee9=_0x221b54;_0x362359=0xc8;}else{_0x362359=0xce;}_0x69e4d4[_0x47a5('0xc')](_0x362359);return _0x69e4d4[_0x47a5('0x12')](_0x47a5('0x13'),_0x711793+'-'+_0x620ee9+'/'+_0x221b54)[_0x47a5('0xe')](_0x250fad);}return null;};}function saveUpdates(_0x574af6){return function(_0x549de3){if(_0x549de3){return _0x549de3[_0x47a5('0x14')](_0x574af6)['then'](function(_0x5247fd){return _0x5247fd;});}return null;};}function removeEntity(_0x423a81){return function(_0xaf70a6){if(_0xaf70a6){return _0xaf70a6[_0x47a5('0x15')]()[_0x47a5('0x16')](function(){var _0x477b1d=_0xaf70a6[_0x47a5('0x17')]({'plain':!![]});var _0x2763d6=_0x47a5('0x18');return db[_0x47a5('0x19')]['destroy']({'where':{'type':_0x2763d6,'resourceId':_0x477b1d['id']}})[_0x47a5('0x16')](function(){return _0xaf70a6;});})[_0x47a5('0x16')](function(){_0x423a81['status'](0xcc)[_0x47a5('0xd')]();});}};}function handleEntityNotFound(_0x1f03f7){return function(_0x36874d){if(!_0x36874d){_0x1f03f7['sendStatus'](0x194);}return _0x36874d;};}function handleError(_0xb8ae6c,_0x2f142b){_0x2f142b=_0x2f142b||0x1f4;return function(_0x23db32){logger[_0x47a5('0x1a')](_0x23db32['stack']);if(_0x23db32[_0x47a5('0x1b')]){delete _0x23db32[_0x47a5('0x1b')];}_0xb8ae6c['status'](_0x2f142b)[_0x47a5('0x1c')](_0x23db32);};}exports[_0x47a5('0x1d')]=function(_0x4437f1,_0x129ce5){var _0x3abd6a={};var _0x50bf17={'count':0x0,'rows':[]};var _0x53078a=_[_0x47a5('0x1e')](db['SmsQueue'][_0x47a5('0x1f')],function(_0x5b6c4e){return{'name':_0x5b6c4e[_0x47a5('0x20')],'type':_0x5b6c4e[_0x47a5('0x21')][_0x47a5('0x22')]};});_0x3abd6a=qs[_0x47a5('0x23')](_0x53078a,_0x4437f1);var _0x21f296={'where':_0x3abd6a[_0x47a5('0x24')]};return db[_0x47a5('0x25')][_0x47a5('0x11')](_0x21f296)[_0x47a5('0x16')](function(_0x361bfa){_0x50bf17[_0x47a5('0x11')]=_0x361bfa;_0x3abd6a[_0x47a5('0x26')]=qs[_0x47a5('0x26')](_0x4437f1['query']);return db[_0x47a5('0x25')]['findAll'](_0x3abd6a);})[_0x47a5('0x16')](function(_0x9ac908){_0x50bf17[_0x47a5('0x27')]=_0x9ac908;return _0x50bf17;})['then'](respondWithFilteredResult(_0x129ce5,_0x3abd6a))[_0x47a5('0x28')](handleError(_0x129ce5,null));};exports[_0x47a5('0x29')]=function(_0x39b50b,_0x1f1c68){var _0x51cc81={'raw':!![],'where':{'id':_0x39b50b[_0x47a5('0x2a')]['id']}},_0x50d875={};_0x50d875[_0x47a5('0x2b')]=_['keys'](db['SmsQueue'][_0x47a5('0x1f')]);_0x50d875[_0x47a5('0x2c')]=_['keys'](_0x39b50b[_0x47a5('0x2c')]);_0x50d875['filters']=_[_0x47a5('0x2d')](_0x50d875[_0x47a5('0x2b')],_0x50d875['query']);_0x51cc81['attributes']=_[_0x47a5('0x2d')](_0x50d875['model'],qs[_0x47a5('0x2e')](_0x39b50b[_0x47a5('0x2c')][_0x47a5('0x2e')]));_0x51cc81['attributes']=_0x51cc81[_0x47a5('0x2f')]['length']?_0x51cc81['attributes']:_0x50d875[_0x47a5('0x2b')];if(_0x39b50b['query'][_0x47a5('0x30')]){_0x51cc81['include']=[{'all':!![]}];}_0x51cc81=_[_0x47a5('0x31')]({},_0x51cc81,_0x39b50b[_0x47a5('0x32')]);return db[_0x47a5('0x25')][_0x47a5('0x33')](_0x51cc81)[_0x47a5('0x16')](handleEntityNotFound(_0x1f1c68,null))[_0x47a5('0x16')](respondWithResult(_0x1f1c68,null))[_0x47a5('0x28')](handleError(_0x1f1c68,null));};exports[_0x47a5('0x34')]=function(_0x1a0d23,_0x4caed5){return db[_0x47a5('0x25')][_0x47a5('0x34')](_0x1a0d23['body'],{})[_0x47a5('0x16')](function(_0x2bf53d){var _0x1d4348=_0x1a0d23['user'][_0x47a5('0x17')]({'plain':!![]});if(!_0x1d4348)throw new Error(_0x47a5('0x35'));if(_0x1d4348['role']===_0x47a5('0x36')){var _0x19218a=_0x2bf53d['get']({'plain':!![]});var _0x55c5eb='SmsQueues';return db[_0x47a5('0x37')]['find']({'where':{'name':_0x55c5eb,'userProfileId':_0x1d4348[_0x47a5('0x38')]},'raw':!![]})[_0x47a5('0x16')](function(_0x301a85){if(_0x301a85&&_0x301a85[_0x47a5('0x39')]===0x0){return db[_0x47a5('0x19')][_0x47a5('0x34')]({'name':_0x19218a[_0x47a5('0x1b')],'resourceId':_0x19218a['id'],'type':_0x301a85[_0x47a5('0x1b')],'sectionId':_0x301a85['id']},{})[_0x47a5('0x16')](function(){return _0x2bf53d;});}else{return _0x2bf53d;}})[_0x47a5('0x28')](function(_0x280500){logger[_0x47a5('0x1a')](_0x47a5('0x3a'),_0x280500);throw _0x280500;});}return _0x2bf53d;})['then'](respondWithResult(_0x4caed5,0xc9))[_0x47a5('0x28')](handleError(_0x4caed5,null));};exports[_0x47a5('0x14')]=function(_0x331474,_0x23bd8d){if(_0x331474['body']['id']){delete _0x331474[_0x47a5('0x3b')]['id'];}return db['SmsQueue']['find']({'where':{'id':_0x331474['params']['id']}})['then'](handleEntityNotFound(_0x23bd8d,null))[_0x47a5('0x16')](saveUpdates(_0x331474['body'],null))[_0x47a5('0x16')](respondWithResult(_0x23bd8d,null))[_0x47a5('0x28')](handleError(_0x23bd8d,null));};exports[_0x47a5('0x15')]=function(_0x494526,_0x3805fd){return db[_0x47a5('0x25')]['find']({'where':{'id':_0x494526['params']['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x3805fd,null))['then'](removeEntity(_0x3805fd,null))[_0x47a5('0x28')](handleError(_0x3805fd,null));};exports[_0x47a5('0x3c')]=function(_0x188614,_0xd75ca3){return db[_0x47a5('0x25')][_0x47a5('0x3c')]()[_0x47a5('0x16')](respondWithResult(_0xd75ca3,null))[_0x47a5('0x28')](handleError(_0xd75ca3,null));};exports[_0x47a5('0x3d')]=function(_0x162fa0,_0x24ecb1){var _0x3c3ebf={'raw':!![],'where':{}},_0xe28d76={},_0x3574d4;return db[_0x47a5('0x25')][_0x47a5('0x3e')]({'where':{'id':_0x162fa0['params']['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x24ecb1,null))[_0x47a5('0x16')](function(_0x49eab1){if(_0x49eab1){_0x3574d4=_0x49eab1['get']({'plain':!![]});_0xe28d76[_0x47a5('0x2b')]=_['keys'](db[_0x47a5('0x3f')][_0x47a5('0x1f')]);_0xe28d76['query']=_['keys'](_0x162fa0[_0x47a5('0x2c')]);_0xe28d76['filters']=_[_0x47a5('0x2d')](_0xe28d76[_0x47a5('0x2b')],_0xe28d76[_0x47a5('0x2c')]);_0x3c3ebf[_0x47a5('0x2f')]=_[_0x47a5('0x2d')](_0xe28d76[_0x47a5('0x2b')],qs[_0x47a5('0x2e')](_0x162fa0['query']['fields']));_0x3c3ebf[_0x47a5('0x2f')]=_0x3c3ebf[_0x47a5('0x2f')][_0x47a5('0x40')]?_0x3c3ebf[_0x47a5('0x2f')]:_0xe28d76[_0x47a5('0x2b')];if(!_0x162fa0[_0x47a5('0x2c')][_0x47a5('0x41')]('nolimit')){_0x3c3ebf[_0x47a5('0x42')]=qs[_0x47a5('0x42')](_0x162fa0[_0x47a5('0x2c')]['limit']);_0x3c3ebf[_0x47a5('0xf')]=qs['offset'](_0x162fa0[_0x47a5('0x2c')][_0x47a5('0xf')]);}_0x3c3ebf[_0x47a5('0x43')]=qs[_0x47a5('0x44')](_0x162fa0['query'][_0x47a5('0x44')]);_0x3c3ebf[_0x47a5('0x24')]=qs[_0x47a5('0x45')](_[_0x47a5('0x46')](_0x162fa0[_0x47a5('0x2c')],_0xe28d76[_0x47a5('0x45')]));_0x3c3ebf[_0x47a5('0x24')]['SmsQueueId']=_0x49eab1['id'];if(_0x162fa0[_0x47a5('0x2c')][_0x47a5('0x47')]){_0x3c3ebf[_0x47a5('0x24')]=_[_0x47a5('0x31')](_0x3c3ebf[_0x47a5('0x24')],{'$or':_[_0x47a5('0x1e')](_0x3c3ebf['attributes'],function(_0x1ad6a9){var _0x245a15={};_0x245a15[_0x1ad6a9]={'$like':'%'+_0x162fa0[_0x47a5('0x2c')]['filter']+'%'};return _0x245a15;})});}_0x3c3ebf=_[_0x47a5('0x31')]({},_0x3c3ebf,_0x162fa0[_0x47a5('0x32')]);return db[_0x47a5('0x3f')]['findAll'](_0x3c3ebf);}})['then'](function(_0x274e38){if(_0x274e38){return db[_0x47a5('0x48')]['findAndCountAll']({'where':{'id':_['map'](_0x274e38,_0x47a5('0x49')),'role':'agent'},'attributes':['id',_0x47a5('0x1b'),'smsPause','updatedAt',_0x47a5('0x4a')]});}})[_0x47a5('0x16')](function(_0x53eedf){if(_0x53eedf){return{'count':_0x53eedf[_0x47a5('0x11')],'rows':_[_0x47a5('0x1e')](_0x53eedf['rows'],function(_0x5b6127){return{'membername':_0x5b6127[_0x47a5('0x1b')],'UserId':_0x5b6127['id'],'queue_name':_0x3574d4[_0x47a5('0x1b')],'SmsQueueId':_0x3574d4['id'],'interface':util[_0x47a5('0x4b')](_0x47a5('0x4c'),'SIP',_0x5b6127[_0x47a5('0x1b')]),'penalty':0x0,'paused':_0x5b6127[_0x47a5('0x4d')],'createdAt':_0x5b6127[_0x47a5('0x4a')],'updatedAt':_0x5b6127['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x47a5('0x16')](respondWithFilteredResult(_0x24ecb1,_0x3c3ebf))['catch'](handleError(_0x24ecb1,null));};exports[_0x47a5('0x4e')]=function(_0x470da6,_0x943a15){var _0x1c485b={};var _0x3603b7={};var _0x4966af;var _0x144af9;return db['SmsQueue']['findOne']({'where':{'id':_0x470da6['params']['id']}})['then'](handleEntityNotFound(_0x943a15,null))[_0x47a5('0x16')](function(_0x6cd4ea){if(_0x6cd4ea){_0x4966af=_0x6cd4ea;_0x3603b7[_0x47a5('0x2b')]=_['keys'](db['Team'][_0x47a5('0x1f')]);_0x3603b7[_0x47a5('0x2c')]=_[_0x47a5('0x4f')](_0x470da6[_0x47a5('0x2c')]);_0x3603b7[_0x47a5('0x45')]=_['intersection'](_0x3603b7[_0x47a5('0x2b')],_0x3603b7['query']);_0x1c485b[_0x47a5('0x2f')]=_[_0x47a5('0x2d')](_0x3603b7['model'],qs[_0x47a5('0x2e')](_0x470da6[_0x47a5('0x2c')][_0x47a5('0x2e')]));_0x1c485b[_0x47a5('0x2f')]=_0x1c485b[_0x47a5('0x2f')][_0x47a5('0x40')]?_0x1c485b[_0x47a5('0x2f')]:_0x3603b7[_0x47a5('0x2b')];_0x1c485b['order']=qs[_0x47a5('0x44')](_0x470da6[_0x47a5('0x2c')][_0x47a5('0x44')]);_0x1c485b[_0x47a5('0x24')]=qs[_0x47a5('0x45')](_['pick'](_0x470da6[_0x47a5('0x2c')],_0x3603b7[_0x47a5('0x45')]));if(_0x470da6[_0x47a5('0x2c')][_0x47a5('0x47')]){_0x1c485b[_0x47a5('0x24')]=_[_0x47a5('0x31')](_0x1c485b[_0x47a5('0x24')],{'$or':_[_0x47a5('0x1e')](_0x1c485b[_0x47a5('0x2f')],function(_0x44cb90){var _0x1d56f3={};_0x1d56f3[_0x44cb90]={'$like':'%'+_0x470da6[_0x47a5('0x2c')][_0x47a5('0x47')]+'%'};return _0x1d56f3;})});}_0x1c485b=_[_0x47a5('0x31')]({},_0x1c485b,_0x470da6[_0x47a5('0x32')]);return _0x4966af['getTeams'](_0x1c485b);}})[_0x47a5('0x16')](function(_0x284fb8){if(_0x284fb8){_0x144af9=_0x284fb8[_0x47a5('0x40')];if(!_0x470da6['query'][_0x47a5('0x41')](_0x47a5('0x50'))){_0x1c485b[_0x47a5('0x42')]=qs[_0x47a5('0x42')](_0x470da6['query'][_0x47a5('0x42')]);_0x1c485b['offset']=qs[_0x47a5('0xf')](_0x470da6['query'][_0x47a5('0xf')]);}return _0x4966af['getTeams'](_0x1c485b);}})[_0x47a5('0x16')](function(_0x2f27c3){if(_0x2f27c3){return _0x2f27c3?{'count':_0x144af9,'rows':_0x2f27c3}:null;}})[_0x47a5('0x16')](respondWithResult(_0x943a15,null))['catch'](handleError(_0x943a15,null));};exports['addTeams']=function(_0x4b8084,_0x4164a3){var _0x2b1303=_0x4b8084[_0x47a5('0x3b')][_0x47a5('0x51')];return db['Team'][_0x47a5('0x52')]({'where':{'id':_0x2b1303},'attributes':['id'],'include':[{'model':db[_0x47a5('0x48')],'as':_0x47a5('0x53'),'attributes':['id',_0x47a5('0x1b'),_0x47a5('0x54'),_0x47a5('0x55'),_0x47a5('0x56')],'raw':!![]}]})[_0x47a5('0x16')](function(_0x4618a0){if(_0x4618a0){var _0xc69a68=_[_0x47a5('0x57')](_0x4618a0,function(_0x463e5e){var _0x49d3dc=_0x463e5e[_0x47a5('0x17')]({'plain':!![]});return _0x49d3dc['Agents'];});return db[_0x47a5('0x25')][_0x47a5('0x33')]({'where':{'id':_0x4b8084[_0x47a5('0x2a')]['id']}})[_0x47a5('0x16')](function(_0x40e584){return db[_0x47a5('0x58')][_0x47a5('0x59')](function(_0x448981){return _0x40e584[_0x47a5('0x5a')](_0x2b1303,{'transaction':_0x448981})[_0x47a5('0x16')](function(){return BPromise[_0x47a5('0x5b')](_0xc69a68,function(_0x1f07ac){return db[_0x47a5('0x3f')][_0x47a5('0x5c')]({'where':{'UserId':_0x1f07ac['id'],'SmsQueueId':_0x4b8084[_0x47a5('0x2a')]['id']},'transaction':_0x448981});});})['then'](function(){_0xc69a68['forEach'](function(_0x5ccc89){socket['emit'](_0x47a5('0x5d'),{'UserId':_0x5ccc89['id'],'SmsQueueId':_0x40e584['id']});});});});});}})[_0x47a5('0x16')](respondWithStatusCode(_0x4164a3,null))['catch'](handleError(_0x4164a3,null));};exports[_0x47a5('0x5e')]=function(_0x44dda2,_0x1baa5a){return db[_0x47a5('0x5f')][_0x47a5('0x52')]({'where':{'id':_0x44dda2[_0x47a5('0x2c')][_0x47a5('0x51')]},'attributes':['id'],'include':[{'model':db[_0x47a5('0x48')],'as':_0x47a5('0x53'),'attributes':['id'],'raw':!![]}]})[_0x47a5('0x16')](handleEntityNotFound(_0x1baa5a,null))[_0x47a5('0x16')](function(_0x5e5f16){var _0x18fa31=_[_0x47a5('0x1e')](_0x5e5f16,'id');var _0x420671=[];var _0x4f35ff=[];var _0x340846=squel[_0x47a5('0x60')]();_0x340846[_0x47a5('0x61')]('tq.TeamId')[_0x47a5('0x62')]('team_has_sms_queues','tq')['join'](_0x47a5('0x63'),'ut',_0x47a5('0x64'))[_0x47a5('0x24')](_0x47a5('0x65'),_0x44dda2[_0x47a5('0x2a')]['id']);for(var _0xea50f3=0x0;_0xea50f3<_0x5e5f16['length'];_0xea50f3+=0x1){let _0x592322=_0x5e5f16[_0xea50f3];for(var _0x3e0dbd=0x0;_0x3e0dbd<_0x592322['Agents'][_0x47a5('0x40')];_0x3e0dbd+=0x1){let _0x3fffd1=_0x592322[_0x47a5('0x53')][_0x3e0dbd];var _0xb16bdd=_0x340846['clone']();_0xb16bdd[_0x47a5('0x24')]('ut.UserId\x20=\x20?',_0x3fffd1['id']);_0x4f35ff['push'](db[_0x47a5('0x58')][_0x47a5('0x2c')](_0xb16bdd['toString'](),{'type':db[_0x47a5('0x58')][_0x47a5('0x66')][_0x47a5('0x67')]})['then'](function(_0x280372){if(_0x280372['length']===0x1){return _0x3fffd1['id'];}else{var _0x2307da=_[_0x47a5('0x68')](_[_0x47a5('0x1e')](_0x280372,'TeamId'),function(_0x2e0af1){return _[_0x47a5('0x69')](_0x18fa31,_0x2e0af1);});if(_0x2307da){return _0x3fffd1['id'];}}}));}}return BPromise[_0x47a5('0x6a')](_0x4f35ff)['then'](function(_0x3525e7){_0x420671=_(_0x420671)['union'](_0x3525e7)[_0x47a5('0x6b')]()['value']();return db[_0x47a5('0x25')][_0x47a5('0x33')]({'where':{'id':_0x44dda2[_0x47a5('0x2a')]['id']}})[_0x47a5('0x16')](function(_0x51738b){return db[_0x47a5('0x58')][_0x47a5('0x59')](function(_0x23c393){return _0x51738b[_0x47a5('0x5e')](_0x44dda2[_0x47a5('0x2c')]['ids'],{'transaction':_0x23c393})['then'](function(){if(!_[_0x47a5('0x6c')](_0x420671)){return _0x51738b['removeAgents'](_0x420671,{'transaction':_0x23c393});}})[_0x47a5('0x16')](function(){_0x420671[_0x47a5('0x6d')](function(_0x216402){socket['emit'](_0x47a5('0x6e'),{'UserId':_0x216402,'SmsQueueId':_0x51738b['id']});});});});});});})[_0x47a5('0x16')](respondWithStatusCode(_0x1baa5a,null))['catch'](handleError(_0x1baa5a,null));};exports[_0x47a5('0x6f')]=function(_0x8a9dea,_0x19acfa){return db[_0x47a5('0x25')]['find']({'where':{'id':_0x8a9dea['params']['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x19acfa,null))[_0x47a5('0x16')](function(_0x48e7f3){if(_0x48e7f3){return _0x48e7f3[_0x47a5('0x6f')](_0x8a9dea[_0x47a5('0x3b')]['ids'],_[_0x47a5('0x70')](_0x8a9dea[_0x47a5('0x3b')],[_0x47a5('0x51'),'id'])||{})['spread'](function(_0x3f2ad9){for(var _0x59b4a5=0x0;_0x59b4a5<_0x8a9dea[_0x47a5('0x3b')]['ids'][_0x47a5('0x40')];_0x59b4a5+=0x1){socket[_0x47a5('0x71')]('userSmsQueue:save',{'UserId':Number(_0x8a9dea[_0x47a5('0x3b')]['ids'][_0x59b4a5]),'SmsQueueId':Number(_0x8a9dea[_0x47a5('0x2a')]['id'])});}return _0x3f2ad9;});}})[_0x47a5('0x16')](respondWithResult(_0x19acfa,null))[_0x47a5('0x28')](handleError(_0x19acfa,null));};exports[_0x47a5('0x72')]=function(_0x49b76a,_0x3eb5c1){return db['SmsQueue']['find']({'where':{'id':_0x49b76a[_0x47a5('0x2a')]['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x3eb5c1,null))[_0x47a5('0x16')](function(_0x96fb22){if(_0x96fb22){return _0x96fb22[_0x47a5('0x72')](_0x49b76a['query'][_0x47a5('0x51')])[_0x47a5('0x16')](function(){if(_[_0x47a5('0x73')](_0x49b76a[_0x47a5('0x2c')]['ids'])){for(var _0x240db9=0x0;_0x240db9<_0x49b76a['query'][_0x47a5('0x51')][_0x47a5('0x40')];_0x240db9+=0x1){socket[_0x47a5('0x71')](_0x47a5('0x6e'),{'UserId':Number(_0x49b76a[_0x47a5('0x2c')][_0x47a5('0x51')][_0x240db9]),'SmsQueueId':Number(_0x49b76a[_0x47a5('0x2a')]['id'])});}}else{socket[_0x47a5('0x71')](_0x47a5('0x6e'),{'UserId':Number(_0x49b76a['query'][_0x47a5('0x51')]),'SmsQueueId':Number(_0x49b76a[_0x47a5('0x2a')]['id'])});}});}})['then'](respondWithStatusCode(_0x3eb5c1,null))[_0x47a5('0x28')](handleError(_0x3eb5c1,null));};exports[_0x47a5('0x74')]=function(_0x6d6a5,_0x5b85cd){var _0x4bf1f5={};var _0x126bb1={};var _0x3d7371;var _0x47fbb6;return db['SmsQueue'][_0x47a5('0x3e')]({'where':{'id':_0x6d6a5[_0x47a5('0x2a')]['id']}})['then'](handleEntityNotFound(_0x5b85cd,null))[_0x47a5('0x16')](function(_0x269ff6){if(_0x269ff6){_0x3d7371=_0x269ff6;_0x126bb1['model']=_[_0x47a5('0x4f')](db[_0x47a5('0x48')][_0x47a5('0x1f')]);_0x126bb1[_0x47a5('0x2c')]=_[_0x47a5('0x4f')](_0x6d6a5[_0x47a5('0x2c')]);_0x126bb1['filters']=_['intersection'](_0x126bb1['model'],_0x126bb1[_0x47a5('0x2c')]);_0x4bf1f5[_0x47a5('0x2f')]=_['intersection'](_0x126bb1[_0x47a5('0x2b')],qs[_0x47a5('0x2e')](_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0x2e')]));_0x4bf1f5[_0x47a5('0x2f')]=_0x4bf1f5['attributes'][_0x47a5('0x40')]?_0x4bf1f5['attributes']:_0x126bb1['model'];_0x4bf1f5['order']=qs[_0x47a5('0x44')](_0x6d6a5['query'][_0x47a5('0x44')]);_0x4bf1f5[_0x47a5('0x24')]=qs[_0x47a5('0x45')](_['pick'](_0x6d6a5[_0x47a5('0x2c')],_0x126bb1[_0x47a5('0x45')]));if(_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0x47')]){_0x4bf1f5[_0x47a5('0x24')]=_['merge'](_0x4bf1f5[_0x47a5('0x24')],{'$or':_[_0x47a5('0x1e')](_0x4bf1f5['attributes'],function(_0x42ba59){var _0x419870={};_0x419870[_0x42ba59]={'$like':'%'+_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0x47')]+'%'};return _0x419870;})});}_0x4bf1f5=_[_0x47a5('0x31')]({},_0x4bf1f5,_0x6d6a5[_0x47a5('0x32')]);return _0x3d7371['getAgents'](_0x4bf1f5);}})[_0x47a5('0x16')](function(_0x2e418d){if(_0x2e418d){_0x47fbb6=_0x2e418d['length'];if(!_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0x41')](_0x47a5('0x50'))){_0x4bf1f5[_0x47a5('0x42')]=qs['limit'](_0x6d6a5['query']['limit']);_0x4bf1f5['offset']=qs[_0x47a5('0xf')](_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0xf')]);}return _0x3d7371[_0x47a5('0x74')](_0x4bf1f5);}})[_0x47a5('0x16')](function(_0x6bc37b){if(_0x6bc37b){return _0x6bc37b?{'count':_0x47fbb6,'rows':_0x6bc37b}:null;}})[_0x47a5('0x16')](respondWithResult(_0x5b85cd,null))[_0x47a5('0x28')](handleError(_0x5b85cd,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index ae39cae..512a32f 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 _0x9e03=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x7aaceb,_0x12a2c0){var _0x2e720b=function(_0x38383a){while(--_0x38383a){_0x7aaceb['push'](_0x7aaceb['shift']());}};_0x2e720b(++_0x12a2c0);}(_0x9e03,0xbf));var _0x39e0=function(_0x4976f0,_0x12f9a6){_0x4976f0=_0x4976f0-0x0;var _0x28b168=_0x9e03[_0x4976f0];return _0x28b168;};'use strict';var EventEmitter=require(_0x39e0('0x0'));var SmsQueue=require('../../mysqldb')['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x39e0('0x1')](0x0);var events={'afterCreate':_0x39e0('0x2'),'afterUpdate':_0x39e0('0x3'),'afterDestroy':_0x39e0('0x4')};function emitEvent(_0x37d361){return function(_0x21d971,_0x29784e,_0x4e6dfc){SmsQueueEvents[_0x39e0('0x5')](_0x37d361+':'+_0x21d971['id'],_0x21d971);SmsQueueEvents[_0x39e0('0x5')](_0x37d361,_0x21d971);_0x4e6dfc(null);};}for(var e in events){if(events[_0x39e0('0x6')](e)){var event=events[e];SmsQueue[_0x39e0('0x7')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file +var _0x5355=['exports','events','SmsQueue','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x3f00ce,_0xb4ec77){var _0x2748bd=function(_0x1e31fb){while(--_0x1e31fb){_0x3f00ce['push'](_0x3f00ce['shift']());}};_0x2748bd(++_0xb4ec77);}(_0x5355,0x91));var _0x5535=function(_0x11946c,_0x12152c){_0x11946c=_0x11946c-0x0;var _0x383935=_0x5355[_0x11946c];return _0x383935;};'use strict';var EventEmitter=require(_0x5535('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0x5535('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x5535('0x2')](0x0);var events={'afterCreate':_0x5535('0x3'),'afterUpdate':'update','afterDestroy':_0x5535('0x4')};function emitEvent(_0x39b030){return function(_0x20c686,_0x4adc95,_0x38c24f){SmsQueueEvents['emit'](_0x39b030+':'+_0x20c686['id'],_0x20c686);SmsQueueEvents[_0x5535('0x5')](_0x39b030,_0x20c686);_0x38c24f(null);};}for(var e in events){if(events[_0x5535('0x6')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x5535('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 a87e2e6..62755c4 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 _0xa792=['define','SmsQueue','util','../../config/logger','api','moment','bluebird','request-promise','path','exports'];(function(_0x3064e7,_0x34edba){var _0x26038e=function(_0x35336c){while(--_0x35336c){_0x3064e7['push'](_0x3064e7['shift']());}};_0x26038e(++_0x34edba);}(_0xa792,0x142));var _0x2a79=function(_0x3eb36f,_0x2395a5){_0x3eb36f=_0x3eb36f-0x0;var _0x2bf875=_0xa792[_0x3eb36f];return _0x2bf875;};'use strict';var _=require('lodash');var util=require(_0x2a79('0x0'));var logger=require(_0x2a79('0x1'))(_0x2a79('0x2'));var moment=require(_0x2a79('0x3'));var BPromise=require(_0x2a79('0x4'));var rp=require(_0x2a79('0x5'));var fs=require('fs');var path=require(_0x2a79('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./smsQueue.attributes');module[_0x2a79('0x7')]=function(_0x5363b4,_0x20c6cb){return _0x5363b4[_0x2a79('0x8')](_0x2a79('0x9'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x786b=['request-promise','rimraf','../../config/environment','./smsQueue.attributes','define','SmsQueue','lodash','../../config/logger','api','moment'];(function(_0x1bd323,_0x1c16ab){var _0x13097b=function(_0x4cc5de){while(--_0x4cc5de){_0x1bd323['push'](_0x1bd323['shift']());}};_0x13097b(++_0x1c16ab);}(_0x786b,0xb0));var _0xb786=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x786b[_0x29d94e];return _0x106237;};'use strict';var _=require(_0xb786('0x0'));var util=require('util');var logger=require(_0xb786('0x1'))(_0xb786('0x2'));var moment=require(_0xb786('0x3'));var BPromise=require('bluebird');var rp=require(_0xb786('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb786('0x5'));var config=require(_0xb786('0x6'));var attributes=require(_0xb786('0x7'));module['exports']=function(_0x56e132,_0x2991bd){return _0x56e132[_0xb786('0x8')](_0xb786('0x9'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index 14357f9..c0c73c3 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 _0xa2cd=['options','attributes','limit','map','include','model','then','catch','ShowSmsQueue','find','raw','where','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./smsQueue.socket','request','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetSmsQueue','SmsQueue','findAll'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa2cd,0x192));var _0xda2c=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xa2cd[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0xda2c('0x0'));var util=require(_0xda2c('0x1'));var moment=require(_0xda2c('0x2'));var BPromise=require(_0xda2c('0x3'));var rs=require(_0xda2c('0x4'));var fs=require('fs');var Redis=require(_0xda2c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xda2c('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xda2c('0x7'));var jayson=require(_0xda2c('0x8'));var client=jayson[_0xda2c('0x9')][_0xda2c('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xda2c('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xda2c('0xc'))(new Redis(config[_0xda2c('0xb')]));require(_0xda2c('0xd'))['register'](socket);function respondWithRpcPromise(_0x2f62ba,_0x3c24d7,_0x2ece7b){return new BPromise(function(_0x170dc7,_0x240c84){return client[_0xda2c('0xe')](_0x2f62ba,_0x2ece7b)['then'](function(_0x14ff21){logger[_0xda2c('0xf')](_0xda2c('0x10'),_0x3c24d7,_0xda2c('0x11'));logger[_0xda2c('0x12')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x3c24d7,_0xda2c('0x11'),JSON[_0xda2c('0x13')](_0x14ff21));if(_0x14ff21[_0xda2c('0x14')]){if(_0x14ff21[_0xda2c('0x14')][_0xda2c('0x15')]===0x1f4){logger[_0xda2c('0x14')](_0xda2c('0x10'),_0x3c24d7,_0x14ff21[_0xda2c('0x14')]['message']);return _0x240c84(_0x14ff21[_0xda2c('0x14')]['message']);}logger['error'](_0xda2c('0x10'),_0x3c24d7,_0x14ff21[_0xda2c('0x14')]['message']);return _0x170dc7(_0x14ff21[_0xda2c('0x14')][_0xda2c('0x16')]);}else{logger[_0xda2c('0xf')](_0xda2c('0x10'),_0x3c24d7,'request\x20sent');_0x170dc7(_0x14ff21[_0xda2c('0x17')][_0xda2c('0x16')]);}})['catch'](function(_0x3744e6){logger[_0xda2c('0x14')]('SmsQueue,\x20%s,\x20%s',_0x3c24d7,_0x3744e6);_0x240c84(_0x3744e6);});});}exports[_0xda2c('0x18')]=function(_0x557a3b){var _0x2682ca=this;return new Promise(function(_0x1828e1,_0x106b14){return db[_0xda2c('0x19')][_0xda2c('0x1a')]({'raw':_0x557a3b[_0xda2c('0x1b')]?_0x557a3b['options']['raw']===undefined?!![]:![]:!![],'where':_0x557a3b[_0xda2c('0x1b')]?_0x557a3b['options']['where']||null:null,'attributes':_0x557a3b[_0xda2c('0x1b')]?_0x557a3b[_0xda2c('0x1b')][_0xda2c('0x1c')]||null:null,'limit':_0x557a3b['options']?_0x557a3b[_0xda2c('0x1b')][_0xda2c('0x1d')]||null:null,'include':_0x557a3b[_0xda2c('0x1b')]?_0x557a3b[_0xda2c('0x1b')]['include']?_[_0xda2c('0x1e')](_0x557a3b[_0xda2c('0x1b')][_0xda2c('0x1f')],function(_0x2b53a3){return{'model':db[_0x2b53a3['model']],'as':_0x2b53a3['as'],'attributes':_0x2b53a3[_0xda2c('0x1c')],'include':_0x2b53a3[_0xda2c('0x1f')]?_[_0xda2c('0x1e')](_0x2b53a3[_0xda2c('0x1f')],function(_0x1f3946){return{'model':db[_0x1f3946[_0xda2c('0x20')]],'as':_0x1f3946['as'],'attributes':_0x1f3946[_0xda2c('0x1c')],'include':_0x1f3946[_0xda2c('0x1f')]?_[_0xda2c('0x1e')](_0x1f3946[_0xda2c('0x1f')],function(_0xccf7ea){return{'model':db[_0xccf7ea[_0xda2c('0x20')]],'as':_0xccf7ea['as'],'attributes':_0xccf7ea[_0xda2c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xda2c('0x21')](function(_0x2937f9){logger[_0xda2c('0xf')](_0xda2c('0x18'),_0x557a3b);logger[_0xda2c('0x12')](_0xda2c('0x18'),_0x557a3b,JSON[_0xda2c('0x13')](_0x2937f9));_0x1828e1(_0x2937f9);})[_0xda2c('0x22')](function(_0x18b18a){logger['error'](_0xda2c('0x18'),_0x18b18a['message'],_0x557a3b);_0x106b14(_0x2682ca[_0xda2c('0x14')](0x1f4,_0x18b18a[_0xda2c('0x16')]));});});};exports[_0xda2c('0x23')]=function(_0x57bceb){var _0x3bfde9=this;return new Promise(function(_0x4b944a,_0x9e02ed){return db['SmsQueue'][_0xda2c('0x24')]({'raw':_0x57bceb['options']?_0x57bceb[_0xda2c('0x1b')][_0xda2c('0x25')]===undefined?!![]:![]:!![],'where':_0x57bceb[_0xda2c('0x1b')]?_0x57bceb['options'][_0xda2c('0x26')]||null:null,'attributes':_0x57bceb[_0xda2c('0x1b')]?_0x57bceb[_0xda2c('0x1b')]['attributes']||null:null,'include':_0x57bceb[_0xda2c('0x1b')]?_0x57bceb['options'][_0xda2c('0x1f')]?_['map'](_0x57bceb[_0xda2c('0x1b')][_0xda2c('0x1f')],function(_0x243e91){return{'model':db[_0x243e91['model']],'as':_0x243e91['as'],'attributes':_0x243e91[_0xda2c('0x1c')],'include':_0x243e91['include']?_[_0xda2c('0x1e')](_0x243e91[_0xda2c('0x1f')],function(_0x5480a7){return{'model':db[_0x5480a7[_0xda2c('0x20')]],'as':_0x5480a7['as'],'attributes':_0x5480a7[_0xda2c('0x1c')],'include':_0x5480a7[_0xda2c('0x1f')]?_[_0xda2c('0x1e')](_0x5480a7[_0xda2c('0x1f')],function(_0x328f18){return{'model':db[_0x328f18[_0xda2c('0x20')]],'as':_0x328f18['as'],'attributes':_0x328f18['attributes']};}):[]};}):[]};}):[]:[]})[_0xda2c('0x21')](function(_0x1addeb){logger[_0xda2c('0xf')](_0xda2c('0x23'),_0x57bceb);logger[_0xda2c('0x12')](_0xda2c('0x23'),_0x57bceb,JSON['stringify'](_0x1addeb));_0x4b944a(_0x1addeb);})['catch'](function(_0x566bd4){logger[_0xda2c('0x14')](_0xda2c('0x23'),_0x566bd4[_0xda2c('0x16')],_0x57bceb);_0x9e02ed(_0x3bfde9[_0xda2c('0x14')](0x1f4,_0x566bd4[_0xda2c('0x16')]));});});}; \ No newline at end of file +var _0xa81e=['localhost','./smsQueue.socket','register','request','then','SmsQueue,\x20%s,\x20%s','debug','stringify','error','code','message','info','request\x20sent','result','catch','GetSmsQueue','SmsQueue','options','raw','where','attributes','limit','include','map','model','ShowSmsQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','defaults','redis'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0xa81e,0xe8));var _0xea81=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xa81e[_0x46698a];return _0x356db0;};'use strict';var _=require(_0xea81('0x0'));var util=require(_0xea81('0x1'));var moment=require(_0xea81('0x2'));var BPromise=require(_0xea81('0x3'));var rs=require(_0xea81('0x4'));var fs=require('fs');var Redis=require(_0xea81('0x5'));var db=require(_0xea81('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xea81('0x7'))(_0xea81('0x8'));var config=require(_0xea81('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xea81('0xa')][_0xea81('0xb')]({'port':0x232a});config['redis']=_[_0xea81('0xc')](config[_0xea81('0xd')],{'host':_0xea81('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xea81('0xd')]));require(_0xea81('0xf'))[_0xea81('0x10')](socket);function respondWithRpcPromise(_0x37ff52,_0x237d11,_0x123ed5){return new BPromise(function(_0x45e63d,_0x2ba255){return client[_0xea81('0x11')](_0x37ff52,_0x123ed5)[_0xea81('0x12')](function(_0x5d7b70){logger['info'](_0xea81('0x13'),_0x237d11,'request\x20sent');logger[_0xea81('0x14')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x237d11,'request\x20sent',JSON[_0xea81('0x15')](_0x5d7b70));if(_0x5d7b70[_0xea81('0x16')]){if(_0x5d7b70[_0xea81('0x16')][_0xea81('0x17')]===0x1f4){logger[_0xea81('0x16')](_0xea81('0x13'),_0x237d11,_0x5d7b70[_0xea81('0x16')][_0xea81('0x18')]);return _0x2ba255(_0x5d7b70[_0xea81('0x16')][_0xea81('0x18')]);}logger[_0xea81('0x16')]('SmsQueue,\x20%s,\x20%s',_0x237d11,_0x5d7b70[_0xea81('0x16')][_0xea81('0x18')]);return _0x45e63d(_0x5d7b70[_0xea81('0x16')][_0xea81('0x18')]);}else{logger[_0xea81('0x19')](_0xea81('0x13'),_0x237d11,_0xea81('0x1a'));_0x45e63d(_0x5d7b70[_0xea81('0x1b')][_0xea81('0x18')]);}})[_0xea81('0x1c')](function(_0x7d8506){logger[_0xea81('0x16')](_0xea81('0x13'),_0x237d11,_0x7d8506);_0x2ba255(_0x7d8506);});});}exports[_0xea81('0x1d')]=function(_0x33080b){var _0x78efe2=this;return new Promise(function(_0x4441ad,_0x5562d3){return db[_0xea81('0x1e')]['findAll']({'raw':_0x33080b[_0xea81('0x1f')]?_0x33080b[_0xea81('0x1f')][_0xea81('0x20')]===undefined?!![]:![]:!![],'where':_0x33080b['options']?_0x33080b[_0xea81('0x1f')][_0xea81('0x21')]||null:null,'attributes':_0x33080b[_0xea81('0x1f')]?_0x33080b[_0xea81('0x1f')][_0xea81('0x22')]||null:null,'limit':_0x33080b[_0xea81('0x1f')]?_0x33080b[_0xea81('0x1f')][_0xea81('0x23')]||null:null,'include':_0x33080b[_0xea81('0x1f')]?_0x33080b[_0xea81('0x1f')][_0xea81('0x24')]?_[_0xea81('0x25')](_0x33080b[_0xea81('0x1f')][_0xea81('0x24')],function(_0x31edff){return{'model':db[_0x31edff[_0xea81('0x26')]],'as':_0x31edff['as'],'attributes':_0x31edff[_0xea81('0x22')],'include':_0x31edff['include']?_[_0xea81('0x25')](_0x31edff[_0xea81('0x24')],function(_0x2046d0){return{'model':db[_0x2046d0[_0xea81('0x26')]],'as':_0x2046d0['as'],'attributes':_0x2046d0['attributes'],'include':_0x2046d0[_0xea81('0x24')]?_[_0xea81('0x25')](_0x2046d0['include'],function(_0x5432b3){return{'model':db[_0x5432b3['model']],'as':_0x5432b3['as'],'attributes':_0x5432b3[_0xea81('0x22')]};}):[]};}):[]};}):[]:[]})[_0xea81('0x12')](function(_0x473cd6){logger[_0xea81('0x19')](_0xea81('0x1d'),_0x33080b);logger[_0xea81('0x14')](_0xea81('0x1d'),_0x33080b,JSON[_0xea81('0x15')](_0x473cd6));_0x4441ad(_0x473cd6);})['catch'](function(_0x2a92eb){logger[_0xea81('0x16')]('GetSmsQueue',_0x2a92eb[_0xea81('0x18')],_0x33080b);_0x5562d3(_0x78efe2[_0xea81('0x16')](0x1f4,_0x2a92eb[_0xea81('0x18')]));});});};exports[_0xea81('0x27')]=function(_0x4fdf4b){var _0x144ab6=this;return new Promise(function(_0x385017,_0x238b27){return db[_0xea81('0x1e')][_0xea81('0x28')]({'raw':_0x4fdf4b[_0xea81('0x1f')]?_0x4fdf4b[_0xea81('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x4fdf4b[_0xea81('0x1f')]?_0x4fdf4b['options']['where']||null:null,'attributes':_0x4fdf4b[_0xea81('0x1f')]?_0x4fdf4b['options'][_0xea81('0x22')]||null:null,'include':_0x4fdf4b['options']?_0x4fdf4b[_0xea81('0x1f')][_0xea81('0x24')]?_[_0xea81('0x25')](_0x4fdf4b[_0xea81('0x1f')][_0xea81('0x24')],function(_0x26a198){return{'model':db[_0x26a198['model']],'as':_0x26a198['as'],'attributes':_0x26a198['attributes'],'include':_0x26a198[_0xea81('0x24')]?_[_0xea81('0x25')](_0x26a198['include'],function(_0x2d32a8){return{'model':db[_0x2d32a8[_0xea81('0x26')]],'as':_0x2d32a8['as'],'attributes':_0x2d32a8[_0xea81('0x22')],'include':_0x2d32a8[_0xea81('0x24')]?_[_0xea81('0x25')](_0x2d32a8[_0xea81('0x24')],function(_0xe75cc2){return{'model':db[_0xe75cc2['model']],'as':_0xe75cc2['as'],'attributes':_0xe75cc2[_0xea81('0x22')]};}):[]};}):[]};}):[]:[]})[_0xea81('0x12')](function(_0xa4dba2){logger['info'](_0xea81('0x27'),_0x4fdf4b);logger[_0xea81('0x14')](_0xea81('0x27'),_0x4fdf4b,JSON[_0xea81('0x15')](_0xa4dba2));_0x385017(_0xa4dba2);})[_0xea81('0x1c')](function(_0x463a39){logger['error'](_0xea81('0x27'),_0x463a39[_0xea81('0x18')],_0x4fdf4b);_0x238b27(_0x144ab6[_0xea81('0x16')](0x1f4,_0x463a39[_0xea81('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index bd66335..d423368 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 _0x3400=['update','removeListener','register','remove'];(function(_0x506eaf,_0x36ea1b){var _0x20ec47=function(_0x25ce86){while(--_0x25ce86){_0x506eaf['push'](_0x506eaf['shift']());}};_0x20ec47(++_0x36ea1b);}(_0x3400,0xd3));var _0x0340=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0x3400[_0xbe200f];return _0x192597;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=['save',_0x0340('0x0'),_0x0340('0x1')];function createListener(_0x2bfa63,_0x3d2e0b){return function(_0x145b9a){_0x3d2e0b['emit'](_0x2bfa63,_0x145b9a);};}function removeListener(_0x466ef5,_0x54f7e1){return function(){SmsQueueEvents[_0x0340('0x2')](_0x466ef5,_0x54f7e1);};}exports[_0x0340('0x3')]=function(_0x17e668){for(var _0x20fabe=0x0,_0x1686ea=events['length'];_0x20fabe<_0x1686ea;_0x20fabe++){var _0x59a9ed=events[_0x20fabe];var _0x133d77=createListener('smsQueue:'+_0x59a9ed,_0x17e668);SmsQueueEvents['on'](_0x59a9ed,_0x133d77);}}; \ No newline at end of file +var _0x8873=['removeListener','register','length','smsQueue:','./smsQueue.events','save','update'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x8873,0x18c));var _0x3887=function(_0xc4e092,_0x5059f7){_0xc4e092=_0xc4e092-0x0;var _0xa4f542=_0x8873[_0xc4e092];return _0xa4f542;};'use strict';var SmsQueueEvents=require(_0x3887('0x0'));var events=[_0x3887('0x1'),'remove',_0x3887('0x2')];function createListener(_0x416ac1,_0x200cdd){return function(_0xb77c51){_0x200cdd['emit'](_0x416ac1,_0xb77c51);};}function removeListener(_0x5469d4,_0x46f0bc){return function(){SmsQueueEvents[_0x3887('0x3')](_0x5469d4,_0x46f0bc);};}exports[_0x3887('0x4')]=function(_0x3e965f){for(var _0x323bdb=0x0,_0x2bcf65=events[_0x3887('0x5')];_0x323bdb<_0x2bcf65;_0x323bdb++){var _0x134f0b=events[_0x323bdb];var _0x41593d=createListener(_0x3887('0x6')+_0x134f0b,_0x3e965f);SmsQueueEvents['on'](_0x134f0b,_0x41593d);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index ecdb038..6d07b50 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 _0xa496=['create','put','update','delete','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id'];(function(_0x2a63ba,_0x150e5c){var _0x82234b=function(_0x49897c){while(--_0x49897c){_0x2a63ba['push'](_0x2a63ba['shift']());}};_0x82234b(++_0x150e5c);}(_0xa496,0x1b7));var _0x6a49=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa496[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6a49('0x0'));var timeout=require(_0x6a49('0x1'));var express=require(_0x6a49('0x2'));var router=express[_0x6a49('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6a49('0x4'));var interaction=require(_0x6a49('0x5'));var config=require(_0x6a49('0x6'));var controller=require('./smsQueueReport.controller');router[_0x6a49('0x7')]('/',auth[_0x6a49('0x8')](),controller['index']);router['get'](_0x6a49('0x9'),auth[_0x6a49('0x8')](),controller['describe']);router[_0x6a49('0x7')](_0x6a49('0xa'),auth[_0x6a49('0x8')](),controller['show']);router['post']('/',auth[_0x6a49('0x8')](),controller[_0x6a49('0xb')]);router[_0x6a49('0xc')](_0x6a49('0xa'),auth[_0x6a49('0x8')](),controller[_0x6a49('0xd')]);router[_0x6a49('0xe')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x7710=['express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','exports','util','connect-timeout'];(function(_0x595a55,_0x3ae7ab){var _0x505347=function(_0xbb3a4e){while(--_0xbb3a4e){_0x595a55['push'](_0x595a55['shift']());}};_0x505347(++_0x3ae7ab);}(_0x7710,0x130));var _0x0771=function(_0x3af1ee,_0x2c54b1){_0x3af1ee=_0x3af1ee-0x0;var _0x49cbcf=_0x7710[_0x3af1ee];return _0x49cbcf;};'use strict';var multer=require('multer');var util=require(_0x0771('0x0'));var path=require('path');var timeout=require(_0x0771('0x1'));var express=require(_0x0771('0x2'));var router=express[_0x0771('0x3')]();var fs_extra=require(_0x0771('0x4'));var auth=require(_0x0771('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./smsQueueReport.controller');router[_0x0771('0x6')]('/',auth[_0x0771('0x7')](),controller[_0x0771('0x8')]);router[_0x0771('0x6')](_0x0771('0x9'),auth['isAuthenticated'](),controller[_0x0771('0xa')]);router[_0x0771('0x6')](_0x0771('0xb'),auth[_0x0771('0x7')](),controller[_0x0771('0xc')]);router['post']('/',auth[_0x0771('0x7')](),controller[_0x0771('0xd')]);router[_0x0771('0xe')]('/:id',auth[_0x0771('0x7')](),controller[_0x0771('0xf')]);router[_0x0771('0x10')](_0x0771('0xb'),auth[_0x0771('0x7')](),controller['destroy']);module[_0x0771('0x11')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 33cf87a..9225f74 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 _0xde71=['STRING','moment','sequelize','exports'];(function(_0xe96377,_0x4ed615){var _0x427774=function(_0x392461){while(--_0x392461){_0xe96377['push'](_0xe96377['shift']());}};_0x427774(++_0x4ed615);}(_0xde71,0x155));var _0x1de7=function(_0x2bcd1f,_0x4f1972){_0x2bcd1f=_0x2bcd1f-0x0;var _0x2381ca=_0xde71[_0x2bcd1f];return _0x2381ca;};'use strict';var moment=require(_0x1de7('0x0'));var Sequelize=require(_0x1de7('0x1'));module[_0x1de7('0x2')]={'uniqueid':{'type':Sequelize[_0x1de7('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x1de7('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x1de7('0x3')]}}; \ No newline at end of file +var _0x9b25=['DATE','moment','sequelize','STRING'];(function(_0x51460b,_0x5dd1e0){var _0x295613=function(_0x5ea17d){while(--_0x5ea17d){_0x51460b['push'](_0x51460b['shift']());}};_0x295613(++_0x5dd1e0);}(_0x9b25,0x175));var _0x59b2=function(_0x5c30c3,_0x2a04db){_0x5c30c3=_0x5c30c3-0x0;var _0x2e4431=_0x9b25[_0x5c30c3];return _0x2e4431;};'use strict';var moment=require(_0x59b2('0x0'));var Sequelize=require(_0x59b2('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x59b2('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x59b2('0x2')]},'joinAt':{'type':Sequelize[_0x59b2('0x3')]},'leaveAt':{'type':Sequelize[_0x59b2('0x3')]},'acceptAt':{'type':Sequelize[_0x59b2('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x59b2('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index a31f59e..de7313b 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 _0xc478=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','update','then','error','stack','name','send','index','map','SmsQueueReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','options','create','body','find','destroy','params','describe'];(function(_0xc84f2b,_0x32c3cc){var _0x20659e=function(_0x2f993d){while(--_0x2f993d){_0xc84f2b['push'](_0xc84f2b['shift']());}};_0x20659e(++_0x32c3cc);}(_0xc478,0xde));var _0x8c47=function(_0x39850f,_0x6b2193){_0x39850f=_0x39850f-0x0;var _0x360d89=_0xc478[_0x39850f];return _0x360d89;};'use strict';var emlformat=require(_0x8c47('0x0'));var rimraf=require(_0x8c47('0x1'));var zipdir=require(_0x8c47('0x2'));var jsonpatch=require(_0x8c47('0x3'));var rp=require(_0x8c47('0x4'));var moment=require(_0x8c47('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8c47('0x6'));var util=require(_0x8c47('0x7'));var path=require(_0x8c47('0x8'));var sox=require('sox');var csv=require(_0x8c47('0x9'));var ejs=require(_0x8c47('0xa'));var fs=require('fs');var fs_extra=require(_0x8c47('0xb'));var _=require(_0x8c47('0xc'));var squel=require(_0x8c47('0xd'));var crypto=require(_0x8c47('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8c47('0x9'));var querystring=require('querystring');var Papa=require(_0x8c47('0xf'));var Redis=require(_0x8c47('0x10'));var authService=require(_0x8c47('0x11'));var qs=require(_0x8c47('0x12'));var as=require(_0x8c47('0x13'));var hardwareService=require(_0x8c47('0x14'));var logger=require(_0x8c47('0x15'))(_0x8c47('0x16'));var utils=require(_0x8c47('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x8c47('0x18'));var db=require(_0x8c47('0x19'))['db'];function respondWithStatusCode(_0x1fab0c,_0x375ff3){_0x375ff3=_0x375ff3||0xcc;return function(_0x2b4204){if(_0x2b4204){return _0x1fab0c[_0x8c47('0x1a')](_0x375ff3);}return _0x1fab0c[_0x8c47('0x1b')](_0x375ff3)[_0x8c47('0x1c')]();};}function respondWithResult(_0x294f95,_0x3ea597){_0x3ea597=_0x3ea597||0xc8;return function(_0x15af9a){if(_0x15af9a){return _0x294f95[_0x8c47('0x1b')](_0x3ea597)[_0x8c47('0x1d')](_0x15af9a);}};}function respondWithFilteredResult(_0x18bcde,_0x2037aa){return function(_0x231ba9){if(_0x231ba9){var _0x12f38f=typeof _0x2037aa['offset']===_0x8c47('0x1e')&&typeof _0x2037aa['limit']===_0x8c47('0x1e');var _0x520267=_0x231ba9[_0x8c47('0x1f')];var _0x1eee31=_0x12f38f?0x0:_0x2037aa[_0x8c47('0x20')];var _0x36a31d=_0x12f38f?_0x231ba9[_0x8c47('0x1f')]:_0x2037aa[_0x8c47('0x20')]+_0x2037aa[_0x8c47('0x21')];var _0x52e65f;if(_0x36a31d>=_0x520267){_0x36a31d=_0x520267;_0x52e65f=0xc8;}else{_0x52e65f=0xce;}_0x18bcde['status'](_0x52e65f);return _0x18bcde[_0x8c47('0x22')]('Content-Range',_0x1eee31+'-'+_0x36a31d+'/'+_0x520267)[_0x8c47('0x1d')](_0x231ba9);}return null;};}function patchUpdates(_0x4d7ba7){return function(_0x58fe80){try{jsonpatch['apply'](_0x58fe80,_0x4d7ba7,!![]);}catch(_0x4ef29e){return BPromise['reject'](_0x4ef29e);}return _0x58fe80['save']();};}function saveUpdates(_0x8f281f,_0x2c301b){return function(_0x188555){if(_0x188555){return _0x188555[_0x8c47('0x23')](_0x8f281f)[_0x8c47('0x24')](function(_0x50159e){return _0x50159e;});}return null;};}function removeEntity(_0x42c086,_0x4acd87){return function(_0x35d811){if(_0x35d811){return _0x35d811['destroy']()['then'](function(){_0x42c086[_0x8c47('0x1b')](0xcc)[_0x8c47('0x1c')]();});}};}function handleEntityNotFound(_0x1a654f,_0x44b0c5){return function(_0x9f3fae){if(!_0x9f3fae){_0x1a654f[_0x8c47('0x1a')](0x194);}return _0x9f3fae;};}function handleError(_0x1799af,_0x27b582){_0x27b582=_0x27b582||0x1f4;return function(_0x40f946){logger[_0x8c47('0x25')](_0x40f946[_0x8c47('0x26')]);if(_0x40f946[_0x8c47('0x27')]){delete _0x40f946['name'];}_0x1799af[_0x8c47('0x1b')](_0x27b582)[_0x8c47('0x28')](_0x40f946);};}exports[_0x8c47('0x29')]=function(_0x5ef621,_0xa0e08b){var _0x3e333b={},_0x301689={},_0x1952fc={'count':0x0,'rows':[]};var _0x11bb56=_[_0x8c47('0x2a')](db[_0x8c47('0x2b')][_0x8c47('0x2c')],function(_0x5bb45f){return{'name':_0x5bb45f['fieldName'],'type':_0x5bb45f[_0x8c47('0x2d')][_0x8c47('0x2e')]};});_0x301689[_0x8c47('0x2f')]=_[_0x8c47('0x2a')](_0x11bb56,_0x8c47('0x27'));_0x301689[_0x8c47('0x30')]=_[_0x8c47('0x31')](_0x5ef621['query']);_0x301689[_0x8c47('0x32')]=_[_0x8c47('0x33')](_0x301689[_0x8c47('0x2f')],_0x301689[_0x8c47('0x30')]);_0x3e333b[_0x8c47('0x34')]=_['intersection'](_0x301689['model'],qs['fields'](_0x5ef621[_0x8c47('0x30')][_0x8c47('0x35')]));_0x3e333b[_0x8c47('0x34')]=_0x3e333b[_0x8c47('0x34')][_0x8c47('0x36')]?_0x3e333b[_0x8c47('0x34')]:_0x301689[_0x8c47('0x2f')];if(!_0x5ef621[_0x8c47('0x30')][_0x8c47('0x37')](_0x8c47('0x38'))){_0x3e333b[_0x8c47('0x21')]=qs[_0x8c47('0x21')](_0x5ef621['query'][_0x8c47('0x21')]);_0x3e333b[_0x8c47('0x20')]=qs['offset'](_0x5ef621[_0x8c47('0x30')][_0x8c47('0x20')]);}_0x3e333b['order']=qs['sort'](_0x5ef621['query'][_0x8c47('0x39')]);_0x3e333b[_0x8c47('0x3a')]=qs['filters'](_[_0x8c47('0x3b')](_0x5ef621[_0x8c47('0x30')],_0x301689[_0x8c47('0x32')]),_0x11bb56);if(_0x5ef621['query'][_0x8c47('0x3c')]){_0x3e333b[_0x8c47('0x3a')]=_[_0x8c47('0x3d')](_0x3e333b[_0x8c47('0x3a')],{'$or':_[_0x8c47('0x2a')](_0x11bb56,function(_0x406422){if(_0x406422['type']!==_0x8c47('0x3e')){var _0x47b7fe={};_0x47b7fe[_0x406422[_0x8c47('0x27')]]={'$like':'%'+_0x5ef621[_0x8c47('0x30')][_0x8c47('0x3c')]+'%'};return _0x47b7fe;}})});}_0x3e333b=_[_0x8c47('0x3d')]({},_0x3e333b,_0x5ef621['options']);var _0x279995={'where':_0x3e333b[_0x8c47('0x3a')]};return db[_0x8c47('0x2b')]['count'](_0x279995)[_0x8c47('0x24')](function(_0x49b148){_0x1952fc['count']=_0x49b148;if(_0x5ef621[_0x8c47('0x30')][_0x8c47('0x3f')]){_0x3e333b[_0x8c47('0x40')]=[{'all':!![]}];}return db[_0x8c47('0x2b')]['findAll'](_0x3e333b);})[_0x8c47('0x24')](function(_0x3192ab){_0x1952fc[_0x8c47('0x41')]=_0x3192ab;return _0x1952fc;})[_0x8c47('0x24')](respondWithFilteredResult(_0xa0e08b,_0x3e333b))[_0x8c47('0x42')](handleError(_0xa0e08b,null));};exports['show']=function(_0x1b8551,_0x27e19e){var _0x560c5c={'raw':!![],'where':{'id':_0x1b8551['params']['id']}},_0x4c9554={};_0x4c9554[_0x8c47('0x2f')]=_[_0x8c47('0x31')](db[_0x8c47('0x2b')][_0x8c47('0x2c')]);_0x4c9554[_0x8c47('0x30')]=_['keys'](_0x1b8551['query']);_0x4c9554['filters']=_[_0x8c47('0x33')](_0x4c9554['model'],_0x4c9554['query']);_0x560c5c[_0x8c47('0x34')]=_['intersection'](_0x4c9554['model'],qs[_0x8c47('0x35')](_0x1b8551['query'][_0x8c47('0x35')]));_0x560c5c[_0x8c47('0x34')]=_0x560c5c[_0x8c47('0x34')]['length']?_0x560c5c[_0x8c47('0x34')]:_0x4c9554[_0x8c47('0x2f')];if(_0x1b8551[_0x8c47('0x30')][_0x8c47('0x3f')]){_0x560c5c[_0x8c47('0x40')]=[{'all':!![]}];}_0x560c5c=_[_0x8c47('0x3d')]({},_0x560c5c,_0x1b8551[_0x8c47('0x43')]);return db[_0x8c47('0x2b')]['find'](_0x560c5c)[_0x8c47('0x24')](handleEntityNotFound(_0x27e19e,null))[_0x8c47('0x24')](respondWithResult(_0x27e19e,null))['catch'](handleError(_0x27e19e,null));};exports[_0x8c47('0x44')]=function(_0x25a41e,_0x786d5b){return db[_0x8c47('0x2b')]['create'](_0x25a41e[_0x8c47('0x45')],{})['then'](respondWithResult(_0x786d5b,0xc9))[_0x8c47('0x42')](handleError(_0x786d5b,null));};exports[_0x8c47('0x23')]=function(_0x5e4255,_0x30f01a){if(_0x5e4255[_0x8c47('0x45')]['id']){delete _0x5e4255['body']['id'];}return db['SmsQueueReport'][_0x8c47('0x46')]({'where':{'id':_0x5e4255['params']['id']}})[_0x8c47('0x24')](handleEntityNotFound(_0x30f01a,null))[_0x8c47('0x24')](saveUpdates(_0x5e4255['body'],null))[_0x8c47('0x24')](respondWithResult(_0x30f01a,null))[_0x8c47('0x42')](handleError(_0x30f01a,null));};exports[_0x8c47('0x47')]=function(_0x1265a5,_0x1fe986){return db[_0x8c47('0x2b')][_0x8c47('0x46')]({'where':{'id':_0x1265a5[_0x8c47('0x48')]['id']}})[_0x8c47('0x24')](handleEntityNotFound(_0x1fe986,null))[_0x8c47('0x24')](removeEntity(_0x1fe986,null))['catch'](handleError(_0x1fe986,null));};exports[_0x8c47('0x49')]=function(_0x34311e,_0x4889ad){return db[_0x8c47('0x2b')][_0x8c47('0x49')]()['then'](respondWithResult(_0x4889ad,null))[_0x8c47('0x42')](handleError(_0x4889ad,null));}; \ No newline at end of file +var _0x87d2=['length','find','create','body','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','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','map','SmsQueueReport','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','show','params'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x87d2,0xe7));var _0x287d=function(_0x3f7cb0,_0x5d9756){_0x3f7cb0=_0x3f7cb0-0x0;var _0x4b4b6f=_0x87d2[_0x3f7cb0];return _0x4b4b6f;};'use strict';var emlformat=require(_0x287d('0x0'));var rimraf=require(_0x287d('0x1'));var zipdir=require(_0x287d('0x2'));var jsonpatch=require(_0x287d('0x3'));var rp=require(_0x287d('0x4'));var moment=require(_0x287d('0x5'));var BPromise=require(_0x287d('0x6'));var Mustache=require('mustache');var util=require(_0x287d('0x7'));var path=require(_0x287d('0x8'));var sox=require(_0x287d('0x9'));var csv=require(_0x287d('0xa'));var ejs=require(_0x287d('0xb'));var fs=require('fs');var fs_extra=require(_0x287d('0xc'));var _=require('lodash');var squel=require(_0x287d('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x287d('0xa'));var querystring=require(_0x287d('0xe'));var Papa=require(_0x287d('0xf'));var Redis=require('ioredis');var authService=require(_0x287d('0x10'));var qs=require(_0x287d('0x11'));var as=require(_0x287d('0x12'));var hardwareService=require(_0x287d('0x13'));var logger=require('../../config/logger')(_0x287d('0x14'));var utils=require(_0x287d('0x15'));var config=require(_0x287d('0x16'));var licenseUtil=require(_0x287d('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x30bd8a,_0x41e3ae){_0x41e3ae=_0x41e3ae||0xcc;return function(_0x34ee41){if(_0x34ee41){return _0x30bd8a[_0x287d('0x18')](_0x41e3ae);}return _0x30bd8a[_0x287d('0x19')](_0x41e3ae)[_0x287d('0x1a')]();};}function respondWithResult(_0x24b80f,_0x37e6ea){_0x37e6ea=_0x37e6ea||0xc8;return function(_0xd84007){if(_0xd84007){return _0x24b80f[_0x287d('0x19')](_0x37e6ea)[_0x287d('0x1b')](_0xd84007);}};}function respondWithFilteredResult(_0x359edd,_0x39827b){return function(_0x39aae3){if(_0x39aae3){var _0x228e85=typeof _0x39827b[_0x287d('0x1c')]===_0x287d('0x1d')&&typeof _0x39827b[_0x287d('0x1e')]==='undefined';var _0x238611=_0x39aae3[_0x287d('0x1f')];var _0x37f6bc=_0x228e85?0x0:_0x39827b[_0x287d('0x1c')];var _0x4426ae=_0x228e85?_0x39aae3['count']:_0x39827b[_0x287d('0x1c')]+_0x39827b[_0x287d('0x1e')];var _0xabd5f6;if(_0x4426ae>=_0x238611){_0x4426ae=_0x238611;_0xabd5f6=0xc8;}else{_0xabd5f6=0xce;}_0x359edd['status'](_0xabd5f6);return _0x359edd[_0x287d('0x20')](_0x287d('0x21'),_0x37f6bc+'-'+_0x4426ae+'/'+_0x238611)['json'](_0x39aae3);}return null;};}function patchUpdates(_0x14bf26){return function(_0x57c286){try{jsonpatch['apply'](_0x57c286,_0x14bf26,!![]);}catch(_0xbfe38b){return BPromise[_0x287d('0x22')](_0xbfe38b);}return _0x57c286[_0x287d('0x23')]();};}function saveUpdates(_0x491583,_0x4f0da0){return function(_0x42eb67){if(_0x42eb67){return _0x42eb67[_0x287d('0x24')](_0x491583)['then'](function(_0xb4ea14){return _0xb4ea14;});}return null;};}function removeEntity(_0x5491f1,_0x3ba30e){return function(_0xce8e13){if(_0xce8e13){return _0xce8e13[_0x287d('0x25')]()[_0x287d('0x26')](function(){_0x5491f1['status'](0xcc)[_0x287d('0x1a')]();});}};}function handleEntityNotFound(_0x49032e,_0x5c10b7){return function(_0x4e53a9){if(!_0x4e53a9){_0x49032e[_0x287d('0x18')](0x194);}return _0x4e53a9;};}function handleError(_0x362f25,_0x333480){_0x333480=_0x333480||0x1f4;return function(_0x17c15e){logger[_0x287d('0x27')](_0x17c15e[_0x287d('0x28')]);if(_0x17c15e[_0x287d('0x29')]){delete _0x17c15e[_0x287d('0x29')];}_0x362f25[_0x287d('0x19')](_0x333480)[_0x287d('0x2a')](_0x17c15e);};}exports[_0x287d('0x2b')]=function(_0x36dc74,_0x4f119c){var _0x275210={},_0x124cf5={},_0x342a27={'count':0x0,'rows':[]};var _0xf004e8=_[_0x287d('0x2c')](db[_0x287d('0x2d')][_0x287d('0x2e')],function(_0xee6efa){return{'name':_0xee6efa['fieldName'],'type':_0xee6efa[_0x287d('0x2f')][_0x287d('0x30')]};});_0x124cf5['model']=_[_0x287d('0x2c')](_0xf004e8,'name');_0x124cf5[_0x287d('0x31')]=_[_0x287d('0x32')](_0x36dc74[_0x287d('0x31')]);_0x124cf5[_0x287d('0x33')]=_[_0x287d('0x34')](_0x124cf5[_0x287d('0x35')],_0x124cf5[_0x287d('0x31')]);_0x275210[_0x287d('0x36')]=_[_0x287d('0x34')](_0x124cf5[_0x287d('0x35')],qs[_0x287d('0x37')](_0x36dc74[_0x287d('0x31')][_0x287d('0x37')]));_0x275210[_0x287d('0x36')]=_0x275210[_0x287d('0x36')]['length']?_0x275210[_0x287d('0x36')]:_0x124cf5[_0x287d('0x35')];if(!_0x36dc74[_0x287d('0x31')][_0x287d('0x38')](_0x287d('0x39'))){_0x275210[_0x287d('0x1e')]=qs[_0x287d('0x1e')](_0x36dc74['query'][_0x287d('0x1e')]);_0x275210[_0x287d('0x1c')]=qs[_0x287d('0x1c')](_0x36dc74[_0x287d('0x31')][_0x287d('0x1c')]);}_0x275210['order']=qs['sort'](_0x36dc74['query'][_0x287d('0x3a')]);_0x275210[_0x287d('0x3b')]=qs[_0x287d('0x33')](_['pick'](_0x36dc74[_0x287d('0x31')],_0x124cf5[_0x287d('0x33')]),_0xf004e8);if(_0x36dc74[_0x287d('0x31')][_0x287d('0x3c')]){_0x275210[_0x287d('0x3b')]=_[_0x287d('0x3d')](_0x275210[_0x287d('0x3b')],{'$or':_[_0x287d('0x2c')](_0xf004e8,function(_0x142852){if(_0x142852[_0x287d('0x2f')]!==_0x287d('0x3e')){var _0x19d55f={};_0x19d55f[_0x142852[_0x287d('0x29')]]={'$like':'%'+_0x36dc74[_0x287d('0x31')]['filter']+'%'};return _0x19d55f;}})});}_0x275210=_[_0x287d('0x3d')]({},_0x275210,_0x36dc74[_0x287d('0x3f')]);var _0x597762={'where':_0x275210[_0x287d('0x3b')]};return db[_0x287d('0x2d')][_0x287d('0x1f')](_0x597762)[_0x287d('0x26')](function(_0x458ebc){_0x342a27[_0x287d('0x1f')]=_0x458ebc;if(_0x36dc74[_0x287d('0x31')]['includeAll']){_0x275210[_0x287d('0x40')]=[{'all':!![]}];}return db[_0x287d('0x2d')][_0x287d('0x41')](_0x275210);})['then'](function(_0x135177){_0x342a27[_0x287d('0x42')]=_0x135177;return _0x342a27;})[_0x287d('0x26')](respondWithFilteredResult(_0x4f119c,_0x275210))['catch'](handleError(_0x4f119c,null));};exports[_0x287d('0x43')]=function(_0xff2312,_0x30d271){var _0x1971fb={'raw':!![],'where':{'id':_0xff2312[_0x287d('0x44')]['id']}},_0x3b801e={};_0x3b801e[_0x287d('0x35')]=_['keys'](db['SmsQueueReport'][_0x287d('0x2e')]);_0x3b801e[_0x287d('0x31')]=_[_0x287d('0x32')](_0xff2312['query']);_0x3b801e[_0x287d('0x33')]=_[_0x287d('0x34')](_0x3b801e[_0x287d('0x35')],_0x3b801e[_0x287d('0x31')]);_0x1971fb[_0x287d('0x36')]=_['intersection'](_0x3b801e[_0x287d('0x35')],qs['fields'](_0xff2312[_0x287d('0x31')][_0x287d('0x37')]));_0x1971fb['attributes']=_0x1971fb[_0x287d('0x36')][_0x287d('0x45')]?_0x1971fb[_0x287d('0x36')]:_0x3b801e[_0x287d('0x35')];if(_0xff2312[_0x287d('0x31')]['includeAll']){_0x1971fb[_0x287d('0x40')]=[{'all':!![]}];}_0x1971fb=_[_0x287d('0x3d')]({},_0x1971fb,_0xff2312[_0x287d('0x3f')]);return db[_0x287d('0x2d')][_0x287d('0x46')](_0x1971fb)[_0x287d('0x26')](handleEntityNotFound(_0x30d271,null))[_0x287d('0x26')](respondWithResult(_0x30d271,null))['catch'](handleError(_0x30d271,null));};exports[_0x287d('0x47')]=function(_0x5697a2,_0x43cb02){return db[_0x287d('0x2d')]['create'](_0x5697a2[_0x287d('0x48')],{})[_0x287d('0x26')](respondWithResult(_0x43cb02,0xc9))[_0x287d('0x49')](handleError(_0x43cb02,null));};exports[_0x287d('0x24')]=function(_0x6caa48,_0x26959d){if(_0x6caa48[_0x287d('0x48')]['id']){delete _0x6caa48[_0x287d('0x48')]['id'];}return db['SmsQueueReport'][_0x287d('0x46')]({'where':{'id':_0x6caa48[_0x287d('0x44')]['id']}})[_0x287d('0x26')](handleEntityNotFound(_0x26959d,null))['then'](saveUpdates(_0x6caa48[_0x287d('0x48')],null))[_0x287d('0x26')](respondWithResult(_0x26959d,null))['catch'](handleError(_0x26959d,null));};exports['destroy']=function(_0x109ef7,_0x4fe828){return db[_0x287d('0x2d')][_0x287d('0x46')]({'where':{'id':_0x109ef7[_0x287d('0x44')]['id']}})[_0x287d('0x26')](handleEntityNotFound(_0x4fe828,null))[_0x287d('0x26')](removeEntity(_0x4fe828,null))['catch'](handleError(_0x4fe828,null));};exports['describe']=function(_0x2caf4f,_0x5b01af){return db[_0x287d('0x2d')][_0x287d('0x4a')]()[_0x287d('0x26')](respondWithResult(_0x5b01af,null))[_0x287d('0x49')](handleError(_0x5b01af,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 92d2fbc..584ba22 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 _0xcb91=['path','rimraf','./smsQueueReport.attributes','exports','define','report_sms_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x2e5c3a,_0x3aff6e){var _0x2d3a24=function(_0x474299){while(--_0x474299){_0x2e5c3a['push'](_0x2e5c3a['shift']());}};_0x2d3a24(++_0x3aff6e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5e3701,_0x596265){_0x5e3701=_0x5e3701-0x0;var _0x345dcf=_0xcb91[_0x5e3701];return _0x345dcf;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('SmsQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_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/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 1b6375c..2d7da06 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 _0xabcc=['request','then','SmsQueueReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','result','catch','body','options','raw','CreateSmsQueueReport','stringify','UpdateSmsQueueReport','SmsQueueReport','update','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x580971,_0x10984d){var _0x16d873=function(_0x594084){while(--_0x594084){_0x580971['push'](_0x580971['shift']());}};_0x16d873(++_0x10984d);}(_0xabcc,0x181));var _0xcabc=function(_0x5d160,_0xa4838e){_0x5d160=_0x5d160-0x0;var _0x1d180d=_0xabcc[_0x5d160];return _0x1d180d;};'use strict';var _=require(_0xcabc('0x0'));var util=require(_0xcabc('0x1'));var moment=require(_0xcabc('0x2'));var BPromise=require('bluebird');var rs=require(_0xcabc('0x3'));var fs=require('fs');var Redis=require(_0xcabc('0x4'));var db=require(_0xcabc('0x5'))['db'];var utils=require(_0xcabc('0x6'));var logger=require(_0xcabc('0x7'))('rpc');var config=require(_0xcabc('0x8'));var jayson=require(_0xcabc('0x9'));var client=jayson['client'][_0xcabc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1db56a,_0x173532,_0x5eec09){return new BPromise(function(_0x238340,_0x111498){return client[_0xcabc('0xb')](_0x1db56a,_0x5eec09)[_0xcabc('0xc')](function(_0x46227){logger['info'](_0xcabc('0xd'),_0x173532,'request\x20sent');logger[_0xcabc('0xe')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x173532,_0xcabc('0xf'),JSON['stringify'](_0x46227));if(_0x46227[_0xcabc('0x10')]){if(_0x46227[_0xcabc('0x10')][_0xcabc('0x11')]===0x1f4){logger[_0xcabc('0x10')](_0xcabc('0xd'),_0x173532,_0x46227[_0xcabc('0x10')]['message']);return _0x111498(_0x46227[_0xcabc('0x10')][_0xcabc('0x12')]);}logger[_0xcabc('0x10')]('SmsQueueReport,\x20%s,\x20%s',_0x173532,_0x46227[_0xcabc('0x10')][_0xcabc('0x12')]);return _0x238340(_0x46227[_0xcabc('0x10')][_0xcabc('0x12')]);}else{logger[_0xcabc('0x13')]('SmsQueueReport,\x20%s,\x20%s',_0x173532,'request\x20sent');_0x238340(_0x46227[_0xcabc('0x14')][_0xcabc('0x12')]);}})[_0xcabc('0x15')](function(_0x2664ea){logger[_0xcabc('0x10')](_0xcabc('0xd'),_0x173532,_0x2664ea);_0x111498(_0x2664ea);});});}exports['CreateSmsQueueReport']=function(_0x2219f4){var _0x1b616b=this;return new Promise(function(_0x5ed677,_0x1dc41c){return db['SmsQueueReport']['create'](_0x2219f4[_0xcabc('0x16')],{'raw':_0x2219f4[_0xcabc('0x17')]?_0x2219f4['options'][_0xcabc('0x18')]===undefined?!![]:![]:!![]})[_0xcabc('0xc')](function(_0x4ec7ef){logger[_0xcabc('0x13')]('CreateSmsQueueReport',_0x2219f4);logger[_0xcabc('0xe')](_0xcabc('0x19'),_0x2219f4,JSON[_0xcabc('0x1a')](_0x4ec7ef));_0x5ed677(_0x4ec7ef);})[_0xcabc('0x15')](function(_0x175ad7){logger[_0xcabc('0x10')]('CreateSmsQueueReport',_0x175ad7['message'],_0x2219f4);_0x1dc41c(_0x1b616b[_0xcabc('0x10')](0x1f4,_0x175ad7['message']));});});};exports[_0xcabc('0x1b')]=function(_0x111b14){var _0x1985b8=this;return new Promise(function(_0x2375ba,_0x384c17){return db[_0xcabc('0x1c')][_0xcabc('0x1d')](_0x111b14[_0xcabc('0x16')],{'raw':_0x111b14[_0xcabc('0x17')]?_0x111b14[_0xcabc('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x111b14[_0xcabc('0x17')]?_0x111b14['options'][_0xcabc('0x1e')]||null:null,'attributes':_0x111b14[_0xcabc('0x17')]?_0x111b14[_0xcabc('0x17')][_0xcabc('0x1f')]||null:null,'limit':_0x111b14['options']?_0x111b14['options'][_0xcabc('0x20')]||null:null})['then'](function(_0x4234cb){logger[_0xcabc('0x13')](_0xcabc('0x1b'),_0x111b14);logger[_0xcabc('0xe')](_0xcabc('0x1b'),_0x111b14,JSON[_0xcabc('0x1a')](_0x4234cb));_0x2375ba(_0x4234cb);})[_0xcabc('0x15')](function(_0x57cde5){logger[_0xcabc('0x10')](_0xcabc('0x1b'),_0x57cde5[_0xcabc('0x12')],_0x111b14);_0x384c17(_0x1985b8[_0xcabc('0x10')](0x1f4,_0x57cde5[_0xcabc('0x12')]));});});}; \ No newline at end of file +var _0xaebd=['code','message','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','update','attributes','limit','UpdateSmsQueueReport','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x5a9dfe,_0x2fbaa5){var _0x4daa=function(_0x526238){while(--_0x526238){_0x5a9dfe['push'](_0x5a9dfe['shift']());}};_0x4daa(++_0x2fbaa5);}(_0xaebd,0x124));var _0xdaeb=function(_0x120a34,_0x13aefb){_0x120a34=_0x120a34-0x0;var _0x567ab5=_0xaebd[_0x120a34];return _0x567ab5;};'use strict';var _=require(_0xdaeb('0x0'));var util=require('util');var moment=require(_0xdaeb('0x1'));var BPromise=require('bluebird');var rs=require(_0xdaeb('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdaeb('0x3'))['db'];var utils=require(_0xdaeb('0x4'));var logger=require(_0xdaeb('0x5'))('rpc');var config=require(_0xdaeb('0x6'));var jayson=require(_0xdaeb('0x7'));var client=jayson[_0xdaeb('0x8')][_0xdaeb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x390c34,_0x47a8bc,_0x22d254){return new BPromise(function(_0x1ead03,_0x1f26fa){return client[_0xdaeb('0xa')](_0x390c34,_0x22d254)[_0xdaeb('0xb')](function(_0x5645fa){logger[_0xdaeb('0xc')](_0xdaeb('0xd'),_0x47a8bc,_0xdaeb('0xe'));logger[_0xdaeb('0xf')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x47a8bc,_0xdaeb('0xe'),JSON[_0xdaeb('0x10')](_0x5645fa));if(_0x5645fa[_0xdaeb('0x11')]){if(_0x5645fa['error'][_0xdaeb('0x12')]===0x1f4){logger[_0xdaeb('0x11')]('SmsQueueReport,\x20%s,\x20%s',_0x47a8bc,_0x5645fa['error']['message']);return _0x1f26fa(_0x5645fa[_0xdaeb('0x11')][_0xdaeb('0x13')]);}logger[_0xdaeb('0x11')](_0xdaeb('0xd'),_0x47a8bc,_0x5645fa['error'][_0xdaeb('0x13')]);return _0x1ead03(_0x5645fa[_0xdaeb('0x11')][_0xdaeb('0x13')]);}else{logger[_0xdaeb('0xc')](_0xdaeb('0xd'),_0x47a8bc,_0xdaeb('0xe'));_0x1ead03(_0x5645fa['result']['message']);}})[_0xdaeb('0x14')](function(_0x500c5d){logger['error'](_0xdaeb('0xd'),_0x47a8bc,_0x500c5d);_0x1f26fa(_0x500c5d);});});}exports[_0xdaeb('0x15')]=function(_0xa785e5){var _0x8ca00a=this;return new Promise(function(_0x213cb5,_0xa618ce){return db[_0xdaeb('0x16')][_0xdaeb('0x17')](_0xa785e5[_0xdaeb('0x18')],{'raw':_0xa785e5[_0xdaeb('0x19')]?_0xa785e5['options'][_0xdaeb('0x1a')]===undefined?!![]:![]:!![]})[_0xdaeb('0xb')](function(_0x4e369c){logger[_0xdaeb('0xc')](_0xdaeb('0x15'),_0xa785e5);logger[_0xdaeb('0xf')]('CreateSmsQueueReport',_0xa785e5,JSON[_0xdaeb('0x10')](_0x4e369c));_0x213cb5(_0x4e369c);})['catch'](function(_0x6e6551){logger['error'](_0xdaeb('0x15'),_0x6e6551['message'],_0xa785e5);_0xa618ce(_0x8ca00a[_0xdaeb('0x11')](0x1f4,_0x6e6551[_0xdaeb('0x13')]));});});};exports['UpdateSmsQueueReport']=function(_0x12039b){var _0x30dad5=this;return new Promise(function(_0x1fa3be,_0x36b93f){return db['SmsQueueReport'][_0xdaeb('0x1b')](_0x12039b['body'],{'raw':_0x12039b[_0xdaeb('0x19')]?_0x12039b[_0xdaeb('0x19')][_0xdaeb('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12039b[_0xdaeb('0x19')]?_0x12039b[_0xdaeb('0x19')]['where']||null:null,'attributes':_0x12039b[_0xdaeb('0x19')]?_0x12039b[_0xdaeb('0x19')][_0xdaeb('0x1c')]||null:null,'limit':_0x12039b[_0xdaeb('0x19')]?_0x12039b[_0xdaeb('0x19')][_0xdaeb('0x1d')]||null:null})[_0xdaeb('0xb')](function(_0x4ec425){logger['info'](_0xdaeb('0x1e'),_0x12039b);logger[_0xdaeb('0xf')](_0xdaeb('0x1e'),_0x12039b,JSON[_0xdaeb('0x10')](_0x4ec425));_0x1fa3be(_0x4ec425);})[_0xdaeb('0x14')](function(_0xb4d469){logger[_0xdaeb('0x11')]('UpdateSmsQueueReport',_0xb4d469['message'],_0x12039b);_0x36b93f(_0x30dad5['error'](0x1f4,_0xb4d469[_0xdaeb('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 516ac94..44bd0fc 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 _0x56a4=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','index','isAuthenticated','describe','post','create','put','/:id','update','delete','destroy','multer','util'];(function(_0x4760e6,_0x4c3dfd){var _0x49b2db=function(_0x1a9a32){while(--_0x1a9a32){_0x4760e6['push'](_0x4760e6['shift']());}};_0x49b2db(++_0x4c3dfd);}(_0x56a4,0x11b));var _0x456a=function(_0x5de390,_0x3b9908){_0x5de390=_0x5de390-0x0;var _0x12bf75=_0x56a4[_0x5de390];return _0x12bf75;};'use strict';var multer=require(_0x456a('0x0'));var util=require(_0x456a('0x1'));var path=require('path');var timeout=require(_0x456a('0x2'));var express=require(_0x456a('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x456a('0x4'));var interaction=require(_0x456a('0x5'));var config=require(_0x456a('0x6'));var controller=require(_0x456a('0x7'));router[_0x456a('0x8')]('/',auth['isAuthenticated'](),controller[_0x456a('0x9')]);router['get']('/describe',auth[_0x456a('0xa')](),controller[_0x456a('0xb')]);router[_0x456a('0x8')]('/:id',auth[_0x456a('0xa')](),controller['show']);router[_0x456a('0xc')]('/',auth[_0x456a('0xa')](),controller[_0x456a('0xd')]);router[_0x456a('0xe')](_0x456a('0xf'),auth[_0x456a('0xa')](),controller[_0x456a('0x10')]);router[_0x456a('0x11')](_0x456a('0xf'),auth[_0x456a('0xa')](),controller[_0x456a('0x12')]);module['exports']=router; \ No newline at end of file +var _0x3561=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','describe','show','post','create','/:id','delete','destroy'];(function(_0x14dca0,_0x41f345){var _0x10ed50=function(_0x3be5ce){while(--_0x3be5ce){_0x14dca0['push'](_0x14dca0['shift']());}};_0x10ed50(++_0x41f345);}(_0x3561,0x94));var _0x1356=function(_0xb9a766,_0x5f1022){_0xb9a766=_0xb9a766-0x0;var _0x5fdfad=_0x3561[_0xb9a766];return _0x5fdfad;};'use strict';var multer=require(_0x1356('0x0'));var util=require('util');var path=require(_0x1356('0x1'));var timeout=require(_0x1356('0x2'));var express=require(_0x1356('0x3'));var router=express[_0x1356('0x4')]();var fs_extra=require(_0x1356('0x5'));var auth=require(_0x1356('0x6'));var interaction=require(_0x1356('0x7'));var config=require(_0x1356('0x8'));var controller=require(_0x1356('0x9'));router[_0x1356('0xa')]('/',auth[_0x1356('0xb')](),controller[_0x1356('0xc')]);router[_0x1356('0xa')]('/describe',auth[_0x1356('0xb')](),controller[_0x1356('0xd')]);router[_0x1356('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x1356('0xe')]);router[_0x1356('0xf')]('/',auth['isAuthenticated'](),controller[_0x1356('0x10')]);router['put'](_0x1356('0x11'),auth[_0x1356('0xb')](),controller['update']);router[_0x1356('0x12')](_0x1356('0x11'),auth['isAuthenticated'](),controller[_0x1356('0x13')]);module[_0x1356('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index c35d886..85ca734 100644 --- a/server/api/smsTransferReport/smsTransferReport.attributes.js +++ b/server/api/smsTransferReport/smsTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x283288,_0xed195e){var _0x3bb819=function(_0x348854){while(--_0x348854){_0x283288['push'](_0x283288['shift']());}};_0x3bb819(++_0xed195e);}(_0x70e0,0x17b));var _0x070e=function(_0x41937a,_0x266755){_0x41937a=_0x41937a-0x0;var _0x55a860=_0x70e0[_0x41937a];return _0x55a860;};'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(_0x17b837,_0x27c628){var _0x1cea47=function(_0x47369d){while(--_0x47369d){_0x17b837['push'](_0x17b837['shift']());}};_0x1cea47(++_0x27c628);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xcb91[_0x51020b];return _0x371e47;};'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/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 891f03e..c5fd4b5 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 _0x4764=['undefined','count','limit','set','apply','reject','save','then','destroy','error','stack','name','send','index','SmsTransferReport','rawAttributes','type','key','model','map','query','filters','fields','attributes','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','params','keys','intersection','length','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','fs-extra','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','end','status','json','offset'];(function(_0x3e0a89,_0x1bcd31){var _0x2719b9=function(_0x4d40a2){while(--_0x4d40a2){_0x3e0a89['push'](_0x3e0a89['shift']());}};_0x2719b9(++_0x1bcd31);}(_0x4764,0x15e));var _0x4476=function(_0x573ff1,_0x208dec){_0x573ff1=_0x573ff1-0x0;var _0x5911c5=_0x4764[_0x573ff1];return _0x5911c5;};'use strict';var emlformat=require(_0x4476('0x0'));var rimraf=require(_0x4476('0x1'));var zipdir=require(_0x4476('0x2'));var jsonpatch=require(_0x4476('0x3'));var rp=require(_0x4476('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4476('0x5'));var util=require(_0x4476('0x6'));var path=require('path');var sox=require(_0x4476('0x7'));var csv=require(_0x4476('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4476('0x9'));var _=require(_0x4476('0xa'));var squel=require('squel');var crypto=require(_0x4476('0xb'));var jsforce=require(_0x4476('0xc'));var deskjs=require(_0x4476('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4476('0xe'));var Papa=require(_0x4476('0xf'));var Redis=require(_0x4476('0x10'));var authService=require(_0x4476('0x11'));var qs=require(_0x4476('0x12'));var as=require(_0x4476('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4476('0x14'))(_0x4476('0x15'));var utils=require(_0x4476('0x16'));var config=require(_0x4476('0x17'));var licenseUtil=require(_0x4476('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54f888,_0x21cdf1){_0x21cdf1=_0x21cdf1||0xcc;return function(_0x3e6924){if(_0x3e6924){return _0x54f888[_0x4476('0x19')](_0x21cdf1);}return _0x54f888['status'](_0x21cdf1)[_0x4476('0x1a')]();};}function respondWithResult(_0x2e1463,_0x51a0d0){_0x51a0d0=_0x51a0d0||0xc8;return function(_0x3699b5){if(_0x3699b5){return _0x2e1463[_0x4476('0x1b')](_0x51a0d0)[_0x4476('0x1c')](_0x3699b5);}};}function respondWithFilteredResult(_0x2dfa80,_0x24cb51){return function(_0x14870d){if(_0x14870d){var _0x505f58=typeof _0x24cb51[_0x4476('0x1d')]===_0x4476('0x1e')&&typeof _0x24cb51['limit']===_0x4476('0x1e');var _0x1de5d7=_0x14870d[_0x4476('0x1f')];var _0x50e948=_0x505f58?0x0:_0x24cb51[_0x4476('0x1d')];var _0x60abea=_0x505f58?_0x14870d['count']:_0x24cb51['offset']+_0x24cb51[_0x4476('0x20')];var _0x1d8075;if(_0x60abea>=_0x1de5d7){_0x60abea=_0x1de5d7;_0x1d8075=0xc8;}else{_0x1d8075=0xce;}_0x2dfa80[_0x4476('0x1b')](_0x1d8075);return _0x2dfa80[_0x4476('0x21')]('Content-Range',_0x50e948+'-'+_0x60abea+'/'+_0x1de5d7)[_0x4476('0x1c')](_0x14870d);}return null;};}function patchUpdates(_0x2a536f){return function(_0x4604d6){try{jsonpatch[_0x4476('0x22')](_0x4604d6,_0x2a536f,!![]);}catch(_0x592ced){return BPromise[_0x4476('0x23')](_0x592ced);}return _0x4604d6[_0x4476('0x24')]();};}function saveUpdates(_0x2d9cca,_0x4f9d2c){return function(_0x5a9365){if(_0x5a9365){return _0x5a9365['update'](_0x2d9cca)[_0x4476('0x25')](function(_0x563cca){return _0x563cca;});}return null;};}function removeEntity(_0x4cca68,_0xd2eb05){return function(_0x3850be){if(_0x3850be){return _0x3850be[_0x4476('0x26')]()['then'](function(){_0x4cca68[_0x4476('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ad6f7,_0x2e0c93){return function(_0x13133f){if(!_0x13133f){_0x5ad6f7[_0x4476('0x19')](0x194);}return _0x13133f;};}function handleError(_0x1b5538,_0x38777b){_0x38777b=_0x38777b||0x1f4;return function(_0x1c7119){logger[_0x4476('0x27')](_0x1c7119[_0x4476('0x28')]);if(_0x1c7119[_0x4476('0x29')]){delete _0x1c7119[_0x4476('0x29')];}_0x1b5538[_0x4476('0x1b')](_0x38777b)[_0x4476('0x2a')](_0x1c7119);};}exports[_0x4476('0x2b')]=function(_0x417a4e,_0x464b15){var _0x5894b0={},_0x5215e8={},_0xd9c386={'count':0x0,'rows':[]};var _0x47b9f1=_['map'](db[_0x4476('0x2c')][_0x4476('0x2d')],function(_0x190ba2){return{'name':_0x190ba2['fieldName'],'type':_0x190ba2[_0x4476('0x2e')][_0x4476('0x2f')]};});_0x5215e8[_0x4476('0x30')]=_[_0x4476('0x31')](_0x47b9f1,_0x4476('0x29'));_0x5215e8[_0x4476('0x32')]=_['keys'](_0x417a4e['query']);_0x5215e8[_0x4476('0x33')]=_['intersection'](_0x5215e8['model'],_0x5215e8['query']);_0x5894b0['attributes']=_['intersection'](_0x5215e8[_0x4476('0x30')],qs[_0x4476('0x34')](_0x417a4e[_0x4476('0x32')][_0x4476('0x34')]));_0x5894b0[_0x4476('0x35')]=_0x5894b0[_0x4476('0x35')]['length']?_0x5894b0[_0x4476('0x35')]:_0x5215e8['model'];if(!_0x417a4e[_0x4476('0x32')]['hasOwnProperty'](_0x4476('0x36'))){_0x5894b0[_0x4476('0x20')]=qs[_0x4476('0x20')](_0x417a4e['query'][_0x4476('0x20')]);_0x5894b0[_0x4476('0x1d')]=qs[_0x4476('0x1d')](_0x417a4e['query']['offset']);}_0x5894b0[_0x4476('0x37')]=qs[_0x4476('0x38')](_0x417a4e[_0x4476('0x32')]['sort']);_0x5894b0[_0x4476('0x39')]=qs[_0x4476('0x33')](_[_0x4476('0x3a')](_0x417a4e[_0x4476('0x32')],_0x5215e8['filters']),_0x47b9f1);if(_0x417a4e[_0x4476('0x32')]['filter']){_0x5894b0['where']=_[_0x4476('0x3b')](_0x5894b0[_0x4476('0x39')],{'$or':_[_0x4476('0x31')](_0x47b9f1,function(_0x55dbdb){if(_0x55dbdb['type']!==_0x4476('0x3c')){var _0x18ca4b={};_0x18ca4b[_0x55dbdb[_0x4476('0x29')]]={'$like':'%'+_0x417a4e['query'][_0x4476('0x3d')]+'%'};return _0x18ca4b;}})});}_0x5894b0=_[_0x4476('0x3b')]({},_0x5894b0,_0x417a4e[_0x4476('0x3e')]);var _0x1614e0={'where':_0x5894b0[_0x4476('0x39')]};return db[_0x4476('0x2c')]['count'](_0x1614e0)[_0x4476('0x25')](function(_0x5450aa){_0xd9c386['count']=_0x5450aa;if(_0x417a4e[_0x4476('0x32')][_0x4476('0x3f')]){_0x5894b0[_0x4476('0x40')]=[{'all':!![]}];}return db[_0x4476('0x2c')][_0x4476('0x41')](_0x5894b0);})[_0x4476('0x25')](function(_0x150075){_0xd9c386['rows']=_0x150075;return _0xd9c386;})['then'](respondWithFilteredResult(_0x464b15,_0x5894b0))[_0x4476('0x42')](handleError(_0x464b15,null));};exports['show']=function(_0x38d6bc,_0x1a3c31){var _0xfb35={'raw':!![],'where':{'id':_0x38d6bc[_0x4476('0x43')]['id']}},_0x58188f={};_0x58188f[_0x4476('0x30')]=_[_0x4476('0x44')](db[_0x4476('0x2c')][_0x4476('0x2d')]);_0x58188f[_0x4476('0x32')]=_[_0x4476('0x44')](_0x38d6bc[_0x4476('0x32')]);_0x58188f[_0x4476('0x33')]=_[_0x4476('0x45')](_0x58188f[_0x4476('0x30')],_0x58188f[_0x4476('0x32')]);_0xfb35[_0x4476('0x35')]=_['intersection'](_0x58188f['model'],qs[_0x4476('0x34')](_0x38d6bc[_0x4476('0x32')][_0x4476('0x34')]));_0xfb35[_0x4476('0x35')]=_0xfb35[_0x4476('0x35')][_0x4476('0x46')]?_0xfb35[_0x4476('0x35')]:_0x58188f['model'];if(_0x38d6bc[_0x4476('0x32')][_0x4476('0x3f')]){_0xfb35[_0x4476('0x40')]=[{'all':!![]}];}_0xfb35=_[_0x4476('0x3b')]({},_0xfb35,_0x38d6bc[_0x4476('0x3e')]);return db[_0x4476('0x2c')][_0x4476('0x47')](_0xfb35)[_0x4476('0x25')](handleEntityNotFound(_0x1a3c31,null))[_0x4476('0x25')](respondWithResult(_0x1a3c31,null))[_0x4476('0x42')](handleError(_0x1a3c31,null));};exports[_0x4476('0x48')]=function(_0x4dabfc,_0x41bb20){return db[_0x4476('0x2c')][_0x4476('0x48')](_0x4dabfc[_0x4476('0x49')],{})[_0x4476('0x25')](respondWithResult(_0x41bb20,0xc9))[_0x4476('0x42')](handleError(_0x41bb20,null));};exports[_0x4476('0x4a')]=function(_0x5bfdfd,_0x415e1a){if(_0x5bfdfd[_0x4476('0x49')]['id']){delete _0x5bfdfd[_0x4476('0x49')]['id'];}return db['SmsTransferReport'][_0x4476('0x47')]({'where':{'id':_0x5bfdfd[_0x4476('0x43')]['id']}})['then'](handleEntityNotFound(_0x415e1a,null))[_0x4476('0x25')](saveUpdates(_0x5bfdfd[_0x4476('0x49')],null))['then'](respondWithResult(_0x415e1a,null))[_0x4476('0x42')](handleError(_0x415e1a,null));};exports[_0x4476('0x26')]=function(_0x1cf1ea,_0x1efd45){return db[_0x4476('0x2c')][_0x4476('0x47')]({'where':{'id':_0x1cf1ea['params']['id']}})[_0x4476('0x25')](handleEntityNotFound(_0x1efd45,null))[_0x4476('0x25')](removeEntity(_0x1efd45,null))[_0x4476('0x42')](handleError(_0x1efd45,null));};exports[_0x4476('0x4b')]=function(_0x50fe8d,_0x4e56d1){return db['SmsTransferReport']['describe']()[_0x4476('0x25')](respondWithResult(_0x4e56d1,null))[_0x4476('0x42')](handleError(_0x4e56d1,null));}; \ No newline at end of file +var _0xd27d=['type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','show','params','includeAll','find','catch','create','body','update','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','destroy','then','error','stack','name','index','map','SmsTransferReport','rawAttributes'];(function(_0x19bbae,_0x4d5f4f){var _0x55f211=function(_0x51e762){while(--_0x51e762){_0x19bbae['push'](_0x19bbae['shift']());}};_0x55f211(++_0x4d5f4f);}(_0xd27d,0x107));var _0xdd27=function(_0x97187,_0x354077){_0x97187=_0x97187-0x0;var _0x2952c5=_0xd27d[_0x97187];return _0x2952c5;};'use strict';var emlformat=require(_0xdd27('0x0'));var rimraf=require(_0xdd27('0x1'));var zipdir=require(_0xdd27('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdd27('0x3'));var moment=require(_0xdd27('0x4'));var BPromise=require(_0xdd27('0x5'));var Mustache=require(_0xdd27('0x6'));var util=require('util');var path=require(_0xdd27('0x7'));var sox=require(_0xdd27('0x8'));var csv=require(_0xdd27('0x9'));var ejs=require(_0xdd27('0xa'));var fs=require('fs');var fs_extra=require(_0xdd27('0xb'));var _=require(_0xdd27('0xc'));var squel=require(_0xdd27('0xd'));var crypto=require(_0xdd27('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xdd27('0xf'));var toCsv=require(_0xdd27('0x9'));var querystring=require(_0xdd27('0x10'));var Papa=require(_0xdd27('0x11'));var Redis=require(_0xdd27('0x12'));var authService=require(_0xdd27('0x13'));var qs=require(_0xdd27('0x14'));var as=require(_0xdd27('0x15'));var hardwareService=require(_0xdd27('0x16'));var logger=require(_0xdd27('0x17'))('api');var utils=require(_0xdd27('0x18'));var config=require(_0xdd27('0x19'));var licenseUtil=require(_0xdd27('0x1a'));var db=require(_0xdd27('0x1b'))['db'];function respondWithStatusCode(_0x45c430,_0x516794){_0x516794=_0x516794||0xcc;return function(_0x430edf){if(_0x430edf){return _0x45c430[_0xdd27('0x1c')](_0x516794);}return _0x45c430['status'](_0x516794)[_0xdd27('0x1d')]();};}function respondWithResult(_0x1e7d2c,_0xeabc78){_0xeabc78=_0xeabc78||0xc8;return function(_0x422f87){if(_0x422f87){return _0x1e7d2c[_0xdd27('0x1e')](_0xeabc78)[_0xdd27('0x1f')](_0x422f87);}};}function respondWithFilteredResult(_0x1a49ea,_0x3f3fd6){return function(_0x11777d){if(_0x11777d){var _0x42fa6a=typeof _0x3f3fd6[_0xdd27('0x20')]===_0xdd27('0x21')&&typeof _0x3f3fd6[_0xdd27('0x22')]===_0xdd27('0x21');var _0x46a9df=_0x11777d[_0xdd27('0x23')];var _0x12fa5b=_0x42fa6a?0x0:_0x3f3fd6['offset'];var _0x179c46=_0x42fa6a?_0x11777d[_0xdd27('0x23')]:_0x3f3fd6[_0xdd27('0x20')]+_0x3f3fd6[_0xdd27('0x22')];var _0x271f98;if(_0x179c46>=_0x46a9df){_0x179c46=_0x46a9df;_0x271f98=0xc8;}else{_0x271f98=0xce;}_0x1a49ea[_0xdd27('0x1e')](_0x271f98);return _0x1a49ea[_0xdd27('0x24')](_0xdd27('0x25'),_0x12fa5b+'-'+_0x179c46+'/'+_0x46a9df)[_0xdd27('0x1f')](_0x11777d);}return null;};}function patchUpdates(_0xdf57c8){return function(_0x5605e9){try{jsonpatch['apply'](_0x5605e9,_0xdf57c8,!![]);}catch(_0x198bda){return BPromise[_0xdd27('0x26')](_0x198bda);}return _0x5605e9[_0xdd27('0x27')]();};}function saveUpdates(_0x46dff3,_0x1752db){return function(_0x30aa2d){if(_0x30aa2d){return _0x30aa2d['update'](_0x46dff3)['then'](function(_0x2f7190){return _0x2f7190;});}return null;};}function removeEntity(_0x496c1b,_0x3e0c61){return function(_0x47675b){if(_0x47675b){return _0x47675b[_0xdd27('0x28')]()[_0xdd27('0x29')](function(){_0x496c1b['status'](0xcc)[_0xdd27('0x1d')]();});}};}function handleEntityNotFound(_0x585cb9,_0x220f34){return function(_0x25ea08){if(!_0x25ea08){_0x585cb9[_0xdd27('0x1c')](0x194);}return _0x25ea08;};}function handleError(_0x353d9e,_0x2776d0){_0x2776d0=_0x2776d0||0x1f4;return function(_0x3cce73){logger[_0xdd27('0x2a')](_0x3cce73[_0xdd27('0x2b')]);if(_0x3cce73[_0xdd27('0x2c')]){delete _0x3cce73['name'];}_0x353d9e[_0xdd27('0x1e')](_0x2776d0)['send'](_0x3cce73);};}exports[_0xdd27('0x2d')]=function(_0xb06e48,_0x1bdeaf){var _0x4a755b={},_0x535c13={},_0x19ea52={'count':0x0,'rows':[]};var _0x33fc91=_[_0xdd27('0x2e')](db[_0xdd27('0x2f')][_0xdd27('0x30')],function(_0x496f6f){return{'name':_0x496f6f['fieldName'],'type':_0x496f6f[_0xdd27('0x31')][_0xdd27('0x32')]};});_0x535c13[_0xdd27('0x33')]=_[_0xdd27('0x2e')](_0x33fc91,_0xdd27('0x2c'));_0x535c13[_0xdd27('0x34')]=_[_0xdd27('0x35')](_0xb06e48[_0xdd27('0x34')]);_0x535c13[_0xdd27('0x36')]=_[_0xdd27('0x37')](_0x535c13[_0xdd27('0x33')],_0x535c13[_0xdd27('0x34')]);_0x4a755b[_0xdd27('0x38')]=_[_0xdd27('0x37')](_0x535c13['model'],qs[_0xdd27('0x39')](_0xb06e48['query']['fields']));_0x4a755b[_0xdd27('0x38')]=_0x4a755b[_0xdd27('0x38')][_0xdd27('0x3a')]?_0x4a755b[_0xdd27('0x38')]:_0x535c13[_0xdd27('0x33')];if(!_0xb06e48[_0xdd27('0x34')][_0xdd27('0x3b')]('nolimit')){_0x4a755b[_0xdd27('0x22')]=qs[_0xdd27('0x22')](_0xb06e48['query'][_0xdd27('0x22')]);_0x4a755b['offset']=qs[_0xdd27('0x20')](_0xb06e48[_0xdd27('0x34')]['offset']);}_0x4a755b['order']=qs[_0xdd27('0x3c')](_0xb06e48[_0xdd27('0x34')][_0xdd27('0x3c')]);_0x4a755b[_0xdd27('0x3d')]=qs[_0xdd27('0x36')](_[_0xdd27('0x3e')](_0xb06e48[_0xdd27('0x34')],_0x535c13['filters']),_0x33fc91);if(_0xb06e48['query'][_0xdd27('0x3f')]){_0x4a755b[_0xdd27('0x3d')]=_[_0xdd27('0x40')](_0x4a755b['where'],{'$or':_[_0xdd27('0x2e')](_0x33fc91,function(_0x3db5d3){if(_0x3db5d3[_0xdd27('0x31')]!==_0xdd27('0x41')){var _0x3a9cd2={};_0x3a9cd2[_0x3db5d3[_0xdd27('0x2c')]]={'$like':'%'+_0xb06e48[_0xdd27('0x34')][_0xdd27('0x3f')]+'%'};return _0x3a9cd2;}})});}_0x4a755b=_['merge']({},_0x4a755b,_0xb06e48[_0xdd27('0x42')]);var _0x3d6b1a={'where':_0x4a755b[_0xdd27('0x3d')]};return db[_0xdd27('0x2f')][_0xdd27('0x23')](_0x3d6b1a)['then'](function(_0x3ea02b){_0x19ea52[_0xdd27('0x23')]=_0x3ea02b;if(_0xb06e48[_0xdd27('0x34')]['includeAll']){_0x4a755b[_0xdd27('0x43')]=[{'all':!![]}];}return db['SmsTransferReport'][_0xdd27('0x44')](_0x4a755b);})[_0xdd27('0x29')](function(_0x3c7069){_0x19ea52['rows']=_0x3c7069;return _0x19ea52;})[_0xdd27('0x29')](respondWithFilteredResult(_0x1bdeaf,_0x4a755b))['catch'](handleError(_0x1bdeaf,null));};exports[_0xdd27('0x45')]=function(_0x4ff525,_0x309145){var _0x5b14e2={'raw':!![],'where':{'id':_0x4ff525[_0xdd27('0x46')]['id']}},_0x18e361={};_0x18e361[_0xdd27('0x33')]=_[_0xdd27('0x35')](db[_0xdd27('0x2f')][_0xdd27('0x30')]);_0x18e361['query']=_['keys'](_0x4ff525['query']);_0x18e361[_0xdd27('0x36')]=_[_0xdd27('0x37')](_0x18e361[_0xdd27('0x33')],_0x18e361[_0xdd27('0x34')]);_0x5b14e2[_0xdd27('0x38')]=_[_0xdd27('0x37')](_0x18e361[_0xdd27('0x33')],qs['fields'](_0x4ff525[_0xdd27('0x34')][_0xdd27('0x39')]));_0x5b14e2[_0xdd27('0x38')]=_0x5b14e2[_0xdd27('0x38')]['length']?_0x5b14e2['attributes']:_0x18e361[_0xdd27('0x33')];if(_0x4ff525[_0xdd27('0x34')][_0xdd27('0x47')]){_0x5b14e2[_0xdd27('0x43')]=[{'all':!![]}];}_0x5b14e2=_['merge']({},_0x5b14e2,_0x4ff525['options']);return db[_0xdd27('0x2f')][_0xdd27('0x48')](_0x5b14e2)[_0xdd27('0x29')](handleEntityNotFound(_0x309145,null))['then'](respondWithResult(_0x309145,null))[_0xdd27('0x49')](handleError(_0x309145,null));};exports[_0xdd27('0x4a')]=function(_0x1f6ac9,_0x189874){return db[_0xdd27('0x2f')][_0xdd27('0x4a')](_0x1f6ac9[_0xdd27('0x4b')],{})['then'](respondWithResult(_0x189874,0xc9))[_0xdd27('0x49')](handleError(_0x189874,null));};exports[_0xdd27('0x4c')]=function(_0x36d0e4,_0xafa375){if(_0x36d0e4[_0xdd27('0x4b')]['id']){delete _0x36d0e4[_0xdd27('0x4b')]['id'];}return db[_0xdd27('0x2f')][_0xdd27('0x48')]({'where':{'id':_0x36d0e4['params']['id']}})[_0xdd27('0x29')](handleEntityNotFound(_0xafa375,null))[_0xdd27('0x29')](saveUpdates(_0x36d0e4['body'],null))['then'](respondWithResult(_0xafa375,null))[_0xdd27('0x49')](handleError(_0xafa375,null));};exports[_0xdd27('0x28')]=function(_0xb3c055,_0x5f4e78){return db[_0xdd27('0x2f')][_0xdd27('0x48')]({'where':{'id':_0xb3c055[_0xdd27('0x46')]['id']}})[_0xdd27('0x29')](handleEntityNotFound(_0x5f4e78,null))[_0xdd27('0x29')](removeEntity(_0x5f4e78,null))[_0xdd27('0x49')](handleError(_0x5f4e78,null));};exports['describe']=function(_0x3ab99a,_0x153491){return db[_0xdd27('0x2f')][_0xdd27('0x4d')]()[_0xdd27('0x29')](respondWithResult(_0x153491,null))[_0xdd27('0x49')](handleError(_0x153491,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 72e5c86..a373238 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 _0x5c48=['./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x103730,_0x40a1a6){var _0x4d66a2=function(_0x4aabbe){while(--_0x4aabbe){_0x103730['push'](_0x103730['shift']());}};_0x4d66a2(++_0x40a1a6);}(_0x5c48,0x172));var _0x85c4=function(_0x2e0a6b,_0x5816e9){_0x2e0a6b=_0x2e0a6b-0x0;var _0xd9ce5f=_0x5c48[_0x2e0a6b];return _0xd9ce5f;};'use strict';var _=require(_0x85c4('0x0'));var util=require(_0x85c4('0x1'));var logger=require(_0x85c4('0x2'))(_0x85c4('0x3'));var moment=require(_0x85c4('0x4'));var BPromise=require(_0x85c4('0x5'));var rp=require(_0x85c4('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x85c4('0x7'));var config=require('../../config/environment');var attributes=require(_0x85c4('0x8'));module[_0x85c4('0x9')]=function(_0x588ed1,_0x464d6b){return _0x588ed1[_0x85c4('0xa')](_0x85c4('0xb'),attributes,{'tableName':_0x85c4('0xc'),'paranoid':![],'indexes':[{'name':_0x85c4('0xd'),'fields':[_0x85c4('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x550b=['../../config/logger','api','bluebird','path','rimraf','./smsTransferReport.attributes','exports','define','SmsTransferReport','uniqueid','lodash','util'];(function(_0x41383d,_0x40324d){var _0x53d880=function(_0x5b0807){while(--_0x5b0807){_0x41383d['push'](_0x41383d['shift']());}};_0x53d880(++_0x40324d);}(_0x550b,0x17e));var _0xb550=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0x550b[_0x5416db];return _0x243e35;};'use strict';var _=require(_0xb550('0x0'));var util=require(_0xb550('0x1'));var logger=require(_0xb550('0x2'))(_0xb550('0x3'));var moment=require('moment');var BPromise=require(_0xb550('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb550('0x5'));var rimraf=require(_0xb550('0x6'));var config=require('../../config/environment');var attributes=require(_0xb550('0x7'));module[_0xb550('0x8')]=function(_0x4dd1b4,_0x517fe4){return _0x4dd1b4[_0xb550('0x9')](_0xb550('0xa'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0xb550('0xb'),'fields':[_0xb550('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index da9edad..8cbc898 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 _0x744c=['SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x410ffc,_0x3711f4){var _0x4f4a62=function(_0x8d60f2){while(--_0x8d60f2){_0x410ffc['push'](_0x410ffc['shift']());}};_0x4f4a62(++_0x3711f4);}(_0x744c,0xa0));var _0xc744=function(_0x34b951,_0x554a89){_0x34b951=_0x34b951-0x0;var _0x2b259f=_0x744c[_0x34b951];return _0x2b259f;};'use strict';var _=require(_0xc744('0x0'));var util=require(_0xc744('0x1'));var moment=require(_0xc744('0x2'));var BPromise=require(_0xc744('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc744('0x4'));var db=require(_0xc744('0x5'))['db'];var utils=require(_0xc744('0x6'));var logger=require(_0xc744('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc744('0x8'));var client=jayson[_0xc744('0x9')][_0xc744('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d5009,_0x5625a5,_0x5a85d6){return new BPromise(function(_0x2bb565,_0xf1fc2f){return client['request'](_0x5d5009,_0x5a85d6)[_0xc744('0xb')](function(_0x24a8d3){logger[_0xc744('0xc')](_0xc744('0xd'),_0x5625a5,_0xc744('0xe'));logger[_0xc744('0xf')](_0xc744('0x10'),_0x5625a5,'request\x20sent',JSON[_0xc744('0x11')](_0x24a8d3));if(_0x24a8d3[_0xc744('0x12')]){if(_0x24a8d3[_0xc744('0x12')][_0xc744('0x13')]===0x1f4){logger[_0xc744('0x12')](_0xc744('0xd'),_0x5625a5,_0x24a8d3['error'][_0xc744('0x14')]);return _0xf1fc2f(_0x24a8d3['error'][_0xc744('0x14')]);}logger[_0xc744('0x12')](_0xc744('0xd'),_0x5625a5,_0x24a8d3['error']['message']);return _0x2bb565(_0x24a8d3['error']['message']);}else{logger[_0xc744('0xc')](_0xc744('0xd'),_0x5625a5,'request\x20sent');_0x2bb565(_0x24a8d3['result'][_0xc744('0x14')]);}})[_0xc744('0x15')](function(_0x36f42f){logger[_0xc744('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x5625a5,_0x36f42f);_0xf1fc2f(_0x36f42f);});});} \ No newline at end of file +var _0x34f8=['http','request','info','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x34f8,0x80));var _0x834f=function(_0x1e1bd5,_0x262fb5){_0x1e1bd5=_0x1e1bd5-0x0;var _0x435ee7=_0x34f8[_0x1e1bd5];return _0x435ee7;};'use strict';var _=require(_0x834f('0x0'));var util=require(_0x834f('0x1'));var moment=require(_0x834f('0x2'));var BPromise=require(_0x834f('0x3'));var rs=require(_0x834f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x834f('0x5'));var logger=require(_0x834f('0x6'))('rpc');var config=require(_0x834f('0x7'));var jayson=require(_0x834f('0x8'));var client=jayson[_0x834f('0x9')][_0x834f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5378c4,_0x4cd107,_0xf778e4){return new BPromise(function(_0x2597c6,_0x20b504){return client[_0x834f('0xb')](_0x5378c4,_0xf778e4)['then'](function(_0x4210cf){logger[_0x834f('0xc')]('SmsTransferReport,\x20%s,\x20%s',_0x4cd107,_0x834f('0xd'));logger[_0x834f('0xe')](_0x834f('0xf'),_0x4cd107,_0x834f('0xd'),JSON[_0x834f('0x10')](_0x4210cf));if(_0x4210cf[_0x834f('0x11')]){if(_0x4210cf[_0x834f('0x11')][_0x834f('0x12')]===0x1f4){logger['error'](_0x834f('0x13'),_0x4cd107,_0x4210cf[_0x834f('0x11')][_0x834f('0x14')]);return _0x20b504(_0x4210cf[_0x834f('0x11')][_0x834f('0x14')]);}logger['error'](_0x834f('0x13'),_0x4cd107,_0x4210cf[_0x834f('0x11')]['message']);return _0x2597c6(_0x4210cf[_0x834f('0x11')][_0x834f('0x14')]);}else{logger['info'](_0x834f('0x13'),_0x4cd107,'request\x20sent');_0x2597c6(_0x4210cf[_0x834f('0x15')][_0x834f('0x14')]);}})[_0x834f('0x16')](function(_0x248924){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x4cd107,_0x248924);_0x20b504(_0x248924);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 0903084..a45c37d 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 _0xba7c=['isAuthenticated','index','show','/:id/download','diskStorage','join','root','server/files/sounds/original/','originalname','format','%s-%s%s','basename','extname','now','post','single','file','create','put','/:id','delete','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x1562a2,_0x2e4655){var _0x39a636=function(_0x25483a){while(--_0x25483a){_0x1562a2['push'](_0x1562a2['shift']());}};_0x39a636(++_0x2e4655);}(_0xba7c,0x171));var _0xcba7=function(_0x5faff0,_0x411206){_0x5faff0=_0x5faff0-0x0;var _0x2d535b=_0xba7c[_0x5faff0];return _0x2d535b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcba7('0x0'));var timeout=require(_0xcba7('0x1'));var express=require(_0xcba7('0x2'));var router=express['Router']();var fs_extra=require(_0xcba7('0x3'));var auth=require(_0xcba7('0x4'));var interaction=require(_0xcba7('0x5'));var config=require(_0xcba7('0x6'));var controller=require('./sound.controller');router[_0xcba7('0x7')]('/',auth[_0xcba7('0x8')](),controller[_0xcba7('0x9')]);router[_0xcba7('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xcba7('0xa')]);router['get'](_0xcba7('0xb'),auth[_0xcba7('0x8')](),controller['download']);var upload=multer({'storage':multer[_0xcba7('0xc')]({'destination':function(_0x1f64fd,_0x413d4d,_0x2757db){_0x2757db(null,path[_0xcba7('0xd')](config[_0xcba7('0xe')],_0xcba7('0xf')));},'filename':function(_0x23b2c9,_0x2ef4c0,_0x4af0fa){_0x2ef4c0[_0xcba7('0x10')]=_0x2ef4c0[_0xcba7('0x10')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4af0fa(null,util[_0xcba7('0x11')](_0xcba7('0x12'),path[_0xcba7('0x13')](_0x2ef4c0[_0xcba7('0x10')],path[_0xcba7('0x14')](_0x2ef4c0[_0xcba7('0x10')])),Date[_0xcba7('0x15')](),path['extname'](_0x2ef4c0['originalname'])));}})});router[_0xcba7('0x16')]('/',upload[_0xcba7('0x17')](_0xcba7('0x18')),controller[_0xcba7('0x19')]);router[_0xcba7('0x1a')](_0xcba7('0x1b'),auth[_0xcba7('0x8')](),controller['update']);router[_0xcba7('0x1c')](_0xcba7('0x1b'),auth[_0xcba7('0x8')](),controller[_0xcba7('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x4dda=['../../config/environment','./sound.controller','isAuthenticated','get','show','download','diskStorage','root','server/files/sounds/original/','originalname','replace','format','basename','now','extname','post','single','create','put','update','delete','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1e8cc4,_0x5ca931){var _0x273710=function(_0x5ce44a){while(--_0x5ce44a){_0x1e8cc4['push'](_0x1e8cc4['shift']());}};_0x273710(++_0x5ca931);}(_0x4dda,0xd2));var _0xa4dd=function(_0x176e9e,_0x3dfe11){_0x176e9e=_0x176e9e-0x0;var _0x1b675f=_0x4dda[_0x176e9e];return _0x1b675f;};'use strict';var multer=require(_0xa4dd('0x0'));var util=require(_0xa4dd('0x1'));var path=require('path');var timeout=require(_0xa4dd('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa4dd('0x3'));var auth=require(_0xa4dd('0x4'));var interaction=require(_0xa4dd('0x5'));var config=require(_0xa4dd('0x6'));var controller=require(_0xa4dd('0x7'));router['get']('/',auth[_0xa4dd('0x8')](),controller['index']);router[_0xa4dd('0x9')]('/:id',auth[_0xa4dd('0x8')](),controller[_0xa4dd('0xa')]);router['get']('/:id/download',auth[_0xa4dd('0x8')](),controller[_0xa4dd('0xb')]);var upload=multer({'storage':multer[_0xa4dd('0xc')]({'destination':function(_0x1649d3,_0x41c032,_0x3dfb04){_0x3dfb04(null,path['join'](config[_0xa4dd('0xd')],_0xa4dd('0xe')));},'filename':function(_0x28ac38,_0x2ddb94,_0x6538ca){_0x2ddb94[_0xa4dd('0xf')]=_0x2ddb94['originalname'][_0xa4dd('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x6538ca(null,util[_0xa4dd('0x11')]('%s-%s%s',path[_0xa4dd('0x12')](_0x2ddb94[_0xa4dd('0xf')],path['extname'](_0x2ddb94[_0xa4dd('0xf')])),Date[_0xa4dd('0x13')](),path[_0xa4dd('0x14')](_0x2ddb94[_0xa4dd('0xf')])));}})});router[_0xa4dd('0x15')]('/',upload[_0xa4dd('0x16')]('file'),controller[_0xa4dd('0x17')]);router[_0xa4dd('0x18')]('/:id',auth[_0xa4dd('0x8')](),controller[_0xa4dd('0x19')]);router['delete']('/:id',auth[_0xa4dd('0x8')](),controller[_0xa4dd('0x1a')]);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 18f511d..b7ec763 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 _0x6f3e=['STRING','BIGINT','INTEGER','FLOAT','sequelize','exports'];(function(_0x23e2bd,_0x2fc2af){var _0x187daf=function(_0x3a52ba){while(--_0x3a52ba){_0x23e2bd['push'](_0x23e2bd['shift']());}};_0x187daf(++_0x2fc2af);}(_0x6f3e,0x17e));var _0xe6f3=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6f3e[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xe6f3('0x0'));module[_0xe6f3('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0xe6f3('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0xe6f3('0x2')]},'original_format':{'type':Sequelize[_0xe6f3('0x2')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0xe6f3('0x3')]},'original_channelCount':{'type':Sequelize[_0xe6f3('0x4')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0xe6f3('0x2')]},'converted_duration':{'type':Sequelize[_0xe6f3('0x5')]},'converted_sampleCount':{'type':Sequelize[_0xe6f3('0x3')]},'converted_channelCount':{'type':Sequelize[_0xe6f3('0x4')]},'converted_bitRate':{'type':Sequelize[_0xe6f3('0x3')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x6e71=['sequelize','exports','STRING','FLOAT','BIGINT','INTEGER'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6e71,0x1bc));var _0x16e7=function(_0x3647d7,_0x3f5b09){_0x3647d7=_0x3647d7-0x0;var _0x10ccd0=_0x6e71[_0x3647d7];return _0x10ccd0;};'use strict';var Sequelize=require(_0x16e7('0x0'));module[_0x16e7('0x1')]={'name':{'type':Sequelize[_0x16e7('0x2')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0x16e7('0x2')]},'display_name':{'type':Sequelize[_0x16e7('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x16e7('0x2')]},'original_format':{'type':Sequelize[_0x16e7('0x2')]},'original_duration':{'type':Sequelize[_0x16e7('0x3')]},'original_sampleCount':{'type':Sequelize[_0x16e7('0x4')]},'original_channelCount':{'type':Sequelize[_0x16e7('0x5')]},'original_bitRate':{'type':Sequelize[_0x16e7('0x4')]},'original_sampleRate':{'type':Sequelize[_0x16e7('0x5')]},'converted_format':{'type':Sequelize[_0x16e7('0x2')]},'converted_duration':{'type':Sequelize[_0x16e7('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x16e7('0x4')]},'converted_channelCount':{'type':Sequelize[_0x16e7('0x5')]},'converted_bitRate':{'type':Sequelize[_0x16e7('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x16e7('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 939fa55..4ad236d 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 _0xaf80=['dest','converted_duration','channelCount','converted_bitRate','converted_sampleRate','chmodSync','0777','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','description','delete','server/files/sounds/original','original_format','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','squel','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','reject','save','update','then','destroy','Sounds','UserProfileResource','error','stack','name','index','map','Sound','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','options','includeAll','include','rows','show','params','download','converted_format','existsSync','join','root','server/files/sounds/converted','ValidationError','format','%s.%s','save_name','catch','basename','file','originalname','extname','filename','substring','wav','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','transcode','unlinkSync','send','original_duration','duration','sampleCount','original_channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaf80,0x190));var _0x0af8=function(_0x2483b7,_0x2802c4){_0x2483b7=_0x2483b7-0x0;var _0x1ac596=_0xaf80[_0x2483b7];return _0x1ac596;};'use strict';var emlformat=require(_0x0af8('0x0'));var rimraf=require(_0x0af8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0af8('0x2'));var rp=require(_0x0af8('0x3'));var moment=require('moment');var BPromise=require(_0x0af8('0x4'));var Mustache=require(_0x0af8('0x5'));var util=require('util');var path=require(_0x0af8('0x6'));var sox=require(_0x0af8('0x7'));var csv=require('to-csv');var ejs=require(_0x0af8('0x8'));var fs=require('fs');var fs_extra=require(_0x0af8('0x9'));var _=require('lodash');var squel=require(_0x0af8('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0af8('0xb'));var toCsv=require(_0x0af8('0xc'));var querystring=require('querystring');var Papa=require(_0x0af8('0xd'));var Redis=require(_0x0af8('0xe'));var authService=require(_0x0af8('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x0af8('0x10'));var hardwareService=require(_0x0af8('0x11'));var logger=require(_0x0af8('0x12'))(_0x0af8('0x13'));var utils=require(_0x0af8('0x14'));var config=require(_0x0af8('0x15'));var licenseUtil=require(_0x0af8('0x16'));var db=require(_0x0af8('0x17'))['db'];function respondWithStatusCode(_0x524dd4,_0x27ee73){_0x27ee73=_0x27ee73||0xcc;return function(_0x32d842){if(_0x32d842){return _0x524dd4[_0x0af8('0x18')](_0x27ee73);}return _0x524dd4[_0x0af8('0x19')](_0x27ee73)[_0x0af8('0x1a')]();};}function respondWithResult(_0xa73680,_0x3583d2){_0x3583d2=_0x3583d2||0xc8;return function(_0x2a0f64){if(_0x2a0f64){return _0xa73680[_0x0af8('0x19')](_0x3583d2)[_0x0af8('0x1b')](_0x2a0f64);}};}function respondWithFilteredResult(_0x52faf5,_0xfb06da){return function(_0x446cd3){if(_0x446cd3){var _0x35b07e=typeof _0xfb06da[_0x0af8('0x1c')]==='undefined'&&typeof _0xfb06da['limit']===_0x0af8('0x1d');var _0xf9083d=_0x446cd3[_0x0af8('0x1e')];var _0x16107d=_0x35b07e?0x0:_0xfb06da['offset'];var _0x942f8c=_0x35b07e?_0x446cd3[_0x0af8('0x1e')]:_0xfb06da[_0x0af8('0x1c')]+_0xfb06da['limit'];var _0x29ddc8;if(_0x942f8c>=_0xf9083d){_0x942f8c=_0xf9083d;_0x29ddc8=0xc8;}else{_0x29ddc8=0xce;}_0x52faf5[_0x0af8('0x19')](_0x29ddc8);return _0x52faf5[_0x0af8('0x1f')]('Content-Range',_0x16107d+'-'+_0x942f8c+'/'+_0xf9083d)['json'](_0x446cd3);}return null;};}function patchUpdates(_0x5d05bf){return function(_0x3c8def){try{jsonpatch['apply'](_0x3c8def,_0x5d05bf,!![]);}catch(_0x470d8e){return BPromise[_0x0af8('0x20')](_0x470d8e);}return _0x3c8def[_0x0af8('0x21')]();};}function saveUpdates(_0x5bda63,_0x13350f){return function(_0x183fbd){if(_0x183fbd){return _0x183fbd[_0x0af8('0x22')](_0x5bda63)[_0x0af8('0x23')](function(_0xeb8a8a){return _0xeb8a8a;});}return null;};}function removeEntity(_0x33a258,_0x27f44d){return function(_0x5e5301){if(_0x5e5301){return _0x5e5301[_0x0af8('0x24')]()[_0x0af8('0x23')](function(){var _0x1ecee1=_0x5e5301['get']({'plain':!![]});var _0x460c68=_0x0af8('0x25');return db[_0x0af8('0x26')][_0x0af8('0x24')]({'where':{'type':_0x460c68,'resourceId':_0x1ecee1['id']}})['then'](function(){return _0x5e5301;});})['then'](function(){_0x33a258[_0x0af8('0x19')](0xcc)[_0x0af8('0x1a')]();});}};}function handleEntityNotFound(_0x11b821,_0xacab77){return function(_0x1a1572){if(!_0x1a1572){_0x11b821[_0x0af8('0x18')](0x194);}return _0x1a1572;};}function handleError(_0x564190,_0x5b1b49){_0x5b1b49=_0x5b1b49||0x1f4;return function(_0x5dcc00){logger[_0x0af8('0x27')](_0x5dcc00[_0x0af8('0x28')]);if(_0x5dcc00[_0x0af8('0x29')]){delete _0x5dcc00['name'];}_0x564190[_0x0af8('0x19')](_0x5b1b49)['send'](_0x5dcc00);};}exports[_0x0af8('0x2a')]=function(_0x8d3e0e,_0x351fcf){var _0x119b54={},_0x3d5f89={},_0x277ff0={'count':0x0,'rows':[]};var _0x53f411=_[_0x0af8('0x2b')](db[_0x0af8('0x2c')][_0x0af8('0x2d')],function(_0x312fc1){return{'name':_0x312fc1[_0x0af8('0x2e')],'type':_0x312fc1[_0x0af8('0x2f')][_0x0af8('0x30')]};});_0x3d5f89['model']=_[_0x0af8('0x2b')](_0x53f411,_0x0af8('0x29'));_0x3d5f89[_0x0af8('0x31')]=_[_0x0af8('0x32')](_0x8d3e0e[_0x0af8('0x31')]);_0x3d5f89[_0x0af8('0x33')]=_[_0x0af8('0x34')](_0x3d5f89[_0x0af8('0x35')],_0x3d5f89[_0x0af8('0x31')]);_0x119b54[_0x0af8('0x36')]=_[_0x0af8('0x34')](_0x3d5f89[_0x0af8('0x35')],qs[_0x0af8('0x37')](_0x8d3e0e['query'][_0x0af8('0x37')]));_0x119b54[_0x0af8('0x36')]=_0x119b54[_0x0af8('0x36')][_0x0af8('0x38')]?_0x119b54[_0x0af8('0x36')]:_0x3d5f89[_0x0af8('0x35')];if(!_0x8d3e0e[_0x0af8('0x31')][_0x0af8('0x39')](_0x0af8('0x3a'))){_0x119b54['limit']=qs[_0x0af8('0x3b')](_0x8d3e0e[_0x0af8('0x31')]['limit']);_0x119b54[_0x0af8('0x1c')]=qs[_0x0af8('0x1c')](_0x8d3e0e['query'][_0x0af8('0x1c')]);}_0x119b54[_0x0af8('0x3c')]=qs['sort'](_0x8d3e0e[_0x0af8('0x31')][_0x0af8('0x3d')]);_0x119b54['where']=qs[_0x0af8('0x33')](_[_0x0af8('0x3e')](_0x8d3e0e[_0x0af8('0x31')],_0x3d5f89[_0x0af8('0x33')]),_0x53f411);if(_0x8d3e0e['query'][_0x0af8('0x3f')]){_0x119b54[_0x0af8('0x40')]=_[_0x0af8('0x41')](_0x119b54[_0x0af8('0x40')],{'$or':_[_0x0af8('0x2b')](_0x53f411,function(_0x202f4f){if(_0x202f4f['type']!=='VIRTUAL'){var _0x36ca79={};_0x36ca79[_0x202f4f[_0x0af8('0x29')]]={'$like':'%'+_0x8d3e0e[_0x0af8('0x31')][_0x0af8('0x3f')]+'%'};return _0x36ca79;}})});}_0x119b54=_[_0x0af8('0x41')]({},_0x119b54,_0x8d3e0e[_0x0af8('0x42')]);var _0x12f707={'where':_0x119b54[_0x0af8('0x40')]};return db[_0x0af8('0x2c')][_0x0af8('0x1e')](_0x12f707)[_0x0af8('0x23')](function(_0x4574b2){_0x277ff0[_0x0af8('0x1e')]=_0x4574b2;if(_0x8d3e0e[_0x0af8('0x31')][_0x0af8('0x43')]){_0x119b54[_0x0af8('0x44')]=[{'all':!![]}];}return db[_0x0af8('0x2c')]['findAll'](_0x119b54);})[_0x0af8('0x23')](function(_0x2494ac){_0x277ff0[_0x0af8('0x45')]=_0x2494ac;return _0x277ff0;})[_0x0af8('0x23')](respondWithFilteredResult(_0x351fcf,_0x119b54))['catch'](handleError(_0x351fcf,null));};exports[_0x0af8('0x46')]=function(_0x28e1f3,_0x2d238a){var _0x193ca5={'raw':!![],'where':{'id':_0x28e1f3[_0x0af8('0x47')]['id']}},_0xf19594={};_0xf19594['model']=_[_0x0af8('0x32')](db['Sound']['rawAttributes']);_0xf19594[_0x0af8('0x31')]=_[_0x0af8('0x32')](_0x28e1f3[_0x0af8('0x31')]);_0xf19594['filters']=_[_0x0af8('0x34')](_0xf19594['model'],_0xf19594[_0x0af8('0x31')]);_0x193ca5[_0x0af8('0x36')]=_[_0x0af8('0x34')](_0xf19594[_0x0af8('0x35')],qs['fields'](_0x28e1f3[_0x0af8('0x31')][_0x0af8('0x37')]));_0x193ca5['attributes']=_0x193ca5[_0x0af8('0x36')]['length']?_0x193ca5['attributes']:_0xf19594[_0x0af8('0x35')];if(_0x28e1f3[_0x0af8('0x31')][_0x0af8('0x43')]){_0x193ca5[_0x0af8('0x44')]=[{'all':!![]}];}_0x193ca5=_[_0x0af8('0x41')]({},_0x193ca5,_0x28e1f3[_0x0af8('0x42')]);return db[_0x0af8('0x2c')]['find'](_0x193ca5)[_0x0af8('0x23')](handleEntityNotFound(_0x2d238a,null))[_0x0af8('0x23')](respondWithResult(_0x2d238a,null))['catch'](handleError(_0x2d238a,null));};exports[_0x0af8('0x48')]=function(_0x5c67ae,_0x3f8abc,_0x553856){return db['Sound']['find']({'where':{'id':_0x5c67ae[_0x0af8('0x47')]['id']},'attributes':[_0x0af8('0x29'),'save_name',_0x0af8('0x49')],'raw':!![]})[_0x0af8('0x23')](handleEntityNotFound(_0x3f8abc,null))[_0x0af8('0x23')](function(_0x49ba4c){if(_0x49ba4c){if(!fs[_0x0af8('0x4a')](path[_0x0af8('0x4b')](config[_0x0af8('0x4c')],_0x0af8('0x4d'),_0x49ba4c['save_name']+'.'+_0x49ba4c[_0x0af8('0x49')]))){throw new db['Sequelize'][(_0x0af8('0x4e'))]('Sound\x20not\x20found');}return _0x3f8abc[_0x0af8('0x48')](path['join'](config[_0x0af8('0x4c')],_0x0af8('0x4d'),util[_0x0af8('0x4f')](_0x0af8('0x50'),_0x49ba4c[_0x0af8('0x51')],_0x49ba4c[_0x0af8('0x49')])),util[_0x0af8('0x4f')](_0x0af8('0x50'),_0x49ba4c['name'],_0x49ba4c[_0x0af8('0x49')]));}return null;})[_0x0af8('0x52')](handleError(_0x3f8abc,null));};exports['create']=function(_0x25d76b,_0x9c6757,_0x32a36b){var _0x485f41={'name':path[_0x0af8('0x53')](_0x25d76b[_0x0af8('0x54')][_0x0af8('0x55')],path['extname'](_0x25d76b[_0x0af8('0x54')][_0x0af8('0x55')])),'save_name':path['basename'](_0x25d76b['file']['filename'],path[_0x0af8('0x56')](_0x25d76b[_0x0af8('0x54')][_0x0af8('0x57')])),'original_format':path['extname'](_0x25d76b[_0x0af8('0x54')][_0x0af8('0x55')])[_0x0af8('0x58')](0x1),'converted_format':_0x0af8('0x59')};var _0x17f9b2=path[_0x0af8('0x4b')](config[_0x0af8('0x4c')],'server/files/sounds/original',_0x25d76b[_0x0af8('0x54')]['filename']);var _0x40650d=path[_0x0af8('0x4b')](config[_0x0af8('0x4c')],_0x0af8('0x4d'),util[_0x0af8('0x4f')](_0x0af8('0x50'),path['basename'](_0x25d76b[_0x0af8('0x54')][_0x0af8('0x57')],path[_0x0af8('0x56')](_0x25d76b[_0x0af8('0x54')]['filename'])),_0x485f41['converted_format']));logger[_0x0af8('0x5a')](_0x0af8('0x5b'),_0x17f9b2);logger[_0x0af8('0x5a')](_0x0af8('0x5c'),_0x40650d);try{fs['chmodSync'](_0x17f9b2,parseInt('0777',0x8));var _0x332a34=sox[_0x0af8('0x5d')](_0x17f9b2,_0x40650d,{'sampleRate':0x1f40,'format':_0x0af8('0x59'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x332a34['on'](_0x0af8('0x27'),function(_0x5060b7){fs[_0x0af8('0x5e')](_0x17f9b2);_0x9c6757['status'](0x1f4)[_0x0af8('0x5f')](_0x5060b7);});_0x332a34['on']('src',function(_0x5b7f11){_0x485f41[_0x0af8('0x60')]=isNaN(_0x5b7f11[_0x0af8('0x61')])?null:_0x5b7f11[_0x0af8('0x61')]*0x3e8;_0x485f41['original_sampleCount']=isNaN(_0x5b7f11[_0x0af8('0x62')])?null:_0x5b7f11[_0x0af8('0x62')];_0x485f41[_0x0af8('0x63')]=isNaN(_0x5b7f11['channelCount'])?null:_0x5b7f11['channelCount'];_0x485f41[_0x0af8('0x64')]=isNaN(_0x5b7f11['bitRate'])?null:_0x5b7f11[_0x0af8('0x65')];_0x485f41[_0x0af8('0x66')]=isNaN(_0x5b7f11[_0x0af8('0x67')])?null:_0x5b7f11[_0x0af8('0x67')];});_0x332a34['on'](_0x0af8('0x68'),function(_0x28eca5){_0x485f41[_0x0af8('0x69')]=isNaN(_0x28eca5['duration'])?null:_0x28eca5[_0x0af8('0x61')]*0x3e8;_0x485f41['converted_sampleCount']=isNaN(_0x28eca5[_0x0af8('0x62')])?null:_0x28eca5[_0x0af8('0x62')];_0x485f41['converted_channelCount']=isNaN(_0x28eca5[_0x0af8('0x6a')])?null:_0x28eca5[_0x0af8('0x6a')];_0x485f41[_0x0af8('0x6b')]=isNaN(_0x28eca5[_0x0af8('0x65')])?null:_0x28eca5[_0x0af8('0x65')];_0x485f41[_0x0af8('0x6c')]=isNaN(_0x28eca5['sampleRate'])?null:_0x28eca5[_0x0af8('0x67')];});_0x332a34['on']('end',function(){fs[_0x0af8('0x6d')](_0x40650d,parseInt(_0x0af8('0x6e'),0x8));return db[_0x0af8('0x2c')]['create'](_0x485f41)['then'](function(_0x4896ce){var _0x56ba3d={'role':_0x25d76b['body'][_0x0af8('0x6f')],'userProfileId':_0x25d76b[_0x0af8('0x70')][_0x0af8('0x71')]};if(!_0x56ba3d)throw new Error(_0x0af8('0x72'));if(_0x56ba3d[_0x0af8('0x6f')]===_0x0af8('0x73')){var _0x17e4ab=_0x4896ce[_0x0af8('0x74')]({'plain':!![]});return db[_0x0af8('0x75')]['find']({'where':{'name':_0x0af8('0x25'),'userProfileId':_0x56ba3d[_0x0af8('0x71')]},'raw':!![]})[_0x0af8('0x23')](function(_0x4884de){if(_0x4884de&&_0x4884de[_0x0af8('0x76')]===0x0){return db[_0x0af8('0x26')][_0x0af8('0x77')]({'name':_0x17e4ab[_0x0af8('0x29')],'resourceId':_0x17e4ab['id'],'type':_0x4884de[_0x0af8('0x29')],'sectionId':_0x4884de['id']},{})[_0x0af8('0x23')](function(){return _0x4896ce;});}else{return _0x4896ce;}})['catch'](function(_0x5b5d79){logger[_0x0af8('0x27')](_0x0af8('0x78'),_0x5b5d79);throw _0x5b5d79;});}return _0x4896ce;})[_0x0af8('0x23')](respondWithResult(_0x9c6757,null))[_0x0af8('0x52')](handleError(_0x9c6757,null));});_0x332a34['start']();}catch(_0x5e6313){_0x9c6757['status'](0x1f4)[_0x0af8('0x5f')](_0x5e6313);}};exports[_0x0af8('0x22')]=function(_0xc8a9f2,_0x1f719a,_0xd982e2){return db[_0x0af8('0x2c')][_0x0af8('0x79')]({'where':{'id':_0xc8a9f2[_0x0af8('0x47')]['id']}})['then'](handleEntityNotFound(_0x1f719a,null))[_0x0af8('0x23')](saveUpdates(_[_0x0af8('0x3e')](_0xc8a9f2[_0x0af8('0x70')],[_0x0af8('0x29'),_0x0af8('0x7a')]),null))[_0x0af8('0x23')](respondWithResult(_0x1f719a,null))['catch'](handleError(_0x1f719a,null));};exports[_0x0af8('0x7b')]=function(_0x500bd8,_0x4b8fa8,_0xe569ef){return db[_0x0af8('0x2c')][_0x0af8('0x79')]({'where':{'id':_0x500bd8[_0x0af8('0x47')]['id']}})[_0x0af8('0x23')](function(_0x2e103a){if(_0x2e103a){return _0x2e103a[_0x0af8('0x24')]();}})['then'](function(_0x2ea76a){var _0x566d33=path[_0x0af8('0x4b')](config['root'],_0x0af8('0x7c'),util[_0x0af8('0x4f')](_0x0af8('0x50'),_0x2ea76a[_0x0af8('0x51')],_0x2ea76a[_0x0af8('0x7d')]));var _0x5330cd=path[_0x0af8('0x4b')](config[_0x0af8('0x4c')],_0x0af8('0x4d'),util[_0x0af8('0x4f')]('%s.%s',_0x2ea76a[_0x0af8('0x51')],_0x2ea76a[_0x0af8('0x49')]));fs[_0x0af8('0x5e')](_0x566d33);fs[_0x0af8('0x5e')](_0x5330cd);return _0x2ea76a;})[_0x0af8('0x23')](function(_0x32f742){if(_0x32f742){return _0x4b8fa8['status'](0xcc)[_0x0af8('0x1a')]();}})[_0x0af8('0x23')](handleEntityNotFound(_0x4b8fa8,null))[_0x0af8('0x52')](handleError(_0x4b8fa8,null));}; \ No newline at end of file +var _0xb208=['Content-Range','json','reject','save','update','then','destroy','Sounds','UserProfileResource','error','stack','name','map','Sound','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','where','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','find','download','save_name','existsSync','root','server/files/sounds/converted','converted_format','Sequelize','Sound\x20not\x20found','join','format','create','basename','file','extname','originalname','filename','wav','server/files/sounds/original','%s.%s','Sound\x20upload\x20filepath:\x20%s','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','unlinkSync','send','src','duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','body','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','pick','description','delete','original_format','eml-format','rimraf','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb208,0x154));var _0x8b20=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xb208[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0x8b20('0x0'));var rimraf=require(_0x8b20('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8b20('0x2'));var moment=require('moment');var BPromise=require(_0x8b20('0x3'));var Mustache=require(_0x8b20('0x4'));var util=require('util');var path=require(_0x8b20('0x5'));var sox=require(_0x8b20('0x6'));var csv=require(_0x8b20('0x7'));var ejs=require(_0x8b20('0x8'));var fs=require('fs');var fs_extra=require(_0x8b20('0x9'));var _=require(_0x8b20('0xa'));var squel=require(_0x8b20('0xb'));var crypto=require(_0x8b20('0xc'));var jsforce=require(_0x8b20('0xd'));var deskjs=require(_0x8b20('0xe'));var toCsv=require(_0x8b20('0x7'));var querystring=require(_0x8b20('0xf'));var Papa=require(_0x8b20('0x10'));var Redis=require(_0x8b20('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8b20('0x12'));var as=require(_0x8b20('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8b20('0x14'))('api');var utils=require(_0x8b20('0x15'));var config=require(_0x8b20('0x16'));var licenseUtil=require(_0x8b20('0x17'));var db=require(_0x8b20('0x18'))['db'];function respondWithStatusCode(_0x22e695,_0x2205f4){_0x2205f4=_0x2205f4||0xcc;return function(_0x3475f0){if(_0x3475f0){return _0x22e695[_0x8b20('0x19')](_0x2205f4);}return _0x22e695[_0x8b20('0x1a')](_0x2205f4)[_0x8b20('0x1b')]();};}function respondWithResult(_0x51c02a,_0xfba0a0){_0xfba0a0=_0xfba0a0||0xc8;return function(_0x34eb93){if(_0x34eb93){return _0x51c02a[_0x8b20('0x1a')](_0xfba0a0)['json'](_0x34eb93);}};}function respondWithFilteredResult(_0xcda597,_0x559b73){return function(_0x15ff0f){if(_0x15ff0f){var _0x53c728=typeof _0x559b73['offset']===_0x8b20('0x1c')&&typeof _0x559b73[_0x8b20('0x1d')]==='undefined';var _0xcb119e=_0x15ff0f[_0x8b20('0x1e')];var _0x616182=_0x53c728?0x0:_0x559b73[_0x8b20('0x1f')];var _0x2f5169=_0x53c728?_0x15ff0f[_0x8b20('0x1e')]:_0x559b73[_0x8b20('0x1f')]+_0x559b73[_0x8b20('0x1d')];var _0x3ad093;if(_0x2f5169>=_0xcb119e){_0x2f5169=_0xcb119e;_0x3ad093=0xc8;}else{_0x3ad093=0xce;}_0xcda597[_0x8b20('0x1a')](_0x3ad093);return _0xcda597['set'](_0x8b20('0x20'),_0x616182+'-'+_0x2f5169+'/'+_0xcb119e)[_0x8b20('0x21')](_0x15ff0f);}return null;};}function patchUpdates(_0x48cee8){return function(_0x284c22){try{jsonpatch['apply'](_0x284c22,_0x48cee8,!![]);}catch(_0x475303){return BPromise[_0x8b20('0x22')](_0x475303);}return _0x284c22[_0x8b20('0x23')]();};}function saveUpdates(_0x212fec,_0x39764c){return function(_0x4b5fe4){if(_0x4b5fe4){return _0x4b5fe4[_0x8b20('0x24')](_0x212fec)[_0x8b20('0x25')](function(_0x10e143){return _0x10e143;});}return null;};}function removeEntity(_0x44ebe0,_0x23e116){return function(_0x5668bc){if(_0x5668bc){return _0x5668bc[_0x8b20('0x26')]()[_0x8b20('0x25')](function(){var _0x421997=_0x5668bc['get']({'plain':!![]});var _0x566c6d=_0x8b20('0x27');return db[_0x8b20('0x28')][_0x8b20('0x26')]({'where':{'type':_0x566c6d,'resourceId':_0x421997['id']}})['then'](function(){return _0x5668bc;});})[_0x8b20('0x25')](function(){_0x44ebe0[_0x8b20('0x1a')](0xcc)[_0x8b20('0x1b')]();});}};}function handleEntityNotFound(_0x286941,_0x3a0873){return function(_0xe45dca){if(!_0xe45dca){_0x286941[_0x8b20('0x19')](0x194);}return _0xe45dca;};}function handleError(_0x506472,_0x116e78){_0x116e78=_0x116e78||0x1f4;return function(_0x3bcb75){logger[_0x8b20('0x29')](_0x3bcb75[_0x8b20('0x2a')]);if(_0x3bcb75[_0x8b20('0x2b')]){delete _0x3bcb75['name'];}_0x506472[_0x8b20('0x1a')](_0x116e78)['send'](_0x3bcb75);};}exports['index']=function(_0x39e46e,_0x130379){var _0x312bcd={},_0x4f513d={},_0x2b7654={'count':0x0,'rows':[]};var _0x325918=_[_0x8b20('0x2c')](db[_0x8b20('0x2d')][_0x8b20('0x2e')],function(_0x2502a7){return{'name':_0x2502a7[_0x8b20('0x2f')],'type':_0x2502a7[_0x8b20('0x30')]['key']};});_0x4f513d[_0x8b20('0x31')]=_[_0x8b20('0x2c')](_0x325918,_0x8b20('0x2b'));_0x4f513d[_0x8b20('0x32')]=_['keys'](_0x39e46e[_0x8b20('0x32')]);_0x4f513d['filters']=_[_0x8b20('0x33')](_0x4f513d[_0x8b20('0x31')],_0x4f513d[_0x8b20('0x32')]);_0x312bcd[_0x8b20('0x34')]=_['intersection'](_0x4f513d[_0x8b20('0x31')],qs[_0x8b20('0x35')](_0x39e46e[_0x8b20('0x32')][_0x8b20('0x35')]));_0x312bcd[_0x8b20('0x34')]=_0x312bcd[_0x8b20('0x34')][_0x8b20('0x36')]?_0x312bcd['attributes']:_0x4f513d['model'];if(!_0x39e46e['query'][_0x8b20('0x37')](_0x8b20('0x38'))){_0x312bcd[_0x8b20('0x1d')]=qs[_0x8b20('0x1d')](_0x39e46e[_0x8b20('0x32')][_0x8b20('0x1d')]);_0x312bcd[_0x8b20('0x1f')]=qs[_0x8b20('0x1f')](_0x39e46e['query'][_0x8b20('0x1f')]);}_0x312bcd[_0x8b20('0x39')]=qs['sort'](_0x39e46e[_0x8b20('0x32')][_0x8b20('0x3a')]);_0x312bcd['where']=qs['filters'](_['pick'](_0x39e46e[_0x8b20('0x32')],_0x4f513d[_0x8b20('0x3b')]),_0x325918);if(_0x39e46e[_0x8b20('0x32')]['filter']){_0x312bcd[_0x8b20('0x3c')]=_[_0x8b20('0x3d')](_0x312bcd[_0x8b20('0x3c')],{'$or':_[_0x8b20('0x2c')](_0x325918,function(_0x2d856f){if(_0x2d856f[_0x8b20('0x30')]!=='VIRTUAL'){var _0x2a8a56={};_0x2a8a56[_0x2d856f[_0x8b20('0x2b')]]={'$like':'%'+_0x39e46e['query'][_0x8b20('0x3e')]+'%'};return _0x2a8a56;}})});}_0x312bcd=_[_0x8b20('0x3d')]({},_0x312bcd,_0x39e46e[_0x8b20('0x3f')]);var _0x5a9f43={'where':_0x312bcd[_0x8b20('0x3c')]};return db[_0x8b20('0x2d')][_0x8b20('0x1e')](_0x5a9f43)[_0x8b20('0x25')](function(_0x24a750){_0x2b7654[_0x8b20('0x1e')]=_0x24a750;if(_0x39e46e[_0x8b20('0x32')][_0x8b20('0x40')]){_0x312bcd[_0x8b20('0x41')]=[{'all':!![]}];}return db[_0x8b20('0x2d')][_0x8b20('0x42')](_0x312bcd);})['then'](function(_0xff5697){_0x2b7654[_0x8b20('0x43')]=_0xff5697;return _0x2b7654;})[_0x8b20('0x25')](respondWithFilteredResult(_0x130379,_0x312bcd))[_0x8b20('0x44')](handleError(_0x130379,null));};exports[_0x8b20('0x45')]=function(_0x346f98,_0x2102b4){var _0x5e205e={'raw':!![],'where':{'id':_0x346f98[_0x8b20('0x46')]['id']}},_0x55ce90={};_0x55ce90[_0x8b20('0x31')]=_['keys'](db[_0x8b20('0x2d')]['rawAttributes']);_0x55ce90[_0x8b20('0x32')]=_['keys'](_0x346f98[_0x8b20('0x32')]);_0x55ce90[_0x8b20('0x3b')]=_[_0x8b20('0x33')](_0x55ce90['model'],_0x55ce90[_0x8b20('0x32')]);_0x5e205e[_0x8b20('0x34')]=_[_0x8b20('0x33')](_0x55ce90[_0x8b20('0x31')],qs[_0x8b20('0x35')](_0x346f98['query'][_0x8b20('0x35')]));_0x5e205e[_0x8b20('0x34')]=_0x5e205e[_0x8b20('0x34')][_0x8b20('0x36')]?_0x5e205e[_0x8b20('0x34')]:_0x55ce90[_0x8b20('0x31')];if(_0x346f98[_0x8b20('0x32')][_0x8b20('0x40')]){_0x5e205e['include']=[{'all':!![]}];}_0x5e205e=_[_0x8b20('0x3d')]({},_0x5e205e,_0x346f98[_0x8b20('0x3f')]);return db['Sound'][_0x8b20('0x47')](_0x5e205e)[_0x8b20('0x25')](handleEntityNotFound(_0x2102b4,null))[_0x8b20('0x25')](respondWithResult(_0x2102b4,null))[_0x8b20('0x44')](handleError(_0x2102b4,null));};exports[_0x8b20('0x48')]=function(_0x3d48bc,_0x2a7c82,_0x2b4f8f){return db[_0x8b20('0x2d')][_0x8b20('0x47')]({'where':{'id':_0x3d48bc[_0x8b20('0x46')]['id']},'attributes':[_0x8b20('0x2b'),_0x8b20('0x49'),'converted_format'],'raw':!![]})[_0x8b20('0x25')](handleEntityNotFound(_0x2a7c82,null))[_0x8b20('0x25')](function(_0x1f8d62){if(_0x1f8d62){if(!fs[_0x8b20('0x4a')](path['join'](config[_0x8b20('0x4b')],_0x8b20('0x4c'),_0x1f8d62[_0x8b20('0x49')]+'.'+_0x1f8d62[_0x8b20('0x4d')]))){throw new db[(_0x8b20('0x4e'))]['ValidationError'](_0x8b20('0x4f'));}return _0x2a7c82[_0x8b20('0x48')](path[_0x8b20('0x50')](config['root'],_0x8b20('0x4c'),util['format']('%s.%s',_0x1f8d62[_0x8b20('0x49')],_0x1f8d62[_0x8b20('0x4d')])),util[_0x8b20('0x51')]('%s.%s',_0x1f8d62['name'],_0x1f8d62[_0x8b20('0x4d')]));}return null;})['catch'](handleError(_0x2a7c82,null));};exports[_0x8b20('0x52')]=function(_0x510480,_0x3a0fb5,_0x157897){var _0x24d219={'name':path[_0x8b20('0x53')](_0x510480[_0x8b20('0x54')]['originalname'],path[_0x8b20('0x55')](_0x510480['file'][_0x8b20('0x56')])),'save_name':path[_0x8b20('0x53')](_0x510480['file'][_0x8b20('0x57')],path[_0x8b20('0x55')](_0x510480[_0x8b20('0x54')]['filename'])),'original_format':path[_0x8b20('0x55')](_0x510480[_0x8b20('0x54')][_0x8b20('0x56')])['substring'](0x1),'converted_format':_0x8b20('0x58')};var _0x3556d7=path[_0x8b20('0x50')](config[_0x8b20('0x4b')],_0x8b20('0x59'),_0x510480[_0x8b20('0x54')][_0x8b20('0x57')]);var _0x50bdad=path[_0x8b20('0x50')](config[_0x8b20('0x4b')],_0x8b20('0x4c'),util[_0x8b20('0x51')](_0x8b20('0x5a'),path[_0x8b20('0x53')](_0x510480[_0x8b20('0x54')][_0x8b20('0x57')],path[_0x8b20('0x55')](_0x510480['file'][_0x8b20('0x57')])),_0x24d219[_0x8b20('0x4d')]));logger['info'](_0x8b20('0x5b'),_0x3556d7);logger[_0x8b20('0x5c')](_0x8b20('0x5d'),_0x50bdad);try{fs[_0x8b20('0x5e')](_0x3556d7,parseInt(_0x8b20('0x5f'),0x8));var _0x4266e4=sox['transcode'](_0x3556d7,_0x50bdad,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4266e4['on'](_0x8b20('0x29'),function(_0x5d36a8){fs[_0x8b20('0x60')](_0x3556d7);_0x3a0fb5[_0x8b20('0x1a')](0x1f4)[_0x8b20('0x61')](_0x5d36a8);});_0x4266e4['on'](_0x8b20('0x62'),function(_0xe112b7){_0x24d219['original_duration']=isNaN(_0xe112b7[_0x8b20('0x63')])?null:_0xe112b7[_0x8b20('0x63')]*0x3e8;_0x24d219['original_sampleCount']=isNaN(_0xe112b7[_0x8b20('0x64')])?null:_0xe112b7['sampleCount'];_0x24d219[_0x8b20('0x65')]=isNaN(_0xe112b7['channelCount'])?null:_0xe112b7[_0x8b20('0x66')];_0x24d219[_0x8b20('0x67')]=isNaN(_0xe112b7[_0x8b20('0x68')])?null:_0xe112b7['bitRate'];_0x24d219[_0x8b20('0x69')]=isNaN(_0xe112b7[_0x8b20('0x6a')])?null:_0xe112b7['sampleRate'];});_0x4266e4['on'](_0x8b20('0x6b'),function(_0x17820a){_0x24d219[_0x8b20('0x6c')]=isNaN(_0x17820a[_0x8b20('0x63')])?null:_0x17820a[_0x8b20('0x63')]*0x3e8;_0x24d219[_0x8b20('0x6d')]=isNaN(_0x17820a[_0x8b20('0x64')])?null:_0x17820a[_0x8b20('0x64')];_0x24d219[_0x8b20('0x6e')]=isNaN(_0x17820a[_0x8b20('0x66')])?null:_0x17820a[_0x8b20('0x66')];_0x24d219[_0x8b20('0x6f')]=isNaN(_0x17820a[_0x8b20('0x68')])?null:_0x17820a[_0x8b20('0x68')];_0x24d219[_0x8b20('0x70')]=isNaN(_0x17820a[_0x8b20('0x6a')])?null:_0x17820a['sampleRate'];});_0x4266e4['on']('end',function(){fs['chmodSync'](_0x50bdad,parseInt(_0x8b20('0x5f'),0x8));return db['Sound'][_0x8b20('0x52')](_0x24d219)['then'](function(_0x4702bc){var _0x1e590e={'role':_0x510480[_0x8b20('0x71')][_0x8b20('0x72')],'userProfileId':_0x510480['body']['userProfileId']};if(!_0x1e590e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1e590e['role']===_0x8b20('0x73')){var _0x5462fc=_0x4702bc['get']({'plain':!![]});return db[_0x8b20('0x74')][_0x8b20('0x47')]({'where':{'name':'Sounds','userProfileId':_0x1e590e[_0x8b20('0x75')]},'raw':!![]})[_0x8b20('0x25')](function(_0x5b565c){if(_0x5b565c&&_0x5b565c[_0x8b20('0x76')]===0x0){return db[_0x8b20('0x28')][_0x8b20('0x52')]({'name':_0x5462fc[_0x8b20('0x2b')],'resourceId':_0x5462fc['id'],'type':_0x5b565c[_0x8b20('0x2b')],'sectionId':_0x5b565c['id']},{})[_0x8b20('0x25')](function(){return _0x4702bc;});}else{return _0x4702bc;}})['catch'](function(_0x35a17e){logger['error'](_0x8b20('0x77'),_0x35a17e);throw _0x35a17e;});}return _0x4702bc;})[_0x8b20('0x25')](respondWithResult(_0x3a0fb5,null))[_0x8b20('0x44')](handleError(_0x3a0fb5,null));});_0x4266e4['start']();}catch(_0x4b5f1a){_0x3a0fb5[_0x8b20('0x1a')](0x1f4)[_0x8b20('0x61')](_0x4b5f1a);}};exports['update']=function(_0xdaf916,_0x3acc95,_0x1587d6){return db['Sound'][_0x8b20('0x47')]({'where':{'id':_0xdaf916['params']['id']}})[_0x8b20('0x25')](handleEntityNotFound(_0x3acc95,null))[_0x8b20('0x25')](saveUpdates(_[_0x8b20('0x78')](_0xdaf916[_0x8b20('0x71')],[_0x8b20('0x2b'),_0x8b20('0x79')]),null))[_0x8b20('0x25')](respondWithResult(_0x3acc95,null))[_0x8b20('0x44')](handleError(_0x3acc95,null));};exports[_0x8b20('0x7a')]=function(_0x4fa75f,_0x2c812c,_0x5df1f5){return db[_0x8b20('0x2d')]['find']({'where':{'id':_0x4fa75f[_0x8b20('0x46')]['id']}})[_0x8b20('0x25')](function(_0x514c52){if(_0x514c52){return _0x514c52['destroy']();}})[_0x8b20('0x25')](function(_0xf05759){var _0x3fb463=path[_0x8b20('0x50')](config[_0x8b20('0x4b')],_0x8b20('0x59'),util[_0x8b20('0x51')](_0x8b20('0x5a'),_0xf05759['save_name'],_0xf05759[_0x8b20('0x7b')]));var _0x7c856=path[_0x8b20('0x50')](config[_0x8b20('0x4b')],_0x8b20('0x4c'),util[_0x8b20('0x51')](_0x8b20('0x5a'),_0xf05759[_0x8b20('0x49')],_0xf05759[_0x8b20('0x4d')]));fs[_0x8b20('0x60')](_0x3fb463);fs[_0x8b20('0x60')](_0x7c856);return _0xf05759;})[_0x8b20('0x25')](function(_0x37e62c){if(_0x37e62c){return _0x2c812c[_0x8b20('0x1a')](0xcc)['end']();}})[_0x8b20('0x25')](handleEntityNotFound(_0x2c812c,null))[_0x8b20('0x44')](handleError(_0x2c812c,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 44880f5..a6cce0f 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 _0x02f5=['rimraf','../../config/environment','./sound.attributes','exports','define','tools_sounds','lodash','../../config/logger','api','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x02f5,0x10e));var _0x502f=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x02f5[_0x5f309e];return _0x487b5e;};'use strict';var _=require(_0x502f('0x0'));var util=require('util');var logger=require(_0x502f('0x1'))(_0x502f('0x2'));var moment=require('moment');var BPromise=require(_0x502f('0x3'));var rp=require(_0x502f('0x4'));var fs=require('fs');var path=require(_0x502f('0x5'));var rimraf=require(_0x502f('0x6'));var config=require(_0x502f('0x7'));var attributes=require(_0x502f('0x8'));module[_0x502f('0x9')]=function(_0x1b8a21,_0x113587){return _0x1b8a21[_0x502f('0xa')]('Sound',attributes,{'tableName':_0x502f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1506=['../../config/environment','./sound.attributes','exports','define','Sound','lodash','../../config/logger','api','bluebird','path','rimraf'];(function(_0x30e7e2,_0xb1c7e6){var _0x37c8dc=function(_0x2f45df){while(--_0x2f45df){_0x30e7e2['push'](_0x30e7e2['shift']());}};_0x37c8dc(++_0xb1c7e6);}(_0x1506,0x10d));var _0x6150=function(_0x28d20f,_0x2435fa){_0x28d20f=_0x28d20f-0x0;var _0x1aec0c=_0x1506[_0x28d20f];return _0x1aec0c;};'use strict';var _=require(_0x6150('0x0'));var util=require('util');var logger=require(_0x6150('0x1'))(_0x6150('0x2'));var moment=require('moment');var BPromise=require(_0x6150('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6150('0x4'));var rimraf=require(_0x6150('0x5'));var config=require(_0x6150('0x6'));var attributes=require(_0x6150('0x7'));module[_0x6150('0x8')]=function(_0x14d2e5,_0x282491){return _0x14d2e5[_0x6150('0x9')](_0x6150('0xa'),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 d8bc0da..616b1c0 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 _0xf5b2=['client','request','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowSound','Sound','find','options','where','attributes','include','map','model','then','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xf5b2,0xb6));var _0x2f5b=function(_0x2d9535,_0x4bc592){_0x2d9535=_0x2d9535-0x0;var _0xb4e710=_0xf5b2[_0x2d9535];return _0xb4e710;};'use strict';var _=require('lodash');var util=require(_0x2f5b('0x0'));var moment=require(_0x2f5b('0x1'));var BPromise=require(_0x2f5b('0x2'));var rs=require(_0x2f5b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2f5b('0x4'))['db'];var utils=require(_0x2f5b('0x5'));var logger=require(_0x2f5b('0x6'))(_0x2f5b('0x7'));var config=require(_0x2f5b('0x8'));var jayson=require(_0x2f5b('0x9'));var client=jayson[_0x2f5b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x515508,_0x425c53,_0x29aca2){return new BPromise(function(_0xf2fa7,_0x59225e){return client[_0x2f5b('0xb')](_0x515508,_0x29aca2)['then'](function(_0x45fb7f){logger[_0x2f5b('0xc')](_0x2f5b('0xd'),_0x425c53,_0x2f5b('0xe'));logger[_0x2f5b('0xf')](_0x2f5b('0x10'),_0x425c53,_0x2f5b('0xe'),JSON[_0x2f5b('0x11')](_0x45fb7f));if(_0x45fb7f['error']){if(_0x45fb7f['error']['code']===0x1f4){logger[_0x2f5b('0x12')](_0x2f5b('0xd'),_0x425c53,_0x45fb7f[_0x2f5b('0x12')][_0x2f5b('0x13')]);return _0x59225e(_0x45fb7f['error'][_0x2f5b('0x13')]);}logger[_0x2f5b('0x12')](_0x2f5b('0xd'),_0x425c53,_0x45fb7f['error'][_0x2f5b('0x13')]);return _0xf2fa7(_0x45fb7f[_0x2f5b('0x12')]['message']);}else{logger['info'](_0x2f5b('0xd'),_0x425c53,_0x2f5b('0xe'));_0xf2fa7(_0x45fb7f[_0x2f5b('0x14')][_0x2f5b('0x13')]);}})[_0x2f5b('0x15')](function(_0xed86e1){logger[_0x2f5b('0x12')](_0x2f5b('0xd'),_0x425c53,_0xed86e1);_0x59225e(_0xed86e1);});});}exports[_0x2f5b('0x16')]=function(_0x39db3b){var _0x51e228=this;return new Promise(function(_0x2c3d55,_0x15d497){return db[_0x2f5b('0x17')][_0x2f5b('0x18')]({'raw':_0x39db3b[_0x2f5b('0x19')]?_0x39db3b[_0x2f5b('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x39db3b[_0x2f5b('0x19')]?_0x39db3b['options'][_0x2f5b('0x1a')]||null:null,'attributes':_0x39db3b[_0x2f5b('0x19')]?_0x39db3b[_0x2f5b('0x19')][_0x2f5b('0x1b')]||null:null,'include':_0x39db3b[_0x2f5b('0x19')]?_0x39db3b[_0x2f5b('0x19')][_0x2f5b('0x1c')]?_[_0x2f5b('0x1d')](_0x39db3b[_0x2f5b('0x19')][_0x2f5b('0x1c')],function(_0x4b99a1){return{'model':db[_0x4b99a1['model']],'as':_0x4b99a1['as'],'attributes':_0x4b99a1[_0x2f5b('0x1b')],'include':_0x4b99a1['include']?_[_0x2f5b('0x1d')](_0x4b99a1[_0x2f5b('0x1c')],function(_0x2cf385){return{'model':db[_0x2cf385[_0x2f5b('0x1e')]],'as':_0x2cf385['as'],'attributes':_0x2cf385['attributes'],'include':_0x2cf385[_0x2f5b('0x1c')]?_[_0x2f5b('0x1d')](_0x2cf385[_0x2f5b('0x1c')],function(_0x293a74){return{'model':db[_0x293a74['model']],'as':_0x293a74['as'],'attributes':_0x293a74[_0x2f5b('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2f5b('0x1f')](function(_0x3d71ce){logger[_0x2f5b('0xc')]('ShowSound',_0x39db3b);logger[_0x2f5b('0xf')](_0x2f5b('0x16'),_0x39db3b,JSON[_0x2f5b('0x11')](_0x3d71ce));_0x2c3d55(_0x3d71ce);})[_0x2f5b('0x15')](function(_0x3bffa5){logger[_0x2f5b('0x12')](_0x2f5b('0x16'),_0x3bffa5['message'],_0x39db3b);_0x15d497(_0x51e228[_0x2f5b('0x12')](0x1f4,_0x3bffa5[_0x2f5b('0x13')]));});});}; \ No newline at end of file +var _0x75d1=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','ShowSound','Sound','options','attributes','include','map','model','moment'];(function(_0x548653,_0x24fa82){var _0x139a59=function(_0x227270){while(--_0x227270){_0x548653['push'](_0x548653['shift']());}};_0x139a59(++_0x24fa82);}(_0x75d1,0x1b2));var _0x175d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x75d1[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x175d('0x0'));var BPromise=require(_0x175d('0x1'));var rs=require(_0x175d('0x2'));var fs=require('fs');var Redis=require(_0x175d('0x3'));var db=require(_0x175d('0x4'))['db'];var utils=require(_0x175d('0x5'));var logger=require(_0x175d('0x6'))(_0x175d('0x7'));var config=require(_0x175d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x175d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xdded7d,_0x5749a1,_0xfcba86){return new BPromise(function(_0xd0ed9c,_0x59cdbb){return client[_0x175d('0xa')](_0xdded7d,_0xfcba86)[_0x175d('0xb')](function(_0x24e1fb){logger[_0x175d('0xc')](_0x175d('0xd'),_0x5749a1,_0x175d('0xe'));logger[_0x175d('0xf')]('Sound,\x20%s,\x20%s,\x20%s',_0x5749a1,_0x175d('0xe'),JSON[_0x175d('0x10')](_0x24e1fb));if(_0x24e1fb[_0x175d('0x11')]){if(_0x24e1fb['error'][_0x175d('0x12')]===0x1f4){logger[_0x175d('0x11')](_0x175d('0xd'),_0x5749a1,_0x24e1fb[_0x175d('0x11')][_0x175d('0x13')]);return _0x59cdbb(_0x24e1fb[_0x175d('0x11')]['message']);}logger['error'](_0x175d('0xd'),_0x5749a1,_0x24e1fb[_0x175d('0x11')]['message']);return _0xd0ed9c(_0x24e1fb[_0x175d('0x11')][_0x175d('0x13')]);}else{logger[_0x175d('0xc')]('Sound,\x20%s,\x20%s',_0x5749a1,_0x175d('0xe'));_0xd0ed9c(_0x24e1fb[_0x175d('0x14')][_0x175d('0x13')]);}})[_0x175d('0x15')](function(_0x43cb5d){logger['error'](_0x175d('0xd'),_0x5749a1,_0x43cb5d);_0x59cdbb(_0x43cb5d);});});}exports[_0x175d('0x16')]=function(_0x1401dd){var _0x22e064=this;return new Promise(function(_0x413098,_0x575412){return db[_0x175d('0x17')]['find']({'raw':_0x1401dd['options']?_0x1401dd[_0x175d('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1401dd[_0x175d('0x18')]?_0x1401dd[_0x175d('0x18')]['where']||null:null,'attributes':_0x1401dd['options']?_0x1401dd[_0x175d('0x18')][_0x175d('0x19')]||null:null,'include':_0x1401dd[_0x175d('0x18')]?_0x1401dd[_0x175d('0x18')][_0x175d('0x1a')]?_[_0x175d('0x1b')](_0x1401dd[_0x175d('0x18')]['include'],function(_0xe6ea80){return{'model':db[_0xe6ea80[_0x175d('0x1c')]],'as':_0xe6ea80['as'],'attributes':_0xe6ea80['attributes'],'include':_0xe6ea80[_0x175d('0x1a')]?_[_0x175d('0x1b')](_0xe6ea80[_0x175d('0x1a')],function(_0x5b688b){return{'model':db[_0x5b688b[_0x175d('0x1c')]],'as':_0x5b688b['as'],'attributes':_0x5b688b['attributes'],'include':_0x5b688b['include']?_[_0x175d('0x1b')](_0x5b688b[_0x175d('0x1a')],function(_0x23a848){return{'model':db[_0x23a848[_0x175d('0x1c')]],'as':_0x23a848['as'],'attributes':_0x23a848[_0x175d('0x19')]};}):[]};}):[]};}):[]:[]})[_0x175d('0xb')](function(_0x4d59f9){logger[_0x175d('0xc')](_0x175d('0x16'),_0x1401dd);logger['debug'](_0x175d('0x16'),_0x1401dd,JSON[_0x175d('0x10')](_0x4d59f9));_0x413098(_0x4d59f9);})[_0x175d('0x15')](function(_0x526aec){logger[_0x175d('0x11')]('ShowSound',_0x526aec[_0x175d('0x13')],_0x1401dd);_0x575412(_0x22e064[_0x175d('0x11')](0x1f4,_0x526aec[_0x175d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index ab89c7b..1b74331 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 _0xb10b=['./squareMessage.controller','get','index','isAuthenticated','show','post','create','put','/:id','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3f7277,_0x42a19f){var _0x88352e=function(_0x385214){while(--_0x385214){_0x3f7277['push'](_0x3f7277['shift']());}};_0x88352e(++_0x42a19f);}(_0xb10b,0x12a));var _0xbb10=function(_0xc471d2,_0x26ab16){_0xc471d2=_0xc471d2-0x0;var _0x334c68=_0xb10b[_0xc471d2];return _0x334c68;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0xd')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['update']);router['delete'](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);module['exports']=router; \ No newline at end of file +var _0xd8b0=['update','delete','destroy','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','create','put','/:id'];(function(_0x4c6790,_0x223ca4){var _0x5cf432=function(_0x5eb8c4){while(--_0x5eb8c4){_0x4c6790['push'](_0x4c6790['shift']());}};_0x5cf432(++_0x223ca4);}(_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('./squareMessage.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['post']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xb')]);router[_0x0d8b('0xc')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xd'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 106e7c1..0f06507 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 _0xb6d7=['STRING','TEXT','ENUM','out','sequelize','exports'];(function(_0x195b7e,_0xdfc658){var _0x55faf2=function(_0x19ba44){while(--_0x19ba44){_0x195b7e['push'](_0x195b7e['shift']());}};_0x55faf2(++_0xdfc658);}(_0xb6d7,0x13c));var _0x7b6d=function(_0x1467d5,_0x49db48){_0x1467d5=_0x1467d5-0x0;var _0x41c380=_0xb6d7[_0x1467d5];return _0x41c380;};'use strict';var Sequelize=require(_0x7b6d('0x0'));module[_0x7b6d('0x1')]={'uniqueid':{'type':Sequelize[_0x7b6d('0x2')]},'body':{'type':Sequelize[_0x7b6d('0x3')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x7b6d('0x4')]('in',_0x7b6d('0x5')),'defaultValue':_0x7b6d('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x7b6d('0x2')]},'providerResponse':{'type':Sequelize[_0x7b6d('0x3')]}}; \ No newline at end of file +var _0x93d4=['exports','TEXT','ENUM','out','sequelize'];(function(_0x437b14,_0xcf17d4){var _0x1ad24e=function(_0x44b236){while(--_0x44b236){_0x437b14['push'](_0x437b14['shift']());}};_0x1ad24e(++_0xcf17d4);}(_0x93d4,0x108));var _0x493d=function(_0x3210c1,_0x12a9ce){_0x3210c1=_0x3210c1-0x0;var _0x10c307=_0x93d4[_0x3210c1];return _0x10c307;};'use strict';var Sequelize=require(_0x493d('0x0'));module[_0x493d('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x493d('0x2')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x493d('0x3')]('in',_0x493d('0x4')),'defaultValue':_0x493d('0x4'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'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 02d65c0..2b4b3d3 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 _0xdc7b=['send','index','map','SquareMessage','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','save','then','destroy','stack','name'];(function(_0x5a99db,_0x1cece5){var _0x3aad62=function(_0x334cb7){while(--_0x334cb7){_0x5a99db['push'](_0x5a99db['shift']());}};_0x3aad62(++_0x1cece5);}(_0xdc7b,0x153));var _0xbdc7=function(_0x5977f5,_0x2a679a){_0x5977f5=_0x5977f5-0x0;var _0x64a481=_0xdc7b[_0x5977f5];return _0x64a481;};'use strict';var emlformat=require(_0xbdc7('0x0'));var rimraf=require(_0xbdc7('0x1'));var zipdir=require(_0xbdc7('0x2'));var jsonpatch=require(_0xbdc7('0x3'));var rp=require(_0xbdc7('0x4'));var moment=require(_0xbdc7('0x5'));var BPromise=require(_0xbdc7('0x6'));var Mustache=require('mustache');var util=require(_0xbdc7('0x7'));var path=require(_0xbdc7('0x8'));var sox=require(_0xbdc7('0x9'));var csv=require('to-csv');var ejs=require(_0xbdc7('0xa'));var fs=require('fs');var fs_extra=require(_0xbdc7('0xb'));var _=require(_0xbdc7('0xc'));var squel=require(_0xbdc7('0xd'));var crypto=require(_0xbdc7('0xe'));var jsforce=require(_0xbdc7('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xbdc7('0x10'));var querystring=require(_0xbdc7('0x11'));var Papa=require(_0xbdc7('0x12'));var Redis=require(_0xbdc7('0x13'));var authService=require(_0xbdc7('0x14'));var qs=require(_0xbdc7('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbdc7('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xbdc7('0x17'));var config=require(_0xbdc7('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xbdc7('0x19'))['db'];function respondWithStatusCode(_0x564745,_0x35c48b){_0x35c48b=_0x35c48b||0xcc;return function(_0x375900){if(_0x375900){return _0x564745[_0xbdc7('0x1a')](_0x35c48b);}return _0x564745[_0xbdc7('0x1b')](_0x35c48b)[_0xbdc7('0x1c')]();};}function respondWithResult(_0x18daec,_0x589967){_0x589967=_0x589967||0xc8;return function(_0x3045f3){if(_0x3045f3){return _0x18daec[_0xbdc7('0x1b')](_0x589967)[_0xbdc7('0x1d')](_0x3045f3);}};}function respondWithFilteredResult(_0x267145,_0x440282){return function(_0x35630a){if(_0x35630a){var _0x286a38=typeof _0x440282['offset']===_0xbdc7('0x1e')&&typeof _0x440282[_0xbdc7('0x1f')]===_0xbdc7('0x1e');var _0x4a1e1c=_0x35630a[_0xbdc7('0x20')];var _0x5677f9=_0x286a38?0x0:_0x440282[_0xbdc7('0x21')];var _0x5aa1bd=_0x286a38?_0x35630a['count']:_0x440282[_0xbdc7('0x21')]+_0x440282[_0xbdc7('0x1f')];var _0x55cfcc;if(_0x5aa1bd>=_0x4a1e1c){_0x5aa1bd=_0x4a1e1c;_0x55cfcc=0xc8;}else{_0x55cfcc=0xce;}_0x267145[_0xbdc7('0x1b')](_0x55cfcc);return _0x267145[_0xbdc7('0x22')]('Content-Range',_0x5677f9+'-'+_0x5aa1bd+'/'+_0x4a1e1c)['json'](_0x35630a);}return null;};}function patchUpdates(_0x56b9cc){return function(_0x554d54){try{jsonpatch['apply'](_0x554d54,_0x56b9cc,!![]);}catch(_0x322d28){return BPromise[_0xbdc7('0x23')](_0x322d28);}return _0x554d54[_0xbdc7('0x24')]();};}function saveUpdates(_0x4af89e,_0x5d6d2e){return function(_0x46640f){if(_0x46640f){return _0x46640f['update'](_0x4af89e)[_0xbdc7('0x25')](function(_0xa8d731){return _0xa8d731;});}return null;};}function removeEntity(_0x49d8e8,_0x224c4e){return function(_0x38d068){if(_0x38d068){return _0x38d068[_0xbdc7('0x26')]()[_0xbdc7('0x25')](function(){_0x49d8e8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x44f825,_0x23f7af){return function(_0x13edaa){if(!_0x13edaa){_0x44f825[_0xbdc7('0x1a')](0x194);}return _0x13edaa;};}function handleError(_0x3105a1,_0x19d3cf){_0x19d3cf=_0x19d3cf||0x1f4;return function(_0x31046b){logger['error'](_0x31046b[_0xbdc7('0x27')]);if(_0x31046b[_0xbdc7('0x28')]){delete _0x31046b['name'];}_0x3105a1[_0xbdc7('0x1b')](_0x19d3cf)[_0xbdc7('0x29')](_0x31046b);};}exports[_0xbdc7('0x2a')]=function(_0x2435fc,_0xad09d8){var _0x313b3d={},_0x4704ed={},_0x33e745={'count':0x0,'rows':[]};var _0x279bda=_[_0xbdc7('0x2b')](db[_0xbdc7('0x2c')][_0xbdc7('0x2d')],function(_0x52e8b2){return{'name':_0x52e8b2['fieldName'],'type':_0x52e8b2['type'][_0xbdc7('0x2e')]};});_0x4704ed[_0xbdc7('0x2f')]=_[_0xbdc7('0x2b')](_0x279bda,'name');_0x4704ed[_0xbdc7('0x30')]=_['keys'](_0x2435fc[_0xbdc7('0x30')]);_0x4704ed[_0xbdc7('0x31')]=_[_0xbdc7('0x32')](_0x4704ed['model'],_0x4704ed[_0xbdc7('0x30')]);_0x313b3d[_0xbdc7('0x33')]=_[_0xbdc7('0x32')](_0x4704ed[_0xbdc7('0x2f')],qs['fields'](_0x2435fc[_0xbdc7('0x30')][_0xbdc7('0x34')]));_0x313b3d[_0xbdc7('0x33')]=_0x313b3d[_0xbdc7('0x33')][_0xbdc7('0x35')]?_0x313b3d[_0xbdc7('0x33')]:_0x4704ed[_0xbdc7('0x2f')];if(!_0x2435fc[_0xbdc7('0x30')][_0xbdc7('0x36')](_0xbdc7('0x37'))){_0x313b3d[_0xbdc7('0x1f')]=qs[_0xbdc7('0x1f')](_0x2435fc[_0xbdc7('0x30')]['limit']);_0x313b3d['offset']=qs[_0xbdc7('0x21')](_0x2435fc[_0xbdc7('0x30')]['offset']);}_0x313b3d[_0xbdc7('0x38')]=qs[_0xbdc7('0x39')](_0x2435fc['query'][_0xbdc7('0x39')]);_0x313b3d[_0xbdc7('0x3a')]=qs[_0xbdc7('0x31')](_[_0xbdc7('0x3b')](_0x2435fc[_0xbdc7('0x30')],_0x4704ed['filters']),_0x279bda);if(_0x2435fc[_0xbdc7('0x30')][_0xbdc7('0x3c')]){_0x313b3d[_0xbdc7('0x3a')]=_[_0xbdc7('0x3d')](_0x313b3d[_0xbdc7('0x3a')],{'$or':_[_0xbdc7('0x2b')](_0x279bda,function(_0x5346ed){if(_0x5346ed[_0xbdc7('0x3e')]!==_0xbdc7('0x3f')){var _0x4a8d82={};_0x4a8d82[_0x5346ed[_0xbdc7('0x28')]]={'$like':'%'+_0x2435fc[_0xbdc7('0x30')][_0xbdc7('0x3c')]+'%'};return _0x4a8d82;}})});}_0x313b3d=_[_0xbdc7('0x3d')]({},_0x313b3d,_0x2435fc[_0xbdc7('0x40')]);var _0x5f1e39={'where':_0x313b3d[_0xbdc7('0x3a')]};return db[_0xbdc7('0x2c')][_0xbdc7('0x20')](_0x5f1e39)[_0xbdc7('0x25')](function(_0x5a427b){_0x33e745[_0xbdc7('0x20')]=_0x5a427b;if(_0x2435fc[_0xbdc7('0x30')][_0xbdc7('0x41')]){_0x313b3d[_0xbdc7('0x42')]=[{'all':!![]}];}return db[_0xbdc7('0x2c')][_0xbdc7('0x43')](_0x313b3d);})[_0xbdc7('0x25')](function(_0x3b401a){_0x33e745[_0xbdc7('0x44')]=_0x3b401a;return _0x33e745;})[_0xbdc7('0x25')](respondWithFilteredResult(_0xad09d8,_0x313b3d))[_0xbdc7('0x45')](handleError(_0xad09d8,null));};exports[_0xbdc7('0x46')]=function(_0x10616e,_0x4d424e){var _0xc0c8b9={'raw':!![],'where':{'id':_0x10616e[_0xbdc7('0x47')]['id']}},_0xfc6a6f={};_0xfc6a6f['model']=_[_0xbdc7('0x48')](db[_0xbdc7('0x2c')][_0xbdc7('0x2d')]);_0xfc6a6f['query']=_[_0xbdc7('0x48')](_0x10616e[_0xbdc7('0x30')]);_0xfc6a6f['filters']=_['intersection'](_0xfc6a6f[_0xbdc7('0x2f')],_0xfc6a6f['query']);_0xc0c8b9[_0xbdc7('0x33')]=_[_0xbdc7('0x32')](_0xfc6a6f[_0xbdc7('0x2f')],qs[_0xbdc7('0x34')](_0x10616e[_0xbdc7('0x30')]['fields']));_0xc0c8b9[_0xbdc7('0x33')]=_0xc0c8b9[_0xbdc7('0x33')][_0xbdc7('0x35')]?_0xc0c8b9[_0xbdc7('0x33')]:_0xfc6a6f[_0xbdc7('0x2f')];if(_0x10616e['query']['includeAll']){_0xc0c8b9[_0xbdc7('0x42')]=[{'all':!![]}];}_0xc0c8b9=_[_0xbdc7('0x3d')]({},_0xc0c8b9,_0x10616e['options']);return db['SquareMessage'][_0xbdc7('0x49')](_0xc0c8b9)[_0xbdc7('0x25')](handleEntityNotFound(_0x4d424e,null))[_0xbdc7('0x25')](respondWithResult(_0x4d424e,null))[_0xbdc7('0x45')](handleError(_0x4d424e,null));};exports[_0xbdc7('0x4a')]=function(_0x53234d,_0x169ae7){return db[_0xbdc7('0x2c')][_0xbdc7('0x4a')](_0x53234d[_0xbdc7('0x4b')],{})['then'](respondWithResult(_0x169ae7,0xc9))['catch'](handleError(_0x169ae7,null));};exports['update']=function(_0x32e8ce,_0x1966ca){if(_0x32e8ce[_0xbdc7('0x4b')]['id']){delete _0x32e8ce[_0xbdc7('0x4b')]['id'];}return db[_0xbdc7('0x2c')][_0xbdc7('0x49')]({'where':{'id':_0x32e8ce[_0xbdc7('0x47')]['id']}})[_0xbdc7('0x25')](handleEntityNotFound(_0x1966ca,null))[_0xbdc7('0x25')](saveUpdates(_0x32e8ce[_0xbdc7('0x4b')],null))[_0xbdc7('0x25')](respondWithResult(_0x1966ca,null))[_0xbdc7('0x45')](handleError(_0x1966ca,null));};exports[_0xbdc7('0x26')]=function(_0x37fe46,_0xa4c9f8){return db[_0xbdc7('0x2c')][_0xbdc7('0x49')]({'where':{'id':_0x37fe46['params']['id']}})[_0xbdc7('0x25')](handleEntityNotFound(_0xa4c9f8,null))['then'](removeEntity(_0xa4c9f8,null))['catch'](handleError(_0xa4c9f8,null));}; \ No newline at end of file +var _0x6df4=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','apply','reject','update','then','destroy','end','error','stack','send','index','rawAttributes','type','key','model','map','query','filters','intersection','fields','attributes','length','nolimit','where','pick','merge','VIRTUAL','name','filter','options','includeAll','include','findAll','catch','show','SquareMessage','keys','find','create','body','params','eml-format','zip-dir','fast-json-patch','mustache','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x6df4,0x78));var _0x46df=function(_0x254076,_0x5e7b8d){_0x254076=_0x254076-0x0;var _0x21a93e=_0x6df4[_0x254076];return _0x21a93e;};'use strict';var emlformat=require(_0x46df('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x46df('0x1'));var jsonpatch=require(_0x46df('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x46df('0x3'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x46df('0x4'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x46df('0x5'));var _=require(_0x46df('0x6'));var squel=require('squel');var crypto=require(_0x46df('0x7'));var jsforce=require(_0x46df('0x8'));var deskjs=require(_0x46df('0x9'));var toCsv=require(_0x46df('0x4'));var querystring=require(_0x46df('0xa'));var Papa=require('papaparse');var Redis=require(_0x46df('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x46df('0xc'));var as=require(_0x46df('0xd'));var hardwareService=require(_0x46df('0xe'));var logger=require(_0x46df('0xf'))('api');var utils=require(_0x46df('0x10'));var config=require(_0x46df('0x11'));var licenseUtil=require(_0x46df('0x12'));var db=require(_0x46df('0x13'))['db'];function respondWithStatusCode(_0x5df22f,_0x566e74){_0x566e74=_0x566e74||0xcc;return function(_0x581c74){if(_0x581c74){return _0x5df22f[_0x46df('0x14')](_0x566e74);}return _0x5df22f['status'](_0x566e74)['end']();};}function respondWithResult(_0x563149,_0x47f87c){_0x47f87c=_0x47f87c||0xc8;return function(_0x19b541){if(_0x19b541){return _0x563149[_0x46df('0x15')](_0x47f87c)[_0x46df('0x16')](_0x19b541);}};}function respondWithFilteredResult(_0x2fa06e,_0xfde1c8){return function(_0x53ad9c){if(_0x53ad9c){var _0x4df9bd=typeof _0xfde1c8[_0x46df('0x17')]==='undefined'&&typeof _0xfde1c8[_0x46df('0x18')]===_0x46df('0x19');var _0x13c7d8=_0x53ad9c[_0x46df('0x1a')];var _0x5bd894=_0x4df9bd?0x0:_0xfde1c8[_0x46df('0x17')];var _0x54f709=_0x4df9bd?_0x53ad9c[_0x46df('0x1a')]:_0xfde1c8[_0x46df('0x17')]+_0xfde1c8[_0x46df('0x18')];var _0x55ff35;if(_0x54f709>=_0x13c7d8){_0x54f709=_0x13c7d8;_0x55ff35=0xc8;}else{_0x55ff35=0xce;}_0x2fa06e[_0x46df('0x15')](_0x55ff35);return _0x2fa06e[_0x46df('0x1b')]('Content-Range',_0x5bd894+'-'+_0x54f709+'/'+_0x13c7d8)[_0x46df('0x16')](_0x53ad9c);}return null;};}function patchUpdates(_0xc654f){return function(_0x11ed92){try{jsonpatch[_0x46df('0x1c')](_0x11ed92,_0xc654f,!![]);}catch(_0x83d2ca){return BPromise[_0x46df('0x1d')](_0x83d2ca);}return _0x11ed92['save']();};}function saveUpdates(_0x449a34,_0x320824){return function(_0x4b7d9d){if(_0x4b7d9d){return _0x4b7d9d[_0x46df('0x1e')](_0x449a34)[_0x46df('0x1f')](function(_0x525917){return _0x525917;});}return null;};}function removeEntity(_0x496624,_0x35e865){return function(_0x2a5703){if(_0x2a5703){return _0x2a5703[_0x46df('0x20')]()[_0x46df('0x1f')](function(){_0x496624[_0x46df('0x15')](0xcc)[_0x46df('0x21')]();});}};}function handleEntityNotFound(_0x56eedf,_0x218b6e){return function(_0x18abb5){if(!_0x18abb5){_0x56eedf[_0x46df('0x14')](0x194);}return _0x18abb5;};}function handleError(_0x3e9240,_0x57ece8){_0x57ece8=_0x57ece8||0x1f4;return function(_0x51320f){logger[_0x46df('0x22')](_0x51320f[_0x46df('0x23')]);if(_0x51320f['name']){delete _0x51320f['name'];}_0x3e9240['status'](_0x57ece8)[_0x46df('0x24')](_0x51320f);};}exports[_0x46df('0x25')]=function(_0x5a6c75,_0x2da249){var _0x5185cf={},_0x1af759={},_0x52bed8={'count':0x0,'rows':[]};var _0x10b63b=_['map'](db['SquareMessage'][_0x46df('0x26')],function(_0x5b8a66){return{'name':_0x5b8a66['fieldName'],'type':_0x5b8a66[_0x46df('0x27')][_0x46df('0x28')]};});_0x1af759[_0x46df('0x29')]=_[_0x46df('0x2a')](_0x10b63b,'name');_0x1af759[_0x46df('0x2b')]=_['keys'](_0x5a6c75[_0x46df('0x2b')]);_0x1af759[_0x46df('0x2c')]=_['intersection'](_0x1af759[_0x46df('0x29')],_0x1af759[_0x46df('0x2b')]);_0x5185cf['attributes']=_[_0x46df('0x2d')](_0x1af759[_0x46df('0x29')],qs[_0x46df('0x2e')](_0x5a6c75['query'][_0x46df('0x2e')]));_0x5185cf[_0x46df('0x2f')]=_0x5185cf['attributes'][_0x46df('0x30')]?_0x5185cf[_0x46df('0x2f')]:_0x1af759[_0x46df('0x29')];if(!_0x5a6c75[_0x46df('0x2b')]['hasOwnProperty'](_0x46df('0x31'))){_0x5185cf[_0x46df('0x18')]=qs[_0x46df('0x18')](_0x5a6c75['query'][_0x46df('0x18')]);_0x5185cf[_0x46df('0x17')]=qs[_0x46df('0x17')](_0x5a6c75[_0x46df('0x2b')][_0x46df('0x17')]);}_0x5185cf['order']=qs['sort'](_0x5a6c75['query']['sort']);_0x5185cf[_0x46df('0x32')]=qs[_0x46df('0x2c')](_[_0x46df('0x33')](_0x5a6c75['query'],_0x1af759[_0x46df('0x2c')]),_0x10b63b);if(_0x5a6c75[_0x46df('0x2b')]['filter']){_0x5185cf[_0x46df('0x32')]=_[_0x46df('0x34')](_0x5185cf['where'],{'$or':_[_0x46df('0x2a')](_0x10b63b,function(_0x30caec){if(_0x30caec['type']!==_0x46df('0x35')){var _0x2c2411={};_0x2c2411[_0x30caec[_0x46df('0x36')]]={'$like':'%'+_0x5a6c75[_0x46df('0x2b')][_0x46df('0x37')]+'%'};return _0x2c2411;}})});}_0x5185cf=_[_0x46df('0x34')]({},_0x5185cf,_0x5a6c75[_0x46df('0x38')]);var _0x5153c5={'where':_0x5185cf[_0x46df('0x32')]};return db['SquareMessage'][_0x46df('0x1a')](_0x5153c5)[_0x46df('0x1f')](function(_0x2bfed4){_0x52bed8[_0x46df('0x1a')]=_0x2bfed4;if(_0x5a6c75['query'][_0x46df('0x39')]){_0x5185cf[_0x46df('0x3a')]=[{'all':!![]}];}return db['SquareMessage'][_0x46df('0x3b')](_0x5185cf);})['then'](function(_0x2c4571){_0x52bed8['rows']=_0x2c4571;return _0x52bed8;})[_0x46df('0x1f')](respondWithFilteredResult(_0x2da249,_0x5185cf))[_0x46df('0x3c')](handleError(_0x2da249,null));};exports[_0x46df('0x3d')]=function(_0xfb7fec,_0x64cc0d){var _0x3cc15a={'raw':!![],'where':{'id':_0xfb7fec['params']['id']}},_0x1271cd={};_0x1271cd['model']=_['keys'](db[_0x46df('0x3e')]['rawAttributes']);_0x1271cd[_0x46df('0x2b')]=_[_0x46df('0x3f')](_0xfb7fec[_0x46df('0x2b')]);_0x1271cd['filters']=_['intersection'](_0x1271cd[_0x46df('0x29')],_0x1271cd[_0x46df('0x2b')]);_0x3cc15a[_0x46df('0x2f')]=_[_0x46df('0x2d')](_0x1271cd[_0x46df('0x29')],qs[_0x46df('0x2e')](_0xfb7fec['query'][_0x46df('0x2e')]));_0x3cc15a[_0x46df('0x2f')]=_0x3cc15a[_0x46df('0x2f')]['length']?_0x3cc15a[_0x46df('0x2f')]:_0x1271cd[_0x46df('0x29')];if(_0xfb7fec[_0x46df('0x2b')][_0x46df('0x39')]){_0x3cc15a[_0x46df('0x3a')]=[{'all':!![]}];}_0x3cc15a=_[_0x46df('0x34')]({},_0x3cc15a,_0xfb7fec['options']);return db[_0x46df('0x3e')][_0x46df('0x40')](_0x3cc15a)[_0x46df('0x1f')](handleEntityNotFound(_0x64cc0d,null))['then'](respondWithResult(_0x64cc0d,null))[_0x46df('0x3c')](handleError(_0x64cc0d,null));};exports[_0x46df('0x41')]=function(_0x74a9c3,_0x498ac3){return db[_0x46df('0x3e')][_0x46df('0x41')](_0x74a9c3[_0x46df('0x42')],{})[_0x46df('0x1f')](respondWithResult(_0x498ac3,0xc9))[_0x46df('0x3c')](handleError(_0x498ac3,null));};exports[_0x46df('0x1e')]=function(_0x50ee8f,_0x4c7562){if(_0x50ee8f[_0x46df('0x42')]['id']){delete _0x50ee8f[_0x46df('0x42')]['id'];}return db[_0x46df('0x3e')]['find']({'where':{'id':_0x50ee8f[_0x46df('0x43')]['id']}})[_0x46df('0x1f')](handleEntityNotFound(_0x4c7562,null))[_0x46df('0x1f')](saveUpdates(_0x50ee8f[_0x46df('0x42')],null))[_0x46df('0x1f')](respondWithResult(_0x4c7562,null))['catch'](handleError(_0x4c7562,null));};exports[_0x46df('0x20')]=function(_0xa069b1,_0x53428b){return db[_0x46df('0x3e')][_0x46df('0x40')]({'where':{'id':_0xa069b1[_0x46df('0x43')]['id']}})[_0x46df('0x1f')](handleEntityNotFound(_0x53428b,null))['then'](removeEntity(_0x53428b,null))[_0x46df('0x3c')](handleError(_0x53428b,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 0b52a20..b355516 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 _0xa3fe=['api','moment','path','../../config/environment','define','SquareMessage','square_messages','lodash','../../config/logger'];(function(_0x648163,_0x241576){var _0x199d4d=function(_0x23055d){while(--_0x23055d){_0x648163['push'](_0x648163['shift']());}};_0x199d4d(++_0x241576);}(_0xa3fe,0x178));var _0xea3f=function(_0x2b0852,_0x4f1b29){_0x2b0852=_0x2b0852-0x0;var _0x3a1053=_0xa3fe[_0x2b0852];return _0x3a1053;};'use strict';var _=require(_0xea3f('0x0'));var util=require('util');var logger=require(_0xea3f('0x1'))(_0xea3f('0x2'));var moment=require(_0xea3f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xea3f('0x4'));var rimraf=require('rimraf');var config=require(_0xea3f('0x5'));var attributes=require('./squareMessage.attributes');module['exports']=function(_0x939131,_0x527d86){return _0x939131[_0xea3f('0x6')](_0xea3f('0x7'),attributes,{'tableName':_0xea3f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x39fb=['SquareMessage','square_messages','lodash','util','api','bluebird','request-promise','rimraf','../../config/environment','./squareMessage.attributes','exports','define'];(function(_0x5f1f41,_0x351e0d){var _0x2a7cbe=function(_0x40ea61){while(--_0x40ea61){_0x5f1f41['push'](_0x5f1f41['shift']());}};_0x2a7cbe(++_0x351e0d);}(_0x39fb,0x9e));var _0xb39f=function(_0x26333b,_0x56470d){_0x26333b=_0x26333b-0x0;var _0x404306=_0x39fb[_0x26333b];return _0x404306;};'use strict';var _=require(_0xb39f('0x0'));var util=require(_0xb39f('0x1'));var logger=require('../../config/logger')(_0xb39f('0x2'));var moment=require('moment');var BPromise=require(_0xb39f('0x3'));var rp=require(_0xb39f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb39f('0x5'));var config=require(_0xb39f('0x6'));var attributes=require(_0xb39f('0x7'));module[_0xb39f('0x8')]=function(_0x3504ad,_0x926cb){return _0x3504ad[_0xb39f('0x9')](_0xb39f('0xa'),attributes,{'tableName':_0xb39f('0xb'),'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 8e6dbeb..2738514 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 _0x26c7=['error','code','message','result','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x242b06,_0x485af6){var _0x15e8e6=function(_0x19f2a3){while(--_0x19f2a3){_0x242b06['push'](_0x242b06['shift']());}};_0x15e8e6(++_0x485af6);}(_0x26c7,0x19e));var _0x726c=function(_0x4d8f6f,_0x559720){_0x4d8f6f=_0x4d8f6f-0x0;var _0x441c71=_0x26c7[_0x4d8f6f];return _0x441c71;};'use strict';var _=require(_0x726c('0x0'));var util=require(_0x726c('0x1'));var moment=require(_0x726c('0x2'));var BPromise=require(_0x726c('0x3'));var rs=require(_0x726c('0x4'));var fs=require('fs');var Redis=require(_0x726c('0x5'));var db=require(_0x726c('0x6'))['db'];var utils=require(_0x726c('0x7'));var logger=require('../../config/logger')(_0x726c('0x8'));var config=require('../../config/environment');var jayson=require(_0x726c('0x9'));var client=jayson[_0x726c('0xa')][_0x726c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x223edc,_0x367aa4,_0x92a405){return new BPromise(function(_0x17a3d6,_0xa576f3){return client[_0x726c('0xc')](_0x223edc,_0x92a405)[_0x726c('0xd')](function(_0x211add){logger[_0x726c('0xe')](_0x726c('0xf'),_0x367aa4,_0x726c('0x10'));logger[_0x726c('0x11')](_0x726c('0x12'),_0x367aa4,_0x726c('0x10'),JSON[_0x726c('0x13')](_0x211add));if(_0x211add[_0x726c('0x14')]){if(_0x211add['error'][_0x726c('0x15')]===0x1f4){logger[_0x726c('0x14')](_0x726c('0xf'),_0x367aa4,_0x211add['error'][_0x726c('0x16')]);return _0xa576f3(_0x211add['error'][_0x726c('0x16')]);}logger['error']('SquareMessage,\x20%s,\x20%s',_0x367aa4,_0x211add[_0x726c('0x14')][_0x726c('0x16')]);return _0x17a3d6(_0x211add[_0x726c('0x14')]['message']);}else{logger[_0x726c('0xe')](_0x726c('0xf'),_0x367aa4,_0x726c('0x10'));_0x17a3d6(_0x211add[_0x726c('0x17')]['message']);}})[_0x726c('0x18')](function(_0x1ee0bd){logger[_0x726c('0x14')](_0x726c('0xf'),_0x367aa4,_0x1ee0bd);_0xa576f3(_0x1ee0bd);});});}exports[_0x726c('0x19')]=function(_0x3598e5){var _0x3c4873=this;return new Promise(function(_0x1525c4,_0x3df92c){return db[_0x726c('0x1a')][_0x726c('0x1b')](_0x3598e5[_0x726c('0x1c')],{'raw':_0x3598e5[_0x726c('0x1d')]?_0x3598e5[_0x726c('0x1d')][_0x726c('0x1e')]===undefined?!![]:![]:!![]})[_0x726c('0xd')](function(_0xb89f95){logger[_0x726c('0xe')]('CreateSquareMessage',_0x3598e5);logger['debug']('CreateSquareMessage',_0x3598e5,JSON[_0x726c('0x13')](_0xb89f95));_0x1525c4(_0xb89f95);})[_0x726c('0x18')](function(_0x31c04b){logger[_0x726c('0x14')](_0x726c('0x19'),_0x31c04b[_0x726c('0x16')],_0x3598e5);_0x3df92c(_0x3c4873['error'](0x1f4,_0x31c04b[_0x726c('0x16')]));});});}; \ No newline at end of file +var _0x3de8=['moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','SquareMessage','body','options','CreateSquareMessage','lodash'];(function(_0x361c05,_0x4f93af){var _0x277812=function(_0x3517df){while(--_0x3517df){_0x361c05['push'](_0x361c05['shift']());}};_0x277812(++_0x4f93af);}(_0x3de8,0x1c1));var _0x83de=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3de8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x83de('0x0'));var util=require('util');var moment=require(_0x83de('0x1'));var BPromise=require(_0x83de('0x2'));var rs=require(_0x83de('0x3'));var fs=require('fs');var Redis=require(_0x83de('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x83de('0x5'))(_0x83de('0x6'));var config=require(_0x83de('0x7'));var jayson=require(_0x83de('0x8'));var client=jayson[_0x83de('0x9')][_0x83de('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4719f0,_0x28f42f,_0x29ceb2){return new BPromise(function(_0xbd8468,_0x3c0ab8){return client[_0x83de('0xb')](_0x4719f0,_0x29ceb2)['then'](function(_0x2e7245){logger[_0x83de('0xc')](_0x83de('0xd'),_0x28f42f,_0x83de('0xe'));logger[_0x83de('0xf')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x28f42f,_0x83de('0xe'),JSON[_0x83de('0x10')](_0x2e7245));if(_0x2e7245['error']){if(_0x2e7245['error'][_0x83de('0x11')]===0x1f4){logger['error'](_0x83de('0xd'),_0x28f42f,_0x2e7245['error']['message']);return _0x3c0ab8(_0x2e7245[_0x83de('0x12')][_0x83de('0x13')]);}logger[_0x83de('0x12')](_0x83de('0xd'),_0x28f42f,_0x2e7245[_0x83de('0x12')]['message']);return _0xbd8468(_0x2e7245[_0x83de('0x12')][_0x83de('0x13')]);}else{logger[_0x83de('0xc')](_0x83de('0xd'),_0x28f42f,_0x83de('0xe'));_0xbd8468(_0x2e7245[_0x83de('0x14')][_0x83de('0x13')]);}})['catch'](function(_0x50de9b){logger[_0x83de('0x12')](_0x83de('0xd'),_0x28f42f,_0x50de9b);_0x3c0ab8(_0x50de9b);});});}exports['CreateSquareMessage']=function(_0xf13e0d){var _0x2435ec=this;return new Promise(function(_0x1947b0,_0x9bff3e){return db[_0x83de('0x15')]['create'](_0xf13e0d[_0x83de('0x16')],{'raw':_0xf13e0d['options']?_0xf13e0d[_0x83de('0x17')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2ddb91){logger[_0x83de('0xc')](_0x83de('0x18'),_0xf13e0d);logger['debug'](_0x83de('0x18'),_0xf13e0d,JSON[_0x83de('0x10')](_0x2ddb91));_0x1947b0(_0x2ddb91);})['catch'](function(_0x1e32b6){logger[_0x83de('0x12')](_0x83de('0x18'),_0x1e32b6[_0x83de('0x13')],_0xf13e0d);_0x9bff3e(_0x2435ec[_0x83de('0x12')](0x1f4,_0x1e32b6[_0x83de('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index f2e342e..8ef8114 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 _0x7d38=['./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test','test','post','create','put','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x27edda,_0x7a4ac7){var _0x150167=function(_0x450b34){while(--_0x450b34){_0x27edda['push'](_0x27edda['shift']());}};_0x150167(++_0x7a4ac7);}(_0x7d38,0x149));var _0x87d3=function(_0x2f24f8,_0x113897){_0x2f24f8=_0x2f24f8-0x0;var _0x16c80f=_0x7d38[_0x2f24f8];return _0x16c80f;};'use strict';var multer=require(_0x87d3('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x87d3('0x1'));var express=require(_0x87d3('0x2'));var router=express[_0x87d3('0x3')]();var fs_extra=require(_0x87d3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x87d3('0x5'));var config=require(_0x87d3('0x6'));var controller=require(_0x87d3('0x7'));router[_0x87d3('0x8')]('/',auth[_0x87d3('0x9')](),controller[_0x87d3('0xa')]);router[_0x87d3('0x8')](_0x87d3('0xb'),auth['isAuthenticated'](),controller[_0x87d3('0xc')]);router[_0x87d3('0x8')](_0x87d3('0xd'),auth[_0x87d3('0x9')](),timeout('15s'),controller[_0x87d3('0xe')]);router[_0x87d3('0xf')]('/',auth[_0x87d3('0x9')](),controller[_0x87d3('0x10')]);router[_0x87d3('0x11')](_0x87d3('0xb'),auth[_0x87d3('0x9')](),controller['update']);router[_0x87d3('0x12')](_0x87d3('0xb'),auth[_0x87d3('0x9')](),controller[_0x87d3('0x13')]);module[_0x87d3('0x14')]=router; \ No newline at end of file +var _0xbabb=['isAuthenticated','create','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','index','get','/:id','show','/:id/test','15s','test'];(function(_0x441ed7,_0x39a713){var _0x4085da=function(_0x323050){while(--_0x323050){_0x441ed7['push'](_0x441ed7['shift']());}};_0x4085da(++_0x39a713);}(_0xbabb,0x1ea));var _0xbbab=function(_0x3acaa7,_0x49b873){_0x3acaa7=_0x3acaa7-0x0;var _0x592edd=_0xbabb[_0x3acaa7];return _0x592edd;};'use strict';var multer=require(_0xbbab('0x0'));var util=require(_0xbbab('0x1'));var path=require('path');var timeout=require(_0xbbab('0x2'));var express=require(_0xbbab('0x3'));var router=express[_0xbbab('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbbab('0x5'));var interaction=require(_0xbbab('0x6'));var config=require(_0xbbab('0x7'));var controller=require(_0xbbab('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xbbab('0x9')]);router[_0xbbab('0xa')](_0xbbab('0xb'),auth['isAuthenticated'](),controller[_0xbbab('0xc')]);router[_0xbbab('0xa')](_0xbbab('0xd'),auth['isAuthenticated'](),timeout(_0xbbab('0xe')),controller[_0xbbab('0xf')]);router['post']('/',auth[_0xbbab('0x10')](),controller[_0xbbab('0x11')]);router['put'](_0xbbab('0xb'),auth[_0xbbab('0x10')](),controller[_0xbbab('0x12')]);router[_0xbbab('0x13')](_0xbbab('0xb'),auth[_0xbbab('0x10')](),controller[_0xbbab('0x14')]);module[_0xbbab('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index ca92b40..643f0f5 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 _0xb050=['STRING','name','exports'];(function(_0x586c45,_0x58bd40){var _0xd6b7b0=function(_0x42585b){while(--_0x42585b){_0x586c45['push'](_0x586c45['shift']());}};_0xd6b7b0(++_0x58bd40);}(_0xb050,0x11f));var _0x0b05=function(_0x4d808a,_0x9de04b){_0x4d808a=_0x4d808a-0x0;var _0x4dfa69=_0xb050[_0x4d808a];return _0x4dfa69;};'use strict';var Sequelize=require('sequelize');module[_0x0b05('0x0')]={'name':{'type':Sequelize[_0x0b05('0x1')],'unique':_0x0b05('0x2'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0b05('0x1')]}}; \ No newline at end of file +var _0x22f1=['STRING','name','sequelize','exports'];(function(_0x26e699,_0x879597){var _0x46a38c=function(_0x579a60){while(--_0x579a60){_0x26e699['push'](_0x26e699['shift']());}};_0x46a38c(++_0x879597);}(_0x22f1,0xf6));var _0x122f=function(_0x1a9b2e,_0x35dc2e){_0x1a9b2e=_0x1a9b2e-0x0;var _0x1a1e0f=_0x22f1[_0x1a9b2e];return _0x1a1e0f;};'use strict';var Sequelize=require(_0x122f('0x0'));module[_0x122f('0x1')]={'name':{'type':Sequelize[_0x122f('0x2')],'unique':_0x122f('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x122f('0x2')]},'description':{'type':Sequelize[_0x122f('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index aac8520..e3be07c 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 _0xe8b4=['json','offset','undefined','limit','count','set','reject','save','update','then','get','ODBC','UserProfileResource','error','stack','name','send','SquareOdbc','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','destroy','test','dsn','odbc','openSync','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x4c7d10,_0x7450e4){var _0x4e0fae=function(_0x30caca){while(--_0x30caca){_0x4c7d10['push'](_0x4c7d10['shift']());}};_0x4e0fae(++_0x7450e4);}(_0xe8b4,0x143));var _0x4e8b=function(_0x60f3ac,_0x3da780){_0x60f3ac=_0x60f3ac-0x0;var _0x3a3ced=_0xe8b4[_0x60f3ac];return _0x3a3ced;};'use strict';var emlformat=require(_0x4e8b('0x0'));var rimraf=require(_0x4e8b('0x1'));var zipdir=require(_0x4e8b('0x2'));var jsonpatch=require(_0x4e8b('0x3'));var rp=require(_0x4e8b('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4e8b('0x5'));var util=require(_0x4e8b('0x6'));var path=require(_0x4e8b('0x7'));var sox=require(_0x4e8b('0x8'));var csv=require(_0x4e8b('0x9'));var ejs=require(_0x4e8b('0xa'));var fs=require('fs');var fs_extra=require(_0x4e8b('0xb'));var _=require(_0x4e8b('0xc'));var squel=require(_0x4e8b('0xd'));var crypto=require(_0x4e8b('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x4e8b('0xf'));var toCsv=require(_0x4e8b('0x9'));var querystring=require(_0x4e8b('0x10'));var Papa=require('papaparse');var Redis=require(_0x4e8b('0x11'));var authService=require(_0x4e8b('0x12'));var qs=require(_0x4e8b('0x13'));var as=require(_0x4e8b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4e8b('0x15'))(_0x4e8b('0x16'));var utils=require(_0x4e8b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4e8b('0x18'));var db=require(_0x4e8b('0x19'))['db'];function respondWithStatusCode(_0x1b5ca1,_0x493ddc){_0x493ddc=_0x493ddc||0xcc;return function(_0x2d9fc3){if(_0x2d9fc3){return _0x1b5ca1[_0x4e8b('0x1a')](_0x493ddc);}return _0x1b5ca1[_0x4e8b('0x1b')](_0x493ddc)[_0x4e8b('0x1c')]();};}function respondWithResult(_0x3b74d4,_0x53bf3f){_0x53bf3f=_0x53bf3f||0xc8;return function(_0x5b4d22){if(_0x5b4d22){return _0x3b74d4['status'](_0x53bf3f)[_0x4e8b('0x1d')](_0x5b4d22);}};}function respondWithFilteredResult(_0x3ed2b9,_0x55bb6c){return function(_0x468a3c){if(_0x468a3c){var _0x486f2a=typeof _0x55bb6c[_0x4e8b('0x1e')]===_0x4e8b('0x1f')&&typeof _0x55bb6c[_0x4e8b('0x20')]===_0x4e8b('0x1f');var _0x23af4a=_0x468a3c[_0x4e8b('0x21')];var _0x24848a=_0x486f2a?0x0:_0x55bb6c['offset'];var _0x45336d=_0x486f2a?_0x468a3c[_0x4e8b('0x21')]:_0x55bb6c[_0x4e8b('0x1e')]+_0x55bb6c['limit'];var _0x55afc3;if(_0x45336d>=_0x23af4a){_0x45336d=_0x23af4a;_0x55afc3=0xc8;}else{_0x55afc3=0xce;}_0x3ed2b9['status'](_0x55afc3);return _0x3ed2b9[_0x4e8b('0x22')]('Content-Range',_0x24848a+'-'+_0x45336d+'/'+_0x23af4a)[_0x4e8b('0x1d')](_0x468a3c);}return null;};}function patchUpdates(_0x1ebf29){return function(_0x441029){try{jsonpatch['apply'](_0x441029,_0x1ebf29,!![]);}catch(_0x225214){return BPromise[_0x4e8b('0x23')](_0x225214);}return _0x441029[_0x4e8b('0x24')]();};}function saveUpdates(_0x1bb809,_0x3e7b5f){return function(_0x275dbb){if(_0x275dbb){return _0x275dbb[_0x4e8b('0x25')](_0x1bb809)[_0x4e8b('0x26')](function(_0x2ef5fd){return _0x2ef5fd;});}return null;};}function removeEntity(_0x3f4c43,_0x550351){return function(_0x300c42){if(_0x300c42){return _0x300c42['destroy']()[_0x4e8b('0x26')](function(){var _0x7cbd31=_0x300c42[_0x4e8b('0x27')]({'plain':!![]});var _0x253c31=_0x4e8b('0x28');return db[_0x4e8b('0x29')]['destroy']({'where':{'type':_0x253c31,'resourceId':_0x7cbd31['id']}})[_0x4e8b('0x26')](function(){return _0x300c42;});})['then'](function(){_0x3f4c43['status'](0xcc)[_0x4e8b('0x1c')]();});}};}function handleEntityNotFound(_0x173ba7,_0x5b305f){return function(_0x234834){if(!_0x234834){_0x173ba7[_0x4e8b('0x1a')](0x194);}return _0x234834;};}function handleError(_0x514a45,_0x279e84){_0x279e84=_0x279e84||0x1f4;return function(_0x5e3a1d){logger[_0x4e8b('0x2a')](_0x5e3a1d[_0x4e8b('0x2b')]);if(_0x5e3a1d[_0x4e8b('0x2c')]){delete _0x5e3a1d[_0x4e8b('0x2c')];}_0x514a45[_0x4e8b('0x1b')](_0x279e84)[_0x4e8b('0x2d')](_0x5e3a1d);};}exports['index']=function(_0x2fef96,_0xc28aa6){var _0x2066f1={},_0x5d6422={},_0x1c0395={'count':0x0,'rows':[]};var _0x578f12=_['map'](db[_0x4e8b('0x2e')][_0x4e8b('0x2f')],function(_0x50e609){return{'name':_0x50e609[_0x4e8b('0x30')],'type':_0x50e609[_0x4e8b('0x31')][_0x4e8b('0x32')]};});_0x5d6422[_0x4e8b('0x33')]=_[_0x4e8b('0x34')](_0x578f12,_0x4e8b('0x2c'));_0x5d6422['query']=_[_0x4e8b('0x35')](_0x2fef96['query']);_0x5d6422[_0x4e8b('0x36')]=_[_0x4e8b('0x37')](_0x5d6422[_0x4e8b('0x33')],_0x5d6422[_0x4e8b('0x38')]);_0x2066f1[_0x4e8b('0x39')]=_[_0x4e8b('0x37')](_0x5d6422[_0x4e8b('0x33')],qs[_0x4e8b('0x3a')](_0x2fef96['query']['fields']));_0x2066f1[_0x4e8b('0x39')]=_0x2066f1[_0x4e8b('0x39')][_0x4e8b('0x3b')]?_0x2066f1[_0x4e8b('0x39')]:_0x5d6422[_0x4e8b('0x33')];if(!_0x2fef96[_0x4e8b('0x38')][_0x4e8b('0x3c')](_0x4e8b('0x3d'))){_0x2066f1['limit']=qs['limit'](_0x2fef96['query'][_0x4e8b('0x20')]);_0x2066f1[_0x4e8b('0x1e')]=qs['offset'](_0x2fef96[_0x4e8b('0x38')][_0x4e8b('0x1e')]);}_0x2066f1[_0x4e8b('0x3e')]=qs[_0x4e8b('0x3f')](_0x2fef96['query']['sort']);_0x2066f1[_0x4e8b('0x40')]=qs[_0x4e8b('0x36')](_[_0x4e8b('0x41')](_0x2fef96[_0x4e8b('0x38')],_0x5d6422[_0x4e8b('0x36')]),_0x578f12);if(_0x2fef96['query'][_0x4e8b('0x42')]){_0x2066f1['where']=_['merge'](_0x2066f1[_0x4e8b('0x40')],{'$or':_['map'](_0x578f12,function(_0x2d7c57){if(_0x2d7c57[_0x4e8b('0x31')]!==_0x4e8b('0x43')){var _0x54e765={};_0x54e765[_0x2d7c57[_0x4e8b('0x2c')]]={'$like':'%'+_0x2fef96[_0x4e8b('0x38')][_0x4e8b('0x42')]+'%'};return _0x54e765;}})});}_0x2066f1=_['merge']({},_0x2066f1,_0x2fef96[_0x4e8b('0x44')]);var _0x2d122d={'where':_0x2066f1[_0x4e8b('0x40')]};return db['SquareOdbc'][_0x4e8b('0x21')](_0x2d122d)['then'](function(_0x2d2f38){_0x1c0395[_0x4e8b('0x21')]=_0x2d2f38;if(_0x2fef96[_0x4e8b('0x38')][_0x4e8b('0x45')]){_0x2066f1[_0x4e8b('0x46')]=[{'all':!![]}];}return db[_0x4e8b('0x2e')][_0x4e8b('0x47')](_0x2066f1);})[_0x4e8b('0x26')](function(_0x36ec94){_0x1c0395['rows']=_0x36ec94;return _0x1c0395;})['then'](respondWithFilteredResult(_0xc28aa6,_0x2066f1))[_0x4e8b('0x48')](handleError(_0xc28aa6,null));};exports['show']=function(_0x1af015,_0x17a876){var _0x28d52f={'raw':!![],'where':{'id':_0x1af015[_0x4e8b('0x49')]['id']}},_0xce55ed={};_0xce55ed[_0x4e8b('0x33')]=_['keys'](db['SquareOdbc'][_0x4e8b('0x2f')]);_0xce55ed[_0x4e8b('0x38')]=_[_0x4e8b('0x35')](_0x1af015[_0x4e8b('0x38')]);_0xce55ed[_0x4e8b('0x36')]=_[_0x4e8b('0x37')](_0xce55ed['model'],_0xce55ed[_0x4e8b('0x38')]);_0x28d52f['attributes']=_[_0x4e8b('0x37')](_0xce55ed['model'],qs[_0x4e8b('0x3a')](_0x1af015['query'][_0x4e8b('0x3a')]));_0x28d52f[_0x4e8b('0x39')]=_0x28d52f[_0x4e8b('0x39')][_0x4e8b('0x3b')]?_0x28d52f[_0x4e8b('0x39')]:_0xce55ed[_0x4e8b('0x33')];if(_0x1af015[_0x4e8b('0x38')]['includeAll']){_0x28d52f['include']=[{'all':!![]}];}_0x28d52f=_['merge']({},_0x28d52f,_0x1af015[_0x4e8b('0x44')]);return db[_0x4e8b('0x2e')]['find'](_0x28d52f)[_0x4e8b('0x26')](handleEntityNotFound(_0x17a876,null))['then'](respondWithResult(_0x17a876,null))[_0x4e8b('0x48')](handleError(_0x17a876,null));};exports[_0x4e8b('0x4a')]=function(_0x114ced,_0x52bb91){return db[_0x4e8b('0x2e')]['create'](_0x114ced[_0x4e8b('0x4b')],{})[_0x4e8b('0x26')](function(_0x4872b8){var _0x211ee6=_0x114ced[_0x4e8b('0x4c')][_0x4e8b('0x27')]({'plain':!![]});if(!_0x211ee6)throw new Error(_0x4e8b('0x4d'));if(_0x211ee6[_0x4e8b('0x4e')]==='user'){var _0x2240eb=_0x4872b8['get']({'plain':!![]});var _0x26842f='ODBC';return db[_0x4e8b('0x4f')][_0x4e8b('0x50')]({'where':{'name':_0x26842f,'userProfileId':_0x211ee6['userProfileId']},'raw':!![]})[_0x4e8b('0x26')](function(_0x5c22fa){if(_0x5c22fa&&_0x5c22fa[_0x4e8b('0x51')]===0x0){return db[_0x4e8b('0x29')][_0x4e8b('0x4a')]({'name':_0x2240eb[_0x4e8b('0x2c')],'resourceId':_0x2240eb['id'],'type':_0x5c22fa['name'],'sectionId':_0x5c22fa['id']},{})[_0x4e8b('0x26')](function(){return _0x4872b8;});}else{return _0x4872b8;}})[_0x4e8b('0x48')](function(_0x1cc23b){logger[_0x4e8b('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1cc23b);throw _0x1cc23b;});}return _0x4872b8;})[_0x4e8b('0x26')](respondWithResult(_0x52bb91,0xc9))['catch'](handleError(_0x52bb91,null));};exports[_0x4e8b('0x25')]=function(_0x25a288,_0x432d61){if(_0x25a288[_0x4e8b('0x4b')]['id']){delete _0x25a288['body']['id'];}return db[_0x4e8b('0x2e')]['find']({'where':{'id':_0x25a288[_0x4e8b('0x49')]['id']}})['then'](handleEntityNotFound(_0x432d61,null))[_0x4e8b('0x26')](saveUpdates(_0x25a288[_0x4e8b('0x4b')],null))[_0x4e8b('0x26')](respondWithResult(_0x432d61,null))[_0x4e8b('0x48')](handleError(_0x432d61,null));};exports[_0x4e8b('0x52')]=function(_0x499ae9,_0x4a1b6f){return db[_0x4e8b('0x2e')][_0x4e8b('0x50')]({'where':{'id':_0x499ae9[_0x4e8b('0x49')]['id']}})['then'](handleEntityNotFound(_0x4a1b6f,null))[_0x4e8b('0x26')](removeEntity(_0x4a1b6f,null))[_0x4e8b('0x48')](handleError(_0x4a1b6f,null));};exports[_0x4e8b('0x53')]=function(_0x19d04d,_0x20d3cd,_0x27f47a){var _0x306a5d;return db[_0x4e8b('0x2e')][_0x4e8b('0x50')]({'where':{'id':_0x19d04d[_0x4e8b('0x49')]['id']},'attributes':['id',_0x4e8b('0x54')]})[_0x4e8b('0x26')](handleEntityNotFound(_0x20d3cd,null))[_0x4e8b('0x26')](function(_0x30207a){if(_0x30207a){var _0x1331a1=require(_0x4e8b('0x55'))();_0x1331a1[_0x4e8b('0x56')](_0x30207a[_0x4e8b('0x54')]);_0x1331a1[_0x4e8b('0x57')]();return _0x30207a;}})[_0x4e8b('0x26')](respondWithResult(_0x20d3cd,null))[_0x4e8b('0x48')](handleError(_0x20d3cd,null));}; \ No newline at end of file +var _0x5b8c=['squel','crypto','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','Content-Range','reject','save','update','then','get','ODBC','UserProfileResource','destroy','error','stack','name','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','SquareOdbc','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','dsn','odbc','openSync','closeSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x5b8c,0x1f3));var _0xc5b8=function(_0x74f73,_0x2acc98){_0x74f73=_0x74f73-0x0;var _0x3827c2=_0x5b8c[_0x74f73];return _0x3827c2;};'use strict';var emlformat=require(_0xc5b8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc5b8('0x1'));var jsonpatch=require(_0xc5b8('0x2'));var rp=require(_0xc5b8('0x3'));var moment=require(_0xc5b8('0x4'));var BPromise=require(_0xc5b8('0x5'));var Mustache=require('mustache');var util=require(_0xc5b8('0x6'));var path=require(_0xc5b8('0x7'));var sox=require('sox');var csv=require(_0xc5b8('0x8'));var ejs=require(_0xc5b8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc5b8('0xa'));var squel=require(_0xc5b8('0xb'));var crypto=require(_0xc5b8('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc5b8('0x8'));var querystring=require(_0xc5b8('0xd'));var Papa=require(_0xc5b8('0xe'));var Redis=require('ioredis');var authService=require(_0xc5b8('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xc5b8('0x10'));var hardwareService=require(_0xc5b8('0x11'));var logger=require(_0xc5b8('0x12'))(_0xc5b8('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc5b8('0x14'));var db=require(_0xc5b8('0x15'))['db'];function respondWithStatusCode(_0x4c4572,_0x1c7d9c){_0x1c7d9c=_0x1c7d9c||0xcc;return function(_0x30c06c){if(_0x30c06c){return _0x4c4572[_0xc5b8('0x16')](_0x1c7d9c);}return _0x4c4572[_0xc5b8('0x17')](_0x1c7d9c)[_0xc5b8('0x18')]();};}function respondWithResult(_0x12382f,_0x5ef4f2){_0x5ef4f2=_0x5ef4f2||0xc8;return function(_0x444bc2){if(_0x444bc2){return _0x12382f[_0xc5b8('0x17')](_0x5ef4f2)[_0xc5b8('0x19')](_0x444bc2);}};}function respondWithFilteredResult(_0x218462,_0x530b89){return function(_0x5243e7){if(_0x5243e7){var _0xba5680=typeof _0x530b89[_0xc5b8('0x1a')]===_0xc5b8('0x1b')&&typeof _0x530b89[_0xc5b8('0x1c')]===_0xc5b8('0x1b');var _0x384bc5=_0x5243e7[_0xc5b8('0x1d')];var _0x4c9270=_0xba5680?0x0:_0x530b89['offset'];var _0x9cf4d2=_0xba5680?_0x5243e7[_0xc5b8('0x1d')]:_0x530b89[_0xc5b8('0x1a')]+_0x530b89[_0xc5b8('0x1c')];var _0x381364;if(_0x9cf4d2>=_0x384bc5){_0x9cf4d2=_0x384bc5;_0x381364=0xc8;}else{_0x381364=0xce;}_0x218462[_0xc5b8('0x17')](_0x381364);return _0x218462[_0xc5b8('0x1e')](_0xc5b8('0x1f'),_0x4c9270+'-'+_0x9cf4d2+'/'+_0x384bc5)[_0xc5b8('0x19')](_0x5243e7);}return null;};}function patchUpdates(_0x50fcd4){return function(_0x1910db){try{jsonpatch['apply'](_0x1910db,_0x50fcd4,!![]);}catch(_0x188334){return BPromise[_0xc5b8('0x20')](_0x188334);}return _0x1910db[_0xc5b8('0x21')]();};}function saveUpdates(_0x2a0f97,_0x12b144){return function(_0x5c92c6){if(_0x5c92c6){return _0x5c92c6[_0xc5b8('0x22')](_0x2a0f97)[_0xc5b8('0x23')](function(_0x35cec5){return _0x35cec5;});}return null;};}function removeEntity(_0x12860f,_0x12a375){return function(_0x11fa36){if(_0x11fa36){return _0x11fa36['destroy']()[_0xc5b8('0x23')](function(){var _0x50055f=_0x11fa36[_0xc5b8('0x24')]({'plain':!![]});var _0x4d25a5=_0xc5b8('0x25');return db[_0xc5b8('0x26')][_0xc5b8('0x27')]({'where':{'type':_0x4d25a5,'resourceId':_0x50055f['id']}})[_0xc5b8('0x23')](function(){return _0x11fa36;});})[_0xc5b8('0x23')](function(){_0x12860f[_0xc5b8('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x133361,_0x4f30c0){return function(_0x486bc6){if(!_0x486bc6){_0x133361[_0xc5b8('0x16')](0x194);}return _0x486bc6;};}function handleError(_0xea53f6,_0x36b5b9){_0x36b5b9=_0x36b5b9||0x1f4;return function(_0x3e3492){logger[_0xc5b8('0x28')](_0x3e3492[_0xc5b8('0x29')]);if(_0x3e3492[_0xc5b8('0x2a')]){delete _0x3e3492['name'];}_0xea53f6[_0xc5b8('0x17')](_0x36b5b9)['send'](_0x3e3492);};}exports['index']=function(_0x1e377e,_0x2afd98){var _0x58cf20={},_0x1bc61c={},_0x36394e={'count':0x0,'rows':[]};var _0x2e3cd1=_[_0xc5b8('0x2b')](db['SquareOdbc'][_0xc5b8('0x2c')],function(_0x5cd6a6){return{'name':_0x5cd6a6[_0xc5b8('0x2d')],'type':_0x5cd6a6[_0xc5b8('0x2e')]['key']};});_0x1bc61c['model']=_[_0xc5b8('0x2b')](_0x2e3cd1,_0xc5b8('0x2a'));_0x1bc61c[_0xc5b8('0x2f')]=_[_0xc5b8('0x30')](_0x1e377e[_0xc5b8('0x2f')]);_0x1bc61c[_0xc5b8('0x31')]=_[_0xc5b8('0x32')](_0x1bc61c[_0xc5b8('0x33')],_0x1bc61c[_0xc5b8('0x2f')]);_0x58cf20[_0xc5b8('0x34')]=_['intersection'](_0x1bc61c['model'],qs[_0xc5b8('0x35')](_0x1e377e[_0xc5b8('0x2f')][_0xc5b8('0x35')]));_0x58cf20[_0xc5b8('0x34')]=_0x58cf20['attributes'][_0xc5b8('0x36')]?_0x58cf20[_0xc5b8('0x34')]:_0x1bc61c['model'];if(!_0x1e377e['query'][_0xc5b8('0x37')](_0xc5b8('0x38'))){_0x58cf20[_0xc5b8('0x1c')]=qs[_0xc5b8('0x1c')](_0x1e377e['query'][_0xc5b8('0x1c')]);_0x58cf20['offset']=qs[_0xc5b8('0x1a')](_0x1e377e['query'][_0xc5b8('0x1a')]);}_0x58cf20[_0xc5b8('0x39')]=qs[_0xc5b8('0x3a')](_0x1e377e[_0xc5b8('0x2f')][_0xc5b8('0x3a')]);_0x58cf20[_0xc5b8('0x3b')]=qs['filters'](_[_0xc5b8('0x3c')](_0x1e377e[_0xc5b8('0x2f')],_0x1bc61c[_0xc5b8('0x31')]),_0x2e3cd1);if(_0x1e377e[_0xc5b8('0x2f')][_0xc5b8('0x3d')]){_0x58cf20[_0xc5b8('0x3b')]=_['merge'](_0x58cf20['where'],{'$or':_[_0xc5b8('0x2b')](_0x2e3cd1,function(_0x59cdc2){if(_0x59cdc2[_0xc5b8('0x2e')]!==_0xc5b8('0x3e')){var _0x3c7fd0={};_0x3c7fd0[_0x59cdc2[_0xc5b8('0x2a')]]={'$like':'%'+_0x1e377e[_0xc5b8('0x2f')][_0xc5b8('0x3d')]+'%'};return _0x3c7fd0;}})});}_0x58cf20=_[_0xc5b8('0x3f')]({},_0x58cf20,_0x1e377e['options']);var _0x731be4={'where':_0x58cf20[_0xc5b8('0x3b')]};return db[_0xc5b8('0x40')][_0xc5b8('0x1d')](_0x731be4)['then'](function(_0x5e2aa1){_0x36394e['count']=_0x5e2aa1;if(_0x1e377e['query'][_0xc5b8('0x41')]){_0x58cf20[_0xc5b8('0x42')]=[{'all':!![]}];}return db[_0xc5b8('0x40')][_0xc5b8('0x43')](_0x58cf20);})[_0xc5b8('0x23')](function(_0x4077cc){_0x36394e[_0xc5b8('0x44')]=_0x4077cc;return _0x36394e;})[_0xc5b8('0x23')](respondWithFilteredResult(_0x2afd98,_0x58cf20))[_0xc5b8('0x45')](handleError(_0x2afd98,null));};exports[_0xc5b8('0x46')]=function(_0xb4c53,_0xcaa1b8){var _0x3ef12d={'raw':!![],'where':{'id':_0xb4c53[_0xc5b8('0x47')]['id']}},_0x3acceb={};_0x3acceb['model']=_[_0xc5b8('0x30')](db[_0xc5b8('0x40')][_0xc5b8('0x2c')]);_0x3acceb['query']=_[_0xc5b8('0x30')](_0xb4c53[_0xc5b8('0x2f')]);_0x3acceb['filters']=_[_0xc5b8('0x32')](_0x3acceb['model'],_0x3acceb[_0xc5b8('0x2f')]);_0x3ef12d[_0xc5b8('0x34')]=_[_0xc5b8('0x32')](_0x3acceb[_0xc5b8('0x33')],qs[_0xc5b8('0x35')](_0xb4c53['query']['fields']));_0x3ef12d['attributes']=_0x3ef12d[_0xc5b8('0x34')][_0xc5b8('0x36')]?_0x3ef12d[_0xc5b8('0x34')]:_0x3acceb[_0xc5b8('0x33')];if(_0xb4c53[_0xc5b8('0x2f')]['includeAll']){_0x3ef12d[_0xc5b8('0x42')]=[{'all':!![]}];}_0x3ef12d=_['merge']({},_0x3ef12d,_0xb4c53[_0xc5b8('0x48')]);return db['SquareOdbc'][_0xc5b8('0x49')](_0x3ef12d)['then'](handleEntityNotFound(_0xcaa1b8,null))[_0xc5b8('0x23')](respondWithResult(_0xcaa1b8,null))[_0xc5b8('0x45')](handleError(_0xcaa1b8,null));};exports[_0xc5b8('0x4a')]=function(_0x2e5c23,_0x5ef29f){return db[_0xc5b8('0x40')][_0xc5b8('0x4a')](_0x2e5c23[_0xc5b8('0x4b')],{})[_0xc5b8('0x23')](function(_0x2cf424){var _0x4d576e=_0x2e5c23[_0xc5b8('0x4c')][_0xc5b8('0x24')]({'plain':!![]});if(!_0x4d576e)throw new Error(_0xc5b8('0x4d'));if(_0x4d576e['role']===_0xc5b8('0x4c')){var _0x4448a3=_0x2cf424[_0xc5b8('0x24')]({'plain':!![]});var _0xc30b07=_0xc5b8('0x25');return db[_0xc5b8('0x4e')][_0xc5b8('0x49')]({'where':{'name':_0xc30b07,'userProfileId':_0x4d576e['userProfileId']},'raw':!![]})[_0xc5b8('0x23')](function(_0x301cb6){if(_0x301cb6&&_0x301cb6[_0xc5b8('0x4f')]===0x0){return db[_0xc5b8('0x26')][_0xc5b8('0x4a')]({'name':_0x4448a3[_0xc5b8('0x2a')],'resourceId':_0x4448a3['id'],'type':_0x301cb6['name'],'sectionId':_0x301cb6['id']},{})[_0xc5b8('0x23')](function(){return _0x2cf424;});}else{return _0x2cf424;}})[_0xc5b8('0x45')](function(_0x433977){logger[_0xc5b8('0x28')](_0xc5b8('0x50'),_0x433977);throw _0x433977;});}return _0x2cf424;})[_0xc5b8('0x23')](respondWithResult(_0x5ef29f,0xc9))[_0xc5b8('0x45')](handleError(_0x5ef29f,null));};exports[_0xc5b8('0x22')]=function(_0x1db049,_0x4ded33){if(_0x1db049[_0xc5b8('0x4b')]['id']){delete _0x1db049[_0xc5b8('0x4b')]['id'];}return db[_0xc5b8('0x40')][_0xc5b8('0x49')]({'where':{'id':_0x1db049[_0xc5b8('0x47')]['id']}})[_0xc5b8('0x23')](handleEntityNotFound(_0x4ded33,null))[_0xc5b8('0x23')](saveUpdates(_0x1db049[_0xc5b8('0x4b')],null))[_0xc5b8('0x23')](respondWithResult(_0x4ded33,null))[_0xc5b8('0x45')](handleError(_0x4ded33,null));};exports[_0xc5b8('0x27')]=function(_0x1448f0,_0x5cd835){return db[_0xc5b8('0x40')][_0xc5b8('0x49')]({'where':{'id':_0x1448f0[_0xc5b8('0x47')]['id']}})[_0xc5b8('0x23')](handleEntityNotFound(_0x5cd835,null))[_0xc5b8('0x23')](removeEntity(_0x5cd835,null))[_0xc5b8('0x45')](handleError(_0x5cd835,null));};exports['test']=function(_0x430d0f,_0x37f079,_0x473a2e){var _0x5e7b9d;return db[_0xc5b8('0x40')][_0xc5b8('0x49')]({'where':{'id':_0x430d0f[_0xc5b8('0x47')]['id']},'attributes':['id',_0xc5b8('0x51')]})['then'](handleEntityNotFound(_0x37f079,null))[_0xc5b8('0x23')](function(_0x3a8fd2){if(_0x3a8fd2){var _0x30df4d=require(_0xc5b8('0x52'))();_0x30df4d[_0xc5b8('0x53')](_0x3a8fd2[_0xc5b8('0x51')]);_0x30df4d[_0xc5b8('0x54')]();return _0x3a8fd2;}})[_0xc5b8('0x23')](respondWithResult(_0x37f079,null))[_0xc5b8('0x45')](handleError(_0x37f079,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index a7321c5..732222a 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 _0x9edd=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','lodash','util','../../config/logger','api'];(function(_0x11f6f4,_0x54819c){var _0x462cbe=function(_0x5708e9){while(--_0x5708e9){_0x11f6f4['push'](_0x11f6f4['shift']());}};_0x462cbe(++_0x54819c);}(_0x9edd,0x6c));var _0xd9ed=function(_0xdb58e5,_0x4cb353){_0xdb58e5=_0xdb58e5-0x0;var _0x89d916=_0x9edd[_0xdb58e5];return _0x89d916;};'use strict';var _=require(_0xd9ed('0x0'));var util=require(_0xd9ed('0x1'));var logger=require(_0xd9ed('0x2'))(_0xd9ed('0x3'));var moment=require(_0xd9ed('0x4'));var BPromise=require(_0xd9ed('0x5'));var rp=require(_0xd9ed('0x6'));var fs=require('fs');var path=require(_0xd9ed('0x7'));var rimraf=require(_0xd9ed('0x8'));var config=require(_0xd9ed('0x9'));var attributes=require(_0xd9ed('0xa'));module[_0xd9ed('0xb')]=function(_0x2ea8a5,_0xde3ea4){return _0x2ea8a5[_0xd9ed('0xc')](_0xd9ed('0xd'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbf7e=['request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','util','../../config/logger','moment','bluebird'];(function(_0x2e4025,_0x20612a){var _0x1c4736=function(_0x40ba6a){while(--_0x40ba6a){_0x2e4025['push'](_0x2e4025['shift']());}};_0x1c4736(++_0x20612a);}(_0xbf7e,0xc8));var _0xebf7=function(_0x3e3a9f,_0x3aa904){_0x3e3a9f=_0x3e3a9f-0x0;var _0x189399=_0xbf7e[_0x3e3a9f];return _0x189399;};'use strict';var _=require('lodash');var util=require(_0xebf7('0x0'));var logger=require(_0xebf7('0x1'))('api');var moment=require(_0xebf7('0x2'));var BPromise=require(_0xebf7('0x3'));var rp=require(_0xebf7('0x4'));var fs=require('fs');var path=require(_0xebf7('0x5'));var rimraf=require(_0xebf7('0x6'));var config=require(_0xebf7('0x7'));var attributes=require(_0xebf7('0x8'));module[_0xebf7('0x9')]=function(_0x563920,_0x560301){return _0x563920[_0xebf7('0xa')](_0xebf7('0xb'),attributes,{'tableName':'square_odbc','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 8cb467c..7d8bdc2 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 _0x6fff=['ShowSquareOdbc','SquareOdbc','find','options','raw','attributes','include','map','model','lodash','util','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch'];(function(_0xd55444,_0x18220b){var _0x29dc54=function(_0xc5d932){while(--_0xc5d932){_0xd55444['push'](_0xd55444['shift']());}};_0x29dc54(++_0x18220b);}(_0x6fff,0x117));var _0xf6ff=function(_0x558955,_0x267cdc){_0x558955=_0x558955-0x0;var _0x3b82e1=_0x6fff[_0x558955];return _0x3b82e1;};'use strict';var _=require(_0xf6ff('0x0'));var util=require(_0xf6ff('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf6ff('0x2'));var db=require(_0xf6ff('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf6ff('0x4'));var config=require(_0xf6ff('0x5'));var jayson=require(_0xf6ff('0x6'));var client=jayson[_0xf6ff('0x7')][_0xf6ff('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c81c7,_0x3a5c38,_0x2387d1){return new BPromise(function(_0x33454b,_0x1bb3e6){return client[_0xf6ff('0x9')](_0x3c81c7,_0x2387d1)[_0xf6ff('0xa')](function(_0x51c75a){logger['info'](_0xf6ff('0xb'),_0x3a5c38,_0xf6ff('0xc'));logger[_0xf6ff('0xd')](_0xf6ff('0xe'),_0x3a5c38,_0xf6ff('0xc'),JSON[_0xf6ff('0xf')](_0x51c75a));if(_0x51c75a[_0xf6ff('0x10')]){if(_0x51c75a['error'][_0xf6ff('0x11')]===0x1f4){logger[_0xf6ff('0x10')](_0xf6ff('0xb'),_0x3a5c38,_0x51c75a[_0xf6ff('0x10')][_0xf6ff('0x12')]);return _0x1bb3e6(_0x51c75a['error']['message']);}logger['error'](_0xf6ff('0xb'),_0x3a5c38,_0x51c75a[_0xf6ff('0x10')][_0xf6ff('0x12')]);return _0x33454b(_0x51c75a['error']['message']);}else{logger[_0xf6ff('0x13')](_0xf6ff('0xb'),_0x3a5c38,'request\x20sent');_0x33454b(_0x51c75a['result'][_0xf6ff('0x12')]);}})[_0xf6ff('0x14')](function(_0x47b60e){logger[_0xf6ff('0x10')](_0xf6ff('0xb'),_0x3a5c38,_0x47b60e);_0x1bb3e6(_0x47b60e);});});}exports[_0xf6ff('0x15')]=function(_0x279ff4){var _0x38c0a4=this;return new Promise(function(_0x5834cf,_0x3d56ab){return db[_0xf6ff('0x16')][_0xf6ff('0x17')]({'raw':_0x279ff4['options']?_0x279ff4[_0xf6ff('0x18')][_0xf6ff('0x19')]===undefined?!![]:![]:!![],'where':_0x279ff4['options']?_0x279ff4['options']['where']||null:null,'attributes':_0x279ff4[_0xf6ff('0x18')]?_0x279ff4[_0xf6ff('0x18')][_0xf6ff('0x1a')]||null:null,'include':_0x279ff4[_0xf6ff('0x18')]?_0x279ff4[_0xf6ff('0x18')][_0xf6ff('0x1b')]?_[_0xf6ff('0x1c')](_0x279ff4[_0xf6ff('0x18')][_0xf6ff('0x1b')],function(_0x4408d0){return{'model':db[_0x4408d0[_0xf6ff('0x1d')]],'as':_0x4408d0['as'],'attributes':_0x4408d0[_0xf6ff('0x1a')],'include':_0x4408d0[_0xf6ff('0x1b')]?_['map'](_0x4408d0[_0xf6ff('0x1b')],function(_0x3ba349){return{'model':db[_0x3ba349[_0xf6ff('0x1d')]],'as':_0x3ba349['as'],'attributes':_0x3ba349['attributes'],'include':_0x3ba349[_0xf6ff('0x1b')]?_[_0xf6ff('0x1c')](_0x3ba349['include'],function(_0x205050){return{'model':db[_0x205050[_0xf6ff('0x1d')]],'as':_0x205050['as'],'attributes':_0x205050[_0xf6ff('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf6ff('0xa')](function(_0x59dacd){logger[_0xf6ff('0x13')]('ShowSquareOdbc',_0x279ff4);logger[_0xf6ff('0xd')]('ShowSquareOdbc',_0x279ff4,JSON[_0xf6ff('0xf')](_0x59dacd));_0x5834cf(_0x59dacd);})[_0xf6ff('0x14')](function(_0x14e66d){logger[_0xf6ff('0x10')]('ShowSquareOdbc',_0x14e66d[_0xf6ff('0x12')],_0x279ff4);_0x3d56ab(_0x38c0a4['error'](0x1f4,_0x14e66d['message']));});});}; \ No newline at end of file +var _0x3a91=['model','attributes','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','SquareOdbc,\x20%s,\x20%s','message','result','ShowSquareOdbc','SquareOdbc','find','options','raw','where','include','map'];(function(_0x18916a,_0x3852a8){var _0x48f7a7=function(_0x3c67e0){while(--_0x3c67e0){_0x18916a['push'](_0x18916a['shift']());}};_0x48f7a7(++_0x3852a8);}(_0x3a91,0x11c));var _0x13a9=function(_0x26f580,_0x1c357e){_0x26f580=_0x26f580-0x0;var _0xba7ae9=_0x3a91[_0x26f580];return _0xba7ae9;};'use strict';var _=require(_0x13a9('0x0'));var util=require(_0x13a9('0x1'));var moment=require(_0x13a9('0x2'));var BPromise=require(_0x13a9('0x3'));var rs=require(_0x13a9('0x4'));var fs=require('fs');var Redis=require(_0x13a9('0x5'));var db=require(_0x13a9('0x6'))['db'];var utils=require(_0x13a9('0x7'));var logger=require(_0x13a9('0x8'))(_0x13a9('0x9'));var config=require(_0x13a9('0xa'));var jayson=require(_0x13a9('0xb'));var client=jayson['client'][_0x13a9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x46b7bc,_0x4150b5,_0x30d2cd){return new BPromise(function(_0x475ac8,_0x29d84e){return client[_0x13a9('0xd')](_0x46b7bc,_0x30d2cd)[_0x13a9('0xe')](function(_0x1c541c){logger['info']('SquareOdbc,\x20%s,\x20%s',_0x4150b5,_0x13a9('0xf'));logger[_0x13a9('0x10')](_0x13a9('0x11'),_0x4150b5,_0x13a9('0xf'),JSON[_0x13a9('0x12')](_0x1c541c));if(_0x1c541c[_0x13a9('0x13')]){if(_0x1c541c[_0x13a9('0x13')]['code']===0x1f4){logger[_0x13a9('0x13')](_0x13a9('0x14'),_0x4150b5,_0x1c541c[_0x13a9('0x13')][_0x13a9('0x15')]);return _0x29d84e(_0x1c541c[_0x13a9('0x13')][_0x13a9('0x15')]);}logger[_0x13a9('0x13')](_0x13a9('0x14'),_0x4150b5,_0x1c541c[_0x13a9('0x13')][_0x13a9('0x15')]);return _0x475ac8(_0x1c541c['error'][_0x13a9('0x15')]);}else{logger['info']('SquareOdbc,\x20%s,\x20%s',_0x4150b5,_0x13a9('0xf'));_0x475ac8(_0x1c541c[_0x13a9('0x16')][_0x13a9('0x15')]);}})['catch'](function(_0x933ddc){logger[_0x13a9('0x13')](_0x13a9('0x14'),_0x4150b5,_0x933ddc);_0x29d84e(_0x933ddc);});});}exports[_0x13a9('0x17')]=function(_0x33db8d){var _0x122691=this;return new Promise(function(_0x4fa941,_0xc77d98){return db[_0x13a9('0x18')][_0x13a9('0x19')]({'raw':_0x33db8d[_0x13a9('0x1a')]?_0x33db8d[_0x13a9('0x1a')][_0x13a9('0x1b')]===undefined?!![]:![]:!![],'where':_0x33db8d[_0x13a9('0x1a')]?_0x33db8d['options'][_0x13a9('0x1c')]||null:null,'attributes':_0x33db8d[_0x13a9('0x1a')]?_0x33db8d[_0x13a9('0x1a')]['attributes']||null:null,'include':_0x33db8d[_0x13a9('0x1a')]?_0x33db8d[_0x13a9('0x1a')][_0x13a9('0x1d')]?_[_0x13a9('0x1e')](_0x33db8d[_0x13a9('0x1a')][_0x13a9('0x1d')],function(_0x3ec2bc){return{'model':db[_0x3ec2bc[_0x13a9('0x1f')]],'as':_0x3ec2bc['as'],'attributes':_0x3ec2bc[_0x13a9('0x20')],'include':_0x3ec2bc[_0x13a9('0x1d')]?_[_0x13a9('0x1e')](_0x3ec2bc[_0x13a9('0x1d')],function(_0xb2f008){return{'model':db[_0xb2f008[_0x13a9('0x1f')]],'as':_0xb2f008['as'],'attributes':_0xb2f008[_0x13a9('0x20')],'include':_0xb2f008[_0x13a9('0x1d')]?_[_0x13a9('0x1e')](_0xb2f008['include'],function(_0x5e75c6){return{'model':db[_0x5e75c6[_0x13a9('0x1f')]],'as':_0x5e75c6['as'],'attributes':_0x5e75c6['attributes']};}):[]};}):[]};}):[]:[]})[_0x13a9('0xe')](function(_0x330507){logger[_0x13a9('0x21')]('ShowSquareOdbc',_0x33db8d);logger[_0x13a9('0x10')](_0x13a9('0x17'),_0x33db8d,JSON['stringify'](_0x330507));_0x4fa941(_0x330507);})[_0x13a9('0x22')](function(_0x9e26a6){logger[_0x13a9('0x13')](_0x13a9('0x17'),_0x9e26a6['message'],_0x33db8d);_0xc77d98(_0x122691[_0x13a9('0x13')](0x1f4,_0x9e26a6[_0x13a9('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index f75dfde..8d4cd47 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 _0xcab1=['express','fs-extra','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','multer','util','connect-timeout'];(function(_0x122e3d,_0x1b218a){var _0x5f15de=function(_0x4b0e42){while(--_0x4b0e42){_0x122e3d['push'](_0x122e3d['shift']());}};_0x5f15de(++_0x1b218a);}(_0xcab1,0xb1));var _0x1cab=function(_0x5450ed,_0x3a1f77){_0x5450ed=_0x5450ed-0x0;var _0x46c7d5=_0xcab1[_0x5450ed];return _0x46c7d5;};'use strict';var multer=require(_0x1cab('0x0'));var util=require(_0x1cab('0x1'));var path=require('path');var timeout=require(_0x1cab('0x2'));var express=require(_0x1cab('0x3'));var router=express['Router']();var fs_extra=require(_0x1cab('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1cab('0x5'));var config=require(_0x1cab('0x6'));var controller=require(_0x1cab('0x7'));router[_0x1cab('0x8')]('/',auth[_0x1cab('0x9')](),controller[_0x1cab('0xa')]);router[_0x1cab('0x8')](_0x1cab('0xb'),auth[_0x1cab('0x9')](),controller[_0x1cab('0xc')]);router[_0x1cab('0xd')]('/',auth[_0x1cab('0x9')](),controller['create']);router[_0x1cab('0xe')](_0x1cab('0xb'),auth['isAuthenticated'](),controller[_0x1cab('0xf')]);router[_0x1cab('0x10')](_0x1cab('0xb'),auth['isAuthenticated'](),controller[_0x1cab('0x11')]);module['exports']=router; \ No newline at end of file +var _0xc7bf=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./squareProject.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer'];(function(_0xff5df6,_0x514e73){var _0x2634bb=function(_0x1bb600){while(--_0x1bb600){_0xff5df6['push'](_0xff5df6['shift']());}};_0x2634bb(++_0x514e73);}(_0xc7bf,0x103));var _0xfc7b=function(_0x1c4550,_0x52dc0c){_0x1c4550=_0x1c4550-0x0;var _0x2c55e8=_0xc7bf[_0x1c4550];return _0x2c55e8;};'use strict';var multer=require(_0xfc7b('0x0'));var util=require(_0xfc7b('0x1'));var path=require(_0xfc7b('0x2'));var timeout=require(_0xfc7b('0x3'));var express=require(_0xfc7b('0x4'));var router=express[_0xfc7b('0x5')]();var fs_extra=require(_0xfc7b('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xfc7b('0x7'));var config=require('../../config/environment');var controller=require(_0xfc7b('0x8'));router[_0xfc7b('0x9')]('/',auth[_0xfc7b('0xa')](),controller[_0xfc7b('0xb')]);router[_0xfc7b('0x9')](_0xfc7b('0xc'),auth['isAuthenticated'](),controller[_0xfc7b('0xd')]);router[_0xfc7b('0xe')]('/',auth[_0xfc7b('0xa')](),controller[_0xfc7b('0xf')]);router[_0xfc7b('0x10')]('/:id',auth[_0xfc7b('0xa')](),controller[_0xfc7b('0x11')]);router['delete'](_0xfc7b('0xc'),auth[_0xfc7b('0xa')](),controller[_0xfc7b('0x12')]);module[_0xfc7b('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 401b02a..6f41273 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 _0x114d=['sequelize','exports','STRING','TEXT','BLOB','long','getDataValue','preproduction','toString','utf8','production','DATE'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x114d,0x144));var _0xd114=function(_0xcf6731,_0x21db70){_0xcf6731=_0xcf6731-0x0;var _0xeb534c=_0x114d[_0xcf6731];return _0xeb534c;};'use strict';var Sequelize=require(_0xd114('0x0'));module[_0xd114('0x1')]={'name':{'type':Sequelize[_0xd114('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xd114('0x2')]},'notes':{'type':Sequelize[_0xd114('0x3')]},'preproduction':{'type':Sequelize[_0xd114('0x4')](_0xd114('0x5')),'get':function(){if(this['getDataValue']('preproduction')){return this[_0xd114('0x6')](_0xd114('0x7'))[_0xd114('0x8')](_0xd114('0x9'));}}},'production':{'type':Sequelize[_0xd114('0x4')](_0xd114('0x5')),'get':function(){if(this[_0xd114('0x6')](_0xd114('0xa'))){return this['getDataValue'](_0xd114('0xa'))[_0xd114('0x8')](_0xd114('0x9'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0xd114('0xb')]}}; \ No newline at end of file +var _0x5017=['long','production','toString','STRING','name','TEXT','BLOB','getDataValue','preproduction','utf8'];(function(_0x209f4c,_0x1e37ed){var _0x45d796=function(_0x3dd1e9){while(--_0x3dd1e9){_0x209f4c['push'](_0x209f4c['shift']());}};_0x45d796(++_0x1e37ed);}(_0x5017,0xa3));var _0x7501=function(_0x531020,_0x484331){_0x531020=_0x531020-0x0;var _0x423033=_0x5017[_0x531020];return _0x423033;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7501('0x0')],'unique':_0x7501('0x1'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0x7501('0x2')]},'preproduction':{'type':Sequelize[_0x7501('0x3')]('long'),'get':function(){if(this[_0x7501('0x4')](_0x7501('0x5'))){return this[_0x7501('0x4')]('preproduction')['toString'](_0x7501('0x6'));}}},'production':{'type':Sequelize[_0x7501('0x3')](_0x7501('0x7')),'get':function(){if(this[_0x7501('0x4')](_0x7501('0x8'))){return this[_0x7501('0x4')]('production')[_0x7501('0x9')]('utf8');}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 651dd17..257c505 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 _0x68cc=['UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','production','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','status','json','undefined','limit','offset','set','update','then','get','SquareProjects','UserProfileResource','destroy','publish','stringify','end','sendStatus','error','stack','name','index','map','SquareProject','fieldName','type','model','keys','filters','fields','query','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','show','params','intersection','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x5bca2f,_0x3b9a52){var _0x558235=function(_0x371345){while(--_0x371345){_0x5bca2f['push'](_0x5bca2f['shift']());}};_0x558235(++_0x3b9a52);}(_0x68cc,0x15e));var _0xc68c=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x68cc[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require('lodash');var Redis=require(_0xc68c('0x0'));var qs=require('../../components/parsers/qs');var logger=require(_0xc68c('0x1'))(_0xc68c('0x2'));var config=require(_0xc68c('0x3'));var db=require(_0xc68c('0x4'))['db'];config[_0xc68c('0x5')]=_[_0xc68c('0x6')](config[_0xc68c('0x5')],{'host':_0xc68c('0x7'),'port':0x18eb});var socket=require(_0xc68c('0x8'))(new Redis(config[_0xc68c('0x5')]));require(_0xc68c('0x9'))[_0xc68c('0xa')](socket);function respondWithResult(_0x241f7b,_0xc7dbda){_0xc7dbda=_0xc7dbda||0xc8;return function(_0x1fc709){if(_0x1fc709){return _0x241f7b[_0xc68c('0xb')](_0xc7dbda)[_0xc68c('0xc')](_0x1fc709);}};}function respondWithFilteredResult(_0x2bf522,_0x5ab58e){return function(_0x2f4b71){if(_0x2f4b71){var _0x3a36f6=typeof _0x5ab58e['offset']===_0xc68c('0xd')&&typeof _0x5ab58e[_0xc68c('0xe')]===_0xc68c('0xd');var _0x316d2b=_0x2f4b71['count'];var _0x34a983=_0x3a36f6?0x0:_0x5ab58e[_0xc68c('0xf')];var _0x136137=_0x3a36f6?_0x2f4b71['count']:_0x5ab58e[_0xc68c('0xf')]+_0x5ab58e[_0xc68c('0xe')];var _0x5b04b4;if(_0x136137>=_0x316d2b){_0x136137=_0x316d2b;_0x5b04b4=0xc8;}else{_0x5b04b4=0xce;}_0x2bf522[_0xc68c('0xb')](_0x5b04b4);return _0x2bf522[_0xc68c('0x10')]('Content-Range',_0x34a983+'-'+_0x136137+'/'+_0x316d2b)['json'](_0x2f4b71);}return null;};}function saveUpdates(_0x3bebf7){return function(_0x28060f){if(_0x28060f){return _0x28060f[_0xc68c('0x11')](_0x3bebf7)[_0xc68c('0x12')](function(_0x190686){return _0x190686;});}return null;};}function removeEntity(_0x3cc3e0){return function(_0x1c1f3f){if(_0x1c1f3f){return _0x1c1f3f['destroy']()['then'](function(){var _0x23fcc0=_0x1c1f3f[_0xc68c('0x13')]({'plain':!![]});var _0xc0a146=_0xc68c('0x14');return db[_0xc68c('0x15')][_0xc68c('0x16')]({'where':{'type':_0xc0a146,'resourceId':_0x23fcc0['id']}})[_0xc68c('0x12')](function(){return _0x1c1f3f;});})[_0xc68c('0x12')](function(){var _0x20f0d9=new Redis(config['redis']);_0x20f0d9[_0xc68c('0x17')]('agi',JSON[_0xc68c('0x18')]({'id':_0x1c1f3f['id'],'deleted':!![]}));})[_0xc68c('0x12')](function(){_0x3cc3e0[_0xc68c('0xb')](0xcc)[_0xc68c('0x19')]();});}};}function handleEntityNotFound(_0x204763){return function(_0x7a5b75){if(!_0x7a5b75){_0x204763[_0xc68c('0x1a')](0x194);}return _0x7a5b75;};}function handleError(_0x1a82e6,_0x4105b9){_0x4105b9=_0x4105b9||0x1f4;return function(_0x12e3ec){logger[_0xc68c('0x1b')](_0x12e3ec[_0xc68c('0x1c')]);if(_0x12e3ec[_0xc68c('0x1d')]){delete _0x12e3ec[_0xc68c('0x1d')];}_0x1a82e6[_0xc68c('0xb')](_0x4105b9)['send'](_0x12e3ec);};}exports[_0xc68c('0x1e')]=function(_0x10bd89,_0x517299){var _0x5dd39d={},_0x357e6a={},_0x4270f6={'count':0x0,'rows':[]};var _0x26e6a2=_[_0xc68c('0x1f')](db[_0xc68c('0x20')]['rawAttributes'],function(_0x47cbb5){return{'name':_0x47cbb5[_0xc68c('0x21')],'type':_0x47cbb5[_0xc68c('0x22')]['key']};});_0x357e6a[_0xc68c('0x23')]=_[_0xc68c('0x1f')](_0x26e6a2,_0xc68c('0x1d'));_0x357e6a['query']=_[_0xc68c('0x24')](_0x10bd89['query']);_0x357e6a[_0xc68c('0x25')]=_['intersection'](_0x357e6a[_0xc68c('0x23')],_0x357e6a['query']);_0x5dd39d['attributes']=_['intersection'](_0x357e6a[_0xc68c('0x23')],qs[_0xc68c('0x26')](_0x10bd89[_0xc68c('0x27')][_0xc68c('0x26')]));_0x5dd39d['attributes']=_0x5dd39d[_0xc68c('0x28')][_0xc68c('0x29')]?_0x5dd39d['attributes']:_0x357e6a['model'];if(!_0x10bd89[_0xc68c('0x27')][_0xc68c('0x2a')]('nolimit')){_0x5dd39d[_0xc68c('0xe')]=qs['limit'](_0x10bd89['query'][_0xc68c('0xe')]);_0x5dd39d[_0xc68c('0xf')]=qs[_0xc68c('0xf')](_0x10bd89[_0xc68c('0x27')][_0xc68c('0xf')]);}_0x5dd39d[_0xc68c('0x2b')]=qs['sort'](_0x10bd89[_0xc68c('0x27')][_0xc68c('0x2c')]);_0x5dd39d[_0xc68c('0x2d')]=qs[_0xc68c('0x25')](_[_0xc68c('0x2e')](_0x10bd89['query'],_0x357e6a[_0xc68c('0x25')]),_0x26e6a2);if(_0x10bd89[_0xc68c('0x27')][_0xc68c('0x2f')]){_0x5dd39d[_0xc68c('0x2d')]=_[_0xc68c('0x30')](_0x5dd39d[_0xc68c('0x2d')],{'$or':_['map'](_0x26e6a2,function(_0x12410e){if(_0x12410e[_0xc68c('0x22')]!==_0xc68c('0x31')){var _0x562e94={};_0x562e94[_0x12410e[_0xc68c('0x1d')]]={'$like':'%'+_0x10bd89[_0xc68c('0x27')][_0xc68c('0x2f')]+'%'};return _0x562e94;}})});}_0x5dd39d=_[_0xc68c('0x30')]({},_0x5dd39d,_0x10bd89[_0xc68c('0x32')]);var _0x40c7b9={'where':_0x5dd39d['where']};return db[_0xc68c('0x20')][_0xc68c('0x33')](_0x40c7b9)['then'](function(_0x3f9415){_0x4270f6['count']=_0x3f9415;if(_0x10bd89[_0xc68c('0x27')][_0xc68c('0x34')]){_0x5dd39d[_0xc68c('0x35')]=[{'all':!![]}];}return db['SquareProject'][_0xc68c('0x36')](_0x5dd39d);})[_0xc68c('0x12')](function(_0x443712){_0x4270f6['rows']=_0x443712;return _0x4270f6;})['then'](respondWithFilteredResult(_0x517299,_0x5dd39d))['catch'](handleError(_0x517299,null));};exports[_0xc68c('0x37')]=function(_0x2073e7,_0x37ae67){var _0x1f9937={'raw':![],'where':{'id':_0x2073e7[_0xc68c('0x38')]['id']}},_0x3ad48e={};_0x3ad48e[_0xc68c('0x23')]=_[_0xc68c('0x24')](db[_0xc68c('0x20')]['rawAttributes']);_0x3ad48e['query']=_[_0xc68c('0x24')](_0x2073e7['query']);_0x3ad48e[_0xc68c('0x25')]=_[_0xc68c('0x39')](_0x3ad48e['model'],_0x3ad48e[_0xc68c('0x27')]);_0x1f9937[_0xc68c('0x28')]=_['intersection'](_0x3ad48e[_0xc68c('0x23')],qs[_0xc68c('0x26')](_0x2073e7[_0xc68c('0x27')][_0xc68c('0x26')]));_0x1f9937[_0xc68c('0x28')]=_0x1f9937['attributes'][_0xc68c('0x29')]?_0x1f9937['attributes']:_0x3ad48e[_0xc68c('0x23')];if(_0x2073e7[_0xc68c('0x27')][_0xc68c('0x34')]){_0x1f9937[_0xc68c('0x35')]=[{'all':!![]}];}_0x1f9937=_[_0xc68c('0x30')]({},_0x1f9937,_0x2073e7[_0xc68c('0x32')]);return db[_0xc68c('0x20')]['find'](_0x1f9937)[_0xc68c('0x12')](handleEntityNotFound(_0x37ae67,null))[_0xc68c('0x12')](respondWithResult(_0x37ae67,null))[_0xc68c('0x3a')](handleError(_0x37ae67,null));};exports[_0xc68c('0x3b')]=function(_0x4b99b7,_0x1e7090){return db[_0xc68c('0x20')]['create'](_0x4b99b7[_0xc68c('0x3c')],{})[_0xc68c('0x12')](function(_0x1d36ca){var _0x556180=_0x4b99b7[_0xc68c('0x3d')][_0xc68c('0x13')]({'plain':!![]});if(!_0x556180)throw new Error(_0xc68c('0x3e'));if(_0x556180[_0xc68c('0x3f')]===_0xc68c('0x3d')){var _0x46953e=_0x1d36ca[_0xc68c('0x13')]({'plain':!![]});var _0x2e4cec='SquareProjects';return db[_0xc68c('0x40')][_0xc68c('0x41')]({'where':{'name':_0x2e4cec,'userProfileId':_0x556180['userProfileId']},'raw':!![]})['then'](function(_0x241af3){if(_0x241af3&&_0x241af3[_0xc68c('0x42')]===0x0){return db[_0xc68c('0x15')]['create']({'name':_0x46953e['name'],'resourceId':_0x46953e['id'],'type':_0x241af3['name'],'sectionId':_0x241af3['id']},{})[_0xc68c('0x12')](function(){return _0x1d36ca;});}else{return _0x1d36ca;}})[_0xc68c('0x3a')](function(_0x1c6d21){logger[_0xc68c('0x1b')](_0xc68c('0x43'),_0x1c6d21);throw _0x1c6d21;});}return _0x1d36ca;})[_0xc68c('0x12')](respondWithResult(_0x1e7090,0xc9))[_0xc68c('0x3a')](handleError(_0x1e7090,null));};exports[_0xc68c('0x11')]=function(_0x3b74c1,_0x33ce20){if(_0x3b74c1[_0xc68c('0x3c')]['id']){delete _0x3b74c1[_0xc68c('0x3c')]['id'];}return db[_0xc68c('0x20')][_0xc68c('0x41')]({'where':{'id':_0x3b74c1['params']['id']}})[_0xc68c('0x12')](handleEntityNotFound(_0x33ce20,null))['then'](saveUpdates(_0x3b74c1['body'],null))[_0xc68c('0x12')](function(_0x3ffb4c){if(!_0x3ffb4c)return;var _0x2c4935=_0x3ffb4c[_0xc68c('0x13')]({'plain':!![]});return _0x2c4935;})[_0xc68c('0x12')](function(_0x59718f){var _0x3d3475=new Redis(config['redis']);_0x3d3475[_0xc68c('0x17')]('agi',JSON[_0xc68c('0x18')](_[_0xc68c('0x2e')](_0x59718f,['id',_0xc68c('0x1d'),_0xc68c('0x44')])));return _0x59718f;})[_0xc68c('0x12')](respondWithResult(_0x33ce20,null))[_0xc68c('0x3a')](handleError(_0x33ce20,null));};exports['destroy']=function(_0x2b71ad,_0x1b9b35){return db[_0xc68c('0x20')][_0xc68c('0x41')]({'where':{'id':_0x2b71ad[_0xc68c('0x38')]['id']}})[_0xc68c('0x12')](handleEntityNotFound(_0x1b9b35,null))[_0xc68c('0x12')](removeEntity(_0x1b9b35,null))[_0xc68c('0x3a')](handleError(_0x1b9b35,null));}; \ No newline at end of file +var _0xd485=['agi','stringify','end','sendStatus','error','stack','name','send','index','map','SquareProject','rawAttributes','fieldName','key','model','query','keys','intersection','fields','length','attributes','hasOwnProperty','order','sort','pick','filters','filter','where','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./squareProject.socket','register','status','json','undefined','limit','count','offset','set','Content-Range','destroy','SquareProjects','UserProfileResource','then','publish'];(function(_0x593b09,_0x3395dc){var _0x228884=function(_0x83cc5){while(--_0x83cc5){_0x593b09['push'](_0x593b09['shift']());}};_0x228884(++_0x3395dc);}(_0xd485,0x114));var _0x5d48=function(_0x3e3d55,_0x2ce35c){_0x3e3d55=_0x3e3d55-0x0;var _0x2a463d=_0xd485[_0x3e3d55];return _0x2a463d;};'use strict';var _=require(_0x5d48('0x0'));var Redis=require('ioredis');var qs=require(_0x5d48('0x1'));var logger=require(_0x5d48('0x2'))(_0x5d48('0x3'));var config=require(_0x5d48('0x4'));var db=require(_0x5d48('0x5'))['db'];config[_0x5d48('0x6')]=_[_0x5d48('0x7')](config[_0x5d48('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x5d48('0x8'))(new Redis(config[_0x5d48('0x6')]));require(_0x5d48('0x9'))[_0x5d48('0xa')](socket);function respondWithResult(_0x35d66e,_0x3bf16a){_0x3bf16a=_0x3bf16a||0xc8;return function(_0xe2db47){if(_0xe2db47){return _0x35d66e[_0x5d48('0xb')](_0x3bf16a)[_0x5d48('0xc')](_0xe2db47);}};}function respondWithFilteredResult(_0x55360d,_0x3c5423){return function(_0x498aa5){if(_0x498aa5){var _0x31c68d=typeof _0x3c5423['offset']===_0x5d48('0xd')&&typeof _0x3c5423[_0x5d48('0xe')]===_0x5d48('0xd');var _0x119d8c=_0x498aa5['count'];var _0x18f156=_0x31c68d?0x0:_0x3c5423['offset'];var _0x222792=_0x31c68d?_0x498aa5[_0x5d48('0xf')]:_0x3c5423[_0x5d48('0x10')]+_0x3c5423[_0x5d48('0xe')];var _0x46a0ca;if(_0x222792>=_0x119d8c){_0x222792=_0x119d8c;_0x46a0ca=0xc8;}else{_0x46a0ca=0xce;}_0x55360d[_0x5d48('0xb')](_0x46a0ca);return _0x55360d[_0x5d48('0x11')](_0x5d48('0x12'),_0x18f156+'-'+_0x222792+'/'+_0x119d8c)[_0x5d48('0xc')](_0x498aa5);}return null;};}function saveUpdates(_0x25021d){return function(_0x707628){if(_0x707628){return _0x707628['update'](_0x25021d)['then'](function(_0x1335aa){return _0x1335aa;});}return null;};}function removeEntity(_0x5b380d){return function(_0x3e223b){if(_0x3e223b){return _0x3e223b[_0x5d48('0x13')]()['then'](function(){var _0x54eb30=_0x3e223b['get']({'plain':!![]});var _0x55cde9=_0x5d48('0x14');return db[_0x5d48('0x15')]['destroy']({'where':{'type':_0x55cde9,'resourceId':_0x54eb30['id']}})[_0x5d48('0x16')](function(){return _0x3e223b;});})['then'](function(){var _0x5cc16b=new Redis(config[_0x5d48('0x6')]);_0x5cc16b[_0x5d48('0x17')](_0x5d48('0x18'),JSON[_0x5d48('0x19')]({'id':_0x3e223b['id'],'deleted':!![]}));})[_0x5d48('0x16')](function(){_0x5b380d[_0x5d48('0xb')](0xcc)[_0x5d48('0x1a')]();});}};}function handleEntityNotFound(_0x2a10bf){return function(_0x535285){if(!_0x535285){_0x2a10bf[_0x5d48('0x1b')](0x194);}return _0x535285;};}function handleError(_0x542353,_0x1aaa9a){_0x1aaa9a=_0x1aaa9a||0x1f4;return function(_0x5ef523){logger[_0x5d48('0x1c')](_0x5ef523[_0x5d48('0x1d')]);if(_0x5ef523[_0x5d48('0x1e')]){delete _0x5ef523[_0x5d48('0x1e')];}_0x542353[_0x5d48('0xb')](_0x1aaa9a)[_0x5d48('0x1f')](_0x5ef523);};}exports[_0x5d48('0x20')]=function(_0xd23880,_0x24db20){var _0x5daecc={},_0x55b97c={},_0x35ae39={'count':0x0,'rows':[]};var _0x28f3fa=_[_0x5d48('0x21')](db[_0x5d48('0x22')][_0x5d48('0x23')],function(_0x327f27){return{'name':_0x327f27[_0x5d48('0x24')],'type':_0x327f27['type'][_0x5d48('0x25')]};});_0x55b97c[_0x5d48('0x26')]=_[_0x5d48('0x21')](_0x28f3fa,'name');_0x55b97c[_0x5d48('0x27')]=_[_0x5d48('0x28')](_0xd23880[_0x5d48('0x27')]);_0x55b97c['filters']=_[_0x5d48('0x29')](_0x55b97c[_0x5d48('0x26')],_0x55b97c[_0x5d48('0x27')]);_0x5daecc['attributes']=_['intersection'](_0x55b97c['model'],qs[_0x5d48('0x2a')](_0xd23880[_0x5d48('0x27')][_0x5d48('0x2a')]));_0x5daecc['attributes']=_0x5daecc['attributes'][_0x5d48('0x2b')]?_0x5daecc[_0x5d48('0x2c')]:_0x55b97c[_0x5d48('0x26')];if(!_0xd23880[_0x5d48('0x27')][_0x5d48('0x2d')]('nolimit')){_0x5daecc[_0x5d48('0xe')]=qs[_0x5d48('0xe')](_0xd23880[_0x5d48('0x27')][_0x5d48('0xe')]);_0x5daecc[_0x5d48('0x10')]=qs['offset'](_0xd23880[_0x5d48('0x27')][_0x5d48('0x10')]);}_0x5daecc[_0x5d48('0x2e')]=qs[_0x5d48('0x2f')](_0xd23880[_0x5d48('0x27')][_0x5d48('0x2f')]);_0x5daecc['where']=qs['filters'](_[_0x5d48('0x30')](_0xd23880[_0x5d48('0x27')],_0x55b97c[_0x5d48('0x31')]),_0x28f3fa);if(_0xd23880[_0x5d48('0x27')][_0x5d48('0x32')]){_0x5daecc[_0x5d48('0x33')]=_[_0x5d48('0x34')](_0x5daecc[_0x5d48('0x33')],{'$or':_[_0x5d48('0x21')](_0x28f3fa,function(_0x3d59bb){if(_0x3d59bb[_0x5d48('0x35')]!==_0x5d48('0x36')){var _0x310914={};_0x310914[_0x3d59bb[_0x5d48('0x1e')]]={'$like':'%'+_0xd23880[_0x5d48('0x27')][_0x5d48('0x32')]+'%'};return _0x310914;}})});}_0x5daecc=_[_0x5d48('0x34')]({},_0x5daecc,_0xd23880[_0x5d48('0x37')]);var _0x3d4cc0={'where':_0x5daecc[_0x5d48('0x33')]};return db['SquareProject'][_0x5d48('0xf')](_0x3d4cc0)[_0x5d48('0x16')](function(_0x1ea81e){_0x35ae39[_0x5d48('0xf')]=_0x1ea81e;if(_0xd23880['query'][_0x5d48('0x38')]){_0x5daecc['include']=[{'all':!![]}];}return db['SquareProject'][_0x5d48('0x39')](_0x5daecc);})[_0x5d48('0x16')](function(_0x3977b8){_0x35ae39[_0x5d48('0x3a')]=_0x3977b8;return _0x35ae39;})['then'](respondWithFilteredResult(_0x24db20,_0x5daecc))[_0x5d48('0x3b')](handleError(_0x24db20,null));};exports[_0x5d48('0x3c')]=function(_0xcdb409,_0x19e770){var _0x2b2e5a={'raw':![],'where':{'id':_0xcdb409['params']['id']}},_0x49e8e1={};_0x49e8e1[_0x5d48('0x26')]=_['keys'](db[_0x5d48('0x22')][_0x5d48('0x23')]);_0x49e8e1[_0x5d48('0x27')]=_['keys'](_0xcdb409[_0x5d48('0x27')]);_0x49e8e1[_0x5d48('0x31')]=_[_0x5d48('0x29')](_0x49e8e1[_0x5d48('0x26')],_0x49e8e1[_0x5d48('0x27')]);_0x2b2e5a[_0x5d48('0x2c')]=_[_0x5d48('0x29')](_0x49e8e1['model'],qs[_0x5d48('0x2a')](_0xcdb409['query'][_0x5d48('0x2a')]));_0x2b2e5a['attributes']=_0x2b2e5a[_0x5d48('0x2c')][_0x5d48('0x2b')]?_0x2b2e5a[_0x5d48('0x2c')]:_0x49e8e1[_0x5d48('0x26')];if(_0xcdb409[_0x5d48('0x27')]['includeAll']){_0x2b2e5a[_0x5d48('0x3d')]=[{'all':!![]}];}_0x2b2e5a=_[_0x5d48('0x34')]({},_0x2b2e5a,_0xcdb409[_0x5d48('0x37')]);return db['SquareProject']['find'](_0x2b2e5a)[_0x5d48('0x16')](handleEntityNotFound(_0x19e770,null))[_0x5d48('0x16')](respondWithResult(_0x19e770,null))[_0x5d48('0x3b')](handleError(_0x19e770,null));};exports['create']=function(_0x29ccbe,_0x3dadb5){return db[_0x5d48('0x22')][_0x5d48('0x3e')](_0x29ccbe[_0x5d48('0x3f')],{})[_0x5d48('0x16')](function(_0x222e9a){var _0x33ed53=_0x29ccbe[_0x5d48('0x40')][_0x5d48('0x41')]({'plain':!![]});if(!_0x33ed53)throw new Error(_0x5d48('0x42'));if(_0x33ed53[_0x5d48('0x43')]===_0x5d48('0x40')){var _0x141a39=_0x222e9a[_0x5d48('0x41')]({'plain':!![]});var _0x4e43e2=_0x5d48('0x14');return db[_0x5d48('0x44')]['find']({'where':{'name':_0x4e43e2,'userProfileId':_0x33ed53[_0x5d48('0x45')]},'raw':!![]})[_0x5d48('0x16')](function(_0x3c88f8){if(_0x3c88f8&&_0x3c88f8[_0x5d48('0x46')]===0x0){return db[_0x5d48('0x15')]['create']({'name':_0x141a39[_0x5d48('0x1e')],'resourceId':_0x141a39['id'],'type':_0x3c88f8['name'],'sectionId':_0x3c88f8['id']},{})[_0x5d48('0x16')](function(){return _0x222e9a;});}else{return _0x222e9a;}})['catch'](function(_0x12778d){logger[_0x5d48('0x1c')](_0x5d48('0x47'),_0x12778d);throw _0x12778d;});}return _0x222e9a;})[_0x5d48('0x16')](respondWithResult(_0x3dadb5,0xc9))[_0x5d48('0x3b')](handleError(_0x3dadb5,null));};exports[_0x5d48('0x48')]=function(_0x71e8b5,_0x1eb18a){if(_0x71e8b5['body']['id']){delete _0x71e8b5[_0x5d48('0x3f')]['id'];}return db[_0x5d48('0x22')][_0x5d48('0x49')]({'where':{'id':_0x71e8b5['params']['id']}})['then'](handleEntityNotFound(_0x1eb18a,null))[_0x5d48('0x16')](saveUpdates(_0x71e8b5['body'],null))[_0x5d48('0x16')](function(_0x22fa36){if(!_0x22fa36)return;var _0x3283ce=_0x22fa36[_0x5d48('0x41')]({'plain':!![]});return _0x3283ce;})[_0x5d48('0x16')](function(_0xf9303c){var _0x21daa0=new Redis(config[_0x5d48('0x6')]);_0x21daa0[_0x5d48('0x17')]('agi',JSON[_0x5d48('0x19')](_['pick'](_0xf9303c,['id','name','production'])));return _0xf9303c;})[_0x5d48('0x16')](respondWithResult(_0x1eb18a,null))['catch'](handleError(_0x1eb18a,null));};exports[_0x5d48('0x13')]=function(_0x47692e,_0x2872de){return db[_0x5d48('0x22')][_0x5d48('0x49')]({'where':{'id':_0x47692e[_0x5d48('0x4a')]['id']}})[_0x5d48('0x16')](handleEntityNotFound(_0x2872de,null))[_0x5d48('0x16')](removeEntity(_0x2872de,null))['catch'](handleError(_0x2872de,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 6cbf794..e1d4d10 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 _0xdee7=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x211201,_0x454beb){var _0x11fe16=function(_0x172c6e){while(--_0x172c6e){_0x211201['push'](_0x211201['shift']());}};_0x11fe16(++_0x454beb);}(_0xdee7,0x17b));var _0x7dee=function(_0x48d8e7,_0x36eb60){_0x48d8e7=_0x48d8e7-0x0;var _0x223a40=_0xdee7[_0x48d8e7];return _0x223a40;};'use strict';var EventEmitter=require(_0x7dee('0x0'));var SquareProject=require(_0x7dee('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x7dee('0x2')](0x0);var events={'afterCreate':_0x7dee('0x3'),'afterUpdate':_0x7dee('0x4'),'afterDestroy':_0x7dee('0x5')};function emitEvent(_0x4e9fd3){return function(_0x5b414f,_0x171f68,_0x14fb78){SquareProjectEvents[_0x7dee('0x6')](_0x4e9fd3+':'+_0x5b414f['id'],_0x5b414f);SquareProjectEvents[_0x7dee('0x6')](_0x4e9fd3,_0x5b414f);_0x14fb78(null);};}for(var e in events){if(events[_0x7dee('0x7')](e)){var event=events[e];SquareProject[_0x7dee('0x8')](e,emitEvent(event));}}module[_0x7dee('0x9')]=SquareProjectEvents; \ No newline at end of file +var _0x510e=['emit','events','../../mysqldb','SquareProject','setMaxListeners','save','update','remove'];(function(_0x28c07e,_0x29bd06){var _0x43ed5e=function(_0x4d73e8){while(--_0x4d73e8){_0x28c07e['push'](_0x28c07e['shift']());}};_0x43ed5e(++_0x29bd06);}(_0x510e,0x139));var _0xe510=function(_0x2ca9d4,_0x51d5c6){_0x2ca9d4=_0x2ca9d4-0x0;var _0x258956=_0x510e[_0x2ca9d4];return _0x258956;};'use strict';var EventEmitter=require(_0xe510('0x0'));var SquareProject=require(_0xe510('0x1'))['db'][_0xe510('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xe510('0x3')](0x0);var events={'afterCreate':_0xe510('0x4'),'afterUpdate':_0xe510('0x5'),'afterDestroy':_0xe510('0x6')};function emitEvent(_0x428c03){return function(_0x583f49,_0x330117,_0xc0eec8){SquareProjectEvents[_0xe510('0x7')](_0x428c03+':'+_0x583f49['id'],_0x583f49);SquareProjectEvents[_0xe510('0x7')](_0x428c03,_0x583f49);_0xc0eec8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index e09875c..5816852 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 _0xd232=['changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./squareProject.attributes','define','SquareProject','square_projects'];(function(_0x9c4a0e,_0x3c943c){var _0x35e304=function(_0x1fcfae){while(--_0x1fcfae){_0x9c4a0e['push'](_0x9c4a0e['shift']());}};_0x35e304(++_0x3c943c);}(_0xd232,0x102));var _0x2d23=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd232[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2d23('0x0'));var util=require(_0x2d23('0x1'));var logger=require(_0x2d23('0x2'))('api');var moment=require(_0x2d23('0x3'));var BPromise=require(_0x2d23('0x4'));var rp=require(_0x2d23('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2d23('0x6'));var config=require(_0x2d23('0x7'));var attributes=require(_0x2d23('0x8'));module['exports']=function(_0x2a614d,_0x28e9c8){return _0x2a614d[_0x2d23('0x9')](_0x2d23('0xa'),attributes,{'tableName':_0x2d23('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5b2827,_0x2a5474,_0x12234d){if(_0x5b2827[_0x2d23('0xc')](_0x2d23('0xd'))){_0x5b2827[_0x2d23('0xe')]=moment()[_0x2d23('0xf')](_0x2d23('0x10'));}if(_0x5b2827[_0x2d23('0xc')](_0x2d23('0x11'))){_0x5b2827['publishedAt']=moment()[_0x2d23('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x12234d(null,_0x5b2827);}}});}; \ No newline at end of file +var _0xbbb0=['changed','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects'];(function(_0x1693dd,_0x135d5b){var _0x126aa7=function(_0x4f0bfe){while(--_0x4f0bfe){_0x1693dd['push'](_0x1693dd['shift']());}};_0x126aa7(++_0x135d5b);}(_0xbbb0,0x196));var _0x0bbb=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xbbb0[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x0bbb('0x0'));var util=require(_0x0bbb('0x1'));var logger=require(_0x0bbb('0x2'))('api');var moment=require(_0x0bbb('0x3'));var BPromise=require(_0x0bbb('0x4'));var rp=require(_0x0bbb('0x5'));var fs=require('fs');var path=require(_0x0bbb('0x6'));var rimraf=require(_0x0bbb('0x7'));var config=require(_0x0bbb('0x8'));var attributes=require(_0x0bbb('0x9'));module[_0x0bbb('0xa')]=function(_0x2b3f37,_0x5a4973){return _0x2b3f37[_0x0bbb('0xb')](_0x0bbb('0xc'),attributes,{'tableName':_0x0bbb('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5f3398,_0x4c9715,_0xebb1eb){if(_0x5f3398[_0x0bbb('0xe')]('preproduction')){_0x5f3398[_0x0bbb('0xf')]=moment()[_0x0bbb('0x10')](_0x0bbb('0x11'));}if(_0x5f3398[_0x0bbb('0xe')](_0x0bbb('0x12'))){_0x5f3398[_0x0bbb('0x13')]=moment()[_0x0bbb('0x10')](_0x0bbb('0x11'));}_0xebb1eb(null,_0x5f3398);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 144eb14..c6a147a 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 _0x2a82=['find','raw','info','catch','lodash','ioredis','../../mysqldb','rpc','../../config/environment','defaults','localhost','redis','./squareProject.socket','register','SquareProject','findAll','options','where','attributes','limit','map','include','model','then','GetSquareProjects','stringify','error','message','ShowSquareProject'];(function(_0x300499,_0x3d9034){var _0x39b72c=function(_0x149e73){while(--_0x149e73){_0x300499['push'](_0x300499['shift']());}};_0x39b72c(++_0x3d9034);}(_0x2a82,0x1d4));var _0x22a8=function(_0x20f595,_0x1bb223){_0x20f595=_0x20f595-0x0;var _0x31deed=_0x2a82[_0x20f595];return _0x31deed;};'use strict';var _=require(_0x22a8('0x0'));var Redis=require(_0x22a8('0x1'));var db=require(_0x22a8('0x2'))['db'];var logger=require('../../config/logger')(_0x22a8('0x3'));var config=require(_0x22a8('0x4'));config['redis']=_[_0x22a8('0x5')](config['redis'],{'host':_0x22a8('0x6'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x22a8('0x7')]));require(_0x22a8('0x8'))[_0x22a8('0x9')](socket);exports['GetSquareProjects']=function(_0xc2dbab){var _0x313df8=this;return new Promise(function(_0x15a115,_0x7fe4f1){return db[_0x22a8('0xa')][_0x22a8('0xb')]({'raw':_0xc2dbab['options']?_0xc2dbab[_0x22a8('0xc')]['raw']===undefined?!![]:![]:!![],'where':_0xc2dbab[_0x22a8('0xc')]?_0xc2dbab[_0x22a8('0xc')][_0x22a8('0xd')]||null:null,'attributes':_0xc2dbab[_0x22a8('0xc')]?_0xc2dbab['options'][_0x22a8('0xe')]||null:null,'limit':_0xc2dbab[_0x22a8('0xc')]?_0xc2dbab[_0x22a8('0xc')][_0x22a8('0xf')]||null:null,'include':_0xc2dbab[_0x22a8('0xc')]?_0xc2dbab[_0x22a8('0xc')]['include']?_[_0x22a8('0x10')](_0xc2dbab[_0x22a8('0xc')][_0x22a8('0x11')],function(_0x4787c0){return{'model':db[_0x4787c0[_0x22a8('0x12')]],'as':_0x4787c0['as'],'attributes':_0x4787c0[_0x22a8('0xe')],'include':_0x4787c0[_0x22a8('0x11')]?_[_0x22a8('0x10')](_0x4787c0['include'],function(_0x39c8a4){return{'model':db[_0x39c8a4[_0x22a8('0x12')]],'as':_0x39c8a4['as'],'attributes':_0x39c8a4[_0x22a8('0xe')],'include':_0x39c8a4[_0x22a8('0x11')]?_[_0x22a8('0x10')](_0x39c8a4['include'],function(_0x48559b){return{'model':db[_0x48559b[_0x22a8('0x12')]],'as':_0x48559b['as'],'attributes':_0x48559b[_0x22a8('0xe')]};}):[]};}):[]};}):[]:[]})[_0x22a8('0x13')](function(_0x1d9da7){logger['info']('GetSquareProjects',_0xc2dbab);logger['debug'](_0x22a8('0x14'),_0xc2dbab,JSON[_0x22a8('0x15')](_0x1d9da7));_0x15a115(_0x1d9da7);})['catch'](function(_0x363dc0){logger[_0x22a8('0x16')](_0x22a8('0x14'),_0x363dc0[_0x22a8('0x17')],_0xc2dbab);_0x7fe4f1(_0x313df8[_0x22a8('0x16')](0x1f4,_0x363dc0[_0x22a8('0x17')]));});});};exports[_0x22a8('0x18')]=function(_0x3cffe1){var _0xa148c=this;return new Promise(function(_0x40eb63,_0x281463){return db[_0x22a8('0xa')][_0x22a8('0x19')]({'raw':_0x3cffe1['options']?_0x3cffe1[_0x22a8('0xc')][_0x22a8('0x1a')]===undefined?!![]:![]:!![],'where':_0x3cffe1[_0x22a8('0xc')]?_0x3cffe1[_0x22a8('0xc')][_0x22a8('0xd')]||null:null,'attributes':_0x3cffe1['options']?_0x3cffe1[_0x22a8('0xc')]['attributes']||null:null,'include':_0x3cffe1[_0x22a8('0xc')]?_0x3cffe1[_0x22a8('0xc')][_0x22a8('0x11')]?_[_0x22a8('0x10')](_0x3cffe1[_0x22a8('0xc')][_0x22a8('0x11')],function(_0x4262a1){return{'model':db[_0x4262a1[_0x22a8('0x12')]],'as':_0x4262a1['as'],'attributes':_0x4262a1['attributes'],'include':_0x4262a1[_0x22a8('0x11')]?_[_0x22a8('0x10')](_0x4262a1[_0x22a8('0x11')],function(_0x28bfe5){return{'model':db[_0x28bfe5[_0x22a8('0x12')]],'as':_0x28bfe5['as'],'attributes':_0x28bfe5['attributes'],'include':_0x28bfe5[_0x22a8('0x11')]?_[_0x22a8('0x10')](_0x28bfe5['include'],function(_0x41f031){return{'model':db[_0x41f031[_0x22a8('0x12')]],'as':_0x41f031['as'],'attributes':_0x41f031['attributes']};}):[]};}):[]};}):[]:[]})[_0x22a8('0x13')](function(_0x261a41){logger[_0x22a8('0x1b')](_0x22a8('0x18'),_0x3cffe1);logger['debug'](_0x22a8('0x18'),_0x3cffe1,JSON[_0x22a8('0x15')](_0x261a41));_0x40eb63(_0x261a41);})[_0x22a8('0x1c')](function(_0x37d744){logger[_0x22a8('0x16')](_0x22a8('0x18'),_0x37d744['message'],_0x3cffe1);_0x281463(_0xa148c[_0x22a8('0x16')](0x1f4,_0x37d744[_0x22a8('0x17')]));});});}; \ No newline at end of file +var _0xefe6=['lodash','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','findAll','options','raw','attributes','include','map','model','then','info','GetSquareProjects','debug','error','message','find','ShowSquareProject','catch'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xefe6,0x64));var _0x6efe=function(_0x38301d,_0x5153a3){_0x38301d=_0x38301d-0x0;var _0x22052c=_0xefe6[_0x38301d];return _0x22052c;};'use strict';var _=require(_0x6efe('0x0'));var Redis=require(_0x6efe('0x1'));var db=require(_0x6efe('0x2'))['db'];var logger=require(_0x6efe('0x3'))(_0x6efe('0x4'));var config=require(_0x6efe('0x5'));config[_0x6efe('0x6')]=_[_0x6efe('0x7')](config[_0x6efe('0x6')],{'host':_0x6efe('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6efe('0x6')]));require('./squareProject.socket')['register'](socket);exports['GetSquareProjects']=function(_0x10f202){var _0xc8866=this;return new Promise(function(_0x239030,_0x448b79){return db['SquareProject'][_0x6efe('0x9')]({'raw':_0x10f202[_0x6efe('0xa')]?_0x10f202[_0x6efe('0xa')][_0x6efe('0xb')]===undefined?!![]:![]:!![],'where':_0x10f202[_0x6efe('0xa')]?_0x10f202[_0x6efe('0xa')]['where']||null:null,'attributes':_0x10f202[_0x6efe('0xa')]?_0x10f202[_0x6efe('0xa')][_0x6efe('0xc')]||null:null,'limit':_0x10f202[_0x6efe('0xa')]?_0x10f202[_0x6efe('0xa')]['limit']||null:null,'include':_0x10f202[_0x6efe('0xa')]?_0x10f202[_0x6efe('0xa')][_0x6efe('0xd')]?_[_0x6efe('0xe')](_0x10f202[_0x6efe('0xa')][_0x6efe('0xd')],function(_0x554d58){return{'model':db[_0x554d58[_0x6efe('0xf')]],'as':_0x554d58['as'],'attributes':_0x554d58['attributes'],'include':_0x554d58['include']?_[_0x6efe('0xe')](_0x554d58[_0x6efe('0xd')],function(_0x4ee237){return{'model':db[_0x4ee237[_0x6efe('0xf')]],'as':_0x4ee237['as'],'attributes':_0x4ee237['attributes'],'include':_0x4ee237[_0x6efe('0xd')]?_['map'](_0x4ee237['include'],function(_0x28c6a5){return{'model':db[_0x28c6a5[_0x6efe('0xf')]],'as':_0x28c6a5['as'],'attributes':_0x28c6a5[_0x6efe('0xc')]};}):[]};}):[]};}):[]:[]})[_0x6efe('0x10')](function(_0x1a1de3){logger[_0x6efe('0x11')](_0x6efe('0x12'),_0x10f202);logger[_0x6efe('0x13')](_0x6efe('0x12'),_0x10f202,JSON['stringify'](_0x1a1de3));_0x239030(_0x1a1de3);})['catch'](function(_0x3e63e3){logger[_0x6efe('0x14')]('GetSquareProjects',_0x3e63e3[_0x6efe('0x15')],_0x10f202);_0x448b79(_0xc8866[_0x6efe('0x14')](0x1f4,_0x3e63e3[_0x6efe('0x15')]));});});};exports['ShowSquareProject']=function(_0xd77d8){var _0x15fb80=this;return new Promise(function(_0x1a3b7c,_0x2d8534){return db['SquareProject'][_0x6efe('0x16')]({'raw':_0xd77d8[_0x6efe('0xa')]?_0xd77d8[_0x6efe('0xa')][_0x6efe('0xb')]===undefined?!![]:![]:!![],'where':_0xd77d8[_0x6efe('0xa')]?_0xd77d8[_0x6efe('0xa')]['where']||null:null,'attributes':_0xd77d8[_0x6efe('0xa')]?_0xd77d8[_0x6efe('0xa')][_0x6efe('0xc')]||null:null,'include':_0xd77d8[_0x6efe('0xa')]?_0xd77d8[_0x6efe('0xa')][_0x6efe('0xd')]?_[_0x6efe('0xe')](_0xd77d8[_0x6efe('0xa')][_0x6efe('0xd')],function(_0x15bc00){return{'model':db[_0x15bc00[_0x6efe('0xf')]],'as':_0x15bc00['as'],'attributes':_0x15bc00['attributes'],'include':_0x15bc00[_0x6efe('0xd')]?_[_0x6efe('0xe')](_0x15bc00['include'],function(_0x3e0140){return{'model':db[_0x3e0140[_0x6efe('0xf')]],'as':_0x3e0140['as'],'attributes':_0x3e0140[_0x6efe('0xc')],'include':_0x3e0140[_0x6efe('0xd')]?_[_0x6efe('0xe')](_0x3e0140[_0x6efe('0xd')],function(_0x4adb0f){return{'model':db[_0x4adb0f['model']],'as':_0x4adb0f['as'],'attributes':_0x4adb0f[_0x6efe('0xc')]};}):[]};}):[]};}):[]:[]})[_0x6efe('0x10')](function(_0x3396cb){logger[_0x6efe('0x11')](_0x6efe('0x17'),_0xd77d8);logger['debug'](_0x6efe('0x17'),_0xd77d8,JSON['stringify'](_0x3396cb));_0x1a3b7c(_0x3396cb);})[_0x6efe('0x18')](function(_0xef69ea){logger[_0x6efe('0x14')](_0x6efe('0x17'),_0xef69ea[_0x6efe('0x15')],_0xd77d8);_0x2d8534(_0x15fb80[_0x6efe('0x14')](0x1f4,_0xef69ea[_0x6efe('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index d7670c0..fd288ff 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 _0x1c9e=['length','squareProject:','update','emit','removeListener','register'];(function(_0x217e48,_0x2e4ae2){var _0x47f9c4=function(_0x4dc60c){while(--_0x4dc60c){_0x217e48['push'](_0x217e48['shift']());}};_0x47f9c4(++_0x2e4ae2);}(_0x1c9e,0xa4));var _0xe1c9=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1c9e[_0x2641f9];return _0x585741;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=['save','remove',_0xe1c9('0x0')];function createListener(_0x3a415c,_0x1e23aa){return function(_0x4f12d6){_0x1e23aa[_0xe1c9('0x1')](_0x3a415c,_0x4f12d6);};}function removeListener(_0x81d97c,_0x448607){return function(){SquareProjectEvents[_0xe1c9('0x2')](_0x81d97c,_0x448607);};}exports[_0xe1c9('0x3')]=function(_0x2cb2e0){for(var _0x3ad419=0x0,_0x1cded6=events[_0xe1c9('0x4')];_0x3ad419<_0x1cded6;_0x3ad419++){var _0x22ff31=events[_0x3ad419];var _0x4b33b3=createListener(_0xe1c9('0x5')+_0x22ff31,_0x2cb2e0);SquareProjectEvents['on'](_0x22ff31,_0x4b33b3);}}; \ No newline at end of file +var _0x0a8a=['removeListener','length','squareProject:','./squareProject.events','save','remove','update','emit'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x0a8a,0x11b));var _0xa0a8=function(_0x35ddf6,_0x3764af){_0x35ddf6=_0x35ddf6-0x0;var _0x303da0=_0x0a8a[_0x35ddf6];return _0x303da0;};'use strict';var SquareProjectEvents=require(_0xa0a8('0x0'));var events=[_0xa0a8('0x1'),_0xa0a8('0x2'),_0xa0a8('0x3')];function createListener(_0x5336b0,_0x122017){return function(_0x1d1614){_0x122017[_0xa0a8('0x4')](_0x5336b0,_0x1d1614);};}function removeListener(_0x5db9a1,_0x48d04a){return function(){SquareProjectEvents[_0xa0a8('0x5')](_0x5db9a1,_0x48d04a);};}exports['register']=function(_0x35d340){for(var _0x2dfd1f=0x0,_0x81f7a1=events[_0xa0a8('0x6')];_0x2dfd1f<_0x81f7a1;_0x2dfd1f++){var _0x3c20b7=events[_0x2dfd1f];var _0x45bb4b=createListener(_0xa0a8('0x7')+_0x3c20b7,_0x35d340);SquareProjectEvents['on'](_0x3c20b7,_0x45bb4b);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index c53f7ae..5c66b69 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 _0x4975=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','index','/:id','isAuthenticated','show','/:id/download','download','post','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x1bf988,_0x184ebd){var _0x337be9=function(_0x57f915){while(--_0x57f915){_0x1bf988['push'](_0x1bf988['shift']());}};_0x337be9(++_0x184ebd);}(_0x4975,0x86));var _0x5497=function(_0x4ddf2a,_0x11b12c){_0x4ddf2a=_0x4ddf2a-0x0;var _0x11734d=_0x4975[_0x4ddf2a];return _0x11734d;};'use strict';var multer=require(_0x5497('0x0'));var util=require('util');var path=require(_0x5497('0x1'));var timeout=require(_0x5497('0x2'));var express=require(_0x5497('0x3'));var router=express[_0x5497('0x4')]();var fs_extra=require(_0x5497('0x5'));var auth=require(_0x5497('0x6'));var interaction=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var controller=require(_0x5497('0x9'));router[_0x5497('0xa')]('/',auth['isAuthenticated'](),controller[_0x5497('0xb')]);router['get'](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0xe')]);router['get'](_0x5497('0xf'),auth['isAuthenticated'](),controller[_0x5497('0x10')]);router[_0x5497('0x11')]('/',auth[_0x5497('0xd')](),controller[_0x5497('0x12')]);router[_0x5497('0x13')](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5497('0x15')]);module[_0x5497('0x16')]=router; \ No newline at end of file +var _0xf494=['../../config/environment','./squareRecording.controller','get','isAuthenticated','index','show','/:id/download','download','post','create','/:id','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x8fb9df,_0x55f21f){var _0x4e07e3=function(_0x3e65cd){while(--_0x3e65cd){_0x8fb9df['push'](_0x8fb9df['shift']());}};_0x4e07e3(++_0x55f21f);}(_0xf494,0x1c6));var _0x4f49=function(_0xa252a3,_0x2b9c1a){_0xa252a3=_0xa252a3-0x0;var _0x1152f2=_0xf494[_0xa252a3];return _0x1152f2;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var fs_extra=require(_0x4f49('0x5'));var auth=require(_0x4f49('0x6'));var interaction=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var controller=require(_0x4f49('0x9'));router[_0x4f49('0xa')]('/',auth[_0x4f49('0xb')](),controller[_0x4f49('0xc')]);router[_0x4f49('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x4f49('0xd')]);router[_0x4f49('0xa')](_0x4f49('0xe'),auth[_0x4f49('0xb')](),controller[_0x4f49('0xf')]);router[_0x4f49('0x10')]('/',auth[_0x4f49('0xb')](),controller[_0x4f49('0x11')]);router['put'](_0x4f49('0x12'),auth[_0x4f49('0xb')](),controller['update']);router[_0x4f49('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x4f49('0x14')]);module[_0x4f49('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 56e8ef2..c8a3c97 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 _0xb4c7=['sequelize','exports','STRING','VIRTUAL','getDataValue','substring','lastIndexOf'];(function(_0x3973e8,_0x3c6a7f){var _0x2b7d95=function(_0x2e178c){while(--_0x2e178c){_0x3973e8['push'](_0x3973e8['shift']());}};_0x2b7d95(++_0x3c6a7f);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0xbca5e,_0x297eed){_0xbca5e=_0xbca5e-0x0;var _0x177989=_0xb4c7[_0xbca5e];return _0x177989;};'use strict';var Sequelize=require(_0x7b4c('0x0'));module[_0x7b4c('0x1')]={'uniqueid':{'type':Sequelize[_0x7b4c('0x2')]},'callerid':{'type':Sequelize[_0x7b4c('0x2')]},'calleridname':{'type':Sequelize[_0x7b4c('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x7b4c('0x2')]},'priority':{'type':Sequelize[_0x7b4c('0x2')]},'accountcode':{'type':Sequelize[_0x7b4c('0x2')]},'dnid':{'type':Sequelize[_0x7b4c('0x2')]},'projectName':{'type':Sequelize[_0x7b4c('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x7b4c('0x2')]},'savePath':{'type':Sequelize[_0x7b4c('0x2')]},'format':{'type':Sequelize[_0x7b4c('0x3')],'get':function(){var _0x4bf85d='';var _0x2d7b7e=this[_0x7b4c('0x4')]('savePath');if(_0x2d7b7e){_0x4bf85d=_0x2d7b7e[_0x7b4c('0x5')](_0x2d7b7e[_0x7b4c('0x6')]('.'));}return _0x4bf85d;}}}; \ No newline at end of file +var _0x6f47=['savePath','substring','lastIndexOf','exports','STRING','VIRTUAL','getDataValue'];(function(_0x14cc97,_0xe46fce){var _0xa32ea7=function(_0x363ada){while(--_0x363ada){_0x14cc97['push'](_0x14cc97['shift']());}};_0xa32ea7(++_0xe46fce);}(_0x6f47,0xc7));var _0x76f4=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x6f47[_0x2a6809];return _0x11c371;};'use strict';var Sequelize=require('sequelize');module[_0x76f4('0x0')]={'uniqueid':{'type':Sequelize[_0x76f4('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x76f4('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x76f4('0x1')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x76f4('0x1')]},'dnid':{'type':Sequelize[_0x76f4('0x1')]},'projectName':{'type':Sequelize[_0x76f4('0x1')]},'saveName':{'type':Sequelize[_0x76f4('0x1')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x76f4('0x1')]},'format':{'type':Sequelize[_0x76f4('0x2')],'get':function(){var _0x2176a7='';var _0x497f99=this[_0x76f4('0x3')](_0x76f4('0x4'));if(_0x497f99){_0x2176a7=_0x497f99[_0x76f4('0x5')](_0x497f99[_0x76f4('0x6')]('.'));}return _0x2176a7;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index ce0433b..8c8a3de 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 _0x9f7f=['destroy','then','end','sendStatus','error','name','send','index','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL','options','SquareRecording','include','findAll','catch','show','params','rawAttributes','includeAll','find','create','body','download','../../components/encryptor','uniqueid','savePath','filename','%s.cypher','secrets','recording','existsSync','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','Not\x20found','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','reject','update'];(function(_0x5aee95,_0x416dca){var _0x2ffac5=function(_0xb46a92){while(--_0xb46a92){_0x5aee95['push'](_0x5aee95['shift']());}};_0x2ffac5(++_0x416dca);}(_0x9f7f,0x15c));var _0xf9f7=function(_0x538627,_0x1c610e){_0x538627=_0x538627-0x0;var _0x148ce8=_0x9f7f[_0x538627];return _0x148ce8;};'use strict';var emlformat=require(_0xf9f7('0x0'));var rimraf=require(_0xf9f7('0x1'));var zipdir=require(_0xf9f7('0x2'));var jsonpatch=require(_0xf9f7('0x3'));var rp=require(_0xf9f7('0x4'));var moment=require(_0xf9f7('0x5'));var BPromise=require(_0xf9f7('0x6'));var Mustache=require('mustache');var util=require(_0xf9f7('0x7'));var path=require('path');var sox=require(_0xf9f7('0x8'));var csv=require(_0xf9f7('0x9'));var ejs=require(_0xf9f7('0xa'));var fs=require('fs');var fs_extra=require(_0xf9f7('0xb'));var _=require('lodash');var squel=require(_0xf9f7('0xc'));var crypto=require(_0xf9f7('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf9f7('0xe'));var toCsv=require(_0xf9f7('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf9f7('0xf'));var qs=require(_0xf9f7('0x10'));var as=require(_0xf9f7('0x11'));var hardwareService=require(_0xf9f7('0x12'));var logger=require('../../config/logger')(_0xf9f7('0x13'));var utils=require(_0xf9f7('0x14'));var config=require(_0xf9f7('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xf9f7('0x16'))['db'];function respondWithStatusCode(_0x21cede,_0x25eb15){_0x25eb15=_0x25eb15||0xcc;return function(_0x256c8d){if(_0x256c8d){return _0x21cede['sendStatus'](_0x25eb15);}return _0x21cede[_0xf9f7('0x17')](_0x25eb15)['end']();};}function respondWithResult(_0x2f87c6,_0x302673){_0x302673=_0x302673||0xc8;return function(_0x4d7aec){if(_0x4d7aec){return _0x2f87c6[_0xf9f7('0x17')](_0x302673)[_0xf9f7('0x18')](_0x4d7aec);}};}function respondWithFilteredResult(_0x268c1d,_0x32ca0d){return function(_0x1523d7){if(_0x1523d7){var _0xc562f4=typeof _0x32ca0d[_0xf9f7('0x19')]===_0xf9f7('0x1a')&&typeof _0x32ca0d[_0xf9f7('0x1b')]===_0xf9f7('0x1a');var _0x54af85=_0x1523d7[_0xf9f7('0x1c')];var _0x26b209=_0xc562f4?0x0:_0x32ca0d[_0xf9f7('0x19')];var _0x1f3b5e=_0xc562f4?_0x1523d7['count']:_0x32ca0d[_0xf9f7('0x19')]+_0x32ca0d[_0xf9f7('0x1b')];var _0x3c450b;if(_0x1f3b5e>=_0x54af85){_0x1f3b5e=_0x54af85;_0x3c450b=0xc8;}else{_0x3c450b=0xce;}_0x268c1d['status'](_0x3c450b);return _0x268c1d['set'](_0xf9f7('0x1d'),_0x26b209+'-'+_0x1f3b5e+'/'+_0x54af85)[_0xf9f7('0x18')](_0x1523d7);}return null;};}function patchUpdates(_0x58e332){return function(_0x93b3b4){try{jsonpatch['apply'](_0x93b3b4,_0x58e332,!![]);}catch(_0x21cdee){return BPromise[_0xf9f7('0x1e')](_0x21cdee);}return _0x93b3b4['save']();};}function saveUpdates(_0x43bbeb,_0x3de45d){return function(_0xf501b4){if(_0xf501b4){return _0xf501b4[_0xf9f7('0x1f')](_0x43bbeb)['then'](function(_0x103dd8){return _0x103dd8;});}return null;};}function removeEntity(_0x264290,_0x9c7a29){return function(_0xf61d4f){if(_0xf61d4f){return _0xf61d4f[_0xf9f7('0x20')]()[_0xf9f7('0x21')](function(){_0x264290[_0xf9f7('0x17')](0xcc)[_0xf9f7('0x22')]();});}};}function handleEntityNotFound(_0x3d2ded,_0x13139d){return function(_0x43ae7c){if(!_0x43ae7c){_0x3d2ded[_0xf9f7('0x23')](0x194);}return _0x43ae7c;};}function handleError(_0x1a9ef0,_0x1b3d45){_0x1b3d45=_0x1b3d45||0x1f4;return function(_0x577bca){logger[_0xf9f7('0x24')](_0x577bca['stack']);if(_0x577bca[_0xf9f7('0x25')]){delete _0x577bca[_0xf9f7('0x25')];}_0x1a9ef0[_0xf9f7('0x17')](_0x1b3d45)[_0xf9f7('0x26')](_0x577bca);};}exports[_0xf9f7('0x27')]=function(_0x1797cf,_0x498ee4){var _0x57ba7b={},_0x1c7d21={},_0x120857={'count':0x0,'rows':[]};var _0x48631b=_['map'](db['SquareRecording']['rawAttributes'],function(_0x18cdb6){return{'name':_0x18cdb6[_0xf9f7('0x28')],'type':_0x18cdb6[_0xf9f7('0x29')][_0xf9f7('0x2a')]};});_0x1c7d21[_0xf9f7('0x2b')]=_['map'](_0x48631b,_0xf9f7('0x25'));_0x1c7d21[_0xf9f7('0x2c')]=_[_0xf9f7('0x2d')](_0x1797cf['query']);_0x1c7d21[_0xf9f7('0x2e')]=_['intersection'](_0x1c7d21[_0xf9f7('0x2b')],_0x1c7d21['query']);_0x57ba7b[_0xf9f7('0x2f')]=_[_0xf9f7('0x30')](_0x1c7d21['model'],qs[_0xf9f7('0x31')](_0x1797cf[_0xf9f7('0x2c')][_0xf9f7('0x31')]));_0x57ba7b[_0xf9f7('0x2f')]=_0x57ba7b[_0xf9f7('0x2f')][_0xf9f7('0x32')]?_0x57ba7b[_0xf9f7('0x2f')]:_0x1c7d21[_0xf9f7('0x2b')];if(!_0x1797cf[_0xf9f7('0x2c')]['hasOwnProperty'](_0xf9f7('0x33'))){_0x57ba7b[_0xf9f7('0x1b')]=qs[_0xf9f7('0x1b')](_0x1797cf[_0xf9f7('0x2c')][_0xf9f7('0x1b')]);_0x57ba7b[_0xf9f7('0x19')]=qs['offset'](_0x1797cf[_0xf9f7('0x2c')][_0xf9f7('0x19')]);}_0x57ba7b[_0xf9f7('0x34')]=qs['sort'](_0x1797cf[_0xf9f7('0x2c')][_0xf9f7('0x35')]);_0x57ba7b['where']=qs['filters'](_[_0xf9f7('0x36')](_0x1797cf[_0xf9f7('0x2c')],_0x1c7d21['filters']),_0x48631b);if(_0x1797cf[_0xf9f7('0x2c')][_0xf9f7('0x37')]){_0x57ba7b[_0xf9f7('0x38')]=_[_0xf9f7('0x39')](_0x57ba7b['where'],{'$or':_[_0xf9f7('0x3a')](_0x48631b,function(_0x24baa6){if(_0x24baa6['type']!==_0xf9f7('0x3b')){var _0x44c03b={};_0x44c03b[_0x24baa6['name']]={'$like':'%'+_0x1797cf[_0xf9f7('0x2c')][_0xf9f7('0x37')]+'%'};return _0x44c03b;}})});}_0x57ba7b=_['merge']({},_0x57ba7b,_0x1797cf[_0xf9f7('0x3c')]);var _0x253b2c={'where':_0x57ba7b[_0xf9f7('0x38')]};return db[_0xf9f7('0x3d')][_0xf9f7('0x1c')](_0x253b2c)[_0xf9f7('0x21')](function(_0x409c34){_0x120857[_0xf9f7('0x1c')]=_0x409c34;if(_0x1797cf[_0xf9f7('0x2c')]['includeAll']){_0x57ba7b[_0xf9f7('0x3e')]=[{'all':!![]}];}return db['SquareRecording'][_0xf9f7('0x3f')](_0x57ba7b);})[_0xf9f7('0x21')](function(_0x451785){_0x120857['rows']=_0x451785;return _0x120857;})['then'](respondWithFilteredResult(_0x498ee4,_0x57ba7b))[_0xf9f7('0x40')](handleError(_0x498ee4,null));};exports[_0xf9f7('0x41')]=function(_0xaddf32,_0x1bf6bc){var _0x42d60a={'raw':!![],'where':{'id':_0xaddf32[_0xf9f7('0x42')]['id']}},_0x4e83d4={};_0x4e83d4['model']=_[_0xf9f7('0x2d')](db[_0xf9f7('0x3d')][_0xf9f7('0x43')]);_0x4e83d4['query']=_[_0xf9f7('0x2d')](_0xaddf32['query']);_0x4e83d4['filters']=_[_0xf9f7('0x30')](_0x4e83d4[_0xf9f7('0x2b')],_0x4e83d4[_0xf9f7('0x2c')]);_0x42d60a['attributes']=_[_0xf9f7('0x30')](_0x4e83d4[_0xf9f7('0x2b')],qs[_0xf9f7('0x31')](_0xaddf32['query'][_0xf9f7('0x31')]));_0x42d60a[_0xf9f7('0x2f')]=_0x42d60a['attributes'][_0xf9f7('0x32')]?_0x42d60a['attributes']:_0x4e83d4[_0xf9f7('0x2b')];if(_0xaddf32[_0xf9f7('0x2c')][_0xf9f7('0x44')]){_0x42d60a[_0xf9f7('0x3e')]=[{'all':!![]}];}_0x42d60a=_['merge']({},_0x42d60a,_0xaddf32[_0xf9f7('0x3c')]);return db['SquareRecording'][_0xf9f7('0x45')](_0x42d60a)['then'](handleEntityNotFound(_0x1bf6bc,null))['then'](respondWithResult(_0x1bf6bc,null))['catch'](handleError(_0x1bf6bc,null));};exports[_0xf9f7('0x46')]=function(_0x46299a,_0x35c425){return db[_0xf9f7('0x3d')]['create'](_0x46299a[_0xf9f7('0x47')],{})[_0xf9f7('0x21')](respondWithResult(_0x35c425,0xc9))[_0xf9f7('0x40')](handleError(_0x35c425,null));};exports[_0xf9f7('0x1f')]=function(_0x280f47,_0x42f344){if(_0x280f47[_0xf9f7('0x47')]['id']){delete _0x280f47[_0xf9f7('0x47')]['id'];}return db['SquareRecording'][_0xf9f7('0x45')]({'where':{'id':_0x280f47[_0xf9f7('0x42')]['id']}})[_0xf9f7('0x21')](handleEntityNotFound(_0x42f344,null))[_0xf9f7('0x21')](saveUpdates(_0x280f47[_0xf9f7('0x47')],null))[_0xf9f7('0x21')](respondWithResult(_0x42f344,null))[_0xf9f7('0x40')](handleError(_0x42f344,null));};exports[_0xf9f7('0x48')]=function(_0x52858e,_0x3d0fe0,_0x9a19c8){var _0x142f5d=require(_0xf9f7('0x49'));var _0x129588=![];var _0x390c41={};if(_0x52858e[_0xf9f7('0x2c')]['type']&&_0x52858e[_0xf9f7('0x2c')][_0xf9f7('0x29')]==='uniqueid'){_0x390c41[_0xf9f7('0x4a')]=_0x52858e['params']['id'];}else{_0x390c41['id']=_0x52858e['params']['id'];}return db[_0xf9f7('0x3d')]['find']({'where':_0x390c41,'attributes':['id',_0xf9f7('0x4b'),_0xf9f7('0x4c')],'raw':!![]})['then'](handleEntityNotFound(_0x3d0fe0,null))[_0xf9f7('0x21')](function(_0x3847f7){if(_0x3847f7){var _0x10705f=_0x3847f7[_0xf9f7('0x4b')];var _0x392e34=util['format'](_0xf9f7('0x4d'),_0x10705f);if(fs['existsSync'](_0x392e34)){_0x129588=!![];return _0x142f5d['decryptFile'](_0x392e34,_0x10705f,config[_0xf9f7('0x4e')][_0xf9f7('0x4f')])[_0xf9f7('0x21')](function(){return _0x3847f7;});}return _0x3847f7;}})[_0xf9f7('0x21')](function(_0x3715b6){if(_0x3715b6){var _0x36cf7a=_0x3715b6[_0xf9f7('0x4b')];if(!fs[_0xf9f7('0x50')](_0x36cf7a)){throw new db[(_0xf9f7('0x51'))][(_0xf9f7('0x52'))](_0xf9f7('0x53'));}if(_0x3715b6[_0xf9f7('0x4c')]){return _0x3d0fe0[_0xf9f7('0x48')](_0x36cf7a,_0x3715b6['filename']+path[_0xf9f7('0x54')](_0x36cf7a),function(){if(_0x129588){fs[_0xf9f7('0x55')](_0x36cf7a);}});}else{return _0x3d0fe0[_0xf9f7('0x48')](_0x36cf7a,function(_0x50f977){if(_0x129588){fs[_0xf9f7('0x55')](_0x36cf7a);}});}}})[_0xf9f7('0x40')](function(_0x3749ec){if(_0x3749ec[_0xf9f7('0x56')]==='SquareRecording\x20not\x20found'){_0x3d0fe0['status'](0x194)[_0xf9f7('0x26')](_0xf9f7('0x57'));}else{return handleError(_0x3d0fe0,null);}});};exports[_0xf9f7('0x20')]=function(_0x585483,_0x2017a5){return db['SquareRecording'][_0xf9f7('0x45')]({'where':{'id':_0x585483[_0xf9f7('0x42')]['id']}})[_0xf9f7('0x21')](function(_0x3e66f2){if(_['isNil'](_0x3e66f2)){throw new ReferenceError(_0xf9f7('0x58'));}return _0x3e66f2;})[_0xf9f7('0x21')](function(_0x552a3f){var _0x5df067=_0x552a3f[_0xf9f7('0x4b')];logger['info'](_0xf9f7('0x59'),_0x5df067);if(!_[_0xf9f7('0x5a')](_0x552a3f[_0xf9f7('0x4b')])&&fs['existsSync'](_0x5df067)){logger[_0xf9f7('0x5b')](_0xf9f7('0x5c')+_0x5df067+_0xf9f7('0x5d'));fs[_0xf9f7('0x5e')](_0x5df067);}_0x5df067=_0x5df067+'.cypher';if(!_['isNil'](_0x552a3f[_0xf9f7('0x4b')])&&fs[_0xf9f7('0x50')](_0x5df067)){logger[_0xf9f7('0x5b')](_0xf9f7('0x5c')+_0x5df067+_0xf9f7('0x5d'));fs[_0xf9f7('0x5e')](_0x5df067);}return _0x552a3f;})['then'](function(_0x2e410b){if(!_0x2e410b)throw new InternalError();return _0x2e410b[_0xf9f7('0x20')]();})['then'](function(){_0x2017a5[_0xf9f7('0x17')](0xcc)[_0xf9f7('0x22')]();})[_0xf9f7('0x40')](handleError(_0x2017a5,null));}; \ No newline at end of file +var _0x5dd3=['limit','undefined','count','set','apply','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','where','filter','merge','options','SquareRecording','include','findAll','rows','catch','show','params','includeAll','create','body','download','find','filename','format','%s.cypher','existsSync','decryptFile','secrets','savePath','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','Not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x59f72e,_0x496111){var _0x28abe5=function(_0x246c49){while(--_0x246c49){_0x59f72e['push'](_0x59f72e['shift']());}};_0x28abe5(++_0x496111);}(_0x5dd3,0x9d));var _0x35dd=function(_0x3bfe1e,_0x4caabe){_0x3bfe1e=_0x3bfe1e-0x0;var _0x4ea26d=_0x5dd3[_0x3bfe1e];return _0x4ea26d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x35dd('0x0'));var zipdir=require(_0x35dd('0x1'));var jsonpatch=require(_0x35dd('0x2'));var rp=require(_0x35dd('0x3'));var moment=require(_0x35dd('0x4'));var BPromise=require(_0x35dd('0x5'));var Mustache=require(_0x35dd('0x6'));var util=require('util');var path=require(_0x35dd('0x7'));var sox=require(_0x35dd('0x8'));var csv=require('to-csv');var ejs=require(_0x35dd('0x9'));var fs=require('fs');var fs_extra=require(_0x35dd('0xa'));var _=require(_0x35dd('0xb'));var squel=require(_0x35dd('0xc'));var crypto=require(_0x35dd('0xd'));var jsforce=require(_0x35dd('0xe'));var deskjs=require(_0x35dd('0xf'));var toCsv=require('to-csv');var querystring=require(_0x35dd('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x35dd('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x35dd('0x12'));var logger=require('../../config/logger')(_0x35dd('0x13'));var utils=require(_0x35dd('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x35dd('0x15'))['db'];function respondWithStatusCode(_0x4534b7,_0x3005b1){_0x3005b1=_0x3005b1||0xcc;return function(_0x5c3b9d){if(_0x5c3b9d){return _0x4534b7[_0x35dd('0x16')](_0x3005b1);}return _0x4534b7[_0x35dd('0x17')](_0x3005b1)[_0x35dd('0x18')]();};}function respondWithResult(_0xeeba33,_0x124b67){_0x124b67=_0x124b67||0xc8;return function(_0x2bba22){if(_0x2bba22){return _0xeeba33[_0x35dd('0x17')](_0x124b67)[_0x35dd('0x19')](_0x2bba22);}};}function respondWithFilteredResult(_0x305146,_0x2e6c35){return function(_0x4d16f7){if(_0x4d16f7){var _0x142425=typeof _0x2e6c35[_0x35dd('0x1a')]==='undefined'&&typeof _0x2e6c35[_0x35dd('0x1b')]===_0x35dd('0x1c');var _0x108e54=_0x4d16f7[_0x35dd('0x1d')];var _0x130bf1=_0x142425?0x0:_0x2e6c35[_0x35dd('0x1a')];var _0x1fc289=_0x142425?_0x4d16f7[_0x35dd('0x1d')]:_0x2e6c35['offset']+_0x2e6c35[_0x35dd('0x1b')];var _0x22c3b7;if(_0x1fc289>=_0x108e54){_0x1fc289=_0x108e54;_0x22c3b7=0xc8;}else{_0x22c3b7=0xce;}_0x305146[_0x35dd('0x17')](_0x22c3b7);return _0x305146[_0x35dd('0x1e')]('Content-Range',_0x130bf1+'-'+_0x1fc289+'/'+_0x108e54)[_0x35dd('0x19')](_0x4d16f7);}return null;};}function patchUpdates(_0x245e88){return function(_0x55949b){try{jsonpatch[_0x35dd('0x1f')](_0x55949b,_0x245e88,!![]);}catch(_0x26197a){return BPromise['reject'](_0x26197a);}return _0x55949b[_0x35dd('0x20')]();};}function saveUpdates(_0x318cbc,_0x35ddec){return function(_0x2ccd55){if(_0x2ccd55){return _0x2ccd55[_0x35dd('0x21')](_0x318cbc)['then'](function(_0x4aece9){return _0x4aece9;});}return null;};}function removeEntity(_0x2a916c,_0x5db30d){return function(_0x1abaa3){if(_0x1abaa3){return _0x1abaa3[_0x35dd('0x22')]()[_0x35dd('0x23')](function(){_0x2a916c[_0x35dd('0x17')](0xcc)[_0x35dd('0x18')]();});}};}function handleEntityNotFound(_0x1e6840,_0x168417){return function(_0x2baf14){if(!_0x2baf14){_0x1e6840[_0x35dd('0x16')](0x194);}return _0x2baf14;};}function handleError(_0x5227c7,_0x262c64){_0x262c64=_0x262c64||0x1f4;return function(_0x36f3d6){logger[_0x35dd('0x24')](_0x36f3d6[_0x35dd('0x25')]);if(_0x36f3d6[_0x35dd('0x26')]){delete _0x36f3d6['name'];}_0x5227c7[_0x35dd('0x17')](_0x262c64)[_0x35dd('0x27')](_0x36f3d6);};}exports[_0x35dd('0x28')]=function(_0x5bfe7f,_0x1e7b10){var _0x4dc8e7={},_0x15270c={},_0x43bc23={'count':0x0,'rows':[]};var _0x5e8b54=_[_0x35dd('0x29')](db['SquareRecording'][_0x35dd('0x2a')],function(_0x285806){return{'name':_0x285806[_0x35dd('0x2b')],'type':_0x285806[_0x35dd('0x2c')][_0x35dd('0x2d')]};});_0x15270c[_0x35dd('0x2e')]=_['map'](_0x5e8b54,_0x35dd('0x26'));_0x15270c['query']=_[_0x35dd('0x2f')](_0x5bfe7f[_0x35dd('0x30')]);_0x15270c[_0x35dd('0x31')]=_[_0x35dd('0x32')](_0x15270c[_0x35dd('0x2e')],_0x15270c[_0x35dd('0x30')]);_0x4dc8e7['attributes']=_[_0x35dd('0x32')](_0x15270c[_0x35dd('0x2e')],qs[_0x35dd('0x33')](_0x5bfe7f[_0x35dd('0x30')][_0x35dd('0x33')]));_0x4dc8e7[_0x35dd('0x34')]=_0x4dc8e7[_0x35dd('0x34')][_0x35dd('0x35')]?_0x4dc8e7[_0x35dd('0x34')]:_0x15270c[_0x35dd('0x2e')];if(!_0x5bfe7f[_0x35dd('0x30')]['hasOwnProperty'](_0x35dd('0x36'))){_0x4dc8e7['limit']=qs['limit'](_0x5bfe7f['query'][_0x35dd('0x1b')]);_0x4dc8e7[_0x35dd('0x1a')]=qs['offset'](_0x5bfe7f[_0x35dd('0x30')][_0x35dd('0x1a')]);}_0x4dc8e7[_0x35dd('0x37')]=qs['sort'](_0x5bfe7f[_0x35dd('0x30')]['sort']);_0x4dc8e7[_0x35dd('0x38')]=qs[_0x35dd('0x31')](_['pick'](_0x5bfe7f['query'],_0x15270c[_0x35dd('0x31')]),_0x5e8b54);if(_0x5bfe7f[_0x35dd('0x30')][_0x35dd('0x39')]){_0x4dc8e7[_0x35dd('0x38')]=_[_0x35dd('0x3a')](_0x4dc8e7[_0x35dd('0x38')],{'$or':_[_0x35dd('0x29')](_0x5e8b54,function(_0x21f7df){if(_0x21f7df['type']!=='VIRTUAL'){var _0xb95bca={};_0xb95bca[_0x21f7df['name']]={'$like':'%'+_0x5bfe7f[_0x35dd('0x30')][_0x35dd('0x39')]+'%'};return _0xb95bca;}})});}_0x4dc8e7=_[_0x35dd('0x3a')]({},_0x4dc8e7,_0x5bfe7f[_0x35dd('0x3b')]);var _0x4c4373={'where':_0x4dc8e7[_0x35dd('0x38')]};return db[_0x35dd('0x3c')][_0x35dd('0x1d')](_0x4c4373)[_0x35dd('0x23')](function(_0x5adb4e){_0x43bc23[_0x35dd('0x1d')]=_0x5adb4e;if(_0x5bfe7f[_0x35dd('0x30')]['includeAll']){_0x4dc8e7[_0x35dd('0x3d')]=[{'all':!![]}];}return db[_0x35dd('0x3c')][_0x35dd('0x3e')](_0x4dc8e7);})[_0x35dd('0x23')](function(_0x332078){_0x43bc23[_0x35dd('0x3f')]=_0x332078;return _0x43bc23;})[_0x35dd('0x23')](respondWithFilteredResult(_0x1e7b10,_0x4dc8e7))[_0x35dd('0x40')](handleError(_0x1e7b10,null));};exports[_0x35dd('0x41')]=function(_0x52ae54,_0x4380e1){var _0x5cbb3b={'raw':!![],'where':{'id':_0x52ae54[_0x35dd('0x42')]['id']}},_0x11baea={};_0x11baea['model']=_[_0x35dd('0x2f')](db[_0x35dd('0x3c')][_0x35dd('0x2a')]);_0x11baea[_0x35dd('0x30')]=_[_0x35dd('0x2f')](_0x52ae54[_0x35dd('0x30')]);_0x11baea[_0x35dd('0x31')]=_[_0x35dd('0x32')](_0x11baea[_0x35dd('0x2e')],_0x11baea[_0x35dd('0x30')]);_0x5cbb3b[_0x35dd('0x34')]=_['intersection'](_0x11baea[_0x35dd('0x2e')],qs[_0x35dd('0x33')](_0x52ae54['query'][_0x35dd('0x33')]));_0x5cbb3b[_0x35dd('0x34')]=_0x5cbb3b['attributes']['length']?_0x5cbb3b['attributes']:_0x11baea[_0x35dd('0x2e')];if(_0x52ae54[_0x35dd('0x30')][_0x35dd('0x43')]){_0x5cbb3b[_0x35dd('0x3d')]=[{'all':!![]}];}_0x5cbb3b=_[_0x35dd('0x3a')]({},_0x5cbb3b,_0x52ae54[_0x35dd('0x3b')]);return db[_0x35dd('0x3c')]['find'](_0x5cbb3b)[_0x35dd('0x23')](handleEntityNotFound(_0x4380e1,null))[_0x35dd('0x23')](respondWithResult(_0x4380e1,null))[_0x35dd('0x40')](handleError(_0x4380e1,null));};exports[_0x35dd('0x44')]=function(_0x2f1250,_0x33c8d9){return db[_0x35dd('0x3c')][_0x35dd('0x44')](_0x2f1250['body'],{})[_0x35dd('0x23')](respondWithResult(_0x33c8d9,0xc9))['catch'](handleError(_0x33c8d9,null));};exports[_0x35dd('0x21')]=function(_0x481cc1,_0x251934){if(_0x481cc1['body']['id']){delete _0x481cc1[_0x35dd('0x45')]['id'];}return db[_0x35dd('0x3c')]['find']({'where':{'id':_0x481cc1[_0x35dd('0x42')]['id']}})[_0x35dd('0x23')](handleEntityNotFound(_0x251934,null))['then'](saveUpdates(_0x481cc1[_0x35dd('0x45')],null))[_0x35dd('0x23')](respondWithResult(_0x251934,null))['catch'](handleError(_0x251934,null));};exports[_0x35dd('0x46')]=function(_0x5cd934,_0xe2bf5d,_0x1d24a6){var _0x4e7ef3=require('../../components/encryptor');var _0x53c596=![];var _0x3322e2={};if(_0x5cd934['query'][_0x35dd('0x2c')]&&_0x5cd934['query'][_0x35dd('0x2c')]==='uniqueid'){_0x3322e2['uniqueid']=_0x5cd934['params']['id'];}else{_0x3322e2['id']=_0x5cd934['params']['id'];}return db[_0x35dd('0x3c')][_0x35dd('0x47')]({'where':_0x3322e2,'attributes':['id','savePath',_0x35dd('0x48')],'raw':!![]})[_0x35dd('0x23')](handleEntityNotFound(_0xe2bf5d,null))[_0x35dd('0x23')](function(_0x3016bb){if(_0x3016bb){var _0x451875=_0x3016bb['savePath'];var _0x3b02c7=util[_0x35dd('0x49')](_0x35dd('0x4a'),_0x451875);if(fs[_0x35dd('0x4b')](_0x3b02c7)){_0x53c596=!![];return _0x4e7ef3[_0x35dd('0x4c')](_0x3b02c7,_0x451875,config[_0x35dd('0x4d')]['recording'])['then'](function(){return _0x3016bb;});}return _0x3016bb;}})[_0x35dd('0x23')](function(_0x52d1af){if(_0x52d1af){var _0x5890a6=_0x52d1af[_0x35dd('0x4e')];if(!fs['existsSync'](_0x5890a6)){throw new db[(_0x35dd('0x4f'))][(_0x35dd('0x50'))](_0x35dd('0x51'));}if(_0x52d1af[_0x35dd('0x48')]){return _0xe2bf5d[_0x35dd('0x46')](_0x5890a6,_0x52d1af[_0x35dd('0x48')]+path[_0x35dd('0x52')](_0x5890a6),function(){if(_0x53c596){fs[_0x35dd('0x53')](_0x5890a6);}});}else{return _0xe2bf5d[_0x35dd('0x46')](_0x5890a6,function(_0x3f9549){if(_0x53c596){fs['unlink'](_0x5890a6);}});}}})[_0x35dd('0x40')](function(_0x456b44){if(_0x456b44[_0x35dd('0x54')]===_0x35dd('0x51')){_0xe2bf5d['status'](0x194)[_0x35dd('0x27')](_0x35dd('0x55'));}else{return handleError(_0xe2bf5d,null);}});};exports['destroy']=function(_0x12d080,_0x4a9d53){return db[_0x35dd('0x3c')][_0x35dd('0x47')]({'where':{'id':_0x12d080[_0x35dd('0x42')]['id']}})[_0x35dd('0x23')](function(_0x4071fb){if(_[_0x35dd('0x56')](_0x4071fb)){throw new ReferenceError('Entity\x20not\x20found');}return _0x4071fb;})['then'](function(_0x251611){var _0x58dc15=_0x251611['savePath'];logger[_0x35dd('0x57')](_0x35dd('0x58'),_0x58dc15);if(!_[_0x35dd('0x56')](_0x251611[_0x35dd('0x4e')])&&fs[_0x35dd('0x4b')](_0x58dc15)){logger[_0x35dd('0x57')](_0x35dd('0x59')+_0x58dc15+_0x35dd('0x5a'));fs['unlinkSync'](_0x58dc15);}_0x58dc15=_0x58dc15+_0x35dd('0x5b');if(!_[_0x35dd('0x56')](_0x251611[_0x35dd('0x4e')])&&fs[_0x35dd('0x4b')](_0x58dc15)){logger[_0x35dd('0x57')](_0x35dd('0x59')+_0x58dc15+_0x35dd('0x5a'));fs['unlinkSync'](_0x58dc15);}return _0x251611;})[_0x35dd('0x23')](function(_0x22ec6e){if(!_0x22ec6e)throw new InternalError();return _0x22ec6e[_0x35dd('0x22')]();})['then'](function(){_0x4a9d53[_0x35dd('0x17')](0xcc)[_0x35dd('0x18')]();})[_0x35dd('0x40')](handleError(_0x4a9d53,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index abc7412..fc5b773 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 _0x5b47=['lodash','util','path','rimraf','../../config/environment','./squareRecording.attributes','exports','SquareRecording'];(function(_0x471af5,_0x1e4fa3){var _0x5a3394=function(_0x143fc3){while(--_0x143fc3){_0x471af5['push'](_0x471af5['shift']());}};_0x5a3394(++_0x1e4fa3);}(_0x5b47,0x120));var _0x75b4=function(_0xd5167c,_0x46ecaa){_0xd5167c=_0xd5167c-0x0;var _0x1b7b6c=_0x5b47[_0xd5167c];return _0x1b7b6c;};'use strict';var _=require(_0x75b4('0x0'));var util=require(_0x75b4('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x75b4('0x2'));var rimraf=require(_0x75b4('0x3'));var config=require(_0x75b4('0x4'));var attributes=require(_0x75b4('0x5'));module[_0x75b4('0x6')]=function(_0x5f544a,_0x5ee223){return _0x5f544a['define'](_0x75b4('0x7'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf2e3=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','define','SquareRecording','square_recordings','lodash'];(function(_0x3f0f27,_0x25d348){var _0x307471=function(_0x4037c1){while(--_0x4037c1){_0x3f0f27['push'](_0x3f0f27['shift']());}};_0x307471(++_0x25d348);}(_0xf2e3,0x9b));var _0x3f2e=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0xf2e3[_0x172747];return _0x509692;};'use strict';var _=require(_0x3f2e('0x0'));var util=require('util');var logger=require(_0x3f2e('0x1'))(_0x3f2e('0x2'));var moment=require(_0x3f2e('0x3'));var BPromise=require(_0x3f2e('0x4'));var rp=require(_0x3f2e('0x5'));var fs=require('fs');var path=require(_0x3f2e('0x6'));var rimraf=require(_0x3f2e('0x7'));var config=require(_0x3f2e('0x8'));var attributes=require(_0x3f2e('0x9'));module['exports']=function(_0x33a3b7,_0xdd6b3e){return _0x33a3b7[_0x3f2e('0xa')](_0x3f2e('0xb'),attributes,{'tableName':_0x3f2e('0xc'),'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 69d8a65..9473666 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 _0x206f=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','error','message','SquareRecording,\x20%s,\x20%s','result','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','util','moment','bluebird','ioredis'];(function(_0x4fa166,_0x58b7fb){var _0x5dd974=function(_0x342886){while(--_0x342886){_0x4fa166['push'](_0x4fa166['shift']());}};_0x5dd974(++_0x58b7fb);}(_0x206f,0x1c7));var _0xf206=function(_0x2dfe6c,_0x255709){_0x2dfe6c=_0x2dfe6c-0x0;var _0x52cb46=_0x206f[_0x2dfe6c];return _0x52cb46;};'use strict';var _=require('lodash');var util=require(_0xf206('0x0'));var moment=require(_0xf206('0x1'));var BPromise=require(_0xf206('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf206('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf206('0x4'));var logger=require(_0xf206('0x5'))(_0xf206('0x6'));var config=require(_0xf206('0x7'));var jayson=require(_0xf206('0x8'));var client=jayson[_0xf206('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3cce1f,_0x1e14a7,_0x2549d7){return new BPromise(function(_0x16ed5f,_0x55ddec){return client[_0xf206('0xa')](_0x3cce1f,_0x2549d7)[_0xf206('0xb')](function(_0x3d3af3){logger[_0xf206('0xc')]('SquareRecording,\x20%s,\x20%s',_0x1e14a7,_0xf206('0xd'));logger[_0xf206('0xe')](_0xf206('0xf'),_0x1e14a7,_0xf206('0xd'),JSON['stringify'](_0x3d3af3));if(_0x3d3af3[_0xf206('0x10')]){if(_0x3d3af3[_0xf206('0x10')]['code']===0x1f4){logger[_0xf206('0x10')]('SquareRecording,\x20%s,\x20%s',_0x1e14a7,_0x3d3af3['error'][_0xf206('0x11')]);return _0x55ddec(_0x3d3af3[_0xf206('0x10')]['message']);}logger[_0xf206('0x10')](_0xf206('0x12'),_0x1e14a7,_0x3d3af3[_0xf206('0x10')][_0xf206('0x11')]);return _0x16ed5f(_0x3d3af3[_0xf206('0x10')][_0xf206('0x11')]);}else{logger['info'](_0xf206('0x12'),_0x1e14a7,_0xf206('0xd'));_0x16ed5f(_0x3d3af3[_0xf206('0x13')][_0xf206('0x11')]);}})[_0xf206('0x14')](function(_0x20c42d){logger[_0xf206('0x10')](_0xf206('0x12'),_0x1e14a7,_0x20c42d);_0x55ddec(_0x20c42d);});});}exports[_0xf206('0x15')]=function(_0x218ab8){var _0x564596=this;return new Promise(function(_0x3c4bd5,_0x216874){return db[_0xf206('0x16')][_0xf206('0x17')](_0x218ab8[_0xf206('0x18')],{'raw':_0x218ab8[_0xf206('0x19')]?_0x218ab8[_0xf206('0x19')][_0xf206('0x1a')]===undefined?!![]:![]:!![]})[_0xf206('0xb')](function(_0x5787a8){logger[_0xf206('0xc')]('CreateSquareRecording',_0x218ab8);logger[_0xf206('0xe')](_0xf206('0x15'),_0x218ab8,JSON['stringify'](_0x5787a8));_0x3c4bd5(_0x5787a8);})[_0xf206('0x14')](function(_0x5d83a8){logger['error'](_0xf206('0x15'),_0x5d83a8['message'],_0x218ab8);_0x216874(_0x564596[_0xf206('0x10')](0x1f4,_0x5d83a8[_0xf206('0x11')]));});});}; \ No newline at end of file +var _0x48ac=['message','catch','SquareRecording','create','body','options','raw','CreateSquareRecording','stringify','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SquareRecording,\x20%s,\x20%s','debug','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x48ac,0x1ad));var _0xc48a=function(_0x278763,_0x2d06b2){_0x278763=_0x278763-0x0;var _0x4d6a31=_0x48ac[_0x278763];return _0x4d6a31;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc48a('0x0'));var BPromise=require(_0xc48a('0x1'));var rs=require(_0xc48a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc48a('0x3'))['db'];var utils=require(_0xc48a('0x4'));var logger=require(_0xc48a('0x5'))(_0xc48a('0x6'));var config=require(_0xc48a('0x7'));var jayson=require(_0xc48a('0x8'));var client=jayson['client'][_0xc48a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f3ffd,_0x255ca4,_0x5d5356){return new BPromise(function(_0x4f26e8,_0x4a02a8){return client[_0xc48a('0xa')](_0x4f3ffd,_0x5d5356)[_0xc48a('0xb')](function(_0x463b65){logger[_0xc48a('0xc')](_0xc48a('0xd'),_0x255ca4,'request\x20sent');logger[_0xc48a('0xe')](_0xc48a('0xf'),_0x255ca4,_0xc48a('0x10'),JSON['stringify'](_0x463b65));if(_0x463b65['error']){if(_0x463b65[_0xc48a('0x11')][_0xc48a('0x12')]===0x1f4){logger[_0xc48a('0x11')](_0xc48a('0xd'),_0x255ca4,_0x463b65[_0xc48a('0x11')][_0xc48a('0x13')]);return _0x4a02a8(_0x463b65[_0xc48a('0x11')][_0xc48a('0x13')]);}logger[_0xc48a('0x11')]('SquareRecording,\x20%s,\x20%s',_0x255ca4,_0x463b65[_0xc48a('0x11')][_0xc48a('0x13')]);return _0x4f26e8(_0x463b65[_0xc48a('0x11')][_0xc48a('0x13')]);}else{logger[_0xc48a('0xc')](_0xc48a('0xd'),_0x255ca4,_0xc48a('0x10'));_0x4f26e8(_0x463b65['result']['message']);}})[_0xc48a('0x14')](function(_0x582965){logger['error'](_0xc48a('0xd'),_0x255ca4,_0x582965);_0x4a02a8(_0x582965);});});}exports['CreateSquareRecording']=function(_0x26c890){var _0x37d731=this;return new Promise(function(_0x39f070,_0x4f6c3a){return db[_0xc48a('0x15')][_0xc48a('0x16')](_0x26c890[_0xc48a('0x17')],{'raw':_0x26c890[_0xc48a('0x18')]?_0x26c890['options'][_0xc48a('0x19')]===undefined?!![]:![]:!![]})[_0xc48a('0xb')](function(_0x47397a){logger[_0xc48a('0xc')](_0xc48a('0x1a'),_0x26c890);logger[_0xc48a('0xe')](_0xc48a('0x1a'),_0x26c890,JSON[_0xc48a('0x1b')](_0x47397a));_0x39f070(_0x47397a);})['catch'](function(_0x22e9df){logger[_0xc48a('0x11')](_0xc48a('0x1a'),_0x22e9df[_0xc48a('0x13')],_0x26c890);_0x4f6c3a(_0x37d731[_0xc48a('0x11')](0x1f4,_0x22e9df[_0xc48a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index e006c72..91f6736 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(_0xa0a702,_0x2fb231){var _0x41f4d7=function(_0x5c9af5){while(--_0x5c9af5){_0xa0a702['push'](_0xa0a702['shift']());}};_0x41f4d7(++_0x2fb231);}(_0xe706,0xa3));var _0x6e70=function(_0x52a592,_0x2926b4){_0x52a592=_0x52a592-0x0;var _0x511e55=_0xe706[_0x52a592];return _0x511e55;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file +var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x4a0808,_0xf1f534){var _0x1271e2=function(_0x8e44bf){while(--_0x8e44bf){_0x4a0808['push'](_0x4a0808['shift']());}};_0x1271e2(++_0xf1f534);}(_0xe706,0xa3));var _0x6e70=function(_0x522ea3,_0x2384bd){_0x522ea3=_0x522ea3-0x0;var _0x4eb4cb=_0xe706[_0x522ea3];return _0x4eb4cb;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 35098aa..90178cd 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 _0x2061=['STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x15cbce,_0xda8402){var _0x257f29=function(_0x388132){while(--_0x388132){_0x15cbce['push'](_0x15cbce['shift']());}};_0x257f29(++_0xda8402);}(_0x2061,0x148));var _0x1206=function(_0x942830,_0x2982eb){_0x942830=_0x942830-0x0;var _0x301730=_0x2061[_0x942830];return _0x301730;};'use strict';var Sequelize=require(_0x1206('0x0'));module[_0x1206('0x1')]={'network':{'type':Sequelize[_0x1206('0x2')]},'network_script':{'type':Sequelize[_0x1206('0x2')]},'request':{'type':Sequelize[_0x1206('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x1206('0x2')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x1206('0x2')]},'version':{'type':Sequelize[_0x1206('0x2')]},'callerid':{'type':Sequelize[_0x1206('0x2')]},'calleridname':{'type':Sequelize[_0x1206('0x2')]},'callingpres':{'type':Sequelize[_0x1206('0x2')]},'callingani2':{'type':Sequelize[_0x1206('0x2')]},'callington':{'type':Sequelize[_0x1206('0x2')]},'callingtns':{'type':Sequelize[_0x1206('0x2')]},'dnid':{'type':Sequelize[_0x1206('0x2')]},'rdnis':{'type':Sequelize[_0x1206('0x2')]},'context':{'type':Sequelize[_0x1206('0x2')]},'extension':{'type':Sequelize[_0x1206('0x2')]},'priority':{'type':Sequelize[_0x1206('0x2')]},'enhanced':{'type':Sequelize[_0x1206('0x2')]},'accountcode':{'type':Sequelize[_0x1206('0x2')]},'threadid':{'type':Sequelize[_0x1206('0x2')]},'project_name':{'type':Sequelize[_0x1206('0x2')]},'joinAt':{'type':Sequelize[_0x1206('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x1206('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xf3bf=['sequelize','STRING','DATE'];(function(_0x3f497f,_0x14c09f){var _0x41c840=function(_0x5a210b){while(--_0x5a210b){_0x3f497f['push'](_0x3f497f['shift']());}};_0x41c840(++_0x14c09f);}(_0xf3bf,0x108));var _0xff3b=function(_0x16bbff,_0xe0d1a3){_0x16bbff=_0x16bbff-0x0;var _0x2dc939=_0xf3bf[_0x16bbff];return _0x2dc939;};'use strict';var Sequelize=require(_0xff3b('0x0'));module['exports']={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0xff3b('0x1')]},'request':{'type':Sequelize[_0xff3b('0x1')]},'channel':{'type':Sequelize[_0xff3b('0x1')]},'language':{'type':Sequelize[_0xff3b('0x1')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xff3b('0x1')]},'version':{'type':Sequelize[_0xff3b('0x1')]},'callerid':{'type':Sequelize[_0xff3b('0x1')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0xff3b('0x1')]},'callingani2':{'type':Sequelize[_0xff3b('0x1')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0xff3b('0x1')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xff3b('0x1')]},'extension':{'type':Sequelize[_0xff3b('0x1')]},'priority':{'type':Sequelize[_0xff3b('0x1')]},'enhanced':{'type':Sequelize[_0xff3b('0x1')]},'accountcode':{'type':Sequelize[_0xff3b('0x1')]},'threadid':{'type':Sequelize[_0xff3b('0x1')]},'project_name':{'type':Sequelize[_0xff3b('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xff3b('0x2')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index fdbe9fa..89b8758 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 _0xe11b=['offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','sendStatus','error','stack','name','send','index','SquareReport','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','find','create','body','params','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../mysqldb','status'];(function(_0x570c8a,_0x4a11cc){var _0x25dc12=function(_0x4585d9){while(--_0x4585d9){_0x570c8a['push'](_0x570c8a['shift']());}};_0x25dc12(++_0x4a11cc);}(_0xe11b,0x168));var _0xbe11=function(_0x204ddd,_0x31c49a){_0x204ddd=_0x204ddd-0x0;var _0x5adaee=_0xe11b[_0x204ddd];return _0x5adaee;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbe11('0x0'));var zipdir=require(_0xbe11('0x1'));var jsonpatch=require(_0xbe11('0x2'));var rp=require(_0xbe11('0x3'));var moment=require(_0xbe11('0x4'));var BPromise=require(_0xbe11('0x5'));var Mustache=require(_0xbe11('0x6'));var util=require(_0xbe11('0x7'));var path=require(_0xbe11('0x8'));var sox=require('sox');var csv=require(_0xbe11('0x9'));var ejs=require(_0xbe11('0xa'));var fs=require('fs');var fs_extra=require(_0xbe11('0xb'));var _=require(_0xbe11('0xc'));var squel=require(_0xbe11('0xd'));var crypto=require(_0xbe11('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xbe11('0xf'));var toCsv=require(_0xbe11('0x9'));var querystring=require(_0xbe11('0x10'));var Papa=require(_0xbe11('0x11'));var Redis=require(_0xbe11('0x12'));var authService=require(_0xbe11('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbe11('0x14'))(_0xbe11('0x15'));var utils=require(_0xbe11('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xbe11('0x17'))['db'];function respondWithStatusCode(_0x549190,_0x4dd00d){_0x4dd00d=_0x4dd00d||0xcc;return function(_0x2c861e){if(_0x2c861e){return _0x549190['sendStatus'](_0x4dd00d);}return _0x549190[_0xbe11('0x18')](_0x4dd00d)['end']();};}function respondWithResult(_0x58b9c7,_0x2a17cd){_0x2a17cd=_0x2a17cd||0xc8;return function(_0x5d011c){if(_0x5d011c){return _0x58b9c7[_0xbe11('0x18')](_0x2a17cd)['json'](_0x5d011c);}};}function respondWithFilteredResult(_0x1d08b4,_0x3d43cd){return function(_0x4cefd4){if(_0x4cefd4){var _0x3265f2=typeof _0x3d43cd[_0xbe11('0x19')]===_0xbe11('0x1a')&&typeof _0x3d43cd[_0xbe11('0x1b')]==='undefined';var _0xab26e4=_0x4cefd4[_0xbe11('0x1c')];var _0x3a24ef=_0x3265f2?0x0:_0x3d43cd[_0xbe11('0x19')];var _0x4b36ba=_0x3265f2?_0x4cefd4[_0xbe11('0x1c')]:_0x3d43cd['offset']+_0x3d43cd['limit'];var _0x1d2917;if(_0x4b36ba>=_0xab26e4){_0x4b36ba=_0xab26e4;_0x1d2917=0xc8;}else{_0x1d2917=0xce;}_0x1d08b4[_0xbe11('0x18')](_0x1d2917);return _0x1d08b4[_0xbe11('0x1d')](_0xbe11('0x1e'),_0x3a24ef+'-'+_0x4b36ba+'/'+_0xab26e4)['json'](_0x4cefd4);}return null;};}function patchUpdates(_0x39c524){return function(_0x699ad1){try{jsonpatch[_0xbe11('0x1f')](_0x699ad1,_0x39c524,!![]);}catch(_0x3cc921){return BPromise[_0xbe11('0x20')](_0x3cc921);}return _0x699ad1[_0xbe11('0x21')]();};}function saveUpdates(_0x489be8,_0x4fcfdc){return function(_0x1c6253){if(_0x1c6253){return _0x1c6253[_0xbe11('0x22')](_0x489be8)['then'](function(_0x6da218){return _0x6da218;});}return null;};}function removeEntity(_0x355971,_0x343d6a){return function(_0x1125e3){if(_0x1125e3){return _0x1125e3['destroy']()[_0xbe11('0x23')](function(){_0x355971[_0xbe11('0x18')](0xcc)[_0xbe11('0x24')]();});}};}function handleEntityNotFound(_0x62ceb1,_0x3e21bf){return function(_0x663629){if(!_0x663629){_0x62ceb1[_0xbe11('0x25')](0x194);}return _0x663629;};}function handleError(_0x2b9c66,_0x205413){_0x205413=_0x205413||0x1f4;return function(_0x1f9547){logger[_0xbe11('0x26')](_0x1f9547[_0xbe11('0x27')]);if(_0x1f9547[_0xbe11('0x28')]){delete _0x1f9547[_0xbe11('0x28')];}_0x2b9c66[_0xbe11('0x18')](_0x205413)[_0xbe11('0x29')](_0x1f9547);};}exports[_0xbe11('0x2a')]=function(_0x206151,_0x156338){var _0x32c155={},_0x224605={},_0x5cd15a={'count':0x0,'rows':[]};var _0x4365f9=_['map'](db[_0xbe11('0x2b')]['rawAttributes'],function(_0x1b6491){return{'name':_0x1b6491[_0xbe11('0x2c')],'type':_0x1b6491[_0xbe11('0x2d')][_0xbe11('0x2e')]};});_0x224605[_0xbe11('0x2f')]=_[_0xbe11('0x30')](_0x4365f9,_0xbe11('0x28'));_0x224605[_0xbe11('0x31')]=_['keys'](_0x206151[_0xbe11('0x31')]);_0x224605[_0xbe11('0x32')]=_[_0xbe11('0x33')](_0x224605[_0xbe11('0x2f')],_0x224605['query']);_0x32c155[_0xbe11('0x34')]=_[_0xbe11('0x33')](_0x224605['model'],qs[_0xbe11('0x35')](_0x206151[_0xbe11('0x31')]['fields']));_0x32c155[_0xbe11('0x34')]=_0x32c155['attributes'][_0xbe11('0x36')]?_0x32c155['attributes']:_0x224605[_0xbe11('0x2f')];if(!_0x206151['query'][_0xbe11('0x37')]('nolimit')){_0x32c155['limit']=qs[_0xbe11('0x1b')](_0x206151[_0xbe11('0x31')][_0xbe11('0x1b')]);_0x32c155[_0xbe11('0x19')]=qs[_0xbe11('0x19')](_0x206151[_0xbe11('0x31')][_0xbe11('0x19')]);}_0x32c155['order']=qs[_0xbe11('0x38')](_0x206151[_0xbe11('0x31')][_0xbe11('0x38')]);_0x32c155[_0xbe11('0x39')]=qs[_0xbe11('0x32')](_[_0xbe11('0x3a')](_0x206151[_0xbe11('0x31')],_0x224605['filters']),_0x4365f9);if(_0x206151[_0xbe11('0x31')][_0xbe11('0x3b')]){_0x32c155[_0xbe11('0x39')]=_[_0xbe11('0x3c')](_0x32c155['where'],{'$or':_[_0xbe11('0x30')](_0x4365f9,function(_0x4a33c6){if(_0x4a33c6[_0xbe11('0x2d')]!==_0xbe11('0x3d')){var _0x41399c={};_0x41399c[_0x4a33c6['name']]={'$like':'%'+_0x206151[_0xbe11('0x31')][_0xbe11('0x3b')]+'%'};return _0x41399c;}})});}_0x32c155=_[_0xbe11('0x3c')]({},_0x32c155,_0x206151[_0xbe11('0x3e')]);var _0x2ed8a8={'where':_0x32c155[_0xbe11('0x39')]};return db['SquareReport']['count'](_0x2ed8a8)[_0xbe11('0x23')](function(_0x3908b1){_0x5cd15a[_0xbe11('0x1c')]=_0x3908b1;if(_0x206151[_0xbe11('0x31')][_0xbe11('0x3f')]){_0x32c155[_0xbe11('0x40')]=[{'all':!![]}];}return db[_0xbe11('0x2b')][_0xbe11('0x41')](_0x32c155);})[_0xbe11('0x23')](function(_0x2a2df7){_0x5cd15a[_0xbe11('0x42')]=_0x2a2df7;return _0x5cd15a;})[_0xbe11('0x23')](respondWithFilteredResult(_0x156338,_0x32c155))[_0xbe11('0x43')](handleError(_0x156338,null));};exports[_0xbe11('0x44')]=function(_0x451ab3,_0x3ed9c3){var _0x2fcb9a={'raw':!![],'where':{'id':_0x451ab3['params']['id']}},_0x3d2bff={};_0x3d2bff[_0xbe11('0x2f')]=_[_0xbe11('0x45')](db[_0xbe11('0x2b')][_0xbe11('0x46')]);_0x3d2bff[_0xbe11('0x31')]=_[_0xbe11('0x45')](_0x451ab3[_0xbe11('0x31')]);_0x3d2bff[_0xbe11('0x32')]=_[_0xbe11('0x33')](_0x3d2bff[_0xbe11('0x2f')],_0x3d2bff[_0xbe11('0x31')]);_0x2fcb9a[_0xbe11('0x34')]=_['intersection'](_0x3d2bff['model'],qs['fields'](_0x451ab3[_0xbe11('0x31')][_0xbe11('0x35')]));_0x2fcb9a[_0xbe11('0x34')]=_0x2fcb9a[_0xbe11('0x34')][_0xbe11('0x36')]?_0x2fcb9a['attributes']:_0x3d2bff['model'];if(_0x451ab3[_0xbe11('0x31')][_0xbe11('0x3f')]){_0x2fcb9a[_0xbe11('0x40')]=[{'all':!![]}];}_0x2fcb9a=_[_0xbe11('0x3c')]({},_0x2fcb9a,_0x451ab3[_0xbe11('0x3e')]);return db[_0xbe11('0x2b')][_0xbe11('0x47')](_0x2fcb9a)[_0xbe11('0x23')](handleEntityNotFound(_0x3ed9c3,null))['then'](respondWithResult(_0x3ed9c3,null))[_0xbe11('0x43')](handleError(_0x3ed9c3,null));};exports[_0xbe11('0x48')]=function(_0x4fe559,_0x1593de){return db[_0xbe11('0x2b')][_0xbe11('0x48')](_0x4fe559[_0xbe11('0x49')],{})[_0xbe11('0x23')](respondWithResult(_0x1593de,0xc9))['catch'](handleError(_0x1593de,null));};exports['update']=function(_0x48759a,_0x1342a6){if(_0x48759a[_0xbe11('0x49')]['id']){delete _0x48759a['body']['id'];}return db[_0xbe11('0x2b')][_0xbe11('0x47')]({'where':{'id':_0x48759a[_0xbe11('0x4a')]['id']}})[_0xbe11('0x23')](handleEntityNotFound(_0x1342a6,null))[_0xbe11('0x23')](saveUpdates(_0x48759a[_0xbe11('0x49')],null))['then'](respondWithResult(_0x1342a6,null))['catch'](handleError(_0x1342a6,null));};exports[_0xbe11('0x4b')]=function(_0x469247,_0x257ead){return db['SquareReport'][_0xbe11('0x47')]({'where':{'id':_0x469247[_0xbe11('0x4a')]['id']}})[_0xbe11('0x23')](handleEntityNotFound(_0x257ead,null))['then'](removeEntity(_0x257ead,null))[_0xbe11('0x43')](handleError(_0x257ead,null));};exports[_0xbe11('0x4c')]=function(_0x10c6da,_0x465233){return db[_0xbe11('0x2b')][_0xbe11('0x4c')]()[_0xbe11('0x23')](respondWithResult(_0x465233,null))[_0xbe11('0x43')](handleError(_0x465233,null));}; \ No newline at end of file +var _0x7b1e=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','then','catch','show','keys','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','error','stack','name','send','SquareReport','rawAttributes','fieldName','type','model','query','filters'];(function(_0x75d5f6,_0x2ac0c7){var _0x57c4da=function(_0x38654f){while(--_0x38654f){_0x75d5f6['push'](_0x75d5f6['shift']());}};_0x57c4da(++_0x2ac0c7);}(_0x7b1e,0x14b));var _0xe7b1=function(_0x1477ef,_0x54a5d6){_0x1477ef=_0x1477ef-0x0;var _0x164acd=_0x7b1e[_0x1477ef];return _0x164acd;};'use strict';var emlformat=require(_0xe7b1('0x0'));var rimraf=require(_0xe7b1('0x1'));var zipdir=require(_0xe7b1('0x2'));var jsonpatch=require(_0xe7b1('0x3'));var rp=require(_0xe7b1('0x4'));var moment=require(_0xe7b1('0x5'));var BPromise=require(_0xe7b1('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe7b1('0x7'));var sox=require('sox');var csv=require(_0xe7b1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe7b1('0x9'));var squel=require(_0xe7b1('0xa'));var crypto=require(_0xe7b1('0xb'));var jsforce=require(_0xe7b1('0xc'));var deskjs=require(_0xe7b1('0xd'));var toCsv=require(_0xe7b1('0x8'));var querystring=require(_0xe7b1('0xe'));var Papa=require(_0xe7b1('0xf'));var Redis=require(_0xe7b1('0x10'));var authService=require(_0xe7b1('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe7b1('0x12'));var hardwareService=require(_0xe7b1('0x13'));var logger=require(_0xe7b1('0x14'))('api');var utils=require(_0xe7b1('0x15'));var config=require(_0xe7b1('0x16'));var licenseUtil=require(_0xe7b1('0x17'));var db=require(_0xe7b1('0x18'))['db'];function respondWithStatusCode(_0x1ac2e0,_0x46e360){_0x46e360=_0x46e360||0xcc;return function(_0x298c88){if(_0x298c88){return _0x1ac2e0[_0xe7b1('0x19')](_0x46e360);}return _0x1ac2e0['status'](_0x46e360)[_0xe7b1('0x1a')]();};}function respondWithResult(_0x57e90d,_0x5dcd07){_0x5dcd07=_0x5dcd07||0xc8;return function(_0x569b89){if(_0x569b89){return _0x57e90d[_0xe7b1('0x1b')](_0x5dcd07)[_0xe7b1('0x1c')](_0x569b89);}};}function respondWithFilteredResult(_0xff4895,_0x443175){return function(_0x342981){if(_0x342981){var _0x2dd314=typeof _0x443175[_0xe7b1('0x1d')]===_0xe7b1('0x1e')&&typeof _0x443175[_0xe7b1('0x1f')]===_0xe7b1('0x1e');var _0x438426=_0x342981[_0xe7b1('0x20')];var _0x30693d=_0x2dd314?0x0:_0x443175[_0xe7b1('0x1d')];var _0x16eb6f=_0x2dd314?_0x342981[_0xe7b1('0x20')]:_0x443175[_0xe7b1('0x1d')]+_0x443175['limit'];var _0x38a9bc;if(_0x16eb6f>=_0x438426){_0x16eb6f=_0x438426;_0x38a9bc=0xc8;}else{_0x38a9bc=0xce;}_0xff4895[_0xe7b1('0x1b')](_0x38a9bc);return _0xff4895[_0xe7b1('0x21')](_0xe7b1('0x22'),_0x30693d+'-'+_0x16eb6f+'/'+_0x438426)[_0xe7b1('0x1c')](_0x342981);}return null;};}function patchUpdates(_0x532a05){return function(_0x2f87dc){try{jsonpatch['apply'](_0x2f87dc,_0x532a05,!![]);}catch(_0x47d6da){return BPromise[_0xe7b1('0x23')](_0x47d6da);}return _0x2f87dc['save']();};}function saveUpdates(_0x20f389,_0x308f1a){return function(_0x41ed48){if(_0x41ed48){return _0x41ed48[_0xe7b1('0x24')](_0x20f389)['then'](function(_0x5b57cf){return _0x5b57cf;});}return null;};}function removeEntity(_0x2cfd64,_0x4b89b0){return function(_0x4f7867){if(_0x4f7867){return _0x4f7867[_0xe7b1('0x25')]()['then'](function(){_0x2cfd64[_0xe7b1('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56ebbe,_0x216488){return function(_0x54f3c7){if(!_0x54f3c7){_0x56ebbe['sendStatus'](0x194);}return _0x54f3c7;};}function handleError(_0x246d40,_0x30f95f){_0x30f95f=_0x30f95f||0x1f4;return function(_0x122cc1){logger[_0xe7b1('0x26')](_0x122cc1[_0xe7b1('0x27')]);if(_0x122cc1['name']){delete _0x122cc1[_0xe7b1('0x28')];}_0x246d40['status'](_0x30f95f)[_0xe7b1('0x29')](_0x122cc1);};}exports['index']=function(_0x447353,_0x11e75b){var _0x2b820f={},_0x1ce93c={},_0x2fbcc7={'count':0x0,'rows':[]};var _0x256268=_['map'](db[_0xe7b1('0x2a')][_0xe7b1('0x2b')],function(_0x4cadfb){return{'name':_0x4cadfb[_0xe7b1('0x2c')],'type':_0x4cadfb[_0xe7b1('0x2d')]['key']};});_0x1ce93c[_0xe7b1('0x2e')]=_['map'](_0x256268,'name');_0x1ce93c[_0xe7b1('0x2f')]=_['keys'](_0x447353['query']);_0x1ce93c[_0xe7b1('0x30')]=_[_0xe7b1('0x31')](_0x1ce93c[_0xe7b1('0x2e')],_0x1ce93c[_0xe7b1('0x2f')]);_0x2b820f[_0xe7b1('0x32')]=_[_0xe7b1('0x31')](_0x1ce93c['model'],qs[_0xe7b1('0x33')](_0x447353[_0xe7b1('0x2f')]['fields']));_0x2b820f[_0xe7b1('0x32')]=_0x2b820f['attributes'][_0xe7b1('0x34')]?_0x2b820f[_0xe7b1('0x32')]:_0x1ce93c[_0xe7b1('0x2e')];if(!_0x447353[_0xe7b1('0x2f')][_0xe7b1('0x35')](_0xe7b1('0x36'))){_0x2b820f[_0xe7b1('0x1f')]=qs['limit'](_0x447353['query']['limit']);_0x2b820f[_0xe7b1('0x1d')]=qs[_0xe7b1('0x1d')](_0x447353[_0xe7b1('0x2f')][_0xe7b1('0x1d')]);}_0x2b820f[_0xe7b1('0x37')]=qs['sort'](_0x447353[_0xe7b1('0x2f')][_0xe7b1('0x38')]);_0x2b820f[_0xe7b1('0x39')]=qs['filters'](_[_0xe7b1('0x3a')](_0x447353[_0xe7b1('0x2f')],_0x1ce93c[_0xe7b1('0x30')]),_0x256268);if(_0x447353[_0xe7b1('0x2f')][_0xe7b1('0x3b')]){_0x2b820f[_0xe7b1('0x39')]=_['merge'](_0x2b820f[_0xe7b1('0x39')],{'$or':_['map'](_0x256268,function(_0x3c46d1){if(_0x3c46d1[_0xe7b1('0x2d')]!==_0xe7b1('0x3c')){var _0x8e8326={};_0x8e8326[_0x3c46d1[_0xe7b1('0x28')]]={'$like':'%'+_0x447353[_0xe7b1('0x2f')][_0xe7b1('0x3b')]+'%'};return _0x8e8326;}})});}_0x2b820f=_[_0xe7b1('0x3d')]({},_0x2b820f,_0x447353[_0xe7b1('0x3e')]);var _0x36ffce={'where':_0x2b820f[_0xe7b1('0x39')]};return db['SquareReport'][_0xe7b1('0x20')](_0x36ffce)['then'](function(_0x4411c5){_0x2fbcc7[_0xe7b1('0x20')]=_0x4411c5;if(_0x447353['query'][_0xe7b1('0x3f')]){_0x2b820f[_0xe7b1('0x40')]=[{'all':!![]}];}return db[_0xe7b1('0x2a')][_0xe7b1('0x41')](_0x2b820f);})['then'](function(_0x2ce567){_0x2fbcc7[_0xe7b1('0x42')]=_0x2ce567;return _0x2fbcc7;})[_0xe7b1('0x43')](respondWithFilteredResult(_0x11e75b,_0x2b820f))[_0xe7b1('0x44')](handleError(_0x11e75b,null));};exports[_0xe7b1('0x45')]=function(_0x4614b2,_0x1f8c27){var _0x44aed5={'raw':!![],'where':{'id':_0x4614b2['params']['id']}},_0x553429={};_0x553429[_0xe7b1('0x2e')]=_[_0xe7b1('0x46')](db['SquareReport'][_0xe7b1('0x2b')]);_0x553429[_0xe7b1('0x2f')]=_['keys'](_0x4614b2[_0xe7b1('0x2f')]);_0x553429[_0xe7b1('0x30')]=_[_0xe7b1('0x31')](_0x553429[_0xe7b1('0x2e')],_0x553429[_0xe7b1('0x2f')]);_0x44aed5[_0xe7b1('0x32')]=_[_0xe7b1('0x31')](_0x553429[_0xe7b1('0x2e')],qs['fields'](_0x4614b2['query']['fields']));_0x44aed5['attributes']=_0x44aed5['attributes'][_0xe7b1('0x34')]?_0x44aed5[_0xe7b1('0x32')]:_0x553429[_0xe7b1('0x2e')];if(_0x4614b2[_0xe7b1('0x2f')][_0xe7b1('0x3f')]){_0x44aed5[_0xe7b1('0x40')]=[{'all':!![]}];}_0x44aed5=_[_0xe7b1('0x3d')]({},_0x44aed5,_0x4614b2['options']);return db[_0xe7b1('0x2a')][_0xe7b1('0x47')](_0x44aed5)[_0xe7b1('0x43')](handleEntityNotFound(_0x1f8c27,null))['then'](respondWithResult(_0x1f8c27,null))['catch'](handleError(_0x1f8c27,null));};exports[_0xe7b1('0x48')]=function(_0x725beb,_0x2361f6){return db[_0xe7b1('0x2a')]['create'](_0x725beb[_0xe7b1('0x49')],{})[_0xe7b1('0x43')](respondWithResult(_0x2361f6,0xc9))[_0xe7b1('0x44')](handleError(_0x2361f6,null));};exports[_0xe7b1('0x24')]=function(_0x4b58d1,_0x4fff2c){if(_0x4b58d1[_0xe7b1('0x49')]['id']){delete _0x4b58d1['body']['id'];}return db[_0xe7b1('0x2a')][_0xe7b1('0x47')]({'where':{'id':_0x4b58d1[_0xe7b1('0x4a')]['id']}})[_0xe7b1('0x43')](handleEntityNotFound(_0x4fff2c,null))['then'](saveUpdates(_0x4b58d1[_0xe7b1('0x49')],null))[_0xe7b1('0x43')](respondWithResult(_0x4fff2c,null))[_0xe7b1('0x44')](handleError(_0x4fff2c,null));};exports['destroy']=function(_0x155550,_0x1628d6){return db[_0xe7b1('0x2a')]['find']({'where':{'id':_0x155550['params']['id']}})['then'](handleEntityNotFound(_0x1628d6,null))[_0xe7b1('0x43')](removeEntity(_0x1628d6,null))[_0xe7b1('0x44')](handleError(_0x1628d6,null));};exports[_0xe7b1('0x4b')]=function(_0x3979f7,_0x37215a){return db[_0xe7b1('0x2a')]['describe']()['then'](respondWithResult(_0x37215a,null))[_0xe7b1('0x44')](handleError(_0x37215a,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 809e026..c687e31 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 _0x7962=['bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','uniqueid','project_name','leaveAt','lodash','util','../../config/logger','api','moment'];(function(_0x4d0629,_0x238445){var _0x82603c=function(_0x5062ba){while(--_0x5062ba){_0x4d0629['push'](_0x4d0629['shift']());}};_0x82603c(++_0x238445);}(_0x7962,0x18a));var _0x2796=function(_0x45bad9,_0x46ef93){_0x45bad9=_0x45bad9-0x0;var _0x22801d=_0x7962[_0x45bad9];return _0x22801d;};'use strict';var _=require(_0x2796('0x0'));var util=require(_0x2796('0x1'));var logger=require(_0x2796('0x2'))(_0x2796('0x3'));var moment=require(_0x2796('0x4'));var BPromise=require(_0x2796('0x5'));var rp=require(_0x2796('0x6'));var fs=require('fs');var path=require(_0x2796('0x7'));var rimraf=require(_0x2796('0x8'));var config=require(_0x2796('0x9'));var attributes=require(_0x2796('0xa'));module[_0x2796('0xb')]=function(_0x2a916d,_0x4ef9b9){return _0x2a916d[_0x2796('0xc')](_0x2796('0xd'),attributes,{'tableName':_0x2796('0xe'),'paranoid':![],'indexes':[{'name':_0x2796('0xf'),'fields':[_0x2796('0x10'),_0x2796('0x11')]},{'name':_0x2796('0x12'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0x146c=['report_square','project_name','leaveAt','lodash','../../config/logger','moment','request-promise','path','rimraf','./squareReport.attributes','exports','define','SquareReport'];(function(_0x28c465,_0x2a550b){var _0x32d696=function(_0x323b83){while(--_0x323b83){_0x28c465['push'](_0x28c465['shift']());}};_0x32d696(++_0x2a550b);}(_0x146c,0x1e4));var _0xc146=function(_0x3d7031,_0xd3085e){_0x3d7031=_0x3d7031-0x0;var _0x24284a=_0x146c[_0x3d7031];return _0x24284a;};'use strict';var _=require(_0xc146('0x0'));var util=require('util');var logger=require(_0xc146('0x1'))('api');var moment=require(_0xc146('0x2'));var BPromise=require('bluebird');var rp=require(_0xc146('0x3'));var fs=require('fs');var path=require(_0xc146('0x4'));var rimraf=require(_0xc146('0x5'));var config=require('../../config/environment');var attributes=require(_0xc146('0x6'));module[_0xc146('0x7')]=function(_0x11743e,_0xf6cfdb){return _0x11743e[_0xc146('0x8')](_0xc146('0x9'),attributes,{'tableName':_0xc146('0xa'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':['uniqueid',_0xc146('0xb')]},{'name':_0xc146('0xc'),'fields':[_0xc146('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 7d60486..8815442 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 _0x81bd=['create','options','raw','then','catch','UpdateSquareReport','update','body','where','limit','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','SquareReport'];(function(_0x15157a,_0x2cb578){var _0x20887e=function(_0xf50838){while(--_0xf50838){_0x15157a['push'](_0x15157a['shift']());}};_0x20887e(++_0x2cb578);}(_0x81bd,0x6d));var _0xd81b=function(_0x1498dd,_0x3155dd){_0x1498dd=_0x1498dd-0x0;var _0x46b1a7=_0x81bd[_0x1498dd];return _0x46b1a7;};'use strict';var _=require(_0xd81b('0x0'));var util=require(_0xd81b('0x1'));var moment=require('moment');var BPromise=require(_0xd81b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd81b('0x3'));var db=require(_0xd81b('0x4'))['db'];var utils=require(_0xd81b('0x5'));var logger=require(_0xd81b('0x6'))(_0xd81b('0x7'));var config=require(_0xd81b('0x8'));var jayson=require(_0xd81b('0x9'));var client=jayson[_0xd81b('0xa')][_0xd81b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x59ec44,_0x25c0ce,_0x346815){return new BPromise(function(_0x163261,_0x4881a6){return client['request'](_0x59ec44,_0x346815)['then'](function(_0x2d4519){logger[_0xd81b('0xc')](_0xd81b('0xd'),_0x25c0ce,_0xd81b('0xe'));logger[_0xd81b('0xf')](_0xd81b('0x10'),_0x25c0ce,_0xd81b('0xe'),JSON[_0xd81b('0x11')](_0x2d4519));if(_0x2d4519[_0xd81b('0x12')]){if(_0x2d4519['error'][_0xd81b('0x13')]===0x1f4){logger[_0xd81b('0x12')](_0xd81b('0xd'),_0x25c0ce,_0x2d4519[_0xd81b('0x12')][_0xd81b('0x14')]);return _0x4881a6(_0x2d4519[_0xd81b('0x12')][_0xd81b('0x14')]);}logger[_0xd81b('0x12')](_0xd81b('0xd'),_0x25c0ce,_0x2d4519[_0xd81b('0x12')][_0xd81b('0x14')]);return _0x163261(_0x2d4519[_0xd81b('0x12')][_0xd81b('0x14')]);}else{logger[_0xd81b('0xc')](_0xd81b('0xd'),_0x25c0ce,_0xd81b('0xe'));_0x163261(_0x2d4519[_0xd81b('0x15')]['message']);}})['catch'](function(_0x37bffe){logger[_0xd81b('0x12')](_0xd81b('0xd'),_0x25c0ce,_0x37bffe);_0x4881a6(_0x37bffe);});});}exports['CreateSquareReport']=function(_0x132189){var _0x2a8e98=this;return new Promise(function(_0x3a035d,_0x18950d){return db[_0xd81b('0x16')][_0xd81b('0x17')](_0x132189['body'],{'raw':_0x132189[_0xd81b('0x18')]?_0x132189['options'][_0xd81b('0x19')]===undefined?!![]:![]:!![]})[_0xd81b('0x1a')](function(_0x25e9b){logger[_0xd81b('0xc')]('CreateSquareReport',_0x132189);logger['debug']('CreateSquareReport',_0x132189,JSON['stringify'](_0x25e9b));_0x3a035d(_0x25e9b);})[_0xd81b('0x1b')](function(_0x35a5e2){logger[_0xd81b('0x12')]('CreateSquareReport',_0x35a5e2[_0xd81b('0x14')],_0x132189);_0x18950d(_0x2a8e98['error'](0x1f4,_0x35a5e2[_0xd81b('0x14')]));});});};exports[_0xd81b('0x1c')]=function(_0x367175){var _0x11da01=this;return new Promise(function(_0x2da1f4,_0x53d41f){return db[_0xd81b('0x16')][_0xd81b('0x1d')](_0x367175[_0xd81b('0x1e')],{'raw':_0x367175[_0xd81b('0x18')]?_0x367175[_0xd81b('0x18')][_0xd81b('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x367175[_0xd81b('0x18')]?_0x367175['options'][_0xd81b('0x1f')]||null:null,'attributes':_0x367175['options']?_0x367175[_0xd81b('0x18')]['attributes']||null:null,'limit':_0x367175[_0xd81b('0x18')]?_0x367175[_0xd81b('0x18')][_0xd81b('0x20')]||null:null})[_0xd81b('0x1a')](function(_0x2bfff1){logger[_0xd81b('0xc')](_0xd81b('0x1c'),_0x367175);logger[_0xd81b('0xf')](_0xd81b('0x1c'),_0x367175,JSON['stringify'](_0x2bfff1));_0x2da1f4(_0x2bfff1);})['catch'](function(_0x2dbd49){logger['error'](_0xd81b('0x1c'),_0x2dbd49[_0xd81b('0x14')],_0x367175);_0x53d41f(_0x11da01[_0xd81b('0x12')](0x1f4,_0x2dbd49[_0xd81b('0x14')]));});});}; \ No newline at end of file +var _0x1409=['then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareReport','SquareReport','create','body','options','raw','UpdateSquareReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x1409,0x152));var _0x9140=function(_0x5b9ae2,_0x1a7b9d){_0x5b9ae2=_0x5b9ae2-0x0;var _0x12095d=_0x1409[_0x5b9ae2];return _0x12095d;};'use strict';var _=require(_0x9140('0x0'));var util=require(_0x9140('0x1'));var moment=require(_0x9140('0x2'));var BPromise=require(_0x9140('0x3'));var rs=require(_0x9140('0x4'));var fs=require('fs');var Redis=require(_0x9140('0x5'));var db=require(_0x9140('0x6'))['db'];var utils=require(_0x9140('0x7'));var logger=require('../../config/logger')(_0x9140('0x8'));var config=require(_0x9140('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9140('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x938c9c,_0x146c72,_0x119a42){return new BPromise(function(_0x1a2baa,_0x33b004){return client[_0x9140('0xb')](_0x938c9c,_0x119a42)[_0x9140('0xc')](function(_0x171698){logger[_0x9140('0xd')](_0x9140('0xe'),_0x146c72,_0x9140('0xf'));logger[_0x9140('0x10')](_0x9140('0x11'),_0x146c72,_0x9140('0xf'),JSON[_0x9140('0x12')](_0x171698));if(_0x171698[_0x9140('0x13')]){if(_0x171698['error'][_0x9140('0x14')]===0x1f4){logger[_0x9140('0x13')](_0x9140('0xe'),_0x146c72,_0x171698[_0x9140('0x13')][_0x9140('0x15')]);return _0x33b004(_0x171698['error'][_0x9140('0x15')]);}logger[_0x9140('0x13')]('SquareReport,\x20%s,\x20%s',_0x146c72,_0x171698[_0x9140('0x13')]['message']);return _0x1a2baa(_0x171698[_0x9140('0x13')]['message']);}else{logger[_0x9140('0xd')](_0x9140('0xe'),_0x146c72,'request\x20sent');_0x1a2baa(_0x171698[_0x9140('0x16')]['message']);}})[_0x9140('0x17')](function(_0x11ae77){logger[_0x9140('0x13')]('SquareReport,\x20%s,\x20%s',_0x146c72,_0x11ae77);_0x33b004(_0x11ae77);});});}exports[_0x9140('0x18')]=function(_0x4e6dab){var _0x3d8d33=this;return new Promise(function(_0x14acab,_0x2b8b86){return db[_0x9140('0x19')][_0x9140('0x1a')](_0x4e6dab[_0x9140('0x1b')],{'raw':_0x4e6dab[_0x9140('0x1c')]?_0x4e6dab[_0x9140('0x1c')][_0x9140('0x1d')]===undefined?!![]:![]:!![]})[_0x9140('0xc')](function(_0xa5833f){logger[_0x9140('0xd')](_0x9140('0x18'),_0x4e6dab);logger[_0x9140('0x10')]('CreateSquareReport',_0x4e6dab,JSON[_0x9140('0x12')](_0xa5833f));_0x14acab(_0xa5833f);})['catch'](function(_0x1fc61b){logger[_0x9140('0x13')]('CreateSquareReport',_0x1fc61b[_0x9140('0x15')],_0x4e6dab);_0x2b8b86(_0x3d8d33['error'](0x1f4,_0x1fc61b[_0x9140('0x15')]));});});};exports[_0x9140('0x1e')]=function(_0x99335e){var _0x30e314=this;return new Promise(function(_0x4f89f6,_0x4f89d){return db[_0x9140('0x19')][_0x9140('0x1f')](_0x99335e[_0x9140('0x1b')],{'raw':_0x99335e[_0x9140('0x1c')]?_0x99335e[_0x9140('0x1c')][_0x9140('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x99335e[_0x9140('0x1c')]?_0x99335e[_0x9140('0x1c')][_0x9140('0x20')]||null:null,'attributes':_0x99335e[_0x9140('0x1c')]?_0x99335e[_0x9140('0x1c')][_0x9140('0x21')]||null:null,'limit':_0x99335e[_0x9140('0x1c')]?_0x99335e[_0x9140('0x1c')][_0x9140('0x22')]||null:null})[_0x9140('0xc')](function(_0x7ad059){logger['info'](_0x9140('0x1e'),_0x99335e);logger[_0x9140('0x10')](_0x9140('0x1e'),_0x99335e,JSON[_0x9140('0x12')](_0x7ad059));_0x4f89f6(_0x7ad059);})['catch'](function(_0xffddf8){logger[_0x9140('0x13')](_0x9140('0x1e'),_0xffddf8[_0x9140('0x15')],_0x99335e);_0x4f89d(_0x30e314['error'](0x1f4,_0xffddf8[_0x9140('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 30e249c..8e82c4f 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 _0xae91=['show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','describe','/:id'];(function(_0x5de6c9,_0x471538){var _0x4f45f6=function(_0xe0c086){while(--_0xe0c086){_0x5de6c9['push'](_0x5de6c9['shift']());}};_0x4f45f6(++_0x471538);}(_0xae91,0xe3));var _0x1ae9=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xae91[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x1ae9('0x0'));var util=require(_0x1ae9('0x1'));var path=require(_0x1ae9('0x2'));var timeout=require(_0x1ae9('0x3'));var express=require(_0x1ae9('0x4'));var router=express['Router']();var fs_extra=require(_0x1ae9('0x5'));var auth=require(_0x1ae9('0x6'));var interaction=require(_0x1ae9('0x7'));var config=require(_0x1ae9('0x8'));var controller=require(_0x1ae9('0x9'));router[_0x1ae9('0xa')]('/',auth[_0x1ae9('0xb')](),controller[_0x1ae9('0xc')]);router[_0x1ae9('0xa')]('/describe',auth[_0x1ae9('0xb')](),controller[_0x1ae9('0xd')]);router[_0x1ae9('0xa')](_0x1ae9('0xe'),auth['isAuthenticated'](),controller[_0x1ae9('0xf')]);router[_0x1ae9('0x10')]('/',auth[_0x1ae9('0xb')](),controller[_0x1ae9('0x11')]);router[_0x1ae9('0x12')](_0x1ae9('0xe'),auth['isAuthenticated'](),controller[_0x1ae9('0x13')]);router[_0x1ae9('0x14')](_0x1ae9('0xe'),auth['isAuthenticated'](),controller[_0x1ae9('0x15')]);module['exports']=router; \ No newline at end of file +var _0xc7e0=['create','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','index','/describe','isAuthenticated','/:id','show'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xc7e0,0xb9));var _0x0c7e=function(_0x1190e0,_0x29544f){_0x1190e0=_0x1190e0-0x0;var _0x4c7704=_0xc7e0[_0x1190e0];return _0x4c7704;};'use strict';var multer=require('multer');var util=require(_0x0c7e('0x0'));var path=require(_0x0c7e('0x1'));var timeout=require(_0x0c7e('0x2'));var express=require(_0x0c7e('0x3'));var router=express['Router']();var fs_extra=require(_0x0c7e('0x4'));var auth=require(_0x0c7e('0x5'));var interaction=require(_0x0c7e('0x6'));var config=require(_0x0c7e('0x7'));var controller=require(_0x0c7e('0x8'));router[_0x0c7e('0x9')]('/',auth['isAuthenticated'](),controller[_0x0c7e('0xa')]);router[_0x0c7e('0x9')](_0x0c7e('0xb'),auth[_0x0c7e('0xc')](),controller['describe']);router[_0x0c7e('0x9')](_0x0c7e('0xd'),auth[_0x0c7e('0xc')](),controller[_0x0c7e('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0c7e('0xf')]);router['put'](_0x0c7e('0xd'),auth['isAuthenticated'](),controller[_0x0c7e('0x10')]);router[_0x0c7e('0x11')]('/:id',auth[_0x0c7e('0xc')](),controller[_0x0c7e('0x12')]);module[_0x0c7e('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index fe73ed2..c9d7fe1 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 _0xd0e8=['STRING','TEXT','sequelize','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xd0e8,0x6e));var _0x8d0e=function(_0x2dd1d9,_0x134ed0){_0x2dd1d9=_0x2dd1d9-0x0;var _0x49221f=_0xd0e8[_0x2dd1d9];return _0x49221f;};'use strict';var Sequelize=require(_0x8d0e('0x0'));module[_0x8d0e('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x8d0e('0x2')]},'application':{'type':Sequelize[_0x8d0e('0x2')]},'data':{'type':Sequelize[_0x8d0e('0x3')]},'project_name':{'type':Sequelize[_0x8d0e('0x2')]},'callerid':{'type':Sequelize[_0x8d0e('0x2')]}}; \ No newline at end of file +var _0x0b35=['exports','STRING','TEXT'];(function(_0x3e15fe,_0x5bf645){var _0x243bbb=function(_0x267369){while(--_0x267369){_0x3e15fe['push'](_0x3e15fe['shift']());}};_0x243bbb(++_0x5bf645);}(_0x0b35,0x10b));var _0x50b3=function(_0x4ccad7,_0x2daf62){_0x4ccad7=_0x4ccad7-0x0;var _0x3a1bc0=_0x0b35[_0x4ccad7];return _0x3a1bc0;};'use strict';var Sequelize=require('sequelize');module[_0x50b3('0x0')]={'uniqueid':{'type':Sequelize[_0x50b3('0x1')]},'node':{'type':Sequelize[_0x50b3('0x1')]},'application':{'type':Sequelize[_0x50b3('0x1')]},'data':{'type':Sequelize[_0x50b3('0x2')]},'project_name':{'type':Sequelize[_0x50b3('0x1')]},'callerid':{'type':Sequelize[_0x50b3('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 569b241..f00d2a2 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 _0x6ad7=['name','send','index','SquareDetailsReport','fieldName','type','key','map','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','pick','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','length','body','find','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','destroy','sendStatus','error'];(function(_0x257a2b,_0x4109b0){var _0x4e97e3=function(_0x520ab6){while(--_0x520ab6){_0x257a2b['push'](_0x257a2b['shift']());}};_0x4e97e3(++_0x4109b0);}(_0x6ad7,0x107));var _0x76ad=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6ad7[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x76ad('0x0'));var rimraf=require(_0x76ad('0x1'));var zipdir=require(_0x76ad('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x76ad('0x3'));var moment=require('moment');var BPromise=require(_0x76ad('0x4'));var Mustache=require('mustache');var util=require(_0x76ad('0x5'));var path=require('path');var sox=require(_0x76ad('0x6'));var csv=require(_0x76ad('0x7'));var ejs=require(_0x76ad('0x8'));var fs=require('fs');var fs_extra=require(_0x76ad('0x9'));var _=require(_0x76ad('0xa'));var squel=require('squel');var crypto=require(_0x76ad('0xb'));var jsforce=require(_0x76ad('0xc'));var deskjs=require(_0x76ad('0xd'));var toCsv=require(_0x76ad('0x7'));var querystring=require(_0x76ad('0xe'));var Papa=require(_0x76ad('0xf'));var Redis=require(_0x76ad('0x10'));var authService=require(_0x76ad('0x11'));var qs=require(_0x76ad('0x12'));var as=require(_0x76ad('0x13'));var hardwareService=require(_0x76ad('0x14'));var logger=require(_0x76ad('0x15'))(_0x76ad('0x16'));var utils=require('../../config/utils');var config=require(_0x76ad('0x17'));var licenseUtil=require(_0x76ad('0x18'));var db=require(_0x76ad('0x19'))['db'];function respondWithStatusCode(_0x4ef09f,_0x3f4b3c){_0x3f4b3c=_0x3f4b3c||0xcc;return function(_0x58cebd){if(_0x58cebd){return _0x4ef09f['sendStatus'](_0x3f4b3c);}return _0x4ef09f[_0x76ad('0x1a')](_0x3f4b3c)[_0x76ad('0x1b')]();};}function respondWithResult(_0x4e6324,_0x19cb21){_0x19cb21=_0x19cb21||0xc8;return function(_0xc857a6){if(_0xc857a6){return _0x4e6324['status'](_0x19cb21)[_0x76ad('0x1c')](_0xc857a6);}};}function respondWithFilteredResult(_0x3e684e,_0x57bfcb){return function(_0x256961){if(_0x256961){var _0x56385=typeof _0x57bfcb[_0x76ad('0x1d')]===_0x76ad('0x1e')&&typeof _0x57bfcb['limit']===_0x76ad('0x1e');var _0x311396=_0x256961[_0x76ad('0x1f')];var _0x5a2fc1=_0x56385?0x0:_0x57bfcb[_0x76ad('0x1d')];var _0x1305e5=_0x56385?_0x256961['count']:_0x57bfcb['offset']+_0x57bfcb[_0x76ad('0x20')];var _0x432d9d;if(_0x1305e5>=_0x311396){_0x1305e5=_0x311396;_0x432d9d=0xc8;}else{_0x432d9d=0xce;}_0x3e684e[_0x76ad('0x1a')](_0x432d9d);return _0x3e684e['set'](_0x76ad('0x21'),_0x5a2fc1+'-'+_0x1305e5+'/'+_0x311396)[_0x76ad('0x1c')](_0x256961);}return null;};}function patchUpdates(_0x273f21){return function(_0x1a717e){try{jsonpatch[_0x76ad('0x22')](_0x1a717e,_0x273f21,!![]);}catch(_0x5d3f39){return BPromise[_0x76ad('0x23')](_0x5d3f39);}return _0x1a717e['save']();};}function saveUpdates(_0x4b204e,_0x4e2104){return function(_0xc7e861){if(_0xc7e861){return _0xc7e861[_0x76ad('0x24')](_0x4b204e)[_0x76ad('0x25')](function(_0x3f0285){return _0x3f0285;});}return null;};}function removeEntity(_0x5fbb47,_0x395d16){return function(_0x239a3b){if(_0x239a3b){return _0x239a3b[_0x76ad('0x26')]()['then'](function(){_0x5fbb47[_0x76ad('0x1a')](0xcc)[_0x76ad('0x1b')]();});}};}function handleEntityNotFound(_0x18a0ab,_0x2b7e9f){return function(_0x19b3e3){if(!_0x19b3e3){_0x18a0ab[_0x76ad('0x27')](0x194);}return _0x19b3e3;};}function handleError(_0x47ce8a,_0x1c4cbc){_0x1c4cbc=_0x1c4cbc||0x1f4;return function(_0x46b57d){logger[_0x76ad('0x28')](_0x46b57d['stack']);if(_0x46b57d[_0x76ad('0x29')]){delete _0x46b57d[_0x76ad('0x29')];}_0x47ce8a[_0x76ad('0x1a')](_0x1c4cbc)[_0x76ad('0x2a')](_0x46b57d);};}exports[_0x76ad('0x2b')]=function(_0xd38751,_0x4b7fd9){var _0x503f0d={},_0x3ef62f={},_0x365e5e={'count':0x0,'rows':[]};var _0x300caf=_['map'](db[_0x76ad('0x2c')]['rawAttributes'],function(_0x1aff01){return{'name':_0x1aff01[_0x76ad('0x2d')],'type':_0x1aff01[_0x76ad('0x2e')][_0x76ad('0x2f')]};});_0x3ef62f['model']=_[_0x76ad('0x30')](_0x300caf,_0x76ad('0x29'));_0x3ef62f[_0x76ad('0x31')]=_['keys'](_0xd38751['query']);_0x3ef62f[_0x76ad('0x32')]=_[_0x76ad('0x33')](_0x3ef62f[_0x76ad('0x34')],_0x3ef62f['query']);_0x503f0d['attributes']=_[_0x76ad('0x33')](_0x3ef62f[_0x76ad('0x34')],qs[_0x76ad('0x35')](_0xd38751[_0x76ad('0x31')][_0x76ad('0x35')]));_0x503f0d[_0x76ad('0x36')]=_0x503f0d[_0x76ad('0x36')]['length']?_0x503f0d[_0x76ad('0x36')]:_0x3ef62f[_0x76ad('0x34')];if(!_0xd38751[_0x76ad('0x31')][_0x76ad('0x37')](_0x76ad('0x38'))){_0x503f0d['limit']=qs[_0x76ad('0x20')](_0xd38751[_0x76ad('0x31')][_0x76ad('0x20')]);_0x503f0d[_0x76ad('0x1d')]=qs[_0x76ad('0x1d')](_0xd38751[_0x76ad('0x31')]['offset']);}_0x503f0d['order']=qs[_0x76ad('0x39')](_0xd38751['query'][_0x76ad('0x39')]);_0x503f0d['where']=qs['filters'](_[_0x76ad('0x3a')](_0xd38751[_0x76ad('0x31')],_0x3ef62f[_0x76ad('0x32')]),_0x300caf);if(_0xd38751[_0x76ad('0x31')]['filter']){_0x503f0d[_0x76ad('0x3b')]=_[_0x76ad('0x3c')](_0x503f0d[_0x76ad('0x3b')],{'$or':_['map'](_0x300caf,function(_0x41202f){if(_0x41202f['type']!==_0x76ad('0x3d')){var _0x175bea={};_0x175bea[_0x41202f['name']]={'$like':'%'+_0xd38751['query']['filter']+'%'};return _0x175bea;}})});}_0x503f0d=_[_0x76ad('0x3c')]({},_0x503f0d,_0xd38751[_0x76ad('0x3e')]);var _0x52312d={'where':_0x503f0d[_0x76ad('0x3b')]};return db[_0x76ad('0x2c')][_0x76ad('0x1f')](_0x52312d)[_0x76ad('0x25')](function(_0xdf4fd1){_0x365e5e['count']=_0xdf4fd1;if(_0xd38751[_0x76ad('0x31')][_0x76ad('0x3f')]){_0x503f0d[_0x76ad('0x40')]=[{'all':!![]}];}return db['SquareDetailsReport'][_0x76ad('0x41')](_0x503f0d);})[_0x76ad('0x25')](function(_0xb67f97){_0x365e5e[_0x76ad('0x42')]=_0xb67f97;return _0x365e5e;})[_0x76ad('0x25')](respondWithFilteredResult(_0x4b7fd9,_0x503f0d))[_0x76ad('0x43')](handleError(_0x4b7fd9,null));};exports[_0x76ad('0x44')]=function(_0x51db47,_0x2b590d){var _0xdcb5f5={'raw':!![],'where':{'id':_0x51db47[_0x76ad('0x45')]['id']}},_0x2d8b89={};_0x2d8b89[_0x76ad('0x34')]=_[_0x76ad('0x46')](db['SquareDetailsReport'][_0x76ad('0x47')]);_0x2d8b89[_0x76ad('0x31')]=_[_0x76ad('0x46')](_0x51db47[_0x76ad('0x31')]);_0x2d8b89['filters']=_[_0x76ad('0x33')](_0x2d8b89[_0x76ad('0x34')],_0x2d8b89[_0x76ad('0x31')]);_0xdcb5f5[_0x76ad('0x36')]=_[_0x76ad('0x33')](_0x2d8b89[_0x76ad('0x34')],qs[_0x76ad('0x35')](_0x51db47['query']['fields']));_0xdcb5f5['attributes']=_0xdcb5f5['attributes'][_0x76ad('0x48')]?_0xdcb5f5['attributes']:_0x2d8b89[_0x76ad('0x34')];if(_0x51db47[_0x76ad('0x31')][_0x76ad('0x3f')]){_0xdcb5f5[_0x76ad('0x40')]=[{'all':!![]}];}_0xdcb5f5=_[_0x76ad('0x3c')]({},_0xdcb5f5,_0x51db47[_0x76ad('0x3e')]);return db[_0x76ad('0x2c')]['find'](_0xdcb5f5)[_0x76ad('0x25')](handleEntityNotFound(_0x2b590d,null))[_0x76ad('0x25')](respondWithResult(_0x2b590d,null))[_0x76ad('0x43')](handleError(_0x2b590d,null));};exports['create']=function(_0x25a1dc,_0x1c197c){return db[_0x76ad('0x2c')]['create'](_0x25a1dc[_0x76ad('0x49')],{})[_0x76ad('0x25')](respondWithResult(_0x1c197c,0xc9))[_0x76ad('0x43')](handleError(_0x1c197c,null));};exports[_0x76ad('0x24')]=function(_0x9b40fe,_0x5b4601){if(_0x9b40fe[_0x76ad('0x49')]['id']){delete _0x9b40fe[_0x76ad('0x49')]['id'];}return db[_0x76ad('0x2c')][_0x76ad('0x4a')]({'where':{'id':_0x9b40fe[_0x76ad('0x45')]['id']}})[_0x76ad('0x25')](handleEntityNotFound(_0x5b4601,null))[_0x76ad('0x25')](saveUpdates(_0x9b40fe[_0x76ad('0x49')],null))[_0x76ad('0x25')](respondWithResult(_0x5b4601,null))[_0x76ad('0x43')](handleError(_0x5b4601,null));};exports['destroy']=function(_0x561fc8,_0x146b49){return db['SquareDetailsReport'][_0x76ad('0x4a')]({'where':{'id':_0x561fc8[_0x76ad('0x45')]['id']}})[_0x76ad('0x25')](handleEntityNotFound(_0x146b49,null))['then'](removeEntity(_0x146b49,null))[_0x76ad('0x43')](handleError(_0x146b49,null));};exports[_0x76ad('0x4b')]=function(_0x27c24b,_0x1d592d){return db['SquareDetailsReport']['describe']()[_0x76ad('0x25')](respondWithResult(_0x1d592d,null))[_0x76ad('0x43')](handleError(_0x1d592d,null));}; \ No newline at end of file +var _0x3715=['reject','save','update','then','error','stack','map','SquareDetailsReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','name','includeAll','include','findAll','rows','catch','show','keys','options','find','create','body','destroy','params','describe','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','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range'];(function(_0x3db41a,_0x333f6a){var _0xd658e1=function(_0x18bb81){while(--_0x18bb81){_0x3db41a['push'](_0x3db41a['shift']());}};_0xd658e1(++_0x333f6a);}(_0x3715,0xc3));var _0x5371=function(_0xeb4b05,_0x324775){_0xeb4b05=_0xeb4b05-0x0;var _0x58460b=_0x3715[_0xeb4b05];return _0x58460b;};'use strict';var emlformat=require(_0x5371('0x0'));var rimraf=require(_0x5371('0x1'));var zipdir=require(_0x5371('0x2'));var jsonpatch=require(_0x5371('0x3'));var rp=require(_0x5371('0x4'));var moment=require(_0x5371('0x5'));var BPromise=require(_0x5371('0x6'));var Mustache=require(_0x5371('0x7'));var util=require(_0x5371('0x8'));var path=require(_0x5371('0x9'));var sox=require(_0x5371('0xa'));var csv=require(_0x5371('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5371('0xc'));var _=require(_0x5371('0xd'));var squel=require('squel');var crypto=require(_0x5371('0xe'));var jsforce=require(_0x5371('0xf'));var deskjs=require(_0x5371('0x10'));var toCsv=require('to-csv');var querystring=require(_0x5371('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5371('0x12'));var qs=require(_0x5371('0x13'));var as=require(_0x5371('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5371('0x15'))(_0x5371('0x16'));var utils=require(_0x5371('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5371('0x18'));var db=require(_0x5371('0x19'))['db'];function respondWithStatusCode(_0x1faac2,_0x1b0a8a){_0x1b0a8a=_0x1b0a8a||0xcc;return function(_0x5b4adf){if(_0x5b4adf){return _0x1faac2[_0x5371('0x1a')](_0x1b0a8a);}return _0x1faac2['status'](_0x1b0a8a)[_0x5371('0x1b')]();};}function respondWithResult(_0x777eaf,_0x4c8eb8){_0x4c8eb8=_0x4c8eb8||0xc8;return function(_0x4611dd){if(_0x4611dd){return _0x777eaf[_0x5371('0x1c')](_0x4c8eb8)[_0x5371('0x1d')](_0x4611dd);}};}function respondWithFilteredResult(_0x29bf5b,_0x178130){return function(_0x41d0c2){if(_0x41d0c2){var _0x33b592=typeof _0x178130['offset']===_0x5371('0x1e')&&typeof _0x178130[_0x5371('0x1f')]===_0x5371('0x1e');var _0x22dbcd=_0x41d0c2[_0x5371('0x20')];var _0x32f469=_0x33b592?0x0:_0x178130[_0x5371('0x21')];var _0x4855b3=_0x33b592?_0x41d0c2['count']:_0x178130[_0x5371('0x21')]+_0x178130['limit'];var _0x2579f9;if(_0x4855b3>=_0x22dbcd){_0x4855b3=_0x22dbcd;_0x2579f9=0xc8;}else{_0x2579f9=0xce;}_0x29bf5b['status'](_0x2579f9);return _0x29bf5b[_0x5371('0x22')](_0x5371('0x23'),_0x32f469+'-'+_0x4855b3+'/'+_0x22dbcd)['json'](_0x41d0c2);}return null;};}function patchUpdates(_0x470cd2){return function(_0x2c989c){try{jsonpatch['apply'](_0x2c989c,_0x470cd2,!![]);}catch(_0x3c2d4a){return BPromise[_0x5371('0x24')](_0x3c2d4a);}return _0x2c989c[_0x5371('0x25')]();};}function saveUpdates(_0x5eacf2,_0x4add7e){return function(_0x4d7dad){if(_0x4d7dad){return _0x4d7dad[_0x5371('0x26')](_0x5eacf2)[_0x5371('0x27')](function(_0x2a897e){return _0x2a897e;});}return null;};}function removeEntity(_0x2bae28,_0x1f0998){return function(_0xabe2a6){if(_0xabe2a6){return _0xabe2a6['destroy']()[_0x5371('0x27')](function(){_0x2bae28['status'](0xcc)[_0x5371('0x1b')]();});}};}function handleEntityNotFound(_0x522a53,_0xc02f21){return function(_0x427f20){if(!_0x427f20){_0x522a53['sendStatus'](0x194);}return _0x427f20;};}function handleError(_0x395aa9,_0x2a7a93){_0x2a7a93=_0x2a7a93||0x1f4;return function(_0x30d3c2){logger[_0x5371('0x28')](_0x30d3c2[_0x5371('0x29')]);if(_0x30d3c2['name']){delete _0x30d3c2['name'];}_0x395aa9[_0x5371('0x1c')](_0x2a7a93)['send'](_0x30d3c2);};}exports['index']=function(_0x2138e6,_0x167280){var _0x5a84c1={},_0x311021={},_0x32554f={'count':0x0,'rows':[]};var _0x1ea613=_[_0x5371('0x2a')](db[_0x5371('0x2b')][_0x5371('0x2c')],function(_0x1f60c3){return{'name':_0x1f60c3[_0x5371('0x2d')],'type':_0x1f60c3[_0x5371('0x2e')][_0x5371('0x2f')]};});_0x311021['model']=_[_0x5371('0x2a')](_0x1ea613,'name');_0x311021[_0x5371('0x30')]=_['keys'](_0x2138e6['query']);_0x311021[_0x5371('0x31')]=_[_0x5371('0x32')](_0x311021[_0x5371('0x33')],_0x311021[_0x5371('0x30')]);_0x5a84c1[_0x5371('0x34')]=_[_0x5371('0x32')](_0x311021['model'],qs[_0x5371('0x35')](_0x2138e6['query'][_0x5371('0x35')]));_0x5a84c1[_0x5371('0x34')]=_0x5a84c1[_0x5371('0x34')][_0x5371('0x36')]?_0x5a84c1[_0x5371('0x34')]:_0x311021[_0x5371('0x33')];if(!_0x2138e6[_0x5371('0x30')]['hasOwnProperty'](_0x5371('0x37'))){_0x5a84c1[_0x5371('0x1f')]=qs[_0x5371('0x1f')](_0x2138e6[_0x5371('0x30')][_0x5371('0x1f')]);_0x5a84c1[_0x5371('0x21')]=qs[_0x5371('0x21')](_0x2138e6['query'][_0x5371('0x21')]);}_0x5a84c1[_0x5371('0x38')]=qs['sort'](_0x2138e6[_0x5371('0x30')][_0x5371('0x39')]);_0x5a84c1[_0x5371('0x3a')]=qs[_0x5371('0x31')](_['pick'](_0x2138e6[_0x5371('0x30')],_0x311021[_0x5371('0x31')]),_0x1ea613);if(_0x2138e6['query'][_0x5371('0x3b')]){_0x5a84c1[_0x5371('0x3a')]=_[_0x5371('0x3c')](_0x5a84c1[_0x5371('0x3a')],{'$or':_[_0x5371('0x2a')](_0x1ea613,function(_0x131409){if(_0x131409[_0x5371('0x2e')]!==_0x5371('0x3d')){var _0x50e7e3={};_0x50e7e3[_0x131409[_0x5371('0x3e')]]={'$like':'%'+_0x2138e6[_0x5371('0x30')][_0x5371('0x3b')]+'%'};return _0x50e7e3;}})});}_0x5a84c1=_[_0x5371('0x3c')]({},_0x5a84c1,_0x2138e6['options']);var _0x175296={'where':_0x5a84c1[_0x5371('0x3a')]};return db[_0x5371('0x2b')][_0x5371('0x20')](_0x175296)[_0x5371('0x27')](function(_0x2b7859){_0x32554f['count']=_0x2b7859;if(_0x2138e6[_0x5371('0x30')][_0x5371('0x3f')]){_0x5a84c1[_0x5371('0x40')]=[{'all':!![]}];}return db[_0x5371('0x2b')][_0x5371('0x41')](_0x5a84c1);})[_0x5371('0x27')](function(_0x47f7fd){_0x32554f[_0x5371('0x42')]=_0x47f7fd;return _0x32554f;})[_0x5371('0x27')](respondWithFilteredResult(_0x167280,_0x5a84c1))[_0x5371('0x43')](handleError(_0x167280,null));};exports[_0x5371('0x44')]=function(_0x454985,_0x331087){var _0x4db26a={'raw':!![],'where':{'id':_0x454985['params']['id']}},_0x29d7ac={};_0x29d7ac['model']=_[_0x5371('0x45')](db['SquareDetailsReport']['rawAttributes']);_0x29d7ac['query']=_[_0x5371('0x45')](_0x454985[_0x5371('0x30')]);_0x29d7ac[_0x5371('0x31')]=_['intersection'](_0x29d7ac[_0x5371('0x33')],_0x29d7ac[_0x5371('0x30')]);_0x4db26a['attributes']=_['intersection'](_0x29d7ac[_0x5371('0x33')],qs[_0x5371('0x35')](_0x454985[_0x5371('0x30')][_0x5371('0x35')]));_0x4db26a['attributes']=_0x4db26a['attributes']['length']?_0x4db26a['attributes']:_0x29d7ac['model'];if(_0x454985[_0x5371('0x30')]['includeAll']){_0x4db26a[_0x5371('0x40')]=[{'all':!![]}];}_0x4db26a=_['merge']({},_0x4db26a,_0x454985[_0x5371('0x46')]);return db[_0x5371('0x2b')][_0x5371('0x47')](_0x4db26a)[_0x5371('0x27')](handleEntityNotFound(_0x331087,null))['then'](respondWithResult(_0x331087,null))[_0x5371('0x43')](handleError(_0x331087,null));};exports[_0x5371('0x48')]=function(_0x5efa09,_0x389bb8){return db[_0x5371('0x2b')]['create'](_0x5efa09[_0x5371('0x49')],{})['then'](respondWithResult(_0x389bb8,0xc9))['catch'](handleError(_0x389bb8,null));};exports[_0x5371('0x26')]=function(_0x179163,_0x2daa6e){if(_0x179163[_0x5371('0x49')]['id']){delete _0x179163[_0x5371('0x49')]['id'];}return db[_0x5371('0x2b')][_0x5371('0x47')]({'where':{'id':_0x179163['params']['id']}})[_0x5371('0x27')](handleEntityNotFound(_0x2daa6e,null))[_0x5371('0x27')](saveUpdates(_0x179163[_0x5371('0x49')],null))['then'](respondWithResult(_0x2daa6e,null))['catch'](handleError(_0x2daa6e,null));};exports[_0x5371('0x4a')]=function(_0x334b29,_0x5e39d2){return db[_0x5371('0x2b')]['find']({'where':{'id':_0x334b29[_0x5371('0x4b')]['id']}})[_0x5371('0x27')](handleEntityNotFound(_0x5e39d2,null))[_0x5371('0x27')](removeEntity(_0x5e39d2,null))[_0x5371('0x43')](handleError(_0x5e39d2,null));};exports['describe']=function(_0x3c75b5,_0x4f9227){return db['SquareDetailsReport'][_0x5371('0x4c')]()[_0x5371('0x27')](respondWithResult(_0x4f9227,null))[_0x5371('0x43')](handleError(_0x4f9227,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index db42cb1..df8b583 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 _0xbfe8=['bluebird','path','rimraf','../../config/environment','exports','define','SquareDetailsReport','util','../../config/logger','api','moment'];(function(_0x41397b,_0x481d0e){var _0x5f4677=function(_0x4a0b5b){while(--_0x4a0b5b){_0x41397b['push'](_0x41397b['shift']());}};_0x5f4677(++_0x481d0e);}(_0xbfe8,0xac));var _0x8bfe=function(_0x455646,_0x415e4f){_0x455646=_0x455646-0x0;var _0x3e04c1=_0xbfe8[_0x455646];return _0x3e04c1;};'use strict';var _=require('lodash');var util=require(_0x8bfe('0x0'));var logger=require(_0x8bfe('0x1'))(_0x8bfe('0x2'));var moment=require(_0x8bfe('0x3'));var BPromise=require(_0x8bfe('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8bfe('0x5'));var rimraf=require(_0x8bfe('0x6'));var config=require(_0x8bfe('0x7'));var attributes=require('./squareReportDetail.attributes');module[_0x8bfe('0x8')]=function(_0x3642cb,_0x58ca39){return _0x3642cb[_0x8bfe('0x9')](_0x8bfe('0xa'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd508=['report_square_details','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports','define','SquareDetailsReport'];(function(_0x2f8804,_0x5cb555){var _0x50eb9e=function(_0x373ad4){while(--_0x373ad4){_0x2f8804['push'](_0x2f8804['shift']());}};_0x50eb9e(++_0x5cb555);}(_0xd508,0x145));var _0x8d50=function(_0x8d2a71,_0x13618e){_0x8d2a71=_0x8d2a71-0x0;var _0x36ba8c=_0xd508[_0x8d2a71];return _0x36ba8c;};'use strict';var _=require(_0x8d50('0x0'));var util=require(_0x8d50('0x1'));var logger=require(_0x8d50('0x2'))(_0x8d50('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8d50('0x4'));var fs=require('fs');var path=require(_0x8d50('0x5'));var rimraf=require(_0x8d50('0x6'));var config=require(_0x8d50('0x7'));var attributes=require('./squareReportDetail.attributes');module[_0x8d50('0x8')]=function(_0x15a140,_0x61f4af){return _0x15a140[_0x8d50('0x9')](_0x8d50('0xa'),attributes,{'tableName':_0x8d50('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 548bd81..935bd8d 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 _0x0598=['catch','CreateSquareDetailsReport','SquareDetailsReport','body','options','then','lodash','util','bluebird','../../mysqldb','../../config/utils','jayson/promise','client','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x3b0620,_0x120d31){var _0x25ec1b=function(_0x138188){while(--_0x138188){_0x3b0620['push'](_0x3b0620['shift']());}};_0x25ec1b(++_0x120d31);}(_0x0598,0x92));var _0x8059=function(_0x199453,_0xeb3841){_0x199453=_0x199453-0x0;var _0x8ba115=_0x0598[_0x199453];return _0x8ba115;};'use strict';var _=require(_0x8059('0x0'));var util=require(_0x8059('0x1'));var moment=require('moment');var BPromise=require(_0x8059('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8059('0x3'))['db'];var utils=require(_0x8059('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x8059('0x5'));var client=jayson[_0x8059('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5996d7,_0x248273,_0x347f1b){return new BPromise(function(_0x4610d2,_0x116946){return client['request'](_0x5996d7,_0x347f1b)['then'](function(_0x89dda1){logger[_0x8059('0x7')](_0x8059('0x8'),_0x248273,_0x8059('0x9'));logger[_0x8059('0xa')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x248273,'request\x20sent',JSON[_0x8059('0xb')](_0x89dda1));if(_0x89dda1[_0x8059('0xc')]){if(_0x89dda1['error']['code']===0x1f4){logger['error'](_0x8059('0x8'),_0x248273,_0x89dda1[_0x8059('0xc')][_0x8059('0xd')]);return _0x116946(_0x89dda1[_0x8059('0xc')][_0x8059('0xd')]);}logger['error'](_0x8059('0x8'),_0x248273,_0x89dda1['error'][_0x8059('0xd')]);return _0x4610d2(_0x89dda1['error'][_0x8059('0xd')]);}else{logger[_0x8059('0x7')](_0x8059('0x8'),_0x248273,'request\x20sent');_0x4610d2(_0x89dda1['result']['message']);}})[_0x8059('0xe')](function(_0x239195){logger[_0x8059('0xc')](_0x8059('0x8'),_0x248273,_0x239195);_0x116946(_0x239195);});});}exports[_0x8059('0xf')]=function(_0x4b6d55){var _0x10ad98=this;return new Promise(function(_0x2bb670,_0x37e926){return db[_0x8059('0x10')]['create'](_0x4b6d55[_0x8059('0x11')],{'raw':_0x4b6d55['options']?_0x4b6d55[_0x8059('0x12')]['raw']===undefined?!![]:![]:!![]})[_0x8059('0x13')](function(_0x56d794){logger[_0x8059('0x7')](_0x8059('0xf'),_0x4b6d55);logger[_0x8059('0xa')]('CreateSquareDetailsReport',_0x4b6d55,JSON['stringify'](_0x56d794));_0x2bb670(_0x56d794);})[_0x8059('0xe')](function(_0x232f1b){logger[_0x8059('0xc')](_0x8059('0xf'),_0x232f1b['message'],_0x4b6d55);_0x37e926(_0x10ad98[_0x8059('0xc')](0x1f4,_0x232f1b[_0x8059('0xd')]));});});}; \ No newline at end of file +var _0x5c3c=['SquareDetailsReport','create','body','options','raw','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateSquareDetailsReport'];(function(_0x4527e5,_0x2d313f){var _0x230365=function(_0x548ec0){while(--_0x548ec0){_0x4527e5['push'](_0x4527e5['shift']());}};_0x230365(++_0x2d313f);}(_0x5c3c,0x132));var _0xc5c3=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x5c3c[_0xd1d19a];return _0x52a79d;};'use strict';var _=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var moment=require(_0xc5c3('0x2'));var BPromise=require(_0xc5c3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc5c3('0x4'));var db=require(_0xc5c3('0x5'))['db'];var utils=require(_0xc5c3('0x6'));var logger=require(_0xc5c3('0x7'))(_0xc5c3('0x8'));var config=require(_0xc5c3('0x9'));var jayson=require(_0xc5c3('0xa'));var client=jayson[_0xc5c3('0xb')][_0xc5c3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a392b,_0x4b8404,_0x591f7d){return new BPromise(function(_0x723c31,_0x522be1){return client['request'](_0x5a392b,_0x591f7d)[_0xc5c3('0xd')](function(_0x46e2c1){logger['info'](_0xc5c3('0xe'),_0x4b8404,_0xc5c3('0xf'));logger['debug'](_0xc5c3('0x10'),_0x4b8404,_0xc5c3('0xf'),JSON[_0xc5c3('0x11')](_0x46e2c1));if(_0x46e2c1['error']){if(_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x13')]===0x1f4){logger['error'](_0xc5c3('0xe'),_0x4b8404,_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x14')]);return _0x522be1(_0x46e2c1['error'][_0xc5c3('0x14')]);}logger[_0xc5c3('0x12')](_0xc5c3('0xe'),_0x4b8404,_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x14')]);return _0x723c31(_0x46e2c1['error']['message']);}else{logger[_0xc5c3('0x15')](_0xc5c3('0xe'),_0x4b8404,_0xc5c3('0xf'));_0x723c31(_0x46e2c1[_0xc5c3('0x16')]['message']);}})['catch'](function(_0x467ba9){logger['error'](_0xc5c3('0xe'),_0x4b8404,_0x467ba9);_0x522be1(_0x467ba9);});});}exports[_0xc5c3('0x17')]=function(_0x2ff158){var _0x13c867=this;return new Promise(function(_0x28bae6,_0x5e11d5){return db[_0xc5c3('0x18')][_0xc5c3('0x19')](_0x2ff158[_0xc5c3('0x1a')],{'raw':_0x2ff158[_0xc5c3('0x1b')]?_0x2ff158['options'][_0xc5c3('0x1c')]===undefined?!![]:![]:!![]})[_0xc5c3('0xd')](function(_0x3cc612){logger[_0xc5c3('0x15')](_0xc5c3('0x17'),_0x2ff158);logger['debug'](_0xc5c3('0x17'),_0x2ff158,JSON[_0xc5c3('0x11')](_0x3cc612));_0x28bae6(_0x3cc612);})[_0xc5c3('0x1d')](function(_0x2de266){logger[_0xc5c3('0x12')](_0xc5c3('0x17'),_0x2de266[_0xc5c3('0x14')],_0x2ff158);_0x5e11d5(_0x13c867['error'](0x1f4,_0x2de266['message']));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 7cf9934..a7054b1 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 _0x5a1b=['exports','express','Router','../../components/auth/service','./system.controller','isAuthenticated','index','get','/process/:pid/kill','killProcess'];(function(_0x3f7ab5,_0x4bcbfd){var _0x5bb8c7=function(_0x219d1d){while(--_0x219d1d){_0x3f7ab5['push'](_0x3f7ab5['shift']());}};_0x5bb8c7(++_0x4bcbfd);}(_0x5a1b,0xdd));var _0xb5a1=function(_0x5acc36,_0x41f79c){_0x5acc36=_0x5acc36-0x0;var _0x3966b4=_0x5a1b[_0x5acc36];return _0x3966b4;};'use strict';var express=require(_0xb5a1('0x0'));var router=express[_0xb5a1('0x1')]();var auth=require(_0xb5a1('0x2'));var controller=require(_0xb5a1('0x3'));router['get']('/',auth[_0xb5a1('0x4')](),controller[_0xb5a1('0x5')]);router[_0xb5a1('0x6')](_0xb5a1('0x7'),auth['isAuthenticated'](),controller[_0xb5a1('0x8')]);module[_0xb5a1('0x9')]=router; \ No newline at end of file +var _0xf685=['index','get','/process/:pid/kill','killProcess','exports','express','Router','./system.controller'];(function(_0x5f0869,_0x2b643c){var _0x5c5ef2=function(_0x856497){while(--_0x856497){_0x5f0869['push'](_0x5f0869['shift']());}};_0x5c5ef2(++_0x2b643c);}(_0xf685,0xdd));var _0x5f68=function(_0x598217,_0x1dd4cc){_0x598217=_0x598217-0x0;var _0x3907be=_0xf685[_0x598217];return _0x3907be;};'use strict';var express=require(_0x5f68('0x0'));var router=express[_0x5f68('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x5f68('0x2'));router['get']('/',auth['isAuthenticated'](),controller[_0x5f68('0x3')]);router[_0x5f68('0x4')](_0x5f68('0x5'),auth['isAuthenticated'](),controller[_0x5f68('0x6')]);module[_0x5f68('0x7')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 6fdd8b8..5f50fde 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 _0x3246=['child_process','../../config/logger','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','status','send','index','getAllData','then','json','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','indexOf','format','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','systeminformation'];(function(_0x20e7ed,_0x40b618){var _0x1982cb=function(_0xf72af9){while(--_0xf72af9){_0x20e7ed['push'](_0x20e7ed['shift']());}};_0x1982cb(++_0x40b618);}(_0x3246,0x9b));var _0x6324=function(_0x644925,_0xbf317d){_0x644925=_0x644925-0x0;var _0x49cda8=_0x3246[_0x644925];return _0x49cda8;};'use strict';var info=require(_0x6324('0x0'));var exec=require(_0x6324('0x1'))['exec'];var logger=require(_0x6324('0x2'))('api');var util=require('util');var BPromise=require('bluebird');var _=require(_0x6324('0x3'));function handleError(_0x18472c,_0x416a29,_0x1fcf64){_0x416a29=_0x416a29||0x1f4;return function(_0x345df6){logger[_0x6324('0x4')](_0x6324('0x5'),_0x1fcf64,_0x416a29,util['inspect'](_0x345df6,{'showHidden':![],'depth':null}));delete _0x345df6[_0x6324('0x6')];_0x18472c[_0x6324('0x7')](_0x416a29)[_0x6324('0x8')](_0x345df6);};}exports[_0x6324('0x9')]=function(_0x4dea95,_0x3a7ca1){return info[_0x6324('0xa')]()[_0x6324('0xb')](function(_0x420983){return _0x3a7ca1[_0x6324('0x7')](0xc8)['json'](_0x420983);})['catch'](function(_0x9b797b){return _0x3a7ca1['status'](0x1f4)[_0x6324('0xc')](_0x9b797b);});};exports['killProcess']=function(_0x6b2b7a,_0x4f74e2){var _0x316d4a=[_0x6324('0xd')];return new BPromise(function(_0x1fd867,_0x19435d){return exec(util['format'](_0x6324('0xe'),_0x6b2b7a[_0x6324('0xf')][_0x6324('0x10')]),function(_0x533316,_0x82eb46,_0x5c4d4a){if(_0x533316){return _0x19435d(_0x533316);}return _0x1fd867(_0x82eb46);});})[_0x6324('0xb')](function(_0xce98e0){var _0x327435=![];var _0x929f96=_0xce98e0[_0x6324('0x11')](/\n/);for(var _0x175d4b=0x0,_0x3d2b9f=_0x316d4a[_0x6324('0x12')];_0x175d4b<_0x3d2b9f,_0x327435===![];_0x175d4b+=0x1){if(_0xce98e0[_0x6324('0x13')](_0x316d4a[_0x175d4b])>=0x0){_0x327435=!![];}}if(!_0x327435){throw new Error(util[_0x6324('0x14')](_0x6324('0x15'),_0x6b2b7a[_0x6324('0xf')][_0x6324('0x10')]));}process[_0x6324('0x16')](_0x6b2b7a[_0x6324('0xf')][_0x6324('0x10')],_0x6324('0x17'));return _0x4f74e2[_0x6324('0x7')](0xc8)[_0x6324('0xc')]({'message':util[_0x6324('0x14')](_0x6324('0x18'),_0x6b2b7a['params'][_0x6324('0x10')])});})[_0x6324('0x19')](handleError(_0x4f74e2,null,'killProcess'));}; \ No newline at end of file +var _0x398a=['util','bluebird','lodash','inspect','name','status','send','index','getAllData','then','json','killProcess','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','split','indexOf','format','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','../../config/logger','api'];(function(_0x35b127,_0x3d84d0){var _0x4ba5a4=function(_0x5ef031){while(--_0x5ef031){_0x35b127['push'](_0x35b127['shift']());}};_0x4ba5a4(++_0x3d84d0);}(_0x398a,0x7d));var _0xa398=function(_0x9853d5,_0x53cd0c){_0x9853d5=_0x9853d5-0x0;var _0x77d871=_0x398a[_0x9853d5];return _0x77d871;};'use strict';var info=require(_0xa398('0x0'));var exec=require(_0xa398('0x1'))[_0xa398('0x2')];var logger=require(_0xa398('0x3'))(_0xa398('0x4'));var util=require(_0xa398('0x5'));var BPromise=require(_0xa398('0x6'));var _=require(_0xa398('0x7'));function handleError(_0x20eeb9,_0x5ecae5,_0x5c00c8){_0x5ecae5=_0x5ecae5||0x1f4;return function(_0x3f9532){logger['error']('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x5c00c8,_0x5ecae5,util[_0xa398('0x8')](_0x3f9532,{'showHidden':![],'depth':null}));delete _0x3f9532[_0xa398('0x9')];_0x20eeb9[_0xa398('0xa')](_0x5ecae5)[_0xa398('0xb')](_0x3f9532);};}exports[_0xa398('0xc')]=function(_0x4deacd,_0x223eff){return info[_0xa398('0xd')]()[_0xa398('0xe')](function(_0x8cd227){return _0x223eff[_0xa398('0xa')](0xc8)[_0xa398('0xf')](_0x8cd227);})['catch'](function(_0x5dbcb7){return _0x223eff[_0xa398('0xa')](0x1f4)[_0xa398('0xf')](_0x5dbcb7);});};exports[_0xa398('0x10')]=function(_0x3ad3dc,_0x2f4935){var _0x41115a=['components/import/cm'];return new BPromise(function(_0x27dc1e,_0x14ef05){return exec(util['format'](_0xa398('0x11'),_0x3ad3dc[_0xa398('0x12')]['pid']),function(_0x510bf9,_0x49bf48,_0xa81658){if(_0x510bf9){return _0x14ef05(_0x510bf9);}return _0x27dc1e(_0x49bf48);});})['then'](function(_0xacca4b){var _0x923adc=![];var _0x5696fd=_0xacca4b[_0xa398('0x13')](/\n/);for(var _0x6ee48c=0x0,_0x7eb8ec=_0x41115a['length'];_0x6ee48c<_0x7eb8ec,_0x923adc===![];_0x6ee48c+=0x1){if(_0xacca4b[_0xa398('0x14')](_0x41115a[_0x6ee48c])>=0x0){_0x923adc=!![];}}if(!_0x923adc){throw new Error(util[_0xa398('0x15')](_0xa398('0x16'),_0x3ad3dc[_0xa398('0x12')][_0xa398('0x17')]));}process[_0xa398('0x18')](_0x3ad3dc[_0xa398('0x12')][_0xa398('0x17')],'SIGINT');return _0x2f4935[_0xa398('0xa')](0xc8)[_0xa398('0xf')]({'message':util[_0xa398('0x15')](_0xa398('0x19'),_0x3ad3dc[_0xa398('0x12')][_0xa398('0x17')])});})['catch'](handleError(_0x2f4935,null,_0xa398('0x10')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 1e2da22..7f5b7c2 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 _0x17c1=['get','isAuthenticated','index','/:id','post','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5870d7,_0x193cae){var _0x58d22f=function(_0xbf024){while(--_0xbf024){_0x5870d7['push'](_0x5870d7['shift']());}};_0x58d22f(++_0x193cae);}(_0x17c1,0x184));var _0x117c=function(_0x1a2a69,_0x41b749){_0x1a2a69=_0x1a2a69-0x0;var _0xd965d8=_0x17c1[_0x1a2a69];return _0xd965d8;};'use strict';var multer=require(_0x117c('0x0'));var util=require(_0x117c('0x1'));var path=require('path');var timeout=require(_0x117c('0x2'));var express=require('express');var router=express[_0x117c('0x3')]();var fs_extra=require(_0x117c('0x4'));var auth=require(_0x117c('0x5'));var interaction=require(_0x117c('0x6'));var config=require(_0x117c('0x7'));var controller=require('./tag.controller');router[_0x117c('0x8')]('/',auth[_0x117c('0x9')](),controller[_0x117c('0xa')]);router[_0x117c('0x8')](_0x117c('0xb'),auth[_0x117c('0x9')](),controller['show']);router[_0x117c('0xc')]('/',auth[_0x117c('0x9')](),controller['create']);router[_0x117c('0xd')]('/:id',auth[_0x117c('0x9')](),controller[_0x117c('0xe')]);router[_0x117c('0xf')](_0x117c('0xb'),auth[_0x117c('0x9')](),controller[_0x117c('0x10')]);module[_0x117c('0x11')]=router; \ No newline at end of file +var _0x943d=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','show','post','put','/:id','update','delete'];(function(_0x5215e6,_0x14c378){var _0x145c9c=function(_0x5e274d){while(--_0x5e274d){_0x5215e6['push'](_0x5215e6['shift']());}};_0x145c9c(++_0x14c378);}(_0x943d,0x155));var _0xd943=function(_0x318410,_0x451962){_0x318410=_0x318410-0x0;var _0x2898a3=_0x943d[_0x318410];return _0x2898a3;};'use strict';var multer=require('multer');var util=require(_0xd943('0x0'));var path=require(_0xd943('0x1'));var timeout=require(_0xd943('0x2'));var express=require(_0xd943('0x3'));var router=express[_0xd943('0x4')]();var fs_extra=require(_0xd943('0x5'));var auth=require(_0xd943('0x6'));var interaction=require(_0xd943('0x7'));var config=require(_0xd943('0x8'));var controller=require(_0xd943('0x9'));router[_0xd943('0xa')]('/',auth[_0xd943('0xb')](),controller[_0xd943('0xc')]);router[_0xd943('0xa')]('/:id',auth[_0xd943('0xb')](),controller[_0xd943('0xd')]);router[_0xd943('0xe')]('/',auth[_0xd943('0xb')](),controller['create']);router[_0xd943('0xf')](_0xd943('0x10'),auth[_0xd943('0xb')](),controller[_0xd943('0x11')]);router[_0xd943('0x12')](_0xd943('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0xd943('0x13')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index fb37f14..195b351 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 _0xd71d=['name','sequelize','exports','STRING'];(function(_0x27ff13,_0x2477be){var _0x5265b1=function(_0x5c53d9){while(--_0x5c53d9){_0x27ff13['push'](_0x27ff13['shift']());}};_0x5265b1(++_0x2477be);}(_0xd71d,0x1a5));var _0xdd71=function(_0xd1a252,_0x16396f){_0xd1a252=_0xd1a252-0x0;var _0x560ee1=_0xd71d[_0xd1a252];return _0x560ee1;};'use strict';var Sequelize=require(_0xdd71('0x0'));module[_0xdd71('0x1')]={'name':{'type':Sequelize[_0xdd71('0x2')],'unique':_0xdd71('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xdd71('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0xdd71('0x2')]}}; \ No newline at end of file +var _0x75ea=['STRING','sequelize','exports','name'];(function(_0x4d0df5,_0x533668){var _0xb7d608=function(_0x568d8c){while(--_0x568d8c){_0x4d0df5['push'](_0x4d0df5['shift']());}};_0xb7d608(++_0x533668);}(_0x75ea,0x7d));var _0xa75e=function(_0x2dcd1f,_0x48e68d){_0x2dcd1f=_0x2dcd1f-0x0;var _0x21a7d4=_0x75ea[_0x2dcd1f];return _0x21a7d4;};'use strict';var Sequelize=require(_0xa75e('0x0'));module[_0xa75e('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xa75e('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xa75e('0x3')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0xa75e('0x3')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 4d07c40..eb01411 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 _0x008c=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then','destroy','get','stack','name','index','map','Tag','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x16ab58,_0x591ef3){var _0x33f05f=function(_0x42f89e){while(--_0x42f89e){_0x16ab58['push'](_0x16ab58['shift']());}};_0x33f05f(++_0x591ef3);}(_0x008c,0x188));var _0xc008=function(_0x371ac2,_0xc5961c){_0x371ac2=_0x371ac2-0x0;var _0x37d93d=_0x008c[_0x371ac2];return _0x37d93d;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){var _0x2e3cfb=_0x58a6ea[_0xc008('0x23')]({'plain':!![]});var _0x5410f5='Tags';return db['UserProfileResource'][_0xc008('0x22')]({'where':{'type':_0x5410f5,'resourceId':_0x2e3cfb['id']}})[_0xc008('0x21')](function(){return _0x58a6ea;});})[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e2aca,_0x4fce9c){return function(_0x4adbab){if(!_0x4adbab){_0x5e2aca['sendStatus'](0x194);}return _0x4adbab;};}function handleError(_0x3865c0,_0x29ba43){_0x29ba43=_0x29ba43||0x1f4;return function(_0x25eae4){logger['error'](_0x25eae4[_0xc008('0x24')]);if(_0x25eae4[_0xc008('0x25')]){delete _0x25eae4[_0xc008('0x25')];}_0x3865c0[_0xc008('0x19')](_0x29ba43)['send'](_0x25eae4);};}exports[_0xc008('0x26')]=function(_0x2e0b4e,_0x53ed35){var _0x58db82={},_0x539766={},_0x1032b2={'count':0x0,'rows':[]};var _0x267abd=_[_0xc008('0x27')](db[_0xc008('0x28')][_0xc008('0x29')],function(_0xceebc3){return{'name':_0xceebc3[_0xc008('0x2a')],'type':_0xceebc3[_0xc008('0x2b')][_0xc008('0x2c')]};});_0x539766[_0xc008('0x2d')]=_[_0xc008('0x27')](_0x267abd,_0xc008('0x25'));_0x539766['query']=_[_0xc008('0x2e')](_0x2e0b4e[_0xc008('0x2f')]);_0x539766['filters']=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],_0x539766[_0xc008('0x2f')]);_0x58db82[_0xc008('0x31')]=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x32')]));_0x58db82['attributes']=_0x58db82[_0xc008('0x31')][_0xc008('0x33')]?_0x58db82[_0xc008('0x31')]:_0x539766[_0xc008('0x2d')];if(!_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x34')](_0xc008('0x35'))){_0x58db82['limit']=qs[_0xc008('0x1d')](_0x2e0b4e[_0xc008('0x2f')]['limit']);_0x58db82[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x2e0b4e['query'][_0xc008('0x1b')]);}_0x58db82[_0xc008('0x36')]=qs[_0xc008('0x37')](_0x2e0b4e['query']['sort']);_0x58db82['where']=qs[_0xc008('0x38')](_['pick'](_0x2e0b4e[_0xc008('0x2f')],_0x539766[_0xc008('0x38')]),_0x267abd);if(_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x39')]){_0x58db82[_0xc008('0x3a')]=_[_0xc008('0x3b')](_0x58db82[_0xc008('0x3a')],{'$or':_[_0xc008('0x27')](_0x267abd,function(_0xffd2b3){if(_0xffd2b3[_0xc008('0x2b')]!==_0xc008('0x3c')){var _0xdfca2e={};_0xdfca2e[_0xffd2b3[_0xc008('0x25')]]={'$like':'%'+_0x2e0b4e[_0xc008('0x2f')]['filter']+'%'};return _0xdfca2e;}})});}_0x58db82=_[_0xc008('0x3b')]({},_0x58db82,_0x2e0b4e[_0xc008('0x3d')]);var _0x30b7df={'where':_0x58db82[_0xc008('0x3a')]};return db['Tag'][_0xc008('0x1e')](_0x30b7df)[_0xc008('0x21')](function(_0xc8cb91){_0x1032b2[_0xc008('0x1e')]=_0xc8cb91;if(_0x2e0b4e[_0xc008('0x2f')]['includeAll']){_0x58db82[_0xc008('0x3e')]=[{'all':!![]}];}return db[_0xc008('0x28')][_0xc008('0x3f')](_0x58db82);})[_0xc008('0x21')](function(_0x7279e8){_0x1032b2['rows']=_0x7279e8;return _0x1032b2;})[_0xc008('0x21')](respondWithFilteredResult(_0x53ed35,_0x58db82))[_0xc008('0x40')](handleError(_0x53ed35,null));};exports[_0xc008('0x41')]=function(_0x408192,_0x4b80f3){var _0x26cd05={'raw':!![],'where':{'id':_0x408192[_0xc008('0x42')]['id']}},_0xe37446={};_0xe37446['model']=_[_0xc008('0x2e')](db['Tag'][_0xc008('0x29')]);_0xe37446['query']=_[_0xc008('0x2e')](_0x408192[_0xc008('0x2f')]);_0xe37446['filters']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],_0xe37446[_0xc008('0x2f')]);_0x26cd05['attributes']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x408192[_0xc008('0x2f')][_0xc008('0x32')]));_0x26cd05[_0xc008('0x31')]=_0x26cd05['attributes']['length']?_0x26cd05['attributes']:_0xe37446[_0xc008('0x2d')];if(_0x408192[_0xc008('0x2f')][_0xc008('0x43')]){_0x26cd05[_0xc008('0x3e')]=[{'all':!![]}];}_0x26cd05=_[_0xc008('0x3b')]({},_0x26cd05,_0x408192[_0xc008('0x3d')]);return db[_0xc008('0x28')][_0xc008('0x44')](_0x26cd05)['then'](handleEntityNotFound(_0x4b80f3,null))['then'](respondWithResult(_0x4b80f3,null))['catch'](handleError(_0x4b80f3,null));};exports[_0xc008('0x45')]=function(_0x2651cf,_0x158eae){return db['Tag'][_0xc008('0x45')](_0x2651cf[_0xc008('0x46')],{})[_0xc008('0x21')](function(_0x1c2c50){var _0x4981b4=_0x2651cf[_0xc008('0x47')][_0xc008('0x23')]({'plain':!![]});if(!_0x4981b4)throw new Error(_0xc008('0x48'));if(_0x4981b4[_0xc008('0x49')]===_0xc008('0x47')){var _0x52c444=_0x1c2c50['get']({'plain':!![]});var _0x223056='Tags';return db[_0xc008('0x4a')][_0xc008('0x44')]({'where':{'name':_0x223056,'userProfileId':_0x4981b4[_0xc008('0x4b')]},'raw':!![]})['then'](function(_0x144ab2){if(_0x144ab2&&_0x144ab2[_0xc008('0x4c')]===0x0){return db[_0xc008('0x4d')][_0xc008('0x45')]({'name':_0x52c444[_0xc008('0x25')],'resourceId':_0x52c444['id'],'type':_0x144ab2['name'],'sectionId':_0x144ab2['id']},{})[_0xc008('0x21')](function(){return _0x1c2c50;});}else{return _0x1c2c50;}})[_0xc008('0x40')](function(_0x4b4c6d){logger[_0xc008('0x4e')](_0xc008('0x4f'),_0x4b4c6d);throw _0x4b4c6d;});}return _0x1c2c50;})['then'](respondWithResult(_0x158eae,0xc9))['catch'](handleError(_0x158eae,null));};exports[_0xc008('0x20')]=function(_0xd47b74,_0x20947b){if(_0xd47b74[_0xc008('0x46')]['id']){delete _0xd47b74[_0xc008('0x46')]['id'];}return db['Tag']['find']({'where':{'id':_0xd47b74[_0xc008('0x42')]['id']}})['then'](handleEntityNotFound(_0x20947b,null))[_0xc008('0x21')](saveUpdates(_0xd47b74[_0xc008('0x46')],null))[_0xc008('0x21')](respondWithResult(_0x20947b,null))[_0xc008('0x40')](handleError(_0x20947b,null));};exports[_0xc008('0x22')]=function(_0x27a167,_0x49d8b0){return db[_0xc008('0x28')][_0xc008('0x44')]({'where':{'id':_0x27a167[_0xc008('0x42')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x49d8b0,null))[_0xc008('0x21')](removeEntity(_0x49d8b0,null))['catch'](handleError(_0x49d8b0,null));}; \ No newline at end of file +var _0x9649=['find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','get','Tags','UserProfileResource','end','error','stack','name','send','index','map','Tag','rawAttributes','fieldName','type','key','keys','query','filters','intersection','attributes','fields','length','model','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','show','params','includeAll'];(function(_0x35e0af,_0x395c27){var _0x299b90=function(_0x240028){while(--_0x240028){_0x35e0af['push'](_0x35e0af['shift']());}};_0x299b90(++_0x395c27);}(_0x9649,0x19f));var _0x9964=function(_0x48d299,_0x567bf8){_0x48d299=_0x48d299-0x0;var _0x2e0ae4=_0x9649[_0x48d299];return _0x2e0ae4;};'use strict';var emlformat=require(_0x9964('0x0'));var rimraf=require(_0x9964('0x1'));var zipdir=require(_0x9964('0x2'));var jsonpatch=require(_0x9964('0x3'));var rp=require('request-promise');var moment=require(_0x9964('0x4'));var BPromise=require(_0x9964('0x5'));var Mustache=require('mustache');var util=require(_0x9964('0x6'));var path=require('path');var sox=require(_0x9964('0x7'));var csv=require(_0x9964('0x8'));var ejs=require(_0x9964('0x9'));var fs=require('fs');var fs_extra=require(_0x9964('0xa'));var _=require(_0x9964('0xb'));var squel=require(_0x9964('0xc'));var crypto=require(_0x9964('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9964('0xe'));var toCsv=require(_0x9964('0x8'));var querystring=require('querystring');var Papa=require(_0x9964('0xf'));var Redis=require(_0x9964('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9964('0x11'));var hardwareService=require(_0x9964('0x12'));var logger=require(_0x9964('0x13'))(_0x9964('0x14'));var utils=require(_0x9964('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9964('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56a69d,_0x39c624){_0x39c624=_0x39c624||0xcc;return function(_0x547b98){if(_0x547b98){return _0x56a69d[_0x9964('0x17')](_0x39c624);}return _0x56a69d[_0x9964('0x18')](_0x39c624)['end']();};}function respondWithResult(_0x1fd4b4,_0x463dbf){_0x463dbf=_0x463dbf||0xc8;return function(_0x11dfc9){if(_0x11dfc9){return _0x1fd4b4[_0x9964('0x18')](_0x463dbf)[_0x9964('0x19')](_0x11dfc9);}};}function respondWithFilteredResult(_0x5f002e,_0x411544){return function(_0x226e78){if(_0x226e78){var _0x57b330=typeof _0x411544[_0x9964('0x1a')]===_0x9964('0x1b')&&typeof _0x411544['limit']===_0x9964('0x1b');var _0x2e7e07=_0x226e78[_0x9964('0x1c')];var _0x4c18a4=_0x57b330?0x0:_0x411544['offset'];var _0x40b3dd=_0x57b330?_0x226e78[_0x9964('0x1c')]:_0x411544['offset']+_0x411544[_0x9964('0x1d')];var _0x3f6472;if(_0x40b3dd>=_0x2e7e07){_0x40b3dd=_0x2e7e07;_0x3f6472=0xc8;}else{_0x3f6472=0xce;}_0x5f002e[_0x9964('0x18')](_0x3f6472);return _0x5f002e[_0x9964('0x1e')](_0x9964('0x1f'),_0x4c18a4+'-'+_0x40b3dd+'/'+_0x2e7e07)[_0x9964('0x19')](_0x226e78);}return null;};}function patchUpdates(_0x400bb5){return function(_0x414649){try{jsonpatch[_0x9964('0x20')](_0x414649,_0x400bb5,!![]);}catch(_0xbd5197){return BPromise['reject'](_0xbd5197);}return _0x414649[_0x9964('0x21')]();};}function saveUpdates(_0x447026,_0x4c479f){return function(_0x2b03a8){if(_0x2b03a8){return _0x2b03a8['update'](_0x447026)[_0x9964('0x22')](function(_0xdc3ba){return _0xdc3ba;});}return null;};}function removeEntity(_0x1c5e34,_0x167525){return function(_0x2d049c){if(_0x2d049c){return _0x2d049c[_0x9964('0x23')]()['then'](function(){var _0x452c96=_0x2d049c[_0x9964('0x24')]({'plain':!![]});var _0x5961e9=_0x9964('0x25');return db[_0x9964('0x26')][_0x9964('0x23')]({'where':{'type':_0x5961e9,'resourceId':_0x452c96['id']}})[_0x9964('0x22')](function(){return _0x2d049c;});})[_0x9964('0x22')](function(){_0x1c5e34['status'](0xcc)[_0x9964('0x27')]();});}};}function handleEntityNotFound(_0x4c2b44,_0x44cb60){return function(_0x512f6b){if(!_0x512f6b){_0x4c2b44[_0x9964('0x17')](0x194);}return _0x512f6b;};}function handleError(_0x5dc789,_0x432f81){_0x432f81=_0x432f81||0x1f4;return function(_0x162b83){logger[_0x9964('0x28')](_0x162b83[_0x9964('0x29')]);if(_0x162b83[_0x9964('0x2a')]){delete _0x162b83[_0x9964('0x2a')];}_0x5dc789[_0x9964('0x18')](_0x432f81)[_0x9964('0x2b')](_0x162b83);};}exports[_0x9964('0x2c')]=function(_0x58ce2c,_0x498014){var _0x5444a8={},_0x483092={},_0x36220b={'count':0x0,'rows':[]};var _0x31398d=_[_0x9964('0x2d')](db[_0x9964('0x2e')][_0x9964('0x2f')],function(_0x3092b2){return{'name':_0x3092b2[_0x9964('0x30')],'type':_0x3092b2[_0x9964('0x31')][_0x9964('0x32')]};});_0x483092['model']=_[_0x9964('0x2d')](_0x31398d,_0x9964('0x2a'));_0x483092['query']=_[_0x9964('0x33')](_0x58ce2c[_0x9964('0x34')]);_0x483092[_0x9964('0x35')]=_[_0x9964('0x36')](_0x483092['model'],_0x483092['query']);_0x5444a8[_0x9964('0x37')]=_['intersection'](_0x483092['model'],qs[_0x9964('0x38')](_0x58ce2c[_0x9964('0x34')]['fields']));_0x5444a8['attributes']=_0x5444a8[_0x9964('0x37')][_0x9964('0x39')]?_0x5444a8['attributes']:_0x483092[_0x9964('0x3a')];if(!_0x58ce2c['query']['hasOwnProperty']('nolimit')){_0x5444a8[_0x9964('0x1d')]=qs[_0x9964('0x1d')](_0x58ce2c[_0x9964('0x34')][_0x9964('0x1d')]);_0x5444a8[_0x9964('0x1a')]=qs[_0x9964('0x1a')](_0x58ce2c[_0x9964('0x34')][_0x9964('0x1a')]);}_0x5444a8[_0x9964('0x3b')]=qs['sort'](_0x58ce2c[_0x9964('0x34')][_0x9964('0x3c')]);_0x5444a8[_0x9964('0x3d')]=qs[_0x9964('0x35')](_['pick'](_0x58ce2c['query'],_0x483092[_0x9964('0x35')]),_0x31398d);if(_0x58ce2c[_0x9964('0x34')][_0x9964('0x3e')]){_0x5444a8[_0x9964('0x3d')]=_[_0x9964('0x3f')](_0x5444a8['where'],{'$or':_[_0x9964('0x2d')](_0x31398d,function(_0xca740f){if(_0xca740f[_0x9964('0x31')]!==_0x9964('0x40')){var _0x24d5d9={};_0x24d5d9[_0xca740f[_0x9964('0x2a')]]={'$like':'%'+_0x58ce2c[_0x9964('0x34')][_0x9964('0x3e')]+'%'};return _0x24d5d9;}})});}_0x5444a8=_[_0x9964('0x3f')]({},_0x5444a8,_0x58ce2c[_0x9964('0x41')]);var _0x12e696={'where':_0x5444a8[_0x9964('0x3d')]};return db[_0x9964('0x2e')][_0x9964('0x1c')](_0x12e696)[_0x9964('0x22')](function(_0x2f625e){_0x36220b['count']=_0x2f625e;if(_0x58ce2c[_0x9964('0x34')]['includeAll']){_0x5444a8[_0x9964('0x42')]=[{'all':!![]}];}return db[_0x9964('0x2e')][_0x9964('0x43')](_0x5444a8);})['then'](function(_0xf4a80e){_0x36220b['rows']=_0xf4a80e;return _0x36220b;})[_0x9964('0x22')](respondWithFilteredResult(_0x498014,_0x5444a8))['catch'](handleError(_0x498014,null));};exports[_0x9964('0x44')]=function(_0x4ad7a6,_0x46b64b){var _0x21b810={'raw':!![],'where':{'id':_0x4ad7a6[_0x9964('0x45')]['id']}},_0x121059={};_0x121059[_0x9964('0x3a')]=_[_0x9964('0x33')](db['Tag'][_0x9964('0x2f')]);_0x121059[_0x9964('0x34')]=_[_0x9964('0x33')](_0x4ad7a6[_0x9964('0x34')]);_0x121059[_0x9964('0x35')]=_[_0x9964('0x36')](_0x121059[_0x9964('0x3a')],_0x121059[_0x9964('0x34')]);_0x21b810[_0x9964('0x37')]=_[_0x9964('0x36')](_0x121059['model'],qs['fields'](_0x4ad7a6[_0x9964('0x34')]['fields']));_0x21b810[_0x9964('0x37')]=_0x21b810['attributes']['length']?_0x21b810['attributes']:_0x121059[_0x9964('0x3a')];if(_0x4ad7a6[_0x9964('0x34')][_0x9964('0x46')]){_0x21b810['include']=[{'all':!![]}];}_0x21b810=_['merge']({},_0x21b810,_0x4ad7a6[_0x9964('0x41')]);return db['Tag'][_0x9964('0x47')](_0x21b810)[_0x9964('0x22')](handleEntityNotFound(_0x46b64b,null))[_0x9964('0x22')](respondWithResult(_0x46b64b,null))[_0x9964('0x48')](handleError(_0x46b64b,null));};exports[_0x9964('0x49')]=function(_0x5b0fa7,_0x521d03){return db[_0x9964('0x2e')][_0x9964('0x49')](_0x5b0fa7[_0x9964('0x4a')],{})[_0x9964('0x22')](function(_0x1c575b){var _0x506c24=_0x5b0fa7[_0x9964('0x4b')][_0x9964('0x24')]({'plain':!![]});if(!_0x506c24)throw new Error(_0x9964('0x4c'));if(_0x506c24['role']===_0x9964('0x4b')){var _0x2649cc=_0x1c575b[_0x9964('0x24')]({'plain':!![]});var _0x2e8dec=_0x9964('0x25');return db[_0x9964('0x4d')][_0x9964('0x47')]({'where':{'name':_0x2e8dec,'userProfileId':_0x506c24[_0x9964('0x4e')]},'raw':!![]})['then'](function(_0x67f068){if(_0x67f068&&_0x67f068['autoAssociation']===0x0){return db['UserProfileResource'][_0x9964('0x49')]({'name':_0x2649cc['name'],'resourceId':_0x2649cc['id'],'type':_0x67f068[_0x9964('0x2a')],'sectionId':_0x67f068['id']},{})[_0x9964('0x22')](function(){return _0x1c575b;});}else{return _0x1c575b;}})[_0x9964('0x48')](function(_0x4b9325){logger[_0x9964('0x28')](_0x9964('0x4f'),_0x4b9325);throw _0x4b9325;});}return _0x1c575b;})[_0x9964('0x22')](respondWithResult(_0x521d03,0xc9))[_0x9964('0x48')](handleError(_0x521d03,null));};exports[_0x9964('0x50')]=function(_0x454d97,_0x25db0d){if(_0x454d97[_0x9964('0x4a')]['id']){delete _0x454d97[_0x9964('0x4a')]['id'];}return db['Tag'][_0x9964('0x47')]({'where':{'id':_0x454d97['params']['id']}})[_0x9964('0x22')](handleEntityNotFound(_0x25db0d,null))[_0x9964('0x22')](saveUpdates(_0x454d97[_0x9964('0x4a')],null))['then'](respondWithResult(_0x25db0d,null))[_0x9964('0x48')](handleError(_0x25db0d,null));};exports[_0x9964('0x23')]=function(_0x238867,_0x375ad6){return db[_0x9964('0x2e')]['find']({'where':{'id':_0x238867[_0x9964('0x45')]['id']}})[_0x9964('0x22')](handleEntityNotFound(_0x375ad6,null))[_0x9964('0x22')](removeEntity(_0x375ad6,null))[_0x9964('0x48')](handleError(_0x375ad6,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 3f0664d..28fcde7 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 _0xb8b7=['./tag.attributes','define','Tag','tools_tags','bluebird','request-promise','path','../../config/environment'];(function(_0x120a91,_0xf61b4e){var _0x304101=function(_0x102885){while(--_0x102885){_0x120a91['push'](_0x120a91['shift']());}};_0x304101(++_0xf61b4e);}(_0xb8b7,0x114));var _0x7b8b=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xb8b7[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x7b8b('0x0'));var rp=require(_0x7b8b('0x1'));var fs=require('fs');var path=require(_0x7b8b('0x2'));var rimraf=require('rimraf');var config=require(_0x7b8b('0x3'));var attributes=require(_0x7b8b('0x4'));module['exports']=function(_0x58a059,_0x43e2b4){return _0x58a059[_0x7b8b('0x5')](_0x7b8b('0x6'),attributes,{'tableName':_0x7b8b('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb31c=['../../config/environment','./tag.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x54d812,_0x2c2aaf){var _0x5099e4=function(_0x605ead){while(--_0x605ead){_0x54d812['push'](_0x54d812['shift']());}};_0x5099e4(++_0x2c2aaf);}(_0xb31c,0x108));var _0xcb31=function(_0x3cb656,_0xaa47b4){_0x3cb656=_0x3cb656-0x0;var _0x290763=_0xb31c[_0x3cb656];return _0x290763;};'use strict';var _=require(_0xcb31('0x0'));var util=require(_0xcb31('0x1'));var logger=require(_0xcb31('0x2'))(_0xcb31('0x3'));var moment=require(_0xcb31('0x4'));var BPromise=require(_0xcb31('0x5'));var rp=require(_0xcb31('0x6'));var fs=require('fs');var path=require(_0xcb31('0x7'));var rimraf=require(_0xcb31('0x8'));var config=require(_0xcb31('0x9'));var attributes=require(_0xcb31('0xa'));module[_0xcb31('0xb')]=function(_0x485180,_0x29462d){return _0x485180[_0xcb31('0xc')]('Tag',attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 5e2058d..1021ff0 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 _0xb717=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','Tag,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','lodash','moment','randomstring','ioredis'];(function(_0xc0e25c,_0x217f81){var _0x15c9ef=function(_0x23a1fb){while(--_0x23a1fb){_0xc0e25c['push'](_0xc0e25c['shift']());}};_0x15c9ef(++_0x217f81);}(_0xb717,0x1b4));var _0x7b71=function(_0x2d9d77,_0x70f873){_0x2d9d77=_0x2d9d77-0x0;var _0x85f32b=_0xb717[_0x2d9d77];return _0x85f32b;};'use strict';var _=require(_0x7b71('0x0'));var util=require('util');var moment=require(_0x7b71('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b71('0x2'));var fs=require('fs');var Redis=require(_0x7b71('0x3'));var db=require(_0x7b71('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b71('0x5'))(_0x7b71('0x6'));var config=require(_0x7b71('0x7'));var jayson=require(_0x7b71('0x8'));var client=jayson[_0x7b71('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x217efe,_0x27b060,_0xd81a5c){return new BPromise(function(_0x4238f6,_0xc46853){return client['request'](_0x217efe,_0xd81a5c)[_0x7b71('0xa')](function(_0x3e13a1){logger['info'](_0x7b71('0xb'),_0x27b060,_0x7b71('0xc'));logger[_0x7b71('0xd')]('Tag,\x20%s,\x20%s,\x20%s',_0x27b060,_0x7b71('0xc'),JSON['stringify'](_0x3e13a1));if(_0x3e13a1[_0x7b71('0xe')]){if(_0x3e13a1['error'][_0x7b71('0xf')]===0x1f4){logger[_0x7b71('0xe')](_0x7b71('0xb'),_0x27b060,_0x3e13a1[_0x7b71('0xe')][_0x7b71('0x10')]);return _0xc46853(_0x3e13a1['error'][_0x7b71('0x10')]);}logger['error'](_0x7b71('0xb'),_0x27b060,_0x3e13a1[_0x7b71('0xe')]['message']);return _0x4238f6(_0x3e13a1[_0x7b71('0xe')][_0x7b71('0x10')]);}else{logger[_0x7b71('0x11')]('Tag,\x20%s,\x20%s',_0x27b060,'request\x20sent');_0x4238f6(_0x3e13a1[_0x7b71('0x12')][_0x7b71('0x10')]);}})[_0x7b71('0x13')](function(_0x1b5d57){logger['error'](_0x7b71('0xb'),_0x27b060,_0x1b5d57);_0xc46853(_0x1b5d57);});});} \ No newline at end of file +var _0x17ba=['code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x154354,_0x2077b3){var _0x2f0288=function(_0x2da7ec){while(--_0x2da7ec){_0x154354['push'](_0x154354['shift']());}};_0x2f0288(++_0x2077b3);}(_0x17ba,0xab));var _0xa17b=function(_0x14311c,_0x31105c){_0x14311c=_0x14311c-0x0;var _0xd3726e=_0x17ba[_0x14311c];return _0xd3726e;};'use strict';var _=require(_0xa17b('0x0'));var util=require(_0xa17b('0x1'));var moment=require('moment');var BPromise=require(_0xa17b('0x2'));var rs=require(_0xa17b('0x3'));var fs=require('fs');var Redis=require(_0xa17b('0x4'));var db=require(_0xa17b('0x5'))['db'];var utils=require(_0xa17b('0x6'));var logger=require(_0xa17b('0x7'))(_0xa17b('0x8'));var config=require(_0xa17b('0x9'));var jayson=require(_0xa17b('0xa'));var client=jayson[_0xa17b('0xb')][_0xa17b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2e3d43,_0x1957be,_0x57f9cd){return new BPromise(function(_0x2ca4d3,_0x17d1d2){return client[_0xa17b('0xd')](_0x2e3d43,_0x57f9cd)[_0xa17b('0xe')](function(_0x15bdfc){logger['info'](_0xa17b('0xf'),_0x1957be,_0xa17b('0x10'));logger[_0xa17b('0x11')](_0xa17b('0x12'),_0x1957be,_0xa17b('0x10'),JSON[_0xa17b('0x13')](_0x15bdfc));if(_0x15bdfc[_0xa17b('0x14')]){if(_0x15bdfc['error'][_0xa17b('0x15')]===0x1f4){logger[_0xa17b('0x14')](_0xa17b('0xf'),_0x1957be,_0x15bdfc['error'][_0xa17b('0x16')]);return _0x17d1d2(_0x15bdfc[_0xa17b('0x14')][_0xa17b('0x16')]);}logger[_0xa17b('0x14')]('Tag,\x20%s,\x20%s',_0x1957be,_0x15bdfc[_0xa17b('0x14')]['message']);return _0x2ca4d3(_0x15bdfc[_0xa17b('0x14')][_0xa17b('0x16')]);}else{logger['info'](_0xa17b('0xf'),_0x1957be,_0xa17b('0x10'));_0x2ca4d3(_0x15bdfc[_0xa17b('0x17')][_0xa17b('0x16')]);}})['catch'](function(_0x98a295){logger['error']('Tag,\x20%s,\x20%s',_0x1957be,_0x98a295);_0x17d1d2(_0x98a295);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index f46be99..00629e5 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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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 488354b..fe97631 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 _0xbaf0=['name','exports','STRING'];(function(_0x1793de,_0x4d7233){var _0x4f0309=function(_0x229ee7){while(--_0x229ee7){_0x1793de['push'](_0x1793de['shift']());}};_0x4f0309(++_0x4d7233);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'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 +var _0xb7e7=['STRING','sequelize'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0xb7e7,0x121));var _0x7b7e=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0xb7e7[_0x16d10f];return _0x50c823;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index a7a4618..4a41aa5 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 _0x6a48=['user','Queue:save','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','all','spread','removeAgents','Whatsapp','Queue:remove','TeamVoicePrefix','getAgents','pick','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./team.socket','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','update','then','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','Team','includeAll','include','findAll','catch','show','params','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Teams','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','QueryTypes','UserId','Sequelize','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','UserMailQueue','destroy','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','UserOpenchannelQueue','WhatsappQueueId','UserWhatsappQueue','UserVoicePrefix','VoicePrefixId','getQueues','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','addQueues','ids','removeQueues','remove','addAgents','isArray','Voice','Sms','Fax','Openchannel','through','penalty','QueueId','TeamVoiceQueue','User','findOrCreate','emit'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x6a48,0x1dc));var _0x86a4=function(_0x51693c,_0x130414){_0x51693c=_0x51693c-0x0;var _0x32f368=_0x6a48[_0x51693c];return _0x32f368;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x86a4('0x0'));var zipdir=require(_0x86a4('0x1'));var jsonpatch=require(_0x86a4('0x2'));var rp=require(_0x86a4('0x3'));var moment=require(_0x86a4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x86a4('0x5'));var util=require(_0x86a4('0x6'));var path=require(_0x86a4('0x7'));var sox=require(_0x86a4('0x8'));var csv=require(_0x86a4('0x9'));var ejs=require(_0x86a4('0xa'));var fs=require('fs');var fs_extra=require(_0x86a4('0xb'));var _=require(_0x86a4('0xc'));var squel=require('squel');var crypto=require(_0x86a4('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x86a4('0xe'));var toCsv=require(_0x86a4('0x9'));var querystring=require('querystring');var Papa=require(_0x86a4('0xf'));var Redis=require(_0x86a4('0x10'));var authService=require(_0x86a4('0x11'));var qs=require(_0x86a4('0x12'));var as=require(_0x86a4('0x13'));var hardwareService=require(_0x86a4('0x14'));var logger=require(_0x86a4('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x86a4('0x16'));var licenseUtil=require(_0x86a4('0x17'));var db=require(_0x86a4('0x18'))['db'];config[_0x86a4('0x19')]=_[_0x86a4('0x1a')](config[_0x86a4('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x86a4('0x1b'))(new Redis(config['redis']));require(_0x86a4('0x1c'))['register'](socket);function respondWithStatusCode(_0x4808c4,_0x54401e){_0x54401e=_0x54401e||0xcc;return function(_0x2fd94e){if(_0x2fd94e){return _0x4808c4[_0x86a4('0x1d')](_0x54401e);}return _0x4808c4[_0x86a4('0x1e')](_0x54401e)[_0x86a4('0x1f')]();};}function respondWithResult(_0x9cccad,_0x58d78c){_0x58d78c=_0x58d78c||0xc8;return function(_0x515765){if(_0x515765){return _0x9cccad[_0x86a4('0x1e')](_0x58d78c)[_0x86a4('0x20')](_0x515765);}};}function respondWithFilteredResult(_0x5b0787,_0x2393e3){return function(_0x3a1716){if(_0x3a1716){var _0x4a892c=typeof _0x2393e3[_0x86a4('0x21')]===_0x86a4('0x22')&&typeof _0x2393e3[_0x86a4('0x23')]===_0x86a4('0x22');var _0x5edffa=_0x3a1716[_0x86a4('0x24')];var _0x540ffa=_0x4a892c?0x0:_0x2393e3[_0x86a4('0x21')];var _0x17f439=_0x4a892c?_0x3a1716[_0x86a4('0x24')]:_0x2393e3['offset']+_0x2393e3[_0x86a4('0x23')];var _0x576346;if(_0x17f439>=_0x5edffa){_0x17f439=_0x5edffa;_0x576346=0xc8;}else{_0x576346=0xce;}_0x5b0787[_0x86a4('0x1e')](_0x576346);return _0x5b0787['set'](_0x86a4('0x25'),_0x540ffa+'-'+_0x17f439+'/'+_0x5edffa)[_0x86a4('0x20')](_0x3a1716);}return null;};}function patchUpdates(_0x5845a2){return function(_0xd49350){try{jsonpatch[_0x86a4('0x26')](_0xd49350,_0x5845a2,!![]);}catch(_0x1bfa09){return BPromise['reject'](_0x1bfa09);}return _0xd49350['save']();};}function saveUpdates(_0x3ec493,_0x6ff359){return function(_0x367686){if(_0x367686){return _0x367686[_0x86a4('0x27')](_0x3ec493)[_0x86a4('0x28')](function(_0x58379e){return _0x58379e;});}return null;};}function handleEntityNotFound(_0x3ad881,_0x1cb45a){return function(_0x404dec){if(!_0x404dec){_0x3ad881[_0x86a4('0x1d')](0x194);}return _0x404dec;};}function handleError(_0x30a7a2,_0x37f3ca){_0x37f3ca=_0x37f3ca||0x1f4;return function(_0x4bdffb){logger[_0x86a4('0x29')](_0x4bdffb['stack']);if(_0x4bdffb[_0x86a4('0x2a')]){delete _0x4bdffb[_0x86a4('0x2a')];}_0x30a7a2[_0x86a4('0x1e')](_0x37f3ca)[_0x86a4('0x2b')](_0x4bdffb);};}exports[_0x86a4('0x2c')]=function(_0x58daef,_0x561802){var _0x4ee41e={},_0x3633b2={},_0x28d578={'count':0x0,'rows':[]};var _0x13faaf=_[_0x86a4('0x2d')](db['Team'][_0x86a4('0x2e')],function(_0x46b6e1){return{'name':_0x46b6e1[_0x86a4('0x2f')],'type':_0x46b6e1[_0x86a4('0x30')][_0x86a4('0x31')]};});_0x3633b2[_0x86a4('0x32')]=_[_0x86a4('0x2d')](_0x13faaf,_0x86a4('0x2a'));_0x3633b2[_0x86a4('0x33')]=_[_0x86a4('0x34')](_0x58daef[_0x86a4('0x33')]);_0x3633b2[_0x86a4('0x35')]=_[_0x86a4('0x36')](_0x3633b2[_0x86a4('0x32')],_0x3633b2[_0x86a4('0x33')]);_0x4ee41e[_0x86a4('0x37')]=_[_0x86a4('0x36')](_0x3633b2['model'],qs[_0x86a4('0x38')](_0x58daef[_0x86a4('0x33')]['fields']));_0x4ee41e[_0x86a4('0x37')]=_0x4ee41e['attributes'][_0x86a4('0x39')]?_0x4ee41e['attributes']:_0x3633b2[_0x86a4('0x32')];if(!_0x58daef[_0x86a4('0x33')][_0x86a4('0x3a')]('nolimit')){_0x4ee41e[_0x86a4('0x23')]=qs[_0x86a4('0x23')](_0x58daef[_0x86a4('0x33')][_0x86a4('0x23')]);_0x4ee41e['offset']=qs[_0x86a4('0x21')](_0x58daef[_0x86a4('0x33')][_0x86a4('0x21')]);}_0x4ee41e[_0x86a4('0x3b')]=qs[_0x86a4('0x3c')](_0x58daef['query'][_0x86a4('0x3c')]);_0x4ee41e[_0x86a4('0x3d')]=qs[_0x86a4('0x35')](_['pick'](_0x58daef[_0x86a4('0x33')],_0x3633b2[_0x86a4('0x35')]),_0x13faaf);if(_0x58daef[_0x86a4('0x33')][_0x86a4('0x3e')]){_0x4ee41e[_0x86a4('0x3d')]=_[_0x86a4('0x3f')](_0x4ee41e[_0x86a4('0x3d')],{'$or':_[_0x86a4('0x2d')](_0x13faaf,function(_0x151244){if(_0x151244[_0x86a4('0x30')]!=='VIRTUAL'){var _0x5b2f66={};_0x5b2f66[_0x151244[_0x86a4('0x2a')]]={'$like':'%'+_0x58daef['query'][_0x86a4('0x3e')]+'%'};return _0x5b2f66;}})});}_0x4ee41e=_[_0x86a4('0x3f')]({},_0x4ee41e,_0x58daef[_0x86a4('0x40')]);var _0x5740bf={'where':_0x4ee41e['where']};return db[_0x86a4('0x41')]['count'](_0x5740bf)['then'](function(_0x44c14e){_0x28d578[_0x86a4('0x24')]=_0x44c14e;if(_0x58daef[_0x86a4('0x33')][_0x86a4('0x42')]){_0x4ee41e[_0x86a4('0x43')]=[{'all':!![]}];}return db[_0x86a4('0x41')][_0x86a4('0x44')](_0x4ee41e);})[_0x86a4('0x28')](function(_0x58bf85){_0x28d578['rows']=_0x58bf85;return _0x28d578;})[_0x86a4('0x28')](respondWithFilteredResult(_0x561802,_0x4ee41e))[_0x86a4('0x45')](handleError(_0x561802,null));};exports[_0x86a4('0x46')]=function(_0x41b4b4,_0x46513b){var _0x18458a={'raw':![],'where':{'id':_0x41b4b4[_0x86a4('0x47')]['id']}},_0x1b1400={};_0x1b1400[_0x86a4('0x32')]=_[_0x86a4('0x34')](db[_0x86a4('0x41')][_0x86a4('0x2e')]);_0x1b1400[_0x86a4('0x33')]=_['keys'](_0x41b4b4[_0x86a4('0x33')]);_0x1b1400[_0x86a4('0x35')]=_[_0x86a4('0x36')](_0x1b1400[_0x86a4('0x32')],_0x1b1400[_0x86a4('0x33')]);_0x18458a[_0x86a4('0x37')]=_[_0x86a4('0x36')](_0x1b1400['model'],qs[_0x86a4('0x38')](_0x41b4b4[_0x86a4('0x33')][_0x86a4('0x38')]));_0x18458a[_0x86a4('0x37')]=_0x18458a[_0x86a4('0x37')][_0x86a4('0x39')]?_0x18458a['attributes']:_0x1b1400[_0x86a4('0x32')];if(_0x41b4b4['query'][_0x86a4('0x42')]){_0x18458a[_0x86a4('0x43')]=[{'all':!![]}];}_0x18458a=_[_0x86a4('0x3f')]({},_0x18458a,_0x41b4b4[_0x86a4('0x40')]);return db[_0x86a4('0x41')]['find'](_0x18458a)[_0x86a4('0x28')](handleEntityNotFound(_0x46513b,null))['then'](respondWithResult(_0x46513b,null))['catch'](handleError(_0x46513b,null));};exports[_0x86a4('0x48')]=function(_0x5952f6,_0x1fb2b9){return db[_0x86a4('0x41')]['create'](_0x5952f6['body'],{})['then'](function(_0x2325d0){var _0x4e76e8=_0x5952f6['user'][_0x86a4('0x49')]({'plain':!![]});if(!_0x4e76e8)throw new Error(_0x86a4('0x4a'));if(_0x4e76e8['role']==='user'){var _0x1c51b0=_0x2325d0[_0x86a4('0x49')]({'plain':!![]});var _0x1d52fa=_0x86a4('0x4b');return db[_0x86a4('0x4c')][_0x86a4('0x4d')]({'where':{'name':_0x1d52fa,'userProfileId':_0x4e76e8[_0x86a4('0x4e')]},'raw':!![]})['then'](function(_0x1acd8f){if(_0x1acd8f&&_0x1acd8f[_0x86a4('0x4f')]===0x0){return db[_0x86a4('0x50')][_0x86a4('0x48')]({'name':_0x1c51b0[_0x86a4('0x2a')],'resourceId':_0x1c51b0['id'],'type':_0x1acd8f[_0x86a4('0x2a')],'sectionId':_0x1acd8f['id']},{})[_0x86a4('0x28')](function(){return _0x2325d0;});}else{return _0x2325d0;}})[_0x86a4('0x45')](function(_0x38f99e){logger[_0x86a4('0x29')](_0x86a4('0x51'),_0x38f99e);throw _0x38f99e;});}return _0x2325d0;})['then'](respondWithResult(_0x1fb2b9,0xc9))[_0x86a4('0x45')](handleError(_0x1fb2b9,null));};exports[_0x86a4('0x27')]=function(_0x13516b,_0x4cebe7){if(_0x13516b[_0x86a4('0x52')]['id']){delete _0x13516b[_0x86a4('0x52')]['id'];}return db[_0x86a4('0x41')][_0x86a4('0x4d')]({'where':{'id':_0x13516b[_0x86a4('0x47')]['id']}})['then'](handleEntityNotFound(_0x4cebe7,null))[_0x86a4('0x28')](saveUpdates(_0x13516b[_0x86a4('0x52')],null))[_0x86a4('0x28')](respondWithResult(_0x4cebe7,null))[_0x86a4('0x45')](handleError(_0x4cebe7,null));};exports['destroy']=function(_0x401530,_0x2924cd){var _0x3f9fbd=_0x401530[_0x86a4('0x47')]['id'];var _0x37a370=[];return db[_0x86a4('0x53')][_0x86a4('0x54')](function(_0x7e55c9){var _0x13116d=_0x86a4('0x55')+_0x3f9fbd;return db[_0x86a4('0x53')]['query'](_0x13116d,{'type':db['Sequelize'][_0x86a4('0x56')]['SELECT'],'raw':!![],'transaction':_0x7e55c9})[_0x86a4('0x28')](function(_0xd98b84){_0x37a370=_[_0x86a4('0x2d')](_0xd98b84,function(_0x2bf944){return Number(_0x2bf944[_0x86a4('0x57')]);});})['then'](function(){var _0x7f6198='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x3f9fbd;return db['sequelize'][_0x86a4('0x33')](_0x7f6198,{'type':db[_0x86a4('0x58')][_0x86a4('0x56')]['SELECT'],'raw':!![],'transaction':_0x7e55c9});})[_0x86a4('0x28')](function(_0x1cf949){var _0xca470f=_['map'](_0x1cf949,function(_0x39b459){return Number(_0x39b459[_0x86a4('0x59')]);});return db[_0x86a4('0x5a')]['destroy']({'where':{'UserId':{'$in':_0x37a370},'VoiceQueueId':{'$in':_0xca470f}},'transaction':_0x7e55c9});})['then'](function(){var _0x18f3d3=_0x86a4('0x5b')+_0x3f9fbd;return db[_0x86a4('0x53')]['query'](_0x18f3d3,{'type':db[_0x86a4('0x58')][_0x86a4('0x56')]['SELECT'],'raw':!![],'transaction':_0x7e55c9});})[_0x86a4('0x28')](function(_0x461454){var _0x396744=_[_0x86a4('0x2d')](_0x461454,function(_0x566d4c){return Number(_0x566d4c['MailQueueId']);});return db[_0x86a4('0x5c')][_0x86a4('0x5d')]({'where':{'UserId':{'$in':_0x37a370},'MailQueueId':{'$in':_0x396744}},'transaction':_0x7e55c9});})[_0x86a4('0x28')](function(){var _0x40e605=_0x86a4('0x5e')+_0x3f9fbd;return db[_0x86a4('0x53')][_0x86a4('0x33')](_0x40e605,{'type':db[_0x86a4('0x58')][_0x86a4('0x56')]['SELECT'],'raw':!![],'transaction':_0x7e55c9});})[_0x86a4('0x28')](function(_0x415d70){var _0x4648a4=_['map'](_0x415d70,function(_0x6e9dd9){return Number(_0x6e9dd9[_0x86a4('0x5f')]);});return db[_0x86a4('0x60')]['destroy']({'where':{'UserId':{'$in':_0x37a370},'SmsQueueId':{'$in':_0x4648a4}},'transaction':_0x7e55c9});})['then'](function(){var _0x3718e6='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x3f9fbd;return db[_0x86a4('0x53')][_0x86a4('0x33')](_0x3718e6,{'type':db[_0x86a4('0x58')][_0x86a4('0x56')][_0x86a4('0x61')],'raw':!![],'transaction':_0x7e55c9});})[_0x86a4('0x28')](function(_0x3c7315){var _0x4d2642=_[_0x86a4('0x2d')](_0x3c7315,function(_0x53f016){return Number(_0x53f016[_0x86a4('0x62')]);});return db[_0x86a4('0x63')][_0x86a4('0x5d')]({'where':{'UserId':{'$in':_0x37a370},'ChatQueueId':{'$in':_0x4d2642}},'transaction':_0x7e55c9});})[_0x86a4('0x28')](function(){var _0x2c1472=_0x86a4('0x64')+_0x3f9fbd;return db[_0x86a4('0x53')][_0x86a4('0x33')](_0x2c1472,{'type':db[_0x86a4('0x58')][_0x86a4('0x56')][_0x86a4('0x61')],'raw':!![],'transaction':_0x7e55c9});})[_0x86a4('0x28')](function(_0x5db3db){var _0x231c45=_[_0x86a4('0x2d')](_0x5db3db,function(_0x269936){return Number(_0x269936[_0x86a4('0x65')]);});return db[_0x86a4('0x66')][_0x86a4('0x5d')]({'where':{'UserId':{'$in':_0x37a370},'FaxQueueId':{'$in':_0x231c45}},'transaction':_0x7e55c9});})['then'](function(){var _0xb1bf1f=_0x86a4('0x67')+_0x3f9fbd;return db[_0x86a4('0x53')][_0x86a4('0x33')](_0xb1bf1f,{'type':db[_0x86a4('0x58')][_0x86a4('0x56')][_0x86a4('0x61')],'raw':!![],'transaction':_0x7e55c9});})[_0x86a4('0x28')](function(_0x35baef){var _0x34d822=_[_0x86a4('0x2d')](_0x35baef,function(_0x2eac21){return Number(_0x2eac21['OpenchannelQueueId']);});return db[_0x86a4('0x68')]['destroy']({'where':{'UserId':{'$in':_0x37a370},'OpenchannelQueueId':{'$in':_0x34d822}},'transaction':_0x7e55c9});})[_0x86a4('0x28')](function(){var _0x2abd97='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x3f9fbd;return db['sequelize'][_0x86a4('0x33')](_0x2abd97,{'type':db[_0x86a4('0x58')]['QueryTypes'][_0x86a4('0x61')],'raw':!![],'transaction':_0x7e55c9});})['then'](function(_0x2b5fa5){var _0x4fd629=_[_0x86a4('0x2d')](_0x2b5fa5,function(_0x166bc2){return Number(_0x166bc2[_0x86a4('0x69')]);});return db[_0x86a4('0x6a')][_0x86a4('0x5d')]({'where':{'UserId':{'$in':_0x37a370},'WhatsappQueueId':{'$in':_0x4fd629}},'transaction':_0x7e55c9});})[_0x86a4('0x28')](function(){return db['TeamVoicePrefix'][_0x86a4('0x4d')]({'where':{'TeamId':_0x3f9fbd}});})[_0x86a4('0x28')](function(_0xafd598){if(_0xafd598===null){return;}return db[_0x86a4('0x6b')][_0x86a4('0x5d')]({'where':{'UserId':{'$in':_0x37a370},'VoicePrefixId':_0xafd598[_0x86a4('0x6c')]},'transaction':_0x7e55c9});})[_0x86a4('0x28')](function(){return db[_0x86a4('0x41')][_0x86a4('0x5d')]({'where':{'id':_0x3f9fbd},'cascade':!![],'transaction':_0x7e55c9});})[_0x86a4('0x28')](function(_0x3fc4a8){if(_0x3fc4a8===0x0){_0x2924cd[_0x86a4('0x1d')](0x194);}else{return db[_0x86a4('0x50')][_0x86a4('0x5d')]({'where':{'type':'Teams','resourceId':_0x3f9fbd},'cascade':!![],'transaction':_0x7e55c9})[_0x86a4('0x28')](function(){_0x2924cd[_0x86a4('0x1e')](0xcc)[_0x86a4('0x1f')]();});}})[_0x86a4('0x45')](function(_0x58eb6e){_0x2924cd[_0x86a4('0x1e')](0x1f4)[_0x86a4('0x2b')](_0x58eb6e);});});};exports[_0x86a4('0x6d')]=function(_0x2332a5,_0x436fe4,_0x394a25){return db[_0x86a4('0x41')][_0x86a4('0x6e')]({'where':{'id':_0x2332a5['params']['id']}})[_0x86a4('0x28')](handleEntityNotFound(_0x436fe4,null))[_0x86a4('0x28')](function(_0xcf390f){if(!_0x2332a5['query'][_0x86a4('0x6f')]||!utils[_0x86a4('0x70')](_0x2332a5['query']['channel'])){throw new db['Sequelize'][(_0x86a4('0x71'))](_0x86a4('0x72'));}var _0x3ebc69={};var _0x559902={};_0x559902[_0x86a4('0x32')]=_[_0x86a4('0x34')](db[_[_0x86a4('0x73')](_0x2332a5[_0x86a4('0x33')]['channel'][_0x86a4('0x74')]())+_0x86a4('0x75')][_0x86a4('0x2e')]);_0x559902['query']=_[_0x86a4('0x34')](_0x2332a5[_0x86a4('0x33')]);_0x559902[_0x86a4('0x35')]=_[_0x86a4('0x36')](_0x559902[_0x86a4('0x32')],_0x559902[_0x86a4('0x33')]);_0x3ebc69[_0x86a4('0x37')]=_[_0x86a4('0x36')](_0x559902[_0x86a4('0x32')],qs[_0x86a4('0x38')](_0x2332a5[_0x86a4('0x33')][_0x86a4('0x38')]));_0x3ebc69[_0x86a4('0x37')]=_0x3ebc69[_0x86a4('0x37')][_0x86a4('0x39')]?_0x3ebc69[_0x86a4('0x37')]:_0x559902[_0x86a4('0x32')];_0x3ebc69['limit']=qs['limit'](_0x2332a5[_0x86a4('0x33')]['limit']);_0x3ebc69[_0x86a4('0x21')]=qs[_0x86a4('0x21')](_0x2332a5[_0x86a4('0x33')][_0x86a4('0x21')]);_0x3ebc69[_0x86a4('0x3b')]=qs[_0x86a4('0x3c')](_0x2332a5['query'][_0x86a4('0x3c')]);_0x3ebc69[_0x86a4('0x3d')]=qs[_0x86a4('0x35')](_['pick'](_0x2332a5[_0x86a4('0x33')],_0x559902['filters']));_0x3ebc69=_[_0x86a4('0x3f')]({},_0x3ebc69,_0x2332a5[_0x86a4('0x40')]);return _0xcf390f[_0x86a4('0x49')+_[_0x86a4('0x73')](_0x2332a5[_0x86a4('0x33')][_0x86a4('0x6f')][_0x86a4('0x74')]())+_0x86a4('0x76')](_0x3ebc69);})[_0x86a4('0x28')](respondWithResult(_0x436fe4,null))[_0x86a4('0x45')](handleError(_0x436fe4,null));};exports[_0x86a4('0x77')]=function(_0x2dddc9,_0x170f84,_0x30309a){return db[_0x86a4('0x41')][_0x86a4('0x6e')]({'where':{'id':_0x2dddc9[_0x86a4('0x47')]['id']}})[_0x86a4('0x28')](function(_0x5b6f7d){if(_0x5b6f7d){if(!_0x2dddc9[_0x86a4('0x52')][_0x86a4('0x6f')]||!utils[_0x86a4('0x70')](_0x2dddc9[_0x86a4('0x52')][_0x86a4('0x6f')])){throw new db[(_0x86a4('0x58'))][(_0x86a4('0x71'))](_0x86a4('0x72'));}return _0x5b6f7d['add'+_[_0x86a4('0x73')](_0x2dddc9['body'][_0x86a4('0x6f')][_0x86a4('0x74')]())+_0x86a4('0x76')](_0x2dddc9[_0x86a4('0x52')][_0x86a4('0x78')]);}return null;})[_0x86a4('0x28')](handleEntityNotFound(_0x170f84,null))[_0x86a4('0x28')](respondWithStatusCode(_0x170f84,null))['catch'](handleError(_0x170f84,null));};exports[_0x86a4('0x79')]=function(_0x30ad9b,_0x2cac36,_0x3e2547){return db[_0x86a4('0x41')][_0x86a4('0x6e')]({'where':{'id':_0x30ad9b[_0x86a4('0x47')]['id']}})[_0x86a4('0x28')](function(_0xa86a7a){if(_0xa86a7a){if(!_0x30ad9b['query'][_0x86a4('0x6f')]||!utils[_0x86a4('0x70')](_0x30ad9b['query']['channel'])){throw new db['Sequelize'][(_0x86a4('0x71'))](_0x86a4('0x72'));}return _0xa86a7a[_0x86a4('0x7a')+_[_0x86a4('0x73')](_0x30ad9b[_0x86a4('0x33')][_0x86a4('0x6f')][_0x86a4('0x74')]())+_0x86a4('0x76')](_0x30ad9b[_0x86a4('0x33')][_0x86a4('0x78')]);}return null;})[_0x86a4('0x28')](handleEntityNotFound(_0x2cac36,null))[_0x86a4('0x28')](respondWithStatusCode(_0x2cac36,null))[_0x86a4('0x45')](handleError(_0x2cac36,null));};exports[_0x86a4('0x7b')]=function(_0xd61fbe,_0x567fa0){var _0x1f6bf2=_[_0x86a4('0x7c')](_0xd61fbe[_0x86a4('0x52')]['ids'])?_0xd61fbe[_0x86a4('0x52')]['ids']:[_0xd61fbe['body'][_0x86a4('0x78')]];var _0x42ed7b=_0xd61fbe[_0x86a4('0x47')]['id'];return db[_0x86a4('0x41')][_0x86a4('0x4d')]({'where':{'id':_0x42ed7b}})[_0x86a4('0x28')](handleEntityNotFound(_0x567fa0,null))[_0x86a4('0x28')](function(_0x30f036){if(_0x30f036){var _0x2b3e07=[_0x86a4('0x7d'),'Chat','Mail',_0x86a4('0x7e'),_0x86a4('0x7f'),_0x86a4('0x80'),'Whatsapp'];return db['sequelize'][_0x86a4('0x54')](function(_0x495d80){var _0x32f2c4=_[_0x86a4('0x2d')](_0x2b3e07,function(_0x3a3fc7){var _0x43293d={'attributes':['id',_0x86a4('0x2a')]};if(_0x3a3fc7===_0x86a4('0x7d')){_0x43293d[_0x86a4('0x81')]={'attributes':[_0x86a4('0x82')]};}return _0x30f036[_0x86a4('0x49')+_0x3a3fc7+_0x86a4('0x76')](_0x43293d)[_0x86a4('0x28')](function(_0x302031){var _0x3ab5ab=_['map'](_0x302031,function(_0x134554){var _0x1d1da8=_[_0x86a4('0x2d')](_0x1f6bf2,function(_0x190002){var _0xc89db2={'where':{'UserId':_0x190002,[_0x3a3fc7+_0x86a4('0x83')]:_0x134554['id']},'transaction':_0x495d80};if(_0x3a3fc7===_0x86a4('0x7d')){_0xc89db2['defaults']={'penalty':_0x134554[_0x86a4('0x84')][_0x86a4('0x82')]};}return db[_0x86a4('0x85')+_0x3a3fc7+_0x86a4('0x75')][_0x86a4('0x86')](_0xc89db2)['then'](function(){socket[_0x86a4('0x87')](_0x86a4('0x88')+_0x3a3fc7+_0x86a4('0x89'),{'UserId':_0x190002,[_0x3a3fc7+'QueueId']:_0x134554['id']});if(_0x3a3fc7!=='Voice'){return;}return db['User'][_0x86a4('0x44')]({'where':{'id':_0x1f6bf2,'online':0x1},'attributes':['id','name','online',_0x86a4('0x8a'),_0x86a4('0x8b')],'raw':!![]})[_0x86a4('0x28')](function(_0x267687){var _0x5e3472=_[_0x86a4('0x2d')](_0x267687,function(_0x54f645){return db[_0x86a4('0x8c')][_0x86a4('0x8d')]({'membername':_0x54f645[_0x86a4('0x2a')],'UserId':_0x54f645['id'],'queue_name':_0x134554[_0x86a4('0x2a')],'VoiceQueueId':_0x134554['id'],'interface':_[_0x86a4('0x8e')](_0x54f645['interface'])?util[_0x86a4('0x8f')](_0x86a4('0x90'),_0x54f645[_0x86a4('0x2a')]):_0x54f645['interface'],'paused':_0x54f645[_0x86a4('0x8a')]||![],'penalty':_0x134554[_0x86a4('0x84')][_0x86a4('0x82')]},{'transaction':_0x495d80});});return Promise[_0x86a4('0x91')](_0x5e3472);});});});return Promise[_0x86a4('0x91')](_0x1d1da8);});return Promise[_0x86a4('0x91')](_0x3ab5ab);})['then'](function(){return db['TeamVoicePrefix'][_0x86a4('0x6e')]({'where':{'teamId':_0x42ed7b}})[_0x86a4('0x28')](function(_0x520c6d){if(_0x520c6d){var _0x3c7b9c=_[_0x86a4('0x2d')](_0x1f6bf2,function(_0x173611){db['UserVoicePrefix'][_0x86a4('0x8d')]({'UserId':_0x173611,'VoicePrefixId':_0x520c6d['VoicePrefixId']});});return Promise[_0x86a4('0x91')](_0x3c7b9c);}});});});return Promise[_0x86a4('0x91')](_0x32f2c4)[_0x86a4('0x28')](function(){return _0x30f036[_0x86a4('0x7b')](_0x1f6bf2,{'transaction':_0x495d80})[_0x86a4('0x92')](function(_0x124124){return _0x124124;});});});}})['then'](respondWithResult(_0x567fa0,null))[_0x86a4('0x45')](handleError(_0x567fa0,null));};exports[_0x86a4('0x93')]=function(_0x3a26c2,_0x41e1ee){var _0x1d9e89=_[_0x86a4('0x7c')](_0x3a26c2[_0x86a4('0x33')]['ids'])?_0x3a26c2['query']['ids']:[_0x3a26c2[_0x86a4('0x33')]['ids']];var _0x3f296a=_0x3a26c2[_0x86a4('0x47')]['id'];return db[_0x86a4('0x41')]['find']({'where':{'id':_0x3f296a}})[_0x86a4('0x28')](handleEntityNotFound(_0x41e1ee,null))[_0x86a4('0x28')](function(_0x4cab81){if(_0x4cab81){var _0x5654c5=[_0x86a4('0x7d'),'Chat','Mail',_0x86a4('0x7e'),_0x86a4('0x7f'),'Openchannel',_0x86a4('0x94')];return db['sequelize']['transaction'](function(_0x1fc0b8){var _0x28b360=_['map'](_0x5654c5,function(_0x5ab13b){var _0x32a111={'attributes':['id','name']};return _0x4cab81[_0x86a4('0x49')+_0x5ab13b+_0x86a4('0x76')](_0x32a111)[_0x86a4('0x28')](function(_0x296e2e){var _0x566ffc=_[_0x86a4('0x2d')](_0x296e2e,function(_0x472a3d){return _0x472a3d[_0x86a4('0x93')](_0x1d9e89,{'transaction':_0x1fc0b8})[_0x86a4('0x28')](function(){var _0x2b08b0=_[_0x86a4('0x2d')](_0x1d9e89,function(_0x76832c){socket[_0x86a4('0x87')](_0x86a4('0x88')+_0x5ab13b+_0x86a4('0x95'),{'UserId':Number(_0x76832c),[_0x5ab13b+'QueueId']:_0x472a3d['id']});if(_0x5ab13b!=='Voice'){return;}return db[_0x86a4('0x8c')][_0x86a4('0x5d')]({'where':{'VoiceQueueId':_0x472a3d['id'],'UserId':_0x76832c},'transaction':_0x1fc0b8});});return Promise[_0x86a4('0x91')](_0x2b08b0);});});return Promise[_0x86a4('0x91')](_0x566ffc);});});return Promise[_0x86a4('0x91')](_0x28b360)['then'](function(){return _0x4cab81[_0x86a4('0x93')](_0x1d9e89,{'transaction':_0x1fc0b8});})[_0x86a4('0x28')](function(){return db[_0x86a4('0x96')][_0x86a4('0x6e')]({'where':{'teamId':_0x3f296a}})['then'](function(_0x4f61c7){if(_0x4f61c7){var _0x1dfe31=_[_0x86a4('0x2d')](_0x1d9e89,function(_0x1efb0e){db[_0x86a4('0x6b')][_0x86a4('0x5d')]({'where':{'UserId':_0x1efb0e,'VoicePrefixId':_0x4f61c7['VoicePrefixId']}});});return Promise['all'](_0x1dfe31);}});});});}})[_0x86a4('0x28')](respondWithStatusCode(_0x41e1ee,null))[_0x86a4('0x45')](handleError(_0x41e1ee,null));};exports[_0x86a4('0x97')]=function(_0x28b2c7,_0x2eb8df,_0x4d399c){var _0xbcca48={};var _0x1e33af={};var _0x4ff89a;var _0x1a0503;return db[_0x86a4('0x41')]['findOne']({'where':{'id':_0x28b2c7['params']['id']}})[_0x86a4('0x28')](handleEntityNotFound(_0x2eb8df,null))['then'](function(_0x3eeb80){if(_0x3eeb80){_0x4ff89a=_0x3eeb80;_0x1e33af[_0x86a4('0x32')]=_[_0x86a4('0x34')](db[_0x86a4('0x85')][_0x86a4('0x2e')]);_0x1e33af[_0x86a4('0x33')]=_[_0x86a4('0x34')](_0x28b2c7[_0x86a4('0x33')]);_0x1e33af['filters']=_[_0x86a4('0x36')](_0x1e33af[_0x86a4('0x32')],_0x1e33af[_0x86a4('0x33')]);_0xbcca48[_0x86a4('0x37')]=_[_0x86a4('0x36')](_0x1e33af[_0x86a4('0x32')],qs[_0x86a4('0x38')](_0x28b2c7[_0x86a4('0x33')]['fields']));_0xbcca48['attributes']=_0xbcca48[_0x86a4('0x37')][_0x86a4('0x39')]?_0xbcca48[_0x86a4('0x37')]:_0x1e33af[_0x86a4('0x32')];_0xbcca48[_0x86a4('0x3b')]=qs['sort'](_0x28b2c7[_0x86a4('0x33')][_0x86a4('0x3c')]);_0xbcca48[_0x86a4('0x3d')]=qs[_0x86a4('0x35')](_[_0x86a4('0x98')](_0x28b2c7[_0x86a4('0x33')],_0x1e33af[_0x86a4('0x35')]));if(_0x28b2c7[_0x86a4('0x33')][_0x86a4('0x3e')]){_0xbcca48[_0x86a4('0x3d')]=_[_0x86a4('0x3f')](_0xbcca48[_0x86a4('0x3d')],{'$or':_['map'](_0xbcca48[_0x86a4('0x37')],function(_0x1ab6cf){var _0x47b494={};_0x47b494[_0x1ab6cf]={'$like':'%'+_0x28b2c7[_0x86a4('0x33')][_0x86a4('0x3e')]+'%'};return _0x47b494;})});}_0xbcca48=_['merge']({},_0xbcca48,_0x28b2c7[_0x86a4('0x40')]);return _0x4ff89a['getAgents'](_0xbcca48);}})[_0x86a4('0x28')](function(_0x1fd565){if(_0x1fd565){_0x1a0503=_0x1fd565[_0x86a4('0x39')];if(!_0x28b2c7['query'][_0x86a4('0x3a')]('nolimit')){_0xbcca48[_0x86a4('0x23')]=qs['limit'](_0x28b2c7[_0x86a4('0x33')][_0x86a4('0x23')]);_0xbcca48[_0x86a4('0x21')]=qs[_0x86a4('0x21')](_0x28b2c7[_0x86a4('0x33')][_0x86a4('0x21')]);}return _0x4ff89a[_0x86a4('0x97')](_0xbcca48);}})[_0x86a4('0x28')](function(_0x578c4e){if(_0x578c4e){return _0x578c4e?{'count':_0x1a0503,'rows':_0x578c4e}:null;}})[_0x86a4('0x28')](respondWithResult(_0x2eb8df,null))[_0x86a4('0x45')](handleError(_0x2eb8df,null));}; \ No newline at end of file +var _0xd9fa=['addAgents','isArray','Voice','Chat','Mail','Fax','Openchannel','Whatsapp','QueueId','User','findOrCreate','emit','Queue:save','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','TeamVoiceQueue','penalty','all','removeAgents','Sms','order','getAgents','nolimit','eml-format','rimraf','zip-dir','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./team.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','save','then','stack','name','index','Team','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','filter','options','include','rows','catch','show','params','keys','rawAttributes','includeAll','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','UserProfileResource','error','update','destroy','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','sequelize','Sequelize','QueryTypes','UserId','SELECT','VoiceQueueId','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','VoicePrefixId','Teams','send','getQueues','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','addQueues','add','ids','removeQueues'];(function(_0x2c5638,_0x437f30){var _0x2d3fdc=function(_0x5df474){while(--_0x5df474){_0x2c5638['push'](_0x2c5638['shift']());}};_0x2d3fdc(++_0x437f30);}(_0xd9fa,0x1da));var _0xad9f=function(_0xf9e72a,_0x2697ea){_0xf9e72a=_0xf9e72a-0x0;var _0x325e72=_0xd9fa[_0xf9e72a];return _0x325e72;};'use strict';var emlformat=require(_0xad9f('0x0'));var rimraf=require(_0xad9f('0x1'));var zipdir=require(_0xad9f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xad9f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xad9f('0x4'));var util=require(_0xad9f('0x5'));var path=require('path');var sox=require(_0xad9f('0x6'));var csv=require(_0xad9f('0x7'));var ejs=require(_0xad9f('0x8'));var fs=require('fs');var fs_extra=require(_0xad9f('0x9'));var _=require(_0xad9f('0xa'));var squel=require(_0xad9f('0xb'));var crypto=require(_0xad9f('0xc'));var jsforce=require(_0xad9f('0xd'));var deskjs=require(_0xad9f('0xe'));var toCsv=require(_0xad9f('0x7'));var querystring=require(_0xad9f('0xf'));var Papa=require('papaparse');var Redis=require(_0xad9f('0x10'));var authService=require(_0xad9f('0x11'));var qs=require(_0xad9f('0x12'));var as=require(_0xad9f('0x13'));var hardwareService=require(_0xad9f('0x14'));var logger=require('../../config/logger')(_0xad9f('0x15'));var utils=require('../../config/utils');var config=require(_0xad9f('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xad9f('0x17'))['db'];config[_0xad9f('0x18')]=_[_0xad9f('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xad9f('0x1a'))(new Redis(config['redis']));require(_0xad9f('0x1b'))[_0xad9f('0x1c')](socket);function respondWithStatusCode(_0x466679,_0x56ac03){_0x56ac03=_0x56ac03||0xcc;return function(_0x237a07){if(_0x237a07){return _0x466679[_0xad9f('0x1d')](_0x56ac03);}return _0x466679[_0xad9f('0x1e')](_0x56ac03)[_0xad9f('0x1f')]();};}function respondWithResult(_0x33d5ac,_0x47b9d2){_0x47b9d2=_0x47b9d2||0xc8;return function(_0x3c905c){if(_0x3c905c){return _0x33d5ac['status'](_0x47b9d2)['json'](_0x3c905c);}};}function respondWithFilteredResult(_0x3ee5cf,_0x351fa1){return function(_0x2dc1c9){if(_0x2dc1c9){var _0x27f7f2=typeof _0x351fa1[_0xad9f('0x20')]===_0xad9f('0x21')&&typeof _0x351fa1[_0xad9f('0x22')]===_0xad9f('0x21');var _0x376dc2=_0x2dc1c9['count'];var _0x2deaab=_0x27f7f2?0x0:_0x351fa1[_0xad9f('0x20')];var _0x2ae997=_0x27f7f2?_0x2dc1c9[_0xad9f('0x23')]:_0x351fa1[_0xad9f('0x20')]+_0x351fa1[_0xad9f('0x22')];var _0x2a4228;if(_0x2ae997>=_0x376dc2){_0x2ae997=_0x376dc2;_0x2a4228=0xc8;}else{_0x2a4228=0xce;}_0x3ee5cf[_0xad9f('0x1e')](_0x2a4228);return _0x3ee5cf[_0xad9f('0x24')]('Content-Range',_0x2deaab+'-'+_0x2ae997+'/'+_0x376dc2)['json'](_0x2dc1c9);}return null;};}function patchUpdates(_0x15947f){return function(_0x53e2fb){try{jsonpatch[_0xad9f('0x25')](_0x53e2fb,_0x15947f,!![]);}catch(_0x3ab336){return BPromise[_0xad9f('0x26')](_0x3ab336);}return _0x53e2fb[_0xad9f('0x27')]();};}function saveUpdates(_0x32636f,_0x1e01ed){return function(_0x5923d1){if(_0x5923d1){return _0x5923d1['update'](_0x32636f)[_0xad9f('0x28')](function(_0x3b00b4){return _0x3b00b4;});}return null;};}function handleEntityNotFound(_0x348fa7,_0xd102fd){return function(_0x2b2a5e){if(!_0x2b2a5e){_0x348fa7[_0xad9f('0x1d')](0x194);}return _0x2b2a5e;};}function handleError(_0x4faabb,_0x16c2a2){_0x16c2a2=_0x16c2a2||0x1f4;return function(_0x3f9064){logger['error'](_0x3f9064[_0xad9f('0x29')]);if(_0x3f9064[_0xad9f('0x2a')]){delete _0x3f9064[_0xad9f('0x2a')];}_0x4faabb[_0xad9f('0x1e')](_0x16c2a2)['send'](_0x3f9064);};}exports[_0xad9f('0x2b')]=function(_0x41ee52,_0x51de0d){var _0x360055={},_0x24cfc3={},_0x395de6={'count':0x0,'rows':[]};var _0x87eb66=_['map'](db[_0xad9f('0x2c')]['rawAttributes'],function(_0x43b4a2){return{'name':_0x43b4a2[_0xad9f('0x2d')],'type':_0x43b4a2[_0xad9f('0x2e')]['key']};});_0x24cfc3[_0xad9f('0x2f')]=_[_0xad9f('0x30')](_0x87eb66,_0xad9f('0x2a'));_0x24cfc3['query']=_['keys'](_0x41ee52[_0xad9f('0x31')]);_0x24cfc3[_0xad9f('0x32')]=_[_0xad9f('0x33')](_0x24cfc3[_0xad9f('0x2f')],_0x24cfc3[_0xad9f('0x31')]);_0x360055[_0xad9f('0x34')]=_['intersection'](_0x24cfc3[_0xad9f('0x2f')],qs[_0xad9f('0x35')](_0x41ee52[_0xad9f('0x31')][_0xad9f('0x35')]));_0x360055[_0xad9f('0x34')]=_0x360055['attributes'][_0xad9f('0x36')]?_0x360055[_0xad9f('0x34')]:_0x24cfc3['model'];if(!_0x41ee52[_0xad9f('0x31')][_0xad9f('0x37')]('nolimit')){_0x360055[_0xad9f('0x22')]=qs['limit'](_0x41ee52['query'][_0xad9f('0x22')]);_0x360055[_0xad9f('0x20')]=qs[_0xad9f('0x20')](_0x41ee52[_0xad9f('0x31')][_0xad9f('0x20')]);}_0x360055['order']=qs[_0xad9f('0x38')](_0x41ee52[_0xad9f('0x31')][_0xad9f('0x38')]);_0x360055[_0xad9f('0x39')]=qs[_0xad9f('0x32')](_[_0xad9f('0x3a')](_0x41ee52['query'],_0x24cfc3[_0xad9f('0x32')]),_0x87eb66);if(_0x41ee52[_0xad9f('0x31')]['filter']){_0x360055[_0xad9f('0x39')]=_[_0xad9f('0x3b')](_0x360055['where'],{'$or':_[_0xad9f('0x30')](_0x87eb66,function(_0x429e5b){if(_0x429e5b[_0xad9f('0x2e')]!=='VIRTUAL'){var _0x153749={};_0x153749[_0x429e5b['name']]={'$like':'%'+_0x41ee52[_0xad9f('0x31')][_0xad9f('0x3c')]+'%'};return _0x153749;}})});}_0x360055=_[_0xad9f('0x3b')]({},_0x360055,_0x41ee52[_0xad9f('0x3d')]);var _0x1e8de0={'where':_0x360055['where']};return db[_0xad9f('0x2c')]['count'](_0x1e8de0)[_0xad9f('0x28')](function(_0x51ef8a){_0x395de6[_0xad9f('0x23')]=_0x51ef8a;if(_0x41ee52[_0xad9f('0x31')]['includeAll']){_0x360055[_0xad9f('0x3e')]=[{'all':!![]}];}return db['Team']['findAll'](_0x360055);})[_0xad9f('0x28')](function(_0x48c71d){_0x395de6[_0xad9f('0x3f')]=_0x48c71d;return _0x395de6;})[_0xad9f('0x28')](respondWithFilteredResult(_0x51de0d,_0x360055))[_0xad9f('0x40')](handleError(_0x51de0d,null));};exports[_0xad9f('0x41')]=function(_0x530e68,_0x2eb1e3){var _0x12d7bb={'raw':![],'where':{'id':_0x530e68[_0xad9f('0x42')]['id']}},_0x1d7852={};_0x1d7852[_0xad9f('0x2f')]=_[_0xad9f('0x43')](db[_0xad9f('0x2c')][_0xad9f('0x44')]);_0x1d7852[_0xad9f('0x31')]=_[_0xad9f('0x43')](_0x530e68[_0xad9f('0x31')]);_0x1d7852[_0xad9f('0x32')]=_[_0xad9f('0x33')](_0x1d7852['model'],_0x1d7852[_0xad9f('0x31')]);_0x12d7bb[_0xad9f('0x34')]=_['intersection'](_0x1d7852[_0xad9f('0x2f')],qs[_0xad9f('0x35')](_0x530e68['query']['fields']));_0x12d7bb['attributes']=_0x12d7bb[_0xad9f('0x34')][_0xad9f('0x36')]?_0x12d7bb[_0xad9f('0x34')]:_0x1d7852[_0xad9f('0x2f')];if(_0x530e68[_0xad9f('0x31')][_0xad9f('0x45')]){_0x12d7bb[_0xad9f('0x3e')]=[{'all':!![]}];}_0x12d7bb=_[_0xad9f('0x3b')]({},_0x12d7bb,_0x530e68[_0xad9f('0x3d')]);return db['Team'][_0xad9f('0x46')](_0x12d7bb)[_0xad9f('0x28')](handleEntityNotFound(_0x2eb1e3,null))[_0xad9f('0x28')](respondWithResult(_0x2eb1e3,null))['catch'](handleError(_0x2eb1e3,null));};exports['create']=function(_0x32336d,_0x1f12a0){return db['Team'][_0xad9f('0x47')](_0x32336d[_0xad9f('0x48')],{})[_0xad9f('0x28')](function(_0x55bd37){var _0x20b734=_0x32336d['user'][_0xad9f('0x49')]({'plain':!![]});if(!_0x20b734)throw new Error(_0xad9f('0x4a'));if(_0x20b734[_0xad9f('0x4b')]===_0xad9f('0x4c')){var _0x2f2c2e=_0x55bd37[_0xad9f('0x49')]({'plain':!![]});var _0xfa3403='Teams';return db[_0xad9f('0x4d')][_0xad9f('0x46')]({'where':{'name':_0xfa3403,'userProfileId':_0x20b734['userProfileId']},'raw':!![]})[_0xad9f('0x28')](function(_0xfdd177){if(_0xfdd177&&_0xfdd177[_0xad9f('0x4e')]===0x0){return db[_0xad9f('0x4f')][_0xad9f('0x47')]({'name':_0x2f2c2e[_0xad9f('0x2a')],'resourceId':_0x2f2c2e['id'],'type':_0xfdd177[_0xad9f('0x2a')],'sectionId':_0xfdd177['id']},{})[_0xad9f('0x28')](function(){return _0x55bd37;});}else{return _0x55bd37;}})['catch'](function(_0x74264b){logger[_0xad9f('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x74264b);throw _0x74264b;});}return _0x55bd37;})[_0xad9f('0x28')](respondWithResult(_0x1f12a0,0xc9))['catch'](handleError(_0x1f12a0,null));};exports[_0xad9f('0x51')]=function(_0x20c39e,_0xc859be){if(_0x20c39e['body']['id']){delete _0x20c39e['body']['id'];}return db[_0xad9f('0x2c')][_0xad9f('0x46')]({'where':{'id':_0x20c39e['params']['id']}})[_0xad9f('0x28')](handleEntityNotFound(_0xc859be,null))['then'](saveUpdates(_0x20c39e[_0xad9f('0x48')],null))[_0xad9f('0x28')](respondWithResult(_0xc859be,null))[_0xad9f('0x40')](handleError(_0xc859be,null));};exports[_0xad9f('0x52')]=function(_0x12269b,_0x446235){var _0x3d49da=_0x12269b[_0xad9f('0x42')]['id'];var _0x2549af=[];return db['sequelize'][_0xad9f('0x53')](function(_0xd57cf){var _0x11e067=_0xad9f('0x54')+_0x3d49da;return db[_0xad9f('0x55')]['query'](_0x11e067,{'type':db[_0xad9f('0x56')][_0xad9f('0x57')]['SELECT'],'raw':!![],'transaction':_0xd57cf})[_0xad9f('0x28')](function(_0x2f1d93){_0x2549af=_['map'](_0x2f1d93,function(_0xcec840){return Number(_0xcec840[_0xad9f('0x58')]);});})[_0xad9f('0x28')](function(){var _0x2583bc='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x3d49da;return db[_0xad9f('0x55')][_0xad9f('0x31')](_0x2583bc,{'type':db[_0xad9f('0x56')][_0xad9f('0x57')][_0xad9f('0x59')],'raw':!![],'transaction':_0xd57cf});})[_0xad9f('0x28')](function(_0x261d2f){var _0x50757a=_['map'](_0x261d2f,function(_0x4999c7){return Number(_0x4999c7[_0xad9f('0x5a')]);});return db['UserVoiceQueue'][_0xad9f('0x52')]({'where':{'UserId':{'$in':_0x2549af},'VoiceQueueId':{'$in':_0x50757a}},'transaction':_0xd57cf});})[_0xad9f('0x28')](function(){var _0x18b9c8=_0xad9f('0x5b')+_0x3d49da;return db[_0xad9f('0x55')][_0xad9f('0x31')](_0x18b9c8,{'type':db['Sequelize'][_0xad9f('0x57')][_0xad9f('0x59')],'raw':!![],'transaction':_0xd57cf});})[_0xad9f('0x28')](function(_0x5c000d){var _0x59d1b8=_[_0xad9f('0x30')](_0x5c000d,function(_0x1432e2){return Number(_0x1432e2[_0xad9f('0x5c')]);});return db[_0xad9f('0x5d')][_0xad9f('0x52')]({'where':{'UserId':{'$in':_0x2549af},'MailQueueId':{'$in':_0x59d1b8}},'transaction':_0xd57cf});})[_0xad9f('0x28')](function(){var _0x2c7c1f=_0xad9f('0x5e')+_0x3d49da;return db[_0xad9f('0x55')][_0xad9f('0x31')](_0x2c7c1f,{'type':db[_0xad9f('0x56')][_0xad9f('0x57')][_0xad9f('0x59')],'raw':!![],'transaction':_0xd57cf});})['then'](function(_0x279608){var _0x2d1284=_[_0xad9f('0x30')](_0x279608,function(_0x41abeb){return Number(_0x41abeb['SmsQueueId']);});return db['UserSmsQueue'][_0xad9f('0x52')]({'where':{'UserId':{'$in':_0x2549af},'SmsQueueId':{'$in':_0x2d1284}},'transaction':_0xd57cf});})[_0xad9f('0x28')](function(){var _0x53b61d='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x3d49da;return db[_0xad9f('0x55')]['query'](_0x53b61d,{'type':db[_0xad9f('0x56')][_0xad9f('0x57')][_0xad9f('0x59')],'raw':!![],'transaction':_0xd57cf});})[_0xad9f('0x28')](function(_0x4c422f){var _0x352129=_['map'](_0x4c422f,function(_0x59a6ad){return Number(_0x59a6ad[_0xad9f('0x5f')]);});return db[_0xad9f('0x60')][_0xad9f('0x52')]({'where':{'UserId':{'$in':_0x2549af},'ChatQueueId':{'$in':_0x352129}},'transaction':_0xd57cf});})[_0xad9f('0x28')](function(){var _0x592b97=_0xad9f('0x61')+_0x3d49da;return db[_0xad9f('0x55')][_0xad9f('0x31')](_0x592b97,{'type':db[_0xad9f('0x56')]['QueryTypes'][_0xad9f('0x59')],'raw':!![],'transaction':_0xd57cf});})[_0xad9f('0x28')](function(_0x2442e4){var _0x4e0263=_[_0xad9f('0x30')](_0x2442e4,function(_0x5d7d3e){return Number(_0x5d7d3e[_0xad9f('0x62')]);});return db[_0xad9f('0x63')][_0xad9f('0x52')]({'where':{'UserId':{'$in':_0x2549af},'FaxQueueId':{'$in':_0x4e0263}},'transaction':_0xd57cf});})[_0xad9f('0x28')](function(){var _0x3ba050='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x3d49da;return db['sequelize'][_0xad9f('0x31')](_0x3ba050,{'type':db[_0xad9f('0x56')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0xd57cf});})[_0xad9f('0x28')](function(_0x24ad15){var _0xd3bf5d=_['map'](_0x24ad15,function(_0xc0efd9){return Number(_0xc0efd9['OpenchannelQueueId']);});return db[_0xad9f('0x64')]['destroy']({'where':{'UserId':{'$in':_0x2549af},'OpenchannelQueueId':{'$in':_0xd3bf5d}},'transaction':_0xd57cf});})[_0xad9f('0x28')](function(){var _0x2a1db4=_0xad9f('0x65')+_0x3d49da;return db[_0xad9f('0x55')][_0xad9f('0x31')](_0x2a1db4,{'type':db[_0xad9f('0x56')][_0xad9f('0x57')][_0xad9f('0x59')],'raw':!![],'transaction':_0xd57cf});})[_0xad9f('0x28')](function(_0x54ec6a){var _0x26d670=_[_0xad9f('0x30')](_0x54ec6a,function(_0x9090c4){return Number(_0x9090c4[_0xad9f('0x66')]);});return db[_0xad9f('0x67')][_0xad9f('0x52')]({'where':{'UserId':{'$in':_0x2549af},'WhatsappQueueId':{'$in':_0x26d670}},'transaction':_0xd57cf});})[_0xad9f('0x28')](function(){return db[_0xad9f('0x68')]['find']({'where':{'TeamId':_0x3d49da}});})[_0xad9f('0x28')](function(_0x318c87){if(_0x318c87===null){return;}return db['UserVoicePrefix'][_0xad9f('0x52')]({'where':{'UserId':{'$in':_0x2549af},'VoicePrefixId':_0x318c87[_0xad9f('0x69')]},'transaction':_0xd57cf});})[_0xad9f('0x28')](function(){return db[_0xad9f('0x2c')][_0xad9f('0x52')]({'where':{'id':_0x3d49da},'cascade':!![],'transaction':_0xd57cf});})[_0xad9f('0x28')](function(_0x4e3098){if(_0x4e3098===0x0){_0x446235[_0xad9f('0x1d')](0x194);}else{return db[_0xad9f('0x4f')]['destroy']({'where':{'type':_0xad9f('0x6a'),'resourceId':_0x3d49da},'cascade':!![],'transaction':_0xd57cf})[_0xad9f('0x28')](function(){_0x446235[_0xad9f('0x1e')](0xcc)[_0xad9f('0x1f')]();});}})[_0xad9f('0x40')](function(_0x24371f){_0x446235[_0xad9f('0x1e')](0x1f4)[_0xad9f('0x6b')](_0x24371f);});});};exports[_0xad9f('0x6c')]=function(_0xf0660b,_0x56cc78,_0x31305b){return db[_0xad9f('0x2c')][_0xad9f('0x6d')]({'where':{'id':_0xf0660b[_0xad9f('0x42')]['id']}})[_0xad9f('0x28')](handleEntityNotFound(_0x56cc78,null))[_0xad9f('0x28')](function(_0xba7a8c){if(!_0xf0660b[_0xad9f('0x31')][_0xad9f('0x6e')]||!utils[_0xad9f('0x6f')](_0xf0660b[_0xad9f('0x31')][_0xad9f('0x6e')])){throw new db[(_0xad9f('0x56'))][(_0xad9f('0x70'))](_0xad9f('0x71'));}var _0x3bffa5={};var _0x34c11b={};_0x34c11b[_0xad9f('0x2f')]=_[_0xad9f('0x43')](db[_[_0xad9f('0x72')](_0xf0660b[_0xad9f('0x31')][_0xad9f('0x6e')][_0xad9f('0x73')]())+_0xad9f('0x74')][_0xad9f('0x44')]);_0x34c11b[_0xad9f('0x31')]=_['keys'](_0xf0660b[_0xad9f('0x31')]);_0x34c11b[_0xad9f('0x32')]=_[_0xad9f('0x33')](_0x34c11b[_0xad9f('0x2f')],_0x34c11b['query']);_0x3bffa5[_0xad9f('0x34')]=_[_0xad9f('0x33')](_0x34c11b['model'],qs[_0xad9f('0x35')](_0xf0660b['query'][_0xad9f('0x35')]));_0x3bffa5[_0xad9f('0x34')]=_0x3bffa5['attributes'][_0xad9f('0x36')]?_0x3bffa5[_0xad9f('0x34')]:_0x34c11b['model'];_0x3bffa5[_0xad9f('0x22')]=qs['limit'](_0xf0660b[_0xad9f('0x31')][_0xad9f('0x22')]);_0x3bffa5['offset']=qs['offset'](_0xf0660b[_0xad9f('0x31')]['offset']);_0x3bffa5['order']=qs['sort'](_0xf0660b['query'][_0xad9f('0x38')]);_0x3bffa5[_0xad9f('0x39')]=qs[_0xad9f('0x32')](_[_0xad9f('0x3a')](_0xf0660b['query'],_0x34c11b[_0xad9f('0x32')]));_0x3bffa5=_[_0xad9f('0x3b')]({},_0x3bffa5,_0xf0660b[_0xad9f('0x3d')]);return _0xba7a8c[_0xad9f('0x49')+_[_0xad9f('0x72')](_0xf0660b['query'][_0xad9f('0x6e')]['toLowerCase']())+_0xad9f('0x75')](_0x3bffa5);})[_0xad9f('0x28')](respondWithResult(_0x56cc78,null))[_0xad9f('0x40')](handleError(_0x56cc78,null));};exports[_0xad9f('0x76')]=function(_0xdc808f,_0x3ccf88,_0x498c48){return db[_0xad9f('0x2c')][_0xad9f('0x6d')]({'where':{'id':_0xdc808f[_0xad9f('0x42')]['id']}})[_0xad9f('0x28')](function(_0x3864d9){if(_0x3864d9){if(!_0xdc808f[_0xad9f('0x48')][_0xad9f('0x6e')]||!utils[_0xad9f('0x6f')](_0xdc808f['body'][_0xad9f('0x6e')])){throw new db[(_0xad9f('0x56'))][(_0xad9f('0x70'))](_0xad9f('0x71'));}return _0x3864d9[_0xad9f('0x77')+_[_0xad9f('0x72')](_0xdc808f[_0xad9f('0x48')][_0xad9f('0x6e')]['toLowerCase']())+_0xad9f('0x75')](_0xdc808f[_0xad9f('0x48')][_0xad9f('0x78')]);}return null;})[_0xad9f('0x28')](handleEntityNotFound(_0x3ccf88,null))[_0xad9f('0x28')](respondWithStatusCode(_0x3ccf88,null))[_0xad9f('0x40')](handleError(_0x3ccf88,null));};exports[_0xad9f('0x79')]=function(_0x41a46e,_0x2ba953,_0x23e859){return db[_0xad9f('0x2c')]['findOne']({'where':{'id':_0x41a46e[_0xad9f('0x42')]['id']}})['then'](function(_0x623709){if(_0x623709){if(!_0x41a46e['query'][_0xad9f('0x6e')]||!utils['isValidChannel'](_0x41a46e[_0xad9f('0x31')][_0xad9f('0x6e')])){throw new db[(_0xad9f('0x56'))][(_0xad9f('0x70'))]('Unknown\x20channel');}return _0x623709['remove'+_[_0xad9f('0x72')](_0x41a46e[_0xad9f('0x31')]['channel'][_0xad9f('0x73')]())+_0xad9f('0x75')](_0x41a46e['query'][_0xad9f('0x78')]);}return null;})['then'](handleEntityNotFound(_0x2ba953,null))[_0xad9f('0x28')](respondWithStatusCode(_0x2ba953,null))[_0xad9f('0x40')](handleError(_0x2ba953,null));};exports[_0xad9f('0x7a')]=function(_0x2e5b5f,_0xea7dbc){var _0x391396=_[_0xad9f('0x7b')](_0x2e5b5f[_0xad9f('0x48')][_0xad9f('0x78')])?_0x2e5b5f[_0xad9f('0x48')][_0xad9f('0x78')]:[_0x2e5b5f[_0xad9f('0x48')][_0xad9f('0x78')]];var _0x584ae4=_0x2e5b5f[_0xad9f('0x42')]['id'];return db['Team'][_0xad9f('0x46')]({'where':{'id':_0x584ae4}})[_0xad9f('0x28')](handleEntityNotFound(_0xea7dbc,null))[_0xad9f('0x28')](function(_0x33e3ff){if(_0x33e3ff){var _0x2f93eb=[_0xad9f('0x7c'),_0xad9f('0x7d'),_0xad9f('0x7e'),'Sms',_0xad9f('0x7f'),_0xad9f('0x80'),_0xad9f('0x81')];return db['sequelize'][_0xad9f('0x53')](function(_0x1d7f42){var _0x4ac065=_[_0xad9f('0x30')](_0x2f93eb,function(_0x1a5a77){var _0x318818={'attributes':['id',_0xad9f('0x2a')]};if(_0x1a5a77===_0xad9f('0x7c')){_0x318818['through']={'attributes':['penalty']};}return _0x33e3ff[_0xad9f('0x49')+_0x1a5a77+'Queues'](_0x318818)[_0xad9f('0x28')](function(_0x1ac581){var _0x3169cc=_[_0xad9f('0x30')](_0x1ac581,function(_0x445cb9){var _0x46842e=_[_0xad9f('0x30')](_0x391396,function(_0x325012){var _0xdb3843={'where':{'UserId':_0x325012,[_0x1a5a77+_0xad9f('0x82')]:_0x445cb9['id']},'transaction':_0x1d7f42};if(_0x1a5a77===_0xad9f('0x7c')){_0xdb3843[_0xad9f('0x19')]={'penalty':_0x445cb9['TeamVoiceQueue']['penalty']};}return db[_0xad9f('0x83')+_0x1a5a77+_0xad9f('0x74')][_0xad9f('0x84')](_0xdb3843)['then'](function(){socket[_0xad9f('0x85')](_0xad9f('0x4c')+_0x1a5a77+_0xad9f('0x86'),{'UserId':_0x325012,[_0x1a5a77+_0xad9f('0x82')]:_0x445cb9['id']});if(_0x1a5a77!==_0xad9f('0x7c')){return;}return db[_0xad9f('0x83')]['findAll']({'where':{'id':_0x391396,'online':0x1},'attributes':['id',_0xad9f('0x2a'),_0xad9f('0x87'),_0xad9f('0x88'),_0xad9f('0x89')],'raw':!![]})[_0xad9f('0x28')](function(_0x364688){var _0x6b5262=_['map'](_0x364688,function(_0x1502ba){return db[_0xad9f('0x8a')][_0xad9f('0x8b')]({'membername':_0x1502ba['name'],'UserId':_0x1502ba['id'],'queue_name':_0x445cb9[_0xad9f('0x2a')],'VoiceQueueId':_0x445cb9['id'],'interface':_[_0xad9f('0x8c')](_0x1502ba[_0xad9f('0x89')])?util['format']('SIP/%s',_0x1502ba[_0xad9f('0x2a')]):_0x1502ba[_0xad9f('0x89')],'paused':_0x1502ba['voicePause']||![],'penalty':_0x445cb9[_0xad9f('0x8d')][_0xad9f('0x8e')]},{'transaction':_0x1d7f42});});return Promise[_0xad9f('0x8f')](_0x6b5262);});});});return Promise[_0xad9f('0x8f')](_0x46842e);});return Promise[_0xad9f('0x8f')](_0x3169cc);})[_0xad9f('0x28')](function(){return db[_0xad9f('0x68')][_0xad9f('0x6d')]({'where':{'teamId':_0x584ae4}})[_0xad9f('0x28')](function(_0x3f1ba0){if(_0x3f1ba0){var _0x26c6db=_[_0xad9f('0x30')](_0x391396,function(_0x426393){db['UserVoicePrefix'][_0xad9f('0x8b')]({'UserId':_0x426393,'VoicePrefixId':_0x3f1ba0[_0xad9f('0x69')]});});return Promise[_0xad9f('0x8f')](_0x26c6db);}});});});return Promise[_0xad9f('0x8f')](_0x4ac065)[_0xad9f('0x28')](function(){return _0x33e3ff['addAgents'](_0x391396,{'transaction':_0x1d7f42})['spread'](function(_0x1874ec){return _0x1874ec;});});});}})[_0xad9f('0x28')](respondWithResult(_0xea7dbc,null))[_0xad9f('0x40')](handleError(_0xea7dbc,null));};exports[_0xad9f('0x90')]=function(_0x34582f,_0x1c2a66){var _0x21a84f=_[_0xad9f('0x7b')](_0x34582f[_0xad9f('0x31')]['ids'])?_0x34582f[_0xad9f('0x31')]['ids']:[_0x34582f[_0xad9f('0x31')][_0xad9f('0x78')]];var _0x5341f9=_0x34582f[_0xad9f('0x42')]['id'];return db[_0xad9f('0x2c')]['find']({'where':{'id':_0x5341f9}})[_0xad9f('0x28')](handleEntityNotFound(_0x1c2a66,null))[_0xad9f('0x28')](function(_0x11b7e2){if(_0x11b7e2){var _0x4cc9eb=['Voice',_0xad9f('0x7d'),'Mail',_0xad9f('0x91'),'Fax',_0xad9f('0x80'),'Whatsapp'];return db[_0xad9f('0x55')][_0xad9f('0x53')](function(_0x1c036f){var _0x59e12c=_[_0xad9f('0x30')](_0x4cc9eb,function(_0x5527e2){var _0x2c6b16={'attributes':['id',_0xad9f('0x2a')]};return _0x11b7e2['get'+_0x5527e2+_0xad9f('0x75')](_0x2c6b16)[_0xad9f('0x28')](function(_0x3f3c65){var _0x53c655=_[_0xad9f('0x30')](_0x3f3c65,function(_0x3feea5){return _0x3feea5[_0xad9f('0x90')](_0x21a84f,{'transaction':_0x1c036f})[_0xad9f('0x28')](function(){var _0x42fd10=_['map'](_0x21a84f,function(_0x1b674e){socket['emit'](_0xad9f('0x4c')+_0x5527e2+'Queue:remove',{'UserId':Number(_0x1b674e),[_0x5527e2+_0xad9f('0x82')]:_0x3feea5['id']});if(_0x5527e2!==_0xad9f('0x7c')){return;}return db[_0xad9f('0x8a')][_0xad9f('0x52')]({'where':{'VoiceQueueId':_0x3feea5['id'],'UserId':_0x1b674e},'transaction':_0x1c036f});});return Promise[_0xad9f('0x8f')](_0x42fd10);});});return Promise[_0xad9f('0x8f')](_0x53c655);});});return Promise[_0xad9f('0x8f')](_0x59e12c)[_0xad9f('0x28')](function(){return _0x11b7e2[_0xad9f('0x90')](_0x21a84f,{'transaction':_0x1c036f});})[_0xad9f('0x28')](function(){return db['TeamVoicePrefix'][_0xad9f('0x6d')]({'where':{'teamId':_0x5341f9}})[_0xad9f('0x28')](function(_0x94c277){if(_0x94c277){var _0x55cd91=_['map'](_0x21a84f,function(_0x4a1fe8){db['UserVoicePrefix'][_0xad9f('0x52')]({'where':{'UserId':_0x4a1fe8,'VoicePrefixId':_0x94c277[_0xad9f('0x69')]}});});return Promise['all'](_0x55cd91);}});});});}})['then'](respondWithStatusCode(_0x1c2a66,null))['catch'](handleError(_0x1c2a66,null));};exports['getAgents']=function(_0x114032,_0x3e01a7,_0x39789f){var _0x5a2eca={};var _0x42dcee={};var _0x3f3d67;var _0x52e23f;return db[_0xad9f('0x2c')]['findOne']({'where':{'id':_0x114032[_0xad9f('0x42')]['id']}})['then'](handleEntityNotFound(_0x3e01a7,null))[_0xad9f('0x28')](function(_0xb1e57d){if(_0xb1e57d){_0x3f3d67=_0xb1e57d;_0x42dcee[_0xad9f('0x2f')]=_[_0xad9f('0x43')](db[_0xad9f('0x83')][_0xad9f('0x44')]);_0x42dcee[_0xad9f('0x31')]=_[_0xad9f('0x43')](_0x114032[_0xad9f('0x31')]);_0x42dcee[_0xad9f('0x32')]=_[_0xad9f('0x33')](_0x42dcee['model'],_0x42dcee[_0xad9f('0x31')]);_0x5a2eca[_0xad9f('0x34')]=_['intersection'](_0x42dcee[_0xad9f('0x2f')],qs[_0xad9f('0x35')](_0x114032[_0xad9f('0x31')]['fields']));_0x5a2eca[_0xad9f('0x34')]=_0x5a2eca[_0xad9f('0x34')][_0xad9f('0x36')]?_0x5a2eca['attributes']:_0x42dcee['model'];_0x5a2eca[_0xad9f('0x92')]=qs[_0xad9f('0x38')](_0x114032[_0xad9f('0x31')][_0xad9f('0x38')]);_0x5a2eca[_0xad9f('0x39')]=qs['filters'](_[_0xad9f('0x3a')](_0x114032[_0xad9f('0x31')],_0x42dcee[_0xad9f('0x32')]));if(_0x114032[_0xad9f('0x31')][_0xad9f('0x3c')]){_0x5a2eca[_0xad9f('0x39')]=_[_0xad9f('0x3b')](_0x5a2eca['where'],{'$or':_[_0xad9f('0x30')](_0x5a2eca[_0xad9f('0x34')],function(_0x37d10e){var _0x1e4e24={};_0x1e4e24[_0x37d10e]={'$like':'%'+_0x114032[_0xad9f('0x31')][_0xad9f('0x3c')]+'%'};return _0x1e4e24;})});}_0x5a2eca=_[_0xad9f('0x3b')]({},_0x5a2eca,_0x114032[_0xad9f('0x3d')]);return _0x3f3d67[_0xad9f('0x93')](_0x5a2eca);}})[_0xad9f('0x28')](function(_0x511649){if(_0x511649){_0x52e23f=_0x511649[_0xad9f('0x36')];if(!_0x114032['query']['hasOwnProperty'](_0xad9f('0x94'))){_0x5a2eca['limit']=qs[_0xad9f('0x22')](_0x114032[_0xad9f('0x31')][_0xad9f('0x22')]);_0x5a2eca['offset']=qs['offset'](_0x114032['query'][_0xad9f('0x20')]);}return _0x3f3d67[_0xad9f('0x93')](_0x5a2eca);}})[_0xad9f('0x28')](function(_0x26f7ce){if(_0x26f7ce){return _0x26f7ce?{'count':_0x52e23f,'rows':_0x26f7ce}:null;}})[_0xad9f('0x28')](respondWithResult(_0x3e01a7,null))['catch'](handleError(_0x3e01a7,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index acc08b0..b1493b6 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 _0x74a5=['events','../../mysqldb','Team','save','remove','emit','hasOwnProperty','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x74a5,0x1f0));var _0x574a=function(_0x4c19cc,_0x24e1c4){_0x4c19cc=_0x4c19cc-0x0;var _0x2d9319=_0x74a5[_0x4c19cc];return _0x2d9319;};'use strict';var EventEmitter=require(_0x574a('0x0'));var Team=require(_0x574a('0x1'))['db'][_0x574a('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x574a('0x3'),'afterUpdate':'update','afterDestroy':_0x574a('0x4')};function emitEvent(_0x45d911){return function(_0x573dad,_0xd8e33f,_0x222ffa){TeamEvents[_0x574a('0x5')](_0x45d911+':'+_0x573dad['id'],_0x573dad);TeamEvents[_0x574a('0x5')](_0x45d911,_0x573dad);_0x222ffa(null);};}for(var e in events){if(events[_0x574a('0x6')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x574a('0x7')]=TeamEvents; \ No newline at end of file +var _0x676b=['hook','exports','Team','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x2bb0f3,_0x1ae901){var _0x2291c=function(_0x69f239){while(--_0x69f239){_0x2bb0f3['push'](_0x2bb0f3['shift']());}};_0x2291c(++_0x1ae901);}(_0x676b,0x12b));var _0xb676=function(_0x249e96,_0x3ea39d){_0x249e96=_0x249e96-0x0;var _0x17444c=_0x676b[_0x249e96];return _0x17444c;};'use strict';var EventEmitter=require('events');var Team=require('../../mysqldb')['db'][_0xb676('0x0')];var TeamEvents=new EventEmitter();TeamEvents[_0xb676('0x1')](0x0);var events={'afterCreate':_0xb676('0x2'),'afterUpdate':_0xb676('0x3'),'afterDestroy':_0xb676('0x4')};function emitEvent(_0x370928){return function(_0x431402,_0x31173b,_0x872be4){TeamEvents[_0xb676('0x5')](_0x370928+':'+_0x431402['id'],_0x431402);TeamEvents[_0xb676('0x5')](_0x370928,_0x431402);_0x872be4(null);};}for(var e in events){if(events[_0xb676('0x6')](e)){var event=events[e];Team[_0xb676('0x7')](e,emitEvent(event));}}module[_0xb676('0x8')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 13f178a..83be59a 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 _0x0079=['all','catch','lodash','./team.attributes','get','Queues','then','setDataValue','channel','exports','define','teams','Chat','Fax','Openchannel','Sms','Voice','Whatsapp','map'];(function(_0x437925,_0x3d5e14){var _0x1cdbe9=function(_0x16b8ae){while(--_0x16b8ae){_0x437925['push'](_0x437925['shift']());}};_0x1cdbe9(++_0x3d5e14);}(_0x0079,0x1dd));var _0x9007=function(_0x2c7614,_0x19084b){_0x2c7614=_0x2c7614-0x0;var _0xbc26d9=_0x0079[_0x2c7614];return _0xbc26d9;};'use strict';var _=require(_0x9007('0x0'));var attributes=require(_0x9007('0x1'));function getQueuesByChannel(_0xc42868,_0x746176){var _0x1beede=_0x9007('0x2')+_0x746176+_0x9007('0x3');return _0xc42868[_0x1beede]()[_0x9007('0x4')](function(_0x5947f6){return _['map'](_0x5947f6,function(_0x4708aa){_0x4708aa[_0x9007('0x5')](_0x9007('0x6'),_0x746176);return _0x4708aa;});})['catch'](function(_0x2c0c3b){throw _0x2c0c3b;});}module[_0x9007('0x7')]=function(_0x8aa7df){return _0x8aa7df[_0x9007('0x8')]('Team',attributes,{'tableName':_0x9007('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x31b153=this;var _0x319555=[_0x9007('0xa'),_0x9007('0xb'),'Mail',_0x9007('0xc'),_0x9007('0xd'),_0x9007('0xe'),_0x9007('0xf')];return Promise['resolve']()['then'](function(){var _0x2be3c1=_[_0x9007('0x10')](_0x319555,function(_0x239cd9){return getQueuesByChannel(_0x31b153,_0x239cd9);});return Promise[_0x9007('0x11')](_0x2be3c1);})[_0x9007('0x12')](function(_0x25c681){throw _0x25c681;});}}});}; \ No newline at end of file +var _0x3128=['all','lodash','./team.attributes','get','Queues','map','setDataValue','channel','catch','exports','define','Team','Chat','Fax','Mail','Sms','Voice','resolve','then'];(function(_0x4e623c,_0x110ef0){var _0x43fbbf=function(_0x38eafe){while(--_0x38eafe){_0x4e623c['push'](_0x4e623c['shift']());}};_0x43fbbf(++_0x110ef0);}(_0x3128,0x73));var _0x8312=function(_0x1e070f,_0x5bf5e1){_0x1e070f=_0x1e070f-0x0;var _0x318ec7=_0x3128[_0x1e070f];return _0x318ec7;};'use strict';var _=require(_0x8312('0x0'));var attributes=require(_0x8312('0x1'));function getQueuesByChannel(_0x3c9d44,_0x3f6f09){var _0x56e888=_0x8312('0x2')+_0x3f6f09+_0x8312('0x3');return _0x3c9d44[_0x56e888]()['then'](function(_0x35c9a8){return _[_0x8312('0x4')](_0x35c9a8,function(_0x56c784){_0x56c784[_0x8312('0x5')](_0x8312('0x6'),_0x3f6f09);return _0x56c784;});})[_0x8312('0x7')](function(_0x2e11ae){throw _0x2e11ae;});}module[_0x8312('0x8')]=function(_0x3ea232){return _0x3ea232[_0x8312('0x9')](_0x8312('0xa'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x15517c=this;var _0x553303=[_0x8312('0xb'),_0x8312('0xc'),_0x8312('0xd'),'Openchannel',_0x8312('0xe'),_0x8312('0xf'),'Whatsapp'];return Promise[_0x8312('0x10')]()[_0x8312('0x11')](function(){var _0x61533b=_['map'](_0x553303,function(_0x58818e){return getQueuesByChannel(_0x15517c,_0x58818e);});return Promise[_0x8312('0x12')](_0x61533b);})[_0x8312('0x7')](function(_0x132a5e){throw _0x132a5e;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 53bc6fe..c5d11f2 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 _0x5da3=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','request','info','Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x2a3248,_0x1fcd9c){var _0x1af4ce=function(_0x4de5d7){while(--_0x4de5d7){_0x2a3248['push'](_0x2a3248['shift']());}};_0x1af4ce(++_0x1fcd9c);}(_0x5da3,0xe2));var _0x35da=function(_0x4b635a,_0x8d01b2){_0x4b635a=_0x4b635a-0x0;var _0x3de488=_0x5da3[_0x4b635a];return _0x3de488;};'use strict';var _=require(_0x35da('0x0'));var util=require(_0x35da('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x35da('0x2'));var fs=require('fs');var Redis=require(_0x35da('0x3'));var db=require(_0x35da('0x4'))['db'];var utils=require(_0x35da('0x5'));var logger=require('../../config/logger')(_0x35da('0x6'));var config=require(_0x35da('0x7'));var jayson=require(_0x35da('0x8'));var client=jayson[_0x35da('0x9')][_0x35da('0xa')]({'port':0x232a});config[_0x35da('0xb')]=_[_0x35da('0xc')](config['redis'],{'host':_0x35da('0xd'),'port':0x18eb});var socket=require(_0x35da('0xe'))(new Redis(config['redis']));require(_0x35da('0xf'))['register'](socket);function respondWithRpcPromise(_0x244894,_0x3bd6e6,_0x505c7e){return new BPromise(function(_0x780167,_0x2764c5){return client[_0x35da('0x10')](_0x244894,_0x505c7e)['then'](function(_0x57930f){logger[_0x35da('0x11')](_0x35da('0x12'),_0x3bd6e6,_0x35da('0x13'));logger['debug'](_0x35da('0x14'),_0x3bd6e6,'request\x20sent',JSON['stringify'](_0x57930f));if(_0x57930f['error']){if(_0x57930f['error'][_0x35da('0x15')]===0x1f4){logger[_0x35da('0x16')](_0x35da('0x12'),_0x3bd6e6,_0x57930f[_0x35da('0x16')][_0x35da('0x17')]);return _0x2764c5(_0x57930f[_0x35da('0x16')][_0x35da('0x17')]);}logger['error'](_0x35da('0x12'),_0x3bd6e6,_0x57930f['error'][_0x35da('0x17')]);return _0x780167(_0x57930f['error'][_0x35da('0x17')]);}else{logger['info']('Team,\x20%s,\x20%s',_0x3bd6e6,_0x35da('0x13'));_0x780167(_0x57930f[_0x35da('0x18')][_0x35da('0x17')]);}})[_0x35da('0x19')](function(_0x5b7dbc){logger[_0x35da('0x16')](_0x35da('0x12'),_0x3bd6e6,_0x5b7dbc);_0x2764c5(_0x5b7dbc);});});} \ No newline at end of file +var _0x5c39=['stringify','error','code','message','info','result','catch','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./team.socket','request','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s'];(function(_0x1a56ee,_0x2c6447){var _0x19591f=function(_0x71606a){while(--_0x71606a){_0x1a56ee['push'](_0x1a56ee['shift']());}};_0x19591f(++_0x2c6447);}(_0x5c39,0x165));var _0x95c3=function(_0x46047a,_0x24bd2b){_0x46047a=_0x46047a-0x0;var _0x48f043=_0x5c39[_0x46047a];return _0x48f043;};'use strict';var _=require('lodash');var util=require(_0x95c3('0x0'));var moment=require(_0x95c3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x95c3('0x2'))['db'];var utils=require(_0x95c3('0x3'));var logger=require(_0x95c3('0x4'))(_0x95c3('0x5'));var config=require(_0x95c3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x95c3('0x7')][_0x95c3('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0x95c3('0x9')],{'host':_0x95c3('0xa'),'port':0x18eb});var socket=require(_0x95c3('0xb'))(new Redis(config[_0x95c3('0x9')]));require(_0x95c3('0xc'))['register'](socket);function respondWithRpcPromise(_0x5f14e6,_0x540334,_0x164682){return new BPromise(function(_0x3862ac,_0x14b887){return client[_0x95c3('0xd')](_0x5f14e6,_0x164682)['then'](function(_0x2a9466){logger['info'](_0x95c3('0xe'),_0x540334,_0x95c3('0xf'));logger[_0x95c3('0x10')](_0x95c3('0x11'),_0x540334,_0x95c3('0xf'),JSON[_0x95c3('0x12')](_0x2a9466));if(_0x2a9466['error']){if(_0x2a9466[_0x95c3('0x13')][_0x95c3('0x14')]===0x1f4){logger[_0x95c3('0x13')](_0x95c3('0xe'),_0x540334,_0x2a9466['error'][_0x95c3('0x15')]);return _0x14b887(_0x2a9466[_0x95c3('0x13')][_0x95c3('0x15')]);}logger[_0x95c3('0x13')](_0x95c3('0xe'),_0x540334,_0x2a9466['error'][_0x95c3('0x15')]);return _0x3862ac(_0x2a9466[_0x95c3('0x13')][_0x95c3('0x15')]);}else{logger[_0x95c3('0x16')](_0x95c3('0xe'),_0x540334,_0x95c3('0xf'));_0x3862ac(_0x2a9466[_0x95c3('0x17')][_0x95c3('0x15')]);}})[_0x95c3('0x18')](function(_0x53aae9){logger[_0x95c3('0x13')]('Team,\x20%s,\x20%s',_0x540334,_0x53aae9);_0x14b887(_0x53aae9);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 8e06a60..60a10c3 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 _0x0b37=['remove','update','emit','removeListener','register','length','team:','save'];(function(_0x6d6015,_0x1bd8ee){var _0x320f10=function(_0x17c451){while(--_0x17c451){_0x6d6015['push'](_0x6d6015['shift']());}};_0x320f10(++_0x1bd8ee);}(_0x0b37,0x1d7));var _0x70b3=function(_0x5c498f,_0xc71f35){_0x5c498f=_0x5c498f-0x0;var _0x34b976=_0x0b37[_0x5c498f];return _0x34b976;};'use strict';var TeamEvents=require('./team.events');var events=[_0x70b3('0x0'),_0x70b3('0x1'),_0x70b3('0x2')];function createListener(_0x361a7d,_0x4840db){return function(_0x2a5f51){_0x4840db[_0x70b3('0x3')](_0x361a7d,_0x2a5f51);};}function removeListener(_0x320fd0,_0x43fe6e){return function(){TeamEvents[_0x70b3('0x4')](_0x320fd0,_0x43fe6e);};}exports[_0x70b3('0x5')]=function(_0x50a82c){for(var _0xbef934=0x0,_0x4accfa=events[_0x70b3('0x6')];_0xbef934<_0x4accfa;_0xbef934++){var _0x12b986=events[_0xbef934];var _0x344ea2=createListener(_0x70b3('0x7')+_0x12b986,_0x50a82c);TeamEvents['on'](_0x12b986,_0x344ea2);}}; \ No newline at end of file +var _0x8bef=['register','length','team:','./team.events','save','remove','update','emit','removeListener'];(function(_0x4297a0,_0x462974){var _0x139f6e=function(_0x2e9a26){while(--_0x2e9a26){_0x4297a0['push'](_0x4297a0['shift']());}};_0x139f6e(++_0x462974);}(_0x8bef,0x66));var _0xf8be=function(_0x1a20ec,_0x27626c){_0x1a20ec=_0x1a20ec-0x0;var _0x3a2ec1=_0x8bef[_0x1a20ec];return _0x3a2ec1;};'use strict';var TeamEvents=require(_0xf8be('0x0'));var events=[_0xf8be('0x1'),_0xf8be('0x2'),_0xf8be('0x3')];function createListener(_0x4398fd,_0x53d752){return function(_0x2dd53c){_0x53d752[_0xf8be('0x4')](_0x4398fd,_0x2dd53c);};}function removeListener(_0x335ee3,_0x306f7a){return function(){TeamEvents[_0xf8be('0x5')](_0x335ee3,_0x306f7a);};}exports[_0xf8be('0x6')]=function(_0x86bf8e){for(var _0x3238f1=0x0,_0x226cb8=events[_0xf8be('0x7')];_0x3238f1<_0x226cb8;_0x3238f1++){var _0x5a53f9=events[_0x3238f1];var _0x3ff5d2=createListener(_0xf8be('0x8')+_0x5a53f9,_0x86bf8e);TeamEvents['on'](_0x5a53f9,_0x3ff5d2);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index fa96fd8..75970f3 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 _0x3ae9=['INTEGER'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x3ae9,0xdb));var _0x93ae=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x3ae9[_0x187ee1];return _0x388160;};'use strict';var Sequelize=require('sequelize');module['exports']={'TeamId':{'type':Sequelize[_0x93ae('0x0')]},'VoicePrefixId':{'type':Sequelize[_0x93ae('0x0')]}}; \ No newline at end of file +var _0x4b8a=['INTEGER','exports'];(function(_0x4f1a90,_0x4dd811){var _0x298050=function(_0xc74433){while(--_0xc74433){_0x4f1a90['push'](_0x4f1a90['shift']());}};_0x298050(++_0x4dd811);}(_0x4b8a,0xd3));var _0xa4b8=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4b8a[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require('sequelize');module[_0xa4b8('0x0')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xa4b8('0x1')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index b024433..88ad9c5 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 _0x2ec8=['bluebird','rimraf','./teamVoicePrefix.attributes','exports','team_has_voice_prefixes','lodash','util','../../config/logger','api'];(function(_0x3dc68d,_0x1c1951){var _0xdf7f94=function(_0x339428){while(--_0x339428){_0x3dc68d['push'](_0x3dc68d['shift']());}};_0xdf7f94(++_0x1c1951);}(_0x2ec8,0x188));var _0x82ec=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x2ec8[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x82ec('0x0'));var util=require(_0x82ec('0x1'));var logger=require(_0x82ec('0x2'))(_0x82ec('0x3'));var moment=require('moment');var BPromise=require(_0x82ec('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x82ec('0x5'));var config=require('../../config/environment');var attributes=require(_0x82ec('0x6'));module[_0x82ec('0x7')]=function(_0x528e26,_0x4c9400){return _0x528e26['define']('TeamVoicePrefix',attributes,{'tableName':_0x82ec('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4a3c=['bluebird','request-promise','path','rimraf','./teamVoicePrefix.attributes','exports','lodash','../../config/logger','api','moment'];(function(_0x6dfbaa,_0x31eede){var _0xfbe02=function(_0x4adcaf){while(--_0x4adcaf){_0x6dfbaa['push'](_0x6dfbaa['shift']());}};_0xfbe02(++_0x31eede);}(_0x4a3c,0x13c));var _0xc4a3=function(_0x28c00b,_0x49a01f){_0x28c00b=_0x28c00b-0x0;var _0x3cb455=_0x4a3c[_0x28c00b];return _0x3cb455;};'use strict';var _=require(_0xc4a3('0x0'));var util=require('util');var logger=require(_0xc4a3('0x1'))(_0xc4a3('0x2'));var moment=require(_0xc4a3('0x3'));var BPromise=require(_0xc4a3('0x4'));var rp=require(_0xc4a3('0x5'));var fs=require('fs');var path=require(_0xc4a3('0x6'));var rimraf=require(_0xc4a3('0x7'));var config=require('../../config/environment');var attributes=require(_0xc4a3('0x8'));module[_0xc4a3('0x9')]=function(_0x26db49,_0x3a4100){return _0x26db49['define']('TeamVoicePrefix',attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 6253f15..18c6639 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x466bc6,_0xefa09a){var _0x56d62b=function(_0x2c8723){while(--_0x2c8723){_0x466bc6['push'](_0x466bc6['shift']());}};_0x56d62b(++_0xefa09a);}(_0x70e0,0x17b));var _0x070e=function(_0x5b841c,_0x3fe0e8){_0x5b841c=_0x5b841c-0x0;var _0x24d054=_0x70e0[_0x5b841c];return _0x24d054;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x2571ac,_0x54e4a6){var _0x2e0924=function(_0x2b8c4e){while(--_0x2b8c4e){_0x2571ac['push'](_0x2571ac['shift']());}};_0x2e0924(++_0x54e4a6);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x35fb56,_0x5dadff){_0x35fb56=_0x35fb56-0x0;var _0x2fd52c=_0xcb91[_0x35fb56];return _0x2fd52c;};'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 61b2e14..9b5e5a3 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 _0xff00=['exports','sequelize'];(function(_0xc90c0b,_0x284a05){var _0x6030aa=function(_0x3c32f5){while(--_0x3c32f5){_0xc90c0b['push'](_0xc90c0b['shift']());}};_0x6030aa(++_0x284a05);}(_0xff00,0x1e9));var _0x0ff0=function(_0x187d52,_0x2eddbd){_0x187d52=_0x187d52-0x0;var _0xd0a834=_0xff00[_0x187d52];return _0xd0a834;};'use strict';var Sequelize=require(_0x0ff0('0x0'));module[_0x0ff0('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x2922=['sequelize','exports','INTEGER'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0x2922,0x6c));var _0x2292=function(_0x2049a0,_0x396bec){_0x2049a0=_0x2049a0-0x0;var _0x346277=_0x2922[_0x2049a0];return _0x346277;};'use strict';var Sequelize=require(_0x2292('0x0'));module[_0x2292('0x1')]={'penalty':{'type':Sequelize[_0x2292('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index 57e12e8..2ccc41f 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 _0x3613=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./teamVoiceQueue.attributes','exports','define','team_has_voice_queues'];(function(_0x3ec4fd,_0x332803){var _0x56ac07=function(_0xfa116c){while(--_0xfa116c){_0x3ec4fd['push'](_0x3ec4fd['shift']());}};_0x56ac07(++_0x332803);}(_0x3613,0x198));var _0x3361=function(_0x1dbc9b,_0x47fd40){_0x1dbc9b=_0x1dbc9b-0x0;var _0x72f556=_0x3613[_0x1dbc9b];return _0x72f556;};'use strict';var _=require(_0x3361('0x0'));var util=require(_0x3361('0x1'));var logger=require(_0x3361('0x2'))(_0x3361('0x3'));var moment=require(_0x3361('0x4'));var BPromise=require(_0x3361('0x5'));var rp=require(_0x3361('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3361('0x7'));var config=require('../../config/environment');var attributes=require(_0x3361('0x8'));module[_0x3361('0x9')]=function(_0xa1bc1b,_0x2e2d6c){return _0xa1bc1b[_0x3361('0xa')]('TeamVoiceQueue',attributes,{'tableName':_0x3361('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x861c=['request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1c85ec,_0x4fd210){var _0x3c72ed=function(_0x265e1a){while(--_0x265e1a){_0x1c85ec['push'](_0x1c85ec['shift']());}};_0x3c72ed(++_0x4fd210);}(_0x861c,0xdb));var _0xc861=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x861c[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xc861('0x0'));var util=require(_0xc861('0x1'));var logger=require(_0xc861('0x2'))(_0xc861('0x3'));var moment=require(_0xc861('0x4'));var BPromise=require(_0xc861('0x5'));var rp=require(_0xc861('0x6'));var fs=require('fs');var path=require(_0xc861('0x7'));var rimraf=require(_0xc861('0x8'));var config=require(_0xc861('0x9'));var attributes=require(_0xc861('0xa'));module[_0xc861('0xb')]=function(_0x562f12,_0xc3b5fd){return _0x562f12[_0xc861('0xc')](_0xc861('0xd'),attributes,{'tableName':_0xc861('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index 274f26b..8932e84 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 _0x3b75=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x2eb8a9,_0x5dc015){var _0x4975ff=function(_0x419d0c){while(--_0x419d0c){_0x2eb8a9['push'](_0x2eb8a9['shift']());}};_0x4975ff(++_0x5dc015);}(_0x3b75,0x144));var _0x53b7=function(_0x189c9e,_0x1c3b55){_0x189c9e=_0x189c9e-0x0;var _0x3f38ca=_0x3b75[_0x189c9e];return _0x3f38ca;};'use strict';var _=require(_0x53b7('0x0'));var util=require(_0x53b7('0x1'));var moment=require(_0x53b7('0x2'));var BPromise=require(_0x53b7('0x3'));var rs=require(_0x53b7('0x4'));var fs=require('fs');var Redis=require(_0x53b7('0x5'));var db=require(_0x53b7('0x6'))['db'];var utils=require(_0x53b7('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x53b7('0x8'));var jayson=require(_0x53b7('0x9'));var client=jayson[_0x53b7('0xa')][_0x53b7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e87d4,_0x4dd362,_0x13d9c7){return new BPromise(function(_0x42a770,_0x3eccbf){return client[_0x53b7('0xc')](_0x4e87d4,_0x13d9c7)[_0x53b7('0xd')](function(_0x4838a1){logger[_0x53b7('0xe')](_0x53b7('0xf'),_0x4dd362,_0x53b7('0x10'));logger[_0x53b7('0x11')](_0x53b7('0x12'),_0x4dd362,_0x53b7('0x10'),JSON['stringify'](_0x4838a1));if(_0x4838a1['error']){if(_0x4838a1[_0x53b7('0x13')]['code']===0x1f4){logger[_0x53b7('0x13')]('TeamVoiceQueue,\x20%s,\x20%s',_0x4dd362,_0x4838a1[_0x53b7('0x13')][_0x53b7('0x14')]);return _0x3eccbf(_0x4838a1[_0x53b7('0x13')]['message']);}logger[_0x53b7('0x13')](_0x53b7('0xf'),_0x4dd362,_0x4838a1['error']['message']);return _0x42a770(_0x4838a1[_0x53b7('0x13')][_0x53b7('0x14')]);}else{logger[_0x53b7('0xe')](_0x53b7('0xf'),_0x4dd362,_0x53b7('0x10'));_0x42a770(_0x4838a1['result'][_0x53b7('0x14')]);}})[_0x53b7('0x15')](function(_0x23bc46){logger[_0x53b7('0x13')](_0x53b7('0xf'),_0x4dd362,_0x23bc46);_0x3eccbf(_0x23bc46);});});} \ No newline at end of file +var _0x5089=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x459423,_0x3416a8){var _0x42ed14=function(_0x1d4f69){while(--_0x1d4f69){_0x459423['push'](_0x459423['shift']());}};_0x42ed14(++_0x3416a8);}(_0x5089,0x1bb));var _0x9508=function(_0x2181fc,_0x7283aa){_0x2181fc=_0x2181fc-0x0;var _0x315da1=_0x5089[_0x2181fc];return _0x315da1;};'use strict';var _=require(_0x9508('0x0'));var util=require(_0x9508('0x1'));var moment=require('moment');var BPromise=require(_0x9508('0x2'));var rs=require(_0x9508('0x3'));var fs=require('fs');var Redis=require(_0x9508('0x4'));var db=require(_0x9508('0x5'))['db'];var utils=require(_0x9508('0x6'));var logger=require('../../config/logger')(_0x9508('0x7'));var config=require('../../config/environment');var jayson=require(_0x9508('0x8'));var client=jayson[_0x9508('0x9')][_0x9508('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ab3c6,_0x1dc04c,_0x42d13a){return new BPromise(function(_0x55a5de,_0x14dae7){return client[_0x9508('0xb')](_0x4ab3c6,_0x42d13a)['then'](function(_0x342ddd){logger['info'](_0x9508('0xc'),_0x1dc04c,_0x9508('0xd'));logger[_0x9508('0xe')](_0x9508('0xf'),_0x1dc04c,_0x9508('0xd'),JSON[_0x9508('0x10')](_0x342ddd));if(_0x342ddd['error']){if(_0x342ddd[_0x9508('0x11')]['code']===0x1f4){logger[_0x9508('0x11')](_0x9508('0xc'),_0x1dc04c,_0x342ddd['error'][_0x9508('0x12')]);return _0x14dae7(_0x342ddd[_0x9508('0x11')][_0x9508('0x12')]);}logger[_0x9508('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x1dc04c,_0x342ddd[_0x9508('0x11')][_0x9508('0x12')]);return _0x55a5de(_0x342ddd['error'][_0x9508('0x12')]);}else{logger['info'](_0x9508('0xc'),_0x1dc04c,_0x9508('0xd'));_0x55a5de(_0x342ddd[_0x9508('0x13')][_0x9508('0x12')]);}})[_0x9508('0x14')](function(_0x343802){logger[_0x9508('0x11')](_0x9508('0xc'),_0x1dc04c,_0x343802);_0x14dae7(_0x343802);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 7fc2640..651fd15 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 _0x160f=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','isAuthenticated','index','create','put','/:id','destroy','multer'];(function(_0x5309a8,_0x2f7a49){var _0x52725c=function(_0xcda479){while(--_0xcda479){_0x5309a8['push'](_0x5309a8['shift']());}};_0x52725c(++_0x2f7a49);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xf160('0x0'));var util=require(_0xf160('0x1'));var path=require(_0xf160('0x2'));var timeout=require(_0xf160('0x3'));var express=require('express');var router=express[_0xf160('0x4')]();var fs_extra=require(_0xf160('0x5'));var auth=require(_0xf160('0x6'));var interaction=require(_0xf160('0x7'));var config=require(_0xf160('0x8'));var controller=require(_0xf160('0x9'));router['get']('/',auth[_0xf160('0xa')](),controller[_0xf160('0xb')]);router['get']('/:id',auth[_0xf160('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xf160('0xc')]);router[_0xf160('0xd')](_0xf160('0xe'),auth[_0xf160('0xa')](),controller['update']);router['delete'](_0xf160('0xe'),auth[_0xf160('0xa')](),controller[_0xf160('0xf')]);module['exports']=router; \ No newline at end of file +var _0xf470=['../../components/interaction/service','./template.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x2eeb33,_0x5ae35a){var _0x568f7f=function(_0x4c7c82){while(--_0x4c7c82){_0x2eeb33['push'](_0x2eeb33['shift']());}};_0x568f7f(++_0x5ae35a);}(_0xf470,0xfd));var _0x0f47=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0xf470[_0x2aa0e7];return _0x1472c0;};'use strict';var multer=require(_0x0f47('0x0'));var util=require(_0x0f47('0x1'));var path=require(_0x0f47('0x2'));var timeout=require(_0x0f47('0x3'));var express=require(_0x0f47('0x4'));var router=express[_0x0f47('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0f47('0x6'));var interaction=require(_0x0f47('0x7'));var config=require('../../config/environment');var controller=require(_0x0f47('0x8'));router[_0x0f47('0x9')]('/',auth[_0x0f47('0xa')](),controller[_0x0f47('0xb')]);router[_0x0f47('0x9')](_0x0f47('0xc'),auth[_0x0f47('0xa')](),controller[_0x0f47('0xd')]);router[_0x0f47('0xe')]('/',auth[_0x0f47('0xa')](),controller[_0x0f47('0xf')]);router[_0x0f47('0x10')](_0x0f47('0xc'),auth[_0x0f47('0xa')](),controller[_0x0f47('0x11')]);router[_0x0f47('0x12')](_0x0f47('0xc'),auth[_0x0f47('0xa')](),controller[_0x0f47('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 296330c..e75365d 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 _0x68c0=['STRING','sequelize','exports'];(function(_0x9a2a6f,_0x596c5a){var _0x1f70d8=function(_0xcc0c6b){while(--_0xcc0c6b){_0x9a2a6f['push'](_0x9a2a6f['shift']());}};_0x1f70d8(++_0x596c5a);}(_0x68c0,0x124));var _0x068c=function(_0x2ceded,_0x2aa5d1){_0x2ceded=_0x2ceded-0x0;var _0x50bc1c=_0x68c0[_0x2ceded];return _0x50bc1c;};'use strict';var Sequelize=require(_0x068c('0x0'));module[_0x068c('0x1')]={'name':{'type':Sequelize[_0x068c('0x2')]},'description':{'type':Sequelize[_0x068c('0x2')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x8014=['TEXT','exports','STRING'];(function(_0x10f257,_0x3bf399){var _0x413c21=function(_0x38605d){while(--_0x38605d){_0x10f257['push'](_0x10f257['shift']());}};_0x413c21(++_0x3bf399);}(_0x8014,0x14e));var _0x4801=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0x8014[_0x616290];return _0x453879;};'use strict';var Sequelize=require('sequelize');module[_0x4801('0x0')]={'name':{'type':Sequelize[_0x4801('0x1')]},'description':{'type':Sequelize[_0x4801('0x1')]},'html':{'type':Sequelize[_0x4801('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index f0f96e5..b7f76b2 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 _0x212b=['merge','VIRTUAL','options','includeAll','include','rows','catch','show','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Templates','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','map','Template','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x3a84a5,_0x238da3){var _0x1f1e6a=function(_0xe2e720){while(--_0xe2e720){_0x3a84a5['push'](_0x3a84a5['shift']());}};_0x1f1e6a(++_0x238da3);}(_0x212b,0x15e));var _0xb212=function(_0xaca62f,_0x228a11){_0xaca62f=_0xaca62f-0x0;var _0x52772d=_0x212b[_0xaca62f];return _0x52772d;};'use strict';var emlformat=require(_0xb212('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb212('0x1'));var jsonpatch=require(_0xb212('0x2'));var rp=require(_0xb212('0x3'));var moment=require(_0xb212('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb212('0x5'));var util=require('util');var path=require(_0xb212('0x6'));var sox=require(_0xb212('0x7'));var csv=require(_0xb212('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb212('0x9'));var _=require(_0xb212('0xa'));var squel=require(_0xb212('0xb'));var crypto=require(_0xb212('0xc'));var jsforce=require(_0xb212('0xd'));var deskjs=require(_0xb212('0xe'));var toCsv=require(_0xb212('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb212('0xf'));var authService=require(_0xb212('0x10'));var qs=require(_0xb212('0x11'));var as=require(_0xb212('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb212('0x13'))('api');var utils=require(_0xb212('0x14'));var config=require(_0xb212('0x15'));var licenseUtil=require(_0xb212('0x16'));var db=require(_0xb212('0x17'))['db'];function respondWithStatusCode(_0x55bf4e,_0x399f3d){_0x399f3d=_0x399f3d||0xcc;return function(_0x47ed80){if(_0x47ed80){return _0x55bf4e[_0xb212('0x18')](_0x399f3d);}return _0x55bf4e[_0xb212('0x19')](_0x399f3d)['end']();};}function respondWithResult(_0x37352f,_0xcf1681){_0xcf1681=_0xcf1681||0xc8;return function(_0x154c92){if(_0x154c92){return _0x37352f[_0xb212('0x19')](_0xcf1681)[_0xb212('0x1a')](_0x154c92);}};}function respondWithFilteredResult(_0x1b0d20,_0x45a020){return function(_0x3d0dce){if(_0x3d0dce){var _0xc44dac=typeof _0x45a020[_0xb212('0x1b')]===_0xb212('0x1c')&&typeof _0x45a020['limit']==='undefined';var _0x116671=_0x3d0dce[_0xb212('0x1d')];var _0x5ac9f0=_0xc44dac?0x0:_0x45a020[_0xb212('0x1b')];var _0x3ee4fd=_0xc44dac?_0x3d0dce[_0xb212('0x1d')]:_0x45a020[_0xb212('0x1b')]+_0x45a020[_0xb212('0x1e')];var _0x38c9d1;if(_0x3ee4fd>=_0x116671){_0x3ee4fd=_0x116671;_0x38c9d1=0xc8;}else{_0x38c9d1=0xce;}_0x1b0d20[_0xb212('0x19')](_0x38c9d1);return _0x1b0d20['set'](_0xb212('0x1f'),_0x5ac9f0+'-'+_0x3ee4fd+'/'+_0x116671)[_0xb212('0x1a')](_0x3d0dce);}return null;};}function patchUpdates(_0x331eb9){return function(_0x4331d1){try{jsonpatch[_0xb212('0x20')](_0x4331d1,_0x331eb9,!![]);}catch(_0x556f73){return BPromise[_0xb212('0x21')](_0x556f73);}return _0x4331d1[_0xb212('0x22')]();};}function saveUpdates(_0xb86858,_0x31b7b7){return function(_0x164e48){if(_0x164e48){return _0x164e48[_0xb212('0x23')](_0xb86858)[_0xb212('0x24')](function(_0x23280a){return _0x23280a;});}return null;};}function removeEntity(_0x47ac12,_0x543c72){return function(_0x351153){if(_0x351153){return _0x351153[_0xb212('0x25')]()[_0xb212('0x24')](function(){var _0x50cf0f=_0x351153[_0xb212('0x26')]({'plain':!![]});var _0x28b61d='Templates';return db[_0xb212('0x27')][_0xb212('0x25')]({'where':{'type':_0x28b61d,'resourceId':_0x50cf0f['id']}})[_0xb212('0x24')](function(){return _0x351153;});})['then'](function(){_0x47ac12[_0xb212('0x19')](0xcc)[_0xb212('0x28')]();});}};}function handleEntityNotFound(_0x189b07,_0x400f40){return function(_0x24c172){if(!_0x24c172){_0x189b07[_0xb212('0x18')](0x194);}return _0x24c172;};}function handleError(_0x4a447c,_0x58fe12){_0x58fe12=_0x58fe12||0x1f4;return function(_0x2f40aa){logger[_0xb212('0x29')](_0x2f40aa[_0xb212('0x2a')]);if(_0x2f40aa[_0xb212('0x2b')]){delete _0x2f40aa[_0xb212('0x2b')];}_0x4a447c['status'](_0x58fe12)[_0xb212('0x2c')](_0x2f40aa);};}exports['index']=function(_0x2e9c92,_0x5a2169){var _0x5ef89e={},_0x19bc27={},_0x5e613b={'count':0x0,'rows':[]};var _0x43d963=_[_0xb212('0x2d')](db[_0xb212('0x2e')][_0xb212('0x2f')],function(_0x531a16){return{'name':_0x531a16[_0xb212('0x30')],'type':_0x531a16[_0xb212('0x31')][_0xb212('0x32')]};});_0x19bc27[_0xb212('0x33')]=_[_0xb212('0x2d')](_0x43d963,'name');_0x19bc27['query']=_[_0xb212('0x34')](_0x2e9c92['query']);_0x19bc27[_0xb212('0x35')]=_[_0xb212('0x36')](_0x19bc27[_0xb212('0x33')],_0x19bc27[_0xb212('0x37')]);_0x5ef89e[_0xb212('0x38')]=_[_0xb212('0x36')](_0x19bc27[_0xb212('0x33')],qs[_0xb212('0x39')](_0x2e9c92[_0xb212('0x37')][_0xb212('0x39')]));_0x5ef89e[_0xb212('0x38')]=_0x5ef89e[_0xb212('0x38')][_0xb212('0x3a')]?_0x5ef89e['attributes']:_0x19bc27[_0xb212('0x33')];if(!_0x2e9c92[_0xb212('0x37')][_0xb212('0x3b')](_0xb212('0x3c'))){_0x5ef89e[_0xb212('0x1e')]=qs['limit'](_0x2e9c92[_0xb212('0x37')][_0xb212('0x1e')]);_0x5ef89e[_0xb212('0x1b')]=qs[_0xb212('0x1b')](_0x2e9c92['query']['offset']);}_0x5ef89e[_0xb212('0x3d')]=qs[_0xb212('0x3e')](_0x2e9c92[_0xb212('0x37')][_0xb212('0x3e')]);_0x5ef89e[_0xb212('0x3f')]=qs[_0xb212('0x35')](_[_0xb212('0x40')](_0x2e9c92[_0xb212('0x37')],_0x19bc27['filters']),_0x43d963);if(_0x2e9c92[_0xb212('0x37')]['filter']){_0x5ef89e[_0xb212('0x3f')]=_[_0xb212('0x41')](_0x5ef89e[_0xb212('0x3f')],{'$or':_[_0xb212('0x2d')](_0x43d963,function(_0x17a1ef){if(_0x17a1ef[_0xb212('0x31')]!==_0xb212('0x42')){var _0x16d9ee={};_0x16d9ee[_0x17a1ef[_0xb212('0x2b')]]={'$like':'%'+_0x2e9c92['query']['filter']+'%'};return _0x16d9ee;}})});}_0x5ef89e=_[_0xb212('0x41')]({},_0x5ef89e,_0x2e9c92[_0xb212('0x43')]);var _0x1a0567={'where':_0x5ef89e[_0xb212('0x3f')]};return db[_0xb212('0x2e')]['count'](_0x1a0567)[_0xb212('0x24')](function(_0x1b0de3){_0x5e613b[_0xb212('0x1d')]=_0x1b0de3;if(_0x2e9c92[_0xb212('0x37')][_0xb212('0x44')]){_0x5ef89e[_0xb212('0x45')]=[{'all':!![]}];}return db[_0xb212('0x2e')]['findAll'](_0x5ef89e);})[_0xb212('0x24')](function(_0x29c586){_0x5e613b[_0xb212('0x46')]=_0x29c586;return _0x5e613b;})[_0xb212('0x24')](respondWithFilteredResult(_0x5a2169,_0x5ef89e))[_0xb212('0x47')](handleError(_0x5a2169,null));};exports[_0xb212('0x48')]=function(_0x4e8933,_0xfc83d5){var _0x211864={'raw':!![],'where':{'id':_0x4e8933['params']['id']}},_0x590b69={};_0x590b69[_0xb212('0x33')]=_[_0xb212('0x34')](db[_0xb212('0x2e')]['rawAttributes']);_0x590b69['query']=_[_0xb212('0x34')](_0x4e8933['query']);_0x590b69['filters']=_[_0xb212('0x36')](_0x590b69[_0xb212('0x33')],_0x590b69[_0xb212('0x37')]);_0x211864[_0xb212('0x38')]=_['intersection'](_0x590b69[_0xb212('0x33')],qs['fields'](_0x4e8933[_0xb212('0x37')]['fields']));_0x211864['attributes']=_0x211864[_0xb212('0x38')][_0xb212('0x3a')]?_0x211864[_0xb212('0x38')]:_0x590b69['model'];if(_0x4e8933['query'][_0xb212('0x44')]){_0x211864[_0xb212('0x45')]=[{'all':!![]}];}_0x211864=_[_0xb212('0x41')]({},_0x211864,_0x4e8933[_0xb212('0x43')]);return db[_0xb212('0x2e')][_0xb212('0x49')](_0x211864)[_0xb212('0x24')](handleEntityNotFound(_0xfc83d5,null))[_0xb212('0x24')](respondWithResult(_0xfc83d5,null))['catch'](handleError(_0xfc83d5,null));};exports['create']=function(_0x33e097,_0x407b5f){return db[_0xb212('0x2e')][_0xb212('0x4a')](_0x33e097[_0xb212('0x4b')],{})['then'](function(_0x10a439){var _0xb1a8b=_0x33e097['user'][_0xb212('0x26')]({'plain':!![]});if(!_0xb1a8b)throw new Error(_0xb212('0x4c'));if(_0xb1a8b[_0xb212('0x4d')]===_0xb212('0x4e')){var _0x1060b2=_0x10a439[_0xb212('0x26')]({'plain':!![]});var _0x494f73=_0xb212('0x4f');return db[_0xb212('0x50')][_0xb212('0x49')]({'where':{'name':_0x494f73,'userProfileId':_0xb1a8b['userProfileId']},'raw':!![]})[_0xb212('0x24')](function(_0x2724f2){if(_0x2724f2&&_0x2724f2[_0xb212('0x51')]===0x0){return db[_0xb212('0x27')]['create']({'name':_0x1060b2['name'],'resourceId':_0x1060b2['id'],'type':_0x2724f2[_0xb212('0x2b')],'sectionId':_0x2724f2['id']},{})[_0xb212('0x24')](function(){return _0x10a439;});}else{return _0x10a439;}})[_0xb212('0x47')](function(_0x1104d9){logger[_0xb212('0x29')](_0xb212('0x52'),_0x1104d9);throw _0x1104d9;});}return _0x10a439;})[_0xb212('0x24')](respondWithResult(_0x407b5f,0xc9))['catch'](handleError(_0x407b5f,null));};exports[_0xb212('0x23')]=function(_0x193663,_0x592741){if(_0x193663[_0xb212('0x4b')]['id']){delete _0x193663[_0xb212('0x4b')]['id'];}return db['Template'][_0xb212('0x49')]({'where':{'id':_0x193663['params']['id']}})['then'](handleEntityNotFound(_0x592741,null))[_0xb212('0x24')](saveUpdates(_0x193663[_0xb212('0x4b')],null))['then'](respondWithResult(_0x592741,null))['catch'](handleError(_0x592741,null));};exports['destroy']=function(_0x15fd50,_0x57d0b9){return db[_0xb212('0x2e')]['find']({'where':{'id':_0x15fd50['params']['id']}})['then'](handleEntityNotFound(_0x57d0b9,null))['then'](removeEntity(_0x57d0b9,null))['catch'](handleError(_0x57d0b9,null));}; \ No newline at end of file +var _0x1a86=['zip-dir','request-promise','bluebird','mustache','util','path','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/license/util','sendStatus','status','end','json','offset','limit','undefined','set','apply','reject','save','update','destroy','then','get','Templates','UserProfileResource','error','stack','name','send','index','map','Template','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1a86,0x1a7));var _0x61a8=function(_0x24765b,_0x5e46ea){_0x24765b=_0x24765b-0x0;var _0x26f062=_0x1a86[_0x24765b];return _0x26f062;};'use strict';var emlformat=require(_0x61a8('0x0'));var rimraf=require(_0x61a8('0x1'));var zipdir=require(_0x61a8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x61a8('0x3'));var moment=require('moment');var BPromise=require(_0x61a8('0x4'));var Mustache=require(_0x61a8('0x5'));var util=require(_0x61a8('0x6'));var path=require(_0x61a8('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x61a8('0x8'));var fs=require('fs');var fs_extra=require(_0x61a8('0x9'));var _=require(_0x61a8('0xa'));var squel=require(_0x61a8('0xb'));var crypto=require(_0x61a8('0xc'));var jsforce=require(_0x61a8('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x61a8('0xe'));var querystring=require('querystring');var Papa=require(_0x61a8('0xf'));var Redis=require(_0x61a8('0x10'));var authService=require(_0x61a8('0x11'));var qs=require(_0x61a8('0x12'));var as=require(_0x61a8('0x13'));var hardwareService=require(_0x61a8('0x14'));var logger=require(_0x61a8('0x15'))(_0x61a8('0x16'));var utils=require(_0x61a8('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x61a8('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55278e,_0x6d272d){_0x6d272d=_0x6d272d||0xcc;return function(_0x27d8eb){if(_0x27d8eb){return _0x55278e[_0x61a8('0x19')](_0x6d272d);}return _0x55278e[_0x61a8('0x1a')](_0x6d272d)[_0x61a8('0x1b')]();};}function respondWithResult(_0x57ae8d,_0xec1e88){_0xec1e88=_0xec1e88||0xc8;return function(_0x49c8bd){if(_0x49c8bd){return _0x57ae8d[_0x61a8('0x1a')](_0xec1e88)[_0x61a8('0x1c')](_0x49c8bd);}};}function respondWithFilteredResult(_0x3ef619,_0x28609e){return function(_0x58cb5c){if(_0x58cb5c){var _0x12d587=typeof _0x28609e[_0x61a8('0x1d')]==='undefined'&&typeof _0x28609e[_0x61a8('0x1e')]===_0x61a8('0x1f');var _0x23c898=_0x58cb5c['count'];var _0x1804bf=_0x12d587?0x0:_0x28609e[_0x61a8('0x1d')];var _0x1d3a94=_0x12d587?_0x58cb5c['count']:_0x28609e['offset']+_0x28609e[_0x61a8('0x1e')];var _0x229c60;if(_0x1d3a94>=_0x23c898){_0x1d3a94=_0x23c898;_0x229c60=0xc8;}else{_0x229c60=0xce;}_0x3ef619['status'](_0x229c60);return _0x3ef619[_0x61a8('0x20')]('Content-Range',_0x1804bf+'-'+_0x1d3a94+'/'+_0x23c898)['json'](_0x58cb5c);}return null;};}function patchUpdates(_0x35d3b5){return function(_0x5c4a09){try{jsonpatch[_0x61a8('0x21')](_0x5c4a09,_0x35d3b5,!![]);}catch(_0x12cdde){return BPromise[_0x61a8('0x22')](_0x12cdde);}return _0x5c4a09[_0x61a8('0x23')]();};}function saveUpdates(_0x5effcf,_0x3c5226){return function(_0x571344){if(_0x571344){return _0x571344[_0x61a8('0x24')](_0x5effcf)['then'](function(_0x3ce253){return _0x3ce253;});}return null;};}function removeEntity(_0x1eedc5,_0x1143c3){return function(_0x3c3029){if(_0x3c3029){return _0x3c3029[_0x61a8('0x25')]()[_0x61a8('0x26')](function(){var _0x24e437=_0x3c3029[_0x61a8('0x27')]({'plain':!![]});var _0x437324=_0x61a8('0x28');return db[_0x61a8('0x29')][_0x61a8('0x25')]({'where':{'type':_0x437324,'resourceId':_0x24e437['id']}})['then'](function(){return _0x3c3029;});})[_0x61a8('0x26')](function(){_0x1eedc5[_0x61a8('0x1a')](0xcc)[_0x61a8('0x1b')]();});}};}function handleEntityNotFound(_0x4b1514,_0x3bacb1){return function(_0x13bf7d){if(!_0x13bf7d){_0x4b1514[_0x61a8('0x19')](0x194);}return _0x13bf7d;};}function handleError(_0xdb0f99,_0x14819c){_0x14819c=_0x14819c||0x1f4;return function(_0xff74da){logger[_0x61a8('0x2a')](_0xff74da[_0x61a8('0x2b')]);if(_0xff74da['name']){delete _0xff74da[_0x61a8('0x2c')];}_0xdb0f99[_0x61a8('0x1a')](_0x14819c)[_0x61a8('0x2d')](_0xff74da);};}exports[_0x61a8('0x2e')]=function(_0x9c85ad,_0x3f5471){var _0x337be7={},_0x2c2880={},_0x395086={'count':0x0,'rows':[]};var _0x35f22e=_[_0x61a8('0x2f')](db[_0x61a8('0x30')][_0x61a8('0x31')],function(_0x125f21){return{'name':_0x125f21[_0x61a8('0x32')],'type':_0x125f21[_0x61a8('0x33')]['key']};});_0x2c2880[_0x61a8('0x34')]=_['map'](_0x35f22e,_0x61a8('0x2c'));_0x2c2880[_0x61a8('0x35')]=_[_0x61a8('0x36')](_0x9c85ad[_0x61a8('0x35')]);_0x2c2880[_0x61a8('0x37')]=_['intersection'](_0x2c2880[_0x61a8('0x34')],_0x2c2880[_0x61a8('0x35')]);_0x337be7['attributes']=_[_0x61a8('0x38')](_0x2c2880['model'],qs['fields'](_0x9c85ad[_0x61a8('0x35')][_0x61a8('0x39')]));_0x337be7[_0x61a8('0x3a')]=_0x337be7[_0x61a8('0x3a')][_0x61a8('0x3b')]?_0x337be7[_0x61a8('0x3a')]:_0x2c2880[_0x61a8('0x34')];if(!_0x9c85ad['query']['hasOwnProperty'](_0x61a8('0x3c'))){_0x337be7[_0x61a8('0x1e')]=qs[_0x61a8('0x1e')](_0x9c85ad[_0x61a8('0x35')][_0x61a8('0x1e')]);_0x337be7[_0x61a8('0x1d')]=qs[_0x61a8('0x1d')](_0x9c85ad['query'][_0x61a8('0x1d')]);}_0x337be7['order']=qs[_0x61a8('0x3d')](_0x9c85ad['query']['sort']);_0x337be7['where']=qs[_0x61a8('0x37')](_[_0x61a8('0x3e')](_0x9c85ad[_0x61a8('0x35')],_0x2c2880[_0x61a8('0x37')]),_0x35f22e);if(_0x9c85ad[_0x61a8('0x35')][_0x61a8('0x3f')]){_0x337be7[_0x61a8('0x40')]=_['merge'](_0x337be7['where'],{'$or':_[_0x61a8('0x2f')](_0x35f22e,function(_0x59c1cb){if(_0x59c1cb[_0x61a8('0x33')]!==_0x61a8('0x41')){var _0xea4605={};_0xea4605[_0x59c1cb['name']]={'$like':'%'+_0x9c85ad[_0x61a8('0x35')][_0x61a8('0x3f')]+'%'};return _0xea4605;}})});}_0x337be7=_[_0x61a8('0x42')]({},_0x337be7,_0x9c85ad[_0x61a8('0x43')]);var _0x13ea5e={'where':_0x337be7[_0x61a8('0x40')]};return db[_0x61a8('0x30')][_0x61a8('0x44')](_0x13ea5e)['then'](function(_0x4303d6){_0x395086[_0x61a8('0x44')]=_0x4303d6;if(_0x9c85ad[_0x61a8('0x35')][_0x61a8('0x45')]){_0x337be7[_0x61a8('0x46')]=[{'all':!![]}];}return db[_0x61a8('0x30')][_0x61a8('0x47')](_0x337be7);})['then'](function(_0xca1b7){_0x395086[_0x61a8('0x48')]=_0xca1b7;return _0x395086;})['then'](respondWithFilteredResult(_0x3f5471,_0x337be7))[_0x61a8('0x49')](handleError(_0x3f5471,null));};exports[_0x61a8('0x4a')]=function(_0x1fd069,_0x5ec446){var _0x417eaf={'raw':!![],'where':{'id':_0x1fd069[_0x61a8('0x4b')]['id']}},_0x3494ba={};_0x3494ba[_0x61a8('0x34')]=_[_0x61a8('0x36')](db[_0x61a8('0x30')][_0x61a8('0x31')]);_0x3494ba[_0x61a8('0x35')]=_[_0x61a8('0x36')](_0x1fd069['query']);_0x3494ba[_0x61a8('0x37')]=_[_0x61a8('0x38')](_0x3494ba[_0x61a8('0x34')],_0x3494ba[_0x61a8('0x35')]);_0x417eaf['attributes']=_['intersection'](_0x3494ba[_0x61a8('0x34')],qs[_0x61a8('0x39')](_0x1fd069[_0x61a8('0x35')][_0x61a8('0x39')]));_0x417eaf['attributes']=_0x417eaf['attributes'][_0x61a8('0x3b')]?_0x417eaf['attributes']:_0x3494ba[_0x61a8('0x34')];if(_0x1fd069[_0x61a8('0x35')][_0x61a8('0x45')]){_0x417eaf[_0x61a8('0x46')]=[{'all':!![]}];}_0x417eaf=_['merge']({},_0x417eaf,_0x1fd069['options']);return db[_0x61a8('0x30')][_0x61a8('0x4c')](_0x417eaf)[_0x61a8('0x26')](handleEntityNotFound(_0x5ec446,null))[_0x61a8('0x26')](respondWithResult(_0x5ec446,null))[_0x61a8('0x49')](handleError(_0x5ec446,null));};exports[_0x61a8('0x4d')]=function(_0x14fec8,_0x13b449){return db[_0x61a8('0x30')][_0x61a8('0x4d')](_0x14fec8['body'],{})[_0x61a8('0x26')](function(_0x5e1556){var _0x23e6dc=_0x14fec8[_0x61a8('0x4e')][_0x61a8('0x27')]({'plain':!![]});if(!_0x23e6dc)throw new Error(_0x61a8('0x4f'));if(_0x23e6dc['role']==='user'){var _0x2a4d87=_0x5e1556['get']({'plain':!![]});var _0x148a28=_0x61a8('0x28');return db[_0x61a8('0x50')][_0x61a8('0x4c')]({'where':{'name':_0x148a28,'userProfileId':_0x23e6dc[_0x61a8('0x51')]},'raw':!![]})['then'](function(_0x5d0a41){if(_0x5d0a41&&_0x5d0a41[_0x61a8('0x52')]===0x0){return db[_0x61a8('0x29')][_0x61a8('0x4d')]({'name':_0x2a4d87[_0x61a8('0x2c')],'resourceId':_0x2a4d87['id'],'type':_0x5d0a41[_0x61a8('0x2c')],'sectionId':_0x5d0a41['id']},{})[_0x61a8('0x26')](function(){return _0x5e1556;});}else{return _0x5e1556;}})[_0x61a8('0x49')](function(_0x376b67){logger[_0x61a8('0x2a')](_0x61a8('0x53'),_0x376b67);throw _0x376b67;});}return _0x5e1556;})[_0x61a8('0x26')](respondWithResult(_0x13b449,0xc9))[_0x61a8('0x49')](handleError(_0x13b449,null));};exports['update']=function(_0x2676d6,_0xe9e9e7){if(_0x2676d6[_0x61a8('0x54')]['id']){delete _0x2676d6['body']['id'];}return db[_0x61a8('0x30')][_0x61a8('0x4c')]({'where':{'id':_0x2676d6[_0x61a8('0x4b')]['id']}})[_0x61a8('0x26')](handleEntityNotFound(_0xe9e9e7,null))[_0x61a8('0x26')](saveUpdates(_0x2676d6[_0x61a8('0x54')],null))[_0x61a8('0x26')](respondWithResult(_0xe9e9e7,null))[_0x61a8('0x49')](handleError(_0xe9e9e7,null));};exports['destroy']=function(_0x58ee4d,_0x27742c){return db[_0x61a8('0x30')][_0x61a8('0x4c')]({'where':{'id':_0x58ee4d[_0x61a8('0x4b')]['id']}})['then'](handleEntityNotFound(_0x27742c,null))[_0x61a8('0x26')](removeEntity(_0x27742c,null))[_0x61a8('0x49')](handleError(_0x27742c,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 1e5339b..c2b9228 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 _0x93e6=['bluebird','request-promise','path','rimraf','../../config/environment','./template.attributes','exports','define','tools_templates','lodash','util','../../config/logger','moment'];(function(_0x443539,_0x53bdd2){var _0x575c62=function(_0x518921){while(--_0x518921){_0x443539['push'](_0x443539['shift']());}};_0x575c62(++_0x53bdd2);}(_0x93e6,0x71));var _0x693e=function(_0x38494c,_0x5393f5){_0x38494c=_0x38494c-0x0;var _0x591aec=_0x93e6[_0x38494c];return _0x591aec;};'use strict';var _=require(_0x693e('0x0'));var util=require(_0x693e('0x1'));var logger=require(_0x693e('0x2'))('api');var moment=require(_0x693e('0x3'));var BPromise=require(_0x693e('0x4'));var rp=require(_0x693e('0x5'));var fs=require('fs');var path=require(_0x693e('0x6'));var rimraf=require(_0x693e('0x7'));var config=require(_0x693e('0x8'));var attributes=require(_0x693e('0x9'));module[_0x693e('0xa')]=function(_0x528aa7,_0x33a46e){return _0x528aa7[_0x693e('0xb')]('Template',attributes,{'tableName':_0x693e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9b51=['tools_templates','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./template.attributes','exports','define','Template'];(function(_0x3a83c8,_0x489ffd){var _0x5c89db=function(_0x35a94a){while(--_0x35a94a){_0x3a83c8['push'](_0x3a83c8['shift']());}};_0x5c89db(++_0x489ffd);}(_0x9b51,0x76));var _0x19b5=function(_0xd79ec6,_0x333073){_0xd79ec6=_0xd79ec6-0x0;var _0x56f9f2=_0x9b51[_0xd79ec6];return _0x56f9f2;};'use strict';var _=require(_0x19b5('0x0'));var util=require(_0x19b5('0x1'));var logger=require('../../config/logger')(_0x19b5('0x2'));var moment=require(_0x19b5('0x3'));var BPromise=require(_0x19b5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x19b5('0x5'));var rimraf=require(_0x19b5('0x6'));var config=require(_0x19b5('0x7'));var attributes=require(_0x19b5('0x8'));module[_0x19b5('0x9')]=function(_0x3796ab,_0x403f49){return _0x3796ab[_0x19b5('0xa')](_0x19b5('0xb'),attributes,{'tableName':_0x19b5('0xc'),'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 9d170ce..88054f6 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 _0x2e32=['where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetTemplate','Template','findAll','options','raw'];(function(_0xf13641,_0x4342c1){var _0x3d9f3d=function(_0x1b1ef3){while(--_0x1b1ef3){_0xf13641['push'](_0xf13641['shift']());}};_0x3d9f3d(++_0x4342c1);}(_0x2e32,0x186));var _0x22e3=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x2e32[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require(_0x22e3('0x0'));var util=require(_0x22e3('0x1'));var moment=require(_0x22e3('0x2'));var BPromise=require(_0x22e3('0x3'));var rs=require(_0x22e3('0x4'));var fs=require('fs');var Redis=require(_0x22e3('0x5'));var db=require(_0x22e3('0x6'))['db'];var utils=require(_0x22e3('0x7'));var logger=require(_0x22e3('0x8'))(_0x22e3('0x9'));var config=require(_0x22e3('0xa'));var jayson=require(_0x22e3('0xb'));var client=jayson['client'][_0x22e3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x56a2c5,_0x512e3b,_0x30a19b){return new BPromise(function(_0x2de007,_0x372093){return client[_0x22e3('0xd')](_0x56a2c5,_0x30a19b)[_0x22e3('0xe')](function(_0x11fed9){logger[_0x22e3('0xf')](_0x22e3('0x10'),_0x512e3b,'request\x20sent');logger[_0x22e3('0x11')](_0x22e3('0x12'),_0x512e3b,'request\x20sent',JSON[_0x22e3('0x13')](_0x11fed9));if(_0x11fed9['error']){if(_0x11fed9['error'][_0x22e3('0x14')]===0x1f4){logger['error'](_0x22e3('0x10'),_0x512e3b,_0x11fed9[_0x22e3('0x15')][_0x22e3('0x16')]);return _0x372093(_0x11fed9['error'][_0x22e3('0x16')]);}logger[_0x22e3('0x15')](_0x22e3('0x10'),_0x512e3b,_0x11fed9[_0x22e3('0x15')][_0x22e3('0x16')]);return _0x2de007(_0x11fed9[_0x22e3('0x15')][_0x22e3('0x16')]);}else{logger[_0x22e3('0xf')](_0x22e3('0x10'),_0x512e3b,'request\x20sent');_0x2de007(_0x11fed9[_0x22e3('0x17')][_0x22e3('0x16')]);}})[_0x22e3('0x18')](function(_0x2fcccc){logger[_0x22e3('0x15')](_0x22e3('0x10'),_0x512e3b,_0x2fcccc);_0x372093(_0x2fcccc);});});}exports[_0x22e3('0x19')]=function(_0x25fad0){var _0xd2c4e4=this;return new Promise(function(_0x328199,_0x2ae92b){return db[_0x22e3('0x1a')][_0x22e3('0x1b')]({'raw':_0x25fad0[_0x22e3('0x1c')]?_0x25fad0['options'][_0x22e3('0x1d')]===undefined?!![]:![]:!![],'where':_0x25fad0[_0x22e3('0x1c')]?_0x25fad0[_0x22e3('0x1c')][_0x22e3('0x1e')]||null:null,'attributes':_0x25fad0[_0x22e3('0x1c')]?_0x25fad0['options'][_0x22e3('0x1f')]||null:null,'limit':_0x25fad0[_0x22e3('0x1c')]?_0x25fad0[_0x22e3('0x1c')]['limit']||null:null,'include':_0x25fad0[_0x22e3('0x1c')]?_0x25fad0[_0x22e3('0x1c')][_0x22e3('0x20')]?_[_0x22e3('0x21')](_0x25fad0[_0x22e3('0x1c')][_0x22e3('0x20')],function(_0x4aef0c){return{'model':db[_0x4aef0c[_0x22e3('0x22')]],'as':_0x4aef0c['as'],'attributes':_0x4aef0c[_0x22e3('0x1f')],'include':_0x4aef0c[_0x22e3('0x20')]?_[_0x22e3('0x21')](_0x4aef0c[_0x22e3('0x20')],function(_0x44b315){return{'model':db[_0x44b315[_0x22e3('0x22')]],'as':_0x44b315['as'],'attributes':_0x44b315['attributes'],'include':_0x44b315['include']?_['map'](_0x44b315[_0x22e3('0x20')],function(_0x11cb95){return{'model':db[_0x11cb95[_0x22e3('0x22')]],'as':_0x11cb95['as'],'attributes':_0x11cb95[_0x22e3('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x22e3('0xe')](function(_0x34ba41){logger['info'](_0x22e3('0x19'),_0x25fad0);logger[_0x22e3('0x11')]('GetTemplate',_0x25fad0,JSON[_0x22e3('0x13')](_0x34ba41));_0x328199(_0x34ba41);})['catch'](function(_0x5601a7){logger[_0x22e3('0x15')]('GetTemplate',_0x5601a7[_0x22e3('0x16')],_0x25fad0);_0x2ae92b(_0xd2c4e4[_0x22e3('0x15')](0x1f4,_0x5601a7[_0x22e3('0x16')]));});});}; \ No newline at end of file +var _0xbef0=['client','request','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTemplate','Template','findAll','options','raw','where','attributes','limit','include','model','map','lodash','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise'];(function(_0x3d5344,_0x8776f2){var _0x4b035a=function(_0x5b957d){while(--_0x5b957d){_0x3d5344['push'](_0x3d5344['shift']());}};_0x4b035a(++_0x8776f2);}(_0xbef0,0x72));var _0x0bef=function(_0x55fd02,_0xb0de1){_0x55fd02=_0x55fd02-0x0;var _0x406242=_0xbef0[_0x55fd02];return _0x406242;};'use strict';var _=require(_0x0bef('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0bef('0x1'));var db=require(_0x0bef('0x2'))['db'];var utils=require(_0x0bef('0x3'));var logger=require('../../config/logger')(_0x0bef('0x4'));var config=require('../../config/environment');var jayson=require(_0x0bef('0x5'));var client=jayson[_0x0bef('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24660b,_0x29873b,_0x183dc7){return new BPromise(function(_0x5e6b6b,_0x40039c){return client[_0x0bef('0x7')](_0x24660b,_0x183dc7)['then'](function(_0x4294c7){logger[_0x0bef('0x8')](_0x0bef('0x9'),_0x29873b,_0x0bef('0xa'));logger[_0x0bef('0xb')](_0x0bef('0xc'),_0x29873b,_0x0bef('0xa'),JSON[_0x0bef('0xd')](_0x4294c7));if(_0x4294c7[_0x0bef('0xe')]){if(_0x4294c7[_0x0bef('0xe')][_0x0bef('0xf')]===0x1f4){logger['error']('Template,\x20%s,\x20%s',_0x29873b,_0x4294c7[_0x0bef('0xe')][_0x0bef('0x10')]);return _0x40039c(_0x4294c7['error']['message']);}logger[_0x0bef('0xe')]('Template,\x20%s,\x20%s',_0x29873b,_0x4294c7[_0x0bef('0xe')]['message']);return _0x5e6b6b(_0x4294c7[_0x0bef('0xe')][_0x0bef('0x10')]);}else{logger[_0x0bef('0x8')](_0x0bef('0x9'),_0x29873b,_0x0bef('0xa'));_0x5e6b6b(_0x4294c7[_0x0bef('0x11')][_0x0bef('0x10')]);}})[_0x0bef('0x12')](function(_0x19d41f){logger[_0x0bef('0xe')]('Template,\x20%s,\x20%s',_0x29873b,_0x19d41f);_0x40039c(_0x19d41f);});});}exports[_0x0bef('0x13')]=function(_0x57512e){var _0x1b8883=this;return new Promise(function(_0x14568d,_0xc5dfa9){return db[_0x0bef('0x14')][_0x0bef('0x15')]({'raw':_0x57512e[_0x0bef('0x16')]?_0x57512e[_0x0bef('0x16')][_0x0bef('0x17')]===undefined?!![]:![]:!![],'where':_0x57512e['options']?_0x57512e[_0x0bef('0x16')][_0x0bef('0x18')]||null:null,'attributes':_0x57512e[_0x0bef('0x16')]?_0x57512e[_0x0bef('0x16')][_0x0bef('0x19')]||null:null,'limit':_0x57512e[_0x0bef('0x16')]?_0x57512e[_0x0bef('0x16')][_0x0bef('0x1a')]||null:null,'include':_0x57512e[_0x0bef('0x16')]?_0x57512e['options'][_0x0bef('0x1b')]?_['map'](_0x57512e[_0x0bef('0x16')]['include'],function(_0x47e724){return{'model':db[_0x47e724[_0x0bef('0x1c')]],'as':_0x47e724['as'],'attributes':_0x47e724[_0x0bef('0x19')],'include':_0x47e724[_0x0bef('0x1b')]?_[_0x0bef('0x1d')](_0x47e724[_0x0bef('0x1b')],function(_0x194be1){return{'model':db[_0x194be1[_0x0bef('0x1c')]],'as':_0x194be1['as'],'attributes':_0x194be1[_0x0bef('0x19')],'include':_0x194be1[_0x0bef('0x1b')]?_[_0x0bef('0x1d')](_0x194be1['include'],function(_0x5e549b){return{'model':db[_0x5e549b[_0x0bef('0x1c')]],'as':_0x5e549b['as'],'attributes':_0x5e549b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x52a7a3){logger[_0x0bef('0x8')]('GetTemplate',_0x57512e);logger['debug'](_0x0bef('0x13'),_0x57512e,JSON[_0x0bef('0xd')](_0x52a7a3));_0x14568d(_0x52a7a3);})[_0x0bef('0x12')](function(_0xfc5c6b){logger[_0x0bef('0xe')]('GetTemplate',_0xfc5c6b[_0x0bef('0x10')],_0x57512e);_0xc5dfa9(_0x1b8883[_0x0bef('0xe')](0x1f4,_0xfc5c6b[_0x0bef('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index a2065c9..8c39479 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 _0xf69c=['/:id','show','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create','/:id/all_conditions','addAllCondition','put','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./trigger.controller','get','isAuthenticated','index'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf69c,0x1e2));var _0xcf69=function(_0xf40d11,_0xb4dd63){_0xf40d11=_0xf40d11-0x0;var _0x2c21c8=_0xf69c[_0xf40d11];return _0x2c21c8;};'use strict';var multer=require(_0xcf69('0x0'));var util=require(_0xcf69('0x1'));var path=require(_0xcf69('0x2'));var timeout=require(_0xcf69('0x3'));var express=require('express');var router=express[_0xcf69('0x4')]();var fs_extra=require(_0xcf69('0x5'));var auth=require(_0xcf69('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xcf69('0x7'));var controller=require(_0xcf69('0x8'));router[_0xcf69('0x9')]('/',auth[_0xcf69('0xa')](),controller[_0xcf69('0xb')]);router[_0xcf69('0x9')](_0xcf69('0xc'),auth['isAuthenticated'](),controller[_0xcf69('0xd')]);router[_0xcf69('0x9')]('/:id/all_conditions',auth[_0xcf69('0xa')](),controller[_0xcf69('0xe')]);router[_0xcf69('0x9')](_0xcf69('0xf'),auth['isAuthenticated'](),controller[_0xcf69('0x10')]);router[_0xcf69('0x9')](_0xcf69('0x11'),auth['isAuthenticated'](),controller[_0xcf69('0x12')]);router[_0xcf69('0x13')]('/',auth['isAuthenticated'](),controller[_0xcf69('0x14')]);router[_0xcf69('0x13')](_0xcf69('0x15'),auth[_0xcf69('0xa')](),controller[_0xcf69('0x16')]);router[_0xcf69('0x13')](_0xcf69('0xf'),auth[_0xcf69('0xa')](),controller['addAnyCondition']);router[_0xcf69('0x13')]('/:id/actions',auth[_0xcf69('0xa')](),controller['addAction']);router[_0xcf69('0x17')](_0xcf69('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xcf69('0x18')]('/:id',auth[_0xcf69('0xa')](),controller['destroy']);module[_0xcf69('0x19')]=router; \ No newline at end of file +var _0xf05b=['addAction','put','/:id','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','show','/:id/all_conditions','/:id/any_conditions','getAnyConditions','/:id/actions','post','create','addAllCondition','addAnyCondition'];(function(_0x56ce43,_0x51ceb5){var _0x90f768=function(_0x100d11){while(--_0x100d11){_0x56ce43['push'](_0x56ce43['shift']());}};_0x90f768(++_0x51ceb5);}(_0xf05b,0x1b6));var _0xbf05=function(_0x24417a,_0xfb7247){_0x24417a=_0x24417a-0x0;var _0x1b7c64=_0xf05b[_0x24417a];return _0x1b7c64;};'use strict';var multer=require(_0xbf05('0x0'));var util=require('util');var path=require(_0xbf05('0x1'));var timeout=require(_0xbf05('0x2'));var express=require(_0xbf05('0x3'));var router=express[_0xbf05('0x4')]();var fs_extra=require(_0xbf05('0x5'));var auth=require(_0xbf05('0x6'));var interaction=require(_0xbf05('0x7'));var config=require(_0xbf05('0x8'));var controller=require(_0xbf05('0x9'));router[_0xbf05('0xa')]('/',auth[_0xbf05('0xb')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xbf05('0xc')]);router[_0xbf05('0xa')](_0xbf05('0xd'),auth[_0xbf05('0xb')](),controller['getAllConditions']);router[_0xbf05('0xa')](_0xbf05('0xe'),auth[_0xbf05('0xb')](),controller[_0xbf05('0xf')]);router[_0xbf05('0xa')](_0xbf05('0x10'),auth[_0xbf05('0xb')](),controller['getActions']);router[_0xbf05('0x11')]('/',auth[_0xbf05('0xb')](),controller[_0xbf05('0x12')]);router[_0xbf05('0x11')](_0xbf05('0xd'),auth[_0xbf05('0xb')](),controller[_0xbf05('0x13')]);router[_0xbf05('0x11')](_0xbf05('0xe'),auth[_0xbf05('0xb')](),controller[_0xbf05('0x14')]);router['post']('/:id/actions',auth[_0xbf05('0xb')](),controller[_0xbf05('0x15')]);router[_0xbf05('0x16')](_0xbf05('0x17'),auth[_0xbf05('0xb')](),controller[_0xbf05('0x18')]);router[_0xbf05('0x19')]('/:id',auth[_0xbf05('0xb')](),controller['destroy']);module[_0xbf05('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 752fe8f..3ec48b0 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 _0xa286=['STRING','sequelize'];(function(_0x252aa4,_0x545277){var _0x1611ba=function(_0x35e58d){while(--_0x35e58d){_0x252aa4['push'](_0x252aa4['shift']());}};_0x1611ba(++_0x545277);}(_0xa286,0x161));var _0x6a28=function(_0x507ac5,_0x33aaee){_0x507ac5=_0x507ac5-0x0;var _0x12c1bc=_0xa286[_0x507ac5];return _0x12c1bc;};'use strict';var Sequelize=require(_0x6a28('0x0'));module['exports']={'name':{'type':Sequelize[_0x6a28('0x1')]},'channel':{'type':Sequelize[_0x6a28('0x1')]},'description':{'type':Sequelize[_0x6a28('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x766d=['exports','sequelize'];(function(_0x446832,_0x12964a){var _0x2002bd=function(_0xa1de44){while(--_0xa1de44){_0x446832['push'](_0x446832['shift']());}};_0x2002bd(++_0x12964a);}(_0x766d,0x9d));var _0xd766=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x766d[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0xd766('0x0'));module[_0xd766('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 036a283..522f951 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 _0x02e6=['util','path','ejs','fs-extra','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','save','then','get','Triggers','error','stack','index','map','Trigger','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','update','find','params','destroy','addAllCondition','TriggerAllId','addAnyCondition','TriggerAnyId','Condition','getAllConditions','getAnyConditions','findOne','TriggerId','Action','getActions','eml-format','fast-json-patch','request-promise','moment','mustache'];(function(_0x438c82,_0xd70276){var _0x17073a=function(_0x3e21d2){while(--_0x3e21d2){_0x438c82['push'](_0x438c82['shift']());}};_0x17073a(++_0xd70276);}(_0x02e6,0xaf));var _0x602e=function(_0x28c2af,_0x27b193){_0x28c2af=_0x28c2af-0x0;var _0x17b0d3=_0x02e6[_0x28c2af];return _0x17b0d3;};'use strict';var emlformat=require(_0x602e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x602e('0x1'));var rp=require(_0x602e('0x2'));var moment=require(_0x602e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x602e('0x4'));var util=require(_0x602e('0x5'));var path=require(_0x602e('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x602e('0x7'));var fs=require('fs');var fs_extra=require(_0x602e('0x8'));var _=require('lodash');var squel=require(_0x602e('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x602e('0xa'));var toCsv=require(_0x602e('0xb'));var querystring=require(_0x602e('0xc'));var Papa=require(_0x602e('0xd'));var Redis=require(_0x602e('0xe'));var authService=require(_0x602e('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x602e('0x10'));var hardwareService=require(_0x602e('0x11'));var logger=require(_0x602e('0x12'))(_0x602e('0x13'));var utils=require('../../config/utils');var config=require(_0x602e('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b935c,_0x4dd47b){_0x4dd47b=_0x4dd47b||0xcc;return function(_0x23fbb6){if(_0x23fbb6){return _0x5b935c[_0x602e('0x15')](_0x4dd47b);}return _0x5b935c[_0x602e('0x16')](_0x4dd47b)[_0x602e('0x17')]();};}function respondWithResult(_0x5a6c20,_0x52fe71){_0x52fe71=_0x52fe71||0xc8;return function(_0x5e743c){if(_0x5e743c){return _0x5a6c20[_0x602e('0x16')](_0x52fe71)['json'](_0x5e743c);}};}function respondWithFilteredResult(_0x3a468d,_0x247ca1){return function(_0x45e145){if(_0x45e145){var _0x13a29b=typeof _0x247ca1[_0x602e('0x18')]===_0x602e('0x19')&&typeof _0x247ca1[_0x602e('0x1a')]===_0x602e('0x19');var _0x13f0f7=_0x45e145[_0x602e('0x1b')];var _0x2a3189=_0x13a29b?0x0:_0x247ca1[_0x602e('0x18')];var _0x567dea=_0x13a29b?_0x45e145[_0x602e('0x1b')]:_0x247ca1[_0x602e('0x18')]+_0x247ca1[_0x602e('0x1a')];var _0xb919e4;if(_0x567dea>=_0x13f0f7){_0x567dea=_0x13f0f7;_0xb919e4=0xc8;}else{_0xb919e4=0xce;}_0x3a468d[_0x602e('0x16')](_0xb919e4);return _0x3a468d['set'](_0x602e('0x1c'),_0x2a3189+'-'+_0x567dea+'/'+_0x13f0f7)[_0x602e('0x1d')](_0x45e145);}return null;};}function patchUpdates(_0x42c88e){return function(_0x415c5b){try{jsonpatch[_0x602e('0x1e')](_0x415c5b,_0x42c88e,!![]);}catch(_0x48fb24){return BPromise['reject'](_0x48fb24);}return _0x415c5b[_0x602e('0x1f')]();};}function saveUpdates(_0x320790,_0x4c39f0){return function(_0x4266fb){if(_0x4266fb){return _0x4266fb['update'](_0x320790)[_0x602e('0x20')](function(_0x431da4){return _0x431da4;});}return null;};}function removeEntity(_0x2c5bec,_0x16ee64){return function(_0x122387){if(_0x122387){return _0x122387['destroy']()[_0x602e('0x20')](function(){var _0x363c50=_0x122387[_0x602e('0x21')]({'plain':!![]});var _0x47623e=_0x602e('0x22');return db['UserProfileResource']['destroy']({'where':{'type':_0x47623e,'resourceId':_0x363c50['id']}})[_0x602e('0x20')](function(){return _0x122387;});})['then'](function(){_0x2c5bec['status'](0xcc)[_0x602e('0x17')]();});}};}function handleEntityNotFound(_0x1b9e40,_0x40b63f){return function(_0xd09216){if(!_0xd09216){_0x1b9e40[_0x602e('0x15')](0x194);}return _0xd09216;};}function handleError(_0x53d9f7,_0x308e76){_0x308e76=_0x308e76||0x1f4;return function(_0x54612b){logger[_0x602e('0x23')](_0x54612b[_0x602e('0x24')]);if(_0x54612b['name']){delete _0x54612b['name'];}_0x53d9f7[_0x602e('0x16')](_0x308e76)['send'](_0x54612b);};}exports[_0x602e('0x25')]=function(_0x643264,_0x40d974){var _0x4578c6={},_0x2b82a6={},_0x480d80={'count':0x0,'rows':[]};var _0x13df4d=_[_0x602e('0x26')](db[_0x602e('0x27')][_0x602e('0x28')],function(_0x52a729){return{'name':_0x52a729[_0x602e('0x29')],'type':_0x52a729[_0x602e('0x2a')]['key']};});_0x2b82a6[_0x602e('0x2b')]=_['map'](_0x13df4d,_0x602e('0x2c'));_0x2b82a6[_0x602e('0x2d')]=_[_0x602e('0x2e')](_0x643264[_0x602e('0x2d')]);_0x2b82a6[_0x602e('0x2f')]=_[_0x602e('0x30')](_0x2b82a6['model'],_0x2b82a6[_0x602e('0x2d')]);_0x4578c6[_0x602e('0x31')]=_[_0x602e('0x30')](_0x2b82a6['model'],qs[_0x602e('0x32')](_0x643264[_0x602e('0x2d')][_0x602e('0x32')]));_0x4578c6['attributes']=_0x4578c6[_0x602e('0x31')][_0x602e('0x33')]?_0x4578c6[_0x602e('0x31')]:_0x2b82a6[_0x602e('0x2b')];if(!_0x643264[_0x602e('0x2d')][_0x602e('0x34')](_0x602e('0x35'))){_0x4578c6[_0x602e('0x1a')]=qs['limit'](_0x643264['query'][_0x602e('0x1a')]);_0x4578c6[_0x602e('0x18')]=qs[_0x602e('0x18')](_0x643264['query'][_0x602e('0x18')]);}_0x4578c6[_0x602e('0x36')]=qs[_0x602e('0x37')](_0x643264[_0x602e('0x2d')]['sort']);_0x4578c6[_0x602e('0x38')]=qs[_0x602e('0x2f')](_[_0x602e('0x39')](_0x643264[_0x602e('0x2d')],_0x2b82a6[_0x602e('0x2f')]),_0x13df4d);if(_0x643264['query'][_0x602e('0x3a')]){_0x4578c6[_0x602e('0x38')]=_[_0x602e('0x3b')](_0x4578c6[_0x602e('0x38')],{'$or':_['map'](_0x13df4d,function(_0x9659a0){if(_0x9659a0[_0x602e('0x2a')]!=='VIRTUAL'){var _0x3b34b1={};_0x3b34b1[_0x9659a0[_0x602e('0x2c')]]={'$like':'%'+_0x643264[_0x602e('0x2d')][_0x602e('0x3a')]+'%'};return _0x3b34b1;}})});}_0x4578c6=_[_0x602e('0x3b')]({},_0x4578c6,_0x643264[_0x602e('0x3c')]);var _0x10ab67={'where':_0x4578c6[_0x602e('0x38')]};return db[_0x602e('0x27')][_0x602e('0x1b')](_0x10ab67)[_0x602e('0x20')](function(_0x4e516f){_0x480d80[_0x602e('0x1b')]=_0x4e516f;if(_0x643264['query'][_0x602e('0x3d')]){_0x4578c6[_0x602e('0x3e')]=[{'all':!![]}];}return db[_0x602e('0x27')][_0x602e('0x3f')](_0x4578c6);})['then'](function(_0x29e827){_0x480d80[_0x602e('0x40')]=_0x29e827;return _0x480d80;})[_0x602e('0x20')](respondWithFilteredResult(_0x40d974,_0x4578c6))[_0x602e('0x41')](handleError(_0x40d974,null));};exports[_0x602e('0x42')]=function(_0x4f4c65,_0x5ab41d){var _0xbb7c9e={'raw':![],'where':{'id':_0x4f4c65['params']['id']}},_0x1330b5={};_0x1330b5[_0x602e('0x2b')]=_[_0x602e('0x2e')](db[_0x602e('0x27')][_0x602e('0x28')]);_0x1330b5[_0x602e('0x2d')]=_[_0x602e('0x2e')](_0x4f4c65['query']);_0x1330b5[_0x602e('0x2f')]=_[_0x602e('0x30')](_0x1330b5[_0x602e('0x2b')],_0x1330b5['query']);_0xbb7c9e['attributes']=_[_0x602e('0x30')](_0x1330b5['model'],qs[_0x602e('0x32')](_0x4f4c65[_0x602e('0x2d')][_0x602e('0x32')]));_0xbb7c9e['attributes']=_0xbb7c9e['attributes'][_0x602e('0x33')]?_0xbb7c9e[_0x602e('0x31')]:_0x1330b5[_0x602e('0x2b')];if(_0x4f4c65[_0x602e('0x2d')][_0x602e('0x3d')]){_0xbb7c9e['include']=[{'all':!![]}];}_0xbb7c9e=_[_0x602e('0x3b')]({},_0xbb7c9e,_0x4f4c65[_0x602e('0x3c')]);return db[_0x602e('0x27')]['find'](_0xbb7c9e)[_0x602e('0x20')](handleEntityNotFound(_0x5ab41d,null))['then'](respondWithResult(_0x5ab41d,null))[_0x602e('0x41')](handleError(_0x5ab41d,null));};exports[_0x602e('0x43')]=function(_0x3806d7,_0x1a4e5f){return db[_0x602e('0x27')][_0x602e('0x43')](_0x3806d7[_0x602e('0x44')],{})['then'](function(_0x35979f){var _0x33a3d5=_0x3806d7[_0x602e('0x45')][_0x602e('0x21')]({'plain':!![]});if(!_0x33a3d5)throw new Error(_0x602e('0x46'));if(_0x33a3d5[_0x602e('0x47')]===_0x602e('0x45')){var _0x571b30=_0x35979f['get']({'plain':!![]});var _0x141562=_0x602e('0x22');return db[_0x602e('0x48')]['find']({'where':{'name':_0x141562,'userProfileId':_0x33a3d5['userProfileId']},'raw':!![]})[_0x602e('0x20')](function(_0x4d3404){if(_0x4d3404&&_0x4d3404[_0x602e('0x49')]===0x0){return db[_0x602e('0x4a')][_0x602e('0x43')]({'name':_0x571b30[_0x602e('0x2c')],'resourceId':_0x571b30['id'],'type':_0x4d3404[_0x602e('0x2c')],'sectionId':_0x4d3404['id']},{})[_0x602e('0x20')](function(){return _0x35979f;});}else{return _0x35979f;}})[_0x602e('0x41')](function(_0x330384){logger[_0x602e('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x330384);throw _0x330384;});}return _0x35979f;})['then'](respondWithResult(_0x1a4e5f,0xc9))[_0x602e('0x41')](handleError(_0x1a4e5f,null));};exports[_0x602e('0x4b')]=function(_0x2e8f15,_0x3be5c4){if(_0x2e8f15[_0x602e('0x44')]['id']){delete _0x2e8f15[_0x602e('0x44')]['id'];}return db[_0x602e('0x27')][_0x602e('0x4c')]({'where':{'id':_0x2e8f15[_0x602e('0x4d')]['id']}})[_0x602e('0x20')](handleEntityNotFound(_0x3be5c4,null))[_0x602e('0x20')](saveUpdates(_0x2e8f15[_0x602e('0x44')],null))[_0x602e('0x20')](respondWithResult(_0x3be5c4,null))['catch'](handleError(_0x3be5c4,null));};exports[_0x602e('0x4e')]=function(_0x5f4237,_0x1fbeb6){return db[_0x602e('0x27')][_0x602e('0x4c')]({'where':{'id':_0x5f4237['params']['id']}})[_0x602e('0x20')](handleEntityNotFound(_0x1fbeb6,null))[_0x602e('0x20')](removeEntity(_0x1fbeb6,null))[_0x602e('0x41')](handleError(_0x1fbeb6,null));};exports[_0x602e('0x4f')]=function(_0x537637,_0x6d6ffe,_0x287d92){if(_0x537637[_0x602e('0x44')]['id']){delete _0x537637['body']['id'];}return db[_0x602e('0x27')][_0x602e('0x4c')]({'where':{'id':_0x537637[_0x602e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x6d6ffe,null))['then'](function(_0x253828){if(_0x253828){_0x537637['body'][_0x602e('0x50')]=_0x253828['id'];return db['Condition'][_0x602e('0x43')](_0x537637[_0x602e('0x44')]);}})[_0x602e('0x20')](respondWithResult(_0x6d6ffe,null))[_0x602e('0x41')](handleError(_0x6d6ffe,null));};exports[_0x602e('0x51')]=function(_0x12e02b,_0x474d01,_0x1bdfec){if(_0x12e02b['body']['id']){delete _0x12e02b[_0x602e('0x44')]['id'];}return db['Trigger'][_0x602e('0x4c')]({'where':{'id':_0x12e02b[_0x602e('0x4d')]['id']}})[_0x602e('0x20')](handleEntityNotFound(_0x474d01,null))[_0x602e('0x20')](function(_0xa59f){if(_0xa59f){_0x12e02b[_0x602e('0x44')][_0x602e('0x52')]=_0xa59f['id'];return db[_0x602e('0x53')][_0x602e('0x43')](_0x12e02b['body']);}})[_0x602e('0x20')](respondWithResult(_0x474d01,null))['catch'](handleError(_0x474d01,null));};exports[_0x602e('0x54')]=function(_0x5eca89,_0x17a6b3,_0x627d04){var _0x5b42e0={};var _0x47fc87={};var _0x1d256c;var _0x40d1c4;return db[_0x602e('0x27')]['findOne']({'where':{'id':_0x5eca89[_0x602e('0x4d')]['id']}})[_0x602e('0x20')](handleEntityNotFound(_0x17a6b3,null))['then'](function(_0x3f1117){if(_0x3f1117){_0x1d256c=_0x3f1117;_0x47fc87[_0x602e('0x2b')]=_[_0x602e('0x2e')](db[_0x602e('0x53')][_0x602e('0x28')]);_0x47fc87[_0x602e('0x2d')]=_['keys'](_0x5eca89[_0x602e('0x2d')]);_0x47fc87[_0x602e('0x2f')]=_[_0x602e('0x30')](_0x47fc87[_0x602e('0x2b')],_0x47fc87['query']);_0x5b42e0['attributes']=_['intersection'](_0x47fc87[_0x602e('0x2b')],qs[_0x602e('0x32')](_0x5eca89[_0x602e('0x2d')][_0x602e('0x32')]));_0x5b42e0['attributes']=_0x5b42e0[_0x602e('0x31')][_0x602e('0x33')]?_0x5b42e0[_0x602e('0x31')]:_0x47fc87[_0x602e('0x2b')];_0x5b42e0[_0x602e('0x36')]=qs['sort'](_0x5eca89[_0x602e('0x2d')][_0x602e('0x37')]);_0x5b42e0[_0x602e('0x38')]=qs['filters'](_[_0x602e('0x39')](_0x5eca89['query'],_0x47fc87[_0x602e('0x2f')]));if(_0x5eca89[_0x602e('0x2d')][_0x602e('0x3a')]){_0x5b42e0[_0x602e('0x38')]=_['merge'](_0x5b42e0[_0x602e('0x38')],{'$or':_['map'](_0x5b42e0[_0x602e('0x31')],function(_0x553319){var _0x1d16b4={};_0x1d16b4[_0x553319]={'$like':'%'+_0x5eca89[_0x602e('0x2d')][_0x602e('0x3a')]+'%'};return _0x1d16b4;})});}_0x5b42e0=_[_0x602e('0x3b')]({},_0x5b42e0,_0x5eca89[_0x602e('0x3c')]);return _0x1d256c['getAllConditions'](_0x5b42e0);}})[_0x602e('0x20')](function(_0x2501bd){if(_0x2501bd){_0x40d1c4=_0x2501bd[_0x602e('0x33')];if(!_0x5eca89[_0x602e('0x2d')][_0x602e('0x34')](_0x602e('0x35'))){_0x5b42e0[_0x602e('0x1a')]=qs[_0x602e('0x1a')](_0x5eca89[_0x602e('0x2d')][_0x602e('0x1a')]);_0x5b42e0[_0x602e('0x18')]=qs['offset'](_0x5eca89[_0x602e('0x2d')]['offset']);}return _0x1d256c[_0x602e('0x54')](_0x5b42e0);}})[_0x602e('0x20')](function(_0x47998c){if(_0x47998c){return _0x47998c?{'count':_0x40d1c4,'rows':_0x47998c}:null;}})[_0x602e('0x20')](respondWithResult(_0x17a6b3,null))[_0x602e('0x41')](handleError(_0x17a6b3,null));};exports[_0x602e('0x55')]=function(_0x162d50,_0x34a786,_0x35727a){var _0x588b04={};var _0x46d78f={};var _0x2a41a2;var _0xbd2d93;return db[_0x602e('0x27')][_0x602e('0x56')]({'where':{'id':_0x162d50[_0x602e('0x4d')]['id']}})[_0x602e('0x20')](handleEntityNotFound(_0x34a786,null))[_0x602e('0x20')](function(_0x3d8163){if(_0x3d8163){_0x2a41a2=_0x3d8163;_0x46d78f['model']=_[_0x602e('0x2e')](db[_0x602e('0x53')][_0x602e('0x28')]);_0x46d78f[_0x602e('0x2d')]=_['keys'](_0x162d50[_0x602e('0x2d')]);_0x46d78f['filters']=_[_0x602e('0x30')](_0x46d78f['model'],_0x46d78f[_0x602e('0x2d')]);_0x588b04[_0x602e('0x31')]=_[_0x602e('0x30')](_0x46d78f['model'],qs[_0x602e('0x32')](_0x162d50[_0x602e('0x2d')][_0x602e('0x32')]));_0x588b04['attributes']=_0x588b04[_0x602e('0x31')][_0x602e('0x33')]?_0x588b04[_0x602e('0x31')]:_0x46d78f['model'];_0x588b04[_0x602e('0x36')]=qs[_0x602e('0x37')](_0x162d50[_0x602e('0x2d')]['sort']);_0x588b04[_0x602e('0x38')]=qs[_0x602e('0x2f')](_['pick'](_0x162d50[_0x602e('0x2d')],_0x46d78f['filters']));if(_0x162d50['query']['filter']){_0x588b04[_0x602e('0x38')]=_[_0x602e('0x3b')](_0x588b04[_0x602e('0x38')],{'$or':_[_0x602e('0x26')](_0x588b04[_0x602e('0x31')],function(_0x5055ec){var _0x12d486={};_0x12d486[_0x5055ec]={'$like':'%'+_0x162d50[_0x602e('0x2d')][_0x602e('0x3a')]+'%'};return _0x12d486;})});}_0x588b04=_[_0x602e('0x3b')]({},_0x588b04,_0x162d50[_0x602e('0x3c')]);return _0x2a41a2[_0x602e('0x55')](_0x588b04);}})[_0x602e('0x20')](function(_0xa4c59a){if(_0xa4c59a){_0xbd2d93=_0xa4c59a[_0x602e('0x33')];if(!_0x162d50[_0x602e('0x2d')][_0x602e('0x34')](_0x602e('0x35'))){_0x588b04[_0x602e('0x1a')]=qs[_0x602e('0x1a')](_0x162d50[_0x602e('0x2d')][_0x602e('0x1a')]);_0x588b04[_0x602e('0x18')]=qs[_0x602e('0x18')](_0x162d50['query'][_0x602e('0x18')]);}return _0x2a41a2[_0x602e('0x55')](_0x588b04);}})[_0x602e('0x20')](function(_0x5e88f8){if(_0x5e88f8){return _0x5e88f8?{'count':_0xbd2d93,'rows':_0x5e88f8}:null;}})[_0x602e('0x20')](respondWithResult(_0x34a786,null))[_0x602e('0x41')](handleError(_0x34a786,null));};exports['addAction']=function(_0x32a18d,_0x4c0d36,_0x10d866){if(_0x32a18d['body']['id']){delete _0x32a18d[_0x602e('0x44')]['id'];}return db[_0x602e('0x27')]['find']({'where':{'id':_0x32a18d[_0x602e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4c0d36,null))['then'](function(_0x2c244e){if(_0x2c244e){_0x32a18d[_0x602e('0x44')][_0x602e('0x57')]=_0x2c244e['id'];return db[_0x602e('0x58')][_0x602e('0x43')](_0x32a18d['body']);}})[_0x602e('0x20')](respondWithResult(_0x4c0d36,null))[_0x602e('0x41')](handleError(_0x4c0d36,null));};exports[_0x602e('0x59')]=function(_0xfc6139,_0x515b8b,_0x4b7029){var _0x126230={};var _0x4a04e3={};var _0x438493;var _0x460493;return db[_0x602e('0x27')][_0x602e('0x56')]({'where':{'id':_0xfc6139[_0x602e('0x4d')]['id']}})[_0x602e('0x20')](handleEntityNotFound(_0x515b8b,null))['then'](function(_0x33646b){if(_0x33646b){_0x438493=_0x33646b;_0x4a04e3[_0x602e('0x2b')]=_[_0x602e('0x2e')](db['Action']['rawAttributes']);_0x4a04e3[_0x602e('0x2d')]=_[_0x602e('0x2e')](_0xfc6139[_0x602e('0x2d')]);_0x4a04e3['filters']=_['intersection'](_0x4a04e3[_0x602e('0x2b')],_0x4a04e3[_0x602e('0x2d')]);_0x126230[_0x602e('0x31')]=_['intersection'](_0x4a04e3['model'],qs[_0x602e('0x32')](_0xfc6139['query']['fields']));_0x126230[_0x602e('0x31')]=_0x126230['attributes']['length']?_0x126230['attributes']:_0x4a04e3[_0x602e('0x2b')];_0x126230[_0x602e('0x36')]=qs[_0x602e('0x37')](_0xfc6139[_0x602e('0x2d')][_0x602e('0x37')]);_0x126230['where']=qs[_0x602e('0x2f')](_[_0x602e('0x39')](_0xfc6139[_0x602e('0x2d')],_0x4a04e3['filters']));if(_0xfc6139[_0x602e('0x2d')][_0x602e('0x3a')]){_0x126230[_0x602e('0x38')]=_[_0x602e('0x3b')](_0x126230['where'],{'$or':_[_0x602e('0x26')](_0x126230[_0x602e('0x31')],function(_0x3e7c98){var _0x2c76c5={};_0x2c76c5[_0x3e7c98]={'$like':'%'+_0xfc6139[_0x602e('0x2d')]['filter']+'%'};return _0x2c76c5;})});}_0x126230=_[_0x602e('0x3b')]({},_0x126230,_0xfc6139['options']);return _0x438493[_0x602e('0x59')](_0x126230);}})[_0x602e('0x20')](function(_0x12b68e){if(_0x12b68e){_0x460493=_0x12b68e[_0x602e('0x33')];if(!_0xfc6139['query']['hasOwnProperty'](_0x602e('0x35'))){_0x126230['limit']=qs['limit'](_0xfc6139[_0x602e('0x2d')]['limit']);_0x126230['offset']=qs['offset'](_0xfc6139[_0x602e('0x2d')][_0x602e('0x18')]);}return _0x438493[_0x602e('0x59')](_0x126230);}})[_0x602e('0x20')](function(_0x5bff03){if(_0x5bff03){return _0x5bff03?{'count':_0x460493,'rows':_0x5bff03}:null;}})[_0x602e('0x20')](respondWithResult(_0x515b8b,null))['catch'](handleError(_0x515b8b,null));}; \ No newline at end of file +var _0x5b61=['../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','get','Triggers','UserProfileResource','error','stack','name','index','Trigger','rawAttributes','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','params','keys','includeAll','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addAllCondition','Condition','addAnyCondition','TriggerAnyId','getAllConditions','nolimit','getAnyConditions','findOne','addAction','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils'];(function(_0x288bff,_0x2a3a33){var _0x344990=function(_0x1f6c6a){while(--_0x1f6c6a){_0x288bff['push'](_0x288bff['shift']());}};_0x344990(++_0x2a3a33);}(_0x5b61,0x1b9));var _0x15b6=function(_0x5d1044,_0x18f656){_0x5d1044=_0x5d1044-0x0;var _0x3cd90e=_0x5b61[_0x5d1044];return _0x3cd90e;};'use strict';var emlformat=require(_0x15b6('0x0'));var rimraf=require(_0x15b6('0x1'));var zipdir=require(_0x15b6('0x2'));var jsonpatch=require(_0x15b6('0x3'));var rp=require(_0x15b6('0x4'));var moment=require('moment');var BPromise=require(_0x15b6('0x5'));var Mustache=require(_0x15b6('0x6'));var util=require(_0x15b6('0x7'));var path=require(_0x15b6('0x8'));var sox=require('sox');var csv=require(_0x15b6('0x9'));var ejs=require(_0x15b6('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x15b6('0xb'));var squel=require('squel');var crypto=require(_0x15b6('0xc'));var jsforce=require(_0x15b6('0xd'));var deskjs=require(_0x15b6('0xe'));var toCsv=require('to-csv');var querystring=require(_0x15b6('0xf'));var Papa=require(_0x15b6('0x10'));var Redis=require(_0x15b6('0x11'));var authService=require(_0x15b6('0x12'));var qs=require(_0x15b6('0x13'));var as=require(_0x15b6('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x15b6('0x15'))(_0x15b6('0x16'));var utils=require(_0x15b6('0x17'));var config=require(_0x15b6('0x18'));var licenseUtil=require(_0x15b6('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3006c2,_0x1c4d15){_0x1c4d15=_0x1c4d15||0xcc;return function(_0x5b3690){if(_0x5b3690){return _0x3006c2['sendStatus'](_0x1c4d15);}return _0x3006c2[_0x15b6('0x1a')](_0x1c4d15)[_0x15b6('0x1b')]();};}function respondWithResult(_0x566665,_0x559444){_0x559444=_0x559444||0xc8;return function(_0x203ca1){if(_0x203ca1){return _0x566665[_0x15b6('0x1a')](_0x559444)['json'](_0x203ca1);}};}function respondWithFilteredResult(_0x420da1,_0xa7216c){return function(_0x506ef0){if(_0x506ef0){var _0x3e864d=typeof _0xa7216c[_0x15b6('0x1c')]===_0x15b6('0x1d')&&typeof _0xa7216c[_0x15b6('0x1e')]===_0x15b6('0x1d');var _0x4d2c91=_0x506ef0[_0x15b6('0x1f')];var _0x6d3666=_0x3e864d?0x0:_0xa7216c[_0x15b6('0x1c')];var _0x2e45d9=_0x3e864d?_0x506ef0[_0x15b6('0x1f')]:_0xa7216c[_0x15b6('0x1c')]+_0xa7216c[_0x15b6('0x1e')];var _0x2952b1;if(_0x2e45d9>=_0x4d2c91){_0x2e45d9=_0x4d2c91;_0x2952b1=0xc8;}else{_0x2952b1=0xce;}_0x420da1['status'](_0x2952b1);return _0x420da1[_0x15b6('0x20')](_0x15b6('0x21'),_0x6d3666+'-'+_0x2e45d9+'/'+_0x4d2c91)[_0x15b6('0x22')](_0x506ef0);}return null;};}function patchUpdates(_0x334877){return function(_0x1295d0){try{jsonpatch[_0x15b6('0x23')](_0x1295d0,_0x334877,!![]);}catch(_0x5824e7){return BPromise['reject'](_0x5824e7);}return _0x1295d0[_0x15b6('0x24')]();};}function saveUpdates(_0x508db1,_0x10841b){return function(_0xc978ea){if(_0xc978ea){return _0xc978ea[_0x15b6('0x25')](_0x508db1)[_0x15b6('0x26')](function(_0x49f2fd){return _0x49f2fd;});}return null;};}function removeEntity(_0x3da4b4,_0x181071){return function(_0x29dbe3){if(_0x29dbe3){return _0x29dbe3[_0x15b6('0x27')]()['then'](function(){var _0x52e094=_0x29dbe3[_0x15b6('0x28')]({'plain':!![]});var _0x57455a=_0x15b6('0x29');return db[_0x15b6('0x2a')]['destroy']({'where':{'type':_0x57455a,'resourceId':_0x52e094['id']}})['then'](function(){return _0x29dbe3;});})[_0x15b6('0x26')](function(){_0x3da4b4[_0x15b6('0x1a')](0xcc)[_0x15b6('0x1b')]();});}};}function handleEntityNotFound(_0x1bd52f,_0x489848){return function(_0x317b2b){if(!_0x317b2b){_0x1bd52f['sendStatus'](0x194);}return _0x317b2b;};}function handleError(_0x4c6c66,_0x2d968b){_0x2d968b=_0x2d968b||0x1f4;return function(_0x4cf3f3){logger[_0x15b6('0x2b')](_0x4cf3f3[_0x15b6('0x2c')]);if(_0x4cf3f3[_0x15b6('0x2d')]){delete _0x4cf3f3[_0x15b6('0x2d')];}_0x4c6c66['status'](_0x2d968b)['send'](_0x4cf3f3);};}exports[_0x15b6('0x2e')]=function(_0x61bab2,_0x42a390){var _0x2881f3={},_0x2e4709={},_0x52f864={'count':0x0,'rows':[]};var _0x102391=_['map'](db[_0x15b6('0x2f')][_0x15b6('0x30')],function(_0x146432){return{'name':_0x146432['fieldName'],'type':_0x146432['type'][_0x15b6('0x31')]};});_0x2e4709[_0x15b6('0x32')]=_[_0x15b6('0x33')](_0x102391,_0x15b6('0x2d'));_0x2e4709[_0x15b6('0x34')]=_['keys'](_0x61bab2[_0x15b6('0x34')]);_0x2e4709[_0x15b6('0x35')]=_[_0x15b6('0x36')](_0x2e4709[_0x15b6('0x32')],_0x2e4709['query']);_0x2881f3[_0x15b6('0x37')]=_[_0x15b6('0x36')](_0x2e4709['model'],qs[_0x15b6('0x38')](_0x61bab2[_0x15b6('0x34')][_0x15b6('0x38')]));_0x2881f3[_0x15b6('0x37')]=_0x2881f3[_0x15b6('0x37')][_0x15b6('0x39')]?_0x2881f3[_0x15b6('0x37')]:_0x2e4709[_0x15b6('0x32')];if(!_0x61bab2['query'][_0x15b6('0x3a')]('nolimit')){_0x2881f3['limit']=qs['limit'](_0x61bab2[_0x15b6('0x34')]['limit']);_0x2881f3[_0x15b6('0x1c')]=qs['offset'](_0x61bab2['query']['offset']);}_0x2881f3[_0x15b6('0x3b')]=qs['sort'](_0x61bab2[_0x15b6('0x34')][_0x15b6('0x3c')]);_0x2881f3[_0x15b6('0x3d')]=qs[_0x15b6('0x35')](_[_0x15b6('0x3e')](_0x61bab2[_0x15b6('0x34')],_0x2e4709[_0x15b6('0x35')]),_0x102391);if(_0x61bab2[_0x15b6('0x34')][_0x15b6('0x3f')]){_0x2881f3['where']=_[_0x15b6('0x40')](_0x2881f3[_0x15b6('0x3d')],{'$or':_[_0x15b6('0x33')](_0x102391,function(_0x106b2d){if(_0x106b2d['type']!==_0x15b6('0x41')){var _0x2a6fdb={};_0x2a6fdb[_0x106b2d[_0x15b6('0x2d')]]={'$like':'%'+_0x61bab2['query'][_0x15b6('0x3f')]+'%'};return _0x2a6fdb;}})});}_0x2881f3=_['merge']({},_0x2881f3,_0x61bab2[_0x15b6('0x42')]);var _0x4608f3={'where':_0x2881f3[_0x15b6('0x3d')]};return db[_0x15b6('0x2f')][_0x15b6('0x1f')](_0x4608f3)['then'](function(_0x8ca67c){_0x52f864[_0x15b6('0x1f')]=_0x8ca67c;if(_0x61bab2[_0x15b6('0x34')]['includeAll']){_0x2881f3[_0x15b6('0x43')]=[{'all':!![]}];}return db[_0x15b6('0x2f')]['findAll'](_0x2881f3);})[_0x15b6('0x26')](function(_0x585547){_0x52f864[_0x15b6('0x44')]=_0x585547;return _0x52f864;})[_0x15b6('0x26')](respondWithFilteredResult(_0x42a390,_0x2881f3))[_0x15b6('0x45')](handleError(_0x42a390,null));};exports[_0x15b6('0x46')]=function(_0x476256,_0x51a747){var _0x36749e={'raw':![],'where':{'id':_0x476256[_0x15b6('0x47')]['id']}},_0x11343c={};_0x11343c['model']=_['keys'](db[_0x15b6('0x2f')]['rawAttributes']);_0x11343c[_0x15b6('0x34')]=_[_0x15b6('0x48')](_0x476256[_0x15b6('0x34')]);_0x11343c[_0x15b6('0x35')]=_[_0x15b6('0x36')](_0x11343c[_0x15b6('0x32')],_0x11343c[_0x15b6('0x34')]);_0x36749e[_0x15b6('0x37')]=_['intersection'](_0x11343c[_0x15b6('0x32')],qs[_0x15b6('0x38')](_0x476256[_0x15b6('0x34')][_0x15b6('0x38')]));_0x36749e[_0x15b6('0x37')]=_0x36749e['attributes'][_0x15b6('0x39')]?_0x36749e[_0x15b6('0x37')]:_0x11343c[_0x15b6('0x32')];if(_0x476256[_0x15b6('0x34')][_0x15b6('0x49')]){_0x36749e[_0x15b6('0x43')]=[{'all':!![]}];}_0x36749e=_[_0x15b6('0x40')]({},_0x36749e,_0x476256[_0x15b6('0x42')]);return db['Trigger']['find'](_0x36749e)[_0x15b6('0x26')](handleEntityNotFound(_0x51a747,null))[_0x15b6('0x26')](respondWithResult(_0x51a747,null))['catch'](handleError(_0x51a747,null));};exports[_0x15b6('0x4a')]=function(_0x287461,_0x828b9e){return db[_0x15b6('0x2f')]['create'](_0x287461['body'],{})['then'](function(_0x4c1729){var _0x27b1c7=_0x287461[_0x15b6('0x4b')][_0x15b6('0x28')]({'plain':!![]});if(!_0x27b1c7)throw new Error(_0x15b6('0x4c'));if(_0x27b1c7[_0x15b6('0x4d')]==='user'){var _0x2f1733=_0x4c1729[_0x15b6('0x28')]({'plain':!![]});var _0x3c7d36=_0x15b6('0x29');return db['UserProfileSection'][_0x15b6('0x4e')]({'where':{'name':_0x3c7d36,'userProfileId':_0x27b1c7['userProfileId']},'raw':!![]})[_0x15b6('0x26')](function(_0x2d766a){if(_0x2d766a&&_0x2d766a[_0x15b6('0x4f')]===0x0){return db['UserProfileResource'][_0x15b6('0x4a')]({'name':_0x2f1733[_0x15b6('0x2d')],'resourceId':_0x2f1733['id'],'type':_0x2d766a[_0x15b6('0x2d')],'sectionId':_0x2d766a['id']},{})[_0x15b6('0x26')](function(){return _0x4c1729;});}else{return _0x4c1729;}})[_0x15b6('0x45')](function(_0x47b5bc){logger[_0x15b6('0x2b')](_0x15b6('0x50'),_0x47b5bc);throw _0x47b5bc;});}return _0x4c1729;})['then'](respondWithResult(_0x828b9e,0xc9))[_0x15b6('0x45')](handleError(_0x828b9e,null));};exports[_0x15b6('0x25')]=function(_0x4a2f49,_0x24a677){if(_0x4a2f49[_0x15b6('0x51')]['id']){delete _0x4a2f49[_0x15b6('0x51')]['id'];}return db['Trigger'][_0x15b6('0x4e')]({'where':{'id':_0x4a2f49[_0x15b6('0x47')]['id']}})[_0x15b6('0x26')](handleEntityNotFound(_0x24a677,null))[_0x15b6('0x26')](saveUpdates(_0x4a2f49['body'],null))[_0x15b6('0x26')](respondWithResult(_0x24a677,null))['catch'](handleError(_0x24a677,null));};exports[_0x15b6('0x27')]=function(_0x2da7c6,_0x221bff){return db[_0x15b6('0x2f')][_0x15b6('0x4e')]({'where':{'id':_0x2da7c6[_0x15b6('0x47')]['id']}})['then'](handleEntityNotFound(_0x221bff,null))['then'](removeEntity(_0x221bff,null))[_0x15b6('0x45')](handleError(_0x221bff,null));};exports[_0x15b6('0x52')]=function(_0x246e6e,_0x3bb2e7,_0x29a067){if(_0x246e6e[_0x15b6('0x51')]['id']){delete _0x246e6e[_0x15b6('0x51')]['id'];}return db[_0x15b6('0x2f')][_0x15b6('0x4e')]({'where':{'id':_0x246e6e[_0x15b6('0x47')]['id']}})[_0x15b6('0x26')](handleEntityNotFound(_0x3bb2e7,null))[_0x15b6('0x26')](function(_0x4144bf){if(_0x4144bf){_0x246e6e[_0x15b6('0x51')]['TriggerAllId']=_0x4144bf['id'];return db[_0x15b6('0x53')][_0x15b6('0x4a')](_0x246e6e['body']);}})[_0x15b6('0x26')](respondWithResult(_0x3bb2e7,null))['catch'](handleError(_0x3bb2e7,null));};exports[_0x15b6('0x54')]=function(_0x3285ef,_0x16e7aa,_0x33427b){if(_0x3285ef['body']['id']){delete _0x3285ef[_0x15b6('0x51')]['id'];}return db[_0x15b6('0x2f')][_0x15b6('0x4e')]({'where':{'id':_0x3285ef[_0x15b6('0x47')]['id']}})[_0x15b6('0x26')](handleEntityNotFound(_0x16e7aa,null))[_0x15b6('0x26')](function(_0x16dc04){if(_0x16dc04){_0x3285ef[_0x15b6('0x51')][_0x15b6('0x55')]=_0x16dc04['id'];return db[_0x15b6('0x53')][_0x15b6('0x4a')](_0x3285ef[_0x15b6('0x51')]);}})['then'](respondWithResult(_0x16e7aa,null))[_0x15b6('0x45')](handleError(_0x16e7aa,null));};exports[_0x15b6('0x56')]=function(_0x33d583,_0x4226a5,_0x1c16d7){var _0x7c5dee={};var _0x5afb5f={};var _0xdfd18a;var _0x3d21e0;return db[_0x15b6('0x2f')]['findOne']({'where':{'id':_0x33d583[_0x15b6('0x47')]['id']}})[_0x15b6('0x26')](handleEntityNotFound(_0x4226a5,null))[_0x15b6('0x26')](function(_0x21c9ac){if(_0x21c9ac){_0xdfd18a=_0x21c9ac;_0x5afb5f[_0x15b6('0x32')]=_[_0x15b6('0x48')](db['Condition']['rawAttributes']);_0x5afb5f[_0x15b6('0x34')]=_[_0x15b6('0x48')](_0x33d583[_0x15b6('0x34')]);_0x5afb5f['filters']=_['intersection'](_0x5afb5f['model'],_0x5afb5f[_0x15b6('0x34')]);_0x7c5dee[_0x15b6('0x37')]=_[_0x15b6('0x36')](_0x5afb5f[_0x15b6('0x32')],qs[_0x15b6('0x38')](_0x33d583['query']['fields']));_0x7c5dee['attributes']=_0x7c5dee[_0x15b6('0x37')][_0x15b6('0x39')]?_0x7c5dee['attributes']:_0x5afb5f[_0x15b6('0x32')];_0x7c5dee['order']=qs[_0x15b6('0x3c')](_0x33d583['query'][_0x15b6('0x3c')]);_0x7c5dee['where']=qs[_0x15b6('0x35')](_[_0x15b6('0x3e')](_0x33d583['query'],_0x5afb5f[_0x15b6('0x35')]));if(_0x33d583[_0x15b6('0x34')][_0x15b6('0x3f')]){_0x7c5dee[_0x15b6('0x3d')]=_['merge'](_0x7c5dee[_0x15b6('0x3d')],{'$or':_['map'](_0x7c5dee[_0x15b6('0x37')],function(_0x58be18){var _0x22e523={};_0x22e523[_0x58be18]={'$like':'%'+_0x33d583[_0x15b6('0x34')][_0x15b6('0x3f')]+'%'};return _0x22e523;})});}_0x7c5dee=_['merge']({},_0x7c5dee,_0x33d583['options']);return _0xdfd18a[_0x15b6('0x56')](_0x7c5dee);}})[_0x15b6('0x26')](function(_0x494e9d){if(_0x494e9d){_0x3d21e0=_0x494e9d[_0x15b6('0x39')];if(!_0x33d583[_0x15b6('0x34')][_0x15b6('0x3a')](_0x15b6('0x57'))){_0x7c5dee[_0x15b6('0x1e')]=qs[_0x15b6('0x1e')](_0x33d583[_0x15b6('0x34')]['limit']);_0x7c5dee[_0x15b6('0x1c')]=qs['offset'](_0x33d583[_0x15b6('0x34')][_0x15b6('0x1c')]);}return _0xdfd18a[_0x15b6('0x56')](_0x7c5dee);}})['then'](function(_0x44217d){if(_0x44217d){return _0x44217d?{'count':_0x3d21e0,'rows':_0x44217d}:null;}})['then'](respondWithResult(_0x4226a5,null))[_0x15b6('0x45')](handleError(_0x4226a5,null));};exports[_0x15b6('0x58')]=function(_0x1b3b32,_0x3c94b9,_0x2b16f6){var _0x29207d={};var _0x36ec60={};var _0x54af4a;var _0x2a270d;return db[_0x15b6('0x2f')][_0x15b6('0x59')]({'where':{'id':_0x1b3b32['params']['id']}})['then'](handleEntityNotFound(_0x3c94b9,null))[_0x15b6('0x26')](function(_0x499551){if(_0x499551){_0x54af4a=_0x499551;_0x36ec60[_0x15b6('0x32')]=_['keys'](db[_0x15b6('0x53')][_0x15b6('0x30')]);_0x36ec60['query']=_['keys'](_0x1b3b32[_0x15b6('0x34')]);_0x36ec60[_0x15b6('0x35')]=_[_0x15b6('0x36')](_0x36ec60['model'],_0x36ec60[_0x15b6('0x34')]);_0x29207d[_0x15b6('0x37')]=_[_0x15b6('0x36')](_0x36ec60[_0x15b6('0x32')],qs[_0x15b6('0x38')](_0x1b3b32[_0x15b6('0x34')]['fields']));_0x29207d[_0x15b6('0x37')]=_0x29207d[_0x15b6('0x37')][_0x15b6('0x39')]?_0x29207d['attributes']:_0x36ec60[_0x15b6('0x32')];_0x29207d[_0x15b6('0x3b')]=qs[_0x15b6('0x3c')](_0x1b3b32[_0x15b6('0x34')][_0x15b6('0x3c')]);_0x29207d[_0x15b6('0x3d')]=qs[_0x15b6('0x35')](_['pick'](_0x1b3b32[_0x15b6('0x34')],_0x36ec60[_0x15b6('0x35')]));if(_0x1b3b32['query']['filter']){_0x29207d[_0x15b6('0x3d')]=_[_0x15b6('0x40')](_0x29207d[_0x15b6('0x3d')],{'$or':_['map'](_0x29207d[_0x15b6('0x37')],function(_0x1176b1){var _0x2e11af={};_0x2e11af[_0x1176b1]={'$like':'%'+_0x1b3b32[_0x15b6('0x34')][_0x15b6('0x3f')]+'%'};return _0x2e11af;})});}_0x29207d=_[_0x15b6('0x40')]({},_0x29207d,_0x1b3b32[_0x15b6('0x42')]);return _0x54af4a['getAnyConditions'](_0x29207d);}})[_0x15b6('0x26')](function(_0x3f2b06){if(_0x3f2b06){_0x2a270d=_0x3f2b06['length'];if(!_0x1b3b32[_0x15b6('0x34')][_0x15b6('0x3a')](_0x15b6('0x57'))){_0x29207d[_0x15b6('0x1e')]=qs[_0x15b6('0x1e')](_0x1b3b32['query']['limit']);_0x29207d[_0x15b6('0x1c')]=qs[_0x15b6('0x1c')](_0x1b3b32[_0x15b6('0x34')][_0x15b6('0x1c')]);}return _0x54af4a['getAnyConditions'](_0x29207d);}})[_0x15b6('0x26')](function(_0x279eb9){if(_0x279eb9){return _0x279eb9?{'count':_0x2a270d,'rows':_0x279eb9}:null;}})[_0x15b6('0x26')](respondWithResult(_0x3c94b9,null))[_0x15b6('0x45')](handleError(_0x3c94b9,null));};exports[_0x15b6('0x5a')]=function(_0xb386cf,_0x3d881c,_0x41d481){if(_0xb386cf[_0x15b6('0x51')]['id']){delete _0xb386cf[_0x15b6('0x51')]['id'];}return db[_0x15b6('0x2f')]['find']({'where':{'id':_0xb386cf[_0x15b6('0x47')]['id']}})['then'](handleEntityNotFound(_0x3d881c,null))[_0x15b6('0x26')](function(_0x46bae7){if(_0x46bae7){_0xb386cf['body']['TriggerId']=_0x46bae7['id'];return db[_0x15b6('0x5b')]['create'](_0xb386cf[_0x15b6('0x51')]);}})[_0x15b6('0x26')](respondWithResult(_0x3d881c,null))[_0x15b6('0x45')](handleError(_0x3d881c,null));};exports[_0x15b6('0x5c')]=function(_0x11d559,_0xa07f4d,_0x4defe6){var _0x61b439={};var _0x3ef180={};var _0x507e0b;var _0x28e048;return db[_0x15b6('0x2f')][_0x15b6('0x59')]({'where':{'id':_0x11d559['params']['id']}})[_0x15b6('0x26')](handleEntityNotFound(_0xa07f4d,null))[_0x15b6('0x26')](function(_0x1876da){if(_0x1876da){_0x507e0b=_0x1876da;_0x3ef180['model']=_[_0x15b6('0x48')](db['Action'][_0x15b6('0x30')]);_0x3ef180[_0x15b6('0x34')]=_[_0x15b6('0x48')](_0x11d559[_0x15b6('0x34')]);_0x3ef180[_0x15b6('0x35')]=_[_0x15b6('0x36')](_0x3ef180[_0x15b6('0x32')],_0x3ef180['query']);_0x61b439[_0x15b6('0x37')]=_[_0x15b6('0x36')](_0x3ef180[_0x15b6('0x32')],qs['fields'](_0x11d559[_0x15b6('0x34')][_0x15b6('0x38')]));_0x61b439[_0x15b6('0x37')]=_0x61b439['attributes'][_0x15b6('0x39')]?_0x61b439[_0x15b6('0x37')]:_0x3ef180[_0x15b6('0x32')];_0x61b439[_0x15b6('0x3b')]=qs['sort'](_0x11d559[_0x15b6('0x34')][_0x15b6('0x3c')]);_0x61b439[_0x15b6('0x3d')]=qs[_0x15b6('0x35')](_[_0x15b6('0x3e')](_0x11d559[_0x15b6('0x34')],_0x3ef180[_0x15b6('0x35')]));if(_0x11d559[_0x15b6('0x34')][_0x15b6('0x3f')]){_0x61b439['where']=_[_0x15b6('0x40')](_0x61b439['where'],{'$or':_[_0x15b6('0x33')](_0x61b439[_0x15b6('0x37')],function(_0x48a264){var _0x54fd4c={};_0x54fd4c[_0x48a264]={'$like':'%'+_0x11d559[_0x15b6('0x34')][_0x15b6('0x3f')]+'%'};return _0x54fd4c;})});}_0x61b439=_['merge']({},_0x61b439,_0x11d559[_0x15b6('0x42')]);return _0x507e0b[_0x15b6('0x5c')](_0x61b439);}})['then'](function(_0x2a1814){if(_0x2a1814){_0x28e048=_0x2a1814[_0x15b6('0x39')];if(!_0x11d559[_0x15b6('0x34')][_0x15b6('0x3a')](_0x15b6('0x57'))){_0x61b439[_0x15b6('0x1e')]=qs[_0x15b6('0x1e')](_0x11d559[_0x15b6('0x34')]['limit']);_0x61b439[_0x15b6('0x1c')]=qs[_0x15b6('0x1c')](_0x11d559[_0x15b6('0x34')][_0x15b6('0x1c')]);}return _0x507e0b[_0x15b6('0x5c')](_0x61b439);}})[_0x15b6('0x26')](function(_0x11a405){if(_0x11a405){return _0x11a405?{'count':_0x28e048,'rows':_0x11a405}:null;}})['then'](respondWithResult(_0xa07f4d,null))['catch'](handleError(_0xa07f4d,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index ed2ebcf..944ba1c 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 _0x535f=['./trigger.attributes','exports','define','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x4ed37d,_0x1a84c9){var _0x4fb2c5=function(_0x5c9013){while(--_0x5c9013){_0x4ed37d['push'](_0x4ed37d['shift']());}};_0x4fb2c5(++_0x1a84c9);}(_0x535f,0x111));var _0xf535=function(_0x225c83,_0x411d35){_0x225c83=_0x225c83-0x0;var _0x138677=_0x535f[_0x225c83];return _0x138677;};'use strict';var _=require('lodash');var util=require(_0xf535('0x0'));var logger=require(_0xf535('0x1'))('api');var moment=require(_0xf535('0x2'));var BPromise=require(_0xf535('0x3'));var rp=require(_0xf535('0x4'));var fs=require('fs');var path=require(_0xf535('0x5'));var rimraf=require('rimraf');var config=require(_0xf535('0x6'));var attributes=require(_0xf535('0x7'));module[_0xf535('0x8')]=function(_0x30936d,_0x41ca74){return _0x30936d[_0xf535('0x9')]('Trigger',attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6873=['request-promise','rimraf','./trigger.attributes','exports','define','Trigger','tools_triggers','../../config/logger','api','moment','bluebird'];(function(_0xcf4f2c,_0x28d7d3){var _0x2f4752=function(_0x1ae0c7){while(--_0x1ae0c7){_0xcf4f2c['push'](_0xcf4f2c['shift']());}};_0x2f4752(++_0x28d7d3);}(_0x6873,0xac));var _0x3687=function(_0x5a6644,_0x45d612){_0x5a6644=_0x5a6644-0x0;var _0x3a2a5d=_0x6873[_0x5a6644];return _0x3a2a5d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3687('0x0'))(_0x3687('0x1'));var moment=require(_0x3687('0x2'));var BPromise=require(_0x3687('0x3'));var rp=require(_0x3687('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3687('0x5'));var config=require('../../config/environment');var attributes=require(_0x3687('0x6'));module[_0x3687('0x7')]=function(_0x4ecd9e,_0x3ff2e3){return _0x4ecd9e[_0x3687('0x8')](_0x3687('0x9'),attributes,{'tableName':_0x3687('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 1732963..26b99ee 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 _0xf332=['model','map','then','catch','ShowTrigger','find','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','client','http','request','Trigger,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','GetTrigger','Trigger','options','raw','attributes','include'];(function(_0x1ec9d1,_0x35ecaf){var _0x4b6bc2=function(_0x2695c6){while(--_0x2695c6){_0x1ec9d1['push'](_0x1ec9d1['shift']());}};_0x4b6bc2(++_0x35ecaf);}(_0xf332,0x15b));var _0x2f33=function(_0x558436,_0x2da95b){_0x558436=_0x558436-0x0;var _0x13148a=_0xf332[_0x558436];return _0x13148a;};'use strict';var _=require(_0x2f33('0x0'));var util=require(_0x2f33('0x1'));var moment=require('moment');var BPromise=require(_0x2f33('0x2'));var rs=require(_0x2f33('0x3'));var fs=require('fs');var Redis=require(_0x2f33('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2f33('0x5'));var logger=require('../../config/logger')(_0x2f33('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2f33('0x7')][_0x2f33('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x398c1e,_0x5dfa8c,_0x3f72db){return new BPromise(function(_0xa7399c,_0x39143a){return client[_0x2f33('0x9')](_0x398c1e,_0x3f72db)['then'](function(_0x471fb5){logger['info'](_0x2f33('0xa'),_0x5dfa8c,_0x2f33('0xb'));logger[_0x2f33('0xc')]('Trigger,\x20%s,\x20%s,\x20%s',_0x5dfa8c,_0x2f33('0xb'),JSON[_0x2f33('0xd')](_0x471fb5));if(_0x471fb5[_0x2f33('0xe')]){if(_0x471fb5[_0x2f33('0xe')][_0x2f33('0xf')]===0x1f4){logger[_0x2f33('0xe')]('Trigger,\x20%s,\x20%s',_0x5dfa8c,_0x471fb5[_0x2f33('0xe')][_0x2f33('0x10')]);return _0x39143a(_0x471fb5[_0x2f33('0xe')][_0x2f33('0x10')]);}logger[_0x2f33('0xe')](_0x2f33('0xa'),_0x5dfa8c,_0x471fb5['error'][_0x2f33('0x10')]);return _0xa7399c(_0x471fb5['error'][_0x2f33('0x10')]);}else{logger[_0x2f33('0x11')](_0x2f33('0xa'),_0x5dfa8c,_0x2f33('0xb'));_0xa7399c(_0x471fb5[_0x2f33('0x12')][_0x2f33('0x10')]);}})['catch'](function(_0x29125d){logger[_0x2f33('0xe')](_0x2f33('0xa'),_0x5dfa8c,_0x29125d);_0x39143a(_0x29125d);});});}exports[_0x2f33('0x13')]=function(_0x545bb9){var _0x5aba1e=this;return new Promise(function(_0x16c64a,_0x184eb4){return db[_0x2f33('0x14')]['findAll']({'raw':_0x545bb9[_0x2f33('0x15')]?_0x545bb9[_0x2f33('0x15')][_0x2f33('0x16')]===undefined?!![]:![]:!![],'where':_0x545bb9[_0x2f33('0x15')]?_0x545bb9[_0x2f33('0x15')]['where']||null:null,'attributes':_0x545bb9[_0x2f33('0x15')]?_0x545bb9[_0x2f33('0x15')][_0x2f33('0x17')]||null:null,'limit':_0x545bb9['options']?_0x545bb9[_0x2f33('0x15')]['limit']||null:null,'include':_0x545bb9[_0x2f33('0x15')]?_0x545bb9[_0x2f33('0x15')][_0x2f33('0x18')]?_['map'](_0x545bb9[_0x2f33('0x15')][_0x2f33('0x18')],function(_0x304f17){return{'model':db[_0x304f17[_0x2f33('0x19')]],'as':_0x304f17['as'],'attributes':_0x304f17[_0x2f33('0x17')],'include':_0x304f17[_0x2f33('0x18')]?_['map'](_0x304f17[_0x2f33('0x18')],function(_0x3a712b){return{'model':db[_0x3a712b[_0x2f33('0x19')]],'as':_0x3a712b['as'],'attributes':_0x3a712b[_0x2f33('0x17')],'include':_0x3a712b[_0x2f33('0x18')]?_[_0x2f33('0x1a')](_0x3a712b[_0x2f33('0x18')],function(_0x4f1c49){return{'model':db[_0x4f1c49[_0x2f33('0x19')]],'as':_0x4f1c49['as'],'attributes':_0x4f1c49[_0x2f33('0x17')]};}):[]};}):[]};}):[]:[]})[_0x2f33('0x1b')](function(_0x228e5a){logger[_0x2f33('0x11')]('GetTrigger',_0x545bb9);logger['debug'](_0x2f33('0x13'),_0x545bb9,JSON[_0x2f33('0xd')](_0x228e5a));_0x16c64a(_0x228e5a);})[_0x2f33('0x1c')](function(_0x10539b){logger['error'](_0x2f33('0x13'),_0x10539b[_0x2f33('0x10')],_0x545bb9);_0x184eb4(_0x5aba1e[_0x2f33('0xe')](0x1f4,_0x10539b[_0x2f33('0x10')]));});});};exports[_0x2f33('0x1d')]=function(_0x13d95d){var _0x347a23=this;return new Promise(function(_0x503eea,_0xc9a489){return db['Trigger'][_0x2f33('0x1e')]({'raw':_0x13d95d['options']?_0x13d95d[_0x2f33('0x15')][_0x2f33('0x16')]===undefined?!![]:![]:!![],'where':_0x13d95d['options']?_0x13d95d[_0x2f33('0x15')]['where']||null:null,'attributes':_0x13d95d[_0x2f33('0x15')]?_0x13d95d[_0x2f33('0x15')][_0x2f33('0x17')]||null:null,'include':_0x13d95d[_0x2f33('0x15')]?_0x13d95d[_0x2f33('0x15')][_0x2f33('0x18')]?_[_0x2f33('0x1a')](_0x13d95d[_0x2f33('0x15')][_0x2f33('0x18')],function(_0x4ec3e1){return{'model':db[_0x4ec3e1[_0x2f33('0x19')]],'as':_0x4ec3e1['as'],'attributes':_0x4ec3e1[_0x2f33('0x17')],'include':_0x4ec3e1['include']?_[_0x2f33('0x1a')](_0x4ec3e1[_0x2f33('0x18')],function(_0x12475e){return{'model':db[_0x12475e[_0x2f33('0x19')]],'as':_0x12475e['as'],'attributes':_0x12475e[_0x2f33('0x17')],'include':_0x12475e[_0x2f33('0x18')]?_[_0x2f33('0x1a')](_0x12475e[_0x2f33('0x18')],function(_0x57f72a){return{'model':db[_0x57f72a[_0x2f33('0x19')]],'as':_0x57f72a['as'],'attributes':_0x57f72a[_0x2f33('0x17')]};}):[]};}):[]};}):[]:[]})[_0x2f33('0x1b')](function(_0x1d6f2f){logger[_0x2f33('0x11')](_0x2f33('0x1d'),_0x13d95d);logger[_0x2f33('0xc')](_0x2f33('0x1d'),_0x13d95d,JSON[_0x2f33('0xd')](_0x1d6f2f));_0x503eea(_0x1d6f2f);})[_0x2f33('0x1c')](function(_0x184bdd){logger[_0x2f33('0xe')](_0x2f33('0x1d'),_0x184bdd[_0x2f33('0x10')],_0x13d95d);_0xc9a489(_0x347a23[_0x2f33('0xe')](0x1f4,_0x184bdd[_0x2f33('0x10')]));});});}; \ No newline at end of file +var _0x3439=['request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTrigger','Trigger','findAll','options','where','limit','include','map','attributes','model','raw','then','ShowTrigger','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','Trigger,\x20%s,\x20%s'];(function(_0x5295ee,_0x2bfa00){var _0x5f1ddc=function(_0x18d5f4){while(--_0x18d5f4){_0x5295ee['push'](_0x5295ee['shift']());}};_0x5f1ddc(++_0x2bfa00);}(_0x3439,0x12e));var _0x9343=function(_0x40ee1b,_0x1fcb9c){_0x40ee1b=_0x40ee1b-0x0;var _0x2fc4ba=_0x3439[_0x40ee1b];return _0x2fc4ba;};'use strict';var _=require(_0x9343('0x0'));var util=require(_0x9343('0x1'));var moment=require('moment');var BPromise=require(_0x9343('0x2'));var rs=require(_0x9343('0x3'));var fs=require('fs');var Redis=require(_0x9343('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9343('0x5'));var logger=require('../../config/logger')(_0x9343('0x6'));var config=require(_0x9343('0x7'));var jayson=require(_0x9343('0x8'));var client=jayson[_0x9343('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x483ace,_0x1de8d2,_0x204ca8){return new BPromise(function(_0x4d03a2,_0x185fef){return client[_0x9343('0xa')](_0x483ace,_0x204ca8)['then'](function(_0x52d52c){logger[_0x9343('0xb')](_0x9343('0xc'),_0x1de8d2,_0x9343('0xd'));logger[_0x9343('0xe')](_0x9343('0xf'),_0x1de8d2,'request\x20sent',JSON[_0x9343('0x10')](_0x52d52c));if(_0x52d52c[_0x9343('0x11')]){if(_0x52d52c[_0x9343('0x11')][_0x9343('0x12')]===0x1f4){logger[_0x9343('0x11')]('Trigger,\x20%s,\x20%s',_0x1de8d2,_0x52d52c[_0x9343('0x11')][_0x9343('0x13')]);return _0x185fef(_0x52d52c['error']['message']);}logger[_0x9343('0x11')](_0x9343('0xc'),_0x1de8d2,_0x52d52c[_0x9343('0x11')][_0x9343('0x13')]);return _0x4d03a2(_0x52d52c[_0x9343('0x11')][_0x9343('0x13')]);}else{logger[_0x9343('0xb')](_0x9343('0xc'),_0x1de8d2,_0x9343('0xd'));_0x4d03a2(_0x52d52c[_0x9343('0x14')][_0x9343('0x13')]);}})[_0x9343('0x15')](function(_0xff0098){logger['error']('Trigger,\x20%s,\x20%s',_0x1de8d2,_0xff0098);_0x185fef(_0xff0098);});});}exports[_0x9343('0x16')]=function(_0x369590){var _0x4082bf=this;return new Promise(function(_0x10282e,_0x44d53a){return db[_0x9343('0x17')][_0x9343('0x18')]({'raw':_0x369590[_0x9343('0x19')]?_0x369590[_0x9343('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x369590[_0x9343('0x19')]?_0x369590[_0x9343('0x19')][_0x9343('0x1a')]||null:null,'attributes':_0x369590[_0x9343('0x19')]?_0x369590['options']['attributes']||null:null,'limit':_0x369590[_0x9343('0x19')]?_0x369590[_0x9343('0x19')][_0x9343('0x1b')]||null:null,'include':_0x369590[_0x9343('0x19')]?_0x369590[_0x9343('0x19')][_0x9343('0x1c')]?_[_0x9343('0x1d')](_0x369590[_0x9343('0x19')]['include'],function(_0x57272e){return{'model':db[_0x57272e['model']],'as':_0x57272e['as'],'attributes':_0x57272e[_0x9343('0x1e')],'include':_0x57272e['include']?_['map'](_0x57272e['include'],function(_0x4ce12f){return{'model':db[_0x4ce12f[_0x9343('0x1f')]],'as':_0x4ce12f['as'],'attributes':_0x4ce12f['attributes'],'include':_0x4ce12f[_0x9343('0x1c')]?_[_0x9343('0x1d')](_0x4ce12f[_0x9343('0x1c')],function(_0x38f0d2){return{'model':db[_0x38f0d2[_0x9343('0x1f')]],'as':_0x38f0d2['as'],'attributes':_0x38f0d2[_0x9343('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1842a7){logger[_0x9343('0xb')](_0x9343('0x16'),_0x369590);logger[_0x9343('0xe')](_0x9343('0x16'),_0x369590,JSON[_0x9343('0x10')](_0x1842a7));_0x10282e(_0x1842a7);})[_0x9343('0x15')](function(_0x1a48d8){logger[_0x9343('0x11')](_0x9343('0x16'),_0x1a48d8[_0x9343('0x13')],_0x369590);_0x44d53a(_0x4082bf[_0x9343('0x11')](0x1f4,_0x1a48d8['message']));});});};exports['ShowTrigger']=function(_0x216acb){var _0x4edea6=this;return new Promise(function(_0x37cc68,_0x421e1c){return db[_0x9343('0x17')]['find']({'raw':_0x216acb[_0x9343('0x19')]?_0x216acb[_0x9343('0x19')][_0x9343('0x20')]===undefined?!![]:![]:!![],'where':_0x216acb[_0x9343('0x19')]?_0x216acb[_0x9343('0x19')]['where']||null:null,'attributes':_0x216acb['options']?_0x216acb[_0x9343('0x19')][_0x9343('0x1e')]||null:null,'include':_0x216acb[_0x9343('0x19')]?_0x216acb[_0x9343('0x19')][_0x9343('0x1c')]?_['map'](_0x216acb[_0x9343('0x19')]['include'],function(_0x3956ae){return{'model':db[_0x3956ae[_0x9343('0x1f')]],'as':_0x3956ae['as'],'attributes':_0x3956ae['attributes'],'include':_0x3956ae[_0x9343('0x1c')]?_[_0x9343('0x1d')](_0x3956ae[_0x9343('0x1c')],function(_0x571799){return{'model':db[_0x571799[_0x9343('0x1f')]],'as':_0x571799['as'],'attributes':_0x571799[_0x9343('0x1e')],'include':_0x571799[_0x9343('0x1c')]?_[_0x9343('0x1d')](_0x571799[_0x9343('0x1c')],function(_0x300050){return{'model':db[_0x300050['model']],'as':_0x300050['as'],'attributes':_0x300050[_0x9343('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9343('0x21')](function(_0x3df5cb){logger[_0x9343('0xb')]('ShowTrigger',_0x216acb);logger[_0x9343('0xe')](_0x9343('0x22'),_0x216acb,JSON['stringify'](_0x3df5cb));_0x37cc68(_0x3df5cb);})[_0x9343('0x15')](function(_0x1682c4){logger[_0x9343('0x11')]('ShowTrigger',_0x1682c4[_0x9343('0x13')],_0x216acb);_0x421e1c(_0x4edea6['error'](0x1f4,_0x1682c4[_0x9343('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 7cd4411..1b6cfa9 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 _0xf8a6=['clone','create','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./trunk.controller','isAuthenticated','index','get','/:id','show','post','/:id/clone'];(function(_0xa25342,_0x24522b){var _0x52be43=function(_0x1ea0e9){while(--_0x1ea0e9){_0xa25342['push'](_0xa25342['shift']());}};_0x52be43(++_0x24522b);}(_0xf8a6,0x99));var _0x6f8a=function(_0x5eaa9f,_0x55700e){_0x5eaa9f=_0x5eaa9f-0x0;var _0x3ff070=_0xf8a6[_0x5eaa9f];return _0x3ff070;};'use strict';var multer=require('multer');var util=require(_0x6f8a('0x0'));var path=require('path');var timeout=require(_0x6f8a('0x1'));var express=require(_0x6f8a('0x2'));var router=express[_0x6f8a('0x3')]();var fs_extra=require(_0x6f8a('0x4'));var auth=require(_0x6f8a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6f8a('0x6'));var controller=require(_0x6f8a('0x7'));router['get']('/',auth[_0x6f8a('0x8')](),controller[_0x6f8a('0x9')]);router[_0x6f8a('0xa')](_0x6f8a('0xb'),auth['isAuthenticated'](),controller[_0x6f8a('0xc')]);router[_0x6f8a('0xd')](_0x6f8a('0xe'),auth[_0x6f8a('0x8')](),controller[_0x6f8a('0xf')]);router[_0x6f8a('0xd')]('/',auth[_0x6f8a('0x8')](),controller[_0x6f8a('0x10')]);router['put'](_0x6f8a('0xb'),auth[_0x6f8a('0x8')](),controller[_0x6f8a('0x11')]);router[_0x6f8a('0x12')](_0x6f8a('0xb'),auth[_0x6f8a('0x8')](),controller[_0x6f8a('0x13')]);module[_0x6f8a('0x14')]=router; \ No newline at end of file +var _0x9507=['exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','index','isAuthenticated','show','post','create','put','/:id','update','delete','destroy'];(function(_0x442a5d,_0x2a6745){var _0x51d134=function(_0x5cae90){while(--_0x5cae90){_0x442a5d['push'](_0x442a5d['shift']());}};_0x51d134(++_0x2a6745);}(_0x9507,0xe8));var _0x7950=function(_0x3103cd,_0x19733a){_0x3103cd=_0x3103cd-0x0;var _0x5ea0a4=_0x9507[_0x3103cd];return _0x5ea0a4;};'use strict';var multer=require(_0x7950('0x0'));var util=require('util');var path=require(_0x7950('0x1'));var timeout=require(_0x7950('0x2'));var express=require(_0x7950('0x3'));var router=express[_0x7950('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7950('0x5'));var interaction=require(_0x7950('0x6'));var config=require(_0x7950('0x7'));var controller=require(_0x7950('0x8'));router[_0x7950('0x9')]('/',auth['isAuthenticated'](),controller[_0x7950('0xa')]);router[_0x7950('0x9')]('/:id',auth[_0x7950('0xb')](),controller[_0x7950('0xc')]);router[_0x7950('0xd')]('/:id/clone',auth[_0x7950('0xb')](),controller['clone']);router['post']('/',auth[_0x7950('0xb')](),controller[_0x7950('0xe')]);router[_0x7950('0xf')](_0x7950('0x10'),auth[_0x7950('0xb')](),controller[_0x7950('0x11')]);router[_0x7950('0x12')](_0x7950('0x10'),auth[_0x7950('0xb')](),controller[_0x7950('0x13')]);module[_0x7950('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 4287650..ab5e7e8 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 _0xded7=['active','passive','actpass','dynamic','update','update,nonat','BOOLEAN','sequelize','exports','STRING','friend','user','peer','from-voip-provider','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp','join','getDataValue','transport','split','rfc2833','info','shortinfo','inband','yes','nonat','outgoing','force_rport,comedia','setDataValue','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','pai','fingerprint'];(function(_0x1cf351,_0x3e87ff){var _0x413c06=function(_0x57f8b9){while(--_0x57f8b9){_0x1cf351['push'](_0x1cf351['shift']());}};_0x413c06(++_0x3e87ff);}(_0xded7,0x115));var _0x7ded=function(_0x16688e,_0x51e0c0){_0x16688e=_0x16688e-0x0;var _0x546c69=_0xded7[_0x16688e];return _0x546c69;};'use strict';var Sequelize=require(_0x7ded('0x0'));module[_0x7ded('0x1')]={'name':{'type':Sequelize[_0x7ded('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x7ded('0x3'),_0x7ded('0x4'),_0x7ded('0x5')),'allowNull':![],'defaultValue':_0x7ded('0x3')},'context':{'type':Sequelize[_0x7ded('0x2')],'allowNull':![],'defaultValue':_0x7ded('0x6')},'callingpres':{'type':Sequelize[_0x7ded('0x7')](_0x7ded('0x8'),_0x7ded('0x9'),_0x7ded('0xa'),_0x7ded('0xb'),_0x7ded('0xc'),_0x7ded('0xd'),'PROHIB_FAILED_SCREEN',_0x7ded('0xe'))},'deny':{'type':Sequelize[_0x7ded('0x2')]},'permit':{'type':Sequelize[_0x7ded('0x2')]},'secret':{'type':Sequelize[_0x7ded('0x2')]},'md5secret':{'type':Sequelize[_0x7ded('0x2')]},'remotesecret':{'type':Sequelize[_0x7ded('0x2')]},'transport':{'type':Sequelize[_0x7ded('0x2')],'defaultValue':_0x7ded('0xf'),'set':function(_0x527a81){this['setDataValue']('transport',_0x527a81?_0x527a81[_0x7ded('0x10')](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0x7ded('0x11')](_0x7ded('0x12'))[_0x7ded('0x13')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x7ded('0x7')](_0x7ded('0x14'),_0x7ded('0x15'),_0x7ded('0x16'),_0x7ded('0x17'),'auto'),'defaultValue':_0x7ded('0x14')},'directmedia':{'type':Sequelize['ENUM'](_0x7ded('0x18'),'no',_0x7ded('0x19'),'update',_0x7ded('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x7ded('0x7')](_0x7ded('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x7ded('0x2')]},'directmediadeny':{'type':Sequelize[_0x7ded('0x2')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x7ded('0x1b'),'set':function(_0x2e42bb){this[_0x7ded('0x1c')](_0x7ded('0x1d'),_0x2e42bb?_0x2e42bb[_0x7ded('0x10')](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0x7ded('0x11')](_0x7ded('0x1d'))[_0x7ded('0x13')](','):null;},'comment':_0x7ded('0x1e')},'callgroup':{'type':Sequelize[_0x7ded('0x2')]},'namedcallgroup':{'type':Sequelize[_0x7ded('0x2')]},'pickupgroup':{'type':Sequelize[_0x7ded('0x2')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x7ded('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x7ded('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x7ded('0x2')],'defaultValue':'all'},'allow':{'type':Sequelize[_0x7ded('0x2')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0xff5fcc){this['setDataValue'](_0x7ded('0x1f'),_0xff5fcc?_0xff5fcc[_0x7ded('0x10')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x7ded('0x11')](_0x7ded('0x1f'))?this['getDataValue'](_0x7ded('0x1f'))[_0x7ded('0x13')](';'):null;},'comment':_0x7ded('0x20')},'autoframing':{'type':Sequelize[_0x7ded('0x7')](_0x7ded('0x18'),'no')},'insecure':{'type':Sequelize[_0x7ded('0x2')],'defaultValue':_0x7ded('0x21'),'set':function(_0x22dcd4){this[_0x7ded('0x1c')](_0x7ded('0x22'),_0x22dcd4?_0x22dcd4[_0x7ded('0x10')](','):null);},'get':function(){return this[_0x7ded('0x11')](_0x7ded('0x22'))?this['getDataValue'](_0x7ded('0x22'))[_0x7ded('0x13')](','):null;},'comment':_0x7ded('0x23')},'trustrpid':{'type':Sequelize[_0x7ded('0x7')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x7ded('0x7')](_0x7ded('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0x7ded('0x24'))},'promiscredir':{'type':Sequelize[_0x7ded('0x7')](_0x7ded('0x18'),'no')},'useclientcode':{'type':Sequelize['ENUM']('yes','no')},'accountcode':{'type':Sequelize[_0x7ded('0x25')](0xb)},'setvar':{'type':Sequelize[_0x7ded('0x2')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0x7ded('0x26')},'amaflags':{'type':Sequelize[_0x7ded('0x2')]},'callcounter':{'type':Sequelize['ENUM'](_0x7ded('0x18'),'no'),'defaultValue':_0x7ded('0x18')},'busylevel':{'type':Sequelize[_0x7ded('0x25')](0xb)},'allowoverlap':{'type':Sequelize[_0x7ded('0x7')](_0x7ded('0x18'),'no')},'allowsubscribe':{'type':Sequelize[_0x7ded('0x7')]('yes','no')},'allowtransfer':{'type':Sequelize[_0x7ded('0x7')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0x7ded('0x7')](_0x7ded('0x18'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x7ded('0x2')]},'videosupport':{'type':Sequelize[_0x7ded('0x7')](_0x7ded('0x18'),'no',_0x7ded('0x27')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x7ded('0x25')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x7ded('0x7')](_0x7ded('0x18'),'no')},'mailbox':{'type':Sequelize[_0x7ded('0x2')]},'session_timers':{'type':Sequelize[_0x7ded('0x7')](_0x7ded('0x28'),_0x7ded('0x29'),_0x7ded('0x2a'))},'session_expires':{'type':Sequelize[_0x7ded('0x25')](0xb)},'session_minse':{'type':Sequelize[_0x7ded('0x25')](0xb)},'session_refresher':{'type':Sequelize[_0x7ded('0x7')](_0x7ded('0x2b'),'uas'),'defaultValue':_0x7ded('0x2c')},'t38pt_usertpsource':{'type':Sequelize[_0x7ded('0x2')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0x7ded('0x2')]},'port':{'type':Sequelize[_0x7ded('0x25')](0x5)},'qualify':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x7ded('0x18')},'keepalive':{'type':Sequelize[_0x7ded('0x25')](0xb)},'defaultip':{'type':Sequelize[_0x7ded('0x2')]},'defaultuser':{'type':Sequelize[_0x7ded('0x2')]},'rtptimeout':{'type':Sequelize[_0x7ded('0x25')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x7ded('0x25')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x7ded('0x25')](0xb)},'sendrpid':{'type':Sequelize[_0x7ded('0x7')](_0x7ded('0x18'),'no',_0x7ded('0x2d')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x7ded('0x2')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x7ded('0x25')](0xb)},'timerb':{'type':Sequelize[_0x7ded('0x25')](0xb)},'qualifyfreq':{'type':Sequelize[_0x7ded('0x25')](0xb)},'contactpermit':{'type':Sequelize[_0x7ded('0x2')]},'contactdeny':{'type':Sequelize[_0x7ded('0x2')]},'contactacl':{'type':Sequelize[_0x7ded('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x7ded('0x2')]},'use_q850_reason':{'type':Sequelize[_0x7ded('0x2')]},'maxforwards':{'type':Sequelize[_0x7ded('0x25')](0xb)},'encryption':{'type':Sequelize[_0x7ded('0x7')](_0x7ded('0x18'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no')},'force_avp':{'type':Sequelize['ENUM'](_0x7ded('0x18'),'no')},'icesupport':{'type':Sequelize[_0x7ded('0x7')]('yes','no')},'dtlsenable':{'type':Sequelize[_0x7ded('0x7')](_0x7ded('0x18'),'no')},'dtlsverify':{'type':Sequelize[_0x7ded('0x7')]('yes','no',_0x7ded('0x2e'),'certificate')},'dtlsrekey':{'type':Sequelize[_0x7ded('0x25')](0xb)},'dtlscertfile':{'type':Sequelize[_0x7ded('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x7ded('0x2')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x7ded('0x2')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x7ded('0x7')](_0x7ded('0x2f'),_0x7ded('0x30'),_0x7ded('0x31')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0x7ded('0x7')](_0x7ded('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x7ded('0x2')]},'recordofffeature':{'type':Sequelize[_0x7ded('0x2')]},'call_limit':{'type':Sequelize[_0x7ded('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x7ded('0x7')](_0x7ded('0x18'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x7ded('0x18'),'no')},'vmexten':{'type':Sequelize[_0x7ded('0x2')]},'mohinterpret':{'type':Sequelize[_0x7ded('0x2')]},'mohsuggest':{'type':Sequelize[_0x7ded('0x2')]},'parkinglot':{'type':Sequelize[_0x7ded('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x7ded('0x2')],'defaultValue':_0x7ded('0x32')},'canreinvite':{'type':Sequelize[_0x7ded('0x7')](_0x7ded('0x18'),'no','nonat',_0x7ded('0x33'),_0x7ded('0x34')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x7ded('0x2')]},'active':{'type':Sequelize[_0x7ded('0x35')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x7ded('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0xdf84=['split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','auto','yes','nonat','update','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','pai','certificate','passive','actpass','dynamic','BOOLEAN','sequelize','exports','STRING','friend','peer','from-voip-provider','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue'];(function(_0x135398,_0x476489){var _0x33fc91=function(_0x27fcce){while(--_0x27fcce){_0x135398['push'](_0x135398['shift']());}};_0x33fc91(++_0x476489);}(_0xdf84,0x130));var _0x4df8=function(_0x16e57d,_0x2cb7ba){_0x16e57d=_0x16e57d-0x0;var _0x40239c=_0xdf84[_0x16e57d];return _0x40239c;};'use strict';var Sequelize=require(_0x4df8('0x0'));module[_0x4df8('0x1')]={'name':{'type':Sequelize[_0x4df8('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x4df8('0x3'),'user',_0x4df8('0x4')),'allowNull':![],'defaultValue':_0x4df8('0x3')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4df8('0x5')},'callingpres':{'type':Sequelize[_0x4df8('0x6')](_0x4df8('0x7'),_0x4df8('0x8'),_0x4df8('0x9'),_0x4df8('0xa'),_0x4df8('0xb'),_0x4df8('0xc'),_0x4df8('0xd'),_0x4df8('0xe'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x4df8('0x2')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x4df8('0x2')]},'remotesecret':{'type':Sequelize[_0x4df8('0x2')]},'transport':{'type':Sequelize[_0x4df8('0x2')],'defaultValue':_0x4df8('0xf'),'set':function(_0x4aafbd){this[_0x4df8('0x10')](_0x4df8('0x11'),_0x4aafbd?_0x4aafbd[_0x4df8('0x12')](','):null);},'get':function(){return this[_0x4df8('0x13')](_0x4df8('0x11'))?this[_0x4df8('0x13')](_0x4df8('0x11'))[_0x4df8('0x14')](','):null;},'comment':_0x4df8('0x15')},'dtmfmode':{'type':Sequelize[_0x4df8('0x6')](_0x4df8('0x16'),'info',_0x4df8('0x17'),_0x4df8('0x18'),_0x4df8('0x19')),'defaultValue':_0x4df8('0x16')},'directmedia':{'type':Sequelize['ENUM'](_0x4df8('0x1a'),'no',_0x4df8('0x1b'),_0x4df8('0x1c'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x4df8('0x6')](_0x4df8('0x1a'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0x4df8('0x2')]},'nat':{'type':Sequelize[_0x4df8('0x2')],'defaultValue':_0x4df8('0x1d'),'set':function(_0x43e4b4){this[_0x4df8('0x10')](_0x4df8('0x1e'),_0x43e4b4?_0x43e4b4[_0x4df8('0x12')](','):null);},'get':function(){return this['getDataValue'](_0x4df8('0x1e'))?this[_0x4df8('0x13')](_0x4df8('0x1e'))[_0x4df8('0x14')](','):null;},'comment':_0x4df8('0x1f')},'callgroup':{'type':Sequelize[_0x4df8('0x2')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x4df8('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x4df8('0x2')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x4df8('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x4df8('0x2')],'defaultValue':_0x4df8('0x20')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4df8('0x21'),'set':function(_0x520e5e){this['setDataValue'](_0x4df8('0x22'),_0x520e5e?_0x520e5e['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue'](_0x4df8('0x22'))?this[_0x4df8('0x13')](_0x4df8('0x22'))[_0x4df8('0x14')](';'):null;},'comment':_0x4df8('0x23')},'autoframing':{'type':Sequelize[_0x4df8('0x6')](_0x4df8('0x1a'),'no')},'insecure':{'type':Sequelize[_0x4df8('0x2')],'defaultValue':_0x4df8('0x24'),'set':function(_0x29aeb1){this['setDataValue'](_0x4df8('0x25'),_0x29aeb1?_0x29aeb1[_0x4df8('0x12')](','):null);},'get':function(){return this[_0x4df8('0x13')](_0x4df8('0x25'))?this[_0x4df8('0x13')](_0x4df8('0x25'))['split'](','):null;},'comment':_0x4df8('0x26')},'trustrpid':{'type':Sequelize[_0x4df8('0x6')](_0x4df8('0x1a'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x4df8('0x6')](_0x4df8('0x1a'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x4df8('0x6')](_0x4df8('0x1a'),'no',_0x4df8('0x27'))},'promiscredir':{'type':Sequelize['ENUM']('yes','no')},'useclientcode':{'type':Sequelize['ENUM'](_0x4df8('0x1a'),'no')},'accountcode':{'type':Sequelize[_0x4df8('0x28')](0xb)},'setvar':{'type':Sequelize[_0x4df8('0x2')]},'callerid':{'type':Sequelize[_0x4df8('0x2')],'defaultValue':_0x4df8('0x29')},'amaflags':{'type':Sequelize[_0x4df8('0x2')]},'callcounter':{'type':Sequelize[_0x4df8('0x6')](_0x4df8('0x1a'),'no'),'defaultValue':_0x4df8('0x1a')},'busylevel':{'type':Sequelize[_0x4df8('0x28')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0x4df8('0x1a'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x4df8('0x1a'),'no')},'allowtransfer':{'type':Sequelize[_0x4df8('0x6')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0x4df8('0x6')](_0x4df8('0x1a'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x4df8('0x2')]},'videosupport':{'type':Sequelize[_0x4df8('0x6')]('yes','no',_0x4df8('0x2a')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x4df8('0x28')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x4df8('0x6')]('yes','no')},'mailbox':{'type':Sequelize[_0x4df8('0x2')]},'session_timers':{'type':Sequelize[_0x4df8('0x6')](_0x4df8('0x2b'),_0x4df8('0x2c'),_0x4df8('0x2d'))},'session_expires':{'type':Sequelize[_0x4df8('0x28')](0xb)},'session_minse':{'type':Sequelize[_0x4df8('0x28')](0xb)},'session_refresher':{'type':Sequelize[_0x4df8('0x6')](_0x4df8('0x2e'),_0x4df8('0x2f')),'defaultValue':_0x4df8('0x2f')},'t38pt_usertpsource':{'type':Sequelize[_0x4df8('0x2')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x4df8('0x2')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x4df8('0x28')](0x5)},'qualify':{'type':Sequelize[_0x4df8('0x6')](_0x4df8('0x1a'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x4df8('0x28')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x4df8('0x2')]},'rtptimeout':{'type':Sequelize[_0x4df8('0x28')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x4df8('0x28')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x4df8('0x28')](0xb)},'sendrpid':{'type':Sequelize[_0x4df8('0x6')](_0x4df8('0x1a'),'no',_0x4df8('0x30')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x4df8('0x2')]},'callbackextension':{'type':Sequelize[_0x4df8('0x2')]},'timert1':{'type':Sequelize[_0x4df8('0x28')](0xb)},'timerb':{'type':Sequelize[_0x4df8('0x28')](0xb)},'qualifyfreq':{'type':Sequelize[_0x4df8('0x28')](0xb)},'contactpermit':{'type':Sequelize[_0x4df8('0x2')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x4df8('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x4df8('0x2')]},'use_q850_reason':{'type':Sequelize[_0x4df8('0x2')]},'maxforwards':{'type':Sequelize[_0x4df8('0x28')](0xb)},'encryption':{'type':Sequelize[_0x4df8('0x6')](_0x4df8('0x1a'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x4df8('0x6')](_0x4df8('0x1a'),'no')},'force_avp':{'type':Sequelize[_0x4df8('0x6')](_0x4df8('0x1a'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0x4df8('0x1a'),'no')},'dtlsenable':{'type':Sequelize[_0x4df8('0x6')](_0x4df8('0x1a'),'no')},'dtlsverify':{'type':Sequelize[_0x4df8('0x6')]('yes','no','fingerprint',_0x4df8('0x31'))},'dtlsrekey':{'type':Sequelize[_0x4df8('0x28')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x4df8('0x2')]},'dtlscipher':{'type':Sequelize[_0x4df8('0x2')]},'dtlscafile':{'type':Sequelize[_0x4df8('0x2')]},'dtlscapath':{'type':Sequelize[_0x4df8('0x2')]},'dtlssetup':{'type':Sequelize[_0x4df8('0x6')]('active',_0x4df8('0x32'),_0x4df8('0x33')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x4df8('0x2')]},'usereqphone':{'type':Sequelize[_0x4df8('0x6')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x4df8('0x2')]},'recordofffeature':{'type':Sequelize[_0x4df8('0x2')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x4df8('0x6')](_0x4df8('0x1a'),'no')},'subscribemwi':{'type':Sequelize[_0x4df8('0x6')](_0x4df8('0x1a'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x4df8('0x2')]},'mohsuggest':{'type':Sequelize[_0x4df8('0x2')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x4df8('0x2')],'defaultValue':_0x4df8('0x34')},'canreinvite':{'type':Sequelize[_0x4df8('0x6')](_0x4df8('0x1a'),'no','nonat',_0x4df8('0x1c'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x4df8('0x2')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x4df8('0x35')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x4df8('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 ed66773..6487b84 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 _0x9957=['clone','includeAll','merge','get','omit','createdAt','updatedAt','body','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findAll','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','update','destroy','Trunks','stack','name','send','map','Trunk','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','type','filter','options','include','rows','show','params','find'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];var jayson=require(_0x7995('0x1b'));var client=jayson[_0x7995('0x1c')][_0x7995('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x23999f,_0x2bbe7a,_0x4cc004,_0x58f5ad){return new BPromise(function(_0x2b4e94,_0x2233dd){var _0x24b5bb=_0x58f5ad||client;return _0x24b5bb[_0x7995('0x1e')](_0x23999f,_0x4cc004)[_0x7995('0x1f')](function(_0x1a5310){logger[_0x7995('0x20')](_0x7995('0x21'),_0x2bbe7a,'request\x20sent');logger[_0x7995('0x22')]('Trunk,\x20%s,\x20%s,\x20%s',_0x2bbe7a,_0x7995('0x23'),JSON[_0x7995('0x24')](_0x1a5310));if(_0x1a5310[_0x7995('0x25')]){if(_0x1a5310[_0x7995('0x25')][_0x7995('0x26')]===0x1f4){logger[_0x7995('0x25')]('Trunk,\x20%s,\x20%s',_0x2bbe7a,_0x1a5310['error'][_0x7995('0x27')]);return _0x2233dd(_0x1a5310['error']['message']);}logger[_0x7995('0x25')](_0x7995('0x21'),_0x2bbe7a,_0x1a5310['error'][_0x7995('0x27')]);return _0x2b4e94(_0x1a5310['error']['message']);}else{logger[_0x7995('0x20')](_0x7995('0x21'),_0x2bbe7a,_0x7995('0x23'));_0x2b4e94(_0x1a5310[_0x7995('0x28')][_0x7995('0x27')]);}})[_0x7995('0x29')](function(_0x5d40ae){logger[_0x7995('0x25')](_0x7995('0x21'),_0x2bbe7a,_0x5d40ae);_0x2233dd(_0x5d40ae);});});}function respondWithStatusCode(_0x204507,_0x285437){_0x285437=_0x285437||0xcc;return function(_0x563799){if(_0x563799){return _0x204507[_0x7995('0x2a')](_0x285437);}return _0x204507[_0x7995('0x2b')](_0x285437)[_0x7995('0x2c')]();};}function respondWithResult(_0x59405a,_0x39df42){_0x39df42=_0x39df42||0xc8;return function(_0x34e70c){if(_0x34e70c){return _0x59405a[_0x7995('0x2b')](_0x39df42)[_0x7995('0x2d')](_0x34e70c);}};}function respondWithFilteredResult(_0x3a3fcf,_0x2a307e){return function(_0x56691a){if(_0x56691a){var _0x47625f=typeof _0x2a307e['offset']===_0x7995('0x2e')&&typeof _0x2a307e[_0x7995('0x2f')]===_0x7995('0x2e');var _0x132a42=_0x56691a[_0x7995('0x30')];var _0x4b6f99=_0x47625f?0x0:_0x2a307e[_0x7995('0x31')];var _0x514445=_0x47625f?_0x56691a[_0x7995('0x30')]:_0x2a307e[_0x7995('0x31')]+_0x2a307e[_0x7995('0x2f')];var _0x574574;if(_0x514445>=_0x132a42){_0x514445=_0x132a42;_0x574574=0xc8;}else{_0x574574=0xce;}_0x3a3fcf['status'](_0x574574);return _0x3a3fcf['set'](_0x7995('0x32'),_0x4b6f99+'-'+_0x514445+'/'+_0x132a42)[_0x7995('0x2d')](_0x56691a);}return null;};}function patchUpdates(_0x327a81){return function(_0x2b874d){try{jsonpatch[_0x7995('0x33')](_0x2b874d,_0x327a81,!![]);}catch(_0x1ca460){return BPromise['reject'](_0x1ca460);}return _0x2b874d['save']();};}function saveUpdates(_0xfa8f15,_0x5524af){return function(_0x553671){if(_0x553671){return _0x553671[_0x7995('0x34')](_0xfa8f15)[_0x7995('0x1f')](function(_0x1e9fa4){return _0x1e9fa4;});}return null;};}function removeEntity(_0x1f7d27,_0x510841){return function(_0x44309d){if(_0x44309d){return _0x44309d[_0x7995('0x35')]()['then'](function(){var _0x48db25=_0x44309d['get']({'plain':!![]});var _0x45bc5e=_0x7995('0x36');return db['UserProfileResource'][_0x7995('0x35')]({'where':{'type':_0x45bc5e,'resourceId':_0x48db25['id']}})['then'](function(){return _0x44309d;});})[_0x7995('0x1f')](function(){_0x1f7d27[_0x7995('0x2b')](0xcc)[_0x7995('0x2c')]();});}};}function handleEntityNotFound(_0x5014d2,_0x52d76d){return function(_0x36d057){if(!_0x36d057){_0x5014d2['sendStatus'](0x194);}return _0x36d057;};}function handleError(_0x5d2428,_0x3e99cd){_0x3e99cd=_0x3e99cd||0x1f4;return function(_0xe328b1){logger['error'](_0xe328b1[_0x7995('0x37')]);if(_0xe328b1[_0x7995('0x38')]){delete _0xe328b1[_0x7995('0x38')];}_0x5d2428[_0x7995('0x2b')](_0x3e99cd)[_0x7995('0x39')](_0xe328b1);};}exports['index']=function(_0x2d4285,_0x242713){var _0xf612e6={},_0x1d60b8={},_0x4b1541={'count':0x0,'rows':[]};var _0x2be2c0=_[_0x7995('0x3a')](db[_0x7995('0x3b')][_0x7995('0x3c')],function(_0x1f5bee){return{'name':_0x1f5bee[_0x7995('0x3d')],'type':_0x1f5bee['type'][_0x7995('0x3e')]};});_0x1d60b8[_0x7995('0x3f')]=_[_0x7995('0x3a')](_0x2be2c0,_0x7995('0x38'));_0x1d60b8[_0x7995('0x40')]=_[_0x7995('0x41')](_0x2d4285[_0x7995('0x40')]);_0x1d60b8[_0x7995('0x42')]=_[_0x7995('0x43')](_0x1d60b8[_0x7995('0x3f')],_0x1d60b8[_0x7995('0x40')]);_0xf612e6[_0x7995('0x44')]=_[_0x7995('0x43')](_0x1d60b8['model'],qs['fields'](_0x2d4285[_0x7995('0x40')][_0x7995('0x45')]));_0xf612e6['attributes']=_0xf612e6['attributes'][_0x7995('0x46')]?_0xf612e6['attributes']:_0x1d60b8['model'];if(!_0x2d4285[_0x7995('0x40')][_0x7995('0x47')](_0x7995('0x48'))){_0xf612e6['limit']=qs[_0x7995('0x2f')](_0x2d4285['query'][_0x7995('0x2f')]);_0xf612e6['offset']=qs['offset'](_0x2d4285[_0x7995('0x40')][_0x7995('0x31')]);}_0xf612e6[_0x7995('0x49')]=qs[_0x7995('0x4a')](_0x2d4285['query'][_0x7995('0x4a')]);_0xf612e6[_0x7995('0x4b')]=qs[_0x7995('0x42')](_[_0x7995('0x4c')](_0x2d4285['query'],_0x1d60b8['filters']),_0x2be2c0);if(_0x2d4285[_0x7995('0x40')]['filter']){_0xf612e6[_0x7995('0x4b')]=_['merge'](_0xf612e6[_0x7995('0x4b')],{'$or':_['map'](_0x2be2c0,function(_0x1e795e){if(_0x1e795e[_0x7995('0x4d')]!=='VIRTUAL'){var _0x3e9e62={};_0x3e9e62[_0x1e795e[_0x7995('0x38')]]={'$like':'%'+_0x2d4285[_0x7995('0x40')][_0x7995('0x4e')]+'%'};return _0x3e9e62;}})});}_0xf612e6=_['merge']({},_0xf612e6,_0x2d4285[_0x7995('0x4f')]);var _0x3e787d={'where':_0xf612e6[_0x7995('0x4b')]};return db['Trunk'][_0x7995('0x30')](_0x3e787d)[_0x7995('0x1f')](function(_0x511567){_0x4b1541[_0x7995('0x30')]=_0x511567;if(_0x2d4285[_0x7995('0x40')]['includeAll']){_0xf612e6[_0x7995('0x50')]=[{'all':!![]}];}return db[_0x7995('0x3b')]['findAll'](_0xf612e6);})[_0x7995('0x1f')](function(_0x5843ba){_0x4b1541[_0x7995('0x51')]=_0x5843ba;return _0x4b1541;})[_0x7995('0x1f')](respondWithFilteredResult(_0x242713,_0xf612e6))[_0x7995('0x29')](handleError(_0x242713,null));};exports[_0x7995('0x52')]=function(_0xddf537,_0x14b537){var _0x1579b9={'raw':![],'where':{'id':_0xddf537[_0x7995('0x53')]['id']}},_0x4d46bc={};_0x4d46bc[_0x7995('0x3f')]=_[_0x7995('0x41')](db['Trunk'][_0x7995('0x3c')]);_0x4d46bc[_0x7995('0x40')]=_[_0x7995('0x41')](_0xddf537['query']);_0x4d46bc['filters']=_['intersection'](_0x4d46bc[_0x7995('0x3f')],_0x4d46bc[_0x7995('0x40')]);_0x1579b9['attributes']=_[_0x7995('0x43')](_0x4d46bc[_0x7995('0x3f')],qs[_0x7995('0x45')](_0xddf537[_0x7995('0x40')][_0x7995('0x45')]));_0x1579b9['attributes']=_0x1579b9[_0x7995('0x44')]['length']?_0x1579b9[_0x7995('0x44')]:_0x4d46bc[_0x7995('0x3f')];if(_0xddf537[_0x7995('0x40')]['includeAll']){_0x1579b9['include']=[{'all':!![]}];}_0x1579b9=_['merge']({},_0x1579b9,_0xddf537['options']);return db[_0x7995('0x3b')][_0x7995('0x54')](_0x1579b9)[_0x7995('0x1f')](handleEntityNotFound(_0x14b537,null))[_0x7995('0x1f')](respondWithResult(_0x14b537,null))[_0x7995('0x29')](handleError(_0x14b537,null));};exports[_0x7995('0x55')]=function(_0x1f4270,_0xda6ce8){var _0x328671={'where':{'id':_0x1f4270[_0x7995('0x53')]['id']}},_0x17ecd3={};_0x17ecd3[_0x7995('0x3f')]=_[_0x7995('0x41')](db[_0x7995('0x3b')][_0x7995('0x3c')]);_0x328671[_0x7995('0x44')]=_[_0x7995('0x43')](_0x17ecd3[_0x7995('0x3f')],qs[_0x7995('0x45')](_0x1f4270['query'][_0x7995('0x45')]));_0x328671[_0x7995('0x44')]=_0x328671[_0x7995('0x44')][_0x7995('0x46')]?_0x328671['attributes']:_0x17ecd3['model'];if(_0x1f4270[_0x7995('0x40')][_0x7995('0x56')]){_0x328671[_0x7995('0x50')]=[{'all':!![]}];}_0x328671=_[_0x7995('0x57')]({},_0x328671,_0x1f4270['options']);return db[_0x7995('0x3b')][_0x7995('0x54')](_0x328671)[_0x7995('0x1f')](handleEntityNotFound(_0xda6ce8,null))[_0x7995('0x1f')](function(_0x502d43){if(_0x502d43){var _0x5e2d97=_0x502d43[_0x7995('0x58')]({'plain':!![]});_0x5e2d97=qs[_0x7995('0x59')](_0x5e2d97,['id',_0x7995('0x5a'),_0x7995('0x5b')]);_0x1f4270[_0x7995('0x5c')]=_[_0x7995('0x59')](_0x1f4270[_0x7995('0x5c')],['id',_0x7995('0x5a'),_0x7995('0x5b')]);return db['Trunk'][_0x7995('0x5d')](_[_0x7995('0x57')](_0x5e2d97,_0x1f4270[_0x7995('0x5c')]),{'include':_0x1f4270[_0x7995('0x40')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x3053fd){var _0xebb5c8=_0x1f4270['user'][_0x7995('0x58')]({'plain':!![]});if(!_0xebb5c8)throw new Error(_0x7995('0x5e'));if(_0xebb5c8[_0x7995('0x5f')]===_0x7995('0x60')){var _0x32cb04=_0x3053fd['get']({'plain':!![]});var _0x457d09='Trunks';return db[_0x7995('0x61')][_0x7995('0x54')]({'where':{'name':_0x457d09,'userProfileId':_0xebb5c8[_0x7995('0x62')]},'raw':!![]})[_0x7995('0x1f')](function(_0x4388c1){if(_0x4388c1&&_0x4388c1[_0x7995('0x63')]===0x0){return db[_0x7995('0x64')][_0x7995('0x5d')]({'name':_0x32cb04[_0x7995('0x38')],'resourceId':_0x32cb04['id'],'type':_0x4388c1[_0x7995('0x38')],'sectionId':_0x4388c1['id']},{})[_0x7995('0x1f')](function(){return _0x3053fd;});}else{return _0x3053fd;}})[_0x7995('0x29')](function(_0x56eb85){logger[_0x7995('0x25')](_0x7995('0x65'),_0x56eb85);throw _0x56eb85;});}return _0x3053fd;});}})[_0x7995('0x1f')](respondWithResult(_0xda6ce8,0xc9))[_0x7995('0x29')](handleError(_0xda6ce8,null));};exports[_0x7995('0x5d')]=function(_0x54a2e0,_0x4b54f2,_0x268fde){var _0x87e38d;return db[_0x7995('0x3b')][_0x7995('0x5d')](_0x54a2e0['body'],{'raw':!![]})[_0x7995('0x1f')](function(_0x50a12e){_0x87e38d=_0x50a12e;return db['Trunk'][_0x7995('0x66')]({'raw':!![]});})[_0x7995('0x1f')](function(_0x3f0a71){var _0x44bf2b=fs[_0x7995('0x67')](path[_0x7995('0x68')](config[_0x7995('0x69')],_0x7995('0x6a')),_0x7995('0x6b'));var _0x2466df=fs['readFileSync'](path[_0x7995('0x68')](config[_0x7995('0x69')],_0x7995('0x6c')),'utf8');var _0x1fe1cb=ejs[_0x7995('0x6d')](_0x44bf2b,{'trunks':_0x3f0a71||[]});fs[_0x7995('0x6e')](_0x7995('0x6f'),_0x1fe1cb);if(_0x87e38d[_0x7995('0x70')]){var _0x51ab1e=ejs[_0x7995('0x6d')](_0x2466df,{'trunks':_0x3f0a71||[]});fs[_0x7995('0x6e')](_0x7995('0x71'),_0x51ab1e);}})[_0x7995('0x1f')](function(){return respondWithRpcPromise(_0x7995('0x72'),'create',{'module':'chan_sip.so'});})[_0x7995('0x1f')](function(){var _0xfe1105=_0x54a2e0[_0x7995('0x60')][_0x7995('0x58')]({'plain':!![]});if(!_0xfe1105)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xfe1105[_0x7995('0x5f')]===_0x7995('0x60')){var _0x54b955=_0x87e38d['get']({'plain':!![]});return db[_0x7995('0x61')][_0x7995('0x54')]({'where':{'name':'Trunks','userProfileId':_0xfe1105[_0x7995('0x62')]},'raw':!![]})['then'](function(_0x3758f9){if(_0x3758f9&&_0x3758f9[_0x7995('0x63')]===0x0){return db['UserProfileResource']['create']({'name':_0x54b955[_0x7995('0x38')],'resourceId':_0x54b955['id'],'type':_0x3758f9['name'],'sectionId':_0x3758f9['id']},{})[_0x7995('0x1f')](function(){return _0x87e38d;});}else{return _0x87e38d;}})[_0x7995('0x29')](function(_0x3dd197){logger[_0x7995('0x25')](_0x7995('0x65'),_0x3dd197);throw _0x3dd197;});}return _0x87e38d;})[_0x7995('0x1f')](respondWithResult(_0x4b54f2,0xc9))[_0x7995('0x29')](handleError(_0x4b54f2,null));};exports[_0x7995('0x34')]=function(_0x29e0ee,_0x117317,_0x1ab590){var _0x16108c;return db[_0x7995('0x3b')][_0x7995('0x54')]({'where':{'id':_0x29e0ee[_0x7995('0x53')]['id']}})[_0x7995('0x1f')](handleEntityNotFound(_0x117317,null))[_0x7995('0x1f')](saveUpdates(_0x29e0ee[_0x7995('0x5c')],null))[_0x7995('0x1f')](function(_0xa2fc8e){if(_0xa2fc8e){_0x16108c=_0xa2fc8e;return db[_0x7995('0x3b')][_0x7995('0x66')]({'raw':!![]});}})[_0x7995('0x1f')](function(_0x280fbb){if(_0x280fbb){var _0x260ef1=fs[_0x7995('0x67')](path[_0x7995('0x68')](config[_0x7995('0x69')],'server/files/templates/trunk.ejs'),_0x7995('0x6b'));var _0x10f4ca=fs['readFileSync'](path['join'](config[_0x7995('0x69')],_0x7995('0x6c')),_0x7995('0x6b'));var _0x38acda=ejs[_0x7995('0x6d')](_0x260ef1,{'trunks':_0x280fbb||[]});fs[_0x7995('0x6e')]('/etc/asterisk/sip_xcally_trunks.conf',_0x38acda);var _0x2f8a2d=ejs[_0x7995('0x6d')](_0x10f4ca,{'trunks':_0x280fbb||[]});fs[_0x7995('0x6e')](_0x7995('0x71'),_0x2f8a2d);return respondWithRpcPromise(_0x7995('0x72'),_0x7995('0x34'),{'module':_0x7995('0x73')});}return null;})[_0x7995('0x1f')](function(_0x560095){if(_0x560095){return _0x16108c;}})[_0x7995('0x1f')](respondWithResult(_0x117317,null))[_0x7995('0x29')](handleError(_0x117317,null));};exports['destroy']=function(_0x479271,_0xd24c64,_0xf8c2ed){var _0x18e1a2;return db[_0x7995('0x3b')][_0x7995('0x54')]({'where':{'id':_0x479271['params']['id']}})[_0x7995('0x1f')](handleEntityNotFound(_0xd24c64,null))[_0x7995('0x1f')](removeEntity(_0xd24c64,null))['then'](function(){return db[_0x7995('0x3b')][_0x7995('0x66')]({'raw':!![]});})['then'](function(_0x1535a3){var _0x4a5bc5=fs[_0x7995('0x67')](path[_0x7995('0x68')](config[_0x7995('0x69')],_0x7995('0x6a')),_0x7995('0x6b'));var _0x5d16da=fs[_0x7995('0x67')](path[_0x7995('0x68')](config[_0x7995('0x69')],'server/files/templates/registry.ejs'),_0x7995('0x6b'));var _0x3f3434=ejs[_0x7995('0x6d')](_0x4a5bc5,{'trunks':_0x1535a3});var _0x308a26=ejs['render'](_0x5d16da,{'trunks':_0x1535a3});fs[_0x7995('0x6e')](_0x7995('0x6f'),_0x3f3434);fs[_0x7995('0x6e')]('/etc/asterisk/sip_xcally_registers.conf',_0x308a26);return respondWithRpcPromise('Reload',_0x7995('0x35'),{'module':_0x7995('0x73')});})['catch'](handleError(_0xd24c64,null));}; \ No newline at end of file +var _0xb821=['model','map','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','Trunk','includeAll','findAll','intersection','length','include','find','params','get','omit','createdAt','updatedAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','server/files/templates/trunk.ejs','utf8','join','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','UserProfileSection','root','rimraf','zip-dir','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','code','Trunk,\x20%s,\x20%s','error','message','info','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','Trunks','name','send','index','rawAttributes','fieldName','key'];(function(_0x27e7bf,_0x289a1d){var _0x1ebde9=function(_0x226c52){while(--_0x226c52){_0x27e7bf['push'](_0x27e7bf['shift']());}};_0x1ebde9(++_0x289a1d);}(_0xb821,0xa7));var _0x1b82=function(_0x287b04,_0x541c3b){_0x287b04=_0x287b04-0x0;var _0x35b104=_0xb821[_0x287b04];return _0x35b104;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1b82('0x0'));var zipdir=require(_0x1b82('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1b82('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1b82('0x3'));var path=require(_0x1b82('0x4'));var sox=require(_0x1b82('0x5'));var csv=require(_0x1b82('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1b82('0x7'));var _=require(_0x1b82('0x8'));var squel=require(_0x1b82('0x9'));var crypto=require(_0x1b82('0xa'));var jsforce=require(_0x1b82('0xb'));var deskjs=require(_0x1b82('0xc'));var toCsv=require(_0x1b82('0x6'));var querystring=require(_0x1b82('0xd'));var Papa=require(_0x1b82('0xe'));var Redis=require('ioredis');var authService=require(_0x1b82('0xf'));var qs=require(_0x1b82('0x10'));var as=require(_0x1b82('0x11'));var hardwareService=require(_0x1b82('0x12'));var logger=require(_0x1b82('0x13'))(_0x1b82('0x14'));var utils=require(_0x1b82('0x15'));var config=require(_0x1b82('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x1b82('0x17'))['db'];var jayson=require(_0x1b82('0x18'));var client=jayson[_0x1b82('0x19')][_0x1b82('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x50aed7,_0x1a6285,_0x5767aa,_0x54915f){return new BPromise(function(_0x1e553a,_0x4bf75b){var _0x1cffd1=_0x54915f||client;return _0x1cffd1[_0x1b82('0x1b')](_0x50aed7,_0x5767aa)['then'](function(_0x46c2cf){logger['info']('Trunk,\x20%s,\x20%s',_0x1a6285,_0x1b82('0x1c'));logger['debug'](_0x1b82('0x1d'),_0x1a6285,_0x1b82('0x1c'),JSON[_0x1b82('0x1e')](_0x46c2cf));if(_0x46c2cf['error']){if(_0x46c2cf['error'][_0x1b82('0x1f')]===0x1f4){logger['error'](_0x1b82('0x20'),_0x1a6285,_0x46c2cf[_0x1b82('0x21')][_0x1b82('0x22')]);return _0x4bf75b(_0x46c2cf['error'][_0x1b82('0x22')]);}logger[_0x1b82('0x21')](_0x1b82('0x20'),_0x1a6285,_0x46c2cf[_0x1b82('0x21')][_0x1b82('0x22')]);return _0x1e553a(_0x46c2cf['error'][_0x1b82('0x22')]);}else{logger[_0x1b82('0x23')](_0x1b82('0x20'),_0x1a6285,_0x1b82('0x1c'));_0x1e553a(_0x46c2cf[_0x1b82('0x24')][_0x1b82('0x22')]);}})[_0x1b82('0x25')](function(_0x486e92){logger[_0x1b82('0x21')](_0x1b82('0x20'),_0x1a6285,_0x486e92);_0x4bf75b(_0x486e92);});});}function respondWithStatusCode(_0x5b8d09,_0x561d78){_0x561d78=_0x561d78||0xcc;return function(_0x225b81){if(_0x225b81){return _0x5b8d09[_0x1b82('0x26')](_0x561d78);}return _0x5b8d09['status'](_0x561d78)[_0x1b82('0x27')]();};}function respondWithResult(_0x4db690,_0x5cd458){_0x5cd458=_0x5cd458||0xc8;return function(_0x5f556b){if(_0x5f556b){return _0x4db690[_0x1b82('0x28')](_0x5cd458)[_0x1b82('0x29')](_0x5f556b);}};}function respondWithFilteredResult(_0xfd00d1,_0x257b79){return function(_0x548a3b){if(_0x548a3b){var _0x222483=typeof _0x257b79[_0x1b82('0x2a')]===_0x1b82('0x2b')&&typeof _0x257b79[_0x1b82('0x2c')]===_0x1b82('0x2b');var _0x1b8b6f=_0x548a3b[_0x1b82('0x2d')];var _0x21ea34=_0x222483?0x0:_0x257b79[_0x1b82('0x2a')];var _0x1f9c6b=_0x222483?_0x548a3b[_0x1b82('0x2d')]:_0x257b79[_0x1b82('0x2a')]+_0x257b79[_0x1b82('0x2c')];var _0x5ea890;if(_0x1f9c6b>=_0x1b8b6f){_0x1f9c6b=_0x1b8b6f;_0x5ea890=0xc8;}else{_0x5ea890=0xce;}_0xfd00d1[_0x1b82('0x28')](_0x5ea890);return _0xfd00d1[_0x1b82('0x2e')](_0x1b82('0x2f'),_0x21ea34+'-'+_0x1f9c6b+'/'+_0x1b8b6f)[_0x1b82('0x29')](_0x548a3b);}return null;};}function patchUpdates(_0x18e4ff){return function(_0x115ce7){try{jsonpatch[_0x1b82('0x30')](_0x115ce7,_0x18e4ff,!![]);}catch(_0x46575f){return BPromise[_0x1b82('0x31')](_0x46575f);}return _0x115ce7[_0x1b82('0x32')]();};}function saveUpdates(_0x501ab0,_0x225c06){return function(_0x29a31e){if(_0x29a31e){return _0x29a31e[_0x1b82('0x33')](_0x501ab0)[_0x1b82('0x34')](function(_0x5b7b18){return _0x5b7b18;});}return null;};}function removeEntity(_0x474218,_0xbf65a){return function(_0x544bd5){if(_0x544bd5){return _0x544bd5[_0x1b82('0x35')]()[_0x1b82('0x34')](function(){var _0x365c3c=_0x544bd5['get']({'plain':!![]});var _0x5efb8e=_0x1b82('0x36');return db['UserProfileResource']['destroy']({'where':{'type':_0x5efb8e,'resourceId':_0x365c3c['id']}})[_0x1b82('0x34')](function(){return _0x544bd5;});})[_0x1b82('0x34')](function(){_0x474218[_0x1b82('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42a64e,_0x366db3){return function(_0xea774a){if(!_0xea774a){_0x42a64e[_0x1b82('0x26')](0x194);}return _0xea774a;};}function handleError(_0x4dd64a,_0x42c1c4){_0x42c1c4=_0x42c1c4||0x1f4;return function(_0x1cd7de){logger[_0x1b82('0x21')](_0x1cd7de['stack']);if(_0x1cd7de['name']){delete _0x1cd7de[_0x1b82('0x37')];}_0x4dd64a['status'](_0x42c1c4)[_0x1b82('0x38')](_0x1cd7de);};}exports[_0x1b82('0x39')]=function(_0x286b4b,_0x348880){var _0x1255db={},_0x3ab35c={},_0x39fe4a={'count':0x0,'rows':[]};var _0x1368df=_['map'](db['Trunk'][_0x1b82('0x3a')],function(_0x5f4baf){return{'name':_0x5f4baf[_0x1b82('0x3b')],'type':_0x5f4baf['type'][_0x1b82('0x3c')]};});_0x3ab35c[_0x1b82('0x3d')]=_[_0x1b82('0x3e')](_0x1368df,_0x1b82('0x37'));_0x3ab35c[_0x1b82('0x3f')]=_[_0x1b82('0x40')](_0x286b4b['query']);_0x3ab35c[_0x1b82('0x41')]=_['intersection'](_0x3ab35c[_0x1b82('0x3d')],_0x3ab35c['query']);_0x1255db[_0x1b82('0x42')]=_['intersection'](_0x3ab35c['model'],qs[_0x1b82('0x43')](_0x286b4b[_0x1b82('0x3f')][_0x1b82('0x43')]));_0x1255db[_0x1b82('0x42')]=_0x1255db[_0x1b82('0x42')]['length']?_0x1255db[_0x1b82('0x42')]:_0x3ab35c['model'];if(!_0x286b4b[_0x1b82('0x3f')][_0x1b82('0x44')](_0x1b82('0x45'))){_0x1255db[_0x1b82('0x2c')]=qs[_0x1b82('0x2c')](_0x286b4b['query'][_0x1b82('0x2c')]);_0x1255db['offset']=qs[_0x1b82('0x2a')](_0x286b4b[_0x1b82('0x3f')]['offset']);}_0x1255db[_0x1b82('0x46')]=qs[_0x1b82('0x47')](_0x286b4b[_0x1b82('0x3f')][_0x1b82('0x47')]);_0x1255db[_0x1b82('0x48')]=qs[_0x1b82('0x41')](_[_0x1b82('0x49')](_0x286b4b['query'],_0x3ab35c[_0x1b82('0x41')]),_0x1368df);if(_0x286b4b['query'][_0x1b82('0x4a')]){_0x1255db[_0x1b82('0x48')]=_[_0x1b82('0x4b')](_0x1255db[_0x1b82('0x48')],{'$or':_[_0x1b82('0x3e')](_0x1368df,function(_0x1d24d6){if(_0x1d24d6[_0x1b82('0x4c')]!==_0x1b82('0x4d')){var _0x192ce3={};_0x192ce3[_0x1d24d6[_0x1b82('0x37')]]={'$like':'%'+_0x286b4b[_0x1b82('0x3f')][_0x1b82('0x4a')]+'%'};return _0x192ce3;}})});}_0x1255db=_[_0x1b82('0x4b')]({},_0x1255db,_0x286b4b[_0x1b82('0x4e')]);var _0x4fb92f={'where':_0x1255db['where']};return db[_0x1b82('0x4f')]['count'](_0x4fb92f)[_0x1b82('0x34')](function(_0x3df0af){_0x39fe4a[_0x1b82('0x2d')]=_0x3df0af;if(_0x286b4b['query'][_0x1b82('0x50')]){_0x1255db['include']=[{'all':!![]}];}return db['Trunk'][_0x1b82('0x51')](_0x1255db);})[_0x1b82('0x34')](function(_0x242324){_0x39fe4a['rows']=_0x242324;return _0x39fe4a;})[_0x1b82('0x34')](respondWithFilteredResult(_0x348880,_0x1255db))[_0x1b82('0x25')](handleError(_0x348880,null));};exports['show']=function(_0x5ca898,_0x106282){var _0x2e676a={'raw':![],'where':{'id':_0x5ca898['params']['id']}},_0x2dc53e={};_0x2dc53e[_0x1b82('0x3d')]=_[_0x1b82('0x40')](db[_0x1b82('0x4f')][_0x1b82('0x3a')]);_0x2dc53e[_0x1b82('0x3f')]=_[_0x1b82('0x40')](_0x5ca898['query']);_0x2dc53e[_0x1b82('0x41')]=_['intersection'](_0x2dc53e[_0x1b82('0x3d')],_0x2dc53e[_0x1b82('0x3f')]);_0x2e676a['attributes']=_[_0x1b82('0x52')](_0x2dc53e['model'],qs[_0x1b82('0x43')](_0x5ca898[_0x1b82('0x3f')][_0x1b82('0x43')]));_0x2e676a[_0x1b82('0x42')]=_0x2e676a[_0x1b82('0x42')][_0x1b82('0x53')]?_0x2e676a['attributes']:_0x2dc53e['model'];if(_0x5ca898[_0x1b82('0x3f')][_0x1b82('0x50')]){_0x2e676a[_0x1b82('0x54')]=[{'all':!![]}];}_0x2e676a=_[_0x1b82('0x4b')]({},_0x2e676a,_0x5ca898[_0x1b82('0x4e')]);return db[_0x1b82('0x4f')][_0x1b82('0x55')](_0x2e676a)[_0x1b82('0x34')](handleEntityNotFound(_0x106282,null))['then'](respondWithResult(_0x106282,null))['catch'](handleError(_0x106282,null));};exports['clone']=function(_0x2658b5,_0x2a95d2){var _0x207f1c={'where':{'id':_0x2658b5[_0x1b82('0x56')]['id']}},_0x27ad80={};_0x27ad80[_0x1b82('0x3d')]=_[_0x1b82('0x40')](db['Trunk'][_0x1b82('0x3a')]);_0x207f1c[_0x1b82('0x42')]=_[_0x1b82('0x52')](_0x27ad80[_0x1b82('0x3d')],qs[_0x1b82('0x43')](_0x2658b5[_0x1b82('0x3f')][_0x1b82('0x43')]));_0x207f1c[_0x1b82('0x42')]=_0x207f1c['attributes'][_0x1b82('0x53')]?_0x207f1c[_0x1b82('0x42')]:_0x27ad80[_0x1b82('0x3d')];if(_0x2658b5[_0x1b82('0x3f')][_0x1b82('0x50')]){_0x207f1c['include']=[{'all':!![]}];}_0x207f1c=_['merge']({},_0x207f1c,_0x2658b5[_0x1b82('0x4e')]);return db[_0x1b82('0x4f')][_0x1b82('0x55')](_0x207f1c)[_0x1b82('0x34')](handleEntityNotFound(_0x2a95d2,null))['then'](function(_0x170905){if(_0x170905){var _0x352603=_0x170905[_0x1b82('0x57')]({'plain':!![]});_0x352603=qs[_0x1b82('0x58')](_0x352603,['id',_0x1b82('0x59'),_0x1b82('0x5a')]);_0x2658b5[_0x1b82('0x5b')]=_[_0x1b82('0x58')](_0x2658b5[_0x1b82('0x5b')],['id',_0x1b82('0x59'),'updatedAt']);return db[_0x1b82('0x4f')][_0x1b82('0x5c')](_['merge'](_0x352603,_0x2658b5[_0x1b82('0x5b')]),{'include':_0x2658b5[_0x1b82('0x3f')][_0x1b82('0x50')]?[{'all':!![]}]:undefined})[_0x1b82('0x34')](function(_0x4b26c4){var _0x30f13a=_0x2658b5[_0x1b82('0x5d')][_0x1b82('0x57')]({'plain':!![]});if(!_0x30f13a)throw new Error(_0x1b82('0x5e'));if(_0x30f13a[_0x1b82('0x5f')]===_0x1b82('0x5d')){var _0x4e8fa2=_0x4b26c4[_0x1b82('0x57')]({'plain':!![]});var _0x5267c3=_0x1b82('0x36');return db['UserProfileSection'][_0x1b82('0x55')]({'where':{'name':_0x5267c3,'userProfileId':_0x30f13a[_0x1b82('0x60')]},'raw':!![]})[_0x1b82('0x34')](function(_0x2db0fe){if(_0x2db0fe&&_0x2db0fe[_0x1b82('0x61')]===0x0){return db[_0x1b82('0x62')][_0x1b82('0x5c')]({'name':_0x4e8fa2['name'],'resourceId':_0x4e8fa2['id'],'type':_0x2db0fe[_0x1b82('0x37')],'sectionId':_0x2db0fe['id']},{})[_0x1b82('0x34')](function(){return _0x4b26c4;});}else{return _0x4b26c4;}})[_0x1b82('0x25')](function(_0x2de10c){logger[_0x1b82('0x21')](_0x1b82('0x63'),_0x2de10c);throw _0x2de10c;});}return _0x4b26c4;});}})[_0x1b82('0x34')](respondWithResult(_0x2a95d2,0xc9))[_0x1b82('0x25')](handleError(_0x2a95d2,null));};exports[_0x1b82('0x5c')]=function(_0x3f7690,_0x1873de,_0xe31cbc){var _0x1ef92c;return db['Trunk'][_0x1b82('0x5c')](_0x3f7690[_0x1b82('0x5b')],{'raw':!![]})[_0x1b82('0x34')](function(_0x4a229e){_0x1ef92c=_0x4a229e;return db[_0x1b82('0x4f')][_0x1b82('0x51')]({'raw':!![]});})['then'](function(_0x3bf106){var _0x5cc386=fs[_0x1b82('0x64')](path['join'](config['root'],_0x1b82('0x65')),_0x1b82('0x66'));var _0x3b4088=fs[_0x1b82('0x64')](path[_0x1b82('0x67')](config['root'],_0x1b82('0x68')),'utf8');var _0x143689=ejs[_0x1b82('0x69')](_0x5cc386,{'trunks':_0x3bf106||[]});fs[_0x1b82('0x6a')](_0x1b82('0x6b'),_0x143689);if(_0x1ef92c[_0x1b82('0x6c')]){var _0x29c42e=ejs[_0x1b82('0x69')](_0x3b4088,{'trunks':_0x3bf106||[]});fs[_0x1b82('0x6a')](_0x1b82('0x6d'),_0x29c42e);}})[_0x1b82('0x34')](function(){return respondWithRpcPromise(_0x1b82('0x6e'),'create',{'module':_0x1b82('0x6f')});})['then'](function(){var _0x4c2e52=_0x3f7690[_0x1b82('0x5d')][_0x1b82('0x57')]({'plain':!![]});if(!_0x4c2e52)throw new Error(_0x1b82('0x5e'));if(_0x4c2e52[_0x1b82('0x5f')]===_0x1b82('0x5d')){var _0x1dd3a1=_0x1ef92c[_0x1b82('0x57')]({'plain':!![]});return db[_0x1b82('0x70')][_0x1b82('0x55')]({'where':{'name':_0x1b82('0x36'),'userProfileId':_0x4c2e52['userProfileId']},'raw':!![]})[_0x1b82('0x34')](function(_0x4d496b){if(_0x4d496b&&_0x4d496b[_0x1b82('0x61')]===0x0){return db['UserProfileResource'][_0x1b82('0x5c')]({'name':_0x1dd3a1[_0x1b82('0x37')],'resourceId':_0x1dd3a1['id'],'type':_0x4d496b[_0x1b82('0x37')],'sectionId':_0x4d496b['id']},{})[_0x1b82('0x34')](function(){return _0x1ef92c;});}else{return _0x1ef92c;}})[_0x1b82('0x25')](function(_0x49a202){logger[_0x1b82('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x49a202);throw _0x49a202;});}return _0x1ef92c;})['then'](respondWithResult(_0x1873de,0xc9))[_0x1b82('0x25')](handleError(_0x1873de,null));};exports[_0x1b82('0x33')]=function(_0x1a4826,_0x4d986c,_0x2e9191){var _0x52f16e;return db[_0x1b82('0x4f')]['find']({'where':{'id':_0x1a4826[_0x1b82('0x56')]['id']}})[_0x1b82('0x34')](handleEntityNotFound(_0x4d986c,null))[_0x1b82('0x34')](saveUpdates(_0x1a4826[_0x1b82('0x5b')],null))['then'](function(_0x46cae4){if(_0x46cae4){_0x52f16e=_0x46cae4;return db['Trunk'][_0x1b82('0x51')]({'raw':!![]});}})[_0x1b82('0x34')](function(_0x1095fb){if(_0x1095fb){var _0x185fce=fs[_0x1b82('0x64')](path['join'](config[_0x1b82('0x71')],'server/files/templates/trunk.ejs'),_0x1b82('0x66'));var _0x5ce247=fs[_0x1b82('0x64')](path[_0x1b82('0x67')](config[_0x1b82('0x71')],'server/files/templates/registry.ejs'),_0x1b82('0x66'));var _0x31a56e=ejs[_0x1b82('0x69')](_0x185fce,{'trunks':_0x1095fb||[]});fs['writeFileSync'](_0x1b82('0x6b'),_0x31a56e);var _0x396272=ejs[_0x1b82('0x69')](_0x5ce247,{'trunks':_0x1095fb||[]});fs[_0x1b82('0x6a')](_0x1b82('0x6d'),_0x396272);return respondWithRpcPromise('Reload',_0x1b82('0x33'),{'module':'chan_sip.so'});}return null;})['then'](function(_0x2759ac){if(_0x2759ac){return _0x52f16e;}})['then'](respondWithResult(_0x4d986c,null))[_0x1b82('0x25')](handleError(_0x4d986c,null));};exports[_0x1b82('0x35')]=function(_0x5f349f,_0x3e17b0,_0x391207){var _0x553ac5;return db['Trunk']['find']({'where':{'id':_0x5f349f['params']['id']}})[_0x1b82('0x34')](handleEntityNotFound(_0x3e17b0,null))[_0x1b82('0x34')](removeEntity(_0x3e17b0,null))[_0x1b82('0x34')](function(){return db['Trunk'][_0x1b82('0x51')]({'raw':!![]});})['then'](function(_0x7d95b6){var _0x372c3b=fs[_0x1b82('0x64')](path[_0x1b82('0x67')](config['root'],_0x1b82('0x65')),_0x1b82('0x66'));var _0x14510c=fs[_0x1b82('0x64')](path[_0x1b82('0x67')](config[_0x1b82('0x71')],_0x1b82('0x68')),'utf8');var _0x58e180=ejs[_0x1b82('0x69')](_0x372c3b,{'trunks':_0x7d95b6});var _0x531d3f=ejs['render'](_0x14510c,{'trunks':_0x7d95b6});fs[_0x1b82('0x6a')](_0x1b82('0x6b'),_0x58e180);fs[_0x1b82('0x6a')]('/etc/asterisk/sip_xcally_registers.conf',_0x531d3f);return respondWithRpcPromise(_0x1b82('0x6e'),'destroy',{'module':_0x1b82('0x6f')});})[_0x1b82('0x25')](handleError(_0x3e17b0,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 784fa6b..e1e8f2e 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 _0xb7e9=['bluebird','request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','lodash','util','../../config/logger','moment'];(function(_0x1e7f2b,_0x48c685){var _0x2487a6=function(_0x2d25de){while(--_0x2d25de){_0x1e7f2b['push'](_0x1e7f2b['shift']());}};_0x2487a6(++_0x48c685);}(_0xb7e9,0x122));var _0x9b7e=function(_0x388eea,_0x340518){_0x388eea=_0x388eea-0x0;var _0x4a175b=_0xb7e9[_0x388eea];return _0x4a175b;};'use strict';var _=require(_0x9b7e('0x0'));var util=require(_0x9b7e('0x1'));var logger=require(_0x9b7e('0x2'))('api');var moment=require(_0x9b7e('0x3'));var BPromise=require(_0x9b7e('0x4'));var rp=require(_0x9b7e('0x5'));var fs=require('fs');var path=require(_0x9b7e('0x6'));var rimraf=require(_0x9b7e('0x7'));var config=require(_0x9b7e('0x8'));var attributes=require(_0x9b7e('0x9'));module[_0x9b7e('0xa')]=function(_0x423e44,_0x10996a){return _0x423e44[_0x9b7e('0xb')](_0x9b7e('0xc'),attributes,{'tableName':_0x9b7e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3b11=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','lodash','util'];(function(_0x5b7a4f,_0x2948ce){var _0x48c7a9=function(_0x27ef67){while(--_0x27ef67){_0x5b7a4f['push'](_0x5b7a4f['shift']());}};_0x48c7a9(++_0x2948ce);}(_0x3b11,0x132));var _0x13b1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3b11[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x13b1('0x0'));var util=require(_0x13b1('0x1'));var logger=require(_0x13b1('0x2'))('api');var moment=require(_0x13b1('0x3'));var BPromise=require(_0x13b1('0x4'));var rp=require(_0x13b1('0x5'));var fs=require('fs');var path=require(_0x13b1('0x6'));var rimraf=require(_0x13b1('0x7'));var config=require(_0x13b1('0x8'));var attributes=require(_0x13b1('0x9'));module[_0x13b1('0xa')]=function(_0x50ca0a,_0x2fe6b4){return _0x50ca0a[_0x13b1('0xb')](_0x13b1('0xc'),attributes,{'tableName':_0x13b1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index 1a6ce46..977be2c 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 _0xcc45=['message','result','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','limit','include','map','model','debug','stringify','ShowTrunk','find','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','then','info','request\x20sent','error','Trunk,\x20%s,\x20%s'];(function(_0x229722,_0xa7a1ba){var _0x3f8521=function(_0x606d28){while(--_0x606d28){_0x229722['push'](_0x229722['shift']());}};_0x3f8521(++_0xa7a1ba);}(_0xcc45,0x112));var _0x5cc4=function(_0x5412f2,_0x27bc0f){_0x5412f2=_0x5412f2-0x0;var _0x3294aa=_0xcc45[_0x5412f2];return _0x3294aa;};'use strict';var _=require('lodash');var util=require(_0x5cc4('0x0'));var moment=require(_0x5cc4('0x1'));var BPromise=require(_0x5cc4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5cc4('0x3'));var db=require(_0x5cc4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5cc4('0x5'))(_0x5cc4('0x6'));var config=require('../../config/environment');var jayson=require(_0x5cc4('0x7'));var client=jayson[_0x5cc4('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x156aed,_0x3334e4,_0x51658a){return new BPromise(function(_0x4b205a,_0x23a83f){return client['request'](_0x156aed,_0x51658a)[_0x5cc4('0x9')](function(_0x3fb11e){logger[_0x5cc4('0xa')]('Trunk,\x20%s,\x20%s',_0x3334e4,_0x5cc4('0xb'));logger['debug']('Trunk,\x20%s,\x20%s,\x20%s',_0x3334e4,_0x5cc4('0xb'),JSON['stringify'](_0x3fb11e));if(_0x3fb11e[_0x5cc4('0xc')]){if(_0x3fb11e[_0x5cc4('0xc')]['code']===0x1f4){logger['error'](_0x5cc4('0xd'),_0x3334e4,_0x3fb11e[_0x5cc4('0xc')][_0x5cc4('0xe')]);return _0x23a83f(_0x3fb11e[_0x5cc4('0xc')][_0x5cc4('0xe')]);}logger[_0x5cc4('0xc')]('Trunk,\x20%s,\x20%s',_0x3334e4,_0x3fb11e[_0x5cc4('0xc')]['message']);return _0x4b205a(_0x3fb11e[_0x5cc4('0xc')][_0x5cc4('0xe')]);}else{logger['info'](_0x5cc4('0xd'),_0x3334e4,_0x5cc4('0xb'));_0x4b205a(_0x3fb11e[_0x5cc4('0xf')]['message']);}})[_0x5cc4('0x10')](function(_0xe338c9){logger['error'](_0x5cc4('0xd'),_0x3334e4,_0xe338c9);_0x23a83f(_0xe338c9);});});}exports[_0x5cc4('0x11')]=function(_0x2f7302){var _0x414ad2=this;return new Promise(function(_0xa6b0ed,_0x2e4687){return db[_0x5cc4('0x12')][_0x5cc4('0x13')]({'raw':_0x2f7302[_0x5cc4('0x14')]?_0x2f7302[_0x5cc4('0x14')][_0x5cc4('0x15')]===undefined?!![]:![]:!![],'where':_0x2f7302[_0x5cc4('0x14')]?_0x2f7302[_0x5cc4('0x14')][_0x5cc4('0x16')]||null:null,'attributes':_0x2f7302[_0x5cc4('0x14')]?_0x2f7302['options'][_0x5cc4('0x17')]||null:null,'limit':_0x2f7302[_0x5cc4('0x14')]?_0x2f7302[_0x5cc4('0x14')][_0x5cc4('0x18')]||null:null,'include':_0x2f7302[_0x5cc4('0x14')]?_0x2f7302['options'][_0x5cc4('0x19')]?_['map'](_0x2f7302[_0x5cc4('0x14')][_0x5cc4('0x19')],function(_0x3c69c9){return{'model':db[_0x3c69c9['model']],'as':_0x3c69c9['as'],'attributes':_0x3c69c9[_0x5cc4('0x17')],'include':_0x3c69c9[_0x5cc4('0x19')]?_[_0x5cc4('0x1a')](_0x3c69c9[_0x5cc4('0x19')],function(_0x259c58){return{'model':db[_0x259c58[_0x5cc4('0x1b')]],'as':_0x259c58['as'],'attributes':_0x259c58['attributes'],'include':_0x259c58[_0x5cc4('0x19')]?_[_0x5cc4('0x1a')](_0x259c58['include'],function(_0x48f669){return{'model':db[_0x48f669['model']],'as':_0x48f669['as'],'attributes':_0x48f669['attributes']};}):[]};}):[]};}):[]:[]})[_0x5cc4('0x9')](function(_0x2aa6b){logger[_0x5cc4('0xa')]('GetTrunk',_0x2f7302);logger[_0x5cc4('0x1c')]('GetTrunk',_0x2f7302,JSON[_0x5cc4('0x1d')](_0x2aa6b));_0xa6b0ed(_0x2aa6b);})[_0x5cc4('0x10')](function(_0xd45455){logger['error'](_0x5cc4('0x11'),_0xd45455[_0x5cc4('0xe')],_0x2f7302);_0x2e4687(_0x414ad2[_0x5cc4('0xc')](0x1f4,_0xd45455['message']));});});};exports[_0x5cc4('0x1e')]=function(_0x10d93d){var _0x3c119a=this;return new Promise(function(_0x51ed45,_0x4ab515){return db[_0x5cc4('0x12')][_0x5cc4('0x1f')]({'raw':_0x10d93d['options']?_0x10d93d[_0x5cc4('0x14')][_0x5cc4('0x15')]===undefined?!![]:![]:!![],'where':_0x10d93d['options']?_0x10d93d[_0x5cc4('0x14')]['where']||null:null,'attributes':_0x10d93d[_0x5cc4('0x14')]?_0x10d93d[_0x5cc4('0x14')][_0x5cc4('0x17')]||null:null,'include':_0x10d93d[_0x5cc4('0x14')]?_0x10d93d[_0x5cc4('0x14')][_0x5cc4('0x19')]?_[_0x5cc4('0x1a')](_0x10d93d[_0x5cc4('0x14')][_0x5cc4('0x19')],function(_0x3d77d4){return{'model':db[_0x3d77d4['model']],'as':_0x3d77d4['as'],'attributes':_0x3d77d4[_0x5cc4('0x17')],'include':_0x3d77d4[_0x5cc4('0x19')]?_['map'](_0x3d77d4[_0x5cc4('0x19')],function(_0x343f8a){return{'model':db[_0x343f8a[_0x5cc4('0x1b')]],'as':_0x343f8a['as'],'attributes':_0x343f8a[_0x5cc4('0x17')],'include':_0x343f8a['include']?_[_0x5cc4('0x1a')](_0x343f8a[_0x5cc4('0x19')],function(_0x594949){return{'model':db[_0x594949[_0x5cc4('0x1b')]],'as':_0x594949['as'],'attributes':_0x594949['attributes']};}):[]};}):[]};}):[]:[]})[_0x5cc4('0x9')](function(_0x309818){logger[_0x5cc4('0xa')](_0x5cc4('0x1e'),_0x10d93d);logger[_0x5cc4('0x1c')](_0x5cc4('0x1e'),_0x10d93d,JSON['stringify'](_0x309818));_0x51ed45(_0x309818);})[_0x5cc4('0x10')](function(_0x4fda35){logger[_0x5cc4('0xc')](_0x5cc4('0x1e'),_0x4fda35[_0x5cc4('0xe')],_0x10d93d);_0x4ab515(_0x3c119a[_0x5cc4('0xc')](0x1f4,_0x4fda35[_0x5cc4('0xe')]));});});}; \ No newline at end of file +var _0xde9c=['result','GetTrunk','Trunk','findAll','options','where','attributes','model','map','include','raw','catch','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x6e88e0,_0x1a54ef){var _0x287f4c=function(_0x13a44a){while(--_0x13a44a){_0x6e88e0['push'](_0x6e88e0['shift']());}};_0x287f4c(++_0x1a54ef);}(_0xde9c,0x15c));var _0xcde9=function(_0x1642cb,_0xe4f1a3){_0x1642cb=_0x1642cb-0x0;var _0x3a9fbc=_0xde9c[_0x1642cb];return _0x3a9fbc;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xcde9('0x0'));var rs=require(_0xcde9('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcde9('0x2'))(_0xcde9('0x3'));var config=require(_0xcde9('0x4'));var jayson=require(_0xcde9('0x5'));var client=jayson[_0xcde9('0x6')][_0xcde9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2ba81c,_0x4d6c77,_0x170cec){return new BPromise(function(_0x4bbee2,_0x34d718){return client['request'](_0x2ba81c,_0x170cec)[_0xcde9('0x8')](function(_0x253a7){logger[_0xcde9('0x9')](_0xcde9('0xa'),_0x4d6c77,_0xcde9('0xb'));logger[_0xcde9('0xc')]('Trunk,\x20%s,\x20%s,\x20%s',_0x4d6c77,_0xcde9('0xb'),JSON['stringify'](_0x253a7));if(_0x253a7[_0xcde9('0xd')]){if(_0x253a7[_0xcde9('0xd')][_0xcde9('0xe')]===0x1f4){logger['error']('Trunk,\x20%s,\x20%s',_0x4d6c77,_0x253a7[_0xcde9('0xd')][_0xcde9('0xf')]);return _0x34d718(_0x253a7['error'][_0xcde9('0xf')]);}logger['error'](_0xcde9('0xa'),_0x4d6c77,_0x253a7[_0xcde9('0xd')]['message']);return _0x4bbee2(_0x253a7['error'][_0xcde9('0xf')]);}else{logger['info'](_0xcde9('0xa'),_0x4d6c77,'request\x20sent');_0x4bbee2(_0x253a7[_0xcde9('0x10')][_0xcde9('0xf')]);}})['catch'](function(_0xea7dbe){logger[_0xcde9('0xd')](_0xcde9('0xa'),_0x4d6c77,_0xea7dbe);_0x34d718(_0xea7dbe);});});}exports[_0xcde9('0x11')]=function(_0x2ec053){var _0x1d4846=this;return new Promise(function(_0x4fd121,_0x333b54){return db[_0xcde9('0x12')][_0xcde9('0x13')]({'raw':_0x2ec053['options']?_0x2ec053[_0xcde9('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x2ec053[_0xcde9('0x14')]?_0x2ec053['options'][_0xcde9('0x15')]||null:null,'attributes':_0x2ec053[_0xcde9('0x14')]?_0x2ec053[_0xcde9('0x14')][_0xcde9('0x16')]||null:null,'limit':_0x2ec053[_0xcde9('0x14')]?_0x2ec053[_0xcde9('0x14')]['limit']||null:null,'include':_0x2ec053[_0xcde9('0x14')]?_0x2ec053[_0xcde9('0x14')]['include']?_['map'](_0x2ec053['options']['include'],function(_0x354b3b){return{'model':db[_0x354b3b[_0xcde9('0x17')]],'as':_0x354b3b['as'],'attributes':_0x354b3b[_0xcde9('0x16')],'include':_0x354b3b['include']?_[_0xcde9('0x18')](_0x354b3b['include'],function(_0x242224){return{'model':db[_0x242224['model']],'as':_0x242224['as'],'attributes':_0x242224[_0xcde9('0x16')],'include':_0x242224[_0xcde9('0x19')]?_[_0xcde9('0x18')](_0x242224[_0xcde9('0x19')],function(_0xa0c13a){return{'model':db[_0xa0c13a[_0xcde9('0x17')]],'as':_0xa0c13a['as'],'attributes':_0xa0c13a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x35c567){logger[_0xcde9('0x9')](_0xcde9('0x11'),_0x2ec053);logger[_0xcde9('0xc')]('GetTrunk',_0x2ec053,JSON['stringify'](_0x35c567));_0x4fd121(_0x35c567);})['catch'](function(_0x3c5434){logger[_0xcde9('0xd')](_0xcde9('0x11'),_0x3c5434[_0xcde9('0xf')],_0x2ec053);_0x333b54(_0x1d4846[_0xcde9('0xd')](0x1f4,_0x3c5434[_0xcde9('0xf')]));});});};exports['ShowTrunk']=function(_0x5751e3){var _0x17ab20=this;return new Promise(function(_0x196fbc,_0x558f18){return db['Trunk']['find']({'raw':_0x5751e3[_0xcde9('0x14')]?_0x5751e3[_0xcde9('0x14')][_0xcde9('0x1a')]===undefined?!![]:![]:!![],'where':_0x5751e3[_0xcde9('0x14')]?_0x5751e3['options'][_0xcde9('0x15')]||null:null,'attributes':_0x5751e3[_0xcde9('0x14')]?_0x5751e3[_0xcde9('0x14')][_0xcde9('0x16')]||null:null,'include':_0x5751e3[_0xcde9('0x14')]?_0x5751e3[_0xcde9('0x14')][_0xcde9('0x19')]?_[_0xcde9('0x18')](_0x5751e3[_0xcde9('0x14')][_0xcde9('0x19')],function(_0x5690bb){return{'model':db[_0x5690bb[_0xcde9('0x17')]],'as':_0x5690bb['as'],'attributes':_0x5690bb[_0xcde9('0x16')],'include':_0x5690bb[_0xcde9('0x19')]?_[_0xcde9('0x18')](_0x5690bb[_0xcde9('0x19')],function(_0x22ef1d){return{'model':db[_0x22ef1d[_0xcde9('0x17')]],'as':_0x22ef1d['as'],'attributes':_0x22ef1d[_0xcde9('0x16')],'include':_0x22ef1d[_0xcde9('0x19')]?_['map'](_0x22ef1d[_0xcde9('0x19')],function(_0x59c1f8){return{'model':db[_0x59c1f8[_0xcde9('0x17')]],'as':_0x59c1f8['as'],'attributes':_0x59c1f8['attributes']};}):[]};}):[]};}):[]:[]})[_0xcde9('0x8')](function(_0x45c98a){logger[_0xcde9('0x9')]('ShowTrunk',_0x5751e3);logger[_0xcde9('0xc')]('ShowTrunk',_0x5751e3,JSON['stringify'](_0x45c98a));_0x196fbc(_0x45c98a);})[_0xcde9('0x1b')](function(_0x3f0499){logger[_0xcde9('0xd')]('ShowTrunk',_0x3f0499['message'],_0x5751e3);_0x558f18(_0x17ab20[_0xcde9('0xd')](0x1f4,_0x3f0499[_0xcde9('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 97af611..42961f6 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 _0x1a54=['../../components/auth/service','put','/:id','isAuthenticated','update','exports','express','Router'];(function(_0x2d015c,_0x31bb7e){var _0x403093=function(_0x2dc795){while(--_0x2dc795){_0x2d015c['push'](_0x2d015c['shift']());}};_0x403093(++_0x31bb7e);}(_0x1a54,0x1c6));var _0x41a5=function(_0x1b874f,_0x5e1748){_0x1b874f=_0x1b874f-0x0;var _0x531574=_0x1a54[_0x1b874f];return _0x531574;};'use strict';var express=require(_0x41a5('0x0'));var router=express[_0x41a5('0x1')]();var auth=require(_0x41a5('0x2'));var controller=require('./user-setting.controller');router[_0x41a5('0x3')](_0x41a5('0x4'),auth[_0x41a5('0x5')](),controller[_0x41a5('0x6')]);module[_0x41a5('0x7')]=router; \ No newline at end of file +var _0x28e7=['./user-setting.controller','put','isAuthenticated','update','exports','express','Router'];(function(_0x46b1fa,_0x3b8818){var _0x25f6ce=function(_0x451022){while(--_0x451022){_0x46b1fa['push'](_0x46b1fa['shift']());}};_0x25f6ce(++_0x3b8818);}(_0x28e7,0x1da));var _0x728e=function(_0x54443a,_0x27a80f){_0x54443a=_0x54443a-0x0;var _0x45786b=_0x28e7[_0x54443a];return _0x45786b;};'use strict';var express=require(_0x728e('0x0'));var router=express[_0x728e('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x728e('0x2'));router[_0x728e('0x3')]('/:id',auth[_0x728e('0x4')](),controller[_0x728e('0x5')]);module[_0x728e('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 2259d57..bbe39ad 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 _0x130f=['exports','ENUM','BOOLEAN','DATE','INTEGER','UserId','warning','info','debug'];(function(_0x2482a7,_0x89337){var _0x244c7c=function(_0x414efb){while(--_0x414efb){_0x2482a7['push'](_0x2482a7['shift']());}};_0x244c7c(++_0x89337);}(_0x130f,0xf0));var _0xf130=function(_0x50bc2e,_0x2d8ddc){_0x50bc2e=_0x50bc2e-0x0;var _0x4810c7=_0x130f[_0x50bc2e];return _0x4810c7;};'use strict';var Sequelize=require('sequelize');const CLIENT_SIDE_LOG_LEVELS=['error',_0xf130('0x0'),_0xf130('0x1'),_0xf130('0x2')];module[_0xf130('0x3')]={'clientSideLoggingLevel':{'type':Sequelize[_0xf130('0x4')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xf130('0x5')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xf130('0x6')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xf130('0x7')],'unique':_0xf130('0x8')}}; \ No newline at end of file +var _0x5e89=['exports','ENUM','BOOLEAN','TEXT','INTEGER','UserId','warning','debug'];(function(_0x392c2a,_0x4e286b){var _0x3bdcb5=function(_0x1974e8){while(--_0x1974e8){_0x392c2a['push'](_0x392c2a['shift']());}};_0x3bdcb5(++_0x4e286b);}(_0x5e89,0x1d6));var _0x95e8=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x5e89[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require('sequelize');const CLIENT_SIDE_LOG_LEVELS=['error',_0x95e8('0x0'),'info',_0x95e8('0x1')];module[_0x95e8('0x2')]={'clientSideLoggingLevel':{'type':Sequelize[_0x95e8('0x3')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x95e8('0x4')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x95e8('0x5')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x95e8('0x6')],'unique':_0x95e8('0x7')}}; \ 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 50f07d9..2d27a80 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 _0x6b19=['body','catch','lodash','ioredis','api','socket.io-emitter','redis','./user-setting.socket','register','status','update','then','sendStatus','error','name','send','user','role','admin','params','Invalid\x20user\x20setting\x20id','UserSetting','find'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6b19,0xe8));var _0x96b1=function(_0x5ce8cd,_0x54c250){_0x5ce8cd=_0x5ce8cd-0x0;var _0x3acc3f=_0x6b19[_0x5ce8cd];return _0x3acc3f;};'use strict';var _=require(_0x96b1('0x0'));var Redis=require(_0x96b1('0x1'));var logger=require('../../config/logger')(_0x96b1('0x2'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var socket=require(_0x96b1('0x3'))(new Redis(config[_0x96b1('0x4')]));require(_0x96b1('0x5'))[_0x96b1('0x6')](socket);config[_0x96b1('0x4')]=_['defaults'](config[_0x96b1('0x4')],{'host':'localhost','port':0x18eb});function respondWithResult(_0x3e3e1a,_0x572fde){_0x572fde=_0x572fde||0xc8;return function(_0x57a23a){if(_0x57a23a){return _0x3e3e1a[_0x96b1('0x7')](_0x572fde)['json'](_0x57a23a);}};}function saveUpdates(_0x2ab6b7){return function(_0x4d2f1c){if(_0x4d2f1c){return _0x4d2f1c[_0x96b1('0x8')](_0x2ab6b7)[_0x96b1('0x9')](function(_0x366a60){return _0x366a60;});}return null;};}function handleEntityNotFound(_0x37612e){return function(_0x39eeb7){if(!_0x39eeb7){_0x37612e[_0x96b1('0xa')](0x194);}return _0x39eeb7;};}function handleError(_0x315a88,_0x5a87f3){_0x5a87f3=_0x5a87f3||0x1f4;return function(_0x52256e){logger[_0x96b1('0xb')](_0x52256e['stack']);if(_0x52256e['name']){delete _0x52256e[_0x96b1('0xc')];}_0x315a88[_0x96b1('0x7')](_0x5a87f3)[_0x96b1('0xd')](_0x52256e);};}exports['update']=function(_0x1372fd,_0x1af8c1){if(_0x1372fd[_0x96b1('0xe')][_0x96b1('0xf')]!==_0x96b1('0x10'))throw new Error('Unauthorized');if(isNaN(Number(_0x1372fd[_0x96b1('0x11')]['id'])))throw new Error(_0x96b1('0x12'));return db[_0x96b1('0x13')][_0x96b1('0x14')]({'where':{'id':_0x1372fd[_0x96b1('0x11')]['id']}})[_0x96b1('0x9')](handleEntityNotFound(_0x1af8c1,null))[_0x96b1('0x9')](saveUpdates(_0x1372fd[_0x96b1('0x15')],null))[_0x96b1('0x9')](respondWithResult(_0x1af8c1,null))[_0x96b1('0x16')](handleError(_0x1af8c1,null));}; \ No newline at end of file +var _0xb0d9=['Unauthorized','Invalid\x20user\x20setting\x20id','UserSetting','find','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','status','json','then','sendStatus','stack','name','send','user','role'];(function(_0x105e01,_0x199717){var _0x421f22=function(_0x5b1103){while(--_0x5b1103){_0x105e01['push'](_0x105e01['shift']());}};_0x421f22(++_0x199717);}(_0xb0d9,0x10c));var _0x9b0d=function(_0x1345d5,_0x51e362){_0x1345d5=_0x1345d5-0x0;var _0x5c3983=_0xb0d9[_0x1345d5];return _0x5c3983;};'use strict';var _=require(_0x9b0d('0x0'));var Redis=require(_0x9b0d('0x1'));var logger=require(_0x9b0d('0x2'))(_0x9b0d('0x3'));var config=require(_0x9b0d('0x4'));var db=require(_0x9b0d('0x5'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0x9b0d('0x6')]));require('./user-setting.socket')['register'](socket);config['redis']=_[_0x9b0d('0x7')](config[_0x9b0d('0x6')],{'host':_0x9b0d('0x8'),'port':0x18eb});function respondWithResult(_0x438e0a,_0x2c519d){_0x2c519d=_0x2c519d||0xc8;return function(_0x45c371){if(_0x45c371){return _0x438e0a[_0x9b0d('0x9')](_0x2c519d)[_0x9b0d('0xa')](_0x45c371);}};}function saveUpdates(_0x3152da){return function(_0x5b30db){if(_0x5b30db){return _0x5b30db['update'](_0x3152da)[_0x9b0d('0xb')](function(_0x76dc19){return _0x76dc19;});}return null;};}function handleEntityNotFound(_0x48ac4a){return function(_0x382196){if(!_0x382196){_0x48ac4a[_0x9b0d('0xc')](0x194);}return _0x382196;};}function handleError(_0x506ef2,_0x58aa0b){_0x58aa0b=_0x58aa0b||0x1f4;return function(_0x41f224){logger['error'](_0x41f224[_0x9b0d('0xd')]);if(_0x41f224['name']){delete _0x41f224[_0x9b0d('0xe')];}_0x506ef2[_0x9b0d('0x9')](_0x58aa0b)[_0x9b0d('0xf')](_0x41f224);};}exports['update']=function(_0x3bd923,_0x551445){if(_0x3bd923[_0x9b0d('0x10')][_0x9b0d('0x11')]!=='admin')throw new Error(_0x9b0d('0x12'));if(isNaN(Number(_0x3bd923['params']['id'])))throw new Error(_0x9b0d('0x13'));return db[_0x9b0d('0x14')][_0x9b0d('0x15')]({'where':{'id':_0x3bd923['params']['id']}})[_0x9b0d('0xb')](handleEntityNotFound(_0x551445,null))[_0x9b0d('0xb')](saveUpdates(_0x3bd923['body'],null))['then'](respondWithResult(_0x551445,null))['catch'](handleError(_0x551445,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 1d39f89..74efe49 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 _0x3544=['save','update','emit','hasOwnProperty','exports','../../mysqldb','UserSetting','setMaxListeners'];(function(_0x28e9d2,_0x2b2bfa){var _0x4150a7=function(_0x5d8701){while(--_0x5d8701){_0x28e9d2['push'](_0x28e9d2['shift']());}};_0x4150a7(++_0x2b2bfa);}(_0x3544,0x1ad));var _0x4354=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0x3544[_0xc67528];return _0x38e26d;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0x4354('0x0'))['db'][_0x4354('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x4354('0x2')](0x0);var events={'afterCreate':_0x4354('0x3'),'afterUpdate':_0x4354('0x4'),'afterDestroy':'remove'};function emitEvent(_0xade43e){return function(_0x2fab97,_0x7d9e8c,_0x49c9be){UserSettingEvents['emit'](_0xade43e+':'+_0x2fab97['id'],_0x2fab97);UserSettingEvents[_0x4354('0x5')](_0xade43e,_0x2fab97);_0x49c9be(null);};}for(var e in events){if(events[_0x4354('0x6')](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module[_0x4354('0x7')]=UserSettingEvents; \ No newline at end of file +var _0xbd94=['../../mysqldb','UserSetting','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x3ba566,_0x5e009d){var _0x480317=function(_0x2fc8de){while(--_0x2fc8de){_0x3ba566['push'](_0x3ba566['shift']());}};_0x480317(++_0x5e009d);}(_0xbd94,0xaf));var _0x4bd9=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xbd94[_0x4565bf];return _0x5610ba;};'use strict';var EventEmitter=require(_0x4bd9('0x0'));var UserSetting=require(_0x4bd9('0x1'))['db'][_0x4bd9('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x4bd9('0x3')](0x0);var events={'afterCreate':_0x4bd9('0x4'),'afterUpdate':_0x4bd9('0x5'),'afterDestroy':_0x4bd9('0x6')};function emitEvent(_0x2e01a9){return function(_0x23a3d8,_0x1671cf,_0x1a8efb){UserSettingEvents[_0x4bd9('0x7')](_0x2e01a9+':'+_0x23a3d8['id'],_0x23a3d8);UserSettingEvents[_0x4bd9('0x7')](_0x2e01a9,_0x23a3d8);_0x1a8efb(null);};}for(var e in events){if(events[_0x4bd9('0x8')](e)){var event=events[e];UserSetting[_0x4bd9('0x9')](e,emitEvent(event));}}module[_0x4bd9('0xa')]=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 7e1fd01..d2151a9 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 _0xcce8=['clientSideLoggingEnabledSince','./user-setting.attributes','exports','define','UserSetting','user_settings','clientSideLoggingEnabled'];(function(_0x278576,_0x20a022){var _0x584e1b=function(_0x4c0319){while(--_0x4c0319){_0x278576['push'](_0x278576['shift']());}};_0x584e1b(++_0x20a022);}(_0xcce8,0x1a5));var _0x8cce=function(_0x19c6a1,_0x11ae8a){_0x19c6a1=_0x19c6a1-0x0;var _0x9aa481=_0xcce8[_0x19c6a1];return _0x9aa481;};'use strict';var attributes=require(_0x8cce('0x0'));module[_0x8cce('0x1')]=function(_0x367918){return _0x367918[_0x8cce('0x2')](_0x8cce('0x3'),attributes,{'tableName':_0x8cce('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1ce3fb){if(!_0x1ce3fb[_0x8cce('0x5')])_0x1ce3fb[_0x8cce('0x6')]=null;else if(_0x1ce3fb[_0x8cce('0x6')]===null)_0x1ce3fb['clientSideLoggingEnabledSince']=new Date();}}});}; \ No newline at end of file +var _0xfd6f=['exports','define','UserSetting','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes'];(function(_0x3a0d46,_0x4130c3){var _0x5ed57d=function(_0x3e25d1){while(--_0x3e25d1){_0x3a0d46['push'](_0x3a0d46['shift']());}};_0x5ed57d(++_0x4130c3);}(_0xfd6f,0x19d));var _0xffd6=function(_0x2ba3ed,_0x36137c){_0x2ba3ed=_0x2ba3ed-0x0;var _0x29d51f=_0xfd6f[_0x2ba3ed];return _0x29d51f;};'use strict';var attributes=require(_0xffd6('0x0'));module[_0xffd6('0x1')]=function(_0x29b163){return _0x29b163[_0xffd6('0x2')](_0xffd6('0x3'),attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xb84411){if(!_0xb84411[_0xffd6('0x4')])_0xb84411[_0xffd6('0x5')]=null;else if(_0xb84411[_0xffd6('0x5')]===null)_0xb84411['clientSideLoggingEnabledSince']=new Date();}}});}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.socket.js b/server/api/user-setting/user-setting.socket.js index 8de0158..7d0f691 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 _0x9e0f=['emit','user-setting:update','UserId','register','length','user-setting:','./user-setting.events','save','remove'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x9e0f,0xa8));var _0xf9e0=function(_0x1e6b29,_0x440ee3){_0x1e6b29=_0x1e6b29-0x0;var _0xd9a812=_0x9e0f[_0x1e6b29];return _0xd9a812;};'use strict';var UserSettingEvents=require(_0xf9e0('0x0'));var events=[_0xf9e0('0x1'),_0xf9e0('0x2'),'update'];function createListener(_0x42fe88,_0x2716bd){return function(_0x50a5a9){_0x2716bd[_0xf9e0('0x3')](_0x42fe88,_0x50a5a9);if(_0x42fe88===_0xf9e0('0x4')){_0x2716bd[_0xf9e0('0x3')]('user-setting:update:user-'+_0x50a5a9[_0xf9e0('0x5')],_0x50a5a9);}};}exports[_0xf9e0('0x6')]=function(_0x3eae70){for(var _0x4180f6=0x0,_0x2010bf=events[_0xf9e0('0x7')];_0x4180f6<_0x2010bf;_0x4180f6++){var _0x56f4fd=events[_0x4180f6];var _0x4ea25e=createListener(_0xf9e0('0x8')+_0x56f4fd,_0x3eae70);UserSettingEvents['on'](_0x56f4fd,_0x4ea25e);}}; \ No newline at end of file +var _0xc2e7=['user-setting:update','emit','user-setting:update:user-','UserId','register','length','user-setting:','./user-setting.events','save','remove','update'];(function(_0x1d2f43,_0x4d8001){var _0x582740=function(_0x1f536a){while(--_0x1f536a){_0x1d2f43['push'](_0x1d2f43['shift']());}};_0x582740(++_0x4d8001);}(_0xc2e7,0x193));var _0x7c2e=function(_0x432ee8,_0x36e1be){_0x432ee8=_0x432ee8-0x0;var _0x1a06d4=_0xc2e7[_0x432ee8];return _0x1a06d4;};'use strict';var UserSettingEvents=require(_0x7c2e('0x0'));var events=[_0x7c2e('0x1'),_0x7c2e('0x2'),_0x7c2e('0x3')];function createListener(_0x1daa2a,_0x4d6aba){return function(_0x11ca24){_0x4d6aba['emit'](_0x1daa2a,_0x11ca24);if(_0x1daa2a===_0x7c2e('0x4')){_0x4d6aba[_0x7c2e('0x5')](_0x7c2e('0x6')+_0x11ca24[_0x7c2e('0x7')],_0x11ca24);}};}exports[_0x7c2e('0x8')]=function(_0x33884e){for(var _0x2bf09c=0x0,_0x4e56f2=events[_0x7c2e('0x9')];_0x2bf09c<_0x4e56f2;_0x2bf09c++){var _0x491baa=events[_0x2bf09c];var _0x536670=createListener(_0x7c2e('0xa')+_0x491baa,_0x33884e);UserSettingEvents['on'](_0x491baa,_0x536670);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index d688eee..a020c24 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 _0x3a93=['/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','/:id/chat_interactions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addMailAccounts','/:id/openchannel_accounts','addOpenchannelAccounts','addSmsAccounts','/:id/chat_websites','addWhatsappAccounts','createApiKey','/:id','put','/:id/password','changePassword','delete','removeQueues','removeTeams','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','/:id/api_key','removeApiKey','/:id/messengerSoundNotification','messengerSoundNotification','exports','util','path','connect-timeout','express','fs-extra','../../config/environment','./user.controller','get','/describe','isAuthenticated','describe','/whoami','whoami','/presence','getPresence','show','/:id/avatar','/:id/open_tabs','getOpenTabs','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','/:id/mail/interactions','/:id/sms/interactions','/:id/fax/interactions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','getLists','getAgents','getVoicePrefixes','/:id/fax_accounts','/:id/mail_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/whatsapp_accounts','/:id/scheduled_calls','getScheduledCalls','post','/:id/contacts','addContacts','create','/create_many','bulkCreate','addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','originalname','single','file','addAvatar'];(function(_0x4497ec,_0x2db3a6){var _0x394cfd=function(_0x32b86d){while(--_0x32b86d){_0x4497ec['push'](_0x4497ec['shift']());}};_0x394cfd(++_0x2db3a6);}(_0x3a93,0x118));var _0x33a9=function(_0x49418f,_0xf40fe9){_0x49418f=_0x49418f-0x0;var _0x319164=_0x3a93[_0x49418f];return _0x319164;};'use strict';var multer=require('multer');var util=require(_0x33a9('0x0'));var path=require(_0x33a9('0x1'));var timeout=require(_0x33a9('0x2'));var express=require(_0x33a9('0x3'));var router=express['Router']();var fs_extra=require(_0x33a9('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x33a9('0x5'));var controller=require(_0x33a9('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x33a9('0x7')](_0x33a9('0x8'),auth[_0x33a9('0x9')](),controller[_0x33a9('0xa')]);router[_0x33a9('0x7')](_0x33a9('0xb'),auth[_0x33a9('0x9')](),controller[_0x33a9('0xc')]);router[_0x33a9('0x7')](_0x33a9('0xd'),auth[_0x33a9('0x9')](),controller[_0x33a9('0xe')]);router[_0x33a9('0x7')]('/:id',auth[_0x33a9('0x9')](),controller[_0x33a9('0xf')]);router[_0x33a9('0x7')](_0x33a9('0x10'),controller['getAvatar']);router[_0x33a9('0x7')](_0x33a9('0x11'),auth['isAuthenticated'](),controller[_0x33a9('0x12')]);router[_0x33a9('0x7')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x33a9('0x13')]);router[_0x33a9('0x7')](_0x33a9('0x14'),auth[_0x33a9('0x9')](),controller[_0x33a9('0x15')]);router[_0x33a9('0x7')](_0x33a9('0x16'),auth['isAuthenticated'](),controller[_0x33a9('0x17')]);router[_0x33a9('0x7')](_0x33a9('0x18'),auth[_0x33a9('0x9')](),controller[_0x33a9('0x19')]);router[_0x33a9('0x7')](_0x33a9('0x1a'),auth['isAuthenticated'](),controller[_0x33a9('0x1b')]);router[_0x33a9('0x7')](_0x33a9('0x1c'),auth['isAuthenticated'](),controller[_0x33a9('0x1d')]);router[_0x33a9('0x7')](_0x33a9('0x1e'),auth[_0x33a9('0x9')](),controller[_0x33a9('0x1f')]);router['get'](_0x33a9('0x20'),auth[_0x33a9('0x9')](),controller['getOpenchannelInteractions']);router[_0x33a9('0x7')](_0x33a9('0x21'),auth[_0x33a9('0x9')](),controller['getMailInteractions']);router[_0x33a9('0x7')](_0x33a9('0x22'),auth[_0x33a9('0x9')](),controller['getSmsInteractions']);router[_0x33a9('0x7')](_0x33a9('0x23'),auth[_0x33a9('0x9')](),controller['getFaxInteractions']);router[_0x33a9('0x7')](_0x33a9('0x24'),auth[_0x33a9('0x9')](),controller[_0x33a9('0x25')]);router[_0x33a9('0x7')](_0x33a9('0x26'),auth[_0x33a9('0x9')](),controller[_0x33a9('0x27')]);router['get']('/:id/lists',auth[_0x33a9('0x9')](),controller[_0x33a9('0x28')]);router[_0x33a9('0x7')]('/:id/agents',auth['isAuthenticated'](),controller[_0x33a9('0x29')]);router[_0x33a9('0x7')]('/:id/prefixes',auth['isAuthenticated'](),controller[_0x33a9('0x2a')]);router[_0x33a9('0x7')](_0x33a9('0x2b'),auth[_0x33a9('0x9')](),controller['getFaxAccounts']);router[_0x33a9('0x7')](_0x33a9('0x2c'),auth[_0x33a9('0x9')](),controller['getMailAccounts']);router['get']('/:id/openchannel_accounts',auth[_0x33a9('0x9')](),controller[_0x33a9('0x2d')]);router[_0x33a9('0x7')](_0x33a9('0x2e'),auth[_0x33a9('0x9')](),controller[_0x33a9('0x2f')]);router[_0x33a9('0x7')]('/:id/chat_websites',auth[_0x33a9('0x9')](),controller['getChatWebsites']);router['get'](_0x33a9('0x30'),auth[_0x33a9('0x9')](),controller['getWhatsappAccounts']);router[_0x33a9('0x7')](_0x33a9('0x31'),auth[_0x33a9('0x9')](),controller[_0x33a9('0x32')]);router[_0x33a9('0x7')]('/:id/api_key',auth[_0x33a9('0x9')](),controller['getApiKey']);router[_0x33a9('0x33')](_0x33a9('0x34'),auth[_0x33a9('0x9')](),controller[_0x33a9('0x35')]);router[_0x33a9('0x33')]('/',auth[_0x33a9('0x9')](),controller[_0x33a9('0x36')]);router[_0x33a9('0x33')](_0x33a9('0x37'),auth['isAuthenticated'](),controller[_0x33a9('0x38')]);router[_0x33a9('0x33')](_0x33a9('0x14'),auth[_0x33a9('0x9')](),controller[_0x33a9('0x39')]);var upload=multer({'storage':multer[_0x33a9('0x3a')]({'destination':function(_0x5dcffe,_0x37f757,_0x25f759){_0x25f759(null,path[_0x33a9('0x3b')](config[_0x33a9('0x3c')],_0x33a9('0x3d')));},'filename':function(_0x579f49,_0x318a66,_0x59179c){_0x59179c(null,util[_0x33a9('0x3e')](_0x33a9('0x3f'),Date['now'](),_0x318a66[_0x33a9('0x40')]));}})});router[_0x33a9('0x33')](_0x33a9('0x10'),upload[_0x33a9('0x41')](_0x33a9('0x42')),controller[_0x33a9('0x43')]);router[_0x33a9('0x33')](_0x33a9('0x44'),auth[_0x33a9('0x9')](),controller[_0x33a9('0x45')]);router[_0x33a9('0x33')](_0x33a9('0x46'),auth[_0x33a9('0x9')](),controller[_0x33a9('0x47')]);router[_0x33a9('0x33')](_0x33a9('0x48'),auth[_0x33a9('0x9')](),controller[_0x33a9('0x49')]);router[_0x33a9('0x33')](_0x33a9('0x4a'),auth[_0x33a9('0x9')](),controller[_0x33a9('0x4b')]);router['post'](_0x33a9('0x26'),auth[_0x33a9('0x9')](),controller['addTeams']);router[_0x33a9('0x33')](_0x33a9('0x4c'),auth[_0x33a9('0x9')](),controller['addChatInteractions']);router[_0x33a9('0x33')](_0x33a9('0x4d'),auth[_0x33a9('0x9')](),controller[_0x33a9('0x4e')]);router[_0x33a9('0x33')](_0x33a9('0x4f'),auth[_0x33a9('0x9')](),controller[_0x33a9('0x50')]);router[_0x33a9('0x33')](_0x33a9('0x51'),auth['isAuthenticated'](),controller['addSmsInteractions']);router[_0x33a9('0x33')](_0x33a9('0x52'),auth[_0x33a9('0x9')](),controller[_0x33a9('0x53')]);router[_0x33a9('0x33')](_0x33a9('0x54'),auth['isAuthenticated'](),controller[_0x33a9('0x55')]);router[_0x33a9('0x33')](_0x33a9('0x2b'),auth[_0x33a9('0x9')](),controller['addFaxAccounts']);router[_0x33a9('0x33')](_0x33a9('0x2c'),auth[_0x33a9('0x9')](),controller[_0x33a9('0x56')]);router['post'](_0x33a9('0x57'),auth[_0x33a9('0x9')](),controller[_0x33a9('0x58')]);router[_0x33a9('0x33')](_0x33a9('0x2e'),auth['isAuthenticated'](),controller[_0x33a9('0x59')]);router['post'](_0x33a9('0x5a'),auth[_0x33a9('0x9')](),controller['addChatWebsites']);router[_0x33a9('0x33')]('/:id/whatsapp_accounts',auth[_0x33a9('0x9')](),controller[_0x33a9('0x5b')]);router[_0x33a9('0x33')]('/:id/api_key',auth[_0x33a9('0x9')](),controller[_0x33a9('0x5c')]);router['put'](_0x33a9('0x5d'),auth[_0x33a9('0x9')](),controller['update']);router[_0x33a9('0x5e')](_0x33a9('0x5f'),auth['isAuthenticated'](),controller[_0x33a9('0x60')]);router[_0x33a9('0x61')]('/:id/queues',auth[_0x33a9('0x9')](),controller[_0x33a9('0x62')]);router[_0x33a9('0x61')](_0x33a9('0x26'),auth['isAuthenticated'](),controller[_0x33a9('0x63')]);router[_0x33a9('0x61')](_0x33a9('0x5d'),auth[_0x33a9('0x9')](),controller['destroy']);router[_0x33a9('0x61')]('/:id/chat_interactions',auth[_0x33a9('0x9')](),controller[_0x33a9('0x64')]);router[_0x33a9('0x61')](_0x33a9('0x4d'),auth[_0x33a9('0x9')](),controller[_0x33a9('0x65')]);router['delete'](_0x33a9('0x4f'),auth[_0x33a9('0x9')](),controller[_0x33a9('0x66')]);router[_0x33a9('0x61')](_0x33a9('0x51'),auth[_0x33a9('0x9')](),controller[_0x33a9('0x67')]);router[_0x33a9('0x61')](_0x33a9('0x52'),auth[_0x33a9('0x9')](),controller['removeOpenchannelInteractions']);router['delete'](_0x33a9('0x54'),auth[_0x33a9('0x9')](),controller[_0x33a9('0x68')]);router[_0x33a9('0x61')](_0x33a9('0x2b'),auth['isAuthenticated'](),controller[_0x33a9('0x69')]);router[_0x33a9('0x61')](_0x33a9('0x2c'),auth[_0x33a9('0x9')](),controller[_0x33a9('0x6a')]);router[_0x33a9('0x61')](_0x33a9('0x57'),auth['isAuthenticated'](),controller[_0x33a9('0x6b')]);router[_0x33a9('0x61')](_0x33a9('0x2e'),auth[_0x33a9('0x9')](),controller[_0x33a9('0x6c')]);router[_0x33a9('0x61')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0x33a9('0x6d')]);router[_0x33a9('0x61')](_0x33a9('0x30'),auth[_0x33a9('0x9')](),controller[_0x33a9('0x6e')]);router[_0x33a9('0x61')](_0x33a9('0x6f'),auth[_0x33a9('0x9')](),controller[_0x33a9('0x70')]);router['post'](_0x33a9('0x71'),auth[_0x33a9('0x9')](),controller[_0x33a9('0x72')]);module[_0x33a9('0x73')]=router; \ No newline at end of file +var _0x2041=['diskStorage','join','root','server/files/images/','%s-%s','now','originalname','single','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','addTeams','/:id/mail_interactions','/:id/fax_interactions','addSmsInteractions','/:id/openchannel_interactions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','/:id/sms_accounts','/:id/api_key','createApiKey','put','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','/:id/chat_interactions','removeChatInteractions','/:id/sms_interactions','removeSmsInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeChatWebsites','removeApiKey','/:id/messengerSoundNotification','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','/whoami','whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getRecordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/sms/interactions','getSmsInteractions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getScheduledCalls','post','addContacts','create','/create_many','bulkCreate','addQueues'];(function(_0x2a55f8,_0x540ac4){var _0x245efd=function(_0x4dbc19){while(--_0x4dbc19){_0x2a55f8['push'](_0x2a55f8['shift']());}};_0x245efd(++_0x540ac4);}(_0x2041,0x10d));var _0x1204=function(_0x10e34d,_0x568151){_0x10e34d=_0x10e34d-0x0;var _0x30a835=_0x2041[_0x10e34d];return _0x30a835;};'use strict';var multer=require(_0x1204('0x0'));var util=require(_0x1204('0x1'));var path=require('path');var timeout=require(_0x1204('0x2'));var express=require(_0x1204('0x3'));var router=express[_0x1204('0x4')]();var fs_extra=require(_0x1204('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1204('0x6'));var config=require(_0x1204('0x7'));var controller=require(_0x1204('0x8'));router[_0x1204('0x9')]('/',auth[_0x1204('0xa')](),controller[_0x1204('0xb')]);router[_0x1204('0x9')](_0x1204('0xc'),auth[_0x1204('0xa')](),controller['describe']);router[_0x1204('0x9')](_0x1204('0xd'),auth[_0x1204('0xa')](),controller[_0x1204('0xe')]);router[_0x1204('0x9')](_0x1204('0xf'),auth[_0x1204('0xa')](),controller[_0x1204('0x10')]);router[_0x1204('0x9')](_0x1204('0x11'),auth[_0x1204('0xa')](),controller[_0x1204('0x12')]);router[_0x1204('0x9')](_0x1204('0x13'),controller[_0x1204('0x14')]);router['get'](_0x1204('0x15'),auth[_0x1204('0xa')](),controller[_0x1204('0x16')]);router[_0x1204('0x9')](_0x1204('0x17'),auth['isAuthenticated'](),controller[_0x1204('0x18')]);router[_0x1204('0x9')](_0x1204('0x19'),auth['isAuthenticated'](),controller[_0x1204('0x1a')]);router[_0x1204('0x9')](_0x1204('0x1b'),auth[_0x1204('0xa')](),controller[_0x1204('0x1c')]);router[_0x1204('0x9')](_0x1204('0x1d'),auth['isAuthenticated'](),controller['getGroups']);router[_0x1204('0x9')]('/:id/recordings',auth[_0x1204('0xa')](),controller[_0x1204('0x1e')]);router[_0x1204('0x9')]('/:id/screen_recordings',auth[_0x1204('0xa')](),controller[_0x1204('0x1f')]);router['get'](_0x1204('0x20'),auth[_0x1204('0xa')](),controller[_0x1204('0x21')]);router['get'](_0x1204('0x22'),auth[_0x1204('0xa')](),controller[_0x1204('0x23')]);router['get']('/:id/mail/interactions',auth[_0x1204('0xa')](),controller['getMailInteractions']);router[_0x1204('0x9')](_0x1204('0x24'),auth['isAuthenticated'](),controller[_0x1204('0x25')]);router['get']('/:id/fax/interactions',auth[_0x1204('0xa')](),controller[_0x1204('0x26')]);router[_0x1204('0x9')](_0x1204('0x27'),auth[_0x1204('0xa')](),controller[_0x1204('0x28')]);router['get'](_0x1204('0x29'),auth[_0x1204('0xa')](),controller[_0x1204('0x2a')]);router[_0x1204('0x9')](_0x1204('0x2b'),auth[_0x1204('0xa')](),controller[_0x1204('0x2c')]);router['get']('/:id/agents',auth[_0x1204('0xa')](),controller[_0x1204('0x2d')]);router['get'](_0x1204('0x2e'),auth[_0x1204('0xa')](),controller[_0x1204('0x2f')]);router[_0x1204('0x9')](_0x1204('0x30'),auth[_0x1204('0xa')](),controller[_0x1204('0x31')]);router['get'](_0x1204('0x32'),auth[_0x1204('0xa')](),controller[_0x1204('0x33')]);router[_0x1204('0x9')](_0x1204('0x34'),auth[_0x1204('0xa')](),controller[_0x1204('0x35')]);router[_0x1204('0x9')]('/:id/sms_accounts',auth[_0x1204('0xa')](),controller['getSmsAccounts']);router[_0x1204('0x9')](_0x1204('0x36'),auth['isAuthenticated'](),controller[_0x1204('0x37')]);router[_0x1204('0x9')](_0x1204('0x38'),auth[_0x1204('0xa')](),controller['getWhatsappAccounts']);router[_0x1204('0x9')]('/:id/scheduled_calls',auth['isAuthenticated'](),controller[_0x1204('0x39')]);router[_0x1204('0x9')]('/:id/api_key',auth[_0x1204('0xa')](),controller['getApiKey']);router[_0x1204('0x3a')](_0x1204('0x17'),auth[_0x1204('0xa')](),controller[_0x1204('0x3b')]);router[_0x1204('0x3a')]('/',auth[_0x1204('0xa')](),controller[_0x1204('0x3c')]);router[_0x1204('0x3a')](_0x1204('0x3d'),auth[_0x1204('0xa')](),controller[_0x1204('0x3e')]);router[_0x1204('0x3a')](_0x1204('0x19'),auth[_0x1204('0xa')](),controller[_0x1204('0x3f')]);var upload=multer({'storage':multer[_0x1204('0x40')]({'destination':function(_0x450a3f,_0x27e42d,_0x520dae){_0x520dae(null,path[_0x1204('0x41')](config[_0x1204('0x42')],_0x1204('0x43')));},'filename':function(_0x44c4be,_0x4f4997,_0xf3e1f3){_0xf3e1f3(null,util['format'](_0x1204('0x44'),Date[_0x1204('0x45')](),_0x4f4997[_0x1204('0x46')]));}})});router[_0x1204('0x3a')](_0x1204('0x13'),upload[_0x1204('0x47')](_0x1204('0x48')),controller[_0x1204('0x49')]);router[_0x1204('0x3a')](_0x1204('0x4a'),auth[_0x1204('0xa')](),controller[_0x1204('0x4b')]);router['post'](_0x1204('0x4c'),auth[_0x1204('0xa')](),controller[_0x1204('0x4d')]);router['post'](_0x1204('0x4e'),auth['isAuthenticated'](),controller[_0x1204('0x4f')]);router[_0x1204('0x3a')]('/:id/unpause',auth[_0x1204('0xa')](),controller['unpause']);router['post'](_0x1204('0x29'),auth[_0x1204('0xa')](),controller[_0x1204('0x50')]);router[_0x1204('0x3a')]('/:id/chat_interactions',auth[_0x1204('0xa')](),controller['addChatInteractions']);router[_0x1204('0x3a')](_0x1204('0x51'),auth[_0x1204('0xa')](),controller['addMailInteractions']);router[_0x1204('0x3a')](_0x1204('0x52'),auth[_0x1204('0xa')](),controller['addFaxInteractions']);router[_0x1204('0x3a')]('/:id/sms_interactions',auth['isAuthenticated'](),controller[_0x1204('0x53')]);router[_0x1204('0x3a')](_0x1204('0x54'),auth[_0x1204('0xa')](),controller['addOpenchannelInteractions']);router[_0x1204('0x3a')](_0x1204('0x55'),auth[_0x1204('0xa')](),controller[_0x1204('0x56')]);router[_0x1204('0x3a')]('/:id/fax_accounts',auth[_0x1204('0xa')](),controller[_0x1204('0x57')]);router[_0x1204('0x3a')](_0x1204('0x32'),auth[_0x1204('0xa')](),controller[_0x1204('0x58')]);router[_0x1204('0x3a')]('/:id/openchannel_accounts',auth[_0x1204('0xa')](),controller['addOpenchannelAccounts']);router[_0x1204('0x3a')](_0x1204('0x59'),auth[_0x1204('0xa')](),controller['addSmsAccounts']);router[_0x1204('0x3a')](_0x1204('0x36'),auth[_0x1204('0xa')](),controller['addChatWebsites']);router[_0x1204('0x3a')](_0x1204('0x38'),auth['isAuthenticated'](),controller['addWhatsappAccounts']);router[_0x1204('0x3a')](_0x1204('0x5a'),auth[_0x1204('0xa')](),controller[_0x1204('0x5b')]);router[_0x1204('0x5c')](_0x1204('0x11'),auth[_0x1204('0xa')](),controller['update']);router[_0x1204('0x5c')](_0x1204('0x5d'),auth[_0x1204('0xa')](),controller[_0x1204('0x5e')]);router[_0x1204('0x5f')]('/:id/queues',auth[_0x1204('0xa')](),controller[_0x1204('0x60')]);router[_0x1204('0x5f')](_0x1204('0x29'),auth[_0x1204('0xa')](),controller[_0x1204('0x61')]);router['delete'](_0x1204('0x11'),auth[_0x1204('0xa')](),controller[_0x1204('0x62')]);router[_0x1204('0x5f')](_0x1204('0x63'),auth[_0x1204('0xa')](),controller[_0x1204('0x64')]);router['delete']('/:id/mail_interactions',auth['isAuthenticated'](),controller['removeMailInteractions']);router['delete'](_0x1204('0x52'),auth[_0x1204('0xa')](),controller['removeFaxInteractions']);router[_0x1204('0x5f')](_0x1204('0x65'),auth[_0x1204('0xa')](),controller[_0x1204('0x66')]);router[_0x1204('0x5f')](_0x1204('0x54'),auth['isAuthenticated'](),controller['removeOpenchannelInteractions']);router['delete']('/:id/whatsapp_interactions',auth[_0x1204('0xa')](),controller[_0x1204('0x67')]);router['delete'](_0x1204('0x30'),auth[_0x1204('0xa')](),controller[_0x1204('0x68')]);router[_0x1204('0x5f')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0x1204('0x69')]);router[_0x1204('0x5f')](_0x1204('0x34'),auth[_0x1204('0xa')](),controller[_0x1204('0x6a')]);router[_0x1204('0x5f')](_0x1204('0x59'),auth[_0x1204('0xa')](),controller['removeSmsAccounts']);router[_0x1204('0x5f')](_0x1204('0x36'),auth['isAuthenticated'](),controller[_0x1204('0x6b')]);router[_0x1204('0x5f')](_0x1204('0x38'),auth[_0x1204('0xa')](),controller['removeWhatsappAccounts']);router[_0x1204('0x5f')](_0x1204('0x5a'),auth['isAuthenticated'](),controller[_0x1204('0x6c')]);router[_0x1204('0x3a')](_0x1204('0x6d'),auth['isAuthenticated'](),controller['messengerSoundNotification']);module[_0x1204('0x6e')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 2dca7ee..ebcac8d 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 _0x5d71=['\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','active','passive','TEXT','get','isArray','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','actpass','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','moment','util','lodash','exports','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','STRING','format','\x22%s\x22\x20<%s>','email','toLowerCase','ENUM','admin','user','agent','telephone','local','INTEGER','internal','callerid','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','friend','peer','from-sip','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','auto','rfc2833','yes','nonat','update','outgoing','force_rport,comedia','nat','join','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x5d71,0x1a6));var _0x15d7=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x5d71[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0x15d7('0x0'));var moment=require(_0x15d7('0x1'));var util=require(_0x15d7('0x2'));var _=require(_0x15d7('0x3'));module[_0x15d7('0x4')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x15d7('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x31fa25){this[_0x15d7('0x6')](_0x15d7('0x5'),_0x31fa25);this[_0x15d7('0x6')](_0x15d7('0x7'),_0x31fa25);},'comment':_0x15d7('0x8')},'fullname':{'type':Sequelize[_0x15d7('0x9')],'allowNull':![],'set':function(_0x16a1b0){this[_0x15d7('0x6')]('fullname',_0x16a1b0);this['setDataValue']('callerid',util[_0x15d7('0xa')](_0x15d7('0xb'),_0x16a1b0,this['getDataValue']('internal')));}},'alias':{'type':Sequelize[_0x15d7('0x9')]},'email':{'type':Sequelize[_0x15d7('0x9')],'allowNull':![],'unique':_0x15d7('0xc'),'validate':{'isEmail':!![]},'set':function(_0x709f8e){if(_0x709f8e){this[_0x15d7('0x6')](_0x15d7('0xc'),_0x709f8e[_0x15d7('0xd')]());}}},'role':{'type':Sequelize[_0x15d7('0xe')](_0x15d7('0xf'),_0x15d7('0x10'),_0x15d7('0x11'),_0x15d7('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0x15d7('0x9')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x15d7('0x13')},'internal':{'type':Sequelize[_0x15d7('0x14')](0xb),'allowNull':![],'unique':_0x15d7('0x15'),'set':function(_0x5479ad){this[_0x15d7('0x6')](_0x15d7('0x15'),_0x5479ad);this[_0x15d7('0x6')]('accountcode',_0x5479ad);this[_0x15d7('0x6')](_0x15d7('0x16'),util[_0x15d7('0xa')](_0x15d7('0xb'),this['getDataValue'](_0x15d7('0x17')),_0x5479ad));}},'salt':{'type':Sequelize[_0x15d7('0x9')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x15d7('0x9')]},'address':{'type':Sequelize[_0x15d7('0x9')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x15d7('0x9')]},'country':{'type':Sequelize[_0x15d7('0x9')]},'online':{'type':Sequelize[_0x15d7('0x18')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x15d7('0x19')]},'voicePause':{'type':Sequelize[_0x15d7('0x18')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x15d7('0x18')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x15d7('0x18')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x15d7('0x18')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x15d7('0x18')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x15d7('0x18')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x15d7('0x9')],'defaultValue':_0x15d7('0x1a')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x15d7('0x14')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x15d7('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x15d7('0x14')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x15d7('0x14')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x15d7('0x18')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x15d7('0x18')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x15d7('0x14')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x15d7('0x14')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x15d7('0x18')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x15d7('0x14')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x15d7('0x18')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x15d7('0x18')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x15d7('0x18')],'defaultValue':![]},'description':{'type':Sequelize[_0x15d7('0x9')],'allowNull':!![]},'host':{'type':Sequelize[_0x15d7('0x9')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x15d7('0x9')],'allowNull':!![]},'port':{'type':Sequelize[_0x15d7('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x15d7('0x14')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x15d7('0x9')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x15d7('0x9')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x15d7('0x9')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x15d7('0x14')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x15d7('0xe')](_0x15d7('0x1b'),'user',_0x15d7('0x1c')),'allowNull':!![],'defaultValue':_0x15d7('0x1b')},'context':{'type':Sequelize[_0x15d7('0x9')],'allowNull':!![],'defaultValue':_0x15d7('0x1d')},'callingpres':{'type':Sequelize['ENUM']('ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN',_0x15d7('0x1e'),_0x15d7('0x1f'),_0x15d7('0x20'),_0x15d7('0x21'),_0x15d7('0x22'),_0x15d7('0x23')),'allowNull':!![]},'deny':{'type':Sequelize[_0x15d7('0x9')],'allowNull':!![]},'permit':{'type':Sequelize[_0x15d7('0x9')],'allowNull':!![]},'secret':{'type':Sequelize[_0x15d7('0x9')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x15d7('0x9')],'allowNull':!![]},'transport':{'type':Sequelize[_0x15d7('0x9')],'allowNull':!![],'defaultValue':_0x15d7('0x24'),'set':function(_0x48da5a){this[_0x15d7('0x6')](_0x15d7('0x25'),_0x48da5a?_0x48da5a['join'](','):null);},'get':function(){return this[_0x15d7('0x26')](_0x15d7('0x25'))?this[_0x15d7('0x26')]('transport')[_0x15d7('0x27')](','):null;},'comment':_0x15d7('0x28')},'dtmfmode':{'type':Sequelize[_0x15d7('0xe')]('rfc2833',_0x15d7('0x29'),_0x15d7('0x2a'),_0x15d7('0x2b'),_0x15d7('0x2c')),'allowNull':!![],'defaultValue':_0x15d7('0x2d')},'directmedia':{'type':Sequelize[_0x15d7('0xe')](_0x15d7('0x2e'),'no',_0x15d7('0x2f'),_0x15d7('0x30'),_0x15d7('0x31')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x15d7('0xe')](_0x15d7('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x15d7('0x9')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x15d7('0x32'),'set':function(_0x19ded0){this['setDataValue'](_0x15d7('0x33'),_0x19ded0?_0x19ded0[_0x15d7('0x34')](','):null);},'get':function(){return this[_0x15d7('0x26')](_0x15d7('0x33'))?this[_0x15d7('0x26')](_0x15d7('0x33'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x15d7('0x9')]},'pickupgroup':{'type':Sequelize[_0x15d7('0x9')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x15d7('0x9')]},'disallow':{'type':Sequelize[_0x15d7('0x9')],'allowNull':![],'defaultValue':_0x15d7('0x35')},'allow':{'type':Sequelize[_0x15d7('0x9')],'allowNull':![],'defaultValue':_0x15d7('0x36'),'set':function(_0x17b6e1){this['setDataValue']('allow',_0x17b6e1?_0x17b6e1[_0x15d7('0x34')](';'):_0x15d7('0x36'));},'get':function(){return this['getDataValue'](_0x15d7('0x37'))?this['getDataValue'](_0x15d7('0x37'))[_0x15d7('0x27')](';'):null;},'comment':_0x15d7('0x38')},'autoframing':{'type':Sequelize[_0x15d7('0xe')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x1251c3){this[_0x15d7('0x6')](_0x15d7('0x39'),_0x1251c3?_0x1251c3[_0x15d7('0x34')](','):null);},'get':function(){return this['getDataValue']('insecure')?this[_0x15d7('0x26')](_0x15d7('0x39'))[_0x15d7('0x27')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM'](_0x15d7('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x15d7('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x15d7('0xe')]('yes','no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0x15d7('0x2e'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x15d7('0xe')](_0x15d7('0x2e'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x15d7('0x14')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x15d7('0x9')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x15d7('0x9')],'allowNull':!![],'defaultValue':_0x15d7('0x3a')},'amaflags':{'type':Sequelize[_0x15d7('0x9')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0x15d7('0x2e'),'no'),'allowNull':!![],'defaultValue':_0x15d7('0x2e')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0x15d7('0x2e'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x15d7('0xe')]('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x15d7('0xe')](_0x15d7('0x2e'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x15d7('0xe')](_0x15d7('0x2e'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x15d7('0x9')],'allowNull':!![]},'template':{'type':Sequelize[_0x15d7('0x9')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x15d7('0xe')](_0x15d7('0x2e'),'no',_0x15d7('0x3b')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x15d7('0x14')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x15d7('0xe')](_0x15d7('0x2e'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x15d7('0x9')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x15d7('0xe')](_0x15d7('0x3c'),_0x15d7('0x3d'),_0x15d7('0x3e')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x15d7('0xe')](_0x15d7('0x3f'),_0x15d7('0x40')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x15d7('0x9')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x15d7('0x9')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x15d7('0x9')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x15d7('0x9')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x15d7('0xe')](_0x15d7('0x2e'),'no'),'allowNull':!![],'defaultValue':_0x15d7('0x2e')},'keepalive':{'type':Sequelize[_0x15d7('0x14')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x15d7('0x9')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x15d7('0x9')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x15d7('0x14')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x15d7('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x15d7('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x15d7('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x15d7('0x9')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x15d7('0x9')],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x15d7('0x14')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x15d7('0x9')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x15d7('0x9')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x15d7('0x9')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x15d7('0x9')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x15d7('0xe')](_0x15d7('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x15d7('0xe')](_0x15d7('0x2e'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x15d7('0x2e'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x15d7('0xe')](_0x15d7('0x2e'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x15d7('0xe')](_0x15d7('0x2e'),'no',_0x15d7('0x41'),_0x15d7('0x42')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x15d7('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x15d7('0x9')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x15d7('0x9')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x15d7('0x9')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x15d7('0x9')],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM'](_0x15d7('0x43'),_0x15d7('0x44'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x15d7('0x9')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x15d7('0xe')](_0x15d7('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x15d7('0x9')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x15d7('0x9')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x15d7('0x14')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x15d7('0xe')](_0x15d7('0x2e'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0x15d7('0x2e'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x15d7('0x9')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x15d7('0x9')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x15d7('0x9')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x15d7('0x9')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x15d7('0xe')](_0x15d7('0x2e'),'no',_0x15d7('0x2f'),'update','update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x15d7('0x9')]},'resetPasswordExpires':{'type':Sequelize[_0x15d7('0x19')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x15d7('0x45')]},'showWebBar':{'type':Sequelize[_0x15d7('0x14')],'defaultValue':0x0,'set':function(_0x5849b9){this[_0x15d7('0x6')]('showWebBar',_0x5849b9);var _0x2fd3fa=this[_0x15d7('0x46')]({'plain':!![]});switch(_0x5849b9){case 0x0:case 0x1:var _0x42a4d4=_0x2fd3fa[_0x15d7('0x25')]?_[_0x15d7('0x47')](_0x2fd3fa[_0x15d7('0x25')])?_0x2fd3fa[_0x15d7('0x25')]['join']():_0x2fd3fa[_0x15d7('0x25')]:_0x15d7('0x24');if(_0x42a4d4==='wss'){_0x42a4d4=_0x15d7('0x24');}this[_0x15d7('0x6')](_0x15d7('0x25'),_0x42a4d4);this['setDataValue'](_0x15d7('0x48'),'no');this[_0x15d7('0x6')](_0x15d7('0x49'),null);this[_0x15d7('0x6')](_0x15d7('0x4a'),null);this[_0x15d7('0x6')](_0x15d7('0x4b'),null);this[_0x15d7('0x6')](_0x15d7('0x4c'),null);this[_0x15d7('0x6')](_0x15d7('0x4d'),null);this[_0x15d7('0x6')](_0x15d7('0x4e'),null);this[_0x15d7('0x6')](_0x15d7('0x4f'),null);this['setDataValue']('dtlsprivatekey',null);this[_0x15d7('0x6')]('rtcp_mux','no');break;case 0x2:this[_0x15d7('0x6')](_0x15d7('0x25'),'wss');this['setDataValue'](_0x15d7('0x48'),_0x15d7('0x2e'));this[_0x15d7('0x6')](_0x15d7('0x49'),'yes');this[_0x15d7('0x6')]('force_avp',_0x15d7('0x2e'));this[_0x15d7('0x6')]('icesupport',_0x15d7('0x2e'));this[_0x15d7('0x6')](_0x15d7('0x4c'),_0x15d7('0x2e'));this[_0x15d7('0x6')](_0x15d7('0x4d'),'no');this[_0x15d7('0x6')](_0x15d7('0x4e'),_0x15d7('0x50'));this[_0x15d7('0x6')]('dtlscertfile',_0x2fd3fa[_0x15d7('0x4f')]||_0x15d7('0x51'));this[_0x15d7('0x6')](_0x15d7('0x52'),_0x2fd3fa['dtlsprivatekey']||_0x15d7('0x53'));this[_0x15d7('0x6')]('rtcp_mux','yes');break;default:}}},'permissions':{'type':Sequelize[_0x15d7('0x45')],'set':function(_0x154377){this[_0x15d7('0x6')](_0x15d7('0x54'),_0x154377?_0x154377[_0x15d7('0x34')](','):[]);},'get':function(){return this[_0x15d7('0x26')](_0x15d7('0x54'))?_[_0x15d7('0x55')](this[_0x15d7('0x26')]('permissions')['split'](','),function(_0x4d028b){return parseInt(_0x4d028b,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x15d7('0x9')]},'phoneBarBusyNumber':{'type':Sequelize[_0x15d7('0x9')]},'phoneBarUnconditional':{'type':Sequelize[_0x15d7('0x18')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x15d7('0x18')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x15d7('0x18')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x15d7('0x18')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x15d7('0x9')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x15d7('0x14')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x15d7('0xe')](_0x15d7('0x2e'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x15d7('0x18')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x15d7('0x9')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x15d7('0x18')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x15d7('0x56')],'get':function(){return this[_0x15d7('0x26')]('phoneBarEnableScreenRecordingByAgent')?this[_0x15d7('0x26')](_0x15d7('0x57')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x15d7('0x18')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x15d7('0x18')],'defaultValue':![]},'interface':{'type':Sequelize[_0x15d7('0x9')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x15d7('0x18')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x15d7('0x9')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x15d7('0x18')],'defaultValue':![],'set':function(_0x2fb48f){if(typeof _0x2fb48f===_0x15d7('0x58')){var _0x1b3f53=_0x2fb48f==='1'?!![]:_0x2fb48f==='0'?![]:_0x2fb48f===_0x15d7('0x59')?!![]:_0x2fb48f===_0x15d7('0x5a')?![]:![];this[_0x15d7('0x6')](_0x15d7('0x5b'),_0x1b3f53);}else{this['setDataValue'](_0x15d7('0x5b'),_0x2fb48f);}}},'blocked':{'type':Sequelize[_0x15d7('0x18')],'defaultValue':![],'set':function(_0x4e4536){this[_0x15d7('0x6')](_0x15d7('0x5c'),_0x4e4536);if(_0x4e4536===!![]){this['setDataValue'](_0x15d7('0x5d'),moment());this[_0x15d7('0x6')](_0x15d7('0x5e'),0x0);}else{this[_0x15d7('0x6')](_0x15d7('0x5d'),null);}}},'blockedAt':{'type':Sequelize[_0x15d7('0x19')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x15d7('0x14')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x15d7('0x18')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x15d7('0x18')],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)[_0x15d7('0x5f')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x15d7('0x18')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x15d7('0x18')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x15d7('0x18')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x15d7('0x18')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x15d7('0x18')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x15d7('0x18')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x15d7('0x18')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x15d7('0x14')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x15d7('0x18')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x15d7('0x14')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x15d7('0x18')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x15d7('0x14')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x15d7('0x14')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x15d7('0x18')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x15d7('0x14')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x15d7('0x14')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0x15d7('0x18')],'defaultValue':![]}}; \ No newline at end of file +var _0xd099=['/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','screenrecording','blocked','blockedAt','UNSIGNED','sequelize','util','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','email','toLowerCase','user','agent','telephone','local','internal','accountcode','BOOLEAN','DEFAULT\x20PAUSE','INTEGER','ENUM','friend','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','inband','auto','nonat','update','yes','nat','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','always','accept','refuse','originate','uac','uas','fingerprint','certificate','active','passive','actpass','update,nonat','DATE','TEXT','showWebBar','get','isArray','wss','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','/etc/pki/tls/certs/motion.crt'];(function(_0x5368c4,_0x6aef2b){var _0xe18947=function(_0x3df890){while(--_0x3df890){_0x5368c4['push'](_0x5368c4['shift']());}};_0xe18947(++_0x6aef2b);}(_0xd099,0xc2));var _0x9d09=function(_0x598b5d,_0x3f4d1e){_0x598b5d=_0x598b5d-0x0;var _0x54ab06=_0xd099[_0x598b5d];return _0x54ab06;};'use strict';var Sequelize=require(_0x9d09('0x0'));var moment=require('moment');var util=require(_0x9d09('0x1'));var _=require(_0x9d09('0x2'));module[_0x9d09('0x3')]={'name':{'type':Sequelize[_0x9d09('0x4')],'allowNull':![],'unique':_0x9d09('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x18cd50){this[_0x9d09('0x6')](_0x9d09('0x5'),_0x18cd50);this[_0x9d09('0x6')](_0x9d09('0x7'),_0x18cd50);},'comment':_0x9d09('0x8')},'fullname':{'type':Sequelize[_0x9d09('0x4')],'allowNull':![],'set':function(_0x1cc003){this[_0x9d09('0x6')](_0x9d09('0x9'),_0x1cc003);this[_0x9d09('0x6')](_0x9d09('0xa'),util[_0x9d09('0xb')](_0x9d09('0xc'),_0x1cc003,this[_0x9d09('0xd')]('internal')));}},'alias':{'type':Sequelize[_0x9d09('0x4')]},'email':{'type':Sequelize[_0x9d09('0x4')],'allowNull':![],'unique':_0x9d09('0xe'),'validate':{'isEmail':!![]},'set':function(_0x55d5c0){if(_0x55d5c0){this[_0x9d09('0x6')](_0x9d09('0xe'),_0x55d5c0[_0x9d09('0xf')]());}}},'role':{'type':Sequelize['ENUM']('admin',_0x9d09('0x10'),_0x9d09('0x11'),_0x9d09('0x12')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x9d09('0x13')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0x9d09('0x14'),'set':function(_0x3039a0){this[_0x9d09('0x6')](_0x9d09('0x14'),_0x3039a0);this[_0x9d09('0x6')](_0x9d09('0x15'),_0x3039a0);this['setDataValue'](_0x9d09('0xa'),util['format']('\x22%s\x22\x20<%s>',this[_0x9d09('0xd')]('fullname'),_0x3039a0));}},'salt':{'type':Sequelize[_0x9d09('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0x9d09('0x4')]},'userpic':{'type':Sequelize[_0x9d09('0x4')]},'city':{'type':Sequelize[_0x9d09('0x4')]},'country':{'type':Sequelize[_0x9d09('0x4')]},'online':{'type':Sequelize[_0x9d09('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0x9d09('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x9d09('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x9d09('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x9d09('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x9d09('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x9d09('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x9d09('0x4')],'defaultValue':_0x9d09('0x17')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x9d09('0x18')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x9d09('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x9d09('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x9d09('0x18')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x9d09('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x9d09('0x18')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x9d09('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x9d09('0x16')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x9d09('0x16')],'defaultValue':![]},'description':{'type':Sequelize[_0x9d09('0x4')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x9d09('0x4')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x9d09('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x9d09('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0x9d09('0x18')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x9d09('0x19')]('friend','user','peer'),'allowNull':!![],'defaultValue':_0x9d09('0x1a')},'context':{'type':Sequelize[_0x9d09('0x4')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize['ENUM']('ALLOWED_NOT_SCREENED',_0x9d09('0x1b'),_0x9d09('0x1c'),_0x9d09('0x1d'),'PROHIB_NOT_SCREENED',_0x9d09('0x1e'),_0x9d09('0x1f'),_0x9d09('0x20')),'allowNull':!![]},'deny':{'type':Sequelize[_0x9d09('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0x9d09('0x4')],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x9d09('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x9d09('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x9d09('0x4')],'allowNull':!![],'defaultValue':_0x9d09('0x21'),'set':function(_0x4e2c09){this['setDataValue']('transport',_0x4e2c09?_0x4e2c09['join'](','):null);},'get':function(){return this[_0x9d09('0xd')](_0x9d09('0x22'))?this[_0x9d09('0xd')](_0x9d09('0x22'))['split'](','):null;},'comment':_0x9d09('0x23')},'dtmfmode':{'type':Sequelize['ENUM'](_0x9d09('0x24'),_0x9d09('0x25'),'shortinfo',_0x9d09('0x26'),_0x9d09('0x27')),'allowNull':!![],'defaultValue':_0x9d09('0x24')},'directmedia':{'type':Sequelize[_0x9d09('0x19')]('yes','no',_0x9d09('0x28'),_0x9d09('0x29'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x9d09('0x19')](_0x9d09('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x9d09('0x4')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x49b185){this[_0x9d09('0x6')](_0x9d09('0x2b'),_0x49b185?_0x49b185[_0x9d09('0x2c')](','):null);},'get':function(){return this[_0x9d09('0xd')](_0x9d09('0x2b'))?this[_0x9d09('0xd')](_0x9d09('0x2b'))[_0x9d09('0x2d')](','):null;},'comment':_0x9d09('0x2e')},'callgroup':{'type':Sequelize[_0x9d09('0x4')]},'namedcallgroup':{'type':Sequelize[_0x9d09('0x4')]},'pickupgroup':{'type':Sequelize[_0x9d09('0x4')]},'namedpickupgroup':{'type':Sequelize[_0x9d09('0x4')]},'language':{'type':Sequelize[_0x9d09('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x9d09('0x4')],'allowNull':![],'defaultValue':_0x9d09('0x2f')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9d09('0x30'),'set':function(_0x5cc25f){this[_0x9d09('0x6')](_0x9d09('0x31'),_0x5cc25f?_0x5cc25f[_0x9d09('0x2c')](';'):_0x9d09('0x30'));},'get':function(){return this[_0x9d09('0xd')](_0x9d09('0x31'))?this[_0x9d09('0xd')](_0x9d09('0x31'))[_0x9d09('0x2d')](';'):null;},'comment':_0x9d09('0x32')},'autoframing':{'type':Sequelize[_0x9d09('0x19')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x9d09('0x4')],'allowNull':!![],'set':function(_0x37e9e0){this['setDataValue'](_0x9d09('0x33'),_0x37e9e0?_0x37e9e0['join'](','):null);},'get':function(){return this[_0x9d09('0xd')](_0x9d09('0x33'))?this[_0x9d09('0xd')](_0x9d09('0x33'))[_0x9d09('0x2d')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x9d09('0x19')](_0x9d09('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x9d09('0x19')](_0x9d09('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x9d09('0x2a'),'no',_0x9d09('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x9d09('0x19')](_0x9d09('0x2a'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x9d09('0x2a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x9d09('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x9d09('0x4')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x9d09('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x9d09('0x18')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0x9d09('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x9d09('0x19')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x9d09('0x19')](_0x9d09('0x2a'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x9d09('0x19')](_0x9d09('0x2a'),'no',_0x9d09('0x35')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x9d09('0x18')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x9d09('0x19')](_0x9d09('0x2a'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x9d09('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x9d09('0x36'),_0x9d09('0x37'),_0x9d09('0x38')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x9d09('0x18')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0x9d09('0x39'),_0x9d09('0x3a')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x9d09('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x9d09('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x9d09('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x9d09('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x9d09('0x19')](_0x9d09('0x2a'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x9d09('0x18')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x9d09('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x9d09('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x9d09('0x18')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x9d09('0x18')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x9d09('0x19')](_0x9d09('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x9d09('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x9d09('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x9d09('0x18')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x9d09('0x18')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x9d09('0x18')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x9d09('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x9d09('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x9d09('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x9d09('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x9d09('0x18')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x9d09('0x19')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x9d09('0x19')](_0x9d09('0x2a'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x9d09('0x19')](_0x9d09('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x9d09('0x19')](_0x9d09('0x2a'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x9d09('0x19')](_0x9d09('0x2a'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x9d09('0x19')](_0x9d09('0x2a'),'no',_0x9d09('0x3b'),_0x9d09('0x3c')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x9d09('0x18')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x9d09('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x9d09('0x19')](_0x9d09('0x3d'),_0x9d09('0x3e'),_0x9d09('0x3f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x9d09('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x9d09('0x19')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x9d09('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x9d09('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x9d09('0x18')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x9d09('0x19')](_0x9d09('0x2a'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x9d09('0x19')](_0x9d09('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x9d09('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x9d09('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x9d09('0x19')]('yes','no',_0x9d09('0x28'),'update',_0x9d09('0x40')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x9d09('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x9d09('0x41')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x9d09('0x42')]},'showWebBar':{'type':Sequelize[_0x9d09('0x18')],'defaultValue':0x0,'set':function(_0x5c7259){this[_0x9d09('0x6')](_0x9d09('0x43'),_0x5c7259);var _0x2b7bbf=this[_0x9d09('0x44')]({'plain':!![]});switch(_0x5c7259){case 0x0:case 0x1:var _0x2eaaca=_0x2b7bbf[_0x9d09('0x22')]?_[_0x9d09('0x45')](_0x2b7bbf['transport'])?_0x2b7bbf[_0x9d09('0x22')][_0x9d09('0x2c')]():_0x2b7bbf['transport']:'udp';if(_0x2eaaca===_0x9d09('0x46')){_0x2eaaca='udp';}this[_0x9d09('0x6')](_0x9d09('0x22'),_0x2eaaca);this['setDataValue'](_0x9d09('0x47'),'no');this['setDataValue'](_0x9d09('0x48'),null);this[_0x9d09('0x6')](_0x9d09('0x49'),null);this['setDataValue'](_0x9d09('0x4a'),null);this[_0x9d09('0x6')](_0x9d09('0x4b'),null);this[_0x9d09('0x6')](_0x9d09('0x4c'),null);this[_0x9d09('0x6')](_0x9d09('0x4d'),null);this[_0x9d09('0x6')](_0x9d09('0x4e'),null);this[_0x9d09('0x6')](_0x9d09('0x4f'),null);this[_0x9d09('0x6')](_0x9d09('0x50'),'no');break;case 0x2:this[_0x9d09('0x6')]('transport',_0x9d09('0x46'));this[_0x9d09('0x6')](_0x9d09('0x47'),_0x9d09('0x2a'));this[_0x9d09('0x6')](_0x9d09('0x48'),_0x9d09('0x2a'));this[_0x9d09('0x6')](_0x9d09('0x49'),_0x9d09('0x2a'));this[_0x9d09('0x6')](_0x9d09('0x4a'),_0x9d09('0x2a'));this[_0x9d09('0x6')](_0x9d09('0x4b'),_0x9d09('0x2a'));this[_0x9d09('0x6')]('dtlsverify','no');this[_0x9d09('0x6')](_0x9d09('0x4d'),'actpass');this[_0x9d09('0x6')](_0x9d09('0x4e'),_0x2b7bbf[_0x9d09('0x4e')]||_0x9d09('0x51'));this[_0x9d09('0x6')](_0x9d09('0x4f'),_0x2b7bbf['dtlsprivatekey']||_0x9d09('0x52'));this[_0x9d09('0x6')]('rtcp_mux',_0x9d09('0x2a'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x1824b2){this[_0x9d09('0x6')](_0x9d09('0x53'),_0x1824b2?_0x1824b2['join'](','):[]);},'get':function(){return this['getDataValue'](_0x9d09('0x53'))?_[_0x9d09('0x54')](this[_0x9d09('0xd')](_0x9d09('0x53'))[_0x9d09('0x2d')](','),function(_0x378913){return parseInt(_0x378913,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x9d09('0x4')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0x9d09('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x9d09('0x16')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x9d09('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x9d09('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x9d09('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x9d09('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x9d09('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x9d09('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x9d09('0x55')],'get':function(){return this[_0x9d09('0xd')](_0x9d09('0x56'))?this[_0x9d09('0xd')](_0x9d09('0x56')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x9d09('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x9d09('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x9d09('0x16')],'defaultValue':![]},'interface':{'type':Sequelize[_0x9d09('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x9d09('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x9d09('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x9d09('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x9d09('0x16')],'defaultValue':![],'set':function(_0x97a3d6){if(typeof _0x97a3d6===_0x9d09('0x57')){var _0x45346=_0x97a3d6==='1'?!![]:_0x97a3d6==='0'?![]:_0x97a3d6==='true'?!![]:_0x97a3d6==='false'?![]:![];this[_0x9d09('0x6')](_0x9d09('0x58'),_0x45346);}else{this[_0x9d09('0x6')](_0x9d09('0x58'),_0x97a3d6);}}},'blocked':{'type':Sequelize[_0x9d09('0x16')],'defaultValue':![],'set':function(_0x398ffb){this[_0x9d09('0x6')](_0x9d09('0x59'),_0x398ffb);if(_0x398ffb===!![]){this[_0x9d09('0x6')]('blockedAt',moment());this[_0x9d09('0x6')]('loginAttempts',0x0);}else{this[_0x9d09('0x6')](_0x9d09('0x5a'),null);}}},'blockedAt':{'type':Sequelize[_0x9d09('0x41')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x9d09('0x18')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x9d09('0x16')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x9d09('0x18')](0x5)[_0x9d09('0x5b')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x9d09('0x16')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x9d09('0x16')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x9d09('0x16')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x9d09('0x16')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x9d09('0x16')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x9d09('0x18')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x9d09('0x16')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x9d09('0x16')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x9d09('0x18')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x9d09('0x16')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x9d09('0x18')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x9d09('0x16')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x9d09('0x18')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0x9d09('0x16')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index c456c85..1b3fad7 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 _0x2e4d=['100','111','114','115','user','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','create','UserProfileSection','Agents','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','map','compact','UserProfileResource','changePassword','oldPassword','newPassword','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Sequelize','Wrong\x20credentials','Invalid\x20body\x20format.\x20Use\x20newPassword','Setting','findOne','enforcePasswordHistory','previousPasswords','validatePasswordHistory','passwordHistoryLimit','online','loginInPause','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','Queues','penalty','spread','QueueId','emit','Queue:save','format','SIP/%s','voicePause','UserVoiceQueueRt','upsert','removeQueues','channel','Queue:remove','voice','addAvatar','filename','join','root','server/files/images/logos/default_profile.png','userpic','download','existsSync','server/files/images/','whatsapp','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','concat','getContacts','hasOwnProperty','CmList','List','Tag','color','tag','getQueues','Queue','keys','filters','intersection','model','fields','order','sort','pick','merge','options','getVoiceQueuesRt','nolimit','getGroups','ChatGroup','getRecordings','VoiceRecording','getScreenRecordings','UserId','ScreenRecording','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','login','mobile','LOCAL/%s@from-sip/n','intrf','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','device','LOGININPAUSE','isMiddleware','resolve','logout','pause','PAUSE','DEFAULT\x20PAUSE','unpause','Channel\x20parameter\x20%s\x20is\x20invalid','chatPause','faxPause','openchannelPause','smsPause','whatsappPause','pauseType','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','addTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','Team','getAssociatedQueues','addAgent','getDataValue','Voice','TeamVoicePrefix','VoicePrefixId','removeTeams','isArray','Query\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','flattenDeep','removeAgent','getLists','values','You\x20can\x27t\x20delete\x20yourself','CmHopper','addChatInteractions','omit','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','getScheduledCalls','$and','$or','$gt','$lte','$eq','$between','$notBetween','$in','$like','$iLike','$notILike','$overlap','$contained','$any','phone','CmContact','dialActive','VoiceQueue','retrieveApiKey','token','createApiKey','iat','nonce','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','apiKeyIat','API\x20key\x20not\x20available','Unable\x20to\x20retrieve\x20the\x20current\x20user','idle','ringing','inbound','flatten','toString','lower','col','asc','desc','substring','uniqBy','getRealtimeAgents','offline','voiceStatus','unavailable','busy','slice','charAt','select','field','ui.','InteractionId','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','messengerSoundNotification','moment','lodash','squel','ioredis','../../components/auth/service','../../components/contacts','../../components/realtime/agents','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../errors/api','APIForbiddenrror','handleError','socket.io-emitter','redis','./user.socket','register','defaults','localhost','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','update','then','role','agent','destroy','get','admin','Users','Telephones','telephone','filter','value','includes','name','stack','send','User','rawAttributes','fieldName','type','key','password','salt','resetPasswordToken','resetPasswordExpires','index','getOptions','where','query','includeAll','include','true','UserSetting','userSetting','attributes','push','findAll','rows','openTabs','length','dataValues','mail','all','catch','show','params','find','chat','sms','openchannel','fax','body','describe','addContacts','ids','internal','findById','securePassword','validatePasswordPattern','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)','QueryTypes','SELECT','from','mailbox','VoiceMail','fullname','permissions','102','103','113','110','104','106','109'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0x2e4d,0x117));var _0xd2e4=function(_0x2c72bd,_0xc43b5d){_0x2c72bd=_0x2c72bd-0x0;var _0x3333af=_0x2e4d[_0x2c72bd];return _0x3333af;};'use strict';var moment=require(_0xd2e4('0x0'));var util=require('util');var path=require('path');var fs=require('fs');var _=require(_0xd2e4('0x1'));var squel=require(_0xd2e4('0x2'));var Redis=require(_0xd2e4('0x3'));var authService=require(_0xd2e4('0x4'));var contacts=require(_0xd2e4('0x5'));var qs=require('../../components/parsers/qs');var rta=require(_0xd2e4('0x6'));var logger=require(_0xd2e4('0x7'))(_0xd2e4('0x8'));var utils=require(_0xd2e4('0x9'));var config=require(_0xd2e4('0xa'));var licenseUtil=require(_0xd2e4('0xb'));var APIBadRequestError=require(_0xd2e4('0xc'))['APIBadRequestError'];var APINotFoundError=require(_0xd2e4('0xc'))['APINotFoundError'];var APIForbiddenError=require('../../errors/api')[_0xd2e4('0xd')];var APIHandleError=require(_0xd2e4('0xc'))[_0xd2e4('0xe')];var db=require('../../mysqldb')['db'];var socket=require(_0xd2e4('0xf'))(new Redis(config[_0xd2e4('0x10')]));require(_0xd2e4('0x11'))[_0xd2e4('0x12')](socket);config[_0xd2e4('0x10')]=_[_0xd2e4('0x13')](config['redis'],{'host':_0xd2e4('0x14'),'port':0x18eb});var values;function respondWithStatusCode(_0x2e0b15,_0x38cf90){_0x38cf90=_0x38cf90||0xcc;return function(_0x11c21c){if(_0x11c21c){return _0x2e0b15[_0xd2e4('0x15')](_0x38cf90);}return _0x2e0b15[_0xd2e4('0x16')](_0x38cf90)[_0xd2e4('0x17')]();};}function respondWithResult(_0x11fa83,_0x5839d3){_0x5839d3=_0x5839d3||0xc8;return function(_0x2cddfa){if(_0x2cddfa){return _0x11fa83['status'](_0x5839d3)['json'](_0x2cddfa);}};}function respondWithFilteredResult(_0x2971d9,_0x31ce9e){return function(_0x26af61){if(_0x26af61){var _0x4f061b=typeof _0x31ce9e['offset']===_0xd2e4('0x18')&&typeof _0x31ce9e[_0xd2e4('0x19')]===_0xd2e4('0x18');var _0x377453=_0x26af61[_0xd2e4('0x1a')];var _0x351807=_0x4f061b?0x0:_0x31ce9e[_0xd2e4('0x1b')];var _0x1a7bd5=_0x4f061b?_0x26af61['count']:_0x31ce9e['offset']+_0x31ce9e[_0xd2e4('0x19')];var _0x3b2620;if(_0x1a7bd5>=_0x377453){_0x1a7bd5=_0x377453;_0x3b2620=0xc8;}else{_0x3b2620=0xce;}_0x2971d9[_0xd2e4('0x16')](_0x3b2620);return _0x2971d9['set'](_0xd2e4('0x1c'),_0x351807+'-'+_0x1a7bd5+'/'+_0x377453)[_0xd2e4('0x1d')](_0x26af61);}return null;};}function saveUpdates(_0x527549){return function(_0xb2a289){if(_0xb2a289){return _0xb2a289[_0xd2e4('0x1e')](_0x527549)[_0xd2e4('0x1f')](function(_0x1ba23f){if(_0x1ba23f[_0xd2e4('0x20')]===_0xd2e4('0x21')){socket['emit']('userNotification:recalc:'+_0x1ba23f['id'],_0x1ba23f);}return _0x1ba23f;});}return null;};}function removeEntity(_0x55e8ed,_0x578844){return function(_0x1434fb){if(_0x1434fb){return _0x1434fb[_0xd2e4('0x22')]({'transaction':_0x578844})[_0xd2e4('0x1f')](function(){var _0x12287a=_0x1434fb[_0xd2e4('0x23')]({'plain':!![]});if(_0x12287a[_0xd2e4('0x20')]===_0xd2e4('0x24'))return;var _0x1b64ba=[{'name':_0xd2e4('0x25'),'value':'user','ignore':!![]},{'name':'Agents','value':_0xd2e4('0x21'),'ignore':![]},{'name':_0xd2e4('0x26'),'value':_0xd2e4('0x27'),'ignore':![]}];var _0x569ba0=_(_0x1b64ba)[_0xd2e4('0x28')]('ignore')['map'](_0xd2e4('0x29'))[_0xd2e4('0x29')]();if(_[_0xd2e4('0x2a')](_0x569ba0,_0x12287a[_0xd2e4('0x20')])){return;}var _0x14b29b=_['find'](_0x1b64ba,['value',_0x12287a['role']])[_0xd2e4('0x2b')];return db['UserProfileResource'][_0xd2e4('0x22')]({'where':{'type':_0x14b29b,'resourceId':_0x12287a['id']},'transaction':_0x578844})[_0xd2e4('0x1f')](function(){return _0x1434fb;});})[_0xd2e4('0x1f')](function(){_0x55e8ed[_0xd2e4('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x126881){return function(_0x5532a5){if(!_0x5532a5){_0x126881[_0xd2e4('0x15')](0x194);}return _0x5532a5;};}function handleError(_0x30d592,_0x1e383d){_0x1e383d=_0x1e383d||0x1f4;return function(_0x5ed4a5){logger['error'](_0x5ed4a5[_0xd2e4('0x2c')]);if(_0x5ed4a5[_0xd2e4('0x2b')]){delete _0x5ed4a5[_0xd2e4('0x2b')];}_0x30d592[_0xd2e4('0x16')](_0x1e383d)[_0xd2e4('0x2d')](_0x5ed4a5);};}function getUserAttributes(){return _(db[_0xd2e4('0x2e')][_0xd2e4('0x2f')])['map'](function(_0x2dd124){return{'name':_0x2dd124[_0xd2e4('0x30')],'type':_0x2dd124[_0xd2e4('0x31')][_0xd2e4('0x32')]};})[_0xd2e4('0x28')](function(_0x57b1c5){return![_0xd2e4('0x33'),_0xd2e4('0x34'),'previousPasswords',_0xd2e4('0x35'),_0xd2e4('0x36'),'md5secret'][_0xd2e4('0x2a')](_0x57b1c5[_0xd2e4('0x2b')]);})[_0xd2e4('0x29')]();}exports[_0xd2e4('0x37')]=function(_0x5d0997,_0x13122a){var _0x2a2d55={},_0x47aa09={'count':0x0,'rows':[]};var _0x2af920=getUserAttributes();_0x2a2d55=qs[_0xd2e4('0x38')](_0x2af920,_0x5d0997);var _0x2ca2b6={'where':_0x2a2d55[_0xd2e4('0x39')]};return db[_0xd2e4('0x2e')][_0xd2e4('0x1a')](_0x2ca2b6)['then'](function(_0x4485fd){_0x47aa09[_0xd2e4('0x1a')]=_0x4485fd;if(_0x5d0997[_0xd2e4('0x3a')][_0xd2e4('0x3b')]){_0x2a2d55[_0xd2e4('0x3c')]=[{'all':!![]}];}if(_0x5d0997['query']['userSetting']===_0xd2e4('0x3d')){_0x2a2d55[_0xd2e4('0x3c')]=[{'model':db[_0xd2e4('0x3e')],'as':_0xd2e4('0x3f')}];}if(!_[_0xd2e4('0x2a')](_0x2a2d55[_0xd2e4('0x40')],'id')){_0x2a2d55['attributes'][_0xd2e4('0x41')]('id');}return db['User'][_0xd2e4('0x42')](_0x2a2d55);})['then'](function(_0x59ad16){_0x47aa09[_0xd2e4('0x43')]=_0x59ad16;if(_0x5d0997['query'][_0xd2e4('0x44')]===_0xd2e4('0x3d')){var _0x43eba9=[];for(var _0xfcee57=0x0;_0xfcee57<_0x47aa09[_0xd2e4('0x43')][_0xd2e4('0x45')];_0xfcee57++){_0x43eba9[_0xd2e4('0x41')](get_open_tabs('chat',_0x47aa09['rows'][_0xfcee57][_0xd2e4('0x46')]));_0x43eba9[_0xd2e4('0x41')](get_open_tabs('sms',_0x47aa09[_0xd2e4('0x43')][_0xfcee57][_0xd2e4('0x46')]));_0x43eba9[_0xd2e4('0x41')](get_open_tabs('fax',_0x47aa09[_0xd2e4('0x43')][_0xfcee57][_0xd2e4('0x46')]));_0x43eba9[_0xd2e4('0x41')](get_open_tabs(_0xd2e4('0x47'),_0x47aa09['rows'][_0xfcee57][_0xd2e4('0x46')]));_0x43eba9[_0xd2e4('0x41')](get_open_tabs('openchannel',_0x47aa09[_0xd2e4('0x43')][_0xfcee57]['dataValues']));_0x43eba9[_0xd2e4('0x41')](get_open_tabs('whatsapp',_0x47aa09[_0xd2e4('0x43')][_0xfcee57][_0xd2e4('0x46')]));}return Promise[_0xd2e4('0x48')](_0x43eba9)[_0xd2e4('0x1f')](function(){return _0x47aa09;});}else{return _0x47aa09;}})[_0xd2e4('0x1f')](respondWithFilteredResult(_0x13122a,_0x2a2d55))[_0xd2e4('0x49')](handleError(_0x13122a,null));};exports[_0xd2e4('0x4a')]=function(_0x282f28,_0x2c8e77){var _0x388b93=getUserAttributes();_0x282f28[_0xd2e4('0x3a')]['id']=_0x282f28[_0xd2e4('0x4b')]['id'];var _0x5ee176=qs[_0xd2e4('0x38')](_0x388b93,_0x282f28);if(_0x282f28['query']['includeAll']){_0x5ee176[_0xd2e4('0x3c')]=[{'all':!![]}];}if(_0x282f28[_0xd2e4('0x3a')][_0xd2e4('0x3f')]==='true'){_0x5ee176[_0xd2e4('0x3c')]=[{'model':db[_0xd2e4('0x3e')],'as':'userSetting'}];}_0x5ee176=_['merge']({},_0x5ee176,_0x282f28['options']);if(!_[_0xd2e4('0x2a')](_0x5ee176[_0xd2e4('0x40')],'id')){_0x5ee176[_0xd2e4('0x40')]['push']('id');}return db[_0xd2e4('0x2e')][_0xd2e4('0x4c')](_0x5ee176)['then'](handleEntityNotFound(_0x2c8e77,null))[_0xd2e4('0x1f')](function(_0x4b2543){var _0x4013ce=[];values=_0x4b2543;if(_0x282f28['query']['openTabs']===_0xd2e4('0x3d')){_0x4013ce[_0xd2e4('0x41')](get_open_tabs(_0xd2e4('0x4d'),_0x4b2543[_0xd2e4('0x46')]));_0x4013ce[_0xd2e4('0x41')](get_open_tabs(_0xd2e4('0x4e'),_0x4b2543[_0xd2e4('0x46')]));_0x4013ce['push'](get_open_tabs(_0xd2e4('0x4f'),_0x4b2543[_0xd2e4('0x46')]));_0x4013ce['push'](get_open_tabs('whatsapp',_0x4b2543[_0xd2e4('0x46')]));_0x4013ce[_0xd2e4('0x41')](get_open_tabs(_0xd2e4('0x50'),_0x4b2543[_0xd2e4('0x46')]));_0x4013ce[_0xd2e4('0x41')](get_open_tabs(_0xd2e4('0x47'),_0x4b2543[_0xd2e4('0x46')]));return Promise['all'](_0x4013ce);}else{return values;}})[_0xd2e4('0x1f')](function(){return values;})['then'](respondWithResult(_0x2c8e77,null))['catch'](handleError(_0x2c8e77,null));};exports[_0xd2e4('0x1e')]=function(_0x28330f,_0x2ffc00){if(_0x28330f['body']['id']){delete _0x28330f[_0xd2e4('0x51')]['id'];}delete _0x28330f[_0xd2e4('0x51')][_0xd2e4('0x20')];return db['User']['find']({'where':{'id':_0x28330f['params']['id']}})['then'](handleEntityNotFound(_0x2ffc00,null))[_0xd2e4('0x1f')](saveUpdates(_0x28330f[_0xd2e4('0x51')],null))[_0xd2e4('0x1f')](respondWithResult(_0x2ffc00,null))[_0xd2e4('0x49')](handleError(_0x2ffc00,null));};exports[_0xd2e4('0x52')]=function(_0x333443,_0x4e58da){return db[_0xd2e4('0x2e')]['describe']()[_0xd2e4('0x1f')](respondWithResult(_0x4e58da,null))[_0xd2e4('0x49')](handleError(_0x4e58da,null));};exports['addContacts']=function(_0x339159,_0x18b1e3){return db[_0xd2e4('0x2e')][_0xd2e4('0x4c')]({'where':{'id':_0x339159[_0xd2e4('0x4b')]['id']}})[_0xd2e4('0x1f')](handleEntityNotFound(_0x18b1e3,null))[_0xd2e4('0x1f')](function(_0x5a5d2f){if(_0x5a5d2f){return _0x5a5d2f[_0xd2e4('0x53')](_0x339159[_0xd2e4('0x51')]['ids'],_['omit'](_0x339159[_0xd2e4('0x51')],[_0xd2e4('0x54'),'id'])||{});}})[_0xd2e4('0x1f')](respondWithResult(_0x18b1e3,null))['catch'](handleError(_0x18b1e3,null));};function validateUser(_0x4d751f){return new Promise(function(_0x374db3,_0x29ca57){if(_0x4d751f[_0xd2e4('0x55')])return _0x374db3(_0x4d751f);return db['Setting'][_0xd2e4('0x56')](0x1)[_0xd2e4('0x1f')](function(_0xa69d56){if(_0xa69d56[_0xd2e4('0x57')])authService[_0xd2e4('0x58')](_0x4d751f[_0xd2e4('0x33')]);db[_0xd2e4('0x2e')][_0xd2e4('0x59')](_0xd2e4('0x55'))[_0xd2e4('0x1f')](function(_0x12d6eb){if(_[_0xd2e4('0x5a')](_0x12d6eb)){_0x4d751f['internal']=_0xa69d56[_0xd2e4('0x5b')]||0x1;return;}if(_[_0xd2e4('0x5a')](_0xa69d56[_0xd2e4('0x5b')])||_0xa69d56[_0xd2e4('0x5b')]===_0x12d6eb){_0x4d751f[_0xd2e4('0x55')]=_0x12d6eb+0x1;return;}if(_0xa69d56[_0xd2e4('0x5b')]>_0x12d6eb){_0x4d751f['internal']=_0xa69d56[_0xd2e4('0x5b')];return;}return db[_0xd2e4('0x5c')][_0xd2e4('0x3a')](_0xd2e4('0x5d'),{'type':db[_0xd2e4('0x5c')][_0xd2e4('0x5e')][_0xd2e4('0x5f')]})[_0xd2e4('0x1f')](function(_0x1be164){if(_0x1be164&&_0x1be164[_0xd2e4('0x45')]){for(var _0x9bc4bb=0x0,_0x41475e=_0x1be164['length'];_0x9bc4bb<_0x41475e&&_[_0xd2e4('0x5a')](_0x4d751f[_0xd2e4('0x55')]);_0x9bc4bb++){if(_0xa69d56[_0xd2e4('0x5b')]<=_0x1be164[_0x9bc4bb][_0xd2e4('0x60')]){_0x4d751f['internal']=_0x1be164[_0x9bc4bb][_0xd2e4('0x60')];}else if(_0xa69d56['min_internal']>_0x1be164[_0x9bc4bb][_0xd2e4('0x60')]&&_0xa69d56[_0xd2e4('0x5b')]<=_0x1be164[_0x9bc4bb]['to']){_0x4d751f[_0xd2e4('0x55')]=_0xa69d56[_0xd2e4('0x5b')];}}}if(_[_0xd2e4('0x5a')](_0x4d751f['internal'])){_0x4d751f['internal']=_0x12d6eb+0x1;}return _0x374db3(_0x4d751f);});});})[_0xd2e4('0x49')](function(_0x48db3d){_0x29ca57(_0x48db3d);});});}function updateUser(_0x5d939c){return new Promise(function(_0x3acf24,_0x6d85fe){try{if(_0x5d939c['voicemail']){_0x5d939c[_0xd2e4('0x61')]=_0x5d939c['internal'];_0x5d939c[_0xd2e4('0x62')]={'mailbox':_0x5d939c[_0xd2e4('0x55')],'password':_0x5d939c[_0xd2e4('0x33')],'fullname':_0x5d939c[_0xd2e4('0x63')],'email':_0x5d939c['email']};}if(_0x5d939c['role']===_0xd2e4('0x21')){if(!_0x5d939c[_0xd2e4('0x64')])_0x5d939c[_0xd2e4('0x64')]=['101',_0xd2e4('0x65'),_0xd2e4('0x66'),_0xd2e4('0x67'),_0xd2e4('0x68'),_0xd2e4('0x69'),'105',_0xd2e4('0x6a'),'107','108',_0xd2e4('0x6b'),_0xd2e4('0x6c'),_0xd2e4('0x6d'),_0xd2e4('0x6e'),_0xd2e4('0x6f')];}_0x3acf24(_0x5d939c);}catch(_0x5c9f64){_0x6d85fe(_0x5c9f64);}});}exports['create']=function(_0x379846,_0x5beb47){if(_0x379846[_0xd2e4('0x70')][_0xd2e4('0x20')]===_0xd2e4('0x21'))throw new Error(_0xd2e4('0x71'));if(_0x379846[_0xd2e4('0x51')][_0xd2e4('0x20')]==='user'&&_0x379846[_0xd2e4('0x70')][_0xd2e4('0x20')]!==_0xd2e4('0x24')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x379846[_0xd2e4('0x51')][_0xd2e4('0x20')]===_0xd2e4('0x24')&&_0x379846[_0xd2e4('0x70')][_0xd2e4('0x20')]!==_0xd2e4('0x24')){throw new Error(_0xd2e4('0x72'));}return licenseUtil[_0xd2e4('0x73')]([_0x379846[_0xd2e4('0x51')]])[_0xd2e4('0x1f')](function(){return validateUser(_0x379846[_0xd2e4('0x51')]);})[_0xd2e4('0x1f')](function(_0x2044ae){return updateUser(_0x2044ae)['then'](function(_0x41199b){if(_0x41199b[_0xd2e4('0x20')]===_0xd2e4('0x24')){_0x41199b[_0xd2e4('0x74')]=_0x379846[_0xd2e4('0x70')][_0xd2e4('0x74')];delete _0x41199b[_0xd2e4('0x75')];}return _0x41199b;});})[_0xd2e4('0x1f')](function(_0x2297f6){return db[_0xd2e4('0x2e')][_0xd2e4('0x76')](_0x2297f6,{'include':[{'model':db[_0xd2e4('0x62')],'as':_0xd2e4('0x62')}]});})['then'](function(_0x5b68f6){if(_0x379846[_0xd2e4('0x51')][_0xd2e4('0x20')]===_0xd2e4('0x70'))return _0x5b68f6;if(_0x379846['user'][_0xd2e4('0x20')]!==_0xd2e4('0x70'))return _0x5b68f6;return db[_0xd2e4('0x77')][_0xd2e4('0x4c')]({'where':{'name':_0x5b68f6[_0xd2e4('0x20')]===_0xd2e4('0x21')?_0xd2e4('0x78'):'Telephones','userProfileId':_0x379846[_0xd2e4('0x70')]['userProfileId']},'raw':!![]})[_0xd2e4('0x1f')](function(_0x3c3e71){if(!_0x3c3e71||_0x3c3e71[_0xd2e4('0x79')]!=0x0)return _0x5b68f6;return db['UserProfileResource'][_0xd2e4('0x76')]({'name':_0x5b68f6[_0xd2e4('0x2b')],'resourceId':_0x5b68f6['id'],'type':_0x3c3e71[_0xd2e4('0x2b')],'sectionId':_0x3c3e71['id']},{})[_0xd2e4('0x1f')](function(){return _0x5b68f6;});})[_0xd2e4('0x49')](function(_0x574036){logger['error'](_0xd2e4('0x7a'),_0x574036);throw _0x574036;});})['then'](respondWithResult(_0x5beb47,0xc9))[_0xd2e4('0x49')](handleError(_0x5beb47,null));};exports[_0xd2e4('0x7b')]=function(_0x57b4a6,_0x3235eb){var _0x113e11=_0x57b4a6[_0xd2e4('0x51')];var _0x5363b4=[];if(_0x57b4a6[_0xd2e4('0x70')][_0xd2e4('0x20')]==='agent')throw new Error(_0xd2e4('0x71'));if(_[_0xd2e4('0x7c')](_0x113e11,[_0xd2e4('0x20'),'user'])&&_0x57b4a6[_0xd2e4('0x70')][_0xd2e4('0x20')]!==_0xd2e4('0x24')){throw new Error(_0xd2e4('0x7d'));}if(_['some'](_0x113e11,['role','admin'])&&_0x57b4a6[_0xd2e4('0x70')][_0xd2e4('0x20')]!==_0xd2e4('0x24')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0xd2e4('0x73')](_0x113e11)[_0xd2e4('0x1f')](function(){return validateUser(_0x113e11[0x0]);})[_0xd2e4('0x1f')](function(){for(var _0x14e87c=0x1;_0x14e87c<_0x113e11[_0xd2e4('0x45')];_0x14e87c++){var _0x3cf791=_0x113e11[_0x14e87c-0x1][_0xd2e4('0x55')];if(!_0x113e11[_0x14e87c]['internal'])_0x113e11[_0x14e87c][_0xd2e4('0x55')]=_0x3cf791+0x1;_0x5363b4[_0xd2e4('0x41')](validateUser(_0x113e11[_0x14e87c]));}return Promise[_0xd2e4('0x48')](_0x5363b4);})[_0xd2e4('0x1f')](function(){_0x5363b4=[];for(var _0x495706=0x0;_0x495706<_0x113e11['length'];_0x495706++){_0x5363b4[_0xd2e4('0x41')](updateUser(_0x113e11[_0x495706]));}return Promise['all'](_0x5363b4);})[_0xd2e4('0x1f')](function(){_0x5363b4=_0x113e11[_0xd2e4('0x7e')](function(_0x1ca0ea){return db['User'][_0xd2e4('0x76')](_0x1ca0ea,{'include':[{'model':db[_0xd2e4('0x62')],'as':_0xd2e4('0x62')}]})[_0xd2e4('0x1f')](function(_0x39f34c){_0x1ca0ea['id']=_0x39f34c['id'];return _0x1ca0ea;});});return Promise[_0xd2e4('0x48')](_0x5363b4);})[_0xd2e4('0x1f')](function(_0x207da4){if(_0x57b4a6['body'][_0xd2e4('0x20')]===_0xd2e4('0x70'))return _0x207da4;if(_0x57b4a6[_0xd2e4('0x70')][_0xd2e4('0x20')]!==_0xd2e4('0x70'))return _0x207da4;var _0x6126eb=_[_0xd2e4('0x7c')](_0x207da4,function(_0x2bacf9){return _0x2bacf9[_0xd2e4('0x20')]===_0xd2e4('0x21')||_0x2bacf9[_0xd2e4('0x20')]==='telephone';});if(!_0x6126eb)return _0x207da4;return db[_0xd2e4('0x77')]['findAll']({'where':{'name':{'$or':[_0xd2e4('0x78'),_0xd2e4('0x26')]},'userProfileId':_0x57b4a6['user'][_0xd2e4('0x75')]},'raw':!![]})[_0xd2e4('0x1f')](function(_0x5033d5){if(_['isEmpty'](_0x5033d5)||!_[_0xd2e4('0x7c')](_0x5033d5,['autoAssociation',0x0]))return _0x207da4;_0x5363b4=[];var _0x1f1fc4=_(_0x5033d5)[_0xd2e4('0x7e')](function(_0x169627){if(_0x169627[_0xd2e4('0x79')]===0x1)return;return _0x169627[_0xd2e4('0x2b')]==='Agents'?_0xd2e4('0x21'):_0xd2e4('0x27');})[_0xd2e4('0x7f')]()[_0xd2e4('0x29')]();for(var _0x4df37d=0x0;_0x4df37d<_0x207da4[_0xd2e4('0x45')];_0x4df37d++){if(!_[_0xd2e4('0x2a')](_0x1f1fc4,_0x207da4[_0x4df37d][_0xd2e4('0x20')]))return;var _0x522c50=_0x207da4[_0x4df37d][_0xd2e4('0x20')]==='agent'?_0xd2e4('0x78'):_0xd2e4('0x26');_0x5363b4['push'](db[_0xd2e4('0x80')][_0xd2e4('0x76')]({'name':_0x207da4[_0x4df37d][_0xd2e4('0x2b')],'resourceId':_0x207da4[_0x4df37d]['id'],'type':_0x522c50,'sectionId':_[_0xd2e4('0x4c')](_0x5033d5,['name',_0x522c50])['id']},{}));}return Promise[_0xd2e4('0x48')](_0x5363b4);});})[_0xd2e4('0x1f')](respondWithResult(_0x3235eb,0xc9))[_0xd2e4('0x49')](handleError(_0x3235eb,null));};exports[_0xd2e4('0x81')]=function(_0x1cd8b9,_0x2a65bc){if(_0x1cd8b9[_0xd2e4('0x51')]['id']){delete _0x1cd8b9[_0xd2e4('0x51')]['id'];}return db[_0xd2e4('0x2e')][_0xd2e4('0x4c')]({'where':{'id':_0x1cd8b9[_0xd2e4('0x4b')]['id']}})[_0xd2e4('0x1f')](function(_0x2a2131){if(!_0x2a2131)return null;if(_0x2a2131['id']===_0x1cd8b9['user']['id']){if(!_0x1cd8b9[_0xd2e4('0x51')][_0xd2e4('0x82')]||!_0x1cd8b9[_0xd2e4('0x51')][_0xd2e4('0x83')]){throw new db['Sequelize'][(_0xd2e4('0x84'))](_0xd2e4('0x85'));}if(!_0x2a2131[_0xd2e4('0x86')](_0x1cd8b9[_0xd2e4('0x51')][_0xd2e4('0x82')])){throw new db[(_0xd2e4('0x87'))][(_0xd2e4('0x84'))](_0xd2e4('0x88'));}if(_0x1cd8b9[_0xd2e4('0x51')]['oldPassword']===_0x1cd8b9[_0xd2e4('0x51')]['newPassword']){throw new db[(_0xd2e4('0x87'))][(_0xd2e4('0x84'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x1cd8b9[_0xd2e4('0x70')][_0xd2e4('0x20')]===_0xd2e4('0x24')){if(!_0x1cd8b9[_0xd2e4('0x51')][_0xd2e4('0x83')]){throw new db[(_0xd2e4('0x87'))]['ValidationError'](_0xd2e4('0x89'));}}else if(_0x1cd8b9['user']['role']===_0xd2e4('0x70')){if(!_0x1cd8b9[_0xd2e4('0x51')][_0xd2e4('0x83')]){throw new db[(_0xd2e4('0x87'))][(_0xd2e4('0x84'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x2a2131[_0xd2e4('0x20')]!==_0xd2e4('0x21')){throw new db[(_0xd2e4('0x87'))][(_0xd2e4('0x84'))](_0xd2e4('0x71'));}}else{throw new db[(_0xd2e4('0x87'))]['ValidationError'](_0xd2e4('0x71'));}return _0x2a2131;})[_0xd2e4('0x1f')](handleEntityNotFound(_0x2a65bc,null))[_0xd2e4('0x1f')](function(_0xd398df){return db[_0xd2e4('0x8a')][_0xd2e4('0x8b')]({'attributes':['id',_0xd2e4('0x57'),_0xd2e4('0x8c'),'passwordHistoryLimit']})[_0xd2e4('0x1f')](function(_0x1615d5){if(_0x1615d5[_0xd2e4('0x57')])authService[_0xd2e4('0x58')](_0x1cd8b9['body']['newPassword']);if(!_0x1615d5[_0xd2e4('0x8c')]||!_0xd398df[_0xd2e4('0x8d')])return _0xd398df;authService[_0xd2e4('0x8e')](_0x1cd8b9['body']['newPassword'],_0xd398df[_0xd2e4('0x8d')],_0x1615d5[_0xd2e4('0x8f')]);return _0xd398df;})['then'](saveUpdates({'password':_0x1cd8b9['body']['newPassword'],'passwordResetAt':_0x1cd8b9[_0xd2e4('0x70')]['id']==_0x1cd8b9[_0xd2e4('0x4b')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x1cd8b9[_0xd2e4('0x51')]['newPassword'],_0xd398df[_0xd2e4('0x8d')])},null));})[_0xd2e4('0x1f')](respondWithResult(_0x2a65bc,null))[_0xd2e4('0x49')](handleError(_0x2a65bc,null));};exports['addQueues']=function(_0x42567f,_0x46a2e7){var _0xe59ff8=_0x42567f[_0xd2e4('0x51')]['channel'];return db['User']['find']({'where':{'id':_0x42567f[_0xd2e4('0x4b')]['id']},'attributes':['id',_0xd2e4('0x2b'),_0xd2e4('0x20'),_0xd2e4('0x90'),_0xd2e4('0x91'),'voicePause',_0xd2e4('0x92')]})['then'](handleEntityNotFound(_0x46a2e7,null))[_0xd2e4('0x1f')](function(_0x43af3d){if(_0x43af3d){if(!utils[_0xd2e4('0x93')](_0xe59ff8)){throw new db[(_0xd2e4('0x87'))][(_0xd2e4('0x84'))](_0xd2e4('0x94'));}return _0x43af3d[_0xd2e4('0x95')+_[_0xd2e4('0x96')](_0xe59ff8[_0xd2e4('0x97')]())+_0xd2e4('0x98')](_0x42567f[_0xd2e4('0x51')][_0xd2e4('0x54')],{'penalty':_0x42567f[_0xd2e4('0x51')][_0xd2e4('0x99')]||0x0})[_0xd2e4('0x9a')](function(_0x5d3439){for(var _0x14d09e=0x0;_0x14d09e<_0x42567f[_0xd2e4('0x51')][_0xd2e4('0x54')]['length'];_0x14d09e+=0x1){var _0x599703={'UserId':Number(_0x42567f[_0xd2e4('0x4b')]['id'])};_0x599703[_[_0xd2e4('0x96')](_0xe59ff8[_0xd2e4('0x97')]())+_0xd2e4('0x9b')]=Number(_0x42567f[_0xd2e4('0x51')]['ids'][_0x14d09e]);socket[_0xd2e4('0x9c')](_0xd2e4('0x70')+_[_0xd2e4('0x96')](_0xe59ff8[_0xd2e4('0x97')]())+_0xd2e4('0x9d'),_0x599703);}return _0x5d3439;})['then'](function(){if(_0xe59ff8==='voice'){return db['VoiceQueue'][_0xd2e4('0x42')]({'where':{'id':_0x42567f[_0xd2e4('0x51')][_0xd2e4('0x54')]||[]},'raw':!![],'attributes':['id',_0xd2e4('0x2b')]});}})[_0xd2e4('0x1f')](function(_0x513b01){var _0x89f73a=_0x43af3d['get']({'plain':!![]});var _0x4b2bd1=[];if(_0xe59ff8==='voice'&&_0x89f73a['role']==='agent'&&_0x89f73a[_0xd2e4('0x90')]){for(let _0x108bc8=0x0;_0x108bc8<_0x513b01['length'];_0x108bc8+=0x1){_0x4b2bd1[_0xd2e4('0x41')]({'membername':_0x89f73a[_0xd2e4('0x2b')],'UserId':_0x89f73a['id'],'queue_name':_0x513b01[_0x108bc8][_0xd2e4('0x2b')],'VoiceQueueId':_0x513b01[_0x108bc8]['id'],'interface':_[_0xd2e4('0x5a')](_0x89f73a[_0xd2e4('0x92')])?util[_0xd2e4('0x9e')](_0xd2e4('0x9f'),_0x89f73a[_0xd2e4('0x2b')]):_0x89f73a[_0xd2e4('0x92')],'paused':_0x89f73a[_0xd2e4('0xa0')]||![],'penalty':_0x42567f['body']['penalty']||0x0});}return Promise['all'](_0x4b2bd1['map'](function(_0x58e645){return db[_0xd2e4('0xa1')][_0xd2e4('0xa2')](_0x58e645);}));}return _0x43af3d;});}})[_0xd2e4('0x1f')](respondWithStatusCode(_0x46a2e7,null))['catch'](handleError(_0x46a2e7,null));};exports[_0xd2e4('0xa3')]=function(_0x4f9e22,_0x1313f0){var _0x8e446c,_0x5bf654;return db[_0xd2e4('0x2e')][_0xd2e4('0x4c')]({'where':{'id':_0x4f9e22[_0xd2e4('0x4b')]['id']},'attributes':['id',_0xd2e4('0x2b'),'role']})['then'](handleEntityNotFound(_0x1313f0,null))['then'](function(_0x5f3803){if(_0x5f3803){_0x8e446c=_0x5f3803;if(!_0x4f9e22[_0xd2e4('0x3a')][_0xd2e4('0xa4')]||!utils['isValidChannel'](_0x4f9e22[_0xd2e4('0x3a')][_0xd2e4('0xa4')])){throw new db[(_0xd2e4('0x87'))][(_0xd2e4('0x84'))](_0xd2e4('0x94'));}return _0x5f3803['remove'+_[_0xd2e4('0x96')](_0x4f9e22[_0xd2e4('0x3a')][_0xd2e4('0xa4')][_0xd2e4('0x97')]())+_0xd2e4('0x98')](_0x4f9e22['query'][_0xd2e4('0x54')]);}})['then'](function(_0x145313){if(_['isArray'](_0x4f9e22[_0xd2e4('0x3a')][_0xd2e4('0x54')])){for(var _0x257681=0x0;_0x257681<_0x4f9e22[_0xd2e4('0x3a')]['ids'][_0xd2e4('0x45')];_0x257681+=0x1){_0x5bf654={'UserId':Number(_0x4f9e22[_0xd2e4('0x4b')]['id'])};_0x5bf654[_[_0xd2e4('0x96')](_0x4f9e22[_0xd2e4('0x3a')][_0xd2e4('0xa4')]['toLowerCase']())+'QueueId']=Number(_0x4f9e22[_0xd2e4('0x3a')][_0xd2e4('0x54')][_0x257681]);socket[_0xd2e4('0x9c')]('user'+_[_0xd2e4('0x96')](_0x4f9e22[_0xd2e4('0x3a')][_0xd2e4('0xa4')]['toLowerCase']())+_0xd2e4('0xa5'),_0x5bf654);}}else{_0x5bf654={'UserId':Number(_0x4f9e22[_0xd2e4('0x4b')]['id'])};_0x5bf654[_['capitalize'](_0x4f9e22[_0xd2e4('0x3a')][_0xd2e4('0xa4')][_0xd2e4('0x97')]())+'QueueId']=Number(_0x4f9e22[_0xd2e4('0x3a')][_0xd2e4('0x54')]);socket['emit'](_0xd2e4('0x70')+_['capitalize'](_0x4f9e22[_0xd2e4('0x3a')][_0xd2e4('0xa4')][_0xd2e4('0x97')]())+_0xd2e4('0xa5'),_0x5bf654);}return _0x145313;})['then'](function(){if(_0x4f9e22[_0xd2e4('0x3a')][_0xd2e4('0xa4')]===_0xd2e4('0xa6')){return db[_0xd2e4('0xa1')]['destroy']({'where':{'UserId':_0x4f9e22[_0xd2e4('0x4b')]['id'],'VoiceQueueId':_0x4f9e22[_0xd2e4('0x3a')][_0xd2e4('0x54')]},'individualHooks':!![]})[_0xd2e4('0x1f')](function(){return _0x8e446c;});}return _0x8e446c;})[_0xd2e4('0x1f')](respondWithStatusCode(_0x1313f0,null))[_0xd2e4('0x49')](handleError(_0x1313f0,null));};exports[_0xd2e4('0xa7')]=function(_0x5c1161,_0x2ae623){_0x5c1161['body']['userpic']=_0x5c1161['file'][_0xd2e4('0xa8')];return db[_0xd2e4('0x2e')][_0xd2e4('0x4c')]({'where':{'id':_0x5c1161[_0xd2e4('0x4b')]['id']}})[_0xd2e4('0x1f')](handleEntityNotFound(_0x2ae623,null))[_0xd2e4('0x1f')](saveUpdates(_0x5c1161[_0xd2e4('0x51')],null))[_0xd2e4('0x1f')](respondWithResult(_0x2ae623,null))[_0xd2e4('0x49')](handleError(_0x2ae623,null));};exports['getAvatar']=function(_0x26feb0,_0x2e0082){var _0x286f9b=path[_0xd2e4('0xa9')](config[_0xd2e4('0xaa')],_0xd2e4('0xab'));return db[_0xd2e4('0x2e')][_0xd2e4('0x4c')]({'where':{'id':_0x26feb0[_0xd2e4('0x4b')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0xd2e4('0x1f')](handleEntityNotFound(_0x2e0082,null))[_0xd2e4('0x1f')](function(_0x226adb){if(_0x226adb){if(_['isNil'](_0x226adb[_0xd2e4('0xac')])){return _0x2e0082[_0xd2e4('0xad')](_0x286f9b);}else{if(!fs[_0xd2e4('0xae')](path[_0xd2e4('0xa9')](config['root'],_0xd2e4('0xaf'),_0x226adb[_0xd2e4('0xac')]))){return _0x2e0082[_0xd2e4('0xad')](_0x286f9b);}return _0x2e0082[_0xd2e4('0xad')](path[_0xd2e4('0xa9')](config['root'],_0xd2e4('0xaf'),_0x226adb['userpic']));}}})[_0xd2e4('0x49')](handleError(_0x2e0082,null));};exports['getOpenTabs']=function(_0x4625e5,_0x479c6f){return db[_0xd2e4('0x2e')]['find']({'where':{'id':_0x4625e5[_0xd2e4('0x4b')]['id']},'attributes':['id']})[_0xd2e4('0x1f')](handleEntityNotFound(_0x479c6f,null))[_0xd2e4('0x1f')](function(_0x13140e){var _0x2c45ba=[];values=_0x13140e[_0xd2e4('0x46')];_0x2c45ba[_0xd2e4('0x41')](get_open_tabs('chat',_0x13140e[_0xd2e4('0x46')]));_0x2c45ba[_0xd2e4('0x41')](get_open_tabs(_0xd2e4('0x4e'),_0x13140e[_0xd2e4('0x46')]));_0x2c45ba['push'](get_open_tabs('openchannel',_0x13140e[_0xd2e4('0x46')]));_0x2c45ba['push'](get_open_tabs(_0xd2e4('0xb0'),_0x13140e['dataValues']));_0x2c45ba[_0xd2e4('0x41')](get_open_tabs('fax',_0x13140e[_0xd2e4('0x46')]));_0x2c45ba[_0xd2e4('0x41')](get_open_tabs(_0xd2e4('0x47'),_0x13140e[_0xd2e4('0x46')]));return Promise[_0xd2e4('0x48')](_0x2c45ba);})[_0xd2e4('0x1f')](function(_0x36bffe){if(_0x36bffe){var _0x4fa9bf=_[_0xd2e4('0x7e')](values[_0xd2e4('0xb1')],function(_0x4d89c8){return{'channel':_0xd2e4('0xb2'),'id':_0x4d89c8['id'],'createdAt':_0x4d89c8[_0xd2e4('0xb3')]};});var _0x3239e0=_[_0xd2e4('0x7e')](values[_0xd2e4('0xb4')],function(_0x2c0511){return{'channel':'FAX','id':_0x2c0511['id'],'createdAt':_0x2c0511[_0xd2e4('0xb3')]};});var _0x3b6f5e=_['map'](values[_0xd2e4('0xb5')],function(_0x500cd7){return{'channel':_0xd2e4('0xb6'),'id':_0x500cd7['id'],'createdAt':_0x500cd7[_0xd2e4('0xb3')]};});var _0x1dcd16=_[_0xd2e4('0x7e')](values[_0xd2e4('0xb7')],function(_0x352d1b){return{'channel':_0xd2e4('0xb8'),'id':_0x352d1b['id'],'createdAt':_0x352d1b[_0xd2e4('0xb3')]};});var _0x2e7112=_[_0xd2e4('0x7e')](values[_0xd2e4('0xb9')],function(_0x2130f6){return{'channel':_0xd2e4('0xba'),'id':_0x2130f6['id'],'createdAt':_0x2130f6[_0xd2e4('0xb3')]};});var _0x508d07=_['map'](values[_0xd2e4('0xbb')],function(_0x495f82){return{'channel':_0xd2e4('0xbc'),'id':_0x495f82['id'],'createdAt':_0x495f82['createdAt']};});var _0x2ab074=_[_0xd2e4('0xbd')](_0x4fa9bf,_0x3239e0,_0x3b6f5e,_0x1dcd16,_0x2e7112,_0x508d07);var _0x4b3175={'count':_0x2ab074[_0xd2e4('0x45')],'rows':_0x2ab074};return _0x4b3175;}else return null;})[_0xd2e4('0x1f')](respondWithResult(_0x479c6f,null))[_0xd2e4('0x49')](handleError(_0x479c6f,null));};exports[_0xd2e4('0xbe')]=function(_0x1298cd,_0x5e9304){var _0x1219be={};return db[_0xd2e4('0x2e')]['findOne']({'where':{'id':_0x1298cd[_0xd2e4('0x4b')]['id']}})[_0xd2e4('0x1f')](function(_0x53211c){if(!_0x53211c){throw new APINotFoundError(util['format']('User\x20with\x20id\x20%s\x20not\x20found',_0x1298cd['params']['id']));}return contacts['describe']();})[_0xd2e4('0x1f')](function(_0x363e0d){_0x1298cd[_0xd2e4('0x3a')]['User']=_0x1298cd[_0xd2e4('0x4b')]['id'];_0x1219be=qs[_0xd2e4('0x38')](_0x363e0d,_0x1298cd);if(_0x1298cd[_0xd2e4('0x3a')][_0xd2e4('0xbf')](_0xd2e4('0x3b'))){_0x1219be['include']=[{'model':db[_0xd2e4('0xc0')],'as':_0xd2e4('0xc1'),'required':![]},{'model':db[_0xd2e4('0xc2')],'as':'Tags','attributes':['id','name',_0xd2e4('0xc3')],'where':_0x1298cd[_0xd2e4('0x3a')]['tag']?{'id':_0x1298cd[_0xd2e4('0x3a')][_0xd2e4('0xc4')]}:undefined,'required':_0x1298cd[_0xd2e4('0x3a')][_0xd2e4('0xc4')]?!![]:![]}];}return contacts['findAll'](_0x1298cd['query'],_0x1298cd['user'],_0x1219be,_0x363e0d);})[_0xd2e4('0x1f')](respondWithFilteredResult(_0x5e9304,_0x1219be))[_0xd2e4('0x49')](APIHandleError(_0x5e9304));};exports[_0xd2e4('0xc5')]=function(_0x58c1e6,_0x65770d){var _0x222c9f;var _0x42d013={};var _0x2efc4c;return db[_0xd2e4('0x2e')][_0xd2e4('0x8b')]({'where':{'id':_0x58c1e6[_0xd2e4('0x4b')]['id']},'attributes':['id',_0xd2e4('0x2b'),'role']})[_0xd2e4('0x1f')](handleEntityNotFound(_0x65770d,null))['then'](function(_0x854400){if(!utils[_0xd2e4('0x93')](_0x58c1e6[_0xd2e4('0x3a')]['channel'])){throw new db['Sequelize']['ValidationError'](_0xd2e4('0x94'));}_0x222c9f=_0x854400;var _0x4942ee={};_0x4942ee['model']=_['keys'](db[_['capitalize'](_0x58c1e6['query'][_0xd2e4('0xa4')])+_0xd2e4('0xc6')][_0xd2e4('0x2f')]);_0x4942ee[_0xd2e4('0x3a')]=_[_0xd2e4('0xc7')](_0x58c1e6[_0xd2e4('0x3a')]);_0x4942ee[_0xd2e4('0xc8')]=_[_0xd2e4('0xc9')](_0x4942ee['model'],_0x4942ee[_0xd2e4('0x3a')]);_0x42d013[_0xd2e4('0x40')]=_['intersection'](_0x4942ee[_0xd2e4('0xca')],qs[_0xd2e4('0xcb')](_0x58c1e6['query'][_0xd2e4('0xcb')]));_0x42d013[_0xd2e4('0x40')]=_0x42d013[_0xd2e4('0x40')][_0xd2e4('0x45')]?_0x42d013[_0xd2e4('0x40')]:_0x4942ee[_0xd2e4('0xca')];_0x42d013[_0xd2e4('0xcc')]=qs[_0xd2e4('0xcd')](_0x58c1e6[_0xd2e4('0x3a')][_0xd2e4('0xcd')]);_0x42d013[_0xd2e4('0x39')]=qs['filters'](_[_0xd2e4('0xce')](_0x58c1e6[_0xd2e4('0x3a')],_0x4942ee[_0xd2e4('0xc8')]));if(_0x58c1e6[_0xd2e4('0x3a')][_0xd2e4('0x28')]){_0x42d013[_0xd2e4('0x39')]=_[_0xd2e4('0xcf')](_0x42d013[_0xd2e4('0x39')],{'$or':_[_0xd2e4('0x7e')](_0x42d013[_0xd2e4('0x40')],function(_0x43a64c){var _0xf130b4={};_0xf130b4[_0x43a64c]={'$like':'%'+_0x58c1e6['query'][_0xd2e4('0x28')]+'%'};return _0xf130b4;})});}_0x42d013=_[_0xd2e4('0xcf')]({},_0x42d013,_0x58c1e6[_0xd2e4('0xd0')]);switch(_0x222c9f[_0xd2e4('0x20')]){case _0xd2e4('0x24'):return db[_['capitalize'](_0x58c1e6[_0xd2e4('0x3a')][_0xd2e4('0xa4')])+_0xd2e4('0xc6')][_0xd2e4('0x42')](_0x42d013);case _0xd2e4('0x70'):case _0xd2e4('0x21'):return _0x222c9f[_0xd2e4('0x23')+_[_0xd2e4('0x96')](_0x58c1e6[_0xd2e4('0x3a')][_0xd2e4('0xa4')])+_0xd2e4('0x98')](_0x42d013);default:throw new db[(_0xd2e4('0x87'))]['ValidationError']('Unknown\x20role');}})[_0xd2e4('0x1f')](function(_0x45a3c9){_0x2efc4c=_0x45a3c9[_0xd2e4('0x45')];if(!_0x58c1e6[_0xd2e4('0x3a')]['hasOwnProperty']('nolimit')){_0x42d013[_0xd2e4('0x19')]=qs['limit'](_0x58c1e6['query'][_0xd2e4('0x19')]);_0x42d013[_0xd2e4('0x1b')]=qs[_0xd2e4('0x1b')](_0x58c1e6[_0xd2e4('0x3a')]['offset']);}switch(_0x222c9f[_0xd2e4('0x20')]){case'admin':return db[_['capitalize'](_0x58c1e6[_0xd2e4('0x3a')]['channel'])+_0xd2e4('0xc6')]['findAll'](_0x42d013);case _0xd2e4('0x70'):case _0xd2e4('0x21'):return _0x222c9f[_0xd2e4('0x23')+_[_0xd2e4('0x96')](_0x58c1e6['query'][_0xd2e4('0xa4')])+_0xd2e4('0x98')](_0x42d013);}})['then'](function(_0x497b2d){return{'count':_0x2efc4c,'rows':_0x497b2d};})[_0xd2e4('0x1f')](respondWithResult(_0x65770d,null))[_0xd2e4('0x49')](handleError(_0x65770d,null));};exports['getVoiceQueuesRt']=function(_0x57ebdf,_0x56641e){var _0x5b5eae={};var _0xa0fc25={};var _0x43010f;var _0x4e62e1;return db[_0xd2e4('0x2e')][_0xd2e4('0x8b')]({'where':{'id':_0x57ebdf[_0xd2e4('0x4b')]['id']}})['then'](handleEntityNotFound(_0x56641e,null))['then'](function(_0x516eb9){if(_0x516eb9){_0x43010f=_0x516eb9;_0xa0fc25[_0xd2e4('0xca')]=_['keys'](db[_0xd2e4('0xa1')][_0xd2e4('0x2f')]);_0xa0fc25[_0xd2e4('0x3a')]=_[_0xd2e4('0xc7')](_0x57ebdf[_0xd2e4('0x3a')]);_0xa0fc25[_0xd2e4('0xc8')]=_['intersection'](_0xa0fc25['model'],_0xa0fc25[_0xd2e4('0x3a')]);_0x5b5eae['attributes']=_[_0xd2e4('0xc9')](_0xa0fc25['model'],qs['fields'](_0x57ebdf[_0xd2e4('0x3a')]['fields']));_0x5b5eae[_0xd2e4('0x40')]=_0x5b5eae[_0xd2e4('0x40')]['length']?_0x5b5eae[_0xd2e4('0x40')]:_0xa0fc25[_0xd2e4('0xca')];_0x5b5eae[_0xd2e4('0xcc')]=qs['sort'](_0x57ebdf[_0xd2e4('0x3a')][_0xd2e4('0xcd')]);_0x5b5eae[_0xd2e4('0x39')]=qs['filters'](_[_0xd2e4('0xce')](_0x57ebdf[_0xd2e4('0x3a')],_0xa0fc25[_0xd2e4('0xc8')]));if(_0x57ebdf['query']['filter']){_0x5b5eae[_0xd2e4('0x39')]=_[_0xd2e4('0xcf')](_0x5b5eae[_0xd2e4('0x39')],{'$or':_[_0xd2e4('0x7e')](_0x5b5eae[_0xd2e4('0x40')],function(_0x50b59a){var _0x1fd0f3={};_0x1fd0f3[_0x50b59a]={'$like':'%'+_0x57ebdf[_0xd2e4('0x3a')][_0xd2e4('0x28')]+'%'};return _0x1fd0f3;})});}_0x5b5eae=_['merge']({},_0x5b5eae,_0x57ebdf[_0xd2e4('0xd0')]);return _0x43010f[_0xd2e4('0xd1')](_0x5b5eae);}})[_0xd2e4('0x1f')](function(_0x3d98bf){if(_0x3d98bf){_0x4e62e1=_0x3d98bf[_0xd2e4('0x45')];if(!_0x57ebdf[_0xd2e4('0x3a')][_0xd2e4('0xbf')](_0xd2e4('0xd2'))){_0x5b5eae[_0xd2e4('0x19')]=qs[_0xd2e4('0x19')](_0x57ebdf['query']['limit']);_0x5b5eae[_0xd2e4('0x1b')]=qs[_0xd2e4('0x1b')](_0x57ebdf[_0xd2e4('0x3a')]['offset']);}return _0x43010f[_0xd2e4('0xd1')](_0x5b5eae);}})['then'](function(_0x1ee656){if(_0x1ee656){return _0x1ee656?{'count':_0x4e62e1,'rows':_0x1ee656}:null;}})[_0xd2e4('0x1f')](respondWithResult(_0x56641e,null))[_0xd2e4('0x49')](handleError(_0x56641e,null));};exports[_0xd2e4('0xd3')]=function(_0x321941,_0x48b34f){var _0x2c1cf6={};var _0x5249bb={};var _0x4be0de;var _0xd5a5a3;return db[_0xd2e4('0x2e')][_0xd2e4('0x8b')]({'where':{'id':_0x321941[_0xd2e4('0x4b')]['id']}})[_0xd2e4('0x1f')](handleEntityNotFound(_0x48b34f,null))['then'](function(_0x52a9bf){if(_0x52a9bf){_0x4be0de=_0x52a9bf;_0x5249bb['model']=_[_0xd2e4('0xc7')](db[_0xd2e4('0xd4')][_0xd2e4('0x2f')]);_0x5249bb['query']=_['keys'](_0x321941['query']);_0x5249bb['filters']=_[_0xd2e4('0xc9')](_0x5249bb[_0xd2e4('0xca')],_0x5249bb[_0xd2e4('0x3a')]);_0x2c1cf6[_0xd2e4('0x40')]=_[_0xd2e4('0xc9')](_0x5249bb['model'],qs[_0xd2e4('0xcb')](_0x321941[_0xd2e4('0x3a')][_0xd2e4('0xcb')]));_0x2c1cf6[_0xd2e4('0x40')]=_0x2c1cf6[_0xd2e4('0x40')][_0xd2e4('0x45')]?_0x2c1cf6[_0xd2e4('0x40')]:_0x5249bb[_0xd2e4('0xca')];_0x2c1cf6[_0xd2e4('0xcc')]=qs[_0xd2e4('0xcd')](_0x321941[_0xd2e4('0x3a')][_0xd2e4('0xcd')]);_0x2c1cf6[_0xd2e4('0x39')]=qs['filters'](_[_0xd2e4('0xce')](_0x321941[_0xd2e4('0x3a')],_0x5249bb[_0xd2e4('0xc8')]));if(_0x321941[_0xd2e4('0x3a')][_0xd2e4('0x28')]){_0x2c1cf6['where']=_[_0xd2e4('0xcf')](_0x2c1cf6[_0xd2e4('0x39')],{'$or':_['map'](_0x2c1cf6[_0xd2e4('0x40')],function(_0x1aec4a){var _0x92d80d={};_0x92d80d[_0x1aec4a]={'$like':'%'+_0x321941[_0xd2e4('0x3a')][_0xd2e4('0x28')]+'%'};return _0x92d80d;})});}_0x2c1cf6=_[_0xd2e4('0xcf')]({},_0x2c1cf6,_0x321941['options']);return _0x4be0de['getGroups'](_0x2c1cf6);}})['then'](function(_0x593d4e){if(_0x593d4e){_0xd5a5a3=_0x593d4e['length'];if(!_0x321941[_0xd2e4('0x3a')][_0xd2e4('0xbf')](_0xd2e4('0xd2'))){_0x2c1cf6['limit']=qs[_0xd2e4('0x19')](_0x321941[_0xd2e4('0x3a')][_0xd2e4('0x19')]);_0x2c1cf6[_0xd2e4('0x1b')]=qs[_0xd2e4('0x1b')](_0x321941[_0xd2e4('0x3a')][_0xd2e4('0x1b')]);}return _0x4be0de[_0xd2e4('0xd3')](_0x2c1cf6);}})[_0xd2e4('0x1f')](function(_0x113368){if(_0x113368){return _0x113368?{'count':_0xd5a5a3,'rows':_0x113368}:null;}})[_0xd2e4('0x1f')](respondWithResult(_0x48b34f,null))[_0xd2e4('0x49')](handleError(_0x48b34f,null));};exports[_0xd2e4('0xd5')]=function(_0x49245d,_0x14081e){var _0xfb71d2={'raw':!![],'where':{}};var _0x30790b={};var _0x111af3={'count':0x0,'rows':[]};return db['User'][_0xd2e4('0x8b')]({'where':{'id':_0x49245d['params']['id']}})[_0xd2e4('0x1f')](handleEntityNotFound(_0x14081e,null))[_0xd2e4('0x1f')](function(_0x24e69b){if(_0x24e69b){_0x30790b[_0xd2e4('0xca')]=_[_0xd2e4('0xc7')](db['VoiceRecording'][_0xd2e4('0x2f')]);_0x30790b[_0xd2e4('0x3a')]=_['keys'](_0x49245d['query']);_0x30790b[_0xd2e4('0xc8')]=_['intersection'](_0x30790b['model'],_0x30790b[_0xd2e4('0x3a')]);_0xfb71d2[_0xd2e4('0x40')]=_['intersection'](_0x30790b[_0xd2e4('0xca')],qs['fields'](_0x49245d['query'][_0xd2e4('0xcb')]));_0xfb71d2[_0xd2e4('0x40')]=_0xfb71d2['attributes'][_0xd2e4('0x45')]?_0xfb71d2[_0xd2e4('0x40')]:_0x30790b['model'];if(!_0x49245d[_0xd2e4('0x3a')][_0xd2e4('0xbf')](_0xd2e4('0xd2'))){_0xfb71d2[_0xd2e4('0x19')]=qs['limit'](_0x49245d[_0xd2e4('0x3a')]['limit']);_0xfb71d2[_0xd2e4('0x1b')]=qs[_0xd2e4('0x1b')](_0x49245d['query'][_0xd2e4('0x1b')]);}_0xfb71d2[_0xd2e4('0xcc')]=qs[_0xd2e4('0xcd')](_0x49245d['query'][_0xd2e4('0xcd')]);_0xfb71d2['where']=qs[_0xd2e4('0xc8')](_['pick'](_0x49245d[_0xd2e4('0x3a')],_0x30790b['filters']));_0xfb71d2[_0xd2e4('0x39')]['UserId']=_0x24e69b['id'];if(_0x49245d[_0xd2e4('0x3a')][_0xd2e4('0x28')]){_0xfb71d2[_0xd2e4('0x39')]=_['merge'](_0xfb71d2['where'],{'$or':_['map'](_0xfb71d2['attributes'],function(_0x1f2e60){var _0x2507a8={};_0x2507a8[_0x1f2e60]={'$like':'%'+_0x49245d['query'][_0xd2e4('0x28')]+'%'};return _0x2507a8;})});}_0xfb71d2=_[_0xd2e4('0xcf')]({},_0xfb71d2,_0x49245d[_0xd2e4('0xd0')]);return db[_0xd2e4('0xd6')][_0xd2e4('0x1a')]({'where':_0xfb71d2[_0xd2e4('0x39')]})[_0xd2e4('0x1f')](function(_0x258bb6){_0x111af3['count']=_0x258bb6;if(_0x49245d[_0xd2e4('0x3a')][_0xd2e4('0x3b')]){_0xfb71d2[_0xd2e4('0x3c')]=[{'all':!![]}];}return db['VoiceRecording'][_0xd2e4('0x42')](_0xfb71d2);})[_0xd2e4('0x1f')](function(_0xe87e3b){_0x111af3['rows']=_0xe87e3b;return _0x111af3;});}})['then'](respondWithFilteredResult(_0x14081e,_0xfb71d2))[_0xd2e4('0x49')](handleError(_0x14081e,null));};exports[_0xd2e4('0xd7')]=function(_0x403c3b,_0xdb2d47){var _0x5b1109={'raw':!![],'where':{}};var _0x56df74={};var _0x24bf84={'count':0x0,'rows':[]};return db[_0xd2e4('0x2e')][_0xd2e4('0x8b')]({'where':{'id':_0x403c3b[_0xd2e4('0x4b')]['id']}})['then'](handleEntityNotFound(_0xdb2d47,null))[_0xd2e4('0x1f')](function(_0x4b64d5){if(_0x4b64d5){_0x56df74['model']=_[_0xd2e4('0xc7')](db['ScreenRecording'][_0xd2e4('0x2f')]);_0x56df74[_0xd2e4('0x3a')]=_[_0xd2e4('0xc7')](_0x403c3b[_0xd2e4('0x3a')]);_0x56df74[_0xd2e4('0xc8')]=_[_0xd2e4('0xc9')](_0x56df74[_0xd2e4('0xca')],_0x56df74[_0xd2e4('0x3a')]);_0x5b1109[_0xd2e4('0x40')]=_[_0xd2e4('0xc9')](_0x56df74[_0xd2e4('0xca')],qs[_0xd2e4('0xcb')](_0x403c3b[_0xd2e4('0x3a')][_0xd2e4('0xcb')]));_0x5b1109[_0xd2e4('0x40')]=_0x5b1109[_0xd2e4('0x40')][_0xd2e4('0x45')]?_0x5b1109[_0xd2e4('0x40')]:_0x56df74[_0xd2e4('0xca')];if(!_0x403c3b[_0xd2e4('0x3a')][_0xd2e4('0xbf')](_0xd2e4('0xd2'))){_0x5b1109[_0xd2e4('0x19')]=qs['limit'](_0x403c3b[_0xd2e4('0x3a')]['limit']);_0x5b1109[_0xd2e4('0x1b')]=qs[_0xd2e4('0x1b')](_0x403c3b['query'][_0xd2e4('0x1b')]);}_0x5b1109['order']=qs['sort'](_0x403c3b[_0xd2e4('0x3a')][_0xd2e4('0xcd')]);_0x5b1109[_0xd2e4('0x39')]=qs[_0xd2e4('0xc8')](_['pick'](_0x403c3b['query'],_0x56df74[_0xd2e4('0xc8')]));_0x5b1109[_0xd2e4('0x39')][_0xd2e4('0xd8')]=_0x4b64d5['id'];if(_0x403c3b[_0xd2e4('0x3a')][_0xd2e4('0x28')]){_0x5b1109[_0xd2e4('0x39')]=_[_0xd2e4('0xcf')](_0x5b1109[_0xd2e4('0x39')],{'$or':_['map'](_0x5b1109[_0xd2e4('0x40')],function(_0x160f81){var _0x2d4698={};_0x2d4698[_0x160f81]={'$like':'%'+_0x403c3b[_0xd2e4('0x3a')][_0xd2e4('0x28')]+'%'};return _0x2d4698;})});}_0x5b1109=_[_0xd2e4('0xcf')]({},_0x5b1109,_0x403c3b[_0xd2e4('0xd0')]);return db[_0xd2e4('0xd9')][_0xd2e4('0x1a')]({'where':_0x5b1109[_0xd2e4('0x39')]})[_0xd2e4('0x1f')](function(_0x1c3780){_0x24bf84[_0xd2e4('0x1a')]=_0x1c3780;if(_0x403c3b[_0xd2e4('0x3a')][_0xd2e4('0x3b')]){_0x5b1109[_0xd2e4('0x3c')]=[{'all':!![]}];}return db[_0xd2e4('0xd9')][_0xd2e4('0x42')](_0x5b1109);})[_0xd2e4('0x1f')](function(_0x3783b6){_0x24bf84[_0xd2e4('0x43')]=_0x3783b6;return _0x24bf84;});}})['then'](respondWithFilteredResult(_0xdb2d47,_0x5b1109))[_0xd2e4('0x49')](handleError(_0xdb2d47,null));};exports['getChatInteractions']=function(_0xfb9885,_0x2fe59f){var _0x4e8ff0={};var _0x5a7fb1={};var _0x1ecda0;var _0x501dc0;return db[_0xd2e4('0x2e')]['findOne']({'where':{'id':_0xfb9885[_0xd2e4('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2fe59f,null))['then'](function(_0x2e76b5){if(_0x2e76b5){_0x1ecda0=_0x2e76b5;_0x5a7fb1['model']=_[_0xd2e4('0xc7')](db[_0xd2e4('0xda')]['rawAttributes']);_0x5a7fb1[_0xd2e4('0x3a')]=_['keys'](_0xfb9885[_0xd2e4('0x3a')]);_0x5a7fb1[_0xd2e4('0xc8')]=_[_0xd2e4('0xc9')](_0x5a7fb1[_0xd2e4('0xca')],_0x5a7fb1[_0xd2e4('0x3a')]);_0x4e8ff0[_0xd2e4('0x40')]=_[_0xd2e4('0xc9')](_0x5a7fb1[_0xd2e4('0xca')],qs[_0xd2e4('0xcb')](_0xfb9885['query'][_0xd2e4('0xcb')]));_0x4e8ff0[_0xd2e4('0x40')]=_0x4e8ff0['attributes'][_0xd2e4('0x45')]?_0x4e8ff0[_0xd2e4('0x40')]:_0x5a7fb1[_0xd2e4('0xca')];_0x4e8ff0[_0xd2e4('0xcc')]=qs[_0xd2e4('0xcd')](_0xfb9885[_0xd2e4('0x3a')]['sort']);_0x4e8ff0[_0xd2e4('0x39')]=qs[_0xd2e4('0xc8')](_['pick'](_0xfb9885['query'],_0x5a7fb1[_0xd2e4('0xc8')]));if(_0xfb9885[_0xd2e4('0x3a')][_0xd2e4('0x28')]){_0x4e8ff0[_0xd2e4('0x39')]=_[_0xd2e4('0xcf')](_0x4e8ff0[_0xd2e4('0x39')],{'$or':_[_0xd2e4('0x7e')](_0x4e8ff0['attributes'],function(_0x2face9){var _0x24414a={};_0x24414a[_0x2face9]={'$like':'%'+_0xfb9885['query']['filter']+'%'};return _0x24414a;})});}_0x4e8ff0=_[_0xd2e4('0xcf')]({},_0x4e8ff0,_0xfb9885[_0xd2e4('0xd0')]);return _0x1ecda0['getChatInteractions'](_0x4e8ff0);}})[_0xd2e4('0x1f')](function(_0x396792){if(_0x396792){_0x501dc0=_0x396792[_0xd2e4('0x45')];if(!_0xfb9885[_0xd2e4('0x3a')][_0xd2e4('0xbf')](_0xd2e4('0xd2'))){_0x4e8ff0[_0xd2e4('0x19')]=qs[_0xd2e4('0x19')](_0xfb9885[_0xd2e4('0x3a')][_0xd2e4('0x19')]);_0x4e8ff0[_0xd2e4('0x1b')]=qs[_0xd2e4('0x1b')](_0xfb9885[_0xd2e4('0x3a')][_0xd2e4('0x1b')]);}return _0x1ecda0['getChatInteractions'](_0x4e8ff0);}})[_0xd2e4('0x1f')](function(_0x169364){if(_0x169364){return _0x169364?{'count':_0x501dc0,'rows':_0x169364}:null;}})[_0xd2e4('0x1f')](respondWithResult(_0x2fe59f,null))['catch'](handleError(_0x2fe59f,null));};exports[_0xd2e4('0xdb')]=function(_0x419700,_0x3109b6){var _0x3ccbc5={};var _0x3ae755={};var _0x33bd51;var _0x493b77;return db['User'][_0xd2e4('0x8b')]({'where':{'id':_0x419700[_0xd2e4('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3109b6,null))['then'](function(_0x7d87fa){if(_0x7d87fa){_0x33bd51=_0x7d87fa;_0x3ae755[_0xd2e4('0xca')]=_[_0xd2e4('0xc7')](db[_0xd2e4('0xdc')][_0xd2e4('0x2f')]);_0x3ae755[_0xd2e4('0x3a')]=_[_0xd2e4('0xc7')](_0x419700[_0xd2e4('0x3a')]);_0x3ae755[_0xd2e4('0xc8')]=_[_0xd2e4('0xc9')](_0x3ae755['model'],_0x3ae755[_0xd2e4('0x3a')]);_0x3ccbc5['attributes']=_['intersection'](_0x3ae755[_0xd2e4('0xca')],qs[_0xd2e4('0xcb')](_0x419700['query'][_0xd2e4('0xcb')]));_0x3ccbc5[_0xd2e4('0x40')]=_0x3ccbc5[_0xd2e4('0x40')][_0xd2e4('0x45')]?_0x3ccbc5[_0xd2e4('0x40')]:_0x3ae755[_0xd2e4('0xca')];_0x3ccbc5[_0xd2e4('0xcc')]=qs['sort'](_0x419700[_0xd2e4('0x3a')]['sort']);_0x3ccbc5[_0xd2e4('0x39')]=qs[_0xd2e4('0xc8')](_[_0xd2e4('0xce')](_0x419700[_0xd2e4('0x3a')],_0x3ae755['filters']));if(_0x419700[_0xd2e4('0x3a')][_0xd2e4('0x28')]){_0x3ccbc5[_0xd2e4('0x39')]=_[_0xd2e4('0xcf')](_0x3ccbc5[_0xd2e4('0x39')],{'$or':_[_0xd2e4('0x7e')](_0x3ccbc5['attributes'],function(_0x38b054){var _0x201655={};_0x201655[_0x38b054]={'$like':'%'+_0x419700[_0xd2e4('0x3a')][_0xd2e4('0x28')]+'%'};return _0x201655;})});}_0x3ccbc5=_['merge']({},_0x3ccbc5,_0x419700[_0xd2e4('0xd0')]);return _0x33bd51['getOpenchannelInteractions'](_0x3ccbc5);}})[_0xd2e4('0x1f')](function(_0xa9f774){if(_0xa9f774){_0x493b77=_0xa9f774['length'];if(!_0x419700[_0xd2e4('0x3a')][_0xd2e4('0xbf')](_0xd2e4('0xd2'))){_0x3ccbc5[_0xd2e4('0x19')]=qs[_0xd2e4('0x19')](_0x419700[_0xd2e4('0x3a')][_0xd2e4('0x19')]);_0x3ccbc5[_0xd2e4('0x1b')]=qs['offset'](_0x419700[_0xd2e4('0x3a')][_0xd2e4('0x1b')]);}return _0x33bd51[_0xd2e4('0xdb')](_0x3ccbc5);}})['then'](function(_0x414127){if(_0x414127){return _0x414127?{'count':_0x493b77,'rows':_0x414127}:null;}})['then'](respondWithResult(_0x3109b6,null))[_0xd2e4('0x49')](handleError(_0x3109b6,null));};exports[_0xd2e4('0xdd')]=function(_0x4b3603,_0x6d5953){var _0x4f796a={'raw':!![],'where':{}};var _0x364711={};var _0x35834a={'count':0x0,'rows':[]};return db[_0xd2e4('0x2e')][_0xd2e4('0x8b')]({'where':{'id':_0x4b3603[_0xd2e4('0x4b')]['id']}})[_0xd2e4('0x1f')](handleEntityNotFound(_0x6d5953,null))[_0xd2e4('0x1f')](function(_0x850987){if(_0x850987){_0x364711[_0xd2e4('0xca')]=_[_0xd2e4('0xc7')](db[_0xd2e4('0xde')]['rawAttributes']);_0x364711['query']=_[_0xd2e4('0xc7')](_0x4b3603['query']);_0x364711[_0xd2e4('0xc8')]=_['intersection'](_0x364711['model'],_0x364711[_0xd2e4('0x3a')]);_0x4f796a[_0xd2e4('0x40')]=_[_0xd2e4('0xc9')](_0x364711[_0xd2e4('0xca')],qs[_0xd2e4('0xcb')](_0x4b3603[_0xd2e4('0x3a')][_0xd2e4('0xcb')]));_0x4f796a[_0xd2e4('0x40')]=_0x4f796a[_0xd2e4('0x40')]['length']?_0x4f796a[_0xd2e4('0x40')]:_0x364711[_0xd2e4('0xca')];if(!_0x4b3603[_0xd2e4('0x3a')]['hasOwnProperty']('nolimit')){_0x4f796a['limit']=qs[_0xd2e4('0x19')](_0x4b3603['query'][_0xd2e4('0x19')]);_0x4f796a[_0xd2e4('0x1b')]=qs[_0xd2e4('0x1b')](_0x4b3603[_0xd2e4('0x3a')][_0xd2e4('0x1b')]);}_0x4f796a[_0xd2e4('0xcc')]=qs[_0xd2e4('0xcd')](_0x4b3603['query']['sort']);_0x4f796a['where']=qs[_0xd2e4('0xc8')](_['pick'](_0x4b3603[_0xd2e4('0x3a')],_0x364711[_0xd2e4('0xc8')]));_0x4f796a[_0xd2e4('0x39')][_0xd2e4('0xd8')]=_0x850987['id'];if(_0x4b3603[_0xd2e4('0x3a')][_0xd2e4('0x28')]){_0x4f796a[_0xd2e4('0x39')]=_['merge'](_0x4f796a[_0xd2e4('0x39')],{'$or':_['map'](_0x4f796a[_0xd2e4('0x40')],function(_0x419210){var _0x83a1c4={};_0x83a1c4[_0x419210]={'$like':'%'+_0x4b3603[_0xd2e4('0x3a')]['filter']+'%'};return _0x83a1c4;})});}_0x4f796a=_[_0xd2e4('0xcf')]({},_0x4f796a,_0x4b3603[_0xd2e4('0xd0')]);return db[_0xd2e4('0xde')][_0xd2e4('0x1a')]({'where':_0x4f796a[_0xd2e4('0x39')]})[_0xd2e4('0x1f')](function(_0x5c6fa6){_0x35834a[_0xd2e4('0x1a')]=_0x5c6fa6;if(_0x4b3603['query'][_0xd2e4('0x3b')]){_0x4f796a[_0xd2e4('0x3c')]=[{'all':!![]}];}return db[_0xd2e4('0xde')][_0xd2e4('0x42')](_0x4f796a);})['then'](function(_0x341ec8){_0x35834a[_0xd2e4('0x43')]=_0x341ec8;return _0x35834a;});}})['then'](respondWithFilteredResult(_0x6d5953,_0x4f796a))[_0xd2e4('0x49')](handleError(_0x6d5953,null));};exports[_0xd2e4('0xdf')]=function(_0x4fc561,_0x238226){var _0x3c73af={};var _0xb411ed={};var _0x434e64;var _0x4b039f;return db['User']['findOne']({'where':{'id':_0x4fc561[_0xd2e4('0x4b')]['id']}})['then'](handleEntityNotFound(_0x238226,null))[_0xd2e4('0x1f')](function(_0x1823a8){if(_0x1823a8){_0x434e64=_0x1823a8;_0xb411ed[_0xd2e4('0xca')]=_[_0xd2e4('0xc7')](db[_0xd2e4('0xe0')][_0xd2e4('0x2f')]);_0xb411ed[_0xd2e4('0x3a')]=_[_0xd2e4('0xc7')](_0x4fc561[_0xd2e4('0x3a')]);_0xb411ed['filters']=_['intersection'](_0xb411ed['model'],_0xb411ed['query']);_0x3c73af[_0xd2e4('0x40')]=_['intersection'](_0xb411ed[_0xd2e4('0xca')],qs['fields'](_0x4fc561[_0xd2e4('0x3a')][_0xd2e4('0xcb')]));_0x3c73af[_0xd2e4('0x40')]=_0x3c73af[_0xd2e4('0x40')][_0xd2e4('0x45')]?_0x3c73af['attributes']:_0xb411ed[_0xd2e4('0xca')];_0x3c73af['order']=qs['sort'](_0x4fc561[_0xd2e4('0x3a')][_0xd2e4('0xcd')]);_0x3c73af[_0xd2e4('0x39')]=qs[_0xd2e4('0xc8')](_['pick'](_0x4fc561[_0xd2e4('0x3a')],_0xb411ed[_0xd2e4('0xc8')]));if(_0x4fc561['query']['filter']){_0x3c73af[_0xd2e4('0x39')]=_[_0xd2e4('0xcf')](_0x3c73af['where'],{'$or':_[_0xd2e4('0x7e')](_0x3c73af['attributes'],function(_0x5bdcdf){var _0xb75ce1={};_0xb75ce1[_0x5bdcdf]={'$like':'%'+_0x4fc561[_0xd2e4('0x3a')][_0xd2e4('0x28')]+'%'};return _0xb75ce1;})});}_0x3c73af=_[_0xd2e4('0xcf')]({},_0x3c73af,_0x4fc561[_0xd2e4('0xd0')]);return _0x434e64[_0xd2e4('0xdf')](_0x3c73af);}})[_0xd2e4('0x1f')](function(_0x23abbf){if(_0x23abbf){_0x4b039f=_0x23abbf[_0xd2e4('0x45')];if(!_0x4fc561['query'][_0xd2e4('0xbf')]('nolimit')){_0x3c73af[_0xd2e4('0x19')]=qs[_0xd2e4('0x19')](_0x4fc561[_0xd2e4('0x3a')][_0xd2e4('0x19')]);_0x3c73af[_0xd2e4('0x1b')]=qs['offset'](_0x4fc561['query']['offset']);}return _0x434e64[_0xd2e4('0xdf')](_0x3c73af);}})[_0xd2e4('0x1f')](function(_0x94573d){if(_0x94573d){return _0x94573d?{'count':_0x4b039f,'rows':_0x94573d}:null;}})['then'](respondWithResult(_0x238226,null))[_0xd2e4('0x49')](handleError(_0x238226,null));};exports[_0xd2e4('0xe1')]=function(_0x1ac99e,_0x9ab45e){var _0x604c33={};var _0x363bf9={};var _0x4a5f28;var _0x163ccd;return db[_0xd2e4('0x2e')][_0xd2e4('0x8b')]({'where':{'id':_0x1ac99e[_0xd2e4('0x4b')]['id']}})['then'](handleEntityNotFound(_0x9ab45e,null))[_0xd2e4('0x1f')](function(_0x115294){if(_0x115294){_0x4a5f28=_0x115294;_0x363bf9[_0xd2e4('0xca')]=_[_0xd2e4('0xc7')](db[_0xd2e4('0xe2')][_0xd2e4('0x2f')]);_0x363bf9[_0xd2e4('0x3a')]=_[_0xd2e4('0xc7')](_0x1ac99e['query']);_0x363bf9['filters']=_[_0xd2e4('0xc9')](_0x363bf9[_0xd2e4('0xca')],_0x363bf9[_0xd2e4('0x3a')]);_0x604c33['attributes']=_[_0xd2e4('0xc9')](_0x363bf9[_0xd2e4('0xca')],qs[_0xd2e4('0xcb')](_0x1ac99e[_0xd2e4('0x3a')][_0xd2e4('0xcb')]));_0x604c33[_0xd2e4('0x40')]=_0x604c33[_0xd2e4('0x40')][_0xd2e4('0x45')]?_0x604c33[_0xd2e4('0x40')]:_0x363bf9[_0xd2e4('0xca')];_0x604c33[_0xd2e4('0xcc')]=qs['sort'](_0x1ac99e['query'][_0xd2e4('0xcd')]);_0x604c33[_0xd2e4('0x39')]=qs[_0xd2e4('0xc8')](_[_0xd2e4('0xce')](_0x1ac99e[_0xd2e4('0x3a')],_0x363bf9[_0xd2e4('0xc8')]));if(_0x1ac99e[_0xd2e4('0x3a')][_0xd2e4('0x28')]){_0x604c33[_0xd2e4('0x39')]=_[_0xd2e4('0xcf')](_0x604c33[_0xd2e4('0x39')],{'$or':_['map'](_0x604c33[_0xd2e4('0x40')],function(_0x226876){var _0x2ad230={};_0x2ad230[_0x226876]={'$like':'%'+_0x1ac99e[_0xd2e4('0x3a')][_0xd2e4('0x28')]+'%'};return _0x2ad230;})});}_0x604c33=_[_0xd2e4('0xcf')]({},_0x604c33,_0x1ac99e[_0xd2e4('0xd0')]);return _0x4a5f28[_0xd2e4('0xe1')](_0x604c33);}})[_0xd2e4('0x1f')](function(_0x231197){if(_0x231197){_0x163ccd=_0x231197[_0xd2e4('0x45')];if(!_0x1ac99e[_0xd2e4('0x3a')]['hasOwnProperty'](_0xd2e4('0xd2'))){_0x604c33[_0xd2e4('0x19')]=qs['limit'](_0x1ac99e[_0xd2e4('0x3a')][_0xd2e4('0x19')]);_0x604c33[_0xd2e4('0x1b')]=qs[_0xd2e4('0x1b')](_0x1ac99e[_0xd2e4('0x3a')][_0xd2e4('0x1b')]);}return _0x4a5f28['getFaxInteractions'](_0x604c33);}})[_0xd2e4('0x1f')](function(_0x24fbfa){if(_0x24fbfa){return _0x24fbfa?{'count':_0x163ccd,'rows':_0x24fbfa}:null;}})['then'](respondWithResult(_0x9ab45e,null))[_0xd2e4('0x49')](handleError(_0x9ab45e,null));};exports[_0xd2e4('0xe3')]=function(_0x14ae07,_0xad285e){var _0x1bc1df={};var _0x9f7de1={};var _0x402702;var _0x5be7fd;return db[_0xd2e4('0x2e')]['findOne']({'where':{'id':_0x14ae07['params']['id']}})['then'](handleEntityNotFound(_0xad285e,null))['then'](function(_0x37e44a){if(_0x37e44a){_0x402702=_0x37e44a;_0x9f7de1['model']=_['keys'](db[_0xd2e4('0xe4')][_0xd2e4('0x2f')]);_0x9f7de1['query']=_[_0xd2e4('0xc7')](_0x14ae07[_0xd2e4('0x3a')]);_0x9f7de1[_0xd2e4('0xc8')]=_[_0xd2e4('0xc9')](_0x9f7de1[_0xd2e4('0xca')],_0x9f7de1[_0xd2e4('0x3a')]);_0x1bc1df[_0xd2e4('0x40')]=_[_0xd2e4('0xc9')](_0x9f7de1['model'],qs['fields'](_0x14ae07[_0xd2e4('0x3a')][_0xd2e4('0xcb')]));_0x1bc1df['attributes']=_0x1bc1df[_0xd2e4('0x40')][_0xd2e4('0x45')]?_0x1bc1df[_0xd2e4('0x40')]:_0x9f7de1[_0xd2e4('0xca')];_0x1bc1df['order']=qs[_0xd2e4('0xcd')](_0x14ae07[_0xd2e4('0x3a')][_0xd2e4('0xcd')]);_0x1bc1df[_0xd2e4('0x39')]=qs[_0xd2e4('0xc8')](_['pick'](_0x14ae07[_0xd2e4('0x3a')],_0x9f7de1[_0xd2e4('0xc8')]));if(_0x14ae07['query'][_0xd2e4('0x28')]){_0x1bc1df[_0xd2e4('0x39')]=_[_0xd2e4('0xcf')](_0x1bc1df[_0xd2e4('0x39')],{'$or':_[_0xd2e4('0x7e')](_0x1bc1df[_0xd2e4('0x40')],function(_0x56b054){var _0x1d738a={};_0x1d738a[_0x56b054]={'$like':'%'+_0x14ae07['query']['filter']+'%'};return _0x1d738a;})});}_0x1bc1df=_[_0xd2e4('0xcf')]({},_0x1bc1df,_0x14ae07[_0xd2e4('0xd0')]);return _0x402702[_0xd2e4('0xe3')](_0x1bc1df);}})[_0xd2e4('0x1f')](function(_0x5d7535){if(_0x5d7535){_0x5be7fd=_0x5d7535[_0xd2e4('0x45')];if(!_0x14ae07[_0xd2e4('0x3a')][_0xd2e4('0xbf')](_0xd2e4('0xd2'))){_0x1bc1df['limit']=qs['limit'](_0x14ae07[_0xd2e4('0x3a')]['limit']);_0x1bc1df[_0xd2e4('0x1b')]=qs[_0xd2e4('0x1b')](_0x14ae07[_0xd2e4('0x3a')]['offset']);}return _0x402702[_0xd2e4('0xe3')](_0x1bc1df);}})[_0xd2e4('0x1f')](function(_0x2da540){if(_0x2da540){return _0x2da540?{'count':_0x5be7fd,'rows':_0x2da540}:null;}})['then'](respondWithResult(_0xad285e,null))[_0xd2e4('0x49')](handleError(_0xad285e,null));};exports[_0xd2e4('0xe5')]=function(_0x3bde58,_0x1251a3,_0x1ca85f){var _0x5e1e01;var _0x33d6e6;var _0x20ccfd;var _0x3efb66=!_['isNil'](_0x3bde58[_0xd2e4('0x4b')]['id'])?_0x3bde58['params']['id']:!_[_0xd2e4('0x5a')](_0x3bde58[_0xd2e4('0x70')]['id'])?_0x3bde58[_0xd2e4('0x70')]['id']:null;return db[_0xd2e4('0x2e')][_0xd2e4('0x4c')]({'where':{'id':_0x3efb66,'role':{'$or':[_0xd2e4('0x24'),'user',_0xd2e4('0x21')]}},'attributes':['id',_0xd2e4('0x2b'),'phone',_0xd2e4('0xe6'),_0xd2e4('0x20'),'internal',_0xd2e4('0x91')]})[_0xd2e4('0x1f')](function(_0x5a1454){if(_0x5a1454){if(_0x5a1454[_0xd2e4('0x20')]===_0xd2e4('0x21')){_0x5e1e01=_0x5a1454;if(_0x3bde58[_0xd2e4('0x51')][_0xd2e4('0x92')]){_0x20ccfd=util['format'](_0xd2e4('0xe7'),_0x5e1e01[_0x3bde58['body']['interface']]);}else if(_0x3bde58[_0xd2e4('0x51')]['intrf']){_0x20ccfd=util[_0xd2e4('0x9e')](_0xd2e4('0x9f'),_0x3bde58[_0xd2e4('0x51')][_0xd2e4('0xe8')]);}else{_0x20ccfd=util[_0xd2e4('0x9e')](_0xd2e4('0x9f'),_0x5e1e01[_0xd2e4('0x2b')]);}socket['to'](util[_0xd2e4('0x9e')]('user:%s',_0x5e1e01[_0xd2e4('0x2b')]))['emit'](_0xd2e4('0xe9'),{'user':{'id':_0x5e1e01['id'],'name':_0x5e1e01[_0xd2e4('0x2b')]},'ip':_0x3bde58[_0xd2e4('0xea')][_0xd2e4('0xeb')]||_0x3bde58[_0xd2e4('0xec')][_0xd2e4('0xed')]||_0x3bde58[_0xd2e4('0xee')][_0xd2e4('0xed')]||_0x3bde58['connection'][_0xd2e4('0xee')]['remoteAddress']});return db[_0xd2e4('0xa1')][_0xd2e4('0x22')]({'where':{'membername':_0x5e1e01['name']},'individualHooks':!![]});}}else{throw new db[(_0xd2e4('0x87'))][(_0xd2e4('0x84'))](_0xd2e4('0xef'));}})[_0xd2e4('0x1f')](function(){if(_0x5e1e01){return _0x5e1e01[_0xd2e4('0xf0')]({'raw':!![]});}})[_0xd2e4('0x1f')](function(_0x2be736){if(_0x5e1e01){if(_0x2be736){_0x33d6e6=_0x2be736;if(_0x33d6e6[_0xd2e4('0x45')]){var _0x2f74f6=_0x33d6e6[_0xd2e4('0x7e')](function(_0x3063dd){var _0x273197={'membername':_0x5e1e01[_0xd2e4('0x2b')],'UserId':_0x5e1e01['id'],'queue_name':_0x3063dd[_0xd2e4('0x2b')],'VoiceQueueId':_0x3063dd['id'],'interface':_0x20ccfd,'paused':_0x5e1e01[_0xd2e4('0x91')]||![],'penalty':_0x3063dd[_0xd2e4('0xf1')]||0x0};return db[_0xd2e4('0xa1')][_0xd2e4('0xa2')](_0x273197);});return Promise['all'](_0x2f74f6);}}}})[_0xd2e4('0x1f')](function(){if(_0x5e1e01){return db[_0xd2e4('0xf2')]['findAll']({'where':{'membername':_0x5e1e01[_0xd2e4('0x2b')],'exitAt':null}});}})[_0xd2e4('0x1f')](function(_0x141c8e){if(_0x5e1e01){var _0x4bc77d=[];_0x141c8e[_0xd2e4('0xf3')](function(_0x395dbc){_0x4bc77d['push'](_0x395dbc[_0xd2e4('0x1e')]({'exitAt':moment()[_0xd2e4('0x9e')](_0xd2e4('0xf4'))}));});return Promise[_0xd2e4('0x48')](_0x4bc77d);}})[_0xd2e4('0x1f')](function(){if(_0x5e1e01){var _0x5c5247=[];var _0xd5e94d=[];var _0x9c1f88=utils[_0xd2e4('0xf5')]();var _0x132205={'membername':_0x5e1e01[_0xd2e4('0x2b')],'interface':_0x20ccfd,'enterAt':moment()[_0xd2e4('0x9e')](_0xd2e4('0xf4')),'role':_0x5e1e01[_0xd2e4('0x20')],'internal':_0x5e1e01['internal']};_0x9c1f88[_0xd2e4('0xf3')](function(_0x30dc39){_0x5c5247['push'](_['merge']({'channel':_0x30dc39,'type':_0xd2e4('0xf6'),'data1':_0x3bde58[_0xd2e4('0x51')][_0xd2e4('0xf7')],'data2':_0x20ccfd},_0x132205));if(_0x5e1e01['loginInPause']){_0xd5e94d[_0xd2e4('0x41')](_['merge']({'channel':_0x30dc39,'type':'PAUSE','data1':_0xd2e4('0xf8')},_0x132205));}});return db[_0xd2e4('0xf2')]['bulkCreate'](_0x5c5247['concat'](_0xd5e94d),{'individualHooks':!![]});}})[_0xd2e4('0x1f')](function(){if(_0x5e1e01){return _0x5e1e01['update']({'online':!![],'lastLoginAt':moment()['format'](_0xd2e4('0xf4')),'voicePause':_0x5e1e01[_0xd2e4('0x91')]||![],'mailPause':_0x5e1e01[_0xd2e4('0x91')]||![],'chatPause':_0x5e1e01[_0xd2e4('0x91')]||![],'faxPause':_0x5e1e01[_0xd2e4('0x91')]||![],'smsPause':_0x5e1e01[_0xd2e4('0x91')]||![],'openchannelPause':_0x5e1e01['loginInPause']||![],'whatsappPause':_0x5e1e01[_0xd2e4('0x91')]||![],'pauseType':_0x5e1e01[_0xd2e4('0x91')]?_0xd2e4('0xf8'):null,'interface':_0x20ccfd,'lastPauseAt':moment()[_0xd2e4('0x9e')](_0xd2e4('0xf4'))});}})[_0xd2e4('0x1f')](function(_0x331cad){if(_0x3bde58[_0xd2e4('0xf9')]){return _0x1ca85f();}else{return Promise[_0xd2e4('0xfa')](_0x331cad)[_0xd2e4('0x1f')](respondWithResult(_0x1251a3,null));}})[_0xd2e4('0x49')](handleError(_0x1251a3,null));};exports[_0xd2e4('0xfb')]=function(_0x28b09a,_0x580eb7){var _0x1fd3a9;return db['User'][_0xd2e4('0x4c')]({'where':{'id':_0x28b09a[_0xd2e4('0x4b')]['id'],'role':_0xd2e4('0x21')},'attributes':['id',_0xd2e4('0x2b'),_0xd2e4('0x20')]})[_0xd2e4('0x1f')](handleEntityNotFound(_0x580eb7,null))[_0xd2e4('0x1f')](function(_0x5b9eaf){if(_0x5b9eaf){_0x1fd3a9=_0x5b9eaf;return db['UserVoiceQueueRt'][_0xd2e4('0x22')]({'where':{'membername':_0x1fd3a9[_0xd2e4('0x2b')]},'individualHooks':!![]});}})[_0xd2e4('0x1f')](function(){return db[_0xd2e4('0xf2')][_0xd2e4('0x42')]({'where':{'membername':_0x1fd3a9[_0xd2e4('0x2b')],'exitAt':null}});})['then'](function(_0x28f7cd){var _0x53aef9=[];_0x28f7cd[_0xd2e4('0xf3')](function(_0x41a195){_0x53aef9['push'](_0x41a195[_0xd2e4('0x1e')]({'exitAt':moment()[_0xd2e4('0x9e')](_0xd2e4('0xf4'))}));});return Promise[_0xd2e4('0x48')](_0x53aef9);})[_0xd2e4('0x1f')](function(){return _0x1fd3a9[_0xd2e4('0x1e')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xd2e4('0x1f')](respondWithResult(_0x580eb7,null))[_0xd2e4('0x49')](handleError(_0x580eb7,null));};exports[_0xd2e4('0xfc')]=function(_0x10404a,_0x290d92){var _0x1489ca;return db[_0xd2e4('0xa1')][_0xd2e4('0x1e')]({'paused':0x1},{'where':{'UserId':_0x10404a['params']['id']},'individualHooks':!![]})['then'](function(){return db['User']['find']({'where':{'id':_0x10404a['params']['id'],'role':'agent'},'attributes':['id',_0xd2e4('0x2b'),_0xd2e4('0x20'),'internal',_0xd2e4('0x92'),'online']});})[_0xd2e4('0x1f')](handleEntityNotFound(_0x290d92,null))[_0xd2e4('0x1f')](function(_0x4827a1){if(_0x4827a1){_0x1489ca=_0x4827a1;return db[_0xd2e4('0xf2')]['findAll']({'where':{'membername':_0x1489ca['name'],'type':_0xd2e4('0xfd'),'exitAt':null}});}})['then'](function(_0x169cd4){if(_0x169cd4[_0xd2e4('0x45')]){var _0x1a1340=moment()['format'](_0xd2e4('0xf4'));for(var _0x367b05=0x0,_0x2838eb=_0x169cd4[_0xd2e4('0x45')];_0x367b05<_0x2838eb;_0x367b05++){_0x169cd4[_0x367b05]['updateAttributes']({'exitAt':_0x1a1340});}}})['then'](function(){var _0x5e19ec=[];var _0x48a16c=utils[_0xd2e4('0xf5')]();_0x48a16c['forEach'](function(_0x5d5531){_0x5e19ec[_0xd2e4('0x41')]({'channel':_0x5d5531,'membername':_0x1489ca[_0xd2e4('0x2b')],'interface':_[_0xd2e4('0x5a')](_0x1489ca['interface'])?util[_0xd2e4('0x9e')](_0xd2e4('0x9f'),_0x1489ca[_0xd2e4('0x2b')]):_0x1489ca['interface'],'type':_0xd2e4('0xfd'),'enterAt':moment()[_0xd2e4('0x9e')](_0xd2e4('0xf4')),'data1':_0x10404a['body'][_0xd2e4('0x31')]||_0xd2e4('0xfe'),'role':_0x1489ca['role'],'internal':_0x1489ca[_0xd2e4('0x55')]});});return db[_0xd2e4('0xf2')][_0xd2e4('0x7b')](_0x5e19ec,{'individualHooks':!![]});})[_0xd2e4('0x1f')](function(){return _0x1489ca[_0xd2e4('0x1e')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x10404a[_0xd2e4('0x51')][_0xd2e4('0x31')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()['format'](_0xd2e4('0xf4'))});})[_0xd2e4('0x1f')](respondWithResult(_0x290d92,null))[_0xd2e4('0x49')](handleError(_0x290d92,null));};exports[_0xd2e4('0xff')]=function(_0x1676f9,_0x53b42b){if(_0x1676f9['body'][_0xd2e4('0xa4')]&&!utils['isValidChannel'](_0x1676f9[_0xd2e4('0x51')][_0xd2e4('0xa4')])){throw new APIBadRequestError(util[_0xd2e4('0x9e')](_0xd2e4('0x100'),_0x1676f9[_0xd2e4('0x51')][_0xd2e4('0xa4')]));}return db[_0xd2e4('0x2e')][_0xd2e4('0x4c')]({'where':{'id':_0x1676f9['params']['id']},'attributes':['id',_0xd2e4('0x2b'),'role','internal',_0xd2e4('0x92'),'online',_0xd2e4('0xa0'),'mailPause',_0xd2e4('0x101'),_0xd2e4('0x102'),_0xd2e4('0x103'),_0xd2e4('0x104'),_0xd2e4('0x105'),_0xd2e4('0x106'),_0xd2e4('0x107')]})[_0xd2e4('0x1f')](function(_0x257327){if(!_0x257327){throw new APINotFoundError(util[_0xd2e4('0x9e')](_0xd2e4('0x108'),_0x1676f9[_0xd2e4('0x4b')]['id']));}return _0x257327[_0xd2e4('0xff')](_0x1676f9['body'][_0xd2e4('0xa4')]);})[_0xd2e4('0x1f')](respondWithResult(_0x53b42b,null))['catch'](APIHandleError(_0x53b42b));};exports['getTeams']=function(_0x23a236,_0x37dcc9){var _0x37874a={};var _0x4085b4={};var _0x4cc465;var _0x3803f5;return db[_0xd2e4('0x2e')]['findOne']({'where':{'id':_0x23a236['params']['id']}})[_0xd2e4('0x1f')](handleEntityNotFound(_0x37dcc9,null))[_0xd2e4('0x1f')](function(_0x214272){if(_0x214272){_0x4cc465=_0x214272;_0x4085b4['model']=_['keys'](db['Team'][_0xd2e4('0x2f')]);_0x4085b4['query']=_[_0xd2e4('0xc7')](_0x23a236['query']);_0x4085b4[_0xd2e4('0xc8')]=_[_0xd2e4('0xc9')](_0x4085b4[_0xd2e4('0xca')],_0x4085b4[_0xd2e4('0x3a')]);_0x37874a[_0xd2e4('0x40')]=_[_0xd2e4('0xc9')](_0x4085b4[_0xd2e4('0xca')],qs[_0xd2e4('0xcb')](_0x23a236[_0xd2e4('0x3a')][_0xd2e4('0xcb')]));_0x37874a[_0xd2e4('0x40')]=_0x37874a['attributes'][_0xd2e4('0x45')]?_0x37874a[_0xd2e4('0x40')]:_0x4085b4[_0xd2e4('0xca')];_0x37874a[_0xd2e4('0xcc')]=qs[_0xd2e4('0xcd')](_0x23a236[_0xd2e4('0x3a')][_0xd2e4('0xcd')]);_0x37874a[_0xd2e4('0x39')]=qs[_0xd2e4('0xc8')](_[_0xd2e4('0xce')](_0x23a236[_0xd2e4('0x3a')],_0x4085b4['filters']));if(_0x23a236[_0xd2e4('0x3a')][_0xd2e4('0x28')]){_0x37874a['where']=_[_0xd2e4('0xcf')](_0x37874a[_0xd2e4('0x39')],{'$or':_[_0xd2e4('0x7e')](_0x37874a[_0xd2e4('0x40')],function(_0x2a9778){var _0x4d578c={};_0x4d578c[_0x2a9778]={'$like':'%'+_0x23a236[_0xd2e4('0x3a')][_0xd2e4('0x28')]+'%'};return _0x4d578c;})});}_0x37874a=_[_0xd2e4('0xcf')]({},_0x37874a,_0x23a236[_0xd2e4('0xd0')]);return _0x4cc465['getTeams'](_0x37874a);}})[_0xd2e4('0x1f')](function(_0x30d2e3){if(_0x30d2e3){_0x3803f5=_0x30d2e3[_0xd2e4('0x45')];if(!_0x23a236['query'][_0xd2e4('0xbf')](_0xd2e4('0xd2'))){_0x37874a[_0xd2e4('0x19')]=qs[_0xd2e4('0x19')](_0x23a236[_0xd2e4('0x3a')][_0xd2e4('0x19')]);_0x37874a['offset']=qs[_0xd2e4('0x1b')](_0x23a236[_0xd2e4('0x3a')]['offset']);}return _0x4cc465['getTeams'](_0x37874a);}})[_0xd2e4('0x1f')](function(_0x58367a){if(_0x58367a){return _0x58367a?{'count':_0x3803f5,'rows':_0x58367a}:null;}})[_0xd2e4('0x1f')](respondWithResult(_0x37dcc9,null))['catch'](handleError(_0x37dcc9,null));};exports[_0xd2e4('0x109')]=function(_0x5481c9,_0x3e79af){var _0x439ac1=_0x5481c9[_0xd2e4('0x4b')]['id'];var _0x3879c1=_0x5481c9['body']?_0x5481c9[_0xd2e4('0x51')]['ids']:null;var _0x34e3d2=[];return Promise[_0xd2e4('0xfa')]()[_0xd2e4('0x1f')](function(){if(!_0x3879c1)throw new APIBadRequestError(_0xd2e4('0x10a'));})[_0xd2e4('0x1f')](function(){return db[_0xd2e4('0x2e')][_0xd2e4('0x8b')]({'where':{'id':_0x439ac1}});})[_0xd2e4('0x1f')](function(_0x54129b){if(!_0x54129b)throw new APINotFoundError(util[_0xd2e4('0x9e')](_0xd2e4('0x108'),_0x5481c9[_0xd2e4('0x4b')]['id']));return db['sequelize']['transaction'](function(_0x417092){return _0x54129b[_0xd2e4('0x109')](_0x3879c1,{'transaction':_0x417092})[_0xd2e4('0x1f')](function(){return db[_0xd2e4('0x10b')][_0xd2e4('0x42')]({'where':{'id':{'$in':_0x3879c1}}});})['then'](function(_0x26cc06){var _0x117146=_[_0xd2e4('0x7e')](_0x26cc06,function(_0x5afef9){return _0x5afef9[_0xd2e4('0x10c')]();});return Promise[_0xd2e4('0x48')](_0x117146);})[_0xd2e4('0x1f')](function(_0x5d9e72){_0x34e3d2=_['flattenDeep'](_0x5d9e72);var _0x130968=_[_0xd2e4('0x7e')](_0x34e3d2,function(_0x33506c){return _0x33506c[_0xd2e4('0x10d')](_0x54129b['id'],{'transaction':_0x417092});});return Promise[_0xd2e4('0x48')](_0x130968);})['then'](function(){if(!_0x54129b['online'])return;var _0x58b7ff=_[_0xd2e4('0x28')](_0x34e3d2,function(_0x3012b7){return _0x3012b7[_0xd2e4('0x10e')](_0xd2e4('0xa4'))===_0xd2e4('0x10f');});var _0x427c7d=_['map'](_0x58b7ff,function(_0xc5d21b){return db[_0xd2e4('0xa1')][_0xd2e4('0xa2')]({'membername':_0x54129b[_0xd2e4('0x2b')],'UserId':_0x54129b['id'],'queue_name':_0xc5d21b['name'],'VoiceQueueId':_0xc5d21b['id'],'interface':_[_0xd2e4('0x5a')](_0x54129b[_0xd2e4('0x92')])?util['format'](_0xd2e4('0x9f'),_0x54129b[_0xd2e4('0x2b')]):_0x54129b[_0xd2e4('0x92')],'paused':_0x54129b[_0xd2e4('0xa0')]||![],'penalty':_0x54129b['penalty']},{'transaction':_0x417092});});return Promise[_0xd2e4('0x48')](_0x427c7d);})[_0xd2e4('0x1f')](function(){return db[_0xd2e4('0x110')][_0xd2e4('0x42')]({'where':{'teamId':{'$in':_0x3879c1}}});})[_0xd2e4('0x1f')](function(_0x8c99a2){var _0x1fb9e0=_[_0xd2e4('0x7e')](_0x8c99a2,function(_0x52f7ae){return db['UserVoicePrefix']['create']({'UserId':_0x54129b['id'],'VoicePrefixId':_0x52f7ae[_0xd2e4('0x111')]},{'transaction':_0x417092});});return Promise[_0xd2e4('0x48')](_0x1fb9e0);});});})['then'](function(){for(var _0x5751d8=0x0;_0x5751d8<_0x34e3d2[_0xd2e4('0x45')];_0x5751d8++){var _0x5e312e=_0x34e3d2[_0x5751d8][_0xd2e4('0x10e')](_0xd2e4('0xa4'));var _0x543e5e=_0x5e312e+_0xd2e4('0x9b');socket[_0xd2e4('0x9c')](_0xd2e4('0x70')+_0x5e312e+_0xd2e4('0x9d'),{'UserId':_0x439ac1,['queueField']:_0x34e3d2[_0x5751d8]['id']});}})[_0xd2e4('0x1f')](respondWithStatusCode(_0x3e79af,null))[_0xd2e4('0x49')](APIHandleError(_0x3e79af));};exports[_0xd2e4('0x112')]=function(_0x39b40f,_0x3c650d){var _0x1c0ccf=_0x39b40f[_0xd2e4('0x4b')]['id'];var _0x103eff=null;if(_0x39b40f[_0xd2e4('0x3a')]['ids']){_0x103eff=_[_0xd2e4('0x113')](_0x39b40f[_0xd2e4('0x3a')][_0xd2e4('0x54')])?_0x39b40f[_0xd2e4('0x3a')][_0xd2e4('0x54')]:[_0x39b40f[_0xd2e4('0x3a')][_0xd2e4('0x54')]];}var _0x2551f4=[];return Promise[_0xd2e4('0xfa')]()[_0xd2e4('0x1f')](function(){if(!_0x103eff)throw new APIBadRequestError(_0xd2e4('0x114'));})['then'](function(){return db[_0xd2e4('0x2e')][_0xd2e4('0x8b')]({'where':{'id':_0x1c0ccf}});})[_0xd2e4('0x1f')](function(_0x183cdb){if(!_0x183cdb)throw new APINotFoundError(util[_0xd2e4('0x9e')](_0xd2e4('0x108'),_0x39b40f[_0xd2e4('0x4b')]['id']));return db[_0xd2e4('0x5c')][_0xd2e4('0x115')](function(_0x255655){return _0x183cdb['removeTeams'](_0x103eff,{'transaction':_0x255655})[_0xd2e4('0x1f')](function(){return db[_0xd2e4('0x10b')][_0xd2e4('0x42')]({'where':{'id':{'$in':_0x103eff}}});})[_0xd2e4('0x1f')](function(_0x1b5d1a){var _0x5bd2d9=_[_0xd2e4('0x7e')](_0x1b5d1a,function(_0xa5f9b0){return _0xa5f9b0[_0xd2e4('0x10c')]();});return Promise[_0xd2e4('0x48')](_0x5bd2d9);})[_0xd2e4('0x1f')](function(_0x59b1e7){_0x2551f4=_[_0xd2e4('0x116')](_0x59b1e7);var _0x3b1d0f=_[_0xd2e4('0x7e')](_0x2551f4,function(_0x12a63b){return _0x12a63b[_0xd2e4('0x117')](_0x183cdb['id'],{'transaction':_0x255655});});return Promise['all'](_0x3b1d0f);})['then'](function(){if(!_0x183cdb['online'])return;var _0x1721d5=_['filter'](_0x2551f4,function(_0x32b0b4){return _0x32b0b4['getDataValue'](_0xd2e4('0xa4'))===_0xd2e4('0x10f');});var _0x165494=_[_0xd2e4('0x7e')](_0x1721d5,function(_0x72eaad){return db[_0xd2e4('0xa1')][_0xd2e4('0x22')]({'where':{'VoiceQueueId':_0x72eaad['id'],'UserId':_0x183cdb['id']},'transaction':_0x255655});});return Promise[_0xd2e4('0x48')](_0x165494);})['then'](function(){return db[_0xd2e4('0x110')][_0xd2e4('0x42')]({'where':{'teamId':{'$in':_0x103eff}}});})[_0xd2e4('0x1f')](function(_0xe6f9d8){var _0x28e503=_[_0xd2e4('0x7e')](_0xe6f9d8,function(_0x20d592){return db['UserVoicePrefix']['destroy']({'where':{'UserId':_0x183cdb['id'],'VoicePrefixId':_0x20d592['VoicePrefixId']}},{'transaction':_0x255655});});return Promise['all'](_0x28e503);});});})[_0xd2e4('0x1f')](function(){for(var _0x3ee5cd=0x0;_0x3ee5cd<_0x2551f4['length'];_0x3ee5cd++){var _0x378bf3=_0x2551f4[_0x3ee5cd][_0xd2e4('0x10e')]('channel');var _0x8cf2d9=_0x378bf3+'QueueId';socket[_0xd2e4('0x9c')]('user'+_0x378bf3+_0xd2e4('0xa5'),{'UserId':_0x1c0ccf,['queueField']:_0x2551f4[_0x3ee5cd]['id']});}})['then'](respondWithStatusCode(_0x3c650d,null))[_0xd2e4('0x49')](APIHandleError(_0x3c650d));};exports[_0xd2e4('0x118')]=function(_0x201552,_0x234f08){var _0x25fedd={};var _0x62721b={};var _0x3a0eaf;var _0x497195;return db[_0xd2e4('0x2e')]['findOne']({'where':{'id':_0x201552['params']['id']}})[_0xd2e4('0x1f')](handleEntityNotFound(_0x234f08,null))['then'](function(_0x902fe2){if(_0x902fe2){_0x3a0eaf=_0x902fe2;_0x62721b[_0xd2e4('0xca')]=_[_0xd2e4('0xc7')](db['CmList'][_0xd2e4('0x2f')]);_0x62721b['query']=_[_0xd2e4('0xc7')](_0x201552[_0xd2e4('0x3a')]);_0x62721b[_0xd2e4('0xc8')]=_[_0xd2e4('0xc9')](_0x62721b['model'],_0x62721b['query']);_0x25fedd[_0xd2e4('0x40')]=_[_0xd2e4('0xc9')](_0x62721b[_0xd2e4('0xca')],qs[_0xd2e4('0xcb')](_0x201552[_0xd2e4('0x3a')][_0xd2e4('0xcb')]));_0x25fedd[_0xd2e4('0x40')]=_0x25fedd[_0xd2e4('0x40')][_0xd2e4('0x45')]?_0x25fedd['attributes']:_0x62721b[_0xd2e4('0xca')];_0x25fedd[_0xd2e4('0xcc')]=qs[_0xd2e4('0xcd')](_0x201552[_0xd2e4('0x3a')][_0xd2e4('0xcd')]);_0x25fedd[_0xd2e4('0x39')]=qs[_0xd2e4('0xc8')](_[_0xd2e4('0xce')](_0x201552['query'],_0x62721b['filters']));if(_0x201552['query']['filter']){_0x25fedd['where']=_[_0xd2e4('0xcf')](_0x25fedd['where'],{'$or':_[_0xd2e4('0x7e')](_0x25fedd[_0xd2e4('0x40')],function(_0x5c6391){var _0x42e154={};_0x42e154[_0x5c6391]={'$like':'%'+_0x201552[_0xd2e4('0x3a')][_0xd2e4('0x28')]+'%'};return _0x42e154;})});}_0x25fedd=_[_0xd2e4('0xcf')]({},_0x25fedd,_0x201552[_0xd2e4('0xd0')]);return _0x3a0eaf[_0xd2e4('0x118')](_0x25fedd);}})[_0xd2e4('0x1f')](function(_0xab8482){if(_0xab8482){_0x497195=_0xab8482[_0xd2e4('0x45')];if(!_0x201552['query']['hasOwnProperty']('nolimit')){_0x25fedd[_0xd2e4('0x19')]=qs['limit'](_0x201552[_0xd2e4('0x3a')][_0xd2e4('0x19')]);_0x25fedd['offset']=qs[_0xd2e4('0x1b')](_0x201552[_0xd2e4('0x3a')][_0xd2e4('0x1b')]);}return _0x3a0eaf[_0xd2e4('0x118')](_0x25fedd);}})['then'](function(_0x108280){if(_0x108280){return _0x108280?{'count':_0x497195,'rows':_0x108280}:null;}})['then'](respondWithResult(_0x234f08,null))[_0xd2e4('0x49')](handleError(_0x234f08,null));};exports['getAgents']=function(_0x1d139d,_0x311bd6){var _0x4c5372={};var _0x4daf4f={};var _0x4ed832;return db['User'][_0xd2e4('0x8b')]({'where':{'id':_0x1d139d[_0xd2e4('0x4b')]['id']}})[_0xd2e4('0x1f')](handleEntityNotFound(_0x311bd6,null))[_0xd2e4('0x1f')](function(_0x4b1649){if(_0x4b1649){_0x4ed832=_0x4b1649;_0x4daf4f[_0xd2e4('0xca')]=_[_0xd2e4('0xc7')](db[_0xd2e4('0x2e')][_0xd2e4('0x2f')]);_0x4daf4f[_0xd2e4('0x3a')]=_[_0xd2e4('0xc7')](_0x1d139d[_0xd2e4('0x3a')]);_0x4daf4f[_0xd2e4('0xc8')]=_['intersection'](_0x4daf4f[_0xd2e4('0xca')],_0x4daf4f[_0xd2e4('0x3a')]);_0x4c5372[_0xd2e4('0x40')]=_[_0xd2e4('0xc9')](_0x4daf4f[_0xd2e4('0xca')],qs[_0xd2e4('0xcb')](_0x1d139d[_0xd2e4('0x3a')][_0xd2e4('0xcb')]));_0x4c5372['attributes']=_0x4c5372[_0xd2e4('0x40')][_0xd2e4('0x45')]?_0x4c5372['attributes']:_0x4daf4f['model'];_0x4c5372[_0xd2e4('0xcc')]=qs[_0xd2e4('0xcd')](_0x1d139d[_0xd2e4('0x3a')][_0xd2e4('0xcd')]);_0x4c5372[_0xd2e4('0x39')]=qs[_0xd2e4('0xc8')](_['pick'](_0x1d139d[_0xd2e4('0x3a')],_0x4daf4f['filters']));if(_0x1d139d[_0xd2e4('0x3a')]['filter']){_0x4c5372[_0xd2e4('0x39')]=_['merge'](_0x4c5372[_0xd2e4('0x39')],{'$or':_[_0xd2e4('0x7e')](_0x4c5372[_0xd2e4('0x40')],function(_0x2de294){var _0x7afde4={};_0x7afde4[_0x2de294]={'$like':'%'+_0x1d139d[_0xd2e4('0x3a')][_0xd2e4('0x28')]+'%'};return _0x7afde4;})});}_0x4c5372['model']=db['User'];_0x4c5372['as']=_0xd2e4('0x78');_0x4c5372=_[_0xd2e4('0xcf')]({},_0x4c5372,_0x1d139d['options']);return _0x4ed832['getVoiceQueues']({'include':[_0x4c5372]});}})[_0xd2e4('0x1f')](function(_0x1cae89){if(_0x1cae89){var _0x5386ec={},_0x2eae27=[];for(var _0x4300cb=0x0;_0x4300cb<_0x1cae89['length'];_0x4300cb+=0x1){for(var _0x36ca79=0x0,_0x5c3ff6;_0x36ca79<_0x1cae89[_0x4300cb][_0xd2e4('0x78')][_0xd2e4('0x45')];_0x36ca79+=0x1){_0x5c3ff6=_0x1cae89[_0x4300cb][_0xd2e4('0x78')][_0x36ca79][_0xd2e4('0x23')]({'plain':!![]});_0x5386ec[_0x5c3ff6['id']]=_0x5c3ff6;}}_0x5386ec=_[_0xd2e4('0x119')](_0x5386ec);for(var _0x3bfa50=qs[_0xd2e4('0x1b')](_0x1d139d['query'][_0xd2e4('0x1b')]);_0x3bfa50<_0x5386ec[_0xd2e4('0x45')]&&_0x2eae27[_0xd2e4('0x45')]=_0x21034f){_0x3f662c=_0x21034f;_0x393909=0xc8;}else{_0x393909=0xce;}_0x5f1e9d[_0xe5e0('0x16')](_0x393909);return _0x5f1e9d[_0xe5e0('0x1d')](_0xe5e0('0x1e'),_0x40a91d+'-'+_0x3f662c+'/'+_0x21034f)['json'](_0x149ba1);}return null;};}function saveUpdates(_0x174cb1){return function(_0xde1fb2){if(_0xde1fb2){return _0xde1fb2[_0xe5e0('0x1f')](_0x174cb1)[_0xe5e0('0x20')](function(_0xab1389){if(_0xab1389[_0xe5e0('0x21')]===_0xe5e0('0x22')){socket['emit']('userNotification:recalc:'+_0xab1389['id'],_0xab1389);}return _0xab1389;});}return null;};}function removeEntity(_0x264d01,_0x218712){return function(_0x3202ed){if(_0x3202ed){return _0x3202ed[_0xe5e0('0x23')]({'transaction':_0x218712})[_0xe5e0('0x20')](function(){var _0x5d8e2c=_0x3202ed[_0xe5e0('0x24')]({'plain':!![]});if(_0x5d8e2c[_0xe5e0('0x21')]===_0xe5e0('0x25'))return;var _0x5652e3=[{'name':_0xe5e0('0x26'),'value':_0xe5e0('0x27'),'ignore':!![]},{'name':_0xe5e0('0x28'),'value':'agent','ignore':![]},{'name':_0xe5e0('0x29'),'value':_0xe5e0('0x2a'),'ignore':![]}];var _0x41e106=_(_0x5652e3)[_0xe5e0('0x2b')]('ignore')[_0xe5e0('0x2c')](_0xe5e0('0x2d'))[_0xe5e0('0x2d')]();if(_[_0xe5e0('0x2e')](_0x41e106,_0x5d8e2c[_0xe5e0('0x21')])){return;}var _0x5601c0=_[_0xe5e0('0x2f')](_0x5652e3,['value',_0x5d8e2c[_0xe5e0('0x21')]])[_0xe5e0('0x30')];return db[_0xe5e0('0x31')][_0xe5e0('0x23')]({'where':{'type':_0x5601c0,'resourceId':_0x5d8e2c['id']},'transaction':_0x218712})[_0xe5e0('0x20')](function(){return _0x3202ed;});})[_0xe5e0('0x20')](function(){_0x264d01[_0xe5e0('0x16')](0xcc)[_0xe5e0('0x17')]();});}};}function handleEntityNotFound(_0x323d79){return function(_0x1972af){if(!_0x1972af){_0x323d79['sendStatus'](0x194);}return _0x1972af;};}function handleError(_0x5bf0cc,_0x4ba185){_0x4ba185=_0x4ba185||0x1f4;return function(_0x4cf9e2){logger[_0xe5e0('0x32')](_0x4cf9e2[_0xe5e0('0x33')]);if(_0x4cf9e2[_0xe5e0('0x30')]){delete _0x4cf9e2['name'];}_0x5bf0cc[_0xe5e0('0x16')](_0x4ba185)[_0xe5e0('0x34')](_0x4cf9e2);};}function getUserAttributes(){return _(db['User'][_0xe5e0('0x35')])['map'](function(_0x1fb561){return{'name':_0x1fb561[_0xe5e0('0x36')],'type':_0x1fb561[_0xe5e0('0x37')][_0xe5e0('0x38')]};})['filter'](function(_0x2ba35c){return![_0xe5e0('0x39'),_0xe5e0('0x3a'),_0xe5e0('0x3b'),_0xe5e0('0x3c'),_0xe5e0('0x3d'),_0xe5e0('0x3e')][_0xe5e0('0x2e')](_0x2ba35c[_0xe5e0('0x30')]);})[_0xe5e0('0x2d')]();}exports[_0xe5e0('0x3f')]=function(_0x2a00d5,_0xad30a2){var _0x591180={},_0x4ed03b={'count':0x0,'rows':[]};var _0x36727f=getUserAttributes();_0x591180=qs['getOptions'](_0x36727f,_0x2a00d5);var _0x2078c1={'where':_0x591180[_0xe5e0('0x40')]};return db[_0xe5e0('0x41')][_0xe5e0('0x1c')](_0x2078c1)[_0xe5e0('0x20')](function(_0x1f0707){_0x4ed03b[_0xe5e0('0x1c')]=_0x1f0707;if(_0x2a00d5['query']['includeAll']){_0x591180['include']=[{'all':!![]}];}if(_0x2a00d5[_0xe5e0('0x42')]['userSetting']==='true'){_0x591180['include']=[{'model':db[_0xe5e0('0x43')],'as':_0xe5e0('0x44')}];}if(!_['includes'](_0x591180['attributes'],'id')){_0x591180[_0xe5e0('0x45')][_0xe5e0('0x46')]('id');}return db[_0xe5e0('0x41')][_0xe5e0('0x47')](_0x591180);})['then'](function(_0x266309){_0x4ed03b[_0xe5e0('0x48')]=_0x266309;if(_0x2a00d5[_0xe5e0('0x42')][_0xe5e0('0x49')]===_0xe5e0('0x4a')){var _0x11f8d6=[];for(var _0x4a1d7c=0x0;_0x4a1d7c<_0x4ed03b[_0xe5e0('0x48')][_0xe5e0('0x4b')];_0x4a1d7c++){_0x11f8d6[_0xe5e0('0x46')](get_open_tabs('chat',_0x4ed03b[_0xe5e0('0x48')][_0x4a1d7c][_0xe5e0('0x4c')]));_0x11f8d6[_0xe5e0('0x46')](get_open_tabs(_0xe5e0('0x4d'),_0x4ed03b[_0xe5e0('0x48')][_0x4a1d7c][_0xe5e0('0x4c')]));_0x11f8d6[_0xe5e0('0x46')](get_open_tabs(_0xe5e0('0x4e'),_0x4ed03b[_0xe5e0('0x48')][_0x4a1d7c][_0xe5e0('0x4c')]));_0x11f8d6['push'](get_open_tabs(_0xe5e0('0x4f'),_0x4ed03b[_0xe5e0('0x48')][_0x4a1d7c][_0xe5e0('0x4c')]));_0x11f8d6[_0xe5e0('0x46')](get_open_tabs(_0xe5e0('0x50'),_0x4ed03b[_0xe5e0('0x48')][_0x4a1d7c][_0xe5e0('0x4c')]));_0x11f8d6[_0xe5e0('0x46')](get_open_tabs(_0xe5e0('0x51'),_0x4ed03b['rows'][_0x4a1d7c][_0xe5e0('0x4c')]));}return Promise['all'](_0x11f8d6)['then'](function(){return _0x4ed03b;});}else{return _0x4ed03b;}})[_0xe5e0('0x20')](respondWithFilteredResult(_0xad30a2,_0x591180))[_0xe5e0('0x52')](handleError(_0xad30a2,null));};exports[_0xe5e0('0x53')]=function(_0x2bb2b1,_0xfa0947){var _0x273b9b=getUserAttributes();_0x2bb2b1[_0xe5e0('0x42')]['id']=_0x2bb2b1[_0xe5e0('0x54')]['id'];var _0xc7f194=qs[_0xe5e0('0x55')](_0x273b9b,_0x2bb2b1);if(_0x2bb2b1[_0xe5e0('0x42')]['includeAll']){_0xc7f194['include']=[{'all':!![]}];}if(_0x2bb2b1[_0xe5e0('0x42')][_0xe5e0('0x44')]==='true'){_0xc7f194['include']=[{'model':db[_0xe5e0('0x43')],'as':_0xe5e0('0x44')}];}_0xc7f194=_[_0xe5e0('0x56')]({},_0xc7f194,_0x2bb2b1['options']);if(!_[_0xe5e0('0x2e')](_0xc7f194[_0xe5e0('0x45')],'id')){_0xc7f194['attributes'][_0xe5e0('0x46')]('id');}return db[_0xe5e0('0x41')][_0xe5e0('0x2f')](_0xc7f194)['then'](handleEntityNotFound(_0xfa0947,null))[_0xe5e0('0x20')](function(_0x205cd4){var _0x5c99e7=[];values=_0x205cd4;if(_0x2bb2b1[_0xe5e0('0x42')][_0xe5e0('0x49')]==='true'){_0x5c99e7[_0xe5e0('0x46')](get_open_tabs(_0xe5e0('0x57'),_0x205cd4['dataValues']));_0x5c99e7[_0xe5e0('0x46')](get_open_tabs(_0xe5e0('0x4d'),_0x205cd4['dataValues']));_0x5c99e7[_0xe5e0('0x46')](get_open_tabs(_0xe5e0('0x50'),_0x205cd4[_0xe5e0('0x4c')]));_0x5c99e7['push'](get_open_tabs(_0xe5e0('0x51'),_0x205cd4[_0xe5e0('0x4c')]));_0x5c99e7[_0xe5e0('0x46')](get_open_tabs('fax',_0x205cd4[_0xe5e0('0x4c')]));_0x5c99e7[_0xe5e0('0x46')](get_open_tabs('mail',_0x205cd4['dataValues']));return Promise['all'](_0x5c99e7);}else{return values;}})[_0xe5e0('0x20')](function(){return values;})[_0xe5e0('0x20')](respondWithResult(_0xfa0947,null))[_0xe5e0('0x52')](handleError(_0xfa0947,null));};exports[_0xe5e0('0x1f')]=function(_0x5d266a,_0xd8e9b0){if(_0x5d266a[_0xe5e0('0x58')]['id']){delete _0x5d266a[_0xe5e0('0x58')]['id'];}delete _0x5d266a['body'][_0xe5e0('0x21')];return db['User'][_0xe5e0('0x2f')]({'where':{'id':_0x5d266a[_0xe5e0('0x54')]['id']}})[_0xe5e0('0x20')](handleEntityNotFound(_0xd8e9b0,null))['then'](saveUpdates(_0x5d266a[_0xe5e0('0x58')],null))[_0xe5e0('0x20')](respondWithResult(_0xd8e9b0,null))[_0xe5e0('0x52')](handleError(_0xd8e9b0,null));};exports['describe']=function(_0x46adfc,_0x122fcf){return db['User'][_0xe5e0('0x59')]()[_0xe5e0('0x20')](respondWithResult(_0x122fcf,null))['catch'](handleError(_0x122fcf,null));};exports['addContacts']=function(_0x4b5b3a,_0xf40474){return db['User']['find']({'where':{'id':_0x4b5b3a[_0xe5e0('0x54')]['id']}})[_0xe5e0('0x20')](handleEntityNotFound(_0xf40474,null))[_0xe5e0('0x20')](function(_0x113c92){if(_0x113c92){return _0x113c92['addContacts'](_0x4b5b3a[_0xe5e0('0x58')]['ids'],_[_0xe5e0('0x5a')](_0x4b5b3a[_0xe5e0('0x58')],[_0xe5e0('0x5b'),'id'])||{});}})[_0xe5e0('0x20')](respondWithResult(_0xf40474,null))['catch'](handleError(_0xf40474,null));};function validateUser(_0x2443dd){return new Promise(function(_0x565907,_0x3161e3){if(_0x2443dd[_0xe5e0('0x5c')])return _0x565907(_0x2443dd);return db[_0xe5e0('0x5d')][_0xe5e0('0x5e')](0x1)['then'](function(_0x89c6c6){if(_0x89c6c6[_0xe5e0('0x5f')])authService['validatePasswordPattern'](_0x2443dd[_0xe5e0('0x39')]);db['User'][_0xe5e0('0x60')](_0xe5e0('0x5c'))[_0xe5e0('0x20')](function(_0xef33f){if(_['isNil'](_0xef33f)){_0x2443dd[_0xe5e0('0x5c')]=_0x89c6c6[_0xe5e0('0x61')]||0x1;return;}if(_['isNil'](_0x89c6c6['min_internal'])||_0x89c6c6['min_internal']===_0xef33f){_0x2443dd[_0xe5e0('0x5c')]=_0xef33f+0x1;return;}if(_0x89c6c6[_0xe5e0('0x61')]>_0xef33f){_0x2443dd[_0xe5e0('0x5c')]=_0x89c6c6[_0xe5e0('0x61')];return;}return db['sequelize'][_0xe5e0('0x42')](_0xe5e0('0x62'),{'type':db[_0xe5e0('0x63')][_0xe5e0('0x64')]['SELECT']})[_0xe5e0('0x20')](function(_0x320663){if(_0x320663&&_0x320663[_0xe5e0('0x4b')]){for(var _0x50261b=0x0,_0x352d6a=_0x320663[_0xe5e0('0x4b')];_0x50261b<_0x352d6a&&_[_0xe5e0('0x65')](_0x2443dd['internal']);_0x50261b++){if(_0x89c6c6[_0xe5e0('0x61')]<=_0x320663[_0x50261b]['from']){_0x2443dd[_0xe5e0('0x5c')]=_0x320663[_0x50261b]['from'];}else if(_0x89c6c6[_0xe5e0('0x61')]>_0x320663[_0x50261b]['from']&&_0x89c6c6[_0xe5e0('0x61')]<=_0x320663[_0x50261b]['to']){_0x2443dd['internal']=_0x89c6c6['min_internal'];}}}if(_[_0xe5e0('0x65')](_0x2443dd[_0xe5e0('0x5c')])){_0x2443dd[_0xe5e0('0x5c')]=_0xef33f+0x1;}return _0x565907(_0x2443dd);});});})[_0xe5e0('0x52')](function(_0x27710d){_0x3161e3(_0x27710d);});});}function updateUser(_0x3c6ee0){return new Promise(function(_0x32de77,_0xec6f4b){try{if(_0x3c6ee0[_0xe5e0('0x66')]){_0x3c6ee0[_0xe5e0('0x67')]=_0x3c6ee0[_0xe5e0('0x5c')];_0x3c6ee0['VoiceMail']={'mailbox':_0x3c6ee0[_0xe5e0('0x5c')],'password':_0x3c6ee0[_0xe5e0('0x39')],'fullname':_0x3c6ee0[_0xe5e0('0x68')],'email':_0x3c6ee0[_0xe5e0('0x69')]};}if(_0x3c6ee0[_0xe5e0('0x21')]===_0xe5e0('0x22')){if(!_0x3c6ee0['permissions'])_0x3c6ee0['permissions']=[_0xe5e0('0x6a'),_0xe5e0('0x6b'),'103',_0xe5e0('0x6c'),_0xe5e0('0x6d'),'104',_0xe5e0('0x6e'),_0xe5e0('0x6f'),'107',_0xe5e0('0x70'),_0xe5e0('0x71'),_0xe5e0('0x72'),'111',_0xe5e0('0x73'),_0xe5e0('0x74')];}_0x32de77(_0x3c6ee0);}catch(_0x49f49e){_0xec6f4b(_0x49f49e);}});}exports['create']=function(_0xa090f9,_0x193610){if(_0xa090f9[_0xe5e0('0x27')]['role']===_0xe5e0('0x22'))throw new Error(_0xe5e0('0x75'));if(_0xa090f9['body'][_0xe5e0('0x21')]===_0xe5e0('0x27')&&_0xa090f9[_0xe5e0('0x27')][_0xe5e0('0x21')]!==_0xe5e0('0x25')){throw new Error(_0xe5e0('0x76'));}if(_0xa090f9[_0xe5e0('0x58')][_0xe5e0('0x21')]===_0xe5e0('0x25')&&_0xa090f9[_0xe5e0('0x27')]['role']!==_0xe5e0('0x25')){throw new Error(_0xe5e0('0x77'));}return licenseUtil[_0xe5e0('0x78')]([_0xa090f9[_0xe5e0('0x58')]])['then'](function(){return validateUser(_0xa090f9[_0xe5e0('0x58')]);})[_0xe5e0('0x20')](function(_0x247541){return updateUser(_0x247541)[_0xe5e0('0x20')](function(_0x3ff496){if(_0x3ff496[_0xe5e0('0x21')]===_0xe5e0('0x25')){_0x3ff496[_0xe5e0('0x79')]=_0xa090f9[_0xe5e0('0x27')]['settingsEnabled'];delete _0x3ff496[_0xe5e0('0x7a')];}return _0x3ff496;});})[_0xe5e0('0x20')](function(_0x46fa9d){return db[_0xe5e0('0x41')][_0xe5e0('0x7b')](_0x46fa9d,{'include':[{'model':db[_0xe5e0('0x7c')],'as':_0xe5e0('0x7c')}]});})[_0xe5e0('0x20')](function(_0x21ae73){if(_0xa090f9[_0xe5e0('0x58')][_0xe5e0('0x21')]===_0xe5e0('0x27'))return _0x21ae73;if(_0xa090f9[_0xe5e0('0x27')]['role']!==_0xe5e0('0x27'))return _0x21ae73;return db[_0xe5e0('0x7d')][_0xe5e0('0x2f')]({'where':{'name':_0x21ae73[_0xe5e0('0x21')]==='agent'?_0xe5e0('0x28'):_0xe5e0('0x29'),'userProfileId':_0xa090f9[_0xe5e0('0x27')]['userProfileId']},'raw':!![]})[_0xe5e0('0x20')](function(_0xc52c7f){if(!_0xc52c7f||_0xc52c7f['autoAssociation']!=0x0)return _0x21ae73;return db['UserProfileResource']['create']({'name':_0x21ae73[_0xe5e0('0x30')],'resourceId':_0x21ae73['id'],'type':_0xc52c7f[_0xe5e0('0x30')],'sectionId':_0xc52c7f['id']},{})[_0xe5e0('0x20')](function(){return _0x21ae73;});})['catch'](function(_0x3bed81){logger[_0xe5e0('0x32')](_0xe5e0('0x7e'),_0x3bed81);throw _0x3bed81;});})['then'](respondWithResult(_0x193610,0xc9))['catch'](handleError(_0x193610,null));};exports[_0xe5e0('0x7f')]=function(_0x5b754e,_0x2ad991){var _0x296d81=_0x5b754e[_0xe5e0('0x58')];var _0x29e109=[];if(_0x5b754e[_0xe5e0('0x27')][_0xe5e0('0x21')]===_0xe5e0('0x22'))throw new Error('Unauthorized');if(_[_0xe5e0('0x80')](_0x296d81,[_0xe5e0('0x21'),_0xe5e0('0x27')])&&_0x5b754e[_0xe5e0('0x27')][_0xe5e0('0x21')]!==_0xe5e0('0x25')){throw new Error(_0xe5e0('0x76'));}if(_[_0xe5e0('0x80')](_0x296d81,[_0xe5e0('0x21'),_0xe5e0('0x25')])&&_0x5b754e[_0xe5e0('0x27')][_0xe5e0('0x21')]!==_0xe5e0('0x25')){throw new Error(_0xe5e0('0x81'));}return licenseUtil[_0xe5e0('0x78')](_0x296d81)['then'](function(){return validateUser(_0x296d81[0x0]);})[_0xe5e0('0x20')](function(){for(var _0x370756=0x1;_0x370756<_0x296d81[_0xe5e0('0x4b')];_0x370756++){var _0x2e1fc5=_0x296d81[_0x370756-0x1][_0xe5e0('0x5c')];if(!_0x296d81[_0x370756][_0xe5e0('0x5c')])_0x296d81[_0x370756][_0xe5e0('0x5c')]=_0x2e1fc5+0x1;_0x29e109[_0xe5e0('0x46')](validateUser(_0x296d81[_0x370756]));}return Promise[_0xe5e0('0x82')](_0x29e109);})[_0xe5e0('0x20')](function(){_0x29e109=[];for(var _0x19a3f0=0x0;_0x19a3f0<_0x296d81['length'];_0x19a3f0++){_0x29e109['push'](updateUser(_0x296d81[_0x19a3f0]));}return Promise['all'](_0x29e109);})[_0xe5e0('0x20')](function(){_0x29e109=_0x296d81[_0xe5e0('0x2c')](function(_0x20ed2f){return db[_0xe5e0('0x41')][_0xe5e0('0x7b')](_0x20ed2f,{'include':[{'model':db[_0xe5e0('0x7c')],'as':_0xe5e0('0x7c')}]})[_0xe5e0('0x20')](function(_0x528a18){_0x20ed2f['id']=_0x528a18['id'];return _0x20ed2f;});});return Promise[_0xe5e0('0x82')](_0x29e109);})[_0xe5e0('0x20')](function(_0x3931a5){if(_0x5b754e[_0xe5e0('0x58')][_0xe5e0('0x21')]===_0xe5e0('0x27'))return _0x3931a5;if(_0x5b754e[_0xe5e0('0x27')][_0xe5e0('0x21')]!==_0xe5e0('0x27'))return _0x3931a5;var _0x3c3a60=_[_0xe5e0('0x80')](_0x3931a5,function(_0x1541e8){return _0x1541e8[_0xe5e0('0x21')]==='agent'||_0x1541e8[_0xe5e0('0x21')]==='telephone';});if(!_0x3c3a60)return _0x3931a5;return db[_0xe5e0('0x7d')][_0xe5e0('0x47')]({'where':{'name':{'$or':['Agents',_0xe5e0('0x29')]},'userProfileId':_0x5b754e['user'][_0xe5e0('0x7a')]},'raw':!![]})[_0xe5e0('0x20')](function(_0x28af71){if(_[_0xe5e0('0x83')](_0x28af71)||!_[_0xe5e0('0x80')](_0x28af71,[_0xe5e0('0x84'),0x0]))return _0x3931a5;_0x29e109=[];var _0x100dc0=_(_0x28af71)['map'](function(_0x1b6d44){if(_0x1b6d44['autoAssociation']===0x1)return;return _0x1b6d44[_0xe5e0('0x30')]===_0xe5e0('0x28')?'agent':_0xe5e0('0x2a');})[_0xe5e0('0x85')]()[_0xe5e0('0x2d')]();for(var _0x41327c=0x0;_0x41327c<_0x3931a5['length'];_0x41327c++){if(!_['includes'](_0x100dc0,_0x3931a5[_0x41327c][_0xe5e0('0x21')]))return;var _0x41d5b5=_0x3931a5[_0x41327c][_0xe5e0('0x21')]===_0xe5e0('0x22')?_0xe5e0('0x28'):'Telephones';_0x29e109[_0xe5e0('0x46')](db[_0xe5e0('0x31')][_0xe5e0('0x7b')]({'name':_0x3931a5[_0x41327c][_0xe5e0('0x30')],'resourceId':_0x3931a5[_0x41327c]['id'],'type':_0x41d5b5,'sectionId':_['find'](_0x28af71,['name',_0x41d5b5])['id']},{}));}return Promise[_0xe5e0('0x82')](_0x29e109);});})[_0xe5e0('0x20')](respondWithResult(_0x2ad991,0xc9))['catch'](handleError(_0x2ad991,null));};exports['changePassword']=function(_0x588fde,_0x7bedc9){if(_0x588fde[_0xe5e0('0x58')]['id']){delete _0x588fde[_0xe5e0('0x58')]['id'];}return db['User'][_0xe5e0('0x2f')]({'where':{'id':_0x588fde['params']['id']}})[_0xe5e0('0x20')](function(_0x3ac5d6){if(!_0x3ac5d6)return null;if(_0x3ac5d6['id']===_0x588fde[_0xe5e0('0x27')]['id']){if(!_0x588fde[_0xe5e0('0x58')][_0xe5e0('0x86')]||!_0x588fde[_0xe5e0('0x58')]['newPassword']){throw new db['Sequelize']['ValidationError'](_0xe5e0('0x87'));}if(!_0x3ac5d6[_0xe5e0('0x88')](_0x588fde['body'][_0xe5e0('0x86')])){throw new db[(_0xe5e0('0x89'))][(_0xe5e0('0x8a'))]('Wrong\x20credentials');}if(_0x588fde['body'][_0xe5e0('0x86')]===_0x588fde[_0xe5e0('0x58')]['newPassword']){throw new db[(_0xe5e0('0x89'))][(_0xe5e0('0x8a'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x588fde['user'][_0xe5e0('0x21')]===_0xe5e0('0x25')){if(!_0x588fde[_0xe5e0('0x58')][_0xe5e0('0x8b')]){throw new db[(_0xe5e0('0x89'))]['ValidationError'](_0xe5e0('0x8c'));}}else if(_0x588fde[_0xe5e0('0x27')][_0xe5e0('0x21')]==='user'){if(!_0x588fde[_0xe5e0('0x58')][_0xe5e0('0x8b')]){throw new db[(_0xe5e0('0x89'))][(_0xe5e0('0x8a'))](_0xe5e0('0x8c'));}if(_0x3ac5d6[_0xe5e0('0x21')]!=='agent'){throw new db['Sequelize']['ValidationError'](_0xe5e0('0x75'));}}else{throw new db[(_0xe5e0('0x89'))][(_0xe5e0('0x8a'))](_0xe5e0('0x75'));}return _0x3ac5d6;})[_0xe5e0('0x20')](handleEntityNotFound(_0x7bedc9,null))[_0xe5e0('0x20')](function(_0xb5922c){return db[_0xe5e0('0x5d')][_0xe5e0('0x8d')]({'attributes':['id','securePassword',_0xe5e0('0x8e'),_0xe5e0('0x8f')]})[_0xe5e0('0x20')](function(_0x67aaef){if(_0x67aaef[_0xe5e0('0x5f')])authService[_0xe5e0('0x90')](_0x588fde[_0xe5e0('0x58')][_0xe5e0('0x8b')]);if(!_0x67aaef[_0xe5e0('0x8e')]||!_0xb5922c[_0xe5e0('0x3b')])return _0xb5922c;authService['validatePasswordHistory'](_0x588fde['body'][_0xe5e0('0x8b')],_0xb5922c[_0xe5e0('0x3b')],_0x67aaef[_0xe5e0('0x8f')]);return _0xb5922c;})[_0xe5e0('0x20')](saveUpdates({'password':_0x588fde['body'][_0xe5e0('0x8b')],'passwordResetAt':_0x588fde[_0xe5e0('0x27')]['id']==_0x588fde[_0xe5e0('0x54')]['id']?moment():null,'previousPasswords':authService[_0xe5e0('0x91')](_0x588fde['body'][_0xe5e0('0x8b')],_0xb5922c[_0xe5e0('0x3b')])},null));})[_0xe5e0('0x20')](respondWithResult(_0x7bedc9,null))[_0xe5e0('0x52')](handleError(_0x7bedc9,null));};exports[_0xe5e0('0x92')]=function(_0x1ff8f8,_0x22b69c){var _0x1819a8=_0x1ff8f8[_0xe5e0('0x58')][_0xe5e0('0x93')];return db['User'][_0xe5e0('0x2f')]({'where':{'id':_0x1ff8f8[_0xe5e0('0x54')]['id']},'attributes':['id',_0xe5e0('0x30'),_0xe5e0('0x21'),'online',_0xe5e0('0x94'),'voicePause',_0xe5e0('0x95')]})[_0xe5e0('0x20')](handleEntityNotFound(_0x22b69c,null))[_0xe5e0('0x20')](function(_0x332251){if(_0x332251){if(!utils['isValidChannel'](_0x1819a8)){throw new db[(_0xe5e0('0x89'))][(_0xe5e0('0x8a'))]('Unknown\x20channel');}return _0x332251[_0xe5e0('0x96')+_[_0xe5e0('0x97')](_0x1819a8[_0xe5e0('0x98')]())+'Queues'](_0x1ff8f8[_0xe5e0('0x58')]['ids'],{'penalty':_0x1ff8f8[_0xe5e0('0x58')][_0xe5e0('0x99')]||0x0})[_0xe5e0('0x9a')](function(_0x8cd274){for(var _0x29efb5=0x0;_0x29efb5<_0x1ff8f8[_0xe5e0('0x58')]['ids'][_0xe5e0('0x4b')];_0x29efb5+=0x1){var _0x13513c={'UserId':Number(_0x1ff8f8[_0xe5e0('0x54')]['id'])};_0x13513c[_[_0xe5e0('0x97')](_0x1819a8[_0xe5e0('0x98')]())+_0xe5e0('0x9b')]=Number(_0x1ff8f8[_0xe5e0('0x58')][_0xe5e0('0x5b')][_0x29efb5]);socket[_0xe5e0('0x9c')](_0xe5e0('0x27')+_[_0xe5e0('0x97')](_0x1819a8[_0xe5e0('0x98')]())+_0xe5e0('0x9d'),_0x13513c);}return _0x8cd274;})[_0xe5e0('0x20')](function(){if(_0x1819a8===_0xe5e0('0x9e')){return db[_0xe5e0('0x9f')][_0xe5e0('0x47')]({'where':{'id':_0x1ff8f8[_0xe5e0('0x58')][_0xe5e0('0x5b')]||[]},'raw':!![],'attributes':['id',_0xe5e0('0x30')]});}})['then'](function(_0x4bc68d){var _0x485507=_0x332251[_0xe5e0('0x24')]({'plain':!![]});var _0x544a1b=[];if(_0x1819a8===_0xe5e0('0x9e')&&_0x485507[_0xe5e0('0x21')]==='agent'&&_0x485507[_0xe5e0('0xa0')]){for(let _0x434b6b=0x0;_0x434b6b<_0x4bc68d[_0xe5e0('0x4b')];_0x434b6b+=0x1){_0x544a1b[_0xe5e0('0x46')]({'membername':_0x485507['name'],'UserId':_0x485507['id'],'queue_name':_0x4bc68d[_0x434b6b]['name'],'VoiceQueueId':_0x4bc68d[_0x434b6b]['id'],'interface':_[_0xe5e0('0x65')](_0x485507[_0xe5e0('0x95')])?util[_0xe5e0('0xa1')](_0xe5e0('0xa2'),_0x485507[_0xe5e0('0x30')]):_0x485507[_0xe5e0('0x95')],'paused':_0x485507[_0xe5e0('0xa3')]||![],'penalty':_0x1ff8f8[_0xe5e0('0x58')]['penalty']||0x0});}return Promise['all'](_0x544a1b[_0xe5e0('0x2c')](function(_0x1685df){return db[_0xe5e0('0xa4')][_0xe5e0('0xa5')](_0x1685df);}));}return _0x332251;});}})[_0xe5e0('0x20')](respondWithStatusCode(_0x22b69c,null))[_0xe5e0('0x52')](handleError(_0x22b69c,null));};exports['removeQueues']=function(_0x1c43ee,_0x3a1863){var _0x20237b,_0x5c4df7;return db[_0xe5e0('0x41')][_0xe5e0('0x2f')]({'where':{'id':_0x1c43ee['params']['id']},'attributes':['id',_0xe5e0('0x30'),_0xe5e0('0x21')]})[_0xe5e0('0x20')](handleEntityNotFound(_0x3a1863,null))[_0xe5e0('0x20')](function(_0x2d73b7){if(_0x2d73b7){_0x20237b=_0x2d73b7;if(!_0x1c43ee['query'][_0xe5e0('0x93')]||!utils['isValidChannel'](_0x1c43ee['query'][_0xe5e0('0x93')])){throw new db['Sequelize'][(_0xe5e0('0x8a'))](_0xe5e0('0xa6'));}return _0x2d73b7['remove'+_[_0xe5e0('0x97')](_0x1c43ee[_0xe5e0('0x42')]['channel'][_0xe5e0('0x98')]())+'Queues'](_0x1c43ee[_0xe5e0('0x42')]['ids']);}})['then'](function(_0x44e472){if(_[_0xe5e0('0xa7')](_0x1c43ee[_0xe5e0('0x42')][_0xe5e0('0x5b')])){for(var _0x27e289=0x0;_0x27e289<_0x1c43ee['query']['ids'][_0xe5e0('0x4b')];_0x27e289+=0x1){_0x5c4df7={'UserId':Number(_0x1c43ee['params']['id'])};_0x5c4df7[_['capitalize'](_0x1c43ee[_0xe5e0('0x42')]['channel']['toLowerCase']())+'QueueId']=Number(_0x1c43ee[_0xe5e0('0x42')]['ids'][_0x27e289]);socket[_0xe5e0('0x9c')](_0xe5e0('0x27')+_['capitalize'](_0x1c43ee[_0xe5e0('0x42')][_0xe5e0('0x93')][_0xe5e0('0x98')]())+_0xe5e0('0xa8'),_0x5c4df7);}}else{_0x5c4df7={'UserId':Number(_0x1c43ee[_0xe5e0('0x54')]['id'])};_0x5c4df7[_[_0xe5e0('0x97')](_0x1c43ee['query'][_0xe5e0('0x93')][_0xe5e0('0x98')]())+'QueueId']=Number(_0x1c43ee[_0xe5e0('0x42')][_0xe5e0('0x5b')]);socket[_0xe5e0('0x9c')](_0xe5e0('0x27')+_[_0xe5e0('0x97')](_0x1c43ee[_0xe5e0('0x42')][_0xe5e0('0x93')][_0xe5e0('0x98')]())+_0xe5e0('0xa8'),_0x5c4df7);}return _0x44e472;})[_0xe5e0('0x20')](function(){if(_0x1c43ee['query'][_0xe5e0('0x93')]===_0xe5e0('0x9e')){return db[_0xe5e0('0xa4')][_0xe5e0('0x23')]({'where':{'UserId':_0x1c43ee['params']['id'],'VoiceQueueId':_0x1c43ee['query'][_0xe5e0('0x5b')]},'individualHooks':!![]})[_0xe5e0('0x20')](function(){return _0x20237b;});}return _0x20237b;})[_0xe5e0('0x20')](respondWithStatusCode(_0x3a1863,null))[_0xe5e0('0x52')](handleError(_0x3a1863,null));};exports[_0xe5e0('0xa9')]=function(_0x27f587,_0x27ca47){_0x27f587[_0xe5e0('0x58')][_0xe5e0('0xaa')]=_0x27f587[_0xe5e0('0xab')][_0xe5e0('0xac')];return db[_0xe5e0('0x41')][_0xe5e0('0x2f')]({'where':{'id':_0x27f587[_0xe5e0('0x54')]['id']}})[_0xe5e0('0x20')](handleEntityNotFound(_0x27ca47,null))[_0xe5e0('0x20')](saveUpdates(_0x27f587['body'],null))['then'](respondWithResult(_0x27ca47,null))[_0xe5e0('0x52')](handleError(_0x27ca47,null));};exports[_0xe5e0('0xad')]=function(_0x2793ec,_0x21fd58){var _0x298ade=path[_0xe5e0('0xae')](config[_0xe5e0('0xaf')],'server/files/images/logos/default_profile.png');return db[_0xe5e0('0x41')][_0xe5e0('0x2f')]({'where':{'id':_0x2793ec[_0xe5e0('0x54')]['id']},'attributes':['id',_0xe5e0('0xaa')],'raw':!![]})[_0xe5e0('0x20')](handleEntityNotFound(_0x21fd58,null))[_0xe5e0('0x20')](function(_0x36abd2){if(_0x36abd2){if(_['isNil'](_0x36abd2[_0xe5e0('0xaa')])){return _0x21fd58[_0xe5e0('0xb0')](_0x298ade);}else{if(!fs[_0xe5e0('0xb1')](path[_0xe5e0('0xae')](config[_0xe5e0('0xaf')],_0xe5e0('0xb2'),_0x36abd2[_0xe5e0('0xaa')]))){return _0x21fd58[_0xe5e0('0xb0')](_0x298ade);}return _0x21fd58[_0xe5e0('0xb0')](path['join'](config[_0xe5e0('0xaf')],'server/files/images/',_0x36abd2[_0xe5e0('0xaa')]));}}})[_0xe5e0('0x52')](handleError(_0x21fd58,null));};exports[_0xe5e0('0xb3')]=function(_0x4a7c07,_0x5b0a06){return db[_0xe5e0('0x41')][_0xe5e0('0x2f')]({'where':{'id':_0x4a7c07[_0xe5e0('0x54')]['id']},'attributes':['id']})[_0xe5e0('0x20')](handleEntityNotFound(_0x5b0a06,null))[_0xe5e0('0x20')](function(_0x4d23d5){var _0x28e763=[];values=_0x4d23d5['dataValues'];_0x28e763['push'](get_open_tabs(_0xe5e0('0x57'),_0x4d23d5[_0xe5e0('0x4c')]));_0x28e763[_0xe5e0('0x46')](get_open_tabs(_0xe5e0('0x4d'),_0x4d23d5[_0xe5e0('0x4c')]));_0x28e763['push'](get_open_tabs('openchannel',_0x4d23d5[_0xe5e0('0x4c')]));_0x28e763['push'](get_open_tabs(_0xe5e0('0x51'),_0x4d23d5['dataValues']));_0x28e763[_0xe5e0('0x46')](get_open_tabs('fax',_0x4d23d5[_0xe5e0('0x4c')]));_0x28e763[_0xe5e0('0x46')](get_open_tabs(_0xe5e0('0x4f'),_0x4d23d5[_0xe5e0('0x4c')]));return Promise[_0xe5e0('0x82')](_0x28e763);})[_0xe5e0('0x20')](function(_0x37a265){if(_0x37a265){var _0x539dd2=_[_0xe5e0('0x2c')](values['ChatOpenTabs'],function(_0x4b0c31){return{'channel':'CHAT','id':_0x4b0c31['id'],'createdAt':_0x4b0c31['createdAt']};});var _0x1e6067=_['map'](values[_0xe5e0('0xb4')],function(_0x1fd04f){return{'channel':_0xe5e0('0xb5'),'id':_0x1fd04f['id'],'createdAt':_0x1fd04f[_0xe5e0('0xb6')]};});var _0x36ab61=_[_0xe5e0('0x2c')](values[_0xe5e0('0xb7')],function(_0x2ba022){return{'channel':_0xe5e0('0xb8'),'id':_0x2ba022['id'],'createdAt':_0x2ba022[_0xe5e0('0xb6')]};});var _0x54f4c8=_[_0xe5e0('0x2c')](values[_0xe5e0('0xb9')],function(_0x5b9872){return{'channel':_0xe5e0('0xba'),'id':_0x5b9872['id'],'createdAt':_0x5b9872[_0xe5e0('0xb6')]};});var _0x1b5e30=_[_0xe5e0('0x2c')](values[_0xe5e0('0xbb')],function(_0x5d9936){return{'channel':_0xe5e0('0xbc'),'id':_0x5d9936['id'],'createdAt':_0x5d9936[_0xe5e0('0xb6')]};});var _0x2e7ee4=_[_0xe5e0('0x2c')](values[_0xe5e0('0xbd')],function(_0x502b2d){return{'channel':_0xe5e0('0xbe'),'id':_0x502b2d['id'],'createdAt':_0x502b2d[_0xe5e0('0xb6')]};});var _0x7693b8=_[_0xe5e0('0xbf')](_0x539dd2,_0x1e6067,_0x36ab61,_0x54f4c8,_0x1b5e30,_0x2e7ee4);var _0x50065b={'count':_0x7693b8['length'],'rows':_0x7693b8};return _0x50065b;}else return null;})['then'](respondWithResult(_0x5b0a06,null))[_0xe5e0('0x52')](handleError(_0x5b0a06,null));};exports[_0xe5e0('0xc0')]=function(_0x22d027,_0x7797c8){var _0x432d88={};return db[_0xe5e0('0x41')][_0xe5e0('0x8d')]({'where':{'id':_0x22d027['params']['id']}})['then'](function(_0x47b25e){if(!_0x47b25e){throw new APINotFoundError(util['format']('User\x20with\x20id\x20%s\x20not\x20found',_0x22d027[_0xe5e0('0x54')]['id']));}return contacts[_0xe5e0('0x59')]();})[_0xe5e0('0x20')](function(_0x27523f){_0x22d027[_0xe5e0('0x42')][_0xe5e0('0x41')]=_0x22d027['params']['id'];_0x432d88=qs[_0xe5e0('0x55')](_0x27523f,_0x22d027);if(_0x22d027[_0xe5e0('0x42')][_0xe5e0('0xc1')](_0xe5e0('0xc2'))){_0x432d88['include']=[{'model':db['CmList'],'as':_0xe5e0('0xc3'),'required':![]},{'model':db[_0xe5e0('0xc4')],'as':_0xe5e0('0xc5'),'attributes':['id',_0xe5e0('0x30'),_0xe5e0('0xc6')],'where':_0x22d027[_0xe5e0('0x42')][_0xe5e0('0xc7')]?{'id':_0x22d027['query']['tag']}:undefined,'required':_0x22d027['query']['tag']?!![]:![]}];}return contacts['findAll'](_0x22d027['query'],_0x22d027[_0xe5e0('0x27')],_0x432d88,_0x27523f);})[_0xe5e0('0x20')](respondWithFilteredResult(_0x7797c8,_0x432d88))[_0xe5e0('0x52')](APIHandleError(_0x7797c8));};exports[_0xe5e0('0xc8')]=function(_0x4f9245,_0x26b3c5){var _0x4f35a3;var _0x3dc611={};var _0x28f6ed;return db['User'][_0xe5e0('0x8d')]({'where':{'id':_0x4f9245['params']['id']},'attributes':['id',_0xe5e0('0x30'),_0xe5e0('0x21')]})[_0xe5e0('0x20')](handleEntityNotFound(_0x26b3c5,null))['then'](function(_0x3ddafc){if(!utils[_0xe5e0('0xc9')](_0x4f9245[_0xe5e0('0x42')]['channel'])){throw new db[(_0xe5e0('0x89'))]['ValidationError'](_0xe5e0('0xa6'));}_0x4f35a3=_0x3ddafc;var _0x223e96={};_0x223e96[_0xe5e0('0xca')]=_[_0xe5e0('0xcb')](db[_[_0xe5e0('0x97')](_0x4f9245[_0xe5e0('0x42')][_0xe5e0('0x93')])+'Queue'][_0xe5e0('0x35')]);_0x223e96[_0xe5e0('0x42')]=_[_0xe5e0('0xcb')](_0x4f9245[_0xe5e0('0x42')]);_0x223e96['filters']=_['intersection'](_0x223e96[_0xe5e0('0xca')],_0x223e96[_0xe5e0('0x42')]);_0x3dc611[_0xe5e0('0x45')]=_['intersection'](_0x223e96[_0xe5e0('0xca')],qs['fields'](_0x4f9245[_0xe5e0('0x42')][_0xe5e0('0xcc')]));_0x3dc611[_0xe5e0('0x45')]=_0x3dc611[_0xe5e0('0x45')][_0xe5e0('0x4b')]?_0x3dc611[_0xe5e0('0x45')]:_0x223e96[_0xe5e0('0xca')];_0x3dc611[_0xe5e0('0xcd')]=qs[_0xe5e0('0xce')](_0x4f9245[_0xe5e0('0x42')]['sort']);_0x3dc611['where']=qs['filters'](_['pick'](_0x4f9245[_0xe5e0('0x42')],_0x223e96['filters']));if(_0x4f9245[_0xe5e0('0x42')][_0xe5e0('0x2b')]){_0x3dc611[_0xe5e0('0x40')]=_[_0xe5e0('0x56')](_0x3dc611[_0xe5e0('0x40')],{'$or':_[_0xe5e0('0x2c')](_0x3dc611[_0xe5e0('0x45')],function(_0x153a0f){var _0x2b9575={};_0x2b9575[_0x153a0f]={'$like':'%'+_0x4f9245['query'][_0xe5e0('0x2b')]+'%'};return _0x2b9575;})});}_0x3dc611=_[_0xe5e0('0x56')]({},_0x3dc611,_0x4f9245[_0xe5e0('0xcf')]);switch(_0x4f35a3[_0xe5e0('0x21')]){case _0xe5e0('0x25'):return db[_['capitalize'](_0x4f9245['query'][_0xe5e0('0x93')])+_0xe5e0('0xd0')][_0xe5e0('0x47')](_0x3dc611);case _0xe5e0('0x27'):case _0xe5e0('0x22'):return _0x4f35a3[_0xe5e0('0x24')+_[_0xe5e0('0x97')](_0x4f9245[_0xe5e0('0x42')][_0xe5e0('0x93')])+'Queues'](_0x3dc611);default:throw new db['Sequelize'][(_0xe5e0('0x8a'))]('Unknown\x20role');}})['then'](function(_0x2946a5){_0x28f6ed=_0x2946a5[_0xe5e0('0x4b')];if(!_0x4f9245[_0xe5e0('0x42')][_0xe5e0('0xc1')](_0xe5e0('0xd1'))){_0x3dc611['limit']=qs[_0xe5e0('0x1b')](_0x4f9245['query'][_0xe5e0('0x1b')]);_0x3dc611['offset']=qs[_0xe5e0('0x19')](_0x4f9245[_0xe5e0('0x42')]['offset']);}switch(_0x4f35a3['role']){case'admin':return db[_[_0xe5e0('0x97')](_0x4f9245['query'][_0xe5e0('0x93')])+_0xe5e0('0xd0')][_0xe5e0('0x47')](_0x3dc611);case _0xe5e0('0x27'):case'agent':return _0x4f35a3[_0xe5e0('0x24')+_[_0xe5e0('0x97')](_0x4f9245[_0xe5e0('0x42')][_0xe5e0('0x93')])+'Queues'](_0x3dc611);}})[_0xe5e0('0x20')](function(_0x153f20){return{'count':_0x28f6ed,'rows':_0x153f20};})[_0xe5e0('0x20')](respondWithResult(_0x26b3c5,null))[_0xe5e0('0x52')](handleError(_0x26b3c5,null));};exports['getVoiceQueuesRt']=function(_0x593f34,_0xe125ab){var _0x15d693={};var _0x66727a={};var _0x443061;var _0x57ed84;return db[_0xe5e0('0x41')][_0xe5e0('0x8d')]({'where':{'id':_0x593f34[_0xe5e0('0x54')]['id']}})['then'](handleEntityNotFound(_0xe125ab,null))[_0xe5e0('0x20')](function(_0x387b3f){if(_0x387b3f){_0x443061=_0x387b3f;_0x66727a['model']=_['keys'](db[_0xe5e0('0xa4')][_0xe5e0('0x35')]);_0x66727a[_0xe5e0('0x42')]=_[_0xe5e0('0xcb')](_0x593f34['query']);_0x66727a[_0xe5e0('0xd2')]=_[_0xe5e0('0xd3')](_0x66727a[_0xe5e0('0xca')],_0x66727a[_0xe5e0('0x42')]);_0x15d693[_0xe5e0('0x45')]=_['intersection'](_0x66727a['model'],qs[_0xe5e0('0xcc')](_0x593f34[_0xe5e0('0x42')][_0xe5e0('0xcc')]));_0x15d693['attributes']=_0x15d693[_0xe5e0('0x45')][_0xe5e0('0x4b')]?_0x15d693[_0xe5e0('0x45')]:_0x66727a[_0xe5e0('0xca')];_0x15d693[_0xe5e0('0xcd')]=qs[_0xe5e0('0xce')](_0x593f34[_0xe5e0('0x42')][_0xe5e0('0xce')]);_0x15d693[_0xe5e0('0x40')]=qs[_0xe5e0('0xd2')](_['pick'](_0x593f34[_0xe5e0('0x42')],_0x66727a[_0xe5e0('0xd2')]));if(_0x593f34[_0xe5e0('0x42')][_0xe5e0('0x2b')]){_0x15d693['where']=_['merge'](_0x15d693[_0xe5e0('0x40')],{'$or':_[_0xe5e0('0x2c')](_0x15d693[_0xe5e0('0x45')],function(_0x411e7a){var _0x2606a1={};_0x2606a1[_0x411e7a]={'$like':'%'+_0x593f34[_0xe5e0('0x42')][_0xe5e0('0x2b')]+'%'};return _0x2606a1;})});}_0x15d693=_[_0xe5e0('0x56')]({},_0x15d693,_0x593f34['options']);return _0x443061['getVoiceQueuesRt'](_0x15d693);}})[_0xe5e0('0x20')](function(_0x32d644){if(_0x32d644){_0x57ed84=_0x32d644[_0xe5e0('0x4b')];if(!_0x593f34['query']['hasOwnProperty'](_0xe5e0('0xd1'))){_0x15d693[_0xe5e0('0x1b')]=qs[_0xe5e0('0x1b')](_0x593f34[_0xe5e0('0x42')][_0xe5e0('0x1b')]);_0x15d693[_0xe5e0('0x19')]=qs['offset'](_0x593f34[_0xe5e0('0x42')]['offset']);}return _0x443061[_0xe5e0('0xd4')](_0x15d693);}})[_0xe5e0('0x20')](function(_0x18095a){if(_0x18095a){return _0x18095a?{'count':_0x57ed84,'rows':_0x18095a}:null;}})['then'](respondWithResult(_0xe125ab,null))[_0xe5e0('0x52')](handleError(_0xe125ab,null));};exports['getGroups']=function(_0x816c5c,_0x33d59f){var _0x52289d={};var _0x6cf667={};var _0x105339;var _0x1394be;return db['User']['findOne']({'where':{'id':_0x816c5c[_0xe5e0('0x54')]['id']}})[_0xe5e0('0x20')](handleEntityNotFound(_0x33d59f,null))['then'](function(_0x53d82b){if(_0x53d82b){_0x105339=_0x53d82b;_0x6cf667[_0xe5e0('0xca')]=_['keys'](db[_0xe5e0('0xd5')][_0xe5e0('0x35')]);_0x6cf667['query']=_['keys'](_0x816c5c[_0xe5e0('0x42')]);_0x6cf667[_0xe5e0('0xd2')]=_[_0xe5e0('0xd3')](_0x6cf667['model'],_0x6cf667['query']);_0x52289d[_0xe5e0('0x45')]=_[_0xe5e0('0xd3')](_0x6cf667['model'],qs[_0xe5e0('0xcc')](_0x816c5c[_0xe5e0('0x42')][_0xe5e0('0xcc')]));_0x52289d[_0xe5e0('0x45')]=_0x52289d[_0xe5e0('0x45')][_0xe5e0('0x4b')]?_0x52289d[_0xe5e0('0x45')]:_0x6cf667[_0xe5e0('0xca')];_0x52289d[_0xe5e0('0xcd')]=qs['sort'](_0x816c5c['query'][_0xe5e0('0xce')]);_0x52289d[_0xe5e0('0x40')]=qs['filters'](_[_0xe5e0('0xd6')](_0x816c5c[_0xe5e0('0x42')],_0x6cf667[_0xe5e0('0xd2')]));if(_0x816c5c[_0xe5e0('0x42')][_0xe5e0('0x2b')]){_0x52289d[_0xe5e0('0x40')]=_[_0xe5e0('0x56')](_0x52289d['where'],{'$or':_['map'](_0x52289d[_0xe5e0('0x45')],function(_0x46f797){var _0x6169e9={};_0x6169e9[_0x46f797]={'$like':'%'+_0x816c5c['query'][_0xe5e0('0x2b')]+'%'};return _0x6169e9;})});}_0x52289d=_[_0xe5e0('0x56')]({},_0x52289d,_0x816c5c['options']);return _0x105339[_0xe5e0('0xd7')](_0x52289d);}})[_0xe5e0('0x20')](function(_0x4c55d3){if(_0x4c55d3){_0x1394be=_0x4c55d3[_0xe5e0('0x4b')];if(!_0x816c5c[_0xe5e0('0x42')][_0xe5e0('0xc1')](_0xe5e0('0xd1'))){_0x52289d[_0xe5e0('0x1b')]=qs[_0xe5e0('0x1b')](_0x816c5c[_0xe5e0('0x42')][_0xe5e0('0x1b')]);_0x52289d[_0xe5e0('0x19')]=qs[_0xe5e0('0x19')](_0x816c5c['query'][_0xe5e0('0x19')]);}return _0x105339[_0xe5e0('0xd7')](_0x52289d);}})[_0xe5e0('0x20')](function(_0xf614c7){if(_0xf614c7){return _0xf614c7?{'count':_0x1394be,'rows':_0xf614c7}:null;}})[_0xe5e0('0x20')](respondWithResult(_0x33d59f,null))[_0xe5e0('0x52')](handleError(_0x33d59f,null));};exports[_0xe5e0('0xd8')]=function(_0x2b7e72,_0xc98baf){var _0x555f54={'raw':!![],'where':{}};var _0x24fe46={};var _0x3387bf={'count':0x0,'rows':[]};return db[_0xe5e0('0x41')][_0xe5e0('0x8d')]({'where':{'id':_0x2b7e72[_0xe5e0('0x54')]['id']}})[_0xe5e0('0x20')](handleEntityNotFound(_0xc98baf,null))[_0xe5e0('0x20')](function(_0x110ef4){if(_0x110ef4){_0x24fe46[_0xe5e0('0xca')]=_[_0xe5e0('0xcb')](db[_0xe5e0('0xd9')][_0xe5e0('0x35')]);_0x24fe46['query']=_[_0xe5e0('0xcb')](_0x2b7e72[_0xe5e0('0x42')]);_0x24fe46[_0xe5e0('0xd2')]=_['intersection'](_0x24fe46[_0xe5e0('0xca')],_0x24fe46[_0xe5e0('0x42')]);_0x555f54[_0xe5e0('0x45')]=_['intersection'](_0x24fe46[_0xe5e0('0xca')],qs[_0xe5e0('0xcc')](_0x2b7e72[_0xe5e0('0x42')][_0xe5e0('0xcc')]));_0x555f54[_0xe5e0('0x45')]=_0x555f54[_0xe5e0('0x45')]['length']?_0x555f54['attributes']:_0x24fe46[_0xe5e0('0xca')];if(!_0x2b7e72[_0xe5e0('0x42')][_0xe5e0('0xc1')](_0xe5e0('0xd1'))){_0x555f54['limit']=qs[_0xe5e0('0x1b')](_0x2b7e72[_0xe5e0('0x42')][_0xe5e0('0x1b')]);_0x555f54[_0xe5e0('0x19')]=qs[_0xe5e0('0x19')](_0x2b7e72[_0xe5e0('0x42')][_0xe5e0('0x19')]);}_0x555f54[_0xe5e0('0xcd')]=qs[_0xe5e0('0xce')](_0x2b7e72['query'][_0xe5e0('0xce')]);_0x555f54['where']=qs[_0xe5e0('0xd2')](_[_0xe5e0('0xd6')](_0x2b7e72['query'],_0x24fe46[_0xe5e0('0xd2')]));_0x555f54['where'][_0xe5e0('0xda')]=_0x110ef4['id'];if(_0x2b7e72[_0xe5e0('0x42')]['filter']){_0x555f54[_0xe5e0('0x40')]=_['merge'](_0x555f54[_0xe5e0('0x40')],{'$or':_[_0xe5e0('0x2c')](_0x555f54[_0xe5e0('0x45')],function(_0x2f670b){var _0x30a764={};_0x30a764[_0x2f670b]={'$like':'%'+_0x2b7e72['query']['filter']+'%'};return _0x30a764;})});}_0x555f54=_[_0xe5e0('0x56')]({},_0x555f54,_0x2b7e72[_0xe5e0('0xcf')]);return db['VoiceRecording'][_0xe5e0('0x1c')]({'where':_0x555f54[_0xe5e0('0x40')]})['then'](function(_0xaa8a3d){_0x3387bf[_0xe5e0('0x1c')]=_0xaa8a3d;if(_0x2b7e72['query'][_0xe5e0('0xc2')]){_0x555f54[_0xe5e0('0xdb')]=[{'all':!![]}];}return db['VoiceRecording'][_0xe5e0('0x47')](_0x555f54);})[_0xe5e0('0x20')](function(_0x423ced){_0x3387bf['rows']=_0x423ced;return _0x3387bf;});}})['then'](respondWithFilteredResult(_0xc98baf,_0x555f54))['catch'](handleError(_0xc98baf,null));};exports['getScreenRecordings']=function(_0x56114d,_0x1cb4c9){var _0xa3c4d={'raw':!![],'where':{}};var _0x593c1a={};var _0x286d43={'count':0x0,'rows':[]};return db[_0xe5e0('0x41')][_0xe5e0('0x8d')]({'where':{'id':_0x56114d['params']['id']}})[_0xe5e0('0x20')](handleEntityNotFound(_0x1cb4c9,null))[_0xe5e0('0x20')](function(_0x5cf389){if(_0x5cf389){_0x593c1a[_0xe5e0('0xca')]=_[_0xe5e0('0xcb')](db[_0xe5e0('0xdc')][_0xe5e0('0x35')]);_0x593c1a[_0xe5e0('0x42')]=_[_0xe5e0('0xcb')](_0x56114d[_0xe5e0('0x42')]);_0x593c1a['filters']=_[_0xe5e0('0xd3')](_0x593c1a[_0xe5e0('0xca')],_0x593c1a['query']);_0xa3c4d['attributes']=_['intersection'](_0x593c1a[_0xe5e0('0xca')],qs[_0xe5e0('0xcc')](_0x56114d[_0xe5e0('0x42')][_0xe5e0('0xcc')]));_0xa3c4d[_0xe5e0('0x45')]=_0xa3c4d['attributes'][_0xe5e0('0x4b')]?_0xa3c4d[_0xe5e0('0x45')]:_0x593c1a[_0xe5e0('0xca')];if(!_0x56114d[_0xe5e0('0x42')][_0xe5e0('0xc1')](_0xe5e0('0xd1'))){_0xa3c4d[_0xe5e0('0x1b')]=qs[_0xe5e0('0x1b')](_0x56114d[_0xe5e0('0x42')][_0xe5e0('0x1b')]);_0xa3c4d[_0xe5e0('0x19')]=qs[_0xe5e0('0x19')](_0x56114d['query'][_0xe5e0('0x19')]);}_0xa3c4d[_0xe5e0('0xcd')]=qs[_0xe5e0('0xce')](_0x56114d[_0xe5e0('0x42')]['sort']);_0xa3c4d[_0xe5e0('0x40')]=qs['filters'](_[_0xe5e0('0xd6')](_0x56114d[_0xe5e0('0x42')],_0x593c1a[_0xe5e0('0xd2')]));_0xa3c4d[_0xe5e0('0x40')][_0xe5e0('0xda')]=_0x5cf389['id'];if(_0x56114d[_0xe5e0('0x42')][_0xe5e0('0x2b')]){_0xa3c4d[_0xe5e0('0x40')]=_['merge'](_0xa3c4d[_0xe5e0('0x40')],{'$or':_[_0xe5e0('0x2c')](_0xa3c4d[_0xe5e0('0x45')],function(_0x2e0203){var _0x25a825={};_0x25a825[_0x2e0203]={'$like':'%'+_0x56114d['query'][_0xe5e0('0x2b')]+'%'};return _0x25a825;})});}_0xa3c4d=_[_0xe5e0('0x56')]({},_0xa3c4d,_0x56114d['options']);return db[_0xe5e0('0xdc')][_0xe5e0('0x1c')]({'where':_0xa3c4d[_0xe5e0('0x40')]})[_0xe5e0('0x20')](function(_0x3f3756){_0x286d43['count']=_0x3f3756;if(_0x56114d[_0xe5e0('0x42')]['includeAll']){_0xa3c4d[_0xe5e0('0xdb')]=[{'all':!![]}];}return db[_0xe5e0('0xdc')][_0xe5e0('0x47')](_0xa3c4d);})['then'](function(_0x1d7360){_0x286d43[_0xe5e0('0x48')]=_0x1d7360;return _0x286d43;});}})[_0xe5e0('0x20')](respondWithFilteredResult(_0x1cb4c9,_0xa3c4d))[_0xe5e0('0x52')](handleError(_0x1cb4c9,null));};exports['getChatInteractions']=function(_0x355cb6,_0x5c3503){var _0x2dcb8f={};var _0x1c5bdc={};var _0x16ae3b;var _0xc3ff92;return db[_0xe5e0('0x41')][_0xe5e0('0x8d')]({'where':{'id':_0x355cb6['params']['id']}})[_0xe5e0('0x20')](handleEntityNotFound(_0x5c3503,null))['then'](function(_0x4ef4e7){if(_0x4ef4e7){_0x16ae3b=_0x4ef4e7;_0x1c5bdc[_0xe5e0('0xca')]=_[_0xe5e0('0xcb')](db[_0xe5e0('0xdd')][_0xe5e0('0x35')]);_0x1c5bdc[_0xe5e0('0x42')]=_[_0xe5e0('0xcb')](_0x355cb6[_0xe5e0('0x42')]);_0x1c5bdc[_0xe5e0('0xd2')]=_[_0xe5e0('0xd3')](_0x1c5bdc['model'],_0x1c5bdc[_0xe5e0('0x42')]);_0x2dcb8f[_0xe5e0('0x45')]=_[_0xe5e0('0xd3')](_0x1c5bdc[_0xe5e0('0xca')],qs['fields'](_0x355cb6[_0xe5e0('0x42')][_0xe5e0('0xcc')]));_0x2dcb8f[_0xe5e0('0x45')]=_0x2dcb8f[_0xe5e0('0x45')][_0xe5e0('0x4b')]?_0x2dcb8f[_0xe5e0('0x45')]:_0x1c5bdc['model'];_0x2dcb8f[_0xe5e0('0xcd')]=qs['sort'](_0x355cb6['query'][_0xe5e0('0xce')]);_0x2dcb8f[_0xe5e0('0x40')]=qs['filters'](_[_0xe5e0('0xd6')](_0x355cb6[_0xe5e0('0x42')],_0x1c5bdc['filters']));if(_0x355cb6['query'][_0xe5e0('0x2b')]){_0x2dcb8f[_0xe5e0('0x40')]=_[_0xe5e0('0x56')](_0x2dcb8f[_0xe5e0('0x40')],{'$or':_[_0xe5e0('0x2c')](_0x2dcb8f['attributes'],function(_0x38bec9){var _0x1e14b6={};_0x1e14b6[_0x38bec9]={'$like':'%'+_0x355cb6[_0xe5e0('0x42')][_0xe5e0('0x2b')]+'%'};return _0x1e14b6;})});}_0x2dcb8f=_[_0xe5e0('0x56')]({},_0x2dcb8f,_0x355cb6[_0xe5e0('0xcf')]);return _0x16ae3b[_0xe5e0('0xde')](_0x2dcb8f);}})[_0xe5e0('0x20')](function(_0x367664){if(_0x367664){_0xc3ff92=_0x367664[_0xe5e0('0x4b')];if(!_0x355cb6[_0xe5e0('0x42')][_0xe5e0('0xc1')](_0xe5e0('0xd1'))){_0x2dcb8f[_0xe5e0('0x1b')]=qs[_0xe5e0('0x1b')](_0x355cb6[_0xe5e0('0x42')][_0xe5e0('0x1b')]);_0x2dcb8f['offset']=qs[_0xe5e0('0x19')](_0x355cb6[_0xe5e0('0x42')]['offset']);}return _0x16ae3b[_0xe5e0('0xde')](_0x2dcb8f);}})[_0xe5e0('0x20')](function(_0x421d19){if(_0x421d19){return _0x421d19?{'count':_0xc3ff92,'rows':_0x421d19}:null;}})[_0xe5e0('0x20')](respondWithResult(_0x5c3503,null))[_0xe5e0('0x52')](handleError(_0x5c3503,null));};exports[_0xe5e0('0xdf')]=function(_0x3c0722,_0x437b26){var _0x16ddbb={};var _0xfaef5={};var _0x49be19;var _0x3d9af1;return db['User'][_0xe5e0('0x8d')]({'where':{'id':_0x3c0722[_0xe5e0('0x54')]['id']}})[_0xe5e0('0x20')](handleEntityNotFound(_0x437b26,null))['then'](function(_0x2fce94){if(_0x2fce94){_0x49be19=_0x2fce94;_0xfaef5[_0xe5e0('0xca')]=_['keys'](db['OpenchannelInteraction'][_0xe5e0('0x35')]);_0xfaef5[_0xe5e0('0x42')]=_[_0xe5e0('0xcb')](_0x3c0722[_0xe5e0('0x42')]);_0xfaef5[_0xe5e0('0xd2')]=_[_0xe5e0('0xd3')](_0xfaef5[_0xe5e0('0xca')],_0xfaef5[_0xe5e0('0x42')]);_0x16ddbb[_0xe5e0('0x45')]=_[_0xe5e0('0xd3')](_0xfaef5['model'],qs[_0xe5e0('0xcc')](_0x3c0722[_0xe5e0('0x42')][_0xe5e0('0xcc')]));_0x16ddbb[_0xe5e0('0x45')]=_0x16ddbb[_0xe5e0('0x45')][_0xe5e0('0x4b')]?_0x16ddbb['attributes']:_0xfaef5[_0xe5e0('0xca')];_0x16ddbb[_0xe5e0('0xcd')]=qs[_0xe5e0('0xce')](_0x3c0722['query'][_0xe5e0('0xce')]);_0x16ddbb['where']=qs['filters'](_[_0xe5e0('0xd6')](_0x3c0722[_0xe5e0('0x42')],_0xfaef5[_0xe5e0('0xd2')]));if(_0x3c0722[_0xe5e0('0x42')][_0xe5e0('0x2b')]){_0x16ddbb[_0xe5e0('0x40')]=_[_0xe5e0('0x56')](_0x16ddbb['where'],{'$or':_[_0xe5e0('0x2c')](_0x16ddbb[_0xe5e0('0x45')],function(_0xc5de7d){var _0x41c8d3={};_0x41c8d3[_0xc5de7d]={'$like':'%'+_0x3c0722[_0xe5e0('0x42')][_0xe5e0('0x2b')]+'%'};return _0x41c8d3;})});}_0x16ddbb=_[_0xe5e0('0x56')]({},_0x16ddbb,_0x3c0722[_0xe5e0('0xcf')]);return _0x49be19[_0xe5e0('0xdf')](_0x16ddbb);}})['then'](function(_0x307e9d){if(_0x307e9d){_0x3d9af1=_0x307e9d[_0xe5e0('0x4b')];if(!_0x3c0722[_0xe5e0('0x42')][_0xe5e0('0xc1')](_0xe5e0('0xd1'))){_0x16ddbb[_0xe5e0('0x1b')]=qs[_0xe5e0('0x1b')](_0x3c0722['query'][_0xe5e0('0x1b')]);_0x16ddbb[_0xe5e0('0x19')]=qs[_0xe5e0('0x19')](_0x3c0722[_0xe5e0('0x42')][_0xe5e0('0x19')]);}return _0x49be19[_0xe5e0('0xdf')](_0x16ddbb);}})['then'](function(_0x4b57d8){if(_0x4b57d8){return _0x4b57d8?{'count':_0x3d9af1,'rows':_0x4b57d8}:null;}})[_0xe5e0('0x20')](respondWithResult(_0x437b26,null))[_0xe5e0('0x52')](handleError(_0x437b26,null));};exports[_0xe5e0('0xe0')]=function(_0x36fcd8,_0x551fd1){var _0x31e271={'raw':!![],'where':{}};var _0x2192bf={};var _0x294279={'count':0x0,'rows':[]};return db[_0xe5e0('0x41')][_0xe5e0('0x8d')]({'where':{'id':_0x36fcd8[_0xe5e0('0x54')]['id']}})[_0xe5e0('0x20')](handleEntityNotFound(_0x551fd1,null))[_0xe5e0('0x20')](function(_0x159edc){if(_0x159edc){_0x2192bf[_0xe5e0('0xca')]=_[_0xe5e0('0xcb')](db[_0xe5e0('0xe1')][_0xe5e0('0x35')]);_0x2192bf[_0xe5e0('0x42')]=_[_0xe5e0('0xcb')](_0x36fcd8[_0xe5e0('0x42')]);_0x2192bf[_0xe5e0('0xd2')]=_[_0xe5e0('0xd3')](_0x2192bf[_0xe5e0('0xca')],_0x2192bf[_0xe5e0('0x42')]);_0x31e271['attributes']=_[_0xe5e0('0xd3')](_0x2192bf['model'],qs[_0xe5e0('0xcc')](_0x36fcd8[_0xe5e0('0x42')][_0xe5e0('0xcc')]));_0x31e271[_0xe5e0('0x45')]=_0x31e271[_0xe5e0('0x45')]['length']?_0x31e271[_0xe5e0('0x45')]:_0x2192bf[_0xe5e0('0xca')];if(!_0x36fcd8[_0xe5e0('0x42')]['hasOwnProperty'](_0xe5e0('0xd1'))){_0x31e271[_0xe5e0('0x1b')]=qs[_0xe5e0('0x1b')](_0x36fcd8[_0xe5e0('0x42')][_0xe5e0('0x1b')]);_0x31e271[_0xe5e0('0x19')]=qs[_0xe5e0('0x19')](_0x36fcd8[_0xe5e0('0x42')][_0xe5e0('0x19')]);}_0x31e271[_0xe5e0('0xcd')]=qs[_0xe5e0('0xce')](_0x36fcd8[_0xe5e0('0x42')]['sort']);_0x31e271[_0xe5e0('0x40')]=qs[_0xe5e0('0xd2')](_['pick'](_0x36fcd8[_0xe5e0('0x42')],_0x2192bf['filters']));_0x31e271[_0xe5e0('0x40')]['UserId']=_0x159edc['id'];if(_0x36fcd8[_0xe5e0('0x42')]['filter']){_0x31e271[_0xe5e0('0x40')]=_[_0xe5e0('0x56')](_0x31e271['where'],{'$or':_[_0xe5e0('0x2c')](_0x31e271[_0xe5e0('0x45')],function(_0x58c4db){var _0x2fd11a={};_0x2fd11a[_0x58c4db]={'$like':'%'+_0x36fcd8[_0xe5e0('0x42')][_0xe5e0('0x2b')]+'%'};return _0x2fd11a;})});}_0x31e271=_[_0xe5e0('0x56')]({},_0x31e271,_0x36fcd8[_0xe5e0('0xcf')]);return db['MailInteraction']['count']({'where':_0x31e271[_0xe5e0('0x40')]})[_0xe5e0('0x20')](function(_0x3b2387){_0x294279[_0xe5e0('0x1c')]=_0x3b2387;if(_0x36fcd8['query'][_0xe5e0('0xc2')]){_0x31e271['include']=[{'all':!![]}];}return db[_0xe5e0('0xe1')][_0xe5e0('0x47')](_0x31e271);})[_0xe5e0('0x20')](function(_0x562a05){_0x294279[_0xe5e0('0x48')]=_0x562a05;return _0x294279;});}})['then'](respondWithFilteredResult(_0x551fd1,_0x31e271))['catch'](handleError(_0x551fd1,null));};exports[_0xe5e0('0xe2')]=function(_0x3163bb,_0xfa0303){var _0x3657a9={};var _0x6747de={};var _0x31cd10;var _0x4c3016;return db['User'][_0xe5e0('0x8d')]({'where':{'id':_0x3163bb[_0xe5e0('0x54')]['id']}})['then'](handleEntityNotFound(_0xfa0303,null))[_0xe5e0('0x20')](function(_0x119913){if(_0x119913){_0x31cd10=_0x119913;_0x6747de[_0xe5e0('0xca')]=_['keys'](db[_0xe5e0('0xe3')][_0xe5e0('0x35')]);_0x6747de[_0xe5e0('0x42')]=_[_0xe5e0('0xcb')](_0x3163bb[_0xe5e0('0x42')]);_0x6747de[_0xe5e0('0xd2')]=_[_0xe5e0('0xd3')](_0x6747de[_0xe5e0('0xca')],_0x6747de[_0xe5e0('0x42')]);_0x3657a9['attributes']=_[_0xe5e0('0xd3')](_0x6747de[_0xe5e0('0xca')],qs[_0xe5e0('0xcc')](_0x3163bb[_0xe5e0('0x42')]['fields']));_0x3657a9[_0xe5e0('0x45')]=_0x3657a9[_0xe5e0('0x45')][_0xe5e0('0x4b')]?_0x3657a9[_0xe5e0('0x45')]:_0x6747de[_0xe5e0('0xca')];_0x3657a9[_0xe5e0('0xcd')]=qs[_0xe5e0('0xce')](_0x3163bb[_0xe5e0('0x42')][_0xe5e0('0xce')]);_0x3657a9[_0xe5e0('0x40')]=qs[_0xe5e0('0xd2')](_[_0xe5e0('0xd6')](_0x3163bb[_0xe5e0('0x42')],_0x6747de[_0xe5e0('0xd2')]));if(_0x3163bb[_0xe5e0('0x42')][_0xe5e0('0x2b')]){_0x3657a9['where']=_[_0xe5e0('0x56')](_0x3657a9[_0xe5e0('0x40')],{'$or':_[_0xe5e0('0x2c')](_0x3657a9['attributes'],function(_0xfcdaba){var _0x5bd8a4={};_0x5bd8a4[_0xfcdaba]={'$like':'%'+_0x3163bb['query'][_0xe5e0('0x2b')]+'%'};return _0x5bd8a4;})});}_0x3657a9=_['merge']({},_0x3657a9,_0x3163bb[_0xe5e0('0xcf')]);return _0x31cd10[_0xe5e0('0xe2')](_0x3657a9);}})['then'](function(_0x1edae6){if(_0x1edae6){_0x4c3016=_0x1edae6['length'];if(!_0x3163bb[_0xe5e0('0x42')]['hasOwnProperty']('nolimit')){_0x3657a9['limit']=qs[_0xe5e0('0x1b')](_0x3163bb['query'][_0xe5e0('0x1b')]);_0x3657a9[_0xe5e0('0x19')]=qs[_0xe5e0('0x19')](_0x3163bb['query'][_0xe5e0('0x19')]);}return _0x31cd10['getSmsInteractions'](_0x3657a9);}})[_0xe5e0('0x20')](function(_0x3eafed){if(_0x3eafed){return _0x3eafed?{'count':_0x4c3016,'rows':_0x3eafed}:null;}})[_0xe5e0('0x20')](respondWithResult(_0xfa0303,null))[_0xe5e0('0x52')](handleError(_0xfa0303,null));};exports[_0xe5e0('0xe4')]=function(_0x27eab,_0x17ee82){var _0xd7e77e={};var _0x26a7c1={};var _0x41d492;var _0x159e74;return db[_0xe5e0('0x41')][_0xe5e0('0x8d')]({'where':{'id':_0x27eab[_0xe5e0('0x54')]['id']}})['then'](handleEntityNotFound(_0x17ee82,null))[_0xe5e0('0x20')](function(_0x5336dc){if(_0x5336dc){_0x41d492=_0x5336dc;_0x26a7c1[_0xe5e0('0xca')]=_[_0xe5e0('0xcb')](db[_0xe5e0('0xe5')][_0xe5e0('0x35')]);_0x26a7c1['query']=_[_0xe5e0('0xcb')](_0x27eab[_0xe5e0('0x42')]);_0x26a7c1['filters']=_[_0xe5e0('0xd3')](_0x26a7c1['model'],_0x26a7c1[_0xe5e0('0x42')]);_0xd7e77e[_0xe5e0('0x45')]=_[_0xe5e0('0xd3')](_0x26a7c1[_0xe5e0('0xca')],qs[_0xe5e0('0xcc')](_0x27eab[_0xe5e0('0x42')][_0xe5e0('0xcc')]));_0xd7e77e[_0xe5e0('0x45')]=_0xd7e77e[_0xe5e0('0x45')][_0xe5e0('0x4b')]?_0xd7e77e[_0xe5e0('0x45')]:_0x26a7c1['model'];_0xd7e77e[_0xe5e0('0xcd')]=qs['sort'](_0x27eab[_0xe5e0('0x42')]['sort']);_0xd7e77e[_0xe5e0('0x40')]=qs[_0xe5e0('0xd2')](_['pick'](_0x27eab[_0xe5e0('0x42')],_0x26a7c1[_0xe5e0('0xd2')]));if(_0x27eab[_0xe5e0('0x42')][_0xe5e0('0x2b')]){_0xd7e77e[_0xe5e0('0x40')]=_['merge'](_0xd7e77e[_0xe5e0('0x40')],{'$or':_[_0xe5e0('0x2c')](_0xd7e77e['attributes'],function(_0x3e223c){var _0x5d3da2={};_0x5d3da2[_0x3e223c]={'$like':'%'+_0x27eab[_0xe5e0('0x42')][_0xe5e0('0x2b')]+'%'};return _0x5d3da2;})});}_0xd7e77e=_[_0xe5e0('0x56')]({},_0xd7e77e,_0x27eab[_0xe5e0('0xcf')]);return _0x41d492[_0xe5e0('0xe4')](_0xd7e77e);}})[_0xe5e0('0x20')](function(_0x5d43b6){if(_0x5d43b6){_0x159e74=_0x5d43b6[_0xe5e0('0x4b')];if(!_0x27eab[_0xe5e0('0x42')]['hasOwnProperty'](_0xe5e0('0xd1'))){_0xd7e77e['limit']=qs['limit'](_0x27eab['query'][_0xe5e0('0x1b')]);_0xd7e77e[_0xe5e0('0x19')]=qs['offset'](_0x27eab['query'][_0xe5e0('0x19')]);}return _0x41d492[_0xe5e0('0xe4')](_0xd7e77e);}})[_0xe5e0('0x20')](function(_0x48d031){if(_0x48d031){return _0x48d031?{'count':_0x159e74,'rows':_0x48d031}:null;}})[_0xe5e0('0x20')](respondWithResult(_0x17ee82,null))[_0xe5e0('0x52')](handleError(_0x17ee82,null));};exports[_0xe5e0('0xe6')]=function(_0x391d35,_0x129b43){var _0x4651c1={};var _0x413f42={};var _0x3c7e58;var _0xa4f6cf;return db[_0xe5e0('0x41')][_0xe5e0('0x8d')]({'where':{'id':_0x391d35[_0xe5e0('0x54')]['id']}})[_0xe5e0('0x20')](handleEntityNotFound(_0x129b43,null))[_0xe5e0('0x20')](function(_0x178a7e){if(_0x178a7e){_0x3c7e58=_0x178a7e;_0x413f42[_0xe5e0('0xca')]=_[_0xe5e0('0xcb')](db[_0xe5e0('0xe7')][_0xe5e0('0x35')]);_0x413f42[_0xe5e0('0x42')]=_[_0xe5e0('0xcb')](_0x391d35[_0xe5e0('0x42')]);_0x413f42['filters']=_[_0xe5e0('0xd3')](_0x413f42[_0xe5e0('0xca')],_0x413f42[_0xe5e0('0x42')]);_0x4651c1[_0xe5e0('0x45')]=_['intersection'](_0x413f42[_0xe5e0('0xca')],qs['fields'](_0x391d35[_0xe5e0('0x42')][_0xe5e0('0xcc')]));_0x4651c1['attributes']=_0x4651c1[_0xe5e0('0x45')][_0xe5e0('0x4b')]?_0x4651c1[_0xe5e0('0x45')]:_0x413f42[_0xe5e0('0xca')];_0x4651c1[_0xe5e0('0xcd')]=qs['sort'](_0x391d35[_0xe5e0('0x42')][_0xe5e0('0xce')]);_0x4651c1['where']=qs[_0xe5e0('0xd2')](_[_0xe5e0('0xd6')](_0x391d35['query'],_0x413f42[_0xe5e0('0xd2')]));if(_0x391d35[_0xe5e0('0x42')][_0xe5e0('0x2b')]){_0x4651c1[_0xe5e0('0x40')]=_[_0xe5e0('0x56')](_0x4651c1[_0xe5e0('0x40')],{'$or':_[_0xe5e0('0x2c')](_0x4651c1[_0xe5e0('0x45')],function(_0x46593d){var _0x4c94b5={};_0x4c94b5[_0x46593d]={'$like':'%'+_0x391d35['query'][_0xe5e0('0x2b')]+'%'};return _0x4c94b5;})});}_0x4651c1=_[_0xe5e0('0x56')]({},_0x4651c1,_0x391d35[_0xe5e0('0xcf')]);return _0x3c7e58[_0xe5e0('0xe6')](_0x4651c1);}})[_0xe5e0('0x20')](function(_0x189c69){if(_0x189c69){_0xa4f6cf=_0x189c69[_0xe5e0('0x4b')];if(!_0x391d35[_0xe5e0('0x42')][_0xe5e0('0xc1')](_0xe5e0('0xd1'))){_0x4651c1[_0xe5e0('0x1b')]=qs[_0xe5e0('0x1b')](_0x391d35['query']['limit']);_0x4651c1['offset']=qs[_0xe5e0('0x19')](_0x391d35[_0xe5e0('0x42')]['offset']);}return _0x3c7e58[_0xe5e0('0xe6')](_0x4651c1);}})['then'](function(_0x257283){if(_0x257283){return _0x257283?{'count':_0xa4f6cf,'rows':_0x257283}:null;}})[_0xe5e0('0x20')](respondWithResult(_0x129b43,null))[_0xe5e0('0x52')](handleError(_0x129b43,null));};exports[_0xe5e0('0xe8')]=function(_0xb8d02e,_0x29a292,_0x329447){var _0x13a928;var _0x53887b;var _0x1fad61;var _0xd814b=!_[_0xe5e0('0x65')](_0xb8d02e['params']['id'])?_0xb8d02e[_0xe5e0('0x54')]['id']:!_[_0xe5e0('0x65')](_0xb8d02e[_0xe5e0('0x27')]['id'])?_0xb8d02e[_0xe5e0('0x27')]['id']:null;return db['User'][_0xe5e0('0x2f')]({'where':{'id':_0xd814b,'role':{'$or':[_0xe5e0('0x25'),'user','agent']}},'attributes':['id',_0xe5e0('0x30'),_0xe5e0('0xe9'),_0xe5e0('0xea'),_0xe5e0('0x21'),'internal',_0xe5e0('0x94')]})[_0xe5e0('0x20')](function(_0x2b76bb){if(_0x2b76bb){if(_0x2b76bb[_0xe5e0('0x21')]==='agent'){_0x13a928=_0x2b76bb;if(_0xb8d02e[_0xe5e0('0x58')][_0xe5e0('0x95')]){_0x1fad61=util['format'](_0xe5e0('0xeb'),_0x13a928[_0xb8d02e[_0xe5e0('0x58')][_0xe5e0('0x95')]]);}else if(_0xb8d02e[_0xe5e0('0x58')][_0xe5e0('0xec')]){_0x1fad61=util[_0xe5e0('0xa1')](_0xe5e0('0xa2'),_0xb8d02e[_0xe5e0('0x58')]['intrf']);}else{_0x1fad61=util[_0xe5e0('0xa1')](_0xe5e0('0xa2'),_0x13a928[_0xe5e0('0x30')]);}socket['to'](util['format'](_0xe5e0('0xed'),_0x13a928[_0xe5e0('0x30')]))[_0xe5e0('0x9c')](_0xe5e0('0xee'),{'user':{'id':_0x13a928['id'],'name':_0x13a928[_0xe5e0('0x30')]},'ip':_0xb8d02e[_0xe5e0('0xef')][_0xe5e0('0xf0')]||_0xb8d02e[_0xe5e0('0xf1')][_0xe5e0('0xf2')]||_0xb8d02e['socket'][_0xe5e0('0xf2')]||_0xb8d02e['connection']['socket'][_0xe5e0('0xf2')]});return db['UserVoiceQueueRt'][_0xe5e0('0x23')]({'where':{'membername':_0x13a928[_0xe5e0('0x30')]},'individualHooks':!![]});}}else{throw new db[(_0xe5e0('0x89'))]['ValidationError'](_0xe5e0('0xf3'));}})[_0xe5e0('0x20')](function(){if(_0x13a928){return _0x13a928[_0xe5e0('0xf4')]({'raw':!![]});}})[_0xe5e0('0x20')](function(_0x14a7d3){if(_0x13a928){if(_0x14a7d3){_0x53887b=_0x14a7d3;if(_0x53887b[_0xe5e0('0x4b')]){var _0x4eeba2=_0x53887b[_0xe5e0('0x2c')](function(_0x2c6d1d){var _0x5a8b08={'membername':_0x13a928['name'],'UserId':_0x13a928['id'],'queue_name':_0x2c6d1d[_0xe5e0('0x30')],'VoiceQueueId':_0x2c6d1d['id'],'interface':_0x1fad61,'paused':_0x13a928['loginInPause']||![],'penalty':_0x2c6d1d[_0xe5e0('0xf5')]||0x0};return db[_0xe5e0('0xa4')][_0xe5e0('0xa5')](_0x5a8b08);});return Promise[_0xe5e0('0x82')](_0x4eeba2);}}}})[_0xe5e0('0x20')](function(){if(_0x13a928){return db[_0xe5e0('0xf6')]['findAll']({'where':{'membername':_0x13a928['name'],'exitAt':null}});}})[_0xe5e0('0x20')](function(_0x4b4702){if(_0x13a928){var _0x22109d=[];_0x4b4702['forEach'](function(_0x4a0245){_0x22109d['push'](_0x4a0245[_0xe5e0('0x1f')]({'exitAt':moment()['format'](_0xe5e0('0xf7'))}));});return Promise[_0xe5e0('0x82')](_0x22109d);}})[_0xe5e0('0x20')](function(){if(_0x13a928){var _0x315a9c=[];var _0x1a6ed7=[];var _0x105bed=utils[_0xe5e0('0xf8')]();var _0xd37748={'membername':_0x13a928[_0xe5e0('0x30')],'interface':_0x1fad61,'enterAt':moment()['format'](_0xe5e0('0xf7')),'role':_0x13a928[_0xe5e0('0x21')],'internal':_0x13a928[_0xe5e0('0x5c')]};_0x105bed[_0xe5e0('0xf9')](function(_0x18ea42){_0x315a9c['push'](_[_0xe5e0('0x56')]({'channel':_0x18ea42,'type':_0xe5e0('0xfa'),'data1':_0xb8d02e[_0xe5e0('0x58')][_0xe5e0('0xfb')],'data2':_0x1fad61},_0xd37748));if(_0x13a928['loginInPause']){_0x1a6ed7[_0xe5e0('0x46')](_[_0xe5e0('0x56')]({'channel':_0x18ea42,'type':_0xe5e0('0xfc'),'data1':'LOGININPAUSE'},_0xd37748));}});return db['MemberReport'][_0xe5e0('0x7f')](_0x315a9c['concat'](_0x1a6ed7),{'individualHooks':!![]});}})[_0xe5e0('0x20')](function(){if(_0x13a928){return _0x13a928[_0xe5e0('0x1f')]({'online':!![],'lastLoginAt':moment()[_0xe5e0('0xa1')](_0xe5e0('0xf7')),'voicePause':_0x13a928[_0xe5e0('0x94')]||![],'mailPause':_0x13a928['loginInPause']||![],'chatPause':_0x13a928[_0xe5e0('0x94')]||![],'faxPause':_0x13a928[_0xe5e0('0x94')]||![],'smsPause':_0x13a928['loginInPause']||![],'openchannelPause':_0x13a928[_0xe5e0('0x94')]||![],'whatsappPause':_0x13a928[_0xe5e0('0x94')]||![],'pauseType':_0x13a928[_0xe5e0('0x94')]?'LOGININPAUSE':null,'interface':_0x1fad61,'lastPauseAt':moment()[_0xe5e0('0xa1')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xe5e0('0x20')](function(_0x550e87){if(_0xb8d02e[_0xe5e0('0xfd')]){return _0x329447();}else{return Promise[_0xe5e0('0xfe')](_0x550e87)[_0xe5e0('0x20')](respondWithResult(_0x29a292,null));}})['catch'](handleError(_0x29a292,null));};exports[_0xe5e0('0xff')]=function(_0xdc58dc,_0xd8e7a8){var _0x1b85e0;return db['User'][_0xe5e0('0x2f')]({'where':{'id':_0xdc58dc[_0xe5e0('0x54')]['id'],'role':_0xe5e0('0x22')},'attributes':['id',_0xe5e0('0x30'),_0xe5e0('0x21')]})[_0xe5e0('0x20')](handleEntityNotFound(_0xd8e7a8,null))['then'](function(_0x118ef9){if(_0x118ef9){_0x1b85e0=_0x118ef9;return db[_0xe5e0('0xa4')][_0xe5e0('0x23')]({'where':{'membername':_0x1b85e0[_0xe5e0('0x30')]},'individualHooks':!![]});}})[_0xe5e0('0x20')](function(){return db[_0xe5e0('0xf6')][_0xe5e0('0x47')]({'where':{'membername':_0x1b85e0[_0xe5e0('0x30')],'exitAt':null}});})['then'](function(_0x5af67f){var _0x11c69e=[];_0x5af67f['forEach'](function(_0x59c019){_0x11c69e[_0xe5e0('0x46')](_0x59c019['update']({'exitAt':moment()[_0xe5e0('0xa1')](_0xe5e0('0xf7'))}));});return Promise[_0xe5e0('0x82')](_0x11c69e);})[_0xe5e0('0x20')](function(){return _0x1b85e0[_0xe5e0('0x1f')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xe5e0('0x20')](respondWithResult(_0xd8e7a8,null))['catch'](handleError(_0xd8e7a8,null));};exports['pause']=function(_0x2ea430,_0x28367f){var _0x4ed60d;return db[_0xe5e0('0xa4')]['update']({'paused':0x1},{'where':{'UserId':_0x2ea430[_0xe5e0('0x54')]['id']},'individualHooks':!![]})[_0xe5e0('0x20')](function(){return db[_0xe5e0('0x41')][_0xe5e0('0x2f')]({'where':{'id':_0x2ea430[_0xe5e0('0x54')]['id'],'role':_0xe5e0('0x22')},'attributes':['id',_0xe5e0('0x30'),_0xe5e0('0x21'),_0xe5e0('0x5c'),_0xe5e0('0x95'),'online']});})[_0xe5e0('0x20')](handleEntityNotFound(_0x28367f,null))[_0xe5e0('0x20')](function(_0x4d16f5){if(_0x4d16f5){_0x4ed60d=_0x4d16f5;return db[_0xe5e0('0xf6')][_0xe5e0('0x47')]({'where':{'membername':_0x4ed60d['name'],'type':_0xe5e0('0xfc'),'exitAt':null}});}})[_0xe5e0('0x20')](function(_0x79f0b2){if(_0x79f0b2[_0xe5e0('0x4b')]){var _0x3d9007=moment()[_0xe5e0('0xa1')](_0xe5e0('0xf7'));for(var _0x249a8c=0x0,_0x10ec5c=_0x79f0b2[_0xe5e0('0x4b')];_0x249a8c<_0x10ec5c;_0x249a8c++){_0x79f0b2[_0x249a8c]['updateAttributes']({'exitAt':_0x3d9007});}}})['then'](function(){var _0x456437=[];var _0x15c2f7=utils[_0xe5e0('0xf8')]();_0x15c2f7[_0xe5e0('0xf9')](function(_0x5a4df3){_0x456437[_0xe5e0('0x46')]({'channel':_0x5a4df3,'membername':_0x4ed60d[_0xe5e0('0x30')],'interface':_['isNil'](_0x4ed60d[_0xe5e0('0x95')])?util[_0xe5e0('0xa1')](_0xe5e0('0xa2'),_0x4ed60d[_0xe5e0('0x30')]):_0x4ed60d[_0xe5e0('0x95')],'type':_0xe5e0('0xfc'),'enterAt':moment()[_0xe5e0('0xa1')](_0xe5e0('0xf7')),'data1':_0x2ea430[_0xe5e0('0x58')]['type']||_0xe5e0('0x100'),'role':_0x4ed60d['role'],'internal':_0x4ed60d[_0xe5e0('0x5c')]});});return db['MemberReport'][_0xe5e0('0x7f')](_0x456437,{'individualHooks':!![]});})[_0xe5e0('0x20')](function(){return _0x4ed60d['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x2ea430[_0xe5e0('0x58')][_0xe5e0('0x37')]||_0xe5e0('0x100'),'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0xe5e0('0x20')](respondWithResult(_0x28367f,null))[_0xe5e0('0x52')](handleError(_0x28367f,null));};exports[_0xe5e0('0x101')]=function(_0x2e43e7,_0x200d9f){if(_0x2e43e7[_0xe5e0('0x58')][_0xe5e0('0x93')]&&!utils[_0xe5e0('0xc9')](_0x2e43e7[_0xe5e0('0x58')]['channel'])){throw new APIBadRequestError(util[_0xe5e0('0xa1')](_0xe5e0('0x102'),_0x2e43e7[_0xe5e0('0x58')][_0xe5e0('0x93')]));}return db[_0xe5e0('0x41')][_0xe5e0('0x2f')]({'where':{'id':_0x2e43e7['params']['id']},'attributes':['id','name',_0xe5e0('0x21'),_0xe5e0('0x5c'),_0xe5e0('0x95'),'online',_0xe5e0('0xa3'),_0xe5e0('0x103'),_0xe5e0('0x104'),_0xe5e0('0x105'),_0xe5e0('0x106'),_0xe5e0('0x107'),_0xe5e0('0x108'),_0xe5e0('0x109'),_0xe5e0('0x10a')]})[_0xe5e0('0x20')](function(_0x5d0c3e){if(!_0x5d0c3e){throw new APINotFoundError(util[_0xe5e0('0xa1')](_0xe5e0('0x10b'),_0x2e43e7['params']['id']));}return _0x5d0c3e[_0xe5e0('0x101')](_0x2e43e7['body'][_0xe5e0('0x93')]);})[_0xe5e0('0x20')](respondWithResult(_0x200d9f,null))[_0xe5e0('0x52')](APIHandleError(_0x200d9f));};exports['getTeams']=function(_0x41f470,_0x2dbe16){var _0xb9f0e1={};var _0x552a58={};var _0x3201eb;var _0x4b9ebe;return db[_0xe5e0('0x41')][_0xe5e0('0x8d')]({'where':{'id':_0x41f470[_0xe5e0('0x54')]['id']}})[_0xe5e0('0x20')](handleEntityNotFound(_0x2dbe16,null))['then'](function(_0x5beb14){if(_0x5beb14){_0x3201eb=_0x5beb14;_0x552a58['model']=_[_0xe5e0('0xcb')](db['Team'][_0xe5e0('0x35')]);_0x552a58[_0xe5e0('0x42')]=_['keys'](_0x41f470['query']);_0x552a58[_0xe5e0('0xd2')]=_[_0xe5e0('0xd3')](_0x552a58[_0xe5e0('0xca')],_0x552a58[_0xe5e0('0x42')]);_0xb9f0e1[_0xe5e0('0x45')]=_[_0xe5e0('0xd3')](_0x552a58[_0xe5e0('0xca')],qs['fields'](_0x41f470[_0xe5e0('0x42')][_0xe5e0('0xcc')]));_0xb9f0e1[_0xe5e0('0x45')]=_0xb9f0e1[_0xe5e0('0x45')][_0xe5e0('0x4b')]?_0xb9f0e1[_0xe5e0('0x45')]:_0x552a58['model'];_0xb9f0e1[_0xe5e0('0xcd')]=qs[_0xe5e0('0xce')](_0x41f470[_0xe5e0('0x42')][_0xe5e0('0xce')]);_0xb9f0e1[_0xe5e0('0x40')]=qs[_0xe5e0('0xd2')](_[_0xe5e0('0xd6')](_0x41f470[_0xe5e0('0x42')],_0x552a58[_0xe5e0('0xd2')]));if(_0x41f470[_0xe5e0('0x42')][_0xe5e0('0x2b')]){_0xb9f0e1[_0xe5e0('0x40')]=_[_0xe5e0('0x56')](_0xb9f0e1[_0xe5e0('0x40')],{'$or':_[_0xe5e0('0x2c')](_0xb9f0e1[_0xe5e0('0x45')],function(_0x2436a8){var _0x3844c3={};_0x3844c3[_0x2436a8]={'$like':'%'+_0x41f470['query'][_0xe5e0('0x2b')]+'%'};return _0x3844c3;})});}_0xb9f0e1=_[_0xe5e0('0x56')]({},_0xb9f0e1,_0x41f470['options']);return _0x3201eb[_0xe5e0('0x10c')](_0xb9f0e1);}})['then'](function(_0x15a634){if(_0x15a634){_0x4b9ebe=_0x15a634[_0xe5e0('0x4b')];if(!_0x41f470[_0xe5e0('0x42')][_0xe5e0('0xc1')](_0xe5e0('0xd1'))){_0xb9f0e1[_0xe5e0('0x1b')]=qs[_0xe5e0('0x1b')](_0x41f470['query'][_0xe5e0('0x1b')]);_0xb9f0e1[_0xe5e0('0x19')]=qs['offset'](_0x41f470['query']['offset']);}return _0x3201eb[_0xe5e0('0x10c')](_0xb9f0e1);}})['then'](function(_0x3f094a){if(_0x3f094a){return _0x3f094a?{'count':_0x4b9ebe,'rows':_0x3f094a}:null;}})[_0xe5e0('0x20')](respondWithResult(_0x2dbe16,null))[_0xe5e0('0x52')](handleError(_0x2dbe16,null));};exports[_0xe5e0('0x10d')]=function(_0x5a7295,_0x2c61cd){var _0x2dd02e=_0x5a7295['params']['id'];var _0x23b6aa=_0x5a7295[_0xe5e0('0x58')]?_0x5a7295[_0xe5e0('0x58')][_0xe5e0('0x5b')]:null;var _0x23ab0b=[];return Promise[_0xe5e0('0xfe')]()[_0xe5e0('0x20')](function(){if(!_0x23b6aa)throw new APIBadRequestError(_0xe5e0('0x10e'));})[_0xe5e0('0x20')](function(){return db[_0xe5e0('0x41')][_0xe5e0('0x8d')]({'where':{'id':_0x2dd02e}});})[_0xe5e0('0x20')](function(_0x3f1b54){if(!_0x3f1b54)throw new APINotFoundError(util[_0xe5e0('0xa1')]('User\x20with\x20id\x20%s\x20not\x20found',_0x5a7295[_0xe5e0('0x54')]['id']));return db[_0xe5e0('0x63')][_0xe5e0('0x10f')](function(_0x31058d){return _0x3f1b54[_0xe5e0('0x10d')](_0x23b6aa,{'transaction':_0x31058d})['then'](function(){return db[_0xe5e0('0x110')][_0xe5e0('0x47')]({'where':{'id':{'$in':_0x23b6aa}}});})[_0xe5e0('0x20')](function(_0x3cee5c){var _0x162b47=_['map'](_0x3cee5c,function(_0x5ce677){return _0x5ce677[_0xe5e0('0x111')]();});return Promise[_0xe5e0('0x82')](_0x162b47);})[_0xe5e0('0x20')](function(_0x45781e){_0x23ab0b=_['flattenDeep'](_0x45781e);var _0x205ba2=_[_0xe5e0('0x2c')](_0x23ab0b,function(_0x988267){return _0x988267['addAgent'](_0x3f1b54['id'],{'transaction':_0x31058d});});return Promise['all'](_0x205ba2);})[_0xe5e0('0x20')](function(){if(!_0x3f1b54['online'])return;var _0x22fd3d=_['filter'](_0x23ab0b,function(_0xee272f){return _0xee272f['getDataValue'](_0xe5e0('0x93'))===_0xe5e0('0x112');});var _0x3d5327=_[_0xe5e0('0x2c')](_0x22fd3d,function(_0x4317c7){return db['UserVoiceQueueRt']['upsert']({'membername':_0x3f1b54[_0xe5e0('0x30')],'UserId':_0x3f1b54['id'],'queue_name':_0x4317c7['name'],'VoiceQueueId':_0x4317c7['id'],'interface':_[_0xe5e0('0x65')](_0x3f1b54[_0xe5e0('0x95')])?util[_0xe5e0('0xa1')]('SIP/%s',_0x3f1b54[_0xe5e0('0x30')]):_0x3f1b54[_0xe5e0('0x95')],'paused':_0x3f1b54[_0xe5e0('0xa3')]||![],'penalty':_0x3f1b54[_0xe5e0('0x99')]},{'transaction':_0x31058d});});return Promise['all'](_0x3d5327);})[_0xe5e0('0x20')](function(){return db['TeamVoicePrefix'][_0xe5e0('0x47')]({'where':{'teamId':{'$in':_0x23b6aa}}});})[_0xe5e0('0x20')](function(_0x15207b){var _0x3ccef4=_['map'](_0x15207b,function(_0x360ca1){return db[_0xe5e0('0x113')][_0xe5e0('0x7b')]({'UserId':_0x3f1b54['id'],'VoicePrefixId':_0x360ca1[_0xe5e0('0x114')]},{'transaction':_0x31058d});});return Promise[_0xe5e0('0x82')](_0x3ccef4);});});})[_0xe5e0('0x20')](function(){for(var _0x2bfb0f=0x0;_0x2bfb0f<_0x23ab0b[_0xe5e0('0x4b')];_0x2bfb0f++){var _0x47be50=_0x23ab0b[_0x2bfb0f][_0xe5e0('0x115')]('channel');var _0x59ab01=_0x47be50+_0xe5e0('0x9b');socket[_0xe5e0('0x9c')]('user'+_0x47be50+_0xe5e0('0x9d'),{'UserId':_0x2dd02e,['queueField']:_0x23ab0b[_0x2bfb0f]['id']});}})['then'](respondWithStatusCode(_0x2c61cd,null))[_0xe5e0('0x52')](APIHandleError(_0x2c61cd));};exports[_0xe5e0('0x116')]=function(_0x372ec2,_0x5d879e){var _0x347797=_0x372ec2[_0xe5e0('0x54')]['id'];var _0x432057=null;if(_0x372ec2[_0xe5e0('0x42')][_0xe5e0('0x5b')]){_0x432057=_['isArray'](_0x372ec2[_0xe5e0('0x42')][_0xe5e0('0x5b')])?_0x372ec2[_0xe5e0('0x42')][_0xe5e0('0x5b')]:[_0x372ec2[_0xe5e0('0x42')][_0xe5e0('0x5b')]];}var _0x465b67=[];return Promise['resolve']()[_0xe5e0('0x20')](function(){if(!_0x432057)throw new APIBadRequestError(_0xe5e0('0x117'));})['then'](function(){return db[_0xe5e0('0x41')][_0xe5e0('0x8d')]({'where':{'id':_0x347797}});})[_0xe5e0('0x20')](function(_0x1ab710){if(!_0x1ab710)throw new APINotFoundError(util[_0xe5e0('0xa1')](_0xe5e0('0x10b'),_0x372ec2[_0xe5e0('0x54')]['id']));return db[_0xe5e0('0x63')]['transaction'](function(_0x2d8c47){return _0x1ab710['removeTeams'](_0x432057,{'transaction':_0x2d8c47})[_0xe5e0('0x20')](function(){return db[_0xe5e0('0x110')]['findAll']({'where':{'id':{'$in':_0x432057}}});})[_0xe5e0('0x20')](function(_0x20a0e4){var _0x30d7ca=_[_0xe5e0('0x2c')](_0x20a0e4,function(_0x105c14){return _0x105c14[_0xe5e0('0x111')]();});return Promise['all'](_0x30d7ca);})[_0xe5e0('0x20')](function(_0x1257b5){_0x465b67=_[_0xe5e0('0x118')](_0x1257b5);var _0x1ea6ce=_[_0xe5e0('0x2c')](_0x465b67,function(_0x3cc3cd){return _0x3cc3cd[_0xe5e0('0x119')](_0x1ab710['id'],{'transaction':_0x2d8c47});});return Promise[_0xe5e0('0x82')](_0x1ea6ce);})[_0xe5e0('0x20')](function(){if(!_0x1ab710[_0xe5e0('0xa0')])return;var _0x5b7c5a=_[_0xe5e0('0x2b')](_0x465b67,function(_0x38991e){return _0x38991e['getDataValue'](_0xe5e0('0x93'))===_0xe5e0('0x112');});var _0x5d9b9e=_[_0xe5e0('0x2c')](_0x5b7c5a,function(_0xfa4d92){return db[_0xe5e0('0xa4')][_0xe5e0('0x23')]({'where':{'VoiceQueueId':_0xfa4d92['id'],'UserId':_0x1ab710['id']},'transaction':_0x2d8c47});});return Promise[_0xe5e0('0x82')](_0x5d9b9e);})[_0xe5e0('0x20')](function(){return db[_0xe5e0('0x11a')][_0xe5e0('0x47')]({'where':{'teamId':{'$in':_0x432057}}});})['then'](function(_0x39d560){var _0x8269b3=_[_0xe5e0('0x2c')](_0x39d560,function(_0x3dbfcc){return db[_0xe5e0('0x113')][_0xe5e0('0x23')]({'where':{'UserId':_0x1ab710['id'],'VoicePrefixId':_0x3dbfcc[_0xe5e0('0x114')]}},{'transaction':_0x2d8c47});});return Promise[_0xe5e0('0x82')](_0x8269b3);});});})[_0xe5e0('0x20')](function(){for(var _0x253ffb=0x0;_0x253ffb<_0x465b67[_0xe5e0('0x4b')];_0x253ffb++){var _0x28e06d=_0x465b67[_0x253ffb][_0xe5e0('0x115')](_0xe5e0('0x93'));var _0x2f29c0=_0x28e06d+_0xe5e0('0x9b');socket['emit'](_0xe5e0('0x27')+_0x28e06d+_0xe5e0('0xa8'),{'UserId':_0x347797,['queueField']:_0x465b67[_0x253ffb]['id']});}})['then'](respondWithStatusCode(_0x5d879e,null))[_0xe5e0('0x52')](APIHandleError(_0x5d879e));};exports[_0xe5e0('0x11b')]=function(_0x32ccd9,_0x18d50a){var _0x567448={};var _0x100774={};var _0x2a9613;var _0x4a5ef1;return db[_0xe5e0('0x41')][_0xe5e0('0x8d')]({'where':{'id':_0x32ccd9['params']['id']}})['then'](handleEntityNotFound(_0x18d50a,null))[_0xe5e0('0x20')](function(_0xd26443){if(_0xd26443){_0x2a9613=_0xd26443;_0x100774[_0xe5e0('0xca')]=_[_0xe5e0('0xcb')](db['CmList']['rawAttributes']);_0x100774[_0xe5e0('0x42')]=_[_0xe5e0('0xcb')](_0x32ccd9['query']);_0x100774[_0xe5e0('0xd2')]=_[_0xe5e0('0xd3')](_0x100774[_0xe5e0('0xca')],_0x100774['query']);_0x567448[_0xe5e0('0x45')]=_[_0xe5e0('0xd3')](_0x100774[_0xe5e0('0xca')],qs[_0xe5e0('0xcc')](_0x32ccd9[_0xe5e0('0x42')][_0xe5e0('0xcc')]));_0x567448[_0xe5e0('0x45')]=_0x567448[_0xe5e0('0x45')][_0xe5e0('0x4b')]?_0x567448[_0xe5e0('0x45')]:_0x100774[_0xe5e0('0xca')];_0x567448['order']=qs[_0xe5e0('0xce')](_0x32ccd9[_0xe5e0('0x42')][_0xe5e0('0xce')]);_0x567448[_0xe5e0('0x40')]=qs[_0xe5e0('0xd2')](_[_0xe5e0('0xd6')](_0x32ccd9[_0xe5e0('0x42')],_0x100774[_0xe5e0('0xd2')]));if(_0x32ccd9[_0xe5e0('0x42')][_0xe5e0('0x2b')]){_0x567448[_0xe5e0('0x40')]=_[_0xe5e0('0x56')](_0x567448[_0xe5e0('0x40')],{'$or':_['map'](_0x567448[_0xe5e0('0x45')],function(_0x5cdf84){var _0xfa3998={};_0xfa3998[_0x5cdf84]={'$like':'%'+_0x32ccd9['query'][_0xe5e0('0x2b')]+'%'};return _0xfa3998;})});}_0x567448=_[_0xe5e0('0x56')]({},_0x567448,_0x32ccd9['options']);return _0x2a9613[_0xe5e0('0x11b')](_0x567448);}})[_0xe5e0('0x20')](function(_0x1bf756){if(_0x1bf756){_0x4a5ef1=_0x1bf756['length'];if(!_0x32ccd9['query'][_0xe5e0('0xc1')](_0xe5e0('0xd1'))){_0x567448[_0xe5e0('0x1b')]=qs[_0xe5e0('0x1b')](_0x32ccd9[_0xe5e0('0x42')][_0xe5e0('0x1b')]);_0x567448[_0xe5e0('0x19')]=qs[_0xe5e0('0x19')](_0x32ccd9['query']['offset']);}return _0x2a9613[_0xe5e0('0x11b')](_0x567448);}})['then'](function(_0x390b22){if(_0x390b22){return _0x390b22?{'count':_0x4a5ef1,'rows':_0x390b22}:null;}})[_0xe5e0('0x20')](respondWithResult(_0x18d50a,null))[_0xe5e0('0x52')](handleError(_0x18d50a,null));};exports[_0xe5e0('0x11c')]=function(_0x5c55ab,_0x156505){var _0x4038d9={};var _0x188b57={};var _0x597d25;return db[_0xe5e0('0x41')][_0xe5e0('0x8d')]({'where':{'id':_0x5c55ab[_0xe5e0('0x54')]['id']}})[_0xe5e0('0x20')](handleEntityNotFound(_0x156505,null))[_0xe5e0('0x20')](function(_0x41957e){if(_0x41957e){_0x597d25=_0x41957e;_0x188b57[_0xe5e0('0xca')]=_[_0xe5e0('0xcb')](db[_0xe5e0('0x41')][_0xe5e0('0x35')]);_0x188b57['query']=_[_0xe5e0('0xcb')](_0x5c55ab[_0xe5e0('0x42')]);_0x188b57['filters']=_[_0xe5e0('0xd3')](_0x188b57[_0xe5e0('0xca')],_0x188b57[_0xe5e0('0x42')]);_0x4038d9['attributes']=_[_0xe5e0('0xd3')](_0x188b57['model'],qs[_0xe5e0('0xcc')](_0x5c55ab[_0xe5e0('0x42')]['fields']));_0x4038d9[_0xe5e0('0x45')]=_0x4038d9[_0xe5e0('0x45')]['length']?_0x4038d9['attributes']:_0x188b57[_0xe5e0('0xca')];_0x4038d9['order']=qs[_0xe5e0('0xce')](_0x5c55ab[_0xe5e0('0x42')][_0xe5e0('0xce')]);_0x4038d9['where']=qs[_0xe5e0('0xd2')](_[_0xe5e0('0xd6')](_0x5c55ab['query'],_0x188b57['filters']));if(_0x5c55ab[_0xe5e0('0x42')][_0xe5e0('0x2b')]){_0x4038d9[_0xe5e0('0x40')]=_[_0xe5e0('0x56')](_0x4038d9[_0xe5e0('0x40')],{'$or':_['map'](_0x4038d9[_0xe5e0('0x45')],function(_0x25fdbf){var _0x5cf82f={};_0x5cf82f[_0x25fdbf]={'$like':'%'+_0x5c55ab['query']['filter']+'%'};return _0x5cf82f;})});}_0x4038d9['model']=db['User'];_0x4038d9['as']=_0xe5e0('0x28');_0x4038d9=_[_0xe5e0('0x56')]({},_0x4038d9,_0x5c55ab[_0xe5e0('0xcf')]);return _0x597d25[_0xe5e0('0xf4')]({'include':[_0x4038d9]});}})['then'](function(_0xda1de1){if(_0xda1de1){var _0x24c8c1={},_0x5a38b3=[];for(var _0x21c0ca=0x0;_0x21c0ca<_0xda1de1[_0xe5e0('0x4b')];_0x21c0ca+=0x1){for(var _0x988b6c=0x0,_0x55765f;_0x988b6c<_0xda1de1[_0x21c0ca]['Agents'][_0xe5e0('0x4b')];_0x988b6c+=0x1){_0x55765f=_0xda1de1[_0x21c0ca][_0xe5e0('0x28')][_0x988b6c][_0xe5e0('0x24')]({'plain':!![]});_0x24c8c1[_0x55765f['id']]=_0x55765f;}}_0x24c8c1=_['values'](_0x24c8c1);for(var _0xd97c02=qs[_0xe5e0('0x19')](_0x5c55ab[_0xe5e0('0x42')][_0xe5e0('0x19')]);_0xd97c02<_0x24c8c1[_0xe5e0('0x4b')]&&_0x5a38b3['length']=_0x3594ec[_0x5ac6('0x4c')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x5ac6('0x16')](function(){if(_0x30f541){return db[_0x5ac6('0x26')]['destroy']({'where':{'membername':_0x30f541[_0x5ac6('0x21')]},'individualHooks':!![]});}})[_0x5ac6('0x16')](function(){if(_0x30f541){return _0x30f541[_0x5ac6('0x4d')]({'raw':!![]});}})[_0x5ac6('0x16')](function(_0x3bd02b){if(_0x30f541){if(_0x3bd02b){var _0xbeb0b8=[];_0x353973=_0x3bd02b;if(_0x353973['length']){for(var _0x2f0c0b=0x0;_0x2f0c0b<_0x353973[_0x5ac6('0x29')];_0x2f0c0b++){_0xbeb0b8[_0x5ac6('0x45')](db[_0x5ac6('0x26')]['upsert']({'membername':_0x30f541[_0x5ac6('0x21')],'UserId':_0x30f541['id'],'queue_name':_0x353973[_0x2f0c0b]['name'],'VoiceQueueId':_0x353973[_0x2f0c0b]['id'],'interface':_0x371f94,'paused':_0x30f541[_0x5ac6('0x4e')]||![],'penalty':_0x353973[_0x2f0c0b][_0x5ac6('0x4f')]||0x0}));}return BPromise[_0x5ac6('0x46')](_0xbeb0b8);}}}})[_0x5ac6('0x16')](function(){if(_0x30f541){return db[_0x5ac6('0x27')][_0x5ac6('0x28')]({'where':{'membername':_0x30f541[_0x5ac6('0x21')],'exitAt':null}});}})['then'](function(_0x5bb627){if(_0x30f541){if(_0x5bb627&&_0x5bb627['length']){var _0x132f78=[];_0x5bb627[_0x5ac6('0x44')](function(_0x573877){_0x132f78[_0x5ac6('0x45')](_0x573877[_0x5ac6('0x33')]({'exitAt':moment()[_0x5ac6('0x24')](_0x5ac6('0x2a'))}));});return BPromise[_0x5ac6('0x46')](_0x132f78);}}})[_0x5ac6('0x16')](function(){if(_0x30f541){var _0x2dde41=[];var _0x17593a=[];var _0x566530=utils[_0x5ac6('0x2c')]();var _0x239ff7={'membername':_0x30f541[_0x5ac6('0x21')],'interface':_0x371f94,'enterAt':moment()[_0x5ac6('0x24')](_0x5ac6('0x2a')),'role':_0x30f541[_0x5ac6('0x22')],'internal':_0x30f541[_0x5ac6('0x31')]};_0x566530[_0x5ac6('0x44')](function(_0x53fba4){_0x2dde41[_0x5ac6('0x45')](_[_0x5ac6('0x50')]({'channel':_0x53fba4,'type':_0x5ac6('0x51'),'data1':_0x5ac6('0x52'),'data2':_0x371f94},_0x239ff7));if(_0x30f541[_0x5ac6('0x4e')]){_0x17593a[_0x5ac6('0x45')](_[_0x5ac6('0x50')]({'channel':_0x53fba4,'type':'PAUSE','data1':_0x5ac6('0x53')},_0x239ff7));}});return db[_0x5ac6('0x27')]['bulkCreate'](_0x2dde41['concat'](_0x17593a),{'individualHooks':!![]});}})[_0x5ac6('0x16')](function(){if(_0x30f541){return _0x30f541[_0x5ac6('0x33')]({'online':!![],'lastLoginAt':moment()[_0x5ac6('0x24')](_0x5ac6('0x2a')),'voicePause':_0x30f541[_0x5ac6('0x4e')]||![],'mailPause':_0x30f541['loginInPause']||![],'chatPause':_0x30f541['loginInPause']||![],'faxPause':_0x30f541[_0x5ac6('0x4e')]||![],'smsPause':_0x30f541[_0x5ac6('0x4e')]||![],'openchannelPause':_0x30f541[_0x5ac6('0x4e')]||![],'pauseType':_0x30f541['loginInPause']?_0x5ac6('0x53'):null,'lastPauseAt':moment()[_0x5ac6('0x24')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x371f94});}})[_0x5ac6('0x16')](function(_0x44592f){_0x5c6075(_0x44592f);})[_0x5ac6('0x19')](function(_0xb48643){_0x569610(_0x5b63bf[_0x5ac6('0x1a')](0x1f4,_0xb48643[_0x5ac6('0x1b')]));});});}; \ No newline at end of file +var _0x128f=['rpc','../../config/environment','defaults','localhost','socket.io-emitter','./user.socket','register','GetUser','User','findAll','options','raw','where','attributes','limit','map','include','model','info','debug','catch','message','error','find','ShowUser','stringify','PauseUser','name','role','internal','interface','then','format','User\x20with\x20id\x20%s\x20not\x20found','params','update','MemberReport','PAUSE','length','YYYY-MM-DD\x20HH:mm:ss','getChannels','forEach','isNil','body','type','uniqueid','bulkCreate','resolve','channel','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','findOne','online','voicePause','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsappPause','pauseType','unpause','system','LogoutUser','UserVoiceQueueRt','destroy','all','mobile','phone','loginInPause','SIP/%s','count','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','push','upsert','UserVoiceQueue.penalty','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash','util','moment','bluebird','../../mysqldb','../../config/logger'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x128f,0xb0));var _0xf128=function(_0x14627c,_0x3051de){_0x14627c=_0x14627c-0x0;var _0x4e2e4c=_0x128f[_0x14627c];return _0x4e2e4c;};'use strict';var _=require(_0xf128('0x0'));var util=require(_0xf128('0x1'));var moment=require(_0xf128('0x2'));var BPromise=require(_0xf128('0x3'));var Redis=require('ioredis');var db=require(_0xf128('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf128('0x5'))(_0xf128('0x6'));var config=require(_0xf128('0x7'));config['redis']=_[_0xf128('0x8')](config['redis'],{'host':_0xf128('0x9'),'port':0x18eb});var socket=require(_0xf128('0xa'))(new Redis(config['redis']));require(_0xf128('0xb'))[_0xf128('0xc')](socket);exports[_0xf128('0xd')]=function(_0x2d43bf){var _0x5b9ca2=this;return new Promise(function(_0x56a0a5,_0x42b1b3){return db[_0xf128('0xe')][_0xf128('0xf')]({'raw':_0x2d43bf[_0xf128('0x10')]?_0x2d43bf[_0xf128('0x10')][_0xf128('0x11')]===undefined?!![]:![]:!![],'where':_0x2d43bf['options']?_0x2d43bf['options'][_0xf128('0x12')]||null:null,'attributes':_0x2d43bf[_0xf128('0x10')]?_0x2d43bf[_0xf128('0x10')][_0xf128('0x13')]||null:null,'limit':_0x2d43bf[_0xf128('0x10')]?_0x2d43bf[_0xf128('0x10')][_0xf128('0x14')]||null:null,'include':_0x2d43bf[_0xf128('0x10')]?_0x2d43bf[_0xf128('0x10')]['include']?_[_0xf128('0x15')](_0x2d43bf[_0xf128('0x10')][_0xf128('0x16')],function(_0x3dea4d){return{'model':db[_0x3dea4d[_0xf128('0x17')]],'as':_0x3dea4d['as'],'attributes':_0x3dea4d['attributes'],'include':_0x3dea4d[_0xf128('0x16')]?_['map'](_0x3dea4d[_0xf128('0x16')],function(_0x579f5e){return{'model':db[_0x579f5e['model']],'as':_0x579f5e['as'],'attributes':_0x579f5e[_0xf128('0x13')],'include':_0x579f5e[_0xf128('0x16')]?_[_0xf128('0x15')](_0x579f5e[_0xf128('0x16')],function(_0x23c252){return{'model':db[_0x23c252[_0xf128('0x17')]],'as':_0x23c252['as'],'attributes':_0x23c252[_0xf128('0x13')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x54d2b0){logger[_0xf128('0x18')]('GetUser',_0x2d43bf);logger[_0xf128('0x19')](_0xf128('0xd'),_0x2d43bf,JSON['stringify'](_0x54d2b0));_0x56a0a5(_0x54d2b0);})[_0xf128('0x1a')](function(_0x5143d8){logger['error'](_0xf128('0xd'),_0x5143d8[_0xf128('0x1b')],_0x2d43bf);_0x42b1b3(_0x5b9ca2[_0xf128('0x1c')](0x1f4,_0x5143d8[_0xf128('0x1b')]));});});};exports['ShowUser']=function(_0x5ac378){var _0x19758e=this;return new Promise(function(_0x4b7f4c,_0xe48ede){return db[_0xf128('0xe')][_0xf128('0x1d')]({'raw':_0x5ac378[_0xf128('0x10')]?_0x5ac378[_0xf128('0x10')][_0xf128('0x11')]===undefined?!![]:![]:!![],'where':_0x5ac378['options']?_0x5ac378[_0xf128('0x10')][_0xf128('0x12')]||null:null,'attributes':_0x5ac378['options']?_0x5ac378[_0xf128('0x10')][_0xf128('0x13')]||null:null,'include':_0x5ac378[_0xf128('0x10')]?_0x5ac378['options'][_0xf128('0x16')]?_['map'](_0x5ac378[_0xf128('0x10')]['include'],function(_0xb281e7){return{'model':db[_0xb281e7[_0xf128('0x17')]],'as':_0xb281e7['as'],'attributes':_0xb281e7['attributes'],'include':_0xb281e7[_0xf128('0x16')]?_[_0xf128('0x15')](_0xb281e7[_0xf128('0x16')],function(_0x4b022f){return{'model':db[_0x4b022f[_0xf128('0x17')]],'as':_0x4b022f['as'],'attributes':_0x4b022f[_0xf128('0x13')],'include':_0x4b022f[_0xf128('0x16')]?_[_0xf128('0x15')](_0x4b022f['include'],function(_0xab74bd){return{'model':db[_0xab74bd['model']],'as':_0xab74bd['as'],'attributes':_0xab74bd['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x110030){logger[_0xf128('0x18')](_0xf128('0x1e'),_0x5ac378);logger[_0xf128('0x19')](_0xf128('0x1e'),_0x5ac378,JSON[_0xf128('0x1f')](_0x110030));_0x4b7f4c(_0x110030);})[_0xf128('0x1a')](function(_0x3ba371){logger[_0xf128('0x1c')]('ShowUser',_0x3ba371[_0xf128('0x1b')],_0x5ac378);_0xe48ede(_0x19758e[_0xf128('0x1c')](0x1f4,_0x3ba371[_0xf128('0x1b')]));});});};exports[_0xf128('0x20')]=function(_0x4eab37){var _0x5d0b44;return db[_0xf128('0xe')][_0xf128('0x1d')]({'where':_0x4eab37[_0xf128('0x10')]['where']||{},'attributes':['id',_0xf128('0x21'),_0xf128('0x22'),_0xf128('0x23'),_0xf128('0x24')]})[_0xf128('0x25')](function(_0x265e7d){if(!_0x265e7d){throw new Error(util[_0xf128('0x26')](_0xf128('0x27'),_0x4eab37[_0xf128('0x28')]['id']));}_0x5d0b44=_0x265e7d;return db['UserVoiceQueueRt'][_0xf128('0x29')]({'paused':0x1},{'where':{'UserId':_0x5d0b44['id']},'individualHooks':!![]});})['then'](function(){return db[_0xf128('0x2a')][_0xf128('0xf')]({'where':{'membername':_0x5d0b44[_0xf128('0x21')],'type':_0xf128('0x2b'),'exitAt':null}});})[_0xf128('0x25')](function(_0x434bb7){if(_0x434bb7&&_0x434bb7[_0xf128('0x2c')]){var _0x9bfcf0=moment()[_0xf128('0x26')](_0xf128('0x2d'));for(var _0x56126a=0x0,_0x438055=_0x434bb7['length'];_0x56126a<_0x438055;_0x56126a++){_0x434bb7[_0x56126a]['updateAttributes']({'exitAt':_0x9bfcf0});}}})[_0xf128('0x25')](function(){var _0x590ba1=[];var _0x581782=utils[_0xf128('0x2e')]();_0x581782[_0xf128('0x2f')](function(_0x4a5d56){_0x590ba1['push']({'channel':_0x4a5d56,'membername':_0x5d0b44[_0xf128('0x21')],'interface':_[_0xf128('0x30')](_0x5d0b44[_0xf128('0x24')])?util['format']('SIP/%s',_0x5d0b44[_0xf128('0x21')]):_0x5d0b44[_0xf128('0x24')],'type':_0xf128('0x2b'),'enterAt':moment()[_0xf128('0x26')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x4eab37[_0xf128('0x31')][_0xf128('0x32')]||'DEFAULT\x20PAUSE','role':_0x5d0b44[_0xf128('0x22')],'internal':_0x5d0b44[_0xf128('0x23')],'uniqueid':_0x4eab37[_0xf128('0x31')][_0xf128('0x33')]||null});});return db[_0xf128('0x2a')][_0xf128('0x34')](_0x590ba1,{'individualHooks':!![]});})[_0xf128('0x25')](function(){return _0x5d0b44[_0xf128('0x29')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x4eab37[_0xf128('0x31')][_0xf128('0x32')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0xf128('0x26')](_0xf128('0x2d'))});})[_0xf128('0x1a')](function(_0x50f2b9){throw _0x50f2b9;});};exports['UnpauseUser']=function(_0x203826){return Promise[_0xf128('0x35')]()[_0xf128('0x25')](function(){if(_0x203826[_0xf128('0x31')][_0xf128('0x36')]&&!utils[_0xf128('0x37')](_0x203826[_0xf128('0x31')][_0xf128('0x36')])){throw new Error(util[_0xf128('0x26')](_0xf128('0x38'),_0x203826[_0xf128('0x31')][_0xf128('0x36')]));}return db[_0xf128('0xe')][_0xf128('0x39')]({'where':_0x203826[_0xf128('0x10')][_0xf128('0x12')]||{},'attributes':['id',_0xf128('0x21'),_0xf128('0x22'),_0xf128('0x23'),_0xf128('0x24'),_0xf128('0x3a'),_0xf128('0x3b'),_0xf128('0x3c'),_0xf128('0x3d'),_0xf128('0x3e'),_0xf128('0x3f'),_0xf128('0x40'),_0xf128('0x41'),_0xf128('0x42'),'lastPauseAt']});})['then'](function(_0x5e92e0){if(!_0x5e92e0){throw new Error(util['format'](_0xf128('0x27'),_0x203826['params']['id']));}return _0x5e92e0[_0xf128('0x43')](_0x203826[_0xf128('0x31')][_0xf128('0x36')],_0xf128('0x44'));})['catch'](function(_0x352aad){throw _0x352aad;});};exports[_0xf128('0x45')]=function(_0x4b1987){var _0x466bb6=this;return new Promise(function(_0x1725d4,_0x24e626){var _0xa9f522;return db[_0xf128('0xe')][_0xf128('0x39')]({'where':_0x4b1987[_0xf128('0x10')][_0xf128('0x12')]||{},'attributes':['id',_0xf128('0x21')]})['then'](function(_0x2f793a){if(_0x2f793a){_0xa9f522=_0x2f793a;return db[_0xf128('0x46')][_0xf128('0x47')]({'where':{'membername':_0xa9f522[_0xf128('0x21')]},'individualHooks':!![]});}})[_0xf128('0x25')](function(){if(_0xa9f522){return db[_0xf128('0x2a')][_0xf128('0xf')]({'where':{'membername':_0xa9f522[_0xf128('0x21')],'exitAt':null}});}})[_0xf128('0x25')](function(_0x33d5b9){if(_0xa9f522){if(_0x33d5b9&&_0x33d5b9[_0xf128('0x2c')]){var _0x1bf89a=[];_0x33d5b9[_0xf128('0x2f')](function(_0x3c781d){_0x1bf89a['push'](_0x3c781d[_0xf128('0x29')]({'exitAt':moment()['format'](_0xf128('0x2d'))}));});return BPromise[_0xf128('0x48')](_0x1bf89a);}}})[_0xf128('0x25')](function(){if(_0xa9f522){return _0xa9f522[_0xf128('0x29')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x9c1381){_0x1725d4(_0x9c1381);})[_0xf128('0x1a')](function(_0x3749e6){_0x24e626(_0x466bb6[_0xf128('0x1c')](0x1f4,_0x3749e6['message']));});});};exports['LoginUser']=function(_0x583e78){var _0x3370be=this;return new Promise(function(_0x3d20a1,_0x17b1a3){var _0xac2d24;var _0x513b33;var _0x51edd3;var _0x176305;return db[_0xf128('0xe')]['findOne']({'where':_0x583e78['options'][_0xf128('0x12')]||{},'attributes':['id','name',_0xf128('0x22'),_0xf128('0x49'),_0xf128('0x4a'),_0xf128('0x23'),_0xf128('0x4b'),_0xf128('0x24')]})[_0xf128('0x25')](function(_0x40de15){if(_0x40de15){_0xac2d24=_0x40de15;_0x176305=_0x583e78[_0xf128('0x31')][_0xf128('0x24')]?_0x583e78['body'][_0xf128('0x24')]:util[_0xf128('0x26')](_0xf128('0x4c'),_0xac2d24[_0xf128('0x21')]);return db[_0xf128('0xe')][_0xf128('0x4d')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0xac2d24['id']}}});}})[_0xf128('0x25')](function(_0x556e6f){if(_0x556e6f){_0x51edd3=_0x556e6f;return require(_0xf128('0x4e'))[_0xf128('0x4f')]();}})[_0xf128('0x25')](function(_0x154d8a){if(_0x154d8a&&_0x154d8a['agents']&&_0x51edd3>=_0x154d8a[_0xf128('0x50')]){throw new Error(_0xf128('0x51'));}})[_0xf128('0x25')](function(){if(_0xac2d24){return db['UserVoiceQueueRt'][_0xf128('0x47')]({'where':{'membername':_0xac2d24['name']},'individualHooks':!![]});}})[_0xf128('0x25')](function(){if(_0xac2d24){return _0xac2d24[_0xf128('0x52')]({'raw':!![]});}})[_0xf128('0x25')](function(_0x410410){if(_0xac2d24){if(_0x410410){var _0x3a062b=[];_0x513b33=_0x410410;if(_0x513b33[_0xf128('0x2c')]){for(var _0x5ef826=0x0;_0x5ef826<_0x513b33[_0xf128('0x2c')];_0x5ef826++){_0x3a062b[_0xf128('0x53')](db[_0xf128('0x46')][_0xf128('0x54')]({'membername':_0xac2d24[_0xf128('0x21')],'UserId':_0xac2d24['id'],'queue_name':_0x513b33[_0x5ef826][_0xf128('0x21')],'VoiceQueueId':_0x513b33[_0x5ef826]['id'],'interface':_0x176305,'paused':_0xac2d24[_0xf128('0x4b')]||![],'penalty':_0x513b33[_0x5ef826][_0xf128('0x55')]||0x0}));}return BPromise[_0xf128('0x48')](_0x3a062b);}}}})[_0xf128('0x25')](function(){if(_0xac2d24){return db[_0xf128('0x2a')][_0xf128('0xf')]({'where':{'membername':_0xac2d24['name'],'exitAt':null}});}})[_0xf128('0x25')](function(_0x35ab4a){if(_0xac2d24){if(_0x35ab4a&&_0x35ab4a[_0xf128('0x2c')]){var _0x13cc7e=[];_0x35ab4a[_0xf128('0x2f')](function(_0x5a5cdf){_0x13cc7e[_0xf128('0x53')](_0x5a5cdf[_0xf128('0x29')]({'exitAt':moment()[_0xf128('0x26')](_0xf128('0x2d'))}));});return BPromise[_0xf128('0x48')](_0x13cc7e);}}})[_0xf128('0x25')](function(){if(_0xac2d24){var _0x216b9a=[];var _0x3c406a=[];var _0x4f0da9=utils[_0xf128('0x2e')]();var _0xb4200c={'membername':_0xac2d24['name'],'interface':_0x176305,'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':_0xac2d24['role'],'internal':_0xac2d24['internal']};_0x4f0da9[_0xf128('0x2f')](function(_0x2c3d99){_0x216b9a[_0xf128('0x53')](_[_0xf128('0x56')]({'channel':_0x2c3d99,'type':_0xf128('0x57'),'data1':_0xf128('0x58'),'data2':_0x176305},_0xb4200c));if(_0xac2d24[_0xf128('0x4b')]){_0x3c406a[_0xf128('0x53')](_[_0xf128('0x56')]({'channel':_0x2c3d99,'type':_0xf128('0x2b'),'data1':_0xf128('0x59')},_0xb4200c));}});return db[_0xf128('0x2a')]['bulkCreate'](_0x216b9a[_0xf128('0x5a')](_0x3c406a),{'individualHooks':!![]});}})[_0xf128('0x25')](function(){if(_0xac2d24){return _0xac2d24[_0xf128('0x29')]({'online':!![],'lastLoginAt':moment()['format'](_0xf128('0x2d')),'voicePause':_0xac2d24[_0xf128('0x4b')]||![],'mailPause':_0xac2d24[_0xf128('0x4b')]||![],'chatPause':_0xac2d24[_0xf128('0x4b')]||![],'faxPause':_0xac2d24['loginInPause']||![],'smsPause':_0xac2d24[_0xf128('0x4b')]||![],'openchannelPause':_0xac2d24[_0xf128('0x4b')]||![],'pauseType':_0xac2d24['loginInPause']?_0xf128('0x59'):null,'lastPauseAt':moment()[_0xf128('0x26')](_0xf128('0x2d')),'interface':_0x176305});}})['then'](function(_0x134b21){_0x3d20a1(_0x134b21);})[_0xf128('0x1a')](function(_0x5e3130){_0x17b1a3(_0x3370be[_0xf128('0x1c')](0x1f4,_0x5e3130[_0xf128('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 57de207..8019b4b 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 _0x4e27=['removeListener','register','length','./user.events','remove','update','emit'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0x4e27,0x137));var _0x74e2=function(_0xf44189,_0x3f82e1){_0xf44189=_0xf44189-0x0;var _0xeb928=_0x4e27[_0xf44189];return _0xeb928;};'use strict';var UserEvents=require(_0x74e2('0x0'));var events=['save',_0x74e2('0x1'),_0x74e2('0x2')];function createListener(_0x143756,_0x2fad30){return function(_0x4818d3){_0x2fad30[_0x74e2('0x3')](_0x143756,_0x4818d3);};}function removeListener(_0x26900b,_0x31340b){return function(){UserEvents[_0x74e2('0x4')](_0x26900b,_0x31340b);};}exports[_0x74e2('0x5')]=function(_0x457515){for(var _0x1947c6=0x0,_0xac9c84=events[_0x74e2('0x6')];_0x1947c6<_0xac9c84;_0x1947c6++){var _0x3bd68f=events[_0x1947c6];var _0x3fb4fb=createListener('user:'+_0x3bd68f,_0x457515);UserEvents['on'](_0x3bd68f,_0x3fb4fb);}}; \ No newline at end of file +var _0x5445=['removeListener','register','length','user:','./user.events','save','emit'];(function(_0x1ccbe8,_0x4de4ac){var _0x3418e5=function(_0x1057fb){while(--_0x1057fb){_0x1ccbe8['push'](_0x1ccbe8['shift']());}};_0x3418e5(++_0x4de4ac);}(_0x5445,0xd6));var _0x5544=function(_0x3f5290,_0x53c67c){_0x3f5290=_0x3f5290-0x0;var _0x8a452d=_0x5445[_0x3f5290];return _0x8a452d;};'use strict';var UserEvents=require(_0x5544('0x0'));var events=[_0x5544('0x1'),'remove','update'];function createListener(_0x2ca63b,_0x79c122){return function(_0x703db4){_0x79c122[_0x5544('0x2')](_0x2ca63b,_0x703db4);};}function removeListener(_0x529994,_0x406ceb){return function(){UserEvents[_0x5544('0x3')](_0x529994,_0x406ceb);};}exports[_0x5544('0x4')]=function(_0x4d9d35){for(var _0x5b2a8f=0x0,_0x1b44f5=events[_0x5544('0x5')];_0x5b2a8f<_0x1b44f5;_0x5b2a8f++){var _0x219385=events[_0x5b2a8f];var _0x2aa458=createListener(_0x5544('0x6')+_0x219385,_0x4d9d35);UserEvents['on'](_0x219385,_0x2aa458);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 2ce96e3..6172d09 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x5c4697,_0x4d1f8d){var _0xebb281=function(_0x1f0e43){while(--_0x1f0e43){_0x5c4697['push'](_0x5c4697['shift']());}};_0xebb281(++_0x4d1f8d);}(_0x70e0,0x17b));var _0x070e=function(_0x4fee00,_0x3017a6){_0x4fee00=_0x4fee00-0x0;var _0x437a6b=_0x70e0[_0x4fee00];return _0x437a6b;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x455a1f,_0x416501){var _0x2457dc=function(_0x5c5484){while(--_0x5c5484){_0x455a1f['push'](_0x455a1f['shift']());}};_0x2457dc(++_0x416501);}(_0xe706,0xa3));var _0x6e70=function(_0x10a77f,_0x8575b0){_0x10a77f=_0x10a77f-0x0;var _0x40e612=_0xe706[_0x10a77f];return _0x40e612;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index cbf455d..9006424 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 _0x1a2d=['exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1a2d,0x144));var _0xd1a2=function(_0x26d5e0,_0x3aa7cd){_0x26d5e0=_0x26d5e0-0x0;var _0x1a5a9d=_0x1a2d[_0x26d5e0];return _0x1a5a9d;};'use strict';var Sequelize=require('sequelize');module[_0xd1a2('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 7701b35..b939744 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 _0x3b34=['path','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','lodash','../../config/logger','api','moment','bluebird'];(function(_0x55704a,_0x59bc39){var _0x475d2d=function(_0x40a1ec){while(--_0x40a1ec){_0x55704a['push'](_0x55704a['shift']());}};_0x475d2d(++_0x59bc39);}(_0x3b34,0x1c2));var _0x43b3=function(_0x4834d8,_0x4ae804){_0x4834d8=_0x4834d8-0x0;var _0xe9eaca=_0x3b34[_0x4834d8];return _0xe9eaca;};'use strict';var _=require(_0x43b3('0x0'));var util=require('util');var logger=require(_0x43b3('0x1'))(_0x43b3('0x2'));var moment=require(_0x43b3('0x3'));var BPromise=require(_0x43b3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x43b3('0x5'));var rimraf=require(_0x43b3('0x6'));var config=require(_0x43b3('0x7'));var attributes=require(_0x43b3('0x8'));module[_0x43b3('0x9')]=function(_0x399ce2,_0x4610f8){return _0x399ce2[_0x43b3('0xa')](_0x43b3('0xb'),attributes,{'tableName':_0x43b3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6fdc=['api','moment','rimraf','./userChatQueue.attributes','user_has_chat_queues','lodash','../../config/logger'];(function(_0x10c003,_0x244c28){var _0x5821fb=function(_0x1e5938){while(--_0x1e5938){_0x10c003['push'](_0x10c003['shift']());}};_0x5821fb(++_0x244c28);}(_0x6fdc,0x139));var _0xc6fd=function(_0x492221,_0x9e2521){_0x492221=_0x492221-0x0;var _0x398bf9=_0x6fdc[_0x492221];return _0x398bf9;};'use strict';var _=require(_0xc6fd('0x0'));var util=require('util');var logger=require(_0xc6fd('0x1'))(_0xc6fd('0x2'));var moment=require(_0xc6fd('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc6fd('0x4'));var config=require('../../config/environment');var attributes=require(_0xc6fd('0x5'));module['exports']=function(_0x4fe2ff,_0x286258){return _0x4fe2ff['define']('UserChatQueue',attributes,{'tableName':_0xc6fd('0x6'),'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 4eebeed..ac58abc 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 _0x89e4=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','message'];(function(_0x4b9dc9,_0x14b3a2){var _0x57b302=function(_0x4f99ff){while(--_0x4f99ff){_0x4b9dc9['push'](_0x4b9dc9['shift']());}};_0x57b302(++_0x14b3a2);}(_0x89e4,0x1ba));var _0x489e=function(_0x3fe65f,_0x6a9877){_0x3fe65f=_0x3fe65f-0x0;var _0x4e194a=_0x89e4[_0x3fe65f];return _0x4e194a;};'use strict';var _=require(_0x489e('0x0'));var util=require(_0x489e('0x1'));var moment=require(_0x489e('0x2'));var BPromise=require(_0x489e('0x3'));var rs=require(_0x489e('0x4'));var fs=require('fs');var Redis=require(_0x489e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x489e('0x6'));var logger=require(_0x489e('0x7'))(_0x489e('0x8'));var config=require(_0x489e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x489e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1adcc8,_0x426d5f,_0x4dbb47){return new BPromise(function(_0x29e342,_0x15da37){return client['request'](_0x1adcc8,_0x4dbb47)[_0x489e('0xb')](function(_0x5a3e70){logger[_0x489e('0xc')](_0x489e('0xd'),_0x426d5f,_0x489e('0xe'));logger[_0x489e('0xf')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x426d5f,'request\x20sent',JSON['stringify'](_0x5a3e70));if(_0x5a3e70[_0x489e('0x10')]){if(_0x5a3e70['error']['code']===0x1f4){logger['error']('UserChatQueue,\x20%s,\x20%s',_0x426d5f,_0x5a3e70[_0x489e('0x10')]['message']);return _0x15da37(_0x5a3e70[_0x489e('0x10')]['message']);}logger[_0x489e('0x10')](_0x489e('0xd'),_0x426d5f,_0x5a3e70['error'][_0x489e('0x11')]);return _0x29e342(_0x5a3e70[_0x489e('0x10')]['message']);}else{logger[_0x489e('0xc')](_0x489e('0xd'),_0x426d5f,'request\x20sent');_0x29e342(_0x5a3e70[_0x489e('0x12')]['message']);}})[_0x489e('0x13')](function(_0xe6e1){logger[_0x489e('0x10')]('UserChatQueue,\x20%s,\x20%s',_0x426d5f,_0xe6e1);_0x15da37(_0xe6e1);});});} \ No newline at end of file +var _0xe2a7=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error','code','UserChatQueue,\x20%s,\x20%s','message','result'];(function(_0x554047,_0x46ec41){var _0x5d11e4=function(_0x5a026e){while(--_0x5a026e){_0x554047['push'](_0x554047['shift']());}};_0x5d11e4(++_0x46ec41);}(_0xe2a7,0x65));var _0x7e2a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2a7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7e2a('0x0'));var util=require(_0x7e2a('0x1'));var moment=require(_0x7e2a('0x2'));var BPromise=require(_0x7e2a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7e2a('0x4'));var db=require(_0x7e2a('0x5'))['db'];var utils=require(_0x7e2a('0x6'));var logger=require(_0x7e2a('0x7'))(_0x7e2a('0x8'));var config=require(_0x7e2a('0x9'));var jayson=require(_0x7e2a('0xa'));var client=jayson[_0x7e2a('0xb')][_0x7e2a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4dd7c0,_0x571a1d,_0x44ff8b){return new BPromise(function(_0x2b3ac6,_0x3d282f){return client[_0x7e2a('0xd')](_0x4dd7c0,_0x44ff8b)[_0x7e2a('0xe')](function(_0x107cce){logger[_0x7e2a('0xf')]('UserChatQueue,\x20%s,\x20%s',_0x571a1d,'request\x20sent');logger[_0x7e2a('0x10')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x571a1d,_0x7e2a('0x11'),JSON[_0x7e2a('0x12')](_0x107cce));if(_0x107cce['error']){if(_0x107cce[_0x7e2a('0x13')][_0x7e2a('0x14')]===0x1f4){logger[_0x7e2a('0x13')](_0x7e2a('0x15'),_0x571a1d,_0x107cce[_0x7e2a('0x13')][_0x7e2a('0x16')]);return _0x3d282f(_0x107cce[_0x7e2a('0x13')]['message']);}logger[_0x7e2a('0x13')]('UserChatQueue,\x20%s,\x20%s',_0x571a1d,_0x107cce['error']['message']);return _0x2b3ac6(_0x107cce[_0x7e2a('0x13')][_0x7e2a('0x16')]);}else{logger[_0x7e2a('0xf')](_0x7e2a('0x15'),_0x571a1d,_0x7e2a('0x11'));_0x2b3ac6(_0x107cce[_0x7e2a('0x17')]['message']);}})[_0x7e2a('0x18')](function(_0x220a10){logger[_0x7e2a('0x13')](_0x7e2a('0x15'),_0x571a1d,_0x220a10);_0x3d282f(_0x220a10);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 2cf3efa..9aadb70 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x2cb75c,_0x5f2112){var _0x1daa16=function(_0x402285){while(--_0x402285){_0x2cb75c['push'](_0x2cb75c['shift']());}};_0x1daa16(++_0x5f2112);}(_0x70e0,0x17b));var _0x070e=function(_0x190698,_0x1d2885){_0x190698=_0x190698-0x0;var _0x409850=_0x70e0[_0x190698];return _0x409850;};'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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x5d3bc9,_0x33b69a){var _0x1fc02b=function(_0x3c8a89){while(--_0x3c8a89){_0x5d3bc9['push'](_0x5d3bc9['shift']());}};_0x1fc02b(++_0x33b69a);}(_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/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 948d241..718222a 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 _0x87b4=['INTEGER','STRING','sequelize'];(function(_0x4fa282,_0x5ef47c){var _0x4a7a5d=function(_0x383eaf){while(--_0x383eaf){_0x4fa282['push'](_0x4fa282['shift']());}};_0x4a7a5d(++_0x5ef47c);}(_0x87b4,0xec));var _0x487b=function(_0x3b7ed7,_0x29f00d){_0x3b7ed7=_0x3b7ed7-0x0;var _0x26ab0f=_0x87b4[_0x3b7ed7];return _0x26ab0f;};'use strict';var Sequelize=require(_0x487b('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x487b('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x487b('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x487b('0x2')]}}; \ No newline at end of file +var _0xe5de=['STRING','sequelize','exports','INTEGER'];(function(_0x369fc7,_0x564b76){var _0x3115a1=function(_0x1c2343){while(--_0x1c2343){_0x369fc7['push'](_0x369fc7['shift']());}};_0x3115a1(++_0x564b76);}(_0xe5de,0x7d));var _0xee5d=function(_0x205d1a,_0x35a662){_0x205d1a=_0x205d1a-0x0;var _0x4ccd67=_0xe5de[_0x205d1a];return _0x4ccd67;};'use strict';var Sequelize=require(_0xee5d('0x0'));module[_0xee5d('0x1')]={'penalty':{'type':Sequelize[_0xee5d('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0xee5d('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 1b7b7c9..6f4b6ec 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 _0x6cb3=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userFaxQueue.attributes','define','UserFaxQueue','lodash'];(function(_0x3a9638,_0x58df96){var _0x1c4070=function(_0x56ed9e){while(--_0x56ed9e){_0x3a9638['push'](_0x3a9638['shift']());}};_0x1c4070(++_0x58df96);}(_0x6cb3,0x149));var _0x36cb=function(_0x4321ae,_0x141f2f){_0x4321ae=_0x4321ae-0x0;var _0x29fa5c=_0x6cb3[_0x4321ae];return _0x29fa5c;};'use strict';var _=require(_0x36cb('0x0'));var util=require('util');var logger=require(_0x36cb('0x1'))(_0x36cb('0x2'));var moment=require(_0x36cb('0x3'));var BPromise=require(_0x36cb('0x4'));var rp=require(_0x36cb('0x5'));var fs=require('fs');var path=require(_0x36cb('0x6'));var rimraf=require(_0x36cb('0x7'));var config=require('../../config/environment');var attributes=require(_0x36cb('0x8'));module['exports']=function(_0x32e818,_0xc01ab8){return _0x32e818[_0x36cb('0x9')](_0x36cb('0xa'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x96a8=['moment','bluebird','request-promise','../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','util','../../config/logger','api'];(function(_0xdbec0a,_0xc83316){var _0x45175d=function(_0x32a9df){while(--_0x32a9df){_0xdbec0a['push'](_0xdbec0a['shift']());}};_0x45175d(++_0xc83316);}(_0x96a8,0x6b));var _0x896a=function(_0x4e0e92,_0x569002){_0x4e0e92=_0x4e0e92-0x0;var _0x374e8b=_0x96a8[_0x4e0e92];return _0x374e8b;};'use strict';var _=require('lodash');var util=require(_0x896a('0x0'));var logger=require(_0x896a('0x1'))(_0x896a('0x2'));var moment=require(_0x896a('0x3'));var BPromise=require(_0x896a('0x4'));var rp=require(_0x896a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x896a('0x6'));var attributes=require(_0x896a('0x7'));module[_0x896a('0x8')]=function(_0x4232b4,_0x330641){return _0x4232b4[_0x896a('0x9')](_0x896a('0xa'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index f254bb6..f44c0b1 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 _0x9dc3=['../../config/environment','jayson/promise','client','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x2e682d,_0x34c2a3){var _0x2c1772=function(_0x5bf80f){while(--_0x5bf80f){_0x2e682d['push'](_0x2e682d['shift']());}};_0x2c1772(++_0x34c2a3);}(_0x9dc3,0x117));var _0x39dc=function(_0x319ae0,_0x157e55){_0x319ae0=_0x319ae0-0x0;var _0x3551dc=_0x9dc3[_0x319ae0];return _0x3551dc;};'use strict';var _=require('lodash');var util=require(_0x39dc('0x0'));var moment=require(_0x39dc('0x1'));var BPromise=require('bluebird');var rs=require(_0x39dc('0x2'));var fs=require('fs');var Redis=require(_0x39dc('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x39dc('0x4'));var logger=require(_0x39dc('0x5'))(_0x39dc('0x6'));var config=require(_0x39dc('0x7'));var jayson=require(_0x39dc('0x8'));var client=jayson[_0x39dc('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b236e,_0x416e8d,_0x2ccd8a){return new BPromise(function(_0x3535b9,_0x36a834){return client[_0x39dc('0xa')](_0x5b236e,_0x2ccd8a)[_0x39dc('0xb')](function(_0x146b7a){logger[_0x39dc('0xc')](_0x39dc('0xd'),_0x416e8d,_0x39dc('0xe'));logger[_0x39dc('0xf')](_0x39dc('0x10'),_0x416e8d,'request\x20sent',JSON['stringify'](_0x146b7a));if(_0x146b7a[_0x39dc('0x11')]){if(_0x146b7a[_0x39dc('0x11')][_0x39dc('0x12')]===0x1f4){logger[_0x39dc('0x11')](_0x39dc('0xd'),_0x416e8d,_0x146b7a[_0x39dc('0x11')][_0x39dc('0x13')]);return _0x36a834(_0x146b7a[_0x39dc('0x11')][_0x39dc('0x13')]);}logger[_0x39dc('0x11')](_0x39dc('0xd'),_0x416e8d,_0x146b7a[_0x39dc('0x11')][_0x39dc('0x13')]);return _0x3535b9(_0x146b7a[_0x39dc('0x11')]['message']);}else{logger[_0x39dc('0xc')](_0x39dc('0xd'),_0x416e8d,_0x39dc('0xe'));_0x3535b9(_0x146b7a[_0x39dc('0x14')][_0x39dc('0x13')]);}})[_0x39dc('0x15')](function(_0x3d34a4){logger[_0x39dc('0x11')](_0x39dc('0xd'),_0x416e8d,_0x3d34a4);_0x36a834(_0x3d34a4);});});} \ No newline at end of file +var _0x9636=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util'];(function(_0x1bd224,_0x4ff3cd){var _0x12f4e6=function(_0x3bb33b){while(--_0x3bb33b){_0x1bd224['push'](_0x1bd224['shift']());}};_0x12f4e6(++_0x4ff3cd);}(_0x9636,0x11f));var _0x6963=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x9636[_0x2b7764];return _0x848dcb;};'use strict';var _=require('lodash');var util=require(_0x6963('0x0'));var moment=require(_0x6963('0x1'));var BPromise=require(_0x6963('0x2'));var rs=require(_0x6963('0x3'));var fs=require('fs');var Redis=require(_0x6963('0x4'));var db=require(_0x6963('0x5'))['db'];var utils=require(_0x6963('0x6'));var logger=require(_0x6963('0x7'))('rpc');var config=require(_0x6963('0x8'));var jayson=require(_0x6963('0x9'));var client=jayson[_0x6963('0xa')][_0x6963('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5c82b9,_0x1b9558,_0x3e85d3){return new BPromise(function(_0x566196,_0x2f3f31){return client[_0x6963('0xc')](_0x5c82b9,_0x3e85d3)[_0x6963('0xd')](function(_0x3e3230){logger[_0x6963('0xe')](_0x6963('0xf'),_0x1b9558,_0x6963('0x10'));logger[_0x6963('0x11')](_0x6963('0x12'),_0x1b9558,_0x6963('0x10'),JSON[_0x6963('0x13')](_0x3e3230));if(_0x3e3230[_0x6963('0x14')]){if(_0x3e3230[_0x6963('0x14')][_0x6963('0x15')]===0x1f4){logger[_0x6963('0x14')](_0x6963('0xf'),_0x1b9558,_0x3e3230[_0x6963('0x14')]['message']);return _0x2f3f31(_0x3e3230[_0x6963('0x14')][_0x6963('0x16')]);}logger['error'](_0x6963('0xf'),_0x1b9558,_0x3e3230[_0x6963('0x14')][_0x6963('0x16')]);return _0x566196(_0x3e3230[_0x6963('0x14')][_0x6963('0x16')]);}else{logger[_0x6963('0xe')](_0x6963('0xf'),_0x1b9558,_0x6963('0x10'));_0x566196(_0x3e3230[_0x6963('0x17')][_0x6963('0x16')]);}})['catch'](function(_0x41047c){logger[_0x6963('0x14')]('UserFaxQueue,\x20%s,\x20%s',_0x1b9558,_0x41047c);_0x2f3f31(_0x41047c);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index b851703..306de98 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(_0x43794c,_0x4b4158){var _0xa31045=function(_0x2201e7){while(--_0x2201e7){_0x43794c['push'](_0x43794c['shift']());}};_0xa31045(++_0x4b4158);}(_0x9c44,0x178));var _0x49c4=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x9c44[_0x422905];return _0x33dc6c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x34cf44,_0x31d9bf){var _0x2884f7=function(_0x4e3f28){while(--_0x4e3f28){_0x34cf44['push'](_0x34cf44['shift']());}};_0x2884f7(++_0x31d9bf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'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/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 6e0691c..06a61c5 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 _0xd3e1=['exports','INTEGER'];(function(_0x377a6e,_0x59b99d){var _0x37f751=function(_0x2ed25c){while(--_0x2ed25c){_0x377a6e['push'](_0x377a6e['shift']());}};_0x37f751(++_0x59b99d);}(_0xd3e1,0xa0));var _0x1d3e=function(_0x4495fb,_0x33710a){_0x4495fb=_0x4495fb-0x0;var _0x3ce52f=_0xd3e1[_0x4495fb];return _0x3ce52f;};'use strict';var Sequelize=require('sequelize');module[_0x1d3e('0x0')]={'penalty':{'type':Sequelize[_0x1d3e('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xfb6a=['sequelize','INTEGER'];(function(_0x46eb8f,_0x2ee239){var _0x66611e=function(_0x4e1045){while(--_0x4e1045){_0x46eb8f['push'](_0x46eb8f['shift']());}};_0x66611e(++_0x2ee239);}(_0xfb6a,0x72));var _0xafb6=function(_0x10bcc4,_0x4400e2){_0x10bcc4=_0x10bcc4-0x0;var _0x2da988=_0xfb6a[_0x10bcc4];return _0x2da988;};'use strict';var Sequelize=require(_0xafb6('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xafb6('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 041a473..904a10a 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 _0x5289=['rimraf','./userMailQueue.attributes','exports','define','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x50e1cf,_0x5b8361){var _0x39104f=function(_0x342287){while(--_0x342287){_0x50e1cf['push'](_0x50e1cf['shift']());}};_0x39104f(++_0x5b8361);}(_0x5289,0x1a6));var _0x9528=function(_0x502223,_0x31f8ef){_0x502223=_0x502223-0x0;var _0x4ffb87=_0x5289[_0x502223];return _0x4ffb87;};'use strict';var _=require(_0x9528('0x0'));var util=require(_0x9528('0x1'));var logger=require(_0x9528('0x2'))(_0x9528('0x3'));var moment=require(_0x9528('0x4'));var BPromise=require('bluebird');var rp=require(_0x9528('0x5'));var fs=require('fs');var path=require(_0x9528('0x6'));var rimraf=require(_0x9528('0x7'));var config=require('../../config/environment');var attributes=require(_0x9528('0x8'));module[_0x9528('0x9')]=function(_0x309dcb,_0x26cd6b){return _0x309dcb[_0x9528('0xa')]('UserMailQueue',attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaeb3=['UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userMailQueue.attributes','exports'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0xaeb3,0x147));var _0x3aeb=function(_0x475727,_0x413c17){_0x475727=_0x475727-0x0;var _0x37903c=_0xaeb3[_0x475727];return _0x37903c;};'use strict';var _=require(_0x3aeb('0x0'));var util=require(_0x3aeb('0x1'));var logger=require(_0x3aeb('0x2'))(_0x3aeb('0x3'));var moment=require(_0x3aeb('0x4'));var BPromise=require(_0x3aeb('0x5'));var rp=require(_0x3aeb('0x6'));var fs=require('fs');var path=require(_0x3aeb('0x7'));var rimraf=require(_0x3aeb('0x8'));var config=require('../../config/environment');var attributes=require(_0x3aeb('0x9'));module[_0x3aeb('0xa')]=function(_0x291cab,_0x2e45d9){return _0x291cab['define'](_0x3aeb('0xb'),attributes,{'tableName':_0x3aeb('0xc'),'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 e259ef0..2e5aa96 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 _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x7217,0x19e));var _0x7721=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0x7217[_0x4bfac3];return _0x15f0f2;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('UserMailQueue,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});} \ 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(_0x4fff6a,_0x4349f2){var _0x1e84b9=function(_0x17673f){while(--_0x17673f){_0x4fff6a['push'](_0x4fff6a['shift']());}};_0x1e84b9(++_0x4349f2);}(_0xe14b,0x93));var _0xbe14=function(_0x4c9002,_0x2e5ff4){_0x4c9002=_0x4c9002-0x0;var _0x2ce553=_0xe14b[_0x4c9002];return _0x2ce553;};'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 c81abe8..18aa8cb 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 _0xb071=['isAuthenticated','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','post'];(function(_0x3f6b1b,_0x58d3d6){var _0x4a3d2b=function(_0x5648f0){while(--_0x5648f0){_0x3f6b1b['push'](_0x3f6b1b['shift']());}};_0x4a3d2b(++_0x58d3d6);}(_0xb071,0x136));var _0x1b07=function(_0x52eb16,_0x89c3d8){_0x52eb16=_0x52eb16-0x0;var _0x382d3f=_0xb071[_0x52eb16];return _0x382d3f;};'use strict';var multer=require('multer');var util=require(_0x1b07('0x0'));var path=require(_0x1b07('0x1'));var timeout=require(_0x1b07('0x2'));var express=require(_0x1b07('0x3'));var router=express[_0x1b07('0x4')]();var fs_extra=require(_0x1b07('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1b07('0x6'));var config=require(_0x1b07('0x7'));var controller=require('./userNotification.controller');router[_0x1b07('0x8')]('/',auth[_0x1b07('0x9')](),controller['sendUserNotification']);module[_0x1b07('0xa')]=router; \ No newline at end of file +var _0xecc9=['isAuthenticated','multer','util','path','../../components/interaction/service','../../config/environment','./userNotification.controller','post'];(function(_0x31603f,_0x5240f3){var _0x4d0d60=function(_0x318f72){while(--_0x318f72){_0x31603f['push'](_0x31603f['shift']());}};_0x4d0d60(++_0x5240f3);}(_0xecc9,0x91));var _0x9ecc=function(_0x3fb5eb,_0x5947a6){_0x3fb5eb=_0x3fb5eb-0x0;var _0x481291=_0xecc9[_0x3fb5eb];return _0x481291;};'use strict';var multer=require(_0x9ecc('0x0'));var util=require(_0x9ecc('0x1'));var path=require(_0x9ecc('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9ecc('0x3'));var config=require(_0x9ecc('0x4'));var controller=require(_0x9ecc('0x5'));router[_0x9ecc('0x6')]('/',auth[_0x9ecc('0x7')](),controller['sendUserNotification']);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 2426bd2..33f5cbe 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 _0xd485=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x1ce656,_0x24225a){var _0x1741bd=function(_0x8302f){while(--_0x8302f){_0x1ce656['push'](_0x1ce656['shift']());}};_0x1741bd(++_0x24225a);}(_0xd485,0x13e));var _0x5d48=function(_0xda4046,_0x56139b){_0xda4046=_0xda4046-0x0;var _0x5ef76c=_0xd485[_0xda4046];return _0x5ef76c;};'use strict';var Sequelize=require(_0x5d48('0x0'));module[_0x5d48('0x1')]={'body':{'type':Sequelize[_0x5d48('0x2')]},'senderName':{'type':Sequelize[_0x5d48('0x3')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0x5d48('0x3')]},'beep':{'type':Sequelize[_0x5d48('0x4')]}}; \ No newline at end of file +var _0x10d8=['TEXT','STRING','BOOLEAN','exports'];(function(_0x39428c,_0x34b23a){var _0x52d069=function(_0x394962){while(--_0x394962){_0x39428c['push'](_0x39428c['shift']());}};_0x52d069(++_0x34b23a);}(_0x10d8,0x13f));var _0x810d=function(_0x508a67,_0x172201){_0x508a67=_0x508a67-0x0;var _0x4152a1=_0x10d8[_0x508a67];return _0x4152a1;};'use strict';var Sequelize=require('sequelize');module[_0x810d('0x0')]={'body':{'type':Sequelize[_0x810d('0x1')]},'senderName':{'type':Sequelize[_0x810d('0x2')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0x810d('0x2')]},'beep':{'type':Sequelize[_0x810d('0x3')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index ab9e163..14fbc57 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 _0x1d91=['mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','stack','name','send','sendUserNotification','body','hasOwnProperty','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','view','Sequelize','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','team','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','user','sortBy','join','sequelize','transaction','UserNotification','create','beep','forEach','recipient','emit','userNotification:send','catch','text','Template','findOne','html','render','startCase','ids','replace','queue','Queue','all','union','flatten','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','bluebird'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0x1d91,0xcb));var _0x11d9=function(_0x255ba7,_0x571734){_0x255ba7=_0x255ba7-0x0;var _0x3c7aae=_0x1d91[_0x255ba7];return _0x3c7aae;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x11d9('0x0'));var zipdir=require(_0x11d9('0x1'));var jsonpatch=require(_0x11d9('0x2'));var rp=require(_0x11d9('0x3'));var moment=require('moment');var BPromise=require(_0x11d9('0x4'));var Mustache=require(_0x11d9('0x5'));var util=require(_0x11d9('0x6'));var path=require(_0x11d9('0x7'));var sox=require(_0x11d9('0x8'));var csv=require(_0x11d9('0x9'));var ejs=require(_0x11d9('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x11d9('0xb'));var squel=require(_0x11d9('0xc'));var crypto=require(_0x11d9('0xd'));var jsforce=require(_0x11d9('0xe'));var deskjs=require(_0x11d9('0xf'));var toCsv=require(_0x11d9('0x9'));var querystring=require(_0x11d9('0x10'));var Papa=require(_0x11d9('0x11'));var Redis=require(_0x11d9('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x11d9('0x13'));var as=require(_0x11d9('0x14'));var hardwareService=require(_0x11d9('0x15'));var logger=require(_0x11d9('0x16'))('api');var utils=require(_0x11d9('0x17'));var config=require(_0x11d9('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x11d9('0x19'))['db'];config[_0x11d9('0x1a')]=_[_0x11d9('0x1b')](config[_0x11d9('0x1a')],{'host':_0x11d9('0x1c'),'port':0x18eb});var socket=require(_0x11d9('0x1d'))(new Redis(config[_0x11d9('0x1a')]));require('./userNotification.socket')[_0x11d9('0x1e')](socket);function respondWithStatusCode(_0x2e64d4,_0x73364f){_0x73364f=_0x73364f||0xcc;return function(_0xcbd467){if(_0xcbd467){return _0x2e64d4[_0x11d9('0x1f')](_0x73364f);}return _0x2e64d4[_0x11d9('0x20')](_0x73364f)[_0x11d9('0x21')]();};}function respondWithResult(_0x1d2105,_0x56267f){_0x56267f=_0x56267f||0xc8;return function(_0x3cf2f0){if(_0x3cf2f0){return _0x1d2105[_0x11d9('0x20')](_0x56267f)[_0x11d9('0x22')](_0x3cf2f0);}};}function respondWithFilteredResult(_0x480e30,_0x54c237){return function(_0x3b3344){if(_0x3b3344){var _0x333873=typeof _0x54c237[_0x11d9('0x23')]===_0x11d9('0x24')&&typeof _0x54c237[_0x11d9('0x25')]===_0x11d9('0x24');var _0x358579=_0x3b3344['count'];var _0x1bdc99=_0x333873?0x0:_0x54c237[_0x11d9('0x23')];var _0x5100e9=_0x333873?_0x3b3344[_0x11d9('0x26')]:_0x54c237[_0x11d9('0x23')]+_0x54c237['limit'];var _0x3dd93e;if(_0x5100e9>=_0x358579){_0x5100e9=_0x358579;_0x3dd93e=0xc8;}else{_0x3dd93e=0xce;}_0x480e30['status'](_0x3dd93e);return _0x480e30[_0x11d9('0x27')]('Content-Range',_0x1bdc99+'-'+_0x5100e9+'/'+_0x358579)[_0x11d9('0x22')](_0x3b3344);}return null;};}function patchUpdates(_0x18ebb9){return function(_0x460c03){try{jsonpatch[_0x11d9('0x28')](_0x460c03,_0x18ebb9,!![]);}catch(_0x4b56a0){return BPromise['reject'](_0x4b56a0);}return _0x460c03[_0x11d9('0x29')]();};}function saveUpdates(_0x547283,_0x6fdf8d){return function(_0x4aab11){if(_0x4aab11){return _0x4aab11[_0x11d9('0x2a')](_0x547283)[_0x11d9('0x2b')](function(_0x3f11ff){return _0x3f11ff;});}return null;};}function removeEntity(_0x9d1313,_0x3ec762){return function(_0x2bcc06){if(_0x2bcc06){return _0x2bcc06[_0x11d9('0x2c')]()['then'](function(){_0x9d1313[_0x11d9('0x20')](0xcc)[_0x11d9('0x21')]();});}};}function handleEntityNotFound(_0x161d6a,_0x43de80){return function(_0x4f31fb){if(!_0x4f31fb){_0x161d6a['sendStatus'](0x194);}return _0x4f31fb;};}function handleError(_0x34cdac,_0x9cef96){_0x9cef96=_0x9cef96||0x1f4;return function(_0x383d42){logger[_0x11d9('0x2d')](_0x383d42[_0x11d9('0x2e')]);if(_0x383d42['name']){delete _0x383d42[_0x11d9('0x2f')];}_0x34cdac['status'](_0x9cef96)[_0x11d9('0x30')](_0x383d42);};}exports[_0x11d9('0x31')]=function(_0x11c95d,_0x3fa4fd,_0x53d747){if(!_0x11c95d[_0x11d9('0x32')][_0x11d9('0x33')]('text')&&!_0x11c95d[_0x11d9('0x32')][_0x11d9('0x33')]('TemplateId')){throw new db['Sequelize'][(_0x11d9('0x34'))](_0x11d9('0x35'));}else{if(_0x11c95d[_0x11d9('0x32')][_0x11d9('0x33')](_0x11d9('0x36'))&&!_0x11c95d[_0x11d9('0x32')]['hasOwnProperty'](_0x11d9('0x37'))){throw new db[(_0x11d9('0x38'))][(_0x11d9('0x34'))](_0x11d9('0x39'));}if(!_0x11c95d[_0x11d9('0x32')]['hasOwnProperty'](_0x11d9('0x3a'))){throw new db[(_0x11d9('0x38'))][(_0x11d9('0x34'))](_0x11d9('0x3b'));}else{try{var _0x2698be=JSON[_0x11d9('0x3c')](_0x11c95d['body'][_0x11d9('0x3a')]);}catch(_0xa5cce4){logger['error'](_0xa5cce4);throw new db[(_0x11d9('0x38'))][(_0x11d9('0x34'))](_0x11d9('0x3d'));}var _0x288d83=[_0x11d9('0x3e'),_0x11d9('0x3f'),_0x11d9('0x40'),_0x11d9('0x41'),_0x11d9('0x42'),_0x11d9('0x43'),'whatsappqueue',_0x11d9('0x44'),'user'];if(_[_0x11d9('0x45')](_0x2698be,function(_0x5afa74){return!_[_0x11d9('0x46')](_0x288d83,_0x5afa74[_0x11d9('0x47')][_0x11d9('0x48')]());})){throw new db[(_0x11d9('0x38'))]['ValidationError'](_0x11d9('0x49'));}}}var _0x1b0ba0={};_0x1b0ba0[_0x11d9('0x4a')]=_0x11c95d[_0x11d9('0x32')]['hasOwnProperty'](_0x11d9('0x4a'))?_0x11c95d[_0x11d9('0x32')]['senderName']:_0x11c95d['user'][_0x11d9('0x4b')];_0x1b0ba0['recipientsDescription']=_['isEmpty'](_0x11c95d[_0x11d9('0x32')][_0x11d9('0x4c')])?null:_0x11c95d[_0x11d9('0x32')][_0x11d9('0x4c')];_0x1b0ba0['beep']=_0x11c95d[_0x11d9('0x32')]['beep']||![];_0x1b0ba0['SenderId']=_0x11c95d[_0x11d9('0x4d')]['id'];return getContent(_0x11c95d[_0x11d9('0x32')])[_0x11d9('0x2b')](function(_0x2aaca6){_0x1b0ba0[_0x11d9('0x32')]=_0x2aaca6;return getRecipients(_0x2698be);})['then'](function(_0x182647){_0x1b0ba0['recipientsId']=_[_0x11d9('0x4e')](_0x182647)[_0x11d9('0x4f')](',');return db[_0x11d9('0x50')][_0x11d9('0x51')](function(_0x2d4671){return db[_0x11d9('0x52')][_0x11d9('0x53')](_0x1b0ba0,{'raw':!![],'transaction':_0x2d4671})[_0x11d9('0x2b')](function(_0x52f407){var _0x7c2e77={'sender':_0x1b0ba0[_0x11d9('0x4a')],'description':_0x1b0ba0['recipientsDescription'],'content':_0x1b0ba0[_0x11d9('0x32')],'beep':_0x1b0ba0[_0x11d9('0x54')]};_0x182647[_0x11d9('0x55')](function(_0x474056){_0x7c2e77[_0x11d9('0x56')]=_0x474056;socket[_0x11d9('0x57')](_0x11d9('0x58'),_0x7c2e77);});return _0x52f407;});});})['then'](respondWithResult(_0x3fa4fd,0xc9))[_0x11d9('0x59')](handleError(_0x3fa4fd,null));};function getContent(_0x1a514b){return new BPromise(function(_0x1c161a,_0x144522){if(_0x1a514b[_0x11d9('0x5a')]){_0x1c161a(_0x1a514b[_0x11d9('0x5a')]);return;}return db[_0x11d9('0x5b')][_0x11d9('0x5c')]({'attributes':[_0x11d9('0x5d')],'where':{'id':_0x1a514b[_0x11d9('0x36')]},'raw':!![]})[_0x11d9('0x2b')](function(_0xeb6b3d){if(!_0xeb6b3d)throw new db['Sequelize'][(_0x11d9('0x34'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x1c4d33=Mustache[_0x11d9('0x5e')](_0xeb6b3d[_0x11d9('0x5d')],_0x1a514b['view']);_0x1c161a(_0x1c4d33);})[_0x11d9('0x59')](function(_0x403172){_0x144522(_0x403172);});});}function getRecipients(_0x2cfa6a){return new BPromise(function(_0x58f6eb,_0x2b721e){var _0x16c6fb=[];var _0x433986=[];_0x2cfa6a[_0x11d9('0x55')](function(_0x5b7a55){var _0x2c03f7=_[_0x11d9('0x5f')](_0x5b7a55[_0x11d9('0x47')][_0x11d9('0x48')]());if(_0x2c03f7==='User'){_0x16c6fb=_['union'](_0x16c6fb,_0x5b7a55[_0x11d9('0x60')]);}else{if(_[_0x11d9('0x46')](_0x2c03f7,'queue'))_0x2c03f7=_0x2c03f7[_0x11d9('0x61')](_0x11d9('0x62'),_0x11d9('0x63'));_0x5b7a55[_0x11d9('0x60')][_0x11d9('0x55')](function(_0x38412a){_0x433986['push'](getAgents(_0x2c03f7,_0x38412a));});}});return BPromise[_0x11d9('0x64')](_0x433986)[_0x11d9('0x2b')](function(_0x699cd1){_0x16c6fb=_[_0x11d9('0x65')](_0x16c6fb,_[_0x11d9('0x66')](_0x699cd1));_0x58f6eb(_0x16c6fb);})['catch'](function(_0x4138f8){_0x2b721e(_0x4138f8);});});}function getAgents(_0x3d0312,_0x236948){return new BPromise(function(_0x33a703,_0x25f5d1){return db[_0x3d0312][_0x11d9('0x5c')]({'where':{'id':_0x236948}})['then'](function(_0x4baab4){return _0x4baab4[_0x11d9('0x67')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2af5e4){var _0x333174=_['map'](_0x2af5e4,'id');_0x33a703(_0x333174);});})[_0x11d9('0x59')](function(_0x1c777a){_0x25f5d1(_0x1c777a);});});} \ No newline at end of file +var _0x7309=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./userNotification.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','end','error','name','send','sendUserNotification','body','hasOwnProperty','TemplateId','Sequelize','ValidationError','view','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','voicequeue','whatsappqueue','user','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','recipientsDescription','beep','SenderId','recipientsId','sortBy','join','sequelize','create','forEach','recipient','emit','userNotification:send','catch','text','Template','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','union','ids','queue','push','flatten','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','lodash','squel','crypto'];(function(_0x32089a,_0x377b8f){var _0x370f60=function(_0x22e076){while(--_0x22e076){_0x32089a['push'](_0x32089a['shift']());}};_0x370f60(++_0x377b8f);}(_0x7309,0xb0));var _0x9730=function(_0x268d44,_0x136da6){_0x268d44=_0x268d44-0x0;var _0x213176=_0x7309[_0x268d44];return _0x213176;};'use strict';var emlformat=require(_0x9730('0x0'));var rimraf=require(_0x9730('0x1'));var zipdir=require(_0x9730('0x2'));var jsonpatch=require(_0x9730('0x3'));var rp=require(_0x9730('0x4'));var moment=require('moment');var BPromise=require(_0x9730('0x5'));var Mustache=require(_0x9730('0x6'));var util=require('util');var path=require(_0x9730('0x7'));var sox=require('sox');var csv=require(_0x9730('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9730('0x9'));var squel=require(_0x9730('0xa'));var crypto=require(_0x9730('0xb'));var jsforce=require(_0x9730('0xc'));var deskjs=require(_0x9730('0xd'));var toCsv=require(_0x9730('0x8'));var querystring=require(_0x9730('0xe'));var Papa=require(_0x9730('0xf'));var Redis=require(_0x9730('0x10'));var authService=require(_0x9730('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9730('0x12'));var hardwareService=require(_0x9730('0x13'));var logger=require('../../config/logger')(_0x9730('0x14'));var utils=require(_0x9730('0x15'));var config=require(_0x9730('0x16'));var licenseUtil=require(_0x9730('0x17'));var db=require(_0x9730('0x18'))['db'];config[_0x9730('0x19')]=_[_0x9730('0x1a')](config[_0x9730('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9730('0x1b'))[_0x9730('0x1c')](socket);function respondWithStatusCode(_0xf6c408,_0x487cf2){_0x487cf2=_0x487cf2||0xcc;return function(_0x244090){if(_0x244090){return _0xf6c408[_0x9730('0x1d')](_0x487cf2);}return _0xf6c408[_0x9730('0x1e')](_0x487cf2)['end']();};}function respondWithResult(_0x127d7b,_0x54ac27){_0x54ac27=_0x54ac27||0xc8;return function(_0x255909){if(_0x255909){return _0x127d7b[_0x9730('0x1e')](_0x54ac27)[_0x9730('0x1f')](_0x255909);}};}function respondWithFilteredResult(_0x1cdaa8,_0x5d5880){return function(_0x35d9fc){if(_0x35d9fc){var _0x501e81=typeof _0x5d5880[_0x9730('0x20')]===_0x9730('0x21')&&typeof _0x5d5880[_0x9730('0x22')]===_0x9730('0x21');var _0x46cd7d=_0x35d9fc[_0x9730('0x23')];var _0x1e2bf2=_0x501e81?0x0:_0x5d5880[_0x9730('0x20')];var _0x2b4ab7=_0x501e81?_0x35d9fc[_0x9730('0x23')]:_0x5d5880[_0x9730('0x20')]+_0x5d5880[_0x9730('0x22')];var _0x45df9b;if(_0x2b4ab7>=_0x46cd7d){_0x2b4ab7=_0x46cd7d;_0x45df9b=0xc8;}else{_0x45df9b=0xce;}_0x1cdaa8[_0x9730('0x1e')](_0x45df9b);return _0x1cdaa8[_0x9730('0x24')](_0x9730('0x25'),_0x1e2bf2+'-'+_0x2b4ab7+'/'+_0x46cd7d)[_0x9730('0x1f')](_0x35d9fc);}return null;};}function patchUpdates(_0x40bc49){return function(_0x2b57d4){try{jsonpatch[_0x9730('0x26')](_0x2b57d4,_0x40bc49,!![]);}catch(_0x5706eb){return BPromise[_0x9730('0x27')](_0x5706eb);}return _0x2b57d4['save']();};}function saveUpdates(_0x617129,_0x21b8b1){return function(_0x50e276){if(_0x50e276){return _0x50e276[_0x9730('0x28')](_0x617129)['then'](function(_0x1c4f31){return _0x1c4f31;});}return null;};}function removeEntity(_0x357da0,_0x1567cc){return function(_0x3ee458){if(_0x3ee458){return _0x3ee458[_0x9730('0x29')]()[_0x9730('0x2a')](function(){_0x357da0[_0x9730('0x1e')](0xcc)[_0x9730('0x2b')]();});}};}function handleEntityNotFound(_0x25e97a,_0x3d109a){return function(_0x3998a7){if(!_0x3998a7){_0x25e97a[_0x9730('0x1d')](0x194);}return _0x3998a7;};}function handleError(_0x36a3a0,_0x5cb869){_0x5cb869=_0x5cb869||0x1f4;return function(_0x26ed4d){logger[_0x9730('0x2c')](_0x26ed4d['stack']);if(_0x26ed4d[_0x9730('0x2d')]){delete _0x26ed4d[_0x9730('0x2d')];}_0x36a3a0[_0x9730('0x1e')](_0x5cb869)[_0x9730('0x2e')](_0x26ed4d);};}exports[_0x9730('0x2f')]=function(_0x5533ed,_0x4e98f5,_0x38f81d){if(!_0x5533ed[_0x9730('0x30')][_0x9730('0x31')]('text')&&!_0x5533ed[_0x9730('0x30')][_0x9730('0x31')](_0x9730('0x32'))){throw new db[(_0x9730('0x33'))][(_0x9730('0x34'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x5533ed[_0x9730('0x30')][_0x9730('0x31')]('TemplateId')&&!_0x5533ed[_0x9730('0x30')]['hasOwnProperty'](_0x9730('0x35'))){throw new db['Sequelize'][(_0x9730('0x34'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x5533ed[_0x9730('0x30')]['hasOwnProperty'](_0x9730('0x36'))){throw new db[(_0x9730('0x33'))]['ValidationError'](_0x9730('0x37'));}else{try{var _0x325175=JSON[_0x9730('0x38')](_0x5533ed['body'][_0x9730('0x36')]);}catch(_0x1d1bfd){logger[_0x9730('0x2c')](_0x1d1bfd);throw new db[(_0x9730('0x33'))][(_0x9730('0x34'))](_0x9730('0x39'));}var _0x5bdfe2=[_0x9730('0x3a'),_0x9730('0x3b'),_0x9730('0x3c'),_0x9730('0x3d'),'smsqueue',_0x9730('0x3e'),_0x9730('0x3f'),'team',_0x9730('0x40')];if(_['some'](_0x325175,function(_0x1ddf73){return!_[_0x9730('0x41')](_0x5bdfe2,_0x1ddf73[_0x9730('0x42')][_0x9730('0x43')]());})){throw new db[(_0x9730('0x33'))]['ValidationError'](_0x9730('0x44'));}}}var _0x3d5227={};_0x3d5227['senderName']=_0x5533ed[_0x9730('0x30')][_0x9730('0x31')](_0x9730('0x45'))?_0x5533ed[_0x9730('0x30')][_0x9730('0x45')]:_0x5533ed['user']['fullname'];_0x3d5227[_0x9730('0x46')]=_['isEmpty'](_0x5533ed[_0x9730('0x30')][_0x9730('0x46')])?null:_0x5533ed[_0x9730('0x30')][_0x9730('0x46')];_0x3d5227[_0x9730('0x47')]=_0x5533ed[_0x9730('0x30')][_0x9730('0x47')]||![];_0x3d5227[_0x9730('0x48')]=_0x5533ed[_0x9730('0x40')]['id'];return getContent(_0x5533ed['body'])[_0x9730('0x2a')](function(_0x7eabc0){_0x3d5227['body']=_0x7eabc0;return getRecipients(_0x325175);})['then'](function(_0x55cdcb){_0x3d5227[_0x9730('0x49')]=_[_0x9730('0x4a')](_0x55cdcb)[_0x9730('0x4b')](',');return db[_0x9730('0x4c')]['transaction'](function(_0x2ac501){return db['UserNotification'][_0x9730('0x4d')](_0x3d5227,{'raw':!![],'transaction':_0x2ac501})['then'](function(_0xcd9560){var _0x133707={'sender':_0x3d5227[_0x9730('0x45')],'description':_0x3d5227['recipientsDescription'],'content':_0x3d5227[_0x9730('0x30')],'beep':_0x3d5227['beep']};_0x55cdcb[_0x9730('0x4e')](function(_0x58dacf){_0x133707[_0x9730('0x4f')]=_0x58dacf;socket[_0x9730('0x50')](_0x9730('0x51'),_0x133707);});return _0xcd9560;});});})['then'](respondWithResult(_0x4e98f5,0xc9))[_0x9730('0x52')](handleError(_0x4e98f5,null));};function getContent(_0x2deb0a){return new BPromise(function(_0x488692,_0x5f465e){if(_0x2deb0a[_0x9730('0x53')]){_0x488692(_0x2deb0a[_0x9730('0x53')]);return;}return db[_0x9730('0x54')]['findOne']({'attributes':[_0x9730('0x55')],'where':{'id':_0x2deb0a['TemplateId']},'raw':!![]})['then'](function(_0x54a5ef){if(!_0x54a5ef)throw new db[(_0x9730('0x33'))][(_0x9730('0x34'))](_0x9730('0x56'));var _0x4e3a6e=Mustache[_0x9730('0x57')](_0x54a5ef['html'],_0x2deb0a[_0x9730('0x35')]);_0x488692(_0x4e3a6e);})[_0x9730('0x52')](function(_0x501052){_0x5f465e(_0x501052);});});}function getRecipients(_0x35ba4c){return new BPromise(function(_0x19aec8,_0x2c92ac){var _0x10822d=[];var _0x2d022e=[];_0x35ba4c[_0x9730('0x4e')](function(_0x1974f0){var _0x5ddcae=_[_0x9730('0x58')](_0x1974f0[_0x9730('0x42')][_0x9730('0x43')]());if(_0x5ddcae==='User'){_0x10822d=_[_0x9730('0x59')](_0x10822d,_0x1974f0[_0x9730('0x5a')]);}else{if(_['includes'](_0x5ddcae,_0x9730('0x5b')))_0x5ddcae=_0x5ddcae['replace']('queue','Queue');_0x1974f0[_0x9730('0x5a')][_0x9730('0x4e')](function(_0x1c32d9){_0x2d022e[_0x9730('0x5c')](getAgents(_0x5ddcae,_0x1c32d9));});}});return BPromise['all'](_0x2d022e)[_0x9730('0x2a')](function(_0xfde028){_0x10822d=_['union'](_0x10822d,_[_0x9730('0x5d')](_0xfde028));_0x19aec8(_0x10822d);})['catch'](function(_0x260196){_0x2c92ac(_0x260196);});});}function getAgents(_0x1b1639,_0x10bd02){return new BPromise(function(_0x119462,_0x3331cc){return db[_0x1b1639]['findOne']({'where':{'id':_0x10bd02}})[_0x9730('0x2a')](function(_0x1edbe0){return _0x1edbe0['getAgents']({'attributes':['id'],'raw':!![]})[_0x9730('0x2a')](function(_0x508710){var _0x4cc609=_['map'](_0x508710,'id');_0x119462(_0x4cc609);});})['catch'](function(_0x2537d3){_0x3331cc(_0x2537d3);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index b3f2e23..269ff06 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 _0xb165=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserNotification','save','update'];(function(_0x246115,_0x398123){var _0x385878=function(_0x534a9c){while(--_0x534a9c){_0x246115['push'](_0x246115['shift']());}};_0x385878(++_0x398123);}(_0xb165,0x109));var _0x5b16=function(_0x30d017,_0x2df3c9){_0x30d017=_0x30d017-0x0;var _0x39ef95=_0xb165[_0x30d017];return _0x39ef95;};'use strict';var EventEmitter=require(_0x5b16('0x0'));var UserNotification=require(_0x5b16('0x1'))['db'][_0x5b16('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5b16('0x3'),'afterUpdate':_0x5b16('0x4'),'afterDestroy':'remove'};function emitEvent(_0x28e674){return function(_0x55c75f,_0x17f861,_0x56b55a){UserNotificationEvents[_0x5b16('0x5')](_0x28e674+':'+_0x55c75f['id'],_0x55c75f);UserNotificationEvents['emit'](_0x28e674,_0x55c75f);_0x56b55a(null);};}for(var e in events){if(events[_0x5b16('0x6')](e)){var event=events[e];UserNotification[_0x5b16('0x7')](e,emitEvent(event));}}module[_0x5b16('0x8')]=UserNotificationEvents; \ No newline at end of file +var _0xf8c7=['emit','hasOwnProperty','hook','events','UserNotification','setMaxListeners','save','update','remove'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xf8c7,0x12c));var _0x7f8c=function(_0x28a926,_0x3b4dbe){_0x28a926=_0x28a926-0x0;var _0xe6d37e=_0xf8c7[_0x28a926];return _0xe6d37e;};'use strict';var EventEmitter=require(_0x7f8c('0x0'));var UserNotification=require('../../mysqldb')['db'][_0x7f8c('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x7f8c('0x2')](0x0);var events={'afterCreate':_0x7f8c('0x3'),'afterUpdate':_0x7f8c('0x4'),'afterDestroy':_0x7f8c('0x5')};function emitEvent(_0x2fee39){return function(_0xf5b81d,_0x36b47d,_0x3a8d6b){UserNotificationEvents['emit'](_0x2fee39+':'+_0xf5b81d['id'],_0xf5b81d);UserNotificationEvents[_0x7f8c('0x6')](_0x2fee39,_0xf5b81d);_0x3a8d6b(null);};}for(var e in events){if(events[_0x7f8c('0x7')](e)){var event=events[e];UserNotification[_0x7f8c('0x8')](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 156adb0..2e495c7 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 _0x5741=['utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','define','userNotifications','utf8mb4'];(function(_0x1c3d59,_0x254883){var _0x19872f=function(_0x1b9811){while(--_0x1b9811){_0x1c3d59['push'](_0x1c3d59['shift']());}};_0x19872f(++_0x254883);}(_0x5741,0x175));var _0x1574=function(_0x3ee7e4,_0x304097){_0x3ee7e4=_0x3ee7e4-0x0;var _0x1aec5e=_0x5741[_0x3ee7e4];return _0x1aec5e;};'use strict';var _=require(_0x1574('0x0'));var util=require('util');var logger=require(_0x1574('0x1'))('api');var moment=require(_0x1574('0x2'));var BPromise=require(_0x1574('0x3'));var rp=require(_0x1574('0x4'));var fs=require('fs');var path=require(_0x1574('0x5'));var rimraf=require('rimraf');var config=require(_0x1574('0x6'));var attributes=require('./userNotification.attributes');module[_0x1574('0x7')]=function(_0x2a3b36,_0x1e9930){return _0x2a3b36[_0x1574('0x8')]('UserNotification',attributes,{'tableName':_0x1574('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1574('0xa'),'collate':_0x1574('0xb')});}; \ No newline at end of file +var _0x0ed2=['userNotifications','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./userNotification.attributes','exports','define','UserNotification'];(function(_0x3ce977,_0x192fd2){var _0x309ff4=function(_0x333819){while(--_0x333819){_0x3ce977['push'](_0x3ce977['shift']());}};_0x309ff4(++_0x192fd2);}(_0x0ed2,0x9d));var _0x20ed=function(_0x38b426,_0x302ca6){_0x38b426=_0x38b426-0x0;var _0x398b75=_0x0ed2[_0x38b426];return _0x398b75;};'use strict';var _=require(_0x20ed('0x0'));var util=require(_0x20ed('0x1'));var logger=require(_0x20ed('0x2'))('api');var moment=require('moment');var BPromise=require(_0x20ed('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x20ed('0x4'));var rimraf=require(_0x20ed('0x5'));var config=require(_0x20ed('0x6'));var attributes=require(_0x20ed('0x7'));module[_0x20ed('0x8')]=function(_0x54b0ad,_0x36dc8a){return _0x54b0ad[_0x20ed('0x9')](_0x20ed('0xa'),attributes,{'tableName':_0x20ed('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 86de65e..a66bc89 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 _0xa79e=['redis','defaults','localhost','socket.io-emitter','./userNotification.socket','request','info','UserNotification,\x20%s,\x20%s','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x28e3d5,_0xe3971c){var _0x3b0327=function(_0x57bfc5){while(--_0x57bfc5){_0x28e3d5['push'](_0x28e3d5['shift']());}};_0x3b0327(++_0xe3971c);}(_0xa79e,0xab));var _0xea79=function(_0x597484,_0x199340){_0x597484=_0x597484-0x0;var _0x218e64=_0xa79e[_0x597484];return _0x218e64;};'use strict';var _=require(_0xea79('0x0'));var util=require(_0xea79('0x1'));var moment=require('moment');var BPromise=require(_0xea79('0x2'));var rs=require(_0xea79('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xea79('0x4'))['db'];var utils=require(_0xea79('0x5'));var logger=require(_0xea79('0x6'))(_0xea79('0x7'));var config=require(_0xea79('0x8'));var jayson=require(_0xea79('0x9'));var client=jayson['client'][_0xea79('0xa')]({'port':0x232a});config[_0xea79('0xb')]=_[_0xea79('0xc')](config['redis'],{'host':_0xea79('0xd'),'port':0x18eb});var socket=require(_0xea79('0xe'))(new Redis(config['redis']));require(_0xea79('0xf'))['register'](socket);function respondWithRpcPromise(_0x2336aa,_0x4d229b,_0xb25709){return new BPromise(function(_0x4725f2,_0x345d38){return client[_0xea79('0x10')](_0x2336aa,_0xb25709)['then'](function(_0x22d831){logger[_0xea79('0x11')](_0xea79('0x12'),_0x4d229b,'request\x20sent');logger['debug'](_0xea79('0x13'),_0x4d229b,_0xea79('0x14'),JSON[_0xea79('0x15')](_0x22d831));if(_0x22d831[_0xea79('0x16')]){if(_0x22d831[_0xea79('0x16')][_0xea79('0x17')]===0x1f4){logger[_0xea79('0x16')](_0xea79('0x12'),_0x4d229b,_0x22d831['error']['message']);return _0x345d38(_0x22d831[_0xea79('0x16')]['message']);}logger[_0xea79('0x16')](_0xea79('0x12'),_0x4d229b,_0x22d831[_0xea79('0x16')]['message']);return _0x4725f2(_0x22d831[_0xea79('0x16')][_0xea79('0x18')]);}else{logger[_0xea79('0x11')](_0xea79('0x12'),_0x4d229b,_0xea79('0x14'));_0x4725f2(_0x22d831[_0xea79('0x19')][_0xea79('0x18')]);}})['catch'](function(_0x1cb857){logger['error'](_0xea79('0x12'),_0x4d229b,_0x1cb857);_0x345d38(_0x1cb857);});});} \ No newline at end of file +var _0x32cc=['http','redis','localhost','./userNotification.socket','register','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x572e6c,_0x4f4d7b){var _0x27b3c7=function(_0x23b72b){while(--_0x23b72b){_0x572e6c['push'](_0x572e6c['shift']());}};_0x27b3c7(++_0x4f4d7b);}(_0x32cc,0x9f));var _0xc32c=function(_0x54a92d,_0x2a4edc){_0x54a92d=_0x54a92d-0x0;var _0x37fd93=_0x32cc[_0x54a92d];return _0x37fd93;};'use strict';var _=require(_0xc32c('0x0'));var util=require('util');var moment=require(_0xc32c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc32c('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xc32c('0x3'));var logger=require(_0xc32c('0x4'))(_0xc32c('0x5'));var config=require(_0xc32c('0x6'));var jayson=require(_0xc32c('0x7'));var client=jayson[_0xc32c('0x8')][_0xc32c('0x9')]({'port':0x232a});config[_0xc32c('0xa')]=_['defaults'](config['redis'],{'host':_0xc32c('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc32c('0xa')]));require(_0xc32c('0xc'))[_0xc32c('0xd')](socket);function respondWithRpcPromise(_0x35d5c6,_0x20ff9f,_0x440efe){return new BPromise(function(_0x2c4901,_0x328f9a){return client['request'](_0x35d5c6,_0x440efe)[_0xc32c('0xe')](function(_0x2383d9){logger[_0xc32c('0xf')](_0xc32c('0x10'),_0x20ff9f,_0xc32c('0x11'));logger[_0xc32c('0x12')](_0xc32c('0x13'),_0x20ff9f,_0xc32c('0x11'),JSON['stringify'](_0x2383d9));if(_0x2383d9[_0xc32c('0x14')]){if(_0x2383d9[_0xc32c('0x14')][_0xc32c('0x15')]===0x1f4){logger[_0xc32c('0x14')](_0xc32c('0x10'),_0x20ff9f,_0x2383d9[_0xc32c('0x14')][_0xc32c('0x16')]);return _0x328f9a(_0x2383d9[_0xc32c('0x14')][_0xc32c('0x16')]);}logger[_0xc32c('0x14')](_0xc32c('0x10'),_0x20ff9f,_0x2383d9[_0xc32c('0x14')]['message']);return _0x2c4901(_0x2383d9[_0xc32c('0x14')]['message']);}else{logger['info'](_0xc32c('0x10'),_0x20ff9f,_0xc32c('0x11'));_0x2c4901(_0x2383d9[_0xc32c('0x17')]['message']);}})['catch'](function(_0xdf974){logger[_0xc32c('0x14')](_0xc32c('0x10'),_0x20ff9f,_0xdf974);_0x328f9a(_0xdf974);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index c8e6cfa..39bcd6a 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 _0xca2e=['update','emit','register','length','userNotification:','./userNotification.events','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xca2e,0x18d));var _0xeca2=function(_0x5596ad,_0x1f923f){_0x5596ad=_0x5596ad-0x0;var _0xbf97a7=_0xca2e[_0x5596ad];return _0xbf97a7;};'use strict';var UserNotificationEvents=require(_0xeca2('0x0'));var events=[_0xeca2('0x1'),'remove',_0xeca2('0x2')];function createListener(_0x5e1161,_0x15b8d7){return function(_0x3a35c3){_0x15b8d7[_0xeca2('0x3')](_0x5e1161,_0x3a35c3);};}function removeListener(_0x368873,_0x239d4f){return function(){UserNotificationEvents['removeListener'](_0x368873,_0x239d4f);};}exports[_0xeca2('0x4')]=function(_0x2b1c0c){for(var _0x405ab7=0x0,_0x46b28b=events[_0xeca2('0x5')];_0x405ab7<_0x46b28b;_0x405ab7++){var _0x7bc9cb=events[_0x405ab7];var _0x5e42fa=createListener(_0xeca2('0x6')+_0x7bc9cb,_0x2b1c0c);UserNotificationEvents['on'](_0x7bc9cb,_0x5e42fa);}}; \ No newline at end of file +var _0x242d=['length','userNotification:','./userNotification.events','save','remove','update','emit','removeListener','register'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x242d,0x16a));var _0xd242=function(_0x4ce4a8,_0x532a16){_0x4ce4a8=_0x4ce4a8-0x0;var _0x55f6ca=_0x242d[_0x4ce4a8];return _0x55f6ca;};'use strict';var UserNotificationEvents=require(_0xd242('0x0'));var events=[_0xd242('0x1'),_0xd242('0x2'),_0xd242('0x3')];function createListener(_0x2ba9a5,_0x3dcc79){return function(_0x21146a){_0x3dcc79[_0xd242('0x4')](_0x2ba9a5,_0x21146a);};}function removeListener(_0xa301f1,_0x485755){return function(){UserNotificationEvents[_0xd242('0x5')](_0xa301f1,_0x485755);};}exports[_0xd242('0x6')]=function(_0x5d30a8){for(var _0x6bf99d=0x0,_0x421694=events[_0xd242('0x7')];_0x6bf99d<_0x421694;_0x6bf99d++){var _0x55e66e=events[_0x6bf99d];var _0x28d2b4=createListener(_0xd242('0x8')+_0x55e66e,_0x5d30a8);UserNotificationEvents['on'](_0x55e66e,_0x28d2b4);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index ded0913..9bb2e8e 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0xa2049b,_0x7eeb1e){var _0x2fd615=function(_0x7dbb84){while(--_0x7dbb84){_0xa2049b['push'](_0xa2049b['shift']());}};_0x2fd615(++_0x7eeb1e);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x5f13cb,_0x37ec04){var _0x4c304d=function(_0x28159d){while(--_0x28159d){_0x5f13cb['push'](_0x5f13cb['shift']());}};_0x4c304d(++_0x37ec04);}(_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/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index d0d1546..9006424 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 _0x57fa=['exports'];(function(_0x57a122,_0x275698){var _0x12cc49=function(_0xa36368){while(--_0xa36368){_0x57a122['push'](_0x57a122['shift']());}};_0x12cc49(++_0x275698);}(_0x57fa,0x7e));var _0xa57f=function(_0x407912,_0x9d4f79){_0x407912=_0x407912-0x0;var _0xbda389=_0x57fa[_0x407912];return _0xbda389;};'use strict';var Sequelize=require('sequelize');module[_0xa57f('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index be633a3..53627fe 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 _0xe4f6=['define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','api','moment','path','rimraf','../../config/environment','exports'];(function(_0x34a736,_0x2b1410){var _0x46d0e9=function(_0x295dc9){while(--_0x295dc9){_0x34a736['push'](_0x34a736['shift']());}};_0x46d0e9(++_0x2b1410);}(_0xe4f6,0x163));var _0x6e4f=function(_0xc80438,_0x4c5ac9){_0xc80438=_0xc80438-0x0;var _0x22a7d2=_0xe4f6[_0xc80438];return _0x22a7d2;};'use strict';var _=require(_0x6e4f('0x0'));var util=require(_0x6e4f('0x1'));var logger=require('../../config/logger')(_0x6e4f('0x2'));var moment=require(_0x6e4f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6e4f('0x4'));var rimraf=require(_0x6e4f('0x5'));var config=require(_0x6e4f('0x6'));var attributes=require('./userOpenchannelQueue.attributes');module[_0x6e4f('0x7')]=function(_0x30e41b,_0x393ba6){return _0x30e41b[_0x6e4f('0x8')](_0x6e4f('0x9'),attributes,{'tableName':_0x6e4f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8eae=['UserOpenchannelQueue','lodash','util','moment','request-promise','../../config/environment','exports','define'];(function(_0x549558,_0x5f2f3e){var _0x4cb338=function(_0x183a71){while(--_0x183a71){_0x549558['push'](_0x549558['shift']());}};_0x4cb338(++_0x5f2f3e);}(_0x8eae,0xe1));var _0xe8ea=function(_0x24487f,_0x9b3ea0){_0x24487f=_0x24487f-0x0;var _0x456456=_0x8eae[_0x24487f];return _0x456456;};'use strict';var _=require(_0xe8ea('0x0'));var util=require(_0xe8ea('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe8ea('0x2'));var BPromise=require('bluebird');var rp=require(_0xe8ea('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe8ea('0x4'));var attributes=require('./userOpenchannelQueue.attributes');module[_0xe8ea('0x5')]=function(_0x5919ab,_0x556e67){return _0x5919ab[_0xe8ea('0x6')](_0xe8ea('0x7'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index 7dc1633..c7356ac 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 _0x6152=['../../config/environment','client','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x1ac894,_0x39b96a){var _0x4f39d7=function(_0x35be9f){while(--_0x35be9f){_0x1ac894['push'](_0x1ac894['shift']());}};_0x4f39d7(++_0x39b96a);}(_0x6152,0x65));var _0x2615=function(_0x1fd407,_0x525625){_0x1fd407=_0x1fd407-0x0;var _0x59dc05=_0x6152[_0x1fd407];return _0x59dc05;};'use strict';var _=require(_0x2615('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2615('0x1'));var rs=require(_0x2615('0x2'));var fs=require('fs');var Redis=require(_0x2615('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2615('0x4'));var logger=require(_0x2615('0x5'))(_0x2615('0x6'));var config=require(_0x2615('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2615('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ca586,_0x482b77,_0x1a3dd5){return new BPromise(function(_0x1507d8,_0x456c7c){return client[_0x2615('0x9')](_0x4ca586,_0x1a3dd5)[_0x2615('0xa')](function(_0x582f93){logger[_0x2615('0xb')](_0x2615('0xc'),_0x482b77,_0x2615('0xd'));logger['debug']('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x482b77,_0x2615('0xd'),JSON[_0x2615('0xe')](_0x582f93));if(_0x582f93[_0x2615('0xf')]){if(_0x582f93[_0x2615('0xf')][_0x2615('0x10')]===0x1f4){logger[_0x2615('0xf')](_0x2615('0xc'),_0x482b77,_0x582f93[_0x2615('0xf')][_0x2615('0x11')]);return _0x456c7c(_0x582f93['error'][_0x2615('0x11')]);}logger[_0x2615('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x482b77,_0x582f93[_0x2615('0xf')]['message']);return _0x1507d8(_0x582f93[_0x2615('0xf')][_0x2615('0x11')]);}else{logger[_0x2615('0xb')](_0x2615('0xc'),_0x482b77,_0x2615('0xd'));_0x1507d8(_0x582f93['result'][_0x2615('0x11')]);}})['catch'](function(_0x172194){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x482b77,_0x172194);_0x456c7c(_0x172194);});});} \ No newline at end of file +var _0xc590=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0xc2ae65,_0x521a25){var _0x589a02=function(_0x4fdf2c){while(--_0x4fdf2c){_0xc2ae65['push'](_0xc2ae65['shift']());}};_0x589a02(++_0x521a25);}(_0xc590,0xdd));var _0x0c59=function(_0x413972,_0x541e36){_0x413972=_0x413972-0x0;var _0x211476=_0xc590[_0x413972];return _0x211476;};'use strict';var _=require(_0x0c59('0x0'));var util=require(_0x0c59('0x1'));var moment=require('moment');var BPromise=require(_0x0c59('0x2'));var rs=require(_0x0c59('0x3'));var fs=require('fs');var Redis=require(_0x0c59('0x4'));var db=require(_0x0c59('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0c59('0x6'))(_0x0c59('0x7'));var config=require(_0x0c59('0x8'));var jayson=require(_0x0c59('0x9'));var client=jayson[_0x0c59('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25aa90,_0x3933ec,_0x4f5deb){return new BPromise(function(_0x35f60f,_0xa7a932){return client[_0x0c59('0xb')](_0x25aa90,_0x4f5deb)['then'](function(_0x3ef699){logger[_0x0c59('0xc')](_0x0c59('0xd'),_0x3933ec,_0x0c59('0xe'));logger['debug'](_0x0c59('0xf'),_0x3933ec,'request\x20sent',JSON[_0x0c59('0x10')](_0x3ef699));if(_0x3ef699['error']){if(_0x3ef699[_0x0c59('0x11')][_0x0c59('0x12')]===0x1f4){logger[_0x0c59('0x11')](_0x0c59('0xd'),_0x3933ec,_0x3ef699['error'][_0x0c59('0x13')]);return _0xa7a932(_0x3ef699[_0x0c59('0x11')][_0x0c59('0x13')]);}logger[_0x0c59('0x11')](_0x0c59('0xd'),_0x3933ec,_0x3ef699[_0x0c59('0x11')][_0x0c59('0x13')]);return _0x35f60f(_0x3ef699[_0x0c59('0x11')][_0x0c59('0x13')]);}else{logger[_0x0c59('0xc')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x3933ec,_0x0c59('0xe'));_0x35f60f(_0x3ef699[_0x0c59('0x14')]['message']);}})[_0x0c59('0x15')](function(_0x3ec751){logger[_0x0c59('0x11')](_0x0c59('0xd'),_0x3933ec,_0x3ec751);_0xa7a932(_0x3ec751);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index fbdb5a3..2e19e4e 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 _0x6c70=['removeSections','removeResources','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfile.controller','get','isAuthenticated','show','getSections','getResources','post','create','/:id/clone','clone','/:id/sections','addSections','/:id/resources','addResources','put','/:id','update','delete','destroy'];(function(_0x360118,_0x184862){var _0x45da64=function(_0x28d35d){while(--_0x28d35d){_0x360118['push'](_0x360118['shift']());}};_0x45da64(++_0x184862);}(_0x6c70,0x1f0));var _0x06c7=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0x6c70[_0xa6cc5c];return _0x44803d;};'use strict';var multer=require('multer');var util=require(_0x06c7('0x0'));var path=require('path');var timeout=require(_0x06c7('0x1'));var express=require(_0x06c7('0x2'));var router=express[_0x06c7('0x3')]();var fs_extra=require(_0x06c7('0x4'));var auth=require(_0x06c7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x06c7('0x6'));var controller=require(_0x06c7('0x7'));router[_0x06c7('0x8')]('/',auth[_0x06c7('0x9')](),controller['index']);router['get']('/describe',auth[_0x06c7('0x9')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x06c7('0xa')]);router[_0x06c7('0x8')]('/:id/sections',auth['isAuthenticated'](),controller[_0x06c7('0xb')]);router[_0x06c7('0x8')]('/:id/resources',auth[_0x06c7('0x9')](),controller[_0x06c7('0xc')]);router[_0x06c7('0xd')]('/',auth['isAuthenticated'](),controller[_0x06c7('0xe')]);router['post'](_0x06c7('0xf'),auth['isAuthenticated'](),controller[_0x06c7('0x10')]);router[_0x06c7('0xd')](_0x06c7('0x11'),auth[_0x06c7('0x9')](),controller[_0x06c7('0x12')]);router[_0x06c7('0xd')](_0x06c7('0x13'),auth[_0x06c7('0x9')](),controller[_0x06c7('0x14')]);router[_0x06c7('0x15')](_0x06c7('0x16'),auth['isAuthenticated'](),controller[_0x06c7('0x17')]);router[_0x06c7('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x06c7('0x19')]);router[_0x06c7('0x18')](_0x06c7('0x11'),auth[_0x06c7('0x9')](),controller[_0x06c7('0x1a')]);router[_0x06c7('0x18')]('/:id/resources',auth[_0x06c7('0x9')](),controller[_0x06c7('0x1b')]);module[_0x06c7('0x1c')]=router; \ No newline at end of file +var _0x2d38=['addSections','addResources','put','/:id','update','delete','removeResources','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','/describe','describe','show','/:id/sections','getSections','/:id/resources','post'];(function(_0xb09819,_0x4a58f7){var _0x813d0=function(_0x57633d){while(--_0x57633d){_0xb09819['push'](_0xb09819['shift']());}};_0x813d0(++_0x4a58f7);}(_0x2d38,0x14c));var _0x82d3=function(_0x17531a,_0x4119d3){_0x17531a=_0x17531a-0x0;var _0x3a3050=_0x2d38[_0x17531a];return _0x3a3050;};'use strict';var multer=require(_0x82d3('0x0'));var util=require(_0x82d3('0x1'));var path=require(_0x82d3('0x2'));var timeout=require(_0x82d3('0x3'));var express=require(_0x82d3('0x4'));var router=express[_0x82d3('0x5')]();var fs_extra=require(_0x82d3('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x82d3('0x7'));var config=require(_0x82d3('0x8'));var controller=require(_0x82d3('0x9'));router[_0x82d3('0xa')]('/',auth[_0x82d3('0xb')](),controller['index']);router[_0x82d3('0xa')](_0x82d3('0xc'),auth['isAuthenticated'](),controller[_0x82d3('0xd')]);router[_0x82d3('0xa')]('/:id',auth[_0x82d3('0xb')](),controller[_0x82d3('0xe')]);router['get'](_0x82d3('0xf'),auth[_0x82d3('0xb')](),controller[_0x82d3('0x10')]);router[_0x82d3('0xa')](_0x82d3('0x11'),auth['isAuthenticated'](),controller['getResources']);router[_0x82d3('0x12')]('/',auth[_0x82d3('0xb')](),controller['create']);router[_0x82d3('0x12')]('/:id/clone',auth[_0x82d3('0xb')](),controller['clone']);router[_0x82d3('0x12')](_0x82d3('0xf'),auth[_0x82d3('0xb')](),controller[_0x82d3('0x13')]);router[_0x82d3('0x12')](_0x82d3('0x11'),auth['isAuthenticated'](),controller[_0x82d3('0x14')]);router[_0x82d3('0x15')](_0x82d3('0x16'),auth[_0x82d3('0xb')](),controller[_0x82d3('0x17')]);router[_0x82d3('0x18')]('/:id',auth[_0x82d3('0xb')](),controller['destroy']);router[_0x82d3('0x18')](_0x82d3('0xf'),auth[_0x82d3('0xb')](),controller['removeSections']);router[_0x82d3('0x18')]('/:id/resources',auth[_0x82d3('0xb')](),controller[_0x82d3('0x19')]);module[_0x82d3('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 6ce0850..03e9131 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 _0x9ab2=['getDataValue','crudPermissions','split','BOOLEAN','exports','STRING','name','join'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0x9ab2,0xbc));var _0x29ab=function(_0x2ff462,_0x5d38f9){_0x2ff462=_0x2ff462-0x0;var _0x5c32a6=_0x9ab2[_0x2ff462];return _0x5c32a6;};'use strict';var Sequelize=require('sequelize');module[_0x29ab('0x0')]={'name':{'type':Sequelize[_0x29ab('0x1')],'allowNull':![],'unique':_0x29ab('0x2')},'crudPermissions':{'type':Sequelize[_0x29ab('0x1')],'set':function(_0x44b1c4){this['setDataValue']('crudPermissions',_0x44b1c4?_0x44b1c4[_0x29ab('0x3')](''):[]);},'get':function(){return this[_0x29ab('0x4')](_0x29ab('0x5'))?this[_0x29ab('0x4')](_0x29ab('0x5'))[_0x29ab('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x29ab('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x29ab('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x29ab('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x29ab('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x29ab('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x29ab('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0x92d5=['join','getDataValue','split','STRING','BOOLEAN','sequelize','exports','setDataValue','crudPermissions'];(function(_0x332141,_0x4bb5ae){var _0x534d63=function(_0x3b200a){while(--_0x3b200a){_0x332141['push'](_0x332141['shift']());}};_0x534d63(++_0x4bb5ae);}(_0x92d5,0x12e));var _0x592d=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x92d5[_0x6c993a];return _0x27f547;};'use strict';var Sequelize=require(_0x592d('0x0'));module[_0x592d('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x454b10){this[_0x592d('0x2')](_0x592d('0x3'),_0x454b10?_0x454b10[_0x592d('0x4')](''):[]);},'get':function(){return this[_0x592d('0x5')](_0x592d('0x3'))?this[_0x592d('0x5')](_0x592d('0x3'))[_0x592d('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x592d('0x7')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x592d('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x592d('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x592d('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x592d('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x592d('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x592d('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index ba3661e..8251a87 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 _0x43ed=['transaction','UserProfileSection','each','sectionId','userProfileId','Resources','describe','addSections','UserProfileResource','removeSections','ids','getSections','includes','isEmpty','subsections','enabled','push','autoAssociation','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','hasOwnProperty','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','update','then','destroy','error','stack','name','send','map','UserProfile','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','clone','get','createdAt','crudPermissions','omit','updatedAt','sequelize'];(function(_0x533852,_0x5e1347){var _0x3b39f2=function(_0x37711a){while(--_0x37711a){_0x533852['push'](_0x533852['shift']());}};_0x3b39f2(++_0x5e1347);}(_0x43ed,0x1ec));var _0xd43e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x43ed[_0x49ca18];return _0x145d54;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd43e('0x0'));var zipdir=require(_0xd43e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd43e('0x2'));var BPromise=require(_0xd43e('0x3'));var Mustache=require('mustache');var util=require(_0xd43e('0x4'));var path=require(_0xd43e('0x5'));var sox=require(_0xd43e('0x6'));var csv=require(_0xd43e('0x7'));var ejs=require(_0xd43e('0x8'));var fs=require('fs');var fs_extra=require(_0xd43e('0x9'));var _=require('lodash');var squel=require(_0xd43e('0xa'));var crypto=require(_0xd43e('0xb'));var jsforce=require(_0xd43e('0xc'));var deskjs=require(_0xd43e('0xd'));var toCsv=require(_0xd43e('0x7'));var querystring=require('querystring');var Papa=require(_0xd43e('0xe'));var Redis=require(_0xd43e('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xd43e('0x10'));var as=require(_0xd43e('0x11'));var hardwareService=require(_0xd43e('0x12'));var logger=require('../../config/logger')(_0xd43e('0x13'));var utils=require(_0xd43e('0x14'));var config=require(_0xd43e('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xd43e('0x16'))['db'];config[_0xd43e('0x17')]=_[_0xd43e('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd43e('0x19'))(new Redis(config[_0xd43e('0x17')]));require('./userProfile.socket')[_0xd43e('0x1a')](socket);function respondWithStatusCode(_0xb0db7a,_0x38b424){_0x38b424=_0x38b424||0xcc;return function(_0x591060){if(_0x591060){return _0xb0db7a[_0xd43e('0x1b')](_0x38b424);}return _0xb0db7a[_0xd43e('0x1c')](_0x38b424)[_0xd43e('0x1d')]();};}function respondWithResult(_0x4f6117,_0x368497){_0x368497=_0x368497||0xc8;return function(_0x37b9f3){if(_0x37b9f3){return _0x4f6117[_0xd43e('0x1c')](_0x368497)['json'](_0x37b9f3);}};}function respondWithFilteredResult(_0x5f07c9,_0x565158){return function(_0x2bc3e7){if(_0x2bc3e7){var _0x4facb2=typeof _0x565158[_0xd43e('0x1e')]===_0xd43e('0x1f')&&typeof _0x565158[_0xd43e('0x20')]==='undefined';var _0xb7f45f=_0x2bc3e7[_0xd43e('0x21')];var _0x46f10a=_0x4facb2?0x0:_0x565158[_0xd43e('0x1e')];var _0x17bab9=_0x4facb2?_0x2bc3e7[_0xd43e('0x21')]:_0x565158[_0xd43e('0x1e')]+_0x565158[_0xd43e('0x20')];var _0x305b9e;if(_0x17bab9>=_0xb7f45f){_0x17bab9=_0xb7f45f;_0x305b9e=0xc8;}else{_0x305b9e=0xce;}_0x5f07c9[_0xd43e('0x1c')](_0x305b9e);return _0x5f07c9[_0xd43e('0x22')]('Content-Range',_0x46f10a+'-'+_0x17bab9+'/'+_0xb7f45f)[_0xd43e('0x23')](_0x2bc3e7);}return null;};}function patchUpdates(_0x69272){return function(_0x3c5e62){try{jsonpatch[_0xd43e('0x24')](_0x3c5e62,_0x69272,!![]);}catch(_0x181382){return BPromise['reject'](_0x181382);}return _0x3c5e62['save']();};}function saveUpdates(_0x1129a7,_0x324dc8){return function(_0x3e841a){if(_0x3e841a){return _0x3e841a[_0xd43e('0x25')](_0x1129a7)[_0xd43e('0x26')](function(_0x14b405){return _0x14b405;});}return null;};}function removeEntity(_0x396b4c,_0x4f877e){return function(_0x2639d8){if(_0x2639d8){return _0x2639d8[_0xd43e('0x27')]()[_0xd43e('0x26')](function(){_0x396b4c[_0xd43e('0x1c')](0xcc)[_0xd43e('0x1d')]();});}};}function handleEntityNotFound(_0x368ca5,_0x5209a9){return function(_0xcbf93a){if(!_0xcbf93a){_0x368ca5[_0xd43e('0x1b')](0x194);}return _0xcbf93a;};}function handleError(_0x3e649a,_0x2198bd){_0x2198bd=_0x2198bd||0x1f4;return function(_0x54a76f){logger[_0xd43e('0x28')](_0x54a76f[_0xd43e('0x29')]);if(_0x54a76f[_0xd43e('0x2a')]){delete _0x54a76f['name'];}_0x3e649a[_0xd43e('0x1c')](_0x2198bd)[_0xd43e('0x2b')](_0x54a76f);};}exports['index']=function(_0x50676a,_0x59fe17){var _0xc41586={},_0x4f6986={},_0x349971={'count':0x0,'rows':[]};var _0x3e2be3=_[_0xd43e('0x2c')](db[_0xd43e('0x2d')][_0xd43e('0x2e')],function(_0x325250){return{'name':_0x325250[_0xd43e('0x2f')],'type':_0x325250['type'][_0xd43e('0x30')]};});_0x4f6986['model']=_['map'](_0x3e2be3,'name');_0x4f6986[_0xd43e('0x31')]=_[_0xd43e('0x32')](_0x50676a[_0xd43e('0x31')]);_0x4f6986[_0xd43e('0x33')]=_[_0xd43e('0x34')](_0x4f6986[_0xd43e('0x35')],_0x4f6986[_0xd43e('0x31')]);_0xc41586[_0xd43e('0x36')]=_['intersection'](_0x4f6986['model'],qs[_0xd43e('0x37')](_0x50676a['query'][_0xd43e('0x37')]));_0xc41586[_0xd43e('0x36')]=_0xc41586[_0xd43e('0x36')][_0xd43e('0x38')]?_0xc41586['attributes']:_0x4f6986[_0xd43e('0x35')];if(!_0x50676a[_0xd43e('0x31')]['hasOwnProperty']('nolimit')){_0xc41586['limit']=qs['limit'](_0x50676a[_0xd43e('0x31')][_0xd43e('0x20')]);_0xc41586[_0xd43e('0x1e')]=qs[_0xd43e('0x1e')](_0x50676a[_0xd43e('0x31')][_0xd43e('0x1e')]);}_0xc41586[_0xd43e('0x39')]=qs['sort'](_0x50676a[_0xd43e('0x31')][_0xd43e('0x3a')]);_0xc41586[_0xd43e('0x3b')]=qs[_0xd43e('0x33')](_[_0xd43e('0x3c')](_0x50676a['query'],_0x4f6986[_0xd43e('0x33')]),_0x3e2be3);if(_0x50676a[_0xd43e('0x31')][_0xd43e('0x3d')]){_0xc41586[_0xd43e('0x3b')]=_[_0xd43e('0x3e')](_0xc41586['where'],{'$or':_['map'](_0x3e2be3,function(_0xb06b16){if(_0xb06b16[_0xd43e('0x3f')]!==_0xd43e('0x40')){var _0x519603={};_0x519603[_0xb06b16[_0xd43e('0x2a')]]={'$like':'%'+_0x50676a[_0xd43e('0x31')][_0xd43e('0x3d')]+'%'};return _0x519603;}})});}_0xc41586=_['merge']({},_0xc41586,_0x50676a[_0xd43e('0x41')]);var _0x55ca96={'where':_0xc41586[_0xd43e('0x3b')]};return db[_0xd43e('0x2d')][_0xd43e('0x21')](_0x55ca96)[_0xd43e('0x26')](function(_0xe2ce57){_0x349971['count']=_0xe2ce57;if(_0x50676a[_0xd43e('0x31')][_0xd43e('0x42')]){_0xc41586['include']=[{'all':!![]}];}return db[_0xd43e('0x2d')][_0xd43e('0x43')](_0xc41586);})['then'](function(_0x31c7d9){_0x349971[_0xd43e('0x44')]=_0x31c7d9;return _0x349971;})['then'](respondWithFilteredResult(_0x59fe17,_0xc41586))[_0xd43e('0x45')](handleError(_0x59fe17,null));};exports[_0xd43e('0x46')]=function(_0x1120fc,_0x268aca){var _0x200075={'raw':![],'where':{'id':_0x1120fc[_0xd43e('0x47')]['id']}},_0x43fbfa={};_0x43fbfa[_0xd43e('0x35')]=_[_0xd43e('0x32')](db['UserProfile'][_0xd43e('0x2e')]);_0x43fbfa['query']=_['keys'](_0x1120fc[_0xd43e('0x31')]);_0x43fbfa[_0xd43e('0x33')]=_[_0xd43e('0x34')](_0x43fbfa['model'],_0x43fbfa[_0xd43e('0x31')]);_0x200075[_0xd43e('0x36')]=_[_0xd43e('0x34')](_0x43fbfa['model'],qs[_0xd43e('0x37')](_0x1120fc[_0xd43e('0x31')]['fields']));_0x200075[_0xd43e('0x36')]=_0x200075[_0xd43e('0x36')]['length']?_0x200075['attributes']:_0x43fbfa['model'];if(_0x1120fc[_0xd43e('0x31')][_0xd43e('0x42')]){_0x200075[_0xd43e('0x48')]=[{'all':!![]}];}_0x200075=_['merge']({},_0x200075,_0x1120fc[_0xd43e('0x41')]);return db[_0xd43e('0x2d')][_0xd43e('0x49')](_0x200075)['then'](handleEntityNotFound(_0x268aca,null))['then'](respondWithResult(_0x268aca,null))[_0xd43e('0x45')](handleError(_0x268aca,null));};exports['create']=function(_0x56ce00,_0x429121){return db[_0xd43e('0x2d')][_0xd43e('0x4a')](_0x56ce00[_0xd43e('0x4b')],{})[_0xd43e('0x26')](respondWithResult(_0x429121,0xc9))[_0xd43e('0x45')](handleError(_0x429121,null));};exports[_0xd43e('0x4c')]=function(_0x585359,_0x1903fa){var _0x2b9791={'where':{'id':_0x585359[_0xd43e('0x47')]['id']}},_0x2872e0={};_0x2872e0['model']=_[_0xd43e('0x32')](db['UserProfile']['rawAttributes']);_0x2b9791[_0xd43e('0x36')]=_[_0xd43e('0x34')](_0x2872e0[_0xd43e('0x35')],qs[_0xd43e('0x37')](_0x585359['query'][_0xd43e('0x37')]));_0x2b9791[_0xd43e('0x36')]=_0x2b9791[_0xd43e('0x36')][_0xd43e('0x38')]?_0x2b9791[_0xd43e('0x36')]:_0x2872e0['model'];if(_0x585359[_0xd43e('0x31')][_0xd43e('0x42')]){_0x2b9791['include']=[{'all':!![]}];}_0x2b9791=_[_0xd43e('0x3e')]({},_0x2b9791,_0x585359[_0xd43e('0x41')]);return db[_0xd43e('0x2d')][_0xd43e('0x49')](_0x2b9791)[_0xd43e('0x26')](handleEntityNotFound(_0x1903fa,null))[_0xd43e('0x26')](function(_0x38e7b4){if(_0x38e7b4){var _0x178cc0=_0x38e7b4[_0xd43e('0x4d')]({'plain':!![]});_0x178cc0=qs['omit'](_0x178cc0,['id',_0xd43e('0x4e'),'updatedAt',_0xd43e('0x4f')]);_0x585359[_0xd43e('0x4b')]=_[_0xd43e('0x50')](_0x585359[_0xd43e('0x4b')],['id',_0xd43e('0x4e'),_0xd43e('0x51')]);return db[_0xd43e('0x52')][_0xd43e('0x53')](function(_0xc781df){return db['UserProfile']['create'](_[_0xd43e('0x3e')](_0x178cc0,_0x585359[_0xd43e('0x4b')]),{'include':_0x585359['query'][_0xd43e('0x42')]?[{'all':!![]}]:undefined,'transaction':_0xc781df})[_0xd43e('0x26')](function(_0x40a35b){var _0x5ac412=_0x40a35b[_0xd43e('0x4d')]({'plain':!![]});return db[_0xd43e('0x54')]['findAll']({'where':{'userProfileId':_0x585359[_0xd43e('0x47')]['id']},'raw':!![]})[_0xd43e('0x26')](function(_0x11f2dc){if(_0x11f2dc){return BPromise[_0xd43e('0x55')](_0x11f2dc,function(_0x35268d){return new BPromise(function(_0x51d7d3,_0x387c54){if(_0x35268d['autoAssociation']===null||_0x35268d['autoAssociation']===0x1)_0x51d7d3(null);return db['UserProfileResource'][_0xd43e('0x43')]({'where':{'sectionId':_0x35268d['id']},'raw':!![]})['then'](function(_0x2d4418){var _0x4d0332=_[_0xd43e('0x2c')](_0x2d4418,function(_0x50f810){return qs[_0xd43e('0x50')](_0x50f810,['id',_0xd43e('0x4e'),_0xd43e('0x51'),_0xd43e('0x56')]);});_0x51d7d3(_0x4d0332);})[_0xd43e('0x45')](function(_0x2ef482){_0x387c54(_0x2ef482);});})[_0xd43e('0x26')](function(_0x4081d1){var _0x324a77=qs[_0xd43e('0x50')](_0x35268d,['id',_0xd43e('0x4e'),_0xd43e('0x51')]);_0x324a77[_0xd43e('0x57')]=_0x5ac412['id'];if(_0x4081d1)_0x324a77['Resources']=_0x4081d1;return _0x324a77;})[_0xd43e('0x26')](function(_0x2c15db){return db[_0xd43e('0x54')][_0xd43e('0x4a')](_0x2c15db,{'include':[{'model':db['UserProfileResource'],'as':_0xd43e('0x58')}],'raw':!![],'transaction':_0xc781df});});})[_0xd43e('0x26')](function(){return _0x5ac412;});}});});});}})[_0xd43e('0x26')](respondWithResult(_0x1903fa,0xc9))[_0xd43e('0x45')](handleError(_0x1903fa,null));};exports[_0xd43e('0x25')]=function(_0x4382c4,_0x4e6688){if(_0x4382c4[_0xd43e('0x4b')]['id']){delete _0x4382c4['body']['id'];}return db['UserProfile'][_0xd43e('0x49')]({'where':{'id':_0x4382c4[_0xd43e('0x47')]['id']}})[_0xd43e('0x26')](handleEntityNotFound(_0x4e6688,null))[_0xd43e('0x26')](saveUpdates(_0x4382c4[_0xd43e('0x4b')],null))['then'](respondWithResult(_0x4e6688,null))[_0xd43e('0x45')](handleError(_0x4e6688,null));};exports[_0xd43e('0x27')]=function(_0x519b75,_0x193c1b){return db[_0xd43e('0x2d')][_0xd43e('0x49')]({'where':{'id':_0x519b75[_0xd43e('0x47')]['id']}})['then'](handleEntityNotFound(_0x193c1b,null))[_0xd43e('0x26')](removeEntity(_0x193c1b,null))[_0xd43e('0x45')](handleError(_0x193c1b,null));};exports[_0xd43e('0x59')]=function(_0x43d1ba,_0x3335c0){return db[_0xd43e('0x2d')]['describe']()[_0xd43e('0x26')](respondWithResult(_0x3335c0,null))[_0xd43e('0x45')](handleError(_0x3335c0,null));};exports[_0xd43e('0x5a')]=function(_0x55483d,_0x8cc4cc){var _0x12099e=_0x55483d['body'];return db['UserProfile']['find']({'where':{'id':_0x55483d[_0xd43e('0x47')]['id']}})[_0xd43e('0x26')](handleEntityNotFound(_0x8cc4cc,null))['then'](function(_0x25da62){if(_0x25da62){return db[_0xd43e('0x52')][_0xd43e('0x53')](function(_0xe7a400){return db[_0xd43e('0x54')][_0xd43e('0x27')]({'where':{'userProfileId':_0x55483d[_0xd43e('0x47')]['id'],'sectionId':_[_0xd43e('0x2c')](_0x12099e,function(_0x1e04b0){return _0x1e04b0[_0xd43e('0x56')];})},'transaction':_0xe7a400})[_0xd43e('0x26')](function(){var _0x589846=_['map'](_0x12099e,function(_0x1dab26){_0x1dab26[_0xd43e('0x57')]=_0x55483d[_0xd43e('0x47')]['id'];return _0x1dab26;});var _0x71c0b0=[];return BPromise[_0xd43e('0x55')](_0x589846,function(_0x197dbc){return db[_0xd43e('0x54')][_0xd43e('0x4a')](_0x197dbc,{'include':[{'model':db[_0xd43e('0x5b')],'as':_0xd43e('0x58')}],'raw':!![],'transaction':_0xe7a400})[_0xd43e('0x26')](function(_0x22dbe1){_0x71c0b0['push'](_0x22dbe1['get']({'plain':!![]}));});})[_0xd43e('0x26')](function(){return _0x71c0b0;});});});}})[_0xd43e('0x26')](function(_0x4927b2){return _0x4927b2;})[_0xd43e('0x26')](respondWithResult(_0x8cc4cc,null))[_0xd43e('0x45')](handleError(_0x8cc4cc,null));};exports[_0xd43e('0x5c')]=function(_0x49c420,_0x351782){var _0x463a22;return db['UserProfile'][_0xd43e('0x49')]({'where':{'id':_0x49c420['params']['id']},'attributes':['id',_0xd43e('0x2a')]})['then'](handleEntityNotFound(_0x351782,null))[_0xd43e('0x26')](function(_0xa46ecc){if(_0xa46ecc){_0x463a22=_0xa46ecc;return db['UserProfileSection'][_0xd43e('0x27')]({'where':{'userProfileId':_0x49c420['params']['id'],'sectionId':_0x49c420[_0xd43e('0x31')][_0xd43e('0x5d')]}});}})[_0xd43e('0x26')](function(){return _0x463a22;})[_0xd43e('0x26')](respondWithStatusCode(_0x351782,null))[_0xd43e('0x45')](handleError(_0x351782,null));};exports[_0xd43e('0x5e')]=function(_0x496ef8,_0x223c38){var _0x578928=[];var _0x537d82=[];return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x496ef8[_0xd43e('0x47')]['id']},'raw':!![]})[_0xd43e('0x26')](function(_0x57c0f7){_0x578928=_[_0xd43e('0x3d')](_0x57c0f7,function(_0x3ceaa3){return _0x3ceaa3['enabled']===0x1||_[_0xd43e('0x5f')]([0x3eb,0x709],_0x3ceaa3['sectionId']);});if(!_[_0xd43e('0x60')](_0x578928)){return _['map'](_0x578928,function(_0x349a1e){return _0x349a1e[_0xd43e('0x56')];});}else{return;}})['then'](function(_0x5e5b0a){if(_0x5e5b0a)_0x537d82=_0x5e5b0a;if(_[_0xd43e('0x5f')](_0x537d82,0x64)){var _0x51e8a8=_[_0xd43e('0x49')](_0x578928,{'sectionId':0x64});return hasDefaultDashboard(_0x51e8a8)[_0xd43e('0x26')](function(_0x356585){return _['map'](_0x578928,function(_0x47ae2c){if(_0x47ae2c['sectionId']===0x64){_0x47ae2c[_0xd43e('0x61')]=_0x356585;}return _0x47ae2c;});});}else{return;}})[_0xd43e('0x26')](function(_0x2bdb53){if(_0x2bdb53)_0x578928=_0x2bdb53;if(_[_0xd43e('0x5f')](_0x537d82,0x3eb)){var _0x1aa8eb=_[_0xd43e('0x49')](_0x578928,{'sectionId':0x3eb});return getCustomDashboards(_0x1aa8eb)[_0xd43e('0x26')](function(_0x5d3dc2){return _[_0xd43e('0x2c')](_0x578928,function(_0x1afb8b){if(_0x1aa8eb[_0xd43e('0x62')]){if(_0x1afb8b[_0xd43e('0x56')]===0x3eb){_0x1afb8b[_0xd43e('0x61')]=_0x5d3dc2;}}else{if(_0x1afb8b[_0xd43e('0x56')]===0x64){if(!_0x1afb8b['subsections']){_0x1afb8b[_0xd43e('0x61')]=[];}_0x1afb8b[_0xd43e('0x61')]=_0x1afb8b[_0xd43e('0x61')]['concat'](_0x5d3dc2);}}return _0x1afb8b;});});}else{return;}})['then'](function(_0x1bb351){if(_0x1bb351)_0x578928=_0x1bb351;if(_[_0xd43e('0x5f')](_0x537d82,0x709)){var _0x39bb9a=_[_0xd43e('0x49')](_0x578928,{'sectionId':0x709});return getPlugins(_0x39bb9a)['then'](function(_0x1f3a84){if(_0x39bb9a[_0xd43e('0x62')]){return _['map'](_0x578928,function(_0x1bcdc0){if(_0x1bcdc0[_0xd43e('0x56')]===0x709){_0x1bcdc0['subsections']=_0x1f3a84;}return _0x1bcdc0;});}else{var _0x532abb={'sectionId':0x76c,'enabled':0x1,'subsections':_0x1f3a84};var _0x44c3e5=_[_0xd43e('0x2c')](_0x578928);_0x44c3e5[_0xd43e('0x63')](_0x532abb);return _0x44c3e5;}});}else{return;}})['then'](function(_0x283122){if(_0x283122)_0x578928=_0x283122;return _['filter'](_0x578928,['enabled',0x1]);})[_0xd43e('0x26')](respondWithResult(_0x223c38,null))[_0xd43e('0x45')](handleError(_0x223c38,null));};function hasDefaultDashboard(_0x16b5b5){var _0x3b38c0=[0x65];return new BPromise(function(_0x4c7ca2,_0x223f9f){try{if(_0x16b5b5[_0xd43e('0x64')]){_0x4c7ca2(_0x3b38c0);}else{return db[_0xd43e('0x5b')][_0xd43e('0x65')]({'where':{'sectionId':_0x16b5b5['id']},'raw':!![]})[_0xd43e('0x26')](function(_0x3aabc1){_0x3aabc1?_0x4c7ca2(_0x3b38c0):_0x4c7ca2();});}}catch(_0x24f8ee){_0x223f9f(_0x24f8ee);}});}function getCustomDashboards(_0x1ea040){var _0x165520=[];return new BPromise(function(_0x4d14b8,_0x447b42){try{if(_0x1ea040[_0xd43e('0x64')]){return db[_0xd43e('0x66')][_0xd43e('0x43')]({'raw':!![]})['then'](function(_0x29a5b8){_0x29a5b8[_0xd43e('0x67')](function(_0x1a9054){_0x165520[_0xd43e('0x63')](_0x1a9054['id']+0x1869f);});_0x4d14b8(_0x165520);});}else{return db[_0xd43e('0x5b')]['findAll']({'where':{'sectionId':_0x1ea040['id']},'raw':!![]})['then'](function(_0x4c7851){_0x4c7851['forEach'](function(_0x11be41){_0x165520['push'](_0x11be41[_0xd43e('0x68')]+0x1869f);});_0x4d14b8(_0x165520);});}}catch(_0x3ae817){_0x447b42(_0x3ae817);}});}function getPlugins(_0x4c6fe6){var _0x4b1237=[];return new BPromise(function(_0x1bfaa4,_0xda6428){try{if(_0x4c6fe6[_0xd43e('0x64')]){return db[_0xd43e('0x69')][_0xd43e('0x43')]({'raw':!![]})[_0xd43e('0x26')](function(_0x4ac0fb){_0x4ac0fb[_0xd43e('0x67')](function(_0x472d63){_0x4b1237['push'](_0x472d63['id']+0x15b38);});_0x1bfaa4(_0x4b1237);});}else{return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x4c6fe6['id']},'raw':!![]})['then'](function(_0xe402ce){_0xe402ce[_0xd43e('0x67')](function(_0x986b6b){_0x4b1237['push'](_0x986b6b['resourceId']+0x15b38);});_0x1bfaa4(_0x4b1237);});}}catch(_0x470518){_0xda6428(_0x470518);}});}exports[_0xd43e('0x6a')]=function(_0xb3dd71,_0x12895b){return db[_0xd43e('0x2d')][_0xd43e('0x49')]({'where':{'id':_0xb3dd71[_0xd43e('0x47')]['id']}})[_0xd43e('0x26')](handleEntityNotFound(_0x12895b,null))['then'](function(_0x1d2f58){if(_0x1d2f58){return db[_0xd43e('0x52')][_0xd43e('0x53')](function(_0x880f75){return db[_0xd43e('0x54')][_0xd43e('0x43')]({'where':{'userProfileId':_0xb3dd71[_0xd43e('0x47')]['id']},'attributes':['id'],'raw':!![]})[_0xd43e('0x26')](function(_0x49d2a9){if(_0x49d2a9){return db[_0xd43e('0x54')][_0xd43e('0x27')]({'where':{'userProfileId':_0xb3dd71['params']['id'],'id':_[_0xd43e('0x2c')](_0x49d2a9,function(_0x199c4f){return _0x199c4f['id'];})},'transaction':_0x880f75});}})[_0xd43e('0x26')](function(_0x4a1e69){var _0x128f18=_['map'](_0xb3dd71[_0xd43e('0x4b')],function(_0x229ab2){_0x229ab2[_0xd43e('0x57')]=_0xb3dd71[_0xd43e('0x47')]['id'];return _0x229ab2;});return db[_0xd43e('0x54')][_0xd43e('0x6b')](_0x128f18,{'raw':!![],'transaction':_0x880f75});})[_0xd43e('0x26')](function(_0x1ecd5f){var _0x4daba9=_[_0xd43e('0x3d')](_[_0xd43e('0x2c')](_0x1ecd5f,function(_0x5db054){return _0x5db054[_0xd43e('0x4d')]({'plain':!![]});}),{'includeAll':![]});if(_0x4daba9){return db['UserProfileSection'][_0xd43e('0x43')]({'where':{'userProfileId':_0xb3dd71['params']['id'],'sectionId':_[_0xd43e('0x2c')](_0x4daba9,function(_0x29fe73){return _0x29fe73[_0xd43e('0x56')];})},'attributes':['id','sectionId'],'raw':!![]})[_0xd43e('0x26')](function(_0x3c5c71){var _0x48f889=_[_0xd43e('0x2c')](_0xb3dd71['body'],function(_0xfd246d){_0xfd246d[_0xd43e('0x57')]=_0xb3dd71[_0xd43e('0x47')]['id'];return _0xfd246d;});return db[_0xd43e('0x5b')][_0xd43e('0x6b')](_0x48f889,{'raw':!![],'transaction':_0x880f75});});}})[_0xd43e('0x45')](handleError(_0x12895b,null));});}})['then'](function(_0x201062){var _0x57d2b9=_['map'](_0x201062,function(_0x536e9b){return _0x536e9b['get']({'plain':!![]});});})['then'](respondWithResult(_0x12895b,null))[_0xd43e('0x45')](handleError(_0x12895b,null));};exports[_0xd43e('0x6c')]=function(_0x7a8141,_0x2aa9c4,_0x3f7d99){return db['UserProfile'][_0xd43e('0x49')]({'where':{'id':_0x7a8141[_0xd43e('0x47')]['id']}})[_0xd43e('0x26')](handleEntityNotFound(_0x2aa9c4,null))[_0xd43e('0x26')](function(_0x2df4d2){if(_0x2df4d2){return _0x2df4d2['removeResources'](_0x7a8141[_0xd43e('0x31')][_0xd43e('0x5d')]);}})[_0xd43e('0x26')](respondWithStatusCode(_0x2aa9c4,null))['catch'](handleError(_0x2aa9c4,null));};exports[_0xd43e('0x6d')]=function(_0x4a840d,_0x36cf43){var _0x4d1e8d={};if(!_0x4a840d['query'][_0xd43e('0x6e')])throw new Error(_0xd43e('0x6f'));if(!_0x4a840d['query'][_0xd43e('0x70')](_0xd43e('0x71'))){_0x4d1e8d['limit']=qs[_0xd43e('0x20')](_0x4a840d[_0xd43e('0x31')]['limit']);_0x4d1e8d[_0xd43e('0x1e')]=qs[_0xd43e('0x1e')](_0x4a840d[_0xd43e('0x31')]['offset']);}return db[_0xd43e('0x2d')]['find']({'where':{'id':_0x4a840d[_0xd43e('0x47')]['id']}})[_0xd43e('0x26')](function(_0x457fcd){if(!_0x457fcd)throw new Error(_0xd43e('0x72')+_0x4a840d['params']['id']);return db[_0xd43e('0x2d')][_0xd43e('0x6d')](_0x4a840d);})[_0xd43e('0x26')](respondWithFilteredResult(_0x36cf43,_0x4d1e8d))[_0xd43e('0x45')](handleError(_0x36cf43,null));}; \ No newline at end of file +var _0xe273=['localhost','./userProfile.socket','register','status','end','undefined','count','offset','limit','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','UserProfile','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','includeAll','include','findAll','catch','show','params','options','find','create','body','get','omit','createdAt','updatedAt','crudPermissions','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','describe','addSections','push','removeSections','ids','getSections','includes','isEmpty','subsections','enabled','concat','findOne','Dashboard','forEach','resourceId','Plugin','addResources','sequelize','bulkCreate','removeResources','getResources','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults'];(function(_0x3f82cd,_0x5e69d0){var _0x5979b5=function(_0x3939b4){while(--_0x3939b4){_0x3f82cd['push'](_0x3f82cd['shift']());}};_0x5979b5(++_0x5e69d0);}(_0xe273,0x1a9));var _0x3e27=function(_0x23e6bb,_0x5c2d69){_0x23e6bb=_0x23e6bb-0x0;var _0x1e3b4c=_0xe273[_0x23e6bb];return _0x1e3b4c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3e27('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3e27('0x1'));var moment=require('moment');var BPromise=require(_0x3e27('0x2'));var Mustache=require(_0x3e27('0x3'));var util=require(_0x3e27('0x4'));var path=require(_0x3e27('0x5'));var sox=require('sox');var csv=require(_0x3e27('0x6'));var ejs=require(_0x3e27('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3e27('0x8'));var squel=require(_0x3e27('0x9'));var crypto=require('crypto');var jsforce=require(_0x3e27('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x3e27('0x6'));var querystring=require('querystring');var Papa=require(_0x3e27('0xb'));var Redis=require(_0x3e27('0xc'));var authService=require(_0x3e27('0xd'));var qs=require(_0x3e27('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3e27('0xf'))(_0x3e27('0x10'));var utils=require(_0x3e27('0x11'));var config=require(_0x3e27('0x12'));var licenseUtil=require(_0x3e27('0x13'));var db=require(_0x3e27('0x14'))['db'];config[_0x3e27('0x15')]=_[_0x3e27('0x16')](config[_0x3e27('0x15')],{'host':_0x3e27('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3e27('0x15')]));require(_0x3e27('0x18'))[_0x3e27('0x19')](socket);function respondWithStatusCode(_0x2afdef,_0x336af6){_0x336af6=_0x336af6||0xcc;return function(_0x22865d){if(_0x22865d){return _0x2afdef['sendStatus'](_0x336af6);}return _0x2afdef[_0x3e27('0x1a')](_0x336af6)[_0x3e27('0x1b')]();};}function respondWithResult(_0x568da9,_0x489d4c){_0x489d4c=_0x489d4c||0xc8;return function(_0x51e8dd){if(_0x51e8dd){return _0x568da9['status'](_0x489d4c)['json'](_0x51e8dd);}};}function respondWithFilteredResult(_0x32ee79,_0x362c71){return function(_0x39ad9d){if(_0x39ad9d){var _0x2993e2=typeof _0x362c71['offset']===_0x3e27('0x1c')&&typeof _0x362c71['limit']===_0x3e27('0x1c');var _0x19ab80=_0x39ad9d[_0x3e27('0x1d')];var _0x2ceab0=_0x2993e2?0x0:_0x362c71[_0x3e27('0x1e')];var _0xa17b2d=_0x2993e2?_0x39ad9d[_0x3e27('0x1d')]:_0x362c71['offset']+_0x362c71[_0x3e27('0x1f')];var _0x5a8611;if(_0xa17b2d>=_0x19ab80){_0xa17b2d=_0x19ab80;_0x5a8611=0xc8;}else{_0x5a8611=0xce;}_0x32ee79[_0x3e27('0x1a')](_0x5a8611);return _0x32ee79['set'](_0x3e27('0x20'),_0x2ceab0+'-'+_0xa17b2d+'/'+_0x19ab80)[_0x3e27('0x21')](_0x39ad9d);}return null;};}function patchUpdates(_0x383546){return function(_0x430237){try{jsonpatch[_0x3e27('0x22')](_0x430237,_0x383546,!![]);}catch(_0x353970){return BPromise[_0x3e27('0x23')](_0x353970);}return _0x430237[_0x3e27('0x24')]();};}function saveUpdates(_0x15a9b2,_0x3fb490){return function(_0x3da93e){if(_0x3da93e){return _0x3da93e[_0x3e27('0x25')](_0x15a9b2)[_0x3e27('0x26')](function(_0x19a4b6){return _0x19a4b6;});}return null;};}function removeEntity(_0x57f373,_0x9f6ef0){return function(_0x1fcebc){if(_0x1fcebc){return _0x1fcebc[_0x3e27('0x27')]()['then'](function(){_0x57f373[_0x3e27('0x1a')](0xcc)[_0x3e27('0x1b')]();});}};}function handleEntityNotFound(_0x3809b5,_0x301e53){return function(_0x46f81e){if(!_0x46f81e){_0x3809b5['sendStatus'](0x194);}return _0x46f81e;};}function handleError(_0x57c443,_0x528ce0){_0x528ce0=_0x528ce0||0x1f4;return function(_0x3fc70e){logger['error'](_0x3fc70e[_0x3e27('0x28')]);if(_0x3fc70e[_0x3e27('0x29')]){delete _0x3fc70e[_0x3e27('0x29')];}_0x57c443[_0x3e27('0x1a')](_0x528ce0)[_0x3e27('0x2a')](_0x3fc70e);};}exports[_0x3e27('0x2b')]=function(_0x533b7b,_0x409d87){var _0x523086={},_0x5a8edd={},_0x222094={'count':0x0,'rows':[]};var _0x4d81db=_[_0x3e27('0x2c')](db[_0x3e27('0x2d')][_0x3e27('0x2e')],function(_0x4e1ede){return{'name':_0x4e1ede[_0x3e27('0x2f')],'type':_0x4e1ede['type'][_0x3e27('0x30')]};});_0x5a8edd[_0x3e27('0x31')]=_[_0x3e27('0x2c')](_0x4d81db,'name');_0x5a8edd[_0x3e27('0x32')]=_[_0x3e27('0x33')](_0x533b7b[_0x3e27('0x32')]);_0x5a8edd[_0x3e27('0x34')]=_['intersection'](_0x5a8edd['model'],_0x5a8edd[_0x3e27('0x32')]);_0x523086[_0x3e27('0x35')]=_[_0x3e27('0x36')](_0x5a8edd['model'],qs[_0x3e27('0x37')](_0x533b7b[_0x3e27('0x32')]['fields']));_0x523086[_0x3e27('0x35')]=_0x523086['attributes'][_0x3e27('0x38')]?_0x523086[_0x3e27('0x35')]:_0x5a8edd[_0x3e27('0x31')];if(!_0x533b7b[_0x3e27('0x32')][_0x3e27('0x39')](_0x3e27('0x3a'))){_0x523086[_0x3e27('0x1f')]=qs['limit'](_0x533b7b[_0x3e27('0x32')][_0x3e27('0x1f')]);_0x523086['offset']=qs[_0x3e27('0x1e')](_0x533b7b['query'][_0x3e27('0x1e')]);}_0x523086[_0x3e27('0x3b')]=qs[_0x3e27('0x3c')](_0x533b7b['query'][_0x3e27('0x3c')]);_0x523086[_0x3e27('0x3d')]=qs[_0x3e27('0x34')](_['pick'](_0x533b7b[_0x3e27('0x32')],_0x5a8edd[_0x3e27('0x34')]),_0x4d81db);if(_0x533b7b[_0x3e27('0x32')]['filter']){_0x523086['where']=_[_0x3e27('0x3e')](_0x523086['where'],{'$or':_[_0x3e27('0x2c')](_0x4d81db,function(_0xe62cd){if(_0xe62cd[_0x3e27('0x3f')]!==_0x3e27('0x40')){var _0x591e8a={};_0x591e8a[_0xe62cd[_0x3e27('0x29')]]={'$like':'%'+_0x533b7b['query'][_0x3e27('0x41')]+'%'};return _0x591e8a;}})});}_0x523086=_['merge']({},_0x523086,_0x533b7b['options']);var _0x1b5504={'where':_0x523086[_0x3e27('0x3d')]};return db['UserProfile']['count'](_0x1b5504)[_0x3e27('0x26')](function(_0x479616){_0x222094[_0x3e27('0x1d')]=_0x479616;if(_0x533b7b[_0x3e27('0x32')][_0x3e27('0x42')]){_0x523086[_0x3e27('0x43')]=[{'all':!![]}];}return db[_0x3e27('0x2d')][_0x3e27('0x44')](_0x523086);})[_0x3e27('0x26')](function(_0x24558e){_0x222094['rows']=_0x24558e;return _0x222094;})[_0x3e27('0x26')](respondWithFilteredResult(_0x409d87,_0x523086))[_0x3e27('0x45')](handleError(_0x409d87,null));};exports[_0x3e27('0x46')]=function(_0x527cbf,_0x2a87c8){var _0x4a414f={'raw':![],'where':{'id':_0x527cbf[_0x3e27('0x47')]['id']}},_0x658f04={};_0x658f04[_0x3e27('0x31')]=_['keys'](db[_0x3e27('0x2d')][_0x3e27('0x2e')]);_0x658f04[_0x3e27('0x32')]=_[_0x3e27('0x33')](_0x527cbf[_0x3e27('0x32')]);_0x658f04[_0x3e27('0x34')]=_['intersection'](_0x658f04[_0x3e27('0x31')],_0x658f04[_0x3e27('0x32')]);_0x4a414f[_0x3e27('0x35')]=_['intersection'](_0x658f04[_0x3e27('0x31')],qs[_0x3e27('0x37')](_0x527cbf[_0x3e27('0x32')]['fields']));_0x4a414f[_0x3e27('0x35')]=_0x4a414f['attributes'][_0x3e27('0x38')]?_0x4a414f['attributes']:_0x658f04[_0x3e27('0x31')];if(_0x527cbf[_0x3e27('0x32')][_0x3e27('0x42')]){_0x4a414f['include']=[{'all':!![]}];}_0x4a414f=_[_0x3e27('0x3e')]({},_0x4a414f,_0x527cbf[_0x3e27('0x48')]);return db[_0x3e27('0x2d')][_0x3e27('0x49')](_0x4a414f)[_0x3e27('0x26')](handleEntityNotFound(_0x2a87c8,null))[_0x3e27('0x26')](respondWithResult(_0x2a87c8,null))['catch'](handleError(_0x2a87c8,null));};exports[_0x3e27('0x4a')]=function(_0x27cca7,_0x2801e3){return db[_0x3e27('0x2d')][_0x3e27('0x4a')](_0x27cca7[_0x3e27('0x4b')],{})[_0x3e27('0x26')](respondWithResult(_0x2801e3,0xc9))[_0x3e27('0x45')](handleError(_0x2801e3,null));};exports['clone']=function(_0x381ccd,_0x2b211d){var _0x2b8afa={'where':{'id':_0x381ccd['params']['id']}},_0x85e63e={};_0x85e63e[_0x3e27('0x31')]=_[_0x3e27('0x33')](db['UserProfile']['rawAttributes']);_0x2b8afa[_0x3e27('0x35')]=_[_0x3e27('0x36')](_0x85e63e[_0x3e27('0x31')],qs['fields'](_0x381ccd[_0x3e27('0x32')][_0x3e27('0x37')]));_0x2b8afa[_0x3e27('0x35')]=_0x2b8afa[_0x3e27('0x35')]['length']?_0x2b8afa[_0x3e27('0x35')]:_0x85e63e[_0x3e27('0x31')];if(_0x381ccd['query']['includeAll']){_0x2b8afa['include']=[{'all':!![]}];}_0x2b8afa=_[_0x3e27('0x3e')]({},_0x2b8afa,_0x381ccd[_0x3e27('0x48')]);return db[_0x3e27('0x2d')][_0x3e27('0x49')](_0x2b8afa)[_0x3e27('0x26')](handleEntityNotFound(_0x2b211d,null))[_0x3e27('0x26')](function(_0x27b07c){if(_0x27b07c){var _0x4c6e5e=_0x27b07c[_0x3e27('0x4c')]({'plain':!![]});_0x4c6e5e=qs[_0x3e27('0x4d')](_0x4c6e5e,['id',_0x3e27('0x4e'),_0x3e27('0x4f'),_0x3e27('0x50')]);_0x381ccd[_0x3e27('0x4b')]=_['omit'](_0x381ccd[_0x3e27('0x4b')],['id','createdAt',_0x3e27('0x4f')]);return db['sequelize'][_0x3e27('0x51')](function(_0x447db6){return db[_0x3e27('0x2d')][_0x3e27('0x4a')](_[_0x3e27('0x3e')](_0x4c6e5e,_0x381ccd[_0x3e27('0x4b')]),{'include':_0x381ccd['query']['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x447db6})[_0x3e27('0x26')](function(_0x44b3c1){var _0x5ae71b=_0x44b3c1[_0x3e27('0x4c')]({'plain':!![]});return db[_0x3e27('0x52')][_0x3e27('0x44')]({'where':{'userProfileId':_0x381ccd[_0x3e27('0x47')]['id']},'raw':!![]})['then'](function(_0x29f58b){if(_0x29f58b){return BPromise[_0x3e27('0x53')](_0x29f58b,function(_0x2ceb6f){return new BPromise(function(_0x27f743,_0x4b0584){if(_0x2ceb6f[_0x3e27('0x54')]===null||_0x2ceb6f[_0x3e27('0x54')]===0x1)_0x27f743(null);return db[_0x3e27('0x55')][_0x3e27('0x44')]({'where':{'sectionId':_0x2ceb6f['id']},'raw':!![]})[_0x3e27('0x26')](function(_0x44df3c){var _0x4fee07=_['map'](_0x44df3c,function(_0x21357b){return qs[_0x3e27('0x4d')](_0x21357b,['id',_0x3e27('0x4e'),_0x3e27('0x4f'),_0x3e27('0x56')]);});_0x27f743(_0x4fee07);})[_0x3e27('0x45')](function(_0x22c81c){_0x4b0584(_0x22c81c);});})['then'](function(_0xde205c){var _0x253fad=qs[_0x3e27('0x4d')](_0x2ceb6f,['id',_0x3e27('0x4e'),_0x3e27('0x4f')]);_0x253fad[_0x3e27('0x57')]=_0x5ae71b['id'];if(_0xde205c)_0x253fad[_0x3e27('0x58')]=_0xde205c;return _0x253fad;})[_0x3e27('0x26')](function(_0x3913f6){return db[_0x3e27('0x52')][_0x3e27('0x4a')](_0x3913f6,{'include':[{'model':db[_0x3e27('0x55')],'as':_0x3e27('0x58')}],'raw':!![],'transaction':_0x447db6});});})[_0x3e27('0x26')](function(){return _0x5ae71b;});}});});});}})[_0x3e27('0x26')](respondWithResult(_0x2b211d,0xc9))[_0x3e27('0x45')](handleError(_0x2b211d,null));};exports[_0x3e27('0x25')]=function(_0xdb8428,_0x4cb2f8){if(_0xdb8428[_0x3e27('0x4b')]['id']){delete _0xdb8428[_0x3e27('0x4b')]['id'];}return db['UserProfile'][_0x3e27('0x49')]({'where':{'id':_0xdb8428['params']['id']}})[_0x3e27('0x26')](handleEntityNotFound(_0x4cb2f8,null))[_0x3e27('0x26')](saveUpdates(_0xdb8428[_0x3e27('0x4b')],null))[_0x3e27('0x26')](respondWithResult(_0x4cb2f8,null))[_0x3e27('0x45')](handleError(_0x4cb2f8,null));};exports[_0x3e27('0x27')]=function(_0x4ae250,_0x50c0e4){return db[_0x3e27('0x2d')][_0x3e27('0x49')]({'where':{'id':_0x4ae250['params']['id']}})[_0x3e27('0x26')](handleEntityNotFound(_0x50c0e4,null))[_0x3e27('0x26')](removeEntity(_0x50c0e4,null))['catch'](handleError(_0x50c0e4,null));};exports[_0x3e27('0x59')]=function(_0x287ac0,_0x5aa933){return db[_0x3e27('0x2d')][_0x3e27('0x59')]()[_0x3e27('0x26')](respondWithResult(_0x5aa933,null))['catch'](handleError(_0x5aa933,null));};exports[_0x3e27('0x5a')]=function(_0x1cf6c0,_0x5d7a46){var _0xe26f98=_0x1cf6c0[_0x3e27('0x4b')];return db[_0x3e27('0x2d')][_0x3e27('0x49')]({'where':{'id':_0x1cf6c0['params']['id']}})[_0x3e27('0x26')](handleEntityNotFound(_0x5d7a46,null))['then'](function(_0x1f89b7){if(_0x1f89b7){return db['sequelize'][_0x3e27('0x51')](function(_0x4a071d){return db[_0x3e27('0x52')][_0x3e27('0x27')]({'where':{'userProfileId':_0x1cf6c0[_0x3e27('0x47')]['id'],'sectionId':_['map'](_0xe26f98,function(_0xc4660a){return _0xc4660a[_0x3e27('0x56')];})},'transaction':_0x4a071d})[_0x3e27('0x26')](function(){var _0x5e4804=_[_0x3e27('0x2c')](_0xe26f98,function(_0x2b1608){_0x2b1608[_0x3e27('0x57')]=_0x1cf6c0[_0x3e27('0x47')]['id'];return _0x2b1608;});var _0x4f1a28=[];return BPromise['each'](_0x5e4804,function(_0x391035){return db[_0x3e27('0x52')][_0x3e27('0x4a')](_0x391035,{'include':[{'model':db['UserProfileResource'],'as':_0x3e27('0x58')}],'raw':!![],'transaction':_0x4a071d})[_0x3e27('0x26')](function(_0xbf64df){_0x4f1a28[_0x3e27('0x5b')](_0xbf64df[_0x3e27('0x4c')]({'plain':!![]}));});})[_0x3e27('0x26')](function(){return _0x4f1a28;});});});}})[_0x3e27('0x26')](function(_0x518446){return _0x518446;})[_0x3e27('0x26')](respondWithResult(_0x5d7a46,null))[_0x3e27('0x45')](handleError(_0x5d7a46,null));};exports[_0x3e27('0x5c')]=function(_0x219068,_0x3c34a4){var _0x23ee28;return db[_0x3e27('0x2d')][_0x3e27('0x49')]({'where':{'id':_0x219068[_0x3e27('0x47')]['id']},'attributes':['id','name']})['then'](handleEntityNotFound(_0x3c34a4,null))[_0x3e27('0x26')](function(_0x5a3c0a){if(_0x5a3c0a){_0x23ee28=_0x5a3c0a;return db['UserProfileSection'][_0x3e27('0x27')]({'where':{'userProfileId':_0x219068['params']['id'],'sectionId':_0x219068[_0x3e27('0x32')][_0x3e27('0x5d')]}});}})[_0x3e27('0x26')](function(){return _0x23ee28;})[_0x3e27('0x26')](respondWithStatusCode(_0x3c34a4,null))[_0x3e27('0x45')](handleError(_0x3c34a4,null));};exports[_0x3e27('0x5e')]=function(_0x5978a6,_0x17ac1b){var _0x12101f=[];var _0x9f4a7b=[];return db[_0x3e27('0x52')][_0x3e27('0x44')]({'where':{'userProfileId':_0x5978a6[_0x3e27('0x47')]['id']},'raw':!![]})['then'](function(_0x1fcc42){_0x12101f=_[_0x3e27('0x41')](_0x1fcc42,function(_0x298067){return _0x298067['enabled']===0x1||_[_0x3e27('0x5f')]([0x3eb,0x709],_0x298067[_0x3e27('0x56')]);});if(!_[_0x3e27('0x60')](_0x12101f)){return _[_0x3e27('0x2c')](_0x12101f,function(_0x51109f){return _0x51109f[_0x3e27('0x56')];});}else{return;}})['then'](function(_0x3c903b){if(_0x3c903b)_0x9f4a7b=_0x3c903b;if(_[_0x3e27('0x5f')](_0x9f4a7b,0x64)){var _0x302885=_[_0x3e27('0x49')](_0x12101f,{'sectionId':0x64});return hasDefaultDashboard(_0x302885)[_0x3e27('0x26')](function(_0x249489){return _['map'](_0x12101f,function(_0x34017c){if(_0x34017c[_0x3e27('0x56')]===0x64){_0x34017c[_0x3e27('0x61')]=_0x249489;}return _0x34017c;});});}else{return;}})['then'](function(_0x1639c5){if(_0x1639c5)_0x12101f=_0x1639c5;if(_[_0x3e27('0x5f')](_0x9f4a7b,0x3eb)){var _0x6fb99d=_[_0x3e27('0x49')](_0x12101f,{'sectionId':0x3eb});return getCustomDashboards(_0x6fb99d)['then'](function(_0x2b99be){return _[_0x3e27('0x2c')](_0x12101f,function(_0x207ed1){if(_0x6fb99d[_0x3e27('0x62')]){if(_0x207ed1[_0x3e27('0x56')]===0x3eb){_0x207ed1[_0x3e27('0x61')]=_0x2b99be;}}else{if(_0x207ed1[_0x3e27('0x56')]===0x64){if(!_0x207ed1[_0x3e27('0x61')]){_0x207ed1['subsections']=[];}_0x207ed1[_0x3e27('0x61')]=_0x207ed1[_0x3e27('0x61')][_0x3e27('0x63')](_0x2b99be);}}return _0x207ed1;});});}else{return;}})['then'](function(_0x528cf6){if(_0x528cf6)_0x12101f=_0x528cf6;if(_[_0x3e27('0x5f')](_0x9f4a7b,0x709)){var _0xb7a40b=_[_0x3e27('0x49')](_0x12101f,{'sectionId':0x709});return getPlugins(_0xb7a40b)[_0x3e27('0x26')](function(_0x262a05){if(_0xb7a40b['enabled']){return _[_0x3e27('0x2c')](_0x12101f,function(_0x13f9a7){if(_0x13f9a7[_0x3e27('0x56')]===0x709){_0x13f9a7[_0x3e27('0x61')]=_0x262a05;}return _0x13f9a7;});}else{var _0xea0fa9={'sectionId':0x76c,'enabled':0x1,'subsections':_0x262a05};var _0x3561c1=_[_0x3e27('0x2c')](_0x12101f);_0x3561c1[_0x3e27('0x5b')](_0xea0fa9);return _0x3561c1;}});}else{return;}})[_0x3e27('0x26')](function(_0x4d5968){if(_0x4d5968)_0x12101f=_0x4d5968;return _[_0x3e27('0x41')](_0x12101f,[_0x3e27('0x62'),0x1]);})['then'](respondWithResult(_0x17ac1b,null))[_0x3e27('0x45')](handleError(_0x17ac1b,null));};function hasDefaultDashboard(_0x2ef051){var _0x313c34=[0x65];return new BPromise(function(_0x522939,_0x23c495){try{if(_0x2ef051[_0x3e27('0x54')]){_0x522939(_0x313c34);}else{return db[_0x3e27('0x55')][_0x3e27('0x64')]({'where':{'sectionId':_0x2ef051['id']},'raw':!![]})['then'](function(_0x2699a0){_0x2699a0?_0x522939(_0x313c34):_0x522939();});}}catch(_0x204d7b){_0x23c495(_0x204d7b);}});}function getCustomDashboards(_0x831af3){var _0x5d43b3=[];return new BPromise(function(_0x3c78ca,_0x549fd4){try{if(_0x831af3[_0x3e27('0x54')]){return db[_0x3e27('0x65')][_0x3e27('0x44')]({'raw':!![]})[_0x3e27('0x26')](function(_0x29f668){_0x29f668[_0x3e27('0x66')](function(_0x483df4){_0x5d43b3['push'](_0x483df4['id']+0x1869f);});_0x3c78ca(_0x5d43b3);});}else{return db[_0x3e27('0x55')]['findAll']({'where':{'sectionId':_0x831af3['id']},'raw':!![]})[_0x3e27('0x26')](function(_0x51d343){_0x51d343['forEach'](function(_0x299e09){_0x5d43b3[_0x3e27('0x5b')](_0x299e09[_0x3e27('0x67')]+0x1869f);});_0x3c78ca(_0x5d43b3);});}}catch(_0x5c3f66){_0x549fd4(_0x5c3f66);}});}function getPlugins(_0x5bf946){var _0xdcc0b2=[];return new BPromise(function(_0x20f408,_0x21300){try{if(_0x5bf946[_0x3e27('0x54')]){return db[_0x3e27('0x68')][_0x3e27('0x44')]({'raw':!![]})[_0x3e27('0x26')](function(_0x21327c){_0x21327c[_0x3e27('0x66')](function(_0x4e7bec){_0xdcc0b2['push'](_0x4e7bec['id']+0x15b38);});_0x20f408(_0xdcc0b2);});}else{return db['UserProfileResource'][_0x3e27('0x44')]({'where':{'sectionId':_0x5bf946['id']},'raw':!![]})[_0x3e27('0x26')](function(_0x5e9235){_0x5e9235[_0x3e27('0x66')](function(_0x193c12){_0xdcc0b2[_0x3e27('0x5b')](_0x193c12['resourceId']+0x15b38);});_0x20f408(_0xdcc0b2);});}}catch(_0x307fd1){_0x21300(_0x307fd1);}});}exports[_0x3e27('0x69')]=function(_0x3d090a,_0x4e1dd4){return db[_0x3e27('0x2d')][_0x3e27('0x49')]({'where':{'id':_0x3d090a['params']['id']}})[_0x3e27('0x26')](handleEntityNotFound(_0x4e1dd4,null))[_0x3e27('0x26')](function(_0x2dba51){if(_0x2dba51){return db[_0x3e27('0x6a')]['transaction'](function(_0x6e3c1){return db['UserProfileSection'][_0x3e27('0x44')]({'where':{'userProfileId':_0x3d090a[_0x3e27('0x47')]['id']},'attributes':['id'],'raw':!![]})[_0x3e27('0x26')](function(_0x4b2d31){if(_0x4b2d31){return db[_0x3e27('0x52')][_0x3e27('0x27')]({'where':{'userProfileId':_0x3d090a[_0x3e27('0x47')]['id'],'id':_[_0x3e27('0x2c')](_0x4b2d31,function(_0x2e0a8a){return _0x2e0a8a['id'];})},'transaction':_0x6e3c1});}})[_0x3e27('0x26')](function(_0x5b7bc7){var _0x26a860=_[_0x3e27('0x2c')](_0x3d090a['body'],function(_0x37d19f){_0x37d19f[_0x3e27('0x57')]=_0x3d090a[_0x3e27('0x47')]['id'];return _0x37d19f;});return db['UserProfileSection'][_0x3e27('0x6b')](_0x26a860,{'raw':!![],'transaction':_0x6e3c1});})[_0x3e27('0x26')](function(_0x13b14e){var _0x86d555=_[_0x3e27('0x41')](_[_0x3e27('0x2c')](_0x13b14e,function(_0x24ce73){return _0x24ce73[_0x3e27('0x4c')]({'plain':!![]});}),{'includeAll':![]});if(_0x86d555){return db[_0x3e27('0x52')][_0x3e27('0x44')]({'where':{'userProfileId':_0x3d090a[_0x3e27('0x47')]['id'],'sectionId':_['map'](_0x86d555,function(_0x550964){return _0x550964[_0x3e27('0x56')];})},'attributes':['id',_0x3e27('0x56')],'raw':!![]})[_0x3e27('0x26')](function(_0xf4bd55){var _0x2b4799=_['map'](_0x3d090a[_0x3e27('0x4b')],function(_0x4d38f7){_0x4d38f7[_0x3e27('0x57')]=_0x3d090a['params']['id'];return _0x4d38f7;});return db['UserProfileResource'][_0x3e27('0x6b')](_0x2b4799,{'raw':!![],'transaction':_0x6e3c1});});}})['catch'](handleError(_0x4e1dd4,null));});}})[_0x3e27('0x26')](function(_0x249762){var _0x1f3e73=_[_0x3e27('0x2c')](_0x249762,function(_0x51af0e){return _0x51af0e[_0x3e27('0x4c')]({'plain':!![]});});})[_0x3e27('0x26')](respondWithResult(_0x4e1dd4,null))[_0x3e27('0x45')](handleError(_0x4e1dd4,null));};exports[_0x3e27('0x6c')]=function(_0x25eb70,_0x1cc4f5,_0x396fdf){return db['UserProfile']['find']({'where':{'id':_0x25eb70[_0x3e27('0x47')]['id']}})[_0x3e27('0x26')](handleEntityNotFound(_0x1cc4f5,null))['then'](function(_0x33db2a){if(_0x33db2a){return _0x33db2a[_0x3e27('0x6c')](_0x25eb70[_0x3e27('0x32')]['ids']);}})[_0x3e27('0x26')](respondWithStatusCode(_0x1cc4f5,null))[_0x3e27('0x45')](handleError(_0x1cc4f5,null));};exports[_0x3e27('0x6d')]=function(_0x3988c7,_0xf9b7bf){var _0x524815={};if(!_0x3988c7[_0x3e27('0x32')]['section'])throw new Error(_0x3e27('0x6e'));if(!_0x3988c7[_0x3e27('0x32')][_0x3e27('0x39')](_0x3e27('0x3a'))){_0x524815[_0x3e27('0x1f')]=qs[_0x3e27('0x1f')](_0x3988c7[_0x3e27('0x32')][_0x3e27('0x1f')]);_0x524815[_0x3e27('0x1e')]=qs[_0x3e27('0x1e')](_0x3988c7['query']['offset']);}return db[_0x3e27('0x2d')][_0x3e27('0x49')]({'where':{'id':_0x3988c7[_0x3e27('0x47')]['id']}})['then'](function(_0x25c916){if(!_0x25c916)throw new Error(_0x3e27('0x6f')+_0x3988c7[_0x3e27('0x47')]['id']);return db[_0x3e27('0x2d')]['getResources'](_0x3988c7);})[_0x3e27('0x26')](respondWithFilteredResult(_0xf9b7bf,_0x524815))['catch'](handleError(_0xf9b7bf,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index b46e77c..8717b37 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 _0xdec3=['hook','exports','events','UserProfile','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0xa116d5,_0x4dc2a6){var _0x3b94bf=function(_0x39dabf){while(--_0x39dabf){_0xa116d5['push'](_0xa116d5['shift']());}};_0x3b94bf(++_0x4dc2a6);}(_0xdec3,0x89));var _0x3dec=function(_0x4bca31,_0x394def){_0x4bca31=_0x4bca31-0x0;var _0x49816d=_0xdec3[_0x4bca31];return _0x49816d;};'use strict';var EventEmitter=require(_0x3dec('0x0'));var UserProfile=require('../../mysqldb')['db'][_0x3dec('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x3dec('0x2')](0x0);var events={'afterCreate':_0x3dec('0x3'),'afterUpdate':'update','afterDestroy':_0x3dec('0x4')};function emitEvent(_0x2821f7){return function(_0x16966b,_0x113b21,_0x5ca438){UserProfileEvents[_0x3dec('0x5')](_0x2821f7+':'+_0x16966b['id'],_0x16966b);UserProfileEvents[_0x3dec('0x5')](_0x2821f7,_0x16966b);_0x5ca438(null);};}for(var e in events){if(events[_0x3dec('0x6')](e)){var event=events[e];UserProfile[_0x3dec('0x7')](e,emitEvent(event));}}module[_0x3dec('0x8')]=UserProfileEvents; \ No newline at end of file +var _0xdf55=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x40d1b5,_0x100bdc){var _0x3bd1fa=function(_0xb37dd0){while(--_0xb37dd0){_0x40d1b5['push'](_0x40d1b5['shift']());}};_0x3bd1fa(++_0x100bdc);}(_0xdf55,0x83));var _0x5df5=function(_0xfbb2c4,_0x26b45a){_0xfbb2c4=_0xfbb2c4-0x0;var _0x440158=_0xdf55[_0xfbb2c4];return _0x440158;};'use strict';var EventEmitter=require(_0x5df5('0x0'));var UserProfile=require(_0x5df5('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x5df5('0x2')](0x0);var events={'afterCreate':_0x5df5('0x3'),'afterUpdate':'update','afterDestroy':_0x5df5('0x4')};function emitEvent(_0x773e15){return function(_0x381a4c,_0x521007,_0x289af4){UserProfileEvents[_0x5df5('0x5')](_0x773e15+':'+_0x381a4c['id'],_0x381a4c);UserProfileEvents[_0x5df5('0x5')](_0x773e15,_0x381a4c);_0x289af4(null);};}for(var e in events){if(events[_0x5df5('0x6')](e)){var event=events[e];UserProfile[_0x5df5('0x7')](e,emitEvent(event));}}module[_0x5df5('0x8')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 720637d..d331965 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 _0xf04e=['Campaign','mailqueues','MailQueue','mailaccounts','MailSubstatus','OpenchannelQueue','smsqueues','smsaccounts','SmsAccount','whatsappqueues','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','VoiceQueues','users','telephones','Users','admin','user','zendeskaccounts','salesforceaccounts','freshdeskaccounts','FreshdeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','tags','Tag','templates','Template','triggers','Trigger','Trunk','variables','Variable','plugins','Plugin','extractedreports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','QueryTypes','SELECT','ui.','ui.createdAt','from','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','toString','define','UserProfile','user_profiles','../../components/parsers/qs','raw','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','ignore','union','autoAssociation','rawAttributes','keys','filters','attributes','intersection','fields','hasOwnProperty','limit','offset','order','sort','pick','merge','key','VIRTUAL','foreignKey','forEach','options','includeAll','include','findAll','reportType','default','DefaultReports','custom','CustomReports','count','rows','ids','customSorting','extraQueryConditions','Tags','tag','ThroughTags','color','openTabs','true','dataValues','sms','fax','mail','openchannel','whatsapp','all','./userProfile.attributes','squel','exports','models','filter','then','associatedResources','map','catch','field','value','model','name','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','projectName','JscriptyProject','contacts','CmContact','parentSections','Lists','ListId','lists','CmList','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','faxaccounts','FaxAccount','internalroutes','outboundroutes','VoiceExtension','contexts','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','User','role','agent','Telephones','queue','VoiceQueue','inbound','QueueCampaigns','musiconholds','VoiceMusicOnHold','chanspies','voiceprefixes','ivrcampaigns'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf04e,0x84));var _0xef04=function(_0x14d228,_0x3d2674){_0x14d228=_0x14d228-0x0;var _0x1ddf91=_0xf04e[_0x14d228];return _0x1ddf91;};'use strict';var _=require('lodash');var attributes=require(_0xef04('0x0'));var squel=require(_0xef04('0x1'));module[_0xef04('0x2')]=function(_0x4a939f){var _0x154ad3=_0x4a939f[_0xef04('0x3')];function _0x561147(_0xfae872,_0x407759){return new Promise(function(_0x2b362a,_0xc9be29){if(!_0x407759)return _0x2b362a(null);var _0x1a8c49=_0x407759[_0xef04('0x4')]?{[_0x407759[_0xef04('0x4')]['field']]:_0x407759['filter']['value']}:undefined;return _0x154ad3[_0xfae872]['findAll']({'where':_0x1a8c49,'raw':!![]})[_0xef04('0x5')](function(_0x1b49dc){_0x407759[_0xef04('0x6')]=_[_0xef04('0x7')](_0x1b49dc,'id');_0x2b362a(_0x407759);})[_0xef04('0x8')](function(_0x22441e){_0xc9be29(_0x22441e);});});}function _0x316679(_0x1add01,_0x235131){return new Promise(function(_0x280bea,_0x427d1e){var _0x12c728=_0x1add01[_0xef04('0x4')]?{[_0x1add01[_0xef04('0x4')][_0xef04('0x9')]]:_0x1add01['filter'][_0xef04('0xa')]}:undefined;return _0x154ad3[_0x1add01[_0xef04('0xb')]]['findAll']({'where':_0x12c728,'raw':!![]})[_0xef04('0x5')](function(_0x12c9b7){_0x235131[_0xef04('0x6')]=_[_0xef04('0x7')](_0x12c9b7,function(_0x1d8e54){return _0x1d8e54[_0xef04('0xc')];});_0x280bea(_0x235131);})[_0xef04('0x8')](function(_0x74fe25){_0x427d1e(_0x74fe25);});});}function _0x14499f(_0x21bbef,_0x4ffac3,_0x1f4184){if(!_0x4ffac3)return Promise[_0xef04('0xd')](null);return new Promise(function(_0x132e89,_0x32820a){return _0x154ad3[_0xef04('0xe')]['findAll']({'where':{'sectionId':_0x4ffac3['id']},'raw':!![]})['then'](function(_0x3a02fd){if(_0x21bbef[_0xef04('0x9')]&&_0x21bbef[_0xef04('0x9')]!=='id'){_0x4ffac3[_0xef04('0x6')]=_[_0xef04('0x7')](_0x3a02fd,function(_0x1afdeb){return _0x1afdeb[_0x21bbef[_0xef04('0x9')]];});}else{if(_0x1f4184===_0xef04('0xf')){_0x4ffac3['associatedResources']=_[_0xef04('0x7')](_0x3a02fd,function(_0x330f6b){return{'id':_0x330f6b[_0xef04('0x10')],'type':_0x330f6b[_0xef04('0x11')]};});}else{_0x4ffac3[_0xef04('0x6')]=_[_0xef04('0x7')](_0x3a02fd,function(_0x53ee6d){return _0x53ee6d[_0xef04('0x10')];});}}_0x132e89(_0x4ffac3);})[_0xef04('0x8')](function(_0x29f40e){_0x32820a(_0x29f40e);});});}function _0x38edf4(_0x4a8a62,_0x326004){var _0x283315={'parentSections':[]};switch(_0x4a8a62['toLowerCase']()){case _0xef04('0x12'):_0x283315[_0xef04('0x13')]=_0xef04('0x14');break;case _0xef04('0x15'):_0x283315[_0xef04('0x13')]=_0xef04('0x16');break;case _0xef04('0x17'):_0x283315[_0xef04('0x13')]='SquareRecording';_0x283315['parentSections']=[{'name':'SquareProjects','field':_0xef04('0xc'),'foreignKey':_0xef04('0x18')}];break;case'projects':_0x283315['childModel']=_0xef04('0x19');break;case _0xef04('0x1a'):_0x283315[_0xef04('0x13')]=_0xef04('0x1b');_0x283315[_0xef04('0x1c')]=[{'name':_0xef04('0x1d'),'field':'id','foreignKey':_0xef04('0x1e')}];break;case _0xef04('0x1f'):_0x283315['childModel']=_0xef04('0x20');break;case'companies':_0x283315[_0xef04('0x13')]=_0xef04('0x21');break;case _0xef04('0x22'):_0x283315[_0xef04('0x13')]=_0xef04('0x23');break;case _0xef04('0x24'):_0x283315['childModel']=_0xef04('0x25');break;case _0xef04('0x26'):_0x283315[_0xef04('0x13')]='ChatWebsite';break;case'faxqueues':_0x283315[_0xef04('0x13')]='FaxQueue';break;case _0xef04('0x27'):_0x283315['childModel']=_0xef04('0x28');break;case'inboundroutes':case _0xef04('0x29'):case _0xef04('0x2a'):_0x283315[_0xef04('0x13')]=_0xef04('0x2b');break;case _0xef04('0x2c'):_0x283315['childModel']='VoiceContext';break;case _0xef04('0x2d'):_0x283315['childModel']=_0xef04('0x2e');break;case _0xef04('0x2f'):_0x283315['childModel']=_0xef04('0x30');_0x283315[_0xef04('0x1c')]=[{'name':_0xef04('0x31'),'field':_0xef04('0xc'),'foreignKey':_0xef04('0x32'),'model':_0xef04('0x33'),'filter':{'field':_0xef04('0x34'),'value':[_0xef04('0x35')]}},{'name':_0xef04('0x36'),'field':_0xef04('0xc'),'foreignKey':_0xef04('0x32'),'model':_0xef04('0x33'),'filter':{'field':_0xef04('0x34'),'value':['telephone']}},{'name':'VoiceQueues','field':_0xef04('0xc'),'foreignKey':_0xef04('0x37'),'model':_0xef04('0x38'),'filter':{'field':_0xef04('0x11'),'value':[_0xef04('0x39')]}},{'name':_0xef04('0x3a'),'field':_0xef04('0xc'),'foreignKey':_0xef04('0x37'),'model':_0xef04('0x38'),'filter':{'field':_0xef04('0x11'),'value':['outbound']}}];break;case _0xef04('0x3b'):_0x283315[_0xef04('0x13')]=_0xef04('0x3c');break;case _0xef04('0x3d'):_0x283315[_0xef04('0x13')]='VoiceChanSpy';break;case _0xef04('0x3e'):_0x283315[_0xef04('0x13')]='VoicePrefix';break;case _0xef04('0x3f'):_0x283315[_0xef04('0x13')]=_0xef04('0x40');break;case _0xef04('0x41'):_0x283315['childModel']=_0xef04('0x42');break;case _0xef04('0x43'):_0x283315[_0xef04('0x13')]='MailAccount';break;case'mailsubstatuses':_0x283315[_0xef04('0x13')]=_0xef04('0x44');break;case'openchannelqueues':_0x283315['childModel']=_0xef04('0x45');break;case'openchannelaccounts':_0x283315['childModel']='OpenchannelAccount';break;case _0xef04('0x46'):_0x283315[_0xef04('0x13')]='SmsQueue';break;case _0xef04('0x47'):_0x283315['childModel']=_0xef04('0x48');break;case _0xef04('0x49'):_0x283315[_0xef04('0x13')]='WhatsappQueue';break;case _0xef04('0x4a'):_0x283315[_0xef04('0x13')]=_0xef04('0x4b');break;case _0xef04('0x4c'):_0x283315['childModel']=_0xef04('0x4d');break;case _0xef04('0x4e'):case _0xef04('0x4f'):_0x283315[_0xef04('0x13')]=_0xef04('0x38');if(_0x326004){_0x283315['parentSections']=[{'name':_0xef04('0x50')},{'name':'QueueCampaigns'}];}break;case _0xef04('0x51'):case'agents':case _0xef04('0x52'):_0x283315[_0xef04('0x13')]=_0xef04('0x33');if(_0x326004){_0x283315[_0xef04('0x1c')]=[{'name':_0xef04('0x53'),'filter':{'field':'role','value':[_0xef04('0x54'),_0xef04('0x55')]},'ignore':!![]},{'name':_0xef04('0x31')},{'name':_0xef04('0x36')}];}break;case _0xef04('0x56'):_0x283315['childModel']='ZendeskAccount';break;case _0xef04('0x57'):_0x283315['childModel']='SalesforceAccount';break;case _0xef04('0x58'):_0x283315[_0xef04('0x13')]=_0xef04('0x59');break;case'sugarcrmaccounts':_0x283315[_0xef04('0x13')]='SugarcrmAccount';break;case'deskaccounts':_0x283315[_0xef04('0x13')]='DeskAccount';break;case _0xef04('0x5a'):_0x283315[_0xef04('0x13')]=_0xef04('0x5b');break;case _0xef04('0x5c'):_0x283315[_0xef04('0x13')]=_0xef04('0x33');break;case _0xef04('0x5d'):_0x283315[_0xef04('0x13')]=_0xef04('0x5e');break;case _0xef04('0x5f'):_0x283315[_0xef04('0x13')]=_0xef04('0x60');break;case _0xef04('0x61'):_0x283315['childModel']=_0xef04('0x62');break;case _0xef04('0x63'):_0x283315[_0xef04('0x13')]=_0xef04('0x64');break;case _0xef04('0x65'):_0x283315[_0xef04('0x13')]=_0xef04('0x66');break;case _0xef04('0x67'):_0x283315['childModel']=_0xef04('0x68');break;case _0xef04('0x69'):_0x283315[_0xef04('0x13')]=_0xef04('0x6a');break;case _0xef04('0x6b'):_0x283315['childModel']=_0xef04('0x6c');break;case _0xef04('0x6d'):_0x283315[_0xef04('0x13')]=_0xef04('0x6e');break;case _0xef04('0x6f'):_0x283315[_0xef04('0x13')]=_0xef04('0x70');break;case'trunks':_0x283315[_0xef04('0x13')]=_0xef04('0x71');break;case _0xef04('0x72'):_0x283315[_0xef04('0x13')]=_0xef04('0x73');break;case _0xef04('0x74'):_0x283315['childModel']=_0xef04('0x75');break;case _0xef04('0x76'):_0x283315[_0xef04('0x13')]=_0xef04('0xf');_0x283315[_0xef04('0x1c')]=[{'name':'Reports','field':'id','foreignKey':_0xef04('0x77')}];break;case _0xef04('0x78'):_0x283315['childModel']=_0xef04('0x79');break;}return _0x283315;}function _0xe05072(_0x4fe726,_0xd41d6a){var _0x161571=_0x4fe726[_0xef04('0x7a')](0x0)[_0xef04('0x7b')]()+_0x4fe726[_0xef04('0x7c')](0x1);var _0x3af4a1={'type':_0x154ad3['Sequelize'][_0xef04('0x7d')][_0xef04('0x7e')],'raw':!![]};return new Promise(function(_0x3f3ae9,_0x5024d6){var _0x40701e=squel['select']()[_0xef04('0x9')](_0xef04('0x7f')+_0x161571+'InteractionId','id')[_0xef04('0x9')](_0xef04('0x80'))[_0xef04('0x81')]('user_has_'+_0x4fe726+_0xef04('0x82'),'ui')[_0xef04('0x83')](_0xef04('0x84'),_0xd41d6a['id']);return _0x154ad3[_0xef04('0x85')][_0xef04('0x86')](_0x40701e[_0xef04('0x87')](),_0x3af4a1)['then'](function(_0x349467){_0xd41d6a[_0x161571+'OpenTabs']=_0x349467;_0x3f3ae9(_0x349467);})[_0xef04('0x8')](function(_0x5b7784){_0x5024d6(_0x5b7784);});});}return _0x4a939f[_0xef04('0x88')](_0xef04('0x89'),attributes,{'tableName':_0xef04('0x8a'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x5b8d5a){var _0x3ffd34=require(_0xef04('0x8b'));var _0x382969={'raw':_0x5b8d5a[_0xef04('0x86')][_0xef04('0x8c')],'where':{}};var _0x255211={};var _0x53c411={'count':0x0,'rows':[]};var _0x2885c8=_0x5b8d5a[_0xef04('0x86')][_0xef04('0x8d')];var _0x22e0cf=_0x5b8d5a[_0xef04('0x86')][_0xef04('0x8e')]||![];var _0x4789a3=_0x38edf4(_0x2885c8,_0x22e0cf);if(!_0x4789a3[_0xef04('0x13')])throw new Error(_0xef04('0x8f')+_0x2885c8+'\x27');var _0x5f0bd6=[{'name':_0x2885c8}];if(!_[_0xef04('0x90')](_0x4789a3[_0xef04('0x1c')]))_0x5f0bd6=_0x4789a3[_0xef04('0x1c')];var _0x478ee2=[];for(var _0x55fb38=0x0;_0x55fb38<_0x5f0bd6[_0xef04('0x91')];_0x55fb38++){_0x478ee2[_0xef04('0x92')](_0x154ad3[_0xef04('0x93')][_0xef04('0x94')]({'where':{'userProfileId':_0x5b8d5a['params']['id'],'name':_0x5f0bd6[_0x55fb38]['name']},'raw':!![]}));}return Promise['all'](_0x478ee2)[_0xef04('0x5')](function(_0x300574){var _0x50a8cc=_[_0xef04('0x4')](_0x300574,function(_0x48b4d4){return _0x48b4d4?_0x48b4d4:undefined;});var _0x2055aa=_[_0xef04('0x4')](_0x5f0bd6,[_0xef04('0x95'),!![]]);var _0x4465c4=_[_0xef04('0x90')](_0x50a8cc)&&_[_0xef04('0x90')](_0x2055aa)?null:_[_0xef04('0x96')](_0x2055aa,_0x50a8cc);if(!_0x4465c4)return null;var _0x4628ae=[];for(var _0x234c4c=0x0;_0x234c4c<_0x4465c4[_0xef04('0x91')];_0x234c4c++){var _0x5277a1=_[_0xef04('0x94')](_0x5f0bd6,function(_0x3fb754){return _0x4465c4[_0x234c4c]?_0x3fb754[_0xef04('0xc')]===_0x4465c4[_0x234c4c][_0xef04('0xc')]:null;});if(_0x5277a1){if(_0x4465c4[_0x234c4c][_0xef04('0x95')]){_0x4628ae[_0xef04('0x92')](_0x561147(_0x4789a3['childModel'],_0x4465c4[_0x234c4c]));}else{if(!_0x4465c4[_0x234c4c][_0xef04('0x97')]){_0x4628ae['push'](_0x14499f(_0x5277a1,_0x4465c4[_0x234c4c],_0x4789a3[_0xef04('0x13')]));}else{if(_0x5277a1[_0xef04('0xb')]){_0x4628ae['push'](_0x316679(_0x5277a1,_0x4465c4[_0x234c4c]));}}}}}return Promise['all'](_0x4628ae);})[_0xef04('0x5')](function(_0x3f29f2){var _0x4a5c39=_0x3f29f2;var _0x4cdccc=null;if(_0x4a5c39){_0x4cdccc=_0x4a5c39[_0xef04('0x91')]===0x1?_0x4a5c39[0x0]:null;}if(!_0x4cdccc&&!_0x4a5c39)return _0x53c411;var _0x32db86=_0x154ad3[_0x4789a3[_0xef04('0x13')]][_0xef04('0x98')];_0x255211['model']=_[_0xef04('0x99')](_0x32db86);_0x255211[_0xef04('0x86')]=_[_0xef04('0x99')](_0x5b8d5a[_0xef04('0x86')]);_0x255211[_0xef04('0x9a')]=_['intersection'](_0x255211['model'],_0x255211[_0xef04('0x86')]);_0x382969[_0xef04('0x9b')]=_[_0xef04('0x9c')](_0x255211[_0xef04('0xb')],_0x3ffd34[_0xef04('0x9d')](_0x5b8d5a['query'][_0xef04('0x9d')]));_0x382969['attributes']=_0x382969[_0xef04('0x9b')][_0xef04('0x91')]?_0x382969['attributes']:_0x255211['model'];if(!_0x5b8d5a[_0xef04('0x86')][_0xef04('0x9e')]('nolimit')){_0x382969['limit']=_0x3ffd34[_0xef04('0x9f')](_0x5b8d5a[_0xef04('0x86')][_0xef04('0x9f')]);_0x382969[_0xef04('0xa0')]=_0x3ffd34[_0xef04('0xa0')](_0x5b8d5a[_0xef04('0x86')][_0xef04('0xa0')]);}_0x382969[_0xef04('0xa1')]=_0x3ffd34[_0xef04('0xa2')](_0x5b8d5a[_0xef04('0x86')][_0xef04('0xa2')]);_0x382969['where']=_0x3ffd34[_0xef04('0x9a')](_[_0xef04('0xa3')](_0x5b8d5a[_0xef04('0x86')],_0x255211[_0xef04('0x9a')]));if(_0x5b8d5a['query'][_0xef04('0x4')]){_0x382969[_0xef04('0x83')]=_[_0xef04('0xa4')](_0x382969[_0xef04('0x83')],{'$or':_[_0xef04('0x7')](_0x32db86,function(_0x44d106){if(_0x44d106['type'][_0xef04('0xa5')]!==_0xef04('0xa6')){var _0xe552db={};_0xe552db[_0x44d106[_0xef04('0x9')]]={'$like':'%'+_0x5b8d5a[_0xef04('0x86')][_0xef04('0x4')]+'%'};return _0xe552db;}})});}var _0xe44a16=[];var _0x4e2f06=null;var _0x51a522={};if(_0x4cdccc){_0x4e2f06=_[_0xef04('0x94')](_0x5f0bd6,['name',_0x4cdccc['name']]);if(_0x4e2f06[_0xef04('0x9')]){_0x51a522={};if(_0x4789a3[_0xef04('0x13')]===_0xef04('0xf')){_0x51a522[_0x4e2f06['foreignKey']]=_[_0xef04('0x7')](_0x4cdccc[_0xef04('0x6')],'id');}else{_0x51a522[_0x4e2f06[_0xef04('0xa7')]]=_0x4cdccc[_0xef04('0x6')];}_0xe44a16[_0xef04('0x92')](_0x51a522);}else{_0x382969[_0xef04('0x83')]['id']=_0x4cdccc['associatedResources'];}}else{for(var _0x4b9cec=0x0;_0x4b9cec<_0x4a5c39['length'];_0x4b9cec++){_0x4e2f06=_[_0xef04('0x94')](_0x5f0bd6,[_0xef04('0xc'),_0x4a5c39[_0x4b9cec][_0xef04('0xc')]]);if(_0x4e2f06['field']){_0x51a522={};_0x51a522[_0x4e2f06[_0xef04('0xa7')]]=_0x4a5c39[_0x4b9cec][_0xef04('0x6')];_0xe44a16[_0xef04('0x92')](_0x51a522);}else{if(!_0x382969[_0xef04('0x83')]['id'])_0x382969[_0xef04('0x83')]['id']=[];_0x4a5c39[_0x4b9cec][_0xef04('0x6')][_0xef04('0xa8')](function(_0x3d8236){_0x382969['where']['id'][_0xef04('0x92')](_0x3d8236);});}}}if(!_['isEmpty'](_0xe44a16)){_0x382969[_0xef04('0x83')]=_[_0xef04('0xa4')](_0x382969[_0xef04('0x83')],{'$and':{'$or':_0xe44a16}});}_0x382969=_[_0xef04('0xa4')]({},_0x382969,_0x5b8d5a[_0xef04('0xa9')]);if(_0x4cdccc&&!_0x4cdccc[_0xef04('0x97')]&&_0x4789a3[_0xef04('0x13')]===_0xef04('0xf')){if(_0x5b8d5a[_0xef04('0x86')][_0xef04('0xaa')]){_0x382969[_0xef04('0xab')]=[{'all':!![]}];}return _0x154ad3[_0x4789a3[_0xef04('0x13')]][_0xef04('0xac')](_0x382969)['then'](function(_0x5dfb69){var _0x5378df=[];_0x5dfb69[_0xef04('0xa8')](function(_0x3ecd8d){var _0x3ed2e4;switch(_0x3ecd8d[_0xef04('0xad')]){case _0xef04('0xae'):_0x3ed2e4=_['find'](_0x4cdccc[_0xef04('0x6')],function(_0xd7e562){return _0xd7e562['id']===_0x3ecd8d[_0xef04('0x77')]&&_0xd7e562[_0xef04('0x11')]===_0xef04('0xaf');});break;case _0xef04('0xb0'):_0x3ed2e4=_[_0xef04('0x94')](_0x4cdccc[_0xef04('0x6')],function(_0x446384){return _0x446384['id']===_0x3ecd8d['reportId']&&_0x446384[_0xef04('0x11')]===_0xef04('0xb1');});break;}if(_0x3ed2e4)_0x5378df[_0xef04('0x92')](_0x3ecd8d);});_0x53c411[_0xef04('0xb2')]=_0x5378df['length'];_0x53c411[_0xef04('0xb3')]=_0x5378df;return _0x53c411;});}else{if(!_[_0xef04('0x90')](_0x5b8d5a[_0xef04('0x86')][_0xef04('0xb4')])){_0x382969[_0xef04('0x83')]['id']=_0x382969[_0xef04('0x83')]['id']?_[_0xef04('0x9c')](_0x382969['where']['id'],_0x5b8d5a[_0xef04('0x86')][_0xef04('0xb4')]):_0x5b8d5a['query'][_0xef04('0xb4')];if(_0x5b8d5a[_0xef04('0x86')][_0xef04('0xb5')]){_0x382969[_0xef04('0xa1')]=_0x5b8d5a[_0xef04('0x86')][_0xef04('0xb5')];}}if(_0x5b8d5a[_0xef04('0x86')][_0xef04('0xb6')]){_0x382969['where']=_['merge'](_0x382969[_0xef04('0x83')],{'$and':_0x5b8d5a[_0xef04('0x86')][_0xef04('0xb6')]});}return _0x154ad3[_0x4789a3[_0xef04('0x13')]][_0xef04('0xb2')]({'where':_0x382969[_0xef04('0x83')]})['then'](function(_0x13bb9e){_0x53c411[_0xef04('0xb2')]=_0x13bb9e;if(_0x5b8d5a[_0xef04('0x86')][_0xef04('0xaa')]){if(_0x4789a3['childModel']===_0xef04('0x1b')){_0x382969[_0xef04('0xab')]=[{'model':_0x154ad3[_0xef04('0x6c')],'as':_0xef04('0xb7'),'attributes':['id','name','color'],'required':_0x5b8d5a[_0xef04('0x86')][_0xef04('0xb8')]?!![]:![]},{'model':_0x154ad3[_0xef04('0x6c')],'as':_0xef04('0xb9'),'attributes':['id',_0xef04('0xc'),_0xef04('0xba')],'through':_0x5b8d5a['query'][_0xef04('0xb8')]?{'attributes':[],'where':{'TagId':_0x5b8d5a[_0xef04('0x86')][_0xef04('0xb8')]||undefined}}:{},'required':_0x5b8d5a['query']['tag']?!![]:![]}];}else{_0x382969['include']=[{'all':!![]}];}}return _0x154ad3[_0x4789a3[_0xef04('0x13')]][_0xef04('0xac')](_0x382969);})['then'](function(_0x18bac1){_0x53c411['rows']=_0x18bac1;if(_0x2885c8==='Agents'&&_0x5b8d5a[_0xef04('0x86')][_0xef04('0xbb')]===_0xef04('0xbc')){var _0x55e375=[];for(var _0x31985b=0x0;_0x31985b<_0x53c411['rows']['length'];_0x31985b++){_0x55e375[_0xef04('0x92')](_0xe05072('chat',_0x53c411[_0xef04('0xb3')][_0x31985b][_0xef04('0xbd')]));_0x55e375['push'](_0xe05072(_0xef04('0xbe'),_0x53c411[_0xef04('0xb3')][_0x31985b][_0xef04('0xbd')]));_0x55e375[_0xef04('0x92')](_0xe05072(_0xef04('0xbf'),_0x53c411[_0xef04('0xb3')][_0x31985b][_0xef04('0xbd')]));_0x55e375[_0xef04('0x92')](_0xe05072(_0xef04('0xc0'),_0x53c411['rows'][_0x31985b][_0xef04('0xbd')]));_0x55e375['push'](_0xe05072(_0xef04('0xc1'),_0x53c411[_0xef04('0xb3')][_0x31985b][_0xef04('0xbd')]));_0x55e375[_0xef04('0x92')](_0xe05072(_0xef04('0xc2'),_0x53c411[_0xef04('0xb3')][_0x31985b][_0xef04('0xbd')]));}return Promise[_0xef04('0xc3')](_0x55e375)['then'](function(){return _0x53c411;});}return _0x53c411;});}});}}});}; \ No newline at end of file +var _0xfdbc=['DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','dispositions','customdashboards','intervals','scheduler','Schedule','sounds','Sound','tags','Tag','Template','Trigger','trunks','Trunk','variables','Variable','extractedreports','Reports','reportId','metrics','AnalyticMetric','toUpperCase','slice','Sequelize','QueryTypes','select','ui.','InteractionId','ui.createdAt','from','_interactions','where','sequelize','query','toString','OpenTabs','UserProfile','user_profiles','../../components/parsers/qs','raw','mergeResources','Invalid\x20section\x20\x27','length','push','UserProfileSection','all','isEmpty','union','autoAssociation','rawAttributes','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','pick','merge','key','VIRTUAL','find','foreignKey','forEach','options','includeAll','include','reportType','default','DefaultReports','CustomReports','count','rows','customSorting','Tags','color','tag','ThroughTags','true','chat','dataValues','fax','openchannel','whatsapp','lodash','./userProfile.attributes','squel','exports','models','filter','field','value','findAll','associatedResources','map','catch','model','then','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','childModel','SquareProject','squarerecordings','SquareRecording','name','projectName','JscriptyProject','contacts','CmContact','parentSections','Lists','lists','CmList','companies','CmCompany','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','VoiceExtension','contexts','VoiceContext','VoiceMail','VoiceRecording','Agents','User','role','agent','telephone','VoiceQueues','VoiceQueue','type','QueueCampaigns','queue','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','Team','voicequeues','queuecampaigns','users','telephones','Users','admin','user','salesforceaccounts','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xfdbc,0x116));var _0xcfdb=function(_0x410f8d,_0x570b5c){_0x410f8d=_0x410f8d-0x0;var _0x3e0d66=_0xfdbc[_0x410f8d];return _0x3e0d66;};'use strict';var _=require(_0xcfdb('0x0'));var attributes=require(_0xcfdb('0x1'));var squel=require(_0xcfdb('0x2'));module[_0xcfdb('0x3')]=function(_0x58e096){var _0x1391cb=_0x58e096[_0xcfdb('0x4')];function _0x2f0538(_0x1f96fa,_0x56388f){return new Promise(function(_0x2daec2,_0x378d49){if(!_0x56388f)return _0x2daec2(null);var _0x2603ef=_0x56388f[_0xcfdb('0x5')]?{[_0x56388f[_0xcfdb('0x5')][_0xcfdb('0x6')]]:_0x56388f[_0xcfdb('0x5')][_0xcfdb('0x7')]}:undefined;return _0x1391cb[_0x1f96fa][_0xcfdb('0x8')]({'where':_0x2603ef,'raw':!![]})['then'](function(_0x48263c){_0x56388f[_0xcfdb('0x9')]=_[_0xcfdb('0xa')](_0x48263c,'id');_0x2daec2(_0x56388f);})[_0xcfdb('0xb')](function(_0xd29979){_0x378d49(_0xd29979);});});}function _0x27c202(_0x3699ea,_0x5acd64){return new Promise(function(_0x8710b4,_0x233f04){var _0x5135d2=_0x3699ea['filter']?{[_0x3699ea[_0xcfdb('0x5')][_0xcfdb('0x6')]]:_0x3699ea[_0xcfdb('0x5')][_0xcfdb('0x7')]}:undefined;return _0x1391cb[_0x3699ea[_0xcfdb('0xc')]][_0xcfdb('0x8')]({'where':_0x5135d2,'raw':!![]})[_0xcfdb('0xd')](function(_0x2a85e7){_0x5acd64['associatedResources']=_[_0xcfdb('0xa')](_0x2a85e7,function(_0x47d7e7){return _0x47d7e7['name'];});_0x8710b4(_0x5acd64);})[_0xcfdb('0xb')](function(_0x5e03c6){_0x233f04(_0x5e03c6);});});}function _0x8f9ca4(_0x98347b,_0x2ffb95,_0x34de05){if(!_0x2ffb95)return Promise[_0xcfdb('0xe')](null);return new Promise(function(_0x4863fe,_0x3cd104){return _0x1391cb[_0xcfdb('0xf')][_0xcfdb('0x8')]({'where':{'sectionId':_0x2ffb95['id']},'raw':!![]})[_0xcfdb('0xd')](function(_0xa45439){if(_0x98347b['field']&&_0x98347b['field']!=='id'){_0x2ffb95[_0xcfdb('0x9')]=_[_0xcfdb('0xa')](_0xa45439,function(_0x5e388c){return _0x5e388c[_0x98347b[_0xcfdb('0x6')]];});}else{if(_0x34de05===_0xcfdb('0x10')){_0x2ffb95[_0xcfdb('0x9')]=_[_0xcfdb('0xa')](_0xa45439,function(_0x203b1b){return{'id':_0x203b1b[_0xcfdb('0x11')],'type':_0x203b1b['type']};});}else{_0x2ffb95['associatedResources']=_[_0xcfdb('0xa')](_0xa45439,function(_0x26a99c){return _0x26a99c[_0xcfdb('0x11')];});}}_0x4863fe(_0x2ffb95);})[_0xcfdb('0xb')](function(_0x490177){_0x3cd104(_0x490177);});});}function _0x35db57(_0x3e5b16,_0x33d599){var _0x3f138c={'parentSections':[]};switch(_0x3e5b16['toLowerCase']()){case'squareprojects':_0x3f138c[_0xcfdb('0x12')]=_0xcfdb('0x13');break;case'odbc':_0x3f138c[_0xcfdb('0x12')]='SquareOdbc';break;case _0xcfdb('0x14'):_0x3f138c[_0xcfdb('0x12')]=_0xcfdb('0x15');_0x3f138c['parentSections']=[{'name':'SquareProjects','field':_0xcfdb('0x16'),'foreignKey':_0xcfdb('0x17')}];break;case'projects':_0x3f138c[_0xcfdb('0x12')]=_0xcfdb('0x18');break;case _0xcfdb('0x19'):_0x3f138c[_0xcfdb('0x12')]=_0xcfdb('0x1a');_0x3f138c[_0xcfdb('0x1b')]=[{'name':_0xcfdb('0x1c'),'field':'id','foreignKey':'ListId'}];break;case _0xcfdb('0x1d'):_0x3f138c[_0xcfdb('0x12')]=_0xcfdb('0x1e');break;case _0xcfdb('0x1f'):_0x3f138c['childModel']=_0xcfdb('0x20');break;case'globalcustomfields':_0x3f138c[_0xcfdb('0x12')]=_0xcfdb('0x21');break;case _0xcfdb('0x22'):_0x3f138c['childModel']=_0xcfdb('0x23');break;case _0xcfdb('0x24'):_0x3f138c[_0xcfdb('0x12')]=_0xcfdb('0x25');break;case _0xcfdb('0x26'):_0x3f138c[_0xcfdb('0x12')]=_0xcfdb('0x27');break;case _0xcfdb('0x28'):_0x3f138c['childModel']=_0xcfdb('0x29');break;case'inboundroutes':case'internalroutes':case'outboundroutes':_0x3f138c['childModel']=_0xcfdb('0x2a');break;case _0xcfdb('0x2b'):_0x3f138c[_0xcfdb('0x12')]=_0xcfdb('0x2c');break;case'voicemails':_0x3f138c['childModel']=_0xcfdb('0x2d');break;case'voicerecordings':_0x3f138c[_0xcfdb('0x12')]=_0xcfdb('0x2e');_0x3f138c['parentSections']=[{'name':_0xcfdb('0x2f'),'field':'name','foreignKey':'membername','model':_0xcfdb('0x30'),'filter':{'field':_0xcfdb('0x31'),'value':[_0xcfdb('0x32')]}},{'name':'Telephones','field':'name','foreignKey':'membername','model':_0xcfdb('0x30'),'filter':{'field':_0xcfdb('0x31'),'value':[_0xcfdb('0x33')]}},{'name':_0xcfdb('0x34'),'field':_0xcfdb('0x16'),'foreignKey':'queue','model':_0xcfdb('0x35'),'filter':{'field':_0xcfdb('0x36'),'value':['inbound']}},{'name':_0xcfdb('0x37'),'field':_0xcfdb('0x16'),'foreignKey':_0xcfdb('0x38'),'model':_0xcfdb('0x35'),'filter':{'field':'type','value':[_0xcfdb('0x39')]}}];break;case _0xcfdb('0x3a'):_0x3f138c[_0xcfdb('0x12')]=_0xcfdb('0x3b');break;case _0xcfdb('0x3c'):_0x3f138c[_0xcfdb('0x12')]=_0xcfdb('0x3d');break;case'voiceprefixes':_0x3f138c[_0xcfdb('0x12')]=_0xcfdb('0x3e');break;case _0xcfdb('0x3f'):_0x3f138c['childModel']=_0xcfdb('0x40');break;case _0xcfdb('0x41'):_0x3f138c[_0xcfdb('0x12')]=_0xcfdb('0x42');break;case _0xcfdb('0x43'):_0x3f138c[_0xcfdb('0x12')]=_0xcfdb('0x44');break;case _0xcfdb('0x45'):_0x3f138c['childModel']=_0xcfdb('0x46');break;case _0xcfdb('0x47'):_0x3f138c['childModel']=_0xcfdb('0x48');break;case _0xcfdb('0x49'):_0x3f138c[_0xcfdb('0x12')]=_0xcfdb('0x4a');break;case _0xcfdb('0x4b'):_0x3f138c[_0xcfdb('0x12')]=_0xcfdb('0x4c');break;case _0xcfdb('0x4d'):_0x3f138c[_0xcfdb('0x12')]=_0xcfdb('0x4e');break;case _0xcfdb('0x4f'):_0x3f138c[_0xcfdb('0x12')]=_0xcfdb('0x50');break;case _0xcfdb('0x51'):_0x3f138c['childModel']='WhatsappAccount';break;case'teams':_0x3f138c[_0xcfdb('0x12')]=_0xcfdb('0x52');break;case _0xcfdb('0x53'):case _0xcfdb('0x54'):_0x3f138c[_0xcfdb('0x12')]='VoiceQueue';if(_0x33d599){_0x3f138c['parentSections']=[{'name':_0xcfdb('0x34')},{'name':_0xcfdb('0x37')}];}break;case _0xcfdb('0x55'):case'agents':case _0xcfdb('0x56'):_0x3f138c[_0xcfdb('0x12')]=_0xcfdb('0x30');if(_0x33d599){_0x3f138c[_0xcfdb('0x1b')]=[{'name':_0xcfdb('0x57'),'filter':{'field':'role','value':[_0xcfdb('0x58'),_0xcfdb('0x59')]},'ignore':!![]},{'name':_0xcfdb('0x2f')},{'name':'Telephones'}];}break;case'zendeskaccounts':_0x3f138c[_0xcfdb('0x12')]='ZendeskAccount';break;case _0xcfdb('0x5a'):_0x3f138c[_0xcfdb('0x12')]='SalesforceAccount';break;case _0xcfdb('0x5b'):_0x3f138c[_0xcfdb('0x12')]=_0xcfdb('0x5c');break;case _0xcfdb('0x5d'):_0x3f138c[_0xcfdb('0x12')]=_0xcfdb('0x5e');break;case _0xcfdb('0x5f'):_0x3f138c[_0xcfdb('0x12')]=_0xcfdb('0x60');break;case _0xcfdb('0x61'):_0x3f138c[_0xcfdb('0x12')]=_0xcfdb('0x62');break;case _0xcfdb('0x63'):_0x3f138c[_0xcfdb('0x12')]=_0xcfdb('0x30');break;case'cannedanswers':_0x3f138c['childModel']='CannedAnswer';break;case _0xcfdb('0x64'):_0x3f138c[_0xcfdb('0x12')]='Disposition';break;case _0xcfdb('0x65'):_0x3f138c[_0xcfdb('0x12')]='Dashboard';break;case _0xcfdb('0x66'):_0x3f138c[_0xcfdb('0x12')]='Interval';break;case'pauses':_0x3f138c['childModel']='Pause';break;case _0xcfdb('0x67'):_0x3f138c[_0xcfdb('0x12')]=_0xcfdb('0x68');break;case _0xcfdb('0x69'):_0x3f138c[_0xcfdb('0x12')]=_0xcfdb('0x6a');break;case _0xcfdb('0x6b'):_0x3f138c[_0xcfdb('0x12')]=_0xcfdb('0x6c');break;case'templates':_0x3f138c[_0xcfdb('0x12')]=_0xcfdb('0x6d');break;case'triggers':_0x3f138c[_0xcfdb('0x12')]=_0xcfdb('0x6e');break;case _0xcfdb('0x6f'):_0x3f138c[_0xcfdb('0x12')]=_0xcfdb('0x70');break;case _0xcfdb('0x71'):_0x3f138c['childModel']=_0xcfdb('0x72');break;case'plugins':_0x3f138c['childModel']='Plugin';break;case _0xcfdb('0x73'):_0x3f138c[_0xcfdb('0x12')]=_0xcfdb('0x10');_0x3f138c[_0xcfdb('0x1b')]=[{'name':_0xcfdb('0x74'),'field':'id','foreignKey':_0xcfdb('0x75')}];break;case _0xcfdb('0x76'):_0x3f138c['childModel']=_0xcfdb('0x77');break;}return _0x3f138c;}function _0x323bc5(_0x2da8fe,_0x2d9bc8){var _0x39f9b0=_0x2da8fe['charAt'](0x0)[_0xcfdb('0x78')]()+_0x2da8fe[_0xcfdb('0x79')](0x1);var _0xa9023f={'type':_0x1391cb[_0xcfdb('0x7a')][_0xcfdb('0x7b')]['SELECT'],'raw':!![]};return new Promise(function(_0x1b9307,_0x7ac2ad){var _0x219158=squel[_0xcfdb('0x7c')]()[_0xcfdb('0x6')](_0xcfdb('0x7d')+_0x39f9b0+_0xcfdb('0x7e'),'id')[_0xcfdb('0x6')](_0xcfdb('0x7f'))[_0xcfdb('0x80')]('user_has_'+_0x2da8fe+_0xcfdb('0x81'),'ui')[_0xcfdb('0x82')]('ui.UserId\x20=\x20?',_0x2d9bc8['id']);return _0x1391cb[_0xcfdb('0x83')][_0xcfdb('0x84')](_0x219158[_0xcfdb('0x85')](),_0xa9023f)[_0xcfdb('0xd')](function(_0x33dca6){_0x2d9bc8[_0x39f9b0+_0xcfdb('0x86')]=_0x33dca6;_0x1b9307(_0x33dca6);})[_0xcfdb('0xb')](function(_0x7fda53){_0x7ac2ad(_0x7fda53);});});}return _0x58e096['define'](_0xcfdb('0x87'),attributes,{'tableName':_0xcfdb('0x88'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x36e690){var _0x253af7=require(_0xcfdb('0x89'));var _0x5310e1={'raw':_0x36e690['query'][_0xcfdb('0x8a')],'where':{}};var _0x1a8c8a={};var _0x22b19e={'count':0x0,'rows':[]};var _0x46e3a4=_0x36e690['query']['section'];var _0x3a306f=_0x36e690[_0xcfdb('0x84')][_0xcfdb('0x8b')]||![];var _0x594488=_0x35db57(_0x46e3a4,_0x3a306f);if(!_0x594488[_0xcfdb('0x12')])throw new Error(_0xcfdb('0x8c')+_0x46e3a4+'\x27');var _0x1b955f=[{'name':_0x46e3a4}];if(!_['isEmpty'](_0x594488['parentSections']))_0x1b955f=_0x594488[_0xcfdb('0x1b')];var _0x590bfd=[];for(var _0x3b45f4=0x0;_0x3b45f4<_0x1b955f[_0xcfdb('0x8d')];_0x3b45f4++){_0x590bfd[_0xcfdb('0x8e')](_0x1391cb[_0xcfdb('0x8f')]['find']({'where':{'userProfileId':_0x36e690['params']['id'],'name':_0x1b955f[_0x3b45f4]['name']},'raw':!![]}));}return Promise[_0xcfdb('0x90')](_0x590bfd)[_0xcfdb('0xd')](function(_0x404706){var _0x227cd3=_[_0xcfdb('0x5')](_0x404706,function(_0x2246b6){return _0x2246b6?_0x2246b6:undefined;});var _0x5207c8=_[_0xcfdb('0x5')](_0x1b955f,['ignore',!![]]);var _0x2ad220=_[_0xcfdb('0x91')](_0x227cd3)&&_[_0xcfdb('0x91')](_0x5207c8)?null:_[_0xcfdb('0x92')](_0x5207c8,_0x227cd3);if(!_0x2ad220)return null;var _0xb87816=[];for(var _0x1edcb8=0x0;_0x1edcb8<_0x2ad220[_0xcfdb('0x8d')];_0x1edcb8++){var _0x380d74=_['find'](_0x1b955f,function(_0x349f6d){return _0x2ad220[_0x1edcb8]?_0x349f6d[_0xcfdb('0x16')]===_0x2ad220[_0x1edcb8]['name']:null;});if(_0x380d74){if(_0x2ad220[_0x1edcb8]['ignore']){_0xb87816[_0xcfdb('0x8e')](_0x2f0538(_0x594488[_0xcfdb('0x12')],_0x2ad220[_0x1edcb8]));}else{if(!_0x2ad220[_0x1edcb8][_0xcfdb('0x93')]){_0xb87816['push'](_0x8f9ca4(_0x380d74,_0x2ad220[_0x1edcb8],_0x594488['childModel']));}else{if(_0x380d74[_0xcfdb('0xc')]){_0xb87816[_0xcfdb('0x8e')](_0x27c202(_0x380d74,_0x2ad220[_0x1edcb8]));}}}}}return Promise[_0xcfdb('0x90')](_0xb87816);})['then'](function(_0x4f6a0b){var _0x3de55d=_0x4f6a0b;var _0xdf3d38=null;if(_0x3de55d){_0xdf3d38=_0x3de55d[_0xcfdb('0x8d')]===0x1?_0x3de55d[0x0]:null;}if(!_0xdf3d38&&!_0x3de55d)return _0x22b19e;var _0xb7c1a8=_0x1391cb[_0x594488['childModel']][_0xcfdb('0x94')];_0x1a8c8a[_0xcfdb('0xc')]=_['keys'](_0xb7c1a8);_0x1a8c8a[_0xcfdb('0x84')]=_[_0xcfdb('0x95')](_0x36e690[_0xcfdb('0x84')]);_0x1a8c8a[_0xcfdb('0x96')]=_[_0xcfdb('0x97')](_0x1a8c8a['model'],_0x1a8c8a[_0xcfdb('0x84')]);_0x5310e1['attributes']=_[_0xcfdb('0x97')](_0x1a8c8a[_0xcfdb('0xc')],_0x253af7[_0xcfdb('0x98')](_0x36e690['query']['fields']));_0x5310e1[_0xcfdb('0x99')]=_0x5310e1[_0xcfdb('0x99')]['length']?_0x5310e1[_0xcfdb('0x99')]:_0x1a8c8a[_0xcfdb('0xc')];if(!_0x36e690[_0xcfdb('0x84')][_0xcfdb('0x9a')](_0xcfdb('0x9b'))){_0x5310e1['limit']=_0x253af7[_0xcfdb('0x9c')](_0x36e690[_0xcfdb('0x84')][_0xcfdb('0x9c')]);_0x5310e1['offset']=_0x253af7[_0xcfdb('0x9d')](_0x36e690['query'][_0xcfdb('0x9d')]);}_0x5310e1[_0xcfdb('0x9e')]=_0x253af7[_0xcfdb('0x9f')](_0x36e690[_0xcfdb('0x84')][_0xcfdb('0x9f')]);_0x5310e1['where']=_0x253af7['filters'](_[_0xcfdb('0xa0')](_0x36e690['query'],_0x1a8c8a['filters']));if(_0x36e690[_0xcfdb('0x84')][_0xcfdb('0x5')]){_0x5310e1['where']=_[_0xcfdb('0xa1')](_0x5310e1[_0xcfdb('0x82')],{'$or':_[_0xcfdb('0xa')](_0xb7c1a8,function(_0x3c3e6e){if(_0x3c3e6e[_0xcfdb('0x36')][_0xcfdb('0xa2')]!==_0xcfdb('0xa3')){var _0x13e4bb={};_0x13e4bb[_0x3c3e6e[_0xcfdb('0x6')]]={'$like':'%'+_0x36e690[_0xcfdb('0x84')][_0xcfdb('0x5')]+'%'};return _0x13e4bb;}})});}var _0x28482d=[];var _0x18c473=null;var _0x4a441f={};if(_0xdf3d38){_0x18c473=_[_0xcfdb('0xa4')](_0x1b955f,[_0xcfdb('0x16'),_0xdf3d38['name']]);if(_0x18c473[_0xcfdb('0x6')]){_0x4a441f={};if(_0x594488[_0xcfdb('0x12')]==='AnalyticExtractedReport'){_0x4a441f[_0x18c473['foreignKey']]=_['map'](_0xdf3d38[_0xcfdb('0x9')],'id');}else{_0x4a441f[_0x18c473['foreignKey']]=_0xdf3d38[_0xcfdb('0x9')];}_0x28482d[_0xcfdb('0x8e')](_0x4a441f);}else{_0x5310e1[_0xcfdb('0x82')]['id']=_0xdf3d38[_0xcfdb('0x9')];}}else{for(var _0x50d2b4=0x0;_0x50d2b4<_0x3de55d[_0xcfdb('0x8d')];_0x50d2b4++){_0x18c473=_[_0xcfdb('0xa4')](_0x1b955f,[_0xcfdb('0x16'),_0x3de55d[_0x50d2b4][_0xcfdb('0x16')]]);if(_0x18c473[_0xcfdb('0x6')]){_0x4a441f={};_0x4a441f[_0x18c473[_0xcfdb('0xa5')]]=_0x3de55d[_0x50d2b4][_0xcfdb('0x9')];_0x28482d['push'](_0x4a441f);}else{if(!_0x5310e1['where']['id'])_0x5310e1[_0xcfdb('0x82')]['id']=[];_0x3de55d[_0x50d2b4][_0xcfdb('0x9')][_0xcfdb('0xa6')](function(_0x4240d0){_0x5310e1[_0xcfdb('0x82')]['id'][_0xcfdb('0x8e')](_0x4240d0);});}}}if(!_[_0xcfdb('0x91')](_0x28482d)){_0x5310e1[_0xcfdb('0x82')]=_['merge'](_0x5310e1['where'],{'$and':{'$or':_0x28482d}});}_0x5310e1=_[_0xcfdb('0xa1')]({},_0x5310e1,_0x36e690[_0xcfdb('0xa7')]);if(_0xdf3d38&&!_0xdf3d38[_0xcfdb('0x93')]&&_0x594488[_0xcfdb('0x12')]===_0xcfdb('0x10')){if(_0x36e690[_0xcfdb('0x84')][_0xcfdb('0xa8')]){_0x5310e1[_0xcfdb('0xa9')]=[{'all':!![]}];}return _0x1391cb[_0x594488['childModel']][_0xcfdb('0x8')](_0x5310e1)[_0xcfdb('0xd')](function(_0x37a748){var _0x206fe0=[];_0x37a748['forEach'](function(_0x30fb98){var _0x39468f;switch(_0x30fb98[_0xcfdb('0xaa')]){case _0xcfdb('0xab'):_0x39468f=_[_0xcfdb('0xa4')](_0xdf3d38[_0xcfdb('0x9')],function(_0x39b39a){return _0x39b39a['id']===_0x30fb98[_0xcfdb('0x75')]&&_0x39b39a['type']===_0xcfdb('0xac');});break;case'custom':_0x39468f=_['find'](_0xdf3d38[_0xcfdb('0x9')],function(_0x31dc64){return _0x31dc64['id']===_0x30fb98[_0xcfdb('0x75')]&&_0x31dc64[_0xcfdb('0x36')]===_0xcfdb('0xad');});break;}if(_0x39468f)_0x206fe0[_0xcfdb('0x8e')](_0x30fb98);});_0x22b19e[_0xcfdb('0xae')]=_0x206fe0['length'];_0x22b19e[_0xcfdb('0xaf')]=_0x206fe0;return _0x22b19e;});}else{if(!_['isEmpty'](_0x36e690[_0xcfdb('0x84')]['ids'])){_0x5310e1[_0xcfdb('0x82')]['id']=_0x5310e1[_0xcfdb('0x82')]['id']?_[_0xcfdb('0x97')](_0x5310e1[_0xcfdb('0x82')]['id'],_0x36e690[_0xcfdb('0x84')]['ids']):_0x36e690[_0xcfdb('0x84')]['ids'];if(_0x36e690[_0xcfdb('0x84')][_0xcfdb('0xb0')]){_0x5310e1[_0xcfdb('0x9e')]=_0x36e690[_0xcfdb('0x84')][_0xcfdb('0xb0')];}}if(_0x36e690[_0xcfdb('0x84')]['extraQueryConditions']){_0x5310e1['where']=_[_0xcfdb('0xa1')](_0x5310e1[_0xcfdb('0x82')],{'$and':_0x36e690[_0xcfdb('0x84')]['extraQueryConditions']});}return _0x1391cb[_0x594488[_0xcfdb('0x12')]][_0xcfdb('0xae')]({'where':_0x5310e1[_0xcfdb('0x82')]})[_0xcfdb('0xd')](function(_0x5f44f5){_0x22b19e[_0xcfdb('0xae')]=_0x5f44f5;if(_0x36e690[_0xcfdb('0x84')]['includeAll']){if(_0x594488[_0xcfdb('0x12')]===_0xcfdb('0x1a')){_0x5310e1['include']=[{'model':_0x1391cb[_0xcfdb('0x6c')],'as':_0xcfdb('0xb1'),'attributes':['id',_0xcfdb('0x16'),_0xcfdb('0xb2')],'required':_0x36e690[_0xcfdb('0x84')][_0xcfdb('0xb3')]?!![]:![]},{'model':_0x1391cb[_0xcfdb('0x6c')],'as':_0xcfdb('0xb4'),'attributes':['id',_0xcfdb('0x16'),_0xcfdb('0xb2')],'through':_0x36e690[_0xcfdb('0x84')][_0xcfdb('0xb3')]?{'attributes':[],'where':{'TagId':_0x36e690['query'][_0xcfdb('0xb3')]||undefined}}:{},'required':_0x36e690[_0xcfdb('0x84')]['tag']?!![]:![]}];}else{_0x5310e1[_0xcfdb('0xa9')]=[{'all':!![]}];}}return _0x1391cb[_0x594488['childModel']]['findAll'](_0x5310e1);})[_0xcfdb('0xd')](function(_0x309411){_0x22b19e['rows']=_0x309411;if(_0x46e3a4===_0xcfdb('0x2f')&&_0x36e690[_0xcfdb('0x84')]['openTabs']===_0xcfdb('0xb5')){var _0x3b7fba=[];for(var _0xc70746=0x0;_0xc70746<_0x22b19e['rows']['length'];_0xc70746++){_0x3b7fba[_0xcfdb('0x8e')](_0x323bc5(_0xcfdb('0xb6'),_0x22b19e[_0xcfdb('0xaf')][_0xc70746][_0xcfdb('0xb7')]));_0x3b7fba['push'](_0x323bc5('sms',_0x22b19e[_0xcfdb('0xaf')][_0xc70746][_0xcfdb('0xb7')]));_0x3b7fba[_0xcfdb('0x8e')](_0x323bc5(_0xcfdb('0xb8'),_0x22b19e[_0xcfdb('0xaf')][_0xc70746][_0xcfdb('0xb7')]));_0x3b7fba[_0xcfdb('0x8e')](_0x323bc5('mail',_0x22b19e['rows'][_0xc70746]['dataValues']));_0x3b7fba['push'](_0x323bc5(_0xcfdb('0xb9'),_0x22b19e[_0xcfdb('0xaf')][_0xc70746][_0xcfdb('0xb7')]));_0x3b7fba[_0xcfdb('0x8e')](_0x323bc5(_0xcfdb('0xba'),_0x22b19e['rows'][_0xc70746][_0xcfdb('0xb7')]));}return Promise[_0xcfdb('0x90')](_0x3b7fba)[_0xcfdb('0xd')](function(){return _0x22b19e;});}return _0x22b19e;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 686a1be..8739d21 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 _0xe953=['defaults','localhost','socket.io-emitter','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http'];(function(_0x21437b,_0x4a0300){var _0x57bf08=function(_0x1f4c72){while(--_0x1f4c72){_0x21437b['push'](_0x21437b['shift']());}};_0x57bf08(++_0x4a0300);}(_0xe953,0xf9));var _0x3e95=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0xe953[_0x2642cb];return _0xe6e41;};'use strict';var _=require(_0x3e95('0x0'));var util=require(_0x3e95('0x1'));var moment=require(_0x3e95('0x2'));var BPromise=require('bluebird');var rs=require(_0x3e95('0x3'));var fs=require('fs');var Redis=require(_0x3e95('0x4'));var db=require(_0x3e95('0x5'))['db'];var utils=require(_0x3e95('0x6'));var logger=require(_0x3e95('0x7'))(_0x3e95('0x8'));var config=require(_0x3e95('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3e95('0xa')]({'port':0x232a});config['redis']=_[_0x3e95('0xb')](config['redis'],{'host':_0x3e95('0xc'),'port':0x18eb});var socket=require(_0x3e95('0xd'))(new Redis(config['redis']));require('./userProfile.socket')[_0x3e95('0xe')](socket);function respondWithRpcPromise(_0x521403,_0x44996c,_0x478d4d){return new BPromise(function(_0x569b9d,_0x369081){return client[_0x3e95('0xf')](_0x521403,_0x478d4d)[_0x3e95('0x10')](function(_0x4882e3){logger[_0x3e95('0x11')](_0x3e95('0x12'),_0x44996c,_0x3e95('0x13'));logger[_0x3e95('0x14')](_0x3e95('0x15'),_0x44996c,'request\x20sent',JSON[_0x3e95('0x16')](_0x4882e3));if(_0x4882e3[_0x3e95('0x17')]){if(_0x4882e3[_0x3e95('0x17')]['code']===0x1f4){logger[_0x3e95('0x17')](_0x3e95('0x12'),_0x44996c,_0x4882e3[_0x3e95('0x17')][_0x3e95('0x18')]);return _0x369081(_0x4882e3[_0x3e95('0x17')][_0x3e95('0x18')]);}logger[_0x3e95('0x17')]('UserProfile,\x20%s,\x20%s',_0x44996c,_0x4882e3[_0x3e95('0x17')][_0x3e95('0x18')]);return _0x569b9d(_0x4882e3[_0x3e95('0x17')]['message']);}else{logger[_0x3e95('0x11')](_0x3e95('0x12'),_0x44996c,_0x3e95('0x13'));_0x569b9d(_0x4882e3['result']['message']);}})[_0x3e95('0x19')](function(_0x56ab9b){logger['error'](_0x3e95('0x12'),_0x44996c,_0x56ab9b);_0x369081(_0x56ab9b);});});} \ No newline at end of file +var _0x5078=['info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then'];(function(_0x43df9b,_0x36ccd2){var _0xdc5a1=function(_0x575453){while(--_0x575453){_0x43df9b['push'](_0x43df9b['shift']());}};_0xdc5a1(++_0x36ccd2);}(_0x5078,0x148));var _0x8507=function(_0x27f9ff,_0x26b9c){_0x27f9ff=_0x27f9ff-0x0;var _0x349f72=_0x5078[_0x27f9ff];return _0x349f72;};'use strict';var _=require(_0x8507('0x0'));var util=require(_0x8507('0x1'));var moment=require(_0x8507('0x2'));var BPromise=require(_0x8507('0x3'));var rs=require(_0x8507('0x4'));var fs=require('fs');var Redis=require(_0x8507('0x5'));var db=require(_0x8507('0x6'))['db'];var utils=require(_0x8507('0x7'));var logger=require(_0x8507('0x8'))(_0x8507('0x9'));var config=require(_0x8507('0xa'));var jayson=require(_0x8507('0xb'));var client=jayson[_0x8507('0xc')][_0x8507('0xd')]({'port':0x232a});config[_0x8507('0xe')]=_[_0x8507('0xf')](config['redis'],{'host':_0x8507('0x10'),'port':0x18eb});var socket=require(_0x8507('0x11'))(new Redis(config[_0x8507('0xe')]));require('./userProfile.socket')['register'](socket);function respondWithRpcPromise(_0x168085,_0x1c71f5,_0x3c8478){return new BPromise(function(_0x339c13,_0x413984){return client[_0x8507('0x12')](_0x168085,_0x3c8478)[_0x8507('0x13')](function(_0x494fed){logger[_0x8507('0x14')](_0x8507('0x15'),_0x1c71f5,_0x8507('0x16'));logger[_0x8507('0x17')](_0x8507('0x18'),_0x1c71f5,_0x8507('0x16'),JSON['stringify'](_0x494fed));if(_0x494fed[_0x8507('0x19')]){if(_0x494fed[_0x8507('0x19')][_0x8507('0x1a')]===0x1f4){logger[_0x8507('0x19')](_0x8507('0x15'),_0x1c71f5,_0x494fed[_0x8507('0x19')]['message']);return _0x413984(_0x494fed['error'][_0x8507('0x1b')]);}logger[_0x8507('0x19')](_0x8507('0x15'),_0x1c71f5,_0x494fed['error'][_0x8507('0x1b')]);return _0x339c13(_0x494fed[_0x8507('0x19')][_0x8507('0x1b')]);}else{logger[_0x8507('0x14')](_0x8507('0x15'),_0x1c71f5,_0x8507('0x16'));_0x339c13(_0x494fed[_0x8507('0x1c')][_0x8507('0x1b')]);}})['catch'](function(_0x5d0f74){logger[_0x8507('0x19')](_0x8507('0x15'),_0x1c71f5,_0x5d0f74);_0x413984(_0x5d0f74);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 0b6f14f..b551a0a 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 _0x4158=['./userProfile.events','save','update','removeListener','register','length','userProfile:'];(function(_0x2e6df1,_0x1b485a){var _0x421e47=function(_0x557599){while(--_0x557599){_0x2e6df1['push'](_0x2e6df1['shift']());}};_0x421e47(++_0x1b485a);}(_0x4158,0x17a));var _0x8415=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x4158[_0x1969a7];return _0x3d665f;};'use strict';var UserProfileEvents=require(_0x8415('0x0'));var events=[_0x8415('0x1'),'remove',_0x8415('0x2')];function createListener(_0x3b1756,_0x374f72){return function(_0x81d4c3){_0x374f72['emit'](_0x3b1756,_0x81d4c3);};}function removeListener(_0x3cc58e,_0x5257e0){return function(){UserProfileEvents[_0x8415('0x3')](_0x3cc58e,_0x5257e0);};}exports[_0x8415('0x4')]=function(_0x4c7393){for(var _0x5483c3=0x0,_0x336660=events[_0x8415('0x5')];_0x5483c3<_0x336660;_0x5483c3++){var _0x1e13fc=events[_0x5483c3];var _0xaa11e7=createListener(_0x8415('0x6')+_0x1e13fc,_0x4c7393);UserProfileEvents['on'](_0x1e13fc,_0xaa11e7);}}; \ No newline at end of file +var _0x8c09=['emit','removeListener','register','length','./userProfile.events','remove'];(function(_0x4e6518,_0x2bdf10){var _0x23e3e8=function(_0x3dcc3c){while(--_0x3dcc3c){_0x4e6518['push'](_0x4e6518['shift']());}};_0x23e3e8(++_0x2bdf10);}(_0x8c09,0x118));var _0x98c0=function(_0x13449c,_0x199140){_0x13449c=_0x13449c-0x0;var _0x306782=_0x8c09[_0x13449c];return _0x306782;};'use strict';var UserProfileEvents=require(_0x98c0('0x0'));var events=['save',_0x98c0('0x1'),'update'];function createListener(_0x548c82,_0x58618e){return function(_0x35bebd){_0x58618e[_0x98c0('0x2')](_0x548c82,_0x35bebd);};}function removeListener(_0x385b8d,_0x2cab90){return function(){UserProfileEvents[_0x98c0('0x3')](_0x385b8d,_0x2cab90);};}exports[_0x98c0('0x4')]=function(_0x5324f0){for(var _0xccb819=0x0,_0x11866d=events[_0x98c0('0x5')];_0xccb819<_0x11866d;_0xccb819++){var _0x184d2c=events[_0xccb819];var _0x4c70ca=createListener('userProfile:'+_0x184d2c,_0x5324f0);UserProfileEvents['on'](_0x184d2c,_0x4c70ca);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 829bb54..55985c2 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 _0x7f8d=['path','connect-timeout','express','fs-extra','../../components/interaction/service','./userProfileResource.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','destroy','multer','util'];(function(_0x4e6d29,_0x9e1341){var _0x33a3c5=function(_0x5a5be2){while(--_0x5a5be2){_0x4e6d29['push'](_0x4e6d29['shift']());}};_0x33a3c5(++_0x9e1341);}(_0x7f8d,0x1ec));var _0xd7f8=function(_0x3e9808,_0x141202){_0x3e9808=_0x3e9808-0x0;var _0xa51b7e=_0x7f8d[_0x3e9808];return _0xa51b7e;};'use strict';var multer=require(_0xd7f8('0x0'));var util=require(_0xd7f8('0x1'));var path=require(_0xd7f8('0x2'));var timeout=require(_0xd7f8('0x3'));var express=require(_0xd7f8('0x4'));var router=express['Router']();var fs_extra=require(_0xd7f8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd7f8('0x6'));var config=require('../../config/environment');var controller=require(_0xd7f8('0x7'));router[_0xd7f8('0x8')]('/',auth[_0xd7f8('0x9')](),controller[_0xd7f8('0xa')]);router[_0xd7f8('0x8')](_0xd7f8('0xb'),auth[_0xd7f8('0x9')](),controller[_0xd7f8('0xc')]);router['get'](_0xd7f8('0xd'),auth[_0xd7f8('0x9')](),controller[_0xd7f8('0xe')]);router[_0xd7f8('0xf')]('/',auth[_0xd7f8('0x9')](),controller[_0xd7f8('0x10')]);router['put'](_0xd7f8('0xd'),auth['isAuthenticated'](),controller[_0xd7f8('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xd7f8('0x12')]);module['exports']=router; \ No newline at end of file +var _0x4cdb=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','/describe','describe','show','create','update','delete','/:id'];(function(_0x517f0e,_0x557448){var _0x513b60=function(_0x8f0a20){while(--_0x8f0a20){_0x517f0e['push'](_0x517f0e['shift']());}};_0x513b60(++_0x557448);}(_0x4cdb,0x17b));var _0xb4cd=function(_0x4cd21c,_0x35fa45){_0x4cd21c=_0x4cd21c-0x0;var _0x5d8e5e=_0x4cdb[_0x4cd21c];return _0x5d8e5e;};'use strict';var multer=require(_0xb4cd('0x0'));var util=require('util');var path=require(_0xb4cd('0x1'));var timeout=require(_0xb4cd('0x2'));var express=require(_0xb4cd('0x3'));var router=express[_0xb4cd('0x4')]();var fs_extra=require(_0xb4cd('0x5'));var auth=require(_0xb4cd('0x6'));var interaction=require(_0xb4cd('0x7'));var config=require(_0xb4cd('0x8'));var controller=require(_0xb4cd('0x9'));router[_0xb4cd('0xa')]('/',auth[_0xb4cd('0xb')](),controller[_0xb4cd('0xc')]);router[_0xb4cd('0xa')](_0xb4cd('0xd'),auth['isAuthenticated'](),controller[_0xb4cd('0xe')]);router[_0xb4cd('0xa')]('/:id',auth[_0xb4cd('0xb')](),controller[_0xb4cd('0xf')]);router['post']('/',auth[_0xb4cd('0xb')](),controller[_0xb4cd('0x10')]);router['put']('/:id',auth[_0xb4cd('0xb')](),controller[_0xb4cd('0x11')]);router[_0xb4cd('0x12')](_0xb4cd('0x13'),auth[_0xb4cd('0xb')](),controller['destroy']);module[_0xb4cd('0x14')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 728dda8..6c2e6fc 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 _0x4f7c=['exports','STRING','INTEGER','sequelize'];(function(_0x3b0b92,_0x5bdef4){var _0x1239fe=function(_0x2add1b){while(--_0x2add1b){_0x3b0b92['push'](_0x3b0b92['shift']());}};_0x1239fe(++_0x5bdef4);}(_0x4f7c,0xff));var _0xc4f7=function(_0x27a36e,_0x1664b2){_0x27a36e=_0x27a36e-0x0;var _0x382947=_0x4f7c[_0x27a36e];return _0x382947;};'use strict';var Sequelize=require(_0xc4f7('0x0'));module[_0xc4f7('0x1')]={'name':{'type':Sequelize[_0xc4f7('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xc4f7('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc4f7('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x4915=['STRING','sequelize','exports','INTEGER'];(function(_0x551cc3,_0x5150a2){var _0x2b9170=function(_0x21ba10){while(--_0x21ba10){_0x551cc3['push'](_0x551cc3['shift']());}};_0x2b9170(++_0x5150a2);}(_0x4915,0x1cd));var _0x5491=function(_0x291b77,_0x36b1c2){_0x291b77=_0x291b77-0x0;var _0x138495=_0x4915[_0x291b77];return _0x138495;};'use strict';var Sequelize=require(_0x5491('0x0'));module[_0x5491('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0x5491('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x5491('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 8d801ed..d5db5f1 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 _0x4137=['key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','show','params','includeAll','options','find','catch','body','describe','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','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','json','offset','limit','count','set','apply','reject','save','update','destroy','then','end','sendStatus','error','name','send','index','map','UserProfileResource','rawAttributes','type'];(function(_0x58e32c,_0x309781){var _0x481e60=function(_0x5326ab){while(--_0x5326ab){_0x58e32c['push'](_0x58e32c['shift']());}};_0x481e60(++_0x309781);}(_0x4137,0xf8));var _0x7413=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x4137[_0x4e676e];return _0x336a3c;};'use strict';var emlformat=require(_0x7413('0x0'));var rimraf=require(_0x7413('0x1'));var zipdir=require(_0x7413('0x2'));var jsonpatch=require(_0x7413('0x3'));var rp=require(_0x7413('0x4'));var moment=require(_0x7413('0x5'));var BPromise=require(_0x7413('0x6'));var Mustache=require(_0x7413('0x7'));var util=require(_0x7413('0x8'));var path=require(_0x7413('0x9'));var sox=require(_0x7413('0xa'));var csv=require(_0x7413('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7413('0xc'));var _=require(_0x7413('0xd'));var squel=require(_0x7413('0xe'));var crypto=require(_0x7413('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x7413('0x10'));var toCsv=require(_0x7413('0xb'));var querystring=require('querystring');var Papa=require(_0x7413('0x11'));var Redis=require(_0x7413('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7413('0x13'));var as=require(_0x7413('0x14'));var hardwareService=require(_0x7413('0x15'));var logger=require(_0x7413('0x16'))(_0x7413('0x17'));var utils=require('../../config/utils');var config=require(_0x7413('0x18'));var licenseUtil=require(_0x7413('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18a874,_0xa26ca4){_0xa26ca4=_0xa26ca4||0xcc;return function(_0x13e6bd){if(_0x13e6bd){return _0x18a874['sendStatus'](_0xa26ca4);}return _0x18a874['status'](_0xa26ca4)['end']();};}function respondWithResult(_0x2267f6,_0x336c4c){_0x336c4c=_0x336c4c||0xc8;return function(_0x49f0f6){if(_0x49f0f6){return _0x2267f6[_0x7413('0x1a')](_0x336c4c)[_0x7413('0x1b')](_0x49f0f6);}};}function respondWithFilteredResult(_0x4955d3,_0x38b3d1){return function(_0x50f301){if(_0x50f301){var _0x4b9a5b=typeof _0x38b3d1[_0x7413('0x1c')]==='undefined'&&typeof _0x38b3d1[_0x7413('0x1d')]==='undefined';var _0x2036b6=_0x50f301[_0x7413('0x1e')];var _0x19157f=_0x4b9a5b?0x0:_0x38b3d1[_0x7413('0x1c')];var _0x2a3417=_0x4b9a5b?_0x50f301[_0x7413('0x1e')]:_0x38b3d1['offset']+_0x38b3d1[_0x7413('0x1d')];var _0x17c062;if(_0x2a3417>=_0x2036b6){_0x2a3417=_0x2036b6;_0x17c062=0xc8;}else{_0x17c062=0xce;}_0x4955d3[_0x7413('0x1a')](_0x17c062);return _0x4955d3[_0x7413('0x1f')]('Content-Range',_0x19157f+'-'+_0x2a3417+'/'+_0x2036b6)[_0x7413('0x1b')](_0x50f301);}return null;};}function patchUpdates(_0x12d94d){return function(_0x206afc){try{jsonpatch[_0x7413('0x20')](_0x206afc,_0x12d94d,!![]);}catch(_0x409392){return BPromise[_0x7413('0x21')](_0x409392);}return _0x206afc[_0x7413('0x22')]();};}function saveUpdates(_0x4e18cb,_0x56a06a){return function(_0x5f12a2){if(_0x5f12a2){return _0x5f12a2[_0x7413('0x23')](_0x4e18cb)['then'](function(_0x1585ba){return _0x1585ba;});}return null;};}function removeEntity(_0x372944,_0x3b0c81){return function(_0x2fc0f4){if(_0x2fc0f4){return _0x2fc0f4[_0x7413('0x24')]()[_0x7413('0x25')](function(){_0x372944[_0x7413('0x1a')](0xcc)[_0x7413('0x26')]();});}};}function handleEntityNotFound(_0x1d455b,_0x5a8329){return function(_0x5cb15f){if(!_0x5cb15f){_0x1d455b[_0x7413('0x27')](0x194);}return _0x5cb15f;};}function handleError(_0x48c2dc,_0x46c895){_0x46c895=_0x46c895||0x1f4;return function(_0x71cbb4){logger[_0x7413('0x28')](_0x71cbb4['stack']);if(_0x71cbb4[_0x7413('0x29')]){delete _0x71cbb4[_0x7413('0x29')];}_0x48c2dc[_0x7413('0x1a')](_0x46c895)[_0x7413('0x2a')](_0x71cbb4);};}exports[_0x7413('0x2b')]=function(_0x2e521f,_0x5eb4d9){var _0x24dce7={},_0x4ed662={},_0x1d0bde={'count':0x0,'rows':[]};var _0x23e682=_[_0x7413('0x2c')](db[_0x7413('0x2d')][_0x7413('0x2e')],function(_0x2004ea){return{'name':_0x2004ea['fieldName'],'type':_0x2004ea[_0x7413('0x2f')][_0x7413('0x30')]};});_0x4ed662[_0x7413('0x31')]=_[_0x7413('0x2c')](_0x23e682,_0x7413('0x29'));_0x4ed662[_0x7413('0x32')]=_[_0x7413('0x33')](_0x2e521f['query']);_0x4ed662[_0x7413('0x34')]=_[_0x7413('0x35')](_0x4ed662[_0x7413('0x31')],_0x4ed662[_0x7413('0x32')]);_0x24dce7[_0x7413('0x36')]=_['intersection'](_0x4ed662[_0x7413('0x31')],qs['fields'](_0x2e521f[_0x7413('0x32')][_0x7413('0x37')]));_0x24dce7[_0x7413('0x36')]=_0x24dce7['attributes'][_0x7413('0x38')]?_0x24dce7['attributes']:_0x4ed662[_0x7413('0x31')];if(!_0x2e521f[_0x7413('0x32')]['hasOwnProperty']('nolimit')){_0x24dce7[_0x7413('0x1d')]=qs[_0x7413('0x1d')](_0x2e521f[_0x7413('0x32')]['limit']);_0x24dce7['offset']=qs[_0x7413('0x1c')](_0x2e521f['query']['offset']);}_0x24dce7[_0x7413('0x39')]=qs['sort'](_0x2e521f[_0x7413('0x32')][_0x7413('0x3a')]);_0x24dce7[_0x7413('0x3b')]=qs[_0x7413('0x34')](_[_0x7413('0x3c')](_0x2e521f['query'],_0x4ed662[_0x7413('0x34')]),_0x23e682);if(_0x2e521f[_0x7413('0x32')][_0x7413('0x3d')]){_0x24dce7[_0x7413('0x3b')]=_[_0x7413('0x3e')](_0x24dce7[_0x7413('0x3b')],{'$or':_[_0x7413('0x2c')](_0x23e682,function(_0x385156){if(_0x385156[_0x7413('0x2f')]!==_0x7413('0x3f')){var _0x5c03eb={};_0x5c03eb[_0x385156[_0x7413('0x29')]]={'$like':'%'+_0x2e521f['query'][_0x7413('0x3d')]+'%'};return _0x5c03eb;}})});}_0x24dce7=_['merge']({},_0x24dce7,_0x2e521f['options']);var _0x5b592c={'where':_0x24dce7['where']};return db['UserProfileResource'][_0x7413('0x1e')](_0x5b592c)['then'](function(_0x535e49){_0x1d0bde[_0x7413('0x1e')]=_0x535e49;if(_0x2e521f['query']['includeAll']){_0x24dce7[_0x7413('0x40')]=[{'all':!![]}];}return db[_0x7413('0x2d')][_0x7413('0x41')](_0x24dce7);})[_0x7413('0x25')](function(_0x8049c0){_0x1d0bde['rows']=_0x8049c0;return _0x1d0bde;})[_0x7413('0x25')](respondWithFilteredResult(_0x5eb4d9,_0x24dce7))['catch'](handleError(_0x5eb4d9,null));};exports[_0x7413('0x42')]=function(_0x1d8219,_0xa063d1){var _0xfe0daa={'raw':![],'where':{'id':_0x1d8219[_0x7413('0x43')]['id']}},_0x3f7da2={};_0x3f7da2[_0x7413('0x31')]=_[_0x7413('0x33')](db[_0x7413('0x2d')][_0x7413('0x2e')]);_0x3f7da2[_0x7413('0x32')]=_[_0x7413('0x33')](_0x1d8219[_0x7413('0x32')]);_0x3f7da2['filters']=_[_0x7413('0x35')](_0x3f7da2[_0x7413('0x31')],_0x3f7da2[_0x7413('0x32')]);_0xfe0daa[_0x7413('0x36')]=_[_0x7413('0x35')](_0x3f7da2[_0x7413('0x31')],qs[_0x7413('0x37')](_0x1d8219[_0x7413('0x32')][_0x7413('0x37')]));_0xfe0daa[_0x7413('0x36')]=_0xfe0daa[_0x7413('0x36')]['length']?_0xfe0daa[_0x7413('0x36')]:_0x3f7da2['model'];if(_0x1d8219[_0x7413('0x32')][_0x7413('0x44')]){_0xfe0daa[_0x7413('0x40')]=[{'all':!![]}];}_0xfe0daa=_[_0x7413('0x3e')]({},_0xfe0daa,_0x1d8219[_0x7413('0x45')]);return db[_0x7413('0x2d')][_0x7413('0x46')](_0xfe0daa)[_0x7413('0x25')](handleEntityNotFound(_0xa063d1,null))[_0x7413('0x25')](respondWithResult(_0xa063d1,null))[_0x7413('0x47')](handleError(_0xa063d1,null));};exports['create']=function(_0x513657,_0x3c1f1a){return db['UserProfileResource']['create'](_0x513657[_0x7413('0x48')],{})[_0x7413('0x25')](respondWithResult(_0x3c1f1a,0xc9))['catch'](handleError(_0x3c1f1a,null));};exports[_0x7413('0x23')]=function(_0x586d25,_0x562bae){if(_0x586d25[_0x7413('0x48')]['id']){delete _0x586d25['body']['id'];}return db[_0x7413('0x2d')][_0x7413('0x46')]({'where':{'id':_0x586d25[_0x7413('0x43')]['id']}})[_0x7413('0x25')](handleEntityNotFound(_0x562bae,null))[_0x7413('0x25')](saveUpdates(_0x586d25[_0x7413('0x48')],null))[_0x7413('0x25')](respondWithResult(_0x562bae,null))[_0x7413('0x47')](handleError(_0x562bae,null));};exports[_0x7413('0x24')]=function(_0x2031e3,_0x50a27d){return db[_0x7413('0x2d')]['find']({'where':{'id':_0x2031e3['params']['id']}})['then'](handleEntityNotFound(_0x50a27d,null))[_0x7413('0x25')](removeEntity(_0x50a27d,null))[_0x7413('0x47')](handleError(_0x50a27d,null));};exports[_0x7413('0x49')]=function(_0x1ba4e9,_0x4bc337){return db['UserProfileResource'][_0x7413('0x49')]()['then'](respondWithResult(_0x4bc337,null))[_0x7413('0x47')](handleError(_0x4bc337,null));}; \ No newline at end of file +var _0x1883=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','UserProfileResource','includeAll','include','findAll','params','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','apply','update','then','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x4a401f,_0x5ab944){var _0x132a35=function(_0x581734){while(--_0x581734){_0x4a401f['push'](_0x4a401f['shift']());}};_0x132a35(++_0x5ab944);}(_0x1883,0xab));var _0x3188=function(_0x7ed328,_0xe45c60){_0x7ed328=_0x7ed328-0x0;var _0x532aba=_0x1883[_0x7ed328];return _0x532aba;};'use strict';var emlformat=require(_0x3188('0x0'));var rimraf=require(_0x3188('0x1'));var zipdir=require(_0x3188('0x2'));var jsonpatch=require(_0x3188('0x3'));var rp=require(_0x3188('0x4'));var moment=require(_0x3188('0x5'));var BPromise=require(_0x3188('0x6'));var Mustache=require(_0x3188('0x7'));var util=require(_0x3188('0x8'));var path=require(_0x3188('0x9'));var sox=require(_0x3188('0xa'));var csv=require(_0x3188('0xb'));var ejs=require(_0x3188('0xc'));var fs=require('fs');var fs_extra=require(_0x3188('0xd'));var _=require(_0x3188('0xe'));var squel=require(_0x3188('0xf'));var crypto=require(_0x3188('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x3188('0x11'));var toCsv=require(_0x3188('0xb'));var querystring=require('querystring');var Papa=require(_0x3188('0x12'));var Redis=require('ioredis');var authService=require(_0x3188('0x13'));var qs=require(_0x3188('0x14'));var as=require(_0x3188('0x15'));var hardwareService=require(_0x3188('0x16'));var logger=require('../../config/logger')(_0x3188('0x17'));var utils=require(_0x3188('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3188('0x19'))['db'];function respondWithStatusCode(_0x45e94e,_0x20fef6){_0x20fef6=_0x20fef6||0xcc;return function(_0x3ae228){if(_0x3ae228){return _0x45e94e[_0x3188('0x1a')](_0x20fef6);}return _0x45e94e[_0x3188('0x1b')](_0x20fef6)['end']();};}function respondWithResult(_0x276d69,_0x5e0044){_0x5e0044=_0x5e0044||0xc8;return function(_0x4a2f36){if(_0x4a2f36){return _0x276d69[_0x3188('0x1b')](_0x5e0044)['json'](_0x4a2f36);}};}function respondWithFilteredResult(_0x54a87f,_0x32c239){return function(_0x1beead){if(_0x1beead){var _0xa2269=typeof _0x32c239[_0x3188('0x1c')]===_0x3188('0x1d')&&typeof _0x32c239[_0x3188('0x1e')]==='undefined';var _0x19cc72=_0x1beead[_0x3188('0x1f')];var _0x3f5b35=_0xa2269?0x0:_0x32c239[_0x3188('0x1c')];var _0x18a71a=_0xa2269?_0x1beead[_0x3188('0x1f')]:_0x32c239[_0x3188('0x1c')]+_0x32c239[_0x3188('0x1e')];var _0x5bcbba;if(_0x18a71a>=_0x19cc72){_0x18a71a=_0x19cc72;_0x5bcbba=0xc8;}else{_0x5bcbba=0xce;}_0x54a87f[_0x3188('0x1b')](_0x5bcbba);return _0x54a87f[_0x3188('0x20')]('Content-Range',_0x3f5b35+'-'+_0x18a71a+'/'+_0x19cc72)['json'](_0x1beead);}return null;};}function patchUpdates(_0x5d8d62){return function(_0x46a318){try{jsonpatch[_0x3188('0x21')](_0x46a318,_0x5d8d62,!![]);}catch(_0xd292b5){return BPromise['reject'](_0xd292b5);}return _0x46a318['save']();};}function saveUpdates(_0x266260,_0x461286){return function(_0x375077){if(_0x375077){return _0x375077[_0x3188('0x22')](_0x266260)[_0x3188('0x23')](function(_0x4bd5ee){return _0x4bd5ee;});}return null;};}function removeEntity(_0x30cf2c,_0x33f882){return function(_0x5a2e67){if(_0x5a2e67){return _0x5a2e67[_0x3188('0x24')]()['then'](function(){_0x30cf2c['status'](0xcc)[_0x3188('0x25')]();});}};}function handleEntityNotFound(_0x129bd7,_0x87d5a3){return function(_0x1aeaba){if(!_0x1aeaba){_0x129bd7[_0x3188('0x1a')](0x194);}return _0x1aeaba;};}function handleError(_0x2cd060,_0xe57f73){_0xe57f73=_0xe57f73||0x1f4;return function(_0x11021c){logger['error'](_0x11021c[_0x3188('0x26')]);if(_0x11021c[_0x3188('0x27')]){delete _0x11021c['name'];}_0x2cd060[_0x3188('0x1b')](_0xe57f73)[_0x3188('0x28')](_0x11021c);};}exports[_0x3188('0x29')]=function(_0x44db9a,_0x20e6aa){var _0x1f1c6f={},_0x8f810f={},_0x472926={'count':0x0,'rows':[]};var _0x57c21c=_[_0x3188('0x2a')](db['UserProfileResource'][_0x3188('0x2b')],function(_0x5623f1){return{'name':_0x5623f1[_0x3188('0x2c')],'type':_0x5623f1[_0x3188('0x2d')][_0x3188('0x2e')]};});_0x8f810f[_0x3188('0x2f')]=_[_0x3188('0x2a')](_0x57c21c,_0x3188('0x27'));_0x8f810f[_0x3188('0x30')]=_[_0x3188('0x31')](_0x44db9a[_0x3188('0x30')]);_0x8f810f[_0x3188('0x32')]=_[_0x3188('0x33')](_0x8f810f[_0x3188('0x2f')],_0x8f810f[_0x3188('0x30')]);_0x1f1c6f[_0x3188('0x34')]=_[_0x3188('0x33')](_0x8f810f[_0x3188('0x2f')],qs[_0x3188('0x35')](_0x44db9a[_0x3188('0x30')]['fields']));_0x1f1c6f[_0x3188('0x34')]=_0x1f1c6f['attributes'][_0x3188('0x36')]?_0x1f1c6f[_0x3188('0x34')]:_0x8f810f['model'];if(!_0x44db9a[_0x3188('0x30')][_0x3188('0x37')](_0x3188('0x38'))){_0x1f1c6f[_0x3188('0x1e')]=qs[_0x3188('0x1e')](_0x44db9a[_0x3188('0x30')][_0x3188('0x1e')]);_0x1f1c6f['offset']=qs['offset'](_0x44db9a[_0x3188('0x30')][_0x3188('0x1c')]);}_0x1f1c6f[_0x3188('0x39')]=qs[_0x3188('0x3a')](_0x44db9a['query'][_0x3188('0x3a')]);_0x1f1c6f[_0x3188('0x3b')]=qs[_0x3188('0x32')](_[_0x3188('0x3c')](_0x44db9a['query'],_0x8f810f[_0x3188('0x32')]),_0x57c21c);if(_0x44db9a['query'][_0x3188('0x3d')]){_0x1f1c6f['where']=_[_0x3188('0x3e')](_0x1f1c6f[_0x3188('0x3b')],{'$or':_[_0x3188('0x2a')](_0x57c21c,function(_0x2990c4){if(_0x2990c4[_0x3188('0x2d')]!==_0x3188('0x3f')){var _0x4666b2={};_0x4666b2[_0x2990c4[_0x3188('0x27')]]={'$like':'%'+_0x44db9a[_0x3188('0x30')][_0x3188('0x3d')]+'%'};return _0x4666b2;}})});}_0x1f1c6f=_['merge']({},_0x1f1c6f,_0x44db9a[_0x3188('0x40')]);var _0x2bad0f={'where':_0x1f1c6f[_0x3188('0x3b')]};return db[_0x3188('0x41')][_0x3188('0x1f')](_0x2bad0f)[_0x3188('0x23')](function(_0x5a815d){_0x472926[_0x3188('0x1f')]=_0x5a815d;if(_0x44db9a['query'][_0x3188('0x42')]){_0x1f1c6f[_0x3188('0x43')]=[{'all':!![]}];}return db[_0x3188('0x41')][_0x3188('0x44')](_0x1f1c6f);})[_0x3188('0x23')](function(_0x549ab2){_0x472926['rows']=_0x549ab2;return _0x472926;})['then'](respondWithFilteredResult(_0x20e6aa,_0x1f1c6f))['catch'](handleError(_0x20e6aa,null));};exports['show']=function(_0x763943,_0x28c224){var _0x3e5f90={'raw':![],'where':{'id':_0x763943[_0x3188('0x45')]['id']}},_0x1b40b1={};_0x1b40b1['model']=_[_0x3188('0x31')](db['UserProfileResource'][_0x3188('0x2b')]);_0x1b40b1[_0x3188('0x30')]=_[_0x3188('0x31')](_0x763943[_0x3188('0x30')]);_0x1b40b1['filters']=_[_0x3188('0x33')](_0x1b40b1[_0x3188('0x2f')],_0x1b40b1[_0x3188('0x30')]);_0x3e5f90[_0x3188('0x34')]=_[_0x3188('0x33')](_0x1b40b1['model'],qs['fields'](_0x763943[_0x3188('0x30')][_0x3188('0x35')]));_0x3e5f90['attributes']=_0x3e5f90[_0x3188('0x34')][_0x3188('0x36')]?_0x3e5f90['attributes']:_0x1b40b1[_0x3188('0x2f')];if(_0x763943[_0x3188('0x30')][_0x3188('0x42')]){_0x3e5f90[_0x3188('0x43')]=[{'all':!![]}];}_0x3e5f90=_[_0x3188('0x3e')]({},_0x3e5f90,_0x763943['options']);return db[_0x3188('0x41')]['find'](_0x3e5f90)[_0x3188('0x23')](handleEntityNotFound(_0x28c224,null))[_0x3188('0x23')](respondWithResult(_0x28c224,null))[_0x3188('0x46')](handleError(_0x28c224,null));};exports[_0x3188('0x47')]=function(_0xe4cbb0,_0x315524){return db[_0x3188('0x41')][_0x3188('0x47')](_0xe4cbb0[_0x3188('0x48')],{})[_0x3188('0x23')](respondWithResult(_0x315524,0xc9))[_0x3188('0x46')](handleError(_0x315524,null));};exports['update']=function(_0x50fd56,_0x1b012d){if(_0x50fd56['body']['id']){delete _0x50fd56[_0x3188('0x48')]['id'];}return db[_0x3188('0x41')]['find']({'where':{'id':_0x50fd56[_0x3188('0x45')]['id']}})[_0x3188('0x23')](handleEntityNotFound(_0x1b012d,null))[_0x3188('0x23')](saveUpdates(_0x50fd56[_0x3188('0x48')],null))[_0x3188('0x23')](respondWithResult(_0x1b012d,null))[_0x3188('0x46')](handleError(_0x1b012d,null));};exports[_0x3188('0x24')]=function(_0x1e3592,_0x59a177){return db[_0x3188('0x41')][_0x3188('0x49')]({'where':{'id':_0x1e3592['params']['id']}})[_0x3188('0x23')](handleEntityNotFound(_0x59a177,null))['then'](removeEntity(_0x59a177,null))[_0x3188('0x46')](handleError(_0x59a177,null));};exports[_0x3188('0x4a')]=function(_0x4f8852,_0x559264){return db['UserProfileResource']['describe']()['then'](respondWithResult(_0x559264,null))['catch'](handleError(_0x559264,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 15e72b6..162a21a 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 _0xf720=['sectionId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','exports','compositeIndex','resourceId'];(function(_0x19a698,_0x43df5f){var _0x38ebb2=function(_0x148eba){while(--_0x148eba){_0x19a698['push'](_0x19a698['shift']());}};_0x38ebb2(++_0x43df5f);}(_0xf720,0x17b));var _0x0f72=function(_0x4b5b36,_0x47f686){_0x4b5b36=_0x4b5b36-0x0;var _0x1360bb=_0xf720[_0x4b5b36];return _0x1360bb;};'use strict';var _=require(_0x0f72('0x0'));var util=require(_0x0f72('0x1'));var logger=require(_0x0f72('0x2'))(_0x0f72('0x3'));var moment=require(_0x0f72('0x4'));var BPromise=require('bluebird');var rp=require(_0x0f72('0x5'));var fs=require('fs');var path=require(_0x0f72('0x6'));var rimraf=require(_0x0f72('0x7'));var config=require(_0x0f72('0x8'));var attributes=require(_0x0f72('0x9'));module[_0x0f72('0xa')]=function(_0x25392c,_0x189282){return _0x25392c['define']('UserProfileResource',attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x0f72('0xb'),'fields':[_0x0f72('0xc'),_0x0f72('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdb77=['path','rimraf','../../config/environment','./userProfileResource.attributes','exports','UserProfileResource','user_profile_has_resources','compositeIndex','sectionId','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x16f386,_0x46190a){var _0x185f62=function(_0x23e17c){while(--_0x23e17c){_0x16f386['push'](_0x16f386['shift']());}};_0x185f62(++_0x46190a);}(_0xdb77,0xdb));var _0x7db7=function(_0x405f96,_0x507b61){_0x405f96=_0x405f96-0x0;var _0x29ca06=_0xdb77[_0x405f96];return _0x29ca06;};'use strict';var _=require(_0x7db7('0x0'));var util=require('util');var logger=require(_0x7db7('0x1'))('api');var moment=require(_0x7db7('0x2'));var BPromise=require(_0x7db7('0x3'));var rp=require(_0x7db7('0x4'));var fs=require('fs');var path=require(_0x7db7('0x5'));var rimraf=require(_0x7db7('0x6'));var config=require(_0x7db7('0x7'));var attributes=require(_0x7db7('0x8'));module[_0x7db7('0x9')]=function(_0x42b5dc,_0x5a70b0){return _0x42b5dc['define'](_0x7db7('0xa'),attributes,{'tableName':_0x7db7('0xb'),'paranoid':![],'indexes':[{'name':_0x7db7('0xc'),'fields':['resourceId',_0x7db7('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index be731d5..828dc05 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 _0x36d4=['result','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x1889e8,_0x30b3df){var _0x3a8bac=function(_0x1f2e64){while(--_0x1f2e64){_0x1889e8['push'](_0x1889e8['shift']());}};_0x3a8bac(++_0x30b3df);}(_0x36d4,0x171));var _0x436d=function(_0x19ae45,_0x3f24e5){_0x19ae45=_0x19ae45-0x0;var _0x15b84f=_0x36d4[_0x19ae45];return _0x15b84f;};'use strict';var _=require('lodash');var util=require(_0x436d('0x0'));var moment=require(_0x436d('0x1'));var BPromise=require(_0x436d('0x2'));var rs=require(_0x436d('0x3'));var fs=require('fs');var Redis=require(_0x436d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x436d('0x5'));var logger=require('../../config/logger')(_0x436d('0x6'));var config=require(_0x436d('0x7'));var jayson=require(_0x436d('0x8'));var client=jayson[_0x436d('0x9')][_0x436d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b250c,_0x1b90b1,_0x571b95){return new BPromise(function(_0x2990cb,_0x1a88e7){return client[_0x436d('0xb')](_0x5b250c,_0x571b95)[_0x436d('0xc')](function(_0x261e6e){logger[_0x436d('0xd')](_0x436d('0xe'),_0x1b90b1,'request\x20sent');logger[_0x436d('0xf')](_0x436d('0x10'),_0x1b90b1,_0x436d('0x11'),JSON[_0x436d('0x12')](_0x261e6e));if(_0x261e6e[_0x436d('0x13')]){if(_0x261e6e['error'][_0x436d('0x14')]===0x1f4){logger[_0x436d('0x13')](_0x436d('0xe'),_0x1b90b1,_0x261e6e['error']['message']);return _0x1a88e7(_0x261e6e[_0x436d('0x13')]['message']);}logger['error'](_0x436d('0xe'),_0x1b90b1,_0x261e6e['error'][_0x436d('0x15')]);return _0x2990cb(_0x261e6e[_0x436d('0x13')][_0x436d('0x15')]);}else{logger[_0x436d('0xd')](_0x436d('0xe'),_0x1b90b1,_0x436d('0x11'));_0x2990cb(_0x261e6e[_0x436d('0x16')][_0x436d('0x15')]);}})['catch'](function(_0x31d586){logger[_0x436d('0x13')](_0x436d('0xe'),_0x1b90b1,_0x31d586);_0x1a88e7(_0x31d586);});});} \ No newline at end of file +var _0x8be7=['error','UserProfileResource,\x20%s,\x20%s','message','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','info','request\x20sent','debug','code'];(function(_0x5bfa44,_0x76dacc){var _0x43815f=function(_0x307fca){while(--_0x307fca){_0x5bfa44['push'](_0x5bfa44['shift']());}};_0x43815f(++_0x76dacc);}(_0x8be7,0x82));var _0x78be=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x8be7[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0x78be('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x78be('0x1'));var rs=require(_0x78be('0x2'));var fs=require('fs');var Redis=require(_0x78be('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x78be('0x4'));var logger=require('../../config/logger')(_0x78be('0x5'));var config=require(_0x78be('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x78be('0x7')][_0x78be('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x535a0d,_0x259069,_0x1a8afb){return new BPromise(function(_0x4e6451,_0x26cdaf){return client[_0x78be('0x9')](_0x535a0d,_0x1a8afb)['then'](function(_0x2605ff){logger[_0x78be('0xa')]('UserProfileResource,\x20%s,\x20%s',_0x259069,_0x78be('0xb'));logger[_0x78be('0xc')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x259069,_0x78be('0xb'),JSON['stringify'](_0x2605ff));if(_0x2605ff['error']){if(_0x2605ff['error'][_0x78be('0xd')]===0x1f4){logger[_0x78be('0xe')](_0x78be('0xf'),_0x259069,_0x2605ff[_0x78be('0xe')][_0x78be('0x10')]);return _0x26cdaf(_0x2605ff[_0x78be('0xe')][_0x78be('0x10')]);}logger[_0x78be('0xe')](_0x78be('0xf'),_0x259069,_0x2605ff['error'][_0x78be('0x10')]);return _0x4e6451(_0x2605ff[_0x78be('0xe')][_0x78be('0x10')]);}else{logger[_0x78be('0xa')](_0x78be('0xf'),_0x259069,_0x78be('0xb'));_0x4e6451(_0x2605ff['result'][_0x78be('0x10')]);}})[_0x78be('0x11')](function(_0x3afa06){logger[_0x78be('0xe')](_0x78be('0xf'),_0x259069,_0x3afa06);_0x26cdaf(_0x3afa06);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index be9489d..7fc0b49 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 _0x2edb=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','show','post','create','put','/:id','update','delete','destroy'];(function(_0x56c396,_0x1c9bc5){var _0x266be9=function(_0x58064d){while(--_0x58064d){_0x56c396['push'](_0x56c396['shift']());}};_0x266be9(++_0x1c9bc5);}(_0x2edb,0x1e4));var _0xb2ed=function(_0x5639e1,_0x421603){_0x5639e1=_0x5639e1-0x0;var _0x197e82=_0x2edb[_0x5639e1];return _0x197e82;};'use strict';var multer=require(_0xb2ed('0x0'));var util=require('util');var path=require(_0xb2ed('0x1'));var timeout=require(_0xb2ed('0x2'));var express=require(_0xb2ed('0x3'));var router=express[_0xb2ed('0x4')]();var fs_extra=require(_0xb2ed('0x5'));var auth=require(_0xb2ed('0x6'));var interaction=require(_0xb2ed('0x7'));var config=require(_0xb2ed('0x8'));var controller=require('./userProfileSection.controller');router[_0xb2ed('0x9')]('/',auth[_0xb2ed('0xa')](),controller['index']);router[_0xb2ed('0x9')](_0xb2ed('0xb'),auth[_0xb2ed('0xa')](),controller['describe']);router[_0xb2ed('0x9')]('/:id',auth[_0xb2ed('0xa')](),controller[_0xb2ed('0xc')]);router[_0xb2ed('0xd')]('/',auth['isAuthenticated'](),controller[_0xb2ed('0xe')]);router[_0xb2ed('0xf')](_0xb2ed('0x10'),auth['isAuthenticated'](),controller[_0xb2ed('0x11')]);router[_0xb2ed('0x12')]('/:id',auth[_0xb2ed('0xa')](),controller[_0xb2ed('0x13')]);module[_0xb2ed('0x14')]=router; \ No newline at end of file +var _0x212c=['isAuthenticated','index','/describe','describe','/:id','show','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x2da721,_0x43429c){var _0x4b62ea=function(_0x5a9af7){while(--_0x5a9af7){_0x2da721['push'](_0x2da721['shift']());}};_0x4b62ea(++_0x43429c);}(_0x212c,0x170));var _0xc212=function(_0x24d6b0,_0x43c455){_0x24d6b0=_0x24d6b0-0x0;var _0x5f299b=_0x212c[_0x24d6b0];return _0x5f299b;};'use strict';var multer=require(_0xc212('0x0'));var util=require(_0xc212('0x1'));var path=require(_0xc212('0x2'));var timeout=require(_0xc212('0x3'));var express=require(_0xc212('0x4'));var router=express['Router']();var fs_extra=require(_0xc212('0x5'));var auth=require(_0xc212('0x6'));var interaction=require(_0xc212('0x7'));var config=require(_0xc212('0x8'));var controller=require('./userProfileSection.controller');router[_0xc212('0x9')]('/',auth[_0xc212('0xa')](),controller[_0xc212('0xb')]);router[_0xc212('0x9')](_0xc212('0xc'),auth[_0xc212('0xa')](),controller[_0xc212('0xd')]);router[_0xc212('0x9')](_0xc212('0xe'),auth[_0xc212('0xa')](),controller[_0xc212('0xf')]);router[_0xc212('0x10')]('/',auth[_0xc212('0xa')](),controller[_0xc212('0x11')]);router['put']('/:id',auth[_0xc212('0xa')](),controller['update']);router[_0xc212('0x12')](_0xc212('0xe'),auth[_0xc212('0xa')](),controller[_0xc212('0x13')]);module[_0xc212('0x14')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index f8b3e8e..6c5264e 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 _0xfef3=['sequelize','STRING','INTEGER','BOOLEAN','crudPermissions','join','getDataValue','split'];(function(_0x43139e,_0x762629){var _0x2bc838=function(_0x593ec3){while(--_0x593ec3){_0x43139e['push'](_0x43139e['shift']());}};_0x2bc838(++_0x762629);}(_0xfef3,0x118));var _0x3fef=function(_0x531b74,_0x3a473b){_0x531b74=_0x531b74-0x0;var _0x513d17=_0xfef3[_0x531b74];return _0x513d17;};'use strict';var Sequelize=require(_0x3fef('0x0'));module['exports']={'name':{'type':Sequelize[_0x3fef('0x1')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0x3fef('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x3fef('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x3fef('0x1')],'set':function(_0x3b71e5){this['setDataValue'](_0x3fef('0x4'),_0x3b71e5?_0x3b71e5[_0x3fef('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0x3fef('0x4'))?this[_0x3fef('0x6')](_0x3fef('0x4'))[_0x3fef('0x7')](''):[];}}}; \ No newline at end of file +var _0xfff0=['BOOLEAN','setDataValue','crudPermissions','getDataValue','split','exports','STRING'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0xfff0,0x139));var _0x0fff=function(_0x3ad1db,_0x332fbb){_0x3ad1db=_0x3ad1db-0x0;var _0x21b183=_0xfff0[_0x3ad1db];return _0x21b183;};'use strict';var Sequelize=require('sequelize');module[_0x0fff('0x0')]={'name':{'type':Sequelize[_0x0fff('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x0fff('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x0fff('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x0fff('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x0fff('0x1')],'set':function(_0x4bec60){this[_0x0fff('0x3')](_0x0fff('0x4'),_0x4bec60?_0x4bec60['join'](''):[]);},'get':function(){return this[_0x0fff('0x5')](_0x0fff('0x4'))?this[_0x0fff('0x5')]('crudPermissions')[_0x0fff('0x6')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 5badfd5..bc653a1 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 _0xf228=['fields','length','hasOwnProperty','nolimit','order','pick','filter','where','VIRTUAL','merge','options','UserProfileSection','includeAll','include','findAll','rows','catch','show','rawAttributes','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','attributes'];(function(_0x327864,_0x5a0a94){var _0x3b3a0c=function(_0x3e9d43){while(--_0x3e9d43){_0x327864['push'](_0x327864['shift']());}};_0x3b3a0c(++_0x5a0a94);}(_0xf228,0x147));var _0x8f22=function(_0x353333,_0x44c332){_0x353333=_0x353333-0x0;var _0x341f01=_0xf228[_0x353333];return _0x341f01;};'use strict';var emlformat=require(_0x8f22('0x0'));var rimraf=require(_0x8f22('0x1'));var zipdir=require(_0x8f22('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8f22('0x3'));var moment=require('moment');var BPromise=require(_0x8f22('0x4'));var Mustache=require(_0x8f22('0x5'));var util=require(_0x8f22('0x6'));var path=require('path');var sox=require(_0x8f22('0x7'));var csv=require(_0x8f22('0x8'));var ejs=require(_0x8f22('0x9'));var fs=require('fs');var fs_extra=require(_0x8f22('0xa'));var _=require(_0x8f22('0xb'));var squel=require(_0x8f22('0xc'));var crypto=require(_0x8f22('0xd'));var jsforce=require(_0x8f22('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8f22('0x8'));var querystring=require(_0x8f22('0xf'));var Papa=require(_0x8f22('0x10'));var Redis=require(_0x8f22('0x11'));var authService=require(_0x8f22('0x12'));var qs=require(_0x8f22('0x13'));var as=require(_0x8f22('0x14'));var hardwareService=require(_0x8f22('0x15'));var logger=require(_0x8f22('0x16'))('api');var utils=require(_0x8f22('0x17'));var config=require(_0x8f22('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x8f22('0x19'))['db'];function respondWithStatusCode(_0x12e737,_0x315ffa){_0x315ffa=_0x315ffa||0xcc;return function(_0x27a805){if(_0x27a805){return _0x12e737['sendStatus'](_0x315ffa);}return _0x12e737['status'](_0x315ffa)['end']();};}function respondWithResult(_0x35ddb7,_0x5b287b){_0x5b287b=_0x5b287b||0xc8;return function(_0x1e2eae){if(_0x1e2eae){return _0x35ddb7[_0x8f22('0x1a')](_0x5b287b)['json'](_0x1e2eae);}};}function respondWithFilteredResult(_0x131c26,_0x4be1b2){return function(_0x2641f8){if(_0x2641f8){var _0x26ca78=typeof _0x4be1b2[_0x8f22('0x1b')]===_0x8f22('0x1c')&&typeof _0x4be1b2[_0x8f22('0x1d')]===_0x8f22('0x1c');var _0x34739a=_0x2641f8['count'];var _0xe1df48=_0x26ca78?0x0:_0x4be1b2[_0x8f22('0x1b')];var _0x3ea3b7=_0x26ca78?_0x2641f8[_0x8f22('0x1e')]:_0x4be1b2[_0x8f22('0x1b')]+_0x4be1b2[_0x8f22('0x1d')];var _0x552df9;if(_0x3ea3b7>=_0x34739a){_0x3ea3b7=_0x34739a;_0x552df9=0xc8;}else{_0x552df9=0xce;}_0x131c26['status'](_0x552df9);return _0x131c26[_0x8f22('0x1f')]('Content-Range',_0xe1df48+'-'+_0x3ea3b7+'/'+_0x34739a)['json'](_0x2641f8);}return null;};}function patchUpdates(_0x585e0f){return function(_0x2a5b84){try{jsonpatch[_0x8f22('0x20')](_0x2a5b84,_0x585e0f,!![]);}catch(_0x1f278c){return BPromise[_0x8f22('0x21')](_0x1f278c);}return _0x2a5b84[_0x8f22('0x22')]();};}function saveUpdates(_0x3e6f7b,_0x5d83ec){return function(_0x1410b8){if(_0x1410b8){return _0x1410b8[_0x8f22('0x23')](_0x3e6f7b)[_0x8f22('0x24')](function(_0x466321){return _0x466321;});}return null;};}function removeEntity(_0x3e48f3,_0x369274){return function(_0x13065b){if(_0x13065b){return _0x13065b[_0x8f22('0x25')]()['then'](function(){_0x3e48f3[_0x8f22('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x109b19,_0x5a1259){return function(_0x455e8f){if(!_0x455e8f){_0x109b19[_0x8f22('0x26')](0x194);}return _0x455e8f;};}function handleError(_0x21ef49,_0x2127b5){_0x2127b5=_0x2127b5||0x1f4;return function(_0x4ced3e){logger[_0x8f22('0x27')](_0x4ced3e[_0x8f22('0x28')]);if(_0x4ced3e[_0x8f22('0x29')]){delete _0x4ced3e[_0x8f22('0x29')];}_0x21ef49[_0x8f22('0x1a')](_0x2127b5)[_0x8f22('0x2a')](_0x4ced3e);};}exports[_0x8f22('0x2b')]=function(_0x80f23,_0x5c72ea){var _0x25002e={},_0x46d968={},_0x4a9f0c={'count':0x0,'rows':[]};var _0x250002=_[_0x8f22('0x2c')](db['UserProfileSection']['rawAttributes'],function(_0x5481bb){return{'name':_0x5481bb[_0x8f22('0x2d')],'type':_0x5481bb[_0x8f22('0x2e')]['key']};});_0x46d968[_0x8f22('0x2f')]=_[_0x8f22('0x2c')](_0x250002,_0x8f22('0x29'));_0x46d968[_0x8f22('0x30')]=_[_0x8f22('0x31')](_0x80f23[_0x8f22('0x30')]);_0x46d968[_0x8f22('0x32')]=_[_0x8f22('0x33')](_0x46d968['model'],_0x46d968[_0x8f22('0x30')]);_0x25002e[_0x8f22('0x34')]=_['intersection'](_0x46d968['model'],qs[_0x8f22('0x35')](_0x80f23[_0x8f22('0x30')]['fields']));_0x25002e[_0x8f22('0x34')]=_0x25002e[_0x8f22('0x34')][_0x8f22('0x36')]?_0x25002e['attributes']:_0x46d968[_0x8f22('0x2f')];if(!_0x80f23[_0x8f22('0x30')][_0x8f22('0x37')](_0x8f22('0x38'))){_0x25002e[_0x8f22('0x1d')]=qs[_0x8f22('0x1d')](_0x80f23[_0x8f22('0x30')][_0x8f22('0x1d')]);_0x25002e[_0x8f22('0x1b')]=qs[_0x8f22('0x1b')](_0x80f23[_0x8f22('0x30')][_0x8f22('0x1b')]);}_0x25002e[_0x8f22('0x39')]=qs['sort'](_0x80f23[_0x8f22('0x30')]['sort']);_0x25002e['where']=qs[_0x8f22('0x32')](_[_0x8f22('0x3a')](_0x80f23[_0x8f22('0x30')],_0x46d968[_0x8f22('0x32')]),_0x250002);if(_0x80f23[_0x8f22('0x30')][_0x8f22('0x3b')]){_0x25002e[_0x8f22('0x3c')]=_['merge'](_0x25002e[_0x8f22('0x3c')],{'$or':_[_0x8f22('0x2c')](_0x250002,function(_0x202d77){if(_0x202d77[_0x8f22('0x2e')]!==_0x8f22('0x3d')){var _0x2a2668={};_0x2a2668[_0x202d77[_0x8f22('0x29')]]={'$like':'%'+_0x80f23['query'][_0x8f22('0x3b')]+'%'};return _0x2a2668;}})});}_0x25002e=_[_0x8f22('0x3e')]({},_0x25002e,_0x80f23[_0x8f22('0x3f')]);var _0x4bd2dd={'where':_0x25002e[_0x8f22('0x3c')]};return db[_0x8f22('0x40')]['count'](_0x4bd2dd)[_0x8f22('0x24')](function(_0x52448c){_0x4a9f0c[_0x8f22('0x1e')]=_0x52448c;if(_0x80f23[_0x8f22('0x30')][_0x8f22('0x41')]){_0x25002e[_0x8f22('0x42')]=[{'all':!![]}];}return db[_0x8f22('0x40')][_0x8f22('0x43')](_0x25002e);})[_0x8f22('0x24')](function(_0x906e31){_0x4a9f0c[_0x8f22('0x44')]=_0x906e31;return _0x4a9f0c;})[_0x8f22('0x24')](respondWithFilteredResult(_0x5c72ea,_0x25002e))[_0x8f22('0x45')](handleError(_0x5c72ea,null));};exports[_0x8f22('0x46')]=function(_0xfd7758,_0x3230fd){var _0x46ab6c={'raw':![],'where':{'id':_0xfd7758['params']['id']}},_0x12ea85={};_0x12ea85['model']=_[_0x8f22('0x31')](db['UserProfileSection'][_0x8f22('0x47')]);_0x12ea85[_0x8f22('0x30')]=_[_0x8f22('0x31')](_0xfd7758['query']);_0x12ea85[_0x8f22('0x32')]=_[_0x8f22('0x33')](_0x12ea85[_0x8f22('0x2f')],_0x12ea85[_0x8f22('0x30')]);_0x46ab6c[_0x8f22('0x34')]=_['intersection'](_0x12ea85['model'],qs[_0x8f22('0x35')](_0xfd7758[_0x8f22('0x30')][_0x8f22('0x35')]));_0x46ab6c[_0x8f22('0x34')]=_0x46ab6c['attributes'][_0x8f22('0x36')]?_0x46ab6c[_0x8f22('0x34')]:_0x12ea85[_0x8f22('0x2f')];if(_0xfd7758['query'][_0x8f22('0x41')]){_0x46ab6c[_0x8f22('0x42')]=[{'all':!![]}];}_0x46ab6c=_[_0x8f22('0x3e')]({},_0x46ab6c,_0xfd7758[_0x8f22('0x3f')]);return db[_0x8f22('0x40')]['find'](_0x46ab6c)[_0x8f22('0x24')](handleEntityNotFound(_0x3230fd,null))['then'](respondWithResult(_0x3230fd,null))['catch'](handleError(_0x3230fd,null));};exports['create']=function(_0xac1e97,_0x1d92ca){return db[_0x8f22('0x40')][_0x8f22('0x48')](_0xac1e97[_0x8f22('0x49')],{})['then'](respondWithResult(_0x1d92ca,0xc9))[_0x8f22('0x45')](handleError(_0x1d92ca,null));};exports[_0x8f22('0x23')]=function(_0x2146a2,_0x393481){if(_0x2146a2[_0x8f22('0x49')]['id']){delete _0x2146a2[_0x8f22('0x49')]['id'];}return db[_0x8f22('0x40')]['find']({'where':{'id':_0x2146a2[_0x8f22('0x4a')]['id']}})[_0x8f22('0x24')](handleEntityNotFound(_0x393481,null))[_0x8f22('0x24')](saveUpdates(_0x2146a2[_0x8f22('0x49')],null))[_0x8f22('0x24')](respondWithResult(_0x393481,null))[_0x8f22('0x45')](handleError(_0x393481,null));};exports[_0x8f22('0x25')]=function(_0x1bc315,_0x307b2a){return db[_0x8f22('0x40')]['find']({'where':{'id':_0x1bc315['params']['id']}})[_0x8f22('0x24')](handleEntityNotFound(_0x307b2a,null))[_0x8f22('0x24')](removeEntity(_0x307b2a,null))[_0x8f22('0x45')](handleError(_0x307b2a,null));};exports[_0x8f22('0x4b')]=function(_0x3386b0,_0xc02532){return db['UserProfileSection']['describe']()[_0x8f22('0x24')](respondWithResult(_0xc02532,null))[_0x8f22('0x45')](handleError(_0xc02532,null));}; \ No newline at end of file +var _0xdcef=['count','Content-Range','apply','save','then','destroy','error','name','send','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','UserProfileSection','include','findAll','rows','catch','show','params','keys','length','includeAll','find','create','body','describe','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x3cde4c,_0x1bbc9b){var _0x512eaa=function(_0x5b89e1){while(--_0x5b89e1){_0x3cde4c['push'](_0x3cde4c['shift']());}};_0x512eaa(++_0x1bbc9b);}(_0xdcef,0x78));var _0xfdce=function(_0x98b7e1,_0x379149){_0x98b7e1=_0x98b7e1-0x0;var _0x195583=_0xdcef[_0x98b7e1];return _0x195583;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfdce('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfdce('0x1'));var moment=require(_0xfdce('0x2'));var BPromise=require(_0xfdce('0x3'));var Mustache=require(_0xfdce('0x4'));var util=require(_0xfdce('0x5'));var path=require('path');var sox=require(_0xfdce('0x6'));var csv=require(_0xfdce('0x7'));var ejs=require(_0xfdce('0x8'));var fs=require('fs');var fs_extra=require(_0xfdce('0x9'));var _=require(_0xfdce('0xa'));var squel=require(_0xfdce('0xb'));var crypto=require(_0xfdce('0xc'));var jsforce=require(_0xfdce('0xd'));var deskjs=require(_0xfdce('0xe'));var toCsv=require(_0xfdce('0x7'));var querystring=require(_0xfdce('0xf'));var Papa=require(_0xfdce('0x10'));var Redis=require('ioredis');var authService=require(_0xfdce('0x11'));var qs=require(_0xfdce('0x12'));var as=require(_0xfdce('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfdce('0x14'))('api');var utils=require(_0xfdce('0x15'));var config=require(_0xfdce('0x16'));var licenseUtil=require(_0xfdce('0x17'));var db=require(_0xfdce('0x18'))['db'];function respondWithStatusCode(_0x1201b5,_0x9cb4ae){_0x9cb4ae=_0x9cb4ae||0xcc;return function(_0x30d59c){if(_0x30d59c){return _0x1201b5[_0xfdce('0x19')](_0x9cb4ae);}return _0x1201b5[_0xfdce('0x1a')](_0x9cb4ae)[_0xfdce('0x1b')]();};}function respondWithResult(_0x1928e6,_0x544104){_0x544104=_0x544104||0xc8;return function(_0x300322){if(_0x300322){return _0x1928e6[_0xfdce('0x1a')](_0x544104)[_0xfdce('0x1c')](_0x300322);}};}function respondWithFilteredResult(_0x5d0c24,_0x2a82c2){return function(_0x6751b6){if(_0x6751b6){var _0x3c258f=typeof _0x2a82c2[_0xfdce('0x1d')]===_0xfdce('0x1e')&&typeof _0x2a82c2[_0xfdce('0x1f')]===_0xfdce('0x1e');var _0x539cb6=_0x6751b6[_0xfdce('0x20')];var _0x5b602d=_0x3c258f?0x0:_0x2a82c2[_0xfdce('0x1d')];var _0x17245=_0x3c258f?_0x6751b6[_0xfdce('0x20')]:_0x2a82c2[_0xfdce('0x1d')]+_0x2a82c2['limit'];var _0x5580cb;if(_0x17245>=_0x539cb6){_0x17245=_0x539cb6;_0x5580cb=0xc8;}else{_0x5580cb=0xce;}_0x5d0c24['status'](_0x5580cb);return _0x5d0c24['set'](_0xfdce('0x21'),_0x5b602d+'-'+_0x17245+'/'+_0x539cb6)['json'](_0x6751b6);}return null;};}function patchUpdates(_0x2f97bb){return function(_0x32f9e4){try{jsonpatch[_0xfdce('0x22')](_0x32f9e4,_0x2f97bb,!![]);}catch(_0x40176e){return BPromise['reject'](_0x40176e);}return _0x32f9e4[_0xfdce('0x23')]();};}function saveUpdates(_0x3b7ef1,_0x41062b){return function(_0xd33eb4){if(_0xd33eb4){return _0xd33eb4['update'](_0x3b7ef1)[_0xfdce('0x24')](function(_0xbe62e6){return _0xbe62e6;});}return null;};}function removeEntity(_0x692019,_0x1f8bdb){return function(_0x2945bc){if(_0x2945bc){return _0x2945bc[_0xfdce('0x25')]()[_0xfdce('0x24')](function(){_0x692019[_0xfdce('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ce453,_0x34db48){return function(_0x3a1abb){if(!_0x3a1abb){_0x2ce453[_0xfdce('0x19')](0x194);}return _0x3a1abb;};}function handleError(_0x46754c,_0x578a01){_0x578a01=_0x578a01||0x1f4;return function(_0x150654){logger[_0xfdce('0x26')](_0x150654['stack']);if(_0x150654[_0xfdce('0x27')]){delete _0x150654[_0xfdce('0x27')];}_0x46754c[_0xfdce('0x1a')](_0x578a01)[_0xfdce('0x28')](_0x150654);};}exports['index']=function(_0x15836d,_0x44706b){var _0x216b69={},_0x2582fd={},_0x325f23={'count':0x0,'rows':[]};var _0x1aca7a=_[_0xfdce('0x29')](db['UserProfileSection'][_0xfdce('0x2a')],function(_0x384c5e){return{'name':_0x384c5e[_0xfdce('0x2b')],'type':_0x384c5e[_0xfdce('0x2c')][_0xfdce('0x2d')]};});_0x2582fd[_0xfdce('0x2e')]=_[_0xfdce('0x29')](_0x1aca7a,_0xfdce('0x27'));_0x2582fd[_0xfdce('0x2f')]=_['keys'](_0x15836d['query']);_0x2582fd['filters']=_[_0xfdce('0x30')](_0x2582fd[_0xfdce('0x2e')],_0x2582fd['query']);_0x216b69[_0xfdce('0x31')]=_[_0xfdce('0x30')](_0x2582fd[_0xfdce('0x2e')],qs['fields'](_0x15836d[_0xfdce('0x2f')][_0xfdce('0x32')]));_0x216b69[_0xfdce('0x31')]=_0x216b69[_0xfdce('0x31')]['length']?_0x216b69[_0xfdce('0x31')]:_0x2582fd[_0xfdce('0x2e')];if(!_0x15836d[_0xfdce('0x2f')][_0xfdce('0x33')](_0xfdce('0x34'))){_0x216b69[_0xfdce('0x1f')]=qs[_0xfdce('0x1f')](_0x15836d['query'][_0xfdce('0x1f')]);_0x216b69[_0xfdce('0x1d')]=qs[_0xfdce('0x1d')](_0x15836d[_0xfdce('0x2f')]['offset']);}_0x216b69[_0xfdce('0x35')]=qs[_0xfdce('0x36')](_0x15836d[_0xfdce('0x2f')][_0xfdce('0x36')]);_0x216b69[_0xfdce('0x37')]=qs[_0xfdce('0x38')](_[_0xfdce('0x39')](_0x15836d['query'],_0x2582fd[_0xfdce('0x38')]),_0x1aca7a);if(_0x15836d[_0xfdce('0x2f')][_0xfdce('0x3a')]){_0x216b69[_0xfdce('0x37')]=_[_0xfdce('0x3b')](_0x216b69[_0xfdce('0x37')],{'$or':_[_0xfdce('0x29')](_0x1aca7a,function(_0x14251c){if(_0x14251c['type']!==_0xfdce('0x3c')){var _0x2f17a8={};_0x2f17a8[_0x14251c[_0xfdce('0x27')]]={'$like':'%'+_0x15836d[_0xfdce('0x2f')]['filter']+'%'};return _0x2f17a8;}})});}_0x216b69=_['merge']({},_0x216b69,_0x15836d[_0xfdce('0x3d')]);var _0xc481b5={'where':_0x216b69[_0xfdce('0x37')]};return db[_0xfdce('0x3e')]['count'](_0xc481b5)[_0xfdce('0x24')](function(_0x504d45){_0x325f23['count']=_0x504d45;if(_0x15836d[_0xfdce('0x2f')]['includeAll']){_0x216b69[_0xfdce('0x3f')]=[{'all':!![]}];}return db[_0xfdce('0x3e')][_0xfdce('0x40')](_0x216b69);})['then'](function(_0x58f8bf){_0x325f23[_0xfdce('0x41')]=_0x58f8bf;return _0x325f23;})[_0xfdce('0x24')](respondWithFilteredResult(_0x44706b,_0x216b69))[_0xfdce('0x42')](handleError(_0x44706b,null));};exports[_0xfdce('0x43')]=function(_0x10419b,_0x5b6acb){var _0x1b5339={'raw':![],'where':{'id':_0x10419b[_0xfdce('0x44')]['id']}},_0x1ed2a0={};_0x1ed2a0[_0xfdce('0x2e')]=_[_0xfdce('0x45')](db[_0xfdce('0x3e')][_0xfdce('0x2a')]);_0x1ed2a0[_0xfdce('0x2f')]=_[_0xfdce('0x45')](_0x10419b[_0xfdce('0x2f')]);_0x1ed2a0[_0xfdce('0x38')]=_[_0xfdce('0x30')](_0x1ed2a0['model'],_0x1ed2a0['query']);_0x1b5339['attributes']=_['intersection'](_0x1ed2a0[_0xfdce('0x2e')],qs[_0xfdce('0x32')](_0x10419b[_0xfdce('0x2f')]['fields']));_0x1b5339[_0xfdce('0x31')]=_0x1b5339[_0xfdce('0x31')][_0xfdce('0x46')]?_0x1b5339['attributes']:_0x1ed2a0[_0xfdce('0x2e')];if(_0x10419b[_0xfdce('0x2f')][_0xfdce('0x47')]){_0x1b5339[_0xfdce('0x3f')]=[{'all':!![]}];}_0x1b5339=_[_0xfdce('0x3b')]({},_0x1b5339,_0x10419b[_0xfdce('0x3d')]);return db[_0xfdce('0x3e')][_0xfdce('0x48')](_0x1b5339)[_0xfdce('0x24')](handleEntityNotFound(_0x5b6acb,null))['then'](respondWithResult(_0x5b6acb,null))['catch'](handleError(_0x5b6acb,null));};exports['create']=function(_0x580c53,_0x2679ad){return db['UserProfileSection'][_0xfdce('0x49')](_0x580c53[_0xfdce('0x4a')],{})[_0xfdce('0x24')](respondWithResult(_0x2679ad,0xc9))[_0xfdce('0x42')](handleError(_0x2679ad,null));};exports['update']=function(_0x29429a,_0x534e9f){if(_0x29429a[_0xfdce('0x4a')]['id']){delete _0x29429a['body']['id'];}return db[_0xfdce('0x3e')][_0xfdce('0x48')]({'where':{'id':_0x29429a['params']['id']}})[_0xfdce('0x24')](handleEntityNotFound(_0x534e9f,null))[_0xfdce('0x24')](saveUpdates(_0x29429a[_0xfdce('0x4a')],null))[_0xfdce('0x24')](respondWithResult(_0x534e9f,null))[_0xfdce('0x42')](handleError(_0x534e9f,null));};exports[_0xfdce('0x25')]=function(_0x3f7f52,_0x3eb6be){return db[_0xfdce('0x3e')][_0xfdce('0x48')]({'where':{'id':_0x3f7f52['params']['id']}})[_0xfdce('0x24')](handleEntityNotFound(_0x3eb6be,null))[_0xfdce('0x24')](removeEntity(_0x3eb6be,null))[_0xfdce('0x42')](handleError(_0x3eb6be,null));};exports[_0xfdce('0x4b')]=function(_0x501654,_0xac57af){return db[_0xfdce('0x3e')][_0xfdce('0x4b')]()[_0xfdce('0x24')](respondWithResult(_0xac57af,null))[_0xfdce('0x42')](handleError(_0xac57af,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 66f93d5..a1ae9ff 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 _0x93f4=['rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','compositeIndex','sectionId','userProfileId','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0xe4a487,_0x5419aa){var _0x203de6=function(_0x529484){while(--_0x529484){_0xe4a487['push'](_0xe4a487['shift']());}};_0x203de6(++_0x5419aa);}(_0x93f4,0x79));var _0x493f=function(_0x3afad7,_0x2d8b64){_0x3afad7=_0x3afad7-0x0;var _0x42ddbb=_0x93f4[_0x3afad7];return _0x42ddbb;};'use strict';var _=require(_0x493f('0x0'));var util=require(_0x493f('0x1'));var logger=require('../../config/logger')(_0x493f('0x2'));var moment=require(_0x493f('0x3'));var BPromise=require(_0x493f('0x4'));var rp=require(_0x493f('0x5'));var fs=require('fs');var path=require(_0x493f('0x6'));var rimraf=require(_0x493f('0x7'));var config=require(_0x493f('0x8'));var attributes=require(_0x493f('0x9'));module[_0x493f('0xa')]=function(_0x2e2e94,_0x52fc37){return _0x2e2e94[_0x493f('0xb')](_0x493f('0xc'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0x493f('0xd'),'fields':[_0x493f('0xe'),_0x493f('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7d0e=['bluebird','path','../../config/environment','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','lodash','../../config/logger'];(function(_0x3fc97f,_0x13542b){var _0x1fcaf0=function(_0xcfb8ed){while(--_0xcfb8ed){_0x3fc97f['push'](_0x3fc97f['shift']());}};_0x1fcaf0(++_0x13542b);}(_0x7d0e,0x1f2));var _0xe7d0=function(_0x4fa72b,_0x1b4760){_0x4fa72b=_0x4fa72b-0x0;var _0x4915d1=_0x7d0e[_0x4fa72b];return _0x4915d1;};'use strict';var _=require(_0xe7d0('0x0'));var util=require('util');var logger=require(_0xe7d0('0x1'))('api');var moment=require('moment');var BPromise=require(_0xe7d0('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe7d0('0x3'));var rimraf=require('rimraf');var config=require(_0xe7d0('0x4'));var attributes=require('./userProfileSection.attributes');module[_0xe7d0('0x5')]=function(_0x16cfaa,_0x306883){return _0x16cfaa[_0xe7d0('0x6')](_0xe7d0('0x7'),attributes,{'tableName':_0xe7d0('0x8'),'paranoid':![],'indexes':[{'name':_0xe7d0('0x9'),'fields':['sectionId','userProfileId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 2bdd006..e3f2213 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 _0x94b9=['client','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise'];(function(_0x257efa,_0x275047){var _0x1c031b=function(_0x17bb13){while(--_0x17bb13){_0x257efa['push'](_0x257efa['shift']());}};_0x1c031b(++_0x275047);}(_0x94b9,0x1ad));var _0x994b=function(_0x313ed5,_0xf1e0de){_0x313ed5=_0x313ed5-0x0;var _0x4c31c9=_0x94b9[_0x313ed5];return _0x4c31c9;};'use strict';var _=require(_0x994b('0x0'));var util=require('util');var moment=require(_0x994b('0x1'));var BPromise=require(_0x994b('0x2'));var rs=require(_0x994b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x994b('0x4'))['db'];var utils=require(_0x994b('0x5'));var logger=require('../../config/logger')(_0x994b('0x6'));var config=require('../../config/environment');var jayson=require(_0x994b('0x7'));var client=jayson[_0x994b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb3cb87,_0x20abb0,_0x477ad9){return new BPromise(function(_0x47fd40,_0x4675ce){return client['request'](_0xb3cb87,_0x477ad9)[_0x994b('0x9')](function(_0xb11c94){logger[_0x994b('0xa')](_0x994b('0xb'),_0x20abb0,_0x994b('0xc'));logger[_0x994b('0xd')](_0x994b('0xe'),_0x20abb0,_0x994b('0xc'),JSON[_0x994b('0xf')](_0xb11c94));if(_0xb11c94['error']){if(_0xb11c94[_0x994b('0x10')]['code']===0x1f4){logger[_0x994b('0x10')](_0x994b('0xb'),_0x20abb0,_0xb11c94['error'][_0x994b('0x11')]);return _0x4675ce(_0xb11c94['error'][_0x994b('0x11')]);}logger[_0x994b('0x10')](_0x994b('0xb'),_0x20abb0,_0xb11c94['error'][_0x994b('0x11')]);return _0x47fd40(_0xb11c94[_0x994b('0x10')][_0x994b('0x11')]);}else{logger['info']('UserProfileSection,\x20%s,\x20%s',_0x20abb0,_0x994b('0xc'));_0x47fd40(_0xb11c94['result'][_0x994b('0x11')]);}})[_0x994b('0x12')](function(_0x2eba00){logger[_0x994b('0x10')](_0x994b('0xb'),_0x20abb0,_0x2eba00);_0x4675ce(_0x2eba00);});});} \ No newline at end of file +var _0xc479=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','code','message','UserProfileSection,\x20%s,\x20%s'];(function(_0x1e2c73,_0x12cd55){var _0x46f8d5=function(_0xe5a2fd){while(--_0xe5a2fd){_0x1e2c73['push'](_0x1e2c73['shift']());}};_0x46f8d5(++_0x12cd55);}(_0xc479,0xc7));var _0x9c47=function(_0x2a7812,_0x1ce83a){_0x2a7812=_0x2a7812-0x0;var _0x3e1342=_0xc479[_0x2a7812];return _0x3e1342;};'use strict';var _=require(_0x9c47('0x0'));var util=require(_0x9c47('0x1'));var moment=require(_0x9c47('0x2'));var BPromise=require(_0x9c47('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9c47('0x4'));var db=require(_0x9c47('0x5'))['db'];var utils=require(_0x9c47('0x6'));var logger=require(_0x9c47('0x7'))('rpc');var config=require(_0x9c47('0x8'));var jayson=require(_0x9c47('0x9'));var client=jayson[_0x9c47('0xa')][_0x9c47('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4afc60,_0x43a9e9,_0x3edddb){return new BPromise(function(_0xef238e,_0x38ee9c){return client[_0x9c47('0xc')](_0x4afc60,_0x3edddb)[_0x9c47('0xd')](function(_0x77407b){logger['info']('UserProfileSection,\x20%s,\x20%s',_0x43a9e9,_0x9c47('0xe'));logger[_0x9c47('0xf')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x43a9e9,_0x9c47('0xe'),JSON[_0x9c47('0x10')](_0x77407b));if(_0x77407b[_0x9c47('0x11')]){if(_0x77407b['error'][_0x9c47('0x12')]===0x1f4){logger[_0x9c47('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x43a9e9,_0x77407b[_0x9c47('0x11')]['message']);return _0x38ee9c(_0x77407b[_0x9c47('0x11')][_0x9c47('0x13')]);}logger[_0x9c47('0x11')](_0x9c47('0x14'),_0x43a9e9,_0x77407b[_0x9c47('0x11')][_0x9c47('0x13')]);return _0xef238e(_0x77407b['error']['message']);}else{logger['info'](_0x9c47('0x14'),_0x43a9e9,'request\x20sent');_0xef238e(_0x77407b['result'][_0x9c47('0x13')]);}})[_0x9c47('0x15')](function(_0x3a4db7){logger[_0x9c47('0x11')](_0x9c47('0x14'),_0x43a9e9,_0x3a4db7);_0x38ee9c(_0x3a4db7);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 83f3c53..d5b5a51 100644 --- a/server/api/userSmsQueue/index.js +++ b/server/api/userSmsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x12995e,_0x573c6d){var _0x321a35=function(_0x535901){while(--_0x535901){_0x12995e['push'](_0x12995e['shift']());}};_0x321a35(++_0x573c6d);}(_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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x5cff24,_0x253408){var _0x4d689a=function(_0x151fa6){while(--_0x151fa6){_0x5cff24['push'](_0x5cff24['shift']());}};_0x4d689a(++_0x253408);}(_0xe706,0xa3));var _0x6e70=function(_0x12c076,_0x5bef17){_0x12c076=_0x12c076-0x0;var _0x2ddd18=_0xe706[_0x12c076];return _0x2ddd18;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index ba4276a..6b1267f 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 _0x257b=['INTEGER'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x257b,0xf8));var _0xb257=function(_0x32713d,_0x38c89d){_0x32713d=_0x32713d-0x0;var _0x655a46=_0x257b[_0x32713d];return _0x655a46;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xb257('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0x72bb=['sequelize','exports','INTEGER'];(function(_0x5be3fd,_0x405440){var _0x556da4=function(_0x362c02){while(--_0x362c02){_0x5be3fd['push'](_0x5be3fd['shift']());}};_0x556da4(++_0x405440);}(_0x72bb,0x14a));var _0xb72b=function(_0xe4bb3d,_0x21e87e){_0xe4bb3d=_0xe4bb3d-0x0;var _0xd9e51=_0x72bb[_0xe4bb3d];return _0xd9e51;};'use strict';var Sequelize=require(_0xb72b('0x0'));module[_0xb72b('0x1')]={'penalty':{'type':Sequelize[_0xb72b('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 3e7a6d4..1a2211c 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 _0x90ec=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./userSmsQueue.attributes','exports','UserSmsQueue','user_has_sms_queues'];(function(_0x2f3d29,_0x150e7b){var _0x53d69d=function(_0x45f6ec){while(--_0x45f6ec){_0x2f3d29['push'](_0x2f3d29['shift']());}};_0x53d69d(++_0x150e7b);}(_0x90ec,0x1d4));var _0xc90e=function(_0x59d726,_0x4d5832){_0x59d726=_0x59d726-0x0;var _0xe77ce1=_0x90ec[_0x59d726];return _0xe77ce1;};'use strict';var _=require(_0xc90e('0x0'));var util=require(_0xc90e('0x1'));var logger=require('../../config/logger')(_0xc90e('0x2'));var moment=require(_0xc90e('0x3'));var BPromise=require(_0xc90e('0x4'));var rp=require(_0xc90e('0x5'));var fs=require('fs');var path=require(_0xc90e('0x6'));var rimraf=require('rimraf');var config=require(_0xc90e('0x7'));var attributes=require(_0xc90e('0x8'));module[_0xc90e('0x9')]=function(_0x54a0a8,_0x259c62){return _0x54a0a8['define'](_0xc90e('0xa'),attributes,{'tableName':_0xc90e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa46e=['api','moment','bluebird','path','../../config/environment','exports','define','user_has_sms_queues','lodash','util'];(function(_0x13137e,_0x29c0f3){var _0x346261=function(_0x8c7d4f){while(--_0x8c7d4f){_0x13137e['push'](_0x13137e['shift']());}};_0x346261(++_0x29c0f3);}(_0xa46e,0x8a));var _0xea46=function(_0x35d775,_0x25431e){_0x35d775=_0x35d775-0x0;var _0x59384d=_0xa46e[_0x35d775];return _0x59384d;};'use strict';var _=require(_0xea46('0x0'));var util=require(_0xea46('0x1'));var logger=require('../../config/logger')(_0xea46('0x2'));var moment=require(_0xea46('0x3'));var BPromise=require(_0xea46('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xea46('0x5'));var rimraf=require('rimraf');var config=require(_0xea46('0x6'));var attributes=require('./userSmsQueue.attributes');module[_0xea46('0x7')]=function(_0x528404,_0x10bee5){return _0x528404[_0xea46('0x8')]('UserSmsQueue',attributes,{'tableName':_0xea46('0x9'),'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 f0b4ac7..6b9a25d 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 _0xce16=['error','code','message','catch','lodash','util','moment','bluebird','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s'];(function(_0x276232,_0x20b6b8){var _0x427024=function(_0x2e7ff8){while(--_0x2e7ff8){_0x276232['push'](_0x276232['shift']());}};_0x427024(++_0x20b6b8);}(_0xce16,0x68));var _0x6ce1=function(_0x6cf82d,_0x398fe5){_0x6cf82d=_0x6cf82d-0x0;var _0x193809=_0xce16[_0x6cf82d];return _0x193809;};'use strict';var _=require(_0x6ce1('0x0'));var util=require(_0x6ce1('0x1'));var moment=require(_0x6ce1('0x2'));var BPromise=require(_0x6ce1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6ce1('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6ce1('0x5'));var config=require(_0x6ce1('0x6'));var jayson=require(_0x6ce1('0x7'));var client=jayson[_0x6ce1('0x8')][_0x6ce1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x35dc76,_0x4b2392,_0xd97bbe){return new BPromise(function(_0x52b9fc,_0x31efed){return client['request'](_0x35dc76,_0xd97bbe)[_0x6ce1('0xa')](function(_0x3a964f){logger[_0x6ce1('0xb')](_0x6ce1('0xc'),_0x4b2392,_0x6ce1('0xd'));logger[_0x6ce1('0xe')](_0x6ce1('0xf'),_0x4b2392,_0x6ce1('0xd'),JSON['stringify'](_0x3a964f));if(_0x3a964f[_0x6ce1('0x10')]){if(_0x3a964f['error'][_0x6ce1('0x11')]===0x1f4){logger['error'](_0x6ce1('0xc'),_0x4b2392,_0x3a964f[_0x6ce1('0x10')]['message']);return _0x31efed(_0x3a964f[_0x6ce1('0x10')][_0x6ce1('0x12')]);}logger[_0x6ce1('0x10')]('UserSmsQueue,\x20%s,\x20%s',_0x4b2392,_0x3a964f[_0x6ce1('0x10')][_0x6ce1('0x12')]);return _0x52b9fc(_0x3a964f[_0x6ce1('0x10')][_0x6ce1('0x12')]);}else{logger[_0x6ce1('0xb')]('UserSmsQueue,\x20%s,\x20%s',_0x4b2392,_0x6ce1('0xd'));_0x52b9fc(_0x3a964f['result'][_0x6ce1('0x12')]);}})[_0x6ce1('0x13')](function(_0x35b94d){logger[_0x6ce1('0x10')](_0x6ce1('0xc'),_0x4b2392,_0x35b94d);_0x31efed(_0x35b94d);});});} \ No newline at end of file +var _0x382f=['debug','request\x20sent','stringify','code','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x382f,0x17f));var _0xf382=function(_0x3c1135,_0x57da89){_0x3c1135=_0x3c1135-0x0;var _0x414986=_0x382f[_0x3c1135];return _0x414986;};'use strict';var _=require(_0xf382('0x0'));var util=require('util');var moment=require(_0xf382('0x1'));var BPromise=require(_0xf382('0x2'));var rs=require(_0xf382('0x3'));var fs=require('fs');var Redis=require(_0xf382('0x4'));var db=require(_0xf382('0x5'))['db'];var utils=require(_0xf382('0x6'));var logger=require(_0xf382('0x7'))(_0xf382('0x8'));var config=require(_0xf382('0x9'));var jayson=require(_0xf382('0xa'));var client=jayson[_0xf382('0xb')][_0xf382('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x351ee3,_0x5e9421,_0x508240){return new BPromise(function(_0x47dca9,_0x4fb301){return client[_0xf382('0xd')](_0x351ee3,_0x508240)[_0xf382('0xe')](function(_0x214f0a){logger[_0xf382('0xf')](_0xf382('0x10'),_0x5e9421,'request\x20sent');logger[_0xf382('0x11')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x5e9421,_0xf382('0x12'),JSON[_0xf382('0x13')](_0x214f0a));if(_0x214f0a['error']){if(_0x214f0a['error'][_0xf382('0x14')]===0x1f4){logger[_0xf382('0x15')](_0xf382('0x10'),_0x5e9421,_0x214f0a[_0xf382('0x15')]['message']);return _0x4fb301(_0x214f0a[_0xf382('0x15')][_0xf382('0x16')]);}logger['error'](_0xf382('0x10'),_0x5e9421,_0x214f0a[_0xf382('0x15')]['message']);return _0x47dca9(_0x214f0a[_0xf382('0x15')]['message']);}else{logger[_0xf382('0xf')](_0xf382('0x10'),_0x5e9421,_0xf382('0x12'));_0x47dca9(_0x214f0a[_0xf382('0x17')][_0xf382('0x16')]);}})[_0xf382('0x18')](function(_0xf80e3c){logger[_0xf382('0x15')](_0xf382('0x10'),_0x5e9421,_0xf80e3c);_0x4fb301(_0xf80e3c);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 68fb659..cdd51a3 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 _0xfa56=['sequelize','INTEGER'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xfa56,0xca));var _0x6fa5=function(_0x5b58ad,_0x14406f){_0x5b58ad=_0x5b58ad-0x0;var _0x3d3e46=_0xfa56[_0x5b58ad];return _0x3d3e46;};'use strict';var Sequelize=require(_0x6fa5('0x0'));module['exports']={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x6fa5('0x1')]}}; \ No newline at end of file +var _0x014b=['INTEGER','sequelize','exports'];(function(_0x3fcfb6,_0x515024){var _0x3b99a7=function(_0x10ddfd){while(--_0x10ddfd){_0x3fcfb6['push'](_0x3fcfb6['shift']());}};_0x3b99a7(++_0x515024);}(_0x014b,0xbb));var _0xb014=function(_0x146beb,_0x57b1f4){_0x146beb=_0x146beb-0x0;var _0x404c81=_0x014b[_0x146beb];return _0x404c81;};'use strict';var Sequelize=require(_0xb014('0x0'));module[_0xb014('0x1')]={'UserId':{'type':Sequelize[_0xb014('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xb014('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 01d2638..3f6787e 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(_0xe2b531,_0x1d9fd2){var _0x167d0b=function(_0x512053){while(--_0x512053){_0xe2b531['push'](_0xe2b531['shift']());}};_0x167d0b(++_0x1d9fd2);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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(_0x2207c4,_0x252dd5){var _0x103576=function(_0x1a88c4){while(--_0x1a88c4){_0x2207c4['push'](_0x2207c4['shift']());}};_0x103576(++_0x252dd5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'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 8dc5800..45bdbe6 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x536295,_0x436f44){var _0x58879d=function(_0x28cd1b){while(--_0x28cd1b){_0x536295['push'](_0x536295['shift']());}};_0x58879d(++_0x436f44);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x1ad5a2,_0x45632b){var _0x51eba3=function(_0x38a6ce){while(--_0x38a6ce){_0x1ad5a2['push'](_0x1ad5a2['shift']());}};_0x51eba3(++_0x45632b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('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 2e0d194..3207d9b 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 _0x9e5c=['INTEGER','sequelize'];(function(_0x1937e5,_0x53e7d3){var _0x1215a1=function(_0x32fd90){while(--_0x32fd90){_0x1937e5['push'](_0x1937e5['shift']());}};_0x1215a1(++_0x53e7d3);}(_0x9e5c,0x17f));var _0xc9e5=function(_0x57a324,_0xbbd5f4){_0x57a324=_0x57a324-0x0;var _0x4a0beb=_0x9e5c[_0x57a324];return _0x4a0beb;};'use strict';var Sequelize=require(_0xc9e5('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xc9e5('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb381=['exports','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb381,0x177));var _0x1b38=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xb381[_0x3ab9ee];return _0x82ee88;};'use strict';var Sequelize=require(_0x1b38('0x0'));module[_0x1b38('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 88b9d58..7e4eca6 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 _0xfd20=['rimraf','./userVoiceQueue.attributes','define','UserVoiceQueue','util','../../config/logger','api','moment','request-promise','path'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xfd20,0xfe));var _0x0fd2=function(_0x580256,_0x3110ed){_0x580256=_0x580256-0x0;var _0x34e885=_0xfd20[_0x580256];return _0x34e885;};'use strict';var _=require('lodash');var util=require(_0x0fd2('0x0'));var logger=require(_0x0fd2('0x1'))(_0x0fd2('0x2'));var moment=require(_0x0fd2('0x3'));var BPromise=require('bluebird');var rp=require(_0x0fd2('0x4'));var fs=require('fs');var path=require(_0x0fd2('0x5'));var rimraf=require(_0x0fd2('0x6'));var config=require('../../config/environment');var attributes=require(_0x0fd2('0x7'));module['exports']=function(_0x2c7bd4,_0x8e0e94){return _0x2c7bd4[_0x0fd2('0x8')](_0x0fd2('0x9'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8158=['moment','path','rimraf','./userVoiceQueue.attributes','exports','define','user_has_voice_queues','lodash','util','../../config/logger','api'];(function(_0xcf88b4,_0xac682f){var _0x42984c=function(_0x25869e){while(--_0x25869e){_0xcf88b4['push'](_0xcf88b4['shift']());}};_0x42984c(++_0xac682f);}(_0x8158,0x1eb));var _0x8815=function(_0x176305,_0x5d8973){_0x176305=_0x176305-0x0;var _0x3aa891=_0x8158[_0x176305];return _0x3aa891;};'use strict';var _=require(_0x8815('0x0'));var util=require(_0x8815('0x1'));var logger=require(_0x8815('0x2'))(_0x8815('0x3'));var moment=require(_0x8815('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8815('0x5'));var rimraf=require(_0x8815('0x6'));var config=require('../../config/environment');var attributes=require(_0x8815('0x7'));module[_0x8815('0x8')]=function(_0x1c73ae,_0xdd4889){return _0x1c73ae[_0x8815('0x9')]('UserVoiceQueue',attributes,{'tableName':_0x8815('0xa'),'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 4393d4a..3899567 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 _0x4286=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x50b1ff,_0x1165ba){var _0xda0c37=function(_0x4d0d22){while(--_0x4d0d22){_0x50b1ff['push'](_0x50b1ff['shift']());}};_0xda0c37(++_0x1165ba);}(_0x4286,0x1a1));var _0x6428=function(_0x31980f,_0x13653b){_0x31980f=_0x31980f-0x0;var _0x3e2304=_0x4286[_0x31980f];return _0x3e2304;};'use strict';var _=require(_0x6428('0x0'));var util=require(_0x6428('0x1'));var moment=require('moment');var BPromise=require(_0x6428('0x2'));var rs=require(_0x6428('0x3'));var fs=require('fs');var Redis=require(_0x6428('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6428('0x5'));var logger=require('../../config/logger')(_0x6428('0x6'));var config=require(_0x6428('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6428('0x8')][_0x6428('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x11667c,_0x3a1bec,_0x247067){return new BPromise(function(_0x438cf9,_0x258d22){return client[_0x6428('0xa')](_0x11667c,_0x247067)[_0x6428('0xb')](function(_0x486f51){logger[_0x6428('0xc')](_0x6428('0xd'),_0x3a1bec,_0x6428('0xe'));logger[_0x6428('0xf')](_0x6428('0x10'),_0x3a1bec,_0x6428('0xe'),JSON[_0x6428('0x11')](_0x486f51));if(_0x486f51[_0x6428('0x12')]){if(_0x486f51[_0x6428('0x12')][_0x6428('0x13')]===0x1f4){logger[_0x6428('0x12')](_0x6428('0xd'),_0x3a1bec,_0x486f51[_0x6428('0x12')]['message']);return _0x258d22(_0x486f51[_0x6428('0x12')][_0x6428('0x14')]);}logger[_0x6428('0x12')](_0x6428('0xd'),_0x3a1bec,_0x486f51[_0x6428('0x12')][_0x6428('0x14')]);return _0x438cf9(_0x486f51[_0x6428('0x12')][_0x6428('0x14')]);}else{logger[_0x6428('0xc')](_0x6428('0xd'),_0x3a1bec,_0x6428('0xe'));_0x438cf9(_0x486f51[_0x6428('0x15')][_0x6428('0x14')]);}})[_0x6428('0x16')](function(_0x1aeca4){logger[_0x6428('0x12')](_0x6428('0xd'),_0x3a1bec,_0x1aeca4);_0x258d22(_0x1aeca4);});});} \ No newline at end of file +var _0x8c23=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x515eac,_0x3becb2){var _0x1c4774=function(_0x57ffd1){while(--_0x57ffd1){_0x515eac['push'](_0x515eac['shift']());}};_0x1c4774(++_0x3becb2);}(_0x8c23,0x10b));var _0x38c2=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x8c23[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0x38c2('0x0'));var util=require(_0x38c2('0x1'));var moment=require(_0x38c2('0x2'));var BPromise=require(_0x38c2('0x3'));var rs=require(_0x38c2('0x4'));var fs=require('fs');var Redis=require(_0x38c2('0x5'));var db=require(_0x38c2('0x6'))['db'];var utils=require(_0x38c2('0x7'));var logger=require(_0x38c2('0x8'))(_0x38c2('0x9'));var config=require(_0x38c2('0xa'));var jayson=require(_0x38c2('0xb'));var client=jayson[_0x38c2('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22f5c4,_0x420c66,_0xba45a6){return new BPromise(function(_0x431acd,_0x468c12){return client[_0x38c2('0xd')](_0x22f5c4,_0xba45a6)[_0x38c2('0xe')](function(_0x544973){logger[_0x38c2('0xf')](_0x38c2('0x10'),_0x420c66,_0x38c2('0x11'));logger['debug'](_0x38c2('0x12'),_0x420c66,_0x38c2('0x11'),JSON[_0x38c2('0x13')](_0x544973));if(_0x544973[_0x38c2('0x14')]){if(_0x544973[_0x38c2('0x14')][_0x38c2('0x15')]===0x1f4){logger[_0x38c2('0x14')]('UserVoiceQueue,\x20%s,\x20%s',_0x420c66,_0x544973[_0x38c2('0x14')][_0x38c2('0x16')]);return _0x468c12(_0x544973[_0x38c2('0x14')][_0x38c2('0x16')]);}logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x420c66,_0x544973[_0x38c2('0x14')]['message']);return _0x431acd(_0x544973[_0x38c2('0x14')]['message']);}else{logger[_0x38c2('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x420c66,_0x38c2('0x11'));_0x431acd(_0x544973[_0x38c2('0x17')]['message']);}})[_0x38c2('0x18')](function(_0x1a889e){logger[_0x38c2('0x14')](_0x38c2('0x10'),_0x420c66,_0x1a889e);_0x468c12(_0x1a889e);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index a59c847..6f9f808 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x91b043,_0x540ff2){var _0xc54353=function(_0xbbc189){while(--_0xbbc189){_0x91b043['push'](_0x91b043['shift']());}};_0xc54353(++_0x540ff2);}(_0xedd9,0xfc));var _0x9edd=function(_0x37cd0c,_0x3a94ce){_0x37cd0c=_0x37cd0c-0x0;var _0x4cdce7=_0xedd9[_0x37cd0c];return _0x4cdce7;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x100f52,_0x4e70f8){var _0xbd959f=function(_0x354263){while(--_0x354263){_0x100f52['push'](_0x100f52['shift']());}};_0xbd959f(++_0x4e70f8);}(_0x70e0,0x17b));var _0x070e=function(_0x2e1fd9,_0x50a01d){_0x2e1fd9=_0x2e1fd9-0x0;var _0x284b31=_0x70e0[_0x2e1fd9];return _0x284b31;};'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 c2b7327..09bd664 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 _0x263d=['INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','sequelize'];(function(_0x53072e,_0xdb61f1){var _0x2b0690=function(_0x21db60){while(--_0x21db60){_0x53072e['push'](_0x53072e['shift']());}};_0x2b0690(++_0xdb61f1);}(_0x263d,0x8b));var _0xd263=function(_0x57928b,_0x29a111){_0x57928b=_0x57928b-0x0;var _0x49aad6=_0x263d[_0x57928b];return _0x49aad6;};'use strict';var Sequelize=require(_0xd263('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xd263('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xd263('0x2')},'membername':{'type':Sequelize[_0xd263('0x3')],'allowNull':![],'comment':_0xd263('0x2')},'UserId':{'type':Sequelize[_0xd263('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xd263('0x3')],'allowNull':![],'unique':_0xd263('0x4'),'comment':_0xd263('0x2')},'VoiceQueueId':{'type':Sequelize[_0xd263('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0xd263('0x3')],'allowNull':![],'unique':_0xd263('0x4'),'comment':_0xd263('0x2')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xd263('0x2')},'paused':{'type':Sequelize[_0xd263('0x1')](0xb),'defaultValue':0x0,'comment':_0xd263('0x2')}}; \ No newline at end of file +var _0xd9dc=['sequelize','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x4fe19c,_0x45d0fe){var _0x952ac7=function(_0x274a16){while(--_0x274a16){_0x4fe19c['push'](_0x4fe19c['shift']());}};_0x952ac7(++_0x45d0fe);}(_0xd9dc,0x18b));var _0xcd9d=function(_0x1d2fb7,_0x46f357){_0x1d2fb7=_0x1d2fb7-0x0;var _0x4fadd9=_0xd9dc[_0x1d2fb7];return _0x4fadd9;};'use strict';var Sequelize=require(_0xcd9d('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xcd9d('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xcd9d('0x2')},'membername':{'type':Sequelize[_0xcd9d('0x3')],'allowNull':![],'comment':_0xcd9d('0x2')},'UserId':{'type':Sequelize[_0xcd9d('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xcd9d('0x3')],'allowNull':![],'unique':_0xcd9d('0x4'),'comment':_0xcd9d('0x2')},'VoiceQueueId':{'type':Sequelize[_0xcd9d('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0xcd9d('0x3')],'allowNull':![],'unique':_0xcd9d('0x4'),'comment':_0xcd9d('0x2')},'penalty':{'type':Sequelize[_0xcd9d('0x1')](0xb),'defaultValue':0x0,'comment':_0xcd9d('0x2')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xcd9d('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index be9d827..a960215 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 _0x178e=['exports','setMaxListeners','save','emit','hasOwnProperty','hook'];(function(_0x12c7b1,_0x5a9edc){var _0x7d2760=function(_0x5df2a8){while(--_0x5df2a8){_0x12c7b1['push'](_0x12c7b1['shift']());}};_0x7d2760(++_0x5a9edc);}(_0x178e,0x133));var _0xe178=function(_0x332a78,_0x4d38b3){_0x332a78=_0x332a78-0x0;var _0x537ac5=_0x178e[_0x332a78];return _0x537ac5;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require('../../mysqldb')['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xe178('0x0')](0x0);var events={'afterCreate':_0xe178('0x1'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5239de){return function(_0x52a5c2,_0x346cd8,_0x7ea7a7){UserVoiceQueueRtEvents[_0xe178('0x2')](_0x5239de+':'+_0x52a5c2['id'],_0x52a5c2);UserVoiceQueueRtEvents['emit'](_0x5239de,_0x52a5c2);_0x7ea7a7(null);};}for(var e in events){if(events[_0xe178('0x3')](e)){var event=events[e];UserVoiceQueueRt[_0xe178('0x4')](e,emitEvent(event));}}module[_0xe178('0x5')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xd22c=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners'];(function(_0x5ae93d,_0x48a929){var _0x3bc344=function(_0x37d1e8){while(--_0x37d1e8){_0x5ae93d['push'](_0x5ae93d['shift']());}};_0x3bc344(++_0x48a929);}(_0xd22c,0xa6));var _0xcd22=function(_0x5645ad,_0x580ea3){_0x5645ad=_0x5645ad-0x0;var _0x17d292=_0xd22c[_0x5645ad];return _0x17d292;};'use strict';var EventEmitter=require(_0xcd22('0x0'));var UserVoiceQueueRt=require(_0xcd22('0x1'))['db'][_0xcd22('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xcd22('0x3')](0x0);var events={'afterCreate':_0xcd22('0x4'),'afterUpdate':'update','afterDestroy':_0xcd22('0x5')};function emitEvent(_0x26e7e5){return function(_0x585a6f,_0xf957bd,_0x407f92){UserVoiceQueueRtEvents['emit'](_0x26e7e5+':'+_0x585a6f['id'],_0x585a6f);UserVoiceQueueRtEvents[_0xcd22('0x6')](_0x26e7e5,_0x585a6f);_0x407f92(null);};}for(var e in events){if(events[_0xcd22('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0xcd22('0x8')](e,emitEvent(event));}}module[_0xcd22('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 07dbc74..b8954a6 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 _0x1395=['path','rimraf','../../config/environment','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x30c9fd,_0x2614f0){var _0x397b35=function(_0x59df58){while(--_0x59df58){_0x30c9fd['push'](_0x30c9fd['shift']());}};_0x397b35(++_0x2614f0);}(_0x1395,0x165));var _0x5139=function(_0x4e6011,_0x1f92b9){_0x4e6011=_0x4e6011-0x0;var _0x3b5abc=_0x1395[_0x4e6011];return _0x3b5abc;};'use strict';var _=require(_0x5139('0x0'));var util=require(_0x5139('0x1'));var logger=require(_0x5139('0x2'))(_0x5139('0x3'));var moment=require(_0x5139('0x4'));var BPromise=require(_0x5139('0x5'));var rp=require(_0x5139('0x6'));var fs=require('fs');var path=require(_0x5139('0x7'));var rimraf=require(_0x5139('0x8'));var config=require(_0x5139('0x9'));var attributes=require('./userVoiceQueueRt.attributes');module['exports']=function(_0x46de24,_0x5af228){return _0x46de24[_0x5139('0xa')](_0x5139('0xb'),attributes,{'tableName':_0x5139('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6838=['exports','define','UserVoiceQueueRt','lodash','util','../../config/logger','api','moment','request-promise','rimraf','./userVoiceQueueRt.attributes'];(function(_0x11787e,_0x4f308f){var _0x2f2a2e=function(_0x506ffe){while(--_0x506ffe){_0x11787e['push'](_0x11787e['shift']());}};_0x2f2a2e(++_0x4f308f);}(_0x6838,0xd4));var _0x8683=function(_0x4af2c3,_0xf4d1f4){_0x4af2c3=_0x4af2c3-0x0;var _0x74088=_0x6838[_0x4af2c3];return _0x74088;};'use strict';var _=require(_0x8683('0x0'));var util=require(_0x8683('0x1'));var logger=require(_0x8683('0x2'))(_0x8683('0x3'));var moment=require(_0x8683('0x4'));var BPromise=require('bluebird');var rp=require(_0x8683('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8683('0x6'));var config=require('../../config/environment');var attributes=require(_0x8683('0x7'));module[_0x8683('0x8')]=function(_0xadb185,_0x109e42){return _0xadb185[_0x8683('0x9')](_0x8683('0xa'),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 7dbbbe2..a31880a 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 _0xdff7=['http','redis','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UserVoiceQueueRt','findAll','options','raw','sequelize','literal','GetVoiceQueueRtPauses','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2052e8,_0x4706df){var _0x4bb84f=function(_0x128235){while(--_0x128235){_0x2052e8['push'](_0x2052e8['shift']());}};_0x4bb84f(++_0x4706df);}(_0xdff7,0x18e));var _0x7dff=function(_0x48fd1b,_0xf73812){_0x48fd1b=_0x48fd1b-0x0;var _0x7370d9=_0xdff7[_0x48fd1b];return _0x7370d9;};'use strict';var _=require(_0x7dff('0x0'));var util=require(_0x7dff('0x1'));var moment=require(_0x7dff('0x2'));var BPromise=require(_0x7dff('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7dff('0x4'));var logger=require(_0x7dff('0x5'))(_0x7dff('0x6'));var config=require(_0x7dff('0x7'));var jayson=require(_0x7dff('0x8'));var client=jayson[_0x7dff('0x9')][_0x7dff('0xa')]({'port':0x232a});config[_0x7dff('0xb')]=_['defaults'](config[_0x7dff('0xb')],{'host':_0x7dff('0xc'),'port':0x18eb});var socket=require(_0x7dff('0xd'))(new Redis(config[_0x7dff('0xb')]));require(_0x7dff('0xe'))[_0x7dff('0xf')](socket);function respondWithRpcPromise(_0x211f1a,_0x50149d,_0x624f54){return new BPromise(function(_0x5fabcc,_0x368b76){return client[_0x7dff('0x10')](_0x211f1a,_0x624f54)[_0x7dff('0x11')](function(_0x58ef6a){logger[_0x7dff('0x12')](_0x7dff('0x13'),_0x50149d,_0x7dff('0x14'));logger[_0x7dff('0x15')](_0x7dff('0x16'),_0x50149d,'request\x20sent',JSON[_0x7dff('0x17')](_0x58ef6a));if(_0x58ef6a[_0x7dff('0x18')]){if(_0x58ef6a[_0x7dff('0x18')]['code']===0x1f4){logger[_0x7dff('0x18')](_0x7dff('0x13'),_0x50149d,_0x58ef6a[_0x7dff('0x18')][_0x7dff('0x19')]);return _0x368b76(_0x58ef6a[_0x7dff('0x18')][_0x7dff('0x19')]);}logger[_0x7dff('0x18')](_0x7dff('0x13'),_0x50149d,_0x58ef6a[_0x7dff('0x18')]['message']);return _0x5fabcc(_0x58ef6a[_0x7dff('0x18')][_0x7dff('0x19')]);}else{logger['info'](_0x7dff('0x13'),_0x50149d,_0x7dff('0x14'));_0x5fabcc(_0x58ef6a['result']['message']);}})[_0x7dff('0x1a')](function(_0x40f557){logger['error'](_0x7dff('0x13'),_0x50149d,_0x40f557);_0x368b76(_0x40f557);});});}exports['GetVoiceQueueRtPauses']=function(_0x186daf){var _0x42dcfb=this;return new Promise(function(_0xf8785b,_0xc9dfd2){return db[_0x7dff('0x1b')][_0x7dff('0x1c')]({'raw':_0x186daf[_0x7dff('0x1d')]?_0x186daf['options'][_0x7dff('0x1e')]===undefined?!![]:![]:!![],'where':_0x186daf[_0x7dff('0x1d')]?_0x186daf[_0x7dff('0x1d')]['where']||null:null,'attributes':[[db[_0x7dff('0x1f')]['fn']('COUNT',db[_0x7dff('0x1f')]['fn']('IF',db[_0x7dff('0x1f')][_0x7dff('0x20')]('`paused`\x20=\x201,\x201,\x20null'))),'outboundQueuePauses']]})[_0x7dff('0x11')](function(_0x19c32f){logger[_0x7dff('0x12')](_0x7dff('0x21'),_0x186daf);logger[_0x7dff('0x15')](_0x7dff('0x21'),_0x186daf,JSON['stringify'](_0x19c32f));_0xf8785b(_0x19c32f);})[_0x7dff('0x1a')](function(_0x746663){logger['error'](_0x7dff('0x21'),_0x746663['message'],_0x186daf);_0xc9dfd2(_0x42dcfb['error'](0x1f4,_0x746663['message']));});});}; \ No newline at end of file +var _0xc240=['error','code','message','result','UserVoiceQueueRt','options','where','COUNT','sequelize','literal','then','GetVoiceQueueRtPauses','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./userVoiceQueueRt.socket','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4fdc67,_0x438bee){var _0x2c4988=function(_0x31da8b){while(--_0x31da8b){_0x4fdc67['push'](_0x4fdc67['shift']());}};_0x2c4988(++_0x438bee);}(_0xc240,0x109));var _0x0c24=function(_0x2cc1f0,_0x27e8f2){_0x2cc1f0=_0x2cc1f0-0x0;var _0x2856f5=_0xc240[_0x2cc1f0];return _0x2856f5;};'use strict';var _=require(_0x0c24('0x0'));var util=require(_0x0c24('0x1'));var moment=require(_0x0c24('0x2'));var BPromise=require(_0x0c24('0x3'));var rs=require(_0x0c24('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0c24('0x5'))['db'];var utils=require(_0x0c24('0x6'));var logger=require(_0x0c24('0x7'))(_0x0c24('0x8'));var config=require(_0x0c24('0x9'));var jayson=require(_0x0c24('0xa'));var client=jayson[_0x0c24('0xb')][_0x0c24('0xc')]({'port':0x232a});config[_0x0c24('0xd')]=_[_0x0c24('0xe')](config['redis'],{'host':_0x0c24('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0c24('0xd')]));require(_0x0c24('0x10'))['register'](socket);function respondWithRpcPromise(_0x1768de,_0x22390f,_0x4a5855){return new BPromise(function(_0x2f89ba,_0x3a708c){return client['request'](_0x1768de,_0x4a5855)['then'](function(_0x558b8a){logger[_0x0c24('0x11')](_0x0c24('0x12'),_0x22390f,_0x0c24('0x13'));logger[_0x0c24('0x14')](_0x0c24('0x15'),_0x22390f,_0x0c24('0x13'),JSON[_0x0c24('0x16')](_0x558b8a));if(_0x558b8a['error']){if(_0x558b8a[_0x0c24('0x17')][_0x0c24('0x18')]===0x1f4){logger[_0x0c24('0x17')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x22390f,_0x558b8a[_0x0c24('0x17')][_0x0c24('0x19')]);return _0x3a708c(_0x558b8a[_0x0c24('0x17')][_0x0c24('0x19')]);}logger[_0x0c24('0x17')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x22390f,_0x558b8a[_0x0c24('0x17')]['message']);return _0x2f89ba(_0x558b8a['error'][_0x0c24('0x19')]);}else{logger[_0x0c24('0x11')](_0x0c24('0x12'),_0x22390f,_0x0c24('0x13'));_0x2f89ba(_0x558b8a[_0x0c24('0x1a')]['message']);}})['catch'](function(_0x387d14){logger[_0x0c24('0x17')](_0x0c24('0x12'),_0x22390f,_0x387d14);_0x3a708c(_0x387d14);});});}exports['GetVoiceQueueRtPauses']=function(_0x59ddad){var _0x4d8429=this;return new Promise(function(_0x85da2a,_0x55d956){return db[_0x0c24('0x1b')]['findAll']({'raw':_0x59ddad['options']?_0x59ddad[_0x0c24('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x59ddad[_0x0c24('0x1c')]?_0x59ddad[_0x0c24('0x1c')][_0x0c24('0x1d')]||null:null,'attributes':[[db['sequelize']['fn'](_0x0c24('0x1e'),db['sequelize']['fn']('IF',db[_0x0c24('0x1f')][_0x0c24('0x20')]('`paused`\x20=\x201,\x201,\x20null'))),'outboundQueuePauses']]})[_0x0c24('0x21')](function(_0x2b71f5){logger[_0x0c24('0x11')](_0x0c24('0x22'),_0x59ddad);logger[_0x0c24('0x14')](_0x0c24('0x22'),_0x59ddad,JSON[_0x0c24('0x16')](_0x2b71f5));_0x85da2a(_0x2b71f5);})[_0x0c24('0x23')](function(_0x35bba7){logger[_0x0c24('0x17')]('GetVoiceQueueRtPauses',_0x35bba7[_0x0c24('0x19')],_0x59ddad);_0x55d956(_0x4d8429[_0x0c24('0x17')](0x1f4,_0x35bba7['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 62e0d2b..024de2b 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 _0x199c=['emit','register','length','userVoiceQueueRt:','remove','update'];(function(_0x105a8a,_0x15a3a2){var _0x105a0e=function(_0x3beeb1){while(--_0x3beeb1){_0x105a8a['push'](_0x105a8a['shift']());}};_0x105a0e(++_0x15a3a2);}(_0x199c,0x1d8));var _0xc199=function(_0x269fba,_0xa68777){_0x269fba=_0x269fba-0x0;var _0x1eeb74=_0x199c[_0x269fba];return _0x1eeb74;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=['save',_0xc199('0x0'),_0xc199('0x1')];function createListener(_0xf15666,_0x3e0b15){return function(_0x124132){_0x3e0b15[_0xc199('0x2')](_0xf15666,_0x124132);};}function removeListener(_0x3f06cc,_0x1eecc2){return function(){UserVoiceQueueRtEvents['removeListener'](_0x3f06cc,_0x1eecc2);};}exports[_0xc199('0x3')]=function(_0x2ff172){for(var _0x499721=0x0,_0x4cd9cb=events[_0xc199('0x4')];_0x499721<_0x4cd9cb;_0x499721++){var _0x126236=events[_0x499721];var _0x12d6df=createListener(_0xc199('0x5')+_0x126236,_0x2ff172);UserVoiceQueueRtEvents['on'](_0x126236,_0x12d6df);}}; \ No newline at end of file +var _0x522b=['removeListener','register','length','./userVoiceQueueRt.events','save','update','emit'];(function(_0x3ed472,_0x41ec7c){var _0x3dc35c=function(_0xbd1070){while(--_0xbd1070){_0x3ed472['push'](_0x3ed472['shift']());}};_0x3dc35c(++_0x41ec7c);}(_0x522b,0x1c3));var _0xb522=function(_0x37ded3,_0x371ebb){_0x37ded3=_0x37ded3-0x0;var _0x51e49e=_0x522b[_0x37ded3];return _0x51e49e;};'use strict';var UserVoiceQueueRtEvents=require(_0xb522('0x0'));var events=[_0xb522('0x1'),'remove',_0xb522('0x2')];function createListener(_0x54310f,_0x4a9709){return function(_0x3519a9){_0x4a9709[_0xb522('0x3')](_0x54310f,_0x3519a9);};}function removeListener(_0x52cd65,_0x335c92){return function(){UserVoiceQueueRtEvents[_0xb522('0x4')](_0x52cd65,_0x335c92);};}exports[_0xb522('0x5')]=function(_0x2fca5b){for(var _0x47bd53=0x0,_0x55a5f0=events[_0xb522('0x6')];_0x47bd53<_0x55a5f0;_0x47bd53++){var _0x2f289f=events[_0x47bd53];var _0x5a5cd3=createListener('userVoiceQueueRt:'+_0x2f289f,_0x2fca5b);UserVoiceQueueRtEvents['on'](_0x2f289f,_0x5a5cd3);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index eb72ea9..9840e5b 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x253745,_0x31e25b){var _0x2b94ee=function(_0x64e66a){while(--_0x64e66a){_0x253745['push'](_0x253745['shift']());}};_0x2b94ee(++_0x31e25b);}(_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(_0x53e1ca,_0x245670){var _0x4789f9=function(_0x111033){while(--_0x111033){_0x53e1ca['push'](_0x53e1ca['shift']());}};_0x4789f9(++_0x245670);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5d07ff,_0x1f976f){_0x5d07ff=_0x5d07ff-0x0;var _0x5226ad=_0xcb91[_0x5d07ff];return _0x5226ad;};'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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 9d92b61..9006424 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 _0xefbf=['exports','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xefbf,0xa3));var _0xfefb=function(_0x91cbd2,_0x1e5e94){_0x91cbd2=_0x91cbd2-0x0;var _0x232c8a=_0xefbf[_0x91cbd2];return _0x232c8a;};'use strict';var Sequelize=require(_0xfefb('0x0'));module[_0xfefb('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +'use strict';var Sequelize=require('sequelize');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 637b600..9f25f31 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 _0x3880=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','UserWhatsappQueue','user_has_whatsapp_queues','util'];(function(_0x1197b0,_0x3b6e34){var _0x42aa68=function(_0x2f0265){while(--_0x2f0265){_0x1197b0['push'](_0x1197b0['shift']());}};_0x42aa68(++_0x3b6e34);}(_0x3880,0x197));var _0x0388=function(_0x22c03d,_0x3e6ae5){_0x22c03d=_0x22c03d-0x0;var _0x3e0e85=_0x3880[_0x22c03d];return _0x3e0e85;};'use strict';var _=require('lodash');var util=require(_0x0388('0x0'));var logger=require(_0x0388('0x1'))(_0x0388('0x2'));var moment=require(_0x0388('0x3'));var BPromise=require('bluebird');var rp=require(_0x0388('0x4'));var fs=require('fs');var path=require(_0x0388('0x5'));var rimraf=require(_0x0388('0x6'));var config=require(_0x0388('0x7'));var attributes=require(_0x0388('0x8'));module[_0x0388('0x9')]=function(_0x4a1632,_0x36cd04){return _0x4a1632['define'](_0x0388('0xa'),attributes,{'tableName':_0x0388('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xce2d=['api','path','../../config/environment','exports','define','UserWhatsappQueue','lodash','../../config/logger'];(function(_0x3fe287,_0x2cf321){var _0x2dcfd2=function(_0x14eb6f){while(--_0x14eb6f){_0x3fe287['push'](_0x3fe287['shift']());}};_0x2dcfd2(++_0x2cf321);}(_0xce2d,0x19e));var _0xdce2=function(_0x549965,_0x153283){_0x549965=_0x549965-0x0;var _0x1399a0=_0xce2d[_0x549965];return _0x1399a0;};'use strict';var _=require(_0xdce2('0x0'));var util=require('util');var logger=require(_0xdce2('0x1'))(_0xdce2('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdce2('0x3'));var rimraf=require('rimraf');var config=require(_0xdce2('0x4'));var attributes=require('./userWhatsappQueue.attributes');module[_0xdce2('0x5')]=function(_0x30de1b,_0xed2047){return _0x30de1b[_0xdce2('0x6')](_0xdce2('0x7'),attributes,{'tableName':'user_has_whatsapp_queues','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 88c6cca..73084e9 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 _0xcb19=['../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis'];(function(_0x292f93,_0x2c6e8e){var _0x5a94b1=function(_0x25735e){while(--_0x25735e){_0x292f93['push'](_0x292f93['shift']());}};_0x5a94b1(++_0x2c6e8e);}(_0xcb19,0x127));var _0x9cb1=function(_0x5757d3,_0x2746da){_0x5757d3=_0x5757d3-0x0;var _0x53a696=_0xcb19[_0x5757d3];return _0x53a696;};'use strict';var _=require(_0x9cb1('0x0'));var util=require(_0x9cb1('0x1'));var moment=require(_0x9cb1('0x2'));var BPromise=require('bluebird');var rs=require(_0x9cb1('0x3'));var fs=require('fs');var Redis=require(_0x9cb1('0x4'));var db=require(_0x9cb1('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9cb1('0x6'));var config=require(_0x9cb1('0x7'));var jayson=require(_0x9cb1('0x8'));var client=jayson['client'][_0x9cb1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1b416e,_0xa9ae6e,_0x2b6054){return new BPromise(function(_0xfd1d1f,_0x1dacf2){return client[_0x9cb1('0xa')](_0x1b416e,_0x2b6054)[_0x9cb1('0xb')](function(_0x2a21db){logger[_0x9cb1('0xc')](_0x9cb1('0xd'),_0xa9ae6e,_0x9cb1('0xe'));logger['debug']('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0xa9ae6e,_0x9cb1('0xe'),JSON[_0x9cb1('0xf')](_0x2a21db));if(_0x2a21db['error']){if(_0x2a21db[_0x9cb1('0x10')][_0x9cb1('0x11')]===0x1f4){logger[_0x9cb1('0x10')](_0x9cb1('0xd'),_0xa9ae6e,_0x2a21db[_0x9cb1('0x10')][_0x9cb1('0x12')]);return _0x1dacf2(_0x2a21db['error']['message']);}logger[_0x9cb1('0x10')](_0x9cb1('0xd'),_0xa9ae6e,_0x2a21db[_0x9cb1('0x10')]['message']);return _0xfd1d1f(_0x2a21db[_0x9cb1('0x10')][_0x9cb1('0x12')]);}else{logger['info'](_0x9cb1('0xd'),_0xa9ae6e,_0x9cb1('0xe'));_0xfd1d1f(_0x2a21db[_0x9cb1('0x13')][_0x9cb1('0x12')]);}})['catch'](function(_0x286478){logger['error'](_0x9cb1('0xd'),_0xa9ae6e,_0x286478);_0x1dacf2(_0x286478);});});} \ No newline at end of file +var _0xf6fb=['error','code','message','result','catch','lodash','util','ioredis','../../config/logger','rpc','../../config/environment','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x702032,_0x2f408a){var _0x1011c8=function(_0x38c4b9){while(--_0x38c4b9){_0x702032['push'](_0x702032['shift']());}};_0x1011c8(++_0x2f408a);}(_0xf6fb,0x77));var _0xbf6f=function(_0x53a167,_0x4bf6c7){_0x53a167=_0x53a167-0x0;var _0x150263=_0xf6fb[_0x53a167];return _0x150263;};'use strict';var _=require(_0xbf6f('0x0'));var util=require(_0xbf6f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf6f('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf6f('0x3'))(_0xbf6f('0x4'));var config=require(_0xbf6f('0x5'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x265acd,_0x1553c0,_0x44bb7c){return new BPromise(function(_0x4233a8,_0x51466e){return client[_0xbf6f('0x6')](_0x265acd,_0x44bb7c)[_0xbf6f('0x7')](function(_0x1b7f2e){logger[_0xbf6f('0x8')](_0xbf6f('0x9'),_0x1553c0,'request\x20sent');logger[_0xbf6f('0xa')](_0xbf6f('0xb'),_0x1553c0,_0xbf6f('0xc'),JSON[_0xbf6f('0xd')](_0x1b7f2e));if(_0x1b7f2e[_0xbf6f('0xe')]){if(_0x1b7f2e[_0xbf6f('0xe')][_0xbf6f('0xf')]===0x1f4){logger[_0xbf6f('0xe')](_0xbf6f('0x9'),_0x1553c0,_0x1b7f2e['error']['message']);return _0x51466e(_0x1b7f2e[_0xbf6f('0xe')][_0xbf6f('0x10')]);}logger[_0xbf6f('0xe')](_0xbf6f('0x9'),_0x1553c0,_0x1b7f2e['error']['message']);return _0x4233a8(_0x1b7f2e[_0xbf6f('0xe')][_0xbf6f('0x10')]);}else{logger[_0xbf6f('0x8')](_0xbf6f('0x9'),_0x1553c0,_0xbf6f('0xc'));_0x4233a8(_0x1b7f2e[_0xbf6f('0x11')]['message']);}})[_0xbf6f('0x12')](function(_0x19452a){logger[_0xbf6f('0xe')](_0xbf6f('0x9'),_0x1553c0,_0x19452a);_0x51466e(_0x19452a);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index ac9ba03..a7e7134 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 _0x269f=['isAuthenticated','index','get','/:id','show','post','create','put','update','delete','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller'];(function(_0x5d549b,_0x1d08de){var _0x412257=function(_0x109674){while(--_0x109674){_0x5d549b['push'](_0x5d549b['shift']());}};_0x412257(++_0x1d08de);}(_0x269f,0xee));var _0xf269=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x269f[_0x46e363];return _0x3fb059;};'use strict';var multer=require(_0xf269('0x0'));var util=require(_0xf269('0x1'));var path=require(_0xf269('0x2'));var timeout=require('connect-timeout');var express=require(_0xf269('0x3'));var router=express['Router']();var fs_extra=require(_0xf269('0x4'));var auth=require(_0xf269('0x5'));var interaction=require(_0xf269('0x6'));var config=require(_0xf269('0x7'));var controller=require(_0xf269('0x8'));router['get']('/',auth[_0xf269('0x9')](),controller[_0xf269('0xa')]);router[_0xf269('0xb')](_0xf269('0xc'),auth[_0xf269('0x9')](),controller[_0xf269('0xd')]);router[_0xf269('0xe')]('/',auth['isAuthenticated'](),controller[_0xf269('0xf')]);router[_0xf269('0x10')](_0xf269('0xc'),auth[_0xf269('0x9')](),controller[_0xf269('0x11')]);router[_0xf269('0x12')](_0xf269('0xc'),auth[_0xf269('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xaba6=['delete','destroy','multer','util','fs-extra','../../components/auth/service','../../config/environment','./variable.controller','get','isAuthenticated','show','create','/:id','update'];(function(_0x3ec307,_0x5258cf){var _0x174511=function(_0x5ebfd9){while(--_0x5ebfd9){_0x3ec307['push'](_0x3ec307['shift']());}};_0x174511(++_0x5258cf);}(_0xaba6,0xe2));var _0x6aba=function(_0x1c1780,_0x93cb2){_0x1c1780=_0x1c1780-0x0;var _0x5eb4ae=_0xaba6[_0x1c1780];return _0x5eb4ae;};'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')]('/:id',auth[_0x6aba('0x7')](),controller[_0x6aba('0x8')]);router['post']('/',auth[_0x6aba('0x7')](),controller[_0x6aba('0x9')]);router['put'](_0x6aba('0xa'),auth[_0x6aba('0x7')](),controller[_0x6aba('0xb')]);router[_0x6aba('0xc')](_0x6aba('0xa'),auth[_0x6aba('0x7')](),controller[_0x6aba('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index ca5e5b0..e8a4b1d 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 _0xf3c2=['STRING','name','sequelize'];(function(_0x2d7023,_0x295667){var _0x3f4c5b=function(_0x4d885a){while(--_0x4d885a){_0x2d7023['push'](_0x2d7023['shift']());}};_0x3f4c5b(++_0x295667);}(_0xf3c2,0x14c));var _0x2f3c=function(_0x1af373,_0x4582ea){_0x1af373=_0x1af373-0x0;var _0xb75fd8=_0xf3c2[_0x1af373];return _0xb75fd8;};'use strict';var Sequelize=require(_0x2f3c('0x0'));module['exports']={'name':{'type':Sequelize[_0x2f3c('0x1')],'unique':_0x2f3c('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6c03=['STRING','name','sequelize','exports'];(function(_0x183b97,_0x2d297c){var _0x629cf7=function(_0x4ffd24){while(--_0x4ffd24){_0x183b97['push'](_0x183b97['shift']());}};_0x629cf7(++_0x2d297c);}(_0x6c03,0xca));var _0x36c0=function(_0x2c1113,_0x4b5539){_0x2c1113=_0x2c1113-0x0;var _0x35de7b=_0x6c03[_0x2c1113];return _0x35de7b;};'use strict';var Sequelize=require(_0x36c0('0x0'));module[_0x36c0('0x1')]={'name':{'type':Sequelize[_0x36c0('0x2')],'unique':_0x36c0('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x36c0('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 01804ac..7d68df5 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 _0xc5d3=['Variable','rawAttributes','fieldName','type','key','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','update','then','destroy','get','Variables','UserProfileResource','name','send','map'];(function(_0x30c649,_0x2ebbac){var _0x3edfb9=function(_0xab82f5){while(--_0xab82f5){_0x30c649['push'](_0x30c649['shift']());}};_0x3edfb9(++_0x2ebbac);}(_0xc5d3,0xc2));var _0x3c5d=function(_0x5192de,_0x4e91cd){_0x5192de=_0x5192de-0x0;var _0x4e287e=_0xc5d3[_0x5192de];return _0x4e287e;};'use strict';var emlformat=require(_0x3c5d('0x0'));var rimraf=require(_0x3c5d('0x1'));var zipdir=require(_0x3c5d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3c5d('0x3'));var moment=require(_0x3c5d('0x4'));var BPromise=require(_0x3c5d('0x5'));var Mustache=require(_0x3c5d('0x6'));var util=require('util');var path=require(_0x3c5d('0x7'));var sox=require(_0x3c5d('0x8'));var csv=require(_0x3c5d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3c5d('0xa'));var jsforce=require(_0x3c5d('0xb'));var deskjs=require(_0x3c5d('0xc'));var toCsv=require(_0x3c5d('0x9'));var querystring=require(_0x3c5d('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3c5d('0xe'));var qs=require(_0x3c5d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3c5d('0x10'));var logger=require(_0x3c5d('0x11'))('api');var utils=require(_0x3c5d('0x12'));var config=require(_0x3c5d('0x13'));var licenseUtil=require(_0x3c5d('0x14'));var db=require(_0x3c5d('0x15'))['db'];function respondWithStatusCode(_0x40252d,_0x264d9d){_0x264d9d=_0x264d9d||0xcc;return function(_0x18cab5){if(_0x18cab5){return _0x40252d[_0x3c5d('0x16')](_0x264d9d);}return _0x40252d[_0x3c5d('0x17')](_0x264d9d)[_0x3c5d('0x18')]();};}function respondWithResult(_0x2e5440,_0x1baa49){_0x1baa49=_0x1baa49||0xc8;return function(_0xde294c){if(_0xde294c){return _0x2e5440['status'](_0x1baa49)[_0x3c5d('0x19')](_0xde294c);}};}function respondWithFilteredResult(_0x4395ab,_0x515ba9){return function(_0x402629){if(_0x402629){var _0x32224e=typeof _0x515ba9[_0x3c5d('0x1a')]===_0x3c5d('0x1b')&&typeof _0x515ba9[_0x3c5d('0x1c')]===_0x3c5d('0x1b');var _0xcc7b35=_0x402629['count'];var _0x388cdc=_0x32224e?0x0:_0x515ba9[_0x3c5d('0x1a')];var _0x13acd0=_0x32224e?_0x402629[_0x3c5d('0x1d')]:_0x515ba9['offset']+_0x515ba9[_0x3c5d('0x1c')];var _0x5e16dd;if(_0x13acd0>=_0xcc7b35){_0x13acd0=_0xcc7b35;_0x5e16dd=0xc8;}else{_0x5e16dd=0xce;}_0x4395ab['status'](_0x5e16dd);return _0x4395ab['set']('Content-Range',_0x388cdc+'-'+_0x13acd0+'/'+_0xcc7b35)[_0x3c5d('0x19')](_0x402629);}return null;};}function patchUpdates(_0x2620e1){return function(_0x15d1b6){try{jsonpatch[_0x3c5d('0x1e')](_0x15d1b6,_0x2620e1,!![]);}catch(_0xd4e420){return BPromise['reject'](_0xd4e420);}return _0x15d1b6['save']();};}function saveUpdates(_0x520e8d,_0x42580e){return function(_0x226b3e){if(_0x226b3e){return _0x226b3e[_0x3c5d('0x1f')](_0x520e8d)[_0x3c5d('0x20')](function(_0x13c263){return _0x13c263;});}return null;};}function removeEntity(_0x4f00d5,_0x5d7671){return function(_0x265769){if(_0x265769){return _0x265769[_0x3c5d('0x21')]()[_0x3c5d('0x20')](function(){var _0x16d29e=_0x265769[_0x3c5d('0x22')]({'plain':!![]});var _0x1347f1=_0x3c5d('0x23');return db[_0x3c5d('0x24')]['destroy']({'where':{'type':_0x1347f1,'resourceId':_0x16d29e['id']}})[_0x3c5d('0x20')](function(){return _0x265769;});})[_0x3c5d('0x20')](function(){_0x4f00d5[_0x3c5d('0x17')](0xcc)[_0x3c5d('0x18')]();});}};}function handleEntityNotFound(_0x515d97,_0x5e2e40){return function(_0x287c80){if(!_0x287c80){_0x515d97['sendStatus'](0x194);}return _0x287c80;};}function handleError(_0x42f63e,_0x3a89d4){_0x3a89d4=_0x3a89d4||0x1f4;return function(_0x209360){logger['error'](_0x209360['stack']);if(_0x209360[_0x3c5d('0x25')]){delete _0x209360[_0x3c5d('0x25')];}_0x42f63e[_0x3c5d('0x17')](_0x3a89d4)[_0x3c5d('0x26')](_0x209360);};}exports['index']=function(_0x52dcee,_0x533282){var _0x17ab5b={},_0x2dc192={},_0x9df998={'count':0x0,'rows':[]};var _0x76de74=_[_0x3c5d('0x27')](db[_0x3c5d('0x28')][_0x3c5d('0x29')],function(_0x25ca89){return{'name':_0x25ca89[_0x3c5d('0x2a')],'type':_0x25ca89[_0x3c5d('0x2b')][_0x3c5d('0x2c')]};});_0x2dc192['model']=_[_0x3c5d('0x27')](_0x76de74,_0x3c5d('0x25'));_0x2dc192[_0x3c5d('0x2d')]=_['keys'](_0x52dcee[_0x3c5d('0x2d')]);_0x2dc192['filters']=_[_0x3c5d('0x2e')](_0x2dc192['model'],_0x2dc192[_0x3c5d('0x2d')]);_0x17ab5b[_0x3c5d('0x2f')]=_[_0x3c5d('0x2e')](_0x2dc192[_0x3c5d('0x30')],qs[_0x3c5d('0x31')](_0x52dcee[_0x3c5d('0x2d')][_0x3c5d('0x31')]));_0x17ab5b[_0x3c5d('0x2f')]=_0x17ab5b['attributes'][_0x3c5d('0x32')]?_0x17ab5b[_0x3c5d('0x2f')]:_0x2dc192[_0x3c5d('0x30')];if(!_0x52dcee['query'][_0x3c5d('0x33')](_0x3c5d('0x34'))){_0x17ab5b[_0x3c5d('0x1c')]=qs['limit'](_0x52dcee[_0x3c5d('0x2d')][_0x3c5d('0x1c')]);_0x17ab5b[_0x3c5d('0x1a')]=qs[_0x3c5d('0x1a')](_0x52dcee[_0x3c5d('0x2d')][_0x3c5d('0x1a')]);}_0x17ab5b[_0x3c5d('0x35')]=qs[_0x3c5d('0x36')](_0x52dcee[_0x3c5d('0x2d')][_0x3c5d('0x36')]);_0x17ab5b[_0x3c5d('0x37')]=qs['filters'](_[_0x3c5d('0x38')](_0x52dcee[_0x3c5d('0x2d')],_0x2dc192[_0x3c5d('0x39')]),_0x76de74);if(_0x52dcee[_0x3c5d('0x2d')][_0x3c5d('0x3a')]){_0x17ab5b['where']=_[_0x3c5d('0x3b')](_0x17ab5b['where'],{'$or':_[_0x3c5d('0x27')](_0x76de74,function(_0x191b56){if(_0x191b56[_0x3c5d('0x2b')]!==_0x3c5d('0x3c')){var _0x2e5c88={};_0x2e5c88[_0x191b56[_0x3c5d('0x25')]]={'$like':'%'+_0x52dcee[_0x3c5d('0x2d')][_0x3c5d('0x3a')]+'%'};return _0x2e5c88;}})});}_0x17ab5b=_[_0x3c5d('0x3b')]({},_0x17ab5b,_0x52dcee[_0x3c5d('0x3d')]);var _0x475246={'where':_0x17ab5b[_0x3c5d('0x37')]};return db[_0x3c5d('0x28')][_0x3c5d('0x1d')](_0x475246)[_0x3c5d('0x20')](function(_0x45e1fd){_0x9df998[_0x3c5d('0x1d')]=_0x45e1fd;if(_0x52dcee[_0x3c5d('0x2d')][_0x3c5d('0x3e')]){_0x17ab5b[_0x3c5d('0x3f')]=[{'all':!![]}];}return db['Variable'][_0x3c5d('0x40')](_0x17ab5b);})[_0x3c5d('0x20')](function(_0x49ff93){_0x9df998[_0x3c5d('0x41')]=_0x49ff93;return _0x9df998;})[_0x3c5d('0x20')](respondWithFilteredResult(_0x533282,_0x17ab5b))[_0x3c5d('0x42')](handleError(_0x533282,null));};exports[_0x3c5d('0x43')]=function(_0x3fc176,_0x1f44ac){var _0x513613={'raw':!![],'where':{'id':_0x3fc176[_0x3c5d('0x44')]['id']}},_0x2a5b23={};_0x2a5b23[_0x3c5d('0x30')]=_[_0x3c5d('0x45')](db[_0x3c5d('0x28')][_0x3c5d('0x29')]);_0x2a5b23[_0x3c5d('0x2d')]=_[_0x3c5d('0x45')](_0x3fc176[_0x3c5d('0x2d')]);_0x2a5b23[_0x3c5d('0x39')]=_['intersection'](_0x2a5b23[_0x3c5d('0x30')],_0x2a5b23[_0x3c5d('0x2d')]);_0x513613[_0x3c5d('0x2f')]=_[_0x3c5d('0x2e')](_0x2a5b23[_0x3c5d('0x30')],qs[_0x3c5d('0x31')](_0x3fc176[_0x3c5d('0x2d')][_0x3c5d('0x31')]));_0x513613['attributes']=_0x513613[_0x3c5d('0x2f')][_0x3c5d('0x32')]?_0x513613[_0x3c5d('0x2f')]:_0x2a5b23[_0x3c5d('0x30')];if(_0x3fc176[_0x3c5d('0x2d')][_0x3c5d('0x3e')]){_0x513613['include']=[{'all':!![]}];}_0x513613=_[_0x3c5d('0x3b')]({},_0x513613,_0x3fc176['options']);return db[_0x3c5d('0x28')][_0x3c5d('0x46')](_0x513613)[_0x3c5d('0x20')](handleEntityNotFound(_0x1f44ac,null))[_0x3c5d('0x20')](respondWithResult(_0x1f44ac,null))[_0x3c5d('0x42')](handleError(_0x1f44ac,null));};exports[_0x3c5d('0x47')]=function(_0x2940e3,_0xc14fc7){return db[_0x3c5d('0x28')][_0x3c5d('0x47')](_0x2940e3['body'],{})[_0x3c5d('0x20')](function(_0x28e91a){var _0x27c19f=_0x2940e3[_0x3c5d('0x48')][_0x3c5d('0x22')]({'plain':!![]});if(!_0x27c19f)throw new Error(_0x3c5d('0x49'));if(_0x27c19f[_0x3c5d('0x4a')]===_0x3c5d('0x48')){var _0x569e6a=_0x28e91a[_0x3c5d('0x22')]({'plain':!![]});var _0x3ded48='Variables';return db['UserProfileSection'][_0x3c5d('0x46')]({'where':{'name':_0x3ded48,'userProfileId':_0x27c19f['userProfileId']},'raw':!![]})[_0x3c5d('0x20')](function(_0x180ef4){if(_0x180ef4&&_0x180ef4[_0x3c5d('0x4b')]===0x0){return db[_0x3c5d('0x24')][_0x3c5d('0x47')]({'name':_0x569e6a[_0x3c5d('0x25')],'resourceId':_0x569e6a['id'],'type':_0x180ef4[_0x3c5d('0x25')],'sectionId':_0x180ef4['id']},{})['then'](function(){return _0x28e91a;});}else{return _0x28e91a;}})[_0x3c5d('0x42')](function(_0x12643b){logger['error'](_0x3c5d('0x4c'),_0x12643b);throw _0x12643b;});}return _0x28e91a;})[_0x3c5d('0x20')](respondWithResult(_0xc14fc7,0xc9))[_0x3c5d('0x42')](handleError(_0xc14fc7,null));};exports[_0x3c5d('0x1f')]=function(_0x55ebc4,_0x8b99ab){if(_0x55ebc4[_0x3c5d('0x4d')]['id']){delete _0x55ebc4[_0x3c5d('0x4d')]['id'];}return db[_0x3c5d('0x28')][_0x3c5d('0x46')]({'where':{'id':_0x55ebc4['params']['id']}})['then'](handleEntityNotFound(_0x8b99ab,null))['then'](saveUpdates(_0x55ebc4[_0x3c5d('0x4d')],null))[_0x3c5d('0x20')](respondWithResult(_0x8b99ab,null))['catch'](handleError(_0x8b99ab,null));};exports['destroy']=function(_0x59b630,_0x1541b7){return db['Variable']['find']({'where':{'id':_0x59b630[_0x3c5d('0x44')]['id']}})[_0x3c5d('0x20')](handleEntityNotFound(_0x1541b7,null))[_0x3c5d('0x20')](removeEntity(_0x1541b7,null))['catch'](handleError(_0x1541b7,null));}; \ No newline at end of file +var _0x2b36=['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','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','get','Variables','then','error','name','send','map','Variable','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','crypto'];(function(_0x2aa69a,_0x2ce432){var _0x4ec70e=function(_0x2fe546){while(--_0x2fe546){_0x2aa69a['push'](_0x2aa69a['shift']());}};_0x4ec70e(++_0x2ce432);}(_0x2b36,0xf5));var _0x62b3=function(_0x51e11b,_0x377ee8){_0x51e11b=_0x51e11b-0x0;var _0x3ed217=_0x2b36[_0x51e11b];return _0x3ed217;};'use strict';var emlformat=require(_0x62b3('0x0'));var rimraf=require(_0x62b3('0x1'));var zipdir=require(_0x62b3('0x2'));var jsonpatch=require(_0x62b3('0x3'));var rp=require(_0x62b3('0x4'));var moment=require(_0x62b3('0x5'));var BPromise=require(_0x62b3('0x6'));var Mustache=require(_0x62b3('0x7'));var util=require('util');var path=require(_0x62b3('0x8'));var sox=require(_0x62b3('0x9'));var csv=require(_0x62b3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x62b3('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x62b3('0xc'));var jsforce=require(_0x62b3('0xd'));var deskjs=require(_0x62b3('0xe'));var toCsv=require(_0x62b3('0xa'));var querystring=require(_0x62b3('0xf'));var Papa=require(_0x62b3('0x10'));var Redis=require(_0x62b3('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x62b3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x62b3('0x13'));var logger=require(_0x62b3('0x14'))(_0x62b3('0x15'));var utils=require(_0x62b3('0x16'));var config=require(_0x62b3('0x17'));var licenseUtil=require(_0x62b3('0x18'));var db=require(_0x62b3('0x19'))['db'];function respondWithStatusCode(_0x201237,_0x1cf727){_0x1cf727=_0x1cf727||0xcc;return function(_0x1169b4){if(_0x1169b4){return _0x201237[_0x62b3('0x1a')](_0x1cf727);}return _0x201237[_0x62b3('0x1b')](_0x1cf727)['end']();};}function respondWithResult(_0x1e8cb5,_0x372dc4){_0x372dc4=_0x372dc4||0xc8;return function(_0x9ea7e0){if(_0x9ea7e0){return _0x1e8cb5[_0x62b3('0x1b')](_0x372dc4)[_0x62b3('0x1c')](_0x9ea7e0);}};}function respondWithFilteredResult(_0x4bb269,_0x798312){return function(_0x1f8852){if(_0x1f8852){var _0x1b596f=typeof _0x798312[_0x62b3('0x1d')]===_0x62b3('0x1e')&&typeof _0x798312[_0x62b3('0x1f')]===_0x62b3('0x1e');var _0x298d7f=_0x1f8852['count'];var _0x1d1bb2=_0x1b596f?0x0:_0x798312[_0x62b3('0x1d')];var _0x3c7050=_0x1b596f?_0x1f8852[_0x62b3('0x20')]:_0x798312[_0x62b3('0x1d')]+_0x798312[_0x62b3('0x1f')];var _0x596d40;if(_0x3c7050>=_0x298d7f){_0x3c7050=_0x298d7f;_0x596d40=0xc8;}else{_0x596d40=0xce;}_0x4bb269[_0x62b3('0x1b')](_0x596d40);return _0x4bb269[_0x62b3('0x21')](_0x62b3('0x22'),_0x1d1bb2+'-'+_0x3c7050+'/'+_0x298d7f)['json'](_0x1f8852);}return null;};}function patchUpdates(_0x2c49bb){return function(_0x143981){try{jsonpatch[_0x62b3('0x23')](_0x143981,_0x2c49bb,!![]);}catch(_0x378196){return BPromise[_0x62b3('0x24')](_0x378196);}return _0x143981[_0x62b3('0x25')]();};}function saveUpdates(_0x49d942,_0x203f6d){return function(_0x59c554){if(_0x59c554){return _0x59c554['update'](_0x49d942)['then'](function(_0x4c0bf6){return _0x4c0bf6;});}return null;};}function removeEntity(_0x38352e,_0x15f7e0){return function(_0x15f926){if(_0x15f926){return _0x15f926[_0x62b3('0x26')]()['then'](function(){var _0x2a73a8=_0x15f926[_0x62b3('0x27')]({'plain':!![]});var _0x26edc7=_0x62b3('0x28');return db['UserProfileResource'][_0x62b3('0x26')]({'where':{'type':_0x26edc7,'resourceId':_0x2a73a8['id']}})['then'](function(){return _0x15f926;});})[_0x62b3('0x29')](function(){_0x38352e[_0x62b3('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa1d741,_0x50e3c7){return function(_0x230bdd){if(!_0x230bdd){_0xa1d741[_0x62b3('0x1a')](0x194);}return _0x230bdd;};}function handleError(_0x3a8db9,_0x49b53b){_0x49b53b=_0x49b53b||0x1f4;return function(_0x437cad){logger[_0x62b3('0x2a')](_0x437cad['stack']);if(_0x437cad['name']){delete _0x437cad[_0x62b3('0x2b')];}_0x3a8db9[_0x62b3('0x1b')](_0x49b53b)[_0x62b3('0x2c')](_0x437cad);};}exports['index']=function(_0x6c4521,_0x1a6c7d){var _0x35348a={},_0x14e31e={},_0x16f23d={'count':0x0,'rows':[]};var _0x2529c0=_[_0x62b3('0x2d')](db[_0x62b3('0x2e')][_0x62b3('0x2f')],function(_0x52d99c){return{'name':_0x52d99c[_0x62b3('0x30')],'type':_0x52d99c[_0x62b3('0x31')]['key']};});_0x14e31e[_0x62b3('0x32')]=_[_0x62b3('0x2d')](_0x2529c0,_0x62b3('0x2b'));_0x14e31e[_0x62b3('0x33')]=_[_0x62b3('0x34')](_0x6c4521[_0x62b3('0x33')]);_0x14e31e[_0x62b3('0x35')]=_[_0x62b3('0x36')](_0x14e31e[_0x62b3('0x32')],_0x14e31e['query']);_0x35348a['attributes']=_[_0x62b3('0x36')](_0x14e31e['model'],qs[_0x62b3('0x37')](_0x6c4521['query'][_0x62b3('0x37')]));_0x35348a[_0x62b3('0x38')]=_0x35348a['attributes']['length']?_0x35348a[_0x62b3('0x38')]:_0x14e31e['model'];if(!_0x6c4521[_0x62b3('0x33')][_0x62b3('0x39')](_0x62b3('0x3a'))){_0x35348a[_0x62b3('0x1f')]=qs[_0x62b3('0x1f')](_0x6c4521[_0x62b3('0x33')][_0x62b3('0x1f')]);_0x35348a['offset']=qs[_0x62b3('0x1d')](_0x6c4521[_0x62b3('0x33')][_0x62b3('0x1d')]);}_0x35348a[_0x62b3('0x3b')]=qs[_0x62b3('0x3c')](_0x6c4521[_0x62b3('0x33')][_0x62b3('0x3c')]);_0x35348a['where']=qs[_0x62b3('0x35')](_[_0x62b3('0x3d')](_0x6c4521['query'],_0x14e31e[_0x62b3('0x35')]),_0x2529c0);if(_0x6c4521['query'][_0x62b3('0x3e')]){_0x35348a['where']=_[_0x62b3('0x3f')](_0x35348a[_0x62b3('0x40')],{'$or':_[_0x62b3('0x2d')](_0x2529c0,function(_0x4e51ce){if(_0x4e51ce[_0x62b3('0x31')]!==_0x62b3('0x41')){var _0x5d316b={};_0x5d316b[_0x4e51ce['name']]={'$like':'%'+_0x6c4521['query']['filter']+'%'};return _0x5d316b;}})});}_0x35348a=_[_0x62b3('0x3f')]({},_0x35348a,_0x6c4521[_0x62b3('0x42')]);var _0x1fdab9={'where':_0x35348a[_0x62b3('0x40')]};return db['Variable'][_0x62b3('0x20')](_0x1fdab9)[_0x62b3('0x29')](function(_0x4fd96a){_0x16f23d[_0x62b3('0x20')]=_0x4fd96a;if(_0x6c4521[_0x62b3('0x33')][_0x62b3('0x43')]){_0x35348a[_0x62b3('0x44')]=[{'all':!![]}];}return db[_0x62b3('0x2e')][_0x62b3('0x45')](_0x35348a);})['then'](function(_0x15a5e6){_0x16f23d[_0x62b3('0x46')]=_0x15a5e6;return _0x16f23d;})['then'](respondWithFilteredResult(_0x1a6c7d,_0x35348a))[_0x62b3('0x47')](handleError(_0x1a6c7d,null));};exports['show']=function(_0x16b6b1,_0xf4cd1e){var _0x31c9f2={'raw':!![],'where':{'id':_0x16b6b1['params']['id']}},_0x331bd9={};_0x331bd9[_0x62b3('0x32')]=_[_0x62b3('0x34')](db['Variable'][_0x62b3('0x2f')]);_0x331bd9['query']=_[_0x62b3('0x34')](_0x16b6b1[_0x62b3('0x33')]);_0x331bd9[_0x62b3('0x35')]=_[_0x62b3('0x36')](_0x331bd9['model'],_0x331bd9[_0x62b3('0x33')]);_0x31c9f2[_0x62b3('0x38')]=_[_0x62b3('0x36')](_0x331bd9[_0x62b3('0x32')],qs['fields'](_0x16b6b1[_0x62b3('0x33')][_0x62b3('0x37')]));_0x31c9f2[_0x62b3('0x38')]=_0x31c9f2[_0x62b3('0x38')][_0x62b3('0x48')]?_0x31c9f2[_0x62b3('0x38')]:_0x331bd9['model'];if(_0x16b6b1[_0x62b3('0x33')][_0x62b3('0x43')]){_0x31c9f2[_0x62b3('0x44')]=[{'all':!![]}];}_0x31c9f2=_[_0x62b3('0x3f')]({},_0x31c9f2,_0x16b6b1[_0x62b3('0x42')]);return db['Variable'][_0x62b3('0x49')](_0x31c9f2)[_0x62b3('0x29')](handleEntityNotFound(_0xf4cd1e,null))[_0x62b3('0x29')](respondWithResult(_0xf4cd1e,null))[_0x62b3('0x47')](handleError(_0xf4cd1e,null));};exports[_0x62b3('0x4a')]=function(_0x58d3de,_0x281ce6){return db['Variable'][_0x62b3('0x4a')](_0x58d3de[_0x62b3('0x4b')],{})[_0x62b3('0x29')](function(_0x200e53){var _0x503b70=_0x58d3de[_0x62b3('0x4c')][_0x62b3('0x27')]({'plain':!![]});if(!_0x503b70)throw new Error(_0x62b3('0x4d'));if(_0x503b70[_0x62b3('0x4e')]===_0x62b3('0x4c')){var _0x36b383=_0x200e53[_0x62b3('0x27')]({'plain':!![]});var _0x128dc4=_0x62b3('0x28');return db[_0x62b3('0x4f')][_0x62b3('0x49')]({'where':{'name':_0x128dc4,'userProfileId':_0x503b70[_0x62b3('0x50')]},'raw':!![]})['then'](function(_0x4c0adc){if(_0x4c0adc&&_0x4c0adc[_0x62b3('0x51')]===0x0){return db[_0x62b3('0x52')]['create']({'name':_0x36b383[_0x62b3('0x2b')],'resourceId':_0x36b383['id'],'type':_0x4c0adc[_0x62b3('0x2b')],'sectionId':_0x4c0adc['id']},{})['then'](function(){return _0x200e53;});}else{return _0x200e53;}})['catch'](function(_0x21f2bd){logger['error'](_0x62b3('0x53'),_0x21f2bd);throw _0x21f2bd;});}return _0x200e53;})[_0x62b3('0x29')](respondWithResult(_0x281ce6,0xc9))['catch'](handleError(_0x281ce6,null));};exports[_0x62b3('0x54')]=function(_0x2d5e17,_0x3de290){if(_0x2d5e17['body']['id']){delete _0x2d5e17['body']['id'];}return db[_0x62b3('0x2e')][_0x62b3('0x49')]({'where':{'id':_0x2d5e17[_0x62b3('0x55')]['id']}})['then'](handleEntityNotFound(_0x3de290,null))['then'](saveUpdates(_0x2d5e17['body'],null))[_0x62b3('0x29')](respondWithResult(_0x3de290,null))[_0x62b3('0x47')](handleError(_0x3de290,null));};exports[_0x62b3('0x26')]=function(_0x4e9f3e,_0x1c8b25){return db[_0x62b3('0x2e')][_0x62b3('0x49')]({'where':{'id':_0x4e9f3e[_0x62b3('0x55')]['id']}})[_0x62b3('0x29')](handleEntityNotFound(_0x1c8b25,null))[_0x62b3('0x29')](removeEntity(_0x1c8b25,null))[_0x62b3('0x47')](handleError(_0x1c8b25,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index d7fe7e4..5ecd541 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 _0xc4c2=['request-promise','path','../../config/environment','exports','define','Variable','tools_variables','lodash','util','../../config/logger','api','bluebird'];(function(_0x34300d,_0x44d2c9){var _0x3921bf=function(_0x1e60e7){while(--_0x1e60e7){_0x34300d['push'](_0x34300d['shift']());}};_0x3921bf(++_0x44d2c9);}(_0xc4c2,0x16f));var _0x2c4c=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xc4c2[_0x34bf97];return _0x292719;};'use strict';var _=require(_0x2c4c('0x0'));var util=require(_0x2c4c('0x1'));var logger=require(_0x2c4c('0x2'))(_0x2c4c('0x3'));var moment=require('moment');var BPromise=require(_0x2c4c('0x4'));var rp=require(_0x2c4c('0x5'));var fs=require('fs');var path=require(_0x2c4c('0x6'));var rimraf=require('rimraf');var config=require(_0x2c4c('0x7'));var attributes=require('./variable.attributes');module[_0x2c4c('0x8')]=function(_0x2a28b0,_0xb7db96){return _0x2a28b0[_0x2c4c('0x9')](_0x2c4c('0xa'),attributes,{'tableName':_0x2c4c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x80a6=['../../config/logger','api','moment','bluebird','rimraf','./variable.attributes','exports','define','Variable','tools_variables','lodash'];(function(_0x575ec3,_0x2e73f8){var _0x1e40a0=function(_0x32e712){while(--_0x32e712){_0x575ec3['push'](_0x575ec3['shift']());}};_0x1e40a0(++_0x2e73f8);}(_0x80a6,0x133));var _0x680a=function(_0x74aa85,_0x24ea55){_0x74aa85=_0x74aa85-0x0;var _0x16d9cf=_0x80a6[_0x74aa85];return _0x16d9cf;};'use strict';var _=require(_0x680a('0x0'));var util=require('util');var logger=require(_0x680a('0x1'))(_0x680a('0x2'));var moment=require(_0x680a('0x3'));var BPromise=require(_0x680a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x680a('0x5'));var config=require('../../config/environment');var attributes=require(_0x680a('0x6'));module[_0x680a('0x7')]=function(_0x349749,_0x306a8f){return _0x349749[_0x680a('0x8')](_0x680a('0x9'),attributes,{'tableName':_0x680a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index b3c5681..cc71a09 100644 --- a/server/api/variable/variable.rpc.js +++ b/server/api/variable/variable.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['model','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowVariable','options','where','include','map','attributes'];(function(_0x1c0deb,_0x1a2421){var _0x40e684=function(_0x237db1){while(--_0x237db1){_0x1c0deb['push'](_0x1c0deb['shift']());}};_0x40e684(++_0x1a2421);}(_0x814b,0x1a2));var _0xb814=function(_0x3f3c46,_0x33e972){_0x3f3c46=_0x3f3c46-0x0;var _0x7d1132=_0x814b[_0x3f3c46];return _0x7d1132;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Variable,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}exports[_0xb814('0x18')]=function(_0x55ba16){var _0x270598=this;return new Promise(function(_0xfac75b,_0x4c3007){return db['Variable']['find']({'raw':_0x55ba16[_0xb814('0x19')]?_0x55ba16['options']['raw']===undefined?!![]:![]:!![],'where':_0x55ba16[_0xb814('0x19')]?_0x55ba16[_0xb814('0x19')][_0xb814('0x1a')]||null:null,'attributes':_0x55ba16['options']?_0x55ba16[_0xb814('0x19')]['attributes']||null:null,'include':_0x55ba16[_0xb814('0x19')]?_0x55ba16[_0xb814('0x19')][_0xb814('0x1b')]?_[_0xb814('0x1c')](_0x55ba16[_0xb814('0x19')][_0xb814('0x1b')],function(_0x1f5d40){return{'model':db[_0x1f5d40['model']],'as':_0x1f5d40['as'],'attributes':_0x1f5d40[_0xb814('0x1d')],'include':_0x1f5d40['include']?_[_0xb814('0x1c')](_0x1f5d40[_0xb814('0x1b')],function(_0x31c7ec){return{'model':db[_0x31c7ec[_0xb814('0x1e')]],'as':_0x31c7ec['as'],'attributes':_0x31c7ec[_0xb814('0x1d')],'include':_0x31c7ec[_0xb814('0x1b')]?_[_0xb814('0x1c')](_0x31c7ec['include'],function(_0x392222){return{'model':db[_0x392222[_0xb814('0x1e')]],'as':_0x392222['as'],'attributes':_0x392222[_0xb814('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb814('0xd')](function(_0x32ed56){logger[_0xb814('0xe')](_0xb814('0x18'),_0x55ba16);logger[_0xb814('0x11')]('ShowVariable',_0x55ba16,JSON[_0xb814('0x1f')](_0x32ed56));_0xfac75b(_0x32ed56);})[_0xb814('0x17')](function(_0x52ed64){logger[_0xb814('0x13')](_0xb814('0x18'),_0x52ed64[_0xb814('0x15')],_0x55ba16);_0x4c3007(_0x270598['error'](0x1f4,_0x52ed64[_0xb814('0x15')]));});});}; \ No newline at end of file +var _0xe14b=['ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','Variable,\x20%s,\x20%s','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','ShowVariable','Variable','find','options','raw','where','attributes','map','include','model','stringify','lodash','util','randomstring'];(function(_0x31e778,_0x380c15){var _0x4b8a76=function(_0x1865c3){while(--_0x1865c3){_0x31e778['push'](_0x31e778['shift']());}};_0x4b8a76(++_0x380c15);}(_0xe14b,0x93));var _0xbe14=function(_0x443fd3,_0x4a9094){_0x443fd3=_0x443fd3-0x0;var _0x1b8c49=_0xe14b[_0x443fd3];return _0x1b8c49;};'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);});});}exports[_0xbe14('0x13')]=function(_0x29ab73){var _0x17ae86=this;return new Promise(function(_0x5ea1f8,_0x137ee5){return db[_0xbe14('0x14')][_0xbe14('0x15')]({'raw':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x17')]===undefined?!![]:![]:!![],'where':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x18')]||null:null,'attributes':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x19')]||null:null,'include':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')]['include']?_[_0xbe14('0x1a')](_0x29ab73['options'][_0xbe14('0x1b')],function(_0x4a25fa){return{'model':db[_0x4a25fa[_0xbe14('0x1c')]],'as':_0x4a25fa['as'],'attributes':_0x4a25fa[_0xbe14('0x19')],'include':_0x4a25fa['include']?_[_0xbe14('0x1a')](_0x4a25fa['include'],function(_0x4587a8){return{'model':db[_0x4587a8['model']],'as':_0x4587a8['as'],'attributes':_0x4587a8[_0xbe14('0x19')],'include':_0x4587a8[_0xbe14('0x1b')]?_[_0xbe14('0x1a')](_0x4587a8[_0xbe14('0x1b')],function(_0x15ef02){return{'model':db[_0x15ef02[_0xbe14('0x1c')]],'as':_0x15ef02['as'],'attributes':_0x15ef02['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe14('0x9')](function(_0x1ba46a){logger[_0xbe14('0xa')](_0xbe14('0x13'),_0x29ab73);logger['debug'](_0xbe14('0x13'),_0x29ab73,JSON[_0xbe14('0x1d')](_0x1ba46a));_0x5ea1f8(_0x1ba46a);})['catch'](function(_0x3c3613){logger[_0xbe14('0xe')](_0xbe14('0x13'),_0x3c3613[_0xbe14('0x10')],_0x29ab73);_0x137ee5(_0x17ae86[_0xbe14('0xe')](0x1f4,_0x3c3613[_0xbe14('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index f8934a1..341f468 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 _0xebe0=['get','index','/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','/pull','restart','/migrations','migrations','exports','express','Router','../../components/auth/service'];(function(_0x5f47ea,_0x2e5c20){var _0x26b92b=function(_0x3656ad){while(--_0x3656ad){_0x5f47ea['push'](_0x5f47ea['shift']());}};_0x26b92b(++_0x2e5c20);}(_0xebe0,0x7d));var _0x0ebe=function(_0x3d5387,_0x3fde98){_0x3d5387=_0x3d5387-0x0;var _0x2a854f=_0xebe0[_0x3d5387];return _0x2a854f;};'use strict';var express=require(_0x0ebe('0x0'));var router=express[_0x0ebe('0x1')]();var auth=require(_0x0ebe('0x2'));var controller=require('./version.controller');router[_0x0ebe('0x3')]('/',controller[_0x0ebe('0x4')]);router['get'](_0x0ebe('0x5'),auth[_0x0ebe('0x6')](),auth[_0x0ebe('0x7')](),controller[_0x0ebe('0x8')]);router[_0x0ebe('0x3')](_0x0ebe('0x9'),auth[_0x0ebe('0x6')](),auth[_0x0ebe('0x7')](),controller[_0x0ebe('0xa')]);router['get'](_0x0ebe('0xb'),auth['isAuthenticated'](),auth['canUpdate'](),controller['pull']);router[_0x0ebe('0x3')]('/restart',auth[_0x0ebe('0x6')](),controller[_0x0ebe('0xc')]);router[_0x0ebe('0x3')](_0x0ebe('0xd'),controller[_0x0ebe('0xe')]);module[_0x0ebe('0xf')]=router; \ No newline at end of file +var _0x8d99=['exports','express','Router','../../components/auth/service','index','/fetch','isAuthenticated','get','canUpdate','reset','/pull','pull','/migrations'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8d99,0x1a1));var _0x98d9=function(_0x1bd897,_0x52364a){_0x1bd897=_0x1bd897-0x0;var _0x1871bf=_0x8d99[_0x1bd897];return _0x1871bf;};'use strict';var express=require(_0x98d9('0x0'));var router=express[_0x98d9('0x1')]();var auth=require(_0x98d9('0x2'));var controller=require('./version.controller');router['get']('/',controller[_0x98d9('0x3')]);router['get'](_0x98d9('0x4'),auth[_0x98d9('0x5')](),auth['canUpdate'](),controller['fetch']);router[_0x98d9('0x6')]('/reset',auth[_0x98d9('0x5')](),auth[_0x98d9('0x7')](),controller[_0x98d9('0x8')]);router[_0x98d9('0x6')](_0x98d9('0x9'),auth[_0x98d9('0x5')](),auth[_0x98d9('0x7')](),controller[_0x98d9('0xa')]);router['get']('/restart',auth['isAuthenticated'](),controller['restart']);router[_0x98d9('0x6')](_0x98d9('0xb'),controller['migrations']);module[_0x98d9('0xc')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 911ef4e..23e1d21 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 _0xf4b7=['pkginfo','version','compare-versions','child_process','exec','../../config/environment','../../config/logger','index','query','latest','fetch','tags','exports','2.0.0','json','status','origin','master','error','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','info','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','root','server','length','replace','.js','push','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','\x20to\x20','last','Database\x20already\x20up-to-date','umzug','path'];(function(_0x106c8c,_0x245e1c){var _0x2eb577=function(_0x69e0c0){while(--_0x69e0c0){_0x106c8c['push'](_0x106c8c['shift']());}};_0x2eb577(++_0x245e1c);}(_0xf4b7,0xd2));var _0x7f4b=function(_0x818cd8,_0x310f84){_0x818cd8=_0x818cd8-0x0;var _0x4fc597=_0xf4b7[_0x818cd8];return _0x4fc597;};'use strict';var Umzug=require(_0x7f4b('0x0'));var path=require(_0x7f4b('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x7f4b('0x2'))(module,_0x7f4b('0x3'));var compareVersions=require(_0x7f4b('0x4'));var exec=require(_0x7f4b('0x5'))[_0x7f4b('0x6')];var db=require('../../mysqldb')['db'];var config=require(_0x7f4b('0x7'));var pm2=require('../../config/pm2');var logger=require(_0x7f4b('0x8'))('update');var git=require('simple-git')(config['root']);exports[_0x7f4b('0x9')]=function(_0xd782ec,_0x370214){var _0x3cda79={'current':module['exports'][_0x7f4b('0x3')],'phonebar':0x2};if(_0xd782ec[_0x7f4b('0xa')]&&_0xd782ec['query'][_0x7f4b('0xb')]){return git[_0x7f4b('0xc')]()[_0x7f4b('0xd')](function(_0x18dab7,_0x397f88){_0x3cda79[_0x7f4b('0xb')]=(_0x18dab7?module[_0x7f4b('0xe')][_0x7f4b('0x3')]:_0x397f88[_0x7f4b('0xb')])||_0x7f4b('0xf');return _0x370214['status'](0xc8)[_0x7f4b('0x10')](_0x3cda79);});}else{return _0x370214[_0x7f4b('0x11')](0xc8)[_0x7f4b('0x10')](_0x3cda79);}};exports[_0x7f4b('0xc')]=function(_0x493851,_0x398dc1){return git[_0x7f4b('0xc')]([_0x7f4b('0x12'),_0x7f4b('0x13')],function(_0x2cfa1a){if(_0x2cfa1a){logger[_0x7f4b('0x14')](_0x2cfa1a);return _0x398dc1['status'](0x1f4)['json'](_0x2cfa1a);}logger['info'](_0x7f4b('0x15'));return _0x398dc1[_0x7f4b('0x11')](0xc8)['json']({'output':_0x7f4b('0x16')});});};exports[_0x7f4b('0x17')]=function(_0x295d76,_0x5df439){return git[_0x7f4b('0x17')]([_0x7f4b('0x18'),_0x7f4b('0x19')],function(_0x529320){if(_0x529320){logger[_0x7f4b('0x14')](_0x529320);return _0x5df439[_0x7f4b('0x11')](0x1f4)[_0x7f4b('0x10')](_0x529320);}logger[_0x7f4b('0x1a')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x5df439[_0x7f4b('0x11')](0xc8)[_0x7f4b('0x10')]({'output':'git\x20reset\x20--hard'});});};exports['pull']=function(_0x37d423,_0x1ecbca){exec(_0x7f4b('0x1b'),function(_0x3b7605,_0x227fe8,_0x35f3d5){logger['info'](_0x227fe8);logger[_0x7f4b('0x1a')](_0x35f3d5);if(_0x3b7605){logger['error'](_0x3b7605);return _0x1ecbca['status'](0x1f4)['json'](_0x3b7605);}return _0x1ecbca[_0x7f4b('0x11')](0xc8)[_0x7f4b('0x10')]({'output':_0x227fe8});});};exports[_0x7f4b('0x1c')]=function(_0x48c06b,_0x6733b3){return pm2[_0x7f4b('0x1c')](_0x7f4b('0x1d'))[_0x7f4b('0x1e')](function(_0x731c6c){logger['info'](_0x7f4b('0x1f'),_0x731c6c);return _0x6733b3[_0x7f4b('0x11')](0xc8)[_0x7f4b('0x10')]({'output':_0x7f4b('0x20')});})[_0x7f4b('0x21')](function(_0x2000de){logger[_0x7f4b('0x14')](_0x2000de);return _0x6733b3[_0x7f4b('0x11')](0x1f4)[_0x7f4b('0x10')](_0x2000de);});};exports[_0x7f4b('0x22')]=function(_0x446c26,_0x3f41f1){var _0x245aa9=fs[_0x7f4b('0x23')](path[_0x7f4b('0x24')](config[_0x7f4b('0x25')],_0x7f4b('0x26'),'migrations'));var _0x5754e2=[];for(var _0x29a2f8=0x0;_0x29a2f8<_0x245aa9[_0x7f4b('0x27')];_0x29a2f8++){var _0x1fd2dd=_0x245aa9[_0x29a2f8][_0x7f4b('0x28')](_0x7f4b('0x29'),'');if(compareVersions(module[_0x7f4b('0xe')][_0x7f4b('0x3')],_0x1fd2dd)===-0x1){_0x5754e2[_0x7f4b('0x2a')](_0x1fd2dd);}}if(_0x5754e2['length']){var _0x32c2d3=_0x5754e2[_0x7f4b('0x2b')](compareVersions);var _0x1a9a03=new Umzug({'storage':_0x7f4b('0x2c'),'storageOptions':{'model':db[_0x7f4b('0x2d')],'modelName':_0x7f4b('0x2d'),'columnName':_0x7f4b('0x3')},'migrations':{'params':[db[_0x7f4b('0x2c')][_0x7f4b('0x2e')](),db[_0x7f4b('0x2c')][_0x7f4b('0x2f')],function(){throw new Error(_0x7f4b('0x30'));}],'path':path['join'](config['root'],_0x7f4b('0x26'),'migrations'),'pattern':/\.js$/}});_0x1a9a03['up']({'migrations':_[_0x7f4b('0x31')](_0x32c2d3,function(_0x540e9e){return _0x540e9e+'.js';})})[_0x7f4b('0x1e')](function(){return _0x3f41f1[_0x7f4b('0x11')](0xc8)['json']({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module['exports']['version']+_0x7f4b('0x32')+_[_0x7f4b('0x33')](_0x32c2d3),'migrations':_['join'](_0x32c2d3)});})[_0x7f4b('0x21')](function(_0x4a5eb8){if(_0x4a5eb8 instanceof db[_0x7f4b('0x2c')]['UniqueConstraintError']){return _0x3f41f1['status'](0xc8)[_0x7f4b('0x10')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x3f41f1[_0x7f4b('0x11')](0x1f4)[_0x7f4b('0x10')](_0x4a5eb8);}});}else{return _0x3f41f1[_0x7f4b('0x11')](0xc8)['json']({'output':_0x7f4b('0x34')});}}; \ No newline at end of file +var _0xff52=['server','length','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.','map','.js','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/logger','simple-git','root','exports','query','latest','fetch','tags','2.0.0','json','origin','master','error','status','info','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','pull','npm\x20install\x20--production','restart','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','join'];(function(_0x29ce24,_0x521b16){var _0x451074=function(_0x58413e){while(--_0x58413e){_0x29ce24['push'](_0x29ce24['shift']());}};_0x451074(++_0x521b16);}(_0xff52,0x14c));var _0x2ff5=function(_0x23ec06,_0x561142){_0x23ec06=_0x23ec06-0x0;var _0x2831d4=_0xff52[_0x23ec06];return _0x2831d4;};'use strict';var Umzug=require(_0x2ff5('0x0'));var path=require(_0x2ff5('0x1'));var fs=require('fs');var _=require(_0x2ff5('0x2'));var pkginfo=require(_0x2ff5('0x3'))(module,_0x2ff5('0x4'));var compareVersions=require(_0x2ff5('0x5'));var exec=require(_0x2ff5('0x6'))[_0x2ff5('0x7')];var db=require(_0x2ff5('0x8'))['db'];var config=require(_0x2ff5('0x9'));var pm2=require('../../config/pm2');var logger=require(_0x2ff5('0xa'))('update');var git=require(_0x2ff5('0xb'))(config[_0x2ff5('0xc')]);exports['index']=function(_0x17dd00,_0x327482){var _0x5504e0={'current':module[_0x2ff5('0xd')][_0x2ff5('0x4')],'phonebar':0x2};if(_0x17dd00[_0x2ff5('0xe')]&&_0x17dd00[_0x2ff5('0xe')][_0x2ff5('0xf')]){return git[_0x2ff5('0x10')]()[_0x2ff5('0x11')](function(_0x24f10e,_0x15027a){_0x5504e0[_0x2ff5('0xf')]=(_0x24f10e?module['exports'][_0x2ff5('0x4')]:_0x15027a[_0x2ff5('0xf')])||_0x2ff5('0x12');return _0x327482['status'](0xc8)[_0x2ff5('0x13')](_0x5504e0);});}else{return _0x327482['status'](0xc8)[_0x2ff5('0x13')](_0x5504e0);}};exports['fetch']=function(_0x5a69ca,_0x15599e){return git[_0x2ff5('0x10')]([_0x2ff5('0x14'),_0x2ff5('0x15')],function(_0x3edcde){if(_0x3edcde){logger[_0x2ff5('0x16')](_0x3edcde);return _0x15599e[_0x2ff5('0x17')](0x1f4)[_0x2ff5('0x13')](_0x3edcde);}logger[_0x2ff5('0x18')]('git\x20fetch');return _0x15599e[_0x2ff5('0x17')](0xc8)[_0x2ff5('0x13')]({'output':_0x2ff5('0x19')});});};exports[_0x2ff5('0x1a')]=function(_0x53f5b0,_0x54a078){return git[_0x2ff5('0x1a')]([_0x2ff5('0x1b'),_0x2ff5('0x1c')],function(_0x54288e){if(_0x54288e){logger['error'](_0x54288e);return _0x54a078[_0x2ff5('0x17')](0x1f4)['json'](_0x54288e);}logger['info'](_0x2ff5('0x1d'));return _0x54a078[_0x2ff5('0x17')](0xc8)['json']({'output':'git\x20reset\x20--hard'});});};exports[_0x2ff5('0x1e')]=function(_0xd4a7e,_0x1e3c45){exec(_0x2ff5('0x1f'),function(_0x3f85a5,_0x2e805f,_0x2fc6d7){logger[_0x2ff5('0x18')](_0x2e805f);logger[_0x2ff5('0x18')](_0x2fc6d7);if(_0x3f85a5){logger[_0x2ff5('0x16')](_0x3f85a5);return _0x1e3c45[_0x2ff5('0x17')](0x1f4)[_0x2ff5('0x13')](_0x3f85a5);}return _0x1e3c45[_0x2ff5('0x17')](0xc8)[_0x2ff5('0x13')]({'output':_0x2e805f});});};exports[_0x2ff5('0x20')]=function(_0x5bd8dd,_0x529496){return pm2['restart']('motion2')[_0x2ff5('0x21')](function(_0x396576){logger[_0x2ff5('0x18')](_0x2ff5('0x22'),_0x396576);return _0x529496[_0x2ff5('0x17')](0xc8)[_0x2ff5('0x13')]({'output':_0x2ff5('0x23')});})['catch'](function(_0x4216fb){logger[_0x2ff5('0x16')](_0x4216fb);return _0x529496['status'](0x1f4)[_0x2ff5('0x13')](_0x4216fb);});};exports[_0x2ff5('0x24')]=function(_0xeb3710,_0xf5d74){var _0x121f48=fs[_0x2ff5('0x25')](path[_0x2ff5('0x26')](config['root'],_0x2ff5('0x27'),_0x2ff5('0x24')));var _0x614e0d=[];for(var _0x37904e=0x0;_0x37904e<_0x121f48[_0x2ff5('0x28')];_0x37904e++){var _0x109ff8=_0x121f48[_0x37904e]['replace']('.js','');if(compareVersions(module[_0x2ff5('0xd')][_0x2ff5('0x4')],_0x109ff8)===-0x1){_0x614e0d[_0x2ff5('0x29')](_0x109ff8);}}if(_0x614e0d[_0x2ff5('0x28')]){var _0x34e10d=_0x614e0d[_0x2ff5('0x2a')](compareVersions);var _0x2bbffd=new Umzug({'storage':_0x2ff5('0x2b'),'storageOptions':{'model':db[_0x2ff5('0x2c')],'modelName':_0x2ff5('0x2c'),'columnName':_0x2ff5('0x4')},'migrations':{'params':[db[_0x2ff5('0x2b')][_0x2ff5('0x2d')](),db[_0x2ff5('0x2b')][_0x2ff5('0x2e')],function(){throw new Error(_0x2ff5('0x2f'));}],'path':path[_0x2ff5('0x26')](config[_0x2ff5('0xc')],'server',_0x2ff5('0x24')),'pattern':/\.js$/}});_0x2bbffd['up']({'migrations':_[_0x2ff5('0x30')](_0x34e10d,function(_0x6dae0a){return _0x6dae0a+_0x2ff5('0x31');})})[_0x2ff5('0x21')](function(){return _0xf5d74[_0x2ff5('0x17')](0xc8)[_0x2ff5('0x13')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module['exports'][_0x2ff5('0x4')]+'\x20to\x20'+_['last'](_0x34e10d),'migrations':_[_0x2ff5('0x26')](_0x34e10d)});})[_0x2ff5('0x32')](function(_0x3db800){if(_0x3db800 instanceof db['sequelize'][_0x2ff5('0x33')]){return _0xf5d74[_0x2ff5('0x17')](0xc8)[_0x2ff5('0x13')]({'output':_0x2ff5('0x34')});}else{return _0xf5d74[_0x2ff5('0x17')](0x1f4)[_0x2ff5('0x13')](_0x3db800);}});}else{return _0xf5d74['status'](0xc8)['json']({'output':_0x2ff5('0x34')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index d6c0f02..0d64890 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 _0x6a63=['index','/describe','/:id','post','create','update','destroy','exports','util','path','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated'];(function(_0x246b17,_0x17f237){var _0x3cd550=function(_0x372d0a){while(--_0x372d0a){_0x246b17['push'](_0x246b17['shift']());}};_0x3cd550(++_0x17f237);}(_0x6a63,0x68));var _0x36a6=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x6a63[_0x9cd4c3];return _0x4c9025;};'use strict';var multer=require('multer');var util=require(_0x36a6('0x0'));var path=require(_0x36a6('0x1'));var timeout=require('connect-timeout');var express=require(_0x36a6('0x2'));var router=express[_0x36a6('0x3')]();var fs_extra=require(_0x36a6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x36a6('0x5'));var config=require('../../config/environment');var controller=require('./voiceAgentReport.controller');router[_0x36a6('0x6')]('/',auth[_0x36a6('0x7')](),controller[_0x36a6('0x8')]);router[_0x36a6('0x6')](_0x36a6('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x36a6('0x6')](_0x36a6('0xa'),auth[_0x36a6('0x7')](),controller['show']);router[_0x36a6('0xb')]('/',auth[_0x36a6('0x7')](),controller[_0x36a6('0xc')]);router['put']('/:id',auth[_0x36a6('0x7')](),controller[_0x36a6('0xd')]);router['delete']('/:id',auth[_0x36a6('0x7')](),controller[_0x36a6('0xe')]);module[_0x36a6('0xf')]=router; \ No newline at end of file +var _0xe6f6=['isAuthenticated','index','get','/:id','show','post','create','put','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller'];(function(_0x202c61,_0x3673e0){var _0x540691=function(_0x409610){while(--_0x409610){_0x202c61['push'](_0x202c61['shift']());}};_0x540691(++_0x3673e0);}(_0xe6f6,0x13b));var _0x6e6f=function(_0xdd65dc,_0xebeaea){_0xdd65dc=_0xdd65dc-0x0;var _0x453595=_0xe6f6[_0xdd65dc];return _0x453595;};'use strict';var multer=require('multer');var util=require(_0x6e6f('0x0'));var path=require(_0x6e6f('0x1'));var timeout=require(_0x6e6f('0x2'));var express=require('express');var router=express[_0x6e6f('0x3')]();var fs_extra=require(_0x6e6f('0x4'));var auth=require(_0x6e6f('0x5'));var interaction=require(_0x6e6f('0x6'));var config=require(_0x6e6f('0x7'));var controller=require(_0x6e6f('0x8'));router['get']('/',auth[_0x6e6f('0x9')](),controller[_0x6e6f('0xa')]);router[_0x6e6f('0xb')]('/describe',auth[_0x6e6f('0x9')](),controller['describe']);router[_0x6e6f('0xb')](_0x6e6f('0xc'),auth['isAuthenticated'](),controller[_0x6e6f('0xd')]);router[_0x6e6f('0xe')]('/',auth[_0x6e6f('0x9')](),controller[_0x6e6f('0xf')]);router[_0x6e6f('0x10')](_0x6e6f('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x6e6f('0xc'),auth[_0x6e6f('0x9')](),controller[_0x6e6f('0x11')]);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 078d3c1..2e4b9a1 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 _0xd26f=['BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','INTEGER'];(function(_0x4aba0e,_0x3cca89){var _0x240301=function(_0x376410){while(--_0x376410){_0x4aba0e['push'](_0x4aba0e['shift']());}};_0x240301(++_0x3cca89);}(_0xd26f,0x113));var _0xfd26=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xd26f[_0x5bd426];return _0x23a7eb;};'use strict';var Sequelize=require(_0xfd26('0x0'));module[_0xfd26('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xfd26('0x2')]},'calleridname':{'type':Sequelize[_0xfd26('0x2')]},'queue':{'type':Sequelize[_0xfd26('0x2')]},'interface':{'type':Sequelize[_0xfd26('0x2')]},'membername':{'type':Sequelize[_0xfd26('0x2')]},'agentcalledAt':{'type':Sequelize[_0xfd26('0x3')]},'agentconnectAt':{'type':Sequelize[_0xfd26('0x3')]},'agentcompleteAt':{'type':Sequelize[_0xfd26('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xfd26('0x3')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xfd26('0x4')]},'agentcomplete':{'type':Sequelize[_0xfd26('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xfd26('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xfd26('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xfd26('0x4')]},'agentacw':{'type':Sequelize[_0xfd26('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xfd26('0x2')]},'lastevent':{'type':Sequelize[_0xfd26('0x2')]},'channel':{'type':Sequelize[_0xfd26('0x2')]},'channelstate':{'type':Sequelize[_0xfd26('0x4')]},'channelstatedesc':{'type':Sequelize[_0xfd26('0x2')]},'connectedlinenum':{'type':Sequelize[_0xfd26('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xfd26('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xfd26('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xfd26('0x2')]},'destcalleridname':{'type':Sequelize[_0xfd26('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xfd26('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xfd26('0x2')]},'destlanguage':{'type':Sequelize[_0xfd26('0x2')]},'destaccountcode':{'type':Sequelize[_0xfd26('0x2')]},'destcontext':{'type':Sequelize[_0xfd26('0x2')]},'destexten':{'type':Sequelize[_0xfd26('0x2')]},'destpriority':{'type':Sequelize[_0xfd26('0x2')]},'destuniqueid':{'type':Sequelize[_0xfd26('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xfd26('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xfd26('0x2')]},'transfer':{'type':Sequelize[_0xfd26('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xfd26('0x2')],'comment':_0xfd26('0x6')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xfd26('0x2')]},'agententerreason':{'type':Sequelize[_0xfd26('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xcf66=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','BOOLEAN','INTEGER'];(function(_0x47a851,_0x403c29){var _0x1b9014=function(_0x2b3775){while(--_0x2b3775){_0x47a851['push'](_0x47a851['shift']());}};_0x1b9014(++_0x403c29);}(_0xcf66,0x71));var _0x6cf6=function(_0x327dbd,_0x2ff882){_0x327dbd=_0x327dbd-0x0;var _0x272df5=_0xcf66[_0x327dbd];return _0x272df5;};'use strict';var Sequelize=require(_0x6cf6('0x0'));module[_0x6cf6('0x1')]={'type':{'type':Sequelize[_0x6cf6('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x6cf6('0x2')]},'calleridname':{'type':Sequelize[_0x6cf6('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x6cf6('0x2')]},'agentcalledAt':{'type':Sequelize[_0x6cf6('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0x6cf6('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x6cf6('0x3')]},'agentdumpAt':{'type':Sequelize[_0x6cf6('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x6cf6('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x6cf6('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x6cf6('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x6cf6('0x5')]},'agentacw':{'type':Sequelize[_0x6cf6('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x6cf6('0x5')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x6cf6('0x5')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x6cf6('0x2')]},'connectedlinename':{'type':Sequelize[_0x6cf6('0x2')]},'language':{'type':Sequelize[_0x6cf6('0x2')]},'accountcode':{'type':Sequelize[_0x6cf6('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x6cf6('0x2')]},'destchannelstate':{'type':Sequelize[_0x6cf6('0x5')]},'destchannelstatedesc':{'type':Sequelize[_0x6cf6('0x2')]},'destcalleridnum':{'type':Sequelize[_0x6cf6('0x2')]},'destcalleridname':{'type':Sequelize[_0x6cf6('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x6cf6('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x6cf6('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x6cf6('0x2')]},'destexten':{'type':Sequelize[_0x6cf6('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x6cf6('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x6cf6('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x6cf6('0x2')]},'transfer':{'type':Sequelize[_0x6cf6('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x6cf6('0x2')],'comment':_0x6cf6('0x6')},'transferexten':{'type':Sequelize[_0x6cf6('0x2')]},'transferuniqueid':{'type':Sequelize[_0x6cf6('0x2')]},'agententerreason':{'type':Sequelize[_0x6cf6('0x5')],'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 b8dcc73..d857ae3 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(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_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 71b8b72..2144821 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 _0x3148=['util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','report_agent','destuniqueid','lodash'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x3148,0x1d3));var _0x8314=function(_0x6e8761,_0xaef231){_0x6e8761=_0x6e8761-0x0;var _0x4e2142=_0x3148[_0x6e8761];return _0x4e2142;};'use strict';var _=require(_0x8314('0x0'));var util=require(_0x8314('0x1'));var logger=require('../../config/logger')(_0x8314('0x2'));var moment=require(_0x8314('0x3'));var BPromise=require(_0x8314('0x4'));var rp=require(_0x8314('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8314('0x6'));var config=require(_0x8314('0x7'));var attributes=require(_0x8314('0x8'));module[_0x8314('0x9')]=function(_0x18a30b,_0x9cb271){return _0x18a30b[_0x8314('0xa')]('VoiceAgentReport',attributes,{'tableName':_0x8314('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0x8314('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6b8f=['exports','define','VoiceAgentReport','report_agent','util','api','request-promise','path','../../config/environment','./voiceAgentReport.attributes'];(function(_0x33626a,_0x1d2abc){var _0x2f6f30=function(_0x3f387b){while(--_0x3f387b){_0x33626a['push'](_0x33626a['shift']());}};_0x2f6f30(++_0x1d2abc);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x5bd459,_0x13c8ad){_0x5bd459=_0x5bd459-0x0;var _0x507699=_0x6b8f[_0x5bd459];return _0x507699;};'use strict';var _=require('lodash');var util=require(_0xf6b8('0x0'));var logger=require('../../config/logger')(_0xf6b8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf6b8('0x2'));var fs=require('fs');var path=require(_0xf6b8('0x3'));var rimraf=require('rimraf');var config=require(_0xf6b8('0x4'));var attributes=require(_0xf6b8('0x5'));module[_0xf6b8('0x6')]=function(_0x549eac,_0x2d035e){return _0x549eac[_0xf6b8('0x7')](_0xf6b8('0x8'),attributes,{'tableName':_0xf6b8('0x9'),'paranoid':![],'indexes':[{'fields':['uniqueid','destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 2185ef4..f828702 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 _0x7ea2=['client','request','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','VoiceAgentReport','create','options','then','CreateVoiceAgentReport','stringify','update','body','raw','limit','UpdateVoiceAgentReport','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x1ef726,_0x16fdea){var _0x4c3c66=function(_0x1bf2de){while(--_0x1bf2de){_0x1ef726['push'](_0x1ef726['shift']());}};_0x4c3c66(++_0x16fdea);}(_0x7ea2,0x116));var _0x27ea=function(_0x7d62cb,_0x7622c){_0x7d62cb=_0x7d62cb-0x0;var _0x3a6266=_0x7ea2[_0x7d62cb];return _0x3a6266;};'use strict';var _=require(_0x27ea('0x0'));var util=require(_0x27ea('0x1'));var moment=require(_0x27ea('0x2'));var BPromise=require(_0x27ea('0x3'));var rs=require(_0x27ea('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x27ea('0x5'))['db'];var utils=require(_0x27ea('0x6'));var logger=require(_0x27ea('0x7'))('rpc');var config=require(_0x27ea('0x8'));var jayson=require(_0x27ea('0x9'));var client=jayson[_0x27ea('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1abef7,_0x3bc9c0,_0x2d541f){return new BPromise(function(_0x26635f,_0x125440){return client[_0x27ea('0xb')](_0x1abef7,_0x2d541f)['then'](function(_0x296496){logger[_0x27ea('0xc')](_0x27ea('0xd'),_0x3bc9c0,_0x27ea('0xe'));logger[_0x27ea('0xf')](_0x27ea('0x10'),_0x3bc9c0,_0x27ea('0xe'),JSON['stringify'](_0x296496));if(_0x296496['error']){if(_0x296496[_0x27ea('0x11')][_0x27ea('0x12')]===0x1f4){logger[_0x27ea('0x11')](_0x27ea('0xd'),_0x3bc9c0,_0x296496[_0x27ea('0x11')][_0x27ea('0x13')]);return _0x125440(_0x296496['error'][_0x27ea('0x13')]);}logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x3bc9c0,_0x296496[_0x27ea('0x11')][_0x27ea('0x13')]);return _0x26635f(_0x296496['error'][_0x27ea('0x13')]);}else{logger[_0x27ea('0xc')](_0x27ea('0xd'),_0x3bc9c0,_0x27ea('0xe'));_0x26635f(_0x296496['result'][_0x27ea('0x13')]);}})[_0x27ea('0x14')](function(_0x51cd09){logger[_0x27ea('0x11')](_0x27ea('0xd'),_0x3bc9c0,_0x51cd09);_0x125440(_0x51cd09);});});}exports['CreateVoiceAgentReport']=function(_0x24eb6c){var _0xc3138f=this;return new Promise(function(_0x386461,_0x259162){return db[_0x27ea('0x15')][_0x27ea('0x16')](_0x24eb6c['body'],{'raw':_0x24eb6c[_0x27ea('0x17')]?_0x24eb6c[_0x27ea('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x27ea('0x18')](function(_0x440cfc){logger[_0x27ea('0xc')](_0x27ea('0x19'),_0x24eb6c);logger[_0x27ea('0xf')](_0x27ea('0x19'),_0x24eb6c,JSON[_0x27ea('0x1a')](_0x440cfc));_0x386461(_0x440cfc);})[_0x27ea('0x14')](function(_0x5ed336){logger[_0x27ea('0x11')](_0x27ea('0x19'),_0x5ed336['message'],_0x24eb6c);_0x259162(_0xc3138f[_0x27ea('0x11')](0x1f4,_0x5ed336['message']));});});};exports['UpdateVoiceAgentReport']=function(_0x4774f8){var _0x38a27f=this;return new Promise(function(_0x5b8d4a,_0x3070a6){return db[_0x27ea('0x15')][_0x27ea('0x1b')](_0x4774f8[_0x27ea('0x1c')],{'raw':_0x4774f8[_0x27ea('0x17')]?_0x4774f8[_0x27ea('0x17')][_0x27ea('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4774f8['options']?_0x4774f8['options']['where']||null:null,'attributes':_0x4774f8[_0x27ea('0x17')]?_0x4774f8[_0x27ea('0x17')]['attributes']||null:null,'limit':_0x4774f8[_0x27ea('0x17')]?_0x4774f8[_0x27ea('0x17')][_0x27ea('0x1e')]||null:null})[_0x27ea('0x18')](function(_0x2d5b8f){logger[_0x27ea('0xc')](_0x27ea('0x1f'),_0x4774f8);logger['debug'](_0x27ea('0x1f'),_0x4774f8,JSON['stringify'](_0x2d5b8f));_0x5b8d4a(_0x2d5b8f);})['catch'](function(_0x163faa){logger['error'](_0x27ea('0x1f'),_0x163faa[_0x27ea('0x13')],_0x4774f8);_0x3070a6(_0x38a27f[_0x27ea('0x11')](0x1f4,_0x163faa[_0x27ea('0x13')]));});});}; \ No newline at end of file +var _0x228d=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceAgentReport,\x20%s,\x20%s','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','then','info','debug','UpdateVoiceAgentReport','where','limit','lodash'];(function(_0x27530d,_0x46480a){var _0x59e561=function(_0x395fe9){while(--_0x395fe9){_0x27530d['push'](_0x27530d['shift']());}};_0x59e561(++_0x46480a);}(_0x228d,0xed));var _0xd228=function(_0x3a24b8,_0x1b7651){_0x3a24b8=_0x3a24b8-0x0;var _0x502dd8=_0x228d[_0x3a24b8];return _0x502dd8;};'use strict';var _=require(_0xd228('0x0'));var util=require(_0xd228('0x1'));var moment=require(_0xd228('0x2'));var BPromise=require(_0xd228('0x3'));var rs=require(_0xd228('0x4'));var fs=require('fs');var Redis=require(_0xd228('0x5'));var db=require(_0xd228('0x6'))['db'];var utils=require(_0xd228('0x7'));var logger=require(_0xd228('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd228('0x9'));var client=jayson[_0xd228('0xa')][_0xd228('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13e917,_0x3ce4ec,_0x58ce99){return new BPromise(function(_0x30fc92,_0x26b342){return client[_0xd228('0xc')](_0x13e917,_0x58ce99)['then'](function(_0x2648bb){logger['info']('VoiceAgentReport,\x20%s,\x20%s',_0x3ce4ec,_0xd228('0xd'));logger['debug'](_0xd228('0xe'),_0x3ce4ec,'request\x20sent',JSON[_0xd228('0xf')](_0x2648bb));if(_0x2648bb[_0xd228('0x10')]){if(_0x2648bb[_0xd228('0x10')][_0xd228('0x11')]===0x1f4){logger[_0xd228('0x10')](_0xd228('0x12'),_0x3ce4ec,_0x2648bb[_0xd228('0x10')][_0xd228('0x13')]);return _0x26b342(_0x2648bb[_0xd228('0x10')][_0xd228('0x13')]);}logger[_0xd228('0x10')](_0xd228('0x12'),_0x3ce4ec,_0x2648bb['error'][_0xd228('0x13')]);return _0x30fc92(_0x2648bb[_0xd228('0x10')][_0xd228('0x13')]);}else{logger['info'](_0xd228('0x12'),_0x3ce4ec,'request\x20sent');_0x30fc92(_0x2648bb[_0xd228('0x14')][_0xd228('0x13')]);}})[_0xd228('0x15')](function(_0x185a84){logger[_0xd228('0x10')]('VoiceAgentReport,\x20%s,\x20%s',_0x3ce4ec,_0x185a84);_0x26b342(_0x185a84);});});}exports[_0xd228('0x16')]=function(_0x1ab5f9){var _0x25e45e=this;return new Promise(function(_0x5ce387,_0x457aa5){return db[_0xd228('0x17')][_0xd228('0x18')](_0x1ab5f9[_0xd228('0x19')],{'raw':_0x1ab5f9[_0xd228('0x1a')]?_0x1ab5f9[_0xd228('0x1a')][_0xd228('0x1b')]===undefined?!![]:![]:!![]})[_0xd228('0x1c')](function(_0x16fcd0){logger[_0xd228('0x1d')](_0xd228('0x16'),_0x1ab5f9);logger[_0xd228('0x1e')](_0xd228('0x16'),_0x1ab5f9,JSON['stringify'](_0x16fcd0));_0x5ce387(_0x16fcd0);})[_0xd228('0x15')](function(_0x1b0840){logger[_0xd228('0x10')](_0xd228('0x16'),_0x1b0840[_0xd228('0x13')],_0x1ab5f9);_0x457aa5(_0x25e45e['error'](0x1f4,_0x1b0840[_0xd228('0x13')]));});});};exports[_0xd228('0x1f')]=function(_0xf6c8b){var _0x3d013f=this;return new Promise(function(_0x8bfb09,_0x381ca6){return db[_0xd228('0x17')]['update'](_0xf6c8b['body'],{'raw':_0xf6c8b['options']?_0xf6c8b[_0xd228('0x1a')][_0xd228('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf6c8b[_0xd228('0x1a')]?_0xf6c8b['options'][_0xd228('0x20')]||null:null,'attributes':_0xf6c8b[_0xd228('0x1a')]?_0xf6c8b[_0xd228('0x1a')]['attributes']||null:null,'limit':_0xf6c8b[_0xd228('0x1a')]?_0xf6c8b['options'][_0xd228('0x21')]||null:null})['then'](function(_0x3f3eeb){logger[_0xd228('0x1d')](_0xd228('0x1f'),_0xf6c8b);logger['debug'](_0xd228('0x1f'),_0xf6c8b,JSON[_0xd228('0xf')](_0x3f3eeb));_0x8bfb09(_0x3f3eeb);})[_0xd228('0x15')](function(_0xd53563){logger['error']('UpdateVoiceAgentReport',_0xd53563['message'],_0xf6c8b);_0x381ca6(_0x3d013f['error'](0x1f4,_0xd53563[_0xd228('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 21305b4..6599cb3 100644 --- a/server/api/voiceCallReport/index.js +++ b/server/api/voiceCallReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x50a6=['create','/:id','update','destroy','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','index','get','/describe','isAuthenticated','show'];(function(_0x50da63,_0x363a1a){var _0x394262=function(_0x22994e){while(--_0x22994e){_0x50da63['push'](_0x50da63['shift']());}};_0x394262(++_0x363a1a);}(_0x50a6,0xa4));var _0x650a=function(_0x273f77,_0xe5b0cb){_0x273f77=_0x273f77-0x0;var _0x71e147=_0x50a6[_0x273f77];return _0x71e147;};'use strict';var multer=require(_0x650a('0x0'));var util=require(_0x650a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x650a('0x2'));var router=express['Router']();var fs_extra=require(_0x650a('0x3'));var auth=require(_0x650a('0x4'));var interaction=require(_0x650a('0x5'));var config=require('../../config/environment');var controller=require(_0x650a('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x650a('0x7')]);router[_0x650a('0x8')](_0x650a('0x9'),auth[_0x650a('0xa')](),controller['describe']);router[_0x650a('0x8')]('/:id',auth[_0x650a('0xa')](),controller[_0x650a('0xb')]);router['post']('/',auth[_0x650a('0xa')](),controller[_0x650a('0xc')]);router['put'](_0x650a('0xd'),auth['isAuthenticated'](),controller[_0x650a('0xe')]);router['delete'](_0x650a('0xd'),auth['isAuthenticated'](),controller[_0x650a('0xf')]);module['exports']=router; \ No newline at end of file +var _0x7dfd=['isAuthenticated','index','/describe','/:id','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get'];(function(_0x152807,_0x363fe7){var _0x48f199=function(_0x114070){while(--_0x114070){_0x152807['push'](_0x152807['shift']());}};_0x48f199(++_0x363fe7);}(_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')]('/',auth[_0xd7df('0xc')](),controller[_0xd7df('0xd')]);router[_0xd7df('0xb')](_0xd7df('0xe'),auth[_0xd7df('0xc')](),controller['describe']);router[_0xd7df('0xb')](_0xd7df('0xf'),auth[_0xd7df('0xc')](),controller[_0xd7df('0x10')]);router['post']('/',auth[_0xd7df('0xc')](),controller['create']);router[_0xd7df('0x11')]('/:id',auth[_0xd7df('0xc')](),controller[_0xd7df('0x12')]);router[_0xd7df('0x13')](_0xd7df('0xf'),auth[_0xd7df('0xc')](),controller[_0xd7df('0x14')]);module[_0xd7df('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 628c2e5..83fe84e 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 _0xedc7=['sequelize','exports','STRING','ENUM','inbound','outbound-fax','dialer','TEXT','DATE','INTEGER'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0xedc7,0x1f4));var _0x7edc=function(_0x1c2a0e,_0x4b5348){_0x1c2a0e=_0x1c2a0e-0x0;var _0x35effc=_0xedc7[_0x1c2a0e];return _0x35effc;};'use strict';var Sequelize=require(_0x7edc('0x0'));module[_0x7edc('0x1')]={'uniqueid':{'type':Sequelize[_0x7edc('0x2')]},'type':{'type':Sequelize[_0x7edc('0x3')](_0x7edc('0x4'),'internal','outbound','inbound-fax',_0x7edc('0x5'),_0x7edc('0x6'))},'tag':{'type':Sequelize[_0x7edc('0x2')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0x7edc('0x2')]},'destination':{'type':Sequelize[_0x7edc('0x2')]},'destinationcontext':{'type':Sequelize[_0x7edc('0x2')]},'callerid':{'type':Sequelize[_0x7edc('0x2')]},'channel':{'type':Sequelize[_0x7edc('0x2')]},'destinationchannel':{'type':Sequelize[_0x7edc('0x2')]},'lastapplication':{'type':Sequelize[_0x7edc('0x2')]},'lastdata':{'type':Sequelize[_0x7edc('0x7')]},'starttime':{'type':Sequelize[_0x7edc('0x8')]},'systemanswertime':{'type':Sequelize[_0x7edc('0x8')]},'answertime':{'type':Sequelize[_0x7edc('0x8')]},'endtime':{'type':Sequelize[_0x7edc('0x8')]},'duration':{'type':Sequelize[_0x7edc('0x9')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x7edc('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x7edc('0x2')]},'amaflags':{'type':Sequelize[_0x7edc('0x2')]},'userfield':{'type':Sequelize[_0x7edc('0x2')]},'userDisposition':{'type':Sequelize[_0x7edc('0x2')]},'userSecondDisposition':{'type':Sequelize[_0x7edc('0x2')]},'userThirdDisposition':{'type':Sequelize[_0x7edc('0x2')]},'note':{'type':Sequelize[_0x7edc('0x2')]},'prefix':{'type':Sequelize[_0x7edc('0x2')]},'routeid':{'type':Sequelize[_0x7edc('0x9')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa321=['TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM','internal','outbound','outbound-fax','dialer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa321,0x9d));var _0x1a32=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0xa321[_0x278e3c];return _0x3e2d9b;};'use strict';var Sequelize=require(_0x1a32('0x0'));module[_0x1a32('0x1')]={'uniqueid':{'type':Sequelize[_0x1a32('0x2')]},'type':{'type':Sequelize[_0x1a32('0x3')]('inbound',_0x1a32('0x4'),_0x1a32('0x5'),'inbound-fax',_0x1a32('0x6'),_0x1a32('0x7'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x1a32('0x2')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x1a32('0x2')]},'channel':{'type':Sequelize[_0x1a32('0x2')]},'destinationchannel':{'type':Sequelize[_0x1a32('0x2')]},'lastapplication':{'type':Sequelize[_0x1a32('0x2')]},'lastdata':{'type':Sequelize[_0x1a32('0x8')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x1a32('0x9')]},'answertime':{'type':Sequelize[_0x1a32('0x9')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0x1a32('0xa')]},'billableseconds':{'type':Sequelize[_0x1a32('0xa')]},'mohtime':{'type':Sequelize[_0x1a32('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x1a32('0x2')]},'amaflags':{'type':Sequelize[_0x1a32('0x2')]},'userfield':{'type':Sequelize[_0x1a32('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x1a32('0x2')]},'userThirdDisposition':{'type':Sequelize[_0x1a32('0x2')]},'note':{'type':Sequelize[_0x1a32('0x2')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0x1a32('0xa')]},'sipcallid':{'type':Sequelize[_0x1a32('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 8f74abd..5442a23 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(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x5f66,0x1a0));var _0x65f6=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x5f66[_0x297fd3];return _0x2af381;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'attributes':['id',_0x65f6('0x23'),_0x65f6('0x3c'),_0x65f6('0x3d')],'model':db[_0x65f6('0x3e')],'as':_0x65f6('0x3e')}];}return db[_0x65f6('0x27')]['findAll'](_0x4ac04b);})[_0x65f6('0x21')](function(_0x400ed2){_0x266cfe[_0x65f6('0x3f')]=_0x400ed2;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))[_0x65f6('0x40')](handleError(_0x559330,null));};exports[_0x65f6('0x41')]=function(_0xe0b72d,_0x2e91e8){var _0x461393={'raw':!![],'where':{'id':_0xe0b72d[_0x65f6('0x42')]['id']}},_0x2abbed={};_0x2abbed[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x2abbed[_0x65f6('0x2c')]=_['keys'](_0xe0b72d[_0x65f6('0x2c')]);_0x2abbed[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],_0x2abbed['query']);_0x461393[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],qs['fields'](_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x2f')]));_0x461393[_0x65f6('0x30')]=_0x461393[_0x65f6('0x30')]['length']?_0x461393[_0x65f6('0x30')]:_0x2abbed['model'];if(_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x461393['include']=[{'all':!![]}];}_0x461393=_[_0x65f6('0x37')]({},_0x461393,_0xe0b72d['options']);return db[_0x65f6('0x27')][_0x65f6('0x43')](_0x461393)[_0x65f6('0x21')](handleEntityNotFound(_0x2e91e8,null))[_0x65f6('0x21')](respondWithResult(_0x2e91e8,null))[_0x65f6('0x40')](handleError(_0x2e91e8,null));};exports[_0x65f6('0x44')]=function(_0x4d30c5,_0x51bf6c){return db[_0x65f6('0x27')][_0x65f6('0x44')](_0x4d30c5[_0x65f6('0x45')],{})[_0x65f6('0x21')](respondWithResult(_0x51bf6c,0xc9))[_0x65f6('0x40')](handleError(_0x51bf6c,null));};exports[_0x65f6('0x20')]=function(_0x149c28,_0x41690c){return db[_0x65f6('0x27')]['find']({'where':{'id':_0x149c28[_0x65f6('0x42')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x41690c,null))[_0x65f6('0x21')](removeEntity(_0x41690c,null))['catch'](handleError(_0x41690c,null));};exports[_0x65f6('0x46')]=function(_0x42d453,_0x49ba5a){return db[_0x65f6('0x27')][_0x65f6('0x46')]()['then'](respondWithResult(_0x49ba5a,null))[_0x65f6('0x40')](handleError(_0x49ba5a,null));};exports['update']=function(_0x247be3,_0x3b241f){if(_0x247be3[_0x65f6('0x45')]['uniqueid']){delete _0x247be3[_0x65f6('0x45')][_0x65f6('0x47')];}return db['VoiceCallReport'][_0x65f6('0x43')]({'where':{'uniqueid':_0x247be3[_0x65f6('0x42')]['id'],'UserId':{'$or':[null,_0x247be3['user']['id']]}}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b241f,null))[_0x65f6('0x21')](saveUpdates(_0x247be3[_0x65f6('0x45')],null))[_0x65f6('0x21')](respondWithResult(_0x3b241f,null))[_0x65f6('0x40')](handleError(_0x3b241f,null));}; \ No newline at end of file +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(_0x4ca712,_0x285d74){var _0x1710d2=function(_0x21dfcb){while(--_0x21dfcb){_0x4ca712['push'](_0x4ca712['shift']());}};_0x1710d2(++_0x285d74);}(_0xdb28,0x106));var _0x8db2=function(_0x69ab61,_0x4c78d3){_0x69ab61=_0x69ab61-0x0;var _0x41af98=_0xdb28[_0x69ab61];return _0x41af98;};'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 293d3cf..dae537b 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 _0x6246=['VoiceCallReport','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x56dc96,_0x1a48b0){var _0x46fea5=function(_0x19c06f){while(--_0x19c06f){_0x56dc96['push'](_0x56dc96['shift']());}};_0x46fea5(++_0x1a48b0);}(_0x6246,0x19a));var _0x6624=function(_0x1ac6a0,_0x5783e7){_0x1ac6a0=_0x1ac6a0-0x0;var _0x26de06=_0x6246[_0x1ac6a0];return _0x26de06;};'use strict';var _=require(_0x6624('0x0'));var util=require(_0x6624('0x1'));var logger=require(_0x6624('0x2'))('api');var moment=require(_0x6624('0x3'));var BPromise=require(_0x6624('0x4'));var rp=require(_0x6624('0x5'));var fs=require('fs');var path=require(_0x6624('0x6'));var rimraf=require(_0x6624('0x7'));var config=require('../../config/environment');var attributes=require('./voiceCallReport.attributes');module[_0x6624('0x8')]=function(_0x4a9fe6,_0x535bb2){return _0x4a9fe6[_0x6624('0x9')](_0x6624('0xa'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0x6624('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xba10=['lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid'];(function(_0x4c2c17,_0x5e7044){var _0x5581da=function(_0x112bd7){while(--_0x112bd7){_0x4c2c17['push'](_0x4c2c17['shift']());}};_0x5581da(++_0x5e7044);}(_0xba10,0x70));var _0x0ba1=function(_0x14021a,_0x4b8c88){_0x14021a=_0x14021a-0x0;var _0x4fda56=_0xba10[_0x14021a];return _0x4fda56;};'use strict';var _=require(_0x0ba1('0x0'));var util=require(_0x0ba1('0x1'));var logger=require(_0x0ba1('0x2'))(_0x0ba1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0ba1('0x4'));var fs=require('fs');var path=require(_0x0ba1('0x5'));var rimraf=require(_0x0ba1('0x6'));var config=require(_0x0ba1('0x7'));var attributes=require(_0x0ba1('0x8'));module[_0x0ba1('0x9')]=function(_0x482081,_0x1e71f7){return _0x482081[_0x0ba1('0xa')](_0x0ba1('0xb'),attributes,{'tableName':_0x0ba1('0xc'),'paranoid':![],'indexes':[{'fields':[_0x0ba1('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 c2785fc..6045a6d 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 _0xf858=['request','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','then','GetVoiceCallReport','stringify','CreateVoiceCallReport','VoiceCallReport','create','update','body','UpdateVoiceCallReport','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x324496,_0x3a4cdd){var _0x899545=function(_0x506ef1){while(--_0x506ef1){_0x324496['push'](_0x324496['shift']());}};_0x899545(++_0x3a4cdd);}(_0xf858,0x10d));var _0x8f85=function(_0x5ede6c,_0x11cb23){_0x5ede6c=_0x5ede6c-0x0;var _0x159814=_0xf858[_0x5ede6c];return _0x159814;};'use strict';var _=require('lodash');var util=require(_0x8f85('0x0'));var moment=require('moment');var BPromise=require(_0x8f85('0x1'));var rs=require(_0x8f85('0x2'));var fs=require('fs');var Redis=require(_0x8f85('0x3'));var db=require(_0x8f85('0x4'))['db'];var utils=require(_0x8f85('0x5'));var logger=require(_0x8f85('0x6'))(_0x8f85('0x7'));var config=require(_0x8f85('0x8'));var jayson=require(_0x8f85('0x9'));var client=jayson['client'][_0x8f85('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b3573,_0xf35259,_0x177353){return new BPromise(function(_0x53f555,_0x500ffd){return client[_0x8f85('0xb')](_0x1b3573,_0x177353)['then'](function(_0x144582){logger[_0x8f85('0xc')](_0x8f85('0xd'),_0xf35259,_0x8f85('0xe'));logger[_0x8f85('0xf')](_0x8f85('0x10'),_0xf35259,_0x8f85('0xe'),JSON['stringify'](_0x144582));if(_0x144582[_0x8f85('0x11')]){if(_0x144582[_0x8f85('0x11')][_0x8f85('0x12')]===0x1f4){logger[_0x8f85('0x11')](_0x8f85('0xd'),_0xf35259,_0x144582[_0x8f85('0x11')][_0x8f85('0x13')]);return _0x500ffd(_0x144582[_0x8f85('0x11')][_0x8f85('0x13')]);}logger[_0x8f85('0x11')](_0x8f85('0xd'),_0xf35259,_0x144582[_0x8f85('0x11')][_0x8f85('0x13')]);return _0x53f555(_0x144582[_0x8f85('0x11')][_0x8f85('0x13')]);}else{logger['info'](_0x8f85('0xd'),_0xf35259,_0x8f85('0xe'));_0x53f555(_0x144582[_0x8f85('0x14')][_0x8f85('0x13')]);}})[_0x8f85('0x15')](function(_0x1c3007){logger['error']('VoiceCallReport,\x20%s,\x20%s',_0xf35259,_0x1c3007);_0x500ffd(_0x1c3007);});});}exports['GetVoiceCallReport']=function(_0xce0600){var _0x2dfca0=this;return new Promise(function(_0x38dcbe,_0x3cfb6b){return db['VoiceCallReport'][_0x8f85('0x16')]({'raw':_0xce0600[_0x8f85('0x17')]?_0xce0600[_0x8f85('0x17')][_0x8f85('0x18')]===undefined?!![]:![]:!![],'where':_0xce0600[_0x8f85('0x17')]?_0xce0600[_0x8f85('0x17')][_0x8f85('0x19')]||null:null,'attributes':_0xce0600[_0x8f85('0x17')]?_0xce0600['options'][_0x8f85('0x1a')]||null:null,'limit':_0xce0600[_0x8f85('0x17')]?_0xce0600['options'][_0x8f85('0x1b')]||null:null,'include':_0xce0600['options']?_0xce0600[_0x8f85('0x17')][_0x8f85('0x1c')]?_[_0x8f85('0x1d')](_0xce0600[_0x8f85('0x17')][_0x8f85('0x1c')],function(_0x4d5811){return{'model':db[_0x4d5811[_0x8f85('0x1e')]],'as':_0x4d5811['as'],'attributes':_0x4d5811[_0x8f85('0x1a')],'include':_0x4d5811[_0x8f85('0x1c')]?_[_0x8f85('0x1d')](_0x4d5811[_0x8f85('0x1c')],function(_0x355f52){return{'model':db[_0x355f52[_0x8f85('0x1e')]],'as':_0x355f52['as'],'attributes':_0x355f52['attributes'],'include':_0x355f52['include']?_[_0x8f85('0x1d')](_0x355f52[_0x8f85('0x1c')],function(_0x3f651d){return{'model':db[_0x3f651d[_0x8f85('0x1e')]],'as':_0x3f651d['as'],'attributes':_0x3f651d['attributes']};}):[]};}):[]};}):[]:[]})[_0x8f85('0x1f')](function(_0x517dc2){logger[_0x8f85('0xc')]('GetVoiceCallReport',_0xce0600);logger['debug'](_0x8f85('0x20'),_0xce0600,JSON[_0x8f85('0x21')](_0x517dc2));_0x38dcbe(_0x517dc2);})['catch'](function(_0x3c7365){logger[_0x8f85('0x11')](_0x8f85('0x20'),_0x3c7365[_0x8f85('0x13')],_0xce0600);_0x3cfb6b(_0x2dfca0[_0x8f85('0x11')](0x1f4,_0x3c7365['message']));});});};exports[_0x8f85('0x22')]=function(_0x169c8b){var _0x3a7712=this;return new Promise(function(_0x2974fc,_0x2af978){return db[_0x8f85('0x23')][_0x8f85('0x24')](_0x169c8b['body'],{'raw':_0x169c8b[_0x8f85('0x17')]?_0x169c8b['options']['raw']===undefined?!![]:![]:!![]})[_0x8f85('0x1f')](function(_0x48a780){logger['info'](_0x8f85('0x22'),_0x169c8b);logger[_0x8f85('0xf')](_0x8f85('0x22'),_0x169c8b,JSON[_0x8f85('0x21')](_0x48a780));_0x2974fc(_0x48a780);})[_0x8f85('0x15')](function(_0x43d894){logger['error']('CreateVoiceCallReport',_0x43d894[_0x8f85('0x13')],_0x169c8b);_0x2af978(_0x3a7712[_0x8f85('0x11')](0x1f4,_0x43d894[_0x8f85('0x13')]));});});};exports['UpdateVoiceCallReport']=function(_0x5b160d){var _0xbf1758=this;return new Promise(function(_0x3e30c8,_0x5ea55e){return db[_0x8f85('0x23')][_0x8f85('0x25')](_0x5b160d[_0x8f85('0x26')],{'raw':_0x5b160d[_0x8f85('0x17')]?_0x5b160d[_0x8f85('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b160d[_0x8f85('0x17')]?_0x5b160d[_0x8f85('0x17')][_0x8f85('0x19')]||null:null,'attributes':_0x5b160d[_0x8f85('0x17')]?_0x5b160d['options'][_0x8f85('0x1a')]||null:null,'limit':_0x5b160d[_0x8f85('0x17')]?_0x5b160d[_0x8f85('0x17')]['limit']||null:null})['then'](function(_0x39dbe9){logger[_0x8f85('0xc')](_0x8f85('0x27'),_0x5b160d);logger['debug'](_0x8f85('0x27'),_0x5b160d,JSON[_0x8f85('0x21')](_0x39dbe9));_0x3e30c8(_0x39dbe9);})[_0x8f85('0x15')](function(_0x1e42f8){logger[_0x8f85('0x11')](_0x8f85('0x27'),_0x1e42f8[_0x8f85('0x13')],_0x5b160d);_0x5ea55e(_0xbf1758['error'](0x1f4,_0x1e42f8['message']));});});}; \ No newline at end of file +var _0x1c44=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','limit','include','map','model','CreateVoiceCallReport','create','catch','UpdateVoiceCallReport','update'];(function(_0xab50a8,_0x5deb29){var _0x4fa4a3=function(_0x2b510c){while(--_0x2b510c){_0xab50a8['push'](_0xab50a8['shift']());}};_0x4fa4a3(++_0x5deb29);}(_0x1c44,0xc3));var _0x41c4=function(_0x4e8972,_0x17179a){_0x4e8972=_0x4e8972-0x0;var _0x521cb5=_0x1c44[_0x4e8972];return _0x521cb5;};'use strict';var _=require(_0x41c4('0x0'));var util=require(_0x41c4('0x1'));var moment=require(_0x41c4('0x2'));var BPromise=require('bluebird');var rs=require(_0x41c4('0x3'));var fs=require('fs');var Redis=require(_0x41c4('0x4'));var db=require(_0x41c4('0x5'))['db'];var utils=require(_0x41c4('0x6'));var logger=require(_0x41c4('0x7'))(_0x41c4('0x8'));var config=require(_0x41c4('0x9'));var jayson=require(_0x41c4('0xa'));var client=jayson['client'][_0x41c4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xe2dfda,_0x466004,_0x12a23f){return new BPromise(function(_0x139c08,_0x4a6af8){return client[_0x41c4('0xc')](_0xe2dfda,_0x12a23f)[_0x41c4('0xd')](function(_0x56dd35){logger[_0x41c4('0xe')](_0x41c4('0xf'),_0x466004,_0x41c4('0x10'));logger[_0x41c4('0x11')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x466004,_0x41c4('0x10'),JSON[_0x41c4('0x12')](_0x56dd35));if(_0x56dd35[_0x41c4('0x13')]){if(_0x56dd35[_0x41c4('0x13')][_0x41c4('0x14')]===0x1f4){logger[_0x41c4('0x13')](_0x41c4('0xf'),_0x466004,_0x56dd35[_0x41c4('0x13')][_0x41c4('0x15')]);return _0x4a6af8(_0x56dd35[_0x41c4('0x13')][_0x41c4('0x15')]);}logger[_0x41c4('0x13')](_0x41c4('0xf'),_0x466004,_0x56dd35[_0x41c4('0x13')][_0x41c4('0x15')]);return _0x139c08(_0x56dd35['error'][_0x41c4('0x15')]);}else{logger['info'](_0x41c4('0xf'),_0x466004,_0x41c4('0x10'));_0x139c08(_0x56dd35[_0x41c4('0x16')][_0x41c4('0x15')]);}})['catch'](function(_0x443757){logger[_0x41c4('0x13')]('VoiceCallReport,\x20%s,\x20%s',_0x466004,_0x443757);_0x4a6af8(_0x443757);});});}exports[_0x41c4('0x17')]=function(_0x31a623){var _0x426bdb=this;return new Promise(function(_0x526439,_0x2eeccf){return db[_0x41c4('0x18')][_0x41c4('0x19')]({'raw':_0x31a623[_0x41c4('0x1a')]?_0x31a623[_0x41c4('0x1a')][_0x41c4('0x1b')]===undefined?!![]:![]:!![],'where':_0x31a623[_0x41c4('0x1a')]?_0x31a623[_0x41c4('0x1a')][_0x41c4('0x1c')]||null:null,'attributes':_0x31a623[_0x41c4('0x1a')]?_0x31a623[_0x41c4('0x1a')][_0x41c4('0x1d')]||null:null,'limit':_0x31a623[_0x41c4('0x1a')]?_0x31a623['options'][_0x41c4('0x1e')]||null:null,'include':_0x31a623['options']?_0x31a623[_0x41c4('0x1a')][_0x41c4('0x1f')]?_[_0x41c4('0x20')](_0x31a623[_0x41c4('0x1a')][_0x41c4('0x1f')],function(_0x8ebfb2){return{'model':db[_0x8ebfb2[_0x41c4('0x21')]],'as':_0x8ebfb2['as'],'attributes':_0x8ebfb2['attributes'],'include':_0x8ebfb2[_0x41c4('0x1f')]?_[_0x41c4('0x20')](_0x8ebfb2[_0x41c4('0x1f')],function(_0x8923c5){return{'model':db[_0x8923c5[_0x41c4('0x21')]],'as':_0x8923c5['as'],'attributes':_0x8923c5[_0x41c4('0x1d')],'include':_0x8923c5[_0x41c4('0x1f')]?_[_0x41c4('0x20')](_0x8923c5[_0x41c4('0x1f')],function(_0x5857ed){return{'model':db[_0x5857ed[_0x41c4('0x21')]],'as':_0x5857ed['as'],'attributes':_0x5857ed[_0x41c4('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x41c4('0xd')](function(_0x14e4c7){logger[_0x41c4('0xe')](_0x41c4('0x17'),_0x31a623);logger['debug'](_0x41c4('0x17'),_0x31a623,JSON[_0x41c4('0x12')](_0x14e4c7));_0x526439(_0x14e4c7);})['catch'](function(_0x30e843){logger['error']('GetVoiceCallReport',_0x30e843[_0x41c4('0x15')],_0x31a623);_0x2eeccf(_0x426bdb[_0x41c4('0x13')](0x1f4,_0x30e843['message']));});});};exports[_0x41c4('0x22')]=function(_0xb3a4d6){var _0x1a7fa3=this;return new Promise(function(_0xeb40b4,_0x42af2f){return db[_0x41c4('0x18')][_0x41c4('0x23')](_0xb3a4d6['body'],{'raw':_0xb3a4d6[_0x41c4('0x1a')]?_0xb3a4d6[_0x41c4('0x1a')][_0x41c4('0x1b')]===undefined?!![]:![]:!![]})[_0x41c4('0xd')](function(_0x361caa){logger[_0x41c4('0xe')](_0x41c4('0x22'),_0xb3a4d6);logger['debug'](_0x41c4('0x22'),_0xb3a4d6,JSON[_0x41c4('0x12')](_0x361caa));_0xeb40b4(_0x361caa);})[_0x41c4('0x24')](function(_0x5ac08e){logger[_0x41c4('0x13')](_0x41c4('0x22'),_0x5ac08e['message'],_0xb3a4d6);_0x42af2f(_0x1a7fa3[_0x41c4('0x13')](0x1f4,_0x5ac08e[_0x41c4('0x15')]));});});};exports[_0x41c4('0x25')]=function(_0x26068e){var _0x4b9087=this;return new Promise(function(_0x11a092,_0x35e122){return db[_0x41c4('0x18')][_0x41c4('0x26')](_0x26068e['body'],{'raw':_0x26068e[_0x41c4('0x1a')]?_0x26068e[_0x41c4('0x1a')][_0x41c4('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26068e[_0x41c4('0x1a')]?_0x26068e[_0x41c4('0x1a')][_0x41c4('0x1c')]||null:null,'attributes':_0x26068e[_0x41c4('0x1a')]?_0x26068e[_0x41c4('0x1a')]['attributes']||null:null,'limit':_0x26068e[_0x41c4('0x1a')]?_0x26068e['options']['limit']||null:null})[_0x41c4('0xd')](function(_0x21453f){logger[_0x41c4('0xe')](_0x41c4('0x25'),_0x26068e);logger[_0x41c4('0x11')](_0x41c4('0x25'),_0x26068e,JSON[_0x41c4('0x12')](_0x21453f));_0x11a092(_0x21453f);})[_0x41c4('0x24')](function(_0x10fb6e){logger['error'](_0x41c4('0x25'),_0x10fb6e[_0x41c4('0x15')],_0x26068e);_0x35e122(_0x4b9087[_0x41c4('0x13')](0x1f4,_0x10fb6e[_0x41c4('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 36dbcbf..9859852 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 _0x82e2=['Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','show','post','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x59cc10,_0x5e5c20){var _0x1b7011=function(_0x46937a){while(--_0x46937a){_0x59cc10['push'](_0x59cc10['shift']());}};_0x1b7011(++_0x5e5c20);}(_0x82e2,0x151));var _0x282e=function(_0x48fcee,_0x431a8b){_0x48fcee=_0x48fcee-0x0;var _0x28d65a=_0x82e2[_0x48fcee];return _0x28d65a;};'use strict';var multer=require(_0x282e('0x0'));var util=require(_0x282e('0x1'));var path=require(_0x282e('0x2'));var timeout=require(_0x282e('0x3'));var express=require(_0x282e('0x4'));var router=express[_0x282e('0x5')]();var fs_extra=require(_0x282e('0x6'));var auth=require(_0x282e('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x282e('0x8'));var controller=require('./voiceChanSpy.controller');router[_0x282e('0x9')]('/',auth[_0x282e('0xa')](),controller['index']);router['get']('/:id',auth[_0x282e('0xa')](),controller[_0x282e('0xb')]);router[_0x282e('0xc')]('/',auth[_0x282e('0xa')](),controller[_0x282e('0xd')]);router[_0x282e('0xe')](_0x282e('0xf'),auth['isAuthenticated'](),controller[_0x282e('0x10')]);router[_0x282e('0x11')]('/:id',auth[_0x282e('0xa')](),controller['destroy']);module[_0x282e('0x12')]=router; \ No newline at end of file +var _0x174c=['./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show','post','update','delete','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x568fb4,_0xe223dc){var _0x4c9c18=function(_0x9d808d){while(--_0x9d808d){_0x568fb4['push'](_0x568fb4['shift']());}};_0x4c9c18(++_0xe223dc);}(_0x174c,0x82));var _0xc174=function(_0x15876a,_0x15383d){_0x15876a=_0x15876a-0x0;var _0xbd900f=_0x174c[_0x15876a];return _0xbd900f;};'use strict';var multer=require(_0xc174('0x0'));var util=require(_0xc174('0x1'));var path=require('path');var timeout=require(_0xc174('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc174('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xc174('0x4'));var config=require(_0xc174('0x5'));var controller=require(_0xc174('0x6'));router[_0xc174('0x7')]('/',auth[_0xc174('0x8')](),controller[_0xc174('0x9')]);router[_0xc174('0x7')](_0xc174('0xa'),auth[_0xc174('0x8')](),controller[_0xc174('0xb')]);router[_0xc174('0xc')]('/',auth[_0xc174('0x8')](),controller['create']);router['put'](_0xc174('0xa'),auth[_0xc174('0x8')](),controller[_0xc174('0xd')]);router[_0xc174('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xc174('0xf')]);module[_0xc174('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index f753d57..f4d6186 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 _0x492f=['setDataValue','options','split','BOOLEAN','sequelize','exports','STRING','name'];(function(_0x5bef68,_0x176752){var _0x226637=function(_0x35c5d8){while(--_0x35c5d8){_0x5bef68['push'](_0x5bef68['shift']());}};_0x226637(++_0x176752);}(_0x492f,0x1bc));var _0xf492=function(_0x44781e,_0x265fc7){_0x44781e=_0x44781e-0x0;var _0x49debb=_0x492f[_0x44781e];return _0x49debb;};'use strict';var Sequelize=require(_0xf492('0x0'));module[_0xf492('0x1')]={'name':{'type':Sequelize[_0xf492('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':_0xf492('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xf492('0x2')],'set':function(_0x380244){this[_0xf492('0x4')](_0xf492('0x5'),_0x380244?_0x380244['join'](''):[]);},'get':function(){return this['getDataValue'](_0xf492('0x5'))?this['getDataValue'](_0xf492('0x5'))[_0xf492('0x6')](''):[];}},'auth':{'type':Sequelize[_0xf492('0x7')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0xf492('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xf492('0x2')]},'description':{'type':Sequelize[_0xf492('0x2')]}}; \ No newline at end of file +var _0x4951=['getDataValue','split','BOOLEAN','sequelize','STRING','join','options'];(function(_0x84601f,_0x41c1a4){var _0xebb50c=function(_0x36a1e6){while(--_0x36a1e6){_0x84601f['push'](_0x84601f['shift']());}};_0xebb50c(++_0x41c1a4);}(_0x4951,0x13e));var _0x1495=function(_0x26cca0,_0x425e64){_0x26cca0=_0x26cca0-0x0;var _0x5a792b=_0x4951[_0x26cca0];return _0x5a792b;};'use strict';var Sequelize=require(_0x1495('0x0'));module['exports']={'name':{'type':Sequelize[_0x1495('0x1')]},'prefix':{'type':Sequelize[_0x1495('0x1')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x1495('0x1')],'set':function(_0x3b1569){this['setDataValue']('options',_0x3b1569?_0x3b1569[_0x1495('0x2')](''):[]);},'get':function(){return this['getDataValue'](_0x1495('0x3'))?this[_0x1495('0x4')](_0x1495('0x3'))[_0x1495('0x5')](''):[];}},'auth':{'type':Sequelize[_0x1495('0x6')],'defaultValue':![]},'password':{'type':Sequelize[_0x1495('0x1')]},'record':{'type':Sequelize[_0x1495('0x6')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x1495('0x1')]},'description':{'type':Sequelize[_0x1495('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 204c24b..a44dc9a 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 _0x8e63=['update','then','destroy','get','ChanSpies','UserProfileResource','end','error','name','send','index','map','VoiceChanSpy','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save'];(function(_0x4d6955,_0x38b1fb){var _0x19c939=function(_0x15daab){while(--_0x15daab){_0x4d6955['push'](_0x4d6955['shift']());}};_0x19c939(++_0x38b1fb);}(_0x8e63,0x7c));var _0x38e6=function(_0x46c712,_0x445c71){_0x46c712=_0x46c712-0x0;var _0x5d877f=_0x8e63[_0x46c712];return _0x5d877f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x38e6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x38e6('0x1'));var moment=require(_0x38e6('0x2'));var BPromise=require(_0x38e6('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x38e6('0x4'));var sox=require(_0x38e6('0x5'));var csv=require(_0x38e6('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x38e6('0x7'));var _=require(_0x38e6('0x8'));var squel=require(_0x38e6('0x9'));var crypto=require(_0x38e6('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x38e6('0x6'));var querystring=require(_0x38e6('0xb'));var Papa=require(_0x38e6('0xc'));var Redis=require(_0x38e6('0xd'));var authService=require(_0x38e6('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x38e6('0xf'));var logger=require('../../config/logger')(_0x38e6('0x10'));var utils=require('../../config/utils');var config=require(_0x38e6('0x11'));var licenseUtil=require(_0x38e6('0x12'));var db=require(_0x38e6('0x13'))['db'];function respondWithStatusCode(_0x14d2cf,_0x2e2585){_0x2e2585=_0x2e2585||0xcc;return function(_0x57c207){if(_0x57c207){return _0x14d2cf[_0x38e6('0x14')](_0x2e2585);}return _0x14d2cf[_0x38e6('0x15')](_0x2e2585)['end']();};}function respondWithResult(_0x1fcdeb,_0xfd7f2){_0xfd7f2=_0xfd7f2||0xc8;return function(_0x229f18){if(_0x229f18){return _0x1fcdeb[_0x38e6('0x15')](_0xfd7f2)[_0x38e6('0x16')](_0x229f18);}};}function respondWithFilteredResult(_0x46b525,_0x55208f){return function(_0x279688){if(_0x279688){var _0x36a263=typeof _0x55208f[_0x38e6('0x17')]===_0x38e6('0x18')&&typeof _0x55208f[_0x38e6('0x19')]==='undefined';var _0x91997a=_0x279688['count'];var _0x800418=_0x36a263?0x0:_0x55208f[_0x38e6('0x17')];var _0x57ded4=_0x36a263?_0x279688[_0x38e6('0x1a')]:_0x55208f['offset']+_0x55208f[_0x38e6('0x19')];var _0x521453;if(_0x57ded4>=_0x91997a){_0x57ded4=_0x91997a;_0x521453=0xc8;}else{_0x521453=0xce;}_0x46b525[_0x38e6('0x15')](_0x521453);return _0x46b525[_0x38e6('0x1b')](_0x38e6('0x1c'),_0x800418+'-'+_0x57ded4+'/'+_0x91997a)[_0x38e6('0x16')](_0x279688);}return null;};}function patchUpdates(_0x3f1d54){return function(_0x41bb24){try{jsonpatch['apply'](_0x41bb24,_0x3f1d54,!![]);}catch(_0x5f3f67){return BPromise['reject'](_0x5f3f67);}return _0x41bb24[_0x38e6('0x1d')]();};}function saveUpdates(_0x58dc63,_0x4a82f6){return function(_0x2d995f){if(_0x2d995f){return _0x2d995f[_0x38e6('0x1e')](_0x58dc63)[_0x38e6('0x1f')](function(_0x2a8a11){return _0x2a8a11;});}return null;};}function removeEntity(_0x5f5ab2,_0x140fc3){return function(_0x4530a7){if(_0x4530a7){return _0x4530a7[_0x38e6('0x20')]()['then'](function(){var _0x832025=_0x4530a7[_0x38e6('0x21')]({'plain':!![]});var _0x24e3d6=_0x38e6('0x22');return db[_0x38e6('0x23')][_0x38e6('0x20')]({'where':{'type':_0x24e3d6,'resourceId':_0x832025['id']}})[_0x38e6('0x1f')](function(){return _0x4530a7;});})[_0x38e6('0x1f')](function(){_0x5f5ab2['status'](0xcc)[_0x38e6('0x24')]();});}};}function handleEntityNotFound(_0x491588,_0x23902b){return function(_0x4d2b24){if(!_0x4d2b24){_0x491588[_0x38e6('0x14')](0x194);}return _0x4d2b24;};}function handleError(_0x16ed33,_0x43f05f){_0x43f05f=_0x43f05f||0x1f4;return function(_0x1afc04){logger[_0x38e6('0x25')](_0x1afc04['stack']);if(_0x1afc04[_0x38e6('0x26')]){delete _0x1afc04[_0x38e6('0x26')];}_0x16ed33[_0x38e6('0x15')](_0x43f05f)[_0x38e6('0x27')](_0x1afc04);};}exports[_0x38e6('0x28')]=function(_0x526569,_0x468310){var _0x192893={},_0x39eafd={},_0x3ce1c2={'count':0x0,'rows':[]};var _0xe7489=_[_0x38e6('0x29')](db[_0x38e6('0x2a')]['rawAttributes'],function(_0x220c19){return{'name':_0x220c19[_0x38e6('0x2b')],'type':_0x220c19[_0x38e6('0x2c')][_0x38e6('0x2d')]};});_0x39eafd[_0x38e6('0x2e')]=_[_0x38e6('0x29')](_0xe7489,_0x38e6('0x26'));_0x39eafd['query']=_[_0x38e6('0x2f')](_0x526569[_0x38e6('0x30')]);_0x39eafd[_0x38e6('0x31')]=_[_0x38e6('0x32')](_0x39eafd[_0x38e6('0x2e')],_0x39eafd[_0x38e6('0x30')]);_0x192893[_0x38e6('0x33')]=_['intersection'](_0x39eafd[_0x38e6('0x2e')],qs[_0x38e6('0x34')](_0x526569[_0x38e6('0x30')][_0x38e6('0x34')]));_0x192893['attributes']=_0x192893[_0x38e6('0x33')][_0x38e6('0x35')]?_0x192893['attributes']:_0x39eafd[_0x38e6('0x2e')];if(!_0x526569[_0x38e6('0x30')][_0x38e6('0x36')](_0x38e6('0x37'))){_0x192893['limit']=qs[_0x38e6('0x19')](_0x526569[_0x38e6('0x30')][_0x38e6('0x19')]);_0x192893[_0x38e6('0x17')]=qs['offset'](_0x526569[_0x38e6('0x30')][_0x38e6('0x17')]);}_0x192893[_0x38e6('0x38')]=qs[_0x38e6('0x39')](_0x526569[_0x38e6('0x30')][_0x38e6('0x39')]);_0x192893[_0x38e6('0x3a')]=qs['filters'](_[_0x38e6('0x3b')](_0x526569[_0x38e6('0x30')],_0x39eafd['filters']),_0xe7489);if(_0x526569['query'][_0x38e6('0x3c')]){_0x192893[_0x38e6('0x3a')]=_[_0x38e6('0x3d')](_0x192893[_0x38e6('0x3a')],{'$or':_[_0x38e6('0x29')](_0xe7489,function(_0x2cb64c){if(_0x2cb64c[_0x38e6('0x2c')]!==_0x38e6('0x3e')){var _0x200c9e={};_0x200c9e[_0x2cb64c[_0x38e6('0x26')]]={'$like':'%'+_0x526569['query'][_0x38e6('0x3c')]+'%'};return _0x200c9e;}})});}_0x192893=_[_0x38e6('0x3d')]({},_0x192893,_0x526569[_0x38e6('0x3f')]);var _0xb486bb={'where':_0x192893[_0x38e6('0x3a')]};return db['VoiceChanSpy'][_0x38e6('0x1a')](_0xb486bb)['then'](function(_0x7a8077){_0x3ce1c2[_0x38e6('0x1a')]=_0x7a8077;if(_0x526569[_0x38e6('0x30')][_0x38e6('0x40')]){_0x192893[_0x38e6('0x41')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0x38e6('0x42')](_0x192893);})[_0x38e6('0x1f')](function(_0x5f4ae3){_0x3ce1c2[_0x38e6('0x43')]=_0x5f4ae3;return _0x3ce1c2;})[_0x38e6('0x1f')](respondWithFilteredResult(_0x468310,_0x192893))[_0x38e6('0x44')](handleError(_0x468310,null));};exports['show']=function(_0x1904b5,_0x295e5c){var _0x49a021={'raw':![],'where':{'id':_0x1904b5[_0x38e6('0x45')]['id']}},_0x454d58={};_0x454d58[_0x38e6('0x2e')]=_[_0x38e6('0x2f')](db[_0x38e6('0x2a')]['rawAttributes']);_0x454d58[_0x38e6('0x30')]=_['keys'](_0x1904b5[_0x38e6('0x30')]);_0x454d58[_0x38e6('0x31')]=_['intersection'](_0x454d58[_0x38e6('0x2e')],_0x454d58[_0x38e6('0x30')]);_0x49a021['attributes']=_[_0x38e6('0x32')](_0x454d58[_0x38e6('0x2e')],qs[_0x38e6('0x34')](_0x1904b5['query'][_0x38e6('0x34')]));_0x49a021[_0x38e6('0x33')]=_0x49a021[_0x38e6('0x33')]['length']?_0x49a021['attributes']:_0x454d58[_0x38e6('0x2e')];if(_0x1904b5[_0x38e6('0x30')]['includeAll']){_0x49a021[_0x38e6('0x41')]=[{'all':!![]}];}_0x49a021=_[_0x38e6('0x3d')]({},_0x49a021,_0x1904b5[_0x38e6('0x3f')]);return db[_0x38e6('0x2a')][_0x38e6('0x46')](_0x49a021)[_0x38e6('0x1f')](handleEntityNotFound(_0x295e5c,null))[_0x38e6('0x1f')](respondWithResult(_0x295e5c,null))['catch'](handleError(_0x295e5c,null));};exports['create']=function(_0x447808,_0x5d1e7b){return db[_0x38e6('0x2a')][_0x38e6('0x47')](_0x447808['body'],{})['then'](function(_0x3ffa84){var _0x358baa=_0x447808['user'][_0x38e6('0x21')]({'plain':!![]});if(!_0x358baa)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x358baa['role']===_0x38e6('0x48')){var _0x432179=_0x3ffa84[_0x38e6('0x21')]({'plain':!![]});var _0x1b6291=_0x38e6('0x22');return db['UserProfileSection'][_0x38e6('0x46')]({'where':{'name':_0x1b6291,'userProfileId':_0x358baa[_0x38e6('0x49')]},'raw':!![]})[_0x38e6('0x1f')](function(_0x957a2a){if(_0x957a2a&&_0x957a2a[_0x38e6('0x4a')]===0x0){return db[_0x38e6('0x23')][_0x38e6('0x47')]({'name':_0x432179['name'],'resourceId':_0x432179['id'],'type':_0x957a2a['name'],'sectionId':_0x957a2a['id']},{})['then'](function(){return _0x3ffa84;});}else{return _0x3ffa84;}})[_0x38e6('0x44')](function(_0x3cdcbd){logger['error'](_0x38e6('0x4b'),_0x3cdcbd);throw _0x3cdcbd;});}return _0x3ffa84;})[_0x38e6('0x1f')](respondWithResult(_0x5d1e7b,0xc9))[_0x38e6('0x44')](handleError(_0x5d1e7b,null));};exports[_0x38e6('0x1e')]=function(_0x38590e,_0x34ab19){if(_0x38590e[_0x38e6('0x4c')]['id']){delete _0x38590e[_0x38e6('0x4c')]['id'];}return db[_0x38e6('0x2a')][_0x38e6('0x46')]({'where':{'id':_0x38590e['params']['id']}})[_0x38e6('0x1f')](handleEntityNotFound(_0x34ab19,null))[_0x38e6('0x1f')](saveUpdates(_0x38590e[_0x38e6('0x4c')],null))[_0x38e6('0x1f')](respondWithResult(_0x34ab19,null))[_0x38e6('0x44')](handleError(_0x34ab19,null));};exports[_0x38e6('0x20')]=function(_0x1175e0,_0x503418){return db[_0x38e6('0x2a')][_0x38e6('0x46')]({'where':{'id':_0x1175e0[_0x38e6('0x45')]['id']}})[_0x38e6('0x1f')](handleEntityNotFound(_0x503418,null))['then'](removeEntity(_0x503418,null))['catch'](handleError(_0x503418,null));}; \ No newline at end of file +var _0x8369=['hasOwnProperty','offset','order','sort','where','pick','filter','merge','options','include','rows','catch','show','params','keys','rawAttributes','includeAll','find','create','user','role','userProfileId','autoAssociation','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','get','ChanSpies','UserProfileResource','error','stack','name','index','map','VoiceChanSpy','fieldName','type','key','model','query','filters','intersection','fields','length','attributes'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x8369,0x10b));var _0x9836=function(_0x283086,_0x49b948){_0x283086=_0x283086-0x0;var _0x23b443=_0x8369[_0x283086];return _0x23b443;};'use strict';var emlformat=require(_0x9836('0x0'));var rimraf=require(_0x9836('0x1'));var zipdir=require(_0x9836('0x2'));var jsonpatch=require(_0x9836('0x3'));var rp=require(_0x9836('0x4'));var moment=require(_0x9836('0x5'));var BPromise=require(_0x9836('0x6'));var Mustache=require('mustache');var util=require(_0x9836('0x7'));var path=require('path');var sox=require(_0x9836('0x8'));var csv=require(_0x9836('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9836('0xa'));var _=require(_0x9836('0xb'));var squel=require('squel');var crypto=require(_0x9836('0xc'));var jsforce=require(_0x9836('0xd'));var deskjs=require(_0x9836('0xe'));var toCsv=require(_0x9836('0x9'));var querystring=require('querystring');var Papa=require(_0x9836('0xf'));var Redis=require(_0x9836('0x10'));var authService=require(_0x9836('0x11'));var qs=require(_0x9836('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9836('0x13'));var logger=require(_0x9836('0x14'))(_0x9836('0x15'));var utils=require(_0x9836('0x16'));var config=require(_0x9836('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x9836('0x18'))['db'];function respondWithStatusCode(_0x357e64,_0x1c4c59){_0x1c4c59=_0x1c4c59||0xcc;return function(_0x173f75){if(_0x173f75){return _0x357e64[_0x9836('0x19')](_0x1c4c59);}return _0x357e64[_0x9836('0x1a')](_0x1c4c59)[_0x9836('0x1b')]();};}function respondWithResult(_0x32e6c2,_0x5abb37){_0x5abb37=_0x5abb37||0xc8;return function(_0xc90217){if(_0xc90217){return _0x32e6c2[_0x9836('0x1a')](_0x5abb37)[_0x9836('0x1c')](_0xc90217);}};}function respondWithFilteredResult(_0x47d820,_0x978742){return function(_0x53bda0){if(_0x53bda0){var _0xa0b1f8=typeof _0x978742['offset']===_0x9836('0x1d')&&typeof _0x978742[_0x9836('0x1e')]===_0x9836('0x1d');var _0xd1664b=_0x53bda0[_0x9836('0x1f')];var _0x2afe17=_0xa0b1f8?0x0:_0x978742['offset'];var _0x1b01b9=_0xa0b1f8?_0x53bda0[_0x9836('0x1f')]:_0x978742['offset']+_0x978742[_0x9836('0x1e')];var _0x351347;if(_0x1b01b9>=_0xd1664b){_0x1b01b9=_0xd1664b;_0x351347=0xc8;}else{_0x351347=0xce;}_0x47d820[_0x9836('0x1a')](_0x351347);return _0x47d820['set'](_0x9836('0x20'),_0x2afe17+'-'+_0x1b01b9+'/'+_0xd1664b)['json'](_0x53bda0);}return null;};}function patchUpdates(_0x472ab4){return function(_0x21288c){try{jsonpatch[_0x9836('0x21')](_0x21288c,_0x472ab4,!![]);}catch(_0x454a4d){return BPromise[_0x9836('0x22')](_0x454a4d);}return _0x21288c['save']();};}function saveUpdates(_0x552f3c,_0x4e51b9){return function(_0x359808){if(_0x359808){return _0x359808[_0x9836('0x23')](_0x552f3c)[_0x9836('0x24')](function(_0x5eb775){return _0x5eb775;});}return null;};}function removeEntity(_0xdba485,_0x20c4d3){return function(_0x110044){if(_0x110044){return _0x110044[_0x9836('0x25')]()['then'](function(){var _0x242b10=_0x110044[_0x9836('0x26')]({'plain':!![]});var _0x3d9599=_0x9836('0x27');return db[_0x9836('0x28')]['destroy']({'where':{'type':_0x3d9599,'resourceId':_0x242b10['id']}})[_0x9836('0x24')](function(){return _0x110044;});})[_0x9836('0x24')](function(){_0xdba485['status'](0xcc)[_0x9836('0x1b')]();});}};}function handleEntityNotFound(_0x517237,_0xedb9b7){return function(_0x535e8c){if(!_0x535e8c){_0x517237['sendStatus'](0x194);}return _0x535e8c;};}function handleError(_0x4f2106,_0x1ed136){_0x1ed136=_0x1ed136||0x1f4;return function(_0x1c061f){logger[_0x9836('0x29')](_0x1c061f[_0x9836('0x2a')]);if(_0x1c061f[_0x9836('0x2b')]){delete _0x1c061f[_0x9836('0x2b')];}_0x4f2106[_0x9836('0x1a')](_0x1ed136)['send'](_0x1c061f);};}exports[_0x9836('0x2c')]=function(_0x4468ea,_0x358ad5){var _0x25ea0d={},_0x2372c1={},_0x1f7790={'count':0x0,'rows':[]};var _0x46e8da=_[_0x9836('0x2d')](db[_0x9836('0x2e')]['rawAttributes'],function(_0x42a3b4){return{'name':_0x42a3b4[_0x9836('0x2f')],'type':_0x42a3b4[_0x9836('0x30')][_0x9836('0x31')]};});_0x2372c1[_0x9836('0x32')]=_[_0x9836('0x2d')](_0x46e8da,_0x9836('0x2b'));_0x2372c1[_0x9836('0x33')]=_['keys'](_0x4468ea['query']);_0x2372c1[_0x9836('0x34')]=_[_0x9836('0x35')](_0x2372c1[_0x9836('0x32')],_0x2372c1['query']);_0x25ea0d['attributes']=_['intersection'](_0x2372c1[_0x9836('0x32')],qs['fields'](_0x4468ea[_0x9836('0x33')][_0x9836('0x36')]));_0x25ea0d['attributes']=_0x25ea0d['attributes'][_0x9836('0x37')]?_0x25ea0d[_0x9836('0x38')]:_0x2372c1[_0x9836('0x32')];if(!_0x4468ea[_0x9836('0x33')][_0x9836('0x39')]('nolimit')){_0x25ea0d['limit']=qs[_0x9836('0x1e')](_0x4468ea[_0x9836('0x33')][_0x9836('0x1e')]);_0x25ea0d[_0x9836('0x3a')]=qs[_0x9836('0x3a')](_0x4468ea[_0x9836('0x33')]['offset']);}_0x25ea0d[_0x9836('0x3b')]=qs['sort'](_0x4468ea[_0x9836('0x33')][_0x9836('0x3c')]);_0x25ea0d[_0x9836('0x3d')]=qs[_0x9836('0x34')](_[_0x9836('0x3e')](_0x4468ea[_0x9836('0x33')],_0x2372c1[_0x9836('0x34')]),_0x46e8da);if(_0x4468ea['query'][_0x9836('0x3f')]){_0x25ea0d[_0x9836('0x3d')]=_[_0x9836('0x40')](_0x25ea0d['where'],{'$or':_['map'](_0x46e8da,function(_0x5260a8){if(_0x5260a8[_0x9836('0x30')]!=='VIRTUAL'){var _0x4841f9={};_0x4841f9[_0x5260a8[_0x9836('0x2b')]]={'$like':'%'+_0x4468ea[_0x9836('0x33')][_0x9836('0x3f')]+'%'};return _0x4841f9;}})});}_0x25ea0d=_[_0x9836('0x40')]({},_0x25ea0d,_0x4468ea[_0x9836('0x41')]);var _0x3b8943={'where':_0x25ea0d[_0x9836('0x3d')]};return db['VoiceChanSpy'][_0x9836('0x1f')](_0x3b8943)[_0x9836('0x24')](function(_0x16ab99){_0x1f7790[_0x9836('0x1f')]=_0x16ab99;if(_0x4468ea[_0x9836('0x33')]['includeAll']){_0x25ea0d[_0x9836('0x42')]=[{'all':!![]}];}return db['VoiceChanSpy']['findAll'](_0x25ea0d);})['then'](function(_0x829dff){_0x1f7790[_0x9836('0x43')]=_0x829dff;return _0x1f7790;})[_0x9836('0x24')](respondWithFilteredResult(_0x358ad5,_0x25ea0d))[_0x9836('0x44')](handleError(_0x358ad5,null));};exports[_0x9836('0x45')]=function(_0x8d4948,_0x48e0ec){var _0x2fee71={'raw':![],'where':{'id':_0x8d4948[_0x9836('0x46')]['id']}},_0x5ea80a={};_0x5ea80a[_0x9836('0x32')]=_[_0x9836('0x47')](db[_0x9836('0x2e')][_0x9836('0x48')]);_0x5ea80a[_0x9836('0x33')]=_[_0x9836('0x47')](_0x8d4948['query']);_0x5ea80a['filters']=_[_0x9836('0x35')](_0x5ea80a[_0x9836('0x32')],_0x5ea80a['query']);_0x2fee71[_0x9836('0x38')]=_[_0x9836('0x35')](_0x5ea80a[_0x9836('0x32')],qs[_0x9836('0x36')](_0x8d4948[_0x9836('0x33')][_0x9836('0x36')]));_0x2fee71['attributes']=_0x2fee71[_0x9836('0x38')]['length']?_0x2fee71[_0x9836('0x38')]:_0x5ea80a['model'];if(_0x8d4948['query'][_0x9836('0x49')]){_0x2fee71['include']=[{'all':!![]}];}_0x2fee71=_[_0x9836('0x40')]({},_0x2fee71,_0x8d4948[_0x9836('0x41')]);return db[_0x9836('0x2e')][_0x9836('0x4a')](_0x2fee71)[_0x9836('0x24')](handleEntityNotFound(_0x48e0ec,null))[_0x9836('0x24')](respondWithResult(_0x48e0ec,null))[_0x9836('0x44')](handleError(_0x48e0ec,null));};exports[_0x9836('0x4b')]=function(_0x9241f2,_0x380abb){return db[_0x9836('0x2e')][_0x9836('0x4b')](_0x9241f2['body'],{})[_0x9836('0x24')](function(_0x36034c){var _0x23d4ec=_0x9241f2[_0x9836('0x4c')][_0x9836('0x26')]({'plain':!![]});if(!_0x23d4ec)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23d4ec[_0x9836('0x4d')]==='user'){var _0x18eee3=_0x36034c[_0x9836('0x26')]({'plain':!![]});var _0x1a09f4=_0x9836('0x27');return db['UserProfileSection'][_0x9836('0x4a')]({'where':{'name':_0x1a09f4,'userProfileId':_0x23d4ec[_0x9836('0x4e')]},'raw':!![]})[_0x9836('0x24')](function(_0x62d6e8){if(_0x62d6e8&&_0x62d6e8[_0x9836('0x4f')]===0x0){return db['UserProfileResource'][_0x9836('0x4b')]({'name':_0x18eee3['name'],'resourceId':_0x18eee3['id'],'type':_0x62d6e8[_0x9836('0x2b')],'sectionId':_0x62d6e8['id']},{})[_0x9836('0x24')](function(){return _0x36034c;});}else{return _0x36034c;}})[_0x9836('0x44')](function(_0x140fbe){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x140fbe);throw _0x140fbe;});}return _0x36034c;})[_0x9836('0x24')](respondWithResult(_0x380abb,0xc9))[_0x9836('0x44')](handleError(_0x380abb,null));};exports[_0x9836('0x23')]=function(_0x59cb7e,_0x406a9f){if(_0x59cb7e[_0x9836('0x50')]['id']){delete _0x59cb7e[_0x9836('0x50')]['id'];}return db[_0x9836('0x2e')][_0x9836('0x4a')]({'where':{'id':_0x59cb7e[_0x9836('0x46')]['id']}})['then'](handleEntityNotFound(_0x406a9f,null))[_0x9836('0x24')](saveUpdates(_0x59cb7e[_0x9836('0x50')],null))[_0x9836('0x24')](respondWithResult(_0x406a9f,null))[_0x9836('0x44')](handleError(_0x406a9f,null));};exports[_0x9836('0x25')]=function(_0x1439ee,_0x5390dc){return db[_0x9836('0x2e')][_0x9836('0x4a')]({'where':{'id':_0x1439ee['params']['id']}})[_0x9836('0x24')](handleEntityNotFound(_0x5390dc,null))[_0x9836('0x24')](removeEntity(_0x5390dc,null))[_0x9836('0x44')](handleError(_0x5390dc,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index cd7b01f..6881f70 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 _0x865d=['format','%s%s','prefix','system','push','merge','Set','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','name','options','StopMixMonitor','length','concat','internal','findAll','agent','then','exports','define','VoiceChanSpy','voice_chanspy','VoiceExtension','catch','destroy','bulkCreate','lodash','util','./voiceChanSpy.attributes','from-sip'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x865d,0x1dd));var _0xd865=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x865d[_0x36884e];return _0x1cc367;};'use strict';var _=require(_0xd865('0x0'));var util=require(_0xd865('0x1'));var BPromise=require('bluebird');var attributes=require(_0xd865('0x2'));var getUserApplications=function(_0x463c94,_0x2df279,_0x4292a6){var _0x3fb117=0x1;var _0x127cb0=[];var _0x3c915e={'context':_0x2df279['context']||_0xd865('0x3'),'exten':util[_0xd865('0x4')](_0xd865('0x5'),_0x463c94[_0xd865('0x6')],_0x4292a6),'type':_0xd865('0x7'),'isApp':![],'ChanSpyId':_0x463c94['id'],'UserId':_0x2df279['id']};_0x127cb0[_0xd865('0x8')](_[_0xd865('0x9')]({'app':_0xd865('0xa'),'appdata':util['format']('CDR(type)=%s',_0xd865('0xb')),'priority':_0x3fb117++},_0x3c915e));if(_0x463c94[_0xd865('0xc')]){_0x127cb0[_0xd865('0x8')](_[_0xd865('0x9')]({'app':_0xd865('0xd'),'appdata':util[_0xd865('0x4')](_0xd865('0xe'),_0x463c94[_0xd865('0xf')]),'priority':_0x3fb117++},_0x3c915e));}if(_0x463c94[_0xd865('0x10')]){_0x127cb0['push'](_[_0xd865('0x9')]({'app':_0xd865('0x11'),'appdata':_0x463c94[_0xd865('0x12')],'priority':_0x3fb117++},_0x3c915e));}_0x127cb0[_0xd865('0x8')](_[_0xd865('0x9')]({'app':_0xd865('0x13'),'appdata':util[_0xd865('0x4')]('SIP/%s,%s',_0x2df279[_0xd865('0x14')],_0x463c94[_0xd865('0x15')]?_0x463c94[_0xd865('0x15')]['join'](''):''),'priority':_0x3fb117++},_0x3c915e));if(_0x463c94['record']){_0x127cb0[_0xd865('0x8')](_['merge']({'app':_0xd865('0x16'),'priority':_0x3fb117++},_0x3c915e));}return _0x127cb0;};var getChanSpyApplications=function(_0x2e8f81,_0x9ed903){var _0xf3f114=[];for(var _0x1d1f93=0x0,_0x1c2710=0x1;_0x1d1f93<_0x9ed903[_0xd865('0x17')];_0x1d1f93++,_0x1c2710=0x1){_0xf3f114=_0xf3f114[_0xd865('0x18')](getUserApplications(_0x2e8f81,_0x9ed903[_0x1d1f93],_0x9ed903[_0x1d1f93][_0xd865('0x19')]));if(_0x9ed903[_0x1d1f93][_0xd865('0x19')]!=_0x9ed903[_0x1d1f93][_0xd865('0x14')]){_0xf3f114=_0xf3f114[_0xd865('0x18')](getUserApplications(_0x2e8f81,_0x9ed903[_0x1d1f93],_0x9ed903[_0x1d1f93]['name']));}}return _0xf3f114;};var getChanSpyPromise=function(_0x3bee1b,_0x4f7781){return new BPromise(function(_0x13645e,_0x53973e){return _0x3bee1b['User'][_0xd865('0x1a')]({'attributes':['id',_0xd865('0x14'),'internal'],'where':{'role':_0xd865('0x1b'),'chanspy':!![]},'raw':!![]})[_0xd865('0x1c')](function(_0x537f59){if(_0x537f59){return _0x13645e(getChanSpyApplications(_0x4f7781,_0x537f59));}return _0x13645e([]);})['catch'](function(_0x26e19b){_0x53973e(_0x26e19b);});});};module[_0xd865('0x1d')]=function(_0x28de86,_0x1f165f){var _0xba7f71=_0x28de86['models'];return _0x28de86[_0xd865('0x1e')](_0xd865('0x1f'),attributes,{'tableName':_0xd865('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1c62cc,_0x1745f3,_0x27db2a){return getChanSpyPromise(_0xba7f71,_0x1c62cc)[_0xd865('0x1c')](function(_0xd2b687){if(_0xd2b687&&_0xd2b687[_0xd865('0x17')]){return _0xba7f71[_0xd865('0x21')]['bulkCreate'](_0xd2b687);}})[_0xd865('0x1c')](function(){_0x27db2a();})[_0xd865('0x22')](function(_0x4effbf){_0x27db2a(_0x4effbf);});},'afterUpdate':function(_0xa84fd,_0x41c7fc,_0x1ba81a){return _0xba7f71['VoiceExtension'][_0xd865('0x23')]({'where':{'ChanSpyId':_0xa84fd['id']}})[_0xd865('0x1c')](function(){return getChanSpyPromise(_0xba7f71,_0xa84fd);})[_0xd865('0x1c')](function(_0xc3e224){if(_0xc3e224&&_0xc3e224['length']){return _0xba7f71[_0xd865('0x21')][_0xd865('0x24')](_0xc3e224);}})[_0xd865('0x1c')](function(){_0x1ba81a();})[_0xd865('0x22')](function(_0x313752){_0x1ba81a(_0x313752);});},'afterDestroy':function(_0x103149,_0x54006d,_0xa2930f){return _0xba7f71['VoiceExtension'][_0xd865('0x23')]({'where':{'ChanSpyId':_0x103149['id']}})[_0xd865('0x1c')](function(){_0xa2930f();})[_0xd865('0x22')](function(_0x128be8){_0xa2930f(_0x128be8);});}}});}; \ No newline at end of file +var _0xd46f=['context','from-sip','format','prefix','system','push','merge','Set','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','options','join','concat','internal','name','agent','then','catch','models','define','VoiceChanSpy','bulkCreate','VoiceExtension','destroy','length','lodash','bluebird'];(function(_0x3c053f,_0x300b2f){var _0x54c8f5=function(_0x5ee6b8){while(--_0x5ee6b8){_0x3c053f['push'](_0x3c053f['shift']());}};_0x54c8f5(++_0x300b2f);}(_0xd46f,0x184));var _0xfd46=function(_0x56b2a5,_0x323185){_0x56b2a5=_0x56b2a5-0x0;var _0x29b273=_0xd46f[_0x56b2a5];return _0x29b273;};'use strict';var _=require(_0xfd46('0x0'));var util=require('util');var BPromise=require(_0xfd46('0x1'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x1a5e0f,_0x100430,_0x37ab8a){var _0xfa0ac1=0x1;var _0x2f1404=[];var _0x37519e={'context':_0x100430[_0xfd46('0x2')]||_0xfd46('0x3'),'exten':util[_0xfd46('0x4')]('%s%s',_0x1a5e0f[_0xfd46('0x5')],_0x37ab8a),'type':_0xfd46('0x6'),'isApp':![],'ChanSpyId':_0x1a5e0f['id'],'UserId':_0x100430['id']};_0x2f1404[_0xfd46('0x7')](_[_0xfd46('0x8')]({'app':_0xfd46('0x9'),'appdata':util[_0xfd46('0x4')]('CDR(type)=%s',_0xfd46('0xa')),'priority':_0xfa0ac1++},_0x37519e));if(_0x1a5e0f[_0xfd46('0xb')]){_0x2f1404[_0xfd46('0x7')](_['merge']({'app':_0xfd46('0xc'),'appdata':util[_0xfd46('0x4')](_0xfd46('0xd'),_0x1a5e0f[_0xfd46('0xe')]),'priority':_0xfa0ac1++},_0x37519e));}if(_0x1a5e0f['auth']){_0x2f1404[_0xfd46('0x7')](_[_0xfd46('0x8')]({'app':'Authenticate','appdata':_0x1a5e0f['password'],'priority':_0xfa0ac1++},_0x37519e));}_0x2f1404[_0xfd46('0x7')](_[_0xfd46('0x8')]({'app':'ChanSpy','appdata':util[_0xfd46('0x4')]('SIP/%s,%s',_0x100430['name'],_0x1a5e0f[_0xfd46('0xf')]?_0x1a5e0f['options'][_0xfd46('0x10')](''):''),'priority':_0xfa0ac1++},_0x37519e));if(_0x1a5e0f['record']){_0x2f1404['push'](_[_0xfd46('0x8')]({'app':'StopMixMonitor','priority':_0xfa0ac1++},_0x37519e));}return _0x2f1404;};var getChanSpyApplications=function(_0x5e2e4d,_0x4dfcb6){var _0x4e3982=[];for(var _0x24bdda=0x0,_0x46af52=0x1;_0x24bdda<_0x4dfcb6['length'];_0x24bdda++,_0x46af52=0x1){_0x4e3982=_0x4e3982[_0xfd46('0x11')](getUserApplications(_0x5e2e4d,_0x4dfcb6[_0x24bdda],_0x4dfcb6[_0x24bdda]['internal']));if(_0x4dfcb6[_0x24bdda][_0xfd46('0x12')]!=_0x4dfcb6[_0x24bdda][_0xfd46('0x13')]){_0x4e3982=_0x4e3982[_0xfd46('0x11')](getUserApplications(_0x5e2e4d,_0x4dfcb6[_0x24bdda],_0x4dfcb6[_0x24bdda]['name']));}}return _0x4e3982;};var getChanSpyPromise=function(_0x1ddccb,_0xec191){return new BPromise(function(_0x3aace3,_0x5cfa86){return _0x1ddccb['User']['findAll']({'attributes':['id',_0xfd46('0x13'),_0xfd46('0x12')],'where':{'role':_0xfd46('0x14'),'chanspy':!![]},'raw':!![]})[_0xfd46('0x15')](function(_0x5e6821){if(_0x5e6821){return _0x3aace3(getChanSpyApplications(_0xec191,_0x5e6821));}return _0x3aace3([]);})[_0xfd46('0x16')](function(_0x13ab7a){_0x5cfa86(_0x13ab7a);});});};module['exports']=function(_0xee8d58,_0x4acc03){var _0x468797=_0xee8d58[_0xfd46('0x17')];return _0xee8d58[_0xfd46('0x18')](_0xfd46('0x19'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x36f897,_0x42c5fe,_0x291efb){return getChanSpyPromise(_0x468797,_0x36f897)['then'](function(_0x1fbbd2){if(_0x1fbbd2&&_0x1fbbd2['length']){return _0x468797['VoiceExtension'][_0xfd46('0x1a')](_0x1fbbd2);}})[_0xfd46('0x15')](function(){_0x291efb();})['catch'](function(_0x79d1dd){_0x291efb(_0x79d1dd);});},'afterUpdate':function(_0x15ff53,_0x4a96fe,_0x1890c6){return _0x468797[_0xfd46('0x1b')][_0xfd46('0x1c')]({'where':{'ChanSpyId':_0x15ff53['id']}})[_0xfd46('0x15')](function(){return getChanSpyPromise(_0x468797,_0x15ff53);})[_0xfd46('0x15')](function(_0x4c4e1f){if(_0x4c4e1f&&_0x4c4e1f[_0xfd46('0x1d')]){return _0x468797[_0xfd46('0x1b')][_0xfd46('0x1a')](_0x4c4e1f);}})[_0xfd46('0x15')](function(){_0x1890c6();})[_0xfd46('0x16')](function(_0x95dc3d){_0x1890c6(_0x95dc3d);});},'afterDestroy':function(_0x218d04,_0x338519,_0x158cb8){return _0x468797['VoiceExtension'][_0xfd46('0x1c')]({'where':{'ChanSpyId':_0x218d04['id']}})[_0xfd46('0x15')](function(){_0x158cb8();})['catch'](function(_0x12db9f){_0x158cb8(_0x12db9f);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 2ad9f2d..b64ea9e 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 _0x49e9=['stringify','error','code','VoiceChanSpy,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s'];(function(_0x3a8a16,_0xe5423f){var _0x597621=function(_0x3bdef5){while(--_0x3bdef5){_0x3a8a16['push'](_0x3a8a16['shift']());}};_0x597621(++_0xe5423f);}(_0x49e9,0x10f));var _0x949e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x49e9[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x949e('0x0'));var util=require(_0x949e('0x1'));var moment=require('moment');var BPromise=require(_0x949e('0x2'));var rs=require(_0x949e('0x3'));var fs=require('fs');var Redis=require(_0x949e('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x949e('0x5'))('rpc');var config=require(_0x949e('0x6'));var jayson=require(_0x949e('0x7'));var client=jayson[_0x949e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17f649,_0x16c669,_0xfc4f8a){return new BPromise(function(_0x34ee57,_0x40d442){return client[_0x949e('0x9')](_0x17f649,_0xfc4f8a)[_0x949e('0xa')](function(_0x56e31d){logger[_0x949e('0xb')]('VoiceChanSpy,\x20%s,\x20%s',_0x16c669,_0x949e('0xc'));logger[_0x949e('0xd')](_0x949e('0xe'),_0x16c669,'request\x20sent',JSON[_0x949e('0xf')](_0x56e31d));if(_0x56e31d[_0x949e('0x10')]){if(_0x56e31d[_0x949e('0x10')][_0x949e('0x11')]===0x1f4){logger[_0x949e('0x10')](_0x949e('0x12'),_0x16c669,_0x56e31d[_0x949e('0x10')][_0x949e('0x13')]);return _0x40d442(_0x56e31d[_0x949e('0x10')][_0x949e('0x13')]);}logger[_0x949e('0x10')](_0x949e('0x12'),_0x16c669,_0x56e31d[_0x949e('0x10')][_0x949e('0x13')]);return _0x34ee57(_0x56e31d[_0x949e('0x10')]['message']);}else{logger[_0x949e('0xb')](_0x949e('0x12'),_0x16c669,_0x949e('0xc'));_0x34ee57(_0x56e31d[_0x949e('0x14')]['message']);}})[_0x949e('0x15')](function(_0x441b80){logger['error'](_0x949e('0x12'),_0x16c669,_0x441b80);_0x40d442(_0x441b80);});});} \ No newline at end of file +var _0xd3d1=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb'];(function(_0x45f6cf,_0x1cdbbc){var _0x2100a5=function(_0x3f2d16){while(--_0x3f2d16){_0x45f6cf['push'](_0x45f6cf['shift']());}};_0x2100a5(++_0x1cdbbc);}(_0xd3d1,0x172));var _0x1d3d=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xd3d1[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require(_0x1d3d('0x0'));var util=require(_0x1d3d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1d3d('0x2'));var fs=require('fs');var Redis=require(_0x1d3d('0x3'));var db=require(_0x1d3d('0x4'))['db'];var utils=require(_0x1d3d('0x5'));var logger=require(_0x1d3d('0x6'))(_0x1d3d('0x7'));var config=require(_0x1d3d('0x8'));var jayson=require(_0x1d3d('0x9'));var client=jayson[_0x1d3d('0xa')][_0x1d3d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3831ce,_0xb1b3c6,_0xe10bca){return new BPromise(function(_0x2c377c,_0xbea61e){return client[_0x1d3d('0xc')](_0x3831ce,_0xe10bca)[_0x1d3d('0xd')](function(_0x510a37){logger[_0x1d3d('0xe')](_0x1d3d('0xf'),_0xb1b3c6,_0x1d3d('0x10'));logger[_0x1d3d('0x11')](_0x1d3d('0x12'),_0xb1b3c6,_0x1d3d('0x10'),JSON[_0x1d3d('0x13')](_0x510a37));if(_0x510a37[_0x1d3d('0x14')]){if(_0x510a37[_0x1d3d('0x14')][_0x1d3d('0x15')]===0x1f4){logger[_0x1d3d('0x14')]('VoiceChanSpy,\x20%s,\x20%s',_0xb1b3c6,_0x510a37[_0x1d3d('0x14')][_0x1d3d('0x16')]);return _0xbea61e(_0x510a37['error']['message']);}logger[_0x1d3d('0x14')](_0x1d3d('0xf'),_0xb1b3c6,_0x510a37[_0x1d3d('0x14')]['message']);return _0x2c377c(_0x510a37[_0x1d3d('0x14')]['message']);}else{logger[_0x1d3d('0xe')](_0x1d3d('0xf'),_0xb1b3c6,_0x1d3d('0x10'));_0x2c377c(_0x510a37[_0x1d3d('0x17')][_0x1d3d('0x16')]);}})[_0x1d3d('0x18')](function(_0x3dcb67){logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0xb1b3c6,_0x3dcb67);_0xbea61e(_0x3dcb67);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index f25bd81..3ee5a08 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 _0x8564=['destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./voiceContext.controller','get','isAuthenticated','index','/:id','post','create','put','update'];(function(_0x3799bf,_0x937a88){var _0x633b0a=function(_0x192fc7){while(--_0x192fc7){_0x3799bf['push'](_0x3799bf['shift']());}};_0x633b0a(++_0x937a88);}(_0x8564,0x111));var _0x4856=function(_0x2832e1,_0xb10362){_0x2832e1=_0x2832e1-0x0;var _0x50028b=_0x8564[_0x2832e1];return _0x50028b;};'use strict';var multer=require(_0x4856('0x0'));var util=require(_0x4856('0x1'));var path=require(_0x4856('0x2'));var timeout=require(_0x4856('0x3'));var express=require('express');var router=express[_0x4856('0x4')]();var fs_extra=require(_0x4856('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4856('0x6'));var config=require('../../config/environment');var controller=require(_0x4856('0x7'));router[_0x4856('0x8')]('/',auth[_0x4856('0x9')](),controller[_0x4856('0xa')]);router['get'](_0x4856('0xb'),auth[_0x4856('0x9')](),controller['show']);router[_0x4856('0xc')]('/',auth[_0x4856('0x9')](),controller[_0x4856('0xd')]);router[_0x4856('0xe')](_0x4856('0xb'),auth[_0x4856('0x9')](),controller[_0x4856('0xf')]);router['delete'](_0x4856('0xb'),auth[_0x4856('0x9')](),controller[_0x4856('0x10')]);module['exports']=router; \ No newline at end of file +var _0x3139=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','post','create','update','delete','destroy','exports','util'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x3139,0xa4));var _0x9313=function(_0x4e6fa3,_0x40529c){_0x4e6fa3=_0x4e6fa3-0x0;var _0x37f902=_0x3139[_0x4e6fa3];return _0x37f902;};'use strict';var multer=require('multer');var util=require(_0x9313('0x0'));var path=require('path');var timeout=require(_0x9313('0x1'));var express=require('express');var router=express[_0x9313('0x2')]();var fs_extra=require(_0x9313('0x3'));var auth=require(_0x9313('0x4'));var interaction=require(_0x9313('0x5'));var config=require('../../config/environment');var controller=require('./voiceContext.controller');router[_0x9313('0x6')]('/',auth[_0x9313('0x7')](),controller['index']);router[_0x9313('0x6')](_0x9313('0x8'),auth[_0x9313('0x7')](),controller['show']);router[_0x9313('0x9')]('/',auth[_0x9313('0x7')](),controller[_0x9313('0xa')]);router['put'](_0x9313('0x8'),auth[_0x9313('0x7')](),controller[_0x9313('0xb')]);router[_0x9313('0xc')](_0x9313('0x8'),auth[_0x9313('0x7')](),controller[_0x9313('0xd')]);module[_0x9313('0xe')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index dc1b9b0..fddc376 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 _0xee37=['exports','STRING','BOOLEAN'];(function(_0xc298ad,_0xea4dc2){var _0x11b2e6=function(_0xe2314f){while(--_0xe2314f){_0xc298ad['push'](_0xc298ad['shift']());}};_0x11b2e6(++_0xea4dc2);}(_0xee37,0xf9));var _0x7ee3=function(_0x202d24,_0x5e8641){_0x202d24=_0x202d24-0x0;var _0x2b3a8e=_0xee37[_0x202d24];return _0x2b3a8e;};'use strict';var Sequelize=require('sequelize');module[_0x7ee3('0x0')]={'name':{'type':Sequelize[_0x7ee3('0x1')],'unique':'name'},'description':{'type':Sequelize[_0x7ee3('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x7ee3('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa98d=['STRING','name','BOOLEAN','sequelize','exports'];(function(_0x1fb597,_0x30c68f){var _0x487868=function(_0x5e52b1){while(--_0x5e52b1){_0x1fb597['push'](_0x1fb597['shift']());}};_0x487868(++_0x30c68f);}(_0xa98d,0x19d));var _0xda98=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa98d[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xda98('0x0'));module[_0xda98('0x1')]={'name':{'type':Sequelize[_0xda98('0x2')],'unique':_0xda98('0x3')},'description':{'type':Sequelize[_0xda98('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xda98('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index b4efead..25f1b75 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 _0x0a16=['sendStatus','status','end','offset','count','limit','json','apply','reject','get','destroy','stack','name','send','map','VoiceContext','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','readFileSync','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','role','UserProfileSection','Contexts','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x246074,_0x9ac8e7){var _0x2f50b3=function(_0x44b171){while(--_0x44b171){_0x246074['push'](_0x246074['shift']());}};_0x2f50b3(++_0x9ac8e7);}(_0x0a16,0x10e));var _0x60a1=function(_0x566168,_0x4c39af){_0x566168=_0x566168-0x0;var _0x4e1f7a=_0x0a16[_0x566168];return _0x4e1f7a;};'use strict';var emlformat=require(_0x60a1('0x0'));var rimraf=require(_0x60a1('0x1'));var zipdir=require(_0x60a1('0x2'));var jsonpatch=require(_0x60a1('0x3'));var rp=require(_0x60a1('0x4'));var moment=require('moment');var BPromise=require(_0x60a1('0x5'));var Mustache=require(_0x60a1('0x6'));var util=require(_0x60a1('0x7'));var path=require(_0x60a1('0x8'));var sox=require(_0x60a1('0x9'));var csv=require(_0x60a1('0xa'));var ejs=require(_0x60a1('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x60a1('0xc'));var crypto=require(_0x60a1('0xd'));var jsforce=require(_0x60a1('0xe'));var deskjs=require(_0x60a1('0xf'));var toCsv=require(_0x60a1('0xa'));var querystring=require(_0x60a1('0x10'));var Papa=require('papaparse');var Redis=require(_0x60a1('0x11'));var authService=require(_0x60a1('0x12'));var qs=require(_0x60a1('0x13'));var as=require(_0x60a1('0x14'));var hardwareService=require(_0x60a1('0x15'));var logger=require(_0x60a1('0x16'))(_0x60a1('0x17'));var utils=require(_0x60a1('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x60a1('0x19'));var db=require(_0x60a1('0x1a'))['db'];var jayson=require(_0x60a1('0x1b'));var client=jayson[_0x60a1('0x1c')][_0x60a1('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x250b1a,_0x3f130f,_0x27672f,_0x116d3f){return new BPromise(function(_0x25d182,_0x590579){var _0xa51217=_0x116d3f||client;return _0xa51217[_0x60a1('0x1e')](_0x250b1a,_0x27672f)[_0x60a1('0x1f')](function(_0x2fbd9f){logger[_0x60a1('0x20')](_0x60a1('0x21'),_0x3f130f,_0x60a1('0x22'));logger[_0x60a1('0x23')](_0x60a1('0x24'),_0x3f130f,_0x60a1('0x22'),JSON['stringify'](_0x2fbd9f));if(_0x2fbd9f['error']){if(_0x2fbd9f[_0x60a1('0x25')]['code']===0x1f4){logger['error'](_0x60a1('0x21'),_0x3f130f,_0x2fbd9f[_0x60a1('0x25')][_0x60a1('0x26')]);return _0x590579(_0x2fbd9f[_0x60a1('0x25')][_0x60a1('0x26')]);}logger[_0x60a1('0x25')](_0x60a1('0x21'),_0x3f130f,_0x2fbd9f[_0x60a1('0x25')][_0x60a1('0x26')]);return _0x25d182(_0x2fbd9f['error'][_0x60a1('0x26')]);}else{logger[_0x60a1('0x20')](_0x60a1('0x21'),_0x3f130f,_0x60a1('0x22'));_0x25d182(_0x2fbd9f['result'][_0x60a1('0x26')]);}})['catch'](function(_0x36c572){logger[_0x60a1('0x25')](_0x60a1('0x21'),_0x3f130f,_0x36c572);_0x590579(_0x36c572);});});}function respondWithStatusCode(_0x5c6250,_0x54c275){_0x54c275=_0x54c275||0xcc;return function(_0x303c11){if(_0x303c11){return _0x5c6250[_0x60a1('0x27')](_0x54c275);}return _0x5c6250[_0x60a1('0x28')](_0x54c275)[_0x60a1('0x29')]();};}function respondWithResult(_0x98c791,_0x5f47b7){_0x5f47b7=_0x5f47b7||0xc8;return function(_0xdfa893){if(_0xdfa893){return _0x98c791['status'](_0x5f47b7)['json'](_0xdfa893);}};}function respondWithFilteredResult(_0x23a2f3,_0x11ce8b){return function(_0x509faa){if(_0x509faa){var _0x1e809c=typeof _0x11ce8b[_0x60a1('0x2a')]==='undefined'&&typeof _0x11ce8b['limit']==='undefined';var _0x5ca5ee=_0x509faa[_0x60a1('0x2b')];var _0x580109=_0x1e809c?0x0:_0x11ce8b[_0x60a1('0x2a')];var _0x1ae3bc=_0x1e809c?_0x509faa[_0x60a1('0x2b')]:_0x11ce8b['offset']+_0x11ce8b[_0x60a1('0x2c')];var _0x3a4477;if(_0x1ae3bc>=_0x5ca5ee){_0x1ae3bc=_0x5ca5ee;_0x3a4477=0xc8;}else{_0x3a4477=0xce;}_0x23a2f3[_0x60a1('0x28')](_0x3a4477);return _0x23a2f3['set']('Content-Range',_0x580109+'-'+_0x1ae3bc+'/'+_0x5ca5ee)[_0x60a1('0x2d')](_0x509faa);}return null;};}function patchUpdates(_0x30280c){return function(_0x3901b0){try{jsonpatch[_0x60a1('0x2e')](_0x3901b0,_0x30280c,!![]);}catch(_0x41d332){return BPromise[_0x60a1('0x2f')](_0x41d332);}return _0x3901b0['save']();};}function saveUpdates(_0x1f1931,_0x470728){return function(_0x1cbef5){if(_0x1cbef5){return _0x1cbef5['update'](_0x1f1931)[_0x60a1('0x1f')](function(_0x46717f){return _0x46717f;});}return null;};}function removeEntity(_0x4ba681,_0xeba554){return function(_0x157897){if(_0x157897){return _0x157897['destroy']()[_0x60a1('0x1f')](function(){var _0x471f81=_0x157897[_0x60a1('0x30')]({'plain':!![]});var _0x40dc3c='Contexts';return db['UserProfileResource'][_0x60a1('0x31')]({'where':{'type':_0x40dc3c,'resourceId':_0x471f81['id']}})[_0x60a1('0x1f')](function(){return _0x157897;});})[_0x60a1('0x1f')](function(){_0x4ba681[_0x60a1('0x28')](0xcc)[_0x60a1('0x29')]();});}};}function handleEntityNotFound(_0x42ae37,_0x27c19a){return function(_0x1c2b49){if(!_0x1c2b49){_0x42ae37[_0x60a1('0x27')](0x194);}return _0x1c2b49;};}function handleError(_0x2c3981,_0xbb141d){_0xbb141d=_0xbb141d||0x1f4;return function(_0x39d8f4){logger[_0x60a1('0x25')](_0x39d8f4[_0x60a1('0x32')]);if(_0x39d8f4['name']){delete _0x39d8f4[_0x60a1('0x33')];}_0x2c3981[_0x60a1('0x28')](_0xbb141d)[_0x60a1('0x34')](_0x39d8f4);};}exports['index']=function(_0x2a3f6d,_0x22216a){var _0x59e0bc={},_0x391d29={},_0x1c9093={'count':0x0,'rows':[]};var _0x40d6c4=_[_0x60a1('0x35')](db[_0x60a1('0x36')]['rawAttributes'],function(_0x5bebb1){return{'name':_0x5bebb1[_0x60a1('0x37')],'type':_0x5bebb1[_0x60a1('0x38')]['key']};});_0x391d29[_0x60a1('0x39')]=_['map'](_0x40d6c4,_0x60a1('0x33'));_0x391d29[_0x60a1('0x3a')]=_[_0x60a1('0x3b')](_0x2a3f6d[_0x60a1('0x3a')]);_0x391d29[_0x60a1('0x3c')]=_[_0x60a1('0x3d')](_0x391d29[_0x60a1('0x39')],_0x391d29['query']);_0x59e0bc[_0x60a1('0x3e')]=_[_0x60a1('0x3d')](_0x391d29[_0x60a1('0x39')],qs['fields'](_0x2a3f6d[_0x60a1('0x3a')][_0x60a1('0x3f')]));_0x59e0bc[_0x60a1('0x3e')]=_0x59e0bc[_0x60a1('0x3e')][_0x60a1('0x40')]?_0x59e0bc[_0x60a1('0x3e')]:_0x391d29[_0x60a1('0x39')];if(!_0x2a3f6d[_0x60a1('0x3a')]['hasOwnProperty'](_0x60a1('0x41'))){_0x59e0bc[_0x60a1('0x2c')]=qs[_0x60a1('0x2c')](_0x2a3f6d['query'][_0x60a1('0x2c')]);_0x59e0bc[_0x60a1('0x2a')]=qs['offset'](_0x2a3f6d[_0x60a1('0x3a')][_0x60a1('0x2a')]);}_0x59e0bc['order']=qs[_0x60a1('0x42')](_0x2a3f6d[_0x60a1('0x3a')]['sort']);_0x59e0bc[_0x60a1('0x43')]=qs[_0x60a1('0x3c')](_[_0x60a1('0x44')](_0x2a3f6d[_0x60a1('0x3a')],_0x391d29['filters']),_0x40d6c4);if(_0x2a3f6d['query'][_0x60a1('0x45')]){_0x59e0bc[_0x60a1('0x43')]=_[_0x60a1('0x46')](_0x59e0bc['where'],{'$or':_[_0x60a1('0x35')](_0x40d6c4,function(_0x2cee25){if(_0x2cee25[_0x60a1('0x38')]!==_0x60a1('0x47')){var _0x1936ad={};_0x1936ad[_0x2cee25[_0x60a1('0x33')]]={'$like':'%'+_0x2a3f6d[_0x60a1('0x3a')][_0x60a1('0x45')]+'%'};return _0x1936ad;}})});}_0x59e0bc=_[_0x60a1('0x46')]({},_0x59e0bc,_0x2a3f6d[_0x60a1('0x48')]);var _0x3b19fd={'where':_0x59e0bc[_0x60a1('0x43')]};return db[_0x60a1('0x36')][_0x60a1('0x2b')](_0x3b19fd)[_0x60a1('0x1f')](function(_0x369a90){_0x1c9093[_0x60a1('0x2b')]=_0x369a90;if(_0x2a3f6d['query'][_0x60a1('0x49')]){_0x59e0bc['include']=[{'all':!![]}];}return db[_0x60a1('0x36')][_0x60a1('0x4a')](_0x59e0bc);})['then'](function(_0x3deb87){_0x1c9093[_0x60a1('0x4b')]=_0x3deb87;return _0x1c9093;})[_0x60a1('0x1f')](respondWithFilteredResult(_0x22216a,_0x59e0bc))['catch'](handleError(_0x22216a,null));};exports[_0x60a1('0x4c')]=function(_0x55c032,_0x3aea1e){var _0x59ff87={'raw':![],'where':{'id':_0x55c032[_0x60a1('0x4d')]['id']}},_0x2d10d2={};_0x2d10d2[_0x60a1('0x39')]=_[_0x60a1('0x3b')](db[_0x60a1('0x36')]['rawAttributes']);_0x2d10d2[_0x60a1('0x3a')]=_[_0x60a1('0x3b')](_0x55c032['query']);_0x2d10d2['filters']=_[_0x60a1('0x3d')](_0x2d10d2[_0x60a1('0x39')],_0x2d10d2[_0x60a1('0x3a')]);_0x59ff87['attributes']=_[_0x60a1('0x3d')](_0x2d10d2['model'],qs[_0x60a1('0x3f')](_0x55c032[_0x60a1('0x3a')][_0x60a1('0x3f')]));_0x59ff87['attributes']=_0x59ff87[_0x60a1('0x3e')][_0x60a1('0x40')]?_0x59ff87[_0x60a1('0x3e')]:_0x2d10d2['model'];if(_0x55c032[_0x60a1('0x3a')][_0x60a1('0x49')]){_0x59ff87[_0x60a1('0x4e')]=[{'all':!![]}];}_0x59ff87=_['merge']({},_0x59ff87,_0x55c032[_0x60a1('0x48')]);return db['VoiceContext'][_0x60a1('0x4f')](_0x59ff87)['then'](handleEntityNotFound(_0x3aea1e,null))['then'](respondWithResult(_0x3aea1e,null))[_0x60a1('0x50')](handleError(_0x3aea1e,null));};exports[_0x60a1('0x51')]=function(_0xf89828,_0x111302,_0x25c7a3){var _0x23284c;return db['VoiceContext'][_0x60a1('0x51')](_0xf89828[_0x60a1('0x52')],{'raw':!![]})[_0x60a1('0x1f')](function(_0x17b0f7){_0x23284c=_0x17b0f7;return db[_0x60a1('0x36')][_0x60a1('0x4a')]({'raw':!![]});})['then'](function(_0x3f6de3){var _0x16f255=fs[_0x60a1('0x53')](path[_0x60a1('0x54')](config[_0x60a1('0x55')],_0x60a1('0x56')),_0x60a1('0x57'));var _0x438946=ejs[_0x60a1('0x58')](_0x16f255,{'contexts':_0x3f6de3||[]});fs[_0x60a1('0x59')](_0x60a1('0x5a'),_0x438946);})[_0x60a1('0x1f')](function(){return respondWithRpcPromise(_0x60a1('0x5b'),_0x60a1('0x51'),{'module':_0x60a1('0x5c')});})['then'](function(){var _0x4f62f0=_0xf89828[_0x60a1('0x5d')]['get']({'plain':!![]});if(!_0x4f62f0)throw new Error(_0x60a1('0x5e'));if(_0x4f62f0[_0x60a1('0x5f')]==='user'){var _0x1cc9fb=_0x23284c[_0x60a1('0x30')]({'plain':!![]});return db[_0x60a1('0x60')]['find']({'where':{'name':_0x60a1('0x61'),'userProfileId':_0x4f62f0[_0x60a1('0x62')]},'raw':!![]})[_0x60a1('0x1f')](function(_0x20d8cd){if(_0x20d8cd&&_0x20d8cd[_0x60a1('0x63')]===0x0){return db[_0x60a1('0x64')]['create']({'name':_0x1cc9fb[_0x60a1('0x33')],'resourceId':_0x1cc9fb['id'],'type':_0x20d8cd[_0x60a1('0x33')],'sectionId':_0x20d8cd['id']},{})[_0x60a1('0x1f')](function(){return _0x23284c;});}else{return _0x23284c;}})[_0x60a1('0x50')](function(_0x9b2889){logger[_0x60a1('0x25')](_0x60a1('0x65'),_0x9b2889);throw _0x9b2889;});}return _0x23284c;})['then'](respondWithResult(_0x111302,0xc9))[_0x60a1('0x50')](handleError(_0x111302,null));};exports[_0x60a1('0x66')]=function(_0x11d771,_0x5c2c26,_0x312b1e){var _0x36d1cc;return db[_0x60a1('0x36')][_0x60a1('0x4f')]({'where':{'id':_0x11d771[_0x60a1('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5c2c26,null))[_0x60a1('0x1f')](saveUpdates(_0x11d771[_0x60a1('0x52')],null))['then'](function(_0x289205){if(_0x289205){_0x36d1cc=_0x289205;return db[_0x60a1('0x36')][_0x60a1('0x4a')]({'raw':!![]});}})[_0x60a1('0x1f')](function(_0x2aa4a9){var _0x3f7a69=fs[_0x60a1('0x53')](path[_0x60a1('0x54')](config['root'],_0x60a1('0x56')),_0x60a1('0x57'));var _0x5695e9=ejs[_0x60a1('0x58')](_0x3f7a69,{'contexts':_0x2aa4a9||[]});fs[_0x60a1('0x59')](_0x60a1('0x5a'),_0x5695e9);})['then'](function(){return respondWithRpcPromise('Reload',_0x60a1('0x66'),{'module':_0x60a1('0x5c')});})[_0x60a1('0x1f')](function(){return _0x36d1cc;})[_0x60a1('0x1f')](respondWithResult(_0x5c2c26,null))['catch'](handleError(_0x5c2c26,null));};exports[_0x60a1('0x31')]=function(_0x20f7f3,_0x1b6b06,_0xffcf93){var _0x16f0fd;return db['VoiceContext'][_0x60a1('0x4f')]({'where':{'id':_0x20f7f3[_0x60a1('0x4d')]['id']}})[_0x60a1('0x1f')](handleEntityNotFound(_0x1b6b06,null))[_0x60a1('0x1f')](removeEntity(_0x1b6b06,null))[_0x60a1('0x1f')](function(){return db[_0x60a1('0x36')][_0x60a1('0x4a')]({'raw':!![]});})['then'](function(_0xd2c6ed){var _0x591fbe=fs[_0x60a1('0x53')](path['join'](config[_0x60a1('0x55')],_0x60a1('0x56')),_0x60a1('0x57'));var _0x29ae11=ejs[_0x60a1('0x58')](_0x591fbe,{'contexts':_0xd2c6ed});fs[_0x60a1('0x59')](_0x60a1('0x5a'),_0x29ae11);return respondWithRpcPromise('Reload',_0x60a1('0x31'),{'module':'chan_sip.so'});})['catch'](handleError(_0x1b6b06,null));}; \ No newline at end of file +var _0x91a4=['debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','result','end','status','json','offset','undefined','count','Content-Range','apply','reject','save','update','destroy','get','Contexts','stack','name','send','index','VoiceContext','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','intersection','find','create','body','join','root','server/files/templates/context.ejs','utf8','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','render','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x91a4,0xb5));var _0x491a=function(_0x162e32,_0x4c7fdd){_0x162e32=_0x162e32-0x0;var _0x5176d1=_0x91a4[_0x162e32];return _0x5176d1;};'use strict';var emlformat=require(_0x491a('0x0'));var rimraf=require(_0x491a('0x1'));var zipdir=require(_0x491a('0x2'));var jsonpatch=require(_0x491a('0x3'));var rp=require('request-promise');var moment=require(_0x491a('0x4'));var BPromise=require(_0x491a('0x5'));var Mustache=require('mustache');var util=require(_0x491a('0x6'));var path=require(_0x491a('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x491a('0x8'));var _=require(_0x491a('0x9'));var squel=require(_0x491a('0xa'));var crypto=require('crypto');var jsforce=require(_0x491a('0xb'));var deskjs=require(_0x491a('0xc'));var toCsv=require('to-csv');var querystring=require(_0x491a('0xd'));var Papa=require(_0x491a('0xe'));var Redis=require(_0x491a('0xf'));var authService=require(_0x491a('0x10'));var qs=require(_0x491a('0x11'));var as=require(_0x491a('0x12'));var hardwareService=require(_0x491a('0x13'));var logger=require(_0x491a('0x14'))(_0x491a('0x15'));var utils=require('../../config/utils');var config=require(_0x491a('0x16'));var licenseUtil=require(_0x491a('0x17'));var db=require(_0x491a('0x18'))['db'];var jayson=require(_0x491a('0x19'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x100fb9,_0x17a3e7,_0x6af5ad,_0x3314dc){return new BPromise(function(_0x279da5,_0x289b7a){var _0x416885=_0x3314dc||client;return _0x416885[_0x491a('0x1a')](_0x100fb9,_0x6af5ad)[_0x491a('0x1b')](function(_0x1d23bf){logger[_0x491a('0x1c')](_0x491a('0x1d'),_0x17a3e7,_0x491a('0x1e'));logger[_0x491a('0x1f')](_0x491a('0x20'),_0x17a3e7,_0x491a('0x1e'),JSON['stringify'](_0x1d23bf));if(_0x1d23bf[_0x491a('0x21')]){if(_0x1d23bf[_0x491a('0x21')][_0x491a('0x22')]===0x1f4){logger['error'](_0x491a('0x1d'),_0x17a3e7,_0x1d23bf[_0x491a('0x21')][_0x491a('0x23')]);return _0x289b7a(_0x1d23bf[_0x491a('0x21')][_0x491a('0x23')]);}logger[_0x491a('0x21')](_0x491a('0x1d'),_0x17a3e7,_0x1d23bf[_0x491a('0x21')][_0x491a('0x23')]);return _0x279da5(_0x1d23bf['error'][_0x491a('0x23')]);}else{logger['info'](_0x491a('0x1d'),_0x17a3e7,_0x491a('0x1e'));_0x279da5(_0x1d23bf[_0x491a('0x24')][_0x491a('0x23')]);}})['catch'](function(_0xed8e46){logger[_0x491a('0x21')](_0x491a('0x1d'),_0x17a3e7,_0xed8e46);_0x289b7a(_0xed8e46);});});}function respondWithStatusCode(_0x347371,_0x5638ce){_0x5638ce=_0x5638ce||0xcc;return function(_0x44ea80){if(_0x44ea80){return _0x347371['sendStatus'](_0x5638ce);}return _0x347371['status'](_0x5638ce)[_0x491a('0x25')]();};}function respondWithResult(_0x26b27e,_0x7c5021){_0x7c5021=_0x7c5021||0xc8;return function(_0x1b4c5b){if(_0x1b4c5b){return _0x26b27e[_0x491a('0x26')](_0x7c5021)[_0x491a('0x27')](_0x1b4c5b);}};}function respondWithFilteredResult(_0x1750ce,_0x9dd96e){return function(_0x46d314){if(_0x46d314){var _0x5be9ea=typeof _0x9dd96e[_0x491a('0x28')]===_0x491a('0x29')&&typeof _0x9dd96e['limit']===_0x491a('0x29');var _0x9a9ac6=_0x46d314[_0x491a('0x2a')];var _0x31611a=_0x5be9ea?0x0:_0x9dd96e['offset'];var _0x2e2487=_0x5be9ea?_0x46d314[_0x491a('0x2a')]:_0x9dd96e[_0x491a('0x28')]+_0x9dd96e['limit'];var _0x509cee;if(_0x2e2487>=_0x9a9ac6){_0x2e2487=_0x9a9ac6;_0x509cee=0xc8;}else{_0x509cee=0xce;}_0x1750ce[_0x491a('0x26')](_0x509cee);return _0x1750ce['set'](_0x491a('0x2b'),_0x31611a+'-'+_0x2e2487+'/'+_0x9a9ac6)[_0x491a('0x27')](_0x46d314);}return null;};}function patchUpdates(_0x4a2fa3){return function(_0x274659){try{jsonpatch[_0x491a('0x2c')](_0x274659,_0x4a2fa3,!![]);}catch(_0xf59f79){return BPromise[_0x491a('0x2d')](_0xf59f79);}return _0x274659[_0x491a('0x2e')]();};}function saveUpdates(_0x3eec28,_0x2533cc){return function(_0x3eda20){if(_0x3eda20){return _0x3eda20[_0x491a('0x2f')](_0x3eec28)['then'](function(_0x2c1fe2){return _0x2c1fe2;});}return null;};}function removeEntity(_0x4cdc21,_0x4376a2){return function(_0x1c9441){if(_0x1c9441){return _0x1c9441[_0x491a('0x30')]()[_0x491a('0x1b')](function(){var _0x19809f=_0x1c9441[_0x491a('0x31')]({'plain':!![]});var _0x4de144=_0x491a('0x32');return db['UserProfileResource'][_0x491a('0x30')]({'where':{'type':_0x4de144,'resourceId':_0x19809f['id']}})['then'](function(){return _0x1c9441;});})[_0x491a('0x1b')](function(){_0x4cdc21[_0x491a('0x26')](0xcc)[_0x491a('0x25')]();});}};}function handleEntityNotFound(_0x251b7e,_0x2adef9){return function(_0x262b1b){if(!_0x262b1b){_0x251b7e['sendStatus'](0x194);}return _0x262b1b;};}function handleError(_0x4193c6,_0x27af9e){_0x27af9e=_0x27af9e||0x1f4;return function(_0x4acd72){logger['error'](_0x4acd72[_0x491a('0x33')]);if(_0x4acd72[_0x491a('0x34')]){delete _0x4acd72[_0x491a('0x34')];}_0x4193c6[_0x491a('0x26')](_0x27af9e)[_0x491a('0x35')](_0x4acd72);};}exports[_0x491a('0x36')]=function(_0x2be77a,_0x244e65){var _0x345cea={},_0x47620b={},_0x19f517={'count':0x0,'rows':[]};var _0x37a420=_['map'](db[_0x491a('0x37')][_0x491a('0x38')],function(_0x2f27fc){return{'name':_0x2f27fc[_0x491a('0x39')],'type':_0x2f27fc[_0x491a('0x3a')][_0x491a('0x3b')]};});_0x47620b[_0x491a('0x3c')]=_[_0x491a('0x3d')](_0x37a420,_0x491a('0x34'));_0x47620b[_0x491a('0x3e')]=_[_0x491a('0x3f')](_0x2be77a['query']);_0x47620b[_0x491a('0x40')]=_['intersection'](_0x47620b[_0x491a('0x3c')],_0x47620b[_0x491a('0x3e')]);_0x345cea[_0x491a('0x41')]=_['intersection'](_0x47620b[_0x491a('0x3c')],qs[_0x491a('0x42')](_0x2be77a[_0x491a('0x3e')][_0x491a('0x42')]));_0x345cea[_0x491a('0x41')]=_0x345cea[_0x491a('0x41')][_0x491a('0x43')]?_0x345cea['attributes']:_0x47620b[_0x491a('0x3c')];if(!_0x2be77a[_0x491a('0x3e')][_0x491a('0x44')](_0x491a('0x45'))){_0x345cea[_0x491a('0x46')]=qs[_0x491a('0x46')](_0x2be77a[_0x491a('0x3e')][_0x491a('0x46')]);_0x345cea[_0x491a('0x28')]=qs['offset'](_0x2be77a['query'][_0x491a('0x28')]);}_0x345cea[_0x491a('0x47')]=qs[_0x491a('0x48')](_0x2be77a[_0x491a('0x3e')][_0x491a('0x48')]);_0x345cea[_0x491a('0x49')]=qs[_0x491a('0x40')](_[_0x491a('0x4a')](_0x2be77a['query'],_0x47620b[_0x491a('0x40')]),_0x37a420);if(_0x2be77a[_0x491a('0x3e')][_0x491a('0x4b')]){_0x345cea[_0x491a('0x49')]=_['merge'](_0x345cea[_0x491a('0x49')],{'$or':_[_0x491a('0x3d')](_0x37a420,function(_0xf96c99){if(_0xf96c99[_0x491a('0x3a')]!==_0x491a('0x4c')){var _0xb169d3={};_0xb169d3[_0xf96c99[_0x491a('0x34')]]={'$like':'%'+_0x2be77a[_0x491a('0x3e')][_0x491a('0x4b')]+'%'};return _0xb169d3;}})});}_0x345cea=_[_0x491a('0x4d')]({},_0x345cea,_0x2be77a[_0x491a('0x4e')]);var _0x43f2de={'where':_0x345cea['where']};return db[_0x491a('0x37')][_0x491a('0x2a')](_0x43f2de)[_0x491a('0x1b')](function(_0x45bb47){_0x19f517['count']=_0x45bb47;if(_0x2be77a[_0x491a('0x3e')][_0x491a('0x4f')]){_0x345cea[_0x491a('0x50')]=[{'all':!![]}];}return db['VoiceContext'][_0x491a('0x51')](_0x345cea);})[_0x491a('0x1b')](function(_0x1376ac){_0x19f517[_0x491a('0x52')]=_0x1376ac;return _0x19f517;})[_0x491a('0x1b')](respondWithFilteredResult(_0x244e65,_0x345cea))[_0x491a('0x53')](handleError(_0x244e65,null));};exports['show']=function(_0x24db82,_0x14f4e7){var _0x8e1efe={'raw':![],'where':{'id':_0x24db82[_0x491a('0x54')]['id']}},_0x584611={};_0x584611[_0x491a('0x3c')]=_[_0x491a('0x3f')](db[_0x491a('0x37')][_0x491a('0x38')]);_0x584611['query']=_['keys'](_0x24db82[_0x491a('0x3e')]);_0x584611[_0x491a('0x40')]=_['intersection'](_0x584611[_0x491a('0x3c')],_0x584611[_0x491a('0x3e')]);_0x8e1efe[_0x491a('0x41')]=_[_0x491a('0x55')](_0x584611[_0x491a('0x3c')],qs[_0x491a('0x42')](_0x24db82['query'][_0x491a('0x42')]));_0x8e1efe['attributes']=_0x8e1efe[_0x491a('0x41')][_0x491a('0x43')]?_0x8e1efe[_0x491a('0x41')]:_0x584611[_0x491a('0x3c')];if(_0x24db82[_0x491a('0x3e')][_0x491a('0x4f')]){_0x8e1efe['include']=[{'all':!![]}];}_0x8e1efe=_[_0x491a('0x4d')]({},_0x8e1efe,_0x24db82['options']);return db[_0x491a('0x37')][_0x491a('0x56')](_0x8e1efe)['then'](handleEntityNotFound(_0x14f4e7,null))[_0x491a('0x1b')](respondWithResult(_0x14f4e7,null))[_0x491a('0x53')](handleError(_0x14f4e7,null));};exports[_0x491a('0x57')]=function(_0x1a99bf,_0x32d1eb,_0x1dad75){var _0x1870b1;return db['VoiceContext'][_0x491a('0x57')](_0x1a99bf[_0x491a('0x58')],{'raw':!![]})[_0x491a('0x1b')](function(_0x1d662c){_0x1870b1=_0x1d662c;return db['VoiceContext'][_0x491a('0x51')]({'raw':!![]});})[_0x491a('0x1b')](function(_0x31d6c8){var _0x1173f8=fs['readFileSync'](path[_0x491a('0x59')](config[_0x491a('0x5a')],_0x491a('0x5b')),_0x491a('0x5c'));var _0xd4442f=ejs['render'](_0x1173f8,{'contexts':_0x31d6c8||[]});fs[_0x491a('0x5d')](_0x491a('0x5e'),_0xd4442f);})['then'](function(){return respondWithRpcPromise(_0x491a('0x5f'),_0x491a('0x57'),{'module':_0x491a('0x60')});})[_0x491a('0x1b')](function(){var _0x5c2230=_0x1a99bf['user']['get']({'plain':!![]});if(!_0x5c2230)throw new Error(_0x491a('0x61'));if(_0x5c2230[_0x491a('0x62')]===_0x491a('0x63')){var _0x13f404=_0x1870b1[_0x491a('0x31')]({'plain':!![]});return db['UserProfileSection'][_0x491a('0x56')]({'where':{'name':_0x491a('0x32'),'userProfileId':_0x5c2230[_0x491a('0x64')]},'raw':!![]})['then'](function(_0x258a22){if(_0x258a22&&_0x258a22[_0x491a('0x65')]===0x0){return db[_0x491a('0x66')][_0x491a('0x57')]({'name':_0x13f404[_0x491a('0x34')],'resourceId':_0x13f404['id'],'type':_0x258a22[_0x491a('0x34')],'sectionId':_0x258a22['id']},{})[_0x491a('0x1b')](function(){return _0x1870b1;});}else{return _0x1870b1;}})[_0x491a('0x53')](function(_0x49d30b){logger[_0x491a('0x21')](_0x491a('0x67'),_0x49d30b);throw _0x49d30b;});}return _0x1870b1;})[_0x491a('0x1b')](respondWithResult(_0x32d1eb,0xc9))[_0x491a('0x53')](handleError(_0x32d1eb,null));};exports[_0x491a('0x2f')]=function(_0x47a24a,_0x8bbd93,_0x835293){var _0x2d65a3;return db['VoiceContext']['find']({'where':{'id':_0x47a24a[_0x491a('0x54')]['id']}})[_0x491a('0x1b')](handleEntityNotFound(_0x8bbd93,null))['then'](saveUpdates(_0x47a24a[_0x491a('0x58')],null))[_0x491a('0x1b')](function(_0xfcdef0){if(_0xfcdef0){_0x2d65a3=_0xfcdef0;return db[_0x491a('0x37')][_0x491a('0x51')]({'raw':!![]});}})[_0x491a('0x1b')](function(_0x525afb){var _0x54c8ce=fs[_0x491a('0x68')](path['join'](config[_0x491a('0x5a')],'server/files/templates/context.ejs'),'utf8');var _0xab3e50=ejs[_0x491a('0x69')](_0x54c8ce,{'contexts':_0x525afb||[]});fs[_0x491a('0x5d')]('/etc/asterisk/extensions_xcally_contexts.conf',_0xab3e50);})[_0x491a('0x1b')](function(){return respondWithRpcPromise('Reload',_0x491a('0x2f'),{'module':'chan_sip.so'});})[_0x491a('0x1b')](function(){return _0x2d65a3;})[_0x491a('0x1b')](respondWithResult(_0x8bbd93,null))[_0x491a('0x53')](handleError(_0x8bbd93,null));};exports[_0x491a('0x30')]=function(_0x48dd29,_0x44c099,_0x101e42){var _0xe2a739;return db[_0x491a('0x37')]['find']({'where':{'id':_0x48dd29['params']['id']}})[_0x491a('0x1b')](handleEntityNotFound(_0x44c099,null))['then'](removeEntity(_0x44c099,null))['then'](function(){return db[_0x491a('0x37')]['findAll']({'raw':!![]});})[_0x491a('0x1b')](function(_0x4a10e1){var _0x4905d5=fs[_0x491a('0x68')](path[_0x491a('0x59')](config['root'],_0x491a('0x5b')),_0x491a('0x5c'));var _0x432324=ejs[_0x491a('0x69')](_0x4905d5,{'contexts':_0x4a10e1});fs[_0x491a('0x5d')](_0x491a('0x5e'),_0x432324);return respondWithRpcPromise(_0x491a('0x5f'),'destroy',{'module':'chan_sip.so'});})[_0x491a('0x53')](handleError(_0x44c099,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index e6041e1..08af6cc 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 _0x8c84=['../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','lodash','util','api','bluebird','request-promise','path','rimraf'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x8c84,0xc9));var _0x48c8=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x8c84[_0x110c3d];return _0x226d67;};'use strict';var _=require(_0x48c8('0x0'));var util=require(_0x48c8('0x1'));var logger=require('../../config/logger')(_0x48c8('0x2'));var moment=require('moment');var BPromise=require(_0x48c8('0x3'));var rp=require(_0x48c8('0x4'));var fs=require('fs');var path=require(_0x48c8('0x5'));var rimraf=require(_0x48c8('0x6'));var config=require(_0x48c8('0x7'));var attributes=require(_0x48c8('0x8'));module[_0x48c8('0x9')]=function(_0x246549,_0x4889fe){return _0x246549[_0x48c8('0xa')](_0x48c8('0xb'),attributes,{'tableName':_0x48c8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc080=['lodash','util','moment','bluebird','rimraf','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts'];(function(_0x18fbdd,_0x5a0170){var _0x11f693=function(_0x35a162){while(--_0x35a162){_0x18fbdd['push'](_0x18fbdd['shift']());}};_0x11f693(++_0x5a0170);}(_0xc080,0x16b));var _0x0c08=function(_0x1d34a4,_0x1f54af){_0x1d34a4=_0x1d34a4-0x0;var _0x5ec467=_0xc080[_0x1d34a4];return _0x5ec467;};'use strict';var _=require(_0x0c08('0x0'));var util=require(_0x0c08('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0c08('0x2'));var BPromise=require(_0x0c08('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0c08('0x4'));var config=require(_0x0c08('0x5'));var attributes=require(_0x0c08('0x6'));module[_0x0c08('0x7')]=function(_0x4fed9b,_0x5d52a0){return _0x4fed9b[_0x0c08('0x8')](_0x0c08('0x9'),attributes,{'tableName':_0x0c08('0xa'),'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 6993164..5c391f1 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 _0x2ed4=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x1a479b,_0x3b99c8){var _0x3d9e3e=function(_0x1ee012){while(--_0x1ee012){_0x1a479b['push'](_0x1a479b['shift']());}};_0x3d9e3e(++_0x3b99c8);}(_0x2ed4,0xe6));var _0x42ed=function(_0x53b53e,_0x498437){_0x53b53e=_0x53b53e-0x0;var _0xbb6179=_0x2ed4[_0x53b53e];return _0xbb6179;};'use strict';var _=require(_0x42ed('0x0'));var util=require(_0x42ed('0x1'));var moment=require(_0x42ed('0x2'));var BPromise=require(_0x42ed('0x3'));var rs=require(_0x42ed('0x4'));var fs=require('fs');var Redis=require(_0x42ed('0x5'));var db=require(_0x42ed('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x42ed('0x7'))(_0x42ed('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x42ed('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2549f8,_0x5e8b58,_0x50983c){return new BPromise(function(_0x2c19ab,_0x4ef196){return client[_0x42ed('0xa')](_0x2549f8,_0x50983c)[_0x42ed('0xb')](function(_0x339d0d){logger[_0x42ed('0xc')](_0x42ed('0xd'),_0x5e8b58,_0x42ed('0xe'));logger[_0x42ed('0xf')](_0x42ed('0x10'),_0x5e8b58,'request\x20sent',JSON[_0x42ed('0x11')](_0x339d0d));if(_0x339d0d[_0x42ed('0x12')]){if(_0x339d0d[_0x42ed('0x12')][_0x42ed('0x13')]===0x1f4){logger[_0x42ed('0x12')](_0x42ed('0xd'),_0x5e8b58,_0x339d0d[_0x42ed('0x12')]['message']);return _0x4ef196(_0x339d0d['error'][_0x42ed('0x14')]);}logger['error'](_0x42ed('0xd'),_0x5e8b58,_0x339d0d[_0x42ed('0x12')][_0x42ed('0x14')]);return _0x2c19ab(_0x339d0d[_0x42ed('0x12')][_0x42ed('0x14')]);}else{logger[_0x42ed('0xc')](_0x42ed('0xd'),_0x5e8b58,_0x42ed('0xe'));_0x2c19ab(_0x339d0d[_0x42ed('0x15')][_0x42ed('0x14')]);}})[_0x42ed('0x16')](function(_0x17788d){logger[_0x42ed('0x12')](_0x42ed('0xd'),_0x5e8b58,_0x17788d);_0x4ef196(_0x17788d);});});} \ No newline at end of file +var _0x1b0e=['debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1b0e,0x132));var _0xe1b0=function(_0x382920,_0x23b099){_0x382920=_0x382920-0x0;var _0x2cf1eb=_0x1b0e[_0x382920];return _0x2cf1eb;};'use strict';var _=require(_0xe1b0('0x0'));var util=require(_0xe1b0('0x1'));var moment=require(_0xe1b0('0x2'));var BPromise=require(_0xe1b0('0x3'));var rs=require(_0xe1b0('0x4'));var fs=require('fs');var Redis=require(_0xe1b0('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe1b0('0x6'))(_0xe1b0('0x7'));var config=require('../../config/environment');var jayson=require(_0xe1b0('0x8'));var client=jayson[_0xe1b0('0x9')][_0xe1b0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52e806,_0x36f5cd,_0x1eef2a){return new BPromise(function(_0x5aacc2,_0x123268){return client[_0xe1b0('0xb')](_0x52e806,_0x1eef2a)[_0xe1b0('0xc')](function(_0x400eee){logger[_0xe1b0('0xd')](_0xe1b0('0xe'),_0x36f5cd,_0xe1b0('0xf'));logger[_0xe1b0('0x10')](_0xe1b0('0x11'),_0x36f5cd,_0xe1b0('0xf'),JSON['stringify'](_0x400eee));if(_0x400eee[_0xe1b0('0x12')]){if(_0x400eee[_0xe1b0('0x12')][_0xe1b0('0x13')]===0x1f4){logger[_0xe1b0('0x12')](_0xe1b0('0xe'),_0x36f5cd,_0x400eee[_0xe1b0('0x12')][_0xe1b0('0x14')]);return _0x123268(_0x400eee[_0xe1b0('0x12')][_0xe1b0('0x14')]);}logger['error'](_0xe1b0('0xe'),_0x36f5cd,_0x400eee[_0xe1b0('0x12')][_0xe1b0('0x14')]);return _0x5aacc2(_0x400eee['error']['message']);}else{logger[_0xe1b0('0xd')](_0xe1b0('0xe'),_0x36f5cd,_0xe1b0('0xf'));_0x5aacc2(_0x400eee[_0xe1b0('0x15')][_0xe1b0('0x14')]);}})[_0xe1b0('0x16')](function(_0x5dfd78){logger[_0xe1b0('0x12')](_0xe1b0('0xe'),_0x36f5cd,_0x5dfd78);_0x123268(_0x5dfd78);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 33a7716..32a42e1 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 _0xd4a0=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post','put','update','destroy'];(function(_0x953c49,_0x1bc21d){var _0x368b77=function(_0x8619e0){while(--_0x8619e0){_0x953c49['push'](_0x953c49['shift']());}};_0x368b77(++_0x1bc21d);}(_0xd4a0,0x187));var _0x0d4a=function(_0x556df5,_0x2574ed){_0x556df5=_0x556df5-0x0;var _0x176b35=_0xd4a0[_0x556df5];return _0x176b35;};'use strict';var multer=require(_0x0d4a('0x0'));var util=require(_0x0d4a('0x1'));var path=require(_0x0d4a('0x2'));var timeout=require(_0x0d4a('0x3'));var express=require('express');var router=express[_0x0d4a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0d4a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0d4a('0x6'));var controller=require('./voiceDialReport.controller');router[_0x0d4a('0x7')]('/',auth[_0x0d4a('0x8')](),controller[_0x0d4a('0x9')]);router[_0x0d4a('0x7')](_0x0d4a('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0d4a('0x7')](_0x0d4a('0xb'),auth[_0x0d4a('0x8')](),controller[_0x0d4a('0xc')]);router[_0x0d4a('0xd')]('/',auth[_0x0d4a('0x8')](),controller['create']);router[_0x0d4a('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x0d4a('0xf')]);router['delete']('/:id',auth[_0x0d4a('0x8')](),controller[_0x0d4a('0x10')]);module['exports']=router; \ No newline at end of file +var _0xb498=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','/describe','isAuthenticated','/:id','show','post','put','update','delete','multer','path','connect-timeout','express','Router'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb498,0x12b));var _0x8b49=function(_0x53ec3d,_0x503c5b){_0x53ec3d=_0x53ec3d-0x0;var _0x472c20=_0xb498[_0x53ec3d];return _0x472c20;};'use strict';var multer=require(_0x8b49('0x0'));var util=require('util');var path=require(_0x8b49('0x1'));var timeout=require(_0x8b49('0x2'));var express=require(_0x8b49('0x3'));var router=express[_0x8b49('0x4')]();var fs_extra=require(_0x8b49('0x5'));var auth=require(_0x8b49('0x6'));var interaction=require(_0x8b49('0x7'));var config=require(_0x8b49('0x8'));var controller=require(_0x8b49('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x8b49('0xa')](_0x8b49('0xb'),auth[_0x8b49('0xc')](),controller['describe']);router['get'](_0x8b49('0xd'),auth[_0x8b49('0xc')](),controller[_0x8b49('0xe')]);router[_0x8b49('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8b49('0x10')](_0x8b49('0xd'),auth[_0x8b49('0xc')](),controller[_0x8b49('0x11')]);router[_0x8b49('0x12')](_0x8b49('0xd'),auth[_0x8b49('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 6c78d8b..e9f7e6e 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 _0x81bd=['exports','STRING','INTEGER','DATE','sequelize'];(function(_0x11d556,_0x1ab952){var _0x151d44=function(_0x576339){while(--_0x576339){_0x11d556['push'](_0x11d556['shift']());}};_0x151d44(++_0x1ab952);}(_0x81bd,0x7c));var _0xd81b=function(_0x1ee7e4,_0x4ba132){_0x1ee7e4=_0x1ee7e4-0x0;var _0x4a99aa=_0x81bd[_0x1ee7e4];return _0x4a99aa;};'use strict';var Sequelize=require(_0xd81b('0x0'));module[_0xd81b('0x1')]={'privilege':{'type':Sequelize[_0xd81b('0x2')]},'channel':{'type':Sequelize[_0xd81b('0x2')]},'channelstate':{'type':Sequelize[_0xd81b('0x3')]},'channelstatedesc':{'type':Sequelize[_0xd81b('0x2')]},'calleridnum':{'type':Sequelize[_0xd81b('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xd81b('0x2')]},'connectedlinename':{'type':Sequelize[_0xd81b('0x2')]},'language':{'type':Sequelize[_0xd81b('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xd81b('0x2')]},'exten':{'type':Sequelize[_0xd81b('0x2')]},'priority':{'type':Sequelize[_0xd81b('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xd81b('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xd81b('0x2')]},'destcalleridnum':{'type':Sequelize[_0xd81b('0x2')]},'destcalleridname':{'type':Sequelize[_0xd81b('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xd81b('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xd81b('0x2')]},'destlanguage':{'type':Sequelize[_0xd81b('0x2')]},'destaccountcode':{'type':Sequelize[_0xd81b('0x2')]},'destcontext':{'type':Sequelize[_0xd81b('0x2')]},'destexten':{'type':Sequelize[_0xd81b('0x2')]},'destpriority':{'type':Sequelize[_0xd81b('0x3')]},'destuniqueid':{'type':Sequelize[_0xd81b('0x2')]},'destlinkedid':{'type':Sequelize[_0xd81b('0x2')]},'dialstring':{'type':Sequelize[_0xd81b('0x2')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xd81b('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xd81b('0x4')]},'lastevent':{'type':Sequelize[_0xd81b('0x2')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xd81b('0x3')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xd81b('0x3')]},'billableseconds':{'type':Sequelize[_0xd81b('0x3')]}}; \ No newline at end of file +var _0x55ca=['exports','STRING','INTEGER','DATE','sequelize'];(function(_0x1d53fe,_0x22f23d){var _0x41693f=function(_0xcd4d3f){while(--_0xcd4d3f){_0x1d53fe['push'](_0x1d53fe['shift']());}};_0x41693f(++_0x22f23d);}(_0x55ca,0x126));var _0xa55c=function(_0x16771d,_0x224c60){_0x16771d=_0x16771d-0x0;var _0x386f11=_0x55ca[_0x16771d];return _0x386f11;};'use strict';var Sequelize=require(_0xa55c('0x0'));module[_0xa55c('0x1')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xa55c('0x2')]},'calleridnum':{'type':Sequelize[_0xa55c('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xa55c('0x2')]},'connectedlinename':{'type':Sequelize[_0xa55c('0x2')]},'language':{'type':Sequelize[_0xa55c('0x2')]},'accountcode':{'type':Sequelize[_0xa55c('0x2')]},'context':{'type':Sequelize[_0xa55c('0x2')]},'exten':{'type':Sequelize[_0xa55c('0x2')]},'priority':{'type':Sequelize[_0xa55c('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xa55c('0x2')]},'destchannel':{'type':Sequelize[_0xa55c('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xa55c('0x2')]},'destcalleridnum':{'type':Sequelize[_0xa55c('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xa55c('0x2')]},'destlanguage':{'type':Sequelize[_0xa55c('0x2')]},'destaccountcode':{'type':Sequelize[_0xa55c('0x2')]},'destcontext':{'type':Sequelize[_0xa55c('0x2')]},'destexten':{'type':Sequelize[_0xa55c('0x2')]},'destpriority':{'type':Sequelize[_0xa55c('0x3')]},'destuniqueid':{'type':Sequelize[_0xa55c('0x2')]},'destlinkedid':{'type':Sequelize[_0xa55c('0x2')]},'dialstring':{'type':Sequelize[_0xa55c('0x2')]},'dialstatus':{'type':Sequelize[_0xa55c('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xa55c('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0xa55c('0x3')]},'holdtime':{'type':Sequelize[_0xa55c('0x3')]},'billableseconds':{'type':Sequelize[_0xa55c('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 0fa6cf3..8abbe3f 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 _0xf807=['query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','rawAttributes','length','create','body','catch','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','name','map','VoiceDialReport','fieldName','key','model'];(function(_0xa97e85,_0x1f7a31){var _0x495825=function(_0x3470fb){while(--_0x3470fb){_0xa97e85['push'](_0xa97e85['shift']());}};_0x495825(++_0x1f7a31);}(_0xf807,0xf2));var _0x7f80=function(_0x2ef252,_0x1993fe){_0x2ef252=_0x2ef252-0x0;var _0x1139ca=_0xf807[_0x2ef252];return _0x1139ca;};'use strict';var emlformat=require(_0x7f80('0x0'));var rimraf=require(_0x7f80('0x1'));var zipdir=require(_0x7f80('0x2'));var jsonpatch=require(_0x7f80('0x3'));var rp=require(_0x7f80('0x4'));var moment=require(_0x7f80('0x5'));var BPromise=require(_0x7f80('0x6'));var Mustache=require(_0x7f80('0x7'));var util=require('util');var path=require(_0x7f80('0x8'));var sox=require(_0x7f80('0x9'));var csv=require(_0x7f80('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7f80('0xb'));var squel=require('squel');var crypto=require(_0x7f80('0xc'));var jsforce=require(_0x7f80('0xd'));var deskjs=require(_0x7f80('0xe'));var toCsv=require(_0x7f80('0xa'));var querystring=require('querystring');var Papa=require(_0x7f80('0xf'));var Redis=require(_0x7f80('0x10'));var authService=require(_0x7f80('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7f80('0x12'));var hardwareService=require(_0x7f80('0x13'));var logger=require(_0x7f80('0x14'))(_0x7f80('0x15'));var utils=require(_0x7f80('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7f80('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4483af,_0x480011){_0x480011=_0x480011||0xcc;return function(_0x284395){if(_0x284395){return _0x4483af[_0x7f80('0x18')](_0x480011);}return _0x4483af[_0x7f80('0x19')](_0x480011)[_0x7f80('0x1a')]();};}function respondWithResult(_0x112508,_0x288dc4){_0x288dc4=_0x288dc4||0xc8;return function(_0x2c6ce4){if(_0x2c6ce4){return _0x112508[_0x7f80('0x19')](_0x288dc4)[_0x7f80('0x1b')](_0x2c6ce4);}};}function respondWithFilteredResult(_0x40813b,_0x441c85){return function(_0x5e50cc){if(_0x5e50cc){var _0x1f79bf=typeof _0x441c85[_0x7f80('0x1c')]===_0x7f80('0x1d')&&typeof _0x441c85[_0x7f80('0x1e')]===_0x7f80('0x1d');var _0x2ddd8c=_0x5e50cc['count'];var _0x454390=_0x1f79bf?0x0:_0x441c85[_0x7f80('0x1c')];var _0x362d53=_0x1f79bf?_0x5e50cc[_0x7f80('0x1f')]:_0x441c85['offset']+_0x441c85[_0x7f80('0x1e')];var _0x1de830;if(_0x362d53>=_0x2ddd8c){_0x362d53=_0x2ddd8c;_0x1de830=0xc8;}else{_0x1de830=0xce;}_0x40813b[_0x7f80('0x19')](_0x1de830);return _0x40813b[_0x7f80('0x20')](_0x7f80('0x21'),_0x454390+'-'+_0x362d53+'/'+_0x2ddd8c)[_0x7f80('0x1b')](_0x5e50cc);}return null;};}function patchUpdates(_0x441aa5){return function(_0x1e0a3b){try{jsonpatch[_0x7f80('0x22')](_0x1e0a3b,_0x441aa5,!![]);}catch(_0x20b6a0){return BPromise[_0x7f80('0x23')](_0x20b6a0);}return _0x1e0a3b[_0x7f80('0x24')]();};}function saveUpdates(_0x23ce8f,_0x1a463d){return function(_0x463c3b){if(_0x463c3b){return _0x463c3b[_0x7f80('0x25')](_0x23ce8f)[_0x7f80('0x26')](function(_0x475797){return _0x475797;});}return null;};}function removeEntity(_0x228389,_0xdd8c3d){return function(_0x469098){if(_0x469098){return _0x469098[_0x7f80('0x27')]()[_0x7f80('0x26')](function(){_0x228389[_0x7f80('0x19')](0xcc)[_0x7f80('0x1a')]();});}};}function handleEntityNotFound(_0x1da1e6,_0x323384){return function(_0xd14881){if(!_0xd14881){_0x1da1e6[_0x7f80('0x18')](0x194);}return _0xd14881;};}function handleError(_0x4704b9,_0x373408){_0x373408=_0x373408||0x1f4;return function(_0x136827){logger['error'](_0x136827['stack']);if(_0x136827[_0x7f80('0x28')]){delete _0x136827['name'];}_0x4704b9[_0x7f80('0x19')](_0x373408)['send'](_0x136827);};}exports['index']=function(_0x710160,_0x298d74){var _0x3adfb0={},_0x1bc64a={},_0x186fdc={'count':0x0,'rows':[]};var _0x526fdf=_[_0x7f80('0x29')](db[_0x7f80('0x2a')]['rawAttributes'],function(_0xe069a1){return{'name':_0xe069a1[_0x7f80('0x2b')],'type':_0xe069a1['type'][_0x7f80('0x2c')]};});_0x1bc64a[_0x7f80('0x2d')]=_['map'](_0x526fdf,_0x7f80('0x28'));_0x1bc64a[_0x7f80('0x2e')]=_[_0x7f80('0x2f')](_0x710160[_0x7f80('0x2e')]);_0x1bc64a[_0x7f80('0x30')]=_[_0x7f80('0x31')](_0x1bc64a[_0x7f80('0x2d')],_0x1bc64a[_0x7f80('0x2e')]);_0x3adfb0[_0x7f80('0x32')]=_['intersection'](_0x1bc64a[_0x7f80('0x2d')],qs[_0x7f80('0x33')](_0x710160[_0x7f80('0x2e')][_0x7f80('0x33')]));_0x3adfb0[_0x7f80('0x32')]=_0x3adfb0['attributes']['length']?_0x3adfb0['attributes']:_0x1bc64a['model'];if(!_0x710160[_0x7f80('0x2e')][_0x7f80('0x34')](_0x7f80('0x35'))){_0x3adfb0[_0x7f80('0x1e')]=qs['limit'](_0x710160[_0x7f80('0x2e')][_0x7f80('0x1e')]);_0x3adfb0[_0x7f80('0x1c')]=qs[_0x7f80('0x1c')](_0x710160[_0x7f80('0x2e')]['offset']);}_0x3adfb0['order']=qs[_0x7f80('0x36')](_0x710160['query']['sort']);_0x3adfb0[_0x7f80('0x37')]=qs[_0x7f80('0x30')](_['pick'](_0x710160[_0x7f80('0x2e')],_0x1bc64a[_0x7f80('0x30')]),_0x526fdf);if(_0x710160[_0x7f80('0x2e')][_0x7f80('0x38')]){_0x3adfb0[_0x7f80('0x37')]=_[_0x7f80('0x39')](_0x3adfb0[_0x7f80('0x37')],{'$or':_[_0x7f80('0x29')](_0x526fdf,function(_0x55219a){if(_0x55219a['type']!==_0x7f80('0x3a')){var _0xb2c574={};_0xb2c574[_0x55219a['name']]={'$like':'%'+_0x710160[_0x7f80('0x2e')]['filter']+'%'};return _0xb2c574;}})});}_0x3adfb0=_[_0x7f80('0x39')]({},_0x3adfb0,_0x710160[_0x7f80('0x3b')]);var _0x56a884={'where':_0x3adfb0['where']};return db['VoiceDialReport'][_0x7f80('0x1f')](_0x56a884)[_0x7f80('0x26')](function(_0x156dce){_0x186fdc[_0x7f80('0x1f')]=_0x156dce;if(_0x710160[_0x7f80('0x2e')][_0x7f80('0x3c')]){_0x3adfb0['include']=[{'all':!![]}];}return db[_0x7f80('0x2a')][_0x7f80('0x3d')](_0x3adfb0);})[_0x7f80('0x26')](function(_0x4c7c7f){_0x186fdc[_0x7f80('0x3e')]=_0x4c7c7f;return _0x186fdc;})[_0x7f80('0x26')](respondWithFilteredResult(_0x298d74,_0x3adfb0))['catch'](handleError(_0x298d74,null));};exports[_0x7f80('0x3f')]=function(_0xab251b,_0x3ee84c){var _0x12d7a3={'raw':!![],'where':{'id':_0xab251b[_0x7f80('0x40')]['id']}},_0x390b87={};_0x390b87[_0x7f80('0x2d')]=_['keys'](db['VoiceDialReport'][_0x7f80('0x41')]);_0x390b87[_0x7f80('0x2e')]=_['keys'](_0xab251b['query']);_0x390b87[_0x7f80('0x30')]=_[_0x7f80('0x31')](_0x390b87[_0x7f80('0x2d')],_0x390b87[_0x7f80('0x2e')]);_0x12d7a3[_0x7f80('0x32')]=_[_0x7f80('0x31')](_0x390b87[_0x7f80('0x2d')],qs[_0x7f80('0x33')](_0xab251b['query'][_0x7f80('0x33')]));_0x12d7a3['attributes']=_0x12d7a3[_0x7f80('0x32')][_0x7f80('0x42')]?_0x12d7a3[_0x7f80('0x32')]:_0x390b87[_0x7f80('0x2d')];if(_0xab251b[_0x7f80('0x2e')]['includeAll']){_0x12d7a3['include']=[{'all':!![]}];}_0x12d7a3=_[_0x7f80('0x39')]({},_0x12d7a3,_0xab251b[_0x7f80('0x3b')]);return db[_0x7f80('0x2a')]['find'](_0x12d7a3)['then'](handleEntityNotFound(_0x3ee84c,null))[_0x7f80('0x26')](respondWithResult(_0x3ee84c,null))['catch'](handleError(_0x3ee84c,null));};exports[_0x7f80('0x43')]=function(_0x3bc977,_0x2fb23c){return db[_0x7f80('0x2a')][_0x7f80('0x43')](_0x3bc977[_0x7f80('0x44')],{})['then'](respondWithResult(_0x2fb23c,0xc9))[_0x7f80('0x45')](handleError(_0x2fb23c,null));};exports[_0x7f80('0x25')]=function(_0x490cc8,_0x3f172a){if(_0x490cc8[_0x7f80('0x44')]['id']){delete _0x490cc8['body']['id'];}return db[_0x7f80('0x2a')][_0x7f80('0x46')]({'where':{'id':_0x490cc8['params']['id']}})[_0x7f80('0x26')](handleEntityNotFound(_0x3f172a,null))[_0x7f80('0x26')](saveUpdates(_0x490cc8[_0x7f80('0x44')],null))[_0x7f80('0x26')](respondWithResult(_0x3f172a,null))['catch'](handleError(_0x3f172a,null));};exports[_0x7f80('0x27')]=function(_0x4a9d9b,_0x428343){return db[_0x7f80('0x2a')]['find']({'where':{'id':_0x4a9d9b[_0x7f80('0x40')]['id']}})[_0x7f80('0x26')](handleEntityNotFound(_0x428343,null))[_0x7f80('0x26')](removeEntity(_0x428343,null))[_0x7f80('0x45')](handleError(_0x428343,null));};exports[_0x7f80('0x47')]=function(_0xc931ae,_0x945d75){return db[_0x7f80('0x2a')][_0x7f80('0x47')]()['then'](respondWithResult(_0x945d75,null))[_0x7f80('0x45')](handleError(_0x945d75,null));}; \ No newline at end of file +var _0x8bff=['index','map','VoiceDialReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','eml-format','zip-dir','request-promise','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','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name'];(function(_0x5441c8,_0x3c7f77){var _0x159a87=function(_0x53710c){while(--_0x53710c){_0x5441c8['push'](_0x5441c8['shift']());}};_0x159a87(++_0x3c7f77);}(_0x8bff,0xbd));var _0xf8bf=function(_0x1864ef,_0x534cc1){_0x1864ef=_0x1864ef-0x0;var _0x397370=_0x8bff[_0x1864ef];return _0x397370;};'use strict';var emlformat=require(_0xf8bf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf8bf('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf8bf('0x2'));var moment=require('moment');var BPromise=require(_0xf8bf('0x3'));var Mustache=require(_0xf8bf('0x4'));var util=require(_0xf8bf('0x5'));var path=require(_0xf8bf('0x6'));var sox=require(_0xf8bf('0x7'));var csv=require(_0xf8bf('0x8'));var ejs=require(_0xf8bf('0x9'));var fs=require('fs');var fs_extra=require(_0xf8bf('0xa'));var _=require(_0xf8bf('0xb'));var squel=require('squel');var crypto=require(_0xf8bf('0xc'));var jsforce=require(_0xf8bf('0xd'));var deskjs=require(_0xf8bf('0xe'));var toCsv=require(_0xf8bf('0x8'));var querystring=require(_0xf8bf('0xf'));var Papa=require(_0xf8bf('0x10'));var Redis=require(_0xf8bf('0x11'));var authService=require(_0xf8bf('0x12'));var qs=require(_0xf8bf('0x13'));var as=require(_0xf8bf('0x14'));var hardwareService=require(_0xf8bf('0x15'));var logger=require(_0xf8bf('0x16'))(_0xf8bf('0x17'));var utils=require(_0xf8bf('0x18'));var config=require(_0xf8bf('0x19'));var licenseUtil=require(_0xf8bf('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ece61,_0x20606c){_0x20606c=_0x20606c||0xcc;return function(_0x24ce01){if(_0x24ce01){return _0x1ece61[_0xf8bf('0x1b')](_0x20606c);}return _0x1ece61[_0xf8bf('0x1c')](_0x20606c)[_0xf8bf('0x1d')]();};}function respondWithResult(_0x2ef877,_0x5410a0){_0x5410a0=_0x5410a0||0xc8;return function(_0x2ff037){if(_0x2ff037){return _0x2ef877[_0xf8bf('0x1c')](_0x5410a0)[_0xf8bf('0x1e')](_0x2ff037);}};}function respondWithFilteredResult(_0x42cc23,_0x440bb3){return function(_0x1146e8){if(_0x1146e8){var _0x1a8c59=typeof _0x440bb3[_0xf8bf('0x1f')]===_0xf8bf('0x20')&&typeof _0x440bb3[_0xf8bf('0x21')]==='undefined';var _0x3ebc06=_0x1146e8[_0xf8bf('0x22')];var _0x2c87ce=_0x1a8c59?0x0:_0x440bb3['offset'];var _0x5ef8e3=_0x1a8c59?_0x1146e8[_0xf8bf('0x22')]:_0x440bb3[_0xf8bf('0x1f')]+_0x440bb3[_0xf8bf('0x21')];var _0x44746e;if(_0x5ef8e3>=_0x3ebc06){_0x5ef8e3=_0x3ebc06;_0x44746e=0xc8;}else{_0x44746e=0xce;}_0x42cc23[_0xf8bf('0x1c')](_0x44746e);return _0x42cc23[_0xf8bf('0x23')]('Content-Range',_0x2c87ce+'-'+_0x5ef8e3+'/'+_0x3ebc06)[_0xf8bf('0x1e')](_0x1146e8);}return null;};}function patchUpdates(_0x212a43){return function(_0x424633){try{jsonpatch[_0xf8bf('0x24')](_0x424633,_0x212a43,!![]);}catch(_0x207edf){return BPromise[_0xf8bf('0x25')](_0x207edf);}return _0x424633[_0xf8bf('0x26')]();};}function saveUpdates(_0x2d4a8b,_0x3d019b){return function(_0x3c79c2){if(_0x3c79c2){return _0x3c79c2[_0xf8bf('0x27')](_0x2d4a8b)[_0xf8bf('0x28')](function(_0x41853f){return _0x41853f;});}return null;};}function removeEntity(_0x612234,_0x36bfca){return function(_0x4ff645){if(_0x4ff645){return _0x4ff645[_0xf8bf('0x29')]()['then'](function(){_0x612234['status'](0xcc)[_0xf8bf('0x1d')]();});}};}function handleEntityNotFound(_0x20fad4,_0x58091f){return function(_0x1d942c){if(!_0x1d942c){_0x20fad4[_0xf8bf('0x1b')](0x194);}return _0x1d942c;};}function handleError(_0x467ec4,_0x4a81c3){_0x4a81c3=_0x4a81c3||0x1f4;return function(_0x500be5){logger[_0xf8bf('0x2a')](_0x500be5[_0xf8bf('0x2b')]);if(_0x500be5[_0xf8bf('0x2c')]){delete _0x500be5[_0xf8bf('0x2c')];}_0x467ec4[_0xf8bf('0x1c')](_0x4a81c3)['send'](_0x500be5);};}exports[_0xf8bf('0x2d')]=function(_0x2ae0c0,_0x4cd619){var _0x42cc4d={},_0x21d06c={},_0x90187={'count':0x0,'rows':[]};var _0x3d32bc=_[_0xf8bf('0x2e')](db[_0xf8bf('0x2f')][_0xf8bf('0x30')],function(_0xa9941f){return{'name':_0xa9941f[_0xf8bf('0x31')],'type':_0xa9941f[_0xf8bf('0x32')]['key']};});_0x21d06c[_0xf8bf('0x33')]=_[_0xf8bf('0x2e')](_0x3d32bc,'name');_0x21d06c[_0xf8bf('0x34')]=_[_0xf8bf('0x35')](_0x2ae0c0[_0xf8bf('0x34')]);_0x21d06c[_0xf8bf('0x36')]=_[_0xf8bf('0x37')](_0x21d06c[_0xf8bf('0x33')],_0x21d06c['query']);_0x42cc4d[_0xf8bf('0x38')]=_['intersection'](_0x21d06c[_0xf8bf('0x33')],qs[_0xf8bf('0x39')](_0x2ae0c0[_0xf8bf('0x34')][_0xf8bf('0x39')]));_0x42cc4d[_0xf8bf('0x38')]=_0x42cc4d[_0xf8bf('0x38')][_0xf8bf('0x3a')]?_0x42cc4d[_0xf8bf('0x38')]:_0x21d06c[_0xf8bf('0x33')];if(!_0x2ae0c0[_0xf8bf('0x34')]['hasOwnProperty']('nolimit')){_0x42cc4d[_0xf8bf('0x21')]=qs[_0xf8bf('0x21')](_0x2ae0c0[_0xf8bf('0x34')]['limit']);_0x42cc4d['offset']=qs['offset'](_0x2ae0c0[_0xf8bf('0x34')][_0xf8bf('0x1f')]);}_0x42cc4d[_0xf8bf('0x3b')]=qs[_0xf8bf('0x3c')](_0x2ae0c0['query']['sort']);_0x42cc4d[_0xf8bf('0x3d')]=qs['filters'](_[_0xf8bf('0x3e')](_0x2ae0c0['query'],_0x21d06c[_0xf8bf('0x36')]),_0x3d32bc);if(_0x2ae0c0['query'][_0xf8bf('0x3f')]){_0x42cc4d[_0xf8bf('0x3d')]=_[_0xf8bf('0x40')](_0x42cc4d[_0xf8bf('0x3d')],{'$or':_[_0xf8bf('0x2e')](_0x3d32bc,function(_0x5e6c35){if(_0x5e6c35['type']!==_0xf8bf('0x41')){var _0x3a41c9={};_0x3a41c9[_0x5e6c35['name']]={'$like':'%'+_0x2ae0c0[_0xf8bf('0x34')][_0xf8bf('0x3f')]+'%'};return _0x3a41c9;}})});}_0x42cc4d=_['merge']({},_0x42cc4d,_0x2ae0c0[_0xf8bf('0x42')]);var _0x2f909e={'where':_0x42cc4d[_0xf8bf('0x3d')]};return db['VoiceDialReport']['count'](_0x2f909e)[_0xf8bf('0x28')](function(_0x365223){_0x90187[_0xf8bf('0x22')]=_0x365223;if(_0x2ae0c0[_0xf8bf('0x34')][_0xf8bf('0x43')]){_0x42cc4d[_0xf8bf('0x44')]=[{'all':!![]}];}return db['VoiceDialReport'][_0xf8bf('0x45')](_0x42cc4d);})['then'](function(_0x4c4f84){_0x90187[_0xf8bf('0x46')]=_0x4c4f84;return _0x90187;})[_0xf8bf('0x28')](respondWithFilteredResult(_0x4cd619,_0x42cc4d))[_0xf8bf('0x47')](handleError(_0x4cd619,null));};exports[_0xf8bf('0x48')]=function(_0x30a821,_0x3af976){var _0x3752bf={'raw':!![],'where':{'id':_0x30a821[_0xf8bf('0x49')]['id']}},_0x5030c3={};_0x5030c3[_0xf8bf('0x33')]=_[_0xf8bf('0x35')](db[_0xf8bf('0x2f')]['rawAttributes']);_0x5030c3['query']=_[_0xf8bf('0x35')](_0x30a821[_0xf8bf('0x34')]);_0x5030c3[_0xf8bf('0x36')]=_[_0xf8bf('0x37')](_0x5030c3[_0xf8bf('0x33')],_0x5030c3['query']);_0x3752bf[_0xf8bf('0x38')]=_[_0xf8bf('0x37')](_0x5030c3['model'],qs[_0xf8bf('0x39')](_0x30a821[_0xf8bf('0x34')]['fields']));_0x3752bf['attributes']=_0x3752bf['attributes']['length']?_0x3752bf[_0xf8bf('0x38')]:_0x5030c3[_0xf8bf('0x33')];if(_0x30a821[_0xf8bf('0x34')][_0xf8bf('0x43')]){_0x3752bf[_0xf8bf('0x44')]=[{'all':!![]}];}_0x3752bf=_['merge']({},_0x3752bf,_0x30a821[_0xf8bf('0x42')]);return db[_0xf8bf('0x2f')]['find'](_0x3752bf)[_0xf8bf('0x28')](handleEntityNotFound(_0x3af976,null))[_0xf8bf('0x28')](respondWithResult(_0x3af976,null))['catch'](handleError(_0x3af976,null));};exports[_0xf8bf('0x4a')]=function(_0x524ee9,_0x2c0af5){return db[_0xf8bf('0x2f')][_0xf8bf('0x4a')](_0x524ee9[_0xf8bf('0x4b')],{})[_0xf8bf('0x28')](respondWithResult(_0x2c0af5,0xc9))['catch'](handleError(_0x2c0af5,null));};exports[_0xf8bf('0x27')]=function(_0x28f5cd,_0x50cb2d){if(_0x28f5cd[_0xf8bf('0x4b')]['id']){delete _0x28f5cd[_0xf8bf('0x4b')]['id'];}return db['VoiceDialReport'][_0xf8bf('0x4c')]({'where':{'id':_0x28f5cd[_0xf8bf('0x49')]['id']}})[_0xf8bf('0x28')](handleEntityNotFound(_0x50cb2d,null))['then'](saveUpdates(_0x28f5cd[_0xf8bf('0x4b')],null))[_0xf8bf('0x28')](respondWithResult(_0x50cb2d,null))[_0xf8bf('0x47')](handleError(_0x50cb2d,null));};exports['destroy']=function(_0x5e0314,_0x468514){return db[_0xf8bf('0x2f')][_0xf8bf('0x4c')]({'where':{'id':_0x5e0314[_0xf8bf('0x49')]['id']}})[_0xf8bf('0x28')](handleEntityNotFound(_0x468514,null))[_0xf8bf('0x28')](removeEntity(_0x468514,null))[_0xf8bf('0x47')](handleError(_0x468514,null));};exports[_0xf8bf('0x4d')]=function(_0x15e35c,_0x35ee78){return db['VoiceDialReport'][_0xf8bf('0x4d')]()['then'](respondWithResult(_0x35ee78,null))[_0xf8bf('0x47')](handleError(_0x35ee78,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index a6c753a..0fdd537 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 _0x952f=['./voiceDialReport.attributes','exports','VoiceDialReport','report_dial','uniqueid','lodash','util','api','bluebird','request-promise','path','rimraf'];(function(_0x5e2dfc,_0x4f52cd){var _0x2644e0=function(_0x261a78){while(--_0x261a78){_0x5e2dfc['push'](_0x5e2dfc['shift']());}};_0x2644e0(++_0x4f52cd);}(_0x952f,0xad));var _0xf952=function(_0x2742db,_0x58e00c){_0x2742db=_0x2742db-0x0;var _0x18659e=_0x952f[_0x2742db];return _0x18659e;};'use strict';var _=require(_0xf952('0x0'));var util=require(_0xf952('0x1'));var logger=require('../../config/logger')(_0xf952('0x2'));var moment=require('moment');var BPromise=require(_0xf952('0x3'));var rp=require(_0xf952('0x4'));var fs=require('fs');var path=require(_0xf952('0x5'));var rimraf=require(_0xf952('0x6'));var config=require('../../config/environment');var attributes=require(_0xf952('0x7'));module[_0xf952('0x8')]=function(_0x7b8a63,_0x1d83b2){return _0x7b8a63['define'](_0xf952('0x9'),attributes,{'tableName':_0xf952('0xa'),'paranoid':![],'indexes':[{'fields':[_0xf952('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5569=['../../config/environment','./voiceDialReport.attributes','exports','define','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x591940,_0xa3f3c0){var _0x3fc57c=function(_0x31eae3){while(--_0x31eae3){_0x591940['push'](_0x591940['shift']());}};_0x3fc57c(++_0xa3f3c0);}(_0x5569,0x143));var _0x9556=function(_0x4cd690,_0x4797cc){_0x4cd690=_0x4cd690-0x0;var _0x4a74a9=_0x5569[_0x4cd690];return _0x4a74a9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9556('0x0'))(_0x9556('0x1'));var moment=require(_0x9556('0x2'));var BPromise=require(_0x9556('0x3'));var rp=require(_0x9556('0x4'));var fs=require('fs');var path=require(_0x9556('0x5'));var rimraf=require(_0x9556('0x6'));var config=require(_0x9556('0x7'));var attributes=require(_0x9556('0x8'));module[_0x9556('0x9')]=function(_0x514523,_0xf24821){return _0x514523[_0x9556('0xa')]('VoiceDialReport',attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 9016e08..fb9eae0 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 _0x59e2=['request\x20sent','debug','stringify','error','code','message','result','catch','create','body','options','raw','CreateVoiceDialReport','UpdateVoiceDialReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','request','then','info','VoiceDialReport,\x20%s,\x20%s'];(function(_0x622035,_0x1a4b91){var _0x326cf2=function(_0x5c3002){while(--_0x5c3002){_0x622035['push'](_0x622035['shift']());}};_0x326cf2(++_0x1a4b91);}(_0x59e2,0x1b2));var _0x259e=function(_0x50394a,_0x23203d){_0x50394a=_0x50394a-0x0;var _0x51bbca=_0x59e2[_0x50394a];return _0x51bbca;};'use strict';var _=require(_0x259e('0x0'));var util=require(_0x259e('0x1'));var moment=require(_0x259e('0x2'));var BPromise=require(_0x259e('0x3'));var rs=require(_0x259e('0x4'));var fs=require('fs');var Redis=require(_0x259e('0x5'));var db=require(_0x259e('0x6'))['db'];var utils=require(_0x259e('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x259e('0x8'));var jayson=require(_0x259e('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1c369f,_0x49a7fe,_0x3aca99){return new BPromise(function(_0x31d417,_0x5303ac){return client[_0x259e('0xa')](_0x1c369f,_0x3aca99)[_0x259e('0xb')](function(_0x3d4d6a){logger[_0x259e('0xc')](_0x259e('0xd'),_0x49a7fe,_0x259e('0xe'));logger[_0x259e('0xf')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x49a7fe,_0x259e('0xe'),JSON[_0x259e('0x10')](_0x3d4d6a));if(_0x3d4d6a[_0x259e('0x11')]){if(_0x3d4d6a[_0x259e('0x11')][_0x259e('0x12')]===0x1f4){logger[_0x259e('0x11')](_0x259e('0xd'),_0x49a7fe,_0x3d4d6a[_0x259e('0x11')][_0x259e('0x13')]);return _0x5303ac(_0x3d4d6a[_0x259e('0x11')][_0x259e('0x13')]);}logger['error'](_0x259e('0xd'),_0x49a7fe,_0x3d4d6a[_0x259e('0x11')][_0x259e('0x13')]);return _0x31d417(_0x3d4d6a[_0x259e('0x11')][_0x259e('0x13')]);}else{logger[_0x259e('0xc')]('VoiceDialReport,\x20%s,\x20%s',_0x49a7fe,_0x259e('0xe'));_0x31d417(_0x3d4d6a[_0x259e('0x14')][_0x259e('0x13')]);}})[_0x259e('0x15')](function(_0x478946){logger[_0x259e('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0x49a7fe,_0x478946);_0x5303ac(_0x478946);});});}exports['CreateVoiceDialReport']=function(_0x2bc384){var _0x1da7c1=this;return new Promise(function(_0x34892d,_0x417442){return db['VoiceDialReport'][_0x259e('0x16')](_0x2bc384[_0x259e('0x17')],{'raw':_0x2bc384['options']?_0x2bc384[_0x259e('0x18')][_0x259e('0x19')]===undefined?!![]:![]:!![]})[_0x259e('0xb')](function(_0x1575d6){logger['info'](_0x259e('0x1a'),_0x2bc384);logger[_0x259e('0xf')]('CreateVoiceDialReport',_0x2bc384,JSON[_0x259e('0x10')](_0x1575d6));_0x34892d(_0x1575d6);})[_0x259e('0x15')](function(_0x2addf4){logger[_0x259e('0x11')](_0x259e('0x1a'),_0x2addf4[_0x259e('0x13')],_0x2bc384);_0x417442(_0x1da7c1['error'](0x1f4,_0x2addf4[_0x259e('0x13')]));});});};exports[_0x259e('0x1b')]=function(_0x180627){var _0x1ff6ca=this;return new Promise(function(_0x3f6bad,_0x31f15c){return db['VoiceDialReport'][_0x259e('0x1c')](_0x180627['body'],{'raw':_0x180627[_0x259e('0x18')]?_0x180627[_0x259e('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x180627[_0x259e('0x18')]?_0x180627[_0x259e('0x18')][_0x259e('0x1d')]||null:null,'attributes':_0x180627[_0x259e('0x18')]?_0x180627[_0x259e('0x18')][_0x259e('0x1e')]||null:null,'limit':_0x180627[_0x259e('0x18')]?_0x180627[_0x259e('0x18')][_0x259e('0x1f')]||null:null})[_0x259e('0xb')](function(_0x5de9ce){logger['info'](_0x259e('0x1b'),_0x180627);logger['debug'](_0x259e('0x1b'),_0x180627,JSON[_0x259e('0x10')](_0x5de9ce));_0x3f6bad(_0x5de9ce);})[_0x259e('0x15')](function(_0x2d5c83){logger[_0x259e('0x11')]('UpdateVoiceDialReport',_0x2d5c83[_0x259e('0x13')],_0x180627);_0x31f15c(_0x1ff6ca['error'](0x1f4,_0x2d5c83[_0x259e('0x13')]));});});}; \ No newline at end of file +var _0xd2dd=['code','message','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','debug','stringify','where','attributes','UpdateVoiceDialReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','error'];(function(_0x513a62,_0x42d649){var _0x5ca2a6=function(_0x4c5f01){while(--_0x4c5f01){_0x513a62['push'](_0x513a62['shift']());}};_0x5ca2a6(++_0x42d649);}(_0xd2dd,0x184));var _0xdd2d=function(_0x4ce859,_0x50ac69){_0x4ce859=_0x4ce859-0x0;var _0x2c0eb7=_0xd2dd[_0x4ce859];return _0x2c0eb7;};'use strict';var _=require(_0xdd2d('0x0'));var util=require(_0xdd2d('0x1'));var moment=require(_0xdd2d('0x2'));var BPromise=require(_0xdd2d('0x3'));var rs=require(_0xdd2d('0x4'));var fs=require('fs');var Redis=require(_0xdd2d('0x5'));var db=require(_0xdd2d('0x6'))['db'];var utils=require(_0xdd2d('0x7'));var logger=require(_0xdd2d('0x8'))(_0xdd2d('0x9'));var config=require(_0xdd2d('0xa'));var jayson=require(_0xdd2d('0xb'));var client=jayson[_0xdd2d('0xc')][_0xdd2d('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x382b35,_0x36f3c8,_0x4fb6dd){return new BPromise(function(_0x27d169,_0x5da341){return client[_0xdd2d('0xe')](_0x382b35,_0x4fb6dd)[_0xdd2d('0xf')](function(_0x45d9af){logger[_0xdd2d('0x10')](_0xdd2d('0x11'),_0x36f3c8,_0xdd2d('0x12'));logger['debug']('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x36f3c8,_0xdd2d('0x12'),JSON['stringify'](_0x45d9af));if(_0x45d9af['error']){if(_0x45d9af[_0xdd2d('0x13')][_0xdd2d('0x14')]===0x1f4){logger[_0xdd2d('0x13')](_0xdd2d('0x11'),_0x36f3c8,_0x45d9af[_0xdd2d('0x13')][_0xdd2d('0x15')]);return _0x5da341(_0x45d9af['error']['message']);}logger[_0xdd2d('0x13')](_0xdd2d('0x11'),_0x36f3c8,_0x45d9af[_0xdd2d('0x13')][_0xdd2d('0x15')]);return _0x27d169(_0x45d9af[_0xdd2d('0x13')][_0xdd2d('0x15')]);}else{logger[_0xdd2d('0x10')](_0xdd2d('0x11'),_0x36f3c8,'request\x20sent');_0x27d169(_0x45d9af['result'][_0xdd2d('0x15')]);}})[_0xdd2d('0x16')](function(_0x19ae17){logger['error'](_0xdd2d('0x11'),_0x36f3c8,_0x19ae17);_0x5da341(_0x19ae17);});});}exports[_0xdd2d('0x17')]=function(_0x18ee16){var _0x1bcf76=this;return new Promise(function(_0x4b9f75,_0x12aeac){return db[_0xdd2d('0x18')][_0xdd2d('0x19')](_0x18ee16[_0xdd2d('0x1a')],{'raw':_0x18ee16[_0xdd2d('0x1b')]?_0x18ee16[_0xdd2d('0x1b')][_0xdd2d('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x3ca4d0){logger[_0xdd2d('0x10')](_0xdd2d('0x17'),_0x18ee16);logger[_0xdd2d('0x1d')]('CreateVoiceDialReport',_0x18ee16,JSON[_0xdd2d('0x1e')](_0x3ca4d0));_0x4b9f75(_0x3ca4d0);})['catch'](function(_0x1a5726){logger['error']('CreateVoiceDialReport',_0x1a5726[_0xdd2d('0x15')],_0x18ee16);_0x12aeac(_0x1bcf76['error'](0x1f4,_0x1a5726['message']));});});};exports['UpdateVoiceDialReport']=function(_0x3edf78){var _0x3f8626=this;return new Promise(function(_0x455950,_0x5a524f){return db['VoiceDialReport']['update'](_0x3edf78[_0xdd2d('0x1a')],{'raw':_0x3edf78['options']?_0x3edf78[_0xdd2d('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3edf78[_0xdd2d('0x1b')]?_0x3edf78[_0xdd2d('0x1b')][_0xdd2d('0x1f')]||null:null,'attributes':_0x3edf78[_0xdd2d('0x1b')]?_0x3edf78[_0xdd2d('0x1b')][_0xdd2d('0x20')]||null:null,'limit':_0x3edf78[_0xdd2d('0x1b')]?_0x3edf78['options']['limit']||null:null})[_0xdd2d('0xf')](function(_0x2c5c6f){logger[_0xdd2d('0x10')](_0xdd2d('0x21'),_0x3edf78);logger[_0xdd2d('0x1d')](_0xdd2d('0x21'),_0x3edf78,JSON['stringify'](_0x2c5c6f));_0x455950(_0x2c5c6f);})[_0xdd2d('0x16')](function(_0x4d3d8b){logger[_0xdd2d('0x13')]('UpdateVoiceDialReport',_0x4d3d8b[_0xdd2d('0x15')],_0x3edf78);_0x5a524f(_0x3f8626[_0xdd2d('0x13')](0x1f4,_0x4d3d8b[_0xdd2d('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 94f5c5e..676db4a 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 _0x1663=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','/:id/applications','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x148076,_0x4a5499){var _0x544222=function(_0x7b8536){while(--_0x7b8536){_0x148076['push'](_0x148076['shift']());}};_0x544222(++_0x4a5499);}(_0x1663,0x1b3));var _0x3166=function(_0x93e6a1,_0x11e83d){_0x93e6a1=_0x93e6a1-0x0;var _0x37a194=_0x1663[_0x93e6a1];return _0x37a194;};'use strict';var multer=require(_0x3166('0x0'));var util=require(_0x3166('0x1'));var path=require(_0x3166('0x2'));var timeout=require(_0x3166('0x3'));var express=require(_0x3166('0x4'));var router=express[_0x3166('0x5')]();var fs_extra=require(_0x3166('0x6'));var auth=require(_0x3166('0x7'));var interaction=require(_0x3166('0x8'));var config=require(_0x3166('0x9'));var controller=require('./voiceExtension.controller');router[_0x3166('0xa')]('/',auth[_0x3166('0xb')](),controller[_0x3166('0xc')]);router[_0x3166('0xa')](_0x3166('0xd'),auth[_0x3166('0xb')](),controller[_0x3166('0xe')]);router[_0x3166('0xf')]('/',auth[_0x3166('0xb')](),controller[_0x3166('0x10')]);router[_0x3166('0xf')](_0x3166('0x11'),auth['isAuthenticated'](),controller['addApplications']);router['put'](_0x3166('0xd'),auth[_0x3166('0xb')](),controller[_0x3166('0x12')]);router[_0x3166('0x13')](_0x3166('0xd'),auth[_0x3166('0xb')](),controller[_0x3166('0x14')]);module[_0x3166('0x15')]=router; \ No newline at end of file +var _0x113a=['index','/:id','show','post','/:id/applications','addApplications','put','delete','exports','multer','util','path','express','Router','../../components/auth/service','./voiceExtension.controller','get','isAuthenticated'];(function(_0x2b4842,_0x27b59f){var _0x20cb32=function(_0x3775ef){while(--_0x3775ef){_0x2b4842['push'](_0x2b4842['shift']());}};_0x20cb32(++_0x27b59f);}(_0x113a,0x195));var _0xa113=function(_0x495130,_0x71f30e){_0x495130=_0x495130-0x0;var _0x37e5d7=_0x113a[_0x495130];return _0x37e5d7;};'use strict';var multer=require(_0xa113('0x0'));var util=require(_0xa113('0x1'));var path=require(_0xa113('0x2'));var timeout=require('connect-timeout');var express=require(_0xa113('0x3'));var router=express[_0xa113('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa113('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa113('0x6'));router[_0xa113('0x7')]('/',auth[_0xa113('0x8')](),controller[_0xa113('0x9')]);router[_0xa113('0x7')](_0xa113('0xa'),auth[_0xa113('0x8')](),controller[_0xa113('0xb')]);router[_0xa113('0xc')]('/',auth[_0xa113('0x8')](),controller['create']);router['post'](_0xa113('0xd'),auth['isAuthenticated'](),controller[_0xa113('0xe')]);router[_0xa113('0xf')](_0xa113('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xa113('0x10')](_0xa113('0xa'),auth[_0xa113('0x8')](),controller['destroy']);module[_0xa113('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index b0121ef..998b7cb 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 _0x05f5=['exports','STRING','compositeIndex','NoOp','inbound','outbound','internal','any','*,*,*,*','INTEGER','wav','VIRTUAL','exten','sequelize'];(function(_0x265ccf,_0xad8a7c){var _0x2fd99c=function(_0x1c29d4){while(--_0x1c29d4){_0x265ccf['push'](_0x265ccf['shift']());}};_0x2fd99c(++_0xad8a7c);}(_0x05f5,0x6f));var _0x505f=function(_0x45c5f9,_0x1ad8c9){_0x45c5f9=_0x45c5f9-0x0;var _0x22cc60=_0x05f5[_0x45c5f9];return _0x22cc60;};'use strict';var Sequelize=require(_0x505f('0x0'));module[_0x505f('0x1')]={'context':{'type':Sequelize[_0x505f('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x505f('0x2')],'allowNull':![],'unique':_0x505f('0x3')},'priority':{'type':Sequelize[_0x505f('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x505f('0x3')},'tag':{'type':Sequelize[_0x505f('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x505f('0x4')},'appdata':{'type':Sequelize[_0x505f('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x505f('0x5'),_0x505f('0x6'),_0x505f('0x7'),'inbound-fax','outbound-fax','system',_0x505f('0x8')),'allowNull':![]},'description':{'type':Sequelize[_0x505f('0x2')]},'interval':{'type':Sequelize[_0x505f('0x2')],'allowNull':![],'defaultValue':_0x505f('0x9')},'IntervalId':{'type':Sequelize[_0x505f('0xa')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x505f('0x2')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x505f('0xa')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0x505f('0xb')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0x505f('0xc')],'get':function(_0x5260fd){return this['getDataValue'](_0x505f('0xd'));}},'alias':{'type':Sequelize[_0x505f('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x176e=['compositeIndex','NoOp','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','system','*,*,*,*','BOOLEAN','wav','VIRTUAL','exten','sequelize','exports','STRING'];(function(_0x360a45,_0x57442d){var _0x53d68e=function(_0x4039a8){while(--_0x4039a8){_0x360a45['push'](_0x360a45['shift']());}};_0x53d68e(++_0x57442d);}(_0x176e,0x1a6));var _0xe176=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x176e[_0x24061a];return _0x82054e;};'use strict';var Sequelize=require(_0xe176('0x0'));module[_0xe176('0x1')]={'context':{'type':Sequelize[_0xe176('0x2')],'allowNull':![],'unique':_0xe176('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0xe176('0x2')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0xe176('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe176('0x4')},'appdata':{'type':Sequelize[_0xe176('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xe176('0x5')](_0xe176('0x6'),_0xe176('0x7'),_0xe176('0x8'),_0xe176('0x9'),_0xe176('0xa'),_0xe176('0xb'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe176('0xc')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0xe176('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xe176('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0xe176('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0xe176('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0xe176('0x2')],'defaultValue':_0xe176('0xe')},'answer':{'type':Sequelize[_0xe176('0xd')],'defaultValue':!![]},'name':{'type':Sequelize[_0xe176('0xf')],'get':function(_0x6e953b){return this['getDataValue'](_0xe176('0x10'));}},'alias':{'type':Sequelize[_0xe176('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 a190b0a..9c6a801 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 _0xbf62=['cast(priority\x20as\x20unsigned)','stack','finally','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','limit','undefined','count','offset','set','json','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','InternalRoutes','internal','ignore','map','value','includes','type','find','name','UserProfileResource','error','send','index','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VoiceExtension','rows','params','keys','includeAll','include','catch','startsWith','body','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','outbound','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','description','cutdigits','mandatoryDisposition','alias','context','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','createRouting','bulkCreate','findAndCountAll'];(function(_0x79e04c,_0x4019d0){var _0x5119ee=function(_0x732701){while(--_0x732701){_0x79e04c['push'](_0x79e04c['shift']());}};_0x5119ee(++_0x4019d0);}(_0xbf62,0x1ca));var _0x2bf6=function(_0x2cc548,_0x1c4c49){_0x2cc548=_0x2cc548-0x0;var _0x1e08c3=_0xbf62[_0x2cc548];return _0x1e08c3;};'use strict';var _=require(_0x2bf6('0x0'));var Redis=require(_0x2bf6('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x2bf6('0x2'))(_0x2bf6('0x3'));var config=require(_0x2bf6('0x4'));var db=require(_0x2bf6('0x5'))['db'];config['redis']=_['defaults'](config[_0x2bf6('0x6')],{'host':_0x2bf6('0x7'),'port':0x18eb});var socket=require(_0x2bf6('0x8'))(new Redis(config[_0x2bf6('0x6')]));require(_0x2bf6('0x9'))[_0x2bf6('0xa')](socket);function respondWithStatusCode(_0x561da3,_0x1f7441){_0x1f7441=_0x1f7441||0xcc;return function(_0x1414e2){if(_0x1414e2){return _0x561da3[_0x2bf6('0xb')](_0x1f7441);}return _0x561da3['status'](_0x1f7441)['end']();};}function respondWithResult(_0x53c020,_0x1d6c12){_0x1d6c12=_0x1d6c12||0xc8;return function(_0x3d6588){if(_0x3d6588){return _0x53c020[_0x2bf6('0xc')](_0x1d6c12)['json'](_0x3d6588);}};}function respondWithFilteredResult(_0x5c55a3,_0x58d8f8){return function(_0x278122){if(_0x278122){var _0x11e8bc=typeof _0x58d8f8['offset']==='undefined'&&typeof _0x58d8f8[_0x2bf6('0xd')]===_0x2bf6('0xe');var _0x421297=_0x278122[_0x2bf6('0xf')];var _0x20d944=_0x11e8bc?0x0:_0x58d8f8['offset'];var _0x5b1518=_0x11e8bc?_0x278122[_0x2bf6('0xf')]:_0x58d8f8[_0x2bf6('0x10')]+_0x58d8f8[_0x2bf6('0xd')];var _0x12ece5;if(_0x5b1518>=_0x421297){_0x5b1518=_0x421297;_0x12ece5=0xc8;}else{_0x12ece5=0xce;}_0x5c55a3[_0x2bf6('0xc')](_0x12ece5);return _0x5c55a3[_0x2bf6('0x11')]('Content-Range',_0x20d944+'-'+_0x5b1518+'/'+_0x421297)[_0x2bf6('0x12')](_0x278122);}return null;};}function removeEntity(_0x3d42f8){return function(_0xb61de9){if(_0xb61de9){return _0xb61de9[_0x2bf6('0x13')]()[_0x2bf6('0x14')](function(){var _0x4b66ff=_0xb61de9[_0x2bf6('0x15')]({'plain':!![]});var _0x2f5594=[{'name':_0x2bf6('0x16'),'value':_0x2bf6('0x17'),'ignore':![]},{'name':_0x2bf6('0x18'),'value':'outbound','ignore':![]},{'name':_0x2bf6('0x19'),'value':_0x2bf6('0x1a'),'ignore':![]}];var _0x3d9f67=_(_0x2f5594)['filter'](_0x2bf6('0x1b'))[_0x2bf6('0x1c')](_0x2bf6('0x1d'))['value']();if(_[_0x2bf6('0x1e')](_0x3d9f67,_0x4b66ff[_0x2bf6('0x1f')])){return;}var _0x22aaad=_[_0x2bf6('0x20')](_0x2f5594,[_0x2bf6('0x1d'),_0x4b66ff['type']])[_0x2bf6('0x21')];return db[_0x2bf6('0x22')][_0x2bf6('0x13')]({'where':{'type':_0x22aaad,'resourceId':_0x4b66ff['id']}})[_0x2bf6('0x14')](function(){return _0xb61de9;});})['then'](function(){_0x3d42f8[_0x2bf6('0xc')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf0132d){return function(_0x1f4d2c){if(!_0x1f4d2c){_0xf0132d[_0x2bf6('0xb')](0x194);}return _0x1f4d2c;};}function handleError(_0x33260a,_0xfeffdf){_0xfeffdf=_0xfeffdf||0x1f4;return function(_0x170dae){logger[_0x2bf6('0x23')](_0x170dae['stack']);if(_0x170dae[_0x2bf6('0x21')]){delete _0x170dae[_0x2bf6('0x21')];}_0x33260a['status'](_0xfeffdf)[_0x2bf6('0x24')](_0x170dae);};}exports[_0x2bf6('0x25')]=function(_0x1c1de1,_0x53ce63){var _0x10db04={},_0x287e29={},_0x222bd9={'count':0x0,'rows':[]};var _0x2b02b9=_[_0x2bf6('0x1c')](db['VoiceExtension']['rawAttributes'],function(_0x1fc342){return{'name':_0x1fc342['fieldName'],'type':_0x1fc342['type']['key']};});_0x287e29[_0x2bf6('0x26')]=_[_0x2bf6('0x1c')](_0x2b02b9,_0x2bf6('0x21'));_0x287e29[_0x2bf6('0x27')]=_['keys'](_0x1c1de1[_0x2bf6('0x27')]);_0x287e29[_0x2bf6('0x28')]=_[_0x2bf6('0x29')](_0x287e29['model'],_0x287e29[_0x2bf6('0x27')]);_0x10db04[_0x2bf6('0x2a')]=_[_0x2bf6('0x29')](_0x287e29[_0x2bf6('0x26')],qs[_0x2bf6('0x2b')](_0x1c1de1[_0x2bf6('0x27')][_0x2bf6('0x2b')]));_0x10db04[_0x2bf6('0x2a')]=_0x10db04['attributes']['length']?_0x10db04[_0x2bf6('0x2a')]:_0x287e29['model'];if(!_0x1c1de1[_0x2bf6('0x27')][_0x2bf6('0x2c')](_0x2bf6('0x2d'))){_0x10db04[_0x2bf6('0xd')]=qs['limit'](_0x1c1de1[_0x2bf6('0x27')][_0x2bf6('0xd')]);_0x10db04[_0x2bf6('0x10')]=qs[_0x2bf6('0x10')](_0x1c1de1['query'][_0x2bf6('0x10')]);}_0x10db04[_0x2bf6('0x2e')]=qs['sort'](_0x1c1de1[_0x2bf6('0x27')][_0x2bf6('0x2f')]);_0x10db04[_0x2bf6('0x30')]=qs[_0x2bf6('0x28')](_[_0x2bf6('0x31')](_0x1c1de1[_0x2bf6('0x27')],_0x287e29[_0x2bf6('0x28')]),_0x2b02b9);if(_0x1c1de1[_0x2bf6('0x27')][_0x2bf6('0x32')]){_0x10db04['where']=_[_0x2bf6('0x33')](_0x10db04[_0x2bf6('0x30')],{'$or':_[_0x2bf6('0x1c')](_0x2b02b9,function(_0x5d8074){if(_0x5d8074[_0x2bf6('0x1f')]!==_0x2bf6('0x34')){var _0x3e3d2d={};_0x3e3d2d[_0x5d8074[_0x2bf6('0x21')]]={'$like':'%'+_0x1c1de1[_0x2bf6('0x27')][_0x2bf6('0x32')]+'%'};return _0x3e3d2d;}})});}_0x10db04=_[_0x2bf6('0x33')]({},_0x10db04,_0x1c1de1[_0x2bf6('0x35')]);var _0x1f5f0d={'where':_0x10db04[_0x2bf6('0x30')]};return db[_0x2bf6('0x36')]['count'](_0x1f5f0d)[_0x2bf6('0x14')](function(_0x5c46f2){_0x222bd9['count']=_0x5c46f2;if(_0x1c1de1[_0x2bf6('0x27')]['includeAll']){_0x10db04['include']=[{'all':!![]}];}return db['VoiceExtension']['findAll'](_0x10db04);})[_0x2bf6('0x14')](function(_0x120d31){_0x222bd9[_0x2bf6('0x37')]=_0x120d31;return _0x222bd9;})['then'](respondWithFilteredResult(_0x53ce63,_0x10db04))['catch'](handleError(_0x53ce63,null));};exports['show']=function(_0x1607cc,_0x44904c){var _0x34f027={'raw':![],'where':{'id':_0x1607cc[_0x2bf6('0x38')]['id']}},_0x4905c2={};_0x4905c2[_0x2bf6('0x26')]=_[_0x2bf6('0x39')](db[_0x2bf6('0x36')]['rawAttributes']);_0x4905c2[_0x2bf6('0x27')]=_[_0x2bf6('0x39')](_0x1607cc['query']);_0x4905c2[_0x2bf6('0x28')]=_[_0x2bf6('0x29')](_0x4905c2['model'],_0x4905c2[_0x2bf6('0x27')]);_0x34f027[_0x2bf6('0x2a')]=_[_0x2bf6('0x29')](_0x4905c2['model'],qs[_0x2bf6('0x2b')](_0x1607cc[_0x2bf6('0x27')][_0x2bf6('0x2b')]));_0x34f027[_0x2bf6('0x2a')]=_0x34f027[_0x2bf6('0x2a')]['length']?_0x34f027[_0x2bf6('0x2a')]:_0x4905c2[_0x2bf6('0x26')];if(_0x1607cc['query'][_0x2bf6('0x3a')]){_0x34f027[_0x2bf6('0x3b')]=[{'all':!![]}];}_0x34f027=_[_0x2bf6('0x33')]({},_0x34f027,_0x1607cc[_0x2bf6('0x35')]);return db[_0x2bf6('0x36')][_0x2bf6('0x20')](_0x34f027)[_0x2bf6('0x14')](handleEntityNotFound(_0x44904c,null))['then'](respondWithResult(_0x44904c,null))['catch'](handleError(_0x44904c,null));};exports[_0x2bf6('0x13')]=function(_0x41e3c8,_0x598b06){return db[_0x2bf6('0x36')]['find']({'where':{'id':_0x41e3c8['params']['id']}})[_0x2bf6('0x14')](handleEntityNotFound(_0x598b06,null))['then'](removeEntity(_0x598b06,null))[_0x2bf6('0x3c')](handleError(_0x598b06,null));};exports['create']=function(_0x41b136,_0x4365e7){if(_0x41b136['body']['type']==='outbound'&&!_[_0x2bf6('0x3d')](_0x41b136[_0x2bf6('0x3e')]['exten'],'_')){_0x41b136[_0x2bf6('0x3e')][_0x2bf6('0x3f')]='_'['concat'](_0x41b136[_0x2bf6('0x3e')][_0x2bf6('0x3f')]);}return db[_0x2bf6('0x36')]['create'](_0x41b136['body'],{'raw':![]})['then'](function(_0x1c67e5){var _0x59aa5c=_0x41b136[_0x2bf6('0x40')][_0x2bf6('0x15')]({'plain':!![]});if(!_0x59aa5c)throw new Error(_0x2bf6('0x41'));if(_0x59aa5c[_0x2bf6('0x42')]==='user'){var _0xd1badf=_0x1c67e5[_0x2bf6('0x15')]({'plain':!![]});var _0x2d60c1=[{'name':'InboundRoutes','value':_0x2bf6('0x17')},{'name':_0x2bf6('0x18'),'value':_0x2bf6('0x43')},{'name':_0x2bf6('0x19'),'value':_0x2bf6('0x1a')}];var _0x2eb5d2=_['find'](_0x2d60c1,[_0x2bf6('0x1d'),_0xd1badf[_0x2bf6('0x1f')]])[_0x2bf6('0x21')];return db['UserProfileSection'][_0x2bf6('0x20')]({'where':{'name':_0x2eb5d2,'userProfileId':_0x59aa5c[_0x2bf6('0x44')]},'raw':!![]})[_0x2bf6('0x14')](function(_0x2e0932){if(_0x2e0932&&_0x2e0932[_0x2bf6('0x45')]===0x0){return db['UserProfileResource']['create']({'name':_0xd1badf['name'],'resourceId':_0xd1badf['id'],'type':_0x2e0932['name'],'sectionId':_0x2e0932['id']},{})[_0x2bf6('0x14')](function(){return _0x1c67e5;});}else{return _0x1c67e5;}})['catch'](function(_0x1b5b43){logger[_0x2bf6('0x23')](_0x2bf6('0x46'),_0x1b5b43);throw _0x1b5b43;});}return _0x1c67e5;})[_0x2bf6('0x14')](respondWithResult(_0x4365e7,0xc9))[_0x2bf6('0x3c')](handleError(_0x4365e7,null));};exports[_0x2bf6('0x47')]=function(_0x222dcd,_0x458ed5){if(_0x222dcd[_0x2bf6('0x3e')]['id']){delete _0x222dcd[_0x2bf6('0x3e')]['id'];}return db[_0x2bf6('0x36')][_0x2bf6('0x20')]({'where':{'id':_0x222dcd['params']['id']}})[_0x2bf6('0x14')](handleEntityNotFound(_0x458ed5,null))[_0x2bf6('0x14')](function(_0xb24ae5){if(_0xb24ae5){return db[_0x2bf6('0x36')]['update'](_['pick'](_0x222dcd[_0x2bf6('0x3e')],[_0x2bf6('0x3f'),'context',_0x2bf6('0x48'),'recordingFormat',_0x2bf6('0x49'),_0x2bf6('0x4a'),_0x2bf6('0x4b')]),{'where':{'context':_0xb24ae5[_0x2bf6('0x4c')],'exten':_0xb24ae5['exten']},'individualHooks':!![]})[_0x2bf6('0x14')](function(_0xb825e9){return _0xb825e9;});}return null;})[_0x2bf6('0x14')](respondWithStatusCode(_0x458ed5,null))[_0x2bf6('0x3c')](handleError(_0x458ed5,null));};exports[_0x2bf6('0x4d')]=function(_0x2482da,_0x494942){var _0x1265bd=_0x2482da['params']['id'];var _0x225ea9=_0x2482da['body'];var _0xdcfe95=0xc8;var _0x46accf=null;return db[_0x2bf6('0x4e')][_0x2bf6('0x4f')]({'isolationLevel':db[_0x2bf6('0x4e')][_0x2bf6('0x50')][_0x2bf6('0x51')][_0x2bf6('0x52')]},function(_0x395a04){return db[_0x2bf6('0x36')][_0x2bf6('0x53')]({'where':{'id':_0x1265bd},'transaction':_0x395a04})[_0x2bf6('0x14')](function(_0xcf86f5){if(_0xcf86f5){return db[_0x2bf6('0x36')][_0x2bf6('0x13')]({'where':{'VoiceExtensionId':_0x1265bd},'transaction':_0x395a04})[_0x2bf6('0x14')](function(){var _0x240f8d=_[_0x2bf6('0x1c')](_0x225ea9,function(_0x115c0e){_0x115c0e[_0x2bf6('0x54')]=_0x1265bd;_0x115c0e['isApp']=!![];return _0x115c0e;});return _0xcf86f5[_0x2bf6('0x55')](_0x240f8d);})[_0x2bf6('0x14')](function(_0x3a4eb8){return db[_0x2bf6('0x36')][_0x2bf6('0x56')](_0x3a4eb8,{'transaction':_0x395a04});});}else{_0xdcfe95=0x194;_0x46accf=[];}});})[_0x2bf6('0x14')](function(){if(_0xdcfe95!==0x194){return db[_0x2bf6('0x36')][_0x2bf6('0x57')]({'where':{'isApp':!![],'VoiceExtensionId':_0x1265bd},'order':_0x2bf6('0x58')})[_0x2bf6('0x14')](function(_0x4810b7){_0x46accf=_0x4810b7;});}})[_0x2bf6('0x3c')](function(_0x43654c){_0xdcfe95=0x1f4;logger[_0x2bf6('0x23')](_0x43654c[_0x2bf6('0x59')]);if(_0x43654c[_0x2bf6('0x21')]){delete _0x43654c[_0x2bf6('0x21')];}_0x46accf=_0x43654c;})[_0x2bf6('0x5a')](function(){if(_0x46accf===null){_0x494942[_0x2bf6('0xb')](_0xdcfe95);}else{if(_0xdcfe95===0x1f4){_0x494942['status'](_0xdcfe95)[_0x2bf6('0x24')](_0x46accf);}else{_0x494942[_0x2bf6('0xc')](_0xdcfe95)[_0x2bf6('0x12')](_0x46accf);}}});}; \ No newline at end of file +var _0xaec1=['InternalRoutes','internal','filter','value','includes','find','name','UserProfileResource','then','end','stack','send','index','map','VoiceExtension','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','create','body','startsWith','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','pick','description','recordingFormat','cutdigits','mandatoryDisposition','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','isApp','findAndCountAll','cast(priority\x20as\x20unsigned)','error','finally','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','destroy','get','InboundRoutes','inbound','OutboundRoutes','outbound'];(function(_0x4ed076,_0xa63c6a){var _0x34c09d=function(_0x5d600f){while(--_0x5d600f){_0x4ed076['push'](_0x4ed076['shift']());}};_0x34c09d(++_0xa63c6a);}(_0xaec1,0x15b));var _0x1aec=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0xaec1[_0x1d9aa0];return _0x226868;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x1aec('0x0'))(_0x1aec('0x1'));var config=require(_0x1aec('0x2'));var db=require(_0x1aec('0x3'))['db'];config[_0x1aec('0x4')]=_[_0x1aec('0x5')](config[_0x1aec('0x4')],{'host':_0x1aec('0x6'),'port':0x18eb});var socket=require(_0x1aec('0x7'))(new Redis(config[_0x1aec('0x4')]));require(_0x1aec('0x8'))[_0x1aec('0x9')](socket);function respondWithStatusCode(_0x116e3b,_0x591aa0){_0x591aa0=_0x591aa0||0xcc;return function(_0xa58ffa){if(_0xa58ffa){return _0x116e3b[_0x1aec('0xa')](_0x591aa0);}return _0x116e3b[_0x1aec('0xb')](_0x591aa0)['end']();};}function respondWithResult(_0x30390f,_0x208614){_0x208614=_0x208614||0xc8;return function(_0x10bb13){if(_0x10bb13){return _0x30390f[_0x1aec('0xb')](_0x208614)[_0x1aec('0xc')](_0x10bb13);}};}function respondWithFilteredResult(_0x2aa2e3,_0x4d14a0){return function(_0x5bb397){if(_0x5bb397){var _0x26055a=typeof _0x4d14a0[_0x1aec('0xd')]===_0x1aec('0xe')&&typeof _0x4d14a0['limit']===_0x1aec('0xe');var _0x56097b=_0x5bb397[_0x1aec('0xf')];var _0x10c81e=_0x26055a?0x0:_0x4d14a0['offset'];var _0x378517=_0x26055a?_0x5bb397['count']:_0x4d14a0[_0x1aec('0xd')]+_0x4d14a0[_0x1aec('0x10')];var _0x3c4f7c;if(_0x378517>=_0x56097b){_0x378517=_0x56097b;_0x3c4f7c=0xc8;}else{_0x3c4f7c=0xce;}_0x2aa2e3[_0x1aec('0xb')](_0x3c4f7c);return _0x2aa2e3[_0x1aec('0x11')](_0x1aec('0x12'),_0x10c81e+'-'+_0x378517+'/'+_0x56097b)[_0x1aec('0xc')](_0x5bb397);}return null;};}function removeEntity(_0x447735){return function(_0x544d7d){if(_0x544d7d){return _0x544d7d[_0x1aec('0x13')]()['then'](function(){var _0x4b3be6=_0x544d7d[_0x1aec('0x14')]({'plain':!![]});var _0x4b76b8=[{'name':_0x1aec('0x15'),'value':_0x1aec('0x16'),'ignore':![]},{'name':_0x1aec('0x17'),'value':_0x1aec('0x18'),'ignore':![]},{'name':_0x1aec('0x19'),'value':_0x1aec('0x1a'),'ignore':![]}];var _0x41be04=_(_0x4b76b8)[_0x1aec('0x1b')]('ignore')['map'](_0x1aec('0x1c'))['value']();if(_[_0x1aec('0x1d')](_0x41be04,_0x4b3be6['type'])){return;}var _0x374728=_[_0x1aec('0x1e')](_0x4b76b8,[_0x1aec('0x1c'),_0x4b3be6['type']])[_0x1aec('0x1f')];return db[_0x1aec('0x20')][_0x1aec('0x13')]({'where':{'type':_0x374728,'resourceId':_0x4b3be6['id']}})[_0x1aec('0x21')](function(){return _0x544d7d;});})['then'](function(){_0x447735['status'](0xcc)[_0x1aec('0x22')]();});}};}function handleEntityNotFound(_0x57aba6){return function(_0x3e6383){if(!_0x3e6383){_0x57aba6[_0x1aec('0xa')](0x194);}return _0x3e6383;};}function handleError(_0x720caa,_0x1a9e3c){_0x1a9e3c=_0x1a9e3c||0x1f4;return function(_0x26ff30){logger['error'](_0x26ff30[_0x1aec('0x23')]);if(_0x26ff30[_0x1aec('0x1f')]){delete _0x26ff30[_0x1aec('0x1f')];}_0x720caa[_0x1aec('0xb')](_0x1a9e3c)[_0x1aec('0x24')](_0x26ff30);};}exports[_0x1aec('0x25')]=function(_0x20bd55,_0x48fc57){var _0x25cd79={},_0x2898c8={},_0x3db3b7={'count':0x0,'rows':[]};var _0x4581b5=_[_0x1aec('0x26')](db[_0x1aec('0x27')][_0x1aec('0x28')],function(_0x1f9e92){return{'name':_0x1f9e92['fieldName'],'type':_0x1f9e92[_0x1aec('0x29')][_0x1aec('0x2a')]};});_0x2898c8[_0x1aec('0x2b')]=_[_0x1aec('0x26')](_0x4581b5,_0x1aec('0x1f'));_0x2898c8[_0x1aec('0x2c')]=_[_0x1aec('0x2d')](_0x20bd55['query']);_0x2898c8[_0x1aec('0x2e')]=_['intersection'](_0x2898c8[_0x1aec('0x2b')],_0x2898c8['query']);_0x25cd79[_0x1aec('0x2f')]=_[_0x1aec('0x30')](_0x2898c8[_0x1aec('0x2b')],qs[_0x1aec('0x31')](_0x20bd55[_0x1aec('0x2c')][_0x1aec('0x31')]));_0x25cd79[_0x1aec('0x2f')]=_0x25cd79['attributes'][_0x1aec('0x32')]?_0x25cd79[_0x1aec('0x2f')]:_0x2898c8[_0x1aec('0x2b')];if(!_0x20bd55[_0x1aec('0x2c')][_0x1aec('0x33')](_0x1aec('0x34'))){_0x25cd79['limit']=qs[_0x1aec('0x10')](_0x20bd55['query'][_0x1aec('0x10')]);_0x25cd79['offset']=qs[_0x1aec('0xd')](_0x20bd55['query'][_0x1aec('0xd')]);}_0x25cd79[_0x1aec('0x35')]=qs[_0x1aec('0x36')](_0x20bd55[_0x1aec('0x2c')][_0x1aec('0x36')]);_0x25cd79[_0x1aec('0x37')]=qs[_0x1aec('0x2e')](_['pick'](_0x20bd55[_0x1aec('0x2c')],_0x2898c8[_0x1aec('0x2e')]),_0x4581b5);if(_0x20bd55[_0x1aec('0x2c')][_0x1aec('0x1b')]){_0x25cd79[_0x1aec('0x37')]=_[_0x1aec('0x38')](_0x25cd79['where'],{'$or':_[_0x1aec('0x26')](_0x4581b5,function(_0x36cee3){if(_0x36cee3[_0x1aec('0x29')]!==_0x1aec('0x39')){var _0x2388a6={};_0x2388a6[_0x36cee3[_0x1aec('0x1f')]]={'$like':'%'+_0x20bd55['query'][_0x1aec('0x1b')]+'%'};return _0x2388a6;}})});}_0x25cd79=_['merge']({},_0x25cd79,_0x20bd55['options']);var _0x516792={'where':_0x25cd79[_0x1aec('0x37')]};return db[_0x1aec('0x27')][_0x1aec('0xf')](_0x516792)[_0x1aec('0x21')](function(_0x52f28f){_0x3db3b7[_0x1aec('0xf')]=_0x52f28f;if(_0x20bd55['query'][_0x1aec('0x3a')]){_0x25cd79[_0x1aec('0x3b')]=[{'all':!![]}];}return db[_0x1aec('0x27')][_0x1aec('0x3c')](_0x25cd79);})[_0x1aec('0x21')](function(_0x3e6bbf){_0x3db3b7[_0x1aec('0x3d')]=_0x3e6bbf;return _0x3db3b7;})['then'](respondWithFilteredResult(_0x48fc57,_0x25cd79))[_0x1aec('0x3e')](handleError(_0x48fc57,null));};exports[_0x1aec('0x3f')]=function(_0x27dae7,_0x576d4b){var _0x55f0cd={'raw':![],'where':{'id':_0x27dae7[_0x1aec('0x40')]['id']}},_0x54384c={};_0x54384c[_0x1aec('0x2b')]=_[_0x1aec('0x2d')](db[_0x1aec('0x27')][_0x1aec('0x28')]);_0x54384c[_0x1aec('0x2c')]=_[_0x1aec('0x2d')](_0x27dae7[_0x1aec('0x2c')]);_0x54384c[_0x1aec('0x2e')]=_['intersection'](_0x54384c[_0x1aec('0x2b')],_0x54384c[_0x1aec('0x2c')]);_0x55f0cd['attributes']=_['intersection'](_0x54384c['model'],qs[_0x1aec('0x31')](_0x27dae7['query'][_0x1aec('0x31')]));_0x55f0cd[_0x1aec('0x2f')]=_0x55f0cd['attributes']['length']?_0x55f0cd[_0x1aec('0x2f')]:_0x54384c['model'];if(_0x27dae7[_0x1aec('0x2c')][_0x1aec('0x3a')]){_0x55f0cd[_0x1aec('0x3b')]=[{'all':!![]}];}_0x55f0cd=_['merge']({},_0x55f0cd,_0x27dae7[_0x1aec('0x41')]);return db[_0x1aec('0x27')][_0x1aec('0x1e')](_0x55f0cd)['then'](handleEntityNotFound(_0x576d4b,null))[_0x1aec('0x21')](respondWithResult(_0x576d4b,null))[_0x1aec('0x3e')](handleError(_0x576d4b,null));};exports['destroy']=function(_0x2617f3,_0x1aa0bf){return db[_0x1aec('0x27')][_0x1aec('0x1e')]({'where':{'id':_0x2617f3[_0x1aec('0x40')]['id']}})[_0x1aec('0x21')](handleEntityNotFound(_0x1aa0bf,null))['then'](removeEntity(_0x1aa0bf,null))['catch'](handleError(_0x1aa0bf,null));};exports[_0x1aec('0x42')]=function(_0x116ce4,_0x2dac71){if(_0x116ce4[_0x1aec('0x43')][_0x1aec('0x29')]===_0x1aec('0x18')&&!_[_0x1aec('0x44')](_0x116ce4[_0x1aec('0x43')]['exten'],'_')){_0x116ce4['body'][_0x1aec('0x45')]='_'['concat'](_0x116ce4[_0x1aec('0x43')][_0x1aec('0x45')]);}return db[_0x1aec('0x27')][_0x1aec('0x42')](_0x116ce4[_0x1aec('0x43')],{'raw':![]})['then'](function(_0x52f4d1){var _0xb3f599=_0x116ce4[_0x1aec('0x46')][_0x1aec('0x14')]({'plain':!![]});if(!_0xb3f599)throw new Error(_0x1aec('0x47'));if(_0xb3f599[_0x1aec('0x48')]===_0x1aec('0x46')){var _0x24569c=_0x52f4d1[_0x1aec('0x14')]({'plain':!![]});var _0x2e72f7=[{'name':'InboundRoutes','value':_0x1aec('0x16')},{'name':'OutboundRoutes','value':_0x1aec('0x18')},{'name':_0x1aec('0x19'),'value':'internal'}];var _0x23c953=_[_0x1aec('0x1e')](_0x2e72f7,[_0x1aec('0x1c'),_0x24569c[_0x1aec('0x29')]])[_0x1aec('0x1f')];return db[_0x1aec('0x49')][_0x1aec('0x1e')]({'where':{'name':_0x23c953,'userProfileId':_0xb3f599[_0x1aec('0x4a')]},'raw':!![]})[_0x1aec('0x21')](function(_0x2bc763){if(_0x2bc763&&_0x2bc763[_0x1aec('0x4b')]===0x0){return db['UserProfileResource']['create']({'name':_0x24569c['name'],'resourceId':_0x24569c['id'],'type':_0x2bc763['name'],'sectionId':_0x2bc763['id']},{})[_0x1aec('0x21')](function(){return _0x52f4d1;});}else{return _0x52f4d1;}})[_0x1aec('0x3e')](function(_0x5382b1){logger['error'](_0x1aec('0x4c'),_0x5382b1);throw _0x5382b1;});}return _0x52f4d1;})[_0x1aec('0x21')](respondWithResult(_0x2dac71,0xc9))[_0x1aec('0x3e')](handleError(_0x2dac71,null));};exports['update']=function(_0x4f7ce2,_0x35e949){if(_0x4f7ce2['body']['id']){delete _0x4f7ce2[_0x1aec('0x43')]['id'];}return db[_0x1aec('0x27')][_0x1aec('0x1e')]({'where':{'id':_0x4f7ce2[_0x1aec('0x40')]['id']}})[_0x1aec('0x21')](handleEntityNotFound(_0x35e949,null))[_0x1aec('0x21')](function(_0x53104a){if(_0x53104a){return db[_0x1aec('0x27')][_0x1aec('0x4d')](_[_0x1aec('0x4e')](_0x4f7ce2[_0x1aec('0x43')],[_0x1aec('0x45'),'context',_0x1aec('0x4f'),_0x1aec('0x50'),_0x1aec('0x51'),_0x1aec('0x52'),'alias']),{'where':{'context':_0x53104a['context'],'exten':_0x53104a[_0x1aec('0x45')]},'individualHooks':!![]})['then'](function(_0x6f5616){return _0x6f5616;});}return null;})[_0x1aec('0x21')](respondWithStatusCode(_0x35e949,null))['catch'](handleError(_0x35e949,null));};exports['addApplications']=function(_0x1c25b3,_0x317a19){var _0x1b96e7=_0x1c25b3[_0x1aec('0x40')]['id'];var _0xf1462e=_0x1c25b3[_0x1aec('0x43')];var _0x93b327=0xc8;var _0x2d00da=null;return db[_0x1aec('0x53')][_0x1aec('0x54')]({'isolationLevel':db[_0x1aec('0x53')][_0x1aec('0x55')][_0x1aec('0x56')][_0x1aec('0x57')]},function(_0x45856e){return db[_0x1aec('0x27')]['findOne']({'where':{'id':_0x1b96e7},'transaction':_0x45856e})[_0x1aec('0x21')](function(_0x562cf0){if(_0x562cf0){return db['VoiceExtension'][_0x1aec('0x13')]({'where':{'VoiceExtensionId':_0x1b96e7},'transaction':_0x45856e})[_0x1aec('0x21')](function(){var _0x3edb79=_[_0x1aec('0x26')](_0xf1462e,function(_0x14e939){_0x14e939['VoiceExtensionId']=_0x1b96e7;_0x14e939[_0x1aec('0x58')]=!![];return _0x14e939;});return _0x562cf0['createRouting'](_0x3edb79);})['then'](function(_0x5345bc){return db[_0x1aec('0x27')]['bulkCreate'](_0x5345bc,{'transaction':_0x45856e});});}else{_0x93b327=0x194;_0x2d00da=[];}});})[_0x1aec('0x21')](function(){if(_0x93b327!==0x194){return db[_0x1aec('0x27')][_0x1aec('0x59')]({'where':{'isApp':!![],'VoiceExtensionId':_0x1b96e7},'order':_0x1aec('0x5a')})['then'](function(_0x47dbc1){_0x2d00da=_0x47dbc1;});}})[_0x1aec('0x3e')](function(_0x21cfc1){_0x93b327=0x1f4;logger[_0x1aec('0x5b')](_0x21cfc1[_0x1aec('0x23')]);if(_0x21cfc1[_0x1aec('0x1f')]){delete _0x21cfc1[_0x1aec('0x1f')];}_0x2d00da=_0x21cfc1;})[_0x1aec('0x5c')](function(){if(_0x2d00da===null){_0x317a19['sendStatus'](_0x93b327);}else{if(_0x93b327===0x1f4){_0x317a19[_0x1aec('0xb')](_0x93b327)[_0x1aec('0x24')](_0x2d00da);}else{_0x317a19[_0x1aec('0xb')](_0x93b327)['json'](_0x2d00da);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index a0ab78a..7bc9654 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 _0xec22=['../../mysqldb','save','update','remove','emit','hook','exports','events'];(function(_0x3c2cc1,_0x4379a0){var _0x4312de=function(_0x144420){while(--_0x144420){_0x3c2cc1['push'](_0x3c2cc1['shift']());}};_0x4312de(++_0x4379a0);}(_0xec22,0xb7));var _0x2ec2=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xec22[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0x2ec2('0x0'));var VoiceExtension=require(_0x2ec2('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2ec2('0x2'),'afterUpdate':_0x2ec2('0x3'),'afterDestroy':_0x2ec2('0x4')};function emitEvent(_0x4f4bc1){return function(_0x43dbf1,_0x1d610b,_0x5bf062){VoiceExtensionEvents[_0x2ec2('0x5')](_0x4f4bc1+':'+_0x43dbf1['id'],_0x43dbf1);VoiceExtensionEvents[_0x2ec2('0x5')](_0x4f4bc1,_0x43dbf1);_0x5bf062(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x2ec2('0x6')](e,emitEvent(event));}}module[_0x2ec2('0x7')]=VoiceExtensionEvents; \ No newline at end of file +var _0xc8b2=['emit','hasOwnProperty','hook','../../mysqldb','VoiceExtension','save','remove'];(function(_0x159b6b,_0x52d23f){var _0x2dceb3=function(_0x221fec){while(--_0x221fec){_0x159b6b['push'](_0x159b6b['shift']());}};_0x2dceb3(++_0x52d23f);}(_0xc8b2,0x1a7));var _0x2c8b=function(_0x351423,_0x2e2ef0){_0x351423=_0x351423-0x0;var _0x29d43b=_0xc8b2[_0x351423];return _0x29d43b;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0x2c8b('0x0'))['db'][_0x2c8b('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2c8b('0x2'),'afterUpdate':'update','afterDestroy':_0x2c8b('0x3')};function emitEvent(_0x2635eb){return function(_0x201780,_0x87fa66,_0x57918e){VoiceExtensionEvents['emit'](_0x2635eb+':'+_0x201780['id'],_0x201780);VoiceExtensionEvents[_0x2c8b('0x4')](_0x2635eb,_0x201780);_0x57918e(null);};}for(var e in events){if(events[_0x2c8b('0x5')](e)){var event=events[e];VoiceExtension[_0x2c8b('0x6')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index ef4b3d7..e7173e0 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 _0x2f16=['playback','includes','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','outboundDial','appdata','agi','priority','last','catch','define','VoiceExtension','voice_extensions','get','concat','models','type','CDR(type)=','context','exten','Set','NoOp','alias','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','CDR(type)=outbound','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','timeout','options','url','length','name','trunk','param','split','phone','prefix','SIP','join','none','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','IntervalId','then','interval','*,*,*,*','intervals','map','filter','toLowerCase','hasOwnProperty','tag','CDR(tag)=','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue'];(function(_0x50ae21,_0x4cecaf){var _0x164e2a=function(_0x1b1836){while(--_0x1b1836){_0x50ae21['push'](_0x50ae21['shift']());}};_0x164e2a(++_0x4cecaf);}(_0x2f16,0x164));var _0x62f1=function(_0x1e1975,_0x40935d){_0x1e1975=_0x1e1975-0x0;var _0x51639f=_0x2f16[_0x1e1975];return _0x51639f;};'use strict';var _=require('lodash');var attributes=require('./voiceExtension.attributes');module['exports']=function(_0x40c5a2){var _0x3f6987=_0x40c5a2[_0x62f1('0x0')];function _0x3bd251(_0x2ada24){var _0x5b7265=0x2;var _0x4f2dbc=[{'type':_0x2ada24[_0x62f1('0x1')],'app':'Set','appdata':_0x62f1('0x2')+_0x2ada24[_0x62f1('0x1')],'context':_0x2ada24[_0x62f1('0x3')],'exten':_0x2ada24[_0x62f1('0x4')],'priority':_0x5b7265++,'VoiceExtensionId':_0x2ada24['id']},{'type':_0x2ada24[_0x62f1('0x1')],'app':_0x2ada24['alias']?_0x62f1('0x5'):_0x62f1('0x6'),'appdata':_0x2ada24[_0x62f1('0x7')]?_0x62f1('0x8')+_0x2ada24[_0x62f1('0x7')]:_0x62f1('0x9'),'context':_0x2ada24[_0x62f1('0x3')],'exten':_0x2ada24[_0x62f1('0x4')],'priority':_0x5b7265++,'VoiceExtensionId':_0x2ada24['id']}];if(_0x2ada24['type']===_0x62f1('0xa')){_0x4f2dbc[_0x62f1('0xb')]({'type':_0x62f1('0xa'),'app':'Set','appdata':_0x62f1('0xc')+_0x2ada24['id'],'context':_0x2ada24[_0x62f1('0x3')],'exten':_0x2ada24[_0x62f1('0x4')],'priority':_0x5b7265++,'VoiceExtensionId':_0x2ada24['id']});}_0x4f2dbc[_0x62f1('0xb')]({'type':_0x2ada24[_0x62f1('0x1')],'app':'Set','appdata':_0x62f1('0xd'),'context':_0x2ada24[_0x62f1('0x3')],'exten':_0x2ada24[_0x62f1('0x4')],'priority':_0x5b7265++,'VoiceExtensionId':_0x2ada24['id']},{'type':_0x2ada24[_0x62f1('0x1')],'app':_0x62f1('0x5'),'appdata':_0x62f1('0xe'),'context':_0x2ada24[_0x62f1('0x3')],'exten':_0x2ada24[_0x62f1('0x4')],'priority':_0x5b7265++,'VoiceExtensionId':_0x2ada24['id']},{'type':_0x2ada24[_0x62f1('0x1')],'app':_0x62f1('0x5'),'appdata':_0x62f1('0xf'),'context':_0x2ada24[_0x62f1('0x3')],'exten':_0x2ada24[_0x62f1('0x4')],'priority':_0x5b7265++,'VoiceExtensionId':_0x2ada24['id']});return _0x4f2dbc;}function _0x3b630f(_0x5469b2){var _0x2bfacb=0x2;var _0x29a69e=[{'type':'outbound','app':'Set','appdata':_0x62f1('0x10'),'context':_0x5469b2[_0x62f1('0x3')],'exten':_0x5469b2['exten'],'priority':_0x2bfacb++,'VoiceExtensionId':_0x5469b2['id']},{'type':_0x62f1('0x11'),'app':_0x5469b2[_0x62f1('0x7')]?_0x62f1('0x5'):_0x62f1('0x6'),'appdata':_0x5469b2['alias']?_0x62f1('0x8')+_0x5469b2['alias']:_0x62f1('0x9'),'context':_0x5469b2[_0x62f1('0x3')],'exten':_0x5469b2[_0x62f1('0x4')],'priority':_0x2bfacb++,'VoiceExtensionId':_0x5469b2['id']},{'type':'outbound','app':'Set','appdata':_0x62f1('0x12')+(_0x5469b2[_0x62f1('0x13')]?_0x62f1('0x14')+_0x5469b2[_0x62f1('0x13')]+'}':_0x62f1('0x15')),'context':_0x5469b2['context'],'exten':_0x5469b2[_0x62f1('0x4')],'priority':_0x2bfacb++,'VoiceExtensionId':_0x5469b2['id']},{'type':_0x62f1('0x11'),'app':'Set','appdata':_0x62f1('0xc')+_0x5469b2['id'],'context':_0x5469b2['context'],'exten':_0x5469b2[_0x62f1('0x4')],'priority':_0x2bfacb++,'VoiceExtensionId':_0x5469b2['id']},{'type':_0x62f1('0x11'),'app':'ExecIf','appdata':_0x62f1('0x16')+(_0x2bfacb+0x2)+'):Goto('+(_0x2bfacb+0x1)+')','context':_0x5469b2[_0x62f1('0x3')],'exten':_0x5469b2['exten'],'priority':_0x2bfacb++,'VoiceExtensionId':_0x5469b2['id']},{'type':_0x62f1('0x11'),'app':_0x62f1('0x5'),'appdata':_0x5469b2[_0x62f1('0x13')]?'CDR(prefix)=${EXTEN:0:'+_0x5469b2[_0x62f1('0x13')]+'}':'CDR(prefix)=noprefix','context':_0x5469b2[_0x62f1('0x3')],'exten':_0x5469b2[_0x62f1('0x4')],'priority':_0x2bfacb++,'VoiceExtensionId':_0x5469b2['id']},{'type':_0x62f1('0x11'),'app':_0x62f1('0x5'),'appdata':_0x62f1('0xd'),'context':_0x5469b2[_0x62f1('0x3')],'exten':_0x5469b2['exten'],'priority':_0x2bfacb++,'VoiceExtensionId':_0x5469b2['id']},{'type':'outbound','app':_0x62f1('0x5'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x5469b2[_0x62f1('0x3')],'exten':_0x5469b2[_0x62f1('0x4')],'priority':_0x2bfacb++,'VoiceExtensionId':_0x5469b2['id']},{'type':_0x62f1('0x11'),'app':_0x62f1('0x5'),'appdata':_0x62f1('0xf'),'context':_0x5469b2[_0x62f1('0x3')],'exten':_0x5469b2[_0x62f1('0x4')],'priority':_0x2bfacb++,'VoiceExtensionId':_0x5469b2['id']},{'type':_0x62f1('0x11'),'app':'Set','appdata':_0x62f1('0x17')+_0x5469b2['id'],'context':_0x5469b2['context'],'exten':_0x5469b2[_0x62f1('0x4')],'priority':_0x2bfacb++,'VoiceExtensionId':_0x5469b2['id']}];if(_0x5469b2['hasOwnProperty'](_0x62f1('0x18'))&&_0x5469b2[_0x62f1('0x18')]!=='none'){_0x29a69e[_0x62f1('0xb')]({'type':_0x62f1('0x11'),'app':_0x62f1('0x5'),'appdata':_0x62f1('0x19'),'context':_0x5469b2['context'],'exten':_0x5469b2['exten'],'priority':_0x2bfacb++,'VoiceExtensionId':_0x5469b2['id']},{'type':_0x62f1('0x11'),'app':_0x62f1('0x5'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x5469b2['recordingFormat']||_0x62f1('0x1a'),'context':_0x5469b2[_0x62f1('0x3')],'exten':_0x5469b2[_0x62f1('0x4')],'priority':_0x2bfacb++,'VoiceExtensionId':_0x5469b2['id']});}return _0x29a69e;}function _0x4739b6(_0x5e104b,_0xd597d3){var _0x46477e=[{'name':'trunk','param':0x0},{'name':_0x62f1('0x1b'),'param':0x1},{'name':_0x62f1('0x1c'),'param':0x2},{'name':_0x62f1('0x1d'),'param':0x3}];var _0x4ee500={};var _0x4e8c65=_0xd597d3['split'](',');var _0x24e409=[];for(var _0x1e3e7a=0x0;_0x1e3e7a<_0x46477e[_0x62f1('0x1e')];_0x1e3e7a++){switch(_0x46477e[_0x1e3e7a][_0x62f1('0x1f')]){case _0x62f1('0x20'):_0x4ee500[_0x62f1('0x20')]=_0x4e8c65[_0x46477e[_0x1e3e7a][_0x62f1('0x21')]]['split']('/')[0x1];_0x4ee500['phone']=_0x4e8c65[_0x46477e[_0x1e3e7a][_0x62f1('0x21')]][_0x62f1('0x22')]('/')[0x2];_0x4ee500['prefix']=_0x4ee500['phone']?_0x4ee500[_0x62f1('0x23')][_0x62f1('0x22')]('$')[0x0]:undefined;_0x4ee500[_0x62f1('0x23')]=_0x5e104b['cutdigits']?(_0x4ee500['prefix']||'')+_0x62f1('0x14')+_0x5e104b[_0x62f1('0x13')]+'}':(_0x4ee500[_0x62f1('0x24')]||'')+_0x62f1('0x15');_0x24e409[_0x46477e[_0x1e3e7a][_0x62f1('0x21')]]=[_0x62f1('0x25'),_0x4ee500['trunk'],_0x4ee500['phone']][_0x62f1('0x26')]('/');break;case _0x62f1('0x1c'):_0x4ee500[_0x62f1('0x1c')]=_0x4e8c65[_0x46477e[_0x1e3e7a][_0x62f1('0x21')]];if(_0x5e104b['recordingFormat']!==_0x62f1('0x27')){if(_0x4ee500[_0x62f1('0x1c')][_0x62f1('0x28')](_0x62f1('0x29'))<0x0){_0x4ee500['options']+=_0x62f1('0x29');}}else{_0x4ee500[_0x62f1('0x1c')]=_0x4ee500['options'][_0x62f1('0x2a')](_0x62f1('0x29'),'');}_0x24e409[_0x46477e[_0x1e3e7a][_0x62f1('0x21')]]=_0x4ee500[_0x62f1('0x1c')];break;default:_0x24e409[_0x46477e[_0x1e3e7a]['param']]=_0x4e8c65[_0x46477e[_0x1e3e7a][_0x62f1('0x21')]];}}return _0x24e409[_0x62f1('0x26')](',');}function _0x35e7f9(_0x25c193,_0xb1fe58,_0x427287){return new Promise(function(_0x3b18ee,_0x3ea387){var _0x32e637=[];if(_[_0x62f1('0x2b')](_0xb1fe58))return _0x3b18ee(_0x32e637);_0x3f6987[_0x62f1('0x2c')][_0x62f1('0x2d')]({'attributes':['id','interval',_0x62f1('0x2e')],'raw':!![]})[_0x62f1('0x2f')](function(_0x384db6){for(var _0x1416cd=0x0,_0x759777=0x0;_0x1416cd<_0xb1fe58[_0x62f1('0x1e')];_0x1416cd++,_0x759777=0x0){var _0x13b7a3=_0xb1fe58[_0x1416cd];var _0x4a29cc=[];var _0x24efe2=[];delete _0x13b7a3['id'];if(_0x13b7a3[_0x62f1('0x30')]!==_0x62f1('0x31')){_0x13b7a3[_0x62f1('0x32')]=[_0x13b7a3[_0x62f1('0x30')]];}else{_0x13b7a3[_0x62f1('0x32')]=_0x13b7a3['IntervalId']?_[_0x62f1('0x33')](_[_0x62f1('0x34')](_0x384db6,{'IntervalId':_0x13b7a3[_0x62f1('0x2e')]}),_0x62f1('0x30')):[];}_0x13b7a3[_0x62f1('0x3')]=_0x25c193[_0x62f1('0x3')];_0x13b7a3[_0x62f1('0x4')]=_0x25c193[_0x62f1('0x4')];if(_0x13b7a3[_0x62f1('0x1')])_0x13b7a3[_0x62f1('0x1')]=_0x13b7a3[_0x62f1('0x1')][_0x62f1('0x35')]();if(_0x25c193[_0x62f1('0x1')]===_0x62f1('0x11')){if(_0x13b7a3[_0x62f1('0x36')]('tag')&&_0x13b7a3['tag']&&_0x13b7a3[_0x62f1('0x37')]!=='--'){_0x4a29cc[_0x62f1('0xb')]({'type':_0x13b7a3['type'][_0x62f1('0x35')](),'app':_0x62f1('0x5'),'appdata':_0x62f1('0x38')+_0x13b7a3[_0x62f1('0x37')],'context':_0x25c193['context'],'exten':_0x25c193[_0x62f1('0x4')],'priority':_0x13b7a3[_0x62f1('0x32')][_0x62f1('0x1e')]+_0x427287+_0x759777++,'VoiceExtensionId':_0x25c193['id']});}_0x4a29cc['push']({'type':_0x13b7a3[_0x62f1('0x1')][_0x62f1('0x35')](),'app':_0x62f1('0x39'),'appdata':_0x62f1('0x3a')+(_0x13b7a3[_0x62f1('0x3b')]?_0x62f1('0x3c')+_0x13b7a3['callerID']+')':_0x62f1('0x3d')),'context':_0x25c193[_0x62f1('0x3')],'exten':_0x25c193[_0x62f1('0x4')],'priority':_0x13b7a3[_0x62f1('0x32')][_0x62f1('0x1e')]+_0x427287+_0x759777++,'VoiceExtensionId':_0x25c193['id']});}else{if(_0x13b7a3[_0x62f1('0x36')](_0x62f1('0x3e'))){if([_0x62f1('0x3f'),_0x62f1('0x40')][_0x62f1('0x41')](_0x13b7a3['app'][_0x62f1('0x35')]())&&_0x13b7a3[_0x62f1('0x42')]!==_0x62f1('0x43')){if(_0x13b7a3[_0x62f1('0x3e')]){_0x4a29cc[_0x62f1('0xb')]({'type':_0x13b7a3[_0x62f1('0x1')][_0x62f1('0x35')](),'app':_0x62f1('0x39'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x25c193[_0x62f1('0x3')],'exten':_0x25c193[_0x62f1('0x4')],'priority':_0x13b7a3[_0x62f1('0x32')][_0x62f1('0x1e')]+_0x427287+_0x759777++,'VoiceExtensionId':_0x25c193['id']});_0x4a29cc[_0x62f1('0xb')]({'type':_0x13b7a3[_0x62f1('0x1')][_0x62f1('0x35')](),'app':_0x62f1('0x5'),'appdata':_0x62f1('0x44'),'context':_0x25c193['context'],'exten':_0x25c193[_0x62f1('0x4')],'priority':_0x13b7a3[_0x62f1('0x32')]['length']+_0x427287+_0x759777++,'VoiceExtensionId':_0x25c193['id']});}else{_0x4a29cc[_0x62f1('0xb')]({'type':_0x13b7a3[_0x62f1('0x1')][_0x62f1('0x35')](),'app':_0x62f1('0x39'),'appdata':_0x62f1('0x45'),'context':_0x25c193[_0x62f1('0x3')],'exten':_0x25c193[_0x62f1('0x4')],'priority':_0x13b7a3['intervals'][_0x62f1('0x1e')]+_0x427287+_0x759777++,'VoiceExtensionId':_0x25c193['id']});_0x4a29cc[_0x62f1('0xb')]({'type':_0x13b7a3[_0x62f1('0x1')]['toLowerCase'](),'app':_0x62f1('0x5'),'appdata':_0x62f1('0x46'),'context':_0x25c193[_0x62f1('0x3')],'exten':_0x25c193['exten'],'priority':_0x13b7a3[_0x62f1('0x32')][_0x62f1('0x1e')]+_0x427287+_0x759777++,'VoiceExtensionId':_0x25c193['id']});}}}}for(var _0x30ac69=0x0;_0x30ac69<_0x13b7a3[_0x62f1('0x32')][_0x62f1('0x1e')];_0x30ac69++){var _0x4cdbab=_0x427287+_0x13b7a3[_0x62f1('0x32')][_0x62f1('0x1e')];var _0x57aed7=_0x30ac69===_0x13b7a3['intervals'][_0x62f1('0x1e')]-0x1?_0x427287+_0x4a29cc[_0x62f1('0x1e')]+_0x24efe2[_0x62f1('0x1e')]+0x2:_0x427287+_0x30ac69+0x1;_0x4a29cc['splice'](_0x30ac69,0x0,{'type':_0x25c193[_0x62f1('0x1')],'app':_0x62f1('0x47'),'appdata':_0x13b7a3[_0x62f1('0x32')][_0x30ac69]+'?'+_0x25c193[_0x62f1('0x3')]+_0x62f1('0x48')+_0x4cdbab+':'+_0x25c193['context']+_0x62f1('0x48')+_0x57aed7,'exten':_0x25c193[_0x62f1('0x4')],'context':_0x25c193['context'],'priority':_0x427287+_0x30ac69,'VoiceExtensionId':_0x25c193['id']});}if(_0x13b7a3[_0x62f1('0x42')]===_0x62f1('0x49')){_0x13b7a3[_0x62f1('0x4a')]=_0x4739b6(_0x25c193,_0x13b7a3[_0x62f1('0x4a')]);}if(_0x13b7a3[_0x62f1('0x42')]===_0x62f1('0x4b')){_0x4a29cc[_0x62f1('0xb')]({'type':_0x13b7a3['type'][_0x62f1('0x35')](),'app':_0x62f1('0x5'),'appdata':'XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','context':_0x25c193[_0x62f1('0x3')],'exten':_0x25c193[_0x62f1('0x4')],'priority':_0x13b7a3[_0x62f1('0x32')][_0x62f1('0x1e')]+_0x427287+_0x759777++,'VoiceExtensionId':_0x25c193['id']});}_0x13b7a3[_0x62f1('0x4c')]=_0x4a29cc['length']?_['last'](_0x4a29cc)[_0x62f1('0x4c')]+0x1:_0x427287;_0x32e637=_['concat'](_0x32e637,_0x4a29cc,[_0x13b7a3],_0x24efe2);_0x427287=_[_0x62f1('0x4d')](_0x32e637)[_0x62f1('0x4c')]+0x1;}return _0x3b18ee(_0x32e637);})[_0x62f1('0x4e')](function(_0x31fc76){_0x3ea387(_0x31fc76);});});}return _0x40c5a2[_0x62f1('0x4f')](_0x62f1('0x50'),attributes,{'tableName':_0x62f1('0x51'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x466d21){var _0x1c3b00=this[_0x62f1('0x52')]({'plain':!![]});var _0x4f6468=_0x1c3b00[_0x62f1('0x1')]===_0x62f1('0x11')?_0x3b630f(_0x1c3b00):_0x3bd251(_0x1c3b00);return _0x35e7f9(_0x1c3b00,_0x466d21,_[_0x62f1('0x4d')](_0x4f6468)[_0x62f1('0x4c')]+0x1)[_0x62f1('0x2f')](function(_0x46350a){var _0x3858f5=_[_0x62f1('0x53')](_0x4f6468,_0x46350a);_0x3858f5['push']({'type':_0x1c3b00[_0x62f1('0x1')],'app':'Hangup','exten':_0x1c3b00[_0x62f1('0x4')],'context':_0x1c3b00['context'],'priority':_[_0x62f1('0x4d')](_0x3858f5)['priority']+0x1,'VoiceExtensionId':_0x1c3b00['id']});return _0x3858f5;});}}});}; \ No newline at end of file +var _0x9a43=['appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','agi','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','priority','last','concat','define','VoiceExtension','voice_extensions','get','Hangup','lodash','./voiceExtension.attributes','models','type','Set','CDR(type)=','context','exten','alias','NoOp','inbound','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','outbound','No\x20alias\x20set','CDR(destination)=','cutdigits','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','MONITOR_OPTIONS=ab','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','trunk','timeout','url','split','name','phone','param','prefix','SIP','join','options','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','IntervalId','length','interval','*,*,*,*','intervals','filter','toLowerCase','tag','CDR(tag)=','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','app'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9a43,0x1f4));var _0x39a4=function(_0x4b26b5,_0x4f71fd){_0x4b26b5=_0x4b26b5-0x0;var _0x4dec71=_0x9a43[_0x4b26b5];return _0x4dec71;};'use strict';var _=require(_0x39a4('0x0'));var attributes=require(_0x39a4('0x1'));module['exports']=function(_0x2f2dff){var _0xb7f9a1=_0x2f2dff[_0x39a4('0x2')];function _0x43e5ca(_0xe5d736){var _0x51dc85=0x2;var _0x2b0284=[{'type':_0xe5d736[_0x39a4('0x3')],'app':_0x39a4('0x4'),'appdata':_0x39a4('0x5')+_0xe5d736[_0x39a4('0x3')],'context':_0xe5d736[_0x39a4('0x6')],'exten':_0xe5d736[_0x39a4('0x7')],'priority':_0x51dc85++,'VoiceExtensionId':_0xe5d736['id']},{'type':_0xe5d736[_0x39a4('0x3')],'app':_0xe5d736[_0x39a4('0x8')]?_0x39a4('0x4'):_0x39a4('0x9'),'appdata':_0xe5d736[_0x39a4('0x8')]?'CDR(routeAlias)='+_0xe5d736[_0x39a4('0x8')]:'No\x20alias\x20set','context':_0xe5d736[_0x39a4('0x6')],'exten':_0xe5d736['exten'],'priority':_0x51dc85++,'VoiceExtensionId':_0xe5d736['id']}];if(_0xe5d736[_0x39a4('0x3')]===_0x39a4('0xa')){_0x2b0284['push']({'type':'inbound','app':_0x39a4('0x4'),'appdata':'CDR(routeid)='+_0xe5d736['id'],'context':_0xe5d736['context'],'exten':_0xe5d736[_0x39a4('0x7')],'priority':_0x51dc85++,'VoiceExtensionId':_0xe5d736['id']});}_0x2b0284[_0x39a4('0xb')]({'type':_0xe5d736[_0x39a4('0x3')],'app':_0x39a4('0x4'),'appdata':_0x39a4('0xc'),'context':_0xe5d736[_0x39a4('0x6')],'exten':_0xe5d736[_0x39a4('0x7')],'priority':_0x51dc85++,'VoiceExtensionId':_0xe5d736['id']},{'type':_0xe5d736['type'],'app':'Set','appdata':_0x39a4('0xd'),'context':_0xe5d736[_0x39a4('0x6')],'exten':_0xe5d736[_0x39a4('0x7')],'priority':_0x51dc85++,'VoiceExtensionId':_0xe5d736['id']},{'type':_0xe5d736['type'],'app':_0x39a4('0x4'),'appdata':'MONITOR_OPTIONS=ab','context':_0xe5d736['context'],'exten':_0xe5d736['exten'],'priority':_0x51dc85++,'VoiceExtensionId':_0xe5d736['id']});return _0x2b0284;}function _0x2f0be6(_0x310d08){var _0x259ac0=0x2;var _0xdbe54=[{'type':_0x39a4('0xe'),'app':_0x39a4('0x4'),'appdata':'CDR(type)=outbound','context':_0x310d08[_0x39a4('0x6')],'exten':_0x310d08[_0x39a4('0x7')],'priority':_0x259ac0++,'VoiceExtensionId':_0x310d08['id']},{'type':_0x39a4('0xe'),'app':_0x310d08[_0x39a4('0x8')]?_0x39a4('0x4'):_0x39a4('0x9'),'appdata':_0x310d08[_0x39a4('0x8')]?'CDR(routeAlias)='+_0x310d08[_0x39a4('0x8')]:_0x39a4('0xf'),'context':_0x310d08[_0x39a4('0x6')],'exten':_0x310d08[_0x39a4('0x7')],'priority':_0x259ac0++,'VoiceExtensionId':_0x310d08['id']},{'type':_0x39a4('0xe'),'app':'Set','appdata':_0x39a4('0x10')+(_0x310d08[_0x39a4('0x11')]?'${EXTEN:'+_0x310d08[_0x39a4('0x11')]+'}':_0x39a4('0x12')),'context':_0x310d08[_0x39a4('0x6')],'exten':_0x310d08['exten'],'priority':_0x259ac0++,'VoiceExtensionId':_0x310d08['id']},{'type':_0x39a4('0xe'),'app':_0x39a4('0x4'),'appdata':_0x39a4('0x13')+_0x310d08['id'],'context':_0x310d08[_0x39a4('0x6')],'exten':_0x310d08[_0x39a4('0x7')],'priority':_0x259ac0++,'VoiceExtensionId':_0x310d08['id']},{'type':_0x39a4('0xe'),'app':_0x39a4('0x14'),'appdata':_0x39a4('0x15')+(_0x259ac0+0x2)+'):Goto('+(_0x259ac0+0x1)+')','context':_0x310d08[_0x39a4('0x6')],'exten':_0x310d08['exten'],'priority':_0x259ac0++,'VoiceExtensionId':_0x310d08['id']},{'type':_0x39a4('0xe'),'app':'Set','appdata':_0x310d08[_0x39a4('0x11')]?_0x39a4('0x16')+_0x310d08[_0x39a4('0x11')]+'}':_0x39a4('0x17'),'context':_0x310d08[_0x39a4('0x6')],'exten':_0x310d08[_0x39a4('0x7')],'priority':_0x259ac0++,'VoiceExtensionId':_0x310d08['id']},{'type':_0x39a4('0xe'),'app':_0x39a4('0x4'),'appdata':_0x39a4('0xc'),'context':_0x310d08[_0x39a4('0x6')],'exten':_0x310d08[_0x39a4('0x7')],'priority':_0x259ac0++,'VoiceExtensionId':_0x310d08['id']},{'type':_0x39a4('0xe'),'app':'Set','appdata':_0x39a4('0xd'),'context':_0x310d08[_0x39a4('0x6')],'exten':_0x310d08[_0x39a4('0x7')],'priority':_0x259ac0++,'VoiceExtensionId':_0x310d08['id']},{'type':'outbound','app':_0x39a4('0x4'),'appdata':_0x39a4('0x18'),'context':_0x310d08[_0x39a4('0x6')],'exten':_0x310d08['exten'],'priority':_0x259ac0++,'VoiceExtensionId':_0x310d08['id']},{'type':_0x39a4('0xe'),'app':_0x39a4('0x4'),'appdata':'outboundrouteid='+_0x310d08['id'],'context':_0x310d08[_0x39a4('0x6')],'exten':_0x310d08[_0x39a4('0x7')],'priority':_0x259ac0++,'VoiceExtensionId':_0x310d08['id']}];if(_0x310d08[_0x39a4('0x19')](_0x39a4('0x1a'))&&_0x310d08[_0x39a4('0x1a')]!==_0x39a4('0x1b')){_0xdbe54[_0x39a4('0xb')]({'type':'outbound','app':_0x39a4('0x4'),'appdata':_0x39a4('0x1c'),'context':_0x310d08[_0x39a4('0x6')],'exten':_0x310d08['exten'],'priority':_0x259ac0++,'VoiceExtensionId':_0x310d08['id']},{'type':'outbound','app':_0x39a4('0x4'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x310d08['recordingFormat']||'wav','context':_0x310d08[_0x39a4('0x6')],'exten':_0x310d08[_0x39a4('0x7')],'priority':_0x259ac0++,'VoiceExtensionId':_0x310d08['id']});}return _0xdbe54;}function _0x160383(_0x14b449,_0xefa805){var _0x459885=[{'name':_0x39a4('0x1d'),'param':0x0},{'name':_0x39a4('0x1e'),'param':0x1},{'name':'options','param':0x2},{'name':_0x39a4('0x1f'),'param':0x3}];var _0x25d404={};var _0x2dfb9b=_0xefa805[_0x39a4('0x20')](',');var _0x207566=[];for(var _0x1113d9=0x0;_0x1113d9<_0x459885['length'];_0x1113d9++){switch(_0x459885[_0x1113d9][_0x39a4('0x21')]){case'trunk':_0x25d404[_0x39a4('0x1d')]=_0x2dfb9b[_0x459885[_0x1113d9]['param']][_0x39a4('0x20')]('/')[0x1];_0x25d404[_0x39a4('0x22')]=_0x2dfb9b[_0x459885[_0x1113d9][_0x39a4('0x23')]][_0x39a4('0x20')]('/')[0x2];_0x25d404[_0x39a4('0x24')]=_0x25d404[_0x39a4('0x22')]?_0x25d404[_0x39a4('0x22')][_0x39a4('0x20')]('$')[0x0]:undefined;_0x25d404['phone']=_0x14b449[_0x39a4('0x11')]?(_0x25d404[_0x39a4('0x24')]||'')+'${EXTEN:'+_0x14b449[_0x39a4('0x11')]+'}':(_0x25d404['prefix']||'')+_0x39a4('0x12');_0x207566[_0x459885[_0x1113d9][_0x39a4('0x23')]]=[_0x39a4('0x25'),_0x25d404[_0x39a4('0x1d')],_0x25d404[_0x39a4('0x22')]][_0x39a4('0x26')]('/');break;case _0x39a4('0x27'):_0x25d404[_0x39a4('0x27')]=_0x2dfb9b[_0x459885[_0x1113d9][_0x39a4('0x23')]];if(_0x14b449[_0x39a4('0x1a')]!==_0x39a4('0x1b')){if(_0x25d404['options'][_0x39a4('0x28')](_0x39a4('0x29'))<0x0){_0x25d404[_0x39a4('0x27')]+=_0x39a4('0x29');}}else{_0x25d404[_0x39a4('0x27')]=_0x25d404[_0x39a4('0x27')][_0x39a4('0x2a')](_0x39a4('0x29'),'');}_0x207566[_0x459885[_0x1113d9][_0x39a4('0x23')]]=_0x25d404[_0x39a4('0x27')];break;default:_0x207566[_0x459885[_0x1113d9]['param']]=_0x2dfb9b[_0x459885[_0x1113d9][_0x39a4('0x23')]];}}return _0x207566[_0x39a4('0x26')](',');}function _0x5b0d4f(_0x5176e1,_0x565a7e,_0x594dd4){return new Promise(function(_0x2f3588,_0x317b00){var _0xc74fe8=[];if(_[_0x39a4('0x2b')](_0x565a7e))return _0x2f3588(_0xc74fe8);_0xb7f9a1[_0x39a4('0x2c')]['findAll']({'attributes':['id','interval',_0x39a4('0x2d')],'raw':!![]})['then'](function(_0x5c5690){for(var _0x5eebb8=0x0,_0x40d21f=0x0;_0x5eebb8<_0x565a7e[_0x39a4('0x2e')];_0x5eebb8++,_0x40d21f=0x0){var _0x531505=_0x565a7e[_0x5eebb8];var _0x245f74=[];var _0x2479e9=[];delete _0x531505['id'];if(_0x531505[_0x39a4('0x2f')]!==_0x39a4('0x30')){_0x531505[_0x39a4('0x31')]=[_0x531505[_0x39a4('0x2f')]];}else{_0x531505[_0x39a4('0x31')]=_0x531505[_0x39a4('0x2d')]?_['map'](_[_0x39a4('0x32')](_0x5c5690,{'IntervalId':_0x531505['IntervalId']}),_0x39a4('0x2f')):[];}_0x531505[_0x39a4('0x6')]=_0x5176e1[_0x39a4('0x6')];_0x531505['exten']=_0x5176e1[_0x39a4('0x7')];if(_0x531505['type'])_0x531505[_0x39a4('0x3')]=_0x531505[_0x39a4('0x3')][_0x39a4('0x33')]();if(_0x5176e1[_0x39a4('0x3')]===_0x39a4('0xe')){if(_0x531505[_0x39a4('0x19')](_0x39a4('0x34'))&&_0x531505[_0x39a4('0x34')]&&_0x531505[_0x39a4('0x34')]!=='--'){_0x245f74['push']({'type':_0x531505[_0x39a4('0x3')][_0x39a4('0x33')](),'app':'Set','appdata':_0x39a4('0x35')+_0x531505[_0x39a4('0x34')],'context':_0x5176e1['context'],'exten':_0x5176e1[_0x39a4('0x7')],'priority':_0x531505[_0x39a4('0x31')][_0x39a4('0x2e')]+_0x594dd4+_0x40d21f++,'VoiceExtensionId':_0x5176e1['id']});}_0x245f74[_0x39a4('0xb')]({'type':_0x531505[_0x39a4('0x3')]['toLowerCase'](),'app':_0x39a4('0x14'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x531505[_0x39a4('0x36')]?_0x39a4('0x37')+_0x531505[_0x39a4('0x36')]+')':_0x39a4('0x38')),'context':_0x5176e1[_0x39a4('0x6')],'exten':_0x5176e1[_0x39a4('0x7')],'priority':_0x531505[_0x39a4('0x31')][_0x39a4('0x2e')]+_0x594dd4+_0x40d21f++,'VoiceExtensionId':_0x5176e1['id']});}else{if(_0x531505['hasOwnProperty'](_0x39a4('0x39'))){if([_0x39a4('0x3a'),'playback']['includes'](_0x531505[_0x39a4('0x3b')][_0x39a4('0x33')]())&&_0x531505[_0x39a4('0x3c')]!==_0x39a4('0x3d')){if(_0x531505[_0x39a4('0x39')]){_0x245f74['push']({'type':_0x531505[_0x39a4('0x3')][_0x39a4('0x33')](),'app':_0x39a4('0x14'),'appdata':_0x39a4('0x3e'),'context':_0x5176e1['context'],'exten':_0x5176e1[_0x39a4('0x7')],'priority':_0x531505[_0x39a4('0x31')][_0x39a4('0x2e')]+_0x594dd4+_0x40d21f++,'VoiceExtensionId':_0x5176e1['id']});_0x245f74['push']({'type':_0x531505[_0x39a4('0x3')][_0x39a4('0x33')](),'app':_0x39a4('0x4'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x5176e1['context'],'exten':_0x5176e1[_0x39a4('0x7')],'priority':_0x531505[_0x39a4('0x31')]['length']+_0x594dd4+_0x40d21f++,'VoiceExtensionId':_0x5176e1['id']});}else{_0x245f74[_0x39a4('0xb')]({'type':_0x531505['type']['toLowerCase'](),'app':_0x39a4('0x14'),'appdata':_0x39a4('0x3f'),'context':_0x5176e1[_0x39a4('0x6')],'exten':_0x5176e1[_0x39a4('0x7')],'priority':_0x531505[_0x39a4('0x31')][_0x39a4('0x2e')]+_0x594dd4+_0x40d21f++,'VoiceExtensionId':_0x5176e1['id']});_0x245f74[_0x39a4('0xb')]({'type':_0x531505[_0x39a4('0x3')]['toLowerCase'](),'app':_0x39a4('0x4'),'appdata':_0x39a4('0x40'),'context':_0x5176e1[_0x39a4('0x6')],'exten':_0x5176e1[_0x39a4('0x7')],'priority':_0x531505[_0x39a4('0x31')][_0x39a4('0x2e')]+_0x594dd4+_0x40d21f++,'VoiceExtensionId':_0x5176e1['id']});}}}}for(var _0x27b969=0x0;_0x27b969<_0x531505[_0x39a4('0x31')][_0x39a4('0x2e')];_0x27b969++){var _0xb2f985=_0x594dd4+_0x531505[_0x39a4('0x31')][_0x39a4('0x2e')];var _0x219c3a=_0x27b969===_0x531505[_0x39a4('0x31')][_0x39a4('0x2e')]-0x1?_0x594dd4+_0x245f74[_0x39a4('0x2e')]+_0x2479e9[_0x39a4('0x2e')]+0x2:_0x594dd4+_0x27b969+0x1;_0x245f74[_0x39a4('0x41')](_0x27b969,0x0,{'type':_0x5176e1[_0x39a4('0x3')],'app':_0x39a4('0x42'),'appdata':_0x531505[_0x39a4('0x31')][_0x27b969]+'?'+_0x5176e1['context']+_0x39a4('0x43')+_0xb2f985+':'+_0x5176e1[_0x39a4('0x6')]+',${EXTEN},'+_0x219c3a,'exten':_0x5176e1[_0x39a4('0x7')],'context':_0x5176e1[_0x39a4('0x6')],'priority':_0x594dd4+_0x27b969,'VoiceExtensionId':_0x5176e1['id']});}if(_0x531505[_0x39a4('0x3c')]===_0x39a4('0x44')){_0x531505[_0x39a4('0x45')]=_0x160383(_0x5176e1,_0x531505[_0x39a4('0x45')]);}if(_0x531505[_0x39a4('0x3c')]===_0x39a4('0x46')){_0x245f74[_0x39a4('0xb')]({'type':_0x531505[_0x39a4('0x3')][_0x39a4('0x33')](),'app':_0x39a4('0x4'),'appdata':_0x39a4('0x47'),'context':_0x5176e1[_0x39a4('0x6')],'exten':_0x5176e1[_0x39a4('0x7')],'priority':_0x531505[_0x39a4('0x31')]['length']+_0x594dd4+_0x40d21f++,'VoiceExtensionId':_0x5176e1['id']});}_0x531505[_0x39a4('0x48')]=_0x245f74[_0x39a4('0x2e')]?_[_0x39a4('0x49')](_0x245f74)[_0x39a4('0x48')]+0x1:_0x594dd4;_0xc74fe8=_[_0x39a4('0x4a')](_0xc74fe8,_0x245f74,[_0x531505],_0x2479e9);_0x594dd4=_[_0x39a4('0x49')](_0xc74fe8)[_0x39a4('0x48')]+0x1;}return _0x2f3588(_0xc74fe8);})['catch'](function(_0x3f6ec8){_0x317b00(_0x3f6ec8);});});}return _0x2f2dff[_0x39a4('0x4b')](_0x39a4('0x4c'),attributes,{'tableName':_0x39a4('0x4d'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x13d132){var _0x5f38d3=this[_0x39a4('0x4e')]({'plain':!![]});var _0x1f2c81=_0x5f38d3['type']===_0x39a4('0xe')?_0x2f0be6(_0x5f38d3):_0x43e5ca(_0x5f38d3);return _0x5b0d4f(_0x5f38d3,_0x13d132,_[_0x39a4('0x49')](_0x1f2c81)[_0x39a4('0x48')]+0x1)['then'](function(_0x2a053b){var _0x4a2ce2=_[_0x39a4('0x4a')](_0x1f2c81,_0x2a053b);_0x4a2ce2[_0x39a4('0xb')]({'type':_0x5f38d3[_0x39a4('0x3')],'app':_0x39a4('0x4f'),'exten':_0x5f38d3['exten'],'context':_0x5f38d3[_0x39a4('0x6')],'priority':_['last'](_0x4a2ce2)[_0x39a4('0x48')]+0x1,'VoiceExtensionId':_0x5f38d3['id']});return _0x4a2ce2;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 2b81cae..f82a367 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 _0x1203=['localhost','socket.io-emitter','request','then','info','VoiceExtension,\x20%s,\x20%s','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','VoiceExtension','options','where','attributes','limit','map','model','include','GetVoiceExtension','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x5341ff,_0x1de6df){var _0x53be58=function(_0x4da0da){while(--_0x4da0da){_0x5341ff['push'](_0x5341ff['shift']());}};_0x53be58(++_0x1de6df);}(_0x1203,0x8c));var _0x3120=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1203[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3120('0x0'));var util=require(_0x3120('0x1'));var moment=require(_0x3120('0x2'));var BPromise=require(_0x3120('0x3'));var rs=require(_0x3120('0x4'));var fs=require('fs');var Redis=require(_0x3120('0x5'));var db=require(_0x3120('0x6'))['db'];var utils=require(_0x3120('0x7'));var logger=require(_0x3120('0x8'))(_0x3120('0x9'));var config=require(_0x3120('0xa'));var jayson=require(_0x3120('0xb'));var client=jayson[_0x3120('0xc')][_0x3120('0xd')]({'port':0x232a});config[_0x3120('0xe')]=_[_0x3120('0xf')](config['redis'],{'host':_0x3120('0x10'),'port':0x18eb});var socket=require(_0x3120('0x11'))(new Redis(config['redis']));require('./voiceExtension.socket')['register'](socket);function respondWithRpcPromise(_0x6ee01b,_0x39f834,_0x5b2ae3){return new BPromise(function(_0x1493fd,_0x5d0ba8){return client[_0x3120('0x12')](_0x6ee01b,_0x5b2ae3)[_0x3120('0x13')](function(_0x492cda){logger[_0x3120('0x14')](_0x3120('0x15'),_0x39f834,'request\x20sent');logger['debug'](_0x3120('0x16'),_0x39f834,_0x3120('0x17'),JSON[_0x3120('0x18')](_0x492cda));if(_0x492cda[_0x3120('0x19')]){if(_0x492cda[_0x3120('0x19')][_0x3120('0x1a')]===0x1f4){logger[_0x3120('0x19')]('VoiceExtension,\x20%s,\x20%s',_0x39f834,_0x492cda[_0x3120('0x19')][_0x3120('0x1b')]);return _0x5d0ba8(_0x492cda[_0x3120('0x19')][_0x3120('0x1b')]);}logger[_0x3120('0x19')](_0x3120('0x15'),_0x39f834,_0x492cda[_0x3120('0x19')]['message']);return _0x1493fd(_0x492cda[_0x3120('0x19')]['message']);}else{logger[_0x3120('0x14')](_0x3120('0x15'),_0x39f834,_0x3120('0x17'));_0x1493fd(_0x492cda[_0x3120('0x1c')][_0x3120('0x1b')]);}})[_0x3120('0x1d')](function(_0x50429){logger['error'](_0x3120('0x15'),_0x39f834,_0x50429);_0x5d0ba8(_0x50429);});});}exports['GetVoiceExtension']=function(_0x3b7e31){var _0x41d73f=this;return new Promise(function(_0x3bc524,_0x5bfd37){return db[_0x3120('0x1e')]['findAll']({'raw':_0x3b7e31[_0x3120('0x1f')]?_0x3b7e31[_0x3120('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x3b7e31[_0x3120('0x1f')]?_0x3b7e31[_0x3120('0x1f')][_0x3120('0x20')]||null:null,'attributes':_0x3b7e31[_0x3120('0x1f')]?_0x3b7e31['options'][_0x3120('0x21')]||null:null,'limit':_0x3b7e31['options']?_0x3b7e31[_0x3120('0x1f')][_0x3120('0x22')]||null:null,'include':_0x3b7e31[_0x3120('0x1f')]?_0x3b7e31['options']['include']?_[_0x3120('0x23')](_0x3b7e31[_0x3120('0x1f')]['include'],function(_0xc88506){return{'model':db[_0xc88506[_0x3120('0x24')]],'as':_0xc88506['as'],'attributes':_0xc88506[_0x3120('0x21')],'include':_0xc88506['include']?_[_0x3120('0x23')](_0xc88506[_0x3120('0x25')],function(_0x4412f9){return{'model':db[_0x4412f9[_0x3120('0x24')]],'as':_0x4412f9['as'],'attributes':_0x4412f9['attributes'],'include':_0x4412f9['include']?_['map'](_0x4412f9[_0x3120('0x25')],function(_0x5444ec){return{'model':db[_0x5444ec[_0x3120('0x24')]],'as':_0x5444ec['as'],'attributes':_0x5444ec[_0x3120('0x21')]};}):[]};}):[]};}):[]:[]})[_0x3120('0x13')](function(_0x3399fd){logger[_0x3120('0x14')](_0x3120('0x26'),_0x3b7e31);logger['debug'](_0x3120('0x26'),_0x3b7e31,JSON[_0x3120('0x18')](_0x3399fd));_0x3bc524(_0x3399fd);})[_0x3120('0x1d')](function(_0x1ee7bc){logger[_0x3120('0x19')](_0x3120('0x26'),_0x1ee7bc[_0x3120('0x1b')],_0x3b7e31);_0x5bfd37(_0x41d73f[_0x3120('0x19')](0x1f4,_0x1ee7bc['message']));});});}; \ No newline at end of file +var _0xbcba=['limit','include','model','map','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','defaults','redis','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','raw','options','where','attributes'];(function(_0xa6cb09,_0x39410f){var _0x12b437=function(_0x1813cc){while(--_0x1813cc){_0xa6cb09['push'](_0xa6cb09['shift']());}};_0x12b437(++_0x39410f);}(_0xbcba,0x6d));var _0xabcb=function(_0x3465be,_0x389ae8){_0x3465be=_0x3465be-0x0;var _0x2c90e9=_0xbcba[_0x3465be];return _0x2c90e9;};'use strict';var _=require(_0xabcb('0x0'));var util=require(_0xabcb('0x1'));var moment=require('moment');var BPromise=require(_0xabcb('0x2'));var rs=require(_0xabcb('0x3'));var fs=require('fs');var Redis=require(_0xabcb('0x4'));var db=require(_0xabcb('0x5'))['db'];var utils=require(_0xabcb('0x6'));var logger=require(_0xabcb('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xabcb('0x8'));var client=jayson[_0xabcb('0x9')]['http']({'port':0x232a});config['redis']=_[_0xabcb('0xa')](config[_0xabcb('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xabcb('0xb')]));require('./voiceExtension.socket')[_0xabcb('0xc')](socket);function respondWithRpcPromise(_0x3ebc6d,_0x53bd6c,_0x2c16c3){return new BPromise(function(_0x4d2585,_0x36ee45){return client[_0xabcb('0xd')](_0x3ebc6d,_0x2c16c3)[_0xabcb('0xe')](function(_0x289f8f){logger[_0xabcb('0xf')](_0xabcb('0x10'),_0x53bd6c,_0xabcb('0x11'));logger[_0xabcb('0x12')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x53bd6c,_0xabcb('0x11'),JSON[_0xabcb('0x13')](_0x289f8f));if(_0x289f8f[_0xabcb('0x14')]){if(_0x289f8f[_0xabcb('0x14')][_0xabcb('0x15')]===0x1f4){logger[_0xabcb('0x14')]('VoiceExtension,\x20%s,\x20%s',_0x53bd6c,_0x289f8f[_0xabcb('0x14')][_0xabcb('0x16')]);return _0x36ee45(_0x289f8f[_0xabcb('0x14')][_0xabcb('0x16')]);}logger[_0xabcb('0x14')](_0xabcb('0x10'),_0x53bd6c,_0x289f8f[_0xabcb('0x14')][_0xabcb('0x16')]);return _0x4d2585(_0x289f8f[_0xabcb('0x14')][_0xabcb('0x16')]);}else{logger['info'](_0xabcb('0x10'),_0x53bd6c,_0xabcb('0x11'));_0x4d2585(_0x289f8f[_0xabcb('0x17')][_0xabcb('0x16')]);}})[_0xabcb('0x18')](function(_0x20f74f){logger[_0xabcb('0x14')](_0xabcb('0x10'),_0x53bd6c,_0x20f74f);_0x36ee45(_0x20f74f);});});}exports[_0xabcb('0x19')]=function(_0xce0100){var _0x5da0c8=this;return new Promise(function(_0x3676c6,_0x44a2c2){return db[_0xabcb('0x1a')]['findAll']({'raw':_0xce0100['options']?_0xce0100['options'][_0xabcb('0x1b')]===undefined?!![]:![]:!![],'where':_0xce0100[_0xabcb('0x1c')]?_0xce0100[_0xabcb('0x1c')][_0xabcb('0x1d')]||null:null,'attributes':_0xce0100[_0xabcb('0x1c')]?_0xce0100['options'][_0xabcb('0x1e')]||null:null,'limit':_0xce0100['options']?_0xce0100['options'][_0xabcb('0x1f')]||null:null,'include':_0xce0100[_0xabcb('0x1c')]?_0xce0100[_0xabcb('0x1c')][_0xabcb('0x20')]?_['map'](_0xce0100[_0xabcb('0x1c')][_0xabcb('0x20')],function(_0x3ffaf7){return{'model':db[_0x3ffaf7[_0xabcb('0x21')]],'as':_0x3ffaf7['as'],'attributes':_0x3ffaf7['attributes'],'include':_0x3ffaf7[_0xabcb('0x20')]?_[_0xabcb('0x22')](_0x3ffaf7['include'],function(_0x5eb6d0){return{'model':db[_0x5eb6d0[_0xabcb('0x21')]],'as':_0x5eb6d0['as'],'attributes':_0x5eb6d0['attributes'],'include':_0x5eb6d0[_0xabcb('0x20')]?_[_0xabcb('0x22')](_0x5eb6d0[_0xabcb('0x20')],function(_0xe6a539){return{'model':db[_0xe6a539[_0xabcb('0x21')]],'as':_0xe6a539['as'],'attributes':_0xe6a539[_0xabcb('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xabcb('0xe')](function(_0x555268){logger['info'](_0xabcb('0x19'),_0xce0100);logger[_0xabcb('0x12')]('GetVoiceExtension',_0xce0100,JSON[_0xabcb('0x13')](_0x555268));_0x3676c6(_0x555268);})[_0xabcb('0x18')](function(_0x17946d){logger[_0xabcb('0x14')](_0xabcb('0x19'),_0x17946d[_0xabcb('0x16')],_0xce0100);_0x44a2c2(_0x5da0c8['error'](0x1f4,_0x17946d[_0xabcb('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index eded852..7358a8d 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 _0x7a54=['remove','emit','removeListener','register','length','voiceExtension:','./voiceExtension.events','save'];(function(_0x581dd7,_0x5a1dc5){var _0x175af4=function(_0x6a5fa0){while(--_0x6a5fa0){_0x581dd7['push'](_0x581dd7['shift']());}};_0x175af4(++_0x5a1dc5);}(_0x7a54,0x106));var _0x47a5=function(_0xfac549,_0x2ccc85){_0xfac549=_0xfac549-0x0;var _0x5bef59=_0x7a54[_0xfac549];return _0x5bef59;};'use strict';var VoiceExtensionEvents=require(_0x47a5('0x0'));var events=[_0x47a5('0x1'),_0x47a5('0x2'),'update'];function createListener(_0x1d33e,_0x4086cd){return function(_0x4880bf){_0x4086cd[_0x47a5('0x3')](_0x1d33e,_0x4880bf);};}function removeListener(_0x11bf85,_0x2a1a7e){return function(){VoiceExtensionEvents[_0x47a5('0x4')](_0x11bf85,_0x2a1a7e);};}exports[_0x47a5('0x5')]=function(_0x545a97){for(var _0x3d5629=0x0,_0x59199c=events[_0x47a5('0x6')];_0x3d5629<_0x59199c;_0x3d5629++){var _0x30e405=events[_0x3d5629];var _0x506eda=createListener(_0x47a5('0x7')+_0x30e405,_0x545a97);VoiceExtensionEvents['on'](_0x30e405,_0x506eda);}}; \ No newline at end of file +var _0x7a54=['remove','emit','removeListener','register','length','voiceExtension:','./voiceExtension.events','save'];(function(_0x226919,_0x1f8a45){var _0x1808f7=function(_0x142154){while(--_0x142154){_0x226919['push'](_0x226919['shift']());}};_0x1808f7(++_0x1f8a45);}(_0x7a54,0x106));var _0x47a5=function(_0x105b84,_0x961a4e){_0x105b84=_0x105b84-0x0;var _0x4dfbef=_0x7a54[_0x105b84];return _0x4dfbef;};'use strict';var VoiceExtensionEvents=require(_0x47a5('0x0'));var events=[_0x47a5('0x1'),_0x47a5('0x2'),'update'];function createListener(_0x1d33e,_0x4086cd){return function(_0x4880bf){_0x4086cd[_0x47a5('0x3')](_0x1d33e,_0x4880bf);};}function removeListener(_0x11bf85,_0x2a1a7e){return function(){VoiceExtensionEvents[_0x47a5('0x4')](_0x11bf85,_0x2a1a7e);};}exports[_0x47a5('0x5')]=function(_0x545a97){for(var _0x3d5629=0x0,_0x59199c=events[_0x47a5('0x6')];_0x3d5629<_0x59199c;_0x3d5629++){var _0x30e405=events[_0x3d5629];var _0x506eda=createListener(_0x47a5('0x7')+_0x30e405,_0x545a97);VoiceExtensionEvents['on'](_0x30e405,_0x506eda);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index df21b3f..98c04fc 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 _0xa456=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','/:id','show','post','create','put','delete','multer'];(function(_0x582e57,_0x85fded){var _0xfef0e6=function(_0x4b78be){while(--_0x4b78be){_0x582e57['push'](_0x582e57['shift']());}};_0xfef0e6(++_0x85fded);}(_0xa456,0x142));var _0x6a45=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0xa456[_0x1a72f3];return _0x57ef47;};'use strict';var multer=require(_0x6a45('0x0'));var util=require(_0x6a45('0x1'));var path=require(_0x6a45('0x2'));var timeout=require(_0x6a45('0x3'));var express=require('express');var router=express[_0x6a45('0x4')]();var fs_extra=require(_0x6a45('0x5'));var auth=require(_0x6a45('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6a45('0x7'));var controller=require(_0x6a45('0x8'));router[_0x6a45('0x9')]('/',auth[_0x6a45('0xa')](),controller['index']);router[_0x6a45('0x9')](_0x6a45('0xb'),auth[_0x6a45('0xa')](),controller[_0x6a45('0xc')]);router[_0x6a45('0x9')]('/:id/messages',auth[_0x6a45('0xa')](),controller['getMessages']);router[_0x6a45('0xd')]('/',auth[_0x6a45('0xa')](),controller[_0x6a45('0xe')]);router[_0x6a45('0xf')](_0x6a45('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x6a45('0x10')](_0x6a45('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x9f0e=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','/:id','isAuthenticated','/:id/messages','getMessages','post','create','put','update','delete','destroy','multer','util'];(function(_0x5eb2ca,_0x528e2d){var _0x507803=function(_0x1a1b08){while(--_0x1a1b08){_0x5eb2ca['push'](_0x5eb2ca['shift']());}};_0x507803(++_0x528e2d);}(_0x9f0e,0x116));var _0xe9f0=function(_0x400602,_0x2e4d2f){_0x400602=_0x400602-0x0;var _0x5e8cd4=_0x9f0e[_0x400602];return _0x5e8cd4;};'use strict';var multer=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var path=require(_0xe9f0('0x2'));var timeout=require(_0xe9f0('0x3'));var express=require(_0xe9f0('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe9f0('0x5'));var interaction=require(_0xe9f0('0x6'));var config=require(_0xe9f0('0x7'));var controller=require(_0xe9f0('0x8'));router[_0xe9f0('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe9f0('0x9')](_0xe9f0('0xa'),auth[_0xe9f0('0xb')](),controller['show']);router[_0xe9f0('0x9')](_0xe9f0('0xc'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0xd')]);router[_0xe9f0('0xe')]('/',auth[_0xe9f0('0xb')](),controller[_0xe9f0('0xf')]);router[_0xe9f0('0x10')](_0xe9f0('0xa'),auth['isAuthenticated'](),controller[_0xe9f0('0x11')]);router[_0xe9f0('0x12')](_0xe9f0('0xa'),auth['isAuthenticated'](),controller[_0xe9f0('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 8e70624..d6afa52 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 _0xf917=['TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','\x20-\x20','getDataValue','mailbox','sequelize','STRING','from-voicemail','contest_mailbox','setDataValue','trim','central','ENUM','yes'];(function(_0xb913fd,_0x1e6a33){var _0x11e5b8=function(_0x1414a9){while(--_0x1414a9){_0xb913fd['push'](_0xb913fd['shift']());}};_0x11e5b8(++_0x1e6a33);}(_0xf917,0xe7));var _0x7f91=function(_0x5de967,_0x515918){_0x5de967=_0x5de967-0x0;var _0x5b07a3=_0xf917[_0x5de967];return _0x5b07a3;};'use strict';var Sequelize=require(_0x7f91('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0x7f91('0x1')]},'context':{'type':Sequelize[_0x7f91('0x1')],'defaultValue':_0x7f91('0x2'),'unique':_0x7f91('0x3')},'mailbox':{'type':Sequelize[_0x7f91('0x1')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x7f91('0x1')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x4e5da0){this[_0x7f91('0x4')]('email',typeof _0x4e5da0==='string'&&_0x4e5da0[_0x7f91('0x5')]()?_0x4e5da0[_0x7f91('0x5')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x7f91('0x1')],'defaultValue':_0x7f91('0x6')},'attach':{'type':Sequelize[_0x7f91('0x7')](_0x7f91('0x8'),'no'),'defaultValue':_0x7f91('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0x7f91('0x7')](_0x7f91('0x8'),'no'),'defaultValue':_0x7f91('0x8'),'allowNull':![]},'dialout':{'type':Sequelize[_0x7f91('0x1')]},'callback':{'type':Sequelize[_0x7f91('0x1')]},'review':{'type':Sequelize[_0x7f91('0x7')](_0x7f91('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x7f91('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x7f91('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x7f91('0x7')](_0x7f91('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x7f91('0x7')](_0x7f91('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0x7f91('0x8'),'no'),'defaultValue':_0x7f91('0x8'),'allowNull':![]},'forcename':{'type':Sequelize[_0x7f91('0x7')](_0x7f91('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x7f91('0x7')](_0x7f91('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x7f91('0x7')](_0x7f91('0x8'),'no'),'defaultValue':_0x7f91('0x8'),'allowNull':![]},'stamp':{'type':_0x7f91('0xa')},'emailsubject':{'type':Sequelize[_0x7f91('0x1')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0x7f91('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x7f91('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x7f91('0xc')],'get':function(){return this['getDataValue']('fullname')+_0x7f91('0xd')+this[_0x7f91('0xe')](_0x7f91('0xf'));}}}; \ No newline at end of file +var _0x9a17=['TINYINT(4)','TIMESTAMP','VIRTUAL','getDataValue','fullname','sequelize','STRING','contest_mailbox','email','string','trim','central','yes','ENUM'];(function(_0x1bd13d,_0x113b03){var _0x4f2d56=function(_0xc67611){while(--_0xc67611){_0x1bd13d['push'](_0x1bd13d['shift']());}};_0x4f2d56(++_0x113b03);}(_0x9a17,0x155));var _0x79a1=function(_0x11b683,_0x249bae){_0x11b683=_0x11b683-0x0;var _0x3522a8=_0x9a17[_0x11b683];return _0x3522a8;};'use strict';var Sequelize=require(_0x79a1('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0x79a1('0x1')]},'context':{'type':Sequelize['STRING'],'defaultValue':'from-voicemail','unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x79a1('0x1')],'defaultValue':'','allowNull':![],'unique':_0x79a1('0x2')},'password':{'type':Sequelize[_0x79a1('0x1')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x79a1('0x1')],'validate':{'isEmail':!![]},'set':function(_0x528b1c){this['setDataValue'](_0x79a1('0x3'),typeof _0x528b1c===_0x79a1('0x4')&&_0x528b1c[_0x79a1('0x5')]()?_0x528b1c[_0x79a1('0x5')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x79a1('0x1')],'defaultValue':_0x79a1('0x6')},'attach':{'type':Sequelize['ENUM'](_0x79a1('0x7'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x79a1('0x8')](_0x79a1('0x7'),'no'),'defaultValue':_0x79a1('0x7'),'allowNull':![]},'dialout':{'type':Sequelize[_0x79a1('0x1')]},'callback':{'type':Sequelize[_0x79a1('0x1')]},'review':{'type':Sequelize['ENUM'](_0x79a1('0x7'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x79a1('0x7'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x79a1('0x8')](_0x79a1('0x7'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0x79a1('0x7'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x79a1('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x79a1('0x8')](_0x79a1('0x7'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x79a1('0x8')](_0x79a1('0x7'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0x79a1('0x7'),'no'),'defaultValue':_0x79a1('0x7'),'allowNull':![]},'forcename':{'type':Sequelize[_0x79a1('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x79a1('0x8')](_0x79a1('0x7'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x79a1('0x7'),'no'),'defaultValue':_0x79a1('0x7'),'allowNull':![]},'stamp':{'type':_0x79a1('0xa')},'emailsubject':{'type':Sequelize[_0x79a1('0x1')]},'emailbody':{'type':Sequelize[_0x79a1('0x1')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x79a1('0xb')],'get':function(){return this[_0x79a1('0xc')](_0x79a1('0xd'))+'\x20-\x20'+this[_0x79a1('0xc')]('mailbox');}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 6181d10..7568aa8 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 _0x4cf8=['UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','merge','VIRTUAL','VoiceMail','include','findAll','catch','find','create','body','user','UserProfileSection','userProfileId','params','getMessages','findOne','VoiceMailMessage','mailbox','options','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Voicemails'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0x4cf8[_0x243b2f];return _0xcb3c2d;};'use strict';var emlformat=require(_0x84cf('0x0'));var rimraf=require(_0x84cf('0x1'));var zipdir=require(_0x84cf('0x2'));var jsonpatch=require(_0x84cf('0x3'));var rp=require(_0x84cf('0x4'));var moment=require(_0x84cf('0x5'));var BPromise=require(_0x84cf('0x6'));var Mustache=require(_0x84cf('0x7'));var util=require(_0x84cf('0x8'));var path=require(_0x84cf('0x9'));var sox=require(_0x84cf('0xa'));var csv=require(_0x84cf('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x84cf('0xc'));var squel=require('squel');var crypto=require(_0x84cf('0xd'));var jsforce=require(_0x84cf('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x84cf('0xb'));var querystring=require(_0x84cf('0xf'));var Papa=require('papaparse');var Redis=require(_0x84cf('0x10'));var authService=require(_0x84cf('0x11'));var qs=require(_0x84cf('0x12'));var as=require(_0x84cf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x84cf('0x14'))(_0x84cf('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x84cf('0x16'));var db=require(_0x84cf('0x17'))['db'];function respondWithStatusCode(_0x35f852,_0x33f83e){_0x33f83e=_0x33f83e||0xcc;return function(_0x172d04){if(_0x172d04){return _0x35f852[_0x84cf('0x18')](_0x33f83e);}return _0x35f852[_0x84cf('0x19')](_0x33f83e)[_0x84cf('0x1a')]();};}function respondWithResult(_0xced48,_0x250a19){_0x250a19=_0x250a19||0xc8;return function(_0x2fc41f){if(_0x2fc41f){return _0xced48[_0x84cf('0x19')](_0x250a19)[_0x84cf('0x1b')](_0x2fc41f);}};}function respondWithFilteredResult(_0x20e79c,_0x27261b){return function(_0x167c3e){if(_0x167c3e){var _0x464e70=typeof _0x27261b[_0x84cf('0x1c')]===_0x84cf('0x1d')&&typeof _0x27261b['limit']===_0x84cf('0x1d');var _0x5d6a93=_0x167c3e[_0x84cf('0x1e')];var _0x1abe2d=_0x464e70?0x0:_0x27261b[_0x84cf('0x1c')];var _0x13ba16=_0x464e70?_0x167c3e[_0x84cf('0x1e')]:_0x27261b['offset']+_0x27261b['limit'];var _0x42d6d4;if(_0x13ba16>=_0x5d6a93){_0x13ba16=_0x5d6a93;_0x42d6d4=0xc8;}else{_0x42d6d4=0xce;}_0x20e79c[_0x84cf('0x19')](_0x42d6d4);return _0x20e79c[_0x84cf('0x1f')](_0x84cf('0x20'),_0x1abe2d+'-'+_0x13ba16+'/'+_0x5d6a93)[_0x84cf('0x1b')](_0x167c3e);}return null;};}function patchUpdates(_0x5dda3f){return function(_0x39a37b){try{jsonpatch[_0x84cf('0x21')](_0x39a37b,_0x5dda3f,!![]);}catch(_0x3ca1be){return BPromise[_0x84cf('0x22')](_0x3ca1be);}return _0x39a37b[_0x84cf('0x23')]();};}function saveUpdates(_0x54405a,_0x42fa45){return function(_0x160f86){if(_0x160f86){return _0x160f86[_0x84cf('0x24')](_0x54405a)[_0x84cf('0x25')](function(_0x3e5e94){return _0x3e5e94;});}return null;};}function removeEntity(_0x29e9e1,_0x7feb4){return function(_0x4c9d1c){if(_0x4c9d1c){return _0x4c9d1c[_0x84cf('0x26')]()[_0x84cf('0x25')](function(){var _0x1c7747=_0x4c9d1c[_0x84cf('0x27')]({'plain':!![]});var _0x1d220a=_0x84cf('0x28');return db[_0x84cf('0x29')][_0x84cf('0x26')]({'where':{'type':_0x1d220a,'resourceId':_0x1c7747['id']}})[_0x84cf('0x25')](function(){return _0x4c9d1c;});})[_0x84cf('0x25')](function(){_0x29e9e1['status'](0xcc)[_0x84cf('0x1a')]();});}};}function handleEntityNotFound(_0x17bc92,_0x2a4973){return function(_0x41a5db){if(!_0x41a5db){_0x17bc92['sendStatus'](0x194);}return _0x41a5db;};}function handleError(_0x1595dd,_0x5a428c){_0x5a428c=_0x5a428c||0x1f4;return function(_0x29455e){logger[_0x84cf('0x2a')](_0x29455e[_0x84cf('0x2b')]);if(_0x29455e[_0x84cf('0x2c')]){delete _0x29455e[_0x84cf('0x2c')];}_0x1595dd[_0x84cf('0x19')](_0x5a428c)[_0x84cf('0x2d')](_0x29455e);};}exports[_0x84cf('0x2e')]=function(_0x1bfa56,_0xb4fc5a){var _0x31dbf5={},_0x308f8f={},_0x18243d={'count':0x0,'rows':[]};var _0x44f16e=_['map'](db['VoiceMail'][_0x84cf('0x2f')],function(_0x25de3a){return{'name':_0x25de3a[_0x84cf('0x30')],'type':_0x25de3a[_0x84cf('0x31')][_0x84cf('0x32')]};});_0x308f8f[_0x84cf('0x33')]=_[_0x84cf('0x34')](_0x44f16e,_0x84cf('0x2c'));_0x308f8f['query']=_[_0x84cf('0x35')](_0x1bfa56[_0x84cf('0x36')]);_0x308f8f['filters']=_[_0x84cf('0x37')](_0x308f8f['model'],_0x308f8f[_0x84cf('0x36')]);_0x31dbf5[_0x84cf('0x38')]=_[_0x84cf('0x37')](_0x308f8f[_0x84cf('0x33')],qs[_0x84cf('0x39')](_0x1bfa56['query'][_0x84cf('0x39')]));_0x31dbf5['attributes']=_0x31dbf5['attributes'][_0x84cf('0x3a')]?_0x31dbf5[_0x84cf('0x38')]:_0x308f8f['model'];if(!_0x1bfa56[_0x84cf('0x36')][_0x84cf('0x3b')](_0x84cf('0x3c'))){_0x31dbf5[_0x84cf('0x3d')]=qs[_0x84cf('0x3d')](_0x1bfa56[_0x84cf('0x36')]['limit']);_0x31dbf5[_0x84cf('0x1c')]=qs[_0x84cf('0x1c')](_0x1bfa56[_0x84cf('0x36')][_0x84cf('0x1c')]);}_0x31dbf5[_0x84cf('0x3e')]=qs[_0x84cf('0x3f')](_0x1bfa56['query'][_0x84cf('0x3f')]);_0x31dbf5['where']=qs[_0x84cf('0x40')](_[_0x84cf('0x41')](_0x1bfa56[_0x84cf('0x36')],_0x308f8f[_0x84cf('0x40')]),_0x44f16e);if(_0x1bfa56[_0x84cf('0x36')][_0x84cf('0x42')]){_0x31dbf5[_0x84cf('0x43')]=_[_0x84cf('0x44')](_0x31dbf5[_0x84cf('0x43')],{'$or':_['map'](_0x44f16e,function(_0x44e6f0){if(_0x44e6f0['type']!==_0x84cf('0x45')){var _0xc75386={};_0xc75386[_0x44e6f0['name']]={'$like':'%'+_0x1bfa56[_0x84cf('0x36')]['filter']+'%'};return _0xc75386;}})});}_0x31dbf5=_[_0x84cf('0x44')]({},_0x31dbf5,_0x1bfa56['options']);var _0x3fc160={'where':_0x31dbf5['where']};return db[_0x84cf('0x46')][_0x84cf('0x1e')](_0x3fc160)['then'](function(_0x847ce9){_0x18243d[_0x84cf('0x1e')]=_0x847ce9;if(_0x1bfa56[_0x84cf('0x36')]['includeAll']){_0x31dbf5[_0x84cf('0x47')]=[{'all':!![]}];}return db['VoiceMail'][_0x84cf('0x48')](_0x31dbf5);})['then'](function(_0x56b0e5){_0x18243d['rows']=_0x56b0e5;return _0x18243d;})[_0x84cf('0x25')](respondWithFilteredResult(_0xb4fc5a,_0x31dbf5))[_0x84cf('0x49')](handleError(_0xb4fc5a,null));};exports['show']=function(_0x2b737e,_0x56b623){var _0x191ad8={'raw':!![],'where':{'id':_0x2b737e['params']['id']}},_0x3fe8c1={};_0x3fe8c1[_0x84cf('0x33')]=_['keys'](db[_0x84cf('0x46')]['rawAttributes']);_0x3fe8c1['query']=_['keys'](_0x2b737e['query']);_0x3fe8c1['filters']=_['intersection'](_0x3fe8c1['model'],_0x3fe8c1[_0x84cf('0x36')]);_0x191ad8[_0x84cf('0x38')]=_[_0x84cf('0x37')](_0x3fe8c1[_0x84cf('0x33')],qs['fields'](_0x2b737e[_0x84cf('0x36')]['fields']));_0x191ad8[_0x84cf('0x38')]=_0x191ad8[_0x84cf('0x38')][_0x84cf('0x3a')]?_0x191ad8[_0x84cf('0x38')]:_0x3fe8c1[_0x84cf('0x33')];if(_0x2b737e[_0x84cf('0x36')]['includeAll']){_0x191ad8[_0x84cf('0x47')]=[{'all':!![]}];}_0x191ad8=_[_0x84cf('0x44')]({},_0x191ad8,_0x2b737e['options']);return db[_0x84cf('0x46')][_0x84cf('0x4a')](_0x191ad8)[_0x84cf('0x25')](handleEntityNotFound(_0x56b623,null))['then'](respondWithResult(_0x56b623,null))['catch'](handleError(_0x56b623,null));};exports['create']=function(_0x1cf3f6,_0x104421){return db[_0x84cf('0x46')][_0x84cf('0x4b')](_0x1cf3f6[_0x84cf('0x4c')],{})[_0x84cf('0x25')](function(_0x51d725){var _0x350985=_0x1cf3f6['user'][_0x84cf('0x27')]({'plain':!![]});if(!_0x350985)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x350985['role']===_0x84cf('0x4d')){var _0xb1c3a8=_0x51d725[_0x84cf('0x27')]({'plain':!![]});var _0x55e24e='Voicemails';return db[_0x84cf('0x4e')][_0x84cf('0x4a')]({'where':{'name':_0x55e24e,'userProfileId':_0x350985[_0x84cf('0x4f')]},'raw':!![]})[_0x84cf('0x25')](function(_0x401ced){if(_0x401ced&&_0x401ced['autoAssociation']===0x0){return db[_0x84cf('0x29')][_0x84cf('0x4b')]({'name':_0xb1c3a8['name'],'resourceId':_0xb1c3a8['id'],'type':_0x401ced[_0x84cf('0x2c')],'sectionId':_0x401ced['id']},{})['then'](function(){return _0x51d725;});}else{return _0x51d725;}})['catch'](function(_0x147194){logger[_0x84cf('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x147194);throw _0x147194;});}return _0x51d725;})['then'](respondWithResult(_0x104421,0xc9))[_0x84cf('0x49')](handleError(_0x104421,null));};exports[_0x84cf('0x24')]=function(_0x2f739a,_0x1e2676){if(_0x2f739a[_0x84cf('0x4c')]['id']){delete _0x2f739a[_0x84cf('0x4c')]['id'];}return db[_0x84cf('0x46')][_0x84cf('0x4a')]({'where':{'id':_0x2f739a['params']['id']}})[_0x84cf('0x25')](handleEntityNotFound(_0x1e2676,null))[_0x84cf('0x25')](saveUpdates(_0x2f739a['body'],null))['then'](respondWithResult(_0x1e2676,null))[_0x84cf('0x49')](handleError(_0x1e2676,null));};exports[_0x84cf('0x26')]=function(_0x3912cb,_0x2a4f20){return db[_0x84cf('0x46')][_0x84cf('0x4a')]({'where':{'id':_0x3912cb[_0x84cf('0x50')]['id']}})['then'](handleEntityNotFound(_0x2a4f20,null))[_0x84cf('0x25')](removeEntity(_0x2a4f20,null))['catch'](handleError(_0x2a4f20,null));};exports[_0x84cf('0x51')]=function(_0x5c0122,_0x2a60bc,_0x1c2f1b){return db['VoiceMail'][_0x84cf('0x52')]({'where':{'id':_0x5c0122[_0x84cf('0x50')]['id']}})['then'](handleEntityNotFound(_0x2a60bc,null))[_0x84cf('0x25')](function(_0x53bfb8){var _0x577d55;var _0x5cc371={},_0x50cde2={};_0x50cde2[_0x84cf('0x33')]=_[_0x84cf('0x35')](db[_0x84cf('0x53')][_0x84cf('0x2f')]);_0x50cde2['query']=_[_0x84cf('0x35')](_0x5c0122[_0x84cf('0x36')]);_0x50cde2['filters']=_[_0x84cf('0x37')](_0x50cde2[_0x84cf('0x33')],_0x50cde2[_0x84cf('0x36')]);_0x5cc371[_0x84cf('0x38')]=_[_0x84cf('0x37')](_0x50cde2[_0x84cf('0x33')],qs[_0x84cf('0x39')](_0x5c0122[_0x84cf('0x36')]['fields']));_0x5cc371[_0x84cf('0x38')]=_0x5cc371['attributes'][_0x84cf('0x3a')]?_0x5cc371[_0x84cf('0x38')]:_0x50cde2[_0x84cf('0x33')];if(!_0x5c0122[_0x84cf('0x36')][_0x84cf('0x3b')]('nolimit')){_0x5cc371[_0x84cf('0x3d')]=qs[_0x84cf('0x3d')](_0x5c0122[_0x84cf('0x36')]['limit']);_0x5cc371[_0x84cf('0x1c')]=qs[_0x84cf('0x1c')](_0x5c0122['query'][_0x84cf('0x1c')]);}_0x5cc371['order']=qs[_0x84cf('0x3f')](_0x5c0122[_0x84cf('0x36')]['sort']);_0x5cc371[_0x84cf('0x43')]=qs[_0x84cf('0x40')](_['pick'](_0x5c0122[_0x84cf('0x36')],_0x50cde2[_0x84cf('0x40')]));if(_0x5c0122[_0x84cf('0x36')][_0x84cf('0x42')]){_0x5cc371['where']=_[_0x84cf('0x44')](_0x5cc371[_0x84cf('0x43')],{'$or':_['map'](_0x5cc371['attributes'],function(_0x4d40e2){var _0x1b000c={};_0x1b000c[_0x4d40e2]={'$like':'%'+_0x5c0122[_0x84cf('0x36')][_0x84cf('0x42')]+'%'};return _0x1b000c;})});}_0x5cc371['where']=_['merge'](_0x5cc371[_0x84cf('0x43')],{'mailboxuser':_0x53bfb8[_0x84cf('0x54')]});_0x5cc371=_[_0x84cf('0x44')]({},_0x5cc371,_0x5c0122[_0x84cf('0x55')]);return db[_0x84cf('0x53')][_0x84cf('0x56')](_0x5cc371)[_0x84cf('0x25')](respondWithFilteredResult(_0x2a60bc,_0x5cc371));})[_0x84cf('0x49')](handleError(_0x2a60bc,null));}; \ No newline at end of file +var _0xa902=['limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','stack','name','send','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','nolimit','where','pick','filter','merge','type','VIRTUAL','options','VoiceMail','includeAll','findAll','rows','catch','show','include','find','create','role','UserProfileSection','error','body','params','getMessages','findOne','hasOwnProperty','sort','mailbox','VoiceMailMessage','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x470611,_0x2a02e2){var _0x1e2d36=function(_0xc6a146){while(--_0xc6a146){_0x470611['push'](_0x470611['shift']());}};_0x1e2d36(++_0x2a02e2);}(_0xa902,0x8d));var _0x2a90=function(_0x515e13,_0x3fabd7){_0x515e13=_0x515e13-0x0;var _0x1dd659=_0xa902[_0x515e13];return _0x1dd659;};'use strict';var emlformat=require(_0x2a90('0x0'));var rimraf=require(_0x2a90('0x1'));var zipdir=require(_0x2a90('0x2'));var jsonpatch=require(_0x2a90('0x3'));var rp=require(_0x2a90('0x4'));var moment=require('moment');var BPromise=require(_0x2a90('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2a90('0x6'));var sox=require(_0x2a90('0x7'));var csv=require(_0x2a90('0x8'));var ejs=require(_0x2a90('0x9'));var fs=require('fs');var fs_extra=require(_0x2a90('0xa'));var _=require(_0x2a90('0xb'));var squel=require('squel');var crypto=require(_0x2a90('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2a90('0x8'));var querystring=require(_0x2a90('0xd'));var Papa=require(_0x2a90('0xe'));var Redis=require(_0x2a90('0xf'));var authService=require(_0x2a90('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x2a90('0x11'));var hardwareService=require(_0x2a90('0x12'));var logger=require(_0x2a90('0x13'))(_0x2a90('0x14'));var utils=require('../../config/utils');var config=require(_0x2a90('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x2a90('0x16'))['db'];function respondWithStatusCode(_0x57458a,_0x1f6953){_0x1f6953=_0x1f6953||0xcc;return function(_0x57aee3){if(_0x57aee3){return _0x57458a[_0x2a90('0x17')](_0x1f6953);}return _0x57458a[_0x2a90('0x18')](_0x1f6953)[_0x2a90('0x19')]();};}function respondWithResult(_0x4c328b,_0x56d1b8){_0x56d1b8=_0x56d1b8||0xc8;return function(_0x57227c){if(_0x57227c){return _0x4c328b[_0x2a90('0x18')](_0x56d1b8)[_0x2a90('0x1a')](_0x57227c);}};}function respondWithFilteredResult(_0x5a2682,_0x1ff63d){return function(_0x21c648){if(_0x21c648){var _0x312782=typeof _0x1ff63d[_0x2a90('0x1b')]===_0x2a90('0x1c')&&typeof _0x1ff63d[_0x2a90('0x1d')]===_0x2a90('0x1c');var _0x10cf94=_0x21c648[_0x2a90('0x1e')];var _0x5c3e4b=_0x312782?0x0:_0x1ff63d[_0x2a90('0x1b')];var _0x1d9a28=_0x312782?_0x21c648[_0x2a90('0x1e')]:_0x1ff63d['offset']+_0x1ff63d[_0x2a90('0x1d')];var _0x1f51a6;if(_0x1d9a28>=_0x10cf94){_0x1d9a28=_0x10cf94;_0x1f51a6=0xc8;}else{_0x1f51a6=0xce;}_0x5a2682[_0x2a90('0x18')](_0x1f51a6);return _0x5a2682[_0x2a90('0x1f')](_0x2a90('0x20'),_0x5c3e4b+'-'+_0x1d9a28+'/'+_0x10cf94)[_0x2a90('0x1a')](_0x21c648);}return null;};}function patchUpdates(_0x312cd5){return function(_0x114d42){try{jsonpatch[_0x2a90('0x21')](_0x114d42,_0x312cd5,!![]);}catch(_0x465284){return BPromise[_0x2a90('0x22')](_0x465284);}return _0x114d42[_0x2a90('0x23')]();};}function saveUpdates(_0x4fdd62,_0x3da7d0){return function(_0x217873){if(_0x217873){return _0x217873[_0x2a90('0x24')](_0x4fdd62)[_0x2a90('0x25')](function(_0x5912fd){return _0x5912fd;});}return null;};}function removeEntity(_0x180485,_0xd033d){return function(_0x4ed9e6){if(_0x4ed9e6){return _0x4ed9e6[_0x2a90('0x26')]()[_0x2a90('0x25')](function(){var _0x10a6dd=_0x4ed9e6[_0x2a90('0x27')]({'plain':!![]});var _0x2a212c=_0x2a90('0x28');return db[_0x2a90('0x29')][_0x2a90('0x26')]({'where':{'type':_0x2a212c,'resourceId':_0x10a6dd['id']}})['then'](function(){return _0x4ed9e6;});})[_0x2a90('0x25')](function(){_0x180485[_0x2a90('0x18')](0xcc)[_0x2a90('0x19')]();});}};}function handleEntityNotFound(_0x40c61a,_0x8544e5){return function(_0x5208d8){if(!_0x5208d8){_0x40c61a['sendStatus'](0x194);}return _0x5208d8;};}function handleError(_0x293765,_0x4ed64a){_0x4ed64a=_0x4ed64a||0x1f4;return function(_0x53391e){logger['error'](_0x53391e[_0x2a90('0x2a')]);if(_0x53391e[_0x2a90('0x2b')]){delete _0x53391e['name'];}_0x293765['status'](_0x4ed64a)[_0x2a90('0x2c')](_0x53391e);};}exports['index']=function(_0x35570e,_0x6892e1){var _0x3b580f={},_0x27b6b6={},_0xf18d11={'count':0x0,'rows':[]};var _0x11586c=_[_0x2a90('0x2d')](db['VoiceMail'][_0x2a90('0x2e')],function(_0x22b1f3){return{'name':_0x22b1f3[_0x2a90('0x2f')],'type':_0x22b1f3['type'][_0x2a90('0x30')]};});_0x27b6b6[_0x2a90('0x31')]=_[_0x2a90('0x2d')](_0x11586c,_0x2a90('0x2b'));_0x27b6b6['query']=_[_0x2a90('0x32')](_0x35570e[_0x2a90('0x33')]);_0x27b6b6[_0x2a90('0x34')]=_[_0x2a90('0x35')](_0x27b6b6[_0x2a90('0x31')],_0x27b6b6[_0x2a90('0x33')]);_0x3b580f['attributes']=_[_0x2a90('0x35')](_0x27b6b6[_0x2a90('0x31')],qs[_0x2a90('0x36')](_0x35570e[_0x2a90('0x33')]['fields']));_0x3b580f[_0x2a90('0x37')]=_0x3b580f[_0x2a90('0x37')]['length']?_0x3b580f[_0x2a90('0x37')]:_0x27b6b6[_0x2a90('0x31')];if(!_0x35570e['query']['hasOwnProperty'](_0x2a90('0x38'))){_0x3b580f[_0x2a90('0x1d')]=qs[_0x2a90('0x1d')](_0x35570e['query'][_0x2a90('0x1d')]);_0x3b580f['offset']=qs[_0x2a90('0x1b')](_0x35570e['query'][_0x2a90('0x1b')]);}_0x3b580f['order']=qs['sort'](_0x35570e[_0x2a90('0x33')]['sort']);_0x3b580f[_0x2a90('0x39')]=qs[_0x2a90('0x34')](_[_0x2a90('0x3a')](_0x35570e['query'],_0x27b6b6[_0x2a90('0x34')]),_0x11586c);if(_0x35570e[_0x2a90('0x33')][_0x2a90('0x3b')]){_0x3b580f['where']=_[_0x2a90('0x3c')](_0x3b580f[_0x2a90('0x39')],{'$or':_[_0x2a90('0x2d')](_0x11586c,function(_0x580667){if(_0x580667[_0x2a90('0x3d')]!==_0x2a90('0x3e')){var _0x504643={};_0x504643[_0x580667[_0x2a90('0x2b')]]={'$like':'%'+_0x35570e[_0x2a90('0x33')][_0x2a90('0x3b')]+'%'};return _0x504643;}})});}_0x3b580f=_[_0x2a90('0x3c')]({},_0x3b580f,_0x35570e[_0x2a90('0x3f')]);var _0x3f2685={'where':_0x3b580f[_0x2a90('0x39')]};return db[_0x2a90('0x40')][_0x2a90('0x1e')](_0x3f2685)[_0x2a90('0x25')](function(_0x45b41c){_0xf18d11[_0x2a90('0x1e')]=_0x45b41c;if(_0x35570e[_0x2a90('0x33')][_0x2a90('0x41')]){_0x3b580f['include']=[{'all':!![]}];}return db[_0x2a90('0x40')][_0x2a90('0x42')](_0x3b580f);})['then'](function(_0x1045bb){_0xf18d11[_0x2a90('0x43')]=_0x1045bb;return _0xf18d11;})[_0x2a90('0x25')](respondWithFilteredResult(_0x6892e1,_0x3b580f))[_0x2a90('0x44')](handleError(_0x6892e1,null));};exports[_0x2a90('0x45')]=function(_0x54b290,_0x145925){var _0x5c6d21={'raw':!![],'where':{'id':_0x54b290['params']['id']}},_0x4566a6={};_0x4566a6[_0x2a90('0x31')]=_[_0x2a90('0x32')](db[_0x2a90('0x40')][_0x2a90('0x2e')]);_0x4566a6[_0x2a90('0x33')]=_[_0x2a90('0x32')](_0x54b290[_0x2a90('0x33')]);_0x4566a6['filters']=_['intersection'](_0x4566a6[_0x2a90('0x31')],_0x4566a6[_0x2a90('0x33')]);_0x5c6d21[_0x2a90('0x37')]=_[_0x2a90('0x35')](_0x4566a6[_0x2a90('0x31')],qs[_0x2a90('0x36')](_0x54b290[_0x2a90('0x33')][_0x2a90('0x36')]));_0x5c6d21['attributes']=_0x5c6d21[_0x2a90('0x37')]['length']?_0x5c6d21[_0x2a90('0x37')]:_0x4566a6[_0x2a90('0x31')];if(_0x54b290['query'][_0x2a90('0x41')]){_0x5c6d21[_0x2a90('0x46')]=[{'all':!![]}];}_0x5c6d21=_[_0x2a90('0x3c')]({},_0x5c6d21,_0x54b290[_0x2a90('0x3f')]);return db[_0x2a90('0x40')][_0x2a90('0x47')](_0x5c6d21)[_0x2a90('0x25')](handleEntityNotFound(_0x145925,null))['then'](respondWithResult(_0x145925,null))['catch'](handleError(_0x145925,null));};exports[_0x2a90('0x48')]=function(_0x2611d0,_0x42c890){return db[_0x2a90('0x40')][_0x2a90('0x48')](_0x2611d0['body'],{})['then'](function(_0x10505c){var _0x386e75=_0x2611d0['user']['get']({'plain':!![]});if(!_0x386e75)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x386e75[_0x2a90('0x49')]==='user'){var _0x370da3=_0x10505c[_0x2a90('0x27')]({'plain':!![]});var _0x272d07=_0x2a90('0x28');return db[_0x2a90('0x4a')][_0x2a90('0x47')]({'where':{'name':_0x272d07,'userProfileId':_0x386e75['userProfileId']},'raw':!![]})[_0x2a90('0x25')](function(_0x46115e){if(_0x46115e&&_0x46115e['autoAssociation']===0x0){return db[_0x2a90('0x29')]['create']({'name':_0x370da3['name'],'resourceId':_0x370da3['id'],'type':_0x46115e[_0x2a90('0x2b')],'sectionId':_0x46115e['id']},{})[_0x2a90('0x25')](function(){return _0x10505c;});}else{return _0x10505c;}})['catch'](function(_0x4c0cb2){logger[_0x2a90('0x4b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c0cb2);throw _0x4c0cb2;});}return _0x10505c;})[_0x2a90('0x25')](respondWithResult(_0x42c890,0xc9))[_0x2a90('0x44')](handleError(_0x42c890,null));};exports['update']=function(_0x366429,_0x29bb7d){if(_0x366429[_0x2a90('0x4c')]['id']){delete _0x366429['body']['id'];}return db[_0x2a90('0x40')][_0x2a90('0x47')]({'where':{'id':_0x366429['params']['id']}})['then'](handleEntityNotFound(_0x29bb7d,null))[_0x2a90('0x25')](saveUpdates(_0x366429[_0x2a90('0x4c')],null))['then'](respondWithResult(_0x29bb7d,null))[_0x2a90('0x44')](handleError(_0x29bb7d,null));};exports['destroy']=function(_0x1302b9,_0x5ab061){return db[_0x2a90('0x40')][_0x2a90('0x47')]({'where':{'id':_0x1302b9[_0x2a90('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5ab061,null))['then'](removeEntity(_0x5ab061,null))['catch'](handleError(_0x5ab061,null));};exports[_0x2a90('0x4e')]=function(_0x37adad,_0x3793e5,_0x469d3c){return db[_0x2a90('0x40')][_0x2a90('0x4f')]({'where':{'id':_0x37adad[_0x2a90('0x4d')]['id']}})[_0x2a90('0x25')](handleEntityNotFound(_0x3793e5,null))[_0x2a90('0x25')](function(_0x4f4dc6){var _0x18bb86;var _0x2442e1={},_0xb816a8={};_0xb816a8['model']=_['keys'](db['VoiceMailMessage'][_0x2a90('0x2e')]);_0xb816a8[_0x2a90('0x33')]=_[_0x2a90('0x32')](_0x37adad[_0x2a90('0x33')]);_0xb816a8[_0x2a90('0x34')]=_[_0x2a90('0x35')](_0xb816a8[_0x2a90('0x31')],_0xb816a8[_0x2a90('0x33')]);_0x2442e1[_0x2a90('0x37')]=_[_0x2a90('0x35')](_0xb816a8[_0x2a90('0x31')],qs[_0x2a90('0x36')](_0x37adad[_0x2a90('0x33')][_0x2a90('0x36')]));_0x2442e1[_0x2a90('0x37')]=_0x2442e1[_0x2a90('0x37')]['length']?_0x2442e1[_0x2a90('0x37')]:_0xb816a8['model'];if(!_0x37adad[_0x2a90('0x33')][_0x2a90('0x50')](_0x2a90('0x38'))){_0x2442e1[_0x2a90('0x1d')]=qs[_0x2a90('0x1d')](_0x37adad[_0x2a90('0x33')][_0x2a90('0x1d')]);_0x2442e1['offset']=qs[_0x2a90('0x1b')](_0x37adad[_0x2a90('0x33')][_0x2a90('0x1b')]);}_0x2442e1['order']=qs[_0x2a90('0x51')](_0x37adad[_0x2a90('0x33')][_0x2a90('0x51')]);_0x2442e1[_0x2a90('0x39')]=qs['filters'](_[_0x2a90('0x3a')](_0x37adad['query'],_0xb816a8[_0x2a90('0x34')]));if(_0x37adad[_0x2a90('0x33')][_0x2a90('0x3b')]){_0x2442e1[_0x2a90('0x39')]=_[_0x2a90('0x3c')](_0x2442e1[_0x2a90('0x39')],{'$or':_['map'](_0x2442e1[_0x2a90('0x37')],function(_0x2347b6){var _0x120c17={};_0x120c17[_0x2347b6]={'$like':'%'+_0x37adad[_0x2a90('0x33')][_0x2a90('0x3b')]+'%'};return _0x120c17;})});}_0x2442e1[_0x2a90('0x39')]=_[_0x2a90('0x3c')](_0x2442e1[_0x2a90('0x39')],{'mailboxuser':_0x4f4dc6[_0x2a90('0x52')]});_0x2442e1=_['merge']({},_0x2442e1,_0x37adad[_0x2a90('0x3f')]);return db[_0x2a90('0x53')][_0x2a90('0x54')](_0x2442e1)['then'](respondWithFilteredResult(_0x3793e5,_0x2442e1));})[_0x2a90('0x44')](handleError(_0x3793e5,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 4e36f69..f584c89 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 _0x63c5=['context','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','exports','define','voice_voicemail'];(function(_0x5dab60,_0x5c7d82){var _0xc107ff=function(_0x5b80a3){while(--_0x5b80a3){_0x5dab60['push'](_0x5dab60['shift']());}};_0xc107ff(++_0x5c7d82);}(_0x63c5,0x177));var _0x563c=function(_0x2e6dee,_0x1a61b0){_0x2e6dee=_0x2e6dee-0x0;var _0x47706=_0x63c5[_0x2e6dee];return _0x47706;};'use strict';var _=require(_0x563c('0x0'));var util=require(_0x563c('0x1'));var logger=require(_0x563c('0x2'))('api');var moment=require('moment');var BPromise=require(_0x563c('0x3'));var rp=require(_0x563c('0x4'));var fs=require('fs');var path=require(_0x563c('0x5'));var rimraf=require(_0x563c('0x6'));var config=require('../../config/environment');var attributes=require('./voiceMail.attributes');module[_0x563c('0x7')]=function(_0x50fb0e,_0x1d10ec){return _0x50fb0e[_0x563c('0x8')]('VoiceMail',attributes,{'tableName':_0x563c('0x9'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':['mailbox',_0x563c('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9f93=['./voiceMail.attributes','define','voice_voicemail','mailbox_context','mailbox','context','lodash','util','../../config/logger','moment','bluebird','../../config/environment'];(function(_0x4da005,_0x5959e7){var _0x2a9787=function(_0x3b7b07){while(--_0x3b7b07){_0x4da005['push'](_0x4da005['shift']());}};_0x2a9787(++_0x5959e7);}(_0x9f93,0x8a));var _0x39f9=function(_0x2abef2,_0x4bca97){_0x2abef2=_0x2abef2-0x0;var _0x15fcbb=_0x9f93[_0x2abef2];return _0x15fcbb;};'use strict';var _=require(_0x39f9('0x0'));var util=require(_0x39f9('0x1'));var logger=require(_0x39f9('0x2'))('api');var moment=require(_0x39f9('0x3'));var BPromise=require(_0x39f9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x39f9('0x5'));var attributes=require(_0x39f9('0x6'));module['exports']=function(_0x2a3351,_0x4ddd69){return _0x2a3351[_0x39f9('0x7')]('VoiceMail',attributes,{'tableName':_0x39f9('0x8'),'paranoid':![],'indexes':[{'name':_0x39f9('0x9'),'fields':[_0x39f9('0xa'),_0x39f9('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 a86dfb8..ada097c 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 _0x9f93=['debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceMail,\x20%s,\x20%s','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x3e1eec,_0x111050){var _0x4dead5=function(_0x33e0e3){while(--_0x33e0e3){_0x3e1eec['push'](_0x3e1eec['shift']());}};_0x4dead5(++_0x111050);}(_0x9f93,0x71));var _0x39f9=function(_0x2f2b6a,_0x442549){_0x2f2b6a=_0x2f2b6a-0x0;var _0x3c80a8=_0x9f93[_0x2f2b6a];return _0x3c80a8;};'use strict';var _=require(_0x39f9('0x0'));var util=require(_0x39f9('0x1'));var moment=require(_0x39f9('0x2'));var BPromise=require('bluebird');var rs=require(_0x39f9('0x3'));var fs=require('fs');var Redis=require(_0x39f9('0x4'));var db=require(_0x39f9('0x5'))['db'];var utils=require(_0x39f9('0x6'));var logger=require(_0x39f9('0x7'))(_0x39f9('0x8'));var config=require(_0x39f9('0x9'));var jayson=require(_0x39f9('0xa'));var client=jayson[_0x39f9('0xb')][_0x39f9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x172c14,_0x3bddb7,_0x542fb0){return new BPromise(function(_0x4eae54,_0x3f132b){return client[_0x39f9('0xd')](_0x172c14,_0x542fb0)[_0x39f9('0xe')](function(_0x531e14){logger[_0x39f9('0xf')]('VoiceMail,\x20%s,\x20%s',_0x3bddb7,_0x39f9('0x10'));logger[_0x39f9('0x11')](_0x39f9('0x12'),_0x3bddb7,_0x39f9('0x10'),JSON[_0x39f9('0x13')](_0x531e14));if(_0x531e14[_0x39f9('0x14')]){if(_0x531e14[_0x39f9('0x14')][_0x39f9('0x15')]===0x1f4){logger['error']('VoiceMail,\x20%s,\x20%s',_0x3bddb7,_0x531e14[_0x39f9('0x14')][_0x39f9('0x16')]);return _0x3f132b(_0x531e14['error'][_0x39f9('0x16')]);}logger[_0x39f9('0x14')](_0x39f9('0x17'),_0x3bddb7,_0x531e14[_0x39f9('0x14')][_0x39f9('0x16')]);return _0x4eae54(_0x531e14[_0x39f9('0x14')][_0x39f9('0x16')]);}else{logger[_0x39f9('0xf')](_0x39f9('0x17'),_0x3bddb7,_0x39f9('0x10'));_0x4eae54(_0x531e14[_0x39f9('0x18')]['message']);}})[_0x39f9('0x19')](function(_0x104363){logger[_0x39f9('0x14')]('VoiceMail,\x20%s,\x20%s',_0x3bddb7,_0x104363);_0x3f132b(_0x104363);});});} \ No newline at end of file +var _0x7d91=['jayson/promise','http','request','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x7d91,0x91));var _0x17d9=function(_0x1abd98,_0x4efa0b){_0x1abd98=_0x1abd98-0x0;var _0x547194=_0x7d91[_0x1abd98];return _0x547194;};'use strict';var _=require(_0x17d9('0x0'));var util=require(_0x17d9('0x1'));var moment=require('moment');var BPromise=require(_0x17d9('0x2'));var rs=require(_0x17d9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x17d9('0x4'))['db'];var utils=require(_0x17d9('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x17d9('0x6'));var jayson=require(_0x17d9('0x7'));var client=jayson['client'][_0x17d9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x169186,_0x441875,_0x4362d9){return new BPromise(function(_0xdf4d1b,_0x4effdb){return client[_0x17d9('0x9')](_0x169186,_0x4362d9)['then'](function(_0x216c60){logger[_0x17d9('0xa')](_0x17d9('0xb'),_0x441875,_0x17d9('0xc'));logger[_0x17d9('0xd')](_0x17d9('0xe'),_0x441875,_0x17d9('0xc'),JSON[_0x17d9('0xf')](_0x216c60));if(_0x216c60[_0x17d9('0x10')]){if(_0x216c60['error']['code']===0x1f4){logger[_0x17d9('0x10')](_0x17d9('0xb'),_0x441875,_0x216c60[_0x17d9('0x10')][_0x17d9('0x11')]);return _0x4effdb(_0x216c60[_0x17d9('0x10')][_0x17d9('0x11')]);}logger['error'](_0x17d9('0xb'),_0x441875,_0x216c60[_0x17d9('0x10')][_0x17d9('0x11')]);return _0xdf4d1b(_0x216c60[_0x17d9('0x10')][_0x17d9('0x11')]);}else{logger[_0x17d9('0xa')](_0x17d9('0xb'),_0x441875,_0x17d9('0xc'));_0xdf4d1b(_0x216c60[_0x17d9('0x12')]['message']);}})['catch'](function(_0x4ffb19){logger['error'](_0x17d9('0xb'),_0x441875,_0x4ffb19);_0x4effdb(_0x4ffb19);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 73c47fc..3624b8e 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 _0x21c2=['../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show','download','post','create','put','update','destroy','exports','multer','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x3d3eab,_0x501fd3){var _0xab469b=function(_0xb956ca){while(--_0xb956ca){_0x3d3eab['push'](_0x3d3eab['shift']());}};_0xab469b(++_0x501fd3);}(_0x21c2,0x93));var _0x221c=function(_0x5b33bb,_0x1a55fa){_0x5b33bb=_0x5b33bb-0x0;var _0x4347f6=_0x21c2[_0x5b33bb];return _0x4347f6;};'use strict';var multer=require(_0x221c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x221c('0x1'));var express=require(_0x221c('0x2'));var router=express[_0x221c('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x221c('0x4'));var config=require(_0x221c('0x5'));var controller=require(_0x221c('0x6'));router[_0x221c('0x7')]('/',auth[_0x221c('0x8')](),controller[_0x221c('0x9')]);router[_0x221c('0x7')](_0x221c('0xa'),auth['isAuthenticated'](),controller[_0x221c('0xb')]);router[_0x221c('0x7')]('/:id/download',auth['isAuthenticated'](),controller[_0x221c('0xc')]);router[_0x221c('0xd')]('/',auth[_0x221c('0x8')](),controller[_0x221c('0xe')]);router[_0x221c('0xf')](_0x221c('0xa'),auth[_0x221c('0x8')](),controller[_0x221c('0x10')]);router['delete'](_0x221c('0xa'),auth[_0x221c('0x8')](),controller[_0x221c('0x11')]);module[_0x221c('0x12')]=router; \ No newline at end of file +var _0x23c3=['update','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMailMessage.controller','get','isAuthenticated','/:id','/:id/download','download','post','create','put'];(function(_0x327fb0,_0x387a15){var _0x13b762=function(_0x24d37a){while(--_0x24d37a){_0x327fb0['push'](_0x327fb0['shift']());}};_0x13b762(++_0x387a15);}(_0x23c3,0x16c));var _0x323c=function(_0x3a07c1,_0x34d57f){_0x3a07c1=_0x3a07c1-0x0;var _0x2bbe15=_0x23c3[_0x3a07c1];return _0x2bbe15;};'use strict';var multer=require(_0x323c('0x0'));var util=require('util');var path=require(_0x323c('0x1'));var timeout=require('connect-timeout');var express=require(_0x323c('0x2'));var router=express[_0x323c('0x3')]();var fs_extra=require(_0x323c('0x4'));var auth=require(_0x323c('0x5'));var interaction=require(_0x323c('0x6'));var config=require('../../config/environment');var controller=require(_0x323c('0x7'));router[_0x323c('0x8')]('/',auth[_0x323c('0x9')](),controller['index']);router['get'](_0x323c('0xa'),auth[_0x323c('0x9')](),controller['show']);router[_0x323c('0x8')](_0x323c('0xb'),auth[_0x323c('0x9')](),controller[_0x323c('0xc')]);router[_0x323c('0xd')]('/',auth[_0x323c('0x9')](),controller[_0x323c('0xe')]);router[_0x323c('0xf')]('/:id',auth[_0x323c('0x9')](),controller[_0x323c('0x10')]);router[_0x323c('0x11')]('/:id',auth[_0x323c('0x9')](),controller[_0x323c('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 3e7e9ec..54ad23b 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 _0x949e=['TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','STRING','BLOB','long'];(function(_0x14e086,_0x11be66){var _0x321afd=function(_0x512756){while(--_0x512756){_0x14e086['push'](_0x14e086['shift']());}};_0x321afd(++_0x11be66);}(_0x949e,0x1c5));var _0xe949=function(_0x374e4e,_0x2d27c4){_0x374e4e=_0x374e4e-0x0;var _0xe05052=_0x949e[_0x374e4e];return _0xe05052;};'use strict';var Sequelize=require(_0xe949('0x0'));module[_0xe949('0x1')]={'name':{'type':Sequelize[_0xe949('0x2')],'get':function(_0x4c3232){return this[_0xe949('0x3')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xe949('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0xe949('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0xe949('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xe949('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0xe949('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xe949('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xe949('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0xe949('0x5')](_0xe949('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0xe949('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xe949('0x4')],'defaultValue':''},'stamp':{'type':_0xe949('0x7'),'defaultValue':Sequelize[_0xe949('0x8')](_0xe949('0x9'))}}; \ No newline at end of file +var _0x5543=['long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING'];(function(_0x23c27e,_0x5dfc84){var _0x2451d0=function(_0x4b174a){while(--_0x4b174a){_0x23c27e['push'](_0x23c27e['shift']());}};_0x2451d0(++_0x5dfc84);}(_0x5543,0x194));var _0x3554=function(_0x589aee,_0x140a03){_0x589aee=_0x589aee-0x0;var _0x2f5ed4=_0x5543[_0x589aee];return _0x2f5ed4;};'use strict';var Sequelize=require(_0x3554('0x0'));module[_0x3554('0x1')]={'name':{'type':Sequelize[_0x3554('0x2')],'get':function(_0x3d58a3){return this[_0x3554('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x3554('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x3554('0x5')],'defaultValue':''},'context':{'type':Sequelize[_0x3554('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x3554('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0x3554('0x5')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0x3554('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x3554('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x3554('0x5')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x3554('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x3554('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x3554('0x5')],'defaultValue':''},'stamp':{'type':_0x3554('0x7'),'defaultValue':Sequelize[_0x3554('0x8')](_0x3554('0x9'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 11fe378..aebce3d 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 _0xcfad=['where','filters','pick','filter','VIRTUAL','merge','options','VoiceMailMessage','findAll','catch','show','rawAttributes','include','find','create','body','params','download','msg_id','recording','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','.wav\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','then','error','name','send','index','map','fieldName','type','model','differenceBy','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort'];(function(_0x216008,_0x2d1023){var _0x4d384f=function(_0x3fd7e2){while(--_0x3fd7e2){_0x216008['push'](_0x216008['shift']());}};_0x4d384f(++_0x2d1023);}(_0xcfad,0xc6));var _0xdcfa=function(_0x3b7338,_0x451e60){_0x3b7338=_0x3b7338-0x0;var _0x291cb2=_0xcfad[_0x3b7338];return _0x291cb2;};'use strict';var emlformat=require(_0xdcfa('0x0'));var rimraf=require(_0xdcfa('0x1'));var zipdir=require(_0xdcfa('0x2'));var jsonpatch=require(_0xdcfa('0x3'));var rp=require(_0xdcfa('0x4'));var moment=require(_0xdcfa('0x5'));var BPromise=require(_0xdcfa('0x6'));var Mustache=require(_0xdcfa('0x7'));var util=require(_0xdcfa('0x8'));var path=require(_0xdcfa('0x9'));var sox=require(_0xdcfa('0xa'));var csv=require('to-csv');var ejs=require(_0xdcfa('0xb'));var fs=require('fs');var fs_extra=require(_0xdcfa('0xc'));var _=require(_0xdcfa('0xd'));var squel=require('squel');var crypto=require(_0xdcfa('0xe'));var jsforce=require(_0xdcfa('0xf'));var deskjs=require(_0xdcfa('0x10'));var toCsv=require(_0xdcfa('0x11'));var querystring=require('querystring');var Papa=require(_0xdcfa('0x12'));var Redis=require(_0xdcfa('0x13'));var authService=require(_0xdcfa('0x14'));var qs=require(_0xdcfa('0x15'));var as=require(_0xdcfa('0x16'));var hardwareService=require(_0xdcfa('0x17'));var logger=require('../../config/logger')(_0xdcfa('0x18'));var utils=require(_0xdcfa('0x19'));var config=require(_0xdcfa('0x1a'));var licenseUtil=require(_0xdcfa('0x1b'));var db=require(_0xdcfa('0x1c'))['db'];function respondWithStatusCode(_0x14e799,_0x2ca5da){_0x2ca5da=_0x2ca5da||0xcc;return function(_0x897863){if(_0x897863){return _0x14e799['sendStatus'](_0x2ca5da);}return _0x14e799[_0xdcfa('0x1d')](_0x2ca5da)[_0xdcfa('0x1e')]();};}function respondWithResult(_0x55bc9d,_0x641587){_0x641587=_0x641587||0xc8;return function(_0x46c8da){if(_0x46c8da){return _0x55bc9d['status'](_0x641587)[_0xdcfa('0x1f')](_0x46c8da);}};}function respondWithFilteredResult(_0x34bc1e,_0x97944a){return function(_0x9c78b4){if(_0x9c78b4){var _0x2fbd2a=typeof _0x97944a[_0xdcfa('0x20')]===_0xdcfa('0x21')&&typeof _0x97944a[_0xdcfa('0x22')]===_0xdcfa('0x21');var _0x297353=_0x9c78b4[_0xdcfa('0x23')];var _0x53731f=_0x2fbd2a?0x0:_0x97944a[_0xdcfa('0x20')];var _0x4253c2=_0x2fbd2a?_0x9c78b4[_0xdcfa('0x23')]:_0x97944a[_0xdcfa('0x20')]+_0x97944a[_0xdcfa('0x22')];var _0x153d5f;if(_0x4253c2>=_0x297353){_0x4253c2=_0x297353;_0x153d5f=0xc8;}else{_0x153d5f=0xce;}_0x34bc1e['status'](_0x153d5f);return _0x34bc1e[_0xdcfa('0x24')](_0xdcfa('0x25'),_0x53731f+'-'+_0x4253c2+'/'+_0x297353)[_0xdcfa('0x1f')](_0x9c78b4);}return null;};}function patchUpdates(_0x10e6ba){return function(_0x59bee7){try{jsonpatch['apply'](_0x59bee7,_0x10e6ba,!![]);}catch(_0x4a7871){return BPromise[_0xdcfa('0x26')](_0x4a7871);}return _0x59bee7['save']();};}function saveUpdates(_0x28a43b,_0x4dcb7f){return function(_0x4349f0){if(_0x4349f0){return _0x4349f0[_0xdcfa('0x27')](_0x28a43b)['then'](function(_0x13d39b){return _0x13d39b;});}return null;};}function removeEntity(_0xce66ea,_0x968fcf){return function(_0xbb936){if(_0xbb936){return _0xbb936[_0xdcfa('0x28')]()[_0xdcfa('0x29')](function(){_0xce66ea[_0xdcfa('0x1d')](0xcc)[_0xdcfa('0x1e')]();});}};}function handleEntityNotFound(_0x28564c,_0x55a953){return function(_0x4f6403){if(!_0x4f6403){_0x28564c['sendStatus'](0x194);}return _0x4f6403;};}function handleError(_0x1640df,_0x40f4c6){_0x40f4c6=_0x40f4c6||0x1f4;return function(_0x383c41){logger[_0xdcfa('0x2a')](_0x383c41['stack']);if(_0x383c41[_0xdcfa('0x2b')]){delete _0x383c41[_0xdcfa('0x2b')];}_0x1640df[_0xdcfa('0x1d')](_0x40f4c6)[_0xdcfa('0x2c')](_0x383c41);};}exports[_0xdcfa('0x2d')]=function(_0x19bdf9,_0x1dc262){var _0x1b3e49={},_0x3d2b5d={},_0x111017={'count':0x0,'rows':[]};var _0x508fc7=_[_0xdcfa('0x2e')](db['VoiceMailMessage']['rawAttributes'],function(_0x507778){return{'name':_0x507778[_0xdcfa('0x2f')],'type':_0x507778[_0xdcfa('0x30')]['key']};});_0x3d2b5d[_0xdcfa('0x31')]=_[_0xdcfa('0x32')](_['map'](_0x508fc7,'name'),['name']);_0x3d2b5d['query']=_[_0xdcfa('0x33')](_0x19bdf9[_0xdcfa('0x34')]);_0x3d2b5d['filters']=_[_0xdcfa('0x35')](_0x3d2b5d[_0xdcfa('0x31')],_0x3d2b5d[_0xdcfa('0x34')]);_0x1b3e49[_0xdcfa('0x36')]=_[_0xdcfa('0x35')](_0x3d2b5d[_0xdcfa('0x31')],qs[_0xdcfa('0x37')](_0x19bdf9[_0xdcfa('0x34')][_0xdcfa('0x37')]));_0x1b3e49[_0xdcfa('0x36')]=_0x1b3e49[_0xdcfa('0x36')][_0xdcfa('0x38')]?_0x1b3e49[_0xdcfa('0x36')]:_0x3d2b5d[_0xdcfa('0x31')];if(!_0x19bdf9[_0xdcfa('0x34')][_0xdcfa('0x39')]('nolimit')){_0x1b3e49[_0xdcfa('0x22')]=qs[_0xdcfa('0x22')](_0x19bdf9['query'][_0xdcfa('0x22')]);_0x1b3e49[_0xdcfa('0x20')]=qs[_0xdcfa('0x20')](_0x19bdf9[_0xdcfa('0x34')][_0xdcfa('0x20')]);}_0x1b3e49[_0xdcfa('0x3a')]=qs[_0xdcfa('0x3b')](_0x19bdf9[_0xdcfa('0x34')]['sort']);_0x1b3e49[_0xdcfa('0x3c')]=qs[_0xdcfa('0x3d')](_[_0xdcfa('0x3e')](_0x19bdf9[_0xdcfa('0x34')],_0x3d2b5d['filters']),_0x508fc7);if(_0x19bdf9[_0xdcfa('0x34')][_0xdcfa('0x3f')]){_0x1b3e49[_0xdcfa('0x3c')]=_['merge'](_0x1b3e49['where'],{'$or':_[_0xdcfa('0x2e')](_0x508fc7,function(_0x49e138){if(_0x49e138[_0xdcfa('0x30')]!==_0xdcfa('0x40')){var _0x1b280d={};_0x1b280d[_0x49e138['name']]={'$like':'%'+_0x19bdf9[_0xdcfa('0x34')][_0xdcfa('0x3f')]+'%'};return _0x1b280d;}})});}_0x1b3e49=_[_0xdcfa('0x41')]({},_0x1b3e49,_0x19bdf9[_0xdcfa('0x42')]);var _0x5b533e={'where':_0x1b3e49[_0xdcfa('0x3c')]};return db['VoiceMailMessage'][_0xdcfa('0x23')](_0x5b533e)['then'](function(_0x46c072){_0x111017[_0xdcfa('0x23')]=_0x46c072;if(_0x19bdf9[_0xdcfa('0x34')]['includeAll']){_0x1b3e49['include']=[{'all':!![]}];}return db[_0xdcfa('0x43')][_0xdcfa('0x44')](_0x1b3e49);})[_0xdcfa('0x29')](function(_0x3fbb9f){_0x111017['rows']=_0x3fbb9f;return _0x111017;})[_0xdcfa('0x29')](respondWithFilteredResult(_0x1dc262,_0x1b3e49))[_0xdcfa('0x45')](handleError(_0x1dc262,null));};exports[_0xdcfa('0x46')]=function(_0x2a4b57,_0x5f3ed4){var _0x47797f={'raw':!![],'where':{'id':_0x2a4b57['params']['id']}},_0x4e754f={};_0x4e754f[_0xdcfa('0x31')]=_[_0xdcfa('0x33')](db[_0xdcfa('0x43')][_0xdcfa('0x47')]);_0x4e754f['query']=_[_0xdcfa('0x33')](_0x2a4b57[_0xdcfa('0x34')]);_0x4e754f[_0xdcfa('0x3d')]=_['intersection'](_0x4e754f['model'],_0x4e754f[_0xdcfa('0x34')]);_0x47797f[_0xdcfa('0x36')]=_[_0xdcfa('0x35')](_0x4e754f[_0xdcfa('0x31')],qs[_0xdcfa('0x37')](_0x2a4b57[_0xdcfa('0x34')]['fields']));_0x47797f[_0xdcfa('0x36')]=_0x47797f['attributes']['length']?_0x47797f[_0xdcfa('0x36')]:_0x4e754f[_0xdcfa('0x31')];if(_0x2a4b57[_0xdcfa('0x34')]['includeAll']){_0x47797f[_0xdcfa('0x48')]=[{'all':!![]}];}_0x47797f=_[_0xdcfa('0x41')]({},_0x47797f,_0x2a4b57[_0xdcfa('0x42')]);return db['VoiceMailMessage'][_0xdcfa('0x49')](_0x47797f)[_0xdcfa('0x29')](handleEntityNotFound(_0x5f3ed4,null))[_0xdcfa('0x29')](respondWithResult(_0x5f3ed4,null))['catch'](handleError(_0x5f3ed4,null));};exports[_0xdcfa('0x4a')]=function(_0x35fa7b,_0x4bd642){return db[_0xdcfa('0x43')][_0xdcfa('0x4a')](_0x35fa7b[_0xdcfa('0x4b')],{})[_0xdcfa('0x29')](respondWithResult(_0x4bd642,0xc9))[_0xdcfa('0x45')](handleError(_0x4bd642,null));};exports[_0xdcfa('0x27')]=function(_0x556b1d,_0x43d0e8){if(_0x556b1d[_0xdcfa('0x4b')]['id']){delete _0x556b1d['body']['id'];}return db[_0xdcfa('0x43')][_0xdcfa('0x49')]({'where':{'id':_0x556b1d[_0xdcfa('0x4c')]['id']}})['then'](handleEntityNotFound(_0x43d0e8,null))['then'](saveUpdates(_0x556b1d['body'],null))['then'](respondWithResult(_0x43d0e8,null))[_0xdcfa('0x45')](handleError(_0x43d0e8,null));};exports[_0xdcfa('0x28')]=function(_0x468812,_0x3d9c7e){return db[_0xdcfa('0x43')][_0xdcfa('0x49')]({'where':{'id':_0x468812[_0xdcfa('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3d9c7e,null))['then'](removeEntity(_0x3d9c7e,null))[_0xdcfa('0x45')](handleError(_0x3d9c7e,null));};exports[_0xdcfa('0x4d')]=function(_0x1a7a2b,_0x3e64f1,_0x55bf92){return db[_0xdcfa('0x43')][_0xdcfa('0x49')]({'where':{'id':_0x1a7a2b[_0xdcfa('0x4c')]['id']},'attributes':['id','recording',_0xdcfa('0x4e')]})['then'](handleEntityNotFound(_0x3e64f1,null))[_0xdcfa('0x29')](function(_0x229215){if(_0x229215){if(!_0x229215[_0xdcfa('0x4f')]){throw new db[(_0xdcfa('0x50'))]['ValidationError'](_0xdcfa('0x51'));}var _0x4ce2e4={'Content-Type':_0xdcfa('0x52'),'Content-Disposition':_0xdcfa('0x53')};if(_0x229215[_0xdcfa('0x4e')]){_0x4ce2e4[_0xdcfa('0x54')]='attachment;\x20filename=\x22'+_0x229215[_0xdcfa('0x4e')]+_0xdcfa('0x55');}_0x3e64f1[_0xdcfa('0x24')](_0x4ce2e4);return _0x3e64f1[_0xdcfa('0x2c')](new Buffer(_0x229215[_0xdcfa('0x4f')]));}})['catch'](handleError(_0x3e64f1,null));}; \ No newline at end of file +var _0x1181=['body','update','download','recording','msg_id','Sequelize','ValidationError','audio/wav','Content-Disposition','.wav\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','sendStatus','status','offset','undefined','limit','set','Content-Range','reject','save','then','destroy','end','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','count','includeAll','include','VoiceMailMessage','findAll','rows','catch','show','params','find','create'];(function(_0x3ee9d6,_0x11b438){var _0x3cda3b=function(_0x2b0922){while(--_0x2b0922){_0x3ee9d6['push'](_0x3ee9d6['shift']());}};_0x3cda3b(++_0x11b438);}(_0x1181,0x186));var _0x1118=function(_0x6dd5c,_0x4bfc19){_0x6dd5c=_0x6dd5c-0x0;var _0x5a87fa=_0x1181[_0x6dd5c];return _0x5a87fa;};'use strict';var emlformat=require(_0x1118('0x0'));var rimraf=require(_0x1118('0x1'));var zipdir=require(_0x1118('0x2'));var jsonpatch=require(_0x1118('0x3'));var rp=require(_0x1118('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1118('0x5'));var path=require(_0x1118('0x6'));var sox=require(_0x1118('0x7'));var csv=require(_0x1118('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1118('0x9'));var _=require(_0x1118('0xa'));var squel=require('squel');var crypto=require(_0x1118('0xb'));var jsforce=require(_0x1118('0xc'));var deskjs=require(_0x1118('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1118('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1118('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1118('0x10'))('api');var utils=require(_0x1118('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xcc1e68,_0x2d3d5c){_0x2d3d5c=_0x2d3d5c||0xcc;return function(_0x520b17){if(_0x520b17){return _0xcc1e68[_0x1118('0x12')](_0x2d3d5c);}return _0xcc1e68[_0x1118('0x13')](_0x2d3d5c)['end']();};}function respondWithResult(_0x15755a,_0x4f73d6){_0x4f73d6=_0x4f73d6||0xc8;return function(_0x210ee5){if(_0x210ee5){return _0x15755a[_0x1118('0x13')](_0x4f73d6)['json'](_0x210ee5);}};}function respondWithFilteredResult(_0x5d381c,_0x5042b0){return function(_0x1c8bca){if(_0x1c8bca){var _0x44e1d2=typeof _0x5042b0[_0x1118('0x14')]===_0x1118('0x15')&&typeof _0x5042b0[_0x1118('0x16')]===_0x1118('0x15');var _0x1e69ce=_0x1c8bca['count'];var _0x166e7d=_0x44e1d2?0x0:_0x5042b0['offset'];var _0x2b0eb2=_0x44e1d2?_0x1c8bca['count']:_0x5042b0[_0x1118('0x14')]+_0x5042b0[_0x1118('0x16')];var _0xfe8f50;if(_0x2b0eb2>=_0x1e69ce){_0x2b0eb2=_0x1e69ce;_0xfe8f50=0xc8;}else{_0xfe8f50=0xce;}_0x5d381c[_0x1118('0x13')](_0xfe8f50);return _0x5d381c[_0x1118('0x17')](_0x1118('0x18'),_0x166e7d+'-'+_0x2b0eb2+'/'+_0x1e69ce)['json'](_0x1c8bca);}return null;};}function patchUpdates(_0x533ea){return function(_0x5bb129){try{jsonpatch['apply'](_0x5bb129,_0x533ea,!![]);}catch(_0x243b3f){return BPromise[_0x1118('0x19')](_0x243b3f);}return _0x5bb129[_0x1118('0x1a')]();};}function saveUpdates(_0x2e04c8,_0x1df5f5){return function(_0x5a1af){if(_0x5a1af){return _0x5a1af['update'](_0x2e04c8)[_0x1118('0x1b')](function(_0x2d4c5a){return _0x2d4c5a;});}return null;};}function removeEntity(_0x27a1ed,_0x547cf1){return function(_0x3b8441){if(_0x3b8441){return _0x3b8441[_0x1118('0x1c')]()[_0x1118('0x1b')](function(){_0x27a1ed[_0x1118('0x13')](0xcc)[_0x1118('0x1d')]();});}};}function handleEntityNotFound(_0x46fe99,_0x53d768){return function(_0x36ff80){if(!_0x36ff80){_0x46fe99[_0x1118('0x12')](0x194);}return _0x36ff80;};}function handleError(_0x27ee7e,_0x545875){_0x545875=_0x545875||0x1f4;return function(_0x126c8c){logger[_0x1118('0x1e')](_0x126c8c[_0x1118('0x1f')]);if(_0x126c8c['name']){delete _0x126c8c[_0x1118('0x20')];}_0x27ee7e['status'](_0x545875)[_0x1118('0x21')](_0x126c8c);};}exports['index']=function(_0x28cbf9,_0x5e6093){var _0x1c72d1={},_0x5d3103={},_0x27fdcf={'count':0x0,'rows':[]};var _0x57c62b=_[_0x1118('0x22')](db['VoiceMailMessage'][_0x1118('0x23')],function(_0x3ab41a){return{'name':_0x3ab41a[_0x1118('0x24')],'type':_0x3ab41a[_0x1118('0x25')][_0x1118('0x26')]};});_0x5d3103[_0x1118('0x27')]=_['differenceBy'](_[_0x1118('0x22')](_0x57c62b,'name'),['name']);_0x5d3103[_0x1118('0x28')]=_[_0x1118('0x29')](_0x28cbf9[_0x1118('0x28')]);_0x5d3103[_0x1118('0x2a')]=_[_0x1118('0x2b')](_0x5d3103[_0x1118('0x27')],_0x5d3103[_0x1118('0x28')]);_0x1c72d1[_0x1118('0x2c')]=_[_0x1118('0x2b')](_0x5d3103[_0x1118('0x27')],qs[_0x1118('0x2d')](_0x28cbf9[_0x1118('0x28')][_0x1118('0x2d')]));_0x1c72d1[_0x1118('0x2c')]=_0x1c72d1['attributes']['length']?_0x1c72d1[_0x1118('0x2c')]:_0x5d3103[_0x1118('0x27')];if(!_0x28cbf9['query']['hasOwnProperty'](_0x1118('0x2e'))){_0x1c72d1['limit']=qs[_0x1118('0x16')](_0x28cbf9[_0x1118('0x28')][_0x1118('0x16')]);_0x1c72d1[_0x1118('0x14')]=qs[_0x1118('0x14')](_0x28cbf9[_0x1118('0x28')][_0x1118('0x14')]);}_0x1c72d1[_0x1118('0x2f')]=qs[_0x1118('0x30')](_0x28cbf9[_0x1118('0x28')][_0x1118('0x30')]);_0x1c72d1['where']=qs[_0x1118('0x2a')](_[_0x1118('0x31')](_0x28cbf9[_0x1118('0x28')],_0x5d3103[_0x1118('0x2a')]),_0x57c62b);if(_0x28cbf9[_0x1118('0x28')][_0x1118('0x32')]){_0x1c72d1['where']=_['merge'](_0x1c72d1[_0x1118('0x33')],{'$or':_[_0x1118('0x22')](_0x57c62b,function(_0x4b0119){if(_0x4b0119[_0x1118('0x25')]!==_0x1118('0x34')){var _0x55afd4={};_0x55afd4[_0x4b0119['name']]={'$like':'%'+_0x28cbf9[_0x1118('0x28')][_0x1118('0x32')]+'%'};return _0x55afd4;}})});}_0x1c72d1=_[_0x1118('0x35')]({},_0x1c72d1,_0x28cbf9[_0x1118('0x36')]);var _0x467fc7={'where':_0x1c72d1[_0x1118('0x33')]};return db['VoiceMailMessage'][_0x1118('0x37')](_0x467fc7)[_0x1118('0x1b')](function(_0x4e78ab){_0x27fdcf[_0x1118('0x37')]=_0x4e78ab;if(_0x28cbf9[_0x1118('0x28')][_0x1118('0x38')]){_0x1c72d1[_0x1118('0x39')]=[{'all':!![]}];}return db[_0x1118('0x3a')][_0x1118('0x3b')](_0x1c72d1);})[_0x1118('0x1b')](function(_0x249634){_0x27fdcf[_0x1118('0x3c')]=_0x249634;return _0x27fdcf;})[_0x1118('0x1b')](respondWithFilteredResult(_0x5e6093,_0x1c72d1))[_0x1118('0x3d')](handleError(_0x5e6093,null));};exports[_0x1118('0x3e')]=function(_0x61c082,_0x5ca3b6){var _0x367f5d={'raw':!![],'where':{'id':_0x61c082[_0x1118('0x3f')]['id']}},_0x112238={};_0x112238[_0x1118('0x27')]=_[_0x1118('0x29')](db[_0x1118('0x3a')]['rawAttributes']);_0x112238[_0x1118('0x28')]=_['keys'](_0x61c082[_0x1118('0x28')]);_0x112238[_0x1118('0x2a')]=_[_0x1118('0x2b')](_0x112238[_0x1118('0x27')],_0x112238['query']);_0x367f5d['attributes']=_[_0x1118('0x2b')](_0x112238[_0x1118('0x27')],qs[_0x1118('0x2d')](_0x61c082['query']['fields']));_0x367f5d['attributes']=_0x367f5d[_0x1118('0x2c')]['length']?_0x367f5d['attributes']:_0x112238[_0x1118('0x27')];if(_0x61c082[_0x1118('0x28')][_0x1118('0x38')]){_0x367f5d[_0x1118('0x39')]=[{'all':!![]}];}_0x367f5d=_[_0x1118('0x35')]({},_0x367f5d,_0x61c082[_0x1118('0x36')]);return db[_0x1118('0x3a')][_0x1118('0x40')](_0x367f5d)[_0x1118('0x1b')](handleEntityNotFound(_0x5ca3b6,null))[_0x1118('0x1b')](respondWithResult(_0x5ca3b6,null))[_0x1118('0x3d')](handleError(_0x5ca3b6,null));};exports['create']=function(_0x1b300b,_0x175493){return db[_0x1118('0x3a')][_0x1118('0x41')](_0x1b300b[_0x1118('0x42')],{})[_0x1118('0x1b')](respondWithResult(_0x175493,0xc9))[_0x1118('0x3d')](handleError(_0x175493,null));};exports[_0x1118('0x43')]=function(_0x27231c,_0x200ae5){if(_0x27231c[_0x1118('0x42')]['id']){delete _0x27231c[_0x1118('0x42')]['id'];}return db[_0x1118('0x3a')][_0x1118('0x40')]({'where':{'id':_0x27231c[_0x1118('0x3f')]['id']}})[_0x1118('0x1b')](handleEntityNotFound(_0x200ae5,null))[_0x1118('0x1b')](saveUpdates(_0x27231c[_0x1118('0x42')],null))[_0x1118('0x1b')](respondWithResult(_0x200ae5,null))[_0x1118('0x3d')](handleError(_0x200ae5,null));};exports[_0x1118('0x1c')]=function(_0x1f35b2,_0x4d2e0f){return db[_0x1118('0x3a')][_0x1118('0x40')]({'where':{'id':_0x1f35b2[_0x1118('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4d2e0f,null))['then'](removeEntity(_0x4d2e0f,null))[_0x1118('0x3d')](handleError(_0x4d2e0f,null));};exports[_0x1118('0x44')]=function(_0x5d7d19,_0x21904f,_0x3aa244){return db[_0x1118('0x3a')]['find']({'where':{'id':_0x5d7d19[_0x1118('0x3f')]['id']},'attributes':['id',_0x1118('0x45'),_0x1118('0x46')]})[_0x1118('0x1b')](handleEntityNotFound(_0x21904f,null))['then'](function(_0x1af633){if(_0x1af633){if(!_0x1af633['recording']){throw new db[(_0x1118('0x47'))][(_0x1118('0x48'))]('VoiceMailMessage\x20not\x20found');}var _0x49ebbb={'Content-Type':_0x1118('0x49'),'Content-Disposition':'attachment'};if(_0x1af633['msg_id']){_0x49ebbb[_0x1118('0x4a')]='attachment;\x20filename=\x22'+_0x1af633[_0x1118('0x46')]+_0x1118('0x4b');}_0x21904f[_0x1118('0x17')](_0x49ebbb);return _0x21904f[_0x1118('0x21')](new Buffer(_0x1af633[_0x1118('0x45')]));}})['catch'](handleError(_0x21904f,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 12c856f..35f5346 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 _0x4e4a=['dir','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceMailMessage.attributes','define','VoiceMailMessage'];(function(_0x1f7a74,_0x18ccc5){var _0x13d9a3=function(_0x5b9f55){while(--_0x5b9f55){_0x1f7a74['push'](_0x1f7a74['shift']());}};_0x13d9a3(++_0x18ccc5);}(_0x4e4a,0x161));var _0xa4e4=function(_0x1436cc,_0x52e949){_0x1436cc=_0x1436cc-0x0;var _0x2d7100=_0x4e4a[_0x1436cc];return _0x2d7100;};'use strict';var _=require('lodash');var util=require(_0xa4e4('0x0'));var logger=require('../../config/logger')(_0xa4e4('0x1'));var moment=require(_0xa4e4('0x2'));var BPromise=require(_0xa4e4('0x3'));var rp=require(_0xa4e4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa4e4('0x5'));var config=require(_0xa4e4('0x6'));var attributes=require(_0xa4e4('0x7'));module['exports']=function(_0x1736e4,_0x4d9960){return _0x1736e4[_0xa4e4('0x8')](_0xa4e4('0x9'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':'dir','fields':[_0xa4e4('0xa')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9100=['request-promise','path','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x36f47c,_0x38ef4d){var _0x296c55=function(_0x403eec){while(--_0x403eec){_0x36f47c['push'](_0x36f47c['shift']());}};_0x296c55(++_0x38ef4d);}(_0x9100,0x180));var _0x0910=function(_0x42871f,_0x34f5a0){_0x42871f=_0x42871f-0x0;var _0x2c7a62=_0x9100[_0x42871f];return _0x2c7a62;};'use strict';var _=require(_0x0910('0x0'));var util=require(_0x0910('0x1'));var logger=require(_0x0910('0x2'))(_0x0910('0x3'));var moment=require(_0x0910('0x4'));var BPromise=require(_0x0910('0x5'));var rp=require(_0x0910('0x6'));var fs=require('fs');var path=require(_0x0910('0x7'));var rimraf=require('rimraf');var config=require(_0x0910('0x8'));var attributes=require(_0x0910('0x9'));module[_0x0910('0xa')]=function(_0x588b9d,_0x384eab){return _0x588b9d[_0x0910('0xb')](_0x0910('0xc'),attributes,{'tableName':_0x0910('0xd'),'paranoid':![],'indexes':[{'name':_0x0910('0xe'),'fields':[_0x0910('0xe')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 91f0b14..22b408a 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 _0xd4c3=['client','http','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x390176,_0x1d6544){var _0x1f2c1c=function(_0x4387a7){while(--_0x4387a7){_0x390176['push'](_0x390176['shift']());}};_0x1f2c1c(++_0x1d6544);}(_0xd4c3,0xb5));var _0x3d4c=function(_0x2850c0,_0x1363a7){_0x2850c0=_0x2850c0-0x0;var _0x21e830=_0xd4c3[_0x2850c0];return _0x21e830;};'use strict';var _=require(_0x3d4c('0x0'));var util=require('util');var moment=require(_0x3d4c('0x1'));var BPromise=require(_0x3d4c('0x2'));var rs=require(_0x3d4c('0x3'));var fs=require('fs');var Redis=require(_0x3d4c('0x4'));var db=require(_0x3d4c('0x5'))['db'];var utils=require(_0x3d4c('0x6'));var logger=require(_0x3d4c('0x7'))(_0x3d4c('0x8'));var config=require(_0x3d4c('0x9'));var jayson=require(_0x3d4c('0xa'));var client=jayson[_0x3d4c('0xb')][_0x3d4c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2dc8d5,_0x1c1315,_0x675aba){return new BPromise(function(_0x3dc956,_0x31cc94){return client['request'](_0x2dc8d5,_0x675aba)['then'](function(_0x556827){logger['info'](_0x3d4c('0xd'),_0x1c1315,_0x3d4c('0xe'));logger[_0x3d4c('0xf')](_0x3d4c('0x10'),_0x1c1315,_0x3d4c('0xe'),JSON[_0x3d4c('0x11')](_0x556827));if(_0x556827[_0x3d4c('0x12')]){if(_0x556827[_0x3d4c('0x12')][_0x3d4c('0x13')]===0x1f4){logger[_0x3d4c('0x12')](_0x3d4c('0xd'),_0x1c1315,_0x556827['error'][_0x3d4c('0x14')]);return _0x31cc94(_0x556827[_0x3d4c('0x12')]['message']);}logger['error'](_0x3d4c('0xd'),_0x1c1315,_0x556827[_0x3d4c('0x12')][_0x3d4c('0x14')]);return _0x3dc956(_0x556827[_0x3d4c('0x12')]['message']);}else{logger[_0x3d4c('0x15')](_0x3d4c('0xd'),_0x1c1315,_0x3d4c('0xe'));_0x3dc956(_0x556827[_0x3d4c('0x16')][_0x3d4c('0x14')]);}})[_0x3d4c('0x17')](function(_0xa6636){logger[_0x3d4c('0x12')](_0x3d4c('0xd'),_0x1c1315,_0xa6636);_0x31cc94(_0xa6636);});});} \ No newline at end of file +var _0x2c7b=['info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x517a54,_0x59f33){var _0x4e3186=function(_0x25fa2d){while(--_0x25fa2d){_0x517a54['push'](_0x517a54['shift']());}};_0x4e3186(++_0x59f33);}(_0x2c7b,0xab));var _0xb2c7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2c7b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xb2c7('0x0'));var moment=require(_0xb2c7('0x1'));var BPromise=require('bluebird');var rs=require(_0xb2c7('0x2'));var fs=require('fs');var Redis=require(_0xb2c7('0x3'));var db=require(_0xb2c7('0x4'))['db'];var utils=require(_0xb2c7('0x5'));var logger=require(_0xb2c7('0x6'))(_0xb2c7('0x7'));var config=require(_0xb2c7('0x8'));var jayson=require(_0xb2c7('0x9'));var client=jayson[_0xb2c7('0xa')][_0xb2c7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x201e0f,_0x46edf6,_0x4abfb5){return new BPromise(function(_0x18a491,_0x1d2a37){return client[_0xb2c7('0xc')](_0x201e0f,_0x4abfb5)['then'](function(_0xf64ff9){logger[_0xb2c7('0xd')](_0xb2c7('0xe'),_0x46edf6,_0xb2c7('0xf'));logger['debug'](_0xb2c7('0x10'),_0x46edf6,_0xb2c7('0xf'),JSON[_0xb2c7('0x11')](_0xf64ff9));if(_0xf64ff9[_0xb2c7('0x12')]){if(_0xf64ff9['error'][_0xb2c7('0x13')]===0x1f4){logger[_0xb2c7('0x12')](_0xb2c7('0xe'),_0x46edf6,_0xf64ff9[_0xb2c7('0x12')][_0xb2c7('0x14')]);return _0x1d2a37(_0xf64ff9['error'][_0xb2c7('0x14')]);}logger[_0xb2c7('0x12')](_0xb2c7('0xe'),_0x46edf6,_0xf64ff9[_0xb2c7('0x12')][_0xb2c7('0x14')]);return _0x18a491(_0xf64ff9['error']['message']);}else{logger[_0xb2c7('0xd')](_0xb2c7('0xe'),_0x46edf6,_0xb2c7('0xf'));_0x18a491(_0xf64ff9[_0xb2c7('0x15')][_0xb2c7('0x14')]);}})[_0xb2c7('0x16')](function(_0x4f6ef4){logger[_0xb2c7('0x12')]('VoiceMailMessage,\x20%s,\x20%s',_0x46edf6,_0x4f6ef4);_0x1d2a37(_0x4f6ef4);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 43d6228..f8ea367 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 _0xb2be=['../../components/interaction/service','get','isAuthenticated','index','show','/:id/sounds','getSounds','post','create','/:id','update','delete','/:id/sounds/:id2','removeSound','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x5ec62e,_0x4488e0){var _0x8bb353=function(_0x1d33fc){while(--_0x1d33fc){_0x5ec62e['push'](_0x5ec62e['shift']());}};_0x8bb353(++_0x4488e0);}(_0xb2be,0x1b1));var _0xeb2b=function(_0x432169,_0x7ffbe9){_0x432169=_0x432169-0x0;var _0x28e745=_0xb2be[_0x432169];return _0x28e745;};'use strict';var multer=require(_0xeb2b('0x0'));var util=require(_0xeb2b('0x1'));var path=require('path');var timeout=require(_0xeb2b('0x2'));var express=require(_0xeb2b('0x3'));var router=express[_0xeb2b('0x4')]();var fs_extra=require(_0xeb2b('0x5'));var auth=require(_0xeb2b('0x6'));var interaction=require(_0xeb2b('0x7'));var config=require('../../config/environment');var controller=require('./voiceMusicOnHold.controller');router[_0xeb2b('0x8')]('/',auth[_0xeb2b('0x9')](),controller[_0xeb2b('0xa')]);router[_0xeb2b('0x8')]('/:id',auth[_0xeb2b('0x9')](),controller[_0xeb2b('0xb')]);router[_0xeb2b('0x8')](_0xeb2b('0xc'),auth['isAuthenticated'](),controller[_0xeb2b('0xd')]);router[_0xeb2b('0xe')]('/',auth[_0xeb2b('0x9')](),controller[_0xeb2b('0xf')]);router[_0xeb2b('0xe')](_0xeb2b('0xc'),auth['isAuthenticated'](),controller['addSound']);router['put'](_0xeb2b('0x10'),auth[_0xeb2b('0x9')](),controller[_0xeb2b('0x11')]);router[_0xeb2b('0x12')](_0xeb2b('0x10'),auth[_0xeb2b('0x9')](),controller['destroy']);router['delete'](_0xeb2b('0x13'),auth[_0xeb2b('0x9')](),controller[_0xeb2b('0x14')]);module[_0xeb2b('0x15')]=router; \ No newline at end of file +var _0xa0cd=['../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','show','/:id/sounds','getSounds','post','create','addSound','/:id','update','delete','destroy','/:id/sounds/:id2','removeSound','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x4234e7,_0x26a9d1){var _0x4eaa98=function(_0x2322e){while(--_0x2322e){_0x4234e7['push'](_0x4234e7['shift']());}};_0x4eaa98(++_0x26a9d1);}(_0xa0cd,0x8b));var _0xda0c=function(_0xc020a,_0x1ffbb9){_0xc020a=_0xc020a-0x0;var _0x1ac1b2=_0xa0cd[_0xc020a];return _0x1ac1b2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xda0c('0x0'));var timeout=require(_0xda0c('0x1'));var express=require('express');var router=express[_0xda0c('0x2')]();var fs_extra=require(_0xda0c('0x3'));var auth=require(_0xda0c('0x4'));var interaction=require(_0xda0c('0x5'));var config=require(_0xda0c('0x6'));var controller=require(_0xda0c('0x7'));router[_0xda0c('0x8')]('/',auth[_0xda0c('0x9')](),controller[_0xda0c('0xa')]);router[_0xda0c('0x8')]('/:id',auth[_0xda0c('0x9')](),controller[_0xda0c('0xb')]);router[_0xda0c('0x8')](_0xda0c('0xc'),auth[_0xda0c('0x9')](),controller[_0xda0c('0xd')]);router[_0xda0c('0xe')]('/',auth['isAuthenticated'](),controller[_0xda0c('0xf')]);router[_0xda0c('0xe')](_0xda0c('0xc'),auth[_0xda0c('0x9')](),controller[_0xda0c('0x10')]);router['put'](_0xda0c('0x11'),auth[_0xda0c('0x9')](),controller[_0xda0c('0x12')]);router[_0xda0c('0x13')](_0xda0c('0x11'),auth[_0xda0c('0x9')](),controller[_0xda0c('0x14')]);router[_0xda0c('0x13')](_0xda0c('0x15'),auth[_0xda0c('0x9')](),controller[_0xda0c('0x16')]);module[_0xda0c('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index cf1cce4..4de6472 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 _0xcdf9=['ENUM','files','mp3nb','quietmp3nb','quietmp3','mp3','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING','name'];(function(_0x72728c,_0x3cb2fd){var _0x21c64b=function(_0x346c1a){while(--_0x346c1a){_0x72728c['push'](_0x72728c['shift']());}};_0x21c64b(++_0x3cb2fd);}(_0xcdf9,0x98));var _0x9cdf=function(_0x2136d5,_0x4b0479){_0x2136d5=_0x2136d5-0x0;var _0x3bee2e=_0xcdf9[_0x2136d5];return _0x3bee2e;};'use strict';var Sequelize=require(_0x9cdf('0x0'));module[_0x9cdf('0x1')]={'name':{'type':Sequelize[_0x9cdf('0x2')],'allowNull':![],'unique':_0x9cdf('0x3')},'mode':{'type':Sequelize[_0x9cdf('0x4')]('custom',_0x9cdf('0x5'),_0x9cdf('0x6'),_0x9cdf('0x7'),_0x9cdf('0x8'),_0x9cdf('0x9')),'allowNull':!![],'defaultValue':_0x9cdf('0x5')},'directory':{'type':Sequelize[_0x9cdf('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x9cdf('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x9cdf('0x2')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x9cdf('0xa')},'format':{'type':Sequelize[_0x9cdf('0x2')],'allowNull':!![]},'stamp':{'type':_0x9cdf('0xb')},'defaultEntry':{'type':Sequelize[_0x9cdf('0xc')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7584=['quietmp3nb','quietmp3','mp3','alpha','TIMESTAMP','sequelize','exports','STRING','name','ENUM','files','mp3nb'];(function(_0x280265,_0x55a168){var _0x25f2f1=function(_0x1caa78){while(--_0x1caa78){_0x280265['push'](_0x280265['shift']());}};_0x25f2f1(++_0x55a168);}(_0x7584,0x191));var _0x4758=function(_0xb74b7c,_0x1cac8f){_0xb74b7c=_0xb74b7c-0x0;var _0x3cdae=_0x7584[_0xb74b7c];return _0x3cdae;};'use strict';var Sequelize=require(_0x4758('0x0'));module[_0x4758('0x1')]={'name':{'type':Sequelize[_0x4758('0x2')],'allowNull':![],'unique':_0x4758('0x3')},'mode':{'type':Sequelize[_0x4758('0x4')]('custom',_0x4758('0x5'),_0x4758('0x6'),_0x4758('0x7'),_0x4758('0x8'),_0x4758('0x9')),'allowNull':!![],'defaultValue':_0x4758('0x5')},'directory':{'type':Sequelize[_0x4758('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x4758('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x4758('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x4758('0x2')],'allowNull':!![],'defaultValue':_0x4758('0xa')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x4758('0xb')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index 0822ba6..c09d8b5 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 _0xd021=['update','then','MusicOnHolds','UserProfileResource','end','sendStatus','error','stack','name','send','index','VoiceMusicOnHold','rawAttributes','type','model','map','keys','filters','query','intersection','fields','attributes','length','hasOwnProperty','order','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','includeAll','find','body','params','mode','files','directory','join','root','create','0777','user','get','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','destroy','readdirSync','forEach','rmdirSync','Sequelize','ValidationError','message','addSound','transaction','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','extname','server/files/moh','removeSound','unlinkSync','getSounds','sort','pick','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','undefined','limit','count','offset','set','apply','reject','save'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xd021,0x12d));var _0x1d02=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd021[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x1d02('0x0'));var rimraf=require(_0x1d02('0x1'));var zipdir=require(_0x1d02('0x2'));var jsonpatch=require(_0x1d02('0x3'));var rp=require('request-promise');var moment=require(_0x1d02('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1d02('0x5'));var path=require(_0x1d02('0x6'));var sox=require(_0x1d02('0x7'));var csv=require(_0x1d02('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1d02('0x9'));var _=require('lodash');var squel=require(_0x1d02('0xa'));var crypto=require('crypto');var jsforce=require(_0x1d02('0xb'));var deskjs=require(_0x1d02('0xc'));var toCsv=require(_0x1d02('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1d02('0xd'));var authService=require(_0x1d02('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x1d02('0xf'));var hardwareService=require(_0x1d02('0x10'));var logger=require(_0x1d02('0x11'))(_0x1d02('0x12'));var utils=require(_0x1d02('0x13'));var config=require(_0x1d02('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x1d02('0x15'))['db'];function respondWithStatusCode(_0x531c6d,_0x30630f){_0x30630f=_0x30630f||0xcc;return function(_0x3e1254){if(_0x3e1254){return _0x531c6d['sendStatus'](_0x30630f);}return _0x531c6d[_0x1d02('0x16')](_0x30630f)['end']();};}function respondWithResult(_0x331c07,_0x5c659c){_0x5c659c=_0x5c659c||0xc8;return function(_0xd24e1){if(_0xd24e1){return _0x331c07[_0x1d02('0x16')](_0x5c659c)[_0x1d02('0x17')](_0xd24e1);}};}function respondWithFilteredResult(_0xfc8482,_0x2a25cb){return function(_0x26f042){if(_0x26f042){var _0x4e48cd=typeof _0x2a25cb['offset']===_0x1d02('0x18')&&typeof _0x2a25cb[_0x1d02('0x19')]===_0x1d02('0x18');var _0x5bc901=_0x26f042[_0x1d02('0x1a')];var _0x33c117=_0x4e48cd?0x0:_0x2a25cb[_0x1d02('0x1b')];var _0x40eec8=_0x4e48cd?_0x26f042[_0x1d02('0x1a')]:_0x2a25cb['offset']+_0x2a25cb[_0x1d02('0x19')];var _0xf762e7;if(_0x40eec8>=_0x5bc901){_0x40eec8=_0x5bc901;_0xf762e7=0xc8;}else{_0xf762e7=0xce;}_0xfc8482[_0x1d02('0x16')](_0xf762e7);return _0xfc8482[_0x1d02('0x1c')]('Content-Range',_0x33c117+'-'+_0x40eec8+'/'+_0x5bc901)[_0x1d02('0x17')](_0x26f042);}return null;};}function patchUpdates(_0x1daaf0){return function(_0xf75474){try{jsonpatch[_0x1d02('0x1d')](_0xf75474,_0x1daaf0,!![]);}catch(_0x171a17){return BPromise[_0x1d02('0x1e')](_0x171a17);}return _0xf75474[_0x1d02('0x1f')]();};}function saveUpdates(_0x498f10,_0x242a16){return function(_0x454795){if(_0x454795){return _0x454795[_0x1d02('0x20')](_0x498f10)['then'](function(_0x2d566b){return _0x2d566b;});}return null;};}function removeEntity(_0x26a155,_0x221971){return function(_0x4eb96d){if(_0x4eb96d){return _0x4eb96d['destroy']()[_0x1d02('0x21')](function(){var _0x361d06=_0x4eb96d['get']({'plain':!![]});var _0x1b5daa=_0x1d02('0x22');return db[_0x1d02('0x23')]['destroy']({'where':{'type':_0x1b5daa,'resourceId':_0x361d06['id']}})['then'](function(){return _0x4eb96d;});})['then'](function(){_0x26a155[_0x1d02('0x16')](0xcc)[_0x1d02('0x24')]();});}};}function handleEntityNotFound(_0x569824,_0x42f0e0){return function(_0x2cf8c5){if(!_0x2cf8c5){_0x569824[_0x1d02('0x25')](0x194);}return _0x2cf8c5;};}function handleError(_0x42cfbd,_0x494559){_0x494559=_0x494559||0x1f4;return function(_0x485a0d){logger[_0x1d02('0x26')](_0x485a0d[_0x1d02('0x27')]);if(_0x485a0d[_0x1d02('0x28')]){delete _0x485a0d['name'];}_0x42cfbd['status'](_0x494559)[_0x1d02('0x29')](_0x485a0d);};}exports[_0x1d02('0x2a')]=function(_0x212b9c,_0x3aff2d){var _0x52b7e2={},_0x449580={},_0x1b0377={'count':0x0,'rows':[]};var _0x564a8f=_['map'](db[_0x1d02('0x2b')][_0x1d02('0x2c')],function(_0x1f7280){return{'name':_0x1f7280['fieldName'],'type':_0x1f7280[_0x1d02('0x2d')]['key']};});_0x449580[_0x1d02('0x2e')]=_[_0x1d02('0x2f')](_0x564a8f,_0x1d02('0x28'));_0x449580['query']=_[_0x1d02('0x30')](_0x212b9c['query']);_0x449580[_0x1d02('0x31')]=_['intersection'](_0x449580[_0x1d02('0x2e')],_0x449580[_0x1d02('0x32')]);_0x52b7e2['attributes']=_[_0x1d02('0x33')](_0x449580['model'],qs[_0x1d02('0x34')](_0x212b9c['query']['fields']));_0x52b7e2[_0x1d02('0x35')]=_0x52b7e2[_0x1d02('0x35')][_0x1d02('0x36')]?_0x52b7e2[_0x1d02('0x35')]:_0x449580[_0x1d02('0x2e')];if(!_0x212b9c[_0x1d02('0x32')][_0x1d02('0x37')]('nolimit')){_0x52b7e2[_0x1d02('0x19')]=qs[_0x1d02('0x19')](_0x212b9c[_0x1d02('0x32')][_0x1d02('0x19')]);_0x52b7e2[_0x1d02('0x1b')]=qs[_0x1d02('0x1b')](_0x212b9c[_0x1d02('0x32')][_0x1d02('0x1b')]);}_0x52b7e2[_0x1d02('0x38')]=qs['sort'](_0x212b9c[_0x1d02('0x32')]['sort']);delete _0x212b9c[_0x1d02('0x32')]['sort'];_0x52b7e2[_0x1d02('0x39')]=qs[_0x1d02('0x31')](_['pick'](_0x212b9c[_0x1d02('0x32')],_0x449580[_0x1d02('0x31')]),_0x564a8f);if(_0x212b9c[_0x1d02('0x32')][_0x1d02('0x3a')]){_0x52b7e2['where']=_[_0x1d02('0x3b')](_0x52b7e2[_0x1d02('0x39')],{'$or':_[_0x1d02('0x2f')](_0x564a8f,function(_0xac3e01){if(_0xac3e01[_0x1d02('0x2d')]!==_0x1d02('0x3c')){var _0x20123d={};_0x20123d[_0xac3e01[_0x1d02('0x28')]]={'$like':'%'+_0x212b9c[_0x1d02('0x32')][_0x1d02('0x3a')]+'%'};return _0x20123d;}})});}_0x52b7e2=_[_0x1d02('0x3b')]({},_0x52b7e2,_0x212b9c[_0x1d02('0x3d')]);var _0x323605={'where':_0x52b7e2['where']};return db[_0x1d02('0x2b')][_0x1d02('0x1a')](_0x323605)[_0x1d02('0x21')](function(_0x2262c1){_0x1b0377[_0x1d02('0x1a')]=_0x2262c1;if(_0x212b9c['query']['includeAll']){_0x52b7e2[_0x1d02('0x3e')]=[{'all':!![]}];}return db[_0x1d02('0x2b')][_0x1d02('0x3f')](_0x52b7e2);})['then'](function(_0x80cdb1){_0x1b0377[_0x1d02('0x40')]=_0x80cdb1;return _0x1b0377;})['then'](respondWithFilteredResult(_0x3aff2d,_0x52b7e2))[_0x1d02('0x41')](handleError(_0x3aff2d,null));};exports[_0x1d02('0x42')]=function(_0x3d79da,_0x19b122){var _0x3cd5ad={'raw':![],'where':{'id':_0x3d79da['params']['id']}},_0x582ef9={};_0x582ef9['model']=_[_0x1d02('0x30')](db[_0x1d02('0x2b')][_0x1d02('0x2c')]);_0x582ef9['query']=_[_0x1d02('0x30')](_0x3d79da[_0x1d02('0x32')]);_0x582ef9['filters']=_[_0x1d02('0x33')](_0x582ef9['model'],_0x582ef9[_0x1d02('0x32')]);_0x3cd5ad[_0x1d02('0x35')]=_[_0x1d02('0x33')](_0x582ef9[_0x1d02('0x2e')],qs[_0x1d02('0x34')](_0x3d79da[_0x1d02('0x32')][_0x1d02('0x34')]));_0x3cd5ad[_0x1d02('0x35')]=_0x3cd5ad[_0x1d02('0x35')]['length']?_0x3cd5ad['attributes']:_0x582ef9['model'];if(_0x3d79da[_0x1d02('0x32')][_0x1d02('0x43')]){_0x3cd5ad['include']=[{'all':!![]}];}_0x3cd5ad=_[_0x1d02('0x3b')]({},_0x3cd5ad,_0x3d79da['options']);return db[_0x1d02('0x2b')][_0x1d02('0x44')](_0x3cd5ad)[_0x1d02('0x21')](handleEntityNotFound(_0x19b122,null))[_0x1d02('0x21')](respondWithResult(_0x19b122,null))['catch'](handleError(_0x19b122,null));};exports[_0x1d02('0x20')]=function(_0x55e1ed,_0x1a5ea7){if(_0x55e1ed[_0x1d02('0x45')]['id']){delete _0x55e1ed[_0x1d02('0x45')]['id'];}return db[_0x1d02('0x2b')][_0x1d02('0x44')]({'where':{'id':_0x55e1ed[_0x1d02('0x46')]['id']}})[_0x1d02('0x21')](handleEntityNotFound(_0x1a5ea7,null))[_0x1d02('0x21')](saveUpdates(_0x55e1ed[_0x1d02('0x45')],null))[_0x1d02('0x21')](respondWithResult(_0x1a5ea7,null))[_0x1d02('0x41')](handleError(_0x1a5ea7,null));};exports['create']=function(_0x4ae620,_0x4938db,_0x457170){return db['sequelize']['transaction'](function(_0x45b4ac){if(_0x4ae620[_0x1d02('0x45')][_0x1d02('0x47')]===_0x1d02('0x48')){_0x4ae620[_0x1d02('0x45')][_0x1d02('0x49')]=path[_0x1d02('0x4a')](config[_0x1d02('0x4b')],'server/files/moh',_0x4ae620[_0x1d02('0x45')][_0x1d02('0x28')]);}return db['VoiceMusicOnHold'][_0x1d02('0x4c')](_0x4ae620[_0x1d02('0x45')],{'transaction':_0x45b4ac})[_0x1d02('0x21')](function(_0x14986b){if(_0x4ae620[_0x1d02('0x45')][_0x1d02('0x47')]==='files'){fs['mkdirSync'](_0x14986b['directory'],parseInt(_0x1d02('0x4d'),0x8));}var _0x522f8e=_0x4ae620[_0x1d02('0x4e')][_0x1d02('0x4f')]({'plain':!![]});if(!_0x522f8e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x522f8e[_0x1d02('0x50')]===_0x1d02('0x4e')){var _0x4e2d22=_0x14986b['get']({'plain':!![]});return db[_0x1d02('0x51')]['find']({'where':{'name':_0x1d02('0x22'),'userProfileId':_0x522f8e[_0x1d02('0x52')]},'raw':!![]})[_0x1d02('0x21')](function(_0x2e0375){if(_0x2e0375&&_0x2e0375['autoAssociation']===0x0){return db[_0x1d02('0x23')]['create']({'name':_0x4e2d22[_0x1d02('0x28')],'resourceId':_0x4e2d22['id'],'type':_0x2e0375[_0x1d02('0x28')],'sectionId':_0x2e0375['id']},{})[_0x1d02('0x21')](function(){return _0x14986b;});}else{return _0x14986b;}})[_0x1d02('0x41')](function(_0x27dc4e){logger[_0x1d02('0x26')](_0x1d02('0x53'),_0x27dc4e);});}return _0x14986b;});})['then'](respondWithResult(_0x4938db,0xc9))['catch'](handleError(_0x4938db,null));};exports['destroy']=function(_0x273362,_0x40f130,_0x594ee8){var _0x45af8f;return db[_0x1d02('0x2b')][_0x1d02('0x44')]({'where':{'id':_0x273362[_0x1d02('0x46')]['id']}})[_0x1d02('0x21')](function(_0x3e4b27){if(_0x3e4b27){return db[_0x1d02('0x54')]['transaction'](function(_0x4f2375){return _0x3e4b27[_0x1d02('0x55')]({'transaction':_0x4f2375,'raw':!![]})['then'](function(_0x462394){if(_0x462394[_0x1d02('0x49')]){fs[_0x1d02('0x56')](_0x462394[_0x1d02('0x49')])[_0x1d02('0x57')](function(_0x4c11a3){fs['unlinkSync'](path[_0x1d02('0x4a')](_0x462394[_0x1d02('0x49')],_0x4c11a3));});fs[_0x1d02('0x58')](_0x462394[_0x1d02('0x49')]);}return _0x462394;});})[_0x1d02('0x41')](function(_0xdf9efe){throw new db[(_0x1d02('0x59'))][(_0x1d02('0x5a'))](_0xdf9efe[_0x1d02('0x5b')]);});}})[_0x1d02('0x21')](handleEntityNotFound(_0x40f130,null))[_0x1d02('0x21')](removeEntity(_0x40f130,null))[_0x1d02('0x41')](handleError(_0x40f130,null));};exports[_0x1d02('0x5c')]=function(_0x589929,_0x50a544,_0x1f1733){return db[_0x1d02('0x54')][_0x1d02('0x5d')](function(_0x2acc6c){var _0x5988b8;return db[_0x1d02('0x2b')][_0x1d02('0x44')]({'where':{'id':_0x589929[_0x1d02('0x46')]['id']}})[_0x1d02('0x21')](function(_0x38bf60){if(_0x38bf60){_0x5988b8=_0x38bf60;return _0x38bf60[_0x1d02('0x5c')](_0x589929[_0x1d02('0x45')]['id'],{'transaction':_0x2acc6c});}})['then'](function(_0x334f5a){if(_0x334f5a){return db[_0x1d02('0x5e')][_0x1d02('0x5f')]({'where':{'id':_0x589929[_0x1d02('0x45')]['id']},'attributes':['id',_0x1d02('0x28'),_0x1d02('0x60'),_0x1d02('0x61'),_0x1d02('0x62')],'raw':!![]});}})['then'](function(_0x4b5c61){if(_0x4b5c61){var _0xaebffe=path['join'](config[_0x1d02('0x4b')],_0x1d02('0x63'),util[_0x1d02('0x64')](_0x1d02('0x65'),path[_0x1d02('0x66')](_0x4b5c61[_0x1d02('0x60')],path[_0x1d02('0x67')](_0x4b5c61[_0x1d02('0x60')])),_0x4b5c61[_0x1d02('0x61')]));var _0x18609b=path[_0x1d02('0x4a')](config['root'],_0x1d02('0x68'),_0x5988b8[_0x1d02('0x28')],util['format'](_0x1d02('0x65'),_0x4b5c61[_0x1d02('0x28')],_0x4b5c61[_0x1d02('0x61')]));fs['symlinkSync'](_0xaebffe,_0x18609b);return _0x4b5c61;}})[_0x1d02('0x41')](function(_0x49bc5c){throw new db[(_0x1d02('0x59'))][(_0x1d02('0x5a'))](_0x49bc5c[_0x1d02('0x5b')]);});})[_0x1d02('0x21')](handleEntityNotFound(_0x50a544,null))['then'](respondWithResult(_0x50a544,0xc9))[_0x1d02('0x41')](handleError(_0x50a544,null));};exports[_0x1d02('0x69')]=function(_0x2b01bf,_0x5743ca,_0x56a8a5){return db[_0x1d02('0x54')][_0x1d02('0x5d')](function(_0x4cdf74){var _0x9d0776;return db[_0x1d02('0x2b')][_0x1d02('0x5f')]({'where':{'id':_0x2b01bf[_0x1d02('0x46')]['id']}})[_0x1d02('0x21')](handleEntityNotFound(_0x5743ca,null))['then'](function(_0x2712d0){if(_0x2712d0){_0x9d0776=_0x2712d0;return _0x2712d0[_0x1d02('0x69')](_0x2b01bf[_0x1d02('0x46')]['id2']);}})[_0x1d02('0x21')](function(_0x4a0cda){if(_0x4a0cda){return db[_0x1d02('0x5e')][_0x1d02('0x5f')]({'where':{'id':_0x2b01bf[_0x1d02('0x46')]['id2']},'attributes':['id',_0x1d02('0x28'),_0x1d02('0x60'),_0x1d02('0x61'),_0x1d02('0x62')],'raw':!![]});}})[_0x1d02('0x21')](function(_0x4c802b){if(_0x4c802b){fs[_0x1d02('0x6a')](path['join'](_0x9d0776[_0x1d02('0x49')],util[_0x1d02('0x64')](_0x1d02('0x65'),_0x4c802b[_0x1d02('0x28')],_0x4c802b['converted_format'])));return _0x4c802b;}})[_0x1d02('0x41')](function(_0x2aa699){throw new db[(_0x1d02('0x59'))]['ValidationError'](_0x2aa699[_0x1d02('0x5b')]);});})[_0x1d02('0x21')](handleEntityNotFound(_0x5743ca,null))[_0x1d02('0x21')](respondWithStatusCode(_0x5743ca,0xcc))['catch'](handleError(_0x5743ca,null));};exports[_0x1d02('0x6b')]=function(_0x26248b,_0xf6ab9,_0xfef5ef){var _0x4f6b54={};var _0x509e6c={};var _0x1d272c;var _0x3296ac;return db['VoiceMusicOnHold'][_0x1d02('0x5f')]({'where':{'id':_0x26248b[_0x1d02('0x46')]['id']}})[_0x1d02('0x21')](handleEntityNotFound(_0xf6ab9,null))[_0x1d02('0x21')](function(_0x897f38){if(_0x897f38){_0x1d272c=_0x897f38;_0x509e6c[_0x1d02('0x2e')]=_[_0x1d02('0x30')](db[_0x1d02('0x5e')][_0x1d02('0x2c')]);_0x509e6c[_0x1d02('0x32')]=_[_0x1d02('0x30')](_0x26248b[_0x1d02('0x32')]);_0x509e6c['filters']=_[_0x1d02('0x33')](_0x509e6c[_0x1d02('0x2e')],_0x509e6c[_0x1d02('0x32')]);_0x4f6b54[_0x1d02('0x35')]=_[_0x1d02('0x33')](_0x509e6c[_0x1d02('0x2e')],qs['fields'](_0x26248b[_0x1d02('0x32')][_0x1d02('0x34')]));_0x4f6b54['attributes']=_0x4f6b54['attributes']['length']?_0x4f6b54[_0x1d02('0x35')]:_0x509e6c[_0x1d02('0x2e')];_0x4f6b54[_0x1d02('0x38')]=qs['sort'](_0x26248b[_0x1d02('0x32')][_0x1d02('0x6c')]);_0x4f6b54[_0x1d02('0x39')]=qs['filters'](_[_0x1d02('0x6d')](_0x26248b[_0x1d02('0x32')],_0x509e6c[_0x1d02('0x31')]));if(_0x26248b[_0x1d02('0x32')][_0x1d02('0x3a')]){_0x4f6b54[_0x1d02('0x39')]=_[_0x1d02('0x3b')](_0x4f6b54[_0x1d02('0x39')],{'$or':_[_0x1d02('0x2f')](_0x4f6b54[_0x1d02('0x35')],function(_0x5088ff){var _0x5955c8={};_0x5955c8[_0x5088ff]={'$like':'%'+_0x26248b[_0x1d02('0x32')]['filter']+'%'};return _0x5955c8;})});}_0x4f6b54=_['merge']({},_0x4f6b54,_0x26248b[_0x1d02('0x3d')]);return _0x1d272c[_0x1d02('0x6b')](_0x4f6b54);}})[_0x1d02('0x21')](function(_0x28bd6f){if(_0x28bd6f){_0x3296ac=_0x28bd6f[_0x1d02('0x36')];if(!_0x26248b[_0x1d02('0x32')]['hasOwnProperty'](_0x1d02('0x6e'))){_0x4f6b54[_0x1d02('0x19')]=qs['limit'](_0x26248b[_0x1d02('0x32')][_0x1d02('0x19')]);_0x4f6b54[_0x1d02('0x1b')]=qs[_0x1d02('0x1b')](_0x26248b[_0x1d02('0x32')][_0x1d02('0x1b')]);}return _0x1d272c['getSounds'](_0x4f6b54);}})[_0x1d02('0x21')](function(_0x59a48f){if(_0x59a48f){return _0x59a48f?{'count':_0x3296ac,'rows':_0x59a48f}:null;}})['then'](respondWithResult(_0xf6ab9,null))[_0x1d02('0x41')](handleError(_0xf6ab9,null));}; \ No newline at end of file +var _0x1778=['role','user','MusicOnHolds','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','forEach','unlinkSync','Sequelize','message','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','basename','extname','%s.%s','symlinkSync','ValidationError','removeSound','id2','order','getSounds','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','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','destroy','then','UserProfileResource','stack','name','send','map','VoiceMusicOnHold','rawAttributes','fieldName','type','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','include','rows','catch','show','params','keys','includeAll','find','body','create','sequelize','transaction','files','join','root','server/files/moh','mode','mkdirSync','directory','0777','get','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x344d8d,_0x510fea){var _0x335c35=function(_0x4f2301){while(--_0x4f2301){_0x344d8d['push'](_0x344d8d['shift']());}};_0x335c35(++_0x510fea);}(_0x1778,0x100));var _0x8177=function(_0x2f1590,_0x286358){_0x2f1590=_0x2f1590-0x0;var _0x2c1783=_0x1778[_0x2f1590];return _0x2c1783;};'use strict';var emlformat=require(_0x8177('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8177('0x1'));var jsonpatch=require(_0x8177('0x2'));var rp=require(_0x8177('0x3'));var moment=require(_0x8177('0x4'));var BPromise=require(_0x8177('0x5'));var Mustache=require(_0x8177('0x6'));var util=require(_0x8177('0x7'));var path=require('path');var sox=require(_0x8177('0x8'));var csv=require(_0x8177('0x9'));var ejs=require(_0x8177('0xa'));var fs=require('fs');var fs_extra=require(_0x8177('0xb'));var _=require('lodash');var squel=require(_0x8177('0xc'));var crypto=require(_0x8177('0xd'));var jsforce=require(_0x8177('0xe'));var deskjs=require(_0x8177('0xf'));var toCsv=require(_0x8177('0x9'));var querystring=require(_0x8177('0x10'));var Papa=require(_0x8177('0x11'));var Redis=require('ioredis');var authService=require(_0x8177('0x12'));var qs=require(_0x8177('0x13'));var as=require(_0x8177('0x14'));var hardwareService=require(_0x8177('0x15'));var logger=require(_0x8177('0x16'))(_0x8177('0x17'));var utils=require(_0x8177('0x18'));var config=require(_0x8177('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x8177('0x1a'))['db'];function respondWithStatusCode(_0x388c91,_0x5aa89e){_0x5aa89e=_0x5aa89e||0xcc;return function(_0xd3466){if(_0xd3466){return _0x388c91[_0x8177('0x1b')](_0x5aa89e);}return _0x388c91['status'](_0x5aa89e)[_0x8177('0x1c')]();};}function respondWithResult(_0x8a5ba4,_0x56d564){_0x56d564=_0x56d564||0xc8;return function(_0x2e8baa){if(_0x2e8baa){return _0x8a5ba4[_0x8177('0x1d')](_0x56d564)[_0x8177('0x1e')](_0x2e8baa);}};}function respondWithFilteredResult(_0x2c628a,_0x467581){return function(_0xadf4af){if(_0xadf4af){var _0x3e2b3a=typeof _0x467581[_0x8177('0x1f')]===_0x8177('0x20')&&typeof _0x467581[_0x8177('0x21')]===_0x8177('0x20');var _0x3e3ec1=_0xadf4af[_0x8177('0x22')];var _0x19bb9a=_0x3e2b3a?0x0:_0x467581['offset'];var _0x336aeb=_0x3e2b3a?_0xadf4af[_0x8177('0x22')]:_0x467581[_0x8177('0x1f')]+_0x467581[_0x8177('0x21')];var _0x343181;if(_0x336aeb>=_0x3e3ec1){_0x336aeb=_0x3e3ec1;_0x343181=0xc8;}else{_0x343181=0xce;}_0x2c628a[_0x8177('0x1d')](_0x343181);return _0x2c628a[_0x8177('0x23')](_0x8177('0x24'),_0x19bb9a+'-'+_0x336aeb+'/'+_0x3e3ec1)[_0x8177('0x1e')](_0xadf4af);}return null;};}function patchUpdates(_0xbe5cb){return function(_0x291037){try{jsonpatch['apply'](_0x291037,_0xbe5cb,!![]);}catch(_0x3decf6){return BPromise['reject'](_0x3decf6);}return _0x291037[_0x8177('0x25')]();};}function saveUpdates(_0x364565,_0x438f7c){return function(_0x40d88e){if(_0x40d88e){return _0x40d88e['update'](_0x364565)['then'](function(_0x8badee){return _0x8badee;});}return null;};}function removeEntity(_0x2e4ded,_0x418538){return function(_0x212f51){if(_0x212f51){return _0x212f51[_0x8177('0x26')]()[_0x8177('0x27')](function(){var _0x1586b6=_0x212f51['get']({'plain':!![]});var _0x4a377a='MusicOnHolds';return db[_0x8177('0x28')][_0x8177('0x26')]({'where':{'type':_0x4a377a,'resourceId':_0x1586b6['id']}})[_0x8177('0x27')](function(){return _0x212f51;});})[_0x8177('0x27')](function(){_0x2e4ded[_0x8177('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x440e2f,_0x3f0b3e){return function(_0x3c59fd){if(!_0x3c59fd){_0x440e2f['sendStatus'](0x194);}return _0x3c59fd;};}function handleError(_0x3a4d7b,_0xde9433){_0xde9433=_0xde9433||0x1f4;return function(_0x59721a){logger['error'](_0x59721a[_0x8177('0x29')]);if(_0x59721a['name']){delete _0x59721a[_0x8177('0x2a')];}_0x3a4d7b[_0x8177('0x1d')](_0xde9433)[_0x8177('0x2b')](_0x59721a);};}exports['index']=function(_0x2a6640,_0x311ae6){var _0x406d8b={},_0x4125d7={},_0x45651f={'count':0x0,'rows':[]};var _0x1c658a=_[_0x8177('0x2c')](db[_0x8177('0x2d')][_0x8177('0x2e')],function(_0x48ccc8){return{'name':_0x48ccc8[_0x8177('0x2f')],'type':_0x48ccc8[_0x8177('0x30')]['key']};});_0x4125d7[_0x8177('0x31')]=_[_0x8177('0x2c')](_0x1c658a,'name');_0x4125d7[_0x8177('0x32')]=_['keys'](_0x2a6640[_0x8177('0x32')]);_0x4125d7['filters']=_[_0x8177('0x33')](_0x4125d7[_0x8177('0x31')],_0x4125d7['query']);_0x406d8b['attributes']=_[_0x8177('0x33')](_0x4125d7['model'],qs[_0x8177('0x34')](_0x2a6640['query'][_0x8177('0x34')]));_0x406d8b['attributes']=_0x406d8b[_0x8177('0x35')][_0x8177('0x36')]?_0x406d8b[_0x8177('0x35')]:_0x4125d7[_0x8177('0x31')];if(!_0x2a6640[_0x8177('0x32')][_0x8177('0x37')](_0x8177('0x38'))){_0x406d8b[_0x8177('0x21')]=qs[_0x8177('0x21')](_0x2a6640['query'][_0x8177('0x21')]);_0x406d8b[_0x8177('0x1f')]=qs[_0x8177('0x1f')](_0x2a6640['query']['offset']);}_0x406d8b['order']=qs[_0x8177('0x39')](_0x2a6640[_0x8177('0x32')][_0x8177('0x39')]);delete _0x2a6640[_0x8177('0x32')][_0x8177('0x39')];_0x406d8b[_0x8177('0x3a')]=qs[_0x8177('0x3b')](_[_0x8177('0x3c')](_0x2a6640['query'],_0x4125d7[_0x8177('0x3b')]),_0x1c658a);if(_0x2a6640[_0x8177('0x32')][_0x8177('0x3d')]){_0x406d8b[_0x8177('0x3a')]=_[_0x8177('0x3e')](_0x406d8b[_0x8177('0x3a')],{'$or':_[_0x8177('0x2c')](_0x1c658a,function(_0x287c24){if(_0x287c24[_0x8177('0x30')]!=='VIRTUAL'){var _0x3ded55={};_0x3ded55[_0x287c24[_0x8177('0x2a')]]={'$like':'%'+_0x2a6640[_0x8177('0x32')][_0x8177('0x3d')]+'%'};return _0x3ded55;}})});}_0x406d8b=_[_0x8177('0x3e')]({},_0x406d8b,_0x2a6640[_0x8177('0x3f')]);var _0x1522ba={'where':_0x406d8b[_0x8177('0x3a')]};return db[_0x8177('0x2d')][_0x8177('0x22')](_0x1522ba)['then'](function(_0x2f14a4){_0x45651f[_0x8177('0x22')]=_0x2f14a4;if(_0x2a6640[_0x8177('0x32')]['includeAll']){_0x406d8b[_0x8177('0x40')]=[{'all':!![]}];}return db['VoiceMusicOnHold']['findAll'](_0x406d8b);})[_0x8177('0x27')](function(_0x1d711a){_0x45651f[_0x8177('0x41')]=_0x1d711a;return _0x45651f;})['then'](respondWithFilteredResult(_0x311ae6,_0x406d8b))[_0x8177('0x42')](handleError(_0x311ae6,null));};exports[_0x8177('0x43')]=function(_0x36ea5e,_0x5d91c4){var _0x197023={'raw':![],'where':{'id':_0x36ea5e[_0x8177('0x44')]['id']}},_0x31a4cc={};_0x31a4cc[_0x8177('0x31')]=_['keys'](db[_0x8177('0x2d')][_0x8177('0x2e')]);_0x31a4cc[_0x8177('0x32')]=_[_0x8177('0x45')](_0x36ea5e[_0x8177('0x32')]);_0x31a4cc[_0x8177('0x3b')]=_['intersection'](_0x31a4cc[_0x8177('0x31')],_0x31a4cc[_0x8177('0x32')]);_0x197023['attributes']=_[_0x8177('0x33')](_0x31a4cc['model'],qs[_0x8177('0x34')](_0x36ea5e[_0x8177('0x32')]['fields']));_0x197023[_0x8177('0x35')]=_0x197023[_0x8177('0x35')][_0x8177('0x36')]?_0x197023[_0x8177('0x35')]:_0x31a4cc[_0x8177('0x31')];if(_0x36ea5e[_0x8177('0x32')][_0x8177('0x46')]){_0x197023[_0x8177('0x40')]=[{'all':!![]}];}_0x197023=_[_0x8177('0x3e')]({},_0x197023,_0x36ea5e['options']);return db[_0x8177('0x2d')][_0x8177('0x47')](_0x197023)[_0x8177('0x27')](handleEntityNotFound(_0x5d91c4,null))['then'](respondWithResult(_0x5d91c4,null))['catch'](handleError(_0x5d91c4,null));};exports['update']=function(_0x1294d8,_0x59d0bd){if(_0x1294d8[_0x8177('0x48')]['id']){delete _0x1294d8[_0x8177('0x48')]['id'];}return db[_0x8177('0x2d')][_0x8177('0x47')]({'where':{'id':_0x1294d8[_0x8177('0x44')]['id']}})[_0x8177('0x27')](handleEntityNotFound(_0x59d0bd,null))[_0x8177('0x27')](saveUpdates(_0x1294d8[_0x8177('0x48')],null))[_0x8177('0x27')](respondWithResult(_0x59d0bd,null))['catch'](handleError(_0x59d0bd,null));};exports[_0x8177('0x49')]=function(_0x363d25,_0x185641,_0x27b9a2){return db[_0x8177('0x4a')][_0x8177('0x4b')](function(_0x261b3a){if(_0x363d25[_0x8177('0x48')]['mode']===_0x8177('0x4c')){_0x363d25[_0x8177('0x48')]['directory']=path[_0x8177('0x4d')](config[_0x8177('0x4e')],_0x8177('0x4f'),_0x363d25[_0x8177('0x48')][_0x8177('0x2a')]);}return db[_0x8177('0x2d')][_0x8177('0x49')](_0x363d25[_0x8177('0x48')],{'transaction':_0x261b3a})[_0x8177('0x27')](function(_0x144ce7){if(_0x363d25[_0x8177('0x48')][_0x8177('0x50')]===_0x8177('0x4c')){fs[_0x8177('0x51')](_0x144ce7[_0x8177('0x52')],parseInt(_0x8177('0x53'),0x8));}var _0x5643c6=_0x363d25['user'][_0x8177('0x54')]({'plain':!![]});if(!_0x5643c6)throw new Error(_0x8177('0x55'));if(_0x5643c6[_0x8177('0x56')]===_0x8177('0x57')){var _0x1f68c7=_0x144ce7[_0x8177('0x54')]({'plain':!![]});return db['UserProfileSection'][_0x8177('0x47')]({'where':{'name':_0x8177('0x58'),'userProfileId':_0x5643c6[_0x8177('0x59')]},'raw':!![]})[_0x8177('0x27')](function(_0x503ce1){if(_0x503ce1&&_0x503ce1[_0x8177('0x5a')]===0x0){return db[_0x8177('0x28')][_0x8177('0x49')]({'name':_0x1f68c7[_0x8177('0x2a')],'resourceId':_0x1f68c7['id'],'type':_0x503ce1[_0x8177('0x2a')],'sectionId':_0x503ce1['id']},{})[_0x8177('0x27')](function(){return _0x144ce7;});}else{return _0x144ce7;}})[_0x8177('0x42')](function(_0x445399){logger[_0x8177('0x5b')](_0x8177('0x5c'),_0x445399);});}return _0x144ce7;});})['then'](respondWithResult(_0x185641,0xc9))[_0x8177('0x42')](handleError(_0x185641,null));};exports[_0x8177('0x26')]=function(_0x5e9d4e,_0x11f6db,_0x2bf07c){var _0x20246d;return db[_0x8177('0x2d')]['find']({'where':{'id':_0x5e9d4e[_0x8177('0x44')]['id']}})[_0x8177('0x27')](function(_0x1c6bc3){if(_0x1c6bc3){return db[_0x8177('0x4a')][_0x8177('0x4b')](function(_0x15217d){return _0x1c6bc3['destroy']({'transaction':_0x15217d,'raw':!![]})[_0x8177('0x27')](function(_0x3b83d0){if(_0x3b83d0[_0x8177('0x52')]){fs['readdirSync'](_0x3b83d0[_0x8177('0x52')])[_0x8177('0x5d')](function(_0x52df25){fs[_0x8177('0x5e')](path[_0x8177('0x4d')](_0x3b83d0['directory'],_0x52df25));});fs['rmdirSync'](_0x3b83d0['directory']);}return _0x3b83d0;});})[_0x8177('0x42')](function(_0x5c3216){throw new db[(_0x8177('0x5f'))]['ValidationError'](_0x5c3216[_0x8177('0x60')]);});}})[_0x8177('0x27')](handleEntityNotFound(_0x11f6db,null))[_0x8177('0x27')](removeEntity(_0x11f6db,null))[_0x8177('0x42')](handleError(_0x11f6db,null));};exports['addSound']=function(_0x52a68a,_0x2bd9ee,_0x1abb7d){return db[_0x8177('0x4a')]['transaction'](function(_0x520e40){var _0x3f07ee;return db[_0x8177('0x2d')][_0x8177('0x47')]({'where':{'id':_0x52a68a['params']['id']}})['then'](function(_0x27072f){if(_0x27072f){_0x3f07ee=_0x27072f;return _0x27072f[_0x8177('0x61')](_0x52a68a[_0x8177('0x48')]['id'],{'transaction':_0x520e40});}})['then'](function(_0x38a747){if(_0x38a747){return db[_0x8177('0x62')][_0x8177('0x63')]({'where':{'id':_0x52a68a[_0x8177('0x48')]['id']},'attributes':['id',_0x8177('0x2a'),_0x8177('0x64'),_0x8177('0x65'),_0x8177('0x66')],'raw':!![]});}})[_0x8177('0x27')](function(_0xba6005){if(_0xba6005){var _0x339cf0=path[_0x8177('0x4d')](config['root'],_0x8177('0x67'),util[_0x8177('0x68')]('%s.%s',path[_0x8177('0x69')](_0xba6005[_0x8177('0x64')],path[_0x8177('0x6a')](_0xba6005[_0x8177('0x64')])),_0xba6005[_0x8177('0x65')]));var _0x5210e4=path[_0x8177('0x4d')](config[_0x8177('0x4e')],_0x8177('0x4f'),_0x3f07ee[_0x8177('0x2a')],util[_0x8177('0x68')](_0x8177('0x6b'),_0xba6005['name'],_0xba6005[_0x8177('0x65')]));fs[_0x8177('0x6c')](_0x339cf0,_0x5210e4);return _0xba6005;}})[_0x8177('0x42')](function(_0x2b7f76){throw new db[(_0x8177('0x5f'))][(_0x8177('0x6d'))](_0x2b7f76[_0x8177('0x60')]);});})['then'](handleEntityNotFound(_0x2bd9ee,null))['then'](respondWithResult(_0x2bd9ee,0xc9))[_0x8177('0x42')](handleError(_0x2bd9ee,null));};exports[_0x8177('0x6e')]=function(_0x5022f4,_0x413ed8,_0x206249){return db[_0x8177('0x4a')]['transaction'](function(_0x4b156d){var _0x251235;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x5022f4[_0x8177('0x44')]['id']}})['then'](handleEntityNotFound(_0x413ed8,null))[_0x8177('0x27')](function(_0x442bea){if(_0x442bea){_0x251235=_0x442bea;return _0x442bea[_0x8177('0x6e')](_0x5022f4[_0x8177('0x44')][_0x8177('0x6f')]);}})[_0x8177('0x27')](function(_0x5891ed){if(_0x5891ed){return db[_0x8177('0x62')][_0x8177('0x63')]({'where':{'id':_0x5022f4['params']['id2']},'attributes':['id',_0x8177('0x2a'),_0x8177('0x64'),_0x8177('0x65'),'createdAt'],'raw':!![]});}})[_0x8177('0x27')](function(_0x15a57a){if(_0x15a57a){fs[_0x8177('0x5e')](path['join'](_0x251235['directory'],util[_0x8177('0x68')]('%s.%s',_0x15a57a['name'],_0x15a57a[_0x8177('0x65')])));return _0x15a57a;}})[_0x8177('0x42')](function(_0x526d7d){throw new db[(_0x8177('0x5f'))][(_0x8177('0x6d'))](_0x526d7d[_0x8177('0x60')]);});})['then'](handleEntityNotFound(_0x413ed8,null))[_0x8177('0x27')](respondWithStatusCode(_0x413ed8,0xcc))['catch'](handleError(_0x413ed8,null));};exports['getSounds']=function(_0x5183c6,_0x5c6af0,_0x4253df){var _0x17d4a9={};var _0x431907={};var _0x2c7e9f;var _0x5ecd24;return db[_0x8177('0x2d')][_0x8177('0x63')]({'where':{'id':_0x5183c6['params']['id']}})[_0x8177('0x27')](handleEntityNotFound(_0x5c6af0,null))[_0x8177('0x27')](function(_0x46203f){if(_0x46203f){_0x2c7e9f=_0x46203f;_0x431907[_0x8177('0x31')]=_[_0x8177('0x45')](db['Sound'][_0x8177('0x2e')]);_0x431907[_0x8177('0x32')]=_['keys'](_0x5183c6['query']);_0x431907['filters']=_[_0x8177('0x33')](_0x431907[_0x8177('0x31')],_0x431907[_0x8177('0x32')]);_0x17d4a9[_0x8177('0x35')]=_[_0x8177('0x33')](_0x431907[_0x8177('0x31')],qs[_0x8177('0x34')](_0x5183c6[_0x8177('0x32')][_0x8177('0x34')]));_0x17d4a9[_0x8177('0x35')]=_0x17d4a9['attributes'][_0x8177('0x36')]?_0x17d4a9[_0x8177('0x35')]:_0x431907['model'];_0x17d4a9[_0x8177('0x70')]=qs[_0x8177('0x39')](_0x5183c6[_0x8177('0x32')][_0x8177('0x39')]);_0x17d4a9[_0x8177('0x3a')]=qs[_0x8177('0x3b')](_[_0x8177('0x3c')](_0x5183c6[_0x8177('0x32')],_0x431907[_0x8177('0x3b')]));if(_0x5183c6[_0x8177('0x32')][_0x8177('0x3d')]){_0x17d4a9[_0x8177('0x3a')]=_[_0x8177('0x3e')](_0x17d4a9[_0x8177('0x3a')],{'$or':_[_0x8177('0x2c')](_0x17d4a9['attributes'],function(_0x703131){var _0x2c4363={};_0x2c4363[_0x703131]={'$like':'%'+_0x5183c6[_0x8177('0x32')][_0x8177('0x3d')]+'%'};return _0x2c4363;})});}_0x17d4a9=_[_0x8177('0x3e')]({},_0x17d4a9,_0x5183c6['options']);return _0x2c7e9f[_0x8177('0x71')](_0x17d4a9);}})[_0x8177('0x27')](function(_0x40d811){if(_0x40d811){_0x5ecd24=_0x40d811[_0x8177('0x36')];if(!_0x5183c6[_0x8177('0x32')][_0x8177('0x37')]('nolimit')){_0x17d4a9[_0x8177('0x21')]=qs[_0x8177('0x21')](_0x5183c6[_0x8177('0x32')]['limit']);_0x17d4a9[_0x8177('0x1f')]=qs[_0x8177('0x1f')](_0x5183c6[_0x8177('0x32')][_0x8177('0x1f')]);}return _0x2c7e9f[_0x8177('0x71')](_0x17d4a9);}})[_0x8177('0x27')](function(_0x2af778){if(_0x2af778){return _0x2af778?{'count':_0x5ecd24,'rows':_0x2af778}:null;}})[_0x8177('0x27')](respondWithResult(_0x5c6af0,null))[_0x8177('0x42')](handleError(_0x5c6af0,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index ec786f7..b3f6f09 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 _0x9509=['exports','define','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x4c7717,_0x520a56){var _0x3cd802=function(_0x3f9dfb){while(--_0x3f9dfb){_0x4c7717['push'](_0x4c7717['shift']());}};_0x3cd802(++_0x520a56);}(_0x9509,0xe3));var _0x9950=function(_0x577932,_0x309e85){_0x577932=_0x577932-0x0;var _0x1e8276=_0x9509[_0x577932];return _0x1e8276;};'use strict';var _=require('lodash');var util=require(_0x9950('0x0'));var logger=require(_0x9950('0x1'))('api');var moment=require(_0x9950('0x2'));var BPromise=require(_0x9950('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9950('0x4'));var rimraf=require(_0x9950('0x5'));var config=require(_0x9950('0x6'));var attributes=require('./voiceMusicOnHold.attributes');module[_0x9950('0x7')]=function(_0xf0e6a0,_0x2caa1a){return _0xf0e6a0[_0x9950('0x8')]('VoiceMusicOnHold',attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x698a=['request-promise','../../config/environment','./voiceMusicOnHold.attributes','exports','VoiceMusicOnHold','voice_musiconhold','util','../../config/logger','api','moment','bluebird'];(function(_0x22f48b,_0x1c31d8){var _0x150531=function(_0x44c3e3){while(--_0x44c3e3){_0x22f48b['push'](_0x22f48b['shift']());}};_0x150531(++_0x1c31d8);}(_0x698a,0x13a));var _0xa698=function(_0xd5709b,_0x101823){_0xd5709b=_0xd5709b-0x0;var _0x3dc484=_0x698a[_0xd5709b];return _0x3dc484;};'use strict';var _=require('lodash');var util=require(_0xa698('0x0'));var logger=require(_0xa698('0x1'))(_0xa698('0x2'));var moment=require(_0xa698('0x3'));var BPromise=require(_0xa698('0x4'));var rp=require(_0xa698('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa698('0x6'));var attributes=require(_0xa698('0x7'));module[_0xa698('0x8')]=function(_0x2ff08e,_0xf39ca6){return _0x2ff08e['define'](_0xa698('0x9'),attributes,{'tableName':_0xa698('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index 455ae71..166e9c8 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x49a6d7,_0x1e86c4){var _0x3232e5=function(_0x345497){while(--_0x345497){_0x49a6d7['push'](_0x49a6d7['shift']());}};_0x3232e5(++_0x1e86c4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'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 _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(_0x17c47e,_0x504b92){var _0x4bb060=function(_0x53aa2e){while(--_0x53aa2e){_0x17c47e['push'](_0x17c47e['shift']());}};_0x4bb060(++_0x504b92);}(_0x70e0,0x17b));var _0x070e=function(_0x44afbe,_0x34b042){_0x44afbe=_0x44afbe-0x0;var _0x2a656d=_0x70e0[_0x44afbe];return _0x2a656d;};'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 diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index a5a74e8..1725ef8 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 _0xd338=['../../config/environment','isAuthenticated','/describe','describe','get','show','/:id/users','/:id/teams','post','create','addAgents','/:id','update','delete','removeTeams','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1b0a0a,_0xd6f80a){var _0x45da2a=function(_0x1b5960){while(--_0x1b5960){_0x1b0a0a['push'](_0x1b0a0a['shift']());}};_0x45da2a(++_0xd6f80a);}(_0xd338,0x1f4));var _0x8d33=function(_0x2e76a7,_0x23871a){_0x2e76a7=_0x2e76a7-0x0;var _0x454cde=_0xd338[_0x2e76a7];return _0x454cde;};'use strict';var multer=require(_0x8d33('0x0'));var util=require('util');var path=require(_0x8d33('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8d33('0x2')]();var fs_extra=require(_0x8d33('0x3'));var auth=require(_0x8d33('0x4'));var interaction=require(_0x8d33('0x5'));var config=require(_0x8d33('0x6'));var controller=require('./voicePrefix.controller');router['get']('/',auth[_0x8d33('0x7')](),controller['index']);router['get'](_0x8d33('0x8'),auth[_0x8d33('0x7')](),controller[_0x8d33('0x9')]);router[_0x8d33('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x8d33('0xb')]);router[_0x8d33('0xa')](_0x8d33('0xc'),auth[_0x8d33('0x7')](),controller['getAgents']);router[_0x8d33('0xa')](_0x8d33('0xd'),auth[_0x8d33('0x7')](),controller['getTeams']);router[_0x8d33('0xe')]('/',auth[_0x8d33('0x7')](),controller[_0x8d33('0xf')]);router[_0x8d33('0xe')](_0x8d33('0xc'),auth[_0x8d33('0x7')](),controller[_0x8d33('0x10')]);router[_0x8d33('0xe')](_0x8d33('0xd'),auth[_0x8d33('0x7')](),controller['addTeams']);router['put'](_0x8d33('0x11'),auth[_0x8d33('0x7')](),controller[_0x8d33('0x12')]);router[_0x8d33('0x13')](_0x8d33('0x11'),auth[_0x8d33('0x7')](),controller['destroy']);router[_0x8d33('0x13')](_0x8d33('0xc'),auth[_0x8d33('0x7')](),controller['removeAgents']);router['delete'](_0x8d33('0xd'),auth['isAuthenticated'](),controller[_0x8d33('0x14')]);module[_0x8d33('0x15')]=router; \ No newline at end of file +var _0x07b9=['delete','removeAgents','removeTeams','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','show','/:id/users','getAgents','/:id/teams','getTeams','post','create','addAgents','addTeams','/:id','destroy'];(function(_0x58cb13,_0x2014ad){var _0x3f2297=function(_0x5b2c90){while(--_0x5b2c90){_0x58cb13['push'](_0x58cb13['shift']());}};_0x3f2297(++_0x2014ad);}(_0x07b9,0x143));var _0x907b=function(_0x46f3f8,_0x12c74b){_0x46f3f8=_0x46f3f8-0x0;var _0xbc57cd=_0x07b9[_0x46f3f8];return _0xbc57cd;};'use strict';var multer=require(_0x907b('0x0'));var util=require(_0x907b('0x1'));var path=require(_0x907b('0x2'));var timeout=require(_0x907b('0x3'));var express=require('express');var router=express[_0x907b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x907b('0x5'));var interaction=require(_0x907b('0x6'));var config=require(_0x907b('0x7'));var controller=require(_0x907b('0x8'));router[_0x907b('0x9')]('/',auth[_0x907b('0xa')](),controller[_0x907b('0xb')]);router['get'](_0x907b('0xc'),auth[_0x907b('0xa')](),controller[_0x907b('0xd')]);router[_0x907b('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x907b('0xe')]);router[_0x907b('0x9')](_0x907b('0xf'),auth[_0x907b('0xa')](),controller[_0x907b('0x10')]);router[_0x907b('0x9')](_0x907b('0x11'),auth[_0x907b('0xa')](),controller[_0x907b('0x12')]);router[_0x907b('0x13')]('/',auth['isAuthenticated'](),controller[_0x907b('0x14')]);router['post']('/:id/users',auth[_0x907b('0xa')](),controller[_0x907b('0x15')]);router[_0x907b('0x13')](_0x907b('0x11'),auth[_0x907b('0xa')](),controller[_0x907b('0x16')]);router['put'](_0x907b('0x17'),auth[_0x907b('0xa')](),controller['update']);router['delete'](_0x907b('0x17'),auth[_0x907b('0xa')](),controller[_0x907b('0x18')]);router[_0x907b('0x19')](_0x907b('0xf'),auth['isAuthenticated'](),controller[_0x907b('0x1a')]);router[_0x907b('0x19')]('/:id/teams',auth[_0x907b('0xa')](),controller[_0x907b('0x1b')]);module[_0x907b('0x1c')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 3b4710a..76c112b 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 _0x1fcd=['getDataValue','name','INTEGER','sequelize','STRING','system-'];(function(_0x183e20,_0x121692){var _0x4ad7f9=function(_0x303020){while(--_0x303020){_0x183e20['push'](_0x183e20['shift']());}};_0x4ad7f9(++_0x121692);}(_0x1fcd,0x93));var _0xd1fc=function(_0x1a7550,_0x1edace){_0x1a7550=_0x1a7550-0x0;var _0x426e22=_0x1fcd[_0x1a7550];return _0x426e22;};'use strict';var Sequelize=require(_0xd1fc('0x0'));module['exports']={'name':{'type':Sequelize[_0xd1fc('0x1')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x46eb73){return _0xd1fc('0x2')+this[_0xd1fc('0x3')](_0xd1fc('0x4'))+'-';}},'description':{'type':Sequelize[_0xd1fc('0x1')]},'callerIdAll':{'type':Sequelize[_0xd1fc('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0xd1fc('0x5')]}}; \ No newline at end of file +var _0x7d47=['STRING','name','getDataValue','exports'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0x7d47,0x1d7));var _0x77d4=function(_0x224f7b,_0x321823){_0x224f7b=_0x224f7b-0x0;var _0x518089=_0x7d47[_0x224f7b];return _0x518089;};'use strict';var Sequelize=require('sequelize');module[_0x77d4('0x0')]={'name':{'type':Sequelize[_0x77d4('0x1')],'allowNull':![],'unique':_0x77d4('0x2')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x3b8019){return'system-'+this[_0x77d4('0x3')]('name')+'-';}},'description':{'type':Sequelize[_0x77d4('0x1')]},'callerIdAll':{'type':Sequelize[_0x77d4('0x1')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index db8e852..6d5855f 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 _0xd4f4=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','./voicePrefix.socket','register','sendStatus','end','status','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','filters','filter','merge','options','includeAll','include','VoicePrefix','rows','catch','show','keys','find','params','describe','sequelize','create','body','VoiceExtension','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','system','description','priority','prefix','NoOp','Voice\x20Prefix','bulkCreate','push','Set','CDR(prefix)=','callerIdAll','goto','${EXTEN:','length','charAt','system-','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','pick','getTeams','findAll','Agents','online','voicePause','interface','flatMap','transaction','addTeams','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','removeTeams','Team','field','tq.TeamId','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','TeamId','includes','union','compact','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x39b38f,_0x3d8594){var _0x311e84=function(_0x314368){while(--_0x314368){_0x39b38f['push'](_0x39b38f['shift']());}};_0x311e84(++_0x3d8594);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x26cde2,_0x2951b7){_0x26cde2=_0x26cde2-0x0;var _0x14a95d=_0xd4f4[_0x26cde2];return _0x14a95d;};'use strict';var emlformat=require(_0x4d4f('0x0'));var rimraf=require(_0x4d4f('0x1'));var zipdir=require(_0x4d4f('0x2'));var jsonpatch=require(_0x4d4f('0x3'));var rp=require(_0x4d4f('0x4'));var moment=require(_0x4d4f('0x5'));var BPromise=require(_0x4d4f('0x6'));var Mustache=require(_0x4d4f('0x7'));var util=require(_0x4d4f('0x8'));var path=require(_0x4d4f('0x9'));var sox=require(_0x4d4f('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4d4f('0xb'));var squel=require(_0x4d4f('0xc'));var crypto=require(_0x4d4f('0xd'));var jsforce=require(_0x4d4f('0xe'));var deskjs=require(_0x4d4f('0xf'));var toCsv=require(_0x4d4f('0x10'));var querystring=require(_0x4d4f('0x11'));var Papa=require(_0x4d4f('0x12'));var Redis=require(_0x4d4f('0x13'));var authService=require(_0x4d4f('0x14'));var qs=require(_0x4d4f('0x15'));var as=require(_0x4d4f('0x16'));var hardwareService=require(_0x4d4f('0x17'));var logger=require(_0x4d4f('0x18'))(_0x4d4f('0x19'));var utils=require(_0x4d4f('0x1a'));var config=require(_0x4d4f('0x1b'));var licenseUtil=require(_0x4d4f('0x1c'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x4d4f('0x1d')],{'host':_0x4d4f('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4d4f('0x1d')]));require(_0x4d4f('0x1f'))[_0x4d4f('0x20')](socket);function respondWithStatusCode(_0x59252c,_0x145804){_0x145804=_0x145804||0xcc;return function(_0x2e736b){if(_0x2e736b){return _0x59252c[_0x4d4f('0x21')](_0x145804);}return _0x59252c['status'](_0x145804)[_0x4d4f('0x22')]();};}function respondWithResult(_0x5e4ff5,_0x18a528){_0x18a528=_0x18a528||0xc8;return function(_0x16f8e7){if(_0x16f8e7){return _0x5e4ff5[_0x4d4f('0x23')](_0x18a528)['json'](_0x16f8e7);}};}function respondWithFilteredResult(_0x30b6b1,_0x17a437){return function(_0x51dcf1){if(_0x51dcf1){var _0x5dbbeb=typeof _0x17a437['offset']==='undefined'&&typeof _0x17a437['limit']===_0x4d4f('0x24');var _0x15100a=_0x51dcf1[_0x4d4f('0x25')];var _0x3566a5=_0x5dbbeb?0x0:_0x17a437['offset'];var _0x5b2863=_0x5dbbeb?_0x51dcf1[_0x4d4f('0x25')]:_0x17a437['offset']+_0x17a437[_0x4d4f('0x26')];var _0x1e3e9a;if(_0x5b2863>=_0x15100a){_0x5b2863=_0x15100a;_0x1e3e9a=0xc8;}else{_0x1e3e9a=0xce;}_0x30b6b1[_0x4d4f('0x23')](_0x1e3e9a);return _0x30b6b1[_0x4d4f('0x27')](_0x4d4f('0x28'),_0x3566a5+'-'+_0x5b2863+'/'+_0x15100a)['json'](_0x51dcf1);}return null;};}function patchUpdates(_0x570520){return function(_0x4043f2){try{jsonpatch['apply'](_0x4043f2,_0x570520,!![]);}catch(_0x247077){return BPromise[_0x4d4f('0x29')](_0x247077);}return _0x4043f2[_0x4d4f('0x2a')]();};}function saveUpdates(_0x3f4a55,_0xf3f7a4){return function(_0x497cec){if(_0x497cec){return _0x497cec[_0x4d4f('0x2b')](_0x3f4a55)[_0x4d4f('0x2c')](function(_0x1cf365){return _0x1cf365;});}return null;};}function removeEntity(_0x28443b,_0x5cf9e7){return function(_0x51a7c5){if(_0x51a7c5){return _0x51a7c5[_0x4d4f('0x2d')]()[_0x4d4f('0x2c')](function(){var _0xa2492c=_0x51a7c5[_0x4d4f('0x2e')]({'plain':!![]});var _0x58acbe=_0x4d4f('0x2f');return db[_0x4d4f('0x30')][_0x4d4f('0x2d')]({'where':{'type':_0x58acbe,'resourceId':_0xa2492c['id']}})[_0x4d4f('0x2c')](function(){return _0x51a7c5;});})['then'](function(){_0x28443b[_0x4d4f('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1688bb,_0x333a40){return function(_0x550040){if(!_0x550040){_0x1688bb[_0x4d4f('0x21')](0x194);}return _0x550040;};}function handleError(_0x123383,_0x287a09){_0x287a09=_0x287a09||0x1f4;return function(_0x3d7f14){logger[_0x4d4f('0x31')](_0x3d7f14[_0x4d4f('0x32')]);if(_0x3d7f14['name']){delete _0x3d7f14[_0x4d4f('0x33')];}_0x123383[_0x4d4f('0x23')](_0x287a09)[_0x4d4f('0x34')](_0x3d7f14);};}exports[_0x4d4f('0x35')]=function(_0x104104,_0x4e47e5){var _0x2d6565={},_0x486e33={},_0x35f9e2={'count':0x0,'rows':[]};var _0x537a47=_['map'](db['VoicePrefix'][_0x4d4f('0x36')],function(_0x57fc2b){return{'name':_0x57fc2b[_0x4d4f('0x37')],'type':_0x57fc2b[_0x4d4f('0x38')][_0x4d4f('0x39')]};});_0x486e33['model']=_[_0x4d4f('0x3a')](_0x537a47,_0x4d4f('0x33'));_0x486e33[_0x4d4f('0x3b')]=_['keys'](_0x104104[_0x4d4f('0x3b')]);_0x486e33['filters']=_[_0x4d4f('0x3c')](_0x486e33[_0x4d4f('0x3d')],_0x486e33[_0x4d4f('0x3b')]);_0x2d6565[_0x4d4f('0x3e')]=_[_0x4d4f('0x3c')](_0x486e33[_0x4d4f('0x3d')],qs[_0x4d4f('0x3f')](_0x104104[_0x4d4f('0x3b')]['fields']));_0x2d6565['attributes']=_0x2d6565[_0x4d4f('0x3e')]['length']?_0x2d6565['attributes']:_0x486e33[_0x4d4f('0x3d')];if(!_0x104104[_0x4d4f('0x3b')][_0x4d4f('0x40')](_0x4d4f('0x41'))){_0x2d6565[_0x4d4f('0x26')]=qs['limit'](_0x104104[_0x4d4f('0x3b')][_0x4d4f('0x26')]);_0x2d6565['offset']=qs[_0x4d4f('0x42')](_0x104104[_0x4d4f('0x3b')][_0x4d4f('0x42')]);}_0x2d6565[_0x4d4f('0x43')]=qs[_0x4d4f('0x44')](_0x104104[_0x4d4f('0x3b')][_0x4d4f('0x44')]);_0x2d6565[_0x4d4f('0x45')]=qs[_0x4d4f('0x46')](_['pick'](_0x104104['query'],_0x486e33[_0x4d4f('0x46')]),_0x537a47);if(_0x104104[_0x4d4f('0x3b')][_0x4d4f('0x47')]){_0x2d6565[_0x4d4f('0x45')]=_['merge'](_0x2d6565['where'],{'$or':_[_0x4d4f('0x3a')](_0x537a47,function(_0x3c34bd){if(_0x3c34bd['type']!=='VIRTUAL'){var _0x3591b7={};_0x3591b7[_0x3c34bd[_0x4d4f('0x33')]]={'$like':'%'+_0x104104['query'][_0x4d4f('0x47')]+'%'};return _0x3591b7;}})});}_0x2d6565=_[_0x4d4f('0x48')]({},_0x2d6565,_0x104104[_0x4d4f('0x49')]);var _0x32c6ff={'where':_0x2d6565[_0x4d4f('0x45')]};return db['VoicePrefix'][_0x4d4f('0x25')](_0x32c6ff)['then'](function(_0x45a0c1){_0x35f9e2[_0x4d4f('0x25')]=_0x45a0c1;if(_0x104104['query'][_0x4d4f('0x4a')]){_0x2d6565[_0x4d4f('0x4b')]=[{'all':!![]}];}return db[_0x4d4f('0x4c')]['findAll'](_0x2d6565);})[_0x4d4f('0x2c')](function(_0x48caa2){_0x35f9e2[_0x4d4f('0x4d')]=_0x48caa2;return _0x35f9e2;})['then'](respondWithFilteredResult(_0x4e47e5,_0x2d6565))[_0x4d4f('0x4e')](handleError(_0x4e47e5,null));};exports[_0x4d4f('0x4f')]=function(_0x231134,_0x2939cb){var _0x198c3a={'raw':![],'where':{'id':_0x231134['params']['id']}},_0x4a53e4={};_0x4a53e4[_0x4d4f('0x3d')]=_[_0x4d4f('0x50')](db[_0x4d4f('0x4c')][_0x4d4f('0x36')]);_0x4a53e4['query']=_['keys'](_0x231134['query']);_0x4a53e4[_0x4d4f('0x46')]=_[_0x4d4f('0x3c')](_0x4a53e4[_0x4d4f('0x3d')],_0x4a53e4[_0x4d4f('0x3b')]);_0x198c3a[_0x4d4f('0x3e')]=_[_0x4d4f('0x3c')](_0x4a53e4[_0x4d4f('0x3d')],qs[_0x4d4f('0x3f')](_0x231134[_0x4d4f('0x3b')][_0x4d4f('0x3f')]));_0x198c3a[_0x4d4f('0x3e')]=_0x198c3a[_0x4d4f('0x3e')]['length']?_0x198c3a[_0x4d4f('0x3e')]:_0x4a53e4[_0x4d4f('0x3d')];if(_0x231134['query'][_0x4d4f('0x4a')]){_0x198c3a['include']=[{'all':!![]}];}_0x198c3a=_[_0x4d4f('0x48')]({},_0x198c3a,_0x231134[_0x4d4f('0x49')]);return db['VoicePrefix'][_0x4d4f('0x51')](_0x198c3a)[_0x4d4f('0x2c')](handleEntityNotFound(_0x2939cb,null))[_0x4d4f('0x2c')](respondWithResult(_0x2939cb,null))[_0x4d4f('0x4e')](handleError(_0x2939cb,null));};exports[_0x4d4f('0x2d')]=function(_0x3eae74,_0x11a63e){return db[_0x4d4f('0x4c')][_0x4d4f('0x51')]({'where':{'id':_0x3eae74[_0x4d4f('0x52')]['id']}})[_0x4d4f('0x2c')](handleEntityNotFound(_0x11a63e,null))[_0x4d4f('0x2c')](removeEntity(_0x11a63e,null))['catch'](handleError(_0x11a63e,null));};exports[_0x4d4f('0x53')]=function(_0x539088,_0x59d245){return db['VoicePrefix'][_0x4d4f('0x53')]()[_0x4d4f('0x2c')](respondWithResult(_0x59d245,null))['catch'](handleError(_0x59d245,null));};exports['create']=function(_0x2a3bc4,_0x4c80c4){var _0x5adc7b;return db[_0x4d4f('0x54')]['transaction'](function(_0x17b59e){return db[_0x4d4f('0x4c')][_0x4d4f('0x55')](_0x2a3bc4[_0x4d4f('0x56')],{'transaction':_0x17b59e})['then'](function(_0x224b83){_0x5adc7b=_0x224b83[_0x4d4f('0x2e')]({'plain':!![]});return db[_0x4d4f('0x57')][_0x4d4f('0x51')]({'where':{'id':_0x5adc7b[_0x4d4f('0x58')]},'raw':!![]})['then'](function(_0x10f94e){return createVoicePrefixExtensions(_0x5adc7b,_0x10f94e,_0x17b59e);});});})['then'](function(){var _0x32cba6=_0x2a3bc4['user'][_0x4d4f('0x2e')]({'plain':!![]});if(!_0x32cba6)throw new Error(_0x4d4f('0x59'));if(_0x32cba6['role']===_0x4d4f('0x5a')){var _0x1d8ae6=_0x5adc7b;return db['UserProfileSection'][_0x4d4f('0x51')]({'where':{'name':'VoicePrefixes','userProfileId':_0x32cba6[_0x4d4f('0x5b')]},'raw':!![]})['then'](function(_0x48ad06){if(_0x48ad06&&_0x48ad06[_0x4d4f('0x5c')]===0x0){return db[_0x4d4f('0x30')][_0x4d4f('0x55')]({'name':_0x1d8ae6[_0x4d4f('0x33')],'resourceId':_0x1d8ae6['id'],'type':_0x48ad06[_0x4d4f('0x33')],'sectionId':_0x48ad06['id']},{})['then'](function(){return _0x5adc7b;});}else{return _0x5adc7b;}})['catch'](function(_0xeaccdd){logger['error'](_0x4d4f('0x5d'),_0xeaccdd);throw _0xeaccdd;});}return _0x5adc7b;})[_0x4d4f('0x2c')](respondWithResult(_0x4c80c4,null))[_0x4d4f('0x4e')](handleError(_0x4c80c4,null));};function Extension(_0x4585b5,_0x31aba3,_0x39ae15,_0x585764){this[_0x4d4f('0x5e')]=_0x4d4f('0x5f');this[_0x4d4f('0x60')]=_0x4585b5;this['app']=_0x39ae15;this[_0x4d4f('0x38')]=_0x4d4f('0x61');this[_0x4d4f('0x62')]='Voice\x20Prefix\x20Extension';this[_0x4d4f('0x63')]=_0x31aba3;this['appdata']=_0x585764;}function createVoicePrefixExtensions(_0xcdab8b,_0x2145ca,_0x1fe5ca){return new BPromise(function(_0xe8d3e2,_0x1edb3d){var _0x2e55f5=new Extension(formatPrefixName(_0xcdab8b[_0x4d4f('0x64')]),0x1,_0x4d4f('0x65'),_0x4d4f('0x66'));_0x2e55f5['VoicePrefixId']=_0xcdab8b['id'];return db[_0x4d4f('0x57')][_0x4d4f('0x55')](_0x2e55f5,{'transaction':_0x1fe5ca})['then'](function(_0x1bd4b1){var _0x2a3738=_0x1bd4b1[_0x4d4f('0x2e')]({'plain':!![]});var _0xae8fe=_['map'](addVoicePrefixExtensions(_0xcdab8b,_0x2145ca),function(_0x4013a9){_0x4013a9[_0x4d4f('0x58')]=_0x2a3738['id'];_0x4013a9['VoicePrefixId']=_0xcdab8b['id'];return _0x4013a9;});return db['VoiceExtension'][_0x4d4f('0x67')](_0xae8fe,{'transaction':_0x1fe5ca})[_0x4d4f('0x2c')](function(_0x53b2db){if(!_0x53b2db){return _0x1edb3d('Extensions\x20creation\x20failed');}else{return _0xe8d3e2(_0x53b2db);}})['catch'](function(_0x4752bd){return _0x1edb3d(_0x4752bd);});});;});};function addVoicePrefixExtensions(_0x351fb5,_0x5e0ead){var _0x347bb1=[];var _0xc596ea=formatPrefixName(_0x351fb5[_0x4d4f('0x64')]);_0x347bb1[_0x4d4f('0x68')](new Extension(_0xc596ea,0x2,_0x4d4f('0x69'),_0x4d4f('0x6a')+_0x351fb5[_0x4d4f('0x33')]));if(_0x351fb5[_0x4d4f('0x6b')]){_0x347bb1['push'](new Extension(_0xc596ea,0x3,_0x4d4f('0x69'),'PREFIX-CALLERIDALL='+_0x351fb5[_0x4d4f('0x6b')]));}else{_0x347bb1[_0x4d4f('0x68')](new Extension(_0xc596ea,0x3,_0x4d4f('0x65'),'No\x20callerid\x20available'));}_0x347bb1[_0x4d4f('0x68')](new Extension(_0xc596ea,0x4,_0x4d4f('0x6c'),_0x5e0ead[_0x4d4f('0x5e')]+','+_0x4d4f('0x6d')+(0x8+_0x351fb5['name'][_0x4d4f('0x6e')])+'}'+','+0x1));return _0x347bb1;}function formatPrefixName(_0x4bf7bd){var _0x268b34='_';for(var _0x50d0da=0x0;_0x50d0da<_0x4bf7bd['length'];_0x50d0da++){if(_0x4bf7bd[_0x4d4f('0x6f')](_0x50d0da)=='-'){_0x268b34+=_0x4bf7bd[_0x4d4f('0x6f')](_0x50d0da);}else{_0x268b34+='['+_0x4bf7bd['charAt'](_0x50d0da)+']';}}_0x268b34+='.';return _0x268b34;}exports[_0x4d4f('0x2b')]=function(_0x53a18b,_0x41ffe7,_0x4420f0){var _0x111c01=_0x53a18b[_0x4d4f('0x56')];_0x111c01['prefix']=_0x4d4f('0x70')+_0x111c01[_0x4d4f('0x33')]+'-';return db[_0x4d4f('0x54')]['transaction'](function(_0x781877){return db[_0x4d4f('0x4c')][_0x4d4f('0x2b')](_0x111c01,{'where':{'id':_0x111c01['id']},'transaction':_0x781877})[_0x4d4f('0x2c')](function(){return db[_0x4d4f('0x57')][_0x4d4f('0x2d')]({'where':{'VoicePrefixId':_0x111c01['id']},'transaction':_0x781877})['then'](function(){return db['VoiceExtension'][_0x4d4f('0x51')]({'where':{'id':_0x111c01[_0x4d4f('0x58')]},'raw':!![]})['then'](function(_0x26ed6f){return createVoicePrefixExtensions(_0x111c01,_0x26ed6f,_0x781877);});});});})[_0x4d4f('0x2c')](function(){return db[_0x4d4f('0x4c')][_0x4d4f('0x71')](_0x111c01['id']);})[_0x4d4f('0x2c')](respondWithResult(_0x41ffe7,null))[_0x4d4f('0x4e')](handleError(_0x41ffe7,null));};exports[_0x4d4f('0x72')]=function(_0x1c764b,_0x302cde,_0x44f0c2){return db[_0x4d4f('0x4c')][_0x4d4f('0x51')]({'where':{'id':_0x1c764b[_0x4d4f('0x52')]['id']}})[_0x4d4f('0x2c')](handleEntityNotFound(_0x302cde,null))[_0x4d4f('0x2c')](function(_0x518252){if(_0x518252){return _0x518252[_0x4d4f('0x72')](_0x1c764b[_0x4d4f('0x56')][_0x4d4f('0x73')],_[_0x4d4f('0x74')](_0x1c764b['body'],['ids','id'])||{})[_0x4d4f('0x75')](function(_0x3c8a64){for(var _0x4736db=0x0;_0x4736db<_0x1c764b[_0x4d4f('0x56')][_0x4d4f('0x73')][_0x4d4f('0x6e')];_0x4736db+=0x1){socket[_0x4d4f('0x76')](_0x4d4f('0x77'),{'UserId':Number(_0x1c764b[_0x4d4f('0x56')][_0x4d4f('0x73')][_0x4736db]),'VoicePrefixId':Number(_0x1c764b['params']['id'])});}return _0x3c8a64;});}})[_0x4d4f('0x2c')](respondWithResult(_0x302cde,null))[_0x4d4f('0x4e')](handleError(_0x302cde,null));};exports[_0x4d4f('0x78')]=function(_0x2c8c79,_0x584c53,_0x5240be){return db['VoicePrefix'][_0x4d4f('0x51')]({'where':{'id':_0x2c8c79['params']['id']}})[_0x4d4f('0x2c')](handleEntityNotFound(_0x584c53,null))[_0x4d4f('0x2c')](function(_0xa63721){if(_0xa63721){return _0xa63721[_0x4d4f('0x78')](_0x2c8c79[_0x4d4f('0x3b')][_0x4d4f('0x73')])[_0x4d4f('0x2c')](function(){if(_[_0x4d4f('0x79')](_0x2c8c79['query']['ids'])){for(var _0x42c66c=0x0;_0x42c66c<_0x2c8c79['query'][_0x4d4f('0x73')][_0x4d4f('0x6e')];_0x42c66c+=0x1){socket[_0x4d4f('0x76')]('userVoicePrefix:remove',{'UserId':Number(_0x2c8c79['query']['ids'][_0x42c66c]),'VoicePrefixId':Number(_0x2c8c79[_0x4d4f('0x52')]['id'])});}}else{socket['emit'](_0x4d4f('0x7a'),{'UserId':Number(_0x2c8c79['query'][_0x4d4f('0x73')]),'VoicePrefixId':Number(_0x2c8c79[_0x4d4f('0x52')]['id'])});}});}})[_0x4d4f('0x2c')](respondWithStatusCode(_0x584c53,null))[_0x4d4f('0x4e')](handleError(_0x584c53,null));};exports[_0x4d4f('0x7b')]=function(_0x1670fd,_0x548709,_0x18274e){var _0x3beacf={};var _0x4691b7={};var _0x1f62e0;var _0x328528;return db['VoicePrefix'][_0x4d4f('0x7c')]({'where':{'id':_0x1670fd['params']['id']}})[_0x4d4f('0x2c')](handleEntityNotFound(_0x548709,null))[_0x4d4f('0x2c')](function(_0x2511c8){if(_0x2511c8){_0x1f62e0=_0x2511c8;_0x4691b7[_0x4d4f('0x3d')]=_[_0x4d4f('0x50')](db[_0x4d4f('0x7d')][_0x4d4f('0x36')]);_0x4691b7['query']=_[_0x4d4f('0x50')](_0x1670fd[_0x4d4f('0x3b')]);_0x4691b7[_0x4d4f('0x46')]=_['intersection'](_0x4691b7[_0x4d4f('0x3d')],_0x4691b7['query']);_0x3beacf[_0x4d4f('0x3e')]=_['intersection'](_0x4691b7[_0x4d4f('0x3d')],qs[_0x4d4f('0x3f')](_0x1670fd[_0x4d4f('0x3b')]['fields']));_0x3beacf[_0x4d4f('0x3e')]=_0x3beacf[_0x4d4f('0x3e')][_0x4d4f('0x6e')]?_0x3beacf[_0x4d4f('0x3e')]:_0x4691b7['model'];_0x3beacf[_0x4d4f('0x43')]=qs[_0x4d4f('0x44')](_0x1670fd['query'][_0x4d4f('0x44')]);_0x3beacf[_0x4d4f('0x45')]=qs[_0x4d4f('0x46')](_[_0x4d4f('0x7e')](_0x1670fd[_0x4d4f('0x3b')],_0x4691b7[_0x4d4f('0x46')]));if(_0x1670fd['query'][_0x4d4f('0x47')]){_0x3beacf[_0x4d4f('0x45')]=_['merge'](_0x3beacf[_0x4d4f('0x45')],{'$or':_[_0x4d4f('0x3a')](_0x3beacf[_0x4d4f('0x3e')],function(_0x4686b9){var _0x16d1f7={};_0x16d1f7[_0x4686b9]={'$like':'%'+_0x1670fd[_0x4d4f('0x3b')][_0x4d4f('0x47')]+'%'};return _0x16d1f7;})});}_0x3beacf=_[_0x4d4f('0x48')]({},_0x3beacf,_0x1670fd['options']);return _0x1f62e0[_0x4d4f('0x7b')](_0x3beacf);}})[_0x4d4f('0x2c')](function(_0x4dd3f6){if(_0x4dd3f6){_0x328528=_0x4dd3f6[_0x4d4f('0x6e')];if(!_0x1670fd['query'][_0x4d4f('0x40')]('nolimit')){_0x3beacf[_0x4d4f('0x26')]=qs[_0x4d4f('0x26')](_0x1670fd[_0x4d4f('0x3b')][_0x4d4f('0x26')]);_0x3beacf[_0x4d4f('0x42')]=qs[_0x4d4f('0x42')](_0x1670fd[_0x4d4f('0x3b')][_0x4d4f('0x42')]);}return _0x1f62e0[_0x4d4f('0x7b')](_0x3beacf);}})[_0x4d4f('0x2c')](function(_0x10f882){if(_0x10f882){return _0x10f882?{'count':_0x328528,'rows':_0x10f882}:null;}})[_0x4d4f('0x2c')](respondWithResult(_0x548709,null))['catch'](handleError(_0x548709,null));};exports['getTeams']=function(_0x41c81d,_0x5d6abf,_0x2208d8){var _0x2b096e={};var _0x4e6da6={};var _0x53817f;var _0x10955f;return db[_0x4d4f('0x4c')][_0x4d4f('0x7c')]({'where':{'id':_0x41c81d['params']['id']}})['then'](handleEntityNotFound(_0x5d6abf,null))[_0x4d4f('0x2c')](function(_0x274ff2){if(_0x274ff2){_0x53817f=_0x274ff2;_0x4e6da6[_0x4d4f('0x3d')]=_[_0x4d4f('0x50')](db['Team'][_0x4d4f('0x36')]);_0x4e6da6[_0x4d4f('0x3b')]=_[_0x4d4f('0x50')](_0x41c81d['query']);_0x4e6da6['filters']=_[_0x4d4f('0x3c')](_0x4e6da6[_0x4d4f('0x3d')],_0x4e6da6[_0x4d4f('0x3b')]);_0x2b096e[_0x4d4f('0x3e')]=_[_0x4d4f('0x3c')](_0x4e6da6['model'],qs[_0x4d4f('0x3f')](_0x41c81d[_0x4d4f('0x3b')][_0x4d4f('0x3f')]));_0x2b096e['attributes']=_0x2b096e[_0x4d4f('0x3e')]['length']?_0x2b096e[_0x4d4f('0x3e')]:_0x4e6da6[_0x4d4f('0x3d')];_0x2b096e[_0x4d4f('0x43')]=qs[_0x4d4f('0x44')](_0x41c81d[_0x4d4f('0x3b')]['sort']);_0x2b096e[_0x4d4f('0x45')]=qs[_0x4d4f('0x46')](_[_0x4d4f('0x7e')](_0x41c81d[_0x4d4f('0x3b')],_0x4e6da6['filters']));if(_0x41c81d[_0x4d4f('0x3b')]['filter']){_0x2b096e['where']=_[_0x4d4f('0x48')](_0x2b096e[_0x4d4f('0x45')],{'$or':_['map'](_0x2b096e[_0x4d4f('0x3e')],function(_0x50b0a3){var _0x1177a3={};_0x1177a3[_0x50b0a3]={'$like':'%'+_0x41c81d[_0x4d4f('0x3b')][_0x4d4f('0x47')]+'%'};return _0x1177a3;})});}_0x2b096e=_[_0x4d4f('0x48')]({},_0x2b096e,_0x41c81d[_0x4d4f('0x49')]);return _0x53817f[_0x4d4f('0x7f')](_0x2b096e);}})[_0x4d4f('0x2c')](function(_0x3fe348){if(_0x3fe348){_0x10955f=_0x3fe348['length'];if(!_0x41c81d[_0x4d4f('0x3b')][_0x4d4f('0x40')]('nolimit')){_0x2b096e[_0x4d4f('0x26')]=qs['limit'](_0x41c81d[_0x4d4f('0x3b')][_0x4d4f('0x26')]);_0x2b096e[_0x4d4f('0x42')]=qs['offset'](_0x41c81d['query']['offset']);}return _0x53817f[_0x4d4f('0x7f')](_0x2b096e);}})['then'](function(_0xb5d71b){if(_0xb5d71b){return _0xb5d71b?{'count':_0x10955f,'rows':_0xb5d71b}:null;}})[_0x4d4f('0x2c')](respondWithResult(_0x5d6abf,null))[_0x4d4f('0x4e')](handleError(_0x5d6abf,null));};exports['addTeams']=function(_0x5b6061,_0x230ff0,_0x28ae80){var _0x42be25=_0x5b6061[_0x4d4f('0x56')][_0x4d4f('0x73')];var _0x13279e;return db['Team'][_0x4d4f('0x80')]({'where':{'id':_0x42be25},'attributes':['id'],'include':[{'model':db[_0x4d4f('0x7d')],'as':_0x4d4f('0x81'),'attributes':['id',_0x4d4f('0x33'),_0x4d4f('0x82'),_0x4d4f('0x83'),_0x4d4f('0x84')],'raw':!![]}]})[_0x4d4f('0x2c')](function(_0x1a1e6f){if(_0x1a1e6f){_0x13279e=_0x1a1e6f;var _0x152400=_[_0x4d4f('0x85')](_0x1a1e6f,function(_0x3c6f1b){var _0x25e63c=_0x3c6f1b[_0x4d4f('0x2e')]({'plain':!![]});return _0x25e63c['Agents'];});return db[_0x4d4f('0x4c')][_0x4d4f('0x51')]({'where':{'id':_0x5b6061[_0x4d4f('0x52')]['id']}})[_0x4d4f('0x2c')](function(_0xc01ac4){return db[_0x4d4f('0x54')][_0x4d4f('0x86')](function(_0x472938){return _0xc01ac4[_0x4d4f('0x87')](_0x42be25,{'transaction':_0x472938})['then'](function(){return BPromise[_0x4d4f('0x88')](_0x13279e,function(_0x72d583){return db[_0x4d4f('0x89')][_0x4d4f('0x8a')]({'TeamId':_0x72d583['id'],'VoicePrefixId':_0x5b6061[_0x4d4f('0x52')]['id']},{'transaction':_0x472938});});})[_0x4d4f('0x2c')](function(){return BPromise[_0x4d4f('0x88')](_0x152400,function(_0x28fd35){return db[_0x4d4f('0x8b')][_0x4d4f('0x8c')]({'where':{'UserId':_0x28fd35['id'],'VoicePrefixId':_0x5b6061['params']['id']},'transaction':_0x472938});});})['then'](function(){_0x152400[_0x4d4f('0x8d')](function(_0x8850a4){socket['emit'](_0x4d4f('0x77'),{'UserId':_0x8850a4['id'],'VoicePrefixId':_0xc01ac4['id']});});});});});}})[_0x4d4f('0x2c')](respondWithStatusCode(_0x230ff0,null))[_0x4d4f('0x4e')](handleError(_0x230ff0,null));};exports[_0x4d4f('0x8e')]=function(_0x15028c,_0x1659f6,_0x77dac1){return db[_0x4d4f('0x8f')][_0x4d4f('0x80')]({'where':{'id':_0x15028c[_0x4d4f('0x3b')][_0x4d4f('0x73')]},'attributes':['id'],'include':[{'model':db[_0x4d4f('0x7d')],'as':_0x4d4f('0x81'),'attributes':['id'],'raw':!![]}]})[_0x4d4f('0x2c')](handleEntityNotFound(_0x1659f6,null))['then'](function(_0x342b63){var _0x524ed0=_[_0x4d4f('0x3a')](_0x342b63,'id');var _0x3fd499=[];var _0x17a39f=[];var _0x27b4d6=squel['select']();_0x27b4d6[_0x4d4f('0x90')](_0x4d4f('0x91'))[_0x4d4f('0x92')](_0x4d4f('0x93'),'tq')[_0x4d4f('0x94')](_0x4d4f('0x95'),'ut',_0x4d4f('0x96'))['where'](_0x4d4f('0x97'),_0x15028c[_0x4d4f('0x52')]['id']);for(var _0x2f4bad=0x0;_0x2f4bad<_0x342b63[_0x4d4f('0x6e')];_0x2f4bad+=0x1){let _0x4501b5=_0x342b63[_0x2f4bad];for(var _0x12eda1=0x0;_0x12eda1<_0x4501b5['Agents']['length'];_0x12eda1+=0x1){let _0x11ee76=_0x4501b5['Agents'][_0x12eda1];var _0x2ea6b4=_0x27b4d6[_0x4d4f('0x98')]();_0x2ea6b4['where'](_0x4d4f('0x99'),_0x11ee76['id']);_0x17a39f[_0x4d4f('0x68')](db[_0x4d4f('0x54')][_0x4d4f('0x3b')](_0x2ea6b4[_0x4d4f('0x9a')](),{'type':db[_0x4d4f('0x54')][_0x4d4f('0x9b')]['SELECT']})[_0x4d4f('0x2c')](function(_0x5d05cb){if(_0x5d05cb[_0x4d4f('0x6e')]===0x1){return _0x11ee76['id'];}else{var _0x2d1337=_['every'](_['map'](_0x5d05cb,_0x4d4f('0x9c')),function(_0x17894c){return _[_0x4d4f('0x9d')](_0x524ed0,_0x17894c);});if(_0x2d1337){return _0x11ee76['id'];}}}));}}return BPromise['all'](_0x17a39f)[_0x4d4f('0x2c')](function(_0x118642){_0x3fd499=_(_0x3fd499)[_0x4d4f('0x9e')](_0x118642)[_0x4d4f('0x9f')]()[_0x4d4f('0xa0')]();return db[_0x4d4f('0x4c')][_0x4d4f('0x51')]({'where':{'id':_0x15028c[_0x4d4f('0x52')]['id']}})[_0x4d4f('0x2c')](function(_0x51e70f){return db[_0x4d4f('0x54')][_0x4d4f('0x86')](function(_0x23485f){return _0x51e70f[_0x4d4f('0x8e')](_0x15028c['query'][_0x4d4f('0x73')],{'transaction':_0x23485f})['then'](function(){if(!_['isEmpty'](_0x3fd499)){return _0x51e70f[_0x4d4f('0x78')](_0x3fd499,{'transaction':_0x23485f});}})[_0x4d4f('0x2c')](function(){_0x3fd499[_0x4d4f('0x8d')](function(_0x3de9b3){socket[_0x4d4f('0x76')](_0x4d4f('0x7a'),{'UserId':_0x3de9b3,'VoicePrefixId':_0x51e70f['id']});});});});});});})[_0x4d4f('0x2c')](respondWithStatusCode(_0x1659f6,null))[_0x4d4f('0x4e')](handleError(_0x1659f6,null));}; \ No newline at end of file +var _0xbbbc=['filters','filter','merge','options','VoicePrefix','includeAll','include','findAll','rows','catch','show','params','find','describe','create','sequelize','transaction','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','VoicePrefixes','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','system','priority','NoOp','Voice\x20Prefix','VoicePrefixId','Extensions\x20creation\x20failed','prefix','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','context','${EXTEN:','charAt','system-','update','findById','addAgents','ids','omit','body','emit','userVoicePrefix:save','removeAgents','isArray','findOne','pick','getAgents','Team','getTeams','hasOwnProperty','addTeams','Agents','online','interface','flatMap','each','TeamVoicePrefix','findOrCreate','forEach','removeTeams','field','from','join','user_has_teams','VoicePrefixId\x20=\x20?','clone','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','userVoicePrefix:remove','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','get','UserProfileResource','destroy','status','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','where'];(function(_0x413ca7,_0x2795af){var _0x10baad=function(_0x3e5bdb){while(--_0x3e5bdb){_0x413ca7['push'](_0x413ca7['shift']());}};_0x10baad(++_0x2795af);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x68a9d4,_0x4dcea0){_0x68a9d4=_0x68a9d4-0x0;var _0x1ab9d9=_0xbbbc[_0x68a9d4];return _0x1ab9d9;};'use strict';var emlformat=require(_0xcbbb('0x0'));var rimraf=require(_0xcbbb('0x1'));var zipdir=require(_0xcbbb('0x2'));var jsonpatch=require(_0xcbbb('0x3'));var rp=require(_0xcbbb('0x4'));var moment=require(_0xcbbb('0x5'));var BPromise=require(_0xcbbb('0x6'));var Mustache=require('mustache');var util=require(_0xcbbb('0x7'));var path=require(_0xcbbb('0x8'));var sox=require(_0xcbbb('0x9'));var csv=require(_0xcbbb('0xa'));var ejs=require(_0xcbbb('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcbbb('0xc'));var squel=require(_0xcbbb('0xd'));var crypto=require(_0xcbbb('0xe'));var jsforce=require(_0xcbbb('0xf'));var deskjs=require(_0xcbbb('0x10'));var toCsv=require(_0xcbbb('0xa'));var querystring=require(_0xcbbb('0x11'));var Papa=require('papaparse');var Redis=require(_0xcbbb('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcbbb('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcbbb('0x14'))('api');var utils=require(_0xcbbb('0x15'));var config=require(_0xcbbb('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xcbbb('0x17'))['db'];config['redis']=_[_0xcbbb('0x18')](config['redis'],{'host':_0xcbbb('0x19'),'port':0x18eb});var socket=require(_0xcbbb('0x1a'))(new Redis(config[_0xcbbb('0x1b')]));require('./voicePrefix.socket')[_0xcbbb('0x1c')](socket);function respondWithStatusCode(_0x3ff767,_0x8a325c){_0x8a325c=_0x8a325c||0xcc;return function(_0x273e13){if(_0x273e13){return _0x3ff767['sendStatus'](_0x8a325c);}return _0x3ff767['status'](_0x8a325c)[_0xcbbb('0x1d')]();};}function respondWithResult(_0x30297d,_0xf76038){_0xf76038=_0xf76038||0xc8;return function(_0x188698){if(_0x188698){return _0x30297d['status'](_0xf76038)[_0xcbbb('0x1e')](_0x188698);}};}function respondWithFilteredResult(_0x4ff973,_0x1fbfb1){return function(_0x3436af){if(_0x3436af){var _0x3572bb=typeof _0x1fbfb1['offset']==='undefined'&&typeof _0x1fbfb1['limit']===_0xcbbb('0x1f');var _0x3ae91b=_0x3436af[_0xcbbb('0x20')];var _0x25e92f=_0x3572bb?0x0:_0x1fbfb1[_0xcbbb('0x21')];var _0x1cca90=_0x3572bb?_0x3436af[_0xcbbb('0x20')]:_0x1fbfb1[_0xcbbb('0x21')]+_0x1fbfb1[_0xcbbb('0x22')];var _0x2d4335;if(_0x1cca90>=_0x3ae91b){_0x1cca90=_0x3ae91b;_0x2d4335=0xc8;}else{_0x2d4335=0xce;}_0x4ff973['status'](_0x2d4335);return _0x4ff973[_0xcbbb('0x23')](_0xcbbb('0x24'),_0x25e92f+'-'+_0x1cca90+'/'+_0x3ae91b)[_0xcbbb('0x1e')](_0x3436af);}return null;};}function patchUpdates(_0x42aaf1){return function(_0x258d1f){try{jsonpatch[_0xcbbb('0x25')](_0x258d1f,_0x42aaf1,!![]);}catch(_0x297eae){return BPromise[_0xcbbb('0x26')](_0x297eae);}return _0x258d1f[_0xcbbb('0x27')]();};}function saveUpdates(_0x5e3970,_0xf39ddd){return function(_0x4490c1){if(_0x4490c1){return _0x4490c1['update'](_0x5e3970)[_0xcbbb('0x28')](function(_0x4ffa80){return _0x4ffa80;});}return null;};}function removeEntity(_0x48dfc4,_0x575d56){return function(_0x32e070){if(_0x32e070){return _0x32e070['destroy']()['then'](function(){var _0x5499a1=_0x32e070[_0xcbbb('0x29')]({'plain':!![]});var _0x55e1d8='VoicePrefixes';return db[_0xcbbb('0x2a')][_0xcbbb('0x2b')]({'where':{'type':_0x55e1d8,'resourceId':_0x5499a1['id']}})[_0xcbbb('0x28')](function(){return _0x32e070;});})[_0xcbbb('0x28')](function(){_0x48dfc4[_0xcbbb('0x2c')](0xcc)[_0xcbbb('0x1d')]();});}};}function handleEntityNotFound(_0x3d4c0d,_0x1c986d){return function(_0x2a023f){if(!_0x2a023f){_0x3d4c0d[_0xcbbb('0x2d')](0x194);}return _0x2a023f;};}function handleError(_0x1c2ac9,_0xeb8cd8){_0xeb8cd8=_0xeb8cd8||0x1f4;return function(_0xfa973b){logger[_0xcbbb('0x2e')](_0xfa973b[_0xcbbb('0x2f')]);if(_0xfa973b[_0xcbbb('0x30')]){delete _0xfa973b[_0xcbbb('0x30')];}_0x1c2ac9[_0xcbbb('0x2c')](_0xeb8cd8)['send'](_0xfa973b);};}exports[_0xcbbb('0x31')]=function(_0x203a34,_0x5332f9){var _0xec2761={},_0x539dcf={},_0x2d37d3={'count':0x0,'rows':[]};var _0x1fb05e=_[_0xcbbb('0x32')](db['VoicePrefix'][_0xcbbb('0x33')],function(_0xa4743b){return{'name':_0xa4743b[_0xcbbb('0x34')],'type':_0xa4743b[_0xcbbb('0x35')][_0xcbbb('0x36')]};});_0x539dcf[_0xcbbb('0x37')]=_[_0xcbbb('0x32')](_0x1fb05e,_0xcbbb('0x30'));_0x539dcf[_0xcbbb('0x38')]=_[_0xcbbb('0x39')](_0x203a34['query']);_0x539dcf['filters']=_['intersection'](_0x539dcf['model'],_0x539dcf[_0xcbbb('0x38')]);_0xec2761[_0xcbbb('0x3a')]=_[_0xcbbb('0x3b')](_0x539dcf[_0xcbbb('0x37')],qs[_0xcbbb('0x3c')](_0x203a34[_0xcbbb('0x38')][_0xcbbb('0x3c')]));_0xec2761[_0xcbbb('0x3a')]=_0xec2761[_0xcbbb('0x3a')][_0xcbbb('0x3d')]?_0xec2761[_0xcbbb('0x3a')]:_0x539dcf[_0xcbbb('0x37')];if(!_0x203a34['query']['hasOwnProperty'](_0xcbbb('0x3e'))){_0xec2761['limit']=qs['limit'](_0x203a34['query'][_0xcbbb('0x22')]);_0xec2761[_0xcbbb('0x21')]=qs[_0xcbbb('0x21')](_0x203a34[_0xcbbb('0x38')][_0xcbbb('0x21')]);}_0xec2761[_0xcbbb('0x3f')]=qs[_0xcbbb('0x40')](_0x203a34[_0xcbbb('0x38')][_0xcbbb('0x40')]);_0xec2761[_0xcbbb('0x41')]=qs[_0xcbbb('0x42')](_['pick'](_0x203a34[_0xcbbb('0x38')],_0x539dcf['filters']),_0x1fb05e);if(_0x203a34[_0xcbbb('0x38')][_0xcbbb('0x43')]){_0xec2761[_0xcbbb('0x41')]=_[_0xcbbb('0x44')](_0xec2761[_0xcbbb('0x41')],{'$or':_[_0xcbbb('0x32')](_0x1fb05e,function(_0x5651fd){if(_0x5651fd['type']!=='VIRTUAL'){var _0xda1973={};_0xda1973[_0x5651fd[_0xcbbb('0x30')]]={'$like':'%'+_0x203a34[_0xcbbb('0x38')][_0xcbbb('0x43')]+'%'};return _0xda1973;}})});}_0xec2761=_[_0xcbbb('0x44')]({},_0xec2761,_0x203a34[_0xcbbb('0x45')]);var _0x2b45ee={'where':_0xec2761['where']};return db[_0xcbbb('0x46')][_0xcbbb('0x20')](_0x2b45ee)['then'](function(_0x15b3bc){_0x2d37d3[_0xcbbb('0x20')]=_0x15b3bc;if(_0x203a34[_0xcbbb('0x38')][_0xcbbb('0x47')]){_0xec2761[_0xcbbb('0x48')]=[{'all':!![]}];}return db['VoicePrefix'][_0xcbbb('0x49')](_0xec2761);})['then'](function(_0x520448){_0x2d37d3[_0xcbbb('0x4a')]=_0x520448;return _0x2d37d3;})[_0xcbbb('0x28')](respondWithFilteredResult(_0x5332f9,_0xec2761))[_0xcbbb('0x4b')](handleError(_0x5332f9,null));};exports[_0xcbbb('0x4c')]=function(_0xb5391d,_0x406e1c){var _0x2040bf={'raw':![],'where':{'id':_0xb5391d[_0xcbbb('0x4d')]['id']}},_0x3ba75e={};_0x3ba75e[_0xcbbb('0x37')]=_[_0xcbbb('0x39')](db[_0xcbbb('0x46')][_0xcbbb('0x33')]);_0x3ba75e[_0xcbbb('0x38')]=_['keys'](_0xb5391d[_0xcbbb('0x38')]);_0x3ba75e[_0xcbbb('0x42')]=_[_0xcbbb('0x3b')](_0x3ba75e[_0xcbbb('0x37')],_0x3ba75e['query']);_0x2040bf['attributes']=_['intersection'](_0x3ba75e[_0xcbbb('0x37')],qs[_0xcbbb('0x3c')](_0xb5391d[_0xcbbb('0x38')][_0xcbbb('0x3c')]));_0x2040bf[_0xcbbb('0x3a')]=_0x2040bf[_0xcbbb('0x3a')][_0xcbbb('0x3d')]?_0x2040bf['attributes']:_0x3ba75e[_0xcbbb('0x37')];if(_0xb5391d[_0xcbbb('0x38')][_0xcbbb('0x47')]){_0x2040bf[_0xcbbb('0x48')]=[{'all':!![]}];}_0x2040bf=_['merge']({},_0x2040bf,_0xb5391d[_0xcbbb('0x45')]);return db[_0xcbbb('0x46')][_0xcbbb('0x4e')](_0x2040bf)[_0xcbbb('0x28')](handleEntityNotFound(_0x406e1c,null))['then'](respondWithResult(_0x406e1c,null))['catch'](handleError(_0x406e1c,null));};exports[_0xcbbb('0x2b')]=function(_0x421137,_0x3dc052){return db['VoicePrefix']['find']({'where':{'id':_0x421137['params']['id']}})[_0xcbbb('0x28')](handleEntityNotFound(_0x3dc052,null))[_0xcbbb('0x28')](removeEntity(_0x3dc052,null))['catch'](handleError(_0x3dc052,null));};exports[_0xcbbb('0x4f')]=function(_0x35bb94,_0x2dc313){return db[_0xcbbb('0x46')]['describe']()[_0xcbbb('0x28')](respondWithResult(_0x2dc313,null))[_0xcbbb('0x4b')](handleError(_0x2dc313,null));};exports[_0xcbbb('0x50')]=function(_0x3526f5,_0xb267da){var _0x3679f4;return db[_0xcbbb('0x51')][_0xcbbb('0x52')](function(_0x2d3990){return db[_0xcbbb('0x46')][_0xcbbb('0x50')](_0x3526f5['body'],{'transaction':_0x2d3990})['then'](function(_0x3fb0bd){_0x3679f4=_0x3fb0bd[_0xcbbb('0x29')]({'plain':!![]});return db[_0xcbbb('0x53')]['find']({'where':{'id':_0x3679f4[_0xcbbb('0x54')]},'raw':!![]})['then'](function(_0x2a9958){return createVoicePrefixExtensions(_0x3679f4,_0x2a9958,_0x2d3990);});});})[_0xcbbb('0x28')](function(){var _0x317633=_0x3526f5[_0xcbbb('0x55')][_0xcbbb('0x29')]({'plain':!![]});if(!_0x317633)throw new Error(_0xcbbb('0x56'));if(_0x317633['role']==='user'){var _0x4cc098=_0x3679f4;return db[_0xcbbb('0x57')][_0xcbbb('0x4e')]({'where':{'name':_0xcbbb('0x58'),'userProfileId':_0x317633[_0xcbbb('0x59')]},'raw':!![]})[_0xcbbb('0x28')](function(_0x30bc24){if(_0x30bc24&&_0x30bc24[_0xcbbb('0x5a')]===0x0){return db[_0xcbbb('0x2a')][_0xcbbb('0x50')]({'name':_0x4cc098[_0xcbbb('0x30')],'resourceId':_0x4cc098['id'],'type':_0x30bc24[_0xcbbb('0x30')],'sectionId':_0x30bc24['id']},{})[_0xcbbb('0x28')](function(){return _0x3679f4;});}else{return _0x3679f4;}})[_0xcbbb('0x4b')](function(_0x48d295){logger[_0xcbbb('0x2e')](_0xcbbb('0x5b'),_0x48d295);throw _0x48d295;});}return _0x3679f4;})[_0xcbbb('0x28')](respondWithResult(_0xb267da,null))['catch'](handleError(_0xb267da,null));};function Extension(_0x17d714,_0x1dbf9b,_0x5501d5,_0x26f0e6){this['context']=_0xcbbb('0x5c');this[_0xcbbb('0x5d')]=_0x17d714;this['app']=_0x5501d5;this[_0xcbbb('0x35')]=_0xcbbb('0x5e');this['description']='Voice\x20Prefix\x20Extension';this[_0xcbbb('0x5f')]=_0x1dbf9b;this['appdata']=_0x26f0e6;}function createVoicePrefixExtensions(_0x411bc6,_0x4c56fe,_0xb68922){return new BPromise(function(_0x3849d8,_0x20aaa9){var _0x4b4bb7=new Extension(formatPrefixName(_0x411bc6['prefix']),0x1,_0xcbbb('0x60'),_0xcbbb('0x61'));_0x4b4bb7['VoicePrefixId']=_0x411bc6['id'];return db[_0xcbbb('0x53')][_0xcbbb('0x50')](_0x4b4bb7,{'transaction':_0xb68922})[_0xcbbb('0x28')](function(_0x556e48){var _0xe347c6=_0x556e48[_0xcbbb('0x29')]({'plain':!![]});var _0x12ef00=_[_0xcbbb('0x32')](addVoicePrefixExtensions(_0x411bc6,_0x4c56fe),function(_0xf13e52){_0xf13e52[_0xcbbb('0x54')]=_0xe347c6['id'];_0xf13e52[_0xcbbb('0x62')]=_0x411bc6['id'];return _0xf13e52;});return db['VoiceExtension']['bulkCreate'](_0x12ef00,{'transaction':_0xb68922})[_0xcbbb('0x28')](function(_0x2469e5){if(!_0x2469e5){return _0x20aaa9(_0xcbbb('0x63'));}else{return _0x3849d8(_0x2469e5);}})[_0xcbbb('0x4b')](function(_0x4bc7cc){return _0x20aaa9(_0x4bc7cc);});});;});};function addVoicePrefixExtensions(_0x5c6bf7,_0x3781df){var _0x4f6529=[];var _0x5ea915=formatPrefixName(_0x5c6bf7[_0xcbbb('0x64')]);_0x4f6529[_0xcbbb('0x65')](new Extension(_0x5ea915,0x2,_0xcbbb('0x66'),_0xcbbb('0x67')+_0x5c6bf7[_0xcbbb('0x30')]));if(_0x5c6bf7[_0xcbbb('0x68')]){_0x4f6529[_0xcbbb('0x65')](new Extension(_0x5ea915,0x3,'Set',_0xcbbb('0x69')+_0x5c6bf7['callerIdAll']));}else{_0x4f6529[_0xcbbb('0x65')](new Extension(_0x5ea915,0x3,'NoOp',_0xcbbb('0x6a')));}_0x4f6529[_0xcbbb('0x65')](new Extension(_0x5ea915,0x4,_0xcbbb('0x6b'),_0x3781df[_0xcbbb('0x6c')]+','+_0xcbbb('0x6d')+(0x8+_0x5c6bf7[_0xcbbb('0x30')][_0xcbbb('0x3d')])+'}'+','+0x1));return _0x4f6529;}function formatPrefixName(_0x619340){var _0x4ff7db='_';for(var _0x57d776=0x0;_0x57d776<_0x619340[_0xcbbb('0x3d')];_0x57d776++){if(_0x619340[_0xcbbb('0x6e')](_0x57d776)=='-'){_0x4ff7db+=_0x619340[_0xcbbb('0x6e')](_0x57d776);}else{_0x4ff7db+='['+_0x619340[_0xcbbb('0x6e')](_0x57d776)+']';}}_0x4ff7db+='.';return _0x4ff7db;}exports['update']=function(_0x583c33,_0x590fc6,_0x6060d){var _0x2f0db8=_0x583c33['body'];_0x2f0db8[_0xcbbb('0x64')]=_0xcbbb('0x6f')+_0x2f0db8['name']+'-';return db[_0xcbbb('0x51')][_0xcbbb('0x52')](function(_0x4e2198){return db[_0xcbbb('0x46')][_0xcbbb('0x70')](_0x2f0db8,{'where':{'id':_0x2f0db8['id']},'transaction':_0x4e2198})[_0xcbbb('0x28')](function(){return db['VoiceExtension']['destroy']({'where':{'VoicePrefixId':_0x2f0db8['id']},'transaction':_0x4e2198})[_0xcbbb('0x28')](function(){return db[_0xcbbb('0x53')][_0xcbbb('0x4e')]({'where':{'id':_0x2f0db8['VoiceExtensionId']},'raw':!![]})['then'](function(_0x128d79){return createVoicePrefixExtensions(_0x2f0db8,_0x128d79,_0x4e2198);});});});})[_0xcbbb('0x28')](function(){return db[_0xcbbb('0x46')][_0xcbbb('0x71')](_0x2f0db8['id']);})[_0xcbbb('0x28')](respondWithResult(_0x590fc6,null))[_0xcbbb('0x4b')](handleError(_0x590fc6,null));};exports[_0xcbbb('0x72')]=function(_0x194b4b,_0x3e401d,_0x305344){return db[_0xcbbb('0x46')]['find']({'where':{'id':_0x194b4b[_0xcbbb('0x4d')]['id']}})[_0xcbbb('0x28')](handleEntityNotFound(_0x3e401d,null))[_0xcbbb('0x28')](function(_0x3ad059){if(_0x3ad059){return _0x3ad059[_0xcbbb('0x72')](_0x194b4b['body'][_0xcbbb('0x73')],_[_0xcbbb('0x74')](_0x194b4b[_0xcbbb('0x75')],[_0xcbbb('0x73'),'id'])||{})['spread'](function(_0x264c34){for(var _0x22de60=0x0;_0x22de60<_0x194b4b[_0xcbbb('0x75')]['ids']['length'];_0x22de60+=0x1){socket[_0xcbbb('0x76')](_0xcbbb('0x77'),{'UserId':Number(_0x194b4b[_0xcbbb('0x75')][_0xcbbb('0x73')][_0x22de60]),'VoicePrefixId':Number(_0x194b4b['params']['id'])});}return _0x264c34;});}})[_0xcbbb('0x28')](respondWithResult(_0x3e401d,null))[_0xcbbb('0x4b')](handleError(_0x3e401d,null));};exports[_0xcbbb('0x78')]=function(_0x349674,_0x42a9d3,_0x5706e6){return db['VoicePrefix'][_0xcbbb('0x4e')]({'where':{'id':_0x349674[_0xcbbb('0x4d')]['id']}})[_0xcbbb('0x28')](handleEntityNotFound(_0x42a9d3,null))[_0xcbbb('0x28')](function(_0x14eaec){if(_0x14eaec){return _0x14eaec[_0xcbbb('0x78')](_0x349674['query'][_0xcbbb('0x73')])[_0xcbbb('0x28')](function(){if(_[_0xcbbb('0x79')](_0x349674[_0xcbbb('0x38')][_0xcbbb('0x73')])){for(var _0x2b1277=0x0;_0x2b1277<_0x349674[_0xcbbb('0x38')]['ids']['length'];_0x2b1277+=0x1){socket[_0xcbbb('0x76')]('userVoicePrefix:remove',{'UserId':Number(_0x349674['query'][_0xcbbb('0x73')][_0x2b1277]),'VoicePrefixId':Number(_0x349674['params']['id'])});}}else{socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x349674[_0xcbbb('0x38')]['ids']),'VoicePrefixId':Number(_0x349674[_0xcbbb('0x4d')]['id'])});}});}})['then'](respondWithStatusCode(_0x42a9d3,null))['catch'](handleError(_0x42a9d3,null));};exports['getAgents']=function(_0x4de2dd,_0x1c9dd2,_0x14c60b){var _0x56b09b={};var _0x4bb903={};var _0x130f91;var _0x1bffe9;return db['VoicePrefix'][_0xcbbb('0x7a')]({'where':{'id':_0x4de2dd[_0xcbbb('0x4d')]['id']}})[_0xcbbb('0x28')](handleEntityNotFound(_0x1c9dd2,null))[_0xcbbb('0x28')](function(_0x24b949){if(_0x24b949){_0x130f91=_0x24b949;_0x4bb903[_0xcbbb('0x37')]=_[_0xcbbb('0x39')](db['User'][_0xcbbb('0x33')]);_0x4bb903[_0xcbbb('0x38')]=_['keys'](_0x4de2dd[_0xcbbb('0x38')]);_0x4bb903[_0xcbbb('0x42')]=_[_0xcbbb('0x3b')](_0x4bb903[_0xcbbb('0x37')],_0x4bb903[_0xcbbb('0x38')]);_0x56b09b[_0xcbbb('0x3a')]=_['intersection'](_0x4bb903['model'],qs[_0xcbbb('0x3c')](_0x4de2dd[_0xcbbb('0x38')][_0xcbbb('0x3c')]));_0x56b09b[_0xcbbb('0x3a')]=_0x56b09b[_0xcbbb('0x3a')]['length']?_0x56b09b[_0xcbbb('0x3a')]:_0x4bb903[_0xcbbb('0x37')];_0x56b09b[_0xcbbb('0x3f')]=qs[_0xcbbb('0x40')](_0x4de2dd[_0xcbbb('0x38')][_0xcbbb('0x40')]);_0x56b09b[_0xcbbb('0x41')]=qs[_0xcbbb('0x42')](_[_0xcbbb('0x7b')](_0x4de2dd[_0xcbbb('0x38')],_0x4bb903[_0xcbbb('0x42')]));if(_0x4de2dd['query']['filter']){_0x56b09b[_0xcbbb('0x41')]=_[_0xcbbb('0x44')](_0x56b09b[_0xcbbb('0x41')],{'$or':_[_0xcbbb('0x32')](_0x56b09b[_0xcbbb('0x3a')],function(_0x4a964b){var _0x1d7b6b={};_0x1d7b6b[_0x4a964b]={'$like':'%'+_0x4de2dd[_0xcbbb('0x38')]['filter']+'%'};return _0x1d7b6b;})});}_0x56b09b=_['merge']({},_0x56b09b,_0x4de2dd[_0xcbbb('0x45')]);return _0x130f91['getAgents'](_0x56b09b);}})[_0xcbbb('0x28')](function(_0x1a5dd3){if(_0x1a5dd3){_0x1bffe9=_0x1a5dd3[_0xcbbb('0x3d')];if(!_0x4de2dd[_0xcbbb('0x38')]['hasOwnProperty']('nolimit')){_0x56b09b[_0xcbbb('0x22')]=qs[_0xcbbb('0x22')](_0x4de2dd['query'][_0xcbbb('0x22')]);_0x56b09b[_0xcbbb('0x21')]=qs[_0xcbbb('0x21')](_0x4de2dd[_0xcbbb('0x38')][_0xcbbb('0x21')]);}return _0x130f91[_0xcbbb('0x7c')](_0x56b09b);}})[_0xcbbb('0x28')](function(_0x49f482){if(_0x49f482){return _0x49f482?{'count':_0x1bffe9,'rows':_0x49f482}:null;}})[_0xcbbb('0x28')](respondWithResult(_0x1c9dd2,null))[_0xcbbb('0x4b')](handleError(_0x1c9dd2,null));};exports['getTeams']=function(_0x10667e,_0x549d6c,_0x7a604f){var _0x10f932={};var _0x736484={};var _0x369b6f;var _0x4dc485;return db[_0xcbbb('0x46')][_0xcbbb('0x7a')]({'where':{'id':_0x10667e[_0xcbbb('0x4d')]['id']}})[_0xcbbb('0x28')](handleEntityNotFound(_0x549d6c,null))[_0xcbbb('0x28')](function(_0x4a5a59){if(_0x4a5a59){_0x369b6f=_0x4a5a59;_0x736484['model']=_[_0xcbbb('0x39')](db[_0xcbbb('0x7d')][_0xcbbb('0x33')]);_0x736484[_0xcbbb('0x38')]=_[_0xcbbb('0x39')](_0x10667e['query']);_0x736484['filters']=_[_0xcbbb('0x3b')](_0x736484[_0xcbbb('0x37')],_0x736484[_0xcbbb('0x38')]);_0x10f932[_0xcbbb('0x3a')]=_[_0xcbbb('0x3b')](_0x736484['model'],qs[_0xcbbb('0x3c')](_0x10667e[_0xcbbb('0x38')][_0xcbbb('0x3c')]));_0x10f932['attributes']=_0x10f932[_0xcbbb('0x3a')][_0xcbbb('0x3d')]?_0x10f932[_0xcbbb('0x3a')]:_0x736484[_0xcbbb('0x37')];_0x10f932[_0xcbbb('0x3f')]=qs[_0xcbbb('0x40')](_0x10667e[_0xcbbb('0x38')][_0xcbbb('0x40')]);_0x10f932['where']=qs[_0xcbbb('0x42')](_['pick'](_0x10667e['query'],_0x736484['filters']));if(_0x10667e[_0xcbbb('0x38')]['filter']){_0x10f932[_0xcbbb('0x41')]=_[_0xcbbb('0x44')](_0x10f932['where'],{'$or':_[_0xcbbb('0x32')](_0x10f932[_0xcbbb('0x3a')],function(_0x4bf0b3){var _0x4314d3={};_0x4314d3[_0x4bf0b3]={'$like':'%'+_0x10667e[_0xcbbb('0x38')][_0xcbbb('0x43')]+'%'};return _0x4314d3;})});}_0x10f932=_['merge']({},_0x10f932,_0x10667e[_0xcbbb('0x45')]);return _0x369b6f[_0xcbbb('0x7e')](_0x10f932);}})[_0xcbbb('0x28')](function(_0x2da472){if(_0x2da472){_0x4dc485=_0x2da472[_0xcbbb('0x3d')];if(!_0x10667e[_0xcbbb('0x38')][_0xcbbb('0x7f')](_0xcbbb('0x3e'))){_0x10f932[_0xcbbb('0x22')]=qs['limit'](_0x10667e[_0xcbbb('0x38')][_0xcbbb('0x22')]);_0x10f932[_0xcbbb('0x21')]=qs['offset'](_0x10667e['query'][_0xcbbb('0x21')]);}return _0x369b6f['getTeams'](_0x10f932);}})[_0xcbbb('0x28')](function(_0x198899){if(_0x198899){return _0x198899?{'count':_0x4dc485,'rows':_0x198899}:null;}})['then'](respondWithResult(_0x549d6c,null))[_0xcbbb('0x4b')](handleError(_0x549d6c,null));};exports[_0xcbbb('0x80')]=function(_0x59d833,_0x39951f,_0x283bc8){var _0x2754d1=_0x59d833[_0xcbbb('0x75')][_0xcbbb('0x73')];var _0x458b66;return db['Team'][_0xcbbb('0x49')]({'where':{'id':_0x2754d1},'attributes':['id'],'include':[{'model':db['User'],'as':_0xcbbb('0x81'),'attributes':['id',_0xcbbb('0x30'),_0xcbbb('0x82'),'voicePause',_0xcbbb('0x83')],'raw':!![]}]})['then'](function(_0x32993d){if(_0x32993d){_0x458b66=_0x32993d;var _0x962f3f=_[_0xcbbb('0x84')](_0x32993d,function(_0x55ca6b){var _0x287b25=_0x55ca6b['get']({'plain':!![]});return _0x287b25[_0xcbbb('0x81')];});return db[_0xcbbb('0x46')][_0xcbbb('0x4e')]({'where':{'id':_0x59d833[_0xcbbb('0x4d')]['id']}})['then'](function(_0x16991b){return db['sequelize'][_0xcbbb('0x52')](function(_0xd01dff){return _0x16991b[_0xcbbb('0x80')](_0x2754d1,{'transaction':_0xd01dff})[_0xcbbb('0x28')](function(){return BPromise[_0xcbbb('0x85')](_0x458b66,function(_0x3ab011){return db[_0xcbbb('0x86')]['upsert']({'TeamId':_0x3ab011['id'],'VoicePrefixId':_0x59d833[_0xcbbb('0x4d')]['id']},{'transaction':_0xd01dff});});})[_0xcbbb('0x28')](function(){return BPromise[_0xcbbb('0x85')](_0x962f3f,function(_0x354314){return db['UserVoicePrefix'][_0xcbbb('0x87')]({'where':{'UserId':_0x354314['id'],'VoicePrefixId':_0x59d833[_0xcbbb('0x4d')]['id']},'transaction':_0xd01dff});});})[_0xcbbb('0x28')](function(){_0x962f3f[_0xcbbb('0x88')](function(_0x3fc8da){socket[_0xcbbb('0x76')]('userVoicePrefix:save',{'UserId':_0x3fc8da['id'],'VoicePrefixId':_0x16991b['id']});});});});});}})[_0xcbbb('0x28')](respondWithStatusCode(_0x39951f,null))[_0xcbbb('0x4b')](handleError(_0x39951f,null));};exports[_0xcbbb('0x89')]=function(_0x23bda8,_0x233c44,_0x26545e){return db[_0xcbbb('0x7d')][_0xcbbb('0x49')]({'where':{'id':_0x23bda8['query'][_0xcbbb('0x73')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xcbbb('0x81'),'attributes':['id'],'raw':!![]}]})[_0xcbbb('0x28')](handleEntityNotFound(_0x233c44,null))[_0xcbbb('0x28')](function(_0x510bc9){var _0x1ce1c4=_[_0xcbbb('0x32')](_0x510bc9,'id');var _0x7fc4ea=[];var _0xde4f2b=[];var _0xabe61=squel['select']();_0xabe61[_0xcbbb('0x8a')]('tq.TeamId')[_0xcbbb('0x8b')]('team_has_voice_prefixes','tq')[_0xcbbb('0x8c')](_0xcbbb('0x8d'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xcbbb('0x41')](_0xcbbb('0x8e'),_0x23bda8[_0xcbbb('0x4d')]['id']);for(var _0x3a3e73=0x0;_0x3a3e73<_0x510bc9[_0xcbbb('0x3d')];_0x3a3e73+=0x1){let _0x517af0=_0x510bc9[_0x3a3e73];for(var _0x4312c3=0x0;_0x4312c3<_0x517af0[_0xcbbb('0x81')][_0xcbbb('0x3d')];_0x4312c3+=0x1){let _0x1b34ac=_0x517af0[_0xcbbb('0x81')][_0x4312c3];var _0x402d10=_0xabe61[_0xcbbb('0x8f')]();_0x402d10[_0xcbbb('0x41')]('ut.UserId\x20=\x20?',_0x1b34ac['id']);_0xde4f2b['push'](db[_0xcbbb('0x51')]['query'](_0x402d10[_0xcbbb('0x90')](),{'type':db[_0xcbbb('0x51')][_0xcbbb('0x91')][_0xcbbb('0x92')]})[_0xcbbb('0x28')](function(_0x2129d8){if(_0x2129d8[_0xcbbb('0x3d')]===0x1){return _0x1b34ac['id'];}else{var _0x274e33=_[_0xcbbb('0x93')](_[_0xcbbb('0x32')](_0x2129d8,_0xcbbb('0x94')),function(_0x1c8981){return _[_0xcbbb('0x95')](_0x1ce1c4,_0x1c8981);});if(_0x274e33){return _0x1b34ac['id'];}}}));}}return BPromise[_0xcbbb('0x96')](_0xde4f2b)[_0xcbbb('0x28')](function(_0x4bcb5d){_0x7fc4ea=_(_0x7fc4ea)[_0xcbbb('0x97')](_0x4bcb5d)[_0xcbbb('0x98')]()[_0xcbbb('0x99')]();return db[_0xcbbb('0x46')]['find']({'where':{'id':_0x23bda8[_0xcbbb('0x4d')]['id']}})[_0xcbbb('0x28')](function(_0x40fc06){return db[_0xcbbb('0x51')][_0xcbbb('0x52')](function(_0x357810){return _0x40fc06['removeTeams'](_0x23bda8[_0xcbbb('0x38')][_0xcbbb('0x73')],{'transaction':_0x357810})['then'](function(){if(!_[_0xcbbb('0x9a')](_0x7fc4ea)){return _0x40fc06[_0xcbbb('0x78')](_0x7fc4ea,{'transaction':_0x357810});}})[_0xcbbb('0x28')](function(){_0x7fc4ea[_0xcbbb('0x88')](function(_0x49e6e1){socket['emit'](_0xcbbb('0x9b'),{'UserId':_0x49e6e1,'VoicePrefixId':_0x40fc06['id']});});});});});});})[_0xcbbb('0x28')](respondWithStatusCode(_0x233c44,null))[_0xcbbb('0x4b')](handleError(_0x233c44,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 3362f6a..4220a73 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 _0xebc6=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','VoicePrefix'];(function(_0x2f7802,_0x29a4a3){var _0x29b223=function(_0x341e3b){while(--_0x341e3b){_0x2f7802['push'](_0x2f7802['shift']());}};_0x29b223(++_0x29a4a3);}(_0xebc6,0x154));var _0x6ebc=function(_0x3dc2f1,_0xcdc605){_0x3dc2f1=_0x3dc2f1-0x0;var _0x5f2730=_0xebc6[_0x3dc2f1];return _0x5f2730;};'use strict';var EventEmitter=require(_0x6ebc('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0x6ebc('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x6ebc('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6ebc('0x3'),'afterDestroy':_0x6ebc('0x4')};function emitEvent(_0x53be83){return function(_0x5a761b,_0x3ad4ed,_0x1d0223){VoicePrefixEvents[_0x6ebc('0x5')](_0x53be83+':'+_0x5a761b['id'],_0x5a761b);VoicePrefixEvents[_0x6ebc('0x5')](_0x53be83,_0x5a761b);_0x1d0223(null);};}for(var e in events){if(events[_0x6ebc('0x6')](e)){var event=events[e];VoicePrefix[_0x6ebc('0x7')](e,emitEvent(event));}}module[_0x6ebc('0x8')]=VoicePrefixEvents; \ No newline at end of file +var _0xb623=['../../mysqldb','VoicePrefix','setMaxListeners','save','emit','hook','exports'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0xb623,0x150));var _0x3b62=function(_0x54bd44,_0x21e8c2){_0x54bd44=_0x54bd44-0x0;var _0x22bb8a=_0xb623[_0x54bd44];return _0x22bb8a;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x3b62('0x0'))['db'][_0x3b62('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x3b62('0x2')](0x0);var events={'afterCreate':_0x3b62('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x44583b){return function(_0xcfdc73,_0x586ef9,_0x30c26b){VoicePrefixEvents[_0x3b62('0x4')](_0x44583b+':'+_0xcfdc73['id'],_0xcfdc73);VoicePrefixEvents[_0x3b62('0x4')](_0x44583b,_0xcfdc73);_0x30c26b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x3b62('0x5')](e,emitEvent(event));}}module[_0x3b62('0x6')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 5218cc0..854291c 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 _0xf299=['../../config/environment','exports','VoicePrefix','voice_prefixes','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x29225c,_0x27b57d){var _0x431ff0=function(_0x5c84d4){while(--_0x5c84d4){_0x29225c['push'](_0x29225c['shift']());}};_0x431ff0(++_0x27b57d);}(_0xf299,0xd6));var _0x9f29=function(_0x659037,_0x1a3604){_0x659037=_0x659037-0x0;var _0x255cc7=_0xf299[_0x659037];return _0x255cc7;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x9f29('0x0'));var moment=require(_0x9f29('0x1'));var BPromise=require(_0x9f29('0x2'));var rp=require(_0x9f29('0x3'));var fs=require('fs');var path=require(_0x9f29('0x4'));var rimraf=require(_0x9f29('0x5'));var config=require(_0x9f29('0x6'));var attributes=require('./voicePrefix.attributes');module[_0x9f29('0x7')]=function(_0x5f0d06,_0xb2e68f){return _0x5f0d06['define'](_0x9f29('0x8'),attributes,{'tableName':_0x9f29('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8843=['define','VoicePrefix','voice_prefixes','util','moment','bluebird','request-promise','path','./voicePrefix.attributes'];(function(_0x14ccc4,_0x20697c){var _0x44c97a=function(_0xe3a09e){while(--_0xe3a09e){_0x14ccc4['push'](_0x14ccc4['shift']());}};_0x44c97a(++_0x20697c);}(_0x8843,0x66));var _0x3884=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x8843[_0x53ccf2];return _0x5a2964;};'use strict';var _=require('lodash');var util=require(_0x3884('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x3884('0x1'));var BPromise=require(_0x3884('0x2'));var rp=require(_0x3884('0x3'));var fs=require('fs');var path=require(_0x3884('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3884('0x5'));module['exports']=function(_0x8c4c71,_0x41bb27){return _0x8c4c71[_0x3884('0x6')](_0x3884('0x7'),attributes,{'tableName':_0x3884('0x8'),'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 f39184e..9e90210 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 _0x8411=['../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2dd0a0,_0x4bd847){var _0x7f9dc4=function(_0x5b7f9f){while(--_0x5b7f9f){_0x2dd0a0['push'](_0x2dd0a0['shift']());}};_0x7f9dc4(++_0x4bd847);}(_0x8411,0x118));var _0x1841=function(_0x376706,_0x1a7144){_0x376706=_0x376706-0x0;var _0x3492fc=_0x8411[_0x376706];return _0x3492fc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1841('0x0'));var BPromise=require(_0x1841('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1841('0x2'))['db'];var utils=require(_0x1841('0x3'));var logger=require(_0x1841('0x4'))(_0x1841('0x5'));var config=require(_0x1841('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1841('0x7')]['http']({'port':0x232a});config[_0x1841('0x8')]=_[_0x1841('0x9')](config[_0x1841('0x8')],{'host':_0x1841('0xa'),'port':0x18eb});var socket=require(_0x1841('0xb'))(new Redis(config[_0x1841('0x8')]));require(_0x1841('0xc'))[_0x1841('0xd')](socket);function respondWithRpcPromise(_0x1d967f,_0x4218ae,_0x108644){return new BPromise(function(_0x1ae8b8,_0x1a3293){return client[_0x1841('0xe')](_0x1d967f,_0x108644)[_0x1841('0xf')](function(_0xf4b1b2){logger[_0x1841('0x10')](_0x1841('0x11'),_0x4218ae,_0x1841('0x12'));logger['debug'](_0x1841('0x13'),_0x4218ae,_0x1841('0x12'),JSON[_0x1841('0x14')](_0xf4b1b2));if(_0xf4b1b2['error']){if(_0xf4b1b2['error'][_0x1841('0x15')]===0x1f4){logger[_0x1841('0x16')]('VoicePrefix,\x20%s,\x20%s',_0x4218ae,_0xf4b1b2[_0x1841('0x16')][_0x1841('0x17')]);return _0x1a3293(_0xf4b1b2[_0x1841('0x16')][_0x1841('0x17')]);}logger[_0x1841('0x16')](_0x1841('0x11'),_0x4218ae,_0xf4b1b2['error'][_0x1841('0x17')]);return _0x1ae8b8(_0xf4b1b2[_0x1841('0x16')][_0x1841('0x17')]);}else{logger[_0x1841('0x10')](_0x1841('0x11'),_0x4218ae,_0x1841('0x12'));_0x1ae8b8(_0xf4b1b2[_0x1841('0x18')][_0x1841('0x17')]);}})[_0x1841('0x19')](function(_0x41c7ef){logger[_0x1841('0x16')](_0x1841('0x11'),_0x4218ae,_0x41c7ef);_0x1a3293(_0x41c7ef);});});} \ No newline at end of file +var _0x02ca=['then','info','VoicePrefix,\x20%s,\x20%s','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./voicePrefix.socket','register'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x02ca,0x97));var _0xa02c=function(_0xa56ecb,_0x562646){_0xa56ecb=_0xa56ecb-0x0;var _0x20fb31=_0x02ca[_0xa56ecb];return _0x20fb31;};'use strict';var _=require(_0xa02c('0x0'));var util=require('util');var moment=require(_0xa02c('0x1'));var BPromise=require(_0xa02c('0x2'));var rs=require(_0xa02c('0x3'));var fs=require('fs');var Redis=require(_0xa02c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa02c('0x5'));var logger=require(_0xa02c('0x6'))(_0xa02c('0x7'));var config=require(_0xa02c('0x8'));var jayson=require(_0xa02c('0x9'));var client=jayson[_0xa02c('0xa')][_0xa02c('0xb')]({'port':0x232a});config[_0xa02c('0xc')]=_[_0xa02c('0xd')](config[_0xa02c('0xc')],{'host':_0xa02c('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa02c('0xc')]));require(_0xa02c('0xf'))[_0xa02c('0x10')](socket);function respondWithRpcPromise(_0x30e1aa,_0x14ffc2,_0x565373){return new BPromise(function(_0x5c553f,_0x50df17){return client['request'](_0x30e1aa,_0x565373)[_0xa02c('0x11')](function(_0x14c96f){logger[_0xa02c('0x12')](_0xa02c('0x13'),_0x14ffc2,'request\x20sent');logger[_0xa02c('0x14')](_0xa02c('0x15'),_0x14ffc2,_0xa02c('0x16'),JSON[_0xa02c('0x17')](_0x14c96f));if(_0x14c96f['error']){if(_0x14c96f[_0xa02c('0x18')][_0xa02c('0x19')]===0x1f4){logger[_0xa02c('0x18')]('VoicePrefix,\x20%s,\x20%s',_0x14ffc2,_0x14c96f[_0xa02c('0x18')][_0xa02c('0x1a')]);return _0x50df17(_0x14c96f['error'][_0xa02c('0x1a')]);}logger[_0xa02c('0x18')]('VoicePrefix,\x20%s,\x20%s',_0x14ffc2,_0x14c96f[_0xa02c('0x18')][_0xa02c('0x1a')]);return _0x5c553f(_0x14c96f[_0xa02c('0x18')]['message']);}else{logger[_0xa02c('0x12')]('VoicePrefix,\x20%s,\x20%s',_0x14ffc2,'request\x20sent');_0x5c553f(_0x14c96f['result'][_0xa02c('0x1a')]);}})[_0xa02c('0x1b')](function(_0x16ac46){logger['error'](_0xa02c('0x13'),_0x14ffc2,_0x16ac46);_0x50df17(_0x16ac46);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 4c492dc..687c9c8 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 _0x8f7d=['./voicePrefix.events','save','update','removeListener','register','length','voicePrefix:'];(function(_0x2eebfa,_0x2b23fd){var _0xdb8044=function(_0x3f11e0){while(--_0x3f11e0){_0x2eebfa['push'](_0x2eebfa['shift']());}};_0xdb8044(++_0x2b23fd);}(_0x8f7d,0xf5));var _0xd8f7=function(_0x4022e8,_0xebb8a3){_0x4022e8=_0x4022e8-0x0;var _0x565f9f=_0x8f7d[_0x4022e8];return _0x565f9f;};'use strict';var VoicePrefixEvents=require(_0xd8f7('0x0'));var events=[_0xd8f7('0x1'),'remove',_0xd8f7('0x2')];function createListener(_0x4a4401,_0x52384d){return function(_0x2600d2){_0x52384d['emit'](_0x4a4401,_0x2600d2);};}function removeListener(_0x9558b6,_0x338be3){return function(){VoicePrefixEvents[_0xd8f7('0x3')](_0x9558b6,_0x338be3);};}exports[_0xd8f7('0x4')]=function(_0x524a2e){for(var _0x4090c9=0x0,_0x2907df=events[_0xd8f7('0x5')];_0x4090c9<_0x2907df;_0x4090c9++){var _0xeaa837=events[_0x4090c9];var _0xa61f07=createListener(_0xd8f7('0x6')+_0xeaa837,_0x524a2e);VoicePrefixEvents['on'](_0xeaa837,_0xa61f07);}}; \ No newline at end of file +var _0xb903=['update','emit','removeListener','register','voicePrefix:','./voicePrefix.events','save','remove'];(function(_0x1793de,_0x4d7233){var _0x4f0309=function(_0x229ee7){while(--_0x229ee7){_0x1793de['push'](_0x1793de['shift']());}};_0x4f0309(++_0x4d7233);}(_0xb903,0x185));var _0x3b90=function(_0x19d021,_0x306470){_0x19d021=_0x19d021-0x0;var _0x12d97d=_0xb903[_0x19d021];return _0x12d97d;};'use strict';var VoicePrefixEvents=require(_0x3b90('0x0'));var events=[_0x3b90('0x1'),_0x3b90('0x2'),_0x3b90('0x3')];function createListener(_0x5191d8,_0x3312ca){return function(_0xf414f4){_0x3312ca[_0x3b90('0x4')](_0x5191d8,_0xf414f4);};}function removeListener(_0x1cd5d8,_0x30d8db){return function(){VoicePrefixEvents[_0x3b90('0x5')](_0x1cd5d8,_0x30d8db);};}exports[_0x3b90('0x6')]=function(_0x5acd76){for(var _0x15b68f=0x0,_0x5e845a=events['length'];_0x15b68f<_0x5e845a;_0x15b68f++){var _0x153283=events[_0x15b68f];var _0x2e4c06=createListener(_0x3b90('0x7')+_0x153283,_0x5acd76);VoicePrefixEvents['on'](_0x153283,_0x2e4c06);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 3e32a6f..e2f4799 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(_0x4d9bb2,_0x3db50d){var _0x3179fe=function(_0x5272f3){while(--_0x5272f3){_0x4d9bb2['push'](_0x4d9bb2['shift']());}};_0x3179fe(++_0x3db50d);}(_0xb10b,0x12a));var _0xbb10=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0xb10b[_0x2aecb2];return _0x3ebb80;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file +var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x391699,_0x34c62e){var _0x2cc4b7=function(_0xb14297){while(--_0xb14297){_0x391699['push'](_0x391699['shift']());}};_0x2cc4b7(++_0x34c62e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 6c0f83a..661b498 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 _0x18c2=['setDataValue','strategy','type','dialMethod','preview','booked','roundrobin','includes','INTEGER','yes','once','TEXT','join','getDataValue','periodic_announce','split','joinempty','leavewhenempty','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','power','predictive','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','name','ENUM','inbound','outbound','default','leastrecent','fewestcalls','random','rrmemory','rrordered'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x18c2,0x17f));var _0x218c=function(_0x369b12,_0xbb2f76){_0x369b12=_0x369b12-0x0;var _0x564fc2=_0x18c2[_0x369b12];return _0x564fc2;};'use strict';var Sequelize=require(_0x218c('0x0'));module['exports']={'name':{'type':Sequelize[_0x218c('0x1')],'allowNull':![],'unique':_0x218c('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x218c('0x3')](_0x218c('0x4'),_0x218c('0x5')),'allowNull':![],'defaultValue':_0x218c('0x4')},'musiconhold':{'type':Sequelize[_0x218c('0x1')],'defaultValue':_0x218c('0x6')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x218c('0x3')]('rr','ringall',_0x218c('0x7'),_0x218c('0x8'),_0x218c('0x9'),_0x218c('0xa'),'linear','wrandom',_0x218c('0xb')),'allowNull':![],'defaultValue':'ringall','set':function(_0x32aa85){this[_0x218c('0xc')](_0x218c('0xd'),_0x32aa85?_0x32aa85:_0x218c('0xa'));},'get':function(){var _0x4590dd=this['getDataValue'](_0x218c('0xe'));var _0x2f2921=this['getDataValue'](_0x218c('0xf'));var _0x4325f2=this['getDataValue'](_0x218c('0xd'));if(_0x4590dd===_0x218c('0x5')){if(_0x2f2921===_0x218c('0x10')){return null;}if(_0x2f2921===_0x218c('0x11')&&!['rrmemory',_0x218c('0x12')][_0x218c('0x13')](_0x4325f2)){this[_0x218c('0xc')](_0x218c('0xd'),_0x218c('0xa'));}}return _0x4325f2;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x218c('0x14')](0xb)},'timeout':{'type':Sequelize[_0x218c('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x218c('0x3')](_0x218c('0x15'),'no'),'defaultValue':_0x218c('0x15')},'autopause':{'type':Sequelize[_0x218c('0x3')](_0x218c('0x15'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x218c('0x14')](0xb)},'autopausebusy':{'type':Sequelize[_0x218c('0x3')](_0x218c('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x218c('0x3')](_0x218c('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x218c('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x218c('0x3')](_0x218c('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x218c('0x3')](_0x218c('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x218c('0x3')](_0x218c('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x218c('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x218c('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x218c('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x218c('0x3')](_0x218c('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x218c('0x15'),'no'),'defaultValue':_0x218c('0x15')},'announce_holdtime':{'type':Sequelize[_0x218c('0x3')](_0x218c('0x15'),'no',_0x218c('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x218c('0x3')]('yes','no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x218c('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x218c('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x218c('0x1')]},'queue_youarenext':{'type':Sequelize[_0x218c('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x218c('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x218c('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x218c('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x218c('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x218c('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x218c('0x1')]},'queue_quantity1':{'type':Sequelize[_0x218c('0x1')]},'queue_quantity2':{'type':Sequelize[_0x218c('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0x218c('0x1')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0x218c('0x17')],'set':function(_0x3e9252){this['setDataValue']('periodic_announce',_0x3e9252?_0x3e9252[_0x218c('0x18')](','):[]);},'get':function(){return this[_0x218c('0x19')]('periodic_announce')?this[_0x218c('0x19')](_0x218c('0x1a'))[_0x218c('0x1b')](','):[];}},'joinempty':{'type':Sequelize[_0x218c('0x1')],'defaultValue':'yes','set':function(_0x5d7f5a){this['setDataValue'](_0x218c('0x1c'),_0x5d7f5a?_0x5d7f5a[_0x218c('0x18')](','):undefined);},'get':function(){return this['getDataValue'](_0x218c('0x1c'))?this[_0x218c('0x19')]('joinempty')[_0x218c('0x1b')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x218c('0x1')],'defaultValue':'no','set':function(_0x3d7c1b){this[_0x218c('0xc')](_0x218c('0x1d'),_0x3d7c1b?_0x3d7c1b[_0x218c('0x18')](','):undefined);},'get':function(){return this[_0x218c('0x19')](_0x218c('0x1d'))?this[_0x218c('0x19')](_0x218c('0x1d'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x218c('0x3')](_0x218c('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x218c('0x3')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x218c('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x218c('0x3')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x218c('0x1')]},'description':{'type':Sequelize[_0x218c('0x1')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x2e3b99){this[_0x218c('0xc')]('acw',_0x2e3b99);if(_0x2e3b99){if(this[_0x218c('0x19')](_0x218c('0x1e'))<0x2){this[_0x218c('0xc')](_0x218c('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x218c('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x218c('0x1f')],'defaultValue':0x0,'comment':_0x218c('0x20')},'dialMethod':{'type':Sequelize[_0x218c('0x3')]('preview','progressive',_0x218c('0x21'),_0x218c('0x22'),_0x218c('0x11')),'defaultValue':_0x218c('0x23'),'comment':_0x218c('0x24')},'dialLimitChannel':{'type':Sequelize[_0x218c('0x14')](0x4)[_0x218c('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x218c('0x26')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x218c('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x218c('0x27')](0x2)[_0x218c('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x218c('0x28')},'dialPredictiveOptimization':{'type':Sequelize[_0x218c('0x3')](_0x218c('0x29'),_0x218c('0x2a')),'defaultValue':_0x218c('0x2a'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0x218c('0x14')](0x3)[_0x218c('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x218c('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x218c('0x14')](0x3)[_0x218c('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x218c('0x2c')},'dialQueueOptions':{'type':Sequelize[_0x218c('0x1')],'defaultValue':_0x218c('0x2d'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0x218c('0x14')](0x3)[_0x218c('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x218c('0x2e')},'dialQueueProject':{'type':Sequelize[_0x218c('0x1')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x218c('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x218c('0x2f')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x218c('0x14')](0x5)[_0x218c('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x218c('0x30')},'dialBusyMaxRetry':{'type':Sequelize[_0x218c('0x14')](0x3)[_0x218c('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x218c('0x14')](0x5)[_0x218c('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x218c('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x218c('0x25')],'defaultValue':0x3,'comment':_0x218c('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x218c('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x218c('0x14')](0x3)[_0x218c('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x218c('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x218c('0x1')],'defaultValue':_0x218c('0x33')},'dialPrefix':{'type':Sequelize[_0x218c('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x218c('0x3')]('always',_0x218c('0x34'),_0x218c('0x35')),'defaultValue':_0x218c('0x36')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x218c('0x37')},'dialAMDInitialSilence':{'type':Sequelize[_0x218c('0x14')](0x9)[_0x218c('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x218c('0x14')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x218c('0x38')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x218c('0x14')](0x9)[_0x218c('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x218c('0x39')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x218c('0x14')](0x9)[_0x218c('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x218c('0x3a')},'dialAMDMinWordLength':{'type':Sequelize[_0x218c('0x14')](0x9)[_0x218c('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x218c('0x3b')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x218c('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x218c('0x3c')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x218c('0x14')](0x9)[_0x218c('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x218c('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x218c('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x218c('0x14')](0x9)[_0x218c('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0x218c('0x14')](0x5)[_0x218c('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x218c('0x3e')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x218c('0x3f')},'dialOrderByScheduledAt':{'type':Sequelize[_0x218c('0x3')]('DESC',_0x218c('0x40')),'defaultValue':_0x218c('0x41')},'dialQueueProject2':{'type':Sequelize[_0x218c('0x1')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x218c('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x218c('0x14')](0x3)[_0x218c('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x218c('0x42')},'dialCutDigit':{'type':Sequelize[_0x218c('0x14')](0x3)[_0x218c('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x218c('0x43')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x218c('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x218c('0x44')},'dialDropMaxRetry':{'type':Sequelize[_0x218c('0x14')](0x3)[_0x218c('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x218c('0x45')},'dialDropRetryFrequency':{'type':Sequelize[_0x218c('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x218c('0x14')](0x3)[_0x218c('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x218c('0x46')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x218c('0x14')](0x5)[_0x218c('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x218c('0x47')},'dialMachineMaxRetry':{'type':Sequelize[_0x218c('0x14')](0x3)[_0x218c('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x218c('0x48')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x218c('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x218c('0x49')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x218c('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x218c('0x4a')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x218c('0x14')](0x5)[_0x218c('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x218c('0x4b')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x218c('0x14')],'allowNull':!![],'comment':_0x218c('0x4c')},'mandatoryDisposition':{'type':Sequelize[_0x218c('0x1f')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x516980){if(!_0x516980)this['setDataValue'](_0x218c('0x4d'),null);this[_0x218c('0xc')](_0x218c('0x4e'),_0x516980);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x218c('0x14')](0x3)[_0x218c('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x218c('0x14')](0x3)[_0x218c('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x218c('0x1f')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize['INTEGER'](0x3)[_0x218c('0x25')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x4ea0=['all','once','TEXT','join','periodic_announce','joinempty','leavewhenempty','split','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','progressive','power','predictive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','DESC','ASC','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','inbound','outbound','default','ringall','fewestcalls','rrmemory','linear','wrandom','rrordered','strategy','getDataValue','booked','roundrobin','setDataValue','INTEGER','yes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4ea0,0x1d2));var _0x04ea=function(_0x2867d8,_0xef3ee0){_0x2867d8=_0x2867d8-0x0;var _0x3b8176=_0x4ea0[_0x2867d8];return _0x3b8176;};'use strict';var Sequelize=require(_0x04ea('0x0'));module[_0x04ea('0x1')]={'name':{'type':Sequelize[_0x04ea('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x04ea('0x3')](_0x04ea('0x4'),_0x04ea('0x5')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x04ea('0x2')],'defaultValue':_0x04ea('0x6')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x04ea('0x3')]('rr',_0x04ea('0x7'),'leastrecent',_0x04ea('0x8'),'random',_0x04ea('0x9'),_0x04ea('0xa'),_0x04ea('0xb'),_0x04ea('0xc')),'allowNull':![],'defaultValue':'ringall','set':function(_0x44541d){this['setDataValue'](_0x04ea('0xd'),_0x44541d?_0x44541d:_0x04ea('0x9'));},'get':function(){var _0x19c2a8=this[_0x04ea('0xe')]('type');var _0xbda608=this[_0x04ea('0xe')]('dialMethod');var _0x2a5223=this[_0x04ea('0xe')]('strategy');if(_0x19c2a8===_0x04ea('0x5')){if(_0xbda608==='preview'){return null;}if(_0xbda608===_0x04ea('0xf')&&![_0x04ea('0x9'),_0x04ea('0x10')]['includes'](_0x2a5223)){this[_0x04ea('0x11')](_0x04ea('0xd'),_0x04ea('0x9'));}}return _0x2a5223;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x04ea('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x04ea('0x12')](0xb)},'timeout':{'type':Sequelize[_0x04ea('0x12')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x04ea('0x12')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0x04ea('0x12')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x04ea('0x12')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x04ea('0x13'),'no'),'defaultValue':_0x04ea('0x13')},'autopause':{'type':Sequelize['ENUM'](_0x04ea('0x13'),'no',_0x04ea('0x14')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x04ea('0x12')](0xb)},'autopausebusy':{'type':Sequelize[_0x04ea('0x3')](_0x04ea('0x13'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x04ea('0x3')](_0x04ea('0x13'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x04ea('0x12')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x04ea('0x3')](_0x04ea('0x13'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x04ea('0x3')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x04ea('0x3')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x04ea('0x3')](_0x04ea('0x13'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x04ea('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x04ea('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x04ea('0x12')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x04ea('0x12')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x04ea('0x3')](_0x04ea('0x13'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x04ea('0x3')](_0x04ea('0x13'),'no'),'defaultValue':_0x04ea('0x13')},'announce_holdtime':{'type':Sequelize['ENUM'](_0x04ea('0x13'),'no',_0x04ea('0x15')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x04ea('0x3')](_0x04ea('0x13'),'no')},'announce_position_limit':{'type':Sequelize[_0x04ea('0x12')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x04ea('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x04ea('0x2')]},'queue_youarenext':{'type':Sequelize[_0x04ea('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x04ea('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x04ea('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x04ea('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x04ea('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x04ea('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x04ea('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x04ea('0x2')]},'queue_quantity1':{'type':Sequelize[_0x04ea('0x2')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0x04ea('0x2')]},'periodic_announce':{'type':Sequelize[_0x04ea('0x16')],'set':function(_0x346997){this['setDataValue']('periodic_announce',_0x346997?_0x346997[_0x04ea('0x17')](','):[]);},'get':function(){return this[_0x04ea('0xe')](_0x04ea('0x18'))?this[_0x04ea('0xe')](_0x04ea('0x18'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0x04ea('0x2')],'defaultValue':_0x04ea('0x13'),'set':function(_0x4302de){this[_0x04ea('0x11')](_0x04ea('0x19'),_0x4302de?_0x4302de[_0x04ea('0x17')](','):undefined);},'get':function(){return this[_0x04ea('0xe')]('joinempty')?this['getDataValue'](_0x04ea('0x19'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x04ea('0x2')],'defaultValue':'no','set':function(_0x80f433){this[_0x04ea('0x11')](_0x04ea('0x1a'),_0x80f433?_0x80f433[_0x04ea('0x17')](','):undefined);},'get':function(){return this[_0x04ea('0xe')](_0x04ea('0x1a'))?this[_0x04ea('0xe')](_0x04ea('0x1a'))[_0x04ea('0x1b')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x04ea('0x3')](_0x04ea('0x13'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x04ea('0x3')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x04ea('0x12')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x04ea('0x3')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x04ea('0x2')]},'description':{'type':Sequelize[_0x04ea('0x2')]},'acw':{'type':Sequelize[_0x04ea('0x1c')],'defaultValue':0x0,'set':function(_0x245d0c){this[_0x04ea('0x11')](_0x04ea('0x1d'),_0x245d0c);if(_0x245d0c){if(this['getDataValue']('wrapuptime')<0x2){this[_0x04ea('0x11')](_0x04ea('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x04ea('0x1c')],'defaultValue':0x0,'comment':_0x04ea('0x1f')},'dialMethod':{'type':Sequelize[_0x04ea('0x3')](_0x04ea('0x20'),_0x04ea('0x21'),_0x04ea('0x22'),_0x04ea('0x23'),_0x04ea('0xf')),'defaultValue':_0x04ea('0x21'),'comment':_0x04ea('0x24')},'dialLimitChannel':{'type':Sequelize[_0x04ea('0x12')](0x4)[_0x04ea('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x04ea('0x26')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x04ea('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x04ea('0x27')](0x2)[_0x04ea('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0x04ea('0x3')](_0x04ea('0x28'),_0x04ea('0x29')),'defaultValue':'dropRate','comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x04ea('0x27')](0x2)[_0x04ea('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x04ea('0x2a')},'dialPredictiveInterval':{'type':Sequelize[_0x04ea('0x12')](0x3)[_0x04ea('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x04ea('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x04ea('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x04ea('0x12')](0x3)[_0x04ea('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x04ea('0x2')],'defaultValue':_0x04ea('0x2b'),'comment':_0x04ea('0x2c')},'dialQueueTimeout':{'type':Sequelize[_0x04ea('0x12')](0x3)[_0x04ea('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x04ea('0x2d')},'dialQueueProject':{'type':Sequelize[_0x04ea('0x2')],'comment':_0x04ea('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0x04ea('0x12')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x04ea('0x2f')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x04ea('0x12')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x04ea('0x30')},'dialBusyMaxRetry':{'type':Sequelize[_0x04ea('0x12')](0x3)[_0x04ea('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x04ea('0x31')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x04ea('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x04ea('0x32')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x04ea('0x12')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x04ea('0x33')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x04ea('0x12')](0x5)[_0x04ea('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x04ea('0x34')},'dialGlobalMaxRetry':{'type':Sequelize[_0x04ea('0x12')](0x3)[_0x04ea('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x04ea('0x35')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x04ea('0x2')],'defaultValue':_0x04ea('0x36')},'dialPrefix':{'type':Sequelize[_0x04ea('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x04ea('0x3')](_0x04ea('0x37'),'never',_0x04ea('0x38')),'defaultValue':_0x04ea('0x37')},'dialAMDActive':{'type':Sequelize[_0x04ea('0x1c')],'defaultValue':0x0,'comment':_0x04ea('0x39')},'dialAMDInitialSilence':{'type':Sequelize[_0x04ea('0x12')](0x9)[_0x04ea('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x04ea('0x3a')},'dialAMDGreeting':{'type':Sequelize[_0x04ea('0x12')](0x9)[_0x04ea('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x04ea('0x3b')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x04ea('0x12')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x04ea('0x3c')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x04ea('0x12')](0x9)[_0x04ea('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x04ea('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x04ea('0x3d')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x04ea('0x3e')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x04ea('0x12')](0x9)[_0x04ea('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x04ea('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x04ea('0x12')](0x5)[_0x04ea('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x04ea('0x40')},'dialRecallMeTimeout':{'type':Sequelize[_0x04ea('0x12')](0x5)[_0x04ea('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x04ea('0x41')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x04ea('0x3')](_0x04ea('0x42'),_0x04ea('0x43')),'defaultValue':_0x04ea('0x42')},'dialQueueProject2':{'type':Sequelize[_0x04ea('0x2')],'comment':_0x04ea('0x2e')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x04ea('0x1c')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x04ea('0x12')](0x3)[_0x04ea('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x04ea('0x12')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x04ea('0x44')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x04ea('0x12')](0x3)[_0x04ea('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x04ea('0x45')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x04ea('0x12')](0x5)[_0x04ea('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x04ea('0x46')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x04ea('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x04ea('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x04ea('0x47')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x04ea('0x12')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x04ea('0x48')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x04ea('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x04ea('0x49')},'dialMachineMaxRetry':{'type':Sequelize[_0x04ea('0x12')](0x3)[_0x04ea('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x04ea('0x4a')},'dialMachineRetryFrequency':{'type':Sequelize[_0x04ea('0x12')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x04ea('0x4b')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x04ea('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x04ea('0x4c')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0x04ea('0x4d')},'mandatoryDisposition':{'type':Sequelize[_0x04ea('0x1c')],'defaultValue':![],'comment':_0x04ea('0x4e'),'set':function(_0x17418d){if(!_0x17418d)this[_0x04ea('0x11')](_0x04ea('0x4f'),null);this[_0x04ea('0x11')](_0x04ea('0x50'),_0x17418d);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x04ea('0x12')](0x3)[_0x04ea('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x04ea('0x12')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x04ea('0x12')](0x3)[_0x04ea('0x25')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x04ea('0x1c')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 52ecef8..5648d6d 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 _0x4b84=['type','find','UserProfileResource','stack','name','send','index','rawAttributes','fieldName','key','getOptions','where','VoiceQueue','include','findAll','rows','catch','show','params','model','keys','query','filters','intersection','attributes','fields','length','includeAll','merge','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','userProfileId','findOne','hasOwnProperty','nolimit','order','sort','VoiceQueueId','CmHopper','getHopperHistories','pick','CmHopperHistory','CmHopperFinal','CmHopperBlack','getTeams','Team','addTeams','User','Agents','voicePause','interface','forEach','penalty','transaction','TeamVoiceQueue','each','UserVoiceQueue','UserVoiceQueueRt','upsert','format','SIP/%s','emit','ids','field','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','sequelize','SELECT','TeamId','all','removeTeams','isEmpty','removeAgents','addAgents','spread','userVoiceQueue:save','online','isNil','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','fromQuery','phone','scheduledAt','ContactId','ListId','select','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','insert','into','CmHopperId','OrderBy','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','h.scheduledat=?','ci.ItemClass=?','removeLists','getBlackLists','NOW()','removeBlackLists','moment','bluebird','squel','../../config/logger','api','../../config/environment','redis','socket.io-emitter','./voiceQueue.socket','sendStatus','end','status','json','undefined','count','offset','limit','update','destroy','then','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b84,0x1cc));var _0x44b8=function(_0x1fb1c1,_0x4ebe69){_0x1fb1c1=_0x1fb1c1-0x0;var _0x1622df=_0x4b84[_0x1fb1c1];return _0x1622df;};'use strict';var moment=require(_0x44b8('0x0'));var BPromise=require(_0x44b8('0x1'));var util=require('util');var _=require('lodash');var squel=require(_0x44b8('0x2'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x44b8('0x3'))(_0x44b8('0x4'));var config=require(_0x44b8('0x5'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x44b8('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x44b8('0x7'))(new Redis(config['redis']));require(_0x44b8('0x8'))['register'](socket);function respondWithStatusCode(_0x5034b6,_0x41d515){_0x41d515=_0x41d515||0xcc;return function(_0x42319d){if(_0x42319d){return _0x5034b6[_0x44b8('0x9')](_0x41d515);}return _0x5034b6['status'](_0x41d515)[_0x44b8('0xa')]();};}function respondWithResult(_0x2cc74b,_0x4315f6){_0x4315f6=_0x4315f6||0xc8;return function(_0x9b6048){if(_0x9b6048){return _0x2cc74b[_0x44b8('0xb')](_0x4315f6)[_0x44b8('0xc')](_0x9b6048);}};}function respondWithFilteredResult(_0xe9a025,_0x4ae8a1){return function(_0x147529){if(_0x147529){var _0x4301a6=typeof _0x4ae8a1['offset']===_0x44b8('0xd')&&typeof _0x4ae8a1['limit']===_0x44b8('0xd');var _0x18d642=_0x147529['count'];var _0x63e8f6=_0x4301a6?0x0:_0x4ae8a1['offset'];var _0x54fa95=_0x4301a6?_0x147529[_0x44b8('0xe')]:_0x4ae8a1[_0x44b8('0xf')]+_0x4ae8a1[_0x44b8('0x10')];var _0x41ab46;if(_0x54fa95>=_0x18d642){_0x54fa95=_0x18d642;_0x41ab46=0xc8;}else{_0x41ab46=0xce;}_0xe9a025['status'](_0x41ab46);return _0xe9a025['set']('Content-Range',_0x63e8f6+'-'+_0x54fa95+'/'+_0x18d642)[_0x44b8('0xc')](_0x147529);}return null;};}function saveUpdates(_0x5b7803){return function(_0x28ef36){if(_0x28ef36){return _0x28ef36[_0x44b8('0x11')](_0x5b7803)['then'](function(_0x36743e){return _0x36743e;});}return null;};}function removeEntity(_0xe3de8f){return function(_0x5103f5){if(_0x5103f5){return _0x5103f5[_0x44b8('0x12')]()[_0x44b8('0x13')](function(){var _0x4b600f=_0x5103f5[_0x44b8('0x14')]({'plain':!![]});var _0x8b4301=[{'name':_0x44b8('0x15'),'value':_0x44b8('0x16'),'ignore':![]},{'name':_0x44b8('0x17'),'value':_0x44b8('0x18'),'ignore':![]}];var _0x452f2f=_(_0x8b4301)[_0x44b8('0x19')](_0x44b8('0x1a'))[_0x44b8('0x1b')](_0x44b8('0x1c'))[_0x44b8('0x1c')]();if(_['includes'](_0x452f2f,_0x4b600f[_0x44b8('0x1d')])){return;}var _0x3a8aa4=_[_0x44b8('0x1e')](_0x8b4301,[_0x44b8('0x1c'),_0x4b600f[_0x44b8('0x1d')]])['name'];return db[_0x44b8('0x1f')]['destroy']({'where':{'type':_0x3a8aa4,'resourceId':_0x4b600f['id']}})[_0x44b8('0x13')](function(){return _0x5103f5;});})[_0x44b8('0x13')](function(){_0xe3de8f[_0x44b8('0xb')](0xcc)[_0x44b8('0xa')]();});}};}function handleEntityNotFound(_0x230a3d){return function(_0x59acbc){if(!_0x59acbc){_0x230a3d[_0x44b8('0x9')](0x194);}return _0x59acbc;};}function handleError(_0x502acf,_0x41d673){_0x41d673=_0x41d673||0x1f4;return function(_0x350482){logger['error'](_0x350482[_0x44b8('0x20')]);if(_0x350482[_0x44b8('0x21')]){delete _0x350482[_0x44b8('0x21')];}_0x502acf['status'](_0x41d673)[_0x44b8('0x22')](_0x350482);};}exports[_0x44b8('0x23')]=function(_0x53d9c7,_0x2e0174){var _0x4a182d={};var _0xfb0028={'count':0x0,'rows':[]};var _0x5a544c=_['map'](db['VoiceQueue'][_0x44b8('0x24')],function(_0x29b18d){return{'name':_0x29b18d[_0x44b8('0x25')],'type':_0x29b18d[_0x44b8('0x1d')][_0x44b8('0x26')]};});_0x4a182d=qs[_0x44b8('0x27')](_0x5a544c,_0x53d9c7);var _0x2cf205={'where':_0x4a182d[_0x44b8('0x28')]};return db[_0x44b8('0x29')][_0x44b8('0xe')](_0x2cf205)[_0x44b8('0x13')](function(_0x417d81){_0xfb0028[_0x44b8('0xe')]=_0x417d81;_0x4a182d['include']=qs[_0x44b8('0x2a')](_0x53d9c7['query']);return db[_0x44b8('0x29')][_0x44b8('0x2b')](_0x4a182d);})[_0x44b8('0x13')](function(_0xb64609){_0xfb0028[_0x44b8('0x2c')]=_0xb64609;return _0xfb0028;})['then'](respondWithFilteredResult(_0x2e0174,_0x4a182d))[_0x44b8('0x2d')](handleError(_0x2e0174,null));};exports[_0x44b8('0x2e')]=function(_0x26265f,_0x339f0f){var _0x46b008={'raw':![],'where':{'id':_0x26265f[_0x44b8('0x2f')]['id']}},_0x5f541d={};_0x5f541d[_0x44b8('0x30')]=_[_0x44b8('0x31')](db[_0x44b8('0x29')][_0x44b8('0x24')]);_0x5f541d[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x26265f[_0x44b8('0x32')]);_0x5f541d[_0x44b8('0x33')]=_[_0x44b8('0x34')](_0x5f541d[_0x44b8('0x30')],_0x5f541d[_0x44b8('0x32')]);_0x46b008[_0x44b8('0x35')]=_[_0x44b8('0x34')](_0x5f541d[_0x44b8('0x30')],qs[_0x44b8('0x36')](_0x26265f[_0x44b8('0x32')][_0x44b8('0x36')]));_0x46b008[_0x44b8('0x35')]=_0x46b008[_0x44b8('0x35')][_0x44b8('0x37')]?_0x46b008[_0x44b8('0x35')]:_0x5f541d['model'];if(_0x26265f[_0x44b8('0x32')][_0x44b8('0x38')]){_0x46b008['include']=[{'all':!![]}];}_0x46b008=_[_0x44b8('0x39')]({},_0x46b008,_0x26265f[_0x44b8('0x3a')]);return db[_0x44b8('0x29')][_0x44b8('0x1e')](_0x46b008)['then'](handleEntityNotFound(_0x339f0f,null))[_0x44b8('0x13')](respondWithResult(_0x339f0f,null))[_0x44b8('0x2d')](handleError(_0x339f0f,null));};exports[_0x44b8('0x3b')]=function(_0x1ee3cc,_0x9cb2a){return db[_0x44b8('0x29')][_0x44b8('0x3b')](_0x1ee3cc[_0x44b8('0x3c')],{})[_0x44b8('0x13')](function(_0x3d1be1){var _0x1c9983=_0x1ee3cc[_0x44b8('0x3d')][_0x44b8('0x14')]({'plain':!![]});if(!_0x1c9983)throw new Error(_0x44b8('0x3e'));if(_0x1c9983[_0x44b8('0x3f')]===_0x44b8('0x3d')){var _0x57d8c4=_0x3d1be1[_0x44b8('0x14')]({'plain':!![]});var _0x43e43a=[{'name':_0x44b8('0x15'),'value':'inbound'},{'name':_0x44b8('0x17'),'value':_0x44b8('0x18')}];var _0x229cc9=_['find'](_0x43e43a,[_0x44b8('0x1c'),_0x57d8c4[_0x44b8('0x1d')]])[_0x44b8('0x21')];return db[_0x44b8('0x40')][_0x44b8('0x1e')]({'where':{'name':_0x229cc9,'userProfileId':_0x1c9983['userProfileId']},'raw':!![]})['then'](function(_0x215f7b){if(_0x215f7b&&_0x215f7b[_0x44b8('0x41')]===0x0){return db[_0x44b8('0x1f')][_0x44b8('0x3b')]({'name':_0x57d8c4[_0x44b8('0x21')],'resourceId':_0x57d8c4['id'],'type':_0x215f7b[_0x44b8('0x21')],'sectionId':_0x215f7b['id']},{})[_0x44b8('0x13')](function(){return _0x3d1be1;});}else{return _0x3d1be1;}})[_0x44b8('0x2d')](function(_0x455fd6){logger[_0x44b8('0x42')](_0x44b8('0x43'),_0x455fd6);throw _0x455fd6;});}return _0x3d1be1;})[_0x44b8('0x13')](respondWithResult(_0x9cb2a,0xc9))[_0x44b8('0x2d')](handleError(_0x9cb2a,null));};exports[_0x44b8('0x44')]=function(_0x149731,_0x60eeb2){var _0xce06dc={'where':{'id':_0x149731[_0x44b8('0x2f')]['id']}},_0x3b3d5d={};_0x3b3d5d['model']=_['keys'](db[_0x44b8('0x29')][_0x44b8('0x24')]);_0xce06dc[_0x44b8('0x35')]=_[_0x44b8('0x34')](_0x3b3d5d[_0x44b8('0x30')],qs[_0x44b8('0x36')](_0x149731[_0x44b8('0x32')]['fields']));_0xce06dc[_0x44b8('0x35')]=_0xce06dc['attributes'][_0x44b8('0x37')]?_0xce06dc[_0x44b8('0x35')]:_0x3b3d5d[_0x44b8('0x30')];if(_0x149731[_0x44b8('0x32')][_0x44b8('0x38')]){_0xce06dc[_0x44b8('0x2a')]=[{'all':!![]}];}_0xce06dc=_['merge']({},_0xce06dc,_0x149731[_0x44b8('0x3a')]);return db[_0x44b8('0x29')][_0x44b8('0x1e')](_0xce06dc)[_0x44b8('0x13')](handleEntityNotFound(_0x60eeb2,null))['then'](function(_0x4e4ed1){if(_0x4e4ed1){var _0x2f549d=_0x4e4ed1[_0x44b8('0x14')]({'plain':!![]});_0x2f549d=qs[_0x44b8('0x45')](_0x2f549d,['id',_0x44b8('0x46'),_0x44b8('0x47')]);_0x149731['body']=_[_0x44b8('0x45')](_0x149731[_0x44b8('0x3c')],['id',_0x44b8('0x46'),_0x44b8('0x47')]);return db[_0x44b8('0x29')]['create'](_['merge'](_0x2f549d,_0x149731[_0x44b8('0x3c')]),{'include':_0x149731['query'][_0x44b8('0x38')]?[{'all':!![]}]:undefined})['then'](function(_0x40164d){var _0x434d6a=_0x149731[_0x44b8('0x3d')][_0x44b8('0x14')]({'plain':!![]});if(!_0x434d6a)throw new Error(_0x44b8('0x3e'));if(_0x434d6a[_0x44b8('0x3f')]===_0x44b8('0x3d')){var _0x533967=_0x40164d[_0x44b8('0x14')]({'plain':!![]});var _0x37b2c2=[{'name':_0x44b8('0x15'),'value':'inbound'},{'name':_0x44b8('0x17'),'value':_0x44b8('0x18')}];var _0x45f9a0=_[_0x44b8('0x1e')](_0x37b2c2,['value',_0x533967[_0x44b8('0x1d')]])[_0x44b8('0x21')];return db['UserProfileSection'][_0x44b8('0x1e')]({'where':{'name':_0x45f9a0,'userProfileId':_0x434d6a[_0x44b8('0x48')]},'raw':!![]})[_0x44b8('0x13')](function(_0x3df6aa){if(_0x3df6aa&&_0x3df6aa[_0x44b8('0x41')]===0x0){return db['UserProfileResource']['create']({'name':_0x533967[_0x44b8('0x21')],'resourceId':_0x533967['id'],'type':_0x3df6aa[_0x44b8('0x21')],'sectionId':_0x3df6aa['id']},{})[_0x44b8('0x13')](function(){return _0x40164d;});}else{return _0x40164d;}})[_0x44b8('0x2d')](function(_0x765e45){logger[_0x44b8('0x42')](_0x44b8('0x43'),_0x765e45);throw _0x765e45;});}return _0x40164d;});}})[_0x44b8('0x13')](respondWithResult(_0x60eeb2,0xc9))[_0x44b8('0x2d')](handleError(_0x60eeb2,null));};exports[_0x44b8('0x11')]=function(_0x16c628,_0x3f7576){if(_0x16c628['body']['id']){delete _0x16c628[_0x44b8('0x3c')]['id'];}return db[_0x44b8('0x29')][_0x44b8('0x1e')]({'where':{'id':_0x16c628[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x3f7576,null))[_0x44b8('0x13')](saveUpdates(_0x16c628[_0x44b8('0x3c')],null))[_0x44b8('0x13')](respondWithResult(_0x3f7576,null))[_0x44b8('0x2d')](handleError(_0x3f7576,null));};exports[_0x44b8('0x12')]=function(_0x2ecff9,_0x15bcba){return db[_0x44b8('0x29')][_0x44b8('0x1e')]({'where':{'id':_0x2ecff9[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x15bcba,null))[_0x44b8('0x13')](removeEntity(_0x15bcba,null))[_0x44b8('0x2d')](handleError(_0x15bcba,null));};exports['getHoppers']=function(_0x1ec516,_0x3aac51){var _0x10e519={'raw':![],'where':{}};var _0x2b37e={};var _0x51f763={'count':0x0,'rows':[]};return db[_0x44b8('0x29')][_0x44b8('0x49')]({'where':{'id':_0x1ec516['params']['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x3aac51,null))[_0x44b8('0x13')](function(_0x5df821){if(_0x5df821){_0x2b37e[_0x44b8('0x30')]=_[_0x44b8('0x31')](db['CmHopper'][_0x44b8('0x24')]);_0x2b37e[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x1ec516['query']);_0x2b37e[_0x44b8('0x33')]=_['intersection'](_0x2b37e[_0x44b8('0x30')],_0x2b37e['query']);_0x10e519[_0x44b8('0x35')]=_[_0x44b8('0x34')](_0x2b37e[_0x44b8('0x30')],qs[_0x44b8('0x36')](_0x1ec516[_0x44b8('0x32')][_0x44b8('0x36')]));_0x10e519['attributes']=_0x10e519[_0x44b8('0x35')]['length']?_0x10e519[_0x44b8('0x35')]:_0x2b37e[_0x44b8('0x30')];if(!_0x1ec516['query'][_0x44b8('0x4a')](_0x44b8('0x4b'))){_0x10e519[_0x44b8('0x10')]=qs[_0x44b8('0x10')](_0x1ec516[_0x44b8('0x32')][_0x44b8('0x10')]);_0x10e519[_0x44b8('0xf')]=qs[_0x44b8('0xf')](_0x1ec516[_0x44b8('0x32')][_0x44b8('0xf')]);}_0x10e519[_0x44b8('0x4c')]=qs[_0x44b8('0x4d')](_0x1ec516['query'][_0x44b8('0x4d')]);_0x10e519[_0x44b8('0x28')]=qs[_0x44b8('0x33')](_['pick'](_0x1ec516[_0x44b8('0x32')],_0x2b37e[_0x44b8('0x33')]));_0x10e519['where'][_0x44b8('0x4e')]=_0x5df821['id'];if(_0x1ec516[_0x44b8('0x32')][_0x44b8('0x19')]){_0x10e519[_0x44b8('0x28')]=_[_0x44b8('0x39')](_0x10e519['where'],{'$or':_[_0x44b8('0x1b')](_0x10e519[_0x44b8('0x35')],function(_0x279753){var _0x270224={};_0x270224[_0x279753]={'$like':'%'+_0x1ec516[_0x44b8('0x32')][_0x44b8('0x19')]+'%'};return _0x270224;})});}_0x10e519=_[_0x44b8('0x39')]({},_0x10e519,_0x1ec516[_0x44b8('0x3a')]);return db['CmHopper'][_0x44b8('0xe')]({'where':_0x10e519[_0x44b8('0x28')]})[_0x44b8('0x13')](function(_0x3ce76e){_0x51f763['count']=_0x3ce76e;if(_0x1ec516['query']['includeAll']){_0x10e519[_0x44b8('0x2a')]=[{'all':!![]}];}return db[_0x44b8('0x4f')][_0x44b8('0x2b')](_0x10e519);})[_0x44b8('0x13')](function(_0x32e630){_0x51f763['rows']=_0x32e630;return _0x51f763;});}})[_0x44b8('0x13')](respondWithFilteredResult(_0x3aac51,_0x10e519))['catch'](handleError(_0x3aac51,null));};exports[_0x44b8('0x50')]=function(_0x155bcf,_0xea2c3e){var _0x5da034={'raw':!![],'where':{}};var _0x4cac12={};var _0xb4c6dc={'count':0x0,'rows':[]};return db[_0x44b8('0x29')][_0x44b8('0x49')]({'where':{'id':_0x155bcf['params']['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0xea2c3e,null))[_0x44b8('0x13')](function(_0x1258c2){if(_0x1258c2){_0x4cac12[_0x44b8('0x30')]=_[_0x44b8('0x31')](db['CmHopperHistory'][_0x44b8('0x24')]);_0x4cac12[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x155bcf[_0x44b8('0x32')]);_0x4cac12[_0x44b8('0x33')]=_['intersection'](_0x4cac12[_0x44b8('0x30')],_0x4cac12[_0x44b8('0x32')]);_0x5da034[_0x44b8('0x35')]=_[_0x44b8('0x34')](_0x4cac12[_0x44b8('0x30')],qs[_0x44b8('0x36')](_0x155bcf[_0x44b8('0x32')]['fields']));_0x5da034[_0x44b8('0x35')]=_0x5da034[_0x44b8('0x35')]['length']?_0x5da034[_0x44b8('0x35')]:_0x4cac12[_0x44b8('0x30')];if(!_0x155bcf['query'][_0x44b8('0x4a')]('nolimit')){_0x5da034['limit']=qs[_0x44b8('0x10')](_0x155bcf[_0x44b8('0x32')][_0x44b8('0x10')]);_0x5da034['offset']=qs['offset'](_0x155bcf['query'][_0x44b8('0xf')]);}_0x5da034[_0x44b8('0x4c')]=qs[_0x44b8('0x4d')](_0x155bcf[_0x44b8('0x32')][_0x44b8('0x4d')]);_0x5da034[_0x44b8('0x28')]=qs[_0x44b8('0x33')](_[_0x44b8('0x51')](_0x155bcf['query'],_0x4cac12[_0x44b8('0x33')]));_0x5da034['where']['VoiceQueueId']=_0x1258c2['id'];if(_0x155bcf['query'][_0x44b8('0x19')]){_0x5da034['where']=_[_0x44b8('0x39')](_0x5da034[_0x44b8('0x28')],{'$or':_[_0x44b8('0x1b')](_0x5da034[_0x44b8('0x35')],function(_0x3a9780){var _0x245ba3={};_0x245ba3[_0x3a9780]={'$like':'%'+_0x155bcf[_0x44b8('0x32')][_0x44b8('0x19')]+'%'};return _0x245ba3;})});}_0x5da034=_['merge']({},_0x5da034,_0x155bcf[_0x44b8('0x3a')]);return db[_0x44b8('0x52')][_0x44b8('0xe')]({'where':_0x5da034[_0x44b8('0x28')]})[_0x44b8('0x13')](function(_0xee44b3){_0xb4c6dc[_0x44b8('0xe')]=_0xee44b3;if(_0x155bcf[_0x44b8('0x32')][_0x44b8('0x38')]){_0x5da034['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x44b8('0x2b')](_0x5da034);})['then'](function(_0x531d65){_0xb4c6dc[_0x44b8('0x2c')]=_0x531d65;return _0xb4c6dc;});}})[_0x44b8('0x13')](respondWithFilteredResult(_0xea2c3e,_0x5da034))['catch'](handleError(_0xea2c3e,null));};exports['getHopperFinals']=function(_0x4b22e7,_0x2e0289){var _0x4860af={'raw':!![],'where':{}};var _0x353ff1={};var _0x2812da={'count':0x0,'rows':[]};return db[_0x44b8('0x29')][_0x44b8('0x49')]({'where':{'id':_0x4b22e7[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x2e0289,null))[_0x44b8('0x13')](function(_0x3a7229){if(_0x3a7229){_0x353ff1[_0x44b8('0x30')]=_[_0x44b8('0x31')](db[_0x44b8('0x53')][_0x44b8('0x24')]);_0x353ff1[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x4b22e7['query']);_0x353ff1[_0x44b8('0x33')]=_[_0x44b8('0x34')](_0x353ff1[_0x44b8('0x30')],_0x353ff1[_0x44b8('0x32')]);_0x4860af[_0x44b8('0x35')]=_[_0x44b8('0x34')](_0x353ff1[_0x44b8('0x30')],qs[_0x44b8('0x36')](_0x4b22e7[_0x44b8('0x32')][_0x44b8('0x36')]));_0x4860af[_0x44b8('0x35')]=_0x4860af[_0x44b8('0x35')][_0x44b8('0x37')]?_0x4860af['attributes']:_0x353ff1[_0x44b8('0x30')];if(!_0x4b22e7[_0x44b8('0x32')][_0x44b8('0x4a')]('nolimit')){_0x4860af['limit']=qs[_0x44b8('0x10')](_0x4b22e7[_0x44b8('0x32')][_0x44b8('0x10')]);_0x4860af['offset']=qs[_0x44b8('0xf')](_0x4b22e7[_0x44b8('0x32')][_0x44b8('0xf')]);}_0x4860af[_0x44b8('0x4c')]=qs[_0x44b8('0x4d')](_0x4b22e7[_0x44b8('0x32')][_0x44b8('0x4d')]);_0x4860af[_0x44b8('0x28')]=qs['filters'](_[_0x44b8('0x51')](_0x4b22e7[_0x44b8('0x32')],_0x353ff1[_0x44b8('0x33')]));_0x4860af[_0x44b8('0x28')][_0x44b8('0x4e')]=_0x3a7229['id'];if(_0x4b22e7[_0x44b8('0x32')][_0x44b8('0x19')]){_0x4860af['where']=_['merge'](_0x4860af['where'],{'$or':_[_0x44b8('0x1b')](_0x4860af[_0x44b8('0x35')],function(_0x2d74ee){var _0x312f4c={};_0x312f4c[_0x2d74ee]={'$like':'%'+_0x4b22e7[_0x44b8('0x32')][_0x44b8('0x19')]+'%'};return _0x312f4c;})});}_0x4860af=_[_0x44b8('0x39')]({},_0x4860af,_0x4b22e7[_0x44b8('0x3a')]);return db[_0x44b8('0x53')]['count']({'where':_0x4860af[_0x44b8('0x28')]})[_0x44b8('0x13')](function(_0x4b8036){_0x2812da['count']=_0x4b8036;if(_0x4b22e7[_0x44b8('0x32')]['includeAll']){_0x4860af[_0x44b8('0x2a')]=[{'all':!![]}];}return db[_0x44b8('0x53')][_0x44b8('0x2b')](_0x4860af);})['then'](function(_0x3f4a2a){_0x2812da[_0x44b8('0x2c')]=_0x3f4a2a;return _0x2812da;});}})[_0x44b8('0x13')](respondWithFilteredResult(_0x2e0289,_0x4860af))[_0x44b8('0x2d')](handleError(_0x2e0289,null));};exports['getHopperBlacks']=function(_0x216030,_0x584ae3){var _0x38c0c5={'raw':!![],'where':{}};var _0x2f2923={};var _0x2d9d62={'count':0x0,'rows':[]};return db[_0x44b8('0x29')][_0x44b8('0x49')]({'where':{'id':_0x216030[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x584ae3,null))['then'](function(_0x4d3b82){if(_0x4d3b82){_0x2f2923['model']=_[_0x44b8('0x31')](db[_0x44b8('0x54')][_0x44b8('0x24')]);_0x2f2923[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x216030[_0x44b8('0x32')]);_0x2f2923[_0x44b8('0x33')]=_[_0x44b8('0x34')](_0x2f2923[_0x44b8('0x30')],_0x2f2923[_0x44b8('0x32')]);_0x38c0c5[_0x44b8('0x35')]=_[_0x44b8('0x34')](_0x2f2923[_0x44b8('0x30')],qs[_0x44b8('0x36')](_0x216030[_0x44b8('0x32')][_0x44b8('0x36')]));_0x38c0c5[_0x44b8('0x35')]=_0x38c0c5[_0x44b8('0x35')]['length']?_0x38c0c5[_0x44b8('0x35')]:_0x2f2923['model'];if(!_0x216030[_0x44b8('0x32')]['hasOwnProperty']('nolimit')){_0x38c0c5[_0x44b8('0x10')]=qs['limit'](_0x216030['query']['limit']);_0x38c0c5['offset']=qs['offset'](_0x216030[_0x44b8('0x32')][_0x44b8('0xf')]);}_0x38c0c5[_0x44b8('0x4c')]=qs[_0x44b8('0x4d')](_0x216030['query'][_0x44b8('0x4d')]);_0x38c0c5[_0x44b8('0x28')]=qs['filters'](_['pick'](_0x216030[_0x44b8('0x32')],_0x2f2923[_0x44b8('0x33')]));_0x38c0c5[_0x44b8('0x28')]['VoiceQueueId']=_0x4d3b82['id'];if(_0x216030[_0x44b8('0x32')][_0x44b8('0x19')]){_0x38c0c5[_0x44b8('0x28')]=_[_0x44b8('0x39')](_0x38c0c5[_0x44b8('0x28')],{'$or':_[_0x44b8('0x1b')](_0x38c0c5[_0x44b8('0x35')],function(_0x16344b){var _0x21057f={};_0x21057f[_0x16344b]={'$like':'%'+_0x216030['query'][_0x44b8('0x19')]+'%'};return _0x21057f;})});}_0x38c0c5=_[_0x44b8('0x39')]({},_0x38c0c5,_0x216030['options']);return db[_0x44b8('0x54')][_0x44b8('0xe')]({'where':_0x38c0c5[_0x44b8('0x28')]})['then'](function(_0x3a09e4){_0x2d9d62['count']=_0x3a09e4;if(_0x216030[_0x44b8('0x32')][_0x44b8('0x38')]){_0x38c0c5['include']=[{'all':!![]}];}return db[_0x44b8('0x54')][_0x44b8('0x2b')](_0x38c0c5);})[_0x44b8('0x13')](function(_0x37871e){_0x2d9d62['rows']=_0x37871e;return _0x2d9d62;});}})[_0x44b8('0x13')](respondWithFilteredResult(_0x584ae3,_0x38c0c5))[_0x44b8('0x2d')](handleError(_0x584ae3,null));};exports[_0x44b8('0x55')]=function(_0x35d46c,_0x2d4a8a){var _0x1d666e={};var _0x10a66a={};var _0x1e608f;var _0x470f90;return db['VoiceQueue']['findOne']({'where':{'id':_0x35d46c[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x2d4a8a,null))[_0x44b8('0x13')](function(_0x3539f9){if(_0x3539f9){_0x1e608f=_0x3539f9;_0x10a66a[_0x44b8('0x30')]=_['keys'](db[_0x44b8('0x56')]['rawAttributes']);_0x10a66a[_0x44b8('0x32')]=_['keys'](_0x35d46c[_0x44b8('0x32')]);_0x10a66a[_0x44b8('0x33')]=_[_0x44b8('0x34')](_0x10a66a[_0x44b8('0x30')],_0x10a66a[_0x44b8('0x32')]);_0x1d666e[_0x44b8('0x35')]=_[_0x44b8('0x34')](_0x10a66a[_0x44b8('0x30')],qs[_0x44b8('0x36')](_0x35d46c['query'][_0x44b8('0x36')]));_0x1d666e[_0x44b8('0x35')]=_0x1d666e[_0x44b8('0x35')][_0x44b8('0x37')]?_0x1d666e['attributes']:_0x10a66a['model'];_0x1d666e['order']=qs[_0x44b8('0x4d')](_0x35d46c['query']['sort']);_0x1d666e[_0x44b8('0x28')]=qs[_0x44b8('0x33')](_[_0x44b8('0x51')](_0x35d46c[_0x44b8('0x32')],_0x10a66a[_0x44b8('0x33')]));if(_0x35d46c[_0x44b8('0x32')][_0x44b8('0x19')]){_0x1d666e[_0x44b8('0x28')]=_['merge'](_0x1d666e[_0x44b8('0x28')],{'$or':_[_0x44b8('0x1b')](_0x1d666e[_0x44b8('0x35')],function(_0x2594bf){var _0x5f0c0c={};_0x5f0c0c[_0x2594bf]={'$like':'%'+_0x35d46c[_0x44b8('0x32')][_0x44b8('0x19')]+'%'};return _0x5f0c0c;})});}_0x1d666e=_[_0x44b8('0x39')]({},_0x1d666e,_0x35d46c['options']);return _0x1e608f['getTeams'](_0x1d666e);}})[_0x44b8('0x13')](function(_0xae9b10){if(_0xae9b10){_0x470f90=_0xae9b10[_0x44b8('0x37')];if(!_0x35d46c[_0x44b8('0x32')][_0x44b8('0x4a')]('nolimit')){_0x1d666e[_0x44b8('0x10')]=qs[_0x44b8('0x10')](_0x35d46c['query'][_0x44b8('0x10')]);_0x1d666e[_0x44b8('0xf')]=qs[_0x44b8('0xf')](_0x35d46c[_0x44b8('0x32')]['offset']);}return _0x1e608f[_0x44b8('0x55')](_0x1d666e);}})['then'](function(_0x4464d3){if(_0x4464d3){return _0x4464d3?{'count':_0x470f90,'rows':_0x4464d3}:null;}})[_0x44b8('0x13')](respondWithResult(_0x2d4a8a,null))[_0x44b8('0x2d')](handleError(_0x2d4a8a,null));};exports[_0x44b8('0x57')]=function(_0x45ff62,_0x343c5c){var _0x3cb290=_0x45ff62[_0x44b8('0x3c')]['teams'];var _0x2d27bf=_[_0x44b8('0x1b')](_0x3cb290,'id');return db[_0x44b8('0x56')][_0x44b8('0x2b')]({'where':{'id':_0x2d27bf},'attributes':['id'],'include':[{'model':db[_0x44b8('0x58')],'as':_0x44b8('0x59'),'attributes':['id','name','online',_0x44b8('0x5a'),_0x44b8('0x5b')],'raw':!![]}]})['then'](function(_0x41f732){if(_0x41f732){var _0x16074e=_['flatMap'](_0x41f732,function(_0x1ec23e){var _0x3208b4=_0x1ec23e[_0x44b8('0x14')]({'plain':!![]});_0x3208b4[_0x44b8('0x59')][_0x44b8('0x5c')](function(_0x43f416){_0x43f416[_0x44b8('0x5d')]=_[_0x44b8('0x1e')](_0x3cb290,{'id':_0x3208b4['id']})[_0x44b8('0x5d')];});return _0x3208b4[_0x44b8('0x59')];});return db[_0x44b8('0x29')][_0x44b8('0x1e')]({'where':{'id':_0x45ff62[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](function(_0x15365d){return db['sequelize'][_0x44b8('0x5e')](function(_0x3d92a9){return _0x15365d[_0x44b8('0x57')](_0x2d27bf,{'transaction':_0x3d92a9})[_0x44b8('0x13')](function(){return BPromise['each'](_0x3cb290,function(_0x611876){return db[_0x44b8('0x5f')]['upsert']({'TeamId':_0x611876['id'],'VoiceQueueId':_0x45ff62[_0x44b8('0x2f')]['id'],'penalty':_0x611876['penalty']},{'transaction':_0x3d92a9});});})[_0x44b8('0x13')](function(){return BPromise[_0x44b8('0x60')](_0x16074e,function(_0x5a508f){return db[_0x44b8('0x61')]['findOrCreate']({'where':{'UserId':_0x5a508f['id'],'VoiceQueueId':_0x45ff62['params']['id']},'defaults':{'penalty':_0x5a508f[_0x44b8('0x5d')]},'transaction':_0x3d92a9});});})[_0x44b8('0x13')](function(){return BPromise['each'](_['filter'](_0x16074e,{'online':!![]}),function(_0x52af57){return db[_0x44b8('0x62')][_0x44b8('0x63')]({'membername':_0x52af57[_0x44b8('0x21')],'UserId':_0x52af57['id'],'queue_name':_0x15365d['name'],'VoiceQueueId':_0x15365d['id'],'interface':_['isNil'](_0x52af57[_0x44b8('0x5b')])?util[_0x44b8('0x64')](_0x44b8('0x65'),_0x52af57[_0x44b8('0x21')]):_0x52af57[_0x44b8('0x5b')],'paused':_0x52af57[_0x44b8('0x5a')]||![],'penalty':_0x52af57[_0x44b8('0x5d')]},{'transaction':_0x3d92a9});});})[_0x44b8('0x13')](function(){_0x16074e[_0x44b8('0x5c')](function(_0x4ed62f){socket[_0x44b8('0x66')]('userVoiceQueue:save',{'UserId':_0x4ed62f['id'],'VoiceQueueId':_0x15365d['id']});});});});});}})[_0x44b8('0x13')](respondWithStatusCode(_0x343c5c,null))['catch'](handleError(_0x343c5c,null));};exports['removeTeams']=function(_0x1fb070,_0x224071){return db[_0x44b8('0x56')][_0x44b8('0x2b')]({'where':{'id':_0x1fb070[_0x44b8('0x32')][_0x44b8('0x67')]},'attributes':['id'],'include':[{'model':db[_0x44b8('0x58')],'as':_0x44b8('0x59'),'attributes':['id'],'raw':!![]}]})[_0x44b8('0x13')](handleEntityNotFound(_0x224071,null))['then'](function(_0x1eb0a8){var _0x1e3b5f=_[_0x44b8('0x1b')](_0x1eb0a8,'id');var _0x536d1d=[];var _0x5bc747=[];var _0x3e44ea=squel['select']();_0x3e44ea[_0x44b8('0x68')]('tq.TeamId')[_0x44b8('0x69')]('team_has_voice_queues','tq')['join'](_0x44b8('0x6a'),'ut',_0x44b8('0x6b'))['where'](_0x44b8('0x6c'),_0x1fb070[_0x44b8('0x2f')]['id']);for(var _0x276dfc=0x0;_0x276dfc<_0x1eb0a8[_0x44b8('0x37')];_0x276dfc+=0x1){let _0x291617=_0x1eb0a8[_0x276dfc];for(var _0x57b73f=0x0;_0x57b73f<_0x291617[_0x44b8('0x59')]['length'];_0x57b73f+=0x1){let _0x595af5=_0x291617['Agents'][_0x57b73f];var _0x3015f9=_0x3e44ea[_0x44b8('0x44')]();_0x3015f9['where'](_0x44b8('0x6d'),_0x595af5['id']);_0x5bc747[_0x44b8('0x6e')](db['sequelize']['query'](_0x3015f9[_0x44b8('0x6f')](),{'type':db[_0x44b8('0x70')]['QueryTypes'][_0x44b8('0x71')]})[_0x44b8('0x13')](function(_0x5e2d3b){if(_0x5e2d3b[_0x44b8('0x37')]===0x1){return _0x595af5['id'];}else{var _0x97f4=_['every'](_[_0x44b8('0x1b')](_0x5e2d3b,_0x44b8('0x72')),function(_0xdb42f2){return _['includes'](_0x1e3b5f,_0xdb42f2);});if(_0x97f4){return _0x595af5['id'];}}}));}}return BPromise[_0x44b8('0x73')](_0x5bc747)['then'](function(_0x2ea49d){_0x536d1d=_(_0x536d1d)['union'](_0x2ea49d)['compact']()[_0x44b8('0x1c')]();return db[_0x44b8('0x29')][_0x44b8('0x1e')]({'where':{'id':_0x1fb070[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](function(_0x1db2cf){return db[_0x44b8('0x70')][_0x44b8('0x5e')](function(_0x1b7826){return _0x1db2cf[_0x44b8('0x74')](_0x1fb070[_0x44b8('0x32')]['ids'],{'transaction':_0x1b7826})[_0x44b8('0x13')](function(){if(!_[_0x44b8('0x75')](_0x536d1d)){return _0x1db2cf[_0x44b8('0x76')](_0x536d1d,{'transaction':_0x1b7826})[_0x44b8('0x13')](function(){return db[_0x44b8('0x62')][_0x44b8('0x12')]({'where':{'VoiceQueueId':_0x1fb070[_0x44b8('0x2f')]['id'],'UserId':_0x536d1d},'transaction':_0x1b7826});});}})[_0x44b8('0x13')](function(){_0x536d1d['forEach'](function(_0x4234bc){socket[_0x44b8('0x66')]('userVoiceQueue:remove',{'UserId':_0x4234bc,'VoiceQueueId':_0x1db2cf['id']});});});});});});})[_0x44b8('0x13')](respondWithStatusCode(_0x224071,null))[_0x44b8('0x2d')](handleError(_0x224071,null));};exports[_0x44b8('0x77')]=function(_0x5596c0,_0x4b2b8f){var _0x18cd30,_0x133da8;return db['VoiceQueue']['find']({'where':{'id':_0x5596c0[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x4b2b8f,null))[_0x44b8('0x13')](function(_0x2bccf9){if(_0x2bccf9){_0x133da8=_0x2bccf9;return _0x2bccf9[_0x44b8('0x77')](_0x5596c0['body'][_0x44b8('0x67')],_['omit'](_0x5596c0[_0x44b8('0x3c')],[_0x44b8('0x67'),'id'])||{})[_0x44b8('0x78')](function(_0x156a60){for(var _0x3cbec9=0x0;_0x3cbec9<_0x5596c0[_0x44b8('0x3c')]['ids'][_0x44b8('0x37')];_0x3cbec9+=0x1){socket['emit'](_0x44b8('0x79'),{'UserId':Number(_0x5596c0[_0x44b8('0x3c')]['ids'][_0x3cbec9]),'VoiceQueueId':Number(_0x5596c0[_0x44b8('0x2f')]['id'])});}return _0x156a60;});}})['then'](function(_0x42b0c9){_0x18cd30=_0x42b0c9||[];if(_0x133da8){return db[_0x44b8('0x58')][_0x44b8('0x2b')]({'where':{'id':_0x5596c0['body'][_0x44b8('0x67')]},'attributes':['id',_0x44b8('0x21'),'online',_0x44b8('0x5a'),'interface'],'raw':!![]});}})['then'](function(_0x4220b5){if(!_['isEmpty'](_0x4220b5)){var _0x336436=[];for(var _0x51add5=0x0;_0x51add5<_0x4220b5[_0x44b8('0x37')];_0x51add5++){if(_0x4220b5[_0x51add5][_0x44b8('0x7a')]){_0x336436['push'](db[_0x44b8('0x62')][_0x44b8('0x63')]({'membername':_0x4220b5[_0x51add5]['name'],'UserId':_0x4220b5[_0x51add5]['id'],'queue_name':_0x133da8['name'],'VoiceQueueId':_0x133da8['id'],'interface':_[_0x44b8('0x7b')](_0x4220b5[_0x51add5][_0x44b8('0x5b')])?util[_0x44b8('0x64')](_0x44b8('0x65'),_0x4220b5[_0x51add5]['name']):_0x4220b5[_0x51add5][_0x44b8('0x5b')],'paused':_0x4220b5[_0x51add5][_0x44b8('0x5a')]||![],'penalty':_0x5596c0[_0x44b8('0x3c')][_0x44b8('0x5d')]||0x0}));}}return BPromise['all'](_0x336436);}})['then'](function(){return _0x18cd30;})[_0x44b8('0x13')](respondWithResult(_0x4b2b8f,null))[_0x44b8('0x2d')](handleError(_0x4b2b8f,null));};exports[_0x44b8('0x76')]=function(_0x4cf4a0,_0x1443bd){return db[_0x44b8('0x29')]['find']({'where':{'id':_0x4cf4a0[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x1443bd,null))[_0x44b8('0x13')](function(_0x2cb698){if(_0x2cb698){return _0x2cb698[_0x44b8('0x76')](_0x4cf4a0[_0x44b8('0x32')]['ids'])['then'](function(){if(_[_0x44b8('0x7c')](_0x4cf4a0['query'][_0x44b8('0x67')])){for(var _0x4dc333=0x0;_0x4dc333<_0x4cf4a0[_0x44b8('0x32')][_0x44b8('0x67')][_0x44b8('0x37')];_0x4dc333+=0x1){socket[_0x44b8('0x66')](_0x44b8('0x7d'),{'UserId':Number(_0x4cf4a0[_0x44b8('0x32')][_0x44b8('0x67')][_0x4dc333]),'VoiceQueueId':Number(_0x4cf4a0[_0x44b8('0x2f')]['id'])});}}else{socket[_0x44b8('0x66')](_0x44b8('0x7d'),{'UserId':Number(_0x4cf4a0[_0x44b8('0x32')][_0x44b8('0x67')]),'VoiceQueueId':Number(_0x4cf4a0[_0x44b8('0x2f')]['id'])});}});}})[_0x44b8('0x13')](function(_0x4026d7){return db[_0x44b8('0x62')]['destroy']({'where':{'VoiceQueueId':_0x4cf4a0[_0x44b8('0x2f')]['id'],'UserId':_0x4cf4a0['query'][_0x44b8('0x67')]}})[_0x44b8('0x13')](function(){return _0x4026d7;});})[_0x44b8('0x13')](respondWithStatusCode(_0x1443bd,null))[_0x44b8('0x2d')](handleError(_0x1443bd,null));};exports[_0x44b8('0x7e')]=function(_0x22e5ae,_0x2f3340){var _0x4d98de={};var _0x597139={};var _0x2fffd5;var _0x3c90c2;return db[_0x44b8('0x29')][_0x44b8('0x49')]({'where':{'id':_0x22e5ae[_0x44b8('0x2f')]['id']}})['then'](handleEntityNotFound(_0x2f3340,null))[_0x44b8('0x13')](function(_0x208c53){if(_0x208c53){_0x2fffd5=_0x208c53;_0x597139[_0x44b8('0x30')]=_[_0x44b8('0x31')](db[_0x44b8('0x58')][_0x44b8('0x24')]);_0x597139['query']=_[_0x44b8('0x31')](_0x22e5ae[_0x44b8('0x32')]);_0x597139[_0x44b8('0x33')]=_[_0x44b8('0x34')](_0x597139[_0x44b8('0x30')],_0x597139['query']);_0x4d98de['attributes']=_[_0x44b8('0x34')](_0x597139[_0x44b8('0x30')],qs['fields'](_0x22e5ae['query'][_0x44b8('0x36')]));_0x4d98de['attributes']=_0x4d98de[_0x44b8('0x35')][_0x44b8('0x37')]?_0x4d98de[_0x44b8('0x35')]:_0x597139[_0x44b8('0x30')];_0x4d98de[_0x44b8('0x4c')]=qs[_0x44b8('0x4d')](_0x22e5ae[_0x44b8('0x32')][_0x44b8('0x4d')]);_0x4d98de['where']=qs[_0x44b8('0x33')](_[_0x44b8('0x51')](_0x22e5ae[_0x44b8('0x32')],_0x597139['filters']));if(_0x22e5ae[_0x44b8('0x32')][_0x44b8('0x19')]){_0x4d98de['where']=_['merge'](_0x4d98de['where'],{'$or':_['map'](_0x4d98de[_0x44b8('0x35')],function(_0x5e423c){var _0x48065d={};_0x48065d[_0x5e423c]={'$like':'%'+_0x22e5ae[_0x44b8('0x32')][_0x44b8('0x19')]+'%'};return _0x48065d;})});}_0x4d98de=_[_0x44b8('0x39')]({},_0x4d98de,_0x22e5ae['options']);return _0x2fffd5[_0x44b8('0x7e')](_0x4d98de);}})['then'](function(_0x230407){if(_0x230407){_0x3c90c2=_0x230407[_0x44b8('0x37')];if(!_0x22e5ae[_0x44b8('0x32')][_0x44b8('0x4a')]('nolimit')){_0x4d98de[_0x44b8('0x10')]=qs[_0x44b8('0x10')](_0x22e5ae[_0x44b8('0x32')][_0x44b8('0x10')]);_0x4d98de['offset']=qs['offset'](_0x22e5ae[_0x44b8('0x32')][_0x44b8('0xf')]);}return _0x2fffd5['getAgents'](_0x4d98de);}})[_0x44b8('0x13')](function(_0x188744){if(_0x188744){return _0x188744?{'count':_0x3c90c2,'rows':_0x188744}:null;}})[_0x44b8('0x13')](respondWithResult(_0x2f3340,null))[_0x44b8('0x2d')](handleError(_0x2f3340,null));};exports[_0x44b8('0x7f')]=function(_0x2da727,_0x319520){var _0x2f7550={};var _0x57d24f={};var _0x223e54;var _0x3e5fa8;return db[_0x44b8('0x29')]['findOne']({'where':{'id':_0x2da727[_0x44b8('0x2f')]['id']}})['then'](handleEntityNotFound(_0x319520,null))[_0x44b8('0x13')](function(_0x5370a5){if(_0x5370a5){_0x223e54=_0x5370a5;_0x57d24f[_0x44b8('0x30')]=_[_0x44b8('0x31')](db[_0x44b8('0x62')][_0x44b8('0x24')]);_0x57d24f[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x2da727[_0x44b8('0x32')]);_0x57d24f[_0x44b8('0x33')]=_[_0x44b8('0x34')](_0x57d24f[_0x44b8('0x30')],_0x57d24f[_0x44b8('0x32')]);_0x2f7550[_0x44b8('0x35')]=_['intersection'](_0x57d24f[_0x44b8('0x30')],qs['fields'](_0x2da727[_0x44b8('0x32')]['fields']));_0x2f7550[_0x44b8('0x35')]=_0x2f7550[_0x44b8('0x35')][_0x44b8('0x37')]?_0x2f7550[_0x44b8('0x35')]:_0x57d24f[_0x44b8('0x30')];_0x2f7550[_0x44b8('0x4c')]=qs[_0x44b8('0x4d')](_0x2da727['query'][_0x44b8('0x4d')]);_0x2f7550[_0x44b8('0x28')]=qs[_0x44b8('0x33')](_[_0x44b8('0x51')](_0x2da727[_0x44b8('0x32')],_0x57d24f[_0x44b8('0x33')]));if(_0x2da727[_0x44b8('0x32')][_0x44b8('0x19')]){_0x2f7550[_0x44b8('0x28')]=_[_0x44b8('0x39')](_0x2f7550[_0x44b8('0x28')],{'$or':_[_0x44b8('0x1b')](_0x2f7550[_0x44b8('0x35')],function(_0x4281a6){var _0x4bb399={};_0x4bb399[_0x4281a6]={'$like':'%'+_0x2da727[_0x44b8('0x32')][_0x44b8('0x19')]+'%'};return _0x4bb399;})});}_0x2f7550=_['merge']({},_0x2f7550,_0x2da727[_0x44b8('0x3a')]);return _0x223e54[_0x44b8('0x7f')](_0x2f7550);}})[_0x44b8('0x13')](function(_0x1f389e){if(_0x1f389e){_0x3e5fa8=_0x1f389e[_0x44b8('0x37')];if(!_0x2da727['query'][_0x44b8('0x4a')](_0x44b8('0x4b'))){_0x2f7550[_0x44b8('0x10')]=qs[_0x44b8('0x10')](_0x2da727['query'][_0x44b8('0x10')]);_0x2f7550[_0x44b8('0xf')]=qs['offset'](_0x2da727['query']['offset']);}return _0x223e54['getMembers'](_0x2f7550);}})[_0x44b8('0x13')](function(_0x5824a8){return _0x5824a8?{'count':_0x3e5fa8,'rows':_0x5824a8}:null;})['then'](respondWithResult(_0x319520,null))[_0x44b8('0x2d')](handleError(_0x319520,null));};exports[_0x44b8('0x80')]=function(_0x87a38,_0x54adf9){var _0x44dc3d={};var _0x32dafb={};var _0x3c8e0c;var _0x21ea61;return db['VoiceQueue'][_0x44b8('0x49')]({'where':{'id':_0x87a38['params']['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x54adf9,null))[_0x44b8('0x13')](function(_0x56cfa5){if(_0x56cfa5){_0x3c8e0c=_0x56cfa5;_0x32dafb[_0x44b8('0x30')]=_[_0x44b8('0x31')](db[_0x44b8('0x81')][_0x44b8('0x24')]);_0x32dafb[_0x44b8('0x32')]=_['keys'](_0x87a38['query']);_0x32dafb[_0x44b8('0x33')]=_[_0x44b8('0x34')](_0x32dafb[_0x44b8('0x30')],_0x32dafb[_0x44b8('0x32')]);_0x44dc3d[_0x44b8('0x35')]=_[_0x44b8('0x34')](_0x32dafb[_0x44b8('0x30')],qs[_0x44b8('0x36')](_0x87a38[_0x44b8('0x32')][_0x44b8('0x36')]));_0x44dc3d[_0x44b8('0x35')]=_0x44dc3d[_0x44b8('0x35')]['length']?_0x44dc3d['attributes']:_0x32dafb[_0x44b8('0x30')];_0x44dc3d['order']=qs[_0x44b8('0x4d')](_0x87a38[_0x44b8('0x32')][_0x44b8('0x4d')]);_0x44dc3d['where']=qs[_0x44b8('0x33')](_[_0x44b8('0x51')](_0x87a38[_0x44b8('0x32')],_0x32dafb[_0x44b8('0x33')]));if(_0x87a38[_0x44b8('0x32')][_0x44b8('0x19')]){_0x44dc3d['where']=_[_0x44b8('0x39')](_0x44dc3d[_0x44b8('0x28')],{'$or':_['map'](_0x44dc3d[_0x44b8('0x35')],function(_0x1ffa05){var _0x22edd7={};_0x22edd7[_0x1ffa05]={'$like':'%'+_0x87a38[_0x44b8('0x32')][_0x44b8('0x19')]+'%'};return _0x22edd7;})});}_0x44dc3d=_['merge']({},_0x44dc3d,_0x87a38[_0x44b8('0x3a')]);return _0x3c8e0c[_0x44b8('0x80')](_0x44dc3d);}})[_0x44b8('0x13')](function(_0x2fca1a){if(_0x2fca1a){_0x21ea61=_0x2fca1a[_0x44b8('0x37')];if(!_0x87a38[_0x44b8('0x32')][_0x44b8('0x4a')](_0x44b8('0x4b'))){_0x44dc3d[_0x44b8('0x10')]=qs[_0x44b8('0x10')](_0x87a38['query'][_0x44b8('0x10')]);_0x44dc3d[_0x44b8('0xf')]=qs[_0x44b8('0xf')](_0x87a38['query']['offset']);}return _0x3c8e0c[_0x44b8('0x80')](_0x44dc3d);}})['then'](function(_0x9458fb){if(_0x9458fb){return _0x9458fb?{'count':_0x21ea61,'rows':_0x9458fb}:null;}})[_0x44b8('0x13')](respondWithResult(_0x54adf9,null))[_0x44b8('0x2d')](handleError(_0x54adf9,null));};exports[_0x44b8('0x82')]=function(_0x2eb6ce,_0x105ca0){var _0x25f364=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x77c009,_0x161362;return db[_0x44b8('0x29')][_0x44b8('0x1e')]({'where':{'id':_0x2eb6ce[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x105ca0,null))['then'](function(_0x4d88a6){if(_0x4d88a6){_0x161362=_0x4d88a6;return _0x4d88a6[_0x44b8('0x82')](_0x2eb6ce[_0x44b8('0x3c')][_0x44b8('0x67')],_[_0x44b8('0x45')](_0x2eb6ce[_0x44b8('0x3c')],[_0x44b8('0x67'),'id'])||{});}return null;})[_0x44b8('0x78')](function(_0x4b49df){var _0xbf96c1;_0x77c009=_0x4b49df||[];var _0x1f6244=[];if(_0x4b49df){for(var _0x96a3cd=0x0;_0x96a3cd<_0x4b49df['length'];_0x96a3cd+=0x1){var _0x16721d=_0x4b49df[_0x96a3cd][_0x44b8('0x14')]({'plain':!![]});_0x161362[_0x44b8('0x83')]=_0x2eb6ce[_0x44b8('0x3c')]['dialCheckDuplicateType']?_0x2eb6ce[_0x44b8('0x3c')][_0x44b8('0x83')]:_0x161362[_0x44b8('0x83')];switch(_0x161362['dialCheckDuplicateType']){case'always':_0xbf96c1=squel['insert']()['into']('cm_hopper')[_0x44b8('0x84')]([_0x44b8('0x85'),_0x44b8('0x86'),_0x44b8('0x87'),_0x44b8('0x88'),_0x44b8('0x4e'),_0x44b8('0x46'),_0x44b8('0x47')],squel[_0x44b8('0x89')]()[_0x44b8('0x68')](_0x44b8('0x85'),'phone')[_0x44b8('0x68')]('\x27'+_0x25f364+'\x27',_0x44b8('0x86'))[_0x44b8('0x68')]('id',_0x44b8('0x87'))[_0x44b8('0x68')](_0x16721d['CmListId'][_0x44b8('0x6f')](),'ListId')[_0x44b8('0x68')](_0x2eb6ce[_0x44b8('0x2f')]['id'][_0x44b8('0x6f')](),'VoiceQueueId')[_0x44b8('0x68')]('\x27'+_0x25f364+'\x27',_0x44b8('0x46'))['field']('\x27'+_0x25f364+'\x27',_0x44b8('0x47'))[_0x44b8('0x69')](_0x44b8('0x8a'))['where'](_0x44b8('0x8b'))['where'](_0x44b8('0x8c'),_0x16721d[_0x44b8('0x8d')][_0x44b8('0x6f')]())['where'](_0x44b8('0x8e'))['where'](_0x44b8('0x8f'),squel[_0x44b8('0x89')]()[_0x44b8('0x68')](_0x44b8('0x90'))[_0x44b8('0x69')](_0x44b8('0x91'))['where'](_0x44b8('0x6c'),_0x2eb6ce[_0x44b8('0x2f')]['id'][_0x44b8('0x6f')]()))[_0x44b8('0x28')]('phone\x20NOT\x20IN\x20(?)',squel[_0x44b8('0x89')]()[_0x44b8('0x68')](_0x44b8('0x92'))[_0x44b8('0x69')](_0x44b8('0x93'))[_0x44b8('0x28')](_0x44b8('0x6c'),_0x2eb6ce[_0x44b8('0x2f')]['id'][_0x44b8('0x6f')]())))[_0x44b8('0x6f')]();break;case _0x44b8('0x94'):_0xbf96c1=squel[_0x44b8('0x95')]()['into'](_0x44b8('0x93'))[_0x44b8('0x84')]([_0x44b8('0x85'),_0x44b8('0x86'),'ContactId',_0x44b8('0x88'),'VoiceQueueId',_0x44b8('0x46'),_0x44b8('0x47')],squel[_0x44b8('0x89')]()['field'](_0x44b8('0x85'),_0x44b8('0x85'))[_0x44b8('0x68')]('\x27'+_0x25f364+'\x27',_0x44b8('0x86'))[_0x44b8('0x68')]('id','ContactId')[_0x44b8('0x68')](_0x16721d[_0x44b8('0x8d')][_0x44b8('0x6f')](),_0x44b8('0x88'))[_0x44b8('0x68')](_0x2eb6ce['params']['id'][_0x44b8('0x6f')](),_0x44b8('0x4e'))[_0x44b8('0x68')]('\x27'+_0x25f364+'\x27',_0x44b8('0x46'))[_0x44b8('0x68')]('\x27'+_0x25f364+'\x27',_0x44b8('0x47'))[_0x44b8('0x69')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x44b8('0x28')](_0x44b8('0x8c'),_0x16721d[_0x44b8('0x8d')]['toString']())['where'](_0x44b8('0x8e'))[_0x44b8('0x28')](_0x44b8('0x8f'),squel[_0x44b8('0x89')]()[_0x44b8('0x68')]('COALESCE(phone,\x27\x27)')['from']('cm_hopper')['where'](_0x44b8('0x6c'),_0x2eb6ce[_0x44b8('0x2f')]['id'][_0x44b8('0x6f')]())))[_0x44b8('0x6f')]();break;default:_0xbf96c1=squel[_0x44b8('0x95')]()[_0x44b8('0x96')]('cm_hopper')[_0x44b8('0x84')](['phone',_0x44b8('0x86'),_0x44b8('0x87'),_0x44b8('0x88'),'VoiceQueueId','createdAt',_0x44b8('0x47')],squel[_0x44b8('0x89')]()['field']('phone',_0x44b8('0x85'))[_0x44b8('0x68')]('\x27'+_0x25f364+'\x27',_0x44b8('0x86'))[_0x44b8('0x68')]('id',_0x44b8('0x87'))['field'](_0x16721d[_0x44b8('0x8d')][_0x44b8('0x6f')](),_0x44b8('0x88'))[_0x44b8('0x68')](_0x2eb6ce[_0x44b8('0x2f')]['id'][_0x44b8('0x6f')](),_0x44b8('0x4e'))['field']('\x27'+_0x25f364+'\x27',_0x44b8('0x46'))[_0x44b8('0x68')]('\x27'+_0x25f364+'\x27',_0x44b8('0x47'))[_0x44b8('0x69')](_0x44b8('0x8a'))[_0x44b8('0x28')]('deletedAt\x20IS\x20NULL')[_0x44b8('0x28')](_0x44b8('0x8c'),_0x16721d[_0x44b8('0x8d')][_0x44b8('0x6f')]())['where'](_0x44b8('0x8e')))[_0x44b8('0x6f')]();}_0x1f6244[_0x44b8('0x6e')](db[_0x44b8('0x70')]['query'](_0xbf96c1));}return BPromise['all'](_0x1f6244);}})[_0x44b8('0x13')](function(){var _0x2ad4ab=[];var _0x196b4b=squel[_0x44b8('0x95')]()[_0x44b8('0x96')]('cm_hopper_additional_phones')[_0x44b8('0x84')]([_0x44b8('0x97'),_0x44b8('0x85'),_0x44b8('0x98'),_0x44b8('0x46'),_0x44b8('0x47')],squel['select']()[_0x44b8('0x68')](_0x44b8('0x99'))[_0x44b8('0x68')](_0x44b8('0x9a'))[_0x44b8('0x68')](_0x44b8('0x9b'))[_0x44b8('0x68')]('\x27'+_0x25f364+'\x27','createdAt')[_0x44b8('0x68')]('\x27'+_0x25f364+'\x27',_0x44b8('0x47'))[_0x44b8('0x69')](_0x44b8('0x9c'),'ci')['join'](_0x44b8('0x93'),'h','h.ContactId=ci.CmContactId')[_0x44b8('0x28')](_0x44b8('0x9d'),_0x25f364)[_0x44b8('0x28')](_0x44b8('0x9e'),'PHONE'))[_0x44b8('0x6f')]();_0x2ad4ab[_0x44b8('0x6e')](db[_0x44b8('0x70')]['query'](_0x196b4b));return BPromise[_0x44b8('0x73')](_0x2ad4ab);})[_0x44b8('0x13')](function(){return _0x77c009;})[_0x44b8('0x13')](respondWithResult(_0x105ca0,null))[_0x44b8('0x2d')](handleError(_0x105ca0,null));};exports[_0x44b8('0x9f')]=function(_0x257702,_0x17560c){return db[_0x44b8('0x29')][_0x44b8('0x1e')]({'where':{'id':_0x257702[_0x44b8('0x2f')]['id']}})['then'](handleEntityNotFound(_0x17560c,null))[_0x44b8('0x13')](function(_0x4d11d5){if(_0x4d11d5){return _0x4d11d5[_0x44b8('0x9f')](_0x257702[_0x44b8('0x32')][_0x44b8('0x67')]);}})[_0x44b8('0x13')](function(_0xafca17){if(_0xafca17){return db['CmHopper']['destroy']({'where':{'ListId':_0x257702['query'][_0x44b8('0x67')],'VoiceQueueId':_0x257702[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](function(){return _0xafca17;});}})[_0x44b8('0x13')](respondWithStatusCode(_0x17560c,null))[_0x44b8('0x2d')](handleError(_0x17560c,null));};exports[_0x44b8('0xa0')]=function(_0x513302,_0xfdb408){var _0x119dda={};var _0x5834fe={};var _0xe5cc1e;var _0x4c55e6;return db[_0x44b8('0x29')][_0x44b8('0x49')]({'where':{'id':_0x513302['params']['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0xfdb408,null))[_0x44b8('0x13')](function(_0x537eab){if(_0x537eab){_0xe5cc1e=_0x537eab;_0x5834fe[_0x44b8('0x30')]=_[_0x44b8('0x31')](db[_0x44b8('0x81')][_0x44b8('0x24')]);_0x5834fe['query']=_[_0x44b8('0x31')](_0x513302[_0x44b8('0x32')]);_0x5834fe[_0x44b8('0x33')]=_[_0x44b8('0x34')](_0x5834fe[_0x44b8('0x30')],_0x5834fe[_0x44b8('0x32')]);_0x119dda[_0x44b8('0x35')]=_['intersection'](_0x5834fe[_0x44b8('0x30')],qs[_0x44b8('0x36')](_0x513302[_0x44b8('0x32')]['fields']));_0x119dda[_0x44b8('0x35')]=_0x119dda[_0x44b8('0x35')]['length']?_0x119dda[_0x44b8('0x35')]:_0x5834fe[_0x44b8('0x30')];_0x119dda[_0x44b8('0x4c')]=qs[_0x44b8('0x4d')](_0x513302['query'][_0x44b8('0x4d')]);_0x119dda[_0x44b8('0x28')]=qs[_0x44b8('0x33')](_[_0x44b8('0x51')](_0x513302[_0x44b8('0x32')],_0x5834fe['filters']));if(_0x513302[_0x44b8('0x32')][_0x44b8('0x19')]){_0x119dda['where']=_[_0x44b8('0x39')](_0x119dda[_0x44b8('0x28')],{'$or':_[_0x44b8('0x1b')](_0x119dda[_0x44b8('0x35')],function(_0x4e9376){var _0x25f31c={};_0x25f31c[_0x4e9376]={'$like':'%'+_0x513302[_0x44b8('0x32')][_0x44b8('0x19')]+'%'};return _0x25f31c;})});}_0x119dda=_[_0x44b8('0x39')]({},_0x119dda,_0x513302[_0x44b8('0x3a')]);return _0xe5cc1e[_0x44b8('0xa0')](_0x119dda);}})[_0x44b8('0x13')](function(_0x57e3c9){if(_0x57e3c9){_0x4c55e6=_0x57e3c9[_0x44b8('0x37')];if(!_0x513302[_0x44b8('0x32')][_0x44b8('0x4a')](_0x44b8('0x4b'))){_0x119dda['limit']=qs[_0x44b8('0x10')](_0x513302[_0x44b8('0x32')][_0x44b8('0x10')]);_0x119dda['offset']=qs['offset'](_0x513302[_0x44b8('0x32')][_0x44b8('0xf')]);}return _0xe5cc1e[_0x44b8('0xa0')](_0x119dda);}})[_0x44b8('0x13')](function(_0x4a5916){if(_0x4a5916){return _0x4a5916?{'count':_0x4c55e6,'rows':_0x4a5916}:null;}})[_0x44b8('0x13')](respondWithResult(_0xfdb408,null))[_0x44b8('0x2d')](handleError(_0xfdb408,null));};exports['addBlackLists']=function(_0xd19a35,_0x2439f2){var _0x22a624;return db['VoiceQueue'][_0x44b8('0x1e')]({'where':{'id':_0xd19a35[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x2439f2,null))[_0x44b8('0x13')](function(_0x14c021){if(_0x14c021){return _0x14c021['addBlackLists'](_0xd19a35[_0x44b8('0x3c')][_0x44b8('0x67')],_['omit'](_0xd19a35[_0x44b8('0x3c')],[_0x44b8('0x67'),'id'])||{});}return null;})[_0x44b8('0x78')](function(_0x3b9cd2){var _0xb6cadf;_0x22a624=_0x3b9cd2||[];var _0x2024eb=[];if(_0x3b9cd2){for(var _0x29af58=0x0;_0x29af58<_0x3b9cd2[_0x44b8('0x37')];_0x29af58+=0x1){var _0x3870a9=_0x3b9cd2[_0x29af58]['get']({'plain':!![]});_0xb6cadf=squel['insert']()['into']('cm_hopper_black')[_0x44b8('0x84')]([_0x44b8('0x85'),'ContactId',_0x44b8('0x88'),_0x44b8('0x4e'),_0x44b8('0x46'),_0x44b8('0x47')],squel[_0x44b8('0x89')]()[_0x44b8('0x68')]('phone',_0x44b8('0x85'))['field']('id','ContactId')[_0x44b8('0x68')](_0x3870a9[_0x44b8('0x8d')][_0x44b8('0x6f')](),_0x44b8('0x88'))[_0x44b8('0x68')](_0xd19a35['params']['id'][_0x44b8('0x6f')](),_0x44b8('0x4e'))[_0x44b8('0x68')](_0x44b8('0xa1'),_0x44b8('0x46'))[_0x44b8('0x68')](_0x44b8('0xa1'),'updatedAt')[_0x44b8('0x69')](_0x44b8('0x8a'))[_0x44b8('0x28')]('deletedAt\x20IS\x20NULL')[_0x44b8('0x28')](_0x44b8('0x8c'),_0x3870a9[_0x44b8('0x8d')][_0x44b8('0x6f')]())[_0x44b8('0x28')](_0x44b8('0x8e')))[_0x44b8('0x6f')]();_0x2024eb[_0x44b8('0x6e')](db['sequelize'][_0x44b8('0x32')](_0xb6cadf));}return BPromise[_0x44b8('0x73')](_0x2024eb);}})[_0x44b8('0x13')](function(){return _0x22a624;})[_0x44b8('0x13')](respondWithResult(_0x2439f2,null))[_0x44b8('0x2d')](handleError(_0x2439f2,null));};exports[_0x44b8('0xa2')]=function(_0x4ec799,_0x3fa943){return db[_0x44b8('0x29')]['find']({'where':{'id':_0x4ec799[_0x44b8('0x2f')]['id']}})[_0x44b8('0x13')](handleEntityNotFound(_0x3fa943,null))[_0x44b8('0x13')](function(_0x3b1643){if(_0x3b1643){return _0x3b1643['removeBlackLists'](_0x4ec799[_0x44b8('0x32')]['ids']);}})['then'](function(_0x9a5734){if(_0x9a5734){return db[_0x44b8('0x54')][_0x44b8('0x12')]({'where':{'ListId':_0x4ec799[_0x44b8('0x32')][_0x44b8('0x67')],'VoiceQueueId':_0x4ec799['params']['id']}})['then'](function(){return _0x9a5734;});}})['then'](respondWithStatusCode(_0x3fa943,null))[_0x44b8('0x2d')](handleError(_0x3fa943,null));}; \ No newline at end of file +var _0x008c=['deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','cm_hopper','onlyIfOpen','into','fromQuery','COALESCE(phone,\x27\x27)','all','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','join','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','moment','bluebird','util','lodash','squel','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','register','sendStatus','json','offset','undefined','count','set','Content-Range','then','inbound','map','value','includes','type','UserProfileResource','destroy','status','send','index','VoiceQueue','rawAttributes','key','getOptions','where','include','query','findAll','rows','catch','show','params','keys','filters','model','intersection','fields','attributes','includeAll','merge','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','VoiceQueues','QueueCampaigns','outbound','name','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','body','createdAt','updatedAt','autoAssociation','getHoppers','findOne','CmHopper','length','hasOwnProperty','nolimit','limit','sort','pick','VoiceQueueId','filter','getHopperHistories','CmHopperHistory','order','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','addTeams','teams','Agents','online','voicePause','flatMap','forEach','penalty','sequelize','transaction','each','TeamVoiceQueue','UserVoiceQueue','findOrCreate','upsert','isNil','interface','format','SIP/%s','userVoiceQueue:save','removeTeams','ids','User','select','tq.TeamId','from','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','TeamId','union','compact','removeAgents','userVoiceQueue:remove','addAgents','spread','emit','isEmpty','UserVoiceQueueRt','isArray','getAgents','getMembers','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','insert','phone','scheduledAt','ContactId','ListId','field','CmListId','toString','cm_contacts'];(function(_0x55c172,_0x3e9218){var _0x2a6b80=function(_0x24b307){while(--_0x24b307){_0x55c172['push'](_0x55c172['shift']());}};_0x2a6b80(++_0x3e9218);}(_0x008c,0x188));var _0xc008=function(_0x2577f7,_0x4e4781){_0x2577f7=_0x2577f7-0x0;var _0x55d372=_0x008c[_0x2577f7];return _0x55d372;};'use strict';var moment=require(_0xc008('0x0'));var BPromise=require(_0xc008('0x1'));var util=require(_0xc008('0x2'));var _=require(_0xc008('0x3'));var squel=require(_0xc008('0x4'));var Redis=require('ioredis');var qs=require(_0xc008('0x5'));var logger=require(_0xc008('0x6'))(_0xc008('0x7'));var config=require(_0xc008('0x8'));var db=require(_0xc008('0x9'))['db'];config[_0xc008('0xa')]=_[_0xc008('0xb')](config[_0xc008('0xa')],{'host':_0xc008('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc008('0xa')]));require('./voiceQueue.socket')[_0xc008('0xd')](socket);function respondWithStatusCode(_0x5b64f8,_0x52041f){_0x52041f=_0x52041f||0xcc;return function(_0x27830d){if(_0x27830d){return _0x5b64f8[_0xc008('0xe')](_0x52041f);}return _0x5b64f8['status'](_0x52041f)['end']();};}function respondWithResult(_0x543eb8,_0x1eacfa){_0x1eacfa=_0x1eacfa||0xc8;return function(_0xc881aa){if(_0xc881aa){return _0x543eb8['status'](_0x1eacfa)[_0xc008('0xf')](_0xc881aa);}};}function respondWithFilteredResult(_0x332fd4,_0x2ea200){return function(_0x2a5b4e){if(_0x2a5b4e){var _0x9ffa93=typeof _0x2ea200[_0xc008('0x10')]===_0xc008('0x11')&&typeof _0x2ea200['limit']==='undefined';var _0x33f44c=_0x2a5b4e['count'];var _0x25e13f=_0x9ffa93?0x0:_0x2ea200[_0xc008('0x10')];var _0x2073ef=_0x9ffa93?_0x2a5b4e[_0xc008('0x12')]:_0x2ea200[_0xc008('0x10')]+_0x2ea200['limit'];var _0x5e894e;if(_0x2073ef>=_0x33f44c){_0x2073ef=_0x33f44c;_0x5e894e=0xc8;}else{_0x5e894e=0xce;}_0x332fd4['status'](_0x5e894e);return _0x332fd4[_0xc008('0x13')](_0xc008('0x14'),_0x25e13f+'-'+_0x2073ef+'/'+_0x33f44c)[_0xc008('0xf')](_0x2a5b4e);}return null;};}function saveUpdates(_0x3eb12a){return function(_0x4fe771){if(_0x4fe771){return _0x4fe771['update'](_0x3eb12a)['then'](function(_0x5c2668){return _0x5c2668;});}return null;};}function removeEntity(_0x46042b){return function(_0x462af5){if(_0x462af5){return _0x462af5['destroy']()[_0xc008('0x15')](function(){var _0x5906e6=_0x462af5['get']({'plain':!![]});var _0x543e5d=[{'name':'VoiceQueues','value':_0xc008('0x16'),'ignore':![]},{'name':'QueueCampaigns','value':'outbound','ignore':![]}];var _0x590a71=_(_0x543e5d)['filter']('ignore')[_0xc008('0x17')](_0xc008('0x18'))[_0xc008('0x18')]();if(_[_0xc008('0x19')](_0x590a71,_0x5906e6[_0xc008('0x1a')])){return;}var _0x110128=_['find'](_0x543e5d,[_0xc008('0x18'),_0x5906e6['type']])['name'];return db[_0xc008('0x1b')][_0xc008('0x1c')]({'where':{'type':_0x110128,'resourceId':_0x5906e6['id']}})[_0xc008('0x15')](function(){return _0x462af5;});})[_0xc008('0x15')](function(){_0x46042b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5de1e9){return function(_0x3f7b07){if(!_0x3f7b07){_0x5de1e9[_0xc008('0xe')](0x194);}return _0x3f7b07;};}function handleError(_0x92c582,_0x2e31c2){_0x2e31c2=_0x2e31c2||0x1f4;return function(_0x5bebd9){logger['error'](_0x5bebd9['stack']);if(_0x5bebd9['name']){delete _0x5bebd9['name'];}_0x92c582[_0xc008('0x1d')](_0x2e31c2)[_0xc008('0x1e')](_0x5bebd9);};}exports[_0xc008('0x1f')]=function(_0x529961,_0x24c14c){var _0x32390d={};var _0x209591={'count':0x0,'rows':[]};var _0x2a7d4f=_['map'](db[_0xc008('0x20')][_0xc008('0x21')],function(_0x53ed35){return{'name':_0x53ed35['fieldName'],'type':_0x53ed35['type'][_0xc008('0x22')]};});_0x32390d=qs[_0xc008('0x23')](_0x2a7d4f,_0x529961);var _0xf831f2={'where':_0x32390d[_0xc008('0x24')]};return db[_0xc008('0x20')][_0xc008('0x12')](_0xf831f2)[_0xc008('0x15')](function(_0x22d8e8){_0x209591[_0xc008('0x12')]=_0x22d8e8;_0x32390d[_0xc008('0x25')]=qs[_0xc008('0x25')](_0x529961[_0xc008('0x26')]);return db['VoiceQueue'][_0xc008('0x27')](_0x32390d);})[_0xc008('0x15')](function(_0x499754){_0x209591[_0xc008('0x28')]=_0x499754;return _0x209591;})[_0xc008('0x15')](respondWithFilteredResult(_0x24c14c,_0x32390d))[_0xc008('0x29')](handleError(_0x24c14c,null));};exports[_0xc008('0x2a')]=function(_0xd0e05a,_0x3cd878){var _0x7cfbc5={'raw':![],'where':{'id':_0xd0e05a[_0xc008('0x2b')]['id']}},_0x470e79={};_0x470e79['model']=_[_0xc008('0x2c')](db[_0xc008('0x20')][_0xc008('0x21')]);_0x470e79[_0xc008('0x26')]=_[_0xc008('0x2c')](_0xd0e05a[_0xc008('0x26')]);_0x470e79[_0xc008('0x2d')]=_['intersection'](_0x470e79[_0xc008('0x2e')],_0x470e79[_0xc008('0x26')]);_0x7cfbc5['attributes']=_[_0xc008('0x2f')](_0x470e79[_0xc008('0x2e')],qs['fields'](_0xd0e05a[_0xc008('0x26')][_0xc008('0x30')]));_0x7cfbc5[_0xc008('0x31')]=_0x7cfbc5['attributes']['length']?_0x7cfbc5['attributes']:_0x470e79[_0xc008('0x2e')];if(_0xd0e05a['query'][_0xc008('0x32')]){_0x7cfbc5[_0xc008('0x25')]=[{'all':!![]}];}_0x7cfbc5=_[_0xc008('0x33')]({},_0x7cfbc5,_0xd0e05a[_0xc008('0x34')]);return db[_0xc008('0x20')][_0xc008('0x35')](_0x7cfbc5)[_0xc008('0x15')](handleEntityNotFound(_0x3cd878,null))[_0xc008('0x15')](respondWithResult(_0x3cd878,null))[_0xc008('0x29')](handleError(_0x3cd878,null));};exports[_0xc008('0x36')]=function(_0x3ebb83,_0xdfca2e){return db[_0xc008('0x20')][_0xc008('0x36')](_0x3ebb83['body'],{})[_0xc008('0x15')](function(_0x23c4db){var _0x30b7df=_0x3ebb83[_0xc008('0x37')]['get']({'plain':!![]});if(!_0x30b7df)throw new Error(_0xc008('0x38'));if(_0x30b7df[_0xc008('0x39')]===_0xc008('0x37')){var _0x36e7ae=_0x23c4db[_0xc008('0x3a')]({'plain':!![]});var _0x5706bb=[{'name':_0xc008('0x3b'),'value':_0xc008('0x16')},{'name':_0xc008('0x3c'),'value':_0xc008('0x3d')}];var _0x7279e8=_['find'](_0x5706bb,[_0xc008('0x18'),_0x36e7ae[_0xc008('0x1a')]])[_0xc008('0x3e')];return db[_0xc008('0x3f')]['find']({'where':{'name':_0x7279e8,'userProfileId':_0x30b7df[_0xc008('0x40')]},'raw':!![]})[_0xc008('0x15')](function(_0x351d5c){if(_0x351d5c&&_0x351d5c['autoAssociation']===0x0){return db[_0xc008('0x1b')]['create']({'name':_0x36e7ae[_0xc008('0x3e')],'resourceId':_0x36e7ae['id'],'type':_0x351d5c['name'],'sectionId':_0x351d5c['id']},{})[_0xc008('0x15')](function(){return _0x23c4db;});}else{return _0x23c4db;}})[_0xc008('0x29')](function(_0x5a5d85){logger[_0xc008('0x41')](_0xc008('0x42'),_0x5a5d85);throw _0x5a5d85;});}return _0x23c4db;})[_0xc008('0x15')](respondWithResult(_0xdfca2e,0xc9))['catch'](handleError(_0xdfca2e,null));};exports[_0xc008('0x43')]=function(_0x2a9b5c,_0x200469){var _0x44fc5d={'where':{'id':_0x2a9b5c[_0xc008('0x2b')]['id']}},_0x347629={};_0x347629['model']=_['keys'](db['VoiceQueue'][_0xc008('0x21')]);_0x44fc5d[_0xc008('0x31')]=_[_0xc008('0x2f')](_0x347629[_0xc008('0x2e')],qs[_0xc008('0x30')](_0x2a9b5c[_0xc008('0x26')][_0xc008('0x30')]));_0x44fc5d[_0xc008('0x31')]=_0x44fc5d['attributes']['length']?_0x44fc5d['attributes']:_0x347629[_0xc008('0x2e')];if(_0x2a9b5c[_0xc008('0x26')][_0xc008('0x32')]){_0x44fc5d['include']=[{'all':!![]}];}_0x44fc5d=_[_0xc008('0x33')]({},_0x44fc5d,_0x2a9b5c[_0xc008('0x34')]);return db[_0xc008('0x20')][_0xc008('0x35')](_0x44fc5d)[_0xc008('0x15')](handleEntityNotFound(_0x200469,null))[_0xc008('0x15')](function(_0x17ec90){if(_0x17ec90){var _0x405e87=_0x17ec90[_0xc008('0x3a')]({'plain':!![]});_0x405e87=qs[_0xc008('0x44')](_0x405e87,['id','createdAt','updatedAt']);_0x2a9b5c[_0xc008('0x45')]=_['omit'](_0x2a9b5c[_0xc008('0x45')],['id',_0xc008('0x46'),_0xc008('0x47')]);return db['VoiceQueue'][_0xc008('0x36')](_[_0xc008('0x33')](_0x405e87,_0x2a9b5c[_0xc008('0x45')]),{'include':_0x2a9b5c[_0xc008('0x26')][_0xc008('0x32')]?[{'all':!![]}]:undefined})['then'](function(_0x3a7b3b){var _0x27b022=_0x2a9b5c['user'][_0xc008('0x3a')]({'plain':!![]});if(!_0x27b022)throw new Error(_0xc008('0x38'));if(_0x27b022['role']==='user'){var _0x2df905=_0x3a7b3b[_0xc008('0x3a')]({'plain':!![]});var _0x20947b=[{'name':_0xc008('0x3b'),'value':_0xc008('0x16')},{'name':'QueueCampaigns','value':'outbound'}];var _0x34b72a=_['find'](_0x20947b,[_0xc008('0x18'),_0x2df905[_0xc008('0x1a')]])[_0xc008('0x3e')];return db[_0xc008('0x3f')][_0xc008('0x35')]({'where':{'name':_0x34b72a,'userProfileId':_0x27b022[_0xc008('0x40')]},'raw':!![]})['then'](function(_0x2ea742){if(_0x2ea742&&_0x2ea742[_0xc008('0x48')]===0x0){return db[_0xc008('0x1b')][_0xc008('0x36')]({'name':_0x2df905[_0xc008('0x3e')],'resourceId':_0x2df905['id'],'type':_0x2ea742['name'],'sectionId':_0x2ea742['id']},{})[_0xc008('0x15')](function(){return _0x3a7b3b;});}else{return _0x3a7b3b;}})['catch'](function(_0x535e6e){logger['error'](_0xc008('0x42'),_0x535e6e);throw _0x535e6e;});}return _0x3a7b3b;});}})[_0xc008('0x15')](respondWithResult(_0x200469,0xc9))[_0xc008('0x29')](handleError(_0x200469,null));};exports['update']=function(_0x3aeeab,_0x2d8361){if(_0x3aeeab[_0xc008('0x45')]['id']){delete _0x3aeeab['body']['id'];}return db[_0xc008('0x20')][_0xc008('0x35')]({'where':{'id':_0x3aeeab[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x2d8361,null))['then'](saveUpdates(_0x3aeeab[_0xc008('0x45')],null))['then'](respondWithResult(_0x2d8361,null))[_0xc008('0x29')](handleError(_0x2d8361,null));};exports[_0xc008('0x1c')]=function(_0x2ae14e,_0x943c91){return db[_0xc008('0x20')][_0xc008('0x35')]({'where':{'id':_0x2ae14e['params']['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x943c91,null))['then'](removeEntity(_0x943c91,null))['catch'](handleError(_0x943c91,null));};exports[_0xc008('0x49')]=function(_0x30aa1e,_0x56e755){var _0xb1befa={'raw':![],'where':{}};var _0xb8ba7={};var _0x3e373e={'count':0x0,'rows':[]};return db[_0xc008('0x20')][_0xc008('0x4a')]({'where':{'id':_0x30aa1e[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x56e755,null))['then'](function(_0x16e052){if(_0x16e052){_0xb8ba7[_0xc008('0x2e')]=_[_0xc008('0x2c')](db[_0xc008('0x4b')][_0xc008('0x21')]);_0xb8ba7[_0xc008('0x26')]=_[_0xc008('0x2c')](_0x30aa1e[_0xc008('0x26')]);_0xb8ba7[_0xc008('0x2d')]=_[_0xc008('0x2f')](_0xb8ba7[_0xc008('0x2e')],_0xb8ba7[_0xc008('0x26')]);_0xb1befa[_0xc008('0x31')]=_[_0xc008('0x2f')](_0xb8ba7['model'],qs[_0xc008('0x30')](_0x30aa1e[_0xc008('0x26')][_0xc008('0x30')]));_0xb1befa['attributes']=_0xb1befa[_0xc008('0x31')][_0xc008('0x4c')]?_0xb1befa['attributes']:_0xb8ba7['model'];if(!_0x30aa1e[_0xc008('0x26')][_0xc008('0x4d')](_0xc008('0x4e'))){_0xb1befa[_0xc008('0x4f')]=qs[_0xc008('0x4f')](_0x30aa1e[_0xc008('0x26')][_0xc008('0x4f')]);_0xb1befa[_0xc008('0x10')]=qs[_0xc008('0x10')](_0x30aa1e[_0xc008('0x26')][_0xc008('0x10')]);}_0xb1befa['order']=qs[_0xc008('0x50')](_0x30aa1e[_0xc008('0x26')][_0xc008('0x50')]);_0xb1befa[_0xc008('0x24')]=qs['filters'](_[_0xc008('0x51')](_0x30aa1e['query'],_0xb8ba7[_0xc008('0x2d')]));_0xb1befa[_0xc008('0x24')][_0xc008('0x52')]=_0x16e052['id'];if(_0x30aa1e['query'][_0xc008('0x53')]){_0xb1befa[_0xc008('0x24')]=_[_0xc008('0x33')](_0xb1befa['where'],{'$or':_[_0xc008('0x17')](_0xb1befa['attributes'],function(_0x50ee03){var _0xee7a85={};_0xee7a85[_0x50ee03]={'$like':'%'+_0x30aa1e[_0xc008('0x26')][_0xc008('0x53')]+'%'};return _0xee7a85;})});}_0xb1befa=_[_0xc008('0x33')]({},_0xb1befa,_0x30aa1e['options']);return db[_0xc008('0x4b')][_0xc008('0x12')]({'where':_0xb1befa['where']})[_0xc008('0x15')](function(_0x5233bb){_0x3e373e[_0xc008('0x12')]=_0x5233bb;if(_0x30aa1e['query'][_0xc008('0x32')]){_0xb1befa['include']=[{'all':!![]}];}return db[_0xc008('0x4b')][_0xc008('0x27')](_0xb1befa);})[_0xc008('0x15')](function(_0x47337b){_0x3e373e['rows']=_0x47337b;return _0x3e373e;});}})[_0xc008('0x15')](respondWithFilteredResult(_0x56e755,_0xb1befa))[_0xc008('0x29')](handleError(_0x56e755,null));};exports[_0xc008('0x54')]=function(_0x1d49db,_0x321500){var _0x13ef78={'raw':!![],'where':{}};var _0xd9e3fd={};var _0x3b46e4={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xc008('0x4a')]({'where':{'id':_0x1d49db['params']['id']}})['then'](handleEntityNotFound(_0x321500,null))['then'](function(_0x406ead){if(_0x406ead){_0xd9e3fd[_0xc008('0x2e')]=_[_0xc008('0x2c')](db[_0xc008('0x55')][_0xc008('0x21')]);_0xd9e3fd[_0xc008('0x26')]=_[_0xc008('0x2c')](_0x1d49db[_0xc008('0x26')]);_0xd9e3fd[_0xc008('0x2d')]=_['intersection'](_0xd9e3fd[_0xc008('0x2e')],_0xd9e3fd[_0xc008('0x26')]);_0x13ef78[_0xc008('0x31')]=_[_0xc008('0x2f')](_0xd9e3fd[_0xc008('0x2e')],qs[_0xc008('0x30')](_0x1d49db[_0xc008('0x26')][_0xc008('0x30')]));_0x13ef78[_0xc008('0x31')]=_0x13ef78[_0xc008('0x31')][_0xc008('0x4c')]?_0x13ef78[_0xc008('0x31')]:_0xd9e3fd['model'];if(!_0x1d49db['query'][_0xc008('0x4d')](_0xc008('0x4e'))){_0x13ef78[_0xc008('0x4f')]=qs['limit'](_0x1d49db[_0xc008('0x26')][_0xc008('0x4f')]);_0x13ef78['offset']=qs['offset'](_0x1d49db['query'][_0xc008('0x10')]);}_0x13ef78[_0xc008('0x56')]=qs[_0xc008('0x50')](_0x1d49db[_0xc008('0x26')][_0xc008('0x50')]);_0x13ef78[_0xc008('0x24')]=qs[_0xc008('0x2d')](_[_0xc008('0x51')](_0x1d49db[_0xc008('0x26')],_0xd9e3fd[_0xc008('0x2d')]));_0x13ef78['where']['VoiceQueueId']=_0x406ead['id'];if(_0x1d49db[_0xc008('0x26')][_0xc008('0x53')]){_0x13ef78[_0xc008('0x24')]=_[_0xc008('0x33')](_0x13ef78[_0xc008('0x24')],{'$or':_[_0xc008('0x17')](_0x13ef78['attributes'],function(_0x5794fe){var _0x68372f={};_0x68372f[_0x5794fe]={'$like':'%'+_0x1d49db[_0xc008('0x26')][_0xc008('0x53')]+'%'};return _0x68372f;})});}_0x13ef78=_['merge']({},_0x13ef78,_0x1d49db['options']);return db['CmHopperHistory']['count']({'where':_0x13ef78['where']})['then'](function(_0x276de2){_0x3b46e4['count']=_0x276de2;if(_0x1d49db[_0xc008('0x26')]['includeAll']){_0x13ef78[_0xc008('0x25')]=[{'all':!![]}];}return db[_0xc008('0x55')][_0xc008('0x27')](_0x13ef78);})['then'](function(_0x58f348){_0x3b46e4[_0xc008('0x28')]=_0x58f348;return _0x3b46e4;});}})['then'](respondWithFilteredResult(_0x321500,_0x13ef78))[_0xc008('0x29')](handleError(_0x321500,null));};exports[_0xc008('0x57')]=function(_0x544519,_0x7b7246){var _0x4db90b={'raw':!![],'where':{}};var _0x554cf4={};var _0x23bece={'count':0x0,'rows':[]};return db[_0xc008('0x20')]['findOne']({'where':{'id':_0x544519[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x7b7246,null))[_0xc008('0x15')](function(_0x4bd290){if(_0x4bd290){_0x554cf4[_0xc008('0x2e')]=_[_0xc008('0x2c')](db[_0xc008('0x58')][_0xc008('0x21')]);_0x554cf4[_0xc008('0x26')]=_[_0xc008('0x2c')](_0x544519['query']);_0x554cf4[_0xc008('0x2d')]=_[_0xc008('0x2f')](_0x554cf4[_0xc008('0x2e')],_0x554cf4['query']);_0x4db90b[_0xc008('0x31')]=_[_0xc008('0x2f')](_0x554cf4[_0xc008('0x2e')],qs['fields'](_0x544519['query']['fields']));_0x4db90b[_0xc008('0x31')]=_0x4db90b[_0xc008('0x31')][_0xc008('0x4c')]?_0x4db90b[_0xc008('0x31')]:_0x554cf4[_0xc008('0x2e')];if(!_0x544519[_0xc008('0x26')][_0xc008('0x4d')](_0xc008('0x4e'))){_0x4db90b['limit']=qs[_0xc008('0x4f')](_0x544519[_0xc008('0x26')]['limit']);_0x4db90b['offset']=qs[_0xc008('0x10')](_0x544519[_0xc008('0x26')][_0xc008('0x10')]);}_0x4db90b[_0xc008('0x56')]=qs[_0xc008('0x50')](_0x544519['query'][_0xc008('0x50')]);_0x4db90b[_0xc008('0x24')]=qs['filters'](_[_0xc008('0x51')](_0x544519[_0xc008('0x26')],_0x554cf4[_0xc008('0x2d')]));_0x4db90b[_0xc008('0x24')]['VoiceQueueId']=_0x4bd290['id'];if(_0x544519[_0xc008('0x26')][_0xc008('0x53')]){_0x4db90b[_0xc008('0x24')]=_[_0xc008('0x33')](_0x4db90b['where'],{'$or':_[_0xc008('0x17')](_0x4db90b[_0xc008('0x31')],function(_0x57cf19){var _0x555e8a={};_0x555e8a[_0x57cf19]={'$like':'%'+_0x544519[_0xc008('0x26')]['filter']+'%'};return _0x555e8a;})});}_0x4db90b=_[_0xc008('0x33')]({},_0x4db90b,_0x544519[_0xc008('0x34')]);return db['CmHopperFinal'][_0xc008('0x12')]({'where':_0x4db90b[_0xc008('0x24')]})[_0xc008('0x15')](function(_0xbe42a2){_0x23bece[_0xc008('0x12')]=_0xbe42a2;if(_0x544519[_0xc008('0x26')][_0xc008('0x32')]){_0x4db90b[_0xc008('0x25')]=[{'all':!![]}];}return db[_0xc008('0x58')][_0xc008('0x27')](_0x4db90b);})['then'](function(_0x49e6d5){_0x23bece[_0xc008('0x28')]=_0x49e6d5;return _0x23bece;});}})[_0xc008('0x15')](respondWithFilteredResult(_0x7b7246,_0x4db90b))['catch'](handleError(_0x7b7246,null));};exports[_0xc008('0x59')]=function(_0x1bdaa9,_0x698d5c){var _0x5f1e48={'raw':!![],'where':{}};var _0x303cdd={};var _0x38239a={'count':0x0,'rows':[]};return db[_0xc008('0x20')][_0xc008('0x4a')]({'where':{'id':_0x1bdaa9[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x698d5c,null))[_0xc008('0x15')](function(_0x5bd010){if(_0x5bd010){_0x303cdd[_0xc008('0x2e')]=_['keys'](db[_0xc008('0x5a')][_0xc008('0x21')]);_0x303cdd[_0xc008('0x26')]=_['keys'](_0x1bdaa9[_0xc008('0x26')]);_0x303cdd[_0xc008('0x2d')]=_[_0xc008('0x2f')](_0x303cdd[_0xc008('0x2e')],_0x303cdd[_0xc008('0x26')]);_0x5f1e48[_0xc008('0x31')]=_[_0xc008('0x2f')](_0x303cdd[_0xc008('0x2e')],qs[_0xc008('0x30')](_0x1bdaa9[_0xc008('0x26')]['fields']));_0x5f1e48[_0xc008('0x31')]=_0x5f1e48[_0xc008('0x31')][_0xc008('0x4c')]?_0x5f1e48[_0xc008('0x31')]:_0x303cdd[_0xc008('0x2e')];if(!_0x1bdaa9['query'][_0xc008('0x4d')](_0xc008('0x4e'))){_0x5f1e48[_0xc008('0x4f')]=qs[_0xc008('0x4f')](_0x1bdaa9[_0xc008('0x26')][_0xc008('0x4f')]);_0x5f1e48[_0xc008('0x10')]=qs[_0xc008('0x10')](_0x1bdaa9[_0xc008('0x26')][_0xc008('0x10')]);}_0x5f1e48[_0xc008('0x56')]=qs[_0xc008('0x50')](_0x1bdaa9[_0xc008('0x26')][_0xc008('0x50')]);_0x5f1e48[_0xc008('0x24')]=qs['filters'](_['pick'](_0x1bdaa9[_0xc008('0x26')],_0x303cdd[_0xc008('0x2d')]));_0x5f1e48[_0xc008('0x24')][_0xc008('0x52')]=_0x5bd010['id'];if(_0x1bdaa9[_0xc008('0x26')][_0xc008('0x53')]){_0x5f1e48[_0xc008('0x24')]=_[_0xc008('0x33')](_0x5f1e48[_0xc008('0x24')],{'$or':_['map'](_0x5f1e48[_0xc008('0x31')],function(_0x2bbadf){var _0x54fd75={};_0x54fd75[_0x2bbadf]={'$like':'%'+_0x1bdaa9[_0xc008('0x26')][_0xc008('0x53')]+'%'};return _0x54fd75;})});}_0x5f1e48=_[_0xc008('0x33')]({},_0x5f1e48,_0x1bdaa9[_0xc008('0x34')]);return db[_0xc008('0x5a')][_0xc008('0x12')]({'where':_0x5f1e48['where']})[_0xc008('0x15')](function(_0x321532){_0x38239a[_0xc008('0x12')]=_0x321532;if(_0x1bdaa9[_0xc008('0x26')]['includeAll']){_0x5f1e48[_0xc008('0x25')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xc008('0x27')](_0x5f1e48);})[_0xc008('0x15')](function(_0x5b47c3){_0x38239a[_0xc008('0x28')]=_0x5b47c3;return _0x38239a;});}})['then'](respondWithFilteredResult(_0x698d5c,_0x5f1e48))[_0xc008('0x29')](handleError(_0x698d5c,null));};exports['getTeams']=function(_0x5b387d,_0x5351f7){var _0x79dfea={};var _0x402b67={};var _0x48f40f;var _0x4fda8;return db[_0xc008('0x20')]['findOne']({'where':{'id':_0x5b387d[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x5351f7,null))[_0xc008('0x15')](function(_0x5843ee){if(_0x5843ee){_0x48f40f=_0x5843ee;_0x402b67[_0xc008('0x2e')]=_[_0xc008('0x2c')](db[_0xc008('0x5b')][_0xc008('0x21')]);_0x402b67[_0xc008('0x26')]=_[_0xc008('0x2c')](_0x5b387d[_0xc008('0x26')]);_0x402b67[_0xc008('0x2d')]=_[_0xc008('0x2f')](_0x402b67[_0xc008('0x2e')],_0x402b67[_0xc008('0x26')]);_0x79dfea['attributes']=_[_0xc008('0x2f')](_0x402b67[_0xc008('0x2e')],qs[_0xc008('0x30')](_0x5b387d['query'][_0xc008('0x30')]));_0x79dfea[_0xc008('0x31')]=_0x79dfea[_0xc008('0x31')]['length']?_0x79dfea[_0xc008('0x31')]:_0x402b67['model'];_0x79dfea[_0xc008('0x56')]=qs[_0xc008('0x50')](_0x5b387d[_0xc008('0x26')]['sort']);_0x79dfea[_0xc008('0x24')]=qs[_0xc008('0x2d')](_[_0xc008('0x51')](_0x5b387d[_0xc008('0x26')],_0x402b67[_0xc008('0x2d')]));if(_0x5b387d[_0xc008('0x26')][_0xc008('0x53')]){_0x79dfea['where']=_[_0xc008('0x33')](_0x79dfea[_0xc008('0x24')],{'$or':_[_0xc008('0x17')](_0x79dfea[_0xc008('0x31')],function(_0x5a61d6){var _0x46fba5={};_0x46fba5[_0x5a61d6]={'$like':'%'+_0x5b387d['query'][_0xc008('0x53')]+'%'};return _0x46fba5;})});}_0x79dfea=_[_0xc008('0x33')]({},_0x79dfea,_0x5b387d[_0xc008('0x34')]);return _0x48f40f[_0xc008('0x5c')](_0x79dfea);}})[_0xc008('0x15')](function(_0x9f266e){if(_0x9f266e){_0x4fda8=_0x9f266e[_0xc008('0x4c')];if(!_0x5b387d['query'][_0xc008('0x4d')](_0xc008('0x4e'))){_0x79dfea[_0xc008('0x4f')]=qs[_0xc008('0x4f')](_0x5b387d['query'][_0xc008('0x4f')]);_0x79dfea['offset']=qs[_0xc008('0x10')](_0x5b387d[_0xc008('0x26')][_0xc008('0x10')]);}return _0x48f40f['getTeams'](_0x79dfea);}})['then'](function(_0x39bfc0){if(_0x39bfc0){return _0x39bfc0?{'count':_0x4fda8,'rows':_0x39bfc0}:null;}})['then'](respondWithResult(_0x5351f7,null))[_0xc008('0x29')](handleError(_0x5351f7,null));};exports[_0xc008('0x5d')]=function(_0x1c2e63,_0xaf3bed){var _0x58ae7b=_0x1c2e63[_0xc008('0x45')][_0xc008('0x5e')];var _0x537e5e=_['map'](_0x58ae7b,'id');return db[_0xc008('0x5b')][_0xc008('0x27')]({'where':{'id':_0x537e5e},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc008('0x5f'),'attributes':['id',_0xc008('0x3e'),_0xc008('0x60'),_0xc008('0x61'),'interface'],'raw':!![]}]})[_0xc008('0x15')](function(_0x3721e8){if(_0x3721e8){var _0xc344a7=_[_0xc008('0x62')](_0x3721e8,function(_0x78b833){var _0x177733=_0x78b833[_0xc008('0x3a')]({'plain':!![]});_0x177733[_0xc008('0x5f')][_0xc008('0x63')](function(_0xa332b1){_0xa332b1[_0xc008('0x64')]=_[_0xc008('0x35')](_0x58ae7b,{'id':_0x177733['id']})[_0xc008('0x64')];});return _0x177733['Agents'];});return db['VoiceQueue'][_0xc008('0x35')]({'where':{'id':_0x1c2e63[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](function(_0x4447ba){return db[_0xc008('0x65')][_0xc008('0x66')](function(_0xe5d226){return _0x4447ba['addTeams'](_0x537e5e,{'transaction':_0xe5d226})['then'](function(){return BPromise[_0xc008('0x67')](_0x58ae7b,function(_0x3d33ed){return db[_0xc008('0x68')]['upsert']({'TeamId':_0x3d33ed['id'],'VoiceQueueId':_0x1c2e63[_0xc008('0x2b')]['id'],'penalty':_0x3d33ed[_0xc008('0x64')]},{'transaction':_0xe5d226});});})[_0xc008('0x15')](function(){return BPromise[_0xc008('0x67')](_0xc344a7,function(_0x156ec3){return db[_0xc008('0x69')][_0xc008('0x6a')]({'where':{'UserId':_0x156ec3['id'],'VoiceQueueId':_0x1c2e63[_0xc008('0x2b')]['id']},'defaults':{'penalty':_0x156ec3[_0xc008('0x64')]},'transaction':_0xe5d226});});})[_0xc008('0x15')](function(){return BPromise[_0xc008('0x67')](_[_0xc008('0x53')](_0xc344a7,{'online':!![]}),function(_0x4ffaa3){return db['UserVoiceQueueRt'][_0xc008('0x6b')]({'membername':_0x4ffaa3[_0xc008('0x3e')],'UserId':_0x4ffaa3['id'],'queue_name':_0x4447ba['name'],'VoiceQueueId':_0x4447ba['id'],'interface':_[_0xc008('0x6c')](_0x4ffaa3[_0xc008('0x6d')])?util[_0xc008('0x6e')](_0xc008('0x6f'),_0x4ffaa3[_0xc008('0x3e')]):_0x4ffaa3[_0xc008('0x6d')],'paused':_0x4ffaa3[_0xc008('0x61')]||![],'penalty':_0x4ffaa3[_0xc008('0x64')]},{'transaction':_0xe5d226});});})[_0xc008('0x15')](function(){_0xc344a7['forEach'](function(_0x51b305){socket['emit'](_0xc008('0x70'),{'UserId':_0x51b305['id'],'VoiceQueueId':_0x4447ba['id']});});});});});}})['then'](respondWithStatusCode(_0xaf3bed,null))[_0xc008('0x29')](handleError(_0xaf3bed,null));};exports[_0xc008('0x71')]=function(_0x2c6a48,_0x177e8e){return db[_0xc008('0x5b')][_0xc008('0x27')]({'where':{'id':_0x2c6a48[_0xc008('0x26')][_0xc008('0x72')]},'attributes':['id'],'include':[{'model':db[_0xc008('0x73')],'as':_0xc008('0x5f'),'attributes':['id'],'raw':!![]}]})[_0xc008('0x15')](handleEntityNotFound(_0x177e8e,null))[_0xc008('0x15')](function(_0x1fea74){var _0x304083=_[_0xc008('0x17')](_0x1fea74,'id');var _0x473f44=[];var _0x41d1ea=[];var _0x5c2ca1=squel[_0xc008('0x74')]();_0x5c2ca1['field'](_0xc008('0x75'))[_0xc008('0x76')](_0xc008('0x77'),'tq')['join'](_0xc008('0x78'),'ut',_0xc008('0x79'))[_0xc008('0x24')](_0xc008('0x7a'),_0x2c6a48[_0xc008('0x2b')]['id']);for(var _0x377754=0x0;_0x377754<_0x1fea74[_0xc008('0x4c')];_0x377754+=0x1){let _0x57b8da=_0x1fea74[_0x377754];for(var _0x1cad4b=0x0;_0x1cad4b<_0x57b8da[_0xc008('0x5f')][_0xc008('0x4c')];_0x1cad4b+=0x1){let _0xdb4cef=_0x57b8da['Agents'][_0x1cad4b];var _0x555e8c=_0x5c2ca1['clone']();_0x555e8c['where'](_0xc008('0x7b'),_0xdb4cef['id']);_0x41d1ea[_0xc008('0x7c')](db[_0xc008('0x65')][_0xc008('0x26')](_0x555e8c['toString'](),{'type':db[_0xc008('0x65')][_0xc008('0x7d')][_0xc008('0x7e')]})['then'](function(_0x438195){if(_0x438195['length']===0x1){return _0xdb4cef['id'];}else{var _0x3d76b7=_['every'](_[_0xc008('0x17')](_0x438195,_0xc008('0x7f')),function(_0x1aaf89){return _[_0xc008('0x19')](_0x304083,_0x1aaf89);});if(_0x3d76b7){return _0xdb4cef['id'];}}}));}}return BPromise['all'](_0x41d1ea)[_0xc008('0x15')](function(_0x19dcb7){_0x473f44=_(_0x473f44)[_0xc008('0x80')](_0x19dcb7)[_0xc008('0x81')]()[_0xc008('0x18')]();return db[_0xc008('0x20')][_0xc008('0x35')]({'where':{'id':_0x2c6a48['params']['id']}})[_0xc008('0x15')](function(_0x30b6af){return db[_0xc008('0x65')]['transaction'](function(_0x5ba04f){return _0x30b6af[_0xc008('0x71')](_0x2c6a48[_0xc008('0x26')][_0xc008('0x72')],{'transaction':_0x5ba04f})[_0xc008('0x15')](function(){if(!_['isEmpty'](_0x473f44)){return _0x30b6af[_0xc008('0x82')](_0x473f44,{'transaction':_0x5ba04f})[_0xc008('0x15')](function(){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x2c6a48['params']['id'],'UserId':_0x473f44},'transaction':_0x5ba04f});});}})[_0xc008('0x15')](function(){_0x473f44['forEach'](function(_0x3744e1){socket['emit'](_0xc008('0x83'),{'UserId':_0x3744e1,'VoiceQueueId':_0x30b6af['id']});});});});});});})[_0xc008('0x15')](respondWithStatusCode(_0x177e8e,null))[_0xc008('0x29')](handleError(_0x177e8e,null));};exports[_0xc008('0x84')]=function(_0x5c24cd,_0x5effd6){var _0x23ba7e,_0x274739;return db[_0xc008('0x20')]['find']({'where':{'id':_0x5c24cd[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x5effd6,null))[_0xc008('0x15')](function(_0x272d98){if(_0x272d98){_0x274739=_0x272d98;return _0x272d98[_0xc008('0x84')](_0x5c24cd[_0xc008('0x45')][_0xc008('0x72')],_[_0xc008('0x44')](_0x5c24cd[_0xc008('0x45')],[_0xc008('0x72'),'id'])||{})[_0xc008('0x85')](function(_0x57687f){for(var _0x5ea13a=0x0;_0x5ea13a<_0x5c24cd[_0xc008('0x45')]['ids'][_0xc008('0x4c')];_0x5ea13a+=0x1){socket[_0xc008('0x86')]('userVoiceQueue:save',{'UserId':Number(_0x5c24cd['body'][_0xc008('0x72')][_0x5ea13a]),'VoiceQueueId':Number(_0x5c24cd[_0xc008('0x2b')]['id'])});}return _0x57687f;});}})[_0xc008('0x15')](function(_0x129cbf){_0x23ba7e=_0x129cbf||[];if(_0x274739){return db[_0xc008('0x73')][_0xc008('0x27')]({'where':{'id':_0x5c24cd['body'][_0xc008('0x72')]},'attributes':['id',_0xc008('0x3e'),_0xc008('0x60'),'voicePause',_0xc008('0x6d')],'raw':!![]});}})[_0xc008('0x15')](function(_0xcef0e4){if(!_[_0xc008('0x87')](_0xcef0e4)){var _0x49f92e=[];for(var _0x4ae026=0x0;_0x4ae026<_0xcef0e4[_0xc008('0x4c')];_0x4ae026++){if(_0xcef0e4[_0x4ae026]['online']){_0x49f92e[_0xc008('0x7c')](db[_0xc008('0x88')][_0xc008('0x6b')]({'membername':_0xcef0e4[_0x4ae026][_0xc008('0x3e')],'UserId':_0xcef0e4[_0x4ae026]['id'],'queue_name':_0x274739[_0xc008('0x3e')],'VoiceQueueId':_0x274739['id'],'interface':_['isNil'](_0xcef0e4[_0x4ae026]['interface'])?util[_0xc008('0x6e')](_0xc008('0x6f'),_0xcef0e4[_0x4ae026][_0xc008('0x3e')]):_0xcef0e4[_0x4ae026][_0xc008('0x6d')],'paused':_0xcef0e4[_0x4ae026][_0xc008('0x61')]||![],'penalty':_0x5c24cd[_0xc008('0x45')][_0xc008('0x64')]||0x0}));}}return BPromise['all'](_0x49f92e);}})[_0xc008('0x15')](function(){return _0x23ba7e;})[_0xc008('0x15')](respondWithResult(_0x5effd6,null))[_0xc008('0x29')](handleError(_0x5effd6,null));};exports[_0xc008('0x82')]=function(_0x1afb32,_0x1c2263){return db[_0xc008('0x20')][_0xc008('0x35')]({'where':{'id':_0x1afb32[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x1c2263,null))[_0xc008('0x15')](function(_0x328284){if(_0x328284){return _0x328284['removeAgents'](_0x1afb32[_0xc008('0x26')][_0xc008('0x72')])['then'](function(){if(_[_0xc008('0x89')](_0x1afb32[_0xc008('0x26')][_0xc008('0x72')])){for(var _0x2598be=0x0;_0x2598be<_0x1afb32[_0xc008('0x26')][_0xc008('0x72')][_0xc008('0x4c')];_0x2598be+=0x1){socket[_0xc008('0x86')](_0xc008('0x83'),{'UserId':Number(_0x1afb32[_0xc008('0x26')][_0xc008('0x72')][_0x2598be]),'VoiceQueueId':Number(_0x1afb32['params']['id'])});}}else{socket[_0xc008('0x86')](_0xc008('0x83'),{'UserId':Number(_0x1afb32[_0xc008('0x26')][_0xc008('0x72')]),'VoiceQueueId':Number(_0x1afb32[_0xc008('0x2b')]['id'])});}});}})[_0xc008('0x15')](function(_0x12f5d1){return db[_0xc008('0x88')][_0xc008('0x1c')]({'where':{'VoiceQueueId':_0x1afb32[_0xc008('0x2b')]['id'],'UserId':_0x1afb32[_0xc008('0x26')][_0xc008('0x72')]}})[_0xc008('0x15')](function(){return _0x12f5d1;});})[_0xc008('0x15')](respondWithStatusCode(_0x1c2263,null))[_0xc008('0x29')](handleError(_0x1c2263,null));};exports[_0xc008('0x8a')]=function(_0x5c358b,_0x49688b){var _0x51fd86={};var _0x10778f={};var _0x237ffb;var _0x3f80f4;return db[_0xc008('0x20')][_0xc008('0x4a')]({'where':{'id':_0x5c358b[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x49688b,null))['then'](function(_0x3e7099){if(_0x3e7099){_0x237ffb=_0x3e7099;_0x10778f['model']=_['keys'](db[_0xc008('0x73')][_0xc008('0x21')]);_0x10778f['query']=_[_0xc008('0x2c')](_0x5c358b[_0xc008('0x26')]);_0x10778f[_0xc008('0x2d')]=_['intersection'](_0x10778f[_0xc008('0x2e')],_0x10778f[_0xc008('0x26')]);_0x51fd86[_0xc008('0x31')]=_['intersection'](_0x10778f[_0xc008('0x2e')],qs[_0xc008('0x30')](_0x5c358b[_0xc008('0x26')][_0xc008('0x30')]));_0x51fd86[_0xc008('0x31')]=_0x51fd86[_0xc008('0x31')][_0xc008('0x4c')]?_0x51fd86[_0xc008('0x31')]:_0x10778f['model'];_0x51fd86[_0xc008('0x56')]=qs[_0xc008('0x50')](_0x5c358b[_0xc008('0x26')][_0xc008('0x50')]);_0x51fd86[_0xc008('0x24')]=qs['filters'](_[_0xc008('0x51')](_0x5c358b[_0xc008('0x26')],_0x10778f[_0xc008('0x2d')]));if(_0x5c358b[_0xc008('0x26')][_0xc008('0x53')]){_0x51fd86[_0xc008('0x24')]=_[_0xc008('0x33')](_0x51fd86[_0xc008('0x24')],{'$or':_['map'](_0x51fd86[_0xc008('0x31')],function(_0x231318){var _0x3df369={};_0x3df369[_0x231318]={'$like':'%'+_0x5c358b[_0xc008('0x26')]['filter']+'%'};return _0x3df369;})});}_0x51fd86=_['merge']({},_0x51fd86,_0x5c358b[_0xc008('0x34')]);return _0x237ffb[_0xc008('0x8a')](_0x51fd86);}})['then'](function(_0x30e433){if(_0x30e433){_0x3f80f4=_0x30e433[_0xc008('0x4c')];if(!_0x5c358b[_0xc008('0x26')][_0xc008('0x4d')](_0xc008('0x4e'))){_0x51fd86[_0xc008('0x4f')]=qs[_0xc008('0x4f')](_0x5c358b['query']['limit']);_0x51fd86[_0xc008('0x10')]=qs['offset'](_0x5c358b[_0xc008('0x26')][_0xc008('0x10')]);}return _0x237ffb[_0xc008('0x8a')](_0x51fd86);}})[_0xc008('0x15')](function(_0x2ea1db){if(_0x2ea1db){return _0x2ea1db?{'count':_0x3f80f4,'rows':_0x2ea1db}:null;}})[_0xc008('0x15')](respondWithResult(_0x49688b,null))[_0xc008('0x29')](handleError(_0x49688b,null));};exports[_0xc008('0x8b')]=function(_0x367873,_0x356a82){var _0x368c1f={};var _0x4fd0ff={};var _0x22772e;var _0x39fd43;return db[_0xc008('0x20')][_0xc008('0x4a')]({'where':{'id':_0x367873[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x356a82,null))[_0xc008('0x15')](function(_0x506dc0){if(_0x506dc0){_0x22772e=_0x506dc0;_0x4fd0ff[_0xc008('0x2e')]=_[_0xc008('0x2c')](db[_0xc008('0x88')]['rawAttributes']);_0x4fd0ff[_0xc008('0x26')]=_[_0xc008('0x2c')](_0x367873[_0xc008('0x26')]);_0x4fd0ff[_0xc008('0x2d')]=_[_0xc008('0x2f')](_0x4fd0ff[_0xc008('0x2e')],_0x4fd0ff['query']);_0x368c1f['attributes']=_[_0xc008('0x2f')](_0x4fd0ff[_0xc008('0x2e')],qs[_0xc008('0x30')](_0x367873[_0xc008('0x26')][_0xc008('0x30')]));_0x368c1f['attributes']=_0x368c1f[_0xc008('0x31')]['length']?_0x368c1f[_0xc008('0x31')]:_0x4fd0ff[_0xc008('0x2e')];_0x368c1f['order']=qs[_0xc008('0x50')](_0x367873[_0xc008('0x26')][_0xc008('0x50')]);_0x368c1f[_0xc008('0x24')]=qs['filters'](_[_0xc008('0x51')](_0x367873[_0xc008('0x26')],_0x4fd0ff[_0xc008('0x2d')]));if(_0x367873[_0xc008('0x26')][_0xc008('0x53')]){_0x368c1f['where']=_[_0xc008('0x33')](_0x368c1f[_0xc008('0x24')],{'$or':_[_0xc008('0x17')](_0x368c1f['attributes'],function(_0x43f96e){var _0x353cd5={};_0x353cd5[_0x43f96e]={'$like':'%'+_0x367873[_0xc008('0x26')][_0xc008('0x53')]+'%'};return _0x353cd5;})});}_0x368c1f=_['merge']({},_0x368c1f,_0x367873[_0xc008('0x34')]);return _0x22772e[_0xc008('0x8b')](_0x368c1f);}})[_0xc008('0x15')](function(_0x9afcd6){if(_0x9afcd6){_0x39fd43=_0x9afcd6[_0xc008('0x4c')];if(!_0x367873['query'][_0xc008('0x4d')]('nolimit')){_0x368c1f['limit']=qs[_0xc008('0x4f')](_0x367873['query'][_0xc008('0x4f')]);_0x368c1f[_0xc008('0x10')]=qs[_0xc008('0x10')](_0x367873[_0xc008('0x26')][_0xc008('0x10')]);}return _0x22772e[_0xc008('0x8b')](_0x368c1f);}})[_0xc008('0x15')](function(_0x5e9e9c){return _0x5e9e9c?{'count':_0x39fd43,'rows':_0x5e9e9c}:null;})[_0xc008('0x15')](respondWithResult(_0x356a82,null))[_0xc008('0x29')](handleError(_0x356a82,null));};exports[_0xc008('0x8c')]=function(_0x45fe90,_0xc046ce){var _0x46fc75={};var _0x59b5b9={};var _0x3c3ead;var _0x3c8a79;return db[_0xc008('0x20')][_0xc008('0x4a')]({'where':{'id':_0x45fe90[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0xc046ce,null))[_0xc008('0x15')](function(_0x3aa9b4){if(_0x3aa9b4){_0x3c3ead=_0x3aa9b4;_0x59b5b9['model']=_['keys'](db[_0xc008('0x8d')][_0xc008('0x21')]);_0x59b5b9['query']=_[_0xc008('0x2c')](_0x45fe90['query']);_0x59b5b9[_0xc008('0x2d')]=_[_0xc008('0x2f')](_0x59b5b9[_0xc008('0x2e')],_0x59b5b9[_0xc008('0x26')]);_0x46fc75[_0xc008('0x31')]=_[_0xc008('0x2f')](_0x59b5b9[_0xc008('0x2e')],qs['fields'](_0x45fe90[_0xc008('0x26')]['fields']));_0x46fc75[_0xc008('0x31')]=_0x46fc75[_0xc008('0x31')][_0xc008('0x4c')]?_0x46fc75[_0xc008('0x31')]:_0x59b5b9[_0xc008('0x2e')];_0x46fc75[_0xc008('0x56')]=qs[_0xc008('0x50')](_0x45fe90['query'][_0xc008('0x50')]);_0x46fc75[_0xc008('0x24')]=qs['filters'](_[_0xc008('0x51')](_0x45fe90[_0xc008('0x26')],_0x59b5b9[_0xc008('0x2d')]));if(_0x45fe90[_0xc008('0x26')][_0xc008('0x53')]){_0x46fc75[_0xc008('0x24')]=_['merge'](_0x46fc75[_0xc008('0x24')],{'$or':_[_0xc008('0x17')](_0x46fc75[_0xc008('0x31')],function(_0x3e7c19){var _0x47d263={};_0x47d263[_0x3e7c19]={'$like':'%'+_0x45fe90['query']['filter']+'%'};return _0x47d263;})});}_0x46fc75=_[_0xc008('0x33')]({},_0x46fc75,_0x45fe90[_0xc008('0x34')]);return _0x3c3ead['getLists'](_0x46fc75);}})['then'](function(_0x5035ca){if(_0x5035ca){_0x3c8a79=_0x5035ca['length'];if(!_0x45fe90[_0xc008('0x26')][_0xc008('0x4d')]('nolimit')){_0x46fc75[_0xc008('0x4f')]=qs[_0xc008('0x4f')](_0x45fe90[_0xc008('0x26')][_0xc008('0x4f')]);_0x46fc75[_0xc008('0x10')]=qs['offset'](_0x45fe90['query'][_0xc008('0x10')]);}return _0x3c3ead[_0xc008('0x8c')](_0x46fc75);}})[_0xc008('0x15')](function(_0x46f9ab){if(_0x46f9ab){return _0x46f9ab?{'count':_0x3c8a79,'rows':_0x46f9ab}:null;}})[_0xc008('0x15')](respondWithResult(_0xc046ce,null))[_0xc008('0x29')](handleError(_0xc046ce,null));};exports[_0xc008('0x8e')]=function(_0x5645bb,_0x2ebe07){var _0x3d6f0d=moment()[_0xc008('0x6e')](_0xc008('0x8f'));var _0x3be328,_0x3bcf94;return db[_0xc008('0x20')]['find']({'where':{'id':_0x5645bb['params']['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x2ebe07,null))[_0xc008('0x15')](function(_0x11bcba){if(_0x11bcba){_0x3bcf94=_0x11bcba;return _0x11bcba[_0xc008('0x8e')](_0x5645bb[_0xc008('0x45')][_0xc008('0x72')],_[_0xc008('0x44')](_0x5645bb[_0xc008('0x45')],[_0xc008('0x72'),'id'])||{});}return null;})[_0xc008('0x85')](function(_0xefba5){var _0x202826;_0x3be328=_0xefba5||[];var _0x37e1f2=[];if(_0xefba5){for(var _0x5161f3=0x0;_0x5161f3<_0xefba5['length'];_0x5161f3+=0x1){var _0x43ec81=_0xefba5[_0x5161f3][_0xc008('0x3a')]({'plain':!![]});_0x3bcf94[_0xc008('0x90')]=_0x5645bb[_0xc008('0x45')][_0xc008('0x90')]?_0x5645bb[_0xc008('0x45')][_0xc008('0x90')]:_0x3bcf94['dialCheckDuplicateType'];switch(_0x3bcf94['dialCheckDuplicateType']){case'always':_0x202826=squel[_0xc008('0x91')]()['into']('cm_hopper')['fromQuery']([_0xc008('0x92'),_0xc008('0x93'),_0xc008('0x94'),_0xc008('0x95'),_0xc008('0x52'),_0xc008('0x46'),_0xc008('0x47')],squel[_0xc008('0x74')]()[_0xc008('0x96')](_0xc008('0x92'),_0xc008('0x92'))[_0xc008('0x96')]('\x27'+_0x3d6f0d+'\x27','scheduledAt')['field']('id',_0xc008('0x94'))[_0xc008('0x96')](_0x43ec81[_0xc008('0x97')][_0xc008('0x98')](),_0xc008('0x95'))[_0xc008('0x96')](_0x5645bb[_0xc008('0x2b')]['id'][_0xc008('0x98')](),'VoiceQueueId')[_0xc008('0x96')]('\x27'+_0x3d6f0d+'\x27','createdAt')['field']('\x27'+_0x3d6f0d+'\x27','updatedAt')['from'](_0xc008('0x99'))['where'](_0xc008('0x9a'))[_0xc008('0x24')](_0xc008('0x9b'),_0x43ec81['CmListId']['toString']())[_0xc008('0x24')](_0xc008('0x9c'))['where'](_0xc008('0x9d'),squel[_0xc008('0x74')]()[_0xc008('0x96')](_0xc008('0x9e'))[_0xc008('0x76')](_0xc008('0x9f'))[_0xc008('0x24')](_0xc008('0x7a'),_0x5645bb[_0xc008('0x2b')]['id'][_0xc008('0x98')]()))['where'](_0xc008('0x9d'),squel[_0xc008('0x74')]()['field']('COALESCE(phone,\x27\x27)')[_0xc008('0x76')](_0xc008('0xa0'))[_0xc008('0x24')]('VoiceQueueId\x20=\x20?',_0x5645bb['params']['id']['toString']())))['toString']();break;case _0xc008('0xa1'):_0x202826=squel[_0xc008('0x91')]()[_0xc008('0xa2')](_0xc008('0xa0'))[_0xc008('0xa3')]([_0xc008('0x92'),_0xc008('0x93'),'ContactId',_0xc008('0x95'),_0xc008('0x52'),_0xc008('0x46'),_0xc008('0x47')],squel[_0xc008('0x74')]()['field'](_0xc008('0x92'),_0xc008('0x92'))['field']('\x27'+_0x3d6f0d+'\x27',_0xc008('0x93'))[_0xc008('0x96')]('id',_0xc008('0x94'))[_0xc008('0x96')](_0x43ec81['CmListId'][_0xc008('0x98')](),'ListId')[_0xc008('0x96')](_0x5645bb[_0xc008('0x2b')]['id'][_0xc008('0x98')](),_0xc008('0x52'))[_0xc008('0x96')]('\x27'+_0x3d6f0d+'\x27','createdAt')[_0xc008('0x96')]('\x27'+_0x3d6f0d+'\x27',_0xc008('0x47'))[_0xc008('0x76')](_0xc008('0x99'))['where'](_0xc008('0x9a'))['where']('ListId\x20=\x20?',_0x43ec81[_0xc008('0x97')][_0xc008('0x98')]())[_0xc008('0x24')]('phone\x20IS\x20NOT\x20NULL')[_0xc008('0x24')](_0xc008('0x9d'),squel['select']()[_0xc008('0x96')](_0xc008('0xa4'))['from']('cm_hopper')[_0xc008('0x24')]('VoiceQueueId\x20=\x20?',_0x5645bb['params']['id'][_0xc008('0x98')]())))['toString']();break;default:_0x202826=squel[_0xc008('0x91')]()[_0xc008('0xa2')](_0xc008('0xa0'))[_0xc008('0xa3')]([_0xc008('0x92'),'scheduledAt','ContactId',_0xc008('0x95'),'VoiceQueueId',_0xc008('0x46'),'updatedAt'],squel['select']()['field'](_0xc008('0x92'),'phone')[_0xc008('0x96')]('\x27'+_0x3d6f0d+'\x27',_0xc008('0x93'))['field']('id','ContactId')[_0xc008('0x96')](_0x43ec81[_0xc008('0x97')][_0xc008('0x98')](),_0xc008('0x95'))['field'](_0x5645bb['params']['id'][_0xc008('0x98')](),'VoiceQueueId')['field']('\x27'+_0x3d6f0d+'\x27',_0xc008('0x46'))[_0xc008('0x96')]('\x27'+_0x3d6f0d+'\x27','updatedAt')['from']('cm_contacts')[_0xc008('0x24')]('deletedAt\x20IS\x20NULL')[_0xc008('0x24')](_0xc008('0x9b'),_0x43ec81[_0xc008('0x97')][_0xc008('0x98')]())[_0xc008('0x24')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x37e1f2[_0xc008('0x7c')](db[_0xc008('0x65')][_0xc008('0x26')](_0x202826));}return BPromise[_0xc008('0xa5')](_0x37e1f2);}})[_0xc008('0x15')](function(){var _0x262b79=[];var _0x15c5a2=squel[_0xc008('0x91')]()[_0xc008('0xa2')](_0xc008('0xa6'))[_0xc008('0xa3')]([_0xc008('0xa7'),'phone',_0xc008('0xa8'),_0xc008('0x46'),_0xc008('0x47')],squel[_0xc008('0x74')]()['field'](_0xc008('0xa9'))[_0xc008('0x96')](_0xc008('0xaa'))[_0xc008('0x96')](_0xc008('0xab'))[_0xc008('0x96')]('\x27'+_0x3d6f0d+'\x27',_0xc008('0x46'))[_0xc008('0x96')]('\x27'+_0x3d6f0d+'\x27','updatedAt')[_0xc008('0x76')](_0xc008('0xac'),'ci')[_0xc008('0xad')](_0xc008('0xa0'),'h',_0xc008('0xae'))[_0xc008('0x24')](_0xc008('0xaf'),_0x3d6f0d)['where'](_0xc008('0xb0'),'PHONE'))[_0xc008('0x98')]();_0x262b79[_0xc008('0x7c')](db[_0xc008('0x65')][_0xc008('0x26')](_0x15c5a2));return BPromise[_0xc008('0xa5')](_0x262b79);})[_0xc008('0x15')](function(){return _0x3be328;})[_0xc008('0x15')](respondWithResult(_0x2ebe07,null))[_0xc008('0x29')](handleError(_0x2ebe07,null));};exports[_0xc008('0xb1')]=function(_0x471780,_0x4fae34){return db[_0xc008('0x20')][_0xc008('0x35')]({'where':{'id':_0x471780[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x4fae34,null))[_0xc008('0x15')](function(_0x1cc6a6){if(_0x1cc6a6){return _0x1cc6a6[_0xc008('0xb1')](_0x471780[_0xc008('0x26')][_0xc008('0x72')]);}})[_0xc008('0x15')](function(_0x471618){if(_0x471618){return db[_0xc008('0x4b')][_0xc008('0x1c')]({'where':{'ListId':_0x471780['query'][_0xc008('0x72')],'VoiceQueueId':_0x471780['params']['id']}})[_0xc008('0x15')](function(){return _0x471618;});}})[_0xc008('0x15')](respondWithStatusCode(_0x4fae34,null))[_0xc008('0x29')](handleError(_0x4fae34,null));};exports[_0xc008('0xb2')]=function(_0x370234,_0x3ff7d2){var _0x478794={};var _0x406de6={};var _0x34cbce;var _0x337acd;return db['VoiceQueue']['findOne']({'where':{'id':_0x370234['params']['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x3ff7d2,null))[_0xc008('0x15')](function(_0x2ccfcf){if(_0x2ccfcf){_0x34cbce=_0x2ccfcf;_0x406de6[_0xc008('0x2e')]=_[_0xc008('0x2c')](db[_0xc008('0x8d')][_0xc008('0x21')]);_0x406de6['query']=_[_0xc008('0x2c')](_0x370234[_0xc008('0x26')]);_0x406de6[_0xc008('0x2d')]=_[_0xc008('0x2f')](_0x406de6[_0xc008('0x2e')],_0x406de6['query']);_0x478794[_0xc008('0x31')]=_[_0xc008('0x2f')](_0x406de6[_0xc008('0x2e')],qs[_0xc008('0x30')](_0x370234[_0xc008('0x26')][_0xc008('0x30')]));_0x478794[_0xc008('0x31')]=_0x478794[_0xc008('0x31')][_0xc008('0x4c')]?_0x478794[_0xc008('0x31')]:_0x406de6[_0xc008('0x2e')];_0x478794['order']=qs[_0xc008('0x50')](_0x370234['query'][_0xc008('0x50')]);_0x478794[_0xc008('0x24')]=qs[_0xc008('0x2d')](_['pick'](_0x370234[_0xc008('0x26')],_0x406de6['filters']));if(_0x370234[_0xc008('0x26')][_0xc008('0x53')]){_0x478794[_0xc008('0x24')]=_[_0xc008('0x33')](_0x478794[_0xc008('0x24')],{'$or':_[_0xc008('0x17')](_0x478794[_0xc008('0x31')],function(_0x89601c){var _0x22bb2a={};_0x22bb2a[_0x89601c]={'$like':'%'+_0x370234[_0xc008('0x26')]['filter']+'%'};return _0x22bb2a;})});}_0x478794=_[_0xc008('0x33')]({},_0x478794,_0x370234['options']);return _0x34cbce['getBlackLists'](_0x478794);}})[_0xc008('0x15')](function(_0x55ad1f){if(_0x55ad1f){_0x337acd=_0x55ad1f[_0xc008('0x4c')];if(!_0x370234[_0xc008('0x26')][_0xc008('0x4d')](_0xc008('0x4e'))){_0x478794['limit']=qs[_0xc008('0x4f')](_0x370234[_0xc008('0x26')][_0xc008('0x4f')]);_0x478794[_0xc008('0x10')]=qs[_0xc008('0x10')](_0x370234['query'][_0xc008('0x10')]);}return _0x34cbce[_0xc008('0xb2')](_0x478794);}})['then'](function(_0x247e3a){if(_0x247e3a){return _0x247e3a?{'count':_0x337acd,'rows':_0x247e3a}:null;}})[_0xc008('0x15')](respondWithResult(_0x3ff7d2,null))[_0xc008('0x29')](handleError(_0x3ff7d2,null));};exports[_0xc008('0xb3')]=function(_0x252c44,_0x3b46db){var _0x482efd;return db[_0xc008('0x20')][_0xc008('0x35')]({'where':{'id':_0x252c44[_0xc008('0x2b')]['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x3b46db,null))[_0xc008('0x15')](function(_0x2f217e){if(_0x2f217e){return _0x2f217e[_0xc008('0xb3')](_0x252c44[_0xc008('0x45')][_0xc008('0x72')],_[_0xc008('0x44')](_0x252c44['body'],[_0xc008('0x72'),'id'])||{});}return null;})[_0xc008('0x85')](function(_0x298783){var _0xe349bd;_0x482efd=_0x298783||[];var _0x50db48=[];if(_0x298783){for(var _0x384f2f=0x0;_0x384f2f<_0x298783[_0xc008('0x4c')];_0x384f2f+=0x1){var _0x367581=_0x298783[_0x384f2f][_0xc008('0x3a')]({'plain':!![]});_0xe349bd=squel[_0xc008('0x91')]()[_0xc008('0xa2')](_0xc008('0xb4'))[_0xc008('0xa3')]([_0xc008('0x92'),_0xc008('0x94'),_0xc008('0x95'),_0xc008('0x52'),_0xc008('0x46'),_0xc008('0x47')],squel['select']()[_0xc008('0x96')](_0xc008('0x92'),_0xc008('0x92'))[_0xc008('0x96')]('id',_0xc008('0x94'))['field'](_0x367581[_0xc008('0x97')][_0xc008('0x98')](),'ListId')[_0xc008('0x96')](_0x252c44[_0xc008('0x2b')]['id']['toString'](),'VoiceQueueId')['field']('NOW()',_0xc008('0x46'))['field']('NOW()',_0xc008('0x47'))[_0xc008('0x76')](_0xc008('0x99'))['where']('deletedAt\x20IS\x20NULL')[_0xc008('0x24')](_0xc008('0x9b'),_0x367581[_0xc008('0x97')][_0xc008('0x98')]())['where'](_0xc008('0x9c')))[_0xc008('0x98')]();_0x50db48['push'](db[_0xc008('0x65')]['query'](_0xe349bd));}return BPromise['all'](_0x50db48);}})[_0xc008('0x15')](function(){return _0x482efd;})[_0xc008('0x15')](respondWithResult(_0x3b46db,null))['catch'](handleError(_0x3b46db,null));};exports['removeBlackLists']=function(_0x1e3098,_0x9b997d){return db['VoiceQueue'][_0xc008('0x35')]({'where':{'id':_0x1e3098['params']['id']}})[_0xc008('0x15')](handleEntityNotFound(_0x9b997d,null))[_0xc008('0x15')](function(_0x1422ab){if(_0x1422ab){return _0x1422ab[_0xc008('0xb5')](_0x1e3098[_0xc008('0x26')][_0xc008('0x72')]);}})[_0xc008('0x15')](function(_0x41a8a6){if(_0x41a8a6){return db['CmHopperBlack'][_0xc008('0x1c')]({'where':{'ListId':_0x1e3098['query'][_0xc008('0x72')],'VoiceQueueId':_0x1e3098['params']['id']}})['then'](function(){return _0x41a8a6;});}})[_0xc008('0x15')](respondWithStatusCode(_0x9b997d,null))[_0xc008('0x29')](handleError(_0x9b997d,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index a46ef6a..86a860b 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 _0x2acd=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueue','setMaxListeners','save'];(function(_0x448320,_0x164f9){var _0x430303=function(_0x253a6b){while(--_0x253a6b){_0x448320['push'](_0x448320['shift']());}};_0x430303(++_0x164f9);}(_0x2acd,0xee));var _0xd2ac=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x2acd[_0x42cae2];return _0x5f256f;};'use strict';var EventEmitter=require(_0xd2ac('0x0'));var VoiceQueue=require(_0xd2ac('0x1'))['db'][_0xd2ac('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xd2ac('0x3')](0x0);var events={'afterCreate':_0xd2ac('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x20cd9e){return function(_0x1a7e6d,_0x266f0b,_0xa8c217){VoiceQueueEvents[_0xd2ac('0x5')](_0x20cd9e+':'+_0x1a7e6d['id'],_0x1a7e6d);VoiceQueueEvents[_0xd2ac('0x5')](_0x20cd9e,_0x1a7e6d);_0xa8c217(null);};}for(var e in events){if(events[_0xd2ac('0x6')](e)){var event=events[e];VoiceQueue[_0xd2ac('0x7')](e,emitEvent(event));}}module[_0xd2ac('0x8')]=VoiceQueueEvents; \ No newline at end of file +var _0xd77f=['VoiceQueue','save','update','remove','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x22ce45,_0x5d4ecd){var _0x418c87=function(_0x32561b){while(--_0x32561b){_0x22ce45['push'](_0x22ce45['shift']());}};_0x418c87(++_0x5d4ecd);}(_0xd77f,0x167));var _0xfd77=function(_0x3fa7ad,_0x182b55){_0x3fa7ad=_0x3fa7ad-0x0;var _0x59491f=_0xd77f[_0x3fa7ad];return _0x59491f;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0xfd77('0x0'))['db'][_0xfd77('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfd77('0x2'),'afterUpdate':_0xfd77('0x3'),'afterDestroy':_0xfd77('0x4')};function emitEvent(_0x1abb14){return function(_0x492e55,_0x5d751d,_0x590a51){VoiceQueueEvents[_0xfd77('0x5')](_0x1abb14+':'+_0x492e55['id'],_0x492e55);VoiceQueueEvents[_0xfd77('0x5')](_0x1abb14,_0x492e55);_0x590a51(null);};}for(var e in events){if(events[_0xfd77('0x6')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0xfd77('0x7')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 8c592a3..93d6eb1 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 _0x9c44=['request-promise','path','./voiceQueue.attributes','define','VoiceQueue','voice_queues','../../config/logger','api','moment','bluebird'];(function(_0x43b001,_0x3b5366){var _0x4203f5=function(_0x4c1baa){while(--_0x4c1baa){_0x43b001['push'](_0x43b001['shift']());}};_0x4203f5(++_0x3b5366);}(_0x9c44,0x178));var _0x49c4=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x9c44[_0x2dea24];return _0x309d58;};'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 +var _0x3e74=['exports','VoiceQueue','voice_queues','lodash','../../config/logger','api','moment','path','../../config/environment','./voiceQueue.attributes'];(function(_0x340fdf,_0x48ad2b){var _0x1a04c2=function(_0x5bcc8e){while(--_0x5bcc8e){_0x340fdf['push'](_0x340fdf['shift']());}};_0x1a04c2(++_0x48ad2b);}(_0x3e74,0x175));var _0x43e7=function(_0x3e1146,_0x5b5649){_0x3e1146=_0x3e1146-0x0;var _0x1b91ce=_0x3e74[_0x3e1146];return _0x1b91ce;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index fce4e3f..db9678f 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 _0xfac6=['result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','include','model','map','debug','find','lodash','moment','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','socket.io-emitter','./voiceQueue.socket','then','VoiceQueue,\x20%s,\x20%s','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info'];(function(_0x48d366,_0x1f4778){var _0x9a3cc1=function(_0x3676db){while(--_0x3676db){_0x48d366['push'](_0x48d366['shift']());}};_0x9a3cc1(++_0x1f4778);}(_0xfac6,0x7b));var _0x6fac=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xfac6[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x6fac('0x0'));var util=require('util');var moment=require(_0x6fac('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6fac('0x2'))['db'];var utils=require(_0x6fac('0x3'));var logger=require(_0x6fac('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6fac('0x5'));var client=jayson[_0x6fac('0x6')][_0x6fac('0x7')]({'port':0x232a});config[_0x6fac('0x8')]=_[_0x6fac('0x9')](config[_0x6fac('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x6fac('0xa'))(new Redis(config[_0x6fac('0x8')]));require(_0x6fac('0xb'))['register'](socket);function respondWithRpcPromise(_0x27df44,_0x5b3e0f,_0x476cfc){return new BPromise(function(_0x1cf583,_0x37ea93){return client['request'](_0x27df44,_0x476cfc)[_0x6fac('0xc')](function(_0x34aa9c){logger['info'](_0x6fac('0xd'),_0x5b3e0f,'request\x20sent');logger['debug'](_0x6fac('0xe'),_0x5b3e0f,_0x6fac('0xf'),JSON[_0x6fac('0x10')](_0x34aa9c));if(_0x34aa9c[_0x6fac('0x11')]){if(_0x34aa9c[_0x6fac('0x11')][_0x6fac('0x12')]===0x1f4){logger[_0x6fac('0x11')](_0x6fac('0xd'),_0x5b3e0f,_0x34aa9c['error'][_0x6fac('0x13')]);return _0x37ea93(_0x34aa9c[_0x6fac('0x11')][_0x6fac('0x13')]);}logger['error'](_0x6fac('0xd'),_0x5b3e0f,_0x34aa9c[_0x6fac('0x11')][_0x6fac('0x13')]);return _0x1cf583(_0x34aa9c[_0x6fac('0x11')][_0x6fac('0x13')]);}else{logger[_0x6fac('0x14')](_0x6fac('0xd'),_0x5b3e0f,_0x6fac('0xf'));_0x1cf583(_0x34aa9c[_0x6fac('0x15')][_0x6fac('0x13')]);}})[_0x6fac('0x16')](function(_0xabe26e){logger[_0x6fac('0x11')](_0x6fac('0xd'),_0x5b3e0f,_0xabe26e);_0x37ea93(_0xabe26e);});});}exports[_0x6fac('0x17')]=function(_0x3d6dcd){var _0x371eba=this;return new Promise(function(_0x3cfadf,_0x4157aa){return db[_0x6fac('0x18')][_0x6fac('0x19')]({'raw':_0x3d6dcd[_0x6fac('0x1a')]?_0x3d6dcd[_0x6fac('0x1a')][_0x6fac('0x1b')]===undefined?!![]:![]:!![],'where':_0x3d6dcd[_0x6fac('0x1a')]?_0x3d6dcd[_0x6fac('0x1a')][_0x6fac('0x1c')]||null:null,'attributes':_0x3d6dcd[_0x6fac('0x1a')]?_0x3d6dcd[_0x6fac('0x1a')][_0x6fac('0x1d')]||null:null,'limit':_0x3d6dcd[_0x6fac('0x1a')]?_0x3d6dcd[_0x6fac('0x1a')][_0x6fac('0x1e')]||null:null,'include':_0x3d6dcd[_0x6fac('0x1a')]?_0x3d6dcd['options']['include']?_['map'](_0x3d6dcd[_0x6fac('0x1a')][_0x6fac('0x1f')],function(_0x3675ef){return{'model':db[_0x3675ef[_0x6fac('0x20')]],'as':_0x3675ef['as'],'attributes':_0x3675ef[_0x6fac('0x1d')],'include':_0x3675ef[_0x6fac('0x1f')]?_[_0x6fac('0x21')](_0x3675ef[_0x6fac('0x1f')],function(_0x13d7f8){return{'model':db[_0x13d7f8[_0x6fac('0x20')]],'as':_0x13d7f8['as'],'attributes':_0x13d7f8[_0x6fac('0x1d')],'include':_0x13d7f8[_0x6fac('0x1f')]?_[_0x6fac('0x21')](_0x13d7f8[_0x6fac('0x1f')],function(_0x2ce91a){return{'model':db[_0x2ce91a[_0x6fac('0x20')]],'as':_0x2ce91a['as'],'attributes':_0x2ce91a[_0x6fac('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6fac('0xc')](function(_0x3f4760){logger[_0x6fac('0x14')](_0x6fac('0x17'),_0x3d6dcd);logger[_0x6fac('0x22')](_0x6fac('0x17'),_0x3d6dcd,JSON[_0x6fac('0x10')](_0x3f4760));_0x3cfadf(_0x3f4760);})[_0x6fac('0x16')](function(_0x2fde99){logger[_0x6fac('0x11')](_0x6fac('0x17'),_0x2fde99['message'],_0x3d6dcd);_0x4157aa(_0x371eba[_0x6fac('0x11')](0x1f4,_0x2fde99[_0x6fac('0x13')]));});});};exports['ShowVoiceQueue']=function(_0x2272ff){var _0x5e3fa7=this;return new Promise(function(_0x573554,_0x2ef6d3){return db['VoiceQueue'][_0x6fac('0x23')]({'raw':_0x2272ff[_0x6fac('0x1a')]?_0x2272ff[_0x6fac('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x2272ff['options']?_0x2272ff[_0x6fac('0x1a')]['where']||null:null,'attributes':_0x2272ff['options']?_0x2272ff[_0x6fac('0x1a')][_0x6fac('0x1d')]||null:null,'include':_0x2272ff[_0x6fac('0x1a')]?_0x2272ff[_0x6fac('0x1a')][_0x6fac('0x1f')]?_['map'](_0x2272ff[_0x6fac('0x1a')]['include'],function(_0x18ec9c){return{'model':db[_0x18ec9c[_0x6fac('0x20')]],'as':_0x18ec9c['as'],'attributes':_0x18ec9c[_0x6fac('0x1d')],'include':_0x18ec9c[_0x6fac('0x1f')]?_[_0x6fac('0x21')](_0x18ec9c[_0x6fac('0x1f')],function(_0x1a28c9){return{'model':db[_0x1a28c9[_0x6fac('0x20')]],'as':_0x1a28c9['as'],'attributes':_0x1a28c9[_0x6fac('0x1d')],'include':_0x1a28c9['include']?_[_0x6fac('0x21')](_0x1a28c9['include'],function(_0x10a6a5){return{'model':db[_0x10a6a5[_0x6fac('0x20')]],'as':_0x10a6a5['as'],'attributes':_0x10a6a5['attributes']};}):[]};}):[]};}):[]:[]})[_0x6fac('0xc')](function(_0x749f89){logger['info']('ShowVoiceQueue',_0x2272ff);logger['debug']('ShowVoiceQueue',_0x2272ff,JSON[_0x6fac('0x10')](_0x749f89));_0x573554(_0x749f89);})[_0x6fac('0x16')](function(_0xaba69d){logger[_0x6fac('0x11')]('ShowVoiceQueue',_0xaba69d[_0x6fac('0x13')],_0x2272ff);_0x2ef6d3(_0x5e3fa7[_0x6fac('0x11')](0x1f4,_0xaba69d[_0x6fac('0x13')]));});});}; \ No newline at end of file +var _0x451b=['randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','info','request\x20sent','stringify','error','code','VoiceQueue,\x20%s,\x20%s','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','attributes','limit','include','map','model','debug','ShowVoiceQueue','find','where','lodash','util','moment','bluebird'];(function(_0x38135f,_0x591f45){var _0xb95187=function(_0x27baab){while(--_0x27baab){_0x38135f['push'](_0x38135f['shift']());}};_0xb95187(++_0x591f45);}(_0x451b,0xce));var _0xb451=function(_0x2d66b4,_0x510743){_0x2d66b4=_0x2d66b4-0x0;var _0x49b073=_0x451b[_0x2d66b4];return _0x49b073;};'use strict';var _=require(_0xb451('0x0'));var util=require(_0xb451('0x1'));var moment=require(_0xb451('0x2'));var BPromise=require(_0xb451('0x3'));var rs=require(_0xb451('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb451('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb451('0x6'))(_0xb451('0x7'));var config=require(_0xb451('0x8'));var jayson=require(_0xb451('0x9'));var client=jayson[_0xb451('0xa')][_0xb451('0xb')]({'port':0x232a});config[_0xb451('0xc')]=_['defaults'](config[_0xb451('0xc')],{'host':_0xb451('0xd'),'port':0x18eb});var socket=require(_0xb451('0xe'))(new Redis(config[_0xb451('0xc')]));require(_0xb451('0xf'))[_0xb451('0x10')](socket);function respondWithRpcPromise(_0x4bb9df,_0x237a18,_0x394033){return new BPromise(function(_0x52bc04,_0x48638e){return client[_0xb451('0x11')](_0x4bb9df,_0x394033)[_0xb451('0x12')](function(_0x5bfc1c){logger[_0xb451('0x13')]('VoiceQueue,\x20%s,\x20%s',_0x237a18,_0xb451('0x14'));logger['debug']('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x237a18,_0xb451('0x14'),JSON[_0xb451('0x15')](_0x5bfc1c));if(_0x5bfc1c[_0xb451('0x16')]){if(_0x5bfc1c[_0xb451('0x16')][_0xb451('0x17')]===0x1f4){logger[_0xb451('0x16')](_0xb451('0x18'),_0x237a18,_0x5bfc1c['error'][_0xb451('0x19')]);return _0x48638e(_0x5bfc1c[_0xb451('0x16')][_0xb451('0x19')]);}logger['error'](_0xb451('0x18'),_0x237a18,_0x5bfc1c['error'][_0xb451('0x19')]);return _0x52bc04(_0x5bfc1c[_0xb451('0x16')][_0xb451('0x19')]);}else{logger[_0xb451('0x13')]('VoiceQueue,\x20%s,\x20%s',_0x237a18,_0xb451('0x14'));_0x52bc04(_0x5bfc1c[_0xb451('0x1a')]['message']);}})[_0xb451('0x1b')](function(_0x2bf327){logger[_0xb451('0x16')](_0xb451('0x18'),_0x237a18,_0x2bf327);_0x48638e(_0x2bf327);});});}exports[_0xb451('0x1c')]=function(_0x2ee98c){var _0x1572aa=this;return new Promise(function(_0x448eab,_0x3d42f2){return db[_0xb451('0x1d')][_0xb451('0x1e')]({'raw':_0x2ee98c[_0xb451('0x1f')]?_0x2ee98c[_0xb451('0x1f')][_0xb451('0x20')]===undefined?!![]:![]:!![],'where':_0x2ee98c[_0xb451('0x1f')]?_0x2ee98c[_0xb451('0x1f')]['where']||null:null,'attributes':_0x2ee98c['options']?_0x2ee98c[_0xb451('0x1f')][_0xb451('0x21')]||null:null,'limit':_0x2ee98c['options']?_0x2ee98c[_0xb451('0x1f')][_0xb451('0x22')]||null:null,'include':_0x2ee98c[_0xb451('0x1f')]?_0x2ee98c['options'][_0xb451('0x23')]?_[_0xb451('0x24')](_0x2ee98c[_0xb451('0x1f')]['include'],function(_0x39ccdb){return{'model':db[_0x39ccdb[_0xb451('0x25')]],'as':_0x39ccdb['as'],'attributes':_0x39ccdb[_0xb451('0x21')],'include':_0x39ccdb[_0xb451('0x23')]?_[_0xb451('0x24')](_0x39ccdb[_0xb451('0x23')],function(_0x39dbf1){return{'model':db[_0x39dbf1[_0xb451('0x25')]],'as':_0x39dbf1['as'],'attributes':_0x39dbf1['attributes'],'include':_0x39dbf1[_0xb451('0x23')]?_[_0xb451('0x24')](_0x39dbf1[_0xb451('0x23')],function(_0x1d734d){return{'model':db[_0x1d734d[_0xb451('0x25')]],'as':_0x1d734d['as'],'attributes':_0x1d734d['attributes']};}):[]};}):[]};}):[]:[]})[_0xb451('0x12')](function(_0x4213d7){logger['info']('GetVoiceQueue',_0x2ee98c);logger[_0xb451('0x26')](_0xb451('0x1c'),_0x2ee98c,JSON[_0xb451('0x15')](_0x4213d7));_0x448eab(_0x4213d7);})[_0xb451('0x1b')](function(_0x5a22b1){logger[_0xb451('0x16')]('GetVoiceQueue',_0x5a22b1[_0xb451('0x19')],_0x2ee98c);_0x3d42f2(_0x1572aa[_0xb451('0x16')](0x1f4,_0x5a22b1[_0xb451('0x19')]));});});};exports[_0xb451('0x27')]=function(_0x16835f){var _0x2843ed=this;return new Promise(function(_0x326fd3,_0x1739df){return db[_0xb451('0x1d')][_0xb451('0x28')]({'raw':_0x16835f['options']?_0x16835f['options'][_0xb451('0x20')]===undefined?!![]:![]:!![],'where':_0x16835f[_0xb451('0x1f')]?_0x16835f['options'][_0xb451('0x29')]||null:null,'attributes':_0x16835f[_0xb451('0x1f')]?_0x16835f[_0xb451('0x1f')][_0xb451('0x21')]||null:null,'include':_0x16835f[_0xb451('0x1f')]?_0x16835f[_0xb451('0x1f')]['include']?_['map'](_0x16835f[_0xb451('0x1f')][_0xb451('0x23')],function(_0x5345de){return{'model':db[_0x5345de[_0xb451('0x25')]],'as':_0x5345de['as'],'attributes':_0x5345de[_0xb451('0x21')],'include':_0x5345de[_0xb451('0x23')]?_[_0xb451('0x24')](_0x5345de[_0xb451('0x23')],function(_0x2dfc2a){return{'model':db[_0x2dfc2a[_0xb451('0x25')]],'as':_0x2dfc2a['as'],'attributes':_0x2dfc2a['attributes'],'include':_0x2dfc2a['include']?_[_0xb451('0x24')](_0x2dfc2a[_0xb451('0x23')],function(_0x15ec51){return{'model':db[_0x15ec51[_0xb451('0x25')]],'as':_0x15ec51['as'],'attributes':_0x15ec51[_0xb451('0x21')]};}):[]};}):[]};}):[]:[]})[_0xb451('0x12')](function(_0x561041){logger['info'](_0xb451('0x27'),_0x16835f);logger[_0xb451('0x26')](_0xb451('0x27'),_0x16835f,JSON[_0xb451('0x15')](_0x561041));_0x326fd3(_0x561041);})['catch'](function(_0x835e90){logger[_0xb451('0x16')](_0xb451('0x27'),_0x835e90[_0xb451('0x19')],_0x16835f);_0x1739df(_0x2843ed[_0xb451('0x16')](0x1f4,_0x835e90[_0xb451('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 1c43698..95b0d98 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 _0x7272=['./voiceQueue.events','remove','update','emit','removeListener'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7272,0x195));var _0x2727=function(_0x3d8f7a,_0x3e897b){_0x3d8f7a=_0x3d8f7a-0x0;var _0xb8bb40=_0x7272[_0x3d8f7a];return _0xb8bb40;};'use strict';var VoiceQueueEvents=require(_0x2727('0x0'));var events=['save',_0x2727('0x1'),_0x2727('0x2')];function createListener(_0x36d92a,_0x466de1){return function(_0x4f42a2){_0x466de1[_0x2727('0x3')](_0x36d92a,_0x4f42a2);};}function removeListener(_0x405438,_0x3ea355){return function(){VoiceQueueEvents[_0x2727('0x4')](_0x405438,_0x3ea355);};}exports['register']=function(_0x143e89){for(var _0x5d8a71=0x0,_0x588eb3=events['length'];_0x5d8a71<_0x588eb3;_0x5d8a71++){var _0x367ecd=events[_0x5d8a71];var _0x36a716=createListener('voiceQueue:'+_0x367ecd,_0x143e89);VoiceQueueEvents['on'](_0x367ecd,_0x36a716);}}; \ No newline at end of file +var _0xadbe=['./voiceQueue.events','remove','emit','removeListener'];(function(_0x123bc8,_0x13d582){var _0x58483e=function(_0x2a76a6){while(--_0x2a76a6){_0x123bc8['push'](_0x123bc8['shift']());}};_0x58483e(++_0x13d582);}(_0xadbe,0x1c0));var _0xeadb=function(_0x44f4c5,_0x4f0606){_0x44f4c5=_0x44f4c5-0x0;var _0x59a14b=_0xadbe[_0x44f4c5];return _0x59a14b;};'use strict';var VoiceQueueEvents=require(_0xeadb('0x0'));var events=['save',_0xeadb('0x1'),'update'];function createListener(_0x5dc4d0,_0x3f3651){return function(_0x4475e6){_0x3f3651[_0xeadb('0x2')](_0x5dc4d0,_0x4475e6);};}function removeListener(_0xe6e76,_0x15192e){return function(){VoiceQueueEvents[_0xeadb('0x3')](_0xe6e76,_0x15192e);};}exports['register']=function(_0x1c15b9){for(var _0x19e3e9=0x0,_0x102412=events['length'];_0x19e3e9<_0x102412;_0x19e3e9++){var _0x334c18=events[_0x19e3e9];var _0x4e3d22=createListener('voiceQueue:'+_0x334c18,_0x1c15b9);VoiceQueueEvents['on'](_0x334c18,_0x4e3d22);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index d0c825b..7144ac2 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 _0x894f=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/index','/:id','post','create','put','update','multer','util','connect-timeout'];(function(_0x2da02c,_0x359588){var _0xe4a708=function(_0x513376){while(--_0x513376){_0x2da02c['push'](_0x2da02c['shift']());}};_0xe4a708(++_0x359588);}(_0x894f,0xbb));var _0xf894=function(_0x42253a,_0x42a21e){_0x42253a=_0x42253a-0x0;var _0x590d1f=_0x894f[_0x42253a];return _0x590d1f;};'use strict';var multer=require(_0xf894('0x0'));var util=require(_0xf894('0x1'));var path=require('path');var timeout=require(_0xf894('0x2'));var express=require(_0xf894('0x3'));var router=express['Router']();var fs_extra=require(_0xf894('0x4'));var auth=require(_0xf894('0x5'));var interaction=require(_0xf894('0x6'));var config=require(_0xf894('0x7'));var controller=require('./voiceQueueReport.controller');router[_0xf894('0x8')]('/',auth[_0xf894('0x9')](),controller[_0xf894('0xa')]);router[_0xf894('0x8')](_0xf894('0xb'),auth[_0xf894('0x9')](),controller[_0xf894('0xc')]);router['get'](_0xf894('0xd'),auth[_0xf894('0x9')](),controller['getVoiceQueuesReport']);router[_0xf894('0x8')](_0xf894('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xf894('0xf')]('/',auth[_0xf894('0x9')](),controller[_0xf894('0x10')]);router[_0xf894('0x11')](_0xf894('0xe'),auth[_0xf894('0x9')](),controller[_0xf894('0x12')]);router['delete'](_0xf894('0xe'),auth[_0xf894('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x7386=['./voiceQueueReport.controller','get','isAuthenticated','index','/describe','/index','getVoiceQueuesReport','show','post','create','put','/:id','update','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x41ffdc,_0x59e29a){var _0x348bf7=function(_0x7f115c){while(--_0x7f115c){_0x41ffdc['push'](_0x41ffdc['shift']());}};_0x348bf7(++_0x59e29a);}(_0x7386,0x158));var _0x6738=function(_0xc13a68,_0x475524){_0xc13a68=_0xc13a68-0x0;var _0xaeb5ce=_0x7386[_0xc13a68];return _0xaeb5ce;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6738('0x0'));var timeout=require(_0x6738('0x1'));var express=require(_0x6738('0x2'));var router=express[_0x6738('0x3')]();var fs_extra=require(_0x6738('0x4'));var auth=require(_0x6738('0x5'));var interaction=require(_0x6738('0x6'));var config=require(_0x6738('0x7'));var controller=require(_0x6738('0x8'));router[_0x6738('0x9')]('/',auth[_0x6738('0xa')](),controller[_0x6738('0xb')]);router['get'](_0x6738('0xc'),auth[_0x6738('0xa')](),controller['describe']);router[_0x6738('0x9')](_0x6738('0xd'),auth[_0x6738('0xa')](),controller[_0x6738('0xe')]);router[_0x6738('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x6738('0xf')]);router[_0x6738('0x10')]('/',auth[_0x6738('0xa')](),controller[_0x6738('0x11')]);router[_0x6738('0x12')](_0x6738('0x13'),auth[_0x6738('0xa')](),controller[_0x6738('0x14')]);router['delete']('/:id',auth[_0x6738('0xa')](),controller[_0x6738('0x15')]);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 865de16..37fd524 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 _0x1ac8=['holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','moment','exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt'];(function(_0x43d5d9,_0x548c1a){var _0x547666=function(_0x5bd752){while(--_0x5bd752){_0x43d5d9['push'](_0x43d5d9['shift']());}};_0x547666(++_0x548c1a);}(_0x1ac8,0x82));var _0x81ac=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x1ac8[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x81ac('0x0'));module[_0x81ac('0x1')]={'type':{'type':Sequelize[_0x81ac('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x81ac('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x81ac('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x81ac('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x81ac('0x3')],'set':function(_0x5ad218){var _0x49ebeb=moment(_0x5ad218);var _0x53a6bc=moment(this['getDataValue']('queuecallerjoinAt'))[_0x81ac('0x4')](_0x81ac('0x5'));var _0x2adcc2=_0x49ebeb[_0x81ac('0x6')](_0x53a6bc,_0x81ac('0x7'));this[_0x81ac('0x8')](_0x81ac('0x9'),_0x5ad218);this[_0x81ac('0x8')](_0x81ac('0xa'),_0x2adcc2||null);}},'position':{'type':Sequelize[_0x81ac('0xb')]},'count':{'type':Sequelize[_0x81ac('0xb')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x81ac('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0x81ac('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x81ac('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x81ac('0x2')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x81ac('0xb')]},'channel':{'type':Sequelize[_0x81ac('0x2')]},'connectedlinenum':{'type':Sequelize[_0x81ac('0x2')]},'connectedlinename':{'type':Sequelize[_0x81ac('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x81ac('0x2')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x81ac('0xb')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x81ac('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x81ac('0x2')]},'transfer':{'type':Sequelize[_0x81ac('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x81ac('0xd')},'transferexten':{'type':Sequelize[_0x81ac('0x2')]},'transferuniqueid':{'type':Sequelize[_0x81ac('0x2')]},'disposition':{'type':Sequelize[_0x81ac('0x2')]},'secondDisposition':{'type':Sequelize[_0x81ac('0x2')]},'thirdDisposition':{'type':Sequelize[_0x81ac('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x81ac('0xb')],'defaultValue':0x0},'note':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5322=['DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','sequelize','STRING'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x5322,0x7c));var _0x2532=function(_0x3b2369,_0x4c68b9){_0x3b2369=_0x3b2369-0x0;var _0x5a1367=_0x5322[_0x3b2369];return _0x5a1367;};'use strict';var Sequelize=require(_0x2532('0x0'));var moment=require('moment');module['exports']={'type':{'type':Sequelize[_0x2532('0x1')]},'uniqueid':{'type':Sequelize[_0x2532('0x1')]},'calleridnum':{'type':Sequelize[_0x2532('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x2532('0x1')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0x2532('0x2')],'set':function(_0x437aae){var _0x55a5c6=moment(_0x437aae);var _0x215935=moment(this[_0x2532('0x3')](_0x2532('0x4')))[_0x2532('0x5')](_0x2532('0x6'));var _0x448d8d=_0x55a5c6[_0x2532('0x7')](_0x215935,_0x2532('0x8'));this[_0x2532('0x9')](_0x2532('0xa'),_0x437aae);this[_0x2532('0x9')](_0x2532('0xb'),_0x448d8d||null);}},'position':{'type':Sequelize[_0x2532('0xc')]},'count':{'type':Sequelize[_0x2532('0xc')]},'queuecallerabandon':{'type':Sequelize[_0x2532('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x2532('0x2')]},'queuecallercomplete':{'type':Sequelize[_0x2532('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x2532('0x2')]},'queuecallerexit':{'type':Sequelize[_0x2532('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x2532('0x2')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x2532('0xc')]},'channel':{'type':Sequelize[_0x2532('0x1')]},'connectedlinenum':{'type':Sequelize[_0x2532('0x1')]},'connectedlinename':{'type':Sequelize[_0x2532('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x2532('0x1')]},'priority':{'type':Sequelize[_0x2532('0x1')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x2532('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x2532('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x2532('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x2532('0x1')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x2532('0x1')]},'disposition':{'type':Sequelize[_0x2532('0x1')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x2532('0x1')]},'queuecallerenterreason':{'type':Sequelize[_0x2532('0xc')],'defaultValue':0x0},'note':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index d57c40d..48e18e6 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 _0xbc49=['offset','limit','undefined','count','json','apply','update','then','destroy','error','stack','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','length','find','catch','create','body','params','getVoiceQueuesReport','order','sort','pick','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','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','defaults','localhost','socket.io-emitter','redis','./voiceQueueReport.socket','register','sendStatus','status'];(function(_0x196e10,_0x3f0318){var _0x2fca9c=function(_0x3b1823){while(--_0x3b1823){_0x196e10['push'](_0x196e10['shift']());}};_0x2fca9c(++_0x3f0318);}(_0xbc49,0x1d8));var _0x9bc4=function(_0xe84805,_0x2702d9){_0xe84805=_0xe84805-0x0;var _0x398efd=_0xbc49[_0xe84805];return _0x398efd;};'use strict';var emlformat=require(_0x9bc4('0x0'));var rimraf=require(_0x9bc4('0x1'));var zipdir=require(_0x9bc4('0x2'));var jsonpatch=require(_0x9bc4('0x3'));var rp=require(_0x9bc4('0x4'));var moment=require(_0x9bc4('0x5'));var BPromise=require(_0x9bc4('0x6'));var Mustache=require(_0x9bc4('0x7'));var util=require(_0x9bc4('0x8'));var path=require(_0x9bc4('0x9'));var sox=require(_0x9bc4('0xa'));var csv=require(_0x9bc4('0xb'));var ejs=require(_0x9bc4('0xc'));var fs=require('fs');var fs_extra=require(_0x9bc4('0xd'));var _=require(_0x9bc4('0xe'));var squel=require(_0x9bc4('0xf'));var crypto=require('crypto');var jsforce=require(_0x9bc4('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x9bc4('0xb'));var querystring=require(_0x9bc4('0x11'));var Papa=require(_0x9bc4('0x12'));var Redis=require(_0x9bc4('0x13'));var authService=require(_0x9bc4('0x14'));var qs=require(_0x9bc4('0x15'));var as=require(_0x9bc4('0x16'));var hardwareService=require(_0x9bc4('0x17'));var logger=require(_0x9bc4('0x18'))(_0x9bc4('0x19'));var utils=require(_0x9bc4('0x1a'));var config=require(_0x9bc4('0x1b'));var licenseUtil=require(_0x9bc4('0x1c'));var db=require(_0x9bc4('0x1d'))['db'];config['redis']=_[_0x9bc4('0x1e')](config['redis'],{'host':_0x9bc4('0x1f'),'port':0x18eb});var socket=require(_0x9bc4('0x20'))(new Redis(config[_0x9bc4('0x21')]));require(_0x9bc4('0x22'))[_0x9bc4('0x23')](socket);function respondWithStatusCode(_0x2a8ddc,_0x54dd65){_0x54dd65=_0x54dd65||0xcc;return function(_0x4353fa){if(_0x4353fa){return _0x2a8ddc[_0x9bc4('0x24')](_0x54dd65);}return _0x2a8ddc[_0x9bc4('0x25')](_0x54dd65)['end']();};}function respondWithResult(_0x48ef30,_0x375639){_0x375639=_0x375639||0xc8;return function(_0x3dde5e){if(_0x3dde5e){return _0x48ef30[_0x9bc4('0x25')](_0x375639)['json'](_0x3dde5e);}};}function respondWithFilteredResult(_0x12ba3e,_0x5c49a0){return function(_0x11597f){if(_0x11597f){var _0x3254eb=typeof _0x5c49a0[_0x9bc4('0x26')]==='undefined'&&typeof _0x5c49a0[_0x9bc4('0x27')]===_0x9bc4('0x28');var _0x4076e3=_0x11597f['count'];var _0x314ea9=_0x3254eb?0x0:_0x5c49a0['offset'];var _0x479b10=_0x3254eb?_0x11597f[_0x9bc4('0x29')]:_0x5c49a0[_0x9bc4('0x26')]+_0x5c49a0[_0x9bc4('0x27')];var _0x5179f6;if(_0x479b10>=_0x4076e3){_0x479b10=_0x4076e3;_0x5179f6=0xc8;}else{_0x5179f6=0xce;}_0x12ba3e[_0x9bc4('0x25')](_0x5179f6);return _0x12ba3e['set']('Content-Range',_0x314ea9+'-'+_0x479b10+'/'+_0x4076e3)[_0x9bc4('0x2a')](_0x11597f);}return null;};}function patchUpdates(_0x41aa26){return function(_0x1886f4){try{jsonpatch[_0x9bc4('0x2b')](_0x1886f4,_0x41aa26,!![]);}catch(_0xc575bd){return BPromise['reject'](_0xc575bd);}return _0x1886f4['save']();};}function saveUpdates(_0x5064a8,_0x194a2f){return function(_0x45c3ec){if(_0x45c3ec){return _0x45c3ec[_0x9bc4('0x2c')](_0x5064a8)[_0x9bc4('0x2d')](function(_0x8dd4ab){return _0x8dd4ab;});}return null;};}function removeEntity(_0x5c376f,_0x373267){return function(_0x4d483e){if(_0x4d483e){return _0x4d483e[_0x9bc4('0x2e')]()[_0x9bc4('0x2d')](function(){_0x5c376f[_0x9bc4('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20c3f5,_0x2da9c1){return function(_0x9b065f){if(!_0x9b065f){_0x20c3f5[_0x9bc4('0x24')](0x194);}return _0x9b065f;};}function handleError(_0x1c3b9d,_0x532261){_0x532261=_0x532261||0x1f4;return function(_0x3ce028){logger[_0x9bc4('0x2f')](_0x3ce028[_0x9bc4('0x30')]);if(_0x3ce028[_0x9bc4('0x31')]){delete _0x3ce028[_0x9bc4('0x31')];}_0x1c3b9d['status'](_0x532261)[_0x9bc4('0x32')](_0x3ce028);};}exports[_0x9bc4('0x33')]=function(_0xaa30ee,_0x11d619){var _0x24c319={},_0x1cb6bb={},_0x5c3fea={'count':0x0,'rows':[]};var _0x58bf65=_[_0x9bc4('0x34')](db[_0x9bc4('0x35')][_0x9bc4('0x36')],function(_0x4dbc2e){return{'name':_0x4dbc2e[_0x9bc4('0x37')],'type':_0x4dbc2e[_0x9bc4('0x38')]['key']};});_0x1cb6bb[_0x9bc4('0x39')]=_[_0x9bc4('0x34')](_0x58bf65,_0x9bc4('0x31'));_0x1cb6bb[_0x9bc4('0x3a')]=_[_0x9bc4('0x3b')](_0xaa30ee[_0x9bc4('0x3a')]);_0x1cb6bb['filters']=_[_0x9bc4('0x3c')](_0x1cb6bb[_0x9bc4('0x39')],_0x1cb6bb[_0x9bc4('0x3a')]);_0x24c319[_0x9bc4('0x3d')]=_[_0x9bc4('0x3c')](_0x1cb6bb[_0x9bc4('0x39')],qs[_0x9bc4('0x3e')](_0xaa30ee[_0x9bc4('0x3a')][_0x9bc4('0x3e')]));_0x24c319['attributes']=_0x24c319['attributes']['length']?_0x24c319['attributes']:_0x1cb6bb[_0x9bc4('0x39')];if(!_0xaa30ee['query'][_0x9bc4('0x3f')](_0x9bc4('0x40'))){_0x24c319[_0x9bc4('0x27')]=qs[_0x9bc4('0x27')](_0xaa30ee[_0x9bc4('0x3a')]['limit']);_0x24c319[_0x9bc4('0x26')]=qs[_0x9bc4('0x26')](_0xaa30ee[_0x9bc4('0x3a')]['offset']);}_0x24c319['order']=qs['sort'](_0xaa30ee[_0x9bc4('0x3a')]['sort']);_0x24c319[_0x9bc4('0x41')]=qs[_0x9bc4('0x42')](_['pick'](_0xaa30ee[_0x9bc4('0x3a')],_0x1cb6bb[_0x9bc4('0x42')]),_0x58bf65);if(_0xaa30ee[_0x9bc4('0x3a')][_0x9bc4('0x43')]){_0x24c319[_0x9bc4('0x41')]=_[_0x9bc4('0x44')](_0x24c319['where'],{'$or':_['map'](_0x58bf65,function(_0x50f48a){if(_0x50f48a[_0x9bc4('0x38')]!==_0x9bc4('0x45')){var _0x1c5f4f={};_0x1c5f4f[_0x50f48a[_0x9bc4('0x31')]]={'$like':'%'+_0xaa30ee[_0x9bc4('0x3a')]['filter']+'%'};return _0x1c5f4f;}})});}_0x24c319=_[_0x9bc4('0x44')]({},_0x24c319,_0xaa30ee[_0x9bc4('0x46')]);var _0xd73850={'where':_0x24c319[_0x9bc4('0x41')]};return db['VoiceQueueReport'][_0x9bc4('0x29')](_0xd73850)[_0x9bc4('0x2d')](function(_0x9da490){_0x5c3fea['count']=_0x9da490;if(_0xaa30ee[_0x9bc4('0x3a')][_0x9bc4('0x47')]){_0x24c319[_0x9bc4('0x48')]=[{'all':!![]}];}return db[_0x9bc4('0x35')][_0x9bc4('0x49')](_0x24c319);})[_0x9bc4('0x2d')](function(_0x57a33d){_0x5c3fea['rows']=_0x57a33d;return _0x5c3fea;})[_0x9bc4('0x2d')](respondWithFilteredResult(_0x11d619,_0x24c319))['catch'](handleError(_0x11d619,null));};exports[_0x9bc4('0x4a')]=function(_0x4605ed,_0x1174e6){var _0x4983f5={'raw':![],'where':{'id':_0x4605ed['params']['id']}},_0x275cb0={};_0x275cb0[_0x9bc4('0x39')]=_[_0x9bc4('0x3b')](db[_0x9bc4('0x35')][_0x9bc4('0x36')]);_0x275cb0[_0x9bc4('0x3a')]=_['keys'](_0x4605ed[_0x9bc4('0x3a')]);_0x275cb0[_0x9bc4('0x42')]=_[_0x9bc4('0x3c')](_0x275cb0['model'],_0x275cb0[_0x9bc4('0x3a')]);_0x4983f5[_0x9bc4('0x3d')]=_['intersection'](_0x275cb0[_0x9bc4('0x39')],qs[_0x9bc4('0x3e')](_0x4605ed['query'][_0x9bc4('0x3e')]));_0x4983f5[_0x9bc4('0x3d')]=_0x4983f5[_0x9bc4('0x3d')][_0x9bc4('0x4b')]?_0x4983f5[_0x9bc4('0x3d')]:_0x275cb0[_0x9bc4('0x39')];if(_0x4605ed[_0x9bc4('0x3a')]['includeAll']){_0x4983f5[_0x9bc4('0x48')]=[{'all':!![]}];}_0x4983f5=_[_0x9bc4('0x44')]({},_0x4983f5,_0x4605ed[_0x9bc4('0x46')]);return db[_0x9bc4('0x35')][_0x9bc4('0x4c')](_0x4983f5)[_0x9bc4('0x2d')](handleEntityNotFound(_0x1174e6,null))[_0x9bc4('0x2d')](respondWithResult(_0x1174e6,null))[_0x9bc4('0x4d')](handleError(_0x1174e6,null));};exports[_0x9bc4('0x4e')]=function(_0x11875b,_0x2af341){return db['VoiceQueueReport'][_0x9bc4('0x4e')](_0x11875b[_0x9bc4('0x4f')],{})[_0x9bc4('0x2d')](respondWithResult(_0x2af341,0xc9))['catch'](handleError(_0x2af341,null));};exports[_0x9bc4('0x2c')]=function(_0x50ed3f,_0x4ff146){if(_0x50ed3f['body']['id']){delete _0x50ed3f['body']['id'];}return db[_0x9bc4('0x35')][_0x9bc4('0x4c')]({'where':{'id':_0x50ed3f[_0x9bc4('0x50')]['id']}})[_0x9bc4('0x2d')](handleEntityNotFound(_0x4ff146,null))['then'](saveUpdates(_0x50ed3f[_0x9bc4('0x4f')],null))['then'](respondWithResult(_0x4ff146,null))[_0x9bc4('0x4d')](handleError(_0x4ff146,null));};exports[_0x9bc4('0x2e')]=function(_0x1de185,_0x3d4d94){return db['VoiceQueueReport']['find']({'where':{'id':_0x1de185[_0x9bc4('0x50')]['id']}})['then'](handleEntityNotFound(_0x3d4d94,null))[_0x9bc4('0x2d')](removeEntity(_0x3d4d94,null))[_0x9bc4('0x4d')](handleError(_0x3d4d94,null));};exports['describe']=function(_0x4c6179,_0x359b28){return db['VoiceQueueReport']['describe']()[_0x9bc4('0x2d')](respondWithResult(_0x359b28,null))['catch'](handleError(_0x359b28,null));};exports[_0x9bc4('0x51')]=function(_0x45019d,_0x10457e){var _0x5f510a={},_0x255216={},_0x9a59a5={'count':0x0,'rows':[]};_0x255216[_0x9bc4('0x39')]=_[_0x9bc4('0x3b')](db[_0x9bc4('0x35')][_0x9bc4('0x36')]);_0x255216[_0x9bc4('0x3a')]=_[_0x9bc4('0x3b')](_0x45019d[_0x9bc4('0x3a')]);_0x255216['filters']=_[_0x9bc4('0x3c')](_0x255216[_0x9bc4('0x39')],_0x255216[_0x9bc4('0x3a')]);_0x5f510a['attributes']=_[_0x9bc4('0x3c')](_0x255216[_0x9bc4('0x39')],qs[_0x9bc4('0x3e')](_0x45019d['query'][_0x9bc4('0x3e')]));_0x5f510a['attributes']=_0x5f510a['attributes'][_0x9bc4('0x4b')]?_0x5f510a[_0x9bc4('0x3d')]:_0x255216['model'];if(!_0x45019d[_0x9bc4('0x3a')][_0x9bc4('0x3f')](_0x9bc4('0x40'))){_0x5f510a[_0x9bc4('0x27')]=qs['limit'](_0x45019d['query'][_0x9bc4('0x27')]);_0x5f510a[_0x9bc4('0x26')]=qs[_0x9bc4('0x26')](_0x45019d[_0x9bc4('0x3a')][_0x9bc4('0x26')]);}_0x5f510a[_0x9bc4('0x52')]=qs[_0x9bc4('0x53')](_0x45019d[_0x9bc4('0x3a')][_0x9bc4('0x53')]);_0x5f510a[_0x9bc4('0x41')]=qs[_0x9bc4('0x42')](_[_0x9bc4('0x54')](_0x45019d[_0x9bc4('0x3a')],_0x255216[_0x9bc4('0x42')]));if(_0x45019d[_0x9bc4('0x3a')]['filter']){_0x5f510a[_0x9bc4('0x41')]=_['merge'](_0x5f510a['where'],{'$or':_[_0x9bc4('0x34')](_0x5f510a[_0x9bc4('0x3d')],function(_0x1aa8fc){var _0x2265c3={};_0x2265c3[_0x1aa8fc]={'$like':'%'+_0x45019d[_0x9bc4('0x3a')][_0x9bc4('0x43')]+'%'};return _0x2265c3;})});}_0x5f510a=_[_0x9bc4('0x44')]({},_0x5f510a,_0x45019d[_0x9bc4('0x46')]);var _0x48d9a9={'where':_0x5f510a[_0x9bc4('0x41')]};return db[_0x9bc4('0x35')]['count'](_0x48d9a9)['then'](function(_0x5a0d16){_0x9a59a5['count']=_0x5a0d16;if(_0x45019d[_0x9bc4('0x3a')]['includeAll']){_0x5f510a[_0x9bc4('0x48')]=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x5f510a);})[_0x9bc4('0x2d')](function(_0x5321bd){_0x9a59a5['rows']=_0x5321bd;return _0x9a59a5;})[_0x9bc4('0x2d')](respondWithFilteredResult(_0x10457e,_0x5f510a,_0x9bc4('0x51')))[_0x9bc4('0x4d')](handleError(_0x10457e,null,_0x9bc4('0x51')));}; \ No newline at end of file +var _0x8726=['destroy','then','error','stack','name','index','map','VoiceQueueReport','rawAttributes','fieldName','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','sort','filters','pick','where','merge','type','VIRTUAL','options','count','includeAll','include','rows','catch','params','find','create','body','describe','nolimit','order','filter','findAll','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','reject','save','update'];(function(_0x112fe3,_0x16b642){var _0x1ec903=function(_0x1539eb){while(--_0x1539eb){_0x112fe3['push'](_0x112fe3['shift']());}};_0x1ec903(++_0x16b642);}(_0x8726,0xc9));var _0x6872=function(_0x4180cf,_0x14ff11){_0x4180cf=_0x4180cf-0x0;var _0x48cf55=_0x8726[_0x4180cf];return _0x48cf55;};'use strict';var emlformat=require(_0x6872('0x0'));var rimraf=require(_0x6872('0x1'));var zipdir=require(_0x6872('0x2'));var jsonpatch=require(_0x6872('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6872('0x4'));var Mustache=require(_0x6872('0x5'));var util=require('util');var path=require(_0x6872('0x6'));var sox=require(_0x6872('0x7'));var csv=require(_0x6872('0x8'));var ejs=require(_0x6872('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6872('0xa'));var jsforce=require(_0x6872('0xb'));var deskjs=require(_0x6872('0xc'));var toCsv=require(_0x6872('0x8'));var querystring=require(_0x6872('0xd'));var Papa=require(_0x6872('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6872('0xf'));var as=require(_0x6872('0x10'));var hardwareService=require(_0x6872('0x11'));var logger=require(_0x6872('0x12'))(_0x6872('0x13'));var utils=require('../../config/utils');var config=require(_0x6872('0x14'));var licenseUtil=require(_0x6872('0x15'));var db=require(_0x6872('0x16'))['db'];config[_0x6872('0x17')]=_['defaults'](config[_0x6872('0x17')],{'host':_0x6872('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6872('0x17')]));require(_0x6872('0x19'))[_0x6872('0x1a')](socket);function respondWithStatusCode(_0x21eb03,_0x354066){_0x354066=_0x354066||0xcc;return function(_0x2d2a3f){if(_0x2d2a3f){return _0x21eb03[_0x6872('0x1b')](_0x354066);}return _0x21eb03[_0x6872('0x1c')](_0x354066)[_0x6872('0x1d')]();};}function respondWithResult(_0x1f8cae,_0x4ba3a5){_0x4ba3a5=_0x4ba3a5||0xc8;return function(_0x51b9c7){if(_0x51b9c7){return _0x1f8cae[_0x6872('0x1c')](_0x4ba3a5)[_0x6872('0x1e')](_0x51b9c7);}};}function respondWithFilteredResult(_0xbde4fc,_0x1926cb){return function(_0x3f8d89){if(_0x3f8d89){var _0x17ada7=typeof _0x1926cb[_0x6872('0x1f')]==='undefined'&&typeof _0x1926cb[_0x6872('0x20')]===_0x6872('0x21');var _0xb1ba27=_0x3f8d89['count'];var _0x4ce087=_0x17ada7?0x0:_0x1926cb[_0x6872('0x1f')];var _0x303b78=_0x17ada7?_0x3f8d89['count']:_0x1926cb[_0x6872('0x1f')]+_0x1926cb[_0x6872('0x20')];var _0x97ff1c;if(_0x303b78>=_0xb1ba27){_0x303b78=_0xb1ba27;_0x97ff1c=0xc8;}else{_0x97ff1c=0xce;}_0xbde4fc['status'](_0x97ff1c);return _0xbde4fc[_0x6872('0x22')](_0x6872('0x23'),_0x4ce087+'-'+_0x303b78+'/'+_0xb1ba27)[_0x6872('0x1e')](_0x3f8d89);}return null;};}function patchUpdates(_0x25a22e){return function(_0x145be7){try{jsonpatch['apply'](_0x145be7,_0x25a22e,!![]);}catch(_0x1e1876){return BPromise[_0x6872('0x24')](_0x1e1876);}return _0x145be7[_0x6872('0x25')]();};}function saveUpdates(_0x2f7b42,_0x1a3ff5){return function(_0x194eb6){if(_0x194eb6){return _0x194eb6[_0x6872('0x26')](_0x2f7b42)['then'](function(_0x234161){return _0x234161;});}return null;};}function removeEntity(_0x23c8dd,_0x31fa9f){return function(_0x18429e){if(_0x18429e){return _0x18429e[_0x6872('0x27')]()[_0x6872('0x28')](function(){_0x23c8dd[_0x6872('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33a78d,_0x3fa154){return function(_0x132b7){if(!_0x132b7){_0x33a78d[_0x6872('0x1b')](0x194);}return _0x132b7;};}function handleError(_0x12fb39,_0x225839){_0x225839=_0x225839||0x1f4;return function(_0x5582ff){logger[_0x6872('0x29')](_0x5582ff[_0x6872('0x2a')]);if(_0x5582ff[_0x6872('0x2b')]){delete _0x5582ff[_0x6872('0x2b')];}_0x12fb39['status'](_0x225839)['send'](_0x5582ff);};}exports[_0x6872('0x2c')]=function(_0x4e318d,_0x2fa524){var _0x505d85={},_0x1edc08={},_0x143455={'count':0x0,'rows':[]};var _0x259cbc=_[_0x6872('0x2d')](db[_0x6872('0x2e')][_0x6872('0x2f')],function(_0x3a3460){return{'name':_0x3a3460[_0x6872('0x30')],'type':_0x3a3460['type']['key']};});_0x1edc08['model']=_['map'](_0x259cbc,_0x6872('0x2b'));_0x1edc08[_0x6872('0x31')]=_[_0x6872('0x32')](_0x4e318d['query']);_0x1edc08['filters']=_[_0x6872('0x33')](_0x1edc08[_0x6872('0x34')],_0x1edc08[_0x6872('0x31')]);_0x505d85[_0x6872('0x35')]=_[_0x6872('0x33')](_0x1edc08[_0x6872('0x34')],qs[_0x6872('0x36')](_0x4e318d[_0x6872('0x31')][_0x6872('0x36')]));_0x505d85[_0x6872('0x35')]=_0x505d85[_0x6872('0x35')][_0x6872('0x37')]?_0x505d85[_0x6872('0x35')]:_0x1edc08['model'];if(!_0x4e318d['query'][_0x6872('0x38')]('nolimit')){_0x505d85[_0x6872('0x20')]=qs[_0x6872('0x20')](_0x4e318d[_0x6872('0x31')][_0x6872('0x20')]);_0x505d85['offset']=qs[_0x6872('0x1f')](_0x4e318d[_0x6872('0x31')]['offset']);}_0x505d85['order']=qs[_0x6872('0x39')](_0x4e318d[_0x6872('0x31')][_0x6872('0x39')]);_0x505d85['where']=qs[_0x6872('0x3a')](_[_0x6872('0x3b')](_0x4e318d[_0x6872('0x31')],_0x1edc08[_0x6872('0x3a')]),_0x259cbc);if(_0x4e318d[_0x6872('0x31')]['filter']){_0x505d85[_0x6872('0x3c')]=_[_0x6872('0x3d')](_0x505d85['where'],{'$or':_['map'](_0x259cbc,function(_0x4f19cc){if(_0x4f19cc[_0x6872('0x3e')]!==_0x6872('0x3f')){var _0x33884f={};_0x33884f[_0x4f19cc['name']]={'$like':'%'+_0x4e318d['query']['filter']+'%'};return _0x33884f;}})});}_0x505d85=_[_0x6872('0x3d')]({},_0x505d85,_0x4e318d[_0x6872('0x40')]);var _0x1d305a={'where':_0x505d85[_0x6872('0x3c')]};return db['VoiceQueueReport'][_0x6872('0x41')](_0x1d305a)['then'](function(_0x9a34ff){_0x143455['count']=_0x9a34ff;if(_0x4e318d[_0x6872('0x31')][_0x6872('0x42')]){_0x505d85[_0x6872('0x43')]=[{'all':!![]}];}return db[_0x6872('0x2e')]['findAll'](_0x505d85);})[_0x6872('0x28')](function(_0x394a25){_0x143455[_0x6872('0x44')]=_0x394a25;return _0x143455;})[_0x6872('0x28')](respondWithFilteredResult(_0x2fa524,_0x505d85))[_0x6872('0x45')](handleError(_0x2fa524,null));};exports['show']=function(_0x593c2b,_0x17e0e9){var _0x546a6f={'raw':![],'where':{'id':_0x593c2b[_0x6872('0x46')]['id']}},_0x892629={};_0x892629[_0x6872('0x34')]=_[_0x6872('0x32')](db[_0x6872('0x2e')][_0x6872('0x2f')]);_0x892629['query']=_[_0x6872('0x32')](_0x593c2b['query']);_0x892629[_0x6872('0x3a')]=_[_0x6872('0x33')](_0x892629[_0x6872('0x34')],_0x892629[_0x6872('0x31')]);_0x546a6f['attributes']=_[_0x6872('0x33')](_0x892629[_0x6872('0x34')],qs[_0x6872('0x36')](_0x593c2b[_0x6872('0x31')]['fields']));_0x546a6f['attributes']=_0x546a6f[_0x6872('0x35')][_0x6872('0x37')]?_0x546a6f[_0x6872('0x35')]:_0x892629['model'];if(_0x593c2b[_0x6872('0x31')][_0x6872('0x42')]){_0x546a6f['include']=[{'all':!![]}];}_0x546a6f=_[_0x6872('0x3d')]({},_0x546a6f,_0x593c2b['options']);return db['VoiceQueueReport'][_0x6872('0x47')](_0x546a6f)[_0x6872('0x28')](handleEntityNotFound(_0x17e0e9,null))[_0x6872('0x28')](respondWithResult(_0x17e0e9,null))[_0x6872('0x45')](handleError(_0x17e0e9,null));};exports[_0x6872('0x48')]=function(_0xb8ab54,_0x3b6c7a){return db[_0x6872('0x2e')][_0x6872('0x48')](_0xb8ab54['body'],{})['then'](respondWithResult(_0x3b6c7a,0xc9))[_0x6872('0x45')](handleError(_0x3b6c7a,null));};exports[_0x6872('0x26')]=function(_0x913316,_0x27e5e6){if(_0x913316['body']['id']){delete _0x913316[_0x6872('0x49')]['id'];}return db[_0x6872('0x2e')]['find']({'where':{'id':_0x913316[_0x6872('0x46')]['id']}})[_0x6872('0x28')](handleEntityNotFound(_0x27e5e6,null))[_0x6872('0x28')](saveUpdates(_0x913316[_0x6872('0x49')],null))['then'](respondWithResult(_0x27e5e6,null))[_0x6872('0x45')](handleError(_0x27e5e6,null));};exports[_0x6872('0x27')]=function(_0x5535c0,_0x50d7fb){return db[_0x6872('0x2e')][_0x6872('0x47')]({'where':{'id':_0x5535c0[_0x6872('0x46')]['id']}})[_0x6872('0x28')](handleEntityNotFound(_0x50d7fb,null))[_0x6872('0x28')](removeEntity(_0x50d7fb,null))[_0x6872('0x45')](handleError(_0x50d7fb,null));};exports[_0x6872('0x4a')]=function(_0x321c94,_0x47ca23){return db[_0x6872('0x2e')]['describe']()[_0x6872('0x28')](respondWithResult(_0x47ca23,null))[_0x6872('0x45')](handleError(_0x47ca23,null));};exports['getVoiceQueuesReport']=function(_0x56ba6d,_0x2b2da9){var _0x449521={},_0x20c3bb={},_0x543c99={'count':0x0,'rows':[]};_0x20c3bb[_0x6872('0x34')]=_[_0x6872('0x32')](db['VoiceQueueReport'][_0x6872('0x2f')]);_0x20c3bb[_0x6872('0x31')]=_[_0x6872('0x32')](_0x56ba6d[_0x6872('0x31')]);_0x20c3bb[_0x6872('0x3a')]=_[_0x6872('0x33')](_0x20c3bb[_0x6872('0x34')],_0x20c3bb[_0x6872('0x31')]);_0x449521[_0x6872('0x35')]=_[_0x6872('0x33')](_0x20c3bb['model'],qs[_0x6872('0x36')](_0x56ba6d[_0x6872('0x31')][_0x6872('0x36')]));_0x449521[_0x6872('0x35')]=_0x449521[_0x6872('0x35')]['length']?_0x449521[_0x6872('0x35')]:_0x20c3bb[_0x6872('0x34')];if(!_0x56ba6d['query'][_0x6872('0x38')](_0x6872('0x4b'))){_0x449521[_0x6872('0x20')]=qs[_0x6872('0x20')](_0x56ba6d[_0x6872('0x31')][_0x6872('0x20')]);_0x449521['offset']=qs['offset'](_0x56ba6d[_0x6872('0x31')][_0x6872('0x1f')]);}_0x449521[_0x6872('0x4c')]=qs[_0x6872('0x39')](_0x56ba6d[_0x6872('0x31')][_0x6872('0x39')]);_0x449521['where']=qs[_0x6872('0x3a')](_[_0x6872('0x3b')](_0x56ba6d['query'],_0x20c3bb[_0x6872('0x3a')]));if(_0x56ba6d[_0x6872('0x31')][_0x6872('0x4d')]){_0x449521[_0x6872('0x3c')]=_[_0x6872('0x3d')](_0x449521['where'],{'$or':_[_0x6872('0x2d')](_0x449521[_0x6872('0x35')],function(_0x60ba59){var _0xf78683={};_0xf78683[_0x60ba59]={'$like':'%'+_0x56ba6d[_0x6872('0x31')][_0x6872('0x4d')]+'%'};return _0xf78683;})});}_0x449521=_[_0x6872('0x3d')]({},_0x449521,_0x56ba6d[_0x6872('0x40')]);var _0x4b8bb8={'where':_0x449521[_0x6872('0x3c')]};return db['VoiceQueueReport'][_0x6872('0x41')](_0x4b8bb8)['then'](function(_0x3725f4){_0x543c99[_0x6872('0x41')]=_0x3725f4;if(_0x56ba6d['query']['includeAll']){_0x449521['include']=[{'all':!![]}];}return db[_0x6872('0x2e')][_0x6872('0x4e')](_0x449521);})[_0x6872('0x28')](function(_0x3b6b39){_0x543c99[_0x6872('0x44')]=_0x3b6b39;return _0x543c99;})['then'](respondWithFilteredResult(_0x2b2da9,_0x449521,_0x6872('0x4f')))['catch'](handleError(_0x2b2da9,null,_0x6872('0x4f')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index e6c5225..20b2e10 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 _0xd71b=['VoiceQueueReport','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x28dfed,_0x21cf26){var _0x72cfad=function(_0x4453ca){while(--_0x4453ca){_0x28dfed['push'](_0x28dfed['shift']());}};_0x72cfad(++_0x21cf26);}(_0xd71b,0xe9));var _0xbd71=function(_0x397a47,_0x1df1f2){_0x397a47=_0x397a47-0x0;var _0x568fd4=_0xd71b[_0x397a47];return _0x568fd4;};'use strict';var EventEmitter=require(_0xbd71('0x0'));var VoiceQueueReport=require('../../mysqldb')['db'][_0xbd71('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xbd71('0x2')](0x0);var events={'afterCreate':_0xbd71('0x3'),'afterUpdate':'update','afterDestroy':_0xbd71('0x4')};function emitEvent(_0x1cc3f1){return function(_0x3a97d8,_0x41ce1b,_0x57632b){VoiceQueueReportEvents[_0xbd71('0x5')](_0x1cc3f1+':'+_0x3a97d8['id'],_0x3a97d8);VoiceQueueReportEvents[_0xbd71('0x5')](_0x1cc3f1,_0x3a97d8);_0x57632b(null);};}for(var e in events){if(events[_0xbd71('0x6')](e)){var event=events[e];VoiceQueueReport[_0xbd71('0x7')](e,emitEvent(event));}}module[_0xbd71('0x8')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x59c4=['emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x3be43b,_0x3c10b3){var _0x2dc567=function(_0x2c33e8){while(--_0x2c33e8){_0x3be43b['push'](_0x3be43b['shift']());}};_0x2dc567(++_0x3c10b3);}(_0x59c4,0xb3));var _0x459c=function(_0x438dc7,_0x280a6d){_0x438dc7=_0x438dc7-0x0;var _0x48d11e=_0x59c4[_0x438dc7];return _0x48d11e;};'use strict';var EventEmitter=require(_0x459c('0x0'));var VoiceQueueReport=require(_0x459c('0x1'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x459c('0x2')](0x0);var events={'afterCreate':_0x459c('0x3'),'afterUpdate':_0x459c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x162677){return function(_0x18fa96,_0x2c55ee,_0x1c77d3){VoiceQueueReportEvents[_0x459c('0x5')](_0x162677+':'+_0x18fa96['id'],_0x18fa96);VoiceQueueReportEvents[_0x459c('0x5')](_0x162677,_0x18fa96);_0x1c77d3(null);};}for(var e in events){if(events[_0x459c('0x6')](e)){var event=events[e];VoiceQueueReport[_0x459c('0x7')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 0cabeec..34812b1 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 _0x8d3e=['../../config/environment','./voiceQueueReport.attributes','exports','define','report_queue','calleridnum','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x23c5b4,_0x22bf64){var _0x186d84=function(_0x13529d){while(--_0x13529d){_0x23c5b4['push'](_0x23c5b4['shift']());}};_0x186d84(++_0x22bf64);}(_0x8d3e,0x1b3));var _0xe8d3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8d3e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe8d3('0x0'));var util=require('util');var logger=require(_0xe8d3('0x1'))(_0xe8d3('0x2'));var moment=require(_0xe8d3('0x3'));var BPromise=require(_0xe8d3('0x4'));var rp=require(_0xe8d3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe8d3('0x6'));var config=require(_0xe8d3('0x7'));var attributes=require(_0xe8d3('0x8'));module[_0xe8d3('0x9')]=function(_0x2c6e0d,_0x194ae4){return _0x2c6e0d[_0xe8d3('0xa')]('VoiceQueueReport',attributes,{'tableName':_0xe8d3('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0xe8d3('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa535=['./voiceQueueReport.attributes','exports','define','VoiceQueueReport','uniqueid','calleridnum','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa535,0x19b));var _0x5a53=function(_0x86e157,_0x596146){_0x86e157=_0x86e157-0x0;var _0x4be032=_0xa535[_0x86e157];return _0x4be032;};'use strict';var _=require(_0x5a53('0x0'));var util=require(_0x5a53('0x1'));var logger=require(_0x5a53('0x2'))(_0x5a53('0x3'));var moment=require(_0x5a53('0x4'));var BPromise=require(_0x5a53('0x5'));var rp=require(_0x5a53('0x6'));var fs=require('fs');var path=require(_0x5a53('0x7'));var rimraf=require('rimraf');var config=require(_0x5a53('0x8'));var attributes=require(_0x5a53('0x9'));module[_0x5a53('0xa')]=function(_0x626a0e,_0x33d57f){return _0x626a0e[_0x5a53('0xb')](_0x5a53('0xc'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0x5a53('0xd')]},{'fields':[_0x5a53('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 6180c4d..8f45932 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 _0xd65c=['limit','UpdateVoiceQueueReport','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise','http','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','attributes','include','model','then','CreateVoiceQueueReport','create','body','where'];(function(_0xf8f22e,_0x598340){var _0x406bd8=function(_0x1e11f9){while(--_0x1e11f9){_0xf8f22e['push'](_0xf8f22e['shift']());}};_0x406bd8(++_0x598340);}(_0xd65c,0x1f0));var _0xcd65=function(_0x1ed298,_0x514c16){_0x1ed298=_0x1ed298-0x0;var _0xdc6426=_0xd65c[_0x1ed298];return _0xdc6426;};'use strict';var _=require(_0xcd65('0x0'));var util=require('util');var moment=require(_0xcd65('0x1'));var BPromise=require(_0xcd65('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcd65('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcd65('0x4'));var logger=require(_0xcd65('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xcd65('0x6'));var client=jayson['client'][_0xcd65('0x7')]({'port':0x232a});config['redis']=_['defaults'](config[_0xcd65('0x8')],{'host':_0xcd65('0x9'),'port':0x18eb});var socket=require(_0xcd65('0xa'))(new Redis(config[_0xcd65('0x8')]));require(_0xcd65('0xb'))[_0xcd65('0xc')](socket);function respondWithRpcPromise(_0x40700d,_0x30da38,_0x4c2c8d){return new BPromise(function(_0xa43b29,_0x470151){return client[_0xcd65('0xd')](_0x40700d,_0x4c2c8d)['then'](function(_0x19ddeb){logger[_0xcd65('0xe')](_0xcd65('0xf'),_0x30da38,_0xcd65('0x10'));logger[_0xcd65('0x11')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x30da38,_0xcd65('0x10'),JSON[_0xcd65('0x12')](_0x19ddeb));if(_0x19ddeb[_0xcd65('0x13')]){if(_0x19ddeb[_0xcd65('0x13')][_0xcd65('0x14')]===0x1f4){logger[_0xcd65('0x13')](_0xcd65('0xf'),_0x30da38,_0x19ddeb[_0xcd65('0x13')][_0xcd65('0x15')]);return _0x470151(_0x19ddeb['error'][_0xcd65('0x15')]);}logger[_0xcd65('0x13')](_0xcd65('0xf'),_0x30da38,_0x19ddeb[_0xcd65('0x13')][_0xcd65('0x15')]);return _0xa43b29(_0x19ddeb[_0xcd65('0x13')][_0xcd65('0x15')]);}else{logger[_0xcd65('0xe')](_0xcd65('0xf'),_0x30da38,_0xcd65('0x10'));_0xa43b29(_0x19ddeb['result'][_0xcd65('0x15')]);}})[_0xcd65('0x16')](function(_0x2777f7){logger[_0xcd65('0x13')](_0xcd65('0xf'),_0x30da38,_0x2777f7);_0x470151(_0x2777f7);});});}exports[_0xcd65('0x17')]=function(_0x17f5eb){var _0x18376e=this;return new Promise(function(_0x134541,_0x201413){return db[_0xcd65('0x18')][_0xcd65('0x19')]({'raw':_0x17f5eb[_0xcd65('0x1a')]?_0x17f5eb[_0xcd65('0x1a')][_0xcd65('0x1b')]===undefined?!![]:![]:!![],'where':_0x17f5eb[_0xcd65('0x1a')]?_0x17f5eb['options']['where']||null:null,'attributes':_0x17f5eb[_0xcd65('0x1a')]?_0x17f5eb[_0xcd65('0x1a')][_0xcd65('0x1c')]||null:null,'limit':_0x17f5eb[_0xcd65('0x1a')]?_0x17f5eb['options']['limit']||null:null,'include':_0x17f5eb['options']?_0x17f5eb[_0xcd65('0x1a')]['include']?_['map'](_0x17f5eb['options'][_0xcd65('0x1d')],function(_0xfb7d2d){return{'model':db[_0xfb7d2d[_0xcd65('0x1e')]],'as':_0xfb7d2d['as'],'attributes':_0xfb7d2d[_0xcd65('0x1c')],'include':_0xfb7d2d[_0xcd65('0x1d')]?_['map'](_0xfb7d2d['include'],function(_0x3a5b41){return{'model':db[_0x3a5b41['model']],'as':_0x3a5b41['as'],'attributes':_0x3a5b41[_0xcd65('0x1c')],'include':_0x3a5b41[_0xcd65('0x1d')]?_['map'](_0x3a5b41[_0xcd65('0x1d')],function(_0x37300e){return{'model':db[_0x37300e[_0xcd65('0x1e')]],'as':_0x37300e['as'],'attributes':_0x37300e[_0xcd65('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xcd65('0x1f')](function(_0x364bf3){logger[_0xcd65('0xe')](_0xcd65('0x17'),_0x17f5eb);logger[_0xcd65('0x11')](_0xcd65('0x17'),_0x17f5eb,JSON[_0xcd65('0x12')](_0x364bf3));_0x134541(_0x364bf3);})[_0xcd65('0x16')](function(_0x1e3226){logger[_0xcd65('0x13')]('GetVoiceQueueReport',_0x1e3226[_0xcd65('0x15')],_0x17f5eb);_0x201413(_0x18376e['error'](0x1f4,_0x1e3226['message']));});});};exports[_0xcd65('0x20')]=function(_0x4cd123){var _0x207dfd=this;return new Promise(function(_0x2bf43e,_0x318e81){return db[_0xcd65('0x18')][_0xcd65('0x21')](_0x4cd123[_0xcd65('0x22')],{'raw':_0x4cd123['options']?_0x4cd123[_0xcd65('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xcd65('0x1f')](function(_0x65f59e){logger[_0xcd65('0xe')]('CreateVoiceQueueReport',_0x4cd123);logger[_0xcd65('0x11')]('CreateVoiceQueueReport',_0x4cd123,JSON[_0xcd65('0x12')](_0x65f59e));_0x2bf43e(_0x65f59e);})[_0xcd65('0x16')](function(_0x595389){logger['error'](_0xcd65('0x20'),_0x595389['message'],_0x4cd123);_0x318e81(_0x207dfd[_0xcd65('0x13')](0x1f4,_0x595389['message']));});});};exports['UpdateVoiceQueueReport']=function(_0x1e0e87){var _0x507726=this;return new Promise(function(_0x14a84a,_0x1b0471){return db[_0xcd65('0x18')]['update'](_0x1e0e87[_0xcd65('0x22')],{'raw':_0x1e0e87[_0xcd65('0x1a')]?_0x1e0e87[_0xcd65('0x1a')][_0xcd65('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e0e87[_0xcd65('0x1a')]?_0x1e0e87[_0xcd65('0x1a')][_0xcd65('0x23')]||null:null,'attributes':_0x1e0e87['options']?_0x1e0e87[_0xcd65('0x1a')]['attributes']||null:null,'limit':_0x1e0e87[_0xcd65('0x1a')]?_0x1e0e87[_0xcd65('0x1a')][_0xcd65('0x24')]||null:null})[_0xcd65('0x1f')](function(_0x198b18){logger[_0xcd65('0xe')](_0xcd65('0x25'),_0x1e0e87);logger[_0xcd65('0x11')](_0xcd65('0x25'),_0x1e0e87,JSON['stringify'](_0x198b18));_0x14a84a(_0x198b18);})[_0xcd65('0x16')](function(_0x2e5cfc){logger[_0xcd65('0x13')](_0xcd65('0x25'),_0x2e5cfc[_0xcd65('0x15')],_0x1e0e87);_0x1b0471(_0x507726['error'](0x1f4,_0x2e5cfc[_0xcd65('0x15')]));});});}; \ No newline at end of file +var _0xd605=['rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','VoiceQueueReport,\x20%s,\x20%s','message','request\x20sent','result','catch','GetVoiceQueueReport','findAll','options','raw','where','limit','include','map','attributes','model','debug','VoiceQueueReport','create','CreateVoiceQueueReport','update','body','UpdateVoiceQueueReport','util','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x356aaa,_0x28c697){var _0x158c0e=function(_0x47bd1c){while(--_0x47bd1c){_0x356aaa['push'](_0x356aaa['shift']());}};_0x158c0e(++_0x28c697);}(_0xd605,0x195));var _0x5d60=function(_0x1e9089,_0x2c5f49){_0x1e9089=_0x1e9089-0x0;var _0x5029ef=_0xd605[_0x1e9089];return _0x5029ef;};'use strict';var _=require('lodash');var util=require(_0x5d60('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5d60('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5d60('0x2'))['db'];var utils=require(_0x5d60('0x3'));var logger=require(_0x5d60('0x4'))(_0x5d60('0x5'));var config=require(_0x5d60('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5d60('0x7')]({'port':0x232a});config[_0x5d60('0x8')]=_[_0x5d60('0x9')](config[_0x5d60('0x8')],{'host':_0x5d60('0xa'),'port':0x18eb});var socket=require(_0x5d60('0xb'))(new Redis(config[_0x5d60('0x8')]));require('./voiceQueueReport.socket')[_0x5d60('0xc')](socket);function respondWithRpcPromise(_0xf12644,_0x62c014,_0x269a91){return new BPromise(function(_0x3b1527,_0x16a85a){return client[_0x5d60('0xd')](_0xf12644,_0x269a91)[_0x5d60('0xe')](function(_0x3d86de){logger[_0x5d60('0xf')]('VoiceQueueReport,\x20%s,\x20%s',_0x62c014,'request\x20sent');logger['debug'](_0x5d60('0x10'),_0x62c014,'request\x20sent',JSON[_0x5d60('0x11')](_0x3d86de));if(_0x3d86de[_0x5d60('0x12')]){if(_0x3d86de[_0x5d60('0x12')]['code']===0x1f4){logger[_0x5d60('0x12')](_0x5d60('0x13'),_0x62c014,_0x3d86de[_0x5d60('0x12')][_0x5d60('0x14')]);return _0x16a85a(_0x3d86de[_0x5d60('0x12')]['message']);}logger[_0x5d60('0x12')](_0x5d60('0x13'),_0x62c014,_0x3d86de['error'][_0x5d60('0x14')]);return _0x3b1527(_0x3d86de[_0x5d60('0x12')][_0x5d60('0x14')]);}else{logger[_0x5d60('0xf')](_0x5d60('0x13'),_0x62c014,_0x5d60('0x15'));_0x3b1527(_0x3d86de[_0x5d60('0x16')][_0x5d60('0x14')]);}})[_0x5d60('0x17')](function(_0x3689e7){logger[_0x5d60('0x12')](_0x5d60('0x13'),_0x62c014,_0x3689e7);_0x16a85a(_0x3689e7);});});}exports[_0x5d60('0x18')]=function(_0x175b4a){var _0x1d9c5a=this;return new Promise(function(_0x11a83e,_0x5821d4){return db['VoiceQueueReport'][_0x5d60('0x19')]({'raw':_0x175b4a[_0x5d60('0x1a')]?_0x175b4a[_0x5d60('0x1a')][_0x5d60('0x1b')]===undefined?!![]:![]:!![],'where':_0x175b4a[_0x5d60('0x1a')]?_0x175b4a[_0x5d60('0x1a')][_0x5d60('0x1c')]||null:null,'attributes':_0x175b4a['options']?_0x175b4a[_0x5d60('0x1a')]['attributes']||null:null,'limit':_0x175b4a['options']?_0x175b4a[_0x5d60('0x1a')][_0x5d60('0x1d')]||null:null,'include':_0x175b4a[_0x5d60('0x1a')]?_0x175b4a['options'][_0x5d60('0x1e')]?_[_0x5d60('0x1f')](_0x175b4a[_0x5d60('0x1a')][_0x5d60('0x1e')],function(_0x3e8d73){return{'model':db[_0x3e8d73['model']],'as':_0x3e8d73['as'],'attributes':_0x3e8d73[_0x5d60('0x20')],'include':_0x3e8d73['include']?_[_0x5d60('0x1f')](_0x3e8d73[_0x5d60('0x1e')],function(_0x867e15){return{'model':db[_0x867e15[_0x5d60('0x21')]],'as':_0x867e15['as'],'attributes':_0x867e15['attributes'],'include':_0x867e15[_0x5d60('0x1e')]?_[_0x5d60('0x1f')](_0x867e15['include'],function(_0x4d55b0){return{'model':db[_0x4d55b0[_0x5d60('0x21')]],'as':_0x4d55b0['as'],'attributes':_0x4d55b0[_0x5d60('0x20')]};}):[]};}):[]};}):[]:[]})[_0x5d60('0xe')](function(_0x2c3e32){logger[_0x5d60('0xf')]('GetVoiceQueueReport',_0x175b4a);logger[_0x5d60('0x22')](_0x5d60('0x18'),_0x175b4a,JSON[_0x5d60('0x11')](_0x2c3e32));_0x11a83e(_0x2c3e32);})['catch'](function(_0x9f11a1){logger[_0x5d60('0x12')](_0x5d60('0x18'),_0x9f11a1[_0x5d60('0x14')],_0x175b4a);_0x5821d4(_0x1d9c5a[_0x5d60('0x12')](0x1f4,_0x9f11a1[_0x5d60('0x14')]));});});};exports['CreateVoiceQueueReport']=function(_0x13791f){var _0x3e7cdc=this;return new Promise(function(_0x1104c9,_0x14d8de){return db[_0x5d60('0x23')][_0x5d60('0x24')](_0x13791f['body'],{'raw':_0x13791f['options']?_0x13791f[_0x5d60('0x1a')][_0x5d60('0x1b')]===undefined?!![]:![]:!![]})[_0x5d60('0xe')](function(_0xfd4e91){logger[_0x5d60('0xf')]('CreateVoiceQueueReport',_0x13791f);logger[_0x5d60('0x22')]('CreateVoiceQueueReport',_0x13791f,JSON[_0x5d60('0x11')](_0xfd4e91));_0x1104c9(_0xfd4e91);})[_0x5d60('0x17')](function(_0x322483){logger[_0x5d60('0x12')](_0x5d60('0x25'),_0x322483[_0x5d60('0x14')],_0x13791f);_0x14d8de(_0x3e7cdc[_0x5d60('0x12')](0x1f4,_0x322483[_0x5d60('0x14')]));});});};exports['UpdateVoiceQueueReport']=function(_0x49adf5){var _0x580988=this;return new Promise(function(_0x4027f8,_0xc06594){return db[_0x5d60('0x23')][_0x5d60('0x26')](_0x49adf5[_0x5d60('0x27')],{'raw':_0x49adf5['options']?_0x49adf5[_0x5d60('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x49adf5[_0x5d60('0x1a')]?_0x49adf5['options']['where']||null:null,'attributes':_0x49adf5[_0x5d60('0x1a')]?_0x49adf5[_0x5d60('0x1a')][_0x5d60('0x20')]||null:null,'limit':_0x49adf5[_0x5d60('0x1a')]?_0x49adf5[_0x5d60('0x1a')]['limit']||null:null})[_0x5d60('0xe')](function(_0x528a63){logger[_0x5d60('0xf')](_0x5d60('0x28'),_0x49adf5);logger[_0x5d60('0x22')]('UpdateVoiceQueueReport',_0x49adf5,JSON[_0x5d60('0x11')](_0x528a63));_0x4027f8(_0x528a63);})['catch'](function(_0x3806b6){logger[_0x5d60('0x12')]('UpdateVoiceQueueReport',_0x3806b6[_0x5d60('0x14')],_0x49adf5);_0xc06594(_0x580988[_0x5d60('0x12')](0x1f4,_0x3806b6['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index c5b39d8..b28cac8 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 _0x3561=['voiceQueueReport:','./voiceQueueReport.events','remove','update','emit','removeListener','register'];(function(_0x2798ee,_0x3785a0){var _0x43c9cd=function(_0x3b9e6c){while(--_0x3b9e6c){_0x2798ee['push'](_0x2798ee['shift']());}};_0x43c9cd(++_0x3785a0);}(_0x3561,0x94));var _0x1356=function(_0x3795f6,_0x1ca93d){_0x3795f6=_0x3795f6-0x0;var _0x1cd73c=_0x3561[_0x3795f6];return _0x1cd73c;};'use strict';var VoiceQueueReportEvents=require(_0x1356('0x0'));var events=['save',_0x1356('0x1'),_0x1356('0x2')];function createListener(_0x8ef5f,_0x14465e){return function(_0x442fbc){_0x14465e[_0x1356('0x3')](_0x8ef5f,_0x442fbc);};}function removeListener(_0x1634de,_0x116ff0){return function(){VoiceQueueReportEvents[_0x1356('0x4')](_0x1634de,_0x116ff0);};}exports[_0x1356('0x5')]=function(_0x417d11){for(var _0x36e81f=0x0,_0x45ac56=events['length'];_0x36e81f<_0x45ac56;_0x36e81f++){var _0x105aaf=events[_0x36e81f];var _0x33529f=createListener(_0x1356('0x6')+_0x105aaf,_0x417d11);VoiceQueueReportEvents['on'](_0x105aaf,_0x33529f);}}; \ No newline at end of file +var _0x770d=['length','voiceQueueReport:','./voiceQueueReport.events','save','remove','update','removeListener','register'];(function(_0x2446ef,_0x5b42d5){var _0x53e0a9=function(_0xd9637b){while(--_0xd9637b){_0x2446ef['push'](_0x2446ef['shift']());}};_0x53e0a9(++_0x5b42d5);}(_0x770d,0x122));var _0xd770=function(_0x50dfa5,_0x2d0564){_0x50dfa5=_0x50dfa5-0x0;var _0x24331c=_0x770d[_0x50dfa5];return _0x24331c;};'use strict';var VoiceQueueReportEvents=require(_0xd770('0x0'));var events=[_0xd770('0x1'),_0xd770('0x2'),_0xd770('0x3')];function createListener(_0x286d89,_0x2b9932){return function(_0x742a9a){_0x2b9932['emit'](_0x286d89,_0x742a9a);};}function removeListener(_0x2ce50a,_0x3ac59f){return function(){VoiceQueueReportEvents[_0xd770('0x4')](_0x2ce50a,_0x3ac59f);};}exports[_0xd770('0x5')]=function(_0x5d3b18){for(var _0x554c5e=0x0,_0x2d73bd=events[_0xd770('0x6')];_0x554c5e<_0x2d73bd;_0x554c5e++){var _0x2224c4=events[_0x554c5e];var _0x433e3d=createListener(_0xd770('0x7')+_0x2224c4,_0x5d3b18);VoiceQueueReportEvents['on'](_0x2224c4,_0x433e3d);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index c1df3f1..f666cdb 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 _0x3ee9=['get','isAuthenticated','index','/:id','show','post','update','delete','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller'];(function(_0x307bf7,_0x315dce){var _0x578e59=function(_0x2214c3){while(--_0x2214c3){_0x307bf7['push'](_0x307bf7['shift']());}};_0x578e59(++_0x315dce);}(_0x3ee9,0xd5));var _0x93ee=function(_0xcf6d0d,_0x490049){_0xcf6d0d=_0xcf6d0d-0x0;var _0x4bc54e=_0x3ee9[_0xcf6d0d];return _0x4bc54e;};'use strict';var multer=require(_0x93ee('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x93ee('0x1'));var express=require('express');var router=express[_0x93ee('0x2')]();var fs_extra=require(_0x93ee('0x3'));var auth=require(_0x93ee('0x4'));var interaction=require(_0x93ee('0x5'));var config=require(_0x93ee('0x6'));var controller=require(_0x93ee('0x7'));router[_0x93ee('0x8')]('/',auth[_0x93ee('0x9')](),controller[_0x93ee('0xa')]);router[_0x93ee('0x8')](_0x93ee('0xb'),auth[_0x93ee('0x9')](),controller[_0x93ee('0xc')]);router[_0x93ee('0xd')]('/',auth[_0x93ee('0x9')](),controller['create']);router['put'](_0x93ee('0xb'),auth[_0x93ee('0x9')](),controller[_0x93ee('0xe')]);router[_0x93ee('0xf')](_0x93ee('0xb'),auth[_0x93ee('0x9')](),controller['destroy']);module[_0x93ee('0x10')]=router; \ No newline at end of file +var _0x01fe=['delete','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','create','update'];(function(_0x260984,_0xd92137){var _0x473fad=function(_0x1a4d86){while(--_0x1a4d86){_0x260984['push'](_0x260984['shift']());}};_0x473fad(++_0xd92137);}(_0x01fe,0x102));var _0xe01f=function(_0x5a3a57,_0x57a585){_0x5a3a57=_0x5a3a57-0x0;var _0xbcf2ec=_0x01fe[_0x5a3a57];return _0xbcf2ec;};'use strict';var multer=require(_0xe01f('0x0'));var util=require('util');var path=require(_0xe01f('0x1'));var timeout=require(_0xe01f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe01f('0x3'));var auth=require(_0xe01f('0x4'));var interaction=require(_0xe01f('0x5'));var config=require(_0xe01f('0x6'));var controller=require('./voiceQueuesLog.controller');router[_0xe01f('0x7')]('/',auth['isAuthenticated'](),controller[_0xe01f('0x8')]);router[_0xe01f('0x7')](_0xe01f('0x9'),auth[_0xe01f('0xa')](),controller[_0xe01f('0xb')]);router['post']('/',auth[_0xe01f('0xa')](),controller[_0xe01f('0xc')]);router['put'](_0xe01f('0x9'),auth['isAuthenticated'](),controller[_0xe01f('0xd')]);router[_0xe01f('0xe')]('/:id',auth[_0xe01f('0xa')](),controller['destroy']);module[_0xe01f('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index a5ca7a1..3e77d8c 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 _0x2653=['STRING','DATE','literal','exports'];(function(_0x1b8d87,_0x4168fb){var _0x182b74=function(_0x12b570){while(--_0x12b570){_0x1b8d87['push'](_0x1b8d87['shift']());}};_0x182b74(++_0x4168fb);}(_0x2653,0x127));var _0x3265=function(_0x2c677e,_0x526777){_0x2c677e=_0x2c677e-0x0;var _0x2c2f48=_0x2653[_0x2c677e];return _0x2c2f48;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x3265('0x0')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x3265('0x1')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x3265('0x1')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x3265('0x1')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x3265('0x1')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x3265('0x1')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x3265('0x2')],'allowNull':![],'defaultValue':Sequelize[_0x3265('0x3')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0xfb9b=['exports','STRING','DATE','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','moment'];(function(_0xa6b2f7,_0x512928){var _0x113157=function(_0x39212d){while(--_0x39212d){_0xa6b2f7['push'](_0xa6b2f7['shift']());}};_0x113157(++_0x512928);}(_0xfb9b,0x178));var _0xbfb9=function(_0x8e6ce5,_0x3a3132){_0x8e6ce5=_0x8e6ce5-0x0;var _0x49af53=_0xfb9b[_0x8e6ce5];return _0x49af53;};'use strict';var Sequelize=require(_0xbfb9('0x0'));var moment=require(_0xbfb9('0x1'));module[_0xbfb9('0x2')]={'time':{'type':Sequelize[_0xbfb9('0x3')]},'callid':{'type':Sequelize[_0xbfb9('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xbfb9('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xbfb9('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xbfb9('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xbfb9('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xbfb9('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xbfb9('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xbfb9('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xbfb9('0x4')],'allowNull':![],'defaultValue':Sequelize[_0xbfb9('0x5')](_0xbfb9('0x6'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 8f7e09a..c05edd4 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 _0xfc35=['sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','VoiceQueuesLog','type','key','model','map','name','query','keys','intersection','fields','attributes','length','order','sort','where','filters','pick','filter','merge','options','count','includeAll','include','rows','catch','show','params','find','create','body','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xfc35,0x108));var _0x5fc3=function(_0x548c56,_0x35663e){_0x548c56=_0x548c56-0x0;var _0x215d0a=_0xfc35[_0x548c56];return _0x215d0a;};'use strict';var emlformat=require(_0x5fc3('0x0'));var rimraf=require(_0x5fc3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5fc3('0x2'));var moment=require(_0x5fc3('0x3'));var BPromise=require(_0x5fc3('0x4'));var Mustache=require(_0x5fc3('0x5'));var util=require('util');var path=require(_0x5fc3('0x6'));var sox=require(_0x5fc3('0x7'));var csv=require(_0x5fc3('0x8'));var ejs=require(_0x5fc3('0x9'));var fs=require('fs');var fs_extra=require(_0x5fc3('0xa'));var _=require(_0x5fc3('0xb'));var squel=require('squel');var crypto=require(_0x5fc3('0xc'));var jsforce=require(_0x5fc3('0xd'));var deskjs=require(_0x5fc3('0xe'));var toCsv=require(_0x5fc3('0x8'));var querystring=require(_0x5fc3('0xf'));var Papa=require(_0x5fc3('0x10'));var Redis=require('ioredis');var authService=require(_0x5fc3('0x11'));var qs=require(_0x5fc3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5fc3('0x13'))(_0x5fc3('0x14'));var utils=require(_0x5fc3('0x15'));var config=require(_0x5fc3('0x16'));var licenseUtil=require(_0x5fc3('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49922a,_0x2b8906){_0x2b8906=_0x2b8906||0xcc;return function(_0x53ba08){if(_0x53ba08){return _0x49922a[_0x5fc3('0x18')](_0x2b8906);}return _0x49922a[_0x5fc3('0x19')](_0x2b8906)[_0x5fc3('0x1a')]();};}function respondWithResult(_0x1be50b,_0x4bf419){_0x4bf419=_0x4bf419||0xc8;return function(_0xec51c){if(_0xec51c){return _0x1be50b['status'](_0x4bf419)[_0x5fc3('0x1b')](_0xec51c);}};}function respondWithFilteredResult(_0x289dd2,_0x3dcb2d){return function(_0x43c89a){if(_0x43c89a){var _0x2d97e6=typeof _0x3dcb2d[_0x5fc3('0x1c')]==='undefined'&&typeof _0x3dcb2d[_0x5fc3('0x1d')]==='undefined';var _0x2d648f=_0x43c89a['count'];var _0x544d20=_0x2d97e6?0x0:_0x3dcb2d['offset'];var _0x306e25=_0x2d97e6?_0x43c89a['count']:_0x3dcb2d[_0x5fc3('0x1c')]+_0x3dcb2d['limit'];var _0x692928;if(_0x306e25>=_0x2d648f){_0x306e25=_0x2d648f;_0x692928=0xc8;}else{_0x692928=0xce;}_0x289dd2[_0x5fc3('0x19')](_0x692928);return _0x289dd2[_0x5fc3('0x1e')](_0x5fc3('0x1f'),_0x544d20+'-'+_0x306e25+'/'+_0x2d648f)[_0x5fc3('0x1b')](_0x43c89a);}return null;};}function patchUpdates(_0x3f3198){return function(_0x4fe7f4){try{jsonpatch[_0x5fc3('0x20')](_0x4fe7f4,_0x3f3198,!![]);}catch(_0x4cb2d6){return BPromise[_0x5fc3('0x21')](_0x4cb2d6);}return _0x4fe7f4[_0x5fc3('0x22')]();};}function saveUpdates(_0x25aeaf,_0x1ef508){return function(_0x129c0d){if(_0x129c0d){return _0x129c0d[_0x5fc3('0x23')](_0x25aeaf)[_0x5fc3('0x24')](function(_0x49657e){return _0x49657e;});}return null;};}function removeEntity(_0xbe282b,_0x321521){return function(_0x1a9f15){if(_0x1a9f15){return _0x1a9f15[_0x5fc3('0x25')]()[_0x5fc3('0x24')](function(){_0xbe282b[_0x5fc3('0x19')](0xcc)[_0x5fc3('0x1a')]();});}};}function handleEntityNotFound(_0x223b05,_0x15a873){return function(_0x31b088){if(!_0x31b088){_0x223b05['sendStatus'](0x194);}return _0x31b088;};}function handleError(_0x552724,_0x559f70){_0x559f70=_0x559f70||0x1f4;return function(_0x121e52){logger[_0x5fc3('0x26')](_0x121e52[_0x5fc3('0x27')]);if(_0x121e52['name']){delete _0x121e52['name'];}_0x552724['status'](_0x559f70)[_0x5fc3('0x28')](_0x121e52);};}exports[_0x5fc3('0x29')]=function(_0x2a299d,_0x39917a){var _0x5cd8c9={},_0x58c3d1={},_0xe48161={'count':0x0,'rows':[]};var _0xbefe13=_['map'](db[_0x5fc3('0x2a')]['rawAttributes'],function(_0x10c606){return{'name':_0x10c606['fieldName'],'type':_0x10c606[_0x5fc3('0x2b')][_0x5fc3('0x2c')]};});_0x58c3d1[_0x5fc3('0x2d')]=_[_0x5fc3('0x2e')](_0xbefe13,_0x5fc3('0x2f'));_0x58c3d1[_0x5fc3('0x30')]=_[_0x5fc3('0x31')](_0x2a299d[_0x5fc3('0x30')]);_0x58c3d1['filters']=_[_0x5fc3('0x32')](_0x58c3d1[_0x5fc3('0x2d')],_0x58c3d1[_0x5fc3('0x30')]);_0x5cd8c9['attributes']=_[_0x5fc3('0x32')](_0x58c3d1[_0x5fc3('0x2d')],qs['fields'](_0x2a299d[_0x5fc3('0x30')][_0x5fc3('0x33')]));_0x5cd8c9['attributes']=_0x5cd8c9[_0x5fc3('0x34')][_0x5fc3('0x35')]?_0x5cd8c9[_0x5fc3('0x34')]:_0x58c3d1[_0x5fc3('0x2d')];if(!_0x2a299d[_0x5fc3('0x30')]['hasOwnProperty']('nolimit')){_0x5cd8c9[_0x5fc3('0x1d')]=qs['limit'](_0x2a299d[_0x5fc3('0x30')][_0x5fc3('0x1d')]);_0x5cd8c9['offset']=qs['offset'](_0x2a299d['query']['offset']);}_0x5cd8c9[_0x5fc3('0x36')]=qs[_0x5fc3('0x37')](_0x2a299d[_0x5fc3('0x30')][_0x5fc3('0x37')]);_0x5cd8c9[_0x5fc3('0x38')]=qs[_0x5fc3('0x39')](_[_0x5fc3('0x3a')](_0x2a299d[_0x5fc3('0x30')],_0x58c3d1['filters']),_0xbefe13);if(_0x2a299d[_0x5fc3('0x30')]['filter']){_0x5cd8c9['where']=_['merge'](_0x5cd8c9[_0x5fc3('0x38')],{'$or':_[_0x5fc3('0x2e')](_0xbefe13,function(_0x2d05d1){if(_0x2d05d1[_0x5fc3('0x2b')]!=='VIRTUAL'){var _0x3c0f63={};_0x3c0f63[_0x2d05d1['name']]={'$like':'%'+_0x2a299d[_0x5fc3('0x30')][_0x5fc3('0x3b')]+'%'};return _0x3c0f63;}})});}_0x5cd8c9=_[_0x5fc3('0x3c')]({},_0x5cd8c9,_0x2a299d[_0x5fc3('0x3d')]);var _0x1c453c={'where':_0x5cd8c9[_0x5fc3('0x38')]};return db[_0x5fc3('0x2a')][_0x5fc3('0x3e')](_0x1c453c)[_0x5fc3('0x24')](function(_0x15dc8c){_0xe48161[_0x5fc3('0x3e')]=_0x15dc8c;if(_0x2a299d[_0x5fc3('0x30')][_0x5fc3('0x3f')]){_0x5cd8c9[_0x5fc3('0x40')]=[{'all':!![]}];}return db[_0x5fc3('0x2a')]['findAll'](_0x5cd8c9);})[_0x5fc3('0x24')](function(_0x2859c6){_0xe48161[_0x5fc3('0x41')]=_0x2859c6;return _0xe48161;})[_0x5fc3('0x24')](respondWithFilteredResult(_0x39917a,_0x5cd8c9))[_0x5fc3('0x42')](handleError(_0x39917a,null));};exports[_0x5fc3('0x43')]=function(_0x3832b4,_0x430bb9){var _0x1dc517={'raw':!![],'where':{'id':_0x3832b4[_0x5fc3('0x44')]['id']}},_0x31aaa9={};_0x31aaa9[_0x5fc3('0x2d')]=_[_0x5fc3('0x31')](db[_0x5fc3('0x2a')]['rawAttributes']);_0x31aaa9[_0x5fc3('0x30')]=_[_0x5fc3('0x31')](_0x3832b4['query']);_0x31aaa9['filters']=_[_0x5fc3('0x32')](_0x31aaa9[_0x5fc3('0x2d')],_0x31aaa9['query']);_0x1dc517[_0x5fc3('0x34')]=_[_0x5fc3('0x32')](_0x31aaa9[_0x5fc3('0x2d')],qs[_0x5fc3('0x33')](_0x3832b4[_0x5fc3('0x30')][_0x5fc3('0x33')]));_0x1dc517[_0x5fc3('0x34')]=_0x1dc517['attributes'][_0x5fc3('0x35')]?_0x1dc517[_0x5fc3('0x34')]:_0x31aaa9[_0x5fc3('0x2d')];if(_0x3832b4['query']['includeAll']){_0x1dc517['include']=[{'all':!![]}];}_0x1dc517=_['merge']({},_0x1dc517,_0x3832b4['options']);return db[_0x5fc3('0x2a')][_0x5fc3('0x45')](_0x1dc517)[_0x5fc3('0x24')](handleEntityNotFound(_0x430bb9,null))[_0x5fc3('0x24')](respondWithResult(_0x430bb9,null))[_0x5fc3('0x42')](handleError(_0x430bb9,null));};exports['create']=function(_0x2da8a6,_0x3a1f89){return db['VoiceQueuesLog'][_0x5fc3('0x46')](_0x2da8a6[_0x5fc3('0x47')],{})['then'](respondWithResult(_0x3a1f89,0xc9))[_0x5fc3('0x42')](handleError(_0x3a1f89,null));};exports[_0x5fc3('0x23')]=function(_0x1ad16d,_0x1345a3){if(_0x1ad16d[_0x5fc3('0x47')]['id']){delete _0x1ad16d[_0x5fc3('0x47')]['id'];}return db['VoiceQueuesLog']['find']({'where':{'id':_0x1ad16d[_0x5fc3('0x44')]['id']}})[_0x5fc3('0x24')](handleEntityNotFound(_0x1345a3,null))[_0x5fc3('0x24')](saveUpdates(_0x1ad16d[_0x5fc3('0x47')],null))[_0x5fc3('0x24')](respondWithResult(_0x1345a3,null))[_0x5fc3('0x42')](handleError(_0x1345a3,null));};exports[_0x5fc3('0x25')]=function(_0x2ef014,_0x451b40){return db[_0x5fc3('0x2a')][_0x5fc3('0x45')]({'where':{'id':_0x2ef014[_0x5fc3('0x44')]['id']}})[_0x5fc3('0x24')](handleEntityNotFound(_0x451b40,null))[_0x5fc3('0x24')](removeEntity(_0x451b40,null))[_0x5fc3('0x42')](handleError(_0x451b40,null));}; \ No newline at end of file +var _0xe6b3=['VoiceQueuesLog','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','rows','catch','show','keys','rawAttributes','includeAll','include','find','create','body','update','params','rimraf','zip-dir','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','map'];(function(_0x487b43,_0x1dfa9b){var _0x27d959=function(_0xe3ad1d){while(--_0xe3ad1d){_0x487b43['push'](_0x487b43['shift']());}};_0x27d959(++_0x1dfa9b);}(_0xe6b3,0x1e9));var _0x3e6b=function(_0x291981,_0x3b2d7d){_0x291981=_0x291981-0x0;var _0x4c3769=_0xe6b3[_0x291981];return _0x4c3769;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e6b('0x0'));var zipdir=require(_0x3e6b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3e6b('0x2'));var BPromise=require(_0x3e6b('0x3'));var Mustache=require(_0x3e6b('0x4'));var util=require('util');var path=require('path');var sox=require(_0x3e6b('0x5'));var csv=require(_0x3e6b('0x6'));var ejs=require(_0x3e6b('0x7'));var fs=require('fs');var fs_extra=require(_0x3e6b('0x8'));var _=require(_0x3e6b('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3e6b('0xa'));var deskjs=require(_0x3e6b('0xb'));var toCsv=require(_0x3e6b('0x6'));var querystring=require('querystring');var Papa=require(_0x3e6b('0xc'));var Redis=require(_0x3e6b('0xd'));var authService=require(_0x3e6b('0xe'));var qs=require(_0x3e6b('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e6b('0x10'));var logger=require(_0x3e6b('0x11'))(_0x3e6b('0x12'));var utils=require(_0x3e6b('0x13'));var config=require(_0x3e6b('0x14'));var licenseUtil=require(_0x3e6b('0x15'));var db=require(_0x3e6b('0x16'))['db'];function respondWithStatusCode(_0x318a80,_0x47360f){_0x47360f=_0x47360f||0xcc;return function(_0x3e3d9a){if(_0x3e3d9a){return _0x318a80[_0x3e6b('0x17')](_0x47360f);}return _0x318a80[_0x3e6b('0x18')](_0x47360f)[_0x3e6b('0x19')]();};}function respondWithResult(_0x42e647,_0x5cddfc){_0x5cddfc=_0x5cddfc||0xc8;return function(_0x5d0395){if(_0x5d0395){return _0x42e647[_0x3e6b('0x18')](_0x5cddfc)[_0x3e6b('0x1a')](_0x5d0395);}};}function respondWithFilteredResult(_0x2cf17a,_0x5c6a28){return function(_0x3f814e){if(_0x3f814e){var _0x4c3c58=typeof _0x5c6a28[_0x3e6b('0x1b')]==='undefined'&&typeof _0x5c6a28['limit']===_0x3e6b('0x1c');var _0x219f15=_0x3f814e[_0x3e6b('0x1d')];var _0x4c0b78=_0x4c3c58?0x0:_0x5c6a28[_0x3e6b('0x1b')];var _0x13f7fe=_0x4c3c58?_0x3f814e[_0x3e6b('0x1d')]:_0x5c6a28[_0x3e6b('0x1b')]+_0x5c6a28[_0x3e6b('0x1e')];var _0x364941;if(_0x13f7fe>=_0x219f15){_0x13f7fe=_0x219f15;_0x364941=0xc8;}else{_0x364941=0xce;}_0x2cf17a[_0x3e6b('0x18')](_0x364941);return _0x2cf17a[_0x3e6b('0x1f')](_0x3e6b('0x20'),_0x4c0b78+'-'+_0x13f7fe+'/'+_0x219f15)['json'](_0x3f814e);}return null;};}function patchUpdates(_0x4ea0e7){return function(_0x37dfc5){try{jsonpatch[_0x3e6b('0x21')](_0x37dfc5,_0x4ea0e7,!![]);}catch(_0x3e66c7){return BPromise[_0x3e6b('0x22')](_0x3e66c7);}return _0x37dfc5[_0x3e6b('0x23')]();};}function saveUpdates(_0x288258,_0x50168a){return function(_0x114bcd){if(_0x114bcd){return _0x114bcd['update'](_0x288258)[_0x3e6b('0x24')](function(_0x27ac27){return _0x27ac27;});}return null;};}function removeEntity(_0x3225b3,_0x550b5f){return function(_0x3315bf){if(_0x3315bf){return _0x3315bf[_0x3e6b('0x25')]()[_0x3e6b('0x24')](function(){_0x3225b3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d7033,_0x8d69f2){return function(_0x298c9a){if(!_0x298c9a){_0x4d7033[_0x3e6b('0x17')](0x194);}return _0x298c9a;};}function handleError(_0x5f13ab,_0x29e94a){_0x29e94a=_0x29e94a||0x1f4;return function(_0x75944b){logger[_0x3e6b('0x26')](_0x75944b[_0x3e6b('0x27')]);if(_0x75944b[_0x3e6b('0x28')]){delete _0x75944b[_0x3e6b('0x28')];}_0x5f13ab['status'](_0x29e94a)['send'](_0x75944b);};}exports[_0x3e6b('0x29')]=function(_0x311ebb,_0x4f76d6){var _0xbdab22={},_0x13f485={},_0x5fb589={'count':0x0,'rows':[]};var _0x36ee44=_[_0x3e6b('0x2a')](db[_0x3e6b('0x2b')]['rawAttributes'],function(_0x4ca10b){return{'name':_0x4ca10b[_0x3e6b('0x2c')],'type':_0x4ca10b['type'][_0x3e6b('0x2d')]};});_0x13f485[_0x3e6b('0x2e')]=_[_0x3e6b('0x2a')](_0x36ee44,'name');_0x13f485[_0x3e6b('0x2f')]=_['keys'](_0x311ebb[_0x3e6b('0x2f')]);_0x13f485[_0x3e6b('0x30')]=_[_0x3e6b('0x31')](_0x13f485[_0x3e6b('0x2e')],_0x13f485[_0x3e6b('0x2f')]);_0xbdab22[_0x3e6b('0x32')]=_[_0x3e6b('0x31')](_0x13f485[_0x3e6b('0x2e')],qs[_0x3e6b('0x33')](_0x311ebb['query']['fields']));_0xbdab22['attributes']=_0xbdab22[_0x3e6b('0x32')][_0x3e6b('0x34')]?_0xbdab22[_0x3e6b('0x32')]:_0x13f485[_0x3e6b('0x2e')];if(!_0x311ebb[_0x3e6b('0x2f')][_0x3e6b('0x35')](_0x3e6b('0x36'))){_0xbdab22[_0x3e6b('0x1e')]=qs[_0x3e6b('0x1e')](_0x311ebb[_0x3e6b('0x2f')][_0x3e6b('0x1e')]);_0xbdab22['offset']=qs[_0x3e6b('0x1b')](_0x311ebb['query'][_0x3e6b('0x1b')]);}_0xbdab22[_0x3e6b('0x37')]=qs[_0x3e6b('0x38')](_0x311ebb['query'][_0x3e6b('0x38')]);_0xbdab22['where']=qs[_0x3e6b('0x30')](_[_0x3e6b('0x39')](_0x311ebb[_0x3e6b('0x2f')],_0x13f485[_0x3e6b('0x30')]),_0x36ee44);if(_0x311ebb['query'][_0x3e6b('0x3a')]){_0xbdab22[_0x3e6b('0x3b')]=_[_0x3e6b('0x3c')](_0xbdab22['where'],{'$or':_[_0x3e6b('0x2a')](_0x36ee44,function(_0x1eaa92){if(_0x1eaa92[_0x3e6b('0x3d')]!==_0x3e6b('0x3e')){var _0x404dc5={};_0x404dc5[_0x1eaa92[_0x3e6b('0x28')]]={'$like':'%'+_0x311ebb['query']['filter']+'%'};return _0x404dc5;}})});}_0xbdab22=_['merge']({},_0xbdab22,_0x311ebb[_0x3e6b('0x3f')]);var _0x36b031={'where':_0xbdab22['where']};return db[_0x3e6b('0x2b')][_0x3e6b('0x1d')](_0x36b031)[_0x3e6b('0x24')](function(_0x483521){_0x5fb589['count']=_0x483521;if(_0x311ebb[_0x3e6b('0x2f')]['includeAll']){_0xbdab22['include']=[{'all':!![]}];}return db[_0x3e6b('0x2b')]['findAll'](_0xbdab22);})[_0x3e6b('0x24')](function(_0x101fd3){_0x5fb589[_0x3e6b('0x40')]=_0x101fd3;return _0x5fb589;})['then'](respondWithFilteredResult(_0x4f76d6,_0xbdab22))[_0x3e6b('0x41')](handleError(_0x4f76d6,null));};exports[_0x3e6b('0x42')]=function(_0x3eec49,_0x31b42f){var _0x40a376={'raw':!![],'where':{'id':_0x3eec49['params']['id']}},_0x3b742f={};_0x3b742f[_0x3e6b('0x2e')]=_[_0x3e6b('0x43')](db[_0x3e6b('0x2b')][_0x3e6b('0x44')]);_0x3b742f[_0x3e6b('0x2f')]=_[_0x3e6b('0x43')](_0x3eec49['query']);_0x3b742f['filters']=_['intersection'](_0x3b742f['model'],_0x3b742f[_0x3e6b('0x2f')]);_0x40a376[_0x3e6b('0x32')]=_[_0x3e6b('0x31')](_0x3b742f[_0x3e6b('0x2e')],qs[_0x3e6b('0x33')](_0x3eec49['query'][_0x3e6b('0x33')]));_0x40a376['attributes']=_0x40a376['attributes'][_0x3e6b('0x34')]?_0x40a376[_0x3e6b('0x32')]:_0x3b742f[_0x3e6b('0x2e')];if(_0x3eec49[_0x3e6b('0x2f')][_0x3e6b('0x45')]){_0x40a376[_0x3e6b('0x46')]=[{'all':!![]}];}_0x40a376=_[_0x3e6b('0x3c')]({},_0x40a376,_0x3eec49[_0x3e6b('0x3f')]);return db[_0x3e6b('0x2b')][_0x3e6b('0x47')](_0x40a376)[_0x3e6b('0x24')](handleEntityNotFound(_0x31b42f,null))[_0x3e6b('0x24')](respondWithResult(_0x31b42f,null))[_0x3e6b('0x41')](handleError(_0x31b42f,null));};exports[_0x3e6b('0x48')]=function(_0x3dfcbf,_0x229a50){return db[_0x3e6b('0x2b')]['create'](_0x3dfcbf[_0x3e6b('0x49')],{})[_0x3e6b('0x24')](respondWithResult(_0x229a50,0xc9))['catch'](handleError(_0x229a50,null));};exports[_0x3e6b('0x4a')]=function(_0x19fd76,_0x4c83bb){if(_0x19fd76[_0x3e6b('0x49')]['id']){delete _0x19fd76['body']['id'];}return db['VoiceQueuesLog'][_0x3e6b('0x47')]({'where':{'id':_0x19fd76[_0x3e6b('0x4b')]['id']}})[_0x3e6b('0x24')](handleEntityNotFound(_0x4c83bb,null))[_0x3e6b('0x24')](saveUpdates(_0x19fd76[_0x3e6b('0x49')],null))[_0x3e6b('0x24')](respondWithResult(_0x4c83bb,null))[_0x3e6b('0x41')](handleError(_0x4c83bb,null));};exports[_0x3e6b('0x25')]=function(_0x202d0d,_0x6f1a9e){return db[_0x3e6b('0x2b')][_0x3e6b('0x47')]({'where':{'id':_0x202d0d['params']['id']}})[_0x3e6b('0x24')](handleEntityNotFound(_0x6f1a9e,null))[_0x3e6b('0x24')](removeEntity(_0x6f1a9e,null))[_0x3e6b('0x41')](handleError(_0x6f1a9e,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 2119c86..dfeda12 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 _0xb332=['bluebird','path','../../config/environment','exports','define','event_dtm','dtm','lodash','../../config/logger','api'];(function(_0x95637,_0xfb929b){var _0x21eaa2=function(_0x4ade20){while(--_0x4ade20){_0x95637['push'](_0x95637['shift']());}};_0x21eaa2(++_0xfb929b);}(_0xb332,0xd9));var _0x2b33=function(_0x229d7e,_0x5bc489){_0x229d7e=_0x229d7e-0x0;var _0xa78280=_0xb332[_0x229d7e];return _0xa78280;};'use strict';var _=require(_0x2b33('0x0'));var util=require('util');var logger=require(_0x2b33('0x1'))(_0x2b33('0x2'));var moment=require('moment');var BPromise=require(_0x2b33('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2b33('0x4'));var rimraf=require('rimraf');var config=require(_0x2b33('0x5'));var attributes=require('./voiceQueuesLog.attributes');module[_0x2b33('0x6')]=function(_0x22d66,_0x478214){return _0x22d66[_0x2b33('0x7')]('VoiceQueuesLog',attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0x2b33('0x8'),'fields':['event',_0x2b33('0x9')]}],'timestamps':![]});}; \ No newline at end of file +var _0x2137=['lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','define','voice_queues_log','event_dtm','dtm'];(function(_0xc97512,_0x2d81d9){var _0x371124=function(_0x167b8b){while(--_0x167b8b){_0xc97512['push'](_0xc97512['shift']());}};_0x371124(++_0x2d81d9);}(_0x2137,0x134));var _0x7213=function(_0x37b519,_0x24b2ca){_0x37b519=_0x37b519-0x0;var _0x412276=_0x2137[_0x37b519];return _0x412276;};'use strict';var _=require(_0x7213('0x0'));var util=require(_0x7213('0x1'));var logger=require(_0x7213('0x2'))('api');var moment=require('moment');var BPromise=require(_0x7213('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7213('0x4'));var rimraf=require(_0x7213('0x5'));var config=require(_0x7213('0x6'));var attributes=require('./voiceQueuesLog.attributes');module['exports']=function(_0x4f36f0,_0x2cf2d6){return _0x4f36f0[_0x7213('0x7')]('VoiceQueuesLog',attributes,{'tableName':_0x7213('0x8'),'paranoid':![],'indexes':[{'name':_0x7213('0x9'),'fields':['event',_0x7213('0xa')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index e5dded8..93ac9a5 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 _0x0298=['debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent'];(function(_0x44e755,_0x11a200){var _0x198c73=function(_0x159173){while(--_0x159173){_0x44e755['push'](_0x44e755['shift']());}};_0x198c73(++_0x11a200);}(_0x0298,0x74));var _0x8029=function(_0x26dda0,_0x5b58ab){_0x26dda0=_0x26dda0-0x0;var _0x41089c=_0x0298[_0x26dda0];return _0x41089c;};'use strict';var _=require(_0x8029('0x0'));var util=require(_0x8029('0x1'));var moment=require('moment');var BPromise=require(_0x8029('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8029('0x3'));var db=require(_0x8029('0x4'))['db'];var utils=require(_0x8029('0x5'));var logger=require(_0x8029('0x6'))(_0x8029('0x7'));var config=require(_0x8029('0x8'));var jayson=require(_0x8029('0x9'));var client=jayson[_0x8029('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd7497e,_0x24ddfa,_0x1ac95a){return new BPromise(function(_0xc61637,_0x29688f){return client[_0x8029('0xb')](_0xd7497e,_0x1ac95a)[_0x8029('0xc')](function(_0x5a0ddc){logger[_0x8029('0xd')](_0x8029('0xe'),_0x24ddfa,_0x8029('0xf'));logger[_0x8029('0x10')](_0x8029('0x11'),_0x24ddfa,_0x8029('0xf'),JSON[_0x8029('0x12')](_0x5a0ddc));if(_0x5a0ddc[_0x8029('0x13')]){if(_0x5a0ddc['error'][_0x8029('0x14')]===0x1f4){logger[_0x8029('0x13')](_0x8029('0xe'),_0x24ddfa,_0x5a0ddc[_0x8029('0x13')][_0x8029('0x15')]);return _0x29688f(_0x5a0ddc[_0x8029('0x13')][_0x8029('0x15')]);}logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x24ddfa,_0x5a0ddc[_0x8029('0x13')][_0x8029('0x15')]);return _0xc61637(_0x5a0ddc[_0x8029('0x13')][_0x8029('0x15')]);}else{logger['info'](_0x8029('0xe'),_0x24ddfa,_0x8029('0xf'));_0xc61637(_0x5a0ddc['result'][_0x8029('0x15')]);}})['catch'](function(_0xaa28da){logger[_0x8029('0x13')]('VoiceQueuesLog,\x20%s,\x20%s',_0x24ddfa,_0xaa28da);_0x29688f(_0xaa28da);});});} \ No newline at end of file +var _0x6263=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x41aa66,_0x544ad7){var _0xe278c8=function(_0x11b8b5){while(--_0x11b8b5){_0x41aa66['push'](_0x41aa66['shift']());}};_0xe278c8(++_0x544ad7);}(_0x6263,0x19d));var _0x3626=function(_0x4e38fd,_0x13d776){_0x4e38fd=_0x4e38fd-0x0;var _0x2fe8b7=_0x6263[_0x4e38fd];return _0x2fe8b7;};'use strict';var _=require(_0x3626('0x0'));var util=require(_0x3626('0x1'));var moment=require(_0x3626('0x2'));var BPromise=require(_0x3626('0x3'));var rs=require(_0x3626('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3626('0x5'))['db'];var utils=require(_0x3626('0x6'));var logger=require(_0x3626('0x7'))(_0x3626('0x8'));var config=require('../../config/environment');var jayson=require(_0x3626('0x9'));var client=jayson['client'][_0x3626('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x292c3a,_0x4a6fd3,_0x313603){return new BPromise(function(_0x15d8b6,_0x48dede){return client[_0x3626('0xb')](_0x292c3a,_0x313603)[_0x3626('0xc')](function(_0x51cbc8){logger['info'](_0x3626('0xd'),_0x4a6fd3,_0x3626('0xe'));logger['debug'](_0x3626('0xf'),_0x4a6fd3,_0x3626('0xe'),JSON[_0x3626('0x10')](_0x51cbc8));if(_0x51cbc8[_0x3626('0x11')]){if(_0x51cbc8[_0x3626('0x11')]['code']===0x1f4){logger[_0x3626('0x11')](_0x3626('0xd'),_0x4a6fd3,_0x51cbc8['error'][_0x3626('0x12')]);return _0x48dede(_0x51cbc8[_0x3626('0x11')][_0x3626('0x12')]);}logger[_0x3626('0x11')](_0x3626('0xd'),_0x4a6fd3,_0x51cbc8[_0x3626('0x11')][_0x3626('0x12')]);return _0x15d8b6(_0x51cbc8[_0x3626('0x11')][_0x3626('0x12')]);}else{logger[_0x3626('0x13')]('VoiceQueuesLog,\x20%s,\x20%s',_0x4a6fd3,_0x3626('0xe'));_0x15d8b6(_0x51cbc8[_0x3626('0x14')][_0x3626('0x12')]);}})[_0x3626('0x15')](function(_0x502abe){logger[_0x3626('0x11')](_0x3626('0xd'),_0x4a6fd3,_0x502abe);_0x48dede(_0x502abe);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 97fecf1..bfd1dfc 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 _0x2a1b=['update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','download','downloads','/:id/transcribe','create','post','runTranscribe','put'];(function(_0x91bf9f,_0x4b932f){var _0x50dbff=function(_0x525d9f){while(--_0x525d9f){_0x91bf9f['push'](_0x91bf9f['shift']());}};_0x50dbff(++_0x4b932f);}(_0x2a1b,0xf6));var _0xb2a1=function(_0x56cd74,_0x4cb744){_0x56cd74=_0x56cd74-0x0;var _0x569f45=_0x2a1b[_0x56cd74];return _0x569f45;};'use strict';var multer=require(_0xb2a1('0x0'));var util=require(_0xb2a1('0x1'));var path=require(_0xb2a1('0x2'));var timeout=require(_0xb2a1('0x3'));var express=require(_0xb2a1('0x4'));var router=express['Router']();var fs_extra=require(_0xb2a1('0x5'));var auth=require(_0xb2a1('0x6'));var interaction=require(_0xb2a1('0x7'));var config=require(_0xb2a1('0x8'));var controller=require(_0xb2a1('0x9'));router[_0xb2a1('0xa')]('/',auth[_0xb2a1('0xb')](),controller[_0xb2a1('0xc')]);router[_0xb2a1('0xa')](_0xb2a1('0xd'),auth[_0xb2a1('0xb')](),controller[_0xb2a1('0xe')]);router[_0xb2a1('0xa')](_0xb2a1('0xf'),auth[_0xb2a1('0xb')](),controller[_0xb2a1('0x10')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xb2a1('0x11')]);router[_0xb2a1('0xa')]('/:id/downloads',controller[_0xb2a1('0x12')]);router[_0xb2a1('0xa')](_0xb2a1('0x13'),auth[_0xb2a1('0xb')](),controller['downloadTranscribe']);router['post']('/',auth['isAuthenticated'](),controller[_0xb2a1('0x14')]);router[_0xb2a1('0x15')]('/:id/transcribe',auth['isAuthenticated'](),controller[_0xb2a1('0x16')]);router[_0xb2a1('0x17')](_0xb2a1('0xf'),auth[_0xb2a1('0xb')](),controller[_0xb2a1('0x18')]);router['delete'](_0xb2a1('0xf'),auth[_0xb2a1('0xb')](),controller[_0xb2a1('0x19')]);module[_0xb2a1('0x1a')]=router; \ No newline at end of file +var _0xd8d4=['../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/:id','/:id/download','download','downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','put','update','destroy','exports','multer','util','path','connect-timeout','fs-extra'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xd8d4,0x11b));var _0x4d8d=function(_0x1a3616,_0x3289f3){_0x1a3616=_0x1a3616-0x0;var _0x3be42e=_0xd8d4[_0x1a3616];return _0x3be42e;};'use strict';var multer=require(_0x4d8d('0x0'));var util=require(_0x4d8d('0x1'));var path=require(_0x4d8d('0x2'));var timeout=require(_0x4d8d('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4d8d('0x4'));var auth=require(_0x4d8d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4d8d('0x6'));var controller=require('./voiceRecording.controller');router[_0x4d8d('0x7')]('/',auth[_0x4d8d('0x8')](),controller[_0x4d8d('0x9')]);router['get']('/describe',auth[_0x4d8d('0x8')](),controller[_0x4d8d('0xa')]);router[_0x4d8d('0x7')](_0x4d8d('0xb'),auth[_0x4d8d('0x8')](),controller['show']);router[_0x4d8d('0x7')](_0x4d8d('0xc'),auth['isAuthenticated'](),controller[_0x4d8d('0xd')]);router['get']('/:id/downloads',controller[_0x4d8d('0xe')]);router['get'](_0x4d8d('0xf'),auth[_0x4d8d('0x8')](),controller[_0x4d8d('0x10')]);router[_0x4d8d('0x11')]('/',auth[_0x4d8d('0x8')](),controller[_0x4d8d('0x12')]);router[_0x4d8d('0x11')](_0x4d8d('0xf'),auth['isAuthenticated'](),controller[_0x4d8d('0x13')]);router[_0x4d8d('0x14')]('/:id',auth[_0x4d8d('0x8')](),controller[_0x4d8d('0x15')]);router['delete'](_0x4d8d('0xb'),auth[_0x4d8d('0x8')](),controller[_0x4d8d('0x16')]);module[_0x4d8d('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index a58e6b7..d3d2f9c 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(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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 3bd888c..497413d 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 _0x53d2=['unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','Voice\x20Recording\x20not\x20found','Setting','findOne','transcribeAccountId','transcribeRegion','language','bucket','Transcribe\x20not\x20configured','sentiment','sentimentAccountId','sentimentRegion','CloudProvider','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','IN_PROGRESS','tempSentiment','runSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','.txt','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','stack','name','send','map','VoiceRecording','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','nolimit','order','sort','where','pick','merge','filter','options','include','findAll','catch','show','params','keys','length','includeAll','create','body','describe','download','../../components/encryptor','uniqueid','find','value','format','existsSync','decryptFile','secrets','Sequelize','filename','extname','unlink','message','VoiceRecording\x20not\x20found','Not\x20found','sequelize','MD5','col','$and','push','%s.cypher','recording','ValidationError','isNil','info','cancellazione\x20fisica\x20documento\x20%s'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x53d2,0x169));var _0x253d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x53d2[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x253d('0x0'));var zipdir=require(_0x253d('0x1'));var jsonpatch=require(_0x253d('0x2'));var rp=require('request-promise');var moment=require(_0x253d('0x3'));var BPromise=require(_0x253d('0x4'));var Mustache=require('mustache');var util=require(_0x253d('0x5'));var path=require(_0x253d('0x6'));var sox=require(_0x253d('0x7'));var csv=require(_0x253d('0x8'));var ejs=require(_0x253d('0x9'));var fs=require('fs');var fs_extra=require(_0x253d('0xa'));var _=require(_0x253d('0xb'));var squel=require(_0x253d('0xc'));var crypto=require(_0x253d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x253d('0xe'));var toCsv=require(_0x253d('0x8'));var querystring=require(_0x253d('0xf'));var Papa=require(_0x253d('0x10'));var AWS=require(_0x253d('0x11'));var uuidv4=require(_0x253d('0x12'));var Redis=require(_0x253d('0x13'));var authService=require(_0x253d('0x14'));var qs=require(_0x253d('0x15'));var as=require(_0x253d('0x16'));var hardwareService=require(_0x253d('0x17'));var logger=require('../../config/logger')(_0x253d('0x18'));var utils=require(_0x253d('0x19'));var config=require(_0x253d('0x1a'));var licenseUtil=require(_0x253d('0x1b'));var db=require(_0x253d('0x1c'))['db'];function respondWithStatusCode(_0x433861,_0x13052e){_0x13052e=_0x13052e||0xcc;return function(_0x513a1e){if(_0x513a1e){return _0x433861[_0x253d('0x1d')](_0x13052e);}return _0x433861[_0x253d('0x1e')](_0x13052e)[_0x253d('0x1f')]();};}function respondWithResult(_0x4df156,_0x5c7364){_0x5c7364=_0x5c7364||0xc8;return function(_0xaf7f4f){if(_0xaf7f4f){return _0x4df156[_0x253d('0x1e')](_0x5c7364)[_0x253d('0x20')](_0xaf7f4f);}};}function respondWithFilteredResult(_0x1e4877,_0x2861ae){return function(_0x3c4c7f){if(_0x3c4c7f){var _0x20ad61=typeof _0x2861ae[_0x253d('0x21')]===_0x253d('0x22')&&typeof _0x2861ae[_0x253d('0x23')]===_0x253d('0x22');var _0x401606=_0x3c4c7f[_0x253d('0x24')];var _0x233fc4=_0x20ad61?0x0:_0x2861ae[_0x253d('0x21')];var _0x23d47b=_0x20ad61?_0x3c4c7f['count']:_0x2861ae[_0x253d('0x21')]+_0x2861ae[_0x253d('0x23')];var _0x3a4c61;if(_0x23d47b>=_0x401606){_0x23d47b=_0x401606;_0x3a4c61=0xc8;}else{_0x3a4c61=0xce;}_0x1e4877[_0x253d('0x1e')](_0x3a4c61);return _0x1e4877['set'](_0x253d('0x25'),_0x233fc4+'-'+_0x23d47b+'/'+_0x401606)[_0x253d('0x20')](_0x3c4c7f);}return null;};}function patchUpdates(_0x205cfd){return function(_0x15dc52){try{jsonpatch[_0x253d('0x26')](_0x15dc52,_0x205cfd,!![]);}catch(_0x440ae5){return BPromise['reject'](_0x440ae5);}return _0x15dc52[_0x253d('0x27')]();};}function saveUpdates(_0x5045d2,_0x4a6bbf){return function(_0x3422a8){if(_0x3422a8){return _0x3422a8[_0x253d('0x28')](_0x5045d2)[_0x253d('0x29')](function(_0x1864f1){return _0x1864f1;});}return null;};}function removeEntity(_0x4f0239,_0x2597ee){return function(_0x1b29b8){if(_0x1b29b8){return _0x1b29b8[_0x253d('0x2a')]()['then'](function(){_0x4f0239[_0x253d('0x1e')](0xcc)[_0x253d('0x1f')]();});}};}function handleEntityNotFound(_0x41ebb0,_0x35d3f4){return function(_0x2b0f7e){if(!_0x2b0f7e){_0x41ebb0[_0x253d('0x1d')](0x194);}return _0x2b0f7e;};}function handleError(_0x4e6b4a,_0x401bd5){_0x401bd5=_0x401bd5||0x1f4;return function(_0x5450b9){logger['error'](_0x5450b9[_0x253d('0x2b')]);if(_0x5450b9[_0x253d('0x2c')]){delete _0x5450b9['name'];}_0x4e6b4a[_0x253d('0x1e')](_0x401bd5)[_0x253d('0x2d')](_0x5450b9);};}exports['index']=function(_0x489982,_0x8529ce){var _0x193f79={},_0x5c9e5c={},_0x5e39a0={'count':0x0,'rows':[]};var _0x5a2f97=_[_0x253d('0x2e')](db[_0x253d('0x2f')][_0x253d('0x30')],function(_0x52b58a){return{'name':_0x52b58a[_0x253d('0x31')],'type':_0x52b58a[_0x253d('0x32')][_0x253d('0x33')]};});_0x5c9e5c['model']=_['differenceBy'](_[_0x253d('0x2e')](_0x5a2f97,_0x253d('0x2c')),['format']);_0x5c9e5c[_0x253d('0x34')]=_['keys'](_0x489982[_0x253d('0x34')]);_0x5c9e5c[_0x253d('0x35')]=_[_0x253d('0x36')](_0x5c9e5c['model'],_0x5c9e5c[_0x253d('0x34')]);_0x193f79[_0x253d('0x37')]=_[_0x253d('0x36')](_0x5c9e5c[_0x253d('0x38')],qs['fields'](_0x489982[_0x253d('0x34')][_0x253d('0x39')]));_0x193f79['attributes']=_0x193f79[_0x253d('0x37')]['length']?_0x193f79[_0x253d('0x37')]:_0x5c9e5c[_0x253d('0x38')];if(!_0x489982[_0x253d('0x34')]['hasOwnProperty'](_0x253d('0x3a'))){_0x193f79[_0x253d('0x23')]=qs[_0x253d('0x23')](_0x489982[_0x253d('0x34')]['limit']);_0x193f79[_0x253d('0x21')]=qs[_0x253d('0x21')](_0x489982[_0x253d('0x34')]['offset']);}_0x193f79[_0x253d('0x3b')]=qs[_0x253d('0x3c')](_0x489982[_0x253d('0x34')][_0x253d('0x3c')]);_0x193f79[_0x253d('0x3d')]=qs[_0x253d('0x35')](_[_0x253d('0x3e')](_0x489982['query'],_0x5c9e5c[_0x253d('0x35')]),_0x5a2f97);if(_0x489982[_0x253d('0x34')]['filter']){_0x193f79[_0x253d('0x3d')]=_[_0x253d('0x3f')](_0x193f79[_0x253d('0x3d')],{'$or':_[_0x253d('0x2e')](_0x5a2f97,function(_0x1e5745){if(_0x1e5745[_0x253d('0x32')]!=='VIRTUAL'){var _0x199326={};_0x199326[_0x1e5745[_0x253d('0x2c')]]={'$like':'%'+_0x489982[_0x253d('0x34')][_0x253d('0x40')]+'%'};return _0x199326;}})});}_0x193f79=_['merge']({},_0x193f79,_0x489982[_0x253d('0x41')]);var _0x9cfdbd={'where':_0x193f79['where']};return db[_0x253d('0x2f')][_0x253d('0x24')](_0x9cfdbd)[_0x253d('0x29')](function(_0x4d3638){_0x5e39a0[_0x253d('0x24')]=_0x4d3638;if(_0x489982['query']['includeAll']){_0x193f79[_0x253d('0x42')]=[{'all':!![]}];}return db['VoiceRecording'][_0x253d('0x43')](_0x193f79);})[_0x253d('0x29')](function(_0x252be5){_0x5e39a0['rows']=_0x252be5;return _0x5e39a0;})[_0x253d('0x29')](respondWithFilteredResult(_0x8529ce,_0x193f79))[_0x253d('0x44')](handleError(_0x8529ce,null));};exports[_0x253d('0x45')]=function(_0x5be032,_0x4be416){var _0x226015={'raw':![],'where':{'id':_0x5be032[_0x253d('0x46')]['id']}},_0x186cb8={};_0x186cb8['model']=_[_0x253d('0x47')](db[_0x253d('0x2f')]['rawAttributes']);_0x186cb8[_0x253d('0x34')]=_[_0x253d('0x47')](_0x5be032['query']);_0x186cb8[_0x253d('0x35')]=_[_0x253d('0x36')](_0x186cb8[_0x253d('0x38')],_0x186cb8[_0x253d('0x34')]);_0x226015[_0x253d('0x37')]=_[_0x253d('0x36')](_0x186cb8[_0x253d('0x38')],qs[_0x253d('0x39')](_0x5be032[_0x253d('0x34')]['fields']));_0x226015['attributes']=_0x226015[_0x253d('0x37')][_0x253d('0x48')]?_0x226015['attributes']:_0x186cb8[_0x253d('0x38')];if(_0x5be032['query'][_0x253d('0x49')]){_0x226015[_0x253d('0x42')]=[{'all':!![]}];}_0x226015=_[_0x253d('0x3f')]({},_0x226015,_0x5be032[_0x253d('0x41')]);return db[_0x253d('0x2f')]['find'](_0x226015)[_0x253d('0x29')](handleEntityNotFound(_0x4be416,null))[_0x253d('0x29')](respondWithResult(_0x4be416,null))['catch'](handleError(_0x4be416,null));};exports[_0x253d('0x4a')]=function(_0x5169d1,_0x166efa){return db[_0x253d('0x2f')][_0x253d('0x4a')](_0x5169d1['body'],{})['then'](respondWithResult(_0x166efa,0xc9))['catch'](handleError(_0x166efa,null));};exports[_0x253d('0x28')]=function(_0x50d977,_0x2b58c0){if(_0x50d977[_0x253d('0x4b')]['id']){delete _0x50d977[_0x253d('0x4b')]['id'];}return db['VoiceRecording']['find']({'where':{'id':_0x50d977['params']['id']}})[_0x253d('0x29')](handleEntityNotFound(_0x2b58c0,null))[_0x253d('0x29')](saveUpdates(_0x50d977[_0x253d('0x4b')],null))[_0x253d('0x29')](respondWithResult(_0x2b58c0,null))[_0x253d('0x44')](handleError(_0x2b58c0,null));};exports[_0x253d('0x4c')]=function(_0x21a4aa,_0x4382c0){return db['VoiceRecording']['describe']()[_0x253d('0x29')](respondWithResult(_0x4382c0,null))[_0x253d('0x44')](handleError(_0x4382c0,null));};exports[_0x253d('0x4d')]=function(_0x17f6bf,_0x3d6c1b,_0x4f8698){var _0xb7bb64=require(_0x253d('0x4e'));var _0x1113b5=![];var _0x54dd94={};if(_0x17f6bf['query']['type']&&_0x17f6bf[_0x253d('0x34')][_0x253d('0x32')]===_0x253d('0x4f')){_0x54dd94[_0x253d('0x4f')]=_0x17f6bf[_0x253d('0x46')]['id'];}else{_0x54dd94['id']=_0x17f6bf[_0x253d('0x46')]['id'];}return db[_0x253d('0x2f')][_0x253d('0x50')]({'where':_0x54dd94,'attributes':['id','value'],'raw':!![]})[_0x253d('0x29')](handleEntityNotFound(_0x3d6c1b,null))[_0x253d('0x29')](function(_0x47ce1a){if(_0x47ce1a){var _0x573d1a=_0x47ce1a[_0x253d('0x51')];var _0x38c72a=util[_0x253d('0x52')]('%s.cypher',_0x573d1a);if(fs[_0x253d('0x53')](_0x38c72a)){_0x1113b5=!![];return _0xb7bb64[_0x253d('0x54')](_0x38c72a,_0x573d1a,config[_0x253d('0x55')]['recording'])['then'](function(){return _0x47ce1a;});}return _0x47ce1a;}})['then'](function(_0x469b2d){if(_0x469b2d){var _0x2429c8=_0x469b2d[_0x253d('0x51')];if(!fs[_0x253d('0x53')](_0x2429c8)){throw new db[(_0x253d('0x56'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x469b2d[_0x253d('0x57')]){return _0x3d6c1b[_0x253d('0x4d')](_0x2429c8,_0x469b2d[_0x253d('0x57')]+path[_0x253d('0x58')](_0x2429c8),function(){if(_0x1113b5){fs[_0x253d('0x59')](_0x2429c8);}});}else{return _0x3d6c1b['download'](_0x2429c8,function(_0x157846){if(_0x1113b5){fs[_0x253d('0x59')](_0x2429c8);}});}}})[_0x253d('0x44')](function(_0x51a6ab){if(_0x51a6ab[_0x253d('0x5a')]===_0x253d('0x5b')){_0x3d6c1b[_0x253d('0x1e')](0x194)[_0x253d('0x2d')](_0x253d('0x5c'));}else{return handleError(_0x3d6c1b,null);}});};exports['downloads']=function(_0x505975,_0x3a43ae,_0x445515){var _0xcf06f=require(_0x253d('0x4e'));var _0x312c15=![];var _0x51e262={'$and':[db[_0x253d('0x5d')][_0x253d('0x3d')](db[_0x253d('0x5d')]['fn'](_0x253d('0x5e'),db[_0x253d('0x5d')][_0x253d('0x5f')](_0x253d('0x4f'))),_0x505975[_0x253d('0x34')]['token'])]};if(_0x505975[_0x253d('0x34')][_0x253d('0x32')]&&_0x505975['query'][_0x253d('0x32')]===_0x253d('0x4f')){_0x51e262[_0x253d('0x60')][_0x253d('0x61')]({'uniqueid':_0x505975[_0x253d('0x46')]['id']});}else{_0x51e262['$and'][_0x253d('0x61')]({'id':_0x505975[_0x253d('0x46')]['id']});}return db['VoiceRecording'][_0x253d('0x50')]({'where':_0x51e262,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x3a43ae,null))['then'](function(_0x22a021){if(_0x22a021){var _0x2e7934=util[_0x253d('0x52')](_0x253d('0x62'),_0x22a021[_0x253d('0x51')]);if(fs[_0x253d('0x53')](_0x2e7934)){_0x312c15=!![];return _0xcf06f[_0x253d('0x54')](_0x2e7934,_0x22a021[_0x253d('0x51')],config['secrets'][_0x253d('0x63')])[_0x253d('0x29')](function(){return _0x22a021;});}return _0x22a021;}})['then'](function(_0x4e6326){if(_0x4e6326){if(!fs['existsSync'](_0x4e6326[_0x253d('0x51')])){throw new db['Sequelize'][(_0x253d('0x64'))](_0x253d('0x5b'));}if(_0x4e6326[_0x253d('0x57')]){return _0x3a43ae[_0x253d('0x4d')](_0x4e6326[_0x253d('0x51')],_0x4e6326[_0x253d('0x57')]+path[_0x253d('0x58')](_0x4e6326[_0x253d('0x51')]),function(){if(_0x312c15){fs[_0x253d('0x59')](_0x4e6326[_0x253d('0x51')]);}});}else{return _0x3a43ae['download'](_0x4e6326[_0x253d('0x51')],function(_0x5a4ccd){if(_0x312c15){fs[_0x253d('0x59')](_0x4e6326[_0x253d('0x51')]);}});}}})[_0x253d('0x44')](handleError(_0x3a43ae,null));};exports[_0x253d('0x2a')]=function(_0x567e46,_0xb94a44){return db[_0x253d('0x2f')]['find']({'where':{'id':_0x567e46[_0x253d('0x46')]['id']}})[_0x253d('0x29')](function(_0x2784e5){if(_[_0x253d('0x65')](_0x2784e5)){throw new ReferenceError('Entity\x20not\x20found');}return _0x2784e5;})[_0x253d('0x29')](function(_0x4e6291){var _0x4bdbe7=_0x4e6291[_0x253d('0x51')];logger[_0x253d('0x66')](_0x253d('0x67'),_0x4bdbe7);if(!_[_0x253d('0x65')](_0x4e6291[_0x253d('0x51')])&&fs[_0x253d('0x53')](_0x4bdbe7)){logger[_0x253d('0x66')]('File:\x20\x22'+_0x4bdbe7+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x253d('0x68')](_0x4bdbe7);}_0x4bdbe7=_0x4bdbe7+_0x253d('0x69');if(!_[_0x253d('0x65')](_0x4e6291[_0x253d('0x51')])&&fs['existsSync'](_0x4bdbe7)){logger[_0x253d('0x66')]('File:\x20\x22'+_0x4bdbe7+_0x253d('0x6a'));fs[_0x253d('0x68')](_0x4bdbe7);}return _0x4e6291;})[_0x253d('0x29')](function(_0x2a59db){if(!_0x2a59db)throw new InternalError();return _0x2a59db[_0x253d('0x2a')]();})[_0x253d('0x29')](function(){_0xb94a44['status'](0xcc)[_0x253d('0x1f')]();})['catch'](handleError(_0xb94a44,null));};function getBucketslist(_0x122091,_0x315e42,_0x1d1008){return new Promise(function(_0xe81309,_0x128201){var _0x4eab6f=new AWS['S3']({'accessKeyId':_0x315e42,'secretAccessKey':_0x122091,'region':_0x1d1008});_0x4eab6f[_0x253d('0x6b')]({},function(_0x289ee3,_0x1a244a){if(_0x289ee3){return _0x128201(_0x289ee3);}else{return _0xe81309(_0x1a244a);}});});}function createBucket(_0x15be98,_0x6b92bd,_0x56d4e2,_0x21cab9){return new Promise(function(_0x4c6a51,_0x195c07){var _0x7c837b=new AWS['S3']({'accessKeyId':_0x6b92bd,'secretAccessKey':_0x15be98,'region':_0x56d4e2});_0x7c837b[_0x253d('0x6c')]({'Bucket':_0x21cab9},function(_0x260db9,_0x4ff4e3){if(_0x260db9){return _0x195c07(_0x260db9);}else{return _0x4c6a51(_0x4ff4e3);}});});}function uploadFile(_0xcfb580,_0x1c4b21,_0x31be0d,_0x241cb3,_0x358421,_0x435073){return new Promise(function(_0x2bdd14,_0x5772fa){var _0x17d508=new AWS['S3']({'accessKeyId':_0x1c4b21,'secretAccessKey':_0xcfb580,'region':_0x31be0d});_0x17d508[_0x253d('0x6d')]({'Bucket':_0x241cb3,'Key':_0x358421,'Body':_0x435073},function(_0x4f8d4d,_0x5d187f){if(_0x4f8d4d){return _0x5772fa(_0x4f8d4d);}else{return _0x2bdd14(_0x5d187f);}});});}function startTranscribe(_0xa701d3,_0x420902,_0x51f2ce,_0xeab7e5,_0x26fd3a,_0x1b81aa){return new Promise(function(_0x430267,_0x314500){var _0x20e57c=new AWS[(_0x253d('0x6e'))]({'accessKeyId':_0x420902,'secretAccessKey':_0xa701d3,'region':_0x51f2ce});_0x20e57c[_0x253d('0x6f')]({'TranscriptionJobName':_0xeab7e5,'LanguageCode':_0x26fd3a,'Media':{'MediaFileUri':_0x1b81aa}},function(_0x3c3b90,_0xc33b5){if(_0x3c3b90){return _0x314500(_0x3c3b90);}else{return _0x430267(_0xc33b5);}});});}function transcribe(_0x37d1e8,_0x4cdc10,_0x374277,_0x2619ec,_0x37282f,_0x33816a,_0x1ed2a3){return new Promise(function(_0x427f09,_0x14db46){var _0x973ce1={};logger[_0x253d('0x66')](util[_0x253d('0x52')](_0x253d('0x70'),_0x37d1e8,_0x37282f));return uploadFile(_0x4cdc10,_0x374277,_0x2619ec,_0x37282f,path[_0x253d('0x71')](_0x33816a),fs[_0x253d('0x72')](_0x33816a))[_0x253d('0x29')](function(_0x25018b){logger['info'](util['format'](_0x253d('0x73'),_0x37d1e8,_0x37282f,_0x25018b[_0x253d('0x74')]));_0x973ce1['bucket']=_0x25018b[_0x253d('0x75')];_0x973ce1[_0x253d('0x76')]=_0x25018b['Location'];logger[_0x253d('0x66')](util[_0x253d('0x52')](_0x253d('0x77'),_0x37d1e8));return startTranscribe(_0x4cdc10,_0x374277,_0x2619ec,uuidv4(),_0x1ed2a3,_0x25018b[_0x253d('0x74')]);})[_0x253d('0x29')](function(_0x586067){logger[_0x253d('0x66')](util[_0x253d('0x52')](_0x253d('0x78'),_0x37d1e8,_0x586067[_0x253d('0x79')][_0x253d('0x7a')]));_0x973ce1[_0x253d('0x7b')]=_0x586067[_0x253d('0x79')]['TranscriptionJobName'];_0x973ce1[_0x253d('0x7c')]=_0x586067[_0x253d('0x79')][_0x253d('0x7d')];return _0x427f09(_0x973ce1);})[_0x253d('0x44')](function(_0x40bd06){return _0x14db46(_0x40bd06);});});}exports[_0x253d('0x7e')]=function(_0x448b29,_0x1698e2,_0xa5abe9){var _0x456b14;var _0x13864a;var _0x1997a0;var _0x40024a=require(_0x253d('0x4e'));return db[_0x253d('0x2f')]['findOne']({'where':{'id':_0x448b29[_0x253d('0x46')]['id']}})[_0x253d('0x29')](function(_0x5cee9e){if(_0x5cee9e){var _0x155e84=util[_0x253d('0x52')](_0x253d('0x62'),_0x5cee9e['value']);if(fs[_0x253d('0x53')](_0x155e84)){cypher=!![];return _0x40024a[_0x253d('0x54')](_0x155e84,_0x5cee9e[_0x253d('0x51')],config['secrets'][_0x253d('0x63')])[_0x253d('0x29')](function(){return _0x5cee9e;});}return _0x5cee9e;}})[_0x253d('0x29')](function(_0x4f2d01){if(!_0x4f2d01){throw new db['Sequelize'][(_0x253d('0x64'))](_0x253d('0x7f'));}_0x13864a=_0x4f2d01;return db[_0x253d('0x80')][_0x253d('0x81')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x1698e2,null))[_0x253d('0x29')](function(_0xf9a0f){if(_0xf9a0f){_0x456b14=_0xf9a0f;if(!_0x456b14['transcribe']||!_0x456b14[_0x253d('0x82')]||!_0x456b14[_0x253d('0x83')]||!_0x456b14[_0x253d('0x84')]||!_0x456b14[_0x253d('0x85')]){throw new db[(_0x253d('0x56'))]['ValidationError'](_0x253d('0x86'));}if(_0x448b29[_0x253d('0x4b')]['runSentiment']&&(!_0x456b14[_0x253d('0x87')]||!_0x456b14[_0x253d('0x88')]||!_0x456b14[_0x253d('0x89')]||!_0x456b14[_0x253d('0x84')]||!_0x456b14[_0x253d('0x85')])){throw new db['Sequelize']['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}return db[_0x253d('0x8a')][_0x253d('0x81')]({'where':{'id':_0x456b14['transcribeAccountId']}});}})[_0x253d('0x29')](function(_0x53e3fa){if(!_0x53e3fa){throw new db[(_0x253d('0x56'))][(_0x253d('0x64'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x53e3fa[_0x253d('0x8b')]||!_0x53e3fa[_0x253d('0x8c')]){throw new db[(_0x253d('0x56'))][(_0x253d('0x64'))](_0x253d('0x8d'));}_0x1997a0=_0x53e3fa;return getBucketslist(_0x1997a0['data1'],_0x1997a0[_0x253d('0x8c')],_0x456b14[_0x253d('0x83')]);})[_0x253d('0x29')](function(_0x3b4936){if(_0x3b4936&&_0x3b4936[_0x253d('0x8e')]){var _0x418e4d=_[_0x253d('0x50')](_0x3b4936[_0x253d('0x8e')],function(_0x229e73){return _0x229e73[_0x253d('0x8f')]===_0x456b14['bucket'];});if(!_0x418e4d){logger[_0x253d('0x66')](util[_0x253d('0x52')](_0x253d('0x90'),_0x448b29[_0x253d('0x46')]['id'],_0x456b14[_0x253d('0x85')]));return createBucket(_0x1997a0[_0x253d('0x8b')],_0x1997a0['data2'],_0x456b14[_0x253d('0x83')],_0x456b14[_0x253d('0x85')]);}logger['info'](util[_0x253d('0x52')](_0x253d('0x91'),_0x448b29[_0x253d('0x46')]['id'],_0x456b14['bucket']));return;}})[_0x253d('0x29')](function(_0xd2bab){if(_0x13864a[_0x253d('0x7c')]==='NEW'){return transcribe(_0x448b29[_0x253d('0x46')]['id'],_0x1997a0['data1'],_0x1997a0[_0x253d('0x8c')],_0x456b14['transcribeRegion'],_0x456b14[_0x253d('0x85')],_0x13864a[_0x253d('0x51')],_0x456b14['language']);}else{logger[_0x253d('0x66')](util[_0x253d('0x52')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x448b29[_0x253d('0x46')]['id']));return{'transcribeStatus':_0x253d('0x92')};}})['then'](function(_0x122830){if(_0x122830){_0x122830[_0x253d('0x93')]=_0x448b29[_0x253d('0x4b')][_0x253d('0x94')];return _0x13864a[_0x253d('0x95')](_0x122830);}})[_0x253d('0x29')](respondWithResult(_0x1698e2,null))[_0x253d('0x44')](handleError(_0x1698e2,null));};function writeFile(_0x787992,_0x230fd3){return new Promise(function(_0x4586da,_0x4eeaa5){fs[_0x253d('0x96')](_0x230fd3,_0x787992,function(_0x5509ba,_0x5bf314){if(_0x5509ba){return _0x4eeaa5(_0x5509ba);}else{return _0x4586da(_0x5bf314);}});});}exports[_0x253d('0x97')]=function(_0x5df61b,_0x71e1,_0x18e695){return db[_0x253d('0x2f')]['findOne']({'where':{'id':_0x5df61b[_0x253d('0x46')]['id']}})['then'](handleEntityNotFound(_0x71e1))[_0x253d('0x29')](function(_0x4b606e){if(_0x4b606e&&_0x4b606e[_0x253d('0x98')]){var _0x28eece=_0x4b606e[_0x253d('0x98')];var _0x38a6e9=config[_0x253d('0x99')]+'/server/files/transcribes/transcribe_'+_0x4b606e['id']+_0x253d('0x9a');if(fs['existsSync'](_0x38a6e9)){return _0x38a6e9;}return writeFile(_0x28eece,_0x38a6e9)['then'](function(){return _0x38a6e9;});}else{throw new db[(_0x253d('0x56'))][(_0x253d('0x64'))]('Transcript\x20not\x20available');}})[_0x253d('0x29')](function(_0x3c849e){return _0x71e1[_0x253d('0x4d')](_0x3c849e);})['catch'](handleError(_0x71e1));}; \ No newline at end of file +var _0xfae9=['VIRTUAL','options','include','rows','show','params','keys','find','create','body','catch','describe','download','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','unlink','message','send','Not\x20found','downloads','../../components/encryptor','sequelize','MD5','token','push','extname','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','createBucket','upload','TranscribeService','startTranscriptionJob','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','bucket','Bucket','location','Location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribeAccountId','transcribeRegion','language','sentiment','sentimentAccountId','Cloud\x20Provider\x20not\x20configured','data1','data2','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','NEW','IN_PROGRESS','updateAttributes','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','error','name','VoiceRecording','rawAttributes','fieldName','type','model','format','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map'];(function(_0x3d87f6,_0x215dd8){var _0x484899=function(_0x62f356){while(--_0x62f356){_0x3d87f6['push'](_0x3d87f6['shift']());}};_0x484899(++_0x215dd8);}(_0xfae9,0xe2));var _0x9fae=function(_0x330939,_0x52dac5){_0x330939=_0x330939-0x0;var _0x4b5b43=_0xfae9[_0x330939];return _0x4b5b43;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9fae('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9fae('0x1'));var rp=require(_0x9fae('0x2'));var moment=require('moment');var BPromise=require(_0x9fae('0x3'));var Mustache=require(_0x9fae('0x4'));var util=require(_0x9fae('0x5'));var path=require(_0x9fae('0x6'));var sox=require(_0x9fae('0x7'));var csv=require(_0x9fae('0x8'));var ejs=require(_0x9fae('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9fae('0xa'));var crypto=require(_0x9fae('0xb'));var jsforce=require(_0x9fae('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9fae('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var AWS=require('aws-sdk');var uuidv4=require(_0x9fae('0xd'));var Redis=require(_0x9fae('0xe'));var authService=require(_0x9fae('0xf'));var qs=require(_0x9fae('0x10'));var as=require(_0x9fae('0x11'));var hardwareService=require(_0x9fae('0x12'));var logger=require(_0x9fae('0x13'))(_0x9fae('0x14'));var utils=require(_0x9fae('0x15'));var config=require(_0x9fae('0x16'));var licenseUtil=require(_0x9fae('0x17'));var db=require(_0x9fae('0x18'))['db'];function respondWithStatusCode(_0x3dd57f,_0x434883){_0x434883=_0x434883||0xcc;return function(_0x7ac486){if(_0x7ac486){return _0x3dd57f[_0x9fae('0x19')](_0x434883);}return _0x3dd57f[_0x9fae('0x1a')](_0x434883)[_0x9fae('0x1b')]();};}function respondWithResult(_0x2deb5d,_0x602b2){_0x602b2=_0x602b2||0xc8;return function(_0x55300c){if(_0x55300c){return _0x2deb5d['status'](_0x602b2)['json'](_0x55300c);}};}function respondWithFilteredResult(_0x4525e6,_0x2b7dc0){return function(_0xef9bca){if(_0xef9bca){var _0x324137=typeof _0x2b7dc0[_0x9fae('0x1c')]===_0x9fae('0x1d')&&typeof _0x2b7dc0[_0x9fae('0x1e')]===_0x9fae('0x1d');var _0x594fa0=_0xef9bca[_0x9fae('0x1f')];var _0x3f5aa0=_0x324137?0x0:_0x2b7dc0[_0x9fae('0x1c')];var _0x581ef5=_0x324137?_0xef9bca['count']:_0x2b7dc0[_0x9fae('0x1c')]+_0x2b7dc0[_0x9fae('0x1e')];var _0x4992f1;if(_0x581ef5>=_0x594fa0){_0x581ef5=_0x594fa0;_0x4992f1=0xc8;}else{_0x4992f1=0xce;}_0x4525e6[_0x9fae('0x1a')](_0x4992f1);return _0x4525e6[_0x9fae('0x20')](_0x9fae('0x21'),_0x3f5aa0+'-'+_0x581ef5+'/'+_0x594fa0)[_0x9fae('0x22')](_0xef9bca);}return null;};}function patchUpdates(_0x34dc75){return function(_0x1e440f){try{jsonpatch[_0x9fae('0x23')](_0x1e440f,_0x34dc75,!![]);}catch(_0x4f1a20){return BPromise['reject'](_0x4f1a20);}return _0x1e440f[_0x9fae('0x24')]();};}function saveUpdates(_0x4080d9,_0x480258){return function(_0x1a5175){if(_0x1a5175){return _0x1a5175[_0x9fae('0x25')](_0x4080d9)['then'](function(_0x2c422e){return _0x2c422e;});}return null;};}function removeEntity(_0x2d0ab4,_0x1f588e){return function(_0x34bf3f){if(_0x34bf3f){return _0x34bf3f['destroy']()[_0x9fae('0x26')](function(){_0x2d0ab4[_0x9fae('0x1a')](0xcc)[_0x9fae('0x1b')]();});}};}function handleEntityNotFound(_0x1e2d78,_0x3287ae){return function(_0x4538d2){if(!_0x4538d2){_0x1e2d78['sendStatus'](0x194);}return _0x4538d2;};}function handleError(_0x3fefce,_0x562753){_0x562753=_0x562753||0x1f4;return function(_0x3acf0f){logger[_0x9fae('0x27')](_0x3acf0f['stack']);if(_0x3acf0f[_0x9fae('0x28')]){delete _0x3acf0f['name'];}_0x3fefce[_0x9fae('0x1a')](_0x562753)['send'](_0x3acf0f);};}exports['index']=function(_0x26016c,_0x2ce9e0){var _0x1ad22e={},_0x5961e3={},_0x2af524={'count':0x0,'rows':[]};var _0x307590=_['map'](db[_0x9fae('0x29')][_0x9fae('0x2a')],function(_0x430e7c){return{'name':_0x430e7c[_0x9fae('0x2b')],'type':_0x430e7c[_0x9fae('0x2c')]['key']};});_0x5961e3[_0x9fae('0x2d')]=_['differenceBy'](_['map'](_0x307590,'name'),[_0x9fae('0x2e')]);_0x5961e3[_0x9fae('0x2f')]=_['keys'](_0x26016c['query']);_0x5961e3[_0x9fae('0x30')]=_[_0x9fae('0x31')](_0x5961e3['model'],_0x5961e3[_0x9fae('0x2f')]);_0x1ad22e[_0x9fae('0x32')]=_[_0x9fae('0x31')](_0x5961e3[_0x9fae('0x2d')],qs['fields'](_0x26016c['query'][_0x9fae('0x33')]));_0x1ad22e[_0x9fae('0x32')]=_0x1ad22e[_0x9fae('0x32')][_0x9fae('0x34')]?_0x1ad22e[_0x9fae('0x32')]:_0x5961e3[_0x9fae('0x2d')];if(!_0x26016c[_0x9fae('0x2f')][_0x9fae('0x35')](_0x9fae('0x36'))){_0x1ad22e[_0x9fae('0x1e')]=qs[_0x9fae('0x1e')](_0x26016c[_0x9fae('0x2f')][_0x9fae('0x1e')]);_0x1ad22e[_0x9fae('0x1c')]=qs[_0x9fae('0x1c')](_0x26016c[_0x9fae('0x2f')][_0x9fae('0x1c')]);}_0x1ad22e[_0x9fae('0x37')]=qs[_0x9fae('0x38')](_0x26016c['query']['sort']);_0x1ad22e[_0x9fae('0x39')]=qs[_0x9fae('0x30')](_[_0x9fae('0x3a')](_0x26016c[_0x9fae('0x2f')],_0x5961e3[_0x9fae('0x30')]),_0x307590);if(_0x26016c[_0x9fae('0x2f')][_0x9fae('0x3b')]){_0x1ad22e[_0x9fae('0x39')]=_[_0x9fae('0x3c')](_0x1ad22e['where'],{'$or':_[_0x9fae('0x3d')](_0x307590,function(_0x2bff75){if(_0x2bff75[_0x9fae('0x2c')]!==_0x9fae('0x3e')){var _0x269593={};_0x269593[_0x2bff75[_0x9fae('0x28')]]={'$like':'%'+_0x26016c['query'][_0x9fae('0x3b')]+'%'};return _0x269593;}})});}_0x1ad22e=_[_0x9fae('0x3c')]({},_0x1ad22e,_0x26016c[_0x9fae('0x3f')]);var _0x94047c={'where':_0x1ad22e['where']};return db[_0x9fae('0x29')][_0x9fae('0x1f')](_0x94047c)[_0x9fae('0x26')](function(_0x5d6aea){_0x2af524[_0x9fae('0x1f')]=_0x5d6aea;if(_0x26016c['query']['includeAll']){_0x1ad22e[_0x9fae('0x40')]=[{'all':!![]}];}return db[_0x9fae('0x29')]['findAll'](_0x1ad22e);})['then'](function(_0x5922f5){_0x2af524[_0x9fae('0x41')]=_0x5922f5;return _0x2af524;})['then'](respondWithFilteredResult(_0x2ce9e0,_0x1ad22e))['catch'](handleError(_0x2ce9e0,null));};exports[_0x9fae('0x42')]=function(_0x3ea202,_0x5d4651){var _0x28889c={'raw':![],'where':{'id':_0x3ea202[_0x9fae('0x43')]['id']}},_0x224670={};_0x224670['model']=_[_0x9fae('0x44')](db[_0x9fae('0x29')][_0x9fae('0x2a')]);_0x224670[_0x9fae('0x2f')]=_['keys'](_0x3ea202['query']);_0x224670[_0x9fae('0x30')]=_['intersection'](_0x224670[_0x9fae('0x2d')],_0x224670['query']);_0x28889c[_0x9fae('0x32')]=_['intersection'](_0x224670['model'],qs[_0x9fae('0x33')](_0x3ea202[_0x9fae('0x2f')][_0x9fae('0x33')]));_0x28889c[_0x9fae('0x32')]=_0x28889c[_0x9fae('0x32')][_0x9fae('0x34')]?_0x28889c[_0x9fae('0x32')]:_0x224670[_0x9fae('0x2d')];if(_0x3ea202[_0x9fae('0x2f')]['includeAll']){_0x28889c[_0x9fae('0x40')]=[{'all':!![]}];}_0x28889c=_[_0x9fae('0x3c')]({},_0x28889c,_0x3ea202[_0x9fae('0x3f')]);return db[_0x9fae('0x29')][_0x9fae('0x45')](_0x28889c)[_0x9fae('0x26')](handleEntityNotFound(_0x5d4651,null))[_0x9fae('0x26')](respondWithResult(_0x5d4651,null))['catch'](handleError(_0x5d4651,null));};exports['create']=function(_0x2ef3fe,_0x12d89c){return db[_0x9fae('0x29')][_0x9fae('0x46')](_0x2ef3fe[_0x9fae('0x47')],{})['then'](respondWithResult(_0x12d89c,0xc9))[_0x9fae('0x48')](handleError(_0x12d89c,null));};exports['update']=function(_0x3e5209,_0x1547c3){if(_0x3e5209[_0x9fae('0x47')]['id']){delete _0x3e5209[_0x9fae('0x47')]['id'];}return db[_0x9fae('0x29')][_0x9fae('0x45')]({'where':{'id':_0x3e5209[_0x9fae('0x43')]['id']}})[_0x9fae('0x26')](handleEntityNotFound(_0x1547c3,null))[_0x9fae('0x26')](saveUpdates(_0x3e5209['body'],null))[_0x9fae('0x26')](respondWithResult(_0x1547c3,null))[_0x9fae('0x48')](handleError(_0x1547c3,null));};exports[_0x9fae('0x49')]=function(_0x1cc9c0,_0x516f06){return db[_0x9fae('0x29')][_0x9fae('0x49')]()['then'](respondWithResult(_0x516f06,null))[_0x9fae('0x48')](handleError(_0x516f06,null));};exports[_0x9fae('0x4a')]=function(_0x3b629f,_0x43464c,_0x484c47){var _0x5b93e3=require('../../components/encryptor');var _0x355fbd=![];var _0x50d75d={};if(_0x3b629f[_0x9fae('0x2f')]['type']&&_0x3b629f[_0x9fae('0x2f')]['type']===_0x9fae('0x4b')){_0x50d75d[_0x9fae('0x4b')]=_0x3b629f[_0x9fae('0x43')]['id'];}else{_0x50d75d['id']=_0x3b629f[_0x9fae('0x43')]['id'];}return db['VoiceRecording'][_0x9fae('0x45')]({'where':_0x50d75d,'attributes':['id',_0x9fae('0x4c')],'raw':!![]})[_0x9fae('0x26')](handleEntityNotFound(_0x43464c,null))[_0x9fae('0x26')](function(_0x2ea908){if(_0x2ea908){var _0x521faa=_0x2ea908[_0x9fae('0x4c')];var _0x41f459=util[_0x9fae('0x2e')](_0x9fae('0x4d'),_0x521faa);if(fs[_0x9fae('0x4e')](_0x41f459)){_0x355fbd=!![];return _0x5b93e3[_0x9fae('0x4f')](_0x41f459,_0x521faa,config[_0x9fae('0x50')][_0x9fae('0x51')])[_0x9fae('0x26')](function(){return _0x2ea908;});}return _0x2ea908;}})[_0x9fae('0x26')](function(_0x41f7f4){if(_0x41f7f4){var _0x1f1d10=_0x41f7f4[_0x9fae('0x4c')];if(!fs['existsSync'](_0x1f1d10)){throw new db[(_0x9fae('0x52'))][(_0x9fae('0x53'))](_0x9fae('0x54'));}if(_0x41f7f4['filename']){return _0x43464c[_0x9fae('0x4a')](_0x1f1d10,_0x41f7f4[_0x9fae('0x55')]+path['extname'](_0x1f1d10),function(){if(_0x355fbd){fs[_0x9fae('0x56')](_0x1f1d10);}});}else{return _0x43464c[_0x9fae('0x4a')](_0x1f1d10,function(_0x56264d){if(_0x355fbd){fs[_0x9fae('0x56')](_0x1f1d10);}});}}})[_0x9fae('0x48')](function(_0x5dc8aa){if(_0x5dc8aa[_0x9fae('0x57')]===_0x9fae('0x54')){_0x43464c[_0x9fae('0x1a')](0x194)[_0x9fae('0x58')](_0x9fae('0x59'));}else{return handleError(_0x43464c,null);}});};exports[_0x9fae('0x5a')]=function(_0x512e64,_0x400627,_0x2ea1eb){var _0x3e36c4=require(_0x9fae('0x5b'));var _0x1f7a24=![];var _0x2c9643={'$and':[db['sequelize']['where'](db[_0x9fae('0x5c')]['fn'](_0x9fae('0x5d'),db[_0x9fae('0x5c')]['col']('uniqueid')),_0x512e64[_0x9fae('0x2f')][_0x9fae('0x5e')])]};if(_0x512e64[_0x9fae('0x2f')][_0x9fae('0x2c')]&&_0x512e64[_0x9fae('0x2f')]['type']==='uniqueid'){_0x2c9643['$and']['push']({'uniqueid':_0x512e64[_0x9fae('0x43')]['id']});}else{_0x2c9643['$and'][_0x9fae('0x5f')]({'id':_0x512e64['params']['id']});}return db[_0x9fae('0x29')][_0x9fae('0x45')]({'where':_0x2c9643,'attributes':['id',_0x9fae('0x4c')],'raw':!![]})[_0x9fae('0x26')](handleEntityNotFound(_0x400627,null))['then'](function(_0x43bd47){if(_0x43bd47){var _0x136159=util[_0x9fae('0x2e')](_0x9fae('0x4d'),_0x43bd47[_0x9fae('0x4c')]);if(fs[_0x9fae('0x4e')](_0x136159)){_0x1f7a24=!![];return _0x3e36c4['decryptFile'](_0x136159,_0x43bd47['value'],config[_0x9fae('0x50')]['recording'])[_0x9fae('0x26')](function(){return _0x43bd47;});}return _0x43bd47;}})[_0x9fae('0x26')](function(_0x287be4){if(_0x287be4){if(!fs[_0x9fae('0x4e')](_0x287be4[_0x9fae('0x4c')])){throw new db[(_0x9fae('0x52'))]['ValidationError'](_0x9fae('0x54'));}if(_0x287be4['filename']){return _0x400627[_0x9fae('0x4a')](_0x287be4[_0x9fae('0x4c')],_0x287be4[_0x9fae('0x55')]+path[_0x9fae('0x60')](_0x287be4[_0x9fae('0x4c')]),function(){if(_0x1f7a24){fs[_0x9fae('0x56')](_0x287be4[_0x9fae('0x4c')]);}});}else{return _0x400627[_0x9fae('0x4a')](_0x287be4[_0x9fae('0x4c')],function(_0x1da6e7){if(_0x1f7a24){fs[_0x9fae('0x56')](_0x287be4[_0x9fae('0x4c')]);}});}}})['catch'](handleError(_0x400627,null));};exports[_0x9fae('0x61')]=function(_0x4785e4,_0x2f2ad1){return db[_0x9fae('0x29')]['find']({'where':{'id':_0x4785e4[_0x9fae('0x43')]['id']}})[_0x9fae('0x26')](function(_0x46c588){if(_[_0x9fae('0x62')](_0x46c588)){throw new ReferenceError(_0x9fae('0x63'));}return _0x46c588;})[_0x9fae('0x26')](function(_0x4925ad){var _0x731374=_0x4925ad['value'];logger[_0x9fae('0x64')](_0x9fae('0x65'),_0x731374);if(!_['isNil'](_0x4925ad['value'])&&fs[_0x9fae('0x4e')](_0x731374)){logger[_0x9fae('0x64')](_0x9fae('0x66')+_0x731374+_0x9fae('0x67'));fs['unlinkSync'](_0x731374);}_0x731374=_0x731374+_0x9fae('0x68');if(!_[_0x9fae('0x62')](_0x4925ad[_0x9fae('0x4c')])&&fs['existsSync'](_0x731374)){logger[_0x9fae('0x64')](_0x9fae('0x66')+_0x731374+_0x9fae('0x67'));fs[_0x9fae('0x69')](_0x731374);}return _0x4925ad;})[_0x9fae('0x26')](function(_0x3462e5){if(!_0x3462e5)throw new InternalError();return _0x3462e5[_0x9fae('0x61')]();})[_0x9fae('0x26')](function(){_0x2f2ad1[_0x9fae('0x1a')](0xcc)['end']();})['catch'](handleError(_0x2f2ad1,null));};function getBucketslist(_0x920b99,_0x322edc,_0x483229){return new Promise(function(_0x5f36dd,_0x5e1d45){var _0x2451b0=new AWS['S3']({'accessKeyId':_0x322edc,'secretAccessKey':_0x920b99,'region':_0x483229});_0x2451b0['listBuckets']({},function(_0x519321,_0x505beb){if(_0x519321){return _0x5e1d45(_0x519321);}else{return _0x5f36dd(_0x505beb);}});});}function createBucket(_0x57caa9,_0x438caf,_0x28f2d8,_0x1f6895){return new Promise(function(_0x244874,_0x3db958){var _0x3155d6=new AWS['S3']({'accessKeyId':_0x438caf,'secretAccessKey':_0x57caa9,'region':_0x28f2d8});_0x3155d6[_0x9fae('0x6a')]({'Bucket':_0x1f6895},function(_0x55f22a,_0x209fed){if(_0x55f22a){return _0x3db958(_0x55f22a);}else{return _0x244874(_0x209fed);}});});}function uploadFile(_0x2949e7,_0x4a8e0d,_0x295bb4,_0x50f0fe,_0x368a13,_0x330657){return new Promise(function(_0x307bce,_0x54c317){var _0x1184f0=new AWS['S3']({'accessKeyId':_0x4a8e0d,'secretAccessKey':_0x2949e7,'region':_0x295bb4});_0x1184f0[_0x9fae('0x6b')]({'Bucket':_0x50f0fe,'Key':_0x368a13,'Body':_0x330657},function(_0x53ada4,_0x175193){if(_0x53ada4){return _0x54c317(_0x53ada4);}else{return _0x307bce(_0x175193);}});});}function startTranscribe(_0x432f10,_0x107b14,_0xd92019,_0x44bde1,_0x80df4d,_0x4c5929){return new Promise(function(_0x416bfe,_0x227b80){var _0x3fc93c=new AWS[(_0x9fae('0x6c'))]({'accessKeyId':_0x107b14,'secretAccessKey':_0x432f10,'region':_0xd92019});_0x3fc93c[_0x9fae('0x6d')]({'TranscriptionJobName':_0x44bde1,'LanguageCode':_0x80df4d,'Media':{'MediaFileUri':_0x4c5929}},function(_0x54f040,_0x349889){if(_0x54f040){return _0x227b80(_0x54f040);}else{return _0x416bfe(_0x349889);}});});}function transcribe(_0x14e4b0,_0x24ae4f,_0x299a6e,_0xde8a72,_0x4ac228,_0x2f3731,_0x5636db){return new Promise(function(_0x3aa28c,_0x4e2af1){var _0x32a6ed={};logger['info'](util[_0x9fae('0x2e')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x14e4b0,_0x4ac228));return uploadFile(_0x24ae4f,_0x299a6e,_0xde8a72,_0x4ac228,path[_0x9fae('0x6e')](_0x2f3731),fs[_0x9fae('0x6f')](_0x2f3731))[_0x9fae('0x26')](function(_0x35f9a9){logger[_0x9fae('0x64')](util[_0x9fae('0x2e')](_0x9fae('0x70'),_0x14e4b0,_0x4ac228,_0x35f9a9['Location']));_0x32a6ed[_0x9fae('0x71')]=_0x35f9a9[_0x9fae('0x72')];_0x32a6ed[_0x9fae('0x73')]=_0x35f9a9['Location'];logger[_0x9fae('0x64')](util[_0x9fae('0x2e')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x14e4b0));return startTranscribe(_0x24ae4f,_0x299a6e,_0xde8a72,uuidv4(),_0x5636db,_0x35f9a9[_0x9fae('0x74')]);})[_0x9fae('0x26')](function(_0x3f8bf2){logger['info'](util[_0x9fae('0x2e')](_0x9fae('0x75'),_0x14e4b0,_0x3f8bf2[_0x9fae('0x76')][_0x9fae('0x77')]));_0x32a6ed[_0x9fae('0x78')]=_0x3f8bf2[_0x9fae('0x76')][_0x9fae('0x77')];_0x32a6ed[_0x9fae('0x79')]=_0x3f8bf2[_0x9fae('0x76')][_0x9fae('0x7a')];return _0x3aa28c(_0x32a6ed);})[_0x9fae('0x48')](function(_0x55f02c){return _0x4e2af1(_0x55f02c);});});}exports['runTranscribe']=function(_0x55b8eb,_0x56c12c,_0x2ba4bf){var _0x3ebbb0;var _0x358435;var _0x3b1b6b;var _0x30e1fd=require(_0x9fae('0x5b'));return db[_0x9fae('0x29')][_0x9fae('0x7b')]({'where':{'id':_0x55b8eb['params']['id']}})[_0x9fae('0x26')](function(_0x942327){if(_0x942327){var _0x10d89c=util[_0x9fae('0x2e')]('%s.cypher',_0x942327[_0x9fae('0x4c')]);if(fs[_0x9fae('0x4e')](_0x10d89c)){cypher=!![];return _0x30e1fd[_0x9fae('0x4f')](_0x10d89c,_0x942327[_0x9fae('0x4c')],config[_0x9fae('0x50')][_0x9fae('0x51')])[_0x9fae('0x26')](function(){return _0x942327;});}return _0x942327;}})[_0x9fae('0x26')](function(_0x87ff16){if(!_0x87ff16){throw new db[(_0x9fae('0x52'))][(_0x9fae('0x53'))](_0x9fae('0x7c'));}_0x358435=_0x87ff16;return db[_0x9fae('0x7d')][_0x9fae('0x7b')]({'where':{'id':0x1}});})[_0x9fae('0x26')](handleEntityNotFound(_0x56c12c,null))['then'](function(_0x7a6b62){if(_0x7a6b62){_0x3ebbb0=_0x7a6b62;if(!_0x3ebbb0['transcribe']||!_0x3ebbb0[_0x9fae('0x7e')]||!_0x3ebbb0[_0x9fae('0x7f')]||!_0x3ebbb0[_0x9fae('0x80')]||!_0x3ebbb0[_0x9fae('0x71')]){throw new db[(_0x9fae('0x52'))][(_0x9fae('0x53'))]('Transcribe\x20not\x20configured');}if(_0x55b8eb[_0x9fae('0x47')]['runSentiment']&&(!_0x3ebbb0[_0x9fae('0x81')]||!_0x3ebbb0[_0x9fae('0x82')]||!_0x3ebbb0['sentimentRegion']||!_0x3ebbb0[_0x9fae('0x80')]||!_0x3ebbb0[_0x9fae('0x71')])){throw new db[(_0x9fae('0x52'))][(_0x9fae('0x53'))]('Sentiment\x20Analysis\x20not\x20configured');}return db['CloudProvider'][_0x9fae('0x7b')]({'where':{'id':_0x3ebbb0[_0x9fae('0x7e')]}});}})['then'](function(_0x306f13){if(!_0x306f13){throw new db['Sequelize'][(_0x9fae('0x53'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x306f13['data1']||!_0x306f13['data2']){throw new db[(_0x9fae('0x52'))][(_0x9fae('0x53'))](_0x9fae('0x83'));}_0x3b1b6b=_0x306f13;return getBucketslist(_0x3b1b6b[_0x9fae('0x84')],_0x3b1b6b[_0x9fae('0x85')],_0x3ebbb0[_0x9fae('0x7f')]);})[_0x9fae('0x26')](function(_0x58ffdf){if(_0x58ffdf&&_0x58ffdf[_0x9fae('0x86')]){var _0x526461=_[_0x9fae('0x45')](_0x58ffdf[_0x9fae('0x86')],function(_0x3945c5){return _0x3945c5['Name']===_0x3ebbb0[_0x9fae('0x71')];});if(!_0x526461){logger[_0x9fae('0x64')](util[_0x9fae('0x2e')](_0x9fae('0x87'),_0x55b8eb[_0x9fae('0x43')]['id'],_0x3ebbb0[_0x9fae('0x71')]));return createBucket(_0x3b1b6b[_0x9fae('0x84')],_0x3b1b6b[_0x9fae('0x85')],_0x3ebbb0[_0x9fae('0x7f')],_0x3ebbb0['bucket']);}logger[_0x9fae('0x64')](util[_0x9fae('0x2e')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x55b8eb[_0x9fae('0x43')]['id'],_0x3ebbb0['bucket']));return;}})[_0x9fae('0x26')](function(_0x5660c4){if(_0x358435[_0x9fae('0x79')]===_0x9fae('0x88')){return transcribe(_0x55b8eb[_0x9fae('0x43')]['id'],_0x3b1b6b[_0x9fae('0x84')],_0x3b1b6b[_0x9fae('0x85')],_0x3ebbb0[_0x9fae('0x7f')],_0x3ebbb0[_0x9fae('0x71')],_0x358435['value'],_0x3ebbb0['language']);}else{logger['info'](util[_0x9fae('0x2e')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x55b8eb['params']['id']));return{'transcribeStatus':_0x9fae('0x89')};}})['then'](function(_0x5b54c8){if(_0x5b54c8){_0x5b54c8['tempSentiment']=_0x55b8eb['body']['runSentiment'];return _0x358435[_0x9fae('0x8a')](_0x5b54c8);}})['then'](respondWithResult(_0x56c12c,null))[_0x9fae('0x48')](handleError(_0x56c12c,null));};function writeFile(_0x41ac5f,_0x3f1d64){return new Promise(function(_0x32c0b6,_0x480baf){fs['writeFile'](_0x3f1d64,_0x41ac5f,function(_0x523614,_0x311d25){if(_0x523614){return _0x480baf(_0x523614);}else{return _0x32c0b6(_0x311d25);}});});}exports['downloadTranscribe']=function(_0x3f3851,_0x58e190,_0x539f45){return db['VoiceRecording']['findOne']({'where':{'id':_0x3f3851[_0x9fae('0x43')]['id']}})[_0x9fae('0x26')](handleEntityNotFound(_0x58e190))[_0x9fae('0x26')](function(_0xab118f){if(_0xab118f&&_0xab118f[_0x9fae('0x8b')]){var _0x3af003=_0xab118f[_0x9fae('0x8b')];var _0x37fab2=config[_0x9fae('0x8c')]+_0x9fae('0x8d')+_0xab118f['id']+_0x9fae('0x8e');if(fs[_0x9fae('0x4e')](_0x37fab2)){return _0x37fab2;}return writeFile(_0x3af003,_0x37fab2)[_0x9fae('0x26')](function(){return _0x37fab2;});}else{throw new db[(_0x9fae('0x52'))]['ValidationError'](_0x9fae('0x8f'));}})[_0x9fae('0x26')](function(_0x5b817c){return _0x58e190[_0x9fae('0x4a')](_0x5b817c);})[_0x9fae('0x48')](handleError(_0x58e190));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 811016e..932bfd1 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 _0x0faf=['./voiceRecording.attributes','define','VoiceRecording','voice_recordings','uniqueid','transcribeStatus'];(function(_0x467c92,_0x3e54b6){var _0x5c691c=function(_0x32b1f0){while(--_0x32b1f0){_0x467c92['push'](_0x467c92['shift']());}};_0x5c691c(++_0x3e54b6);}(_0x0faf,0x132));var _0xf0fa=function(_0x44c974,_0x1bcfde){_0x44c974=_0x44c974-0x0;var _0x5214c6=_0x0faf[_0x44c974];return _0x5214c6;};'use strict';var attributes=require(_0xf0fa('0x0'));module['exports']=function(_0x43fe7a,_0x1b4763){return _0x43fe7a[_0xf0fa('0x1')](_0xf0fa('0x2'),attributes,{'tableName':_0xf0fa('0x3'),'paranoid':![],'indexes':[{'name':_0xf0fa('0x4'),'fields':[_0xf0fa('0x4')]},{'name':_0xf0fa('0x5'),'fields':[_0xf0fa('0x5')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc678=['define','voice_recordings','uniqueid','transcribeStatus'];(function(_0x50a333,_0x399fb5){var _0x21156f=function(_0x5de8cd){while(--_0x5de8cd){_0x50a333['push'](_0x50a333['shift']());}};_0x21156f(++_0x399fb5);}(_0xc678,0x1b4));var _0x8c67=function(_0x3345f4,_0x56fd4d){_0x3345f4=_0x3345f4-0x0;var _0x23a41c=_0xc678[_0x3345f4];return _0x23a41c;};'use strict';var attributes=require('./voiceRecording.attributes');module['exports']=function(_0x3002e5,_0x137fa2){return _0x3002e5[_0x8c67('0x0')]('VoiceRecording',attributes,{'tableName':_0x8c67('0x1'),'paranoid':![],'indexes':[{'name':_0x8c67('0x2'),'fields':[_0x8c67('0x2')]},{'name':_0x8c67('0x3'),'fields':['transcribeStatus']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index edcbf22..79041a6 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 _0x4325=['attributes','CreateVoiceRecording','Setting','findOne','create','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','VoiceRecording,\x20%s,\x20%s','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where'];(function(_0xcbda08,_0x523f37){var _0x3f8713=function(_0x561b9d){while(--_0x561b9d){_0xcbda08['push'](_0xcbda08['shift']());}};_0x3f8713(++_0x523f37);}(_0x4325,0x1da));var _0x5432=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x4325[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x5432('0x0'));var util=require(_0x5432('0x1'));var moment=require('moment');var BPromise=require(_0x5432('0x2'));var rs=require(_0x5432('0x3'));var fs=require('fs');var Redis=require(_0x5432('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5432('0x5'))(_0x5432('0x6'));var config=require(_0x5432('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5432('0x8')][_0x5432('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a6e76,_0x106ec9,_0x50394d){return new BPromise(function(_0xc8252e,_0x1c9762){return client[_0x5432('0xa')](_0x4a6e76,_0x50394d)[_0x5432('0xb')](function(_0x263a0c){logger['info'](_0x5432('0xc'),_0x106ec9,'request\x20sent');logger[_0x5432('0xd')](_0x5432('0xe'),_0x106ec9,_0x5432('0xf'),JSON[_0x5432('0x10')](_0x263a0c));if(_0x263a0c['error']){if(_0x263a0c['error'][_0x5432('0x11')]===0x1f4){logger[_0x5432('0x12')]('VoiceRecording,\x20%s,\x20%s',_0x106ec9,_0x263a0c[_0x5432('0x12')][_0x5432('0x13')]);return _0x1c9762(_0x263a0c[_0x5432('0x12')][_0x5432('0x13')]);}logger[_0x5432('0x12')](_0x5432('0xc'),_0x106ec9,_0x263a0c['error']['message']);return _0xc8252e(_0x263a0c[_0x5432('0x12')][_0x5432('0x13')]);}else{logger[_0x5432('0x14')](_0x5432('0xc'),_0x106ec9,_0x5432('0xf'));_0xc8252e(_0x263a0c[_0x5432('0x15')]['message']);}})[_0x5432('0x16')](function(_0x49e8fd){logger[_0x5432('0x12')](_0x5432('0xc'),_0x106ec9,_0x49e8fd);_0x1c9762(_0x49e8fd);});});}exports[_0x5432('0x17')]=function(_0x32fe60){var _0x4221a8=this;return new Promise(function(_0x5f011f,_0x3f3873){return db[_0x5432('0x18')][_0x5432('0x19')](_0x32fe60[_0x5432('0x1a')],{'raw':_0x32fe60[_0x5432('0x1b')]?_0x32fe60[_0x5432('0x1b')][_0x5432('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32fe60['options']?_0x32fe60[_0x5432('0x1b')][_0x5432('0x1d')]||null:null,'attributes':_0x32fe60[_0x5432('0x1b')]?_0x32fe60[_0x5432('0x1b')][_0x5432('0x1e')]||null:null,'limit':_0x32fe60['options']?_0x32fe60['options']['limit']||null:null})[_0x5432('0xb')](function(_0xb900f2){logger[_0x5432('0x14')](_0x5432('0x17'),_0x32fe60);logger['debug']('UpdateVoiceRecording',_0x32fe60,JSON[_0x5432('0x10')](_0xb900f2));_0x5f011f(_0xb900f2);})[_0x5432('0x16')](function(_0x4a40fc){logger[_0x5432('0x12')](_0x5432('0x17'),_0x4a40fc[_0x5432('0x13')],_0x32fe60);_0x3f3873(_0x4221a8['error'](0x1f4,_0x4a40fc[_0x5432('0x13')]));});});};exports[_0x5432('0x1f')]=function(_0xe7eda2){var _0x520da1=this;return new Promise(function(_0x4ab09d,_0x1f2055){var _0x2114b8=require('../../components/encryptor');var _0x1abe73;return db[_0x5432('0x20')][_0x5432('0x21')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x5432('0xb')](function(_0x5be867){_0x1abe73=_0x5be867;return db['VoiceRecording'][_0x5432('0x22')](_0xe7eda2['body']);})[_0x5432('0xb')](function(_0x578281){if(_0x1abe73['callRecordingEncryption']&&fs[_0x5432('0x23')](_0x578281[_0x5432('0x24')])){var _0x345b51=util['format'](_0x5432('0x25'),_0x578281[_0x5432('0x24')]);return _0x2114b8[_0x5432('0x26')](_0x578281[_0x5432('0x24')],_0x345b51,config[_0x5432('0x27')][_0x5432('0x28')])[_0x5432('0xb')](function(){fs[_0x5432('0x29')](_0x578281[_0x5432('0x24')]);logger['info']('CreateVoiceRecording\x20file\x20encrypted');return _0x578281;});}return _0x578281;})[_0x5432('0xb')](function(_0x42ab1e){logger[_0x5432('0x14')](_0x5432('0x1f'),_0xe7eda2);logger[_0x5432('0xd')]('CreateVoiceRecording',_0xe7eda2,JSON[_0x5432('0x10')](_0x42ab1e));_0x4ab09d(_0x42ab1e);})['catch'](function(_0x2955e0){logger[_0x5432('0x12')](_0x5432('0x1f'),_0x2955e0[_0x5432('0x13')],_0xe7eda2);_0x1f2055(_0x520da1[_0x5432('0x12')](0x1f4,_0x2955e0[_0x5432('0x13')]));});});}; \ No newline at end of file +var _0x7bd0=['callRecordingEncryption','create','existsSync','value','format','%s.cypher','encryptFile','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','VoiceRecording','update','body','options','raw','attributes','UpdateVoiceRecording','CreateVoiceRecording','Setting','findOne'];(function(_0x4bd950,_0x184ed5){var _0x5dc59a=function(_0x6ff30f){while(--_0x6ff30f){_0x4bd950['push'](_0x4bd950['shift']());}};_0x5dc59a(++_0x184ed5);}(_0x7bd0,0x111));var _0x07bd=function(_0x540dcb,_0x4eacb6){_0x540dcb=_0x540dcb-0x0;var _0x49353c=_0x7bd0[_0x540dcb];return _0x49353c;};'use strict';var _=require(_0x07bd('0x0'));var util=require(_0x07bd('0x1'));var moment=require(_0x07bd('0x2'));var BPromise=require(_0x07bd('0x3'));var rs=require(_0x07bd('0x4'));var fs=require('fs');var Redis=require(_0x07bd('0x5'));var db=require(_0x07bd('0x6'))['db'];var utils=require(_0x07bd('0x7'));var logger=require('../../config/logger')(_0x07bd('0x8'));var config=require(_0x07bd('0x9'));var jayson=require(_0x07bd('0xa'));var client=jayson[_0x07bd('0xb')][_0x07bd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x422a22,_0x2e4cd1,_0x5a939d){return new BPromise(function(_0x3968d9,_0x5cd446){return client[_0x07bd('0xd')](_0x422a22,_0x5a939d)[_0x07bd('0xe')](function(_0x323724){logger['info'](_0x07bd('0xf'),_0x2e4cd1,_0x07bd('0x10'));logger[_0x07bd('0x11')](_0x07bd('0x12'),_0x2e4cd1,'request\x20sent',JSON[_0x07bd('0x13')](_0x323724));if(_0x323724[_0x07bd('0x14')]){if(_0x323724[_0x07bd('0x14')][_0x07bd('0x15')]===0x1f4){logger[_0x07bd('0x14')](_0x07bd('0xf'),_0x2e4cd1,_0x323724[_0x07bd('0x14')][_0x07bd('0x16')]);return _0x5cd446(_0x323724['error']['message']);}logger[_0x07bd('0x14')](_0x07bd('0xf'),_0x2e4cd1,_0x323724[_0x07bd('0x14')][_0x07bd('0x16')]);return _0x3968d9(_0x323724[_0x07bd('0x14')][_0x07bd('0x16')]);}else{logger[_0x07bd('0x17')]('VoiceRecording,\x20%s,\x20%s',_0x2e4cd1,_0x07bd('0x10'));_0x3968d9(_0x323724['result'][_0x07bd('0x16')]);}})[_0x07bd('0x18')](function(_0x31655a){logger[_0x07bd('0x14')](_0x07bd('0xf'),_0x2e4cd1,_0x31655a);_0x5cd446(_0x31655a);});});}exports['UpdateVoiceRecording']=function(_0x3f9f0b){var _0xc4cf4c=this;return new Promise(function(_0x4948f4,_0x3e8ec4){return db[_0x07bd('0x19')][_0x07bd('0x1a')](_0x3f9f0b[_0x07bd('0x1b')],{'raw':_0x3f9f0b[_0x07bd('0x1c')]?_0x3f9f0b[_0x07bd('0x1c')][_0x07bd('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f9f0b[_0x07bd('0x1c')]?_0x3f9f0b[_0x07bd('0x1c')]['where']||null:null,'attributes':_0x3f9f0b[_0x07bd('0x1c')]?_0x3f9f0b[_0x07bd('0x1c')][_0x07bd('0x1e')]||null:null,'limit':_0x3f9f0b[_0x07bd('0x1c')]?_0x3f9f0b[_0x07bd('0x1c')]['limit']||null:null})['then'](function(_0xbb7117){logger['info'](_0x07bd('0x1f'),_0x3f9f0b);logger['debug']('UpdateVoiceRecording',_0x3f9f0b,JSON[_0x07bd('0x13')](_0xbb7117));_0x4948f4(_0xbb7117);})[_0x07bd('0x18')](function(_0xf3b23c){logger[_0x07bd('0x14')](_0x07bd('0x1f'),_0xf3b23c[_0x07bd('0x16')],_0x3f9f0b);_0x3e8ec4(_0xc4cf4c['error'](0x1f4,_0xf3b23c[_0x07bd('0x16')]));});});};exports[_0x07bd('0x20')]=function(_0x3db9d0){var _0x2a7202=this;return new Promise(function(_0x12ce26,_0x1c1fda){var _0x571dab=require('../../components/encryptor');var _0x5184dc;return db[_0x07bd('0x21')][_0x07bd('0x22')]({'attributes':['id',_0x07bd('0x23')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x1a3aa9){_0x5184dc=_0x1a3aa9;return db[_0x07bd('0x19')][_0x07bd('0x24')](_0x3db9d0[_0x07bd('0x1b')]);})[_0x07bd('0xe')](function(_0x13bf6b){if(_0x5184dc['callRecordingEncryption']&&fs[_0x07bd('0x25')](_0x13bf6b[_0x07bd('0x26')])){var _0x4182b9=util[_0x07bd('0x27')](_0x07bd('0x28'),_0x13bf6b[_0x07bd('0x26')]);return _0x571dab[_0x07bd('0x29')](_0x13bf6b[_0x07bd('0x26')],_0x4182b9,config['secrets']['recording'])[_0x07bd('0xe')](function(){fs[_0x07bd('0x2a')](_0x13bf6b[_0x07bd('0x26')]);logger['info'](_0x07bd('0x2b'));return _0x13bf6b;});}return _0x13bf6b;})[_0x07bd('0xe')](function(_0x208aca){logger['info']('CreateVoiceRecording',_0x3db9d0);logger[_0x07bd('0x11')](_0x07bd('0x20'),_0x3db9d0,JSON[_0x07bd('0x13')](_0x208aca));_0x12ce26(_0x208aca);})[_0x07bd('0x18')](function(_0x5f29c5){logger[_0x07bd('0x14')](_0x07bd('0x20'),_0x5f29c5[_0x07bd('0x16')],_0x3db9d0);_0x1c1fda(_0x2a7202['error'](0x1f4,_0x5f29c5[_0x07bd('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 162e27d..22d94a5 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 _0xb0c3=['../../config/environment','isAuthenticated','index','get','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service'];(function(_0x30a43e,_0xe75825){var _0x7f4af9=function(_0x419891){while(--_0x419891){_0x30a43e['push'](_0x30a43e['shift']());}};_0x7f4af9(++_0xe75825);}(_0xb0c3,0xcb));var _0x3b0c=function(_0x6d9a0a,_0x5aa364){_0x6d9a0a=_0x6d9a0a-0x0;var _0x376544=_0xb0c3[_0x6d9a0a];return _0x376544;};'use strict';var multer=require(_0x3b0c('0x0'));var util=require(_0x3b0c('0x1'));var path=require(_0x3b0c('0x2'));var timeout=require('connect-timeout');var express=require(_0x3b0c('0x3'));var router=express['Router']();var fs_extra=require(_0x3b0c('0x4'));var auth=require(_0x3b0c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3b0c('0x6'));var controller=require('./voiceTransferReport.controller');router['get']('/',auth[_0x3b0c('0x7')](),controller[_0x3b0c('0x8')]);router[_0x3b0c('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x3b0c('0xa')]);router[_0x3b0c('0x9')](_0x3b0c('0xb'),auth[_0x3b0c('0x7')](),controller['show']);router[_0x3b0c('0xc')]('/',auth[_0x3b0c('0x7')](),controller[_0x3b0c('0xd')]);router[_0x3b0c('0xe')](_0x3b0c('0xb'),auth[_0x3b0c('0x7')](),controller[_0x3b0c('0xf')]);router[_0x3b0c('0x10')](_0x3b0c('0xb'),auth[_0x3b0c('0x7')](),controller[_0x3b0c('0x11')]);module[_0x3b0c('0x12')]=router; \ No newline at end of file +var _0x20df=['delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0x20df,0x10b));var _0xf20d=function(_0x5df033,_0x29458b){_0x5df033=_0x5df033-0x0;var _0x445829=_0x20df[_0x5df033];return _0x445829;};'use strict';var multer=require(_0xf20d('0x0'));var util=require(_0xf20d('0x1'));var path=require('path');var timeout=require(_0xf20d('0x2'));var express=require(_0xf20d('0x3'));var router=express[_0xf20d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf20d('0x5'));var interaction=require(_0xf20d('0x6'));var config=require(_0xf20d('0x7'));var controller=require(_0xf20d('0x8'));router[_0xf20d('0x9')]('/',auth[_0xf20d('0xa')](),controller[_0xf20d('0xb')]);router[_0xf20d('0x9')](_0xf20d('0xc'),auth[_0xf20d('0xa')](),controller[_0xf20d('0xd')]);router['get']('/:id',auth[_0xf20d('0xa')](),controller[_0xf20d('0xe')]);router[_0xf20d('0xf')]('/',auth[_0xf20d('0xa')](),controller[_0xf20d('0x10')]);router[_0xf20d('0x11')](_0xf20d('0x12'),auth[_0xf20d('0xa')](),controller['update']);router[_0xf20d('0x13')](_0xf20d('0x12'),auth[_0xf20d('0xa')](),controller[_0xf20d('0x14')]);module[_0xf20d('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 1943a88..cf6b6a1 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 _0x104a=['STRING','Yes','sequelize','moment','ENUM','blind'];(function(_0x44c423,_0x5b534b){var _0x3a44bb=function(_0xe34e7b){while(--_0xe34e7b){_0x44c423['push'](_0x44c423['shift']());}};_0x3a44bb(++_0x5b534b);}(_0x104a,0x128));var _0xa104=function(_0x1992f1,_0x5c61f0){_0x1992f1=_0x1992f1-0x0;var _0x413dfe=_0x104a[_0x1992f1];return _0x413dfe;};'use strict';var Sequelize=require(_0xa104('0x0'));var moment=require(_0xa104('0x1'));module['exports']={'type':{'type':Sequelize[_0xa104('0x2')](_0xa104('0x3'),'attended')},'result':{'type':Sequelize[_0xa104('0x4')]},'transfererchannel':{'type':Sequelize[_0xa104('0x4')]},'transferercalleridnum':{'type':Sequelize[_0xa104('0x4')]},'transferercalleridname':{'type':Sequelize[_0xa104('0x4')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0xa104('0x4')]},'transfereraccountcode':{'type':Sequelize[_0xa104('0x4')]},'transferercontext':{'type':Sequelize[_0xa104('0x4')]},'transfererexten':{'type':Sequelize[_0xa104('0x4')]},'transfererlinkedid':{'type':Sequelize[_0xa104('0x4')]},'transfereechannel':{'type':Sequelize[_0xa104('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0xa104('0x4')]},'transfereecalleridname':{'type':Sequelize[_0xa104('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xa104('0x4')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0xa104('0x4')]},'transfereeexten':{'type':Sequelize[_0xa104('0x4')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize['ENUM'](_0xa104('0x5'),'No')},'context':{'type':Sequelize[_0xa104('0x4')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8ba1=['blind','attended','STRING','sequelize','moment','exports','ENUM'];(function(_0xb3c3b9,_0x41d41f){var _0x6e79b0=function(_0x1ac4a2){while(--_0x1ac4a2){_0xb3c3b9['push'](_0xb3c3b9['shift']());}};_0x6e79b0(++_0x41d41f);}(_0x8ba1,0x192));var _0x18ba=function(_0x5a8680,_0xb34899){_0x5a8680=_0x5a8680-0x0;var _0x3b67d8=_0x8ba1[_0x5a8680];return _0x3b67d8;};'use strict';var Sequelize=require(_0x18ba('0x0'));var moment=require(_0x18ba('0x1'));module[_0x18ba('0x2')]={'type':{'type':Sequelize[_0x18ba('0x3')](_0x18ba('0x4'),_0x18ba('0x5'))},'result':{'type':Sequelize[_0x18ba('0x6')]},'transfererchannel':{'type':Sequelize[_0x18ba('0x6')]},'transferercalleridnum':{'type':Sequelize[_0x18ba('0x6')]},'transferercalleridname':{'type':Sequelize[_0x18ba('0x6')]},'transfererconnectedlinenum':{'type':Sequelize[_0x18ba('0x6')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x18ba('0x6')]},'transferercontext':{'type':Sequelize[_0x18ba('0x6')]},'transfererexten':{'type':Sequelize[_0x18ba('0x6')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0x18ba('0x6')]},'transfereecalleridnum':{'type':Sequelize[_0x18ba('0x6')]},'transfereecalleridname':{'type':Sequelize[_0x18ba('0x6')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x18ba('0x6')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x18ba('0x6')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x18ba('0x6')]},'transfereelinkedid':{'type':Sequelize[_0x18ba('0x6')]},'isexternal':{'type':Sequelize[_0x18ba('0x3')]('Yes','No')},'context':{'type':Sequelize[_0x18ba('0x6')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 5e4538a..0dfcf0a 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 _0x772c=['map','rawAttributes','key','model','query','filters','attributes','intersection','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','VoiceTransferReport','include','findAll','rows','catch','show','params','keys','fields','includeAll','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','end','stack','name','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x772c,0xfb));var _0xc772=function(_0x304ec2,_0x507b33){_0x304ec2=_0x304ec2-0x0;var _0x26e56d=_0x772c[_0x304ec2];return _0x26e56d;};'use strict';var emlformat=require(_0xc772('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc772('0x1'));var jsonpatch=require(_0xc772('0x2'));var rp=require(_0xc772('0x3'));var moment=require(_0xc772('0x4'));var BPromise=require(_0xc772('0x5'));var Mustache=require(_0xc772('0x6'));var util=require('util');var path=require(_0xc772('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc772('0x8'));var _=require(_0xc772('0x9'));var squel=require(_0xc772('0xa'));var crypto=require(_0xc772('0xb'));var jsforce=require(_0xc772('0xc'));var deskjs=require(_0xc772('0xd'));var toCsv=require(_0xc772('0xe'));var querystring=require(_0xc772('0xf'));var Papa=require(_0xc772('0x10'));var Redis=require(_0xc772('0x11'));var authService=require(_0xc772('0x12'));var qs=require(_0xc772('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xc772('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xc772('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1cb13a,_0x8ee1ed){_0x8ee1ed=_0x8ee1ed||0xcc;return function(_0x3c9a37){if(_0x3c9a37){return _0x1cb13a[_0xc772('0x16')](_0x8ee1ed);}return _0x1cb13a['status'](_0x8ee1ed)['end']();};}function respondWithResult(_0x14d0be,_0x1e44d1){_0x1e44d1=_0x1e44d1||0xc8;return function(_0x5f1ea5){if(_0x5f1ea5){return _0x14d0be[_0xc772('0x17')](_0x1e44d1)[_0xc772('0x18')](_0x5f1ea5);}};}function respondWithFilteredResult(_0x14dd44,_0x59d039){return function(_0x5f54d5){if(_0x5f54d5){var _0x31cd4e=typeof _0x59d039[_0xc772('0x19')]===_0xc772('0x1a')&&typeof _0x59d039[_0xc772('0x1b')]===_0xc772('0x1a');var _0x3ab16a=_0x5f54d5[_0xc772('0x1c')];var _0x47726b=_0x31cd4e?0x0:_0x59d039[_0xc772('0x19')];var _0x4c62a6=_0x31cd4e?_0x5f54d5[_0xc772('0x1c')]:_0x59d039[_0xc772('0x19')]+_0x59d039[_0xc772('0x1b')];var _0x222922;if(_0x4c62a6>=_0x3ab16a){_0x4c62a6=_0x3ab16a;_0x222922=0xc8;}else{_0x222922=0xce;}_0x14dd44[_0xc772('0x17')](_0x222922);return _0x14dd44[_0xc772('0x1d')](_0xc772('0x1e'),_0x47726b+'-'+_0x4c62a6+'/'+_0x3ab16a)[_0xc772('0x18')](_0x5f54d5);}return null;};}function patchUpdates(_0x579608){return function(_0x15f56e){try{jsonpatch[_0xc772('0x1f')](_0x15f56e,_0x579608,!![]);}catch(_0x2c006a){return BPromise[_0xc772('0x20')](_0x2c006a);}return _0x15f56e[_0xc772('0x21')]();};}function saveUpdates(_0x120c44,_0x4a57b9){return function(_0x1ef986){if(_0x1ef986){return _0x1ef986[_0xc772('0x22')](_0x120c44)['then'](function(_0x1cf044){return _0x1cf044;});}return null;};}function removeEntity(_0x323a94,_0xc19df3){return function(_0x19403e){if(_0x19403e){return _0x19403e[_0xc772('0x23')]()[_0xc772('0x24')](function(){_0x323a94['status'](0xcc)[_0xc772('0x25')]();});}};}function handleEntityNotFound(_0x688f11,_0x1360a7){return function(_0x269a9e){if(!_0x269a9e){_0x688f11['sendStatus'](0x194);}return _0x269a9e;};}function handleError(_0x42bd22,_0x53c469){_0x53c469=_0x53c469||0x1f4;return function(_0xdfddb7){logger['error'](_0xdfddb7[_0xc772('0x26')]);if(_0xdfddb7[_0xc772('0x27')]){delete _0xdfddb7['name'];}_0x42bd22[_0xc772('0x17')](_0x53c469)['send'](_0xdfddb7);};}exports[_0xc772('0x28')]=function(_0x118163,_0x59af9a){var _0x32abd5={},_0x2f1776={},_0x561277={'count':0x0,'rows':[]};var _0x12964d=_[_0xc772('0x29')](db['VoiceTransferReport'][_0xc772('0x2a')],function(_0x12530f){return{'name':_0x12530f['fieldName'],'type':_0x12530f['type'][_0xc772('0x2b')]};});_0x2f1776[_0xc772('0x2c')]=_['map'](_0x12964d,'name');_0x2f1776[_0xc772('0x2d')]=_['keys'](_0x118163[_0xc772('0x2d')]);_0x2f1776[_0xc772('0x2e')]=_['intersection'](_0x2f1776[_0xc772('0x2c')],_0x2f1776[_0xc772('0x2d')]);_0x32abd5[_0xc772('0x2f')]=_[_0xc772('0x30')](_0x2f1776['model'],qs['fields'](_0x118163[_0xc772('0x2d')]['fields']));_0x32abd5[_0xc772('0x2f')]=_0x32abd5[_0xc772('0x2f')]['length']?_0x32abd5['attributes']:_0x2f1776['model'];if(!_0x118163[_0xc772('0x2d')][_0xc772('0x31')](_0xc772('0x32'))){_0x32abd5[_0xc772('0x1b')]=qs[_0xc772('0x1b')](_0x118163[_0xc772('0x2d')][_0xc772('0x1b')]);_0x32abd5[_0xc772('0x19')]=qs[_0xc772('0x19')](_0x118163['query'][_0xc772('0x19')]);}_0x32abd5[_0xc772('0x33')]=qs[_0xc772('0x34')](_0x118163[_0xc772('0x2d')][_0xc772('0x34')]);_0x32abd5[_0xc772('0x35')]=qs[_0xc772('0x2e')](_[_0xc772('0x36')](_0x118163['query'],_0x2f1776[_0xc772('0x2e')]),_0x12964d);if(_0x118163[_0xc772('0x2d')]['filter']){_0x32abd5[_0xc772('0x35')]=_[_0xc772('0x37')](_0x32abd5[_0xc772('0x35')],{'$or':_['map'](_0x12964d,function(_0x58895e){if(_0x58895e[_0xc772('0x38')]!==_0xc772('0x39')){var _0x52ca50={};_0x52ca50[_0x58895e[_0xc772('0x27')]]={'$like':'%'+_0x118163[_0xc772('0x2d')][_0xc772('0x3a')]+'%'};return _0x52ca50;}})});}_0x32abd5=_[_0xc772('0x37')]({},_0x32abd5,_0x118163['options']);var _0xa45089={'where':_0x32abd5['where']};return db[_0xc772('0x3b')][_0xc772('0x1c')](_0xa45089)[_0xc772('0x24')](function(_0x8ce743){_0x561277[_0xc772('0x1c')]=_0x8ce743;if(_0x118163[_0xc772('0x2d')]['includeAll']){_0x32abd5[_0xc772('0x3c')]=[{'all':!![]}];}return db[_0xc772('0x3b')][_0xc772('0x3d')](_0x32abd5);})[_0xc772('0x24')](function(_0x3bdfcb){_0x561277[_0xc772('0x3e')]=_0x3bdfcb;return _0x561277;})[_0xc772('0x24')](respondWithFilteredResult(_0x59af9a,_0x32abd5))[_0xc772('0x3f')](handleError(_0x59af9a,null));};exports[_0xc772('0x40')]=function(_0x53f122,_0x8c7a5b){var _0x1780b2={'raw':!![],'where':{'id':_0x53f122[_0xc772('0x41')]['id']}},_0x4909c2={};_0x4909c2['model']=_[_0xc772('0x42')](db[_0xc772('0x3b')][_0xc772('0x2a')]);_0x4909c2[_0xc772('0x2d')]=_['keys'](_0x53f122[_0xc772('0x2d')]);_0x4909c2[_0xc772('0x2e')]=_[_0xc772('0x30')](_0x4909c2[_0xc772('0x2c')],_0x4909c2[_0xc772('0x2d')]);_0x1780b2[_0xc772('0x2f')]=_[_0xc772('0x30')](_0x4909c2['model'],qs['fields'](_0x53f122[_0xc772('0x2d')][_0xc772('0x43')]));_0x1780b2[_0xc772('0x2f')]=_0x1780b2[_0xc772('0x2f')]['length']?_0x1780b2[_0xc772('0x2f')]:_0x4909c2[_0xc772('0x2c')];if(_0x53f122[_0xc772('0x2d')][_0xc772('0x44')]){_0x1780b2[_0xc772('0x3c')]=[{'all':!![]}];}_0x1780b2=_['merge']({},_0x1780b2,_0x53f122['options']);return db[_0xc772('0x3b')][_0xc772('0x45')](_0x1780b2)[_0xc772('0x24')](handleEntityNotFound(_0x8c7a5b,null))[_0xc772('0x24')](respondWithResult(_0x8c7a5b,null))[_0xc772('0x3f')](handleError(_0x8c7a5b,null));};exports[_0xc772('0x46')]=function(_0x48ae4a,_0x26fc73){return db['VoiceTransferReport'][_0xc772('0x46')](_0x48ae4a[_0xc772('0x47')],{})[_0xc772('0x24')](respondWithResult(_0x26fc73,0xc9))['catch'](handleError(_0x26fc73,null));};exports['update']=function(_0x5cd741,_0x41c7f6){if(_0x5cd741['body']['id']){delete _0x5cd741[_0xc772('0x47')]['id'];}return db['VoiceTransferReport']['find']({'where':{'id':_0x5cd741[_0xc772('0x41')]['id']}})[_0xc772('0x24')](handleEntityNotFound(_0x41c7f6,null))['then'](saveUpdates(_0x5cd741['body'],null))['then'](respondWithResult(_0x41c7f6,null))[_0xc772('0x3f')](handleError(_0x41c7f6,null));};exports[_0xc772('0x23')]=function(_0x541fd1,_0x292433){return db['VoiceTransferReport'][_0xc772('0x45')]({'where':{'id':_0x541fd1['params']['id']}})[_0xc772('0x24')](handleEntityNotFound(_0x292433,null))[_0xc772('0x24')](removeEntity(_0x292433,null))[_0xc772('0x3f')](handleError(_0x292433,null));};exports[_0xc772('0x48')]=function(_0x5945ab,_0x58e927){return db[_0xc772('0x3b')][_0xc772('0x48')]()[_0xc772('0x24')](respondWithResult(_0x58e927,null))[_0xc772('0x3f')](handleError(_0x58e927,null));}; \ No newline at end of file +var _0x95a9=['model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','params','find','create','body','describe','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','status','error','index','map','VoiceTransferReport','rawAttributes','fieldName'];(function(_0x335271,_0x5025f2){var _0xa9fff8=function(_0x28d0bd){while(--_0x28d0bd){_0x335271['push'](_0x335271['shift']());}};_0xa9fff8(++_0x5025f2);}(_0x95a9,0xab));var _0x995a=function(_0x59e7d5,_0x26fcab){_0x59e7d5=_0x59e7d5-0x0;var _0x5000d4=_0x95a9[_0x59e7d5];return _0x5000d4;};'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(_0x995a('0x0'));var moment=require('moment');var BPromise=require(_0x995a('0x1'));var Mustache=require(_0x995a('0x2'));var util=require(_0x995a('0x3'));var path=require(_0x995a('0x4'));var sox=require(_0x995a('0x5'));var csv=require(_0x995a('0x6'));var ejs=require(_0x995a('0x7'));var fs=require('fs');var fs_extra=require(_0x995a('0x8'));var _=require('lodash');var squel=require(_0x995a('0x9'));var crypto=require(_0x995a('0xa'));var jsforce=require(_0x995a('0xb'));var deskjs=require(_0x995a('0xc'));var toCsv=require(_0x995a('0x6'));var querystring=require(_0x995a('0xd'));var Papa=require(_0x995a('0xe'));var Redis=require(_0x995a('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x995a('0x10'));var hardwareService=require(_0x995a('0x11'));var logger=require(_0x995a('0x12'))(_0x995a('0x13'));var utils=require(_0x995a('0x14'));var config=require(_0x995a('0x15'));var licenseUtil=require(_0x995a('0x16'));var db=require(_0x995a('0x17'))['db'];function respondWithStatusCode(_0x11de4c,_0x42c49b){_0x42c49b=_0x42c49b||0xcc;return function(_0x257dd5){if(_0x257dd5){return _0x11de4c[_0x995a('0x18')](_0x42c49b);}return _0x11de4c['status'](_0x42c49b)['end']();};}function respondWithResult(_0x6663aa,_0x35c775){_0x35c775=_0x35c775||0xc8;return function(_0x1f7f90){if(_0x1f7f90){return _0x6663aa['status'](_0x35c775)[_0x995a('0x19')](_0x1f7f90);}};}function respondWithFilteredResult(_0x130d7e,_0x10a63e){return function(_0x294b58){if(_0x294b58){var _0x2fa74c=typeof _0x10a63e[_0x995a('0x1a')]===_0x995a('0x1b')&&typeof _0x10a63e[_0x995a('0x1c')]==='undefined';var _0x43aa79=_0x294b58[_0x995a('0x1d')];var _0x495b32=_0x2fa74c?0x0:_0x10a63e[_0x995a('0x1a')];var _0x457309=_0x2fa74c?_0x294b58['count']:_0x10a63e[_0x995a('0x1a')]+_0x10a63e[_0x995a('0x1c')];var _0x53cf98;if(_0x457309>=_0x43aa79){_0x457309=_0x43aa79;_0x53cf98=0xc8;}else{_0x53cf98=0xce;}_0x130d7e['status'](_0x53cf98);return _0x130d7e[_0x995a('0x1e')](_0x995a('0x1f'),_0x495b32+'-'+_0x457309+'/'+_0x43aa79)[_0x995a('0x19')](_0x294b58);}return null;};}function patchUpdates(_0xafa6c1){return function(_0x34779e){try{jsonpatch[_0x995a('0x20')](_0x34779e,_0xafa6c1,!![]);}catch(_0x554e1f){return BPromise[_0x995a('0x21')](_0x554e1f);}return _0x34779e[_0x995a('0x22')]();};}function saveUpdates(_0x5d0591,_0x5754e2){return function(_0x536c60){if(_0x536c60){return _0x536c60[_0x995a('0x23')](_0x5d0591)[_0x995a('0x24')](function(_0x4a1e62){return _0x4a1e62;});}return null;};}function removeEntity(_0x21b07d,_0xf3dec2){return function(_0xfc8e5b){if(_0xfc8e5b){return _0xfc8e5b[_0x995a('0x25')]()['then'](function(){_0x21b07d[_0x995a('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3265ec,_0x508b00){return function(_0x37032e){if(!_0x37032e){_0x3265ec[_0x995a('0x18')](0x194);}return _0x37032e;};}function handleError(_0x566bf9,_0x3ff517){_0x3ff517=_0x3ff517||0x1f4;return function(_0x4f621b){logger[_0x995a('0x27')](_0x4f621b['stack']);if(_0x4f621b['name']){delete _0x4f621b['name'];}_0x566bf9[_0x995a('0x26')](_0x3ff517)['send'](_0x4f621b);};}exports[_0x995a('0x28')]=function(_0x10c02f,_0x6e2354){var _0x484a55={},_0x1a0bfc={},_0x5f0953={'count':0x0,'rows':[]};var _0x1f0528=_[_0x995a('0x29')](db[_0x995a('0x2a')][_0x995a('0x2b')],function(_0xdcf815){return{'name':_0xdcf815[_0x995a('0x2c')],'type':_0xdcf815['type']['key']};});_0x1a0bfc[_0x995a('0x2d')]=_[_0x995a('0x29')](_0x1f0528,_0x995a('0x2e'));_0x1a0bfc[_0x995a('0x2f')]=_[_0x995a('0x30')](_0x10c02f['query']);_0x1a0bfc[_0x995a('0x31')]=_[_0x995a('0x32')](_0x1a0bfc[_0x995a('0x2d')],_0x1a0bfc[_0x995a('0x2f')]);_0x484a55[_0x995a('0x33')]=_[_0x995a('0x32')](_0x1a0bfc[_0x995a('0x2d')],qs['fields'](_0x10c02f['query'][_0x995a('0x34')]));_0x484a55[_0x995a('0x33')]=_0x484a55[_0x995a('0x33')][_0x995a('0x35')]?_0x484a55[_0x995a('0x33')]:_0x1a0bfc[_0x995a('0x2d')];if(!_0x10c02f[_0x995a('0x2f')]['hasOwnProperty'](_0x995a('0x36'))){_0x484a55[_0x995a('0x1c')]=qs[_0x995a('0x1c')](_0x10c02f[_0x995a('0x2f')][_0x995a('0x1c')]);_0x484a55[_0x995a('0x1a')]=qs['offset'](_0x10c02f[_0x995a('0x2f')][_0x995a('0x1a')]);}_0x484a55[_0x995a('0x37')]=qs[_0x995a('0x38')](_0x10c02f[_0x995a('0x2f')][_0x995a('0x38')]);_0x484a55[_0x995a('0x39')]=qs['filters'](_['pick'](_0x10c02f[_0x995a('0x2f')],_0x1a0bfc[_0x995a('0x31')]),_0x1f0528);if(_0x10c02f[_0x995a('0x2f')][_0x995a('0x3a')]){_0x484a55[_0x995a('0x39')]=_[_0x995a('0x3b')](_0x484a55[_0x995a('0x39')],{'$or':_[_0x995a('0x29')](_0x1f0528,function(_0x81918){if(_0x81918[_0x995a('0x3c')]!==_0x995a('0x3d')){var _0x54eb00={};_0x54eb00[_0x81918[_0x995a('0x2e')]]={'$like':'%'+_0x10c02f[_0x995a('0x2f')]['filter']+'%'};return _0x54eb00;}})});}_0x484a55=_[_0x995a('0x3b')]({},_0x484a55,_0x10c02f[_0x995a('0x3e')]);var _0x266233={'where':_0x484a55[_0x995a('0x39')]};return db[_0x995a('0x2a')]['count'](_0x266233)[_0x995a('0x24')](function(_0x505238){_0x5f0953['count']=_0x505238;if(_0x10c02f[_0x995a('0x2f')][_0x995a('0x3f')]){_0x484a55[_0x995a('0x40')]=[{'all':!![]}];}return db[_0x995a('0x2a')]['findAll'](_0x484a55);})['then'](function(_0x4a429e){_0x5f0953[_0x995a('0x41')]=_0x4a429e;return _0x5f0953;})[_0x995a('0x24')](respondWithFilteredResult(_0x6e2354,_0x484a55))[_0x995a('0x42')](handleError(_0x6e2354,null));};exports['show']=function(_0x168481,_0xd96bf1){var _0x3bd1ea={'raw':!![],'where':{'id':_0x168481[_0x995a('0x43')]['id']}},_0x48000b={};_0x48000b['model']=_['keys'](db[_0x995a('0x2a')][_0x995a('0x2b')]);_0x48000b['query']=_[_0x995a('0x30')](_0x168481['query']);_0x48000b[_0x995a('0x31')]=_[_0x995a('0x32')](_0x48000b[_0x995a('0x2d')],_0x48000b[_0x995a('0x2f')]);_0x3bd1ea['attributes']=_[_0x995a('0x32')](_0x48000b[_0x995a('0x2d')],qs[_0x995a('0x34')](_0x168481[_0x995a('0x2f')][_0x995a('0x34')]));_0x3bd1ea[_0x995a('0x33')]=_0x3bd1ea[_0x995a('0x33')]['length']?_0x3bd1ea[_0x995a('0x33')]:_0x48000b[_0x995a('0x2d')];if(_0x168481[_0x995a('0x2f')][_0x995a('0x3f')]){_0x3bd1ea[_0x995a('0x40')]=[{'all':!![]}];}_0x3bd1ea=_[_0x995a('0x3b')]({},_0x3bd1ea,_0x168481[_0x995a('0x3e')]);return db[_0x995a('0x2a')][_0x995a('0x44')](_0x3bd1ea)[_0x995a('0x24')](handleEntityNotFound(_0xd96bf1,null))[_0x995a('0x24')](respondWithResult(_0xd96bf1,null))['catch'](handleError(_0xd96bf1,null));};exports[_0x995a('0x45')]=function(_0xb5ef44,_0x5366a9){return db[_0x995a('0x2a')]['create'](_0xb5ef44[_0x995a('0x46')],{})[_0x995a('0x24')](respondWithResult(_0x5366a9,0xc9))['catch'](handleError(_0x5366a9,null));};exports['update']=function(_0x2b0a6b,_0xa42c68){if(_0x2b0a6b[_0x995a('0x46')]['id']){delete _0x2b0a6b[_0x995a('0x46')]['id'];}return db[_0x995a('0x2a')][_0x995a('0x44')]({'where':{'id':_0x2b0a6b['params']['id']}})[_0x995a('0x24')](handleEntityNotFound(_0xa42c68,null))['then'](saveUpdates(_0x2b0a6b['body'],null))[_0x995a('0x24')](respondWithResult(_0xa42c68,null))[_0x995a('0x42')](handleError(_0xa42c68,null));};exports[_0x995a('0x25')]=function(_0xcc34e4,_0x56090b){return db['VoiceTransferReport'][_0x995a('0x44')]({'where':{'id':_0xcc34e4[_0x995a('0x43')]['id']}})[_0x995a('0x24')](handleEntityNotFound(_0x56090b,null))[_0x995a('0x24')](removeEntity(_0x56090b,null))[_0x995a('0x42')](handleError(_0x56090b,null));};exports['describe']=function(_0x186086,_0x213fc6){return db[_0x995a('0x2a')][_0x995a('0x47')]()[_0x995a('0x24')](respondWithResult(_0x213fc6,null))[_0x995a('0x42')](handleError(_0x213fc6,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 3d7dbf5..ec743a3 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 _0xdd67=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','VoiceTransferReport','report_call_transfer'];(function(_0x3d88ad,_0x3ac338){var _0xa57f06=function(_0x12d0e4){while(--_0x12d0e4){_0x3d88ad['push'](_0x3d88ad['shift']());}};_0xa57f06(++_0x3ac338);}(_0xdd67,0x9c));var _0x7dd6=function(_0x5e9bd4,_0x5c5112){_0x5e9bd4=_0x5e9bd4-0x0;var _0x1374cd=_0xdd67[_0x5e9bd4];return _0x1374cd;};'use strict';var _=require('lodash');var util=require(_0x7dd6('0x0'));var logger=require(_0x7dd6('0x1'))(_0x7dd6('0x2'));var moment=require(_0x7dd6('0x3'));var BPromise=require(_0x7dd6('0x4'));var rp=require(_0x7dd6('0x5'));var fs=require('fs');var path=require(_0x7dd6('0x6'));var rimraf=require(_0x7dd6('0x7'));var config=require(_0x7dd6('0x8'));var attributes=require(_0x7dd6('0x9'));module[_0x7dd6('0xa')]=function(_0x4fbee6,_0x32f6e9){return _0x4fbee6['define'](_0x7dd6('0xb'),attributes,{'tableName':_0x7dd6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x51cc=['bluebird','path','rimraf','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','util','../../config/logger','api'];(function(_0x51e489,_0x308727){var _0x5de918=function(_0x47adee){while(--_0x47adee){_0x51e489['push'](_0x51e489['shift']());}};_0x5de918(++_0x308727);}(_0x51cc,0x105));var _0xc51c=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x51cc[_0x13ea00];return _0x1f7347;};'use strict';var _=require('lodash');var util=require(_0xc51c('0x0'));var logger=require(_0xc51c('0x1'))(_0xc51c('0x2'));var moment=require('moment');var BPromise=require(_0xc51c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc51c('0x4'));var rimraf=require(_0xc51c('0x5'));var config=require('../../config/environment');var attributes=require(_0xc51c('0x6'));module[_0xc51c('0x7')]=function(_0x31f1a7,_0x18f802){return _0x31f1a7[_0xc51c('0x8')](_0xc51c('0x9'),attributes,{'tableName':_0xc51c('0xa'),'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 7ae7107..23900be 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 _0x80ef=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','code','VoiceTransferReport,\x20%s,\x20%s','message','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','stringify','catch','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x57928b,_0x29a111){var _0x49aad6=function(_0x34a268){while(--_0x34a268){_0x57928b['push'](_0x57928b['shift']());}};_0x49aad6(++_0x29a111);}(_0x80ef,0x157));var _0xf80e=function(_0x3142b1,_0x3cf732){_0x3142b1=_0x3142b1-0x0;var _0x35c702=_0x80ef[_0x3142b1];return _0x35c702;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf80e('0x0'));var BPromise=require(_0xf80e('0x1'));var rs=require(_0xf80e('0x2'));var fs=require('fs');var Redis=require(_0xf80e('0x3'));var db=require(_0xf80e('0x4'))['db'];var utils=require(_0xf80e('0x5'));var logger=require(_0xf80e('0x6'))(_0xf80e('0x7'));var config=require(_0xf80e('0x8'));var jayson=require(_0xf80e('0x9'));var client=jayson[_0xf80e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c9926,_0x45bd6c,_0x2cbeef){return new BPromise(function(_0x15dbf4,_0x23adf7){return client[_0xf80e('0xb')](_0x2c9926,_0x2cbeef)[_0xf80e('0xc')](function(_0x11aff1){logger[_0xf80e('0xd')]('VoiceTransferReport,\x20%s,\x20%s',_0x45bd6c,_0xf80e('0xe'));logger[_0xf80e('0xf')](_0xf80e('0x10'),_0x45bd6c,_0xf80e('0xe'),JSON['stringify'](_0x11aff1));if(_0x11aff1['error']){if(_0x11aff1[_0xf80e('0x11')][_0xf80e('0x12')]===0x1f4){logger[_0xf80e('0x11')](_0xf80e('0x13'),_0x45bd6c,_0x11aff1[_0xf80e('0x11')][_0xf80e('0x14')]);return _0x23adf7(_0x11aff1[_0xf80e('0x11')][_0xf80e('0x14')]);}logger[_0xf80e('0x11')](_0xf80e('0x13'),_0x45bd6c,_0x11aff1['error'][_0xf80e('0x14')]);return _0x15dbf4(_0x11aff1[_0xf80e('0x11')][_0xf80e('0x14')]);}else{logger['info'](_0xf80e('0x13'),_0x45bd6c,_0xf80e('0xe'));_0x15dbf4(_0x11aff1['result'][_0xf80e('0x14')]);}})['catch'](function(_0x552c75){logger['error'](_0xf80e('0x13'),_0x45bd6c,_0x552c75);_0x23adf7(_0x552c75);});});}exports[_0xf80e('0x15')]=function(_0x1cac21){var _0x408d2a=this;return new Promise(function(_0x15f6b4,_0x3f6f43){return db[_0xf80e('0x16')][_0xf80e('0x17')](_0x1cac21[_0xf80e('0x18')],{'raw':_0x1cac21[_0xf80e('0x19')]?_0x1cac21[_0xf80e('0x19')][_0xf80e('0x1a')]===undefined?!![]:![]:!![]})[_0xf80e('0xc')](function(_0x215b8e){logger['info']('CreateVoiceTransferReport',_0x1cac21);logger['debug']('CreateVoiceTransferReport',_0x1cac21,JSON[_0xf80e('0x1b')](_0x215b8e));_0x15f6b4(_0x215b8e);})[_0xf80e('0x1c')](function(_0x255d0f){logger[_0xf80e('0x11')](_0xf80e('0x15'),_0x255d0f[_0xf80e('0x14')],_0x1cac21);_0x3f6f43(_0x408d2a[_0xf80e('0x11')](0x1f4,_0x255d0f[_0xf80e('0x14')]));});});}; \ No newline at end of file +var _0x9d21=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','debug','lodash','util','bluebird','ioredis','../../config/utils'];(function(_0x1da25a,_0x3bcbca){var _0x4108e5=function(_0x45a3da){while(--_0x45a3da){_0x1da25a['push'](_0x1da25a['shift']());}};_0x4108e5(++_0x3bcbca);}(_0x9d21,0x157));var _0x19d2=function(_0xc2d1dc,_0x56b390){_0xc2d1dc=_0xc2d1dc-0x0;var _0x4ea771=_0x9d21[_0xc2d1dc];return _0x4ea771;};'use strict';var _=require(_0x19d2('0x0'));var util=require(_0x19d2('0x1'));var moment=require('moment');var BPromise=require(_0x19d2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x19d2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x19d2('0x4'));var logger=require('../../config/logger')(_0x19d2('0x5'));var config=require(_0x19d2('0x6'));var jayson=require(_0x19d2('0x7'));var client=jayson[_0x19d2('0x8')][_0x19d2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x19b778,_0x55973f,_0x2525e1){return new BPromise(function(_0x59e6ab,_0x76a2a3){return client[_0x19d2('0xa')](_0x19b778,_0x2525e1)[_0x19d2('0xb')](function(_0x545d27){logger[_0x19d2('0xc')](_0x19d2('0xd'),_0x55973f,'request\x20sent');logger['debug'](_0x19d2('0xe'),_0x55973f,_0x19d2('0xf'),JSON[_0x19d2('0x10')](_0x545d27));if(_0x545d27[_0x19d2('0x11')]){if(_0x545d27[_0x19d2('0x11')][_0x19d2('0x12')]===0x1f4){logger[_0x19d2('0x11')](_0x19d2('0xd'),_0x55973f,_0x545d27[_0x19d2('0x11')]['message']);return _0x76a2a3(_0x545d27[_0x19d2('0x11')][_0x19d2('0x13')]);}logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x55973f,_0x545d27[_0x19d2('0x11')][_0x19d2('0x13')]);return _0x59e6ab(_0x545d27[_0x19d2('0x11')][_0x19d2('0x13')]);}else{logger[_0x19d2('0xc')]('VoiceTransferReport,\x20%s,\x20%s',_0x55973f,_0x19d2('0xf'));_0x59e6ab(_0x545d27[_0x19d2('0x14')][_0x19d2('0x13')]);}})[_0x19d2('0x15')](function(_0x5070de){logger[_0x19d2('0x11')](_0x19d2('0xd'),_0x55973f,_0x5070de);_0x76a2a3(_0x5070de);});});}exports[_0x19d2('0x16')]=function(_0x30672c){var _0x10911e=this;return new Promise(function(_0x50ffe7,_0x54dd3d){return db[_0x19d2('0x17')][_0x19d2('0x18')](_0x30672c[_0x19d2('0x19')],{'raw':_0x30672c[_0x19d2('0x1a')]?_0x30672c[_0x19d2('0x1a')][_0x19d2('0x1b')]===undefined?!![]:![]:!![]})[_0x19d2('0xb')](function(_0x17ed2e){logger['info']('CreateVoiceTransferReport',_0x30672c);logger[_0x19d2('0x1c')](_0x19d2('0x16'),_0x30672c,JSON['stringify'](_0x17ed2e));_0x50ffe7(_0x17ed2e);})['catch'](function(_0x1840b4){logger[_0x19d2('0x11')](_0x19d2('0x16'),_0x1840b4[_0x19d2('0x13')],_0x30672c);_0x54dd3d(_0x10911e[_0x19d2('0x11')](0x1f4,_0x1840b4[_0x19d2('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index d271530..4f15838 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 _0xe5b3=['transfer','Router','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','hangup','answer','hold','/unhold','unhold','/calls','calls','/transfer'];(function(_0x5b7a65,_0x21a5e6){var _0x239661=function(_0x5d640b){while(--_0x5d640b){_0x5b7a65['push'](_0x5b7a65['shift']());}};_0x239661(++_0x21a5e6);}(_0xe5b3,0x133));var _0x3e5b=function(_0x1e0acf,_0x14eae2){_0x1e0acf=_0x1e0acf-0x0;var _0x2d0df0=_0xe5b3[_0x1e0acf];return _0x2d0df0;};'use strict';var express=require('express');var router=express[_0x3e5b('0x0')]();var auth=require(_0x3e5b('0x1'));var controller=require(_0x3e5b('0x2'));router[_0x3e5b('0x3')](_0x3e5b('0x4'),auth[_0x3e5b('0x5')](),auth[_0x3e5b('0x6')](),controller[_0x3e5b('0x7')]);router[_0x3e5b('0x3')](_0x3e5b('0x8'),auth[_0x3e5b('0x5')](),auth['isWebrtcLicence'](),controller[_0x3e5b('0x9')]);router[_0x3e5b('0x3')]('/answer',auth[_0x3e5b('0x5')](),auth[_0x3e5b('0x6')](),controller[_0x3e5b('0xa')]);router[_0x3e5b('0x3')]('/hold',auth['isAuthenticated'](),auth[_0x3e5b('0x6')](),controller[_0x3e5b('0xb')]);router[_0x3e5b('0x3')](_0x3e5b('0xc'),auth[_0x3e5b('0x5')](),auth['isWebrtcLicence'](),controller[_0x3e5b('0xd')]);router['post'](_0x3e5b('0xe'),auth[_0x3e5b('0x5')](),auth[_0x3e5b('0x6')](),controller[_0x3e5b('0xf')]);router[_0x3e5b('0x3')](_0x3e5b('0x10'),auth[_0x3e5b('0x5')](),auth['isWebrtcLicence'](),controller[_0x3e5b('0x11')]);module['exports']=router; \ No newline at end of file +var _0xb821=['/unhold','unhold','/calls','calls','/transfer','Router','../../components/auth/service','/originate','originate','post','/hangup','isAuthenticated','hangup','/answer','isWebrtcLicence','answer','/hold','hold'];(function(_0xa3fa3,_0x328285){var _0x488dd4=function(_0x1c4f57){while(--_0x1c4f57){_0xa3fa3['push'](_0xa3fa3['shift']());}};_0x488dd4(++_0x328285);}(_0xb821,0xa7));var _0x1b82=function(_0x43dd9d,_0x97a30c){_0x43dd9d=_0x43dd9d-0x0;var _0x40768d=_0xb821[_0x43dd9d];return _0x40768d;};'use strict';var express=require('express');var router=express[_0x1b82('0x0')]();var auth=require(_0x1b82('0x1'));var controller=require('./webbar.controller');router['post'](_0x1b82('0x2'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0x1b82('0x3')]);router[_0x1b82('0x4')](_0x1b82('0x5'),auth[_0x1b82('0x6')](),auth['isWebrtcLicence'](),controller[_0x1b82('0x7')]);router[_0x1b82('0x4')](_0x1b82('0x8'),auth[_0x1b82('0x6')](),auth[_0x1b82('0x9')](),controller[_0x1b82('0xa')]);router[_0x1b82('0x4')](_0x1b82('0xb'),auth[_0x1b82('0x6')](),auth['isWebrtcLicence'](),controller[_0x1b82('0xc')]);router[_0x1b82('0x4')](_0x1b82('0xd'),auth[_0x1b82('0x6')](),auth[_0x1b82('0x9')](),controller[_0x1b82('0xe')]);router[_0x1b82('0x4')](_0x1b82('0xf'),auth['isAuthenticated'](),auth[_0x1b82('0x9')](),controller[_0x1b82('0x10')]);router[_0x1b82('0x4')](_0x1b82('0x11'),auth['isAuthenticated'](),auth[_0x1b82('0x9')](),controller['transfer']);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 9401291..ff81140 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 _0x00bb=['hangup\x20fired:','webbar:hangup','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','all','conference','conference\x20fired:','conference\x20executed!','transfer','transfer\x20fired:','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','util','jayson/promise','client','../../config/logger','webbarapi','redis','localhost','socket.io-emitter','validate','number','callNumber\x20is\x20required','string','userId\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','handleError:','stack','name','status','send','NotFound','request','error','code','message','result','catch','User','VoiceChannels','then','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','json','body','userId','callNumber','callbackUrl','entityFound:','format','user:%s','webbar:originate'];(function(_0x5dfeb8,_0x375a72){var _0x2a6db3=function(_0x26070c){while(--_0x26070c){_0x5dfeb8['push'](_0x5dfeb8['shift']());}};_0x2a6db3(++_0x375a72);}(_0x00bb,0x1d8));var _0xb00b=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x00bb[_0x491a7f];return _0x3d8f44;};'use strict';var path=require(_0xb00b('0x0'));var fs=require('fs');var _=require(_0xb00b('0x1'));var db=require(_0xb00b('0x2'))['db'];var config=require('../../config/environment');var util=require(_0xb00b('0x3'));var BPromise=require('bluebird');var jayson=require(_0xb00b('0x4'));var amiClient=jayson[_0xb00b('0x5')]['http']({'port':0x232a});var logger=require(_0xb00b('0x6'))(_0xb00b('0x7'));var Redis=require('ioredis');config['redis']=_['defaults'](config[_0xb00b('0x8')],{'host':_0xb00b('0x9'),'port':0x18eb});var io=require(_0xb00b('0xa'))(new Redis(config[_0xb00b('0x8')]));var Schema=require(_0xb00b('0xb'));var originateValidation=new Schema({'userId':{'type':_0xb00b('0xc'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':'string','required':[!![],_0xb00b('0xd')]},'callerId':{'type':_0xb00b('0xe')},'callbackUrl':{'type':_0xb00b('0xe')}});var hangupValidation=new Schema({'userId':{'type':_0xb00b('0xc'),'required':[!![],_0xb00b('0xf')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0xb00b('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0xb00b('0xf')]},'sessionId':{'type':_0xb00b('0xe'),'required':[!![],_0xb00b('0x10')]},'transferNumber':{'type':_0xb00b('0xe'),'required':[!![],_0xb00b('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0xb00b('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xb00b('0xe'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xb00b('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xb00b('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xb00b('0xc'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0xb00b('0xf')]}});function emit(_0x4dcd45,_0x51d136,_0x1f9c78){logger[_0xb00b('0x12')](_0x4dcd45,_0x51d136,JSON[_0xb00b('0x13')](_0x1f9c78));io['to'](_0x4dcd45)[_0xb00b('0x14')](_0x51d136,_0x1f9c78);}function handleError(_0x58d65f){return function(_0x2a7231){console['log'](_0xb00b('0x15'),_0x2a7231,_0x2a7231 instanceof RangeError);logger['error'](_0x2a7231[_0xb00b('0x16')]);if(_0x2a7231 instanceof RangeError){if(_0x2a7231['name']){delete _0x2a7231[_0xb00b('0x17')];}_0x58d65f[_0xb00b('0x18')](0x194)['send'](_0x2a7231);}else{if(_0x2a7231['name']){delete _0x2a7231[_0xb00b('0x17')];}_0x58d65f['status'](0x1f4)[_0xb00b('0x19')](_0x2a7231);}};}function checkError(){return function(_0x43da66){if(!_0x43da66){throw new RangeError(_0xb00b('0x1a'));}return _0x43da66;};}function respondWithRpcPromise(_0x3501af,_0x56c189){return new BPromise(function(_0x362ee0,_0x4df284){var _0x25a973=amiClient;return _0x25a973[_0xb00b('0x1b')](_0x3501af,_0x56c189)['then'](function(_0x231293){if(_0x231293[_0xb00b('0x1c')]){if(_0x231293['error'][_0xb00b('0x1d')]===0x1f4){return _0x4df284(_0x231293[_0xb00b('0x1c')]['message']);}return _0x362ee0(_0x231293[_0xb00b('0x1c')][_0xb00b('0x1e')]);}else{_0x362ee0(_0x231293[_0xb00b('0x1f')]);}})[_0xb00b('0x20')](function(_0x520e55){_0x4df284(_0x520e55);});});}function getAgent(_0x50be6c){return db[_0xb00b('0x21')]['findOne']({'where':{'id':_0x50be6c,'role':'agent'}})['then'](checkError());}function getAgentCheckSession(_0x16ac55,_0x73b6b0){return new BPromise(function(_0x2592cf,_0x3825af){var _0x1f14fa=respondWithRpcPromise(_0xb00b('0x22'));var _0x15d3b9=getAgent(_0x16ac55);Promise['all']([_0x1f14fa,_0x15d3b9])[_0xb00b('0x23')](function(_0x503c9c){var _0x450129=_0x503c9c[0x0];var _0x348165=_0x503c9c[0x1];var _0x5424ca=_['filter'](_0x450129[_0xb00b('0x24')],function(_0x280ed3){return _0x280ed3[_0xb00b('0x25')]==_0x348165['id']&&_0x280ed3[_0xb00b('0x26')]==_0x73b6b0;});if(_0x5424ca[_0xb00b('0x27')]==0x1){_0x2592cf(_0x348165);}else{_0x3825af(new RangeError(_0xb00b('0x28')+_0x73b6b0+_0xb00b('0x29')));}});});}exports[_0xb00b('0x2a')]=function(_0x149c1a,_0x54e247){logger[_0xb00b('0x12')](_0xb00b('0x2b'),_0x149c1a['body']);var _0x593659=originateValidation[_0xb00b('0xb')](_0x149c1a['body']);if(_0x593659[_0xb00b('0x27')]>0x0){return _0x54e247['status'](0x190)[_0xb00b('0x2c')](_0x593659);}var _0x4117f2=_0x149c1a[_0xb00b('0x2d')][_0xb00b('0x2e')];var _0x338864=_0x149c1a[_0xb00b('0x2d')][_0xb00b('0x2f')];var _0x594840=_0x149c1a['body']['callerId'];var _0x347e73=_0x149c1a[_0xb00b('0x2d')][_0xb00b('0x30')];return getAgent(_0x4117f2)[_0xb00b('0x23')](function(_0x5cfa60){logger[_0xb00b('0x12')](_0xb00b('0x31'),_0x5cfa60[_0xb00b('0x17')]);emit(util[_0xb00b('0x32')](_0xb00b('0x33'),_0x5cfa60[_0xb00b('0x17')]),_0xb00b('0x34'),{'callNumber':_0x338864,'callerId':_0x594840,'callbackUrl':_0x347e73});return _0x54e247[_0xb00b('0x18')](0xc8)['json']({'error':![],'message':'originate\x20executed!'});})[_0xb00b('0x20')](handleError(_0x54e247));};exports['hangup']=function(_0x1c8258,_0x1c5400){logger[_0xb00b('0x12')](_0xb00b('0x35'),_0x1c8258[_0xb00b('0x2d')]);var _0x142cdd=hangupValidation[_0xb00b('0xb')](_0x1c8258['body']);if(_0x142cdd[_0xb00b('0x27')]>0x0){return _0x1c5400[_0xb00b('0x18')](0x190)[_0xb00b('0x2c')](_0x142cdd);}var _0xd9c03f=_0x1c8258[_0xb00b('0x2d')][_0xb00b('0x2e')];var _0x59fb00=_0x1c8258[_0xb00b('0x2d')][_0xb00b('0x26')];return getAgent(_0xd9c03f)['then'](function(_0x17ff34){logger[_0xb00b('0x12')](_0xb00b('0x31'),_0x17ff34[_0xb00b('0x17')]);emit(util[_0xb00b('0x32')]('user:%s',_0x17ff34[_0xb00b('0x17')]),_0xb00b('0x36'),{'sessionId':_0x59fb00});return _0x1c5400[_0xb00b('0x18')](0xc8)[_0xb00b('0x2c')]({'error':![],'message':'hangup\x20executed!'});})['catch'](handleError(_0x1c5400));};exports[_0xb00b('0x37')]=function(_0xf6ae0c,_0x10a348){logger[_0xb00b('0x12')](_0xb00b('0x38'),_0xf6ae0c[_0xb00b('0x2d')]);var _0x275664=answerValidation['validate'](_0xf6ae0c[_0xb00b('0x2d')]);if(_0x275664[_0xb00b('0x27')]>0x0){return _0x10a348[_0xb00b('0x18')](0x190)[_0xb00b('0x2c')](_0x275664);}var _0x302ded=_0xf6ae0c[_0xb00b('0x2d')][_0xb00b('0x2e')];var _0x974a29=_0xf6ae0c[_0xb00b('0x2d')][_0xb00b('0x26')];return getAgent(_0x302ded)[_0xb00b('0x23')](function(_0x419113){logger['info'](_0xb00b('0x31'),_0x419113[_0xb00b('0x17')]);emit(util[_0xb00b('0x32')](_0xb00b('0x33'),_0x419113[_0xb00b('0x17')]),_0xb00b('0x39'),{'sessionId':_0x974a29});return _0x10a348[_0xb00b('0x18')](0xc8)[_0xb00b('0x2c')]({'error':![],'message':_0xb00b('0x3a')});})[_0xb00b('0x20')](handleError(_0x10a348));};exports[_0xb00b('0x3b')]=function(_0x3b3031,_0x5dbe00){logger['info']('hold\x20fired:',_0x3b3031[_0xb00b('0x2d')]);var _0x23d858=holdValidation['validate'](_0x3b3031[_0xb00b('0x2d')]);if(_0x23d858[_0xb00b('0x27')]>0x0){return _0x5dbe00[_0xb00b('0x18')](0x190)[_0xb00b('0x2c')](_0x23d858);}var _0x4b62b3=_0x3b3031['body'][_0xb00b('0x2e')];var _0x40c2fd=_0x3b3031['body']['sessionId'];return getAgent(_0x4b62b3)[_0xb00b('0x23')](function(_0x3a205d){logger['info'](_0xb00b('0x31'),_0x3a205d['name']);emit(util['format']('user:%s',_0x3a205d[_0xb00b('0x17')]),'webbar:hold',{'sessionId':_0x40c2fd});return _0x5dbe00[_0xb00b('0x18')](0xc8)[_0xb00b('0x2c')]({'error':![],'message':_0xb00b('0x3c')});})[_0xb00b('0x20')](handleError(_0x5dbe00));};exports[_0xb00b('0x3d')]=function(_0xda60ca,_0x4846c9){logger['info'](_0xb00b('0x3e'),_0xda60ca[_0xb00b('0x2d')]);var _0x559357=unholdValidation[_0xb00b('0xb')](_0xda60ca[_0xb00b('0x2d')]);if(_0x559357['length']>0x0){return _0x4846c9[_0xb00b('0x18')](0x190)[_0xb00b('0x2c')](_0x559357);}var _0x3b5d82=_0xda60ca['body']['userId'];var _0x19f907=_0xda60ca[_0xb00b('0x2d')][_0xb00b('0x26')];return getAgent(_0x3b5d82)[_0xb00b('0x23')](function(_0x489b49){logger[_0xb00b('0x12')](_0xb00b('0x31'),_0x489b49['name']);emit(util['format'](_0xb00b('0x33'),_0x489b49['name']),_0xb00b('0x3f'),{'sessionId':_0x19f907});return _0x4846c9[_0xb00b('0x18')](0xc8)[_0xb00b('0x2c')]({'error':![],'message':_0xb00b('0x40')});})[_0xb00b('0x20')](handleError(_0x4846c9));};exports[_0xb00b('0x41')]=function(_0x5a3b85,_0x5d52a5){logger['info'](_0xb00b('0x42'),_0x5d52a5[_0xb00b('0x2d')]);var _0x4129ba=callsValidation['validate'](_0x5a3b85[_0xb00b('0x2d')]);if(_0x4129ba[_0xb00b('0x27')]>0x0){return _0x5d52a5[_0xb00b('0x18')](0x190)['json'](_0x4129ba);}var _0x24e826=_0x5a3b85[_0xb00b('0x2d')][_0xb00b('0x2e')];var _0x385029=respondWithRpcPromise(_0xb00b('0x22'));var _0x279467=getAgent(_0x24e826);return Promise[_0xb00b('0x43')]([_0x385029,_0x279467])[_0xb00b('0x23')](function(_0x4c3067){var _0x153551=_0x4c3067[0x0];var _0x2cbe80=_0x4c3067[0x1];var _0x1b4860=_['filter'](_0x153551[_0xb00b('0x24')],function(_0x24a8a2){return _0x24a8a2[_0xb00b('0x25')]==_0x2cbe80['id'];});return _0x5d52a5[_0xb00b('0x18')](0xc8)[_0xb00b('0x2c')]({'count':_0x1b4860['length'],'rows':_0x1b4860});})[_0xb00b('0x20')](handleError(_0x5d52a5));};exports[_0xb00b('0x44')]=function(_0x2e3c56,_0x1cad79){logger['info'](_0xb00b('0x45'),_0x2e3c56[_0xb00b('0x2d')]);var _0x2c93db=conferenceValidation[_0xb00b('0xb')](_0x2e3c56[_0xb00b('0x2d')]);if(_0x2c93db[_0xb00b('0x27')]>0x0){return _0x1cad79[_0xb00b('0x18')](0x190)['json'](_0x2c93db);}var _0x2b090a=_0x2e3c56['body'][_0xb00b('0x2e')];return getAgent(_0x2b090a)['then'](function(_0x3b3272){logger['info'](_0xb00b('0x31'),_0x3b3272['name']);emit(util[_0xb00b('0x32')](_0xb00b('0x33'),_0x3b3272[_0xb00b('0x17')]),'webbar:conference');return _0x1cad79['status'](0xc8)['json']({'error':![],'message':_0xb00b('0x46')});})[_0xb00b('0x20')](handleError(_0x1cad79));};exports[_0xb00b('0x47')]=function(_0x49246b,_0x311f49){logger[_0xb00b('0x12')](_0xb00b('0x48'),_0x49246b[_0xb00b('0x2d')]);var _0x1f4a96=transferValidation['validate'](_0x49246b[_0xb00b('0x2d')]);if(_0x1f4a96[_0xb00b('0x27')]>0x0){return _0x311f49['status'](0x190)[_0xb00b('0x2c')](_0x1f4a96);}var _0x36ac5a=_0x49246b[_0xb00b('0x2d')]['userId'];var _0x4e8b85=_0x49246b[_0xb00b('0x2d')][_0xb00b('0x26')];var _0x23762e=_0x49246b['body']['transferNumber'];return getAgent(_0x36ac5a)['then'](function(_0x5e9677){logger[_0xb00b('0x12')]('entityFound:',_0x5e9677[_0xb00b('0x17')]);emit(util[_0xb00b('0x32')]('user:%s',_0x5e9677[_0xb00b('0x17')]),_0xb00b('0x49'),{'sessionId':_0x4e8b85,'transferNumber':_0x23762e});return _0x311f49[_0xb00b('0x18')](0xc8)[_0xb00b('0x2c')]({'error':![],'message':_0xb00b('0x4a')});})['catch'](handleError(_0x311f49));}; \ No newline at end of file +var _0xcb91=['findOne','VoiceChannels','all','rows','UserId','sessionId','sessionId\x20','originate','originate\x20fired:','body','length','json','userId','callNumber','callerId','callbackUrl','format','user:%s','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','entityFound:','hangup\x20executed!','answer','answer\x20fired:','validate','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls\x20fired:','filter','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transferNumber','webbar:transfer','../../mysqldb','../../config/environment','util','bluebird','client','http','webbarapi','ioredis','defaults','redis','socket.io-emitter','number','callNumber\x20is\x20required','string','userId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','error','stack','name','status','send','NotFound','request','then','message','result','catch','User'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x438685,_0x4ec0c0){_0x438685=_0x438685-0x0;var _0x41cca2=_0xcb91[_0x438685];return _0x41cca2;};'use strict';var path=require('path');var fs=require('fs');var _=require('lodash');var db=require(_0x1cb9('0x0'))['db'];var config=require(_0x1cb9('0x1'));var util=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0x1cb9('0x4')][_0x1cb9('0x5')]({'port':0x232a});var logger=require('../../config/logger')(_0x1cb9('0x6'));var Redis=require(_0x1cb9('0x7'));config['redis']=_[_0x1cb9('0x8')](config[_0x1cb9('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x1cb9('0xa'))(new Redis(config[_0x1cb9('0x9')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0x1cb9('0xb'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':'string','required':[!![],_0x1cb9('0xc')]},'callerId':{'type':_0x1cb9('0xd')},'callbackUrl':{'type':_0x1cb9('0xd')}});var hangupValidation=new Schema({'userId':{'type':_0x1cb9('0xb'),'required':[!![],_0x1cb9('0xe')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0x1cb9('0xb'),'required':[!![],_0x1cb9('0xe')]},'sessionId':{'type':_0x1cb9('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x1cb9('0xb'),'required':[!![],_0x1cb9('0xe')]},'sessionId':{'type':'string','required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':'string','required':[!![],_0x1cb9('0xf')]}});var holdValidation=new Schema({'userId':{'type':_0x1cb9('0xb'),'required':[!![],_0x1cb9('0xe')]},'sessionId':{'type':_0x1cb9('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x1cb9('0xe')]},'sessionId':{'type':_0x1cb9('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x1cb9('0xb'),'required':[!![],_0x1cb9('0xe')]}});var conferenceValidation=new Schema({'userId':{'type':_0x1cb9('0xb'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x5572cb,_0xd446a3,_0x3cc765){logger[_0x1cb9('0x10')](_0x5572cb,_0xd446a3,JSON[_0x1cb9('0x11')](_0x3cc765));io['to'](_0x5572cb)[_0x1cb9('0x12')](_0xd446a3,_0x3cc765);}function handleError(_0xf22920){return function(_0x23d3a9){console['log']('handleError:',_0x23d3a9,_0x23d3a9 instanceof RangeError);logger[_0x1cb9('0x13')](_0x23d3a9[_0x1cb9('0x14')]);if(_0x23d3a9 instanceof RangeError){if(_0x23d3a9[_0x1cb9('0x15')]){delete _0x23d3a9[_0x1cb9('0x15')];}_0xf22920[_0x1cb9('0x16')](0x194)[_0x1cb9('0x17')](_0x23d3a9);}else{if(_0x23d3a9[_0x1cb9('0x15')]){delete _0x23d3a9['name'];}_0xf22920['status'](0x1f4)[_0x1cb9('0x17')](_0x23d3a9);}};}function checkError(){return function(_0x5dbfae){if(!_0x5dbfae){throw new RangeError(_0x1cb9('0x18'));}return _0x5dbfae;};}function respondWithRpcPromise(_0x2265ea,_0x523b26){return new BPromise(function(_0x599275,_0x2e3854){var _0x325637=amiClient;return _0x325637[_0x1cb9('0x19')](_0x2265ea,_0x523b26)[_0x1cb9('0x1a')](function(_0x45b8d3){if(_0x45b8d3[_0x1cb9('0x13')]){if(_0x45b8d3['error']['code']===0x1f4){return _0x2e3854(_0x45b8d3[_0x1cb9('0x13')]['message']);}return _0x599275(_0x45b8d3[_0x1cb9('0x13')][_0x1cb9('0x1b')]);}else{_0x599275(_0x45b8d3[_0x1cb9('0x1c')]);}})[_0x1cb9('0x1d')](function(_0x43a100){_0x2e3854(_0x43a100);});});}function getAgent(_0x53f9fa){return db[_0x1cb9('0x1e')][_0x1cb9('0x1f')]({'where':{'id':_0x53f9fa,'role':'agent'}})[_0x1cb9('0x1a')](checkError());}function getAgentCheckSession(_0x21effa,_0x41a9a0){return new BPromise(function(_0x1804fd,_0x406821){var _0x21d6f5=respondWithRpcPromise(_0x1cb9('0x20'));var _0xb644b3=getAgent(_0x21effa);Promise[_0x1cb9('0x21')]([_0x21d6f5,_0xb644b3])[_0x1cb9('0x1a')](function(_0x48888d){var _0x405a2f=_0x48888d[0x0];var _0x536635=_0x48888d[0x1];var _0x110282=_['filter'](_0x405a2f[_0x1cb9('0x22')],function(_0x41011c){return _0x41011c[_0x1cb9('0x23')]==_0x536635['id']&&_0x41011c[_0x1cb9('0x24')]==_0x41a9a0;});if(_0x110282['length']==0x1){_0x1804fd(_0x536635);}else{_0x406821(new RangeError(_0x1cb9('0x25')+_0x41a9a0+'\x20not\x20found!'));}});});}exports[_0x1cb9('0x26')]=function(_0x336a98,_0x4220d7){logger['info'](_0x1cb9('0x27'),_0x336a98['body']);var _0x3a3543=originateValidation['validate'](_0x336a98[_0x1cb9('0x28')]);if(_0x3a3543[_0x1cb9('0x29')]>0x0){return _0x4220d7[_0x1cb9('0x16')](0x190)[_0x1cb9('0x2a')](_0x3a3543);}var _0x56c3e0=_0x336a98[_0x1cb9('0x28')][_0x1cb9('0x2b')];var _0x3467d5=_0x336a98[_0x1cb9('0x28')][_0x1cb9('0x2c')];var _0x2794fa=_0x336a98[_0x1cb9('0x28')][_0x1cb9('0x2d')];var _0x386e8b=_0x336a98[_0x1cb9('0x28')][_0x1cb9('0x2e')];return getAgent(_0x56c3e0)[_0x1cb9('0x1a')](function(_0x29f149){logger['info']('entityFound:',_0x29f149[_0x1cb9('0x15')]);emit(util[_0x1cb9('0x2f')](_0x1cb9('0x30'),_0x29f149[_0x1cb9('0x15')]),_0x1cb9('0x31'),{'callNumber':_0x3467d5,'callerId':_0x2794fa,'callbackUrl':_0x386e8b});return _0x4220d7[_0x1cb9('0x16')](0xc8)[_0x1cb9('0x2a')]({'error':![],'message':_0x1cb9('0x32')});})['catch'](handleError(_0x4220d7));};exports[_0x1cb9('0x33')]=function(_0x1482c4,_0xefe136){logger['info'](_0x1cb9('0x34'),_0x1482c4['body']);var _0x313e34=hangupValidation['validate'](_0x1482c4[_0x1cb9('0x28')]);if(_0x313e34[_0x1cb9('0x29')]>0x0){return _0xefe136[_0x1cb9('0x16')](0x190)[_0x1cb9('0x2a')](_0x313e34);}var _0x34ada2=_0x1482c4[_0x1cb9('0x28')][_0x1cb9('0x2b')];var _0x4a4788=_0x1482c4['body'][_0x1cb9('0x24')];return getAgent(_0x34ada2)[_0x1cb9('0x1a')](function(_0x7a0d8b){logger[_0x1cb9('0x10')](_0x1cb9('0x35'),_0x7a0d8b[_0x1cb9('0x15')]);emit(util[_0x1cb9('0x2f')]('user:%s',_0x7a0d8b[_0x1cb9('0x15')]),'webbar:hangup',{'sessionId':_0x4a4788});return _0xefe136['status'](0xc8)['json']({'error':![],'message':_0x1cb9('0x36')});})[_0x1cb9('0x1d')](handleError(_0xefe136));};exports[_0x1cb9('0x37')]=function(_0x2e3cf3,_0x2817e9){logger['info'](_0x1cb9('0x38'),_0x2e3cf3['body']);var _0x91121=answerValidation[_0x1cb9('0x39')](_0x2e3cf3[_0x1cb9('0x28')]);if(_0x91121['length']>0x0){return _0x2817e9[_0x1cb9('0x16')](0x190)['json'](_0x91121);}var _0xda1a44=_0x2e3cf3[_0x1cb9('0x28')]['userId'];var _0x5839aa=_0x2e3cf3[_0x1cb9('0x28')][_0x1cb9('0x24')];return getAgent(_0xda1a44)[_0x1cb9('0x1a')](function(_0x162712){logger[_0x1cb9('0x10')]('entityFound:',_0x162712[_0x1cb9('0x15')]);emit(util['format']('user:%s',_0x162712['name']),_0x1cb9('0x3a'),{'sessionId':_0x5839aa});return _0x2817e9[_0x1cb9('0x16')](0xc8)[_0x1cb9('0x2a')]({'error':![],'message':_0x1cb9('0x3b')});})[_0x1cb9('0x1d')](handleError(_0x2817e9));};exports[_0x1cb9('0x3c')]=function(_0x40ca68,_0x409b89){logger[_0x1cb9('0x10')](_0x1cb9('0x3d'),_0x40ca68[_0x1cb9('0x28')]);var _0x4ce899=holdValidation[_0x1cb9('0x39')](_0x40ca68[_0x1cb9('0x28')]);if(_0x4ce899[_0x1cb9('0x29')]>0x0){return _0x409b89['status'](0x190)[_0x1cb9('0x2a')](_0x4ce899);}var _0x57251=_0x40ca68[_0x1cb9('0x28')][_0x1cb9('0x2b')];var _0x4599a4=_0x40ca68['body'][_0x1cb9('0x24')];return getAgent(_0x57251)['then'](function(_0x2eaa11){logger['info'](_0x1cb9('0x35'),_0x2eaa11[_0x1cb9('0x15')]);emit(util[_0x1cb9('0x2f')](_0x1cb9('0x30'),_0x2eaa11['name']),_0x1cb9('0x3e'),{'sessionId':_0x4599a4});return _0x409b89[_0x1cb9('0x16')](0xc8)[_0x1cb9('0x2a')]({'error':![],'message':_0x1cb9('0x3f')});})[_0x1cb9('0x1d')](handleError(_0x409b89));};exports[_0x1cb9('0x40')]=function(_0x17b92a,_0x3b6a92){logger[_0x1cb9('0x10')](_0x1cb9('0x41'),_0x17b92a['body']);var _0x5092a6=unholdValidation[_0x1cb9('0x39')](_0x17b92a[_0x1cb9('0x28')]);if(_0x5092a6[_0x1cb9('0x29')]>0x0){return _0x3b6a92[_0x1cb9('0x16')](0x190)[_0x1cb9('0x2a')](_0x5092a6);}var _0x2d076b=_0x17b92a[_0x1cb9('0x28')][_0x1cb9('0x2b')];var _0x36c53a=_0x17b92a[_0x1cb9('0x28')]['sessionId'];return getAgent(_0x2d076b)[_0x1cb9('0x1a')](function(_0x5e773d){logger[_0x1cb9('0x10')]('entityFound:',_0x5e773d[_0x1cb9('0x15')]);emit(util['format']('user:%s',_0x5e773d[_0x1cb9('0x15')]),_0x1cb9('0x42'),{'sessionId':_0x36c53a});return _0x3b6a92[_0x1cb9('0x16')](0xc8)['json']({'error':![],'message':_0x1cb9('0x43')});})[_0x1cb9('0x1d')](handleError(_0x3b6a92));};exports['calls']=function(_0x571b33,_0x398d9d){logger[_0x1cb9('0x10')](_0x1cb9('0x44'),_0x398d9d[_0x1cb9('0x28')]);var _0x3de325=callsValidation[_0x1cb9('0x39')](_0x571b33[_0x1cb9('0x28')]);if(_0x3de325['length']>0x0){return _0x398d9d[_0x1cb9('0x16')](0x190)[_0x1cb9('0x2a')](_0x3de325);}var _0x108551=_0x571b33['body'][_0x1cb9('0x2b')];var _0x9893a3=respondWithRpcPromise(_0x1cb9('0x20'));var _0xf6eb2d=getAgent(_0x108551);return Promise[_0x1cb9('0x21')]([_0x9893a3,_0xf6eb2d])[_0x1cb9('0x1a')](function(_0x5ae762){var _0x37ceb5=_0x5ae762[0x0];var _0x36c40d=_0x5ae762[0x1];var _0x41e81f=_[_0x1cb9('0x45')](_0x37ceb5[_0x1cb9('0x22')],function(_0x274c90){return _0x274c90[_0x1cb9('0x23')]==_0x36c40d['id'];});return _0x398d9d[_0x1cb9('0x16')](0xc8)[_0x1cb9('0x2a')]({'count':_0x41e81f[_0x1cb9('0x29')],'rows':_0x41e81f});})[_0x1cb9('0x1d')](handleError(_0x398d9d));};exports['conference']=function(_0xfc39e1,_0xb4c211){logger[_0x1cb9('0x10')](_0x1cb9('0x46'),_0xfc39e1['body']);var _0x4a9cf8=conferenceValidation[_0x1cb9('0x39')](_0xfc39e1[_0x1cb9('0x28')]);if(_0x4a9cf8[_0x1cb9('0x29')]>0x0){return _0xb4c211[_0x1cb9('0x16')](0x190)[_0x1cb9('0x2a')](_0x4a9cf8);}var _0x75c734=_0xfc39e1[_0x1cb9('0x28')][_0x1cb9('0x2b')];return getAgent(_0x75c734)['then'](function(_0x49f74c){logger[_0x1cb9('0x10')]('entityFound:',_0x49f74c['name']);emit(util['format']('user:%s',_0x49f74c['name']),_0x1cb9('0x47'));return _0xb4c211[_0x1cb9('0x16')](0xc8)[_0x1cb9('0x2a')]({'error':![],'message':_0x1cb9('0x48')});})[_0x1cb9('0x1d')](handleError(_0xb4c211));};exports[_0x1cb9('0x49')]=function(_0x54f008,_0x27d7ef){logger[_0x1cb9('0x10')]('transfer\x20fired:',_0x54f008['body']);var _0x150441=transferValidation[_0x1cb9('0x39')](_0x54f008[_0x1cb9('0x28')]);if(_0x150441[_0x1cb9('0x29')]>0x0){return _0x27d7ef[_0x1cb9('0x16')](0x190)['json'](_0x150441);}var _0x538ff0=_0x54f008['body'][_0x1cb9('0x2b')];var _0x2fd5a0=_0x54f008[_0x1cb9('0x28')][_0x1cb9('0x24')];var _0x349f33=_0x54f008['body'][_0x1cb9('0x4a')];return getAgent(_0x538ff0)[_0x1cb9('0x1a')](function(_0x5c65cd){logger['info'](_0x1cb9('0x35'),_0x5c65cd['name']);emit(util[_0x1cb9('0x2f')](_0x1cb9('0x30'),_0x5c65cd[_0x1cb9('0x15')]),_0x1cb9('0x4b'),{'sessionId':_0x2fd5a0,'transferNumber':_0x349f33});return _0x27d7ef[_0x1cb9('0x16')](0xc8)[_0x1cb9('0x2a')]({'error':![],'message':'transfer\x20executed!'});})[_0x1cb9('0x1d')](handleError(_0x27d7ef));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 4c00585..60322c8 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 _0xb993=['getApplications','post','create','/:id/dispositions','addDisposition','addAnswer','notify','/:id/send','send','/:id','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','express','Router','../../components/interaction/service','./whatsappAccount.controller','get','isAuthenticated','show','getDispositions','/:id/canned_answers','/:id/users','getAgents','/:id/applications'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xb993,0x8c));var _0x3b99=function(_0x204bdc,_0x2bee50){_0x204bdc=_0x204bdc-0x0;var _0x24bf1=_0xb993[_0x204bdc];return _0x24bf1;};'use strict';var multer=require(_0x3b99('0x0'));var util=require(_0x3b99('0x1'));var path=require(_0x3b99('0x2'));var timeout=require('connect-timeout');var express=require(_0x3b99('0x3'));var router=express[_0x3b99('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3b99('0x5'));var config=require('../../config/environment');var controller=require(_0x3b99('0x6'));router[_0x3b99('0x7')]('/',auth[_0x3b99('0x8')](),controller['index']);router[_0x3b99('0x7')]('/describe',auth[_0x3b99('0x8')](),controller['describe']);router[_0x3b99('0x7')]('/:id',auth[_0x3b99('0x8')](),controller[_0x3b99('0x9')]);router[_0x3b99('0x7')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x3b99('0xa')]);router['get'](_0x3b99('0xb'),auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x3b99('0xc'),auth['isAuthenticated'](),controller[_0x3b99('0xd')]);router[_0x3b99('0x7')](_0x3b99('0xe'),auth[_0x3b99('0x8')](),controller[_0x3b99('0xf')]);router[_0x3b99('0x10')]('/',auth[_0x3b99('0x8')](),controller[_0x3b99('0x11')]);router['post'](_0x3b99('0x12'),auth['isAuthenticated'](),controller[_0x3b99('0x13')]);router['post']('/:id/canned_answers',auth[_0x3b99('0x8')](),controller[_0x3b99('0x14')]);router[_0x3b99('0x10')](_0x3b99('0xc'),auth[_0x3b99('0x8')](),controller['addAgents']);router[_0x3b99('0x10')](_0x3b99('0xe'),auth['isAuthenticated'](),controller['addApplications']);router[_0x3b99('0x10')]('/:id/notify',controller[_0x3b99('0x15')]);router[_0x3b99('0x10')](_0x3b99('0x16'),auth['isAuthenticated'](),controller[_0x3b99('0x17')]);router['put'](_0x3b99('0x18'),auth[_0x3b99('0x8')](),controller[_0x3b99('0x19')]);router[_0x3b99('0x1a')](_0x3b99('0x18'),auth['isAuthenticated'](),controller['destroy']);router[_0x3b99('0x1a')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x3b99('0x1b')]);router[_0x3b99('0x1a')](_0x3b99('0xb'),auth[_0x3b99('0x8')](),controller[_0x3b99('0x1c')]);router[_0x3b99('0x1a')]('/:id/users',auth[_0x3b99('0x8')](),controller[_0x3b99('0x1d')]);module[_0x3b99('0x1e')]=router; \ No newline at end of file +var _0xdec1=['post','addAnswer','addApplications','/:id/notify','notify','/:id/send','send','put','update','destroy','delete','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications'];(function(_0x5bb257,_0x2ac141){var _0x1c3de2=function(_0x45882d){while(--_0x45882d){_0x5bb257['push'](_0x5bb257['shift']());}};_0x1c3de2(++_0x2ac141);}(_0xdec1,0x14e));var _0x1dec=function(_0x393f24,_0x8bdca9){_0x393f24=_0x393f24-0x0;var _0x53d17b=_0xdec1[_0x393f24];return _0x53d17b;};'use strict';var multer=require(_0x1dec('0x0'));var util=require(_0x1dec('0x1'));var path=require(_0x1dec('0x2'));var timeout=require(_0x1dec('0x3'));var express=require(_0x1dec('0x4'));var router=express[_0x1dec('0x5')]();var fs_extra=require(_0x1dec('0x6'));var auth=require(_0x1dec('0x7'));var interaction=require(_0x1dec('0x8'));var config=require(_0x1dec('0x9'));var controller=require(_0x1dec('0xa'));router[_0x1dec('0xb')]('/',auth[_0x1dec('0xc')](),controller[_0x1dec('0xd')]);router['get'](_0x1dec('0xe'),auth['isAuthenticated'](),controller[_0x1dec('0xf')]);router[_0x1dec('0xb')](_0x1dec('0x10'),auth[_0x1dec('0xc')](),controller[_0x1dec('0x11')]);router['get'](_0x1dec('0x12'),auth[_0x1dec('0xc')](),controller[_0x1dec('0x13')]);router[_0x1dec('0xb')](_0x1dec('0x14'),auth[_0x1dec('0xc')](),controller[_0x1dec('0x15')]);router[_0x1dec('0xb')](_0x1dec('0x16'),auth[_0x1dec('0xc')](),controller[_0x1dec('0x17')]);router['get'](_0x1dec('0x18'),auth[_0x1dec('0xc')](),controller[_0x1dec('0x19')]);router['post']('/',auth[_0x1dec('0xc')](),controller['create']);router[_0x1dec('0x1a')](_0x1dec('0x12'),auth[_0x1dec('0xc')](),controller['addDisposition']);router[_0x1dec('0x1a')](_0x1dec('0x14'),auth[_0x1dec('0xc')](),controller[_0x1dec('0x1b')]);router[_0x1dec('0x1a')]('/:id/users',auth[_0x1dec('0xc')](),controller['addAgents']);router[_0x1dec('0x1a')]('/:id/applications',auth[_0x1dec('0xc')](),controller[_0x1dec('0x1c')]);router['post'](_0x1dec('0x1d'),controller[_0x1dec('0x1e')]);router[_0x1dec('0x1a')](_0x1dec('0x1f'),auth[_0x1dec('0xc')](),controller[_0x1dec('0x20')]);router[_0x1dec('0x21')](_0x1dec('0x10'),auth[_0x1dec('0xc')](),controller[_0x1dec('0x22')]);router['delete'](_0x1dec('0x10'),auth['isAuthenticated'](),controller[_0x1dec('0x23')]);router[_0x1dec('0x24')](_0x1dec('0x12'),auth[_0x1dec('0xc')](),controller['removeDispositions']);router['delete'](_0x1dec('0x14'),auth['isAuthenticated'](),controller[_0x1dec('0x25')]);router['delete'](_0x1dec('0x16'),auth['isAuthenticated'](),controller[_0x1dec('0x26')]);module[_0x1dec('0x27')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 73f0ec6..173ca52 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 _0x4b24=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','ENUM','twilio','sinch','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x4af925,_0x412f25){var _0xa7b75d=function(_0x1cd600){while(--_0x1cd600){_0x4af925['push'](_0x4af925['shift']());}};_0xa7b75d(++_0x412f25);}(_0x4b24,0xa3));var _0x44b2=function(_0x38ea3c,_0x2f0c72){_0x38ea3c=_0x38ea3c-0x0;var _0x573582=_0x4b24[_0x38ea3c];return _0x573582;};'use strict';var Sequelize=require(_0x44b2('0x0'));var rs=require(_0x44b2('0x1'));module[_0x44b2('0x2')]={'name':{'type':Sequelize[_0x44b2('0x3')],'unique':_0x44b2('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x44b2('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x44b2('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x44b2('0x3')],'defaultValue':function(){return rs[_0x44b2('0x5')]();}},'phone':{'type':Sequelize[_0x44b2('0x3')]},'type':{'type':Sequelize[_0x44b2('0x6')](_0x44b2('0x7'),_0x44b2('0x8'))},'accountSid':{'type':Sequelize[_0x44b2('0x3')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x44b2('0x3')]},'notificationTemplate':{'type':Sequelize[_0x44b2('0x9')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x44b2('0xa')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x44b2('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x44b2('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x44b2('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x44b2('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x44b2('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x44b2('0xb')],'comment':_0x44b2('0xc')},'mandatoryDisposition':{'type':Sequelize[_0x44b2('0xa')],'defaultValue':![],'comment':_0x44b2('0xd'),'set':function(_0x3402e6){if(!_0x3402e6){this[_0x44b2('0xe')]('mandatoryDispositionPauseId',null);}this['setDataValue'](_0x44b2('0xf'),_0x3402e6);}},'description':{'type':Sequelize[_0x44b2('0x3')]}}; \ No newline at end of file +var _0x7c22=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','STRING','name','ENUM','sinch','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER'];(function(_0x4852e2,_0x1bc3f3){var _0x217e7a=function(_0x48c467){while(--_0x48c467){_0x4852e2['push'](_0x4852e2['shift']());}};_0x217e7a(++_0x1bc3f3);}(_0x7c22,0x6c));var _0x27c2=function(_0x408702,_0xd7f79){_0x408702=_0x408702-0x0;var _0x51b812=_0x7c22[_0x408702];return _0x51b812;};'use strict';var Sequelize=require(_0x27c2('0x0'));var rs=require(_0x27c2('0x1'));module['exports']={'name':{'type':Sequelize[_0x27c2('0x2')],'unique':_0x27c2('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x27c2('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x27c2('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x27c2('0x4')]('twilio',_0x27c2('0x5'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize[_0x27c2('0x2')]},'authToken':{'type':Sequelize[_0x27c2('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x27c2('0x6');}},'notificationSound':{'type':Sequelize[_0x27c2('0x7')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x27c2('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x27c2('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x27c2('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x27c2('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x27c2('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x27c2('0x8')],'comment':_0x27c2('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x27c2('0xa'),'set':function(_0x14ff58){if(!_0x14ff58){this[_0x27c2('0xb')]('mandatoryDispositionPauseId',null);}this['setDataValue'](_0x27c2('0xc'),_0x14ff58);}},'description':{'type':Sequelize[_0x27c2('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 0fe065a..c7d89a5 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 _0xa184=['User','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','priority','finally','getApplications','notify','whatsapp','Applications','account','statuses','state','read','WhatsappMessage','timestamp','applications','orderBy','asc','CmContact','Sequelize','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','from','whatsapp:','messageId','sinch','notifications','message_id','isNil','from\x20is\x20mandatory','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','contact','WhatsappInteraction','interaction','created','autoclose','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','queueId','WhatsappQueue','queue','waitForTheAssignedQueue','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','\x0a','to\x20is\x20mandatory','List','Messages','dataValues','push','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','jayson/promise','client','http','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','limit','count','set','reject','save','update','destroy','get','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','params','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','WhatsappAccounts','UserProfileSection','userProfileId','autoAssociation','find','describe','WhatsappAccountId','getDispositions','findOne','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','hasOwnProperty','removeAnswers','addAgents','omit','spread','userWhatsappAccount:save','isArray','emit','userWhatsappAccount:remove','getAgents'];(function(_0x46c7ff,_0xaa3094){var _0x56783c=function(_0x346023){while(--_0x346023){_0x46c7ff['push'](_0x46c7ff['shift']());}};_0x56783c(++_0xaa3094);}(_0xa184,0x110));var _0x4a18=function(_0x2a0738,_0x3c0bc5){_0x2a0738=_0x2a0738-0x0;var _0x159679=_0xa184[_0x2a0738];return _0x159679;};'use strict';var emlformat=require(_0x4a18('0x0'));var rimraf=require(_0x4a18('0x1'));var zipdir=require(_0x4a18('0x2'));var jsonpatch=require(_0x4a18('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4a18('0x4'));var Mustache=require(_0x4a18('0x5'));var util=require('util');var path=require(_0x4a18('0x6'));var sox=require(_0x4a18('0x7'));var csv=require('to-csv');var ejs=require(_0x4a18('0x8'));var fs=require('fs');var fs_extra=require(_0x4a18('0x9'));var _=require(_0x4a18('0xa'));var squel=require('squel');var crypto=require(_0x4a18('0xb'));var jsforce=require(_0x4a18('0xc'));var deskjs=require(_0x4a18('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4a18('0xe'));var Papa=require(_0x4a18('0xf'));var Redis=require(_0x4a18('0x10'));var authService=require(_0x4a18('0x11'));var qs=require(_0x4a18('0x12'));var as=require(_0x4a18('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4a18('0x14'))(_0x4a18('0x15'));var utils=require(_0x4a18('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x4a18('0x17'));var db=require(_0x4a18('0x18'))['db'];config[_0x4a18('0x19')]=_[_0x4a18('0x1a')](config[_0x4a18('0x19')],{'host':_0x4a18('0x1b'),'port':0x18eb});var socket=require(_0x4a18('0x1c'))(new Redis(config[_0x4a18('0x19')]));require(_0x4a18('0x1d'))['register'](socket);var jayson=require(_0x4a18('0x1e'));var client=jayson[_0x4a18('0x1f')][_0x4a18('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x44206e,_0x17b687,_0x57e44d,_0x34c423){return new BPromise(function(_0x5c7e4b,_0x5bec0f){var _0x5f1588=_0x34c423||client;return _0x5f1588['request'](_0x44206e,_0x57e44d)[_0x4a18('0x21')](function(_0x2b6822){logger[_0x4a18('0x22')](_0x4a18('0x23'),_0x17b687,_0x4a18('0x24'));logger[_0x4a18('0x25')](_0x4a18('0x26'),_0x17b687,'request\x20sent',JSON[_0x4a18('0x27')](_0x2b6822));if(_0x2b6822[_0x4a18('0x28')]){if(_0x2b6822['error'][_0x4a18('0x29')]===0x1f4){logger[_0x4a18('0x28')](_0x4a18('0x23'),_0x17b687,_0x2b6822[_0x4a18('0x28')][_0x4a18('0x2a')]);return _0x5bec0f(_0x2b6822[_0x4a18('0x28')][_0x4a18('0x2a')]);}logger[_0x4a18('0x28')](_0x4a18('0x23'),_0x17b687,_0x2b6822[_0x4a18('0x28')]['message']);return _0x5c7e4b(_0x2b6822['error'][_0x4a18('0x2a')]);}else{logger[_0x4a18('0x22')](_0x4a18('0x23'),_0x17b687,'request\x20sent');_0x5c7e4b(_0x2b6822[_0x4a18('0x2b')][_0x4a18('0x2a')]);}})['catch'](function(_0x230104){logger['error'](_0x4a18('0x23'),_0x17b687,_0x230104);_0x5bec0f(_0x230104);});});}function respondWithStatusCode(_0x5b1c79,_0x28bbee){_0x28bbee=_0x28bbee||0xcc;return function(_0x68d636){if(_0x68d636){return _0x5b1c79[_0x4a18('0x2c')](_0x28bbee);}return _0x5b1c79[_0x4a18('0x2d')](_0x28bbee)[_0x4a18('0x2e')]();};}function respondWithResult(_0x4d76ca,_0x200f66){_0x200f66=_0x200f66||0xc8;return function(_0x2ebf51){if(_0x2ebf51){return _0x4d76ca[_0x4a18('0x2d')](_0x200f66)[_0x4a18('0x2f')](_0x2ebf51);}};}function respondWithFilteredResult(_0x3eab01,_0x275c1a){return function(_0x59fd98){if(_0x59fd98){var _0x4df062=typeof _0x275c1a[_0x4a18('0x30')]==='undefined'&&typeof _0x275c1a[_0x4a18('0x31')]==='undefined';var _0x395309=_0x59fd98[_0x4a18('0x32')];var _0x5dbbde=_0x4df062?0x0:_0x275c1a[_0x4a18('0x30')];var _0x3197b4=_0x4df062?_0x59fd98[_0x4a18('0x32')]:_0x275c1a[_0x4a18('0x30')]+_0x275c1a['limit'];var _0x50a38d;if(_0x3197b4>=_0x395309){_0x3197b4=_0x395309;_0x50a38d=0xc8;}else{_0x50a38d=0xce;}_0x3eab01[_0x4a18('0x2d')](_0x50a38d);return _0x3eab01[_0x4a18('0x33')]('Content-Range',_0x5dbbde+'-'+_0x3197b4+'/'+_0x395309)['json'](_0x59fd98);}return null;};}function patchUpdates(_0x28f367){return function(_0x477467){try{jsonpatch['apply'](_0x477467,_0x28f367,!![]);}catch(_0x118609){return BPromise[_0x4a18('0x34')](_0x118609);}return _0x477467[_0x4a18('0x35')]();};}function saveUpdates(_0x4919f2,_0x57fc2e){return function(_0x4d7e1f){if(_0x4d7e1f){return _0x4d7e1f[_0x4a18('0x36')](_0x4919f2)[_0x4a18('0x21')](function(_0x1aa8f5){return _0x1aa8f5;});}return null;};}function removeEntity(_0x370cc9,_0x31dcda){return function(_0x46b73d){if(_0x46b73d){return _0x46b73d[_0x4a18('0x37')]()['then'](function(){var _0x4e115b=_0x46b73d[_0x4a18('0x38')]({'plain':!![]});var _0x2b4117='WhatsappAccounts';return db[_0x4a18('0x39')][_0x4a18('0x37')]({'where':{'type':_0x2b4117,'resourceId':_0x4e115b['id']}})[_0x4a18('0x21')](function(){return _0x46b73d;});})[_0x4a18('0x21')](function(){_0x370cc9[_0x4a18('0x2d')](0xcc)[_0x4a18('0x2e')]();});}};}function handleEntityNotFound(_0x549734,_0x4be933){return function(_0x34c643){if(!_0x34c643){_0x549734[_0x4a18('0x2c')](0x194);}return _0x34c643;};}function handleError(_0x5a7de7,_0x21322c){_0x21322c=_0x21322c||0x1f4;return function(_0x47e8ab){logger['error'](_0x47e8ab[_0x4a18('0x3a')]);if(_0x47e8ab[_0x4a18('0x3b')]){delete _0x47e8ab[_0x4a18('0x3b')];}_0x5a7de7[_0x4a18('0x2d')](_0x21322c)[_0x4a18('0x3c')](_0x47e8ab);};}exports[_0x4a18('0x3d')]=function(_0x591e9c,_0x5b9e50){var _0x58dd2d={'include':[{'model':db[_0x4a18('0x3e')],'as':_0x4a18('0x3f')}]},_0x4907e0={},_0x4934e2={'count':0x0,'rows':[]};var _0x1ac90b=_[_0x4a18('0x40')](db[_0x4a18('0x41')][_0x4a18('0x42')],function(_0x48532c){return{'name':_0x48532c[_0x4a18('0x43')],'type':_0x48532c[_0x4a18('0x44')][_0x4a18('0x45')]};});_0x4907e0[_0x4a18('0x46')]=_[_0x4a18('0x40')](_0x1ac90b,_0x4a18('0x3b'));_0x4907e0[_0x4a18('0x47')]=_[_0x4a18('0x48')](_0x591e9c[_0x4a18('0x47')]);_0x4907e0['filters']=_[_0x4a18('0x49')](_0x4907e0['model'],_0x4907e0[_0x4a18('0x47')]);_0x58dd2d[_0x4a18('0x4a')]=_[_0x4a18('0x49')](_0x4907e0[_0x4a18('0x46')],qs[_0x4a18('0x4b')](_0x591e9c[_0x4a18('0x47')]['fields']));_0x58dd2d[_0x4a18('0x4a')]=_0x58dd2d[_0x4a18('0x4a')][_0x4a18('0x4c')]?_0x58dd2d[_0x4a18('0x4a')]:_0x4907e0[_0x4a18('0x46')];if(!_0x591e9c[_0x4a18('0x47')]['hasOwnProperty'](_0x4a18('0x4d'))){_0x58dd2d[_0x4a18('0x31')]=qs[_0x4a18('0x31')](_0x591e9c[_0x4a18('0x47')][_0x4a18('0x31')]);_0x58dd2d[_0x4a18('0x30')]=qs[_0x4a18('0x30')](_0x591e9c['query'][_0x4a18('0x30')]);}_0x58dd2d[_0x4a18('0x4e')]=qs[_0x4a18('0x4f')](_0x591e9c['query']['sort']);_0x58dd2d[_0x4a18('0x50')]=qs[_0x4a18('0x51')](_[_0x4a18('0x52')](_0x591e9c[_0x4a18('0x47')],_0x4907e0[_0x4a18('0x51')]),_0x1ac90b);if(_0x591e9c[_0x4a18('0x47')][_0x4a18('0x53')]){_0x58dd2d[_0x4a18('0x50')]=_['merge'](_0x58dd2d[_0x4a18('0x50')],{'$or':_[_0x4a18('0x40')](_0x1ac90b,function(_0x54872f){if(_0x54872f['type']!=='VIRTUAL'){var _0x4e9f68={};_0x4e9f68[_0x54872f[_0x4a18('0x3b')]]={'$like':'%'+_0x591e9c[_0x4a18('0x47')][_0x4a18('0x53')]+'%'};return _0x4e9f68;}})});}_0x58dd2d=_[_0x4a18('0x54')]({},_0x58dd2d,_0x591e9c[_0x4a18('0x55')]);var _0x37013c={'where':_0x58dd2d['where']};return db[_0x4a18('0x41')][_0x4a18('0x32')](_0x37013c)[_0x4a18('0x21')](function(_0x47ed26){_0x4934e2[_0x4a18('0x32')]=_0x47ed26;if(_0x591e9c[_0x4a18('0x47')][_0x4a18('0x56')]){_0x58dd2d[_0x4a18('0x57')]=[{'all':!![]}];}return db[_0x4a18('0x41')][_0x4a18('0x58')](_0x58dd2d);})[_0x4a18('0x21')](function(_0x1ef4d7){_0x4934e2[_0x4a18('0x59')]=_0x1ef4d7;return _0x4934e2;})['then'](respondWithFilteredResult(_0x5b9e50,_0x58dd2d))['catch'](handleError(_0x5b9e50,null));};exports['show']=function(_0x5cbbe5,_0x34b24a){var _0x5c2a4c={'raw':![],'where':{'id':_0x5cbbe5[_0x4a18('0x5a')]['id']},'include':[{'model':db[_0x4a18('0x3e')],'as':_0x4a18('0x3f')}]},_0x20610b={};_0x20610b['model']=_[_0x4a18('0x48')](db[_0x4a18('0x41')]['rawAttributes']);_0x20610b[_0x4a18('0x47')]=_['keys'](_0x5cbbe5[_0x4a18('0x47')]);_0x20610b[_0x4a18('0x51')]=_[_0x4a18('0x49')](_0x20610b[_0x4a18('0x46')],_0x20610b['query']);_0x5c2a4c[_0x4a18('0x4a')]=_[_0x4a18('0x49')](_0x20610b[_0x4a18('0x46')],qs[_0x4a18('0x4b')](_0x5cbbe5[_0x4a18('0x47')][_0x4a18('0x4b')]));_0x5c2a4c['attributes']=_0x5c2a4c[_0x4a18('0x4a')]['length']?_0x5c2a4c[_0x4a18('0x4a')]:_0x20610b[_0x4a18('0x46')];if(_0x5cbbe5[_0x4a18('0x47')][_0x4a18('0x56')]){_0x5c2a4c[_0x4a18('0x57')]=[{'all':!![]}];}_0x5c2a4c=_[_0x4a18('0x54')]({},_0x5c2a4c,_0x5cbbe5[_0x4a18('0x55')]);return db['WhatsappAccount']['find'](_0x5c2a4c)[_0x4a18('0x21')](handleEntityNotFound(_0x34b24a,null))['then'](respondWithResult(_0x34b24a,null))[_0x4a18('0x5b')](handleError(_0x34b24a,null));};exports[_0x4a18('0x5c')]=function(_0x15e4d9,_0xa09471){return db[_0x4a18('0x41')][_0x4a18('0x5c')](_0x15e4d9[_0x4a18('0x5d')],{})[_0x4a18('0x21')](function(_0x3f53d4){var _0x120d02=_0x15e4d9['user']['get']({'plain':!![]});if(!_0x120d02)throw new Error(_0x4a18('0x5e'));if(_0x120d02[_0x4a18('0x5f')]===_0x4a18('0x60')){var _0xbc0e26=_0x3f53d4[_0x4a18('0x38')]({'plain':!![]});var _0x23bfaa=_0x4a18('0x61');return db[_0x4a18('0x62')]['find']({'where':{'name':_0x23bfaa,'userProfileId':_0x120d02[_0x4a18('0x63')]},'raw':!![]})[_0x4a18('0x21')](function(_0x36bce7){if(_0x36bce7&&_0x36bce7[_0x4a18('0x64')]===0x0){return db[_0x4a18('0x39')][_0x4a18('0x5c')]({'name':_0xbc0e26['name'],'resourceId':_0xbc0e26['id'],'type':_0x36bce7[_0x4a18('0x3b')],'sectionId':_0x36bce7['id']},{})[_0x4a18('0x21')](function(){return _0x3f53d4;});}else{return _0x3f53d4;}})['catch'](function(_0x11e5a6){logger[_0x4a18('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x11e5a6);throw _0x11e5a6;});}return _0x3f53d4;})['then'](respondWithResult(_0xa09471,0xc9))[_0x4a18('0x5b')](handleError(_0xa09471,null));};exports[_0x4a18('0x36')]=function(_0x43dd3b,_0x176848){if(_0x43dd3b['body']['id']){delete _0x43dd3b[_0x4a18('0x5d')]['id'];}return db[_0x4a18('0x41')][_0x4a18('0x65')]({'where':{'id':_0x43dd3b[_0x4a18('0x5a')]['id']},'include':[{'model':db[_0x4a18('0x3e')],'as':_0x4a18('0x3f')}]})[_0x4a18('0x21')](handleEntityNotFound(_0x176848,null))[_0x4a18('0x21')](saveUpdates(_0x43dd3b[_0x4a18('0x5d')],null))[_0x4a18('0x21')](respondWithResult(_0x176848,null))[_0x4a18('0x5b')](handleError(_0x176848,null));};exports[_0x4a18('0x37')]=function(_0x3e4f4e,_0x30a168){return db[_0x4a18('0x41')]['find']({'where':{'id':_0x3e4f4e[_0x4a18('0x5a')]['id']}})['then'](handleEntityNotFound(_0x30a168,null))[_0x4a18('0x21')](removeEntity(_0x30a168,null))[_0x4a18('0x5b')](handleError(_0x30a168,null));};exports[_0x4a18('0x66')]=function(_0x26a226,_0x4bed64){return db[_0x4a18('0x41')][_0x4a18('0x66')]()[_0x4a18('0x21')](respondWithResult(_0x4bed64,null))[_0x4a18('0x5b')](handleError(_0x4bed64,null));};exports['addDisposition']=function(_0x4a945c,_0x4d07a3,_0x4959d8){if(_0x4a945c[_0x4a18('0x5d')]['id']){delete _0x4a945c[_0x4a18('0x5d')]['id'];}return db[_0x4a18('0x41')]['find']({'where':{'id':_0x4a945c[_0x4a18('0x5a')]['id']}})[_0x4a18('0x21')](handleEntityNotFound(_0x4d07a3,null))[_0x4a18('0x21')](function(_0x589653){if(_0x589653){_0x4a945c[_0x4a18('0x5d')][_0x4a18('0x67')]=_0x589653['id'];return db['Disposition'][_0x4a18('0x5c')](_0x4a945c[_0x4a18('0x5d')]);}})[_0x4a18('0x21')](respondWithResult(_0x4d07a3,null))['catch'](handleError(_0x4d07a3,null));};exports[_0x4a18('0x68')]=function(_0xec6802,_0x2b2000,_0x17f8d9){var _0x589e24={'raw':![],'where':{}};var _0x32b798={};var _0x251b24={'count':0x0,'rows':[]};return db[_0x4a18('0x41')][_0x4a18('0x69')]({'where':{'id':_0xec6802[_0x4a18('0x5a')]['id']}})[_0x4a18('0x21')](handleEntityNotFound(_0x2b2000,null))['then'](function(_0xa8bd8f){if(_0xa8bd8f){_0x32b798['model']=_['keys'](db['Disposition']['rawAttributes']);_0x32b798[_0x4a18('0x47')]=_[_0x4a18('0x48')](_0xec6802[_0x4a18('0x47')]);_0x32b798[_0x4a18('0x51')]=_[_0x4a18('0x49')](_0x32b798[_0x4a18('0x46')],_0x32b798[_0x4a18('0x47')]);_0x589e24[_0x4a18('0x4a')]=_['intersection'](_0x32b798[_0x4a18('0x46')],qs['fields'](_0xec6802['query'][_0x4a18('0x4b')]));_0x589e24[_0x4a18('0x4a')]=_0x589e24['attributes'][_0x4a18('0x4c')]?_0x589e24[_0x4a18('0x4a')]:_0x32b798['model'];if(!_0xec6802[_0x4a18('0x47')]['hasOwnProperty'](_0x4a18('0x4d'))){_0x589e24['limit']=qs[_0x4a18('0x31')](_0xec6802[_0x4a18('0x47')][_0x4a18('0x31')]);_0x589e24[_0x4a18('0x30')]=qs[_0x4a18('0x30')](_0xec6802['query'][_0x4a18('0x30')]);}_0x589e24[_0x4a18('0x4e')]=qs[_0x4a18('0x4f')](_0xec6802[_0x4a18('0x47')]['sort']);_0x589e24['where']=qs['filters'](_['pick'](_0xec6802[_0x4a18('0x47')],_0x32b798[_0x4a18('0x51')]));_0x589e24[_0x4a18('0x50')]['WhatsappAccountId']=_0xa8bd8f['id'];if(_0xec6802[_0x4a18('0x47')]['filter']){_0x589e24[_0x4a18('0x50')]=_[_0x4a18('0x54')](_0x589e24[_0x4a18('0x50')],{'$or':_['map'](_0x589e24[_0x4a18('0x4a')],function(_0x191d1d){var _0x2ba44c={};_0x2ba44c[_0x191d1d]={'$like':'%'+_0xec6802[_0x4a18('0x47')][_0x4a18('0x53')]+'%'};return _0x2ba44c;})});}_0x589e24=_['merge']({},_0x589e24,_0xec6802['options']);return db[_0x4a18('0x6a')][_0x4a18('0x32')]({'where':_0x589e24[_0x4a18('0x50')]})[_0x4a18('0x21')](function(_0x28be69){_0x251b24['count']=_0x28be69;if(_0xec6802[_0x4a18('0x47')][_0x4a18('0x56')]){_0x589e24['include']=[{'all':!![]}];}return db[_0x4a18('0x6a')][_0x4a18('0x58')](_0x589e24);})[_0x4a18('0x21')](function(_0x1d6e5a){_0x251b24[_0x4a18('0x59')]=_0x1d6e5a;return _0x251b24;});}})[_0x4a18('0x21')](respondWithFilteredResult(_0x2b2000,_0x589e24))[_0x4a18('0x5b')](handleError(_0x2b2000,null));};exports['removeDispositions']=function(_0x977bb7,_0x4f9fd7,_0x21cd8d){return db['WhatsappAccount']['find']({'where':{'id':_0x977bb7[_0x4a18('0x5a')]['id']}})[_0x4a18('0x21')](handleEntityNotFound(_0x4f9fd7,null))[_0x4a18('0x21')](function(_0x2b881c){if(_0x2b881c){return _0x2b881c[_0x4a18('0x6b')](_0x977bb7['query'][_0x4a18('0x6c')]);}})[_0x4a18('0x21')](respondWithStatusCode(_0x4f9fd7,null))[_0x4a18('0x5b')](handleError(_0x4f9fd7,null));};exports[_0x4a18('0x6d')]=function(_0x115964,_0x1f84a0,_0x568af0){if(_0x115964[_0x4a18('0x5d')]['id']){delete _0x115964[_0x4a18('0x5d')]['id'];}return db['WhatsappAccount'][_0x4a18('0x65')]({'where':{'id':_0x115964[_0x4a18('0x5a')]['id']}})[_0x4a18('0x21')](handleEntityNotFound(_0x1f84a0,null))[_0x4a18('0x21')](function(_0xff3ccb){if(_0xff3ccb){_0x115964[_0x4a18('0x5d')]['WhatsappAccountId']=_0xff3ccb['id'];return db[_0x4a18('0x6e')][_0x4a18('0x5c')](_0x115964[_0x4a18('0x5d')]);}})['then'](respondWithResult(_0x1f84a0,null))[_0x4a18('0x5b')](handleError(_0x1f84a0,null));};exports[_0x4a18('0x6f')]=function(_0x5af43d,_0x1058d2,_0x1b0fb8){var _0x59f579={'raw':![],'where':{}};var _0x14d9e6={};var _0x3d43e3={'count':0x0,'rows':[]};return db[_0x4a18('0x41')]['findOne']({'where':{'id':_0x5af43d[_0x4a18('0x5a')]['id']}})[_0x4a18('0x21')](handleEntityNotFound(_0x1058d2,null))[_0x4a18('0x21')](function(_0x27e75d){if(_0x27e75d){_0x14d9e6[_0x4a18('0x46')]=_[_0x4a18('0x48')](db[_0x4a18('0x6e')][_0x4a18('0x42')]);_0x14d9e6[_0x4a18('0x47')]=_[_0x4a18('0x48')](_0x5af43d[_0x4a18('0x47')]);_0x14d9e6[_0x4a18('0x51')]=_[_0x4a18('0x49')](_0x14d9e6[_0x4a18('0x46')],_0x14d9e6[_0x4a18('0x47')]);_0x59f579['attributes']=_[_0x4a18('0x49')](_0x14d9e6[_0x4a18('0x46')],qs[_0x4a18('0x4b')](_0x5af43d[_0x4a18('0x47')][_0x4a18('0x4b')]));_0x59f579[_0x4a18('0x4a')]=_0x59f579[_0x4a18('0x4a')][_0x4a18('0x4c')]?_0x59f579['attributes']:_0x14d9e6[_0x4a18('0x46')];if(!_0x5af43d[_0x4a18('0x47')][_0x4a18('0x70')]('nolimit')){_0x59f579[_0x4a18('0x31')]=qs[_0x4a18('0x31')](_0x5af43d[_0x4a18('0x47')]['limit']);_0x59f579[_0x4a18('0x30')]=qs['offset'](_0x5af43d[_0x4a18('0x47')]['offset']);}_0x59f579[_0x4a18('0x4e')]=qs[_0x4a18('0x4f')](_0x5af43d[_0x4a18('0x47')][_0x4a18('0x4f')]);_0x59f579[_0x4a18('0x50')]=qs[_0x4a18('0x51')](_[_0x4a18('0x52')](_0x5af43d[_0x4a18('0x47')],_0x14d9e6['filters']));_0x59f579['where'][_0x4a18('0x67')]=_0x27e75d['id'];if(_0x5af43d['query'][_0x4a18('0x53')]){_0x59f579[_0x4a18('0x50')]=_[_0x4a18('0x54')](_0x59f579[_0x4a18('0x50')],{'$or':_['map'](_0x59f579['attributes'],function(_0x2941ca){var _0x2df65f={};_0x2df65f[_0x2941ca]={'$like':'%'+_0x5af43d[_0x4a18('0x47')][_0x4a18('0x53')]+'%'};return _0x2df65f;})});}_0x59f579=_[_0x4a18('0x54')]({},_0x59f579,_0x5af43d[_0x4a18('0x55')]);return db[_0x4a18('0x6e')]['count']({'where':_0x59f579[_0x4a18('0x50')]})[_0x4a18('0x21')](function(_0x1c5711){_0x3d43e3[_0x4a18('0x32')]=_0x1c5711;if(_0x5af43d[_0x4a18('0x47')][_0x4a18('0x56')]){_0x59f579[_0x4a18('0x57')]=[{'all':!![]}];}return db[_0x4a18('0x6e')][_0x4a18('0x58')](_0x59f579);})[_0x4a18('0x21')](function(_0x3b29e0){_0x3d43e3['rows']=_0x3b29e0;return _0x3d43e3;});}})[_0x4a18('0x21')](respondWithFilteredResult(_0x1058d2,_0x59f579))[_0x4a18('0x5b')](handleError(_0x1058d2,null));};exports[_0x4a18('0x71')]=function(_0x1c7ee3,_0x33d4cb,_0xc49cf7){return db[_0x4a18('0x41')][_0x4a18('0x65')]({'where':{'id':_0x1c7ee3[_0x4a18('0x5a')]['id']}})[_0x4a18('0x21')](handleEntityNotFound(_0x33d4cb,null))['then'](function(_0x3e81df){if(_0x3e81df){return _0x3e81df[_0x4a18('0x71')](_0x1c7ee3[_0x4a18('0x47')][_0x4a18('0x6c')]);}})[_0x4a18('0x21')](respondWithStatusCode(_0x33d4cb,null))[_0x4a18('0x5b')](handleError(_0x33d4cb,null));};exports[_0x4a18('0x72')]=function(_0x4db625,_0x56c027,_0x2bcc02){return db[_0x4a18('0x41')][_0x4a18('0x65')]({'where':{'id':_0x4db625[_0x4a18('0x5a')]['id']}})[_0x4a18('0x21')](handleEntityNotFound(_0x56c027,null))['then'](function(_0x25fea5){if(_0x25fea5){return _0x25fea5[_0x4a18('0x72')](_0x4db625[_0x4a18('0x5d')][_0x4a18('0x6c')],_[_0x4a18('0x73')](_0x4db625[_0x4a18('0x5d')],[_0x4a18('0x6c'),'id'])||{})[_0x4a18('0x74')](function(_0x3c9636){for(var _0xef13d1=0x0;_0xef13d1<_0x4db625[_0x4a18('0x5d')]['ids'][_0x4a18('0x4c')];_0xef13d1+=0x1){socket['emit'](_0x4a18('0x75'),{'UserId':Number(_0x4db625[_0x4a18('0x5d')]['ids'][_0xef13d1]),'WhatsappAccountId':Number(_0x4db625[_0x4a18('0x5a')]['id'])});}return _0x3c9636;});}})[_0x4a18('0x21')](respondWithResult(_0x56c027,null))['catch'](handleError(_0x56c027,null));};exports['removeAgents']=function(_0x401b5c,_0x455162,_0x486c7f){return db['WhatsappAccount']['find']({'where':{'id':_0x401b5c[_0x4a18('0x5a')]['id']}})['then'](handleEntityNotFound(_0x455162,null))[_0x4a18('0x21')](function(_0x208ca9){if(_0x208ca9){return _0x208ca9['removeAgents'](_0x401b5c[_0x4a18('0x47')][_0x4a18('0x6c')])[_0x4a18('0x21')](function(){if(_[_0x4a18('0x76')](_0x401b5c[_0x4a18('0x47')]['ids'])){for(var _0x1ce694=0x0;_0x1ce694<_0x401b5c['query'][_0x4a18('0x6c')][_0x4a18('0x4c')];_0x1ce694+=0x1){socket[_0x4a18('0x77')](_0x4a18('0x78'),{'UserId':Number(_0x401b5c[_0x4a18('0x47')][_0x4a18('0x6c')][_0x1ce694]),'WhatsappAccountId':Number(_0x401b5c[_0x4a18('0x5a')]['id'])});}}else{socket[_0x4a18('0x77')](_0x4a18('0x78'),{'UserId':Number(_0x401b5c['query'][_0x4a18('0x6c')]),'WhatsappAccountId':Number(_0x401b5c[_0x4a18('0x5a')]['id'])});}});}})['then'](respondWithStatusCode(_0x455162,null))['catch'](handleError(_0x455162,null));};exports[_0x4a18('0x79')]=function(_0x975687,_0x4d39e3,_0x10d31f){var _0x10e8b8={};var _0x4a3ffb={};var _0x3d9cd9;var _0x42e9a6;return db[_0x4a18('0x41')][_0x4a18('0x69')]({'where':{'id':_0x975687[_0x4a18('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4d39e3,null))[_0x4a18('0x21')](function(_0x5dcca9){if(_0x5dcca9){_0x3d9cd9=_0x5dcca9;_0x4a3ffb['model']=_[_0x4a18('0x48')](db[_0x4a18('0x7a')][_0x4a18('0x42')]);_0x4a3ffb[_0x4a18('0x47')]=_[_0x4a18('0x48')](_0x975687[_0x4a18('0x47')]);_0x4a3ffb[_0x4a18('0x51')]=_[_0x4a18('0x49')](_0x4a3ffb[_0x4a18('0x46')],_0x4a3ffb[_0x4a18('0x47')]);_0x10e8b8[_0x4a18('0x4a')]=_[_0x4a18('0x49')](_0x4a3ffb['model'],qs['fields'](_0x975687[_0x4a18('0x47')]['fields']));_0x10e8b8[_0x4a18('0x4a')]=_0x10e8b8[_0x4a18('0x4a')][_0x4a18('0x4c')]?_0x10e8b8[_0x4a18('0x4a')]:_0x4a3ffb[_0x4a18('0x46')];_0x10e8b8['order']=qs['sort'](_0x975687[_0x4a18('0x47')][_0x4a18('0x4f')]);_0x10e8b8['where']=qs[_0x4a18('0x51')](_[_0x4a18('0x52')](_0x975687[_0x4a18('0x47')],_0x4a3ffb[_0x4a18('0x51')]));if(_0x975687['query'][_0x4a18('0x53')]){_0x10e8b8[_0x4a18('0x50')]=_[_0x4a18('0x54')](_0x10e8b8['where'],{'$or':_[_0x4a18('0x40')](_0x10e8b8[_0x4a18('0x4a')],function(_0x1ab67d){var _0x488e8b={};_0x488e8b[_0x1ab67d]={'$like':'%'+_0x975687[_0x4a18('0x47')]['filter']+'%'};return _0x488e8b;})});}_0x10e8b8=_[_0x4a18('0x54')]({},_0x10e8b8,_0x975687[_0x4a18('0x55')]);return _0x3d9cd9['getAgents'](_0x10e8b8);}})[_0x4a18('0x21')](function(_0x423ca5){if(_0x423ca5){_0x42e9a6=_0x423ca5[_0x4a18('0x4c')];if(!_0x975687[_0x4a18('0x47')][_0x4a18('0x70')]('nolimit')){_0x10e8b8[_0x4a18('0x31')]=qs['limit'](_0x975687[_0x4a18('0x47')][_0x4a18('0x31')]);_0x10e8b8[_0x4a18('0x30')]=qs['offset'](_0x975687['query'][_0x4a18('0x30')]);}return _0x3d9cd9[_0x4a18('0x79')](_0x10e8b8);}})['then'](function(_0x2d0966){if(_0x2d0966){return _0x2d0966?{'count':_0x42e9a6,'rows':_0x2d0966}:null;}})[_0x4a18('0x21')](respondWithResult(_0x4d39e3,null))['catch'](handleError(_0x4d39e3,null));};exports[_0x4a18('0x7b')]=function(_0x155846,_0x189324){var _0xb9f0d7=_0x155846[_0x4a18('0x5a')]['id'];var _0x2dfed7=_0x155846[_0x4a18('0x5d')];var _0x2498c5=0xc8;var _0x21bcf3=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x4a18('0x7c')][_0x4a18('0x7d')][_0x4a18('0x7e')][_0x4a18('0x7f')]},function(_0x31f048){return db['WhatsappAccount'][_0x4a18('0x69')]({'where':{'id':_0xb9f0d7},'transaction':_0x31f048})[_0x4a18('0x21')](function(_0x4e187f){if(_0x4e187f){return db['WhatsappApplication'][_0x4a18('0x37')]({'where':{'WhatsappAccountId':_0xb9f0d7},'transaction':_0x31f048})['then'](function(){var _0x3b5261=_[_0x4a18('0x40')](_0x2dfed7,function(_0x102b0e){_0x102b0e['WhatsappAccountId']=_0xb9f0d7;return _0x102b0e;});return db[_0x4a18('0x80')]['bulkCreate'](_0x3b5261,{'transaction':_0x31f048});});}else{_0x2498c5=0x194;_0x21bcf3=[];}});})['then'](function(){if(_0x2498c5!==0x194){return db['WhatsappApplication']['findAndCountAll']({'where':{'WhatsappAccountId':_0xb9f0d7},'order':_0x4a18('0x81')})[_0x4a18('0x21')](function(_0x44a033){_0x21bcf3=_0x44a033;});}})[_0x4a18('0x5b')](function(_0x26988e){_0x2498c5=0x1f4;logger[_0x4a18('0x28')](_0x26988e[_0x4a18('0x3a')]);if(_0x26988e['name']){delete _0x26988e[_0x4a18('0x3b')];}_0x21bcf3=_0x26988e;})[_0x4a18('0x82')](function(){if(_0x21bcf3===null){_0x189324['sendStatus'](_0x2498c5);}else{if(_0x2498c5===0x1f4){_0x189324[_0x4a18('0x2d')](_0x2498c5)[_0x4a18('0x3c')](_0x21bcf3);}else{_0x189324['status'](_0x2498c5)[_0x4a18('0x2f')](_0x21bcf3);}}});};exports['getApplications']=function(_0x12be5b,_0x20e3be,_0x4e7578){var _0x521a17={};var _0x8da094={};var _0x5a7296;var _0x3547bc;return db[_0x4a18('0x41')][_0x4a18('0x69')]({'where':{'id':_0x12be5b[_0x4a18('0x5a')]['id']}})[_0x4a18('0x21')](handleEntityNotFound(_0x20e3be,null))[_0x4a18('0x21')](function(_0x2a6b2f){if(_0x2a6b2f){_0x5a7296=_0x2a6b2f;_0x8da094[_0x4a18('0x46')]=_['keys'](db[_0x4a18('0x80')][_0x4a18('0x42')]);_0x8da094[_0x4a18('0x47')]=_[_0x4a18('0x48')](_0x12be5b[_0x4a18('0x47')]);_0x8da094['filters']=_[_0x4a18('0x49')](_0x8da094['model'],_0x8da094[_0x4a18('0x47')]);_0x521a17[_0x4a18('0x4a')]=_[_0x4a18('0x49')](_0x8da094[_0x4a18('0x46')],qs[_0x4a18('0x4b')](_0x12be5b[_0x4a18('0x47')][_0x4a18('0x4b')]));_0x521a17[_0x4a18('0x4a')]=_0x521a17[_0x4a18('0x4a')][_0x4a18('0x4c')]?_0x521a17[_0x4a18('0x4a')]:_0x8da094[_0x4a18('0x46')];_0x521a17[_0x4a18('0x4e')]=qs[_0x4a18('0x4f')](_0x12be5b['query'][_0x4a18('0x4f')]);_0x521a17[_0x4a18('0x50')]=qs['filters'](_[_0x4a18('0x52')](_0x12be5b[_0x4a18('0x47')],_0x8da094['filters']));if(_0x12be5b['query'][_0x4a18('0x53')]){_0x521a17[_0x4a18('0x50')]=_[_0x4a18('0x54')](_0x521a17[_0x4a18('0x50')],{'$or':_[_0x4a18('0x40')](_0x521a17[_0x4a18('0x4a')],function(_0x2b4d47){var _0x4108e6={};_0x4108e6[_0x2b4d47]={'$like':'%'+_0x12be5b[_0x4a18('0x47')][_0x4a18('0x53')]+'%'};return _0x4108e6;})});}_0x521a17=_[_0x4a18('0x54')]({},_0x521a17,_0x12be5b['options']);return _0x5a7296[_0x4a18('0x83')](_0x521a17);}})[_0x4a18('0x21')](function(_0x5c3ab9){if(_0x5c3ab9){_0x3547bc=_0x5c3ab9[_0x4a18('0x4c')];if(!_0x12be5b[_0x4a18('0x47')][_0x4a18('0x70')](_0x4a18('0x4d'))){_0x521a17[_0x4a18('0x31')]=qs[_0x4a18('0x31')](_0x12be5b[_0x4a18('0x47')][_0x4a18('0x31')]);_0x521a17[_0x4a18('0x30')]=qs['offset'](_0x12be5b[_0x4a18('0x47')][_0x4a18('0x30')]);}return _0x5a7296[_0x4a18('0x83')](_0x521a17);}})['then'](function(_0x567562){if(_0x567562){return _0x567562?{'count':_0x3547bc,'rows':_0x567562}:null;}})[_0x4a18('0x21')](respondWithResult(_0x20e3be,null))[_0x4a18('0x5b')](handleError(_0x20e3be,null));};exports[_0x4a18('0x84')]=function(_0x56dbeb,_0x295f3a,_0x34b023){var _0x8bfa2d={'channel':_0x4a18('0x85')};var _0x188189=[];var _0x415a15=[];var _0x51ff27={};return db[_0x4a18('0x41')][_0x4a18('0x65')]({'where':{'id':_0x56dbeb[_0x4a18('0x5a')]['id']},'include':[{'model':db[_0x4a18('0x80')],'as':_0x4a18('0x86')}]})[_0x4a18('0x21')](handleEntityNotFound(_0x295f3a,null))['then'](function(_0xbc54f8){_0x8bfa2d[_0x4a18('0x87')]=_0xbc54f8;if(_0x8bfa2d[_0x4a18('0x87')]&&_0x8bfa2d[_0x4a18('0x87')][_0x4a18('0x44')]==='sinch'&&_0x56dbeb[_0x4a18('0x5d')][_0x4a18('0x88')]){if(_0x56dbeb[_0x4a18('0x5d')][_0x4a18('0x88')]['length']===0x0)return;if(_0x56dbeb[_0x4a18('0x5d')]['statuses'][0x0][_0x4a18('0x89')]!==_0x4a18('0x8a'))return;return db[_0x4a18('0x8b')]['update']({'read':!![],'readAt':_0x56dbeb[_0x4a18('0x5d')][_0x4a18('0x88')][0x0][_0x4a18('0x8c')]},{'where':{'messageId':_0x56dbeb[_0x4a18('0x5d')][_0x4a18('0x88')][0x0]['message_id']},'individualHooks':!![]})[_0x4a18('0x21')](function(_0x41c13f){return _0x295f3a['status'](0xc8)[_0x4a18('0x2f')](_0x41c13f);});}_0x8bfa2d[_0x4a18('0x8d')]=_[_0x4a18('0x8e')](_0xbc54f8[_0x4a18('0x86')],[_0x4a18('0x81')],[_0x4a18('0x8f')]);if(_0x8bfa2d[_0x4a18('0x87')][_0x4a18('0x86')]){delete _0x8bfa2d[_0x4a18('0x87')][_0x4a18('0x86')];}return db[_0x4a18('0x90')]['describe']()['then'](function(_0x46d7ea){if(!_0x46d7ea){throw new db[(_0x4a18('0x91'))]['ValidationError'](_0x4a18('0x92'));}_0x188189=_['difference'](_[_0x4a18('0x48')](_0x46d7ea),[_0x4a18('0x93'),_0x4a18('0x94')]);_0x415a15=_[_0x4a18('0x95')](_[_0x4a18('0x48')](_0x46d7ea),[_0x4a18('0x93'),_0x4a18('0x94'),_0x4a18('0x96'),_0x4a18('0x97')]);_0x8bfa2d[_0x4a18('0x5d')]={'mapKey':'mobile'};if(_0x8bfa2d['account']&&_0x8bfa2d[_0x4a18('0x87')][_0x4a18('0x44')]==='twilio'){_0x8bfa2d['body'][_0x4a18('0x98')]=_0x56dbeb['body']['From']['replace'](_0x4a18('0x99'),'');_0x8bfa2d[_0x4a18('0x5d')][_0x4a18('0x5d')]=_0x56dbeb['body']['Body'];_0x8bfa2d[_0x4a18('0x5d')][_0x4a18('0x9a')]=_0x56dbeb[_0x4a18('0x5d')]['MessageSid'];}if(_0x8bfa2d[_0x4a18('0x87')]&&_0x8bfa2d[_0x4a18('0x87')][_0x4a18('0x44')]===_0x4a18('0x9b')){_0x8bfa2d[_0x4a18('0x5d')]['from']=_0x56dbeb[_0x4a18('0x5d')]['notifications'][0x0][_0x4a18('0x98')];_0x8bfa2d[_0x4a18('0x5d')][_0x4a18('0x5d')]=_0x56dbeb['body']['notifications'][0x0]['message']['body'];_0x8bfa2d[_0x4a18('0x5d')][_0x4a18('0x9a')]=_0x56dbeb[_0x4a18('0x5d')][_0x4a18('0x9c')][0x0][_0x4a18('0x9d')];}if(_0x8bfa2d['body']['id']){delete _0x8bfa2d[_0x4a18('0x5d')]['id'];}if(_[_0x4a18('0x9e')](_0x8bfa2d[_0x4a18('0x5d')][_0x4a18('0x98')])){throw new db['Sequelize']['ValidationError'](_0x4a18('0x9f'));}if(_['isNil'](_0x8bfa2d['body'][_0x4a18('0x5d')])||_0x8bfa2d[_0x4a18('0x5d')][_0x4a18('0x5d')]===''){throw new db[(_0x4a18('0x91'))][(_0x4a18('0xa0'))](_0x4a18('0xa1'));}if(_[_0x4a18('0x9e')](_0x8bfa2d[_0x4a18('0x5d')][_0x4a18('0xa2')])){throw new db[(_0x4a18('0x91'))][(_0x4a18('0xa0'))](_0x4a18('0xa3')+_0x415a15);}if(!_['includes'](_0x415a15,_0x8bfa2d[_0x4a18('0x5d')][_0x4a18('0xa2')])){throw new db['Sequelize'][(_0x4a18('0xa0'))](_0x4a18('0xa4')+_0x415a15);}_0x51ff27[_0x8bfa2d[_0x4a18('0x5d')]['mapKey']]=_0x8bfa2d[_0x4a18('0x5d')][_0x4a18('0x98')];return db[_0x4a18('0xa5')]['find']({'where':{'id':_0x8bfa2d[_0x4a18('0x87')][_0x4a18('0x97')]},'include':[{'model':db[_0x4a18('0x90')],'as':_0x4a18('0xa6'),'where':_0x51ff27,'limit':0x1,'order':[[_0x4a18('0x94'),_0x4a18('0xa7')]]}]});})[_0x4a18('0x21')](handleEntityNotFound(_0x295f3a,null))[_0x4a18('0x21')](function(_0x5013b4){if(_0x5013b4){_0x8bfa2d[_0x4a18('0xa8')]=_['omit'](_0x5013b4,['Contacts']);if(_0x5013b4[_0x4a18('0xa6')][_0x4a18('0x4c')]){return _0x5013b4[_0x4a18('0xa6')][0x0];}var _0x58b28f=_['defaults'](_0x8bfa2d[_0x4a18('0x5d')],{'firstName':_0x8bfa2d['body']['from'],'ListId':_0x5013b4['id']});_0x58b28f[_0x8bfa2d[_0x4a18('0x5d')]['mapKey']]=_0x8bfa2d[_0x4a18('0x5d')][_0x4a18('0x98')];return db[_0x4a18('0x90')][_0x4a18('0x5c')](_0x58b28f,{'fields':_0x188189,'raw':!![]});}})[_0x4a18('0x21')](handleEntityNotFound(_0x295f3a,null))['then'](function(_0x13c792){if(_0x13c792){_0x8bfa2d[_0x4a18('0xa9')]=_0x13c792;var _0x1a29b0={'ContactId':_0x13c792['id'],'phone':_0x8bfa2d[_0x4a18('0x5d')][_0x4a18('0x98')],'WhatsappAccountId':_0x56dbeb['params']['id']};var _0x58ea44={'ContactId':_0x13c792['id'],'WhatsappAccountId':_0x56dbeb[_0x4a18('0x5a')]['id'],'closed':![]};return db['WhatsappInteraction'][_0x4a18('0x65')]({'where':_0x58ea44})[_0x4a18('0x21')](function(_0x1e1d5f){if(_0x1e1d5f){return[_0x1e1d5f,![]];}return db[_0x4a18('0xaa')][_0x4a18('0x5c')](_0x1a29b0)[_0x4a18('0x21')](function(_0x786ce8){return[_0x786ce8,!![]];});});}})[_0x4a18('0x74')](function(_0xf6fab4,_0x1baed6){_0x8bfa2d[_0x4a18('0xab')]=_0xf6fab4[_0x4a18('0x38')]({'plain':!![]});_0x8bfa2d[_0x4a18('0xab')][_0x4a18('0xac')]=![];if(_0x1baed6){if(_0x8bfa2d['account'][_0x4a18('0xad')]){_0x8bfa2d['applications']['push']({'id':0x0,'priority':_0x8bfa2d[_0x4a18('0x8d')][_0x4a18('0x4c')]+0x1,'app':'close','appdata':'unmanaged','interval':'*,*,*,*'});}_0x8bfa2d[_0x4a18('0xab')][_0x4a18('0xac')]=!![];}return db[_0x4a18('0x8b')][_0x4a18('0x5c')]({'phone':_0x8bfa2d[_0x4a18('0x5d')][_0x4a18('0x98')],'messageId':_0x8bfa2d['body'][_0x4a18('0x9a')],'body':_0x8bfa2d['body'][_0x4a18('0x5d')],'WhatsappAccountId':_0x56dbeb[_0x4a18('0x5a')]['id'],'WhatsappInteractionId':_0xf6fab4['id'],'direction':'in','ContactId':_0xf6fab4[_0x4a18('0xae')],'AttachmentId':_0x8bfa2d[_0x4a18('0x5d')][_0x4a18('0xaf')]});})[_0x4a18('0x21')](function(_0xb53a0e){_0x8bfa2d['message']=_0xb53a0e;if(!_0x8bfa2d[_0x4a18('0xab')][_0x4a18('0xb0')])return;return db[_0x4a18('0x7a')]['find']({'attributes':['id',_0x4a18('0x3b')],'where':{'id':_0x8bfa2d[_0x4a18('0xab')][_0x4a18('0xb0')]}});})[_0x4a18('0x21')](function(_0x4672df){if(_0x4672df){_0x8bfa2d[_0x4a18('0x8d')][_0x4a18('0xb1')]({'id':0x0,'priority':0x0,'app':_0x4a18('0xb2'),'appdata':_0x4672df[_0x4a18('0x3b')]+','+(_0x8bfa2d[_0x4a18('0x87')][_0x4a18('0xb3')]||0xa),'interval':'*,*,*,*'});}if(!_0x8bfa2d['interaction'][_0x4a18('0xb4')])return;return db[_0x4a18('0xb5')][_0x4a18('0x65')]({'attributes':['id',_0x4a18('0x3b')],'where':{'id':_0x8bfa2d[_0x4a18('0xab')][_0x4a18('0xb4')]}});})[_0x4a18('0x21')](function(_0x2bf9a7){if(_0x2bf9a7){_0x8bfa2d[_0x4a18('0x8d')]['unshift']({'id':0x0,'priority':0x1,'app':_0x4a18('0xb6'),'appdata':_0x2bf9a7['name']+','+(_0x8bfa2d[_0x4a18('0x87')][_0x4a18('0xb7')]||0x12c),'interval':_0x4a18('0xb8')});}return respondWithRpcPromise(_0x4a18('0xb9'),_0x4a18('0xba'),_0x8bfa2d);})[_0x4a18('0x21')](function(_0x44bb2b){if(_0x44bb2b){var _0x2b4bfd=0xc8;var _0x5d7ad8=_0x4a18('0xbb');logger[_0x4a18('0x22')](_0x4a18('0x26'),_0x5d7ad8,_0x2b4bfd,_0x4a18('0xbc'));logger[_0x4a18('0x25')](_0x4a18('0xbd'),_0x5d7ad8,_0x2b4bfd,_0x4a18('0xbc'),JSON['stringify'](_0x44bb2b));if(_0x8bfa2d[_0x4a18('0x87')]['type']==='twilio'){return _0x295f3a[_0x4a18('0x2d')](_0x2b4bfd)[_0x4a18('0x33')](_0x4a18('0xbe'),'text/xml')[_0x4a18('0x3c')](_0x4a18('0xbf'));}else{return _0x295f3a[_0x4a18('0x2d')](_0x2b4bfd)[_0x4a18('0x2f')](_0x44bb2b);}}});})[_0x4a18('0x5b')](handleError(_0x295f3a,null));};exports[_0x4a18('0x3c')]=function(_0x36770a,_0x29c844,_0x13c25f){var _0x1f1838,_0xc1b803,_0x50ca25;if(_['isNil'](_0x36770a[_0x4a18('0x5d')][_0x4a18('0x5d')])||_0x36770a[_0x4a18('0x5d')][_0x4a18('0x5d')]===''){throw new db[(_0x4a18('0x91'))][(_0x4a18('0xa0'))](_0x4a18('0xa1'));}if(_[_0x4a18('0x9e')](_0x36770a[_0x4a18('0x5d')]['to'])){throw new db[(_0x4a18('0x91'))][(_0x4a18('0xa0'))](_0x4a18('0xc0'));}_0x1f1838=_0x36770a[_0x4a18('0x5d')]['to'];return db[_0x4a18('0x41')]['find']({'where':{'id':_0x36770a[_0x4a18('0x5a')]['id']},'include':[{'model':db[_0x4a18('0xa5')],'as':'List','include':[{'model':db[_0x4a18('0x90')],'as':_0x4a18('0xa6'),'where':{'mobile':_0x1f1838},'limit':0x1,'order':[[_0x4a18('0x94'),_0x4a18('0xa7')]]}]}]})[_0x4a18('0x21')](handleEntityNotFound(_0x29c844,null))['then'](function(_0x4a1145){if(_0x4a1145&&_0x4a1145['List']){_0xc1b803=_0x4a1145[_0x4a18('0x38')]({'plain':!![]});if(_0xc1b803[_0x4a18('0xc1')]&&_0xc1b803[_0x4a18('0xc1')]['Contacts'][_0x4a18('0x4c')]){return _0xc1b803[_0x4a18('0xc1')][_0x4a18('0xa6')][0x0];}return db[_0x4a18('0x90')][_0x4a18('0x5c')](_[_0x4a18('0x1a')](_0x36770a[_0x4a18('0x5d')],{'firstName':_0x1f1838,'mobile':_0x1f1838,'phone':_0x1f1838,'ListId':_0xc1b803[_0x4a18('0x97')]}));}})[_0x4a18('0x21')](handleEntityNotFound(_0x29c844,null))[_0x4a18('0x21')](function(_0x7f3b3d){if(_0x7f3b3d){_0x50ca25=_0x7f3b3d;return db[_0x4a18('0xaa')][_0x4a18('0x65')]({'where':{'ContactId':_0x50ca25['id'],'closed':![],'WhatsappAccountId':_0xc1b803['id']}})[_0x4a18('0x21')](function(_0x2c6dc9){if(_0x2c6dc9){return[_0x2c6dc9,![]];}return db['WhatsappInteraction']['create']({'UserId':_0x36770a['user']['id'],'ContactId':_0x50ca25['id'],'WhatsappAccountId':_0xc1b803['id'],'phone':_0x1f1838,'firstMsgDirection':'out','Messages':[_[_0x4a18('0x54')](_0x36770a[_0x4a18('0x5d')],{'read':![],'body':_0x36770a[_0x4a18('0x5d')]['body'],'phone':_0x1f1838,'WhatsappAccountId':_0xc1b803['id'],'UserId':_0x36770a['user']['id'],'ContactId':_0x50ca25['id']})]},{'include':[{'model':db[_0x4a18('0x8b')],'as':_0x4a18('0xc2')}]})['then'](function(_0x3cffce){return[_0x3cffce,!![]];});});}})['spread'](function(_0x381b97,_0x27ee94){if(_0x27ee94){return _0x381b97;}return db[_0x4a18('0x8b')][_0x4a18('0x5c')](_[_0x4a18('0x54')](_0x36770a[_0x4a18('0x5d')],{'read':![],'body':_0x36770a['body'][_0x4a18('0x5d')],'phone':_0x1f1838,'WhatsappAccountId':_0xc1b803['id'],'WhatsappInteractionId':_0x381b97['id'],'UserId':_0x36770a[_0x4a18('0x60')]['id'],'ContactId':_0x50ca25['id']}))['then'](function(_0x50e412){_0x381b97[_0x4a18('0xc3')]['Messages']=[];_0x381b97[_0x4a18('0xc3')][_0x4a18('0xc2')][_0x4a18('0xc4')](_0x50e412[_0x4a18('0xc3')]);return _0x381b97;});})[_0x4a18('0x21')](respondWithResult(_0x29c844,null))[_0x4a18('0x5b')](handleError(_0x29c844,null));}; \ No newline at end of file +var _0xf8d0=['set','\x0a','List','CmContact','out','dataValues','Messages','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','sendStatus','end','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','get','WhatsappAccounts','status','stack','name','send','index','Pause','mandatoryDispositionPause','WhatsappAccount','rawAttributes','fieldName','model','map','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','include','findAll','rows','show','params','keys','fields','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','UserProfileResource','update','describe','addDisposition','Disposition','getDispositions','WhatsappAccountId','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','findOne','User','getAgents','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','json','getApplications','notify','account','type','statuses','WhatsappMessage','message_id','orderBy','Applications','asc','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','From','replace','whatsapp:','messageId','MessageSid','sinch','notifications','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','defaults','contact','WhatsappInteraction','interaction','created','autoclose','applications','push','close','unmanaged','ContactId','AttachmentId','UserId','agent','waitForTheAssignedAgent','WhatsappQueue','unshift','waitForTheAssignedQueue','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','twilio'];(function(_0x4bc65f,_0x39ec43){var _0x44f85f=function(_0x175343){while(--_0x175343){_0x4bc65f['push'](_0x4bc65f['shift']());}};_0x44f85f(++_0x39ec43);}(_0xf8d0,0x199));var _0x0f8d=function(_0x7a8c96,_0x2e99d6){_0x7a8c96=_0x7a8c96-0x0;var _0x31d2f6=_0xf8d0[_0x7a8c96];return _0x31d2f6;};'use strict';var emlformat=require(_0x0f8d('0x0'));var rimraf=require(_0x0f8d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0f8d('0x2'));var rp=require(_0x0f8d('0x3'));var moment=require('moment');var BPromise=require(_0x0f8d('0x4'));var Mustache=require(_0x0f8d('0x5'));var util=require(_0x0f8d('0x6'));var path=require(_0x0f8d('0x7'));var sox=require(_0x0f8d('0x8'));var csv=require(_0x0f8d('0x9'));var ejs=require(_0x0f8d('0xa'));var fs=require('fs');var fs_extra=require(_0x0f8d('0xb'));var _=require(_0x0f8d('0xc'));var squel=require(_0x0f8d('0xd'));var crypto=require(_0x0f8d('0xe'));var jsforce=require(_0x0f8d('0xf'));var deskjs=require(_0x0f8d('0x10'));var toCsv=require('to-csv');var querystring=require(_0x0f8d('0x11'));var Papa=require('papaparse');var Redis=require(_0x0f8d('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x0f8d('0x13'));var as=require(_0x0f8d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0f8d('0x15'));var utils=require(_0x0f8d('0x16'));var config=require(_0x0f8d('0x17'));var licenseUtil=require(_0x0f8d('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x0f8d('0x19')],{'host':_0x0f8d('0x1a'),'port':0x18eb});var socket=require(_0x0f8d('0x1b'))(new Redis(config[_0x0f8d('0x19')]));require('./whatsappAccount.socket')[_0x0f8d('0x1c')](socket);var jayson=require(_0x0f8d('0x1d'));var client=jayson[_0x0f8d('0x1e')][_0x0f8d('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x214684,_0x4a9624,_0x4df97d,_0x32af72){return new BPromise(function(_0x171bc9,_0x5e0830){var _0x9a42dc=_0x32af72||client;return _0x9a42dc[_0x0f8d('0x20')](_0x214684,_0x4df97d)[_0x0f8d('0x21')](function(_0x3a183a){logger['info'](_0x0f8d('0x22'),_0x4a9624,_0x0f8d('0x23'));logger[_0x0f8d('0x24')](_0x0f8d('0x25'),_0x4a9624,'request\x20sent',JSON['stringify'](_0x3a183a));if(_0x3a183a[_0x0f8d('0x26')]){if(_0x3a183a[_0x0f8d('0x26')][_0x0f8d('0x27')]===0x1f4){logger['error'](_0x0f8d('0x22'),_0x4a9624,_0x3a183a[_0x0f8d('0x26')][_0x0f8d('0x28')]);return _0x5e0830(_0x3a183a[_0x0f8d('0x26')][_0x0f8d('0x28')]);}logger[_0x0f8d('0x26')](_0x0f8d('0x22'),_0x4a9624,_0x3a183a['error']['message']);return _0x171bc9(_0x3a183a['error'][_0x0f8d('0x28')]);}else{logger[_0x0f8d('0x29')](_0x0f8d('0x22'),_0x4a9624,_0x0f8d('0x23'));_0x171bc9(_0x3a183a['result']['message']);}})[_0x0f8d('0x2a')](function(_0x1aea09){logger[_0x0f8d('0x26')](_0x0f8d('0x22'),_0x4a9624,_0x1aea09);_0x5e0830(_0x1aea09);});});}function respondWithStatusCode(_0x258982,_0x1c82b0){_0x1c82b0=_0x1c82b0||0xcc;return function(_0x1a2580){if(_0x1a2580){return _0x258982[_0x0f8d('0x2b')](_0x1c82b0);}return _0x258982['status'](_0x1c82b0)[_0x0f8d('0x2c')]();};}function respondWithResult(_0x2841ee,_0x21d9b5){_0x21d9b5=_0x21d9b5||0xc8;return function(_0x50b590){if(_0x50b590){return _0x2841ee['status'](_0x21d9b5)['json'](_0x50b590);}};}function respondWithFilteredResult(_0x8c3727,_0x31d7c7){return function(_0x2060fc){if(_0x2060fc){var _0x183225=typeof _0x31d7c7[_0x0f8d('0x2d')]===_0x0f8d('0x2e')&&typeof _0x31d7c7[_0x0f8d('0x2f')]===_0x0f8d('0x2e');var _0x5a4084=_0x2060fc['count'];var _0x496d5c=_0x183225?0x0:_0x31d7c7[_0x0f8d('0x2d')];var _0x25c788=_0x183225?_0x2060fc[_0x0f8d('0x30')]:_0x31d7c7[_0x0f8d('0x2d')]+_0x31d7c7[_0x0f8d('0x2f')];var _0x4edaf5;if(_0x25c788>=_0x5a4084){_0x25c788=_0x5a4084;_0x4edaf5=0xc8;}else{_0x4edaf5=0xce;}_0x8c3727['status'](_0x4edaf5);return _0x8c3727['set'](_0x0f8d('0x31'),_0x496d5c+'-'+_0x25c788+'/'+_0x5a4084)['json'](_0x2060fc);}return null;};}function patchUpdates(_0x3ea121){return function(_0x39bcb0){try{jsonpatch[_0x0f8d('0x32')](_0x39bcb0,_0x3ea121,!![]);}catch(_0x12fff3){return BPromise[_0x0f8d('0x33')](_0x12fff3);}return _0x39bcb0[_0x0f8d('0x34')]();};}function saveUpdates(_0x40dc38,_0x54cc04){return function(_0x53dfc6){if(_0x53dfc6){return _0x53dfc6['update'](_0x40dc38)[_0x0f8d('0x21')](function(_0x1d6dce){return _0x1d6dce;});}return null;};}function removeEntity(_0x442a2e,_0x566c10){return function(_0x51870f){if(_0x51870f){return _0x51870f[_0x0f8d('0x35')]()[_0x0f8d('0x21')](function(){var _0x387f8e=_0x51870f[_0x0f8d('0x36')]({'plain':!![]});var _0xf80968=_0x0f8d('0x37');return db['UserProfileResource'][_0x0f8d('0x35')]({'where':{'type':_0xf80968,'resourceId':_0x387f8e['id']}})[_0x0f8d('0x21')](function(){return _0x51870f;});})[_0x0f8d('0x21')](function(){_0x442a2e[_0x0f8d('0x38')](0xcc)[_0x0f8d('0x2c')]();});}};}function handleEntityNotFound(_0x388370,_0x27d761){return function(_0x248ac4){if(!_0x248ac4){_0x388370[_0x0f8d('0x2b')](0x194);}return _0x248ac4;};}function handleError(_0x4ce71a,_0x4553e0){_0x4553e0=_0x4553e0||0x1f4;return function(_0x91b029){logger[_0x0f8d('0x26')](_0x91b029[_0x0f8d('0x39')]);if(_0x91b029[_0x0f8d('0x3a')]){delete _0x91b029[_0x0f8d('0x3a')];}_0x4ce71a['status'](_0x4553e0)[_0x0f8d('0x3b')](_0x91b029);};}exports[_0x0f8d('0x3c')]=function(_0x3d8639,_0x80e63b){var _0x33c538={'include':[{'model':db[_0x0f8d('0x3d')],'as':_0x0f8d('0x3e')}]},_0x7462b0={},_0x56a2de={'count':0x0,'rows':[]};var _0x2a9750=_['map'](db[_0x0f8d('0x3f')][_0x0f8d('0x40')],function(_0x18c5f1){return{'name':_0x18c5f1[_0x0f8d('0x41')],'type':_0x18c5f1['type']['key']};});_0x7462b0[_0x0f8d('0x42')]=_[_0x0f8d('0x43')](_0x2a9750,_0x0f8d('0x3a'));_0x7462b0[_0x0f8d('0x44')]=_['keys'](_0x3d8639[_0x0f8d('0x44')]);_0x7462b0[_0x0f8d('0x45')]=_[_0x0f8d('0x46')](_0x7462b0[_0x0f8d('0x42')],_0x7462b0[_0x0f8d('0x44')]);_0x33c538['attributes']=_[_0x0f8d('0x46')](_0x7462b0[_0x0f8d('0x42')],qs['fields'](_0x3d8639[_0x0f8d('0x44')]['fields']));_0x33c538['attributes']=_0x33c538[_0x0f8d('0x47')][_0x0f8d('0x48')]?_0x33c538[_0x0f8d('0x47')]:_0x7462b0['model'];if(!_0x3d8639['query'][_0x0f8d('0x49')](_0x0f8d('0x4a'))){_0x33c538[_0x0f8d('0x2f')]=qs[_0x0f8d('0x2f')](_0x3d8639[_0x0f8d('0x44')]['limit']);_0x33c538[_0x0f8d('0x2d')]=qs['offset'](_0x3d8639[_0x0f8d('0x44')]['offset']);}_0x33c538[_0x0f8d('0x4b')]=qs[_0x0f8d('0x4c')](_0x3d8639[_0x0f8d('0x44')][_0x0f8d('0x4c')]);_0x33c538['where']=qs[_0x0f8d('0x45')](_[_0x0f8d('0x4d')](_0x3d8639[_0x0f8d('0x44')],_0x7462b0['filters']),_0x2a9750);if(_0x3d8639[_0x0f8d('0x44')]['filter']){_0x33c538[_0x0f8d('0x4e')]=_[_0x0f8d('0x4f')](_0x33c538[_0x0f8d('0x4e')],{'$or':_[_0x0f8d('0x43')](_0x2a9750,function(_0x235ee1){if(_0x235ee1['type']!==_0x0f8d('0x50')){var _0x123a45={};_0x123a45[_0x235ee1[_0x0f8d('0x3a')]]={'$like':'%'+_0x3d8639[_0x0f8d('0x44')][_0x0f8d('0x51')]+'%'};return _0x123a45;}})});}_0x33c538=_['merge']({},_0x33c538,_0x3d8639[_0x0f8d('0x52')]);var _0x210e1f={'where':_0x33c538[_0x0f8d('0x4e')]};return db[_0x0f8d('0x3f')]['count'](_0x210e1f)[_0x0f8d('0x21')](function(_0x218909){_0x56a2de['count']=_0x218909;if(_0x3d8639['query']['includeAll']){_0x33c538[_0x0f8d('0x53')]=[{'all':!![]}];}return db[_0x0f8d('0x3f')][_0x0f8d('0x54')](_0x33c538);})[_0x0f8d('0x21')](function(_0x30089a){_0x56a2de[_0x0f8d('0x55')]=_0x30089a;return _0x56a2de;})[_0x0f8d('0x21')](respondWithFilteredResult(_0x80e63b,_0x33c538))[_0x0f8d('0x2a')](handleError(_0x80e63b,null));};exports[_0x0f8d('0x56')]=function(_0x225328,_0x32e368){var _0x350d3c={'raw':![],'where':{'id':_0x225328[_0x0f8d('0x57')]['id']},'include':[{'model':db['Pause'],'as':_0x0f8d('0x3e')}]},_0x31868a={};_0x31868a[_0x0f8d('0x42')]=_['keys'](db[_0x0f8d('0x3f')][_0x0f8d('0x40')]);_0x31868a[_0x0f8d('0x44')]=_[_0x0f8d('0x58')](_0x225328[_0x0f8d('0x44')]);_0x31868a[_0x0f8d('0x45')]=_[_0x0f8d('0x46')](_0x31868a[_0x0f8d('0x42')],_0x31868a['query']);_0x350d3c[_0x0f8d('0x47')]=_[_0x0f8d('0x46')](_0x31868a[_0x0f8d('0x42')],qs[_0x0f8d('0x59')](_0x225328[_0x0f8d('0x44')][_0x0f8d('0x59')]));_0x350d3c[_0x0f8d('0x47')]=_0x350d3c[_0x0f8d('0x47')][_0x0f8d('0x48')]?_0x350d3c[_0x0f8d('0x47')]:_0x31868a[_0x0f8d('0x42')];if(_0x225328['query'][_0x0f8d('0x5a')]){_0x350d3c['include']=[{'all':!![]}];}_0x350d3c=_[_0x0f8d('0x4f')]({},_0x350d3c,_0x225328['options']);return db[_0x0f8d('0x3f')][_0x0f8d('0x5b')](_0x350d3c)[_0x0f8d('0x21')](handleEntityNotFound(_0x32e368,null))['then'](respondWithResult(_0x32e368,null))['catch'](handleError(_0x32e368,null));};exports[_0x0f8d('0x5c')]=function(_0x4f45be,_0x584272){return db[_0x0f8d('0x3f')][_0x0f8d('0x5c')](_0x4f45be[_0x0f8d('0x5d')],{})[_0x0f8d('0x21')](function(_0x2d057f){var _0x31f336=_0x4f45be[_0x0f8d('0x5e')]['get']({'plain':!![]});if(!_0x31f336)throw new Error(_0x0f8d('0x5f'));if(_0x31f336[_0x0f8d('0x60')]===_0x0f8d('0x5e')){var _0x44c8e=_0x2d057f[_0x0f8d('0x36')]({'plain':!![]});var _0xc77a3c='WhatsappAccounts';return db['UserProfileSection'][_0x0f8d('0x5b')]({'where':{'name':_0xc77a3c,'userProfileId':_0x31f336[_0x0f8d('0x61')]},'raw':!![]})[_0x0f8d('0x21')](function(_0x5b2e64){if(_0x5b2e64&&_0x5b2e64['autoAssociation']===0x0){return db[_0x0f8d('0x62')][_0x0f8d('0x5c')]({'name':_0x44c8e['name'],'resourceId':_0x44c8e['id'],'type':_0x5b2e64[_0x0f8d('0x3a')],'sectionId':_0x5b2e64['id']},{})[_0x0f8d('0x21')](function(){return _0x2d057f;});}else{return _0x2d057f;}})[_0x0f8d('0x2a')](function(_0x38ee64){logger[_0x0f8d('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x38ee64);throw _0x38ee64;});}return _0x2d057f;})['then'](respondWithResult(_0x584272,0xc9))[_0x0f8d('0x2a')](handleError(_0x584272,null));};exports[_0x0f8d('0x63')]=function(_0x3e8c8d,_0x427a9a){if(_0x3e8c8d[_0x0f8d('0x5d')]['id']){delete _0x3e8c8d['body']['id'];}return db[_0x0f8d('0x3f')][_0x0f8d('0x5b')]({'where':{'id':_0x3e8c8d[_0x0f8d('0x57')]['id']},'include':[{'model':db[_0x0f8d('0x3d')],'as':_0x0f8d('0x3e')}]})[_0x0f8d('0x21')](handleEntityNotFound(_0x427a9a,null))[_0x0f8d('0x21')](saveUpdates(_0x3e8c8d[_0x0f8d('0x5d')],null))[_0x0f8d('0x21')](respondWithResult(_0x427a9a,null))[_0x0f8d('0x2a')](handleError(_0x427a9a,null));};exports[_0x0f8d('0x35')]=function(_0x524f0c,_0x2d4e61){return db[_0x0f8d('0x3f')][_0x0f8d('0x5b')]({'where':{'id':_0x524f0c['params']['id']}})[_0x0f8d('0x21')](handleEntityNotFound(_0x2d4e61,null))['then'](removeEntity(_0x2d4e61,null))['catch'](handleError(_0x2d4e61,null));};exports[_0x0f8d('0x64')]=function(_0x12ffce,_0x35cd3b){return db[_0x0f8d('0x3f')][_0x0f8d('0x64')]()[_0x0f8d('0x21')](respondWithResult(_0x35cd3b,null))['catch'](handleError(_0x35cd3b,null));};exports[_0x0f8d('0x65')]=function(_0x226847,_0x3c58ef,_0xa7ffc2){if(_0x226847['body']['id']){delete _0x226847['body']['id'];}return db[_0x0f8d('0x3f')][_0x0f8d('0x5b')]({'where':{'id':_0x226847[_0x0f8d('0x57')]['id']}})[_0x0f8d('0x21')](handleEntityNotFound(_0x3c58ef,null))[_0x0f8d('0x21')](function(_0x469852){if(_0x469852){_0x226847[_0x0f8d('0x5d')]['WhatsappAccountId']=_0x469852['id'];return db[_0x0f8d('0x66')][_0x0f8d('0x5c')](_0x226847['body']);}})['then'](respondWithResult(_0x3c58ef,null))['catch'](handleError(_0x3c58ef,null));};exports[_0x0f8d('0x67')]=function(_0x158634,_0x303b94,_0x102cb9){var _0x249b4a={'raw':![],'where':{}};var _0x4a65b0={};var _0x1c949a={'count':0x0,'rows':[]};return db[_0x0f8d('0x3f')]['findOne']({'where':{'id':_0x158634[_0x0f8d('0x57')]['id']}})[_0x0f8d('0x21')](handleEntityNotFound(_0x303b94,null))['then'](function(_0x4d496c){if(_0x4d496c){_0x4a65b0['model']=_[_0x0f8d('0x58')](db['Disposition'][_0x0f8d('0x40')]);_0x4a65b0[_0x0f8d('0x44')]=_[_0x0f8d('0x58')](_0x158634[_0x0f8d('0x44')]);_0x4a65b0[_0x0f8d('0x45')]=_[_0x0f8d('0x46')](_0x4a65b0[_0x0f8d('0x42')],_0x4a65b0[_0x0f8d('0x44')]);_0x249b4a[_0x0f8d('0x47')]=_[_0x0f8d('0x46')](_0x4a65b0[_0x0f8d('0x42')],qs[_0x0f8d('0x59')](_0x158634[_0x0f8d('0x44')][_0x0f8d('0x59')]));_0x249b4a['attributes']=_0x249b4a[_0x0f8d('0x47')]['length']?_0x249b4a[_0x0f8d('0x47')]:_0x4a65b0[_0x0f8d('0x42')];if(!_0x158634[_0x0f8d('0x44')][_0x0f8d('0x49')]('nolimit')){_0x249b4a[_0x0f8d('0x2f')]=qs['limit'](_0x158634[_0x0f8d('0x44')][_0x0f8d('0x2f')]);_0x249b4a[_0x0f8d('0x2d')]=qs[_0x0f8d('0x2d')](_0x158634[_0x0f8d('0x44')]['offset']);}_0x249b4a[_0x0f8d('0x4b')]=qs[_0x0f8d('0x4c')](_0x158634[_0x0f8d('0x44')][_0x0f8d('0x4c')]);_0x249b4a[_0x0f8d('0x4e')]=qs[_0x0f8d('0x45')](_[_0x0f8d('0x4d')](_0x158634[_0x0f8d('0x44')],_0x4a65b0['filters']));_0x249b4a[_0x0f8d('0x4e')][_0x0f8d('0x68')]=_0x4d496c['id'];if(_0x158634[_0x0f8d('0x44')][_0x0f8d('0x51')]){_0x249b4a[_0x0f8d('0x4e')]=_[_0x0f8d('0x4f')](_0x249b4a[_0x0f8d('0x4e')],{'$or':_['map'](_0x249b4a['attributes'],function(_0x30894c){var _0x37c80f={};_0x37c80f[_0x30894c]={'$like':'%'+_0x158634[_0x0f8d('0x44')][_0x0f8d('0x51')]+'%'};return _0x37c80f;})});}_0x249b4a=_[_0x0f8d('0x4f')]({},_0x249b4a,_0x158634['options']);return db[_0x0f8d('0x66')]['count']({'where':_0x249b4a['where']})[_0x0f8d('0x21')](function(_0x5656dd){_0x1c949a[_0x0f8d('0x30')]=_0x5656dd;if(_0x158634[_0x0f8d('0x44')][_0x0f8d('0x5a')]){_0x249b4a[_0x0f8d('0x53')]=[{'all':!![]}];}return db[_0x0f8d('0x66')][_0x0f8d('0x54')](_0x249b4a);})[_0x0f8d('0x21')](function(_0x8b2314){_0x1c949a[_0x0f8d('0x55')]=_0x8b2314;return _0x1c949a;});}})['then'](respondWithFilteredResult(_0x303b94,_0x249b4a))[_0x0f8d('0x2a')](handleError(_0x303b94,null));};exports['removeDispositions']=function(_0x14fe21,_0x54bd92,_0x4ae408){return db[_0x0f8d('0x3f')][_0x0f8d('0x5b')]({'where':{'id':_0x14fe21[_0x0f8d('0x57')]['id']}})[_0x0f8d('0x21')](handleEntityNotFound(_0x54bd92,null))[_0x0f8d('0x21')](function(_0x58e45d){if(_0x58e45d){return _0x58e45d[_0x0f8d('0x69')](_0x14fe21[_0x0f8d('0x44')]['ids']);}})['then'](respondWithStatusCode(_0x54bd92,null))[_0x0f8d('0x2a')](handleError(_0x54bd92,null));};exports[_0x0f8d('0x6a')]=function(_0xda13c4,_0x3f780a,_0x414922){if(_0xda13c4[_0x0f8d('0x5d')]['id']){delete _0xda13c4[_0x0f8d('0x5d')]['id'];}return db[_0x0f8d('0x3f')][_0x0f8d('0x5b')]({'where':{'id':_0xda13c4['params']['id']}})[_0x0f8d('0x21')](handleEntityNotFound(_0x3f780a,null))[_0x0f8d('0x21')](function(_0x4fb982){if(_0x4fb982){_0xda13c4[_0x0f8d('0x5d')][_0x0f8d('0x68')]=_0x4fb982['id'];return db[_0x0f8d('0x6b')][_0x0f8d('0x5c')](_0xda13c4[_0x0f8d('0x5d')]);}})[_0x0f8d('0x21')](respondWithResult(_0x3f780a,null))['catch'](handleError(_0x3f780a,null));};exports[_0x0f8d('0x6c')]=function(_0x38437b,_0x23add3,_0x2e049e){var _0x50050b={'raw':![],'where':{}};var _0x553dfc={};var _0x362d80={'count':0x0,'rows':[]};return db['WhatsappAccount']['findOne']({'where':{'id':_0x38437b[_0x0f8d('0x57')]['id']}})['then'](handleEntityNotFound(_0x23add3,null))[_0x0f8d('0x21')](function(_0x18cc90){if(_0x18cc90){_0x553dfc[_0x0f8d('0x42')]=_['keys'](db['CannedAnswer'][_0x0f8d('0x40')]);_0x553dfc[_0x0f8d('0x44')]=_['keys'](_0x38437b[_0x0f8d('0x44')]);_0x553dfc['filters']=_['intersection'](_0x553dfc['model'],_0x553dfc['query']);_0x50050b[_0x0f8d('0x47')]=_[_0x0f8d('0x46')](_0x553dfc['model'],qs[_0x0f8d('0x59')](_0x38437b['query'][_0x0f8d('0x59')]));_0x50050b[_0x0f8d('0x47')]=_0x50050b[_0x0f8d('0x47')][_0x0f8d('0x48')]?_0x50050b[_0x0f8d('0x47')]:_0x553dfc[_0x0f8d('0x42')];if(!_0x38437b[_0x0f8d('0x44')][_0x0f8d('0x49')](_0x0f8d('0x4a'))){_0x50050b[_0x0f8d('0x2f')]=qs[_0x0f8d('0x2f')](_0x38437b[_0x0f8d('0x44')]['limit']);_0x50050b[_0x0f8d('0x2d')]=qs[_0x0f8d('0x2d')](_0x38437b['query']['offset']);}_0x50050b[_0x0f8d('0x4b')]=qs[_0x0f8d('0x4c')](_0x38437b[_0x0f8d('0x44')]['sort']);_0x50050b[_0x0f8d('0x4e')]=qs[_0x0f8d('0x45')](_[_0x0f8d('0x4d')](_0x38437b[_0x0f8d('0x44')],_0x553dfc[_0x0f8d('0x45')]));_0x50050b['where'][_0x0f8d('0x68')]=_0x18cc90['id'];if(_0x38437b[_0x0f8d('0x44')]['filter']){_0x50050b[_0x0f8d('0x4e')]=_['merge'](_0x50050b[_0x0f8d('0x4e')],{'$or':_[_0x0f8d('0x43')](_0x50050b[_0x0f8d('0x47')],function(_0x14ea3f){var _0x3e196a={};_0x3e196a[_0x14ea3f]={'$like':'%'+_0x38437b['query']['filter']+'%'};return _0x3e196a;})});}_0x50050b=_[_0x0f8d('0x4f')]({},_0x50050b,_0x38437b[_0x0f8d('0x52')]);return db[_0x0f8d('0x6b')]['count']({'where':_0x50050b[_0x0f8d('0x4e')]})[_0x0f8d('0x21')](function(_0x595afd){_0x362d80[_0x0f8d('0x30')]=_0x595afd;if(_0x38437b[_0x0f8d('0x44')]['includeAll']){_0x50050b[_0x0f8d('0x53')]=[{'all':!![]}];}return db[_0x0f8d('0x6b')][_0x0f8d('0x54')](_0x50050b);})[_0x0f8d('0x21')](function(_0x2423e1){_0x362d80[_0x0f8d('0x55')]=_0x2423e1;return _0x362d80;});}})[_0x0f8d('0x21')](respondWithFilteredResult(_0x23add3,_0x50050b))[_0x0f8d('0x2a')](handleError(_0x23add3,null));};exports['removeAnswers']=function(_0x4e34ea,_0x533c83,_0x58ebe){return db[_0x0f8d('0x3f')][_0x0f8d('0x5b')]({'where':{'id':_0x4e34ea[_0x0f8d('0x57')]['id']}})['then'](handleEntityNotFound(_0x533c83,null))[_0x0f8d('0x21')](function(_0x31d438){if(_0x31d438){return _0x31d438[_0x0f8d('0x6d')](_0x4e34ea[_0x0f8d('0x44')][_0x0f8d('0x6e')]);}})[_0x0f8d('0x21')](respondWithStatusCode(_0x533c83,null))[_0x0f8d('0x2a')](handleError(_0x533c83,null));};exports[_0x0f8d('0x6f')]=function(_0x544941,_0x446ce2,_0x59fde0){return db['WhatsappAccount'][_0x0f8d('0x5b')]({'where':{'id':_0x544941[_0x0f8d('0x57')]['id']}})['then'](handleEntityNotFound(_0x446ce2,null))[_0x0f8d('0x21')](function(_0x3a5163){if(_0x3a5163){return _0x3a5163[_0x0f8d('0x6f')](_0x544941[_0x0f8d('0x5d')][_0x0f8d('0x6e')],_[_0x0f8d('0x70')](_0x544941[_0x0f8d('0x5d')],['ids','id'])||{})[_0x0f8d('0x71')](function(_0x3e1422){for(var _0x37ce37=0x0;_0x37ce37<_0x544941[_0x0f8d('0x5d')][_0x0f8d('0x6e')][_0x0f8d('0x48')];_0x37ce37+=0x1){socket[_0x0f8d('0x72')](_0x0f8d('0x73'),{'UserId':Number(_0x544941['body'][_0x0f8d('0x6e')][_0x37ce37]),'WhatsappAccountId':Number(_0x544941[_0x0f8d('0x57')]['id'])});}return _0x3e1422;});}})['then'](respondWithResult(_0x446ce2,null))[_0x0f8d('0x2a')](handleError(_0x446ce2,null));};exports[_0x0f8d('0x74')]=function(_0x4a8ecd,_0x3a5a3b,_0x2a14a7){return db['WhatsappAccount']['find']({'where':{'id':_0x4a8ecd['params']['id']}})['then'](handleEntityNotFound(_0x3a5a3b,null))[_0x0f8d('0x21')](function(_0x118415){if(_0x118415){return _0x118415[_0x0f8d('0x74')](_0x4a8ecd[_0x0f8d('0x44')]['ids'])[_0x0f8d('0x21')](function(){if(_[_0x0f8d('0x75')](_0x4a8ecd[_0x0f8d('0x44')][_0x0f8d('0x6e')])){for(var _0x121e12=0x0;_0x121e12<_0x4a8ecd['query'][_0x0f8d('0x6e')][_0x0f8d('0x48')];_0x121e12+=0x1){socket[_0x0f8d('0x72')](_0x0f8d('0x76'),{'UserId':Number(_0x4a8ecd['query'][_0x0f8d('0x6e')][_0x121e12]),'WhatsappAccountId':Number(_0x4a8ecd[_0x0f8d('0x57')]['id'])});}}else{socket[_0x0f8d('0x72')](_0x0f8d('0x76'),{'UserId':Number(_0x4a8ecd[_0x0f8d('0x44')]['ids']),'WhatsappAccountId':Number(_0x4a8ecd[_0x0f8d('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x3a5a3b,null))[_0x0f8d('0x2a')](handleError(_0x3a5a3b,null));};exports['getAgents']=function(_0x3cfe98,_0x30821f,_0x49c6b1){var _0x2f6973={};var _0x4e2e20={};var _0x3b3ed6;var _0x4d1373;return db[_0x0f8d('0x3f')][_0x0f8d('0x77')]({'where':{'id':_0x3cfe98[_0x0f8d('0x57')]['id']}})[_0x0f8d('0x21')](handleEntityNotFound(_0x30821f,null))[_0x0f8d('0x21')](function(_0x4ec2f0){if(_0x4ec2f0){_0x3b3ed6=_0x4ec2f0;_0x4e2e20[_0x0f8d('0x42')]=_[_0x0f8d('0x58')](db[_0x0f8d('0x78')]['rawAttributes']);_0x4e2e20['query']=_['keys'](_0x3cfe98[_0x0f8d('0x44')]);_0x4e2e20[_0x0f8d('0x45')]=_[_0x0f8d('0x46')](_0x4e2e20[_0x0f8d('0x42')],_0x4e2e20['query']);_0x2f6973['attributes']=_[_0x0f8d('0x46')](_0x4e2e20[_0x0f8d('0x42')],qs['fields'](_0x3cfe98[_0x0f8d('0x44')][_0x0f8d('0x59')]));_0x2f6973[_0x0f8d('0x47')]=_0x2f6973['attributes']['length']?_0x2f6973[_0x0f8d('0x47')]:_0x4e2e20[_0x0f8d('0x42')];_0x2f6973['order']=qs[_0x0f8d('0x4c')](_0x3cfe98['query'][_0x0f8d('0x4c')]);_0x2f6973[_0x0f8d('0x4e')]=qs[_0x0f8d('0x45')](_[_0x0f8d('0x4d')](_0x3cfe98[_0x0f8d('0x44')],_0x4e2e20[_0x0f8d('0x45')]));if(_0x3cfe98[_0x0f8d('0x44')][_0x0f8d('0x51')]){_0x2f6973[_0x0f8d('0x4e')]=_['merge'](_0x2f6973[_0x0f8d('0x4e')],{'$or':_[_0x0f8d('0x43')](_0x2f6973[_0x0f8d('0x47')],function(_0x2a8df7){var _0x350c60={};_0x350c60[_0x2a8df7]={'$like':'%'+_0x3cfe98['query']['filter']+'%'};return _0x350c60;})});}_0x2f6973=_[_0x0f8d('0x4f')]({},_0x2f6973,_0x3cfe98[_0x0f8d('0x52')]);return _0x3b3ed6[_0x0f8d('0x79')](_0x2f6973);}})[_0x0f8d('0x21')](function(_0x27fd31){if(_0x27fd31){_0x4d1373=_0x27fd31[_0x0f8d('0x48')];if(!_0x3cfe98['query'][_0x0f8d('0x49')](_0x0f8d('0x4a'))){_0x2f6973[_0x0f8d('0x2f')]=qs[_0x0f8d('0x2f')](_0x3cfe98[_0x0f8d('0x44')][_0x0f8d('0x2f')]);_0x2f6973[_0x0f8d('0x2d')]=qs['offset'](_0x3cfe98[_0x0f8d('0x44')][_0x0f8d('0x2d')]);}return _0x3b3ed6[_0x0f8d('0x79')](_0x2f6973);}})[_0x0f8d('0x21')](function(_0x359a07){if(_0x359a07){return _0x359a07?{'count':_0x4d1373,'rows':_0x359a07}:null;}})[_0x0f8d('0x21')](respondWithResult(_0x30821f,null))[_0x0f8d('0x2a')](handleError(_0x30821f,null));};exports[_0x0f8d('0x7a')]=function(_0x817ea1,_0x19cd00){var _0xe2be3d=_0x817ea1[_0x0f8d('0x57')]['id'];var _0x62311f=_0x817ea1[_0x0f8d('0x5d')];var _0x139e69=0xc8;var _0x513e10=null;return db[_0x0f8d('0x7b')][_0x0f8d('0x7c')]({'isolationLevel':db[_0x0f8d('0x7b')]['Transaction'][_0x0f8d('0x7d')][_0x0f8d('0x7e')]},function(_0xbbb1ff){return db[_0x0f8d('0x3f')][_0x0f8d('0x77')]({'where':{'id':_0xe2be3d},'transaction':_0xbbb1ff})['then'](function(_0x34d12c){if(_0x34d12c){return db[_0x0f8d('0x7f')]['destroy']({'where':{'WhatsappAccountId':_0xe2be3d},'transaction':_0xbbb1ff})[_0x0f8d('0x21')](function(){var _0x342c1b=_[_0x0f8d('0x43')](_0x62311f,function(_0x24f724){_0x24f724[_0x0f8d('0x68')]=_0xe2be3d;return _0x24f724;});return db[_0x0f8d('0x7f')][_0x0f8d('0x80')](_0x342c1b,{'transaction':_0xbbb1ff});});}else{_0x139e69=0x194;_0x513e10=[];}});})[_0x0f8d('0x21')](function(){if(_0x139e69!==0x194){return db[_0x0f8d('0x7f')][_0x0f8d('0x81')]({'where':{'WhatsappAccountId':_0xe2be3d},'order':_0x0f8d('0x82')})[_0x0f8d('0x21')](function(_0x274484){_0x513e10=_0x274484;});}})[_0x0f8d('0x2a')](function(_0x5ec0f0){_0x139e69=0x1f4;logger[_0x0f8d('0x26')](_0x5ec0f0[_0x0f8d('0x39')]);if(_0x5ec0f0['name']){delete _0x5ec0f0[_0x0f8d('0x3a')];}_0x513e10=_0x5ec0f0;})[_0x0f8d('0x83')](function(){if(_0x513e10===null){_0x19cd00[_0x0f8d('0x2b')](_0x139e69);}else{if(_0x139e69===0x1f4){_0x19cd00[_0x0f8d('0x38')](_0x139e69)[_0x0f8d('0x3b')](_0x513e10);}else{_0x19cd00['status'](_0x139e69)[_0x0f8d('0x84')](_0x513e10);}}});};exports['getApplications']=function(_0x2f752e,_0x5d67ef,_0x436e6e){var _0x88e01e={};var _0x5949c2={};var _0x56508e;var _0x4dba60;return db[_0x0f8d('0x3f')]['findOne']({'where':{'id':_0x2f752e[_0x0f8d('0x57')]['id']}})[_0x0f8d('0x21')](handleEntityNotFound(_0x5d67ef,null))[_0x0f8d('0x21')](function(_0x425d83){if(_0x425d83){_0x56508e=_0x425d83;_0x5949c2[_0x0f8d('0x42')]=_[_0x0f8d('0x58')](db[_0x0f8d('0x7f')][_0x0f8d('0x40')]);_0x5949c2[_0x0f8d('0x44')]=_['keys'](_0x2f752e['query']);_0x5949c2[_0x0f8d('0x45')]=_[_0x0f8d('0x46')](_0x5949c2[_0x0f8d('0x42')],_0x5949c2[_0x0f8d('0x44')]);_0x88e01e[_0x0f8d('0x47')]=_['intersection'](_0x5949c2[_0x0f8d('0x42')],qs[_0x0f8d('0x59')](_0x2f752e[_0x0f8d('0x44')]['fields']));_0x88e01e['attributes']=_0x88e01e[_0x0f8d('0x47')][_0x0f8d('0x48')]?_0x88e01e[_0x0f8d('0x47')]:_0x5949c2[_0x0f8d('0x42')];_0x88e01e[_0x0f8d('0x4b')]=qs[_0x0f8d('0x4c')](_0x2f752e[_0x0f8d('0x44')][_0x0f8d('0x4c')]);_0x88e01e[_0x0f8d('0x4e')]=qs[_0x0f8d('0x45')](_[_0x0f8d('0x4d')](_0x2f752e[_0x0f8d('0x44')],_0x5949c2[_0x0f8d('0x45')]));if(_0x2f752e['query']['filter']){_0x88e01e[_0x0f8d('0x4e')]=_['merge'](_0x88e01e[_0x0f8d('0x4e')],{'$or':_[_0x0f8d('0x43')](_0x88e01e[_0x0f8d('0x47')],function(_0x4bda6a){var _0x4314d1={};_0x4314d1[_0x4bda6a]={'$like':'%'+_0x2f752e[_0x0f8d('0x44')][_0x0f8d('0x51')]+'%'};return _0x4314d1;})});}_0x88e01e=_[_0x0f8d('0x4f')]({},_0x88e01e,_0x2f752e[_0x0f8d('0x52')]);return _0x56508e[_0x0f8d('0x85')](_0x88e01e);}})['then'](function(_0x1173c7){if(_0x1173c7){_0x4dba60=_0x1173c7[_0x0f8d('0x48')];if(!_0x2f752e[_0x0f8d('0x44')][_0x0f8d('0x49')](_0x0f8d('0x4a'))){_0x88e01e['limit']=qs[_0x0f8d('0x2f')](_0x2f752e[_0x0f8d('0x44')][_0x0f8d('0x2f')]);_0x88e01e[_0x0f8d('0x2d')]=qs[_0x0f8d('0x2d')](_0x2f752e[_0x0f8d('0x44')]['offset']);}return _0x56508e[_0x0f8d('0x85')](_0x88e01e);}})[_0x0f8d('0x21')](function(_0x17c1da){if(_0x17c1da){return _0x17c1da?{'count':_0x4dba60,'rows':_0x17c1da}:null;}})[_0x0f8d('0x21')](respondWithResult(_0x5d67ef,null))[_0x0f8d('0x2a')](handleError(_0x5d67ef,null));};exports[_0x0f8d('0x86')]=function(_0x30e2d6,_0x31a57d,_0x2ac88b){var _0x5d28ef={'channel':'whatsapp'};var _0x2c8baf=[];var _0x420cea=[];var _0x30da59={};return db[_0x0f8d('0x3f')]['find']({'where':{'id':_0x30e2d6['params']['id']},'include':[{'model':db[_0x0f8d('0x7f')],'as':'Applications'}]})['then'](handleEntityNotFound(_0x31a57d,null))[_0x0f8d('0x21')](function(_0xff85c){_0x5d28ef['account']=_0xff85c;if(_0x5d28ef[_0x0f8d('0x87')]&&_0x5d28ef[_0x0f8d('0x87')][_0x0f8d('0x88')]==='sinch'&&_0x30e2d6[_0x0f8d('0x5d')]['statuses']){if(_0x30e2d6[_0x0f8d('0x5d')][_0x0f8d('0x89')][_0x0f8d('0x48')]===0x0)return;if(_0x30e2d6[_0x0f8d('0x5d')]['statuses'][0x0]['state']!=='read')return;return db[_0x0f8d('0x8a')]['update']({'read':!![],'readAt':_0x30e2d6[_0x0f8d('0x5d')]['statuses'][0x0]['timestamp']},{'where':{'messageId':_0x30e2d6[_0x0f8d('0x5d')][_0x0f8d('0x89')][0x0][_0x0f8d('0x8b')]},'individualHooks':!![]})[_0x0f8d('0x21')](function(_0x2fdf75){return _0x31a57d[_0x0f8d('0x38')](0xc8)[_0x0f8d('0x84')](_0x2fdf75);});}_0x5d28ef['applications']=_[_0x0f8d('0x8c')](_0xff85c[_0x0f8d('0x8d')],['priority'],[_0x0f8d('0x8e')]);if(_0x5d28ef['account'][_0x0f8d('0x8d')]){delete _0x5d28ef[_0x0f8d('0x87')][_0x0f8d('0x8d')];}return db['CmContact']['describe']()[_0x0f8d('0x21')](function(_0x57c265){if(!_0x57c265){throw new db[(_0x0f8d('0x8f'))][(_0x0f8d('0x90'))](_0x0f8d('0x91'));}_0x2c8baf=_[_0x0f8d('0x92')](_['keys'](_0x57c265),[_0x0f8d('0x93'),'updatedAt']);_0x420cea=_[_0x0f8d('0x92')](_[_0x0f8d('0x58')](_0x57c265),[_0x0f8d('0x93'),_0x0f8d('0x94'),_0x0f8d('0x95'),_0x0f8d('0x96')]);_0x5d28ef['body']={'mapKey':'mobile'};if(_0x5d28ef[_0x0f8d('0x87')]&&_0x5d28ef[_0x0f8d('0x87')]['type']==='twilio'){_0x5d28ef[_0x0f8d('0x5d')][_0x0f8d('0x97')]=_0x30e2d6[_0x0f8d('0x5d')][_0x0f8d('0x98')][_0x0f8d('0x99')](_0x0f8d('0x9a'),'');_0x5d28ef[_0x0f8d('0x5d')]['body']=_0x30e2d6[_0x0f8d('0x5d')]['Body'];_0x5d28ef['body'][_0x0f8d('0x9b')]=_0x30e2d6[_0x0f8d('0x5d')][_0x0f8d('0x9c')];}if(_0x5d28ef['account']&&_0x5d28ef[_0x0f8d('0x87')][_0x0f8d('0x88')]===_0x0f8d('0x9d')){_0x5d28ef[_0x0f8d('0x5d')][_0x0f8d('0x97')]=_0x30e2d6[_0x0f8d('0x5d')][_0x0f8d('0x9e')][0x0]['from'];_0x5d28ef[_0x0f8d('0x5d')][_0x0f8d('0x5d')]=_0x30e2d6[_0x0f8d('0x5d')][_0x0f8d('0x9e')][0x0][_0x0f8d('0x28')][_0x0f8d('0x5d')];_0x5d28ef['body']['messageId']=_0x30e2d6['body']['notifications'][0x0]['message_id'];}if(_0x5d28ef['body']['id']){delete _0x5d28ef[_0x0f8d('0x5d')]['id'];}if(_[_0x0f8d('0x9f')](_0x5d28ef[_0x0f8d('0x5d')][_0x0f8d('0x97')])){throw new db[(_0x0f8d('0x8f'))][(_0x0f8d('0x90'))](_0x0f8d('0xa0'));}if(_[_0x0f8d('0x9f')](_0x5d28ef[_0x0f8d('0x5d')][_0x0f8d('0x5d')])||_0x5d28ef['body']['body']===''){throw new db['Sequelize'][(_0x0f8d('0x90'))](_0x0f8d('0xa1'));}if(_['isNil'](_0x5d28ef[_0x0f8d('0x5d')][_0x0f8d('0xa2')])){throw new db[(_0x0f8d('0x8f'))][(_0x0f8d('0x90'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x420cea);}if(!_['includes'](_0x420cea,_0x5d28ef['body'][_0x0f8d('0xa2')])){throw new db[(_0x0f8d('0x8f'))][(_0x0f8d('0x90'))](_0x0f8d('0xa3')+_0x420cea);}_0x30da59[_0x5d28ef[_0x0f8d('0x5d')][_0x0f8d('0xa2')]]=_0x5d28ef['body'][_0x0f8d('0x97')];return db[_0x0f8d('0xa4')][_0x0f8d('0x5b')]({'where':{'id':_0x5d28ef[_0x0f8d('0x87')][_0x0f8d('0x96')]},'include':[{'model':db['CmContact'],'as':_0x0f8d('0xa5'),'where':_0x30da59,'limit':0x1,'order':[['updatedAt',_0x0f8d('0xa6')]]}]});})[_0x0f8d('0x21')](handleEntityNotFound(_0x31a57d,null))[_0x0f8d('0x21')](function(_0x5c145c){if(_0x5c145c){_0x5d28ef[_0x0f8d('0xa7')]=_[_0x0f8d('0x70')](_0x5c145c,['Contacts']);if(_0x5c145c[_0x0f8d('0xa5')][_0x0f8d('0x48')]){return _0x5c145c[_0x0f8d('0xa5')][0x0];}var _0x5d4099=_[_0x0f8d('0xa8')](_0x5d28ef['body'],{'firstName':_0x5d28ef[_0x0f8d('0x5d')][_0x0f8d('0x97')],'ListId':_0x5c145c['id']});_0x5d4099[_0x5d28ef[_0x0f8d('0x5d')][_0x0f8d('0xa2')]]=_0x5d28ef[_0x0f8d('0x5d')]['from'];return db['CmContact'][_0x0f8d('0x5c')](_0x5d4099,{'fields':_0x2c8baf,'raw':!![]});}})[_0x0f8d('0x21')](handleEntityNotFound(_0x31a57d,null))['then'](function(_0x37ca8a){if(_0x37ca8a){_0x5d28ef[_0x0f8d('0xa9')]=_0x37ca8a;var _0x4699bf={'ContactId':_0x37ca8a['id'],'phone':_0x5d28ef[_0x0f8d('0x5d')][_0x0f8d('0x97')],'WhatsappAccountId':_0x30e2d6[_0x0f8d('0x57')]['id']};var _0x2d848a={'ContactId':_0x37ca8a['id'],'WhatsappAccountId':_0x30e2d6['params']['id'],'closed':![]};return db[_0x0f8d('0xaa')][_0x0f8d('0x5b')]({'where':_0x2d848a})[_0x0f8d('0x21')](function(_0x3627b9){if(_0x3627b9){return[_0x3627b9,![]];}return db[_0x0f8d('0xaa')][_0x0f8d('0x5c')](_0x4699bf)[_0x0f8d('0x21')](function(_0x3f86d1){return[_0x3f86d1,!![]];});});}})['spread'](function(_0x5d4cb5,_0x2a9f06){_0x5d28ef[_0x0f8d('0xab')]=_0x5d4cb5[_0x0f8d('0x36')]({'plain':!![]});_0x5d28ef['interaction'][_0x0f8d('0xac')]=![];if(_0x2a9f06){if(_0x5d28ef[_0x0f8d('0x87')][_0x0f8d('0xad')]){_0x5d28ef[_0x0f8d('0xae')][_0x0f8d('0xaf')]({'id':0x0,'priority':_0x5d28ef[_0x0f8d('0xae')]['length']+0x1,'app':_0x0f8d('0xb0'),'appdata':_0x0f8d('0xb1'),'interval':'*,*,*,*'});}_0x5d28ef[_0x0f8d('0xab')][_0x0f8d('0xac')]=!![];}return db[_0x0f8d('0x8a')][_0x0f8d('0x5c')]({'phone':_0x5d28ef['body'][_0x0f8d('0x97')],'messageId':_0x5d28ef['body'][_0x0f8d('0x9b')],'body':_0x5d28ef[_0x0f8d('0x5d')][_0x0f8d('0x5d')],'WhatsappAccountId':_0x30e2d6[_0x0f8d('0x57')]['id'],'WhatsappInteractionId':_0x5d4cb5['id'],'direction':'in','ContactId':_0x5d4cb5[_0x0f8d('0xb2')],'AttachmentId':_0x5d28ef[_0x0f8d('0x5d')][_0x0f8d('0xb3')]});})[_0x0f8d('0x21')](function(_0x208312){_0x5d28ef['message']=_0x208312;if(!_0x5d28ef[_0x0f8d('0xab')]['UserId'])return;return db[_0x0f8d('0x78')][_0x0f8d('0x5b')]({'attributes':['id',_0x0f8d('0x3a')],'where':{'id':_0x5d28ef[_0x0f8d('0xab')][_0x0f8d('0xb4')]}});})['then'](function(_0x2d1199){if(_0x2d1199){_0x5d28ef[_0x0f8d('0xae')]['unshift']({'id':0x0,'priority':0x0,'app':_0x0f8d('0xb5'),'appdata':_0x2d1199[_0x0f8d('0x3a')]+','+(_0x5d28ef['account'][_0x0f8d('0xb6')]||0xa),'interval':'*,*,*,*'});}if(!_0x5d28ef[_0x0f8d('0xab')]['queueId'])return;return db[_0x0f8d('0xb7')][_0x0f8d('0x5b')]({'attributes':['id',_0x0f8d('0x3a')],'where':{'id':_0x5d28ef['interaction']['queueId']}});})[_0x0f8d('0x21')](function(_0x3ffa5b){if(_0x3ffa5b){_0x5d28ef[_0x0f8d('0xae')][_0x0f8d('0xb8')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x3ffa5b['name']+','+(_0x5d28ef[_0x0f8d('0x87')][_0x0f8d('0xb9')]||0x12c),'interval':_0x0f8d('0xba')});}return respondWithRpcPromise(_0x0f8d('0xbb'),_0x0f8d('0xbc'),_0x5d28ef);})['then'](function(_0xcd7194){if(_0xcd7194){var _0x23b2f8=0xc8;var _0x3552dc=_0x0f8d('0xbd');logger['info']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x3552dc,_0x23b2f8,_0x0f8d('0xbe'));logger[_0x0f8d('0x24')](_0x0f8d('0xbf'),_0x3552dc,_0x23b2f8,_0x0f8d('0xbe'),JSON[_0x0f8d('0xc0')](_0xcd7194));if(_0x5d28ef[_0x0f8d('0x87')][_0x0f8d('0x88')]===_0x0f8d('0xc1')){return _0x31a57d['status'](_0x23b2f8)[_0x0f8d('0xc2')]('Content-Type','text/xml')['send'](_0x0f8d('0xc3'));}else{return _0x31a57d[_0x0f8d('0x38')](_0x23b2f8)[_0x0f8d('0x84')](_0xcd7194);}}});})['catch'](handleError(_0x31a57d,null));};exports[_0x0f8d('0x3b')]=function(_0x400249,_0x13b57e,_0x2185ec){var _0x269f30,_0x5c1ef6,_0x1c4512;if(_[_0x0f8d('0x9f')](_0x400249[_0x0f8d('0x5d')][_0x0f8d('0x5d')])||_0x400249[_0x0f8d('0x5d')][_0x0f8d('0x5d')]===''){throw new db['Sequelize'][(_0x0f8d('0x90'))](_0x0f8d('0xa1'));}if(_[_0x0f8d('0x9f')](_0x400249[_0x0f8d('0x5d')]['to'])){throw new db[(_0x0f8d('0x8f'))][(_0x0f8d('0x90'))]('to\x20is\x20mandatory');}_0x269f30=_0x400249[_0x0f8d('0x5d')]['to'];return db['WhatsappAccount'][_0x0f8d('0x5b')]({'where':{'id':_0x400249[_0x0f8d('0x57')]['id']},'include':[{'model':db['CmList'],'as':_0x0f8d('0xc4'),'include':[{'model':db['CmContact'],'as':_0x0f8d('0xa5'),'where':{'mobile':_0x269f30},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})['then'](handleEntityNotFound(_0x13b57e,null))[_0x0f8d('0x21')](function(_0x12fd73){if(_0x12fd73&&_0x12fd73[_0x0f8d('0xc4')]){_0x5c1ef6=_0x12fd73[_0x0f8d('0x36')]({'plain':!![]});if(_0x5c1ef6[_0x0f8d('0xc4')]&&_0x5c1ef6['List'][_0x0f8d('0xa5')][_0x0f8d('0x48')]){return _0x5c1ef6['List']['Contacts'][0x0];}return db[_0x0f8d('0xc5')][_0x0f8d('0x5c')](_[_0x0f8d('0xa8')](_0x400249[_0x0f8d('0x5d')],{'firstName':_0x269f30,'mobile':_0x269f30,'phone':_0x269f30,'ListId':_0x5c1ef6['ListId']}));}})[_0x0f8d('0x21')](handleEntityNotFound(_0x13b57e,null))[_0x0f8d('0x21')](function(_0x42164d){if(_0x42164d){_0x1c4512=_0x42164d;return db[_0x0f8d('0xaa')]['find']({'where':{'ContactId':_0x1c4512['id'],'closed':![],'WhatsappAccountId':_0x5c1ef6['id']}})[_0x0f8d('0x21')](function(_0x361fba){if(_0x361fba){return[_0x361fba,![]];}return db[_0x0f8d('0xaa')]['create']({'UserId':_0x400249[_0x0f8d('0x5e')]['id'],'ContactId':_0x1c4512['id'],'WhatsappAccountId':_0x5c1ef6['id'],'phone':_0x269f30,'firstMsgDirection':_0x0f8d('0xc6'),'Messages':[_[_0x0f8d('0x4f')](_0x400249[_0x0f8d('0x5d')],{'read':![],'body':_0x400249[_0x0f8d('0x5d')][_0x0f8d('0x5d')],'phone':_0x269f30,'WhatsappAccountId':_0x5c1ef6['id'],'UserId':_0x400249[_0x0f8d('0x5e')]['id'],'ContactId':_0x1c4512['id']})]},{'include':[{'model':db[_0x0f8d('0x8a')],'as':'Messages'}]})['then'](function(_0x5abe43){return[_0x5abe43,!![]];});});}})[_0x0f8d('0x71')](function(_0x3d8a46,_0x275639){if(_0x275639){return _0x3d8a46;}return db['WhatsappMessage']['create'](_[_0x0f8d('0x4f')](_0x400249[_0x0f8d('0x5d')],{'read':![],'body':_0x400249[_0x0f8d('0x5d')]['body'],'phone':_0x269f30,'WhatsappAccountId':_0x5c1ef6['id'],'WhatsappInteractionId':_0x3d8a46['id'],'UserId':_0x400249[_0x0f8d('0x5e')]['id'],'ContactId':_0x1c4512['id']}))['then'](function(_0x405d0f){_0x3d8a46[_0x0f8d('0xc7')]['Messages']=[];_0x3d8a46[_0x0f8d('0xc7')][_0x0f8d('0xc8')][_0x0f8d('0xaf')](_0x405d0f[_0x0f8d('0xc7')]);return _0x3d8a46;});})[_0x0f8d('0x21')](respondWithResult(_0x13b57e,null))[_0x0f8d('0x2a')](handleError(_0x13b57e,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index ab74cdb..50ea772 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 _0xe3dd=['../../mysqldb','WhatsappAccount','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x2835e1,_0x4ccc9e){var _0x3a0e3b=function(_0x4da542){while(--_0x4da542){_0x2835e1['push'](_0x2835e1['shift']());}};_0x3a0e3b(++_0x4ccc9e);}(_0xe3dd,0x1b7));var _0xde3d=function(_0x5d722c,_0x4d65d4){_0x5d722c=_0x5d722c-0x0;var _0x37046b=_0xe3dd[_0x5d722c];return _0x37046b;};'use strict';var EventEmitter=require(_0xde3d('0x0'));var WhatsappAccount=require(_0xde3d('0x1'))['db'][_0xde3d('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xde3d('0x3')](0x0);var events={'afterCreate':_0xde3d('0x4'),'afterUpdate':_0xde3d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2bea1c){return function(_0x1cf546,_0x27a34,_0x5d5298){WhatsappAccountEvents[_0xde3d('0x6')](_0x2bea1c+':'+_0x1cf546['id'],_0x1cf546);WhatsappAccountEvents[_0xde3d('0x6')](_0x2bea1c,_0x1cf546);_0x5d5298(null);};}for(var e in events){if(events[_0xde3d('0x7')](e)){var event=events[e];WhatsappAccount[_0xde3d('0x8')](e,emitEvent(event));}}module[_0xde3d('0x9')]=WhatsappAccountEvents; \ No newline at end of file +var _0xd0b2=['setMaxListeners','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappAccount'];(function(_0x17d133,_0x3aebc5){var _0xf4f7a2=function(_0x30277d){while(--_0x30277d){_0x17d133['push'](_0x17d133['shift']());}};_0xf4f7a2(++_0x3aebc5);}(_0xd0b2,0x165));var _0x2d0b=function(_0x4c3c99,_0x3ddf6b){_0x4c3c99=_0x4c3c99-0x0;var _0x28bf04=_0xd0b2[_0x4c3c99];return _0x28bf04;};'use strict';var EventEmitter=require(_0x2d0b('0x0'));var WhatsappAccount=require(_0x2d0b('0x1'))['db'][_0x2d0b('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x2d0b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2d0b('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5950fe){return function(_0x19d357,_0x3bb401,_0x382d6c){WhatsappAccountEvents['emit'](_0x5950fe+':'+_0x19d357['id'],_0x19d357);WhatsappAccountEvents[_0x2d0b('0x5')](_0x5950fe,_0x19d357);_0x382d6c(null);};}for(var e in events){if(events[_0x2d0b('0x6')](e)){var event=events[e];WhatsappAccount[_0x2d0b('0x7')](e,emitEvent(event));}}module[_0x2d0b('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 5ed4d89..d0dff80 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 _0xc403=['bluebird','request-promise','path','../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger'];(function(_0x15602c,_0x4aa06a){var _0xe4586a=function(_0x5b05cb){while(--_0x5b05cb){_0x15602c['push'](_0x15602c['shift']());}};_0xe4586a(++_0x4aa06a);}(_0xc403,0x69));var _0x3c40=function(_0x3c199f,_0x5c25b4){_0x3c199f=_0x3c199f-0x0;var _0x263bf2=_0xc403[_0x3c199f];return _0x263bf2;};'use strict';var _=require(_0x3c40('0x0'));var util=require(_0x3c40('0x1'));var logger=require(_0x3c40('0x2'))('api');var moment=require('moment');var BPromise=require(_0x3c40('0x3'));var rp=require(_0x3c40('0x4'));var fs=require('fs');var path=require(_0x3c40('0x5'));var rimraf=require('rimraf');var config=require(_0x3c40('0x6'));var attributes=require(_0x3c40('0x7'));module[_0x3c40('0x8')]=function(_0x4faedb,_0x33ca68){return _0x4faedb[_0x3c40('0x9')](_0x3c40('0xa'),attributes,{'tableName':_0x3c40('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x28b4=['define','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','moment','request-promise','path','exports'];(function(_0xa033a3,_0x9420a2){var _0x3e8fbc=function(_0x46d497){while(--_0x46d497){_0xa033a3['push'](_0xa033a3['shift']());}};_0x3e8fbc(++_0x9420a2);}(_0x28b4,0xd5));var _0x428b=function(_0x4f4347,_0x28022c){_0x4f4347=_0x4f4347-0x0;var _0x409216=_0x28b4[_0x4f4347];return _0x409216;};'use strict';var _=require(_0x428b('0x0'));var util=require(_0x428b('0x1'));var logger=require(_0x428b('0x2'))('api');var moment=require(_0x428b('0x3'));var BPromise=require('bluebird');var rp=require(_0x428b('0x4'));var fs=require('fs');var path=require(_0x428b('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./whatsappAccount.attributes');module[_0x428b('0x6')]=function(_0x1ea9ed,_0x30ba96){return _0x1ea9ed[_0x428b('0x7')](_0x428b('0x8'),attributes,{'tableName':_0x428b('0x9'),'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 e2981fd..aec24e1 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 _0x80f7=['jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','catch','ShowWhatsappAccount','WhatsappAccount','find','raw','options','where','attributes','include','map','model','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment'];(function(_0x15d18f,_0x126b0e){var _0xd12bf7=function(_0x19e661){while(--_0x19e661){_0x15d18f['push'](_0x15d18f['shift']());}};_0xd12bf7(++_0x126b0e);}(_0x80f7,0xd6));var _0x780f=function(_0x49f37e,_0x4d9211){_0x49f37e=_0x49f37e-0x0;var _0x3c30e6=_0x80f7[_0x49f37e];return _0x3c30e6;};'use strict';var _=require(_0x780f('0x0'));var util=require('util');var moment=require(_0x780f('0x1'));var BPromise=require(_0x780f('0x2'));var rs=require(_0x780f('0x3'));var fs=require('fs');var Redis=require(_0x780f('0x4'));var db=require(_0x780f('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x780f('0x6'));var config=require(_0x780f('0x7'));var jayson=require(_0x780f('0x8'));var client=jayson[_0x780f('0x9')]['http']({'port':0x232a});config[_0x780f('0xa')]=_[_0x780f('0xb')](config[_0x780f('0xa')],{'host':_0x780f('0xc'),'port':0x18eb});var socket=require(_0x780f('0xd'))(new Redis(config['redis']));require(_0x780f('0xe'))[_0x780f('0xf')](socket);function respondWithRpcPromise(_0x361457,_0x3ed1ef,_0x1fdcf9){return new BPromise(function(_0x5a93b0,_0x1160bb){return client[_0x780f('0x10')](_0x361457,_0x1fdcf9)[_0x780f('0x11')](function(_0x3a80ab){logger[_0x780f('0x12')]('WhatsappAccount,\x20%s,\x20%s',_0x3ed1ef,_0x780f('0x13'));logger[_0x780f('0x14')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x3ed1ef,_0x780f('0x13'),JSON[_0x780f('0x15')](_0x3a80ab));if(_0x3a80ab[_0x780f('0x16')]){if(_0x3a80ab[_0x780f('0x16')][_0x780f('0x17')]===0x1f4){logger[_0x780f('0x16')](_0x780f('0x18'),_0x3ed1ef,_0x3a80ab[_0x780f('0x16')]['message']);return _0x1160bb(_0x3a80ab[_0x780f('0x16')][_0x780f('0x19')]);}logger[_0x780f('0x16')](_0x780f('0x18'),_0x3ed1ef,_0x3a80ab[_0x780f('0x16')][_0x780f('0x19')]);return _0x5a93b0(_0x3a80ab[_0x780f('0x16')][_0x780f('0x19')]);}else{logger['info'](_0x780f('0x18'),_0x3ed1ef,_0x780f('0x13'));_0x5a93b0(_0x3a80ab['result'][_0x780f('0x19')]);}})[_0x780f('0x1a')](function(_0x285a7e){logger[_0x780f('0x16')]('WhatsappAccount,\x20%s,\x20%s',_0x3ed1ef,_0x285a7e);_0x1160bb(_0x285a7e);});});}exports[_0x780f('0x1b')]=function(_0x5d0ce1){var _0x46dd57=this;return new Promise(function(_0xdce1bf,_0x53347e){return db[_0x780f('0x1c')][_0x780f('0x1d')]({'raw':_0x5d0ce1['options']?_0x5d0ce1['options'][_0x780f('0x1e')]===undefined?!![]:![]:!![],'where':_0x5d0ce1[_0x780f('0x1f')]?_0x5d0ce1[_0x780f('0x1f')][_0x780f('0x20')]||null:null,'attributes':_0x5d0ce1['options']?_0x5d0ce1[_0x780f('0x1f')][_0x780f('0x21')]||null:null,'include':_0x5d0ce1[_0x780f('0x1f')]?_0x5d0ce1[_0x780f('0x1f')][_0x780f('0x22')]?_[_0x780f('0x23')](_0x5d0ce1[_0x780f('0x1f')][_0x780f('0x22')],function(_0x5690e6){return{'model':db[_0x5690e6['model']],'as':_0x5690e6['as'],'attributes':_0x5690e6[_0x780f('0x21')],'include':_0x5690e6[_0x780f('0x22')]?_[_0x780f('0x23')](_0x5690e6[_0x780f('0x22')],function(_0x4312c0){return{'model':db[_0x4312c0[_0x780f('0x24')]],'as':_0x4312c0['as'],'attributes':_0x4312c0['attributes'],'include':_0x4312c0[_0x780f('0x22')]?_[_0x780f('0x23')](_0x4312c0[_0x780f('0x22')],function(_0x132a99){return{'model':db[_0x132a99[_0x780f('0x24')]],'as':_0x132a99['as'],'attributes':_0x132a99[_0x780f('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4d0415){logger[_0x780f('0x12')](_0x780f('0x1b'),_0x5d0ce1);logger[_0x780f('0x14')](_0x780f('0x1b'),_0x5d0ce1,JSON['stringify'](_0x4d0415));_0xdce1bf(_0x4d0415);})[_0x780f('0x1a')](function(_0x5501ae){logger['error']('ShowWhatsappAccount',_0x5501ae['message'],_0x5d0ce1);_0x53347e(_0x46dd57[_0x780f('0x16')](0x1f4,_0x5501ae[_0x780f('0x19')]));});});}; \ No newline at end of file +var _0xdab4=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','./whatsappAccount.socket','register','request','then','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','info','result','catch','ShowWhatsappAccount','find','options','raw','where','attributes','include','model','map','lodash'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0xdab4,0x1d3));var _0x4dab=function(_0x3e8998,_0x2c5cc1){_0x3e8998=_0x3e8998-0x0;var _0x1f0fba=_0xdab4[_0x3e8998];return _0x1f0fba;};'use strict';var _=require(_0x4dab('0x0'));var util=require(_0x4dab('0x1'));var moment=require('moment');var BPromise=require(_0x4dab('0x2'));var rs=require(_0x4dab('0x3'));var fs=require('fs');var Redis=require(_0x4dab('0x4'));var db=require(_0x4dab('0x5'))['db'];var utils=require(_0x4dab('0x6'));var logger=require(_0x4dab('0x7'))(_0x4dab('0x8'));var config=require(_0x4dab('0x9'));var jayson=require(_0x4dab('0xa'));var client=jayson['client'][_0x4dab('0xb')]({'port':0x232a});config['redis']=_[_0x4dab('0xc')](config[_0x4dab('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x4dab('0xe'))(new Redis(config[_0x4dab('0xd')]));require(_0x4dab('0xf'))[_0x4dab('0x10')](socket);function respondWithRpcPromise(_0x6d3984,_0x578d99,_0x35ebe1){return new BPromise(function(_0x12310c,_0x326283){return client[_0x4dab('0x11')](_0x6d3984,_0x35ebe1)[_0x4dab('0x12')](function(_0x39790e){logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x578d99,'request\x20sent');logger[_0x4dab('0x13')](_0x4dab('0x14'),_0x578d99,_0x4dab('0x15'),JSON[_0x4dab('0x16')](_0x39790e));if(_0x39790e[_0x4dab('0x17')]){if(_0x39790e[_0x4dab('0x17')][_0x4dab('0x18')]===0x1f4){logger['error'](_0x4dab('0x19'),_0x578d99,_0x39790e[_0x4dab('0x17')]['message']);return _0x326283(_0x39790e[_0x4dab('0x17')]['message']);}logger[_0x4dab('0x17')](_0x4dab('0x19'),_0x578d99,_0x39790e['error'][_0x4dab('0x1a')]);return _0x12310c(_0x39790e[_0x4dab('0x17')][_0x4dab('0x1a')]);}else{logger[_0x4dab('0x1b')](_0x4dab('0x19'),_0x578d99,_0x4dab('0x15'));_0x12310c(_0x39790e[_0x4dab('0x1c')][_0x4dab('0x1a')]);}})[_0x4dab('0x1d')](function(_0x2c4a35){logger[_0x4dab('0x17')](_0x4dab('0x19'),_0x578d99,_0x2c4a35);_0x326283(_0x2c4a35);});});}exports[_0x4dab('0x1e')]=function(_0x4d94d3){var _0x5b6b03=this;return new Promise(function(_0x39efa1,_0x352805){return db['WhatsappAccount'][_0x4dab('0x1f')]({'raw':_0x4d94d3[_0x4dab('0x20')]?_0x4d94d3[_0x4dab('0x20')][_0x4dab('0x21')]===undefined?!![]:![]:!![],'where':_0x4d94d3[_0x4dab('0x20')]?_0x4d94d3[_0x4dab('0x20')][_0x4dab('0x22')]||null:null,'attributes':_0x4d94d3[_0x4dab('0x20')]?_0x4d94d3[_0x4dab('0x20')][_0x4dab('0x23')]||null:null,'include':_0x4d94d3[_0x4dab('0x20')]?_0x4d94d3[_0x4dab('0x20')][_0x4dab('0x24')]?_['map'](_0x4d94d3['options'][_0x4dab('0x24')],function(_0x4ba622){return{'model':db[_0x4ba622[_0x4dab('0x25')]],'as':_0x4ba622['as'],'attributes':_0x4ba622[_0x4dab('0x23')],'include':_0x4ba622[_0x4dab('0x24')]?_[_0x4dab('0x26')](_0x4ba622['include'],function(_0x7128f0){return{'model':db[_0x7128f0[_0x4dab('0x25')]],'as':_0x7128f0['as'],'attributes':_0x7128f0[_0x4dab('0x23')],'include':_0x7128f0[_0x4dab('0x24')]?_[_0x4dab('0x26')](_0x7128f0[_0x4dab('0x24')],function(_0xa9178){return{'model':db[_0xa9178[_0x4dab('0x25')]],'as':_0xa9178['as'],'attributes':_0xa9178['attributes']};}):[]};}):[]};}):[]:[]})[_0x4dab('0x12')](function(_0x226ea4){logger[_0x4dab('0x1b')](_0x4dab('0x1e'),_0x4d94d3);logger[_0x4dab('0x13')]('ShowWhatsappAccount',_0x4d94d3,JSON[_0x4dab('0x16')](_0x226ea4));_0x39efa1(_0x226ea4);})['catch'](function(_0x109639){logger['error']('ShowWhatsappAccount',_0x109639[_0x4dab('0x1a')],_0x4d94d3);_0x352805(_0x5b6b03[_0x4dab('0x17')](0x1f4,_0x109639[_0x4dab('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 4d1bf52..5d14ecb 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 _0x6e73=['save','emit','removeListener','register','length','whatsappAccount:','./whatsappAccount.events'];(function(_0x16b273,_0x3a8aac){var _0x511f9f=function(_0x16e515){while(--_0x16e515){_0x16b273['push'](_0x16b273['shift']());}};_0x511f9f(++_0x3a8aac);}(_0x6e73,0xbc));var _0x36e7=function(_0x6ba738,_0x388187){_0x6ba738=_0x6ba738-0x0;var _0x3f4422=_0x6e73[_0x6ba738];return _0x3f4422;};'use strict';var WhatsappAccountEvents=require(_0x36e7('0x0'));var events=[_0x36e7('0x1'),'remove','update'];function createListener(_0x57df16,_0x3f5a84){return function(_0x50130c){_0x3f5a84[_0x36e7('0x2')](_0x57df16,_0x50130c);};}function removeListener(_0x1a184b,_0x51f02a){return function(){WhatsappAccountEvents[_0x36e7('0x3')](_0x1a184b,_0x51f02a);};}exports[_0x36e7('0x4')]=function(_0x2625bd){for(var _0x5293c0=0x0,_0xdbc92=events[_0x36e7('0x5')];_0x5293c0<_0xdbc92;_0x5293c0++){var _0x141e70=events[_0x5293c0];var _0x197250=createListener(_0x36e7('0x6')+_0x141e70,_0x2625bd);WhatsappAccountEvents['on'](_0x141e70,_0x197250);}}; \ No newline at end of file +var _0xf975=['remove','update','emit','removeListener','length','whatsappAccount:','./whatsappAccount.events','save'];(function(_0x7157e1,_0x33232e){var _0x2bb1c1=function(_0x22ef48){while(--_0x22ef48){_0x7157e1['push'](_0x7157e1['shift']());}};_0x2bb1c1(++_0x33232e);}(_0xf975,0x19e));var _0x5f97=function(_0x3c2d87,_0x623ad){_0x3c2d87=_0x3c2d87-0x0;var _0x142d3c=_0xf975[_0x3c2d87];return _0x142d3c;};'use strict';var WhatsappAccountEvents=require(_0x5f97('0x0'));var events=[_0x5f97('0x1'),_0x5f97('0x2'),_0x5f97('0x3')];function createListener(_0x4f554d,_0x2a8729){return function(_0x2105d7){_0x2a8729[_0x5f97('0x4')](_0x4f554d,_0x2105d7);};}function removeListener(_0x2e9296,_0x2fcef0){return function(){WhatsappAccountEvents[_0x5f97('0x5')](_0x2e9296,_0x2fcef0);};}exports['register']=function(_0x5f5481){for(var _0x2acfb6=0x0,_0x391476=events[_0x5f97('0x6')];_0x2acfb6<_0x391476;_0x2acfb6++){var _0x2aa3ec=events[_0x2acfb6];var _0x5a788d=createListener(_0x5f97('0x7')+_0x2aa3ec,_0x5f5481);WhatsappAccountEvents['on'](_0x2aa3ec,_0x5a788d);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 7c0e30f..0ce4596 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 _0x91aa=['/:id','post','create','put','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated'];(function(_0x501624,_0x3ffbf9){var _0x512894=function(_0xe214b0){while(--_0xe214b0){_0x501624['push'](_0x501624['shift']());}};_0x512894(++_0x3ffbf9);}(_0x91aa,0x15a));var _0xa91a=function(_0x18bd9,_0x1ef045){_0x18bd9=_0x18bd9-0x0;var _0x3dee22=_0x91aa[_0x18bd9];return _0x3dee22;};'use strict';var multer=require(_0xa91a('0x0'));var util=require(_0xa91a('0x1'));var path=require(_0xa91a('0x2'));var timeout=require(_0xa91a('0x3'));var express=require(_0xa91a('0x4'));var router=express[_0xa91a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa91a('0x6'));var config=require(_0xa91a('0x7'));var controller=require(_0xa91a('0x8'));router[_0xa91a('0x9')]('/',auth[_0xa91a('0xa')](),controller['index']);router[_0xa91a('0x9')](_0xa91a('0xb'),auth[_0xa91a('0xa')](),controller['show']);router[_0xa91a('0xc')]('/',auth[_0xa91a('0xa')](),controller[_0xa91a('0xd')]);router[_0xa91a('0xe')](_0xa91a('0xb'),auth[_0xa91a('0xa')](),controller['update']);router[_0xa91a('0xf')]('/:id',auth[_0xa91a('0xa')](),controller[_0xa91a('0x10')]);module['exports']=router; \ No newline at end of file +var _0xf3f0=['put','/:id','update','delete','destroy','exports','util','path','connect-timeout','Router','isAuthenticated','index','get','post'];(function(_0x5a7e3c,_0xdc9219){var _0x59252b=function(_0x29655c){while(--_0x29655c){_0x5a7e3c['push'](_0x5a7e3c['shift']());}};_0x59252b(++_0xdc9219);}(_0xf3f0,0x102));var _0x0f3f=function(_0x3f244f,_0x5d13f0){_0x3f244f=_0x3f244f-0x0;var _0x25b53e=_0xf3f0[_0x3f244f];return _0x25b53e;};'use strict';var multer=require('multer');var util=require(_0x0f3f('0x0'));var path=require(_0x0f3f('0x1'));var timeout=require(_0x0f3f('0x2'));var express=require('express');var router=express[_0x0f3f('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./whatsappApplication.controller');router['get']('/',auth[_0x0f3f('0x4')](),controller[_0x0f3f('0x5')]);router[_0x0f3f('0x6')]('/:id',auth[_0x0f3f('0x4')](),controller['show']);router[_0x0f3f('0x7')]('/',auth[_0x0f3f('0x4')](),controller['create']);router[_0x0f3f('0x8')](_0x0f3f('0x9'),auth[_0x0f3f('0x4')](),controller[_0x0f3f('0xa')]);router[_0x0f3f('0xb')](_0x0f3f('0x9'),auth[_0x0f3f('0x4')](),controller[_0x0f3f('0xc')]);module[_0x0f3f('0xd')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 36ce8e0..04d3121 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 _0xe6a6=['*,*,*,*','INTEGER','STRING','noop'];(function(_0x12e13a,_0x3f8461){var _0xf4cf3c=function(_0x54012f){while(--_0x54012f){_0x12e13a['push'](_0x12e13a['shift']());}};_0xf4cf3c(++_0x3f8461);}(_0xe6a6,0x195));var _0x6e6a=function(_0x418687,_0x9f3c7b){_0x418687=_0x418687-0x0;var _0xfcec38=_0xe6a6[_0x418687];return _0xfcec38;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x6e6a('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x6e6a('0x1')],'allowNull':![],'defaultValue':_0x6e6a('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x6e6a('0x1')],'defaultValue':_0x6e6a('0x3')}}; \ No newline at end of file +var _0x0a6b=['STRING','noop','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x7fa825,_0x4bedc1){var _0x2c849a=function(_0x456c49){while(--_0x456c49){_0x7fa825['push'](_0x7fa825['shift']());}};_0x2c849a(++_0x4bedc1);}(_0x0a6b,0x1e9));var _0xb0a6=function(_0x4eaebe,_0x5a9372){_0x4eaebe=_0x4eaebe-0x0;var _0x3ca596=_0x0a6b[_0x4eaebe];return _0x3ca596;};'use strict';var Sequelize=require(_0xb0a6('0x0'));module[_0xb0a6('0x1')]={'priority':{'type':Sequelize[_0xb0a6('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xb0a6('0x3')],'allowNull':![],'defaultValue':_0xb0a6('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xb0a6('0x3')]},'interval':{'type':Sequelize[_0xb0a6('0x3')],'defaultValue':_0xb0a6('0x5')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index d1eb4ee..3726021 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 _0x6343=['hasOwnProperty','nolimit','order','where','filter','merge','VIRTUAL','options','WhatsappApplication','then','rows','catch','show','params','keys','includeAll','include','create','body','find','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'];(function(_0x1c98d2,_0x4689a3){var _0xc65c49=function(_0x50cf50){while(--_0x50cf50){_0x1c98d2['push'](_0x1c98d2['shift']());}};_0xc65c49(++_0x4689a3);}(_0x6343,0x168));var _0x3634=function(_0x1fd7ff,_0x1b3aae){_0x1fd7ff=_0x1fd7ff-0x0;var _0x29bc67=_0x6343[_0x1fd7ff];return _0x29bc67;};'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['WhatsappApplication'][_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));}; \ No newline at end of file +var _0x80e0=['sort','pick','filter','where','merge','VIRTUAL','options','WhatsappApplication','includeAll','rows','params','rawAttributes','include','create','body','catch','find','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x26e1db,_0x233f4c){var _0x326bd1=function(_0x15adf5){while(--_0x15adf5){_0x26e1db['push'](_0x26e1db['shift']());}};_0x326bd1(++_0x233f4c);}(_0x80e0,0x9d));var _0x080e=function(_0x5385f9,_0x57d383){_0x5385f9=_0x5385f9-0x0;var _0x3ea012=_0x80e0[_0x5385f9];return _0x3ea012;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x080e('0x0'));var jsonpatch=require(_0x080e('0x1'));var rp=require(_0x080e('0x2'));var moment=require('moment');var BPromise=require(_0x080e('0x3'));var Mustache=require(_0x080e('0x4'));var util=require(_0x080e('0x5'));var path=require('path');var sox=require(_0x080e('0x6'));var csv=require(_0x080e('0x7'));var ejs=require(_0x080e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x080e('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x080e('0xa'));var toCsv=require('to-csv');var querystring=require(_0x080e('0xb'));var Papa=require(_0x080e('0xc'));var Redis=require(_0x080e('0xd'));var authService=require(_0x080e('0xe'));var qs=require(_0x080e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x080e('0x10'))(_0x080e('0x11'));var utils=require(_0x080e('0x12'));var config=require(_0x080e('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xce9995,_0x1b6d32){_0x1b6d32=_0x1b6d32||0xcc;return function(_0x10fc04){if(_0x10fc04){return _0xce9995['sendStatus'](_0x1b6d32);}return _0xce9995[_0x080e('0x14')](_0x1b6d32)[_0x080e('0x15')]();};}function respondWithResult(_0x56c604,_0x55228e){_0x55228e=_0x55228e||0xc8;return function(_0x53b13c){if(_0x53b13c){return _0x56c604['status'](_0x55228e)[_0x080e('0x16')](_0x53b13c);}};}function respondWithFilteredResult(_0x16429a,_0x5816c8){return function(_0x4d1a7d){if(_0x4d1a7d){var _0x3394c1=typeof _0x5816c8['offset']==='undefined'&&typeof _0x5816c8[_0x080e('0x17')]==='undefined';var _0x1fd1f2=_0x4d1a7d[_0x080e('0x18')];var _0x171ead=_0x3394c1?0x0:_0x5816c8[_0x080e('0x19')];var _0x4f53cf=_0x3394c1?_0x4d1a7d[_0x080e('0x18')]:_0x5816c8[_0x080e('0x19')]+_0x5816c8[_0x080e('0x17')];var _0x5096a8;if(_0x4f53cf>=_0x1fd1f2){_0x4f53cf=_0x1fd1f2;_0x5096a8=0xc8;}else{_0x5096a8=0xce;}_0x16429a[_0x080e('0x14')](_0x5096a8);return _0x16429a[_0x080e('0x1a')](_0x080e('0x1b'),_0x171ead+'-'+_0x4f53cf+'/'+_0x1fd1f2)['json'](_0x4d1a7d);}return null;};}function patchUpdates(_0x902dc1){return function(_0x3c3156){try{jsonpatch[_0x080e('0x1c')](_0x3c3156,_0x902dc1,!![]);}catch(_0x58f36b){return BPromise[_0x080e('0x1d')](_0x58f36b);}return _0x3c3156['save']();};}function saveUpdates(_0x1db2f2,_0x44b7c2){return function(_0x17d77c){if(_0x17d77c){return _0x17d77c[_0x080e('0x1e')](_0x1db2f2)[_0x080e('0x1f')](function(_0x3740ad){return _0x3740ad;});}return null;};}function removeEntity(_0x309866,_0x47b3bc){return function(_0x416f57){if(_0x416f57){return _0x416f57[_0x080e('0x20')]()[_0x080e('0x1f')](function(){_0x309866[_0x080e('0x14')](0xcc)[_0x080e('0x15')]();});}};}function handleEntityNotFound(_0xd64e99,_0x2bc6b0){return function(_0x3f1545){if(!_0x3f1545){_0xd64e99[_0x080e('0x21')](0x194);}return _0x3f1545;};}function handleError(_0x2e0d50,_0x3bb0bd){_0x3bb0bd=_0x3bb0bd||0x1f4;return function(_0x50c791){logger[_0x080e('0x22')](_0x50c791['stack']);if(_0x50c791[_0x080e('0x23')]){delete _0x50c791[_0x080e('0x23')];}_0x2e0d50['status'](_0x3bb0bd)[_0x080e('0x24')](_0x50c791);};}exports[_0x080e('0x25')]=function(_0x1a709a,_0x1fe8b0){var _0x362492={},_0xebd28a={},_0x1b9b70={'count':0x0,'rows':[]};var _0x142426=_[_0x080e('0x26')](db['WhatsappApplication']['rawAttributes'],function(_0x44eac6){return{'name':_0x44eac6[_0x080e('0x27')],'type':_0x44eac6[_0x080e('0x28')][_0x080e('0x29')]};});_0xebd28a[_0x080e('0x2a')]=_[_0x080e('0x26')](_0x142426,_0x080e('0x23'));_0xebd28a[_0x080e('0x2b')]=_[_0x080e('0x2c')](_0x1a709a[_0x080e('0x2b')]);_0xebd28a[_0x080e('0x2d')]=_[_0x080e('0x2e')](_0xebd28a[_0x080e('0x2a')],_0xebd28a['query']);_0x362492[_0x080e('0x2f')]=_['intersection'](_0xebd28a[_0x080e('0x2a')],qs[_0x080e('0x30')](_0x1a709a[_0x080e('0x2b')][_0x080e('0x30')]));_0x362492[_0x080e('0x2f')]=_0x362492[_0x080e('0x2f')][_0x080e('0x31')]?_0x362492[_0x080e('0x2f')]:_0xebd28a[_0x080e('0x2a')];if(!_0x1a709a[_0x080e('0x2b')][_0x080e('0x32')](_0x080e('0x33'))){_0x362492[_0x080e('0x17')]=qs['limit'](_0x1a709a[_0x080e('0x2b')][_0x080e('0x17')]);_0x362492[_0x080e('0x19')]=qs['offset'](_0x1a709a[_0x080e('0x2b')][_0x080e('0x19')]);}_0x362492[_0x080e('0x34')]=qs[_0x080e('0x35')](_0x1a709a[_0x080e('0x2b')]['sort']);_0x362492['where']=qs[_0x080e('0x2d')](_[_0x080e('0x36')](_0x1a709a[_0x080e('0x2b')],_0xebd28a[_0x080e('0x2d')]),_0x142426);if(_0x1a709a[_0x080e('0x2b')][_0x080e('0x37')]){_0x362492[_0x080e('0x38')]=_[_0x080e('0x39')](_0x362492['where'],{'$or':_[_0x080e('0x26')](_0x142426,function(_0x50e3ed){if(_0x50e3ed[_0x080e('0x28')]!==_0x080e('0x3a')){var _0x3c8282={};_0x3c8282[_0x50e3ed[_0x080e('0x23')]]={'$like':'%'+_0x1a709a[_0x080e('0x2b')][_0x080e('0x37')]+'%'};return _0x3c8282;}})});}_0x362492=_[_0x080e('0x39')]({},_0x362492,_0x1a709a[_0x080e('0x3b')]);var _0x392530={'where':_0x362492[_0x080e('0x38')]};return db[_0x080e('0x3c')][_0x080e('0x18')](_0x392530)[_0x080e('0x1f')](function(_0x41b2fc){_0x1b9b70['count']=_0x41b2fc;if(_0x1a709a[_0x080e('0x2b')][_0x080e('0x3d')]){_0x362492['include']=[{'all':!![]}];}return db[_0x080e('0x3c')]['findAll'](_0x362492);})[_0x080e('0x1f')](function(_0x2816e1){_0x1b9b70[_0x080e('0x3e')]=_0x2816e1;return _0x1b9b70;})['then'](respondWithFilteredResult(_0x1fe8b0,_0x362492))['catch'](handleError(_0x1fe8b0,null));};exports['show']=function(_0x4afa3b,_0x468015){var _0x400de6={'raw':!![],'where':{'id':_0x4afa3b[_0x080e('0x3f')]['id']}},_0x405aa3={};_0x405aa3[_0x080e('0x2a')]=_[_0x080e('0x2c')](db[_0x080e('0x3c')][_0x080e('0x40')]);_0x405aa3[_0x080e('0x2b')]=_['keys'](_0x4afa3b[_0x080e('0x2b')]);_0x405aa3[_0x080e('0x2d')]=_['intersection'](_0x405aa3[_0x080e('0x2a')],_0x405aa3[_0x080e('0x2b')]);_0x400de6[_0x080e('0x2f')]=_[_0x080e('0x2e')](_0x405aa3[_0x080e('0x2a')],qs[_0x080e('0x30')](_0x4afa3b[_0x080e('0x2b')][_0x080e('0x30')]));_0x400de6[_0x080e('0x2f')]=_0x400de6['attributes']['length']?_0x400de6[_0x080e('0x2f')]:_0x405aa3['model'];if(_0x4afa3b[_0x080e('0x2b')][_0x080e('0x3d')]){_0x400de6[_0x080e('0x41')]=[{'all':!![]}];}_0x400de6=_[_0x080e('0x39')]({},_0x400de6,_0x4afa3b[_0x080e('0x3b')]);return db[_0x080e('0x3c')]['find'](_0x400de6)[_0x080e('0x1f')](handleEntityNotFound(_0x468015,null))[_0x080e('0x1f')](respondWithResult(_0x468015,null))['catch'](handleError(_0x468015,null));};exports[_0x080e('0x42')]=function(_0x560eab,_0x5ad913){return db['WhatsappApplication'][_0x080e('0x42')](_0x560eab[_0x080e('0x43')],{})[_0x080e('0x1f')](respondWithResult(_0x5ad913,0xc9))[_0x080e('0x44')](handleError(_0x5ad913,null));};exports[_0x080e('0x1e')]=function(_0x444f93,_0x51ecd0){if(_0x444f93['body']['id']){delete _0x444f93[_0x080e('0x43')]['id'];}return db['WhatsappApplication']['find']({'where':{'id':_0x444f93['params']['id']}})[_0x080e('0x1f')](handleEntityNotFound(_0x51ecd0,null))[_0x080e('0x1f')](saveUpdates(_0x444f93[_0x080e('0x43')],null))[_0x080e('0x1f')](respondWithResult(_0x51ecd0,null))[_0x080e('0x44')](handleError(_0x51ecd0,null));};exports['destroy']=function(_0x96366d,_0x46389a){return db['WhatsappApplication'][_0x080e('0x45')]({'where':{'id':_0x96366d[_0x080e('0x3f')]['id']}})[_0x080e('0x1f')](handleEntityNotFound(_0x46389a,null))[_0x080e('0x1f')](removeEntity(_0x46389a,null))[_0x080e('0x44')](handleError(_0x46389a,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index c37ff1d..40d0ad0 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 _0xd4b6=['lodash','util','api','moment','request-promise','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4'];(function(_0x151222,_0x5d83b6){var _0x4e8232=function(_0x2ddf51){while(--_0x2ddf51){_0x151222['push'](_0x151222['shift']());}};_0x4e8232(++_0x5d83b6);}(_0xd4b6,0x13f));var _0x6d4b=function(_0x41c173,_0x3b499e){_0x41c173=_0x41c173-0x0;var _0x35a186=_0xd4b6[_0x41c173];return _0x35a186;};'use strict';var _=require(_0x6d4b('0x0'));var util=require(_0x6d4b('0x1'));var logger=require('../../config/logger')(_0x6d4b('0x2'));var moment=require(_0x6d4b('0x3'));var BPromise=require('bluebird');var rp=require(_0x6d4b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6d4b('0x5'));module[_0x6d4b('0x6')]=function(_0x442164,_0x5daf08){return _0x442164[_0x6d4b('0x7')](_0x6d4b('0x8'),attributes,{'tableName':_0x6d4b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6d4b('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x8ece=['util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x1415c8,_0x27d437){var _0x5360fc=function(_0x526c8a){while(--_0x526c8a){_0x1415c8['push'](_0x1415c8['shift']());}};_0x5360fc(++_0x27d437);}(_0x8ece,0x195));var _0xe8ec=function(_0x30b094,_0x555417){_0x30b094=_0x30b094-0x0;var _0x4337f3=_0x8ece[_0x30b094];return _0x4337f3;};'use strict';var _=require(_0xe8ec('0x0'));var util=require(_0xe8ec('0x1'));var logger=require(_0xe8ec('0x2'))(_0xe8ec('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe8ec('0x4'));var fs=require('fs');var path=require(_0xe8ec('0x5'));var rimraf=require(_0xe8ec('0x6'));var config=require(_0xe8ec('0x7'));var attributes=require(_0xe8ec('0x8'));module['exports']=function(_0x346577,_0x23fa35){return _0x346577[_0xe8ec('0x9')](_0xe8ec('0xa'),attributes,{'tableName':_0xe8ec('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe8ec('0xc'),'collate':_0xe8ec('0xd')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index e5f71b2..a433c0f 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 _0x0e85=['bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util'];(function(_0x897f4d,_0x537f71){var _0x57a2f2=function(_0x564ff8){while(--_0x564ff8){_0x897f4d['push'](_0x897f4d['shift']());}};_0x57a2f2(++_0x537f71);}(_0x0e85,0x7c));var _0x50e8=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x0e85[_0x2dadb9];return _0x2f0097;};'use strict';var _=require(_0x50e8('0x0'));var util=require(_0x50e8('0x1'));var moment=require('moment');var BPromise=require(_0x50e8('0x2'));var rs=require(_0x50e8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x50e8('0x4'))('rpc');var config=require(_0x50e8('0x5'));var jayson=require(_0x50e8('0x6'));var client=jayson[_0x50e8('0x7')][_0x50e8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5e8b01,_0x3ce904,_0x108edc){return new BPromise(function(_0x42665e,_0x988da0){return client[_0x50e8('0x9')](_0x5e8b01,_0x108edc)[_0x50e8('0xa')](function(_0x5825f5){logger[_0x50e8('0xb')](_0x50e8('0xc'),_0x3ce904,_0x50e8('0xd'));logger[_0x50e8('0xe')](_0x50e8('0xf'),_0x3ce904,_0x50e8('0xd'),JSON[_0x50e8('0x10')](_0x5825f5));if(_0x5825f5[_0x50e8('0x11')]){if(_0x5825f5['error']['code']===0x1f4){logger[_0x50e8('0x11')](_0x50e8('0xc'),_0x3ce904,_0x5825f5['error']['message']);return _0x988da0(_0x5825f5[_0x50e8('0x11')][_0x50e8('0x12')]);}logger[_0x50e8('0x11')](_0x50e8('0xc'),_0x3ce904,_0x5825f5['error'][_0x50e8('0x12')]);return _0x42665e(_0x5825f5[_0x50e8('0x11')][_0x50e8('0x12')]);}else{logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x3ce904,_0x50e8('0xd'));_0x42665e(_0x5825f5[_0x50e8('0x13')][_0x50e8('0x12')]);}})[_0x50e8('0x14')](function(_0x211731){logger[_0x50e8('0x11')]('WhatsappApplication,\x20%s,\x20%s',_0x3ce904,_0x211731);_0x988da0(_0x211731);});});} \ No newline at end of file +var _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','WhatsappApplication,\x20%s,\x20%s','message','catch','util'];(function(_0x4ba54b,_0x46f4de){var _0x364bfe=function(_0xe601b3){while(--_0xe601b3){_0x4ba54b['push'](_0x4ba54b['shift']());}};_0x364bfe(++_0x46f4de);}(_0xedd9,0xfc));var _0x9edd=function(_0x16ca04,_0x2e1403){_0x16ca04=_0x16ca04-0x0;var _0x21f968=_0xedd9[_0x16ca04];return _0x21f968;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index ab67d2a..e7dd1af 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 _0xa6b0=['/describe','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','update','whatsappinteraction:destroy','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index'];(function(_0x4020a3,_0x16e619){var _0x178f7a=function(_0x1697bc){while(--_0x1697bc){_0x4020a3['push'](_0x4020a3['shift']());}};_0x178f7a(++_0x16e619);}(_0xa6b0,0xaf));var _0x0a6b=function(_0xf10102,_0x5c92e4){_0xf10102=_0xf10102-0x0;var _0x420523=_0xa6b0[_0xf10102];return _0x420523;};'use strict';var multer=require(_0x0a6b('0x0'));var util=require(_0x0a6b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0a6b('0x2'));var router=express[_0x0a6b('0x3')]();var fs_extra=require(_0x0a6b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0a6b('0x5'));var config=require(_0x0a6b('0x6'));var controller=require(_0x0a6b('0x7'));router[_0x0a6b('0x8')]('/',auth[_0x0a6b('0x9')](),controller[_0x0a6b('0xa')]);router[_0x0a6b('0x8')](_0x0a6b('0xb'),auth[_0x0a6b('0x9')](),controller[_0x0a6b('0xc')]);router[_0x0a6b('0x8')](_0x0a6b('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x0a6b('0x8')](_0x0a6b('0xe'),auth[_0x0a6b('0x9')](),controller[_0x0a6b('0xf')]);router[_0x0a6b('0x8')](_0x0a6b('0x10'),auth[_0x0a6b('0x9')](),controller[_0x0a6b('0x11')]);router[_0x0a6b('0x12')]('/',auth[_0x0a6b('0x9')](),controller[_0x0a6b('0x13')]);router[_0x0a6b('0x12')](_0x0a6b('0xe'),auth[_0x0a6b('0x9')](),controller['addMessage']);router['post'](_0x0a6b('0x14'),auth[_0x0a6b('0x9')](),interaction[_0x0a6b('0x15')](_0x0a6b('0x16'),_0x0a6b('0x17')),controller[_0x0a6b('0x18')]);router[_0x0a6b('0x19')](_0x0a6b('0xd'),auth[_0x0a6b('0x9')](),interaction[_0x0a6b('0x15')]('whatsapp',_0x0a6b('0x1a')),controller[_0x0a6b('0x1b')]);router['delete'](_0x0a6b('0xd'),auth['isAuthenticated'](),interaction[_0x0a6b('0x15')](_0x0a6b('0x16'),_0x0a6b('0x1c')),controller[_0x0a6b('0x1d')]);router['delete'](_0x0a6b('0x14'),auth[_0x0a6b('0x9')](),controller['removeTags']);module[_0x0a6b('0x1e')]=router; \ No newline at end of file +var _0x687b=['multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','/:id','whatsappinteraction:update','update','destroy','delete','/:id/tags','removeTags'];(function(_0x3a1871,_0xc65526){var _0x8d39ae=function(_0x3aceb2){while(--_0x3aceb2){_0x3a1871['push'](_0x3a1871['shift']());}};_0x8d39ae(++_0xc65526);}(_0x687b,0x14a));var _0xb687=function(_0x46c865,_0x154b2f){_0x46c865=_0x46c865-0x0;var _0x200973=_0x687b[_0x46c865];return _0x200973;};'use strict';var multer=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var path=require(_0xb687('0x2'));var timeout=require(_0xb687('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb687('0x4'));var auth=require(_0xb687('0x5'));var interaction=require(_0xb687('0x6'));var config=require(_0xb687('0x7'));var controller=require(_0xb687('0x8'));router[_0xb687('0x9')]('/',auth[_0xb687('0xa')](),controller[_0xb687('0xb')]);router[_0xb687('0x9')](_0xb687('0xc'),auth['isAuthenticated'](),controller[_0xb687('0xd')]);router[_0xb687('0x9')]('/:id',auth[_0xb687('0xa')](),controller[_0xb687('0xe')]);router[_0xb687('0x9')](_0xb687('0xf'),auth[_0xb687('0xa')](),controller[_0xb687('0x10')]);router[_0xb687('0x9')](_0xb687('0x11'),auth[_0xb687('0xa')](),controller['download']);router[_0xb687('0x12')]('/',auth[_0xb687('0xa')](),controller[_0xb687('0x13')]);router[_0xb687('0x12')]('/:id/messages',auth['isAuthenticated'](),controller[_0xb687('0x14')]);router[_0xb687('0x12')]('/:id/tags',auth[_0xb687('0xa')](),interaction[_0xb687('0x15')](_0xb687('0x16'),_0xb687('0x17')),controller[_0xb687('0x18')]);router[_0xb687('0x19')](_0xb687('0x1a'),auth[_0xb687('0xa')](),interaction[_0xb687('0x15')](_0xb687('0x16'),_0xb687('0x1b')),controller[_0xb687('0x1c')]);router['delete'](_0xb687('0x1a'),auth[_0xb687('0xa')](),interaction[_0xb687('0x15')]('whatsapp','whatsappinteraction:destroy'),controller[_0xb687('0x1d')]);router[_0xb687('0x1e')](_0xb687('0x1f'),auth['isAuthenticated'](),controller[_0xb687('0x20')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index b5f3162..d204836 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 _0x13cc=['out','ENUM','INTEGER','exports','BOOLEAN','STRING','DATE'];(function(_0x112c6f,_0xf90729){var _0x235efe=function(_0x506b7c){while(--_0x506b7c){_0x112c6f['push'](_0x112c6f['shift']());}};_0x235efe(++_0xf90729);}(_0x13cc,0x161));var _0xc13c=function(_0x1d7bbd,_0x327073){_0x1d7bbd=_0x1d7bbd-0x0;var _0x520685=_0x13cc[_0x1d7bbd];return _0x520685;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xc13c('0x0')]={'closed':{'type':Sequelize[_0xc13c('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xc13c('0x2')]},'secondDisposition':{'type':Sequelize[_0xc13c('0x2')]},'thirdDisposition':{'type':Sequelize[_0xc13c('0x2')]},'note':{'type':Sequelize[_0xc13c('0x2')]},'phone':{'type':Sequelize[_0xc13c('0x2')]},'read1stAt':{'type':Sequelize[_0xc13c('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xc13c('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xc13c('0x5')]('in',_0xc13c('0x4')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xc13c('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xc13c('0x6')]}}; \ No newline at end of file +var _0xa908=['out','BOOLEAN','INTEGER','sequelize','exports','DATE','STRING','ENUM'];(function(_0x3550c3,_0x6b3eb1){var _0x4b7418=function(_0x2d2d23){while(--_0x2d2d23){_0x3550c3['push'](_0x3550c3['shift']());}};_0x4b7418(++_0x6b3eb1);}(_0xa908,0x1c3));var _0x8a90=function(_0x5e58b2,_0x1b7ed4){_0x5e58b2=_0x5e58b2-0x0;var _0x4facd0=_0xa908[_0x5e58b2];return _0x4facd0;};'use strict';var Sequelize=require(_0x8a90('0x0'));var moment=require('moment');module[_0x8a90('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8a90('0x2')]},'disposition':{'type':Sequelize[_0x8a90('0x3')]},'secondDisposition':{'type':Sequelize[_0x8a90('0x3')]},'thirdDisposition':{'type':Sequelize[_0x8a90('0x3')]},'note':{'type':Sequelize[_0x8a90('0x3')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x8a90('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x8a90('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8a90('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x8a90('0x4')]('in',_0x8a90('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x8a90('0x6')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x8a90('0x7')]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index cd2d987..eff8a5c 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 _0xabb5=['basename','existsSync','pipe','out','firstName','secret','value','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','moment','bluebird','path','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','defaults','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','sendStatus','status','end','offset','limit','count','set','Content-Range','update','then','error','name','send','index','map','WhatsappInteraction','rawAttributes','fieldName','type','getOptions','findAll','whatsapp','query','user','show','model','keys','filters','intersection','attributes','fields','includeAll','include','options','find','create','body','params','catch','describe','WhatsappMessage','ids','omit','getMessages','findOne','length','nolimit','order','sort','pick','where','WhatsappInteractionId','filter','$gte','split','format','merge','addTags','spread','Tag','color','emit','whatsappInteractionTags:save','removeTags','join','server','tmp','root','files','attachments','push','User','fullname','CmContact','Contact','lastName','Attachment','Messages','createdAt','direction','read','Owner','mkdirSync','Whatsapp','N.A.','YYYY-MM-DD\x20HH:mm:ss','toString','closedAt','disposition'];(function(_0x32e6b0,_0x1968ce){var _0x840c53=function(_0x622d4e){while(--_0x622d4e){_0x32e6b0['push'](_0x32e6b0['shift']());}};_0x840c53(++_0x1968ce);}(_0xabb5,0x1e2));var _0x5abb=function(_0x546ccd,_0x2342db){_0x546ccd=_0x546ccd-0x0;var _0x560093=_0xabb5[_0x546ccd];return _0x560093;};'use strict';var rimraf=require(_0x5abb('0x0'));var zipdir=require(_0x5abb('0x1'));var moment=require(_0x5abb('0x2'));var BPromise=require(_0x5abb('0x3'));var util=require('util');var path=require(_0x5abb('0x4'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require(_0x5abb('0x5'));var interaction=require('../../components/interaction/service');var qs=require(_0x5abb('0x6'));var pdf=require('../../components/export/pdf');var logger=require(_0x5abb('0x7'))('api');var config=require(_0x5abb('0x8'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x5abb('0x9')](config[_0x5abb('0xa')],{'host':_0x5abb('0xb'),'port':0x18eb});var socket=require(_0x5abb('0xc'))(new Redis(config[_0x5abb('0xa')]));require(_0x5abb('0xd'))['register'](socket);function respondWithStatusCode(_0x37bbf9,_0x1576e9){_0x1576e9=_0x1576e9||0xcc;return function(_0x40d9b2){if(_0x40d9b2){return _0x37bbf9[_0x5abb('0xe')](_0x1576e9);}return _0x37bbf9[_0x5abb('0xf')](_0x1576e9)[_0x5abb('0x10')]();};}function respondWithResult(_0x56031e,_0x1b0255){_0x1b0255=_0x1b0255||0xc8;return function(_0x326826){if(_0x326826){return _0x56031e['status'](_0x1b0255)['json'](_0x326826);}};}function respondWithFilteredResult(_0x4529c4,_0x3fd1a9){return function(_0x55d2dc){if(_0x55d2dc){var _0x137878=typeof _0x3fd1a9[_0x5abb('0x11')]==='undefined'&&typeof _0x3fd1a9[_0x5abb('0x12')]==='undefined';var _0x455ab5=_0x55d2dc['count'];var _0x545d56=_0x137878?0x0:_0x3fd1a9['offset'];var _0xb6146c=_0x137878?_0x55d2dc[_0x5abb('0x13')]:_0x3fd1a9[_0x5abb('0x11')]+_0x3fd1a9[_0x5abb('0x12')];var _0x2eaddd;if(_0xb6146c>=_0x455ab5){_0xb6146c=_0x455ab5;_0x2eaddd=0xc8;}else{_0x2eaddd=0xce;}_0x4529c4[_0x5abb('0xf')](_0x2eaddd);return _0x4529c4[_0x5abb('0x14')](_0x5abb('0x15'),_0x545d56+'-'+_0xb6146c+'/'+_0x455ab5)['json'](_0x55d2dc);}return null;};}function saveUpdates(_0x1663bf){return function(_0x3414b4){if(_0x3414b4){return _0x3414b4[_0x5abb('0x16')](_0x1663bf)[_0x5abb('0x17')](function(_0x5cdc3a){return _0x5cdc3a;});}return null;};}function removeEntity(_0x54e48e){return function(_0x2c7cf2){if(_0x2c7cf2){return _0x2c7cf2['destroy']()[_0x5abb('0x17')](function(){_0x54e48e[_0x5abb('0xf')](0xcc)[_0x5abb('0x10')]();});}};}function handleEntityNotFound(_0x33bbc8){return function(_0x9ef4a5){if(!_0x9ef4a5){_0x33bbc8[_0x5abb('0xe')](0x194);}return _0x9ef4a5;};}function handleError(_0x2d3f58,_0x17f315){_0x17f315=_0x17f315||0x1f4;return function(_0x411bad){logger[_0x5abb('0x18')](_0x411bad['stack']);if(_0x411bad[_0x5abb('0x19')]){delete _0x411bad[_0x5abb('0x19')];}_0x2d3f58[_0x5abb('0xf')](_0x17f315)[_0x5abb('0x1a')](_0x411bad);};}exports[_0x5abb('0x1b')]=function(_0x115fec,_0x2f736f){var _0xd9c1cc={};var _0x5d84ef=_[_0x5abb('0x1c')](db[_0x5abb('0x1d')][_0x5abb('0x1e')],function(_0x20d276){return{'name':_0x20d276[_0x5abb('0x1f')],'type':_0x20d276[_0x5abb('0x20')]['key']};});_0xd9c1cc=qs[_0x5abb('0x21')](_0x5d84ef,_0x115fec);return interaction[_0x5abb('0x22')](_0x5abb('0x23'),_0x115fec[_0x5abb('0x24')],_0x115fec[_0x5abb('0x25')],_0xd9c1cc,_0x5d84ef)['then'](respondWithFilteredResult(_0x2f736f,_0xd9c1cc))['catch'](handleError(_0x2f736f,null));};exports[_0x5abb('0x26')]=function(_0x51d8ef,_0x17fe31){var _0x275ac9={'raw':![],'where':{'id':_0x51d8ef['params']['id']}},_0x17d8e0={};_0x17d8e0[_0x5abb('0x27')]=_[_0x5abb('0x28')](db[_0x5abb('0x1d')]['rawAttributes']);_0x17d8e0['query']=_[_0x5abb('0x28')](_0x51d8ef[_0x5abb('0x24')]);_0x17d8e0[_0x5abb('0x29')]=_[_0x5abb('0x2a')](_0x17d8e0[_0x5abb('0x27')],_0x17d8e0[_0x5abb('0x24')]);_0x275ac9[_0x5abb('0x2b')]=_[_0x5abb('0x2a')](_0x17d8e0['model'],qs['fields'](_0x51d8ef[_0x5abb('0x24')][_0x5abb('0x2c')]));_0x275ac9[_0x5abb('0x2b')]=_0x275ac9[_0x5abb('0x2b')]['length']?_0x275ac9[_0x5abb('0x2b')]:_0x17d8e0['model'];if(_0x51d8ef[_0x5abb('0x24')][_0x5abb('0x2d')]){_0x275ac9[_0x5abb('0x2e')]=[{'all':!![]}];}_0x275ac9=_['merge']({},_0x275ac9,_0x51d8ef[_0x5abb('0x2f')]);return db[_0x5abb('0x1d')][_0x5abb('0x30')](_0x275ac9)[_0x5abb('0x17')](handleEntityNotFound(_0x17fe31,null))[_0x5abb('0x17')](respondWithResult(_0x17fe31,null))['catch'](handleError(_0x17fe31,null));};exports[_0x5abb('0x31')]=function(_0x33b5fa,_0x59723e){return db[_0x5abb('0x1d')]['create'](_0x33b5fa[_0x5abb('0x32')],{})[_0x5abb('0x17')](respondWithResult(_0x59723e,0xc9))['catch'](handleError(_0x59723e,null));};exports[_0x5abb('0x16')]=function(_0x5f34ea,_0x29b47d){if(_0x5f34ea[_0x5abb('0x32')]['id']){delete _0x5f34ea['body']['id'];}return db['WhatsappInteraction']['find']({'where':{'id':_0x5f34ea[_0x5abb('0x33')]['id']}})[_0x5abb('0x17')](handleEntityNotFound(_0x29b47d,null))[_0x5abb('0x17')](saveUpdates(_0x5f34ea[_0x5abb('0x32')],null))['then'](respondWithResult(_0x29b47d,null))[_0x5abb('0x34')](handleError(_0x29b47d,null));};exports['destroy']=function(_0x12fc12,_0x2e6bd0){return db[_0x5abb('0x1d')][_0x5abb('0x30')]({'where':{'id':_0x12fc12[_0x5abb('0x33')]['id']}})[_0x5abb('0x17')](handleEntityNotFound(_0x2e6bd0,null))['then'](removeEntity(_0x2e6bd0,null))[_0x5abb('0x34')](handleError(_0x2e6bd0,null));};exports[_0x5abb('0x35')]=function(_0x41d5fe,_0xc50bad){return db[_0x5abb('0x1d')][_0x5abb('0x35')]()[_0x5abb('0x17')](respondWithResult(_0xc50bad,null))['catch'](handleError(_0xc50bad,null));};exports['addMessage']=function(_0x1965d4,_0x735946){return db[_0x5abb('0x36')]['find']({'where':{'id':_0x1965d4[_0x5abb('0x33')]['id']}})['then'](handleEntityNotFound(_0x735946,null))[_0x5abb('0x17')](function(_0x5d836f){if(_0x5d836f){return _0x5d836f['addMessage'](_0x1965d4['body'][_0x5abb('0x37')],_[_0x5abb('0x38')](_0x1965d4[_0x5abb('0x32')],[_0x5abb('0x37'),'id'])||{});}})[_0x5abb('0x17')](respondWithResult(_0x735946,null))[_0x5abb('0x34')](handleError(_0x735946,null));};exports[_0x5abb('0x39')]=function(_0x4f7c2c,_0x382ba4){var _0x1b99d3={'raw':![],'where':{}};var _0x2fa42f={};var _0x49ab61={'count':0x0,'rows':[]};return db[_0x5abb('0x1d')][_0x5abb('0x3a')]({'where':{'id':_0x4f7c2c['params']['id']}})['then'](handleEntityNotFound(_0x382ba4,null))[_0x5abb('0x17')](function(_0x25954b){if(_0x25954b){_0x2fa42f[_0x5abb('0x27')]=_[_0x5abb('0x28')](db[_0x5abb('0x36')][_0x5abb('0x1e')]);_0x2fa42f[_0x5abb('0x24')]=_['keys'](_0x4f7c2c[_0x5abb('0x24')]);_0x2fa42f[_0x5abb('0x29')]=_[_0x5abb('0x2a')](_0x2fa42f[_0x5abb('0x27')],_0x2fa42f[_0x5abb('0x24')]);_0x1b99d3[_0x5abb('0x2b')]=_[_0x5abb('0x2a')](_0x2fa42f[_0x5abb('0x27')],qs[_0x5abb('0x2c')](_0x4f7c2c['query']['fields']));_0x1b99d3[_0x5abb('0x2b')]=_0x1b99d3[_0x5abb('0x2b')][_0x5abb('0x3b')]?_0x1b99d3[_0x5abb('0x2b')]:_0x2fa42f[_0x5abb('0x27')];if(!_0x4f7c2c[_0x5abb('0x24')]['hasOwnProperty'](_0x5abb('0x3c'))){_0x1b99d3[_0x5abb('0x12')]=qs[_0x5abb('0x12')](_0x4f7c2c[_0x5abb('0x24')][_0x5abb('0x12')]);_0x1b99d3['offset']=qs[_0x5abb('0x11')](_0x4f7c2c[_0x5abb('0x24')][_0x5abb('0x11')]);}_0x1b99d3[_0x5abb('0x3d')]=qs[_0x5abb('0x3e')](_0x4f7c2c[_0x5abb('0x24')]['sort']);_0x1b99d3['where']=qs[_0x5abb('0x29')](_[_0x5abb('0x3f')](_0x4f7c2c['query'],_0x2fa42f[_0x5abb('0x29')]));_0x1b99d3[_0x5abb('0x40')][_0x5abb('0x41')]=_0x25954b['id'];if(_0x4f7c2c[_0x5abb('0x24')]['filter']){_0x1b99d3[_0x5abb('0x40')]=_['merge'](_0x1b99d3[_0x5abb('0x40')],{'$or':_[_0x5abb('0x1c')](_0x1b99d3[_0x5abb('0x2b')],function(_0xaa2d4c){var _0x3dba3a={};_0x3dba3a[_0xaa2d4c]={'$like':'%'+_0x4f7c2c[_0x5abb('0x24')][_0x5abb('0x42')]+'%'};return _0x3dba3a;})});}if(_0x4f7c2c[_0x5abb('0x24')][_0x5abb('0x43')]){var _0x4ec85f=_0x4f7c2c['query'][_0x5abb('0x43')][_0x5abb('0x44')](',');var _0x40aa3e={};_0x40aa3e[_0x4ec85f[0x0]]={'$gte':moment(_0x4ec85f[0x1])[_0x5abb('0x45')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1b99d3[_0x5abb('0x40')]=_[_0x5abb('0x46')](_0x1b99d3[_0x5abb('0x40')],_0x40aa3e);}_0x1b99d3=_[_0x5abb('0x46')]({},_0x1b99d3,_0x4f7c2c[_0x5abb('0x2f')]);return db['WhatsappMessage'][_0x5abb('0x13')]({'where':_0x1b99d3[_0x5abb('0x40')]})['then'](function(_0x224a36){_0x49ab61[_0x5abb('0x13')]=_0x224a36;if(_0x4f7c2c['query'][_0x5abb('0x2d')]){_0x1b99d3['include']=[{'all':!![]}];}return db[_0x5abb('0x36')][_0x5abb('0x22')](_0x1b99d3);})[_0x5abb('0x17')](function(_0x533caf){_0x49ab61['rows']=_0x533caf;return _0x49ab61;});}})['then'](respondWithFilteredResult(_0x382ba4,_0x1b99d3))[_0x5abb('0x34')](handleError(_0x382ba4,null));};exports[_0x5abb('0x47')]=function(_0x127c3a,_0x5e0ce0){return db[_0x5abb('0x1d')][_0x5abb('0x30')]({'where':{'id':_0x127c3a[_0x5abb('0x33')]['id']}})[_0x5abb('0x17')](handleEntityNotFound(_0x5e0ce0,null))[_0x5abb('0x17')](function(_0x1e2a4d){if(_0x1e2a4d){return _0x1e2a4d['setTags'](_0x127c3a[_0x5abb('0x32')][_0x5abb('0x37')],_[_0x5abb('0x38')](_0x127c3a[_0x5abb('0x32')],[_0x5abb('0x37'),'id'])||{})[_0x5abb('0x48')](function(){return db[_0x5abb('0x49')][_0x5abb('0x22')]({'attributes':['id',_0x5abb('0x19'),_0x5abb('0x4a')],'where':{'id':_0x127c3a['body'][_0x5abb('0x37')]}});})['then'](function(_0x1ccd20){socket[_0x5abb('0x4b')](_0x5abb('0x4c'),{'id':Number(_0x127c3a[_0x5abb('0x33')]['id']),'tags':_0x1ccd20||[]});return{'id':Number(_0x127c3a[_0x5abb('0x33')]['id']),'tags':_0x1ccd20||[]};});}})[_0x5abb('0x17')](respondWithResult(_0x5e0ce0,null))[_0x5abb('0x34')](handleError(_0x5e0ce0,null));};exports[_0x5abb('0x4d')]=function(_0x3affe2,_0x1776df){return db[_0x5abb('0x1d')]['find']({'where':{'id':_0x3affe2[_0x5abb('0x33')]['id']}})['then'](handleEntityNotFound(_0x1776df,null))['then'](function(_0x3c7588){if(_0x3c7588){return _0x3c7588[_0x5abb('0x4d')](_0x3affe2[_0x5abb('0x24')][_0x5abb('0x37')]);}})[_0x5abb('0x17')](respondWithStatusCode(_0x1776df,null))[_0x5abb('0x34')](handleError(_0x1776df,null));};exports['download']=function(_0xde8984,_0x191bbb){var _0x1341b6=moment()['unix']()['toString']();var _0x2f3dc2=path[_0x5abb('0x4e')](config['root'],_0x5abb('0x4f'),'files',_0x5abb('0x50'));var _0x3ca1c7=path['join'](config[_0x5abb('0x51')],_0x5abb('0x4f'),_0x5abb('0x52'),_0x5abb('0x53'));var _0x2287dc=path[_0x5abb('0x4e')](_0x2f3dc2,_0x1341b6);var _0x39f6f1=util[_0x5abb('0x45')]('transcript-%d-%s.zip',_0xde8984[_0x5abb('0x33')]['id'],_0x1341b6);var _0x4f2d8f=path[_0x5abb('0x4e')](_0x2f3dc2,_0x39f6f1);var _0x282ffb=[];_0x282ffb[_0x5abb('0x54')]({'model':db[_0x5abb('0x55')],'as':_0x5abb('0x55'),'attributes':['id',_0x5abb('0x56')],'raw':!![]});_0x282ffb[_0x5abb('0x54')]({'model':db[_0x5abb('0x57')],'as':_0x5abb('0x58'),'attributes':['id','firstName',_0x5abb('0x59')],'raw':!![]});if(_0xde8984[_0x5abb('0x24')]['attachments']){_0x282ffb[_0x5abb('0x54')]({'model':db['Attachment'],'as':_0x5abb('0x5a'),'raw':!![]});}var _0x1a34da=[{'model':db[_0x5abb('0x36')],'as':_0x5abb('0x5b'),'attributes':['id',_0x5abb('0x32'),_0x5abb('0x5c'),_0x5abb('0x5d'),'secret',_0x5abb('0x5e')],'include':_0x282ffb}];_0x1a34da[_0x5abb('0x54')]({'model':db['WhatsappAccount'],'as':'Account','attributes':['id',_0x5abb('0x19')]});_0x1a34da[_0x5abb('0x54')]({'model':db[_0x5abb('0x55')],'as':_0x5abb('0x5f'),'attributes':['id','fullname']});return db[_0x5abb('0x1d')][_0x5abb('0x30')]({'where':{'id':_0xde8984[_0x5abb('0x33')]['id']},'include':_0x1a34da})[_0x5abb('0x17')](handleEntityNotFound(_0x191bbb,null))[_0x5abb('0x17')](function(_0x251747){if(_0x251747){var _0x2d32f6=_0x251747['get']({'plain':!![]});fs[_0x5abb('0x60')](_0x2287dc);var _0x1e6948={'channel':_0x5abb('0x61'),'account':_0x2d32f6['Account']['name'],'agent':_0x2d32f6[_0x5abb('0x5f')]?_0x2d32f6[_0x5abb('0x5f')][_0x5abb('0x56')]:_0x5abb('0x62'),'createdAt':moment(_0x2d32f6[_0x5abb('0x5c')])['format'](_0x5abb('0x63'))[_0x5abb('0x64')](),'closedAt':_0x2d32f6['closed']?moment(_0x2d32f6[_0x5abb('0x65')])[_0x5abb('0x45')](_0x5abb('0x63'))[_0x5abb('0x64')]():'','disposition':_0x2d32f6[_0x5abb('0x66')],'messages':_(_0x2d32f6['Messages'])[_0x5abb('0x42')]({'secret':![]})[_0x5abb('0x1c')](function(_0x28096b){if(_0x28096b['Attachment']){var _0x50ac87=path['join'](_0x3ca1c7,_0x28096b[_0x5abb('0x5a')][_0x5abb('0x67')]);if(fs[_0x5abb('0x68')](_0x50ac87)){fs['createReadStream'](_0x50ac87)[_0x5abb('0x69')](fs['createWriteStream'](path['join'](_0x2287dc,_0x28096b[_0x5abb('0x5a')][_0x5abb('0x67')])));}}return{'date':moment(_0x28096b[_0x5abb('0x5c')])[_0x5abb('0x45')]('YYYY-MM-DD\x20HH:mm:ss')[_0x5abb('0x64')](),'sender':_0x28096b[_0x5abb('0x5d')]===_0x5abb('0x6a')?_0x28096b['User']?_0x28096b[_0x5abb('0x55')][_0x5abb('0x56')]:'System':_0x28096b[_0x5abb('0x58')][_0x5abb('0x6b')]+(_0x28096b[_0x5abb('0x58')][_0x5abb('0x59')]?'\x20'+_0x28096b[_0x5abb('0x58')][_0x5abb('0x59')]:''),'body':_0x28096b['Attachment']?_0x28096b['Attachment'][_0x5abb('0x67')]:_0x28096b[_0x5abb('0x32')],'direction':_0x28096b[_0x5abb('0x5d')]===_0x5abb('0x6a')?'A':'C','secret':_0x28096b[_0x5abb('0x6c')],'read':_0x28096b[_0x5abb('0x5e')],'attachment':_0x28096b['Attachment']};})[_0x5abb('0x6d')]()};return ejs['renderFile'](path[_0x5abb('0x4e')](config[_0x5abb('0x51')],'server',_0x5abb('0x6e'),_0x5abb('0x6f')),{'interaction':_0x1e6948})[_0x5abb('0x17')](function(_0x4e3de8){var _0x1c5ccd=path['join'](_0x2287dc,_0x5abb('0x70')+_0x2d32f6['id']+'-'+_0x1341b6+_0x5abb('0x71'));var _0x2f6abc={'path':_0x1c5ccd,'channel':'Whatsapp','interactionId':_0x2d32f6['id']};return pdf[_0x5abb('0x72')](_0x4e3de8,_0x2f6abc);})[_0x5abb('0x17')](function(){return new BPromise(function(_0x27a0d7,_0x39ab4f){zipdir(_0x2287dc,{'saveTo':_0x4f2d8f},function(_0x21afb4,_0x14771e){if(_0x21afb4)return _0x39ab4f(_0x21afb4);return _0x27a0d7(_0x14771e);});})[_0x5abb('0x17')](function(){return new BPromise(function(_0x22c3cb,_0x4caef5){rimraf(_0x2287dc,function(_0x387d47){if(_0x387d47)_0x4caef5(_0x387d47);return _0x22c3cb();});});})[_0x5abb('0x17')](function(){return _0x191bbb['download'](_0x4f2d8f,_0x39f6f1,function(_0x2fb85a){if(_0x2fb85a){console['log'](_0x5abb('0x73'),_0x2fb85a);}else{fs[_0x5abb('0x74')](_0x4f2d8f);}});});});}else{return _0x191bbb[_0x5abb('0xe')](0xc8);}})[_0x5abb('0x34')](handleError(_0x191bbb,null));}; \ No newline at end of file +var _0x4108=['undefined','limit','count','Content-Range','update','then','destroy','error','stack','name','send','index','WhatsappInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','whatsapp','show','params','model','query','filters','intersection','attributes','fields','length','includeAll','include','options','create','catch','body','find','describe','addMessage','ids','omit','getMessages','findOne','keys','WhatsappMessage','nolimit','sort','pick','where','WhatsappInteractionId','filter','merge','map','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','spread','Tag','color','whatsappInteractionTags:save','removeTags','download','unix','toString','join','server','files','root','format','push','User','CmContact','Contact','firstName','attachments','Attachment','Messages','createdAt','direction','secret','Account','Owner','mkdirSync','N.A.','closed','closedAt','disposition','existsSync','createReadStream','pipe','createWriteStream','out','fullname','System','lastName','read','value','renderFile','downloadInteraction.ejs','.pdf','Whatsapp','err','unlinkSync','zip-dir','moment','bluebird','util','path','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset'];(function(_0x7cb10c,_0x2fcc3a){var _0x11df59=function(_0x75305f){while(--_0x75305f){_0x7cb10c['push'](_0x7cb10c['shift']());}};_0x11df59(++_0x2fcc3a);}(_0x4108,0x69));var _0x8410=function(_0x14ba88,_0xab0525){_0x14ba88=_0x14ba88-0x0;var _0x210ef4=_0x4108[_0x14ba88];return _0x210ef4;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x8410('0x0'));var moment=require(_0x8410('0x1'));var BPromise=require(_0x8410('0x2'));var util=require(_0x8410('0x3'));var path=require(_0x8410('0x4'));var ejs=require(_0x8410('0x5'));var fs=require('fs');var _=require(_0x8410('0x6'));var Redis=require('ioredis');var interaction=require(_0x8410('0x7'));var qs=require(_0x8410('0x8'));var pdf=require('../../components/export/pdf');var logger=require(_0x8410('0x9'))('api');var config=require(_0x8410('0xa'));var db=require(_0x8410('0xb'))['db'];config[_0x8410('0xc')]=_[_0x8410('0xd')](config[_0x8410('0xc')],{'host':_0x8410('0xe'),'port':0x18eb});var socket=require(_0x8410('0xf'))(new Redis(config[_0x8410('0xc')]));require(_0x8410('0x10'))[_0x8410('0x11')](socket);function respondWithStatusCode(_0x6d9d0f,_0x1695b3){_0x1695b3=_0x1695b3||0xcc;return function(_0x516b72){if(_0x516b72){return _0x6d9d0f[_0x8410('0x12')](_0x1695b3);}return _0x6d9d0f[_0x8410('0x13')](_0x1695b3)[_0x8410('0x14')]();};}function respondWithResult(_0x1a1132,_0x1cec16){_0x1cec16=_0x1cec16||0xc8;return function(_0x6083a){if(_0x6083a){return _0x1a1132['status'](_0x1cec16)[_0x8410('0x15')](_0x6083a);}};}function respondWithFilteredResult(_0x51d049,_0x2a0c9e){return function(_0x3e42b3){if(_0x3e42b3){var _0x1ce91e=typeof _0x2a0c9e[_0x8410('0x16')]===_0x8410('0x17')&&typeof _0x2a0c9e[_0x8410('0x18')]===_0x8410('0x17');var _0x238ebe=_0x3e42b3[_0x8410('0x19')];var _0x573608=_0x1ce91e?0x0:_0x2a0c9e[_0x8410('0x16')];var _0x314ac1=_0x1ce91e?_0x3e42b3[_0x8410('0x19')]:_0x2a0c9e['offset']+_0x2a0c9e[_0x8410('0x18')];var _0x5b79d6;if(_0x314ac1>=_0x238ebe){_0x314ac1=_0x238ebe;_0x5b79d6=0xc8;}else{_0x5b79d6=0xce;}_0x51d049['status'](_0x5b79d6);return _0x51d049['set'](_0x8410('0x1a'),_0x573608+'-'+_0x314ac1+'/'+_0x238ebe)[_0x8410('0x15')](_0x3e42b3);}return null;};}function saveUpdates(_0x3f44c6){return function(_0x120d14){if(_0x120d14){return _0x120d14[_0x8410('0x1b')](_0x3f44c6)[_0x8410('0x1c')](function(_0x217d4b){return _0x217d4b;});}return null;};}function removeEntity(_0xd46603){return function(_0x3a8a1d){if(_0x3a8a1d){return _0x3a8a1d[_0x8410('0x1d')]()[_0x8410('0x1c')](function(){_0xd46603[_0x8410('0x13')](0xcc)[_0x8410('0x14')]();});}};}function handleEntityNotFound(_0x49f1fa){return function(_0x5c54a9){if(!_0x5c54a9){_0x49f1fa[_0x8410('0x12')](0x194);}return _0x5c54a9;};}function handleError(_0x474c50,_0x43dbeb){_0x43dbeb=_0x43dbeb||0x1f4;return function(_0x1bb44c){logger[_0x8410('0x1e')](_0x1bb44c[_0x8410('0x1f')]);if(_0x1bb44c[_0x8410('0x20')]){delete _0x1bb44c[_0x8410('0x20')];}_0x474c50[_0x8410('0x13')](_0x43dbeb)[_0x8410('0x21')](_0x1bb44c);};}exports[_0x8410('0x22')]=function(_0x3070e8,_0x2e06b2){var _0x5869c5={};var _0x8a878e=_['map'](db[_0x8410('0x23')][_0x8410('0x24')],function(_0x471248){return{'name':_0x471248[_0x8410('0x25')],'type':_0x471248[_0x8410('0x26')][_0x8410('0x27')]};});_0x5869c5=qs[_0x8410('0x28')](_0x8a878e,_0x3070e8);return interaction[_0x8410('0x29')](_0x8410('0x2a'),_0x3070e8['query'],_0x3070e8['user'],_0x5869c5,_0x8a878e)[_0x8410('0x1c')](respondWithFilteredResult(_0x2e06b2,_0x5869c5))['catch'](handleError(_0x2e06b2,null));};exports[_0x8410('0x2b')]=function(_0x5ee350,_0x2900c6){var _0x3bb723={'raw':![],'where':{'id':_0x5ee350[_0x8410('0x2c')]['id']}},_0x578c21={};_0x578c21[_0x8410('0x2d')]=_['keys'](db[_0x8410('0x23')]['rawAttributes']);_0x578c21[_0x8410('0x2e')]=_['keys'](_0x5ee350[_0x8410('0x2e')]);_0x578c21[_0x8410('0x2f')]=_[_0x8410('0x30')](_0x578c21['model'],_0x578c21[_0x8410('0x2e')]);_0x3bb723[_0x8410('0x31')]=_[_0x8410('0x30')](_0x578c21['model'],qs['fields'](_0x5ee350[_0x8410('0x2e')][_0x8410('0x32')]));_0x3bb723[_0x8410('0x31')]=_0x3bb723[_0x8410('0x31')][_0x8410('0x33')]?_0x3bb723[_0x8410('0x31')]:_0x578c21[_0x8410('0x2d')];if(_0x5ee350['query'][_0x8410('0x34')]){_0x3bb723[_0x8410('0x35')]=[{'all':!![]}];}_0x3bb723=_['merge']({},_0x3bb723,_0x5ee350[_0x8410('0x36')]);return db['WhatsappInteraction']['find'](_0x3bb723)['then'](handleEntityNotFound(_0x2900c6,null))[_0x8410('0x1c')](respondWithResult(_0x2900c6,null))['catch'](handleError(_0x2900c6,null));};exports[_0x8410('0x37')]=function(_0x248e4b,_0x1aaac8){return db['WhatsappInteraction'][_0x8410('0x37')](_0x248e4b['body'],{})['then'](respondWithResult(_0x1aaac8,0xc9))[_0x8410('0x38')](handleError(_0x1aaac8,null));};exports[_0x8410('0x1b')]=function(_0x43fe64,_0x30e84c){if(_0x43fe64[_0x8410('0x39')]['id']){delete _0x43fe64[_0x8410('0x39')]['id'];}return db[_0x8410('0x23')]['find']({'where':{'id':_0x43fe64['params']['id']}})[_0x8410('0x1c')](handleEntityNotFound(_0x30e84c,null))['then'](saveUpdates(_0x43fe64[_0x8410('0x39')],null))[_0x8410('0x1c')](respondWithResult(_0x30e84c,null))[_0x8410('0x38')](handleError(_0x30e84c,null));};exports[_0x8410('0x1d')]=function(_0x2ff14e,_0x4e0706){return db[_0x8410('0x23')][_0x8410('0x3a')]({'where':{'id':_0x2ff14e['params']['id']}})[_0x8410('0x1c')](handleEntityNotFound(_0x4e0706,null))[_0x8410('0x1c')](removeEntity(_0x4e0706,null))['catch'](handleError(_0x4e0706,null));};exports[_0x8410('0x3b')]=function(_0x4e63d0,_0x3d792b){return db[_0x8410('0x23')][_0x8410('0x3b')]()[_0x8410('0x1c')](respondWithResult(_0x3d792b,null))[_0x8410('0x38')](handleError(_0x3d792b,null));};exports[_0x8410('0x3c')]=function(_0x237ce6,_0x4782d1){return db['WhatsappMessage'][_0x8410('0x3a')]({'where':{'id':_0x237ce6['params']['id']}})[_0x8410('0x1c')](handleEntityNotFound(_0x4782d1,null))[_0x8410('0x1c')](function(_0xd74cce){if(_0xd74cce){return _0xd74cce[_0x8410('0x3c')](_0x237ce6['body'][_0x8410('0x3d')],_[_0x8410('0x3e')](_0x237ce6[_0x8410('0x39')],[_0x8410('0x3d'),'id'])||{});}})[_0x8410('0x1c')](respondWithResult(_0x4782d1,null))['catch'](handleError(_0x4782d1,null));};exports[_0x8410('0x3f')]=function(_0x561613,_0x1a609f){var _0x221405={'raw':![],'where':{}};var _0x46c626={};var _0x31602f={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0x8410('0x40')]({'where':{'id':_0x561613[_0x8410('0x2c')]['id']}})[_0x8410('0x1c')](handleEntityNotFound(_0x1a609f,null))[_0x8410('0x1c')](function(_0x4b956f){if(_0x4b956f){_0x46c626[_0x8410('0x2d')]=_[_0x8410('0x41')](db[_0x8410('0x42')][_0x8410('0x24')]);_0x46c626['query']=_[_0x8410('0x41')](_0x561613[_0x8410('0x2e')]);_0x46c626[_0x8410('0x2f')]=_[_0x8410('0x30')](_0x46c626[_0x8410('0x2d')],_0x46c626[_0x8410('0x2e')]);_0x221405['attributes']=_[_0x8410('0x30')](_0x46c626[_0x8410('0x2d')],qs[_0x8410('0x32')](_0x561613[_0x8410('0x2e')][_0x8410('0x32')]));_0x221405[_0x8410('0x31')]=_0x221405[_0x8410('0x31')][_0x8410('0x33')]?_0x221405[_0x8410('0x31')]:_0x46c626[_0x8410('0x2d')];if(!_0x561613[_0x8410('0x2e')]['hasOwnProperty'](_0x8410('0x43'))){_0x221405['limit']=qs[_0x8410('0x18')](_0x561613[_0x8410('0x2e')][_0x8410('0x18')]);_0x221405['offset']=qs[_0x8410('0x16')](_0x561613[_0x8410('0x2e')][_0x8410('0x16')]);}_0x221405['order']=qs[_0x8410('0x44')](_0x561613[_0x8410('0x2e')][_0x8410('0x44')]);_0x221405['where']=qs[_0x8410('0x2f')](_[_0x8410('0x45')](_0x561613[_0x8410('0x2e')],_0x46c626[_0x8410('0x2f')]));_0x221405[_0x8410('0x46')][_0x8410('0x47')]=_0x4b956f['id'];if(_0x561613[_0x8410('0x2e')][_0x8410('0x48')]){_0x221405[_0x8410('0x46')]=_[_0x8410('0x49')](_0x221405[_0x8410('0x46')],{'$or':_[_0x8410('0x4a')](_0x221405['attributes'],function(_0x25ceab){var _0x2157d5={};_0x2157d5[_0x25ceab]={'$like':'%'+_0x561613[_0x8410('0x2e')]['filter']+'%'};return _0x2157d5;})});}if(_0x561613[_0x8410('0x2e')][_0x8410('0x4b')]){var _0x51ac5f=_0x561613[_0x8410('0x2e')][_0x8410('0x4b')][_0x8410('0x4c')](',');var _0x56bd22={};_0x56bd22[_0x51ac5f[0x0]]={'$gte':moment(_0x51ac5f[0x1])['format'](_0x8410('0x4d'))};_0x221405[_0x8410('0x46')]=_[_0x8410('0x49')](_0x221405[_0x8410('0x46')],_0x56bd22);}_0x221405=_[_0x8410('0x49')]({},_0x221405,_0x561613[_0x8410('0x36')]);return db[_0x8410('0x42')][_0x8410('0x19')]({'where':_0x221405[_0x8410('0x46')]})[_0x8410('0x1c')](function(_0x2e166b){_0x31602f[_0x8410('0x19')]=_0x2e166b;if(_0x561613[_0x8410('0x2e')][_0x8410('0x34')]){_0x221405['include']=[{'all':!![]}];}return db['WhatsappMessage'][_0x8410('0x29')](_0x221405);})[_0x8410('0x1c')](function(_0x321f59){_0x31602f[_0x8410('0x4e')]=_0x321f59;return _0x31602f;});}})['then'](respondWithFilteredResult(_0x1a609f,_0x221405))['catch'](handleError(_0x1a609f,null));};exports[_0x8410('0x4f')]=function(_0x4006de,_0x508c59){return db[_0x8410('0x23')]['find']({'where':{'id':_0x4006de[_0x8410('0x2c')]['id']}})['then'](handleEntityNotFound(_0x508c59,null))[_0x8410('0x1c')](function(_0xca36fd){if(_0xca36fd){return _0xca36fd[_0x8410('0x50')](_0x4006de[_0x8410('0x39')]['ids'],_['omit'](_0x4006de[_0x8410('0x39')],[_0x8410('0x3d'),'id'])||{})[_0x8410('0x51')](function(){return db[_0x8410('0x52')]['findAll']({'attributes':['id','name',_0x8410('0x53')],'where':{'id':_0x4006de[_0x8410('0x39')][_0x8410('0x3d')]}});})[_0x8410('0x1c')](function(_0x51b9d0){socket['emit'](_0x8410('0x54'),{'id':Number(_0x4006de['params']['id']),'tags':_0x51b9d0||[]});return{'id':Number(_0x4006de['params']['id']),'tags':_0x51b9d0||[]};});}})[_0x8410('0x1c')](respondWithResult(_0x508c59,null))['catch'](handleError(_0x508c59,null));};exports['removeTags']=function(_0x5f21fe,_0x3baa16){return db[_0x8410('0x23')][_0x8410('0x3a')]({'where':{'id':_0x5f21fe[_0x8410('0x2c')]['id']}})['then'](handleEntityNotFound(_0x3baa16,null))['then'](function(_0x334b6d){if(_0x334b6d){return _0x334b6d[_0x8410('0x55')](_0x5f21fe[_0x8410('0x2e')]['ids']);}})['then'](respondWithStatusCode(_0x3baa16,null))[_0x8410('0x38')](handleError(_0x3baa16,null));};exports[_0x8410('0x56')]=function(_0x1b6db7,_0x5bf0fe){var _0x259379=moment()[_0x8410('0x57')]()[_0x8410('0x58')]();var _0x587af9=path[_0x8410('0x59')](config['root'],_0x8410('0x5a'),_0x8410('0x5b'),'tmp');var _0x697158=path['join'](config[_0x8410('0x5c')],_0x8410('0x5a'),_0x8410('0x5b'),'attachments');var _0x1f786e=path['join'](_0x587af9,_0x259379);var _0x4124f7=util[_0x8410('0x5d')]('transcript-%d-%s.zip',_0x1b6db7[_0x8410('0x2c')]['id'],_0x259379);var _0x37090f=path['join'](_0x587af9,_0x4124f7);var _0x2b0929=[];_0x2b0929[_0x8410('0x5e')]({'model':db[_0x8410('0x5f')],'as':_0x8410('0x5f'),'attributes':['id','fullname'],'raw':!![]});_0x2b0929[_0x8410('0x5e')]({'model':db[_0x8410('0x60')],'as':_0x8410('0x61'),'attributes':['id',_0x8410('0x62'),'lastName'],'raw':!![]});if(_0x1b6db7[_0x8410('0x2e')][_0x8410('0x63')]){_0x2b0929[_0x8410('0x5e')]({'model':db[_0x8410('0x64')],'as':_0x8410('0x64'),'raw':!![]});}var _0x4710c2=[{'model':db[_0x8410('0x42')],'as':_0x8410('0x65'),'attributes':['id',_0x8410('0x39'),_0x8410('0x66'),_0x8410('0x67'),_0x8410('0x68'),'read'],'include':_0x2b0929}];_0x4710c2['push']({'model':db['WhatsappAccount'],'as':_0x8410('0x69'),'attributes':['id',_0x8410('0x20')]});_0x4710c2[_0x8410('0x5e')]({'model':db[_0x8410('0x5f')],'as':_0x8410('0x6a'),'attributes':['id','fullname']});return db[_0x8410('0x23')][_0x8410('0x3a')]({'where':{'id':_0x1b6db7[_0x8410('0x2c')]['id']},'include':_0x4710c2})[_0x8410('0x1c')](handleEntityNotFound(_0x5bf0fe,null))[_0x8410('0x1c')](function(_0x4a21a6){if(_0x4a21a6){var _0x2ed233=_0x4a21a6['get']({'plain':!![]});fs[_0x8410('0x6b')](_0x1f786e);var _0x50565={'channel':'Whatsapp','account':_0x2ed233[_0x8410('0x69')]['name'],'agent':_0x2ed233[_0x8410('0x6a')]?_0x2ed233['Owner']['fullname']:_0x8410('0x6c'),'createdAt':moment(_0x2ed233[_0x8410('0x66')])[_0x8410('0x5d')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x2ed233[_0x8410('0x6d')]?moment(_0x2ed233[_0x8410('0x6e')])[_0x8410('0x5d')](_0x8410('0x4d'))[_0x8410('0x58')]():'','disposition':_0x2ed233[_0x8410('0x6f')],'messages':_(_0x2ed233['Messages'])[_0x8410('0x48')]({'secret':![]})[_0x8410('0x4a')](function(_0x214dcd){if(_0x214dcd['Attachment']){var _0x58e0f8=path['join'](_0x697158,_0x214dcd['Attachment']['basename']);if(fs[_0x8410('0x70')](_0x58e0f8)){fs[_0x8410('0x71')](_0x58e0f8)[_0x8410('0x72')](fs[_0x8410('0x73')](path[_0x8410('0x59')](_0x1f786e,_0x214dcd[_0x8410('0x64')]['basename'])));}}return{'date':moment(_0x214dcd[_0x8410('0x66')])[_0x8410('0x5d')]('YYYY-MM-DD\x20HH:mm:ss')[_0x8410('0x58')](),'sender':_0x214dcd[_0x8410('0x67')]===_0x8410('0x74')?_0x214dcd['User']?_0x214dcd[_0x8410('0x5f')][_0x8410('0x75')]:_0x8410('0x76'):_0x214dcd['Contact'][_0x8410('0x62')]+(_0x214dcd['Contact']['lastName']?'\x20'+_0x214dcd['Contact'][_0x8410('0x77')]:''),'body':_0x214dcd[_0x8410('0x64')]?_0x214dcd[_0x8410('0x64')]['basename']:_0x214dcd['body'],'direction':_0x214dcd[_0x8410('0x67')]==='out'?'A':'C','secret':_0x214dcd[_0x8410('0x68')],'read':_0x214dcd[_0x8410('0x78')],'attachment':_0x214dcd['Attachment']};})[_0x8410('0x79')]()};return ejs[_0x8410('0x7a')](path[_0x8410('0x59')](config[_0x8410('0x5c')],_0x8410('0x5a'),'views',_0x8410('0x7b')),{'interaction':_0x50565})[_0x8410('0x1c')](function(_0x545970){var _0x5b00b4=path[_0x8410('0x59')](_0x1f786e,'transcript-'+_0x2ed233['id']+'-'+_0x259379+_0x8410('0x7c'));var _0x35de13={'path':_0x5b00b4,'channel':_0x8410('0x7d'),'interactionId':_0x2ed233['id']};return pdf['createPdfFromHTML'](_0x545970,_0x35de13);})[_0x8410('0x1c')](function(){return new BPromise(function(_0x5457ac,_0x7733dd){zipdir(_0x1f786e,{'saveTo':_0x37090f},function(_0x1b68ba,_0x47306c){if(_0x1b68ba)return _0x7733dd(_0x1b68ba);return _0x5457ac(_0x47306c);});})[_0x8410('0x1c')](function(){return new BPromise(function(_0x54ef92,_0x47eb32){rimraf(_0x1f786e,function(_0x424788){if(_0x424788)_0x47eb32(_0x424788);return _0x54ef92();});});})[_0x8410('0x1c')](function(){return _0x5bf0fe['download'](_0x37090f,_0x4124f7,function(_0x3d538b){if(_0x3d538b){console['log'](_0x8410('0x7e'),_0x3d538b);}else{fs[_0x8410('0x7f')](_0x37090f);}});});});}else{return _0x5bf0fe[_0x8410('0x12')](0xc8);}})['catch'](handleError(_0x5bf0fe,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index d4d4b09..8802849 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 _0xd87e=['../../mysqldb','WhatsappMessage','setMaxListeners','update','setDataValue','Users','map','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','exports','events'];(function(_0x111ca0,_0x4faf25){var _0x42d01c=function(_0x1f3aeb){while(--_0x1f3aeb){_0x111ca0['push'](_0x111ca0['shift']());}};_0x42d01c(++_0x4faf25);}(_0xd87e,0x1bf));var _0xed87=function(_0x58217c,_0x2aea63){_0x58217c=_0x58217c-0x0;var _0x4de8d6=_0xd87e[_0x58217c];return _0x4de8d6;};'use strict';var EventEmitter=require(_0xed87('0x0'));var WhatsappInteraction=require(_0xed87('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0xed87('0x1'))['db'][_0xed87('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xed87('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xed87('0x4'),'afterDestroy':'remove'};function emitEvent(_0x11a5d9){return function(_0x41ca7c,_0x5c9f03,_0x17adfe){_0x41ca7c['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0xa33c67){_0x41ca7c[_0xed87('0x5')](_0xed87('0x6'),_0xa33c67[_0xed87('0x7')](function(_0x569d66){return{'id':_0x569d66['id']};}));return WhatsappMessage[_0xed87('0x8')]({'where':{'WhatsappInteractionId':_0x41ca7c['id'],'direction':'in','read':![]},'raw':!![]});})[_0xed87('0x9')](function(_0x21d399){_0x41ca7c[_0xed87('0x5')](_0xed87('0xa'),_0x21d399[_0xed87('0xb')]);WhatsappInteractionEvents[_0xed87('0xc')](_0x11a5d9+':'+_0x41ca7c['id'],_0x41ca7c);WhatsappInteractionEvents['emit'](_0x11a5d9,_0x41ca7c);_0x17adfe(null);})[_0xed87('0xd')](_0x17adfe(null));};}for(var e in events){if(events[_0xed87('0xe')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0xed87('0xf')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x5397=['length','emit','catch','hasOwnProperty','exports','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','save','update','remove','getUsers','then','Users','findAll'];(function(_0x1e6fd6,_0x466b1f){var _0x56afda=function(_0x5d4276){while(--_0x5d4276){_0x1e6fd6['push'](_0x1e6fd6['shift']());}};_0x56afda(++_0x466b1f);}(_0x5397,0x105));var _0x7539=function(_0x2b4154,_0x4e9cba){_0x2b4154=_0x2b4154-0x0;var _0x59768f=_0x5397[_0x2b4154];return _0x59768f;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0x7539('0x0'))['db'][_0x7539('0x1')];var WhatsappMessage=require(_0x7539('0x0'))['db'][_0x7539('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x7539('0x3')](0x0);var events={'afterCreate':_0x7539('0x4'),'afterUpdate':_0x7539('0x5'),'afterDestroy':_0x7539('0x6')};function emitEvent(_0x394310){return function(_0x5b6181,_0x19dcb4,_0x3486c2){_0x5b6181[_0x7539('0x7')]({'attributes':['id'],'raw':!![]})[_0x7539('0x8')](function(_0x2e3dad){_0x5b6181['setDataValue'](_0x7539('0x9'),_0x2e3dad['map'](function(_0xa25c56){return{'id':_0xa25c56['id']};}));return WhatsappMessage[_0x7539('0xa')]({'where':{'WhatsappInteractionId':_0x5b6181['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7539('0x8')](function(_0x448095){_0x5b6181['setDataValue']('unreadMessages',_0x448095[_0x7539('0xb')]);WhatsappInteractionEvents[_0x7539('0xc')](_0x394310+':'+_0x5b6181['id'],_0x5b6181);WhatsappInteractionEvents[_0x7539('0xc')](_0x394310,_0x5b6181);_0x3486c2(null);})[_0x7539('0xd')](_0x3486c2(null));};}for(var e in events){if(events[_0x7539('0xe')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0x7539('0xf')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 7015350..811b64a 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 _0x337f=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','WhatsappInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x337f,0x11c));var _0xf337=function(_0x4f0e29,_0x1f3709){_0x4f0e29=_0x4f0e29-0x0;var _0x310707=_0x337f[_0x4f0e29];return _0x310707;};'use strict';var _=require(_0xf337('0x0'));var util=require(_0xf337('0x1'));var logger=require(_0xf337('0x2'))('api');var moment=require(_0xf337('0x3'));var BPromise=require(_0xf337('0x4'));var rp=require(_0xf337('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf337('0x6'));var config=require(_0xf337('0x7'));var attributes=require('./whatsappInteraction.attributes');module[_0xf337('0x8')]=function(_0x485b2a,_0x4580a3){return _0x485b2a['define'](_0xf337('0x9'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4b80a2,_0x1f0a95,_0x5a8308){if(_0x4b80a2[_0xf337('0xa')](_0xf337('0xb'))){_0x4b80a2[_0xf337('0xc')]=moment()[_0xf337('0xd')](_0xf337('0xe'));}_0x5a8308(null,_0x4b80a2);}}});}; \ No newline at end of file +var _0x9da6=['lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','./whatsappInteraction.attributes','exports','WhatsappInteraction','whatsapp_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x2dcea6,_0x46c44a){var _0xda3708=function(_0x2b896e){while(--_0x2b896e){_0x2dcea6['push'](_0x2dcea6['shift']());}};_0xda3708(++_0x46c44a);}(_0x9da6,0xff));var _0x69da=function(_0x449f36,_0x427a0f){_0x449f36=_0x449f36-0x0;var _0x1d5183=_0x9da6[_0x449f36];return _0x1d5183;};'use strict';var _=require(_0x69da('0x0'));var util=require(_0x69da('0x1'));var logger=require(_0x69da('0x2'))('api');var moment=require(_0x69da('0x3'));var BPromise=require(_0x69da('0x4'));var rp=require(_0x69da('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x69da('0x6'));var config=require('../../config/environment');var attributes=require(_0x69da('0x7'));module[_0x69da('0x8')]=function(_0xd1cf0d,_0x2ff4e0){return _0xd1cf0d['define'](_0x69da('0x9'),attributes,{'tableName':_0x69da('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x95c2ed,_0x101db3,_0x32dc42){if(_0x95c2ed[_0x69da('0xb')]('closed')){_0x95c2ed[_0x69da('0xc')]=moment()[_0x69da('0xd')](_0x69da('0xe'));}_0x32dc42(null,_0x95c2ed);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 2d42902..bdf30c0 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 _0xbfec=['UpdateWhatsappInteraction','AddTagsToWhatsappInteraction','addTags','ids','spread','AddTags','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','update','body','options','raw','where','attributes','limit'];(function(_0x31df6f,_0x380e73){var _0x31e353=function(_0x3a434b){while(--_0x3a434b){_0x31df6f['push'](_0x31df6f['shift']());}};_0x31e353(++_0x380e73);}(_0xbfec,0x147));var _0xcbfe=function(_0x502db4,_0x4e1361){_0x502db4=_0x502db4-0x0;var _0x2efca2=_0xbfec[_0x502db4];return _0x2efca2;};'use strict';var _=require('lodash');var util=require(_0xcbfe('0x0'));var moment=require(_0xcbfe('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcbfe('0x2'));var db=require(_0xcbfe('0x3'))['db'];var utils=require(_0xcbfe('0x4'));var logger=require(_0xcbfe('0x5'))('rpc');var config=require(_0xcbfe('0x6'));var jayson=require(_0xcbfe('0x7'));var client=jayson[_0xcbfe('0x8')][_0xcbfe('0x9')]({'port':0x232a});config['redis']=_[_0xcbfe('0xa')](config[_0xcbfe('0xb')],{'host':_0xcbfe('0xc'),'port':0x18eb});var socket=require(_0xcbfe('0xd'))(new Redis(config[_0xcbfe('0xb')]));require(_0xcbfe('0xe'))['register'](socket);function respondWithRpcPromise(_0x22951c,_0x3fc241,_0x17e1cc){return new BPromise(function(_0x1471e2,_0x28b7ac){return client[_0xcbfe('0xf')](_0x22951c,_0x17e1cc)[_0xcbfe('0x10')](function(_0xba5862){logger[_0xcbfe('0x11')](_0xcbfe('0x12'),_0x3fc241,_0xcbfe('0x13'));logger[_0xcbfe('0x14')](_0xcbfe('0x15'),_0x3fc241,_0xcbfe('0x13'),JSON['stringify'](_0xba5862));if(_0xba5862[_0xcbfe('0x16')]){if(_0xba5862[_0xcbfe('0x16')][_0xcbfe('0x17')]===0x1f4){logger[_0xcbfe('0x16')](_0xcbfe('0x12'),_0x3fc241,_0xba5862['error']['message']);return _0x28b7ac(_0xba5862[_0xcbfe('0x16')][_0xcbfe('0x18')]);}logger[_0xcbfe('0x16')](_0xcbfe('0x12'),_0x3fc241,_0xba5862['error'][_0xcbfe('0x18')]);return _0x1471e2(_0xba5862[_0xcbfe('0x16')][_0xcbfe('0x18')]);}else{logger[_0xcbfe('0x11')](_0xcbfe('0x12'),_0x3fc241,_0xcbfe('0x13'));_0x1471e2(_0xba5862[_0xcbfe('0x19')]['message']);}})['catch'](function(_0x4bc0fe){logger['error'](_0xcbfe('0x12'),_0x3fc241,_0x4bc0fe);_0x28b7ac(_0x4bc0fe);});});}exports['UpdateWhatsappInteraction']=function(_0x4f6b50){var _0x2f1a9b=this;return new Promise(function(_0x176456,_0x56d53){return db['WhatsappInteraction'][_0xcbfe('0x1a')](_0x4f6b50[_0xcbfe('0x1b')],{'raw':_0x4f6b50[_0xcbfe('0x1c')]?_0x4f6b50[_0xcbfe('0x1c')][_0xcbfe('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f6b50[_0xcbfe('0x1c')]?_0x4f6b50[_0xcbfe('0x1c')][_0xcbfe('0x1e')]||null:null,'attributes':_0x4f6b50[_0xcbfe('0x1c')]?_0x4f6b50[_0xcbfe('0x1c')][_0xcbfe('0x1f')]||null:null,'limit':_0x4f6b50[_0xcbfe('0x1c')]?_0x4f6b50[_0xcbfe('0x1c')][_0xcbfe('0x20')]||null:null})[_0xcbfe('0x10')](function(_0x287983){logger['info'](_0xcbfe('0x21'),_0x4f6b50);logger['debug'](_0xcbfe('0x21'),_0x4f6b50,JSON['stringify'](_0x287983));_0x176456(_0x287983);})['catch'](function(_0x5247ff){logger[_0xcbfe('0x16')](_0xcbfe('0x21'),_0x5247ff[_0xcbfe('0x18')],_0x4f6b50);_0x56d53(_0x2f1a9b[_0xcbfe('0x16')](0x1f4,_0x5247ff[_0xcbfe('0x18')]));});});};exports[_0xcbfe('0x22')]=function(_0xaf85fe){return new Promise(function(_0x176f50,_0x445a78){return db['WhatsappInteraction']['find']({'where':_0xaf85fe[_0xcbfe('0x1c')]?_0xaf85fe[_0xcbfe('0x1c')]['where']||null:null})['then'](function(_0x1d2e5e){if(_0x1d2e5e){return _0x1d2e5e[_0xcbfe('0x23')](_0xaf85fe[_0xcbfe('0x1b')][_0xcbfe('0x24')],_['omit'](_0xaf85fe[_0xcbfe('0x1b')],[_0xcbfe('0x24'),'id'])||{});}})[_0xcbfe('0x25')](function(_0x2ae899){logger[_0xcbfe('0x11')]('AddTags',_0xaf85fe);logger[_0xcbfe('0x14')](_0xcbfe('0x26'),_0xaf85fe,JSON['stringify'](_0x2ae899));_0x176f50(_0x2ae899);})[_0xcbfe('0x27')](function(_0x4fcb5a){logger['error']('AddTags',_0x4fcb5a[_0xcbfe('0x18')],_0xaf85fe);_0x445a78(_this[_0xcbfe('0x16')](0x1f4,_0x4fcb5a['message']));});});}; \ No newline at end of file +var _0xbf36=['raw','where','limit','then','UpdateWhatsappInteraction','WhatsappInteraction','find','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','update','options'];(function(_0x212bb6,_0x25df90){var _0x5e9aa3=function(_0x31acd2){while(--_0x31acd2){_0x212bb6['push'](_0x212bb6['shift']());}};_0x5e9aa3(++_0x25df90);}(_0xbf36,0x1b8));var _0x6bf3=function(_0x5a19fc,_0x58f9f4){_0x5a19fc=_0x5a19fc-0x0;var _0x34b413=_0xbf36[_0x5a19fc];return _0x34b413;};'use strict';var _=require(_0x6bf3('0x0'));var util=require(_0x6bf3('0x1'));var moment=require(_0x6bf3('0x2'));var BPromise=require(_0x6bf3('0x3'));var rs=require(_0x6bf3('0x4'));var fs=require('fs');var Redis=require(_0x6bf3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6bf3('0x6'));var logger=require('../../config/logger')(_0x6bf3('0x7'));var config=require(_0x6bf3('0x8'));var jayson=require(_0x6bf3('0x9'));var client=jayson['client'][_0x6bf3('0xa')]({'port':0x232a});config[_0x6bf3('0xb')]=_[_0x6bf3('0xc')](config[_0x6bf3('0xb')],{'host':_0x6bf3('0xd'),'port':0x18eb});var socket=require(_0x6bf3('0xe'))(new Redis(config[_0x6bf3('0xb')]));require(_0x6bf3('0xf'))['register'](socket);function respondWithRpcPromise(_0x5a626a,_0x122218,_0x3f4189){return new BPromise(function(_0x559eb8,_0x42a0fd){return client['request'](_0x5a626a,_0x3f4189)['then'](function(_0x564f94){logger[_0x6bf3('0x10')](_0x6bf3('0x11'),_0x122218,_0x6bf3('0x12'));logger[_0x6bf3('0x13')](_0x6bf3('0x14'),_0x122218,_0x6bf3('0x12'),JSON[_0x6bf3('0x15')](_0x564f94));if(_0x564f94[_0x6bf3('0x16')]){if(_0x564f94[_0x6bf3('0x16')]['code']===0x1f4){logger[_0x6bf3('0x16')](_0x6bf3('0x11'),_0x122218,_0x564f94[_0x6bf3('0x16')]['message']);return _0x42a0fd(_0x564f94[_0x6bf3('0x16')]['message']);}logger[_0x6bf3('0x16')]('WhatsappInteraction,\x20%s,\x20%s',_0x122218,_0x564f94[_0x6bf3('0x16')][_0x6bf3('0x17')]);return _0x559eb8(_0x564f94[_0x6bf3('0x16')][_0x6bf3('0x17')]);}else{logger[_0x6bf3('0x10')](_0x6bf3('0x11'),_0x122218,_0x6bf3('0x12'));_0x559eb8(_0x564f94[_0x6bf3('0x18')]['message']);}})[_0x6bf3('0x19')](function(_0x4785bd){logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x122218,_0x4785bd);_0x42a0fd(_0x4785bd);});});}exports['UpdateWhatsappInteraction']=function(_0x2f4ae6){var _0x5a6d1a=this;return new Promise(function(_0x22037a,_0x464399){return db['WhatsappInteraction'][_0x6bf3('0x1a')](_0x2f4ae6['body'],{'raw':_0x2f4ae6[_0x6bf3('0x1b')]?_0x2f4ae6[_0x6bf3('0x1b')][_0x6bf3('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f4ae6['options']?_0x2f4ae6[_0x6bf3('0x1b')][_0x6bf3('0x1d')]||null:null,'attributes':_0x2f4ae6[_0x6bf3('0x1b')]?_0x2f4ae6['options']['attributes']||null:null,'limit':_0x2f4ae6['options']?_0x2f4ae6[_0x6bf3('0x1b')][_0x6bf3('0x1e')]||null:null})[_0x6bf3('0x1f')](function(_0x2da8a7){logger['info'](_0x6bf3('0x20'),_0x2f4ae6);logger[_0x6bf3('0x13')](_0x6bf3('0x20'),_0x2f4ae6,JSON[_0x6bf3('0x15')](_0x2da8a7));_0x22037a(_0x2da8a7);})[_0x6bf3('0x19')](function(_0x1cb208){logger[_0x6bf3('0x16')]('UpdateWhatsappInteraction',_0x1cb208['message'],_0x2f4ae6);_0x464399(_0x5a6d1a['error'](0x1f4,_0x1cb208[_0x6bf3('0x17')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x451e72){return new Promise(function(_0x47b19c,_0x169432){return db[_0x6bf3('0x21')][_0x6bf3('0x22')]({'where':_0x451e72[_0x6bf3('0x1b')]?_0x451e72['options'][_0x6bf3('0x1d')]||null:null})[_0x6bf3('0x1f')](function(_0x126d9d){if(_0x126d9d){return _0x126d9d[_0x6bf3('0x23')](_0x451e72['body'][_0x6bf3('0x24')],_['omit'](_0x451e72['body'],[_0x6bf3('0x24'),'id'])||{});}})[_0x6bf3('0x25')](function(_0x2a9b72){logger[_0x6bf3('0x10')](_0x6bf3('0x26'),_0x451e72);logger[_0x6bf3('0x13')](_0x6bf3('0x26'),_0x451e72,JSON[_0x6bf3('0x15')](_0x2a9b72));_0x47b19c(_0x2a9b72);})[_0x6bf3('0x19')](function(_0x17de93){logger[_0x6bf3('0x16')](_0x6bf3('0x26'),_0x17de93[_0x6bf3('0x17')],_0x451e72);_0x169432(_this[_0x6bf3('0x16')](0x1f4,_0x17de93['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 60bf5e4..228dfd0 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 _0xe0dc=['emit','removeListener','register','length','./whatsappInteraction.events','save','remove'];(function(_0x42fa8f,_0x1102ed){var _0x3f5ad0=function(_0x4adb84){while(--_0x4adb84){_0x42fa8f['push'](_0x42fa8f['shift']());}};_0x3f5ad0(++_0x1102ed);}(_0xe0dc,0x18c));var _0xce0d=function(_0x74a76c,_0x87c60d){_0x74a76c=_0x74a76c-0x0;var _0x3d8e25=_0xe0dc[_0x74a76c];return _0x3d8e25;};'use strict';var WhatsappInteractionEvents=require(_0xce0d('0x0'));var events=[_0xce0d('0x1'),_0xce0d('0x2'),'update'];function createListener(_0x2f956b,_0x2a9ccb){return function(_0x167372){_0x2a9ccb[_0xce0d('0x3')](_0x2f956b,_0x167372);};}function removeListener(_0x1007d2,_0x193d40){return function(){WhatsappInteractionEvents[_0xce0d('0x4')](_0x1007d2,_0x193d40);};}exports[_0xce0d('0x5')]=function(_0x45bca5){for(var _0x5cb215=0x0,_0x16c280=events[_0xce0d('0x6')];_0x5cb215<_0x16c280;_0x5cb215++){var _0x21b7ad=events[_0x5cb215];var _0x2c848e=createListener('whatsappInteraction:'+_0x21b7ad,_0x45bca5);WhatsappInteractionEvents['on'](_0x21b7ad,_0x2c848e);}}; \ No newline at end of file +var _0x3e4b=['register','length','whatsappInteraction:','./whatsappInteraction.events','save','remove','update','removeListener'];(function(_0x5dc123,_0x1a7217){var _0xd98e38=function(_0x1332aa){while(--_0x1332aa){_0x5dc123['push'](_0x5dc123['shift']());}};_0xd98e38(++_0x1a7217);}(_0x3e4b,0x183));var _0xb3e4=function(_0x59ad43,_0x1c7fe0){_0x59ad43=_0x59ad43-0x0;var _0x38ee60=_0x3e4b[_0x59ad43];return _0x38ee60;};'use strict';var WhatsappInteractionEvents=require(_0xb3e4('0x0'));var events=[_0xb3e4('0x1'),_0xb3e4('0x2'),_0xb3e4('0x3')];function createListener(_0x301b36,_0x1a2a2d){return function(_0x890f6a){_0x1a2a2d['emit'](_0x301b36,_0x890f6a);};}function removeListener(_0x7ca113,_0xedf342){return function(){WhatsappInteractionEvents[_0xb3e4('0x4')](_0x7ca113,_0xedf342);};}exports[_0xb3e4('0x5')]=function(_0x462207){for(var _0x499536=0x0,_0x5aadea=events[_0xb3e4('0x6')];_0x499536<_0x5aadea;_0x499536++){var _0x459704=events[_0x499536];var _0x374776=createListener(_0xb3e4('0x7')+_0x459704,_0x462207);WhatsappInteractionEvents['on'](_0x459704,_0x374776);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 0d64ddb..eedd32a 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 _0x0804=['/:id/status','status','update','put','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','whatsapp','whatsappmessage:create','create','post'];(function(_0x4fa4fd,_0x4c656b){var _0x3c50d0=function(_0x223600){while(--_0x223600){_0x4fa4fd['push'](_0x4fa4fd['shift']());}};_0x3c50d0(++_0x4c656b);}(_0x0804,0x9b));var _0x4080=function(_0x2d2ca2,_0x51873f){_0x2d2ca2=_0x2d2ca2-0x0;var _0x48489d=_0x0804[_0x2d2ca2];return _0x48489d;};'use strict';var multer=require(_0x4080('0x0'));var util=require('util');var path=require(_0x4080('0x1'));var timeout=require(_0x4080('0x2'));var express=require(_0x4080('0x3'));var router=express['Router']();var fs_extra=require(_0x4080('0x4'));var auth=require(_0x4080('0x5'));var interaction=require(_0x4080('0x6'));var config=require('../../config/environment');var controller=require(_0x4080('0x7'));router['get']('/',auth[_0x4080('0x8')](),controller[_0x4080('0x9')]);router[_0x4080('0xa')](_0x4080('0xb'),auth[_0x4080('0x8')](),controller[_0x4080('0xc')]);router[_0x4080('0xa')](_0x4080('0xd'),auth['isAuthenticated'](),controller[_0x4080('0xe')]);router['post']('/',auth[_0x4080('0x8')](),interaction['tracked'](_0x4080('0xf'),_0x4080('0x10')),controller[_0x4080('0x11')]);router[_0x4080('0x12')](_0x4080('0x13'),controller[_0x4080('0x14')]);router['put'](_0x4080('0xd'),auth[_0x4080('0x8')](),controller[_0x4080('0x15')]);router[_0x4080('0x16')](_0x4080('0x17'),auth[_0x4080('0x8')](),controller[_0x4080('0x18')]);router[_0x4080('0x16')](_0x4080('0x19'),auth[_0x4080('0x8')](),controller[_0x4080('0x1a')]);router[_0x4080('0x1b')](_0x4080('0xd'),auth[_0x4080('0x8')](),controller['destroy']);module[_0x4080('0x1c')]=router; \ No newline at end of file +var _0x1cbc=['whatsapp','whatsappmessage:create','create','post','status','put','/:id/accept','accept','delete','destroy','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','tracked'];(function(_0x61c693,_0x1826ff){var _0x139963=function(_0x5425cf){while(--_0x5425cf){_0x61c693['push'](_0x61c693['shift']());}};_0x139963(++_0x1826ff);}(_0x1cbc,0x181));var _0xc1cb=function(_0x6bf16d,_0x7c0cd1){_0x6bf16d=_0x6bf16d-0x0;var _0x32a608=_0x1cbc[_0x6bf16d];return _0x32a608;};'use strict';var multer=require('multer');var util=require(_0xc1cb('0x0'));var path=require(_0xc1cb('0x1'));var timeout=require('connect-timeout');var express=require(_0xc1cb('0x2'));var router=express['Router']();var fs_extra=require(_0xc1cb('0x3'));var auth=require(_0xc1cb('0x4'));var interaction=require(_0xc1cb('0x5'));var config=require('../../config/environment');var controller=require(_0xc1cb('0x6'));router[_0xc1cb('0x7')]('/',auth[_0xc1cb('0x8')](),controller[_0xc1cb('0x9')]);router[_0xc1cb('0x7')](_0xc1cb('0xa'),auth[_0xc1cb('0x8')](),controller[_0xc1cb('0xb')]);router[_0xc1cb('0x7')](_0xc1cb('0xc'),auth[_0xc1cb('0x8')](),controller[_0xc1cb('0xd')]);router['post']('/',auth['isAuthenticated'](),interaction[_0xc1cb('0xe')](_0xc1cb('0xf'),_0xc1cb('0x10')),controller[_0xc1cb('0x11')]);router[_0xc1cb('0x12')]('/:id/status',controller[_0xc1cb('0x13')]);router[_0xc1cb('0x14')](_0xc1cb('0xc'),auth['isAuthenticated'](),controller['update']);router['put'](_0xc1cb('0x15'),auth[_0xc1cb('0x8')](),controller[_0xc1cb('0x16')]);router[_0xc1cb('0x14')]('/:id/reject',auth[_0xc1cb('0x8')](),controller['reject']);router[_0xc1cb('0x17')](_0xc1cb('0xc'),auth['isAuthenticated'](),controller[_0xc1cb('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 51477c1..add4ec9 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 _0xb493=['BOOLEAN','ENUM','out','STRING','DATE','TEXT','medium'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb493,0x116));var _0x3b49=function(_0x3540ef,_0x20ed26){_0x3540ef=_0x3540ef-0x0;var _0x6be53c=_0xb493[_0x3540ef];return _0x6be53c;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x3b49('0x0')](_0x3b49('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x3b49('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3b49('0x3')]('in',_0x3b49('0x4')),'defaultValue':_0x3b49('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x3b49('0x5')](0xbe)},'phone':{'type':Sequelize[_0x3b49('0x5')]},'readAt':{'type':Sequelize[_0x3b49('0x6')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x1061=['STRING','DATE','TEXT','sequelize','BOOLEAN','ENUM','out'];(function(_0x4174ee,_0x33bed3){var _0x1def92=function(_0x1cfdbf){while(--_0x1cfdbf){_0x4174ee['push'](_0x4174ee['shift']());}};_0x1def92(++_0x33bed3);}(_0x1061,0x1b5));var _0x1106=function(_0x4bcd2d,_0x2f674c){_0x4bcd2d=_0x4bcd2d-0x0;var _0x19b95f=_0x1061[_0x4bcd2d];return _0x19b95f;};'use strict';var Sequelize=require(_0x1106('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x1106('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1106('0x2')]('in',_0x1106('0x3')),'defaultValue':_0x1106('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0x1106('0x4')](0xbe)},'phone':{'type':Sequelize[_0x1106('0x4')]},'readAt':{'type':Sequelize[_0x1106('0x5')]},'secret':{'type':Sequelize[_0x1106('0x1')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x1106('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 1df03a5..95aec1d 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 _0x7f0e=['WhatsappAccount','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../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','./whatsappMessage.socket','jayson/promise','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','map','WhatsappMessage','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','whatsapp-interactions','accept','whatsapp','read','readAt','format','UserId','user','agent','get','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','internal','interface','rejectmessage'];(function(_0x34ad8d,_0x4a02a8){var _0x2b7956=function(_0x3f5345){while(--_0x3f5345){_0x34ad8d['push'](_0x34ad8d['shift']());}};_0x2b7956(++_0x4a02a8);}(_0x7f0e,0x1af));var _0xe7f0=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x7f0e[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe7f0('0x0'));var zipdir=require(_0xe7f0('0x1'));var jsonpatch=require(_0xe7f0('0x2'));var rp=require('request-promise');var moment=require(_0xe7f0('0x3'));var BPromise=require(_0xe7f0('0x4'));var Mustache=require(_0xe7f0('0x5'));var util=require(_0xe7f0('0x6'));var path=require(_0xe7f0('0x7'));var sox=require(_0xe7f0('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe7f0('0x9'));var _=require(_0xe7f0('0xa'));var squel=require(_0xe7f0('0xb'));var crypto=require(_0xe7f0('0xc'));var jsforce=require(_0xe7f0('0xd'));var deskjs=require(_0xe7f0('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7f0('0xf'));var qs=require(_0xe7f0('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe7f0('0x11'));var logger=require(_0xe7f0('0x12'))(_0xe7f0('0x13'));var utils=require(_0xe7f0('0x14'));var config=require(_0xe7f0('0x15'));var licenseUtil=require(_0xe7f0('0x16'));var db=require(_0xe7f0('0x17'))['db'];config[_0xe7f0('0x18')]=_[_0xe7f0('0x19')](config[_0xe7f0('0x18')],{'host':_0xe7f0('0x1a'),'port':0x18eb});var socket=require(_0xe7f0('0x1b'))(new Redis(config[_0xe7f0('0x18')]));require(_0xe7f0('0x1c'))['register'](socket);var jayson=require(_0xe7f0('0x1d'));var client=jayson['client'][_0xe7f0('0x1e')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x41d542,_0x55ce57,_0x3513cd,_0x2bb41e){return new BPromise(function(_0x759e35,_0x58e0fe){var _0x5d6b27=_0x2bb41e||client;return _0x5d6b27[_0xe7f0('0x1f')](_0x41d542,_0x3513cd)[_0xe7f0('0x20')](function(_0x31aec9){logger[_0xe7f0('0x21')](_0xe7f0('0x22'),_0x55ce57,_0xe7f0('0x23'));logger[_0xe7f0('0x24')](_0xe7f0('0x25'),_0x55ce57,_0xe7f0('0x23'),JSON['stringify'](_0x31aec9));if(_0x31aec9[_0xe7f0('0x26')]){if(_0x31aec9[_0xe7f0('0x26')][_0xe7f0('0x27')]===0x1f4){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x55ce57,_0x31aec9['error']['message']);return _0x58e0fe(_0x31aec9[_0xe7f0('0x26')][_0xe7f0('0x28')]);}logger[_0xe7f0('0x26')](_0xe7f0('0x22'),_0x55ce57,_0x31aec9['error'][_0xe7f0('0x28')]);return _0x759e35(_0x31aec9[_0xe7f0('0x26')][_0xe7f0('0x28')]);}else{logger[_0xe7f0('0x21')](_0xe7f0('0x22'),_0x55ce57,_0xe7f0('0x23'));_0x759e35(_0x31aec9[_0xe7f0('0x29')][_0xe7f0('0x28')]);}})['catch'](function(_0x280b0a){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x55ce57,_0x280b0a);_0x58e0fe(_0x280b0a);});});}function respondWithStatusCode(_0x3b5186,_0x169698){_0x169698=_0x169698||0xcc;return function(_0x34519f){if(_0x34519f){return _0x3b5186[_0xe7f0('0x2a')](_0x169698);}return _0x3b5186[_0xe7f0('0x2b')](_0x169698)[_0xe7f0('0x2c')]();};}function respondWithResult(_0x32674f,_0x5769ad){_0x5769ad=_0x5769ad||0xc8;return function(_0x3675c6){if(_0x3675c6){return _0x32674f[_0xe7f0('0x2b')](_0x5769ad)[_0xe7f0('0x2d')](_0x3675c6);}};}function respondWithFilteredResult(_0x2e08bc,_0x33e9e3){return function(_0x22d2a5){if(_0x22d2a5){var _0x3b3d25=typeof _0x33e9e3[_0xe7f0('0x2e')]===_0xe7f0('0x2f')&&typeof _0x33e9e3[_0xe7f0('0x30')]===_0xe7f0('0x2f');var _0x3cbd8c=_0x22d2a5[_0xe7f0('0x31')];var _0x15b80c=_0x3b3d25?0x0:_0x33e9e3[_0xe7f0('0x2e')];var _0x4567d1=_0x3b3d25?_0x22d2a5[_0xe7f0('0x31')]:_0x33e9e3[_0xe7f0('0x2e')]+_0x33e9e3[_0xe7f0('0x30')];var _0x5d8e9b;if(_0x4567d1>=_0x3cbd8c){_0x4567d1=_0x3cbd8c;_0x5d8e9b=0xc8;}else{_0x5d8e9b=0xce;}_0x2e08bc[_0xe7f0('0x2b')](_0x5d8e9b);return _0x2e08bc[_0xe7f0('0x32')](_0xe7f0('0x33'),_0x15b80c+'-'+_0x4567d1+'/'+_0x3cbd8c)['json'](_0x22d2a5);}return null;};}function patchUpdates(_0x5a4c4c){return function(_0x1d95de){try{jsonpatch[_0xe7f0('0x34')](_0x1d95de,_0x5a4c4c,!![]);}catch(_0x3ef641){return BPromise[_0xe7f0('0x35')](_0x3ef641);}return _0x1d95de[_0xe7f0('0x36')]();};}function saveUpdates(_0x182561,_0x324433){return function(_0x1334f9){if(_0x1334f9){return _0x1334f9[_0xe7f0('0x37')](_0x182561)[_0xe7f0('0x20')](function(_0x1ee67c){return _0x1ee67c;});}return null;};}function removeEntity(_0x3a7268,_0x440822){return function(_0x61f563){if(_0x61f563){return _0x61f563[_0xe7f0('0x38')]()[_0xe7f0('0x20')](function(){_0x3a7268['status'](0xcc)[_0xe7f0('0x2c')]();});}};}function handleEntityNotFound(_0x4f6780,_0x3d5980){return function(_0x380348){if(!_0x380348){_0x4f6780[_0xe7f0('0x2a')](0x194);}return _0x380348;};}function handleError(_0x422dcc,_0x463f40){_0x463f40=_0x463f40||0x1f4;return function(_0xaf9589){logger['error'](_0xaf9589[_0xe7f0('0x39')]);if(_0xaf9589[_0xe7f0('0x3a')]){delete _0xaf9589[_0xe7f0('0x3a')];}_0x422dcc[_0xe7f0('0x2b')](_0x463f40)[_0xe7f0('0x3b')](_0xaf9589);};}exports['index']=function(_0xce5ba8,_0xd3f7d9){var _0x3d3eba={},_0x591315={},_0x364297={'count':0x0,'rows':[]};var _0x5747b6=_[_0xe7f0('0x3c')](db[_0xe7f0('0x3d')][_0xe7f0('0x3e')],function(_0x2a305d){return{'name':_0x2a305d['fieldName'],'type':_0x2a305d[_0xe7f0('0x3f')]['key']};});_0x591315[_0xe7f0('0x40')]=_['map'](_0x5747b6,'name');_0x591315[_0xe7f0('0x41')]=_[_0xe7f0('0x42')](_0xce5ba8[_0xe7f0('0x41')]);_0x591315['filters']=_[_0xe7f0('0x43')](_0x591315[_0xe7f0('0x40')],_0x591315['query']);_0x3d3eba[_0xe7f0('0x44')]=_[_0xe7f0('0x43')](_0x591315[_0xe7f0('0x40')],qs[_0xe7f0('0x45')](_0xce5ba8[_0xe7f0('0x41')][_0xe7f0('0x45')]));_0x3d3eba[_0xe7f0('0x44')]=_0x3d3eba[_0xe7f0('0x44')][_0xe7f0('0x46')]?_0x3d3eba[_0xe7f0('0x44')]:_0x591315[_0xe7f0('0x40')];if(!_0xce5ba8['query']['hasOwnProperty'](_0xe7f0('0x47'))){_0x3d3eba[_0xe7f0('0x30')]=qs[_0xe7f0('0x30')](_0xce5ba8[_0xe7f0('0x41')][_0xe7f0('0x30')]);_0x3d3eba[_0xe7f0('0x2e')]=qs[_0xe7f0('0x2e')](_0xce5ba8['query'][_0xe7f0('0x2e')]);}_0x3d3eba[_0xe7f0('0x48')]=qs[_0xe7f0('0x49')](_0xce5ba8['query'][_0xe7f0('0x49')]);_0x3d3eba['where']=qs[_0xe7f0('0x4a')](_[_0xe7f0('0x4b')](_0xce5ba8[_0xe7f0('0x41')],_0x591315[_0xe7f0('0x4a')]),_0x5747b6);if(_0xce5ba8[_0xe7f0('0x41')][_0xe7f0('0x4c')]){_0x3d3eba['where']=_['merge'](_0x3d3eba[_0xe7f0('0x4d')],{'$or':_[_0xe7f0('0x3c')](_0x5747b6,function(_0x1760ad){if(_0x1760ad[_0xe7f0('0x3f')]!=='VIRTUAL'){var _0x50c025={};_0x50c025[_0x1760ad[_0xe7f0('0x3a')]]={'$like':'%'+_0xce5ba8['query'][_0xe7f0('0x4c')]+'%'};return _0x50c025;}})});}_0x3d3eba=_[_0xe7f0('0x4e')]({},_0x3d3eba,_0xce5ba8[_0xe7f0('0x4f')]);var _0x7eb49a={'where':_0x3d3eba['where']};return db['WhatsappMessage'][_0xe7f0('0x31')](_0x7eb49a)[_0xe7f0('0x20')](function(_0xcd9fe6){_0x364297[_0xe7f0('0x31')]=_0xcd9fe6;if(_0xce5ba8[_0xe7f0('0x41')][_0xe7f0('0x50')]){_0x3d3eba[_0xe7f0('0x51')]=[{'all':!![]}];}return db[_0xe7f0('0x3d')][_0xe7f0('0x52')](_0x3d3eba);})['then'](function(_0x2e52f9){_0x364297[_0xe7f0('0x53')]=_0x2e52f9;return _0x364297;})[_0xe7f0('0x20')](respondWithFilteredResult(_0xd3f7d9,_0x3d3eba))[_0xe7f0('0x54')](handleError(_0xd3f7d9,null));};exports[_0xe7f0('0x55')]=function(_0x40698b,_0x371725){var _0x17bb8c={'raw':!![],'where':{'id':_0x40698b[_0xe7f0('0x56')]['id']}},_0x4d774f={};_0x4d774f[_0xe7f0('0x40')]=_[_0xe7f0('0x42')](db[_0xe7f0('0x3d')][_0xe7f0('0x3e')]);_0x4d774f[_0xe7f0('0x41')]=_['keys'](_0x40698b[_0xe7f0('0x41')]);_0x4d774f[_0xe7f0('0x4a')]=_[_0xe7f0('0x43')](_0x4d774f[_0xe7f0('0x40')],_0x4d774f[_0xe7f0('0x41')]);_0x17bb8c[_0xe7f0('0x44')]=_[_0xe7f0('0x43')](_0x4d774f['model'],qs[_0xe7f0('0x45')](_0x40698b[_0xe7f0('0x41')][_0xe7f0('0x45')]));_0x17bb8c[_0xe7f0('0x44')]=_0x17bb8c[_0xe7f0('0x44')][_0xe7f0('0x46')]?_0x17bb8c['attributes']:_0x4d774f['model'];if(_0x40698b[_0xe7f0('0x41')]['includeAll']){_0x17bb8c[_0xe7f0('0x51')]=[{'all':!![]}];}_0x17bb8c=_[_0xe7f0('0x4e')]({},_0x17bb8c,_0x40698b[_0xe7f0('0x4f')]);return db['WhatsappMessage'][_0xe7f0('0x57')](_0x17bb8c)[_0xe7f0('0x20')](handleEntityNotFound(_0x371725,null))[_0xe7f0('0x20')](respondWithResult(_0x371725,null))[_0xe7f0('0x54')](handleError(_0x371725,null));};exports[_0xe7f0('0x58')]=function(_0x4313e9,_0x265d11){return db[_0xe7f0('0x3d')][_0xe7f0('0x58')](_0x4313e9['body'],{})[_0xe7f0('0x20')](respondWithResult(_0x265d11,0xc9))[_0xe7f0('0x54')](handleError(_0x265d11,null));};exports['update']=function(_0x232953,_0x1be94e){if(_0x232953[_0xe7f0('0x59')]['id']){delete _0x232953['body']['id'];}return db[_0xe7f0('0x3d')][_0xe7f0('0x57')]({'where':{'id':_0x232953[_0xe7f0('0x56')]['id']}})[_0xe7f0('0x20')](handleEntityNotFound(_0x1be94e,null))[_0xe7f0('0x20')](saveUpdates(_0x232953[_0xe7f0('0x59')],null))[_0xe7f0('0x20')](respondWithResult(_0x1be94e,null))[_0xe7f0('0x54')](handleError(_0x1be94e,null));};exports[_0xe7f0('0x38')]=function(_0x4b3cd2,_0x4b85f9){return db[_0xe7f0('0x3d')]['find']({'where':{'id':_0x4b3cd2[_0xe7f0('0x56')]['id']}})[_0xe7f0('0x20')](handleEntityNotFound(_0x4b85f9,null))['then'](removeEntity(_0x4b85f9,null))[_0xe7f0('0x54')](handleError(_0x4b85f9,null));};exports[_0xe7f0('0x5a')]=function(_0x2c5945,_0x36e26a){return db['WhatsappMessage'][_0xe7f0('0x5a')]()[_0xe7f0('0x20')](respondWithResult(_0x36e26a,null))[_0xe7f0('0x54')](handleError(_0x36e26a,null));};var interaction_log=require(_0xe7f0('0x12'))(_0xe7f0('0x5b'));exports[_0xe7f0('0x5c')]=function(_0x38e702,_0x5d2352,_0x1bf921){var _0x406608={'agent':{},'channel':_0xe7f0('0x5d')};if(_0x38e702['body']['id']){delete _0x38e702[_0xe7f0('0x59')]['id'];}_0x38e702[_0xe7f0('0x59')][_0xe7f0('0x5e')]=!![];_0x38e702[_0xe7f0('0x59')][_0xe7f0('0x5f')]=moment()[_0xe7f0('0x60')]('YYYY-MM-DD\x20HH:mm:ss');_0x38e702['body'][_0xe7f0('0x61')]=_0x38e702[_0xe7f0('0x59')][_0xe7f0('0x61')]||_0x38e702[_0xe7f0('0x62')]['id'];_0x406608[_0xe7f0('0x63')]['id']=_0x38e702[_0xe7f0('0x59')]['UserId'];return db[_0xe7f0('0x3d')][_0xe7f0('0x57')]({'where':{'id':_0x38e702[_0xe7f0('0x56')]['id'],'UserId':null}})[_0xe7f0('0x20')](handleEntityNotFound(_0x5d2352,null))['then'](saveUpdates(_0x38e702['body'],null))['then'](function(_0x250876){if(_0x250876){_0x406608['message']=_0x250876[_0xe7f0('0x64')]({'plain':!![]});return db['WhatsappInteraction'][_0xe7f0('0x57')]({'where':{'id':_0x250876['WhatsappInteractionId']}});}return null;})[_0xe7f0('0x20')](handleEntityNotFound(_0x5d2352,null))[_0xe7f0('0x20')](function(_0x5933d1){if(_0x5933d1){return _0x5933d1['update']({'UserId':_0x38e702[_0xe7f0('0x59')][_0xe7f0('0x61')],'read1stAt':_[_0xe7f0('0x65')](_0x5933d1['read1stAt'])?moment()[_0xe7f0('0x60')](_0xe7f0('0x66')):undefined});}return null;})['then'](function(_0x120783){if(_0x120783){_0x406608[_0xe7f0('0x67')]=_0x120783[_0xe7f0('0x64')]({'plain':!![]});interaction_log['info'](_0xe7f0('0x68'),_0x38e702[_0xe7f0('0x62')]['id'],_0x38e702['user'][_0xe7f0('0x3a')],_0x38e702[_0xe7f0('0x62')][_0xe7f0('0x69')],_0x406608[_0xe7f0('0x67')]['id'],_0x38e702[_0xe7f0('0x59')]?JSON[_0xe7f0('0x6a')](_0x38e702[_0xe7f0('0x59')]):_0xe7f0('0x6b'));return respondWithRpcPromise(_0xe7f0('0x6c'),_0xe7f0('0x6d'),_0x406608);}return null;})[_0xe7f0('0x20')](function(_0x68d16b){var _0x5ac25d=_0xe7f0('0x6e')+_0x68d16b[_0xe7f0('0x28')][_0xe7f0('0x6f')];return db[_0xe7f0('0x70')]['query'](_0x5ac25d,{'type':db[_0xe7f0('0x71')][_0xe7f0('0x72')][_0xe7f0('0x73')],'raw':!![]})['then'](function(_0x4e5ea9){return _0x4e5ea9;});})[_0xe7f0('0x20')](function(_0x1faad){if(_0x1faad){_0x406608['message'][_0xe7f0('0x74')]=_0x1faad[0x0];if(!_0x38e702[_0xe7f0('0x59')][_0xe7f0('0x61')])return;return db[_0xe7f0('0x75')][_0xe7f0('0x57')]({'where':{'id':_0x38e702['body'][_0xe7f0('0x61')],'role':'agent'},'attributes':['id',_0xe7f0('0x3a'),_0xe7f0('0x76'),_0xe7f0('0x77'),'internal'],'raw':!![]});}return null;})['then'](function(_0x1a06fc){if(!_0x1a06fc)return null;_0x406608[_0xe7f0('0x28')][_0xe7f0('0x63')]=_0x1a06fc;return _0x406608;})['then'](function(_0x537286){if(_0x537286){if(_0x38e702['body'][_0xe7f0('0x78')]){_0x406608['message']['interface']=util[_0xe7f0('0x60')](_0xe7f0('0x79'),_0x38e702['user'][_0xe7f0('0x3a')]);_0x406608['message'][_0xe7f0('0x7a')]=_0x406608[_0xe7f0('0x7a')];_0x406608[_0xe7f0('0x28')][_0xe7f0('0x7b')]=_0x406608[_0xe7f0('0x7a')];_0x406608[_0xe7f0('0x28')][_0xe7f0('0x7c')]=_0xe7f0('0x5c');return respondWithRpcPromise(_0xe7f0('0x7d'),_0xe7f0('0x7d'),{'event':_0xe7f0('0x7e'),'message':_0x406608[_0xe7f0('0x28')]},client9002)['then'](function(){return _0x406608;});}return _0x406608;}return null;})['then'](respondWithResult(_0x5d2352,null))['catch'](handleError(_0x5d2352,null));};var interaction_log=require('../../config/logger')('whatsapp-interactions');exports[_0xe7f0('0x35')]=function(_0xa3d0c8,_0x231680,_0x26fb94){var _0x372b58={'agent':{},'channel':_0xe7f0('0x5d')};if(_0xa3d0c8[_0xe7f0('0x59')]['id']){delete _0xa3d0c8[_0xe7f0('0x59')]['id'];}_0xa3d0c8['body'][_0xe7f0('0x61')]=_0xa3d0c8[_0xe7f0('0x59')][_0xe7f0('0x61')]||_0xa3d0c8[_0xe7f0('0x62')]['id'];_0x372b58['agent']['id']=_0xa3d0c8[_0xe7f0('0x59')]['UserId'];return db[_0xe7f0('0x3d')][_0xe7f0('0x57')]({'where':{'id':_0xa3d0c8[_0xe7f0('0x56')]['id'],'UserId':null}})[_0xe7f0('0x20')](handleEntityNotFound(_0x231680,null))[_0xe7f0('0x20')](function(_0x573e1a){if(_0x573e1a){_0x372b58[_0xe7f0('0x28')]=_0x573e1a[_0xe7f0('0x64')]({'plain':!![]});return db['WhatsappInteraction'][_0xe7f0('0x57')]({'where':{'id':_0x573e1a['WhatsappInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x231680,null))[_0xe7f0('0x20')](function(_0x18e466){if(_0x18e466){_0x372b58[_0xe7f0('0x67')]=_0x18e466[_0xe7f0('0x64')]({'plain':!![]});interaction_log[_0xe7f0('0x21')](_0xe7f0('0x7f'),_0xa3d0c8['user']['id'],_0xa3d0c8[_0xe7f0('0x62')][_0xe7f0('0x3a')],_0xa3d0c8[_0xe7f0('0x62')][_0xe7f0('0x69')],_0x372b58[_0xe7f0('0x67')]['id'],_0xa3d0c8[_0xe7f0('0x59')]?JSON[_0xe7f0('0x6a')](_0xa3d0c8[_0xe7f0('0x59')]):'null');return respondWithRpcPromise(_0xe7f0('0x80'),_0xe7f0('0x81'),_0x372b58);}return null;})['then'](function(_0x100d01){var _0x4a55e4=_0xe7f0('0x6e')+_0x100d01[_0xe7f0('0x28')][_0xe7f0('0x6f')];return db['sequelize'][_0xe7f0('0x41')](_0x4a55e4,{'type':db[_0xe7f0('0x71')][_0xe7f0('0x72')]['SELECT'],'raw':!![]})[_0xe7f0('0x20')](function(_0x5721d7){return _0x5721d7;});})[_0xe7f0('0x20')](function(_0xc518d9){if(_0xc518d9){_0x372b58[_0xe7f0('0x28')]['contact']=_0xc518d9[0x0];if(!_0xa3d0c8[_0xe7f0('0x59')][_0xe7f0('0x61')])return;return db['User']['find']({'where':{'id':_0xa3d0c8[_0xe7f0('0x59')][_0xe7f0('0x61')],'role':_0xe7f0('0x63')},'attributes':['id',_0xe7f0('0x3a'),_0xe7f0('0x76'),_0xe7f0('0x77'),_0xe7f0('0x82')],'raw':!![]});}return null;})[_0xe7f0('0x20')](function(_0x1738d6){if(!_0x1738d6)return null;_0x372b58[_0xe7f0('0x28')][_0xe7f0('0x63')]=_0x1738d6;return _0x372b58;})[_0xe7f0('0x20')](function(_0x5c8f43){if(_0x5c8f43){_0x5c8f43[_0xe7f0('0x28')][_0xe7f0('0x83')]=util[_0xe7f0('0x60')](_0xe7f0('0x79'),_0xa3d0c8[_0xe7f0('0x62')][_0xe7f0('0x3a')]);_0x5c8f43[_0xe7f0('0x28')]['channel']=_0x372b58[_0xe7f0('0x7a')];_0x5c8f43[_0xe7f0('0x28')][_0xe7f0('0x7b')]=_0x372b58[_0xe7f0('0x7a')];_0x5c8f43['message'][_0xe7f0('0x7c')]=_0xe7f0('0x35');respondWithRpcPromise(_0xe7f0('0x7d'),_0xe7f0('0x7d'),{'event':_0xe7f0('0x84'),'message':_0x5c8f43['message']},client9002);return _0x372b58;}return null;})[_0xe7f0('0x20')](respondWithResult(_0x231680,null))[_0xe7f0('0x54')](handleError(_0x231680,null));};exports[_0xe7f0('0x2b')]=function(_0x1d9f88,_0x2f898d,_0x1fdbf5){if(_0x1d9f88['body']['id']){delete _0x1d9f88[_0xe7f0('0x59')]['id'];}var _0x40713b;return db[_0xe7f0('0x3d')][_0xe7f0('0x57')]({'where':{'id':_0x1d9f88[_0xe7f0('0x56')]['id']}})[_0xe7f0('0x20')](handleEntityNotFound(_0x2f898d,null))[_0xe7f0('0x20')](function(_0x13b6be){if(_0x13b6be){_0x40713b=_0x13b6be;return db[_0xe7f0('0x85')][_0xe7f0('0x57')]({'where':{'id':_0x13b6be['WhatsappAccountId']}});}})['then'](handleEntityNotFound(_0x2f898d,null))[_0xe7f0('0x20')](function(_0x139fe7){if(_0x139fe7){logger[_0xe7f0('0x24')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0xe7f0('0x2b'),_0xe7f0('0x86'),_0x139fe7[_0xe7f0('0x3f')],util[_0xe7f0('0x87')](_0x1d9f88[_0xe7f0('0x59')],{'showHidden':![],'depth':null}));switch(_0x139fe7[_0xe7f0('0x3f')]){case'twilio':if(_0x1d9f88['body'][_0xe7f0('0x88')]&&_0x1d9f88['body']['MessageSid']===_0x40713b[_0xe7f0('0x89')]&&_0x1d9f88[_0xe7f0('0x59')]['MessageStatus']&&_0x1d9f88[_0xe7f0('0x59')][_0xe7f0('0x8a')]===_0xe7f0('0x5e')){return _0x40713b[_0xe7f0('0x37')]({'read':!![]});}else{logger[_0xe7f0('0x26')](_0xe7f0('0x8b'),_0xe7f0('0x2b'),_0xe7f0('0x8c'),util['inspect'](_0x1d9f88[_0xe7f0('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x40713b;}})[_0xe7f0('0x20')](respondWithResult(_0x2f898d,null))['catch'](handleError(_0x2f898d,null));}; \ No newline at end of file +var _0xd3e1=['nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','create','body','describe','whatsapp-interactions','accept','whatsapp','read','readAt','format','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','RejectMessage','rejectMessage','sequelize','contact','rejectmessage','WhatsappAccount','WhatsappAccountId','debug','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','redis','localhost','socket.io-emitter','register','client','http','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','name','send','map','WhatsappMessage','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x1ae491,_0x5b83b9){var _0x4958a5=function(_0xf0f364){while(--_0xf0f364){_0x1ae491['push'](_0x1ae491['shift']());}};_0x4958a5(++_0x5b83b9);}(_0xd3e1,0xd1));var _0x1d3e=function(_0x3a5431,_0x405cc6){_0x3a5431=_0x3a5431-0x0;var _0xa0406c=_0xd3e1[_0x3a5431];return _0xa0406c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1d3e('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1d3e('0x1'));var moment=require(_0x1d3e('0x2'));var BPromise=require(_0x1d3e('0x3'));var Mustache=require(_0x1d3e('0x4'));var util=require(_0x1d3e('0x5'));var path=require(_0x1d3e('0x6'));var sox=require(_0x1d3e('0x7'));var csv=require(_0x1d3e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1d3e('0x9'));var squel=require(_0x1d3e('0xa'));var crypto=require(_0x1d3e('0xb'));var jsforce=require(_0x1d3e('0xc'));var deskjs=require(_0x1d3e('0xd'));var toCsv=require(_0x1d3e('0x8'));var querystring=require(_0x1d3e('0xe'));var Papa=require('papaparse');var Redis=require(_0x1d3e('0xf'));var authService=require(_0x1d3e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x1d3e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1d3e('0x12'))(_0x1d3e('0x13'));var utils=require(_0x1d3e('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x1d3e('0x15')]=_['defaults'](config[_0x1d3e('0x15')],{'host':_0x1d3e('0x16'),'port':0x18eb});var socket=require(_0x1d3e('0x17'))(new Redis(config[_0x1d3e('0x15')]));require('./whatsappMessage.socket')[_0x1d3e('0x18')](socket);var jayson=require('jayson/promise');var client=jayson[_0x1d3e('0x19')][_0x1d3e('0x1a')]({'port':0x232c});var client9002=jayson[_0x1d3e('0x19')][_0x1d3e('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x225614,_0x3115c2,_0x47632d,_0x6f8674){return new BPromise(function(_0x5598b0,_0x340c0a){var _0x329865=_0x6f8674||client;return _0x329865['request'](_0x225614,_0x47632d)[_0x1d3e('0x1b')](function(_0x3c1dcf){logger[_0x1d3e('0x1c')](_0x1d3e('0x1d'),_0x3115c2,_0x1d3e('0x1e'));logger['debug'](_0x1d3e('0x1f'),_0x3115c2,_0x1d3e('0x1e'),JSON['stringify'](_0x3c1dcf));if(_0x3c1dcf[_0x1d3e('0x20')]){if(_0x3c1dcf[_0x1d3e('0x20')][_0x1d3e('0x21')]===0x1f4){logger[_0x1d3e('0x20')](_0x1d3e('0x1d'),_0x3115c2,_0x3c1dcf['error'][_0x1d3e('0x22')]);return _0x340c0a(_0x3c1dcf[_0x1d3e('0x20')][_0x1d3e('0x22')]);}logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x3115c2,_0x3c1dcf['error']['message']);return _0x5598b0(_0x3c1dcf[_0x1d3e('0x20')][_0x1d3e('0x22')]);}else{logger[_0x1d3e('0x1c')](_0x1d3e('0x1d'),_0x3115c2,_0x1d3e('0x1e'));_0x5598b0(_0x3c1dcf[_0x1d3e('0x23')][_0x1d3e('0x22')]);}})[_0x1d3e('0x24')](function(_0x346842){logger[_0x1d3e('0x20')](_0x1d3e('0x1d'),_0x3115c2,_0x346842);_0x340c0a(_0x346842);});});}function respondWithStatusCode(_0x330611,_0x451e78){_0x451e78=_0x451e78||0xcc;return function(_0x3d49f8){if(_0x3d49f8){return _0x330611[_0x1d3e('0x25')](_0x451e78);}return _0x330611[_0x1d3e('0x26')](_0x451e78)[_0x1d3e('0x27')]();};}function respondWithResult(_0x15f353,_0x13d102){_0x13d102=_0x13d102||0xc8;return function(_0x2fdc13){if(_0x2fdc13){return _0x15f353[_0x1d3e('0x26')](_0x13d102)[_0x1d3e('0x28')](_0x2fdc13);}};}function respondWithFilteredResult(_0x522571,_0x1af0c7){return function(_0x26afe9){if(_0x26afe9){var _0x3f80e2=typeof _0x1af0c7[_0x1d3e('0x29')]===_0x1d3e('0x2a')&&typeof _0x1af0c7[_0x1d3e('0x2b')]===_0x1d3e('0x2a');var _0x100a46=_0x26afe9[_0x1d3e('0x2c')];var _0x522e80=_0x3f80e2?0x0:_0x1af0c7[_0x1d3e('0x29')];var _0x3feaa5=_0x3f80e2?_0x26afe9[_0x1d3e('0x2c')]:_0x1af0c7[_0x1d3e('0x29')]+_0x1af0c7['limit'];var _0x5593ba;if(_0x3feaa5>=_0x100a46){_0x3feaa5=_0x100a46;_0x5593ba=0xc8;}else{_0x5593ba=0xce;}_0x522571['status'](_0x5593ba);return _0x522571[_0x1d3e('0x2d')]('Content-Range',_0x522e80+'-'+_0x3feaa5+'/'+_0x100a46)['json'](_0x26afe9);}return null;};}function patchUpdates(_0x293e92){return function(_0x26d99b){try{jsonpatch[_0x1d3e('0x2e')](_0x26d99b,_0x293e92,!![]);}catch(_0x49fff5){return BPromise[_0x1d3e('0x2f')](_0x49fff5);}return _0x26d99b[_0x1d3e('0x30')]();};}function saveUpdates(_0x652d1e,_0x329925){return function(_0x59c7ea){if(_0x59c7ea){return _0x59c7ea[_0x1d3e('0x31')](_0x652d1e)[_0x1d3e('0x1b')](function(_0x2e9d92){return _0x2e9d92;});}return null;};}function removeEntity(_0x59479d,_0x59795b){return function(_0x358626){if(_0x358626){return _0x358626[_0x1d3e('0x32')]()['then'](function(){_0x59479d[_0x1d3e('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1165d1,_0x454d8f){return function(_0xf1fdf){if(!_0xf1fdf){_0x1165d1[_0x1d3e('0x25')](0x194);}return _0xf1fdf;};}function handleError(_0x403088,_0x536676){_0x536676=_0x536676||0x1f4;return function(_0xa6bb38){logger[_0x1d3e('0x20')](_0xa6bb38['stack']);if(_0xa6bb38[_0x1d3e('0x33')]){delete _0xa6bb38[_0x1d3e('0x33')];}_0x403088[_0x1d3e('0x26')](_0x536676)[_0x1d3e('0x34')](_0xa6bb38);};}exports['index']=function(_0x14db42,_0x432426){var _0x5d1121={},_0x2b8310={},_0xe3fdfc={'count':0x0,'rows':[]};var _0x517690=_[_0x1d3e('0x35')](db[_0x1d3e('0x36')][_0x1d3e('0x37')],function(_0x12c202){return{'name':_0x12c202[_0x1d3e('0x38')],'type':_0x12c202[_0x1d3e('0x39')][_0x1d3e('0x3a')]};});_0x2b8310[_0x1d3e('0x3b')]=_[_0x1d3e('0x35')](_0x517690,_0x1d3e('0x33'));_0x2b8310[_0x1d3e('0x3c')]=_[_0x1d3e('0x3d')](_0x14db42[_0x1d3e('0x3c')]);_0x2b8310['filters']=_[_0x1d3e('0x3e')](_0x2b8310[_0x1d3e('0x3b')],_0x2b8310[_0x1d3e('0x3c')]);_0x5d1121[_0x1d3e('0x3f')]=_[_0x1d3e('0x3e')](_0x2b8310[_0x1d3e('0x3b')],qs['fields'](_0x14db42[_0x1d3e('0x3c')][_0x1d3e('0x40')]));_0x5d1121[_0x1d3e('0x3f')]=_0x5d1121[_0x1d3e('0x3f')][_0x1d3e('0x41')]?_0x5d1121[_0x1d3e('0x3f')]:_0x2b8310['model'];if(!_0x14db42[_0x1d3e('0x3c')][_0x1d3e('0x42')](_0x1d3e('0x43'))){_0x5d1121[_0x1d3e('0x2b')]=qs[_0x1d3e('0x2b')](_0x14db42['query'][_0x1d3e('0x2b')]);_0x5d1121[_0x1d3e('0x29')]=qs[_0x1d3e('0x29')](_0x14db42[_0x1d3e('0x3c')][_0x1d3e('0x29')]);}_0x5d1121['order']=qs[_0x1d3e('0x44')](_0x14db42[_0x1d3e('0x3c')][_0x1d3e('0x44')]);_0x5d1121[_0x1d3e('0x45')]=qs[_0x1d3e('0x46')](_[_0x1d3e('0x47')](_0x14db42[_0x1d3e('0x3c')],_0x2b8310[_0x1d3e('0x46')]),_0x517690);if(_0x14db42['query'][_0x1d3e('0x48')]){_0x5d1121['where']=_[_0x1d3e('0x49')](_0x5d1121['where'],{'$or':_[_0x1d3e('0x35')](_0x517690,function(_0x1c180d){if(_0x1c180d[_0x1d3e('0x39')]!==_0x1d3e('0x4a')){var _0x3db899={};_0x3db899[_0x1c180d[_0x1d3e('0x33')]]={'$like':'%'+_0x14db42['query'][_0x1d3e('0x48')]+'%'};return _0x3db899;}})});}_0x5d1121=_[_0x1d3e('0x49')]({},_0x5d1121,_0x14db42[_0x1d3e('0x4b')]);var _0x418b7e={'where':_0x5d1121[_0x1d3e('0x45')]};return db[_0x1d3e('0x36')]['count'](_0x418b7e)['then'](function(_0x1d333e){_0xe3fdfc[_0x1d3e('0x2c')]=_0x1d333e;if(_0x14db42[_0x1d3e('0x3c')]['includeAll']){_0x5d1121[_0x1d3e('0x4c')]=[{'all':!![]}];}return db[_0x1d3e('0x36')][_0x1d3e('0x4d')](_0x5d1121);})[_0x1d3e('0x1b')](function(_0x115725){_0xe3fdfc[_0x1d3e('0x4e')]=_0x115725;return _0xe3fdfc;})[_0x1d3e('0x1b')](respondWithFilteredResult(_0x432426,_0x5d1121))[_0x1d3e('0x24')](handleError(_0x432426,null));};exports[_0x1d3e('0x4f')]=function(_0x1a8d39,_0x34bf2a){var _0x49e720={'raw':!![],'where':{'id':_0x1a8d39[_0x1d3e('0x50')]['id']}},_0x2f1bc2={};_0x2f1bc2[_0x1d3e('0x3b')]=_[_0x1d3e('0x3d')](db[_0x1d3e('0x36')][_0x1d3e('0x37')]);_0x2f1bc2[_0x1d3e('0x3c')]=_[_0x1d3e('0x3d')](_0x1a8d39[_0x1d3e('0x3c')]);_0x2f1bc2[_0x1d3e('0x46')]=_[_0x1d3e('0x3e')](_0x2f1bc2[_0x1d3e('0x3b')],_0x2f1bc2[_0x1d3e('0x3c')]);_0x49e720[_0x1d3e('0x3f')]=_[_0x1d3e('0x3e')](_0x2f1bc2[_0x1d3e('0x3b')],qs['fields'](_0x1a8d39[_0x1d3e('0x3c')][_0x1d3e('0x40')]));_0x49e720[_0x1d3e('0x3f')]=_0x49e720[_0x1d3e('0x3f')][_0x1d3e('0x41')]?_0x49e720['attributes']:_0x2f1bc2[_0x1d3e('0x3b')];if(_0x1a8d39['query'][_0x1d3e('0x51')]){_0x49e720[_0x1d3e('0x4c')]=[{'all':!![]}];}_0x49e720=_[_0x1d3e('0x49')]({},_0x49e720,_0x1a8d39[_0x1d3e('0x4b')]);return db[_0x1d3e('0x36')][_0x1d3e('0x52')](_0x49e720)[_0x1d3e('0x1b')](handleEntityNotFound(_0x34bf2a,null))[_0x1d3e('0x1b')](respondWithResult(_0x34bf2a,null))[_0x1d3e('0x24')](handleError(_0x34bf2a,null));};exports[_0x1d3e('0x53')]=function(_0x229f7c,_0x2f3299){return db[_0x1d3e('0x36')]['create'](_0x229f7c[_0x1d3e('0x54')],{})[_0x1d3e('0x1b')](respondWithResult(_0x2f3299,0xc9))[_0x1d3e('0x24')](handleError(_0x2f3299,null));};exports[_0x1d3e('0x31')]=function(_0x1d32ff,_0x2bb4e0){if(_0x1d32ff[_0x1d3e('0x54')]['id']){delete _0x1d32ff[_0x1d3e('0x54')]['id'];}return db[_0x1d3e('0x36')][_0x1d3e('0x52')]({'where':{'id':_0x1d32ff[_0x1d3e('0x50')]['id']}})[_0x1d3e('0x1b')](handleEntityNotFound(_0x2bb4e0,null))['then'](saveUpdates(_0x1d32ff[_0x1d3e('0x54')],null))[_0x1d3e('0x1b')](respondWithResult(_0x2bb4e0,null))[_0x1d3e('0x24')](handleError(_0x2bb4e0,null));};exports[_0x1d3e('0x32')]=function(_0x39c97a,_0x4a708c){return db['WhatsappMessage'][_0x1d3e('0x52')]({'where':{'id':_0x39c97a['params']['id']}})[_0x1d3e('0x1b')](handleEntityNotFound(_0x4a708c,null))[_0x1d3e('0x1b')](removeEntity(_0x4a708c,null))['catch'](handleError(_0x4a708c,null));};exports[_0x1d3e('0x55')]=function(_0xc653b2,_0x2ec78d){return db[_0x1d3e('0x36')]['describe']()[_0x1d3e('0x1b')](respondWithResult(_0x2ec78d,null))[_0x1d3e('0x24')](handleError(_0x2ec78d,null));};var interaction_log=require('../../config/logger')(_0x1d3e('0x56'));exports[_0x1d3e('0x57')]=function(_0x2ce8f6,_0x30a1c9,_0x11a7f2){var _0x2451af={'agent':{},'channel':_0x1d3e('0x58')};if(_0x2ce8f6[_0x1d3e('0x54')]['id']){delete _0x2ce8f6[_0x1d3e('0x54')]['id'];}_0x2ce8f6[_0x1d3e('0x54')][_0x1d3e('0x59')]=!![];_0x2ce8f6[_0x1d3e('0x54')][_0x1d3e('0x5a')]=moment()[_0x1d3e('0x5b')]('YYYY-MM-DD\x20HH:mm:ss');_0x2ce8f6[_0x1d3e('0x54')][_0x1d3e('0x5c')]=_0x2ce8f6[_0x1d3e('0x54')][_0x1d3e('0x5c')]||_0x2ce8f6[_0x1d3e('0x5d')]['id'];_0x2451af[_0x1d3e('0x5e')]['id']=_0x2ce8f6[_0x1d3e('0x54')]['UserId'];return db[_0x1d3e('0x36')][_0x1d3e('0x52')]({'where':{'id':_0x2ce8f6[_0x1d3e('0x50')]['id'],'UserId':null}})[_0x1d3e('0x1b')](handleEntityNotFound(_0x30a1c9,null))['then'](saveUpdates(_0x2ce8f6[_0x1d3e('0x54')],null))['then'](function(_0x4bb5d3){if(_0x4bb5d3){_0x2451af['message']=_0x4bb5d3[_0x1d3e('0x5f')]({'plain':!![]});return db[_0x1d3e('0x60')]['find']({'where':{'id':_0x4bb5d3[_0x1d3e('0x61')]}});}return null;})[_0x1d3e('0x1b')](handleEntityNotFound(_0x30a1c9,null))[_0x1d3e('0x1b')](function(_0x1cc9ca){if(_0x1cc9ca){return _0x1cc9ca[_0x1d3e('0x31')]({'UserId':_0x2ce8f6[_0x1d3e('0x54')][_0x1d3e('0x5c')],'read1stAt':_[_0x1d3e('0x62')](_0x1cc9ca['read1stAt'])?moment()[_0x1d3e('0x5b')](_0x1d3e('0x63')):undefined});}return null;})[_0x1d3e('0x1b')](function(_0x1d0c6c){if(_0x1d0c6c){_0x2451af[_0x1d3e('0x64')]=_0x1d0c6c[_0x1d3e('0x5f')]({'plain':!![]});interaction_log[_0x1d3e('0x1c')](_0x1d3e('0x65'),_0x2ce8f6[_0x1d3e('0x5d')]['id'],_0x2ce8f6[_0x1d3e('0x5d')][_0x1d3e('0x33')],_0x2ce8f6[_0x1d3e('0x5d')][_0x1d3e('0x66')],_0x2451af['interaction']['id'],_0x2ce8f6[_0x1d3e('0x54')]?JSON['stringify'](_0x2ce8f6[_0x1d3e('0x54')]):'null');return respondWithRpcPromise('AcceptMessage',_0x1d3e('0x67'),_0x2451af);}return null;})[_0x1d3e('0x1b')](function(_0x31c5db){var _0x487463=_0x1d3e('0x68')+_0x31c5db[_0x1d3e('0x22')][_0x1d3e('0x69')];return db['sequelize']['query'](_0x487463,{'type':db[_0x1d3e('0x6a')][_0x1d3e('0x6b')][_0x1d3e('0x6c')],'raw':!![]})['then'](function(_0x4a6136){return _0x4a6136;});})['then'](function(_0x26d9c5){if(_0x26d9c5){_0x2451af[_0x1d3e('0x22')]['contact']=_0x26d9c5[0x0];if(!_0x2ce8f6[_0x1d3e('0x54')][_0x1d3e('0x5c')])return;return db[_0x1d3e('0x6d')][_0x1d3e('0x52')]({'where':{'id':_0x2ce8f6[_0x1d3e('0x54')][_0x1d3e('0x5c')],'role':_0x1d3e('0x5e')},'attributes':['id',_0x1d3e('0x33'),_0x1d3e('0x6e'),_0x1d3e('0x6f'),_0x1d3e('0x70')],'raw':!![]});}return null;})[_0x1d3e('0x1b')](function(_0x113d68){if(!_0x113d68)return null;_0x2451af[_0x1d3e('0x22')][_0x1d3e('0x5e')]=_0x113d68;return _0x2451af;})['then'](function(_0x227221){if(_0x227221){if(_0x2ce8f6[_0x1d3e('0x54')][_0x1d3e('0x71')]){_0x2451af[_0x1d3e('0x22')][_0x1d3e('0x72')]=util[_0x1d3e('0x5b')](_0x1d3e('0x73'),_0x2ce8f6[_0x1d3e('0x5d')][_0x1d3e('0x33')]);_0x2451af['message'][_0x1d3e('0x74')]=_0x2451af[_0x1d3e('0x74')];_0x2451af[_0x1d3e('0x22')][_0x1d3e('0x75')]=_0x2451af['channel'];_0x2451af['message'][_0x1d3e('0x76')]=_0x1d3e('0x57');return respondWithRpcPromise(_0x1d3e('0x77'),_0x1d3e('0x77'),{'event':_0x1d3e('0x78'),'message':_0x2451af[_0x1d3e('0x22')]},client9002)[_0x1d3e('0x1b')](function(){return _0x2451af;});}return _0x2451af;}return null;})[_0x1d3e('0x1b')](respondWithResult(_0x30a1c9,null))['catch'](handleError(_0x30a1c9,null));};var interaction_log=require(_0x1d3e('0x12'))(_0x1d3e('0x56'));exports[_0x1d3e('0x2f')]=function(_0x5d6b0e,_0x248907,_0x2f71c7){var _0x519922={'agent':{},'channel':'whatsapp'};if(_0x5d6b0e[_0x1d3e('0x54')]['id']){delete _0x5d6b0e[_0x1d3e('0x54')]['id'];}_0x5d6b0e[_0x1d3e('0x54')]['UserId']=_0x5d6b0e['body']['UserId']||_0x5d6b0e[_0x1d3e('0x5d')]['id'];_0x519922[_0x1d3e('0x5e')]['id']=_0x5d6b0e[_0x1d3e('0x54')][_0x1d3e('0x5c')];return db[_0x1d3e('0x36')]['find']({'where':{'id':_0x5d6b0e['params']['id'],'UserId':null}})[_0x1d3e('0x1b')](handleEntityNotFound(_0x248907,null))[_0x1d3e('0x1b')](function(_0x5eef07){if(_0x5eef07){_0x519922[_0x1d3e('0x22')]=_0x5eef07[_0x1d3e('0x5f')]({'plain':!![]});return db[_0x1d3e('0x60')][_0x1d3e('0x52')]({'where':{'id':_0x5eef07[_0x1d3e('0x61')]}});}return null;})[_0x1d3e('0x1b')](handleEntityNotFound(_0x248907,null))[_0x1d3e('0x1b')](function(_0x5d7d6b){if(_0x5d7d6b){_0x519922[_0x1d3e('0x64')]=_0x5d7d6b[_0x1d3e('0x5f')]({'plain':!![]});interaction_log[_0x1d3e('0x1c')](_0x1d3e('0x79'),_0x5d6b0e['user']['id'],_0x5d6b0e[_0x1d3e('0x5d')][_0x1d3e('0x33')],_0x5d6b0e[_0x1d3e('0x5d')]['role'],_0x519922[_0x1d3e('0x64')]['id'],_0x5d6b0e[_0x1d3e('0x54')]?JSON[_0x1d3e('0x7a')](_0x5d6b0e[_0x1d3e('0x54')]):_0x1d3e('0x7b'));return respondWithRpcPromise(_0x1d3e('0x7c'),_0x1d3e('0x7d'),_0x519922);}return null;})[_0x1d3e('0x1b')](function(_0x14855d){var _0x218e7b='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x14855d[_0x1d3e('0x22')][_0x1d3e('0x69')];return db[_0x1d3e('0x7e')]['query'](_0x218e7b,{'type':db['Sequelize'][_0x1d3e('0x6b')][_0x1d3e('0x6c')],'raw':!![]})[_0x1d3e('0x1b')](function(_0x49229e){return _0x49229e;});})['then'](function(_0x1b50fc){if(_0x1b50fc){_0x519922[_0x1d3e('0x22')][_0x1d3e('0x7f')]=_0x1b50fc[0x0];if(!_0x5d6b0e[_0x1d3e('0x54')]['UserId'])return;return db[_0x1d3e('0x6d')]['find']({'where':{'id':_0x5d6b0e['body'][_0x1d3e('0x5c')],'role':_0x1d3e('0x5e')},'attributes':['id','name','fullname',_0x1d3e('0x6f'),'internal'],'raw':!![]});}return null;})[_0x1d3e('0x1b')](function(_0x2bc8e2){if(!_0x2bc8e2)return null;_0x519922[_0x1d3e('0x22')][_0x1d3e('0x5e')]=_0x2bc8e2;return _0x519922;})[_0x1d3e('0x1b')](function(_0x25371c){if(_0x25371c){_0x25371c[_0x1d3e('0x22')][_0x1d3e('0x72')]=util['format'](_0x1d3e('0x73'),_0x5d6b0e[_0x1d3e('0x5d')]['name']);_0x25371c[_0x1d3e('0x22')][_0x1d3e('0x74')]=_0x519922[_0x1d3e('0x74')];_0x25371c[_0x1d3e('0x22')][_0x1d3e('0x75')]=_0x519922[_0x1d3e('0x74')];_0x25371c['message'][_0x1d3e('0x76')]=_0x1d3e('0x2f');respondWithRpcPromise(_0x1d3e('0x77'),_0x1d3e('0x77'),{'event':_0x1d3e('0x80'),'message':_0x25371c[_0x1d3e('0x22')]},client9002);return _0x519922;}return null;})[_0x1d3e('0x1b')](respondWithResult(_0x248907,null))[_0x1d3e('0x24')](handleError(_0x248907,null));};exports['status']=function(_0x101da2,_0xff1eec,_0x7f3556){if(_0x101da2[_0x1d3e('0x54')]['id']){delete _0x101da2[_0x1d3e('0x54')]['id'];}var _0x203701;return db[_0x1d3e('0x36')]['find']({'where':{'id':_0x101da2[_0x1d3e('0x50')]['id']}})[_0x1d3e('0x1b')](handleEntityNotFound(_0xff1eec,null))[_0x1d3e('0x1b')](function(_0x455922){if(_0x455922){_0x203701=_0x455922;return db[_0x1d3e('0x81')]['find']({'where':{'id':_0x455922[_0x1d3e('0x82')]}});}})[_0x1d3e('0x1b')](handleEntityNotFound(_0xff1eec,null))['then'](function(_0x542b3f){if(_0x542b3f){logger[_0x1d3e('0x83')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0x1d3e('0x26'),_0x1d3e('0x84'),_0x542b3f[_0x1d3e('0x39')],util[_0x1d3e('0x85')](_0x101da2['body'],{'showHidden':![],'depth':null}));switch(_0x542b3f[_0x1d3e('0x39')]){case _0x1d3e('0x86'):if(_0x101da2[_0x1d3e('0x54')]['MessageSid']&&_0x101da2[_0x1d3e('0x54')][_0x1d3e('0x87')]===_0x203701['messageId']&&_0x101da2[_0x1d3e('0x54')][_0x1d3e('0x88')]&&_0x101da2[_0x1d3e('0x54')][_0x1d3e('0x88')]===_0x1d3e('0x59')){return _0x203701['update']({'read':!![]});}else{logger[_0x1d3e('0x20')](_0x1d3e('0x89'),_0x1d3e('0x26'),'twilio',util[_0x1d3e('0x85')](_0x101da2[_0x1d3e('0x54')],{'showHidden':![],'depth':null}));}break;}return _0x203701;}})[_0x1d3e('0x1b')](respondWithResult(_0xff1eec,null))[_0x1d3e('0x24')](handleError(_0xff1eec,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 220c7d0..d0dd74c 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 _0x44a3=['emit','hasOwnProperty','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove'];(function(_0x3e4ecc,_0x3c3803){var _0x26af00=function(_0x1f6158){while(--_0x1f6158){_0x3e4ecc['push'](_0x3e4ecc['shift']());}};_0x26af00(++_0x3c3803);}(_0x44a3,0x1a9));var _0x344a=function(_0x2975f1,_0x453f49){_0x2975f1=_0x2975f1-0x0;var _0x2c08d5=_0x44a3[_0x2975f1];return _0x2c08d5;};'use strict';var EventEmitter=require(_0x344a('0x0'));var WhatsappMessage=require(_0x344a('0x1'))['db'][_0x344a('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x344a('0x3')](0x0);var events={'afterCreate':_0x344a('0x4'),'afterUpdate':_0x344a('0x5'),'afterDestroy':_0x344a('0x6')};function emitEvent(_0x212a39){return function(_0x528a13,_0x23004c,_0x1bc716){WhatsappMessageEvents[_0x344a('0x7')](_0x212a39+':'+_0x528a13['id'],_0x528a13);WhatsappMessageEvents[_0x344a('0x7')](_0x212a39,_0x528a13);_0x1bc716(null);};}for(var e in events){if(events[_0x344a('0x8')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file +var _0x3264=['exports','../../mysqldb','WhatsappMessage','setMaxListeners','save','emit','hasOwnProperty'];(function(_0xabaf9b,_0x21e0f4){var _0x48d6e6=function(_0x38ef1e){while(--_0x38ef1e){_0xabaf9b['push'](_0xabaf9b['shift']());}};_0x48d6e6(++_0x21e0f4);}(_0x3264,0x7f));var _0x4326=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3264[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x4326('0x0'))['db'][_0x4326('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x4326('0x2')](0x0);var events={'afterCreate':_0x4326('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xdd223f){return function(_0x510181,_0x5555ac,_0x27ff99){WhatsappMessageEvents[_0x4326('0x4')](_0xdd223f+':'+_0x510181['id'],_0x510181);WhatsappMessageEvents[_0x4326('0x4')](_0xdd223f,_0x510181);_0x27ff99(null);};}for(var e in events){if(events[_0x4326('0x5')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x4326('0x6')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 81238ce..7d03960 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 _0xcd0e=['WhatsappInteraction','findOne','update','createdAt','catch','error','WhatsappAccount','find','then','type','twilio','authToken','phone','accountSid','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','/whatsapp/v1/','text','Bearer\x20','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','out','secret','isNil','UserId'];(function(_0x1e393b,_0x355f6b){var _0x3d0bfe=function(_0x320830){while(--_0x320830){_0x1e393b['push'](_0x1e393b['shift']());}};_0x3d0bfe(++_0x355f6b);}(_0xcd0e,0x18c));var _0xecd0=function(_0x35a274,_0x98b399){_0x35a274=_0x35a274-0x0;var _0x40d905=_0xcd0e[_0x35a274];return _0x40d905;};'use strict';var _=require(_0xecd0('0x0'));var util=require(_0xecd0('0x1'));var logger=require(_0xecd0('0x2'))(_0xecd0('0x3'));var moment=require(_0xecd0('0x4'));var BPromise=require(_0xecd0('0x5'));var rp=require(_0xecd0('0x6'));var fetch=require(_0xecd0('0x7'));var fs=require('fs');var path=require(_0xecd0('0x8'));var rimraf=require(_0xecd0('0x9'));var config=require(_0xecd0('0xa'));var attributes=require(_0xecd0('0xb'));module['exports']=function(_0x4f07f7,_0x408d0f){return _0x4f07f7['define']('WhatsappMessage',attributes,{'tableName':_0xecd0('0xc'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xecd0('0xd')]},{'name':_0xecd0('0xe'),'fields':[_0xecd0('0xf')],'type':_0xecd0('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x24b63a,_0x3d0811,_0x545900){var _0xbf7762=_0x4f07f7[_0xecd0('0x11')];var _0x254409=_0x24b63a[_0xecd0('0x12')]({'plain':!![]});if(_0x254409[_0xecd0('0x13')]['toLowerCase']()==='in'||_0x254409[_0xecd0('0x13')]['toLowerCase']()===_0xecd0('0x14')&&!_0x254409[_0xecd0('0x15')]&&!_[_0xecd0('0x16')](_0x254409[_0xecd0('0x17')])){_0xbf7762[_0xecd0('0x18')][_0xecd0('0x19')]({'where':{'id':_0x254409['WhatsappInteractionId']}})['then'](function(_0x2a88a1){if(_0x2a88a1){_0x2a88a1[_0xecd0('0x1a')]({'lastMsgAt':_0x254409[_0xecd0('0x1b')],'lastMsgDirection':_0x254409[_0xecd0('0x13')]['toLowerCase']()});}})[_0xecd0('0x1c')](function(_0x2706b1){console[_0xecd0('0x1d')](_0x2706b1);});}if(_0x254409['direction']===_0xecd0('0x14')&&!_0x254409[_0xecd0('0x15')]){var _0x214341;_0xbf7762[_0xecd0('0x1e')][_0xecd0('0x1f')]({'where':{'id':_0x254409['WhatsappAccountId']},'raw':!![]})[_0xecd0('0x20')](function(_0x7c22eb){_0x214341=_0x7c22eb;if(_0x214341&&_0x214341[_0xecd0('0x21')]){switch(_0x214341[_0xecd0('0x21')]){case'twilio':var _0x53e6af=require(_0xecd0('0x22'));if(_0x214341['accountSid']&&_0x214341[_0xecd0('0x23')]&&_0x214341[_0xecd0('0x24')]){var _0x58c26c=new _0x53e6af(_0x214341[_0xecd0('0x25')],_0x214341[_0xecd0('0x23')]);_0x58c26c[_0xecd0('0x26')][_0xecd0('0x27')]({'body':_0x254409[_0xecd0('0xf')],'to':'whatsapp:'+_0x254409[_0xecd0('0x24')],'from':_0xecd0('0x28')+_0x214341['phone'],'statusCallback':_0x214341[_0xecd0('0x29')]+_0xecd0('0x2a')+_0x254409['id']+_0xecd0('0x2b')+_0x214341['token']})['then'](function(_0x5b9737){if(_0x5b9737[_0xecd0('0x2c')]){return _0x24b63a['update']({'messageId':_0x5b9737[_0xecd0('0x2c')]});}})[_0xecd0('0x1c')](function(_0x14d2fd){logger['error'](_0xecd0('0x2d'),_0xecd0('0x2e'),_0xecd0('0x22'),util[_0xecd0('0x2f')](_0x14d2fd,{'showHidden':![],'depth':null}));});}else{logger[_0xecd0('0x1d')]('WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','twilio',_0xecd0('0x30'));}break;case _0xecd0('0x31'):var _0x3874a7=_0x214341[_0xecd0('0x25')];var _0x5bdd71=_0x214341[_0xecd0('0x23')];var _0x5b1265=_0x214341['baseUrl']+_0xecd0('0x32')+_0x3874a7+'/messages/';var _0x34894={'to':[_0x254409[_0xecd0('0x24')]],'message':{'type':_0xecd0('0x33'),'text':_0x254409[_0xecd0('0xf')]}};var _0xc86a48={'method':'POST','uri':_0x5b1265,'headers':{'Authorization':_0xecd0('0x34')+_0x5bdd71,'Content-Type':_0xecd0('0x35')},'body':_0x34894,'json':!![]};rp(_0xc86a48)['then'](function(_0x391ab3){if(_0x391ab3[_0xecd0('0x36')][0x0][_0xecd0('0x37')]){return _0x24b63a[_0xecd0('0x1a')]({'messageId':_0x391ab3[_0xecd0('0x36')][0x0][_0xecd0('0x37')]});}})['catch'](function(_0x3cb2d4){logger[_0xecd0('0x38')](_0xecd0('0x39'),_0x3cb2d4);});break;}}})['finally'](function(){_0x545900();});}else{_0x545900();}}},'charset':_0xecd0('0x3a'),'collate':_0xecd0('0x3b')});}; \ No newline at end of file +var _0x1aa4=['statuses','message_id','err','WhatsappMessage,\x20%s','utf8mb4','lodash','util','../../config/logger','api','moment','request-promise','node-fetch','path','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','models','direction','toLowerCase','out','UserId','findOne','WhatsappInteractionId','update','createdAt','catch','error','secret','WhatsappAccountId','type','twilio','authToken','accountSid','messages','create','body','phone','whatsapp:','then','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','text','POST','Bearer\x20','application/json'];(function(_0x14e9f0,_0x287f90){var _0xa63f7e=function(_0x4829d6){while(--_0x4829d6){_0x14e9f0['push'](_0x14e9f0['shift']());}};_0xa63f7e(++_0x287f90);}(_0x1aa4,0x171));var _0x41aa=function(_0x43a8df,_0x19d0e3){_0x43a8df=_0x43a8df-0x0;var _0x19a947=_0x1aa4[_0x43a8df];return _0x19a947;};'use strict';var _=require(_0x41aa('0x0'));var util=require(_0x41aa('0x1'));var logger=require(_0x41aa('0x2'))(_0x41aa('0x3'));var moment=require(_0x41aa('0x4'));var BPromise=require('bluebird');var rp=require(_0x41aa('0x5'));var fetch=require(_0x41aa('0x6'));var fs=require('fs');var path=require(_0x41aa('0x7'));var rimraf=require('rimraf');var config=require(_0x41aa('0x8'));var attributes=require(_0x41aa('0x9'));module[_0x41aa('0xa')]=function(_0xd35672,_0x3ae235){return _0xd35672[_0x41aa('0xb')](_0x41aa('0xc'),attributes,{'tableName':_0x41aa('0xd'),'paranoid':![],'indexes':[{'name':_0x41aa('0xe'),'fields':[_0x41aa('0xe')]},{'name':_0x41aa('0xf'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3a2dd1,_0x3be357,_0xdac80a){var _0x26e9f8=_0xd35672[_0x41aa('0x10')];var _0x3447cd=_0x3a2dd1['get']({'plain':!![]});if(_0x3447cd[_0x41aa('0x11')][_0x41aa('0x12')]()==='in'||_0x3447cd[_0x41aa('0x11')]['toLowerCase']()===_0x41aa('0x13')&&!_0x3447cd['secret']&&!_['isNil'](_0x3447cd[_0x41aa('0x14')])){_0x26e9f8['WhatsappInteraction'][_0x41aa('0x15')]({'where':{'id':_0x3447cd[_0x41aa('0x16')]}})['then'](function(_0x218c8c){if(_0x218c8c){_0x218c8c[_0x41aa('0x17')]({'lastMsgAt':_0x3447cd[_0x41aa('0x18')],'lastMsgDirection':_0x3447cd[_0x41aa('0x11')][_0x41aa('0x12')]()});}})[_0x41aa('0x19')](function(_0x17633a){console[_0x41aa('0x1a')](_0x17633a);});}if(_0x3447cd['direction']==='out'&&!_0x3447cd[_0x41aa('0x1b')]){var _0xa162ba;_0x26e9f8['WhatsappAccount']['find']({'where':{'id':_0x3447cd[_0x41aa('0x1c')]},'raw':!![]})['then'](function(_0x4b8479){_0xa162ba=_0x4b8479;if(_0xa162ba&&_0xa162ba[_0x41aa('0x1d')]){switch(_0xa162ba[_0x41aa('0x1d')]){case'twilio':var _0x3692c8=require(_0x41aa('0x1e'));if(_0xa162ba['accountSid']&&_0xa162ba[_0x41aa('0x1f')]&&_0xa162ba['phone']){var _0x1132c7=new _0x3692c8(_0xa162ba[_0x41aa('0x20')],_0xa162ba[_0x41aa('0x1f')]);_0x1132c7[_0x41aa('0x21')][_0x41aa('0x22')]({'body':_0x3447cd[_0x41aa('0x23')],'to':'whatsapp:'+_0x3447cd[_0x41aa('0x24')],'from':_0x41aa('0x25')+_0xa162ba[_0x41aa('0x24')],'statusCallback':_0xa162ba['remote']+'/api/whatsapp/messages/'+_0x3447cd['id']+'/status?token='+_0xa162ba['token']})[_0x41aa('0x26')](function(_0x3ba386){if(_0x3ba386[_0x41aa('0x27')]){return _0x3a2dd1[_0x41aa('0x17')]({'messageId':_0x3ba386['sid']});}})['catch'](function(_0x31be6f){logger[_0x41aa('0x1a')](_0x41aa('0x28'),_0x41aa('0x29'),_0x41aa('0x1e'),util[_0x41aa('0x2a')](_0x31be6f,{'showHidden':![],'depth':null}));});}else{logger[_0x41aa('0x1a')](_0x41aa('0x28'),_0x41aa('0x29'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case'sinch':var _0x38bb2f=_0xa162ba['accountSid'];var _0x2441a3=_0xa162ba[_0x41aa('0x1f')];var _0x4cbe7b=_0xa162ba['baseUrl']+'/whatsapp/v1/'+_0x38bb2f+'/messages/';var _0x53dd73={'to':[_0x3447cd[_0x41aa('0x24')]],'message':{'type':_0x41aa('0x2b'),'text':_0x3447cd[_0x41aa('0x23')]}};var _0x1d7bbb={'method':_0x41aa('0x2c'),'uri':_0x4cbe7b,'headers':{'Authorization':_0x41aa('0x2d')+_0x2441a3,'Content-Type':_0x41aa('0x2e')},'body':_0x53dd73,'json':!![]};rp(_0x1d7bbb)[_0x41aa('0x26')](function(_0x1d2241){if(_0x1d2241[_0x41aa('0x2f')][0x0][_0x41aa('0x30')]){return _0x3a2dd1[_0x41aa('0x17')]({'messageId':_0x1d2241[_0x41aa('0x2f')][0x0][_0x41aa('0x30')]});}})['catch'](function(_0x1a9d44){logger[_0x41aa('0x31')](_0x41aa('0x32'),_0x1a9d44);});break;}}})['finally'](function(){_0xdac80a();});}else{_0xdac80a();}}},'charset':_0x41aa('0x33'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index e9f4392..038617b 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 _0x377c=['message','result','catch','WhatsappMessage,\x20%s,\x20%s','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','info','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1fcaf1,_0x21c3c2){var _0x55f464=function(_0x348eb3){while(--_0x348eb3){_0x1fcaf1['push'](_0x1fcaf1['shift']());}};_0x55f464(++_0x21c3c2);}(_0x377c,0x19d));var _0xc377=function(_0x4eb045,_0x1adeee){_0x4eb045=_0x4eb045-0x0;var _0x528fa6=_0x377c[_0x4eb045];return _0x528fa6;};'use strict';var _=require(_0xc377('0x0'));var util=require(_0xc377('0x1'));var moment=require('moment');var BPromise=require(_0xc377('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc377('0x3'));var db=require(_0xc377('0x4'))['db'];var utils=require(_0xc377('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc377('0x6')][_0xc377('0x7')]({'port':0x232a});config['redis']=_[_0xc377('0x8')](config[_0xc377('0x9')],{'host':_0xc377('0xa'),'port':0x18eb});var socket=require(_0xc377('0xb'))(new Redis(config[_0xc377('0x9')]));require('./whatsappMessage.socket')[_0xc377('0xc')](socket);function respondWithRpcPromise(_0x2046a0,_0x117202,_0x1a104a){return new BPromise(function(_0x57338f,_0x39d7a5){return client[_0xc377('0xd')](_0x2046a0,_0x1a104a)[_0xc377('0xe')](function(_0x7f1492){logger[_0xc377('0xf')]('WhatsappMessage,\x20%s,\x20%s',_0x117202,_0xc377('0x10'));logger['debug'](_0xc377('0x11'),_0x117202,_0xc377('0x10'),JSON[_0xc377('0x12')](_0x7f1492));if(_0x7f1492[_0xc377('0x13')]){if(_0x7f1492['error'][_0xc377('0x14')]===0x1f4){logger[_0xc377('0x13')]('WhatsappMessage,\x20%s,\x20%s',_0x117202,_0x7f1492['error'][_0xc377('0x15')]);return _0x39d7a5(_0x7f1492[_0xc377('0x13')][_0xc377('0x15')]);}logger[_0xc377('0x13')]('WhatsappMessage,\x20%s,\x20%s',_0x117202,_0x7f1492['error'][_0xc377('0x15')]);return _0x57338f(_0x7f1492[_0xc377('0x13')][_0xc377('0x15')]);}else{logger[_0xc377('0xf')]('WhatsappMessage,\x20%s,\x20%s',_0x117202,_0xc377('0x10'));_0x57338f(_0x7f1492[_0xc377('0x16')]['message']);}})[_0xc377('0x17')](function(_0x1b829c){logger['error'](_0xc377('0x18'),_0x117202,_0x1b829c);_0x39d7a5(_0x1b829c);});});}exports[_0xc377('0x19')]=function(_0x34f06f){var _0x17c6b4=this;return new Promise(function(_0x5fd5ef,_0x38eabb){return db[_0xc377('0x1a')][_0xc377('0x1b')](_0x34f06f[_0xc377('0x1c')],{'raw':_0x34f06f[_0xc377('0x1d')]?_0x34f06f[_0xc377('0x1d')][_0xc377('0x1e')]===undefined?!![]:![]:!![]})[_0xc377('0xe')](function(_0x244253){logger[_0xc377('0xf')]('CreateWhatsappMessage',_0x34f06f);logger['debug'](_0xc377('0x19'),_0x34f06f,JSON['stringify'](_0x244253));_0x5fd5ef(_0x244253);})[_0xc377('0x17')](function(_0x147562){logger[_0xc377('0x13')]('CreateWhatsappMessage',_0x147562[_0xc377('0x15')],_0x34f06f);_0x38eabb(_0x17c6b4[_0xc377('0x13')](0x1f4,_0x147562[_0xc377('0x15')]));});});}; \ No newline at end of file +var _0xd991=['WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','WhatsappMessage','options','raw','CreateWhatsappMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','request','then','info','WhatsappMessage,\x20%s,\x20%s','debug'];(function(_0x3a3b19,_0x33ebc1){var _0x587da7=function(_0x2eeb97){while(--_0x2eeb97){_0x3a3b19['push'](_0x3a3b19['shift']());}};_0x587da7(++_0x33ebc1);}(_0xd991,0x16c));var _0x1d99=function(_0x3530c2,_0x236d33){_0x3530c2=_0x3530c2-0x0;var _0x85a6a=_0xd991[_0x3530c2];return _0x85a6a;};'use strict';var _=require(_0x1d99('0x0'));var util=require(_0x1d99('0x1'));var moment=require(_0x1d99('0x2'));var BPromise=require(_0x1d99('0x3'));var rs=require(_0x1d99('0x4'));var fs=require('fs');var Redis=require(_0x1d99('0x5'));var db=require(_0x1d99('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1d99('0x7'))(_0x1d99('0x8'));var config=require(_0x1d99('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1d99('0xa')][_0x1d99('0xb')]({'port':0x232a});config[_0x1d99('0xc')]=_['defaults'](config[_0x1d99('0xc')],{'host':_0x1d99('0xd'),'port':0x18eb});var socket=require(_0x1d99('0xe'))(new Redis(config[_0x1d99('0xc')]));require('./whatsappMessage.socket')['register'](socket);function respondWithRpcPromise(_0x10985d,_0x2d62f8,_0x20451d){return new BPromise(function(_0x4fb184,_0x471b23){return client[_0x1d99('0xf')](_0x10985d,_0x20451d)[_0x1d99('0x10')](function(_0x35fd52){logger[_0x1d99('0x11')](_0x1d99('0x12'),_0x2d62f8,'request\x20sent');logger[_0x1d99('0x13')](_0x1d99('0x14'),_0x2d62f8,'request\x20sent',JSON[_0x1d99('0x15')](_0x35fd52));if(_0x35fd52[_0x1d99('0x16')]){if(_0x35fd52[_0x1d99('0x16')][_0x1d99('0x17')]===0x1f4){logger[_0x1d99('0x16')](_0x1d99('0x12'),_0x2d62f8,_0x35fd52[_0x1d99('0x16')]['message']);return _0x471b23(_0x35fd52[_0x1d99('0x16')][_0x1d99('0x18')]);}logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x2d62f8,_0x35fd52[_0x1d99('0x16')]['message']);return _0x4fb184(_0x35fd52[_0x1d99('0x16')]['message']);}else{logger['info'](_0x1d99('0x12'),_0x2d62f8,_0x1d99('0x19'));_0x4fb184(_0x35fd52[_0x1d99('0x1a')]['message']);}})[_0x1d99('0x1b')](function(_0x488774){logger['error'](_0x1d99('0x12'),_0x2d62f8,_0x488774);_0x471b23(_0x488774);});});}exports['CreateWhatsappMessage']=function(_0x11cb4d){var _0x236724=this;return new Promise(function(_0x1d3716,_0x1c0900){return db[_0x1d99('0x1c')]['create'](_0x11cb4d['body'],{'raw':_0x11cb4d['options']?_0x11cb4d[_0x1d99('0x1d')][_0x1d99('0x1e')]===undefined?!![]:![]:!![]})[_0x1d99('0x10')](function(_0x121537){logger['info'](_0x1d99('0x1f'),_0x11cb4d);logger[_0x1d99('0x13')]('CreateWhatsappMessage',_0x11cb4d,JSON['stringify'](_0x121537));_0x1d3716(_0x121537);})[_0x1d99('0x1b')](function(_0x1ff8f1){logger[_0x1d99('0x16')](_0x1d99('0x1f'),_0x1ff8f1[_0x1d99('0x18')],_0x11cb4d);_0x1c0900(_0x236724[_0x1d99('0x16')](0x1f4,_0x1ff8f1['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 7d0b7c8..26733f0 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 _0x7103=['removeListener','register','length','whatsappMessage:','./whatsappMessage.events','save','remove','update'];(function(_0x332e65,_0x368a12){var _0x1b19dc=function(_0x5be18f){while(--_0x5be18f){_0x332e65['push'](_0x332e65['shift']());}};_0x1b19dc(++_0x368a12);}(_0x7103,0xc4));var _0x3710=function(_0x55b69e,_0x3ce1f9){_0x55b69e=_0x55b69e-0x0;var _0x403210=_0x7103[_0x55b69e];return _0x403210;};'use strict';var WhatsappMessageEvents=require(_0x3710('0x0'));var events=[_0x3710('0x1'),_0x3710('0x2'),_0x3710('0x3')];function createListener(_0x1be74f,_0x44c4bb){return function(_0x1a76b3){_0x44c4bb['emit'](_0x1be74f,_0x1a76b3);};}function removeListener(_0x1c873f,_0x3fb734){return function(){WhatsappMessageEvents[_0x3710('0x4')](_0x1c873f,_0x3fb734);};}exports[_0x3710('0x5')]=function(_0x4356dd){for(var _0x1da3a0=0x0,_0x1e79af=events[_0x3710('0x6')];_0x1da3a0<_0x1e79af;_0x1da3a0++){var _0x4de1eb=events[_0x1da3a0];var _0x23ba6b=createListener(_0x3710('0x7')+_0x4de1eb,_0x4356dd);WhatsappMessageEvents['on'](_0x4de1eb,_0x23ba6b);}}; \ No newline at end of file +var _0x3805=['update','emit','removeListener','register','length','save'];(function(_0x34ffce,_0x272cee){var _0x4a411b=function(_0x455f31){while(--_0x455f31){_0x34ffce['push'](_0x34ffce['shift']());}};_0x4a411b(++_0x272cee);}(_0x3805,0x1df));var _0x5380=function(_0x21125f,_0x8079f8){_0x21125f=_0x21125f-0x0;var _0x2f421d=_0x3805[_0x21125f];return _0x2f421d;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0x5380('0x0'),'remove',_0x5380('0x1')];function createListener(_0x39e1bf,_0x437ab5){return function(_0x389205){_0x437ab5[_0x5380('0x2')](_0x39e1bf,_0x389205);};}function removeListener(_0x5b6841,_0x40101c){return function(){WhatsappMessageEvents[_0x5380('0x3')](_0x5b6841,_0x40101c);};}exports[_0x5380('0x4')]=function(_0x1a342c){for(var _0x4a69f9=0x0,_0x1076aa=events[_0x5380('0x5')];_0x4a69f9<_0x1076aa;_0x4a69f9++){var _0x13dfd9=events[_0x4a69f9];var _0x4c90f1=createListener('whatsappMessage:'+_0x13dfd9,_0x1a342c);WhatsappMessageEvents['on'](_0x13dfd9,_0x4c90f1);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 1ed44ed..3d7e483 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 _0x2275=['/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','create','addTeams','post','/:id/users','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index'];(function(_0x425716,_0x3e9d1c){var _0x2d39af=function(_0x1febc1){while(--_0x1febc1){_0x425716['push'](_0x425716['shift']());}};_0x2d39af(++_0x3e9d1c);}(_0x2275,0xfa));var _0x5227=function(_0x5a42a3,_0x34c696){_0x5a42a3=_0x5a42a3-0x0;var _0x377122=_0x2275[_0x5a42a3];return _0x377122;};'use strict';var multer=require(_0x5227('0x0'));var util=require(_0x5227('0x1'));var path=require(_0x5227('0x2'));var timeout=require(_0x5227('0x3'));var express=require(_0x5227('0x4'));var router=express[_0x5227('0x5')]();var fs_extra=require(_0x5227('0x6'));var auth=require(_0x5227('0x7'));var interaction=require(_0x5227('0x8'));var config=require(_0x5227('0x9'));var controller=require(_0x5227('0xa'));router[_0x5227('0xb')]('/',auth[_0x5227('0xc')](),controller[_0x5227('0xd')]);router['get'](_0x5227('0xe'),auth[_0x5227('0xc')](),controller[_0x5227('0xf')]);router[_0x5227('0xb')](_0x5227('0x10'),auth['isAuthenticated'](),controller[_0x5227('0x11')]);router[_0x5227('0xb')]('/:id/members',auth[_0x5227('0xc')](),controller[_0x5227('0x12')]);router[_0x5227('0xb')](_0x5227('0x13'),auth['isAuthenticated'](),controller[_0x5227('0x14')]);router[_0x5227('0xb')]('/:id/users',auth[_0x5227('0xc')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x5227('0x15')]);router['post'](_0x5227('0x13'),auth[_0x5227('0xc')](),controller[_0x5227('0x16')]);router[_0x5227('0x17')](_0x5227('0x18'),auth[_0x5227('0xc')](),controller[_0x5227('0x19')]);router[_0x5227('0x1a')](_0x5227('0x10'),auth[_0x5227('0xc')](),controller[_0x5227('0x1b')]);router[_0x5227('0x1c')](_0x5227('0x10'),auth[_0x5227('0xc')](),controller[_0x5227('0x1d')]);router[_0x5227('0x1c')](_0x5227('0x13'),auth[_0x5227('0xc')](),controller[_0x5227('0x1e')]);router[_0x5227('0x1c')]('/:id/users',auth[_0x5227('0xc')](),controller[_0x5227('0x1f')]);module[_0x5227('0x20')]=router; \ No newline at end of file +var _0xf9f0=['isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','destroy','delete','exports','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get'];(function(_0x219a04,_0xccc518){var _0x5e5155=function(_0x470e3a){while(--_0x470e3a){_0x219a04['push'](_0x219a04['shift']());}};_0x5e5155(++_0xccc518);}(_0xf9f0,0xeb));var _0x0f9f=function(_0x499023,_0x42de50){_0x499023=_0x499023-0x0;var _0x5a4cd6=_0xf9f0[_0x499023];return _0x5a4cd6;};'use strict';var multer=require('multer');var util=require(_0x0f9f('0x0'));var path=require(_0x0f9f('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0f9f('0x2')]();var fs_extra=require(_0x0f9f('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0f9f('0x4'));var config=require(_0x0f9f('0x5'));var controller=require(_0x0f9f('0x6'));router[_0x0f9f('0x7')]('/',auth[_0x0f9f('0x8')](),controller[_0x0f9f('0x9')]);router[_0x0f9f('0x7')](_0x0f9f('0xa'),auth[_0x0f9f('0x8')](),controller[_0x0f9f('0xb')]);router[_0x0f9f('0x7')](_0x0f9f('0xc'),auth['isAuthenticated'](),controller[_0x0f9f('0xd')]);router[_0x0f9f('0x7')](_0x0f9f('0xe'),auth[_0x0f9f('0x8')](),controller[_0x0f9f('0xf')]);router['get'](_0x0f9f('0x10'),auth[_0x0f9f('0x8')](),controller[_0x0f9f('0x11')]);router[_0x0f9f('0x7')](_0x0f9f('0x12'),auth[_0x0f9f('0x8')](),controller[_0x0f9f('0x13')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x0f9f('0x14')](_0x0f9f('0x10'),auth['isAuthenticated'](),controller[_0x0f9f('0x15')]);router[_0x0f9f('0x14')](_0x0f9f('0x12'),auth[_0x0f9f('0x8')](),controller[_0x0f9f('0x16')]);router[_0x0f9f('0x17')](_0x0f9f('0xc'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0f9f('0x8')](),controller[_0x0f9f('0x18')]);router[_0x0f9f('0x19')](_0x0f9f('0x10'),auth[_0x0f9f('0x8')](),controller['removeTeams']);router['delete'](_0x0f9f('0x12'),auth[_0x0f9f('0x8')](),controller['removeAgents']);module[_0x0f9f('0x1a')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index c187e33..00818dc 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 _0x0bb5=['sequelize','exports','INTEGER','ENUM','rrmemory','beepall','roundrobin','STRING'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x0bb5,0x148));var _0x50bb=function(_0x5d83c8,_0x7b640f){_0x5d83c8=_0x5d83c8-0x0;var _0x84ef2f=_0x0bb5[_0x5d83c8];return _0x84ef2f;};'use strict';var Sequelize=require(_0x50bb('0x0'));module[_0x50bb('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x50bb('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x50bb('0x3')](_0x50bb('0x4'),_0x50bb('0x5'),_0x50bb('0x6'))},'description':{'type':Sequelize[_0x50bb('0x7')]}}; \ No newline at end of file +var _0xf874=['STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x7d3dde,_0x421b90){var _0x16a30d=function(_0x46d40d){while(--_0x46d40d){_0x7d3dde['push'](_0x7d3dde['shift']());}};_0x16a30d(++_0x421b90);}(_0xf874,0x177));var _0x4f87=function(_0x4f1bd3,_0x3773fe){_0x4f1bd3=_0x4f1bd3-0x0;var _0x3efe61=_0xf874[_0x4f1bd3];return _0x3efe61;};'use strict';var Sequelize=require(_0x4f87('0x0'));module['exports']={'name':{'type':Sequelize[_0x4f87('0x1')],'unique':_0x4f87('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x4f87('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4f87('0x4')](_0x4f87('0x5'),_0x4f87('0x6'),_0x4f87('0x7'))},'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 d698a28..9fa2bac 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 _0x4d44=['hasOwnProperty','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','then','get','WhatsappQueues','UserProfileResource','destroy','error','stack','name','send','map','WhatsappQueue','rawAttributes','fieldName','key','getOptions','where','include','query','rows','catch','show','params','keys','filters','intersection','model','attributes','fields','length','includeAll','merge','options','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','update','body','describe','getMembers','findOne','UserWhatsappQueue','nolimit','order','sort','WhatsappQueueId','filter','findAll','User','findAndCountAll','agent','whatsappPause','updatedAt','format','%s/%s','SIP','createdAt','Team','pick','getTeams','addTeams','interface','flatMap','transaction','each','forEach','emit','ids','select','field','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','Agents','clone','sequelize','toString','SELECT','every','TeamId','includes','all','union','compact','removeTeams','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','getAgents'];(function(_0x599f34,_0x375ce0){var _0x128e0e=function(_0x1c793c){while(--_0x1c793c){_0x599f34['push'](_0x599f34['shift']());}};_0x128e0e(++_0x375ce0);}(_0x4d44,0x16c));var _0x44d4=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x4d44[_0x19950b];return _0x3c6b41;};'use strict';var BPromise=require(_0x44d4('0x0'));var util=require(_0x44d4('0x1'));var _=require(_0x44d4('0x2'));var squel=require(_0x44d4('0x3'));var Redis=require(_0x44d4('0x4'));var qs=require(_0x44d4('0x5'));var logger=require(_0x44d4('0x6'))(_0x44d4('0x7'));var config=require(_0x44d4('0x8'));var db=require(_0x44d4('0x9'))['db'];config[_0x44d4('0xa')]=_[_0x44d4('0xb')](config[_0x44d4('0xa')],{'host':_0x44d4('0xc'),'port':0x18eb});var socket=require(_0x44d4('0xd'))(new Redis(config[_0x44d4('0xa')]));require('./whatsappQueue.socket')[_0x44d4('0xe')](socket);function respondWithStatusCode(_0x3294e1,_0x578656){_0x578656=_0x578656||0xcc;return function(_0x5cb7c6){if(_0x5cb7c6){return _0x3294e1[_0x44d4('0xf')](_0x578656);}return _0x3294e1[_0x44d4('0x10')](_0x578656)[_0x44d4('0x11')]();};}function respondWithResult(_0x4baab2,_0x2c4545){_0x2c4545=_0x2c4545||0xc8;return function(_0x1a0703){if(_0x1a0703){return _0x4baab2['status'](_0x2c4545)[_0x44d4('0x12')](_0x1a0703);}};}function respondWithFilteredResult(_0x125b69,_0x34e24d){return function(_0x30f295){if(_0x30f295){var _0x164f4b=typeof _0x34e24d[_0x44d4('0x13')]==='undefined'&&typeof _0x34e24d[_0x44d4('0x14')]===_0x44d4('0x15');var _0x2a6f59=_0x30f295[_0x44d4('0x16')];var _0x369ff6=_0x164f4b?0x0:_0x34e24d[_0x44d4('0x13')];var _0x3321b5=_0x164f4b?_0x30f295[_0x44d4('0x16')]:_0x34e24d['offset']+_0x34e24d[_0x44d4('0x14')];var _0xc597fa;if(_0x3321b5>=_0x2a6f59){_0x3321b5=_0x2a6f59;_0xc597fa=0xc8;}else{_0xc597fa=0xce;}_0x125b69[_0x44d4('0x10')](_0xc597fa);return _0x125b69['set'](_0x44d4('0x17'),_0x369ff6+'-'+_0x3321b5+'/'+_0x2a6f59)[_0x44d4('0x12')](_0x30f295);}return null;};}function saveUpdates(_0x38b43e){return function(_0x3a465e){if(_0x3a465e){return _0x3a465e['update'](_0x38b43e)[_0x44d4('0x18')](function(_0x343a65){return _0x343a65;});}return null;};}function removeEntity(_0x6a9038){return function(_0x4de4cd){if(_0x4de4cd){return _0x4de4cd['destroy']()[_0x44d4('0x18')](function(){var _0x262835=_0x4de4cd[_0x44d4('0x19')]({'plain':!![]});var _0x4799e3=_0x44d4('0x1a');return db[_0x44d4('0x1b')][_0x44d4('0x1c')]({'where':{'type':_0x4799e3,'resourceId':_0x262835['id']}})[_0x44d4('0x18')](function(){return _0x4de4cd;});})[_0x44d4('0x18')](function(){_0x6a9038[_0x44d4('0x10')](0xcc)[_0x44d4('0x11')]();});}};}function handleEntityNotFound(_0x20f4c3){return function(_0x26903f){if(!_0x26903f){_0x20f4c3['sendStatus'](0x194);}return _0x26903f;};}function handleError(_0x41730e,_0x33dbf1){_0x33dbf1=_0x33dbf1||0x1f4;return function(_0x1d43dd){logger[_0x44d4('0x1d')](_0x1d43dd[_0x44d4('0x1e')]);if(_0x1d43dd['name']){delete _0x1d43dd[_0x44d4('0x1f')];}_0x41730e['status'](_0x33dbf1)[_0x44d4('0x20')](_0x1d43dd);};}exports['index']=function(_0x331019,_0x3a5fa6){var _0x37f139={};var _0x33ecee={'count':0x0,'rows':[]};var _0x2ba999=_[_0x44d4('0x21')](db[_0x44d4('0x22')][_0x44d4('0x23')],function(_0x48b306){return{'name':_0x48b306[_0x44d4('0x24')],'type':_0x48b306['type'][_0x44d4('0x25')]};});_0x37f139=qs[_0x44d4('0x26')](_0x2ba999,_0x331019);var _0x2332e2={'where':_0x37f139[_0x44d4('0x27')]};return db['WhatsappQueue'][_0x44d4('0x16')](_0x2332e2)[_0x44d4('0x18')](function(_0xa3e079){_0x33ecee['count']=_0xa3e079;_0x37f139[_0x44d4('0x28')]=qs[_0x44d4('0x28')](_0x331019[_0x44d4('0x29')]);return db['WhatsappQueue']['findAll'](_0x37f139);})[_0x44d4('0x18')](function(_0x216b06){_0x33ecee[_0x44d4('0x2a')]=_0x216b06;return _0x33ecee;})[_0x44d4('0x18')](respondWithFilteredResult(_0x3a5fa6,_0x37f139))[_0x44d4('0x2b')](handleError(_0x3a5fa6,null));};exports[_0x44d4('0x2c')]=function(_0x59cf73,_0x18921c){var _0x17fd0c={'raw':!![],'where':{'id':_0x59cf73[_0x44d4('0x2d')]['id']}},_0x40c132={};_0x40c132['model']=_[_0x44d4('0x2e')](db[_0x44d4('0x22')]['rawAttributes']);_0x40c132['query']=_[_0x44d4('0x2e')](_0x59cf73[_0x44d4('0x29')]);_0x40c132[_0x44d4('0x2f')]=_[_0x44d4('0x30')](_0x40c132[_0x44d4('0x31')],_0x40c132[_0x44d4('0x29')]);_0x17fd0c[_0x44d4('0x32')]=_[_0x44d4('0x30')](_0x40c132[_0x44d4('0x31')],qs[_0x44d4('0x33')](_0x59cf73[_0x44d4('0x29')][_0x44d4('0x33')]));_0x17fd0c[_0x44d4('0x32')]=_0x17fd0c['attributes'][_0x44d4('0x34')]?_0x17fd0c[_0x44d4('0x32')]:_0x40c132['model'];if(_0x59cf73[_0x44d4('0x29')][_0x44d4('0x35')]){_0x17fd0c[_0x44d4('0x28')]=[{'all':!![]}];}_0x17fd0c=_[_0x44d4('0x36')]({},_0x17fd0c,_0x59cf73[_0x44d4('0x37')]);return db[_0x44d4('0x22')][_0x44d4('0x38')](_0x17fd0c)[_0x44d4('0x18')](handleEntityNotFound(_0x18921c,null))[_0x44d4('0x18')](respondWithResult(_0x18921c,null))[_0x44d4('0x2b')](handleError(_0x18921c,null));};exports[_0x44d4('0x39')]=function(_0x1abe2c,_0x470bfc){return db[_0x44d4('0x22')]['create'](_0x1abe2c['body'],{})[_0x44d4('0x18')](function(_0x330c93){var _0x296ed7=_0x1abe2c[_0x44d4('0x3a')][_0x44d4('0x19')]({'plain':!![]});if(!_0x296ed7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x296ed7[_0x44d4('0x3b')]==='user'){var _0x2eba5c=_0x330c93['get']({'plain':!![]});var _0x104090=_0x44d4('0x1a');return db[_0x44d4('0x3c')][_0x44d4('0x38')]({'where':{'name':_0x104090,'userProfileId':_0x296ed7[_0x44d4('0x3d')]},'raw':!![]})[_0x44d4('0x18')](function(_0xf53070){if(_0xf53070&&_0xf53070[_0x44d4('0x3e')]===0x0){return db[_0x44d4('0x1b')][_0x44d4('0x39')]({'name':_0x2eba5c[_0x44d4('0x1f')],'resourceId':_0x2eba5c['id'],'type':_0xf53070['name'],'sectionId':_0xf53070['id']},{})['then'](function(){return _0x330c93;});}else{return _0x330c93;}})[_0x44d4('0x2b')](function(_0x24dc18){logger[_0x44d4('0x1d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x24dc18);throw _0x24dc18;});}return _0x330c93;})[_0x44d4('0x18')](respondWithResult(_0x470bfc,0xc9))[_0x44d4('0x2b')](handleError(_0x470bfc,null));};exports[_0x44d4('0x3f')]=function(_0x36875b,_0x594bb8){if(_0x36875b[_0x44d4('0x40')]['id']){delete _0x36875b[_0x44d4('0x40')]['id'];}return db[_0x44d4('0x22')][_0x44d4('0x38')]({'where':{'id':_0x36875b['params']['id']}})[_0x44d4('0x18')](handleEntityNotFound(_0x594bb8,null))[_0x44d4('0x18')](saveUpdates(_0x36875b[_0x44d4('0x40')],null))['then'](respondWithResult(_0x594bb8,null))[_0x44d4('0x2b')](handleError(_0x594bb8,null));};exports[_0x44d4('0x1c')]=function(_0x1b6374,_0x51978c){return db['WhatsappQueue'][_0x44d4('0x38')]({'where':{'id':_0x1b6374[_0x44d4('0x2d')]['id']}})[_0x44d4('0x18')](handleEntityNotFound(_0x51978c,null))['then'](removeEntity(_0x51978c,null))[_0x44d4('0x2b')](handleError(_0x51978c,null));};exports[_0x44d4('0x41')]=function(_0x135a67,_0x38e978){return db[_0x44d4('0x22')][_0x44d4('0x41')]()[_0x44d4('0x18')](respondWithResult(_0x38e978,null))[_0x44d4('0x2b')](handleError(_0x38e978,null));};exports[_0x44d4('0x42')]=function(_0x250440,_0x2073bc){var _0x52f773={'raw':!![],'where':{}},_0x379343={},_0x3f3933;return db[_0x44d4('0x22')][_0x44d4('0x43')]({'where':{'id':_0x250440[_0x44d4('0x2d')]['id']}})[_0x44d4('0x18')](handleEntityNotFound(_0x2073bc,null))[_0x44d4('0x18')](function(_0xd4718b){if(_0xd4718b){_0x3f3933=_0xd4718b[_0x44d4('0x19')]({'plain':!![]});_0x379343[_0x44d4('0x31')]=_['keys'](db[_0x44d4('0x44')][_0x44d4('0x23')]);_0x379343[_0x44d4('0x29')]=_[_0x44d4('0x2e')](_0x250440[_0x44d4('0x29')]);_0x379343[_0x44d4('0x2f')]=_[_0x44d4('0x30')](_0x379343[_0x44d4('0x31')],_0x379343[_0x44d4('0x29')]);_0x52f773[_0x44d4('0x32')]=_['intersection'](_0x379343['model'],qs[_0x44d4('0x33')](_0x250440[_0x44d4('0x29')][_0x44d4('0x33')]));_0x52f773[_0x44d4('0x32')]=_0x52f773['attributes'][_0x44d4('0x34')]?_0x52f773['attributes']:_0x379343[_0x44d4('0x31')];if(!_0x250440['query']['hasOwnProperty'](_0x44d4('0x45'))){_0x52f773[_0x44d4('0x14')]=qs[_0x44d4('0x14')](_0x250440[_0x44d4('0x29')]['limit']);_0x52f773[_0x44d4('0x13')]=qs[_0x44d4('0x13')](_0x250440[_0x44d4('0x29')][_0x44d4('0x13')]);}_0x52f773[_0x44d4('0x46')]=qs['sort'](_0x250440[_0x44d4('0x29')][_0x44d4('0x47')]);_0x52f773[_0x44d4('0x27')]=qs[_0x44d4('0x2f')](_['pick'](_0x250440[_0x44d4('0x29')],_0x379343[_0x44d4('0x2f')]));_0x52f773[_0x44d4('0x27')][_0x44d4('0x48')]=_0xd4718b['id'];if(_0x250440[_0x44d4('0x29')][_0x44d4('0x49')]){_0x52f773[_0x44d4('0x27')]=_[_0x44d4('0x36')](_0x52f773[_0x44d4('0x27')],{'$or':_[_0x44d4('0x21')](_0x52f773[_0x44d4('0x32')],function(_0x46c374){var _0x1e1629={};_0x1e1629[_0x46c374]={'$like':'%'+_0x250440[_0x44d4('0x29')][_0x44d4('0x49')]+'%'};return _0x1e1629;})});}_0x52f773=_[_0x44d4('0x36')]({},_0x52f773,_0x250440[_0x44d4('0x37')]);return db['UserWhatsappQueue'][_0x44d4('0x4a')](_0x52f773);}})[_0x44d4('0x18')](function(_0xf41f84){if(_0xf41f84){return db[_0x44d4('0x4b')][_0x44d4('0x4c')]({'where':{'id':_[_0x44d4('0x21')](_0xf41f84,'UserId'),'role':_0x44d4('0x4d')},'attributes':['id',_0x44d4('0x1f'),_0x44d4('0x4e'),_0x44d4('0x4f'),'createdAt']});}})[_0x44d4('0x18')](function(_0x72f52f){if(_0x72f52f){return{'count':_0x72f52f[_0x44d4('0x16')],'rows':_[_0x44d4('0x21')](_0x72f52f[_0x44d4('0x2a')],function(_0x3440b5){return{'membername':_0x3440b5[_0x44d4('0x1f')],'UserId':_0x3440b5['id'],'queue_name':_0x3f3933[_0x44d4('0x1f')],'WhatsappQueueId':_0x3f3933['id'],'interface':util[_0x44d4('0x50')](_0x44d4('0x51'),_0x44d4('0x52'),_0x3440b5[_0x44d4('0x1f')]),'penalty':0x0,'paused':_0x3440b5['whatsappPause'],'createdAt':_0x3440b5[_0x44d4('0x53')],'updatedAt':_0x3440b5['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2073bc,_0x52f773))[_0x44d4('0x2b')](handleError(_0x2073bc,null));};exports['getTeams']=function(_0x2e1cf6,_0x324a8d){var _0x1bcdd4={};var _0x51daee={};var _0xfce6ea;var _0x7dd759;return db[_0x44d4('0x22')][_0x44d4('0x43')]({'where':{'id':_0x2e1cf6['params']['id']}})[_0x44d4('0x18')](handleEntityNotFound(_0x324a8d,null))[_0x44d4('0x18')](function(_0x3c6902){if(_0x3c6902){_0xfce6ea=_0x3c6902;_0x51daee[_0x44d4('0x31')]=_[_0x44d4('0x2e')](db[_0x44d4('0x54')][_0x44d4('0x23')]);_0x51daee[_0x44d4('0x29')]=_[_0x44d4('0x2e')](_0x2e1cf6['query']);_0x51daee[_0x44d4('0x2f')]=_[_0x44d4('0x30')](_0x51daee[_0x44d4('0x31')],_0x51daee['query']);_0x1bcdd4[_0x44d4('0x32')]=_[_0x44d4('0x30')](_0x51daee[_0x44d4('0x31')],qs[_0x44d4('0x33')](_0x2e1cf6['query']['fields']));_0x1bcdd4[_0x44d4('0x32')]=_0x1bcdd4[_0x44d4('0x32')][_0x44d4('0x34')]?_0x1bcdd4['attributes']:_0x51daee[_0x44d4('0x31')];_0x1bcdd4['order']=qs[_0x44d4('0x47')](_0x2e1cf6['query']['sort']);_0x1bcdd4[_0x44d4('0x27')]=qs['filters'](_[_0x44d4('0x55')](_0x2e1cf6[_0x44d4('0x29')],_0x51daee[_0x44d4('0x2f')]));if(_0x2e1cf6['query'][_0x44d4('0x49')]){_0x1bcdd4[_0x44d4('0x27')]=_[_0x44d4('0x36')](_0x1bcdd4[_0x44d4('0x27')],{'$or':_[_0x44d4('0x21')](_0x1bcdd4[_0x44d4('0x32')],function(_0x750d35){var _0x2870b8={};_0x2870b8[_0x750d35]={'$like':'%'+_0x2e1cf6['query'][_0x44d4('0x49')]+'%'};return _0x2870b8;})});}_0x1bcdd4=_[_0x44d4('0x36')]({},_0x1bcdd4,_0x2e1cf6[_0x44d4('0x37')]);return _0xfce6ea[_0x44d4('0x56')](_0x1bcdd4);}})[_0x44d4('0x18')](function(_0x1f9b8d){if(_0x1f9b8d){_0x7dd759=_0x1f9b8d[_0x44d4('0x34')];if(!_0x2e1cf6[_0x44d4('0x29')]['hasOwnProperty'](_0x44d4('0x45'))){_0x1bcdd4['limit']=qs[_0x44d4('0x14')](_0x2e1cf6['query'][_0x44d4('0x14')]);_0x1bcdd4[_0x44d4('0x13')]=qs['offset'](_0x2e1cf6[_0x44d4('0x29')][_0x44d4('0x13')]);}return _0xfce6ea[_0x44d4('0x56')](_0x1bcdd4);}})[_0x44d4('0x18')](function(_0x4914e8){if(_0x4914e8){return _0x4914e8?{'count':_0x7dd759,'rows':_0x4914e8}:null;}})[_0x44d4('0x18')](respondWithResult(_0x324a8d,null))[_0x44d4('0x2b')](handleError(_0x324a8d,null));};exports[_0x44d4('0x57')]=function(_0x443ad1,_0x49c291){var _0x242af8=_0x443ad1[_0x44d4('0x40')]['ids'];return db[_0x44d4('0x54')][_0x44d4('0x4a')]({'where':{'id':_0x242af8},'attributes':['id'],'include':[{'model':db[_0x44d4('0x4b')],'as':'Agents','attributes':['id',_0x44d4('0x1f'),'online','voicePause',_0x44d4('0x58')],'raw':!![]}]})['then'](function(_0x11a123){if(_0x11a123){var _0x299934=_[_0x44d4('0x59')](_0x11a123,function(_0x12e118){var _0x13e275=_0x12e118['get']({'plain':!![]});return _0x13e275['Agents'];});return db[_0x44d4('0x22')][_0x44d4('0x38')]({'where':{'id':_0x443ad1[_0x44d4('0x2d')]['id']}})['then'](function(_0x1d4600){return db['sequelize'][_0x44d4('0x5a')](function(_0x4ab158){return _0x1d4600['addTeams'](_0x242af8,{'transaction':_0x4ab158})[_0x44d4('0x18')](function(){return BPromise[_0x44d4('0x5b')](_0x299934,function(_0x4e23b2){return db[_0x44d4('0x44')]['findOrCreate']({'where':{'UserId':_0x4e23b2['id'],'WhatsappQueueId':_0x443ad1[_0x44d4('0x2d')]['id']},'transaction':_0x4ab158});});})[_0x44d4('0x18')](function(){_0x299934[_0x44d4('0x5c')](function(_0x1ebb42){socket[_0x44d4('0x5d')]('userWhatsappQueue:save',{'UserId':_0x1ebb42['id'],'WhatsappQueueId':_0x1d4600['id']});});});});});}})[_0x44d4('0x18')](respondWithStatusCode(_0x49c291,null))[_0x44d4('0x2b')](handleError(_0x49c291,null));};exports['removeTeams']=function(_0x2489c8,_0x168468){return db[_0x44d4('0x54')]['findAll']({'where':{'id':_0x2489c8['query'][_0x44d4('0x5e')]},'attributes':['id'],'include':[{'model':db[_0x44d4('0x4b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x44d4('0x18')](handleEntityNotFound(_0x168468,null))[_0x44d4('0x18')](function(_0x4faba4){var _0x503665=_['map'](_0x4faba4,'id');var _0x335ee7=[];var _0xfb597a=[];var _0x3a2020=squel[_0x44d4('0x5f')]();_0x3a2020[_0x44d4('0x60')]('tq.TeamId')[_0x44d4('0x61')](_0x44d4('0x62'),'tq')[_0x44d4('0x63')](_0x44d4('0x64'),'ut',_0x44d4('0x65'))['where']('WhatsappQueueId\x20=\x20?',_0x2489c8[_0x44d4('0x2d')]['id']);for(var _0x55098e=0x0;_0x55098e<_0x4faba4[_0x44d4('0x34')];_0x55098e+=0x1){let _0x251170=_0x4faba4[_0x55098e];for(var _0x2fc457=0x0;_0x2fc457<_0x251170[_0x44d4('0x66')][_0x44d4('0x34')];_0x2fc457+=0x1){let _0x55010b=_0x251170[_0x44d4('0x66')][_0x2fc457];var _0x149b1b=_0x3a2020[_0x44d4('0x67')]();_0x149b1b[_0x44d4('0x27')]('ut.UserId\x20=\x20?',_0x55010b['id']);_0xfb597a['push'](db[_0x44d4('0x68')][_0x44d4('0x29')](_0x149b1b[_0x44d4('0x69')](),{'type':db[_0x44d4('0x68')]['QueryTypes'][_0x44d4('0x6a')]})[_0x44d4('0x18')](function(_0x1a1bdf){if(_0x1a1bdf[_0x44d4('0x34')]===0x1){return _0x55010b['id'];}else{var _0x30e101=_[_0x44d4('0x6b')](_[_0x44d4('0x21')](_0x1a1bdf,_0x44d4('0x6c')),function(_0x5592ec){return _[_0x44d4('0x6d')](_0x503665,_0x5592ec);});if(_0x30e101){return _0x55010b['id'];}}}));}}return BPromise[_0x44d4('0x6e')](_0xfb597a)[_0x44d4('0x18')](function(_0x2fdb1b){_0x335ee7=_(_0x335ee7)[_0x44d4('0x6f')](_0x2fdb1b)[_0x44d4('0x70')]()['value']();return db[_0x44d4('0x22')]['find']({'where':{'id':_0x2489c8[_0x44d4('0x2d')]['id']}})['then'](function(_0x72b1bd){return db[_0x44d4('0x68')]['transaction'](function(_0x7a6257){return _0x72b1bd[_0x44d4('0x71')](_0x2489c8[_0x44d4('0x29')][_0x44d4('0x5e')],{'transaction':_0x7a6257})['then'](function(){if(!_['isEmpty'](_0x335ee7)){return _0x72b1bd[_0x44d4('0x72')](_0x335ee7,{'transaction':_0x7a6257});}})[_0x44d4('0x18')](function(){_0x335ee7[_0x44d4('0x5c')](function(_0x254bde){socket['emit'](_0x44d4('0x73'),{'UserId':_0x254bde,'WhatsappQueueId':_0x72b1bd['id']});});});});});});})[_0x44d4('0x18')](respondWithStatusCode(_0x168468,null))[_0x44d4('0x2b')](handleError(_0x168468,null));};exports[_0x44d4('0x74')]=function(_0x5c9c90,_0xad8d5e){return db[_0x44d4('0x22')]['find']({'where':{'id':_0x5c9c90[_0x44d4('0x2d')]['id']}})['then'](handleEntityNotFound(_0xad8d5e,null))[_0x44d4('0x18')](function(_0x2d44d6){if(_0x2d44d6){return _0x2d44d6['addAgents'](_0x5c9c90['body'][_0x44d4('0x5e')],_[_0x44d4('0x75')](_0x5c9c90[_0x44d4('0x40')],['ids','id'])||{})[_0x44d4('0x76')](function(_0x1c1771){for(var _0x4b60d8=0x0;_0x4b60d8<_0x5c9c90['body'][_0x44d4('0x5e')]['length'];_0x4b60d8+=0x1){socket[_0x44d4('0x5d')]('userWhatsappQueue:save',{'UserId':Number(_0x5c9c90[_0x44d4('0x40')][_0x44d4('0x5e')][_0x4b60d8]),'WhatsappQueueId':Number(_0x5c9c90[_0x44d4('0x2d')]['id'])});}return _0x1c1771;});}})[_0x44d4('0x18')](respondWithResult(_0xad8d5e,null))[_0x44d4('0x2b')](handleError(_0xad8d5e,null));};exports[_0x44d4('0x72')]=function(_0x46326a,_0x470cf9){return db[_0x44d4('0x22')][_0x44d4('0x38')]({'where':{'id':_0x46326a[_0x44d4('0x2d')]['id']}})['then'](handleEntityNotFound(_0x470cf9,null))[_0x44d4('0x18')](function(_0x57c291){if(_0x57c291){return _0x57c291[_0x44d4('0x72')](_0x46326a['query'][_0x44d4('0x5e')])[_0x44d4('0x18')](function(){if(_['isArray'](_0x46326a['query'][_0x44d4('0x5e')])){for(var _0x23d2bd=0x0;_0x23d2bd<_0x46326a[_0x44d4('0x29')][_0x44d4('0x5e')][_0x44d4('0x34')];_0x23d2bd+=0x1){socket['emit'](_0x44d4('0x73'),{'UserId':Number(_0x46326a['query']['ids'][_0x23d2bd]),'WhatsappQueueId':Number(_0x46326a[_0x44d4('0x2d')]['id'])});}}else{socket[_0x44d4('0x5d')](_0x44d4('0x73'),{'UserId':Number(_0x46326a[_0x44d4('0x29')][_0x44d4('0x5e')]),'WhatsappQueueId':Number(_0x46326a[_0x44d4('0x2d')]['id'])});}});}})['then'](respondWithStatusCode(_0x470cf9,null))[_0x44d4('0x2b')](handleError(_0x470cf9,null));};exports[_0x44d4('0x77')]=function(_0x2bb00d,_0x4d1e68){var _0x44d20a={};var _0x2d01bf={};var _0xebbe51;var _0x460116;return db['WhatsappQueue'][_0x44d4('0x43')]({'where':{'id':_0x2bb00d['params']['id']}})[_0x44d4('0x18')](handleEntityNotFound(_0x4d1e68,null))['then'](function(_0x36fb99){if(_0x36fb99){_0xebbe51=_0x36fb99;_0x2d01bf['model']=_[_0x44d4('0x2e')](db[_0x44d4('0x4b')]['rawAttributes']);_0x2d01bf['query']=_[_0x44d4('0x2e')](_0x2bb00d[_0x44d4('0x29')]);_0x2d01bf[_0x44d4('0x2f')]=_[_0x44d4('0x30')](_0x2d01bf['model'],_0x2d01bf[_0x44d4('0x29')]);_0x44d20a[_0x44d4('0x32')]=_[_0x44d4('0x30')](_0x2d01bf[_0x44d4('0x31')],qs[_0x44d4('0x33')](_0x2bb00d['query'][_0x44d4('0x33')]));_0x44d20a['attributes']=_0x44d20a[_0x44d4('0x32')][_0x44d4('0x34')]?_0x44d20a[_0x44d4('0x32')]:_0x2d01bf['model'];_0x44d20a[_0x44d4('0x46')]=qs[_0x44d4('0x47')](_0x2bb00d[_0x44d4('0x29')]['sort']);_0x44d20a[_0x44d4('0x27')]=qs[_0x44d4('0x2f')](_[_0x44d4('0x55')](_0x2bb00d[_0x44d4('0x29')],_0x2d01bf['filters']));if(_0x2bb00d['query'][_0x44d4('0x49')]){_0x44d20a[_0x44d4('0x27')]=_[_0x44d4('0x36')](_0x44d20a[_0x44d4('0x27')],{'$or':_[_0x44d4('0x21')](_0x44d20a['attributes'],function(_0x59994a){var _0x52b2fc={};_0x52b2fc[_0x59994a]={'$like':'%'+_0x2bb00d[_0x44d4('0x29')]['filter']+'%'};return _0x52b2fc;})});}_0x44d20a=_['merge']({},_0x44d20a,_0x2bb00d[_0x44d4('0x37')]);return _0xebbe51[_0x44d4('0x77')](_0x44d20a);}})[_0x44d4('0x18')](function(_0x717039){if(_0x717039){_0x460116=_0x717039[_0x44d4('0x34')];if(!_0x2bb00d[_0x44d4('0x29')][_0x44d4('0x78')](_0x44d4('0x45'))){_0x44d20a[_0x44d4('0x14')]=qs[_0x44d4('0x14')](_0x2bb00d[_0x44d4('0x29')][_0x44d4('0x14')]);_0x44d20a[_0x44d4('0x13')]=qs['offset'](_0x2bb00d[_0x44d4('0x29')][_0x44d4('0x13')]);}return _0xebbe51[_0x44d4('0x77')](_0x44d20a);}})[_0x44d4('0x18')](function(_0x2b8d25){if(_0x2b8d25){return _0x2b8d25?{'count':_0x460116,'rows':_0x2b8d25}:null;}})[_0x44d4('0x18')](respondWithResult(_0x4d1e68,null))[_0x44d4('0x2b')](handleError(_0x4d1e68,null));}; \ No newline at end of file +var _0x8c12=['order','sort','pick','WhatsappQueueId','filter','merge','User','findAndCountAll','agent','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','online','voicePause','interface','Agents','sequelize','transaction','each','UserWhatsappQueue','findOrCreate','forEach','userWhatsappQueue:save','removeTeams','select','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','includes','all','union','value','isEmpty','removeAgents','emit','addAgents','omit','userWhatsappQueue:remove','getAgents','bluebird','util','squel','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','end','status','json','limit','undefined','count','offset','Content-Range','update','then','destroy','get','WhatsappQueues','UserProfileResource','error','stack','name','send','index','map','fieldName','getOptions','where','include','query','WhatsappQueue','findAll','rows','catch','show','params','model','keys','rawAttributes','intersection','attributes','fields','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','describe','getMembers','findOne','filters','hasOwnProperty','nolimit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8c12,0x12c));var _0x28c1=function(_0x2bb180,_0x31a8fb){_0x2bb180=_0x2bb180-0x0;var _0xe94b01=_0x8c12[_0x2bb180];return _0xe94b01;};'use strict';var BPromise=require(_0x28c1('0x0'));var util=require(_0x28c1('0x1'));var _=require('lodash');var squel=require(_0x28c1('0x2'));var Redis=require(_0x28c1('0x3'));var qs=require('../../components/parsers/qs');var logger=require(_0x28c1('0x4'))(_0x28c1('0x5'));var config=require(_0x28c1('0x6'));var db=require(_0x28c1('0x7'))['db'];config[_0x28c1('0x8')]=_[_0x28c1('0x9')](config[_0x28c1('0x8')],{'host':_0x28c1('0xa'),'port':0x18eb});var socket=require(_0x28c1('0xb'))(new Redis(config[_0x28c1('0x8')]));require(_0x28c1('0xc'))[_0x28c1('0xd')](socket);function respondWithStatusCode(_0x166ce1,_0x5769f2){_0x5769f2=_0x5769f2||0xcc;return function(_0xdf8adf){if(_0xdf8adf){return _0x166ce1[_0x28c1('0xe')](_0x5769f2);}return _0x166ce1['status'](_0x5769f2)[_0x28c1('0xf')]();};}function respondWithResult(_0x2559f5,_0x1390c9){_0x1390c9=_0x1390c9||0xc8;return function(_0x536f76){if(_0x536f76){return _0x2559f5[_0x28c1('0x10')](_0x1390c9)[_0x28c1('0x11')](_0x536f76);}};}function respondWithFilteredResult(_0x2c1b54,_0x559deb){return function(_0x50fed0){if(_0x50fed0){var _0x40080d=typeof _0x559deb['offset']==='undefined'&&typeof _0x559deb[_0x28c1('0x12')]===_0x28c1('0x13');var _0x776aa9=_0x50fed0[_0x28c1('0x14')];var _0x2354f3=_0x40080d?0x0:_0x559deb[_0x28c1('0x15')];var _0x35d902=_0x40080d?_0x50fed0[_0x28c1('0x14')]:_0x559deb[_0x28c1('0x15')]+_0x559deb['limit'];var _0x4566f7;if(_0x35d902>=_0x776aa9){_0x35d902=_0x776aa9;_0x4566f7=0xc8;}else{_0x4566f7=0xce;}_0x2c1b54['status'](_0x4566f7);return _0x2c1b54['set'](_0x28c1('0x16'),_0x2354f3+'-'+_0x35d902+'/'+_0x776aa9)[_0x28c1('0x11')](_0x50fed0);}return null;};}function saveUpdates(_0x21cfe0){return function(_0x106d26){if(_0x106d26){return _0x106d26[_0x28c1('0x17')](_0x21cfe0)[_0x28c1('0x18')](function(_0x30cb6f){return _0x30cb6f;});}return null;};}function removeEntity(_0x3ae19c){return function(_0x127b47){if(_0x127b47){return _0x127b47[_0x28c1('0x19')]()['then'](function(){var _0x47e87f=_0x127b47[_0x28c1('0x1a')]({'plain':!![]});var _0x120edd=_0x28c1('0x1b');return db[_0x28c1('0x1c')][_0x28c1('0x19')]({'where':{'type':_0x120edd,'resourceId':_0x47e87f['id']}})[_0x28c1('0x18')](function(){return _0x127b47;});})[_0x28c1('0x18')](function(){_0x3ae19c[_0x28c1('0x10')](0xcc)[_0x28c1('0xf')]();});}};}function handleEntityNotFound(_0x5ed243){return function(_0x12362a){if(!_0x12362a){_0x5ed243['sendStatus'](0x194);}return _0x12362a;};}function handleError(_0x1fdbbe,_0x24af8a){_0x24af8a=_0x24af8a||0x1f4;return function(_0x27872a){logger[_0x28c1('0x1d')](_0x27872a[_0x28c1('0x1e')]);if(_0x27872a[_0x28c1('0x1f')]){delete _0x27872a['name'];}_0x1fdbbe['status'](_0x24af8a)[_0x28c1('0x20')](_0x27872a);};}exports[_0x28c1('0x21')]=function(_0x26368f,_0x537302){var _0x123f60={};var _0x5e7e07={'count':0x0,'rows':[]};var _0x5e6116=_[_0x28c1('0x22')](db['WhatsappQueue']['rawAttributes'],function(_0x185a49){return{'name':_0x185a49[_0x28c1('0x23')],'type':_0x185a49['type']['key']};});_0x123f60=qs[_0x28c1('0x24')](_0x5e6116,_0x26368f);var _0x17e8cc={'where':_0x123f60[_0x28c1('0x25')]};return db['WhatsappQueue'][_0x28c1('0x14')](_0x17e8cc)[_0x28c1('0x18')](function(_0x483d6a){_0x5e7e07[_0x28c1('0x14')]=_0x483d6a;_0x123f60[_0x28c1('0x26')]=qs[_0x28c1('0x26')](_0x26368f[_0x28c1('0x27')]);return db[_0x28c1('0x28')][_0x28c1('0x29')](_0x123f60);})[_0x28c1('0x18')](function(_0x1924ad){_0x5e7e07[_0x28c1('0x2a')]=_0x1924ad;return _0x5e7e07;})[_0x28c1('0x18')](respondWithFilteredResult(_0x537302,_0x123f60))[_0x28c1('0x2b')](handleError(_0x537302,null));};exports[_0x28c1('0x2c')]=function(_0x83edbd,_0x580b40){var _0x43fb00={'raw':!![],'where':{'id':_0x83edbd[_0x28c1('0x2d')]['id']}},_0x5761d4={};_0x5761d4[_0x28c1('0x2e')]=_[_0x28c1('0x2f')](db['WhatsappQueue'][_0x28c1('0x30')]);_0x5761d4[_0x28c1('0x27')]=_[_0x28c1('0x2f')](_0x83edbd[_0x28c1('0x27')]);_0x5761d4['filters']=_[_0x28c1('0x31')](_0x5761d4[_0x28c1('0x2e')],_0x5761d4[_0x28c1('0x27')]);_0x43fb00[_0x28c1('0x32')]=_[_0x28c1('0x31')](_0x5761d4[_0x28c1('0x2e')],qs[_0x28c1('0x33')](_0x83edbd[_0x28c1('0x27')][_0x28c1('0x33')]));_0x43fb00['attributes']=_0x43fb00[_0x28c1('0x32')][_0x28c1('0x34')]?_0x43fb00[_0x28c1('0x32')]:_0x5761d4[_0x28c1('0x2e')];if(_0x83edbd[_0x28c1('0x27')]['includeAll']){_0x43fb00[_0x28c1('0x26')]=[{'all':!![]}];}_0x43fb00=_['merge']({},_0x43fb00,_0x83edbd[_0x28c1('0x35')]);return db['WhatsappQueue'][_0x28c1('0x36')](_0x43fb00)[_0x28c1('0x18')](handleEntityNotFound(_0x580b40,null))[_0x28c1('0x18')](respondWithResult(_0x580b40,null))[_0x28c1('0x2b')](handleError(_0x580b40,null));};exports[_0x28c1('0x37')]=function(_0x471b66,_0x4387ce){return db[_0x28c1('0x28')][_0x28c1('0x37')](_0x471b66[_0x28c1('0x38')],{})[_0x28c1('0x18')](function(_0x5f076c){var _0x3f8abd=_0x471b66[_0x28c1('0x39')][_0x28c1('0x1a')]({'plain':!![]});if(!_0x3f8abd)throw new Error(_0x28c1('0x3a'));if(_0x3f8abd[_0x28c1('0x3b')]===_0x28c1('0x39')){var _0x17fb76=_0x5f076c[_0x28c1('0x1a')]({'plain':!![]});var _0x2f7156=_0x28c1('0x1b');return db[_0x28c1('0x3c')][_0x28c1('0x36')]({'where':{'name':_0x2f7156,'userProfileId':_0x3f8abd[_0x28c1('0x3d')]},'raw':!![]})[_0x28c1('0x18')](function(_0x50fd93){if(_0x50fd93&&_0x50fd93[_0x28c1('0x3e')]===0x0){return db[_0x28c1('0x1c')][_0x28c1('0x37')]({'name':_0x17fb76[_0x28c1('0x1f')],'resourceId':_0x17fb76['id'],'type':_0x50fd93['name'],'sectionId':_0x50fd93['id']},{})[_0x28c1('0x18')](function(){return _0x5f076c;});}else{return _0x5f076c;}})[_0x28c1('0x2b')](function(_0xcee021){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xcee021);throw _0xcee021;});}return _0x5f076c;})[_0x28c1('0x18')](respondWithResult(_0x4387ce,0xc9))[_0x28c1('0x2b')](handleError(_0x4387ce,null));};exports[_0x28c1('0x17')]=function(_0x34fdc5,_0x3e90a3){if(_0x34fdc5[_0x28c1('0x38')]['id']){delete _0x34fdc5[_0x28c1('0x38')]['id'];}return db[_0x28c1('0x28')]['find']({'where':{'id':_0x34fdc5[_0x28c1('0x2d')]['id']}})['then'](handleEntityNotFound(_0x3e90a3,null))['then'](saveUpdates(_0x34fdc5[_0x28c1('0x38')],null))[_0x28c1('0x18')](respondWithResult(_0x3e90a3,null))['catch'](handleError(_0x3e90a3,null));};exports[_0x28c1('0x19')]=function(_0x47d5ef,_0x11bdb5){return db[_0x28c1('0x28')][_0x28c1('0x36')]({'where':{'id':_0x47d5ef[_0x28c1('0x2d')]['id']}})['then'](handleEntityNotFound(_0x11bdb5,null))[_0x28c1('0x18')](removeEntity(_0x11bdb5,null))['catch'](handleError(_0x11bdb5,null));};exports[_0x28c1('0x3f')]=function(_0x32c2b0,_0x3875f1){return db['WhatsappQueue'][_0x28c1('0x3f')]()[_0x28c1('0x18')](respondWithResult(_0x3875f1,null))[_0x28c1('0x2b')](handleError(_0x3875f1,null));};exports[_0x28c1('0x40')]=function(_0x7c3868,_0x186158){var _0x4cc2a4={'raw':!![],'where':{}},_0x143cbd={},_0x23c5f6;return db[_0x28c1('0x28')][_0x28c1('0x41')]({'where':{'id':_0x7c3868[_0x28c1('0x2d')]['id']}})[_0x28c1('0x18')](handleEntityNotFound(_0x186158,null))[_0x28c1('0x18')](function(_0x22919f){if(_0x22919f){_0x23c5f6=_0x22919f['get']({'plain':!![]});_0x143cbd[_0x28c1('0x2e')]=_[_0x28c1('0x2f')](db['UserWhatsappQueue'][_0x28c1('0x30')]);_0x143cbd[_0x28c1('0x27')]=_['keys'](_0x7c3868['query']);_0x143cbd[_0x28c1('0x42')]=_[_0x28c1('0x31')](_0x143cbd['model'],_0x143cbd['query']);_0x4cc2a4[_0x28c1('0x32')]=_[_0x28c1('0x31')](_0x143cbd['model'],qs[_0x28c1('0x33')](_0x7c3868[_0x28c1('0x27')][_0x28c1('0x33')]));_0x4cc2a4['attributes']=_0x4cc2a4[_0x28c1('0x32')][_0x28c1('0x34')]?_0x4cc2a4[_0x28c1('0x32')]:_0x143cbd[_0x28c1('0x2e')];if(!_0x7c3868[_0x28c1('0x27')][_0x28c1('0x43')](_0x28c1('0x44'))){_0x4cc2a4[_0x28c1('0x12')]=qs[_0x28c1('0x12')](_0x7c3868[_0x28c1('0x27')][_0x28c1('0x12')]);_0x4cc2a4['offset']=qs[_0x28c1('0x15')](_0x7c3868['query'][_0x28c1('0x15')]);}_0x4cc2a4[_0x28c1('0x45')]=qs[_0x28c1('0x46')](_0x7c3868[_0x28c1('0x27')][_0x28c1('0x46')]);_0x4cc2a4[_0x28c1('0x25')]=qs[_0x28c1('0x42')](_[_0x28c1('0x47')](_0x7c3868[_0x28c1('0x27')],_0x143cbd[_0x28c1('0x42')]));_0x4cc2a4['where'][_0x28c1('0x48')]=_0x22919f['id'];if(_0x7c3868[_0x28c1('0x27')][_0x28c1('0x49')]){_0x4cc2a4[_0x28c1('0x25')]=_['merge'](_0x4cc2a4['where'],{'$or':_[_0x28c1('0x22')](_0x4cc2a4['attributes'],function(_0x2369de){var _0x56b8af={};_0x56b8af[_0x2369de]={'$like':'%'+_0x7c3868['query'][_0x28c1('0x49')]+'%'};return _0x56b8af;})});}_0x4cc2a4=_[_0x28c1('0x4a')]({},_0x4cc2a4,_0x7c3868[_0x28c1('0x35')]);return db['UserWhatsappQueue'][_0x28c1('0x29')](_0x4cc2a4);}})[_0x28c1('0x18')](function(_0x394cde){if(_0x394cde){return db[_0x28c1('0x4b')][_0x28c1('0x4c')]({'where':{'id':_[_0x28c1('0x22')](_0x394cde,'UserId'),'role':_0x28c1('0x4d')},'attributes':['id',_0x28c1('0x1f'),'whatsappPause',_0x28c1('0x4e'),_0x28c1('0x4f')]});}})[_0x28c1('0x18')](function(_0x1dc0ec){if(_0x1dc0ec){return{'count':_0x1dc0ec[_0x28c1('0x14')],'rows':_[_0x28c1('0x22')](_0x1dc0ec[_0x28c1('0x2a')],function(_0x22f469){return{'membername':_0x22f469[_0x28c1('0x1f')],'UserId':_0x22f469['id'],'queue_name':_0x23c5f6['name'],'WhatsappQueueId':_0x23c5f6['id'],'interface':util[_0x28c1('0x50')](_0x28c1('0x51'),_0x28c1('0x52'),_0x22f469['name']),'penalty':0x0,'paused':_0x22f469['whatsappPause'],'createdAt':_0x22f469[_0x28c1('0x4f')],'updatedAt':_0x22f469[_0x28c1('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x186158,_0x4cc2a4))[_0x28c1('0x2b')](handleError(_0x186158,null));};exports[_0x28c1('0x53')]=function(_0x1e82fe,_0x68fb42){var _0x42dc16={};var _0x1a9990={};var _0x1f18fa;var _0x15303a;return db[_0x28c1('0x28')][_0x28c1('0x41')]({'where':{'id':_0x1e82fe[_0x28c1('0x2d')]['id']}})[_0x28c1('0x18')](handleEntityNotFound(_0x68fb42,null))['then'](function(_0x2999c5){if(_0x2999c5){_0x1f18fa=_0x2999c5;_0x1a9990[_0x28c1('0x2e')]=_[_0x28c1('0x2f')](db[_0x28c1('0x54')]['rawAttributes']);_0x1a9990[_0x28c1('0x27')]=_[_0x28c1('0x2f')](_0x1e82fe['query']);_0x1a9990['filters']=_['intersection'](_0x1a9990[_0x28c1('0x2e')],_0x1a9990['query']);_0x42dc16[_0x28c1('0x32')]=_[_0x28c1('0x31')](_0x1a9990[_0x28c1('0x2e')],qs[_0x28c1('0x33')](_0x1e82fe['query'][_0x28c1('0x33')]));_0x42dc16[_0x28c1('0x32')]=_0x42dc16[_0x28c1('0x32')][_0x28c1('0x34')]?_0x42dc16['attributes']:_0x1a9990[_0x28c1('0x2e')];_0x42dc16['order']=qs[_0x28c1('0x46')](_0x1e82fe[_0x28c1('0x27')][_0x28c1('0x46')]);_0x42dc16[_0x28c1('0x25')]=qs[_0x28c1('0x42')](_[_0x28c1('0x47')](_0x1e82fe[_0x28c1('0x27')],_0x1a9990['filters']));if(_0x1e82fe[_0x28c1('0x27')][_0x28c1('0x49')]){_0x42dc16[_0x28c1('0x25')]=_[_0x28c1('0x4a')](_0x42dc16[_0x28c1('0x25')],{'$or':_[_0x28c1('0x22')](_0x42dc16[_0x28c1('0x32')],function(_0x3a7ff1){var _0x15af29={};_0x15af29[_0x3a7ff1]={'$like':'%'+_0x1e82fe[_0x28c1('0x27')][_0x28c1('0x49')]+'%'};return _0x15af29;})});}_0x42dc16=_[_0x28c1('0x4a')]({},_0x42dc16,_0x1e82fe[_0x28c1('0x35')]);return _0x1f18fa[_0x28c1('0x53')](_0x42dc16);}})[_0x28c1('0x18')](function(_0xeeae01){if(_0xeeae01){_0x15303a=_0xeeae01['length'];if(!_0x1e82fe['query'][_0x28c1('0x43')]('nolimit')){_0x42dc16[_0x28c1('0x12')]=qs[_0x28c1('0x12')](_0x1e82fe[_0x28c1('0x27')][_0x28c1('0x12')]);_0x42dc16[_0x28c1('0x15')]=qs[_0x28c1('0x15')](_0x1e82fe['query'][_0x28c1('0x15')]);}return _0x1f18fa['getTeams'](_0x42dc16);}})[_0x28c1('0x18')](function(_0x304f38){if(_0x304f38){return _0x304f38?{'count':_0x15303a,'rows':_0x304f38}:null;}})[_0x28c1('0x18')](respondWithResult(_0x68fb42,null))[_0x28c1('0x2b')](handleError(_0x68fb42,null));};exports[_0x28c1('0x55')]=function(_0x4f71e7,_0x28f5a9){var _0x28362f=_0x4f71e7[_0x28c1('0x38')][_0x28c1('0x56')];return db[_0x28c1('0x54')][_0x28c1('0x29')]({'where':{'id':_0x28362f},'attributes':['id'],'include':[{'model':db[_0x28c1('0x4b')],'as':'Agents','attributes':['id',_0x28c1('0x1f'),_0x28c1('0x57'),_0x28c1('0x58'),_0x28c1('0x59')],'raw':!![]}]})[_0x28c1('0x18')](function(_0x455dc3){if(_0x455dc3){var _0x21d9a1=_['flatMap'](_0x455dc3,function(_0x32b0e8){var _0x4843d0=_0x32b0e8[_0x28c1('0x1a')]({'plain':!![]});return _0x4843d0[_0x28c1('0x5a')];});return db[_0x28c1('0x28')][_0x28c1('0x36')]({'where':{'id':_0x4f71e7[_0x28c1('0x2d')]['id']}})[_0x28c1('0x18')](function(_0x85e45d){return db[_0x28c1('0x5b')][_0x28c1('0x5c')](function(_0x14a5ad){return _0x85e45d[_0x28c1('0x55')](_0x28362f,{'transaction':_0x14a5ad})['then'](function(){return BPromise[_0x28c1('0x5d')](_0x21d9a1,function(_0x4e21cd){return db[_0x28c1('0x5e')][_0x28c1('0x5f')]({'where':{'UserId':_0x4e21cd['id'],'WhatsappQueueId':_0x4f71e7[_0x28c1('0x2d')]['id']},'transaction':_0x14a5ad});});})['then'](function(){_0x21d9a1[_0x28c1('0x60')](function(_0x36ae2d){socket['emit'](_0x28c1('0x61'),{'UserId':_0x36ae2d['id'],'WhatsappQueueId':_0x85e45d['id']});});});});});}})[_0x28c1('0x18')](respondWithStatusCode(_0x28f5a9,null))['catch'](handleError(_0x28f5a9,null));};exports[_0x28c1('0x62')]=function(_0x598afa,_0x39f4d0){return db[_0x28c1('0x54')]['findAll']({'where':{'id':_0x598afa['query'][_0x28c1('0x56')]},'attributes':['id'],'include':[{'model':db[_0x28c1('0x4b')],'as':_0x28c1('0x5a'),'attributes':['id'],'raw':!![]}]})[_0x28c1('0x18')](handleEntityNotFound(_0x39f4d0,null))['then'](function(_0x2be882){var _0x4a5623=_[_0x28c1('0x22')](_0x2be882,'id');var _0x2912d1=[];var _0x39e8c3=[];var _0x345d39=squel[_0x28c1('0x63')]();_0x345d39['field'](_0x28c1('0x64'))[_0x28c1('0x65')](_0x28c1('0x66'),'tq')[_0x28c1('0x67')](_0x28c1('0x68'),'ut',_0x28c1('0x69'))[_0x28c1('0x25')](_0x28c1('0x6a'),_0x598afa[_0x28c1('0x2d')]['id']);for(var _0x325586=0x0;_0x325586<_0x2be882[_0x28c1('0x34')];_0x325586+=0x1){let _0x4cec78=_0x2be882[_0x325586];for(var _0x4f8214=0x0;_0x4f8214<_0x4cec78['Agents'][_0x28c1('0x34')];_0x4f8214+=0x1){let _0x56ce5c=_0x4cec78[_0x28c1('0x5a')][_0x4f8214];var _0x306778=_0x345d39[_0x28c1('0x6b')]();_0x306778[_0x28c1('0x25')](_0x28c1('0x6c'),_0x56ce5c['id']);_0x39e8c3['push'](db[_0x28c1('0x5b')]['query'](_0x306778[_0x28c1('0x6d')](),{'type':db['sequelize']['QueryTypes'][_0x28c1('0x6e')]})[_0x28c1('0x18')](function(_0x23703c){if(_0x23703c[_0x28c1('0x34')]===0x1){return _0x56ce5c['id'];}else{var _0x3c5ce9=_[_0x28c1('0x6f')](_['map'](_0x23703c,'TeamId'),function(_0x27780c){return _[_0x28c1('0x70')](_0x4a5623,_0x27780c);});if(_0x3c5ce9){return _0x56ce5c['id'];}}}));}}return BPromise[_0x28c1('0x71')](_0x39e8c3)[_0x28c1('0x18')](function(_0x271e80){_0x2912d1=_(_0x2912d1)[_0x28c1('0x72')](_0x271e80)['compact']()[_0x28c1('0x73')]();return db[_0x28c1('0x28')]['find']({'where':{'id':_0x598afa[_0x28c1('0x2d')]['id']}})['then'](function(_0x26b3fd){return db[_0x28c1('0x5b')][_0x28c1('0x5c')](function(_0xfeb183){return _0x26b3fd[_0x28c1('0x62')](_0x598afa['query'][_0x28c1('0x56')],{'transaction':_0xfeb183})[_0x28c1('0x18')](function(){if(!_[_0x28c1('0x74')](_0x2912d1)){return _0x26b3fd[_0x28c1('0x75')](_0x2912d1,{'transaction':_0xfeb183});}})[_0x28c1('0x18')](function(){_0x2912d1[_0x28c1('0x60')](function(_0x538ccc){socket[_0x28c1('0x76')]('userWhatsappQueue:remove',{'UserId':_0x538ccc,'WhatsappQueueId':_0x26b3fd['id']});});});});});});})['then'](respondWithStatusCode(_0x39f4d0,null))[_0x28c1('0x2b')](handleError(_0x39f4d0,null));};exports[_0x28c1('0x77')]=function(_0x506c42,_0x4b19fb){return db[_0x28c1('0x28')][_0x28c1('0x36')]({'where':{'id':_0x506c42['params']['id']}})[_0x28c1('0x18')](handleEntityNotFound(_0x4b19fb,null))['then'](function(_0x26eaa3){if(_0x26eaa3){return _0x26eaa3[_0x28c1('0x77')](_0x506c42[_0x28c1('0x38')][_0x28c1('0x56')],_[_0x28c1('0x78')](_0x506c42[_0x28c1('0x38')],[_0x28c1('0x56'),'id'])||{})['spread'](function(_0x45eefc){for(var _0xa71e25=0x0;_0xa71e25<_0x506c42[_0x28c1('0x38')]['ids']['length'];_0xa71e25+=0x1){socket['emit'](_0x28c1('0x61'),{'UserId':Number(_0x506c42['body']['ids'][_0xa71e25]),'WhatsappQueueId':Number(_0x506c42[_0x28c1('0x2d')]['id'])});}return _0x45eefc;});}})['then'](respondWithResult(_0x4b19fb,null))[_0x28c1('0x2b')](handleError(_0x4b19fb,null));};exports[_0x28c1('0x75')]=function(_0x1b40c9,_0x1f9a9f){return db[_0x28c1('0x28')][_0x28c1('0x36')]({'where':{'id':_0x1b40c9[_0x28c1('0x2d')]['id']}})[_0x28c1('0x18')](handleEntityNotFound(_0x1f9a9f,null))['then'](function(_0x4ed4fe){if(_0x4ed4fe){return _0x4ed4fe['removeAgents'](_0x1b40c9[_0x28c1('0x27')]['ids'])[_0x28c1('0x18')](function(){if(_['isArray'](_0x1b40c9[_0x28c1('0x27')]['ids'])){for(var _0x5ba4ee=0x0;_0x5ba4ee<_0x1b40c9['query'][_0x28c1('0x56')]['length'];_0x5ba4ee+=0x1){socket[_0x28c1('0x76')](_0x28c1('0x79'),{'UserId':Number(_0x1b40c9['query'][_0x28c1('0x56')][_0x5ba4ee]),'WhatsappQueueId':Number(_0x1b40c9[_0x28c1('0x2d')]['id'])});}}else{socket[_0x28c1('0x76')](_0x28c1('0x79'),{'UserId':Number(_0x1b40c9[_0x28c1('0x27')][_0x28c1('0x56')]),'WhatsappQueueId':Number(_0x1b40c9[_0x28c1('0x2d')]['id'])});}});}})[_0x28c1('0x18')](respondWithStatusCode(_0x1f9a9f,null))[_0x28c1('0x2b')](handleError(_0x1f9a9f,null));};exports['getAgents']=function(_0x57b097,_0x56a2be){var _0x10723e={};var _0x4b3193={};var _0x12a48a;var _0x7244ed;return db['WhatsappQueue'][_0x28c1('0x41')]({'where':{'id':_0x57b097[_0x28c1('0x2d')]['id']}})[_0x28c1('0x18')](handleEntityNotFound(_0x56a2be,null))['then'](function(_0x43420b){if(_0x43420b){_0x12a48a=_0x43420b;_0x4b3193['model']=_[_0x28c1('0x2f')](db[_0x28c1('0x4b')]['rawAttributes']);_0x4b3193['query']=_[_0x28c1('0x2f')](_0x57b097[_0x28c1('0x27')]);_0x4b3193['filters']=_['intersection'](_0x4b3193[_0x28c1('0x2e')],_0x4b3193[_0x28c1('0x27')]);_0x10723e[_0x28c1('0x32')]=_[_0x28c1('0x31')](_0x4b3193[_0x28c1('0x2e')],qs['fields'](_0x57b097[_0x28c1('0x27')][_0x28c1('0x33')]));_0x10723e[_0x28c1('0x32')]=_0x10723e[_0x28c1('0x32')][_0x28c1('0x34')]?_0x10723e[_0x28c1('0x32')]:_0x4b3193[_0x28c1('0x2e')];_0x10723e[_0x28c1('0x45')]=qs[_0x28c1('0x46')](_0x57b097[_0x28c1('0x27')][_0x28c1('0x46')]);_0x10723e['where']=qs[_0x28c1('0x42')](_[_0x28c1('0x47')](_0x57b097[_0x28c1('0x27')],_0x4b3193[_0x28c1('0x42')]));if(_0x57b097[_0x28c1('0x27')][_0x28c1('0x49')]){_0x10723e['where']=_[_0x28c1('0x4a')](_0x10723e['where'],{'$or':_['map'](_0x10723e['attributes'],function(_0x164283){var _0x743285={};_0x743285[_0x164283]={'$like':'%'+_0x57b097['query'][_0x28c1('0x49')]+'%'};return _0x743285;})});}_0x10723e=_[_0x28c1('0x4a')]({},_0x10723e,_0x57b097[_0x28c1('0x35')]);return _0x12a48a['getAgents'](_0x10723e);}})['then'](function(_0xbf7db2){if(_0xbf7db2){_0x7244ed=_0xbf7db2[_0x28c1('0x34')];if(!_0x57b097[_0x28c1('0x27')][_0x28c1('0x43')]('nolimit')){_0x10723e[_0x28c1('0x12')]=qs[_0x28c1('0x12')](_0x57b097[_0x28c1('0x27')][_0x28c1('0x12')]);_0x10723e['offset']=qs['offset'](_0x57b097[_0x28c1('0x27')][_0x28c1('0x15')]);}return _0x12a48a[_0x28c1('0x7a')](_0x10723e);}})[_0x28c1('0x18')](function(_0xa17c43){if(_0xa17c43){return _0xa17c43?{'count':_0x7244ed,'rows':_0xa17c43}:null;}})[_0x28c1('0x18')](respondWithResult(_0x56a2be,null))['catch'](handleError(_0x56a2be,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 738737e..0815eb8 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 _0x8f09=['save','update','remove','emit','hook','events','../../mysqldb','WhatsappQueue','setMaxListeners'];(function(_0x32bdd4,_0x143a69){var _0x4b54d3=function(_0x5c38d6){while(--_0x5c38d6){_0x32bdd4['push'](_0x32bdd4['shift']());}};_0x4b54d3(++_0x143a69);}(_0x8f09,0x191));var _0x98f0=function(_0x57f121,_0x16f9f2){_0x57f121=_0x57f121-0x0;var _0x1bc0b6=_0x8f09[_0x57f121];return _0x1bc0b6;};'use strict';var EventEmitter=require(_0x98f0('0x0'));var WhatsappQueue=require(_0x98f0('0x1'))['db'][_0x98f0('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x98f0('0x3')](0x0);var events={'afterCreate':_0x98f0('0x4'),'afterUpdate':_0x98f0('0x5'),'afterDestroy':_0x98f0('0x6')};function emitEvent(_0x517ed3){return function(_0x17bf95,_0x536dd7,_0x40af97){WhatsappQueueEvents[_0x98f0('0x7')](_0x517ed3+':'+_0x17bf95['id'],_0x17bf95);WhatsappQueueEvents['emit'](_0x517ed3,_0x17bf95);_0x40af97(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x98f0('0x8')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file +var _0xb553=['hook','exports','../../mysqldb','save','update','remove','emit','hasOwnProperty'];(function(_0x3da5b4,_0x69ce3e){var _0x423341=function(_0x34c473){while(--_0x34c473){_0x3da5b4['push'](_0x3da5b4['shift']());}};_0x423341(++_0x69ce3e);}(_0xb553,0x132));var _0x3b55=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0xb553[_0x243b59];return _0x3e1676;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x3b55('0x0'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3b55('0x1'),'afterUpdate':_0x3b55('0x2'),'afterDestroy':_0x3b55('0x3')};function emitEvent(_0x272c9d){return function(_0x3625bf,_0x41a3b8,_0xd6e269){WhatsappQueueEvents[_0x3b55('0x4')](_0x272c9d+':'+_0x3625bf['id'],_0x3625bf);WhatsappQueueEvents[_0x3b55('0x4')](_0x272c9d,_0x3625bf);_0xd6e269(null);};}for(var e in events){if(events[_0x3b55('0x5')](e)){var event=events[e];WhatsappQueue[_0x3b55('0x6')](e,emitEvent(event));}}module[_0x3b55('0x7')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index f2d62bf..bbe0bed 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 _0x9e3e=['exports','define','WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./whatsappQueue.attributes'];(function(_0x2a5099,_0x329e92){var _0x2802f1=function(_0x53f99b){while(--_0x53f99b){_0x2a5099['push'](_0x2a5099['shift']());}};_0x2802f1(++_0x329e92);}(_0x9e3e,0xa0));var _0xe9e3=function(_0x21065c,_0x23839c){_0x21065c=_0x21065c-0x0;var _0x3500c0=_0x9e3e[_0x21065c];return _0x3500c0;};'use strict';var _=require(_0xe9e3('0x0'));var util=require(_0xe9e3('0x1'));var logger=require(_0xe9e3('0x2'))(_0xe9e3('0x3'));var moment=require('moment');var BPromise=require(_0xe9e3('0x4'));var rp=require(_0xe9e3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe9e3('0x6'));var config=require(_0xe9e3('0x7'));var attributes=require(_0xe9e3('0x8'));module[_0xe9e3('0x9')]=function(_0x5990c5,_0x35953f){return _0x5990c5[_0xe9e3('0xa')](_0xe9e3('0xb'),attributes,{'tableName':_0xe9e3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5b48=['path','rimraf','../../config/environment','WhatsappQueue','whatsapp_queues','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1a4ced,_0x166f65){var _0x4f93d0=function(_0x4d43bb){while(--_0x4d43bb){_0x1a4ced['push'](_0x1a4ced['shift']());}};_0x4f93d0(++_0x166f65);}(_0x5b48,0xaa));var _0x85b4=function(_0x163b92,_0x31d23a){_0x163b92=_0x163b92-0x0;var _0x5e4b1a=_0x5b48[_0x163b92];return _0x5e4b1a;};'use strict';var _=require('lodash');var util=require(_0x85b4('0x0'));var logger=require(_0x85b4('0x1'))(_0x85b4('0x2'));var moment=require(_0x85b4('0x3'));var BPromise=require(_0x85b4('0x4'));var rp=require(_0x85b4('0x5'));var fs=require('fs');var path=require(_0x85b4('0x6'));var rimraf=require(_0x85b4('0x7'));var config=require(_0x85b4('0x8'));var attributes=require('./whatsappQueue.attributes');module['exports']=function(_0x4cc5e8,_0x53a9cd){return _0x4cc5e8['define'](_0x85b4('0x9'),attributes,{'tableName':_0x85b4('0xa'),'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 84e0729..8c70eb4 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 _0xf766=['request\x20sent','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','where','attributes','limit','include','map','model','then','ShowWhatsappQueue','find','raw','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','redis','socket.io-emitter','./whatsappQueue.socket','register','info','WhatsappQueue,\x20%s,\x20%s','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2a6aea,_0x49052a){var _0x37e283=function(_0x3cd6f9){while(--_0x3cd6f9){_0x2a6aea['push'](_0x2a6aea['shift']());}};_0x37e283(++_0x49052a);}(_0xf766,0xf5));var _0x6f76=function(_0x23be51,_0xc02a1b){_0x23be51=_0x23be51-0x0;var _0x47a26d=_0xf766[_0x23be51];return _0x47a26d;};'use strict';var _=require(_0x6f76('0x0'));var util=require(_0x6f76('0x1'));var moment=require(_0x6f76('0x2'));var BPromise=require(_0x6f76('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6f76('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6f76('0x5'));var logger=require(_0x6f76('0x6'))(_0x6f76('0x7'));var config=require('../../config/environment');var jayson=require(_0x6f76('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x6f76('0x9')]=_['defaults'](config[_0x6f76('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x6f76('0xa'))(new Redis(config[_0x6f76('0x9')]));require(_0x6f76('0xb'))[_0x6f76('0xc')](socket);function respondWithRpcPromise(_0x34218b,_0x469821,_0x54d7dd){return new BPromise(function(_0x2ed8d6,_0x11c6f2){return client['request'](_0x34218b,_0x54d7dd)['then'](function(_0x1354ec){logger[_0x6f76('0xd')](_0x6f76('0xe'),_0x469821,'request\x20sent');logger[_0x6f76('0xf')](_0x6f76('0x10'),_0x469821,'request\x20sent',JSON[_0x6f76('0x11')](_0x1354ec));if(_0x1354ec[_0x6f76('0x12')]){if(_0x1354ec[_0x6f76('0x12')][_0x6f76('0x13')]===0x1f4){logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x469821,_0x1354ec[_0x6f76('0x12')]['message']);return _0x11c6f2(_0x1354ec[_0x6f76('0x12')]['message']);}logger['error'](_0x6f76('0xe'),_0x469821,_0x1354ec[_0x6f76('0x12')][_0x6f76('0x14')]);return _0x2ed8d6(_0x1354ec[_0x6f76('0x12')][_0x6f76('0x14')]);}else{logger['info'](_0x6f76('0xe'),_0x469821,_0x6f76('0x15'));_0x2ed8d6(_0x1354ec[_0x6f76('0x16')][_0x6f76('0x14')]);}})[_0x6f76('0x17')](function(_0x47fbb9){logger[_0x6f76('0x12')](_0x6f76('0xe'),_0x469821,_0x47fbb9);_0x11c6f2(_0x47fbb9);});});}exports[_0x6f76('0x18')]=function(_0x24b047){var _0xec372e=this;return new Promise(function(_0xf1182b,_0x34e0e4){return db[_0x6f76('0x19')][_0x6f76('0x1a')]({'raw':_0x24b047[_0x6f76('0x1b')]?_0x24b047['options']['raw']===undefined?!![]:![]:!![],'where':_0x24b047[_0x6f76('0x1b')]?_0x24b047[_0x6f76('0x1b')][_0x6f76('0x1c')]||null:null,'attributes':_0x24b047['options']?_0x24b047[_0x6f76('0x1b')][_0x6f76('0x1d')]||null:null,'limit':_0x24b047['options']?_0x24b047['options'][_0x6f76('0x1e')]||null:null,'include':_0x24b047[_0x6f76('0x1b')]?_0x24b047[_0x6f76('0x1b')][_0x6f76('0x1f')]?_[_0x6f76('0x20')](_0x24b047[_0x6f76('0x1b')][_0x6f76('0x1f')],function(_0x554eb4){return{'model':db[_0x554eb4[_0x6f76('0x21')]],'as':_0x554eb4['as'],'attributes':_0x554eb4[_0x6f76('0x1d')],'include':_0x554eb4[_0x6f76('0x1f')]?_[_0x6f76('0x20')](_0x554eb4['include'],function(_0x4f5115){return{'model':db[_0x4f5115[_0x6f76('0x21')]],'as':_0x4f5115['as'],'attributes':_0x4f5115[_0x6f76('0x1d')],'include':_0x4f5115[_0x6f76('0x1f')]?_[_0x6f76('0x20')](_0x4f5115['include'],function(_0x204792){return{'model':db[_0x204792[_0x6f76('0x21')]],'as':_0x204792['as'],'attributes':_0x204792[_0x6f76('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6f76('0x22')](function(_0x13e7f5){logger['info'](_0x6f76('0x18'),_0x24b047);logger[_0x6f76('0xf')](_0x6f76('0x18'),_0x24b047,JSON[_0x6f76('0x11')](_0x13e7f5));_0xf1182b(_0x13e7f5);})['catch'](function(_0x340ba3){logger[_0x6f76('0x12')](_0x6f76('0x18'),_0x340ba3[_0x6f76('0x14')],_0x24b047);_0x34e0e4(_0xec372e['error'](0x1f4,_0x340ba3['message']));});});};exports[_0x6f76('0x23')]=function(_0x38a1eb){var _0x238d4d=this;return new Promise(function(_0x5389fd,_0x128d0f){return db[_0x6f76('0x19')][_0x6f76('0x24')]({'raw':_0x38a1eb[_0x6f76('0x1b')]?_0x38a1eb[_0x6f76('0x1b')][_0x6f76('0x25')]===undefined?!![]:![]:!![],'where':_0x38a1eb[_0x6f76('0x1b')]?_0x38a1eb[_0x6f76('0x1b')][_0x6f76('0x1c')]||null:null,'attributes':_0x38a1eb[_0x6f76('0x1b')]?_0x38a1eb[_0x6f76('0x1b')][_0x6f76('0x1d')]||null:null,'include':_0x38a1eb['options']?_0x38a1eb[_0x6f76('0x1b')][_0x6f76('0x1f')]?_['map'](_0x38a1eb[_0x6f76('0x1b')]['include'],function(_0x2aa4e7){return{'model':db[_0x2aa4e7[_0x6f76('0x21')]],'as':_0x2aa4e7['as'],'attributes':_0x2aa4e7[_0x6f76('0x1d')],'include':_0x2aa4e7[_0x6f76('0x1f')]?_[_0x6f76('0x20')](_0x2aa4e7[_0x6f76('0x1f')],function(_0x20c625){return{'model':db[_0x20c625[_0x6f76('0x21')]],'as':_0x20c625['as'],'attributes':_0x20c625[_0x6f76('0x1d')],'include':_0x20c625[_0x6f76('0x1f')]?_[_0x6f76('0x20')](_0x20c625[_0x6f76('0x1f')],function(_0x186c61){return{'model':db[_0x186c61['model']],'as':_0x186c61['as'],'attributes':_0x186c61[_0x6f76('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6f76('0x22')](function(_0xb80459){logger[_0x6f76('0xd')](_0x6f76('0x23'),_0x38a1eb);logger['debug'](_0x6f76('0x23'),_0x38a1eb,JSON[_0x6f76('0x11')](_0xb80459));_0x5389fd(_0xb80459);})['catch'](function(_0x589a20){logger[_0x6f76('0x12')](_0x6f76('0x23'),_0x589a20[_0x6f76('0x14')],_0x38a1eb);_0x128d0f(_0x238d4d[_0x6f76('0x12')](0x1f4,_0x589a20[_0x6f76('0x14')]));});});}; \ No newline at end of file +var _0xc6cc=['request\x20sent','error','code','message','info','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','attributes','include','model','map','stringify','find','where','ShowWhatsappQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','http','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','WhatsappQueue,\x20%s,\x20%s','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s'];(function(_0x2b60b4,_0x2e79d0){var _0x3ff60f=function(_0x455d01){while(--_0x455d01){_0x2b60b4['push'](_0x2b60b4['shift']());}};_0x3ff60f(++_0x2e79d0);}(_0xc6cc,0x18f));var _0xcc6c=function(_0x2d291e,_0x227e5d){_0x2d291e=_0x2d291e-0x0;var _0x4c1b0d=_0xc6cc[_0x2d291e];return _0x4c1b0d;};'use strict';var _=require(_0xcc6c('0x0'));var util=require(_0xcc6c('0x1'));var moment=require(_0xcc6c('0x2'));var BPromise=require(_0xcc6c('0x3'));var rs=require(_0xcc6c('0x4'));var fs=require('fs');var Redis=require(_0xcc6c('0x5'));var db=require(_0xcc6c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xcc6c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xcc6c('0x8')]({'port':0x232a});config[_0xcc6c('0x9')]=_['defaults'](config[_0xcc6c('0x9')],{'host':_0xcc6c('0xa'),'port':0x18eb});var socket=require(_0xcc6c('0xb'))(new Redis(config[_0xcc6c('0x9')]));require(_0xcc6c('0xc'))[_0xcc6c('0xd')](socket);function respondWithRpcPromise(_0x59bb66,_0x31259b,_0xebc08b){return new BPromise(function(_0x19bc7f,_0x2036b6){return client[_0xcc6c('0xe')](_0x59bb66,_0xebc08b)[_0xcc6c('0xf')](function(_0x4a20ad){logger['info'](_0xcc6c('0x10'),_0x31259b,'request\x20sent');logger[_0xcc6c('0x11')](_0xcc6c('0x12'),_0x31259b,_0xcc6c('0x13'),JSON['stringify'](_0x4a20ad));if(_0x4a20ad['error']){if(_0x4a20ad[_0xcc6c('0x14')][_0xcc6c('0x15')]===0x1f4){logger['error'](_0xcc6c('0x10'),_0x31259b,_0x4a20ad[_0xcc6c('0x14')]['message']);return _0x2036b6(_0x4a20ad[_0xcc6c('0x14')]['message']);}logger[_0xcc6c('0x14')](_0xcc6c('0x10'),_0x31259b,_0x4a20ad[_0xcc6c('0x14')][_0xcc6c('0x16')]);return _0x19bc7f(_0x4a20ad[_0xcc6c('0x14')][_0xcc6c('0x16')]);}else{logger[_0xcc6c('0x17')](_0xcc6c('0x10'),_0x31259b,_0xcc6c('0x13'));_0x19bc7f(_0x4a20ad['result'][_0xcc6c('0x16')]);}})[_0xcc6c('0x18')](function(_0x57be69){logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x31259b,_0x57be69);_0x2036b6(_0x57be69);});});}exports[_0xcc6c('0x19')]=function(_0x33c7b5){var _0x1f73b8=this;return new Promise(function(_0x17ccc3,_0x37e53c){return db[_0xcc6c('0x1a')][_0xcc6c('0x1b')]({'raw':_0x33c7b5[_0xcc6c('0x1c')]?_0x33c7b5[_0xcc6c('0x1c')][_0xcc6c('0x1d')]===undefined?!![]:![]:!![],'where':_0x33c7b5['options']?_0x33c7b5[_0xcc6c('0x1c')]['where']||null:null,'attributes':_0x33c7b5['options']?_0x33c7b5['options'][_0xcc6c('0x1e')]||null:null,'limit':_0x33c7b5['options']?_0x33c7b5[_0xcc6c('0x1c')]['limit']||null:null,'include':_0x33c7b5[_0xcc6c('0x1c')]?_0x33c7b5[_0xcc6c('0x1c')][_0xcc6c('0x1f')]?_['map'](_0x33c7b5['options'][_0xcc6c('0x1f')],function(_0x20f159){return{'model':db[_0x20f159[_0xcc6c('0x20')]],'as':_0x20f159['as'],'attributes':_0x20f159[_0xcc6c('0x1e')],'include':_0x20f159['include']?_[_0xcc6c('0x21')](_0x20f159[_0xcc6c('0x1f')],function(_0x295165){return{'model':db[_0x295165[_0xcc6c('0x20')]],'as':_0x295165['as'],'attributes':_0x295165[_0xcc6c('0x1e')],'include':_0x295165['include']?_[_0xcc6c('0x21')](_0x295165['include'],function(_0xaa2a1f){return{'model':db[_0xaa2a1f[_0xcc6c('0x20')]],'as':_0xaa2a1f['as'],'attributes':_0xaa2a1f[_0xcc6c('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x337008){logger[_0xcc6c('0x17')](_0xcc6c('0x19'),_0x33c7b5);logger['debug']('GetWhatsappQueue',_0x33c7b5,JSON[_0xcc6c('0x22')](_0x337008));_0x17ccc3(_0x337008);})['catch'](function(_0x455ccc){logger[_0xcc6c('0x14')](_0xcc6c('0x19'),_0x455ccc['message'],_0x33c7b5);_0x37e53c(_0x1f73b8[_0xcc6c('0x14')](0x1f4,_0x455ccc['message']));});});};exports['ShowWhatsappQueue']=function(_0x5dd7a6){var _0x3beeda=this;return new Promise(function(_0xf32437,_0x1e50ed){return db['WhatsappQueue'][_0xcc6c('0x23')]({'raw':_0x5dd7a6[_0xcc6c('0x1c')]?_0x5dd7a6[_0xcc6c('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x5dd7a6[_0xcc6c('0x1c')]?_0x5dd7a6[_0xcc6c('0x1c')][_0xcc6c('0x24')]||null:null,'attributes':_0x5dd7a6['options']?_0x5dd7a6[_0xcc6c('0x1c')][_0xcc6c('0x1e')]||null:null,'include':_0x5dd7a6[_0xcc6c('0x1c')]?_0x5dd7a6[_0xcc6c('0x1c')]['include']?_[_0xcc6c('0x21')](_0x5dd7a6[_0xcc6c('0x1c')][_0xcc6c('0x1f')],function(_0x5a24dc){return{'model':db[_0x5a24dc[_0xcc6c('0x20')]],'as':_0x5a24dc['as'],'attributes':_0x5a24dc[_0xcc6c('0x1e')],'include':_0x5a24dc['include']?_[_0xcc6c('0x21')](_0x5a24dc[_0xcc6c('0x1f')],function(_0xe8f502){return{'model':db[_0xe8f502['model']],'as':_0xe8f502['as'],'attributes':_0xe8f502[_0xcc6c('0x1e')],'include':_0xe8f502[_0xcc6c('0x1f')]?_[_0xcc6c('0x21')](_0xe8f502['include'],function(_0x302472){return{'model':db[_0x302472[_0xcc6c('0x20')]],'as':_0x302472['as'],'attributes':_0x302472[_0xcc6c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xcc6c('0xf')](function(_0x9f0ff7){logger[_0xcc6c('0x17')](_0xcc6c('0x25'),_0x5dd7a6);logger[_0xcc6c('0x11')](_0xcc6c('0x25'),_0x5dd7a6,JSON['stringify'](_0x9f0ff7));_0xf32437(_0x9f0ff7);})[_0xcc6c('0x18')](function(_0x101db3){logger[_0xcc6c('0x14')]('ShowWhatsappQueue',_0x101db3[_0xcc6c('0x16')],_0x5dd7a6);_0x1e50ed(_0x3beeda['error'](0x1f4,_0x101db3[_0xcc6c('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index f90dac1..141418e 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 _0x60de=['remove','update','emit','length','whatsappQueue:','save'];(function(_0x333174,_0x3408c2){var _0x461682=function(_0x2ffefe){while(--_0x2ffefe){_0x333174['push'](_0x333174['shift']());}};_0x461682(++_0x3408c2);}(_0x60de,0x71));var _0xe60d=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x60de[_0x57b54c];return _0x59cc19;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0xe60d('0x0'),_0xe60d('0x1'),_0xe60d('0x2')];function createListener(_0x57ee3d,_0x405e8a){return function(_0x1688ee){_0x405e8a[_0xe60d('0x3')](_0x57ee3d,_0x1688ee);};}function removeListener(_0x2e71eb,_0x5dfc35){return function(){WhatsappQueueEvents['removeListener'](_0x2e71eb,_0x5dfc35);};}exports['register']=function(_0x363809){for(var _0x49bfe3=0x0,_0x4ba1c5=events[_0xe60d('0x4')];_0x49bfe3<_0x4ba1c5;_0x49bfe3++){var _0x59d33c=events[_0x49bfe3];var _0x579674=createListener(_0xe60d('0x5')+_0x59d33c,_0x363809);WhatsappQueueEvents['on'](_0x59d33c,_0x579674);}}; \ No newline at end of file +var _0xf3f9=['emit','removeListener','register','length','whatsappQueue:','./whatsappQueue.events','remove'];(function(_0x4eb3f,_0x4d72fc){var _0x24966a=function(_0x486562){while(--_0x486562){_0x4eb3f['push'](_0x4eb3f['shift']());}};_0x24966a(++_0x4d72fc);}(_0xf3f9,0x1e1));var _0x9f3f=function(_0x537c1b,_0x151ae4){_0x537c1b=_0x537c1b-0x0;var _0x5129a6=_0xf3f9[_0x537c1b];return _0x5129a6;};'use strict';var WhatsappQueueEvents=require(_0x9f3f('0x0'));var events=['save',_0x9f3f('0x1'),'update'];function createListener(_0x385784,_0x36a587){return function(_0x2776bf){_0x36a587[_0x9f3f('0x2')](_0x385784,_0x2776bf);};}function removeListener(_0xd5c3c5,_0x3dfb0b){return function(){WhatsappQueueEvents[_0x9f3f('0x3')](_0xd5c3c5,_0x3dfb0b);};}exports[_0x9f3f('0x4')]=function(_0x16736c){for(var _0x12f193=0x0,_0x3a9b79=events[_0x9f3f('0x5')];_0x12f193<_0x3a9b79;_0x12f193++){var _0x7b1d7a=events[_0x12f193];var _0x5c47f5=createListener(_0x9f3f('0x6')+_0x7b1d7a,_0x16736c);WhatsappQueueEvents['on'](_0x7b1d7a,_0x5c47f5);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index e0a31fc..bddb240 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 _0xca8d=['Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','post','put','/:id','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x1a5322,_0x8e492d){var _0x47475b=function(_0x24779c){while(--_0x24779c){_0x1a5322['push'](_0x1a5322['shift']());}};_0x47475b(++_0x8e492d);}(_0xca8d,0x10d));var _0xdca8=function(_0xc492a3,_0x2b42ee){_0xc492a3=_0xc492a3-0x0;var _0x414593=_0xca8d[_0xc492a3];return _0x414593;};'use strict';var multer=require(_0xdca8('0x0'));var util=require('util');var path=require(_0xdca8('0x1'));var timeout=require(_0xdca8('0x2'));var express=require(_0xdca8('0x3'));var router=express[_0xdca8('0x4')]();var fs_extra=require(_0xdca8('0x5'));var auth=require(_0xdca8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xdca8('0x7'));var controller=require(_0xdca8('0x8'));router[_0xdca8('0x9')]('/',auth[_0xdca8('0xa')](),controller[_0xdca8('0xb')]);router['get'](_0xdca8('0xc'),auth['isAuthenticated'](),controller[_0xdca8('0xd')]);router['get']('/:id',auth[_0xdca8('0xa')](),controller[_0xdca8('0xe')]);router[_0xdca8('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xdca8('0x10')](_0xdca8('0x11'),auth['isAuthenticated'](),controller[_0xdca8('0x12')]);router['delete'](_0xdca8('0x11'),auth[_0xdca8('0xa')](),controller[_0xdca8('0x13')]);module[_0xdca8('0x14')]=router; \ No newline at end of file +var _0xa603=['./whatsappQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x541ea6,_0x51cab6){var _0x3c3e84=function(_0xc06bed){while(--_0xc06bed){_0x541ea6['push'](_0x541ea6['shift']());}};_0x3c3e84(++_0x51cab6);}(_0xa603,0x112));var _0x3a60=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xa603[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0x3a60('0x0'));var util=require(_0x3a60('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3a60('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3a60('0x3'));var interaction=require(_0x3a60('0x4'));var config=require(_0x3a60('0x5'));var controller=require(_0x3a60('0x6'));router['get']('/',auth[_0x3a60('0x7')](),controller[_0x3a60('0x8')]);router[_0x3a60('0x9')](_0x3a60('0xa'),auth[_0x3a60('0x7')](),controller[_0x3a60('0xb')]);router[_0x3a60('0x9')](_0x3a60('0xc'),auth[_0x3a60('0x7')](),controller[_0x3a60('0xd')]);router['post']('/',auth[_0x3a60('0x7')](),controller[_0x3a60('0xe')]);router[_0x3a60('0xf')](_0x3a60('0xc'),auth[_0x3a60('0x7')](),controller[_0x3a60('0x10')]);router[_0x3a60('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x3a60('0x12')]);module[_0x3a60('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 50b61a9..a256f57 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(_0x5acd2b,_0x926213){var _0x17d8f7=function(_0x33d1f1){while(--_0x33d1f1){_0x5acd2b['push'](_0x5acd2b['shift']());}};_0x17d8f7(++_0x926213);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x5e1e45,_0x1dfc0d){var _0x1d5e77=function(_0x11d1f9){while(--_0x11d1f9){_0x5e1e45['push'](_0x5e1e45['shift']());}};_0x1d5e77(++_0x1dfc0d);}(_0x7a54,0x106));var _0x47a5=function(_0x5e16af,_0x4c1ead){_0x5e16af=_0x5e16af-0x0;var _0x2f029e=_0x7a54[_0x5e16af];return _0x2f029e;};'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 7786ad1..6fb4b7c 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 _0x96cc=['status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','name','send','index','map','WhatsappQueueReport','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x51477d,_0x489c34){var _0x16be13=function(_0x2c99bd){while(--_0x2c99bd){_0x51477d['push'](_0x51477d['shift']());}};_0x16be13(++_0x489c34);}(_0x96cc,0x16c));var _0xc96c=function(_0x1ad53c,_0x13ebf8){_0x1ad53c=_0x1ad53c-0x0;var _0x33afe4=_0x96cc[_0x1ad53c];return _0x33afe4;};'use strict';var emlformat=require(_0xc96c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc96c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc96c('0x2'));var moment=require(_0xc96c('0x3'));var BPromise=require(_0xc96c('0x4'));var Mustache=require(_0xc96c('0x5'));var util=require(_0xc96c('0x6'));var path=require(_0xc96c('0x7'));var sox=require(_0xc96c('0x8'));var csv=require(_0xc96c('0x9'));var ejs=require(_0xc96c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc96c('0xb'));var squel=require(_0xc96c('0xc'));var crypto=require(_0xc96c('0xd'));var jsforce=require(_0xc96c('0xe'));var deskjs=require(_0xc96c('0xf'));var toCsv=require(_0xc96c('0x9'));var querystring=require(_0xc96c('0x10'));var Papa=require('papaparse');var Redis=require(_0xc96c('0x11'));var authService=require(_0xc96c('0x12'));var qs=require(_0xc96c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc96c('0x14'));var logger=require('../../config/logger')(_0xc96c('0x15'));var utils=require('../../config/utils');var config=require(_0xc96c('0x16'));var licenseUtil=require(_0xc96c('0x17'));var db=require(_0xc96c('0x18'))['db'];function respondWithStatusCode(_0x246a95,_0x5f27f3){_0x5f27f3=_0x5f27f3||0xcc;return function(_0x3fe3d5){if(_0x3fe3d5){return _0x246a95[_0xc96c('0x19')](_0x5f27f3);}return _0x246a95[_0xc96c('0x1a')](_0x5f27f3)[_0xc96c('0x1b')]();};}function respondWithResult(_0x48de8d,_0x35da94){_0x35da94=_0x35da94||0xc8;return function(_0xbed0c9){if(_0xbed0c9){return _0x48de8d[_0xc96c('0x1a')](_0x35da94)[_0xc96c('0x1c')](_0xbed0c9);}};}function respondWithFilteredResult(_0x377dbc,_0x46455a){return function(_0x1765d9){if(_0x1765d9){var _0x23e357=typeof _0x46455a[_0xc96c('0x1d')]===_0xc96c('0x1e')&&typeof _0x46455a[_0xc96c('0x1f')]==='undefined';var _0x509376=_0x1765d9[_0xc96c('0x20')];var _0x99c402=_0x23e357?0x0:_0x46455a[_0xc96c('0x1d')];var _0x2ae19a=_0x23e357?_0x1765d9['count']:_0x46455a[_0xc96c('0x1d')]+_0x46455a[_0xc96c('0x1f')];var _0x2a361c;if(_0x2ae19a>=_0x509376){_0x2ae19a=_0x509376;_0x2a361c=0xc8;}else{_0x2a361c=0xce;}_0x377dbc[_0xc96c('0x1a')](_0x2a361c);return _0x377dbc[_0xc96c('0x21')](_0xc96c('0x22'),_0x99c402+'-'+_0x2ae19a+'/'+_0x509376)[_0xc96c('0x1c')](_0x1765d9);}return null;};}function patchUpdates(_0x41daba){return function(_0x28d762){try{jsonpatch[_0xc96c('0x23')](_0x28d762,_0x41daba,!![]);}catch(_0x2bb397){return BPromise[_0xc96c('0x24')](_0x2bb397);}return _0x28d762[_0xc96c('0x25')]();};}function saveUpdates(_0x45edee,_0x325c54){return function(_0x3b5c6c){if(_0x3b5c6c){return _0x3b5c6c[_0xc96c('0x26')](_0x45edee)['then'](function(_0xd63951){return _0xd63951;});}return null;};}function removeEntity(_0x4be783,_0x4456bf){return function(_0x10ae21){if(_0x10ae21){return _0x10ae21[_0xc96c('0x27')]()[_0xc96c('0x28')](function(){_0x4be783[_0xc96c('0x1a')](0xcc)[_0xc96c('0x1b')]();});}};}function handleEntityNotFound(_0x1a77df,_0x14f171){return function(_0x50fc07){if(!_0x50fc07){_0x1a77df[_0xc96c('0x19')](0x194);}return _0x50fc07;};}function handleError(_0x117f17,_0x3f87cc){_0x3f87cc=_0x3f87cc||0x1f4;return function(_0x294fee){logger['error'](_0x294fee['stack']);if(_0x294fee[_0xc96c('0x29')]){delete _0x294fee[_0xc96c('0x29')];}_0x117f17[_0xc96c('0x1a')](_0x3f87cc)[_0xc96c('0x2a')](_0x294fee);};}exports[_0xc96c('0x2b')]=function(_0x5e1727,_0x427cb2){var _0x1c911b={},_0xa0efbc={},_0x27925f={'count':0x0,'rows':[]};var _0x325cda=_[_0xc96c('0x2c')](db[_0xc96c('0x2d')][_0xc96c('0x2e')],function(_0x556108){return{'name':_0x556108[_0xc96c('0x2f')],'type':_0x556108['type'][_0xc96c('0x30')]};});_0xa0efbc[_0xc96c('0x31')]=_[_0xc96c('0x2c')](_0x325cda,'name');_0xa0efbc[_0xc96c('0x32')]=_[_0xc96c('0x33')](_0x5e1727[_0xc96c('0x32')]);_0xa0efbc[_0xc96c('0x34')]=_['intersection'](_0xa0efbc['model'],_0xa0efbc[_0xc96c('0x32')]);_0x1c911b[_0xc96c('0x35')]=_[_0xc96c('0x36')](_0xa0efbc['model'],qs[_0xc96c('0x37')](_0x5e1727[_0xc96c('0x32')][_0xc96c('0x37')]));_0x1c911b[_0xc96c('0x35')]=_0x1c911b['attributes'][_0xc96c('0x38')]?_0x1c911b[_0xc96c('0x35')]:_0xa0efbc['model'];if(!_0x5e1727[_0xc96c('0x32')][_0xc96c('0x39')](_0xc96c('0x3a'))){_0x1c911b[_0xc96c('0x1f')]=qs[_0xc96c('0x1f')](_0x5e1727[_0xc96c('0x32')]['limit']);_0x1c911b[_0xc96c('0x1d')]=qs[_0xc96c('0x1d')](_0x5e1727[_0xc96c('0x32')][_0xc96c('0x1d')]);}_0x1c911b[_0xc96c('0x3b')]=qs[_0xc96c('0x3c')](_0x5e1727['query']['sort']);_0x1c911b[_0xc96c('0x3d')]=qs[_0xc96c('0x34')](_['pick'](_0x5e1727['query'],_0xa0efbc[_0xc96c('0x34')]),_0x325cda);if(_0x5e1727[_0xc96c('0x32')][_0xc96c('0x3e')]){_0x1c911b[_0xc96c('0x3d')]=_[_0xc96c('0x3f')](_0x1c911b[_0xc96c('0x3d')],{'$or':_[_0xc96c('0x2c')](_0x325cda,function(_0x257750){if(_0x257750[_0xc96c('0x40')]!==_0xc96c('0x41')){var _0x1b68e6={};_0x1b68e6[_0x257750['name']]={'$like':'%'+_0x5e1727[_0xc96c('0x32')][_0xc96c('0x3e')]+'%'};return _0x1b68e6;}})});}_0x1c911b=_[_0xc96c('0x3f')]({},_0x1c911b,_0x5e1727[_0xc96c('0x42')]);var _0x4eb180={'where':_0x1c911b[_0xc96c('0x3d')]};return db[_0xc96c('0x2d')][_0xc96c('0x20')](_0x4eb180)['then'](function(_0x510252){_0x27925f[_0xc96c('0x20')]=_0x510252;if(_0x5e1727[_0xc96c('0x32')][_0xc96c('0x43')]){_0x1c911b['include']=[{'all':!![]}];}return db[_0xc96c('0x2d')][_0xc96c('0x44')](_0x1c911b);})[_0xc96c('0x28')](function(_0x2a8ea7){_0x27925f[_0xc96c('0x45')]=_0x2a8ea7;return _0x27925f;})[_0xc96c('0x28')](respondWithFilteredResult(_0x427cb2,_0x1c911b))[_0xc96c('0x46')](handleError(_0x427cb2,null));};exports[_0xc96c('0x47')]=function(_0x25df41,_0x4d5a1b){var _0x4c3088={'raw':!![],'where':{'id':_0x25df41[_0xc96c('0x48')]['id']}},_0x30b3ac={};_0x30b3ac[_0xc96c('0x31')]=_[_0xc96c('0x33')](db['WhatsappQueueReport']['rawAttributes']);_0x30b3ac[_0xc96c('0x32')]=_[_0xc96c('0x33')](_0x25df41[_0xc96c('0x32')]);_0x30b3ac[_0xc96c('0x34')]=_[_0xc96c('0x36')](_0x30b3ac[_0xc96c('0x31')],_0x30b3ac[_0xc96c('0x32')]);_0x4c3088['attributes']=_[_0xc96c('0x36')](_0x30b3ac[_0xc96c('0x31')],qs[_0xc96c('0x37')](_0x25df41[_0xc96c('0x32')]['fields']));_0x4c3088['attributes']=_0x4c3088[_0xc96c('0x35')][_0xc96c('0x38')]?_0x4c3088[_0xc96c('0x35')]:_0x30b3ac[_0xc96c('0x31')];if(_0x25df41[_0xc96c('0x32')][_0xc96c('0x43')]){_0x4c3088[_0xc96c('0x49')]=[{'all':!![]}];}_0x4c3088=_[_0xc96c('0x3f')]({},_0x4c3088,_0x25df41[_0xc96c('0x42')]);return db[_0xc96c('0x2d')][_0xc96c('0x4a')](_0x4c3088)[_0xc96c('0x28')](handleEntityNotFound(_0x4d5a1b,null))[_0xc96c('0x28')](respondWithResult(_0x4d5a1b,null))['catch'](handleError(_0x4d5a1b,null));};exports[_0xc96c('0x4b')]=function(_0x2e5045,_0x307d58){return db[_0xc96c('0x2d')]['create'](_0x2e5045[_0xc96c('0x4c')],{})['then'](respondWithResult(_0x307d58,0xc9))[_0xc96c('0x46')](handleError(_0x307d58,null));};exports[_0xc96c('0x26')]=function(_0x565812,_0x2581ae){if(_0x565812[_0xc96c('0x4c')]['id']){delete _0x565812[_0xc96c('0x4c')]['id'];}return db[_0xc96c('0x2d')][_0xc96c('0x4a')]({'where':{'id':_0x565812[_0xc96c('0x48')]['id']}})['then'](handleEntityNotFound(_0x2581ae,null))['then'](saveUpdates(_0x565812['body'],null))[_0xc96c('0x28')](respondWithResult(_0x2581ae,null))['catch'](handleError(_0x2581ae,null));};exports[_0xc96c('0x27')]=function(_0x22b2e3,_0x65a0a7){return db[_0xc96c('0x2d')][_0xc96c('0x4a')]({'where':{'id':_0x22b2e3[_0xc96c('0x48')]['id']}})[_0xc96c('0x28')](handleEntityNotFound(_0x65a0a7,null))[_0xc96c('0x28')](removeEntity(_0x65a0a7,null))[_0xc96c('0x46')](handleError(_0x65a0a7,null));};exports[_0xc96c('0x4d')]=function(_0x573177,_0x3adefb){return db[_0xc96c('0x2d')][_0xc96c('0x4d')]()[_0xc96c('0x28')](respondWithResult(_0x3adefb,null))[_0xc96c('0x46')](handleError(_0x3adefb,null));}; \ No newline at end of file +var _0xf45e=['Content-Range','json','apply','reject','save','destroy','then','sendStatus','stack','index','map','rawAttributes','type','key','model','name','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','WhatsappQueueReport','includeAll','include','findAll','rows','show','params','keys','length','merge','find','create','body','update','catch','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','set'];(function(_0x344df7,_0x368aa5){var _0x1c077f=function(_0x596299){while(--_0x596299){_0x344df7['push'](_0x344df7['shift']());}};_0x1c077f(++_0x368aa5);}(_0xf45e,0x115));var _0xef45=function(_0x4c9ad2,_0x3bb687){_0x4c9ad2=_0x4c9ad2-0x0;var _0x507886=_0xf45e[_0x4c9ad2];return _0x507886;};'use strict';var emlformat=require(_0xef45('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xef45('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xef45('0x2'));var moment=require(_0xef45('0x3'));var BPromise=require(_0xef45('0x4'));var Mustache=require(_0xef45('0x5'));var util=require(_0xef45('0x6'));var path=require(_0xef45('0x7'));var sox=require(_0xef45('0x8'));var csv=require(_0xef45('0x9'));var ejs=require(_0xef45('0xa'));var fs=require('fs');var fs_extra=require(_0xef45('0xb'));var _=require(_0xef45('0xc'));var squel=require(_0xef45('0xd'));var crypto=require(_0xef45('0xe'));var jsforce=require(_0xef45('0xf'));var deskjs=require(_0xef45('0x10'));var toCsv=require(_0xef45('0x9'));var querystring=require(_0xef45('0x11'));var Papa=require(_0xef45('0x12'));var Redis=require(_0xef45('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xef45('0x14'));var as=require(_0xef45('0x15'));var hardwareService=require(_0xef45('0x16'));var logger=require(_0xef45('0x17'))(_0xef45('0x18'));var utils=require(_0xef45('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xef45('0x1a'));var db=require(_0xef45('0x1b'))['db'];function respondWithStatusCode(_0x30babb,_0x433be9){_0x433be9=_0x433be9||0xcc;return function(_0x476739){if(_0x476739){return _0x30babb['sendStatus'](_0x433be9);}return _0x30babb['status'](_0x433be9)[_0xef45('0x1c')]();};}function respondWithResult(_0x47fd96,_0x2ae89a){_0x2ae89a=_0x2ae89a||0xc8;return function(_0xb0fc43){if(_0xb0fc43){return _0x47fd96[_0xef45('0x1d')](_0x2ae89a)['json'](_0xb0fc43);}};}function respondWithFilteredResult(_0x5b3136,_0x29c0c4){return function(_0x5530e6){if(_0x5530e6){var _0x11cd3a=typeof _0x29c0c4[_0xef45('0x1e')]===_0xef45('0x1f')&&typeof _0x29c0c4[_0xef45('0x20')]==='undefined';var _0x560b2f=_0x5530e6[_0xef45('0x21')];var _0x219778=_0x11cd3a?0x0:_0x29c0c4[_0xef45('0x1e')];var _0x258785=_0x11cd3a?_0x5530e6['count']:_0x29c0c4['offset']+_0x29c0c4[_0xef45('0x20')];var _0x20ef26;if(_0x258785>=_0x560b2f){_0x258785=_0x560b2f;_0x20ef26=0xc8;}else{_0x20ef26=0xce;}_0x5b3136[_0xef45('0x1d')](_0x20ef26);return _0x5b3136[_0xef45('0x22')](_0xef45('0x23'),_0x219778+'-'+_0x258785+'/'+_0x560b2f)[_0xef45('0x24')](_0x5530e6);}return null;};}function patchUpdates(_0x375cbd){return function(_0x4a6217){try{jsonpatch[_0xef45('0x25')](_0x4a6217,_0x375cbd,!![]);}catch(_0x3e2a47){return BPromise[_0xef45('0x26')](_0x3e2a47);}return _0x4a6217[_0xef45('0x27')]();};}function saveUpdates(_0x27322f,_0x5205bf){return function(_0x40abc8){if(_0x40abc8){return _0x40abc8['update'](_0x27322f)['then'](function(_0x7707a1){return _0x7707a1;});}return null;};}function removeEntity(_0x2b41d8,_0xbb859b){return function(_0x7817d0){if(_0x7817d0){return _0x7817d0[_0xef45('0x28')]()[_0xef45('0x29')](function(){_0x2b41d8[_0xef45('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x208b35,_0x5f0593){return function(_0x38b470){if(!_0x38b470){_0x208b35[_0xef45('0x2a')](0x194);}return _0x38b470;};}function handleError(_0x578f03,_0x46e423){_0x46e423=_0x46e423||0x1f4;return function(_0x2c356d){logger['error'](_0x2c356d[_0xef45('0x2b')]);if(_0x2c356d['name']){delete _0x2c356d['name'];}_0x578f03['status'](_0x46e423)['send'](_0x2c356d);};}exports[_0xef45('0x2c')]=function(_0x2f72ef,_0x217e8d){var _0x15ad38={},_0x5782d0={},_0x18f304={'count':0x0,'rows':[]};var _0x4f028c=_[_0xef45('0x2d')](db['WhatsappQueueReport'][_0xef45('0x2e')],function(_0x5bfd2d){return{'name':_0x5bfd2d['fieldName'],'type':_0x5bfd2d[_0xef45('0x2f')][_0xef45('0x30')]};});_0x5782d0[_0xef45('0x31')]=_[_0xef45('0x2d')](_0x4f028c,_0xef45('0x32'));_0x5782d0['query']=_['keys'](_0x2f72ef['query']);_0x5782d0[_0xef45('0x33')]=_[_0xef45('0x34')](_0x5782d0[_0xef45('0x31')],_0x5782d0[_0xef45('0x35')]);_0x15ad38[_0xef45('0x36')]=_[_0xef45('0x34')](_0x5782d0[_0xef45('0x31')],qs['fields'](_0x2f72ef['query'][_0xef45('0x37')]));_0x15ad38['attributes']=_0x15ad38[_0xef45('0x36')]['length']?_0x15ad38[_0xef45('0x36')]:_0x5782d0[_0xef45('0x31')];if(!_0x2f72ef[_0xef45('0x35')][_0xef45('0x38')](_0xef45('0x39'))){_0x15ad38['limit']=qs[_0xef45('0x20')](_0x2f72ef[_0xef45('0x35')][_0xef45('0x20')]);_0x15ad38['offset']=qs['offset'](_0x2f72ef[_0xef45('0x35')][_0xef45('0x1e')]);}_0x15ad38['order']=qs[_0xef45('0x3a')](_0x2f72ef['query']['sort']);_0x15ad38[_0xef45('0x3b')]=qs[_0xef45('0x33')](_[_0xef45('0x3c')](_0x2f72ef['query'],_0x5782d0[_0xef45('0x33')]),_0x4f028c);if(_0x2f72ef[_0xef45('0x35')][_0xef45('0x3d')]){_0x15ad38[_0xef45('0x3b')]=_['merge'](_0x15ad38['where'],{'$or':_[_0xef45('0x2d')](_0x4f028c,function(_0x474be1){if(_0x474be1[_0xef45('0x2f')]!==_0xef45('0x3e')){var _0x269a11={};_0x269a11[_0x474be1[_0xef45('0x32')]]={'$like':'%'+_0x2f72ef[_0xef45('0x35')][_0xef45('0x3d')]+'%'};return _0x269a11;}})});}_0x15ad38=_['merge']({},_0x15ad38,_0x2f72ef['options']);var _0x13f8b2={'where':_0x15ad38[_0xef45('0x3b')]};return db[_0xef45('0x3f')][_0xef45('0x21')](_0x13f8b2)[_0xef45('0x29')](function(_0x3bcada){_0x18f304[_0xef45('0x21')]=_0x3bcada;if(_0x2f72ef[_0xef45('0x35')][_0xef45('0x40')]){_0x15ad38[_0xef45('0x41')]=[{'all':!![]}];}return db[_0xef45('0x3f')][_0xef45('0x42')](_0x15ad38);})[_0xef45('0x29')](function(_0xd7d217){_0x18f304[_0xef45('0x43')]=_0xd7d217;return _0x18f304;})[_0xef45('0x29')](respondWithFilteredResult(_0x217e8d,_0x15ad38))['catch'](handleError(_0x217e8d,null));};exports[_0xef45('0x44')]=function(_0x5bdfad,_0x1b9d45){var _0x82c123={'raw':!![],'where':{'id':_0x5bdfad[_0xef45('0x45')]['id']}},_0x54ccb8={};_0x54ccb8['model']=_[_0xef45('0x46')](db['WhatsappQueueReport'][_0xef45('0x2e')]);_0x54ccb8[_0xef45('0x35')]=_[_0xef45('0x46')](_0x5bdfad[_0xef45('0x35')]);_0x54ccb8[_0xef45('0x33')]=_[_0xef45('0x34')](_0x54ccb8[_0xef45('0x31')],_0x54ccb8['query']);_0x82c123[_0xef45('0x36')]=_[_0xef45('0x34')](_0x54ccb8[_0xef45('0x31')],qs[_0xef45('0x37')](_0x5bdfad[_0xef45('0x35')][_0xef45('0x37')]));_0x82c123[_0xef45('0x36')]=_0x82c123[_0xef45('0x36')][_0xef45('0x47')]?_0x82c123[_0xef45('0x36')]:_0x54ccb8[_0xef45('0x31')];if(_0x5bdfad[_0xef45('0x35')][_0xef45('0x40')]){_0x82c123[_0xef45('0x41')]=[{'all':!![]}];}_0x82c123=_[_0xef45('0x48')]({},_0x82c123,_0x5bdfad['options']);return db[_0xef45('0x3f')][_0xef45('0x49')](_0x82c123)[_0xef45('0x29')](handleEntityNotFound(_0x1b9d45,null))['then'](respondWithResult(_0x1b9d45,null))['catch'](handleError(_0x1b9d45,null));};exports['create']=function(_0x29aeab,_0x18143c){return db[_0xef45('0x3f')][_0xef45('0x4a')](_0x29aeab[_0xef45('0x4b')],{})[_0xef45('0x29')](respondWithResult(_0x18143c,0xc9))['catch'](handleError(_0x18143c,null));};exports[_0xef45('0x4c')]=function(_0x463796,_0x2b2419){if(_0x463796['body']['id']){delete _0x463796['body']['id'];}return db[_0xef45('0x3f')][_0xef45('0x49')]({'where':{'id':_0x463796['params']['id']}})[_0xef45('0x29')](handleEntityNotFound(_0x2b2419,null))[_0xef45('0x29')](saveUpdates(_0x463796[_0xef45('0x4b')],null))[_0xef45('0x29')](respondWithResult(_0x2b2419,null))[_0xef45('0x4d')](handleError(_0x2b2419,null));};exports[_0xef45('0x28')]=function(_0x23581f,_0xfa5fdd){return db[_0xef45('0x3f')][_0xef45('0x49')]({'where':{'id':_0x23581f[_0xef45('0x45')]['id']}})[_0xef45('0x29')](handleEntityNotFound(_0xfa5fdd,null))[_0xef45('0x29')](removeEntity(_0xfa5fdd,null))[_0xef45('0x4d')](handleError(_0xfa5fdd,null));};exports['describe']=function(_0x22b75e,_0x24aceb){return db[_0xef45('0x3f')]['describe']()[_0xef45('0x29')](respondWithResult(_0x24aceb,null))[_0xef45('0x4d')](handleError(_0x24aceb,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index b5d8bb0..faa0049 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 _0x7309=['api','bluebird','rimraf','../../config/environment','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','util'];(function(_0x1138d0,_0x8df64f){var _0x108a20=function(_0x29fa50){while(--_0x29fa50){_0x1138d0['push'](_0x1138d0['shift']());}};_0x108a20(++_0x8df64f);}(_0x7309,0x185));var _0x9730=function(_0x2c9c67,_0x4c8a85){_0x2c9c67=_0x2c9c67-0x0;var _0x2166c4=_0x7309[_0x2c9c67];return _0x2166c4;};'use strict';var _=require('lodash');var util=require(_0x9730('0x0'));var logger=require('../../config/logger')(_0x9730('0x1'));var moment=require('moment');var BPromise=require(_0x9730('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9730('0x3'));var config=require(_0x9730('0x4'));var attributes=require('./whatsappQueueReport.attributes');module[_0x9730('0x5')]=function(_0x11a889,_0x1925be){return _0x11a889[_0x9730('0x6')](_0x9730('0x7'),attributes,{'tableName':_0x9730('0x8'),'paranoid':![],'indexes':[{'name':_0x9730('0x9'),'fields':[_0x9730('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x54e7=['report_whatsapp_queue','uniqueid','../../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);}(_0x54e7,0xf4));var _0x754e=function(_0x3dadd8,_0x1ad005){_0x3dadd8=_0x3dadd8-0x0;var _0x22353f=_0x54e7[_0x3dadd8];return _0x22353f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x754e('0x0'))(_0x754e('0x1'));var moment=require(_0x754e('0x2'));var BPromise=require(_0x754e('0x3'));var rp=require(_0x754e('0x4'));var fs=require('fs');var path=require(_0x754e('0x5'));var rimraf=require(_0x754e('0x6'));var config=require(_0x754e('0x7'));var attributes=require('./whatsappQueueReport.attributes');module[_0x754e('0x8')]=function(_0x283a27,_0x282080){return _0x283a27['define']('WhatsappQueueReport',attributes,{'tableName':_0x754e('0x9'),'paranoid':![],'indexes':[{'name':_0x754e('0xa'),'fields':[_0x754e('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 61f015e..dc56272 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 _0x38e1=['UpdateWhatsappQueueReport','WhatsappQueueReport','update','raw','attributes','limit','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateWhatsappQueueReport','create','body','options','debug'];(function(_0xfb7ee3,_0x6f1f19){var _0x5c061d=function(_0x404867){while(--_0x404867){_0xfb7ee3['push'](_0xfb7ee3['shift']());}};_0x5c061d(++_0x6f1f19);}(_0x38e1,0x114));var _0x138e=function(_0x5a2506,_0x148b50){_0x5a2506=_0x5a2506-0x0;var _0x1f6fb4=_0x38e1[_0x5a2506];return _0x1f6fb4;};'use strict';var _=require(_0x138e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x138e('0x1'));var rs=require(_0x138e('0x2'));var fs=require('fs');var Redis=require(_0x138e('0x3'));var db=require(_0x138e('0x4'))['db'];var utils=require(_0x138e('0x5'));var logger=require('../../config/logger')(_0x138e('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x138e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x17c629,_0x33c6d8,_0x4480fb){return new BPromise(function(_0x286f9a,_0x3bfef0){return client[_0x138e('0x8')](_0x17c629,_0x4480fb)[_0x138e('0x9')](function(_0x4ef908){logger[_0x138e('0xa')](_0x138e('0xb'),_0x33c6d8,'request\x20sent');logger['debug']('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x33c6d8,_0x138e('0xc'),JSON[_0x138e('0xd')](_0x4ef908));if(_0x4ef908[_0x138e('0xe')]){if(_0x4ef908['error'][_0x138e('0xf')]===0x1f4){logger[_0x138e('0xe')](_0x138e('0xb'),_0x33c6d8,_0x4ef908['error'][_0x138e('0x10')]);return _0x3bfef0(_0x4ef908[_0x138e('0xe')][_0x138e('0x10')]);}logger[_0x138e('0xe')](_0x138e('0xb'),_0x33c6d8,_0x4ef908['error'][_0x138e('0x10')]);return _0x286f9a(_0x4ef908[_0x138e('0xe')][_0x138e('0x10')]);}else{logger[_0x138e('0xa')](_0x138e('0xb'),_0x33c6d8,_0x138e('0xc'));_0x286f9a(_0x4ef908[_0x138e('0x11')][_0x138e('0x10')]);}})[_0x138e('0x12')](function(_0x293f93){logger[_0x138e('0xe')](_0x138e('0xb'),_0x33c6d8,_0x293f93);_0x3bfef0(_0x293f93);});});}exports[_0x138e('0x13')]=function(_0x75bbf1){var _0xca6cd2=this;return new Promise(function(_0x53080f,_0x2f9460){return db['WhatsappQueueReport'][_0x138e('0x14')](_0x75bbf1[_0x138e('0x15')],{'raw':_0x75bbf1[_0x138e('0x16')]?_0x75bbf1['options']['raw']===undefined?!![]:![]:!![]})[_0x138e('0x9')](function(_0x57f5ba){logger['info'](_0x138e('0x13'),_0x75bbf1);logger[_0x138e('0x17')](_0x138e('0x13'),_0x75bbf1,JSON['stringify'](_0x57f5ba));_0x53080f(_0x57f5ba);})['catch'](function(_0x1fc220){logger[_0x138e('0xe')](_0x138e('0x13'),_0x1fc220['message'],_0x75bbf1);_0x2f9460(_0xca6cd2['error'](0x1f4,_0x1fc220['message']));});});};exports[_0x138e('0x18')]=function(_0x186b82){var _0x4e3b8b=this;return new Promise(function(_0x73725e,_0x9bc432){return db[_0x138e('0x19')][_0x138e('0x1a')](_0x186b82[_0x138e('0x15')],{'raw':_0x186b82[_0x138e('0x16')]?_0x186b82[_0x138e('0x16')][_0x138e('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x186b82[_0x138e('0x16')]?_0x186b82['options']['where']||null:null,'attributes':_0x186b82['options']?_0x186b82[_0x138e('0x16')][_0x138e('0x1c')]||null:null,'limit':_0x186b82[_0x138e('0x16')]?_0x186b82[_0x138e('0x16')][_0x138e('0x1d')]||null:null})[_0x138e('0x9')](function(_0x3983cc){logger['info'](_0x138e('0x18'),_0x186b82);logger['debug'](_0x138e('0x18'),_0x186b82,JSON[_0x138e('0xd')](_0x3983cc));_0x73725e(_0x3983cc);})[_0x138e('0x12')](function(_0x1528ea){logger[_0x138e('0xe')](_0x138e('0x18'),_0x1528ea['message'],_0x186b82);_0x9bc432(_0x4e3b8b[_0x138e('0xe')](0x1f4,_0x1528ea[_0x138e('0x10')]));});});}; \ No newline at end of file +var _0x59e8=['UpdateWhatsappQueueReport','update','body','options','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappQueueReport,\x20%s,\x20%s','message','request\x20sent','result','catch','WhatsappQueueReport','create','raw','CreateWhatsappQueueReport'];(function(_0x12932d,_0x32920d){var _0x424f68=function(_0xe0a7c1){while(--_0xe0a7c1){_0x12932d['push'](_0x12932d['shift']());}};_0x424f68(++_0x32920d);}(_0x59e8,0xbb));var _0x859e=function(_0x2f9f5b,_0x15e8dd){_0x2f9f5b=_0x2f9f5b-0x0;var _0x327b1f=_0x59e8[_0x2f9f5b];return _0x327b1f;};'use strict';var _=require('lodash');var util=require(_0x859e('0x0'));var moment=require(_0x859e('0x1'));var BPromise=require(_0x859e('0x2'));var rs=require(_0x859e('0x3'));var fs=require('fs');var Redis=require(_0x859e('0x4'));var db=require(_0x859e('0x5'))['db'];var utils=require(_0x859e('0x6'));var logger=require(_0x859e('0x7'))(_0x859e('0x8'));var config=require('../../config/environment');var jayson=require(_0x859e('0x9'));var client=jayson[_0x859e('0xa')][_0x859e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d7271,_0x192d63,_0x53a72c){return new BPromise(function(_0xf2f16a,_0x1c81f9){return client[_0x859e('0xc')](_0x2d7271,_0x53a72c)[_0x859e('0xd')](function(_0x50ebec){logger[_0x859e('0xe')]('WhatsappQueueReport,\x20%s,\x20%s',_0x192d63,'request\x20sent');logger[_0x859e('0xf')](_0x859e('0x10'),_0x192d63,'request\x20sent',JSON[_0x859e('0x11')](_0x50ebec));if(_0x50ebec[_0x859e('0x12')]){if(_0x50ebec[_0x859e('0x12')][_0x859e('0x13')]===0x1f4){logger[_0x859e('0x12')](_0x859e('0x14'),_0x192d63,_0x50ebec[_0x859e('0x12')]['message']);return _0x1c81f9(_0x50ebec[_0x859e('0x12')][_0x859e('0x15')]);}logger['error'](_0x859e('0x14'),_0x192d63,_0x50ebec['error']['message']);return _0xf2f16a(_0x50ebec[_0x859e('0x12')][_0x859e('0x15')]);}else{logger[_0x859e('0xe')](_0x859e('0x14'),_0x192d63,_0x859e('0x16'));_0xf2f16a(_0x50ebec[_0x859e('0x17')][_0x859e('0x15')]);}})[_0x859e('0x18')](function(_0x225886){logger['error'](_0x859e('0x14'),_0x192d63,_0x225886);_0x1c81f9(_0x225886);});});}exports['CreateWhatsappQueueReport']=function(_0x33b0f5){var _0x2a6ca5=this;return new Promise(function(_0x42119c,_0x53d771){return db[_0x859e('0x19')][_0x859e('0x1a')](_0x33b0f5['body'],{'raw':_0x33b0f5['options']?_0x33b0f5['options'][_0x859e('0x1b')]===undefined?!![]:![]:!![]})[_0x859e('0xd')](function(_0x58a53f){logger[_0x859e('0xe')](_0x859e('0x1c'),_0x33b0f5);logger[_0x859e('0xf')](_0x859e('0x1c'),_0x33b0f5,JSON['stringify'](_0x58a53f));_0x42119c(_0x58a53f);})[_0x859e('0x18')](function(_0x16c194){logger[_0x859e('0x12')](_0x859e('0x1c'),_0x16c194[_0x859e('0x15')],_0x33b0f5);_0x53d771(_0x2a6ca5[_0x859e('0x12')](0x1f4,_0x16c194[_0x859e('0x15')]));});});};exports[_0x859e('0x1d')]=function(_0x23b32d){var _0x4a3853=this;return new Promise(function(_0x3ec934,_0x63efcb){return db['WhatsappQueueReport'][_0x859e('0x1e')](_0x23b32d[_0x859e('0x1f')],{'raw':_0x23b32d[_0x859e('0x20')]?_0x23b32d['options'][_0x859e('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23b32d[_0x859e('0x20')]?_0x23b32d[_0x859e('0x20')][_0x859e('0x21')]||null:null,'attributes':_0x23b32d['options']?_0x23b32d[_0x859e('0x20')][_0x859e('0x22')]||null:null,'limit':_0x23b32d['options']?_0x23b32d['options'][_0x859e('0x23')]||null:null})[_0x859e('0xd')](function(_0x58cf0c){logger['info'](_0x859e('0x1d'),_0x23b32d);logger['debug'](_0x859e('0x1d'),_0x23b32d,JSON[_0x859e('0x11')](_0x58cf0c));_0x3ec934(_0x58cf0c);})[_0x859e('0x18')](function(_0x29402d){logger[_0x859e('0x12')](_0x859e('0x1d'),_0x29402d['message'],_0x23b32d);_0x63efcb(_0x4a3853['error'](0x1f4,_0x29402d[_0x859e('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 03b173d..b2d96ad 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 _0x32bb=['util','express','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show','post','create','/:id','update','destroy'];(function(_0x5dd98d,_0x37997c){var _0xa3605b=function(_0x363bf5){while(--_0x363bf5){_0x5dd98d['push'](_0x5dd98d['shift']());}};_0xa3605b(++_0x37997c);}(_0x32bb,0x1b2));var _0xb32b=function(_0x5e8eae,_0x4f81e0){_0x5e8eae=_0x5e8eae-0x0;var _0xdd09cd=_0x32bb[_0x5e8eae];return _0xdd09cd;};'use strict';var multer=require('multer');var util=require(_0xb32b('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb32b('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb32b('0x2'));var config=require(_0xb32b('0x3'));var controller=require('./whatsappTransferReport.controller');router[_0xb32b('0x4')]('/',auth[_0xb32b('0x5')](),controller['index']);router[_0xb32b('0x4')](_0xb32b('0x6'),auth['isAuthenticated'](),controller[_0xb32b('0x7')]);router[_0xb32b('0x4')]('/:id',auth[_0xb32b('0x5')](),controller[_0xb32b('0x8')]);router[_0xb32b('0x9')]('/',auth['isAuthenticated'](),controller[_0xb32b('0xa')]);router['put'](_0xb32b('0xb'),auth[_0xb32b('0x5')](),controller[_0xb32b('0xc')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xb32b('0xd')]);module['exports']=router; \ No newline at end of file +var _0xdaaa=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy','multer'];(function(_0x5d411d,_0x3e3f5d){var _0xb25dd=function(_0x421f7c){while(--_0x421f7c){_0x5d411d['push'](_0x5d411d['shift']());}};_0xb25dd(++_0x3e3f5d);}(_0xdaaa,0xbc));var _0xadaa=function(_0x5a7801,_0x337c33){_0x5a7801=_0x5a7801-0x0;var _0x4c8b20=_0xdaaa[_0x5a7801];return _0x4c8b20;};'use strict';var multer=require(_0xadaa('0x0'));var util=require('util');var path=require(_0xadaa('0x1'));var timeout=require(_0xadaa('0x2'));var express=require(_0xadaa('0x3'));var router=express['Router']();var fs_extra=require(_0xadaa('0x4'));var auth=require(_0xadaa('0x5'));var interaction=require(_0xadaa('0x6'));var config=require(_0xadaa('0x7'));var controller=require(_0xadaa('0x8'));router[_0xadaa('0x9')]('/',auth[_0xadaa('0xa')](),controller[_0xadaa('0xb')]);router[_0xadaa('0x9')](_0xadaa('0xc'),auth[_0xadaa('0xa')](),controller[_0xadaa('0xd')]);router['get'](_0xadaa('0xe'),auth[_0xadaa('0xa')](),controller[_0xadaa('0xf')]);router[_0xadaa('0x10')]('/',auth[_0xadaa('0xa')](),controller[_0xadaa('0x11')]);router[_0xadaa('0x12')](_0xadaa('0xe'),auth[_0xadaa('0xa')](),controller[_0xadaa('0x13')]);router['delete'](_0xadaa('0xe'),auth['isAuthenticated'](),controller[_0xadaa('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 3b4d59a..f06c8b5 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 _0x0936=['STRING','ENUM','account','agent','queue','sequelize','exports'];(function(_0x3a4aaf,_0x49339e){var _0x5eecee=function(_0x496ac2){while(--_0x496ac2){_0x3a4aaf['push'](_0x3a4aaf['shift']());}};_0x5eecee(++_0x49339e);}(_0x0936,0xde));var _0x6093=function(_0x2e5c0b,_0x33b67d){_0x2e5c0b=_0x2e5c0b-0x0;var _0x1d8f8b=_0x0936[_0x2e5c0b];return _0x1d8f8b;};'use strict';var Sequelize=require(_0x6093('0x0'));module[_0x6093('0x1')]={'uniqueid':{'type':Sequelize[_0x6093('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x6093('0x3')](_0x6093('0x4'),_0x6093('0x5'),_0x6093('0x6')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0xb240=['STRING','ENUM','account','agent','queue','DATE','sequelize','exports'];(function(_0x2d285a,_0x3404d6){var _0x438199=function(_0x113299){while(--_0x113299){_0x2d285a['push'](_0x2d285a['shift']());}};_0x438199(++_0x3404d6);}(_0xb240,0x7e));var _0x0b24=function(_0x434e50,_0x47297f){_0x434e50=_0x434e50-0x0;var _0x4fe162=_0xb240[_0x434e50];return _0x4fe162;};'use strict';var Sequelize=require(_0x0b24('0x0'));module[_0x0b24('0x1')]={'uniqueid':{'type':Sequelize[_0x0b24('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x0b24('0x3')](_0x0b24('0x4'),_0x0b24('0x5'),_0x0b24('0x6')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x0b24('0x7')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index c4ea3c6..259c9b7 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 _0x4bab=['save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','filter','where','merge','type','VIRTUAL','options','WhatsappTransferReport','includeAll','findAll','rows','catch','show','include','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','apply','reject'];(function(_0x49ae20,_0x27a7b7){var _0xda9f07=function(_0xd46d69){while(--_0xd46d69){_0x49ae20['push'](_0x49ae20['shift']());}};_0xda9f07(++_0x27a7b7);}(_0x4bab,0xc8));var _0xb4ba=function(_0x200900,_0x58c997){_0x200900=_0x200900-0x0;var _0x29952c=_0x4bab[_0x200900];return _0x29952c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb4ba('0x0'));var zipdir=require(_0xb4ba('0x1'));var jsonpatch=require(_0xb4ba('0x2'));var rp=require(_0xb4ba('0x3'));var moment=require(_0xb4ba('0x4'));var BPromise=require(_0xb4ba('0x5'));var Mustache=require(_0xb4ba('0x6'));var util=require(_0xb4ba('0x7'));var path=require('path');var sox=require(_0xb4ba('0x8'));var csv=require(_0xb4ba('0x9'));var ejs=require(_0xb4ba('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb4ba('0xb'));var squel=require(_0xb4ba('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb4ba('0x9'));var querystring=require(_0xb4ba('0xd'));var Papa=require(_0xb4ba('0xe'));var Redis=require(_0xb4ba('0xf'));var authService=require(_0xb4ba('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xb4ba('0x11'));var hardwareService=require(_0xb4ba('0x12'));var logger=require(_0xb4ba('0x13'))(_0xb4ba('0x14'));var utils=require(_0xb4ba('0x15'));var config=require(_0xb4ba('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xb4ba('0x17'))['db'];function respondWithStatusCode(_0x2ff2ee,_0x5ccd64){_0x5ccd64=_0x5ccd64||0xcc;return function(_0x3d2b37){if(_0x3d2b37){return _0x2ff2ee[_0xb4ba('0x18')](_0x5ccd64);}return _0x2ff2ee[_0xb4ba('0x19')](_0x5ccd64)[_0xb4ba('0x1a')]();};}function respondWithResult(_0x17124b,_0xf59cbd){_0xf59cbd=_0xf59cbd||0xc8;return function(_0x414cf9){if(_0x414cf9){return _0x17124b[_0xb4ba('0x19')](_0xf59cbd)[_0xb4ba('0x1b')](_0x414cf9);}};}function respondWithFilteredResult(_0x3208b8,_0x5efb5a){return function(_0x2fcf29){if(_0x2fcf29){var _0x588028=typeof _0x5efb5a[_0xb4ba('0x1c')]===_0xb4ba('0x1d')&&typeof _0x5efb5a['limit']==='undefined';var _0x52038d=_0x2fcf29[_0xb4ba('0x1e')];var _0x1fea10=_0x588028?0x0:_0x5efb5a[_0xb4ba('0x1c')];var _0x5cfb95=_0x588028?_0x2fcf29[_0xb4ba('0x1e')]:_0x5efb5a[_0xb4ba('0x1c')]+_0x5efb5a['limit'];var _0x241bf8;if(_0x5cfb95>=_0x52038d){_0x5cfb95=_0x52038d;_0x241bf8=0xc8;}else{_0x241bf8=0xce;}_0x3208b8[_0xb4ba('0x19')](_0x241bf8);return _0x3208b8[_0xb4ba('0x1f')]('Content-Range',_0x1fea10+'-'+_0x5cfb95+'/'+_0x52038d)[_0xb4ba('0x1b')](_0x2fcf29);}return null;};}function patchUpdates(_0x2fc858){return function(_0x11db73){try{jsonpatch[_0xb4ba('0x20')](_0x11db73,_0x2fc858,!![]);}catch(_0x59b2cd){return BPromise[_0xb4ba('0x21')](_0x59b2cd);}return _0x11db73[_0xb4ba('0x22')]();};}function saveUpdates(_0x1ee113,_0x30925b){return function(_0x3ec220){if(_0x3ec220){return _0x3ec220[_0xb4ba('0x23')](_0x1ee113)[_0xb4ba('0x24')](function(_0x141cb6){return _0x141cb6;});}return null;};}function removeEntity(_0x5153ac,_0x48269a){return function(_0x53d189){if(_0x53d189){return _0x53d189[_0xb4ba('0x25')]()[_0xb4ba('0x24')](function(){_0x5153ac['status'](0xcc)[_0xb4ba('0x1a')]();});}};}function handleEntityNotFound(_0x15d06e,_0x488a14){return function(_0x4a1e6b){if(!_0x4a1e6b){_0x15d06e[_0xb4ba('0x18')](0x194);}return _0x4a1e6b;};}function handleError(_0x1257e0,_0x5d4509){_0x5d4509=_0x5d4509||0x1f4;return function(_0x224ace){logger[_0xb4ba('0x26')](_0x224ace[_0xb4ba('0x27')]);if(_0x224ace[_0xb4ba('0x28')]){delete _0x224ace['name'];}_0x1257e0['status'](_0x5d4509)[_0xb4ba('0x29')](_0x224ace);};}exports[_0xb4ba('0x2a')]=function(_0x22fe53,_0x329510){var _0x3350dd={},_0x448b37={},_0x6a3ab8={'count':0x0,'rows':[]};var _0x206136=_[_0xb4ba('0x2b')](db['WhatsappTransferReport'][_0xb4ba('0x2c')],function(_0x4a39ab){return{'name':_0x4a39ab[_0xb4ba('0x2d')],'type':_0x4a39ab['type'][_0xb4ba('0x2e')]};});_0x448b37[_0xb4ba('0x2f')]=_['map'](_0x206136,_0xb4ba('0x28'));_0x448b37['query']=_[_0xb4ba('0x30')](_0x22fe53[_0xb4ba('0x31')]);_0x448b37['filters']=_['intersection'](_0x448b37[_0xb4ba('0x2f')],_0x448b37[_0xb4ba('0x31')]);_0x3350dd[_0xb4ba('0x32')]=_[_0xb4ba('0x33')](_0x448b37['model'],qs[_0xb4ba('0x34')](_0x22fe53[_0xb4ba('0x31')][_0xb4ba('0x34')]));_0x3350dd[_0xb4ba('0x32')]=_0x3350dd[_0xb4ba('0x32')][_0xb4ba('0x35')]?_0x3350dd[_0xb4ba('0x32')]:_0x448b37[_0xb4ba('0x2f')];if(!_0x22fe53[_0xb4ba('0x31')][_0xb4ba('0x36')](_0xb4ba('0x37'))){_0x3350dd[_0xb4ba('0x38')]=qs[_0xb4ba('0x38')](_0x22fe53[_0xb4ba('0x31')][_0xb4ba('0x38')]);_0x3350dd['offset']=qs[_0xb4ba('0x1c')](_0x22fe53[_0xb4ba('0x31')][_0xb4ba('0x1c')]);}_0x3350dd[_0xb4ba('0x39')]=qs[_0xb4ba('0x3a')](_0x22fe53[_0xb4ba('0x31')]['sort']);_0x3350dd['where']=qs[_0xb4ba('0x3b')](_['pick'](_0x22fe53['query'],_0x448b37[_0xb4ba('0x3b')]),_0x206136);if(_0x22fe53[_0xb4ba('0x31')][_0xb4ba('0x3c')]){_0x3350dd[_0xb4ba('0x3d')]=_[_0xb4ba('0x3e')](_0x3350dd[_0xb4ba('0x3d')],{'$or':_[_0xb4ba('0x2b')](_0x206136,function(_0x16f35e){if(_0x16f35e[_0xb4ba('0x3f')]!==_0xb4ba('0x40')){var _0x52c3c2={};_0x52c3c2[_0x16f35e[_0xb4ba('0x28')]]={'$like':'%'+_0x22fe53['query'][_0xb4ba('0x3c')]+'%'};return _0x52c3c2;}})});}_0x3350dd=_[_0xb4ba('0x3e')]({},_0x3350dd,_0x22fe53[_0xb4ba('0x41')]);var _0x24a40d={'where':_0x3350dd[_0xb4ba('0x3d')]};return db[_0xb4ba('0x42')][_0xb4ba('0x1e')](_0x24a40d)[_0xb4ba('0x24')](function(_0xc03daf){_0x6a3ab8[_0xb4ba('0x1e')]=_0xc03daf;if(_0x22fe53['query'][_0xb4ba('0x43')]){_0x3350dd['include']=[{'all':!![]}];}return db[_0xb4ba('0x42')][_0xb4ba('0x44')](_0x3350dd);})[_0xb4ba('0x24')](function(_0x49f947){_0x6a3ab8[_0xb4ba('0x45')]=_0x49f947;return _0x6a3ab8;})[_0xb4ba('0x24')](respondWithFilteredResult(_0x329510,_0x3350dd))[_0xb4ba('0x46')](handleError(_0x329510,null));};exports[_0xb4ba('0x47')]=function(_0x44470a,_0x4fad16){var _0x265f99={'raw':!![],'where':{'id':_0x44470a['params']['id']}},_0x44c8c6={};_0x44c8c6[_0xb4ba('0x2f')]=_[_0xb4ba('0x30')](db[_0xb4ba('0x42')][_0xb4ba('0x2c')]);_0x44c8c6[_0xb4ba('0x31')]=_[_0xb4ba('0x30')](_0x44470a[_0xb4ba('0x31')]);_0x44c8c6[_0xb4ba('0x3b')]=_[_0xb4ba('0x33')](_0x44c8c6[_0xb4ba('0x2f')],_0x44c8c6['query']);_0x265f99[_0xb4ba('0x32')]=_['intersection'](_0x44c8c6[_0xb4ba('0x2f')],qs[_0xb4ba('0x34')](_0x44470a[_0xb4ba('0x31')]['fields']));_0x265f99[_0xb4ba('0x32')]=_0x265f99['attributes'][_0xb4ba('0x35')]?_0x265f99[_0xb4ba('0x32')]:_0x44c8c6[_0xb4ba('0x2f')];if(_0x44470a[_0xb4ba('0x31')][_0xb4ba('0x43')]){_0x265f99[_0xb4ba('0x48')]=[{'all':!![]}];}_0x265f99=_[_0xb4ba('0x3e')]({},_0x265f99,_0x44470a[_0xb4ba('0x41')]);return db[_0xb4ba('0x42')][_0xb4ba('0x49')](_0x265f99)[_0xb4ba('0x24')](handleEntityNotFound(_0x4fad16,null))[_0xb4ba('0x24')](respondWithResult(_0x4fad16,null))['catch'](handleError(_0x4fad16,null));};exports[_0xb4ba('0x4a')]=function(_0x481321,_0x294c82){return db['WhatsappTransferReport'][_0xb4ba('0x4a')](_0x481321[_0xb4ba('0x4b')],{})[_0xb4ba('0x24')](respondWithResult(_0x294c82,0xc9))[_0xb4ba('0x46')](handleError(_0x294c82,null));};exports[_0xb4ba('0x23')]=function(_0x52d253,_0x5e1a0b){if(_0x52d253[_0xb4ba('0x4b')]['id']){delete _0x52d253['body']['id'];}return db[_0xb4ba('0x42')]['find']({'where':{'id':_0x52d253[_0xb4ba('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5e1a0b,null))[_0xb4ba('0x24')](saveUpdates(_0x52d253['body'],null))[_0xb4ba('0x24')](respondWithResult(_0x5e1a0b,null))['catch'](handleError(_0x5e1a0b,null));};exports[_0xb4ba('0x25')]=function(_0x300ec5,_0x2db964){return db[_0xb4ba('0x42')][_0xb4ba('0x49')]({'where':{'id':_0x300ec5['params']['id']}})['then'](handleEntityNotFound(_0x2db964,null))[_0xb4ba('0x24')](removeEntity(_0x2db964,null))[_0xb4ba('0x46')](handleError(_0x2db964,null));};exports[_0xb4ba('0x4d')]=function(_0x52415d,_0x8eefa0){return db[_0xb4ba('0x42')][_0xb4ba('0x4d')]()[_0xb4ba('0x24')](respondWithResult(_0x8eefa0,null))[_0xb4ba('0x46')](handleError(_0x8eefa0,null));}; \ No newline at end of file +var _0x5158=['order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','rows','show','keys','find','create','catch','update','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','set','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','WhatsappTransferReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x513d80,_0x1649db){var _0x174463=function(_0x3b3dcd){while(--_0x3b3dcd){_0x513d80['push'](_0x513d80['shift']());}};_0x174463(++_0x1649db);}(_0x5158,0x1d7));var _0x8515=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x5158[_0x29d94e];return _0x106237;};'use strict';var emlformat=require(_0x8515('0x0'));var rimraf=require(_0x8515('0x1'));var zipdir=require(_0x8515('0x2'));var jsonpatch=require(_0x8515('0x3'));var rp=require(_0x8515('0x4'));var moment=require(_0x8515('0x5'));var BPromise=require(_0x8515('0x6'));var Mustache=require('mustache');var util=require(_0x8515('0x7'));var path=require(_0x8515('0x8'));var sox=require(_0x8515('0x9'));var csv=require(_0x8515('0xa'));var ejs=require(_0x8515('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8515('0xc'));var crypto=require(_0x8515('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8515('0xe'));var Redis=require(_0x8515('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x8515('0x10'));var as=require(_0x8515('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8515('0x12'));var utils=require(_0x8515('0x13'));var config=require(_0x8515('0x14'));var licenseUtil=require(_0x8515('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55e18e,_0x43d4c5){_0x43d4c5=_0x43d4c5||0xcc;return function(_0x15f954){if(_0x15f954){return _0x55e18e[_0x8515('0x16')](_0x43d4c5);}return _0x55e18e[_0x8515('0x17')](_0x43d4c5)['end']();};}function respondWithResult(_0x411101,_0x5cf368){_0x5cf368=_0x5cf368||0xc8;return function(_0x42c518){if(_0x42c518){return _0x411101[_0x8515('0x17')](_0x5cf368)[_0x8515('0x18')](_0x42c518);}};}function respondWithFilteredResult(_0x3e9ffc,_0x2036c6){return function(_0x154ffd){if(_0x154ffd){var _0x206228=typeof _0x2036c6[_0x8515('0x19')]==='undefined'&&typeof _0x2036c6[_0x8515('0x1a')]===_0x8515('0x1b');var _0x5ba325=_0x154ffd['count'];var _0x22ca97=_0x206228?0x0:_0x2036c6[_0x8515('0x19')];var _0x1a8784=_0x206228?_0x154ffd['count']:_0x2036c6[_0x8515('0x19')]+_0x2036c6[_0x8515('0x1a')];var _0x3ee542;if(_0x1a8784>=_0x5ba325){_0x1a8784=_0x5ba325;_0x3ee542=0xc8;}else{_0x3ee542=0xce;}_0x3e9ffc[_0x8515('0x17')](_0x3ee542);return _0x3e9ffc[_0x8515('0x1c')]('Content-Range',_0x22ca97+'-'+_0x1a8784+'/'+_0x5ba325)['json'](_0x154ffd);}return null;};}function patchUpdates(_0x5a44b0){return function(_0x25b1c1){try{jsonpatch[_0x8515('0x1d')](_0x25b1c1,_0x5a44b0,!![]);}catch(_0x2bbc01){return BPromise[_0x8515('0x1e')](_0x2bbc01);}return _0x25b1c1[_0x8515('0x1f')]();};}function saveUpdates(_0x246699,_0x508933){return function(_0xb5c5a7){if(_0xb5c5a7){return _0xb5c5a7['update'](_0x246699)[_0x8515('0x20')](function(_0x112023){return _0x112023;});}return null;};}function removeEntity(_0x52da55,_0x55f70c){return function(_0x503d93){if(_0x503d93){return _0x503d93[_0x8515('0x21')]()[_0x8515('0x20')](function(){_0x52da55[_0x8515('0x17')](0xcc)[_0x8515('0x22')]();});}};}function handleEntityNotFound(_0x2b11a0,_0x1a08a0){return function(_0x4b6173){if(!_0x4b6173){_0x2b11a0['sendStatus'](0x194);}return _0x4b6173;};}function handleError(_0x53593b,_0x572369){_0x572369=_0x572369||0x1f4;return function(_0x98f15f){logger[_0x8515('0x23')](_0x98f15f[_0x8515('0x24')]);if(_0x98f15f['name']){delete _0x98f15f[_0x8515('0x25')];}_0x53593b[_0x8515('0x17')](_0x572369)[_0x8515('0x26')](_0x98f15f);};}exports[_0x8515('0x27')]=function(_0xa32154,_0x2eb1e6){var _0x260c51={},_0x4cc03a={},_0x280f2b={'count':0x0,'rows':[]};var _0x272f6c=_[_0x8515('0x28')](db[_0x8515('0x29')][_0x8515('0x2a')],function(_0x10c8e2){return{'name':_0x10c8e2['fieldName'],'type':_0x10c8e2[_0x8515('0x2b')][_0x8515('0x2c')]};});_0x4cc03a[_0x8515('0x2d')]=_[_0x8515('0x28')](_0x272f6c,'name');_0x4cc03a[_0x8515('0x2e')]=_['keys'](_0xa32154[_0x8515('0x2e')]);_0x4cc03a[_0x8515('0x2f')]=_[_0x8515('0x30')](_0x4cc03a[_0x8515('0x2d')],_0x4cc03a[_0x8515('0x2e')]);_0x260c51[_0x8515('0x31')]=_[_0x8515('0x30')](_0x4cc03a[_0x8515('0x2d')],qs[_0x8515('0x32')](_0xa32154[_0x8515('0x2e')]['fields']));_0x260c51[_0x8515('0x31')]=_0x260c51[_0x8515('0x31')][_0x8515('0x33')]?_0x260c51[_0x8515('0x31')]:_0x4cc03a['model'];if(!_0xa32154['query'][_0x8515('0x34')](_0x8515('0x35'))){_0x260c51[_0x8515('0x1a')]=qs[_0x8515('0x1a')](_0xa32154[_0x8515('0x2e')][_0x8515('0x1a')]);_0x260c51[_0x8515('0x19')]=qs['offset'](_0xa32154['query']['offset']);}_0x260c51[_0x8515('0x36')]=qs[_0x8515('0x37')](_0xa32154[_0x8515('0x2e')]['sort']);_0x260c51[_0x8515('0x38')]=qs['filters'](_[_0x8515('0x39')](_0xa32154[_0x8515('0x2e')],_0x4cc03a[_0x8515('0x2f')]),_0x272f6c);if(_0xa32154['query'][_0x8515('0x3a')]){_0x260c51[_0x8515('0x38')]=_[_0x8515('0x3b')](_0x260c51[_0x8515('0x38')],{'$or':_[_0x8515('0x28')](_0x272f6c,function(_0x504c55){if(_0x504c55[_0x8515('0x2b')]!==_0x8515('0x3c')){var _0x54fd3f={};_0x54fd3f[_0x504c55['name']]={'$like':'%'+_0xa32154[_0x8515('0x2e')]['filter']+'%'};return _0x54fd3f;}})});}_0x260c51=_['merge']({},_0x260c51,_0xa32154[_0x8515('0x3d')]);var _0x55683a={'where':_0x260c51[_0x8515('0x38')]};return db['WhatsappTransferReport']['count'](_0x55683a)[_0x8515('0x20')](function(_0x11e386){_0x280f2b[_0x8515('0x3e')]=_0x11e386;if(_0xa32154['query'][_0x8515('0x3f')]){_0x260c51[_0x8515('0x40')]=[{'all':!![]}];}return db[_0x8515('0x29')]['findAll'](_0x260c51);})['then'](function(_0x3cf31a){_0x280f2b[_0x8515('0x41')]=_0x3cf31a;return _0x280f2b;})['then'](respondWithFilteredResult(_0x2eb1e6,_0x260c51))['catch'](handleError(_0x2eb1e6,null));};exports[_0x8515('0x42')]=function(_0x58df55,_0xbc9ebc){var _0x4c206e={'raw':!![],'where':{'id':_0x58df55['params']['id']}},_0x184a13={};_0x184a13[_0x8515('0x2d')]=_[_0x8515('0x43')](db['WhatsappTransferReport'][_0x8515('0x2a')]);_0x184a13[_0x8515('0x2e')]=_[_0x8515('0x43')](_0x58df55['query']);_0x184a13['filters']=_[_0x8515('0x30')](_0x184a13[_0x8515('0x2d')],_0x184a13[_0x8515('0x2e')]);_0x4c206e[_0x8515('0x31')]=_['intersection'](_0x184a13['model'],qs['fields'](_0x58df55['query']['fields']));_0x4c206e[_0x8515('0x31')]=_0x4c206e[_0x8515('0x31')][_0x8515('0x33')]?_0x4c206e[_0x8515('0x31')]:_0x184a13['model'];if(_0x58df55[_0x8515('0x2e')]['includeAll']){_0x4c206e[_0x8515('0x40')]=[{'all':!![]}];}_0x4c206e=_[_0x8515('0x3b')]({},_0x4c206e,_0x58df55[_0x8515('0x3d')]);return db['WhatsappTransferReport'][_0x8515('0x44')](_0x4c206e)[_0x8515('0x20')](handleEntityNotFound(_0xbc9ebc,null))[_0x8515('0x20')](respondWithResult(_0xbc9ebc,null))['catch'](handleError(_0xbc9ebc,null));};exports[_0x8515('0x45')]=function(_0x4b8a16,_0x5a6f8d){return db[_0x8515('0x29')]['create'](_0x4b8a16['body'],{})[_0x8515('0x20')](respondWithResult(_0x5a6f8d,0xc9))[_0x8515('0x46')](handleError(_0x5a6f8d,null));};exports[_0x8515('0x47')]=function(_0x22b7bf,_0x4b425f){if(_0x22b7bf[_0x8515('0x48')]['id']){delete _0x22b7bf[_0x8515('0x48')]['id'];}return db[_0x8515('0x29')][_0x8515('0x44')]({'where':{'id':_0x22b7bf[_0x8515('0x49')]['id']}})['then'](handleEntityNotFound(_0x4b425f,null))[_0x8515('0x20')](saveUpdates(_0x22b7bf[_0x8515('0x48')],null))['then'](respondWithResult(_0x4b425f,null))[_0x8515('0x46')](handleError(_0x4b425f,null));};exports['destroy']=function(_0x49c702,_0x5b0688){return db[_0x8515('0x29')][_0x8515('0x44')]({'where':{'id':_0x49c702[_0x8515('0x49')]['id']}})[_0x8515('0x20')](handleEntityNotFound(_0x5b0688,null))['then'](removeEntity(_0x5b0688,null))[_0x8515('0x46')](handleError(_0x5b0688,null));};exports[_0x8515('0x4a')]=function(_0x139ee0,_0x2db12f){return db[_0x8515('0x29')][_0x8515('0x4a')]()[_0x8515('0x20')](respondWithResult(_0x2db12f,null))[_0x8515('0x46')](handleError(_0x2db12f,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 4c81146..1b8e12a 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 _0xc770=['bluebird','request-promise','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','moment'];(function(_0x2b529b,_0x337af4){var _0x49bb0b=function(_0x57c04b){while(--_0x57c04b){_0x2b529b['push'](_0x2b529b['shift']());}};_0x49bb0b(++_0x337af4);}(_0xc770,0x19d));var _0x0c77=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc770[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0c77('0x0'));var util=require(_0x0c77('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0c77('0x2'));var BPromise=require(_0x0c77('0x3'));var rp=require(_0x0c77('0x4'));var fs=require('fs');var path=require(_0x0c77('0x5'));var rimraf=require(_0x0c77('0x6'));var config=require(_0x0c77('0x7'));var attributes=require(_0x0c77('0x8'));module[_0x0c77('0x9')]=function(_0x101dca,_0x2a2b0f){return _0x101dca['define'](_0x0c77('0xa'),attributes,{'tableName':_0x0c77('0xb'),'paranoid':![],'indexes':[{'name':_0x0c77('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc9b9=['report_whatsapp_transfer','uniqueid','../../config/logger','api','moment','bluebird','path','../../config/environment','exports','define','WhatsappTransferReport'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xc9b9,0x1c5));var _0x9c9b=function(_0x421eeb,_0x3d3e3e){_0x421eeb=_0x421eeb-0x0;var _0x2c7371=_0xc9b9[_0x421eeb];return _0x2c7371;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9c9b('0x0'))(_0x9c9b('0x1'));var moment=require(_0x9c9b('0x2'));var BPromise=require(_0x9c9b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9c9b('0x4'));var rimraf=require('rimraf');var config=require(_0x9c9b('0x5'));var attributes=require('./whatsappTransferReport.attributes');module[_0x9c9b('0x6')]=function(_0x4d88ce,_0x554137){return _0x4d88ce[_0x9c9b('0x7')](_0x9c9b('0x8'),attributes,{'tableName':_0x9c9b('0x9'),'paranoid':![],'indexes':[{'name':_0x9c9b('0xa'),'fields':[_0x9c9b('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index b048ed1..a79bad4 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 _0x3ea3=['../../config/utils','../../config/logger','client','http','request','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x40d601,_0x1ae3e6){var _0x2b9ad6=function(_0x5f053c){while(--_0x5f053c){_0x40d601['push'](_0x40d601['shift']());}};_0x2b9ad6(++_0x1ae3e6);}(_0x3ea3,0x175));var _0x33ea=function(_0x3cbc20,_0x4a37e2){_0x3cbc20=_0x3cbc20-0x0;var _0x43c527=_0x3ea3[_0x3cbc20];return _0x43c527;};'use strict';var _=require(_0x33ea('0x0'));var util=require(_0x33ea('0x1'));var moment=require(_0x33ea('0x2'));var BPromise=require(_0x33ea('0x3'));var rs=require(_0x33ea('0x4'));var fs=require('fs');var Redis=require(_0x33ea('0x5'));var db=require(_0x33ea('0x6'))['db'];var utils=require(_0x33ea('0x7'));var logger=require(_0x33ea('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x33ea('0x9')][_0x33ea('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x157679,_0x4da21e,_0x3858df){return new BPromise(function(_0x5c8b0f,_0x1e7264){return client[_0x33ea('0xb')](_0x157679,_0x3858df)['then'](function(_0x25f8bb){logger[_0x33ea('0xc')](_0x33ea('0xd'),_0x4da21e,_0x33ea('0xe'));logger[_0x33ea('0xf')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x4da21e,'request\x20sent',JSON['stringify'](_0x25f8bb));if(_0x25f8bb['error']){if(_0x25f8bb[_0x33ea('0x10')]['code']===0x1f4){logger[_0x33ea('0x10')]('WhatsappTransferReport,\x20%s,\x20%s',_0x4da21e,_0x25f8bb[_0x33ea('0x10')]['message']);return _0x1e7264(_0x25f8bb[_0x33ea('0x10')][_0x33ea('0x11')]);}logger[_0x33ea('0x10')](_0x33ea('0xd'),_0x4da21e,_0x25f8bb[_0x33ea('0x10')][_0x33ea('0x11')]);return _0x5c8b0f(_0x25f8bb[_0x33ea('0x10')][_0x33ea('0x11')]);}else{logger[_0x33ea('0xc')](_0x33ea('0xd'),_0x4da21e,_0x33ea('0xe'));_0x5c8b0f(_0x25f8bb[_0x33ea('0x12')][_0x33ea('0x11')]);}})['catch'](function(_0x20fc57){logger[_0x33ea('0x10')](_0x33ea('0xd'),_0x4da21e,_0x20fc57);_0x1e7264(_0x20fc57);});});} \ No newline at end of file +var _0xa282=['jayson/promise','client','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','randomstring','ioredis','../../mysqldb','rpc','../../config/environment'];(function(_0xa32dea,_0x43101b){var _0x26db5f=function(_0x4abc74){while(--_0x4abc74){_0xa32dea['push'](_0xa32dea['shift']());}};_0x26db5f(++_0x43101b);}(_0xa282,0x15e));var _0x2a28=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xa282[_0x36c5b0];return _0xf19333;};'use strict';var _=require(_0x2a28('0x0'));var util=require(_0x2a28('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2a28('0x2'));var fs=require('fs');var Redis=require(_0x2a28('0x3'));var db=require(_0x2a28('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2a28('0x5'));var config=require(_0x2a28('0x6'));var jayson=require(_0x2a28('0x7'));var client=jayson[_0x2a28('0x8')][_0x2a28('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f5adb,_0x3b2b2a,_0x2385ca){return new BPromise(function(_0x2e90d4,_0x2b349d){return client[_0x2a28('0xa')](_0x2f5adb,_0x2385ca)[_0x2a28('0xb')](function(_0x398f32){logger[_0x2a28('0xc')](_0x2a28('0xd'),_0x3b2b2a,_0x2a28('0xe'));logger[_0x2a28('0xf')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x3b2b2a,'request\x20sent',JSON[_0x2a28('0x10')](_0x398f32));if(_0x398f32[_0x2a28('0x11')]){if(_0x398f32[_0x2a28('0x11')][_0x2a28('0x12')]===0x1f4){logger[_0x2a28('0x11')](_0x2a28('0xd'),_0x3b2b2a,_0x398f32[_0x2a28('0x11')]['message']);return _0x2b349d(_0x398f32[_0x2a28('0x11')][_0x2a28('0x13')]);}logger[_0x2a28('0x11')](_0x2a28('0xd'),_0x3b2b2a,_0x398f32[_0x2a28('0x11')]['message']);return _0x2e90d4(_0x398f32[_0x2a28('0x11')][_0x2a28('0x13')]);}else{logger['info']('WhatsappTransferReport,\x20%s,\x20%s',_0x3b2b2a,_0x2a28('0xe'));_0x2e90d4(_0x398f32[_0x2a28('0x14')][_0x2a28('0x13')]);}})['catch'](function(_0x78f083){logger[_0x2a28('0x11')](_0x2a28('0xd'),_0x3b2b2a,_0x78f083);_0x2b349d(_0x78f083);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 739a75c..383063a 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfd6e=['Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./config/seedDB','./rpc','./config/environment','./config/pm2/config','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','default','then','listen','info','start','filter','exitCode','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','online','Offline\x20apps:','status','join','log','App\x20Ready!','catch'];(function(_0x3e7554,_0x54396f){var _0x13ceb4=function(_0x58b4d4){while(--_0x58b4d4){_0x3e7554['push'](_0x3e7554['shift']());}};_0x13ceb4(++_0x54396f);}(_0xfd6e,0x16e));var _0xefd6=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xfd6e[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xefd6('0x0'));var db=require('./mysqldb')['db'];var seedDb=require(_0xefd6('0x1'));var checkLicense=require('./config/license');var rpc=require(_0xefd6('0x2'));var config=require(_0xefd6('0x3'));var logger=require('./config/logger')('app');var pm2=require('./config/pm2');var pm2Config=require(_0xefd6('0x4'));var schedule=require('./config/schedule');var chat=require('./config/schedule/chat');var whatsapp=require(_0xefd6('0x5'));var transcribe=require(_0xefd6('0x6'));var provider=require(_0xefd6('0x7'));function main(){return db[_0xefd6('0x8')][_0xefd6('0x9')]()['then'](function(){if(config['seedDB']){return seedDb[_0xefd6('0xa')]();}})[_0xefd6('0xb')](function(){return checkLicense[_0xefd6('0xa')]();})['then'](function(){return rpc[_0xefd6('0xc')]();})[_0xefd6('0xb')](function(_0x10fe07){logger[_0xefd6('0xd')](_0x10fe07);return chat['start']();})[_0xefd6('0xb')](function(){return whatsapp[_0xefd6('0xe')]();})[_0xefd6('0xb')](function(){return schedule[_0xefd6('0xe')]();})[_0xefd6('0xb')](function(){return transcribe[_0xefd6('0xe')]();})[_0xefd6('0xb')](function(){return provider[_0xefd6('0xe')]();})['then'](function(_0x265b8a){logger[_0xefd6('0xd')](_0x265b8a);return pm2[_0xefd6('0xe')](pm2Config);})[_0xefd6('0xb')](function(_0x1a8cc9){var _0x4bb43c=_0x1a8cc9[_0xefd6('0xf')](function(_0x4be0f8){return typeof _0x4be0f8[_0xefd6('0x10')]==='number'&&_0x4be0f8[_0xefd6('0x10')]>=0x0;});if(_0x4bb43c[_0xefd6('0x11')]>0x0){throw new Error(_0x4bb43c['length']+_0xefd6('0x12')+_[_0xefd6('0x13')](_0x4bb43c,function(_0x41e998){return'\x22'+_0x41e998[_0xefd6('0x14')][_0xefd6('0x15')]+'\x22';}));}logger[_0xefd6('0xd')](_0xefd6('0x16'),_[_0xefd6('0x13')](_[_0xefd6('0xf')](_0x1a8cc9,{'status':_0xefd6('0x17')}),_0xefd6('0x15'))['join']());logger[_0xefd6('0xd')](_0xefd6('0x18'),_[_0xefd6('0x13')](_[_0xefd6('0xf')](_0x1a8cc9,function(_0x122009){return _0x122009[_0xefd6('0x19')]!=='online';}),_0xefd6('0x15'))[_0xefd6('0x1a')]()||'None');console[_0xefd6('0x1b')](_0xefd6('0x1c'));})[_0xefd6('0x1d')](function(_0x57b184){console['log'](_0xefd6('0x1e'),_0x57b184);logger[_0xefd6('0x1f')](_0xefd6('0x20'),_0x57b184);process['exit'](0x1);});}main(); \ No newline at end of file +var _0xe0ae=['sync','seedDB','default','then','listen','info','start','filter','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','online','Offline\x20apps:','status','join','None','log','App\x20Ready!','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','exit','./config/seedDB','./config/license','./config/environment','app','./config/pm2','./config/schedule','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize'];(function(_0x2fcefd,_0x4000a7){var _0x1eb8b5=function(_0x6706f9){while(--_0x6706f9){_0x2fcefd['push'](_0x2fcefd['shift']());}};_0x1eb8b5(++_0x4000a7);}(_0xe0ae,0xa1));var _0xee0a=function(_0x591e16,_0x5aefc1){_0x591e16=_0x591e16-0x0;var _0x543b35=_0xe0ae[_0x591e16];return _0x543b35;};'use strict';var _=require('lodash');var db=require('./mysqldb')['db'];var seedDb=require(_0xee0a('0x0'));var checkLicense=require(_0xee0a('0x1'));var rpc=require('./rpc');var config=require(_0xee0a('0x2'));var logger=require('./config/logger')(_0xee0a('0x3'));var pm2=require(_0xee0a('0x4'));var pm2Config=require('./config/pm2/config');var schedule=require(_0xee0a('0x5'));var chat=require('./config/schedule/chat');var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0xee0a('0x6'));var provider=require(_0xee0a('0x7'));function main(){return db[_0xee0a('0x8')][_0xee0a('0x9')]()['then'](function(){if(config[_0xee0a('0xa')]){return seedDb['default']();}})['then'](function(){return checkLicense[_0xee0a('0xb')]();})[_0xee0a('0xc')](function(){return rpc[_0xee0a('0xd')]();})['then'](function(_0x3bc0cf){logger[_0xee0a('0xe')](_0x3bc0cf);return chat['start']();})[_0xee0a('0xc')](function(){return whatsapp['start']();})[_0xee0a('0xc')](function(){return schedule[_0xee0a('0xf')]();})['then'](function(){return transcribe[_0xee0a('0xf')]();})['then'](function(){return provider[_0xee0a('0xf')]();})[_0xee0a('0xc')](function(_0x58adf4){logger['info'](_0x58adf4);return pm2[_0xee0a('0xf')](pm2Config);})[_0xee0a('0xc')](function(_0x347604){var _0x427b5c=_0x347604[_0xee0a('0x10')](function(_0x57afe6){return typeof _0x57afe6[_0xee0a('0x11')]===_0xee0a('0x12')&&_0x57afe6['exitCode']>=0x0;});if(_0x427b5c[_0xee0a('0x13')]>0x0){throw new Error(_0x427b5c[_0xee0a('0x13')]+_0xee0a('0x14')+_[_0xee0a('0x15')](_0x427b5c,function(_0x4f711b){return'\x22'+_0x4f711b[_0xee0a('0x16')][_0xee0a('0x17')]+'\x22';}));}logger[_0xee0a('0xe')]('Online\x20apps:',_[_0xee0a('0x15')](_[_0xee0a('0x10')](_0x347604,{'status':_0xee0a('0x18')}),_0xee0a('0x17'))['join']());logger[_0xee0a('0xe')](_0xee0a('0x19'),_[_0xee0a('0x15')](_[_0xee0a('0x10')](_0x347604,function(_0x5c981e){return _0x5c981e[_0xee0a('0x1a')]!==_0xee0a('0x18');}),_0xee0a('0x17'))[_0xee0a('0x1b')]()||_0xee0a('0x1c'));console[_0xee0a('0x1d')](_0xee0a('0x1e'));})['catch'](function(_0x2ee00d){console[_0xee0a('0x1d')](_0xee0a('0x1f'),_0x2ee00d);logger[_0xee0a('0x20')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x2ee00d);process[_0xee0a('0x21')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 41b1528..3cd6980 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 _0xab13=['getUuid','then','User','sub','Setting','findOne','allowedLoginAttempts','apiKeyNonce','disabled','Invalid\x20API\x20access\x20key','blockDuration','blockedAt','add','minutes','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isWebrtcLicence','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','splice','unshift','encryptString','promisify','sign','secret','session','payload','options','randomBytes','toString','floor','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','basic-auth','crypto','util','moment','secrets','role','fullname','name','internal','email','userpic','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarPrefixRequired','phoneBarRemoteControl','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadAttachments','ignorePauseForPreviewCalls','chatAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','messengerSoundNotification','isChatInteractionAuthorized','isAuthenticated','use','ChatInteraction','closed','query','forceDownload','status','unmanaged','json','disposition','Unmanaged.','catch','headers','authorization','startsWith','Basic','find','authenticate','Wrong\x20credentials.','user','Bearer','Unknown\x20authorization\x20format'];(function(_0x243ec7,_0x5b376e){var _0x39d41f=function(_0x5647b4){while(--_0x5647b4){_0x243ec7['push'](_0x243ec7['shift']());}};_0x39d41f(++_0x5b376e);}(_0xab13,0x149));var _0x3ab1=function(_0x19737b,_0x212909){_0x19737b=_0x19737b-0x0;var _0x16329e=_0xab13[_0x19737b];return _0x16329e;};'use strict';var db=require(_0x3ab1('0x0'))['db'];var config=require(_0x3ab1('0x1'));var hardwareConf=require(_0x3ab1('0x2'));var licenseUtil=require(_0x3ab1('0x3'));var encryptor=require(_0x3ab1('0x4'));var _=require(_0x3ab1('0x5'));var jwt=require(_0x3ab1('0x6'));var expressJwt=require(_0x3ab1('0x7'));var compose=require('composable-middleware');var basicAuth=require(_0x3ab1('0x8'));var crypto=require(_0x3ab1('0x9'));var BPromise=require('bluebird');var util=require(_0x3ab1('0xa'));var moment=require(_0x3ab1('0xb'));var validateJwt=expressJwt({'secret':config[_0x3ab1('0xc')]['session']});var userAttributes=['id',_0x3ab1('0xd'),_0x3ab1('0xe'),_0x3ab1('0xf'),_0x3ab1('0x10'),_0x3ab1('0x11'),_0x3ab1('0x12'),'permissions',_0x3ab1('0x13'),_0x3ab1('0x14'),_0x3ab1('0x15'),_0x3ab1('0x16'),_0x3ab1('0x17'),_0x3ab1('0x18'),_0x3ab1('0x19'),'pauseType',_0x3ab1('0x1a'),_0x3ab1('0x1b'),_0x3ab1('0x1c'),_0x3ab1('0x1d'),_0x3ab1('0x1e'),_0x3ab1('0x1f'),'alias',_0x3ab1('0x20'),'phoneBarAutoAnswerDelay',_0x3ab1('0x21'),'phoneBarEnableRecording',_0x3ab1('0x22'),'phoneBarEnableSettings','phoneBarExpires',_0x3ab1('0x23'),_0x3ab1('0x24'),'phoneBarRemoteControlPort',_0x3ab1('0x25'),_0x3ab1('0x26'),_0x3ab1('0x27'),_0x3ab1('0x28'),_0x3ab1('0x29'),_0x3ab1('0x2a'),_0x3ab1('0x2b'),'downloadOmnichannelInteractions',_0x3ab1('0x2c'),_0x3ab1('0x2d'),'selectRecallMeCampaign','chatAutoanswer',_0x3ab1('0x2e'),'emailAutoanswer','emailAutoanswerDelay',_0x3ab1('0x2f'),_0x3ab1('0x30'),_0x3ab1('0x31'),_0x3ab1('0x32'),_0x3ab1('0x33'),'faxAutoanswerDelay','whatsappAutoanswer','whatsappAutoanswerDelay',_0x3ab1('0x34')];exports[_0x3ab1('0x35')]=function(){return this[_0x3ab1('0x36')](!![])[_0x3ab1('0x37')](function(_0x113595,_0x5dd0e8,_0x457539){if(_0x113595['user']){_0x457539();}else{return db[_0x3ab1('0x38')]['findOne']({'where':{'id':_0x113595['params']['id']},'attributes':['id',_0x3ab1('0x39'),'disposition'],'raw':!![]})['then'](function(_0x4741ed){if(_0x4741ed&&_0x4741ed[_0x3ab1('0x39')]&&!_0x113595[_0x3ab1('0x3a')][_0x3ab1('0x3b')]){return _0x5dd0e8[_0x3ab1('0x3c')](_0x4741ed['disposition']===_0x3ab1('0x3d')?0x195:0x193)[_0x3ab1('0x3e')]({'message':_0x4741ed[_0x3ab1('0x3f')]===_0x3ab1('0x3d')?_0x3ab1('0x40'):'Forbidden.'});}else{_0x457539();}})[_0x3ab1('0x41')](function(_0x283901){_0x457539(_0x283901);});}});};exports[_0x3ab1('0x36')]=function isAuthenticated(_0x5a0778){return compose()[_0x3ab1('0x37')](function(_0x42f4cf,_0x3f3cec,_0x4bd9f3){var _0x23a4cd;if(_0x42f4cf[_0x3ab1('0x42')][_0x3ab1('0x43')]){if(_[_0x3ab1('0x44')](_0x42f4cf[_0x3ab1('0x42')][_0x3ab1('0x43')],_0x3ab1('0x45'))){var _0x59b888=basicAuth(_0x42f4cf);db['User'][_0x3ab1('0x46')]({'where':{'name':_0x59b888['name']}})['then'](function(_0x5220fa){if(!_0x5220fa||!_0x5220fa[_0x3ab1('0x47')](_0x59b888['pass'])){return _0x3f3cec[_0x3ab1('0x3c')](0x191)['json']({'message':_0x3ab1('0x48')});}_0x42f4cf[_0x3ab1('0x49')]={'id':_0x5220fa['id']};_0x4bd9f3();})[_0x3ab1('0x41')](function(_0x458525){_0x4bd9f3(_0x458525);});}else if(_['startsWith'](_0x42f4cf[_0x3ab1('0x42')][_0x3ab1('0x43')],_0x3ab1('0x4a'))){validateJwt(_0x42f4cf,_0x3f3cec,_0x4bd9f3);}else{if(_0x5a0778){_0x4bd9f3();}else{return _0x3f3cec['status'](0x193)[_0x3ab1('0x3e')]({'message':_0x3ab1('0x4b')});}}}else if(_0x42f4cf[_0x3ab1('0x3a')]['apikey']){try{var _0x4275d6={'audience':hardwareConf[_0x3ab1('0x4c')](),'issuer':hardwareConf[_0x3ab1('0x4c')]()};verifyJwt(_0x42f4cf[_0x3ab1('0x3a')]['apikey'],_0x4275d6)[_0x3ab1('0x4d')](function(_0x5172f3){return db[_0x3ab1('0x4e')][_0x3ab1('0x46')]({'where':{'id':_0x5172f3[_0x3ab1('0x4f')]}})[_0x3ab1('0x4d')](function(_0x3c5707){_0x23a4cd=_0x3c5707;return db[_0x3ab1('0x50')][_0x3ab1('0x51')]({'where':{'id':0x1},'attributes':[_0x3ab1('0x52'),'blockDuration'],'raw':!![]});})[_0x3ab1('0x4d')](function(_0x55ba7d){if(!_0x23a4cd||!_['isEqual'](_0x23a4cd[_0x3ab1('0x53')],_0x5172f3['nonce'])){return _0x3f3cec[_0x3ab1('0x3c')](0x191)[_0x3ab1('0x3e')]({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x23a4cd[_0x3ab1('0x54')]){return _0x3f3cec[_0x3ab1('0x3c')](0x191)[_0x3ab1('0x3e')]({'message':_0x3ab1('0x55')});}if(_0x23a4cd['blocked']){if(_0x55ba7d[_0x3ab1('0x56')]>0x0){if(moment(_0x23a4cd[_0x3ab1('0x57')])[_0x3ab1('0x58')](_0x55ba7d[_0x3ab1('0x56')],_0x3ab1('0x59'))>moment()){return _0x3f3cec[_0x3ab1('0x3c')](0x191)[_0x3ab1('0x3e')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x3f3cec[_0x3ab1('0x3c')](0x191)[_0x3ab1('0x3e')]({'message':_0x3ab1('0x55')});}}_0x42f4cf[_0x3ab1('0x49')]={'id':_0x23a4cd['id']};_0x4bd9f3();});})[_0x3ab1('0x41')](function(){return _0x3f3cec['status'](0x191)[_0x3ab1('0x3e')]({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x2423a7){_0x4bd9f3(_0x2423a7);}}else if(_0x5a0778){_0x4bd9f3();}else{return _0x3f3cec[_0x3ab1('0x3c')](0x193)[_0x3ab1('0x3e')]({'message':_0x3ab1('0x4b')});}})[_0x3ab1('0x37')](function(_0x3be592,_0x568692,_0x52623c){if(_0x3be592[_0x3ab1('0x49')]){db[_0x3ab1('0x4e')][_0x3ab1('0x46')]({'where':{'id':_0x3be592[_0x3ab1('0x49')]['id']},'attributes':userAttributes})['then'](function(_0xc6413c){if(!_0xc6413c){return _0x568692[_0x3ab1('0x3c')](0x194)['json']({'message':_0x3ab1('0x5a')});}_0x3be592[_0x3ab1('0x49')]=_0xc6413c;_0x52623c();})[_0x3ab1('0x41')](function(_0x3b31c0){_0x52623c(_0x3b31c0);});}else if(_0x5a0778){_0x52623c();}else{return _0x568692['status'](0x194)[_0x3ab1('0x3e')]({'message':_0x3ab1('0x5b')});}});};exports[_0x3ab1('0x5c')]=function canUpdate(){return compose()[_0x3ab1('0x37')](function(_0x24b372,_0x4c945f,_0x39effd){return licenseUtil[_0x3ab1('0x5d')]()[_0x3ab1('0x4d')](function(_0x198520){if(_0x198520[_0x3ab1('0x5e')]){_0x39effd();}else{return _0x4c945f['status'](0x193)[_0x3ab1('0x3e')]({'message':_0x3ab1('0x5f')});}})[_0x3ab1('0x41')](function(_0x3f82c1){_0x39effd(_0x3f82c1);});});};exports[_0x3ab1('0x60')]=function isWebrtcLicence(){return compose()[_0x3ab1('0x37')](function(_0x1e76fc,_0x57e4a3,_0xa13124){return licenseUtil['getLicense']()['then'](function(_0x561587){if(_0x561587['webrtc']){_0xa13124();}else{return _0x57e4a3['status'](0x193)['json']({'message':_0x3ab1('0x5f')});}})['catch'](function(_0x516ebc){_0xa13124(_0x516ebc);});});};exports[_0x3ab1('0x61')]=function(_0x279a60,_0x326399,_0x13f775){_0x279a60[_0x3ab1('0x61')]=!![];return _0x13f775();};exports[_0x3ab1('0x62')]=function signToken(_0x7f24ed){return signJwt(_0x7f24ed);};exports[_0x3ab1('0x63')]=function(_0x4a47cd,_0xfaec62){if(!_0x4a47cd[_0x3ab1('0x49')]){return _0xfaec62[_0x3ab1('0x3c')](0x194)['json']({'message':_0x3ab1('0x64')});}var _0x11b99a={'payload':{'id':_0x4a47cd[_0x3ab1('0x49')]['id'],'role':_0x4a47cd['user'][_0x3ab1('0xd')]},'options':{'expiresIn':0x15180}};return signJwt(_0x11b99a)[_0x3ab1('0x4d')](function(_0x90385d){_0xfaec62['cookie']('motion.token',_0x90385d);_0xfaec62[_0x3ab1('0x65')](_0x3ab1('0x66'));})['catch'](function(_0x3b34ee){return _0xfaec62['status'](0x1f4)[_0x3ab1('0x67')](_0x3b34ee);});};exports[_0x3ab1('0x68')]=function(_0x4edcb8){if(_[_0x3ab1('0x69')](_0x4edcb8[_0x3ab1('0x53')])||_['isNil'](_0x4edcb8[_0x3ab1('0x6a')])){return null;}else{return createJwt(_0x4edcb8);}};exports['generateApiKey']=function(_0xf5fd05){_0xf5fd05[_0x3ab1('0x53')]=generateNonce();_0xf5fd05[_0x3ab1('0x6a')]=generateIssuedAt();return createJwt(_0xf5fd05);};exports[_0x3ab1('0x6b')]=function(_0x3ce0b6,_0x361e19){var _0x2dcb7d=_0x3ce0b6[_0x3ab1('0x3a')]['apikey'];if(_0x2dcb7d){var _0x2c31aa={'nonce':_0x361e19['apiKeyNonce'],'iat':_0x361e19['apiKeyIat'],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x3ab1('0x4c')]()};return verifyJwt(_0x2dcb7d,_0x2c31aa)[_0x3ab1('0x4d')](function(){return generateApiKey(_0x361e19);});}else{throw{'message':_0x3ab1('0x6c')};}};exports[_0x3ab1('0x6d')]=function(_0x48cd32){var _0x59e91d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x59e91d[_0x3ab1('0x6e')](_0x48cd32))throw new db[(_0x3ab1('0x6f'))][(_0x3ab1('0x70'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports[_0x3ab1('0x71')]=function(_0x3ae8b1,_0x31897d,_0x5b4a7f){var _0x1ddaf1=encryptor[_0x3ab1('0x72')](_0x31897d)[_0x3ab1('0x73')](',');for(var _0x57b356=0x0;_0x57b356<_0x5b4a7f;_0x57b356++){if(!_0x1ddaf1[_0x57b356])break;if(_0x3ae8b1['toLowerCase']()===_0x1ddaf1[_0x57b356][_0x3ab1('0x74')]()){var _0x78de26=util[_0x3ab1('0x75')](_0x3ab1('0x76'),_0x5b4a7f);if(_0x5b4a7f===0x1){_0x78de26='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db['Sequelize'][(_0x3ab1('0x70'))](_0x78de26);}}return;};exports[_0x3ab1('0x77')]=function(_0x2951fb,_0x504c9d){var _0x13cb9a=_0x504c9d?encryptor[_0x3ab1('0x72')](_0x504c9d)['split'](','):[];if(_0x13cb9a[_0x3ab1('0x78')]===0x5){_0x13cb9a[_0x3ab1('0x79')](-0x1,0x1);}_0x13cb9a[_0x3ab1('0x7a')](_0x2951fb);return encryptor[_0x3ab1('0x7b')](_0x13cb9a['join'](','));};function signJwt(_0x42d8ba){var _0x5a0811=BPromise[_0x3ab1('0x7c')](jwt[_0x3ab1('0x7d')],{'context':jwt});var _0x3a4698=_0x42d8ba[_0x3ab1('0x7e')]||config['secrets'][_0x3ab1('0x7f')];return new BPromise(function(_0x59e8a4,_0x3fb36){_0x5a0811(_0x42d8ba[_0x3ab1('0x80')],_0x3a4698,_0x42d8ba[_0x3ab1('0x81')])['then'](function(_0x348d05){_0x59e8a4(_0x348d05);})[_0x3ab1('0x41')](function(_0x2cede6){_0x3fb36(_0x2cede6);});});}function verifyJwt(_0x4f97ea,_0x4d87da,_0x236458){var _0x36eab7=BPromise['promisify'](jwt['verify'],{'context':jwt});var _0x295338=_0x236458||config[_0x3ab1('0xc')]['session'];return new BPromise(function(_0x733de8,_0x2ac358){_0x36eab7(_0x4f97ea,_0x295338,_0x4d87da)[_0x3ab1('0x4d')](function(_0x4c2046){_0x733de8(_0x4c2046);})['catch'](function(_0x551641){_0x2ac358(_0x551641);});});}function generateNonce(){return crypto[_0x3ab1('0x82')](0x10)[_0x3ab1('0x83')]('hex');}function generateIssuedAt(){return Math[_0x3ab1('0x84')](Date[_0x3ab1('0x85')]()/0x3e8)[_0x3ab1('0x83')]();}function createJwt(_0x54b8cc){var _0x287932={'payload':{'iat':_0x54b8cc[_0x3ab1('0x6a')],'nonce':_0x54b8cc[_0x3ab1('0x53')]},'options':{'algorithm':_0x3ab1('0x86'),'subject':_0x54b8cc['id'][_0x3ab1('0x83')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x287932)['then'](function(_0xf152db){return{'iat':_0x54b8cc['apiKeyIat'],'nonce':_0x54b8cc[_0x3ab1('0x53')],'token':_0xf152db};});} \ No newline at end of file +var _0x6316=['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','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','splice','unshift','encryptString','join','promisify','sign','secret','payload','options','verify','toString','floor','now','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','basic-auth','crypto','bluebird','moment','secrets','session','role','fullname','name','internal','email','userpic','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','selectRecallMeCampaign','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswerDelay','faxAutoanswerDelay','whatsappAutoanswerDelay','messengerSoundNotification','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','params','disposition','then','query','status','unmanaged','json','Unmanaged.','Forbidden.','catch','headers','authorization','startsWith','Basic','User','find','pass','Wrong\x20credentials.','apikey','getUuid','Setting','findOne','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes','Unknown\x20authorization\x20format','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','send','retrieveApiKey','isNil','apiKeyIat','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'];(function(_0x5b606d,_0xf92a5e){var _0x2a4a23=function(_0x372683){while(--_0x372683){_0x5b606d['push'](_0x5b606d['shift']());}};_0x2a4a23(++_0xf92a5e);}(_0x6316,0xa6));var _0x6631=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6316[_0x501510];return _0x1e6ee5;};'use strict';var db=require(_0x6631('0x0'))['db'];var config=require(_0x6631('0x1'));var hardwareConf=require(_0x6631('0x2'));var licenseUtil=require(_0x6631('0x3'));var encryptor=require(_0x6631('0x4'));var _=require(_0x6631('0x5'));var jwt=require(_0x6631('0x6'));var expressJwt=require('express-jwt');var compose=require('composable-middleware');var basicAuth=require(_0x6631('0x7'));var crypto=require(_0x6631('0x8'));var BPromise=require(_0x6631('0x9'));var util=require('util');var moment=require(_0x6631('0xa'));var validateJwt=expressJwt({'secret':config[_0x6631('0xb')][_0x6631('0xc')]});var userAttributes=['id',_0x6631('0xd'),_0x6631('0xe'),_0x6631('0xf'),_0x6631('0x10'),_0x6631('0x11'),_0x6631('0x12'),'permissions','md5secret','voicePause',_0x6631('0x13'),_0x6631('0x14'),_0x6631('0x15'),_0x6631('0x16'),_0x6631('0x17'),_0x6631('0x18'),_0x6631('0x19'),_0x6631('0x1a'),_0x6631('0x1b'),_0x6631('0x1c'),_0x6631('0x1d'),_0x6631('0x1e'),_0x6631('0x1f'),_0x6631('0x20'),_0x6631('0x21'),_0x6631('0x22'),'phoneBarEnableRecording',_0x6631('0x23'),_0x6631('0x24'),_0x6631('0x25'),_0x6631('0x26'),_0x6631('0x27'),_0x6631('0x28'),_0x6631('0x29'),_0x6631('0x2a'),_0x6631('0x2b'),_0x6631('0x2c'),_0x6631('0x2d'),_0x6631('0x2e'),_0x6631('0x2f'),_0x6631('0x30'),'downloadAttachments','ignorePauseForPreviewCalls',_0x6631('0x31'),'chatAutoanswer',_0x6631('0x32'),_0x6631('0x33'),_0x6631('0x34'),_0x6631('0x35'),_0x6631('0x36'),'openchannelAutoanswer',_0x6631('0x37'),'faxAutoanswer',_0x6631('0x38'),'whatsappAutoanswer',_0x6631('0x39'),_0x6631('0x3a')];exports[_0x6631('0x3b')]=function(){return this[_0x6631('0x3c')](!![])[_0x6631('0x3d')](function(_0x428545,_0x12d710,_0x1bf5a3){if(_0x428545[_0x6631('0x3e')]){_0x1bf5a3();}else{return db[_0x6631('0x3f')]['findOne']({'where':{'id':_0x428545[_0x6631('0x40')]['id']},'attributes':['id','closed',_0x6631('0x41')],'raw':!![]})[_0x6631('0x42')](function(_0x2cc145){if(_0x2cc145&&_0x2cc145['closed']&&!_0x428545[_0x6631('0x43')]['forceDownload']){return _0x12d710[_0x6631('0x44')](_0x2cc145[_0x6631('0x41')]===_0x6631('0x45')?0x195:0x193)[_0x6631('0x46')]({'message':_0x2cc145[_0x6631('0x41')]===_0x6631('0x45')?_0x6631('0x47'):_0x6631('0x48')});}else{_0x1bf5a3();}})[_0x6631('0x49')](function(_0x3826a6){_0x1bf5a3(_0x3826a6);});}});};exports[_0x6631('0x3c')]=function isAuthenticated(_0x3f214a){return compose()['use'](function(_0x3b1ec1,_0x1c857e,_0x4fbc19){var _0x3e903c;if(_0x3b1ec1[_0x6631('0x4a')][_0x6631('0x4b')]){if(_[_0x6631('0x4c')](_0x3b1ec1['headers'][_0x6631('0x4b')],_0x6631('0x4d'))){var _0x74b614=basicAuth(_0x3b1ec1);db[_0x6631('0x4e')][_0x6631('0x4f')]({'where':{'name':_0x74b614[_0x6631('0xf')]}})[_0x6631('0x42')](function(_0x2aacd2){if(!_0x2aacd2||!_0x2aacd2['authenticate'](_0x74b614[_0x6631('0x50')])){return _0x1c857e[_0x6631('0x44')](0x191)['json']({'message':_0x6631('0x51')});}_0x3b1ec1[_0x6631('0x3e')]={'id':_0x2aacd2['id']};_0x4fbc19();})['catch'](function(_0x37d633){_0x4fbc19(_0x37d633);});}else if(_[_0x6631('0x4c')](_0x3b1ec1[_0x6631('0x4a')][_0x6631('0x4b')],'Bearer')){validateJwt(_0x3b1ec1,_0x1c857e,_0x4fbc19);}else{if(_0x3f214a){_0x4fbc19();}else{return _0x1c857e[_0x6631('0x44')](0x193)[_0x6631('0x46')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x3b1ec1[_0x6631('0x43')][_0x6631('0x52')]){try{var _0x2713de={'audience':hardwareConf[_0x6631('0x53')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x3b1ec1[_0x6631('0x43')]['apikey'],_0x2713de)[_0x6631('0x42')](function(_0x11625){return db[_0x6631('0x4e')][_0x6631('0x4f')]({'where':{'id':_0x11625['sub']}})[_0x6631('0x42')](function(_0x192b0b){_0x3e903c=_0x192b0b;return db[_0x6631('0x54')][_0x6631('0x55')]({'where':{'id':0x1},'attributes':[_0x6631('0x56'),_0x6631('0x57')],'raw':!![]});})[_0x6631('0x42')](function(_0x32ab50){if(!_0x3e903c||!_[_0x6631('0x58')](_0x3e903c[_0x6631('0x59')],_0x11625['nonce'])){return _0x1c857e[_0x6631('0x44')](0x191)[_0x6631('0x46')]({'message':_0x6631('0x5a')});}if(_0x3e903c[_0x6631('0x5b')]){return _0x1c857e[_0x6631('0x44')](0x191)[_0x6631('0x46')]({'message':_0x6631('0x5c')});}if(_0x3e903c[_0x6631('0x5d')]){if(_0x32ab50[_0x6631('0x57')]>0x0){if(moment(_0x3e903c[_0x6631('0x5e')])[_0x6631('0x5f')](_0x32ab50[_0x6631('0x57')],_0x6631('0x60'))>moment()){return _0x1c857e[_0x6631('0x44')](0x191)[_0x6631('0x46')]({'message':_0x6631('0x5c')});}}else{return _0x1c857e[_0x6631('0x44')](0x191)['json']({'message':_0x6631('0x5c')});}}_0x3b1ec1['user']={'id':_0x3e903c['id']};_0x4fbc19();});})['catch'](function(){return _0x1c857e[_0x6631('0x44')](0x191)['json']({'message':_0x6631('0x5c')});});}catch(_0x1f79d8){_0x4fbc19(_0x1f79d8);}}else if(_0x3f214a){_0x4fbc19();}else{return _0x1c857e[_0x6631('0x44')](0x193)[_0x6631('0x46')]({'message':_0x6631('0x61')});}})['use'](function(_0x100c08,_0x28273e,_0x5b935c){if(_0x100c08[_0x6631('0x3e')]){db[_0x6631('0x4e')]['find']({'where':{'id':_0x100c08[_0x6631('0x3e')]['id']},'attributes':userAttributes})[_0x6631('0x42')](function(_0x5ae2b5){if(!_0x5ae2b5){return _0x28273e[_0x6631('0x44')](0x194)['json']({'message':_0x6631('0x62')});}_0x100c08['user']=_0x5ae2b5;_0x5b935c();})[_0x6631('0x49')](function(_0x2b328d){_0x5b935c(_0x2b328d);});}else if(_0x3f214a){_0x5b935c();}else{return _0x28273e['status'](0x194)[_0x6631('0x46')]({'message':_0x6631('0x63')});}});};exports[_0x6631('0x64')]=function canUpdate(){return compose()[_0x6631('0x3d')](function(_0x1488cb,_0x324ddd,_0x5d5bf2){return licenseUtil[_0x6631('0x65')]()[_0x6631('0x42')](function(_0x3f8d00){if(_0x3f8d00[_0x6631('0x66')]){_0x5d5bf2();}else{return _0x324ddd[_0x6631('0x44')](0x193)[_0x6631('0x46')]({'message':_0x6631('0x67')});}})[_0x6631('0x49')](function(_0x23ab22){_0x5d5bf2(_0x23ab22);});});};exports[_0x6631('0x68')]=function isWebrtcLicence(){return compose()['use'](function(_0x4367fd,_0x159376,_0x36e291){return licenseUtil[_0x6631('0x65')]()[_0x6631('0x42')](function(_0x4a7738){if(_0x4a7738[_0x6631('0x69')]){_0x36e291();}else{return _0x159376[_0x6631('0x44')](0x193)['json']({'message':_0x6631('0x67')});}})[_0x6631('0x49')](function(_0x59b9f6){_0x36e291(_0x59b9f6);});});};exports[_0x6631('0x6a')]=function(_0x4dee7f,_0x47baf6,_0x5dff7f){_0x4dee7f[_0x6631('0x6a')]=!![];return _0x5dff7f();};exports[_0x6631('0x6b')]=function signToken(_0x2957e1){return signJwt(_0x2957e1);};exports[_0x6631('0x6c')]=function(_0xcb7481,_0x4cab5b){if(!_0xcb7481[_0x6631('0x3e')]){return _0x4cab5b[_0x6631('0x44')](0x194)['json']({'message':_0x6631('0x6d')});}var _0x31f992={'payload':{'id':_0xcb7481[_0x6631('0x3e')]['id'],'role':_0xcb7481[_0x6631('0x3e')][_0x6631('0xd')]},'options':{'expiresIn':0x15180}};return signJwt(_0x31f992)['then'](function(_0x16e5ad){_0x4cab5b[_0x6631('0x6e')](_0x6631('0x6f'),_0x16e5ad);_0x4cab5b[_0x6631('0x70')]('/dashboards/general');})['catch'](function(_0x1b9259){return _0x4cab5b[_0x6631('0x44')](0x1f4)[_0x6631('0x71')](_0x1b9259);});};exports[_0x6631('0x72')]=function(_0x506b51){if(_[_0x6631('0x73')](_0x506b51[_0x6631('0x59')])||_[_0x6631('0x73')](_0x506b51[_0x6631('0x74')])){return null;}else{return createJwt(_0x506b51);}};exports['generateApiKey']=function(_0x4b735d){_0x4b735d['apiKeyNonce']=generateNonce();_0x4b735d[_0x6631('0x74')]=generateIssuedAt();return createJwt(_0x4b735d);};exports['regenerateApiKey']=function(_0x2289e8,_0x3beae0){var _0x537f55=_0x2289e8[_0x6631('0x43')]['apikey'];if(_0x537f55){var _0x3cc25c={'nonce':_0x3beae0[_0x6631('0x59')],'iat':_0x3beae0[_0x6631('0x74')],'audience':hardwareConf[_0x6631('0x53')](),'issuer':hardwareConf[_0x6631('0x53')]()};return verifyJwt(_0x537f55,_0x3cc25c)[_0x6631('0x42')](function(){return generateApiKey(_0x3beae0);});}else{throw{'message':_0x6631('0x75')};}};exports[_0x6631('0x76')]=function(_0x51acba){var _0xf84f5f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0xf84f5f[_0x6631('0x77')](_0x51acba))throw new db[(_0x6631('0x78'))][(_0x6631('0x79'))](_0x6631('0x7a'));return;};exports[_0x6631('0x7b')]=function(_0x18ef8,_0x2db744,_0x529475){var _0x4d7357=encryptor[_0x6631('0x7c')](_0x2db744)[_0x6631('0x7d')](',');for(var _0x1bab28=0x0;_0x1bab28<_0x529475;_0x1bab28++){if(!_0x4d7357[_0x1bab28])break;if(_0x18ef8['toLowerCase']()===_0x4d7357[_0x1bab28]['toLowerCase']()){var _0xea9192=util[_0x6631('0x7e')](_0x6631('0x7f'),_0x529475);if(_0x529475===0x1){_0xea9192=_0x6631('0x80');}throw new db[(_0x6631('0x78'))]['ValidationError'](_0xea9192);}}return;};exports['updatePasswordsHistory']=function(_0x2fe3d8,_0x6e4969){var _0x5ac229=_0x6e4969?encryptor[_0x6631('0x7c')](_0x6e4969)['split'](','):[];if(_0x5ac229['length']===0x5){_0x5ac229[_0x6631('0x81')](-0x1,0x1);}_0x5ac229[_0x6631('0x82')](_0x2fe3d8);return encryptor[_0x6631('0x83')](_0x5ac229[_0x6631('0x84')](','));};function signJwt(_0x4b826d){var _0x1731f6=BPromise[_0x6631('0x85')](jwt[_0x6631('0x86')],{'context':jwt});var _0x2fbdf8=_0x4b826d[_0x6631('0x87')]||config['secrets'][_0x6631('0xc')];return new BPromise(function(_0x79218b,_0x6e5648){_0x1731f6(_0x4b826d[_0x6631('0x88')],_0x2fbdf8,_0x4b826d[_0x6631('0x89')])[_0x6631('0x42')](function(_0x1bfba3){_0x79218b(_0x1bfba3);})[_0x6631('0x49')](function(_0x3ee121){_0x6e5648(_0x3ee121);});});}function verifyJwt(_0x2f31df,_0x529d91,_0x434314){var _0x4ad4ec=BPromise[_0x6631('0x85')](jwt[_0x6631('0x8a')],{'context':jwt});var _0x318903=_0x434314||config[_0x6631('0xb')][_0x6631('0xc')];return new BPromise(function(_0x1f02ea,_0x3e2691){_0x4ad4ec(_0x2f31df,_0x318903,_0x529d91)['then'](function(_0x54702a){_0x1f02ea(_0x54702a);})[_0x6631('0x49')](function(_0x5be7f8){_0x3e2691(_0x5be7f8);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0x6631('0x8b')]('hex');}function generateIssuedAt(){return Math[_0x6631('0x8c')](Date[_0x6631('0x8d')]()/0x3e8)[_0x6631('0x8b')]();}function createJwt(_0x4df441){var _0x1059b8={'payload':{'iat':_0x4df441['apiKeyIat'],'nonce':_0x4df441[_0x6631('0x59')]},'options':{'algorithm':'HS512','subject':_0x4df441['id']['toString'](),'issuer':hardwareConf[_0x6631('0x53')](),'audience':hardwareConf[_0x6631('0x53')]()}};return signJwt(_0x1059b8)[_0x6631('0x42')](function(_0x1b9c1b){return{'iat':_0x4df441[_0x6631('0x74')],'nonce':_0x4df441[_0x6631('0x59')],'token':_0x1b9c1b};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index 98996e0..0373b2e 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 _0x040a=['map','lodash','./sql-utils','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','default','filter','where','clause','user','tag','countFilteredContacts','count','fields','getFilteredContacts','rows','catch','describe','CmContact','keys','cf_','all','length','fieldType','type'];(function(_0x386c3e,_0x44a375){var _0x4b8e13=function(_0x583c8f){while(--_0x583c8f){_0x386c3e['push'](_0x386c3e['shift']());}};_0x4b8e13(++_0x44a375);}(_0x040a,0x175));var _0xa040=function(_0x4cfc1d,_0x2c0927){_0x4cfc1d=_0x4cfc1d-0x0;var _0x1c01a0=_0x040a[_0x4cfc1d];return _0x1c01a0;};'use strict';var _=require(_0xa040('0x0'));var sqlUtils=require(_0xa040('0x1'));var db=require(_0xa040('0x2'))['db'];exports[_0xa040('0x3')]=function(_0x1abd28,_0x10c0f2,_0x1d91d6,_0x255589){var _0x342c07={'count':0x0,'rows':[]};var _0x566be2=sqlUtils[_0xa040('0x4')](_0x10c0f2,_0x1abd28);if(_0x566be2){return Promise[_0xa040('0x5')](_0x342c07);}var _0x5e7096=sqlUtils[_0xa040('0x6')]();var _0x4db07e={};var _0x107be6=![];var _0x2cedff=![];return Promise['resolve']()[_0xa040('0x7')](function(){if(_0x1abd28[_0xa040('0x8')]){return sqlUtils[_0xa040('0x9')](_0x1abd28[_0xa040('0x8')],_0x255589);}else{return sqlUtils['parseQueryParameters'](_0x1abd28,_0x255589);}})['then'](function(_0x29e67f){_0x5e7096['where'](_0x29e67f[_0xa040('0xa')]);_0x5e7096['where'](_0x29e67f['fields']);_0x5e7096['where'](_0x29e67f[_0xa040('0xb')]);_0x5e7096[_0xa040('0xc')](_0x29e67f['user'][_0xa040('0xd')]);_0x4db07e=_0x29e67f['tags'];_0x2cedff=_0x29e67f[_0xa040('0xe')]['skip'];return sqlUtils['checkListsRestrictions'](_0x10c0f2,_0x1abd28,_0x2cedff);})[_0xa040('0x7')](function(_0x2f1441){_0x5e7096[_0xa040('0xc')](_0x2f1441);var _0x5f0960=_0x1abd28['search']?_0x4db07e['ids']:_0x1abd28[_0xa040('0xf')];_0x107be6=_0x5f0960?!![]:![];return sqlUtils[_0xa040('0x10')](_0x5e7096,_0x5f0960);})[_0xa040('0x7')](function(_0x2bc54d){_0x342c07[_0xa040('0x11')]=_0x2bc54d;if(_0x342c07[_0xa040('0x11')]===0x0){return;}if(_0x1abd28['User']){_0x2cedff=!![];}return sqlUtils['buildContactsQuery'](_0x5e7096,_0x1abd28[_0xa040('0x12')],_0x1d91d6,_0x107be6,_0x4db07e[_0xa040('0xd')],_0x2cedff);})[_0xa040('0x7')](function(_0x28a1b7){if(!_0x28a1b7){return[];}return sqlUtils[_0xa040('0x13')](_0x28a1b7,_0x1abd28,_0x1d91d6);})[_0xa040('0x7')](function(_0x5cd25e){_0x342c07[_0xa040('0x14')]=_0x5cd25e;return _0x342c07;})[_0xa040('0x15')](function(_0x1bb84c){throw _0x1bb84c;});};exports[_0xa040('0x16')]=function(){var _0xa55dc4={};var _0xb83c24=[];return db[_0xa040('0x17')][_0xa040('0x16')]()[_0xa040('0x7')](function(_0x4b1435){_0xa55dc4=_0x4b1435;var _0x3f36dd=Object[_0xa040('0x18')](_0xa55dc4)[_0xa040('0xb')](function(_0x24d493){return _['startsWith'](_0x24d493,_0xa040('0x19'))?_0x24d493:undefined;});var _0x14c02e=_0x3f36dd['map'](function(_0x4cca61){return db['CmCustomField']['findOne']({'where':{'id':_0x4cca61['slice'](0x3)},'raw':!![]});});return Promise[_0xa040('0x1a')](_0x14c02e);})[_0xa040('0x7')](function(_0x3775a4){for(var _0x8fda45=0x0;_0x8fda45<_0x3775a4[_0xa040('0x1b')];_0x8fda45++){if(_0x3775a4[_0x8fda45]){var _0x37f742=_0xa040('0x19')+_0x3775a4[_0x8fda45]['id'];_0xa55dc4[_0x37f742][_0xa040('0x1c')]=_0x3775a4[_0x8fda45][_0xa040('0x1d')];}}_0xb83c24=_[_0xa040('0x1e')](Object[_0xa040('0x18')](_0xa55dc4),function(_0x44d1c9){return{'name':_0x44d1c9,'type':_0xa55dc4[_0x44d1c9][_0xa040('0x1d')]};});return _0xb83c24;})['catch'](function(_0x13a743){throw _0x13a743;});}; \ No newline at end of file +var _0xd719=['./sql-utils','../../mysqldb','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','where','default','fields','filter','user','clause','tags','skip','checkListsRestrictions','tag','countFilteredContacts','count','User','getFilteredContacts','catch','describe','CmContact','cf_','CmCustomField','findOne','all','length','type','keys'];(function(_0x53f1aa,_0x27d8e3){var _0x1833b5=function(_0x388f2){while(--_0x388f2){_0x53f1aa['push'](_0x53f1aa['shift']());}};_0x1833b5(++_0x27d8e3);}(_0xd719,0x155));var _0x9d71=function(_0x210ddf,_0x3d367f){_0x210ddf=_0x210ddf-0x0;var _0x2f611b=_0xd719[_0x210ddf];return _0x2f611b;};'use strict';var _=require('lodash');var sqlUtils=require(_0x9d71('0x0'));var db=require(_0x9d71('0x1'))['db'];exports['findAll']=function(_0x4c16eb,_0x17228f,_0x420ae0,_0x2f7bc0){var _0x36fa55={'count':0x0,'rows':[]};var _0x545925=sqlUtils['skipContactsQuery'](_0x17228f,_0x4c16eb);if(_0x545925){return Promise[_0x9d71('0x2')](_0x36fa55);}var _0x9950d=sqlUtils[_0x9d71('0x3')]();var _0x9d7536={};var _0x4bf5d1=![];var _0x1126ce=![];return Promise[_0x9d71('0x2')]()[_0x9d71('0x4')](function(){if(_0x4c16eb[_0x9d71('0x5')]){return sqlUtils[_0x9d71('0x6')](_0x4c16eb[_0x9d71('0x5')],_0x2f7bc0);}else{return sqlUtils['parseQueryParameters'](_0x4c16eb,_0x2f7bc0);}})[_0x9d71('0x4')](function(_0x179f42){_0x9950d[_0x9d71('0x7')](_0x179f42[_0x9d71('0x8')]);_0x9950d[_0x9d71('0x7')](_0x179f42[_0x9d71('0x9')]);_0x9950d['where'](_0x179f42[_0x9d71('0xa')]);_0x9950d['where'](_0x179f42[_0x9d71('0xb')][_0x9d71('0xc')]);_0x9d7536=_0x179f42[_0x9d71('0xd')];_0x1126ce=_0x179f42[_0x9d71('0xb')][_0x9d71('0xe')];return sqlUtils[_0x9d71('0xf')](_0x17228f,_0x4c16eb,_0x1126ce);})[_0x9d71('0x4')](function(_0x37517e){_0x9950d[_0x9d71('0x7')](_0x37517e);var _0x5b0696=_0x4c16eb['search']?_0x9d7536['ids']:_0x4c16eb[_0x9d71('0x10')];_0x4bf5d1=_0x5b0696?!![]:![];return sqlUtils[_0x9d71('0x11')](_0x9950d,_0x5b0696);})['then'](function(_0x3ac14f){_0x36fa55[_0x9d71('0x12')]=_0x3ac14f;if(_0x36fa55[_0x9d71('0x12')]===0x0){return;}if(_0x4c16eb[_0x9d71('0x13')]){_0x1126ce=!![];}return sqlUtils['buildContactsQuery'](_0x9950d,_0x4c16eb[_0x9d71('0x9')],_0x420ae0,_0x4bf5d1,_0x9d7536[_0x9d71('0xc')],_0x1126ce);})[_0x9d71('0x4')](function(_0xcecdd4){if(!_0xcecdd4){return[];}return sqlUtils[_0x9d71('0x14')](_0xcecdd4,_0x4c16eb,_0x420ae0);})[_0x9d71('0x4')](function(_0x4e0ee9){_0x36fa55['rows']=_0x4e0ee9;return _0x36fa55;})[_0x9d71('0x15')](function(_0xcde51f){throw _0xcde51f;});};exports[_0x9d71('0x16')]=function(){var _0x19d400={};var _0xce56fe=[];return db[_0x9d71('0x17')]['describe']()['then'](function(_0x4eec82){_0x19d400=_0x4eec82;var _0x45ebbe=Object['keys'](_0x19d400)[_0x9d71('0xa')](function(_0x53ef15){return _['startsWith'](_0x53ef15,_0x9d71('0x18'))?_0x53ef15:undefined;});var _0x2d8ce4=_0x45ebbe['map'](function(_0x8160e7){return db[_0x9d71('0x19')][_0x9d71('0x1a')]({'where':{'id':_0x8160e7['slice'](0x3)},'raw':!![]});});return Promise[_0x9d71('0x1b')](_0x2d8ce4);})[_0x9d71('0x4')](function(_0x4568a0){for(var _0x26e48c=0x0;_0x26e48c<_0x4568a0[_0x9d71('0x1c')];_0x26e48c++){if(_0x4568a0[_0x26e48c]){var _0x3867bc=_0x9d71('0x18')+_0x4568a0[_0x26e48c]['id'];_0x19d400[_0x3867bc]['fieldType']=_0x4568a0[_0x26e48c][_0x9d71('0x1d')];}}_0xce56fe=_['map'](Object[_0x9d71('0x1e')](_0x19d400),function(_0x43f86a){return{'name':_0x43f86a,'type':_0x19d400[_0x43f86a][_0x9d71('0x1d')]};});return _0xce56fe;})[_0x9d71('0x15')](function(_0x169e48){throw _0x169e48;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index c413259..55596c4 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 _0xfd86=['uc.UserId\x20=\x20?','\x20=\x20?','resolve','then','fields','filter','search','c.ListId\x20IS\x20NULL','attributes','group','c.id','limit','offset','subqry.id','having','order','subqry.','keyBy','Sequelize','QueryTypes','SELECT','CmContact','sequelize','toString','Tags','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','query','lodash','squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','role','agent','ListId','select','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','tools_tags','phone','mobile','fax','createdAt','updatedAt','deletedAt','TagIds','includes','forEach','GROUP_CONCAT(DISTINCT\x20t.id)','field','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','conditions','name','dateOfBirth','fieldType','datetime','DATE','buildExpression','type','default','text','value','end','Tag','map','clause','and','tags','ids','User','user','skip','some','compact','Contact','push','c.ListId\x20IN\x20?'];(function(_0x4a963e,_0x2ed7d6){var _0x435fd3=function(_0x33ff39){while(--_0x33ff39){_0x4a963e['push'](_0x4a963e['shift']());}};_0x435fd3(++_0x2ed7d6);}(_0xfd86,0x14d));var _0x6fd8=function(_0x5ad220,_0x27407e){_0x5ad220=_0x5ad220-0x0;var _0xdec77d=_0xfd86[_0x5ad220];return _0xdec77d;};'use strict';var _=require(_0x6fd8('0x0'));var squel=require(_0x6fd8('0x1'));var as=require(_0x6fd8('0x2'));var qs=require(_0x6fd8('0x3'));var utils=require(_0x6fd8('0x4'));var db=require('../../mysqldb')['db'];function skipContactsQuery(_0x1e5cd4,_0x349b24){var _0x12e87c=![];if(_0x1e5cd4[_0x6fd8('0x5')]===_0x6fd8('0x6')&&!_0x349b24['search']&&!_0x349b24[_0x6fd8('0x7')]&&_0x349b24['autocomplete']!=='true'){_0x12e87c=!![];}return _0x12e87c;}function getContactsSubquery(){return squel[_0x6fd8('0x8')]()[_0x6fd8('0x9')](_0x6fd8('0xa'),'c')[_0x6fd8('0xb')](_0x6fd8('0xc'));}function applyJoinClauses(_0x819b45,_0xebc06){var _0x1d8ada=_0xebc06?'c':'subqry';_0x819b45[_0x6fd8('0xd')](_0x6fd8('0xe'),'uc',_0x6fd8('0xf')+_0x1d8ada+'.id')[_0x6fd8('0xd')]('cm_contact_has_tags','ct','ct.CmContactId\x20=\x20'+_0x1d8ada+_0x6fd8('0x10'))[_0x6fd8('0xd')](_0x6fd8('0x11'),'t','t.id\x20=\x20ct.TagId');return _0x819b45;}function addFieldsToQuery(_0x17d5e8,_0x155262,_0x11a017,_0x3150c9,_0x570302){var _0x4ba8be=_0x570302?'c':'subqry';if(!_0x155262){_0x155262=['id','firstName','lastName',_0x6fd8('0x12'),_0x6fd8('0x13'),_0x6fd8('0x14'),'email',_0x6fd8('0x7'),'CompanyId',_0x6fd8('0x15'),_0x6fd8('0x16'),_0x6fd8('0x17'),_0x6fd8('0x18')];}else if(!_0x155262[_0x6fd8('0x19')]('id')){_0x155262['push']('id');}var _0x13ffd6=_0x11a017&&_0x570302||!_0x11a017&&!_0x570302;if(_0x3150c9){_0x13ffd6=_0x3150c9&&_0x570302||!_0x3150c9&&!_0x570302;}_0x155262[_0x6fd8('0x1a')](function(_0x531993){if(_0x531993===_0x6fd8('0x18')){if(_0x13ffd6){_0x17d5e8['field'](_0x6fd8('0x1b'),_0x531993);}else if(_0x11a017||_0x3150c9){_0x17d5e8[_0x6fd8('0x1c')](_0x4ba8be+'.'+_0x531993);}}else{_0x17d5e8[_0x6fd8('0x1c')](_0x4ba8be+'.'+_0x531993);}});return _0x17d5e8;}function getSqlClauses(){var _0x26ec7f={'default':squel['expr'](),'fields':squel[_0x6fd8('0x1d')](),'filter':squel[_0x6fd8('0x1d')](),'tags':{'clause':squel[_0x6fd8('0x1d')](),'ids':null},'user':{'clause':squel['expr'](),'skip':![]}};return _0x26ec7f;}function parseTagParameter(_0x5786c1){var _0x2e9622=squel[_0x6fd8('0x1d')]();if(_0x5786c1){var _0x7daa8=utils[_0x6fd8('0x1e')](_0x5786c1);_0x7daa8[_0x6fd8('0x1a')](function(_0x3d78ac){_0x2e9622['or'](_0x6fd8('0x1f'),'%,'+_0x3d78ac+',%');});}return _0x2e9622;}function parseSearchFilter(_0x55638f){var _0x419e76=squel['expr']();if(_0x55638f){var _0x93130a=_0x55638f[_0x6fd8('0x20')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x93130a[_0x6fd8('0x21')]('\x20')[_0x6fd8('0x22')]>0x1){_0x419e76['or'](_0x6fd8('0x23'),qs[_0x6fd8('0x24')](_0x93130a,!![]),null);}else{if(qs[_0x6fd8('0x25')](_0x93130a)){_0x419e76['or'](_0x6fd8('0x26'),_0x93130a+'%');_0x419e76['or']('c.phone\x20LIKE\x20?',_0x93130a+'%');_0x419e76['or'](_0x6fd8('0x27'),_0x93130a+'%');_0x419e76['or']('c.fax\x20LIKE\x20?',_0x93130a+'%');}else if(qs[_0x6fd8('0x28')](_0x93130a)){_0x419e76['or'](_0x6fd8('0x29'),_0x93130a+'%');}else{_0x419e76['or'](_0x6fd8('0x2a'),'%'+_0x93130a+'%');_0x419e76['or'](_0x6fd8('0x2b'),'%'+_0x93130a+'%');_0x419e76['or'](_0x6fd8('0x29'),'%'+_0x93130a+'%');}}}return _0x419e76;}function parseAdvancedSearchFilter(_0x22ea45,_0x492eb4){var _0x25ad54=getSqlClauses();var _0x596fb8=as[_0x6fd8('0x2c')](_0x22ea45);var _0x1db8c2=_0x596fb8['sqlOperator'];for(var _0x2618eb=0x0;_0x2618eb<_0x596fb8[_0x6fd8('0x2d')][_0x6fd8('0x22')];_0x2618eb++){var _0x1ff400=_0x596fb8[_0x6fd8('0x2d')][_0x2618eb];var _0x52d201='c';var _0x1ea61c=_['find'](_0x492eb4,[_0x6fd8('0x2e'),_0x1ff400[_0x6fd8('0x1c')]]);if(_0x1ea61c){if(_0x1ff400[_0x6fd8('0x1c')]===_0x6fd8('0x2f')||_0x1ea61c[_0x6fd8('0x30')]===_0x6fd8('0x31')){_0x1ff400['castTo']=_0x6fd8('0x32');}var _0x5318b8=as[_0x6fd8('0x33')](_0x52d201,_0x1ea61c[_0x6fd8('0x34')],_0x1ff400);_0x25ad54[_0x6fd8('0x35')][_0x1db8c2](_0x5318b8[_0x6fd8('0x36')],_0x5318b8[_0x6fd8('0x37')]['start'],_0x5318b8['value'][_0x6fd8('0x38')]);}else{if(_0x1ff400[_0x6fd8('0x1c')]===_0x6fd8('0x39')){var _0x218297=_0x1ff400[_0x6fd8('0x37')][_0x6fd8('0x21')](',')[_0x6fd8('0x3a')](function(_0x5166ed){return Number(_0x5166ed);});var _0x3c178f=parseTagParameter(_0x218297);_0x25ad54['tags'][_0x6fd8('0x3b')][_0x6fd8('0x3c')](_0x3c178f);_0x25ad54[_0x6fd8('0x3d')][_0x6fd8('0x3e')]=_0x218297;}else if(_0x1ff400[_0x6fd8('0x1c')]===_0x6fd8('0x3f')){_0x25ad54['user'][_0x6fd8('0x3b')][_0x6fd8('0x3c')]('uc.UserId\x20=\x20?',_0x1ff400['value']);_0x25ad54[_0x6fd8('0x40')][_0x6fd8('0x41')]=!![];}}}return _0x25ad54;}function parseModelFields(_0x2eb5d5,_0x209a56){var _0x107c38=squel[_0x6fd8('0x1d')]();var _0x331e74=_(_0x2eb5d5)['keys']()[_0x6fd8('0x3a')](function(_0x1930df){return _[_0x6fd8('0x42')](_0x209a56,[_0x6fd8('0x2e'),_0x1930df])?_0x1930df:undefined;})[_0x6fd8('0x43')]()[_0x6fd8('0x37')]();if(_0x2eb5d5[_0x6fd8('0x44')]){_0x331e74[_0x6fd8('0x45')]('Contact');}if(_0x2eb5d5[_0x6fd8('0x3f')]){_0x331e74['push'](_0x6fd8('0x3f'));}if(_0x331e74['length']>0x0){_0x331e74[_0x6fd8('0x1a')](function(_0x1271e0){if(_0x1271e0===_0x6fd8('0x7')){_0x107c38[_0x6fd8('0x3c')](_0x6fd8('0x46'),[]['concat'](_0x2eb5d5[_0x1271e0]));}else if(_0x1271e0===_0x6fd8('0x44')){var _0x416ffd='%'+_0x2eb5d5[_0x1271e0]+'%';_0x107c38['and']('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x416ffd);}else if(_0x1271e0===_0x6fd8('0x3f')){_0x107c38[_0x6fd8('0x3c')](_0x6fd8('0x47'),_0x2eb5d5[_0x1271e0]);}else{_0x107c38[_0x6fd8('0x3c')]('c.'+_0x1271e0+_0x6fd8('0x48'),_0x2eb5d5[_0x1271e0]);}});}return _0x107c38;}function parseQueryParameters(_0xdb8f50,_0x3452a4){var _0x554cbb=getSqlClauses();return Promise[_0x6fd8('0x49')]()[_0x6fd8('0x4a')](function(){return parseModelFields(_0xdb8f50,_0x3452a4);})[_0x6fd8('0x4a')](function(_0x12efc9){_0x554cbb[_0x6fd8('0x4b')][_0x6fd8('0x3c')](_0x12efc9);return parseTagParameter(_0xdb8f50['tag']);})[_0x6fd8('0x4a')](function(_0x1a057a){_0x554cbb['tags'][_0x6fd8('0x3b')][_0x6fd8('0x3c')](_0x1a057a);return parseSearchFilter(_0xdb8f50['filter']);})[_0x6fd8('0x4a')](function(_0x214060){_0x554cbb[_0x6fd8('0x4c')]=_0x214060;return _0x554cbb;});}function checkListsRestrictions(_0xeb79d9,_0x3275a0,_0x253101){var _0x44a9b=squel[_0x6fd8('0x1d')]();return Promise['resolve']()[_0x6fd8('0x4a')](function(){if(_0x3275a0[_0x6fd8('0x4d')]&&_0xeb79d9[_0x6fd8('0x5')]===_0x6fd8('0x6')&&!_0x253101){return _0xeb79d9['getLists']({'attributes':['id'],'raw':!![]});}})['then'](function(_0x22954c){if(_0x22954c){if(_0x22954c[_0x6fd8('0x22')]===0x0){_0x44a9b[_0x6fd8('0x3c')](_0x6fd8('0x4e'));}else{_0x44a9b[_0x6fd8('0x3c')]('c.ListId\x20IN\x20?',_[_0x6fd8('0x3a')](_0x22954c,'id'));}}})[_0x6fd8('0x4a')](function(){return _0x44a9b;});}function buildContactsQuery(_0x57489e,_0x4dbbd0,_0x7732f9,_0x148c13,_0x413440,_0x397ca7){if(_0x4dbbd0){_0x4dbbd0=_0x7732f9[_0x6fd8('0x4f')];}_0x57489e=addFieldsToQuery(_0x57489e,_0x4dbbd0,_0x148c13,_0x397ca7,!![]);var _0x51e244=squel[_0x6fd8('0x8')]();_0x51e244=addFieldsToQuery(_0x51e244,_0x4dbbd0,_0x148c13,_0x397ca7,![]);if(_0x148c13||_0x397ca7){_0x57489e=applyJoinClauses(_0x57489e,!![]);_0x57489e[_0x6fd8('0x50')](_0x6fd8('0x51'));if(_0x7732f9['limit']){_0x51e244[_0x6fd8('0x52')](_0x7732f9[_0x6fd8('0x52')]);}if(_0x7732f9[_0x6fd8('0x53')]){_0x51e244[_0x6fd8('0x53')](_0x7732f9[_0x6fd8('0x53')]);}}else{_0x51e244=applyJoinClauses(_0x51e244,![]);_0x51e244[_0x6fd8('0x50')](_0x6fd8('0x54'));if(_0x7732f9[_0x6fd8('0x52')]){_0x57489e[_0x6fd8('0x52')](_0x7732f9[_0x6fd8('0x52')]);}if(_0x7732f9['offset']){_0x57489e[_0x6fd8('0x53')](_0x7732f9[_0x6fd8('0x53')]);}}_0x51e244[_0x6fd8('0x55')](_0x413440);if(_0x7732f9[_0x6fd8('0x56')]){_0x7732f9['order'][_0x6fd8('0x1a')](function(_0x5a3b1d){_0x57489e[_0x6fd8('0x56')]('c.'+_0x5a3b1d[0x0],_0x5a3b1d[0x1]==='DESC'?![]:!![]);_0x51e244[_0x6fd8('0x56')](_0x6fd8('0x57')+_0x5a3b1d[0x0],_0x5a3b1d[0x1]==='DESC'?![]:!![]);});}_0x51e244[_0x6fd8('0x9')](_0x57489e,'subqry');return _0x51e244;}function getFilteredContacts(_0x485509){var _0x190503=[];return db[_0x6fd8('0x39')]['findAll']({'attributes':['id',_0x6fd8('0x2e'),'color'],'raw':!![]})['then'](function(_0x145fc8){_0x190503=_[_0x6fd8('0x58')](_0x145fc8,'id');var _0x2f4b2b={'type':db[_0x6fd8('0x59')][_0x6fd8('0x5a')][_0x6fd8('0x5b')],'model':db[_0x6fd8('0x5c')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x6fd8('0x5d')]['query'](_0x485509[_0x6fd8('0x5e')](),_0x2f4b2b);})[_0x6fd8('0x4a')](function(_0x5acee7){_0x5acee7[_0x6fd8('0x1a')](function(_0x59e2d6){if(_0x59e2d6['TagIds']){_0x59e2d6[_0x6fd8('0x5f')]=[];_0x59e2d6['TagIds'][_0x6fd8('0x21')](',')['forEach'](function(_0x3889d9){_0x59e2d6[_0x6fd8('0x5f')]['push'](_0x190503[_0x3889d9]);});}delete _0x59e2d6[_0x6fd8('0x18')];});return _0x5acee7;});}function countFilteredContacts(_0x2453af,_0x149d70){var _0x3e5ecf=_0x2453af[_0x6fd8('0x60')]();_0x3e5ecf['field'](_0x6fd8('0x61'));_0x3e5ecf=applyJoinClauses(_0x3e5ecf,!![]);_0x2453af['group'](_0x6fd8('0x51'));var _0x5844f8=utils[_0x6fd8('0x1e')](_0x149d70);if(!_[_0x6fd8('0x62')](_0x5844f8)){_0x3e5ecf[_0x6fd8('0xb')](_0x6fd8('0x63'),_0x5844f8);}var _0x5b35a8={'type':db[_0x6fd8('0x59')]['QueryTypes'][_0x6fd8('0x5b')],'raw':!![]};return db[_0x6fd8('0x5d')][_0x6fd8('0x64')](_0x3e5ecf['toString'](),_0x5b35a8)['then'](function(_0x6a0928){return _0x6a0928[0x0][_0x6fd8('0x61')];});}module['exports']={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0xcfae=['then','fields','tag','filter','search','getLists','c.ListId\x20IS\x20NULL','attributes','group','c.id','limit','offset','subqry.id','having','order','DESC','from','findAll','keyBy','Sequelize','QueryTypes','SELECT','CmContact','sequelize','toString','Tags','clone','COUNT(*)','getSelectedTags','isEmpty','t.id\x20IN\x20?','query','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','../../mysqldb','role','agent','ListId','autocomplete','select','cm_contacts','where','c.deletedAt\x20IS\x20NULL','subqry','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','ct.CmContactId\x20=\x20','.id','t.id\x20=\x20ct.TagId','firstName','lastName','phone','mobile','fax','email','CompanyId','createdAt','deletedAt','TagIds','includes','push','forEach','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','replace','length','getFullTextValue','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','sqlOperator','conditions','find','fieldType','datetime','castTo','DATE','buildExpression','type','default','text','value','start','end','Tag','split','map','tags','clause','user','and','uc.UserId\x20=\x20?','skip','keys','name','compact','Contact','User','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve'];(function(_0x83879,_0x42f30e){var _0x1b7d91=function(_0x2a616f){while(--_0x2a616f){_0x83879['push'](_0x83879['shift']());}};_0x1b7d91(++_0x42f30e);}(_0xcfae,0x92));var _0xecfa=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xcfae[_0x134c2e];return _0x2825db;};'use strict';var _=require(_0xecfa('0x0'));var squel=require(_0xecfa('0x1'));var as=require(_0xecfa('0x2'));var qs=require(_0xecfa('0x3'));var utils=require(_0xecfa('0x4'));var db=require(_0xecfa('0x5'))['db'];function skipContactsQuery(_0x33a494,_0x1bd10e){var _0x4b4628=![];if(_0x33a494[_0xecfa('0x6')]===_0xecfa('0x7')&&!_0x1bd10e['search']&&!_0x1bd10e[_0xecfa('0x8')]&&_0x1bd10e[_0xecfa('0x9')]!=='true'){_0x4b4628=!![];}return _0x4b4628;}function getContactsSubquery(){return squel[_0xecfa('0xa')]()['from'](_0xecfa('0xb'),'c')[_0xecfa('0xc')](_0xecfa('0xd'));}function applyJoinClauses(_0x12f0ef,_0x501d28){var _0x2a9132=_0x501d28?'c':_0xecfa('0xe');_0x12f0ef[_0xecfa('0xf')](_0xecfa('0x10'),'uc',_0xecfa('0x11')+_0x2a9132+'.id')[_0xecfa('0xf')]('cm_contact_has_tags','ct',_0xecfa('0x12')+_0x2a9132+_0xecfa('0x13'))[_0xecfa('0xf')]('tools_tags','t',_0xecfa('0x14'));return _0x12f0ef;}function addFieldsToQuery(_0x2a7cb5,_0x52c7ad,_0x1b2bdd,_0x25ab72,_0xfff4d5){var _0x421199=_0xfff4d5?'c':'subqry';if(!_0x52c7ad){_0x52c7ad=['id',_0xecfa('0x15'),_0xecfa('0x16'),_0xecfa('0x17'),_0xecfa('0x18'),_0xecfa('0x19'),_0xecfa('0x1a'),'ListId',_0xecfa('0x1b'),_0xecfa('0x1c'),'updatedAt',_0xecfa('0x1d'),_0xecfa('0x1e')];}else if(!_0x52c7ad[_0xecfa('0x1f')]('id')){_0x52c7ad[_0xecfa('0x20')]('id');}var _0x3b6ce0=_0x1b2bdd&&_0xfff4d5||!_0x1b2bdd&&!_0xfff4d5;if(_0x25ab72){_0x3b6ce0=_0x25ab72&&_0xfff4d5||!_0x25ab72&&!_0xfff4d5;}_0x52c7ad[_0xecfa('0x21')](function(_0x13b1e1){if(_0x13b1e1===_0xecfa('0x1e')){if(_0x3b6ce0){_0x2a7cb5[_0xecfa('0x22')](_0xecfa('0x23'),_0x13b1e1);}else if(_0x1b2bdd||_0x25ab72){_0x2a7cb5['field'](_0x421199+'.'+_0x13b1e1);}}else{_0x2a7cb5[_0xecfa('0x22')](_0x421199+'.'+_0x13b1e1);}});return _0x2a7cb5;}function getSqlClauses(){var _0x41c6ef={'default':squel['expr'](),'fields':squel[_0xecfa('0x24')](),'filter':squel[_0xecfa('0x24')](),'tags':{'clause':squel['expr'](),'ids':null},'user':{'clause':squel['expr'](),'skip':![]}};return _0x41c6ef;}function parseTagParameter(_0x331907){var _0x39507b=squel[_0xecfa('0x24')]();if(_0x331907){var _0x3187cd=utils['getSelectedTags'](_0x331907);_0x3187cd[_0xecfa('0x21')](function(_0x3efd3c){_0x39507b['or']('CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3efd3c+',%');});}return _0x39507b;}function parseSearchFilter(_0x392cdb){var _0x28077c=squel[_0xecfa('0x24')]();if(_0x392cdb){var _0x1a311f=_0x392cdb['replace']('\x5c','\x5c\x5c')[_0xecfa('0x25')](/'/g,'\x27\x27');if(_0x1a311f['split']('\x20')[_0xecfa('0x26')]>0x1){_0x28077c['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xecfa('0x27')](_0x1a311f,!![]),null);}else{if(qs['isNumeric'](_0x1a311f)){_0x28077c['or'](_0xecfa('0x28'),_0x1a311f+'%');_0x28077c['or'](_0xecfa('0x29'),_0x1a311f+'%');_0x28077c['or'](_0xecfa('0x2a'),_0x1a311f+'%');_0x28077c['or'](_0xecfa('0x2b'),_0x1a311f+'%');}else if(qs[_0xecfa('0x2c')](_0x1a311f)){_0x28077c['or'](_0xecfa('0x2d'),_0x1a311f+'%');}else{_0x28077c['or']('c.firstName\x20LIKE\x20?','%'+_0x1a311f+'%');_0x28077c['or'](_0xecfa('0x2e'),'%'+_0x1a311f+'%');_0x28077c['or'](_0xecfa('0x2d'),'%'+_0x1a311f+'%');}}}return _0x28077c;}function parseAdvancedSearchFilter(_0x20ce9c,_0xc5d9e7){var _0x3444ed=getSqlClauses();var _0x22196c=as['parseSearch'](_0x20ce9c);var _0x143012=_0x22196c[_0xecfa('0x2f')];for(var _0x5b3367=0x0;_0x5b3367<_0x22196c[_0xecfa('0x30')][_0xecfa('0x26')];_0x5b3367++){var _0x167f31=_0x22196c['conditions'][_0x5b3367];var _0x1dbb5a='c';var _0x3b2257=_[_0xecfa('0x31')](_0xc5d9e7,['name',_0x167f31[_0xecfa('0x22')]]);if(_0x3b2257){if(_0x167f31[_0xecfa('0x22')]==='dateOfBirth'||_0x3b2257[_0xecfa('0x32')]===_0xecfa('0x33')){_0x167f31[_0xecfa('0x34')]=_0xecfa('0x35');}var _0x5ee241=as[_0xecfa('0x36')](_0x1dbb5a,_0x3b2257[_0xecfa('0x37')],_0x167f31);_0x3444ed[_0xecfa('0x38')][_0x143012](_0x5ee241[_0xecfa('0x39')],_0x5ee241[_0xecfa('0x3a')][_0xecfa('0x3b')],_0x5ee241['value'][_0xecfa('0x3c')]);}else{if(_0x167f31[_0xecfa('0x22')]===_0xecfa('0x3d')){var _0x5c2a02=_0x167f31[_0xecfa('0x3a')][_0xecfa('0x3e')](',')[_0xecfa('0x3f')](function(_0x174c33){return Number(_0x174c33);});var _0x5ab9e6=parseTagParameter(_0x5c2a02);_0x3444ed[_0xecfa('0x40')][_0xecfa('0x41')]['and'](_0x5ab9e6);_0x3444ed[_0xecfa('0x40')]['ids']=_0x5c2a02;}else if(_0x167f31[_0xecfa('0x22')]==='User'){_0x3444ed[_0xecfa('0x42')]['clause'][_0xecfa('0x43')](_0xecfa('0x44'),_0x167f31[_0xecfa('0x3a')]);_0x3444ed[_0xecfa('0x42')][_0xecfa('0x45')]=!![];}}}return _0x3444ed;}function parseModelFields(_0xdbcc8a,_0x21d542){var _0x47f77c=squel['expr']();var _0x4f8bd3=_(_0xdbcc8a)[_0xecfa('0x46')]()[_0xecfa('0x3f')](function(_0x20124b){return _['some'](_0x21d542,[_0xecfa('0x47'),_0x20124b])?_0x20124b:undefined;})[_0xecfa('0x48')]()['value']();if(_0xdbcc8a[_0xecfa('0x49')]){_0x4f8bd3[_0xecfa('0x20')](_0xecfa('0x49'));}if(_0xdbcc8a[_0xecfa('0x4a')]){_0x4f8bd3[_0xecfa('0x20')](_0xecfa('0x4a'));}if(_0x4f8bd3['length']>0x0){_0x4f8bd3[_0xecfa('0x21')](function(_0x412f02){if(_0x412f02===_0xecfa('0x8')){_0x47f77c[_0xecfa('0x43')](_0xecfa('0x4b'),[][_0xecfa('0x4c')](_0xdbcc8a[_0x412f02]));}else if(_0x412f02===_0xecfa('0x49')){var _0x27f2db='%'+_0xdbcc8a[_0x412f02]+'%';_0x47f77c['and'](_0xecfa('0x4d'),_0x27f2db);}else if(_0x412f02===_0xecfa('0x4a')){_0x47f77c[_0xecfa('0x43')](_0xecfa('0x44'),_0xdbcc8a[_0x412f02]);}else{_0x47f77c[_0xecfa('0x43')]('c.'+_0x412f02+_0xecfa('0x4e'),_0xdbcc8a[_0x412f02]);}});}return _0x47f77c;}function parseQueryParameters(_0x4b73e2,_0x88bcf0){var _0x28bd2c=getSqlClauses();return Promise[_0xecfa('0x4f')]()['then'](function(){return parseModelFields(_0x4b73e2,_0x88bcf0);})[_0xecfa('0x50')](function(_0x204651){_0x28bd2c[_0xecfa('0x51')][_0xecfa('0x43')](_0x204651);return parseTagParameter(_0x4b73e2[_0xecfa('0x52')]);})[_0xecfa('0x50')](function(_0x55b91f){_0x28bd2c['tags'][_0xecfa('0x41')]['and'](_0x55b91f);return parseSearchFilter(_0x4b73e2[_0xecfa('0x53')]);})[_0xecfa('0x50')](function(_0x1216fc){_0x28bd2c[_0xecfa('0x53')]=_0x1216fc;return _0x28bd2c;});}function checkListsRestrictions(_0x18df87,_0x42fdaf,_0x4ae909){var _0x19784f=squel['expr']();return Promise['resolve']()[_0xecfa('0x50')](function(){if(_0x42fdaf[_0xecfa('0x54')]&&_0x18df87[_0xecfa('0x6')]===_0xecfa('0x7')&&!_0x4ae909){return _0x18df87[_0xecfa('0x55')]({'attributes':['id'],'raw':!![]});}})[_0xecfa('0x50')](function(_0x2cd5ee){if(_0x2cd5ee){if(_0x2cd5ee['length']===0x0){_0x19784f[_0xecfa('0x43')](_0xecfa('0x56'));}else{_0x19784f[_0xecfa('0x43')]('c.ListId\x20IN\x20?',_['map'](_0x2cd5ee,'id'));}}})['then'](function(){return _0x19784f;});}function buildContactsQuery(_0x56c5a0,_0x51037f,_0x2f2761,_0x5c44a6,_0x5b038d,_0x217a09){if(_0x51037f){_0x51037f=_0x2f2761[_0xecfa('0x57')];}_0x56c5a0=addFieldsToQuery(_0x56c5a0,_0x51037f,_0x5c44a6,_0x217a09,!![]);var _0x3365f2=squel[_0xecfa('0xa')]();_0x3365f2=addFieldsToQuery(_0x3365f2,_0x51037f,_0x5c44a6,_0x217a09,![]);if(_0x5c44a6||_0x217a09){_0x56c5a0=applyJoinClauses(_0x56c5a0,!![]);_0x56c5a0[_0xecfa('0x58')](_0xecfa('0x59'));if(_0x2f2761[_0xecfa('0x5a')]){_0x3365f2[_0xecfa('0x5a')](_0x2f2761['limit']);}if(_0x2f2761['offset']){_0x3365f2['offset'](_0x2f2761[_0xecfa('0x5b')]);}}else{_0x3365f2=applyJoinClauses(_0x3365f2,![]);_0x3365f2[_0xecfa('0x58')](_0xecfa('0x5c'));if(_0x2f2761[_0xecfa('0x5a')]){_0x56c5a0['limit'](_0x2f2761['limit']);}if(_0x2f2761[_0xecfa('0x5b')]){_0x56c5a0['offset'](_0x2f2761[_0xecfa('0x5b')]);}}_0x3365f2[_0xecfa('0x5d')](_0x5b038d);if(_0x2f2761[_0xecfa('0x5e')]){_0x2f2761[_0xecfa('0x5e')][_0xecfa('0x21')](function(_0x26d958){_0x56c5a0[_0xecfa('0x5e')]('c.'+_0x26d958[0x0],_0x26d958[0x1]===_0xecfa('0x5f')?![]:!![]);_0x3365f2[_0xecfa('0x5e')]('subqry.'+_0x26d958[0x0],_0x26d958[0x1]===_0xecfa('0x5f')?![]:!![]);});}_0x3365f2[_0xecfa('0x60')](_0x56c5a0,'subqry');return _0x3365f2;}function getFilteredContacts(_0x4165fb){var _0x28aaae=[];return db[_0xecfa('0x3d')][_0xecfa('0x61')]({'attributes':['id',_0xecfa('0x47'),'color'],'raw':!![]})[_0xecfa('0x50')](function(_0x332baf){_0x28aaae=_[_0xecfa('0x62')](_0x332baf,'id');var _0x344b05={'type':db[_0xecfa('0x63')][_0xecfa('0x64')][_0xecfa('0x65')],'model':db[_0xecfa('0x66')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0xecfa('0x67')]['query'](_0x4165fb[_0xecfa('0x68')](),_0x344b05);})['then'](function(_0x1b3ce1){_0x1b3ce1[_0xecfa('0x21')](function(_0x14e98d){if(_0x14e98d[_0xecfa('0x1e')]){_0x14e98d['Tags']=[];_0x14e98d[_0xecfa('0x1e')]['split'](',')[_0xecfa('0x21')](function(_0x4fbb9d){_0x14e98d[_0xecfa('0x69')][_0xecfa('0x20')](_0x28aaae[_0x4fbb9d]);});}delete _0x14e98d[_0xecfa('0x1e')];});return _0x1b3ce1;});}function countFilteredContacts(_0x906719,_0xa2a845){var _0x2260aa=_0x906719[_0xecfa('0x6a')]();_0x2260aa[_0xecfa('0x22')](_0xecfa('0x6b'));_0x2260aa=applyJoinClauses(_0x2260aa,!![]);_0x906719[_0xecfa('0x58')](_0xecfa('0x59'));var _0x250284=utils[_0xecfa('0x6c')](_0xa2a845);if(!_[_0xecfa('0x6d')](_0x250284)){_0x2260aa['where'](_0xecfa('0x6e'),_0x250284);}var _0x1633db={'type':db['Sequelize'][_0xecfa('0x64')][_0xecfa('0x65')],'raw':!![]};return db['sequelize'][_0xecfa('0x6f')](_0x2260aa[_0xecfa('0x68')](),_0x1633db)['then'](function(_0x3e7606){return _0x3e7606[0x0]['COUNT(*)'];});}module[_0xecfa('0x70')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 60ed02a..0267228 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 _0x7835=['createDecipher','encryptString','secret','base64','decryptString','utf8','crypto','lodash','../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createCipher','data','update','binary','write','end','final','close','unlink','decryptFile','createWriteStream'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0x7835,0x12e));var _0x5783=function(_0x26eb82,_0x12aefc){_0x26eb82=_0x26eb82-0x0;var _0x39aab5=_0x7835[_0x26eb82];return _0x39aab5;};'use strict';var crypto=require(_0x5783('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0x5783('0x1'));var config=require(_0x5783('0x2'));var logger=require(_0x5783('0x3'))(_0x5783('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x5783('0x5')][_0x5783('0x6')],'algorithm':_0x5783('0x7')};const fileOptions={'algorithm':_0x5783('0x8')};if(config[_0x5783('0x9')]&&config['encrypt']['algorithm']){var isSupported=isAlgorithmSupported(config['encrypt'][_0x5783('0xa')]);if(isSupported){fileOptions[_0x5783('0xa')]=config[_0x5783('0x9')][_0x5783('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x5783('0xb')](',\x20');logger[_0x5783('0xc')](config[_0x5783('0x9')][_0x5783('0xa')],_0x5783('0xd'),supportedAlgorithms);}}function isASupportedCipher(_0x2a5133){return AES_SUPPORTED_RX[_0x5783('0xe')](_0x2a5133);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x5783('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0xf23b8f){return getSupportedCiphers()[_0x5783('0x10')](_0xf23b8f)>-0x1;}function combineOptions(_0x4b38e1){var _0x5a4e14={};for(var _0x448253 in fileOptions){if(fileOptions[_0x5783('0x11')](_0x448253)){_0x5a4e14[_0x448253]=fileOptions[_0x448253];}}if(_0x4b38e1){for(var _0x5d2bfd in _0x4b38e1){if(_0x4b38e1[_0x5783('0x11')](_0x5d2bfd)){_0x5a4e14[_0x5d2bfd]=_0x4b38e1[_0x5d2bfd];}}}return _0x5a4e14;}exports[_0x5783('0x12')]=function(_0x4a1d92,_0x5bb0af,_0x587c6d,_0x2ff0b4){return new BPromise(function(_0x4fb98d,_0x2aedd7){_0x2ff0b4=combineOptions(_0x2ff0b4);var _0xca070d=new Buffer(_0x587c6d);var _0x1f7226=fs[_0x5783('0x13')](_0x4a1d92);var _0x184246=fs['createWriteStream'](_0x5bb0af);var _0x216b01=crypto[_0x5783('0x14')](_0x2ff0b4[_0x5783('0xa')],_0xca070d);_0x1f7226['on'](_0x5783('0x15'),function(_0x14174c){var _0x2c6a49=new Buffer(_0x216b01[_0x5783('0x16')](_0x14174c),_0x5783('0x17'));_0x184246[_0x5783('0x18')](_0x2c6a49);});_0x1f7226['on'](_0x5783('0x19'),function(){try{var _0x1fe533=new Buffer(_0x216b01[_0x5783('0x1a')](_0x5783('0x17')),_0x5783('0x17'));_0x184246[_0x5783('0x18')](_0x1fe533);_0x184246['end']();_0x184246['on'](_0x5783('0x1b'),function(){return _0x4fb98d(_0x5bb0af);});}catch(_0x4b08b8){fs[_0x5783('0x1c')](_0x5bb0af);return _0x2aedd7(_0x4b08b8);}});});};exports[_0x5783('0x1d')]=function(_0x4a3b0f,_0x344cde,_0x46e9ef,_0x36ec12){return new BPromise(function(_0x181e67,_0x761ef2){_0x36ec12=combineOptions(_0x36ec12);var _0x3e66c0=new Buffer(_0x46e9ef);var _0x33a0f8=fs[_0x5783('0x13')](_0x4a3b0f);var _0xef9176=fs[_0x5783('0x1e')](_0x344cde);var _0x1c65ce=crypto[_0x5783('0x1f')](_0x36ec12[_0x5783('0xa')],_0x3e66c0);_0x33a0f8['on'](_0x5783('0x15'),function(_0x3ca903){var _0x8b08b3=new Buffer(_0x1c65ce[_0x5783('0x16')](_0x3ca903),_0x5783('0x17'));_0xef9176[_0x5783('0x18')](_0x8b08b3);});_0x33a0f8['on'](_0x5783('0x19'),function(){try{var _0x4ba31a=new Buffer(_0x1c65ce[_0x5783('0x1a')](_0x5783('0x17')),'binary');_0xef9176[_0x5783('0x18')](_0x4ba31a);_0xef9176[_0x5783('0x19')]();_0xef9176['on'](_0x5783('0x1b'),function(){return _0x181e67(_0x344cde);});}catch(_0x3efc28){fs[_0x5783('0x1c')](_0x344cde);return _0x761ef2(_0x3efc28);}});});};exports[_0x5783('0x20')]=function(_0xf324f,_0x452df1,_0x4e4a48){var _0x2ecd0b=_0x4e4a48||stringOptions[_0x5783('0xa')];var _0x14f4c3=_0x452df1||stringOptions[_0x5783('0x21')];var _0x42e74b=crypto[_0x5783('0x14')](_0x2ecd0b,_0x14f4c3);var _0x3652c5=_0x42e74b['update'](_0xf324f,'utf8',_0x5783('0x22'));_0x3652c5+=_0x42e74b[_0x5783('0x1a')](_0x5783('0x22'));return _0x3652c5;};exports[_0x5783('0x23')]=function(_0x4425b3,_0x4aa16f,_0x1a7701){var _0x42c1c3=_0x1a7701||stringOptions['algorithm'];var _0x194c61=_0x4aa16f||stringOptions[_0x5783('0x21')];var _0x2f2264=crypto['createDecipher'](_0x42c1c3,_0x194c61);var _0x2ba4e5=_0x2f2264[_0x5783('0x16')](_0x4425b3,_0x5783('0x22'),_0x5783('0x24'));_0x2ba4e5+=_0x2f2264['final'](_0x5783('0x24'));return _0x2ba4e5;}; \ No newline at end of file +var _0x8e41=['createWriteStream','createCipher','data','update','binary','write','end','final','unlink','decryptFile','createDecipher','encryptString','secret','utf8','base64','decryptString','crypto','lodash','../../config/environment','../../config/logger','app','secrets','aes-256-ctr','aes192','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x8e41,0x105));var _0x18e4=function(_0x26df48,_0x22aa50){_0x26df48=_0x26df48-0x0;var _0x209047=_0x8e41[_0x26df48];return _0x209047;};'use strict';var crypto=require(_0x18e4('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0x18e4('0x1'));var config=require(_0x18e4('0x2'));var logger=require(_0x18e4('0x3'))(_0x18e4('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x18e4('0x5')]['session'],'algorithm':_0x18e4('0x6')};const fileOptions={'algorithm':_0x18e4('0x7')};if(config[_0x18e4('0x8')]&&config['encrypt'][_0x18e4('0x9')]){var isSupported=isAlgorithmSupported(config[_0x18e4('0x8')][_0x18e4('0x9')]);if(isSupported){fileOptions[_0x18e4('0x9')]=config[_0x18e4('0x8')][_0x18e4('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x18e4('0xa')](',\x20');logger['error'](config[_0x18e4('0x8')][_0x18e4('0x9')],_0x18e4('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x6fe954){return AES_SUPPORTED_RX[_0x18e4('0xc')](_0x6fe954);}function getSupportedCiphers(){return crypto[_0x18e4('0xd')]()[_0x18e4('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0xe4e59d){return getSupportedCiphers()[_0x18e4('0xf')](_0xe4e59d)>-0x1;}function combineOptions(_0x54afd1){var _0x30c04d={};for(var _0x4deda4 in fileOptions){if(fileOptions[_0x18e4('0x10')](_0x4deda4)){_0x30c04d[_0x4deda4]=fileOptions[_0x4deda4];}}if(_0x54afd1){for(var _0x50d401 in _0x54afd1){if(_0x54afd1[_0x18e4('0x10')](_0x50d401)){_0x30c04d[_0x50d401]=_0x54afd1[_0x50d401];}}}return _0x30c04d;}exports[_0x18e4('0x11')]=function(_0x5de0e4,_0x50dd67,_0x4114c9,_0x48d71a){return new BPromise(function(_0x2e0aea,_0x370c53){_0x48d71a=combineOptions(_0x48d71a);var _0x158f61=new Buffer(_0x4114c9);var _0x4dee36=fs[_0x18e4('0x12')](_0x5de0e4);var _0x1c5946=fs[_0x18e4('0x13')](_0x50dd67);var _0x35b3e0=crypto[_0x18e4('0x14')](_0x48d71a[_0x18e4('0x9')],_0x158f61);_0x4dee36['on'](_0x18e4('0x15'),function(_0x203fe8){var _0x5884c3=new Buffer(_0x35b3e0[_0x18e4('0x16')](_0x203fe8),_0x18e4('0x17'));_0x1c5946[_0x18e4('0x18')](_0x5884c3);});_0x4dee36['on'](_0x18e4('0x19'),function(){try{var _0x3b7522=new Buffer(_0x35b3e0[_0x18e4('0x1a')]('binary'),_0x18e4('0x17'));_0x1c5946['write'](_0x3b7522);_0x1c5946[_0x18e4('0x19')]();_0x1c5946['on']('close',function(){return _0x2e0aea(_0x50dd67);});}catch(_0x4743c1){fs[_0x18e4('0x1b')](_0x50dd67);return _0x370c53(_0x4743c1);}});});};exports[_0x18e4('0x1c')]=function(_0x48f7f0,_0x4c492d,_0x3d5080,_0x436e53){return new BPromise(function(_0x112102,_0x2e2339){_0x436e53=combineOptions(_0x436e53);var _0x12f1d8=new Buffer(_0x3d5080);var _0x195a19=fs['createReadStream'](_0x48f7f0);var _0x55bda6=fs[_0x18e4('0x13')](_0x4c492d);var _0x19e0a2=crypto[_0x18e4('0x1d')](_0x436e53[_0x18e4('0x9')],_0x12f1d8);_0x195a19['on']('data',function(_0x27cf3e){var _0x65fa8d=new Buffer(_0x19e0a2[_0x18e4('0x16')](_0x27cf3e),_0x18e4('0x17'));_0x55bda6[_0x18e4('0x18')](_0x65fa8d);});_0x195a19['on'](_0x18e4('0x19'),function(){try{var _0x9d8416=new Buffer(_0x19e0a2['final'](_0x18e4('0x17')),_0x18e4('0x17'));_0x55bda6[_0x18e4('0x18')](_0x9d8416);_0x55bda6[_0x18e4('0x19')]();_0x55bda6['on']('close',function(){return _0x112102(_0x4c492d);});}catch(_0x27c4ad){fs[_0x18e4('0x1b')](_0x4c492d);return _0x2e2339(_0x27c4ad);}});});};exports[_0x18e4('0x1e')]=function(_0x1980ca,_0xbae876,_0x131d37){var _0x4c1740=_0x131d37||stringOptions[_0x18e4('0x9')];var _0x17a076=_0xbae876||stringOptions[_0x18e4('0x1f')];var _0x312eb6=crypto['createCipher'](_0x4c1740,_0x17a076);var _0x3ff74d=_0x312eb6['update'](_0x1980ca,_0x18e4('0x20'),_0x18e4('0x21'));_0x3ff74d+=_0x312eb6[_0x18e4('0x1a')]('base64');return _0x3ff74d;};exports[_0x18e4('0x22')]=function(_0x1d6508,_0x5510d3,_0x2ac5e0){var _0x2c5507=_0x2ac5e0||stringOptions[_0x18e4('0x9')];var _0x2dfdfb=_0x5510d3||stringOptions[_0x18e4('0x1f')];var _0x255a9a=crypto['createDecipher'](_0x2c5507,_0x2dfdfb);var _0x45bf40=_0x255a9a[_0x18e4('0x16')](_0x1d6508,_0x18e4('0x21'),_0x18e4('0x20'));_0x45bf40+=_0x255a9a['final'](_0x18e4('0x20'));return _0x45bf40;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 0a71f00..6fd8ff8 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 _0x866d=['Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','bluebird','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','savename','update','info','CSV','Setting','split','splitSizeCsv','then','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','Empty','length','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','existsSync','join','mkdirSync','each','csv','%s.%s','writeFileSync','zip','zip\x20finished'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0x866d,0xe5));var _0xd866=function(_0x309bc4,_0x7780f2){_0x309bc4=_0x309bc4-0x0;var _0x32c905=_0x866d[_0x309bc4];return _0x32c905;};'use strict';var util=require(_0xd866('0x0'));var path=require('path');var _=require('lodash');var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0xd866('0x1'));var zipdir=require(_0xd866('0x2'));var rimraf=require(_0xd866('0x3'));var db=require(_0xd866('0x4'))['db'];var dbH=require('../../mysqldb')[_0xd866('0x5')];var logger=require('../../config/logger')(_0xd866('0x6'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xd866('0x7')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2a9158,_0x5227ea){var _0x240661={'status':_0x2a9158};var _0x58db91={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5227ea){_0x240661[_0xd866('0x8')]=_0x5227ea;}return db['AnalyticExtractedReport'][_0xd866('0x9')](_0x240661,_0x58db91);}function main(){var _0x1f5f44=0x1388;var _0x409a4d;logger[_0xd866('0xa')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xd866('0xb')));return db[_0xd866('0xc')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xd866('0xd'),_0xd866('0xe')]})['then'](function(_0x1181dd){if(_0x1181dd){_0x409a4d=_0x1181dd;_0x1f5f44=_0x409a4d[_0xd866('0xe')]||0x1388;}})[_0xd866('0xf')](function(){return dbH['sequelize'][_0xd866('0x10')](util[_0xd866('0x11')](_0xd866('0x12'),QUERY),{'type':dbH[_0xd866('0x13')][_0xd866('0x14')][_0xd866('0x15')]});})[_0xd866('0xf')](function(_0x5e6746){if(!_0x5e6746[0x0][_0xd866('0x16')]){return analyticExtractedReport(_0xd866('0x17'));}var _0x52b6df=[];var _0x20c44b=0x0;if(_0x409a4d[_0xd866('0xd')]){if(_0x5e6746&&_0x5e6746[_0xd866('0x18')]){var _0x152c23=_['range'](_0x5e6746[0x0]['num']/_0x1f5f44);var _0x3a117a=Number[_0xd866('0x19')](_0x5e6746[0x0][_0xd866('0x16')]/_0x1f5f44)?_0x5e6746[0x0]['num']%_0x1f5f44:0x0;_0x152c23[_0xd866('0x1a')](function(_0x4e81bb){if(_0x4e81bb>0x0){_0x20c44b+=_0x1f5f44;}_0x52b6df[_0xd866('0x1b')](dbH[_0xd866('0x13')][_0xd866('0x10')](util[_0xd866('0x11')](_0xd866('0x1c'),QUERY,_0x1f5f44,_0x20c44b),{'type':dbH[_0xd866('0x13')][_0xd866('0x14')][_0xd866('0x15')]}));});if(_0x3a117a>0x0){_0x20c44b+=_0x1f5f44;_0x52b6df[_0xd866('0x1b')](dbH['sequelize'][_0xd866('0x10')](util[_0xd866('0x11')](_0xd866('0x1c'),QUERY,_0x3a117a,_0x20c44b),{'type':dbH[_0xd866('0x13')][_0xd866('0x14')]['SELECT']}));}}}else{_0x52b6df[_0xd866('0x1b')](dbH['sequelize']['query'](QUERY,{'type':dbH[_0xd866('0x13')][_0xd866('0x14')][_0xd866('0x15')]}));}var _0x3712ac=path[_0xd866('0x1d')](PATH);var _0x4011d9=path[_0xd866('0x1e')](PATH,_0xd866('0x1f'));var _0x5e4b97=_0x409a4d[_0xd866('0xd')]&&_0x52b6df[_0xd866('0x18')]>0x1;var _0x1c8c72=[];if(!fs[_0xd866('0x20')](path[_0xd866('0x21')](_0x3712ac,_0x4011d9))&&_0x5e4b97){fs[_0xd866('0x22')](path[_0xd866('0x21')](_0x3712ac,_0x4011d9));}return BPromise[_0xd866('0x23')](_0x52b6df,function(_0x2e4e7c){_0x1c8c72['push'](_0x2e4e7c);})[_0xd866('0xf')](function(){for(var _0xc257b1=0x0;_0xc257b1<_0x1c8c72[_0xd866('0x18')];_0xc257b1+=0x1){var _0x384416;var _0x4a9c95=_0x1c8c72[_0xc257b1];if(_0x5e4b97){_0x384416=path[_0xd866('0x21')](_0x3712ac,_0x4011d9,util[_0xd866('0x11')]('%s%d.%s',_0x4011d9,_0xc257b1,_0xd866('0x24')));}else{_0x384416=path[_0xd866('0x21')](_0x3712ac,util[_0xd866('0x11')](_0xd866('0x25'),_0x4011d9,_0xd866('0x24')));}fs[_0xd866('0x26')](_0x384416,csv(_0x4a9c95));}})[_0xd866('0xf')](function(){if(_0x5e4b97){return new Promise(function(_0x197353){zipdir(path[_0xd866('0x21')](_0x3712ac,_0x4011d9),{'saveTo':path['join'](_0x3712ac,util[_0xd866('0x11')](_0xd866('0x25'),_0x4011d9,_0xd866('0x27')))},function(_0x4dbb0a,_0x394fdb){rimraf(path['join'](_0x3712ac,_0x4011d9),function(){});_0x197353(_0xd866('0x28'));});});}})['then'](function(){logger[_0xd866('0xa')](util[_0xd866('0x11')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xd866('0x29'),_0x5e4b97?util[_0xd866('0x11')](_0xd866('0x25'),_0x4011d9,_0x5e4b97?_0xd866('0x27'):'csv'):null);});})['catch'](function(_0xe53a6a){logger[_0xd866('0xa')](util[_0xd866('0x11')](_0xd866('0x2a'),EXTRACTED_REPORT_ID,_0xd866('0xb')),util[_0xd866('0x2b')](_0xe53a6a,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xd866('0x2c'));})['finally'](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0xea15=['dirname','.csv','existsSync','join','mkdirSync','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','split','splitSizeCsv','then','sequelize','query','QueryTypes','SELECT','num','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0xea15,0x146));var _0x5ea1=function(_0x479344,_0x5f471d){_0x479344=_0x479344-0x0;var _0x6f22a3=_0xea15[_0x479344];return _0x6f22a3;};'use strict';var util=require(_0x5ea1('0x0'));var path=require(_0x5ea1('0x1'));var _=require(_0x5ea1('0x2'));var csv=require(_0x5ea1('0x3'));var fs=require('fs');var BPromise=require(_0x5ea1('0x4'));var zipdir=require(_0x5ea1('0x5'));var rimraf=require(_0x5ea1('0x6'));var db=require(_0x5ea1('0x7'))['db'];var dbH=require(_0x5ea1('0x7'))[_0x5ea1('0x8')];var logger=require('../../config/logger')(_0x5ea1('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x5ea1('0xa')][0x2]);var QUERY=process[_0x5ea1('0xa')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x391597,_0x2dea68){var _0x29c746={'status':_0x391597};var _0x584a7b={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2dea68){_0x29c746[_0x5ea1('0xb')]=_0x2dea68;}return db[_0x5ea1('0xc')][_0x5ea1('0xd')](_0x29c746,_0x584a7b);}function main(){var _0x10aa74=0x1388;var _0x196b22;logger['info'](util[_0x5ea1('0xe')](_0x5ea1('0xf'),EXTRACTED_REPORT_ID,'CSV'));return db[_0x5ea1('0x10')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x5ea1('0x11'),_0x5ea1('0x12')]})[_0x5ea1('0x13')](function(_0x3bc83d){if(_0x3bc83d){_0x196b22=_0x3bc83d;_0x10aa74=_0x196b22['splitSizeCsv']||0x1388;}})['then'](function(){return dbH[_0x5ea1('0x14')][_0x5ea1('0x15')](util[_0x5ea1('0xe')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x5ea1('0x14')][_0x5ea1('0x16')][_0x5ea1('0x17')]});})[_0x5ea1('0x13')](function(_0x5cd466){if(!_0x5cd466[0x0][_0x5ea1('0x18')]){return analyticExtractedReport('Empty');}var _0x18b294=[];var _0x3f7e54=0x0;if(_0x196b22[_0x5ea1('0x11')]){if(_0x5cd466&&_0x5cd466[_0x5ea1('0x19')]){var _0x56d836=_[_0x5ea1('0x1a')](_0x5cd466[0x0][_0x5ea1('0x18')]/_0x10aa74);var _0x39493d=Number[_0x5ea1('0x1b')](_0x5cd466[0x0][_0x5ea1('0x18')]/_0x10aa74)?_0x5cd466[0x0][_0x5ea1('0x18')]%_0x10aa74:0x0;_0x56d836[_0x5ea1('0x1c')](function(_0x446556){if(_0x446556>0x0){_0x3f7e54+=_0x10aa74;}_0x18b294[_0x5ea1('0x1d')](dbH[_0x5ea1('0x14')][_0x5ea1('0x15')](util[_0x5ea1('0xe')](_0x5ea1('0x1e'),QUERY,_0x10aa74,_0x3f7e54),{'type':dbH[_0x5ea1('0x14')][_0x5ea1('0x16')]['SELECT']}));});if(_0x39493d>0x0){_0x3f7e54+=_0x10aa74;_0x18b294['push'](dbH[_0x5ea1('0x14')][_0x5ea1('0x15')](util['format'](_0x5ea1('0x1e'),QUERY,_0x39493d,_0x3f7e54),{'type':dbH[_0x5ea1('0x14')][_0x5ea1('0x16')][_0x5ea1('0x17')]}));}}}else{_0x18b294[_0x5ea1('0x1d')](dbH[_0x5ea1('0x14')]['query'](QUERY,{'type':dbH[_0x5ea1('0x14')]['QueryTypes'][_0x5ea1('0x17')]}));}var _0x2c2fbb=path[_0x5ea1('0x1f')](PATH);var _0xe17cf4=path['basename'](PATH,_0x5ea1('0x20'));var _0x564c7c=_0x196b22[_0x5ea1('0x11')]&&_0x18b294[_0x5ea1('0x19')]>0x1;var _0x1a0971=[];if(!fs[_0x5ea1('0x21')](path[_0x5ea1('0x22')](_0x2c2fbb,_0xe17cf4))&&_0x564c7c){fs[_0x5ea1('0x23')](path[_0x5ea1('0x22')](_0x2c2fbb,_0xe17cf4));}return BPromise[_0x5ea1('0x24')](_0x18b294,function(_0x3ea435){_0x1a0971[_0x5ea1('0x1d')](_0x3ea435);})[_0x5ea1('0x13')](function(){for(var _0x17f027=0x0;_0x17f027<_0x1a0971[_0x5ea1('0x19')];_0x17f027+=0x1){var _0x566f80;var _0x1b8101=_0x1a0971[_0x17f027];if(_0x564c7c){_0x566f80=path[_0x5ea1('0x22')](_0x2c2fbb,_0xe17cf4,util[_0x5ea1('0xe')](_0x5ea1('0x25'),_0xe17cf4,_0x17f027,_0x5ea1('0x26')));}else{_0x566f80=path[_0x5ea1('0x22')](_0x2c2fbb,util[_0x5ea1('0xe')](_0x5ea1('0x27'),_0xe17cf4,_0x5ea1('0x26')));}fs[_0x5ea1('0x28')](_0x566f80,csv(_0x1b8101));}})[_0x5ea1('0x13')](function(){if(_0x564c7c){return new Promise(function(_0x36c82b){zipdir(path['join'](_0x2c2fbb,_0xe17cf4),{'saveTo':path[_0x5ea1('0x22')](_0x2c2fbb,util[_0x5ea1('0xe')](_0x5ea1('0x27'),_0xe17cf4,_0x5ea1('0x29')))},function(_0x4728bd,_0x555a9f){rimraf(path['join'](_0x2c2fbb,_0xe17cf4),function(){});_0x36c82b(_0x5ea1('0x2a'));});});}})['then'](function(){logger[_0x5ea1('0x2b')](util[_0x5ea1('0xe')](_0x5ea1('0x2c'),EXTRACTED_REPORT_ID,_0x5ea1('0x2d')));return analyticExtractedReport('Completed',_0x564c7c?util['format'](_0x5ea1('0x27'),_0xe17cf4,_0x564c7c?_0x5ea1('0x29'):'csv'):null);});})[_0x5ea1('0x2e')](function(_0x20f49f){logger['info'](util[_0x5ea1('0xe')](_0x5ea1('0x2f'),EXTRACTED_REPORT_ID,'CSV'),util['inspect'](_0x20f49f,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x5ea1('0x30'));})[_0x5ea1('0x31')](function(){process[_0x5ea1('0x32')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index c8c978c..0e1d50a 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 _0xb3f8=['each','flatten','createPdfKitDocument','pdf','%s.%s','all','zip','zip\x20finished','info','PDF','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','createPdfFromHTML','lodash','util','path','moment','html-to-pdfmake','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','tableHeader','map','fill','length','body','push','chunk','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','format','endDate','header','pageBreak','before','margin','landscape','toString','\x20/\x20','footer','find','split','splitSizePdf','then','range','num','isInteger','forEach','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','.pdf','existsSync','join','mkdirSync'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xb3f8,0xcd));var _0x8b3f=function(_0x210d7f,_0x2abe4f){_0x210d7f=_0x210d7f-0x0;var _0x42d687=_0xb3f8[_0x210d7f];return _0x42d687;};'use strict';var _=require(_0x8b3f('0x0'));var fs=require('fs');var util=require(_0x8b3f('0x1'));var path=require(_0x8b3f('0x2'));var moment=require(_0x8b3f('0x3'));var htmlToPdfmake=require(_0x8b3f('0x4'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require('zip-dir');var rimraf=require(_0x8b3f('0x5'));var JSDOM=require(_0x8b3f('0x6'))[_0x8b3f('0x7')];var window=new JSDOM('')[_0x8b3f('0x8')];var BPromise=require(_0x8b3f('0x9'));var db=require(_0x8b3f('0xa'))['db'];var dbH=require(_0x8b3f('0xa'))[_0x8b3f('0xb')];var logger=require(_0x8b3f('0xc'))(_0x8b3f('0xd'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x8b3f('0xe')][0x3];var PATH=process[_0x8b3f('0xe')][0x4];var NAME=process[_0x8b3f('0xe')][0x5];var FORMAT=_0x8b3f('0xf');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x1f78fc,_0x54bd82){var _0x1c09a5={'status':_0x1f78fc};var _0x5161f3={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x54bd82){_0x1c09a5[_0x8b3f('0x10')]=_0x54bd82;}return db[_0x8b3f('0x11')]['update'](_0x1c09a5,_0x5161f3);}function getHeaders(_0x10f9aa){return _['map'](_0x10f9aa,function(_0x5cbda6){return{'text':_0x5cbda6,'style':_0x8b3f('0x12')};});}function getRows(_0x54781e,_0x5d607e){return _[_0x8b3f('0x13')](_0x5d607e,function(_0x2f06e9){return _(_0x2f06e9)['pick'](_0x54781e)[_0x8b3f('0x13')](function(_0x223da3){return _0x223da3?_['toString'](_0x223da3):'';})['value']();});}function createTable(_0x1f9544,_0x203ea1){var _0x1bcae3={'widths':_[_0x8b3f('0x14')](Array(_0x1f9544[_0x8b3f('0x15')]),0x91),'heights':function(_0x54bdac){return _0x54bdac===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x8ee7ae=getHeaders(_0x1f9544);_0x1bcae3[_0x8b3f('0x16')][_0x8b3f('0x17')](_0x8ee7ae);var _0xbd79a7=getRows(_0x1f9544,_0x203ea1);_0x1bcae3[_0x8b3f('0x16')]=_0x1bcae3[_0x8b3f('0x16')]['concat'](_0xbd79a7);return _0x1bcae3;}function createTables(_0x4c4c2b){var _0x4e5027=[];var _0x2b6c69=_[_0x8b3f('0x18')](Object['keys'](_0x4c4c2b[0x0]),0x5);_0x2b6c69['forEach'](function(_0x31dcdf){_0x4e5027[_0x8b3f('0x17')](createTable(_0x31dcdf,_0x4c4c2b));});return _0x4e5027;}function getPDFDocDefinition(_0x5a4a2a){var _0x582dec=util['format'](_0x8b3f('0x19'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0x8b3f('0x1a')])[_0x8b3f('0x1b')](FORMAT),moment(EXTRACTED_REPORT[_0x8b3f('0x1c')])[_0x8b3f('0x1b')](FORMAT));var _0x3558f0=[];for(var _0x31216d=0x0;_0x31216d<_0x5a4a2a[_0x8b3f('0x15')];_0x31216d++){var _0x3c5e92=[];if(_0x31216d===0x0){_0x3c5e92['push']({'text':_0x582dec,'style':_0x8b3f('0x1d')});}var _0x52ef15={'table':_0x5a4a2a[_0x31216d]};if(_0x31216d>0x0){_0x52ef15[_0x8b3f('0x1e')]=_0x8b3f('0x1f');_0x52ef15[_0x8b3f('0x20')]=[0x0,0x46,0x0,0x0];}_0x3c5e92['push'](_0x52ef15);_0x3558f0[_0x8b3f('0x17')](_0x3c5e92);}return{'pageSize':'A4','pageOrientation':_0x8b3f('0x21'),'content':_0x3558f0,'footer':function(_0x5e401c,_0xbc2ff4){return{'text':_0x5e401c[_0x8b3f('0x22')]()+_0x8b3f('0x23')+_0xbc2ff4,'style':_0x8b3f('0x24')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x39d330){var _0x5af164=0x1388;var _0x12e0b5;if(!_0x39d330[0x0]['num']){return analyticExtractedReport('Empty');}return db['Setting'][_0x8b3f('0x25')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x8b3f('0x26'),_0x8b3f('0x27')]})[_0x8b3f('0x28')](function(_0x466c17){if(_0x466c17){_0x12e0b5=_0x466c17;_0x5af164=_0x12e0b5[_0x8b3f('0x27')]||0x3e8;}})[_0x8b3f('0x28')](function(){var _0xacd8d=[];var _0x2fc238=0x0;if(_0x12e0b5['split']){if(_0x39d330&&_0x39d330[_0x8b3f('0x15')]){var _0x320627=_[_0x8b3f('0x29')](_0x39d330[0x0][_0x8b3f('0x2a')]/_0x5af164);var _0x19db74=Number[_0x8b3f('0x2b')](_0x39d330[0x0][_0x8b3f('0x2a')]/_0x5af164)?_0x39d330[0x0][_0x8b3f('0x2a')]%_0x5af164:0x0;_0x320627[_0x8b3f('0x2c')](function(_0x5ba6ee){if(_0x5ba6ee>0x0){_0x2fc238+=_0x5af164;}_0xacd8d[_0x8b3f('0x17')](dbH[_0x8b3f('0x2d')][_0x8b3f('0x2e')](util[_0x8b3f('0x1b')](_0x8b3f('0x2f'),QUERY,_0x5af164,_0x2fc238),{'type':dbH[_0x8b3f('0x2d')][_0x8b3f('0x30')][_0x8b3f('0x31')]}));});if(_0x19db74>0x0){_0x2fc238+=_0x5af164;_0xacd8d[_0x8b3f('0x17')](dbH[_0x8b3f('0x2d')][_0x8b3f('0x2e')](util[_0x8b3f('0x1b')](_0x8b3f('0x2f'),QUERY,_0x19db74,_0x2fc238),{'type':dbH['sequelize'][_0x8b3f('0x30')][_0x8b3f('0x31')]}));}}}else{_0xacd8d['push'](dbH['sequelize'][_0x8b3f('0x2e')](QUERY,{'type':dbH[_0x8b3f('0x2d')][_0x8b3f('0x30')][_0x8b3f('0x31')]}));}var _0x5f2556=path[_0x8b3f('0x32')](PATH);var _0x4c3ab9=path[_0x8b3f('0x33')](PATH,_0x8b3f('0x34'));var _0x18236b=_0x12e0b5['split']&&_0xacd8d['length']>0x1;var _0x54d22d=[];if(!fs[_0x8b3f('0x35')](path[_0x8b3f('0x36')](_0x5f2556,_0x4c3ab9))&&_0x18236b){fs[_0x8b3f('0x37')](path[_0x8b3f('0x36')](_0x5f2556,_0x4c3ab9));}return BPromise[_0x8b3f('0x38')](_0xacd8d,function(_0x9c03bc){_0x54d22d[_0x8b3f('0x17')](_0x9c03bc);})[_0x8b3f('0x28')](function(){var _0x552b93=[];for(var _0x132048=0x0;_0x132048<_0x54d22d['length'];_0x132048+=0x1){var _0x1aec86=_0x54d22d[_0x132048];var _0x3a73e9=createTables(_[_0x8b3f('0x39')](_0x1aec86));var _0x52b7f6;var _0x2af430=getPDFDocDefinition(_0x3a73e9);var _0xeffe96=getPDFPrinter();var _0x36758b=_0xeffe96[_0x8b3f('0x3a')](_0x2af430);if(_0x18236b){_0x52b7f6=path[_0x8b3f('0x36')](_0x5f2556,_0x4c3ab9,util['format']('%s%d.%s',_0x4c3ab9,_0x132048,_0x8b3f('0x3b')));}else{_0x52b7f6=path[_0x8b3f('0x36')](_0x5f2556,util['format'](_0x8b3f('0x3c'),_0x4c3ab9,'pdf'));}_0x552b93[_0x8b3f('0x17')](writePDFDocument(_0x36758b,_0x52b7f6));}return Promise[_0x8b3f('0x3d')](_0x552b93);})['then'](function(){if(_0x18236b){return new Promise(function(_0x548319){zipdir(path[_0x8b3f('0x36')](_0x5f2556,_0x4c3ab9),{'saveTo':path[_0x8b3f('0x36')](_0x5f2556,util[_0x8b3f('0x1b')](_0x8b3f('0x3c'),_0x4c3ab9,_0x8b3f('0x3e')))},function(){rimraf(path[_0x8b3f('0x36')](_0x5f2556,_0x4c3ab9),function(){});_0x548319(_0x8b3f('0x3f'));});});}})[_0x8b3f('0x28')](function(){if(!_0x18236b)return;rimraf(path['join'](_0x5f2556,_0x4c3ab9),function(){});})[_0x8b3f('0x28')](function(){logger[_0x8b3f('0x40')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x8b3f('0x41')));return analyticExtractedReport('Completed',_0x18236b?util[_0x8b3f('0x1b')]('%s.%s',_0x4c3ab9,_0x18236b?_0x8b3f('0x3e'):_0x8b3f('0x3b')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0x8b3f('0x1b')](_0x8b3f('0x42'),EXTRACTED_REPORT_ID,'PDF'));return db[_0x8b3f('0x11')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0x8b3f('0x28')](function(_0x3c331f){EXTRACTED_REPORT=_0x3c331f;return dbH[_0x8b3f('0x2d')][_0x8b3f('0x2e')](util[_0x8b3f('0x1b')](_0x8b3f('0x43'),QUERY),{'type':dbH[_0x8b3f('0x2d')][_0x8b3f('0x30')][_0x8b3f('0x31')]});})[_0x8b3f('0x28')](extractReport)[_0x8b3f('0x44')](function(_0x9f1f10){logger['info'](util[_0x8b3f('0x1b')](_0x8b3f('0x45'),EXTRACTED_REPORT_ID,_0x8b3f('0x41')),util['inspect'](_0x9f1f10,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x8b3f('0x46'));})[_0x8b3f('0x47')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x51e858=new PdfPrinter({'Arial':{'normal':__dirname+_0x8b3f('0x48'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0x8b3f('0x49'),'bolditalics':__dirname+_0x8b3f('0x4a')}});return _0x51e858;}function getPDFDocDefinitionFromHTML(_0x2359b0,_0x38b298){var _0x5a3c6c=util[_0x8b3f('0x1b')](_0x8b3f('0x4b'),_0x38b298[_0x8b3f('0x4c')],_0x38b298['interactionId']);var _0x274e7f=moment()[_0x8b3f('0x1b')](_0x8b3f('0x4d'))[_0x8b3f('0x22')]();var _0x569dbb=htmlToPdfmake(_0x2359b0,{'window':window,'tableAutoSize':!![]});return{'content':[_0x569dbb],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x8b3f('0x4e'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x8b3f('0x4e')}},'header':function(){return[{'text':_0x8b3f('0x4f'),'style':'header'}];},'footer':function(_0x32d8d6,_0x33059f){return[{'text':util[_0x8b3f('0x1b')](_0x8b3f('0x50'),_0x5a3c6c,_0x32d8d6,_0x33059f,_0x274e7f),'style':_0x8b3f('0x24')}];}};}function writePDFDocument(_0x410bf3,_0x5f05f0){return new Promise(function(_0x130125,_0x2f4efb){var _0x394762=_0x410bf3[_0x8b3f('0x51')](fs[_0x8b3f('0x52')](_0x5f05f0));_0x394762['on']('finish',function(){_0x130125(_0x8b3f('0x53'));});_0x394762['on'](_0x8b3f('0x54'),function(_0x5bc165){_0x2f4efb(_0x5bc165);});_0x410bf3[_0x8b3f('0x55')]();});}exports[_0x8b3f('0x56')]=function(_0x13afaf,_0x234366){var _0x3bdad3=getPDFPrinter();var _0x444008=getPDFDocDefinitionFromHTML(_0x13afaf,_0x234366);var _0x279ac4=_0x3bdad3['createPdfKitDocument'](_0x444008);return writePDFDocument(_0x279ac4,_0x234366[_0x8b3f('0x2')])['catch'](function(_0x3d5e65){throw _0x3d5e65;});}; \ No newline at end of file +var _0x461b=['finish','error','end','createPdfFromHTML','lodash','path','html-to-pdfmake','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','tableHeader','map','toString','value','fill','length','auto','body','concat','keys','push','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','pageBreak','before','margin','landscape','black','right','Empty','Setting','splitSizePdf','then','split','num','isInteger','forEach','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','.pdf','existsSync','join','mkdirSync','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','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','channel','interactionId','YYYY-MM-DD','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','footer','createWriteStream'];(function(_0x295fb2,_0x3d9f36){var _0x922f8=function(_0x2faef1){while(--_0x2faef1){_0x295fb2['push'](_0x295fb2['shift']());}};_0x922f8(++_0x3d9f36);}(_0x461b,0x1c1));var _0xb461=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x461b[_0x13e741];return _0x3f8bb3;};'use strict';var _=require(_0xb461('0x0'));var fs=require('fs');var util=require('util');var path=require(_0xb461('0x1'));var moment=require('moment');var htmlToPdfmake=require(_0xb461('0x2'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require('zip-dir');var rimraf=require(_0xb461('0x3'));var JSDOM=require(_0xb461('0x4'))[_0xb461('0x5')];var window=new JSDOM('')[_0xb461('0x6')];var BPromise=require(_0xb461('0x7'));var db=require('../../mysqldb')['db'];var dbH=require(_0xb461('0x8'))[_0xb461('0x9')];var logger=require(_0xb461('0xa'))(_0xb461('0xb'));var EXTRACTED_REPORT_ID=Number(process[_0xb461('0xc')][0x2]);var QUERY=process[_0xb461('0xc')][0x3];var PATH=process[_0xb461('0xc')][0x4];var NAME=process[_0xb461('0xc')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x41ef98,_0x45e058){var _0x16c115={'status':_0x41ef98};var _0x1e95dd={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x45e058){_0x16c115['savename']=_0x45e058;}return db[_0xb461('0xd')]['update'](_0x16c115,_0x1e95dd);}function getHeaders(_0x2eac4d){return _['map'](_0x2eac4d,function(_0x3867cf){return{'text':_0x3867cf,'style':_0xb461('0xe')};});}function getRows(_0x1be240,_0x259659){return _[_0xb461('0xf')](_0x259659,function(_0x33c0be){return _(_0x33c0be)['pick'](_0x1be240)[_0xb461('0xf')](function(_0x16bae0){return _0x16bae0?_[_0xb461('0x10')](_0x16bae0):'';})[_0xb461('0x11')]();});}function createTable(_0x78b1f7,_0x178620){var _0x506e9f={'widths':_[_0xb461('0x12')](Array(_0x78b1f7[_0xb461('0x13')]),0x91),'heights':function(_0x1c49a7){return _0x1c49a7===0x0?_0xb461('0x14'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x234009=getHeaders(_0x78b1f7);_0x506e9f[_0xb461('0x15')]['push'](_0x234009);var _0x2561b3=getRows(_0x78b1f7,_0x178620);_0x506e9f[_0xb461('0x15')]=_0x506e9f[_0xb461('0x15')][_0xb461('0x16')](_0x2561b3);return _0x506e9f;}function createTables(_0x339865){var _0x140745=[];var _0x1d9f77=_['chunk'](Object[_0xb461('0x17')](_0x339865[0x0]),0x5);_0x1d9f77['forEach'](function(_0x48ce6f){_0x140745[_0xb461('0x18')](createTable(_0x48ce6f,_0x339865));});return _0x140745;}function getPDFDocDefinition(_0x6b3991){var _0x317450=util[_0xb461('0x19')](_0xb461('0x1a'),NAME,EXTRACTED_REPORT[_0xb461('0x1b')],moment(EXTRACTED_REPORT[_0xb461('0x1c')])[_0xb461('0x19')](FORMAT),moment(EXTRACTED_REPORT[_0xb461('0x1d')])[_0xb461('0x19')](FORMAT));var _0x13f587=[];for(var _0x11778e=0x0;_0x11778e<_0x6b3991[_0xb461('0x13')];_0x11778e++){var _0x424172=[];if(_0x11778e===0x0){_0x424172['push']({'text':_0x317450,'style':'header'});}var _0x508ab4={'table':_0x6b3991[_0x11778e]};if(_0x11778e>0x0){_0x508ab4[_0xb461('0x1e')]=_0xb461('0x1f');_0x508ab4[_0xb461('0x20')]=[0x0,0x46,0x0,0x0];}_0x424172['push'](_0x508ab4);_0x13f587[_0xb461('0x18')](_0x424172);}return{'pageSize':'A4','pageOrientation':_0xb461('0x21'),'content':_0x13f587,'footer':function(_0x1155e4,_0x308f7a){return{'text':_0x1155e4[_0xb461('0x10')]()+'\x20/\x20'+_0x308f7a,'style':'footer'};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xb461('0x22')},'footer':{'alignment':_0xb461('0x23'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0xb7b241){var _0x42a94d=0x1388;var _0x875996;if(!_0xb7b241[0x0]['num']){return analyticExtractedReport(_0xb461('0x24'));}return db[_0xb461('0x25')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xb461('0x26')]})[_0xb461('0x27')](function(_0x18295f){if(_0x18295f){_0x875996=_0x18295f;_0x42a94d=_0x875996[_0xb461('0x26')]||0x3e8;}})[_0xb461('0x27')](function(){var _0x5b8b2a=[];var _0x3690ed=0x0;if(_0x875996[_0xb461('0x28')]){if(_0xb7b241&&_0xb7b241[_0xb461('0x13')]){var _0x2ac223=_['range'](_0xb7b241[0x0][_0xb461('0x29')]/_0x42a94d);var _0x434ecc=Number[_0xb461('0x2a')](_0xb7b241[0x0][_0xb461('0x29')]/_0x42a94d)?_0xb7b241[0x0][_0xb461('0x29')]%_0x42a94d:0x0;_0x2ac223[_0xb461('0x2b')](function(_0x1ef564){if(_0x1ef564>0x0){_0x3690ed+=_0x42a94d;}_0x5b8b2a[_0xb461('0x18')](dbH[_0xb461('0x2c')][_0xb461('0x2d')](util['format'](_0xb461('0x2e'),QUERY,_0x42a94d,_0x3690ed),{'type':dbH[_0xb461('0x2c')][_0xb461('0x2f')][_0xb461('0x30')]}));});if(_0x434ecc>0x0){_0x3690ed+=_0x42a94d;_0x5b8b2a[_0xb461('0x18')](dbH[_0xb461('0x2c')]['query'](util['format'](_0xb461('0x2e'),QUERY,_0x434ecc,_0x3690ed),{'type':dbH[_0xb461('0x2c')]['QueryTypes'][_0xb461('0x30')]}));}}}else{_0x5b8b2a[_0xb461('0x18')](dbH[_0xb461('0x2c')][_0xb461('0x2d')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0xb461('0x30')]}));}var _0x5dd375=path[_0xb461('0x31')](PATH);var _0x5e1d64=path[_0xb461('0x32')](PATH,_0xb461('0x33'));var _0x2d76a2=_0x875996[_0xb461('0x28')]&&_0x5b8b2a[_0xb461('0x13')]>0x1;var _0x3a0d9c=[];if(!fs[_0xb461('0x34')](path[_0xb461('0x35')](_0x5dd375,_0x5e1d64))&&_0x2d76a2){fs[_0xb461('0x36')](path[_0xb461('0x35')](_0x5dd375,_0x5e1d64));}return BPromise['each'](_0x5b8b2a,function(_0x5b78fa){_0x3a0d9c[_0xb461('0x18')](_0x5b78fa);})[_0xb461('0x27')](function(){var _0x2b8c05=[];for(var _0x363ad4=0x0;_0x363ad4<_0x3a0d9c[_0xb461('0x13')];_0x363ad4+=0x1){var _0xf2e981=_0x3a0d9c[_0x363ad4];var _0x26b2ea=createTables(_[_0xb461('0x37')](_0xf2e981));var _0x58c283;var _0x33c21d=getPDFDocDefinition(_0x26b2ea);var _0x41e1cb=getPDFPrinter();var _0x1c3007=_0x41e1cb[_0xb461('0x38')](_0x33c21d);if(_0x2d76a2){_0x58c283=path[_0xb461('0x35')](_0x5dd375,_0x5e1d64,util[_0xb461('0x19')](_0xb461('0x39'),_0x5e1d64,_0x363ad4,_0xb461('0x3a')));}else{_0x58c283=path[_0xb461('0x35')](_0x5dd375,util[_0xb461('0x19')]('%s.%s',_0x5e1d64,_0xb461('0x3a')));}_0x2b8c05[_0xb461('0x18')](writePDFDocument(_0x1c3007,_0x58c283));}return Promise['all'](_0x2b8c05);})[_0xb461('0x27')](function(){if(_0x2d76a2){return new Promise(function(_0x66e252){zipdir(path[_0xb461('0x35')](_0x5dd375,_0x5e1d64),{'saveTo':path['join'](_0x5dd375,util[_0xb461('0x19')](_0xb461('0x3b'),_0x5e1d64,_0xb461('0x3c')))},function(){rimraf(path['join'](_0x5dd375,_0x5e1d64),function(){});_0x66e252(_0xb461('0x3d'));});});}})[_0xb461('0x27')](function(){if(!_0x2d76a2)return;rimraf(path[_0xb461('0x35')](_0x5dd375,_0x5e1d64),function(){});})[_0xb461('0x27')](function(){logger[_0xb461('0x3e')](util['format'](_0xb461('0x3f'),EXTRACTED_REPORT_ID,_0xb461('0x40')));return analyticExtractedReport('Completed',_0x2d76a2?util[_0xb461('0x19')](_0xb461('0x3b'),_0x5e1d64,_0x2d76a2?'zip':_0xb461('0x3a')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xb461('0x3e')](util[_0xb461('0x19')](_0xb461('0x41'),EXTRACTED_REPORT_ID,'PDF'));return db[_0xb461('0xd')][_0xb461('0x42')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xb461('0x27')](function(_0x392168){EXTRACTED_REPORT=_0x392168;return dbH['sequelize'][_0xb461('0x2d')](util[_0xb461('0x19')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xb461('0x2c')]['QueryTypes'][_0xb461('0x30')]});})[_0xb461('0x27')](extractReport)[_0xb461('0x43')](function(_0x285de7){logger['info'](util[_0xb461('0x19')](_0xb461('0x44'),EXTRACTED_REPORT_ID,'PDF'),util[_0xb461('0x45')](_0x285de7,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xb461('0x46'));})[_0xb461('0x47')](function(){process[_0xb461('0x48')](EXIT_CODE);});}main();function getPDFPrinter(){var _0xd7cc69=new PdfPrinter({'Arial':{'normal':__dirname+_0xb461('0x49'),'bold':__dirname+_0xb461('0x4a'),'italics':__dirname+_0xb461('0x4b'),'bolditalics':__dirname+_0xb461('0x4c')}});return _0xd7cc69;}function getPDFDocDefinitionFromHTML(_0x55d35a,_0x263c28){var _0x583f88=util[_0xb461('0x19')](_0xb461('0x4d'),_0x263c28[_0xb461('0x4e')],_0x263c28[_0xb461('0x4f')]);var _0x562b29=moment()[_0xb461('0x19')](_0xb461('0x50'))[_0xb461('0x10')]();var _0x13878e=htmlToPdfmake(_0x55d35a,{'window':window,'tableAutoSize':!![]});return{'content':[_0x13878e],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xb461('0x51'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xb461('0x51')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':'header'}];},'footer':function(_0x4a64db,_0x4f2928){return[{'text':util[_0xb461('0x19')](_0xb461('0x52'),_0x583f88,_0x4a64db,_0x4f2928,_0x562b29),'style':_0xb461('0x53')}];}};}function writePDFDocument(_0x11d729,_0x2fb7f9){return new Promise(function(_0x4c1d28,_0x17fead){var _0x318566=_0x11d729['pipe'](fs[_0xb461('0x54')](_0x2fb7f9));_0x318566['on']('finish',function(){_0x4c1d28(_0xb461('0x55'));});_0x318566['on'](_0xb461('0x56'),function(_0x45bd03){_0x17fead(_0x45bd03);});_0x11d729[_0xb461('0x57')]();});}exports[_0xb461('0x58')]=function(_0x573749,_0x35e2dc){var _0x7de9b2=getPDFPrinter();var _0x2ae3e6=getPDFDocDefinitionFromHTML(_0x573749,_0x35e2dc);var _0x539c81=_0x7de9b2[_0xb461('0x38')](_0x2ae3e6);return writePDFDocument(_0x539c81,_0x35e2dc['path'])[_0xb461('0x43')](function(_0x356e6b){throw _0x356e6b;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 9ba44fc..97281ab 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 _0x1e7b=['update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','Empty','length','range','num','isInteger','forEach','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','binary','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','util','path','json2xls','bluebird','rimraf','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport'];(function(_0x3f378f,_0x2a7723){var _0x56d027=function(_0xf32b62){while(--_0xf32b62){_0x3f378f['push'](_0x3f378f['shift']());}};_0x56d027(++_0x2a7723);}(_0x1e7b,0x12d));var _0xb1e7=function(_0x1e1299,_0x4fbdf0){_0x1e1299=_0x1e1299-0x0;var _0x3cfaf9=_0x1e7b[_0x1e1299];return _0x3cfaf9;};'use strict';var util=require(_0xb1e7('0x0'));var path=require(_0xb1e7('0x1'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0xb1e7('0x2'));var BPromise=require(_0xb1e7('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0xb1e7('0x4'));var db=require(_0xb1e7('0x5'))['db'];var dbH=require(_0xb1e7('0x5'))[_0xb1e7('0x6')];var logger=require('../../config/logger')(_0xb1e7('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0xb1e7('0x8')][0x2]);var QUERY=process[_0xb1e7('0x8')][0x3];var PATH=process[_0xb1e7('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x3a83ba,_0x578f37){var _0x161376={'status':_0x3a83ba};var _0xca6a82={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x578f37){_0x161376[_0xb1e7('0x9')]=_0x578f37;}return db[_0xb1e7('0xa')][_0xb1e7('0xb')](_0x161376,_0xca6a82);}function main(){var _0x1c27e8=0x1388;var _0x842e0a;logger[_0xb1e7('0xc')](util[_0xb1e7('0xd')](_0xb1e7('0xe'),EXTRACTED_REPORT_ID,_0xb1e7('0xf')));return db[_0xb1e7('0x10')][_0xb1e7('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xb1e7('0x12'),_0xb1e7('0x13')]})['then'](function(_0x5894c2){if(_0x5894c2){_0x842e0a=_0x5894c2;_0x1c27e8=_0x842e0a[_0xb1e7('0x13')]||0x1388;}})[_0xb1e7('0x14')](function(){return dbH[_0xb1e7('0x15')]['query'](util[_0xb1e7('0xd')](_0xb1e7('0x16'),QUERY),{'type':dbH[_0xb1e7('0x15')]['QueryTypes'][_0xb1e7('0x17')]});})[_0xb1e7('0x14')](function(_0x276540){if(!_0x276540[0x0]['num']){return analyticExtractedReport(_0xb1e7('0x18'));}var _0x2f677d=[];var _0xe090d0=0x0;if(_0x842e0a[_0xb1e7('0x12')]){if(_0x276540&&_0x276540[_0xb1e7('0x19')]){var _0x2d1dd0=_[_0xb1e7('0x1a')](_0x276540[0x0][_0xb1e7('0x1b')]/_0x1c27e8);var _0x37de68=Number[_0xb1e7('0x1c')](_0x276540[0x0][_0xb1e7('0x1b')]/_0x1c27e8)?_0x276540[0x0][_0xb1e7('0x1b')]%_0x1c27e8:0x0;_0x2d1dd0[_0xb1e7('0x1d')](function(_0xf92d57){if(_0xf92d57>0x0){_0xe090d0+=_0x1c27e8;}_0x2f677d[_0xb1e7('0x1e')](dbH['sequelize'][_0xb1e7('0x1f')](util[_0xb1e7('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1c27e8,_0xe090d0),{'type':dbH[_0xb1e7('0x15')]['QueryTypes'][_0xb1e7('0x17')]}));});if(_0x37de68>0x0){_0xe090d0+=_0x1c27e8;_0x2f677d[_0xb1e7('0x1e')](dbH[_0xb1e7('0x15')][_0xb1e7('0x1f')](util[_0xb1e7('0xd')](_0xb1e7('0x20'),QUERY,_0x37de68,_0xe090d0),{'type':dbH['sequelize'][_0xb1e7('0x21')][_0xb1e7('0x17')]}));}}}else{_0x2f677d['push'](dbH['sequelize'][_0xb1e7('0x1f')](QUERY,{'type':dbH[_0xb1e7('0x15')][_0xb1e7('0x21')]['SELECT']}));}var _0x1265d9=path[_0xb1e7('0x22')](PATH);var _0x125eb3=path[_0xb1e7('0x23')](PATH,'.xlsx');var _0x582dcc=_0x842e0a[_0xb1e7('0x12')]&&_0x2f677d['length']>0x1;var _0x2853f9=[];if(!fs[_0xb1e7('0x24')](path[_0xb1e7('0x25')](_0x1265d9,_0x125eb3))&&_0x582dcc){fs[_0xb1e7('0x26')](path[_0xb1e7('0x25')](_0x1265d9,_0x125eb3));}return BPromise[_0xb1e7('0x27')](_0x2f677d,function(_0x2a1dd6){_0x2853f9[_0xb1e7('0x1e')](_0x2a1dd6);})[_0xb1e7('0x14')](function(){for(var _0x2ad5e7=0x0;_0x2ad5e7<_0x2853f9[_0xb1e7('0x19')];_0x2ad5e7+=0x1){var _0x235f63;var _0x2a0ede=_0x2853f9[_0x2ad5e7];if(_0x582dcc){_0x235f63=path['join'](_0x1265d9,_0x125eb3,util[_0xb1e7('0xd')](_0xb1e7('0x28'),_0x125eb3,_0x2ad5e7,_0xb1e7('0x29')));}else{_0x235f63=path[_0xb1e7('0x25')](_0x1265d9,util['format'](_0xb1e7('0x2a'),_0x125eb3,'xlsx'));}fs['writeFileSync'](_0x235f63,json2xls(_0x2a0ede),_0xb1e7('0x2b'));}})[_0xb1e7('0x14')](function(){if(_0x582dcc){return new Promise(function(_0x3d0c48){zipdir(path[_0xb1e7('0x25')](_0x1265d9,_0x125eb3),{'saveTo':path[_0xb1e7('0x25')](_0x1265d9,util['format']('%s.%s',_0x125eb3,'zip'))},function(_0x329a7a,_0x193622){rimraf(path[_0xb1e7('0x25')](_0x1265d9,_0x125eb3),function(){});_0x3d0c48(_0xb1e7('0x2c'));});});}})[_0xb1e7('0x14')](function(){logger['info'](util[_0xb1e7('0xd')](_0xb1e7('0x2d'),EXTRACTED_REPORT_ID,_0xb1e7('0xf')));return analyticExtractedReport(_0xb1e7('0x2e'),_0x582dcc?util[_0xb1e7('0xd')]('%s.%s',_0x125eb3,_0x582dcc?'zip':_0xb1e7('0x29')):null);});})[_0xb1e7('0x2f')](function(_0x213084){logger['info'](util[_0xb1e7('0xd')](_0xb1e7('0x30'),EXTRACTED_REPORT_ID,_0xb1e7('0xf')),util[_0xb1e7('0x31')](_0x213084,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xb1e7('0x32'));})['finally'](function(){process[_0xb1e7('0x33')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xf49b=['find','split','splitSizeXlsx','then','query','sequelize','QueryTypes','SELECT','length','range','num','forEach','push','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','xlsx','%s.%s','binary','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','exit','util','path','lodash','bluebird','zip-dir','rimraf','../../mysqldb','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting'];(function(_0x58c830,_0x3cbe75){var _0x10885f=function(_0x4ac2e1){while(--_0x4ac2e1){_0x58c830['push'](_0x58c830['shift']());}};_0x10885f(++_0x3cbe75);}(_0xf49b,0x7f));var _0xbf49=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf49b[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xbf49('0x0'));var path=require(_0xbf49('0x1'));var _=require(_0xbf49('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0xbf49('0x3'));var zipdir=require(_0xbf49('0x4'));var rimraf=require(_0xbf49('0x5'));var db=require('../../mysqldb')['db'];var dbH=require(_0xbf49('0x6'))['dbH'];var logger=require(_0xbf49('0x7'))(_0xbf49('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xbf49('0x9')][0x2]);var QUERY=process[_0xbf49('0x9')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x58b44f,_0x2324f7){var _0xb3dd86={'status':_0x58b44f};var _0x3b3451={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2324f7){_0xb3dd86[_0xbf49('0xa')]=_0x2324f7;}return db[_0xbf49('0xb')][_0xbf49('0xc')](_0xb3dd86,_0x3b3451);}function main(){var _0x2fd239=0x1388;var _0x24eff8;logger['info'](util[_0xbf49('0xd')](_0xbf49('0xe'),EXTRACTED_REPORT_ID,_0xbf49('0xf')));return db[_0xbf49('0x10')][_0xbf49('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xbf49('0x12'),_0xbf49('0x13')]})[_0xbf49('0x14')](function(_0x2c5788){if(_0x2c5788){_0x24eff8=_0x2c5788;_0x2fd239=_0x24eff8[_0xbf49('0x13')]||0x1388;}})[_0xbf49('0x14')](function(){return dbH['sequelize'][_0xbf49('0x15')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xbf49('0x16')][_0xbf49('0x17')][_0xbf49('0x18')]});})[_0xbf49('0x14')](function(_0x51b54b){if(!_0x51b54b[0x0]['num']){return analyticExtractedReport('Empty');}var _0x1ab51a=[];var _0x280527=0x0;if(_0x24eff8[_0xbf49('0x12')]){if(_0x51b54b&&_0x51b54b[_0xbf49('0x19')]){var _0xd2472a=_[_0xbf49('0x1a')](_0x51b54b[0x0]['num']/_0x2fd239);var _0x59a299=Number['isInteger'](_0x51b54b[0x0][_0xbf49('0x1b')]/_0x2fd239)?_0x51b54b[0x0]['num']%_0x2fd239:0x0;_0xd2472a[_0xbf49('0x1c')](function(_0x565075){if(_0x565075>0x0){_0x280527+=_0x2fd239;}_0x1ab51a[_0xbf49('0x1d')](dbH['sequelize'][_0xbf49('0x15')](util[_0xbf49('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2fd239,_0x280527),{'type':dbH[_0xbf49('0x16')][_0xbf49('0x17')][_0xbf49('0x18')]}));});if(_0x59a299>0x0){_0x280527+=_0x2fd239;_0x1ab51a[_0xbf49('0x1d')](dbH[_0xbf49('0x16')][_0xbf49('0x15')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x59a299,_0x280527),{'type':dbH['sequelize'][_0xbf49('0x17')][_0xbf49('0x18')]}));}}}else{_0x1ab51a[_0xbf49('0x1d')](dbH[_0xbf49('0x16')]['query'](QUERY,{'type':dbH[_0xbf49('0x16')][_0xbf49('0x17')][_0xbf49('0x18')]}));}var _0x2285f4=path[_0xbf49('0x1e')](PATH);var _0x39f1d7=path[_0xbf49('0x1f')](PATH,_0xbf49('0x20'));var _0xc09be6=_0x24eff8[_0xbf49('0x12')]&&_0x1ab51a[_0xbf49('0x19')]>0x1;var _0x330594=[];if(!fs[_0xbf49('0x21')](path[_0xbf49('0x22')](_0x2285f4,_0x39f1d7))&&_0xc09be6){fs[_0xbf49('0x23')](path[_0xbf49('0x22')](_0x2285f4,_0x39f1d7));}return BPromise[_0xbf49('0x24')](_0x1ab51a,function(_0x43069e){_0x330594[_0xbf49('0x1d')](_0x43069e);})['then'](function(){for(var _0x21a8c2=0x0;_0x21a8c2<_0x330594[_0xbf49('0x19')];_0x21a8c2+=0x1){var _0x37251b;var _0x584dac=_0x330594[_0x21a8c2];if(_0xc09be6){_0x37251b=path['join'](_0x2285f4,_0x39f1d7,util[_0xbf49('0xd')]('%s%d.%s',_0x39f1d7,_0x21a8c2,_0xbf49('0x25')));}else{_0x37251b=path[_0xbf49('0x22')](_0x2285f4,util[_0xbf49('0xd')](_0xbf49('0x26'),_0x39f1d7,'xlsx'));}fs['writeFileSync'](_0x37251b,json2xls(_0x584dac),_0xbf49('0x27'));}})[_0xbf49('0x14')](function(){if(_0xc09be6){return new Promise(function(_0x2fdbe3){zipdir(path[_0xbf49('0x22')](_0x2285f4,_0x39f1d7),{'saveTo':path[_0xbf49('0x22')](_0x2285f4,util[_0xbf49('0xd')](_0xbf49('0x26'),_0x39f1d7,_0xbf49('0x28')))},function(_0x33064c,_0x122fa6){rimraf(path[_0xbf49('0x22')](_0x2285f4,_0x39f1d7),function(){});_0x2fdbe3(_0xbf49('0x29'));});});}})[_0xbf49('0x14')](function(){logger[_0xbf49('0x2a')](util['format'](_0xbf49('0x2b'),EXTRACTED_REPORT_ID,_0xbf49('0xf')));return analyticExtractedReport(_0xbf49('0x2c'),_0xc09be6?util['format'](_0xbf49('0x26'),_0x39f1d7,_0xc09be6?_0xbf49('0x28'):_0xbf49('0x25')):null);});})['catch'](function(_0x4cee98){logger[_0xbf49('0x2a')](util[_0xbf49('0xd')](_0xbf49('0x2d'),EXTRACTED_REPORT_ID,'XLSX'),util['inspect'](_0x4cee98,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xbf49('0x2e'));})['finally'](function(){process[_0xbf49('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 125df14..7798ef0 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 _0xbdf1=['VoiceExtensionId','cutdigits','${EXTEN}','ExecIf','):Goto(','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','interval','*,*,*,*','IntervalId','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','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','sortBy','rewrite','lodash','util','models','Interval','findAll','then','intervals','VoiceExtension','map','exten','filter','queue','playback','hasOwnProperty','priority','extensions','extension','find','push','type','Set','format','CDR(routeid)=','context'];(function(_0x51ec5c,_0x3506ef){var _0x5b04b8=function(_0x2e741f){while(--_0x2e741f){_0x51ec5c['push'](_0x51ec5c['shift']());}};_0x5b04b8(++_0x3506ef);}(_0xbdf1,0xa2));var _0x1bdf=function(_0x96db3e,_0x5359eb){_0x96db3e=_0x96db3e-0x0;var _0x4dc76a=_0xbdf1[_0x96db3e];return _0x4dc76a;};'use strict';var _=require(_0x1bdf('0x0'));var util=require(_0x1bdf('0x1'));function rewrite(_0x36edb3,_0xa8e22a){var _0x11aea2=this;return _0x36edb3[_0x1bdf('0x2')][_0x1bdf('0x3')][_0x1bdf('0x4')]({'raw':!![]})[_0x1bdf('0x5')](function(_0x322c38){_0x11aea2[_0x1bdf('0x6')]=_0x322c38;return _0x36edb3[_0x1bdf('0x2')][_0x1bdf('0x7')][_0x1bdf('0x4')]({'where':{'IntervalId':_0xa8e22a['IntervalId']},'raw':!![]});})[_0x1bdf('0x5')](function(_0x4f7b99){return _0x36edb3[_0x1bdf('0x2')][_0x1bdf('0x7')]['findAll']({'where':{'exten':{'$in':_['uniq'](_[_0x1bdf('0x8')](_0x4f7b99,_0x1bdf('0x9')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x1bdf('0x5')](function(_0x1e3710){var _0xc02500=_[_0x1bdf('0xa')](_0x1e3710,{'priority':'1'});var _0x30e8f5=_[_0x1bdf('0xa')](_0x1e3710,{'isApp':0x1});var _0x268139=_['groupBy'](_0x30e8f5,'exten');var _0x47933b=[_0x1bdf('0xb'),_0x1bdf('0xc')];var _0x2e709b=[];var _0x401976=[];for(var _0x3048de in _0x268139){if(_0x268139[_0x1bdf('0xd')](_0x3048de)){_0x11aea2[_0x1bdf('0xe')]=0x2;_0x11aea2[_0x1bdf('0xf')]=[];_0x11aea2[_0x1bdf('0x10')]=_[_0x1bdf('0x11')](_0xc02500,{'exten':_0x268139[_0x3048de][0x0][_0x1bdf('0x9')]});_0x11aea2['extensions'][_0x1bdf('0x12')]({'type':_0x268139[_0x3048de][0x0][_0x1bdf('0x13')],'app':_0x1bdf('0x14'),'appdata':util[_0x1bdf('0x15')]('CDR(type)=%s',_0x268139[_0x3048de][0x0][_0x1bdf('0x13')]),'context':_0x268139[_0x3048de][0x0]['context'],'exten':_0x268139[_0x3048de][0x0][_0x1bdf('0x9')],'priority':_0x11aea2['priority']++,'VoiceExtensionId':_0x268139[_0x3048de][0x0]['VoiceExtensionId']});if(_0x268139[_0x3048de][0x0][_0x1bdf('0x13')]==='inbound'){_0x11aea2[_0x1bdf('0xf')][_0x1bdf('0x12')]({'type':_0x268139[_0x3048de][0x0][_0x1bdf('0x13')],'app':_0x1bdf('0x14'),'appdata':_0x1bdf('0x16')+_0x268139[_0x3048de][0x0]['VoiceExtensionId'],'context':_0x268139[_0x3048de][0x0][_0x1bdf('0x17')],'exten':_0x268139[_0x3048de][0x0][_0x1bdf('0x9')],'priority':_0x11aea2[_0x1bdf('0xe')]++,'VoiceExtensionId':_0x268139[_0x3048de][0x0][_0x1bdf('0x18')]});}else if(_0x268139[_0x3048de][0x0][_0x1bdf('0x13')]==='outbound'){if(_0x11aea2[_0x1bdf('0x10')]){_0x11aea2['extensions'][_0x1bdf('0x12')]({'type':_0x268139[_0x3048de][0x0][_0x1bdf('0x13')],'app':_0x1bdf('0x14'),'appdata':'CDR(destination)='+(_0x11aea2['extension']['cutdigits']?'${EXTEN:'+_0x11aea2[_0x1bdf('0x10')][_0x1bdf('0x19')]+'}':_0x1bdf('0x1a')),'context':_0x268139[_0x3048de][0x0]['context'],'exten':_0x268139[_0x3048de][0x0][_0x1bdf('0x9')],'priority':_0x11aea2[_0x1bdf('0xe')]++,'VoiceExtensionId':_0x268139[_0x3048de][0x0][_0x1bdf('0x18')]});}_0x11aea2[_0x1bdf('0xf')]['push']({'type':_0x268139[_0x3048de][0x0][_0x1bdf('0x13')],'app':_0x1bdf('0x14'),'appdata':_0x1bdf('0x16')+_0x268139[_0x3048de][0x0][_0x1bdf('0x18')],'context':_0x268139[_0x3048de][0x0][_0x1bdf('0x17')],'exten':_0x268139[_0x3048de][0x0][_0x1bdf('0x9')],'priority':_0x11aea2['priority']++,'VoiceExtensionId':_0x268139[_0x3048de][0x0][_0x1bdf('0x18')]});var _0x3e2fbb=_0x11aea2[_0x1bdf('0xe')]++;_0x11aea2[_0x1bdf('0xf')][_0x1bdf('0x12')]({'type':_0x268139[_0x3048de][0x0][_0x1bdf('0x13')],'app':_0x1bdf('0x1b'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x3e2fbb+0x2)+_0x1bdf('0x1c')+(_0x3e2fbb+0x1)+')','context':_0x268139[_0x3048de][0x0]['context'],'exten':_0x268139[_0x3048de][0x0][_0x1bdf('0x9')],'priority':_0x3e2fbb,'VoiceExtensionId':_0x268139[_0x3048de][0x0][_0x1bdf('0x18')]});if(_0x11aea2[_0x1bdf('0x10')]){_0x11aea2[_0x1bdf('0xf')]['push']({'type':_0x268139[_0x3048de][0x0][_0x1bdf('0x13')],'app':_0x1bdf('0x14'),'appdata':_0x11aea2[_0x1bdf('0x10')]['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0x11aea2[_0x1bdf('0x10')][_0x1bdf('0x19')]+'}':'CDR(prefix)=noprefix','context':_0x268139[_0x3048de][0x0][_0x1bdf('0x17')],'exten':_0x268139[_0x3048de][0x0][_0x1bdf('0x9')],'priority':_0x11aea2[_0x1bdf('0xe')]++,'VoiceExtensionId':_0x268139[_0x3048de][0x0]['VoiceExtensionId']});}_0x11aea2[_0x1bdf('0xf')][_0x1bdf('0x12')]({'type':_0x268139[_0x3048de][0x0][_0x1bdf('0x13')],'app':_0x1bdf('0x14'),'appdata':_0x1bdf('0x1d')+_0x268139[_0x3048de][0x0]['VoiceExtensionId'],'context':_0x268139[_0x3048de][0x0][_0x1bdf('0x17')],'exten':_0x268139[_0x3048de][0x0][_0x1bdf('0x9')],'priority':_0x11aea2['priority']++,'VoiceExtensionId':_0x268139[_0x3048de][0x0][_0x1bdf('0x18')]});if(_0x11aea2[_0x1bdf('0x10')]&&_0x11aea2[_0x1bdf('0x10')]['hasOwnProperty']('recordingFormat')&&_0x11aea2[_0x1bdf('0x10')][_0x1bdf('0x1e')]!=='none'){_0x11aea2[_0x1bdf('0xf')][_0x1bdf('0x12')]({'type':_0x268139[_0x3048de][0x0][_0x1bdf('0x13')],'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x268139[_0x3048de][0x0][_0x1bdf('0x17')],'exten':_0x268139[_0x3048de][0x0][_0x1bdf('0x9')],'priority':_0x11aea2['priority']++,'VoiceExtensionId':_0x268139[_0x3048de][0x0][_0x1bdf('0x18')]});_0x11aea2[_0x1bdf('0xf')][_0x1bdf('0x12')]({'type':_0x268139[_0x3048de][0x0]['type'],'app':_0x1bdf('0x14'),'appdata':_0x1bdf('0x1f')+_0x11aea2[_0x1bdf('0x10')]['recordingFormat']||_0x1bdf('0x20'),'context':_0x268139[_0x3048de][0x0][_0x1bdf('0x17')],'exten':_0x268139[_0x3048de][0x0][_0x1bdf('0x9')],'priority':_0x11aea2[_0x1bdf('0xe')]++,'VoiceExtensionId':_0x268139[_0x3048de][0x0][_0x1bdf('0x18')]});}}_0x11aea2[_0x1bdf('0xf')][_0x1bdf('0x12')]({'type':_0x268139[_0x3048de][0x0]['type'],'app':'Set','appdata':_0x1bdf('0x21'),'context':_0x268139[_0x3048de][0x0][_0x1bdf('0x17')],'exten':_0x268139[_0x3048de][0x0][_0x1bdf('0x9')],'priority':_0x11aea2[_0x1bdf('0xe')]++,'VoiceExtensionId':_0x268139[_0x3048de][0x0][_0x1bdf('0x18')]});_0x11aea2[_0x1bdf('0xf')][_0x1bdf('0x12')]({'type':_0x268139[_0x3048de][0x0][_0x1bdf('0x13')],'app':_0x1bdf('0x14'),'appdata':_0x1bdf('0x22'),'context':_0x268139[_0x3048de][0x0][_0x1bdf('0x17')],'exten':_0x268139[_0x3048de][0x0][_0x1bdf('0x9')],'priority':_0x11aea2['priority']++,'VoiceExtensionId':_0x268139[_0x3048de][0x0]['VoiceExtensionId']});_0x11aea2[_0x1bdf('0xf')][_0x1bdf('0x12')]({'type':_0x268139[_0x3048de][0x0]['type'],'app':_0x1bdf('0x14'),'appdata':_0x1bdf('0x23'),'context':_0x268139[_0x3048de][0x0][_0x1bdf('0x17')],'exten':_0x268139[_0x3048de][0x0]['exten'],'priority':_0x11aea2[_0x1bdf('0xe')]++,'VoiceExtensionId':_0x268139[_0x3048de][0x0][_0x1bdf('0x18')]});for(var _0x339bed=0x0,_0x62b75b=0x0;_0x339bed<_0x268139[_0x3048de][_0x1bdf('0x24')];_0x339bed+=0x1,_0x62b75b=0x0){var _0x10d1e9=_0x268139[_0x3048de][_0x339bed];if(_0x10d1e9[_0x1bdf('0x13')]){_0x10d1e9['type']=_0x10d1e9[_0x1bdf('0x13')][_0x1bdf('0x25')]();}var _0x4c7878=[];var _0x282927=[];delete _0x10d1e9['id'];delete _0x10d1e9[_0x1bdf('0x26')];delete _0x10d1e9['updatedAt'];var _0x44bada=_0x10d1e9[_0x1bdf('0x27')]!==_0x1bdf('0x28')?[_0x10d1e9[_0x1bdf('0x27')]]:_0x10d1e9[_0x1bdf('0x29')]?_['map'](_[_0x1bdf('0xa')](_0x11aea2[_0x1bdf('0x6')],{'IntervalId':_0x10d1e9[_0x1bdf('0x29')]}),_0x1bdf('0x27')):[];if(_0x10d1e9[_0x1bdf('0xd')](_0x1bdf('0x2a'))){if(_0x10d1e9['tag']&&_0x10d1e9[_0x1bdf('0x2a')]!=='--'){_0x4c7878[_0x1bdf('0x12')]({'type':_0x10d1e9[_0x1bdf('0x13')],'app':_0x1bdf('0x14'),'appdata':_0x1bdf('0x2b')+_0x10d1e9[_0x1bdf('0x2a')],'context':_0x10d1e9['context'],'exten':_0x10d1e9['exten'],'priority':_0x44bada[_0x1bdf('0x24')]+_0x11aea2[_0x1bdf('0xe')]+_0x62b75b++,'VoiceExtensionId':_0x10d1e9[_0x1bdf('0x18')]});}}if(_0x10d1e9[_0x1bdf('0x13')]==='outbound'&&_0x10d1e9[_0x1bdf('0xd')](_0x1bdf('0x2c'))){if(_0x10d1e9[_0x1bdf('0x2c')]){_0x4c7878[_0x1bdf('0x12')]({'type':_0x10d1e9[_0x1bdf('0x13')],'app':_0x1bdf('0x1b'),'appdata':_0x1bdf('0x2d')+_0x10d1e9['callerID']+')','context':_0x10d1e9[_0x1bdf('0x17')],'exten':_0x10d1e9['exten'],'priority':_0x44bada[_0x1bdf('0x24')]+_0x11aea2['priority']+_0x62b75b++,'VoiceExtensionId':_0x10d1e9[_0x1bdf('0x18')]});}else{_0x4c7878[_0x1bdf('0x12')]({'type':_0x10d1e9[_0x1bdf('0x13')],'app':_0x1bdf('0x1b'),'appdata':_0x1bdf('0x2e'),'context':_0x10d1e9[_0x1bdf('0x17')],'exten':_0x10d1e9[_0x1bdf('0x9')],'priority':_0x44bada[_0x1bdf('0x24')]+_0x11aea2['priority']+_0x62b75b++,'VoiceExtensionId':_0x10d1e9[_0x1bdf('0x18')]});}}if(_0x10d1e9['hasOwnProperty'](_0x1bdf('0x2f'))){if(_0x47933b['indexOf'](_0x10d1e9[_0x1bdf('0x30')][_0x1bdf('0x25')]())>=0x0&&_0x10d1e9[_0x1bdf('0x31')]!==_0x1bdf('0x32')){if(_0x10d1e9['answer']){_0x4c7878[_0x1bdf('0x12')]({'type':_0x10d1e9['type'],'app':_0x1bdf('0x1b'),'appdata':_0x1bdf('0x33'),'context':_0x10d1e9[_0x1bdf('0x17')],'exten':_0x10d1e9['exten'],'priority':_0x44bada['length']+_0x11aea2[_0x1bdf('0xe')]+_0x62b75b++,'VoiceExtensionId':_0x10d1e9['VoiceExtensionId']});_0x4c7878[_0x1bdf('0x12')]({'type':_0x10d1e9[_0x1bdf('0x13')],'app':_0x1bdf('0x14'),'appdata':_0x1bdf('0x34'),'context':_0x10d1e9['context'],'exten':_0x10d1e9['exten'],'priority':_0x44bada['length']+_0x11aea2[_0x1bdf('0xe')]+_0x62b75b++,'VoiceExtensionId':_0x10d1e9['VoiceExtensionId']});}else{_0x4c7878['push']({'type':_0x10d1e9[_0x1bdf('0x13')],'app':'ExecIf','appdata':_0x1bdf('0x35'),'context':_0x10d1e9[_0x1bdf('0x17')],'exten':_0x10d1e9[_0x1bdf('0x9')],'priority':_0x44bada['length']+_0x11aea2[_0x1bdf('0xe')]+_0x62b75b++,'VoiceExtensionId':_0x10d1e9[_0x1bdf('0x18')]});_0x4c7878['push']({'type':_0x10d1e9['type'],'app':_0x1bdf('0x14'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x10d1e9[_0x1bdf('0x17')],'exten':_0x10d1e9[_0x1bdf('0x9')],'priority':_0x44bada[_0x1bdf('0x24')]+_0x11aea2['priority']+_0x62b75b++,'VoiceExtensionId':_0x10d1e9[_0x1bdf('0x18')]});}}}for(var _0x54d258=0x0;_0x54d258<_0x44bada['length'];_0x54d258+=0x1){var _0x238d48=_0x11aea2[_0x1bdf('0xe')]+_0x44bada[_0x1bdf('0x24')];var _0x1a8f51=_0x54d258===_0x44bada[_0x1bdf('0x24')]-0x1?_0x11aea2[_0x1bdf('0xe')]+_0x4c7878[_0x1bdf('0x24')]+_0x282927[_0x1bdf('0x24')]+0x2:_0x11aea2['priority']+_0x54d258+0x1;_0x4c7878[_0x1bdf('0x36')](_0x54d258,0x0,{'type':_0x10d1e9['type'],'app':_0x1bdf('0x37'),'appdata':_0x44bada[_0x54d258]+'?'+_0x10d1e9[_0x1bdf('0x17')]+_0x1bdf('0x38')+_0x238d48+':'+_0x10d1e9[_0x1bdf('0x17')]+_0x1bdf('0x38')+_0x1a8f51,'exten':_0x10d1e9['exten'],'context':_0x10d1e9[_0x1bdf('0x17')],'priority':_0x11aea2[_0x1bdf('0xe')]+_0x54d258,'VoiceExtensionId':_0x268139[_0x3048de][0x0]['VoiceExtensionId']});}_0x10d1e9[_0x1bdf('0xe')]=_0x4c7878[_0x1bdf('0x24')]?_[_0x1bdf('0x39')](_0x4c7878)[_0x1bdf('0xe')]+0x1:_0x11aea2['priority'];_0x11aea2[_0x1bdf('0xe')]=(_0x282927[_0x1bdf('0x24')]?_[_0x1bdf('0x39')](_0x282927)[_0x1bdf('0xe')]:_0x10d1e9['priority'])+0x1;_0x11aea2['extensions']=_[_0x1bdf('0x3a')](_0x11aea2[_0x1bdf('0xf')],_0x4c7878,[_0x10d1e9],_0x282927);}_0x11aea2[_0x1bdf('0xf')][_0x1bdf('0x12')]({'type':_0x268139[_0x3048de][0x0][_0x1bdf('0x13')],'app':_0x1bdf('0x3b'),'exten':_0x268139[_0x3048de][0x0][_0x1bdf('0x9')],'context':_0x268139[_0x3048de][0x0][_0x1bdf('0x17')],'priority':_0x11aea2[_0x1bdf('0xe')],'VoiceExtensionId':_0x268139[_0x3048de][0x0]['VoiceExtensionId']});_0x2e709b[_0x1bdf('0x12')](_0x268139[_0x3048de][0x0]['VoiceExtensionId']);_0x401976=_[_0x1bdf('0x3a')](_0x401976,_0x11aea2[_0x1bdf('0xf')]);}}return _0x36edb3['transaction'](function(_0x10d43b){return _0x36edb3['models']['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':{'$in':_0x2e709b}},'transaction':_0x10d43b})[_0x1bdf('0x5')](function(_0x5e8ae4){return _0x36edb3[_0x1bdf('0x2')][_0x1bdf('0x7')]['bulkCreate'](_[_0x1bdf('0x3c')](_0x401976,_0x1bdf('0xe')),{'transaction':_0x10d43b});});});})['catch'](function(_0x128abc){console['error'](_0x128abc);});}exports[_0x1bdf('0x3d')]=rewrite; \ No newline at end of file +var _0x4ecf=['inbound','CDR(routeid)=','context','outbound','CDR(destination)=','cutdigits','push','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','updatedAt','interval','*,*,*,*','intervals','tag','CDR(tag)=','callerID','answer','indexOf','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime','last','concat','transaction','destroy','catch','error','rewrite','lodash','util','models','Interval','findAll','then','VoiceExtension','IntervalId','map','filter','groupBy','exten','queue','hasOwnProperty','priority','extensions','extension','find','type','Set','format','VoiceExtensionId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4ecf,0x170));var _0xf4ec=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x4ecf[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xf4ec('0x0'));var util=require(_0xf4ec('0x1'));function rewrite(_0x28d80f,_0x460825){var _0x2ebef4=this;return _0x28d80f[_0xf4ec('0x2')][_0xf4ec('0x3')][_0xf4ec('0x4')]({'raw':!![]})[_0xf4ec('0x5')](function(_0xed429b){_0x2ebef4['intervals']=_0xed429b;return _0x28d80f[_0xf4ec('0x2')][_0xf4ec('0x6')]['findAll']({'where':{'IntervalId':_0x460825[_0xf4ec('0x7')]},'raw':!![]});})['then'](function(_0x4b3ee2){return _0x28d80f[_0xf4ec('0x2')][_0xf4ec('0x6')][_0xf4ec('0x4')]({'where':{'exten':{'$in':_['uniq'](_[_0xf4ec('0x8')](_0x4b3ee2,'exten'))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0xf4ec('0x5')](function(_0x4cee23){var _0x5b7f86=_[_0xf4ec('0x9')](_0x4cee23,{'priority':'1'});var _0xb67d75=_['filter'](_0x4cee23,{'isApp':0x1});var _0x4f4e19=_[_0xf4ec('0xa')](_0xb67d75,_0xf4ec('0xb'));var _0x45a665=[_0xf4ec('0xc'),'playback'];var _0x3f5840=[];var _0xd1987f=[];for(var _0x384b11 in _0x4f4e19){if(_0x4f4e19[_0xf4ec('0xd')](_0x384b11)){_0x2ebef4[_0xf4ec('0xe')]=0x2;_0x2ebef4[_0xf4ec('0xf')]=[];_0x2ebef4[_0xf4ec('0x10')]=_[_0xf4ec('0x11')](_0x5b7f86,{'exten':_0x4f4e19[_0x384b11][0x0][_0xf4ec('0xb')]});_0x2ebef4[_0xf4ec('0xf')]['push']({'type':_0x4f4e19[_0x384b11][0x0][_0xf4ec('0x12')],'app':_0xf4ec('0x13'),'appdata':util[_0xf4ec('0x14')]('CDR(type)=%s',_0x4f4e19[_0x384b11][0x0][_0xf4ec('0x12')]),'context':_0x4f4e19[_0x384b11][0x0]['context'],'exten':_0x4f4e19[_0x384b11][0x0][_0xf4ec('0xb')],'priority':_0x2ebef4[_0xf4ec('0xe')]++,'VoiceExtensionId':_0x4f4e19[_0x384b11][0x0][_0xf4ec('0x15')]});if(_0x4f4e19[_0x384b11][0x0]['type']===_0xf4ec('0x16')){_0x2ebef4[_0xf4ec('0xf')]['push']({'type':_0x4f4e19[_0x384b11][0x0][_0xf4ec('0x12')],'app':'Set','appdata':_0xf4ec('0x17')+_0x4f4e19[_0x384b11][0x0]['VoiceExtensionId'],'context':_0x4f4e19[_0x384b11][0x0][_0xf4ec('0x18')],'exten':_0x4f4e19[_0x384b11][0x0][_0xf4ec('0xb')],'priority':_0x2ebef4[_0xf4ec('0xe')]++,'VoiceExtensionId':_0x4f4e19[_0x384b11][0x0][_0xf4ec('0x15')]});}else if(_0x4f4e19[_0x384b11][0x0][_0xf4ec('0x12')]===_0xf4ec('0x19')){if(_0x2ebef4[_0xf4ec('0x10')]){_0x2ebef4[_0xf4ec('0xf')]['push']({'type':_0x4f4e19[_0x384b11][0x0][_0xf4ec('0x12')],'app':_0xf4ec('0x13'),'appdata':_0xf4ec('0x1a')+(_0x2ebef4['extension']['cutdigits']?'${EXTEN:'+_0x2ebef4['extension'][_0xf4ec('0x1b')]+'}':'${EXTEN}'),'context':_0x4f4e19[_0x384b11][0x0][_0xf4ec('0x18')],'exten':_0x4f4e19[_0x384b11][0x0][_0xf4ec('0xb')],'priority':_0x2ebef4[_0xf4ec('0xe')]++,'VoiceExtensionId':_0x4f4e19[_0x384b11][0x0]['VoiceExtensionId']});}_0x2ebef4[_0xf4ec('0xf')]['push']({'type':_0x4f4e19[_0x384b11][0x0][_0xf4ec('0x12')],'app':_0xf4ec('0x13'),'appdata':_0xf4ec('0x17')+_0x4f4e19[_0x384b11][0x0][_0xf4ec('0x15')],'context':_0x4f4e19[_0x384b11][0x0][_0xf4ec('0x18')],'exten':_0x4f4e19[_0x384b11][0x0][_0xf4ec('0xb')],'priority':_0x2ebef4[_0xf4ec('0xe')]++,'VoiceExtensionId':_0x4f4e19[_0x384b11][0x0]['VoiceExtensionId']});var _0x5d8b82=_0x2ebef4[_0xf4ec('0xe')]++;_0x2ebef4['extensions'][_0xf4ec('0x1c')]({'type':_0x4f4e19[_0x384b11][0x0][_0xf4ec('0x12')],'app':_0xf4ec('0x1d'),'appdata':_0xf4ec('0x1e')+(_0x5d8b82+0x2)+_0xf4ec('0x1f')+(_0x5d8b82+0x1)+')','context':_0x4f4e19[_0x384b11][0x0]['context'],'exten':_0x4f4e19[_0x384b11][0x0][_0xf4ec('0xb')],'priority':_0x5d8b82,'VoiceExtensionId':_0x4f4e19[_0x384b11][0x0][_0xf4ec('0x15')]});if(_0x2ebef4[_0xf4ec('0x10')]){_0x2ebef4[_0xf4ec('0xf')][_0xf4ec('0x1c')]({'type':_0x4f4e19[_0x384b11][0x0][_0xf4ec('0x12')],'app':_0xf4ec('0x13'),'appdata':_0x2ebef4['extension'][_0xf4ec('0x1b')]?'CDR(prefix)=${EXTEN:0:'+_0x2ebef4[_0xf4ec('0x10')][_0xf4ec('0x1b')]+'}':_0xf4ec('0x20'),'context':_0x4f4e19[_0x384b11][0x0][_0xf4ec('0x18')],'exten':_0x4f4e19[_0x384b11][0x0][_0xf4ec('0xb')],'priority':_0x2ebef4[_0xf4ec('0xe')]++,'VoiceExtensionId':_0x4f4e19[_0x384b11][0x0][_0xf4ec('0x15')]});}_0x2ebef4[_0xf4ec('0xf')][_0xf4ec('0x1c')]({'type':_0x4f4e19[_0x384b11][0x0][_0xf4ec('0x12')],'app':_0xf4ec('0x13'),'appdata':_0xf4ec('0x21')+_0x4f4e19[_0x384b11][0x0][_0xf4ec('0x15')],'context':_0x4f4e19[_0x384b11][0x0]['context'],'exten':_0x4f4e19[_0x384b11][0x0]['exten'],'priority':_0x2ebef4[_0xf4ec('0xe')]++,'VoiceExtensionId':_0x4f4e19[_0x384b11][0x0]['VoiceExtensionId']});if(_0x2ebef4[_0xf4ec('0x10')]&&_0x2ebef4[_0xf4ec('0x10')][_0xf4ec('0xd')]('recordingFormat')&&_0x2ebef4[_0xf4ec('0x10')][_0xf4ec('0x22')]!==_0xf4ec('0x23')){_0x2ebef4['extensions'][_0xf4ec('0x1c')]({'type':_0x4f4e19[_0x384b11][0x0][_0xf4ec('0x12')],'app':'Set','appdata':_0xf4ec('0x24'),'context':_0x4f4e19[_0x384b11][0x0][_0xf4ec('0x18')],'exten':_0x4f4e19[_0x384b11][0x0][_0xf4ec('0xb')],'priority':_0x2ebef4[_0xf4ec('0xe')]++,'VoiceExtensionId':_0x4f4e19[_0x384b11][0x0][_0xf4ec('0x15')]});_0x2ebef4[_0xf4ec('0xf')][_0xf4ec('0x1c')]({'type':_0x4f4e19[_0x384b11][0x0][_0xf4ec('0x12')],'app':'Set','appdata':_0xf4ec('0x25')+_0x2ebef4['extension'][_0xf4ec('0x22')]||'wav','context':_0x4f4e19[_0x384b11][0x0]['context'],'exten':_0x4f4e19[_0x384b11][0x0][_0xf4ec('0xb')],'priority':_0x2ebef4['priority']++,'VoiceExtensionId':_0x4f4e19[_0x384b11][0x0][_0xf4ec('0x15')]});}}_0x2ebef4[_0xf4ec('0xf')][_0xf4ec('0x1c')]({'type':_0x4f4e19[_0x384b11][0x0][_0xf4ec('0x12')],'app':_0xf4ec('0x13'),'appdata':_0xf4ec('0x26'),'context':_0x4f4e19[_0x384b11][0x0][_0xf4ec('0x18')],'exten':_0x4f4e19[_0x384b11][0x0][_0xf4ec('0xb')],'priority':_0x2ebef4[_0xf4ec('0xe')]++,'VoiceExtensionId':_0x4f4e19[_0x384b11][0x0][_0xf4ec('0x15')]});_0x2ebef4[_0xf4ec('0xf')][_0xf4ec('0x1c')]({'type':_0x4f4e19[_0x384b11][0x0]['type'],'app':_0xf4ec('0x13'),'appdata':_0xf4ec('0x27'),'context':_0x4f4e19[_0x384b11][0x0][_0xf4ec('0x18')],'exten':_0x4f4e19[_0x384b11][0x0][_0xf4ec('0xb')],'priority':_0x2ebef4[_0xf4ec('0xe')]++,'VoiceExtensionId':_0x4f4e19[_0x384b11][0x0]['VoiceExtensionId']});_0x2ebef4[_0xf4ec('0xf')]['push']({'type':_0x4f4e19[_0x384b11][0x0][_0xf4ec('0x12')],'app':_0xf4ec('0x13'),'appdata':_0xf4ec('0x28'),'context':_0x4f4e19[_0x384b11][0x0][_0xf4ec('0x18')],'exten':_0x4f4e19[_0x384b11][0x0][_0xf4ec('0xb')],'priority':_0x2ebef4['priority']++,'VoiceExtensionId':_0x4f4e19[_0x384b11][0x0]['VoiceExtensionId']});for(var _0xa1967d=0x0,_0x939c82=0x0;_0xa1967d<_0x4f4e19[_0x384b11][_0xf4ec('0x29')];_0xa1967d+=0x1,_0x939c82=0x0){var _0x269791=_0x4f4e19[_0x384b11][_0xa1967d];if(_0x269791[_0xf4ec('0x12')]){_0x269791[_0xf4ec('0x12')]=_0x269791[_0xf4ec('0x12')][_0xf4ec('0x2a')]();}var _0x24e1f0=[];var _0x54c549=[];delete _0x269791['id'];delete _0x269791['createdAt'];delete _0x269791[_0xf4ec('0x2b')];var _0x1f0693=_0x269791[_0xf4ec('0x2c')]!==_0xf4ec('0x2d')?[_0x269791['interval']]:_0x269791[_0xf4ec('0x7')]?_[_0xf4ec('0x8')](_[_0xf4ec('0x9')](_0x2ebef4[_0xf4ec('0x2e')],{'IntervalId':_0x269791[_0xf4ec('0x7')]}),'interval'):[];if(_0x269791[_0xf4ec('0xd')](_0xf4ec('0x2f'))){if(_0x269791[_0xf4ec('0x2f')]&&_0x269791[_0xf4ec('0x2f')]!=='--'){_0x24e1f0[_0xf4ec('0x1c')]({'type':_0x269791[_0xf4ec('0x12')],'app':_0xf4ec('0x13'),'appdata':_0xf4ec('0x30')+_0x269791[_0xf4ec('0x2f')],'context':_0x269791[_0xf4ec('0x18')],'exten':_0x269791[_0xf4ec('0xb')],'priority':_0x1f0693[_0xf4ec('0x29')]+_0x2ebef4[_0xf4ec('0xe')]+_0x939c82++,'VoiceExtensionId':_0x269791[_0xf4ec('0x15')]});}}if(_0x269791[_0xf4ec('0x12')]==='outbound'&&_0x269791[_0xf4ec('0xd')](_0xf4ec('0x31'))){if(_0x269791[_0xf4ec('0x31')]){_0x24e1f0[_0xf4ec('0x1c')]({'type':_0x269791[_0xf4ec('0x12')],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x269791['callerID']+')','context':_0x269791[_0xf4ec('0x18')],'exten':_0x269791[_0xf4ec('0xb')],'priority':_0x1f0693[_0xf4ec('0x29')]+_0x2ebef4['priority']+_0x939c82++,'VoiceExtensionId':_0x269791[_0xf4ec('0x15')]});}else{_0x24e1f0[_0xf4ec('0x1c')]({'type':_0x269791['type'],'app':_0xf4ec('0x1d'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x269791[_0xf4ec('0x18')],'exten':_0x269791[_0xf4ec('0xb')],'priority':_0x1f0693['length']+_0x2ebef4[_0xf4ec('0xe')]+_0x939c82++,'VoiceExtensionId':_0x269791[_0xf4ec('0x15')]});}}if(_0x269791['hasOwnProperty'](_0xf4ec('0x32'))){if(_0x45a665[_0xf4ec('0x33')](_0x269791[_0xf4ec('0x34')][_0xf4ec('0x2a')]())>=0x0&&_0x269791[_0xf4ec('0x35')]!=='custom'){if(_0x269791['answer']){_0x24e1f0[_0xf4ec('0x1c')]({'type':_0x269791[_0xf4ec('0x12')],'app':'ExecIf','appdata':_0xf4ec('0x36'),'context':_0x269791[_0xf4ec('0x18')],'exten':_0x269791[_0xf4ec('0xb')],'priority':_0x1f0693[_0xf4ec('0x29')]+_0x2ebef4['priority']+_0x939c82++,'VoiceExtensionId':_0x269791['VoiceExtensionId']});_0x24e1f0['push']({'type':_0x269791[_0xf4ec('0x12')],'app':_0xf4ec('0x13'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x269791[_0xf4ec('0x18')],'exten':_0x269791[_0xf4ec('0xb')],'priority':_0x1f0693[_0xf4ec('0x29')]+_0x2ebef4[_0xf4ec('0xe')]+_0x939c82++,'VoiceExtensionId':_0x269791[_0xf4ec('0x15')]});}else{_0x24e1f0[_0xf4ec('0x1c')]({'type':_0x269791[_0xf4ec('0x12')],'app':'ExecIf','appdata':_0xf4ec('0x37'),'context':_0x269791[_0xf4ec('0x18')],'exten':_0x269791['exten'],'priority':_0x1f0693[_0xf4ec('0x29')]+_0x2ebef4['priority']+_0x939c82++,'VoiceExtensionId':_0x269791['VoiceExtensionId']});_0x24e1f0['push']({'type':_0x269791[_0xf4ec('0x12')],'app':_0xf4ec('0x13'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x269791[_0xf4ec('0x18')],'exten':_0x269791['exten'],'priority':_0x1f0693[_0xf4ec('0x29')]+_0x2ebef4[_0xf4ec('0xe')]+_0x939c82++,'VoiceExtensionId':_0x269791[_0xf4ec('0x15')]});}}}for(var _0x9a99a5=0x0;_0x9a99a5<_0x1f0693[_0xf4ec('0x29')];_0x9a99a5+=0x1){var _0x2e89b3=_0x2ebef4[_0xf4ec('0xe')]+_0x1f0693['length'];var _0x225a00=_0x9a99a5===_0x1f0693[_0xf4ec('0x29')]-0x1?_0x2ebef4[_0xf4ec('0xe')]+_0x24e1f0[_0xf4ec('0x29')]+_0x54c549[_0xf4ec('0x29')]+0x2:_0x2ebef4[_0xf4ec('0xe')]+_0x9a99a5+0x1;_0x24e1f0[_0xf4ec('0x38')](_0x9a99a5,0x0,{'type':_0x269791[_0xf4ec('0x12')],'app':_0xf4ec('0x39'),'appdata':_0x1f0693[_0x9a99a5]+'?'+_0x269791[_0xf4ec('0x18')]+',${EXTEN},'+_0x2e89b3+':'+_0x269791[_0xf4ec('0x18')]+',${EXTEN},'+_0x225a00,'exten':_0x269791[_0xf4ec('0xb')],'context':_0x269791[_0xf4ec('0x18')],'priority':_0x2ebef4[_0xf4ec('0xe')]+_0x9a99a5,'VoiceExtensionId':_0x4f4e19[_0x384b11][0x0][_0xf4ec('0x15')]});}_0x269791['priority']=_0x24e1f0[_0xf4ec('0x29')]?_[_0xf4ec('0x3a')](_0x24e1f0)[_0xf4ec('0xe')]+0x1:_0x2ebef4[_0xf4ec('0xe')];_0x2ebef4[_0xf4ec('0xe')]=(_0x54c549[_0xf4ec('0x29')]?_[_0xf4ec('0x3a')](_0x54c549)[_0xf4ec('0xe')]:_0x269791[_0xf4ec('0xe')])+0x1;_0x2ebef4[_0xf4ec('0xf')]=_[_0xf4ec('0x3b')](_0x2ebef4[_0xf4ec('0xf')],_0x24e1f0,[_0x269791],_0x54c549);}_0x2ebef4[_0xf4ec('0xf')]['push']({'type':_0x4f4e19[_0x384b11][0x0][_0xf4ec('0x12')],'app':'Hangup','exten':_0x4f4e19[_0x384b11][0x0][_0xf4ec('0xb')],'context':_0x4f4e19[_0x384b11][0x0][_0xf4ec('0x18')],'priority':_0x2ebef4[_0xf4ec('0xe')],'VoiceExtensionId':_0x4f4e19[_0x384b11][0x0]['VoiceExtensionId']});_0x3f5840['push'](_0x4f4e19[_0x384b11][0x0][_0xf4ec('0x15')]);_0xd1987f=_[_0xf4ec('0x3b')](_0xd1987f,_0x2ebef4[_0xf4ec('0xf')]);}}return _0x28d80f[_0xf4ec('0x3c')](function(_0x46b0d7){return _0x28d80f['models'][_0xf4ec('0x6')][_0xf4ec('0x3d')]({'where':{'VoiceExtensionId':{'$in':_0x3f5840}},'transaction':_0x46b0d7})[_0xf4ec('0x5')](function(_0x31786d){return _0x28d80f[_0xf4ec('0x2')][_0xf4ec('0x6')]['bulkCreate'](_['sortBy'](_0xd1987f,_0xf4ec('0xe')),{'transaction':_0x46b0d7});});});})[_0xf4ec('0x3e')](function(_0x179381){console[_0xf4ec('0x3f')](_0x179381);});}exports[_0xf4ec('0x40')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index bc58216..27628b1 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 _0x06e4=['findAll','outbound','dialCheckDuplicateType','CmList','get','always','sequelize','query','VoiceQueueId','onlyIfOpen','catch','all','VoiceQueue','Campaign','Lists','CampaignId','BlackLists','generalCheckHopper','contact:csv_','resume','resolve','emit','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','duplicate','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','papaparse','../../../mysqldb','../../../config/environment','../../../config/logger','defaults','redis','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','Missing\x20filepath\x20parameter!','undefined','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','contact','index','test','isNil','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','map','message','join','hasOwnProperty','data','firstName\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','email','CompanyId','length','find','CmContact','keys','then','push','pick','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','into','cm_hopper','fromQuery','phone','ContactId','ListId','createdAt','select','field','NOW()','scheduledAt','toString','updatedAt','cm_contacts','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','insert','id\x20IN\x20?','str','calleridnum','cm_hopper_final','\x20=\x20?','deletedAt\x20IS\x20NULL','cm_hopper_black'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x06e4,0x16c));var _0x406e=function(_0x12e073,_0x2a6387){_0x12e073=_0x12e073-0x0;var _0x17e67b=_0x06e4[_0x12e073];return _0x17e67b;};'use strict';var BPromise=require(_0x406e('0x0'));var util=require(_0x406e('0x1'));var _=require('lodash');var fs=require('fs');var squel=require('squel');var Papa=require(_0x406e('0x2'));var Redis=require('ioredis');var db=require(_0x406e('0x3'))['db'];var config=require(_0x406e('0x4'));var logger=require(_0x406e('0x5'))('api');config['redis']=_[_0x406e('0x6')](config[_0x406e('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x406e('0x8'))(new Redis(config[_0x406e('0x7')]));require(_0x406e('0x9'))[_0x406e('0xa')](socket);try{if(!process[_0x406e('0xb')][0x2]||process[_0x406e('0xb')][0x2]==='undefined'||process[_0x406e('0xb')][0x2]==='null'){throw new Error(_0x406e('0xc'));}var FILEPATH=process[_0x406e('0xb')][0x2];if(!process['argv'][0x3]||process[_0x406e('0xb')][0x3]===_0x406e('0xd')||process[_0x406e('0xb')][0x3]===_0x406e('0xe')||!process[_0x406e('0xb')][0x4]||process['argv'][0x4]===_0x406e('0xd')||process['argv'][0x4]===_0x406e('0xe')){throw new Error(_0x406e('0xf'));}var FIELDS=_[_0x406e('0x10')](process[_0x406e('0xb')][0x3][_0x406e('0x11')](','),process[_0x406e('0xb')][0x4]['split'](','));if(!process[_0x406e('0xb')][0x5]||process[_0x406e('0xb')][0x5]===_0x406e('0xd')||process[_0x406e('0xb')][0x5]===_0x406e('0xe')){throw new Error(_0x406e('0x12'));}var LISTID=process[_0x406e('0xb')][0x5];var COMPANYID=process[_0x406e('0xb')][0x6]&&process[_0x406e('0xb')][0x6]!==_0x406e('0xd')&&process[_0x406e('0xb')][0x6]!=='null'?process[_0x406e('0xb')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x406e('0xb')][0x7]!==_0x406e('0xd')&&process[_0x406e('0xb')][0x7]!=='null'?process['argv'][0x7]:null;if(!process[_0x406e('0xb')][0x8]||process[_0x406e('0xb')][0x8]===_0x406e('0xd')||process[_0x406e('0xb')][0x8]==='null'){throw new Error(_0x406e('0x13'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x528c6f){logger['error'](_0x528c6f);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(_0x2038f0,_0x24b13c,_0x15eb2f,_0x434057){var _0xaa9d8f={'message':_0x24b13c};_0xaa9d8f[_0x2038f0]=!![];if(_0x15eb2f){_0xaa9d8f[_0x406e('0x14')]=_0x15eb2f;}if(_0x434057){_0xaa9d8f[_0x406e('0x15')]=_0x434057;}return _0xaa9d8f;}function isEmail(_0x2b61cb){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))*$/[_0x406e('0x16')](_0x2b61cb);}function checkRow(_0x1bf21d,_0x131336,_0x3b17a0){return new BPromise(function(_0xb5fb48,_0x333239){if(_[_0x406e('0x17')](_0x1bf21d)){return _0x333239(handleCheckRowError(_0x406e('0x18'),_0x406e('0x19'),null,_0x3b17a0));}if(_0x1bf21d[_0x406e('0x1a')]&&_0x1bf21d['errors']['length']){var _0x5adab4=_[_0x406e('0x1b')](_0x1bf21d[_0x406e('0x1a')],_0x406e('0x1c'))[_0x406e('0x1d')](';');return _0x333239(handleCheckRowError(_0x406e('0x18'),_0x5adab4,null,_0x3b17a0));}var _0x219ded={};for(var _0xb3d5d9 in FIELDS){if(FIELDS[_0x406e('0x1e')](_0xb3d5d9)&&FIELDS[_0xb3d5d9]){_0x219ded[_0xb3d5d9]=_0x1bf21d[_0x406e('0x1f')][0x0][FIELDS[_0xb3d5d9]]||_0x1bf21d[_0x406e('0x1f')][0x0]['\ufeff'+FIELDS[_0xb3d5d9]];}}if(!_0x219ded['firstName']){return _0x333239(handleCheckRowError(_0x406e('0x18'),_0x406e('0x20'),null,_0x3b17a0));}if(!_0x219ded['phone']){return _0x333239(handleCheckRowError(_0x406e('0x18'),'phone\x20not\x20specified!',null,_0x3b17a0));}if(_0x219ded[_0x406e('0x21')]){var _0x52c60c=moment(_0x219ded[_0x406e('0x21')],_0x406e('0x22'));if(!_0x52c60c[_0x406e('0x23')]()){return _0x333239(handleCheckRowError('error','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x3b17a0));}}if(_0x219ded[_0x406e('0x24')]){if(!isEmail(_0x219ded[_0x406e('0x24')])){return _0x333239(handleCheckRowError(_0x406e('0x18'),'email\x20format\x20is\x20not\x20valid!',null,_0x3b17a0));}}_0x219ded['ListId']=LISTID;_0x219ded[_0x406e('0x25')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x406e('0x26')]&&_0x131336){var _0x2f63a8={};for(var _0x3cf7dc=0x0,_0x15ec42=DUPLICATES[_0x406e('0x26')];_0x3cf7dc<_0x15ec42;_0x3cf7dc+=0x1){_0x2f63a8[DUPLICATES[_0x3cf7dc]]=_0x219ded[DUPLICATES[_0x3cf7dc]];}var _0x596359=_[_0x406e('0x27')](_0x131336,_0x2f63a8);if(_0x596359){return _0x333239(handleCheckRowError('duplicate','Duplicate\x20Contact',_0x596359,_0x3b17a0));}}return db[_0x406e('0x28')]['create'](_0x219ded,{'raw':!![],'hooks':![],'fields':_[_0x406e('0x29')](_0x219ded)})[_0x406e('0x2a')](function(_0x578caa){if(DUPLICATES&&DUPLICATES[_0x406e('0x26')]&&_0x131336){_0x131336[_0x406e('0x2b')](_[_0x406e('0x2c')](_0x219ded,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x578caa['id'];return _0xb5fb48();})['catch'](function(_0x11a520){return _0x333239(handleCheckRowError(_0x406e('0x18'),_0x406e('0x2d')+(_0x11a520['message']||JSON[_0x406e('0x2e')](_0x11a520)),null,_0x3b17a0));});});}function checkHopper(){function _0x44d8a3(){return function(_0x26fbd7){logger['error'](_0x406e('0x2f'),_0x406e('0x30'),util['inspect'](_0x26fbd7,{'showHidden':![],'depth':null}));};}var _0x537edb=function(_0x1bbf4f,_0x3baf83){var _0x369f4d=squel['insert']()[_0x406e('0x31')](_0x406e('0x32'))[_0x406e('0x33')]([_0x406e('0x34'),'scheduledAt',_0x406e('0x35'),_0x406e('0x36'),_0x3baf83,_0x406e('0x37'),'updatedAt'],squel[_0x406e('0x38')]()['field'](_0x406e('0x34'),_0x406e('0x34'))[_0x406e('0x39')](_0x406e('0x3a'),_0x406e('0x3b'))[_0x406e('0x39')]('id',_0x406e('0x35'))[_0x406e('0x39')](LISTID[_0x406e('0x3c')](),_0x406e('0x36'))['field'](_0x1bbf4f['id'][_0x406e('0x3c')](),_0x3baf83)['field'](_0x406e('0x3a'),_0x406e('0x37'))[_0x406e('0x39')]('NOW()',_0x406e('0x3d'))['from'](_0x406e('0x3e'))[_0x406e('0x3f')]('deletedAt\x20IS\x20NULL')[_0x406e('0x3f')](_0x406e('0x40'),LISTID[_0x406e('0x3c')]())['where'](_0x406e('0x41'))[_0x406e('0x3f')](_0x406e('0x42'),squel[_0x406e('0x38')]()[_0x406e('0x39')](_0x406e('0x34'))[_0x406e('0x43')](_0x406e('0x32'))['where'](_0x3baf83+'\x20=\x20?',_0x1bbf4f['id'][_0x406e('0x3c')]())))[_0x406e('0x3c')]();return _0x369f4d;};var _0x1ef02e=function(_0x160faa,_0x3a09bd){var _0x3133ad=squel[_0x406e('0x44')]()[_0x406e('0x31')](_0x406e('0x32'))['fromQuery'](['phone','scheduledAt',_0x406e('0x35'),'ListId',_0x3a09bd,_0x406e('0x37'),'updatedAt'],squel[_0x406e('0x38')]()['field'](_0x406e('0x34'),'phone')[_0x406e('0x39')](_0x406e('0x3a'),_0x406e('0x3b'))[_0x406e('0x39')]('id',_0x406e('0x35'))[_0x406e('0x39')](LISTID[_0x406e('0x3c')](),_0x406e('0x36'))['field'](_0x160faa['id']['toString'](),_0x3a09bd)[_0x406e('0x39')](_0x406e('0x3a'),_0x406e('0x37'))[_0x406e('0x39')](_0x406e('0x3a'),'updatedAt')[_0x406e('0x43')]('cm_contacts')[_0x406e('0x3f')]('deletedAt\x20IS\x20NULL')['where'](_0x406e('0x40'),LISTID['toString']())[_0x406e('0x3f')](_0x406e('0x45'),squel[_0x406e('0x46')](hopperContacts))[_0x406e('0x3f')](_0x406e('0x41'))[_0x406e('0x3f')](_0x406e('0x42'),squel[_0x406e('0x38')]()[_0x406e('0x39')](_0x406e('0x47'))[_0x406e('0x43')](_0x406e('0x48'))[_0x406e('0x3f')](_0x3a09bd+_0x406e('0x49'),_0x160faa['id'][_0x406e('0x3c')]()))[_0x406e('0x3f')](_0x406e('0x42'),squel[_0x406e('0x38')]()[_0x406e('0x39')]('phone')[_0x406e('0x43')]('cm_hopper')[_0x406e('0x3f')](_0x3a09bd+'\x20=\x20?',_0x160faa['id'][_0x406e('0x3c')]())))[_0x406e('0x3c')]();return _0x3133ad;};function _0x4dfe4a(_0x3d5cd2,_0x2f8425){var _0x28f0a8=squel['insert']()[_0x406e('0x31')](_0x406e('0x32'))['fromQuery']([_0x406e('0x34'),_0x406e('0x3b'),'ContactId',_0x406e('0x36'),_0x2f8425,_0x406e('0x37'),_0x406e('0x3d')],squel[_0x406e('0x38')]()[_0x406e('0x39')]('phone',_0x406e('0x34'))[_0x406e('0x39')](_0x406e('0x3a'),'scheduledAt')[_0x406e('0x39')]('id',_0x406e('0x35'))['field'](LISTID[_0x406e('0x3c')](),_0x406e('0x36'))[_0x406e('0x39')](_0x3d5cd2['id'][_0x406e('0x3c')](),_0x2f8425)['field']('NOW()',_0x406e('0x37'))[_0x406e('0x39')](_0x406e('0x3a'),_0x406e('0x3d'))[_0x406e('0x43')](_0x406e('0x3e'))[_0x406e('0x3f')](_0x406e('0x4a'))[_0x406e('0x3f')](_0x406e('0x40'),LISTID[_0x406e('0x3c')]())['where'](_0x406e('0x45'),squel[_0x406e('0x46')](hopperContacts))[_0x406e('0x3f')](_0x406e('0x41')))['toString']();return _0x28f0a8;}function _0x36abb2(_0xffc297,_0x8b22c6){var _0x23b8d4=squel['insert']()[_0x406e('0x31')](_0x406e('0x4b'))[_0x406e('0x33')](['phone','ContactId','ListId',_0x8b22c6,_0x406e('0x37'),_0x406e('0x3d')],squel[_0x406e('0x38')]()[_0x406e('0x39')](_0x406e('0x34'),_0x406e('0x34'))['field']('id',_0x406e('0x35'))[_0x406e('0x39')](LISTID[_0x406e('0x3c')](),'ListId')['field'](_0xffc297['id'][_0x406e('0x3c')](),_0x8b22c6)['field'](_0x406e('0x3a'),_0x406e('0x37'))['field'](_0x406e('0x3a'),_0x406e('0x3d'))[_0x406e('0x43')]('cm_contacts')[_0x406e('0x3f')](_0x406e('0x4a'))[_0x406e('0x3f')](_0x406e('0x40'),LISTID[_0x406e('0x3c')]())['where'](_0x406e('0x45'),squel[_0x406e('0x46')](hopperContacts))[_0x406e('0x3f')](_0x406e('0x41')))[_0x406e('0x3c')]();return _0x23b8d4;}return db['VoiceQueue'][_0x406e('0x4c')]({'where':{'type':_0x406e('0x4d')},'attributes':['id',_0x406e('0x4e')],'include':[{'model':db[_0x406e('0x4f')],'as':'Lists','where':{'id':LISTID}}]})[_0x406e('0x2a')](function(_0x264b27){var _0x38036e=[];if(_0x264b27){var _0x38e1f7;for(var _0x190ee4=0x0,_0x531510;_0x190ee4<_0x264b27[_0x406e('0x26')];_0x190ee4+=0x1){_0x531510=_0x264b27[_0x190ee4][_0x406e('0x50')]({'plain':!![]});switch(_0x531510[_0x406e('0x4e')]){case _0x406e('0x51'):_0x38036e['push'](db[_0x406e('0x52')][_0x406e('0x53')](_0x1ef02e(_0x531510,_0x406e('0x54')))[_0x406e('0x2a')](function(){})['catch'](_0x44d8a3()));break;case _0x406e('0x55'):_0x38036e['push'](db[_0x406e('0x52')]['query'](_0x537edb(_0x531510,'VoiceQueueId'))[_0x406e('0x2a')](function(){})[_0x406e('0x56')](_0x44d8a3()));break;default:_0x38036e['push'](db['sequelize'][_0x406e('0x53')](_0x4dfe4a(_0x531510,'VoiceQueueId'))[_0x406e('0x2a')](function(){})[_0x406e('0x56')](_0x44d8a3()));}}}return _0x38036e;})[_0x406e('0x57')]()[_0x406e('0x2a')](function(){return db[_0x406e('0x58')][_0x406e('0x4c')]({'where':{'type':_0x406e('0x4d')},'attributes':['id'],'include':[{'model':db[_0x406e('0x4f')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x406e('0x2a')](function(_0x41eb1f){var _0x1989e6=[];if(_0x41eb1f){var _0x5e24dc;for(var _0x62ff4f=0x0,_0x2f6bc2;_0x62ff4f<_0x41eb1f[_0x406e('0x26')];_0x62ff4f+=0x1){_0x2f6bc2=_0x41eb1f[_0x62ff4f]['get']({'plain':!![]});_0x1989e6['push'](db['sequelize'][_0x406e('0x53')](_0x36abb2(_0x2f6bc2,_0x406e('0x54')))['then'](function(){})[_0x406e('0x56')](_0x44d8a3()));}}return _0x1989e6;})['all']();})[_0x406e('0x2a')](function(){return db[_0x406e('0x59')][_0x406e('0x4c')]({'attributes':['id',_0x406e('0x4e')],'include':[{'model':db[_0x406e('0x4f')],'as':_0x406e('0x5a'),'where':{'id':LISTID}}]})[_0x406e('0x2a')](function(_0x428c18){var _0x1a0c19=[];if(_0x428c18){for(var _0xbb8375=0x0,_0x40f6c2;_0xbb8375<_0x428c18[_0x406e('0x26')];_0xbb8375+=0x1){_0x40f6c2=_0x428c18[_0xbb8375]['get']({'plain':!![]});switch(_0x40f6c2[_0x406e('0x4e')]){case'always':_0x1a0c19[_0x406e('0x2b')](db['sequelize'][_0x406e('0x53')](_0x1ef02e(_0x40f6c2,'CampaignId'))['then'](function(){})[_0x406e('0x56')](_0x44d8a3()));break;case'onlyIfOpen':_0x1a0c19[_0x406e('0x2b')](db[_0x406e('0x52')][_0x406e('0x53')](_0x537edb(_0x40f6c2,_0x406e('0x5b')))[_0x406e('0x2a')](function(){})[_0x406e('0x56')](_0x44d8a3()));break;default:_0x1a0c19[_0x406e('0x2b')](db['sequelize'][_0x406e('0x53')](_0x4dfe4a(_0x40f6c2,_0x406e('0x5b')))[_0x406e('0x2a')](function(){})['catch'](_0x44d8a3()));}}}return _0x1a0c19;})[_0x406e('0x57')]();})[_0x406e('0x2a')](function(){return db['Campaign'][_0x406e('0x4c')]({'attributes':['id'],'include':[{'model':db[_0x406e('0x4f')],'as':_0x406e('0x5c'),'where':{'id':LISTID}}]})[_0x406e('0x2a')](function(_0x457ab8){var _0x56a7eb=[];if(_0x457ab8){for(var _0x1a5526=0x0,_0x55ce0b;_0x1a5526<_0x457ab8[_0x406e('0x26')];_0x1a5526+=0x1){_0x55ce0b=_0x457ab8[_0x1a5526]['get']({'plain':!![]});_0x56a7eb[_0x406e('0x2b')](db[_0x406e('0x52')][_0x406e('0x53')](_0x36abb2(_0x55ce0b,'CampaignId'))[_0x406e('0x2a')](function(){})[_0x406e('0x56')](_0x44d8a3()));}}return _0x56a7eb;})['all']();})[_0x406e('0x56')](function(_0x60030e){logger[_0x406e('0x18')]('cmContact,\x20%s,\x20%s',_0x406e('0x5d'),_0x60030e[_0x406e('0x1c')]);});}var processPromises=function(_0x543416){return BPromise[_0x406e('0x57')](promises)['then'](function(_0x1e47d8){})['catch'](function(_0x5f3de6){logger[_0x406e('0x18')]('Error\x20processing\x20rows\x20block:',JSON[_0x406e('0x2e')](_0x5f3de6));})['finally'](function(){socket['emit'](_0x406e('0x5e')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x543416){return _0x543416[_0x406e('0x5f')]();}});};var endCsv=function(){return BPromise[_0x406e('0x60')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x406e('0x2a')](function(){socket[_0x406e('0x61')](_0x406e('0x5e')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x406e('0x62')](FILEPATH);}catch(_0x541df4){logger['error'](_0x406e('0x63'),JSON[_0x406e('0x2e')](_0x541df4));}finally{process[_0x406e('0x64')](0x0);}});};process['on'](_0x406e('0x65'),function(){logger[_0x406e('0x66')](_0x406e('0x67'));endCsv();});function main(){return BPromise[_0x406e('0x60')]()[_0x406e('0x2a')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x406e('0x11')](',');return db['CmContact'][_0x406e('0x4c')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x406e('0x2a')](function(_0x295ecf){var _0x4c533f=fs[_0x406e('0x68')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x4c533f,{'header':!![],'skipEmptyLines':!![],'step':function(_0x26b27d,_0x44b8cb){total+=0x1;var _0x41613f=total;promises['push'](checkRow(_0x26b27d,_0x295ecf,_0x41613f)[_0x406e('0x2a')](function(){success+=0x1;})[_0x406e('0x56')](function(_0x11cfd6){if(_0x11cfd6[_0x406e('0x18')]){errors+=0x1;delete _0x11cfd6[_0x406e('0x18')];}else if(_0x11cfd6[_0x406e('0x69')]){duplicates+=0x1;delete _0x11cfd6[_0x406e('0x69')];}rows[_0x406e('0x2b')](_0x11cfd6);}));if(total%0xc8===0x0){_0x44b8cb[_0x406e('0x6a')]();return processPromises(_0x44b8cb);}},'complete':function(){return processPromises()['then'](function(){logger[_0x406e('0x66')](_0x406e('0x6b'));endCsv();});},'error':function(_0x148166,_0x21eaed){logger[_0x406e('0x66')](_0x406e('0x6c'),JSON[_0x406e('0x2e')](_0x148166));endCsv();}});})[_0x406e('0x56')](function(_0xfc36bf){logger[_0x406e('0x18')](_0x406e('0x6d'),JSON[_0x406e('0x2e')](_0xfc36bf));});}main(); \ No newline at end of file +var _0x659c=['resume','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','resolve','createReadStream','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','util','lodash','papaparse','../../../mysqldb','../../../config/logger','api','defaults','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','error','index','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','map','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','birthDate','YYYY-MM-DD','isValid','email','email\x20format\x20is\x20not\x20valid!','CompanyId','length','find','duplicate','Duplicate\x20Contact','CmContact','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','message','stringify','cmContact','checkHopper','inspect','insert','cm_hopper','scheduledAt','ContactId','ListId','createdAt','select','field','toString','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','fromQuery','updatedAt','id\x20IN\x20?','str','calleridnum','cm_hopper_final','\x20=\x20?','cm_hopper_black','findAll','dialCheckDuplicateType','CmList','Lists','get','always','query','VoiceQueueId','then','onlyIfOpen','sequelize','all','VoiceQueue','outbound','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','emit'];(function(_0x99e1f9,_0x347694){var _0x46c9a7=function(_0x4749f8){while(--_0x4749f8){_0x99e1f9['push'](_0x99e1f9['shift']());}};_0x46c9a7(++_0x347694);}(_0x659c,0xe2));var _0xc659=function(_0x5b9458,_0x184cc5){_0x5b9458=_0x5b9458-0x0;var _0x1134d4=_0x659c[_0x5b9458];return _0x1134d4;};'use strict';var BPromise=require('bluebird');var util=require(_0xc659('0x0'));var _=require(_0xc659('0x1'));var fs=require('fs');var squel=require('squel');var Papa=require(_0xc659('0x2'));var Redis=require('ioredis');var db=require(_0xc659('0x3'))['db'];var config=require('../../../config/environment');var logger=require(_0xc659('0x4'))(_0xc659('0x5'));config['redis']=_[_0xc659('0x6')](config[_0xc659('0x7')],{'host':_0xc659('0x8'),'port':0x18eb});var socket=require(_0xc659('0x9'))(new Redis(config[_0xc659('0x7')]));require(_0xc659('0xa'))[_0xc659('0xb')](socket);try{if(!process[_0xc659('0xc')][0x2]||process[_0xc659('0xc')][0x2]===_0xc659('0xd')||process[_0xc659('0xc')][0x2]==='null'){throw new Error(_0xc659('0xe'));}var FILEPATH=process[_0xc659('0xc')][0x2];if(!process[_0xc659('0xc')][0x3]||process[_0xc659('0xc')][0x3]===_0xc659('0xd')||process['argv'][0x3]===_0xc659('0xf')||!process[_0xc659('0xc')][0x4]||process['argv'][0x4]===_0xc659('0xd')||process[_0xc659('0xc')][0x4]===_0xc659('0xf')){throw new Error(_0xc659('0x10'));}var FIELDS=_[_0xc659('0x11')](process[_0xc659('0xc')][0x3]['split'](','),process[_0xc659('0xc')][0x4][_0xc659('0x12')](','));if(!process[_0xc659('0xc')][0x5]||process[_0xc659('0xc')][0x5]===_0xc659('0xd')||process['argv'][0x5]===_0xc659('0xf')){throw new Error(_0xc659('0x13'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0xc659('0xc')][0x6]&&process[_0xc659('0xc')][0x6]!==_0xc659('0xd')&&process[_0xc659('0xc')][0x6]!==_0xc659('0xf')?process['argv'][0x6]:null;var DUPLICATES=process[_0xc659('0xc')][0x7]&&process[_0xc659('0xc')][0x7]!==_0xc659('0xd')&&process[_0xc659('0xc')][0x7]!==_0xc659('0xf')?process['argv'][0x7]:null;if(!process[_0xc659('0xc')][0x8]||process[_0xc659('0xc')][0x8]===_0xc659('0xd')||process['argv'][0x8]==='null'){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0xc659('0xc')][0x8];}catch(_0x4aa439){logger[_0xc659('0x14')](_0x4aa439);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(_0x511ff0,_0x33d7ab,_0x2842c7,_0x1285cb){var _0x42e5c2={'message':_0x33d7ab};_0x42e5c2[_0x511ff0]=!![];if(_0x2842c7){_0x42e5c2['contact']=_0x2842c7;}if(_0x1285cb){_0x42e5c2[_0xc659('0x15')]=_0x1285cb;}return _0x42e5c2;}function isEmail(_0x4845ed){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'](_0x4845ed);}function checkRow(_0x9aeeac,_0x3712cf,_0x504429){return new BPromise(function(_0x52c399,_0x410ae9){if(_['isNil'](_0x9aeeac)){return _0x410ae9(handleCheckRowError(_0xc659('0x14'),_0xc659('0x16'),null,_0x504429));}if(_0x9aeeac[_0xc659('0x17')]&&_0x9aeeac[_0xc659('0x17')]['length']){var _0x1c91b3=_[_0xc659('0x18')](_0x9aeeac['errors'],'message')['join'](';');return _0x410ae9(handleCheckRowError(_0xc659('0x14'),_0x1c91b3,null,_0x504429));}var _0xa1f438={};for(var _0x3ed26d in FIELDS){if(FIELDS[_0xc659('0x19')](_0x3ed26d)&&FIELDS[_0x3ed26d]){_0xa1f438[_0x3ed26d]=_0x9aeeac[_0xc659('0x1a')][0x0][FIELDS[_0x3ed26d]]||_0x9aeeac[_0xc659('0x1a')][0x0]['\ufeff'+FIELDS[_0x3ed26d]];}}if(!_0xa1f438[_0xc659('0x1b')]){return _0x410ae9(handleCheckRowError(_0xc659('0x14'),_0xc659('0x1c'),null,_0x504429));}if(!_0xa1f438[_0xc659('0x1d')]){return _0x410ae9(handleCheckRowError(_0xc659('0x14'),'phone\x20not\x20specified!',null,_0x504429));}if(_0xa1f438[_0xc659('0x1e')]){var _0x2b8757=moment(_0xa1f438[_0xc659('0x1e')],_0xc659('0x1f'));if(!_0x2b8757[_0xc659('0x20')]()){return _0x410ae9(handleCheckRowError(_0xc659('0x14'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x504429));}}if(_0xa1f438[_0xc659('0x21')]){if(!isEmail(_0xa1f438[_0xc659('0x21')])){return _0x410ae9(handleCheckRowError(_0xc659('0x14'),_0xc659('0x22'),null,_0x504429));}}_0xa1f438['ListId']=LISTID;_0xa1f438[_0xc659('0x23')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xc659('0x24')]&&_0x3712cf){var _0x764341={};for(var _0x13cda0=0x0,_0x45c967=DUPLICATES['length'];_0x13cda0<_0x45c967;_0x13cda0+=0x1){_0x764341[DUPLICATES[_0x13cda0]]=_0xa1f438[DUPLICATES[_0x13cda0]];}var _0x3b69b9=_[_0xc659('0x25')](_0x3712cf,_0x764341);if(_0x3b69b9){return _0x410ae9(handleCheckRowError(_0xc659('0x26'),_0xc659('0x27'),_0x3b69b9,_0x504429));}}return db[_0xc659('0x28')]['create'](_0xa1f438,{'raw':!![],'hooks':![],'fields':_['keys'](_0xa1f438)})['then'](function(_0x59a595){if(DUPLICATES&&DUPLICATES['length']&&_0x3712cf){_0x3712cf[_0xc659('0x29')](_[_0xc659('0x2a')](_0xa1f438,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x59a595['id'];return _0x52c399();})[_0xc659('0x2b')](function(_0x365ea0){return _0x410ae9(handleCheckRowError(_0xc659('0x14'),_0xc659('0x2c')+(_0x365ea0[_0xc659('0x2d')]||JSON[_0xc659('0x2e')](_0x365ea0)),null,_0x504429));});});}function checkHopper(){function _0x259564(){return function(_0x4830b5){logger[_0xc659('0x14')](_0xc659('0x2f'),_0xc659('0x30'),util[_0xc659('0x31')](_0x4830b5,{'showHidden':![],'depth':null}));};}var _0x54d776=function(_0xb1ad63,_0x32ddc3){var _0xc0aebf=squel[_0xc659('0x32')]()['into'](_0xc659('0x33'))['fromQuery']([_0xc659('0x1d'),_0xc659('0x34'),_0xc659('0x35'),_0xc659('0x36'),_0x32ddc3,_0xc659('0x37'),'updatedAt'],squel[_0xc659('0x38')]()[_0xc659('0x39')](_0xc659('0x1d'),_0xc659('0x1d'))[_0xc659('0x39')]('NOW()',_0xc659('0x34'))[_0xc659('0x39')]('id',_0xc659('0x35'))[_0xc659('0x39')](LISTID[_0xc659('0x3a')](),_0xc659('0x36'))[_0xc659('0x39')](_0xb1ad63['id']['toString'](),_0x32ddc3)[_0xc659('0x39')]('NOW()',_0xc659('0x37'))[_0xc659('0x39')](_0xc659('0x3b'),'updatedAt')[_0xc659('0x3c')](_0xc659('0x3d'))['where'](_0xc659('0x3e'))[_0xc659('0x3f')](_0xc659('0x40'),LISTID[_0xc659('0x3a')]())[_0xc659('0x3f')](_0xc659('0x41'))[_0xc659('0x3f')](_0xc659('0x42'),squel[_0xc659('0x38')]()[_0xc659('0x39')]('phone')['from']('cm_hopper')[_0xc659('0x3f')](_0x32ddc3+'\x20=\x20?',_0xb1ad63['id']['toString']())))[_0xc659('0x3a')]();return _0xc0aebf;};var _0xdb463e=function(_0x41538a,_0x25eedb){var _0x512f27=squel['insert']()['into']('cm_hopper')[_0xc659('0x43')]([_0xc659('0x1d'),'scheduledAt',_0xc659('0x35'),_0xc659('0x36'),_0x25eedb,_0xc659('0x37'),'updatedAt'],squel[_0xc659('0x38')]()['field'](_0xc659('0x1d'),'phone')[_0xc659('0x39')](_0xc659('0x3b'),'scheduledAt')['field']('id','ContactId')['field'](LISTID['toString'](),_0xc659('0x36'))['field'](_0x41538a['id'][_0xc659('0x3a')](),_0x25eedb)[_0xc659('0x39')]('NOW()',_0xc659('0x37'))[_0xc659('0x39')]('NOW()',_0xc659('0x44'))['from'](_0xc659('0x3d'))[_0xc659('0x3f')](_0xc659('0x3e'))[_0xc659('0x3f')]('ListId\x20=\x20?',LISTID[_0xc659('0x3a')]())[_0xc659('0x3f')](_0xc659('0x45'),squel[_0xc659('0x46')](hopperContacts))[_0xc659('0x3f')](_0xc659('0x41'))[_0xc659('0x3f')](_0xc659('0x42'),squel[_0xc659('0x38')]()[_0xc659('0x39')](_0xc659('0x47'))[_0xc659('0x3c')](_0xc659('0x48'))[_0xc659('0x3f')](_0x25eedb+'\x20=\x20?',_0x41538a['id']['toString']()))[_0xc659('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xc659('0x39')](_0xc659('0x1d'))[_0xc659('0x3c')](_0xc659('0x33'))[_0xc659('0x3f')](_0x25eedb+_0xc659('0x49'),_0x41538a['id'][_0xc659('0x3a')]())))['toString']();return _0x512f27;};function _0x3c1e11(_0x3120d0,_0x221c8b){var _0x46b6c7=squel[_0xc659('0x32')]()['into']('cm_hopper')['fromQuery']([_0xc659('0x1d'),_0xc659('0x34'),_0xc659('0x35'),_0xc659('0x36'),_0x221c8b,_0xc659('0x37'),'updatedAt'],squel['select']()[_0xc659('0x39')](_0xc659('0x1d'),_0xc659('0x1d'))[_0xc659('0x39')]('NOW()',_0xc659('0x34'))['field']('id',_0xc659('0x35'))[_0xc659('0x39')](LISTID[_0xc659('0x3a')](),_0xc659('0x36'))[_0xc659('0x39')](_0x3120d0['id']['toString'](),_0x221c8b)['field'](_0xc659('0x3b'),'createdAt')[_0xc659('0x39')](_0xc659('0x3b'),_0xc659('0x44'))[_0xc659('0x3c')](_0xc659('0x3d'))[_0xc659('0x3f')](_0xc659('0x3e'))['where'](_0xc659('0x40'),LISTID[_0xc659('0x3a')]())[_0xc659('0x3f')]('id\x20IN\x20?',squel[_0xc659('0x46')](hopperContacts))[_0xc659('0x3f')](_0xc659('0x41')))[_0xc659('0x3a')]();return _0x46b6c7;}function _0xee3ef7(_0x361f9d,_0x582deb){var _0x442042=squel['insert']()['into'](_0xc659('0x4a'))['fromQuery']([_0xc659('0x1d'),_0xc659('0x35'),'ListId',_0x582deb,'createdAt',_0xc659('0x44')],squel['select']()[_0xc659('0x39')](_0xc659('0x1d'),_0xc659('0x1d'))['field']('id',_0xc659('0x35'))[_0xc659('0x39')](LISTID[_0xc659('0x3a')](),_0xc659('0x36'))[_0xc659('0x39')](_0x361f9d['id']['toString'](),_0x582deb)[_0xc659('0x39')](_0xc659('0x3b'),_0xc659('0x37'))['field']('NOW()','updatedAt')[_0xc659('0x3c')](_0xc659('0x3d'))['where']('deletedAt\x20IS\x20NULL')[_0xc659('0x3f')](_0xc659('0x40'),LISTID[_0xc659('0x3a')]())[_0xc659('0x3f')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0xc659('0x3f')](_0xc659('0x41')))[_0xc659('0x3a')]();return _0x442042;}return db['VoiceQueue'][_0xc659('0x4b')]({'where':{'type':'outbound'},'attributes':['id',_0xc659('0x4c')],'include':[{'model':db[_0xc659('0x4d')],'as':_0xc659('0x4e'),'where':{'id':LISTID}}]})['then'](function(_0x14f505){var _0x3f46b3=[];if(_0x14f505){var _0x33d152;for(var _0x9c26a1=0x0,_0x2f9b32;_0x9c26a1<_0x14f505['length'];_0x9c26a1+=0x1){_0x2f9b32=_0x14f505[_0x9c26a1][_0xc659('0x4f')]({'plain':!![]});switch(_0x2f9b32[_0xc659('0x4c')]){case _0xc659('0x50'):_0x3f46b3['push'](db['sequelize'][_0xc659('0x51')](_0xdb463e(_0x2f9b32,_0xc659('0x52')))[_0xc659('0x53')](function(){})[_0xc659('0x2b')](_0x259564()));break;case _0xc659('0x54'):_0x3f46b3['push'](db[_0xc659('0x55')][_0xc659('0x51')](_0x54d776(_0x2f9b32,_0xc659('0x52')))['then'](function(){})[_0xc659('0x2b')](_0x259564()));break;default:_0x3f46b3[_0xc659('0x29')](db[_0xc659('0x55')]['query'](_0x3c1e11(_0x2f9b32,'VoiceQueueId'))[_0xc659('0x53')](function(){})[_0xc659('0x2b')](_0x259564()));}}}return _0x3f46b3;})[_0xc659('0x56')]()[_0xc659('0x53')](function(){return db[_0xc659('0x57')][_0xc659('0x4b')]({'where':{'type':_0xc659('0x58')},'attributes':['id'],'include':[{'model':db[_0xc659('0x4d')],'as':_0xc659('0x59'),'where':{'id':LISTID}}]})[_0xc659('0x53')](function(_0x432ba0){var _0x443dc3=[];if(_0x432ba0){var _0x3937d9;for(var _0x3cf052=0x0,_0x384234;_0x3cf052<_0x432ba0[_0xc659('0x24')];_0x3cf052+=0x1){_0x384234=_0x432ba0[_0x3cf052][_0xc659('0x4f')]({'plain':!![]});_0x443dc3['push'](db['sequelize']['query'](_0xee3ef7(_0x384234,'VoiceQueueId'))['then'](function(){})[_0xc659('0x2b')](_0x259564()));}}return _0x443dc3;})[_0xc659('0x56')]();})['then'](function(){return db[_0xc659('0x5a')][_0xc659('0x4b')]({'attributes':['id',_0xc659('0x4c')],'include':[{'model':db['CmList'],'as':'Lists','where':{'id':LISTID}}]})[_0xc659('0x53')](function(_0x5b701c){var _0x361f3d=[];if(_0x5b701c){for(var _0x32875a=0x0,_0x2cecef;_0x32875a<_0x5b701c['length'];_0x32875a+=0x1){_0x2cecef=_0x5b701c[_0x32875a][_0xc659('0x4f')]({'plain':!![]});switch(_0x2cecef[_0xc659('0x4c')]){case _0xc659('0x50'):_0x361f3d['push'](db[_0xc659('0x55')]['query'](_0xdb463e(_0x2cecef,_0xc659('0x5b')))[_0xc659('0x53')](function(){})['catch'](_0x259564()));break;case'onlyIfOpen':_0x361f3d[_0xc659('0x29')](db[_0xc659('0x55')][_0xc659('0x51')](_0x54d776(_0x2cecef,_0xc659('0x5b')))[_0xc659('0x53')](function(){})['catch'](_0x259564()));break;default:_0x361f3d[_0xc659('0x29')](db['sequelize'][_0xc659('0x51')](_0x3c1e11(_0x2cecef,_0xc659('0x5b')))[_0xc659('0x53')](function(){})[_0xc659('0x2b')](_0x259564()));}}}return _0x361f3d;})[_0xc659('0x56')]();})['then'](function(){return db[_0xc659('0x5a')]['findAll']({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xc659('0x59'),'where':{'id':LISTID}}]})['then'](function(_0x5c2aa4){var _0x150ca0=[];if(_0x5c2aa4){for(var _0x555ab1=0x0,_0x536031;_0x555ab1<_0x5c2aa4[_0xc659('0x24')];_0x555ab1+=0x1){_0x536031=_0x5c2aa4[_0x555ab1]['get']({'plain':!![]});_0x150ca0[_0xc659('0x29')](db[_0xc659('0x55')][_0xc659('0x51')](_0xee3ef7(_0x536031,'CampaignId'))[_0xc659('0x53')](function(){})['catch'](_0x259564()));}}return _0x150ca0;})[_0xc659('0x56')]();})[_0xc659('0x2b')](function(_0x1ae738){logger[_0xc659('0x14')](_0xc659('0x5c'),_0xc659('0x5d'),_0x1ae738['message']);});}var processPromises=function(_0x20f6f8){return BPromise['all'](promises)[_0xc659('0x53')](function(_0x608861){})[_0xc659('0x2b')](function(_0xc53929){logger[_0xc659('0x14')]('Error\x20processing\x20rows\x20block:',JSON[_0xc659('0x2e')](_0xc53929));})['finally'](function(){socket[_0xc659('0x5e')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x20f6f8){return _0x20f6f8[_0xc659('0x5f')]();}});};var endCsv=function(){return BPromise['resolve']()[_0xc659('0x53')](function(){if(hopperContacts){return checkHopper();}})[_0xc659('0x53')](function(){socket[_0xc659('0x5e')](_0xc659('0x60')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xc659('0x61')](FILEPATH);}catch(_0x6070dc){logger[_0xc659('0x14')](_0xc659('0x62'),JSON[_0xc659('0x2e')](_0x6070dc));}finally{process[_0xc659('0x63')](0x0);}});};process['on'](_0xc659('0x64'),function(){logger[_0xc659('0x65')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0xc659('0x66')]()[_0xc659('0x53')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xc659('0x12')](',');return db['CmContact'][_0xc659('0x4b')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xc659('0x53')](function(_0x4cb562){var _0x31f33f=fs[_0xc659('0x67')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x31f33f,{'header':!![],'skipEmptyLines':!![],'step':function(_0x1b28cb,_0x5bcb0b){total+=0x1;var _0x586e32=total;promises['push'](checkRow(_0x1b28cb,_0x4cb562,_0x586e32)[_0xc659('0x53')](function(){success+=0x1;})[_0xc659('0x2b')](function(_0x1dcb7c){if(_0x1dcb7c['error']){errors+=0x1;delete _0x1dcb7c[_0xc659('0x14')];}else if(_0x1dcb7c['duplicate']){duplicates+=0x1;delete _0x1dcb7c[_0xc659('0x26')];}rows[_0xc659('0x29')](_0x1dcb7c);}));if(total%0xc8===0x0){_0x5bcb0b[_0xc659('0x68')]();return processPromises(_0x5bcb0b);}},'complete':function(){return processPromises()[_0xc659('0x53')](function(){logger['info'](_0xc659('0x69'));endCsv();});},'error':function(_0x37aa84,_0xca82e0){logger[_0xc659('0x65')](_0xc659('0x6a'),JSON[_0xc659('0x2e')](_0x37aa84));endCsv();}});})[_0xc659('0x2b')](function(_0x3fc360){logger['error']('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0xc659('0x2e')](_0x3fc360));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 45f3dc5..0232713 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 _0x1a36=['papaparse','util','moment','squel','../../../mysqldb','../../../config/logger','import','redis','defaults','localhost','format','YYYY-MM-DD\x20HH:mm:ss','field','phone','from','join','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','findAll','AdditionalPhones','then','split','length','push','all','CmContactHasItem','findOne','update','create','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ListId','createdAt','updatedAt','priority','UserId','select','fields','cm_contacts','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.updatedAt','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_hopper_black','ListId\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.id','ContactId','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','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','deletedAt\x20IS\x20NULL','id\x20IN\x20?','group','info','Received\x20SIGINT','error','message','exit','errors','code','sequelize','query','catch','campaigns','campaigns_has_cm_lists','campaigns_has_cm_lists.CmListId=','spread','voice_queues.id','voice_queues','voice_queues_has_cm_lists','timezones','dialTimezone','isNil','utcOffset','set','offset','main','stringify','clone','socket_timestamp','.csv','includes','header','ContactItemType','name','_description','writeFileSync','createReadStream','data','rows','find','hasOwnProperty','trim','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','replace','itemTypeId','description','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','SystemError','cm_contacts_','CREATE\x20TABLE\x20','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','dialTimezone,utcOffset','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','duplicates','DROP\x20TABLE\x20','contactId','contactTypeId','orderBy','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_blacklists','CampaignId','each','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','root','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','binding','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','No\x20agent\x20available','uncaughtException','path','lodash'];(function(_0x1d5ad0,_0x40aeae){var _0x57a56b=function(_0x560999){while(--_0x560999){_0x1d5ad0['push'](_0x1d5ad0['shift']());}};_0x57a56b(++_0x40aeae);}(_0x1a36,0x15a));var _0x61a3=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1a36[_0x17d9e3];return _0x14192d;};'use strict';var fs=require('fs');var path=require(_0x61a3('0x0'));var _=require(_0x61a3('0x1'));var Papa=require(_0x61a3('0x2'));var util=require(_0x61a3('0x3'));var BPromise=require('bluebird');var moment=require(_0x61a3('0x4'));var squel=require(_0x61a3('0x5'));var Redis=require('ioredis');var db=require(_0x61a3('0x6'))['db'];var config=require('../../../config/environment');var shared=require('../../../config/environment/shared');var logger=require(_0x61a3('0x7'))(_0x61a3('0x8'));config[_0x61a3('0x9')]=_[_0x61a3('0xa')](config[_0x61a3('0x9')],{'host':_0x61a3('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x61a3('0xc')](_0x61a3('0xd'));function isEmail(_0x5d055a){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'](_0x5d055a);}function selectNotIn(_0x29e4dd,_0x4c9141,_0x3aa7bf,_0x2c03e3,_0x545486){return squel['select']()[_0x61a3('0xe')](_0x61a3('0xf'))[_0x61a3('0x10')](_0x2c03e3)[_0x61a3('0x11')](_0x4c9141,null,_0x4c9141+_0x61a3('0x12')+_0x2c03e3+'.'+_0x3aa7bf)[_0x61a3('0x13')](_0x2c03e3+'.'+_0x3aa7bf+'\x20=\x20'+_0x29e4dd+'.'+_0x3aa7bf)['where'](_0x4c9141+_0x61a3('0x14')+_0x545486[_0x61a3('0x11')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x29c5c3,_0x518d4f){promisesAdditionalPhones=[];return db['CmContact'][_0x61a3('0x15')]({'raw':!![],'attributes':['id',_0x61a3('0x16')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x61a3('0x17')](function(_0x482ae9){if(_0x482ae9!==null){var _0x1685c2=[];for(var _0x5e9d2c=0x0;_0x5e9d2c<_0x482ae9['length'];_0x5e9d2c++){var _0x36a654=_0x482ae9[_0x5e9d2c];_0x1685c2['push'](insertAdditionalPhones(_0x36a654));}}Promise['all'](_0x1685c2)[_0x61a3('0x17')](function(){_0x29c5c3({'val':0x1});});});});}function insertAdditionalPhones(_0x5f4331){return new Promise(function(_0x41f179,_0x52c04c){var _0x5b489d=_0x5f4331['AdditionalPhones'];var _0x1122d4=_0x5b489d[_0x61a3('0x18')](';');var _0x518de1=[];orderBy=0x0;for(var _0x59fb91=0x0;_0x59fb91<_0x1122d4[_0x61a3('0x19')];_0x59fb91++){_0x518de1[_0x61a3('0x1a')](splitAdditionalPhone(_0x5f4331['id'],_0x1122d4[_0x59fb91]));}Promise[_0x61a3('0x1b')](_0x518de1)[_0x61a3('0x17')](function(){_0x41f179({'val':_0x1122d4['length']});});});}function splitAdditionalPhone(_0x23fb42,_0x38d33d){return new Promise(function(_0xb2f24,_0x29cf05){var _0x37f4a7=_0x38d33d['split'](':');var _0x2e1d8c=_0x37f4a7[0x0];var _0x49d5fd=_0x37f4a7[0x1];if(!_['isNil'](_0x49d5fd)){var _0x530666=_0x49d5fd[_0x61a3('0x18')]('|');var _0x234820=[];for(var _0x262551=0x0;_0x262551<_0x530666['length'];_0x262551++){if(_0x530666[_0x262551]!==''){var _0x3595d3=_['filter'](promisesAdditionalPhones,{'contactId':_0x23fb42,'phone':_0x530666[_0x262551]});if(_0x3595d3[_0x61a3('0x19')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x23fb42,'contactTypeId':_0x2e1d8c,'phone':_0x530666[_0x262551],'orderBy':orderBy});}}}_0xb2f24({'ok':0x1});}else _0xb2f24({'res':0x0});});}function createAdditionalPhone(_0x550a95,_0x2a42cd,_0xc5a316,_0x2d5167){var _0xf25ce4='';var _0x113b6c='';var _0x53cac9=_0xc5a316[_0x61a3('0x18')]('§');_0xf25ce4=_0x53cac9[0x0];if(_0x53cac9[_0x61a3('0x19')]==0x2)_0x113b6c=_0x53cac9[0x1];return new Promise(function(_0x3b58fe,_0x4bf16d){return db[_0x61a3('0x1c')][_0x61a3('0x1d')]({'where':{'CmContactId':_0x550a95,'item':_0xf25ce4}})[_0x61a3('0x17')](function(_0x58a2c0){if(_0x58a2c0){return db[_0x61a3('0x1c')][_0x61a3('0x1e')]({'ItemTypeId':_0x2a42cd,'description':_0x113b6c,'OrderBy':_0x2d5167},{'where':{'CmContactId':_0x550a95,'item':_0xf25ce4}})[_0x61a3('0x17')](function(_0x227a37){_0x3b58fe({'res':'updated'});});}else{return db[_0x61a3('0x1c')][_0x61a3('0x1f')]({'CmContactId':_0x550a95,'item':_0xf25ce4,'description':_0x113b6c,'ItemTypeId':_0x2a42cd,'OrderBy':_0x2d5167,'ItemClass':'PHONE'})[_0x61a3('0x17')](function(_0x448431){_0x3b58fe({'res':_0x61a3('0x20')});});}});});}function insertCmHopper(_0x1d307a,_0x1abfe4,_0x4bca99,_0xd9210a,_0x2aede9){var _0x2de177=[_0x61a3('0x21'),_0x61a3('0x22'),'cm_contacts.id',_0x61a3('0x23'),_0x1abfe4+'.'+_0xd9210a,_0x61a3('0x24'),'cm_contacts.updatedAt',_0x61a3('0x25'),_0x61a3('0x26'),'\x22'+_0x2aede9+'\x22'];return squel[_0x61a3('0x27')]()[_0x61a3('0x28')](_0x61a3('0x29'))[_0x61a3('0x2a')](['phone',_0x61a3('0x2b'),'ContactId',_0x61a3('0x2c'),_0xd9210a,_0x61a3('0x2d'),_0x61a3('0x2e'),_0x61a3('0x2f'),_0x61a3('0x30'),'recallme'],squel[_0x61a3('0x31')]()[_0x61a3('0x32')](_0x2de177)[_0x61a3('0x10')](_0x1abfe4)[_0x61a3('0x11')](_0x61a3('0x33'),null,'cm_contacts.ListId\x20=\x20'+_0x1abfe4+_0x61a3('0x34'))[_0x61a3('0x11')](_0x4bca99,null,_0x4bca99+_0x61a3('0x12')+_0x1abfe4+'.'+_0xd9210a)[_0x61a3('0x13')](_0x1abfe4+'.CmListId\x20=\x20?',_0x1d307a)[_0x61a3('0x13')](_0x61a3('0x35'),NOW)['where'](_0x61a3('0x36'),selectNotIn(_0x1abfe4,_0x4bca99,_0xd9210a,_0x61a3('0x29'),[_0x61a3('0x37'),_0x61a3('0x38')]))[_0x61a3('0x13')](_0x61a3('0x36'),selectNotIn(_0x1abfe4,_0x4bca99,_0xd9210a,'cm_hopper',[_0x61a3('0x37')])))[_0x61a3('0x39')]();}function insertCmHopperBlack(_0xb922f2,_0x1000bb,_0x1306f7,_0x3bae5f){var _0x41cb3e=[_0x61a3('0x21'),'cm_contacts.id',_0x61a3('0x23'),_0x1000bb+'.'+_0x3bae5f,_0x61a3('0x24'),_0x61a3('0x3a')];return squel[_0x61a3('0x27')]()[_0x61a3('0x28')]('cm_hopper_black')[_0x61a3('0x2a')](['phone','ContactId',_0x61a3('0x2c'),_0x3bae5f,_0x61a3('0x2d'),_0x61a3('0x2e')],squel[_0x61a3('0x31')]()['fields'](_0x41cb3e)[_0x61a3('0x10')](_0x1000bb)['join'](_0x61a3('0x33'),null,_0x61a3('0x3b')+_0x1000bb+_0x61a3('0x34'))[_0x61a3('0x11')](_0x1306f7,null,_0x1306f7+_0x61a3('0x12')+_0x1000bb+'.'+_0x3bae5f)['where'](_0x1000bb+_0x61a3('0x3c'),_0xb922f2)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0x61a3('0x13')](_0x61a3('0x36'),squel[_0x61a3('0x31')]()[_0x61a3('0xe')](_0x61a3('0xf'))[_0x61a3('0x10')](_0x61a3('0x3d'))[_0x61a3('0x13')](_0x61a3('0x3e'),_0xb922f2)[_0x61a3('0x13')](_0x3bae5f+'\x20=\x20'+_0x1000bb+'.'+_0x3bae5f)))[_0x61a3('0x39')]();}function insertTzCmHopper(_0x5d0f04,_0x40bf79,_0x18a078,_0x106365,_0x940616,_0x1383b6){var _0x3785c8=['cm_contacts.phone',_0x61a3('0x3f')+_0x1383b6+_0x61a3('0x40'),'cm_contacts.id',_0x61a3('0x23'),_0x40bf79+'.'+_0x106365,_0x61a3('0x24'),'cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','\x22'+_0x940616+'\x22'];var _0x246813=squel[_0x61a3('0x27')]()['into'](_0x61a3('0x29'))[_0x61a3('0x2a')]([_0x61a3('0xf'),_0x61a3('0x2b'),'ContactId',_0x61a3('0x2c'),_0x106365,_0x61a3('0x2d'),_0x61a3('0x2e'),_0x61a3('0x2f'),_0x61a3('0x30'),'recallme'],squel[_0x61a3('0x31')]()[_0x61a3('0x32')](_0x3785c8)[_0x61a3('0x10')](_0x40bf79)[_0x61a3('0x11')](_0x61a3('0x33'),null,_0x61a3('0x3b')+_0x40bf79+_0x61a3('0x34'))['join'](_0x18a078,null,_0x18a078+_0x61a3('0x12')+_0x40bf79+'.'+_0x106365)[_0x61a3('0x11')](_0x1383b6,null,_0x1383b6+_0x61a3('0x12')+_0x40bf79+'.'+_0x106365)[_0x61a3('0x13')](_0x40bf79+'.CmListId\x20=\x20?',_0x5d0f04)[_0x61a3('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x61a3('0x13')](_0x61a3('0x36'),selectNotIn(_0x40bf79,_0x18a078,_0x106365,_0x61a3('0x29'),['\x22always\x22',_0x61a3('0x38')]))[_0x61a3('0x13')](_0x61a3('0x36'),selectNotIn(_0x40bf79,_0x18a078,_0x106365,_0x61a3('0x29'),[_0x61a3('0x37')])))[_0x61a3('0x39')]();return _0x246813;}function insertTzCmHopperBlack(_0x3e08c8,_0x17802f,_0xf0aea7,_0x3d9515){var _0x4e1bf2=[_0x61a3('0x21'),_0x61a3('0x41'),'cm_contacts.ListId',_0x17802f+'.'+_0x3d9515,_0x61a3('0x24'),_0x61a3('0x3a')];return squel[_0x61a3('0x27')]()[_0x61a3('0x28')](_0x61a3('0x3d'))[_0x61a3('0x2a')]([_0x61a3('0xf'),_0x61a3('0x42'),_0x61a3('0x2c'),_0x3d9515,'createdAt','updatedAt'],squel[_0x61a3('0x31')]()[_0x61a3('0x32')](_0x4e1bf2)[_0x61a3('0x10')](_0x17802f)[_0x61a3('0x11')](_0x61a3('0x33'),null,_0x61a3('0x3b')+_0x17802f+'.CmListId')[_0x61a3('0x11')](_0xf0aea7,null,_0xf0aea7+_0x61a3('0x12')+_0x17802f+'.'+_0x3d9515)[_0x61a3('0x13')](_0x17802f+_0x61a3('0x3c'),_0x3e08c8)[_0x61a3('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x61a3('0x36'),squel[_0x61a3('0x31')]()['field'](_0x61a3('0xf'))[_0x61a3('0x10')](_0x61a3('0x3d'))[_0x61a3('0x13')](_0x61a3('0x3e'),_0x3e08c8)[_0x61a3('0x13')](_0x3d9515+'\x20=\x20'+_0x17802f+'.'+_0x3d9515)))['toString']();}function insertCmHopperAdditionalPhones(_0x4df5e5){var _0x3a6da4=['cm_hopper.id',_0x61a3('0x43'),_0x61a3('0x44'),_0x61a3('0x45'),_0x61a3('0x46')];return squel[_0x61a3('0x27')]()[_0x61a3('0x28')]('cm_hopper_additional_phones')[_0x61a3('0x2a')](['CmHopperId',_0x61a3('0xf'),_0x61a3('0x47'),'createdAt',_0x61a3('0x2e')],squel['select']()['fields'](_0x3a6da4)[_0x61a3('0x10')](_0x61a3('0x29'))[_0x61a3('0x11')](_0x61a3('0x33'),null,_0x61a3('0x48'))[_0x61a3('0x11')]('cm_contact_has_items',null,_0x61a3('0x49'))[_0x61a3('0x13')](_0x61a3('0x4a'),_0x4df5e5)[_0x61a3('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW))[_0x61a3('0x39')]();}function insertCmContact(_0x5dc2a8,_0x2af693,_0xafa2e6,_0x593175){var _0x37f62b=_[_0x61a3('0x4b')](_[_0x61a3('0x4c')](_0x593175),['ListId',_0x61a3('0x4d'),_0x61a3('0x2d'),'updatedAt','scheduledAt']);return squel['insert']()[_0x61a3('0x28')](_0x61a3('0x33'))[_0x61a3('0x2a')](_0x37f62b,squel[_0x61a3('0x31')]()['fields'](_0x37f62b)[_0x61a3('0x10')](_0x2af693)[_0x61a3('0x13')]('('+_0xafa2e6[_0x61a3('0x11')](',')+')\x20NOT\x20IN\x20?',squel['select']()['fields'](_0xafa2e6)[_0x61a3('0x10')](_0x61a3('0x33'))[_0x61a3('0x13')]('ListId\x20=\x20?',_0x5dc2a8)[_0x61a3('0x13')](_0x61a3('0x4e')))['where'](_0x61a3('0x4f'),squel[_0x61a3('0x31')]()[_0x61a3('0xe')]('MIN(id)','min_id')[_0x61a3('0x10')](_0x2af693)[_0x61a3('0x50')](_0xafa2e6[_0x61a3('0x11')](','))))['toString']();}function handleStop(){logger[_0x61a3('0x51')](_0x61a3('0x52'));stopped=!![];}function handleUncaughtException(_0x12f6ff){logger[_0x61a3('0x53')](_0x12f6ff[_0x61a3('0x54')]);process[_0x61a3('0x55')](0x1);}function handleError(_0x346281,_0x18ae7c){stats[_0x61a3('0x56')][_0x61a3('0x1a')]({'name':_0x18ae7c[_0x61a3('0x57')],'message':_0x18ae7c[_0x61a3('0x54')],'row':_0x346281});}function handleQuery(_0x53cac7){logger[_0x61a3('0x51')](_0x53cac7);return db[_0x61a3('0x58')][_0x61a3('0x59')](_0x53cac7)['spread'](function(_0x49dd10){results['push'](_0x49dd10);})[_0x61a3('0x5a')](function(_0x151031){logger[_0x61a3('0x53')](_0x151031[_0x61a3('0x54')]);});}function updateTzCampaigns(_0x14fe67){return new Promise(function(_0x2f1f51,_0x3034e9){var _0x6293b6=squel[_0x61a3('0x31')]()['fields'](['campaigns.id','campaigns.dialTimezone'])[_0x61a3('0x10')](_0x61a3('0x5b'))[_0x61a3('0x11')](_0x61a3('0x5c'),null,'campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId')[_0x61a3('0x13')](_0x61a3('0x5d')+_0x14fe67);db[_0x61a3('0x58')][_0x61a3('0x59')](_0x6293b6['toString']())[_0x61a3('0x5e')](function(_0x421832){var _0x4aba24=[];for(var _0x408d7e=0x0;_0x408d7e<_0x421832['length'];_0x408d7e++){_0x4aba24[_0x61a3('0x1a')](getTimezoneData(_0x421832[_0x408d7e],tmp_campaigns));}BPromise['all'](_0x4aba24)[_0x61a3('0x17')](function(){_0x2f1f51({'val':0x1});});})[_0x61a3('0x5a')](function(_0x403e86){logger[_0x61a3('0x53')](_0x403e86[_0x61a3('0x54')]);_0x2f1f51({'val':0x0});});});}function updateTzVoiceQueues(_0x6b6569){return new Promise(function(_0x204115,_0x1db054){var _0x5109f8=squel['select']()[_0x61a3('0x32')]([_0x61a3('0x5f'),'voice_queues.dialTimezone'])[_0x61a3('0x10')](_0x61a3('0x60'))[_0x61a3('0x11')](_0x61a3('0x61'),null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')[_0x61a3('0x13')]('voice_queues_has_cm_lists.CmListId='+_0x6b6569);db[_0x61a3('0x58')][_0x61a3('0x59')](_0x5109f8[_0x61a3('0x39')]())[_0x61a3('0x5e')](function(_0x1a5e44){var _0x3c3037=[];for(var _0x29e80a=0x0;_0x29e80a<_0x1a5e44[_0x61a3('0x19')];_0x29e80a++){_0x3c3037['push'](getTimezoneData(_0x1a5e44[_0x29e80a],tmp_voice_queues));}BPromise[_0x61a3('0x1b')](_0x3c3037)['then'](function(){_0x204115({'val':0x1});});})[_0x61a3('0x5a')](function(_0x44a7db){logger['error'](_0x44a7db[_0x61a3('0x54')]);_0x204115({'val':0x0});});});}function getTimezoneData(_0x4c173e,_0x11b169){return new Promise(function(_0x3b7a97,_0x749bd0){var _0x564211=shared[_0x61a3('0x62')];var _0x5e63da=_0x564211[_0x4c173e[_0x61a3('0x63')]];if(_[_0x61a3('0x64')](_0x5e63da)){_0x3b7a97({'ret':0x1});}else{var _0x41d281=_0x5e63da[_0x61a3('0x65')];var _0x4c8806=squel[_0x61a3('0x27')]()[_0x61a3('0x28')](_0x11b169)[_0x61a3('0x66')]('id',_0x4c173e['id'])[_0x61a3('0x66')](_0x61a3('0x67'),_0x41d281)[_0x61a3('0x66')](_0x61a3('0x63'),_0x4c173e[_0x61a3('0x63')])[_0x61a3('0x39')]();return db[_0x61a3('0x58')][_0x61a3('0x59')](_0x4c8806)[_0x61a3('0x5e')](function(_0x10f16e){_0x3b7a97({'ret':0x1});})[_0x61a3('0x5a')](function(_0x39f53a){logger[_0x61a3('0x53')](_0x39f53a[_0x61a3('0x54')]);_0x749bd0({'ret':0x1});});}});}function handleTZQuery(_0x2646fa){logger[_0x61a3('0x51')](_0x2646fa);return db[_0x61a3('0x58')][_0x61a3('0x59')](_0x2646fa)[_0x61a3('0x5e')](function(_0x284bc8){})['catch'](function(_0x3317dc){logger[_0x61a3('0x53')](_0x3317dc[_0x61a3('0x54')]);});}function main(_0x275da9,_0x1d805e,_0x1070cd,_0x7d180d){logger['info'](_0x61a3('0x68'),_0x275da9,JSON[_0x61a3('0x69')](_0x1d805e));process['send']('start');var _0x186c1c=_0x1d805e['binding'];var _0x1af343=_[_0x61a3('0x6a')](_0x186c1c);var _0x24de0e=_0x1d805e[_0x61a3('0x6b')];var _0x5d54d3=path[_0x61a3('0x11')](config['root'],'server/files/tmp',_0x24de0e+_0x61a3('0x6c'));hasTZ=_[_0x61a3('0x4c')](_0x186c1c)[_0x61a3('0x6d')](_0x61a3('0x63'));var _0x4d9863=_[_0x61a3('0x4c')](_0x186c1c)[_0x61a3('0x11')]();logger['info'](_0x61a3('0x6e'),_0x4d9863);db[_0x61a3('0x6f')][_0x61a3('0x15')]({'raw':!![],'attributes':['id',_0x61a3('0x70')]})[_0x61a3('0x17')](function(_0x18edef){for(var _0x58032b=0x0;_0x58032b<_0x18edef[_0x61a3('0x19')];_0x58032b++){if(_0x18edef[_0x58032b][_0x61a3('0x70')]in _0x186c1c){contactItemTypes[_0x61a3('0x1a')](_0x18edef[_0x58032b]);delete _0x1af343[_0x18edef[_0x58032b]['name']];hasAdditionalPhones=!![];}for(var _0x28f6bb in _0x186c1c){if(_0x18edef[_0x58032b][_0x61a3('0x70')]+_0x61a3('0x71')===_0x28f6bb){phoneDescriptions[_0x61a3('0x1a')]({'itemTypeId':_0x18edef[_0x58032b]['id'],'description':_0x28f6bb});delete _0x1af343[_0x28f6bb];}}}if(hasAdditionalPhones)_0x1af343[_0x61a3('0x16')]='';var _0x26bc17=_[_0x61a3('0x4c')](_0x1af343)[_0x61a3('0x11')]();logger[_0x61a3('0x51')](_0x61a3('0x6e'),_0x26bc17);fs[_0x61a3('0x72')](_0x5d54d3,_0x26bc17+'\x0a');Papa['parse'](fs[_0x61a3('0x73')](_0x275da9),{'header':!![],'skipEmptyLines':!![],'step':function(_0x641de0,_0x4fc347){try{for(var _0x533902=0x0,_0x1b8a11=[];_0x533902<_0x641de0[_0x61a3('0x74')][_0x61a3('0x19')];_0x533902++){stats[_0x61a3('0x75')]+=0x1;if(_0x641de0[_0x61a3('0x56')][_0x533902]){handleError(_0x641de0[_0x61a3('0x74')][_0x533902],_0x641de0[_0x61a3('0x56')][_0x533902]);}else{var _0x14ddc0=[];var _0x39212f=[];var _0x91a42a={};for(var _0x137e9a in _0x186c1c){let _0x2f127f=contactItemTypes[_0x61a3('0x76')](_0x4feaad=>_0x4feaad[_0x61a3('0x70')]===_0x137e9a);let _0x428014=contactItemTypes[_0x61a3('0x76')](_0x494a2b=>_0x494a2b[_0x61a3('0x70')]+_0x61a3('0x71')===_0x137e9a);if(_[_0x61a3('0x64')](_0x2f127f)&&_[_0x61a3('0x64')](_0x428014)){if(_0x186c1c[_0x61a3('0x77')](_0x137e9a)){if(_0x641de0[_0x61a3('0x74')][_0x533902][_0x186c1c[_0x137e9a]]){var _0x11072d=_[_0x61a3('0x78')](_0x641de0[_0x61a3('0x74')][_0x533902][_0x186c1c[_0x137e9a]]['replace'](/"/g,'\x27'));switch(_0x137e9a){case _0x61a3('0x2b'):var _0x4bf938=moment(_0x11072d,_0x61a3('0xd'),!![]);if(_0x4bf938[_0x61a3('0x79')]()){_0x1b8a11[_0x61a3('0x1a')]('\x22'+_0x11072d+'\x22');}else{_0x14ddc0[_0x61a3('0x1a')](_0x61a3('0x7a'));}break;case _0x61a3('0x2f'):var _0x29ef96=parseInt(_0x11072d);_0x11072d=_['isNaN'](_0x29ef96)||_0x29ef96<0x0||_0x29ef96>0x4?_0x7d180d?0x3:0x2:_0x29ef96;_0x1b8a11[_0x61a3('0x1a')]('\x22'+_0x11072d+'\x22');break;case'UserId':var _0x196493=parseInt(_0x11072d);if(_[_0x61a3('0x7b')](_0x196493)&&_[_0x61a3('0x6d')](_0x1070cd,_0x196493)){_0x1b8a11[_0x61a3('0x1a')]('\x22'+_0x196493+'\x22');}else{_0x14ddc0['push'](_0x61a3('0x7c'));}break;case _0x61a3('0x7d'):if(isEmail(_0x11072d)){_0x1b8a11[_0x61a3('0x1a')]('\x22'+_0x11072d+'\x22');}else{_0x14ddc0[_0x61a3('0x1a')](_0x61a3('0x7e'));}break;case'dateOfBirth':var _0xb418c7=moment(_0x11072d,'YYYY-MM-DD',!![]);if(_0xb418c7[_0x61a3('0x79')]()){_0x1b8a11[_0x61a3('0x1a')]('\x22'+_0x11072d+'\x22');}else{_0x14ddc0['push'](_0x61a3('0x7f'));}break;case _0x61a3('0x63'):var _0x2d8185=shared[_0x61a3('0x62')];var _0x3e68fb=_0x2d8185[_0x11072d];if(!_[_0x61a3('0x64')](_0x3e68fb)){var _0x46d71f=_0x3e68fb[_0x61a3('0x65')];_0x1b8a11['push']('\x22'+_0x11072d+'\x22');_0x1b8a11[_0x61a3('0x1a')]('\x22'+_0x46d71f+'\x22');}break;default:_0x1b8a11[_0x61a3('0x1a')]('\x22'+_0x11072d+'\x22');}}else{switch(_0x137e9a){case _0x61a3('0x80'):case _0x61a3('0xf'):_0x14ddc0[_0x61a3('0x1a')](_0x137e9a+'\x20not\x20specified');break;default:_0x1b8a11[_0x61a3('0x1a')]('\x22\x22');}}}}else{var _0x3e4b96='';if(!_['isNil'](_0x2f127f)){if(!_0x91a42a['hasOwnProperty'](_0x2f127f['id'])){if(!_[_0x61a3('0x64')](_0x641de0[_0x61a3('0x74')][_0x533902][_0x186c1c[_0x137e9a]])){var _0x11072d=_[_0x61a3('0x78')](_0x641de0['data'][_0x533902][_0x186c1c[_0x137e9a]][_0x61a3('0x81')](/"/g,'\x27'));var _0x1bc689=phoneDescriptions[_0x61a3('0x76')](_0x4ce5a9=>_0x4ce5a9[_0x61a3('0x82')]===_0x2f127f['id']);if(!_[_0x61a3('0x64')](_0x1bc689)){var _0x1bba58=_[_0x61a3('0x78')](_0x641de0[_0x61a3('0x74')][_0x533902][_0x186c1c[_0x1bc689[_0x61a3('0x83')]]][_0x61a3('0x81')](/"/g,'\x27'));if(!_[_0x61a3('0x64')](_0x1bba58))_0x11072d=_0x11072d+'§'+_0x1bba58;}if(_0x3e4b96=='')_0x3e4b96=_0x11072d;else _0x3e4b96+='|'+_0x11072d;}_0x39212f[_0x61a3('0x1a')](_0x2f127f['id']+':'+_0x3e4b96);_0x91a42a[_0x2f127f['id']]=0x1;}}}}if(hasAdditionalPhones){_0x1b8a11[_0x61a3('0x1a')]('\x22'+_0x39212f['join'](';')+'\x22');}if(_0x14ddc0[_0x61a3('0x19')]){handleError(_0x641de0['data'][_0x533902],{'code':_0x61a3('0x84'),'message':_0x14ddc0[_0x61a3('0x11')]()});}else{fs[_0x61a3('0x85')](_0x5d54d3,_0x1b8a11[_0x61a3('0x11')]()+'\x0a');}_0x1b8a11=[];}if(!(stats[_0x61a3('0x75')]%0xc8)){socket[_0x61a3('0x86')](_0x61a3('0x87')+_0x24de0e,stats);stats[_0x61a3('0x56')]=[];}}if(stopped){logger[_0x61a3('0x51')](_0x61a3('0x88'));_0x4fc347['abort']();}}catch(_0x57ffaa){handleError(_0x641de0['data'][_0x533902],{'code':_0x61a3('0x89'),'message':_0x57ffaa[_0x61a3('0x54')]});logger[_0x61a3('0x53')]('step',_0x57ffaa[_0x61a3('0x54')]);}},'complete':function(){try{var _0x4a9d9a=[];var _0x3de4ee=[];var _0x2a0139=_0x61a3('0x33');if(_0x1d805e['duplicates']&&_0x1d805e['duplicates'][_0x61a3('0x19')]){_0x2a0139=_0x61a3('0x8a')+_0x24de0e;_0x4a9d9a[_0x61a3('0x1a')](_0x61a3('0x8b')+_0x2a0139+'\x20LIKE\x20cm_contacts;');}tmp_campaigns=_0x61a3('0x8c')+_0x24de0e;tmp_voice_queues=_0x61a3('0x8d')+_0x24de0e;_0x3de4ee['push'](_0x61a3('0x8b')+tmp_campaigns+_0x61a3('0x8e'));_0x3de4ee[_0x61a3('0x1a')](_0x61a3('0x8b')+tmp_voice_queues+_0x61a3('0x8e'));BPromise['each'](_0x3de4ee,handleTZQuery)[_0x61a3('0x17')](function(_0x25c371){updateTzCampaigns(_0x1d805e['ListId'])[_0x61a3('0x17')](function(_0x5ce047){updateTzVoiceQueues(_0x1d805e[_0x61a3('0x2c')])[_0x61a3('0x17')](function(_0x3c9748){if(hasTZ)_0x26bc17=_0x26bc17[_0x61a3('0x81')](_0x61a3('0x63'),_0x61a3('0x8f'));var _0x56078f=util['format'](_0x61a3('0x90'),_0x5d54d3,_0x2a0139,_0x26bc17,_0x1d805e[_0x61a3('0x2c')],_0x1d805e[_0x61a3('0x4d')]||null,NOW,NOW);if(_[_0x61a3('0x64')](_0x186c1c[_0x61a3('0x2b')])){_0x56078f+=_0x61a3('0x91');}_0x4a9d9a[_0x61a3('0x1a')](_0x56078f);if(_0x1d805e[_0x61a3('0x92')]&&_0x1d805e[_0x61a3('0x92')]['length']){_0x4a9d9a[_0x61a3('0x1a')](insertCmContact(_0x1d805e[_0x61a3('0x2c')],_0x2a0139,_0x1d805e[_0x61a3('0x92')],_0x186c1c));_0x4a9d9a[_0x61a3('0x1a')](_0x61a3('0x93')+_0x2a0139+';');}BPromise['each'](_0x4a9d9a,handleQuery)[_0x61a3('0x17')](function(_0x126cc4){BPromise[_0x61a3('0x1b')]([handleAdditionalPhones()])[_0x61a3('0x17')](function(){_0x4a9d9a=[];for(var _0x59fe36=0x0;_0x59fe36\x20\x20','existsSync','file\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','join','AdditionalPhones','then','push','split','length','isNil','findOne','CmContactHasItem','updated','PHONE','inserted','cm_contacts.phone','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','insert','cm_hopper','fromQuery','scheduledat','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','\x22always\x22','toString','cm_contacts.id','into','cm_hopper_black','ContactId','cm_contacts.ListId\x20=\x20','ListId\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.priority','\x20=\x20','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.createdAt','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','group','info','error','message','exit','errors','sequelize','catch','campaigns.id','campaigns.dialTimezone','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','query','spread','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues_has_cm_lists.CmListId=','all','dialTimezone','utcOffset','set','main','stringify','send','binding','clone','root','server/files/tmp','.csv','includes','header','ContactItemType','findAll','name','parse','data','find','_description','hasOwnProperty','trim','replace','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','timezones','firstName','\x20not\x20specified','itemTypeId','description','rows','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','dialTimezone,utcOffset','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','contactId','contactTypeId','orderBy','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns','campaigns_has_cm_blacklists','DROP\x20TABLE\x20','finish'];(function(_0x24c1ce,_0x242cd0){var _0x4a9106=function(_0x1a743c){while(--_0x1a743c){_0x24c1ce['push'](_0x24c1ce['shift']());}};_0x4a9106(++_0x242cd0);}(_0x3dbf,0x183));var _0xf3db=function(_0x13c90f,_0x16dd88){_0x13c90f=_0x13c90f-0x0;var _0x2b785f=_0x3dbf[_0x13c90f];return _0x2b785f;};'use strict';var fs=require('fs');var path=require(_0xf3db('0x0'));var _=require(_0xf3db('0x1'));var Papa=require('papaparse');var util=require(_0xf3db('0x2'));var BPromise=require(_0xf3db('0x3'));var moment=require(_0xf3db('0x4'));var squel=require(_0xf3db('0x5'));var Redis=require(_0xf3db('0x6'));var db=require(_0xf3db('0x7'))['db'];var config=require(_0xf3db('0x8'));var shared=require(_0xf3db('0x9'));var logger=require('../../../config/logger')(_0xf3db('0xa'));config[_0xf3db('0xb')]=_[_0xf3db('0xc')](config['redis'],{'host':_0xf3db('0xd'),'port':0x18eb});var socket=require(_0xf3db('0xe'))(new Redis(config[_0xf3db('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0xf3db('0xf')](_0xf3db('0x10'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0xf3db('0xf')](_0xf3db('0x10'));function isEmail(_0x5aa62b){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))*$/[_0xf3db('0x11')](_0x5aa62b);}function selectNotIn(_0x5d0232,_0x26d57f,_0x3f6c9c,_0x16e374,_0x1012ad){return squel[_0xf3db('0x12')]()[_0xf3db('0x13')](_0xf3db('0x14'))[_0xf3db('0x15')](_0x16e374)['join'](_0x26d57f,null,_0x26d57f+_0xf3db('0x16')+_0x16e374+'.'+_0x3f6c9c)['where'](_0x16e374+'.'+_0x3f6c9c+'\x20=\x20'+_0x5d0232+'.'+_0x3f6c9c)[_0xf3db('0x17')](_0x26d57f+_0xf3db('0x18')+_0x1012ad[_0xf3db('0x19')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x2acccf,_0x279ba9){promisesAdditionalPhones=[];return db['CmContact']['findAll']({'raw':!![],'attributes':['id',_0xf3db('0x1a')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0xf3db('0x1b')](function(_0x57fb4b){if(_0x57fb4b!==null){var _0x40473b=[];for(var _0x1261b2=0x0;_0x1261b2<_0x57fb4b['length'];_0x1261b2++){var _0x23e7e7=_0x57fb4b[_0x1261b2];_0x40473b[_0xf3db('0x1c')](insertAdditionalPhones(_0x23e7e7));}}Promise['all'](_0x40473b)[_0xf3db('0x1b')](function(){_0x2acccf({'val':0x1});});});});}function insertAdditionalPhones(_0x1b5210){return new Promise(function(_0x4f0ef4,_0x5461a6){var _0x10fa58=_0x1b5210['AdditionalPhones'];var _0x27117e=_0x10fa58[_0xf3db('0x1d')](';');var _0x563e8f=[];orderBy=0x0;for(var _0x1d5e21=0x0;_0x1d5e21<_0x27117e[_0xf3db('0x1e')];_0x1d5e21++){_0x563e8f[_0xf3db('0x1c')](splitAdditionalPhone(_0x1b5210['id'],_0x27117e[_0x1d5e21]));}Promise['all'](_0x563e8f)[_0xf3db('0x1b')](function(){_0x4f0ef4({'val':_0x27117e['length']});});});}function splitAdditionalPhone(_0x3c38cb,_0x4400cc){return new Promise(function(_0x1f30d1,_0x36249e){var _0x401b1e=_0x4400cc[_0xf3db('0x1d')](':');var _0x42e4a6=_0x401b1e[0x0];var _0xaa77aa=_0x401b1e[0x1];if(!_[_0xf3db('0x1f')](_0xaa77aa)){var _0xf1a9f7=_0xaa77aa['split']('|');var _0x5e513b=[];for(var _0x220bdc=0x0;_0x220bdc<_0xf1a9f7[_0xf3db('0x1e')];_0x220bdc++){if(_0xf1a9f7[_0x220bdc]!==''){var _0x44ed9d=_['filter'](promisesAdditionalPhones,{'contactId':_0x3c38cb,'phone':_0xf1a9f7[_0x220bdc]});if(_0x44ed9d[_0xf3db('0x1e')]==0x0){orderBy++;promisesAdditionalPhones[_0xf3db('0x1c')]({'contactId':_0x3c38cb,'contactTypeId':_0x42e4a6,'phone':_0xf1a9f7[_0x220bdc],'orderBy':orderBy});}}}_0x1f30d1({'ok':0x1});}else _0x1f30d1({'res':0x0});});}function createAdditionalPhone(_0x13b501,_0x2e1374,_0x567e5b,_0x40b304){var _0x15b49f='';var _0x270d89='';var _0x2a3db9=_0x567e5b[_0xf3db('0x1d')]('§');_0x15b49f=_0x2a3db9[0x0];if(_0x2a3db9[_0xf3db('0x1e')]==0x2)_0x270d89=_0x2a3db9[0x1];return new Promise(function(_0x12b3fe,_0x3ea75f){return db['CmContactHasItem'][_0xf3db('0x20')]({'where':{'CmContactId':_0x13b501,'item':_0x15b49f}})[_0xf3db('0x1b')](function(_0x52e470){if(_0x52e470){return db[_0xf3db('0x21')]['update']({'ItemTypeId':_0x2e1374,'description':_0x270d89,'OrderBy':_0x40b304},{'where':{'CmContactId':_0x13b501,'item':_0x15b49f}})[_0xf3db('0x1b')](function(_0x5bb782){_0x12b3fe({'res':_0xf3db('0x22')});});}else{return db[_0xf3db('0x21')]['create']({'CmContactId':_0x13b501,'item':_0x15b49f,'description':_0x270d89,'ItemTypeId':_0x2e1374,'OrderBy':_0x40b304,'ItemClass':_0xf3db('0x23')})[_0xf3db('0x1b')](function(_0x5339cd){_0x12b3fe({'res':_0xf3db('0x24')});});}});});}function insertCmHopper(_0x27970c,_0x4fba94,_0x2a7e32,_0x31db33,_0x50c04d){var _0x1a6158=[_0xf3db('0x25'),'cm_contacts.scheduledat','cm_contacts.id',_0xf3db('0x26'),_0x4fba94+'.'+_0x31db33,_0xf3db('0x27'),_0xf3db('0x28'),'cm_contacts.priority',_0xf3db('0x29'),'\x22'+_0x50c04d+'\x22'];return squel[_0xf3db('0x2a')]()['into'](_0xf3db('0x2b'))[_0xf3db('0x2c')]([_0xf3db('0x14'),_0xf3db('0x2d'),'ContactId',_0xf3db('0x2e'),_0x31db33,_0xf3db('0x2f'),_0xf3db('0x30'),_0xf3db('0x31'),_0xf3db('0x32'),_0xf3db('0x33')],squel['select']()[_0xf3db('0x34')](_0x1a6158)['from'](_0x4fba94)[_0xf3db('0x19')](_0xf3db('0x35'),null,'cm_contacts.ListId\x20=\x20'+_0x4fba94+_0xf3db('0x36'))[_0xf3db('0x19')](_0x2a7e32,null,_0x2a7e32+_0xf3db('0x16')+_0x4fba94+'.'+_0x31db33)[_0xf3db('0x17')](_0x4fba94+_0xf3db('0x37'),_0x27970c)[_0xf3db('0x17')](_0xf3db('0x38'),NOW)[_0xf3db('0x17')](_0xf3db('0x39'),selectNotIn(_0x4fba94,_0x2a7e32,_0x31db33,_0xf3db('0x2b'),['\x22always\x22',_0xf3db('0x3a')]))[_0xf3db('0x17')](_0xf3db('0x39'),selectNotIn(_0x4fba94,_0x2a7e32,_0x31db33,'cm_hopper',[_0xf3db('0x3b')])))[_0xf3db('0x3c')]();}function insertCmHopperBlack(_0x542d4e,_0x3213ee,_0xc6dc86,_0x6534d1){var _0x584c12=[_0xf3db('0x25'),_0xf3db('0x3d'),_0xf3db('0x26'),_0x3213ee+'.'+_0x6534d1,_0xf3db('0x27'),_0xf3db('0x28')];return squel[_0xf3db('0x2a')]()[_0xf3db('0x3e')](_0xf3db('0x3f'))[_0xf3db('0x2c')]([_0xf3db('0x14'),_0xf3db('0x40'),_0xf3db('0x2e'),_0x6534d1,_0xf3db('0x2f'),_0xf3db('0x30')],squel[_0xf3db('0x12')]()[_0xf3db('0x34')](_0x584c12)[_0xf3db('0x15')](_0x3213ee)[_0xf3db('0x19')](_0xf3db('0x35'),null,_0xf3db('0x41')+_0x3213ee+_0xf3db('0x36'))[_0xf3db('0x19')](_0xc6dc86,null,_0xc6dc86+'.id\x20=\x20'+_0x3213ee+'.'+_0x6534d1)[_0xf3db('0x17')](_0x3213ee+_0xf3db('0x37'),_0x542d4e)[_0xf3db('0x17')](_0xf3db('0x38'),NOW)[_0xf3db('0x17')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0xf3db('0x12')]()[_0xf3db('0x13')](_0xf3db('0x14'))[_0xf3db('0x15')](_0xf3db('0x3f'))[_0xf3db('0x17')](_0xf3db('0x42'),_0x542d4e)[_0xf3db('0x17')](_0x6534d1+'\x20=\x20'+_0x3213ee+'.'+_0x6534d1)))['toString']();}function insertTzCmHopper(_0x1da364,_0x6426c,_0x5e2430,_0x486b29,_0x3f7d33,_0x64549a){var _0x530587=[_0xf3db('0x25'),_0xf3db('0x43')+_0x64549a+_0xf3db('0x44'),_0xf3db('0x3d'),_0xf3db('0x26'),_0x6426c+'.'+_0x486b29,_0xf3db('0x27'),'cm_contacts.updatedAt',_0xf3db('0x45'),_0xf3db('0x29'),'\x22'+_0x3f7d33+'\x22'];var _0x306c1d=squel[_0xf3db('0x2a')]()[_0xf3db('0x3e')](_0xf3db('0x2b'))[_0xf3db('0x2c')]([_0xf3db('0x14'),'scheduledat',_0xf3db('0x40'),'ListId',_0x486b29,_0xf3db('0x2f'),_0xf3db('0x30'),'priority',_0xf3db('0x32'),_0xf3db('0x33')],squel[_0xf3db('0x12')]()[_0xf3db('0x34')](_0x530587)['from'](_0x6426c)['join'](_0xf3db('0x35'),null,_0xf3db('0x41')+_0x6426c+_0xf3db('0x36'))[_0xf3db('0x19')](_0x5e2430,null,_0x5e2430+_0xf3db('0x16')+_0x6426c+'.'+_0x486b29)[_0xf3db('0x19')](_0x64549a,null,_0x64549a+_0xf3db('0x16')+_0x6426c+'.'+_0x486b29)[_0xf3db('0x17')](_0x6426c+'.CmListId\x20=\x20?',_0x1da364)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0xf3db('0x17')](_0xf3db('0x39'),selectNotIn(_0x6426c,_0x5e2430,_0x486b29,_0xf3db('0x2b'),[_0xf3db('0x3b'),'\x22onlyIfOpen\x22']))[_0xf3db('0x17')](_0xf3db('0x39'),selectNotIn(_0x6426c,_0x5e2430,_0x486b29,_0xf3db('0x2b'),[_0xf3db('0x3b')])))['toString']();return _0x306c1d;}function insertTzCmHopperBlack(_0x82029e,_0x51e64e,_0x284bae,_0x175e54){var _0x1096d1=[_0xf3db('0x25'),'cm_contacts.id',_0xf3db('0x26'),_0x51e64e+'.'+_0x175e54,'cm_contacts.createdAt','cm_contacts.updatedAt'];return squel[_0xf3db('0x2a')]()[_0xf3db('0x3e')](_0xf3db('0x3f'))['fromQuery']([_0xf3db('0x14'),_0xf3db('0x40'),_0xf3db('0x2e'),_0x175e54,'createdAt',_0xf3db('0x30')],squel['select']()[_0xf3db('0x34')](_0x1096d1)['from'](_0x51e64e)[_0xf3db('0x19')]('cm_contacts',null,_0xf3db('0x41')+_0x51e64e+'.CmListId')[_0xf3db('0x19')](_0x284bae,null,_0x284bae+_0xf3db('0x16')+_0x51e64e+'.'+_0x175e54)[_0xf3db('0x17')](_0x51e64e+'.CmListId\x20=\x20?',_0x82029e)[_0xf3db('0x17')](_0xf3db('0x38'),NOW)[_0xf3db('0x17')](_0xf3db('0x39'),squel['select']()[_0xf3db('0x13')](_0xf3db('0x14'))[_0xf3db('0x15')](_0xf3db('0x3f'))[_0xf3db('0x17')](_0xf3db('0x42'),_0x82029e)['where'](_0x175e54+_0xf3db('0x46')+_0x51e64e+'.'+_0x175e54)))['toString']();}function insertCmHopperAdditionalPhones(_0x508018){var _0x3fedf6=[_0xf3db('0x47'),_0xf3db('0x48'),'cm_contact_has_items.OrderBy',_0xf3db('0x49'),'cm_contact_has_items.updatedAt'];return squel[_0xf3db('0x2a')]()[_0xf3db('0x3e')]('cm_hopper_additional_phones')['fromQuery']([_0xf3db('0x4a'),_0xf3db('0x14'),_0xf3db('0x4b'),'createdAt','updatedAt'],squel[_0xf3db('0x12')]()[_0xf3db('0x34')](_0x3fedf6)[_0xf3db('0x15')]('cm_hopper')[_0xf3db('0x19')](_0xf3db('0x35'),null,_0xf3db('0x4c'))[_0xf3db('0x19')](_0xf3db('0x4d'),null,_0xf3db('0x4e'))['where'](_0xf3db('0x4f'),_0x508018)[_0xf3db('0x17')](_0xf3db('0x38'),NOW))[_0xf3db('0x3c')]();}function insertCmContact(_0x231994,_0x1d6506,_0x3f9b13,_0x5ae435){var _0x47d923=_['concat'](_[_0xf3db('0x50')](_0x5ae435),[_0xf3db('0x2e'),_0xf3db('0x51'),_0xf3db('0x2f'),_0xf3db('0x30'),'scheduledAt']);return squel[_0xf3db('0x2a')]()[_0xf3db('0x3e')](_0xf3db('0x35'))['fromQuery'](_0x47d923,squel[_0xf3db('0x12')]()[_0xf3db('0x34')](_0x47d923)['from'](_0x1d6506)['where']('('+_0x3f9b13[_0xf3db('0x19')](',')+_0xf3db('0x52'),squel[_0xf3db('0x12')]()['fields'](_0x3f9b13)[_0xf3db('0x15')]('cm_contacts')[_0xf3db('0x17')](_0xf3db('0x42'),_0x231994)['where'](_0xf3db('0x53')))['where'](_0xf3db('0x54'),squel[_0xf3db('0x12')]()[_0xf3db('0x13')](_0xf3db('0x55'),'min_id')[_0xf3db('0x15')](_0x1d6506)[_0xf3db('0x56')](_0x3f9b13[_0xf3db('0x19')](','))))[_0xf3db('0x3c')]();}function handleStop(){logger[_0xf3db('0x57')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x686b51){logger[_0xf3db('0x58')](_0x686b51[_0xf3db('0x59')]);process[_0xf3db('0x5a')](0x1);}function handleError(_0x58c0f3,_0x49e341){stats[_0xf3db('0x5b')]['push']({'name':_0x49e341['code'],'message':_0x49e341[_0xf3db('0x59')],'row':_0x58c0f3});}function handleQuery(_0x47ef36){logger[_0xf3db('0x57')](_0x47ef36);return db[_0xf3db('0x5c')]['query'](_0x47ef36)['spread'](function(_0x56dd62){results[_0xf3db('0x1c')](_0x56dd62);})[_0xf3db('0x5d')](function(_0x710c6e){logger[_0xf3db('0x58')](_0x710c6e['message']);});}function updateTzCampaigns(_0x59db5b){return new Promise(function(_0x29f7b0,_0x12dcc0){var _0x56ecab=squel[_0xf3db('0x12')]()['fields']([_0xf3db('0x5e'),_0xf3db('0x5f')])[_0xf3db('0x15')]('campaigns')[_0xf3db('0x19')](_0xf3db('0x60'),null,_0xf3db('0x61'))['where'](_0xf3db('0x62')+_0x59db5b);db[_0xf3db('0x5c')][_0xf3db('0x63')](_0x56ecab['toString']())[_0xf3db('0x64')](function(_0x5d5619){var _0x2b4148=[];for(var _0x459bc4=0x0;_0x459bc4<_0x5d5619[_0xf3db('0x1e')];_0x459bc4++){_0x2b4148['push'](getTimezoneData(_0x5d5619[_0x459bc4],tmp_campaigns));}BPromise['all'](_0x2b4148)[_0xf3db('0x1b')](function(){_0x29f7b0({'val':0x1});});})[_0xf3db('0x5d')](function(_0x1c6d0b){logger['error'](_0x1c6d0b[_0xf3db('0x59')]);_0x29f7b0({'val':0x0});});});}function updateTzVoiceQueues(_0x423515){return new Promise(function(_0x1bc6ea,_0x2164a8){var _0x5d348c=squel[_0xf3db('0x12')]()[_0xf3db('0x34')]([_0xf3db('0x65'),_0xf3db('0x66')])[_0xf3db('0x15')](_0xf3db('0x67'))[_0xf3db('0x19')](_0xf3db('0x68'),null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')[_0xf3db('0x17')](_0xf3db('0x69')+_0x423515);db['sequelize'][_0xf3db('0x63')](_0x5d348c[_0xf3db('0x3c')]())[_0xf3db('0x64')](function(_0xb276f9){var _0x47cbda=[];for(var _0x34bdc9=0x0;_0x34bdc9<_0xb276f9['length'];_0x34bdc9++){_0x47cbda[_0xf3db('0x1c')](getTimezoneData(_0xb276f9[_0x34bdc9],tmp_voice_queues));}BPromise[_0xf3db('0x6a')](_0x47cbda)[_0xf3db('0x1b')](function(){_0x1bc6ea({'val':0x1});});})['catch'](function(_0x3299ba){logger[_0xf3db('0x58')](_0x3299ba[_0xf3db('0x59')]);_0x1bc6ea({'val':0x0});});});}function getTimezoneData(_0x2b879f,_0x4e2f4b){return new Promise(function(_0x1f90e3,_0x408773){var _0x529c0d=shared['timezones'];var _0xb34b5f=_0x529c0d[_0x2b879f[_0xf3db('0x6b')]];if(_[_0xf3db('0x1f')](_0xb34b5f)){_0x1f90e3({'ret':0x1});}else{var _0xde68dc=_0xb34b5f[_0xf3db('0x6c')];var _0x57e832=squel[_0xf3db('0x2a')]()['into'](_0x4e2f4b)['set']('id',_0x2b879f['id'])[_0xf3db('0x6d')]('offset',_0xde68dc)[_0xf3db('0x6d')]('dialTimezone',_0x2b879f['dialTimezone'])[_0xf3db('0x3c')]();return db[_0xf3db('0x5c')][_0xf3db('0x63')](_0x57e832)['spread'](function(_0x13132d){_0x1f90e3({'ret':0x1});})['catch'](function(_0x5b8418){logger['error'](_0x5b8418[_0xf3db('0x59')]);_0x408773({'ret':0x1});});}});}function handleTZQuery(_0x1422a9){logger[_0xf3db('0x57')](_0x1422a9);return db[_0xf3db('0x5c')][_0xf3db('0x63')](_0x1422a9)[_0xf3db('0x64')](function(_0x5e64a2){})[_0xf3db('0x5d')](function(_0x23cda7){logger[_0xf3db('0x58')](_0x23cda7[_0xf3db('0x59')]);});}function main(_0x84a07,_0x288fd9,_0x222aeb,_0xa21c84){logger[_0xf3db('0x57')](_0xf3db('0x6e'),_0x84a07,JSON[_0xf3db('0x6f')](_0x288fd9));process[_0xf3db('0x70')]('start');var _0x1ead37=_0x288fd9[_0xf3db('0x71')];var _0x3a4a99=_[_0xf3db('0x72')](_0x1ead37);var _0x34a32d=_0x288fd9['socket_timestamp'];var _0x3d265b=path[_0xf3db('0x19')](config[_0xf3db('0x73')],_0xf3db('0x74'),_0x34a32d+_0xf3db('0x75'));hasTZ=_[_0xf3db('0x50')](_0x1ead37)[_0xf3db('0x76')](_0xf3db('0x6b'));var _0x280c2b=_[_0xf3db('0x50')](_0x1ead37)[_0xf3db('0x19')]();logger[_0xf3db('0x57')](_0xf3db('0x77'),_0x280c2b);db[_0xf3db('0x78')][_0xf3db('0x79')]({'raw':!![],'attributes':['id','name']})[_0xf3db('0x1b')](function(_0x44c202){for(var _0x3bfaa5=0x0;_0x3bfaa5<_0x44c202[_0xf3db('0x1e')];_0x3bfaa5++){if(_0x44c202[_0x3bfaa5][_0xf3db('0x7a')]in _0x1ead37){contactItemTypes['push'](_0x44c202[_0x3bfaa5]);delete _0x3a4a99[_0x44c202[_0x3bfaa5]['name']];hasAdditionalPhones=!![];}for(var _0x2ae4e7 in _0x1ead37){if(_0x44c202[_0x3bfaa5]['name']+'_description'===_0x2ae4e7){phoneDescriptions[_0xf3db('0x1c')]({'itemTypeId':_0x44c202[_0x3bfaa5]['id'],'description':_0x2ae4e7});delete _0x3a4a99[_0x2ae4e7];}}}if(hasAdditionalPhones)_0x3a4a99[_0xf3db('0x1a')]='';var _0x5d78ef=_[_0xf3db('0x50')](_0x3a4a99)[_0xf3db('0x19')]();logger[_0xf3db('0x57')](_0xf3db('0x77'),_0x5d78ef);fs['writeFileSync'](_0x3d265b,_0x5d78ef+'\x0a');Papa[_0xf3db('0x7b')](fs['createReadStream'](_0x84a07),{'header':!![],'skipEmptyLines':!![],'step':function(_0x6fbf27,_0x45a154){try{for(var _0x1bea33=0x0,_0x56b6bc=[];_0x1bea33<_0x6fbf27[_0xf3db('0x7c')][_0xf3db('0x1e')];_0x1bea33++){stats['rows']+=0x1;if(_0x6fbf27['errors'][_0x1bea33]){handleError(_0x6fbf27['data'][_0x1bea33],_0x6fbf27[_0xf3db('0x5b')][_0x1bea33]);}else{var _0x4a3e43=[];var _0x2df8a2=[];var _0x1a025b={};for(var _0x6c85bb in _0x1ead37){let _0x22796e=contactItemTypes[_0xf3db('0x7d')](_0x43b6cb=>_0x43b6cb[_0xf3db('0x7a')]===_0x6c85bb);let _0x2a1819=contactItemTypes['find'](_0x593c73=>_0x593c73[_0xf3db('0x7a')]+_0xf3db('0x7e')===_0x6c85bb);if(_[_0xf3db('0x1f')](_0x22796e)&&_['isNil'](_0x2a1819)){if(_0x1ead37[_0xf3db('0x7f')](_0x6c85bb)){if(_0x6fbf27[_0xf3db('0x7c')][_0x1bea33][_0x1ead37[_0x6c85bb]]){var _0x2672f9=_[_0xf3db('0x80')](_0x6fbf27[_0xf3db('0x7c')][_0x1bea33][_0x1ead37[_0x6c85bb]][_0xf3db('0x81')](/"/g,'\x27'));switch(_0x6c85bb){case _0xf3db('0x2d'):var _0x16d96d=moment(_0x2672f9,_0xf3db('0x10'),!![]);if(_0x16d96d['isValid']()){_0x56b6bc[_0xf3db('0x1c')]('\x22'+_0x2672f9+'\x22');}else{_0x4a3e43[_0xf3db('0x1c')](_0xf3db('0x82'));}break;case _0xf3db('0x31'):var _0xd70592=parseInt(_0x2672f9);_0x2672f9=_[_0xf3db('0x83')](_0xd70592)||_0xd70592<0x0||_0xd70592>0x4?_0xa21c84?0x3:0x2:_0xd70592;_0x56b6bc[_0xf3db('0x1c')]('\x22'+_0x2672f9+'\x22');break;case _0xf3db('0x32'):var _0x164fc7=parseInt(_0x2672f9);if(_[_0xf3db('0x84')](_0x164fc7)&&_[_0xf3db('0x76')](_0x222aeb,_0x164fc7)){_0x56b6bc['push']('\x22'+_0x164fc7+'\x22');}else{_0x4a3e43[_0xf3db('0x1c')](_0xf3db('0x85'));}break;case _0xf3db('0x86'):if(isEmail(_0x2672f9)){_0x56b6bc[_0xf3db('0x1c')]('\x22'+_0x2672f9+'\x22');}else{_0x4a3e43[_0xf3db('0x1c')](_0xf3db('0x87'));}break;case _0xf3db('0x88'):var _0x2f8596=moment(_0x2672f9,_0xf3db('0x89'),!![]);if(_0x2f8596[_0xf3db('0x8a')]()){_0x56b6bc[_0xf3db('0x1c')]('\x22'+_0x2672f9+'\x22');}else{_0x4a3e43[_0xf3db('0x1c')](_0xf3db('0x8b'));}break;case'dialTimezone':var _0x5d3081=shared[_0xf3db('0x8c')];var _0xc206e4=_0x5d3081[_0x2672f9];if(!_[_0xf3db('0x1f')](_0xc206e4)){var _0x138d7f=_0xc206e4[_0xf3db('0x6c')];_0x56b6bc['push']('\x22'+_0x2672f9+'\x22');_0x56b6bc['push']('\x22'+_0x138d7f+'\x22');}break;default:_0x56b6bc[_0xf3db('0x1c')]('\x22'+_0x2672f9+'\x22');}}else{switch(_0x6c85bb){case _0xf3db('0x8d'):case _0xf3db('0x14'):_0x4a3e43['push'](_0x6c85bb+_0xf3db('0x8e'));break;default:_0x56b6bc[_0xf3db('0x1c')]('\x22\x22');}}}}else{var _0x62afbd='';if(!_[_0xf3db('0x1f')](_0x22796e)){if(!_0x1a025b[_0xf3db('0x7f')](_0x22796e['id'])){if(!_[_0xf3db('0x1f')](_0x6fbf27[_0xf3db('0x7c')][_0x1bea33][_0x1ead37[_0x6c85bb]])){var _0x2672f9=_[_0xf3db('0x80')](_0x6fbf27[_0xf3db('0x7c')][_0x1bea33][_0x1ead37[_0x6c85bb]]['replace'](/"/g,'\x27'));var _0x49e108=phoneDescriptions[_0xf3db('0x7d')](_0x5b0796=>_0x5b0796[_0xf3db('0x8f')]===_0x22796e['id']);if(!_['isNil'](_0x49e108)){var _0x4a6350=_[_0xf3db('0x80')](_0x6fbf27[_0xf3db('0x7c')][_0x1bea33][_0x1ead37[_0x49e108[_0xf3db('0x90')]]][_0xf3db('0x81')](/"/g,'\x27'));if(!_[_0xf3db('0x1f')](_0x4a6350))_0x2672f9=_0x2672f9+'§'+_0x4a6350;}if(_0x62afbd=='')_0x62afbd=_0x2672f9;else _0x62afbd+='|'+_0x2672f9;}_0x2df8a2[_0xf3db('0x1c')](_0x22796e['id']+':'+_0x62afbd);_0x1a025b[_0x22796e['id']]=0x1;}}}}if(hasAdditionalPhones){_0x56b6bc['push']('\x22'+_0x2df8a2['join'](';')+'\x22');}if(_0x4a3e43['length']){handleError(_0x6fbf27[_0xf3db('0x7c')][_0x1bea33],{'code':'SystemRow','message':_0x4a3e43[_0xf3db('0x19')]()});}else{fs['appendFileSync'](_0x3d265b,_0x56b6bc['join']()+'\x0a');}_0x56b6bc=[];}if(!(stats[_0xf3db('0x91')]%0xc8)){socket[_0xf3db('0x92')](_0xf3db('0x93')+_0x34a32d,stats);stats[_0xf3db('0x5b')]=[];}}if(stopped){logger[_0xf3db('0x57')](_0xf3db('0x94'));_0x45a154[_0xf3db('0x95')]();}}catch(_0x855d9a){handleError(_0x6fbf27[_0xf3db('0x7c')][_0x1bea33],{'code':_0xf3db('0x96'),'message':_0x855d9a[_0xf3db('0x59')]});logger[_0xf3db('0x58')](_0xf3db('0x97'),_0x855d9a[_0xf3db('0x59')]);}},'complete':function(){try{var _0x16432b=[];var _0x2f0157=[];var _0x19d4bc=_0xf3db('0x35');if(_0x288fd9[_0xf3db('0x98')]&&_0x288fd9[_0xf3db('0x98')][_0xf3db('0x1e')]){_0x19d4bc=_0xf3db('0x99')+_0x34a32d;_0x16432b[_0xf3db('0x1c')](_0xf3db('0x9a')+_0x19d4bc+_0xf3db('0x9b'));}tmp_campaigns=_0xf3db('0x9c')+_0x34a32d;tmp_voice_queues=_0xf3db('0x9d')+_0x34a32d;_0x2f0157[_0xf3db('0x1c')](_0xf3db('0x9a')+tmp_campaigns+_0xf3db('0x9e'));_0x2f0157['push']('CREATE\x20TABLE\x20'+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise['each'](_0x2f0157,handleTZQuery)[_0xf3db('0x1b')](function(_0x5db335){updateTzCampaigns(_0x288fd9[_0xf3db('0x2e')])[_0xf3db('0x1b')](function(_0x5d0065){updateTzVoiceQueues(_0x288fd9[_0xf3db('0x2e')])[_0xf3db('0x1b')](function(_0x2b8c86){if(hasTZ)_0x5d78ef=_0x5d78ef[_0xf3db('0x81')](_0xf3db('0x6b'),_0xf3db('0x9f'));var _0x285060=util[_0xf3db('0xf')](_0xf3db('0xa0'),_0x3d265b,_0x19d4bc,_0x5d78ef,_0x288fd9[_0xf3db('0x2e')],_0x288fd9[_0xf3db('0x51')]||null,NOW,NOW);if(_[_0xf3db('0x1f')](_0x1ead37[_0xf3db('0x2d')])){_0x285060+=',\x20scheduledAt\x20=\x20NOW()';}_0x16432b[_0xf3db('0x1c')](_0x285060);if(_0x288fd9[_0xf3db('0x98')]&&_0x288fd9[_0xf3db('0x98')]['length']){_0x16432b['push'](insertCmContact(_0x288fd9[_0xf3db('0x2e')],_0x19d4bc,_0x288fd9[_0xf3db('0x98')],_0x1ead37));_0x16432b['push']('DROP\x20TABLE\x20'+_0x19d4bc+';');}BPromise['each'](_0x16432b,handleQuery)[_0xf3db('0x1b')](function(_0x4e02ee){BPromise[_0xf3db('0x6a')]([handleAdditionalPhones()])[_0xf3db('0x1b')](function(){_0x16432b=[];for(var _0x1a6a34=0x0;_0x1a6a34\x20\x20','existsSync','binding\x20doesn\x27t\x20exists','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','lodash','papaparse','util','bluebird','moment','squel','../../../mysqldb','../../../config/environment','../../../config/logger','import','defaults','redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','test','select','phone','from','join','.id\x20=\x20','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','query','select\x20*\x20from\x20','spread','length','isNil','push','all','then','catch','error','message','AdditionalPhones','split','filter','findOne','CmContactHasItem','update','updated','create','PHONE','inserted','CmContact','CmHopper','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','into','fromQuery','scheduledat','ContactId','ListId','updatedAt','priority','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','cm_contacts.phone','insert','cm_hopper_black','createdAt','field','ListId\x20=\x20?','\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','concat','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','min_id','group','info','Received\x20SIGINT','exit','errors','code','sequelize','main','stringify','send','start','binding','clone','socket_timestamp','root','server/files/tmp','ContactItemType','findAll','name','_description','keys','header','writeFileSync','parse','createReadStream','data','rows','find','hasOwnProperty','trim','replace','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','UserId','isNumber','includes','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','isValid','firstName','\x20not\x20specified','description','SystemRow','appendFileSync','contact:import:','Abort\x20parser'];(function(_0x5f3905,_0x43a651){var _0x2923b1=function(_0x3c72d8){while(--_0x3c72d8){_0x5f3905['push'](_0x5f3905['shift']());}};_0x2923b1(++_0x43a651);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x4f541f,_0x3de9a6){_0x4f541f=_0x4f541f-0x0;var _0x44a136=_0x4e2e[_0x4f541f];return _0x44a136;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0xe4e2('0x0'));var Papa=require(_0xe4e2('0x1'));var util=require(_0xe4e2('0x2'));var BPromise=require(_0xe4e2('0x3'));var moment=require(_0xe4e2('0x4'));var squel=require(_0xe4e2('0x5'));var Redis=require('ioredis');var db=require(_0xe4e2('0x6'))['db'];var config=require(_0xe4e2('0x7'));var logger=require(_0xe4e2('0x8'))(_0xe4e2('0x9'));config['redis']=_[_0xe4e2('0xa')](config[_0xe4e2('0xb')],{'host':_0xe4e2('0xc'),'port':0x18eb});var socket=require(_0xe4e2('0xd'))(new Redis(config[_0xe4e2('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0xe4e2('0xe')](_0xe4e2('0xf'));var tempTableName=_0xe4e2('0x10')+moment()['format'](_0xe4e2('0x11'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x14fe0d){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))*$/[_0xe4e2('0x12')](_0x14fe0d);}function selectNotIn(_0x5b7889,_0x1954f8,_0x42a1f0,_0x137047,_0x107816){return squel[_0xe4e2('0x13')]()['field'](_0xe4e2('0x14'))[_0xe4e2('0x15')](_0x137047)[_0xe4e2('0x16')](_0x1954f8,null,_0x1954f8+_0xe4e2('0x17')+_0x137047+'.'+_0x42a1f0)['where'](_0x137047+'.'+_0x42a1f0+_0xe4e2('0x18')+_0x5b7889+'.'+_0x42a1f0)[_0xe4e2('0x19')](_0x1954f8+_0xe4e2('0x1a')+_0x107816[_0xe4e2('0x16')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x202486,_0x50678d){promisesAdditionalPhones=[];promisesContact=[];return db['sequelize'][_0xe4e2('0x1b')](_0xe4e2('0x1c')+tempTableName)[_0xe4e2('0x1d')](function(_0x28ee12){if(_0x28ee12!==null){var _0x217ea5=[];for(var _0x54107a=0x0;_0x54107a<_0x28ee12[_0xe4e2('0x1e')];_0x54107a++){var _0x3e8bb6=_0x28ee12[_0x54107a];if(!_[_0xe4e2('0x1f')](_0x3e8bb6['phone'])){if(!_[_0xe4e2('0x1f')](_0x3e8bb6['AdditionalPhones']))_0x217ea5[_0xe4e2('0x20')](insertAdditionalPhones(_0x3e8bb6));promisesContact[_0xe4e2('0x20')]({'contact':_0x3e8bb6});}}}Promise[_0xe4e2('0x21')](_0x217ea5)[_0xe4e2('0x22')](function(){_0x202486({'val':0x1});});})[_0xe4e2('0x23')](function(_0x156243){logger[_0xe4e2('0x24')](_0x156243[_0xe4e2('0x25')]);});});}function insertAdditionalPhones(_0x4769dd){return new Promise(function(_0x362741,_0x5a84c5){var _0xb7b3ab=_0x4769dd[_0xe4e2('0x26')];if(_[_0xe4e2('0x1f')](_0xb7b3ab))_0x5a84c5({'val':0x0});else{var _0x3491ff=_0xb7b3ab[_0xe4e2('0x27')](';');var _0x23b466=[];orderBy=0x0;for(var _0x16f14b=0x0;_0x16f14b<_0x3491ff['length'];_0x16f14b++){_0x23b466[_0xe4e2('0x20')](splitAdditionalPhone(_0x4769dd['id'],_0x3491ff[_0x16f14b]));}Promise[_0xe4e2('0x21')](_0x23b466)[_0xe4e2('0x22')](function(){_0x362741({'val':_0x3491ff['length']});});}});}function splitAdditionalPhone(_0x353030,_0x12ad33){return new Promise(function(_0x598fa3,_0xcba85a){var _0x234c38=_0x12ad33[_0xe4e2('0x27')](':');var _0x3f5265=_0x234c38[0x0];var _0x249b7e=_0x234c38[0x1];if(_0x249b7e!==''){var _0x5887c9=_0x249b7e[_0xe4e2('0x27')]('|');var _0x357903=[];for(var _0x1f6d1f=0x0;_0x1f6d1f<_0x5887c9['length'];_0x1f6d1f++){if(_0x5887c9[_0x1f6d1f]!==''){var _0x3a31b8=_[_0xe4e2('0x28')](promisesAdditionalPhones,{'contactId':_0x353030,'phone':_0x5887c9[_0x1f6d1f]});if(_0x3a31b8[_0xe4e2('0x1e')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x353030,'contactTypeId':_0x3f5265,'phone':_0x5887c9[_0x1f6d1f],'orderBy':orderBy});}}}_0x598fa3({'ok':0x1});}else _0x598fa3({'res':0x0});});}function createAdditionalPhone(_0x2e5a65,_0x50b4d9,_0x477b5c,_0x1e21c0){var _0x52c849='';var _0x46926a='';var _0x18e2e5=_0x477b5c[_0xe4e2('0x27')]('§');_0x52c849=_0x18e2e5[0x0];if(_0x18e2e5[_0xe4e2('0x1e')]==0x2)_0x46926a=_0x18e2e5[0x1];return new Promise(function(_0x1f7bcc,_0x4d33de){return db['CmContactHasItem'][_0xe4e2('0x29')]({'where':{'CmContactId':_0x2e5a65,'item':_0x52c849}})[_0xe4e2('0x22')](function(_0x12848d){if(_0x12848d){return db[_0xe4e2('0x2a')][_0xe4e2('0x2b')]({'ItemTypeId':_0x50b4d9,'description':_0x46926a,'OrderBy':_0x1e21c0},{'where':{'CmContactId':_0x2e5a65,'item':_0x52c849}})[_0xe4e2('0x22')](function(_0x1c7f9a){_0x1f7bcc({'res':_0xe4e2('0x2c')});});}else{return db[_0xe4e2('0x2a')][_0xe4e2('0x2d')]({'CmContactId':_0x2e5a65,'item':_0x52c849,'ItemTypeId':_0x50b4d9,'description':_0x46926a,'OrderBy':_0x1e21c0,'ItemClass':_0xe4e2('0x2e')})[_0xe4e2('0x22')](function(_0x4ce75b){_0x1f7bcc({'res':_0xe4e2('0x2f')});});}});});}function updateContact(_0x8ffc6){return new Promise(function(_0xe0846a,_0x1fd3c5){var _0x1431b0=_0x8ffc6['id'];delete _0x8ffc6['id'];return db[_0xe4e2('0x30')]['update'](_0x8ffc6,{'where':{'id':_0x1431b0}})[_0xe4e2('0x22')](function(_0x286714){updatedRows+=0x1;return db[_0xe4e2('0x31')][_0xe4e2('0x2b')]({'phone':_0x8ffc6[_0xe4e2('0x14')]},{'where':{'ContactId':_0x1431b0}})[_0xe4e2('0x22')](function(_0x444b99){_0xe0846a({'ret':'OK'});});});});}function insertCmHopper(_0x36a26d,_0xe3d34a,_0x337b42,_0x2767df,_0x4ac14d){var _0x2c831f=['cm_contacts.phone',_0xe4e2('0x32'),_0xe4e2('0x33'),'cm_contacts.ListId',_0xe3d34a+'.'+_0x2767df,_0xe4e2('0x34'),_0xe4e2('0x35'),_0xe4e2('0x36'),_0xe4e2('0x37'),'\x22'+_0x4ac14d+'\x22'];return squel['insert']()[_0xe4e2('0x38')]('cm_hopper')[_0xe4e2('0x39')](['phone',_0xe4e2('0x3a'),_0xe4e2('0x3b'),_0xe4e2('0x3c'),_0x2767df,'createdAt',_0xe4e2('0x3d'),_0xe4e2('0x3e'),'UserId',_0xe4e2('0x3f')],squel[_0xe4e2('0x13')]()[_0xe4e2('0x40')](_0x2c831f)[_0xe4e2('0x15')](_0xe3d34a)[_0xe4e2('0x16')](_0xe4e2('0x41'),null,_0xe4e2('0x42')+_0xe3d34a+_0xe4e2('0x43'))[_0xe4e2('0x16')](_0x337b42,null,_0x337b42+'.id\x20=\x20'+_0xe3d34a+'.'+_0x2767df)['where'](_0xe3d34a+_0xe4e2('0x44'),_0x36a26d)[_0xe4e2('0x19')](_0xe4e2('0x45'),NOW)[_0xe4e2('0x19')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0xe3d34a,_0x337b42,_0x2767df,'cm_hopper',[_0xe4e2('0x46'),_0xe4e2('0x47')]))[_0xe4e2('0x19')](_0xe4e2('0x48'),selectNotIn(_0xe3d34a,_0x337b42,_0x2767df,'cm_hopper',[_0xe4e2('0x46')])))[_0xe4e2('0x49')]();}function insertCmHopperBlack(_0x385572,_0x577d4c,_0x1b54f6,_0x4789cf){var _0x67ee4f=[_0xe4e2('0x4a'),'cm_contacts.id','cm_contacts.ListId',_0x577d4c+'.'+_0x4789cf,_0xe4e2('0x34'),_0xe4e2('0x35')];return squel[_0xe4e2('0x4b')]()['into'](_0xe4e2('0x4c'))[_0xe4e2('0x39')](['phone',_0xe4e2('0x3b'),_0xe4e2('0x3c'),_0x4789cf,_0xe4e2('0x4d'),_0xe4e2('0x3d')],squel[_0xe4e2('0x13')]()[_0xe4e2('0x40')](_0x67ee4f)[_0xe4e2('0x15')](_0x577d4c)[_0xe4e2('0x16')]('cm_contacts',null,_0xe4e2('0x42')+_0x577d4c+_0xe4e2('0x43'))['join'](_0x1b54f6,null,_0x1b54f6+'.id\x20=\x20'+_0x577d4c+'.'+_0x4789cf)[_0xe4e2('0x19')](_0x577d4c+_0xe4e2('0x44'),_0x385572)[_0xe4e2('0x19')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xe4e2('0x19')](_0xe4e2('0x48'),squel[_0xe4e2('0x13')]()[_0xe4e2('0x4e')]('phone')[_0xe4e2('0x15')](_0xe4e2('0x4c'))[_0xe4e2('0x19')](_0xe4e2('0x4f'),_0x385572)['where'](_0x4789cf+_0xe4e2('0x50'),_0x577d4c+'.'+_0x4789cf)))[_0xe4e2('0x49')]();}function insertCmHopperAdditionalPhones(_0x59c52d){var _0x37a988=[_0xe4e2('0x51'),_0xe4e2('0x52'),'cm_contact_has_items.OrderBy',_0xe4e2('0x53'),_0xe4e2('0x54')];return squel[_0xe4e2('0x4b')]()['into']('cm_hopper_additional_phones')[_0xe4e2('0x39')](['CmHopperId',_0xe4e2('0x14'),'OrderBy',_0xe4e2('0x4d'),_0xe4e2('0x3d')],squel[_0xe4e2('0x13')]()['fields'](_0x37a988)[_0xe4e2('0x15')]('cm_hopper')[_0xe4e2('0x16')](_0xe4e2('0x41'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0xe4e2('0x16')]('cm_contact_has_items',null,_0xe4e2('0x55'))[_0xe4e2('0x19')]('cm_hopper.ListId\x20=\x20?',_0x59c52d)[_0xe4e2('0x19')](_0xe4e2('0x45'),NOW))[_0xe4e2('0x49')]();}function insertCmContact(_0x3e540d,_0x3c0107,_0xf7409d,_0x315255){var _0x37b33b=_[_0xe4e2('0x56')](_['keys'](_0x315255),[_0xe4e2('0x3c'),_0xe4e2('0x57'),_0xe4e2('0x4d'),_0xe4e2('0x3d')]);return squel[_0xe4e2('0x4b')]()[_0xe4e2('0x38')](_0xe4e2('0x41'))[_0xe4e2('0x39')](_0x37b33b,squel[_0xe4e2('0x13')]()[_0xe4e2('0x40')](_0x37b33b)[_0xe4e2('0x15')](_0x3c0107)['where']('('+_0xf7409d[_0xe4e2('0x16')](',')+_0xe4e2('0x58'),squel[_0xe4e2('0x13')]()[_0xe4e2('0x40')](_0xf7409d)['from'](_0xe4e2('0x41'))[_0xe4e2('0x19')]('ListId\x20=\x20?',_0x3e540d))[_0xe4e2('0x19')](_0xe4e2('0x59'),squel[_0xe4e2('0x13')]()[_0xe4e2('0x4e')]('MIN(id)',_0xe4e2('0x5a'))['from'](_0x3c0107)[_0xe4e2('0x5b')](_0xf7409d[_0xe4e2('0x16')](','))))[_0xe4e2('0x49')]();}function handleStop(){logger[_0xe4e2('0x5c')](_0xe4e2('0x5d'));stopped=!![];}function handleUncaughtException(_0x26ab38){logger[_0xe4e2('0x24')](_0x26ab38[_0xe4e2('0x25')]);process[_0xe4e2('0x5e')](0x1);}function handleError(_0x230969,_0x3cb0d2){stats[_0xe4e2('0x5f')]['push']({'name':_0x3cb0d2[_0xe4e2('0x60')],'message':_0x3cb0d2['message'],'row':_0x230969});}function handleQuery(_0x5eb739){logger[_0xe4e2('0x5c')](_0x5eb739);return db[_0xe4e2('0x61')][_0xe4e2('0x1b')](_0x5eb739)['spread'](function(_0x477acd){results['push'](_0x477acd);})[_0xe4e2('0x23')](function(_0x9ba757){logger['error'](_0x9ba757[_0xe4e2('0x25')]);});}function main(_0x14f7da,_0x55d442,_0x3f2b39,_0x4e3a01){logger['info'](_0xe4e2('0x62'),_0x14f7da,JSON[_0xe4e2('0x63')](_0x55d442));process[_0xe4e2('0x64')](_0xe4e2('0x65'));var _0x4bd248=_0x55d442[_0xe4e2('0x66')];var _0x3f94ef=_[_0xe4e2('0x67')](_0x4bd248);var _0x133f62=_0x55d442[_0xe4e2('0x68')];var _0x472b0d=path[_0xe4e2('0x16')](config[_0xe4e2('0x69')],_0xe4e2('0x6a'),_0x133f62+'.csv');logger['info']('body',_0x55d442);db[_0xe4e2('0x6b')][_0xe4e2('0x6c')]({'raw':!![],'attributes':['id',_0xe4e2('0x6d')]})[_0xe4e2('0x22')](function(_0x346e88){for(var _0x2c38a7=0x0;_0x2c38a7<_0x346e88[_0xe4e2('0x1e')];_0x2c38a7++){if(_0x346e88[_0x2c38a7]['name']in _0x4bd248){contactItemTypes[_0xe4e2('0x20')](_0x346e88[_0x2c38a7]);delete _0x3f94ef[_0x346e88[_0x2c38a7][_0xe4e2('0x6d')]];hasAdditionalPhones=!![];}for(var _0x1a96af in _0x4bd248){if(_0x346e88[_0x2c38a7][_0xe4e2('0x6d')]+_0xe4e2('0x6e')===_0x1a96af){phoneDescriptions[_0xe4e2('0x20')]({'itemTypeId':_0x346e88[_0x2c38a7]['id'],'description':_0x1a96af});delete _0x3f94ef[_0x1a96af];}}}if(hasAdditionalPhones)_0x3f94ef[_0xe4e2('0x26')]='';var _0x38eb8a=_[_0xe4e2('0x6f')](_0x3f94ef)[_0xe4e2('0x16')]();logger[_0xe4e2('0x5c')](_0xe4e2('0x70'),_0x38eb8a);fs[_0xe4e2('0x71')](_0x472b0d,_0x38eb8a+'\x0a');Papa[_0xe4e2('0x72')](fs[_0xe4e2('0x73')](_0x14f7da),{'header':!![],'skipEmptyLines':!![],'step':function(_0x51d58d,_0x4434c9){try{for(var _0xdeb76a=0x0,_0x32185b=[];_0xdeb76a<_0x51d58d[_0xe4e2('0x74')][_0xe4e2('0x1e')];_0xdeb76a++){stats[_0xe4e2('0x75')]+=0x1;if(_0x51d58d[_0xe4e2('0x5f')][_0xdeb76a]){handleError(_0x51d58d[_0xe4e2('0x74')][_0xdeb76a],_0x51d58d[_0xe4e2('0x5f')][_0xdeb76a]);}else{var _0x23e014=[];var _0x57a7eb=[];var _0x31cdfe={};for(var _0x46b5bc in _0x4bd248){let _0x11679c=contactItemTypes[_0xe4e2('0x76')](_0x24859b=>_0x24859b[_0xe4e2('0x6d')]===_0x46b5bc);let _0xacef79=contactItemTypes[_0xe4e2('0x76')](_0x4d6bbd=>_0x4d6bbd[_0xe4e2('0x6d')]+_0xe4e2('0x6e')===_0x46b5bc);if(_[_0xe4e2('0x1f')](_0x11679c)&&_[_0xe4e2('0x1f')](_0xacef79)){if(_0x4bd248[_0xe4e2('0x77')](_0x46b5bc)){if(_0x51d58d[_0xe4e2('0x74')][_0xdeb76a][_0x4bd248[_0x46b5bc]]){var _0x150c1a=_[_0xe4e2('0x78')](_0x51d58d[_0xe4e2('0x74')][_0xdeb76a][_0x4bd248[_0x46b5bc]][_0xe4e2('0x79')](/"/g,'\x27'));switch(_0x46b5bc){case'scheduledat':var _0x10fe72=moment(_0x150c1a,_0xe4e2('0xf'),!![]);if(_0x10fe72['isValid']()){_0x32185b[_0xe4e2('0x20')]('\x22'+_0x150c1a+'\x22');}else{_0x23e014[_0xe4e2('0x20')](_0xe4e2('0x7a'));}break;case _0xe4e2('0x3e'):var _0x16f0d1=parseInt(_0x150c1a);_0x150c1a=_['isNaN'](_0x16f0d1)||_0x16f0d1<0x0||_0x16f0d1>0x4?_0x4e3a01?0x3:0x2:_0x16f0d1;_0x32185b[_0xe4e2('0x20')]('\x22'+_0x150c1a+'\x22');break;case _0xe4e2('0x7b'):var _0x287546=parseInt(_0x150c1a);if(_[_0xe4e2('0x7c')](_0x287546)&&_[_0xe4e2('0x7d')](_0x3f2b39,_0x287546)){_0x32185b[_0xe4e2('0x20')]('\x22'+_0x287546+'\x22');}else{_0x23e014[_0xe4e2('0x20')](_0xe4e2('0x7e'));}break;case'email':if(isEmail(_0x150c1a)){_0x32185b[_0xe4e2('0x20')]('\x22'+_0x150c1a+'\x22');}else{_0x23e014[_0xe4e2('0x20')](_0xe4e2('0x7f'));}break;case _0xe4e2('0x80'):var _0x2fec7a=moment(_0x150c1a,_0xe4e2('0x81'),!![]);if(_0x2fec7a[_0xe4e2('0x82')]()){_0x32185b[_0xe4e2('0x20')]('\x22'+_0x150c1a+'\x22');}else{_0x23e014[_0xe4e2('0x20')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x32185b[_0xe4e2('0x20')]('\x22'+_0x150c1a+'\x22');}}else{switch(_0x46b5bc){case _0xe4e2('0x83'):case _0xe4e2('0x14'):_0x23e014[_0xe4e2('0x20')](_0x46b5bc+_0xe4e2('0x84'));break;default:_0x32185b[_0xe4e2('0x20')]('\x22\x22');}}}}else{var _0x1255e0='';if(!_[_0xe4e2('0x1f')](_0x11679c)){if(!_0x31cdfe[_0xe4e2('0x77')](_0x11679c['id'])){for(var _0x428f83=0x0;_0x428f83<_0x4bd248[_0x46b5bc][_0xe4e2('0x1e')];_0x428f83++){var _0x150c1a=_[_0xe4e2('0x78')](_0x51d58d['data'][_0xdeb76a][_0x4bd248[_0x46b5bc][_0x428f83]][_0xe4e2('0x79')](/"/g,'\x27'));var _0x5ed108=phoneDescriptions[_0xe4e2('0x76')](_0x18e8b3=>_0x18e8b3['itemTypeId']===_0x11679c['id']);if(!_[_0xe4e2('0x1f')](_0x5ed108)){var _0xd829a8=_[_0xe4e2('0x78')](_0x51d58d[_0xe4e2('0x74')][_0xdeb76a][_0x4bd248[_0x5ed108[_0xe4e2('0x85')]][0x0]][_0xe4e2('0x79')](/"/g,'\x27'));if(!_[_0xe4e2('0x1f')](_0xd829a8))_0x150c1a=_0x150c1a+'§'+_0xd829a8;}if(_0x1255e0=='')_0x1255e0=_0x150c1a;else _0x1255e0+='|'+_0x150c1a;}_0x57a7eb['push'](_0x11679c['id']+':'+_0x1255e0);_0x31cdfe[_0x11679c['id']]=0x1;}}}}if(hasAdditionalPhones){_0x32185b[_0xe4e2('0x20')]('\x22'+_0x57a7eb[_0xe4e2('0x16')](';')+'\x22');}if(_0x23e014['length']){handleError(_0x51d58d['data'][_0xdeb76a],{'code':_0xe4e2('0x86'),'message':_0x23e014[_0xe4e2('0x16')]()});}else{fs[_0xe4e2('0x87')](_0x472b0d,_0x32185b['join']()+'\x0a');}_0x32185b=[];}if(!(stats[_0xe4e2('0x75')]%0xc8)){socket['emit'](_0xe4e2('0x88')+_0x133f62,stats);stats[_0xe4e2('0x5f')]=[];}}if(stopped){logger['info'](_0xe4e2('0x89'));_0x4434c9[_0xe4e2('0x8a')]();}}catch(_0x45ecb8){handleError(_0x51d58d[_0xe4e2('0x74')][_0xdeb76a],{'code':_0xe4e2('0x8b'),'message':_0x45ecb8[_0xe4e2('0x25')]});logger[_0xe4e2('0x24')](_0xe4e2('0x8c'),_0x45ecb8[_0xe4e2('0x25')]);}},'complete':function(){try{var _0x18fb51=[];var _0x5a6a7c=tempTableName;_0x18fb51[_0xe4e2('0x20')](_0xe4e2('0x8d')+_0x5a6a7c+'\x20LIKE\x20cm_contacts;');logger[_0xe4e2('0x5c')]('CIS\x20len',contactItemTypes[_0xe4e2('0x1e')]);var _0x388f48=util[_0xe4e2('0xe')](_0xe4e2('0x8e'),_0x472b0d,_0x5a6a7c,_0x38eb8a,_0x55d442['ListId'],_0x55d442[_0xe4e2('0x57')]||null,NOW,NOW);if(_[_0xe4e2('0x1f')](_0x4bd248[_0xe4e2('0x3a')])){_0x388f48+=_0xe4e2('0x8f');}_0x18fb51[_0xe4e2('0x20')](_0x388f48);BPromise[_0xe4e2('0x90')](_0x18fb51,handleQuery)[_0xe4e2('0x22')](function(_0x526a50){BPromise['all']([handleAdditionalPhones()])[_0xe4e2('0x22')](function(){_0x18fb51=[];for(var _0x3d7f70=0x0;_0x3d7f70\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format'];(function(_0x18b4df,_0xced636){var _0x329a04=function(_0x4f32b8){while(--_0x4f32b8){_0x18b4df['push'](_0x18b4df['shift']());}};_0x329a04(++_0xced636);}(_0xdf5d,0x126));var _0xddf5=function(_0x99e48a,_0x7976c1){_0x99e48a=_0x99e48a-0x0;var _0x256353=_0xdf5d[_0x99e48a];return _0x256353;};'use strict';var fs=require('fs');var path=require(_0xddf5('0x0'));var _=require(_0xddf5('0x1'));var Papa=require(_0xddf5('0x2'));var util=require(_0xddf5('0x3'));var BPromise=require(_0xddf5('0x4'));var moment=require(_0xddf5('0x5'));var squel=require(_0xddf5('0x6'));var Redis=require(_0xddf5('0x7'));var db=require('../../../mysqldb')['db'];var config=require(_0xddf5('0x8'));var logger=require(_0xddf5('0x9'))(_0xddf5('0xa'));config[_0xddf5('0xb')]=_[_0xddf5('0xc')](config[_0xddf5('0xb')],{'host':_0xddf5('0xd'),'port':0x18eb});var socket=require(_0xddf5('0xe'))(new Redis(config[_0xddf5('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0xddf5('0xf')](_0xddf5('0x10'));var tempTableName=_0xddf5('0x11')+moment()[_0xddf5('0xf')](_0xddf5('0x12'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x10191b){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))*$/[_0xddf5('0x13')](_0x10191b);}function selectNotIn(_0x5a4f45,_0x161973,_0x3d3fc3,_0x72f146,_0x10245f){return squel[_0xddf5('0x14')]()[_0xddf5('0x15')](_0xddf5('0x16'))[_0xddf5('0x17')](_0x72f146)['join'](_0x161973,null,_0x161973+'.id\x20=\x20'+_0x72f146+'.'+_0x3d3fc3)[_0xddf5('0x18')](_0x72f146+'.'+_0x3d3fc3+_0xddf5('0x19')+_0x5a4f45+'.'+_0x3d3fc3)[_0xddf5('0x18')](_0x161973+_0xddf5('0x1a')+_0x10245f[_0xddf5('0x1b')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x149fef,_0x2ecea5){promisesAdditionalPhones=[];promisesContact=[];return db[_0xddf5('0x1c')]['query'](_0xddf5('0x1d')+tempTableName)[_0xddf5('0x1e')](function(_0x3dd408){if(_0x3dd408!==null){var _0x1c0c30=[];for(var _0x19a039=0x0;_0x19a039<_0x3dd408['length'];_0x19a039++){var _0x3a9263=_0x3dd408[_0x19a039];if(!_['isNil'](_0x3a9263[_0xddf5('0x16')])){if(!_['isNil'](_0x3a9263[_0xddf5('0x1f')]))_0x1c0c30[_0xddf5('0x20')](insertAdditionalPhones(_0x3a9263));promisesContact[_0xddf5('0x20')]({'contact':_0x3a9263});}}}Promise[_0xddf5('0x21')](_0x1c0c30)['then'](function(){_0x149fef({'val':0x1});});})['catch'](function(_0x1b085b){logger[_0xddf5('0x22')](_0x1b085b[_0xddf5('0x23')]);});});}function insertAdditionalPhones(_0x1abfb2){return new Promise(function(_0x5e5537,_0x52ecdb){var _0x3f3194=_0x1abfb2[_0xddf5('0x1f')];if(_[_0xddf5('0x24')](_0x3f3194))_0x52ecdb({'val':0x0});else{var _0x497805=_0x3f3194[_0xddf5('0x25')](';');var _0x39212c=[];orderBy=0x0;for(var _0x21c68b=0x0;_0x21c68b<_0x497805[_0xddf5('0x26')];_0x21c68b++){_0x39212c['push'](splitAdditionalPhone(_0x1abfb2['id'],_0x497805[_0x21c68b]));}Promise[_0xddf5('0x21')](_0x39212c)[_0xddf5('0x27')](function(){_0x5e5537({'val':_0x497805['length']});});}});}function splitAdditionalPhone(_0x300923,_0x4267aa){return new Promise(function(_0x34539e,_0x12ece7){var _0x49c381=_0x4267aa[_0xddf5('0x25')](':');var _0xc75eb8=_0x49c381[0x0];var _0x256ff0=_0x49c381[0x1];if(_0x256ff0!==''){var _0x1eca6a=_0x256ff0[_0xddf5('0x25')]('|');var _0x4caa12=[];for(var _0x2caa8f=0x0;_0x2caa8f<_0x1eca6a[_0xddf5('0x26')];_0x2caa8f++){if(_0x1eca6a[_0x2caa8f]!==''){var _0x5c0451=_['filter'](promisesAdditionalPhones,{'contactId':_0x300923,'phone':_0x1eca6a[_0x2caa8f]});if(_0x5c0451[_0xddf5('0x26')]==0x0){orderBy++;promisesAdditionalPhones[_0xddf5('0x20')]({'contactId':_0x300923,'contactTypeId':_0xc75eb8,'phone':_0x1eca6a[_0x2caa8f],'orderBy':orderBy});}}}_0x34539e({'ok':0x1});}else _0x34539e({'res':0x0});});}function createAdditionalPhone(_0x1d493e,_0x174cd7,_0x3be6f4,_0x1a476d){var _0x5a3548='';var _0x26f43c='';var _0x228073=_0x3be6f4['split']('§');_0x5a3548=_0x228073[0x0];if(_0x228073[_0xddf5('0x26')]==0x2)_0x26f43c=_0x228073[0x1];return new Promise(function(_0x3ac1e8,_0x281307){return db['CmContactHasItem']['findOne']({'where':{'CmContactId':_0x1d493e,'item':_0x5a3548}})['then'](function(_0xdc764b){if(_0xdc764b){return db[_0xddf5('0x28')][_0xddf5('0x29')]({'ItemTypeId':_0x174cd7,'description':_0x26f43c,'OrderBy':_0x1a476d},{'where':{'CmContactId':_0x1d493e,'item':_0x5a3548}})['then'](function(_0x3d1c7a){_0x3ac1e8({'res':'updated'});});}else{return db['CmContactHasItem']['create']({'CmContactId':_0x1d493e,'item':_0x5a3548,'ItemTypeId':_0x174cd7,'description':_0x26f43c,'OrderBy':_0x1a476d,'ItemClass':_0xddf5('0x2a')})[_0xddf5('0x27')](function(_0x2a4b2e){_0x3ac1e8({'res':_0xddf5('0x2b')});});}});});}function updateContact(_0x11cee5){return new Promise(function(_0x49e5a9,_0x1eca4e){var _0x53e916=_0x11cee5['id'];delete _0x11cee5['id'];return db[_0xddf5('0x2c')][_0xddf5('0x29')](_0x11cee5,{'where':{'id':_0x53e916}})['then'](function(_0xf355f4){updatedRows+=0x1;return db[_0xddf5('0x2d')][_0xddf5('0x29')]({'phone':_0x11cee5[_0xddf5('0x16')]},{'where':{'ContactId':_0x53e916}})[_0xddf5('0x27')](function(_0x4e0b6f){_0x49e5a9({'ret':'OK'});});});});}function insertCmHopper(_0x873d16,_0x5478cf,_0x2874f8,_0x45a373,_0x50240c){var _0x1be090=['cm_contacts.phone',_0xddf5('0x2e'),'cm_contacts.id','cm_contacts.ListId',_0x5478cf+'.'+_0x45a373,_0xddf5('0x2f'),'cm_contacts.updatedAt',_0xddf5('0x30'),_0xddf5('0x31'),'\x22'+_0x50240c+'\x22'];return squel[_0xddf5('0x32')]()[_0xddf5('0x33')](_0xddf5('0x34'))[_0xddf5('0x35')]([_0xddf5('0x16'),_0xddf5('0x36'),_0xddf5('0x37'),_0xddf5('0x38'),_0x45a373,_0xddf5('0x39'),_0xddf5('0x3a'),_0xddf5('0x3b'),_0xddf5('0x3c'),_0xddf5('0x3d')],squel[_0xddf5('0x14')]()[_0xddf5('0x3e')](_0x1be090)[_0xddf5('0x17')](_0x5478cf)['join'](_0xddf5('0x3f'),null,_0xddf5('0x40')+_0x5478cf+_0xddf5('0x41'))[_0xddf5('0x1b')](_0x2874f8,null,_0x2874f8+_0xddf5('0x42')+_0x5478cf+'.'+_0x45a373)['where'](_0x5478cf+'.CmListId\x20=\x20?',_0x873d16)['where'](_0xddf5('0x43'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x5478cf,_0x2874f8,_0x45a373,_0xddf5('0x34'),[_0xddf5('0x44'),_0xddf5('0x45')]))[_0xddf5('0x18')](_0xddf5('0x46'),selectNotIn(_0x5478cf,_0x2874f8,_0x45a373,_0xddf5('0x34'),[_0xddf5('0x44')])))[_0xddf5('0x47')]();}function insertCmHopperBlack(_0x490a14,_0xd5c63d,_0x5b4817,_0x5654c2){var _0x2858f3=[_0xddf5('0x48'),'cm_contacts.id','cm_contacts.ListId',_0xd5c63d+'.'+_0x5654c2,_0xddf5('0x2f'),_0xddf5('0x49')];return squel[_0xddf5('0x32')]()[_0xddf5('0x33')]('cm_hopper_black')['fromQuery']([_0xddf5('0x16'),_0xddf5('0x37'),'ListId',_0x5654c2,_0xddf5('0x39'),_0xddf5('0x3a')],squel['select']()[_0xddf5('0x3e')](_0x2858f3)['from'](_0xd5c63d)[_0xddf5('0x1b')](_0xddf5('0x3f'),null,_0xddf5('0x40')+_0xd5c63d+'.CmListId')[_0xddf5('0x1b')](_0x5b4817,null,_0x5b4817+_0xddf5('0x42')+_0xd5c63d+'.'+_0x5654c2)[_0xddf5('0x18')](_0xd5c63d+_0xddf5('0x4a'),_0x490a14)[_0xddf5('0x18')](_0xddf5('0x43'),NOW)['where'](_0xddf5('0x46'),squel[_0xddf5('0x14')]()[_0xddf5('0x15')](_0xddf5('0x16'))['from'](_0xddf5('0x4b'))[_0xddf5('0x18')](_0xddf5('0x4c'),_0x490a14)[_0xddf5('0x18')](_0x5654c2+'\x20=\x20?',_0xd5c63d+'.'+_0x5654c2)))[_0xddf5('0x47')]();}function insertCmHopperAdditionalPhones(_0x50fe){var _0x549404=[_0xddf5('0x4d'),'cm_contact_has_items.item',_0xddf5('0x4e'),_0xddf5('0x4f'),_0xddf5('0x50')];return squel[_0xddf5('0x32')]()['into'](_0xddf5('0x51'))[_0xddf5('0x35')](['CmHopperId',_0xddf5('0x16'),'OrderBy','createdAt',_0xddf5('0x3a')],squel[_0xddf5('0x14')]()[_0xddf5('0x3e')](_0x549404)[_0xddf5('0x17')](_0xddf5('0x34'))[_0xddf5('0x1b')]('cm_contacts',null,_0xddf5('0x52'))[_0xddf5('0x1b')](_0xddf5('0x53'),null,_0xddf5('0x54'))['where'](_0xddf5('0x55'),_0x50fe)[_0xddf5('0x18')]('cm_contacts.createdAt\x20=\x20?',NOW))[_0xddf5('0x47')]();}function insertCmContact(_0x2ae7dd,_0x4af9f5,_0x28dc81,_0x5be225){var _0x1aa19e=_['concat'](_['keys'](_0x5be225),['ListId',_0xddf5('0x56'),_0xddf5('0x39'),_0xddf5('0x3a')]);return squel[_0xddf5('0x32')]()[_0xddf5('0x33')](_0xddf5('0x3f'))[_0xddf5('0x35')](_0x1aa19e,squel[_0xddf5('0x14')]()[_0xddf5('0x3e')](_0x1aa19e)[_0xddf5('0x17')](_0x4af9f5)['where']('('+_0x28dc81[_0xddf5('0x1b')](',')+_0xddf5('0x57'),squel[_0xddf5('0x14')]()[_0xddf5('0x3e')](_0x28dc81)[_0xddf5('0x17')]('cm_contacts')[_0xddf5('0x18')]('ListId\x20=\x20?',_0x2ae7dd))[_0xddf5('0x18')](_0xddf5('0x58'),squel['select']()[_0xddf5('0x15')]('MIN(id)',_0xddf5('0x59'))['from'](_0x4af9f5)['group'](_0x28dc81[_0xddf5('0x1b')](','))))[_0xddf5('0x47')]();}function handleStop(){logger[_0xddf5('0x5a')](_0xddf5('0x5b'));stopped=!![];}function handleUncaughtException(_0xb62de0){logger[_0xddf5('0x22')](_0xb62de0['message']);process[_0xddf5('0x5c')](0x1);}function handleError(_0x9d3d33,_0x120ba8){stats[_0xddf5('0x5d')]['push']({'name':_0x120ba8[_0xddf5('0x5e')],'message':_0x120ba8[_0xddf5('0x23')],'row':_0x9d3d33});}function handleQuery(_0x24cc45){logger['info'](_0x24cc45);return db[_0xddf5('0x1c')][_0xddf5('0x5f')](_0x24cc45)[_0xddf5('0x1e')](function(_0x3e256c){results[_0xddf5('0x20')](_0x3e256c);})[_0xddf5('0x60')](function(_0x1d6ed0){logger[_0xddf5('0x22')](_0x1d6ed0[_0xddf5('0x23')]);});}function main(_0x337186,_0x320afb,_0x46bbd7,_0xb7ed5c){logger['info'](_0xddf5('0x61'),_0x337186,JSON['stringify'](_0x320afb));process[_0xddf5('0x62')](_0xddf5('0x63'));var _0xdbce2a=_0x320afb[_0xddf5('0x64')];var _0x59df27=_[_0xddf5('0x65')](_0xdbce2a);var _0x4c3aa9=_0x320afb[_0xddf5('0x66')];var _0x22018e=path[_0xddf5('0x1b')](config[_0xddf5('0x67')],_0xddf5('0x68'),_0x4c3aa9+'.csv');logger['info'](_0xddf5('0x69'),_0x320afb);db[_0xddf5('0x6a')][_0xddf5('0x6b')]({'raw':!![],'attributes':['id',_0xddf5('0x6c')]})['then'](function(_0x50c8c8){for(var _0x20bea2=0x0;_0x20bea2<_0x50c8c8[_0xddf5('0x26')];_0x20bea2++){if(_0x50c8c8[_0x20bea2][_0xddf5('0x6c')]in _0xdbce2a){contactItemTypes[_0xddf5('0x20')](_0x50c8c8[_0x20bea2]);delete _0x59df27[_0x50c8c8[_0x20bea2][_0xddf5('0x6c')]];hasAdditionalPhones=!![];}for(var _0x1a006d in _0xdbce2a){if(_0x50c8c8[_0x20bea2][_0xddf5('0x6c')]+'_description'===_0x1a006d){phoneDescriptions['push']({'itemTypeId':_0x50c8c8[_0x20bea2]['id'],'description':_0x1a006d});delete _0x59df27[_0x1a006d];}}}if(hasAdditionalPhones)_0x59df27['AdditionalPhones']='';var _0x200ab4=_[_0xddf5('0x6d')](_0x59df27)[_0xddf5('0x1b')]();logger[_0xddf5('0x5a')](_0xddf5('0x6e'),_0x200ab4);fs[_0xddf5('0x6f')](_0x22018e,_0x200ab4+'\x0a');Papa[_0xddf5('0x70')](fs['createReadStream'](_0x337186),{'header':!![],'skipEmptyLines':!![],'step':function(_0x43a461,_0x30c640){try{for(var _0x5d50c2=0x0,_0x3e2f87=[];_0x5d50c2<_0x43a461[_0xddf5('0x71')][_0xddf5('0x26')];_0x5d50c2++){stats[_0xddf5('0x72')]+=0x1;if(_0x43a461['errors'][_0x5d50c2]){handleError(_0x43a461[_0xddf5('0x71')][_0x5d50c2],_0x43a461[_0xddf5('0x5d')][_0x5d50c2]);}else{var _0x10c4ad=[];var _0xf9d67=[];var _0x22463b={};for(var _0x3f7c95 in _0xdbce2a){let _0x551666=contactItemTypes[_0xddf5('0x73')](_0x5151f6=>_0x5151f6['name']===_0x3f7c95);let _0x2f064b=contactItemTypes['find'](_0x372026=>_0x372026[_0xddf5('0x6c')]+_0xddf5('0x74')===_0x3f7c95);if(_[_0xddf5('0x24')](_0x551666)&&_['isNil'](_0x2f064b)){if(_0xdbce2a[_0xddf5('0x75')](_0x3f7c95)){if(_0x43a461[_0xddf5('0x71')][_0x5d50c2][_0xdbce2a[_0x3f7c95]]){var _0x1244ec=_[_0xddf5('0x76')](_0x43a461['data'][_0x5d50c2][_0xdbce2a[_0x3f7c95]][_0xddf5('0x77')](/"/g,'\x27'));switch(_0x3f7c95){case'scheduledat':var _0x38ae00=moment(_0x1244ec,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x38ae00[_0xddf5('0x78')]()){_0x3e2f87[_0xddf5('0x20')]('\x22'+_0x1244ec+'\x22');}else{_0x10c4ad[_0xddf5('0x20')](_0xddf5('0x79'));}break;case'priority':var _0x5bae97=parseInt(_0x1244ec);_0x1244ec=_['isNaN'](_0x5bae97)||_0x5bae97<0x0||_0x5bae97>0x4?_0xb7ed5c?0x3:0x2:_0x5bae97;_0x3e2f87[_0xddf5('0x20')]('\x22'+_0x1244ec+'\x22');break;case _0xddf5('0x3c'):var _0x12c23a=parseInt(_0x1244ec);if(_[_0xddf5('0x7a')](_0x12c23a)&&_[_0xddf5('0x7b')](_0x46bbd7,_0x12c23a)){_0x3e2f87[_0xddf5('0x20')]('\x22'+_0x12c23a+'\x22');}else{_0x10c4ad[_0xddf5('0x20')]('agent\x20not\x20exists');}break;case _0xddf5('0x7c'):if(isEmail(_0x1244ec)){_0x3e2f87[_0xddf5('0x20')]('\x22'+_0x1244ec+'\x22');}else{_0x10c4ad['push'](_0xddf5('0x7d'));}break;case _0xddf5('0x7e'):var _0x673df9=moment(_0x1244ec,_0xddf5('0x7f'),!![]);if(_0x673df9['isValid']()){_0x3e2f87['push']('\x22'+_0x1244ec+'\x22');}else{_0x10c4ad['push'](_0xddf5('0x80'));}break;default:_0x3e2f87['push']('\x22'+_0x1244ec+'\x22');}}else{switch(_0x3f7c95){case'firstName':case _0xddf5('0x16'):_0x10c4ad[_0xddf5('0x20')](_0x3f7c95+_0xddf5('0x81'));break;default:_0x3e2f87[_0xddf5('0x20')]('\x22\x22');}}}}else{var _0x1ff22e='';if(!_[_0xddf5('0x24')](_0x551666)){if(!_0x22463b[_0xddf5('0x75')](_0x551666['id'])){for(var _0x480dee=0x0;_0x480dee<_0xdbce2a[_0x3f7c95]['length'];_0x480dee++){var _0x1244ec=_[_0xddf5('0x76')](_0x43a461['data'][_0x5d50c2][_0xdbce2a[_0x3f7c95][_0x480dee]][_0xddf5('0x77')](/"/g,'\x27'));var _0x5962b4=phoneDescriptions[_0xddf5('0x73')](_0x3bf028=>_0x3bf028['itemTypeId']===_0x551666['id']);if(!_['isNil'](_0x5962b4)){var _0x2ab5c3=_[_0xddf5('0x76')](_0x43a461[_0xddf5('0x71')][_0x5d50c2][_0xdbce2a[_0x5962b4[_0xddf5('0x82')]][0x0]][_0xddf5('0x77')](/"/g,'\x27'));if(!_[_0xddf5('0x24')](_0x2ab5c3))_0x1244ec=_0x1244ec+'§'+_0x2ab5c3;}if(_0x1ff22e=='')_0x1ff22e=_0x1244ec;else _0x1ff22e+='|'+_0x1244ec;}_0xf9d67[_0xddf5('0x20')](_0x551666['id']+':'+_0x1ff22e);_0x22463b[_0x551666['id']]=0x1;}}}}if(hasAdditionalPhones){_0x3e2f87['push']('\x22'+_0xf9d67[_0xddf5('0x1b')](';')+'\x22');}if(_0x10c4ad[_0xddf5('0x26')]){handleError(_0x43a461[_0xddf5('0x71')][_0x5d50c2],{'code':'SystemRow','message':_0x10c4ad['join']()});}else{fs['appendFileSync'](_0x22018e,_0x3e2f87['join']()+'\x0a');}_0x3e2f87=[];}if(!(stats[_0xddf5('0x72')]%0xc8)){socket[_0xddf5('0x83')]('contact:import:'+_0x4c3aa9,stats);stats[_0xddf5('0x5d')]=[];}}if(stopped){logger[_0xddf5('0x5a')]('Abort\x20parser');_0x30c640[_0xddf5('0x84')]();}}catch(_0xedf2d){handleError(_0x43a461[_0xddf5('0x71')][_0x5d50c2],{'code':'SystemError','message':_0xedf2d[_0xddf5('0x23')]});logger[_0xddf5('0x22')]('step',_0xedf2d[_0xddf5('0x23')]);}},'complete':function(){try{var _0x2af6a4=[];var _0x44c26e=tempTableName;_0x2af6a4[_0xddf5('0x20')](_0xddf5('0x85')+_0x44c26e+'\x20LIKE\x20cm_contacts;');logger[_0xddf5('0x5a')](_0xddf5('0x86'),contactItemTypes[_0xddf5('0x26')]);var _0x386a5c=util[_0xddf5('0xf')]('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x22018e,_0x44c26e,_0x200ab4,_0x320afb[_0xddf5('0x38')],_0x320afb['CompanyId']||null,NOW,NOW);if(_[_0xddf5('0x24')](_0xdbce2a[_0xddf5('0x36')])){_0x386a5c+=_0xddf5('0x87');}_0x2af6a4[_0xddf5('0x20')](_0x386a5c);BPromise[_0xddf5('0x88')](_0x2af6a4,handleQuery)[_0xddf5('0x27')](function(_0x4427dd){BPromise[_0xddf5('0x21')]([handleAdditionalPhones()])[_0xddf5('0x27')](function(){_0x2af6a4=[];for(var _0x1798f3=0x0;_0x1798f3\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.id','i.createdAt','i.updatedAt','i.closedAt','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','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','Contact.lastName','c.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','enableEmailPreview','clone','COUNT(*)','getSelectedTags','where','t.id\x20IN\x20?','exports','squel','./update-interaction','updateInteraction','./utils','../../mysqldb','getAccountFK','role','agent','search','select','field','color','from','tools_tags','getInteractionFK','user_has_','_interactions','u.id'];(function(_0x2aa785,_0x541b5b){var _0x1dc83c=function(_0x18e93a){while(--_0x18e93a){_0x2aa785['push'](_0x2aa785['shift']());}};_0x1dc83c(++_0x541b5b);}(_0x8745,0x1d1));var _0x5874=function(_0x24b4ab,_0x19d58d){_0x24b4ab=_0x24b4ab-0x0;var _0x3f09d4=_0x8745[_0x24b4ab];return _0x3f09d4;};'use strict';var _=require('lodash');var squel=require(_0x5874('0x0'));var as=require('../parsers/advancedSearch');var qs=require('../parsers/qs');var updateInteraction=require(_0x5874('0x1'))[_0x5874('0x2')];var utils=require(_0x5874('0x3'));var db=require(_0x5874('0x4'))['db'];function skipInteractionsQuery(_0x5cd3cf,_0x577de3,_0x4d98eb){var _0xd0737b=![];var _0x48f0cb=utils[_0x5874('0x5')](_0x5cd3cf);if(_0x577de3[_0x5874('0x6')]===_0x5874('0x7')&&!_0x4d98eb[_0x5874('0x8')]&&!_0x4d98eb[_0x48f0cb]){_0xd0737b=!![];}return _0xd0737b;}function getTagsQuery(){return squel[_0x5874('0x9')]()[_0x5874('0xa')]('id')['field']('name')[_0x5874('0xa')](_0x5874('0xb'))[_0x5874('0xc')](_0x5874('0xd'));}function getUsersQuery(_0x58d563,_0x254ae9){var _0x195d9b=utils[_0x5874('0xe')](_0x58d563);var _0x4f895b=_0x5874('0xf')+_0x58d563+_0x5874('0x10');var _0x12251b=squel['select']()['field'](_0x5874('0x11'))[_0x5874('0xa')](_0x5874('0x12'))['field'](_0x5874('0x13')+_0x195d9b)[_0x5874('0xc')](_0x4f895b,'ui')[_0x5874('0x14')](_0x5874('0x15'),'u',_0x5874('0x16'));if(_0x254ae9['length']>0x0){_0x12251b['where'](_0x5874('0x13')+_0x195d9b+'\x20IN\x20?',_[_0x5874('0x17')](_0x254ae9,'id'));}return _0x12251b;}function getInteractionsQuery(_0x14f26b){var _0x1292e5=utils[_0x5874('0x18')](_0x14f26b);var _0x4897ef=utils['getAccountFK'](_0x14f26b);var _0x63f49f=utils[_0x5874('0xe')](_0x14f26b);return squel[_0x5874('0x9')]()[_0x5874('0xc')](_0x1292e5['interactions'],'i')[_0x5874('0x14')](_0x5874('0x19'),'c',_0x5874('0x1a'))[_0x5874('0x14')](_0x5874('0x15'),'o','o.id\x20=\x20i.UserId')['left_join'](_0x1292e5[_0x5874('0x1b')],'a',_0x5874('0x1c')+_0x4897ef)[_0x5874('0x14')](_0x1292e5[_0x5874('0x1d')],'me',_0x5874('0x1e')+_0x63f49f+_0x5874('0x1f'))['left_join'](_0x1292e5['interactionsTags'],'it','it.'+_0x63f49f+_0x5874('0x1f'))[_0x5874('0x14')](_0x5874('0xd'),'t',_0x5874('0x20'));}function getSqlClauses(){var _0x204e80={'body':squel['expr'](),'contact':squel[_0x5874('0x21')](),'default':squel[_0x5874('0x21')](),'fields':squel[_0x5874('0x21')](),'filter':squel['expr'](),'read':squel[_0x5874('0x21')](),'tags':{'clause':squel[_0x5874('0x21')](),'ids':null},'user':squel['expr']()};return _0x204e80;}function parseTagParameter(_0x526fb4){var _0x13331c=squel[_0x5874('0x21')]();if(_0x526fb4){var _0x59c8d1=utils['getSelectedTags'](_0x526fb4);_0x59c8d1[_0x5874('0x22')](function(_0x591d4d){_0x13331c['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x591d4d+',%');});}return _0x13331c;}function parseReadParameter(_0x5bd79f){var _0x14d3a7='';if(_0x5bd79f){_0x14d3a7=_0x5874('0x23');if(_0x5bd79f==='1'){_0x14d3a7=_0x14d3a7['replace'](_0x5874('0x24'),'=');}else{_0x14d3a7=_0x14d3a7['replace'](_0x5874('0x24'),'>');}}return _0x14d3a7;}function parseSearchFilter(_0x5a1d1b,_0x9e7474){var _0x2f1096=squel[_0x5874('0x21')]();if(_0x9e7474){var _0x55f2ec=_0x9e7474['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x5874('0x25')](_0x55f2ec)){_0x2f1096['or'](_0x5874('0x26'),_0x55f2ec+'%');if([_0x5874('0x27'),_0x5874('0x28')][_0x5874('0x29')](_0x5a1d1b)){_0x2f1096['or'](_0x5874('0x2a'),_0x55f2ec+'%');}else if(_0x5a1d1b===_0x5874('0x2b')){_0x2f1096['or']('i.fax\x20LIKE\x20?',_0x55f2ec+'%');}else if(_0x5a1d1b===_0x5874('0x2c')){_0x2f1096['or']('i.from\x20LIKE\x20?',_0x55f2ec+'%');}}else if(_0x5a1d1b==='mail'&&qs[_0x5874('0x2d')](_0x55f2ec)){_0x2f1096['or'](_0x5874('0x2e'),_0x55f2ec+'%');}else{if(_0x5a1d1b===_0x5874('0x2f')){_0x2f1096['or'](_0x5874('0x30'),qs[_0x5874('0x31')](_0x55f2ec,!![]))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x5874('0x31')](_0x55f2ec));}else if(_0x5a1d1b!=='fax'){_0x2f1096['or'](_0x5874('0x32'),qs[_0x5874('0x31')](_0x55f2ec));}_0x2f1096['or'](_0x5874('0x33'),qs[_0x5874('0x31')](_0x55f2ec,!![]),null);}}return _0x2f1096;}function parseAdvancedSearchFilter(_0x400df5,_0x3e915b){var _0x317689=getSqlClauses();var _0xb30dcf=as[_0x5874('0x34')](_0x400df5);var _0x4ff737=_0xb30dcf[_0x5874('0x35')];for(var _0x30418d=0x0;_0x30418d<_0xb30dcf['conditions'][_0x5874('0x36')];_0x30418d++){var _0xc96816=_0xb30dcf[_0x5874('0x37')][_0x30418d];var _0x2f0364='i';var _0x2f80e3=_[_0x5874('0x38')](_0x3e915b,[_0x5874('0x39'),_0xc96816[_0x5874('0xa')]]);if(_0x2f80e3){var _0x271452=as[_0x5874('0x3a')](_0x2f0364,_0x2f80e3['type'],_0xc96816);_0x317689[_0x5874('0x3b')][_0x4ff737](_0x271452[_0x5874('0x3c')],_0x271452[_0x5874('0x3d')][_0x5874('0x3e')],_0x271452[_0x5874('0x3d')][_0x5874('0x3f')]);}else{switch(_0xc96816[_0x5874('0xa')]){case _0x5874('0x40'):var _0x31abc3=parseReadParameter(_0xc96816[_0x5874('0x3d')]);_0x317689['read']['and'](_0x31abc3);break;case'Contact':if(_0xc96816[_0x5874('0x41')]===_0x5874('0x42')){if(_0xc96816[_0x5874('0x3d')][_0x5874('0x43')]('\x20')[_0x5874('0x36')]>0x1){_0x317689[_0x5874('0x44')][_0x4ff737]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x5874('0x31')](_0xc96816[_0x5874('0x3d')],!![]),null);}else{var _0x524357='%'+_0xc96816[_0x5874('0x3d')]+'%';_0x317689[_0x5874('0x44')][_0x4ff737](_0x5874('0x45'),_0x524357,_0x524357,_0x524357);}}else{_0x2f80e3=_[_0x5874('0x38')](_0x3e915b,[_0x5874('0x39'),_0x5874('0x46')]);_0xc96816[_0x5874('0xa')]='ContactId';_0x271452=as[_0x5874('0x3a')](_0x2f0364,_0x2f80e3['type'],_0xc96816);_0x317689[_0x5874('0x44')][_0x4ff737](_0x271452[_0x5874('0x3c')],_0x271452[_0x5874('0x3d')][_0x5874('0x3e')],_0x271452['value']['end']);}break;case _0x5874('0x47'):var _0x38ca53=_0xc96816[_0x5874('0x3d')][_0x5874('0x43')](',')['map'](function(_0x1e2265){return Number(_0x1e2265);});var _0x46a668=parseTagParameter(_0x38ca53);_0x317689[_0x5874('0x48')][_0x5874('0x49')][_0x5874('0x4a')](_0x46a668);_0x317689['tags'][_0x5874('0x4b')]=_0x38ca53;break;case'User':if(_0xc96816[_0x5874('0x41')]===_0x5874('0x42')){_0x317689['user'][_0x4ff737](_0x5874('0x4c'),'%'+_0xc96816[_0x5874('0x3d')]+'%',null);}else{_0x2f80e3=_[_0x5874('0x38')](_0x3e915b,[_0x5874('0x39'),_0x5874('0x4d')]);_0xc96816[_0x5874('0xa')]='UserId';_0x271452=as[_0x5874('0x3a')](_0x2f0364,_0x2f80e3['type'],_0xc96816);_0x317689[_0x5874('0x4e')][_0x4ff737](_0x271452['text'],_0x271452[_0x5874('0x3d')][_0x5874('0x3e')],_0x271452[_0x5874('0x3d')][_0x5874('0x3f')]);}break;case'body':case _0x5874('0x4f'):_0x271452=as['buildExpression']('me',null,_0xc96816);_0x317689['body'][_0x4ff737](_0x271452[_0x5874('0x3c')],_0x271452[_0x5874('0x3d')][_0x5874('0x3e')],_0x271452[_0x5874('0x3d')][_0x5874('0x3f')]);break;}}}return _0x317689;}function parseModelFields(_0x1013d7,_0x5068b9,_0x4b59bb){var _0xbd0015=utils[_0x5874('0x5')](_0x1013d7);var _0x70ceb5=squel['expr']();var _0x41c013=_(_0x5068b9)[_0x5874('0x50')]()[_0x5874('0x17')](function(_0x398ad4){return _[_0x5874('0x51')](_0x4b59bb,['name',_0x398ad4])?_0x398ad4:undefined;})[_0x5874('0x52')]()[_0x5874('0x3d')]();if(_0x41c013['length']>0x0){_0x41c013['forEach'](function(_0x5541f7){if(_0x5541f7===_0xbd0015){_0x70ceb5[_0x5874('0x4a')]('i.'+_0xbd0015+_0x5874('0x53'),[][_0x5874('0x54')](_0x5068b9[_0x5541f7]));}else if(_0x5541f7===_0x5874('0x55')){var _0x30c255=JSON[_0x5874('0x56')](_0x5068b9[_0x5541f7])[_0x5874('0x57')];var _0x461e41=JSON[_0x5874('0x56')](_0x5068b9[_0x5541f7])[_0x5874('0x58')];_0x70ceb5['and'](_0x5874('0x59'),_0x30c255,_0x461e41);}else{if(_0x5068b9[_0x5541f7]===_0x5874('0x5a')){_0x70ceb5[_0x5874('0x4a')]('i.'+_0x5541f7+'\x20IS\x20NULL');}else{_0x70ceb5[_0x5874('0x4a')]('i.'+_0x5541f7+'\x20=\x20?',_0x5068b9[_0x5541f7]);}}});}return _0x70ceb5;}function parseQueryParameters(_0x19d9c4,_0x461588,_0x202f64){var _0xe7dd55=getSqlClauses();return Promise['resolve']()[_0x5874('0x5b')](function(){return parseModelFields(_0x19d9c4,_0x461588,_0x202f64);})['then'](function(_0x1d8b03){_0xe7dd55[_0x5874('0x5c')][_0x5874('0x4a')](_0x1d8b03);return parseReadParameter(_0x461588[_0x5874('0x5d')]);})['then'](function(_0x5ab2d1){_0xe7dd55['read'][_0x5874('0x4a')](_0x5ab2d1);return parseTagParameter(_0x461588[_0x5874('0x5e')]);})['then'](function(_0x2f32e0){_0xe7dd55[_0x5874('0x48')][_0x5874('0x49')][_0x5874('0x4a')](_0x2f32e0);return parseSearchFilter(_0x19d9c4,_0x461588[_0x5874('0x5f')]);})['then'](function(_0x589f39){_0xe7dd55[_0x5874('0x5f')]=_0x589f39;return _0xe7dd55;});}function checkAccountsRestrictions(_0x35a285,_0x412b0,_0x472549){var _0xf71be6=utils[_0x5874('0x5')](_0x35a285);var _0x3e1e55=_0x5874('0x60')+_['capitalize'](_0x35a285)+(_0x35a285==='chat'?'Websites':_0x5874('0x61'));var _0x2adeab=squel[_0x5874('0x21')]();return Promise[_0x5874('0x62')]()[_0x5874('0x5b')](function(){if(_0x472549[_0x5874('0x8')]&&_0x412b0[_0x5874('0x6')]===_0x5874('0x7')){return _0x412b0[_0x3e1e55]({'attributes':['id'],'raw':!![]});}})[_0x5874('0x5b')](function(_0x275d85){if(_0x275d85){if(_0x275d85[_0x5874('0x36')]===0x0){_0x2adeab[_0x5874('0x4a')]('i.'+_0xf71be6+_0x5874('0x63'));}else{_0x2adeab[_0x5874('0x4a')]('i.'+_0xf71be6+_0x5874('0x53'),_['map'](_0x275d85,'id'));}}else if(!_0x472549[_0xf71be6]){_0x2adeab[_0x5874('0x4a')]('i.'+_0xf71be6+_0x5874('0x64'));}})['then'](function(){return _0x2adeab;});}function getClosedOrderClause(_0x234986,_0x36efce){var _0x4cdc12='';var _0x508b02=[_0x5874('0x65'),_0x5874('0x66'),'i.disposition'];if(_0x234986===_0x5874('0x2f')){_0x508b02['unshift'](_0x5874('0x67'));}if(_0x36efce[_0x5874('0x68')]==='0'&&_0x234986==='mail'){_0x4cdc12=_0x5874('0x67');}else{if(_0x36efce['closed']==='1'){_0x508b02[_0x5874('0x69')]();}_0x4cdc12='CONCAT_WS(\x27\x27,\x20'+_0x508b02[_0x5874('0x6a')](',\x20')+')';}return _0x4cdc12;}function getFilteredInteractions(_0x505be4,_0x171023,_0x3fcc31,_0x108cb6){var _0x4df256=utils[_0x5874('0xe')](_0x505be4);var _0x2c288f=_[_0x5874('0x6b')](_0x505be4)+_0x5874('0x6c');var _0x414e89=[];var _0x4c132d=getTagsQuery();var _0x3ab6f0={'type':db[_0x5874('0x6d')][_0x5874('0x6e')][_0x5874('0x6f')],'raw':!![]};var _0x177286=[];var _0x33c1d2=[];return db[_0x5874('0x70')][_0x5874('0x71')](_0x4c132d[_0x5874('0x72')](),_0x3ab6f0)[_0x5874('0x5b')](function(_0x206f86){_0x414e89=_[_0x5874('0x73')](_0x206f86,'id');_0x3ab6f0=_[_0x5874('0x74')](_0x3ab6f0,{'model':db[_0x2c288f],'mapToModel':!![],'nest':!![]});if(_0x3fcc31[_0x5874('0x5c')]){_0x108cb6[_0x5874('0x75')][_0x5874('0x22')](function(_0x2d9aaf){_0x171023[_0x5874('0xa')]('i.'+_0x2d9aaf);});}else{_0x171023[_0x5874('0xa')](_0x5874('0x76'),_0x5874('0x40'));_0x171023[_0x5874('0xa')](_0x5874('0x77'),_0x5874('0x78'));_0x171023[_0x5874('0xa')](_0x5874('0x79'),_0x5874('0x7a'));if(_0x505be4===_0x5874('0x2f')){_0x171023[_0x5874('0xa')]('a.email',_0x5874('0x7b'));_0x171023[_0x5874('0xa')](_0x5874('0x7c'),_0x5874('0x7d'));_0x171023[_0x5874('0xa')](_0x5874('0x7e'));_0x171023[_0x5874('0xa')](_0x5874('0x7f'));_0x171023[_0x5874('0xa')](_0x5874('0x80'));_0x171023[_0x5874('0xa')]('i.closed');_0x171023[_0x5874('0xa')](_0x5874('0x81'));_0x171023[_0x5874('0xa')]('i.attach');_0x171023[_0x5874('0xa')](_0x5874('0x82'));_0x171023[_0x5874('0xa')](_0x5874('0x83'));_0x171023['field'](_0x5874('0x84'));_0x171023[_0x5874('0xa')](_0x5874('0x85'));_0x171023[_0x5874('0xa')](_0x5874('0x66'));_0x171023[_0x5874('0xa')](_0x5874('0x65'));_0x171023[_0x5874('0xa')](_0x5874('0x67'));_0x171023[_0x5874('0xa')]('i.to');_0x171023[_0x5874('0xa')]('i.ContactId');_0x171023['field'](_0x5874('0x86'));_0x171023[_0x5874('0xa')](_0x5874('0x87'));}else if(_0x505be4===_0x5874('0x2c')){_0x171023[_0x5874('0xa')](_0x5874('0x88'),_0x5874('0x7d'));}else{_0x171023[_0x5874('0xa')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x5874('0x7d'));}if(_0x505be4!==_0x5874('0x2f')){_0x171023[_0x5874('0xa')](_0x5874('0x89'));}_0x171023[_0x5874('0xa')](_0x5874('0x8a'),_0x5874('0x8b'));_0x171023[_0x5874('0xa')]('c.lastName',_0x5874('0x8c'));_0x171023[_0x5874('0xa')](_0x5874('0x8d'),'Contact.email');_0x171023[_0x5874('0xa')](_0x5874('0x8e'),'Contact.phone');_0x171023[_0x5874('0xa')](_0x5874('0x8f'),_0x5874('0x90'));_0x171023['field'](_0x5874('0x91'),_0x5874('0x92'));_0x171023['field'](_0x5874('0x93'),_0x5874('0x94'));_0x171023[_0x5874('0xa')](_0x5874('0x95'),'Owner.internal');_0x171023['field'](_0x5874('0x96'),_0x5874('0x97'));}if(_0x108cb6['limit']){_0x171023[_0x5874('0x98')](_0x108cb6['limit']);}if(_0x108cb6[_0x5874('0x99')]){_0x171023[_0x5874('0x99')](_0x108cb6[_0x5874('0x99')]);}return db[_0x5874('0x70')][_0x5874('0x71')](_0x171023['toString'](),_0x3ab6f0);})['then'](function(_0x506c26){_0x177286=_0x506c26;var _0x47388b=getUsersQuery(_0x505be4,_0x177286);return db[_0x5874('0x70')][_0x5874('0x71')](_0x47388b[_0x5874('0x72')](),_0x3ab6f0);})['then'](function(_0x136886){_0x33c1d2=_['groupBy'](_0x136886,_0x4df256);if(_0x505be4===_0x5874('0x2f')){return db['Setting']['findOne']({'attributes':[_0x5874('0x9a')],'raw':!![]});}})['then'](function(_0x24aae1){var _0x40e1e4=_0x24aae1?_0x24aae1[_0x5874('0x9a')]:undefined;var _0x234165=_0x177286[_0x5874('0x17')](function(_0x1ca5f9){return updateInteraction(_0x1ca5f9,_0x414e89,_0x33c1d2,_0x40e1e4);});return Promise['all'](_0x234165);});}function countFilteredInteractions(_0x16ed44,_0x139d48){var _0x138e61=_0x16ed44[_0x5874('0x9b')]();_0x138e61[_0x5874('0xa')](_0x5874('0x9c'));_0x138e61[_0x5874('0xa')](_0x5874('0x76'),_0x5874('0x40'));var _0x486f4c=utils[_0x5874('0x9d')](_0x139d48);if(!_['isEmpty'](_0x486f4c)){_0x138e61[_0x5874('0x9e')](_0x5874('0x9f'),_0x486f4c);}var _0x87650={'type':db[_0x5874('0x6d')][_0x5874('0x6e')][_0x5874('0x6f')],'raw':!![]};return db[_0x5874('0x70')][_0x5874('0x71')](_0x138e61[_0x5874('0x72')](),_0x87650);}module[_0x5874('0xa0')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0xed70=['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)','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','conditions','find','buildExpression','type','text','value','read','Contact','$substring','split','contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','start','end','clause','tags','ids','User','operator','user','UserId','body','keys','compact','and','\x20IN\x20?','concat','createdAt','parse','$gte','null','resolve','then','fields','tag','filter','get','capitalize','chat','Websites','Accounts','\x20IS\x20NULL','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.substatus','closed','shift','CONCAT_WS(\x27\x27,\x20','join','Interaction','Sequelize','QueryTypes','sequelize','query','toString','keyBy','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','a.key','Account.key','a.mandatoryDisposition','a.email','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.id','i.createdAt','i.closedAt','i.lastMsgAt','i.lastMsgDirection','i.subject','i.secondDisposition','i.to','i.ContactId','i.MailAccountId','i.UserId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','groupBy','Setting','findOne','enableEmailPreview','all','clone','COUNT(*)','isEmpty','where','SELECT','exports','lodash','squel','../parsers/qs','updateInteraction','./utils','role','agent','search','select','field','name','color','from','tools_tags','getInteractionFK','_interactions','u.fullname','ui.','left_join','users','u.id\x20=\x20ui.UserId','length','map','getInteractionsTables','getAccountFK','interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','messages','me.','\x20=\x20i.id','interactionsTags','it.','t.id\x20=\x20it.TagId','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','isNumeric','i.id\x20LIKE\x20?','sms','whatsapp','includes','i.phone\x20LIKE\x20?','fax','i.fax\x20LIKE\x20?','openchannel'];(function(_0x37ea50,_0x1c30e4){var _0x25d492=function(_0x374579){while(--_0x374579){_0x37ea50['push'](_0x37ea50['shift']());}};_0x25d492(++_0x1c30e4);}(_0xed70,0x11e));var _0x0ed7=function(_0x490872,_0x2e72d9){_0x490872=_0x490872-0x0;var _0x4fef75=_0xed70[_0x490872];return _0x4fef75;};'use strict';var _=require(_0x0ed7('0x0'));var squel=require(_0x0ed7('0x1'));var as=require('../parsers/advancedSearch');var qs=require(_0x0ed7('0x2'));var updateInteraction=require('./update-interaction')[_0x0ed7('0x3')];var utils=require(_0x0ed7('0x4'));var db=require('../../mysqldb')['db'];function skipInteractionsQuery(_0x247af0,_0x5cb0fb,_0x317ffc){var _0x264bab=![];var _0x7fb24d=utils['getAccountFK'](_0x247af0);if(_0x5cb0fb[_0x0ed7('0x5')]===_0x0ed7('0x6')&&!_0x317ffc[_0x0ed7('0x7')]&&!_0x317ffc[_0x7fb24d]){_0x264bab=!![];}return _0x264bab;}function getTagsQuery(){return squel[_0x0ed7('0x8')]()[_0x0ed7('0x9')]('id')['field'](_0x0ed7('0xa'))['field'](_0x0ed7('0xb'))[_0x0ed7('0xc')](_0x0ed7('0xd'));}function getUsersQuery(_0x57009d,_0x32b119){var _0x2282e5=utils[_0x0ed7('0xe')](_0x57009d);var _0x37502e='user_has_'+_0x57009d+_0x0ed7('0xf');var _0x1087eb=squel[_0x0ed7('0x8')]()[_0x0ed7('0x9')]('u.id')[_0x0ed7('0x9')](_0x0ed7('0x10'))[_0x0ed7('0x9')](_0x0ed7('0x11')+_0x2282e5)[_0x0ed7('0xc')](_0x37502e,'ui')[_0x0ed7('0x12')](_0x0ed7('0x13'),'u',_0x0ed7('0x14'));if(_0x32b119[_0x0ed7('0x15')]>0x0){_0x1087eb['where'](_0x0ed7('0x11')+_0x2282e5+'\x20IN\x20?',_[_0x0ed7('0x16')](_0x32b119,'id'));}return _0x1087eb;}function getInteractionsQuery(_0x130dbe){var _0x4664e8=utils[_0x0ed7('0x17')](_0x130dbe);var _0x19848b=utils[_0x0ed7('0x18')](_0x130dbe);var _0x5962bb=utils[_0x0ed7('0xe')](_0x130dbe);return squel['select']()['from'](_0x4664e8[_0x0ed7('0x19')],'i')[_0x0ed7('0x12')]('cm_contacts','c',_0x0ed7('0x1a'))[_0x0ed7('0x12')](_0x0ed7('0x13'),'o',_0x0ed7('0x1b'))[_0x0ed7('0x12')](_0x4664e8[_0x0ed7('0x1c')],'a',_0x0ed7('0x1d')+_0x19848b)[_0x0ed7('0x12')](_0x4664e8[_0x0ed7('0x1e')],'me',_0x0ed7('0x1f')+_0x5962bb+_0x0ed7('0x20'))['left_join'](_0x4664e8[_0x0ed7('0x21')],'it',_0x0ed7('0x22')+_0x5962bb+_0x0ed7('0x20'))[_0x0ed7('0x12')]('tools_tags','t',_0x0ed7('0x23'));}function getSqlClauses(){var _0xef262a={'body':squel[_0x0ed7('0x24')](),'contact':squel[_0x0ed7('0x24')](),'default':squel[_0x0ed7('0x24')](),'fields':squel['expr'](),'filter':squel[_0x0ed7('0x24')](),'read':squel[_0x0ed7('0x24')](),'tags':{'clause':squel[_0x0ed7('0x24')](),'ids':null},'user':squel[_0x0ed7('0x24')]()};return _0xef262a;}function parseTagParameter(_0x2166c8){var _0x47229a=squel[_0x0ed7('0x24')]();if(_0x2166c8){var _0x5853e3=utils[_0x0ed7('0x25')](_0x2166c8);_0x5853e3[_0x0ed7('0x26')](function(_0x4c73b7){_0x47229a['or'](_0x0ed7('0x27'),'%,'+_0x4c73b7+',%');});}return _0x47229a;}function parseReadParameter(_0x5ea8a2){var _0x489ceb='';if(_0x5ea8a2){_0x489ceb=_0x0ed7('0x28');if(_0x5ea8a2==='1'){_0x489ceb=_0x489ceb[_0x0ed7('0x29')](_0x0ed7('0x2a'),'=');}else{_0x489ceb=_0x489ceb[_0x0ed7('0x29')](_0x0ed7('0x2a'),'>');}}return _0x489ceb;}function parseSearchFilter(_0x5d820e,_0x38e6c6){var _0x16795c=squel[_0x0ed7('0x24')]();if(_0x38e6c6){var _0x1f8f38=_0x38e6c6['replace']('\x5c','\x5c\x5c')[_0x0ed7('0x29')](/'/g,'\x27\x27');if(qs[_0x0ed7('0x2b')](_0x1f8f38)){_0x16795c['or'](_0x0ed7('0x2c'),_0x1f8f38+'%');if([_0x0ed7('0x2d'),_0x0ed7('0x2e')][_0x0ed7('0x2f')](_0x5d820e)){_0x16795c['or'](_0x0ed7('0x30'),_0x1f8f38+'%');}else if(_0x5d820e===_0x0ed7('0x31')){_0x16795c['or'](_0x0ed7('0x32'),_0x1f8f38+'%');}else if(_0x5d820e===_0x0ed7('0x33')){_0x16795c['or'](_0x0ed7('0x34'),_0x1f8f38+'%');}}else if(_0x5d820e===_0x0ed7('0x35')&&qs[_0x0ed7('0x36')](_0x1f8f38)){_0x16795c['or'](_0x0ed7('0x37'),_0x1f8f38+'%');}else{if(_0x5d820e===_0x0ed7('0x35')){_0x16795c['or'](_0x0ed7('0x38'),qs[_0x0ed7('0x39')](_0x1f8f38,!![]))['or'](_0x0ed7('0x3a'),qs[_0x0ed7('0x39')](_0x1f8f38));}else if(_0x5d820e!==_0x0ed7('0x31')){_0x16795c['or'](_0x0ed7('0x3b'),qs[_0x0ed7('0x39')](_0x1f8f38));}_0x16795c['or'](_0x0ed7('0x3c'),qs[_0x0ed7('0x39')](_0x1f8f38,!![]),null);}}return _0x16795c;}function parseAdvancedSearchFilter(_0x479990,_0x54aa62){var _0xdb8b58=getSqlClauses();var _0x21172e=as[_0x0ed7('0x3d')](_0x479990);var _0x536db4=_0x21172e['sqlOperator'];for(var _0x31713c=0x0;_0x31713c<_0x21172e[_0x0ed7('0x3e')][_0x0ed7('0x15')];_0x31713c++){var _0x203edf=_0x21172e['conditions'][_0x31713c];var _0x563dee='i';var _0x46a49a=_[_0x0ed7('0x3f')](_0x54aa62,[_0x0ed7('0xa'),_0x203edf[_0x0ed7('0x9')]]);if(_0x46a49a){var _0x20aa9b=as[_0x0ed7('0x40')](_0x563dee,_0x46a49a[_0x0ed7('0x41')],_0x203edf);_0xdb8b58['default'][_0x536db4](_0x20aa9b[_0x0ed7('0x42')],_0x20aa9b[_0x0ed7('0x43')]['start'],_0x20aa9b['value']['end']);}else{switch(_0x203edf[_0x0ed7('0x9')]){case'unreadMessages':var _0x5e1a3e=parseReadParameter(_0x203edf[_0x0ed7('0x43')]);_0xdb8b58[_0x0ed7('0x44')]['and'](_0x5e1a3e);break;case _0x0ed7('0x45'):if(_0x203edf['operator']===_0x0ed7('0x46')){if(_0x203edf[_0x0ed7('0x43')][_0x0ed7('0x47')]('\x20')[_0x0ed7('0x15')]>0x1){_0xdb8b58[_0x0ed7('0x48')][_0x536db4](_0x0ed7('0x3c'),qs[_0x0ed7('0x39')](_0x203edf[_0x0ed7('0x43')],!![]),null);}else{var _0x491262='%'+_0x203edf['value']+'%';_0xdb8b58[_0x0ed7('0x48')][_0x536db4](_0x0ed7('0x49'),_0x491262,_0x491262,_0x491262);}}else{_0x46a49a=_[_0x0ed7('0x3f')](_0x54aa62,[_0x0ed7('0xa'),_0x0ed7('0x4a')]);_0x203edf[_0x0ed7('0x9')]=_0x0ed7('0x4a');_0x20aa9b=as[_0x0ed7('0x40')](_0x563dee,_0x46a49a['type'],_0x203edf);_0xdb8b58['contact'][_0x536db4](_0x20aa9b[_0x0ed7('0x42')],_0x20aa9b['value'][_0x0ed7('0x4b')],_0x20aa9b['value'][_0x0ed7('0x4c')]);}break;case'Tag':var _0x2233bf=_0x203edf[_0x0ed7('0x43')][_0x0ed7('0x47')](',')['map'](function(_0x49d968){return Number(_0x49d968);});var _0x31b9ea=parseTagParameter(_0x2233bf);_0xdb8b58['tags'][_0x0ed7('0x4d')]['and'](_0x31b9ea);_0xdb8b58[_0x0ed7('0x4e')][_0x0ed7('0x4f')]=_0x2233bf;break;case _0x0ed7('0x50'):if(_0x203edf[_0x0ed7('0x51')]===_0x0ed7('0x46')){_0xdb8b58[_0x0ed7('0x52')][_0x536db4]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x203edf[_0x0ed7('0x43')]+'%',null);}else{_0x46a49a=_['find'](_0x54aa62,['name','UserId']);_0x203edf[_0x0ed7('0x9')]=_0x0ed7('0x53');_0x20aa9b=as[_0x0ed7('0x40')](_0x563dee,_0x46a49a['type'],_0x203edf);_0xdb8b58[_0x0ed7('0x52')][_0x536db4](_0x20aa9b['text'],_0x20aa9b[_0x0ed7('0x43')][_0x0ed7('0x4b')],_0x20aa9b[_0x0ed7('0x43')]['end']);}break;case _0x0ed7('0x54'):case'plainBody':_0x20aa9b=as['buildExpression']('me',null,_0x203edf);_0xdb8b58[_0x0ed7('0x54')][_0x536db4](_0x20aa9b['text'],_0x20aa9b[_0x0ed7('0x43')][_0x0ed7('0x4b')],_0x20aa9b[_0x0ed7('0x43')][_0x0ed7('0x4c')]);break;}}}return _0xdb8b58;}function parseModelFields(_0x1690c7,_0xe32854,_0x4b40f7){var _0x4c8f88=utils[_0x0ed7('0x18')](_0x1690c7);var _0x389887=squel[_0x0ed7('0x24')]();var _0x3f1a90=_(_0xe32854)[_0x0ed7('0x55')]()[_0x0ed7('0x16')](function(_0x1b7994){return _['some'](_0x4b40f7,[_0x0ed7('0xa'),_0x1b7994])?_0x1b7994:undefined;})[_0x0ed7('0x56')]()[_0x0ed7('0x43')]();if(_0x3f1a90['length']>0x0){_0x3f1a90[_0x0ed7('0x26')](function(_0x37cb4c){if(_0x37cb4c===_0x4c8f88){_0x389887[_0x0ed7('0x57')]('i.'+_0x4c8f88+_0x0ed7('0x58'),[][_0x0ed7('0x59')](_0xe32854[_0x37cb4c]));}else if(_0x37cb4c===_0x0ed7('0x5a')){var _0x47a544=JSON[_0x0ed7('0x5b')](_0xe32854[_0x37cb4c])[_0x0ed7('0x5c')];var _0x3231cc=JSON[_0x0ed7('0x5b')](_0xe32854[_0x37cb4c])['$lte'];_0x389887[_0x0ed7('0x57')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x47a544,_0x3231cc);}else{if(_0xe32854[_0x37cb4c]===_0x0ed7('0x5d')){_0x389887[_0x0ed7('0x57')]('i.'+_0x37cb4c+'\x20IS\x20NULL');}else{_0x389887[_0x0ed7('0x57')]('i.'+_0x37cb4c+'\x20=\x20?',_0xe32854[_0x37cb4c]);}}});}return _0x389887;}function parseQueryParameters(_0x4f2003,_0x337bcc,_0x11e8a4){var _0x31ee9f=getSqlClauses();return Promise[_0x0ed7('0x5e')]()['then'](function(){return parseModelFields(_0x4f2003,_0x337bcc,_0x11e8a4);})[_0x0ed7('0x5f')](function(_0x39d996){_0x31ee9f[_0x0ed7('0x60')][_0x0ed7('0x57')](_0x39d996);return parseReadParameter(_0x337bcc['read']);})[_0x0ed7('0x5f')](function(_0x1b100b){_0x31ee9f[_0x0ed7('0x44')]['and'](_0x1b100b);return parseTagParameter(_0x337bcc[_0x0ed7('0x61')]);})['then'](function(_0x49ca48){_0x31ee9f[_0x0ed7('0x4e')][_0x0ed7('0x4d')][_0x0ed7('0x57')](_0x49ca48);return parseSearchFilter(_0x4f2003,_0x337bcc[_0x0ed7('0x62')]);})[_0x0ed7('0x5f')](function(_0x218469){_0x31ee9f[_0x0ed7('0x62')]=_0x218469;return _0x31ee9f;});}function checkAccountsRestrictions(_0x52ac93,_0x17d279,_0xb2b5d4){var _0xc103ab=utils[_0x0ed7('0x18')](_0x52ac93);var _0x5e5d24=_0x0ed7('0x63')+_[_0x0ed7('0x64')](_0x52ac93)+(_0x52ac93===_0x0ed7('0x65')?_0x0ed7('0x66'):_0x0ed7('0x67'));var _0x510961=squel[_0x0ed7('0x24')]();return Promise[_0x0ed7('0x5e')]()[_0x0ed7('0x5f')](function(){if(_0xb2b5d4[_0x0ed7('0x7')]&&_0x17d279[_0x0ed7('0x5')]===_0x0ed7('0x6')){return _0x17d279[_0x5e5d24]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x37f142){if(_0x37f142){if(_0x37f142[_0x0ed7('0x15')]===0x0){_0x510961['and']('i.'+_0xc103ab+_0x0ed7('0x68'));}else{_0x510961[_0x0ed7('0x57')]('i.'+_0xc103ab+_0x0ed7('0x58'),_[_0x0ed7('0x16')](_0x37f142,'id'));}}else if(!_0xb2b5d4[_0xc103ab]){_0x510961[_0x0ed7('0x57')]('i.'+_0xc103ab+_0x0ed7('0x69'));}})[_0x0ed7('0x5f')](function(){return _0x510961;});}function getClosedOrderClause(_0x2e52c0,_0x1c097d){var _0x3f762b='';var _0x267863=[_0x0ed7('0x6a'),'i.secondDisposition','i.disposition'];if(_0x2e52c0===_0x0ed7('0x35')){_0x267863['unshift'](_0x0ed7('0x6b'));}if(_0x1c097d[_0x0ed7('0x6c')]==='0'&&_0x2e52c0===_0x0ed7('0x35')){_0x3f762b=_0x0ed7('0x6b');}else{if(_0x1c097d[_0x0ed7('0x6c')]==='1'){_0x267863[_0x0ed7('0x6d')]();}_0x3f762b=_0x0ed7('0x6e')+_0x267863[_0x0ed7('0x6f')](',\x20')+')';}return _0x3f762b;}function getFilteredInteractions(_0x32b674,_0x4cfd2a,_0x2ecf54,_0x286783){var _0x42dd84=utils['getInteractionFK'](_0x32b674);var _0x395b33=_[_0x0ed7('0x64')](_0x32b674)+_0x0ed7('0x70');var _0x26f485=[];var _0x48585f=getTagsQuery();var _0x3a8540={'type':db[_0x0ed7('0x71')][_0x0ed7('0x72')]['SELECT'],'raw':!![]};var _0x3dd16c=[];var _0x2a4906=[];return db[_0x0ed7('0x73')][_0x0ed7('0x74')](_0x48585f[_0x0ed7('0x75')](),_0x3a8540)[_0x0ed7('0x5f')](function(_0x58b581){_0x26f485=_[_0x0ed7('0x76')](_0x58b581,'id');_0x3a8540=_['merge'](_0x3a8540,{'model':db[_0x395b33],'mapToModel':!![],'nest':!![]});if(_0x2ecf54[_0x0ed7('0x60')]){_0x286783[_0x0ed7('0x77')][_0x0ed7('0x26')](function(_0x4a6eb0){_0x4cfd2a[_0x0ed7('0x9')]('i.'+_0x4a6eb0);});}else{_0x4cfd2a['field'](_0x0ed7('0x78'),_0x0ed7('0x79'));_0x4cfd2a['field'](_0x0ed7('0x7a'),_0x0ed7('0x7b'));_0x4cfd2a[_0x0ed7('0x9')](_0x0ed7('0x7c'),'Account.mandatoryDisposition');if(_0x32b674===_0x0ed7('0x35')){_0x4cfd2a[_0x0ed7('0x9')](_0x0ed7('0x7d'),_0x0ed7('0x7e'));_0x4cfd2a[_0x0ed7('0x9')](_0x0ed7('0x7f'),_0x0ed7('0x80'));_0x4cfd2a[_0x0ed7('0x9')](_0x0ed7('0x81'));_0x4cfd2a[_0x0ed7('0x9')](_0x0ed7('0x82'));_0x4cfd2a[_0x0ed7('0x9')]('i.updatedAt');_0x4cfd2a['field']('i.closed');_0x4cfd2a[_0x0ed7('0x9')](_0x0ed7('0x83'));_0x4cfd2a['field']('i.attach');_0x4cfd2a['field'](_0x0ed7('0x84'));_0x4cfd2a[_0x0ed7('0x9')](_0x0ed7('0x85'));_0x4cfd2a[_0x0ed7('0x9')](_0x0ed7('0x86'));_0x4cfd2a[_0x0ed7('0x9')]('i.disposition');_0x4cfd2a[_0x0ed7('0x9')](_0x0ed7('0x87'));_0x4cfd2a[_0x0ed7('0x9')](_0x0ed7('0x6a'));_0x4cfd2a[_0x0ed7('0x9')](_0x0ed7('0x6b'));_0x4cfd2a[_0x0ed7('0x9')](_0x0ed7('0x88'));_0x4cfd2a[_0x0ed7('0x9')](_0x0ed7('0x89'));_0x4cfd2a[_0x0ed7('0x9')](_0x0ed7('0x8a'));_0x4cfd2a[_0x0ed7('0x9')](_0x0ed7('0x8b'));}else if(_0x32b674===_0x0ed7('0x33')){_0x4cfd2a['field'](_0x0ed7('0x8c'),_0x0ed7('0x80'));}else{_0x4cfd2a['field'](_0x0ed7('0x8d'),_0x0ed7('0x80'));}if(_0x32b674!==_0x0ed7('0x35')){_0x4cfd2a['field'](_0x0ed7('0x8e'));}_0x4cfd2a[_0x0ed7('0x9')](_0x0ed7('0x8f'),_0x0ed7('0x90'));_0x4cfd2a[_0x0ed7('0x9')]('c.lastName',_0x0ed7('0x91'));_0x4cfd2a[_0x0ed7('0x9')](_0x0ed7('0x92'),_0x0ed7('0x93'));_0x4cfd2a[_0x0ed7('0x9')](_0x0ed7('0x94'),_0x0ed7('0x95'));_0x4cfd2a['field'](_0x0ed7('0x96'),_0x0ed7('0x97'));_0x4cfd2a[_0x0ed7('0x9')]('c.fax','Contact.fax');_0x4cfd2a[_0x0ed7('0x9')]('o.fullname','Owner.fullname');_0x4cfd2a[_0x0ed7('0x9')](_0x0ed7('0x98'),_0x0ed7('0x99'));_0x4cfd2a[_0x0ed7('0x9')](_0x0ed7('0x9a'),_0x0ed7('0x9b'));}if(_0x286783[_0x0ed7('0x9c')]){_0x4cfd2a['limit'](_0x286783['limit']);}if(_0x286783[_0x0ed7('0x9d')]){_0x4cfd2a[_0x0ed7('0x9d')](_0x286783[_0x0ed7('0x9d')]);}return db['sequelize'][_0x0ed7('0x74')](_0x4cfd2a[_0x0ed7('0x75')](),_0x3a8540);})[_0x0ed7('0x5f')](function(_0x18850d){_0x3dd16c=_0x18850d;var _0x47c409=getUsersQuery(_0x32b674,_0x3dd16c);return db[_0x0ed7('0x73')][_0x0ed7('0x74')](_0x47c409[_0x0ed7('0x75')](),_0x3a8540);})[_0x0ed7('0x5f')](function(_0x352b63){_0x2a4906=_[_0x0ed7('0x9e')](_0x352b63,_0x42dd84);if(_0x32b674===_0x0ed7('0x35')){return db[_0x0ed7('0x9f')][_0x0ed7('0xa0')]({'attributes':[_0x0ed7('0xa1')],'raw':!![]});}})[_0x0ed7('0x5f')](function(_0x4514d4){var _0x45769f=_0x4514d4?_0x4514d4['enableEmailPreview']:undefined;var _0x58e3d9=_0x3dd16c[_0x0ed7('0x16')](function(_0x102854){return updateInteraction(_0x102854,_0x26f485,_0x2a4906,_0x45769f);});return Promise[_0x0ed7('0xa2')](_0x58e3d9);});}function countFilteredInteractions(_0x5a3dd7,_0xcaa15b){var _0x32c7d3=_0x5a3dd7[_0x0ed7('0xa3')]();_0x32c7d3[_0x0ed7('0x9')](_0x0ed7('0xa4'));_0x32c7d3[_0x0ed7('0x9')](_0x0ed7('0x78'),_0x0ed7('0x79'));var _0x33afec=utils[_0x0ed7('0x25')](_0xcaa15b);if(!_[_0x0ed7('0xa5')](_0x33afec)){_0x32c7d3[_0x0ed7('0xa6')]('t.id\x20IN\x20?',_0x33afec);}var _0x1b1cab={'type':db['Sequelize'][_0x0ed7('0x72')][_0x0ed7('0xa7')],'raw':!![]};return db[_0x0ed7('0x73')][_0x0ed7('0x74')](_0x32c7d3['toString'](),_0x1b1cab);}module[_0x0ed7('0xa8')]={'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 8a05214..33098a0 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 _0xf4a0=['total','disposition','abandoned','UserId','waiting','MailMessage','out','-id','plainBody','lastMsgText','trimStart','catch','then','Users','TagIds','Tags','lodash','map','fullname','split','push','talking','answered','unmanaged'];(function(_0x370d7c,_0x473365){var _0x1727d7=function(_0x2c212e){while(--_0x2c212e){_0x370d7c['push'](_0x370d7c['shift']());}};_0x1727d7(++_0x473365);}(_0xf4a0,0x178));var _0x0f4a=function(_0x2c3a07,_0x384eb9){_0x2c3a07=_0x2c3a07-0x0;var _0x46aa2a=_0xf4a0[_0x2c3a07];return _0x46aa2a;};'use strict';var _=require(_0x0f4a('0x0'));var db=require('../../mysqldb')['db'];function getInteractionUsers(_0x276511,_0xed2f2e){return new Promise(function(_0x4e41a0,_0x307c06){try{var _0x595c77=[];if(_0xed2f2e[_0x276511]){_0x595c77=_0xed2f2e[_0x276511][_0x0f4a('0x1')](function(_0xfe22b5){return{'id':_0xfe22b5['id'],'fullname':_0xfe22b5[_0x0f4a('0x2')]};});}return _0x4e41a0(_0x595c77);}catch(_0x252666){_0x307c06(_0x252666);}});}function getInteractionTags(_0x3f5869,_0x54e19c){var _0xe63f42=[];if(_0x3f5869){_0x3f5869[_0x0f4a('0x3')](',')['forEach'](function(_0x1fee1d){_0xe63f42[_0x0f4a('0x4')](_0x54e19c[_0x1fee1d]);});}return _0xe63f42;}function updateWaitingCounter(_0x32828e){if(_0x32828e['waiting']){_0x32828e['waiting']-=0x1;}}function updateInteractionCounters(_0x49e918){_0x49e918['waiting']=0x0;_0x49e918[_0x0f4a('0x5')]=0x0;_0x49e918[_0x0f4a('0x6')]=0x0;_0x49e918[_0x0f4a('0x7')]=0x0;_0x49e918['abandoned']=0x0;_0x49e918[_0x0f4a('0x8')]=0x0;if(_0x49e918['closed']){if(_0x49e918[_0x0f4a('0x9')]===_0x0f4a('0xa')){_0x49e918[_0x0f4a('0xa')]+=0x1;updateWaitingCounter(_0x49e918);}if(_0x49e918[_0x0f4a('0xb')]){_0x49e918[_0x0f4a('0x6')]+=0x1;if(_0x49e918[_0x0f4a('0x5')]){_0x49e918[_0x0f4a('0x5')]-=0x1;}}else{if(_0x49e918[_0x0f4a('0x9')]){_0x49e918[_0x0f4a('0x7')]+=0x1;updateWaitingCounter(_0x49e918);}}}else{if(!_0x49e918['UserId']){_0x49e918[_0x0f4a('0xc')]+=0x1;}if(_0x49e918['UserId']){_0x49e918[_0x0f4a('0x5')]+=0x1;updateWaitingCounter(_0x49e918);}}_0x49e918['total']+=0x1;return _0x49e918;}function getLastMessageText(_0x25c939){return db[_0x0f4a('0xd')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x25c939['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x0f4a('0xe')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0x0f4a('0xf'),'raw':!![]})['then'](function(_0x53e14e){if(_0x53e14e&&_0x53e14e[_0x0f4a('0x10')]){_0x25c939[_0x0f4a('0x11')]=_[_0x0f4a('0x12')](_0x53e14e[_0x0f4a('0x10')]);}return _0x25c939;})[_0x0f4a('0x13')](function(_0x458755){throw _0x458755;});}exports['updateInteraction']=function(_0x3aa22d,_0x5d7b98,_0x7e45df,_0x30a77c){return new Promise(function(_0x1e1b5b,_0x5e1cd4){return getInteractionUsers(_0x3aa22d['id'],_0x7e45df)[_0x0f4a('0x14')](function(_0x4aa9bb){_0x3aa22d[_0x0f4a('0x15')]=_0x4aa9bb;return getInteractionTags(_0x3aa22d[_0x0f4a('0x16')],_0x5d7b98);})[_0x0f4a('0x14')](function(_0x3d40c6){_0x3aa22d[_0x0f4a('0x17')]=_0x3d40c6;delete _0x3aa22d[_0x0f4a('0x16')];return updateInteractionCounters(_0x3aa22d);})[_0x0f4a('0x14')](function(_0xf2a97e){if(_0x30a77c){return getLastMessageText(_0xf2a97e);}else{return _0xf2a97e;}})['then'](function(_0x1f904b){_0x1e1b5b(_0x1f904b);})[_0x0f4a('0x13')](function(_0x300372){_0x5e1cd4(_0x300372);});});}; \ No newline at end of file +var _0xf8ab=['lastMsgText','trimStart','updateInteraction','Users','TagIds','catch','../../mysqldb','map','split','forEach','push','waiting','talking','answered','unmanaged','abandoned','total','closed','disposition','UserId','MailMessage','findOne','out','plainBody','-id','then'];(function(_0x5a191e,_0x271e90){var _0x313d9c=function(_0x34a05d){while(--_0x34a05d){_0x5a191e['push'](_0x5a191e['shift']());}};_0x313d9c(++_0x271e90);}(_0xf8ab,0xbc));var _0xbf8a=function(_0x5e9660,_0x2a15ae){_0x5e9660=_0x5e9660-0x0;var _0x4d48aa=_0xf8ab[_0x5e9660];return _0x4d48aa;};'use strict';var _=require('lodash');var db=require(_0xbf8a('0x0'))['db'];function getInteractionUsers(_0xa13ba1,_0x563f3d){return new Promise(function(_0x5c39f3,_0xfa15f3){try{var _0x52f9a0=[];if(_0x563f3d[_0xa13ba1]){_0x52f9a0=_0x563f3d[_0xa13ba1][_0xbf8a('0x1')](function(_0x502f38){return{'id':_0x502f38['id'],'fullname':_0x502f38['fullname']};});}return _0x5c39f3(_0x52f9a0);}catch(_0x5ad046){_0xfa15f3(_0x5ad046);}});}function getInteractionTags(_0x3eec6c,_0x2f9bea){var _0x282e3f=[];if(_0x3eec6c){_0x3eec6c[_0xbf8a('0x2')](',')[_0xbf8a('0x3')](function(_0x589e09){_0x282e3f[_0xbf8a('0x4')](_0x2f9bea[_0x589e09]);});}return _0x282e3f;}function updateWaitingCounter(_0x50a853){if(_0x50a853[_0xbf8a('0x5')]){_0x50a853[_0xbf8a('0x5')]-=0x1;}}function updateInteractionCounters(_0x37f57a){_0x37f57a[_0xbf8a('0x5')]=0x0;_0x37f57a[_0xbf8a('0x6')]=0x0;_0x37f57a[_0xbf8a('0x7')]=0x0;_0x37f57a[_0xbf8a('0x8')]=0x0;_0x37f57a[_0xbf8a('0x9')]=0x0;_0x37f57a[_0xbf8a('0xa')]=0x0;if(_0x37f57a[_0xbf8a('0xb')]){if(_0x37f57a[_0xbf8a('0xc')]==='abandoned'){_0x37f57a['abandoned']+=0x1;updateWaitingCounter(_0x37f57a);}if(_0x37f57a[_0xbf8a('0xd')]){_0x37f57a[_0xbf8a('0x7')]+=0x1;if(_0x37f57a['talking']){_0x37f57a[_0xbf8a('0x6')]-=0x1;}}else{if(_0x37f57a[_0xbf8a('0xc')]){_0x37f57a[_0xbf8a('0x8')]+=0x1;updateWaitingCounter(_0x37f57a);}}}else{if(!_0x37f57a[_0xbf8a('0xd')]){_0x37f57a[_0xbf8a('0x5')]+=0x1;}if(_0x37f57a[_0xbf8a('0xd')]){_0x37f57a['talking']+=0x1;updateWaitingCounter(_0x37f57a);}}_0x37f57a[_0xbf8a('0xa')]+=0x1;return _0x37f57a;}function getLastMessageText(_0x1bb999){return db[_0xbf8a('0xe')][_0xbf8a('0xf')]({'where':{'$and':[{'MailInteractionId':_0x1bb999['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xbf8a('0x10')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xbf8a('0x11')],'order':_0xbf8a('0x12'),'raw':!![]})[_0xbf8a('0x13')](function(_0x47fcdf){if(_0x47fcdf&&_0x47fcdf['plainBody']){_0x1bb999[_0xbf8a('0x14')]=_[_0xbf8a('0x15')](_0x47fcdf['plainBody']);}return _0x1bb999;})['catch'](function(_0x12518f){throw _0x12518f;});}exports[_0xbf8a('0x16')]=function(_0x222e12,_0x4d7f95,_0x541705,_0xaef5bf){return new Promise(function(_0x271fe6,_0x16f2ed){return getInteractionUsers(_0x222e12['id'],_0x541705)[_0xbf8a('0x13')](function(_0xd7f815){_0x222e12[_0xbf8a('0x17')]=_0xd7f815;return getInteractionTags(_0x222e12[_0xbf8a('0x18')],_0x4d7f95);})[_0xbf8a('0x13')](function(_0x305d86){_0x222e12['Tags']=_0x305d86;delete _0x222e12[_0xbf8a('0x18')];return updateInteractionCounters(_0x222e12);})[_0xbf8a('0x13')](function(_0x137235){if(_0xaef5bf){return getLastMessageText(_0x137235);}else{return _0x137235;}})[_0xbf8a('0x13')](function(_0x4ad22f){_0x271fe6(_0x4ad22f);})[_0xbf8a('0x19')](function(_0x2d3ed6){_0x16f2ed(_0x2d3ed6);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index 1e4d321..f244538 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 _0x1fa5=['null','Interaction','findOne','then','update','catch','error','exports','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Website','Account','InteractionId','upperFirst','unknown','websites','accounts','_interactions','_interaction_has_tags','user_has_','isArray','toLowerCase','toUpperCase','name','role','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1fa5,0x118));var _0x51fa=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x1fa5[_0x173441];return _0x2423a8;};'use strict';var _=require(_0x51fa('0x0'));var db=require(_0x51fa('0x1'))['db'];var loggers={'openchannel':require(_0x51fa('0x2'))(_0x51fa('0x3')),'mail':require(_0x51fa('0x2'))(_0x51fa('0x4')),'fax':require('../../config/logger')(_0x51fa('0x5')),'sms':require('../../config/logger')('sms-interactions'),'chat':require(_0x51fa('0x2'))(_0x51fa('0x6')),'whatsapp':require(_0x51fa('0x2'))(_0x51fa('0x7'))};function getAccountFK(_0x30479a){return _[_0x51fa('0x8')](_0x30479a)+(_0x30479a===_0x51fa('0x9')?_0x51fa('0xa'):_0x51fa('0xb'))+'Id';}function getInteractionFK(_0x4c002a){return _[_0x51fa('0x8')](_0x4c002a)+_0x51fa('0xc');}function getInteractionId(_0x1c15af,_0x28920f,_0x2efa06){if(_0x1c15af&&_0x1c15af[_[_0x51fa('0xd')](_0x2efa06)+_0x51fa('0xc')]){return _0x1c15af[_[_0x51fa('0xd')](_0x2efa06)+_0x51fa('0xc')];}else if(_0x1c15af&&_0x1c15af['id']){return _0x1c15af['id'];}else if(_0x28920f&&_0x28920f['id']){return _0x28920f['id'];}else{return _0x51fa('0xe');}}function getInteractionsTables(_0x410497){return{'accounts':_0x410497+'_'+(_0x410497==='chat'?_0x51fa('0xf'):_0x51fa('0x10')),'interactions':_0x410497+_0x51fa('0x11'),'interactionsTags':_0x410497+_0x51fa('0x12'),'messages':_0x410497+'_messages','userInteractions':_0x51fa('0x13')+_0x410497+'_interactions'};}function getSelectedTags(_0x283b3c){var _0x5c907c=[];if(_0x283b3c){_0x5c907c=Array[_0x51fa('0x14')](_0x283b3c)?_0x283b3c:[_0x283b3c];}return _0x5c907c;}function log(_0x5ee266,_0x3a569e,_0x5420be,_0x57a0ba,_0x45b401,_0xfbe1){loggers[_0x45b401[_0x51fa('0x15')]()][_0x5ee266]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xfbe1[_0x51fa('0x16')](),_0x3a569e?_0x3a569e['id']:null,_0x3a569e?_0x3a569e[_0x51fa('0x17')]:null,_0x3a569e?_0x3a569e[_0x51fa('0x18')]:null,getInteractionId(_0x5420be,_0x57a0ba,_0x45b401),_0x5420be?JSON[_0x51fa('0x19')](_0x5420be):_0x51fa('0x1a'));}function updateUser(_0xcde132,_0x17898d,_0x2327af,_0x4e0ff9,_0x248804){db[_[_0x51fa('0xd')](_0x4e0ff9)+_0x51fa('0x1b')][_0x51fa('0x1c')]({'where':{'id':getInteractionId(_0x17898d,_0x2327af,_0x4e0ff9)}})[_0x51fa('0x1d')](function(_0x6a8399){if(_0x6a8399){return _0x6a8399[_0x51fa('0x1e')]({'UserId':_0xcde132?_0xcde132['id']:null});}})['then'](function(_0x3aba15){if(_0x3aba15){log('info',_0xcde132,_0x17898d,_0x2327af,_0x4e0ff9,_0x248804);}})[_0x51fa('0x1f')](function(){log(_0x51fa('0x20'),_0xcde132,_0x17898d,_0x2327af,_0x4e0ff9,_0x248804);});}module[_0x51fa('0x21')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x8791=['then','update','catch','error','lodash','../../mysqldb','../../config/logger','openchannel-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Website','Account','InteractionId','upperFirst','websites','accounts','_interactions','_interaction_has_tags','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','findOne'];(function(_0x437ae9,_0x4fa1a8){var _0x5042ee=function(_0x48d996){while(--_0x48d996){_0x437ae9['push'](_0x437ae9['shift']());}};_0x5042ee(++_0x4fa1a8);}(_0x8791,0xf7));var _0x1879=function(_0x19e974,_0x274146){_0x19e974=_0x19e974-0x0;var _0x3f1a92=_0x8791[_0x19e974];return _0x3f1a92;};'use strict';var _=require(_0x1879('0x0'));var db=require(_0x1879('0x1'))['db'];var loggers={'openchannel':require(_0x1879('0x2'))(_0x1879('0x3')),'mail':require(_0x1879('0x2'))('mail-interactions'),'fax':require('../../config/logger')('fax-interactions'),'sms':require('../../config/logger')(_0x1879('0x4')),'chat':require(_0x1879('0x2'))(_0x1879('0x5')),'whatsapp':require('../../config/logger')(_0x1879('0x6'))};function getAccountFK(_0x43025f){return _[_0x1879('0x7')](_0x43025f)+(_0x43025f===_0x1879('0x8')?_0x1879('0x9'):_0x1879('0xa'))+'Id';}function getInteractionFK(_0x5a4a0e){return _['capitalize'](_0x5a4a0e)+_0x1879('0xb');}function getInteractionId(_0x242b5d,_0x236cdf,_0x13738d){if(_0x242b5d&&_0x242b5d[_[_0x1879('0xc')](_0x13738d)+_0x1879('0xb')]){return _0x242b5d[_[_0x1879('0xc')](_0x13738d)+_0x1879('0xb')];}else if(_0x242b5d&&_0x242b5d['id']){return _0x242b5d['id'];}else if(_0x236cdf&&_0x236cdf['id']){return _0x236cdf['id'];}else{return'unknown';}}function getInteractionsTables(_0x2e9548){return{'accounts':_0x2e9548+'_'+(_0x2e9548===_0x1879('0x8')?_0x1879('0xd'):_0x1879('0xe')),'interactions':_0x2e9548+_0x1879('0xf'),'interactionsTags':_0x2e9548+_0x1879('0x10'),'messages':_0x2e9548+'_messages','userInteractions':'user_has_'+_0x2e9548+_0x1879('0xf')};}function getSelectedTags(_0x53b481){var _0xce10d8=[];if(_0x53b481){_0xce10d8=Array[_0x1879('0x11')](_0x53b481)?_0x53b481:[_0x53b481];}return _0xce10d8;}function log(_0x5e765e,_0x86ba9b,_0x56f64c,_0x461392,_0x56dcfa,_0x23f481){loggers[_0x56dcfa[_0x1879('0x12')]()][_0x5e765e](_0x1879('0x13'),_0x23f481[_0x1879('0x14')](),_0x86ba9b?_0x86ba9b['id']:null,_0x86ba9b?_0x86ba9b[_0x1879('0x15')]:null,_0x86ba9b?_0x86ba9b['role']:null,getInteractionId(_0x56f64c,_0x461392,_0x56dcfa),_0x56f64c?JSON['stringify'](_0x56f64c):'null');}function updateUser(_0x1041cd,_0x26d71b,_0x1f2916,_0x57ae76,_0x5b9a9c){db[_['upperFirst'](_0x57ae76)+'Interaction'][_0x1879('0x16')]({'where':{'id':getInteractionId(_0x26d71b,_0x1f2916,_0x57ae76)}})[_0x1879('0x17')](function(_0x40a484){if(_0x40a484){return _0x40a484[_0x1879('0x18')]({'UserId':_0x1041cd?_0x1041cd['id']:null});}})[_0x1879('0x17')](function(_0x4b9f7f){if(_0x4b9f7f){log('info',_0x1041cd,_0x26d71b,_0x1f2916,_0x57ae76,_0x5b9a9c);}})[_0x1879('0x19')](function(){log(_0x1879('0x1a'),_0x1041cd,_0x26d71b,_0x1f2916,_0x57ae76,_0x5b9a9c);});}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 c8c2617..512441f 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 _0x8510=['Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','admin','user','isUserLimit','crypto','composable-middleware','../../mysqldb','../../config/environment','license','data1','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse','hasOwnProperty','License','then','count','json'];(function(_0x1b4bfa,_0x2f2e9f){var _0x2a9733=function(_0x157e02){while(--_0x157e02){_0x1b4bfa['push'](_0x1b4bfa['shift']());}};_0x2a9733(++_0x2f2e9f);}(_0x8510,0xf9));var _0x0851=function(_0x38325,_0x262d3c){_0x38325=_0x38325-0x0;var _0x2994d6=_0x8510[_0x38325];return _0x2994d6;};'use strict';var crypto=require(_0x0851('0x0'));var util=require('util');var compose=require(_0x0851('0x1'));var db=require(_0x0851('0x2'))['db'];var config=require(_0x0851('0x3'));function getValueFromLicense(_0x2522b4,_0x558782){if(_0x2522b4&&_0x558782){if(_0x558782['data1']&&_0x558782[_0x0851('0x4')]){var _0x5dd972=_0x558782[_0x0851('0x5')];var _0xd73681=_0x558782[_0x0851('0x4')];var _0x2bc334=_0x5dd972[_0x0851('0x6')]('-')[0x4];var _0x4af5f5=_0x5dd972[_0x0851('0x6')]('-')[0x0];var _0x2b20fa=crypto[_0x0851('0x7')](_0x0851('0x8'),util[_0x0851('0x9')](_0x0851('0xa'),_0x2bc334,_0x5dd972,_0x4af5f5));var _0x2a16eb=_0x2b20fa[_0x0851('0xb')](_0xd73681,_0x0851('0xc'),_0x0851('0xd'));_0x2a16eb+=_0x2b20fa[_0x0851('0xe')](_0x0851('0xd'));var _0x3f8eec=JSON[_0x0851('0xf')](_0x2a16eb);return _0x3f8eec[_0x0851('0x10')](_0x2522b4)?_0x3f8eec[_0x2522b4]:null;}}return null;}function isLimit(_0x39e63a,_0x1295a2,_0x4d0ca5,_0xa3014c){var _0x5a36b5=_0x1295a2;return compose()['use'](function(_0x2f7cfb,_0x4101ab,_0x560845){return db[_0x0851('0x11')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0x0851('0x12')](function(_0x3869cc){var _0x3dfb7f=getValueFromLicense(_0x39e63a,_0x3869cc);return _0x3dfb7f?_0x3dfb7f:_0x5a36b5;})[_0x0851('0x12')](function(_0x30a31a){_0x5a36b5=_0x30a31a;return _0x4d0ca5[_0x0851('0x13')](_0xa3014c);})[_0x0851('0x12')](function(_0xde27a6){if(_0xde27a6>=_0x5a36b5){return _0x4101ab['status'](0x193)[_0x0851('0x14')]({'message':util['format'](_0x0851('0x15'),_0x39e63a)});}_0x560845();})[_0x0851('0x16')](function(_0x2b45d2){_0x560845(_0x2b45d2);});});}function isUserLimit(){return isLimit(_0x0851('0x17'),0x1,db['User'],{'where':{'$or':[{'role':_0x0851('0x18')},{'role':_0x0851('0x19')}]}});}exports[_0x0851('0x1a')]=isUserLimit; \ No newline at end of file +var _0x7ce5=['then','status','json','catch','users','User','admin','user','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','aes-256-ctr','%s:%s:%s','update','base64','utf8','final','parse','hasOwnProperty','use'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x7ce5,0x102));var _0x57ce=function(_0x4abfe7,_0x15a338){_0x4abfe7=_0x4abfe7-0x0;var _0x9553ef=_0x7ce5[_0x4abfe7];return _0x9553ef;};'use strict';var crypto=require(_0x57ce('0x0'));var util=require(_0x57ce('0x1'));var compose=require(_0x57ce('0x2'));var db=require(_0x57ce('0x3'))['db'];var config=require(_0x57ce('0x4'));function getValueFromLicense(_0x12dbb2,_0x37b3d3){if(_0x12dbb2&&_0x37b3d3){if(_0x37b3d3[_0x57ce('0x5')]&&_0x37b3d3[_0x57ce('0x6')]){var _0x180439=_0x37b3d3[_0x57ce('0x5')];var _0x4a719f=_0x37b3d3[_0x57ce('0x6')];var _0x247d64=_0x180439[_0x57ce('0x7')]('-')[0x4];var _0x2e6893=_0x180439['split']('-')[0x0];var _0x47cb4f=crypto['createDecipher'](_0x57ce('0x8'),util['format'](_0x57ce('0x9'),_0x247d64,_0x180439,_0x2e6893));var _0x48fb75=_0x47cb4f[_0x57ce('0xa')](_0x4a719f,_0x57ce('0xb'),_0x57ce('0xc'));_0x48fb75+=_0x47cb4f[_0x57ce('0xd')](_0x57ce('0xc'));var _0x305936=JSON[_0x57ce('0xe')](_0x48fb75);return _0x305936[_0x57ce('0xf')](_0x12dbb2)?_0x305936[_0x12dbb2]:null;}}return null;}function isLimit(_0x359d7a,_0x18c552,_0x4716e0,_0x1f9efc){var _0x3be1cf=_0x18c552;return compose()[_0x57ce('0x10')](function(_0x850258,_0x962ae8,_0x31b9bd){return db['License']['findOne']({'where':{'id':0x1},'raw':!![]})['then'](function(_0x3b29d0){var _0xf619f6=getValueFromLicense(_0x359d7a,_0x3b29d0);return _0xf619f6?_0xf619f6:_0x3be1cf;})[_0x57ce('0x11')](function(_0x453090){_0x3be1cf=_0x453090;return _0x4716e0['count'](_0x1f9efc);})['then'](function(_0x1838d9){if(_0x1838d9>=_0x3be1cf){return _0x962ae8[_0x57ce('0x12')](0x193)[_0x57ce('0x13')]({'message':util['format']('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x359d7a)});}_0x31b9bd();})[_0x57ce('0x14')](function(_0x1ad508){_0x31b9bd(_0x1ad508);});});}function isUserLimit(){return isLimit(_0x57ce('0x15'),0x1,db[_0x57ce('0x16')],{'where':{'$or':[{'role':_0x57ce('0x17')},{'role':_0x57ce('0x18')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index c0311c5..b5f67cb 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 _0xdb92=['$in','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','<\x20?','>\x20?','$lte','<=\x20?','$gte','start','pop','DATE','utcOffset','format','hours','minutes','seconds','moment','sqlOperator','startsWith','[$or]','and','replace','[$and]','split','length','slice','forEach','shift','filter','indexOf','map','conditions','buildExpression','operator','$eq','$between','value','includes','$gt','add','days','YYYY-MM-DD','castTo','text','CAST(','field','$ne','$notIn','\x20OR\x20'];(function(_0x335f5c,_0xce622c){var _0x27458c=function(_0x108b7f){while(--_0x108b7f){_0x335f5c['push'](_0x335f5c['shift']());}};_0x27458c(++_0xce622c);}(_0xdb92,0x159));var _0x2db9=function(_0x111ca9,_0x495f80){_0x111ca9=_0x111ca9-0x0;var _0x47342b=_0xdb92[_0x111ca9];return _0x47342b;};'use strict';var _=require('lodash');var moment=require(_0x2db9('0x0'));exports['parseSearch']=function(_0x2ce892){var _0x47aed8={'conditions':[]};_0x47aed8[_0x2db9('0x1')]=_[_0x2db9('0x2')](_0x2ce892,_0x2db9('0x3'))?'or':_0x2db9('0x4');var _0x2461e7=_0x2ce892[_0x2db9('0x5')](_0x2db9('0x6'),'')[_0x2db9('0x5')]('[$or]','')[_0x2db9('0x7')]('||');for(var _0x46dace=0x0;_0x46dace<_0x2461e7[_0x2db9('0x8')];_0x46dace++){var _0x58f48a=_0x2461e7[_0x46dace][_0x2db9('0x7')](':=');var _0xabb022=_0x58f48a[0x0];var _0x1243cc=_0x58f48a[_0x2db9('0x9')](0x1);_0x1243cc[_0x2db9('0xa')](function(_0x1d243d){var _0x5b9d58=_0x1d243d[_0x2db9('0x7')]('[')[_0x2db9('0xb')]();var _0x169eae=_0x1d243d['match'](/\[(.*?)\]/g);_0x169eae['forEach'](function(_0x75e81a){var _0x31b203=_0x75e81a[_0x2db9('0x7')]('[')[_0x2db9('0xc')](function(_0x20e3d5){return _0x20e3d5[_0x2db9('0xd')](']')>-0x1;})[_0x2db9('0xe')](function(_0x316921){return _0x316921['split'](']')[0x0];})[0x0];_0x47aed8[_0x2db9('0xf')]['push']({'field':_0xabb022,'operator':_0x5b9d58,'value':_0x31b203});});});}return _0x47aed8;};exports[_0x2db9('0x10')]=function(_0x1fb005,_0x168791,_0x28c35c){var _0x1b0b9a={};if(_0x168791==='DATE'){if(_0x28c35c[_0x2db9('0x11')]===_0x2db9('0x12')){_0x28c35c[_0x2db9('0x11')]=_0x2db9('0x13');_0x28c35c[_0x2db9('0x14')]+=','+_0x28c35c[_0x2db9('0x14')];}else if(_[_0x2db9('0x15')]([_0x2db9('0x16'),'$lte'],_0x28c35c[_0x2db9('0x11')])){_0x28c35c[_0x2db9('0x14')]=moment(_0x28c35c[_0x2db9('0x14')])[_0x2db9('0x17')](0x1,_0x2db9('0x18'))['format'](_0x2db9('0x19'));}}if(_0x28c35c[_0x2db9('0x1a')]){_0x168791=_0x28c35c[_0x2db9('0x1a')];_0x1b0b9a[_0x2db9('0x1b')]=_0x2db9('0x1c')+_0x1fb005+'.'+_0x28c35c[_0x2db9('0x1d')]+'\x20AS\x20'+_0x28c35c[_0x2db9('0x1a')]+')\x20'+parseOperator(_0x28c35c[_0x2db9('0x11')]);}else{_0x1b0b9a['text']=_0x1fb005+'.'+_0x28c35c['field']+'\x20'+parseOperator(_0x28c35c[_0x2db9('0x11')]);}if(_[_0x2db9('0x15')]([_0x2db9('0x1e'),_0x2db9('0x1f')],_0x28c35c['operator']))_0x1b0b9a[_0x2db9('0x1b')]='('+_0x1b0b9a['text']+_0x2db9('0x20')+_0x1fb005+'.'+_0x28c35c[_0x2db9('0x1d')]+'\x20IS\x20NULL)';_0x1b0b9a[_0x2db9('0x14')]=parseValue(_0x168791,_0x28c35c[_0x2db9('0x11')],_0x28c35c['value']);return _0x1b0b9a;};function parseOperator(_0xa7031){var _0x24b6ec;switch(_0xa7031){case _0x2db9('0x21'):_0x24b6ec='IN\x20?';break;case'$notIn':_0x24b6ec=_0x2db9('0x22');break;case _0x2db9('0x12'):_0x24b6ec=_0x2db9('0x23');break;case _0x2db9('0x1e'):_0x24b6ec=_0x2db9('0x24');break;case _0x2db9('0x25'):case _0x2db9('0x26'):case _0x2db9('0x27'):_0x24b6ec=_0x2db9('0x28');break;case'$lt':_0x24b6ec=_0x2db9('0x29');break;case _0x2db9('0x16'):_0x24b6ec=_0x2db9('0x2a');break;case _0x2db9('0x2b'):_0x24b6ec=_0x2db9('0x2c');break;case _0x2db9('0x2d'):_0x24b6ec='>=\x20?';break;case _0x2db9('0x13'):_0x24b6ec='BETWEEN\x20?\x20AND\x20?';break;}return _0x24b6ec;}function parseValue(_0x57cc8a,_0x12e270,_0x41fc22){var _0x3fe653={'start':undefined,'end':undefined};switch(_0x12e270){case _0x2db9('0x21'):case _0x2db9('0x1f'):_0x3fe653['start']=_0x41fc22[_0x2db9('0x7')](',');break;case _0x2db9('0x25'):_0x3fe653['start']='%'+_0x41fc22+'%';break;case'$startsWith':_0x3fe653[_0x2db9('0x2e')]=_0x41fc22+'%';break;case _0x2db9('0x27'):_0x3fe653[_0x2db9('0x2e')]='%'+_0x41fc22;break;case _0x2db9('0x13'):var _0x5152ee=_0x41fc22[_0x2db9('0x7')](',');var _0x41fc22=_0x5152ee[_0x2db9('0xb')]();var _0x59f9f3=_0x5152ee[_0x2db9('0x2f')]();if(_0x57cc8a===_0x2db9('0x30')){_0x41fc22=moment(_0x41fc22)[_0x2db9('0x31')](0x0,!![])[_0x2db9('0x32')]();_0x59f9f3=moment(_0x59f9f3)[_0x2db9('0x31')](0x0,!![])[_0x2db9('0x17')](0x17,_0x2db9('0x33'))[_0x2db9('0x17')](0x3b,_0x2db9('0x34'))[_0x2db9('0x17')](0x3b,_0x2db9('0x35'))[_0x2db9('0x32')]();}_0x3fe653={'start':_0x41fc22,'end':_0x59f9f3};break;default:_0x3fe653[_0x2db9('0x2e')]=_0x41fc22;break;}return _0x3fe653;} \ No newline at end of file +var _0x7c9d=['moment','parseSearch','startsWith','[$or]','replace','[$and]','split','length','forEach','shift','match','filter','map','conditions','buildExpression','DATE','operator','$eq','$between','value','includes','$lte','add','days','format','YYYY-MM-DD','castTo','text','CAST(','\x20AS\x20','$ne','$notIn','\x20OR\x20','field','\x20IS\x20NULL)','$in','NOT\x20IN\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','$gt','>\x20?','$gte','BETWEEN\x20?\x20AND\x20?','start','pop','utcOffset','hours','minutes','seconds','lodash'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x7c9d,0x149));var _0xd7c9=function(_0x21d3ea,_0x5bb490){_0x21d3ea=_0x21d3ea-0x0;var _0x4ac04d=_0x7c9d[_0x21d3ea];return _0x4ac04d;};'use strict';var _=require(_0xd7c9('0x0'));var moment=require(_0xd7c9('0x1'));exports[_0xd7c9('0x2')]=function(_0x4d0e73){var _0x45e477={'conditions':[]};_0x45e477['sqlOperator']=_[_0xd7c9('0x3')](_0x4d0e73,_0xd7c9('0x4'))?'or':'and';var _0x59b98a=_0x4d0e73[_0xd7c9('0x5')](_0xd7c9('0x6'),'')[_0xd7c9('0x5')](_0xd7c9('0x4'),'')[_0xd7c9('0x7')]('||');for(var _0x22ef49=0x0;_0x22ef49<_0x59b98a[_0xd7c9('0x8')];_0x22ef49++){var _0x5b28b9=_0x59b98a[_0x22ef49][_0xd7c9('0x7')](':=');var _0x37f86a=_0x5b28b9[0x0];var _0x569efd=_0x5b28b9['slice'](0x1);_0x569efd[_0xd7c9('0x9')](function(_0x5335ea){var _0x2be7af=_0x5335ea[_0xd7c9('0x7')]('[')[_0xd7c9('0xa')]();var _0x92bed9=_0x5335ea[_0xd7c9('0xb')](/\[(.*?)\]/g);_0x92bed9[_0xd7c9('0x9')](function(_0x321e36){var _0x2841e1=_0x321e36[_0xd7c9('0x7')]('[')[_0xd7c9('0xc')](function(_0x4c8c34){return _0x4c8c34['indexOf'](']')>-0x1;})[_0xd7c9('0xd')](function(_0x52e8cd){return _0x52e8cd[_0xd7c9('0x7')](']')[0x0];})[0x0];_0x45e477[_0xd7c9('0xe')]['push']({'field':_0x37f86a,'operator':_0x2be7af,'value':_0x2841e1});});});}return _0x45e477;};exports[_0xd7c9('0xf')]=function(_0x3c727f,_0xda73d,_0x4109cf){var _0x1c7487={};if(_0xda73d===_0xd7c9('0x10')){if(_0x4109cf[_0xd7c9('0x11')]===_0xd7c9('0x12')){_0x4109cf[_0xd7c9('0x11')]=_0xd7c9('0x13');_0x4109cf[_0xd7c9('0x14')]+=','+_0x4109cf[_0xd7c9('0x14')];}else if(_[_0xd7c9('0x15')](['$gt',_0xd7c9('0x16')],_0x4109cf['operator'])){_0x4109cf[_0xd7c9('0x14')]=moment(_0x4109cf[_0xd7c9('0x14')])[_0xd7c9('0x17')](0x1,_0xd7c9('0x18'))[_0xd7c9('0x19')](_0xd7c9('0x1a'));}}if(_0x4109cf[_0xd7c9('0x1b')]){_0xda73d=_0x4109cf[_0xd7c9('0x1b')];_0x1c7487[_0xd7c9('0x1c')]=_0xd7c9('0x1d')+_0x3c727f+'.'+_0x4109cf['field']+_0xd7c9('0x1e')+_0x4109cf['castTo']+')\x20'+parseOperator(_0x4109cf[_0xd7c9('0x11')]);}else{_0x1c7487['text']=_0x3c727f+'.'+_0x4109cf['field']+'\x20'+parseOperator(_0x4109cf[_0xd7c9('0x11')]);}if(_[_0xd7c9('0x15')]([_0xd7c9('0x1f'),_0xd7c9('0x20')],_0x4109cf[_0xd7c9('0x11')]))_0x1c7487[_0xd7c9('0x1c')]='('+_0x1c7487['text']+_0xd7c9('0x21')+_0x3c727f+'.'+_0x4109cf[_0xd7c9('0x22')]+_0xd7c9('0x23');_0x1c7487[_0xd7c9('0x14')]=parseValue(_0xda73d,_0x4109cf[_0xd7c9('0x11')],_0x4109cf['value']);return _0x1c7487;};function parseOperator(_0x5a230e){var _0x129e47;switch(_0x5a230e){case _0xd7c9('0x24'):_0x129e47='IN\x20?';break;case _0xd7c9('0x20'):_0x129e47=_0xd7c9('0x25');break;case _0xd7c9('0x12'):_0x129e47='=\x20?';break;case _0xd7c9('0x1f'):_0x129e47=_0xd7c9('0x26');break;case _0xd7c9('0x27'):case _0xd7c9('0x28'):case _0xd7c9('0x29'):_0x129e47=_0xd7c9('0x2a');break;case _0xd7c9('0x2b'):_0x129e47=_0xd7c9('0x2c');break;case _0xd7c9('0x2d'):_0x129e47=_0xd7c9('0x2e');break;case'$lte':_0x129e47='<=\x20?';break;case _0xd7c9('0x2f'):_0x129e47='>=\x20?';break;case _0xd7c9('0x13'):_0x129e47=_0xd7c9('0x30');break;}return _0x129e47;}function parseValue(_0x59e340,_0x4b8443,_0xfa5e29){var _0x725713={'start':undefined,'end':undefined};switch(_0x4b8443){case _0xd7c9('0x24'):case _0xd7c9('0x20'):_0x725713[_0xd7c9('0x31')]=_0xfa5e29[_0xd7c9('0x7')](',');break;case _0xd7c9('0x27'):_0x725713[_0xd7c9('0x31')]='%'+_0xfa5e29+'%';break;case _0xd7c9('0x28'):_0x725713[_0xd7c9('0x31')]=_0xfa5e29+'%';break;case _0xd7c9('0x29'):_0x725713['start']='%'+_0xfa5e29;break;case _0xd7c9('0x13'):var _0x572b4c=_0xfa5e29[_0xd7c9('0x7')](',');var _0xfa5e29=_0x572b4c[_0xd7c9('0xa')]();var _0x2a7fa6=_0x572b4c[_0xd7c9('0x32')]();if(_0x59e340==='DATE'){_0xfa5e29=moment(_0xfa5e29)[_0xd7c9('0x33')](0x0,!![])[_0xd7c9('0x19')]();_0x2a7fa6=moment(_0x2a7fa6)[_0xd7c9('0x33')](0x0,!![])['add'](0x17,_0xd7c9('0x34'))[_0xd7c9('0x17')](0x3b,_0xd7c9('0x35'))['add'](0x3b,_0xd7c9('0x36'))[_0xd7c9('0x19')]();}_0x725713={'start':_0xfa5e29,'end':_0x2a7fa6};break;default:_0x725713['start']=_0xfa5e29;break;}return _0x725713;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 102e36e..266a66d 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 _0x04f1=['ASC','omit','length','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','getFullTextValue','{EXPR}','forEach','replace','join','query','$id','attributes','intersection','nolimit','where','pick','filter','merge','VIRTUAL','lower','include','includeAll','push','lodash','sequelize','moment','parse','keys','model','raw','fields','split','filters','isEmpty','find','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','name','isArray','limit','offset','sort','map','priority','col','unsigned','DESC','cast'];(function(_0x6d4288,_0x33d776){var _0x95aebe=function(_0x5acf07){while(--_0x5acf07){_0x6d4288['push'](_0x6d4288['shift']());}};_0x95aebe(++_0x33d776);}(_0x04f1,0x92));var _0x104f=function(_0x317869,_0x4c497f){_0x317869=_0x317869-0x0;var _0x3e2bab=_0x04f1[_0x317869];return _0x3e2bab;};'use strict';var _=require(_0x104f('0x0'));var sequelize=require(_0x104f('0x1'));var moment=require(_0x104f('0x2'));var db=require('../../mysqldb')['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x49868f){var _0x1c9941=['ne'];try{var _0x442b5d=JSON[_0x104f('0x3')](_0x49868f);var _0x55c56e=Object['keys'](_0x442b5d)[0x0];return _0x1c9941['includes'](_0x55c56e);}catch(_0x4f9e77){return![];}}function getOperatorValue(_0x4e767b){var _0x20a746=JSON[_0x104f('0x3')](_0x4e767b);var _0x5b7110=Object[_0x104f('0x4')](_0x20a746)[0x0];var _0x57acf5=_0x20a746[_0x5b7110];return{['$'+_0x5b7110]:_0x57acf5};}function parseIncludeModel(_0x47582b){var _0x258503=JSON[_0x104f('0x3')](_0x47582b);return{'model':db[_0x258503[_0x104f('0x5')]],'as':_0x258503['alias'],'attributes':_0x258503['fields'],'raw':_0x258503[_0x104f('0x6')]};}exports[_0x104f('0x7')]=function(_0x1e5996){var _0x2a62e7=null;if(_0x1e5996){_0x2a62e7=_0x1e5996[_0x104f('0x8')](',');}return _0x2a62e7;};exports[_0x104f('0x9')]=function(_0x395321,_0x175506){var _0x294cdc={};if(!_[_0x104f('0xa')](_0x395321)){_['forOwn'](_0x395321,function(_0x11b95f,_0x346442){try{if(_0x175506){var _0x149a32=_[_0x104f('0xb')](_0x175506,{'name':_0x346442})||{};if(hasSequelizeOperator(_0x11b95f)){_0x294cdc[_0x346442]=getOperatorValue(_0x11b95f);}else if(_0x149a32[_0x104f('0xc')]===_0x104f('0xd')&&_[_0x104f('0xe')](_0x11b95f)){var _0x373b4f=JSON[_0x104f('0x3')](_0x11b95f);var _0x67d2be={'$gte':moment(moment(_0x373b4f[_0x104f('0xf')])[_0x104f('0x10')](_0x104f('0x11')))[_0x104f('0x12')]()['format'](),'$lte':moment(moment(_0x373b4f[_0x104f('0x13')])[_0x104f('0x10')](_0x104f('0x11')))[_0x104f('0x12')]()['subtract'](0x1,'s')[_0x104f('0x10')]()};_0x294cdc[_0x346442]=_0x67d2be;}else if(_0x149a32[_0x104f('0x14')]==='uniqueid'){_0x294cdc[_0x346442]=_0x11b95f;}else{_0x294cdc[_0x346442]=_[_0x104f('0x15')](_0x11b95f)?_0x11b95f:JSON[_0x104f('0x3')](_0x11b95f);}}else{_0x294cdc[_0x346442]=_['isArray'](_0x11b95f)?_0x11b95f:JSON[_0x104f('0x3')](_0x11b95f);}}catch(_0x2760da){_0x294cdc[_0x346442]=_0x11b95f[_0x104f('0x8')](',');}});}return _0x294cdc;};exports[_0x104f('0x16')]=function(_0x2a256a){_0x2a256a=parseInt(_0x2a256a,0xa);if(!_0x2a256a||_0x2a256a<0x0){_0x2a256a=LIMIT_VALUE;}return _0x2a256a;};exports[_0x104f('0x17')]=function(_0x4f712e){_0x4f712e=parseInt(_0x4f712e,0xa);if(!_0x4f712e||_0x4f712e<0x0){_0x4f712e=0x0;}return _0x4f712e;};exports[_0x104f('0x18')]=function(_0x49f853){var _0x54c992,_0x18a7bf=null;if(_0x49f853){_0x54c992=_0x49f853[_0x104f('0x8')](',');_0x18a7bf=_[_0x104f('0x19')](_0x54c992,function(_0x4a84ef){if(_0x4a84ef['indexOf']('-')===0x0){return[_0x4a84ef===_0x104f('0x1a')?sequelize['cast'](sequelize[_0x104f('0x1b')](_0x104f('0x1a')),_0x104f('0x1c')):_0x4a84ef['substr'](0x1),_0x104f('0x1d')];}else{return[_0x4a84ef==='priority'?sequelize[_0x104f('0x1e')](sequelize[_0x104f('0x1b')](_0x104f('0x1a')),'unsigned'):_0x4a84ef,_0x104f('0x1f')];}});}return _0x18a7bf;};exports[_0x104f('0x20')]=function(_0x307a45,_0xd7adde){if(_['isEmpty'](_0x307a45)){return _0x307a45;}if(_[_0x104f('0x15')](_0x307a45)){for(var _0x48261e=0x0;_0x48261e<_0x307a45[_0x104f('0x21')];_0x48261e+=0x1){_0x307a45[_0x48261e]=this[_0x104f('0x20')](_0x307a45[_0x48261e],_0xd7adde);}return _0x307a45;}if(!_['isObject'](_0x307a45)){return _0x307a45;}if(_[_0x104f('0x22')](_0xd7adde)){_0xd7adde=[_0xd7adde];}if(!_['isArray'](_0xd7adde)){return _0x307a45;}for(var _0x28fe5c=0x0;_0x28fe5c<_0xd7adde[_0x104f('0x21')];_0x28fe5c+=0x1){_[_0x104f('0x23')](_0x307a45,_0xd7adde[_0x28fe5c]);}for(var _0x3f6005 in _0x307a45){if(_0x307a45[_0x104f('0x24')](_0x3f6005)){_0x307a45[_0x3f6005]=this[_0x104f('0x20')](_0x307a45[_0x3f6005],_0xd7adde);}}return _0x307a45;};exports[_0x104f('0x25')]=function(_0x4661f6){return _0x4661f6[_0x104f('0x26')](RegExp(_0x104f('0x27')))?!![]:![];};exports['isEmail']=function(_0x55d63c){return _0x55d63c[_0x104f('0x26')](/^\S+@\S+$/)?!![]:![];};exports[_0x104f('0x28')]=function(_0x1b0714,_0x245853){var _0x39d8cf=[];var _0x295b42=/[ `!@#$%^&*()_\-?~]/;var _0x4d988b=_0x245853?'\x22{EXPR}\x22':_0x104f('0x29');_0x1b0714[_0x104f('0x8')](/[ ,]+/)[_0x104f('0x2a')](function(_0x1e633d){_0x1e633d=_0x1e633d[_0x104f('0x2b')](/([^:]")"+/g,'$1');_0x1e633d='+'+_0x1e633d+'*';var _0x1e3c73=_0x1e633d['match'](_0x295b42);if(_0x1e3c73){_0x1e633d='\x22'+_0x1e633d+'\x22';}_0x39d8cf['push'](_0x1e633d);});_0x4d988b=_0x4d988b['replace'](_0x104f('0x29'),_0x39d8cf[_0x104f('0x2c')]('\x20'));return _0x4d988b;};exports['getOptions']=function(_0x1d7a1b,_0x538735,_0x5d9e79){var _0x30198d={},_0x488e5f={};if(_0x538735['query']['$id']){_0x538735[_0x104f('0x2d')]['id']=_0x538735['query'][_0x104f('0x2e')];delete _0x538735[_0x104f('0x2d')]['$id'];}_0x30198d['model']=_[_0x104f('0x19')](_0x1d7a1b,'name');_0x30198d[_0x104f('0x2d')]=_[_0x104f('0x4')](_0x538735['query']);_0x30198d[_0x104f('0x9')]=_['intersection'](_0x30198d['model'],_0x30198d['query']);_0x488e5f[_0x104f('0x2f')]=_[_0x104f('0x30')](_0x30198d['model'],this['fields'](_0x538735[_0x104f('0x2d')][_0x104f('0x7')]));_0x488e5f[_0x104f('0x2f')]=_0x488e5f[_0x104f('0x2f')][_0x104f('0x21')]?_0x488e5f[_0x104f('0x2f')]:_0x30198d['model'];if(!_0x538735[_0x104f('0x2d')]['hasOwnProperty'](_0x104f('0x31'))){_0x488e5f['limit']=this[_0x104f('0x16')](_0x538735['query']['limit']);_0x488e5f[_0x104f('0x17')]=this[_0x104f('0x17')](_0x538735[_0x104f('0x2d')][_0x104f('0x17')]);}_0x488e5f['order']=this[_0x104f('0x18')](_0x538735[_0x104f('0x2d')][_0x104f('0x18')]);_0x488e5f[_0x104f('0x32')]=this[_0x104f('0x9')](_[_0x104f('0x33')](_0x538735['query'],_0x30198d['filters']),_0x1d7a1b);if(_0x538735[_0x104f('0x2d')][_0x104f('0x34')]){var _0x428841=_0x1d7a1b;var _0x144d8c=_0x538735[_0x104f('0x2d')][_0x104f('0x34')];if(typeof _0x144d8c==='object'){_0x428841=_[_0x104f('0x34')](_0x1d7a1b,function(_0x5613ad){return _['includes'](_0x144d8c['columns'],_0x5613ad[_0x104f('0x14')]);});_0x144d8c=_0x144d8c['value'];}_0x488e5f[_0x104f('0x32')]=_[_0x104f('0x35')](_0x488e5f[_0x104f('0x32')],{'$or':_[_0x104f('0x19')](_0x428841,function(_0x10de7){if(_0x10de7[_0x104f('0xc')]!==_0x104f('0x36')){if(_0x5d9e79){return sequelize['where'](sequelize['fn'](_0x104f('0x37'),sequelize[_0x104f('0x1b')](_0x10de7['name'])),{'$like':sequelize['fn'](_0x104f('0x37'),'%'+_0x538735[_0x104f('0x2d')][_0x104f('0x34')]+'%')});}else{var _0x5a0be6={};_0x5a0be6[_0x10de7[_0x104f('0x14')]]={'$like':'%'+_0x538735[_0x104f('0x2d')][_0x104f('0x34')]+'%'};return _0x5a0be6;}}})});}_0x488e5f=_[_0x104f('0x35')]({},_0x488e5f,_0x538735['options']);return _0x488e5f;};exports[_0x104f('0x38')]=function(_0xce92f){var _0x51d9fa=[];if(_0xce92f[_0x104f('0x39')]){_0x51d9fa[_0x104f('0x3a')]({'all':!![]});}else if(_0xce92f[_0x104f('0x38')]){if(Array['isArray'](_0xce92f[_0x104f('0x38')])){_0x51d9fa=Object[_0x104f('0x4')](_0xce92f['include'])[_0x104f('0x19')](function(_0x48f454){return parseIncludeModel(_0xce92f[_0x104f('0x38')][_0x48f454]);});}else{var _0x485ba1=parseIncludeModel(_0xce92f['include']);_0x51d9fa[_0x104f('0x3a')](_0x485ba1);}}return _0x51d9fa;}; \ No newline at end of file +var _0x4629=['isArray','limit','offset','sort','map','indexOf','priority','cast','col','unsigned','substr','DESC','ASC','omit','isObject','isString','unset','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','\x22{EXPR}\x22','forEach','replace','push','{EXPR}','getOptions','query','$id','intersection','attributes','nolimit','order','pick','filter','object','columns','where','merge','lower','include','sequelize','moment','../../mysqldb','parse','keys','includes','model','alias','raw','fields','split','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid'];(function(_0x14fae3,_0x1bb829){var _0x2e3c1e=function(_0x5b48ce){while(--_0x5b48ce){_0x14fae3['push'](_0x14fae3['shift']());}};_0x2e3c1e(++_0x1bb829);}(_0x4629,0x136));var _0x9462=function(_0x4ed2c1,_0x8c9475){_0x4ed2c1=_0x4ed2c1-0x0;var _0x397295=_0x4629[_0x4ed2c1];return _0x397295;};'use strict';var _=require('lodash');var sequelize=require(_0x9462('0x0'));var moment=require(_0x9462('0x1'));var db=require(_0x9462('0x2'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x386ee4){var _0x34e7c2=['ne'];try{var _0x461519=JSON[_0x9462('0x3')](_0x386ee4);var _0x21f6c8=Object[_0x9462('0x4')](_0x461519)[0x0];return _0x34e7c2[_0x9462('0x5')](_0x21f6c8);}catch(_0xbc2300){return![];}}function getOperatorValue(_0x32bc87){var _0xd55c35=JSON[_0x9462('0x3')](_0x32bc87);var _0x558a78=Object['keys'](_0xd55c35)[0x0];var _0x3f6559=_0xd55c35[_0x558a78];return{['$'+_0x558a78]:_0x3f6559};}function parseIncludeModel(_0x594c71){var _0x310ab9=JSON[_0x9462('0x3')](_0x594c71);return{'model':db[_0x310ab9[_0x9462('0x6')]],'as':_0x310ab9[_0x9462('0x7')],'attributes':_0x310ab9['fields'],'raw':_0x310ab9[_0x9462('0x8')]};}exports[_0x9462('0x9')]=function(_0x55cd2c){var _0x40bdad=null;if(_0x55cd2c){_0x40bdad=_0x55cd2c[_0x9462('0xa')](',');}return _0x40bdad;};exports[_0x9462('0xb')]=function(_0x24d4d7,_0x4e535d){var _0x2bf9f1={};if(!_[_0x9462('0xc')](_0x24d4d7)){_[_0x9462('0xd')](_0x24d4d7,function(_0x737f27,_0xfdda0f){try{if(_0x4e535d){var _0x51ebba=_[_0x9462('0xe')](_0x4e535d,{'name':_0xfdda0f})||{};if(hasSequelizeOperator(_0x737f27)){_0x2bf9f1[_0xfdda0f]=getOperatorValue(_0x737f27);}else if(_0x51ebba[_0x9462('0xf')]===_0x9462('0x10')&&_[_0x9462('0x11')](_0x737f27)){var _0x519573=JSON['parse'](_0x737f27);var _0x5bb2f5={'$gte':moment(moment(_0x519573['$gte'])[_0x9462('0x12')](_0x9462('0x13')))[_0x9462('0x14')]()[_0x9462('0x12')](),'$lte':moment(moment(_0x519573[_0x9462('0x15')])[_0x9462('0x12')](_0x9462('0x13')))[_0x9462('0x14')]()[_0x9462('0x16')](0x1,'s')[_0x9462('0x12')]()};_0x2bf9f1[_0xfdda0f]=_0x5bb2f5;}else if(_0x51ebba[_0x9462('0x17')]===_0x9462('0x18')){_0x2bf9f1[_0xfdda0f]=_0x737f27;}else{_0x2bf9f1[_0xfdda0f]=_[_0x9462('0x19')](_0x737f27)?_0x737f27:JSON[_0x9462('0x3')](_0x737f27);}}else{_0x2bf9f1[_0xfdda0f]=_[_0x9462('0x19')](_0x737f27)?_0x737f27:JSON[_0x9462('0x3')](_0x737f27);}}catch(_0x8fb960){_0x2bf9f1[_0xfdda0f]=_0x737f27[_0x9462('0xa')](',');}});}return _0x2bf9f1;};exports[_0x9462('0x1a')]=function(_0x59ef14){_0x59ef14=parseInt(_0x59ef14,0xa);if(!_0x59ef14||_0x59ef14<0x0){_0x59ef14=LIMIT_VALUE;}return _0x59ef14;};exports[_0x9462('0x1b')]=function(_0x950db4){_0x950db4=parseInt(_0x950db4,0xa);if(!_0x950db4||_0x950db4<0x0){_0x950db4=0x0;}return _0x950db4;};exports[_0x9462('0x1c')]=function(_0x39c244){var _0x79feb2,_0x11aada=null;if(_0x39c244){_0x79feb2=_0x39c244[_0x9462('0xa')](',');_0x11aada=_[_0x9462('0x1d')](_0x79feb2,function(_0x29fd09){if(_0x29fd09[_0x9462('0x1e')]('-')===0x0){return[_0x29fd09===_0x9462('0x1f')?sequelize[_0x9462('0x20')](sequelize[_0x9462('0x21')](_0x9462('0x1f')),_0x9462('0x22')):_0x29fd09[_0x9462('0x23')](0x1),_0x9462('0x24')];}else{return[_0x29fd09===_0x9462('0x1f')?sequelize['cast'](sequelize[_0x9462('0x21')](_0x9462('0x1f')),_0x9462('0x22')):_0x29fd09,_0x9462('0x25')];}});}return _0x11aada;};exports[_0x9462('0x26')]=function(_0x1afd7e,_0x649344){if(_[_0x9462('0xc')](_0x1afd7e)){return _0x1afd7e;}if(_[_0x9462('0x19')](_0x1afd7e)){for(var _0x1812b0=0x0;_0x1812b0<_0x1afd7e['length'];_0x1812b0+=0x1){_0x1afd7e[_0x1812b0]=this['omit'](_0x1afd7e[_0x1812b0],_0x649344);}return _0x1afd7e;}if(!_[_0x9462('0x27')](_0x1afd7e)){return _0x1afd7e;}if(_[_0x9462('0x28')](_0x649344)){_0x649344=[_0x649344];}if(!_[_0x9462('0x19')](_0x649344)){return _0x1afd7e;}for(var _0x58609e=0x0;_0x58609e<_0x649344['length'];_0x58609e+=0x1){_[_0x9462('0x29')](_0x1afd7e,_0x649344[_0x58609e]);}for(var _0x54503a in _0x1afd7e){if(_0x1afd7e['hasOwnProperty'](_0x54503a)){_0x1afd7e[_0x54503a]=this[_0x9462('0x26')](_0x1afd7e[_0x54503a],_0x649344);}}return _0x1afd7e;};exports[_0x9462('0x2a')]=function(_0x1b3487){return _0x1b3487[_0x9462('0x2b')](RegExp(_0x9462('0x2c')))?!![]:![];};exports[_0x9462('0x2d')]=function(_0x481695){return _0x481695[_0x9462('0x2b')](/^\S+@\S+$/)?!![]:![];};exports[_0x9462('0x2e')]=function(_0x2e2b74,_0x58e836){var _0xe01e31=[];var _0x3b113e=/[ `!@#$%^&*()_\-?~]/;var _0x2bca0c=_0x58e836?_0x9462('0x2f'):'{EXPR}';_0x2e2b74[_0x9462('0xa')](/[ ,]+/)[_0x9462('0x30')](function(_0x1bb53c){_0x1bb53c=_0x1bb53c[_0x9462('0x31')](/([^:]")"+/g,'$1');_0x1bb53c='+'+_0x1bb53c+'*';var _0x476de1=_0x1bb53c['match'](_0x3b113e);if(_0x476de1){_0x1bb53c='\x22'+_0x1bb53c+'\x22';}_0xe01e31[_0x9462('0x32')](_0x1bb53c);});_0x2bca0c=_0x2bca0c[_0x9462('0x31')](_0x9462('0x33'),_0xe01e31['join']('\x20'));return _0x2bca0c;};exports[_0x9462('0x34')]=function(_0x429ff0,_0x5daffe,_0x3df544){var _0x21ac7b={},_0x2ba1d9={};if(_0x5daffe[_0x9462('0x35')][_0x9462('0x36')]){_0x5daffe[_0x9462('0x35')]['id']=_0x5daffe['query']['$id'];delete _0x5daffe['query'][_0x9462('0x36')];}_0x21ac7b[_0x9462('0x6')]=_[_0x9462('0x1d')](_0x429ff0,_0x9462('0x17'));_0x21ac7b[_0x9462('0x35')]=_[_0x9462('0x4')](_0x5daffe[_0x9462('0x35')]);_0x21ac7b['filters']=_['intersection'](_0x21ac7b[_0x9462('0x6')],_0x21ac7b[_0x9462('0x35')]);_0x2ba1d9['attributes']=_[_0x9462('0x37')](_0x21ac7b[_0x9462('0x6')],this[_0x9462('0x9')](_0x5daffe[_0x9462('0x35')][_0x9462('0x9')]));_0x2ba1d9[_0x9462('0x38')]=_0x2ba1d9[_0x9462('0x38')]['length']?_0x2ba1d9[_0x9462('0x38')]:_0x21ac7b[_0x9462('0x6')];if(!_0x5daffe[_0x9462('0x35')]['hasOwnProperty'](_0x9462('0x39'))){_0x2ba1d9[_0x9462('0x1a')]=this[_0x9462('0x1a')](_0x5daffe[_0x9462('0x35')][_0x9462('0x1a')]);_0x2ba1d9[_0x9462('0x1b')]=this[_0x9462('0x1b')](_0x5daffe[_0x9462('0x35')]['offset']);}_0x2ba1d9[_0x9462('0x3a')]=this[_0x9462('0x1c')](_0x5daffe[_0x9462('0x35')][_0x9462('0x1c')]);_0x2ba1d9['where']=this[_0x9462('0xb')](_[_0x9462('0x3b')](_0x5daffe['query'],_0x21ac7b[_0x9462('0xb')]),_0x429ff0);if(_0x5daffe[_0x9462('0x35')][_0x9462('0x3c')]){var _0x510b4a=_0x429ff0;var _0x43c5c4=_0x5daffe[_0x9462('0x35')][_0x9462('0x3c')];if(typeof _0x43c5c4===_0x9462('0x3d')){_0x510b4a=_[_0x9462('0x3c')](_0x429ff0,function(_0x54e0da){return _[_0x9462('0x5')](_0x43c5c4[_0x9462('0x3e')],_0x54e0da[_0x9462('0x17')]);});_0x43c5c4=_0x43c5c4['value'];}_0x2ba1d9[_0x9462('0x3f')]=_[_0x9462('0x40')](_0x2ba1d9[_0x9462('0x3f')],{'$or':_[_0x9462('0x1d')](_0x510b4a,function(_0x5e9b89){if(_0x5e9b89[_0x9462('0xf')]!=='VIRTUAL'){if(_0x3df544){return sequelize['where'](sequelize['fn'](_0x9462('0x41'),sequelize[_0x9462('0x21')](_0x5e9b89[_0x9462('0x17')])),{'$like':sequelize['fn']('lower','%'+_0x5daffe[_0x9462('0x35')]['filter']+'%')});}else{var _0x12ee34={};_0x12ee34[_0x5e9b89['name']]={'$like':'%'+_0x5daffe[_0x9462('0x35')][_0x9462('0x3c')]+'%'};return _0x12ee34;}}})});}_0x2ba1d9=_[_0x9462('0x40')]({},_0x2ba1d9,_0x5daffe['options']);return _0x2ba1d9;};exports[_0x9462('0x42')]=function(_0x161711){var _0x221534=[];if(_0x161711['includeAll']){_0x221534[_0x9462('0x32')]({'all':!![]});}else if(_0x161711[_0x9462('0x42')]){if(Array[_0x9462('0x19')](_0x161711[_0x9462('0x42')])){_0x221534=Object[_0x9462('0x4')](_0x161711[_0x9462('0x42')])[_0x9462('0x1d')](function(_0x28024e){return parseIncludeModel(_0x161711[_0x9462('0x42')][_0x28024e]);});}else{var _0x193482=parseIncludeModel(_0x161711[_0x9462('0x42')]);_0x221534[_0x9462('0x32')](_0x193482);}}return _0x221534;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 2cd14cc..2ffe1b2 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 _0x55ca=['mailPause','openchannelPause','smsPause','whatsappPause','every','filter','length','idle','unknown','unavailable','ringing','isNil','voiceStatus','voicePause','openchannelStatus','smsStatus','whatsappStatus','request','Agents','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','pause','busy','isArray','Queue','findOne','getAgents','all','flatten','map','uniq','value','getAgentIdsByQueues','includes','getAgentIdsByStatus','User','findAll','name','fullname','pauseType','find','getSortedAgentsIdsByStatus','split','globalStatus','order','ASC','fullname,internal','substring','indexOf','internal','sort','DESC','toLowerCase','sortAgentsByStatus','online','lastLoginAt','lastPauseAt','address','chatCapacity','mailCapacity','smsCapacity','whatsappCapacity','chatCurrentCapacity','openchannelCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatus','mailStatus','faxStatus','openchannelStatusTime','mailStatusTime','smsStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','filterAgentAttributes','userpic','chatStatusTime','whatsappStatusTime','openchannelCapacity','mailCurrentCapacity','onhold','queue','screenrecording','getRealtimeAgentsQueryFields','lodash','jayson/promise','client','http','chatPause','faxPause'];(function(_0x195ff5,_0xe3e93c){var _0x376924=function(_0x4ee15d){while(--_0x4ee15d){_0x195ff5['push'](_0x195ff5['shift']());}};_0x376924(++_0xe3e93c);}(_0x55ca,0x126));var _0xa55c=function(_0x4dd71c,_0x23a24e){_0x4dd71c=_0x4dd71c-0x0;var _0x8e4e36=_0x55ca[_0x4dd71c];return _0x8e4e36;};'use strict';var _=require(_0xa55c('0x0'));var jayson=require(_0xa55c('0x1'));var db=require('../../mysqldb')['db'];var amiClient=jayson['client']['http']({'port':0x232a});var routingClient=jayson[_0xa55c('0x2')][_0xa55c('0x3')]({'port':0x232c});function isAgentPaused(_0x5dc716,_0x3b478a){var _0x2db02a=[_0x5dc716[_0xa55c('0x4')],_0x5dc716[_0xa55c('0x5')],_0x5dc716[_0xa55c('0x6')],_0x5dc716[_0xa55c('0x7')],_0x5dc716[_0xa55c('0x8')],_0x5dc716['voicePause'],_0x5dc716[_0xa55c('0x9')]];if(!_0x3b478a)return _[_0xa55c('0xa')](_0x2db02a);var _0x57e069=_[_0xa55c('0xb')](_0x2db02a);return _0x57e069[_0xa55c('0xc')]>0x0&&_0x57e069['length']<_0x2db02a['length']?!![]:![];}function isIdle(_0x473d0e){return _0x473d0e===_0xa55c('0xd')||_0x473d0e===_0xa55c('0xe')||_0x473d0e===_0xa55c('0xf')||_0x473d0e===_0xa55c('0x10')||_[_0xa55c('0x11')](_0x473d0e);}function isAgentIdle(_0x508342){if(_0x508342[_0xa55c('0x12')]!==_0xa55c('0xd')&&_0x508342[_0xa55c('0x13')]){_0x508342['voiceStatus']='pause';return![];}return _[_0xa55c('0xa')]([_0x508342['chatStatus'],_0x508342['faxStatus'],_0x508342['mailStatus'],_0x508342[_0xa55c('0x14')],_0x508342[_0xa55c('0x15')],_0x508342[_0xa55c('0x12')],_0x508342[_0xa55c('0x16')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xa55c('0x17')](_0xa55c('0x18'),{})['then'](function(_0x3ccf65){if(_0x3ccf65[_0xa55c('0x19')]){throw new Error(_0xa55c('0x1a'));}var _0x31e10d=_0x3ccf65[_0xa55c('0x1b')];return routingClient[_0xa55c('0x17')](_0xa55c('0x18'),{})[_0xa55c('0x1c')](function(_0x24783b){if(_0x24783b['error']){throw new Error(_0xa55c('0x1d'));}var _0x104a99=_0x24783b[_0xa55c('0x1b')];return _[_0xa55c('0x1e')]({},_0x31e10d,_0x104a99);});})[_0xa55c('0x1f')](function(_0x5426e5){throw _0x5426e5;});}exports['getRealtimeAgents']=getRealtimeAgents;function getAgentStatus(_0x5f5158){var _0xd643cc=_0xa55c('0xe');if(isAgentPaused(_0x5f5158))_0xd643cc=_0xa55c('0x20');else if(isAgentPaused(_0x5f5158,!![]))_0xd643cc='*pause';else if(isAgentIdle(_0x5f5158))_0xd643cc=_0xa55c('0xd');else _0xd643cc=_0xa55c('0x21');return _0xd643cc;}exports['getAgentStatus']=getAgentStatus;function getAgentIdsByQueues(_0x187a87,_0x133096){var _0x940f28=_[_0xa55c('0x22')](_0x187a87)?_0x187a87:[_0x187a87];var _0x234372=_['startCase'](_0x133096)+_0xa55c('0x23');var _0x504c24=_['map'](_0x940f28,function(_0x59d89a){return db[_0x234372][_0xa55c('0x24')]({'where':{'id':_0x59d89a}})['then'](function(_0x3ecbe7){if(!_0x3ecbe7)return[];return _0x3ecbe7[_0xa55c('0x25')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xa55c('0x26')](_0x504c24)[_0xa55c('0x1c')](function(_0x2313a9){var _0x170ba4=_(_0x2313a9)[_0xa55c('0x27')]()[_0xa55c('0x28')]('id')[_0xa55c('0x29')]()[_0xa55c('0x2a')]();return _0x170ba4;});}exports[_0xa55c('0x2b')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x57f271,_0x430d55,_0x28814f){try{if(_0x430d55[_0xa55c('0xc')]>0x0){_0x57f271=_0x57f271[_0xa55c('0xb')](function(_0x5d940d){return _0x430d55[_0xa55c('0x2c')](_0x5d940d['id']);});}var _0x22f6b6=_0x57f271[_0xa55c('0xb')](function(_0x201941){var _0x45ee8d=_0xa55c('0x21');if(isAgentIdle(_0x201941)){_0x45ee8d='idle';}return _0x45ee8d===_0x28814f;});return _[_0xa55c('0x28')](_0x22f6b6,'id');}catch(_0x490b7d){throw _0x490b7d;}}exports[_0xa55c('0x2d')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x1d730b,_0x1cc53e,_0x223813){return Promise['resolve']()[_0xa55c('0x1c')](function(){if(_0x1cc53e[_0xa55c('0xc')]>0x0){_0x1d730b=_0x1d730b[_0xa55c('0xb')](function(_0x20da31){return _0x1cc53e[_0xa55c('0x2c')](_0x20da31['id']);});}return _0x1d730b;})[_0xa55c('0x1c')](function(){return db[_0xa55c('0x2e')][_0xa55c('0x2f')]({'attributes':['id',_0xa55c('0x30'),_0xa55c('0x31'),_0xa55c('0x4'),'faxPause','mailPause',_0xa55c('0x7'),_0xa55c('0x8'),'voicePause',_0xa55c('0x9'),_0xa55c('0x32')],'where':{'id':{'$in':_[_0xa55c('0x28')](_0x1d730b,'id')}},'raw':!![]});})[_0xa55c('0x1c')](function(_0x30d4f8){return _0x30d4f8[_0xa55c('0x28')](function(_0x3ce1b3){var _0x222d4b=_[_0xa55c('0x33')](_0x1d730b,['id',_0x3ce1b3['id']]);var _0x53590c=filterAgentAttributes(_0x222d4b);_['merge'](_0x3ce1b3,_0x53590c);_0x3ce1b3['globalStatus']=getAgentStatus(_0x3ce1b3);return _0x3ce1b3;});})[_0xa55c('0x1c')](function(_0x18e00e){var _0x2bb4f0=sortAgentsByStatus(_0x18e00e,_0x223813);return _['map'](_0x2bb4f0,'id');})[_0xa55c('0x1f')](function(_0x547930){throw _0x547930;});}exports[_0xa55c('0x34')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x4ad813){var _0x18c6f1={'fields':[],'order':null};var _0x39267c=_0x4ad813[_0xa55c('0x35')](',');_0x18c6f1['fields']=_[_0xa55c('0xb')](_0x39267c,function(_0x30f23b){if(!_0x30f23b['includes'](_0xa55c('0x36'))){return!![];}_0x18c6f1[_0xa55c('0x37')]=_['startsWith'](_0x30f23b,'-')?'DESC':_0xa55c('0x38');return![];});return _0x18c6f1;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x1e75dc){if(!_0x1e75dc){_0x1e75dc=_0xa55c('0x39');}if(_0x1e75dc['includes']('fullname')&&!_0x1e75dc['includes']('internal')){var _0x3b3308=_0x1e75dc[_0xa55c('0x3a')](0x0,_0x1e75dc[_0xa55c('0x3b')](_0xa55c('0x31')));_0x1e75dc+=','+_0x3b3308+_0xa55c('0x3c');}return _0x1e75dc;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0x3d52d8,_0x7cc363){var _0x77d623=_0x3d52d8[_0xa55c('0x3d')](function(_0x43bac0,_0x23cef5){if(_0x43bac0['globalStatus']===_0x23cef5[_0xa55c('0x36')]){if(_0x43bac0['globalStatus']==='pause'){if(_0x7cc363===_0xa55c('0x3e')){return(_0x43bac0[_0xa55c('0x32')]||'')<(_0x23cef5['pauseType']||'')||_0x43bac0[_0xa55c('0x31')]['toLowerCase']()>_0x23cef5['fullname'][_0xa55c('0x3f')]()?0x1:-0x1;}else{return(_0x43bac0[_0xa55c('0x32')]||'')<(_0x23cef5[_0xa55c('0x32')]||'')||_0x43bac0['fullname'][_0xa55c('0x3f')]()>_0x23cef5[_0xa55c('0x31')]['toLowerCase']()?-0x1:0x1;}}else{if(_0x7cc363===_0xa55c('0x3e')){return _0x43bac0['fullname'][_0xa55c('0x3f')]()<_0x23cef5[_0xa55c('0x31')]['toLowerCase']()?0x1:-0x1;}else{return _0x43bac0[_0xa55c('0x31')][_0xa55c('0x3f')]()<_0x23cef5['fullname'][_0xa55c('0x3f')]()?-0x1:0x1;}}}else{if(_0x7cc363===_0xa55c('0x3e')){return _0x43bac0[_0xa55c('0x36')]<_0x23cef5['globalStatus']?0x1:-0x1;}else{return _0x43bac0[_0xa55c('0x36')]<_0x23cef5['globalStatus']?-0x1:0x1;}}});return _0x77d623;}exports[_0xa55c('0x40')]=sortAgentsByStatus;function filterAgentAttributes(_0x3a8af4){var _0x451269=['userpic',_0xa55c('0x41'),_0xa55c('0x42'),'lastPauseAt',_0xa55c('0x32'),_0xa55c('0x43'),'internal',_0xa55c('0x44'),_0xa55c('0x4'),'openchannelPause',_0xa55c('0x6'),_0xa55c('0x8'),_0xa55c('0x9'),_0xa55c('0x5'),'voicePause',_0xa55c('0x45'),'openchannelCapacity',_0xa55c('0x46'),_0xa55c('0x47'),_0xa55c('0x48'),'faxCapacity',_0xa55c('0x49'),_0xa55c('0x4a'),'mailCurrentCapacity',_0xa55c('0x4b'),_0xa55c('0x4c'),_0xa55c('0x4d'),_0xa55c('0x4e'),_0xa55c('0x14'),_0xa55c('0x4f'),_0xa55c('0x15'),_0xa55c('0x16'),_0xa55c('0x50'),_0xa55c('0x12'),'chatStatusTime',_0xa55c('0x51'),_0xa55c('0x52'),_0xa55c('0x53'),'whatsappStatusTime',_0xa55c('0x54'),_0xa55c('0x55'),'queue',_0xa55c('0x56'),'screenrecording',_0xa55c('0x57'),_0xa55c('0x58'),_0xa55c('0x59')];var _0x3f9313=[_0xa55c('0x4'),'openchannelPause',_0xa55c('0x6'),_0xa55c('0x8'),'whatsappPause',_0xa55c('0x5'),_0xa55c('0x13'),_0xa55c('0x41')];var _0x30693a=_(_0x3a8af4)['omit'](_0x3f9313)['pick'](_0x451269)[_0xa55c('0x2a')]();return _0x30693a;}exports[_0xa55c('0x5a')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0xa55c('0x30'),_0xa55c('0x31'),'role',_0xa55c('0x3c'),'online',_0xa55c('0x36'),_0xa55c('0x5b'),_0xa55c('0x42'),_0xa55c('0x32'),_0xa55c('0x43'),'faxPause',_0xa55c('0x4'),'mailPause',_0xa55c('0x7'),_0xa55c('0x8'),_0xa55c('0x13'),_0xa55c('0x9'),_0xa55c('0x4e'),_0xa55c('0x50'),_0xa55c('0x4f'),'openchannelStatus',_0xa55c('0x15'),_0xa55c('0x12'),_0xa55c('0x16'),_0xa55c('0x5c'),_0xa55c('0x54'),'mailStatusTime',_0xa55c('0x51'),_0xa55c('0x53'),_0xa55c('0x55'),_0xa55c('0x5d'),_0xa55c('0x45'),'faxCapacity',_0xa55c('0x46'),_0xa55c('0x5e'),_0xa55c('0x47'),_0xa55c('0x48'),_0xa55c('0x49'),'faxCurrentCapacity',_0xa55c('0x5f'),'openchannelCurrentCapacity',_0xa55c('0x4b'),'whatsappCurrentCapacity',_0xa55c('0x57'),'phoneBarEnableAutomaticScreenRecording',_0xa55c('0x56'),_0xa55c('0x60'),_0xa55c('0x61'),_0xa55c('0x59'),_0xa55c('0x62')];}exports[_0xa55c('0x63')]=getRealtimeAgentsQueryFields; \ No newline at end of file +var _0x98a8=['lastPauseAt','openchannelCapacity','mailCapacity','whatsappCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatus','faxStatus','chatStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','filterAgentAttributes','online','faxStatusTime','openchannelStatusTime','voiceStatusTime','faxCapacity','smsCapacity','smsCurrentCapacity','onhold','lodash','jayson/promise','../../mysqldb','client','http','chatPause','faxPause','mailPause','smsPause','whatsappPause','filter','length','idle','unknown','unavailable','isNil','voiceStatus','voicePause','pause','mailStatus','openchannelStatus','smsStatus','whatsappStatus','request','then','error','catch','*pause','busy','getAgentStatus','isArray','startCase','Queue','map','findOne','getAgents','uniq','value','getAgentIdsByQueues','getAgentIdsByStatus','resolve','includes','name','fullname','openchannelPause','pauseType','find','merge','fields','startsWith','DESC','fullname,internal','internal','validateSortParameter','sort','globalStatus','toLowerCase','sortAgentsByStatus','userpic','lastLoginAt'];(function(_0x5c5505,_0x22736d){var _0x3aea06=function(_0x2924a4){while(--_0x2924a4){_0x5c5505['push'](_0x5c5505['shift']());}};_0x3aea06(++_0x22736d);}(_0x98a8,0x12c));var _0x898a=function(_0x3c45b4,_0x3beed5){_0x3c45b4=_0x3c45b4-0x0;var _0x121c6d=_0x98a8[_0x3c45b4];return _0x121c6d;};'use strict';var _=require(_0x898a('0x0'));var jayson=require(_0x898a('0x1'));var db=require(_0x898a('0x2'))['db'];var amiClient=jayson[_0x898a('0x3')][_0x898a('0x4')]({'port':0x232a});var routingClient=jayson[_0x898a('0x3')][_0x898a('0x4')]({'port':0x232c});function isAgentPaused(_0x4a0836,_0x2bb3e2){var _0xf84a19=[_0x4a0836[_0x898a('0x5')],_0x4a0836[_0x898a('0x6')],_0x4a0836[_0x898a('0x7')],_0x4a0836['openchannelPause'],_0x4a0836[_0x898a('0x8')],_0x4a0836['voicePause'],_0x4a0836[_0x898a('0x9')]];if(!_0x2bb3e2)return _['every'](_0xf84a19);var _0x42021d=_[_0x898a('0xa')](_0xf84a19);return _0x42021d[_0x898a('0xb')]>0x0&&_0x42021d[_0x898a('0xb')]<_0xf84a19[_0x898a('0xb')]?!![]:![];}function isIdle(_0x388a47){return _0x388a47===_0x898a('0xc')||_0x388a47===_0x898a('0xd')||_0x388a47===_0x898a('0xe')||_0x388a47==='ringing'||_[_0x898a('0xf')](_0x388a47);}function isAgentIdle(_0x502e95){if(_0x502e95[_0x898a('0x10')]!=='idle'&&_0x502e95[_0x898a('0x11')]){_0x502e95[_0x898a('0x10')]=_0x898a('0x12');return![];}return _['every']([_0x502e95['chatStatus'],_0x502e95['faxStatus'],_0x502e95[_0x898a('0x13')],_0x502e95[_0x898a('0x14')],_0x502e95[_0x898a('0x15')],_0x502e95[_0x898a('0x10')],_0x502e95[_0x898a('0x16')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x898a('0x17')]('Agents',{})[_0x898a('0x18')](function(_0x53a4b8){if(_0x53a4b8[_0x898a('0x19')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');}var _0x303321=_0x53a4b8['result'];return routingClient[_0x898a('0x17')]('Agents',{})[_0x898a('0x18')](function(_0x3197f7){if(_0x3197f7[_0x898a('0x19')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x1faf4c=_0x3197f7['result'];return _['merge']({},_0x303321,_0x1faf4c);});})[_0x898a('0x1a')](function(_0x1455ab){throw _0x1455ab;});}exports['getRealtimeAgents']=getRealtimeAgents;function getAgentStatus(_0x4d374b){var _0x12bc0f=_0x898a('0xd');if(isAgentPaused(_0x4d374b))_0x12bc0f=_0x898a('0x12');else if(isAgentPaused(_0x4d374b,!![]))_0x12bc0f=_0x898a('0x1b');else if(isAgentIdle(_0x4d374b))_0x12bc0f=_0x898a('0xc');else _0x12bc0f=_0x898a('0x1c');return _0x12bc0f;}exports[_0x898a('0x1d')]=getAgentStatus;function getAgentIdsByQueues(_0x483212,_0x247cfc){var _0x50718e=_[_0x898a('0x1e')](_0x483212)?_0x483212:[_0x483212];var _0x3cfd9c=_[_0x898a('0x1f')](_0x247cfc)+_0x898a('0x20');var _0x4e254d=_[_0x898a('0x21')](_0x50718e,function(_0x16c318){return db[_0x3cfd9c][_0x898a('0x22')]({'where':{'id':_0x16c318}})[_0x898a('0x18')](function(_0x3901ab){if(!_0x3901ab)return[];return _0x3901ab[_0x898a('0x23')]({'attributes':['id'],'raw':!![]});});});return Promise['all'](_0x4e254d)[_0x898a('0x18')](function(_0x51d501){var _0x513c6b=_(_0x51d501)['flatten']()[_0x898a('0x21')]('id')[_0x898a('0x24')]()[_0x898a('0x25')]();return _0x513c6b;});}exports[_0x898a('0x26')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x28ae6a,_0x2efde2,_0x398e98){try{if(_0x2efde2[_0x898a('0xb')]>0x0){_0x28ae6a=_0x28ae6a[_0x898a('0xa')](function(_0x58149d){return _0x2efde2['includes'](_0x58149d['id']);});}var _0x47f1ed=_0x28ae6a[_0x898a('0xa')](function(_0x62fe93){var _0x3b7704=_0x898a('0x1c');if(isAgentIdle(_0x62fe93)){_0x3b7704=_0x898a('0xc');}return _0x3b7704===_0x398e98;});return _[_0x898a('0x21')](_0x47f1ed,'id');}catch(_0xe3c983){throw _0xe3c983;}}exports[_0x898a('0x27')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x18773a,_0x4287da,_0x44c5d2){return Promise[_0x898a('0x28')]()['then'](function(){if(_0x4287da[_0x898a('0xb')]>0x0){_0x18773a=_0x18773a[_0x898a('0xa')](function(_0x26eead){return _0x4287da[_0x898a('0x29')](_0x26eead['id']);});}return _0x18773a;})[_0x898a('0x18')](function(){return db['User']['findAll']({'attributes':['id',_0x898a('0x2a'),_0x898a('0x2b'),_0x898a('0x5'),'faxPause',_0x898a('0x7'),_0x898a('0x2c'),_0x898a('0x8'),_0x898a('0x11'),_0x898a('0x9'),_0x898a('0x2d')],'where':{'id':{'$in':_[_0x898a('0x21')](_0x18773a,'id')}},'raw':!![]});})[_0x898a('0x18')](function(_0x50bb4b){return _0x50bb4b[_0x898a('0x21')](function(_0x5baf5b){var _0x573eb3=_[_0x898a('0x2e')](_0x18773a,['id',_0x5baf5b['id']]);var _0x58d997=filterAgentAttributes(_0x573eb3);_[_0x898a('0x2f')](_0x5baf5b,_0x58d997);_0x5baf5b['globalStatus']=getAgentStatus(_0x5baf5b);return _0x5baf5b;});})[_0x898a('0x18')](function(_0x4f202c){var _0x299371=sortAgentsByStatus(_0x4f202c,_0x44c5d2);return _[_0x898a('0x21')](_0x299371,'id');})[_0x898a('0x1a')](function(_0x50c0e4){throw _0x50c0e4;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x47966e){var _0x1575d2={'fields':[],'order':null};var _0x429c32=_0x47966e['split'](',');_0x1575d2[_0x898a('0x30')]=_[_0x898a('0xa')](_0x429c32,function(_0xe84f7e){if(!_0xe84f7e[_0x898a('0x29')]('globalStatus')){return!![];}_0x1575d2['order']=_[_0x898a('0x31')](_0xe84f7e,'-')?_0x898a('0x32'):'ASC';return![];});return _0x1575d2;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x168f92){if(!_0x168f92){_0x168f92=_0x898a('0x33');}if(_0x168f92[_0x898a('0x29')](_0x898a('0x2b'))&&!_0x168f92['includes'](_0x898a('0x34'))){var _0x369c02=_0x168f92['substring'](0x0,_0x168f92['indexOf']('fullname'));_0x168f92+=','+_0x369c02+_0x898a('0x34');}return _0x168f92;}exports[_0x898a('0x35')]=validateSortParameter;function sortAgentsByStatus(_0x35d767,_0x22f464){var _0x20a6eb=_0x35d767[_0x898a('0x36')](function(_0x10daf6,_0x1432ec){if(_0x10daf6[_0x898a('0x37')]===_0x1432ec[_0x898a('0x37')]){if(_0x10daf6[_0x898a('0x37')]===_0x898a('0x12')){if(_0x22f464===_0x898a('0x32')){return(_0x10daf6[_0x898a('0x2d')]||'')<(_0x1432ec[_0x898a('0x2d')]||'')||_0x10daf6['fullname'][_0x898a('0x38')]()>_0x1432ec[_0x898a('0x2b')][_0x898a('0x38')]()?0x1:-0x1;}else{return(_0x10daf6['pauseType']||'')<(_0x1432ec[_0x898a('0x2d')]||'')||_0x10daf6[_0x898a('0x2b')][_0x898a('0x38')]()>_0x1432ec[_0x898a('0x2b')][_0x898a('0x38')]()?-0x1:0x1;}}else{if(_0x22f464===_0x898a('0x32')){return _0x10daf6[_0x898a('0x2b')][_0x898a('0x38')]()<_0x1432ec['fullname'][_0x898a('0x38')]()?0x1:-0x1;}else{return _0x10daf6[_0x898a('0x2b')][_0x898a('0x38')]()<_0x1432ec[_0x898a('0x2b')]['toLowerCase']()?-0x1:0x1;}}}else{if(_0x22f464===_0x898a('0x32')){return _0x10daf6[_0x898a('0x37')]<_0x1432ec['globalStatus']?0x1:-0x1;}else{return _0x10daf6[_0x898a('0x37')]<_0x1432ec['globalStatus']?-0x1:0x1;}}});return _0x20a6eb;}exports[_0x898a('0x39')]=sortAgentsByStatus;function filterAgentAttributes(_0x5137c4){var _0x486e66=[_0x898a('0x3a'),'online',_0x898a('0x3b'),_0x898a('0x3c'),'pauseType',_0x898a('0x3c'),_0x898a('0x34'),'address',_0x898a('0x5'),_0x898a('0x2c'),_0x898a('0x7'),_0x898a('0x8'),'whatsappPause',_0x898a('0x6'),_0x898a('0x11'),'chatCapacity',_0x898a('0x3d'),_0x898a('0x3e'),'smsCapacity',_0x898a('0x3f'),'faxCapacity',_0x898a('0x40'),_0x898a('0x41'),_0x898a('0x42'),'smsCurrentCapacity',_0x898a('0x43'),_0x898a('0x44'),_0x898a('0x45'),_0x898a('0x14'),'mailStatus',_0x898a('0x15'),'whatsappStatus',_0x898a('0x46'),_0x898a('0x10'),_0x898a('0x47'),'openchannelStatusTime',_0x898a('0x48'),_0x898a('0x49'),_0x898a('0x4a'),'faxStatusTime','voiceStatusTime',_0x898a('0x4b'),_0x898a('0x4c'),_0x898a('0x4d'),_0x898a('0x4e'),_0x898a('0x4f'),_0x898a('0x50')];var _0x369f33=[_0x898a('0x5'),_0x898a('0x2c'),_0x898a('0x7'),_0x898a('0x8'),'whatsappPause',_0x898a('0x6'),_0x898a('0x11'),'online'];var _0x36d7aa=_(_0x5137c4)['omit'](_0x369f33)['pick'](_0x486e66)[_0x898a('0x25')]();return _0x36d7aa;}exports[_0x898a('0x51')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0x898a('0x2a'),'fullname','role',_0x898a('0x34'),_0x898a('0x52'),'globalStatus',_0x898a('0x3a'),_0x898a('0x3b'),'pauseType',_0x898a('0x3c'),_0x898a('0x6'),_0x898a('0x5'),'mailPause',_0x898a('0x2c'),_0x898a('0x8'),_0x898a('0x11'),_0x898a('0x9'),_0x898a('0x45'),_0x898a('0x46'),'mailStatus',_0x898a('0x14'),'smsStatus',_0x898a('0x10'),_0x898a('0x16'),_0x898a('0x47'),_0x898a('0x53'),_0x898a('0x48'),_0x898a('0x54'),_0x898a('0x49'),_0x898a('0x55'),_0x898a('0x4a'),'chatCapacity',_0x898a('0x56'),_0x898a('0x3e'),_0x898a('0x3d'),_0x898a('0x57'),_0x898a('0x3f'),_0x898a('0x40'),_0x898a('0x44'),_0x898a('0x42'),_0x898a('0x41'),_0x898a('0x58'),_0x898a('0x43'),_0x898a('0x4e'),_0x898a('0x4f'),_0x898a('0x4c'),_0x898a('0x59'),'queue',_0x898a('0x50'),_0x898a('0x4d')];}exports['getRealtimeAgentsQueryFields']=getRealtimeAgentsQueryFields; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index 0e7f767..2953a0d 100644 --- a/server/components/realtime/queues.js +++ b/server/components/realtime/queues.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcf4c=['predictiveIntervalAvgHoldtime','Queues','then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','getRealtimeQueues','voice','inbound','concat','outbound','waiting','find','pick','initializeQueues','lodash','jayson/promise','util','client','http','available','loggedIn','paused','busy','inUse','invalid','loggedInDb','notInUse','ringInUse','talking','pTalking','originated','statusMessage','dialActive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit'];(function(_0x5c868d,_0x8b071){var _0x30b436=function(_0x5b75ff){while(--_0x5b75ff){_0x5c868d['push'](_0x5c868d['shift']());}};_0x30b436(++_0x8b071);}(_0xcf4c,0xa1));var _0xccf4=function(_0x1232e3,_0xde73a8){_0x1232e3=_0x1232e3-0x0;var _0x5b88eb=_0xcf4c[_0x1232e3];return _0x5b88eb;};'use strict';var _=require(_0xccf4('0x0'));var jayson=require(_0xccf4('0x1'));var util=require(_0xccf4('0x2'));var amiClient=jayson[_0xccf4('0x3')][_0xccf4('0x4')]({'port':0x232a});var routingClient=jayson['client'][_0xccf4('0x4')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0xccf4('0x5'),_0xccf4('0x6'),_0xccf4('0x7'),'waiting'];var VOICE_QUEUE_ATTRIBUTES=[_0xccf4('0x8'),_0xccf4('0x9'),_0xccf4('0xa'),_0xccf4('0xb'),_0xccf4('0xc'),'onHold','ringing',_0xccf4('0xd'),_0xccf4('0xe'),'unavailable','unknown'];var OUTBOUND_QUEUE_ATTRIBUTES=[_0xccf4('0xf'),_0xccf4('0x10'),'message',_0xccf4('0x11'),_0xccf4('0x12'),'dialMethod','Trunk','startPredictive',_0xccf4('0x13'),_0xccf4('0x14'),_0xccf4('0x15'),_0xccf4('0x16'),_0xccf4('0x17'),_0xccf4('0x18'),_0xccf4('0x19'),_0xccf4('0x1a'),_0xccf4('0x1b'),_0xccf4('0x1c'),'predictiveIntervalAnsweredCalls',_0xccf4('0x1d'),_0xccf4('0x1e'),_0xccf4('0x1f'),'predictiveIntervalAvgTalktime'];function getRealtimeQueues(_0x1488bc,_0x40a4bd){var _0x513307=_0x40a4bd==='voice'?amiClient:routingClient;return _0x513307['request'](_['startCase'](_0x40a4bd)+_0xccf4('0x20'),_0x1488bc)[_0xccf4('0x21')](function(_0x329615){if(_0x329615[_0xccf4('0x22')])throw new Error(util[_0xccf4('0x23')](_0xccf4('0x24'),_0x40a4bd));return _0x329615[_0xccf4('0x25')];})[_0xccf4('0x26')](function(_0x4b96f2){throw _0x4b96f2;});}exports[_0xccf4('0x27')]=getRealtimeQueues;function initializeQueues(_0x80cf1d,_0x1922ab,_0x2aab51,_0x27689e){var _0x3c1512=DEFAULT_QUEUE_ATTRIBUTES;if(_0x2aab51===_0xccf4('0x28')){if(_0x27689e===_0xccf4('0x29')){_0x3c1512=_0x3c1512[_0xccf4('0x2a')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x27689e===_0xccf4('0x2b')){_0x3c1512=_0x3c1512['concat'](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x80cf1d['map'](function(_0x27377b){var _0x2b7e92=_0x27377b['get']({'plain':!![]});_0x2b7e92[_0xccf4('0x7')]=0x0;_0x2b7e92['loggedInDb']=0x0;_0x2b7e92[_0xccf4('0x6')]=0x0;_0x2b7e92[_0xccf4('0x5')]=0x0;_0x2b7e92[_0xccf4('0x2c')]=0x0;if(_0x2aab51===_0xccf4('0x28')){_0x2b7e92['talking']=0x0;_0x2b7e92['busy']=0x0;if(_0x27689e===_0xccf4('0x2b')){_0x2b7e92[_0xccf4('0xf')]=0x0;_0x2b7e92['originated']=0x0;}}var _0x78232c=_[_0xccf4('0x2d')](_0x1922ab,['id',_0x2b7e92['id']]);if(_0x78232c){_['merge'](_0x2b7e92,_[_0xccf4('0x2e')](_0x78232c,_0x3c1512));}return _0x2b7e92;});}exports[_0xccf4('0x2f')]=initializeQueues; \ No newline at end of file +var _0xe8e6=['Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','voice','inbound','concat','busy','find','merge','pick','initializeQueues','lodash','jayson/promise','util','client','http','available','loggedIn','paused','waiting','inUse','invalid','loggedInDb','notInUse','onHold','ringInUse','talking','unavailable','unknown','pTalking','originated','statusMessage','dialActive','dialMethod','startPredictive','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','request','then','error'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe8e6,0x1eb));var _0x6e8e=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0xe8e6[_0x4bb66f];return _0xf2772f;};'use strict';var _=require(_0x6e8e('0x0'));var jayson=require(_0x6e8e('0x1'));var util=require(_0x6e8e('0x2'));var amiClient=jayson[_0x6e8e('0x3')]['http']({'port':0x232a});var routingClient=jayson[_0x6e8e('0x3')][_0x6e8e('0x4')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x6e8e('0x5'),_0x6e8e('0x6'),_0x6e8e('0x7'),_0x6e8e('0x8')];var VOICE_QUEUE_ATTRIBUTES=['busy',_0x6e8e('0x9'),_0x6e8e('0xa'),_0x6e8e('0xb'),_0x6e8e('0xc'),_0x6e8e('0xd'),'ringing',_0x6e8e('0xe'),_0x6e8e('0xf'),_0x6e8e('0x10'),_0x6e8e('0x11')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x6e8e('0x12'),_0x6e8e('0x13'),'message',_0x6e8e('0x14'),_0x6e8e('0x15'),_0x6e8e('0x16'),'Trunk',_0x6e8e('0x17'),'startProgressive',_0x6e8e('0x18'),_0x6e8e('0x19'),'erlangAbandonmentRate',_0x6e8e('0x1a'),'dialPredictiveInterval','dialPredictiveIntervalMaxThreshold',_0x6e8e('0x1b'),_0x6e8e('0x1c'),_0x6e8e('0x1d'),_0x6e8e('0x1e'),_0x6e8e('0x1f'),_0x6e8e('0x20'),'predictiveIntervalAvgHoldtime',_0x6e8e('0x21')];function getRealtimeQueues(_0x1787ca,_0x160125){var _0x135a25=_0x160125==='voice'?amiClient:routingClient;return _0x135a25[_0x6e8e('0x22')](_['startCase'](_0x160125)+'Queues',_0x1787ca)[_0x6e8e('0x23')](function(_0x553585){if(_0x553585[_0x6e8e('0x24')])throw new Error(util['format'](_0x6e8e('0x25'),_0x160125));return _0x553585[_0x6e8e('0x26')];})[_0x6e8e('0x27')](function(_0x31bd6a){throw _0x31bd6a;});}exports['getRealtimeQueues']=getRealtimeQueues;function initializeQueues(_0x7e8c8,_0x9372d7,_0x278b8d,_0x5ca576){var _0x4e57fd=DEFAULT_QUEUE_ATTRIBUTES;if(_0x278b8d===_0x6e8e('0x28')){if(_0x5ca576===_0x6e8e('0x29')){_0x4e57fd=_0x4e57fd['concat'](VOICE_QUEUE_ATTRIBUTES);}else if(_0x5ca576==='outbound'){_0x4e57fd=_0x4e57fd[_0x6e8e('0x2a')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x7e8c8['map'](function(_0x15ad4a){var _0x3e0df5=_0x15ad4a['get']({'plain':!![]});_0x3e0df5['paused']=0x0;_0x3e0df5[_0x6e8e('0xb')]=0x0;_0x3e0df5[_0x6e8e('0x6')]=0x0;_0x3e0df5[_0x6e8e('0x5')]=0x0;_0x3e0df5[_0x6e8e('0x8')]=0x0;if(_0x278b8d==='voice'){_0x3e0df5[_0x6e8e('0xf')]=0x0;_0x3e0df5[_0x6e8e('0x2b')]=0x0;if(_0x5ca576==='outbound'){_0x3e0df5['pTalking']=0x0;_0x3e0df5['originated']=0x0;}}var _0x37be64=_[_0x6e8e('0x2c')](_0x9372d7,['id',_0x3e0df5['id']]);if(_0x37be64){_[_0x6e8e('0x2d')](_0x3e0df5,_[_0x6e8e('0x2e')](_0x37be64,_0x4e57fd));}return _0x3e0df5;});}exports[_0x6e8e('0x2f')]=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index ff4fbc0..c07dbd8 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(_0x4da7cd,_0x2d5596){var _0x448ddf=function(_0x55177a){while(--_0x55177a){_0x4da7cd['push'](_0x4da7cd['shift']());}};_0x448ddf(++_0x2d5596);}(_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(_0x3b4b1d,_0x15029e){var _0x488c36=function(_0x56c8b3){while(--_0x56c8b3){_0x3b4b1d['push'](_0x3b4b1d['shift']());}};_0x488c36(++_0x15029e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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 9bf5d2b..8d1420b 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 _0x0e6e=['createHash','md5','update','digest','hex','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','macAddress','ipAddress','substring','lodash','crypto','bimedia-machine-uuid','execSync','networkInterfaces','orderBy','length','family','IPv4','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','map','model'];(function(_0xdfb3c3,_0x59788d){var _0x4f9a74=function(_0x2f1544){while(--_0x2f1544){_0xdfb3c3['push'](_0xdfb3c3['shift']());}};_0x4f9a74(++_0x59788d);}(_0x0e6e,0xef));var _0xe0e6=function(_0x9433a8,_0x386fe0){_0x9433a8=_0x9433a8-0x0;var _0x59fda5=_0x0e6e[_0x9433a8];return _0x59fda5;};'use strict';var _=require(_0xe0e6('0x0'));var os=require('os');var crypto=require(_0xe0e6('0x1'));var machine=require(_0xe0e6('0x2'));var exec=require('child_process')[_0xe0e6('0x3')];var config=require('../environment');function getInterfaces(){var _0x289686=[];var _0x2747a3=os[_0xe0e6('0x4')]();var _0x1b219f=_[_0xe0e6('0x5')](_['keys'](_0x2747a3));for(var _0x208432=0x0;_0x208432<_0x1b219f[_0xe0e6('0x6')];_0x208432++){var _0x1f0874=_0x2747a3[_0x1b219f[_0x208432]]['filter'](function(_0x53995c){return _0x53995c[_0xe0e6('0x7')]===_0xe0e6('0x8')&&_0x53995c['internal']===![];});_0x289686=_0x289686['concat'](_0x1f0874);}return _0x289686;}function getFirstInterface(){var _0x4916b7=_[_0xe0e6('0x9')](getInterfaces());return{'macAddress':_0x4916b7&&_0x4916b7[_0xe0e6('0xa')]?_0x4916b7[_0xe0e6('0xa')]:_0xe0e6('0xb'),'ipAddress':_0x4916b7&&_0x4916b7[_0xe0e6('0xc')]?_0x4916b7[_0xe0e6('0xc')]:_0xe0e6('0xd')};}exports[_0xe0e6('0xe')]=getFirstInterface;function getCPUhash(){var _0x3dbc33=_['orderBy'](os['cpus']()[_0xe0e6('0xf')](function(_0x26c4a8){return _0x26c4a8[_0xe0e6('0x10')];}))['join'](':');return crypto[_0xe0e6('0x11')](_0xe0e6('0x12'))[_0xe0e6('0x13')](_0x3dbc33)[_0xe0e6('0x14')](_0xe0e6('0x15'));}exports['getUuid']=function(){var _0x52fbfc=os[_0xe0e6('0x16')]();var _0x4df1e6=/[0-9a-f-]{36}/;if(config[_0xe0e6('0x17')]&&_0x4df1e6[_0xe0e6('0x18')](config['licenseToken'])){return config[_0xe0e6('0x17')];}else if(_0x52fbfc===_0xe0e6('0x19')){return exec(_0xe0e6('0x1a'),{'encoding':_0xe0e6('0x1b')})[_0xe0e6('0x1c')]('\x0d\x0a','');}else{var _0x341bd3=getFirstInterface();var _0x2374ee=getCPUhash();var _0x5f4544=_0x2374ee+'|'+os['hostname']()+'|'+_0x341bd3[_0xe0e6('0x1d')]+'|'+_0x341bd3[_0xe0e6('0x1e')];var _0x4c0d20=crypto[_0xe0e6('0x11')]('md5')[_0xe0e6('0x13')](_0x5f4544)[_0xe0e6('0x14')]('hex');return _0x4c0d20[_0xe0e6('0x1f')](0x0,0x8)+'-'+_0x4c0d20['substring'](0x8,0xc)+'-'+_0x4c0d20[_0xe0e6('0x1f')](0xc,0x10)+'-'+_0x4c0d20[_0xe0e6('0x1f')](0x10,0x14)+'-'+_0x4c0d20[_0xe0e6('0x1f')](0x14);}}; \ No newline at end of file +var _0x00a7=['ipAddress','hex','substring','lodash','child_process','execSync','../environment','networkInterfaces','orderBy','keys','length','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','cpus','map','join','createHash','md5','update','digest','getUuid','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','replace','hostname','macAddress'];(function(_0x5e6935,_0x23d0a4){var _0x5498f9=function(_0x592401){while(--_0x592401){_0x5e6935['push'](_0x5e6935['shift']());}};_0x5498f9(++_0x23d0a4);}(_0x00a7,0x184));var _0x700a=function(_0x36dca6,_0x410004){_0x36dca6=_0x36dca6-0x0;var _0x2ac354=_0x00a7[_0x36dca6];return _0x2ac354;};'use strict';var _=require(_0x700a('0x0'));var os=require('os');var crypto=require('crypto');var machine=require('bimedia-machine-uuid');var exec=require(_0x700a('0x1'))[_0x700a('0x2')];var config=require(_0x700a('0x3'));function getInterfaces(){var _0x32ff07=[];var _0x2d991b=os[_0x700a('0x4')]();var _0x2c3703=_[_0x700a('0x5')](_[_0x700a('0x6')](_0x2d991b));for(var _0x28bc77=0x0;_0x28bc77<_0x2c3703[_0x700a('0x7')];_0x28bc77++){var _0x1417e4=_0x2d991b[_0x2c3703[_0x28bc77]]['filter'](function(_0x48a40e){return _0x48a40e['family']===_0x700a('0x8')&&_0x48a40e[_0x700a('0x9')]===![];});_0x32ff07=_0x32ff07[_0x700a('0xa')](_0x1417e4);}return _0x32ff07;}function getFirstInterface(){var _0x26ebf1=_[_0x700a('0xb')](getInterfaces());return{'macAddress':_0x26ebf1&&_0x26ebf1[_0x700a('0xc')]?_0x26ebf1[_0x700a('0xc')]:_0x700a('0xd'),'ipAddress':_0x26ebf1&&_0x26ebf1[_0x700a('0xe')]?_0x26ebf1[_0x700a('0xe')]:_0x700a('0xf')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x449f16=_[_0x700a('0x5')](os[_0x700a('0x10')]()[_0x700a('0x11')](function(_0x41f9c7){return _0x41f9c7['model'];}))[_0x700a('0x12')](':');return crypto[_0x700a('0x13')](_0x700a('0x14'))[_0x700a('0x15')](_0x449f16)[_0x700a('0x16')]('hex');}exports[_0x700a('0x17')]=function(){var _0x4de868=os[_0x700a('0x18')]();var _0x32a543=/[0-9a-f-]{36}/;if(config[_0x700a('0x19')]&&_0x32a543[_0x700a('0x1a')](config[_0x700a('0x19')])){return config[_0x700a('0x19')];}else if(_0x4de868===_0x700a('0x1b')){return exec(_0x700a('0x1c'),{'encoding':'utf8'})[_0x700a('0x1d')]('\x0d\x0a','');}else{var _0x55112b=getFirstInterface();var _0x568b7c=getCPUhash();var _0x1f109a=_0x568b7c+'|'+os[_0x700a('0x1e')]()+'|'+_0x55112b[_0x700a('0x1f')]+'|'+_0x55112b[_0x700a('0x20')];var _0x4bbfb4=crypto[_0x700a('0x13')](_0x700a('0x14'))[_0x700a('0x15')](_0x1f109a)['digest'](_0x700a('0x21'));return _0x4bbfb4[_0x700a('0x22')](0x0,0x8)+'-'+_0x4bbfb4['substring'](0x8,0xc)+'-'+_0x4bbfb4['substring'](0xc,0x10)+'-'+_0x4bbfb4['substring'](0x10,0x14)+'-'+_0x4bbfb4[_0x700a('0x22')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 3b0e16b..f7a658f 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 _0x107c=['get','data1','data2','active','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','YYYY-MM-DD\x20HH:mm','encryptString','decryptString','DEMO\x20START\x20AT\x20%s','error','finally','getUuid','License','message','default','util','request-promise','bluebird','pkginfo','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','version','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','catch'];(function(_0x3e3162,_0x5d5421){var _0x5c0f2a=function(_0x1b3d27){while(--_0x1b3d27){_0x3e3162['push'](_0x3e3162['shift']());}};_0x5c0f2a(++_0x5d5421);}(_0x107c,0x128));var _0xc107=function(_0xe71cf6,_0x120a90){_0xe71cf6=_0xe71cf6-0x0;var _0x1ffd42=_0x107c[_0xe71cf6];return _0x1ffd42;};'use strict';var util=require(_0xc107('0x0'));var moment=require('moment');var rp=require(_0xc107('0x1'));var BPromise=require(_0xc107('0x2'));var pkginfo=require(_0xc107('0x3'))(module,'version');var db=require('../../mysqldb')['db'];var encryptor=require(_0xc107('0x4'));var hardware=require(_0xc107('0x5'));var logger=require(_0xc107('0x6'))(_0xc107('0x7'));var HOST=_0xc107('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x1b0978){return new BPromise(function(_0x3daf2d,_0x359486){var _0x4d7382=util[_0xc107('0x9')](_0xc107('0xa'),HOST,_0x1b0978,module[_0xc107('0xb')][_0xc107('0xc')]);if(oldToken){_0x4d7382=util[_0xc107('0x9')](_0xc107('0xd'),HOST,_0x1b0978,module[_0xc107('0xb')][_0xc107('0xc')],oldToken);}var _0xb4dbb2={'uri':_0x4d7382,'method':_0xc107('0xe'),'timeout':0xea60,'json':!![]};return rp(_0xb4dbb2)['then'](function(_0x29984f){_0x3daf2d(_0x29984f);})[_0xc107('0xf')](function(_0x197ca1){_0x359486(_0x197ca1);});});}function manageLicense(_0x3757c5,_0x2b7cb8){var _0x526395=_0x2b7cb8[_0xc107('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x526395[_0xc107('0x11')]!==_0x3757c5&&!_0x526395[_0xc107('0x12')]){oldToken=_0x526395[_0xc107('0x11')];}httpRequest(_0x3757c5)['then'](function(_0x306835){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x306835[_0xc107('0x13')]){isOldTokenSent=![];if(!_0x526395[_0xc107('0x7')]&&_0x526395[_0xc107('0x7')]!=_0x306835['license']||_0x526395[_0xc107('0x7')]&&_0x526395['data2']){logger[_0xc107('0x14')](_0xc107('0x15'));}if(_0x526395['license']&&!_0x526395['data2']&&_0x526395[_0xc107('0x7')]!=_0x306835[_0xc107('0x7')]){logger[_0xc107('0x14')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x526395['license']&&!_0x526395['data2']&&_0x526395['license']==_0x306835[_0xc107('0x7')]){return _0x2b7cb8;}return _0x2b7cb8[_0xc107('0x16')]({'data1':_0x3757c5,'data2':null,'license':_0x306835['license']});}else{if(_0x306835[_0xc107('0x7')]||_0x526395[_0xc107('0x7')]){if(!_0x526395['data2']){if(_0x526395['data1']==_0x3757c5){GRAY_PERIOD_REASON=_0xc107('0x17');logger[_0xc107('0x14')](_0xc107('0x18'));}else{GRAY_PERIOD_REASON=_0xc107('0x19');logger['info'](_0xc107('0x1a'),_0x526395[_0xc107('0x11')],_0x3757c5);}logger[_0xc107('0x14')](_0xc107('0x1b'),GRAY_PERIOD_REASON[_0xc107('0x1c')](),moment()[_0xc107('0x9')](_0xc107('0x1d')));return _0x2b7cb8[_0xc107('0x16')]({'data2':encryptor[_0xc107('0x1e')](moment()['format'](_0xc107('0x1d')))});}else{if(moment()['diff'](encryptor[_0xc107('0x1f')](_0x526395['data2']),'days')>DAYS){logger[_0xc107('0x14')](_0xc107('0x20'),moment()['format'](_0xc107('0x1d')));isOldTokenSent=![];return _0x2b7cb8['update']({'data1':_0x3757c5,'data2':null,'license':null});}}}else{if(_0x526395['data1']!=_0x3757c5){logger[_0xc107('0x14')](_0xc107('0x1a'),_0x526395[_0xc107('0x11')],_0x3757c5);return _0x2b7cb8[_0xc107('0x16')]({'data1':_0x3757c5,'data2':null,'license':null});}}}return _0x2b7cb8;})['then'](function(_0x4ff806){_0x2b7cb8=_0x4ff806;})[_0xc107('0xf')](function(_0x1f6677){logger[_0xc107('0x21')](_0x1f6677['message']);})[_0xc107('0x22')](function(){setTimeout(function(){manageLicense(hardware[_0xc107('0x23')](),_0x2b7cb8);},TIME);});}function defaultLicense(){var _0x312ca8=hardware[_0xc107('0x23')]();if(_0x312ca8){return db[_0xc107('0x24')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x312ca8}})['spread'](function(_0x5dbd4e,_0xf285de){logger['info']('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x312ca8);manageLicense(_0x312ca8,_0x5dbd4e);})['catch'](function(_0x197164){logger[_0xc107('0x21')](_0x197164[_0xc107('0x25')]);});}}exports[_0xc107('0x26')]=defaultLicense; \ No newline at end of file +var _0x258b=['util','request-promise','bluebird','pkginfo','../../mysqldb','../../components/encryptor','./hardware','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','version','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','catch','get','data1','then','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','days','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','License','findOrCreate','spread','default'];(function(_0x3a919a,_0x45a59a){var _0x110464=function(_0x508427){while(--_0x508427){_0x3a919a['push'](_0x3a919a['shift']());}};_0x110464(++_0x45a59a);}(_0x258b,0x1c3));var _0xb258=function(_0x304a98,_0x2894f9){_0x304a98=_0x304a98-0x0;var _0x4297a3=_0x258b[_0x304a98];return _0x4297a3;};'use strict';var util=require(_0xb258('0x0'));var moment=require('moment');var rp=require(_0xb258('0x1'));var BPromise=require(_0xb258('0x2'));var pkginfo=require(_0xb258('0x3'))(module,'version');var db=require(_0xb258('0x4'))['db'];var encryptor=require(_0xb258('0x5'));var hardware=require(_0xb258('0x6'));var logger=require('../logger')(_0xb258('0x7'));var HOST=_0xb258('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x568a40){return new BPromise(function(_0x2be194,_0x2af661){var _0x268e5b=util[_0xb258('0x9')](_0xb258('0xa'),HOST,_0x568a40,module[_0xb258('0xb')][_0xb258('0xc')]);if(oldToken){_0x268e5b=util[_0xb258('0x9')](_0xb258('0xd'),HOST,_0x568a40,module['exports']['version'],oldToken);}var _0x33ccc7={'uri':_0x268e5b,'method':_0xb258('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x33ccc7)['then'](function(_0x387948){_0x2be194(_0x387948);})[_0xb258('0xf')](function(_0x2e3de6){_0x2af661(_0x2e3de6);});});}function manageLicense(_0x357303,_0x2d7724){var _0x3a3178=_0x2d7724[_0xb258('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x3a3178[_0xb258('0x11')]!==_0x357303&&!_0x3a3178['data2']){oldToken=_0x3a3178[_0xb258('0x11')];}httpRequest(_0x357303)[_0xb258('0x12')](function(_0x55465a){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x55465a[_0xb258('0x13')]){isOldTokenSent=![];if(!_0x3a3178[_0xb258('0x7')]&&_0x3a3178[_0xb258('0x7')]!=_0x55465a[_0xb258('0x7')]||_0x3a3178[_0xb258('0x7')]&&_0x3a3178[_0xb258('0x14')]){logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x3a3178[_0xb258('0x7')]&&!_0x3a3178[_0xb258('0x14')]&&_0x3a3178[_0xb258('0x7')]!=_0x55465a[_0xb258('0x7')]){logger[_0xb258('0x15')](_0xb258('0x16'));}if(_0x3a3178[_0xb258('0x7')]&&!_0x3a3178[_0xb258('0x14')]&&_0x3a3178[_0xb258('0x7')]==_0x55465a[_0xb258('0x7')]){return _0x2d7724;}return _0x2d7724[_0xb258('0x17')]({'data1':_0x357303,'data2':null,'license':_0x55465a[_0xb258('0x7')]});}else{if(_0x55465a[_0xb258('0x7')]||_0x3a3178[_0xb258('0x7')]){if(!_0x3a3178[_0xb258('0x14')]){if(_0x3a3178[_0xb258('0x11')]==_0x357303){GRAY_PERIOD_REASON='Disabled';logger[_0xb258('0x15')](_0xb258('0x18'));}else{GRAY_PERIOD_REASON=_0xb258('0x19');logger[_0xb258('0x15')](_0xb258('0x1a'),_0x3a3178['data1'],_0x357303);}logger[_0xb258('0x15')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0xb258('0x1b')](),moment()[_0xb258('0x9')](_0xb258('0x1c')));return _0x2d7724[_0xb258('0x17')]({'data2':encryptor[_0xb258('0x1d')](moment()[_0xb258('0x9')](_0xb258('0x1c')))});}else{if(moment()[_0xb258('0x1e')](encryptor['decryptString'](_0x3a3178[_0xb258('0x14')]),_0xb258('0x1f'))>DAYS){logger[_0xb258('0x15')](_0xb258('0x20'),moment()[_0xb258('0x9')](_0xb258('0x1c')));isOldTokenSent=![];return _0x2d7724[_0xb258('0x17')]({'data1':_0x357303,'data2':null,'license':null});}}}else{if(_0x3a3178[_0xb258('0x11')]!=_0x357303){logger[_0xb258('0x15')](_0xb258('0x1a'),_0x3a3178['data1'],_0x357303);return _0x2d7724[_0xb258('0x17')]({'data1':_0x357303,'data2':null,'license':null});}}}return _0x2d7724;})[_0xb258('0x12')](function(_0x5eb40a){_0x2d7724=_0x5eb40a;})[_0xb258('0xf')](function(_0x5727ec){logger[_0xb258('0x21')](_0x5727ec[_0xb258('0x22')]);})[_0xb258('0x23')](function(){setTimeout(function(){manageLicense(hardware[_0xb258('0x24')](),_0x2d7724);},TIME);});}function defaultLicense(){var _0x1332e8=hardware['getUuid']();if(_0x1332e8){return db[_0xb258('0x25')][_0xb258('0x26')]({'where':{'id':0x1},'defaults':{'data1':_0x1332e8}})[_0xb258('0x27')](function(_0x3747b4,_0x51268d){logger[_0xb258('0x15')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x1332e8);manageLicense(_0x1332e8,_0x3747b4);})[_0xb258('0xf')](function(_0x5ef7e5){logger[_0xb258('0x21')](_0x5ef7e5['message']);});}}exports[_0xb258('0x28')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index df6d7c2..4e0ca16 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 _0x8fbd=['demo','machineUuid','getUuid','deadline','add','grayReason','message','User','findAll','role','sequelize','admin','user','telephone','users','forEach','count','catch','pick','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','moment','bluebird','./hardware','2027-01-01T00:00:00.000Z','Demo\x20license','Breaking\x20license','find','defaults','then','uuid','data1','license','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s'];(function(_0x51167d,_0x208fdf){var _0x59203b=function(_0x205bdf){while(--_0x205bdf){_0x51167d['push'](_0x51167d['shift']());}};_0x59203b(++_0x208fdf);}(_0x8fbd,0x187));var _0xd8fb=function(_0x4619ec,_0xdadf6c){_0x4619ec=_0x4619ec-0x0;var _0x3aeba0=_0x8fbd[_0x4619ec];return _0x3aeba0;};'use strict';var util=require(_0xd8fb('0x0'));var _=require('lodash');var moment=require(_0xd8fb('0x1'));var BPromise=require(_0xd8fb('0x2'));var hardware=require(_0xd8fb('0x3'));var encryptor=require('../../components/encryptor');var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xd8fb('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xd8fb('0x5'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xd8fb('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xd8fb('0x6'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x5f35f5){return new BPromise(function(_0x1fe9d0,_0x2a107c){return db['License'][_0xd8fb('0x7')](_[_0xd8fb('0x8')](_0x5f35f5,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x3b5575){return checkLicense(_0x3b5575,null);})[_0xd8fb('0x9')](function(_0x2e74eb){_0x1fe9d0(_0x2e74eb);return;})['catch'](function(_0x49de8a){_0x2a107c(_0x49de8a);});});}function checkLicense(_0x25ebbf,_0x2502e2){if(!_0x25ebbf){demoLicense[_0xd8fb('0xa')]=_0x25ebbf[_0xd8fb('0xb')];return demoLicense;}try{var _0x37d2a0=_0x2502e2||_0x25ebbf[_0xd8fb('0xc')];if(_['isEmpty'](_0x37d2a0)){throw new Error(_0xd8fb('0xd'));}var _0x4dd90e=_0x25ebbf[_0xd8fb('0xb')];var _0x132693=_0x25ebbf[_0xd8fb('0xe')];var _0x521dfd=_0x4dd90e[_0xd8fb('0xf')]('-')[0x4];var _0x183d57=_0x4dd90e[_0xd8fb('0xf')]('-')[0x0];var _0x48347a=encryptor[_0xd8fb('0x10')](_0x37d2a0,util[_0xd8fb('0x11')](_0xd8fb('0x12'),_0x521dfd,_0x4dd90e,_0x183d57));var _0x528d32=JSON['parse'](_0x48347a);_0x528d32[_0xd8fb('0x13')]=![];_0x528d32[_0xd8fb('0xa')]=_0x4dd90e;_0x528d32[_0xd8fb('0x14')]=hardware[_0xd8fb('0x15')]();if(_0x132693){var _0x242274=encryptor['decryptString'](_0x132693);_0x528d32['gray']=_0x242274;_0x528d32[_0xd8fb('0x16')]=moment(_0x242274)[_0xd8fb('0x17')](0x7,'days')[_0xd8fb('0x11')]();_0x528d32[_0xd8fb('0x18')]=_0x528d32[_0xd8fb('0xa')]!=_0x528d32[_0xd8fb('0x14')]?'changed':'disabled';}return _0x528d32;}catch(_0x428f72){breakingLicense[_0xd8fb('0xa')]=_0x25ebbf['data1'];breakingLicense[_0xd8fb('0x19')]=_0x428f72[_0xd8fb('0x19')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0xe69089,_0x58d7ea){getLicense()[_0xd8fb('0x9')](function(_0x2a1f2a){return db[_0xd8fb('0x1a')][_0xd8fb('0x1b')]({'attributes':[_0xd8fb('0x1c'),[db[_0xd8fb('0x1d')]['fn']('COUNT',db[_0xd8fb('0x1d')]['col'](_0xd8fb('0x1c'))),'count']],'group':_0xd8fb('0x1c'),'where':{'role':{'$or':[_0xd8fb('0x1e'),_0xd8fb('0x1f'),_0xd8fb('0x20')]}},'raw':!![]})['then'](function(_0x3e45a5){var _0x52e0c2={'user':_0x2a1f2a[_0xd8fb('0x21')]||0x0,'telephone':_0x2a1f2a['telephones']||0x0};_0x3e45a5[_0xd8fb('0x22')](function(_0x284def){var _0x3810ff=_0x284def[_0xd8fb('0x1c')]===_0xd8fb('0x1e')?'user':_0x284def[_0xd8fb('0x1c')];_0x52e0c2[_0x3810ff]-=_0x284def[_0xd8fb('0x23')];if(_0x52e0c2[_0x3810ff]<0x0)_0x52e0c2[_0x3810ff]=0x0;});_0xe69089(_0x52e0c2);return;});})[_0xd8fb('0x24')](function(_0x19a4f9){_0x58d7ea(_0x19a4f9);});});}function checkUserLimits(_0x29d529){return new BPromise(function(_0x46092b,_0x42f13d){getLimits()['then'](function(_0x5b31a2){var _0x3df547=_[_0xd8fb('0x25')](_['countBy'](_0x29d529,'role'),[_0xd8fb('0x1e'),_0xd8fb('0x1f'),_0xd8fb('0x20')]);var _0x1295fb=(_0x3df547[_0xd8fb('0x1e')]||0x0)+(_0x3df547[_0xd8fb('0x1f')]||0x0);var _0x345c5e=_0x3df547[_0xd8fb('0x20')]||0x0;if(_0x1295fb>_0x5b31a2[_0xd8fb('0x1f')])return _0x42f13d(_0xd8fb('0x26'));if(_0x345c5e>_0x5b31a2[_0xd8fb('0x20')])return _0x42f13d(_0xd8fb('0x27'));return _0x46092b();})[_0xd8fb('0x24')](function(_0x2ed4bb){_0x42f13d(_0x2ed4bb);});});}module[_0xd8fb('0x28')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x52ad=['changed','disabled','message','findAll','role','sequelize','COUNT','admin','user','telephone','users','forEach','count','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','lodash','moment','bluebird','./hardware','../../components/encryptor','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','find','defaults','then','catch','data1','license','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','uuid','gray','deadline','add','days','grayReason'];(function(_0x334d52,_0x40d32b){var _0x32aacf=function(_0x2a904e){while(--_0x2a904e){_0x334d52['push'](_0x334d52['shift']());}};_0x32aacf(++_0x40d32b);}(_0x52ad,0x1b0));var _0xd52a=function(_0x225b94,_0x4b6591){_0x225b94=_0x225b94-0x0;var _0x4f8713=_0x52ad[_0x225b94];return _0x4f8713;};'use strict';var util=require('util');var _=require(_0xd52a('0x0'));var moment=require(_0xd52a('0x1'));var BPromise=require(_0xd52a('0x2'));var hardware=require(_0xd52a('0x3'));var encryptor=require(_0xd52a('0x4'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xd52a('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xd52a('0x6'),'machineUuid':hardware[_0xd52a('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xd52a('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xd52a('0x8'),'machineUuid':hardware[_0xd52a('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x945d9a){return new BPromise(function(_0x201fb7,_0xf5d54d){return db['License'][_0xd52a('0x9')](_[_0xd52a('0xa')](_0x945d9a,{'raw':!![],'where':{'id':0x1}}))[_0xd52a('0xb')](function(_0x45bbaa){return checkLicense(_0x45bbaa,null);})['then'](function(_0x4e4290){_0x201fb7(_0x4e4290);return;})[_0xd52a('0xc')](function(_0x1f85e5){_0xf5d54d(_0x1f85e5);});});}function checkLicense(_0xafbea0,_0x228569){if(!_0xafbea0){demoLicense['uuid']=_0xafbea0[_0xd52a('0xd')];return demoLicense;}try{var _0x3090ac=_0x228569||_0xafbea0[_0xd52a('0xe')];if(_['isEmpty'](_0x3090ac)){throw new Error(_0xd52a('0xf'));}var _0x2c5dc1=_0xafbea0[_0xd52a('0xd')];var _0x35f253=_0xafbea0[_0xd52a('0x10')];var _0xe9a99a=_0x2c5dc1['split']('-')[0x4];var _0x4bd9ee=_0x2c5dc1[_0xd52a('0x11')]('-')[0x0];var _0x27cbd8=encryptor[_0xd52a('0x12')](_0x3090ac,util[_0xd52a('0x13')](_0xd52a('0x14'),_0xe9a99a,_0x2c5dc1,_0x4bd9ee));var _0x52c33f=JSON[_0xd52a('0x15')](_0x27cbd8);_0x52c33f['demo']=![];_0x52c33f[_0xd52a('0x16')]=_0x2c5dc1;_0x52c33f['machineUuid']=hardware[_0xd52a('0x7')]();if(_0x35f253){var _0x399eeb=encryptor[_0xd52a('0x12')](_0x35f253);_0x52c33f[_0xd52a('0x17')]=_0x399eeb;_0x52c33f[_0xd52a('0x18')]=moment(_0x399eeb)[_0xd52a('0x19')](0x7,_0xd52a('0x1a'))[_0xd52a('0x13')]();_0x52c33f[_0xd52a('0x1b')]=_0x52c33f[_0xd52a('0x16')]!=_0x52c33f['machineUuid']?_0xd52a('0x1c'):_0xd52a('0x1d');}return _0x52c33f;}catch(_0x1f1df6){breakingLicense[_0xd52a('0x16')]=_0xafbea0[_0xd52a('0xd')];breakingLicense[_0xd52a('0x1e')]=_0x1f1df6['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x1ce081,_0x37fdd2){getLicense()[_0xd52a('0xb')](function(_0x38c9b9){return db['User'][_0xd52a('0x1f')]({'attributes':[_0xd52a('0x20'),[db[_0xd52a('0x21')]['fn'](_0xd52a('0x22'),db[_0xd52a('0x21')]['col'](_0xd52a('0x20'))),'count']],'group':_0xd52a('0x20'),'where':{'role':{'$or':[_0xd52a('0x23'),_0xd52a('0x24'),_0xd52a('0x25')]}},'raw':!![]})[_0xd52a('0xb')](function(_0x1ad75e){var _0x8746fb={'user':_0x38c9b9[_0xd52a('0x26')]||0x0,'telephone':_0x38c9b9['telephones']||0x0};_0x1ad75e[_0xd52a('0x27')](function(_0x2f127f){var _0x54be85=_0x2f127f[_0xd52a('0x20')]===_0xd52a('0x23')?_0xd52a('0x24'):_0x2f127f[_0xd52a('0x20')];_0x8746fb[_0x54be85]-=_0x2f127f[_0xd52a('0x28')];if(_0x8746fb[_0x54be85]<0x0)_0x8746fb[_0x54be85]=0x0;});_0x1ce081(_0x8746fb);return;});})['catch'](function(_0x34b560){_0x37fdd2(_0x34b560);});});}function checkUserLimits(_0x3f80da){return new BPromise(function(_0x337ca6,_0x3382da){getLimits()[_0xd52a('0xb')](function(_0x4f850e){var _0x4af57d=_[_0xd52a('0x29')](_[_0xd52a('0x2a')](_0x3f80da,'role'),['admin',_0xd52a('0x24'),'telephone']);var _0x2861c8=(_0x4af57d[_0xd52a('0x23')]||0x0)+(_0x4af57d[_0xd52a('0x24')]||0x0);var _0x476ab2=_0x4af57d[_0xd52a('0x25')]||0x0;if(_0x2861c8>_0x4f850e[_0xd52a('0x24')])return _0x3382da(_0xd52a('0x2b'));if(_0x476ab2>_0x4f850e[_0xd52a('0x25')])return _0x3382da(_0xd52a('0x2c'));return _0x337ca6();})[_0xd52a('0xc')](function(_0x439de0){_0x3382da(_0x439de0);});});}module[_0xd52a('0x2d')]={'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 ebdcaba..9dca22f 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 _0x1775=['myappanuglar-secret','app-id','secret','http://localhost:9000'];(function(_0x5f0805,_0xa3a28c){var _0xbbc661=function(_0x3d7e4c){while(--_0x3d7e4c){_0x5f0805['push'](_0x5f0805['shift']());}};_0xbbc661(++_0xa3a28c);}(_0x1775,0x1db));var _0x5177=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x1775[_0x432682];return _0x463d05;};'use strict';module['exports']={'DOMAIN':_0x5177('0x0'),'SESSION_SECRET':_0x5177('0x1'),'GOOGLE_ID':_0x5177('0x2'),'GOOGLE_SECRET':_0x5177('0x3'),'DEBUG':''}; \ No newline at end of file +var _0xcf2f=['app-id','secret','exports','http://localhost:9000','myappanuglar-secret'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcf2f,0xa7));var _0xfcf2=function(_0x4f9835,_0x1c5c29){_0x4f9835=_0x4f9835-0x0;var _0x17c6aa=_0xcf2f[_0x4f9835];return _0x17c6aa;};'use strict';module[_0xfcf2('0x0')]={'DOMAIN':_0xfcf2('0x1'),'SESSION_SECRET':_0xfcf2('0x2'),'GOOGLE_ID':_0xfcf2('0x3'),'GOOGLE_SECRET':_0xfcf2('0x4'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 81d6d66..e0c6612 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x85e7=['fileLogger','../utils/loggers'];(function(_0x5506b2,_0x430302){var _0x3c0f7f=function(_0x442dba){while(--_0x442dba){_0x5506b2['push'](_0x5506b2['shift']());}};_0x3c0f7f(++_0x430302);}(_0x85e7,0xa1));var _0x785e=function(_0xd40e86,_0x36caa1){_0xd40e86=_0xd40e86-0x0;var _0x3135e0=_0x85e7[_0xd40e86];return _0x3135e0;};'use strict';var fileLogger=require(_0x785e('0x0'))[_0x785e('0x1')];module['exports']=fileLogger; \ No newline at end of file +var _0x4b7d=['exports','../utils/loggers','fileLogger'];(function(_0x3be8e8,_0x246a8f){var _0x5f7c64=function(_0x14b674){while(--_0x14b674){_0x3be8e8['push'](_0x3be8e8['shift']());}};_0x5f7c64(++_0x246a8f);}(_0x4b7d,0x13f));var _0xd4b7=function(_0x5a5a7b,_0x290fc2){_0x5a5a7b=_0x5a5a7b-0x0;var _0x3098c5=_0x4b7d[_0x5a5a7b];return _0x3098c5;};'use strict';var fileLogger=require(_0xd4b7('0x0'))[_0xd4b7('0x1')];module[_0xd4b7('0x2')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index b571e11..551590b 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 _0xcc95=['../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','path','../../config/environment','resolve','root','legacy-libs','express','join','../../services/express/index.js','ami'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xcc95,0xc3));var _0x5cc9=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xcc95[_0x3b5250];return _0xc844a1;};'use strict';var path=require(_0x5cc9('0x0'));var cfg=require(_0x5cc9('0x1'));var env={'NODE_PATH':path[_0x5cc9('0x2')](path['join'](cfg[_0x5cc9('0x3')],_0x5cc9('0x4')))};var pm2config={'apps':[{'name':_0x5cc9('0x5'),'script':path[_0x5cc9('0x6')](__dirname,_0x5cc9('0x7')),'env':env},{'name':_0x5cc9('0x8'),'script':path[_0x5cc9('0x6')](__dirname,_0x5cc9('0x9')),'env':env},{'name':_0x5cc9('0xa'),'script':path[_0x5cc9('0x6')](__dirname,_0x5cc9('0xb')),'env':env},{'name':_0x5cc9('0xc'),'script':path[_0x5cc9('0x6')](__dirname,_0x5cc9('0xd')),'env':env},{'name':_0x5cc9('0xe'),'script':path[_0x5cc9('0x6')](__dirname,_0x5cc9('0xf')),'env':env},{'name':_0x5cc9('0x10'),'script':path['join'](__dirname,'../../services/xdr/index.js'),'env':env}]};module['exports']=pm2config; \ No newline at end of file +var _0x3995=['../../services/email/index.js','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','../../config/environment','resolve','join','root','legacy-libs','express','../../services/express/index.js','ami','agi','email'];(function(_0x171b7a,_0xb35bd2){var _0x4fa679=function(_0x18ddca){while(--_0x18ddca){_0x171b7a['push'](_0x171b7a['shift']());}};_0x4fa679(++_0xb35bd2);}(_0x3995,0x9b));var _0x5399=function(_0x3c9fdb,_0x3a964c){_0x3c9fdb=_0x3c9fdb-0x0;var _0x25fe17=_0x3995[_0x3c9fdb];return _0x25fe17;};'use strict';var path=require('path');var cfg=require(_0x5399('0x0'));var env={'NODE_PATH':path[_0x5399('0x1')](path[_0x5399('0x2')](cfg[_0x5399('0x3')],_0x5399('0x4')))};var pm2config={'apps':[{'name':_0x5399('0x5'),'script':path[_0x5399('0x2')](__dirname,_0x5399('0x6')),'env':env},{'name':_0x5399('0x7'),'script':path[_0x5399('0x2')](__dirname,'../../services/ami/index.js'),'env':env},{'name':_0x5399('0x8'),'script':path[_0x5399('0x2')](__dirname,'../../services/agi/index.js'),'env':env},{'name':_0x5399('0x9'),'script':path['join'](__dirname,_0x5399('0xa')),'env':env},{'name':'routing','script':path[_0x5399('0x2')](__dirname,_0x5399('0xb')),'env':env},{'name':_0x5399('0xc'),'script':path[_0x5399('0x2')](__dirname,_0x5399('0xd')),'env':env}]};module[_0x5399('0xe')]=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index e4b10a1..81bbf64 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 _0xca5f=['pm2','bluebird','connect','connected','start','then','stop','disconnect','list','describe','delete','saved'];(function(_0x5523ba,_0x312e5e){var _0x4ce263=function(_0x5d3beb){while(--_0x5d3beb){_0x5523ba['push'](_0x5523ba['shift']());}};_0x4ce263(++_0x312e5e);}(_0xca5f,0x1e0));var _0xfca5=function(_0x28a531,_0xd02938){_0x28a531=_0x28a531-0x0;var _0x59c356=_0xca5f[_0x28a531];return _0x59c356;};'use strict';var pm2=require(_0xfca5('0x0'));var BPromise=require(_0xfca5('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x32fdbe,_0x2ceee1){return pm2[_0xfca5('0x2')](function(_0x34b791){if(_0x34b791){return _0x2ceee1(_0x34b791);}return _0x32fdbe(_0xfca5('0x3'));});});};exports[_0xfca5('0x4')]=function(_0x3028b7){return connect()[_0xfca5('0x5')](function(){return new BPromise(function(_0x54d290,_0x3cd6bf){return pm2[_0xfca5('0x4')](_0x3028b7,function(_0x1f4611,_0x2bcc84){if(_0x1f4611){return _0x3cd6bf(_0x1f4611);}pm2['disconnect']();return _0x54d290(_0x2bcc84);});});});};exports[_0xfca5('0x6')]=function(_0x23e2e6){return connect()[_0xfca5('0x5')](function(){return new BPromise(function(_0x4f6246,_0x9b89a4){return pm2[_0xfca5('0x6')](_0x23e2e6,function(_0x2d59ae,_0x190a9c){if(_0x2d59ae){return _0x9b89a4(_0x2d59ae);}pm2[_0xfca5('0x7')]();return _0x4f6246(_0x190a9c);});});});};exports['restart']=function(_0x1d204f){return connect()['then'](function(){return new BPromise(function(_0x42a919,_0xf6a72e){return pm2['restart'](_0x1d204f,function(_0x4cefbd,_0x558849){if(_0x4cefbd){return _0xf6a72e(_0x4cefbd);}pm2[_0xfca5('0x7')]();return _0x42a919(_0x558849);});});});};exports[_0xfca5('0x8')]=function(){return connect()['then'](function(){return new BPromise(function(_0x30033f,_0x1b3d0b){return pm2['list'](function(_0x39bbbe,_0xf6954b){if(_0x39bbbe){return _0x1b3d0b(_0x39bbbe);}pm2[_0xfca5('0x7')]();return _0x30033f(_0xf6954b);});});});};exports[_0xfca5('0x9')]=function(_0x42cd28){return connect()[_0xfca5('0x5')](function(){return new BPromise(function(_0x5c9547,_0x3a7233){return pm2[_0xfca5('0x9')](_0x42cd28,function(_0x1ef9cf,_0x30bf24){if(_0x1ef9cf){return _0x3a7233(_0x1ef9cf);}pm2[_0xfca5('0x7')]();return _0x5c9547(_0x30bf24);});});});};exports['delete']=function(_0xb2bd6d){return connect()['then'](function(){return new BPromise(function(_0x243a8d,_0x628d05){return pm2[_0xfca5('0xa')](_0xb2bd6d,function(_0x2370c9,_0x375d3e){if(_0x2370c9){return _0x628d05(_0x2370c9);}pm2['disconnect']();return _0x243a8d(_0x375d3e);});});});};exports['dump']=function(){return connect()[_0xfca5('0x5')](function(){return new BPromise(function(_0x52544d,_0x31e5ab){return pm2['dump'](function(_0x3ad899){if(_0x3ad899){return _0x31e5ab(_0x3ad899);}return _0x52544d(_0xfca5('0xb'));});});});}; \ No newline at end of file +var _0x8ded=['stop','restart','list','delete','dump','pm2','./config','connect','connected','start','then','disconnect'];(function(_0x190803,_0x39df52){var _0x2ec77a=function(_0x428272){while(--_0x428272){_0x190803['push'](_0x190803['shift']());}};_0x2ec77a(++_0x39df52);}(_0x8ded,0x7d));var _0xd8de=function(_0x3e5462,_0x33ced5){_0x3e5462=_0x3e5462-0x0;var _0x185b55=_0x8ded[_0x3e5462];return _0x185b55;};'use strict';var pm2=require(_0xd8de('0x0'));var BPromise=require('bluebird');var config=require(_0xd8de('0x1'));function connect(){return new BPromise(function(_0x61ef9,_0x3d2d3c){return pm2[_0xd8de('0x2')](function(_0x1a1aeb){if(_0x1a1aeb){return _0x3d2d3c(_0x1a1aeb);}return _0x61ef9(_0xd8de('0x3'));});});};exports[_0xd8de('0x4')]=function(_0x2af381){return connect()[_0xd8de('0x5')](function(){return new BPromise(function(_0x38d564,_0x487f03){return pm2[_0xd8de('0x4')](_0x2af381,function(_0x5a6903,_0x1b3fdc){if(_0x5a6903){return _0x487f03(_0x5a6903);}pm2[_0xd8de('0x6')]();return _0x38d564(_0x1b3fdc);});});});};exports[_0xd8de('0x7')]=function(_0x186761){return connect()[_0xd8de('0x5')](function(){return new BPromise(function(_0xefe870,_0x46cdf9){return pm2[_0xd8de('0x7')](_0x186761,function(_0x43557c,_0x281d29){if(_0x43557c){return _0x46cdf9(_0x43557c);}pm2[_0xd8de('0x6')]();return _0xefe870(_0x281d29);});});});};exports['restart']=function(_0x46333d){return connect()[_0xd8de('0x5')](function(){return new BPromise(function(_0x47906c,_0x80755f){return pm2[_0xd8de('0x8')](_0x46333d,function(_0x32e81a,_0x398052){if(_0x32e81a){return _0x80755f(_0x32e81a);}pm2[_0xd8de('0x6')]();return _0x47906c(_0x398052);});});});};exports[_0xd8de('0x9')]=function(){return connect()['then'](function(){return new BPromise(function(_0x59d0ca,_0x5566cf){return pm2[_0xd8de('0x9')](function(_0x438951,_0x23815b){if(_0x438951){return _0x5566cf(_0x438951);}pm2['disconnect']();return _0x59d0ca(_0x23815b);});});});};exports['describe']=function(_0x14a3e1){return connect()[_0xd8de('0x5')](function(){return new BPromise(function(_0x4478de,_0x65f770){return pm2['describe'](_0x14a3e1,function(_0x49adab,_0x52a882){if(_0x49adab){return _0x65f770(_0x49adab);}pm2['disconnect']();return _0x4478de(_0x52a882);});});});};exports[_0xd8de('0xa')]=function(_0x3d6338){return connect()[_0xd8de('0x5')](function(){return new BPromise(function(_0x14471c,_0x9b149b){return pm2[_0xd8de('0xa')](_0x3d6338,function(_0x3a936d,_0x494149){if(_0x3a936d){return _0x9b149b(_0x3a936d);}pm2[_0xd8de('0x6')]();return _0x14471c(_0x494149);});});});};exports['dump']=function(){return connect()[_0xd8de('0x5')](function(){return new BPromise(function(_0x5e39ac,_0xbeeed4){return pm2[_0xd8de('0xb')](function(_0x25157b){if(_0x25157b){return _0xbeeed4(_0x25157b);}return _0x5e39ac('saved');});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 647fc8d..1a4c9e3 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 _0x0782=['schedule','defaults','redis','socket.io-emitter','chatTimeout','ChatInteraction','findAll','subtract','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','then','length','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','[CHAT]\x20Error\x20closing\x20interactions','inspect','lodash','moment','ioredis','util','../../config/environment','../../mysqldb'];(function(_0x1c7f15,_0x37a3eb){var _0x366929=function(_0x410a1a){while(--_0x410a1a){_0x1c7f15['push'](_0x1c7f15['shift']());}};_0x366929(++_0x37a3eb);}(_0x0782,0x81));var _0x2078=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x0782[_0x4243a3];return _0x1b2a33;};'use strict';var _=require(_0x2078('0x0'));var moment=require(_0x2078('0x1'));var Redis=require(_0x2078('0x2'));var util=require(_0x2078('0x3'));var config=require(_0x2078('0x4'));var db=require(_0x2078('0x5'))['db'];var logger=require('../logger')(_0x2078('0x6'));config['redis']=_[_0x2078('0x7')](config[_0x2078('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x2078('0x9'))(new Redis(config[_0x2078('0x8')]));function closeInteractions(){var _0x1d8e85=0x0;var _0x281346=[];return db['Setting']['find']({'raw':!![],'attributes':['id',_0x2078('0xa')],'where':{'id':0x1}})['then'](function(_0x3310d2){_0x1d8e85=_0x3310d2[_0x2078('0xa')];if(_0x1d8e85){return db[_0x2078('0xb')][_0x2078('0xc')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x2078('0xd')](_0x3310d2[_0x2078('0xa')],'minutes')}}});}else{return[];}})['then'](function(_0x4e8e23){if(_0x4e8e23&&_0x4e8e23['length']){_0x281346=_['map'](_0x4e8e23||[],'id');logger[_0x2078('0xe')](_0x2078('0xf'),_0x281346[_0x2078('0x10')]());return db[_0x2078('0xb')][_0x2078('0x11')]({'closeReason':_0x2078('0x12'),'disposition':_0x2078('0x13'),'closed':!![],'closedAt':moment()[_0x2078('0x14')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x281346}});}})[_0x2078('0x15')](function(){if(_0x281346&&_0x281346[_0x2078('0x16')]){logger[_0x2078('0xe')](_0x2078('0x17'),_0x281346[_0x2078('0x10')]());for(var _0x2518c5=0x0;_0x2518c5<_0x281346['length'];_0x2518c5++){io[_0x2078('0x18')]('chatInteraction:update',{'id':_0x281346[_0x2518c5],'closed':!![]});}}})['catch'](function(_0x3e4c59){logger['error'](_0x2078('0x19'),_0x3e4c59?util[_0x2078('0x1a')](_0x3e4c59,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xf4c4=['socket.io-emitter','Setting','chatTimeout','ChatInteraction','lastMsgAt','subtract','length','info','[CHAT]\x20Interactions\x20to\x20close:','join','system','format','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','inspect','start','lodash','moment','util','redis','localhost'];(function(_0x5ac969,_0x1274d4){var _0x489619=function(_0x4dcbb8){while(--_0x4dcbb8){_0x5ac969['push'](_0x5ac969['shift']());}};_0x489619(++_0x1274d4);}(_0xf4c4,0x1c9));var _0x4f4c=function(_0x28d7b5,_0x1305a4){_0x28d7b5=_0x28d7b5-0x0;var _0x1ed035=_0xf4c4[_0x28d7b5];return _0x1ed035;};'use strict';var _=require(_0x4f4c('0x0'));var moment=require(_0x4f4c('0x1'));var Redis=require('ioredis');var util=require(_0x4f4c('0x2'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require('../logger')('schedule');config[_0x4f4c('0x3')]=_['defaults'](config['redis'],{'host':_0x4f4c('0x4'),'port':0x18eb});var io=require(_0x4f4c('0x5'))(new Redis(config[_0x4f4c('0x3')]));function closeInteractions(){var _0x4273a5=0x0;var _0x40dd7a=[];return db[_0x4f4c('0x6')]['find']({'raw':!![],'attributes':['id',_0x4f4c('0x7')],'where':{'id':0x1}})['then'](function(_0x2cbe6b){_0x4273a5=_0x2cbe6b['chatTimeout'];if(_0x4273a5){return db[_0x4f4c('0x8')]['findAll']({'raw':!![],'attributes':['id',_0x4f4c('0x9')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x4f4c('0xa')](_0x2cbe6b[_0x4f4c('0x7')],'minutes')}}});}else{return[];}})['then'](function(_0x46624d){if(_0x46624d&&_0x46624d[_0x4f4c('0xb')]){_0x40dd7a=_['map'](_0x46624d||[],'id');logger[_0x4f4c('0xc')](_0x4f4c('0xd'),_0x40dd7a[_0x4f4c('0xe')]());return db[_0x4f4c('0x8')]['update']({'closeReason':_0x4f4c('0xf'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x4f4c('0x10')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x40dd7a}});}})['then'](function(){if(_0x40dd7a&&_0x40dd7a[_0x4f4c('0xb')]){logger[_0x4f4c('0xc')](_0x4f4c('0x11'),_0x40dd7a[_0x4f4c('0xe')]());for(var _0x33385d=0x0;_0x33385d<_0x40dd7a[_0x4f4c('0xb')];_0x33385d++){io[_0x4f4c('0x12')]('chatInteraction:update',{'id':_0x40dd7a[_0x33385d],'closed':!![]});}}})['catch'](function(_0x28ff20){logger['error']('[CHAT]\x20Error\x20closing\x20interactions',_0x28ff20?util[_0x4f4c('0x13')](_0x28ff20,{'showHidden':![],'depth':null}):'');});}exports[_0x4f4c('0x14')]=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 ceec590..fc4cba4 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 _0xf118=['startAllRefreshIntervals','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x6b9475,_0x93a936){var _0x5bb2ca=function(_0x4bf4de){while(--_0x4bf4de){_0x6b9475['push'](_0x6b9475['shift']());}};_0x5bb2ca(++_0x93a936);}(_0xf118,0x113));var _0x8f11=function(_0x51904f,_0x439694){_0x51904f=_0x51904f-0x0;var _0x24dc27=_0xf118[_0x51904f];return _0x24dc27;};'use strict';function start(){var _0x37fec3=require(_0x8f11('0x0'));return _0x37fec3[_0x8f11('0x1')]();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file +var _0x7b6e=['../../api/cloudProvider/cloudProvider.oauth.js','exports'];(function(_0x5619f3,_0x6c71af){var _0xe83580=function(_0x4aea6a){while(--_0x4aea6a){_0x5619f3['push'](_0x5619f3['shift']());}};_0xe83580(++_0x6c71af);}(_0x7b6e,0x1c2));var _0xe7b6=function(_0x3c38c7,_0x14dd97){_0x3c38c7=_0x3c38c7-0x0;var _0x4aa4b1=_0x7b6e[_0x3c38c7];return _0x4aa4b1;};'use strict';function start(){var _0xb2278e=require(_0xe7b6('0x0'));return _0xb2278e['startAllRefreshIntervals']();}module[_0xe7b6('0x1')]={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 81982bc..9d1348c 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 _0xdb0f=['subtractNumber','subtractUnit','join','../../files/reports','%s.%s','basename','savename','extname','existsSync','Sent','message','attachments','text','stringify','info','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','catch','error\x20mail','isNil','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','exec\x20defaul\x20report\x20id:%s','runReport','DefaultReportId','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','MailServerOut','CloudProvider','keys','jobs','map','toString','keyBy','difference','intersection','exists','stop','deleteJob','delete\x20cron','toRun','my\x20id','run\x20job','cron','active','add','start','add\x20cron','stop\x20cron','length','isBetween','startAt','update','update\x20cron','run','lodash','cron-job-manager','jayson/promise','../logger','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','name','Smtp','user','bcc','Report\x20%s\x20last\x20%s\x20%s'];(function(_0x2069be,_0x36d91f){var _0x46a3f2=function(_0x5bb706){while(--_0x5bb706){_0x2069be['push'](_0x2069be['shift']());}};_0x46a3f2(++_0x36d91f);}(_0xdb0f,0x1c4));var _0xfdb0=function(_0x479978,_0x46ab1e){_0x479978=_0x479978-0x0;var _0x567a9f=_0xdb0f[_0x479978];return _0x567a9f;};'use strict';var fs=require('fs');var util=require('util');var path=require('path');var _=require(_0xfdb0('0x0'));var moment=require('moment');var CronJobManager=require(_0xfdb0('0x1'));var jayson=require(_0xfdb0('0x2'));var BPromise=require('bluebird');var logger=require(_0xfdb0('0x3'))('schedule');var db=require('../../mysqldb')['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0xfdb0('0x4'));var client=jayson['client'][_0xfdb0('0x5')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x307438,_0x1d0c67){return function(){logger['info'](_0xfdb0('0x6'),_0x307438[_0xfdb0('0x7')]);var _0x4ae3ca=!![];var _0x31c56a=_0x307438[_0xfdb0('0x8')][_0xfdb0('0x9')]();var _0x551cd8={'account':_0x31c56a,'message':{'from':util[_0xfdb0('0xa')]('\x22%s\x22\x20<%s>',_0x307438[_0xfdb0('0x8')][_0xfdb0('0xb')],_0x307438[_0xfdb0('0x8')][_0xfdb0('0x7')]||_0x307438[_0xfdb0('0x8')][_0xfdb0('0xc')][_0xfdb0('0xd')]),'to':_0x307438['email'],'cc':_0x307438['cc'],'bcc':_0x307438[_0xfdb0('0xe')],'subject':util['format'](_0xfdb0('0xf'),_0x1d0c67[_0xfdb0('0xb')],_0x307438[_0xfdb0('0x10')],_0x307438[_0xfdb0('0x11')])}};var _0x51353c=path[_0xfdb0('0x12')](__dirname,_0xfdb0('0x13'));var _0x54e69f=_0x1d0c67['savename'];var _0x360ff6=util['format'](_0xfdb0('0x14'),path[_0xfdb0('0x15')](_0x1d0c67[_0xfdb0('0x16')],path[_0xfdb0('0x17')](_0x1d0c67[_0xfdb0('0x16')])),'zip');var _0x4f8138=path[_0xfdb0('0x12')](_0x51353c,_0x54e69f);var _0x517d36=path['join'](_0x51353c,_0x360ff6);if(fs[_0xfdb0('0x18')](_0x4f8138)){_0x1d0c67['status']=_0xfdb0('0x19');_0x551cd8[_0xfdb0('0x1a')][_0xfdb0('0x1b')]=[{'filename':_0x54e69f,'path':_0x4f8138}];_0x551cd8[_0xfdb0('0x1a')][_0xfdb0('0x1c')]=util[_0xfdb0('0xa')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0xfdb0('0x1d')](_0x1d0c67,null,0x2));}else if(fs[_0xfdb0('0x18')](_0x517d36)){_0x1d0c67['status']='Sent';_0x551cd8[_0xfdb0('0x1a')]['attachments']=[{'filename':_0x360ff6,'path':_0x517d36}];}else{_0x551cd8[_0xfdb0('0x1a')][_0xfdb0('0x1c')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x307438['sendIfEmpty']){_0x4ae3ca=![];logger[_0xfdb0('0x1e')](_0xfdb0('0x1f'));}}if(_0x4ae3ca){return client[_0xfdb0('0x20')](_0xfdb0('0x21'),_0x551cd8)[_0xfdb0('0x22')](function(_0x4ead5e){if(_0x4ead5e[_0xfdb0('0x23')]){return logger[_0xfdb0('0x23')]('error\x20mail',JSON[_0xfdb0('0x1d')](_0x4ead5e));}return logger[_0xfdb0('0x1e')]('email\x20sent');})[_0xfdb0('0x24')](function(_0x330d38){return logger[_0xfdb0('0x23')](_0xfdb0('0x25'),JSON[_0xfdb0('0x1d')](_0x330d38));});}};}function handleError(){return function(_0x38f9f6){return logger[_0xfdb0('0x23')](JSON[_0xfdb0('0x1d')](_0x38f9f6));};}function handleResult(_0x576332){return function(_0x4bca27){logger[_0xfdb0('0x1e')]('data',JSON[_0xfdb0('0x1d')](_0x4bca27));if(_0x576332[_0xfdb0('0x8')]&&_0x576332[_0xfdb0('0x8')][_0xfdb0('0xc')]&&!_[_0xfdb0('0x26')](_0x576332['email'])){setTimeout(handleSendEmail(_0x576332,_0x4bca27),0x3c*0x3e8);}};}function handleJob(_0x1749c6){return function(){try{if(_['isNil'](_0x1749c6[_0xfdb0('0x10')])){return logger[_0xfdb0('0x1e')]('subtractNumber\x20null\x20or\x20undefined');}if(_['isNil'](_0x1749c6[_0xfdb0('0x11')])){return logger[_0xfdb0('0x1e')](_0xfdb0('0x27'));}var _0x18b261={'startDate':moment()['subtract'](_0x1749c6[_0xfdb0('0x10')],_0x1749c6[_0xfdb0('0x11')])[_0xfdb0('0xa')](_0xfdb0('0x28')),'endDate':moment()[_0xfdb0('0xa')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0xfdb0('0x29'),'output':_0x1749c6[_0xfdb0('0x2a')],'name':_0x1749c6[_0xfdb0('0xb')]};if(!_['isNil'](_0x1749c6['DefaultReportId'])){logger['info'](_0xfdb0('0x2b'),_0x1749c6['DefaultReportId']);return analyticDefaultReportController[_0xfdb0('0x2c')]({'id':_0x1749c6[_0xfdb0('0x2d')]},_0x18b261)['then'](handleResult(_0x1749c6))[_0xfdb0('0x24')](handleError());}if(!_[_0xfdb0('0x26')](_0x1749c6[_0xfdb0('0x2e')])){logger[_0xfdb0('0x1e')](_0xfdb0('0x2f'),_0x1749c6[_0xfdb0('0x2e')]);return analyticCustomReportController[_0xfdb0('0x2c')]({'id':_0x1749c6[_0xfdb0('0x2e')]},_0x18b261)['then'](handleResult(_0x1749c6))[_0xfdb0('0x24')](handleError());}}catch(_0x552a63){logger[_0xfdb0('0x23')](JSON['stringify'](_0x552a63));}return logger[_0xfdb0('0x1e')](_0xfdb0('0x30'));};}function getJobs(_0xae797b){var _0x417267={};if(_0xae797b){_0x417267['id']=_0xae797b;}return db[_0xfdb0('0x31')]['findAll']({'where':_0x417267,'include':[{'model':db[_0xfdb0('0x8')],'attributes':['id','name',_0xfdb0('0x7')],'include':[{'model':db[_0xfdb0('0x32')],'as':_0xfdb0('0xc'),'include':[{'model':db[_0xfdb0('0x33')],'as':'CloudProvider'}]}]}]})[_0xfdb0('0x22')](function(_0x4ef078){var _0x3e9de3=_[_0xfdb0('0x34')](manager[_0xfdb0('0x35')]);var _0x5bf300=_[_0xfdb0('0x36')](_0x4ef078,function(_0x5557a6){return _0x5557a6['id'][_0xfdb0('0x37')]();});var _0xf4e247=_[_0xfdb0('0x38')](_0x4ef078,function(_0x245ad4){return _0x245ad4['id'][_0xfdb0('0x37')]();});var _0x33a0d8=_0xae797b?_0x5bf300:_[_0xfdb0('0x39')](_0x5bf300,_0x3e9de3);var _0x31e807=_[_0xfdb0('0x3a')](_0x5bf300,_0x3e9de3);var _0x7561ad=_[_0xfdb0('0x39')](_0x3e9de3,_0x5bf300);var _0x4a1dba;var _0x5efaa2;for(_0x4a1dba=0x0;_0x4a1dba<_0x7561ad['length']&&!_0xae797b;_0x4a1dba+=0x1){_0x5efaa2=_0x7561ad[_0x4a1dba]['toString']();if(manager[_0xfdb0('0x3b')](_0x5efaa2)){manager[_0xfdb0('0x3c')](_0x5efaa2);manager[_0xfdb0('0x3d')](_0x5efaa2);logger['info'](_0xfdb0('0x3e'),_0x5efaa2);}}logger[_0xfdb0('0x1e')](_0xfdb0('0x3f'),JSON[_0xfdb0('0x1d')](_0x33a0d8));for(_0x4a1dba=0x0;_0x4a1dba<_0x33a0d8['length'];_0x4a1dba+=0x1){_0x5efaa2=_0x33a0d8[_0x4a1dba]['toString']();logger[_0xfdb0('0x1e')]('index',_0x5efaa2);if(_0xae797b){logger['info'](_0xfdb0('0x40'),_0xae797b);logger[_0xfdb0('0x1e')](JSON[_0xfdb0('0x1d')](_0xf4e247[_0x5efaa2]));BPromise['resolve']()[_0xfdb0('0x22')](handleJob(_0xf4e247[_0x5efaa2]));logger[_0xfdb0('0x1e')](_0xfdb0('0x41'),_0xf4e247[_0x5efaa2]['name'],_0xf4e247[_0x5efaa2][_0xfdb0('0x42')]);}else if(_0xf4e247[_0x5efaa2][_0xfdb0('0x42')]&&_0xf4e247[_0x5efaa2][_0xfdb0('0x43')]&&moment()['isBetween'](_0xf4e247[_0x5efaa2]['startAt'],_0xf4e247[_0x5efaa2]['endAt'])){manager[_0xfdb0('0x44')](_0x5efaa2,_0xf4e247[_0x5efaa2]['cron'],handleJob(_0xf4e247[_0x5efaa2]));manager[_0xfdb0('0x45')](_0x5efaa2);logger[_0xfdb0('0x1e')](_0xfdb0('0x46'),_0xf4e247[_0x5efaa2]['name'],_0xf4e247[_0x5efaa2][_0xfdb0('0x42')]);}else if(manager[_0xfdb0('0x3b')](_0x5efaa2)){manager[_0xfdb0('0x3c')](_0x5efaa2);manager['deleteJob'](_0x5efaa2);logger[_0xfdb0('0x1e')](_0xfdb0('0x47'),_0xf4e247[_0x5efaa2][_0xfdb0('0xb')],_0xf4e247[_0x5efaa2][_0xfdb0('0x42')]);}}for(_0x4a1dba=0x0,_0x5efaa2;_0x4a1dba<_0x31e807[_0xfdb0('0x48')]&&!_0xae797b;_0x4a1dba+=0x1){_0x5efaa2=_0x31e807[_0x4a1dba][_0xfdb0('0x37')]();if(manager[_0xfdb0('0x3b')](_0x5efaa2)){if(_0xf4e247[_0x5efaa2][_0xfdb0('0x42')]&&_0xf4e247[_0x5efaa2][_0xfdb0('0x43')]&&moment()[_0xfdb0('0x49')](_0xf4e247[_0x5efaa2][_0xfdb0('0x4a')],_0xf4e247[_0x5efaa2]['endAt'])){manager[_0xfdb0('0x4b')](_0x5efaa2,_0xf4e247[_0x5efaa2][_0xfdb0('0x42')],handleJob(_0xf4e247[_0x5efaa2]));logger['info'](_0xfdb0('0x4c'),_0xf4e247[_0x5efaa2][_0xfdb0('0xb')],_0xf4e247[_0x5efaa2][_0xfdb0('0x42')]);}else{manager[_0xfdb0('0x3c')](_0x5efaa2);manager[_0xfdb0('0x3d')](_0x5efaa2);logger[_0xfdb0('0x1e')](_0xfdb0('0x47'),_0xf4e247[_0x5efaa2][_0xfdb0('0xb')],_0xf4e247[_0x5efaa2][_0xfdb0('0x42')]);}}}})[_0xfdb0('0x24')](function(_0x221e28){logger['error'](JSON[_0xfdb0('0x1d')](_0x221e28));});}exports[_0xfdb0('0x4d')]=function(_0x467a2a){return getJobs(_0x467a2a);};exports[_0xfdb0('0x45')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x5974=['jobs','map','toString','keyBy','difference','intersection','length','exists','deleteJob','delete\x20cron','toRun','index','resolve','run\x20job','cron','active','isBetween','endAt','add','start','add\x20cron','stop','stop\x20cron','startAt','update','update\x20cron','run','util','path','moment','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','getSmtpOptions','format','\x22%s\x22\x20<%s>','name','email','user','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','savename','%s.%s','zip','join','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','existsSync','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','SendMail','then','error','error\x20mail','data','Smtp','subtractNumber\x20null\x20or\x20undefined','isNil','subtractUnit','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','exec\x20defaul\x20report\x20id:%s','runReport','DefaultReportId','catch','CustomReportId','exec\x20custom\x20report\x20id:%s','findAll','MailServerOut','CloudProvider','keys'];(function(_0x20ef3d,_0x4feb9a){var _0x530ebb=function(_0xbf8a7d){while(--_0xbf8a7d){_0x20ef3d['push'](_0x20ef3d['shift']());}};_0x530ebb(++_0x4feb9a);}(_0x5974,0x1d8));var _0x4597=function(_0x59bd3b,_0x53eff9){_0x59bd3b=_0x59bd3b-0x0;var _0x586c53=_0x5974[_0x59bd3b];return _0x586c53;};'use strict';var fs=require('fs');var util=require(_0x4597('0x0'));var path=require(_0x4597('0x1'));var _=require('lodash');var moment=require(_0x4597('0x2'));var CronJobManager=require('cron-job-manager');var jayson=require(_0x4597('0x3'));var BPromise=require(_0x4597('0x4'));var logger=require(_0x4597('0x5'))(_0x4597('0x6'));var db=require(_0x4597('0x7'))['db'];var analyticCustomReportController=require(_0x4597('0x8'));var analyticDefaultReportController=require(_0x4597('0x9'));var client=jayson[_0x4597('0xa')][_0x4597('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x50fd44,_0x3f9bb2){return function(){logger[_0x4597('0xc')](_0x4597('0xd'),_0x50fd44['email']);var _0x50360d=!![];var _0x1674ca=_0x50fd44[_0x4597('0xe')][_0x4597('0xf')]();var _0x516836={'account':_0x1674ca,'message':{'from':util[_0x4597('0x10')](_0x4597('0x11'),_0x50fd44[_0x4597('0xe')][_0x4597('0x12')],_0x50fd44[_0x4597('0xe')][_0x4597('0x13')]||_0x50fd44[_0x4597('0xe')]['Smtp'][_0x4597('0x14')]),'to':_0x50fd44[_0x4597('0x13')],'cc':_0x50fd44['cc'],'bcc':_0x50fd44['bcc'],'subject':util['format'](_0x4597('0x15'),_0x3f9bb2['name'],_0x50fd44[_0x4597('0x16')],_0x50fd44['subtractUnit'])}};var _0x9a9ac5=path['join'](__dirname,'../../files/reports');var _0x5317d0=_0x3f9bb2[_0x4597('0x17')];var _0x21f502=util[_0x4597('0x10')](_0x4597('0x18'),path['basename'](_0x3f9bb2[_0x4597('0x17')],path['extname'](_0x3f9bb2['savename'])),_0x4597('0x19'));var _0xd821d7=path['join'](_0x9a9ac5,_0x5317d0);var _0xceb374=path[_0x4597('0x1a')](_0x9a9ac5,_0x21f502);if(fs['existsSync'](_0xd821d7)){_0x3f9bb2[_0x4597('0x1b')]=_0x4597('0x1c');_0x516836[_0x4597('0x1d')][_0x4597('0x1e')]=[{'filename':_0x5317d0,'path':_0xd821d7}];_0x516836[_0x4597('0x1d')][_0x4597('0x1f')]=util['format'](_0x4597('0x20'),JSON[_0x4597('0x21')](_0x3f9bb2,null,0x2));}else if(fs[_0x4597('0x22')](_0xceb374)){_0x3f9bb2['status']=_0x4597('0x1c');_0x516836['message'][_0x4597('0x1e')]=[{'filename':_0x21f502,'path':_0xceb374}];}else{_0x516836[_0x4597('0x1d')][_0x4597('0x1f')]=_0x4597('0x23');if(!_0x50fd44[_0x4597('0x24')]){_0x50360d=![];logger[_0x4597('0xc')](_0x4597('0x25'));}}if(_0x50360d){return client['request'](_0x4597('0x26'),_0x516836)[_0x4597('0x27')](function(_0x36168d){if(_0x36168d['error']){return logger[_0x4597('0x28')](_0x4597('0x29'),JSON[_0x4597('0x21')](_0x36168d));}return logger[_0x4597('0xc')]('email\x20sent');})['catch'](function(_0x37befe){return logger[_0x4597('0x28')]('error\x20mail',JSON[_0x4597('0x21')](_0x37befe));});}};}function handleError(){return function(_0x47fb0b){return logger[_0x4597('0x28')](JSON[_0x4597('0x21')](_0x47fb0b));};}function handleResult(_0x3a6858){return function(_0x22bbf9){logger[_0x4597('0xc')](_0x4597('0x2a'),JSON['stringify'](_0x22bbf9));if(_0x3a6858[_0x4597('0xe')]&&_0x3a6858[_0x4597('0xe')][_0x4597('0x2b')]&&!_['isNil'](_0x3a6858['email'])){setTimeout(handleSendEmail(_0x3a6858,_0x22bbf9),0x3c*0x3e8);}};}function handleJob(_0x2de621){return function(){try{if(_['isNil'](_0x2de621[_0x4597('0x16')])){return logger[_0x4597('0xc')](_0x4597('0x2c'));}if(_[_0x4597('0x2d')](_0x2de621[_0x4597('0x2e')])){return logger[_0x4597('0xc')](_0x4597('0x2f'));}var _0x40388f={'startDate':moment()[_0x4597('0x30')](_0x2de621[_0x4597('0x16')],_0x2de621[_0x4597('0x2e')])[_0x4597('0x10')](_0x4597('0x31')),'endDate':moment()['format'](_0x4597('0x31')),'type':_0x4597('0x32'),'output':_0x2de621[_0x4597('0x33')],'name':_0x2de621[_0x4597('0x12')]};if(!_[_0x4597('0x2d')](_0x2de621['DefaultReportId'])){logger[_0x4597('0xc')](_0x4597('0x34'),_0x2de621['DefaultReportId']);return analyticDefaultReportController[_0x4597('0x35')]({'id':_0x2de621[_0x4597('0x36')]},_0x40388f)[_0x4597('0x27')](handleResult(_0x2de621))[_0x4597('0x37')](handleError());}if(!_[_0x4597('0x2d')](_0x2de621[_0x4597('0x38')])){logger[_0x4597('0xc')](_0x4597('0x39'),_0x2de621['CustomReportId']);return analyticCustomReportController['runReport']({'id':_0x2de621[_0x4597('0x38')]},_0x40388f)[_0x4597('0x27')](handleResult(_0x2de621))[_0x4597('0x37')](handleError());}}catch(_0x41b214){logger['error'](JSON[_0x4597('0x21')](_0x41b214));}return logger[_0x4597('0xc')]('no\x20report\x20id');};}function getJobs(_0x2f539f){var _0x485c82={};if(_0x2f539f){_0x485c82['id']=_0x2f539f;}return db['Schedule'][_0x4597('0x3a')]({'where':_0x485c82,'include':[{'model':db[_0x4597('0xe')],'attributes':['id',_0x4597('0x12'),'email'],'include':[{'model':db[_0x4597('0x3b')],'as':'Smtp','include':[{'model':db['CloudProvider'],'as':_0x4597('0x3c')}]}]}]})[_0x4597('0x27')](function(_0x1a4ce7){var _0x3bccb7=_[_0x4597('0x3d')](manager[_0x4597('0x3e')]);var _0x6d1eab=_[_0x4597('0x3f')](_0x1a4ce7,function(_0x3d7351){return _0x3d7351['id'][_0x4597('0x40')]();});var _0x5acbcb=_[_0x4597('0x41')](_0x1a4ce7,function(_0x2805f2){return _0x2805f2['id'][_0x4597('0x40')]();});var _0x56f8cd=_0x2f539f?_0x6d1eab:_[_0x4597('0x42')](_0x6d1eab,_0x3bccb7);var _0x4e1126=_[_0x4597('0x43')](_0x6d1eab,_0x3bccb7);var _0x14d0c5=_[_0x4597('0x42')](_0x3bccb7,_0x6d1eab);var _0x3faa3a;var _0x382b4d;for(_0x3faa3a=0x0;_0x3faa3a<_0x14d0c5[_0x4597('0x44')]&&!_0x2f539f;_0x3faa3a+=0x1){_0x382b4d=_0x14d0c5[_0x3faa3a][_0x4597('0x40')]();if(manager[_0x4597('0x45')](_0x382b4d)){manager['stop'](_0x382b4d);manager[_0x4597('0x46')](_0x382b4d);logger[_0x4597('0xc')](_0x4597('0x47'),_0x382b4d);}}logger['info'](_0x4597('0x48'),JSON[_0x4597('0x21')](_0x56f8cd));for(_0x3faa3a=0x0;_0x3faa3a<_0x56f8cd[_0x4597('0x44')];_0x3faa3a+=0x1){_0x382b4d=_0x56f8cd[_0x3faa3a][_0x4597('0x40')]();logger[_0x4597('0xc')](_0x4597('0x49'),_0x382b4d);if(_0x2f539f){logger[_0x4597('0xc')]('my\x20id',_0x2f539f);logger[_0x4597('0xc')](JSON[_0x4597('0x21')](_0x5acbcb[_0x382b4d]));BPromise[_0x4597('0x4a')]()['then'](handleJob(_0x5acbcb[_0x382b4d]));logger[_0x4597('0xc')](_0x4597('0x4b'),_0x5acbcb[_0x382b4d]['name'],_0x5acbcb[_0x382b4d]['cron']);}else if(_0x5acbcb[_0x382b4d][_0x4597('0x4c')]&&_0x5acbcb[_0x382b4d][_0x4597('0x4d')]&&moment()[_0x4597('0x4e')](_0x5acbcb[_0x382b4d]['startAt'],_0x5acbcb[_0x382b4d][_0x4597('0x4f')])){manager[_0x4597('0x50')](_0x382b4d,_0x5acbcb[_0x382b4d][_0x4597('0x4c')],handleJob(_0x5acbcb[_0x382b4d]));manager[_0x4597('0x51')](_0x382b4d);logger[_0x4597('0xc')](_0x4597('0x52'),_0x5acbcb[_0x382b4d]['name'],_0x5acbcb[_0x382b4d][_0x4597('0x4c')]);}else if(manager[_0x4597('0x45')](_0x382b4d)){manager[_0x4597('0x53')](_0x382b4d);manager['deleteJob'](_0x382b4d);logger[_0x4597('0xc')](_0x4597('0x54'),_0x5acbcb[_0x382b4d][_0x4597('0x12')],_0x5acbcb[_0x382b4d]['cron']);}}for(_0x3faa3a=0x0,_0x382b4d;_0x3faa3a<_0x4e1126['length']&&!_0x2f539f;_0x3faa3a+=0x1){_0x382b4d=_0x4e1126[_0x3faa3a][_0x4597('0x40')]();if(manager[_0x4597('0x45')](_0x382b4d)){if(_0x5acbcb[_0x382b4d][_0x4597('0x4c')]&&_0x5acbcb[_0x382b4d]['active']&&moment()['isBetween'](_0x5acbcb[_0x382b4d][_0x4597('0x55')],_0x5acbcb[_0x382b4d][_0x4597('0x4f')])){manager[_0x4597('0x56')](_0x382b4d,_0x5acbcb[_0x382b4d]['cron'],handleJob(_0x5acbcb[_0x382b4d]));logger[_0x4597('0xc')](_0x4597('0x57'),_0x5acbcb[_0x382b4d][_0x4597('0x12')],_0x5acbcb[_0x382b4d]['cron']);}else{manager[_0x4597('0x53')](_0x382b4d);manager[_0x4597('0x46')](_0x382b4d);logger[_0x4597('0xc')](_0x4597('0x54'),_0x5acbcb[_0x382b4d][_0x4597('0x12')],_0x5acbcb[_0x382b4d][_0x4597('0x4c')]);}}}})[_0x4597('0x37')](function(_0x45ad97){logger[_0x4597('0x28')](JSON[_0x4597('0x21')](_0x45ad97));});}exports[_0x4597('0x58')]=function(_0x744e4a){return getJobs(_0x744e4a);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index db7dac9..3319b1f 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 _0xae87=['[RECORDING:%d]\x20Get\x20transcript','Transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','SentimentScore','Positive','Neutral','FAILED','resolve','sentiment','Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','Sentiment','Negative','name','SequelizeValidationError','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','Transcribe\x20not\x20configured','transcribeAccountId','push','all','catch','error','inspect','start','bluebird','../../mysqldb','transcribe','TranscribeService','getTranscriptionJob','Comprehend','substring','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','fileText','COMPLETED','TranscriptionJob','TranscriptFileUri'];(function(_0x58af5d,_0x3b13c1){var _0x16645e=function(_0x2c7b8b){while(--_0x2c7b8b){_0x58af5d['push'](_0x58af5d['shift']());}};_0x16645e(++_0x3b13c1);}(_0xae87,0x1ce));var _0x7ae8=function(_0x37ae26,_0x2ecd70){_0x37ae26=_0x37ae26-0x0;var _0x1b1902=_0xae87[_0x37ae26];return _0x1b1902;};var _=require('lodash');var AWS=require('aws-sdk');var rp=require('request-promise');var util=require('util');var BPromise=require(_0x7ae8('0x0'));var db=require(_0x7ae8('0x1'))['db'];var logger=require('../../config/logger')(_0x7ae8('0x2'));function getTranscriptionJob(_0x4a22a5,_0x4ca11e,_0x3b95c1,_0x33b313){return new Promise(function(_0x141978,_0x3b6a2d){var _0x57d2f2=new AWS[(_0x7ae8('0x3'))]({'accessKeyId':_0x4ca11e,'secretAccessKey':_0x4a22a5,'region':_0x3b95c1});_0x57d2f2[_0x7ae8('0x4')]({'TranscriptionJobName':_0x33b313},function(_0x26d4bb,_0x2aa2d5){if(_0x26d4bb){return _0x3b6a2d(_0x26d4bb);}else{return _0x141978(_0x2aa2d5);}});});}function sentiment(_0x1f049b,_0x45dfc2,_0x2138eb,_0x48d84d,_0x4a63d6){return new Promise(function(_0x2cc5f6,_0x334ae7){var _0x595760=new AWS[(_0x7ae8('0x5'))]({'accessKeyId':_0x45dfc2,'secretAccessKey':_0x1f049b,'region':_0x2138eb});_0x595760['detectSentiment']({'Text':_0x48d84d,'LanguageCode':_0x4a63d6[_0x7ae8('0x6')](0x0,0x2)},function(_0x5e7200,_0x24bddd){if(_0x5e7200){return _0x334ae7(_0x5e7200);}else{return _0x2cc5f6(_0x24bddd);}});});}function checkTranscribeJob(_0x4bf950,_0x218df1,_0x428e16){var _0x3e41c1;return new BPromise(function(_0x510852,_0x42af18){logger[_0x7ae8('0x7')](util['format'](_0x7ae8('0x8'),_0x4bf950['id'],_0x4bf950[_0x7ae8('0x9')]));return getTranscriptionJob(_0x428e16[_0x7ae8('0xa')],_0x428e16[_0x7ae8('0xb')],_0x218df1[_0x7ae8('0xc')],_0x4bf950[_0x7ae8('0x9')])[_0x7ae8('0xd')](function(_0x16fbcc){logger[_0x7ae8('0x7')](util[_0x7ae8('0xe')](_0x7ae8('0xf'),_0x4bf950['id'],_0x4bf950[_0x7ae8('0x9')],_0x16fbcc['TranscriptionJob'][_0x7ae8('0x10')]));if(!_0x4bf950[_0x7ae8('0x11')]){switch(_0x16fbcc['TranscriptionJob'][_0x7ae8('0x10')]){case _0x7ae8('0x12'):var _0x408e0b={'transcribeStatus':_0x16fbcc[_0x7ae8('0x13')]['TranscriptionJobStatus'],'fileUri':_0x16fbcc['TranscriptionJob']['Transcript'][_0x7ae8('0x14')]};logger[_0x7ae8('0x7')](util['format'](_0x7ae8('0x15'),_0x4bf950['id']));return rp({'uri':_0x16fbcc['TranscriptionJob'][_0x7ae8('0x16')][_0x7ae8('0x14')],'json':!![]})[_0x7ae8('0xd')](function(_0x35cbed){logger[_0x7ae8('0x7')](util[_0x7ae8('0xe')](_0x7ae8('0x17'),_0x4bf950['id']));if(_0x35cbed&&_0x35cbed[_0x7ae8('0x18')]&&_0x35cbed[_0x7ae8('0x18')][_0x7ae8('0x19')]&&_0x35cbed[_0x7ae8('0x18')][_0x7ae8('0x19')][_0x7ae8('0x1a')]){_0x408e0b[_0x7ae8('0x11')]='';for(var _0x2e11d9=0x0;_0x2e11d9<_0x35cbed['results']['transcripts'][_0x7ae8('0x1a')];_0x2e11d9++){_0x408e0b['fileText']+=_0x35cbed['results'][_0x7ae8('0x19')][_0x2e11d9]['transcript']+'';}}return _0x4bf950[_0x7ae8('0x1b')](_0x408e0b);})[_0x7ae8('0xd')](function(){logger['info'](util[_0x7ae8('0xe')](_0x7ae8('0x1c'),_0x4bf950['id']));if(!_0x4bf950[_0x7ae8('0x1d')]){throw new db[(_0x7ae8('0x1e'))][(_0x7ae8('0x1f'))](_0x7ae8('0x20'));}if(!_0x218df1['sentiment']||!_0x218df1[_0x7ae8('0x21')]||!_0x218df1['sentimentRegion']||!_0x218df1[_0x7ae8('0x22')]||!_0x218df1[_0x7ae8('0x23')]){throw new db[(_0x7ae8('0x1e'))]['ValidationError'](_0x7ae8('0x24'));}if(!_0x408e0b[_0x7ae8('0x11')]){throw new Error(_0x7ae8('0x25'));}if(_0x218df1['sentimentAccountId']===_0x428e16['id']){return _0x428e16;}else{return db[_0x7ae8('0x26')][_0x7ae8('0x27')]({'where':{'id':_settings[_0x7ae8('0x21')]}});}})[_0x7ae8('0xd')](function(_0x4d7c50){if(!_0x4d7c50){throw new db[(_0x7ae8('0x1e'))][(_0x7ae8('0x1f'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x4d7c50[_0x7ae8('0xa')]||!_0x4d7c50[_0x7ae8('0xb')]){throw new db[(_0x7ae8('0x1e'))]['ValidationError'](_0x7ae8('0x28'));}_0x3e41c1=_0x4d7c50;logger[_0x7ae8('0x7')](util[_0x7ae8('0xe')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x4bf950['id']));return sentiment(_0x3e41c1[_0x7ae8('0xa')],_0x3e41c1['data2'],_0x218df1['sentimentRegion'],_0x408e0b['fileText'],_0x218df1[_0x7ae8('0x22')]);})[_0x7ae8('0xd')](function(_0x533bf8){logger[_0x7ae8('0x7')](util[_0x7ae8('0xe')](_0x7ae8('0x29'),_0x4bf950['id']));return _0x4bf950[_0x7ae8('0x1b')]({'sentiment':_0x533bf8['Sentiment'],'sPositive':_0x533bf8[_0x7ae8('0x2a')][_0x7ae8('0x2b')],'sNegative':_0x533bf8[_0x7ae8('0x2a')]['Negative'],'sMixed':_0x533bf8[_0x7ae8('0x2a')]['Mixed'],'sNeutral':_0x533bf8[_0x7ae8('0x2a')][_0x7ae8('0x2c')]});})[_0x7ae8('0xd')](function(){logger[_0x7ae8('0x7')](util['format'](_0x7ae8('0x1c'),_0x4bf950['id']));_0x510852();});case _0x7ae8('0x2d'):return _0x4bf950[_0x7ae8('0x1b')]({'transcribeStatus':'FAILED','failureReason':_0x16fbcc[_0x7ae8('0x13')]['FailureReason']})['then'](function(){logger[_0x7ae8('0x7')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x4bf950['id']));_0x510852();});default:logger[_0x7ae8('0x7')](util[_0x7ae8('0xe')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x4bf950['id']));break;}}else{return BPromise[_0x7ae8('0x2e')]()[_0x7ae8('0xd')](function(){if(!_0x4bf950[_0x7ae8('0x1d')]){throw new db['Sequelize'][(_0x7ae8('0x1f'))](_0x7ae8('0x20'));}if(!_0x218df1[_0x7ae8('0x2f')]||!_0x218df1[_0x7ae8('0x21')]||!_0x218df1['sentimentRegion']||!_0x218df1[_0x7ae8('0x22')]||!_0x218df1[_0x7ae8('0x23')]){throw new db[(_0x7ae8('0x1e'))][(_0x7ae8('0x1f'))](_0x7ae8('0x24'));}if(!_0x4bf950['fileText']){throw new Error('Transcript\x20not\x20available');}if(_0x218df1['sentimentAccountId']===_0x428e16['id']){return _0x428e16;}else{return db[_0x7ae8('0x26')][_0x7ae8('0x27')]({'where':{'id':_settings[_0x7ae8('0x21')]}});}})[_0x7ae8('0xd')](function(_0x4e2adb){if(!_0x4e2adb){throw new db[(_0x7ae8('0x1e'))][(_0x7ae8('0x1f'))](_0x7ae8('0x30'));}if(!_0x4e2adb[_0x7ae8('0xa')]||!_0x4e2adb[_0x7ae8('0xb')]){throw new db[(_0x7ae8('0x1e'))][(_0x7ae8('0x1f'))](_0x7ae8('0x28'));}_0x3e41c1=_0x4e2adb;logger[_0x7ae8('0x7')](util[_0x7ae8('0xe')](_0x7ae8('0x31'),_0x4bf950['id']));return sentiment(_0x3e41c1[_0x7ae8('0xa')],_0x3e41c1[_0x7ae8('0xb')],_0x218df1[_0x7ae8('0x32')],_0x4bf950[_0x7ae8('0x11')],_0x218df1[_0x7ae8('0x22')]);})[_0x7ae8('0xd')](function(_0x36f942){logger[_0x7ae8('0x7')](util['format'](_0x7ae8('0x29'),_0x4bf950['id']));return _0x4bf950['update']({'sentiment':_0x36f942[_0x7ae8('0x33')],'sPositive':_0x36f942[_0x7ae8('0x2a')][_0x7ae8('0x2b')],'sNegative':_0x36f942[_0x7ae8('0x2a')][_0x7ae8('0x34')],'sMixed':_0x36f942[_0x7ae8('0x2a')]['Mixed'],'sNeutral':_0x36f942[_0x7ae8('0x2a')][_0x7ae8('0x2c')],'transcribeStatus':_0x7ae8('0x12')});})[_0x7ae8('0xd')](function(){logger[_0x7ae8('0x7')](util[_0x7ae8('0xe')](_0x7ae8('0x1c'),_0x4bf950['id']));_0x510852();});}})['catch'](function(_0x5eee24){if(_0x5eee24){if(!_0x5eee24[_0x7ae8('0x35')]||_0x5eee24[_0x7ae8('0x35')]!==_0x7ae8('0x36')){logger['error'](util[_0x7ae8('0xe')](_0x7ae8('0x37'),_0x4bf950['id']),util['inspect'](_0x5eee24,{'showHidden':![],'depth':null}));}}_0x510852();});});}function checkTranscribe(){var _0x42ec4a;var _0x10e6b9;var _0x5c6435;return db[_0x7ae8('0x38')][_0x7ae8('0x39')]({'where':{'transcribeStatus':_0x7ae8('0x3a')}})['then'](function(_0x58f513){if(!_0x58f513||!_0x58f513['length']){throw new db['Sequelize'][(_0x7ae8('0x1f'))](_0x7ae8('0x3b'));}_0x42ec4a=_0x58f513;return db['Setting'][_0x7ae8('0x27')]({'where':{'id':0x1}});})[_0x7ae8('0xd')](function(_0x21dac6){if(!_0x21dac6){throw new db[(_0x7ae8('0x1e'))][(_0x7ae8('0x1f'))](_0x7ae8('0x3c'));}_0x10e6b9=_0x21dac6;if(!_0x10e6b9[_0x7ae8('0x2')]||!_0x10e6b9['transcribeAccountId']||!_0x10e6b9[_0x7ae8('0xc')]||!_0x10e6b9['language']||!_0x10e6b9[_0x7ae8('0x23')]){throw new db[(_0x7ae8('0x1e'))]['ValidationError'](_0x7ae8('0x3d'));}return db['CloudProvider'][_0x7ae8('0x27')]({'where':{'id':_0x10e6b9[_0x7ae8('0x3e')]}});})[_0x7ae8('0xd')](function(_0x2af06d){if(!_0x2af06d){throw new db[(_0x7ae8('0x1e'))]['ValidationError'](_0x7ae8('0x30'));}if(!_0x2af06d['data1']||!_0x2af06d[_0x7ae8('0xb')]){throw new db[(_0x7ae8('0x1e'))][(_0x7ae8('0x1f'))](_0x7ae8('0x28'));}_0x5c6435=_0x2af06d;var _0xf5e180=[];_0x42ec4a['forEach'](function(_0x5c2bae){_0xf5e180[_0x7ae8('0x3f')](checkTranscribeJob(_0x5c2bae,_0x10e6b9,_0x5c6435));});return BPromise[_0x7ae8('0x40')](_0xf5e180);})[_0x7ae8('0x41')](function(_0x1e6eb8){if(_0x1e6eb8){if(!_0x1e6eb8[_0x7ae8('0x35')]||_0x1e6eb8[_0x7ae8('0x35')]!==_0x7ae8('0x36')){logger[_0x7ae8('0x42')](util[_0x7ae8('0x43')](_0x1e6eb8,{'showHidden':![],'depth':null}));}}});}exports[_0x7ae8('0x44')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xdf79=['Mixed','Neutral','FAILED','update','FailureReason','tempSentiment','Transcript\x20not\x20available','CloudProvider','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Sentiment','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','findOne','Settings\x20not\x20available','transcribe','Transcribe\x20not\x20configured','forEach','all','start','request-promise','util','bluebird','../../mysqldb','../../config/logger','getTranscriptionJob','detectSentiment','substring','info','format','data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','transcribeName','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','length','transcripts','transcript','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Positive','SentimentScore','Negative'];(function(_0x19b3f9,_0xade753){var _0x18c3f6=function(_0x21439f){while(--_0x21439f){_0x19b3f9['push'](_0x19b3f9['shift']());}};_0x18c3f6(++_0xade753);}(_0xdf79,0xa7));var _0x9df7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xdf79[_0x14add3];return _0x4a174f;};var _=require('lodash');var AWS=require('aws-sdk');var rp=require(_0x9df7('0x0'));var util=require(_0x9df7('0x1'));var BPromise=require(_0x9df7('0x2'));var db=require(_0x9df7('0x3'))['db'];var logger=require(_0x9df7('0x4'))('transcribe');function getTranscriptionJob(_0x5b7b63,_0x5c0301,_0x531eed,_0x975891){return new Promise(function(_0x23c80b,_0x3350cd){var _0x39f3c2=new AWS['TranscribeService']({'accessKeyId':_0x5c0301,'secretAccessKey':_0x5b7b63,'region':_0x531eed});_0x39f3c2[_0x9df7('0x5')]({'TranscriptionJobName':_0x975891},function(_0x4cc7d5,_0x1663c8){if(_0x4cc7d5){return _0x3350cd(_0x4cc7d5);}else{return _0x23c80b(_0x1663c8);}});});}function sentiment(_0x57abfe,_0x459c62,_0x1d86ed,_0x340553,_0x4ee4aa){return new Promise(function(_0x2b457d,_0x6d46a9){var _0x2296e7=new AWS['Comprehend']({'accessKeyId':_0x459c62,'secretAccessKey':_0x57abfe,'region':_0x1d86ed});_0x2296e7[_0x9df7('0x6')]({'Text':_0x340553,'LanguageCode':_0x4ee4aa[_0x9df7('0x7')](0x0,0x2)},function(_0x2b3cdb,_0x368f28){if(_0x2b3cdb){return _0x6d46a9(_0x2b3cdb);}else{return _0x2b457d(_0x368f28);}});});}function checkTranscribeJob(_0x2cbe7f,_0x878af2,_0x1c2bf0){var _0x6a24cb;return new BPromise(function(_0x1d9b30,_0x168f47){logger[_0x9df7('0x8')](util[_0x9df7('0x9')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x2cbe7f['id'],_0x2cbe7f['transcribeName']));return getTranscriptionJob(_0x1c2bf0[_0x9df7('0xa')],_0x1c2bf0[_0x9df7('0xb')],_0x878af2[_0x9df7('0xc')],_0x2cbe7f['transcribeName'])[_0x9df7('0xd')](function(_0x5cb6dc){logger['info'](util['format'](_0x9df7('0xe'),_0x2cbe7f['id'],_0x2cbe7f[_0x9df7('0xf')],_0x5cb6dc[_0x9df7('0x10')][_0x9df7('0x11')]));if(!_0x2cbe7f[_0x9df7('0x12')]){switch(_0x5cb6dc[_0x9df7('0x10')][_0x9df7('0x11')]){case _0x9df7('0x13'):var _0x1c9a02={'transcribeStatus':_0x5cb6dc[_0x9df7('0x10')][_0x9df7('0x11')],'fileUri':_0x5cb6dc[_0x9df7('0x10')][_0x9df7('0x14')]['TranscriptFileUri']};logger['info'](util[_0x9df7('0x9')](_0x9df7('0x15'),_0x2cbe7f['id']));return rp({'uri':_0x5cb6dc['TranscriptionJob'][_0x9df7('0x14')]['TranscriptFileUri'],'json':!![]})[_0x9df7('0xd')](function(_0x466d34){logger[_0x9df7('0x8')](util[_0x9df7('0x9')](_0x9df7('0x16'),_0x2cbe7f['id']));if(_0x466d34&&_0x466d34[_0x9df7('0x17')]&&_0x466d34[_0x9df7('0x17')]['transcripts']&&_0x466d34[_0x9df7('0x17')]['transcripts'][_0x9df7('0x18')]){_0x1c9a02[_0x9df7('0x12')]='';for(var _0x1fa27c=0x0;_0x1fa27c<_0x466d34['results'][_0x9df7('0x19')][_0x9df7('0x18')];_0x1fa27c++){_0x1c9a02[_0x9df7('0x12')]+=_0x466d34['results'][_0x9df7('0x19')][_0x1fa27c][_0x9df7('0x1a')]+'';}}return _0x2cbe7f['update'](_0x1c9a02);})[_0x9df7('0xd')](function(){logger['info'](util[_0x9df7('0x9')](_0x9df7('0x1b'),_0x2cbe7f['id']));if(!_0x2cbe7f['tempSentiment']){throw new db[(_0x9df7('0x1c'))][(_0x9df7('0x1d'))](_0x9df7('0x1e'));}if(!_0x878af2[_0x9df7('0x1f')]||!_0x878af2[_0x9df7('0x20')]||!_0x878af2[_0x9df7('0x21')]||!_0x878af2[_0x9df7('0x22')]||!_0x878af2[_0x9df7('0x23')]){throw new db['Sequelize'][(_0x9df7('0x1d'))](_0x9df7('0x24'));}if(!_0x1c9a02[_0x9df7('0x12')]){throw new Error('Transcript\x20not\x20available');}if(_0x878af2[_0x9df7('0x20')]===_0x1c2bf0['id']){return _0x1c2bf0;}else{return db['CloudProvider']['findOne']({'where':{'id':_settings[_0x9df7('0x20')]}});}})[_0x9df7('0xd')](function(_0x327160){if(!_0x327160){throw new db[(_0x9df7('0x1c'))][(_0x9df7('0x1d'))](_0x9df7('0x25'));}if(!_0x327160['data1']||!_0x327160[_0x9df7('0xb')]){throw new db[(_0x9df7('0x1c'))][(_0x9df7('0x1d'))](_0x9df7('0x26'));}_0x6a24cb=_0x327160;logger[_0x9df7('0x8')](util[_0x9df7('0x9')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x2cbe7f['id']));return sentiment(_0x6a24cb[_0x9df7('0xa')],_0x6a24cb[_0x9df7('0xb')],_0x878af2[_0x9df7('0x21')],_0x1c9a02[_0x9df7('0x12')],_0x878af2['language']);})[_0x9df7('0xd')](function(_0x1ab3bd){logger[_0x9df7('0x8')](util[_0x9df7('0x9')](_0x9df7('0x27'),_0x2cbe7f['id']));return _0x2cbe7f['update']({'sentiment':_0x1ab3bd['Sentiment'],'sPositive':_0x1ab3bd['SentimentScore'][_0x9df7('0x28')],'sNegative':_0x1ab3bd[_0x9df7('0x29')][_0x9df7('0x2a')],'sMixed':_0x1ab3bd[_0x9df7('0x29')][_0x9df7('0x2b')],'sNeutral':_0x1ab3bd['SentimentScore'][_0x9df7('0x2c')]});})[_0x9df7('0xd')](function(){logger[_0x9df7('0x8')](util[_0x9df7('0x9')](_0x9df7('0x1b'),_0x2cbe7f['id']));_0x1d9b30();});case _0x9df7('0x2d'):return _0x2cbe7f[_0x9df7('0x2e')]({'transcribeStatus':_0x9df7('0x2d'),'failureReason':_0x5cb6dc[_0x9df7('0x10')][_0x9df7('0x2f')]})[_0x9df7('0xd')](function(){logger[_0x9df7('0x8')](util['format'](_0x9df7('0x1b'),_0x2cbe7f['id']));_0x1d9b30();});default:logger[_0x9df7('0x8')](util['format']('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x2cbe7f['id']));break;}}else{return BPromise['resolve']()[_0x9df7('0xd')](function(){if(!_0x2cbe7f[_0x9df7('0x30')]){throw new db[(_0x9df7('0x1c'))]['ValidationError'](_0x9df7('0x1e'));}if(!_0x878af2[_0x9df7('0x1f')]||!_0x878af2[_0x9df7('0x20')]||!_0x878af2[_0x9df7('0x21')]||!_0x878af2[_0x9df7('0x22')]||!_0x878af2[_0x9df7('0x23')]){throw new db['Sequelize'][(_0x9df7('0x1d'))](_0x9df7('0x24'));}if(!_0x2cbe7f[_0x9df7('0x12')]){throw new Error(_0x9df7('0x31'));}if(_0x878af2[_0x9df7('0x20')]===_0x1c2bf0['id']){return _0x1c2bf0;}else{return db[_0x9df7('0x32')]['findOne']({'where':{'id':_settings[_0x9df7('0x20')]}});}})[_0x9df7('0xd')](function(_0xe42193){if(!_0xe42193){throw new db[(_0x9df7('0x1c'))][(_0x9df7('0x1d'))](_0x9df7('0x25'));}if(!_0xe42193['data1']||!_0xe42193[_0x9df7('0xb')]){throw new db[(_0x9df7('0x1c'))][(_0x9df7('0x1d'))]('Cloud\x20Provider\x20not\x20configured');}_0x6a24cb=_0xe42193;logger[_0x9df7('0x8')](util[_0x9df7('0x9')](_0x9df7('0x33'),_0x2cbe7f['id']));return sentiment(_0x6a24cb[_0x9df7('0xa')],_0x6a24cb[_0x9df7('0xb')],_0x878af2[_0x9df7('0x21')],_0x2cbe7f[_0x9df7('0x12')],_0x878af2[_0x9df7('0x22')]);})['then'](function(_0x10f1d9){logger['info'](util[_0x9df7('0x9')](_0x9df7('0x27'),_0x2cbe7f['id']));return _0x2cbe7f[_0x9df7('0x2e')]({'sentiment':_0x10f1d9[_0x9df7('0x34')],'sPositive':_0x10f1d9[_0x9df7('0x29')][_0x9df7('0x28')],'sNegative':_0x10f1d9['SentimentScore'][_0x9df7('0x2a')],'sMixed':_0x10f1d9[_0x9df7('0x29')][_0x9df7('0x2b')],'sNeutral':_0x10f1d9[_0x9df7('0x29')][_0x9df7('0x2c')],'transcribeStatus':_0x9df7('0x13')});})['then'](function(){logger[_0x9df7('0x8')](util[_0x9df7('0x9')](_0x9df7('0x1b'),_0x2cbe7f['id']));_0x1d9b30();});}})[_0x9df7('0x35')](function(_0x1594db){if(_0x1594db){if(!_0x1594db[_0x9df7('0x36')]||_0x1594db[_0x9df7('0x36')]!==_0x9df7('0x37')){logger[_0x9df7('0x38')](util[_0x9df7('0x9')](_0x9df7('0x39'),_0x2cbe7f['id']),util[_0x9df7('0x3a')](_0x1594db,{'showHidden':![],'depth':null}));}}_0x1d9b30();});});}function checkTranscribe(){var _0x5e2211;var _0x1d8bfc;var _0x50c22b;return db[_0x9df7('0x3b')]['findAll']({'where':{'transcribeStatus':_0x9df7('0x3c')}})[_0x9df7('0xd')](function(_0x3a7683){if(!_0x3a7683||!_0x3a7683['length']){throw new db[(_0x9df7('0x1c'))][(_0x9df7('0x1d'))](_0x9df7('0x3d'));}_0x5e2211=_0x3a7683;return db[_0x9df7('0x3e')][_0x9df7('0x3f')]({'where':{'id':0x1}});})[_0x9df7('0xd')](function(_0x245d94){if(!_0x245d94){throw new db[(_0x9df7('0x1c'))][(_0x9df7('0x1d'))](_0x9df7('0x40'));}_0x1d8bfc=_0x245d94;if(!_0x1d8bfc[_0x9df7('0x41')]||!_0x1d8bfc['transcribeAccountId']||!_0x1d8bfc[_0x9df7('0xc')]||!_0x1d8bfc[_0x9df7('0x22')]||!_0x1d8bfc[_0x9df7('0x23')]){throw new db[(_0x9df7('0x1c'))]['ValidationError'](_0x9df7('0x42'));}return db[_0x9df7('0x32')]['findOne']({'where':{'id':_0x1d8bfc['transcribeAccountId']}});})['then'](function(_0x59f673){if(!_0x59f673){throw new db[(_0x9df7('0x1c'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x59f673['data1']||!_0x59f673[_0x9df7('0xb')]){throw new db[(_0x9df7('0x1c'))][(_0x9df7('0x1d'))](_0x9df7('0x26'));}_0x50c22b=_0x59f673;var _0x51e657=[];_0x5e2211[_0x9df7('0x43')](function(_0x440e0d){_0x51e657['push'](checkTranscribeJob(_0x440e0d,_0x1d8bfc,_0x50c22b));});return BPromise[_0x9df7('0x44')](_0x51e657);})[_0x9df7('0x35')](function(_0x389a77){if(_0x389a77){if(!_0x389a77[_0x9df7('0x36')]||_0x389a77[_0x9df7('0x36')]!==_0x9df7('0x37')){logger[_0x9df7('0x38')](util[_0x9df7('0x3a')](_0x389a77,{'showHidden':![],'depth':null}));}}});}exports[_0x9df7('0x45')]=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 6986549..c0e5e8e 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 _0xcf2e=['lastMsgAt','subtract','hours','then','length','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','format','YYYY-MM-DD\x20HH:mm:ss','emit','whatsappInteraction:update','catch','error','inspect','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','localhost','socket.io-emitter','WhatsappInteraction','findAll'];(function(_0x3fa7fd,_0x80fff2){var _0x19ec6a=function(_0x2bbf71){while(--_0x2bbf71){_0x3fa7fd['push'](_0x3fa7fd['shift']());}};_0x19ec6a(++_0x80fff2);}(_0xcf2e,0x197));var _0xecf2=function(_0x21ecc8,_0x2bdead){_0x21ecc8=_0x21ecc8-0x0;var _0x510c1d=_0xcf2e[_0x21ecc8];return _0x510c1d;};'use strict';var _=require(_0xecf2('0x0'));var moment=require(_0xecf2('0x1'));var Redis=require(_0xecf2('0x2'));var util=require(_0xecf2('0x3'));var config=require(_0xecf2('0x4'));var db=require(_0xecf2('0x5'))['db'];var logger=require(_0xecf2('0x6'))(_0xecf2('0x7'));config[_0xecf2('0x8')]=_['defaults'](config[_0xecf2('0x8')],{'host':_0xecf2('0x9'),'port':0x18eb});var io=require(_0xecf2('0xa'))(new Redis(config[_0xecf2('0x8')]));function closeInteractions(){var _0x5c2c06=[];return db[_0xecf2('0xb')][_0xecf2('0xc')]({'raw':!![],'attributes':['id',_0xecf2('0xd')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xecf2('0xe')](0x18,_0xecf2('0xf'))}}})[_0xecf2('0x10')](function(_0x1f5f16){if(_0x1f5f16&&_0x1f5f16[_0xecf2('0x11')]){_0x5c2c06=_['map'](_0x1f5f16||[],'id');logger[_0xecf2('0x12')](_0xecf2('0x13'),_0x5c2c06[_0xecf2('0x14')]());return db[_0xecf2('0xb')][_0xecf2('0x15')]({'closeReason':_0xecf2('0x16'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0xecf2('0x17')](_0xecf2('0x18'))},{'where':{'id':_0x5c2c06}});}})[_0xecf2('0x10')](function(){if(_0x5c2c06&&_0x5c2c06[_0xecf2('0x11')]){logger['info']('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x5c2c06['join']());for(var _0x304d9c=0x0;_0x304d9c<_0x5c2c06[_0xecf2('0x11')];_0x304d9c++){io[_0xecf2('0x19')](_0xecf2('0x1a'),{'id':_0x5c2c06[_0x304d9c],'closed':!![]});}}})[_0xecf2('0x1b')](function(_0x34060e){logger[_0xecf2('0x1c')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x34060e?util[_0xecf2('0x1d')](_0x34060e,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xb2f9=['moment','ioredis','util','../../config/environment','../../mysqldb','../logger','redis','defaults','WhatsappInteraction','findAll','subtract','hours','then','length','map','[WHATSAPP]\x20Interactions\x20to\x20close:','timeout','format','info','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','join','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start'];(function(_0x59e9f0,_0x764002){var _0xb031ff=function(_0x47d740){while(--_0x47d740){_0x59e9f0['push'](_0x59e9f0['shift']());}};_0xb031ff(++_0x764002);}(_0xb2f9,0xb6));var _0x9b2f=function(_0x177ca9,_0x4701c2){_0x177ca9=_0x177ca9-0x0;var _0x38eea3=_0xb2f9[_0x177ca9];return _0x38eea3;};'use strict';var _=require('lodash');var moment=require(_0x9b2f('0x0'));var Redis=require(_0x9b2f('0x1'));var util=require(_0x9b2f('0x2'));var config=require(_0x9b2f('0x3'));var db=require(_0x9b2f('0x4'))['db'];var logger=require(_0x9b2f('0x5'))('schedule');config[_0x9b2f('0x6')]=_[_0x9b2f('0x7')](config[_0x9b2f('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9b2f('0x6')]));function closeInteractions(){var _0x5d424d=[];return db[_0x9b2f('0x8')][_0x9b2f('0x9')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x9b2f('0xa')](0x18,_0x9b2f('0xb'))}}})[_0x9b2f('0xc')](function(_0xb9bbd6){if(_0xb9bbd6&&_0xb9bbd6[_0x9b2f('0xd')]){_0x5d424d=_[_0x9b2f('0xe')](_0xb9bbd6||[],'id');logger['info'](_0x9b2f('0xf'),_0x5d424d['join']());return db[_0x9b2f('0x8')]['update']({'closeReason':'system','disposition':_0x9b2f('0x10'),'closed':!![],'closedAt':moment()[_0x9b2f('0x11')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x5d424d}});}})[_0x9b2f('0xc')](function(){if(_0x5d424d&&_0x5d424d[_0x9b2f('0xd')]){logger[_0x9b2f('0x12')](_0x9b2f('0x13'),_0x5d424d[_0x9b2f('0x14')]());for(var _0x1eab6e=0x0;_0x1eab6e<_0x5d424d['length'];_0x1eab6e++){io['emit']('whatsappInteraction:update',{'id':_0x5d424d[_0x1eab6e],'closed':!![]});}}})[_0x9b2f('0x15')](function(_0x15bec6){logger[_0x9b2f('0x16')](_0x9b2f('0x17'),_0x15bec6?util[_0x9b2f('0x18')](_0x15bec6,{'showHidden':![],'depth':null}):'');});}exports[_0x9b2f('0x19')]=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 b95d377..37346b7 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4d43=['contacts1','CmHopper','hopper1','contacts2','hopper2','catch','util','push','Innocenzo','innocenzo.biondo','@xcally.com','now','CmContact','destroy','then','bulkCreate','log','finished\x20populating'];(function(_0x3a062d,_0x503f80){var _0x2c5410=function(_0x1a5d54){while(--_0x1a5d54){_0x3a062d['push'](_0x3a062d['shift']());}};_0x2c5410(++_0x503f80);}(_0x4d43,0xcc));var _0x34d4=function(_0x88596e,_0x207f81){_0x88596e=_0x88596e-0x0;var _0x166774=_0x4d43[_0x88596e];return _0x166774;};'use strict';var util=require(_0x34d4('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x34d4('0x1')]({'id':i,'firstName':_0x34d4('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x34d4('0x3')+i+_0x34d4('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x34d4('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x34d4('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x34d4('0x5')](),'updatedAt':Date[_0x34d4('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x34d4('0x1')]({'id':i,'firstName':_0x34d4('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x34d4('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x34d4('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x34d4('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x34d4('0x5')](),'updatedAt':Date['now']()});}db[_0x34d4('0x6')][_0x34d4('0x7')]({'where':{}})[_0x34d4('0x8')](function(){return db[_0x34d4('0x6')][_0x34d4('0x9')](contacts);})[_0x34d4('0x8')](function(){console[_0x34d4('0xa')](_0x34d4('0xb'),_0x34d4('0xc'));return db['CmHopper']['destroy']({'where':{}});})[_0x34d4('0x8')](function(){return db[_0x34d4('0xd')][_0x34d4('0x9')](hopper);})[_0x34d4('0x8')](function(){console[_0x34d4('0xa')](_0x34d4('0xb'),_0x34d4('0xe'));return db[_0x34d4('0x6')]['bulkCreate'](contacts2);})[_0x34d4('0x8')](function(){console['log'](_0x34d4('0xb'),_0x34d4('0xf'));return db['CmHopper'][_0x34d4('0x9')](hopper2);})[_0x34d4('0x8')](function(){console[_0x34d4('0xa')](_0x34d4('0xb'),_0x34d4('0x10'));})[_0x34d4('0x11')](function(_0x3cac22){console[_0x34d4('0xa')](_0x3cac22);}); \ No newline at end of file +var _0xd9c6=['CmHopper','then','hopper1','contacts2','hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo','@xcally.com','now','innocenzo.biondo','CmContact','destroy','bulkCreate','log','finished\x20populating','contacts1'];(function(_0x5d2f4b,_0x42bad4){var _0x39012a=function(_0x16c03c){while(--_0x16c03c){_0x5d2f4b['push'](_0x5d2f4b['shift']());}};_0x39012a(++_0x42bad4);}(_0xd9c6,0xba));var _0x6d9c=function(_0x3735b0,_0x8eb06b){_0x3735b0=_0x3735b0-0x0;var _0x18e0ec=_0xd9c6[_0x3735b0];return _0x18e0ec;};'use strict';var util=require(_0x6d9c('0x0'));var db=require(_0x6d9c('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x6d9c('0x2')]({'id':i,'firstName':_0x6d9c('0x3')+i,'lastName':_0x6d9c('0x4')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x6d9c('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x6d9c('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x6d9c('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x6d9c('0x6')](),'updatedAt':Date[_0x6d9c('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x6d9c('0x2')]({'id':i,'firstName':_0x6d9c('0x3')+i,'lastName':_0x6d9c('0x4')+i,'phone':0xf879fb460+i,'email':_0x6d9c('0x7')+i+_0x6d9c('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x6d9c('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x6d9c('0x6')]()});}db[_0x6d9c('0x8')][_0x6d9c('0x9')]({'where':{}})['then'](function(){return db['CmContact'][_0x6d9c('0xa')](contacts);})['then'](function(){console[_0x6d9c('0xb')](_0x6d9c('0xc'),_0x6d9c('0xd'));return db[_0x6d9c('0xe')][_0x6d9c('0x9')]({'where':{}});})[_0x6d9c('0xf')](function(){return db[_0x6d9c('0xe')][_0x6d9c('0xa')](hopper);})['then'](function(){console[_0x6d9c('0xb')](_0x6d9c('0xc'),_0x6d9c('0x10'));return db[_0x6d9c('0x8')][_0x6d9c('0xa')](contacts2);})[_0x6d9c('0xf')](function(){console[_0x6d9c('0xb')]('finished\x20populating',_0x6d9c('0x11'));return db[_0x6d9c('0xe')][_0x6d9c('0xa')](hopper2);})[_0x6d9c('0xf')](function(){console[_0x6d9c('0xb')](_0x6d9c('0xc'),_0x6d9c('0x12'));})[_0x6d9c('0x13')](function(_0x57ab20){console['log'](_0x57ab20);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index c6d703a..7e66008 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3d1a=['%s%s@xcally.com','password','udp','wss','yes','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','catch','util','push','format','%s%s','agent'];(function(_0x5678c4,_0x3a6da6){var _0x78c4c7=function(_0x8a4d35){while(--_0x8a4d35){_0x5678c4['push'](_0x5678c4['shift']());}};_0x78c4c7(++_0x3a6da6);}(_0x3d1a,0x67));var _0xa3d1=function(_0x5015c2,_0x2f6198){_0x5015c2=_0x5015c2-0x0;var _0x338b23=_0x3d1a[_0x5015c2];return _0x338b23;};'use strict';var util=require(_0xa3d1('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xa3d1('0x1')]({'name':util[_0xa3d1('0x2')](_0xa3d1('0x3'),_0xa3d1('0x4'),i),'fullname':util[_0xa3d1('0x2')](_0xa3d1('0x3'),_0xa3d1('0x4'),i),'email':util[_0xa3d1('0x2')](_0xa3d1('0x5'),'agent',i),'role':_0xa3d1('0x4'),'password':_0xa3d1('0x6'),'internal':0xfa0+i,'type':'friend','transport':[_0xa3d1('0x7'),'ws',_0xa3d1('0x8')],'disallow':['all'],'allow':['ulaw'],'defaultuser':util[_0xa3d1('0x2')](_0xa3d1('0x3'),_0xa3d1('0x4'),i),'encryption':_0xa3d1('0x9'),'avpf':_0xa3d1('0x9'),'force_avp':_0xa3d1('0x9'),'icesupport':_0xa3d1('0x9'),'dtlsenable':_0xa3d1('0x9'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0xa3d1('0xa'),'dtlssetup':_0xa3d1('0xb'),'callerid':util[_0xa3d1('0x2')](_0xa3d1('0xc'),util[_0xa3d1('0x2')](_0xa3d1('0x3'),_0xa3d1('0x4'),i),0xfa0+i)});}db[_0xa3d1('0xd')][_0xa3d1('0xe')](users)[_0xa3d1('0xf')](function(){console[_0xa3d1('0x10')]('add\x20user');})[_0xa3d1('0x11')](function(_0x19e491){console[_0xa3d1('0x10')](_0x19e491);}); \ No newline at end of file +var _0xf0d0=['/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','log','catch','util','push','format','%s%s','agent','password','friend','wss','all','yes','/etc/pki/tls/certs/motion.crt'];(function(_0x373e59,_0x164397){var _0xec00d8=function(_0x5e9e76){while(--_0x5e9e76){_0x373e59['push'](_0x373e59['shift']());}};_0xec00d8(++_0x164397);}(_0xf0d0,0xb0));var _0x0f0d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf0d0[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0x0f0d('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x0f0d('0x1')]({'name':util[_0x0f0d('0x2')](_0x0f0d('0x3'),'agent',i),'fullname':util[_0x0f0d('0x2')]('%s%s',_0x0f0d('0x4'),i),'email':util[_0x0f0d('0x2')]('%s%s@xcally.com',_0x0f0d('0x4'),i),'role':'agent','password':_0x0f0d('0x5'),'internal':0xfa0+i,'type':_0x0f0d('0x6'),'transport':['udp','ws',_0x0f0d('0x7')],'disallow':[_0x0f0d('0x8')],'allow':['ulaw'],'defaultuser':util[_0x0f0d('0x2')](_0x0f0d('0x3'),_0x0f0d('0x4'),i),'encryption':'yes','avpf':'yes','force_avp':_0x0f0d('0x9'),'icesupport':_0x0f0d('0x9'),'dtlsenable':_0x0f0d('0x9'),'dtlsverify':'no','dtlscertfile':_0x0f0d('0xa'),'dtlsprivatekey':_0x0f0d('0xb'),'dtlssetup':_0x0f0d('0xc'),'callerid':util['format'](_0x0f0d('0xd'),util['format']('%s%s',_0x0f0d('0x4'),i),0xfa0+i)});}db[_0x0f0d('0xe')]['bulkCreate'](users)['then'](function(){console[_0x0f0d('0xf')]('add\x20user');})[_0x0f0d('0x10')](function(_0x193ed5){console['log'](_0x193ed5);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 6c3ea0b..b4bd2ae 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd01d=['telephone','type','ivr','UserProfileSection','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','MailQueues','findAll','Telephones','Trunks','resourceId','map','Campaign','then','%s:queue:%s','length','format','user:%s','query','find','userProfileId','handshake','ChatInteraction','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','OpenchannelInteraction','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','FaxQueue','SmsQueues','WhatsappQueues','IvrCampaigns','getVoiceQueues','getChatQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','voice','fax','sms','openchannel','whatsapp','trunk:%s','campaign:%s:%s','ChatInteractions','removeChatInteractions','emit','user_has_chat_interactions:remove','leave','removeMailInteractions','user_has_mail_interactions:remove','user_has_fax_interactions:remove','SmsInteractions','OpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','default','setMaxListeners','address','request','connection','remoteAddress','remotePort','connectedAt','SocketIO\x20','disconnect','CONNECTED','util','../mysqldb','./environment','name','Agents','User','role','agent'];(function(_0x102cdf,_0x5e709e){var _0x434739=function(_0x2ef3ef){while(--_0x2ef3ef){_0x102cdf['push'](_0x102cdf['shift']());}};_0x434739(++_0x5e709e);}(_0xd01d,0xbe));var _0xdd01=function(_0x39794b,_0x198617){_0x39794b=_0x39794b-0x0;var _0x9a115a=_0xd01d[_0x39794b];return _0x9a115a;};'use strict';var _=require('lodash');var util=require(_0xdd01('0x0'));var BPromise=require('bluebird');var db=require(_0xdd01('0x1'))['db'];var config=require(_0xdd01('0x2'));var queryQueues={'attributes':['id',_0xdd01('0x3')],'include':[{'as':_0xdd01('0x4'),'model':db[_0xdd01('0x5')],'attributes':['id',_0xdd01('0x3'),_0xdd01('0x6')],'raw':!![],'where':{'role':_0xdd01('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xdd01('0x3')],'where':{'role':_0xdd01('0x8')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0xdd01('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xdd01('0x3'),_0xdd01('0x9')],'where':{'type':_0xdd01('0xa')}};function getAssociatedResources(_0xf29a16,_0x5a40fc,_0x2c9fd4){return db[_0xdd01('0xb')]['findOne']({'where':{'name':_0xf29a16,'userProfileId':_0x5a40fc},'raw':!![]})['then'](function(_0x1fc7e8){if(_0x1fc7e8){if(_0x1fc7e8[_0xdd01('0xc')]){switch(_0xf29a16){case _0xdd01('0xd'):case _0xdd01('0xe'):case _0xdd01('0xf'):case'SmsQueues':case _0xdd01('0x10'):case'OpenchannelQueues':case'WhatsappQueues':return db[_0x2c9fd4][_0xdd01('0x11')](queryQueues);case _0xdd01('0x12'):return db[_0x2c9fd4][_0xdd01('0x11')](queryTelephones);case _0xdd01('0x13'):return db[_0x2c9fd4][_0xdd01('0x11')](queryTrunks);case'IvrCampaigns':return db[_0x2c9fd4][_0xdd01('0x11')](queryCampaigns);}}else{return db['UserProfileResource'][_0xdd01('0x11')]({'attributes':[_0xdd01('0x14')],'where':{'sectionId':_0x1fc7e8['id']},'raw':!![]})['then'](function(_0x113b25){if(_0x113b25){var _0x580efc={'where':{'id':_[_0xdd01('0x15')](_0x113b25,_0xdd01('0x14'))},'raw':!![]};switch(_0x2c9fd4){case _0xdd01('0x5'):_0x580efc['where'][_0xdd01('0x6')]=_0xdd01('0x8');break;case _0xdd01('0x16'):_0x580efc['where'][_0xdd01('0x9')]=_0xdd01('0xa');break;}return db[_0x2c9fd4][_0xdd01('0x11')](_0x580efc);}else{return[];}});}}else{return[];}})[_0xdd01('0x17')](function(_0x19cae7){return _0x19cae7;});}function joinOrLeaveQueues(_0xf9f29,_0x43ccd2,_0x351331,_0x90d731){_0xf9f29[_0x43ccd2](util['format'](_0xdd01('0x18'),_0x351331,_0x90d731['name']));if(_0x90d731[_0xdd01('0x4')]){for(var _0xa4ef26=0x0;_0xa4ef26<_0x90d731[_0xdd01('0x4')][_0xdd01('0x19')];_0xa4ef26+=0x1){_0xf9f29[_0x43ccd2](util[_0xdd01('0x1a')](_0xdd01('0x1b'),_0x90d731[_0xdd01('0x4')][_0xa4ef26][_0xdd01('0x3')]));}}}function joinOrLeave(_0x542f0f,_0x1d0d38,_0x24fb8f){var _0x40e654;if(_0x542f0f['handshake'][_0xdd01('0x1c')]['id']){db[_0xdd01('0x5')][_0xdd01('0x1d')]({'attributes':['id',_0xdd01('0x3'),_0xdd01('0x6'),_0xdd01('0x1e')],'where':{'id':_0x542f0f[_0xdd01('0x1f')]['query']['id']},'include':[{'model':db[_0xdd01('0x20')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xdd01('0x21')],'as':_0xdd01('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0xdd01('0x23')],'as':_0xdd01('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0xdd01('0x25')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xdd01('0x26')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xdd01('0x27')],'as':_0xdd01('0x28'),'attributes':['id'],'raw':!![]}]})[_0xdd01('0x17')](function(_0x17181f){if(_0x17181f){_0x40e654=_0x17181f;_0x542f0f[_0x1d0d38](util[_0xdd01('0x1a')](_0xdd01('0x1b'),_0x17181f[_0xdd01('0x3')]));var _0x6ff499=[];switch(_0x17181f[_0xdd01('0x6')]){case _0xdd01('0x29'):_0x542f0f[_0x1d0d38](_0xdd01('0x2a'));_0x542f0f[_0x1d0d38](_0xdd01('0x2b'));if(queryQueues[_0xdd01('0x2c')]('include')){delete queryQueues[_0xdd01('0x2d')];}_0x6ff499[_0xdd01('0x2e')](db[_0xdd01('0x2f')][_0xdd01('0x11')](queryQueues));_0x6ff499[_0xdd01('0x2e')](db[_0xdd01('0x30')][_0xdd01('0x11')](queryQueues));_0x6ff499[_0xdd01('0x2e')](db['FaxQueue'][_0xdd01('0x11')](queryQueues));_0x6ff499[_0xdd01('0x2e')](db[_0xdd01('0x31')][_0xdd01('0x11')](queryQueues));_0x6ff499['push'](db[_0xdd01('0x32')][_0xdd01('0x11')](queryQueues));_0x6ff499[_0xdd01('0x2e')](db[_0xdd01('0x33')][_0xdd01('0x11')](queryQueues));_0x6ff499[_0xdd01('0x2e')](db[_0xdd01('0x34')]['findAll'](queryQueues));_0x6ff499[_0xdd01('0x2e')](db[_0xdd01('0x5')]['findAll'](queryTelephones));_0x6ff499[_0xdd01('0x2e')](db[_0xdd01('0x35')][_0xdd01('0x11')](queryTrunks));_0x6ff499[_0xdd01('0x2e')](db[_0xdd01('0x16')][_0xdd01('0x11')](queryCampaigns));_0x6ff499[_0xdd01('0x2e')](db['User'][_0xdd01('0x11')](queryAgents));break;case _0xdd01('0x36'):_0x542f0f[_0x1d0d38](_0xdd01('0x2a'));_0x542f0f[_0x1d0d38](_0xdd01('0x2b'));_0x6ff499[_0xdd01('0x2e')](getAssociatedResources(_0xdd01('0xd'),_0x17181f['userProfileId'],'VoiceQueue'));_0x6ff499[_0xdd01('0x2e')](getAssociatedResources(_0xdd01('0xe'),_0x17181f[_0xdd01('0x1e')],'ChatQueue'));_0x6ff499[_0xdd01('0x2e')](getAssociatedResources('FaxQueues',_0x17181f['userProfileId'],_0xdd01('0x37')));_0x6ff499[_0xdd01('0x2e')](getAssociatedResources(_0xdd01('0x38'),_0x17181f[_0xdd01('0x1e')],_0xdd01('0x31')));_0x6ff499[_0xdd01('0x2e')](getAssociatedResources('MailQueues',_0x17181f[_0xdd01('0x1e')],'MailQueue'));_0x6ff499['push'](getAssociatedResources('OpenchannelQueues',_0x17181f[_0xdd01('0x1e')],_0xdd01('0x33')));_0x6ff499[_0xdd01('0x2e')](getAssociatedResources(_0xdd01('0x39'),_0x17181f[_0xdd01('0x1e')],_0xdd01('0x34')));_0x6ff499[_0xdd01('0x2e')](getAssociatedResources('Telephones',_0x17181f[_0xdd01('0x1e')],_0xdd01('0x5')));_0x6ff499[_0xdd01('0x2e')](getAssociatedResources(_0xdd01('0x13'),_0x17181f[_0xdd01('0x1e')],_0xdd01('0x35')));_0x6ff499[_0xdd01('0x2e')](getAssociatedResources(_0xdd01('0x3a'),_0x17181f[_0xdd01('0x1e')],'Campaign'));_0x6ff499[_0xdd01('0x2e')](db[_0xdd01('0x5')][_0xdd01('0x11')](queryAgents));break;case _0xdd01('0x7'):_0x542f0f[_0x1d0d38]('voice:inbound');_0x542f0f[_0x1d0d38]('voice:outbound');_0x6ff499[_0xdd01('0x2e')](_0x17181f[_0xdd01('0x3b')]({'attributes':['id',_0xdd01('0x3')]}));_0x6ff499[_0xdd01('0x2e')](_0x17181f[_0xdd01('0x3c')]({'attributes':['id',_0xdd01('0x3')]}));_0x6ff499['push'](_0x17181f['getFaxQueues']({'attributes':['id','name']}));_0x6ff499['push'](_0x17181f[_0xdd01('0x3d')]({'attributes':['id',_0xdd01('0x3')]}));_0x6ff499[_0xdd01('0x2e')](_0x17181f[_0xdd01('0x3e')]({'attributes':['id',_0xdd01('0x3')]}));_0x6ff499[_0xdd01('0x2e')](_0x17181f[_0xdd01('0x3f')]({'attributes':['id',_0xdd01('0x3')]}));_0x6ff499[_0xdd01('0x2e')](_0x17181f[_0xdd01('0x40')]({'attributes':['id',_0xdd01('0x3')]}));break;}return BPromise['all'](_0x6ff499);}})['then'](function(_0x54ddf7){if(_0x54ddf7&&_0x54ddf7[_0xdd01('0x19')]){for(var _0x1287b7=0x0;_0x1287b7<_0x54ddf7['length'];_0x1287b7+=0x1){for(var _0x19706b=0x0;_0x19706b<_0x54ddf7[_0x1287b7][_0xdd01('0x19')];_0x19706b+=0x1){switch(_0x1287b7){case 0x0:joinOrLeaveQueues(_0x542f0f,_0x1d0d38,_0xdd01('0x41'),_0x54ddf7[_0x1287b7][_0x19706b]);break;case 0x1:joinOrLeaveQueues(_0x542f0f,_0x1d0d38,'chat',_0x54ddf7[_0x1287b7][_0x19706b]);break;case 0x2:joinOrLeaveQueues(_0x542f0f,_0x1d0d38,_0xdd01('0x42'),_0x54ddf7[_0x1287b7][_0x19706b]);break;case 0x3:joinOrLeaveQueues(_0x542f0f,_0x1d0d38,_0xdd01('0x43'),_0x54ddf7[_0x1287b7][_0x19706b]);break;case 0x4:joinOrLeaveQueues(_0x542f0f,_0x1d0d38,'mail',_0x54ddf7[_0x1287b7][_0x19706b]);break;case 0x5:joinOrLeaveQueues(_0x542f0f,_0x1d0d38,_0xdd01('0x44'),_0x54ddf7[_0x1287b7][_0x19706b]);break;case 0x6:joinOrLeaveQueues(_0x542f0f,_0x1d0d38,_0xdd01('0x45'),_0x54ddf7[_0x1287b7][_0x19706b]);break;case 0x7:if(_0x40e654[_0xdd01('0x6')]!==_0xdd01('0x7'))_0x542f0f[_0x1d0d38](util[_0xdd01('0x1a')]('telephone:%s',_0x54ddf7[_0x1287b7][_0x19706b][_0xdd01('0x3')]));break;case 0x8:if(_0x40e654[_0xdd01('0x6')]!==_0xdd01('0x7'))_0x542f0f[_0x1d0d38](util[_0xdd01('0x1a')](_0xdd01('0x46'),_0x54ddf7[_0x1287b7][_0x19706b]['name']));break;case 0x9:if(_0x40e654[_0xdd01('0x6')]!==_0xdd01('0x7'))_0x542f0f[_0x1d0d38](util[_0xdd01('0x1a')](_0xdd01('0x47'),_0x54ddf7[_0x1287b7][_0x19706b][_0xdd01('0x9')],_0x54ddf7[_0x1287b7][_0x19706b][_0xdd01('0x3')]));break;case 0xa:_0x542f0f[_0x1d0d38](util[_0xdd01('0x1a')]('user:%s',_0x54ddf7[_0x1287b7][_0x19706b][_0xdd01('0x3')]));break;}}}}})['then'](function(){if(_0x1d0d38==='leave'){var _0x7b5b42=_[_0xdd01('0x15')](_0x40e654[_0xdd01('0x48')],'id');return _0x40e654[_0xdd01('0x49')](_0x7b5b42)[_0xdd01('0x17')](function(){for(var _0x258aa8=0x0;_0x258aa8<_0x7b5b42[_0xdd01('0x19')];_0x258aa8+=0x1){_0x24fb8f[_0xdd01('0x4a')](_0xdd01('0x4b'),{'ChatInteractionId':Number(_0x7b5b42[_0x258aa8]),'UserId':Number(_0x40e654['id'])});}});}})[_0xdd01('0x17')](function(){if(_0x1d0d38===_0xdd01('0x4c')){var _0x5daee2=_[_0xdd01('0x15')](_0x40e654[_0xdd01('0x22')],'id');return _0x40e654[_0xdd01('0x4d')](_0x5daee2)[_0xdd01('0x17')](function(){for(var _0x47913e=0x0;_0x47913e<_0x5daee2['length'];_0x47913e+=0x1){_0x24fb8f[_0xdd01('0x4a')](_0xdd01('0x4e'),{'MailInteractionId':Number(_0x5daee2[_0x47913e]),'UserId':Number(_0x40e654['id'])});}});}})[_0xdd01('0x17')](function(){if(_0x1d0d38===_0xdd01('0x4c')){var _0x3f9cd5=_[_0xdd01('0x15')](_0x40e654[_0xdd01('0x24')],'id');return _0x40e654['removeFaxInteractions'](_0x3f9cd5)[_0xdd01('0x17')](function(){for(var _0x20cb95=0x0;_0x20cb95<_0x3f9cd5['length'];_0x20cb95+=0x1){_0x24fb8f[_0xdd01('0x4a')](_0xdd01('0x4f'),{'FaxInteractionId':Number(_0x3f9cd5[_0x20cb95]),'UserId':Number(_0x40e654['id'])});}});}})[_0xdd01('0x17')](function(){if(_0x1d0d38==='leave'){var _0x39e310=_[_0xdd01('0x15')](_0x40e654[_0xdd01('0x50')],'id');return _0x40e654['removeSmsInteractions'](_0x39e310)[_0xdd01('0x17')](function(){for(var _0x5374b1=0x0;_0x5374b1<_0x39e310[_0xdd01('0x19')];_0x5374b1+=0x1){_0x24fb8f[_0xdd01('0x4a')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x39e310[_0x5374b1]),'UserId':Number(_0x40e654['id'])});}});}})[_0xdd01('0x17')](function(){if(_0x1d0d38===_0xdd01('0x4c')){var _0x4c3e8d=_[_0xdd01('0x15')](_0x40e654[_0xdd01('0x51')],'id');return _0x40e654[_0xdd01('0x52')](_0x4c3e8d)[_0xdd01('0x17')](function(){for(var _0x291c76=0x0;_0x291c76<_0x4c3e8d[_0xdd01('0x19')];_0x291c76+=0x1){_0x24fb8f[_0xdd01('0x4a')](_0xdd01('0x53'),{'OpenchannelInteractionId':Number(_0x4c3e8d[_0x291c76]),'UserId':Number(_0x40e654['id'])});}});}})[_0xdd01('0x17')](function(){if(_0x1d0d38===_0xdd01('0x4c')){var _0x394d45=_[_0xdd01('0x15')](_0x40e654['WhatsappInteractions'],'id');return _0x40e654[_0xdd01('0x54')](_0x394d45)[_0xdd01('0x17')](function(){for(var _0x5ede6d=0x0;_0x5ede6d<_0x394d45[_0xdd01('0x19')];_0x5ede6d+=0x1){_0x24fb8f[_0xdd01('0x4a')](_0xdd01('0x55'),{'WhatsappInteractionId':Number(_0x394d45[_0x5ede6d]),'UserId':Number(_0x40e654['id'])});}});}})[_0xdd01('0x56')](function(_0x577a42){_0x542f0f[_0xdd01('0x57')](_0x577a42);});}}function onDisconnect(_0x3512b1,_0x20443b){joinOrLeave(_0x3512b1,_0xdd01('0x4c'),_0x20443b);}function onConnect(_0x495c86){joinOrLeave(_0x495c86,'join');}exports[_0xdd01('0x58')]=function(_0x372df4){_0x372df4['on']('connection',function(_0xb62444){_0xb62444[_0xdd01('0x59')](0x0);_0xb62444[_0xdd01('0x5a')]=_0xb62444[_0xdd01('0x5b')][_0xdd01('0x5c')][_0xdd01('0x5d')]+':'+_0xb62444[_0xdd01('0x5b')][_0xdd01('0x5c')][_0xdd01('0x5e')];_0xb62444[_0xdd01('0x5f')]=new Date();_0xb62444[_0xdd01('0x57')]=function(_0x2dc2e8){console[_0xdd01('0x57')](_0xdd01('0x60')+_0xb62444['nsp'][_0xdd01('0x3')]+'['+_0xb62444[_0xdd01('0x5a')]+']',_0x2dc2e8);};_0xb62444['on'](_0xdd01('0x61'),function(){onDisconnect(_0xb62444,_0x372df4);_0xb62444[_0xdd01('0x57')]('DISCONNECTED');});onConnect(_0xb62444);_0xb62444[_0xdd01('0x57')](_0xdd01('0x62'));});}; \ No newline at end of file +var _0x761c=['ChatInteractions','MailInteraction','MailInteractions','SmsInteraction','SmsInteractions','OpenchannelInteractions','WhatsappInteractions','voice:inbound','voice:outbound','hasOwnProperty','include','VoiceQueue','push','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','SmsQueues','WhatsappQueues','WhatsappQueue','getFaxQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','sms','mail','whatsapp','trunk:%s','removeChatInteractions','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','emit','leave','removeSmsInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','join','setMaxListeners','request','connectedAt','log','SocketIO\x20','nsp','address','DISCONNECTED','CONNECTED','lodash','bluebird','../mysqldb','name','Agents','User','role','telephone','agent','type','UserProfileSection','findOne','then','ChatQueues','FaxQueues','OpenchannelQueues','findAll','IvrCampaigns','UserProfileResource','resourceId','map','Campaign','where','format','%s:queue:%s','length','user:%s','query','find','userProfileId','handshake'];(function(_0x4d4d81,_0x57ed49){var _0x557ca8=function(_0x26c055){while(--_0x26c055){_0x4d4d81['push'](_0x4d4d81['shift']());}};_0x557ca8(++_0x57ed49);}(_0x761c,0x18a));var _0xc761=function(_0xbc3ed2,_0x10775a){_0xbc3ed2=_0xbc3ed2-0x0;var _0x38cf64=_0x761c[_0xbc3ed2];return _0x38cf64;};'use strict';var _=require(_0xc761('0x0'));var util=require('util');var BPromise=require(_0xc761('0x1'));var db=require(_0xc761('0x2'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0xc761('0x3')],'include':[{'as':_0xc761('0x4'),'model':db[_0xc761('0x5')],'attributes':['id','name',_0xc761('0x6')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xc761('0x3')],'where':{'role':_0xc761('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0xc761('0x3')]};var queryAgents={'raw':!![],'attributes':['id',_0xc761('0x3')],'where':{'role':_0xc761('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xc761('0x3'),_0xc761('0x9')],'where':{'type':'ivr'}};function getAssociatedResources(_0x3bdf6f,_0x2cf2e9,_0x175c1c){return db[_0xc761('0xa')][_0xc761('0xb')]({'where':{'name':_0x3bdf6f,'userProfileId':_0x2cf2e9},'raw':!![]})[_0xc761('0xc')](function(_0x205c96){if(_0x205c96){if(_0x205c96['autoAssociation']){switch(_0x3bdf6f){case'VoiceQueues':case _0xc761('0xd'):case _0xc761('0xe'):case'SmsQueues':case'MailQueues':case _0xc761('0xf'):case'WhatsappQueues':return db[_0x175c1c][_0xc761('0x10')](queryQueues);case'Telephones':return db[_0x175c1c][_0xc761('0x10')](queryTelephones);case'Trunks':return db[_0x175c1c][_0xc761('0x10')](queryTrunks);case _0xc761('0x11'):return db[_0x175c1c][_0xc761('0x10')](queryCampaigns);}}else{return db[_0xc761('0x12')][_0xc761('0x10')]({'attributes':[_0xc761('0x13')],'where':{'sectionId':_0x205c96['id']},'raw':!![]})[_0xc761('0xc')](function(_0x5d83cc){if(_0x5d83cc){var _0x4c487e={'where':{'id':_[_0xc761('0x14')](_0x5d83cc,_0xc761('0x13'))},'raw':!![]};switch(_0x175c1c){case _0xc761('0x5'):_0x4c487e['where'][_0xc761('0x6')]=_0xc761('0x7');break;case _0xc761('0x15'):_0x4c487e[_0xc761('0x16')][_0xc761('0x9')]='ivr';break;}return db[_0x175c1c]['findAll'](_0x4c487e);}else{return[];}});}}else{return[];}})[_0xc761('0xc')](function(_0x3d5913){return _0x3d5913;});}function joinOrLeaveQueues(_0x5dfd75,_0x49177e,_0x3bebd6,_0x40d48d){_0x5dfd75[_0x49177e](util[_0xc761('0x17')](_0xc761('0x18'),_0x3bebd6,_0x40d48d[_0xc761('0x3')]));if(_0x40d48d['Agents']){for(var _0x2863a9=0x0;_0x2863a9<_0x40d48d[_0xc761('0x4')][_0xc761('0x19')];_0x2863a9+=0x1){_0x5dfd75[_0x49177e](util[_0xc761('0x17')](_0xc761('0x1a'),_0x40d48d['Agents'][_0x2863a9][_0xc761('0x3')]));}}}function joinOrLeave(_0x2043e0,_0xb48d6b,_0x13a002){var _0x47c0d9;if(_0x2043e0['handshake'][_0xc761('0x1b')]['id']){db[_0xc761('0x5')][_0xc761('0x1c')]({'attributes':['id',_0xc761('0x3'),_0xc761('0x6'),_0xc761('0x1d')],'where':{'id':_0x2043e0[_0xc761('0x1e')][_0xc761('0x1b')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0xc761('0x1f'),'attributes':['id'],'raw':!![]},{'model':db[_0xc761('0x20')],'as':_0xc761('0x21'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xc761('0x22')],'as':_0xc761('0x23'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0xc761('0x24'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0xc761('0x25'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x47eda8){if(_0x47eda8){_0x47c0d9=_0x47eda8;_0x2043e0[_0xb48d6b](util['format'](_0xc761('0x1a'),_0x47eda8[_0xc761('0x3')]));var _0x358d64=[];switch(_0x47eda8[_0xc761('0x6')]){case'admin':_0x2043e0[_0xb48d6b](_0xc761('0x26'));_0x2043e0[_0xb48d6b](_0xc761('0x27'));if(queryQueues[_0xc761('0x28')](_0xc761('0x29'))){delete queryQueues[_0xc761('0x29')];}_0x358d64['push'](db[_0xc761('0x2a')][_0xc761('0x10')](queryQueues));_0x358d64[_0xc761('0x2b')](db[_0xc761('0x2c')][_0xc761('0x10')](queryQueues));_0x358d64[_0xc761('0x2b')](db[_0xc761('0x2d')][_0xc761('0x10')](queryQueues));_0x358d64[_0xc761('0x2b')](db[_0xc761('0x2e')]['findAll'](queryQueues));_0x358d64[_0xc761('0x2b')](db[_0xc761('0x2f')]['findAll'](queryQueues));_0x358d64['push'](db[_0xc761('0x30')][_0xc761('0x10')](queryQueues));_0x358d64[_0xc761('0x2b')](db['WhatsappQueue']['findAll'](queryQueues));_0x358d64['push'](db[_0xc761('0x5')][_0xc761('0x10')](queryTelephones));_0x358d64[_0xc761('0x2b')](db[_0xc761('0x31')]['findAll'](queryTrunks));_0x358d64[_0xc761('0x2b')](db['Campaign']['findAll'](queryCampaigns));_0x358d64[_0xc761('0x2b')](db[_0xc761('0x5')][_0xc761('0x10')](queryAgents));break;case'user':_0x2043e0[_0xb48d6b](_0xc761('0x26'));_0x2043e0[_0xb48d6b](_0xc761('0x27'));_0x358d64[_0xc761('0x2b')](getAssociatedResources('VoiceQueues',_0x47eda8[_0xc761('0x1d')],_0xc761('0x2a')));_0x358d64[_0xc761('0x2b')](getAssociatedResources('ChatQueues',_0x47eda8[_0xc761('0x1d')],_0xc761('0x2c')));_0x358d64['push'](getAssociatedResources(_0xc761('0xe'),_0x47eda8['userProfileId'],'FaxQueue'));_0x358d64[_0xc761('0x2b')](getAssociatedResources(_0xc761('0x32'),_0x47eda8[_0xc761('0x1d')],_0xc761('0x2e')));_0x358d64['push'](getAssociatedResources('MailQueues',_0x47eda8[_0xc761('0x1d')],_0xc761('0x2f')));_0x358d64[_0xc761('0x2b')](getAssociatedResources(_0xc761('0xf'),_0x47eda8[_0xc761('0x1d')],_0xc761('0x30')));_0x358d64['push'](getAssociatedResources(_0xc761('0x33'),_0x47eda8[_0xc761('0x1d')],_0xc761('0x34')));_0x358d64[_0xc761('0x2b')](getAssociatedResources('Telephones',_0x47eda8['userProfileId'],_0xc761('0x5')));_0x358d64[_0xc761('0x2b')](getAssociatedResources('Trunks',_0x47eda8[_0xc761('0x1d')],_0xc761('0x31')));_0x358d64[_0xc761('0x2b')](getAssociatedResources(_0xc761('0x11'),_0x47eda8[_0xc761('0x1d')],'Campaign'));_0x358d64[_0xc761('0x2b')](db[_0xc761('0x5')][_0xc761('0x10')](queryAgents));break;case'agent':_0x2043e0[_0xb48d6b](_0xc761('0x26'));_0x2043e0[_0xb48d6b]('voice:outbound');_0x358d64['push'](_0x47eda8['getVoiceQueues']({'attributes':['id',_0xc761('0x3')]}));_0x358d64[_0xc761('0x2b')](_0x47eda8['getChatQueues']({'attributes':['id',_0xc761('0x3')]}));_0x358d64[_0xc761('0x2b')](_0x47eda8[_0xc761('0x35')]({'attributes':['id',_0xc761('0x3')]}));_0x358d64[_0xc761('0x2b')](_0x47eda8['getSmsQueues']({'attributes':['id',_0xc761('0x3')]}));_0x358d64[_0xc761('0x2b')](_0x47eda8[_0xc761('0x36')]({'attributes':['id',_0xc761('0x3')]}));_0x358d64[_0xc761('0x2b')](_0x47eda8[_0xc761('0x37')]({'attributes':['id',_0xc761('0x3')]}));_0x358d64[_0xc761('0x2b')](_0x47eda8[_0xc761('0x38')]({'attributes':['id',_0xc761('0x3')]}));break;}return BPromise[_0xc761('0x39')](_0x358d64);}})[_0xc761('0xc')](function(_0x5c27a1){if(_0x5c27a1&&_0x5c27a1[_0xc761('0x19')]){for(var _0x5148d7=0x0;_0x5148d7<_0x5c27a1['length'];_0x5148d7+=0x1){for(var _0x1f2bf3=0x0;_0x1f2bf3<_0x5c27a1[_0x5148d7][_0xc761('0x19')];_0x1f2bf3+=0x1){switch(_0x5148d7){case 0x0:joinOrLeaveQueues(_0x2043e0,_0xb48d6b,_0xc761('0x3a'),_0x5c27a1[_0x5148d7][_0x1f2bf3]);break;case 0x1:joinOrLeaveQueues(_0x2043e0,_0xb48d6b,'chat',_0x5c27a1[_0x5148d7][_0x1f2bf3]);break;case 0x2:joinOrLeaveQueues(_0x2043e0,_0xb48d6b,'fax',_0x5c27a1[_0x5148d7][_0x1f2bf3]);break;case 0x3:joinOrLeaveQueues(_0x2043e0,_0xb48d6b,_0xc761('0x3b'),_0x5c27a1[_0x5148d7][_0x1f2bf3]);break;case 0x4:joinOrLeaveQueues(_0x2043e0,_0xb48d6b,_0xc761('0x3c'),_0x5c27a1[_0x5148d7][_0x1f2bf3]);break;case 0x5:joinOrLeaveQueues(_0x2043e0,_0xb48d6b,'openchannel',_0x5c27a1[_0x5148d7][_0x1f2bf3]);break;case 0x6:joinOrLeaveQueues(_0x2043e0,_0xb48d6b,_0xc761('0x3d'),_0x5c27a1[_0x5148d7][_0x1f2bf3]);break;case 0x7:if(_0x47c0d9['role']!=='agent')_0x2043e0[_0xb48d6b](util['format']('telephone:%s',_0x5c27a1[_0x5148d7][_0x1f2bf3][_0xc761('0x3')]));break;case 0x8:if(_0x47c0d9[_0xc761('0x6')]!==_0xc761('0x8'))_0x2043e0[_0xb48d6b](util[_0xc761('0x17')](_0xc761('0x3e'),_0x5c27a1[_0x5148d7][_0x1f2bf3][_0xc761('0x3')]));break;case 0x9:if(_0x47c0d9[_0xc761('0x6')]!=='agent')_0x2043e0[_0xb48d6b](util['format']('campaign:%s:%s',_0x5c27a1[_0x5148d7][_0x1f2bf3]['type'],_0x5c27a1[_0x5148d7][_0x1f2bf3][_0xc761('0x3')]));break;case 0xa:_0x2043e0[_0xb48d6b](util[_0xc761('0x17')](_0xc761('0x1a'),_0x5c27a1[_0x5148d7][_0x1f2bf3][_0xc761('0x3')]));break;}}}}})[_0xc761('0xc')](function(){if(_0xb48d6b==='leave'){var _0x2d5a41=_[_0xc761('0x14')](_0x47c0d9[_0xc761('0x1f')],'id');return _0x47c0d9[_0xc761('0x3f')](_0x2d5a41)[_0xc761('0xc')](function(){for(var _0x32e280=0x0;_0x32e280<_0x2d5a41[_0xc761('0x19')];_0x32e280+=0x1){_0x13a002['emit'](_0xc761('0x40'),{'ChatInteractionId':Number(_0x2d5a41[_0x32e280]),'UserId':Number(_0x47c0d9['id'])});}});}})[_0xc761('0xc')](function(){if(_0xb48d6b==='leave'){var _0x4b2f08=_[_0xc761('0x14')](_0x47c0d9[_0xc761('0x21')],'id');return _0x47c0d9[_0xc761('0x41')](_0x4b2f08)['then'](function(){for(var _0x3584d4=0x0;_0x3584d4<_0x4b2f08[_0xc761('0x19')];_0x3584d4+=0x1){_0x13a002['emit'](_0xc761('0x42'),{'MailInteractionId':Number(_0x4b2f08[_0x3584d4]),'UserId':Number(_0x47c0d9['id'])});}});}})[_0xc761('0xc')](function(){if(_0xb48d6b==='leave'){var _0x5cee91=_[_0xc761('0x14')](_0x47c0d9['FaxInteractions'],'id');return _0x47c0d9['removeFaxInteractions'](_0x5cee91)[_0xc761('0xc')](function(){for(var _0x2e7049=0x0;_0x2e7049<_0x5cee91[_0xc761('0x19')];_0x2e7049+=0x1){_0x13a002[_0xc761('0x43')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x5cee91[_0x2e7049]),'UserId':Number(_0x47c0d9['id'])});}});}})['then'](function(){if(_0xb48d6b===_0xc761('0x44')){var _0xbd67f0=_[_0xc761('0x14')](_0x47c0d9[_0xc761('0x23')],'id');return _0x47c0d9[_0xc761('0x45')](_0xbd67f0)[_0xc761('0xc')](function(){for(var _0xf0cf1f=0x0;_0xf0cf1f<_0xbd67f0['length'];_0xf0cf1f+=0x1){_0x13a002[_0xc761('0x43')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0xbd67f0[_0xf0cf1f]),'UserId':Number(_0x47c0d9['id'])});}});}})[_0xc761('0xc')](function(){if(_0xb48d6b==='leave'){var _0x41a9a4=_[_0xc761('0x14')](_0x47c0d9[_0xc761('0x24')],'id');return _0x47c0d9[_0xc761('0x46')](_0x41a9a4)[_0xc761('0xc')](function(){for(var _0x42ada7=0x0;_0x42ada7<_0x41a9a4['length'];_0x42ada7+=0x1){_0x13a002[_0xc761('0x43')](_0xc761('0x47'),{'OpenchannelInteractionId':Number(_0x41a9a4[_0x42ada7]),'UserId':Number(_0x47c0d9['id'])});}});}})[_0xc761('0xc')](function(){if(_0xb48d6b===_0xc761('0x44')){var _0x2a6064=_[_0xc761('0x14')](_0x47c0d9[_0xc761('0x25')],'id');return _0x47c0d9[_0xc761('0x48')](_0x2a6064)[_0xc761('0xc')](function(){for(var _0x31c25a=0x0;_0x31c25a<_0x2a6064[_0xc761('0x19')];_0x31c25a+=0x1){_0x13a002[_0xc761('0x43')](_0xc761('0x49'),{'WhatsappInteractionId':Number(_0x2a6064[_0x31c25a]),'UserId':Number(_0x47c0d9['id'])});}});}})[_0xc761('0x4a')](function(_0x133528){_0x2043e0['log'](_0x133528);});}}function onDisconnect(_0x249768,_0x51e04c){joinOrLeave(_0x249768,_0xc761('0x44'),_0x51e04c);}function onConnect(_0x37cbab){joinOrLeave(_0x37cbab,_0xc761('0x4b'));}exports['default']=function(_0x481b2b){_0x481b2b['on']('connection',function(_0x1f2687){_0x1f2687[_0xc761('0x4c')](0x0);_0x1f2687['address']=_0x1f2687[_0xc761('0x4d')]['connection']['remoteAddress']+':'+_0x1f2687['request']['connection']['remotePort'];_0x1f2687[_0xc761('0x4e')]=new Date();_0x1f2687['log']=function(_0x4783c5){console[_0xc761('0x4f')](_0xc761('0x50')+_0x1f2687[_0xc761('0x51')]['name']+'['+_0x1f2687[_0xc761('0x52')]+']',_0x4783c5);};_0x1f2687['on']('disconnect',function(){onDisconnect(_0x1f2687,_0x481b2b);_0x1f2687[_0xc761('0x4f')](_0xc761('0x53'));});onConnect(_0x1f2687);_0x1f2687['log'](_0xc761('0x54'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 22324ee..50e3f3b 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 _0x32a9=['newinteraction','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','Mail','MailInteraction','MailMessage','OpenchannelInteraction','request','EventManager','info','Trigger,\x20%s','error','code','get','channel','motionChannel','event','resolve','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','then','contact','UserId','interface','format','SIP/%s','name','agent','incomingmessage','outgoingmessage','catch','AfterCreateMessage','opened','SELECT','AfterCreate','changed','closed','substatus','query','AfterUpdate','User','find','fullname','email','internal','length','hasOwnProperty','model','hook','callback','toLowerCase','condition','util','jayson/promise','triggers','client','http','Chat','ChatInteraction','afterCreate','afterUpdate','closedinteraction','newmessage','SmsInteraction'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x32a9,0x84));var _0x932a=function(_0x494ee1,_0x1f18e1){_0x494ee1=_0x494ee1-0x0;var _0x1e0057=_0x32a9[_0x494ee1];return _0x1e0057;};'use strict';var util=require(_0x932a('0x0'));var db=require('../../mysqldb')['db'];var jayson=require(_0x932a('0x1'));var logger=require('../logger')(_0x932a('0x2'));var client=jayson[_0x932a('0x3')][_0x932a('0x4')]({'port':0x232a});var triggers=[{'channel':_0x932a('0x5'),'model':_0x932a('0x6'),'event':_0x932a('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':'Chat','model':_0x932a('0x6'),'event':_0x932a('0x8'),'condition':_0x932a('0x9'),'callback':afterUpdate},{'channel':_0x932a('0x5'),'model':'ChatMessage','event':_0x932a('0x7'),'condition':_0x932a('0xa'),'callback':afterCreateMessage},{'channel':_0x932a('0x5'),'model':'ChatOfflineMessage','event':_0x932a('0x7'),'condition':_0x932a('0xa'),'callback':afterCreateOfflineMessage},{'channel':'Sms','model':_0x932a('0xb'),'event':'afterCreate','condition':_0x932a('0xc'),'callback':afterCreate},{'channel':'Sms','model':_0x932a('0xb'),'event':_0x932a('0x8'),'condition':_0x932a('0x9'),'callback':afterUpdate},{'channel':'Sms','model':_0x932a('0xd'),'event':'afterCreate','condition':_0x932a('0xa'),'callback':afterCreateMessage},{'channel':_0x932a('0xe'),'model':_0x932a('0xf'),'event':_0x932a('0x7'),'condition':_0x932a('0xc'),'callback':afterCreate},{'channel':'Whatsapp','model':'WhatsappInteraction','event':'afterUpdate','condition':_0x932a('0x9'),'callback':afterUpdate},{'channel':_0x932a('0xe'),'model':_0x932a('0x10'),'event':_0x932a('0x7'),'condition':_0x932a('0xa'),'callback':afterCreateMessage},{'channel':_0x932a('0x11'),'model':_0x932a('0x12'),'event':_0x932a('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x932a('0x11'),'model':_0x932a('0x12'),'event':_0x932a('0x8'),'condition':_0x932a('0x9'),'callback':afterUpdate},{'channel':'Fax','model':'FaxMessage','event':_0x932a('0x7'),'condition':_0x932a('0xa'),'callback':afterCreateMessage},{'channel':_0x932a('0x13'),'model':_0x932a('0x14'),'event':_0x932a('0x7'),'condition':_0x932a('0xc'),'callback':afterCreate},{'channel':'Mail','model':'MailInteraction','event':_0x932a('0x8'),'condition':_0x932a('0x9'),'callback':afterUpdate},{'channel':_0x932a('0x13'),'model':_0x932a('0x15'),'event':_0x932a('0x7'),'condition':_0x932a('0xa'),'callback':afterCreateMessage},{'channel':'Openchannel','model':'OpenchannelInteraction','event':'afterCreate','condition':_0x932a('0xc'),'callback':afterCreate},{'channel':'Openchannel','model':_0x932a('0x16'),'event':_0x932a('0x8'),'condition':_0x932a('0x9'),'callback':afterUpdate},{'channel':'Openchannel','model':'OpenchannelMessage','event':_0x932a('0x7'),'condition':_0x932a('0xa'),'callback':afterCreateMessage}];function request(_0x5512e3){return client[_0x932a('0x17')](_0x932a('0x18'),_0x5512e3)['then'](function(_0x4e9ab7){logger[_0x932a('0x19')](_0x932a('0x1a'),_0x932a('0x18'),_0x4e9ab7);if(_0x4e9ab7[_0x932a('0x1b')]){if(_0x4e9ab7[_0x932a('0x1b')][_0x932a('0x1c')]===0x1f4){logger['error'](_0x932a('0x1a'),_0x932a('0x18'),_0x4e9ab7[_0x932a('0x1b')]);}}})['catch'](function(_0x3ba75c){logger[_0x932a('0x1b')](_0x932a('0x1a'),_0x932a('0x18'),_0x3ba75c);});}function afterCreateMessage(_0x237aeb){return function(_0x3930c8){_0x3930c8=_0x3930c8[_0x932a('0x1d')]({'plain':!![]});_0x3930c8[_0x932a('0x1e')]=_0x237aeb;_0x3930c8[_0x932a('0x1f')]=_0x237aeb;_0x3930c8[_0x932a('0x20')]=_0x3930c8['direction'];Promise[_0x932a('0x21')]()['then'](function(){if(typeof _0x3930c8[_0x932a('0x22')]===_0x932a('0x23'))return null;var _0x3756e8=_0x932a('0x24')+_0x3930c8['ContactId'];return db[_0x932a('0x25')]['query'](_0x3756e8,{'type':db[_0x932a('0x26')][_0x932a('0x27')]['SELECT'],'raw':!![]});})[_0x932a('0x28')](function(_0x16b5e5){if(_0x16b5e5){_0x3930c8[_0x932a('0x29')]=_0x16b5e5[0x0];}if(typeof _0x3930c8[_0x932a('0x2a')]===_0x932a('0x23'))return;return getAgent(_0x3930c8[_0x932a('0x2a')]);})[_0x932a('0x28')](function(_0x54243d){if(_0x54243d){_0x3930c8[_0x932a('0x2b')]=util[_0x932a('0x2c')](_0x932a('0x2d'),_0x54243d[_0x932a('0x2e')]);_0x3930c8[_0x932a('0x2f')]=_0x54243d;_0x3930c8['channel']=_0x237aeb;return request({'event':_0x932a('0x30'),'message':_0x3930c8});}else{return request({'event':_0x932a('0x31'),'message':_0x3930c8});}})[_0x932a('0x32')](function(_0x52cdd9){logger[_0x932a('0x1b')](_0x932a('0x1a'),_0x932a('0x33'),_0x52cdd9);});};}function afterCreateOfflineMessage(_0x3bc2aa){return function(_0x3cd9f9){_0x3cd9f9=_0x3cd9f9['get']({'plain':!![]});_0x3cd9f9[_0x932a('0x1e')]=_0x3bc2aa;_0x3cd9f9['motionChannel']=_0x3bc2aa;_0x3cd9f9[_0x932a('0x20')]='offlineMessage';return request({'event':_0x3cd9f9[_0x932a('0x20')],'message':_0x3cd9f9});};}function afterCreate(_0x4b2e2a,_0x7b2eac){return function(_0x3da334){_0x3da334=_0x3da334[_0x932a('0x1d')]({'plain':!![]});_0x3da334['channel']=_0x4b2e2a;_0x3da334[_0x932a('0x1f')]=_0x4b2e2a;_0x3da334[_0x932a('0x20')]=_0x932a('0x34');Promise[_0x932a('0x21')]()[_0x932a('0x28')](function(){var _0x1f33f7=_0x932a('0x24')+_0x3da334['ContactId'];return db['sequelize']['query'](_0x1f33f7,{'type':db[_0x932a('0x26')][_0x932a('0x27')][_0x932a('0x35')],'raw':!![]});})[_0x932a('0x28')](function(_0x45a407){if(_0x45a407){_0x3da334[_0x932a('0x29')]=_0x45a407[0x0];}if(typeof _0x3da334[_0x932a('0x2a')]===_0x932a('0x23'))return;return getAgent(_0x3da334[_0x932a('0x2a')]);})['then'](function(_0x2c8bb2){if(_0x2c8bb2){_0x3da334[_0x932a('0x2b')]=util['format'](_0x932a('0x2d'),_0x2c8bb2['name']);_0x3da334[_0x932a('0x2f')]=_0x2c8bb2;}return request({'event':_0x7b2eac,'message':_0x3da334});})['catch'](function(_0x47c987){logger[_0x932a('0x1b')](_0x932a('0x1a'),_0x932a('0x36'),_0x47c987);});};}function afterUpdate(_0xf17d45){return function(_0x1b4199){var _0xd6e8a=_0x1b4199[_0x932a('0x37')](_0x932a('0x38'))&&_0x1b4199[_0x932a('0x38')];var _0xbb6bcb=_0x1b4199[_0x932a('0x37')](_0x932a('0x39'));if(_0xd6e8a||_0xbb6bcb){var _0x3be36e=_0xd6e8a?_0x932a('0x9'):'substatus';var _0x10e1a4=_0x1b4199[_0x932a('0x1d')]({'plain':!![]});_0x10e1a4['channel']=_0xf17d45;_0x10e1a4[_0x932a('0x1f')]=_0xf17d45;_0x10e1a4[_0x932a('0x20')]=_0xd6e8a?_0x932a('0x38'):'substatus';var _0x1cb38f=_0x932a('0x24')+_0x10e1a4[_0x932a('0x22')];return db[_0x932a('0x25')][_0x932a('0x3a')](_0x1cb38f,{'type':db[_0x932a('0x26')][_0x932a('0x27')]['SELECT'],'raw':!![]})[_0x932a('0x28')](function(_0x27cf09){if(_0x27cf09){_0x10e1a4[_0x932a('0x29')]=_0x27cf09[0x0];}if(typeof _0x10e1a4[_0x932a('0x2a')]===_0x932a('0x23'))return;return getAgent(_0x10e1a4['UserId']);})[_0x932a('0x28')](function(_0x5713d1){if(_0x5713d1){_0x10e1a4['interface']=util[_0x932a('0x2c')](_0x932a('0x2d'),_0x5713d1['name']);_0x10e1a4[_0x932a('0x2f')]=_0x5713d1;}return request({'event':_0x3be36e,'message':_0x10e1a4});})[_0x932a('0x32')](function(_0x59556a){logger[_0x932a('0x1b')](_0x932a('0x1a'),_0x932a('0x3b'),_0x59556a);});}};}function getAgent(_0x4accf6){return db[_0x932a('0x3c')][_0x932a('0x3d')]({'where':{'id':_0x4accf6},'attributes':['id',_0x932a('0x2e'),_0x932a('0x3e'),_0x932a('0x3f'),_0x932a('0x40')],'raw':!![]})[_0x932a('0x28')](function(_0x288914){return _0x288914;});}exports['default']=function(){for(var _0x996e0b=0x0;_0x996e0b=_0x1be772[_0x9fde('0x15')]){throw Error(_0x9fde('0x16'));}_0x2fb776(_0x22241a);})['catch'](function(_0x788cf0){_0x4979d5(_0x788cf0);});});}; \ No newline at end of file +var _0x763a=['catch','lodash','bluebird','../mysqldb','./license/util','voice','mail','chat','sms','whatsapp','openchannel','getChannels','isValidChannel','includes','clearBlockUser','blockedAt','updateAttributes','getLicense','role','agent','then','agents','Maximum\x20login\x20has\x20been\x20reached'];(function(_0x1238fc,_0x404d1f){var _0x66d410=function(_0x22b1bc){while(--_0x22b1bc){_0x1238fc['push'](_0x1238fc['shift']());}};_0x66d410(++_0x404d1f);}(_0x763a,0x19f));var _0xa763=function(_0x1ff728,_0x469b9f){_0x1ff728=_0x1ff728-0x0;var _0x47ba02=_0x763a[_0x1ff728];return _0x47ba02;};'use strict';var _=require(_0xa763('0x0'));var BPromise=require(_0xa763('0x1'));var db=require(_0xa763('0x2'))['db'];var util=require(_0xa763('0x3'));var channels=[_0xa763('0x4'),_0xa763('0x5'),_0xa763('0x6'),'fax',_0xa763('0x7'),_0xa763('0x8'),_0xa763('0x9')];exports[_0xa763('0xa')]=function(){return channels;};exports[_0xa763('0xb')]=function(_0x384cdd){_0x384cdd=_0x384cdd['toLowerCase']();return _[_0xa763('0xc')](channels,_0x384cdd);};exports[_0xa763('0xd')]=function(_0x39b50b,_0x183b4f,_0x40add1,_0x56050b){var _0x44c5c0={'loginAttempts':_0x183b4f,'blocked':_0x40add1};if(!_['isUndefined'](_0x56050b)){_0x44c5c0[_0xa763('0xe')]=_0x56050b;}return _0x39b50b[_0xa763('0xf')](_0x44c5c0);};exports[_0xa763('0x10')]=function(_0x3fd475){return new BPromise(function(_0x23342b,_0x38a3dd){var _0x248bb4=0x0;if(_0x3fd475[_0xa763('0x11')]!==_0xa763('0x12')){_0x23342b(_0x3fd475);}db['User']['count']({'where':{'role':'agent','online':!![],'id':{'$ne':_0x3fd475['id']}}})[_0xa763('0x13')](function(_0x366101){_0x248bb4=_0x366101;return util[_0xa763('0x10')]();})[_0xa763('0x13')](function(_0x46c8f4){if(_0x46c8f4&&_0x46c8f4['agents']&&_0x248bb4>=_0x46c8f4[_0xa763('0x14')]){throw Error(_0xa763('0x15'));}_0x23342b(_0x3fd475);})[_0xa763('0x16')](function(_0x83481b){_0x38a3dd(_0x83481b);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index f9d1008..c1c697c 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x92e5=['name','Not\x20Found','Message\x20sent\x20outside\x20a\x20valid\x20interval','code','details','Resource\x20Conflict','Conflict','Out\x20Of\x20Interval','error','statusMessage','status','send','exports','util','../config/logger','api','Internal\x20Server\x20Error','Error','inherits','message','Bad\x20Request','Forbidden','Entity\x20not\x20found'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x92e5,0x1c2));var _0x592e=function(_0x30ff87,_0x38f522){_0x30ff87=_0x30ff87-0x0;var _0x9e6ddf=_0x92e5[_0x30ff87];return _0x9e6ddf;};'use strict';var util=require(_0x592e('0x0'));var logger=require(_0x592e('0x1'))(_0x592e('0x2'));var APIError=function(_0x520d00,_0x1c95c8){this['message']=_0x520d00||_0x592e('0x3');this['name']=_0x1c95c8||_0x592e('0x4');util[_0x592e('0x5')](APIError,Error);};var APIBadRequestError=function(_0x1cde40){this[_0x592e('0x6')]=_0x1cde40||'Bad\x20Request';this['name']=_0x592e('0x7');util[_0x592e('0x5')](APIBadRequestError,APIError);};var APIForbiddenError=function(_0x4c4b1a){this['message']=_0x4c4b1a||_0x592e('0x8');this['name']=_0x592e('0x8');util[_0x592e('0x5')](APIForbiddenError,APIError);};var APINotFoundError=function(_0x2881f1){this[_0x592e('0x6')]=_0x2881f1||_0x592e('0x9');this[_0x592e('0xa')]=_0x592e('0xb');util[_0x592e('0x5')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x42ce49){this['message']=_0x42ce49||_0x592e('0xc');this['name']='Out\x20Of\x20Interval';this[_0x592e('0xd')]=0x193;this[_0x592e('0xe')]={'type':'OutOfInterval'};util[_0x592e('0x5')](APIOutOfIntervalError,APIError);};var APIConflictError=function(_0x25c7fc){this[_0x592e('0x6')]=_0x25c7fc||_0x592e('0xf');this[_0x592e('0xa')]=_0x592e('0x10');util[_0x592e('0x5')](APIBadRequestError,APIError);};function getStatusCode(_0x3ff32d){switch(_0x3ff32d){case _0x592e('0x7'):return 0x190;case _0x592e('0x8'),_0x592e('0x11'):return 0x193;case _0x592e('0xb'):return 0x194;case'Conflict':return 0x199;default:return 0x1f4;}}function getCustomStatusMessage(_0x3a674e){if(_0x3a674e==='Out\x20Of\x20Interval')return _0x3a674e;return null;}function handleError(_0x8abe9d){return function(_0x126321){logger[_0x592e('0x12')](_0x126321['stack']);var _0x4536ff=getStatusCode(_0x126321[_0x592e('0xa')]);var _0x4b87a0=getCustomStatusMessage(_0x126321['name']);if(_0x126321['name']){delete _0x126321[_0x592e('0xa')];}if(_0x4b87a0){_0x8abe9d[_0x592e('0x13')]=_0x4b87a0;}return _0x8abe9d[_0x592e('0x14')](_0x4536ff)[_0x592e('0x15')](_0x126321);};}module[_0x592e('0x16')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIForbiddenError':APIForbiddenError,'APINotFoundError':APINotFoundError,'APIOutOfIntervalError':APIOutOfIntervalError,'APIConflict':APIConflictError,'handleError':handleError}; \ No newline at end of file +var _0x239e=['Entity\x20not\x20found','Not\x20Found','Message\x20sent\x20outside\x20a\x20valid\x20interval','Out\x20Of\x20Interval','code','OutOfInterval','Conflict','stack','status','send','exports','util','../config/logger','api','message','Internal\x20Server\x20Error','name','inherits','Bad\x20Request','Forbidden'];(function(_0x56a871,_0x18b7fe){var _0x124954=function(_0x39b7a1){while(--_0x39b7a1){_0x56a871['push'](_0x56a871['shift']());}};_0x124954(++_0x18b7fe);}(_0x239e,0xe7));var _0xe239=function(_0x34843e,_0x4c4224){_0x34843e=_0x34843e-0x0;var _0x598f7f=_0x239e[_0x34843e];return _0x598f7f;};'use strict';var util=require(_0xe239('0x0'));var logger=require(_0xe239('0x1'))(_0xe239('0x2'));var APIError=function(_0x4117aa,_0xc73508){this[_0xe239('0x3')]=_0x4117aa||_0xe239('0x4');this[_0xe239('0x5')]=_0xc73508||'Error';util[_0xe239('0x6')](APIError,Error);};var APIBadRequestError=function(_0x1fb7c3){this['message']=_0x1fb7c3||_0xe239('0x7');this[_0xe239('0x5')]=_0xe239('0x7');util[_0xe239('0x6')](APIBadRequestError,APIError);};var APIForbiddenError=function(_0x22d201){this['message']=_0x22d201||_0xe239('0x8');this[_0xe239('0x5')]=_0xe239('0x8');util['inherits'](APIForbiddenError,APIError);};var APINotFoundError=function(_0x3c382f){this[_0xe239('0x3')]=_0x3c382f||_0xe239('0x9');this[_0xe239('0x5')]=_0xe239('0xa');util[_0xe239('0x6')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x5458fe){this['message']=_0x5458fe||_0xe239('0xb');this['name']=_0xe239('0xc');this[_0xe239('0xd')]=0x193;this['details']={'type':_0xe239('0xe')};util[_0xe239('0x6')](APIOutOfIntervalError,APIError);};var APIConflictError=function(_0x20ba5a){this['message']=_0x20ba5a||'Resource\x20Conflict';this[_0xe239('0x5')]='Conflict';util[_0xe239('0x6')](APIBadRequestError,APIError);};function getStatusCode(_0x5ef8ae){switch(_0x5ef8ae){case _0xe239('0x7'):return 0x190;case _0xe239('0x8'),_0xe239('0xc'):return 0x193;case _0xe239('0xa'):return 0x194;case _0xe239('0xf'):return 0x199;default:return 0x1f4;}}function getCustomStatusMessage(_0xad7d72){if(_0xad7d72==='Out\x20Of\x20Interval')return _0xad7d72;return null;}function handleError(_0x21f79c){return function(_0x3eb3cd){logger['error'](_0x3eb3cd[_0xe239('0x10')]);var _0x46f9fd=getStatusCode(_0x3eb3cd[_0xe239('0x5')]);var _0x2eb8a0=getCustomStatusMessage(_0x3eb3cd['name']);if(_0x3eb3cd[_0xe239('0x5')]){delete _0x3eb3cd[_0xe239('0x5')];}if(_0x2eb8a0){_0x21f79c['statusMessage']=_0x2eb8a0;}return _0x21f79c[_0xe239('0x11')](_0x46f9fd)[_0xe239('0x12')](_0x3eb3cd);};}module[_0xe239('0x13')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIForbiddenError':APIForbiddenError,'APINotFoundError':APINotFoundError,'APIOutOfIntervalError':APIOutOfIntervalError,'APIConflict':APIConflictError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 5fd8897..71b6409 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x85f8=['404','status','render','json','send','exports'];(function(_0x6bd06d,_0x1a434d){var _0x4d2df3=function(_0x5c91a9){while(--_0x5c91a9){_0x6bd06d['push'](_0x6bd06d['shift']());}};_0x4d2df3(++_0x1a434d);}(_0x85f8,0xd7));var _0x885f=function(_0x399fa4,_0x124cd5){_0x399fa4=_0x399fa4-0x0;var _0x7ae905=_0x85f8[_0x399fa4];return _0x7ae905;};'use strict';module[_0x885f('0x0')][0x194]=function pageNotFound(_0x4186b0,_0x1fe991){var _0x33099b=_0x885f('0x1');var _0x21c4c8=0x194;var _0x18de5b={'status':_0x21c4c8};_0x1fe991[_0x885f('0x2')](_0x18de5b['status']);_0x1fe991[_0x885f('0x3')](_0x33099b,{},function(_0x42dc60,_0x135a23){if(_0x42dc60){return _0x1fe991['status'](_0x18de5b[_0x885f('0x2')])[_0x885f('0x4')](_0x18de5b);}_0x1fe991[_0x885f('0x5')](_0x135a23);});}; \ No newline at end of file +var _0x9e0d=['json','send','exports','status','render'];(function(_0x2f7e24,_0x52a165){var _0x1c03ca=function(_0xa2d0a3){while(--_0xa2d0a3){_0x2f7e24['push'](_0x2f7e24['shift']());}};_0x1c03ca(++_0x52a165);}(_0x9e0d,0xf7));var _0xd9e0=function(_0x1eb411,_0x295844){_0x1eb411=_0x1eb411-0x0;var _0x5be2ba=_0x9e0d[_0x1eb411];return _0x5be2ba;};'use strict';module[_0xd9e0('0x0')][0x194]=function pageNotFound(_0x19bb01,_0x6d0b17){var _0x1634c8='404';var _0x2c5792=0x194;var _0x3ec198={'status':_0x2c5792};_0x6d0b17[_0xd9e0('0x1')](_0x3ec198[_0xd9e0('0x1')]);_0x6d0b17[_0xd9e0('0x2')](_0x1634c8,{},function(_0x36a691,_0x4d2247){if(_0x36a691){return _0x6d0b17['status'](_0x3ec198[_0xd9e0('0x1')])[_0xd9e0('0x3')](_0x3ec198);}_0x6d0b17[_0xd9e0('0x4')](_0x4d2247);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index be81097..ae4d3ca 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe032=['../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','../api/faxAccount/faxAccount.model','FaxApplication','FaxInteraction','../api/faxInteraction/faxInteraction.model','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','../api/smsQueue/smsQueue.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','SalesforceConfiguration','SalesforceField','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','DeskAccount','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../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/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','Plugin','MailTransferReport','ChatTransferReport','FaxTransferReport','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','VoicePrefix','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','../api/whatsappInteraction/whatsappInteraction.model','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappTransferReport/whatsappTransferReport.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','hasOne','VoiceMail','UserId','userSetting','cascade','hasMany','Recordings','CmHopperFinal','HopperHistory','OpenchannelInteraction','ChatInteraction','ChatInteractions','SmsInteractions','MailInteractions','WhatsappInteraction','WhatsappInteractions','UserNotification','SenderId','Hoppers','UserProfile','belongsToMany','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_mail_interactions','user_has_chat_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','MailQueues','UserMailQueue','ChatQueues','SmsQueue','OpenchannelQueues','WhatsappQueues','ChatWebsites','FaxAccount','FaxAccounts','MailAccounts','user_has_mail_accounts','OpenchannelAccount','OpenchannelAccounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SpiedAgents','ChanSpyId','Sound','Sounds','moh_has_sounds','Members','VoiceQueueId','HopperHistories','HopperBlacks','belongsTo','Trunk','TrunkBackupId','Interval','IntervalId','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','Contact','ContactId','MailAccount','MailAccountId','CloudProviderId','restrict','Imap','Smtp','Dispositions','Answers','Interactions','Applications','List','ListId','Template','TemplateId','team_has_mail_queues','MailInteractionId','Account','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessage','TagId','MailQueueReport','Items','FaxAccountId','Exntensions','mandatoryDispositionPause','user_has_fax_accounts','FaxMessage','FaxInteractionId','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','user_has_openchannel_accounts','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ProactiveActions','Agent','Queue','Website','ChatInteractionId','chat_interaction_has_tags','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','chat_group_has_users','CompanyId','Phones','CmContactId','HopperFinals','JscriptySessions','Company','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','OwnerId','CampaignId','All','Any','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','Extensions','MailApplications','ChatApplications','FaxApplications','SmsApplications','Schedule','AnalyticDefaultReport','DefaultReportId','Mohs','whatsapp_interaction_has_tags','ItemType','ItemTypeId','CmHopperId','AllConditions','AllCondition','TriggerAllId','AnyCondition','TriggerId','Fields','CustomReportId','Configurations','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Field','VariableId','SugarcrmField','Description','int_desk_configuration_has_tags','DeskField','ZendeskConfiguration','int_zendesk_configuration_has_tags','VtigerField','ServicenowConfiguration','Dynamics365Field','FreshsalesField','FromId','ToId','SessionId','ProjectId','user_has_teams','FaxQueues','team_has_whatsapp_queues','TeamVoicePrefix','TrunkId','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','FromFaxAccountId','FromAgent','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','userProfileId','Resources','sectionId','WhatsappAccountId','WhatsappMessage','WhatsappInteractionId','WhatsappQueue','WhatsappTransferReport','FromWhatsappAccountId','WhatsappQueueId','user','exports','../config/environment','sequelize','lodash','determine','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','database','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceExtension','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','../api/memberReport/memberReport.model','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','MailServerOut'];(function(_0x14cd6f,_0x263dfd){var _0x1a31ce=function(_0xf199d4){while(--_0xf199d4){_0x14cd6f['push'](_0x14cd6f['shift']());}};_0x1a31ce(++_0x263dfd);}(_0xe032,0x1cb));var _0x2e03=function(_0x13c174,_0xda25fe){_0x13c174=_0x13c174-0x0;var _0x160654=_0xe032[_0x13c174];return _0x160654;};'use strict';var config=require(_0x2e03('0x0'));var Sequelize=require(_0x2e03('0x1'));var _=require(_0x2e03('0x2'));var jstz=require('jstz');var timezone=jstz[_0x2e03('0x3')]();config[_0x2e03('0x1')]=_[_0x2e03('0x4')](config[_0x2e03('0x1')],{'database':_0x2e03('0x5'),'username':_0x2e03('0x6'),'password':_0x2e03('0x7'),'options':{'host':_0x2e03('0x8'),'port':0xcea,'dialect':_0x2e03('0x9'),'dialectOptions':{'charset':_0x2e03('0xa')},'logging':![],'timezone':timezone[_0x2e03('0xb')](),'define':{'charset':_0x2e03('0xc'),'collate':_0x2e03('0xd')}}});config[_0x2e03('0xe')]=_[_0x2e03('0x4')](config[_0x2e03('0xe')],{'database':_0x2e03('0x5'),'username':'xcall','password':_0x2e03('0x7'),'options':{'host':_0x2e03('0x8'),'port':0xcea,'dialect':_0x2e03('0x9'),'dialectOptions':{'charset':_0x2e03('0xa')},'logging':![],'timezone':timezone[_0x2e03('0xb')](),'define':{'charset':_0x2e03('0xc'),'collate':_0x2e03('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x2e03('0x1')][_0x2e03('0xf')],config[_0x2e03('0x1')][_0x2e03('0x10')],config[_0x2e03('0x1')][_0x2e03('0x11')],config[_0x2e03('0x1')][_0x2e03('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x2e03('0xf')],config[_0x2e03('0xe')][_0x2e03('0x10')],config[_0x2e03('0xe')][_0x2e03('0x11')],config[_0x2e03('0xe')][_0x2e03('0x12')])};db[_0x2e03('0x13')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0x15'));db[_0x2e03('0x16')]=db['sequelize'][_0x2e03('0x14')](_0x2e03('0x17'));db['VoiceContext']=db[_0x2e03('0x1')]['import']('../api/voiceContext/voiceContext.model');db[_0x2e03('0x18')]=db['sequelize'][_0x2e03('0x14')]('../api/voiceExtension/voiceExtension.model');db[_0x2e03('0x19')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0x1a'));db[_0x2e03('0x1b')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0x1c'));db[_0x2e03('0x1d')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0x1e'));db[_0x2e03('0x1f')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0x20'));db['VoiceMail']=db[_0x2e03('0x1')]['import'](_0x2e03('0x21'));db[_0x2e03('0x22')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0x23'));db[_0x2e03('0x24')]=db['sequelize'][_0x2e03('0x14')](_0x2e03('0x25'));db[_0x2e03('0x26')]=db[_0x2e03('0x1')][_0x2e03('0x14')]('../api/voiceDialReport/voiceDialReport.model');db[_0x2e03('0x27')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0x28'));db[_0x2e03('0x29')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0x2a'));db['MemberReport']=db['sequelize']['import'](_0x2e03('0x2b'));db['Trunk']=db['sequelize'][_0x2e03('0x14')](_0x2e03('0x2c'));db['VoiceTransferReport']=db[_0x2e03('0x1')]['import'](_0x2e03('0x2d'));db[_0x2e03('0x2e')]=db[_0x2e03('0x1')]['import']('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x2e03('0x2f')]=db['sequelize'][_0x2e03('0x14')](_0x2e03('0x30'));db[_0x2e03('0x31')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0x32'));db['UserMailQueue']=db[_0x2e03('0x1')][_0x2e03('0x14')]('../api/userMailQueue/userMailQueue.model');db[_0x2e03('0x33')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0x34'));db[_0x2e03('0x35')]=db['sequelize'][_0x2e03('0x14')]('../api/userSmsQueue/userSmsQueue.model');db[_0x2e03('0x36')]=db['sequelize']['import'](_0x2e03('0x37'));db[_0x2e03('0x38')]=db['sequelize'][_0x2e03('0x14')](_0x2e03('0x39'));db[_0x2e03('0x3a')]=db[_0x2e03('0x1')][_0x2e03('0x14')]('../api/mailServerIn/mailServerIn.model');db[_0x2e03('0x3b')]=db['sequelize'][_0x2e03('0x14')](_0x2e03('0x3c'));db['MailAccount']=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0x3d'));db[_0x2e03('0x3e')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0x3f'));db[_0x2e03('0x40')]=db['sequelize'][_0x2e03('0x14')](_0x2e03('0x41'));db[_0x2e03('0x42')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0x43'));db[_0x2e03('0x44')]=db[_0x2e03('0x1')]['import'](_0x2e03('0x45'));db[_0x2e03('0x46')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0x47'));db['MailQueueReport']=db['sequelize']['import'](_0x2e03('0x48'));db[_0x2e03('0x49')]=db['sequelize'][_0x2e03('0x14')](_0x2e03('0x4a'));db[_0x2e03('0x4b')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0x4c'));db['FaxAccount']=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0x4d'));db[_0x2e03('0x4e')]=db['sequelize'][_0x2e03('0x14')]('../api/faxApplication/faxApplication.model');db[_0x2e03('0x4f')]=db['sequelize'][_0x2e03('0x14')](_0x2e03('0x50'));db['FaxMessage']=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0x51'));db[_0x2e03('0x52')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0x53'));db[_0x2e03('0x54')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0x55'));db[_0x2e03('0x56')]=db['sequelize'][_0x2e03('0x14')](_0x2e03('0x57'));db[_0x2e03('0x58')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0x59'));db[_0x2e03('0x5a')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0x5b'));db[_0x2e03('0x5c')]=db[_0x2e03('0x1')]['import'](_0x2e03('0x5d'));db['SmsQueue']=db[_0x2e03('0x1')]['import'](_0x2e03('0x5e'));db['OpenchannelAccount']=db[_0x2e03('0x1')][_0x2e03('0x14')]('../api/openchannelAccount/openchannelAccount.model');db[_0x2e03('0x5f')]=db['sequelize'][_0x2e03('0x14')](_0x2e03('0x60'));db['OpenchannelInteraction']=db['sequelize']['import'](_0x2e03('0x61'));db[_0x2e03('0x62')]=db['sequelize'][_0x2e03('0x14')]('../api/openchannelMessage/openchannelMessage.model');db[_0x2e03('0x63')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0x64'));db[_0x2e03('0x65')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0x66'));db[_0x2e03('0x67')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0x68'));db[_0x2e03('0x69')]=db['sequelize'][_0x2e03('0x14')]('../api/chatApplication/chatApplication.model');db['ChatInteraction']=db[_0x2e03('0x1')]['import'](_0x2e03('0x6a'));db[_0x2e03('0x6b')]=db['sequelize'][_0x2e03('0x14')](_0x2e03('0x6c'));db['ChatOfflineMessage']=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0x6d'));db[_0x2e03('0x6e')]=db[_0x2e03('0x1')]['import'](_0x2e03('0x6f'));db[_0x2e03('0x70')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0x71'));db[_0x2e03('0x72')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0x73'));db[_0x2e03('0x74')]=db['sequelize']['import'](_0x2e03('0x75'));db[_0x2e03('0x76')]=db['sequelize'][_0x2e03('0x14')](_0x2e03('0x77'));db[_0x2e03('0x78')]=db[_0x2e03('0x1')][_0x2e03('0x14')]('../api/cmHopper/cmHopper.model');db[_0x2e03('0x79')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0x7a'));db['CmHopperFinal']=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0x7b'));db[_0x2e03('0x7c')]=db['sequelize'][_0x2e03('0x14')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x2e03('0x7d')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0x7e'));db[_0x2e03('0x7f')]=db[_0x2e03('0x1')]['import'](_0x2e03('0x80'));db[_0x2e03('0x81')]=db['sequelize']['import'](_0x2e03('0x82'));db[_0x2e03('0x83')]=db['sequelize'][_0x2e03('0x14')](_0x2e03('0x84'));db[_0x2e03('0x85')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0x86'));db[_0x2e03('0x87')]=db['sequelize']['import'](_0x2e03('0x88'));db[_0x2e03('0x89')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0x8a'));db['Interval']=db[_0x2e03('0x1')][_0x2e03('0x14')]('../api/interval/interval.model');db[_0x2e03('0x8b')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0x8c'));db[_0x2e03('0x8d')]=db['sequelize'][_0x2e03('0x14')](_0x2e03('0x8e'));db[_0x2e03('0x8f')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0x90'));db['Schedule']=db[_0x2e03('0x1')][_0x2e03('0x14')]('../api/schedule/schedule.model');db['Sound']=db[_0x2e03('0x1')][_0x2e03('0x14')]('../api/sound/sound.model');db[_0x2e03('0x91')]=db['sequelize'][_0x2e03('0x14')](_0x2e03('0x92'));db[_0x2e03('0x93')]=db['sequelize'][_0x2e03('0x14')](_0x2e03('0x94'));db[_0x2e03('0x95')]=db[_0x2e03('0x1')][_0x2e03('0x14')]('../api/cmContactHasItem/cmContactHasItem.model');db['CmHopperAdditionalPhone']=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0x96'));db['Template']=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0x97'));db[_0x2e03('0x98')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0x99'));db[_0x2e03('0x9a')]=db['sequelize'][_0x2e03('0x14')]('../api/variable/variable.model');db[_0x2e03('0x9b')]=db['sequelize'][_0x2e03('0x14')](_0x2e03('0x9c'));db[_0x2e03('0x9d')]=db['sequelize'][_0x2e03('0x14')](_0x2e03('0x9e'));db[_0x2e03('0x9f')]=db['sequelize'][_0x2e03('0x14')]('../api/analyticCustomReport/analyticCustomReport.model');db['AnalyticDefaultReport']=db['sequelize'][_0x2e03('0x14')](_0x2e03('0xa0'));db[_0x2e03('0xa1')]=db['sequelize']['import'](_0x2e03('0xa2'));db[_0x2e03('0xa3')]=db['sequelize']['import'](_0x2e03('0xa4'));db[_0x2e03('0xa5')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0xa6'));db['AnalyticTreeReport']=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0xa7'));db[_0x2e03('0xa8')]=db[_0x2e03('0x1')][_0x2e03('0x14')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0x2e03('0xa9')]=db[_0x2e03('0x1')][_0x2e03('0x14')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0x2e03('0xaa')]=db[_0x2e03('0x1')]['import']('../api/intSalesforceField/intSalesforceField.model');db[_0x2e03('0xab')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0xac'));db[_0x2e03('0xad')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0xae'));db['SugarcrmField']=db[_0x2e03('0x1')][_0x2e03('0x14')]('../api/intSugarcrmField/intSugarcrmField.model');db[_0x2e03('0xaf')]=db[_0x2e03('0x1')][_0x2e03('0x14')]('../api/intDeskAccount/intDeskAccount.model');db[_0x2e03('0xb0')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0xb1'));db['DeskField']=db['sequelize'][_0x2e03('0x14')]('../api/intDeskField/intDeskField.model');db[_0x2e03('0xb2')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0xb3'));db[_0x2e03('0xb4')]=db[_0x2e03('0x1')][_0x2e03('0x14')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0x2e03('0xb5')]=db['sequelize'][_0x2e03('0x14')](_0x2e03('0xb6'));db[_0x2e03('0xb7')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0xb8'));db['ZendeskConfiguration']=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0xb9'));db[_0x2e03('0xba')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0xbb'));db[_0x2e03('0xbc')]=db[_0x2e03('0x1')]['import'](_0x2e03('0xbd'));db[_0x2e03('0xbe')]=db['sequelize']['import']('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0x2e03('0xbf')]=db[_0x2e03('0x1')]['import'](_0x2e03('0xc0'));db[_0x2e03('0xc1')]=db[_0x2e03('0x1')][_0x2e03('0x14')]('../api/intVtigerAccount/intVtigerAccount.model');db[_0x2e03('0xc2')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0xc3'));db['VtigerField']=db[_0x2e03('0x1')]['import'](_0x2e03('0xc4'));db[_0x2e03('0xc5')]=db['sequelize'][_0x2e03('0x14')]('../api/intServicenowAccount/intServicenowAccount.model');db['ServicenowConfiguration']=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0xc6'));db[_0x2e03('0xc7')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0xc8'));db[_0x2e03('0xc9')]=db[_0x2e03('0x1')]['import'](_0x2e03('0xca'));db[_0x2e03('0xcb')]=db[_0x2e03('0x1')][_0x2e03('0x14')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db['Dynamics365Field']=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0xcc'));db[_0x2e03('0xcd')]=db['sequelize'][_0x2e03('0x14')](_0x2e03('0xce'));db[_0x2e03('0xcf')]=db['sequelize'][_0x2e03('0x14')](_0x2e03('0xd0'));db['FreshsalesField']=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0xd1'));db[_0x2e03('0x9b')]=db[_0x2e03('0x1')][_0x2e03('0x14')]('../api/integration/integration.model');db[_0x2e03('0xd2')]=db['sequelize']['import'](_0x2e03('0xd3'));db[_0x2e03('0xd4')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0xd5'));db[_0x2e03('0xd6')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0xd7'));db[_0x2e03('0xd8')]=db['sequelize']['import'](_0x2e03('0xd9'));db[_0x2e03('0xda')]=db['sequelize'][_0x2e03('0x14')](_0x2e03('0xdb'));db[_0x2e03('0xdc')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0xdd'));db[_0x2e03('0xde')]=db['sequelize'][_0x2e03('0x14')]('../api/smsQueueReport/smsQueueReport.model');db['SquareReport']=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0xdf'));db[_0x2e03('0xe0')]=db['sequelize']['import'](_0x2e03('0xe1'));db[_0x2e03('0xe2')]=db['sequelize'][_0x2e03('0x14')]('../api/jscriptyProject/jscriptyProject.model');db[_0x2e03('0xe3')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0xe4'));db[_0x2e03('0xe5')]=db['sequelize'][_0x2e03('0x14')](_0x2e03('0xe6'));db[_0x2e03('0xe7')]=db['sequelize']['import'](_0x2e03('0xe8'));db[_0x2e03('0xe9')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0xea'));db[_0x2e03('0xeb')]=db[_0x2e03('0x1')]['import'](_0x2e03('0xec'));db[_0x2e03('0xed')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0xee'));db[_0x2e03('0xef')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0xf0'));db[_0x2e03('0xf1')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0xf2'));db[_0x2e03('0xf3')]=db[_0x2e03('0x1')]['import'](_0x2e03('0xf4'));db[_0x2e03('0xf5')]=db['sequelize'][_0x2e03('0x14')]('../api/attachment/attachment.model');db[_0x2e03('0xf6')]=db[_0x2e03('0x1')][_0x2e03('0x14')]('../api/plugin/plugin.model');db[_0x2e03('0xf7')]=db[_0x2e03('0x1')][_0x2e03('0x14')]('../api/mailTransferReport/mailTransferReport.model');db[_0x2e03('0xf8')]=db['sequelize']['import']('../api/chatTransferReport/chatTransferReport.model');db[_0x2e03('0xf9')]=db['sequelize']['import']('../api/faxTransferReport/faxTransferReport.model');db[_0x2e03('0xfa')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0xfb'));db[_0x2e03('0xfc')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0xfd'));db[_0x2e03('0xfe')]=db[_0x2e03('0x1')]['import']('../api/cmList/cmList.model');db[_0x2e03('0xff')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0x100'));db['UserProfile']=db['sequelize'][_0x2e03('0x14')](_0x2e03('0x101'));db[_0x2e03('0x102')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0x103'));db[_0x2e03('0x104')]=db[_0x2e03('0x1')]['import'](_0x2e03('0x105'));db['UserNotification']=db['sequelize'][_0x2e03('0x14')](_0x2e03('0x106'));db[_0x2e03('0x107')]=db['sequelize']['import'](_0x2e03('0x108'));db[_0x2e03('0x109')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0x10a'));db['WhatsappInteraction']=db['sequelize'][_0x2e03('0x14')](_0x2e03('0x10b'));db['WhatsappMessage']=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0x10c'));db[_0x2e03('0x10d')]=db[_0x2e03('0x1')][_0x2e03('0x14')]('../api/whatsappQueueReport/whatsappQueueReport.model');db['WhatsappTransferReport']=db[_0x2e03('0x1')]['import'](_0x2e03('0x10e'));db['WhatsappQueue']=db['sequelize'][_0x2e03('0x14')]('../api/whatsappQueue/whatsappQueue.model');db[_0x2e03('0x10f')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0x110'));db[_0x2e03('0x111')]=db[_0x2e03('0x1')][_0x2e03('0x14')]('../api/teamVoiceQueue/teamVoiceQueue.model');db['TeamVoicePrefix']=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0x112'));db[_0x2e03('0x113')]=db[_0x2e03('0x1')][_0x2e03('0x14')](_0x2e03('0x114'));db[_0x2e03('0x115')]=db[_0x2e03('0x1')]['import'](_0x2e03('0x116'));db['User'][_0x2e03('0x117')](db[_0x2e03('0x118')],{'as':_0x2e03('0x118'),'onDelete':'cascade','foreignKey':_0x2e03('0x119')});db[_0x2e03('0x13')]['hasOne'](db[_0x2e03('0x115')],{'as':_0x2e03('0x11a'),'onDelete':_0x2e03('0x11b'),'foreignKey':_0x2e03('0x119')});db[_0x2e03('0x13')][_0x2e03('0x11c')](db[_0x2e03('0x1d')],{'as':_0x2e03('0x11d'),'foreignKey':_0x2e03('0x119')});db[_0x2e03('0x13')][_0x2e03('0x11c')](db['UserVoiceQueueRt'],{'as':'VoiceQueuesRt','foreignKey':_0x2e03('0x119')});db[_0x2e03('0x13')]['hasMany'](db[_0x2e03('0x18')],{'as':'Extensions','onDelete':_0x2e03('0x11b'),'hooks':!![]});db[_0x2e03('0x13')][_0x2e03('0x11c')](db[_0x2e03('0x11e')],{'as':'HopperFinals','foreignKey':_0x2e03('0x119')});db['User'][_0x2e03('0x11c')](db[_0x2e03('0x7c')],{'as':_0x2e03('0x11f'),'foreignKey':_0x2e03('0x119')});db[_0x2e03('0x13')][_0x2e03('0x11c')](db['ReportAgentPreview'],{'as':_0x2e03('0x7d'),'foreignKey':_0x2e03('0x119')});db['User'][_0x2e03('0x11c')](db[_0x2e03('0x120')],{'as':'OpenchannelInteractions','foreignKey':_0x2e03('0x119')});db[_0x2e03('0x13')]['hasMany'](db[_0x2e03('0x121')],{'as':_0x2e03('0x122'),'foreignKey':_0x2e03('0x119')});db[_0x2e03('0x13')][_0x2e03('0x11c')](db[_0x2e03('0x5a')],{'as':_0x2e03('0x123'),'foreignKey':_0x2e03('0x119')});db[_0x2e03('0x13')]['hasMany'](db[_0x2e03('0x4f')],{'as':'FaxInteractions','foreignKey':_0x2e03('0x119')});db['User'][_0x2e03('0x11c')](db[_0x2e03('0x42')],{'as':_0x2e03('0x124'),'foreignKey':'UserId'});db['User'][_0x2e03('0x11c')](db[_0x2e03('0x125')],{'as':_0x2e03('0x126'),'foreignKey':_0x2e03('0x119')});db[_0x2e03('0x13')][_0x2e03('0x11c')](db[_0x2e03('0x127')],{'as':'UserNotifications','foreignKey':_0x2e03('0x128')});db['User'][_0x2e03('0x11c')](db['CmHopper'],{'as':_0x2e03('0x129'),'foreignKey':_0x2e03('0x119'),'onDelete':'SET\x20NULL'});db['User']['belongsTo'](db['UserProfile'],{'as':_0x2e03('0x12a'),'foreignKey':'userProfileId'});db[_0x2e03('0x13')][_0x2e03('0x12b')](db[_0x2e03('0x70')],{'as':'Groups','through':'chat_group_has_users'});db[_0x2e03('0x13')][_0x2e03('0x12b')](db[_0x2e03('0x76')],{'as':_0x2e03('0x12c'),'through':_0x2e03('0x12d')});db[_0x2e03('0x13')][_0x2e03('0x12b')](db[_0x2e03('0xfe')],{'as':_0x2e03('0x12e'),'through':_0x2e03('0x12f')});db[_0x2e03('0x13')][_0x2e03('0x12b')](db[_0x2e03('0xed')],{'through':'user_has_teams'});db[_0x2e03('0x13')][_0x2e03('0x12b')](db[_0x2e03('0x42')],{'as':_0x2e03('0x124'),'through':_0x2e03('0x130')});db['User']['belongsToMany'](db[_0x2e03('0x121')],{'as':_0x2e03('0x122'),'through':_0x2e03('0x131')});db['User'][_0x2e03('0x12b')](db[_0x2e03('0x4f')],{'as':_0x2e03('0x132'),'through':_0x2e03('0x133')});db[_0x2e03('0x13')][_0x2e03('0x12b')](db['SmsInteraction'],{'as':_0x2e03('0x123'),'through':_0x2e03('0x134')});db['User'][_0x2e03('0x12b')](db[_0x2e03('0x120')],{'as':'OpenchannelInteractions','through':_0x2e03('0x135')});db['User'][_0x2e03('0x12b')](db[_0x2e03('0x125')],{'as':_0x2e03('0x126'),'through':_0x2e03('0x136')});db[_0x2e03('0x13')][_0x2e03('0x12b')](db[_0x2e03('0x1b')],{'as':_0x2e03('0x137'),'through':_0x2e03('0x2f'),'required':![]});db[_0x2e03('0x13')][_0x2e03('0x12b')](db[_0x2e03('0xff')],{'as':_0x2e03('0x138'),'through':'UserVoicePrefix','required':![]});db[_0x2e03('0x13')][_0x2e03('0x12b')](db['MailQueue'],{'as':_0x2e03('0x139'),'through':_0x2e03('0x13a'),'required':![]});db['User']['belongsToMany'](db[_0x2e03('0x6e')],{'as':_0x2e03('0x13b'),'through':'UserChatQueue','required':![],'hooks':!![]});db[_0x2e03('0x13')][_0x2e03('0x12b')](db[_0x2e03('0x52')],{'as':'FaxQueues','through':_0x2e03('0x33'),'required':![]});db[_0x2e03('0x13')][_0x2e03('0x12b')](db[_0x2e03('0x13c')],{'as':'SmsQueues','through':_0x2e03('0x35'),'required':![]});db[_0x2e03('0x13')][_0x2e03('0x12b')](db[_0x2e03('0x63')],{'as':_0x2e03('0x13d'),'through':'UserOpenchannelQueue','required':![]});db[_0x2e03('0x13')][_0x2e03('0x12b')](db['WhatsappQueue'],{'as':_0x2e03('0x13e'),'through':_0x2e03('0x38'),'required':![]});db[_0x2e03('0x13')]['belongsToMany'](db[_0x2e03('0xfe')],{'through':_0x2e03('0x12f')});db[_0x2e03('0x13')][_0x2e03('0x12b')](db['ChatWebsite'],{'as':_0x2e03('0x13f'),'through':'user_has_chat_websites'});db['User']['belongsToMany'](db[_0x2e03('0x140')],{'as':_0x2e03('0x141'),'through':'user_has_fax_accounts'});db[_0x2e03('0x13')][_0x2e03('0x12b')](db['MailAccount'],{'as':_0x2e03('0x142'),'through':_0x2e03('0x143')});db[_0x2e03('0x13')]['belongsToMany'](db[_0x2e03('0x144')],{'as':_0x2e03('0x145'),'through':'user_has_openchannel_accounts'});db[_0x2e03('0x13')][_0x2e03('0x12b')](db[_0x2e03('0x56')],{'as':_0x2e03('0x146'),'through':_0x2e03('0x147')});db[_0x2e03('0x13')]['belongsToMany'](db[_0x2e03('0x107')],{'as':_0x2e03('0x148'),'through':_0x2e03('0x149')});db[_0x2e03('0x16')][_0x2e03('0x11c')](db[_0x2e03('0x18')],{'as':_0x2e03('0x14a'),'onDelete':_0x2e03('0x11b'),'foreignKey':_0x2e03('0x14b')});db['VoiceContext'][_0x2e03('0x11c')](db[_0x2e03('0x18')],{'onDelete':_0x2e03('0x11b')});db[_0x2e03('0x18')]['hasMany'](db[_0x2e03('0x18')],{'as':'Applications','onDelete':_0x2e03('0x11b')});db['VoiceMusicOnHold'][_0x2e03('0x12b')](db[_0x2e03('0x14c')],{'as':_0x2e03('0x14d'),'through':_0x2e03('0x14e')});db[_0x2e03('0x1b')][_0x2e03('0x11c')](db[_0x2e03('0x2e')],{'as':_0x2e03('0x14f'),'foreignKey':'VoiceQueueId'});db[_0x2e03('0x1b')][_0x2e03('0x11c')](db[_0x2e03('0x78')],{'as':_0x2e03('0x129'),'foreignKey':_0x2e03('0x150')});db[_0x2e03('0x1b')][_0x2e03('0x11c')](db[_0x2e03('0x11e')],{'as':'HopperFinals','foreignKey':_0x2e03('0x150')});db['VoiceQueue']['hasMany'](db[_0x2e03('0x7c')],{'as':_0x2e03('0x151'),'foreignKey':_0x2e03('0x150')});db['VoiceQueue'][_0x2e03('0x11c')](db[_0x2e03('0x7d')],{'as':_0x2e03('0x7d'),'foreignKey':_0x2e03('0x150')});db[_0x2e03('0x1b')][_0x2e03('0x11c')](db['CmHopperBlack'],{'as':_0x2e03('0x152'),'foreignKey':_0x2e03('0x150')});db['VoiceQueue'][_0x2e03('0x11c')](db[_0x2e03('0xdc')],{'as':'JscriptySessions','foreignKey':_0x2e03('0x150')});db['VoiceQueue'][_0x2e03('0x153')](db[_0x2e03('0x154')],{'as':_0x2e03('0x154'),'foreignKey':'TrunkId'});db[_0x2e03('0x1b')]['belongsTo'](db[_0x2e03('0x154')],{'as':'TrunkBackup','foreignKey':_0x2e03('0x155')});db[_0x2e03('0x1b')][_0x2e03('0x153')](db[_0x2e03('0x156')],{'as':'Interval','foreignKey':_0x2e03('0x157')});db[_0x2e03('0x1b')][_0x2e03('0x153')](db[_0x2e03('0x8b')],{'as':'mandatoryDispositionPause','foreignKey':_0x2e03('0x158')});db[_0x2e03('0x1b')][_0x2e03('0x12b')](db[_0x2e03('0xfe')],{'as':'Lists','through':_0x2e03('0x159')});db[_0x2e03('0x1b')]['belongsToMany'](db[_0x2e03('0x13')],{'as':_0x2e03('0x15a'),'through':'UserVoiceQueue'});db[_0x2e03('0x1b')][_0x2e03('0x12b')](db['Team'],{'as':_0x2e03('0x15b'),'through':_0x2e03('0x111')});db[_0x2e03('0x1b')]['belongsToMany'](db[_0x2e03('0xfe')],{'as':'BlackLists','through':_0x2e03('0x15c')});db[_0x2e03('0x1d')][_0x2e03('0x153')](db[_0x2e03('0x13')],{'as':'User','foreignKey':_0x2e03('0x119')});db[_0x2e03('0x1f')][_0x2e03('0x153')](db['User'],{'as':_0x2e03('0x13'),'foreignKey':'UserId'});db['VoiceMail']['hasMany'](db[_0x2e03('0x22')],{'as':_0x2e03('0x15d'),'onDelete':'cascade','foreignKey':_0x2e03('0x15e'),'sourceKey':_0x2e03('0x15f')});db[_0x2e03('0x22')]['belongsTo'](db[_0x2e03('0x118')],{'foreignKey':_0x2e03('0x15e'),'targetKey':_0x2e03('0x15f')});db[_0x2e03('0x24')][_0x2e03('0x11c')](db[_0x2e03('0x29')],{'as':_0x2e03('0x160'),'foreignKey':_0x2e03('0x161'),'constraints':![]});db[_0x2e03('0x24')][_0x2e03('0x11c')](db[_0x2e03('0x27')],{'as':'AgentReports','foreignKey':_0x2e03('0x161'),'constraints':![]});db[_0x2e03('0x24')][_0x2e03('0x153')](db[_0x2e03('0x13')],{'as':'User','foreignKey':_0x2e03('0x119')});db['VoiceCallReport'][_0x2e03('0x153')](db[_0x2e03('0x76')],{'as':_0x2e03('0x162'),'foreignKey':_0x2e03('0x163')});db[_0x2e03('0x3a')][_0x2e03('0x153')](db[_0x2e03('0x164')],{'as':_0x2e03('0x164'),'foreignKey':_0x2e03('0x165')});db['MailServerIn'][_0x2e03('0x153')](db[_0x2e03('0x10f')],{'as':_0x2e03('0x10f'),'foreignKey':_0x2e03('0x166'),'onDelete':_0x2e03('0x167')});db[_0x2e03('0x3b')][_0x2e03('0x153')](db[_0x2e03('0x164')],{'as':'MailAccount','foreignKey':_0x2e03('0x165')});db['MailServerOut']['belongsTo'](db['CloudProvider'],{'as':_0x2e03('0x10f'),'foreignKey':'CloudProviderId','onDelete':_0x2e03('0x167')});db[_0x2e03('0x164')][_0x2e03('0x117')](db['MailServerIn'],{'as':_0x2e03('0x168'),'onDelete':_0x2e03('0x11b')});db['MailAccount'][_0x2e03('0x117')](db[_0x2e03('0x3b')],{'as':_0x2e03('0x169'),'onDelete':'cascade'});db[_0x2e03('0x164')][_0x2e03('0x11c')](db['Disposition'],{'as':_0x2e03('0x16a'),'foreignKey':_0x2e03('0x165'),'onDelete':_0x2e03('0x11b')});db[_0x2e03('0x164')][_0x2e03('0x11c')](db[_0x2e03('0x85')],{'as':_0x2e03('0x16b'),'foreignKey':_0x2e03('0x165')});db[_0x2e03('0x164')]['hasMany'](db[_0x2e03('0x44')],{'as':_0x2e03('0x15d'),'foreignKey':'MailAccountId'});db[_0x2e03('0x164')][_0x2e03('0x11c')](db[_0x2e03('0x42')],{'as':_0x2e03('0x16c')});db['MailAccount'][_0x2e03('0x11c')](db[_0x2e03('0x46')],{'as':_0x2e03('0x16d'),'foreignKey':'MailAccountId','onDelete':_0x2e03('0x11b')});db[_0x2e03('0x164')][_0x2e03('0x153')](db['CmList'],{'as':_0x2e03('0x16e'),'foreignKey':_0x2e03('0x16f')});db[_0x2e03('0x164')]['belongsTo'](db['Template'],{'as':_0x2e03('0x170'),'foreignKey':_0x2e03('0x171')});db[_0x2e03('0x164')][_0x2e03('0x153')](db[_0x2e03('0x8b')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x2e03('0x164')][_0x2e03('0x12b')](db[_0x2e03('0x13')],{'as':'Agents','through':_0x2e03('0x143')});db[_0x2e03('0x3e')][_0x2e03('0x12b')](db[_0x2e03('0x13')],{'as':'Agents','through':_0x2e03('0x13a')});db[_0x2e03('0x3e')][_0x2e03('0x12b')](db[_0x2e03('0xed')],{'through':_0x2e03('0x172'),'as':'Teams'});db['MailInteraction'][_0x2e03('0x11c')](db[_0x2e03('0x44')],{'as':_0x2e03('0x15d'),'onDelete':_0x2e03('0x11b'),'foreignKey':_0x2e03('0x173')});db[_0x2e03('0x42')][_0x2e03('0x153')](db[_0x2e03('0x164')],{'as':_0x2e03('0x174'),'foreignKey':_0x2e03('0x165')});db[_0x2e03('0x42')][_0x2e03('0x153')](db[_0x2e03('0x76')],{'as':_0x2e03('0x162'),'foreignKey':_0x2e03('0x163')});db[_0x2e03('0x42')]['belongsTo'](db[_0x2e03('0x13')],{'as':_0x2e03('0x175'),'foreignKey':'UserId'});db['MailInteraction'][_0x2e03('0x12b')](db[_0x2e03('0x91')],{'through':_0x2e03('0x176'),'as':_0x2e03('0x177')});db[_0x2e03('0x42')]['belongsToMany'](db[_0x2e03('0x91')],{'through':_0x2e03('0x176'),'as':_0x2e03('0x178')});db[_0x2e03('0x42')]['belongsToMany'](db[_0x2e03('0x13')],{'as':_0x2e03('0x179'),'through':_0x2e03('0x130'),'foreignKey':_0x2e03('0x173')});db[_0x2e03('0x44')]['hasMany'](db[_0x2e03('0xf5')],{'as':_0x2e03('0x17a'),'onDelete':_0x2e03('0x11b')});db[_0x2e03('0x44')]['belongsTo'](db[_0x2e03('0x13')],{'as':_0x2e03('0x13')});db['MailMessage'][_0x2e03('0x153')](db[_0x2e03('0x76')],{'onDelete':_0x2e03('0x11b'),'as':_0x2e03('0x162')});db[_0x2e03('0x44')]['belongsTo'](db[_0x2e03('0x42')],{'as':_0x2e03('0x17b'),'foreignKey':_0x2e03('0x173')});db[_0x2e03('0x44')][_0x2e03('0x153')](db[_0x2e03('0x164')],{'as':_0x2e03('0x174'),'foreignKey':_0x2e03('0x165')});db[_0x2e03('0x44')][_0x2e03('0x153')](db[_0x2e03('0x65')],{'as':_0x2e03('0x65'),'foreignKey':_0x2e03('0x17c')});db[_0x2e03('0x44')][_0x2e03('0x153')](db[_0x2e03('0x17d')],{'as':_0x2e03('0x17d'),'foreignKey':'ChatOfflineMessageId'});db[_0x2e03('0x46')]['belongsTo'](db[_0x2e03('0x13')],{'onDelete':_0x2e03('0x167')});db['MailApplication'][_0x2e03('0x153')](db[_0x2e03('0x3e')],{'onDelete':_0x2e03('0x167')});db[_0x2e03('0x46')][_0x2e03('0x153')](db[_0x2e03('0x164')],{'onDelete':_0x2e03('0x167')});db[_0x2e03('0x46')]['belongsTo'](db[_0x2e03('0x156')],{'onDelete':_0x2e03('0x167'),'foreignKey':_0x2e03('0x157')});db['MailApplication'][_0x2e03('0x153')](db['Tag'],{'onDelete':_0x2e03('0x167'),'foreignKey':_0x2e03('0x17e')});db[_0x2e03('0x17f')]['belongsTo'](db[_0x2e03('0x164')],{});db[_0x2e03('0x17f')][_0x2e03('0x153')](db[_0x2e03('0xfe')],{'as':'List','foreignKey':_0x2e03('0x16f')});db[_0x2e03('0x17f')][_0x2e03('0x153')](db[_0x2e03('0x76')],{'as':'Contact','foreignKey':_0x2e03('0x163')});db[_0x2e03('0x17f')][_0x2e03('0x153')](db['MailInteraction'],{});db[_0x2e03('0x17f')]['belongsTo'](db[_0x2e03('0x44')],{});db[_0x2e03('0x17f')][_0x2e03('0x153')](db[_0x2e03('0x13')],{});db[_0x2e03('0x17f')][_0x2e03('0x153')](db['MailQueue'],{});db[_0x2e03('0x49')][_0x2e03('0x11c')](db[_0x2e03('0x4b')],{'as':_0x2e03('0x180'),'onDelete':_0x2e03('0x11b')});db[_0x2e03('0x140')][_0x2e03('0x11c')](db['Disposition'],{'as':_0x2e03('0x16a'),'foreignKey':_0x2e03('0x181'),'onDelete':'cascade'});db['FaxAccount'][_0x2e03('0x11c')](db[_0x2e03('0x85')],{'as':_0x2e03('0x16b'),'foreignKey':_0x2e03('0x181')});db['FaxAccount'][_0x2e03('0x11c')](db[_0x2e03('0x4f')],{'as':'Interactions'});db[_0x2e03('0x140')][_0x2e03('0x11c')](db[_0x2e03('0x4e')],{'as':'Applications','foreignKey':'FaxAccountId','onDelete':_0x2e03('0x11b')});db[_0x2e03('0x140')][_0x2e03('0x11c')](db[_0x2e03('0x18')],{'as':_0x2e03('0x182'),'onDelete':_0x2e03('0x11b')});db[_0x2e03('0x140')][_0x2e03('0x11c')](db['FaxMessage'],{'as':_0x2e03('0x15d')});db['FaxAccount']['belongsTo'](db[_0x2e03('0x154')],{'as':_0x2e03('0x154')});db['FaxAccount'][_0x2e03('0x153')](db[_0x2e03('0xfe')],{'as':_0x2e03('0x16e'),'foreignKey':_0x2e03('0x16f')});db[_0x2e03('0x140')][_0x2e03('0x153')](db[_0x2e03('0x8b')],{'as':_0x2e03('0x183'),'foreignKey':_0x2e03('0x158')});db[_0x2e03('0x140')][_0x2e03('0x12b')](db[_0x2e03('0x13')],{'as':_0x2e03('0x15a'),'through':_0x2e03('0x184')});db[_0x2e03('0x4e')][_0x2e03('0x153')](db[_0x2e03('0x13')],{'onDelete':_0x2e03('0x167')});db['FaxApplication']['belongsTo'](db[_0x2e03('0x52')],{'onDelete':_0x2e03('0x167')});db['FaxApplication'][_0x2e03('0x153')](db[_0x2e03('0x140')],{'onDelete':_0x2e03('0x167')});db[_0x2e03('0x4e')][_0x2e03('0x153')](db[_0x2e03('0x91')],{'onDelete':_0x2e03('0x167'),'foreignKey':'TagId'});db[_0x2e03('0x4f')][_0x2e03('0x11c')](db[_0x2e03('0x185')],{'as':_0x2e03('0x15d'),'onDelete':_0x2e03('0x11b'),'foreignKey':_0x2e03('0x186')});db['FaxInteraction']['belongsTo'](db[_0x2e03('0x140')],{'as':_0x2e03('0x174'),'foreignKey':_0x2e03('0x181')});db['FaxInteraction'][_0x2e03('0x153')](db[_0x2e03('0x76')],{'as':_0x2e03('0x162'),'foreignKey':_0x2e03('0x163')});db[_0x2e03('0x4f')][_0x2e03('0x153')](db['User'],{'as':'Owner','foreignKey':_0x2e03('0x119')});db[_0x2e03('0x4f')][_0x2e03('0x12b')](db[_0x2e03('0x91')],{'through':_0x2e03('0x187'),'as':_0x2e03('0x177')});db[_0x2e03('0x4f')][_0x2e03('0x12b')](db[_0x2e03('0x91')],{'through':_0x2e03('0x187'),'as':'ThroughTags'});db[_0x2e03('0x4f')][_0x2e03('0x12b')](db[_0x2e03('0x13')],{'as':_0x2e03('0x179'),'through':_0x2e03('0x133'),'foreignKey':_0x2e03('0x186')});db[_0x2e03('0x185')][_0x2e03('0x153')](db[_0x2e03('0x13')],{'onDelete':_0x2e03('0x11b'),'as':_0x2e03('0x13')});db[_0x2e03('0x185')][_0x2e03('0x153')](db[_0x2e03('0x4f')],{'as':_0x2e03('0x17b'),'foreignKey':'FaxInteractionId'});db[_0x2e03('0x185')][_0x2e03('0x153')](db[_0x2e03('0x76')],{'onDelete':_0x2e03('0x11b'),'as':_0x2e03('0x162')});db[_0x2e03('0x185')]['belongsTo'](db['Attachment'],{'as':_0x2e03('0xf5'),'foreignKey':_0x2e03('0x188')});db[_0x2e03('0x185')][_0x2e03('0x153')](db[_0x2e03('0x140')],{'as':_0x2e03('0x174'),'foreignKey':_0x2e03('0x181')});db[_0x2e03('0x52')][_0x2e03('0x12b')](db[_0x2e03('0x13')],{'as':_0x2e03('0x15a'),'through':_0x2e03('0x33')});db[_0x2e03('0x52')][_0x2e03('0x12b')](db[_0x2e03('0xed')],{'through':_0x2e03('0x189'),'as':_0x2e03('0x15b')});db[_0x2e03('0x54')][_0x2e03('0x153')](db[_0x2e03('0x140')],{});db[_0x2e03('0x54')][_0x2e03('0x153')](db[_0x2e03('0xfe')],{'as':_0x2e03('0x16e'),'foreignKey':_0x2e03('0x16f')});db[_0x2e03('0x54')][_0x2e03('0x153')](db[_0x2e03('0x76')],{'as':_0x2e03('0x162'),'foreignKey':_0x2e03('0x163')});db[_0x2e03('0x54')][_0x2e03('0x153')](db['FaxInteraction'],{});db[_0x2e03('0x54')][_0x2e03('0x153')](db[_0x2e03('0x185')],{});db[_0x2e03('0x54')][_0x2e03('0x153')](db[_0x2e03('0x13')],{});db['FaxQueueReport'][_0x2e03('0x153')](db[_0x2e03('0x52')],{});db[_0x2e03('0x56')][_0x2e03('0x11c')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x2e03('0x18a'),'onDelete':_0x2e03('0x11b')});db[_0x2e03('0x56')][_0x2e03('0x11c')](db['CannedAnswer'],{'as':_0x2e03('0x16b'),'foreignKey':'SmsAccountId'});db[_0x2e03('0x56')][_0x2e03('0x11c')](db[_0x2e03('0x5c')],{'as':_0x2e03('0x15d'),'foreignKey':_0x2e03('0x18a')});db[_0x2e03('0x56')][_0x2e03('0x11c')](db[_0x2e03('0x5a')],{'as':'Interactions'});db[_0x2e03('0x56')][_0x2e03('0x11c')](db[_0x2e03('0x58')],{'as':'Applications','foreignKey':_0x2e03('0x18a'),'onDelete':_0x2e03('0x11b')});db[_0x2e03('0x56')][_0x2e03('0x153')](db['CmList'],{'as':_0x2e03('0x16e'),'foreignKey':_0x2e03('0x16f')});db['SmsAccount']['belongsTo'](db[_0x2e03('0x8b')],{'as':'mandatoryDispositionPause','foreignKey':_0x2e03('0x158')});db['SmsAccount'][_0x2e03('0x12b')](db[_0x2e03('0x13')],{'as':_0x2e03('0x15a'),'through':_0x2e03('0x147')});db['SmsApplication']['belongsTo'](db[_0x2e03('0x13')],{'onDelete':_0x2e03('0x167')});db[_0x2e03('0x58')][_0x2e03('0x153')](db[_0x2e03('0x13c')],{'onDelete':_0x2e03('0x167')});db['SmsApplication']['belongsTo'](db[_0x2e03('0x56')],{'onDelete':_0x2e03('0x167')});db[_0x2e03('0x58')][_0x2e03('0x153')](db['Interval'],{'onDelete':_0x2e03('0x167'),'foreignKey':_0x2e03('0x157')});db[_0x2e03('0x58')][_0x2e03('0x153')](db[_0x2e03('0x91')],{'onDelete':_0x2e03('0x167'),'foreignKey':_0x2e03('0x17e')});db[_0x2e03('0x5a')][_0x2e03('0x11c')](db['SmsMessage'],{'as':_0x2e03('0x15d'),'onDelete':'cascade','foreignKey':_0x2e03('0x18b')});db['SmsInteraction'][_0x2e03('0x153')](db[_0x2e03('0x56')],{'as':_0x2e03('0x174'),'foreignKey':'SmsAccountId'});db[_0x2e03('0x5a')]['belongsTo'](db['CmContact'],{'as':_0x2e03('0x162'),'foreignKey':_0x2e03('0x163')});db[_0x2e03('0x5a')][_0x2e03('0x153')](db[_0x2e03('0x13')],{'as':_0x2e03('0x175'),'foreignKey':'UserId'});db[_0x2e03('0x5a')][_0x2e03('0x12b')](db[_0x2e03('0x91')],{'through':_0x2e03('0x18c'),'as':_0x2e03('0x177')});db['SmsInteraction'][_0x2e03('0x12b')](db[_0x2e03('0x91')],{'through':_0x2e03('0x18c'),'as':'ThroughTags'});db[_0x2e03('0x5a')][_0x2e03('0x12b')](db[_0x2e03('0x13')],{'as':_0x2e03('0x179'),'through':_0x2e03('0x134'),'foreignKey':_0x2e03('0x18b')});db[_0x2e03('0x5c')][_0x2e03('0x153')](db[_0x2e03('0x13')],{'as':_0x2e03('0x13')});db['SmsMessage'][_0x2e03('0x153')](db[_0x2e03('0x76')],{'onDelete':_0x2e03('0x11b'),'as':_0x2e03('0x162')});db[_0x2e03('0x5c')][_0x2e03('0x153')](db[_0x2e03('0x5a')],{'onDelete':_0x2e03('0x11b'),'as':'Interaction','foreignKey':_0x2e03('0x18b')});db[_0x2e03('0x5c')][_0x2e03('0x153')](db['SmsAccount'],{'as':_0x2e03('0x174'),'foreignKey':_0x2e03('0x18a')});db[_0x2e03('0x13c')][_0x2e03('0x12b')](db[_0x2e03('0x13')],{'as':'Agents','through':_0x2e03('0x35'),'foreignKey':_0x2e03('0x18d')});db[_0x2e03('0x13c')][_0x2e03('0x12b')](db[_0x2e03('0xed')],{'through':_0x2e03('0x18e'),'as':_0x2e03('0x15b')});db[_0x2e03('0x144')][_0x2e03('0x11c')](db['Disposition'],{'as':_0x2e03('0x16a'),'foreignKey':_0x2e03('0x18f'),'onDelete':_0x2e03('0x11b')});db['OpenchannelAccount'][_0x2e03('0x11c')](db[_0x2e03('0x85')],{'as':_0x2e03('0x16b'),'foreignKey':_0x2e03('0x18f')});db['OpenchannelAccount'][_0x2e03('0x11c')](db[_0x2e03('0x120')],{'as':_0x2e03('0x16c'),'foreignKey':_0x2e03('0x18f')});db[_0x2e03('0x144')][_0x2e03('0x11c')](db[_0x2e03('0x62')],{'as':_0x2e03('0x15d'),'foreignKey':_0x2e03('0x18f')});db['OpenchannelAccount'][_0x2e03('0x11c')](db[_0x2e03('0x5f')],{'as':_0x2e03('0x16d'),'foreignKey':_0x2e03('0x18f'),'onDelete':_0x2e03('0x11b')});db[_0x2e03('0x144')]['belongsTo'](db[_0x2e03('0xfe')],{'as':'List','foreignKey':_0x2e03('0x16f')});db[_0x2e03('0x144')]['belongsTo'](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x2e03('0x158')});db['OpenchannelAccount']['belongsToMany'](db[_0x2e03('0x13')],{'as':_0x2e03('0x15a'),'through':_0x2e03('0x190')});db['OpenchannelApplication'][_0x2e03('0x153')](db[_0x2e03('0x13')],{'onDelete':_0x2e03('0x167')});db['OpenchannelApplication'][_0x2e03('0x153')](db['OpenchannelQueue'],{'onDelete':_0x2e03('0x167'),'foreignKey':_0x2e03('0x191')});db[_0x2e03('0x5f')][_0x2e03('0x153')](db[_0x2e03('0x144')],{'onDelete':'restrict','foreignKey':_0x2e03('0x18f')});db['OpenchannelApplication']['belongsTo'](db[_0x2e03('0x156')],{'onDelete':_0x2e03('0x167'),'foreignKey':_0x2e03('0x157')});db['OpenchannelApplication'][_0x2e03('0x153')](db[_0x2e03('0x91')],{'onDelete':_0x2e03('0x167'),'foreignKey':_0x2e03('0x17e')});db[_0x2e03('0x120')][_0x2e03('0x11c')](db[_0x2e03('0x62')],{'as':_0x2e03('0x15d'),'onDelete':_0x2e03('0x11b'),'foreignKey':_0x2e03('0x192')});db['OpenchannelInteraction']['belongsTo'](db['OpenchannelAccount'],{'as':'Account','foreignKey':'OpenchannelAccountId'});db['OpenchannelInteraction'][_0x2e03('0x153')](db[_0x2e03('0x76')],{'as':'Contact','foreignKey':'ContactId'});db[_0x2e03('0x120')][_0x2e03('0x153')](db[_0x2e03('0x13')],{'as':_0x2e03('0x175'),'foreignKey':_0x2e03('0x119')});db['OpenchannelInteraction'][_0x2e03('0x12b')](db[_0x2e03('0x91')],{'through':_0x2e03('0x193'),'as':_0x2e03('0x177')});db[_0x2e03('0x120')][_0x2e03('0x12b')](db[_0x2e03('0x91')],{'through':_0x2e03('0x193'),'as':_0x2e03('0x178')});db[_0x2e03('0x120')][_0x2e03('0x12b')](db[_0x2e03('0x13')],{'as':_0x2e03('0x179'),'through':_0x2e03('0x135'),'foreignKey':'OpenchannelInteractionId'});db['OpenchannelMessage'][_0x2e03('0x153')](db[_0x2e03('0x13')],{'onDelete':'cascade','as':_0x2e03('0x13')});db['OpenchannelMessage'][_0x2e03('0x153')](db[_0x2e03('0x76')],{'onDelete':'cascade','as':_0x2e03('0x162')});db[_0x2e03('0x62')]['belongsTo'](db[_0x2e03('0x120')],{'onDelete':_0x2e03('0x11b'),'as':'Interaction','foreignKey':_0x2e03('0x192')});db[_0x2e03('0x62')]['belongsTo'](db['Attachment'],{'as':_0x2e03('0xf5'),'foreignKey':_0x2e03('0x188')});db[_0x2e03('0x62')]['belongsTo'](db[_0x2e03('0x144')],{'as':_0x2e03('0x174'),'foreignKey':_0x2e03('0x18f')});db['OpenchannelQueue'][_0x2e03('0x12b')](db[_0x2e03('0x13')],{'as':_0x2e03('0x15a'),'through':_0x2e03('0x36'),'foreignKey':_0x2e03('0x191')});db['OpenchannelQueue'][_0x2e03('0x12b')](db[_0x2e03('0xed')],{'through':_0x2e03('0x194'),'as':_0x2e03('0x15b')});db[_0x2e03('0x65')][_0x2e03('0x11c')](db[_0x2e03('0x87')],{'as':'Dispositions','foreignKey':_0x2e03('0x17c'),'onDelete':_0x2e03('0x11b')});db[_0x2e03('0x65')][_0x2e03('0x11c')](db['CannedAnswer'],{'as':_0x2e03('0x16b'),'foreignKey':_0x2e03('0x17c')});db[_0x2e03('0x65')][_0x2e03('0x11c')](db['ChatProactiveAction'],{'as':_0x2e03('0x195')});db[_0x2e03('0x65')][_0x2e03('0x11c')](db['ChatInteraction'],{'as':_0x2e03('0x16c')});db[_0x2e03('0x65')]['hasMany'](db['ChatApplication'],{'as':_0x2e03('0x16d'),'foreignKey':_0x2e03('0x17c'),'onDelete':_0x2e03('0x11b')});db[_0x2e03('0x65')][_0x2e03('0x11c')](db['ChatMessage'],{'as':_0x2e03('0x15d')});db['ChatWebsite'][_0x2e03('0x153')](db[_0x2e03('0xfe')],{'as':_0x2e03('0x16e'),'foreignKey':_0x2e03('0x16f')});db['ChatWebsite'][_0x2e03('0x153')](db['Interval'],{'as':'Interval','foreignKey':_0x2e03('0x157')});db[_0x2e03('0x65')][_0x2e03('0x153')](db[_0x2e03('0x164')],{'as':_0x2e03('0x164'),'foreignKey':_0x2e03('0x165')});db[_0x2e03('0x65')][_0x2e03('0x153')](db[_0x2e03('0x8b')],{'as':'mandatoryDispositionPause','foreignKey':_0x2e03('0x158')});db[_0x2e03('0x65')]['belongsToMany'](db[_0x2e03('0x13')],{'as':_0x2e03('0x15a'),'through':'user_has_chat_websites'});db[_0x2e03('0x67')][_0x2e03('0x153')](db[_0x2e03('0x144')],{});db[_0x2e03('0x67')][_0x2e03('0x153')](db[_0x2e03('0xfe')],{'as':_0x2e03('0x16e'),'foreignKey':'ListId'});db['OpenchannelQueueReport']['belongsTo'](db[_0x2e03('0x76')],{'as':_0x2e03('0x162'),'foreignKey':_0x2e03('0x163')});db[_0x2e03('0x67')][_0x2e03('0x153')](db['OpenchannelInteraction'],{});db['OpenchannelQueueReport']['belongsTo'](db[_0x2e03('0x62')],{});db[_0x2e03('0x67')]['belongsTo'](db[_0x2e03('0x13')],{});db[_0x2e03('0x67')][_0x2e03('0x153')](db['OpenchannelQueue'],{});db['ChatApplication']['belongsTo'](db[_0x2e03('0x13')],{'as':_0x2e03('0x196'),'foreignKey':_0x2e03('0x119'),'onDelete':_0x2e03('0x167')});db[_0x2e03('0x69')][_0x2e03('0x153')](db[_0x2e03('0x6e')],{'as':_0x2e03('0x197'),'foreignKey':'ChatQueueId','onDelete':_0x2e03('0x167')});db['ChatApplication'][_0x2e03('0x153')](db[_0x2e03('0x65')],{'as':_0x2e03('0x198'),'foreignKey':_0x2e03('0x17c'),'onDelete':_0x2e03('0x167')});db[_0x2e03('0x69')][_0x2e03('0x153')](db[_0x2e03('0x91')],{'onDelete':_0x2e03('0x167'),'foreignKey':_0x2e03('0x17e')});db[_0x2e03('0x121')][_0x2e03('0x11c')](db['ChatMessage'],{'as':_0x2e03('0x15d'),'onDelete':_0x2e03('0x11b'),'foreignKey':_0x2e03('0x199')});db[_0x2e03('0x121')][_0x2e03('0x153')](db[_0x2e03('0x65')],{'as':_0x2e03('0x174'),'foreignKey':_0x2e03('0x17c')});db[_0x2e03('0x121')][_0x2e03('0x153')](db[_0x2e03('0x76')],{'as':_0x2e03('0x162'),'foreignKey':_0x2e03('0x163')});db['ChatInteraction']['belongsTo'](db['User'],{'as':_0x2e03('0x175'),'foreignKey':_0x2e03('0x119')});db[_0x2e03('0x121')][_0x2e03('0x12b')](db[_0x2e03('0x91')],{'through':_0x2e03('0x19a'),'as':_0x2e03('0x177')});db[_0x2e03('0x121')][_0x2e03('0x12b')](db[_0x2e03('0x91')],{'through':_0x2e03('0x19a'),'as':_0x2e03('0x178')});db[_0x2e03('0x121')][_0x2e03('0x12b')](db[_0x2e03('0x13')],{'as':_0x2e03('0x179'),'through':_0x2e03('0x131'),'foreignKey':_0x2e03('0x199')});db[_0x2e03('0x6b')]['belongsTo'](db[_0x2e03('0x13')],{'onDelete':_0x2e03('0x11b'),'as':'User'});db[_0x2e03('0x6b')][_0x2e03('0x153')](db['CmContact'],{'onDelete':_0x2e03('0x11b'),'as':'Contact','foreignKey':'ContactId'});db['ChatMessage'][_0x2e03('0x153')](db[_0x2e03('0x121')],{'onDelete':_0x2e03('0x11b'),'as':'Interaction','foreignKey':_0x2e03('0x199')});db[_0x2e03('0x6b')][_0x2e03('0x153')](db['Attachment'],{'as':_0x2e03('0xf5'),'foreignKey':_0x2e03('0x188')});db[_0x2e03('0x6b')]['belongsTo'](db['ChatWebsite'],{'as':_0x2e03('0x174'),'foreignKey':_0x2e03('0x17c')});db[_0x2e03('0x17d')]['hasMany'](db[_0x2e03('0xf5')],{'as':'Attachments','foreignKey':_0x2e03('0x19b'),'onDelete':_0x2e03('0x11b'),'hooks':!![]});db[_0x2e03('0x17d')]['belongsTo'](db[_0x2e03('0x76')],{'onDelete':_0x2e03('0x11b'),'as':_0x2e03('0x162'),'foreignKey':'ContactId'});db[_0x2e03('0x17d')][_0x2e03('0x153')](db['ChatWebsite'],{'as':'Account','foreignKey':_0x2e03('0x17c')});db[_0x2e03('0x6e')][_0x2e03('0x12b')](db[_0x2e03('0x13')],{'as':_0x2e03('0x15a'),'through':_0x2e03('0x31'),'hooks':!![]});db[_0x2e03('0x6e')]['belongsToMany'](db[_0x2e03('0xed')],{'through':_0x2e03('0x19c'),'as':_0x2e03('0x15b')});db[_0x2e03('0x70')][_0x2e03('0x11c')](db['ChatInternalMessage'],{'as':_0x2e03('0x15d'),'foreignKey':_0x2e03('0x19d'),'onDelete':_0x2e03('0x11b')});db[_0x2e03('0x70')][_0x2e03('0x12b')](db[_0x2e03('0x13')],{'as':_0x2e03('0x14f'),'through':_0x2e03('0x19e')});db['ChatProactiveAction']['belongsTo'](db[_0x2e03('0x65')],{'as':'Website','foreignKey':'ChatWebsiteId'});db['CmCompany'][_0x2e03('0x11c')](db[_0x2e03('0x76')],{'as':_0x2e03('0x12c'),'foreignKey':_0x2e03('0x19f')});db[_0x2e03('0x76')][_0x2e03('0x11c')](db[_0x2e03('0x95')],{'as':_0x2e03('0x1a0'),'foreignKey':_0x2e03('0x1a1')});db[_0x2e03('0x76')][_0x2e03('0x11c')](db['CmHopper'],{'as':_0x2e03('0x129'),'foreignKey':_0x2e03('0x163')});db[_0x2e03('0x76')][_0x2e03('0x11c')](db['CmHopperFinal'],{'as':_0x2e03('0x1a2'),'foreignKey':_0x2e03('0x163')});db[_0x2e03('0x76')][_0x2e03('0x11c')](db['CmHopperHistory'],{'as':_0x2e03('0x151'),'foreignKey':_0x2e03('0x163')});db[_0x2e03('0x76')]['hasMany'](db[_0x2e03('0x7d')],{'as':'ReportAgentPreview','foreignKey':_0x2e03('0x163')});db[_0x2e03('0x76')][_0x2e03('0x11c')](db[_0x2e03('0xdc')],{'as':_0x2e03('0x1a3'),'foreignKey':'ContactId'});db[_0x2e03('0x76')]['hasMany'](db[_0x2e03('0x120')],{'as':'OpenchannelInteractions','foreignKey':_0x2e03('0x163'),'onDelete':_0x2e03('0x167')});db[_0x2e03('0x76')][_0x2e03('0x11c')](db[_0x2e03('0x121')],{'as':_0x2e03('0x122'),'foreignKey':_0x2e03('0x163'),'onDelete':_0x2e03('0x167')});db['CmContact'][_0x2e03('0x11c')](db[_0x2e03('0x5a')],{'as':_0x2e03('0x123'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0x2e03('0x76')][_0x2e03('0x11c')](db[_0x2e03('0x4f')],{'as':_0x2e03('0x132'),'foreignKey':_0x2e03('0x163'),'onDelete':_0x2e03('0x167')});db[_0x2e03('0x76')][_0x2e03('0x11c')](db['MailInteraction'],{'as':'MailInteractions','foreignKey':'ContactId','onDelete':'restrict'});db[_0x2e03('0x76')][_0x2e03('0x153')](db[_0x2e03('0x74')],{'as':_0x2e03('0x1a4'),'foreignKey':'CompanyId'});db[_0x2e03('0x76')]['belongsTo'](db['CmList'],{'as':_0x2e03('0x16e'),'foreignKey':_0x2e03('0x16f'),'onDelete':_0x2e03('0x11b')});db[_0x2e03('0x76')][_0x2e03('0x12b')](db[_0x2e03('0x13')],{'as':'Users','through':_0x2e03('0x12d')});db['CmContact']['belongsToMany'](db[_0x2e03('0x91')],{'as':_0x2e03('0x177'),'through':'cm_contact_has_tags'});db['CmContact'][_0x2e03('0x12b')](db[_0x2e03('0x91')],{'through':_0x2e03('0x1a5'),'as':_0x2e03('0x178')});db[_0x2e03('0x78')]['hasMany'](db[_0x2e03('0x1a6')],{'as':_0x2e03('0x1a7'),'foreignKey':'CmHopperId'});db['CmHopper'][_0x2e03('0x153')](db[_0x2e03('0x76')],{'as':'Contact','foreignKey':_0x2e03('0x163'),'onDelete':_0x2e03('0x11b')});db[_0x2e03('0x78')][_0x2e03('0x153')](db[_0x2e03('0xfe')],{'as':_0x2e03('0x16e'),'foreignKey':_0x2e03('0x16f'),'onDelete':'cascade'});db[_0x2e03('0x78')][_0x2e03('0x153')](db['User'],{'as':_0x2e03('0x196'),'foreignKey':_0x2e03('0x119')});db[_0x2e03('0x78')][_0x2e03('0x153')](db[_0x2e03('0x1b')],{'as':_0x2e03('0x197'),'foreignKey':_0x2e03('0x150'),'onDelete':_0x2e03('0x11b')});db[_0x2e03('0x78')][_0x2e03('0x153')](db[_0x2e03('0xf1')],{'as':_0x2e03('0xf1'),'foreignKey':'CampaignId','onDelete':_0x2e03('0x11b')});db[_0x2e03('0x78')][_0x2e03('0x153')](db[_0x2e03('0x13')],{'as':_0x2e03('0x175'),'foreignKey':_0x2e03('0x1a8')});db['CmHopperBlack'][_0x2e03('0x153')](db[_0x2e03('0x76')],{'as':'Contact','foreignKey':_0x2e03('0x163'),'onDelete':_0x2e03('0x11b')});db[_0x2e03('0x79')]['belongsTo'](db[_0x2e03('0xfe')],{'as':'List','foreignKey':_0x2e03('0x16f'),'onDelete':_0x2e03('0x11b')});db['CmHopperBlack']['belongsTo'](db[_0x2e03('0x1b')],{'as':'Queue','foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x2e03('0x79')][_0x2e03('0x153')](db['Campaign'],{'as':_0x2e03('0xf1'),'foreignKey':_0x2e03('0x1a9'),'onDelete':_0x2e03('0x11b')});db[_0x2e03('0x83')][_0x2e03('0x11c')](db[_0x2e03('0x89')],{'as':{'plural':_0x2e03('0x1aa'),'singular':'OneAll'},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x2e03('0x83')][_0x2e03('0x11c')](db[_0x2e03('0x89')],{'as':{'plural':_0x2e03('0x1ab'),'singular':_0x2e03('0x1ac')},'foreignKey':_0x2e03('0x1ad'),'onDelete':_0x2e03('0x11b'),'hooks':!![]});db[_0x2e03('0x83')][_0x2e03('0x11c')](db[_0x2e03('0x81')],{'as':_0x2e03('0x1ae'),'foreignKey':_0x2e03('0x1af'),'onDelete':_0x2e03('0x11b'),'hooks':!![]});db[_0x2e03('0x87')][_0x2e03('0x11c')](db[_0x2e03('0x87')],{'as':'Dispositions','foreignKey':_0x2e03('0x1b0'),'onDelete':_0x2e03('0x11b')});db[_0x2e03('0x156')][_0x2e03('0x11c')](db['Interval'],{'as':_0x2e03('0x1b1'),'foreignKey':_0x2e03('0x157'),'onDelete':_0x2e03('0x11b'),'hooks':!![],'required':![]});db[_0x2e03('0x156')][_0x2e03('0x11c')](db['VoiceExtension'],{'as':_0x2e03('0x1b2'),'foreignKey':_0x2e03('0x157'),'onDelete':'restrict'});db[_0x2e03('0x156')][_0x2e03('0x11c')](db[_0x2e03('0x46')],{'as':_0x2e03('0x1b3'),'foreignKey':_0x2e03('0x157')});db[_0x2e03('0x156')][_0x2e03('0x11c')](db[_0x2e03('0x69')],{'as':_0x2e03('0x1b4'),'foreignKey':_0x2e03('0x157')});db['Interval'][_0x2e03('0x11c')](db[_0x2e03('0x4e')],{'as':_0x2e03('0x1b5'),'foreignKey':'IntervalId'});db[_0x2e03('0x156')][_0x2e03('0x11c')](db['SmsApplication'],{'as':_0x2e03('0x1b6'),'foreignKey':_0x2e03('0x157')});db['Schedule'][_0x2e03('0x153')](db[_0x2e03('0x164')],{});db[_0x2e03('0x1b7')][_0x2e03('0x153')](db[_0x2e03('0x1b8')],{'foreignKey':_0x2e03('0x1b9')});db[_0x2e03('0x1b7')][_0x2e03('0x153')](db[_0x2e03('0x9f')],{'foreignKey':'CustomReportId'});db[_0x2e03('0x14c')]['belongsToMany'](db[_0x2e03('0x19')],{'as':_0x2e03('0x1ba'),'through':_0x2e03('0x14e'),'onDelete':_0x2e03('0x167')});db[_0x2e03('0x91')][_0x2e03('0x12b')](db['CmContact'],{'through':'cm_contact_has_tags'});db[_0x2e03('0x91')]['belongsToMany'](db['ChatInteraction'],{'through':_0x2e03('0x19a')});db[_0x2e03('0x91')][_0x2e03('0x12b')](db[_0x2e03('0x42')],{'through':_0x2e03('0x176')});db[_0x2e03('0x91')][_0x2e03('0x12b')](db[_0x2e03('0x5a')],{'through':_0x2e03('0x18c')});db[_0x2e03('0x91')]['belongsToMany'](db['FaxInteraction'],{'through':_0x2e03('0x187')});db['Tag']['belongsToMany'](db['OpenchannelInteraction'],{'through':_0x2e03('0x193')});db[_0x2e03('0x91')][_0x2e03('0x12b')](db[_0x2e03('0x125')],{'through':_0x2e03('0x1bb')});db['CmContactHasItem']['belongsTo'](db[_0x2e03('0x93')],{'as':_0x2e03('0x1bc'),'foreignKey':_0x2e03('0x1bd')});db[_0x2e03('0x1a6')][_0x2e03('0x153')](db[_0x2e03('0x78')],{'as':'Hopper','foreignKey':_0x2e03('0x1be')});db[_0x2e03('0x95')][_0x2e03('0x153')](db[_0x2e03('0x76')],{'as':'Contact','foreignKey':_0x2e03('0x1a1')});db[_0x2e03('0x98')][_0x2e03('0x11c')](db['Condition'],{'as':{'plural':_0x2e03('0x1bf'),'singular':_0x2e03('0x1c0')},'foreignKey':_0x2e03('0x1c1'),'onDelete':'cascade','hooks':!![]});db['Trigger'][_0x2e03('0x11c')](db[_0x2e03('0x89')],{'as':{'plural':'AnyConditions','singular':_0x2e03('0x1c2')},'foreignKey':'TriggerAnyId','onDelete':_0x2e03('0x11b'),'hooks':!![]});db[_0x2e03('0x98')][_0x2e03('0x11c')](db[_0x2e03('0x81')],{'as':_0x2e03('0x1ae'),'foreignKey':_0x2e03('0x1c3'),'onDelete':_0x2e03('0x11b'),'hooks':!![]});db[_0x2e03('0x9f')][_0x2e03('0x11c')](db['AnalyticFieldReport'],{'as':_0x2e03('0x1c4'),'onDelete':_0x2e03('0x11b'),'foreignKey':_0x2e03('0x1c5'),'hooks':!![]});db[_0x2e03('0x1b8')][_0x2e03('0x11c')](db['AnalyticFieldReport'],{'as':_0x2e03('0x1c4'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x2e03('0xa3')][_0x2e03('0x11c')](db['AnalyticFieldReport'],{'as':_0x2e03('0x1c4'),'onDelete':_0x2e03('0x11b'),'foreignKey':'MetricId'});db[_0x2e03('0xa5')][_0x2e03('0x153')](db[_0x2e03('0xa3')],{'foreignKey':'MetricId'});db[_0x2e03('0xa8')][_0x2e03('0x11c')](db['SalesforceConfiguration'],{'as':_0x2e03('0x1c6'),'onDelete':_0x2e03('0x11b'),'foreignKey':_0x2e03('0x1c7')});db[_0x2e03('0xa9')][_0x2e03('0x11c')](db[_0x2e03('0xaa')],{'as':_0x2e03('0x1c8'),'onDelete':'cascade','foreignKey':_0x2e03('0x1c9')});db[_0x2e03('0xa9')]['hasMany'](db['SalesforceField'],{'as':_0x2e03('0x1ca'),'onDelete':'cascade','foreignKey':_0x2e03('0x1cb')});db[_0x2e03('0xa9')][_0x2e03('0x11c')](db['SalesforceField'],{'as':_0x2e03('0x1c4'),'onDelete':'cascade','foreignKey':_0x2e03('0x1cc')});db['SalesforceConfiguration'][_0x2e03('0x153')](db[_0x2e03('0xa8')],{'as':_0x2e03('0x174'),'foreignKey':_0x2e03('0x1c7')});db[_0x2e03('0xaa')][_0x2e03('0x11c')](db['SalesforceField'],{'as':_0x2e03('0x1cd'),'foreignKey':_0x2e03('0x1c9')});db[_0x2e03('0xaa')][_0x2e03('0x11c')](db[_0x2e03('0xaa')],{'as':'Description','foreignKey':_0x2e03('0x1cb')});db['SalesforceField'][_0x2e03('0x11c')](db[_0x2e03('0xaa')],{'as':_0x2e03('0x1ce'),'foreignKey':_0x2e03('0x1cc')});db['SalesforceField'][_0x2e03('0x153')](db[_0x2e03('0x9a')],{'as':_0x2e03('0x9a'),'foreignKey':_0x2e03('0x1cf')});db[_0x2e03('0xab')][_0x2e03('0x11c')](db['SugarcrmConfiguration'],{'as':_0x2e03('0x1c6'),'onDelete':'cascade','foreignKey':_0x2e03('0x1c7')});db[_0x2e03('0xad')][_0x2e03('0x11c')](db[_0x2e03('0x1d0')],{'as':_0x2e03('0x1c8'),'onDelete':'cascade','foreignKey':'SubjectId'});db['SugarcrmConfiguration'][_0x2e03('0x11c')](db[_0x2e03('0x1d0')],{'as':_0x2e03('0x1ca'),'onDelete':_0x2e03('0x11b'),'foreignKey':'DescriptionId'});db['SugarcrmConfiguration'][_0x2e03('0x11c')](db[_0x2e03('0x1d0')],{'as':'Fields','onDelete':_0x2e03('0x11b'),'foreignKey':_0x2e03('0x1cc')});db['SugarcrmConfiguration'][_0x2e03('0x153')](db[_0x2e03('0xab')],{'as':_0x2e03('0x174'),'foreignKey':_0x2e03('0x1c7')});db[_0x2e03('0x1d0')][_0x2e03('0x11c')](db[_0x2e03('0x1d0')],{'as':_0x2e03('0x1cd'),'foreignKey':_0x2e03('0x1c9')});db['SugarcrmField'][_0x2e03('0x11c')](db['SugarcrmField'],{'as':_0x2e03('0x1d1'),'foreignKey':_0x2e03('0x1cb')});db[_0x2e03('0x1d0')][_0x2e03('0x11c')](db['SugarcrmField'],{'as':_0x2e03('0x1ce'),'foreignKey':'FieldId'});db[_0x2e03('0x1d0')]['belongsTo'](db[_0x2e03('0x9a')],{'as':_0x2e03('0x9a'),'foreignKey':'VariableId'});db[_0x2e03('0xaf')][_0x2e03('0x11c')](db['DeskConfiguration'],{'as':_0x2e03('0x1c6'),'onDelete':_0x2e03('0x11b'),'foreignKey':'AccountId'});db['DeskConfiguration'][_0x2e03('0x11c')](db['DeskField'],{'as':_0x2e03('0x1c8'),'onDelete':_0x2e03('0x11b'),'foreignKey':_0x2e03('0x1c9')});db[_0x2e03('0xb0')][_0x2e03('0x11c')](db['DeskField'],{'as':_0x2e03('0x1ca'),'onDelete':_0x2e03('0x11b'),'foreignKey':_0x2e03('0x1cb')});db['DeskConfiguration'][_0x2e03('0x11c')](db['DeskField'],{'as':'Fields','onDelete':'cascade','foreignKey':_0x2e03('0x1cc')});db[_0x2e03('0xb0')][_0x2e03('0x153')](db[_0x2e03('0xaf')],{'as':_0x2e03('0x174'),'foreignKey':_0x2e03('0x1c7')});db[_0x2e03('0xb0')][_0x2e03('0x12b')](db[_0x2e03('0x91')],{'through':_0x2e03('0x1d2')});db[_0x2e03('0x1d3')][_0x2e03('0x11c')](db[_0x2e03('0x1d3')],{'as':'Subject','foreignKey':_0x2e03('0x1c9')});db[_0x2e03('0x1d3')][_0x2e03('0x11c')](db['DeskField'],{'as':_0x2e03('0x1d1'),'foreignKey':_0x2e03('0x1cb')});db[_0x2e03('0x1d3')][_0x2e03('0x11c')](db[_0x2e03('0x1d3')],{'as':_0x2e03('0x1ce'),'foreignKey':_0x2e03('0x1cc')});db['DeskField'][_0x2e03('0x153')](db[_0x2e03('0x9a')],{'as':_0x2e03('0x9a'),'foreignKey':_0x2e03('0x1cf')});db[_0x2e03('0xb2')]['hasMany'](db[_0x2e03('0xb4')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x2e03('0x1c7')});db[_0x2e03('0xb4')][_0x2e03('0x11c')](db['ZohoField'],{'as':_0x2e03('0x1c8'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x2e03('0xb4')]['hasMany'](db['ZohoField'],{'as':'Descriptions','onDelete':_0x2e03('0x11b'),'foreignKey':_0x2e03('0x1cb')});db[_0x2e03('0xb4')]['hasMany'](db[_0x2e03('0xb5')],{'as':_0x2e03('0x1c4'),'onDelete':'cascade','foreignKey':_0x2e03('0x1cc')});db['ZohoConfiguration'][_0x2e03('0x153')](db[_0x2e03('0xb2')],{'as':_0x2e03('0x174'),'foreignKey':_0x2e03('0x1c7')});db[_0x2e03('0xb5')][_0x2e03('0x11c')](db[_0x2e03('0xb5')],{'as':_0x2e03('0x1cd'),'foreignKey':_0x2e03('0x1c9')});db[_0x2e03('0xb5')][_0x2e03('0x11c')](db[_0x2e03('0xb5')],{'as':_0x2e03('0x1d1'),'foreignKey':_0x2e03('0x1cb')});db['ZohoField'][_0x2e03('0x11c')](db[_0x2e03('0xb5')],{'as':_0x2e03('0x1ce'),'foreignKey':'FieldId'});db[_0x2e03('0xb5')][_0x2e03('0x153')](db[_0x2e03('0x9a')],{'as':'Variable','foreignKey':_0x2e03('0x1cf')});db['ZendeskAccount']['hasMany'](db[_0x2e03('0x1d4')],{'as':_0x2e03('0x1c6'),'onDelete':'cascade','foreignKey':_0x2e03('0x1c7')});db[_0x2e03('0x1d4')]['hasMany'](db['ZendeskField'],{'as':_0x2e03('0x1c8'),'foreignKey':_0x2e03('0x1c9')});db[_0x2e03('0x1d4')][_0x2e03('0x11c')](db[_0x2e03('0xba')],{'as':_0x2e03('0x1ca'),'foreignKey':_0x2e03('0x1cb')});db[_0x2e03('0x1d4')][_0x2e03('0x11c')](db[_0x2e03('0xba')],{'as':_0x2e03('0x1c4'),'foreignKey':'FieldId'});db[_0x2e03('0x1d4')]['belongsTo'](db[_0x2e03('0xb7')],{'as':_0x2e03('0x174'),'foreignKey':_0x2e03('0x1c7')});db['ZendeskConfiguration'][_0x2e03('0x12b')](db[_0x2e03('0x91')],{'through':_0x2e03('0x1d5')});db[_0x2e03('0xba')][_0x2e03('0x11c')](db[_0x2e03('0xba')],{'as':'Subject','foreignKey':_0x2e03('0x1c9')});db[_0x2e03('0xba')][_0x2e03('0x11c')](db[_0x2e03('0xba')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x2e03('0xba')][_0x2e03('0x11c')](db[_0x2e03('0xba')],{'as':_0x2e03('0x1ce'),'foreignKey':'FieldId'});db[_0x2e03('0xba')][_0x2e03('0x153')](db[_0x2e03('0x9a')],{'as':_0x2e03('0x9a'),'foreignKey':'VariableId'});db[_0x2e03('0xbc')]['hasMany'](db[_0x2e03('0xbe')],{'as':_0x2e03('0x1c6'),'onDelete':_0x2e03('0x11b'),'foreignKey':_0x2e03('0x1c7')});db[_0x2e03('0xbe')]['hasMany'](db[_0x2e03('0xbf')],{'as':_0x2e03('0x1c8'),'onDelete':_0x2e03('0x11b'),'foreignKey':'SubjectId'});db[_0x2e03('0xbe')][_0x2e03('0x11c')](db[_0x2e03('0xbf')],{'as':_0x2e03('0x1ca'),'onDelete':_0x2e03('0x11b'),'foreignKey':_0x2e03('0x1cb')});db[_0x2e03('0xbe')][_0x2e03('0x11c')](db['FreshdeskField'],{'as':_0x2e03('0x1c4'),'onDelete':_0x2e03('0x11b'),'foreignKey':_0x2e03('0x1cc')});db['FreshdeskConfiguration'][_0x2e03('0x153')](db['FreshdeskAccount'],{'as':_0x2e03('0x174'),'foreignKey':_0x2e03('0x1c7')});db['FreshdeskConfiguration'][_0x2e03('0x12b')](db[_0x2e03('0x91')],{'through':'int_freshdesk_configuration_has_tags'});db[_0x2e03('0xbf')][_0x2e03('0x11c')](db[_0x2e03('0xbf')],{'as':_0x2e03('0x1cd'),'foreignKey':_0x2e03('0x1c9')});db[_0x2e03('0xbf')]['hasMany'](db['FreshdeskField'],{'as':_0x2e03('0x1d1'),'foreignKey':_0x2e03('0x1cb')});db[_0x2e03('0xbf')][_0x2e03('0x11c')](db['FreshdeskField'],{'as':_0x2e03('0x1ce'),'foreignKey':'FieldId'});db['FreshdeskField'][_0x2e03('0x153')](db[_0x2e03('0x9a')],{'as':_0x2e03('0x9a'),'foreignKey':'VariableId'});db[_0x2e03('0xc1')][_0x2e03('0x11c')](db['VtigerConfiguration'],{'as':_0x2e03('0x1c6'),'onDelete':_0x2e03('0x11b'),'foreignKey':_0x2e03('0x1c7')});db[_0x2e03('0xc2')]['hasMany'](db[_0x2e03('0x1d6')],{'as':_0x2e03('0x1c8'),'foreignKey':'SubjectId'});db[_0x2e03('0xc2')]['hasMany'](db[_0x2e03('0x1d6')],{'as':'Descriptions','foreignKey':_0x2e03('0x1cb')});db['VtigerConfiguration']['hasMany'](db[_0x2e03('0x1d6')],{'as':_0x2e03('0x1c4'),'foreignKey':'FieldId'});db[_0x2e03('0xc2')][_0x2e03('0x153')](db[_0x2e03('0xc1')],{'as':_0x2e03('0x174'),'foreignKey':_0x2e03('0x1c7')});db[_0x2e03('0x1d6')][_0x2e03('0x11c')](db[_0x2e03('0x1d6')],{'as':_0x2e03('0x1cd'),'foreignKey':_0x2e03('0x1c9')});db[_0x2e03('0x1d6')][_0x2e03('0x11c')](db[_0x2e03('0x1d6')],{'as':_0x2e03('0x1d1'),'foreignKey':_0x2e03('0x1cb')});db['VtigerField'][_0x2e03('0x11c')](db['VtigerField'],{'as':_0x2e03('0x1ce'),'foreignKey':'FieldId'});db[_0x2e03('0x1d6')][_0x2e03('0x153')](db[_0x2e03('0x9a')],{'as':'Variable','foreignKey':'VariableId'});db[_0x2e03('0xc5')][_0x2e03('0x11c')](db[_0x2e03('0x1d7')],{'as':_0x2e03('0x1c6'),'onDelete':_0x2e03('0x11b'),'foreignKey':_0x2e03('0x1c7')});db[_0x2e03('0x1d7')][_0x2e03('0x11c')](db[_0x2e03('0xc7')],{'as':_0x2e03('0x1c8'),'foreignKey':_0x2e03('0x1c9')});db[_0x2e03('0x1d7')][_0x2e03('0x11c')](db[_0x2e03('0xc7')],{'as':'Descriptions','foreignKey':_0x2e03('0x1cb')});db[_0x2e03('0x1d7')]['hasMany'](db[_0x2e03('0xc7')],{'as':_0x2e03('0x1c4'),'foreignKey':_0x2e03('0x1cc')});db[_0x2e03('0x1d7')][_0x2e03('0x153')](db[_0x2e03('0xc5')],{'as':_0x2e03('0x174'),'foreignKey':_0x2e03('0x1c7')});db[_0x2e03('0xc7')][_0x2e03('0x11c')](db[_0x2e03('0xc7')],{'as':_0x2e03('0x1cd'),'foreignKey':_0x2e03('0x1c9')});db[_0x2e03('0xc7')][_0x2e03('0x11c')](db['ServicenowField'],{'as':_0x2e03('0x1d1'),'foreignKey':_0x2e03('0x1cb')});db['ServicenowField'][_0x2e03('0x11c')](db[_0x2e03('0xc7')],{'as':_0x2e03('0x1ce'),'foreignKey':_0x2e03('0x1cc')});db[_0x2e03('0xc7')][_0x2e03('0x153')](db[_0x2e03('0x9a')],{'as':_0x2e03('0x9a'),'foreignKey':'VariableId'});db[_0x2e03('0xc9')]['hasMany'](db[_0x2e03('0xcb')],{'as':_0x2e03('0x1c6'),'onDelete':_0x2e03('0x11b'),'foreignKey':_0x2e03('0x1c7')});db[_0x2e03('0xc9')][_0x2e03('0x153')](db['CloudProvider'],{'as':'CloudProvider','foreignKey':_0x2e03('0x166')});db[_0x2e03('0xcb')][_0x2e03('0x11c')](db[_0x2e03('0x1d8')],{'as':'Subjects','onDelete':_0x2e03('0x11b'),'foreignKey':_0x2e03('0x1c9')});db[_0x2e03('0xcb')][_0x2e03('0x11c')](db[_0x2e03('0x1d8')],{'as':_0x2e03('0x1ca'),'onDelete':_0x2e03('0x11b'),'foreignKey':'DescriptionId'});db[_0x2e03('0xcb')][_0x2e03('0x11c')](db[_0x2e03('0x1d8')],{'as':_0x2e03('0x1c4'),'onDelete':'cascade','foreignKey':_0x2e03('0x1cc')});db[_0x2e03('0xcb')][_0x2e03('0x153')](db[_0x2e03('0xc9')],{'as':'Account','foreignKey':_0x2e03('0x1c7')});db['Dynamics365Field']['hasMany'](db[_0x2e03('0x1d8')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x2e03('0x1d8')][_0x2e03('0x11c')](db['Dynamics365Field'],{'as':'Description','foreignKey':'DescriptionId'});db['Dynamics365Field'][_0x2e03('0x11c')](db['Dynamics365Field'],{'as':'Field','foreignKey':_0x2e03('0x1cc')});db[_0x2e03('0x1d8')][_0x2e03('0x153')](db[_0x2e03('0x9a')],{'as':_0x2e03('0x9a'),'foreignKey':_0x2e03('0x1cf')});db[_0x2e03('0xcd')][_0x2e03('0x11c')](db[_0x2e03('0xcf')],{'as':_0x2e03('0x1c6'),'onDelete':_0x2e03('0x11b'),'foreignKey':'AccountId'});db['FreshsalesConfiguration'][_0x2e03('0x11c')](db[_0x2e03('0x1d9')],{'as':_0x2e03('0x1c8'),'foreignKey':_0x2e03('0x1c9')});db[_0x2e03('0xcf')][_0x2e03('0x11c')](db[_0x2e03('0x1d9')],{'as':_0x2e03('0x1ca'),'foreignKey':_0x2e03('0x1cb')});db[_0x2e03('0xcf')][_0x2e03('0x11c')](db[_0x2e03('0x1d9')],{'as':_0x2e03('0x1c4'),'foreignKey':_0x2e03('0x1cc')});db['FreshsalesConfiguration'][_0x2e03('0x153')](db['FreshsalesAccount'],{'as':_0x2e03('0x174'),'foreignKey':'AccountId'});db['FreshsalesField'][_0x2e03('0x11c')](db[_0x2e03('0x1d9')],{'as':_0x2e03('0x1cd'),'foreignKey':_0x2e03('0x1c9')});db[_0x2e03('0x1d9')][_0x2e03('0x11c')](db[_0x2e03('0x1d9')],{'as':_0x2e03('0x1d1'),'foreignKey':_0x2e03('0x1cb')});db[_0x2e03('0x1d9')]['hasMany'](db[_0x2e03('0x1d9')],{'as':_0x2e03('0x1ce'),'foreignKey':_0x2e03('0x1cc')});db[_0x2e03('0x1d9')][_0x2e03('0x153')](db[_0x2e03('0x9a')],{'as':_0x2e03('0x9a'),'foreignKey':_0x2e03('0x1cf')});db[_0x2e03('0xd4')]['belongsTo'](db[_0x2e03('0x65')],{});db['ChatQueueReport'][_0x2e03('0x153')](db[_0x2e03('0xfe')],{'as':_0x2e03('0x16e'),'foreignKey':_0x2e03('0x16f')});db[_0x2e03('0xd4')][_0x2e03('0x153')](db[_0x2e03('0x76')],{'as':_0x2e03('0x162'),'foreignKey':'ContactId'});db['ChatQueueReport'][_0x2e03('0x153')](db[_0x2e03('0x121')],{});db[_0x2e03('0xd4')][_0x2e03('0x153')](db[_0x2e03('0x6b')],{});db['ChatQueueReport'][_0x2e03('0x153')](db[_0x2e03('0x13')],{});db[_0x2e03('0xd4')]['belongsTo'](db[_0x2e03('0x6e')],{});db[_0x2e03('0xd6')][_0x2e03('0x153')](db[_0x2e03('0x13')],{'onDelete':_0x2e03('0x11b'),'foreignKey':_0x2e03('0x1da')});db[_0x2e03('0xd6')][_0x2e03('0x153')](db[_0x2e03('0x13')],{'onDelete':_0x2e03('0x11b'),'foreignKey':_0x2e03('0x1db')});db[_0x2e03('0xdc')][_0x2e03('0x11c')](db[_0x2e03('0xda')],{'foreignKey':_0x2e03('0x1dc'),'onDelete':_0x2e03('0x11b')});db[_0x2e03('0xdc')][_0x2e03('0x11c')](db[_0x2e03('0xd8')],{'foreignKey':_0x2e03('0x1dc'),'onDelete':_0x2e03('0x11b')});db['SmsQueueReport'][_0x2e03('0x153')](db[_0x2e03('0x56')],{});db['SmsQueueReport'][_0x2e03('0x153')](db[_0x2e03('0xfe')],{'as':_0x2e03('0x16e'),'foreignKey':'ListId'});db[_0x2e03('0xde')][_0x2e03('0x153')](db[_0x2e03('0x76')],{'as':_0x2e03('0x162'),'foreignKey':_0x2e03('0x163')});db[_0x2e03('0xde')][_0x2e03('0x153')](db[_0x2e03('0x5a')],{});db[_0x2e03('0xde')][_0x2e03('0x153')](db[_0x2e03('0x5c')],{});db[_0x2e03('0xde')][_0x2e03('0x153')](db[_0x2e03('0x13')],{});db[_0x2e03('0xde')][_0x2e03('0x153')](db[_0x2e03('0x13c')],{});db[_0x2e03('0xe2')][_0x2e03('0x11c')](db[_0x2e03('0xdc')],{'foreignKey':_0x2e03('0x1dd')});db[_0x2e03('0xe2')][_0x2e03('0x11c')](db[_0x2e03('0xda')],{'foreignKey':_0x2e03('0x1dd')});db[_0x2e03('0xe2')]['hasMany'](db[_0x2e03('0xd8')],{'foreignKey':'ProjectId'});db[_0x2e03('0xed')][_0x2e03('0x12b')](db[_0x2e03('0x13')],{'as':'Agents','through':_0x2e03('0x1de')});db['Team'][_0x2e03('0x12b')](db[_0x2e03('0x1b')],{'through':_0x2e03('0x111'),'as':_0x2e03('0x137')});db[_0x2e03('0xed')][_0x2e03('0x12b')](db['MailQueue'],{'through':'team_has_mail_queues','as':_0x2e03('0x139')});db['Team'][_0x2e03('0x12b')](db[_0x2e03('0x6e')],{'through':_0x2e03('0x19c'),'as':'ChatQueues'});db[_0x2e03('0xed')][_0x2e03('0x12b')](db[_0x2e03('0x52')],{'through':_0x2e03('0x189'),'as':_0x2e03('0x1df')});db[_0x2e03('0xed')][_0x2e03('0x12b')](db['SmsQueue'],{'through':_0x2e03('0x18e'),'as':'SmsQueues'});db[_0x2e03('0xed')][_0x2e03('0x12b')](db[_0x2e03('0x63')],{'through':_0x2e03('0x194'),'as':'OpenchannelQueues'});db[_0x2e03('0xed')][_0x2e03('0x12b')](db['WhatsappQueue'],{'through':_0x2e03('0x1e0'),'as':_0x2e03('0x13e')});db['Team'][_0x2e03('0x12b')](db[_0x2e03('0xff')],{'through':_0x2e03('0x1e1'),'as':'VoicePrefixes'});db[_0x2e03('0xf1')][_0x2e03('0x11c')](db[_0x2e03('0x78')],{'as':_0x2e03('0x129'),'foreignKey':_0x2e03('0x1a9')});db[_0x2e03('0xf1')][_0x2e03('0x11c')](db[_0x2e03('0x11e')],{'as':_0x2e03('0x1a2'),'foreignKey':_0x2e03('0x1a9')});db[_0x2e03('0xf1')][_0x2e03('0x11c')](db[_0x2e03('0x7c')],{'as':'HopperHistories','foreignKey':_0x2e03('0x1a9')});db[_0x2e03('0xf1')][_0x2e03('0x11c')](db[_0x2e03('0x79')],{'as':_0x2e03('0x152'),'foreignKey':_0x2e03('0x1a9')});db[_0x2e03('0xf1')][_0x2e03('0x153')](db[_0x2e03('0x154')],{'as':_0x2e03('0x154'),'foreignKey':_0x2e03('0x1e2')});db[_0x2e03('0xf1')][_0x2e03('0x153')](db[_0x2e03('0x154')],{'as':'TrunkBackup','foreignKey':'TrunkBackupId'});db[_0x2e03('0xf1')][_0x2e03('0x153')](db[_0x2e03('0x156')],{'as':_0x2e03('0x156'),'foreignKey':_0x2e03('0x157')});db['Campaign'][_0x2e03('0x153')](db[_0x2e03('0xe7')],{'as':_0x2e03('0xe7'),'foreignKey':_0x2e03('0x1e3')});db[_0x2e03('0xf1')][_0x2e03('0x12b')](db['CmList'],{'as':_0x2e03('0x12e'),'through':_0x2e03('0x1e4')});db['Campaign'][_0x2e03('0x12b')](db[_0x2e03('0xfe')],{'as':'BlackLists','through':_0x2e03('0x1e5')});db[_0x2e03('0xf5')][_0x2e03('0x153')](db[_0x2e03('0x17d')],{'as':_0x2e03('0x17d'),'foreignKey':_0x2e03('0x19b')});db[_0x2e03('0xf7')][_0x2e03('0x153')](db[_0x2e03('0x44')],{});db[_0x2e03('0xf7')][_0x2e03('0x153')](db[_0x2e03('0x42')],{});db[_0x2e03('0xf7')][_0x2e03('0x153')](db['MailAccount'],{'foreignKey':_0x2e03('0x1e6'),'as':_0x2e03('0x1e7')});db[_0x2e03('0xf7')][_0x2e03('0x153')](db['User'],{'foreignKey':'FromUserId','as':'FromAgent'});db['MailTransferReport'][_0x2e03('0x153')](db[_0x2e03('0x13')],{'foreignKey':_0x2e03('0x1e8'),'as':_0x2e03('0x1e9')});db[_0x2e03('0xf7')][_0x2e03('0x153')](db[_0x2e03('0x3e')],{'foreignKey':_0x2e03('0x1ea'),'as':_0x2e03('0x1eb')});db[_0x2e03('0xf7')][_0x2e03('0x153')](db['MailAccount'],{'foreignKey':'ToMailAccountId','as':_0x2e03('0x1ec')});db['ChatTransferReport'][_0x2e03('0x153')](db[_0x2e03('0x6b')],{});db[_0x2e03('0xf8')][_0x2e03('0x153')](db[_0x2e03('0x121')],{});db[_0x2e03('0xf8')]['belongsTo'](db[_0x2e03('0x65')],{'foreignKey':_0x2e03('0x1ed'),'as':'FromAccount'});db[_0x2e03('0xf8')][_0x2e03('0x153')](db[_0x2e03('0x13')],{'foreignKey':_0x2e03('0x1ee'),'as':'FromAgent'});db['ChatTransferReport'][_0x2e03('0x153')](db['User'],{'foreignKey':_0x2e03('0x1e8'),'as':_0x2e03('0x1e9')});db[_0x2e03('0xf8')][_0x2e03('0x153')](db[_0x2e03('0x6e')],{'foreignKey':_0x2e03('0x1ef'),'as':'ToQueue'});db['ChatTransferReport'][_0x2e03('0x153')](db[_0x2e03('0x65')],{'foreignKey':'ToChatWebsiteId','as':_0x2e03('0x1ec')});db[_0x2e03('0xf9')][_0x2e03('0x153')](db[_0x2e03('0x185')],{});db['FaxTransferReport'][_0x2e03('0x153')](db[_0x2e03('0x4f')],{});db['FaxTransferReport'][_0x2e03('0x153')](db[_0x2e03('0x140')],{'foreignKey':_0x2e03('0x1f0'),'as':_0x2e03('0x1e7')});db[_0x2e03('0xf9')]['belongsTo'](db[_0x2e03('0x13')],{'foreignKey':_0x2e03('0x1ee'),'as':_0x2e03('0x1f1')});db[_0x2e03('0xf9')][_0x2e03('0x153')](db['User'],{'foreignKey':_0x2e03('0x1e8'),'as':_0x2e03('0x1e9')});db[_0x2e03('0xf9')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0x2e03('0x1f2'),'as':_0x2e03('0x1eb')});db[_0x2e03('0xf9')][_0x2e03('0x153')](db[_0x2e03('0x140')],{'foreignKey':_0x2e03('0x1f3'),'as':_0x2e03('0x1ec')});db[_0x2e03('0xfa')][_0x2e03('0x153')](db[_0x2e03('0x62')],{});db[_0x2e03('0xfa')][_0x2e03('0x153')](db['OpenchannelInteraction'],{});db[_0x2e03('0xfa')][_0x2e03('0x153')](db[_0x2e03('0x144')],{'foreignKey':_0x2e03('0x1f4'),'as':_0x2e03('0x1e7')});db[_0x2e03('0xfa')]['belongsTo'](db[_0x2e03('0x13')],{'foreignKey':_0x2e03('0x1ee'),'as':_0x2e03('0x1f1')});db['OpenchannelTransferReport'][_0x2e03('0x153')](db[_0x2e03('0x13')],{'foreignKey':_0x2e03('0x1e8'),'as':'ToAgent'});db[_0x2e03('0xfa')][_0x2e03('0x153')](db[_0x2e03('0x63')],{'foreignKey':'ToOpenchannelQueueId','as':_0x2e03('0x1eb')});db[_0x2e03('0xfa')][_0x2e03('0x153')](db[_0x2e03('0x144')],{'foreignKey':_0x2e03('0x1f5'),'as':_0x2e03('0x1ec')});db['SmsTransferReport'][_0x2e03('0x153')](db[_0x2e03('0x5c')],{});db[_0x2e03('0xfc')]['belongsTo'](db[_0x2e03('0x5a')],{});db[_0x2e03('0xfc')][_0x2e03('0x153')](db['SmsAccount'],{'foreignKey':_0x2e03('0x1f6'),'as':'FromAccount'});db[_0x2e03('0xfc')]['belongsTo'](db['User'],{'foreignKey':_0x2e03('0x1ee'),'as':_0x2e03('0x1f1')});db['SmsTransferReport'][_0x2e03('0x153')](db['User'],{'foreignKey':_0x2e03('0x1e8'),'as':'ToAgent'});db['SmsTransferReport'][_0x2e03('0x153')](db['SmsQueue'],{'foreignKey':_0x2e03('0x1f7'),'as':'ToQueue'});db[_0x2e03('0xfc')][_0x2e03('0x153')](db[_0x2e03('0x56')],{'foreignKey':_0x2e03('0x1f8'),'as':_0x2e03('0x1ec')});db['CmList'][_0x2e03('0x11c')](db[_0x2e03('0x87')],{'as':_0x2e03('0x16a'),'foreignKey':_0x2e03('0x16f'),'onDelete':'cascade'});db['CmList'][_0x2e03('0x11c')](db[_0x2e03('0x7f')],{'as':_0x2e03('0x1f9'),'foreignKey':'ListId'});db[_0x2e03('0xfe')]['hasMany'](db[_0x2e03('0x76')],{'as':'Contacts','onDelete':'cascade','foreignKey':_0x2e03('0x16f')});db[_0x2e03('0xfe')][_0x2e03('0x11c')](db[_0x2e03('0x11e')],{'as':_0x2e03('0x1a2'),'foreignKey':_0x2e03('0x16f')});db[_0x2e03('0xfe')][_0x2e03('0x11c')](db[_0x2e03('0x7c')],{'as':'HopperHistory','foreignKey':_0x2e03('0x16f')});db[_0x2e03('0xfe')]['hasMany'](db['ReportAgentPreview'],{'as':_0x2e03('0x7d'),'foreignKey':_0x2e03('0x16f')});db['CmList'][_0x2e03('0x12b')](db['VoiceQueue'],{'as':_0x2e03('0x1fa'),'through':_0x2e03('0x159')});db[_0x2e03('0xfe')][_0x2e03('0x12b')](db[_0x2e03('0x13')],{'as':_0x2e03('0x15a'),'through':_0x2e03('0x12f')});db[_0x2e03('0xff')][_0x2e03('0x11c')](db[_0x2e03('0x18')],{'as':_0x2e03('0x1b2'),'onDelete':_0x2e03('0x11b')});db[_0x2e03('0xff')][_0x2e03('0x12b')](db[_0x2e03('0x13')],{'as':'Agents','through':_0x2e03('0x113')});db[_0x2e03('0xff')]['belongsToMany'](db['Team'],{'through':_0x2e03('0x1e1'),'as':_0x2e03('0x15b')});db[_0x2e03('0x12a')][_0x2e03('0x11c')](db['User'],{'as':'Users','foreignKey':_0x2e03('0x1fb')});db[_0x2e03('0x12a')][_0x2e03('0x11c')](db[_0x2e03('0x102')],{'as':'UserProfileSections','foreignKey':'userProfileId','onDelete':_0x2e03('0x11b')});db['UserProfileSection'][_0x2e03('0x11c')](db[_0x2e03('0x104')],{'as':_0x2e03('0x1fc'),'foreignKey':_0x2e03('0x1fd'),'onDelete':_0x2e03('0x11b')});db['WhatsappAccount'][_0x2e03('0x11c')](db[_0x2e03('0x87')],{'as':'Dispositions','foreignKey':_0x2e03('0x1fe'),'onDelete':_0x2e03('0x11b')});db['WhatsappAccount']['hasMany'](db[_0x2e03('0x85')],{'as':'Answers','foreignKey':_0x2e03('0x1fe')});db[_0x2e03('0x107')][_0x2e03('0x11c')](db[_0x2e03('0x1ff')],{'as':_0x2e03('0x15d'),'foreignKey':_0x2e03('0x1fe')});db[_0x2e03('0x107')][_0x2e03('0x11c')](db[_0x2e03('0x125')],{'as':_0x2e03('0x16c')});db['WhatsappAccount'][_0x2e03('0x11c')](db['WhatsappApplication'],{'as':'Applications','foreignKey':_0x2e03('0x1fe'),'onDelete':_0x2e03('0x11b')});db[_0x2e03('0x107')][_0x2e03('0x153')](db[_0x2e03('0xfe')],{'as':_0x2e03('0x16e'),'foreignKey':_0x2e03('0x16f')});db[_0x2e03('0x107')][_0x2e03('0x153')](db['Pause'],{'as':_0x2e03('0x183'),'foreignKey':_0x2e03('0x158')});db[_0x2e03('0x107')][_0x2e03('0x12b')](db['User'],{'as':_0x2e03('0x15a'),'through':'user_has_whatsapp_accounts'});db[_0x2e03('0x109')][_0x2e03('0x153')](db[_0x2e03('0x13')],{'onDelete':_0x2e03('0x167')});db[_0x2e03('0x109')][_0x2e03('0x153')](db['WhatsappQueue'],{'onDelete':_0x2e03('0x167')});db['WhatsappApplication'][_0x2e03('0x153')](db[_0x2e03('0x107')],{'onDelete':_0x2e03('0x167')});db[_0x2e03('0x109')][_0x2e03('0x153')](db[_0x2e03('0x156')],{'onDelete':_0x2e03('0x167'),'foreignKey':'IntervalId'});db['WhatsappApplication'][_0x2e03('0x153')](db[_0x2e03('0x91')],{'onDelete':'restrict','foreignKey':_0x2e03('0x17e')});db['WhatsappInteraction']['hasMany'](db[_0x2e03('0x1ff')],{'as':'Messages','onDelete':_0x2e03('0x11b'),'foreignKey':_0x2e03('0x200')});db[_0x2e03('0x125')]['belongsTo'](db[_0x2e03('0x107')],{'as':_0x2e03('0x174'),'foreignKey':_0x2e03('0x1fe')});db[_0x2e03('0x125')][_0x2e03('0x153')](db[_0x2e03('0x76')],{'as':'Contact','foreignKey':_0x2e03('0x163')});db[_0x2e03('0x125')][_0x2e03('0x153')](db['User'],{'as':_0x2e03('0x175'),'foreignKey':_0x2e03('0x119')});db[_0x2e03('0x125')][_0x2e03('0x12b')](db[_0x2e03('0x91')],{'through':_0x2e03('0x1bb'),'as':_0x2e03('0x177')});db['WhatsappInteraction']['belongsToMany'](db[_0x2e03('0x91')],{'through':_0x2e03('0x1bb'),'as':_0x2e03('0x178')});db['WhatsappInteraction'][_0x2e03('0x12b')](db[_0x2e03('0x13')],{'as':_0x2e03('0x179'),'through':_0x2e03('0x136'),'foreignKey':'WhatsappInteractionId'});db['WhatsappMessage'][_0x2e03('0x153')](db[_0x2e03('0x13')],{'as':'User'});db[_0x2e03('0x1ff')][_0x2e03('0x153')](db[_0x2e03('0x76')],{'onDelete':'cascade','as':_0x2e03('0x162')});db[_0x2e03('0x1ff')][_0x2e03('0x153')](db[_0x2e03('0x125')],{'onDelete':_0x2e03('0x11b'),'as':_0x2e03('0x17b'),'foreignKey':'WhatsappInteractionId'});db[_0x2e03('0x1ff')][_0x2e03('0x153')](db[_0x2e03('0x107')],{'as':_0x2e03('0x174'),'foreignKey':_0x2e03('0x1fe')});db['WhatsappQueueReport'][_0x2e03('0x153')](db[_0x2e03('0x107')],{});db[_0x2e03('0x10d')][_0x2e03('0x153')](db[_0x2e03('0xfe')],{'as':'List','foreignKey':_0x2e03('0x16f')});db[_0x2e03('0x10d')][_0x2e03('0x153')](db[_0x2e03('0x76')],{'as':_0x2e03('0x162'),'foreignKey':'ContactId'});db[_0x2e03('0x10d')][_0x2e03('0x153')](db[_0x2e03('0x125')],{});db[_0x2e03('0x10d')][_0x2e03('0x153')](db[_0x2e03('0x201')],{});db[_0x2e03('0x10d')][_0x2e03('0x153')](db[_0x2e03('0x1ff')],{});db['WhatsappQueueReport']['belongsTo'](db[_0x2e03('0x13')],{});db[_0x2e03('0x202')][_0x2e03('0x153')](db[_0x2e03('0x1ff')],{});db[_0x2e03('0x202')][_0x2e03('0x153')](db[_0x2e03('0x125')],{});db[_0x2e03('0x202')][_0x2e03('0x153')](db[_0x2e03('0x107')],{'foreignKey':_0x2e03('0x203'),'as':_0x2e03('0x1e7')});db[_0x2e03('0x202')][_0x2e03('0x153')](db[_0x2e03('0x107')],{'foreignKey':'ToWhatsappAccountId','as':_0x2e03('0x1ec')});db[_0x2e03('0x202')][_0x2e03('0x153')](db[_0x2e03('0x201')],{'foreignKey':'ToQueueId','as':_0x2e03('0x1eb')});db[_0x2e03('0x202')]['belongsTo'](db['User'],{'foreignKey':_0x2e03('0x1ee'),'as':_0x2e03('0x1f1')});db[_0x2e03('0x202')][_0x2e03('0x153')](db[_0x2e03('0x13')],{'foreignKey':_0x2e03('0x1e8'),'as':_0x2e03('0x1e9')});db['WhatsappQueue'][_0x2e03('0x12b')](db[_0x2e03('0x13')],{'as':_0x2e03('0x15a'),'through':_0x2e03('0x38'),'foreignKey':_0x2e03('0x204')});db[_0x2e03('0x201')]['belongsToMany'](db[_0x2e03('0xed')],{'through':_0x2e03('0x1e0'),'as':_0x2e03('0x15b')});db[_0x2e03('0x115')][_0x2e03('0x153')](db[_0x2e03('0x13')],{'as':_0x2e03('0x205'),'foreignKey':_0x2e03('0x119'),'onDelete':_0x2e03('0x11b'),'hooks':!![]});db[_0x2e03('0x10f')]['hasOne'](db[_0x2e03('0xc9')],{'as':_0x2e03('0xc9'),'onDelete':'restrict'});db[_0x2e03('0x10f')][_0x2e03('0x117')](db['MailServerIn'],{'as':'Imap','onDelete':_0x2e03('0x167')});db[_0x2e03('0x10f')][_0x2e03('0x117')](db[_0x2e03('0x3b')],{'as':_0x2e03('0x169'),'onDelete':_0x2e03('0x167')});module[_0x2e03('0x206')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xc812=['FaxMessage','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.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','ChatApplication','../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/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/contactItemType/contactItemType.model','CmContactHasItem','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/template/template.model','Trigger','../api/variable/variable.model','Integration','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','ChatInternalMessage','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','License','Campaign','../api/campaign/campaign.model','Plugin','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','TeamVoiceQueue','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','hasOne','cascade','userSetting','UserId','hasMany','Recordings','VoiceQueuesRt','Extensions','CmHopperFinal','HopperFinals','HopperHistory','ReportAgentPreview','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','CmHopper','Hoppers','SET\x20NULL','UserProfile','userProfileId','belongsToMany','Groups','chat_group_has_users','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueue','VoiceQueues','VoicePrefixes','MailQueues','ChatQueues','FaxQueue','SmsQueues','OpenchannelQueues','WhatsappQueues','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','user_has_whatsapp_accounts','VoiceChanSpy','VoiceExtension','SpiedAgents','ChanSpyId','Applications','VoiceMusicOnHold','Sounds','moh_has_sounds','Members','VoiceQueueId','HopperHistories','HopperBlacks','JscriptySessions','belongsTo','Trunk','TrunkId','TrunkBackup','Interval','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','QueueCalls','AgentReports','uniqueid','ContactId','MailAccountId','CloudProviderId','restrict','MailServerOut','Imap','Smtp','List','TemplateId','team_has_mail_queues','MailInteractionId','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachment','Attachments','Contact','Interaction','ChatWebsiteId','ChatOfflineMessage','ChatOfflineMessageId','TagId','ListId','Items','Dispositions','Answers','FaxAccountId','Interactions','Exntensions','FaxApplication','FaxInteractionId','Account','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','FaxQueueReport','SmsAccountId','SmsInteraction','SmsInteractionId','sms_interaction_has_tags','user_has_sms_interactions','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelInteractionId','openchannel_interaction_has_tags','UserOpenchannelQueue','OpenchannelQueueId','team_has_openchannel_queues','ProactiveActions','OpenchannelQueueReport','ChatQueue','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','CmCompany','CompanyId','Phones','Company','cm_contact_has_tags','AdditionalPhones','CampaignId','OwnerId','All','AutomationAllId','AutomationAnyId','AutomationId','ParentId','Intervals','MailApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','ContactItemType','ItemType','ItemTypeId','Hopper','CmHopperId','CmContactId','AllConditions','AllCondition','AnyConditions','AnyCondition','TriggerAnyId','Actions','TriggerId','AnalyticDefaultReport','Fields','MetricId','SalesforceAccount','Configurations','Subjects','Descriptions','DescriptionId','FieldId','AccountId','Subject','SubjectId','Description','Field','Variable','VariableId','SugarcrmConfiguration','DeskAccount','int_desk_configuration_has_tags','int_zendesk_configuration_has_tags','FreshdeskConfiguration','FreshdeskField','int_freshdesk_configuration_has_tags','VtigerAccount','FreshsalesField','FromId','SessionId','JscriptyAnswerReport','ProjectId','FaxQueues','team_has_whatsapp_queues','TrunkBackupId','SquareProjectId','BlackLists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToAccount','ChatTransferReport','FromChatWebsiteId','ToChatQueueId','ToQueue','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','UserProfileResource','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','whatsapp_interaction_has_tags','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','user','sequelize','jstz','determine','defaultsDeep','motion2','xcall','127.0.0.1','name','utf8_general_ci','sequelizeHistory','xC@LL1234','mysql','utf8mb4','utf8','database','username','password','options','User','import','../api/user/user.model','VoiceContext','../api/voiceContext/voiceContext.model','../api/voiceExtension/voiceExtension.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','../api/trunk/trunk.model','VoiceTransferReport','UserVoiceQueueRt','UserVoiceQueue','UserChatQueue','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','../api/faxApplication/faxApplication.model','FaxInteraction'];(function(_0x3be029,_0x1eb265){var _0x394a5f=function(_0x2bc0f3){while(--_0x2bc0f3){_0x3be029['push'](_0x3be029['shift']());}};_0x394a5f(++_0x1eb265);}(_0xc812,0x1be));var _0x2c81=function(_0x1afadd,_0x4bd479){_0x1afadd=_0x1afadd-0x0;var _0x3c5a28=_0xc812[_0x1afadd];return _0x3c5a28;};'use strict';var config=require('../config/environment');var Sequelize=require(_0x2c81('0x0'));var _=require('lodash');var jstz=require(_0x2c81('0x1'));var timezone=jstz[_0x2c81('0x2')]();config['sequelize']=_[_0x2c81('0x3')](config[_0x2c81('0x0')],{'database':_0x2c81('0x4'),'username':_0x2c81('0x5'),'password':'xC@LL1234','options':{'host':_0x2c81('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x2c81('0x7')](),'define':{'charset':'utf8','collate':_0x2c81('0x8')}}});config[_0x2c81('0x9')]=_['defaultsDeep'](config[_0x2c81('0x9')],{'database':_0x2c81('0x4'),'username':_0x2c81('0x5'),'password':_0x2c81('0xa'),'options':{'host':_0x2c81('0x6'),'port':0xcea,'dialect':_0x2c81('0xb'),'dialectOptions':{'charset':_0x2c81('0xc')},'logging':![],'timezone':timezone[_0x2c81('0x7')](),'define':{'charset':_0x2c81('0xd'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x2c81('0x0')][_0x2c81('0xe')],config[_0x2c81('0x0')][_0x2c81('0xf')],config[_0x2c81('0x0')][_0x2c81('0x10')],config[_0x2c81('0x0')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x2c81('0xe')],config[_0x2c81('0x9')]['username'],config['sequelizeHistory'][_0x2c81('0x10')],config['sequelizeHistory'][_0x2c81('0x11')])};db[_0x2c81('0x12')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x14'));db['VoiceChanSpy']=db[_0x2c81('0x0')][_0x2c81('0x13')]('../api/voiceChanSpy/voiceChanSpy.model');db[_0x2c81('0x15')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x16'));db['VoiceExtension']=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x17'));db['VoiceMusicOnHold']=db['sequelize'][_0x2c81('0x13')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db['VoiceQueue']=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x18'));db[_0x2c81('0x19')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x1a'));db[_0x2c81('0x1b')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x1c'));db[_0x2c81('0x1d')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x1e'));db[_0x2c81('0x1f')]=db['sequelize'][_0x2c81('0x13')](_0x2c81('0x20'));db[_0x2c81('0x21')]=db[_0x2c81('0x0')]['import'](_0x2c81('0x22'));db[_0x2c81('0x23')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x24'));db[_0x2c81('0x25')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x26'));db[_0x2c81('0x27')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x28'));db[_0x2c81('0x29')]=db[_0x2c81('0x0')]['import'](_0x2c81('0x2a'));db['Trunk']=db['sequelize'][_0x2c81('0x13')](_0x2c81('0x2b'));db[_0x2c81('0x2c')]=db[_0x2c81('0x0')][_0x2c81('0x13')]('../api/voiceTransferReport/voiceTransferReport.model');db[_0x2c81('0x2d')]=db[_0x2c81('0x0')]['import']('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x2c81('0x2e')]=db[_0x2c81('0x0')]['import']('../api/userVoiceQueue/userVoiceQueue.model');db[_0x2c81('0x2f')]=db['sequelize'][_0x2c81('0x13')]('../api/userChatQueue/userChatQueue.model');db[_0x2c81('0x30')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x31'));db[_0x2c81('0x32')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x33'));db[_0x2c81('0x34')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x35'));db['UserOpenchannelQueue']=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x36'));db[_0x2c81('0x37')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x38'));db[_0x2c81('0x39')]=db['sequelize'][_0x2c81('0x13')](_0x2c81('0x3a'));db['MailServerOut']=db['sequelize'][_0x2c81('0x13')](_0x2c81('0x3b'));db[_0x2c81('0x3c')]=db[_0x2c81('0x0')][_0x2c81('0x13')]('../api/mailAccount/mailAccount.model');db[_0x2c81('0x3d')]=db[_0x2c81('0x0')][_0x2c81('0x13')]('../api/mailQueue/mailQueue.model');db[_0x2c81('0x3e')]=db['sequelize'][_0x2c81('0x13')](_0x2c81('0x3f'));db[_0x2c81('0x40')]=db['sequelize'][_0x2c81('0x13')](_0x2c81('0x41'));db[_0x2c81('0x42')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x43'));db[_0x2c81('0x44')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x45'));db[_0x2c81('0x46')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x47'));db[_0x2c81('0x48')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x49'));db[_0x2c81('0x4a')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x4b'));db[_0x2c81('0x4c')]=db['sequelize'][_0x2c81('0x13')](_0x2c81('0x4d'));db['FaxApplication']=db[_0x2c81('0x0')]['import'](_0x2c81('0x4e'));db[_0x2c81('0x4f')]=db['sequelize'][_0x2c81('0x13')]('../api/faxInteraction/faxInteraction.model');db[_0x2c81('0x50')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x51'));db['FaxQueue']=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x52'));db['FaxQueueReport']=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x53'));db[_0x2c81('0x54')]=db['sequelize']['import'](_0x2c81('0x55'));db[_0x2c81('0x56')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x57'));db['SmsInteraction']=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x58'));db[_0x2c81('0x59')]=db['sequelize'][_0x2c81('0x13')](_0x2c81('0x5a'));db[_0x2c81('0x5b')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x5c'));db[_0x2c81('0x5d')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x5e'));db[_0x2c81('0x5f')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x60'));db[_0x2c81('0x61')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x62'));db[_0x2c81('0x63')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x64'));db[_0x2c81('0x65')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x66'));db[_0x2c81('0x67')]=db['sequelize'][_0x2c81('0x13')](_0x2c81('0x68'));db['OpenchannelQueueReport']=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x69'));db[_0x2c81('0x6a')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x6b'));db[_0x2c81('0x6c')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x6d'));db[_0x2c81('0x6e')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x6f'));db['ChatOfflineMessage']=db['sequelize'][_0x2c81('0x13')](_0x2c81('0x70'));db['ChatQueue']=db[_0x2c81('0x0')]['import']('../api/chatQueue/chatQueue.model');db[_0x2c81('0x71')]=db['sequelize'][_0x2c81('0x13')](_0x2c81('0x72'));db[_0x2c81('0x73')]=db['sequelize']['import']('../api/chatProactiveAction/chatProactiveAction.model');db['CmCompany']=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x74'));db[_0x2c81('0x75')]=db['sequelize'][_0x2c81('0x13')](_0x2c81('0x76'));db['CmHopper']=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x77'));db[_0x2c81('0x78')]=db[_0x2c81('0x0')]['import'](_0x2c81('0x79'));db['CmHopperFinal']=db['sequelize'][_0x2c81('0x13')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0x2c81('0x7a')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x7b'));db['ReportAgentPreview']=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x7c'));db[_0x2c81('0x7d')]=db[_0x2c81('0x0')][_0x2c81('0x13')]('../api/cmCustomField/cmCustomField.model');db[_0x2c81('0x7e')]=db[_0x2c81('0x0')]['import'](_0x2c81('0x7f'));db[_0x2c81('0x80')]=db[_0x2c81('0x0')]['import'](_0x2c81('0x81'));db[_0x2c81('0x82')]=db[_0x2c81('0x0')][_0x2c81('0x13')]('../api/cannedAnswer/cannedAnswer.model');db[_0x2c81('0x83')]=db[_0x2c81('0x0')]['import'](_0x2c81('0x84'));db[_0x2c81('0x85')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x86'));db['Interval']=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x87'));db[_0x2c81('0x88')]=db['sequelize'][_0x2c81('0x13')](_0x2c81('0x89'));db[_0x2c81('0x8a')]=db[_0x2c81('0x0')]['import'](_0x2c81('0x8b'));db['VoiceQueuesLog']=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x8c'));db[_0x2c81('0x8d')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x8e'));db[_0x2c81('0x8f')]=db['sequelize'][_0x2c81('0x13')](_0x2c81('0x90'));db[_0x2c81('0x91')]=db[_0x2c81('0x0')][_0x2c81('0x13')]('../api/tag/tag.model');db['ContactItemType']=db[_0x2c81('0x0')]['import'](_0x2c81('0x92'));db[_0x2c81('0x93')]=db[_0x2c81('0x0')][_0x2c81('0x13')]('../api/cmContactHasItem/cmContactHasItem.model');db[_0x2c81('0x94')]=db[_0x2c81('0x0')]['import'](_0x2c81('0x95'));db[_0x2c81('0x96')]=db['sequelize'][_0x2c81('0x13')](_0x2c81('0x97'));db[_0x2c81('0x98')]=db[_0x2c81('0x0')][_0x2c81('0x13')]('../api/trigger/trigger.model');db['Variable']=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x99'));db[_0x2c81('0x9a')]=db[_0x2c81('0x0')]['import']('../api/integration/integration.model');db[_0x2c81('0x9b')]=db['sequelize'][_0x2c81('0x13')](_0x2c81('0x9c'));db[_0x2c81('0x9d')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x9e'));db['AnalyticDefaultReport']=db[_0x2c81('0x0')][_0x2c81('0x13')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0x2c81('0x9f')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0xa0'));db[_0x2c81('0xa1')]=db['sequelize'][_0x2c81('0x13')]('../api/analyticMetric/analyticMetric.model');db[_0x2c81('0xa2')]=db['sequelize'][_0x2c81('0x13')](_0x2c81('0xa3'));db[_0x2c81('0xa4')]=db[_0x2c81('0x0')][_0x2c81('0x13')]('../api/analyticTreeReport/analyticTreeReport.model');db['SalesforceAccount']=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0xa5'));db[_0x2c81('0xa6')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0xa7'));db[_0x2c81('0xa8')]=db[_0x2c81('0x0')]['import'](_0x2c81('0xa9'));db[_0x2c81('0xaa')]=db[_0x2c81('0x0')][_0x2c81('0x13')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db['SugarcrmConfiguration']=db['sequelize'][_0x2c81('0x13')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0x2c81('0xab')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0xac'));db['DeskAccount']=db[_0x2c81('0x0')]['import'](_0x2c81('0xad'));db[_0x2c81('0xae')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0xaf'));db[_0x2c81('0xb0')]=db[_0x2c81('0x0')]['import']('../api/intDeskField/intDeskField.model');db[_0x2c81('0xb1')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0xb2'));db[_0x2c81('0xb3')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0xb4'));db[_0x2c81('0xb5')]=db[_0x2c81('0x0')]['import']('../api/intZohoField/intZohoField.model');db[_0x2c81('0xb6')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0xb7'));db[_0x2c81('0xb8')]=db[_0x2c81('0x0')]['import']('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0x2c81('0xb9')]=db['sequelize'][_0x2c81('0x13')](_0x2c81('0xba'));db[_0x2c81('0xbb')]=db[_0x2c81('0x0')][_0x2c81('0x13')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0xbc'));db['FreshdeskField']=db['sequelize'][_0x2c81('0x13')](_0x2c81('0xbd'));db['VtigerAccount']=db[_0x2c81('0x0')]['import'](_0x2c81('0xbe'));db[_0x2c81('0xbf')]=db[_0x2c81('0x0')][_0x2c81('0x13')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x2c81('0xc0')]=db['sequelize'][_0x2c81('0x13')](_0x2c81('0xc1'));db[_0x2c81('0xc2')]=db[_0x2c81('0x0')]['import'](_0x2c81('0xc3'));db[_0x2c81('0xc4')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0xc5'));db[_0x2c81('0xc6')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0xc7'));db[_0x2c81('0xc8')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0xc9'));db[_0x2c81('0xca')]=db[_0x2c81('0x0')][_0x2c81('0x13')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0x2c81('0xcb')]=db[_0x2c81('0x0')]['import'](_0x2c81('0xcc'));db[_0x2c81('0xcd')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0xce'));db[_0x2c81('0xcf')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0xd0'));db['FreshsalesField']=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0xd1'));db[_0x2c81('0x9a')]=db[_0x2c81('0x0')]['import']('../api/integration/integration.model');db['Network']=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0xd2'));db[_0x2c81('0xd3')]=db[_0x2c81('0x0')][_0x2c81('0x13')]('../api/chatQueueReport/chatQueueReport.model');db[_0x2c81('0xd4')]=db[_0x2c81('0x0')][_0x2c81('0x13')]('../api/chatInternalMessage/chatInternalMessage.model');db['JscriptyAnswerReport']=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0xd5'));db[_0x2c81('0xd6')]=db['sequelize'][_0x2c81('0x13')](_0x2c81('0xd7'));db[_0x2c81('0xd8')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0xd9'));db[_0x2c81('0xda')]=db['sequelize'][_0x2c81('0x13')](_0x2c81('0xdb'));db[_0x2c81('0xdc')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0xdd'));db[_0x2c81('0xde')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0xdf'));db[_0x2c81('0xe0')]=db['sequelize'][_0x2c81('0x13')]('../api/jscriptyProject/jscriptyProject.model');db[_0x2c81('0xe1')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0xe2'));db[_0x2c81('0xe3')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0xe4'));db[_0x2c81('0xe5')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0xe6'));db[_0x2c81('0xe7')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0xe8'));db[_0x2c81('0xe9')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0xea'));db[_0x2c81('0xeb')]=db['sequelize'][_0x2c81('0x13')]('../api/team/team.model');db[_0x2c81('0xec')]=db[_0x2c81('0x0')][_0x2c81('0x13')]('../api/license/license.model');db[_0x2c81('0xed')]=db['sequelize'][_0x2c81('0x13')](_0x2c81('0xee'));db['Migration']=db[_0x2c81('0x0')][_0x2c81('0x13')]('../api/migration/migration.model');db['Attachment']=db[_0x2c81('0x0')]['import']('../api/attachment/attachment.model');db[_0x2c81('0xef')]=db[_0x2c81('0x0')][_0x2c81('0x13')]('../api/plugin/plugin.model');db[_0x2c81('0xf0')]=db['sequelize'][_0x2c81('0x13')](_0x2c81('0xf1'));db['ChatTransferReport']=db[_0x2c81('0x0')][_0x2c81('0x13')]('../api/chatTransferReport/chatTransferReport.model');db[_0x2c81('0xf2')]=db['sequelize'][_0x2c81('0x13')](_0x2c81('0xf3'));db[_0x2c81('0xf4')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0xf5'));db[_0x2c81('0xf6')]=db['sequelize'][_0x2c81('0x13')](_0x2c81('0xf7'));db[_0x2c81('0xf8')]=db['sequelize'][_0x2c81('0x13')](_0x2c81('0xf9'));db[_0x2c81('0xfa')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0xfb'));db['UserProfile']=db['sequelize'][_0x2c81('0x13')](_0x2c81('0xfc'));db[_0x2c81('0xfd')]=db['sequelize'][_0x2c81('0x13')](_0x2c81('0xfe'));db['UserProfileResource']=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0xff'));db[_0x2c81('0x100')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x101'));db[_0x2c81('0x102')]=db['sequelize']['import'](_0x2c81('0x103'));db[_0x2c81('0x104')]=db[_0x2c81('0x0')][_0x2c81('0x13')]('../api/whatsappApplication/whatsappApplication.model');db[_0x2c81('0x105')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x106'));db[_0x2c81('0x107')]=db[_0x2c81('0x0')]['import'](_0x2c81('0x108'));db[_0x2c81('0x109')]=db[_0x2c81('0x0')]['import'](_0x2c81('0x10a'));db[_0x2c81('0x10b')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x10c'));db[_0x2c81('0x10d')]=db[_0x2c81('0x0')][_0x2c81('0x13')](_0x2c81('0x10e'));db[_0x2c81('0x10f')]=db['sequelize'][_0x2c81('0x13')]('../api/cloudProvider/cloudProvider.model');db[_0x2c81('0x110')]=db[_0x2c81('0x0')][_0x2c81('0x13')]('../api/teamVoiceQueue/teamVoiceQueue.model');db[_0x2c81('0x111')]=db['sequelize']['import'](_0x2c81('0x112'));db[_0x2c81('0x113')]=db['sequelize'][_0x2c81('0x13')](_0x2c81('0x114'));db[_0x2c81('0x115')]=db['sequelize']['import'](_0x2c81('0x116'));db[_0x2c81('0x12')][_0x2c81('0x117')](db['VoiceMail'],{'as':_0x2c81('0x1d'),'onDelete':_0x2c81('0x118'),'foreignKey':'UserId'});db[_0x2c81('0x12')][_0x2c81('0x117')](db[_0x2c81('0x115')],{'as':_0x2c81('0x119'),'onDelete':_0x2c81('0x118'),'foreignKey':_0x2c81('0x11a')});db['User'][_0x2c81('0x11b')](db['VoiceRecording'],{'as':_0x2c81('0x11c'),'foreignKey':'UserId'});db[_0x2c81('0x12')]['hasMany'](db['UserVoiceQueueRt'],{'as':_0x2c81('0x11d'),'foreignKey':_0x2c81('0x11a')});db['User'][_0x2c81('0x11b')](db['VoiceExtension'],{'as':_0x2c81('0x11e'),'onDelete':'cascade','hooks':!![]});db[_0x2c81('0x12')][_0x2c81('0x11b')](db[_0x2c81('0x11f')],{'as':_0x2c81('0x120'),'foreignKey':_0x2c81('0x11a')});db[_0x2c81('0x12')][_0x2c81('0x11b')](db['CmHopperHistory'],{'as':_0x2c81('0x121'),'foreignKey':_0x2c81('0x11a')});db[_0x2c81('0x12')][_0x2c81('0x11b')](db['ReportAgentPreview'],{'as':_0x2c81('0x122'),'foreignKey':_0x2c81('0x11a')});db[_0x2c81('0x12')][_0x2c81('0x11b')](db[_0x2c81('0x61')],{'as':_0x2c81('0x123'),'foreignKey':'UserId'});db['User'][_0x2c81('0x11b')](db['ChatInteraction'],{'as':_0x2c81('0x124'),'foreignKey':_0x2c81('0x11a')});db[_0x2c81('0x12')][_0x2c81('0x11b')](db['SmsInteraction'],{'as':_0x2c81('0x125'),'foreignKey':_0x2c81('0x11a')});db[_0x2c81('0x12')]['hasMany'](db[_0x2c81('0x4f')],{'as':_0x2c81('0x126'),'foreignKey':'UserId'});db['User'][_0x2c81('0x11b')](db['MailInteraction'],{'as':_0x2c81('0x127'),'foreignKey':_0x2c81('0x11a')});db[_0x2c81('0x12')]['hasMany'](db['WhatsappInteraction'],{'as':_0x2c81('0x128'),'foreignKey':_0x2c81('0x11a')});db[_0x2c81('0x12')][_0x2c81('0x11b')](db[_0x2c81('0x100')],{'as':_0x2c81('0x129'),'foreignKey':_0x2c81('0x12a')});db['User'][_0x2c81('0x11b')](db[_0x2c81('0x12b')],{'as':_0x2c81('0x12c'),'foreignKey':_0x2c81('0x11a'),'onDelete':_0x2c81('0x12d')});db['User']['belongsTo'](db[_0x2c81('0x12e')],{'as':_0x2c81('0x12e'),'foreignKey':_0x2c81('0x12f')});db[_0x2c81('0x12')][_0x2c81('0x130')](db[_0x2c81('0x71')],{'as':_0x2c81('0x131'),'through':_0x2c81('0x132')});db['User'][_0x2c81('0x130')](db[_0x2c81('0x75')],{'as':'Contacts','through':_0x2c81('0x133')});db['User'][_0x2c81('0x130')](db[_0x2c81('0xf8')],{'as':_0x2c81('0x134'),'through':_0x2c81('0x135')});db[_0x2c81('0x12')]['belongsToMany'](db['Team'],{'through':_0x2c81('0x136')});db['User'][_0x2c81('0x130')](db[_0x2c81('0x40')],{'as':_0x2c81('0x127'),'through':_0x2c81('0x137')});db[_0x2c81('0x12')]['belongsToMany'](db[_0x2c81('0x6c')],{'as':_0x2c81('0x124'),'through':_0x2c81('0x138')});db[_0x2c81('0x12')]['belongsToMany'](db[_0x2c81('0x4f')],{'as':_0x2c81('0x126'),'through':_0x2c81('0x139')});db[_0x2c81('0x12')]['belongsToMany'](db['SmsInteraction'],{'as':_0x2c81('0x125'),'through':'user_has_sms_interactions'});db[_0x2c81('0x12')][_0x2c81('0x130')](db[_0x2c81('0x61')],{'as':_0x2c81('0x123'),'through':_0x2c81('0x13a')});db[_0x2c81('0x12')][_0x2c81('0x130')](db['WhatsappInteraction'],{'as':_0x2c81('0x128'),'through':_0x2c81('0x13b')});db[_0x2c81('0x12')]['belongsToMany'](db[_0x2c81('0x13c')],{'as':_0x2c81('0x13d'),'through':_0x2c81('0x2e'),'required':![]});db[_0x2c81('0x12')][_0x2c81('0x130')](db['VoicePrefix'],{'as':_0x2c81('0x13e'),'through':'UserVoicePrefix','required':![]});db[_0x2c81('0x12')][_0x2c81('0x130')](db[_0x2c81('0x3d')],{'as':_0x2c81('0x13f'),'through':_0x2c81('0x30'),'required':![]});db[_0x2c81('0x12')]['belongsToMany'](db['ChatQueue'],{'as':_0x2c81('0x140'),'through':_0x2c81('0x2f'),'required':![],'hooks':!![]});db[_0x2c81('0x12')][_0x2c81('0x130')](db[_0x2c81('0x141')],{'as':'FaxQueues','through':_0x2c81('0x32'),'required':![]});db[_0x2c81('0x12')][_0x2c81('0x130')](db[_0x2c81('0x5b')],{'as':_0x2c81('0x142'),'through':_0x2c81('0x34'),'required':![]});db['User'][_0x2c81('0x130')](db['OpenchannelQueue'],{'as':_0x2c81('0x143'),'through':'UserOpenchannelQueue','required':![]});db['User'][_0x2c81('0x130')](db[_0x2c81('0x10d')],{'as':_0x2c81('0x144'),'through':_0x2c81('0x37'),'required':![]});db[_0x2c81('0x12')]['belongsToMany'](db['CmList'],{'through':_0x2c81('0x135')});db[_0x2c81('0x12')]['belongsToMany'](db[_0x2c81('0x67')],{'as':_0x2c81('0x145'),'through':_0x2c81('0x146')});db[_0x2c81('0x12')][_0x2c81('0x130')](db[_0x2c81('0x4c')],{'as':_0x2c81('0x147'),'through':_0x2c81('0x148')});db[_0x2c81('0x12')]['belongsToMany'](db[_0x2c81('0x3c')],{'as':_0x2c81('0x149'),'through':_0x2c81('0x14a')});db[_0x2c81('0x12')][_0x2c81('0x130')](db['OpenchannelAccount'],{'as':'OpenchannelAccounts','through':_0x2c81('0x14b')});db[_0x2c81('0x12')]['belongsToMany'](db[_0x2c81('0x54')],{'as':_0x2c81('0x14c'),'through':_0x2c81('0x14d')});db[_0x2c81('0x12')][_0x2c81('0x130')](db['WhatsappAccount'],{'as':'WhatsappAccounts','through':_0x2c81('0x14e')});db[_0x2c81('0x14f')][_0x2c81('0x11b')](db[_0x2c81('0x150')],{'as':_0x2c81('0x151'),'onDelete':_0x2c81('0x118'),'foreignKey':_0x2c81('0x152')});db['VoiceContext'][_0x2c81('0x11b')](db[_0x2c81('0x150')],{'onDelete':'cascade'});db[_0x2c81('0x150')]['hasMany'](db[_0x2c81('0x150')],{'as':_0x2c81('0x153'),'onDelete':_0x2c81('0x118')});db[_0x2c81('0x154')][_0x2c81('0x130')](db['Sound'],{'as':_0x2c81('0x155'),'through':_0x2c81('0x156')});db['VoiceQueue'][_0x2c81('0x11b')](db[_0x2c81('0x2d')],{'as':_0x2c81('0x157'),'foreignKey':'VoiceQueueId'});db[_0x2c81('0x13c')][_0x2c81('0x11b')](db[_0x2c81('0x12b')],{'as':_0x2c81('0x12c'),'foreignKey':_0x2c81('0x158')});db['VoiceQueue']['hasMany'](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x2c81('0x158')});db[_0x2c81('0x13c')]['hasMany'](db[_0x2c81('0x7a')],{'as':_0x2c81('0x159'),'foreignKey':'VoiceQueueId'});db[_0x2c81('0x13c')][_0x2c81('0x11b')](db[_0x2c81('0x122')],{'as':_0x2c81('0x122'),'foreignKey':_0x2c81('0x158')});db[_0x2c81('0x13c')][_0x2c81('0x11b')](db['CmHopperBlack'],{'as':_0x2c81('0x15a'),'foreignKey':_0x2c81('0x158')});db['VoiceQueue'][_0x2c81('0x11b')](db['JscriptySessionReport'],{'as':_0x2c81('0x15b'),'foreignKey':_0x2c81('0x158')});db[_0x2c81('0x13c')][_0x2c81('0x15c')](db[_0x2c81('0x15d')],{'as':_0x2c81('0x15d'),'foreignKey':_0x2c81('0x15e')});db['VoiceQueue']['belongsTo'](db[_0x2c81('0x15d')],{'as':_0x2c81('0x15f'),'foreignKey':'TrunkBackupId'});db[_0x2c81('0x13c')][_0x2c81('0x15c')](db[_0x2c81('0x160')],{'as':'Interval','foreignKey':_0x2c81('0x161')});db[_0x2c81('0x13c')][_0x2c81('0x15c')](db[_0x2c81('0x88')],{'as':_0x2c81('0x162'),'foreignKey':_0x2c81('0x163')});db[_0x2c81('0x13c')]['belongsToMany'](db[_0x2c81('0xf8')],{'as':_0x2c81('0x134'),'through':_0x2c81('0x164')});db[_0x2c81('0x13c')][_0x2c81('0x130')](db[_0x2c81('0x12')],{'as':_0x2c81('0x165'),'through':'UserVoiceQueue'});db[_0x2c81('0x13c')][_0x2c81('0x130')](db[_0x2c81('0xeb')],{'as':_0x2c81('0x166'),'through':_0x2c81('0x110')});db[_0x2c81('0x13c')][_0x2c81('0x130')](db['CmList'],{'as':'BlackLists','through':_0x2c81('0x167')});db['VoiceRecording'][_0x2c81('0x15c')](db[_0x2c81('0x12')],{'as':_0x2c81('0x12'),'foreignKey':_0x2c81('0x11a')});db['ScreenRecording']['belongsTo'](db['User'],{'as':_0x2c81('0x12'),'foreignKey':_0x2c81('0x11a')});db['VoiceMail']['hasMany'](db[_0x2c81('0x1f')],{'as':_0x2c81('0x168'),'onDelete':_0x2c81('0x118'),'foreignKey':_0x2c81('0x169'),'sourceKey':_0x2c81('0x16a')});db[_0x2c81('0x1f')][_0x2c81('0x15c')](db[_0x2c81('0x1d')],{'foreignKey':'mailboxuser','targetKey':_0x2c81('0x16a')});db[_0x2c81('0x21')][_0x2c81('0x11b')](db[_0x2c81('0x27')],{'as':_0x2c81('0x16b'),'foreignKey':'uniqueid','constraints':![]});db[_0x2c81('0x21')][_0x2c81('0x11b')](db[_0x2c81('0x25')],{'as':_0x2c81('0x16c'),'foreignKey':_0x2c81('0x16d'),'constraints':![]});db['VoiceCallReport']['belongsTo'](db[_0x2c81('0x12')],{'as':_0x2c81('0x12'),'foreignKey':_0x2c81('0x11a')});db[_0x2c81('0x21')][_0x2c81('0x15c')](db[_0x2c81('0x75')],{'as':'Contact','foreignKey':_0x2c81('0x16e')});db[_0x2c81('0x39')][_0x2c81('0x15c')](db[_0x2c81('0x3c')],{'as':_0x2c81('0x3c'),'foreignKey':_0x2c81('0x16f')});db[_0x2c81('0x39')]['belongsTo'](db[_0x2c81('0x10f')],{'as':_0x2c81('0x10f'),'foreignKey':_0x2c81('0x170'),'onDelete':_0x2c81('0x171')});db[_0x2c81('0x172')][_0x2c81('0x15c')](db[_0x2c81('0x3c')],{'as':_0x2c81('0x3c'),'foreignKey':_0x2c81('0x16f')});db['MailServerOut'][_0x2c81('0x15c')](db[_0x2c81('0x10f')],{'as':'CloudProvider','foreignKey':_0x2c81('0x170'),'onDelete':_0x2c81('0x171')});db[_0x2c81('0x3c')][_0x2c81('0x117')](db[_0x2c81('0x39')],{'as':_0x2c81('0x173'),'onDelete':_0x2c81('0x118')});db[_0x2c81('0x3c')][_0x2c81('0x117')](db[_0x2c81('0x172')],{'as':_0x2c81('0x174'),'onDelete':_0x2c81('0x118')});db['MailAccount']['hasMany'](db[_0x2c81('0x83')],{'as':'Dispositions','foreignKey':_0x2c81('0x16f'),'onDelete':_0x2c81('0x118')});db['MailAccount'][_0x2c81('0x11b')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x2c81('0x16f')});db['MailAccount'][_0x2c81('0x11b')](db[_0x2c81('0x42')],{'as':'Messages','foreignKey':'MailAccountId'});db[_0x2c81('0x3c')][_0x2c81('0x11b')](db['MailInteraction'],{'as':'Interactions'});db['MailAccount'][_0x2c81('0x11b')](db[_0x2c81('0x44')],{'as':_0x2c81('0x153'),'foreignKey':'MailAccountId','onDelete':_0x2c81('0x118')});db[_0x2c81('0x3c')][_0x2c81('0x15c')](db[_0x2c81('0xf8')],{'as':_0x2c81('0x175'),'foreignKey':'ListId'});db[_0x2c81('0x3c')][_0x2c81('0x15c')](db[_0x2c81('0x96')],{'as':_0x2c81('0x96'),'foreignKey':_0x2c81('0x176')});db[_0x2c81('0x3c')][_0x2c81('0x15c')](db[_0x2c81('0x88')],{'as':_0x2c81('0x162'),'foreignKey':_0x2c81('0x163')});db['MailAccount'][_0x2c81('0x130')](db[_0x2c81('0x12')],{'as':_0x2c81('0x165'),'through':_0x2c81('0x14a')});db[_0x2c81('0x3d')][_0x2c81('0x130')](db[_0x2c81('0x12')],{'as':_0x2c81('0x165'),'through':_0x2c81('0x30')});db['MailQueue'][_0x2c81('0x130')](db[_0x2c81('0xeb')],{'through':_0x2c81('0x177'),'as':_0x2c81('0x166')});db[_0x2c81('0x40')][_0x2c81('0x11b')](db[_0x2c81('0x42')],{'as':_0x2c81('0x168'),'onDelete':_0x2c81('0x118'),'foreignKey':_0x2c81('0x178')});db[_0x2c81('0x40')][_0x2c81('0x15c')](db[_0x2c81('0x3c')],{'as':'Account','foreignKey':_0x2c81('0x16f')});db[_0x2c81('0x40')][_0x2c81('0x15c')](db[_0x2c81('0x75')],{'as':'Contact','foreignKey':_0x2c81('0x16e')});db[_0x2c81('0x40')][_0x2c81('0x15c')](db[_0x2c81('0x12')],{'as':_0x2c81('0x179'),'foreignKey':'UserId'});db[_0x2c81('0x40')]['belongsToMany'](db[_0x2c81('0x91')],{'through':_0x2c81('0x17a'),'as':_0x2c81('0x17b')});db[_0x2c81('0x40')]['belongsToMany'](db[_0x2c81('0x91')],{'through':_0x2c81('0x17a'),'as':_0x2c81('0x17c')});db[_0x2c81('0x40')][_0x2c81('0x130')](db['User'],{'as':_0x2c81('0x17d'),'through':_0x2c81('0x137'),'foreignKey':_0x2c81('0x178')});db[_0x2c81('0x42')]['hasMany'](db[_0x2c81('0x17e')],{'as':_0x2c81('0x17f'),'onDelete':_0x2c81('0x118')});db[_0x2c81('0x42')]['belongsTo'](db[_0x2c81('0x12')],{'as':_0x2c81('0x12')});db[_0x2c81('0x42')][_0x2c81('0x15c')](db[_0x2c81('0x75')],{'onDelete':_0x2c81('0x118'),'as':_0x2c81('0x180')});db[_0x2c81('0x42')][_0x2c81('0x15c')](db['MailInteraction'],{'as':_0x2c81('0x181'),'foreignKey':_0x2c81('0x178')});db[_0x2c81('0x42')][_0x2c81('0x15c')](db[_0x2c81('0x3c')],{'as':'Account','foreignKey':_0x2c81('0x16f')});db[_0x2c81('0x42')][_0x2c81('0x15c')](db[_0x2c81('0x67')],{'as':_0x2c81('0x67'),'foreignKey':_0x2c81('0x182')});db[_0x2c81('0x42')][_0x2c81('0x15c')](db[_0x2c81('0x183')],{'as':_0x2c81('0x183'),'foreignKey':_0x2c81('0x184')});db[_0x2c81('0x44')][_0x2c81('0x15c')](db['User'],{'onDelete':'restrict'});db[_0x2c81('0x44')][_0x2c81('0x15c')](db[_0x2c81('0x3d')],{'onDelete':'restrict'});db[_0x2c81('0x44')]['belongsTo'](db[_0x2c81('0x3c')],{'onDelete':_0x2c81('0x171')});db[_0x2c81('0x44')][_0x2c81('0x15c')](db['Interval'],{'onDelete':'restrict','foreignKey':_0x2c81('0x161')});db[_0x2c81('0x44')][_0x2c81('0x15c')](db[_0x2c81('0x91')],{'onDelete':_0x2c81('0x171'),'foreignKey':_0x2c81('0x185')});db[_0x2c81('0x46')][_0x2c81('0x15c')](db[_0x2c81('0x3c')],{});db[_0x2c81('0x46')][_0x2c81('0x15c')](db[_0x2c81('0xf8')],{'as':_0x2c81('0x175'),'foreignKey':_0x2c81('0x186')});db[_0x2c81('0x46')][_0x2c81('0x15c')](db[_0x2c81('0x75')],{'as':'Contact','foreignKey':_0x2c81('0x16e')});db[_0x2c81('0x46')][_0x2c81('0x15c')](db[_0x2c81('0x40')],{});db[_0x2c81('0x46')]['belongsTo'](db['MailMessage'],{});db['MailQueueReport'][_0x2c81('0x15c')](db['User'],{});db['MailQueueReport'][_0x2c81('0x15c')](db[_0x2c81('0x3d')],{});db['Dashboard']['hasMany'](db[_0x2c81('0x4a')],{'as':_0x2c81('0x187'),'onDelete':_0x2c81('0x118')});db[_0x2c81('0x4c')][_0x2c81('0x11b')](db[_0x2c81('0x83')],{'as':_0x2c81('0x188'),'foreignKey':'FaxAccountId','onDelete':_0x2c81('0x118')});db[_0x2c81('0x4c')][_0x2c81('0x11b')](db[_0x2c81('0x82')],{'as':_0x2c81('0x189'),'foreignKey':_0x2c81('0x18a')});db[_0x2c81('0x4c')][_0x2c81('0x11b')](db[_0x2c81('0x4f')],{'as':_0x2c81('0x18b')});db[_0x2c81('0x4c')][_0x2c81('0x11b')](db['FaxApplication'],{'as':_0x2c81('0x153'),'foreignKey':_0x2c81('0x18a'),'onDelete':'cascade'});db[_0x2c81('0x4c')][_0x2c81('0x11b')](db['VoiceExtension'],{'as':_0x2c81('0x18c'),'onDelete':_0x2c81('0x118')});db[_0x2c81('0x4c')]['hasMany'](db[_0x2c81('0x50')],{'as':'Messages'});db[_0x2c81('0x4c')][_0x2c81('0x15c')](db['Trunk'],{'as':_0x2c81('0x15d')});db['FaxAccount'][_0x2c81('0x15c')](db[_0x2c81('0xf8')],{'as':_0x2c81('0x175'),'foreignKey':_0x2c81('0x186')});db[_0x2c81('0x4c')][_0x2c81('0x15c')](db[_0x2c81('0x88')],{'as':_0x2c81('0x162'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x2c81('0x4c')][_0x2c81('0x130')](db['User'],{'as':_0x2c81('0x165'),'through':'user_has_fax_accounts'});db[_0x2c81('0x18d')][_0x2c81('0x15c')](db[_0x2c81('0x12')],{'onDelete':_0x2c81('0x171')});db[_0x2c81('0x18d')]['belongsTo'](db[_0x2c81('0x141')],{'onDelete':_0x2c81('0x171')});db[_0x2c81('0x18d')][_0x2c81('0x15c')](db[_0x2c81('0x4c')],{'onDelete':'restrict'});db[_0x2c81('0x18d')][_0x2c81('0x15c')](db[_0x2c81('0x91')],{'onDelete':_0x2c81('0x171'),'foreignKey':'TagId'});db['FaxInteraction']['hasMany'](db[_0x2c81('0x50')],{'as':_0x2c81('0x168'),'onDelete':_0x2c81('0x118'),'foreignKey':_0x2c81('0x18e')});db[_0x2c81('0x4f')][_0x2c81('0x15c')](db[_0x2c81('0x4c')],{'as':_0x2c81('0x18f'),'foreignKey':_0x2c81('0x18a')});db['FaxInteraction'][_0x2c81('0x15c')](db['CmContact'],{'as':_0x2c81('0x180'),'foreignKey':_0x2c81('0x16e')});db[_0x2c81('0x4f')][_0x2c81('0x15c')](db[_0x2c81('0x12')],{'as':'Owner','foreignKey':_0x2c81('0x11a')});db[_0x2c81('0x4f')][_0x2c81('0x130')](db[_0x2c81('0x91')],{'through':_0x2c81('0x190'),'as':_0x2c81('0x17b')});db[_0x2c81('0x4f')][_0x2c81('0x130')](db['Tag'],{'through':_0x2c81('0x190'),'as':_0x2c81('0x17c')});db[_0x2c81('0x4f')][_0x2c81('0x130')](db['User'],{'as':_0x2c81('0x17d'),'through':_0x2c81('0x139'),'foreignKey':_0x2c81('0x18e')});db['FaxMessage'][_0x2c81('0x15c')](db[_0x2c81('0x12')],{'onDelete':_0x2c81('0x118'),'as':'User'});db[_0x2c81('0x50')][_0x2c81('0x15c')](db[_0x2c81('0x4f')],{'as':_0x2c81('0x181'),'foreignKey':_0x2c81('0x18e')});db[_0x2c81('0x50')][_0x2c81('0x15c')](db[_0x2c81('0x75')],{'onDelete':'cascade','as':_0x2c81('0x180')});db[_0x2c81('0x50')][_0x2c81('0x15c')](db['Attachment'],{'as':_0x2c81('0x17e'),'foreignKey':_0x2c81('0x191')});db[_0x2c81('0x50')][_0x2c81('0x15c')](db[_0x2c81('0x4c')],{'as':_0x2c81('0x18f'),'foreignKey':_0x2c81('0x18a')});db[_0x2c81('0x141')][_0x2c81('0x130')](db[_0x2c81('0x12')],{'as':_0x2c81('0x165'),'through':_0x2c81('0x32')});db[_0x2c81('0x141')]['belongsToMany'](db[_0x2c81('0xeb')],{'through':_0x2c81('0x192'),'as':_0x2c81('0x166')});db[_0x2c81('0x193')]['belongsTo'](db[_0x2c81('0x4c')],{});db[_0x2c81('0x193')]['belongsTo'](db[_0x2c81('0xf8')],{'as':_0x2c81('0x175'),'foreignKey':_0x2c81('0x186')});db[_0x2c81('0x193')][_0x2c81('0x15c')](db['CmContact'],{'as':_0x2c81('0x180'),'foreignKey':_0x2c81('0x16e')});db[_0x2c81('0x193')][_0x2c81('0x15c')](db[_0x2c81('0x4f')],{});db[_0x2c81('0x193')][_0x2c81('0x15c')](db[_0x2c81('0x50')],{});db['FaxQueueReport'][_0x2c81('0x15c')](db[_0x2c81('0x12')],{});db[_0x2c81('0x193')][_0x2c81('0x15c')](db[_0x2c81('0x141')],{});db['SmsAccount'][_0x2c81('0x11b')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x2c81('0x194'),'onDelete':'cascade'});db[_0x2c81('0x54')]['hasMany'](db[_0x2c81('0x82')],{'as':_0x2c81('0x189'),'foreignKey':_0x2c81('0x194')});db[_0x2c81('0x54')][_0x2c81('0x11b')](db[_0x2c81('0x59')],{'as':'Messages','foreignKey':'SmsAccountId'});db[_0x2c81('0x54')][_0x2c81('0x11b')](db[_0x2c81('0x195')],{'as':_0x2c81('0x18b')});db['SmsAccount'][_0x2c81('0x11b')](db[_0x2c81('0x56')],{'as':_0x2c81('0x153'),'foreignKey':_0x2c81('0x194'),'onDelete':_0x2c81('0x118')});db[_0x2c81('0x54')][_0x2c81('0x15c')](db[_0x2c81('0xf8')],{'as':'List','foreignKey':_0x2c81('0x186')});db['SmsAccount'][_0x2c81('0x15c')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x2c81('0x54')][_0x2c81('0x130')](db[_0x2c81('0x12')],{'as':'Agents','through':_0x2c81('0x14d')});db[_0x2c81('0x56')][_0x2c81('0x15c')](db['User'],{'onDelete':_0x2c81('0x171')});db[_0x2c81('0x56')][_0x2c81('0x15c')](db[_0x2c81('0x5b')],{'onDelete':_0x2c81('0x171')});db[_0x2c81('0x56')]['belongsTo'](db[_0x2c81('0x54')],{'onDelete':'restrict'});db[_0x2c81('0x56')][_0x2c81('0x15c')](db['Interval'],{'onDelete':_0x2c81('0x171'),'foreignKey':_0x2c81('0x161')});db[_0x2c81('0x56')][_0x2c81('0x15c')](db[_0x2c81('0x91')],{'onDelete':'restrict','foreignKey':_0x2c81('0x185')});db[_0x2c81('0x195')][_0x2c81('0x11b')](db[_0x2c81('0x59')],{'as':_0x2c81('0x168'),'onDelete':'cascade','foreignKey':_0x2c81('0x196')});db[_0x2c81('0x195')][_0x2c81('0x15c')](db[_0x2c81('0x54')],{'as':_0x2c81('0x18f'),'foreignKey':_0x2c81('0x194')});db[_0x2c81('0x195')][_0x2c81('0x15c')](db[_0x2c81('0x75')],{'as':_0x2c81('0x180'),'foreignKey':_0x2c81('0x16e')});db[_0x2c81('0x195')][_0x2c81('0x15c')](db[_0x2c81('0x12')],{'as':'Owner','foreignKey':_0x2c81('0x11a')});db[_0x2c81('0x195')][_0x2c81('0x130')](db[_0x2c81('0x91')],{'through':'sms_interaction_has_tags','as':_0x2c81('0x17b')});db[_0x2c81('0x195')][_0x2c81('0x130')](db[_0x2c81('0x91')],{'through':_0x2c81('0x197'),'as':_0x2c81('0x17c')});db[_0x2c81('0x195')]['belongsToMany'](db[_0x2c81('0x12')],{'as':_0x2c81('0x17d'),'through':_0x2c81('0x198'),'foreignKey':_0x2c81('0x196')});db[_0x2c81('0x59')][_0x2c81('0x15c')](db[_0x2c81('0x12')],{'as':'User'});db[_0x2c81('0x59')]['belongsTo'](db[_0x2c81('0x75')],{'onDelete':_0x2c81('0x118'),'as':_0x2c81('0x180')});db[_0x2c81('0x59')][_0x2c81('0x15c')](db['SmsInteraction'],{'onDelete':'cascade','as':_0x2c81('0x181'),'foreignKey':_0x2c81('0x196')});db[_0x2c81('0x59')][_0x2c81('0x15c')](db[_0x2c81('0x54')],{'as':_0x2c81('0x18f'),'foreignKey':'SmsAccountId'});db[_0x2c81('0x5b')][_0x2c81('0x130')](db[_0x2c81('0x12')],{'as':_0x2c81('0x165'),'through':_0x2c81('0x34'),'foreignKey':_0x2c81('0x199')});db[_0x2c81('0x5b')][_0x2c81('0x130')](db[_0x2c81('0xeb')],{'through':_0x2c81('0x19a'),'as':_0x2c81('0x166')});db[_0x2c81('0x5d')]['hasMany'](db['Disposition'],{'as':_0x2c81('0x188'),'foreignKey':_0x2c81('0x19b'),'onDelete':'cascade'});db['OpenchannelAccount'][_0x2c81('0x11b')](db[_0x2c81('0x82')],{'as':_0x2c81('0x189'),'foreignKey':_0x2c81('0x19b')});db[_0x2c81('0x5d')][_0x2c81('0x11b')](db['OpenchannelInteraction'],{'as':_0x2c81('0x18b'),'foreignKey':'OpenchannelAccountId'});db[_0x2c81('0x5d')][_0x2c81('0x11b')](db[_0x2c81('0x63')],{'as':'Messages','foreignKey':'OpenchannelAccountId'});db[_0x2c81('0x5d')][_0x2c81('0x11b')](db[_0x2c81('0x5f')],{'as':'Applications','foreignKey':_0x2c81('0x19b'),'onDelete':_0x2c81('0x118')});db[_0x2c81('0x5d')][_0x2c81('0x15c')](db[_0x2c81('0xf8')],{'as':_0x2c81('0x175'),'foreignKey':_0x2c81('0x186')});db['OpenchannelAccount'][_0x2c81('0x15c')](db[_0x2c81('0x88')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x2c81('0x5d')][_0x2c81('0x130')](db[_0x2c81('0x12')],{'as':'Agents','through':_0x2c81('0x14b')});db['OpenchannelApplication'][_0x2c81('0x15c')](db[_0x2c81('0x12')],{'onDelete':_0x2c81('0x171')});db['OpenchannelApplication'][_0x2c81('0x15c')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':'OpenchannelQueueId'});db['OpenchannelApplication'][_0x2c81('0x15c')](db[_0x2c81('0x5d')],{'onDelete':_0x2c81('0x171'),'foreignKey':_0x2c81('0x19b')});db[_0x2c81('0x5f')][_0x2c81('0x15c')](db[_0x2c81('0x160')],{'onDelete':_0x2c81('0x171'),'foreignKey':_0x2c81('0x161')});db['OpenchannelApplication'][_0x2c81('0x15c')](db[_0x2c81('0x91')],{'onDelete':_0x2c81('0x171'),'foreignKey':'TagId'});db['OpenchannelInteraction'][_0x2c81('0x11b')](db[_0x2c81('0x63')],{'as':_0x2c81('0x168'),'onDelete':_0x2c81('0x118'),'foreignKey':_0x2c81('0x19c')});db[_0x2c81('0x61')]['belongsTo'](db[_0x2c81('0x5d')],{'as':'Account','foreignKey':_0x2c81('0x19b')});db['OpenchannelInteraction'][_0x2c81('0x15c')](db[_0x2c81('0x75')],{'as':_0x2c81('0x180'),'foreignKey':'ContactId'});db['OpenchannelInteraction']['belongsTo'](db[_0x2c81('0x12')],{'as':'Owner','foreignKey':'UserId'});db[_0x2c81('0x61')]['belongsToMany'](db[_0x2c81('0x91')],{'through':_0x2c81('0x19d'),'as':_0x2c81('0x17b')});db['OpenchannelInteraction'][_0x2c81('0x130')](db[_0x2c81('0x91')],{'through':_0x2c81('0x19d'),'as':'ThroughTags'});db[_0x2c81('0x61')][_0x2c81('0x130')](db[_0x2c81('0x12')],{'as':_0x2c81('0x17d'),'through':_0x2c81('0x13a'),'foreignKey':_0x2c81('0x19c')});db[_0x2c81('0x63')][_0x2c81('0x15c')](db[_0x2c81('0x12')],{'onDelete':_0x2c81('0x118'),'as':_0x2c81('0x12')});db[_0x2c81('0x63')]['belongsTo'](db['CmContact'],{'onDelete':_0x2c81('0x118'),'as':_0x2c81('0x180')});db['OpenchannelMessage'][_0x2c81('0x15c')](db[_0x2c81('0x61')],{'onDelete':_0x2c81('0x118'),'as':_0x2c81('0x181'),'foreignKey':_0x2c81('0x19c')});db['OpenchannelMessage'][_0x2c81('0x15c')](db[_0x2c81('0x17e')],{'as':_0x2c81('0x17e'),'foreignKey':_0x2c81('0x191')});db[_0x2c81('0x63')][_0x2c81('0x15c')](db[_0x2c81('0x5d')],{'as':_0x2c81('0x18f'),'foreignKey':_0x2c81('0x19b')});db[_0x2c81('0x65')][_0x2c81('0x130')](db[_0x2c81('0x12')],{'as':_0x2c81('0x165'),'through':_0x2c81('0x19e'),'foreignKey':_0x2c81('0x19f')});db[_0x2c81('0x65')][_0x2c81('0x130')](db[_0x2c81('0xeb')],{'through':_0x2c81('0x1a0'),'as':_0x2c81('0x166')});db[_0x2c81('0x67')][_0x2c81('0x11b')](db[_0x2c81('0x83')],{'as':_0x2c81('0x188'),'foreignKey':'ChatWebsiteId','onDelete':_0x2c81('0x118')});db['ChatWebsite'][_0x2c81('0x11b')](db[_0x2c81('0x82')],{'as':_0x2c81('0x189'),'foreignKey':_0x2c81('0x182')});db['ChatWebsite'][_0x2c81('0x11b')](db[_0x2c81('0x73')],{'as':_0x2c81('0x1a1')});db[_0x2c81('0x67')][_0x2c81('0x11b')](db['ChatInteraction'],{'as':'Interactions'});db[_0x2c81('0x67')][_0x2c81('0x11b')](db[_0x2c81('0x6a')],{'as':_0x2c81('0x153'),'foreignKey':_0x2c81('0x182'),'onDelete':_0x2c81('0x118')});db['ChatWebsite'][_0x2c81('0x11b')](db['ChatMessage'],{'as':_0x2c81('0x168')});db[_0x2c81('0x67')][_0x2c81('0x15c')](db['CmList'],{'as':_0x2c81('0x175'),'foreignKey':_0x2c81('0x186')});db[_0x2c81('0x67')]['belongsTo'](db[_0x2c81('0x160')],{'as':_0x2c81('0x160'),'foreignKey':_0x2c81('0x161')});db['ChatWebsite'][_0x2c81('0x15c')](db[_0x2c81('0x3c')],{'as':_0x2c81('0x3c'),'foreignKey':_0x2c81('0x16f')});db[_0x2c81('0x67')]['belongsTo'](db[_0x2c81('0x88')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db['ChatWebsite']['belongsToMany'](db['User'],{'as':'Agents','through':_0x2c81('0x146')});db[_0x2c81('0x1a2')]['belongsTo'](db['OpenchannelAccount'],{});db[_0x2c81('0x1a2')][_0x2c81('0x15c')](db[_0x2c81('0xf8')],{'as':_0x2c81('0x175'),'foreignKey':'ListId'});db['OpenchannelQueueReport'][_0x2c81('0x15c')](db[_0x2c81('0x75')],{'as':'Contact','foreignKey':'ContactId'});db['OpenchannelQueueReport']['belongsTo'](db[_0x2c81('0x61')],{});db[_0x2c81('0x1a2')][_0x2c81('0x15c')](db[_0x2c81('0x63')],{});db['OpenchannelQueueReport']['belongsTo'](db[_0x2c81('0x12')],{});db[_0x2c81('0x1a2')][_0x2c81('0x15c')](db[_0x2c81('0x65')],{});db['ChatApplication'][_0x2c81('0x15c')](db['User'],{'as':'Agent','foreignKey':_0x2c81('0x11a'),'onDelete':_0x2c81('0x171')});db[_0x2c81('0x6a')]['belongsTo'](db[_0x2c81('0x1a3')],{'as':_0x2c81('0x1a4'),'foreignKey':_0x2c81('0x1a5'),'onDelete':_0x2c81('0x171')});db[_0x2c81('0x6a')][_0x2c81('0x15c')](db[_0x2c81('0x67')],{'as':_0x2c81('0x1a6'),'foreignKey':_0x2c81('0x182'),'onDelete':_0x2c81('0x171')});db[_0x2c81('0x6a')][_0x2c81('0x15c')](db[_0x2c81('0x91')],{'onDelete':'restrict','foreignKey':_0x2c81('0x185')});db[_0x2c81('0x6c')][_0x2c81('0x11b')](db[_0x2c81('0x6e')],{'as':_0x2c81('0x168'),'onDelete':_0x2c81('0x118'),'foreignKey':_0x2c81('0x1a7')});db[_0x2c81('0x6c')][_0x2c81('0x15c')](db[_0x2c81('0x67')],{'as':_0x2c81('0x18f'),'foreignKey':'ChatWebsiteId'});db[_0x2c81('0x6c')][_0x2c81('0x15c')](db[_0x2c81('0x75')],{'as':_0x2c81('0x180'),'foreignKey':_0x2c81('0x16e')});db[_0x2c81('0x6c')][_0x2c81('0x15c')](db[_0x2c81('0x12')],{'as':_0x2c81('0x179'),'foreignKey':_0x2c81('0x11a')});db[_0x2c81('0x6c')][_0x2c81('0x130')](db[_0x2c81('0x91')],{'through':_0x2c81('0x1a8'),'as':'Tags'});db[_0x2c81('0x6c')][_0x2c81('0x130')](db['Tag'],{'through':'chat_interaction_has_tags','as':_0x2c81('0x17c')});db['ChatInteraction'][_0x2c81('0x130')](db[_0x2c81('0x12')],{'as':_0x2c81('0x17d'),'through':_0x2c81('0x138'),'foreignKey':_0x2c81('0x1a7')});db[_0x2c81('0x6e')][_0x2c81('0x15c')](db[_0x2c81('0x12')],{'onDelete':'cascade','as':'User'});db[_0x2c81('0x6e')]['belongsTo'](db[_0x2c81('0x75')],{'onDelete':'cascade','as':_0x2c81('0x180'),'foreignKey':_0x2c81('0x16e')});db[_0x2c81('0x6e')][_0x2c81('0x15c')](db[_0x2c81('0x6c')],{'onDelete':_0x2c81('0x118'),'as':'Interaction','foreignKey':_0x2c81('0x1a7')});db[_0x2c81('0x6e')][_0x2c81('0x15c')](db[_0x2c81('0x17e')],{'as':_0x2c81('0x17e'),'foreignKey':'AttachmentId'});db['ChatMessage'][_0x2c81('0x15c')](db['ChatWebsite'],{'as':'Account','foreignKey':_0x2c81('0x182')});db[_0x2c81('0x183')][_0x2c81('0x11b')](db[_0x2c81('0x17e')],{'as':_0x2c81('0x17f'),'foreignKey':_0x2c81('0x184'),'onDelete':_0x2c81('0x118'),'hooks':!![]});db[_0x2c81('0x183')]['belongsTo'](db['CmContact'],{'onDelete':_0x2c81('0x118'),'as':_0x2c81('0x180'),'foreignKey':_0x2c81('0x16e')});db[_0x2c81('0x183')][_0x2c81('0x15c')](db[_0x2c81('0x67')],{'as':_0x2c81('0x18f'),'foreignKey':_0x2c81('0x182')});db[_0x2c81('0x1a3')]['belongsToMany'](db['User'],{'as':_0x2c81('0x165'),'through':_0x2c81('0x2f'),'hooks':!![]});db[_0x2c81('0x1a3')][_0x2c81('0x130')](db[_0x2c81('0xeb')],{'through':_0x2c81('0x1a9'),'as':_0x2c81('0x166')});db[_0x2c81('0x71')][_0x2c81('0x11b')](db[_0x2c81('0xd4')],{'as':_0x2c81('0x168'),'foreignKey':_0x2c81('0x1aa'),'onDelete':'cascade'});db[_0x2c81('0x71')]['belongsToMany'](db[_0x2c81('0x12')],{'as':_0x2c81('0x157'),'through':'chat_group_has_users'});db['ChatProactiveAction'][_0x2c81('0x15c')](db['ChatWebsite'],{'as':_0x2c81('0x1a6'),'foreignKey':_0x2c81('0x182')});db[_0x2c81('0x1ab')]['hasMany'](db['CmContact'],{'as':'Contacts','foreignKey':_0x2c81('0x1ac')});db[_0x2c81('0x75')][_0x2c81('0x11b')](db[_0x2c81('0x93')],{'as':_0x2c81('0x1ad'),'foreignKey':'CmContactId'});db['CmContact'][_0x2c81('0x11b')](db[_0x2c81('0x12b')],{'as':_0x2c81('0x12c'),'foreignKey':_0x2c81('0x16e')});db[_0x2c81('0x75')][_0x2c81('0x11b')](db['CmHopperFinal'],{'as':_0x2c81('0x120'),'foreignKey':_0x2c81('0x16e')});db[_0x2c81('0x75')][_0x2c81('0x11b')](db['CmHopperHistory'],{'as':_0x2c81('0x159'),'foreignKey':_0x2c81('0x16e')});db[_0x2c81('0x75')][_0x2c81('0x11b')](db[_0x2c81('0x122')],{'as':_0x2c81('0x122'),'foreignKey':'ContactId'});db[_0x2c81('0x75')][_0x2c81('0x11b')](db[_0x2c81('0xd8')],{'as':'JscriptySessions','foreignKey':'ContactId'});db[_0x2c81('0x75')][_0x2c81('0x11b')](db[_0x2c81('0x61')],{'as':_0x2c81('0x123'),'foreignKey':_0x2c81('0x16e'),'onDelete':_0x2c81('0x171')});db[_0x2c81('0x75')]['hasMany'](db[_0x2c81('0x6c')],{'as':_0x2c81('0x124'),'foreignKey':_0x2c81('0x16e'),'onDelete':_0x2c81('0x171')});db['CmContact']['hasMany'](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x2c81('0x16e'),'onDelete':_0x2c81('0x171')});db['CmContact'][_0x2c81('0x11b')](db[_0x2c81('0x4f')],{'as':'FaxInteractions','foreignKey':'ContactId','onDelete':_0x2c81('0x171')});db['CmContact'][_0x2c81('0x11b')](db[_0x2c81('0x40')],{'as':_0x2c81('0x127'),'foreignKey':_0x2c81('0x16e'),'onDelete':_0x2c81('0x171')});db[_0x2c81('0x75')][_0x2c81('0x15c')](db[_0x2c81('0x1ab')],{'as':_0x2c81('0x1ae'),'foreignKey':'CompanyId'});db['CmContact']['belongsTo'](db[_0x2c81('0xf8')],{'as':_0x2c81('0x175'),'foreignKey':_0x2c81('0x186'),'onDelete':_0x2c81('0x118')});db[_0x2c81('0x75')]['belongsToMany'](db[_0x2c81('0x12')],{'as':_0x2c81('0x17d'),'through':'cm_user_has_contacts'});db[_0x2c81('0x75')][_0x2c81('0x130')](db['Tag'],{'as':'Tags','through':_0x2c81('0x1af')});db[_0x2c81('0x75')][_0x2c81('0x130')](db[_0x2c81('0x91')],{'through':_0x2c81('0x1af'),'as':_0x2c81('0x17c')});db['CmHopper'][_0x2c81('0x11b')](db[_0x2c81('0x94')],{'as':_0x2c81('0x1b0'),'foreignKey':'CmHopperId'});db[_0x2c81('0x12b')][_0x2c81('0x15c')](db[_0x2c81('0x75')],{'as':_0x2c81('0x180'),'foreignKey':_0x2c81('0x16e'),'onDelete':_0x2c81('0x118')});db[_0x2c81('0x12b')]['belongsTo'](db[_0x2c81('0xf8')],{'as':'List','foreignKey':_0x2c81('0x186'),'onDelete':_0x2c81('0x118')});db[_0x2c81('0x12b')][_0x2c81('0x15c')](db[_0x2c81('0x12')],{'as':'Agent','foreignKey':'UserId'});db[_0x2c81('0x12b')][_0x2c81('0x15c')](db[_0x2c81('0x13c')],{'as':_0x2c81('0x1a4'),'foreignKey':'VoiceQueueId','onDelete':_0x2c81('0x118')});db[_0x2c81('0x12b')][_0x2c81('0x15c')](db[_0x2c81('0xed')],{'as':'Campaign','foreignKey':_0x2c81('0x1b1'),'onDelete':_0x2c81('0x118')});db['CmHopper'][_0x2c81('0x15c')](db['User'],{'as':'Owner','foreignKey':_0x2c81('0x1b2')});db['CmHopperBlack'][_0x2c81('0x15c')](db[_0x2c81('0x75')],{'as':'Contact','foreignKey':_0x2c81('0x16e'),'onDelete':_0x2c81('0x118')});db[_0x2c81('0x78')][_0x2c81('0x15c')](db[_0x2c81('0xf8')],{'as':'List','foreignKey':'ListId','onDelete':_0x2c81('0x118')});db['CmHopperBlack'][_0x2c81('0x15c')](db[_0x2c81('0x13c')],{'as':_0x2c81('0x1a4'),'foreignKey':'VoiceQueueId','onDelete':_0x2c81('0x118')});db[_0x2c81('0x78')][_0x2c81('0x15c')](db[_0x2c81('0xed')],{'as':_0x2c81('0xed'),'foreignKey':_0x2c81('0x1b1'),'onDelete':_0x2c81('0x118')});db[_0x2c81('0x80')][_0x2c81('0x11b')](db[_0x2c81('0x85')],{'as':{'plural':_0x2c81('0x1b3'),'singular':'OneAll'},'foreignKey':_0x2c81('0x1b4'),'onDelete':_0x2c81('0x118'),'hooks':!![]});db['Automation'][_0x2c81('0x11b')](db[_0x2c81('0x85')],{'as':{'plural':'Any','singular':'OneAny'},'foreignKey':_0x2c81('0x1b5'),'onDelete':'cascade','hooks':!![]});db[_0x2c81('0x80')][_0x2c81('0x11b')](db[_0x2c81('0x7e')],{'as':'Actions','foreignKey':_0x2c81('0x1b6'),'onDelete':_0x2c81('0x118'),'hooks':!![]});db[_0x2c81('0x83')]['hasMany'](db[_0x2c81('0x83')],{'as':_0x2c81('0x188'),'foreignKey':_0x2c81('0x1b7'),'onDelete':_0x2c81('0x118')});db[_0x2c81('0x160')][_0x2c81('0x11b')](db['Interval'],{'as':_0x2c81('0x1b8'),'foreignKey':_0x2c81('0x161'),'onDelete':_0x2c81('0x118'),'hooks':!![],'required':![]});db['Interval'][_0x2c81('0x11b')](db[_0x2c81('0x150')],{'as':_0x2c81('0x11e'),'foreignKey':_0x2c81('0x161'),'onDelete':_0x2c81('0x171')});db[_0x2c81('0x160')][_0x2c81('0x11b')](db[_0x2c81('0x44')],{'as':_0x2c81('0x1b9'),'foreignKey':_0x2c81('0x161')});db[_0x2c81('0x160')][_0x2c81('0x11b')](db[_0x2c81('0x6a')],{'as':'ChatApplications','foreignKey':_0x2c81('0x161')});db[_0x2c81('0x160')][_0x2c81('0x11b')](db['FaxApplication'],{'as':_0x2c81('0x1ba'),'foreignKey':'IntervalId'});db[_0x2c81('0x160')][_0x2c81('0x11b')](db['SmsApplication'],{'as':_0x2c81('0x1bb'),'foreignKey':_0x2c81('0x161')});db['Schedule'][_0x2c81('0x15c')](db['MailAccount'],{});db[_0x2c81('0x8d')][_0x2c81('0x15c')](db['AnalyticDefaultReport'],{'foreignKey':_0x2c81('0x1bc')});db[_0x2c81('0x8d')][_0x2c81('0x15c')](db['AnalyticCustomReport'],{'foreignKey':_0x2c81('0x1bd')});db['Sound'][_0x2c81('0x130')](db[_0x2c81('0x154')],{'as':'Mohs','through':_0x2c81('0x156'),'onDelete':_0x2c81('0x171')});db[_0x2c81('0x91')]['belongsToMany'](db['CmContact'],{'through':_0x2c81('0x1af')});db[_0x2c81('0x91')][_0x2c81('0x130')](db[_0x2c81('0x6c')],{'through':_0x2c81('0x1a8')});db['Tag']['belongsToMany'](db[_0x2c81('0x40')],{'through':'mail_interaction_has_tags'});db[_0x2c81('0x91')][_0x2c81('0x130')](db['SmsInteraction'],{'through':_0x2c81('0x197')});db[_0x2c81('0x91')][_0x2c81('0x130')](db[_0x2c81('0x4f')],{'through':_0x2c81('0x190')});db['Tag'][_0x2c81('0x130')](db['OpenchannelInteraction'],{'through':_0x2c81('0x19d')});db[_0x2c81('0x91')]['belongsToMany'](db[_0x2c81('0x105')],{'through':'whatsapp_interaction_has_tags'});db['CmContactHasItem'][_0x2c81('0x15c')](db[_0x2c81('0x1be')],{'as':_0x2c81('0x1bf'),'foreignKey':_0x2c81('0x1c0')});db[_0x2c81('0x94')][_0x2c81('0x15c')](db['CmHopper'],{'as':_0x2c81('0x1c1'),'foreignKey':_0x2c81('0x1c2')});db['CmContactHasItem'][_0x2c81('0x15c')](db[_0x2c81('0x75')],{'as':_0x2c81('0x180'),'foreignKey':_0x2c81('0x1c3')});db[_0x2c81('0x98')][_0x2c81('0x11b')](db[_0x2c81('0x85')],{'as':{'plural':_0x2c81('0x1c4'),'singular':_0x2c81('0x1c5')},'foreignKey':'TriggerAllId','onDelete':'cascade','hooks':!![]});db[_0x2c81('0x98')][_0x2c81('0x11b')](db[_0x2c81('0x85')],{'as':{'plural':_0x2c81('0x1c6'),'singular':_0x2c81('0x1c7')},'foreignKey':_0x2c81('0x1c8'),'onDelete':'cascade','hooks':!![]});db[_0x2c81('0x98')]['hasMany'](db[_0x2c81('0x7e')],{'as':_0x2c81('0x1c9'),'foreignKey':_0x2c81('0x1ca'),'onDelete':_0x2c81('0x118'),'hooks':!![]});db[_0x2c81('0x9d')]['hasMany'](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0x2c81('0x118'),'foreignKey':'CustomReportId','hooks':!![]});db[_0x2c81('0x1cb')][_0x2c81('0x11b')](db[_0x2c81('0xa2')],{'as':_0x2c81('0x1cc'),'onDelete':'cascade','foreignKey':_0x2c81('0x1bc')});db[_0x2c81('0xa1')]['hasMany'](db[_0x2c81('0xa2')],{'as':_0x2c81('0x1cc'),'onDelete':_0x2c81('0x118'),'foreignKey':'MetricId'});db['AnalyticFieldReport'][_0x2c81('0x15c')](db[_0x2c81('0xa1')],{'foreignKey':_0x2c81('0x1cd')});db[_0x2c81('0x1ce')][_0x2c81('0x11b')](db['SalesforceConfiguration'],{'as':_0x2c81('0x1cf'),'onDelete':_0x2c81('0x118'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x2c81('0x11b')](db['SalesforceField'],{'as':_0x2c81('0x1d0'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x2c81('0xa6')]['hasMany'](db[_0x2c81('0xa8')],{'as':_0x2c81('0x1d1'),'onDelete':_0x2c81('0x118'),'foreignKey':_0x2c81('0x1d2')});db[_0x2c81('0xa6')][_0x2c81('0x11b')](db['SalesforceField'],{'as':_0x2c81('0x1cc'),'onDelete':'cascade','foreignKey':_0x2c81('0x1d3')});db[_0x2c81('0xa6')][_0x2c81('0x15c')](db[_0x2c81('0x1ce')],{'as':'Account','foreignKey':_0x2c81('0x1d4')});db['SalesforceField']['hasMany'](db[_0x2c81('0xa8')],{'as':_0x2c81('0x1d5'),'foreignKey':_0x2c81('0x1d6')});db[_0x2c81('0xa8')][_0x2c81('0x11b')](db['SalesforceField'],{'as':_0x2c81('0x1d7'),'foreignKey':_0x2c81('0x1d2')});db[_0x2c81('0xa8')][_0x2c81('0x11b')](db[_0x2c81('0xa8')],{'as':_0x2c81('0x1d8'),'foreignKey':_0x2c81('0x1d3')});db['SalesforceField'][_0x2c81('0x15c')](db['Variable'],{'as':_0x2c81('0x1d9'),'foreignKey':_0x2c81('0x1da')});db['SugarcrmAccount'][_0x2c81('0x11b')](db[_0x2c81('0x1db')],{'as':'Configurations','onDelete':_0x2c81('0x118'),'foreignKey':_0x2c81('0x1d4')});db['SugarcrmConfiguration'][_0x2c81('0x11b')](db['SugarcrmField'],{'as':_0x2c81('0x1d0'),'onDelete':'cascade','foreignKey':_0x2c81('0x1d6')});db['SugarcrmConfiguration']['hasMany'](db['SugarcrmField'],{'as':_0x2c81('0x1d1'),'onDelete':'cascade','foreignKey':_0x2c81('0x1d2')});db[_0x2c81('0x1db')][_0x2c81('0x11b')](db[_0x2c81('0xab')],{'as':_0x2c81('0x1cc'),'onDelete':'cascade','foreignKey':_0x2c81('0x1d3')});db[_0x2c81('0x1db')]['belongsTo'](db['SugarcrmAccount'],{'as':'Account','foreignKey':'AccountId'});db['SugarcrmField']['hasMany'](db[_0x2c81('0xab')],{'as':'Subject','foreignKey':'SubjectId'});db['SugarcrmField'][_0x2c81('0x11b')](db[_0x2c81('0xab')],{'as':_0x2c81('0x1d7'),'foreignKey':_0x2c81('0x1d2')});db[_0x2c81('0xab')][_0x2c81('0x11b')](db[_0x2c81('0xab')],{'as':_0x2c81('0x1d8'),'foreignKey':'FieldId'});db[_0x2c81('0xab')][_0x2c81('0x15c')](db[_0x2c81('0x1d9')],{'as':_0x2c81('0x1d9'),'foreignKey':'VariableId'});db[_0x2c81('0x1dc')][_0x2c81('0x11b')](db['DeskConfiguration'],{'as':_0x2c81('0x1cf'),'onDelete':_0x2c81('0x118'),'foreignKey':_0x2c81('0x1d4')});db['DeskConfiguration']['hasMany'](db['DeskField'],{'as':_0x2c81('0x1d0'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x2c81('0xae')]['hasMany'](db[_0x2c81('0xb0')],{'as':_0x2c81('0x1d1'),'onDelete':_0x2c81('0x118'),'foreignKey':_0x2c81('0x1d2')});db[_0x2c81('0xae')]['hasMany'](db[_0x2c81('0xb0')],{'as':_0x2c81('0x1cc'),'onDelete':_0x2c81('0x118'),'foreignKey':'FieldId'});db['DeskConfiguration'][_0x2c81('0x15c')](db[_0x2c81('0x1dc')],{'as':_0x2c81('0x18f'),'foreignKey':_0x2c81('0x1d4')});db[_0x2c81('0xae')]['belongsToMany'](db[_0x2c81('0x91')],{'through':_0x2c81('0x1dd')});db[_0x2c81('0xb0')][_0x2c81('0x11b')](db[_0x2c81('0xb0')],{'as':_0x2c81('0x1d5'),'foreignKey':_0x2c81('0x1d6')});db[_0x2c81('0xb0')][_0x2c81('0x11b')](db[_0x2c81('0xb0')],{'as':'Description','foreignKey':_0x2c81('0x1d2')});db['DeskField'][_0x2c81('0x11b')](db[_0x2c81('0xb0')],{'as':'Field','foreignKey':_0x2c81('0x1d3')});db[_0x2c81('0xb0')]['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':_0x2c81('0x1da')});db['ZohoAccount'][_0x2c81('0x11b')](db[_0x2c81('0xb3')],{'as':'Configurations','onDelete':_0x2c81('0x118'),'foreignKey':'AccountId'});db[_0x2c81('0xb3')]['hasMany'](db[_0x2c81('0xb5')],{'as':_0x2c81('0x1d0'),'onDelete':_0x2c81('0x118'),'foreignKey':'SubjectId'});db[_0x2c81('0xb3')][_0x2c81('0x11b')](db[_0x2c81('0xb5')],{'as':'Descriptions','onDelete':_0x2c81('0x118'),'foreignKey':_0x2c81('0x1d2')});db[_0x2c81('0xb3')]['hasMany'](db[_0x2c81('0xb5')],{'as':'Fields','onDelete':_0x2c81('0x118'),'foreignKey':_0x2c81('0x1d3')});db[_0x2c81('0xb3')][_0x2c81('0x15c')](db[_0x2c81('0xb1')],{'as':_0x2c81('0x18f'),'foreignKey':_0x2c81('0x1d4')});db[_0x2c81('0xb5')][_0x2c81('0x11b')](db[_0x2c81('0xb5')],{'as':_0x2c81('0x1d5'),'foreignKey':'SubjectId'});db['ZohoField'][_0x2c81('0x11b')](db['ZohoField'],{'as':'Description','foreignKey':_0x2c81('0x1d2')});db[_0x2c81('0xb5')]['hasMany'](db['ZohoField'],{'as':_0x2c81('0x1d8'),'foreignKey':_0x2c81('0x1d3')});db[_0x2c81('0xb5')]['belongsTo'](db[_0x2c81('0x1d9')],{'as':'Variable','foreignKey':'VariableId'});db[_0x2c81('0xb6')][_0x2c81('0x11b')](db[_0x2c81('0xb8')],{'as':_0x2c81('0x1cf'),'onDelete':_0x2c81('0x118'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x2c81('0x11b')](db[_0x2c81('0xb9')],{'as':_0x2c81('0x1d0'),'foreignKey':_0x2c81('0x1d6')});db[_0x2c81('0xb8')][_0x2c81('0x11b')](db[_0x2c81('0xb9')],{'as':_0x2c81('0x1d1'),'foreignKey':_0x2c81('0x1d2')});db['ZendeskConfiguration'][_0x2c81('0x11b')](db[_0x2c81('0xb9')],{'as':_0x2c81('0x1cc'),'foreignKey':'FieldId'});db[_0x2c81('0xb8')]['belongsTo'](db[_0x2c81('0xb6')],{'as':_0x2c81('0x18f'),'foreignKey':'AccountId'});db[_0x2c81('0xb8')][_0x2c81('0x130')](db[_0x2c81('0x91')],{'through':_0x2c81('0x1de')});db[_0x2c81('0xb9')][_0x2c81('0x11b')](db[_0x2c81('0xb9')],{'as':_0x2c81('0x1d5'),'foreignKey':_0x2c81('0x1d6')});db[_0x2c81('0xb9')][_0x2c81('0x11b')](db[_0x2c81('0xb9')],{'as':'Description','foreignKey':_0x2c81('0x1d2')});db[_0x2c81('0xb9')][_0x2c81('0x11b')](db[_0x2c81('0xb9')],{'as':_0x2c81('0x1d8'),'foreignKey':'FieldId'});db['ZendeskField']['belongsTo'](db[_0x2c81('0x1d9')],{'as':_0x2c81('0x1d9'),'foreignKey':'VariableId'});db[_0x2c81('0xbb')][_0x2c81('0x11b')](db[_0x2c81('0x1df')],{'as':'Configurations','onDelete':_0x2c81('0x118'),'foreignKey':'AccountId'});db[_0x2c81('0x1df')][_0x2c81('0x11b')](db[_0x2c81('0x1e0')],{'as':_0x2c81('0x1d0'),'onDelete':'cascade','foreignKey':_0x2c81('0x1d6')});db[_0x2c81('0x1df')][_0x2c81('0x11b')](db[_0x2c81('0x1e0')],{'as':_0x2c81('0x1d1'),'onDelete':_0x2c81('0x118'),'foreignKey':_0x2c81('0x1d2')});db[_0x2c81('0x1df')][_0x2c81('0x11b')](db[_0x2c81('0x1e0')],{'as':_0x2c81('0x1cc'),'onDelete':'cascade','foreignKey':_0x2c81('0x1d3')});db['FreshdeskConfiguration'][_0x2c81('0x15c')](db[_0x2c81('0xbb')],{'as':_0x2c81('0x18f'),'foreignKey':_0x2c81('0x1d4')});db[_0x2c81('0x1df')][_0x2c81('0x130')](db[_0x2c81('0x91')],{'through':_0x2c81('0x1e1')});db[_0x2c81('0x1e0')][_0x2c81('0x11b')](db[_0x2c81('0x1e0')],{'as':_0x2c81('0x1d5'),'foreignKey':'SubjectId'});db[_0x2c81('0x1e0')][_0x2c81('0x11b')](db[_0x2c81('0x1e0')],{'as':_0x2c81('0x1d7'),'foreignKey':_0x2c81('0x1d2')});db['FreshdeskField'][_0x2c81('0x11b')](db['FreshdeskField'],{'as':_0x2c81('0x1d8'),'foreignKey':_0x2c81('0x1d3')});db[_0x2c81('0x1e0')][_0x2c81('0x15c')](db[_0x2c81('0x1d9')],{'as':_0x2c81('0x1d9'),'foreignKey':_0x2c81('0x1da')});db[_0x2c81('0x1e2')][_0x2c81('0x11b')](db[_0x2c81('0xbf')],{'as':_0x2c81('0x1cf'),'onDelete':'cascade','foreignKey':_0x2c81('0x1d4')});db[_0x2c81('0xbf')][_0x2c81('0x11b')](db['VtigerField'],{'as':'Subjects','foreignKey':_0x2c81('0x1d6')});db[_0x2c81('0xbf')]['hasMany'](db[_0x2c81('0xc0')],{'as':_0x2c81('0x1d1'),'foreignKey':'DescriptionId'});db['VtigerConfiguration'][_0x2c81('0x11b')](db[_0x2c81('0xc0')],{'as':_0x2c81('0x1cc'),'foreignKey':_0x2c81('0x1d3')});db['VtigerConfiguration'][_0x2c81('0x15c')](db[_0x2c81('0x1e2')],{'as':_0x2c81('0x18f'),'foreignKey':_0x2c81('0x1d4')});db[_0x2c81('0xc0')][_0x2c81('0x11b')](db[_0x2c81('0xc0')],{'as':_0x2c81('0x1d5'),'foreignKey':'SubjectId'});db['VtigerField'][_0x2c81('0x11b')](db[_0x2c81('0xc0')],{'as':'Description','foreignKey':_0x2c81('0x1d2')});db[_0x2c81('0xc0')]['hasMany'](db[_0x2c81('0xc0')],{'as':_0x2c81('0x1d8'),'foreignKey':'FieldId'});db[_0x2c81('0xc0')][_0x2c81('0x15c')](db[_0x2c81('0x1d9')],{'as':_0x2c81('0x1d9'),'foreignKey':_0x2c81('0x1da')});db[_0x2c81('0xc2')][_0x2c81('0x11b')](db[_0x2c81('0xc4')],{'as':'Configurations','onDelete':_0x2c81('0x118'),'foreignKey':_0x2c81('0x1d4')});db[_0x2c81('0xc4')][_0x2c81('0x11b')](db[_0x2c81('0xc6')],{'as':_0x2c81('0x1d0'),'foreignKey':'SubjectId'});db[_0x2c81('0xc4')][_0x2c81('0x11b')](db[_0x2c81('0xc6')],{'as':_0x2c81('0x1d1'),'foreignKey':_0x2c81('0x1d2')});db['ServicenowConfiguration']['hasMany'](db[_0x2c81('0xc6')],{'as':_0x2c81('0x1cc'),'foreignKey':_0x2c81('0x1d3')});db[_0x2c81('0xc4')][_0x2c81('0x15c')](db['ServicenowAccount'],{'as':_0x2c81('0x18f'),'foreignKey':_0x2c81('0x1d4')});db[_0x2c81('0xc6')]['hasMany'](db[_0x2c81('0xc6')],{'as':_0x2c81('0x1d5'),'foreignKey':_0x2c81('0x1d6')});db[_0x2c81('0xc6')][_0x2c81('0x11b')](db['ServicenowField'],{'as':'Description','foreignKey':_0x2c81('0x1d2')});db[_0x2c81('0xc6')]['hasMany'](db[_0x2c81('0xc6')],{'as':'Field','foreignKey':_0x2c81('0x1d3')});db[_0x2c81('0xc6')][_0x2c81('0x15c')](db[_0x2c81('0x1d9')],{'as':'Variable','foreignKey':_0x2c81('0x1da')});db[_0x2c81('0xc8')]['hasMany'](db[_0x2c81('0xca')],{'as':'Configurations','onDelete':_0x2c81('0x118'),'foreignKey':_0x2c81('0x1d4')});db['Dynamics365Account']['belongsTo'](db[_0x2c81('0x10f')],{'as':_0x2c81('0x10f'),'foreignKey':_0x2c81('0x170')});db[_0x2c81('0xca')][_0x2c81('0x11b')](db['Dynamics365Field'],{'as':'Subjects','onDelete':_0x2c81('0x118'),'foreignKey':_0x2c81('0x1d6')});db[_0x2c81('0xca')][_0x2c81('0x11b')](db[_0x2c81('0xcb')],{'as':_0x2c81('0x1d1'),'onDelete':'cascade','foreignKey':_0x2c81('0x1d2')});db['Dynamics365Configuration'][_0x2c81('0x11b')](db[_0x2c81('0xcb')],{'as':_0x2c81('0x1cc'),'onDelete':'cascade','foreignKey':_0x2c81('0x1d3')});db[_0x2c81('0xca')]['belongsTo'](db['Dynamics365Account'],{'as':'Account','foreignKey':_0x2c81('0x1d4')});db[_0x2c81('0xcb')]['hasMany'](db[_0x2c81('0xcb')],{'as':_0x2c81('0x1d5'),'foreignKey':_0x2c81('0x1d6')});db[_0x2c81('0xcb')]['hasMany'](db[_0x2c81('0xcb')],{'as':_0x2c81('0x1d7'),'foreignKey':_0x2c81('0x1d2')});db['Dynamics365Field'][_0x2c81('0x11b')](db[_0x2c81('0xcb')],{'as':_0x2c81('0x1d8'),'foreignKey':_0x2c81('0x1d3')});db[_0x2c81('0xcb')][_0x2c81('0x15c')](db['Variable'],{'as':'Variable','foreignKey':_0x2c81('0x1da')});db[_0x2c81('0xcd')][_0x2c81('0x11b')](db[_0x2c81('0xcf')],{'as':_0x2c81('0x1cf'),'onDelete':'cascade','foreignKey':_0x2c81('0x1d4')});db[_0x2c81('0xcf')]['hasMany'](db[_0x2c81('0x1e3')],{'as':_0x2c81('0x1d0'),'foreignKey':'SubjectId'});db[_0x2c81('0xcf')][_0x2c81('0x11b')](db[_0x2c81('0x1e3')],{'as':_0x2c81('0x1d1'),'foreignKey':_0x2c81('0x1d2')});db[_0x2c81('0xcf')][_0x2c81('0x11b')](db[_0x2c81('0x1e3')],{'as':_0x2c81('0x1cc'),'foreignKey':_0x2c81('0x1d3')});db[_0x2c81('0xcf')]['belongsTo'](db[_0x2c81('0xcd')],{'as':_0x2c81('0x18f'),'foreignKey':_0x2c81('0x1d4')});db[_0x2c81('0x1e3')][_0x2c81('0x11b')](db['FreshsalesField'],{'as':_0x2c81('0x1d5'),'foreignKey':'SubjectId'});db['FreshsalesField']['hasMany'](db[_0x2c81('0x1e3')],{'as':_0x2c81('0x1d7'),'foreignKey':_0x2c81('0x1d2')});db[_0x2c81('0x1e3')]['hasMany'](db[_0x2c81('0x1e3')],{'as':_0x2c81('0x1d8'),'foreignKey':_0x2c81('0x1d3')});db[_0x2c81('0x1e3')][_0x2c81('0x15c')](db[_0x2c81('0x1d9')],{'as':_0x2c81('0x1d9'),'foreignKey':'VariableId'});db[_0x2c81('0xd3')][_0x2c81('0x15c')](db[_0x2c81('0x67')],{});db['ChatQueueReport'][_0x2c81('0x15c')](db[_0x2c81('0xf8')],{'as':'List','foreignKey':_0x2c81('0x186')});db[_0x2c81('0xd3')][_0x2c81('0x15c')](db[_0x2c81('0x75')],{'as':_0x2c81('0x180'),'foreignKey':_0x2c81('0x16e')});db[_0x2c81('0xd3')][_0x2c81('0x15c')](db[_0x2c81('0x6c')],{});db[_0x2c81('0xd3')][_0x2c81('0x15c')](db[_0x2c81('0x6e')],{});db[_0x2c81('0xd3')][_0x2c81('0x15c')](db[_0x2c81('0x12')],{});db[_0x2c81('0xd3')][_0x2c81('0x15c')](db[_0x2c81('0x1a3')],{});db[_0x2c81('0xd4')][_0x2c81('0x15c')](db[_0x2c81('0x12')],{'onDelete':_0x2c81('0x118'),'foreignKey':_0x2c81('0x1e4')});db[_0x2c81('0xd4')][_0x2c81('0x15c')](db[_0x2c81('0x12')],{'onDelete':_0x2c81('0x118'),'foreignKey':'ToId'});db[_0x2c81('0xd8')][_0x2c81('0x11b')](db['JscriptyQuestionReport'],{'foreignKey':_0x2c81('0x1e5'),'onDelete':'cascade'});db['JscriptySessionReport'][_0x2c81('0x11b')](db[_0x2c81('0x1e6')],{'foreignKey':_0x2c81('0x1e5'),'onDelete':_0x2c81('0x118')});db[_0x2c81('0xda')][_0x2c81('0x15c')](db[_0x2c81('0x54')],{});db[_0x2c81('0xda')][_0x2c81('0x15c')](db[_0x2c81('0xf8')],{'as':_0x2c81('0x175'),'foreignKey':_0x2c81('0x186')});db['SmsQueueReport'][_0x2c81('0x15c')](db[_0x2c81('0x75')],{'as':_0x2c81('0x180'),'foreignKey':_0x2c81('0x16e')});db['SmsQueueReport'][_0x2c81('0x15c')](db[_0x2c81('0x195')],{});db[_0x2c81('0xda')][_0x2c81('0x15c')](db[_0x2c81('0x59')],{});db[_0x2c81('0xda')]['belongsTo'](db[_0x2c81('0x12')],{});db[_0x2c81('0xda')][_0x2c81('0x15c')](db[_0x2c81('0x5b')],{});db['JscriptyProject'][_0x2c81('0x11b')](db['JscriptySessionReport'],{'foreignKey':_0x2c81('0x1e7')});db[_0x2c81('0xe0')][_0x2c81('0x11b')](db[_0x2c81('0xd6')],{'foreignKey':_0x2c81('0x1e7')});db[_0x2c81('0xe0')][_0x2c81('0x11b')](db[_0x2c81('0x1e6')],{'foreignKey':_0x2c81('0x1e7')});db[_0x2c81('0xeb')][_0x2c81('0x130')](db[_0x2c81('0x12')],{'as':_0x2c81('0x165'),'through':_0x2c81('0x136')});db[_0x2c81('0xeb')][_0x2c81('0x130')](db[_0x2c81('0x13c')],{'through':_0x2c81('0x110'),'as':_0x2c81('0x13d')});db[_0x2c81('0xeb')]['belongsToMany'](db[_0x2c81('0x3d')],{'through':_0x2c81('0x177'),'as':_0x2c81('0x13f')});db[_0x2c81('0xeb')][_0x2c81('0x130')](db[_0x2c81('0x1a3')],{'through':'team_has_chat_queues','as':_0x2c81('0x140')});db['Team']['belongsToMany'](db['FaxQueue'],{'through':_0x2c81('0x192'),'as':_0x2c81('0x1e8')});db[_0x2c81('0xeb')]['belongsToMany'](db[_0x2c81('0x5b')],{'through':_0x2c81('0x19a'),'as':_0x2c81('0x142')});db[_0x2c81('0xeb')][_0x2c81('0x130')](db[_0x2c81('0x65')],{'through':_0x2c81('0x1a0'),'as':_0x2c81('0x143')});db[_0x2c81('0xeb')][_0x2c81('0x130')](db[_0x2c81('0x10d')],{'through':_0x2c81('0x1e9'),'as':_0x2c81('0x144')});db['Team']['belongsToMany'](db[_0x2c81('0xfa')],{'through':_0x2c81('0x111'),'as':_0x2c81('0x13e')});db[_0x2c81('0xed')][_0x2c81('0x11b')](db[_0x2c81('0x12b')],{'as':_0x2c81('0x12c'),'foreignKey':_0x2c81('0x1b1')});db[_0x2c81('0xed')][_0x2c81('0x11b')](db[_0x2c81('0x11f')],{'as':_0x2c81('0x120'),'foreignKey':'CampaignId'});db[_0x2c81('0xed')][_0x2c81('0x11b')](db['CmHopperHistory'],{'as':_0x2c81('0x159'),'foreignKey':_0x2c81('0x1b1')});db['Campaign'][_0x2c81('0x11b')](db[_0x2c81('0x78')],{'as':_0x2c81('0x15a'),'foreignKey':_0x2c81('0x1b1')});db[_0x2c81('0xed')][_0x2c81('0x15c')](db[_0x2c81('0x15d')],{'as':'Trunk','foreignKey':'TrunkId'});db[_0x2c81('0xed')][_0x2c81('0x15c')](db['Trunk'],{'as':_0x2c81('0x15f'),'foreignKey':_0x2c81('0x1ea')});db[_0x2c81('0xed')][_0x2c81('0x15c')](db[_0x2c81('0x160')],{'as':_0x2c81('0x160'),'foreignKey':_0x2c81('0x161')});db['Campaign'][_0x2c81('0x15c')](db['SquareProject'],{'as':_0x2c81('0xe5'),'foreignKey':_0x2c81('0x1eb')});db['Campaign']['belongsToMany'](db[_0x2c81('0xf8')],{'as':'Lists','through':'campaigns_has_cm_lists'});db[_0x2c81('0xed')][_0x2c81('0x130')](db[_0x2c81('0xf8')],{'as':_0x2c81('0x1ec'),'through':_0x2c81('0x1ed')});db[_0x2c81('0x17e')][_0x2c81('0x15c')](db[_0x2c81('0x183')],{'as':_0x2c81('0x183'),'foreignKey':_0x2c81('0x184')});db[_0x2c81('0xf0')]['belongsTo'](db[_0x2c81('0x42')],{});db[_0x2c81('0xf0')][_0x2c81('0x15c')](db[_0x2c81('0x40')],{});db[_0x2c81('0xf0')][_0x2c81('0x15c')](db[_0x2c81('0x3c')],{'foreignKey':_0x2c81('0x1ee'),'as':_0x2c81('0x1ef')});db[_0x2c81('0xf0')]['belongsTo'](db[_0x2c81('0x12')],{'foreignKey':_0x2c81('0x1f0'),'as':_0x2c81('0x1f1')});db[_0x2c81('0xf0')]['belongsTo'](db[_0x2c81('0x12')],{'foreignKey':_0x2c81('0x1f2'),'as':_0x2c81('0x1f3')});db[_0x2c81('0xf0')][_0x2c81('0x15c')](db[_0x2c81('0x3d')],{'foreignKey':_0x2c81('0x1f4'),'as':'ToQueue'});db[_0x2c81('0xf0')]['belongsTo'](db['MailAccount'],{'foreignKey':'ToMailAccountId','as':_0x2c81('0x1f5')});db[_0x2c81('0x1f6')][_0x2c81('0x15c')](db['ChatMessage'],{});db[_0x2c81('0x1f6')][_0x2c81('0x15c')](db[_0x2c81('0x6c')],{});db[_0x2c81('0x1f6')]['belongsTo'](db[_0x2c81('0x67')],{'foreignKey':_0x2c81('0x1f7'),'as':_0x2c81('0x1ef')});db[_0x2c81('0x1f6')][_0x2c81('0x15c')](db[_0x2c81('0x12')],{'foreignKey':_0x2c81('0x1f0'),'as':_0x2c81('0x1f1')});db['ChatTransferReport']['belongsTo'](db[_0x2c81('0x12')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x2c81('0x1f6')][_0x2c81('0x15c')](db['ChatQueue'],{'foreignKey':_0x2c81('0x1f8'),'as':_0x2c81('0x1f9')});db[_0x2c81('0x1f6')][_0x2c81('0x15c')](db[_0x2c81('0x67')],{'foreignKey':'ToChatWebsiteId','as':_0x2c81('0x1f5')});db[_0x2c81('0xf2')][_0x2c81('0x15c')](db[_0x2c81('0x50')],{});db[_0x2c81('0xf2')][_0x2c81('0x15c')](db['FaxInteraction'],{});db['FaxTransferReport']['belongsTo'](db[_0x2c81('0x4c')],{'foreignKey':_0x2c81('0x1fa'),'as':'FromAccount'});db[_0x2c81('0xf2')][_0x2c81('0x15c')](db[_0x2c81('0x12')],{'foreignKey':_0x2c81('0x1f0'),'as':'FromAgent'});db['FaxTransferReport'][_0x2c81('0x15c')](db['User'],{'foreignKey':'ToUserId','as':_0x2c81('0x1f3')});db[_0x2c81('0xf2')]['belongsTo'](db[_0x2c81('0x141')],{'foreignKey':_0x2c81('0x1fb'),'as':_0x2c81('0x1f9')});db[_0x2c81('0xf2')][_0x2c81('0x15c')](db[_0x2c81('0x4c')],{'foreignKey':_0x2c81('0x1fc'),'as':_0x2c81('0x1f5')});db[_0x2c81('0xf4')]['belongsTo'](db[_0x2c81('0x63')],{});db[_0x2c81('0xf4')][_0x2c81('0x15c')](db[_0x2c81('0x61')],{});db[_0x2c81('0xf4')][_0x2c81('0x15c')](db[_0x2c81('0x5d')],{'foreignKey':_0x2c81('0x1fd'),'as':'FromAccount'});db[_0x2c81('0xf4')]['belongsTo'](db[_0x2c81('0x12')],{'foreignKey':_0x2c81('0x1f0'),'as':_0x2c81('0x1f1')});db['OpenchannelTransferReport'][_0x2c81('0x15c')](db[_0x2c81('0x12')],{'foreignKey':_0x2c81('0x1f2'),'as':_0x2c81('0x1f3')});db[_0x2c81('0xf4')]['belongsTo'](db['OpenchannelQueue'],{'foreignKey':_0x2c81('0x1fe'),'as':_0x2c81('0x1f9')});db[_0x2c81('0xf4')][_0x2c81('0x15c')](db[_0x2c81('0x5d')],{'foreignKey':_0x2c81('0x1ff'),'as':_0x2c81('0x1f5')});db[_0x2c81('0xf6')][_0x2c81('0x15c')](db['SmsMessage'],{});db[_0x2c81('0xf6')][_0x2c81('0x15c')](db[_0x2c81('0x195')],{});db[_0x2c81('0xf6')][_0x2c81('0x15c')](db[_0x2c81('0x54')],{'foreignKey':'FromSmsAccountId','as':_0x2c81('0x1ef')});db[_0x2c81('0xf6')][_0x2c81('0x15c')](db[_0x2c81('0x12')],{'foreignKey':_0x2c81('0x1f0'),'as':_0x2c81('0x1f1')});db[_0x2c81('0xf6')]['belongsTo'](db[_0x2c81('0x12')],{'foreignKey':_0x2c81('0x1f2'),'as':_0x2c81('0x1f3')});db['SmsTransferReport']['belongsTo'](db[_0x2c81('0x5b')],{'foreignKey':_0x2c81('0x200'),'as':_0x2c81('0x1f9')});db[_0x2c81('0xf6')][_0x2c81('0x15c')](db[_0x2c81('0x54')],{'foreignKey':_0x2c81('0x201'),'as':_0x2c81('0x1f5')});db[_0x2c81('0xf8')][_0x2c81('0x11b')](db[_0x2c81('0x83')],{'as':_0x2c81('0x188'),'foreignKey':'ListId','onDelete':'cascade'});db[_0x2c81('0xf8')][_0x2c81('0x11b')](db[_0x2c81('0x7d')],{'as':_0x2c81('0x202'),'foreignKey':'ListId'});db[_0x2c81('0xf8')][_0x2c81('0x11b')](db[_0x2c81('0x75')],{'as':'Contacts','onDelete':_0x2c81('0x118'),'foreignKey':_0x2c81('0x186')});db[_0x2c81('0xf8')][_0x2c81('0x11b')](db[_0x2c81('0x11f')],{'as':'HopperFinals','foreignKey':'ListId'});db[_0x2c81('0xf8')][_0x2c81('0x11b')](db[_0x2c81('0x7a')],{'as':_0x2c81('0x121'),'foreignKey':_0x2c81('0x186')});db[_0x2c81('0xf8')][_0x2c81('0x11b')](db[_0x2c81('0x122')],{'as':_0x2c81('0x122'),'foreignKey':_0x2c81('0x186')});db[_0x2c81('0xf8')][_0x2c81('0x130')](db[_0x2c81('0x13c')],{'as':'Queues','through':'voice_queues_has_cm_lists'});db[_0x2c81('0xf8')][_0x2c81('0x130')](db[_0x2c81('0x12')],{'as':_0x2c81('0x165'),'through':_0x2c81('0x135')});db[_0x2c81('0xfa')][_0x2c81('0x11b')](db[_0x2c81('0x150')],{'as':'Extensions','onDelete':_0x2c81('0x118')});db[_0x2c81('0xfa')][_0x2c81('0x130')](db[_0x2c81('0x12')],{'as':'Agents','through':'UserVoicePrefix'});db[_0x2c81('0xfa')][_0x2c81('0x130')](db[_0x2c81('0xeb')],{'through':'TeamVoicePrefix','as':'Teams'});db[_0x2c81('0x12e')][_0x2c81('0x11b')](db[_0x2c81('0x12')],{'as':_0x2c81('0x17d'),'foreignKey':_0x2c81('0x12f')});db['UserProfile'][_0x2c81('0x11b')](db[_0x2c81('0xfd')],{'as':'UserProfileSections','foreignKey':_0x2c81('0x12f'),'onDelete':_0x2c81('0x118')});db[_0x2c81('0xfd')][_0x2c81('0x11b')](db[_0x2c81('0x203')],{'as':_0x2c81('0x204'),'foreignKey':_0x2c81('0x205'),'onDelete':_0x2c81('0x118')});db[_0x2c81('0x102')][_0x2c81('0x11b')](db[_0x2c81('0x83')],{'as':_0x2c81('0x188'),'foreignKey':_0x2c81('0x206'),'onDelete':'cascade'});db[_0x2c81('0x102')][_0x2c81('0x11b')](db[_0x2c81('0x82')],{'as':'Answers','foreignKey':_0x2c81('0x206')});db[_0x2c81('0x102')]['hasMany'](db[_0x2c81('0x107')],{'as':_0x2c81('0x168'),'foreignKey':_0x2c81('0x206')});db[_0x2c81('0x102')][_0x2c81('0x11b')](db[_0x2c81('0x105')],{'as':_0x2c81('0x18b')});db[_0x2c81('0x102')][_0x2c81('0x11b')](db['WhatsappApplication'],{'as':'Applications','foreignKey':'WhatsappAccountId','onDelete':_0x2c81('0x118')});db[_0x2c81('0x102')][_0x2c81('0x15c')](db[_0x2c81('0xf8')],{'as':'List','foreignKey':'ListId'});db[_0x2c81('0x102')][_0x2c81('0x15c')](db[_0x2c81('0x88')],{'as':_0x2c81('0x162'),'foreignKey':_0x2c81('0x163')});db[_0x2c81('0x102')]['belongsToMany'](db[_0x2c81('0x12')],{'as':'Agents','through':'user_has_whatsapp_accounts'});db[_0x2c81('0x104')]['belongsTo'](db[_0x2c81('0x12')],{'onDelete':'restrict'});db[_0x2c81('0x104')][_0x2c81('0x15c')](db[_0x2c81('0x10d')],{'onDelete':_0x2c81('0x171')});db['WhatsappApplication'][_0x2c81('0x15c')](db[_0x2c81('0x102')],{'onDelete':_0x2c81('0x171')});db[_0x2c81('0x104')][_0x2c81('0x15c')](db[_0x2c81('0x160')],{'onDelete':'restrict','foreignKey':'IntervalId'});db['WhatsappApplication'][_0x2c81('0x15c')](db[_0x2c81('0x91')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x2c81('0x105')][_0x2c81('0x11b')](db[_0x2c81('0x107')],{'as':_0x2c81('0x168'),'onDelete':'cascade','foreignKey':_0x2c81('0x207')});db[_0x2c81('0x105')][_0x2c81('0x15c')](db['WhatsappAccount'],{'as':_0x2c81('0x18f'),'foreignKey':_0x2c81('0x206')});db[_0x2c81('0x105')][_0x2c81('0x15c')](db[_0x2c81('0x75')],{'as':_0x2c81('0x180'),'foreignKey':_0x2c81('0x16e')});db[_0x2c81('0x105')][_0x2c81('0x15c')](db[_0x2c81('0x12')],{'as':_0x2c81('0x179'),'foreignKey':_0x2c81('0x11a')});db['WhatsappInteraction']['belongsToMany'](db[_0x2c81('0x91')],{'through':_0x2c81('0x208'),'as':'Tags'});db['WhatsappInteraction'][_0x2c81('0x130')](db[_0x2c81('0x91')],{'through':'whatsapp_interaction_has_tags','as':'ThroughTags'});db['WhatsappInteraction'][_0x2c81('0x130')](db['User'],{'as':'Users','through':_0x2c81('0x13b'),'foreignKey':'WhatsappInteractionId'});db[_0x2c81('0x107')][_0x2c81('0x15c')](db[_0x2c81('0x12')],{'as':'User'});db[_0x2c81('0x107')]['belongsTo'](db[_0x2c81('0x75')],{'onDelete':_0x2c81('0x118'),'as':_0x2c81('0x180')});db[_0x2c81('0x107')][_0x2c81('0x15c')](db[_0x2c81('0x105')],{'onDelete':'cascade','as':_0x2c81('0x181'),'foreignKey':_0x2c81('0x207')});db[_0x2c81('0x107')][_0x2c81('0x15c')](db['WhatsappAccount'],{'as':_0x2c81('0x18f'),'foreignKey':_0x2c81('0x206')});db[_0x2c81('0x109')][_0x2c81('0x15c')](db['WhatsappAccount'],{});db[_0x2c81('0x109')][_0x2c81('0x15c')](db['CmList'],{'as':_0x2c81('0x175'),'foreignKey':'ListId'});db[_0x2c81('0x109')]['belongsTo'](db[_0x2c81('0x75')],{'as':_0x2c81('0x180'),'foreignKey':_0x2c81('0x16e')});db[_0x2c81('0x109')][_0x2c81('0x15c')](db['WhatsappInteraction'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x2c81('0x10d')],{});db[_0x2c81('0x109')][_0x2c81('0x15c')](db[_0x2c81('0x107')],{});db[_0x2c81('0x109')]['belongsTo'](db[_0x2c81('0x12')],{});db['WhatsappTransferReport'][_0x2c81('0x15c')](db[_0x2c81('0x107')],{});db[_0x2c81('0x10b')][_0x2c81('0x15c')](db[_0x2c81('0x105')],{});db['WhatsappTransferReport'][_0x2c81('0x15c')](db[_0x2c81('0x102')],{'foreignKey':_0x2c81('0x209'),'as':_0x2c81('0x1ef')});db[_0x2c81('0x10b')][_0x2c81('0x15c')](db['WhatsappAccount'],{'foreignKey':_0x2c81('0x20a'),'as':_0x2c81('0x1f5')});db[_0x2c81('0x10b')][_0x2c81('0x15c')](db[_0x2c81('0x10d')],{'foreignKey':_0x2c81('0x20b'),'as':_0x2c81('0x1f9')});db[_0x2c81('0x10b')][_0x2c81('0x15c')](db[_0x2c81('0x12')],{'foreignKey':_0x2c81('0x1f0'),'as':'FromAgent'});db[_0x2c81('0x10b')][_0x2c81('0x15c')](db[_0x2c81('0x12')],{'foreignKey':'ToUserId','as':_0x2c81('0x1f3')});db[_0x2c81('0x10d')]['belongsToMany'](db[_0x2c81('0x12')],{'as':_0x2c81('0x165'),'through':'UserWhatsappQueue','foreignKey':_0x2c81('0x20c')});db[_0x2c81('0x10d')][_0x2c81('0x130')](db[_0x2c81('0xeb')],{'through':_0x2c81('0x1e9'),'as':_0x2c81('0x166')});db[_0x2c81('0x115')]['belongsTo'](db['User'],{'as':_0x2c81('0x20d'),'foreignKey':_0x2c81('0x11a'),'onDelete':_0x2c81('0x118'),'hooks':!![]});db[_0x2c81('0x10f')][_0x2c81('0x117')](db[_0x2c81('0xc8')],{'as':_0x2c81('0xc8'),'onDelete':_0x2c81('0x171')});db[_0x2c81('0x10f')]['hasOne'](db['MailServerIn'],{'as':'Imap','onDelete':_0x2c81('0x171')});db[_0x2c81('0x10f')][_0x2c81('0x117')](db[_0x2c81('0x172')],{'as':_0x2c81('0x174'),'onDelete':_0x2c81('0x171')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index f56dd28..2123226 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7aa3=['./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','/api/actions','./api/action','/api/automations','./api/automation','/api/dispositions','./api/disposition','/api/pauses','./api/pause','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','/api/tags','./api/tag','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','/api/analytics/metrics','/api/analytics/field_reports','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','./api/squareProject','/api/square/recordings','./api/squareRecording','./api/squareMessage','/api/teams','./api/team','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','/api/plugins','./api/plugin','/api/mail/reports/transfer','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','./api/voicePrefix','/api/userProfiles','./api/userProfile','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','/api/rpc','./api/rpc','/api/version','./api/version','./api/system','/api/pm2','./api/webbar','/apidoc','static','join','root','/www','/demo','/snippet','snippet','3.8.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','path','./errors','./utils/client-side-logger','setupLoggers','./api/client-side-logs','then','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','./api/voiceQueue','./api/voiceRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','/api/voice/calls/reports','/api/voice/dials/reports','/api/voice/agents/reports','./api/voiceAgentReport','./api/voiceQueueReport','/api/members/reports','./api/trunk','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailApplication','/api/mail/reports/queue','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','/api/sms/queues','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts'];(function(_0xce4830,_0x11218d){var _0x50c1d3=function(_0x21f78d){while(--_0x21f78d){_0xce4830['push'](_0xce4830['shift']());}};_0x50c1d3(++_0x11218d);}(_0x7aa3,0x1c9));var _0x37aa=function(_0x249e26,_0x2d953e){_0x249e26=_0x249e26-0x0;var _0x2a45c4=_0x7aa3[_0x249e26];return _0x2a45c4;};'use strict';var path=require(_0x37aa('0x0'));var express=require('express');var errors=require(_0x37aa('0x1'));var config=require('./config/environment');var setupLoggers=require(_0x37aa('0x2'))[_0x37aa('0x3')];var clientSideLogs=require(_0x37aa('0x4'));exports['default']=function(_0x5d0cd9){return setupLoggers(_0x5d0cd9)[_0x37aa('0x5')](function(){_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x7'),require(_0x37aa('0x8')));_0x5d0cd9['use'](_0x37aa('0x9'),require('./api/voiceChanSpy'));_0x5d0cd9[_0x37aa('0x6')]('/api/voice/contexts',require(_0x37aa('0xa')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0xb'),require(_0x37aa('0xc')));_0x5d0cd9[_0x37aa('0x6')]('/api/voice/mohs',require(_0x37aa('0xd')));_0x5d0cd9['use']('/api/voice/queues',require(_0x37aa('0xe')));_0x5d0cd9[_0x37aa('0x6')]('/api/voice/recordings',require(_0x37aa('0xf')));_0x5d0cd9[_0x37aa('0x6')]('/api/screen/recordings',require('./api/screenRecording'));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x10'),require(_0x37aa('0x11')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x12'),require('./api/voiceMailMessage'));_0x5d0cd9['use'](_0x37aa('0x13'),require('./api/voiceCallReport'));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x14'),require('./api/voiceDialReport'));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x15'),require(_0x37aa('0x16')));_0x5d0cd9[_0x37aa('0x6')]('/api/voice/queues/reports',require(_0x37aa('0x17')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x18'),require('./api/memberReport'));_0x5d0cd9[_0x37aa('0x6')]('/api/trunks',require(_0x37aa('0x19')));_0x5d0cd9['use']('/api/voice/transfers/reports',require('./api/voiceTransferReport'));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x1a'),require(_0x37aa('0x1b')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x1c'),require(_0x37aa('0x1d')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x1e'),require(_0x37aa('0x1f')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x20'),require(_0x37aa('0x21')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x22'),require(_0x37aa('0x23')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x24'),require('./api/mailMessage'));_0x5d0cd9['use']('/api/mail/applications',require(_0x37aa('0x25')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x26'),require('./api/mailQueueReport'));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x27'),require(_0x37aa('0x28')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x29'),require(_0x37aa('0x2a')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x2b'),require(_0x37aa('0x2c')));_0x5d0cd9[_0x37aa('0x6')]('/api/fax/applications',require(_0x37aa('0x2d')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x2e'),require(_0x37aa('0x2f')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x30'),require(_0x37aa('0x31')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x32'),require(_0x37aa('0x33')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x34'),require('./api/faxQueueReport'));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x35'),require(_0x37aa('0x36')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x37'),require(_0x37aa('0x38')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x39'),require(_0x37aa('0x3a')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x3b'),require('./api/smsMessage'));_0x5d0cd9['use'](_0x37aa('0x3c'),require('./api/smsQueue'));_0x5d0cd9[_0x37aa('0x6')]('/api/openchannel/accounts',require(_0x37aa('0x3d')));_0x5d0cd9['use'](_0x37aa('0x3e'),require(_0x37aa('0x3f')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x40'),require('./api/openchannelInteraction'));_0x5d0cd9[_0x37aa('0x6')]('/api/openchannel/messages',require(_0x37aa('0x41')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x42'),require(_0x37aa('0x43')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x44'),require('./api/chatWebsite'));_0x5d0cd9['use'](_0x37aa('0x45'),require(_0x37aa('0x46')));_0x5d0cd9[_0x37aa('0x6')]('/api/chat/applications',require(_0x37aa('0x47')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x48'),require(_0x37aa('0x49')));_0x5d0cd9[_0x37aa('0x6')]('/api/chat/messages',require(_0x37aa('0x4a')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x4b'),require('./api/chatOfflineMessage'));_0x5d0cd9['use'](_0x37aa('0x4c'),require(_0x37aa('0x4d')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x4e'),require('./api/chatGroup'));_0x5d0cd9['use']('/api/chat/proactive_actions',require(_0x37aa('0x4f')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x50'),require(_0x37aa('0x51')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x52'),require(_0x37aa('0x53')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x54'),require(_0x37aa('0x55')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x56'),require('./api/cmHopperBlack'));_0x5d0cd9['use'](_0x37aa('0x57'),require(_0x37aa('0x58')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x59'),require(_0x37aa('0x5a')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x5b'),require('./api/cmCustomField'));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x5c'),require(_0x37aa('0x5d')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x5e'),require(_0x37aa('0x5f')));_0x5d0cd9['use']('/api/canned_answers',require('./api/cannedAnswer'));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x60'),require(_0x37aa('0x61')));_0x5d0cd9[_0x37aa('0x6')]('/api/conditions',require('./api/condition'));_0x5d0cd9[_0x37aa('0x6')]('/api/intervals',require('./api/interval'));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x62'),require(_0x37aa('0x63')));_0x5d0cd9[_0x37aa('0x6')]('/api/cdr',require('./api/cdr'));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x64'),require(_0x37aa('0x65')));_0x5d0cd9['use'](_0x37aa('0x66'),require(_0x37aa('0x67')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x68'),require('./api/sound'));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x69'),require(_0x37aa('0x6a')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x6b'),require(_0x37aa('0x6c')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x6d'),require(_0x37aa('0x6e')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x6f'),require('./api/cmHopperAdditionalPhone'));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x70'),require(_0x37aa('0x71')));_0x5d0cd9['use'](_0x37aa('0x72'),require(_0x37aa('0x73')));_0x5d0cd9['use'](_0x37aa('0x74'),require(_0x37aa('0x75')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x76'),require('./api/integration'));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x77'),require('./api/integrationReport'));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x78'),require(_0x37aa('0x79')));_0x5d0cd9[_0x37aa('0x6')]('/api/analytics/default_reports',require(_0x37aa('0x7a')));_0x5d0cd9['use'](_0x37aa('0x7b'),require('./api/analyticExtractedReport'));_0x5d0cd9['use'](_0x37aa('0x7c'),require('./api/analyticMetric'));_0x5d0cd9['use'](_0x37aa('0x7d'),require('./api/analyticFieldReport'));_0x5d0cd9['use'](_0x37aa('0x7e'),require(_0x37aa('0x7f')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x80'),require('./api/intSalesforceAccount'));_0x5d0cd9[_0x37aa('0x6')]('/api/integrations/salesforce/configurations',require(_0x37aa('0x81')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x82'),require(_0x37aa('0x83')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x84'),require('./api/intSugarcrmAccount'));_0x5d0cd9['use']('/api/integrations/sugarcrm/configurations',require(_0x37aa('0x85')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x86'),require(_0x37aa('0x87')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x88'),require('./api/intDeskAccount'));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x89'),require('./api/intDeskConfiguration'));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x8a'),require(_0x37aa('0x8b')));_0x5d0cd9['use'](_0x37aa('0x8c'),require('./api/intZohoAccount'));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x8d'),require(_0x37aa('0x8e')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x8f'),require(_0x37aa('0x90')));_0x5d0cd9['use'](_0x37aa('0x91'),require('./api/intZendeskAccount'));_0x5d0cd9['use'](_0x37aa('0x92'),require('./api/intZendeskConfiguration'));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x93'),require(_0x37aa('0x94')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x95'),require(_0x37aa('0x96')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x97'),require('./api/intFreshdeskConfiguration'));_0x5d0cd9[_0x37aa('0x6')]('/api/integrations/freshdesk/fields',require(_0x37aa('0x98')));_0x5d0cd9['use'](_0x37aa('0x99'),require(_0x37aa('0x9a')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x9b'),require(_0x37aa('0x9c')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x9d'),require('./api/intVtigerField'));_0x5d0cd9['use'](_0x37aa('0x9e'),require(_0x37aa('0x9f')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0xa0'),require('./api/intServicenowConfiguration'));_0x5d0cd9['use'](_0x37aa('0xa1'),require('./api/intServicenowField'));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0xa2'),require(_0x37aa('0xa3')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0xa4'),require(_0x37aa('0xa5')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0xa6'),require(_0x37aa('0xa7')));_0x5d0cd9[_0x37aa('0x6')]('/api/integrations/freshsales/accounts',require(_0x37aa('0xa8')));_0x5d0cd9['use'](_0x37aa('0xa9'),require(_0x37aa('0xaa')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0xab'),require('./api/intFreshsalesField'));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0xac'),require(_0x37aa('0xad')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0xae'),require(_0x37aa('0xaf')));_0x5d0cd9[_0x37aa('0x6')]('/api/chat/internal/messages',require('./api/chatInternalMessage'));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0xb0'),require(_0x37aa('0xb1')));_0x5d0cd9[_0x37aa('0x6')]('/api/jscripty/questions/reports',require(_0x37aa('0xb2')));_0x5d0cd9['use'](_0x37aa('0xb3'),require(_0x37aa('0xb4')));_0x5d0cd9[_0x37aa('0x6')]('/api/sms/reports/queue',require(_0x37aa('0xb5')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0xb6'),require(_0x37aa('0xb7')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0xb8'),require('./api/squareReportDetail'));_0x5d0cd9[_0x37aa('0x6')]('/api/jscripty/projects',require(_0x37aa('0xb9')));_0x5d0cd9['use'](_0x37aa('0xba'),require(_0x37aa('0xbb')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0xbc'),require(_0x37aa('0xbd')));_0x5d0cd9[_0x37aa('0x6')]('/api/square/projects',require(_0x37aa('0xbe')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0xbf'),require(_0x37aa('0xc0')));_0x5d0cd9[_0x37aa('0x6')]('/api/square/messages',require(_0x37aa('0xc1')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0xc2'),require(_0x37aa('0xc3')));_0x5d0cd9['use']('/api/license',require('./api/license'));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0xc4'),require(_0x37aa('0xc5')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0xc6'),require(_0x37aa('0xc7')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0xc8'),require('./api/attachment'));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0xc9'),require(_0x37aa('0xca')));_0x5d0cd9['use'](_0x37aa('0xcb'),require('./api/mailTransferReport'));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0xcc'),require(_0x37aa('0xcd')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0xce'),require(_0x37aa('0xcf')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0xd0'),require(_0x37aa('0xd1')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0xd2'),require(_0x37aa('0xd3')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0xd4'),require(_0x37aa('0xd5')));_0x5d0cd9[_0x37aa('0x6')]('/api/voice/prefixes',require(_0x37aa('0xd6')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0xd7'),require(_0x37aa('0xd8')));_0x5d0cd9[_0x37aa('0x6')]('/api/userProfile/sections',require(_0x37aa('0xd9')));_0x5d0cd9['use'](_0x37aa('0xda'),require(_0x37aa('0xdb')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0xdc'),require(_0x37aa('0xdd')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0xde'),require(_0x37aa('0xdf')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0xe0'),require(_0x37aa('0xe1')));_0x5d0cd9[_0x37aa('0x6')]('/api/whatsapp/interactions',require(_0x37aa('0xe2')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0xe3'),require(_0x37aa('0xe4')));_0x5d0cd9['use'](_0x37aa('0xe5'),require('./api/whatsappQueueReport'));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0xe6'),require(_0x37aa('0xe7')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0xe8'),require(_0x37aa('0xe9')));_0x5d0cd9['use']('/api/cloudProviders',require(_0x37aa('0xea')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0xeb'),require(_0x37aa('0xec')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0xed'),require(_0x37aa('0xee')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0xef'),require(_0x37aa('0xf0')));_0x5d0cd9[_0x37aa('0x6')]('/api/auth/google',require(_0x37aa('0xf1')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0xf2'),require(_0x37aa('0xf3')));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0xf4'),require('./api/jira'));_0x5d0cd9['use'](_0x37aa('0xf5'),require(_0x37aa('0xf6')));_0x5d0cd9['use'](_0x37aa('0xf7'),require(_0x37aa('0xf8')));_0x5d0cd9['use']('/api/system',require(_0x37aa('0xf9')));_0x5d0cd9['use'](_0x37aa('0xfa'),require('./api/pm2'));_0x5d0cd9['use']('/api/webbar',require(_0x37aa('0xfb')));_0x5d0cd9['use']('/api/logs',clientSideLogs);_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0xfc'),express[_0x37aa('0xfd')](path[_0x37aa('0xfe')](config[_0x37aa('0xff')],_0x37aa('0xfc'))));_0x5d0cd9['use'](_0x37aa('0x100'),express[_0x37aa('0xfd')](path[_0x37aa('0xfe')](config[_0x37aa('0xff')],_0x37aa('0x100'))));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x101'),express[_0x37aa('0xfd')](path[_0x37aa('0xfe')](config[_0x37aa('0xff')],_0x37aa('0x101'))));_0x5d0cd9[_0x37aa('0x6')](_0x37aa('0x102'),express[_0x37aa('0xfd')](path['join'](config[_0x37aa('0xff')],_0x37aa('0x103'),_0x37aa('0x104'))));_0x5d0cd9['use'](_0x37aa('0x105'),express['static'](path[_0x37aa('0xfe')](config[_0x37aa('0xff')],_0x37aa('0x106'))));_0x5d0cd9[_0x37aa('0x107')](_0x37aa('0x108'))['get'](errors[0x194]);_0x5d0cd9['route']('/*')[_0x37aa('0x109')](function(_0x3d53a5,_0x3bb772){_0x3bb772[_0x37aa('0x10a')](path[_0x37aa('0x10b')](_0x5d0cd9[_0x37aa('0x109')](_0x37aa('0x10c'))+_0x37aa('0x10d')));});return _0x5d0cd9;});}; \ No newline at end of file +var _0x8e32=['./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappQueue','/api/cloudProviders','/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/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','join','root','/www','/demo','static','3.8.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','then','use','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','/api/voice/recordings','/api/screen/recordings','./api/screenRecording','/api/voice/mails','/api/voice/mails/messages','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/agents/reports','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/mail/out_servers','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','/api/dashboards/items','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','./api/smsInteraction','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','./api/cmCompany','./api/cmContact','./api/cmHopper','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','./api/action','/api/automations','./api/automation','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','/api/tags','./api/tag','/api/cm_contact_has_items','/api/cm_hopper_additional_phones','/api/templates','./api/template','/api/triggers','/api/variables','./api/variable','/api/integrations','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/intFreshsalesAccount','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','/api/chat/internal/messages','./api/chatInternalMessage','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','/api/square/reports','./api/squareReport','./api/jscriptyProject','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','./api/squareRecording','/api/square/messages','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','/api/attachments','/api/plugins','./api/plugin','/api/mail/reports/transfer','/api/fax/reports/transfer','/api/openchannel/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/messages'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x8e32,0x13a));var _0x28e3=function(_0x1b0865,_0x1daf7e){_0x1b0865=_0x1b0865-0x0;var _0x318381=_0x8e32[_0x1b0865];return _0x318381;};'use strict';var path=require(_0x28e3('0x0'));var express=require(_0x28e3('0x1'));var errors=require(_0x28e3('0x2'));var config=require(_0x28e3('0x3'));var setupLoggers=require(_0x28e3('0x4'))[_0x28e3('0x5')];var clientSideLogs=require(_0x28e3('0x6'));exports['default']=function(_0x371b62){return setupLoggers(_0x371b62)[_0x28e3('0x7')](function(){_0x371b62[_0x28e3('0x8')]('/api/users',require(_0x28e3('0x9')));_0x371b62[_0x28e3('0x8')](_0x28e3('0xa'),require(_0x28e3('0xb')));_0x371b62['use'](_0x28e3('0xc'),require(_0x28e3('0xd')));_0x371b62[_0x28e3('0x8')](_0x28e3('0xe'),require(_0x28e3('0xf')));_0x371b62['use'](_0x28e3('0x10'),require(_0x28e3('0x11')));_0x371b62[_0x28e3('0x8')](_0x28e3('0x12'),require('./api/voiceQueue'));_0x371b62[_0x28e3('0x8')](_0x28e3('0x13'),require('./api/voiceRecording'));_0x371b62[_0x28e3('0x8')](_0x28e3('0x14'),require(_0x28e3('0x15')));_0x371b62[_0x28e3('0x8')](_0x28e3('0x16'),require('./api/voiceMail'));_0x371b62[_0x28e3('0x8')](_0x28e3('0x17'),require('./api/voiceMailMessage'));_0x371b62['use'](_0x28e3('0x18'),require(_0x28e3('0x19')));_0x371b62[_0x28e3('0x8')](_0x28e3('0x1a'),require('./api/voiceDialReport'));_0x371b62[_0x28e3('0x8')](_0x28e3('0x1b'),require('./api/voiceAgentReport'));_0x371b62[_0x28e3('0x8')](_0x28e3('0x1c'),require(_0x28e3('0x1d')));_0x371b62[_0x28e3('0x8')](_0x28e3('0x1e'),require(_0x28e3('0x1f')));_0x371b62[_0x28e3('0x8')](_0x28e3('0x20'),require(_0x28e3('0x21')));_0x371b62[_0x28e3('0x8')]('/api/voice/transfers/reports',require('./api/voiceTransferReport'));_0x371b62['use'](_0x28e3('0x22'),require('./api/mailServerOut'));_0x371b62['use'](_0x28e3('0x23'),require(_0x28e3('0x24')));_0x371b62[_0x28e3('0x8')](_0x28e3('0x25'),require(_0x28e3('0x26')));_0x371b62['use'](_0x28e3('0x27'),require(_0x28e3('0x28')));_0x371b62[_0x28e3('0x8')](_0x28e3('0x29'),require(_0x28e3('0x2a')));_0x371b62[_0x28e3('0x8')](_0x28e3('0x2b'),require('./api/mailMessage'));_0x371b62[_0x28e3('0x8')](_0x28e3('0x2c'),require(_0x28e3('0x2d')));_0x371b62[_0x28e3('0x8')](_0x28e3('0x2e'),require(_0x28e3('0x2f')));_0x371b62[_0x28e3('0x8')]('/api/dashboards',require(_0x28e3('0x30')));_0x371b62[_0x28e3('0x8')](_0x28e3('0x31'),require('./api/dashboardItem'));_0x371b62[_0x28e3('0x8')](_0x28e3('0x32'),require(_0x28e3('0x33')));_0x371b62[_0x28e3('0x8')](_0x28e3('0x34'),require('./api/faxApplication'));_0x371b62[_0x28e3('0x8')]('/api/fax/interactions',require(_0x28e3('0x35')));_0x371b62[_0x28e3('0x8')](_0x28e3('0x36'),require(_0x28e3('0x37')));_0x371b62[_0x28e3('0x8')](_0x28e3('0x38'),require(_0x28e3('0x39')));_0x371b62[_0x28e3('0x8')](_0x28e3('0x3a'),require(_0x28e3('0x3b')));_0x371b62[_0x28e3('0x8')](_0x28e3('0x3c'),require(_0x28e3('0x3d')));_0x371b62[_0x28e3('0x8')]('/api/sms/applications',require('./api/smsApplication'));_0x371b62[_0x28e3('0x8')]('/api/sms/interactions',require(_0x28e3('0x3e')));_0x371b62[_0x28e3('0x8')]('/api/sms/messages',require(_0x28e3('0x3f')));_0x371b62[_0x28e3('0x8')](_0x28e3('0x40'),require(_0x28e3('0x41')));_0x371b62[_0x28e3('0x8')](_0x28e3('0x42'),require('./api/openchannelAccount'));_0x371b62[_0x28e3('0x8')]('/api/openchannel/applications',require(_0x28e3('0x43')));_0x371b62[_0x28e3('0x8')](_0x28e3('0x44'),require(_0x28e3('0x45')));_0x371b62[_0x28e3('0x8')](_0x28e3('0x46'),require(_0x28e3('0x47')));_0x371b62['use'](_0x28e3('0x48'),require(_0x28e3('0x49')));_0x371b62['use'](_0x28e3('0x4a'),require(_0x28e3('0x4b')));_0x371b62[_0x28e3('0x8')](_0x28e3('0x4c'),require(_0x28e3('0x4d')));_0x371b62['use'](_0x28e3('0x4e'),require(_0x28e3('0x4f')));_0x371b62[_0x28e3('0x8')](_0x28e3('0x50'),require(_0x28e3('0x51')));_0x371b62[_0x28e3('0x8')](_0x28e3('0x52'),require('./api/chatMessage'));_0x371b62[_0x28e3('0x8')](_0x28e3('0x53'),require(_0x28e3('0x54')));_0x371b62[_0x28e3('0x8')](_0x28e3('0x55'),require(_0x28e3('0x56')));_0x371b62[_0x28e3('0x8')](_0x28e3('0x57'),require(_0x28e3('0x58')));_0x371b62[_0x28e3('0x8')](_0x28e3('0x59'),require(_0x28e3('0x5a')));_0x371b62[_0x28e3('0x8')]('/api/cm/companies',require(_0x28e3('0x5b')));_0x371b62[_0x28e3('0x8')]('/api/cm/contacts',require(_0x28e3('0x5c')));_0x371b62[_0x28e3('0x8')]('/api/cm/hopper',require(_0x28e3('0x5d')));_0x371b62['use']('/api/cm/hopper_black',require(_0x28e3('0x5e')));_0x371b62[_0x28e3('0x8')](_0x28e3('0x5f'),require('./api/cmHopperFinal'));_0x371b62['use'](_0x28e3('0x60'),require(_0x28e3('0x61')));_0x371b62['use'](_0x28e3('0x62'),require(_0x28e3('0x63')));_0x371b62[_0x28e3('0x8')]('/api/actions',require(_0x28e3('0x64')));_0x371b62['use'](_0x28e3('0x65'),require(_0x28e3('0x66')));_0x371b62[_0x28e3('0x8')]('/api/canned_answers',require(_0x28e3('0x67')));_0x371b62[_0x28e3('0x8')](_0x28e3('0x68'),require(_0x28e3('0x69')));_0x371b62['use'](_0x28e3('0x6a'),require(_0x28e3('0x6b')));_0x371b62['use'](_0x28e3('0x6c'),require(_0x28e3('0x6d')));_0x371b62[_0x28e3('0x8')](_0x28e3('0x6e'),require('./api/pause'));_0x371b62[_0x28e3('0x8')](_0x28e3('0x6f'),require(_0x28e3('0x70')));_0x371b62[_0x28e3('0x8')](_0x28e3('0x71'),require(_0x28e3('0x72')));_0x371b62[_0x28e3('0x8')](_0x28e3('0x73'),require(_0x28e3('0x74')));_0x371b62[_0x28e3('0x8')]('/api/sounds',require(_0x28e3('0x75')));_0x371b62['use'](_0x28e3('0x76'),require(_0x28e3('0x77')));_0x371b62[_0x28e3('0x8')]('/api/contact_item_types',require('./api/contactItemType'));_0x371b62[_0x28e3('0x8')](_0x28e3('0x78'),require('./api/cmContactHasItem'));_0x371b62[_0x28e3('0x8')](_0x28e3('0x79'),require('./api/cmHopperAdditionalPhone'));_0x371b62[_0x28e3('0x8')](_0x28e3('0x7a'),require(_0x28e3('0x7b')));_0x371b62['use'](_0x28e3('0x7c'),require('./api/trigger'));_0x371b62['use'](_0x28e3('0x7d'),require(_0x28e3('0x7e')));_0x371b62['use'](_0x28e3('0x7f'),require('./api/integration'));_0x371b62['use'](_0x28e3('0x80'),require(_0x28e3('0x81')));_0x371b62[_0x28e3('0x8')](_0x28e3('0x82'),require(_0x28e3('0x83')));_0x371b62[_0x28e3('0x8')](_0x28e3('0x84'),require('./api/analyticDefaultReport'));_0x371b62['use'](_0x28e3('0x85'),require(_0x28e3('0x86')));_0x371b62[_0x28e3('0x8')](_0x28e3('0x87'),require(_0x28e3('0x88')));_0x371b62[_0x28e3('0x8')](_0x28e3('0x89'),require(_0x28e3('0x8a')));_0x371b62['use']('/api/analytics/tree_reports',require(_0x28e3('0x8b')));_0x371b62[_0x28e3('0x8')](_0x28e3('0x8c'),require(_0x28e3('0x8d')));_0x371b62[_0x28e3('0x8')](_0x28e3('0x8e'),require(_0x28e3('0x8f')));_0x371b62[_0x28e3('0x8')](_0x28e3('0x90'),require(_0x28e3('0x91')));_0x371b62[_0x28e3('0x8')](_0x28e3('0x92'),require(_0x28e3('0x93')));_0x371b62[_0x28e3('0x8')](_0x28e3('0x94'),require('./api/intSugarcrmConfiguration'));_0x371b62[_0x28e3('0x8')](_0x28e3('0x95'),require(_0x28e3('0x96')));_0x371b62['use'](_0x28e3('0x97'),require(_0x28e3('0x98')));_0x371b62[_0x28e3('0x8')](_0x28e3('0x99'),require(_0x28e3('0x9a')));_0x371b62[_0x28e3('0x8')](_0x28e3('0x9b'),require(_0x28e3('0x9c')));_0x371b62['use']('/api/integrations/zoho/accounts',require(_0x28e3('0x9d')));_0x371b62[_0x28e3('0x8')](_0x28e3('0x9e'),require(_0x28e3('0x9f')));_0x371b62['use'](_0x28e3('0xa0'),require('./api/intZohoField'));_0x371b62[_0x28e3('0x8')](_0x28e3('0xa1'),require('./api/intZendeskAccount'));_0x371b62['use'](_0x28e3('0xa2'),require(_0x28e3('0xa3')));_0x371b62[_0x28e3('0x8')](_0x28e3('0xa4'),require(_0x28e3('0xa5')));_0x371b62[_0x28e3('0x8')]('/api/integrations/freshdesk/accounts',require(_0x28e3('0xa6')));_0x371b62[_0x28e3('0x8')](_0x28e3('0xa7'),require(_0x28e3('0xa8')));_0x371b62[_0x28e3('0x8')](_0x28e3('0xa9'),require(_0x28e3('0xaa')));_0x371b62[_0x28e3('0x8')]('/api/integrations/vtiger/accounts',require(_0x28e3('0xab')));_0x371b62[_0x28e3('0x8')](_0x28e3('0xac'),require(_0x28e3('0xad')));_0x371b62['use'](_0x28e3('0xae'),require('./api/intVtigerField'));_0x371b62[_0x28e3('0x8')](_0x28e3('0xaf'),require(_0x28e3('0xb0')));_0x371b62[_0x28e3('0x8')](_0x28e3('0xb1'),require('./api/intServicenowConfiguration'));_0x371b62[_0x28e3('0x8')](_0x28e3('0xb2'),require(_0x28e3('0xb3')));_0x371b62[_0x28e3('0x8')](_0x28e3('0xb4'),require(_0x28e3('0xb5')));_0x371b62['use'](_0x28e3('0xb6'),require(_0x28e3('0xb7')));_0x371b62[_0x28e3('0x8')](_0x28e3('0xb8'),require(_0x28e3('0xb9')));_0x371b62[_0x28e3('0x8')]('/api/integrations/freshsales/accounts',require(_0x28e3('0xba')));_0x371b62[_0x28e3('0x8')]('/api/integrations/freshsales/configurations',require('./api/intFreshsalesConfiguration'));_0x371b62['use'](_0x28e3('0xbb'),require(_0x28e3('0xbc')));_0x371b62[_0x28e3('0x8')](_0x28e3('0xbd'),require(_0x28e3('0xbe')));_0x371b62[_0x28e3('0x8')](_0x28e3('0xbf'),require('./api/chatQueueReport'));_0x371b62[_0x28e3('0x8')](_0x28e3('0xc0'),require(_0x28e3('0xc1')));_0x371b62[_0x28e3('0x8')]('/api/jscripty/answers/reports',require('./api/jscriptyAnswerReport'));_0x371b62[_0x28e3('0x8')]('/api/jscripty/questions/reports',require(_0x28e3('0xc2')));_0x371b62['use'](_0x28e3('0xc3'),require(_0x28e3('0xc4')));_0x371b62['use'](_0x28e3('0xc5'),require('./api/smsQueueReport'));_0x371b62[_0x28e3('0x8')](_0x28e3('0xc6'),require(_0x28e3('0xc7')));_0x371b62[_0x28e3('0x8')]('/api/square/details/reports',require('./api/squareReportDetail'));_0x371b62[_0x28e3('0x8')]('/api/jscripty/projects',require(_0x28e3('0xc8')));_0x371b62[_0x28e3('0x8')]('/api/settings',require(_0x28e3('0xc9')));_0x371b62['use'](_0x28e3('0xca'),require(_0x28e3('0xcb')));_0x371b62['use'](_0x28e3('0xcc'),require(_0x28e3('0xcd')));_0x371b62['use']('/api/square/recordings',require(_0x28e3('0xce')));_0x371b62[_0x28e3('0x8')](_0x28e3('0xcf'),require('./api/squareMessage'));_0x371b62[_0x28e3('0x8')]('/api/teams',require(_0x28e3('0xd0')));_0x371b62[_0x28e3('0x8')](_0x28e3('0xd1'),require(_0x28e3('0xd2')));_0x371b62[_0x28e3('0x8')](_0x28e3('0xd3'),require(_0x28e3('0xd4')));_0x371b62[_0x28e3('0x8')](_0x28e3('0xd5'),require('./api/migration'));_0x371b62['use'](_0x28e3('0xd6'),require('./api/attachment'));_0x371b62['use'](_0x28e3('0xd7'),require(_0x28e3('0xd8')));_0x371b62[_0x28e3('0x8')](_0x28e3('0xd9'),require('./api/mailTransferReport'));_0x371b62['use']('/api/chat/reports/transfer',require('./api/chatTransferReport'));_0x371b62[_0x28e3('0x8')](_0x28e3('0xda'),require('./api/faxTransferReport'));_0x371b62[_0x28e3('0x8')](_0x28e3('0xdb'),require('./api/openchannelTransferReport'));_0x371b62[_0x28e3('0x8')](_0x28e3('0xdc'),require(_0x28e3('0xdd')));_0x371b62['use']('/api/cm/lists',require(_0x28e3('0xde')));_0x371b62[_0x28e3('0x8')](_0x28e3('0xdf'),require(_0x28e3('0xe0')));_0x371b62[_0x28e3('0x8')](_0x28e3('0xe1'),require(_0x28e3('0xe2')));_0x371b62[_0x28e3('0x8')](_0x28e3('0xe3'),require(_0x28e3('0xe4')));_0x371b62[_0x28e3('0x8')](_0x28e3('0xe5'),require(_0x28e3('0xe6')));_0x371b62['use'](_0x28e3('0xe7'),require(_0x28e3('0xe8')));_0x371b62[_0x28e3('0x8')](_0x28e3('0xe9'),require(_0x28e3('0xea')));_0x371b62[_0x28e3('0x8')](_0x28e3('0xeb'),require(_0x28e3('0xec')));_0x371b62[_0x28e3('0x8')]('/api/whatsapp/interactions',require('./api/whatsappInteraction'));_0x371b62[_0x28e3('0x8')](_0x28e3('0xed'),require(_0x28e3('0xee')));_0x371b62['use'](_0x28e3('0xef'),require(_0x28e3('0xf0')));_0x371b62[_0x28e3('0x8')](_0x28e3('0xf1'),require('./api/whatsappTransferReport'));_0x371b62[_0x28e3('0x8')]('/api/whatsapp/queues',require(_0x28e3('0xf2')));_0x371b62['use'](_0x28e3('0xf3'),require('./api/cloudProvider'));_0x371b62['use'](_0x28e3('0xf4'),require(_0x28e3('0xf5')));_0x371b62[_0x28e3('0x8')]('/api/user-settings',require(_0x28e3('0xf6')));_0x371b62[_0x28e3('0x8')](_0x28e3('0xf7'),require('./api/authLocal'));_0x371b62[_0x28e3('0x8')](_0x28e3('0xf8'),require(_0x28e3('0xf9')));_0x371b62[_0x28e3('0x8')](_0x28e3('0xfa'),require(_0x28e3('0xfb')));_0x371b62['use']('/api/jira',require(_0x28e3('0xfc')));_0x371b62['use'](_0x28e3('0xfd'),require('./api/rpc'));_0x371b62['use'](_0x28e3('0xfe'),require(_0x28e3('0xff')));_0x371b62[_0x28e3('0x8')](_0x28e3('0x100'),require('./api/system'));_0x371b62[_0x28e3('0x8')](_0x28e3('0x101'),require(_0x28e3('0x102')));_0x371b62[_0x28e3('0x8')](_0x28e3('0x103'),require(_0x28e3('0x104')));_0x371b62[_0x28e3('0x8')](_0x28e3('0x105'),clientSideLogs);_0x371b62['use'](_0x28e3('0x106'),express['static'](path[_0x28e3('0x107')](config[_0x28e3('0x108')],'/apidoc')));_0x371b62['use'](_0x28e3('0x109'),express['static'](path[_0x28e3('0x107')](config[_0x28e3('0x108')],'/www')));_0x371b62[_0x28e3('0x8')](_0x28e3('0x10a'),express['static'](path[_0x28e3('0x107')](config[_0x28e3('0x108')],_0x28e3('0x10a'))));_0x371b62[_0x28e3('0x8')]('/snippet',express[_0x28e3('0x10b')](path[_0x28e3('0x107')](config[_0x28e3('0x108')],'snippet',_0x28e3('0x10c'))));_0x371b62['use'](_0x28e3('0x10d'),express[_0x28e3('0x10b')](path['join'](config[_0x28e3('0x108')],_0x28e3('0x10e'))));_0x371b62[_0x28e3('0x10f')](_0x28e3('0x110'))[_0x28e3('0x111')](errors[0x194]);_0x371b62[_0x28e3('0x10f')]('/*')['get'](function(_0x42127a,_0x4698a6){_0x4698a6['sendFile'](path[_0x28e3('0x112')](_0x371b62[_0x28e3('0x111')]('appPath')+_0x28e3('0x113')));});return _0x371b62;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index b42d5b6..fa5f7bc 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf5dc=['../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','server','http','rpc','port','localhost','error','log','../config/triggers','../config/environment','listen','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/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc'];(function(_0x445b31,_0x53ed18){var _0x55dd44=function(_0x11c035){while(--_0x11c035){_0x445b31['push'](_0x445b31['shift']());}};_0x55dd44(++_0x53ed18);}(_0xf5dc,0x117));var _0xcf5d=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xf5dc[_0x3ab51d];return _0x29a04e;};'use strict';var jayson=require('jayson/promise');var _=require('lodash');var config=require(_0xcf5d('0x0'));exports[_0xcf5d('0x1')]=function(){return new Promise(function(_0x5f11e5,_0x50c2d8){var _0x177b2d={};_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require(_0xcf5d('0x3')));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require(_0xcf5d('0x4')));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require(_0xcf5d('0x5')));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require(_0xcf5d('0x6')));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require(_0xcf5d('0x7')));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require(_0xcf5d('0x8')));_0x177b2d=_['merge'](_0x177b2d,require(_0xcf5d('0x9')));_0x177b2d=_['merge'](_0x177b2d,require(_0xcf5d('0xa')));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require('../api/memberReport/memberReport.rpc'));_0x177b2d=_['merge'](_0x177b2d,require(_0xcf5d('0xb')));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require(_0xcf5d('0xc')));_0x177b2d=_['merge'](_0x177b2d,require(_0xcf5d('0xd')));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require(_0xcf5d('0xe')));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require('../api/mailAccount/mailAccount.rpc'));_0x177b2d=_['merge'](_0x177b2d,require(_0xcf5d('0xf')));_0x177b2d=_['merge'](_0x177b2d,require('../api/mailInteraction/mailInteraction.rpc'));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require(_0xcf5d('0x10')));_0x177b2d=_['merge'](_0x177b2d,require(_0xcf5d('0x11')));_0x177b2d=_['merge'](_0x177b2d,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require(_0xcf5d('0x12')));_0x177b2d=_['merge'](_0x177b2d,require(_0xcf5d('0x13')));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require('../api/faxInteraction/faxInteraction.rpc'));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require(_0xcf5d('0x14')));_0x177b2d=_['merge'](_0x177b2d,require(_0xcf5d('0x15')));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require(_0xcf5d('0x16')));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require(_0xcf5d('0x17')));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require(_0xcf5d('0x18')));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require('../api/smsMessage/smsMessage.rpc'));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require(_0xcf5d('0x19')));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require(_0xcf5d('0x1a')));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require(_0xcf5d('0x1b')));_0x177b2d=_['merge'](_0x177b2d,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require(_0xcf5d('0x1c')));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require(_0xcf5d('0x1d')));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require(_0xcf5d('0x1e')));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require(_0xcf5d('0x1f')));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require(_0xcf5d('0x20')));_0x177b2d=_['merge'](_0x177b2d,require('../api/cmHopper/cmHopper.rpc'));_0x177b2d=_['merge'](_0x177b2d,require(_0xcf5d('0x21')));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require(_0xcf5d('0x22')));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require(_0xcf5d('0x23')));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require(_0xcf5d('0x24')));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require('../api/sound/sound.rpc'));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require(_0xcf5d('0x25')));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require(_0xcf5d('0x26')));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require(_0xcf5d('0x27')));_0x177b2d=_['merge'](_0x177b2d,require(_0xcf5d('0x28')));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require(_0xcf5d('0x29')));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require(_0xcf5d('0x2a')));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require(_0xcf5d('0x2b')));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x177b2d=_['merge'](_0x177b2d,require(_0xcf5d('0x2c')));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require(_0xcf5d('0x2d')));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require(_0xcf5d('0x2e')));_0x177b2d=_['merge'](_0x177b2d,require(_0xcf5d('0x2f')));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require(_0xcf5d('0x30')));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require('../api/squareReport/squareReport.rpc'));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require(_0xcf5d('0x31')));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require(_0xcf5d('0x32')));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require(_0xcf5d('0x33')));_0x177b2d=_['merge'](_0x177b2d,require('../api/squareProject/squareProject.rpc'));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require('../api/squareRecording/squareRecording.rpc'));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require('../api/squareMessage/squareMessage.rpc'));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require(_0xcf5d('0x34')));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require(_0xcf5d('0x35')));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require(_0xcf5d('0x36')));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require(_0xcf5d('0x37')));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require(_0xcf5d('0x38')));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x177b2d=_[_0xcf5d('0x2')](_0x177b2d,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x5c23a8=jayson[_0xcf5d('0x39')](_0x177b2d)[_0xcf5d('0x3a')]();var _0x249cde=config[_0xcf5d('0x3b')][_0xcf5d('0x3c')]||config[_0xcf5d('0x3c')]+0x1;var _0xba42fc=config[_0xcf5d('0x3b')]['ip']||_0xcf5d('0x3d');_0x5c23a8['on'](_0xcf5d('0x3e'),function(_0x52c1d1){return _0x50c2d8(_0x52c1d1);});_0x5c23a8[_0xcf5d('0x1')](_0x249cde,_0xba42fc,function(){console[_0xcf5d('0x3f')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0xba42fc,_0x249cde);require(_0xcf5d('0x40'))['default']();return _0x5f11e5('RPC\x20listening\x20on\x20'+_0xba42fc+':'+_0x249cde);});});}; \ No newline at end of file +var _0x5ff6=['../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/variable/variable.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc'];(function(_0x23ac57,_0x2bebdf){var _0x43e6c5=function(_0x546e0a){while(--_0x546e0a){_0x23ac57['push'](_0x23ac57['shift']());}};_0x43e6c5(++_0x2bebdf);}(_0x5ff6,0x18d));var _0x65ff=function(_0x2d9d4b,_0xc3127a){_0x2d9d4b=_0x2d9d4b-0x0;var _0x1b6b88=_0x5ff6[_0x2d9d4b];return _0x1b6b88;};'use strict';var jayson=require(_0x65ff('0x0'));var _=require(_0x65ff('0x1'));var config=require(_0x65ff('0x2'));exports[_0x65ff('0x3')]=function(){return new Promise(function(_0x2658b0,_0x1d2882){var _0x456a64={};_0x456a64=_[_0x65ff('0x4')](_0x456a64,require(_0x65ff('0x5')));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require('../api/voiceExtension/voiceExtension.rpc'));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require(_0x65ff('0x6')));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require('../api/voiceRecording/voiceRecording.rpc'));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require(_0x65ff('0x7')));_0x456a64=_['merge'](_0x456a64,require(_0x65ff('0x8')));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require(_0x65ff('0x9')));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require(_0x65ff('0xa')));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require(_0x65ff('0xb')));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x456a64=_['merge'](_0x456a64,require(_0x65ff('0xc')));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require(_0x65ff('0xd')));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require(_0x65ff('0xe')));_0x456a64=_['merge'](_0x456a64,require('../api/mailQueue/mailQueue.rpc'));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require('../api/mailInteraction/mailInteraction.rpc'));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require(_0x65ff('0xf')));_0x456a64=_['merge'](_0x456a64,require(_0x65ff('0x10')));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require(_0x65ff('0x11')));_0x456a64=_['merge'](_0x456a64,require(_0x65ff('0x12')));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require(_0x65ff('0x13')));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require('../api/faxInteraction/faxInteraction.rpc'));_0x456a64=_['merge'](_0x456a64,require(_0x65ff('0x14')));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require('../api/faxQueue/faxQueue.rpc'));_0x456a64=_['merge'](_0x456a64,require(_0x65ff('0x15')));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require(_0x65ff('0x16')));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require(_0x65ff('0x17')));_0x456a64=_['merge'](_0x456a64,require(_0x65ff('0x18')));_0x456a64=_['merge'](_0x456a64,require(_0x65ff('0x19')));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require(_0x65ff('0x1a')));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require(_0x65ff('0x1b')));_0x456a64=_['merge'](_0x456a64,require(_0x65ff('0x1c')));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require(_0x65ff('0x1d')));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require(_0x65ff('0x1e')));_0x456a64=_['merge'](_0x456a64,require(_0x65ff('0x1f')));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require(_0x65ff('0x20')));_0x456a64=_['merge'](_0x456a64,require(_0x65ff('0x21')));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require(_0x65ff('0x22')));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require('../api/cmHopper/cmHopper.rpc'));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require(_0x65ff('0x23')));_0x456a64=_['merge'](_0x456a64,require(_0x65ff('0x24')));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require(_0x65ff('0x25')));_0x456a64=_['merge'](_0x456a64,require(_0x65ff('0x26')));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require(_0x65ff('0x27')));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require('../api/sound/sound.rpc'));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require(_0x65ff('0x28')));_0x456a64=_['merge'](_0x456a64,require(_0x65ff('0x29')));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require('../api/trigger/trigger.rpc'));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require(_0x65ff('0x2a')));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require(_0x65ff('0x2b')));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require(_0x65ff('0x2c')));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require(_0x65ff('0x2d')));_0x456a64=_['merge'](_0x456a64,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require(_0x65ff('0x2e')));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require(_0x65ff('0x2f')));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require('../api/squareReport/squareReport.rpc'));_0x456a64=_['merge'](_0x456a64,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require(_0x65ff('0x30')));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require(_0x65ff('0x31')));_0x456a64=_['merge'](_0x456a64,require(_0x65ff('0x32')));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require(_0x65ff('0x33')));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require(_0x65ff('0x34')));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require(_0x65ff('0x35')));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require('../api/attachment/attachment.rpc'));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require(_0x65ff('0x36')));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require(_0x65ff('0x37')));_0x456a64=_['merge'](_0x456a64,require(_0x65ff('0x38')));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require(_0x65ff('0x39')));_0x456a64=_['merge'](_0x456a64,require(_0x65ff('0x3a')));_0x456a64=_[_0x65ff('0x4')](_0x456a64,require(_0x65ff('0x3b')));var _0x3fb241=jayson[_0x65ff('0x3c')](_0x456a64)[_0x65ff('0x3d')]();var _0x4ad723=config[_0x65ff('0x3e')][_0x65ff('0x3f')]||config['port']+0x1;var _0x43986d=config['rpc']['ip']||_0x65ff('0x40');_0x3fb241['on'](_0x65ff('0x41'),function(_0x5a9f42){return _0x1d2882(_0x5a9f42);});_0x3fb241[_0x65ff('0x3')](_0x4ad723,_0x43986d,function(){console[_0x65ff('0x42')](_0x65ff('0x43'),_0x43986d,_0x4ad723);require(_0x65ff('0x44'))[_0x65ff('0x45')]();return _0x2658b0(_0x65ff('0x46')+_0x43986d+':'+_0x4ad723);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 1aedf15..c6694af 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 _0xef66=['STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','util','lodash','events','EventEmitter','./reply','call','setEncoding','utf8','setTimeout','emit','ready','line','toLowerCase','hangup','520-Invalid','search','520\x20End\x20of\x20proper','function','substring','no\x20code','replace','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','timeout','E_AGI_SOCKET_TIMEOUT','pipe','command','write','inherits','prototype','sendRequest','sync','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','EXEC\x20%s\x20%s','join','setContext','setExtension','SET\x20PRIORITY\x20%s','isBoolean','isNumber','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','sayDigits','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','recordFile','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile'];(function(_0x1e1526,_0x37e3d3){var _0x2ffb34=function(_0x5ed43b){while(--_0x5ed43b){_0x1e1526['push'](_0x1e1526['shift']());}};_0x2ffb34(++_0x37e3d3);}(_0xef66,0x1db));var _0x6ef6=function(_0x3dda21,_0x2d53bf){_0x3dda21=_0x3dda21-0x0;var _0x1eb3d1=_0xef66[_0x3dda21];return _0x1eb3d1;};'use strict';var util=require(_0x6ef6('0x0'));var _=require(_0x6ef6('0x1'));var EventEmitter=require(_0x6ef6('0x2'))[_0x6ef6('0x3')];var AGIReply=require(_0x6ef6('0x4'));var AGIError=require('./error');function AGIChannel(_0x555330){var _0x447651=this,_0x2443db=new AGIReply(),_0x337718=![],_0x1cc212={};EventEmitter[_0x6ef6('0x5')](_0x447651);_0x555330[_0x6ef6('0x6')](_0x6ef6('0x7'));_0x555330[_0x6ef6('0x8')](0x8*0x3c*0x3c*0x3e8);_0x2443db[_0x6ef6('0x6')]('utf8');_0x2443db['on']('headers',function(_0xc0d555){for(var _0xeccd37 in _0xc0d555){_0x447651[_0xeccd37]=_0xc0d555[_0xeccd37];}_0x447651[_0x6ef6('0x9')](_0x6ef6('0xa'));});_0x2443db['on'](_0x6ef6('0xb'),function(_0x49fed5){if(_0x49fed5[_0x6ef6('0xc')]()=='hangup'){_0x447651['emit'](_0x6ef6('0xd'));return;}if(_0x49fed5['substring'](0x0,0xb)==_0x6ef6('0xe')){_0x337718=!![];}if(_0x337718){_0x1cc212['rx']+=_0x49fed5+'\x0a';if(_0x49fed5[_0x6ef6('0xf')](_0x6ef6('0x10'))!=-0x1){_0x337718=![];}}else{_0x1cc212['rx']=_0x49fed5;}if(_0x337718){return;}if(typeof _0x1cc212['cb']==_0x6ef6('0x11')){var _0x596b91=_0x1cc212['rx'][_0x6ef6('0x12')](0x0,0x3),_0x3aa045=null,_0x22b44e=null;_0x596b91=parseInt(_0x596b91);if(isNaN(_0x596b91)){_0x1cc212['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x6ef6('0x13')});return;}if(_0x596b91!=0xc8){_0x1cc212['cb'](null,{'code':_0x596b91,'result':-0x1,'extra':'KO'});return;}_0x3aa045=_0x1cc212['rx']['substring'](0x4)[_0x6ef6('0x14')]('result=','');if(_0x3aa045[_0x6ef6('0x15')]('\x20')!=-0x1){_0x3aa045=_0x3aa045[_0x6ef6('0x16')](0x0,_0x3aa045['indexOf']('\x20'));}if(_[_0x6ef6('0x17')](_0x3aa045,'-1')){_0x3aa045=parseInt(_0x3aa045);}_0x22b44e=_0x1cc212['rx'][_0x6ef6('0x18')]('\x20');if(_0x22b44e[_0x6ef6('0x19')]==0x3){_0x22b44e=_0x22b44e[0x2][_0x6ef6('0x12')](0x1,_0x22b44e[0x2][_0x6ef6('0x19')]-0x1);}else if(_0x22b44e[_0x6ef6('0x19')]>0x3){var _0x4ea222=/\((.+)\)/;var _0x30b8e8=_0x1cc212['rx'][_0x6ef6('0x1a')](_0x4ea222);if(_0x30b8e8){_0x22b44e=_0x30b8e8[0x1];}else{_0x22b44e=null;}}else{_0x22b44e=null;}_0x1cc212['cb'](null,{'code':_0x596b91,'result':_0x3aa045,'extra':_0x22b44e});}});_0x555330['on'](_0x6ef6('0x1b'),function(_0x53586d){_0x447651[_0x6ef6('0x9')](_0x6ef6('0x1b'),new AGIError(_0x6ef6('0x1c'),_0x53586d[_0x6ef6('0x1d')]));});_0x555330['on'](_0x6ef6('0x1e'),function(){_0x447651[_0x6ef6('0x9')](_0x6ef6('0x1e'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x555330['on'](_0x6ef6('0x1f'),function(){_0x447651[_0x6ef6('0x9')](_0x6ef6('0x1f'),new AGIError(_0x6ef6('0x20')));_0x555330['destroy']();});_0x555330[_0x6ef6('0x21')](_0x2443db);this[_0x6ef6('0x22')]=function(_0xed332b,_0x4f6df6){var _0xed332b=_0xed332b||'',_0x4f6df6=typeof _0x4f6df6=='function'?_0x4f6df6:new Function();_0x1cc212={'tx':_0xed332b,'rx':'','cb':_0x4f6df6};_0x555330[_0x6ef6('0x23')](_0xed332b+'\x0a');},this[_0x6ef6('0x1e')]=function(){_0x555330['destroy']();};}util[_0x6ef6('0x24')](AGIChannel,EventEmitter);AGIChannel[_0x6ef6('0x25')][_0x6ef6('0x26')]=function(_0x414def){return this[_0x6ef6('0x22')][_0x6ef6('0x27')](this,_0x414def);};AGIChannel[_0x6ef6('0x25')]['answer']=function(){return this[_0x6ef6('0x26')]('ANSWER');};AGIChannel[_0x6ef6('0x25')][_0x6ef6('0x28')]=function(_0x443ded,_0xada7a8,_0x1faa2c){_0x443ded=_0x443ded===undefined?_0x6ef6('0x29'):_0x443ded;_0xada7a8=_0xada7a8===undefined?'5':_0xada7a8;_0x1faa2c=_0x1faa2c===undefined?'1':_0x1faa2c;return this[_0x6ef6('0x26')](util[_0x6ef6('0x2a')](_0x6ef6('0x2b'),_0x443ded,_0xada7a8*0x3e8,_0x1faa2c));};AGIChannel[_0x6ef6('0x25')][_0x6ef6('0x2c')]=function(_0x2d87a8){_0x2d87a8=_0x2d87a8||_0x6ef6('0x2d');return this[_0x6ef6('0x26')](util[_0x6ef6('0x2a')](_0x6ef6('0x2e'),_0x2d87a8));};AGIChannel[_0x6ef6('0x25')][_0x6ef6('0x2f')]=function(_0x24eeae,_0x23f979){if(_['isArray'](_0x23f979)){return this[_0x6ef6('0x26')](util['format'](_0x6ef6('0x30'),_0x24eeae,_0x23f979[_0x6ef6('0x31')](',')));}return this[_0x6ef6('0x26')](util['format']('EXEC\x20%s\x20%s',_0x24eeae,_0x23f979));};AGIChannel[_0x6ef6('0x25')][_0x6ef6('0x32')]=function(_0x335b1d){return this['sendRequest'](util[_0x6ef6('0x2a')]('SET\x20CONTEXT\x20%s',_0x335b1d));};AGIChannel[_0x6ef6('0x25')][_0x6ef6('0x33')]=function(_0x4cdb58){return this['sendRequest'](util[_0x6ef6('0x2a')]('SET\x20EXTENSION\x20%s',_0x4cdb58));};AGIChannel[_0x6ef6('0x25')]['setPriority']=function(_0x3f0ada){return this['sendRequest'](util['format'](_0x6ef6('0x34'),_0x3f0ada));};AGIChannel[_0x6ef6('0x25')]['hangup']=function(){return this[_0x6ef6('0x26')]('HANGUP');};AGIChannel[_0x6ef6('0x25')]['setVariable']=function(_0x215daf,_0x5cf0ea){var _0x28dda7=_[_0x6ef6('0x35')](_0x5cf0ea)||_[_0x6ef6('0x36')](_0x5cf0ea)?_0x5cf0ea['toString']():_0x5cf0ea;return this['sendRequest'](util[_0x6ef6('0x2a')](_0x6ef6('0x37'),_0x215daf,_0x28dda7?_0x28dda7[_0x6ef6('0x38')]()[_0x6ef6('0x14')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype']['sayNumber']=function(_0x2ed80c,_0x55212c){return this['sendRequest'](util[_0x6ef6('0x2a')]('SAY\x20NUMBER\x20%s\x20%s',_0x2ed80c,_0x55212c));};AGIChannel[_0x6ef6('0x25')][_0x6ef6('0x39')]=function(_0x30649c,_0x31facc){return this[_0x6ef6('0x26')](util[_0x6ef6('0x2a')](_0x6ef6('0x3a'),_0x30649c,_0x31facc));};AGIChannel['prototype'][_0x6ef6('0x3b')]=function(_0x58fed8,_0x522399){return this[_0x6ef6('0x26')](util[_0x6ef6('0x2a')](_0x6ef6('0x3c'),_0x58fed8,_0x522399));};AGIChannel['prototype'][_0x6ef6('0x3d')]=function(_0x3855b5,_0x215529,_0x513103){_0x215529=_0x215529||this[_0x6ef6('0x3e')];_0x513103=_0x513103||0x1;this[_0x6ef6('0x32')](_0x3855b5);this[_0x6ef6('0x33')](_0x215529);this[_0x6ef6('0x3f')](_0x513103);return this[_0x6ef6('0x2c')](util[_0x6ef6('0x2a')](_0x6ef6('0x40'),_0x3855b5,_0x215529,_0x513103));};AGIChannel[_0x6ef6('0x25')][_0x6ef6('0x41')]=function(_0x230f30){return this['sendRequest'](util[_0x6ef6('0x2a')](_0x6ef6('0x42'),_0x230f30));};AGIChannel[_0x6ef6('0x25')][_0x6ef6('0x43')]=function(_0x4f3b4f,_0x23abee,_0x2bbbbd,_0x16cc42,_0x1418e8,_0x3592a5){_0x23abee=_0x23abee||_0x6ef6('0x44');_0x2bbbbd=_0x2bbbbd||'';_0x16cc42=_0x16cc42===undefined?-0x1:_0x16cc42==='-1'?-0x1:_0x16cc42*0x3e8;_0x1418e8=_0x1418e8===undefined?'':'s='+_0x1418e8;_0x3592a5=_0x3592a5?'BEEP':'';return this[_0x6ef6('0x26')](util['format'](_0x6ef6('0x45'),_0x4f3b4f,_0x23abee,_0x2bbbbd,_0x16cc42,_0x3592a5,_0x1418e8));};AGIChannel['prototype'][_0x6ef6('0x46')]=function(_0x16edb3,_0x5aa8f3){_0x5aa8f3=_0x5aa8f3||'';return this[_0x6ef6('0x26')](util[_0x6ef6('0x2a')](_0x6ef6('0x47'),_0x16edb3,_0x5aa8f3));};AGIChannel[_0x6ef6('0x25')][_0x6ef6('0x48')]=function(_0x5dfd25){return this[_0x6ef6('0x2f')](_0x6ef6('0x49'),_0x5dfd25);};AGIChannel[_0x6ef6('0x25')][_0x6ef6('0x4a')]=function(_0x26e869){return this[_0x6ef6('0x2f')](_0x6ef6('0x4b'),_0x26e869);};AGIChannel[_0x6ef6('0x25')]['error']=function(_0x367df3,_0x2d54c0){this['noop'](util['format'](_0x6ef6('0x4c'),_0x367df3['id'],_0x367df3['label'],_0x2d54c0));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x6ef6('0x4d')]=AGIChannel; \ No newline at end of file +var _0x236d=['E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','prototype','command','sync','answer','sendRequest','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','getVariable','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','util','lodash','EventEmitter','./error','call','setEncoding','utf8','setTimeout','headers','emit','ready','toLowerCase','hangup','substring','520-Invalid','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','substr','startsWith','split','length','error'];(function(_0x4a7af0,_0x458775){var _0x28fe7c=function(_0x23d3b3){while(--_0x23d3b3){_0x4a7af0['push'](_0x4a7af0['shift']());}};_0x28fe7c(++_0x458775);}(_0x236d,0x7e));var _0xd236=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x236d[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xd236('0x0'));var _=require(_0xd236('0x1'));var EventEmitter=require('events')[_0xd236('0x2')];var AGIReply=require('./reply');var AGIError=require(_0xd236('0x3'));function AGIChannel(_0x2ffe96){var _0x22533a=this,_0x17ebae=new AGIReply(),_0x52cdc5=![],_0x56bc88={};EventEmitter[_0xd236('0x4')](_0x22533a);_0x2ffe96[_0xd236('0x5')](_0xd236('0x6'));_0x2ffe96[_0xd236('0x7')](0x8*0x3c*0x3c*0x3e8);_0x17ebae['setEncoding']('utf8');_0x17ebae['on'](_0xd236('0x8'),function(_0x18d969){for(var _0x4e0460 in _0x18d969){_0x22533a[_0x4e0460]=_0x18d969[_0x4e0460];}_0x22533a[_0xd236('0x9')](_0xd236('0xa'));});_0x17ebae['on']('line',function(_0x3d11c7){if(_0x3d11c7[_0xd236('0xb')]()==_0xd236('0xc')){_0x22533a['emit'](_0xd236('0xc'));return;}if(_0x3d11c7[_0xd236('0xd')](0x0,0xb)==_0xd236('0xe')){_0x52cdc5=!![];}if(_0x52cdc5){_0x56bc88['rx']+=_0x3d11c7+'\x0a';if(_0x3d11c7['search'](_0xd236('0xf'))!=-0x1){_0x52cdc5=![];}}else{_0x56bc88['rx']=_0x3d11c7;}if(_0x52cdc5){return;}if(typeof _0x56bc88['cb']==_0xd236('0x10')){var _0x3d1076=_0x56bc88['rx'][_0xd236('0xd')](0x0,0x3),_0x160cb1=null,_0x21f27b=null;_0x3d1076=parseInt(_0x3d1076);if(isNaN(_0x3d1076)){_0x56bc88['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xd236('0x11')});return;}if(_0x3d1076!=0xc8){_0x56bc88['cb'](null,{'code':_0x3d1076,'result':-0x1,'extra':'KO'});return;}_0x160cb1=_0x56bc88['rx'][_0xd236('0xd')](0x4)[_0xd236('0x12')](_0xd236('0x13'),'');if(_0x160cb1[_0xd236('0x14')]('\x20')!=-0x1){_0x160cb1=_0x160cb1[_0xd236('0x15')](0x0,_0x160cb1[_0xd236('0x14')]('\x20'));}if(_[_0xd236('0x16')](_0x160cb1,'-1')){_0x160cb1=parseInt(_0x160cb1);}_0x21f27b=_0x56bc88['rx'][_0xd236('0x17')]('\x20');if(_0x21f27b[_0xd236('0x18')]==0x3){_0x21f27b=_0x21f27b[0x2][_0xd236('0xd')](0x1,_0x21f27b[0x2][_0xd236('0x18')]-0x1);}else if(_0x21f27b[_0xd236('0x18')]>0x3){var _0x1956a4=/\((.+)\)/;var _0x582d7d=_0x56bc88['rx']['match'](_0x1956a4);if(_0x582d7d){_0x21f27b=_0x582d7d[0x1];}else{_0x21f27b=null;}}else{_0x21f27b=null;}_0x56bc88['cb'](null,{'code':_0x3d1076,'result':_0x160cb1,'extra':_0x21f27b});}});_0x2ffe96['on'](_0xd236('0x19'),function(_0x1b02a5){_0x22533a['emit'](_0xd236('0x19'),new AGIError(_0xd236('0x1a'),_0x1b02a5[_0xd236('0x1b')]));});_0x2ffe96['on']('close',function(){_0x22533a[_0xd236('0x9')](_0xd236('0x1c'),new AGIError(_0xd236('0x1d')));});_0x2ffe96['on']('timeout',function(){_0x22533a[_0xd236('0x9')](_0xd236('0x1e'),new AGIError(_0xd236('0x1f')));_0x2ffe96[_0xd236('0x20')]();});_0x2ffe96[_0xd236('0x21')](_0x17ebae);this['command']=function(_0x2a1255,_0x30e7aa){var _0x2a1255=_0x2a1255||'',_0x30e7aa=typeof _0x30e7aa==_0xd236('0x10')?_0x30e7aa:new Function();_0x56bc88={'tx':_0x2a1255,'rx':'','cb':_0x30e7aa};_0x2ffe96['write'](_0x2a1255+'\x0a');},this['close']=function(){_0x2ffe96[_0xd236('0x20')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0xd236('0x22')]['sendRequest']=function(_0x2be060){return this[_0xd236('0x23')][_0xd236('0x24')](this,_0x2be060);};AGIChannel['prototype'][_0xd236('0x25')]=function(){return this[_0xd236('0x26')](_0xd236('0x27'));};AGIChannel[_0xd236('0x22')][_0xd236('0x28')]=function(_0x17f927,_0x41cf34,_0x21eeab){_0x17f927=_0x17f927===undefined?_0xd236('0x29'):_0x17f927;_0x41cf34=_0x41cf34===undefined?'5':_0x41cf34;_0x21eeab=_0x21eeab===undefined?'1':_0x21eeab;return this[_0xd236('0x26')](util[_0xd236('0x2a')](_0xd236('0x2b'),_0x17f927,_0x41cf34*0x3e8,_0x21eeab));};AGIChannel[_0xd236('0x22')][_0xd236('0x2c')]=function(_0x3108f4){_0x3108f4=_0x3108f4||_0xd236('0x2d');return this[_0xd236('0x26')](util[_0xd236('0x2a')](_0xd236('0x2e'),_0x3108f4));};AGIChannel[_0xd236('0x22')][_0xd236('0x2f')]=function(_0x37b099,_0x3c1617){if(_[_0xd236('0x30')](_0x3c1617)){return this[_0xd236('0x26')](util[_0xd236('0x2a')](_0xd236('0x31'),_0x37b099,_0x3c1617[_0xd236('0x32')](',')));}return this[_0xd236('0x26')](util['format'](_0xd236('0x31'),_0x37b099,_0x3c1617));};AGIChannel['prototype'][_0xd236('0x33')]=function(_0x14ef11){return this[_0xd236('0x26')](util['format'](_0xd236('0x34'),_0x14ef11));};AGIChannel[_0xd236('0x22')][_0xd236('0x35')]=function(_0x33400d){return this[_0xd236('0x26')](util[_0xd236('0x2a')](_0xd236('0x36'),_0x33400d));};AGIChannel['prototype'][_0xd236('0x37')]=function(_0x4dc776){return this[_0xd236('0x26')](util['format'](_0xd236('0x38'),_0x4dc776));};AGIChannel[_0xd236('0x22')][_0xd236('0xc')]=function(){return this[_0xd236('0x26')](_0xd236('0x39'));};AGIChannel[_0xd236('0x22')][_0xd236('0x3a')]=function(_0x94c21b,_0x450217){var _0x145bff=_[_0xd236('0x3b')](_0x450217)||_[_0xd236('0x3c')](_0x450217)?_0x450217[_0xd236('0x3d')]():_0x450217;return this['sendRequest'](util[_0xd236('0x2a')](_0xd236('0x3e'),_0x94c21b,_0x145bff?_0x145bff[_0xd236('0x3d')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xd236('0x22')][_0xd236('0x3f')]=function(_0x10e3de,_0x1848a4){return this[_0xd236('0x26')](util[_0xd236('0x2a')]('SAY\x20NUMBER\x20%s\x20%s',_0x10e3de,_0x1848a4));};AGIChannel[_0xd236('0x22')][_0xd236('0x40')]=function(_0x21da6b,_0x3c798f){return this[_0xd236('0x26')](util[_0xd236('0x2a')]('SAY\x20DIGITS\x20%s\x20%s',_0x21da6b,_0x3c798f));};AGIChannel[_0xd236('0x22')][_0xd236('0x41')]=function(_0x2ba3ae,_0x5df9ad){return this[_0xd236('0x26')](util['format'](_0xd236('0x42'),_0x2ba3ae,_0x5df9ad));};AGIChannel['prototype']['continueAt']=function(_0x29268e,_0x1aec55,_0x45ad0b){_0x1aec55=_0x1aec55||this[_0xd236('0x43')];_0x45ad0b=_0x45ad0b||0x1;this[_0xd236('0x33')](_0x29268e);this['setExtension'](_0x1aec55);this['setPriority'](_0x45ad0b);return this[_0xd236('0x2c')](util[_0xd236('0x2a')]('GOTO\x20%s\x20%s\x20%s',_0x29268e,_0x1aec55,_0x45ad0b));};AGIChannel[_0xd236('0x22')][_0xd236('0x44')]=function(_0x2d815b){return this['sendRequest'](util['format']('GET\x20VARIABLE\x20\x22%s\x22',_0x2d815b));};AGIChannel[_0xd236('0x22')]['recordFile']=function(_0x552cd6,_0x111865,_0x3892ce,_0x47240a,_0x29be22,_0x25970d){_0x111865=_0x111865||'wav';_0x3892ce=_0x3892ce||'';_0x47240a=_0x47240a===undefined?-0x1:_0x47240a==='-1'?-0x1:_0x47240a*0x3e8;_0x29be22=_0x29be22===undefined?'':'s='+_0x29be22;_0x25970d=_0x25970d?'BEEP':'';return this[_0xd236('0x26')](util[_0xd236('0x2a')](_0xd236('0x45'),_0x552cd6,_0x111865,_0x3892ce,_0x47240a,_0x25970d,_0x29be22));};AGIChannel[_0xd236('0x22')][_0xd236('0x46')]=function(_0x174821,_0x5498a3){_0x5498a3=_0x5498a3||'';return this[_0xd236('0x26')](util['format'](_0xd236('0x47'),_0x174821,_0x5498a3));};AGIChannel[_0xd236('0x22')]['agi']=function(_0x5efa49){return this['exec']('AGI',_0x5efa49);};AGIChannel[_0xd236('0x22')][_0xd236('0x48')]=function(_0x33394b){return this[_0xd236('0x2f')](_0xd236('0x49'),_0x33394b);};AGIChannel['prototype']['error']=function(_0x2f3b1f,_0x7c0650){this[_0xd236('0x2c')](util[_0xd236('0x2a')](_0xd236('0x4a'),_0x2f3b1f['id'],_0x2f3b1f[_0xd236('0x4b')],_0x7c0650));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index cdbe8b6..b20c3f2 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 _0xd3d5=['[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','push','format','message','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.'];(function(_0x482cb9,_0x448f4d){var _0x2c5647=function(_0x147bf2){while(--_0x147bf2){_0x482cb9['push'](_0x482cb9['shift']());}};_0x2c5647(++_0x448f4d);}(_0xd3d5,0x8e));var _0x5d3d=function(_0x236f98,_0x20aa59){_0x236f98=_0x236f98-0x0;var _0xff6ca6=_0xd3d5[_0x236f98];return _0xff6ca6;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0x5d3d('0x0'),'E_AGI_SERVER_ERROR':_0x5d3d('0x1'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x5d3d('0x2'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x5d3d('0x3'),'E_AGI_COMMAND_EMPTY':_0x5d3d('0x4'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x5d3d('0x5'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x79717){var _0x79717=_0x79717||null,_0x16e49d=_0x16e49d||[],_0x549de0=0x1,_0x3eae09='';if(!error[_0x79717]){_0x79717='E_AGI_UNDEFINED';}_0x16e49d[_0x5d3d('0x6')](error[_0x79717]);while(arguments[_0x549de0]){_0x16e49d[_0x5d3d('0x6')](arguments[_0x549de0]);_0x549de0++;}_0x3eae09=util[_0x5d3d('0x7')]['apply'](util,_0x16e49d);this[_0x5d3d('0x8')]=_0x3eae09;this['name']=_0x79717;}module['exports']=AGIError; \ No newline at end of file +var _0x6964=['[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED','push','apply','message','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.'];(function(_0x1bfd25,_0x349005){var _0x11804d=function(_0x47334c){while(--_0x47334c){_0x1bfd25['push'](_0x1bfd25['shift']());}};_0x11804d(++_0x349005);}(_0x6964,0xed));var _0x4696=function(_0x55cc58,_0x5ce0af){_0x55cc58=_0x55cc58-0x0;var _0x26062e=_0x6964[_0x55cc58];return _0x26062e;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x4696('0x0'),'E_AGI_ARGUMENT_PORT':_0x4696('0x1'),'E_AGI_SERVER_ERROR':_0x4696('0x2'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x4696('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0x4696('0x4'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0x4696('0x5'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x4696('0x6'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x4696('0x7'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x3fe2ad){var _0x3fe2ad=_0x3fe2ad||null,_0x4e7b98=_0x4e7b98||[],_0x3fa93c=0x1,_0xc5edca='';if(!error[_0x3fe2ad]){_0x3fe2ad=_0x4696('0x8');}_0x4e7b98[_0x4696('0x9')](error[_0x3fe2ad]);while(arguments[_0x3fa93c]){_0x4e7b98[_0x4696('0x9')](arguments[_0x3fa93c]);_0x3fa93c++;}_0xc5edca=util['format'][_0x4696('0xa')](util,_0x4e7b98);this[_0x4696('0xb')]=_0xc5edca;this['name']=_0x3fe2ad;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index b0f71e3..18e5fd5 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 _0x12cf=['projectUpdate','exports','lodash','events','EventEmitter','ioredis','./error','../../config/environment','redis','defaults','subscribe','emit','error','E_AGI_SERVER_ERROR','parse'];(function(_0x5ca353,_0x21eb37){var _0x4f2fe5=function(_0x14cd1b){while(--_0x14cd1b){_0x5ca353['push'](_0x5ca353['shift']());}};_0x4f2fe5(++_0x21eb37);}(_0x12cf,0x98));var _0xf12c=function(_0x43b468,_0x46c33c){_0x43b468=_0x43b468-0x0;var _0x47ee4b=_0x12cf[_0x43b468];return _0x47ee4b;};'use strict';var _=require(_0xf12c('0x0'));var EventEmitter=require(_0xf12c('0x1'))[_0xf12c('0x2')];var Redis=require(_0xf12c('0x3'));var AGIError=require(_0xf12c('0x4'));var config=require(_0xf12c('0x5'));config[_0xf12c('0x6')]=_[_0xf12c('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xf12c('0x6')]);sub[_0xf12c('0x8')]('agi',function(_0x33087d){if(_0x33087d)return eventEmitter[_0xf12c('0x9')](_0xf12c('0xa'),new AGIError(_0xf12c('0xb'),_0x33087d));});sub['on']('message',function(_0x342057,_0x55d7a3){if(_0x342057!=='agi')return;try{var _0x2b9f79=JSON[_0xf12c('0xc')](_0x55d7a3);eventEmitter[_0xf12c('0x9')](_0xf12c('0xd'),_0x2b9f79);}catch(_0x26546f){eventEmitter[_0xf12c('0x9')]('error',new AGIError(_0xf12c('0xb'),_0x26546f));}});module[_0xf12c('0xe')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0xa4b5=['defaults','localhost','subscribe','error','E_AGI_SERVER_ERROR','message','agi','parse','emit','projectUpdate','ioredis','../../config/environment','redis'];(function(_0x20d7d4,_0x211699){var _0x389db4=function(_0x1ac87c){while(--_0x1ac87c){_0x20d7d4['push'](_0x20d7d4['shift']());}};_0x389db4(++_0x211699);}(_0xa4b5,0x1aa));var _0x5a4b=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa4b5[_0x2576d7];return _0x16a08c;};'use strict';var _=require('lodash');var EventEmitter=require('events')['EventEmitter'];var Redis=require(_0x5a4b('0x0'));var AGIError=require('./error');var config=require(_0x5a4b('0x1'));config[_0x5a4b('0x2')]=_[_0x5a4b('0x3')](config['redis'],{'host':_0x5a4b('0x4'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x5a4b('0x2')]);sub[_0x5a4b('0x5')]('agi',function(_0x3511d1){if(_0x3511d1)return eventEmitter['emit'](_0x5a4b('0x6'),new AGIError(_0x5a4b('0x7'),_0x3511d1));});sub['on'](_0x5a4b('0x8'),function(_0x1278c6,_0x5c5c80){if(_0x1278c6!==_0x5a4b('0x9'))return;try{var _0x23e6fa=JSON[_0x5a4b('0xa')](_0x5c5c80);eventEmitter[_0x5a4b('0xb')](_0x5a4b('0xc'),_0x23e6fa);}catch(_0x5be52c){eventEmitter['emit'](_0x5a4b('0x6'),new AGIError('E_AGI_SERVER_ERROR',_0x5be52c));}});module['exports']={'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 c4acbeb..0a6af3e 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 _0x4ee2=['no\x20vertex\x20found','stop\x20traverse','no\x20edge/s\x20available','length','split','agicommand','target','vswitch','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','agi','menu','getdigits','getsecretdigits','edges','numberOfEdges','prototype','addVertex','push','size','vertices','relations','traverseBFS','info'];(function(_0x58712a,_0x1d88a9){var _0x342032=function(_0x5365f0){while(--_0x5365f0){_0x58712a['push'](_0x58712a['shift']());}};_0x342032(++_0x1d88a9);}(_0x4ee2,0x140));var _0x24ee=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x4ee2[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x24ee('0x0'));var logger=require(_0x24ee('0x1'))(_0x24ee('0x2'));var verticesWithRetry=[_0x24ee('0x3'),_0x24ee('0x4'),_0x24ee('0x5')];var Graph=function(){this['vertices']={};this[_0x24ee('0x6')]={};this[_0x24ee('0x7')]=0x0;};Graph[_0x24ee('0x8')][_0x24ee('0x9')]=function(_0xa36002){this['vertices'][_0xa36002['id']]=_0xa36002;this[_0x24ee('0x6')][_0xa36002['id']]=[];};Graph['prototype']['addEdge']=function(_0x4210e7,_0x44f6a2,_0x18dabe){this[_0x24ee('0x6')][_0x4210e7][_0x24ee('0xa')]({'target':_0x44f6a2,'condition':_0x18dabe});this[_0x24ee('0x7')]+=0x1;};Graph[_0x24ee('0x8')][_0x24ee('0xb')]=function(){return _[_0x24ee('0xb')](this[_0x24ee('0xc')]);};Graph[_0x24ee('0x8')][_0x24ee('0xd')]=function(){return this[_0x24ee('0x7')];};Graph[_0x24ee('0x8')]['getVertex']=function(_0x32e382){return this[_0x24ee('0xc')][_0x32e382];};Graph[_0x24ee('0x8')][_0x24ee('0xe')]=function(_0x330be8,_0x28fc31){if(!this['vertices'][_0x330be8]){return logger[_0x24ee('0xf')](_0x24ee('0x10'));}var _0x30e53a=_0x28fc31(this[_0x24ee('0xc')][_0x330be8]);if(!_0x30e53a){return logger[_0x24ee('0xf')](_0x24ee('0x11'));}if(this[_0x24ee('0x6')][_0x330be8]['length']===0x0){return logger[_0x24ee('0xf')](_0x24ee('0x12'));}for(var _0x5b049f=0x0,_0x14b0d0=[],_0x2cb4ba=![];_0x5b049f\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','createSquareReport','then','catch','hasOwnProperty','agi_','substring','debug','variables','stringify','timeout','evtHangup','hangup','find','handleNotFound','handleUnpublished','initialize','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','getAll','[LICENSE]','listening','connection','close','lodash','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./project','EventEmitter','defaults','127.0.0.1','error','stack','findIndex','splice','push','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xd07a,0x175));var _0xad07=function(_0x4996d5,_0x123daf){_0x4996d5=_0x4996d5-0x0;var _0x4793f9=_0xd07a[_0x4996d5];return _0x4793f9;};'use strict';var _=require(_0xad07('0x0'));var syncho=require('syncho');var util=require('util');var config=require(_0xad07('0x1'));var logger=require(_0xad07('0x2'))(_0xad07('0x3'));var utilLicense=require(_0xad07('0x4'));var rpc=require(_0xad07('0x5'));var Project=require(_0xad07('0x6'));var AGIEmitter=require('./events')[_0xad07('0x7')];var projects=[];config[_0xad07('0x3')]=_[_0xad07('0x8')](config['agi'],{'ip':_0xad07('0x9'),'port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x576ddb){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x576ddb);agiHandler(_0x576ddb);}catch(_0x1af0ab){logger[_0xad07('0xa')](_0x1af0ab[_0xad07('0xb')]);}});});}function projectUpdateHandler(_0x1c5532){try{var _0x4a0b3c=_[_0xad07('0xc')](projects,['id',_0x1c5532['id']]);if(_0x4a0b3c>-0x1){if(_0x1c5532['deleted']===!![]){projects[_0xad07('0xd')](_0x4a0b3c,0x1);}else{projects[_0x4a0b3c]=_0x1c5532;}}else{projects[_0xad07('0xe')](_0x1c5532);}}catch(_0x1f429c){logger[_0xad07('0xa')](_0x1f429c[_0xad07('0xb')]);}}function listeningHandler(){console['log'](_0xad07('0xf'),config[_0xad07('0x3')][_0xad07('0x10')]);logger[_0xad07('0x11')](util[_0xad07('0x12')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config['agi']['ip'],config['agi']['port']));}function errorHandler(_0x2b04fb){if(_0x2b04fb&&_0x2b04fb[_0xad07('0x13')]&&_0x2b04fb['message']){logger[_0xad07('0xa')](util[_0xad07('0x12')](_0xad07('0x14'),_0x2b04fb[_0xad07('0x13')],_0x2b04fb['message']));}else{logger[_0xad07('0xa')](util[_0xad07('0x12')](_0xad07('0x15'),_0x2b04fb[_0xad07('0xb')]));}}function closeHandler(){logger['info'](util[_0xad07('0x12')](_0xad07('0x16'),this[_0xad07('0x17')],this['calleridname'],this['callerid'],this[_0xad07('0x18')],this['uniqueid']));try{createSquareReport(this);}catch(_0x5c09c1){logger['error'](_0x5c09c1[_0xad07('0xb')]);}}function timeoutHandler(){logger['info'](util[_0xad07('0x12')](_0xad07('0x19'),this[_0xad07('0x17')],this[_0xad07('0x1a')],this[_0xad07('0x1b')],this[_0xad07('0x18')],this[_0xad07('0x1c')]));}function hangupHandler(){logger[_0xad07('0x11')](util[_0xad07('0x12')](_0xad07('0x1d'),this['arg_1'],this[_0xad07('0x1a')],this[_0xad07('0x1b')],this[_0xad07('0x18')],this[_0xad07('0x1c')]));this['evtHangup']=!![];}function createSquareReport(_0x3bbd41,_0x2f3536){rpc[_0xad07('0x1e')](_0x3bbd41)[_0xad07('0x1f')](function(_0x33403a){if(_0x2f3536){_0x2f3536(null,_0x33403a);}})[_0xad07('0x20')](function(_0x583d92){if(_0x2f3536){_0x2f3536(null,_0x583d92);}});}function setChannelVariables(_0x513798){for(var _0x590b19 in _0x513798){if(_0x513798[_0xad07('0x21')](_0x590b19)){if(_0x590b19['indexOf'](_0xad07('0x22'))===0x0){_0x513798[_0x590b19[_0xad07('0x23')](0x4)]=_0x513798[_0x590b19];delete _0x513798[_0x590b19];}}}}function agiHandler(_0x27a75d){logger[_0xad07('0x24')](_0xad07('0x25'),JSON[_0xad07('0x26')](_0x27a75d,null,0x2));logger[_0xad07('0x11')](util[_0xad07('0x12')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x27a75d[_0xad07('0x17')],_0x27a75d[_0xad07('0x1a')],_0x27a75d['callerid'],_0x27a75d[_0xad07('0x18')],_0x27a75d['uniqueid']));_0x27a75d['on'](_0xad07('0xa'),errorHandler);_0x27a75d['on']('close',closeHandler);_0x27a75d['on'](_0xad07('0x27'),timeoutHandler);_0x27a75d[_0xad07('0x28')]=![];_0x27a75d['on'](_0xad07('0x29'),hangupHandler);var _0x4f5565=_[_0xad07('0x2a')](projects,['name',_0x27a75d[_0xad07('0x17')]]);if(!_0x4f5565)return Project[_0xad07('0x2b')](_0x27a75d);if(!_0x4f5565['production'])return Project[_0xad07('0x2c')](_0x27a75d);return Project[_0xad07('0x2d')](_0x4f5565,_0x27a75d);}function main(){var _0x56b8df;return utilLicense[_0xad07('0x2e')]()['then'](function(_0x216056){if(!_0x216056)return;if(_0x216056[_0xad07('0x2f')]){if(_0x216056[_0xad07('0x30')]&&_0x216056['callysquare']>0x0){logger[_0xad07('0x11')](util[_0xad07('0x12')](_0xad07('0x31'),_0x216056[_0xad07('0x30')]));_0x56b8df=_0x216056['callysquare'];}else{logger[_0xad07('0x11')](_0xad07('0x32'));}}else{logger[_0xad07('0x11')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x56b8df=-0x1;}})['then'](function(){return Project[_0xad07('0x33')]();})[_0xad07('0x1f')](function(_0x1ed852){projects=_0x1ed852;return;})[_0xad07('0x20')](function(_0x45aee9){logger['error'](_0xad07('0x34'),_0x45aee9[_0xad07('0xb')]);})['finally'](function(){var _0x2a49fa=require('./server')(config[_0xad07('0x3')]['port'],config[_0xad07('0x3')]['ip'],_0x56b8df);_0x2a49fa['on']('error',errorHandler);_0x2a49fa['on'](_0xad07('0x35'),listeningHandler);_0x2a49fa['on'](_0xad07('0x36'),connectionHandler);_0x2a49fa['on'](_0xad07('0x37'),closeHandler);});}main(); \ No newline at end of file +var _0x6226=['debug','variables','calleridname','close','timeout','hangup','find','handleNotFound','production','handleUnpublished','initialize','getLicense','voice','[LICENSE]\x20CHANNELS:\x20%s','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','finally','./server','listening','lodash','syncho','util','../../config/environment','../../config/logger','../../config/license/util','./rpc','EventEmitter','agi','127.0.0.1','projectUpdate','nextTick','error','stack','findIndex','deleted','splice','push','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','format','[ERROR]\x20%s','arg_1','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','then','catch','hasOwnProperty'];(function(_0x360af4,_0x34f939){var _0x2cb5a4=function(_0x23aa9f){while(--_0x23aa9f){_0x360af4['push'](_0x360af4['shift']());}};_0x2cb5a4(++_0x34f939);}(_0x6226,0xfc));var _0x6622=function(_0x408658,_0x333430){_0x408658=_0x408658-0x0;var _0x1a37ca=_0x6226[_0x408658];return _0x1a37ca;};'use strict';var _=require(_0x6622('0x0'));var syncho=require(_0x6622('0x1'));var util=require(_0x6622('0x2'));var config=require(_0x6622('0x3'));var logger=require(_0x6622('0x4'))('agi');var utilLicense=require(_0x6622('0x5'));var rpc=require(_0x6622('0x6'));var Project=require('./project');var AGIEmitter=require('./events')[_0x6622('0x7')];var projects=[];config[_0x6622('0x8')]=_['defaults'](config[_0x6622('0x8')],{'ip':_0x6622('0x9'),'port':0x11dd});AGIEmitter['on'](_0x6622('0xa'),projectUpdateHandler);function connectionHandler(_0x271e7a){process[_0x6622('0xb')](function(){syncho(function(){try{setChannelVariables(_0x271e7a);agiHandler(_0x271e7a);}catch(_0x5e8adf){logger[_0x6622('0xc')](_0x5e8adf[_0x6622('0xd')]);}});});}function projectUpdateHandler(_0x4e9b53){try{var _0x620e30=_[_0x6622('0xe')](projects,['id',_0x4e9b53['id']]);if(_0x620e30>-0x1){if(_0x4e9b53[_0x6622('0xf')]===!![]){projects[_0x6622('0x10')](_0x620e30,0x1);}else{projects[_0x620e30]=_0x4e9b53;}}else{projects[_0x6622('0x11')](_0x4e9b53);}}catch(_0x152e02){logger[_0x6622('0xc')](_0x152e02['stack']);}}function listeningHandler(){console[_0x6622('0x12')](_0x6622('0x13'),config['agi']['port']);logger[_0x6622('0x14')](util['format'](_0x6622('0x15'),config[_0x6622('0x8')]['ip'],config['agi']['port']));}function errorHandler(_0x1321e1){if(_0x1321e1&&_0x1321e1[_0x6622('0x16')]&&_0x1321e1[_0x6622('0x17')]){logger['error'](util['format'](_0x6622('0x18'),_0x1321e1[_0x6622('0x16')],_0x1321e1[_0x6622('0x17')]));}else{logger['error'](util[_0x6622('0x19')](_0x6622('0x1a'),_0x1321e1[_0x6622('0xd')]));}}function closeHandler(){logger[_0x6622('0x14')](util[_0x6622('0x19')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x6622('0x1b')],this['calleridname'],this[_0x6622('0x1c')],this[_0x6622('0x1d')],this[_0x6622('0x1e')]));try{createSquareReport(this);}catch(_0x534a72){logger[_0x6622('0xc')](_0x534a72['stack']);}}function timeoutHandler(){logger[_0x6622('0x14')](util[_0x6622('0x19')](_0x6622('0x1f'),this[_0x6622('0x1b')],this['calleridname'],this[_0x6622('0x1c')],this['dnid'],this[_0x6622('0x1e')]));}function hangupHandler(){logger[_0x6622('0x14')](util[_0x6622('0x19')](_0x6622('0x20'),this['arg_1'],this['calleridname'],this[_0x6622('0x1c')],this[_0x6622('0x1d')],this[_0x6622('0x1e')]));this[_0x6622('0x21')]=!![];}function createSquareReport(_0x59ba56,_0x2e22a2){rpc[_0x6622('0x22')](_0x59ba56)[_0x6622('0x23')](function(_0x35950f){if(_0x2e22a2){_0x2e22a2(null,_0x35950f);}})[_0x6622('0x24')](function(_0x57124e){if(_0x2e22a2){_0x2e22a2(null,_0x57124e);}});}function setChannelVariables(_0x1d9576){for(var _0xc06178 in _0x1d9576){if(_0x1d9576[_0x6622('0x25')](_0xc06178)){if(_0xc06178['indexOf']('agi_')===0x0){_0x1d9576[_0xc06178['substring'](0x4)]=_0x1d9576[_0xc06178];delete _0x1d9576[_0xc06178];}}}}function agiHandler(_0x2a25d9){logger[_0x6622('0x26')](_0x6622('0x27'),JSON['stringify'](_0x2a25d9,null,0x2));logger['info'](util[_0x6622('0x19')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x2a25d9[_0x6622('0x1b')],_0x2a25d9[_0x6622('0x28')],_0x2a25d9[_0x6622('0x1c')],_0x2a25d9[_0x6622('0x1d')],_0x2a25d9[_0x6622('0x1e')]));_0x2a25d9['on']('error',errorHandler);_0x2a25d9['on'](_0x6622('0x29'),closeHandler);_0x2a25d9['on'](_0x6622('0x2a'),timeoutHandler);_0x2a25d9[_0x6622('0x21')]=![];_0x2a25d9['on'](_0x6622('0x2b'),hangupHandler);var _0x326e0e=_[_0x6622('0x2c')](projects,[_0x6622('0x16'),_0x2a25d9[_0x6622('0x1b')]]);if(!_0x326e0e)return Project[_0x6622('0x2d')](_0x2a25d9);if(!_0x326e0e[_0x6622('0x2e')])return Project[_0x6622('0x2f')](_0x2a25d9);return Project[_0x6622('0x30')](_0x326e0e,_0x2a25d9);}function main(){var _0x3314d3;return utilLicense[_0x6622('0x31')]()['then'](function(_0x56bc6){if(!_0x56bc6)return;if(_0x56bc6[_0x6622('0x32')]){if(_0x56bc6['callysquare']&&_0x56bc6['callysquare']>0x0){logger[_0x6622('0x14')](util[_0x6622('0x19')](_0x6622('0x33'),_0x56bc6[_0x6622('0x34')]));_0x3314d3=_0x56bc6['callysquare'];}else{logger[_0x6622('0x14')](_0x6622('0x35'));}}else{logger[_0x6622('0x14')](_0x6622('0x36'));_0x3314d3=-0x1;}})[_0x6622('0x23')](function(){return Project['getAll']();})[_0x6622('0x23')](function(_0x5db178){projects=_0x5db178;return;})[_0x6622('0x24')](function(_0x14e049){logger[_0x6622('0xc')]('[LICENSE]',_0x14e049[_0x6622('0xd')]);})[_0x6622('0x37')](function(){var _0x1e3272=require(_0x6622('0x38'))(config['agi']['port'],config['agi']['ip'],_0x3314d3);_0x1e3272['on'](_0x6622('0xc'),errorHandler);_0x1e3272['on'](_0x6622('0x39'),listeningHandler);_0x1e3272['on']('connection',connectionHandler);_0x1e3272['on'](_0x6622('0x29'),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 83072d4..beb4581 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 _0xeee0=['client','request','then','error','catch','bluebird'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0xeee0,0x14f));var _0x0eee=function(_0x71e493,_0x4308b7){_0x71e493=_0x71e493-0x0;var _0x3d40ab=_0xeee0[_0x71e493];return _0x3d40ab;};'use strict';var BPromise=require(_0x0eee('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x0eee('0x1')]['http']({'port':0x232b});function request(_0x5c50db,_0x4fcf00){return new BPromise(function(_0x5e6c58,_0x4ff316){return client[_0x0eee('0x2')](_0x5c50db,_0x4fcf00)[_0x0eee('0x3')](function(_0x3ccb6e){if(_0x3ccb6e['error']){return _0x4ff316(_0x3ccb6e[_0x0eee('0x4')]['message']);}else{return _0x5e6c58(_0x3ccb6e['result']);}})[_0x0eee('0x5')](function(_0x34cea3){return _0x4ff316(_0x34cea3);});});}exports['sendMailMessage']=function(_0x259c62,_0x12548e){return request('SendMail',{'account':_0x259c62,'message':_0x12548e});}; \ No newline at end of file +var _0xa511=['sendMailMessage','SendMail','bluebird','jayson/promise','http','error','message','result','catch'];(function(_0x12ff4a,_0x3a1f15){var _0x7f3416=function(_0xc62a5a){while(--_0xc62a5a){_0x12ff4a['push'](_0x12ff4a['shift']());}};_0x7f3416(++_0x3a1f15);}(_0xa511,0x17c));var _0x1a51=function(_0x5548ab,_0x28599d){_0x5548ab=_0x5548ab-0x0;var _0x5c6b76=_0xa511[_0x5548ab];return _0x5c6b76;};'use strict';var BPromise=require(_0x1a51('0x0'));var jayson=require(_0x1a51('0x1'));var client=jayson['client'][_0x1a51('0x2')]({'port':0x232b});function request(_0x388b73,_0x32b412){return new BPromise(function(_0x22c7e7,_0x16c352){return client['request'](_0x388b73,_0x32b412)['then'](function(_0x1bfad5){if(_0x1bfad5[_0x1a51('0x3')]){return _0x16c352(_0x1bfad5['error'][_0x1a51('0x4')]);}else{return _0x22c7e7(_0x1bfad5[_0x1a51('0x5')]);}})[_0x1a51('0x6')](function(_0x590b45){return _0x16c352(_0x590b45);});});}exports[_0x1a51('0x7')]=function(_0x355744,_0x2b32ae){return request(_0x1a51('0x8'),{'account':_0x355744,'message':_0x2b32ae});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index 7cb6c67..00f7ca0 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 _0xe0ed=['agicommand','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','evtHangup','toString','error','agicommand\x20not\x20found','finally','calleridname','isUndefined','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','close','Project\x20%s\x20not\x20found','continueAt','lodash','xml2json','util','../../config/logger','agi','./rpc','./mailRpc','./vertices','catch','Unable\x20to\x20download\x20CallySquare\x20projects','stack','hasOwnProperty','maxRetry','retry','mxCell','isArray','length','source','target','value','toJson','mxGraphModel','root','inspect','production','start','debug','joinAt','omit','info','format','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','dnid','uniqueid','clear','vertex','stringify'];(function(_0x11a505,_0x3fd181){var _0x1605a6=function(_0x128d96){while(--_0x128d96){_0x11a505['push'](_0x11a505['shift']());}};_0x1605a6(++_0x3fd181);}(_0xe0ed,0x105));var _0xde0e=function(_0x386827,_0x3616e6){_0x386827=_0x386827-0x0;var _0x4b08b1=_0xe0ed[_0x386827];return _0x4b08b1;};'use strict';var _=require(_0xde0e('0x0'));var moment=require('moment');var parser=require(_0xde0e('0x1'));var util=require(_0xde0e('0x2'));var logger=require(_0xde0e('0x3'))(_0xde0e('0x4'));var rpc=require(_0xde0e('0x5'));var mailRpc=require(_0xde0e('0x6'));var Graph=require('./graph');var Vertices=require(_0xde0e('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc['getSquareProjects']()[_0xde0e('0x8')](function(_0x142fb2){logger['error'](_0xde0e('0x9'),_0x142fb2[_0xde0e('0xa')]);return[];});}function addVertex(_0x877dfe,_0x37da43,_0x54237d){_0x37da43['agicommand']=_0x54237d;if(_0x37da43[_0xde0e('0xb')]('retry')){_0x37da43[_0xde0e('0xc')]=parseInt(_0x37da43[_0xde0e('0xd')],0xa);}_0x877dfe['addVertex'](_['omit'](_0x37da43,_0xde0e('0xe')));}function initGraph(_0xd62409,_0x30ef47){var _0x3bced2=new Graph();for(var _0x3cabee in _0xd62409){if(_0xd62409['hasOwnProperty'](_0x3cabee)){if(_[_0xde0e('0xf')](_0xd62409[_0x3cabee])){for(var _0x365ae9=0x0;_0x365ae9<_0xd62409[_0x3cabee][_0xde0e('0x10')];_0x365ae9+=0x1){addVertex(_0x3bced2,_0xd62409[_0x3cabee][_0x365ae9],_0x3cabee);}}else{addVertex(_0x3bced2,_0xd62409[_0x3cabee],_0x3cabee);}}}for(var _0x3a7431=0x0;_0x3a7431<_0x30ef47[_0xde0e('0x10')];_0x3a7431+=0x1){if(_0x30ef47[_0x3a7431]['source']&&_0x30ef47[_0x3a7431]['target']){_0x3bced2['addEdge'](_0x30ef47[_0x3a7431][_0xde0e('0x11')],_0x30ef47[_0x3a7431][_0xde0e('0x12')],_0x30ef47[_0x3a7431][_0xde0e('0x13')]);}}return _0x3bced2;}function getRoot(_0x526a3d){return parser[_0xde0e('0x14')](_0x526a3d,{'object':!![]})[_0xde0e('0x15')][_0xde0e('0x16')];}function inspect(_0x566aab){return util[_0xde0e('0x17')](_0x566aab,{'showHidden':![],'depth':null});}function initialize(_0x57d4f6,_0x41956c){var _0x3f5530=getRoot(_0x57d4f6[_0xde0e('0x18')]);if(!_0x3f5530||!_0x3f5530[_0xde0e('0x19')])return;var _0x3efe46,_0x437e2c,_0x571349;logger[_0xde0e('0x1a')](_0xde0e('0x16'),JSON['stringify'](_0x3f5530,null,0x2));_0x41956c[_0xde0e('0x1b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3efe46=initGraph(_[_0xde0e('0x1c')](_0x3f5530,_0xde0e('0xe')),_0x3f5530['mxCell']);_0x437e2c=new Vertices(_0x41956c,rpc,mailRpc);logger[_0xde0e('0x1d')](util[_0xde0e('0x1e')](_0xde0e('0x1f'),_0x41956c[_0xde0e('0x20')],_0x41956c['calleridname'],_0x41956c[_0xde0e('0x21')],_0x41956c[_0xde0e('0x22')],_0x41956c[_0xde0e('0x23')]));_0x3efe46['traverseBFS'](_0x3f5530[_0xde0e('0x19')]['id'],function(_0x29cada){try{_0x29cada=_0x437e2c[_0xde0e('0x24')](_0x29cada);logger[_0xde0e('0x1a')](_0xde0e('0x25'),JSON[_0xde0e('0x26')](_0x29cada,null,0x2));if(_0x29cada[_0xde0e('0x27')]===_0xde0e('0x28')){logger[_0xde0e('0x1d')](_0xde0e('0x29'));_0x41956c[_0xde0e('0x2a')]=_0x29cada['context']||_0x41956c[_0xde0e('0x2a')];_0x41956c['extension']=_0x29cada[_0xde0e('0x2b')];_0x41956c[_0xde0e('0x2c')]=_0x29cada['priority']?_0x29cada[_0xde0e('0x2c')]-0x1:0x1;return null;}else if(_0x29cada&&_0x437e2c[_0x29cada[_0xde0e('0x27')]]){_0x571349=_0x437e2c[_0x29cada[_0xde0e('0x27')]](_0x29cada);logger[_0xde0e('0x1d')](_0xde0e('0x2d'),JSON[_0xde0e('0x26')](_0x571349,null,0x2));if(_0x571349&&_0x571349[_0xde0e('0x2e')]===AGI_CODE_SUCCESS&&_0x571349[_0xde0e('0x2f')]!==AGI_RESULT_ERROR&&!_0x41956c[_0xde0e('0x30')]){logger[_0xde0e('0x1a')](_0xde0e('0x2d'),inspect(_0x571349));return _['isUndefined'](_0x571349[_0xde0e('0x2f')])?null:_0x571349[_0xde0e('0x2f')][_0xde0e('0x31')]();}else{logger[_0xde0e('0x32')]('response',inspect(_0x571349));return null;}}else{logger[_0xde0e('0x32')](_0xde0e('0x33'));return null;}}catch(_0x228043){logger[_0xde0e('0x32')](_0x228043['stack']);return null;}});if(_0x3f5530[_0xde0e('0x34')]){logger[_0xde0e('0x1d')](util[_0xde0e('0x1e')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x41956c[_0xde0e('0x20')],_0x41956c[_0xde0e('0x35')],_0x41956c[_0xde0e('0x21')],_0x41956c[_0xde0e('0x22')],_0x41956c[_0xde0e('0x23')]));_0x3efe46['traverseBFS'](_0x3f5530[_0xde0e('0x34')]['id'],function(_0x268c18){try{_0x268c18=_0x437e2c[_0xde0e('0x24')](_0x268c18);logger['debug'](_0xde0e('0x25'),JSON[_0xde0e('0x26')](_0x268c18,null,0x2));if(_0x268c18&&_0x437e2c[_0x268c18[_0xde0e('0x27')]]){_0x571349=_0x437e2c[_0x268c18[_0xde0e('0x27')]](_0x268c18);if(_0x571349){logger[_0xde0e('0x1a')](_0xde0e('0x2d'),inspect(_0x571349));return _[_0xde0e('0x36')](_0x571349[_0xde0e('0x2f')])?null:_0x571349[_0xde0e('0x2f')][_0xde0e('0x31')]();}else{logger[_0xde0e('0x32')](_0xde0e('0x2d'),inspect(_0x571349));return null;}}else{logger['error'](_0xde0e('0x33'));return null;}}catch(_0x14b25b){logger['error'](_0x14b25b[_0xde0e('0xa')]);return null;}});}logger[_0xde0e('0x1d')](util['format'](_0xde0e('0x37'),_0x41956c[_0xde0e('0x20')],_0x41956c[_0xde0e('0x35')],_0x41956c['callerid'],_0x41956c[_0xde0e('0x22')],_0x41956c[_0xde0e('0x23')]));logger[_0xde0e('0x1d')](util[_0xde0e('0x1e')](_0xde0e('0x38'),_0x41956c[_0xde0e('0x2a')],_0x41956c[_0xde0e('0x2b')],parseInt(_0x41956c[_0xde0e('0x2c')],0xa)+0x1));_0x41956c['continueAt'](_0x41956c[_0xde0e('0x2a')],_0x41956c[_0xde0e('0x2b')],parseInt(_0x41956c[_0xde0e('0x2c')],0xa)+0x1);_0x41956c[_0xde0e('0x39')]();}function handleNotFound(_0x3abb6b){logger['error'](util[_0xde0e('0x1e')](_0xde0e('0x3a'),_0x3abb6b['arg_1']));_0x3abb6b[_0xde0e('0x3b')](_0x3abb6b['context'],_0x3abb6b[_0xde0e('0x2b')],parseInt(_0x3abb6b['priority'],0xa)+0x1);_0x3abb6b['close']();}function handleUnpublished(_0x3d9ff7){logger[_0xde0e('0x32')](util[_0xde0e('0x1e')]('Project\x20%s\x20not\x20published',_0x3d9ff7['arg_1']));_0x3d9ff7[_0xde0e('0x3b')](_0x3d9ff7['context'],_0x3d9ff7[_0xde0e('0x2b')],parseInt(_0x3d9ff7[_0xde0e('0x2c')],0xa)+0x1);_0x3d9ff7[_0xde0e('0x39')]();}module['exports']={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0x488c=['length','source','target','addEdge','value','mxGraphModel','root','inspect','start','debug','YYYY-MM-DD\x20HH:mm:ss','info','format','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','dnid','uniqueid','traverseBFS','clear','vertex','gotoc','context','extension','priority','response','stringify','code','evtHangup','isUndefined','result','toString','agicommand\x20not\x20found','stack','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20found','lodash','moment','xml2json','agi','./mailRpc','./graph','./vertices','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','agicommand','hasOwnProperty','retry','maxRetry','addVertex','mxCell','isArray'];(function(_0x5c4807,_0x77b379){var _0x269d24=function(_0x3828d1){while(--_0x3828d1){_0x5c4807['push'](_0x5c4807['shift']());}};_0x269d24(++_0x77b379);}(_0x488c,0x116));var _0xc488=function(_0x28d225,_0x43be18){_0x28d225=_0x28d225-0x0;var _0x1f79e1=_0x488c[_0x28d225];return _0x1f79e1;};'use strict';var _=require(_0xc488('0x0'));var moment=require(_0xc488('0x1'));var parser=require(_0xc488('0x2'));var util=require('util');var logger=require('../../config/logger')(_0xc488('0x3'));var rpc=require('./rpc');var mailRpc=require(_0xc488('0x4'));var Graph=require(_0xc488('0x5'));var Vertices=require(_0xc488('0x6'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc['getSquareProjects']()[_0xc488('0x7')](function(_0x20851c){logger[_0xc488('0x8')](_0xc488('0x9'),_0x20851c['stack']);return[];});}function addVertex(_0x4eb526,_0x44617a,_0x4ac223){_0x44617a[_0xc488('0xa')]=_0x4ac223;if(_0x44617a[_0xc488('0xb')](_0xc488('0xc'))){_0x44617a[_0xc488('0xd')]=parseInt(_0x44617a[_0xc488('0xc')],0xa);}_0x4eb526[_0xc488('0xe')](_['omit'](_0x44617a,_0xc488('0xf')));}function initGraph(_0x518363,_0x3e7d90){var _0x377e3f=new Graph();for(var _0x52149e in _0x518363){if(_0x518363['hasOwnProperty'](_0x52149e)){if(_[_0xc488('0x10')](_0x518363[_0x52149e])){for(var _0x86f8fe=0x0;_0x86f8fe<_0x518363[_0x52149e][_0xc488('0x11')];_0x86f8fe+=0x1){addVertex(_0x377e3f,_0x518363[_0x52149e][_0x86f8fe],_0x52149e);}}else{addVertex(_0x377e3f,_0x518363[_0x52149e],_0x52149e);}}}for(var _0x5ba6d5=0x0;_0x5ba6d5<_0x3e7d90['length'];_0x5ba6d5+=0x1){if(_0x3e7d90[_0x5ba6d5][_0xc488('0x12')]&&_0x3e7d90[_0x5ba6d5][_0xc488('0x13')]){_0x377e3f[_0xc488('0x14')](_0x3e7d90[_0x5ba6d5][_0xc488('0x12')],_0x3e7d90[_0x5ba6d5][_0xc488('0x13')],_0x3e7d90[_0x5ba6d5][_0xc488('0x15')]);}}return _0x377e3f;}function getRoot(_0x27180f){return parser['toJson'](_0x27180f,{'object':!![]})[_0xc488('0x16')][_0xc488('0x17')];}function inspect(_0x787177){return util[_0xc488('0x18')](_0x787177,{'showHidden':![],'depth':null});}function initialize(_0x66a6c1,_0x9f8f3b){var _0x5e93e7=getRoot(_0x66a6c1['production']);if(!_0x5e93e7||!_0x5e93e7[_0xc488('0x19')])return;var _0x5e4dd6,_0x2e862c,_0x462037;logger[_0xc488('0x1a')](_0xc488('0x17'),JSON['stringify'](_0x5e93e7,null,0x2));_0x9f8f3b['joinAt']=moment()['format'](_0xc488('0x1b'));_0x5e4dd6=initGraph(_['omit'](_0x5e93e7,'mxCell'),_0x5e93e7[_0xc488('0xf')]);_0x2e862c=new Vertices(_0x9f8f3b,rpc,mailRpc);logger[_0xc488('0x1c')](util[_0xc488('0x1d')](_0xc488('0x1e'),_0x9f8f3b[_0xc488('0x1f')],_0x9f8f3b[_0xc488('0x20')],_0x9f8f3b['callerid'],_0x9f8f3b[_0xc488('0x21')],_0x9f8f3b[_0xc488('0x22')]));_0x5e4dd6[_0xc488('0x23')](_0x5e93e7[_0xc488('0x19')]['id'],function(_0x5e8901){try{_0x5e8901=_0x2e862c[_0xc488('0x24')](_0x5e8901);logger[_0xc488('0x1a')](_0xc488('0x25'),JSON['stringify'](_0x5e8901,null,0x2));if(_0x5e8901['agicommand']===_0xc488('0x26')){logger['info']('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x9f8f3b[_0xc488('0x27')]=_0x5e8901[_0xc488('0x27')]||_0x9f8f3b['context'];_0x9f8f3b[_0xc488('0x28')]=_0x5e8901[_0xc488('0x28')];_0x9f8f3b[_0xc488('0x29')]=_0x5e8901[_0xc488('0x29')]?_0x5e8901[_0xc488('0x29')]-0x1:0x1;return null;}else if(_0x5e8901&&_0x2e862c[_0x5e8901['agicommand']]){_0x462037=_0x2e862c[_0x5e8901[_0xc488('0xa')]](_0x5e8901);logger[_0xc488('0x1c')](_0xc488('0x2a'),JSON[_0xc488('0x2b')](_0x462037,null,0x2));if(_0x462037&&_0x462037[_0xc488('0x2c')]===AGI_CODE_SUCCESS&&_0x462037['result']!==AGI_RESULT_ERROR&&!_0x9f8f3b[_0xc488('0x2d')]){logger[_0xc488('0x1a')](_0xc488('0x2a'),inspect(_0x462037));return _[_0xc488('0x2e')](_0x462037[_0xc488('0x2f')])?null:_0x462037[_0xc488('0x2f')][_0xc488('0x30')]();}else{logger[_0xc488('0x8')](_0xc488('0x2a'),inspect(_0x462037));return null;}}else{logger[_0xc488('0x8')](_0xc488('0x31'));return null;}}catch(_0x299bc7){logger[_0xc488('0x8')](_0x299bc7[_0xc488('0x32')]);return null;}});if(_0x5e93e7[_0xc488('0x33')]){logger[_0xc488('0x1c')](util['format'](_0xc488('0x34'),_0x9f8f3b['arg_1'],_0x9f8f3b[_0xc488('0x20')],_0x9f8f3b[_0xc488('0x35')],_0x9f8f3b[_0xc488('0x21')],_0x9f8f3b['uniqueid']));_0x5e4dd6['traverseBFS'](_0x5e93e7['finally']['id'],function(_0x5afffb){try{_0x5afffb=_0x2e862c[_0xc488('0x24')](_0x5afffb);logger[_0xc488('0x1a')]('vertex',JSON[_0xc488('0x2b')](_0x5afffb,null,0x2));if(_0x5afffb&&_0x2e862c[_0x5afffb[_0xc488('0xa')]]){_0x462037=_0x2e862c[_0x5afffb[_0xc488('0xa')]](_0x5afffb);if(_0x462037){logger[_0xc488('0x1a')]('response',inspect(_0x462037));return _[_0xc488('0x2e')](_0x462037[_0xc488('0x2f')])?null:_0x462037['result'][_0xc488('0x30')]();}else{logger[_0xc488('0x8')](_0xc488('0x2a'),inspect(_0x462037));return null;}}else{logger['error'](_0xc488('0x31'));return null;}}catch(_0x1fa97c){logger['error'](_0x1fa97c['stack']);return null;}});}logger['info'](util[_0xc488('0x1d')](_0xc488('0x36'),_0x9f8f3b['arg_1'],_0x9f8f3b['calleridname'],_0x9f8f3b[_0xc488('0x35')],_0x9f8f3b['dnid'],_0x9f8f3b['uniqueid']));logger['info'](util[_0xc488('0x1d')](_0xc488('0x37'),_0x9f8f3b[_0xc488('0x27')],_0x9f8f3b[_0xc488('0x28')],parseInt(_0x9f8f3b['priority'],0xa)+0x1));_0x9f8f3b[_0xc488('0x38')](_0x9f8f3b['context'],_0x9f8f3b[_0xc488('0x28')],parseInt(_0x9f8f3b[_0xc488('0x29')],0xa)+0x1);_0x9f8f3b[_0xc488('0x39')]();}function handleNotFound(_0xd60fad){logger[_0xc488('0x8')](util['format'](_0xc488('0x3a'),_0xd60fad['arg_1']));_0xd60fad[_0xc488('0x38')](_0xd60fad[_0xc488('0x27')],_0xd60fad[_0xc488('0x28')],parseInt(_0xd60fad[_0xc488('0x29')],0xa)+0x1);_0xd60fad['close']();}function handleUnpublished(_0x1f0b98){logger[_0xc488('0x8')](util[_0xc488('0x1d')]('Project\x20%s\x20not\x20published',_0x1f0b98['arg_1']));_0x1f0b98['continueAt'](_0x1f0b98[_0xc488('0x27')],_0x1f0b98['extension'],parseInt(_0x1f0b98[_0xc488('0x29')],0xa)+0x1);_0x1f0b98[_0xc488('0x39')]();}module['exports']={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index a6461b3..a2fedcf 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 _0xe373=['inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString','_inBody','indexOf','substring','split','slice','trim','length','emit','exports','util','stream','Transform','_localBuffer'];(function(_0x3f3053,_0x3940c9){var _0x105221=function(_0x98d89){while(--_0x98d89){_0x3f3053['push'](_0x3f3053['shift']());}};_0x105221(++_0x3940c9);}(_0xe373,0x11c));var _0x3e37=function(_0x4255b2,_0x4fac86){_0x4255b2=_0x4255b2-0x0;var _0x15e39c=_0xe373[_0x4255b2];return _0x15e39c;};'use strict';var util=require(_0x3e37('0x0'));var Transform=require(_0x3e37('0x1'))[_0x3e37('0x2')];function AGIReply(_0x50ee30){Transform['call'](this,_0x50ee30);this[_0x3e37('0x3')]='';this['_inBody']=![];}util[_0x3e37('0x4')](AGIReply,Transform);AGIReply[_0x3e37('0x5')][_0x3e37('0x6')]=function(_0x2ecfde,_0x1d9c2a,_0x62b337){var _0x539870='\x0a',_0x42d6e3=['\x0a\x0a',_0x3e37('0x7')],_0x2e8fc8=-0x1,_0x563c98=-0x1,_0x5e2509='',_0x435f3f=0x0,_0x8b6133='',_0x5896d6='';this[_0x3e37('0x3')]+=_0x2ecfde[_0x3e37('0x8')]();_0x8b6133=this['_localBuffer'];if(!this[_0x3e37('0x9')]){_0x435f3f=0x0;while(_0x42d6e3[_0x435f3f]){while((_0x563c98=_0x8b6133[_0x3e37('0xa')](_0x42d6e3[_0x435f3f]))!=-0x1){_0x5e2509=_0x42d6e3[_0x435f3f];_0x5896d6=_0x8b6133['substring'](0x0,_0x563c98);_0x8b6133=_0x8b6133[_0x3e37('0xb')](_0x563c98+_0x5e2509['length']);var _0x428d01=_0x5896d6[_0x3e37('0xc')](_0x539870),_0x52c557=0x0,_0x2554ff={},_0x5508eb='',_0x5c9151='',_0x4fb220=-0x1;while(_0x428d01[_0x52c557]){_0x4fb220=_0x428d01[_0x52c557][_0x3e37('0xa')](':');if(_0x4fb220!=-0x1){_0x5508eb=_0x428d01[_0x52c557][_0x3e37('0xd')](0x0,_0x4fb220)['trim']();_0x5c9151=_0x428d01[_0x52c557]['slice'](_0x4fb220+0x1)[_0x3e37('0xe')]();if(_0x5508eb[_0x3e37('0xf')]>0x0){_0x2554ff[_0x5508eb]=_0x5c9151;}}else{}_0x52c557++;}this[_0x3e37('0x10')]('headers',_0x2554ff);this[_0x3e37('0x9')]=!![];}_0x435f3f++;}this[_0x3e37('0x3')]=_0x8b6133;}else{while((_0x2e8fc8=_0x8b6133[_0x3e37('0xa')](_0x539870))!=-0x1){_0x5896d6=_0x8b6133[_0x3e37('0xb')](0x0,_0x2e8fc8);this[_0x3e37('0x10')]('line',_0x5896d6);_0x8b6133=_0x8b6133['substring'](_0x2e8fc8+_0x539870[_0x3e37('0xf')]);}this[_0x3e37('0x3')]=_0x8b6133;}_0x62b337();};module[_0x3e37('0x11')]=AGIReply; \ No newline at end of file +var _0x0e9f=['\x0d\x0a\x0d\x0a','_localBuffer','indexOf','substring','length','slice','trim','emit','line','exports','stream','Transform','_inBody','inherits','prototype','_transform'];(function(_0x27becc,_0x590c64){var _0x1631fe=function(_0x5af355){while(--_0x5af355){_0x27becc['push'](_0x27becc['shift']());}};_0x1631fe(++_0x590c64);}(_0x0e9f,0x7a));var _0xf0e9=function(_0x4f517f,_0x4ccde7){_0x4f517f=_0x4f517f-0x0;var _0x2a290a=_0x0e9f[_0x4f517f];return _0x2a290a;};'use strict';var util=require('util');var Transform=require(_0xf0e9('0x0'))[_0xf0e9('0x1')];function AGIReply(_0x5b0f51){Transform['call'](this,_0x5b0f51);this['_localBuffer']='';this[_0xf0e9('0x2')]=![];}util[_0xf0e9('0x3')](AGIReply,Transform);AGIReply[_0xf0e9('0x4')][_0xf0e9('0x5')]=function(_0x20adbd,_0xbc3ff0,_0xd7134d){var _0x1c9a31='\x0a',_0x29cb56=['\x0a\x0a',_0xf0e9('0x6')],_0x5000d8=-0x1,_0x5178ff=-0x1,_0x1b05b8='',_0x171cbf=0x0,_0x317d9b='',_0x4a23ea='';this[_0xf0e9('0x7')]+=_0x20adbd['toString']();_0x317d9b=this[_0xf0e9('0x7')];if(!this['_inBody']){_0x171cbf=0x0;while(_0x29cb56[_0x171cbf]){while((_0x5178ff=_0x317d9b[_0xf0e9('0x8')](_0x29cb56[_0x171cbf]))!=-0x1){_0x1b05b8=_0x29cb56[_0x171cbf];_0x4a23ea=_0x317d9b['substring'](0x0,_0x5178ff);_0x317d9b=_0x317d9b[_0xf0e9('0x9')](_0x5178ff+_0x1b05b8[_0xf0e9('0xa')]);var _0x4980a7=_0x4a23ea['split'](_0x1c9a31),_0x41e0e2=0x0,_0x254e78={},_0x5a4682='',_0x4940f0='',_0x4e6db0=-0x1;while(_0x4980a7[_0x41e0e2]){_0x4e6db0=_0x4980a7[_0x41e0e2][_0xf0e9('0x8')](':');if(_0x4e6db0!=-0x1){_0x5a4682=_0x4980a7[_0x41e0e2][_0xf0e9('0xb')](0x0,_0x4e6db0)[_0xf0e9('0xc')]();_0x4940f0=_0x4980a7[_0x41e0e2][_0xf0e9('0xb')](_0x4e6db0+0x1)['trim']();if(_0x5a4682[_0xf0e9('0xa')]>0x0){_0x254e78[_0x5a4682]=_0x4940f0;}}else{}_0x41e0e2++;}this[_0xf0e9('0xd')]('headers',_0x254e78);this[_0xf0e9('0x2')]=!![];}_0x171cbf++;}this[_0xf0e9('0x7')]=_0x317d9b;}else{while((_0x5000d8=_0x317d9b[_0xf0e9('0x8')](_0x1c9a31))!=-0x1){_0x4a23ea=_0x317d9b['substring'](0x0,_0x5000d8);this['emit'](_0xf0e9('0xe'),_0x4a23ea);_0x317d9b=_0x317d9b[_0xf0e9('0x9')](_0x5000d8+_0x1c9a31[_0xf0e9('0xa')]);}this[_0xf0e9('0x7')]=_0x317d9b;}_0xd7134d();};module[_0xf0e9('0xf')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 6781368..4e74b5a 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 _0x4f29=['getTrunkById','ShowTrunk','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','createSquareDetailsReport','createSquareReport','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createCmContact','ShowCmHopper','ListId','CreateCmContact','ShowPause','agentLogin','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','moment','jayson/promise','client','http','request','then','message','result','catch','getSquareProjects','getSquareProject','ShowSquareProject','production','getMailAccountById','MailServerOut','Smtp','CloudProvider','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','ShowVariable','ShowSquareOdbc','ShowUser','GetContactByPhone','phone'];(function(_0x3ad8d1,_0xdb6b71){var _0x2ed13f=function(_0x5f4942){while(--_0x5f4942){_0x3ad8d1['push'](_0x3ad8d1['shift']());}};_0x2ed13f(++_0xdb6b71);}(_0x4f29,0xfd));var _0x94f2=function(_0x3e56e6,_0xace190){_0x3e56e6=_0x3e56e6-0x0;var _0x474363=_0x4f29[_0x3e56e6];return _0x474363;};'use strict';var _=require('lodash');var moment=require(_0x94f2('0x0'));var jayson=require(_0x94f2('0x1'));var client=jayson[_0x94f2('0x2')][_0x94f2('0x3')]({'port':0x2329});function request(_0xc16ee3,_0x36e06e){return new Promise(function(_0x338fe2,_0x2a6535){return client[_0x94f2('0x4')](_0xc16ee3,_0x36e06e)[_0x94f2('0x5')](function(_0x273314){if(_0x273314['error']){return _0x2a6535(_0x273314['error'][_0x94f2('0x6')]);}else{return _0x338fe2(_0x273314[_0x94f2('0x7')]);}})[_0x94f2('0x8')](function(_0x224a93){return _0x2a6535(_0x224a93);});});}exports[_0x94f2('0x9')]=function(){return request('GetSquareProjects',{'options':{'raw':![],'attributes':['id','name','production']}});};exports[_0x94f2('0xa')]=function(_0x511952){return request(_0x94f2('0xb'),{'options':{'raw':![],'where':{'name':_0x511952},'attributes':[_0x94f2('0xc')]}});};exports[_0x94f2('0xd')]=function(_0x117396){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x117396},'include':[{'model':_0x94f2('0xe'),'as':_0x94f2('0xf'),'include':[{'model':_0x94f2('0x10'),'as':_0x94f2('0x10')}]}],'attributes':['id',_0x94f2('0x11'),_0x94f2('0x12')],'smtp':!![]}});};exports[_0x94f2('0x13')]=function(_0x490142){return request(_0x94f2('0xb'),{'options':{'where':{'id':_0x490142},'attributes':['name']}});};exports[_0x94f2('0x14')]=function(_0x7a3dc0){return request(_0x94f2('0x15'),{'options':{'where':{'id':_0x7a3dc0},'attributes':['name']}});};exports['getVariableById']=function(_0x292953){return request(_0x94f2('0x16'),{'options':{'where':{'id':_0x292953},'attributes':[_0x94f2('0x11')]}});};exports['getSquareOdbcById']=function(_0x8496f1){return request(_0x94f2('0x17'),{'options':{'where':{'id':_0x8496f1},'attributes':['dsn']}});};exports['getUserById']=function(_0x423aa8){return request(_0x94f2('0x18'),{'options':{'where':{'id':_0x423aa8},'attributes':[_0x94f2('0x11')]}});};exports['getContactByPhone']=function(_0x302c00){return request(_0x94f2('0x19'),{'options':{'where':{'phone':_0x302c00[_0x94f2('0x1a')]},'attributes':['id']}});};exports[_0x94f2('0x1b')]=function(_0x4ceba8){return request(_0x94f2('0x1c'),{'options':{'where':{'id':_0x4ceba8},'attributes':[_0x94f2('0x11')]}});};exports['getSoundById']=function(_0x397744){return request(_0x94f2('0x1d'),{'options':{'where':{'id':_0x397744},'attributes':[_0x94f2('0x1e')]}});};exports[_0x94f2('0x1f')]=function(_0x6858ba){return request(_0x94f2('0x20'),{'options':{'raw':![],'where':{'id':_0x6858ba},'include':[{'model':_0x94f2('0x21'),'as':_0x94f2('0x22')}]}});};exports[_0x94f2('0x23')]=function(_0xed0b88){return request(_0x94f2('0x24'),{'options':{'where':{'id':_0xed0b88},'attributes':['id',_0x94f2('0x11')]}});};exports[_0x94f2('0x25')]=function(_0x35b31d){return request('CreateSmsMessage',{'body':_0x35b31d});};exports[_0x94f2('0x26')]=function(_0xf4eeb0){return request('CreateSquareDetailsReport',{'body':_0xf4eeb0});};exports[_0x94f2('0x27')]=function(_0x3e2e0a){return request('CreateSquareReport',{'body':_['merge'](_0x3e2e0a,{'project_name':_0x3e2e0a['arg_1'],'prev_project_name':_0x3e2e0a['arg_2']||'','is_subproject':_0x3e2e0a['arg_2']?!![]:![],'leaveAt':moment()[_0x94f2('0x28')](_0x94f2('0x29'))})});};exports[_0x94f2('0x2a')]=function(_0x14ae14){return request(_0x94f2('0x2b'),{'body':_0x14ae14});};exports['createSquareMessage']=function(_0x1ccf31){return request('CreateSquareMessage',{'body':_0x1ccf31});};exports[_0x94f2('0x2c')]=function(_0xd5b804){return request(_0x94f2('0x2d'),{'options':{'raw':![],'where':{'phone':_0xd5b804[_0x94f2('0x1a')],'ListId':_0xd5b804[_0x94f2('0x2e')]}}})[_0x94f2('0x5')](function(_0x27d85f){if(_0x27d85f){return _0x27d85f;}return request(_0x94f2('0x2f'),{'body':_0xd5b804});});};exports['getPauseById']=function(_0x134a0f){return request(_0x94f2('0x30'),{'options':{'where':{'id':_0x134a0f},'attributes':[_0x94f2('0x11')]}});};exports[_0x94f2('0x31')]=function(_0x547a48,_0xd54694){return request('LoginUser',{'body':{'interface':_0xd54694},'options':{'where':_0x547a48}});};exports[_0x94f2('0x32')]=function(_0x1e8033,_0x3096bf,_0x4c8c14){return request(_0x94f2('0x33'),{'body':{'type':_0x3096bf,'uniqueid':_0x4c8c14},'options':{'where':_0x1e8033}});};exports[_0x94f2('0x34')]=function(_0x280ae4){return request(_0x94f2('0x35'),{'body':{},'options':{'where':_0x280ae4}});};exports[_0x94f2('0x36')]=function(_0x25c0b0){return request(_0x94f2('0x37'),{'body':{},'options':{'where':_0x25c0b0}});}; \ No newline at end of file +var _0x891b=['Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','createCmContact','ListId','CreateCmContact','agentLogin','LoginUser','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','jayson/promise','client','then','error','getSquareProjects','GetSquareProjects','name','production','getSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','getSquareProjectById','ShowSquareProject','getVoiceQueueById','ShowVoiceQueue','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk','save_name','getIntervalById','ShowInterval'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x891b,0xc5));var _0xb891=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x891b[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var moment=require('moment');var jayson=require(_0xb891('0x0'));var client=jayson[_0xb891('0x1')]['http']({'port':0x2329});function request(_0x31870f,_0xca3e82){return new Promise(function(_0x1c519f,_0x467558){return client['request'](_0x31870f,_0xca3e82)[_0xb891('0x2')](function(_0x44ca2e){if(_0x44ca2e['error']){return _0x467558(_0x44ca2e[_0xb891('0x3')]['message']);}else{return _0x1c519f(_0x44ca2e['result']);}})['catch'](function(_0x134dc0){return _0x467558(_0x134dc0);});});}exports[_0xb891('0x4')]=function(){return request(_0xb891('0x5'),{'options':{'raw':![],'attributes':['id',_0xb891('0x6'),_0xb891('0x7')]}});};exports[_0xb891('0x8')]=function(_0x119686){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x119686},'attributes':[_0xb891('0x7')]}});};exports[_0xb891('0x9')]=function(_0x2dd7d4){return request(_0xb891('0xa'),{'options':{'raw':![],'where':{'id':_0x2dd7d4},'include':[{'model':_0xb891('0xb'),'as':_0xb891('0xc'),'include':[{'model':_0xb891('0xd'),'as':_0xb891('0xd')}]}],'attributes':['id',_0xb891('0x6'),_0xb891('0xe')],'smtp':!![]}});};exports[_0xb891('0xf')]=function(_0x5ecb30){return request(_0xb891('0x10'),{'options':{'where':{'id':_0x5ecb30},'attributes':[_0xb891('0x6')]}});};exports[_0xb891('0x11')]=function(_0x57c76b){return request(_0xb891('0x12'),{'options':{'where':{'id':_0x57c76b},'attributes':[_0xb891('0x6')]}});};exports['getVariableById']=function(_0xca0294){return request('ShowVariable',{'options':{'where':{'id':_0xca0294},'attributes':[_0xb891('0x6')]}});};exports[_0xb891('0x13')]=function(_0x1a028b){return request(_0xb891('0x14'),{'options':{'where':{'id':_0x1a028b},'attributes':[_0xb891('0x15')]}});};exports[_0xb891('0x16')]=function(_0x592f48){return request('ShowUser',{'options':{'where':{'id':_0x592f48},'attributes':[_0xb891('0x6')]}});};exports[_0xb891('0x17')]=function(_0x10a1b3){return request(_0xb891('0x18'),{'options':{'where':{'phone':_0x10a1b3[_0xb891('0x19')]},'attributes':['id']}});};exports[_0xb891('0x1a')]=function(_0x2b1afa){return request(_0xb891('0x1b'),{'options':{'where':{'id':_0x2b1afa},'attributes':['name']}});};exports['getSoundById']=function(_0x245a64){return request('ShowSound',{'options':{'where':{'id':_0x245a64},'attributes':[_0xb891('0x1c')]}});};exports[_0xb891('0x1d')]=function(_0x5cd70a){return request(_0xb891('0x1e'),{'options':{'raw':![],'where':{'id':_0x5cd70a},'include':[{'model':'Interval','as':_0xb891('0x1f')}]}});};exports[_0xb891('0x20')]=function(_0x46ad5b){return request(_0xb891('0x21'),{'options':{'where':{'id':_0x46ad5b},'attributes':['id',_0xb891('0x6')]}});};exports[_0xb891('0x22')]=function(_0x14e936){return request(_0xb891('0x23'),{'body':_0x14e936});};exports[_0xb891('0x24')]=function(_0x2b50a7){return request(_0xb891('0x25'),{'body':_0x2b50a7});};exports[_0xb891('0x26')]=function(_0x5f5731){return request(_0xb891('0x27'),{'body':_[_0xb891('0x28')](_0x5f5731,{'project_name':_0x5f5731[_0xb891('0x29')],'prev_project_name':_0x5f5731['arg_2']||'','is_subproject':_0x5f5731[_0xb891('0x2a')]?!![]:![],'leaveAt':moment()['format'](_0xb891('0x2b'))})});};exports[_0xb891('0x2c')]=function(_0x210ea4){return request(_0xb891('0x2d'),{'body':_0x210ea4});};exports[_0xb891('0x2e')]=function(_0x519f0c){return request('CreateSquareMessage',{'body':_0x519f0c});};exports[_0xb891('0x2f')]=function(_0x54f690){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x54f690[_0xb891('0x19')],'ListId':_0x54f690[_0xb891('0x30')]}}})[_0xb891('0x2')](function(_0x600154){if(_0x600154){return _0x600154;}return request(_0xb891('0x31'),{'body':_0x54f690});});};exports['getPauseById']=function(_0x2af0eb){return request('ShowPause',{'options':{'where':{'id':_0x2af0eb},'attributes':[_0xb891('0x6')]}});};exports[_0xb891('0x32')]=function(_0x1f6bc8,_0x5adcbe){return request(_0xb891('0x33'),{'body':{'interface':_0x5adcbe},'options':{'where':_0x1f6bc8}});};exports['agentPause']=function(_0x489a73,_0x1d5e51,_0x3b0aeb){return request(_0xb891('0x34'),{'body':{'type':_0x1d5e51,'uniqueid':_0x3b0aeb},'options':{'where':_0x489a73}});};exports[_0xb891('0x35')]=function(_0x5a200d){return request(_0xb891('0x36'),{'body':{},'options':{'where':_0x5a200d}});};exports[_0xb891('0x37')]=function(_0x257f6e){return request(_0xb891('0x38'),{'body':{},'options':{'where':_0x257f6e}});}; \ 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 ad452da..bb557ce 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 _0x6c45=['./lex','./polly'];(function(_0x2a9352,_0x2c92f9){var _0x4eb483=function(_0x3e6c16){while(--_0x3e6c16){_0x2a9352['push'](_0x2a9352['shift']());}};_0x4eb483(++_0x2c92f9);}(_0x6c45,0xb1));var _0x56c4=function(_0x1727bc,_0x4d5590){_0x1727bc=_0x1727bc-0x0;var _0x10e45f=_0x6c45[_0x1727bc];return _0x10e45f;};var polly=require(_0x56c4('0x0'));var lex=require(_0x56c4('0x1'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xbe3b=['./lex','exports'];(function(_0x407bd8,_0x277add){var _0x20b6c9=function(_0x215b6c){while(--_0x215b6c){_0x407bd8['push'](_0x407bd8['shift']());}};_0x20b6c9(++_0x277add);}(_0xbe3b,0x19c));var _0xbbe3=function(_0xb60643,_0x5a28f0){_0xb60643=_0xb60643-0x0;var _0x2375d3=_0xbe3b[_0xb60643];return _0x2375d3;};var polly=require('./polly');var lex=require(_0xbbe3('0x0'));module[_0xbbe3('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 930651b..fb33130 100644 --- a/server/services/agi/scripts/aws/lex/index.js +++ b/server/services/agi/scripts/aws/lex/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6c76=['./lib/api','exports'];(function(_0x3a98db,_0x35330e){var _0xce13bc=function(_0x5db35d){while(--_0x5db35d){_0x3a98db['push'](_0x3a98db['shift']());}};_0xce13bc(++_0x35330e);}(_0x6c76,0x184));var _0x66c7=function(_0x17c364,_0x4194f5){_0x17c364=_0x17c364-0x0;var _0xc1ed5=_0x6c76[_0x17c364];return _0xc1ed5;};'use strict';var lex=require(_0x66c7('0x0'));module[_0x66c7('0x1')]=function(_0x10a050,_0x55604c,_0x203e75,_0xd49f21,_0x519756,_0x572a2b){return lex(_0x10a050,_0x55604c,_0x203e75,_0xd49f21,_0x519756,_0x572a2b);}; \ No newline at end of file +var _0xaa88=['exports','./lib/api'];(function(_0x5adbc0,_0x191ff2){var _0x55e51c=function(_0x34367f){while(--_0x34367f){_0x5adbc0['push'](_0x5adbc0['shift']());}};_0x55e51c(++_0x191ff2);}(_0xaa88,0x137));var _0x8aa8=function(_0x514260,_0x1891e1){_0x514260=_0x514260-0x0;var _0x4ac81b=_0xaa88[_0x514260];return _0x4ac81b;};'use strict';var lex=require(_0x8aa8('0x0'));module[_0x8aa8('0x1')]=function(_0x1643a6,_0x51c79b,_0x4aee38,_0x4ba9dd,_0x3a5b12,_0x43f7e4){return lex(_0x1643a6,_0x51c79b,_0x4aee38,_0x4ba9dd,_0x3a5b12,_0x43f7e4);}; \ 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 e2f4d11..1d8a3d0 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(_0x257523,_0x28cd48){var _0x20e793=function(_0x153dc9){while(--_0x153dc9){_0x257523['push'](_0x257523['shift']());}};_0x20e793(++_0x28cd48);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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(_0x8241b,_0x537667){var _0x514a13=function(_0x40bdd0){while(--_0x40bdd0){_0x8241b['push'](_0x8241b['shift']());}};_0x514a13(++_0x537667);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'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 903cac5..c5ebd0e 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 _0x342f=['exports','./lib/api'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x342f,0xbb));var _0xf342=function(_0x15cf85,_0x46015f){_0x15cf85=_0x15cf85-0x0;var _0x12fb0e=_0x342f[_0x15cf85];return _0x12fb0e;};'use strict';var polly=require(_0xf342('0x0'));module[_0xf342('0x1')]=function(_0x559e10,_0x1fe9e5,_0x977a5c,_0x398666,_0x118b31,_0x4a979d,_0x1f76ba){return polly(_0x559e10,_0x1fe9e5,_0x977a5c,_0x398666,_0x118b31,_0x4a979d,_0x1f76ba);}; \ No newline at end of file +var _0x966a=['exports'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x966a,0xfc));var _0xa966=function(_0xd7c1cc,_0x55b008){_0xd7c1cc=_0xd7c1cc-0x0;var _0x340dac=_0x966a[_0xd7c1cc];return _0x340dac;};'use strict';var polly=require('./lib/api');module[_0xa966('0x0')]=function(_0x3246cf,_0x363d31,_0x46a674,_0x4f5e96,_0x483323,_0x3c0fb1,_0x178331){return polly(_0x3246cf,_0x363d31,_0x46a674,_0x4f5e96,_0x483323,_0x3c0fb1,_0x178331);}; \ 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 2e10c2c..8021709 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 _0x59d2=['randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','text','path','bluebird'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x59d2,0xe5));var _0x259d=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x59d2[_0xa1e3e3];return _0xc980e9;};'use strict';var fs=require('fs');var path=require(_0x259d('0x0'));var BPromise=require(_0x259d('0x1'));var rs=require(_0x259d('0x2'));var AWS=require(_0x259d('0x3'));function pollyResult(_0x17b1f1,_0x5e55e6,_0x3f4cca){return new BPromise(function(_0x3c8b4e,_0x3564b7){_0x17b1f1[_0x259d('0x4')](_0x5e55e6,function(_0x11e35f,_0x12bc1b){if(_0x11e35f){_0x3564b7(_0x11e35f);}else if(_0x12bc1b){if(_0x12bc1b[_0x259d('0x5')]instanceof Buffer){fs[_0x259d('0x6')](_0x3f4cca,_0x12bc1b[_0x259d('0x5')],function(_0x5edcf3){if(_0x5edcf3){_0x3564b7(_0x5edcf3);}else{_0x3c8b4e();}});}else{_0x3564b7(new Error(_0x259d('0x7')));}}else{_0x3564b7(new Error(_0x259d('0x8')));}});});}module[_0x259d('0x9')]=function(_0x5efb45,_0xa93f05,_0x3b3b3e,_0x4a4e44,_0x307363,_0x3e8067,_0x1cf3de){var _0x53ca6a=new AWS['Polly']({'accessKeyId':_0x5efb45,'secretAccessKey':_0xa93f05,'region':_0x3b3b3e});var _0x432e95={'Text':_0x307363,'TextType':_0x3e8067||_0x259d('0xa'),'OutputFormat':'mp3','VoiceId':_0x4a4e44};return pollyResult(_0x53ca6a,_0x432e95,_0x1cf3de);}; \ No newline at end of file +var _0x4a9b=['AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','bluebird','aws-sdk','synthesizeSpeech','writeFile'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4a9b,0xed));var _0xb4a9=function(_0x3cd204,_0x273fe7){_0x3cd204=_0x3cd204-0x0;var _0x2338d4=_0x4a9b[_0x3cd204];return _0x2338d4;};'use strict';var fs=require('fs');var path=require(_0xb4a9('0x0'));var BPromise=require(_0xb4a9('0x1'));var rs=require('randomstring');var AWS=require(_0xb4a9('0x2'));function pollyResult(_0x5d498e,_0x3d3b68,_0xc0c6d9){return new BPromise(function(_0x320a50,_0x3c70b7){_0x5d498e[_0xb4a9('0x3')](_0x3d3b68,function(_0x3e37ff,_0xed8a78){if(_0x3e37ff){_0x3c70b7(_0x3e37ff);}else if(_0xed8a78){if(_0xed8a78['AudioStream']instanceof Buffer){fs[_0xb4a9('0x4')](_0xc0c6d9,_0xed8a78[_0xb4a9('0x5')],function(_0x425bc1){if(_0x425bc1){_0x3c70b7(_0x425bc1);}else{_0x320a50();}});}else{_0x3c70b7(new Error(_0xb4a9('0x6')));}}else{_0x3c70b7(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0xb4a9('0x7')]=function(_0x4ca021,_0x48e96a,_0x5cbe1b,_0x2b7b3e,_0x424998,_0x3fa14a,_0x48ac01){var _0x5152db=new AWS[(_0xb4a9('0x8'))]({'accessKeyId':_0x4ca021,'secretAccessKey':_0x48e96a,'region':_0x5cbe1b});var _0x189ec4={'Text':_0x424998,'TextType':_0x3fa14a||_0xb4a9('0x9'),'OutputFormat':_0xb4a9('0xa'),'VoiceId':_0x2b7b3e};return pollyResult(_0x5152db,_0x189ec4,_0x48ac01);}; \ 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 16b35c0..4f87102 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 _0x3437=['exports','./lib/api'];(function(_0x5c92a4,_0x819c46){var _0x2007e7=function(_0x4235f6){while(--_0x4235f6){_0x5c92a4['push'](_0x5c92a4['shift']());}};_0x2007e7(++_0x819c46);}(_0x3437,0x191));var _0x7343=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x3437[_0x21a9d9];return _0x46adce;};'use strict';var asr=require(_0x7343('0x0'));module[_0x7343('0x1')]=function(_0x30a371,_0x202ed2,_0x4fb1e7,_0x4306f6){return asr(_0x30a371,_0x202ed2,_0x4fb1e7);}; \ No newline at end of file +var _0x37d6=['exports'];(function(_0x41c3ac,_0x35c6e7){var _0x4aaccd=function(_0x30c53d){while(--_0x30c53d){_0x41c3ac['push'](_0x41c3ac['shift']());}};_0x4aaccd(++_0x35c6e7);}(_0x37d6,0x156));var _0x637d=function(_0x57807,_0x43a33b){_0x57807=_0x57807-0x0;var _0x1ba2c3=_0x37d6[_0x57807];return _0x1ba2c3;};'use strict';var asr=require('./lib/api');module[_0x637d('0x0')]=function(_0x1276b9,_0xb19779,_0x607d0b,_0x3970d8){return asr(_0x1276b9,_0xb19779,_0x607d0b);}; \ 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 e95f613..d0e1b99 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 _0x8db0=['length','string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','exports'];(function(_0x3ebd42,_0x29741a){var _0x41cd10=function(_0x390fc4){while(--_0x390fc4){_0x3ebd42['push'](_0x3ebd42['shift']());}};_0x41cd10(++_0x29741a);}(_0x8db0,0x65));var _0x08db=function(_0x3be2e2,_0x5c166d){_0x3be2e2=_0x3be2e2-0x0;var _0x53b9c5=_0x8db0[_0x3be2e2];return _0x53b9c5;};'use strict';var url=require(_0x08db('0x0'));var BPromise=require(_0x08db('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x08db('0x2')]=function(_0x2ac694,_0x17ccf3,_0x5eb423){return new BPromise(function(_0x3b5170,_0x55e572){var _0x4f4614;if(typeof _0x2ac694!=='string'||_0x2ac694[_0x08db('0x3')]===0x0){return _0x55e572('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x17ccf3!==_0x08db('0x4')||_0x17ccf3['length']===0x0){return _0x55e572(_0x08db('0x5'));}if(typeof _0x5eb423!==_0x08db('0x6')&&(typeof _0x5eb423!==_0x08db('0x4')||_0x5eb423[_0x08db('0x3')]===0x0)){return _0x55e572(_0x08db('0x7'));}try{_0x4f4614=fs['readFileSync'](_0x2ac694)['toString'](_0x08db('0x8'));}catch(_0x2fe457){return _0x55e572(_0x2fe457);}return _0x3b5170({'method':_0x08db('0x9'),'uri':host+_0x08db('0xa')+_0x17ccf3,'body':{'config':{'encoding':_0x08db('0xb'),'sampleRateHertz':_0x08db('0xc'),'languageCode':_0x5eb423},'audio':{'content':_0x4f4614}},'json':!![]});});}; \ No newline at end of file +var _0x202c=['string','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','length','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','exports'];(function(_0x18ace5,_0x13aa30){var _0x429f97=function(_0x127e4e){while(--_0x127e4e){_0x18ace5['push'](_0x18ace5['shift']());}};_0x429f97(++_0x13aa30);}(_0x202c,0x178));var _0xc202=function(_0x186c21,_0x3229d3){_0x186c21=_0x186c21-0x0;var _0x1c7241=_0x202c[_0x186c21];return _0x1c7241;};'use strict';var url=require(_0xc202('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host='https://speech.googleapis.com';module[_0xc202('0x1')]=function(_0x1ab6a1,_0x27b3b2,_0x5c5dec){return new BPromise(function(_0x215161,_0x155c3b){var _0x1763f5;if(typeof _0x1ab6a1!==_0xc202('0x2')||_0x1ab6a1['length']===0x0){return _0x155c3b(_0xc202('0x3'));}if(typeof _0x27b3b2!==_0xc202('0x2')||_0x27b3b2['length']===0x0){return _0x155c3b(_0xc202('0x4'));}if(typeof _0x5c5dec!=='undefined'&&(typeof _0x5c5dec!==_0xc202('0x2')||_0x5c5dec[_0xc202('0x5')]===0x0)){return _0x155c3b(_0xc202('0x6'));}try{_0x1763f5=fs[_0xc202('0x7')](_0x1ab6a1)[_0xc202('0x8')](_0xc202('0x9'));}catch(_0x409c93){return _0x155c3b(_0x409c93);}return _0x215161({'method':_0xc202('0xa'),'uri':host+_0xc202('0xb')+_0x27b3b2,'body':{'config':{'encoding':_0xc202('0xc'),'sampleRateHertz':_0xc202('0xd'),'languageCode':_0x5c5dec},'audio':{'content':_0x1763f5}},'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 182994c..eb8b20b 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 _0x428b=['exports'];(function(_0x454064,_0x1c6c86){var _0x1a18c1=function(_0xdceeba){while(--_0xdceeba){_0x454064['push'](_0x454064['shift']());}};_0x1a18c1(++_0x1c6c86);}(_0x428b,0x72));var _0xb428=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x428b[_0x4a747d];return _0x3a5b5c;};var asr=require('./asr');module[_0xb428('0x0')]={'asr':asr}; \ No newline at end of file +var _0x0d14=['exports'];(function(_0x21f721,_0x490dfb){var _0x46821d=function(_0x97682b){while(--_0x97682b){_0x21f721['push'](_0x21f721['shift']());}};_0x46821d(++_0x490dfb);}(_0x0d14,0xbf));var _0x40d1=function(_0x3cc500,_0x5cafe9){_0x3cc500=_0x3cc500-0x0;var _0x58c77c=_0x0d14[_0x3cc500];return _0x58c77c;};var asr=require('./asr');module[_0x40d1('0x0')]={'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 21a6bda..cf0c8cb 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 _0x4e30=['https','path','querystring','request-promise','url','parse','./aws','./google','./sestek','./tilde','../../../config/logger','host','WHAT_EVER','get','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','finish','finish\x20download\x20file','unlink','download\x20error','end','protocol','https:','request\x20to\x20','data','transcode','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','base64','then','777','split','readFileSync','toString','googleCloudTTS','?key=','ssml','input','voice','MP3','text:synthesize','POST','.mp3','from','audioContent','writeFile','chmodSync','info','googleCloudTTS\x20path','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','jQ1olc','stringify','generic','slice','parse\x20response\x20failed:\x0a','length','\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','confidence','join','googleASR\x20transcription','googleASR\x20confidence','[%s]\x20%s:%s','message','googleDialogflow','textRequest','result','source','resolvedQuery','action','actionIncomplete','fulfillment','score','status','code','metadata','endConversation','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','boolValue','fulfillmentText','intent','name','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','Tilde\x20ASR\x20transcription','polly','awsLex','ispeechTTS','format','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','channelData','audiofile','dirName','apiai-promise','bluebird','dialogflow','http'];(function(_0x20cc7c,_0x4a7401){var _0x1de7be=function(_0x599500){while(--_0x599500){_0x20cc7c['push'](_0x20cc7c['shift']());}};_0x1de7be(++_0x4a7401);}(_0x4e30,0x80));var _0x04e3=function(_0x18be85,_0x436c70){_0x18be85=_0x18be85-0x0;var _0x409c2a=_0x4e30[_0x18be85];return _0x409c2a;};'use strict';var apiai=require(_0x04e3('0x0'));var BPromise=require(_0x04e3('0x1'));var dialogflow=require(_0x04e3('0x2'));var fs=require('fs');var http=require(_0x04e3('0x3'));var https=require(_0x04e3('0x4'));var md5=require('md5');var path=require(_0x04e3('0x5'));var querystring=require(_0x04e3('0x6'));var rp=require(_0x04e3('0x7'));var rs=require('randomstring');var sox=require('sox');var tts=require('google-tts-api');var urlParse=require(_0x04e3('0x8'))[_0x04e3('0x9')];var util=require('util');var aws=require(_0x04e3('0xa'));var google=require(_0x04e3('0xb'));var sestek=require(_0x04e3('0xc'));var tilde=require(_0x04e3('0xd'));var logger=require(_0x04e3('0xe'))('agi');var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x579907,_0x44e19a){return new BPromise(function(_0x108ca9,_0x6bd871){var _0x48f159=urlParse(_0x579907);var _0x36bc1e=_0x48f159['protocol']==='https:'?https:http;var _0x412eec={'host':_0x48f159[_0x04e3('0xf')],'path':_0x48f159[_0x04e3('0x5')],'headers':{'user-agent':_0x04e3('0x10')}};_0x36bc1e[_0x04e3('0x11')](_0x412eec,function(_0x2af55b){if(_0x2af55b[_0x04e3('0x12')]!==0xc8){logger[_0x04e3('0x13')]('request\x20to\x20'+_0x579907+_0x04e3('0x14')+_0x2af55b[_0x04e3('0x12')]+'\x20('+_0x2af55b[_0x04e3('0x15')]+')');_0x6bd871(new Error('request\x20to\x20'+_0x579907+_0x04e3('0x14')+_0x2af55b[_0x04e3('0x12')]+'\x20('+_0x2af55b[_0x04e3('0x15')]+')'));return;}var _0x3b1956=fs['createWriteStream'](_0x44e19a);_0x3b1956['on'](_0x04e3('0x16'),function(){logger['info'](_0x04e3('0x17'));_0x3b1956['close'](_0x108ca9);});_0x3b1956['on'](_0x04e3('0x13'),function(_0x4810c0){fs[_0x04e3('0x18')](_0x44e19a);logger[_0x04e3('0x13')](_0x04e3('0x19'),_0x4810c0);_0x6bd871(_0x4810c0);});_0x2af55b['pipe'](_0x3b1956);})['on']('error',function(_0x45da5a){logger[_0x04e3('0x13')](_0x45da5a);_0x6bd871(_0x45da5a);})[_0x04e3('0x1a')]();});}function uploadFile(_0x1c3dfa){return new BPromise(function(_0x41064a,_0x4e8960){var _0x8dc8aa=urlParse(_0x1c3dfa);var _0x2777a2=_0x8dc8aa[_0x04e3('0x1b')]===_0x04e3('0x1c')?https:http;var _0x246d13={'host':_0x8dc8aa[_0x04e3('0xf')],'path':_0x8dc8aa[_0x04e3('0x5')],'headers':{'user-agent':_0x04e3('0x10')}};_0x2777a2[_0x04e3('0x11')](_0x246d13,function(_0x29db5d){if(_0x29db5d['statusCode']!==0xc8){_0x4e8960(new Error(_0x04e3('0x1d')+_0x1c3dfa+_0x04e3('0x14')+_0x29db5d[_0x04e3('0x12')]+'\x20('+_0x29db5d[_0x04e3('0x15')]+')'));return;}var _0x41c35c='';_0x29db5d['on'](_0x04e3('0x1e'),function(_0x4bfcf9){_0x41c35c+=_0x4bfcf9;});_0x29db5d['on'](_0x04e3('0x1a'),function(){_0x41064a(_0x41c35c);});})['on'](_0x04e3('0x13'),function(_0x3131f5){_0x4e8960(_0x3131f5);})[_0x04e3('0x1a')]();});}function convertFile(_0x19e627,_0x12c713){return new BPromise(function(_0x336559,_0xc6d5cb){var _0x54aff7=sox[_0x04e3('0x1f')](_0x19e627,_0x12c713,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x54aff7['on'](_0x04e3('0x13'),function(_0x863498){logger['error'](_0x04e3('0x20'),_0x863498);_0xc6d5cb(_0x863498);});_0x54aff7['on'](_0x04e3('0x1a'),function(){logger['info'](_0x04e3('0x21'));_0x336559();});_0x54aff7[_0x04e3('0x22')]();});}function base64Decode(_0x53908c,_0x5e2455){var _0x39e192=path[_0x04e3('0x23')](__dirname,_0x04e3('0x24'),rs[_0x04e3('0x25')](0x4)+_0x04e3('0x26'));fs[_0x04e3('0x27')](_0x39e192,_0x53908c,_0x04e3('0x28'));return convertFile(_0x39e192,_0x5e2455)[_0x04e3('0x29')](function(){try{fs[_0x04e3('0x18')](_0x39e192);fs['chmodSync'](_0x5e2455,_0x04e3('0x2a'));}catch(_0x2c5c39){logger['error'](_0x2c5c39);}return _0x5e2455[_0x04e3('0x2b')]('.')[0x0];});}function base64Encode(_0x45736d){var _0x3cff61=fs[_0x04e3('0x2c')](_0x45736d);return new Buffer(_0x3cff61)[_0x04e3('0x2d')]('base64');}exports[_0x04e3('0x2e')]=function(_0x2b8756,_0x2bb749,_0x36bd5d,_0x2b4264,_0x5811e2,_0x2da810){var _0x568629,_0x3cfdb8;var _0x306668='https://texttospeech.googleapis.com/v1/';var _0x1f2f4a=_0x04e3('0x2f')+_0x2b8756;var _0x36ce6e={};if(_0x2bb749===_0x04e3('0x30')){_0x36ce6e[_0x04e3('0x31')]={'ssml':_0x36bd5d};}else{_0x36ce6e[_0x04e3('0x31')]={'text':_0x36bd5d};};_0x36ce6e[_0x04e3('0x32')]={'languageCode':_0x2b4264,'ssmlGender':_0x5811e2};_0x36ce6e['audioConfig']={'audioEncoding':_0x04e3('0x33'),'sampleRateHertz':0x1f40};var _0x4f7bd6={'url':_0x306668+_0x04e3('0x34')+_0x1f2f4a,'method':_0x04e3('0x35'),'json':!![],'body':_0x36ce6e};return rp(_0x4f7bd6)[_0x04e3('0x29')](function(_0xb40f4a){return new BPromise(function(_0x1be812,_0x34a267){_0x568629=path['resolve'](__dirname,'tmp',rs[_0x04e3('0x25')](0x4)+_0x04e3('0x36'));var _0x13947a=Buffer[_0x04e3('0x37')](_0xb40f4a[_0x04e3('0x38')],_0x04e3('0x28'));return fs[_0x04e3('0x39')](_0x568629,_0x13947a,function(_0x165799){_0x34a267(_0x165799);},function(_0x597350){fs['chmodSync'](_0x568629,_0x04e3('0x2a'));_0x1be812(_0x597350);});});})[_0x04e3('0x29')](function(_0x4f3d25){_0x3cfdb8=path['resolve'](__dirname,_0x04e3('0x24'),rs[_0x04e3('0x25')](0x4)+_0x04e3('0x26'));return convertFile(_0x568629,_0x3cfdb8);})['then'](function(){try{fs[_0x04e3('0x18')](_0x568629);fs[_0x04e3('0x3a')](_0x3cfdb8,_0x04e3('0x2a'));}catch(_0x3c356a){logger[_0x04e3('0x13')](_0x3c356a);}logger[_0x04e3('0x3b')](_0x04e3('0x3c'),_0x3cfdb8[_0x04e3('0x2b')]('.')[0x0]);return _0x3cfdb8[_0x04e3('0x2b')]('.')[0x0];});};exports['googleTTS']=function(_0x49ddb4,_0x3df7da){var _0x396d26=_0x04e3('0x3d');var _0x26bafc,_0xc0f204;var _0x2a57d4;var _0x266fcd={'encoding':_0x04e3('0x3e'),'method':_0x04e3('0x35'),'timeout':0x2710,'url':_0x396d26,'headers':{'Content-Type':_0x04e3('0x3f')},'body':_0x04e3('0x40')+encodeURIComponent(JSON['stringify']([[[_0x04e3('0x41'),JSON[_0x04e3('0x42')]([_0x49ddb4,_0x3df7da||'en',![],'null']),null,_0x04e3('0x43')]]]))};return rp(_0x266fcd)[_0x04e3('0x29')](function(_0x488840){try{_0x2a57d4=eval(_0x488840[_0x04e3('0x44')](0x5))[0x0][0x2];}catch(_0x40aeda){throw new Error(_0x04e3('0x45')+_0x488840['data']);}if(!_0x2a57d4){if(_0x49ddb4[_0x04e3('0x46')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error('lang\x20\x22'+_0x3df7da+_0x04e3('0x47'));}}try{_0x2a57d4=eval(_0x2a57d4)[0x0];}catch(_0x53188d){throw new Error('parse\x20response\x20failed:\x0a'+res[_0x04e3('0x1e')]);}const _0x16d6cc=_0x2a57d4;_0x26bafc=path[_0x04e3('0x23')](__dirname,_0x04e3('0x24'),rs['generate'](0x4)+_0x04e3('0x36'));fs['writeFileSync'](_0x26bafc,_0x2a57d4,{'encoding':'base64'});_0xc0f204=path[_0x04e3('0x23')](__dirname,_0x04e3('0x24'),rs[_0x04e3('0x25')](0x4)+_0x04e3('0x26'));return convertFile(_0x26bafc,_0xc0f204);})[_0x04e3('0x29')](function(){try{fs[_0x04e3('0x18')](_0x26bafc);fs[_0x04e3('0x3a')](_0xc0f204,'777');}catch(_0xb51ca8){logger[_0x04e3('0x13')](_0xb51ca8);}logger[_0x04e3('0x3b')](_0x04e3('0x48'),_0xc0f204[_0x04e3('0x2b')]('.')[0x0]);return _0xc0f204[_0x04e3('0x2b')]('.')[0x0];});};exports[_0x04e3('0x49')]=function(_0x4003f8,_0x4ffad0,_0x52469f){return google[_0x04e3('0x4a')](_0x4003f8,_0x4ffad0,_0x52469f)[_0x04e3('0x29')](function(_0x511eca){logger['info'](_0x511eca[_0x04e3('0x4b')]);return rp(_0x511eca);})['then'](function(_0x1a8a29){var _0x1d1c75='';var _0x1fafc1=0x0;try{fs[_0x04e3('0x18')](_0x4003f8);}catch(_0xa69573){logger['error'](_0xa69573);}if(_0x1a8a29&&_0x1a8a29['results']){_0x1d1c75=_0x1a8a29[_0x04e3('0x4c')][_0x04e3('0x4d')](function(_0x2fb51b){return _0x2fb51b&&_0x2fb51b[_0x04e3('0x4e')][0x0]&&_0x2fb51b['alternatives'][0x0][_0x04e3('0x4f')]?_0x2fb51b['alternatives'][0x0][_0x04e3('0x4f')]:'';})['join']('\x0a');_0x1fafc1=_0x1a8a29[_0x04e3('0x4c')][_0x04e3('0x4d')](function(_0x1d51ad){return _0x1d51ad&&_0x1d51ad['alternatives'][0x0]&&_0x1d51ad[_0x04e3('0x4e')][0x0][_0x04e3('0x50')]?_0x1d51ad[_0x04e3('0x4e')][0x0][_0x04e3('0x50')]:0x0;})[_0x04e3('0x51')]('\x0a');}logger[_0x04e3('0x3b')](_0x04e3('0x52'),_0x1d1c75);logger[_0x04e3('0x3b')](_0x04e3('0x53'),_0x1fafc1);return{'transcript':_0x1d1c75,'confidence':_0x1fafc1};})['catch'](function(_0x562bae){logger['error'](_0x04e3('0x54'),_0x562bae[_0x04e3('0x12')],_0x562bae['name'],_0x562bae[_0x04e3('0x55')]);});};exports[_0x04e3('0x56')]=function(_0x424e92,_0xd09185,_0xe3bd9c,_0xa758e3){var _0x295887=apiai(_0xd09185,{'language':_0xa758e3||'en'});return _0x295887[_0x04e3('0x57')](_0xe3bd9c,{'sessionId':md5(_0x424e92)})[_0x04e3('0x29')](function(_0x3bb92c){logger[_0x04e3('0x3b')](JSON[_0x04e3('0x42')](_0x3bb92c));return{'source':_0x3bb92c[_0x04e3('0x58')][_0x04e3('0x59')],'resolvedQuery':_0x3bb92c[_0x04e3('0x58')][_0x04e3('0x5a')],'action':_0x3bb92c[_0x04e3('0x58')][_0x04e3('0x5b')],'actionIncomplete':_0x3bb92c[_0x04e3('0x58')][_0x04e3('0x5c')],'speech':_0x3bb92c[_0x04e3('0x58')][_0x04e3('0x5d')]['speech'],'score':_0x3bb92c['result'][_0x04e3('0x5e')],'statusCode':_0x3bb92c[_0x04e3('0x5f')][_0x04e3('0x60')],'endConversation':_0x3bb92c[_0x04e3('0x58')][_0x04e3('0x61')][_0x04e3('0x62')]||![],'isFallbackIntent':_0x3bb92c[_0x04e3('0x58')][_0x04e3('0x61')]['isFallbackIntent']};});};exports[_0x04e3('0x63')]=function(_0xe4f6f3,_0x230979,_0x43c0d1,_0x1d387a,_0x4c0794,_0x7c2658){var _0x4c91b4=_0x1d387a[_0x04e3('0x64')](/\\n/g,'\x0a');var _0x3058ec={'credentials':{'private_key':_0x4c91b4,'client_email':_0x43c0d1}};var _0x4f7371=new dialogflow[(_0x04e3('0x65'))](_0x3058ec);var _0xd999a=_0x4f7371[_0x04e3('0x66')](_0x230979,md5(_0xe4f6f3));var _0x1a6034={'session':_0xd999a,'queryInput':{'text':{'text':_0x4c0794,'languageCode':_0x7c2658}}};return _0x4f7371[_0x04e3('0x67')](_0x1a6034)[_0x04e3('0x29')](function(_0x352fdc){if(_0x352fdc&&_0x352fdc[_0x04e3('0x46')]){logger[_0x04e3('0x3b')](_0x04e3('0x68'),JSON[_0x04e3('0x42')](_0x352fdc));var _0x358d7b=_0x352fdc[0x0];if(_0x358d7b){var _0x38f8a4={'action':_0x358d7b[_0x04e3('0x69')]['action'],'allRequiredParamsPresent':_0x358d7b[_0x04e3('0x69')][_0x04e3('0x6a')],'endConversation':_0x358d7b[_0x04e3('0x69')][_0x04e3('0x6b')]&&_0x358d7b['queryResult'][_0x04e3('0x6b')]['fields']?_0x358d7b[_0x04e3('0x69')][_0x04e3('0x6b')][_0x04e3('0x6c')]['end_conversation'][_0x04e3('0x6d')]:![],'fulfillmentText':_0x358d7b[_0x04e3('0x69')][_0x04e3('0x6e')],'intentName':_0x358d7b[_0x04e3('0x69')][_0x04e3('0x6f')][_0x04e3('0x70')],'intentDisplayName':_0x358d7b[_0x04e3('0x69')]['intent'][_0x04e3('0x71')],'isFallbackIntent':_0x358d7b[_0x04e3('0x69')][_0x04e3('0x6f')][_0x04e3('0x72')],'languageCode':_0x358d7b[_0x04e3('0x69')][_0x04e3('0x73')],'queryText':_0x358d7b['queryResult'][_0x04e3('0x74')],'responseId':_0x358d7b[_0x04e3('0x75')],'score':_0x358d7b[_0x04e3('0x69')][_0x04e3('0x76')],'speech':_0x358d7b[_0x04e3('0x69')][_0x04e3('0x6e')],'providerResponse':JSON['stringify'](_0x352fdc)};return _0x38f8a4;}}});};exports['tildeASR']=function(_0x45e9f7,_0x1d575d,_0x1b8cfb,_0x1f9317){return tilde[_0x04e3('0x4a')](_0x45e9f7,_0x1d575d,_0x1b8cfb,_0x1f9317)['then'](function(_0x20c2cc){try{fs[_0x04e3('0x18')](_0x45e9f7);}catch(_0x55a3a4){logger[_0x04e3('0x13')](_0x55a3a4);}logger[_0x04e3('0x3b')](_0x04e3('0x77'),_0x20c2cc[_0x04e3('0x4f')]);logger[_0x04e3('0x3b')]('Tilde\x20ASR\x20confidence',_0x20c2cc[_0x04e3('0x50')]);return _0x20c2cc;});};exports['awsPolly']=function(_0xde4235,_0x599d68,_0x506e15,_0x41191a,_0x40a1ec,_0x2ee7f1){var _0xe3f51c=path[_0x04e3('0x23')](__dirname,_0x04e3('0x24'),rs['generate'](0x4)+_0x04e3('0x36'));var _0x3a6472;return aws[_0x04e3('0x78')](_0xde4235,_0x599d68,_0x506e15,_0x41191a,_0x40a1ec,_0x2ee7f1,_0xe3f51c)[_0x04e3('0x29')](function(){_0x3a6472=path['resolve'](__dirname,'tmp',rs[_0x04e3('0x25')](0x4)+_0x04e3('0x26'));return convertFile(_0xe3f51c,_0x3a6472);})[_0x04e3('0x29')](function(){try{fs[_0x04e3('0x18')](_0xe3f51c);fs['chmodSync'](_0x3a6472,'777');}catch(_0x1ae253){logger['error'](_0x1ae253);}return _0x3a6472[_0x04e3('0x2b')]('.')[0x0];});};exports[_0x04e3('0x79')]=function(_0x3bdcd9,_0x2d679d,_0x3a5703,_0x421c23,_0x21b0f0,_0x59c96b){return aws['lex'](_0x3bdcd9,_0x2d679d,_0x3a5703,_0x421c23,_0x21b0f0,_0x59c96b)['then'](function(_0x20583a){logger[_0x04e3('0x3b')](JSON[_0x04e3('0x42')](_0x20583a));return _0x20583a;});};exports[_0x04e3('0x7a')]=function(_0xec6977,_0x4e1924,_0x1d1862,_0x386389){var _0x5a56f3=util[_0x04e3('0x7b')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0xec6977,encodeURIComponent(_0x4e1924),_0x1d1862,_0x386389);var _0x59730b=path['resolve'](__dirname,_0x04e3('0x24'),rs['generate'](0x4)+_0x04e3('0x36'));var _0x588442;return downloadFile(_0x5a56f3,_0x59730b)[_0x04e3('0x29')](function(){_0x588442=path[_0x04e3('0x23')](__dirname,_0x04e3('0x24'),rs[_0x04e3('0x25')](0x4)+_0x04e3('0x26'));return convertFile(_0x59730b,_0x588442);})[_0x04e3('0x29')](function(){try{fs['unlink'](_0x59730b);fs[_0x04e3('0x3a')](_0x588442,_0x04e3('0x2a'));}catch(_0x55e5f8){logger[_0x04e3('0x13')](_0x55e5f8);}return _0x588442[_0x04e3('0x2b')]('.')[0x0];});};exports[_0x04e3('0x7c')]=function(_0x21b72f,_0x3a83cb,_0x51a71d,_0x49e2e5){var _0x19c91b=util['format'](_0x04e3('0x7d'),ISPEECH_API,_0x3a83cb,_0x51a71d,base64Encode(_0x21b72f),_0x49e2e5?util[_0x04e3('0x7b')](_0x04e3('0x7e'),encodeURIComponent(_0x49e2e5)):_0x04e3('0x7f'));return uploadFile(_0x19c91b)[_0x04e3('0x29')](function(_0x6e9c08){return querystring[_0x04e3('0x9')](_0x6e9c08);});};exports[_0x04e3('0x80')]=function(_0x2e95f8,_0x26e686){return sestek['nda'](_0x2e95f8,_0x26e686)['then'](function(_0x11d72b){logger['info'](JSON[_0x04e3('0x42')](_0x11d72b));var _0x2a7d6d={'speech':_0x11d72b['text'],'action':_0x11d72b['channelData']?_0x11d72b[_0x04e3('0x81')]['CustomAction']:undefined,'actiondata':_0x11d72b['channelData']?_0x11d72b['channelData']['CustomActionData']:undefined};if(_0x11d72b['channelData']&&_0x11d72b[_0x04e3('0x81')]['AudioFromTts']){return base64Decode(_0x11d72b['channelData']['AudioFromTts']['Data'],path[_0x04e3('0x23')](__dirname,_0x04e3('0x24'),rs['generate'](0x4)+_0x04e3('0x26')))['then'](function(_0x59921f){_0x2a7d6d[_0x04e3('0x82')]=_0x59921f;return _0x2a7d6d;});}return _0x2a7d6d;});};exports[_0x04e3('0x83')]=function(){return __dirname;}; \ No newline at end of file +var _0xd9b6=['pipe','https:','data','end','transcode','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','base64','777','split','readFileSync','toString','https://texttospeech.googleapis.com/v1/','ssml','input','audioConfig','MP3','POST','then','.mp3','from','audioContent','chmodSync','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','f.req=','stringify','jQ1olc','null','generic','slice','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','goggleTTS\x20path','googleASR','uri','results','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','textRequest','result','source','resolvedQuery','actionIncomplete','fulfillment','speech','score','status','code','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','action','allRequiredParamsPresent','diagnosticInfo','fields','boolValue','fulfillmentText','intent','displayName','isFallback','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','polly','awsLex','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','sestekNDA','text','channelData','CustomActionData','AudioFromTts','audiofile','dirName','bluebird','http','https','md5','path','querystring','sox','url','parse','./sestek','./tilde','https://api.ispeech.org/api/rest','protocol','host','WHAT_EVER','get','error','request\x20to\x20','statusCode','\x20failed,\x20status\x20code\x20=\x20','createWriteStream','finish','info','finish\x20download\x20file','unlink','download\x20error'];(function(_0x56fab4,_0x490f69){var _0x538a70=function(_0x74d36f){while(--_0x74d36f){_0x56fab4['push'](_0x56fab4['shift']());}};_0x538a70(++_0x490f69);}(_0xd9b6,0x16f));var _0x6d9b=function(_0x41e723,_0x5e6494){_0x41e723=_0x41e723-0x0;var _0x5cf973=_0xd9b6[_0x41e723];return _0x5cf973;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0x6d9b('0x0'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0x6d9b('0x1'));var https=require(_0x6d9b('0x2'));var md5=require(_0x6d9b('0x3'));var path=require(_0x6d9b('0x4'));var querystring=require(_0x6d9b('0x5'));var rp=require('request-promise');var rs=require('randomstring');var sox=require(_0x6d9b('0x6'));var tts=require('google-tts-api');var urlParse=require(_0x6d9b('0x7'))[_0x6d9b('0x8')];var util=require('util');var aws=require('./aws');var google=require('./google');var sestek=require(_0x6d9b('0x9'));var tilde=require(_0x6d9b('0xa'));var logger=require('../../../config/logger')('agi');var ISPEECH_API=_0x6d9b('0xb');function downloadFile(_0x39102c,_0x47bc7f){return new BPromise(function(_0x2ccb8d,_0x58c04e){var _0x521eaa=urlParse(_0x39102c);var _0x38bd4b=_0x521eaa[_0x6d9b('0xc')]==='https:'?https:http;var _0x14c7e4={'host':_0x521eaa[_0x6d9b('0xd')],'path':_0x521eaa['path'],'headers':{'user-agent':_0x6d9b('0xe')}};_0x38bd4b[_0x6d9b('0xf')](_0x14c7e4,function(_0x349e76){if(_0x349e76['statusCode']!==0xc8){logger[_0x6d9b('0x10')](_0x6d9b('0x11')+_0x39102c+'\x20failed,\x20status\x20code\x20=\x20'+_0x349e76[_0x6d9b('0x12')]+'\x20('+_0x349e76['statusMessage']+')');_0x58c04e(new Error(_0x6d9b('0x11')+_0x39102c+_0x6d9b('0x13')+_0x349e76[_0x6d9b('0x12')]+'\x20('+_0x349e76['statusMessage']+')'));return;}var _0x3d4d04=fs[_0x6d9b('0x14')](_0x47bc7f);_0x3d4d04['on'](_0x6d9b('0x15'),function(){logger[_0x6d9b('0x16')](_0x6d9b('0x17'));_0x3d4d04['close'](_0x2ccb8d);});_0x3d4d04['on'](_0x6d9b('0x10'),function(_0x2ed450){fs[_0x6d9b('0x18')](_0x47bc7f);logger['error'](_0x6d9b('0x19'),_0x2ed450);_0x58c04e(_0x2ed450);});_0x349e76[_0x6d9b('0x1a')](_0x3d4d04);})['on'](_0x6d9b('0x10'),function(_0x34de1b){logger[_0x6d9b('0x10')](_0x34de1b);_0x58c04e(_0x34de1b);})['end']();});}function uploadFile(_0x26b20c){return new BPromise(function(_0x48cf94,_0x184a1f){var _0x2c44d8=urlParse(_0x26b20c);var _0x377119=_0x2c44d8['protocol']===_0x6d9b('0x1b')?https:http;var _0x41a05d={'host':_0x2c44d8['host'],'path':_0x2c44d8[_0x6d9b('0x4')],'headers':{'user-agent':_0x6d9b('0xe')}};_0x377119['get'](_0x41a05d,function(_0x400f4c){if(_0x400f4c['statusCode']!==0xc8){_0x184a1f(new Error(_0x6d9b('0x11')+_0x26b20c+_0x6d9b('0x13')+_0x400f4c[_0x6d9b('0x12')]+'\x20('+_0x400f4c['statusMessage']+')'));return;}var _0xaa954='';_0x400f4c['on'](_0x6d9b('0x1c'),function(_0x3cb3cd){_0xaa954+=_0x3cb3cd;});_0x400f4c['on'](_0x6d9b('0x1d'),function(){_0x48cf94(_0xaa954);});})['on']('error',function(_0xb071ea){_0x184a1f(_0xb071ea);})['end']();});}function convertFile(_0x283126,_0x4b74c0){return new BPromise(function(_0x453a89,_0x217372){var _0x1feb19=sox[_0x6d9b('0x1e')](_0x283126,_0x4b74c0,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1feb19['on'](_0x6d9b('0x10'),function(_0x30091f){logger[_0x6d9b('0x10')](_0x6d9b('0x1f'),_0x30091f);_0x217372(_0x30091f);});_0x1feb19['on'](_0x6d9b('0x1d'),function(){logger[_0x6d9b('0x16')](_0x6d9b('0x20'));_0x453a89();});_0x1feb19[_0x6d9b('0x21')]();});}function base64Decode(_0xa04a07,_0x47b2f9){var _0x5e0987=path[_0x6d9b('0x22')](__dirname,_0x6d9b('0x23'),rs[_0x6d9b('0x24')](0x4)+_0x6d9b('0x25'));fs[_0x6d9b('0x26')](_0x5e0987,_0xa04a07,_0x6d9b('0x27'));return convertFile(_0x5e0987,_0x47b2f9)['then'](function(){try{fs[_0x6d9b('0x18')](_0x5e0987);fs['chmodSync'](_0x47b2f9,_0x6d9b('0x28'));}catch(_0x140a28){logger[_0x6d9b('0x10')](_0x140a28);}return _0x47b2f9[_0x6d9b('0x29')]('.')[0x0];});}function base64Encode(_0x2f3295){var _0x261d1d=fs[_0x6d9b('0x2a')](_0x2f3295);return new Buffer(_0x261d1d)[_0x6d9b('0x2b')](_0x6d9b('0x27'));}exports['googleCloudTTS']=function(_0x4b5143,_0x15e1e0,_0xc54033,_0x5e273d,_0x205e8b,_0x5dc0dd){var _0x4d2cab,_0x33dd4b;var _0x327256=_0x6d9b('0x2c');var _0x127a76='?key='+_0x4b5143;var _0x4d6ec8={};if(_0x15e1e0===_0x6d9b('0x2d')){_0x4d6ec8['input']={'ssml':_0xc54033};}else{_0x4d6ec8[_0x6d9b('0x2e')]={'text':_0xc54033};};_0x4d6ec8['voice']={'languageCode':_0x5e273d,'ssmlGender':_0x205e8b};_0x4d6ec8[_0x6d9b('0x2f')]={'audioEncoding':_0x6d9b('0x30'),'sampleRateHertz':0x1f40};var _0x4562c4={'url':_0x327256+'text:synthesize'+_0x127a76,'method':_0x6d9b('0x31'),'json':!![],'body':_0x4d6ec8};return rp(_0x4562c4)[_0x6d9b('0x32')](function(_0x2d490e){return new BPromise(function(_0x4178a8,_0x556e1f){_0x4d2cab=path[_0x6d9b('0x22')](__dirname,_0x6d9b('0x23'),rs[_0x6d9b('0x24')](0x4)+_0x6d9b('0x33'));var _0x58891f=Buffer[_0x6d9b('0x34')](_0x2d490e[_0x6d9b('0x35')],_0x6d9b('0x27'));return fs['writeFile'](_0x4d2cab,_0x58891f,function(_0x10c459){_0x556e1f(_0x10c459);},function(_0x1b0498){fs[_0x6d9b('0x36')](_0x4d2cab,'777');_0x4178a8(_0x1b0498);});});})['then'](function(_0x9e32d2){_0x33dd4b=path[_0x6d9b('0x22')](__dirname,_0x6d9b('0x23'),rs['generate'](0x4)+'.wav');return convertFile(_0x4d2cab,_0x33dd4b);})[_0x6d9b('0x32')](function(){try{fs[_0x6d9b('0x18')](_0x4d2cab);fs[_0x6d9b('0x36')](_0x33dd4b,_0x6d9b('0x28'));}catch(_0x1dc81c){logger[_0x6d9b('0x10')](_0x1dc81c);}logger[_0x6d9b('0x16')](_0x6d9b('0x37'),_0x33dd4b[_0x6d9b('0x29')]('.')[0x0]);return _0x33dd4b[_0x6d9b('0x29')]('.')[0x0];});};exports[_0x6d9b('0x38')]=function(_0x260ad4,_0x12aed4){var _0x475428=_0x6d9b('0x39');var _0x390443,_0x316183;var _0x10d18b;var _0x2ed116={'encoding':_0x6d9b('0x3a'),'method':_0x6d9b('0x31'),'timeout':0x2710,'url':_0x475428,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x6d9b('0x3b')+encodeURIComponent(JSON[_0x6d9b('0x3c')]([[[_0x6d9b('0x3d'),JSON['stringify']([_0x260ad4,_0x12aed4||'en',![],_0x6d9b('0x3e')]),null,_0x6d9b('0x3f')]]]))};return rp(_0x2ed116)[_0x6d9b('0x32')](function(_0x1ce39d){try{_0x10d18b=eval(_0x1ce39d[_0x6d9b('0x40')](0x5))[0x0][0x2];}catch(_0x4dd0f2){throw new Error('parse\x20response\x20failed:\x0a'+_0x1ce39d['data']);}if(!_0x10d18b){if(_0x260ad4[_0x6d9b('0x41')]>0xc8){throw new Error(_0x6d9b('0x42'));}else{throw new Error(_0x6d9b('0x43')+_0x12aed4+_0x6d9b('0x44'));}}try{_0x10d18b=eval(_0x10d18b)[0x0];}catch(_0x27eb0d){throw new Error(_0x6d9b('0x45')+res[_0x6d9b('0x1c')]);}const _0x25b013=_0x10d18b;_0x390443=path[_0x6d9b('0x22')](__dirname,'tmp',rs[_0x6d9b('0x24')](0x4)+_0x6d9b('0x33'));fs[_0x6d9b('0x26')](_0x390443,_0x10d18b,{'encoding':_0x6d9b('0x27')});_0x316183=path[_0x6d9b('0x22')](__dirname,_0x6d9b('0x23'),rs[_0x6d9b('0x24')](0x4)+'.wav');return convertFile(_0x390443,_0x316183);})['then'](function(){try{fs['unlink'](_0x390443);fs[_0x6d9b('0x36')](_0x316183,_0x6d9b('0x28'));}catch(_0x5c30df){logger[_0x6d9b('0x10')](_0x5c30df);}logger[_0x6d9b('0x16')](_0x6d9b('0x46'),_0x316183[_0x6d9b('0x29')]('.')[0x0]);return _0x316183[_0x6d9b('0x29')]('.')[0x0];});};exports[_0x6d9b('0x47')]=function(_0x5e9278,_0x43310f,_0x6c9f58){return google['asr'](_0x5e9278,_0x43310f,_0x6c9f58)[_0x6d9b('0x32')](function(_0x290d32){logger[_0x6d9b('0x16')](_0x290d32[_0x6d9b('0x48')]);return rp(_0x290d32);})[_0x6d9b('0x32')](function(_0x5711a6){var _0x564fd9='';var _0x550cf9=0x0;try{fs[_0x6d9b('0x18')](_0x5e9278);}catch(_0x4dbbc2){logger[_0x6d9b('0x10')](_0x4dbbc2);}if(_0x5711a6&&_0x5711a6['results']){_0x564fd9=_0x5711a6[_0x6d9b('0x49')]['map'](function(_0x179780){return _0x179780&&_0x179780[_0x6d9b('0x4a')][0x0]&&_0x179780['alternatives'][0x0]['transcript']?_0x179780[_0x6d9b('0x4a')][0x0][_0x6d9b('0x4b')]:'';})[_0x6d9b('0x4c')]('\x0a');_0x550cf9=_0x5711a6[_0x6d9b('0x49')]['map'](function(_0x31c2b0){return _0x31c2b0&&_0x31c2b0['alternatives'][0x0]&&_0x31c2b0['alternatives'][0x0][_0x6d9b('0x4d')]?_0x31c2b0[_0x6d9b('0x4a')][0x0][_0x6d9b('0x4d')]:0x0;})[_0x6d9b('0x4c')]('\x0a');}logger['info'](_0x6d9b('0x4e'),_0x564fd9);logger['info'](_0x6d9b('0x4f'),_0x550cf9);return{'transcript':_0x564fd9,'confidence':_0x550cf9};})[_0x6d9b('0x50')](function(_0x5acab9){logger['error'](_0x6d9b('0x51'),_0x5acab9['statusCode'],_0x5acab9[_0x6d9b('0x52')],_0x5acab9[_0x6d9b('0x53')]);});};exports['googleDialogflow']=function(_0x1cd65a,_0x37b208,_0x397d28,_0x47d209){var _0x59bc38=apiai(_0x37b208,{'language':_0x47d209||'en'});return _0x59bc38[_0x6d9b('0x54')](_0x397d28,{'sessionId':md5(_0x1cd65a)})[_0x6d9b('0x32')](function(_0x3a741d){logger['info'](JSON[_0x6d9b('0x3c')](_0x3a741d));return{'source':_0x3a741d[_0x6d9b('0x55')][_0x6d9b('0x56')],'resolvedQuery':_0x3a741d[_0x6d9b('0x55')][_0x6d9b('0x57')],'action':_0x3a741d[_0x6d9b('0x55')]['action'],'actionIncomplete':_0x3a741d['result'][_0x6d9b('0x58')],'speech':_0x3a741d[_0x6d9b('0x55')][_0x6d9b('0x59')][_0x6d9b('0x5a')],'score':_0x3a741d['result'][_0x6d9b('0x5b')],'statusCode':_0x3a741d[_0x6d9b('0x5c')][_0x6d9b('0x5d')],'endConversation':_0x3a741d['result']['metadata'][_0x6d9b('0x5e')]||![],'isFallbackIntent':_0x3a741d['result']['metadata'][_0x6d9b('0x5f')]};});};exports[_0x6d9b('0x60')]=function(_0x42da59,_0x4438e0,_0x328ae0,_0x2f5905,_0x54cc9c,_0x13055){var _0x402750=_0x2f5905[_0x6d9b('0x61')](/\\n/g,'\x0a');var _0x5df089={'credentials':{'private_key':_0x402750,'client_email':_0x328ae0}};var _0x218de2=new dialogflow[(_0x6d9b('0x62'))](_0x5df089);var _0x1230e9=_0x218de2[_0x6d9b('0x63')](_0x4438e0,md5(_0x42da59));var _0x990303={'session':_0x1230e9,'queryInput':{'text':{'text':_0x54cc9c,'languageCode':_0x13055}}};return _0x218de2[_0x6d9b('0x64')](_0x990303)[_0x6d9b('0x32')](function(_0x4726b4){if(_0x4726b4&&_0x4726b4[_0x6d9b('0x41')]){logger[_0x6d9b('0x16')](_0x6d9b('0x65'),JSON[_0x6d9b('0x3c')](_0x4726b4));var _0x3253e3=_0x4726b4[0x0];if(_0x3253e3){var _0x4aef1e={'action':_0x3253e3[_0x6d9b('0x66')][_0x6d9b('0x67')],'allRequiredParamsPresent':_0x3253e3[_0x6d9b('0x66')][_0x6d9b('0x68')],'endConversation':_0x3253e3['queryResult'][_0x6d9b('0x69')]&&_0x3253e3['queryResult']['diagnosticInfo'][_0x6d9b('0x6a')]?_0x3253e3[_0x6d9b('0x66')][_0x6d9b('0x69')][_0x6d9b('0x6a')]['end_conversation'][_0x6d9b('0x6b')]:![],'fulfillmentText':_0x3253e3['queryResult'][_0x6d9b('0x6c')],'intentName':_0x3253e3['queryResult'][_0x6d9b('0x6d')][_0x6d9b('0x52')],'intentDisplayName':_0x3253e3[_0x6d9b('0x66')][_0x6d9b('0x6d')][_0x6d9b('0x6e')],'isFallbackIntent':_0x3253e3['queryResult'][_0x6d9b('0x6d')][_0x6d9b('0x6f')],'languageCode':_0x3253e3['queryResult']['languageCode'],'queryText':_0x3253e3['queryResult'][_0x6d9b('0x70')],'responseId':_0x3253e3[_0x6d9b('0x71')],'score':_0x3253e3[_0x6d9b('0x66')][_0x6d9b('0x72')],'speech':_0x3253e3['queryResult'][_0x6d9b('0x6c')],'providerResponse':JSON[_0x6d9b('0x3c')](_0x4726b4)};return _0x4aef1e;}}});};exports[_0x6d9b('0x73')]=function(_0x2e4d10,_0x26a69f,_0x3f6068,_0x54f46c){return tilde['asr'](_0x2e4d10,_0x26a69f,_0x3f6068,_0x54f46c)[_0x6d9b('0x32')](function(_0x3e8dca){try{fs[_0x6d9b('0x18')](_0x2e4d10);}catch(_0xf4926){logger[_0x6d9b('0x10')](_0xf4926);}logger[_0x6d9b('0x16')](_0x6d9b('0x74'),_0x3e8dca['transcript']);logger['info']('Tilde\x20ASR\x20confidence',_0x3e8dca[_0x6d9b('0x4d')]);return _0x3e8dca;});};exports['awsPolly']=function(_0x146768,_0x41290d,_0x21a82c,_0x684c81,_0x8dab91,_0x403d3d){var _0x1b2bda=path['resolve'](__dirname,_0x6d9b('0x23'),rs['generate'](0x4)+'.mp3');var _0x7be3ed;return aws[_0x6d9b('0x75')](_0x146768,_0x41290d,_0x21a82c,_0x684c81,_0x8dab91,_0x403d3d,_0x1b2bda)[_0x6d9b('0x32')](function(){_0x7be3ed=path['resolve'](__dirname,_0x6d9b('0x23'),rs[_0x6d9b('0x24')](0x4)+_0x6d9b('0x25'));return convertFile(_0x1b2bda,_0x7be3ed);})[_0x6d9b('0x32')](function(){try{fs[_0x6d9b('0x18')](_0x1b2bda);fs[_0x6d9b('0x36')](_0x7be3ed,'777');}catch(_0x3c8970){logger[_0x6d9b('0x10')](_0x3c8970);}return _0x7be3ed[_0x6d9b('0x29')]('.')[0x0];});};exports[_0x6d9b('0x76')]=function(_0x143492,_0x47b7b1,_0x636c67,_0x267e2a,_0x3dda8f,_0x373259){return aws['lex'](_0x143492,_0x47b7b1,_0x636c67,_0x267e2a,_0x3dda8f,_0x373259)['then'](function(_0x596d1a){logger[_0x6d9b('0x16')](JSON[_0x6d9b('0x3c')](_0x596d1a));return _0x596d1a;});};exports['ispeechTTS']=function(_0x3d18a0,_0x11c234,_0x76d49a,_0x5b452d){var _0xe2d5e9=util[_0x6d9b('0x77')](_0x6d9b('0x78'),ISPEECH_API,_0x3d18a0,encodeURIComponent(_0x11c234),_0x76d49a,_0x5b452d);var _0x10fecd=path['resolve'](__dirname,_0x6d9b('0x23'),rs[_0x6d9b('0x24')](0x4)+_0x6d9b('0x33'));var _0x22f008;return downloadFile(_0xe2d5e9,_0x10fecd)[_0x6d9b('0x32')](function(){_0x22f008=path['resolve'](__dirname,_0x6d9b('0x23'),rs[_0x6d9b('0x24')](0x4)+_0x6d9b('0x25'));return convertFile(_0x10fecd,_0x22f008);})[_0x6d9b('0x32')](function(){try{fs['unlink'](_0x10fecd);fs[_0x6d9b('0x36')](_0x22f008,_0x6d9b('0x28'));}catch(_0xe6a85a){logger[_0x6d9b('0x10')](_0xe6a85a);}return _0x22f008[_0x6d9b('0x29')]('.')[0x0];});};exports[_0x6d9b('0x79')]=function(_0x5736ac,_0x4b1db3,_0x52e6d8,_0x2b40fc){var _0x98b0cf=util[_0x6d9b('0x77')](_0x6d9b('0x7a'),ISPEECH_API,_0x4b1db3,_0x52e6d8,base64Encode(_0x5736ac),_0x2b40fc?util[_0x6d9b('0x77')](_0x6d9b('0x7b'),encodeURIComponent(_0x2b40fc)):'freeform=3');return uploadFile(_0x98b0cf)[_0x6d9b('0x32')](function(_0x10c482){return querystring[_0x6d9b('0x8')](_0x10c482);});};exports[_0x6d9b('0x7c')]=function(_0x3216a1,_0x1b8fb4){return sestek['nda'](_0x3216a1,_0x1b8fb4)[_0x6d9b('0x32')](function(_0x3ed100){logger['info'](JSON[_0x6d9b('0x3c')](_0x3ed100));var _0xc7f96={'speech':_0x3ed100[_0x6d9b('0x7d')],'action':_0x3ed100[_0x6d9b('0x7e')]?_0x3ed100['channelData']['CustomAction']:undefined,'actiondata':_0x3ed100[_0x6d9b('0x7e')]?_0x3ed100[_0x6d9b('0x7e')][_0x6d9b('0x7f')]:undefined};if(_0x3ed100['channelData']&&_0x3ed100[_0x6d9b('0x7e')][_0x6d9b('0x80')]){return base64Decode(_0x3ed100[_0x6d9b('0x7e')][_0x6d9b('0x80')]['Data'],path[_0x6d9b('0x22')](__dirname,'tmp',rs['generate'](0x4)+_0x6d9b('0x25')))['then'](function(_0x2d0fef){_0xc7f96[_0x6d9b('0x81')]=_0x2d0fef;return _0xc7f96;});}return _0xc7f96;});};exports[_0x6d9b('0x82')]=function(){return __dirname;}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/index.js b/server/services/agi/scripts/sestek/index.js index 8456417..0be2e26 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 _0x0a91=['./nda'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0a91,0xb2));var _0x10a9=function(_0x2d982d,_0x121028){_0x2d982d=_0x2d982d-0x0;var _0x4f36b0=_0x0a91[_0x2d982d];return _0x4f36b0;};var nda=require(_0x10a9('0x0'));module['exports']={'nda':nda}; \ No newline at end of file +var _0x494e=['exports'];(function(_0xa9a245,_0x2a0387){var _0x2d0eaa=function(_0x2bba86){while(--_0x2bba86){_0xa9a245['push'](_0xa9a245['shift']());}};_0x2d0eaa(++_0x2a0387);}(_0x494e,0x104));var _0xe494=function(_0x12a2ec,_0x3c7919){_0x12a2ec=_0x12a2ec-0x0;var _0x45ebaa=_0x494e[_0x12a2ec];return _0x45ebaa;};var nda=require('./nda');module[_0xe494('0x0')]={'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 5d2c61e..1a56ea3 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 _0xb75c=['../../../../../config/logger','exports','POST','ndauth_url','username','password','then','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','message','uniqueid','calleridname','extension','text','Bearer\x20','access_token','body','channelData','ProjectName','project','ndagenerate_audio','AudioOutputSettings','custom_action','custom_action_data','CustomActionData','info','request-promise','url'];(function(_0x19dd7a,_0x51de21){var _0x3feb6a=function(_0x4a3c84){while(--_0x4a3c84){_0x19dd7a['push'](_0x19dd7a['shift']());}};_0x3feb6a(++_0x51de21);}(_0xb75c,0x1ce));var _0xcb75=function(_0x23b5e0,_0x278bb5){_0x23b5e0=_0x23b5e0-0x0;var _0x5a347a=_0xb75c[_0x23b5e0];return _0x5a347a;};'use strict';var rp=require(_0xcb75('0x0'));var url=require(_0xcb75('0x1'));var logger=require(_0xcb75('0x2'))('agi');module[_0xcb75('0x3')]=function(_0x4da54f,_0x21a350){var _0x12aaaa={'method':_0xcb75('0x4'),'uri':url['resolve'](_0x21a350[_0xcb75('0x5')],'/token'),'form':{'grant_type':'password','username':_0x21a350[_0xcb75('0x6')],'password':_0x21a350[_0xcb75('0x7')]},'json':!![]};return rp(_0x12aaaa)[_0xcb75('0x8')](function(_0x498656){var _0x57ef56={'method':'POST','uri':url[_0xcb75('0x9')](_0x21a350[_0xcb75('0xa')],_0xcb75('0xb')),'body':{'type':_0x21a350['ndaactivity_type']||_0xcb75('0xc'),'channelId':'Nda','conversation':{'id':_0x4da54f[_0xcb75('0xd')]},'from':{'id':_0x4da54f['callerid'],'name':_0x4da54f[_0xcb75('0xe')]},'recipient':{'id':_0x4da54f['dnid'],'name':_0x4da54f[_0xcb75('0xf')]},'text':_0x21a350[_0xcb75('0x10')],'channelData':{}},'headers':{'Authorization':_0xcb75('0x11')+_0x498656[_0xcb75('0x12')]},'json':!![]};if(_0x21a350['project']){_0x57ef56[_0xcb75('0x13')][_0xcb75('0x14')][_0xcb75('0x15')]=_0x21a350[_0xcb75('0x16')];}if(_0x21a350[_0xcb75('0x17')]=='1'){_0x57ef56[_0xcb75('0x13')][_0xcb75('0x14')][_0xcb75('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x21a350['custom_action']){_0x57ef56[_0xcb75('0x13')][_0xcb75('0x14')]['CustomAction']=_0x21a350[_0xcb75('0x19')];if(_0x21a350[_0xcb75('0x1a')]){_0x57ef56['body'][_0xcb75('0x14')][_0xcb75('0x1b')]=_0x21a350[_0xcb75('0x1a')];}}logger[_0xcb75('0x1c')](JSON['stringify'](_0x57ef56));return rp(_0x57ef56);});}; \ No newline at end of file +var _0x9990=['AudioOutputSettings','audio/wav','CustomAction','custom_action','custom_action_data','info','url','../../../../../config/logger','agi','exports','POST','ndauth_url','/token','password','then','resolve','ndassistant_url','ndaactivity_type','message','Nda','callerid','calleridname','dnid','text','access_token','project','body','channelData','ProjectName','ndagenerate_audio'];(function(_0xfae546,_0x30bc17){var _0xc7220d=function(_0x5858f4){while(--_0x5858f4){_0xfae546['push'](_0xfae546['shift']());}};_0xc7220d(++_0x30bc17);}(_0x9990,0xf6));var _0x0999=function(_0x515da8,_0x3b69d2){_0x515da8=_0x515da8-0x0;var _0x10da36=_0x9990[_0x515da8];return _0x10da36;};'use strict';var rp=require('request-promise');var url=require(_0x0999('0x0'));var logger=require(_0x0999('0x1'))(_0x0999('0x2'));module[_0x0999('0x3')]=function(_0x33d7a5,_0x43f491){var _0x1fd95b={'method':_0x0999('0x4'),'uri':url['resolve'](_0x43f491[_0x0999('0x5')],_0x0999('0x6')),'form':{'grant_type':_0x0999('0x7'),'username':_0x43f491['username'],'password':_0x43f491[_0x0999('0x7')]},'json':!![]};return rp(_0x1fd95b)[_0x0999('0x8')](function(_0x3fe805){var _0x304f75={'method':_0x0999('0x4'),'uri':url[_0x0999('0x9')](_0x43f491[_0x0999('0xa')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x43f491[_0x0999('0xb')]||_0x0999('0xc'),'channelId':_0x0999('0xd'),'conversation':{'id':_0x33d7a5['uniqueid']},'from':{'id':_0x33d7a5[_0x0999('0xe')],'name':_0x33d7a5[_0x0999('0xf')]},'recipient':{'id':_0x33d7a5[_0x0999('0x10')],'name':_0x33d7a5['extension']},'text':_0x43f491[_0x0999('0x11')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x3fe805[_0x0999('0x12')]},'json':!![]};if(_0x43f491[_0x0999('0x13')]){_0x304f75[_0x0999('0x14')][_0x0999('0x15')][_0x0999('0x16')]=_0x43f491['project'];}if(_0x43f491[_0x0999('0x17')]=='1'){_0x304f75[_0x0999('0x14')][_0x0999('0x15')][_0x0999('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x0999('0x19')};}if(_0x43f491['custom_action']){_0x304f75[_0x0999('0x14')][_0x0999('0x15')][_0x0999('0x1a')]=_0x43f491[_0x0999('0x1b')];if(_0x43f491[_0x0999('0x1c')]){_0x304f75[_0x0999('0x14')][_0x0999('0x15')]['CustomActionData']=_0x43f491[_0x0999('0x1c')];}}logger[_0x0999('0x1d')](JSON['stringify'](_0x304f75));return rp(_0x304f75);});}; \ 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 9d1837c..9f545ec 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 _0x6521=['./lib/api'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x6521,0x8d));var _0x1652=function(_0x39efbf,_0x118364){_0x39efbf=_0x39efbf-0x0;var _0xcbd510=_0x6521[_0x39efbf];return _0xcbd510;};'use strict';var asr=require(_0x1652('0x0'));module['exports']=function(_0x220e41,_0x338b58,_0x41bfa8,_0x2eccce){return asr(_0x220e41,_0x338b58,_0x41bfa8,_0x2eccce);}; \ No newline at end of file +var _0x0a9f=['exports'];(function(_0x5a7e91,_0x4a2ec3){var _0x2aab91=function(_0x44a00f){while(--_0x44a00f){_0x5a7e91['push'](_0x5a7e91['shift']());}};_0x2aab91(++_0x4a2ec3);}(_0x0a9f,0x162));var _0xf0a9=function(_0x42e1ec,_0x19aacc){_0x42e1ec=_0x42e1ec-0x0;var _0xe8c124=_0x0a9f[_0x42e1ec];return _0xe8c124;};'use strict';var asr=require('./lib/api');module[_0xf0a9('0x0')]=function(_0x149366,_0x363245,_0x4e803a,_0x5a6c64){return asr(_0x149366,_0x363245,_0x4e803a,_0x5a6c64);}; \ 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 9ca0738..566affc 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 _0xd86d=['close','error','Tilde\x20ASR\x20send\x20error','terminate','status','result','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','open','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','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','sha1','digest','unix','send','stringify','createReadStream','data'];(function(_0x2d79fe,_0x33dcb0){var _0x666ce4=function(_0x442d94){while(--_0x442d94){_0x2d79fe['push'](_0x2d79fe['shift']());}};_0x666ce4(++_0x33dcb0);}(_0xd86d,0xf7));var _0xdd86=function(_0x58e3de,_0x40f92c){_0x58e3de=_0x58e3de-0x0;var _0x2c0fd2=_0xd86d[_0x58e3de];return _0x2c0fd2;};'use strict';var BPromise=require(_0xdd86('0x0'));var _=require(_0xdd86('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xdd86('0x2'));var crypto=require(_0xdd86('0x3'));var logger=require(_0xdd86('0x4'))(_0xdd86('0x5'));module[_0xdd86('0x6')]=function(_0x3bc547,_0x4f9d92,_0x3aaa03,_0x51c3ce){return new BPromise(function(_0x4ebf30,_0x41b2a2){logger[_0xdd86('0x7')](_0xdd86('0x8'),_0x51c3ce||_0xdd86('0x9'));var _0x3c8059=new WebSocket(_0x51c3ce||_0xdd86('0x9'),{'perMessageDeflate':![]});var _0x3ed49e='';var _0x20bafe='0';var _0x2a8f24='1';var _0x52b342=_0xdd86('0xa');function _0x1543e6(_0x1fdce9){var _0x48d025=crypto[_0xdd86('0xb')](_0xdd86('0xc'));_0x48d025['update'](_0x1fdce9);return _0x48d025[_0xdd86('0xd')]('hex');}function _0xafbfed(){try{logger['info']('Open\x20Tilde\x20ASR\x20socket');var _0x1274e2=moment()[_0xdd86('0xe')]();var _0x187697=_0x1543e6(_0x1274e2+_0x4f9d92+_0x3aaa03);_0x3c8059[_0xdd86('0xf')](JSON[_0xdd86('0x10')]({'appID':_0x4f9d92,'timestamp':_0x1274e2,'appKey':_0x187697}));var _0x20c51b=fs[_0xdd86('0x11')](_0x3bc547);_0x20c51b['on'](_0xdd86('0x12'),function(_0x30175e){_0x3c8059[_0xdd86('0xf')](_0x30175e);});_0x20c51b['on'](_0xdd86('0x13'),function(){_0x3c8059[_0xdd86('0xf')]('EOS');});}catch(_0x586a63){logger[_0xdd86('0x14')](_0xdd86('0x15'),JSON[_0xdd86('0x10')](_0x586a63));_0x3c8059[_0xdd86('0x16')]();}}function _0x2a85fb(_0xfa10e){try{if(_0xfa10e){var _0x49f4ce=JSON['parse'](_0xfa10e);switch(_0x49f4ce[_0xdd86('0x17')]){case 0x0:if(_0x49f4ce[_0xdd86('0x18')]){if(_0x49f4ce[_0xdd86('0x18')]['final']){logger['info'](_0xdd86('0x19'),JSON['stringify'](_0x49f4ce[_0xdd86('0x18')][_0xdd86('0x1a')]));_0x3ed49e=_0x49f4ce[_0xdd86('0x18')]['hypotheses'][0x0][_0xdd86('0x1b')];_0x20bafe=_0x49f4ce[_0xdd86('0x18')][_0xdd86('0x1a')][0x0][_0xdd86('0x1c')];_0x2a8f24='0';_0x52b342=_0xdd86('0x1d');_0x3c8059['terminate']();}}break;case 0x1:logger['info'](_0xdd86('0xa'));_0x2a8f24='1';_0x52b342=_0xdd86('0xa');break;case 0x2:logger[_0xdd86('0x7')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x2a8f24='2';_0x52b342='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger['info'](_0xdd86('0x1e'));_0x2a8f24='9';_0x52b342=_0xdd86('0x1e');break;case 0xa:logger[_0xdd86('0x7')](_0xdd86('0x1f'));_0x2a8f24='10';_0x52b342=_0xdd86('0x1f');break;case 0xb:logger[_0xdd86('0x7')](_0xdd86('0x20'));_0x2a8f24='11';_0x52b342=_0xdd86('0x20');}}}catch(_0x5bf688){logger[_0xdd86('0x14')](_0xdd86('0x21'),JSON[_0xdd86('0x10')](_0x5bf688));_0x3c8059[_0xdd86('0x16')]();}}function _0x276428(){logger[_0xdd86('0x7')](_0xdd86('0x22'));_0x4ebf30({'transcript':_0x3ed49e,'confidence':_0x20bafe,'status':_0x2a8f24,'status_message':_0x52b342});}function _0x1546f4(_0x5a3465){logger[_0xdd86('0x14')](_0xdd86('0x23'));if(!_[_0xdd86('0x24')](_0x5a3465)){logger['error'](_['isObject'](_0x5a3465)?JSON[_0xdd86('0x10')](_0x5a3465):_0x5a3465);}}_0x3c8059['on'](_0xdd86('0x25'),_0xafbfed);_0x3c8059['on']('message',_0x2a85fb);_0x3c8059['on'](_0xdd86('0x13'),_0x276428);_0x3c8059['on'](_0xdd86('0x14'),_0x1546f4);});}; \ No newline at end of file +var _0x6e8b=['wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','EOS','Tilde\x20ASR\x20send\x20error','terminate','status','result','final','Tilde\x20ASR\x20hypoteses','transcript','hypotheses','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','isObject','open','close','bluebird','lodash','crypto','agi','exports','info','Tilde\x20URI'];(function(_0x5cd23e,_0x20777b){var _0x216550=function(_0x2935bb){while(--_0x2935bb){_0x5cd23e['push'](_0x5cd23e['shift']());}};_0x216550(++_0x20777b);}(_0x6e8b,0x9d));var _0xb6e8=function(_0x218994,_0x2cf487){_0x218994=_0x218994-0x0;var _0x3f350b=_0x6e8b[_0x218994];return _0x3f350b;};'use strict';var BPromise=require(_0xb6e8('0x0'));var _=require(_0xb6e8('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0xb6e8('0x2'));var logger=require('../../../../../../config/logger')(_0xb6e8('0x3'));module[_0xb6e8('0x4')]=function(_0xb06f34,_0x45e7e5,_0x112a1e,_0x267306){return new BPromise(function(_0x357720,_0x498125){logger[_0xb6e8('0x5')](_0xb6e8('0x6'),_0x267306||_0xb6e8('0x7'));var _0x199281=new WebSocket(_0x267306||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x539887='';var _0x16c412='0';var _0x10e58b='1';var _0x5b6dac=_0xb6e8('0x8');function _0x48f4cc(_0xa5cf53){var _0x36cb0d=crypto[_0xb6e8('0x9')](_0xb6e8('0xa'));_0x36cb0d[_0xb6e8('0xb')](_0xa5cf53);return _0x36cb0d[_0xb6e8('0xc')](_0xb6e8('0xd'));}function _0x232850(){try{logger[_0xb6e8('0x5')](_0xb6e8('0xe'));var _0x1cb083=moment()[_0xb6e8('0xf')]();var _0x3255d4=_0x48f4cc(_0x1cb083+_0x45e7e5+_0x112a1e);_0x199281[_0xb6e8('0x10')](JSON[_0xb6e8('0x11')]({'appID':_0x45e7e5,'timestamp':_0x1cb083,'appKey':_0x3255d4}));var _0x1af493=fs[_0xb6e8('0x12')](_0xb06f34);_0x1af493['on'](_0xb6e8('0x13'),function(_0x11351c){_0x199281[_0xb6e8('0x10')](_0x11351c);});_0x1af493['on']('close',function(){_0x199281[_0xb6e8('0x10')](_0xb6e8('0x14'));});}catch(_0x538197){logger['error'](_0xb6e8('0x15'),JSON[_0xb6e8('0x11')](_0x538197));_0x199281[_0xb6e8('0x16')]();}}function _0x5260dc(_0x5638d4){try{if(_0x5638d4){var _0x386e54=JSON['parse'](_0x5638d4);switch(_0x386e54[_0xb6e8('0x17')]){case 0x0:if(_0x386e54['result']){if(_0x386e54[_0xb6e8('0x18')][_0xb6e8('0x19')]){logger[_0xb6e8('0x5')](_0xb6e8('0x1a'),JSON[_0xb6e8('0x11')](_0x386e54[_0xb6e8('0x18')]['hypotheses']));_0x539887=_0x386e54[_0xb6e8('0x18')]['hypotheses'][0x0][_0xb6e8('0x1b')];_0x16c412=_0x386e54[_0xb6e8('0x18')][_0xb6e8('0x1c')][0x0][_0xb6e8('0x1d')];_0x10e58b='0';_0x5b6dac=_0xb6e8('0x1e');_0x199281[_0xb6e8('0x16')]();}}break;case 0x1:logger[_0xb6e8('0x5')](_0xb6e8('0x8'));_0x10e58b='1';_0x5b6dac=_0xb6e8('0x8');break;case 0x2:logger['info'](_0xb6e8('0x1f'));_0x10e58b='2';_0x5b6dac=_0xb6e8('0x1f');break;case 0x9:logger[_0xb6e8('0x5')](_0xb6e8('0x20'));_0x10e58b='9';_0x5b6dac=_0xb6e8('0x20');break;case 0xa:logger[_0xb6e8('0x5')](_0xb6e8('0x21'));_0x10e58b='10';_0x5b6dac='Authentication\x20failed.';break;case 0xb:logger[_0xb6e8('0x5')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x10e58b='11';_0x5b6dac=_0xb6e8('0x22');}}}catch(_0x347e69){logger[_0xb6e8('0x23')](_0xb6e8('0x24'),JSON['stringify'](_0x347e69));_0x199281[_0xb6e8('0x16')]();}}function _0x2cef32(){logger['info'](_0xb6e8('0x25'));_0x357720({'transcript':_0x539887,'confidence':_0x16c412,'status':_0x10e58b,'status_message':_0x5b6dac});}function _0x3d7510(_0x2a1cee){logger[_0xb6e8('0x23')]('Error\x20Tilde\x20ASR\x20socket');if(!_['isNil'](_0x2a1cee)){logger[_0xb6e8('0x23')](_[_0xb6e8('0x26')](_0x2a1cee)?JSON[_0xb6e8('0x11')](_0x2a1cee):_0x2a1cee);}}_0x199281['on'](_0xb6e8('0x27'),_0x232850);_0x199281['on']('message',_0x5260dc);_0x199281['on'](_0xb6e8('0x28'),_0x2cef32);_0x199281['on'](_0xb6e8('0x23'),_0x3d7510);});}; \ 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 5e29f5e..8a9095f 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 _0x8611=['exports','./asr'];(function(_0x1aa3fe,_0x27c5fa){var _0x163cee=function(_0x2a1505){while(--_0x2a1505){_0x1aa3fe['push'](_0x1aa3fe['shift']());}};_0x163cee(++_0x27c5fa);}(_0x8611,0x12b));var _0x1861=function(_0x2d1736,_0x1efc37){_0x2d1736=_0x2d1736-0x0;var _0x15714b=_0x8611[_0x2d1736];return _0x15714b;};var asr=require(_0x1861('0x0'));module[_0x1861('0x1')]={'asr':asr}; \ No newline at end of file +var _0x3098=['./asr'];(function(_0x122240,_0x3610d9){var _0x454446=function(_0x28d5bf){while(--_0x28d5bf){_0x122240['push'](_0x122240['shift']());}};_0x454446(++_0x3610d9);}(_0x3098,0x160));var _0x8309=function(_0x50f392,_0x1d8441){_0x50f392=_0x50f392-0x0;var _0x5926f2=_0x3098[_0x50f392];return _0x5926f2;};var asr=require(_0x8309('0x0'));module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index bfb3d4d..f9f78c3 100644 --- a/server/services/agi/server.js +++ b/server/services/agi/server.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','inherits','exports','util','net','events','EventEmitter','./channel','call','emit','error'];(function(_0x2e5a67,_0x37dadb){var _0x1f37b9=function(_0x47a076){while(--_0x47a076){_0x2e5a67['push'](_0x2e5a67['shift']());}};_0x1f37b9(++_0x37dadb);}(_0x34e8,0x12c));var _0x834e=function(_0x262c0d,_0x2ec705){_0x262c0d=_0x262c0d-0x0;var _0x29bc2e=_0x34e8[_0x262c0d];return _0x29bc2e;};'use strict';var util=require(_0x834e('0x0'));var net=require(_0x834e('0x1'));var EventEmitter=require(_0x834e('0x2'))[_0x834e('0x3')];var AGIError=require('./error');var AGIChannel=require(_0x834e('0x4'));var AGIServer=function(_0x21e2e0,_0x472111,_0x31bf20){var _0x289ef2=this;var _0x19a3e0=null;var _0x398bee=0x0;if(!_0x21e2e0)_0x21e2e0=0x11dd;if(!_0x472111)_0x472111='127.0.0.1';EventEmitter[_0x834e('0x5')](_0x289ef2);function _0x52056d(){if(!_0x21e2e0){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0x8')));return![];}_0x19a3e0=net[_0x834e('0x9')]();_0x19a3e0[_0x834e('0xa')](_0x21e2e0,_0x472111);_0x19a3e0['on'](_0x834e('0xb'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xb'));});_0x19a3e0['on'](_0x834e('0xc'),function(_0x186b3b){_0x19a3e0[_0x834e('0xd')](function(_0x36e124,_0x14038b){if(_0x36e124){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x36e124));}else if(_0x31bf20&&_0x31bf20<0x0){_0x289ef2[_0x834e('0x6')]('error',new AGIError(_0x834e('0xf')));_0x186b3b[_0x834e('0x10')]();}else if(_0x31bf20&&_0x31bf20>0x0&&_0x31bf20<_0x14038b){_0x398bee+=0x1;_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0x11'),_0x398bee));_0x186b3b[_0x834e('0x10')]();}else{var _0x21cc0a=new AGIChannel(_0x186b3b);_0x21cc0a['on']('ready',function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xc'),_0x21cc0a);});}});});_0x19a3e0['on']('error',function(_0x316205){_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x316205['code']));});_0x19a3e0['on'](_0x834e('0x12'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0x12'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x834e('0x13')](function(){_0x52056d();});};util[_0x834e('0x14')](AGIServer,EventEmitter);module[_0x834e('0x15')]=function(_0xb993a1,_0x237947,_0x254677){return new AGIServer(_0xb993a1,_0x237947,_0x254677);}; \ No newline at end of file +var _0xe706=['connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','exports','util','net','events','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening'];(function(_0x131585,_0x1abd33){var _0x1fcca2=function(_0x8f165b){while(--_0x8f165b){_0x131585['push'](_0x131585['shift']());}};_0x1fcca2(++_0x1abd33);}(_0xe706,0xa3));var _0x6e70=function(_0x109669,_0x1b4895){_0x109669=_0x109669-0x0;var _0x4dd5a7=_0xe706[_0x109669];return _0x4dd5a7;};'use strict';var util=require(_0x6e70('0x0'));var net=require(_0x6e70('0x1'));var EventEmitter=require(_0x6e70('0x2'))['EventEmitter'];var AGIError=require(_0x6e70('0x3'));var AGIChannel=require(_0x6e70('0x4'));var AGIServer=function(_0x2ca810,_0x7dfbc3,_0x142c27){var _0x2164a4=this;var _0x376a8d=null;var _0x506db9=0x0;if(!_0x2ca810)_0x2ca810=0x11dd;if(!_0x7dfbc3)_0x7dfbc3=_0x6e70('0x5');EventEmitter[_0x6e70('0x6')](_0x2164a4);function _0x36357b(){if(!_0x2ca810){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x9')));return![];}_0x376a8d=net[_0x6e70('0xa')]();_0x376a8d[_0x6e70('0xb')](_0x2ca810,_0x7dfbc3);_0x376a8d['on'](_0x6e70('0xc'),function(){_0x2164a4[_0x6e70('0x7')](_0x6e70('0xc'));});_0x376a8d['on'](_0x6e70('0xd'),function(_0x743eb5){_0x376a8d[_0x6e70('0xe')](function(_0x37b3e0,_0x4600f9){if(_0x37b3e0){_0x2164a4['emit']('error',new AGIError(_0x6e70('0xf'),_0x37b3e0));}else if(_0x142c27&&_0x142c27<0x0){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x10')));_0x743eb5[_0x6e70('0x11')]();}else if(_0x142c27&&_0x142c27>0x0&&_0x142c27<_0x4600f9){_0x506db9+=0x1;_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x12'),_0x506db9));_0x743eb5['destroy']();}else{var _0x52737e=new AGIChannel(_0x743eb5);_0x52737e['on']('ready',function(){_0x2164a4[_0x6e70('0x7')]('connection',_0x52737e);});}});});_0x376a8d['on']('error',function(_0x304716){_0x2164a4[_0x6e70('0x7')]('error',new AGIError(_0x6e70('0xf'),_0x304716['code']));});_0x376a8d['on'](_0x6e70('0x13'),function(){_0x2164a4[_0x6e70('0x7')]('close',new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x6e70('0x14')](function(){_0x36357b();});};util['inherits'](AGIServer,EventEmitter);module[_0x6e70('0x15')]=function(_0x173afe,_0x53acdc,_0x497d61){return new AGIServer(_0x173afe,_0x53acdc,_0x497d61);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index c1f68ae..98e5d76 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 _0x0fda=['arg_1','createSquareRecording','callerid','calleridname','extension','priority','accountcode','createSquareMessage','createCmContact','isNil','callback_','random','isEmpty','lastName','scheduledAt','callback','toString','getPause','getPauseById','agentPause','agentUnpause','agent','agentLogout','internal','LOCAL','agentLogin','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','MALE','audioEncoding','googleTTS','google_tts_language','restAPI','url','method','timeout','number','includes','POST','PUT','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','client_email','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','model','awsPolly','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_access_key_id','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','hasOwnProperty','isString','replaceObjectAllVariables','recursiveNodeIndex','length','saveRestApiResult','isPlainObject','%s.%s','isArray','setVariable','replaceAllVariables','split','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','isConfigured','maxRetry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','MRCPSynth','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','agi','Enter\x20in\x20AGI\x20(%s)\x20block','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','no\x20list\x20selected','add','delay','minutes','callback_priority','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','no\x20odbc\x20database\x20found','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','forEach','%s[%s][%s]','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','no\x20key\x20configured','no\x20text\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','speech','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','private_key','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','out','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','username','no\x20username\x20configured','password','ndassistant_url','Trying\x20SestekNDA:\x20%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','trunk_name','SIP/%s/%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','getData','response','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','recordFile','intKey','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appsecret\x20configured','NOBEEP','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','context','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','interval_id','no\x20interval\x20configured','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','no\x20find\x20by\x20configured','math','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','math\x20%s','operation','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','getSound','indexOf','QUEUE','gosub','Enter\x20in\x20RECORD\x20(%s)\x20block','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','no\x20mail\x20account\x20configured','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','template_id','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','getSmsAccount','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','no\x20variable\x20selected','variable_value','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','XMCS-UNIQUEID','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','command','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','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/logger','./scripts','rawBody','menu','getdigits','getsecretdigits','channel','rpc','prototype','getVariable','getVariableById','then','name','getVoiceQueue','getVoiceQueueById','catch','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getSoundPath','getMailAccount','getMailAccountById','getIntervals','getIntervalById','IntervalId','map','format','getQueryOdbc','open','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand'];(function(_0x45bc76,_0x22a744){var _0x22eae3=function(_0x156a6d){while(--_0x156a6d){_0x45bc76['push'](_0x45bc76['shift']());}};_0x22eae3(++_0x22a744);}(_0x0fda,0x1a0));var _0xa0fd=function(_0x127495,_0x124924){_0x127495=_0x127495-0x0;var _0x224caa=_0x0fda[_0x127495];return _0x224caa;};'use strict';var fs=require('fs');var util=require(_0xa0fd('0x0'));var _=require('lodash');var sh=require(_0xa0fd('0x1'));var odbc=require(_0xa0fd('0x2'))();var rs=require(_0xa0fd('0x3'));var moment=require(_0xa0fd('0x4'));var Mustache=require(_0xa0fd('0x5'));var rp=require(_0xa0fd('0x6'));var logger=require(_0xa0fd('0x7'))('agi');var config=require('../../config/environment');var scripts=require(_0xa0fd('0x8'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=['rawHeaders',_0xa0fd('0x9')];var verticesWithRetry=[_0xa0fd('0xa'),_0xa0fd('0xb'),_0xa0fd('0xc')];var AGIVertices=function(_0x5d996b,_0x29da4c,_0xe93771){this[_0xa0fd('0xd')]=_0x5d996b;this[_0xa0fd('0xe')]=_0x29da4c;this['mailRpc']=_0xe93771;};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0x10')]=function(_0x36634c,_0x5c1786){this[_0xa0fd('0xe')][_0xa0fd('0x11')](_0x36634c)[_0xa0fd('0x12')](function(_0x2af372){_0x5c1786(null,_0x2af372?_0x2af372[_0xa0fd('0x13')]:![]);})['catch'](function(_0x490112){_0x5c1786(_0x490112);});};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0x14')]=function(_0x5a7274,_0x21acc2){this[_0xa0fd('0xe')][_0xa0fd('0x15')](_0x5a7274)[_0xa0fd('0x12')](function(_0x2b0993){_0x21acc2(null,_0x2b0993?_0x2b0993[_0xa0fd('0x13')]:![]);})[_0xa0fd('0x16')](function(_0x4fe62c){_0x21acc2(_0x4fe62c);});};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0x17')]=function(_0x5605ae,_0x50aa6d){this[_0xa0fd('0xe')][_0xa0fd('0x18')](_0x5605ae)['then'](function(_0x2b8d15){_0x50aa6d(null,_0x2b8d15?_0x2b8d15[_0xa0fd('0x13')]:![]);})[_0xa0fd('0x16')](function(_0x5073a8){_0x50aa6d(_0x5073a8);});};AGIVertices['prototype'][_0xa0fd('0x19')]=function(_0x558109,_0x40e288){this[_0xa0fd('0xe')][_0xa0fd('0x1a')](_0x558109)[_0xa0fd('0x12')](function(_0x263591){_0x40e288(null,_0x263591?_0x263591[_0xa0fd('0x1b')]:![]);})[_0xa0fd('0x16')](function(_0x515b0d){_0x40e288(_0x515b0d);});};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0x1c')]=function(_0x701d7,_0x18eaa8){this[_0xa0fd('0xe')][_0xa0fd('0x1d')](_0x701d7)[_0xa0fd('0x12')](function(_0x411205){_0x18eaa8(null,_0x411205?_0x411205[_0xa0fd('0x13')]:![]);})[_0xa0fd('0x16')](function(_0x28dbda){_0x18eaa8(_0x28dbda);});};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0x1e')]=function(_0x54cacc,_0x37177b){this[_0xa0fd('0xe')]['getTrunkById'](_0x54cacc)[_0xa0fd('0x12')](function(_0x3cd5b0){_0x37177b(null,_0x3cd5b0?_0x3cd5b0['name']:![]);})['catch'](function(_0x2e9b0d){_0x37177b(_0x2e9b0d);});};AGIVertices[_0xa0fd('0xf')]['getSound']=function(_0x5c70fb,_0x5b50c0){var _0x58b786=this;this[_0xa0fd('0xe')]['getSoundById'](_0x5c70fb)[_0xa0fd('0x12')](function(_0x1db300){_0x5b50c0(null,_0x1db300?_0x58b786[_0xa0fd('0x1f')](_0x1db300['save_name']):![]);})[_0xa0fd('0x16')](function(_0x19c352){_0x5b50c0(_0x19c352);});};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0x20')]=function(_0x26e39c,_0x58ddb3){this[_0xa0fd('0xe')][_0xa0fd('0x21')](_0x26e39c)[_0xa0fd('0x12')](function(_0x2993aa){_0x58ddb3(null,_0x2993aa?_0x2993aa:![]);})['catch'](function(_0x33785f){_0x58ddb3(_0x33785f);});};AGIVertices[_0xa0fd('0xf')]['sendMailMessage']=function(_0x4fddf9,_0x581071,_0x1fc249){this['mailRpc']['sendMailMessage'](_0x4fddf9,_0x581071)[_0xa0fd('0x12')](function(){_0x1fc249(null);})['catch'](function(_0xbaa5d2){_0x1fc249(_0xbaa5d2);});};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0x22')]=function(_0x2081dc,_0x1f6e72){this[_0xa0fd('0xe')][_0xa0fd('0x23')](_0x2081dc)[_0xa0fd('0x12')](function(_0x4ce77f){if(_0x4ce77f){if(_0x4ce77f[_0xa0fd('0x24')]){_0x1f6e72(null,[_0x4ce77f['interval']]);}else{_0x1f6e72(null,_[_0xa0fd('0x25')](_0x4ce77f['Intervals'],'interval'));}}else{_0x1f6e72(null,![]);}})[_0xa0fd('0x16')](function(_0x4bcec1){_0x1f6e72(_0x4bcec1);});};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0x1f')]=function(_0x431d31){return util[_0xa0fd('0x26')]('%s/sounds/converted/%s',FILES_PATH,_0x431d31);};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0x27')]=function(_0x3b06ef,_0x3f6146,_0x2e3cfa){odbc[_0xa0fd('0x28')](_0x3b06ef,function(_0x41feca){if(_0x41feca){logger['error']('Error\x20getting\x20ODBC\x20connection\x20%s',_0x41feca);_0x2e3cfa(_0x41feca);}else{logger[_0xa0fd('0x29')](_0xa0fd('0x2a'));odbc[_0xa0fd('0x2b')](_0x3f6146,function(_0x155f5,_0x5e1a77){if(_0x155f5){logger[_0xa0fd('0x29')](_0xa0fd('0x2c'),_0x3f6146);_0x2e3cfa(_0x155f5);}else{logger[_0xa0fd('0x29')](_0xa0fd('0x2d'),_0x3f6146);odbc[_0xa0fd('0x2e')](function(_0x5d5fdd){if(_0x5d5fdd){logger[_0xa0fd('0x2f')](_0xa0fd('0x30'),_0x5d5fdd);}_0x2e3cfa(null,_0x5e1a77);});}});}});};AGIVertices['prototype']['getSmsAccount']=function(_0x27082a,_0x163023){this[_0xa0fd('0xe')][_0xa0fd('0x31')](_0x27082a)[_0xa0fd('0x12')](function(_0xbeca16){_0x163023(null,_0xbeca16?_0xbeca16:![]);})[_0xa0fd('0x16')](function(_0xc147b5){_0x163023(_0xc147b5);});};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0x32')]=function(_0x12d66a,_0x1c9bba){this[_0xa0fd('0xe')][_0xa0fd('0x32')](_0x12d66a)[_0xa0fd('0x12')](function(_0x515449){_0x1c9bba(null,_0x515449);})['catch'](function(_0x4dd042){_0x1c9bba(_0x4dd042);});};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0x33')]=function(_0x399eb1,_0x54fb8c,_0x428255){this[_0xa0fd('0xe')][_0xa0fd('0x33')]({'uniqueid':this['channel'][_0xa0fd('0x34')],'node':_0x399eb1[_0xa0fd('0x35')],'application':_0x399eb1[_0xa0fd('0x36')],'data':_0x54fb8c||null,'project_name':this[_0xa0fd('0xd')][_0xa0fd('0x37')],'callerid':this[_0xa0fd('0xd')]['callerid']})[_0xa0fd('0x12')](function(_0x2b58a0){if(_0x428255){_0x428255(null,_0x2b58a0);}})[_0xa0fd('0x16')](function(_0x2498da){if(_0x428255){_0x428255(_0x2498da);}});};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0x38')]=function(_0x56cfca,_0x2ccdf7,_0x781be5,_0xf1c674){this[_0xa0fd('0xe')][_0xa0fd('0x38')]({'uniqueid':this['channel']['uniqueid'],'callerid':this[_0xa0fd('0xd')][_0xa0fd('0x39')],'calleridname':this[_0xa0fd('0xd')][_0xa0fd('0x3a')],'context':this[_0xa0fd('0xd')]['context'],'extension':this[_0xa0fd('0xd')][_0xa0fd('0x3b')],'priority':this[_0xa0fd('0xd')][_0xa0fd('0x3c')],'accountcode':this[_0xa0fd('0xd')][_0xa0fd('0x3d')],'dnid':this['channel']['dnid'],'projectName':this['channel'][_0xa0fd('0x37')],'saveName':_0x2ccdf7,'filename':_0x56cfca['file']||_0x2ccdf7,'savePath':_0x781be5})['then'](function(_0xcf725e){_0xf1c674(null,_0xcf725e);})['catch'](function(_0x357324){_0xf1c674(_0x357324);});};AGIVertices[_0xa0fd('0xf')]['createSquareMessage']=function(_0x4abff8,_0x213e67,_0x38a66b,_0x42376a,_0x167503){this[_0xa0fd('0xe')][_0xa0fd('0x3e')]({'uniqueid':this['channel']['uniqueid'],'body':_0x4abff8,'direction':_0x213e67,'providerName':_0x38a66b,'providerResponse':_0x42376a})['then'](function(_0x59742b){if(_0x167503){_0x167503(null,_0x59742b);}})[_0xa0fd('0x16')](function(_0x43fc4a){if(_0x167503){_0x167503(_0x43fc4a);}});};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0x3f')]=function(_0x32d251,_0x53c1a2){this['rpc']['createCmContact']({'firstName':_['isEmpty'](_0x32d251['name'])||_[_0xa0fd('0x40')](_0x32d251[_0xa0fd('0x13')])?_0xa0fd('0x41')+Math[_0xa0fd('0x42')]():_0x32d251[_0xa0fd('0x13')],'lastName':_[_0xa0fd('0x43')](_0x32d251[_0xa0fd('0x44')])||_[_0xa0fd('0x40')](_0x32d251[_0xa0fd('0x44')])?null:_0x32d251[_0xa0fd('0x44')],'phone':_0x32d251['phone'],'ListId':_0x32d251['list_id'],'scheduledat':_0x32d251[_0xa0fd('0x45')],'callbackUniqueid':this[_0xa0fd('0xd')][_0xa0fd('0x34')],'tags':_0xa0fd('0x46'),'description':'Callback\x20scheduled\x20at\x20'+_0x32d251[_0xa0fd('0x45')][_0xa0fd('0x47')](),'priority':_0x32d251['callback_priority']})[_0xa0fd('0x12')](function(_0x4a662a){_0x53c1a2(null,_0x4a662a);})[_0xa0fd('0x16')](function(_0x39578a){_0x53c1a2(_0x39578a);});};AGIVertices['prototype'][_0xa0fd('0x48')]=function(_0x2d658e,_0x10d3c3){this[_0xa0fd('0xe')][_0xa0fd('0x49')](_0x2d658e)[_0xa0fd('0x12')](function(_0x47675b){_0x10d3c3(null,_0x47675b?_0x47675b[_0xa0fd('0x13')]:![]);})['catch'](function(_0x201fd5){_0x10d3c3(_0x201fd5);});};AGIVertices['prototype'][_0xa0fd('0x4a')]=function(_0x4205ac,_0x2e3344,_0x1483d5){var _0xa37ca9={'role':'agent'};_0xa37ca9[_0x4205ac]=this[_0xa0fd('0xd')][_0xa0fd('0x39')];this['rpc'][_0xa0fd('0x4a')](_0xa37ca9,_0x2e3344,this[_0xa0fd('0xd')][_0xa0fd('0x34')])['then'](function(_0x44083d){_0x1483d5(null,_['isNil'](_0x44083d)?![]:!![]);})[_0xa0fd('0x16')](function(_0x5e720f){logger[_0xa0fd('0x2f')](_0x5e720f);_0x1483d5(null,![]);});};AGIVertices['prototype'][_0xa0fd('0x4b')]=function(_0x62c3e7,_0x3f9d1e){var _0x981780={'role':_0xa0fd('0x4c')};_0x981780[_0x62c3e7]=this[_0xa0fd('0xd')][_0xa0fd('0x39')];this['rpc'][_0xa0fd('0x4b')](_0x981780)[_0xa0fd('0x12')](function(_0x221c5b){_0x3f9d1e(null,_[_0xa0fd('0x40')](_0x221c5b)?![]:!![]);})[_0xa0fd('0x16')](function(_0x587adf){logger['error'](_0x587adf);_0x3f9d1e(null,![]);});};AGIVertices['prototype'][_0xa0fd('0x4d')]=function(_0x5e3b77,_0x420d66){var _0x589433={'role':_0xa0fd('0x4c')};_0x589433[_0x5e3b77]=this[_0xa0fd('0xd')][_0xa0fd('0x39')];this[_0xa0fd('0xe')][_0xa0fd('0x4d')](_0x589433)[_0xa0fd('0x12')](function(_0x471a34){_0x420d66(null,_[_0xa0fd('0x40')](_0x471a34)?![]:!![]);})[_0xa0fd('0x16')](function(_0x39b8e8){logger[_0xa0fd('0x2f')](_0x39b8e8);_0x420d66(null,![]);});};AGIVertices[_0xa0fd('0xf')]['agentLogin']=function(_0x5366d0,_0x385b00){var _0x1169a0={'role':_0xa0fd('0x4c')};_0x1169a0[_0x5366d0]=this[_0xa0fd('0xd')][_0xa0fd('0x39')];var _0x40186a=_0x5366d0!=_0xa0fd('0x4e')?util[_0xa0fd('0x26')]('%s/%s@from-sip/n',_0xa0fd('0x4f'),this[_0xa0fd('0xd')][_0xa0fd('0x39')]):undefined;this[_0xa0fd('0xe')][_0xa0fd('0x50')](_0x1169a0,_0x40186a)[_0xa0fd('0x12')](function(_0x45f7df){_0x385b00(null,_[_0xa0fd('0x40')](_0x45f7df)?![]:!![]);})[_0xa0fd('0x16')](function(_0x1bc5db){logger[_0xa0fd('0x2f')](_0x1bc5db);_0x385b00(null,![]);});};AGIVertices[_0xa0fd('0xf')]['shellCommand']=function(_0x436f4f,_0x3cd5a5){sh[_0xa0fd('0x51')](_[_0xa0fd('0x52')](_0x436f4f),function(_0x4147b4,_0x1c73ca){var _0x2d70a7=_0x1c73ca[_0xa0fd('0x53')](/(\r\n|\n|\r)/gm,'');_0x3cd5a5(null,_0x2d70a7);});};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0x54')]=function(_0x4d97eb,_0x174f31){scripts[_0xa0fd('0x54')](_0x4d97eb[_0xa0fd('0x55')],_0x4d97eb[_0xa0fd('0x56')]||_0xa0fd('0x57'),_0x4d97eb[_0xa0fd('0x57')],_0x4d97eb[_0xa0fd('0x58')]||_0xa0fd('0x59'),_0x4d97eb['ssmlGender']||_0xa0fd('0x5a'),_0x4d97eb[_0xa0fd('0x5b')]||'MP3')[_0xa0fd('0x12')](function(_0x1b9799){_0x174f31(null,_0x1b9799);})[_0xa0fd('0x16')](function(_0x62efea){_0x174f31(_0x62efea);});};AGIVertices[_0xa0fd('0xf')]['googleTTS']=function(_0xb6fed,_0x306ca1){scripts[_0xa0fd('0x5c')](_0xb6fed[_0xa0fd('0x57')],_0xb6fed[_0xa0fd('0x5d')]||'en',0x1)[_0xa0fd('0x12')](function(_0x34ae5a){_0x306ca1(null,_0x34ae5a);})[_0xa0fd('0x16')](function(_0xaaeabf){_0x306ca1(_0xaaeabf);});};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0x5e')]=function(_0x245012,_0x36452c){var _0x7d5b1d={'uri':_0x245012[_0xa0fd('0x5f')],'method':_0x245012[_0xa0fd('0x60')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x245012[_0xa0fd('0x61')])===_0xa0fd('0x62')&&parseInt(_0x245012[_0xa0fd('0x61')])>=0x1?parseInt(_0x245012['timeout'])*0x3e8:0x5*0x3e8};if(_[_0xa0fd('0x63')]([_0xa0fd('0x64'),_0xa0fd('0x65')],_0x7d5b1d[_0xa0fd('0x60')]['toUpperCase']())){try{_0x7d5b1d[_0xa0fd('0x66')]=_0x245012[_0xa0fd('0x9')]?JSON[_0xa0fd('0x67')](_0x245012[_0xa0fd('0x9')]):{};}catch(_0xc2f803){logger['error'](_0xa0fd('0x68'),_0xc2f803);}}try{_0x7d5b1d[_0xa0fd('0x69')]=_0x245012['rawHeaders']?JSON['parse'](_0x245012[_0xa0fd('0x6a')]):{};}catch(_0x5aa5eb){logger['error'](_0xa0fd('0x6b'),_0x5aa5eb);}if(_0x245012[_0xa0fd('0x6c')]){try{var _0x576c79=require(_0x245012[_0xa0fd('0x6c')])[_0xa0fd('0x6d')](this,_0x7d5b1d);_0x7d5b1d[_0xa0fd('0x6e')]=Mustache[_0xa0fd('0x6f')](_0x245012[_0xa0fd('0x5f')],_0x576c79,{},['$$','$$']);if(_0x7d5b1d['headers']){_0x7d5b1d[_0xa0fd('0x69')]=JSON[_0xa0fd('0x67')](Mustache['render'](JSON[_0xa0fd('0x70')](_0x7d5b1d[_0xa0fd('0x69')]),_0x576c79,{},['$$','$$']));}if(_0x7d5b1d[_0xa0fd('0x66')]){_0x7d5b1d['body']=JSON[_0xa0fd('0x67')](Mustache['render'](JSON[_0xa0fd('0x70')](_0x7d5b1d[_0xa0fd('0x66')]),_0x576c79,{},['$$','$$']));}}catch(_0xe9600b){logger[_0xa0fd('0x2f')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0xe9600b);}}rp(_0x7d5b1d)[_0xa0fd('0x12')](function(_0x2d8792){var _0x438fc3={'statusCode':_0x2d8792[_0xa0fd('0x71')]||0xc8,'statusMessage':_0x2d8792[_0xa0fd('0x72')]||'OK','headers':_0x2d8792[_0xa0fd('0x69')]||{},'body':_0x2d8792['body']||{}};_0x36452c(null,_0x438fc3);})[_0xa0fd('0x16')](function(_0x33c39f){var _0x2a32d5={'statusCode':_0x33c39f[_0xa0fd('0x71')]||0x1f4,'statusMessage':_0x33c39f[_0xa0fd('0x73')]||_0xa0fd('0x74'),'headers':_0x33c39f['options']['headers']||{},'body':_0x33c39f[_0xa0fd('0x75')][_0xa0fd('0x66')]||{}};_0x36452c(null,_0x2a32d5);});};AGIVertices['prototype'][_0xa0fd('0x76')]=function(_0x42a27d,_0x1bdcb){scripts[_0xa0fd('0x76')](this[_0xa0fd('0xd')][_0xa0fd('0x34')],_0x42a27d[_0xa0fd('0x77')],_0x42a27d[_0xa0fd('0x57')],_0x42a27d[_0xa0fd('0x78')]||'en')['then'](function(_0x2f8807){_0x1bdcb(null,_0x2f8807);})[_0xa0fd('0x16')](function(_0x379af6){_0x1bdcb(_0x379af6);});};AGIVertices['prototype'][_0xa0fd('0x79')]=function(_0x23e557,_0x4c3da0){scripts['googleDialogflowV2'](this[_0xa0fd('0xd')][_0xa0fd('0x34')],_0x23e557[_0xa0fd('0x7a')],_0x23e557[_0xa0fd('0x7b')],_0x23e557['private_key'],_0x23e557['text'],_0x23e557[_0xa0fd('0x7c')]||'en')[_0xa0fd('0x12')](function(_0x316177){_0x4c3da0(null,_0x316177);})[_0xa0fd('0x16')](function(_0x31cf5e){_0x4c3da0(_0x31cf5e);});};AGIVertices['prototype']['sestekNDA']=function(_0x2b3963,_0x1e9404){scripts[_0xa0fd('0x7d')](this[_0xa0fd('0xd')],_0x2b3963)[_0xa0fd('0x12')](function(_0x3daa8f){_0x1e9404(null,_0x3daa8f);})[_0xa0fd('0x16')](function(_0x392700){_0x1e9404(_0x392700);});};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0x7e')]=function(_0x369fa2,_0x227b1b){scripts[_0xa0fd('0x7e')](_0x369fa2[_0xa0fd('0x77')],_0x369fa2['text'],_0x369fa2[_0xa0fd('0x7f')]||_0xa0fd('0x59'),_0x369fa2[_0xa0fd('0x80')])[_0xa0fd('0x12')](function(_0x5706c5){_0x227b1b(null,_0x5706c5);})['catch'](function(_0x785ba5){_0x227b1b(_0x785ba5);});};AGIVertices['prototype'][_0xa0fd('0x81')]=function(_0x18c33e,_0x11eef0,_0x18046f){scripts['ispeechASR'](_0x11eef0,_0x18c33e['key'],_0x18c33e['ispeech_asr_language']||'en-US',this['isConfigured'](_0x18c33e['model'])?_0x18c33e[_0xa0fd('0x82')]:undefined)[_0xa0fd('0x12')](function(_0xabf058){_0x18046f(null,_0xabf058);})['catch'](function(_0x3b22d1){_0x18046f(_0x3b22d1);});};AGIVertices['prototype'][_0xa0fd('0x83')]=function(_0x47115d,_0xc12eb7){scripts[_0xa0fd('0x83')](_0x47115d['aws_access_key_id'],_0x47115d[_0xa0fd('0x84')],_0x47115d[_0xa0fd('0x85')],_0x47115d[_0xa0fd('0x86')]||_0xa0fd('0x87'),_0x47115d[_0xa0fd('0x57')],_0x47115d[_0xa0fd('0x88')]||'text')[_0xa0fd('0x12')](function(_0x2e4ec0){_0xc12eb7(null,_0x2e4ec0);})[_0xa0fd('0x16')](function(_0x33cfc6){_0xc12eb7(_0x33cfc6);});};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0x89')]=function(_0x2d46f2,_0x2276f5){scripts['awsLex'](this[_0xa0fd('0xd')]['uniqueid'],_0x2d46f2[_0xa0fd('0x8a')],_0x2d46f2[_0xa0fd('0x84')],_0x2d46f2[_0xa0fd('0x8b')],_0x2d46f2['text'],_0x2d46f2[_0xa0fd('0x8c')])[_0xa0fd('0x12')](function(_0x3cee7a){_0x2276f5(null,_0x3cee7a);})[_0xa0fd('0x16')](function(_0x598374){_0x2276f5(_0x598374);});};AGIVertices['prototype'][_0xa0fd('0x8d')]=function(_0x50503e,_0xc54804,_0x3f7ce0){scripts[_0xa0fd('0x8d')](_0xc54804,_0x50503e['key'],_0x50503e[_0xa0fd('0x8e')]||_0xa0fd('0x59'))['then'](function(_0x333844){_0x3f7ce0(null,_0x333844);})['catch'](function(_0x58614d){_0x3f7ce0(_0x58614d);});};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0x8f')]=function(_0x2438a0,_0x4dcb19,_0x2fb169){scripts['tildeASR'](_0x4dcb19,_0x2438a0[_0xa0fd('0x90')],_0x2438a0[_0xa0fd('0x91')],_0x2438a0[_0xa0fd('0x6e')])[_0xa0fd('0x12')](function(_0x342216){_0x2fb169(null,_0x342216);})['catch'](function(_0xb491e6){_0x2fb169(_0xb491e6);});};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0x92')]=function(_0x2f712f){var _0x3f630a=_[_0xa0fd('0x63')](verticesWithRetry,_0x2f712f[_0xa0fd('0x36')])?_0x2f712f:_['clone'](_0x2f712f);for(var _0xc9573f in _0x3f630a){if(_0x3f630a[_0xa0fd('0x93')](_0xc9573f)){if(_0x3f630a[_0xc9573f]&&_[_0xa0fd('0x94')](_0x3f630a[_0xc9573f])){if(_[_0xa0fd('0x63')](recursiveMapAttributes,_0xc9573f)){_0x3f630a[_0xc9573f]=this[_0xa0fd('0x95')](_0x3f630a[_0xc9573f]);}else{_0x3f630a[_0xc9573f]=this['replaceAllVariables'](_0x3f630a[_0xc9573f]);}}}}return _0x3f630a;};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0x96')]=function(_0x14ea72){for(var _0x2c7bdf in _0x14ea72){if(_0x14ea72['hasOwnProperty'](_0x2c7bdf)){if(_['isPlainObject'](_0x14ea72[_0x2c7bdf])){this[_0xa0fd('0x96')](_0x14ea72[_0x2c7bdf]);}else if(_['isArray'](_0x14ea72[_0x2c7bdf])){for(var _0x345ed6=0x0;_0x345ed6<_0x14ea72[_0x2c7bdf][_0xa0fd('0x97')];_0x345ed6++){this['recursiveNodeIndex'](_0x14ea72[_0x2c7bdf][_0x345ed6]);}}else if(_[_0xa0fd('0x94')](_0x14ea72[_0x2c7bdf])){_0x14ea72[_0x2c7bdf]=this['replaceAllVariables'](_0x14ea72[_0x2c7bdf]);}}}};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0x98')]=function(_0x4e335c,_0x545f2f){for(var _0x108fa0 in _0x4e335c){if(_0x4e335c['hasOwnProperty'](_0x108fa0)){if(_[_0xa0fd('0x99')](_0x4e335c[_0x108fa0])){if(!_['isEmpty'](_0x4e335c[_0x108fa0])){this[_0xa0fd('0x98')](_0x4e335c[_0x108fa0],util['format'](_0xa0fd('0x9a'),_0x545f2f,_0x108fa0));}}else if(_[_0xa0fd('0x9b')](_0x4e335c[_0x108fa0])){for(var _0x2ca1c9=0x0;_0x2ca1c9<_0x4e335c[_0x108fa0][_0xa0fd('0x97')];_0x2ca1c9++){this['saveRestApiResult'](_0x4e335c[_0x108fa0][_0x2ca1c9],util[_0xa0fd('0x26')](_0xa0fd('0x9a'),_0x545f2f,_0x108fa0+'['+_0x2ca1c9+']'));}}else{if(!_['isNil'](_0x4e335c[_0x108fa0])){this[_0xa0fd('0xd')][_0xa0fd('0x9c')](util['format'](_0xa0fd('0x9a'),_0x545f2f,_0x108fa0),_0x4e335c[_0x108fa0]);}}}}};AGIVertices[_0xa0fd('0xf')]['replaceObjectAllVariables']=function(_0x7ba27f){try{var _0x384c86=JSON[_0xa0fd('0x67')](_0x7ba27f);this[_0xa0fd('0x96')](_0x384c86);return JSON[_0xa0fd('0x70')](_0x384c86);}catch(_0xf65b43){return this[_0xa0fd('0x9d')](_0x7ba27f);}};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0x9d')]=function(_0x4875de){var _0x197a0e=_0x4875de[_0xa0fd('0x9e')]('{');for(var _0x4a7beb=0x1;_0x4a7beb<_0x197a0e['length'];_0x4a7beb+=0x1){var _0x45861e=_0x197a0e[_0x4a7beb][_0xa0fd('0x9e')]('}');if(_0x45861e[_0xa0fd('0x97')]>0x1){_0x4875de=_0x4875de[_0xa0fd('0x9f')]('{'+_0x45861e[0x0]+'}',this[_0xa0fd('0xd')]['getVariable'](_0x45861e[0x0])[_0xa0fd('0xa0')]||_0x45861e[0x0]);}}if(_0x197a0e[_0xa0fd('0x97')]===0x1){return _0x4875de[_0xa0fd('0x47')]();}return this['replaceAllVariables'](_0x4875de);};AGIVertices['prototype'][_0xa0fd('0xa1')]=function(_0x4418c5,_0x1b0de8){var _0x7698a0=this[_0xa0fd('0xd')]['getVariable'](_0x4418c5);if(_0x7698a0[_0xa0fd('0xa2')]===-0x1){return _0x7698a0;}logger[_0xa0fd('0x29')](util[_0xa0fd('0x26')](_0xa0fd('0xa3'),_0x1b0de8,_0x7698a0[_0xa0fd('0xa0')]));return this[_0xa0fd('0xd')]['setVariable'](_0x1b0de8,_0x7698a0[_0xa0fd('0xa0')]);};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0xa4')]=function(_0x3f6f09){return _0x3f6f09&&_0x3f6f09!=='0'&&_0x3f6f09!=='-1'&&_0x3f6f09!=='';};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0xa5')]=function(_0x294b03){this['createSquareDetailsReport'][_0xa0fd('0x6d')](this,_0x294b03,'-');_0x294b03['retry']=_0x294b03['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices['prototype']['mrcpsynth']=function(_0x54b24f){logger['info'](util[_0xa0fd('0x26')](_0xa0fd('0xa6'),_0x54b24f['label']));if(!this[_0xa0fd('0xa4')](_0x54b24f[_0xa0fd('0x57')])){return this[_0xa0fd('0xd')][_0xa0fd('0xa7')]('no\x20text\x20configured');}var _0xbbbadb='\x22'+_0x54b24f[_0xa0fd('0x57')]+'\x22';if(this[_0xa0fd('0xa4')](_0x54b24f[_0xa0fd('0x75')])){_0xbbbadb+=','+_0x54b24f[_0xa0fd('0x75')];}var _0x239982=this['channel'][_0xa0fd('0x51')](_0xa0fd('0xa8'),_0xbbbadb);if(_0x239982[_0xa0fd('0xa2')]===-0x1){return _0x239982;}return this[_0xa0fd('0xd')][_0xa0fd('0xa7')](util[_0xa0fd('0x26')]('Executed\x20command\x20MRCPSynth\x20%s',_0xbbbadb));};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0xa9')]=function(_0x4bbe91){logger[_0xa0fd('0x29')](util['format'](_0xa0fd('0xaa'),_0x4bbe91['label']));if(!this['isConfigured'](_0x4bbe91[_0xa0fd('0xab')])){return this[_0xa0fd('0xd')][_0xa0fd('0xa7')](_0xa0fd('0xac'));}var _0x22619c=_0x4bbe91[_0xa0fd('0xab')];if(this[_0xa0fd('0xa4')](_0x4bbe91['options'])){_0x22619c+=','+_0x4bbe91[_0xa0fd('0x75')];}var _0x5d87ad=this[_0xa0fd('0xd')]['exec'](_0xa0fd('0xad'),_0x22619c);if(_0x5d87ad[_0xa0fd('0xa2')]===-0x1){return _0x5d87ad;}var _0x2a15f2=this[_0xa0fd('0xa1')](_0xa0fd('0xae'),'MRCP_RECOG_CONFIDENCE');if(_0x2a15f2[_0xa0fd('0xa2')]===-0x1){return _0x2a15f2;}var _0x5d847d=this[_0xa0fd('0xa1')]('RECOG_INPUT()',_0xa0fd('0xaf'));if(_0x5d847d['result']===-0x1){return _0x5d847d;}var _0x269b52=this['getAndSetVariable'](_0xa0fd('0xb0'),'MRCP_RECOG_INSTANCE');if(_0x269b52[_0xa0fd('0xa2')]===-0x1){return _0x269b52;}return this['channel']['noop'](util[_0xa0fd('0x26')](_0xa0fd('0xb1'),_0x22619c));};AGIVertices['prototype'][_0xa0fd('0xb2')]=function(_0x585bc9){logger['info'](util['format'](_0xa0fd('0xb3'),_0x585bc9['label']));return this['channel'][_0xa0fd('0xb2')]([_0x585bc9['command'],_0x585bc9[_0xa0fd('0xb4')]]);};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0xb5')]=function(_0x575f53){logger[_0xa0fd('0x29')](util[_0xa0fd('0x26')](_0xa0fd('0xb6'),_0x575f53[_0xa0fd('0x35')]));if(this[_0xa0fd('0xa4')](_0x575f53[_0xa0fd('0x61')])){logger[_0xa0fd('0x29')](util[_0xa0fd('0x26')](_0xa0fd('0xb7'),_0x575f53[_0xa0fd('0x61')]));var _0x52e4c8=this[_0xa0fd('0xd')][_0xa0fd('0xb8')](_0x575f53[_0xa0fd('0x61')]);if(_0x52e4c8['result']===-0x1){return _0x52e4c8;}}return this[_0xa0fd('0xd')]['answer']();};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0x46')]=function(_0x333c83){logger[_0xa0fd('0x29')](util['format'](_0xa0fd('0xb9'),_0x333c83[_0xa0fd('0x35')]));if(!this[_0xa0fd('0xa4')](_0x333c83[_0xa0fd('0xba')])){return this['channel'][_0xa0fd('0x2f')](_0x333c83,_0xa0fd('0xbb'));}_0x333c83[_0xa0fd('0x45')]=moment();if(this['isConfigured'](_0x333c83['delay'])){_0x333c83[_0xa0fd('0x45')]=moment()[_0xa0fd('0xbc')](_0x333c83[_0xa0fd('0xbd')],_0xa0fd('0xbe'));}if(!this[_0xa0fd('0xa4')](_0x333c83[_0xa0fd('0xbf')])){_0x333c83[_0xa0fd('0xbf')]=0x2;}this[_0xa0fd('0x3f')][_0xa0fd('0x6d')](this,_0x333c83);return this[_0xa0fd('0xd')][_0xa0fd('0xa7')](util[_0xa0fd('0x26')](_0xa0fd('0xc0'),_0x333c83[_0xa0fd('0xc1')],_0x333c83['list_id'],_0x333c83[_0xa0fd('0x45')]));};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0xc2')]=function(_0x45e291){logger[_0xa0fd('0x29')](util['format'](_0xa0fd('0xc3'),_0x45e291[_0xa0fd('0x35')]));var _0x2b6d98=this[_0xa0fd('0xd')][_0xa0fd('0x51')](_0x45e291[_0xa0fd('0xc4')],_0x45e291[_0xa0fd('0x75')]);if(_0x2b6d98[_0xa0fd('0xa2')]===-0x1){return _0x2b6d98;}return this[_0xa0fd('0xd')][_0xa0fd('0xa7')](util[_0xa0fd('0x26')](_0xa0fd('0xc5'),_0x45e291[_0xa0fd('0xc4')],_0x45e291[_0xa0fd('0x75')]));};AGIVertices[_0xa0fd('0xf')]['lumenvoxtts']=function(_0x4a8690){logger[_0xa0fd('0x29')](util[_0xa0fd('0x26')](_0xa0fd('0xc6'),_0x4a8690['label']));if(!this['isConfigured'](_0x4a8690['text'])){return this[_0xa0fd('0xd')][_0xa0fd('0xa7')]('no\x20text\x20configured');}var _0x3e028e='\x22'+_0x4a8690[_0xa0fd('0x57')]+'\x22';if(this[_0xa0fd('0xa4')](_0x4a8690[_0xa0fd('0x75')])){_0x3e028e+=','+_0x4a8690[_0xa0fd('0x75')];}var _0xd6ecdd=this[_0xa0fd('0xd')][_0xa0fd('0x51')](_0xa0fd('0xa8'),_0x3e028e);if(_0xd6ecdd[_0xa0fd('0xa2')]===-0x1){return _0xd6ecdd;}return this[_0xa0fd('0xd')][_0xa0fd('0xa7')](util['format'](_0xa0fd('0xc7'),_0x3e028e));};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0xc8')]=function(_0x827eed){logger[_0xa0fd('0x29')](util[_0xa0fd('0x26')](_0xa0fd('0xc9'),_0x827eed[_0xa0fd('0x35')]));if(!this[_0xa0fd('0xa4')](_0x827eed[_0xa0fd('0x57')])){return this['channel'][_0xa0fd('0xa7')]('no\x20text\x20configured');}var _0x582997='\x22'+_0x827eed['text']+'\x22';if(this[_0xa0fd('0xa4')](_0x827eed[_0xa0fd('0x75')])){_0x582997+=','+_0x827eed[_0xa0fd('0x75')];}var _0x51ec05=this['channel'][_0xa0fd('0x51')](_0xa0fd('0xa8'),_0x582997);if(_0x51ec05[_0xa0fd('0xa2')]===-0x1){return _0x51ec05;}return this['channel'][_0xa0fd('0xa7')](util[_0xa0fd('0x26')](_0xa0fd('0xc7'),_0x582997));};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0xca')]=function(_0x3077ff){logger[_0xa0fd('0x29')](util['format']('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x3077ff[_0xa0fd('0x35')]));if(!this[_0xa0fd('0xa4')](_0x3077ff[_0xa0fd('0xab')])){return this['channel']['noop']('no\x20grammar\x20configured');}var _0x2ddfa6=_0x3077ff['grammar'];if(this[_0xa0fd('0xa4')](_0x3077ff[_0xa0fd('0x75')])){_0x2ddfa6+=','+_0x3077ff['options'];}var _0x2a5d54=this[_0xa0fd('0xd')][_0xa0fd('0x51')](_0xa0fd('0xad'),_0x2ddfa6);if(_0x2a5d54[_0xa0fd('0xa2')]===-0x1){return _0x2a5d54;}var _0x483258=this[_0xa0fd('0xa1')](_0xa0fd('0xae'),_0xa0fd('0xcb'));if(_0x483258[_0xa0fd('0xa2')]===-0x1){return _0x483258;}var _0x5251be=this[_0xa0fd('0xa1')](_0xa0fd('0xcc'),_0xa0fd('0xcd'));if(_0x5251be[_0xa0fd('0xa2')]===-0x1){return _0x5251be;}var _0x2cbf51=this[_0xa0fd('0xa1')]('RECOG_INSTANCE()',_0xa0fd('0xce'));if(_0x2cbf51[_0xa0fd('0xa2')]===-0x1){return _0x2cbf51;}return this['channel'][_0xa0fd('0xa7')](util['format'](_0xa0fd('0xb1'),_0x2ddfa6));};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0xcf')]=function(_0x43324d){logger['info'](util[_0xa0fd('0x26')](_0xa0fd('0xd0'),_0x43324d[_0xa0fd('0x35')]));if(!this[_0xa0fd('0xa4')](_0x43324d['grammar'])){return this['channel'][_0xa0fd('0xa7')]('no\x20grammar\x20configured');}var _0x69ebb3=_0x43324d[_0xa0fd('0xab')];if(this[_0xa0fd('0xa4')](_0x43324d[_0xa0fd('0x75')])){_0x69ebb3+=','+_0x43324d[_0xa0fd('0x75')];}var _0x389ce9=this[_0xa0fd('0xd')]['exec'](_0xa0fd('0xad'),_0x69ebb3);if(_0x389ce9[_0xa0fd('0xa2')]===-0x1){return _0x389ce9;}var _0x43d934=this[_0xa0fd('0xa1')]('RECOG_CONFIDENCE()',_0xa0fd('0xd1'));if(_0x43d934[_0xa0fd('0xa2')]===-0x1){return _0x43d934;}var _0x13e0fd=this[_0xa0fd('0xa1')](_0xa0fd('0xcc'),_0xa0fd('0xd2'));if(_0x13e0fd[_0xa0fd('0xa2')]===-0x1){return _0x13e0fd;}var _0x39c4c4=this['getAndSetVariable'](_0xa0fd('0xb0'),_0xa0fd('0xd3'));if(_0x39c4c4[_0xa0fd('0xa2')]===-0x1){return _0x39c4c4;}return this[_0xa0fd('0xd')][_0xa0fd('0xa7')](util['format'](_0xa0fd('0xb1'),_0x69ebb3));};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0xd4')]=function(_0x5bbfb9){logger['info'](util['format'](_0xa0fd('0xd5'),_0x5bbfb9[_0xa0fd('0x35')]));if(!this[_0xa0fd('0xa4')](_0x5bbfb9['odbc_id'])){return this[_0xa0fd('0xd')]['error'](_0x5bbfb9,_0xa0fd('0xd6'));}var _0x5d506d=this['getSquareOdbc']['sync'](this,_0x5bbfb9['odbc_id']);if(!_0x5d506d){return this['channel'][_0xa0fd('0x2f')](_0x5bbfb9,_0xa0fd('0xd7'));}if(!this[_0xa0fd('0xa4')](_0x5bbfb9['query'])){return this[_0xa0fd('0xd')][_0xa0fd('0x2f')](_0x5bbfb9,'no\x20query\x20configured');}var _0x41bcb3=_0x5bbfb9['query'][_0xa0fd('0x53')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0xa0fd('0xa7')](util['format'](_0xa0fd('0xd8'),_0x41bcb3));var _0x5ca26c=this[_0xa0fd('0x27')][_0xa0fd('0x6d')](this,_0x5d506d,_0x41bcb3);this[_0xa0fd('0x33')][_0xa0fd('0x6d')](this,_0x5bbfb9,_0x41bcb3);if(!this['isConfigured'](_0x5bbfb9[_0xa0fd('0xd9')])){return this[_0xa0fd('0xd')][_0xa0fd('0xa7')](_0xa0fd('0xda'));}var _0x226ad4=this[_0xa0fd('0x10')][_0xa0fd('0x6d')](this,_0x5bbfb9['variable_id']);if(!_0x226ad4){return this[_0xa0fd('0xd')][_0xa0fd('0x2f')](_0x5bbfb9,'no\x20variable\x20found');}var _0x2a48b2=this;_0x5ca26c[_0xa0fd('0xdb')](function(_0x34bb25,_0xf5dff9){Object['keys'](_0x34bb25)[_0xa0fd('0xdb')](function(_0x2acc74){_0x2a48b2[_0xa0fd('0xd')][_0xa0fd('0x9c')](util[_0xa0fd('0x26')](_0xa0fd('0xdc'),_0x226ad4,_0xf5dff9,_0x2acc74),_0x34bb25[_0x2acc74]);});});this[_0xa0fd('0xd')]['setVariable'](util[_0xa0fd('0x26')]('%s_ROWS_COUNT',_0x226ad4),_0x5ca26c[_0xa0fd('0x97')]);return this['channel']['noop'](util['format'](_0xa0fd('0xdd'),_0x226ad4));};AGIVertices['prototype'][_0xa0fd('0xde')]=function(_0x2b6727){logger[_0xa0fd('0xdf')](util[_0xa0fd('0x26')](_0xa0fd('0xe0'),_0x2b6727[_0xa0fd('0x35')]));if(!this['isConfigured'](_0x2b6727['sip_id'])){return this[_0xa0fd('0xd')][_0xa0fd('0x2f')](_0x2b6727,_0xa0fd('0xe1'));}var _0x4c940d=this[_0xa0fd('0x1c')]['sync'](this,_0x2b6727[_0xa0fd('0xe2')]);if(!_0x4c940d){return this[_0xa0fd('0xd')][_0xa0fd('0x2f')](_0x2b6727,_0xa0fd('0xe3'));}var _0x285d31=this[_0xa0fd('0xd')][_0xa0fd('0x51')](_0xa0fd('0xe4'),[util[_0xa0fd('0x26')](_0xa0fd('0xe5'),_0x4c940d),_0x2b6727[_0xa0fd('0x61')],_0x2b6727[_0xa0fd('0xe6')],_0x2b6727[_0xa0fd('0x5f')]]);if(_0x285d31['result']===-0x1){return _0x285d31;}return this['channel'][_0xa0fd('0xa7')](util[_0xa0fd('0x26')](_0xa0fd('0xe7'),_0xa0fd('0xe4')));};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0xe8')]=function(_0x4c4e40){logger[_0xa0fd('0x29')](util[_0xa0fd('0x26')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x4c4e40[_0xa0fd('0x35')]));if(!this[_0xa0fd('0xa4')](_0x4c4e40[_0xa0fd('0x77')])){return this[_0xa0fd('0xd')][_0xa0fd('0xa7')](_0xa0fd('0xe9'));}if(!this[_0xa0fd('0xa4')](_0x4c4e40[_0xa0fd('0x57')])){return this[_0xa0fd('0xd')][_0xa0fd('0xa7')](_0xa0fd('0xea'));}this[_0xa0fd('0xd')][_0xa0fd('0xeb')]=!![];this[_0xa0fd('0x33')](_0x4c4e40);this[_0xa0fd('0x3e')](_0x4c4e40['text'],'in','','');this['channel'][_0xa0fd('0xa7')](util[_0xa0fd('0x26')](_0xa0fd('0xec'),_0x4c4e40[_0xa0fd('0x57')]));var _0x4dfc2f=this['googleDialogflow'][_0xa0fd('0x6d')](this,_0x4c4e40);if(_0x4dfc2f){for(var _0x19bc9b in _0x4dfc2f){if(_0x4dfc2f[_0xa0fd('0x93')](_0x19bc9b)){this[_0xa0fd('0xd')]['setVariable'](util[_0xa0fd('0x26')](_0xa0fd('0xed'),_0x19bc9b[_0xa0fd('0xee')]()),_0x4dfc2f[_0x19bc9b]);}}this[_0xa0fd('0x3e')](_0x4dfc2f[_0xa0fd('0xef')],'out',_0xa0fd('0xe8'),'');return this['channel'][_0xa0fd('0xa7')](util['format'](_0xa0fd('0xf0'),_0x4dfc2f[_0xa0fd('0xef')]));}return this[_0xa0fd('0xd')]['error'](_0x4c4e40,_0xa0fd('0xf1'));};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0xf2')]=function(_0x33852f){logger[_0xa0fd('0x29')](util[_0xa0fd('0x26')](_0xa0fd('0xf3'),_0x33852f[_0xa0fd('0x35')]));if(!this['isConfigured'](_0x33852f[_0xa0fd('0x7a')])){return this[_0xa0fd('0xd')]['noop'](_0xa0fd('0xf4'));}if(!this[_0xa0fd('0xa4')](_0x33852f[_0xa0fd('0x7b')])){return this[_0xa0fd('0xd')][_0xa0fd('0xa7')](_0xa0fd('0xf5'));}if(!this[_0xa0fd('0xa4')](_0x33852f[_0xa0fd('0xf6')])){return this[_0xa0fd('0xd')][_0xa0fd('0xa7')]('no\x20private_key\x20configured');}if(!this[_0xa0fd('0xa4')](_0x33852f[_0xa0fd('0x7c')])){return this[_0xa0fd('0xd')][_0xa0fd('0xa7')](_0xa0fd('0xf7'));}if(!this[_0xa0fd('0xa4')](_0x33852f['text'])){return this[_0xa0fd('0xd')][_0xa0fd('0xa7')]('no\x20text\x20configured');}this[_0xa0fd('0xd')]['bot']=!![];this[_0xa0fd('0x33')](_0x33852f);this[_0xa0fd('0x3e')](_0x33852f[_0xa0fd('0x57')],'in','','');this[_0xa0fd('0xd')][_0xa0fd('0xa7')](util[_0xa0fd('0x26')](_0xa0fd('0xf8'),_0x33852f[_0xa0fd('0x57')]));var _0xa60500=this[_0xa0fd('0x79')][_0xa0fd('0x6d')](this,_0x33852f);if(_0xa60500){for(var _0x2590c4 in _0xa60500){if(_0xa60500[_0xa0fd('0x93')](_0x2590c4)){if(_0x2590c4!==_0xa0fd('0xf9')){this['channel']['setVariable'](util[_0xa0fd('0x26')](_0xa0fd('0xed'),_0x2590c4[_0xa0fd('0xee')]()),_0xa60500[_0x2590c4]);}}}this['createSquareMessage'](_0xa60500[_0xa0fd('0xef')],_0xa0fd('0xfa'),'dialogflowV2',_0xa60500[_0xa0fd('0xf9')]);return this['channel'][_0xa0fd('0xa7')](util[_0xa0fd('0x26')](_0xa0fd('0xfb'),_0xa60500[_0xa0fd('0xef')]));}return this[_0xa0fd('0xd')][_0xa0fd('0x2f')](_0x33852f,_0xa0fd('0xfc'));};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0xfd')]=function(_0x549ac2){logger['info'](util['format'](_0xa0fd('0xfe'),_0x549ac2[_0xa0fd('0x35')]));if(!this[_0xa0fd('0xa4')](_0x549ac2[_0xa0fd('0xff')])){return this['channel']['noop']('no\x20ndauth\x20url\x20configured');}if(!this[_0xa0fd('0xa4')](_0x549ac2[_0xa0fd('0x100')])){return this[_0xa0fd('0xd')][_0xa0fd('0xa7')](_0xa0fd('0x101'));}if(!this['isConfigured'](_0x549ac2[_0xa0fd('0x102')])){return this['channel'][_0xa0fd('0xa7')]('no\x20password\x20configured');}if(!this[_0xa0fd('0xa4')](_0x549ac2[_0xa0fd('0x103')])){return this[_0xa0fd('0xd')]['noop'](_0xa0fd('0xea'));}this['channel'][_0xa0fd('0xeb')]=!![];this['createSquareDetailsReport'](_0x549ac2);this[_0xa0fd('0x3e')](_0x549ac2[_0xa0fd('0x57')],'in','','');this['channel'][_0xa0fd('0xa7')](util[_0xa0fd('0x26')](_0xa0fd('0x104'),_0x549ac2[_0xa0fd('0x57')]));var _0x14df37=this[_0xa0fd('0x7d')][_0xa0fd('0x6d')](this,_0x549ac2);if(_0x14df37){for(var _0x861438 in _0x14df37){if(_0x14df37[_0xa0fd('0x93')](_0x861438)){this[_0xa0fd('0xd')][_0xa0fd('0x9c')](util[_0xa0fd('0x26')]('SESTEK_NDA_%s',_0x861438['toUpperCase']()),_0x14df37[_0x861438]);}}this[_0xa0fd('0x3e')](_0x14df37[_0xa0fd('0xef')],'out',_0xa0fd('0xfd'),'');if(_0x14df37[_0xa0fd('0x105')]){this['channel'][_0xa0fd('0xa7')](util[_0xa0fd('0x26')](_0xa0fd('0x106'),_0x14df37[_0xa0fd('0x105')]));var _0x434d65=this[_0xa0fd('0xd')][_0xa0fd('0x107')](_0x14df37[_0xa0fd('0x105')]);try{fs[_0xa0fd('0x108')](_0x14df37[_0xa0fd('0x105')]+_0xa0fd('0x109'));}catch(_0x384fd9){logger[_0xa0fd('0x2f')](_0x384fd9);}return _0x434d65;}else{return this['channel'][_0xa0fd('0xa7')](util[_0xa0fd('0x26')](_0xa0fd('0x10a'),_0x14df37[_0xa0fd('0xef')]));}}return this['channel'][_0xa0fd('0x2f')](_0x549ac2,_0xa0fd('0x10b'));};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0x10c')]=function(_0x548cd1){logger['info'](util[_0xa0fd('0x26')](_0xa0fd('0x10d'),_0x548cd1['label']));return this['channel'][_0xa0fd('0xa7')](_0xa0fd('0x10c'));};AGIVertices['prototype']['ext_dial']=function(_0x33639b){logger[_0xa0fd('0x29')](util[_0xa0fd('0x26')](_0xa0fd('0x10e'),_0x33639b[_0xa0fd('0x35')]));var _0x426988='';if(_0x33639b[_0xa0fd('0x10f')]){if(!this[_0xa0fd('0xa4')](_0x33639b['trunk_id'])){return this[_0xa0fd('0xd')][_0xa0fd('0x2f')](_0x33639b,_0xa0fd('0x110'));}else{var _0x3de6da=parseInt(_0x33639b[_0xa0fd('0x10f')],0xa);if(isNaN(_0x3de6da)){_0x426988=_0x33639b[_0xa0fd('0x10f')];}else{_0x426988=this['getTrunk'][_0xa0fd('0x6d')](this,_0x33639b[_0xa0fd('0x10f')]);if(!_0x426988){return this[_0xa0fd('0xd')][_0xa0fd('0x2f')](_0x33639b,'no\x20trunk\x20found');}}}}else if(_0x33639b['trunk_name']){_0x426988=_0x33639b[_0xa0fd('0x111')];}else{return this[_0xa0fd('0xd')]['error'](_0x33639b,_0xa0fd('0x110'));}var _0x3b43b3=this[_0xa0fd('0xd')][_0xa0fd('0x51')](_0xa0fd('0xe4'),[util[_0xa0fd('0x26')](_0xa0fd('0x112'),_0x426988,_0x33639b[_0xa0fd('0xc1')]),_0x33639b[_0xa0fd('0x61')],_0x33639b[_0xa0fd('0xe6')],_0x33639b['url']]);if(_0x3b43b3['result']===-0x1){return _0x3b43b3;}return this[_0xa0fd('0xd')][_0xa0fd('0xa7')](util[_0xa0fd('0x26')](_0xa0fd('0xe7'),_0xa0fd('0xe4')));};AGIVertices['prototype']['finally']=function(_0x362771){logger[_0xa0fd('0x29')](util['format'](_0xa0fd('0x113'),_0x362771[_0xa0fd('0x35')]));return this['channel']['noop'](_0xa0fd('0x114'));};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0xb')]=function(_0x39e2bf){logger['info'](util[_0xa0fd('0x26')](_0xa0fd('0x115'),_0x39e2bf[_0xa0fd('0x35')]));if(_0x39e2bf[_0xa0fd('0x116')]===0x0){return this[_0xa0fd('0xa5')](_0x39e2bf);}_0x39e2bf[_0xa0fd('0x116')]-=0x1;if(!this[_0xa0fd('0xa4')](_0x39e2bf[_0xa0fd('0x117')])){return this[_0xa0fd('0xd')]['error'](_0x39e2bf,_0xa0fd('0x118'));}var _0x2990ab=this['getSound'][_0xa0fd('0x6d')](this,_0x39e2bf['file_id']);if(!_0x2990ab){return this[_0xa0fd('0xd')][_0xa0fd('0x2f')](_0x39e2bf,'no\x20file\x20audio\x20found');}if(!this[_0xa0fd('0xa4')](_0x39e2bf[_0xa0fd('0xd9')])){return this[_0xa0fd('0xd')][_0xa0fd('0x2f')](_0xa0fd('0xda'));}var _0x55ff3f=this['channel'][_0xa0fd('0x119')](_0x2990ab,_0x39e2bf[_0xa0fd('0x11a')],_0x39e2bf[_0xa0fd('0x11b')]);var _0x45b2e1=_0x55ff3f[_0xa0fd('0xa2')]?_0x55ff3f[_0xa0fd('0xa2')][_0xa0fd('0x47')]():'';logger['info'](_0xa0fd('0x11c'),JSON[_0xa0fd('0x70')](_0x55ff3f));if(_0x55ff3f[_0xa0fd('0xa2')]===-0x1){this[_0xa0fd('0x33')][_0xa0fd('0x6d')](this,_0x39e2bf,_0x45b2e1);return _0x55ff3f;}else if(_0x55ff3f['extra']===_0xa0fd('0x61')){_0x55ff3f[_0xa0fd('0xa2')]=_0x45b2e1[_0xa0fd('0x97')]>=parseInt(_0x39e2bf[_0xa0fd('0x11d')])?'x':'i';}else{_0x55ff3f[_0xa0fd('0xa2')]=_0x45b2e1[_0xa0fd('0x97')]>=parseInt(_0x39e2bf['mindigit'])&&_0x45b2e1[_0xa0fd('0x97')]<=parseInt(_0x39e2bf['maxdigit'])?'x':'i';}var _0x5ced4f=this[_0xa0fd('0x10')][_0xa0fd('0x6d')](this,_0x39e2bf['variable_id']);if(!_0x5ced4f){return this[_0xa0fd('0xd')][_0xa0fd('0x2f')](_0x39e2bf,_0xa0fd('0x11e'));}this[_0xa0fd('0xd')][_0xa0fd('0x9c')](_0x5ced4f,_0x45b2e1);if(this[_0xa0fd('0xa4')](_0x39e2bf[_0xa0fd('0x11f')])){var _0x84c94=parseInt(_0x39e2bf['hiddendigitsnum'],0xa);var _0x6fec6c=rs[_0xa0fd('0x120')]({'charset':'*','length':_0x84c94});var _0xfd47ab=_0x45b2e1['length'];if(_0xfd47ab>0x0){if(_0xfd47ab>_0x84c94){this[_0xa0fd('0x33')][_0xa0fd('0x6d')](this,_0x39e2bf,_0x39e2bf['hiddendigitspos']===_0xa0fd('0x121')?_0x6fec6c+_0x45b2e1[_0xa0fd('0x122')](_0x84c94):_0x45b2e1[_0xa0fd('0x122')](0x0,_0xfd47ab-_0x84c94)+_0x6fec6c);}else{this['createSquareDetailsReport'][_0xa0fd('0x6d')](this,_0x39e2bf,rs[_0xa0fd('0x120')]({'charset':'*','length':_0xfd47ab}));}}else{this['createSquareDetailsReport'][_0xa0fd('0x6d')](this,_0x39e2bf,'');}}else{this[_0xa0fd('0x33')][_0xa0fd('0x6d')](this,_0x39e2bf,_0x45b2e1);}return _0x55ff3f;};AGIVertices[_0xa0fd('0xf')]['getsecretdigits']=function(_0x499956){logger['info'](util['format'](_0xa0fd('0x123'),_0x499956[_0xa0fd('0x35')]));return this[_0xa0fd('0xb')](_0x499956);};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0x124')]=function(_0xebb0e0){logger[_0xa0fd('0x29')](util[_0xa0fd('0x26')](_0xa0fd('0x125'),_0xebb0e0[_0xa0fd('0x35')]));this['createSquareDetailsReport'][_0xa0fd('0x6d')](this,_0xebb0e0,_0xebb0e0[_0xa0fd('0x126')]);return this['channel'][_0xa0fd('0xa7')](util['format'](_0xa0fd('0x127'),_0xebb0e0[_0xa0fd('0x126')]));};AGIVertices['prototype']['awspolly']=function(_0x184747){logger[_0xa0fd('0x29')](util[_0xa0fd('0x26')](_0xa0fd('0x128'),_0x184747[_0xa0fd('0x35')]));if(!this[_0xa0fd('0xa4')](_0x184747[_0xa0fd('0x8a')])||!this[_0xa0fd('0xa4')](_0x184747['aws_secret_access_key'])){return this[_0xa0fd('0xd')][_0xa0fd('0xa7')](_0xa0fd('0x129'));}if(!this[_0xa0fd('0xa4')](_0x184747['text'])){return this[_0xa0fd('0xd')][_0xa0fd('0xa7')](_0xa0fd('0xea'));}this['channel'][_0xa0fd('0xa7')](util[_0xa0fd('0x26')](_0xa0fd('0x12a'),_0x184747[_0xa0fd('0x57')]));var _0x169292=this['awsPolly'][_0xa0fd('0x6d')](this,_0x184747);if(_0x169292){this['channel'][_0xa0fd('0xa7')](util[_0xa0fd('0x26')](_0xa0fd('0x12b'),_0x169292));var _0x1540d0=this[_0xa0fd('0xd')][_0xa0fd('0x107')](_0x169292);try{fs[_0xa0fd('0x108')](_0x169292+_0xa0fd('0x109'));}catch(_0x23945a){logger[_0xa0fd('0x2f')](_0x23945a);}return _0x1540d0;}return this[_0xa0fd('0xd')][_0xa0fd('0x2f')](_0x184747,_0xa0fd('0x12c'));};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0x12d')]=function(_0x206d47){logger[_0xa0fd('0x29')](util['format'](_0xa0fd('0x12e'),_0x206d47['label']));if(!this[_0xa0fd('0xa4')](_0x206d47[_0xa0fd('0x8a')])||!this['isConfigured'](_0x206d47['aws_secret_access_key'])){return this[_0xa0fd('0xd')][_0xa0fd('0xa7')](_0xa0fd('0x129'));}if(!this[_0xa0fd('0xa4')](_0x206d47[_0xa0fd('0x8c')])){return this[_0xa0fd('0xd')]['noop'](_0xa0fd('0x12f'));}if(!this[_0xa0fd('0xa4')](_0x206d47['text'])){return this[_0xa0fd('0xd')][_0xa0fd('0xa7')](_0xa0fd('0xea'));}this['channel'][_0xa0fd('0xeb')]=!![];this[_0xa0fd('0x33')](_0x206d47);this[_0xa0fd('0x3e')](_0x206d47['text'],'in','','');this[_0xa0fd('0xd')]['noop'](util[_0xa0fd('0x26')](_0xa0fd('0x130'),_0x206d47[_0xa0fd('0x57')]));var _0x1ed7c4=this[_0xa0fd('0x89')][_0xa0fd('0x6d')](this,_0x206d47);if(_0x1ed7c4){for(var _0xe2fb30 in _0x1ed7c4){if(_0x1ed7c4[_0xa0fd('0x93')](_0xe2fb30)&&_[_0xa0fd('0x94')](_0x1ed7c4[_0xe2fb30])){this[_0xa0fd('0xd')][_0xa0fd('0x9c')](util[_0xa0fd('0x26')](_0xa0fd('0x131'),_0xe2fb30[_0xa0fd('0xee')]()),_0x1ed7c4[_0xe2fb30]);}}if(_['isNil'](_0x1ed7c4[_0xa0fd('0x73')])){return this[_0xa0fd('0xd')][_0xa0fd('0xa7')](_0xa0fd('0x132'));}else{this[_0xa0fd('0x3e')](_0x1ed7c4[_0xa0fd('0x73')],_0xa0fd('0xfa'),_0xa0fd('0x133'),'');return this[_0xa0fd('0xd')]['noop'](util[_0xa0fd('0x26')]('Amazon\x20Lex\x20Result\x20%s',_0x1ed7c4[_0xa0fd('0x73')]));}}return this[_0xa0fd('0xd')]['error'](_0x206d47,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices['prototype'][_0xa0fd('0x134')]=function(_0x5a6a2c){logger[_0xa0fd('0x29')](util[_0xa0fd('0x26')](_0xa0fd('0x135'),_0x5a6a2c[_0xa0fd('0x35')],_0x5a6a2c[_0xa0fd('0x61')]));if(!this[_0xa0fd('0xa4')](_0x5a6a2c[_0xa0fd('0x77')])){return this[_0xa0fd('0xd')][_0xa0fd('0xa7')]('no\x20key\x20configured');}var _0x29de9b=_0xa0fd('0x136');var _0x4d1788=util[_0xa0fd('0x26')](_0xa0fd('0x137'),FILES_PATH,rs['generate'](0x4));var _0x21ce41=util[_0xa0fd('0x26')]('%s.%s',_0x4d1788,_0x29de9b);var _0x97e736=!![];if(_0x5a6a2c[_0xa0fd('0x138')]==='NOBEEP'){_0x97e736=![];}var _0x2b257c=this[_0xa0fd('0xd')][_0xa0fd('0x139')](_0x4d1788,_0x29de9b,_0x5a6a2c[_0xa0fd('0x13a')],_0x5a6a2c[_0xa0fd('0x61')],undefined,_0x97e736);if(_0x2b257c[_0xa0fd('0xa2')]!==-0x1){this[_0xa0fd('0xd')][_0xa0fd('0xa7')](util[_0xa0fd('0x26')]('google\x20%s\x20file\x20created',_0x21ce41));var _0x411298=this[_0xa0fd('0x8d')][_0xa0fd('0x6d')](this,_0x5a6a2c,_0x21ce41);if(_0x411298){for(var _0x1b9688 in _0x411298){if(_0x411298['hasOwnProperty'](_0x1b9688)){this[_0xa0fd('0xd')][_0xa0fd('0x9c')](util[_0xa0fd('0x26')](_0xa0fd('0x13b'),_0x1b9688[_0xa0fd('0xee')]()),_0x411298[_0x1b9688]);}}return this[_0xa0fd('0xd')]['noop'](util[_0xa0fd('0x26')](_0xa0fd('0x13c'),JSON[_0xa0fd('0x70')](_0x411298)));}}return _0x2b257c;};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0x13d')]=function(_0x5c2b1a){logger[_0xa0fd('0x29')](util[_0xa0fd('0x26')](_0xa0fd('0x13e'),_0x5c2b1a[_0xa0fd('0x35')]));if(!this[_0xa0fd('0xa4')](_0x5c2b1a['appid'])){return this[_0xa0fd('0xd')][_0xa0fd('0xa7')]('no\x20appid\x20configured');}if(!this[_0xa0fd('0xa4')](_0x5c2b1a[_0xa0fd('0x91')])){return this[_0xa0fd('0xd')][_0xa0fd('0xa7')](_0xa0fd('0x13f'));}var _0x3af596=_0xa0fd('0x136');var _0x4ba0ea=util[_0xa0fd('0x26')](_0xa0fd('0x137'),FILES_PATH,rs[_0xa0fd('0x120')](0x4));var _0x493f9c=util[_0xa0fd('0x26')](_0xa0fd('0x9a'),_0x4ba0ea,_0x3af596);var _0x4a7236=!![];if(_0x5c2b1a[_0xa0fd('0x138')]===_0xa0fd('0x140')){_0x4a7236=![];}var _0x5b631b=this[_0xa0fd('0xd')][_0xa0fd('0x139')](_0x4ba0ea,_0x3af596,_0x5c2b1a[_0xa0fd('0x13a')],_0x5c2b1a[_0xa0fd('0x61')],undefined,_0x4a7236);if(_0x5b631b[_0xa0fd('0xa2')]!==-0x1){this[_0xa0fd('0xd')]['noop'](util['format'](_0xa0fd('0x141'),_0x493f9c));var _0x5265fa=this[_0xa0fd('0x8f')][_0xa0fd('0x6d')](this,_0x5c2b1a,_0x493f9c);if(_0x5265fa){for(var _0x3f4953 in _0x5265fa){if(_0x5265fa[_0xa0fd('0x93')](_0x3f4953)){this[_0xa0fd('0xd')]['setVariable'](util[_0xa0fd('0x26')]('TILDE_ASR_%s',_0x3f4953['toUpperCase']()),_0x5265fa[_0x3f4953]);}}return this[_0xa0fd('0xd')][_0xa0fd('0xa7')](util['format'](_0xa0fd('0x142'),JSON['stringify'](_0x5265fa)));}}return _0x5b631b;};AGIVertices['prototype'][_0xa0fd('0x143')]=function(_0x14a866){logger[_0xa0fd('0x29')](util[_0xa0fd('0x26')](_0xa0fd('0x144'),_0x14a866[_0xa0fd('0x35')]));return this[_0xa0fd('0xd')][_0xa0fd('0x145')](_0x14a866[_0xa0fd('0x146')],_0x14a866[_0xa0fd('0x3b')],_0x14a866['priority']);};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0x147')]=function(_0x2ff3aa){logger[_0xa0fd('0x29')](util[_0xa0fd('0x26')](_0xa0fd('0x148'),_0x2ff3aa[_0xa0fd('0x35')]));if(!this[_0xa0fd('0xa4')](_0x2ff3aa['condition'])){return this['channel'][_0xa0fd('0x2f')](_0x2ff3aa,_0xa0fd('0x149'));}try{var _0x2f0838=eval(_0x2ff3aa[_0xa0fd('0x14a')])?_0xa0fd('0x14b'):_0xa0fd('0x14c');this[_0xa0fd('0xd')]['noop'](util['format'](_0xa0fd('0x14d'),_0x2ff3aa[_0xa0fd('0x14a')],_0x2f0838));return{'code':0xc8,'result':_0x2f0838};}catch(_0x1c90ca){return{'code':0xc8,'result':_0xa0fd('0x14c')};}};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0x14e')]=function(_0x50150f){logger['info'](util[_0xa0fd('0x26')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x50150f[_0xa0fd('0x35')]));if(!this['isConfigured'](_0x50150f[_0xa0fd('0x14f')])){return this[_0xa0fd('0xd')][_0xa0fd('0x2f')](_0x50150f,_0xa0fd('0x150'));}var _0x39b66b=this[_0xa0fd('0x22')]['sync'](this,_0x50150f[_0xa0fd('0x14f')]);if(!_0x39b66b){return this['channel'][_0xa0fd('0x2f')](_0x50150f,'no\x20intervals\x20found');}for(var _0x41a1ac=0x0;_0x41a1ac<_0x39b66b['length'];_0x41a1ac+=0x1){var _0x1c831d=this[_0xa0fd('0xd')][_0xa0fd('0x10')](util[_0xa0fd('0x26')](_0xa0fd('0x151'),_0x39b66b[_0x41a1ac]));if(_0x1c831d['result']===-0x1){return _0x1c831d;}logger[_0xa0fd('0x29')](util[_0xa0fd('0x26')](_0xa0fd('0x152'),_0x39b66b[_0x41a1ac],_0x1c831d[_0xa0fd('0xa0')]));if(_0x1c831d[_0xa0fd('0xa0')]===_0xa0fd('0x14b')){logger[_0xa0fd('0x29')](util[_0xa0fd('0x26')](_0xa0fd('0x152'),_0x39b66b[_0x41a1ac],_0xa0fd('0x14b')));this[_0xa0fd('0xd')][_0xa0fd('0xa7')](util['format'](_0xa0fd('0x152'),_0x39b66b[_0x41a1ac],_0xa0fd('0x14b')));return{'code':0xc8,'result':_0xa0fd('0x14b')};}else{logger['info'](util['format'](_0xa0fd('0x152'),_0x39b66b[_0x41a1ac],_0xa0fd('0x14c')));this[_0xa0fd('0xd')][_0xa0fd('0xa7')](util['format'](_0xa0fd('0x152'),_0x39b66b[_0x41a1ac],_0xa0fd('0x14c')));}}return{'code':0xc8,'result':_0xa0fd('0x14c')};};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0x153')]=function(_0x34f530){logger['info'](util[_0xa0fd('0x26')](_0xa0fd('0x154'),_0x34f530[_0xa0fd('0x35')]));return this[_0xa0fd('0xd')][_0xa0fd('0x153')]();};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0x155')]=function(_0x117444){logger['info'](util['format'](_0xa0fd('0x156'),_0x117444['label']));if(!this[_0xa0fd('0xa4')](_0x117444[_0xa0fd('0x77')])){return this['channel']['noop'](_0xa0fd('0xe9'));}var _0x46f6dd='wav';var _0x32bde5=util['format'](_0xa0fd('0x137'),FILES_PATH,rs[_0xa0fd('0x120')](0x4));var _0x2a7bdf=util['format']('%s.%s',_0x32bde5,_0x46f6dd);var _0x5e1a61=!![];if(_0x117444['beep']===_0xa0fd('0x140')){_0x5e1a61=![];}var _0x53b749=this[_0xa0fd('0xd')][_0xa0fd('0x139')](_0x32bde5,_0x46f6dd,_0x117444[_0xa0fd('0x13a')],_0x117444['timeout'],undefined,_0x5e1a61);if(_0x53b749[_0xa0fd('0xa2')]!==-0x1){this[_0xa0fd('0xd')]['noop'](util['format'](_0xa0fd('0x157'),_0x2a7bdf));var _0x322e36=this[_0xa0fd('0x81')][_0xa0fd('0x6d')](this,_0x117444,_0x2a7bdf);if(_0x322e36){for(var _0x23fe02 in _0x322e36){if(_0x322e36[_0xa0fd('0x93')](_0x23fe02)){this[_0xa0fd('0xd')][_0xa0fd('0x9c')](util[_0xa0fd('0x26')](_0xa0fd('0x158'),_0x23fe02[_0xa0fd('0xee')]()),_0x322e36[_0x23fe02]);}}return this[_0xa0fd('0xd')][_0xa0fd('0xa7')](util[_0xa0fd('0x26')]('IspeechASR\x20Result\x20%s',JSON[_0xa0fd('0x70')](_0x322e36)));}}return _0x53b749;};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0x159')]=function(_0x2d4dc4){logger[_0xa0fd('0x29')](util[_0xa0fd('0x26')](_0xa0fd('0x15a'),_0x2d4dc4[_0xa0fd('0x35')]));if(!this[_0xa0fd('0xa4')](_0x2d4dc4[_0xa0fd('0x77')])){return this[_0xa0fd('0xd')]['noop']('no\x20key\x20configured');}if(!this[_0xa0fd('0xa4')](_0x2d4dc4[_0xa0fd('0x57')])){return this[_0xa0fd('0xd')][_0xa0fd('0xa7')](_0xa0fd('0xea'));}this[_0xa0fd('0xd')]['noop'](util['format'](_0xa0fd('0x15b'),_0x2d4dc4[_0xa0fd('0x57')]));var _0x267854=this['ispeechTTS'][_0xa0fd('0x6d')](this,_0x2d4dc4);if(_0x267854){this[_0xa0fd('0xd')][_0xa0fd('0xa7')](util['format']('ispeech\x20%s\x20file\x20created',_0x267854));var _0x288573=this[_0xa0fd('0xd')][_0xa0fd('0x107')](_0x267854,_0x2d4dc4['intKey']);try{fs[_0xa0fd('0x108')](_0x267854+_0xa0fd('0x109'));}catch(_0x1de3fe){logger[_0xa0fd('0x2f')](_0x1de3fe);}return _0x288573;}return this[_0xa0fd('0xd')][_0xa0fd('0x2f')](_0x2d4dc4,_0xa0fd('0x15c'));};AGIVertices['prototype'][_0xa0fd('0x15d')]=function(_0x35ce77){logger['info'](util[_0xa0fd('0x26')](_0xa0fd('0x15e'),_0x35ce77[_0xa0fd('0x35')]));if(!this['isConfigured'](_0x35ce77[_0xa0fd('0x15f')])){return this[_0xa0fd('0xd')][_0xa0fd('0x2f')](_0x35ce77,'no\x20find\x20by\x20configured');}logger[_0xa0fd('0x29')](util[_0xa0fd('0x26')](_0xa0fd('0x160'),this[_0xa0fd('0xd')]['callerid'],_0x35ce77[_0xa0fd('0x15f')]));var _0x7810b9=this[_0xa0fd('0x50')][_0xa0fd('0x6d')](this,_0x35ce77['findBy']);if(_0x7810b9){logger[_0xa0fd('0x29')](util[_0xa0fd('0x26')](_0xa0fd('0x161'),this[_0xa0fd('0xd')][_0xa0fd('0x39')],_0x35ce77[_0xa0fd('0x15f')]));this['channel'][_0xa0fd('0xa7')](util[_0xa0fd('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xa0fd('0xd')]['callerid'],_0x35ce77[_0xa0fd('0x15f')]));return{'code':0xc8,'result':_0xa0fd('0x162')};}else{logger[_0xa0fd('0x29')](util[_0xa0fd('0x26')](_0xa0fd('0x163'),this[_0xa0fd('0xd')][_0xa0fd('0x39')],_0x35ce77[_0xa0fd('0x15f')]));this['channel']['noop'](util[_0xa0fd('0x26')](_0xa0fd('0x163'),this['channel'][_0xa0fd('0x39')],_0x35ce77['findBy']));return{'code':0xc8,'result':_0xa0fd('0x164')};}};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0x165')]=function(_0x3a263a){logger[_0xa0fd('0x29')](util[_0xa0fd('0x26')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x3a263a[_0xa0fd('0x35')]));if(!this['isConfigured'](_0x3a263a[_0xa0fd('0x15f')])){return this['channel'][_0xa0fd('0x2f')](_0x3a263a,_0xa0fd('0x166'));}logger['info'](util['format'](_0xa0fd('0x160'),this[_0xa0fd('0xd')][_0xa0fd('0x39')],_0x3a263a['findBy']));var _0xe40db=this['agentLogout'][_0xa0fd('0x6d')](this,_0x3a263a[_0xa0fd('0x15f')]);if(_0xe40db){logger[_0xa0fd('0x29')](util[_0xa0fd('0x26')](_0xa0fd('0x161'),this[_0xa0fd('0xd')][_0xa0fd('0x39')],_0x3a263a[_0xa0fd('0x15f')]));this[_0xa0fd('0xd')][_0xa0fd('0xa7')](util[_0xa0fd('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xa0fd('0xd')][_0xa0fd('0x39')],_0x3a263a[_0xa0fd('0x15f')]));return{'code':0xc8,'result':_0xa0fd('0x162')};}else{logger['info'](util['format'](_0xa0fd('0x163'),this[_0xa0fd('0xd')][_0xa0fd('0x39')],_0x3a263a[_0xa0fd('0x15f')]));this[_0xa0fd('0xd')][_0xa0fd('0xa7')](util['format'](_0xa0fd('0x163'),this[_0xa0fd('0xd')][_0xa0fd('0x39')],_0x3a263a['findBy']));return{'code':0xc8,'result':_0xa0fd('0x164')};}};AGIVertices['prototype'][_0xa0fd('0x167')]=function(_0x7ec6c7){logger[_0xa0fd('0x29')](util[_0xa0fd('0x26')](_0xa0fd('0x168'),_0x7ec6c7[_0xa0fd('0x35')]));if(!this[_0xa0fd('0xa4')](_0x7ec6c7['operation'])){return this[_0xa0fd('0xd')][_0xa0fd('0x2f')](_0x7ec6c7,_0xa0fd('0x169'));}this['channel'][_0xa0fd('0xa7')](util[_0xa0fd('0x26')](_0xa0fd('0x16a'),_0x7ec6c7[_0xa0fd('0x16b')]));var _0x5e205e=eval(_0x7ec6c7[_0xa0fd('0x16b')]);if(!this['isConfigured'](_0x7ec6c7[_0xa0fd('0xd9')])){return this[_0xa0fd('0xd')][_0xa0fd('0xa7')](_0xa0fd('0xda'));}var _0x3bef47=this[_0xa0fd('0x10')][_0xa0fd('0x6d')](this,_0x7ec6c7[_0xa0fd('0xd9')]);if(!_0x3bef47){return this[_0xa0fd('0xd')][_0xa0fd('0x2f')](_0x7ec6c7,_0xa0fd('0x11e'));}if(_['isArray'](_0x5e205e)){var _0x1afbef=this;_0x5e205e[_0xa0fd('0xdb')](function(_0x30325f,_0x457f84){_0x1afbef[_0xa0fd('0xd')][_0xa0fd('0x9c')](util[_0xa0fd('0x26')](_0xa0fd('0x16c'),_0x3bef47,_0x457f84),_0x30325f);});return this[_0xa0fd('0xd')][_0xa0fd('0xa7')](util[_0xa0fd('0x26')](_0xa0fd('0x16d'),_0x3bef47));}else{return this['channel']['setVariable'](_0x3bef47,_0x5e205e);}};AGIVertices['prototype'][_0xa0fd('0xa')]=function(_0x14dce9){logger[_0xa0fd('0x29')](util[_0xa0fd('0x26')](_0xa0fd('0x16e'),_0x14dce9[_0xa0fd('0x35')]));if(_0x14dce9[_0xa0fd('0x116')]===0x0){return this[_0xa0fd('0xa5')](_0x14dce9);}_0x14dce9['retry']-=0x1;if(!this['isConfigured'](_0x14dce9[_0xa0fd('0x117')])){return this[_0xa0fd('0xd')][_0xa0fd('0x2f')](_0x14dce9,_0xa0fd('0x118'));}var _0x257777=this['getSound'][_0xa0fd('0x6d')](this,_0x14dce9['file_id']);if(!_0x257777){return this[_0xa0fd('0xd')][_0xa0fd('0x2f')](_0x14dce9,_0xa0fd('0x16f'));}var _0x8a3e07=this[_0xa0fd('0xd')][_0xa0fd('0x119')](_0x257777,_0x14dce9[_0xa0fd('0x11a')],_0x14dce9[_0xa0fd('0x170')]);var _0x6225e4=_0x8a3e07[_0xa0fd('0xa2')];if(_0x8a3e07[_0xa0fd('0xa2')]===-0x1){this['createSquareDetailsReport'][_0xa0fd('0x6d')](this,_0x14dce9,'-1');return _0x8a3e07;}else if(_0x8a3e07['extra']==='timeout'){_0x8a3e07[_0xa0fd('0xa2')]=_0x8a3e07[_0xa0fd('0xa2')]['length']>0x0?_0x8a3e07['result']:'t';}else if(_[_0xa0fd('0x43')](_0x8a3e07[_0xa0fd('0xa2')])){_0x8a3e07['result']='#';_0x6225e4='#';}if(!this[_0xa0fd('0xa4')](_0x14dce9['variable_id'])){this[_0xa0fd('0xd')]['noop'](_0xa0fd('0xda'));}else{var _0x34c989=this[_0xa0fd('0x10')][_0xa0fd('0x6d')](this,_0x14dce9[_0xa0fd('0xd9')]);if(!_0x34c989){return this[_0xa0fd('0xd')][_0xa0fd('0x2f')](_0x14dce9,_0xa0fd('0x11e'));}this[_0xa0fd('0xd')][_0xa0fd('0x9c')](_0x34c989,_0x6225e4);}this['createSquareDetailsReport']['sync'](this,_0x14dce9,_0x6225e4);return _0x8a3e07;};AGIVertices[_0xa0fd('0xf')]['noop']=function(_0x429fd6){logger[_0xa0fd('0x29')](util['format'](_0xa0fd('0x171'),_0x429fd6[_0xa0fd('0x35')]));return this[_0xa0fd('0xd')]['noop'](_0x429fd6[_0xa0fd('0x172')]||_0x429fd6[_0xa0fd('0x35')]);};AGIVertices['prototype']['pause']=function(_0x19561e){logger['info'](util[_0xa0fd('0x26')](_0xa0fd('0x173'),_0x19561e[_0xa0fd('0x35')]));if(!this[_0xa0fd('0xa4')](_0x19561e['findBy'])){return this[_0xa0fd('0xd')]['error'](_0x19561e,_0xa0fd('0x166'));}logger[_0xa0fd('0x29')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xa0fd('0xd')]['callerid'],_0x19561e[_0xa0fd('0x15f')]));var _0x45dfa1=this[_0xa0fd('0x48')]['sync'](this,_0x19561e['pause_id']);var _0x3361ba=this['agentPause'][_0xa0fd('0x6d')](this,_0x19561e[_0xa0fd('0x15f')],_0x45dfa1);if(_0x3361ba){logger[_0xa0fd('0x29')](util[_0xa0fd('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xa0fd('0xd')]['callerid'],_0x19561e[_0xa0fd('0x15f')]));this[_0xa0fd('0xd')][_0xa0fd('0xa7')](util[_0xa0fd('0x26')](_0xa0fd('0x161'),this[_0xa0fd('0xd')]['callerid'],_0x19561e[_0xa0fd('0x15f')]));return{'code':0xc8,'result':_0xa0fd('0x162')};}else{logger[_0xa0fd('0x29')](util[_0xa0fd('0x26')](_0xa0fd('0x163'),this['channel'][_0xa0fd('0x39')],_0x19561e[_0xa0fd('0x15f')]));this[_0xa0fd('0xd')][_0xa0fd('0xa7')](util[_0xa0fd('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xa0fd('0xd')]['callerid'],_0x19561e['findBy']));return{'code':0xc8,'result':_0xa0fd('0x164')};}};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0x174')]=function(_0x2db8f9){logger[_0xa0fd('0x29')](util['format'](_0xa0fd('0x175'),_0x2db8f9[_0xa0fd('0x35')]));if(!this[_0xa0fd('0xa4')](_0x2db8f9[_0xa0fd('0x117')])){return this[_0xa0fd('0xd')][_0xa0fd('0x2f')](_0x2db8f9,_0xa0fd('0x118'));}var _0x27d3a1=this['getSound'][_0xa0fd('0x6d')](this,_0x2db8f9['file_id']);if(!_0x27d3a1){return this[_0xa0fd('0xd')][_0xa0fd('0x2f')](_0x2db8f9,'no\x20file\x20audio\x20found');}var _0xbfa39d=this[_0xa0fd('0xd')][_0xa0fd('0x51')](_0xa0fd('0x176'),[_0x27d3a1,_0x2db8f9[_0xa0fd('0xe6')]]);if(_0xbfa39d[_0xa0fd('0xa2')]===-0x1){return _0xbfa39d;}return this[_0xa0fd('0xd')][_0xa0fd('0xa7')](util['format'](_0xa0fd('0xc5'),_0xa0fd('0x176'),_0x27d3a1));};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0x177')]=function(_0x7abf6e){logger[_0xa0fd('0x29')](util['format'](_0xa0fd('0x178'),_0x7abf6e[_0xa0fd('0x35')]));if(!this[_0xa0fd('0xa4')](_0x7abf6e[_0xa0fd('0x179')])){return this[_0xa0fd('0xd')]['error'](_0x7abf6e,_0xa0fd('0x17a'));}var _0x5f6c33='';var _0x40397e=parseInt(_0x7abf6e[_0xa0fd('0x179')],0xa);if(isNaN(_0x40397e)){_0x5f6c33=_0x7abf6e['queue_id'];}else{_0x5f6c33=this[_0xa0fd('0x14')][_0xa0fd('0x6d')](this,_0x7abf6e[_0xa0fd('0x179')]);if(!_0x5f6c33){return this[_0xa0fd('0xd')][_0xa0fd('0x2f')](_0x7abf6e,_0xa0fd('0x17b'));}}var _0x5b6bcf='';if(this[_0xa0fd('0xa4')](_0x7abf6e[_0xa0fd('0x117')])){var _0x314951=this[_0xa0fd('0x17c')][_0xa0fd('0x6d')](this,_0x7abf6e['file_id']);if(_0x314951){_0x5b6bcf=_0x314951;}}this['createSquareDetailsReport'][_0xa0fd('0x6d')](this,_0x7abf6e,_0x5f6c33);if(_0x7abf6e[_0xa0fd('0xe6')]['indexOf']('x')<0x0){_0x7abf6e[_0xa0fd('0xe6')]+='x';}if(_0x7abf6e[_0xa0fd('0xe6')][_0xa0fd('0x17d')]('X')<0x0){_0x7abf6e[_0xa0fd('0xe6')]+='X';}this[_0xa0fd('0xd')]['setVariable']('XMCS-QUEUE',_0x5f6c33?_0x5f6c33['toLowerCase']():'');var _0x3200b3=this[_0xa0fd('0xd')][_0xa0fd('0x51')](_0xa0fd('0x17e'),[_0x5f6c33,_0x7abf6e['opts'],_0x7abf6e[_0xa0fd('0x5f')],_0x5b6bcf,_0x7abf6e['timeout'],_0x7abf6e['agi'],_0x7abf6e['macro'],_0x7abf6e[_0xa0fd('0x17f')],'',_0x7abf6e['position']]);if(_0x3200b3[_0xa0fd('0xa2')]===-0x1){return _0x3200b3;}return this[_0xa0fd('0xd')][_0xa0fd('0xa7')](util[_0xa0fd('0x26')](_0xa0fd('0xc5'),_0xa0fd('0x17e'),_0x5f6c33));};AGIVertices[_0xa0fd('0xf')]['record']=function(_0x208d9a){logger[_0xa0fd('0x29')](util[_0xa0fd('0x26')](_0xa0fd('0x180'),_0x208d9a['label']));var _0x1a8a69=_0x208d9a['recordingFormat']||_0xa0fd('0x136');var _0x3596a6=util['format']('%s_%s',this['channel']['uniqueid'],rs[_0xa0fd('0x120')](0x5));var _0x1fb42a=util[_0xa0fd('0x26')](_0xa0fd('0x181'),FILES_PATH,_0x3596a6,_0x1a8a69);var _0xc21460=util['format'](_0xa0fd('0x137'),FILES_PATH,_0x3596a6);this[_0xa0fd('0x38')]['sync'](this,_0x208d9a,_0x3596a6,_0x1fb42a);this[_0xa0fd('0xd')][_0xa0fd('0x9c')](_0xa0fd('0x182'),_0x3596a6);logger[_0xa0fd('0x29')](_0xa0fd('0x183'),_0xc21460,_0x1a8a69,_0x208d9a[_0xa0fd('0x184')],_0x208d9a[_0xa0fd('0x61')]);return this[_0xa0fd('0xd')][_0xa0fd('0x139')](_0xc21460,_0x1a8a69,_0x208d9a['escape_digits'],_0x208d9a['timeout'],undefined,!![]);};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0x185')]=function(_0x4b5d48){logger[_0xa0fd('0x29')](util[_0xa0fd('0x26')](_0xa0fd('0x186'),_0x4b5d48['label']));if(!this[_0xa0fd('0xa4')](_0x4b5d48[_0xa0fd('0x5f')])){return this[_0xa0fd('0xd')][_0xa0fd('0xa7')](_0xa0fd('0x187'));}var _0x2c8689=this['restAPI'][_0xa0fd('0x6d')](this,_0x4b5d48);logger['info'](util[_0xa0fd('0x26')](_0xa0fd('0x188'),util['inspect'](_0x2c8689,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x4b5d48[_0xa0fd('0xd9')])){return this[_0xa0fd('0xd')][_0xa0fd('0xa7')](_0xa0fd('0x189'));}var _0x266c55=this[_0xa0fd('0x10')][_0xa0fd('0x6d')](this,_0x4b5d48[_0xa0fd('0xd9')]);if(!_0x266c55){return this['channel'][_0xa0fd('0x2f')](_0x4b5d48,'no\x20variable\x20found');}this[_0xa0fd('0xd')]['setVariable'](util['format'](_0xa0fd('0x18a'),_0x266c55),_0x2c8689[_0xa0fd('0x71')]?_0x2c8689['statusCode']:_0xa0fd('0x18b'));this[_0xa0fd('0xd')][_0xa0fd('0x9c')](util[_0xa0fd('0x26')](_0xa0fd('0x18c'),_0x266c55),_0x2c8689['statusMessage']?_0x2c8689[_0xa0fd('0x72')]:'OK');if(_0x2c8689[_0xa0fd('0x66')]){try{this[_0xa0fd('0x98')](_0x2c8689[_0xa0fd('0x66')],_0x266c55);}catch(_0x4ac077){logger[_0xa0fd('0x2f')](util[_0xa0fd('0x26')](_0xa0fd('0x18d'),_0x266c55));}}return this['channel'][_0xa0fd('0xa7')](util[_0xa0fd('0x26')](_0xa0fd('0xdd'),_0x266c55));};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0x18e')]=function(_0x2cd9dc){logger[_0xa0fd('0x29')](util[_0xa0fd('0x26')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x2cd9dc['label']));return this[_0xa0fd('0xd')][_0xa0fd('0x18f')](_0x2cd9dc[_0xa0fd('0x190')][_0xa0fd('0x53')](/\s+/g,''),_0x2cd9dc['escape_digits']);};AGIVertices['prototype'][_0xa0fd('0x191')]=function(_0x5c330c){logger[_0xa0fd('0x29')](util[_0xa0fd('0x26')](_0xa0fd('0x192'),_0x5c330c['label']));return this['channel']['sayNumber'](_0x5c330c['number'][_0xa0fd('0x53')](/\s+/g,''),_0x5c330c[_0xa0fd('0x184')]);};AGIVertices['prototype']['sayphonetic']=function(_0x36dc23){logger[_0xa0fd('0x29')](util[_0xa0fd('0x26')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x36dc23['label']));return this[_0xa0fd('0xd')][_0xa0fd('0x193')](_0x36dc23[_0xa0fd('0x57')],_0x36dc23[_0xa0fd('0x184')]);};AGIVertices['prototype'][_0xa0fd('0x194')]=function(_0x4a4414){logger['info'](util[_0xa0fd('0x26')](_0xa0fd('0x195'),_0x4a4414[_0xa0fd('0x35')]));if(!this[_0xa0fd('0xa4')](_0x4a4414['account_id'])){return this[_0xa0fd('0xd')]['noop'](_0xa0fd('0x196'));}var _0x3a2d25=this[_0xa0fd('0x20')][_0xa0fd('0x6d')](this,_0x4a4414[_0xa0fd('0x197')]);if(!_0x3a2d25||!_0x3a2d25[_0xa0fd('0x198')]){return this['channel'][_0xa0fd('0x2f')](_0x4a4414,_0xa0fd('0x199'));}var _0x47c31a={'from':util[_0xa0fd('0x26')](_0xa0fd('0x19a'),_0x3a2d25['name'],_0x3a2d25[_0xa0fd('0x19b')]||_0x3a2d25[_0xa0fd('0x198')][_0xa0fd('0x19c')]),'to':_0x4a4414['to']||'','cc':_0x4a4414['cc']||'','bcc':_0x4a4414[_0xa0fd('0x19d')]||'','subject':_0x4a4414[_0xa0fd('0x19e')],'html':_0x4a4414[_0xa0fd('0x57')],'text':_0x4a4414[_0xa0fd('0x57')]};if(this['isConfigured'](_0x4a4414[_0xa0fd('0x19f')])){}logger[_0xa0fd('0xdf')]('sendMail\x20message',JSON['stringify'](_0x47c31a));this[_0xa0fd('0x33')][_0xa0fd('0x6d')](this,_0x4a4414,_0x4a4414['account_id']);this[_0xa0fd('0xd')][_0xa0fd('0xa7')](util[_0xa0fd('0x26')](_0xa0fd('0x1a0'),_0x3a2d25[_0xa0fd('0x13')]));this['sendMailMessage']['sync'](this,_0x3a2d25[_0xa0fd('0x1a1')],_0x47c31a);return this[_0xa0fd('0xd')][_0xa0fd('0xa7')](_0xa0fd('0x1a2'));};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0x1a3')]=function(_0xf2b24){logger[_0xa0fd('0x29')](util[_0xa0fd('0x26')](_0xa0fd('0x1a4'),_0xf2b24[_0xa0fd('0x35')]));return this[_0xa0fd('0xd')][_0xa0fd('0xa7')](_0xa0fd('0x1a5'));};AGIVertices[_0xa0fd('0xf')]['sendSMS']=function(_0x128b61){logger['info'](util[_0xa0fd('0x26')](_0xa0fd('0x1a6'),_0x128b61[_0xa0fd('0x35')]));if(!this['isConfigured'](_0x128b61[_0xa0fd('0x1a7')])){return this['channel'][_0xa0fd('0xa7')]('no\x20sms\x20account\x20configured');}var _0x2579de=this[_0xa0fd('0x1a8')][_0xa0fd('0x6d')](this,_0x128b61[_0xa0fd('0x1a7')]);if(!_0x2579de){return this[_0xa0fd('0xd')]['error'](_0x128b61,_0xa0fd('0x1a9'));}var _0x3dde5f={'body':_0x128b61[_0xa0fd('0x1aa')],'phone':_0x128b61['to']||'','SmsAccountId':_0x2579de['id']};logger[_0xa0fd('0xdf')](_0xa0fd('0x1ab'),JSON[_0xa0fd('0x70')](_0x3dde5f));this[_0xa0fd('0x33')][_0xa0fd('0x6d')](this,_0x128b61,_0x128b61[_0xa0fd('0x1a7')]);this[_0xa0fd('0xd')][_0xa0fd('0xa7')](util['format']('Trying\x20SendSMS\x20with\x20account\x20%s',_0x2579de[_0xa0fd('0x13')]));this[_0xa0fd('0x32')]['sync'](this,_0x3dde5f);return this[_0xa0fd('0xd')][_0xa0fd('0xa7')](_0xa0fd('0x1ac'));};AGIVertices['prototype'][_0xa0fd('0x1ad')]=function(_0x478038){logger[_0xa0fd('0x29')](util[_0xa0fd('0x26')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x478038[_0xa0fd('0x35')]));if(!this[_0xa0fd('0xa4')](_0x478038[_0xa0fd('0xd9')])){return this[_0xa0fd('0xd')]['error'](_0x478038,_0xa0fd('0x1ae'));}var _0x357903=this[_0xa0fd('0x10')][_0xa0fd('0x6d')](this,_0x478038[_0xa0fd('0xd9')]);if(!_0x357903){return this[_0xa0fd('0xd')][_0xa0fd('0x2f')](_0x478038,_0xa0fd('0x11e'));}return this[_0xa0fd('0xd')][_0xa0fd('0x9c')](_0x357903,_0x478038[_0xa0fd('0x1af')]);};AGIVertices[_0xa0fd('0xf')]['start']=function(_0x28abd9){logger[_0xa0fd('0x29')](util[_0xa0fd('0x26')](_0xa0fd('0x1b0'),_0x28abd9[_0xa0fd('0x35')]));this[_0xa0fd('0xd')][_0xa0fd('0xa7')](_0xa0fd('0x1b1'));var _0x3a8193=this['channel'][_0xa0fd('0x10')](_0xa0fd('0x1b2'));if(!_['isEmpty'](_0x3a8193[_0xa0fd('0xa0')])){this['channel'][_0xa0fd('0x34')]=_0x3a8193[_0xa0fd('0xa0')];}if(_0x28abd9[_0xa0fd('0xb5')]===_0xa0fd('0x1b3')){this[_0xa0fd('0xd')][_0xa0fd('0xa7')](_0xa0fd('0x1b4'));return this['channel'][_0xa0fd('0xb5')]();}return this[_0xa0fd('0xd')]['noop'](_0xa0fd('0x1b5'));};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0x1b6')]=function(_0x467a4e){logger['info'](util[_0xa0fd('0x26')](_0xa0fd('0x1b7'),_0x467a4e[_0xa0fd('0x35')]));if(!this[_0xa0fd('0xa4')](_0x467a4e[_0xa0fd('0x1b8')])){return this[_0xa0fd('0xd')][_0xa0fd('0x2f')](_0x467a4e,_0xa0fd('0x1b9'));}var _0x36ba6c=this[_0xa0fd('0x17')][_0xa0fd('0x6d')](this,_0x467a4e[_0xa0fd('0x1b8')]);if(!this[_0xa0fd('0xa4')](_0x36ba6c)){return this[_0xa0fd('0xd')][_0xa0fd('0x2f')](_0x467a4e,util[_0xa0fd('0x26')](_0xa0fd('0x1ba'),_0x467a4e[_0xa0fd('0x1b8')]));}if(_0x36ba6c===this[_0xa0fd('0xd')][_0xa0fd('0x37')]){return this[_0xa0fd('0xd')][_0xa0fd('0x2f')](_0x467a4e,_0xa0fd('0x1bb'));}this['createSquareDetailsReport'][_0xa0fd('0x6d')](this,_0x467a4e,_0x36ba6c);var _0x4f8331=this['channel'][_0xa0fd('0x51')](_0xa0fd('0x1bc'),util['format'](_0xa0fd('0x1bd'),config[_0xa0fd('0xb2')][_0xa0fd('0x1be')]||_0xa0fd('0x1bf'),_0x36ba6c,this[_0xa0fd('0xd')][_0xa0fd('0x37')]));if(_0x4f8331[_0xa0fd('0xa2')]===-0x1){return _0x4f8331;}return this['channel']['noop'](util[_0xa0fd('0x26')](_0xa0fd('0xc5'),_0xa0fd('0x1bc'),_0x36ba6c));};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0x1c0')]=function(_0x325cb6){logger[_0xa0fd('0x29')](util['format'](_0xa0fd('0x1c1'),_0x325cb6[_0xa0fd('0x35')]));var _0x433ea9=this[_0xa0fd('0x1c2')][_0xa0fd('0x6d')](this,_0x325cb6[_0xa0fd('0x1c3')]);this['createSquareDetailsReport'][_0xa0fd('0x6d')](this,_0x325cb6,_0x325cb6['command']);if(this[_0xa0fd('0xa4')](_0x325cb6[_0xa0fd('0xd9')])){var _0xa7a535=this[_0xa0fd('0x10')][_0xa0fd('0x6d')](this,_0x325cb6['variable_id']);if(_0xa7a535){this[_0xa0fd('0xd')][_0xa0fd('0x9c')](_0xa7a535,_0x433ea9);return this['channel'][_0xa0fd('0xa7')](util['format'](_0xa0fd('0x1c4'),_0x325cb6['command'],_0xa7a535));}}return this['channel'][_0xa0fd('0xa7')](util[_0xa0fd('0x26')](_0xa0fd('0x1c5'),_0x325cb6[_0xa0fd('0x1c3')]));};AGIVertices['prototype'][_0xa0fd('0x1c6')]=function(_0x5497bc){logger[_0xa0fd('0x29')](util[_0xa0fd('0x26')](_0xa0fd('0x1c7'),_0x5497bc['label']));_0x5497bc[_0xa0fd('0x57')]=_0x5497bc[_0xa0fd('0x57')][_0xa0fd('0x53')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xa0fd('0xa4')](_0x5497bc['apiKey'])){return this[_0xa0fd('0xd')][_0xa0fd('0xa7')](_0xa0fd('0x1c8'));}if(!this[_0xa0fd('0xa4')](_0x5497bc[_0xa0fd('0x57')])){return this[_0xa0fd('0xd')][_0xa0fd('0xa7')](_0xa0fd('0xea'));}this[_0xa0fd('0xd')][_0xa0fd('0xa7')](util[_0xa0fd('0x26')](_0xa0fd('0x1c9'),_0x5497bc[_0xa0fd('0x57')]));var _0x451f28=this[_0xa0fd('0x54')][_0xa0fd('0x6d')](this,_0x5497bc);if(_0x451f28){this[_0xa0fd('0xd')][_0xa0fd('0xa7')](util['format'](_0xa0fd('0x1ca'),_0x451f28));var _0x1c1ed8=this[_0xa0fd('0xd')][_0xa0fd('0x107')](_0x451f28);try{fs[_0xa0fd('0x108')](_0x451f28+_0xa0fd('0x109'));}catch(_0x3fbbd9){logger[_0xa0fd('0x2f')](_0x3fbbd9);}return _0x1c1ed8;}return this['channel'][_0xa0fd('0x2f')](_0x5497bc,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0xa0fd('0xf')]['tts']=function(_0x5066ce){logger[_0xa0fd('0x29')](util[_0xa0fd('0x26')](_0xa0fd('0x1cb'),_0x5066ce[_0xa0fd('0x35')]));_0x5066ce['text']=_0x5066ce[_0xa0fd('0x57')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xa0fd('0xa4')](_0x5066ce[_0xa0fd('0x57')])){return this[_0xa0fd('0xd')][_0xa0fd('0xa7')]('no\x20text\x20configured');}this[_0xa0fd('0xd')]['noop'](util[_0xa0fd('0x26')](_0xa0fd('0x1cc'),_0x5066ce[_0xa0fd('0x57')]));var _0xb6f230=this['googleTTS']['sync'](this,_0x5066ce);if(_0xb6f230){this['channel'][_0xa0fd('0xa7')](util[_0xa0fd('0x26')]('Google\x20TTS\x20%s\x20file\x20created',_0xb6f230));var _0x55d3e4=this[_0xa0fd('0xd')][_0xa0fd('0x107')](_0xb6f230);try{fs[_0xa0fd('0x108')](_0xb6f230+_0xa0fd('0x109'));}catch(_0xf14d25){logger[_0xa0fd('0x2f')](_0xf14d25);}return _0x55d3e4;}return this[_0xa0fd('0xd')][_0xa0fd('0x2f')](_0x5066ce,_0xa0fd('0x1cd'));};AGIVertices[_0xa0fd('0xf')]['unpause']=function(_0x45a67a){logger[_0xa0fd('0x29')](util[_0xa0fd('0x26')](_0xa0fd('0x1ce'),_0x45a67a['label']));if(!this['isConfigured'](_0x45a67a[_0xa0fd('0x15f')])){return this[_0xa0fd('0xd')][_0xa0fd('0x2f')](_0x45a67a,_0xa0fd('0x166'));}logger[_0xa0fd('0x29')](util['format'](_0xa0fd('0x160'),this[_0xa0fd('0xd')][_0xa0fd('0x39')],_0x45a67a['findBy']));var _0x2b4fd3=this[_0xa0fd('0x4b')][_0xa0fd('0x6d')](this,_0x45a67a[_0xa0fd('0x15f')]);if(_0x2b4fd3){logger[_0xa0fd('0x29')](util['format'](_0xa0fd('0x161'),this['channel'][_0xa0fd('0x39')],_0x45a67a[_0xa0fd('0x15f')]));this[_0xa0fd('0xd')][_0xa0fd('0xa7')](util[_0xa0fd('0x26')](_0xa0fd('0x161'),this[_0xa0fd('0xd')][_0xa0fd('0x39')],_0x45a67a['findBy']));return{'code':0xc8,'result':_0xa0fd('0x162')};}else{logger[_0xa0fd('0x29')](util[_0xa0fd('0x26')](_0xa0fd('0x163'),this[_0xa0fd('0xd')]['callerid'],_0x45a67a[_0xa0fd('0x15f')]));this[_0xa0fd('0xd')][_0xa0fd('0xa7')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xa0fd('0x39')],_0x45a67a[_0xa0fd('0x15f')]));return{'code':0xc8,'result':_0xa0fd('0x164')};}};AGIVertices[_0xa0fd('0xf')][_0xa0fd('0x1cf')]=function(_0x1504d1){logger[_0xa0fd('0x29')](util['format'](_0xa0fd('0x1d0'),_0x1504d1[_0xa0fd('0x35')]));var _0x40cd22=this[_0xa0fd('0xd')][_0xa0fd('0x51')](_0xa0fd('0x1d1'),[_0x1504d1[_0xa0fd('0x1d2')],_0x1504d1[_0xa0fd('0x75')]]);if(_0x40cd22[_0xa0fd('0xa2')]===-0x1){return _0x40cd22;}return this['channel'][_0xa0fd('0xa7')](util[_0xa0fd('0x26')](_0xa0fd('0xc5'),_0xa0fd('0x1d1'),_0x1504d1['mailbox']));};AGIVertices['prototype'][_0xa0fd('0x1d3')]=function(_0x349e85){logger[_0xa0fd('0x29')](util['format'](_0xa0fd('0x1d4'),_0x349e85[_0xa0fd('0x35')]));if(!this[_0xa0fd('0xa4')](_0x349e85[_0xa0fd('0xd9')])){return this[_0xa0fd('0xd')][_0xa0fd('0x2f')](_0x349e85,_0xa0fd('0x1ae'));}var _0x4f099f=this[_0xa0fd('0x10')][_0xa0fd('0x6d')](this,_0x349e85['variable_id']);if(!_0x4f099f){return this[_0xa0fd('0xd')]['error'](_0x349e85,_0xa0fd('0x11e'));}var _0x122cad=this['channel']['getVariable'](_0x4f099f);return{'code':0xc8,'result':_0x122cad[_0xa0fd('0xa0')]?_0x122cad[_0xa0fd('0xa0')]:'-'};};String['prototype'][_0xa0fd('0x9f')]=function(_0x36287,_0x4d804e){return this[_0xa0fd('0x9e')](_0x36287)[_0xa0fd('0x1d5')](_0x4d804e);};module[_0xa0fd('0x1d6')]=AGIVertices; \ No newline at end of file +var _0x7d9f=['dialogflowV2_project_id','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_region','aws_text_type','awsLex','aws_secret_access_key','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clone','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','hasOwnProperty','isPlainObject','isArray','length','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','getAndSetVariable','result','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','label','noop','no\x20text\x20configured','exec','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Enter\x20in\x20AGI\x20(%s)\x20block','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','minutes','callback_priority','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','lumenvoxtts','sestektts','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','MRCPRecog','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','keys','forEach','%s_ROWS_COUNT','variable\x20%s\x20set','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','SIP/%s','Executed\x20command\x20%s','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','googleDialogflow','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','client_email','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','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','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','.wav','SestekNDA\x20Result\x20%s','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','getData','response','maxdigit','test','mindigit','hiddendigitsnum','generate','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','unlink','ispeech\x20TTS\x20is\x20unreachable','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','menu','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','opts','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','macro','gosub','position','QUEUE','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','no\x20mail\x20account\x20configured','account_id','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','Smtp','bcc','subject','template_id','debug','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','XMCS-UNIQUEID','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project_id','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','127.0.0.1','Executed\x20command\x20%s\x20%s','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','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','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','exports','util','lodash','shelljs','odbc','randomstring','mustache','request-promise','../../config/logger','agi','../../config/environment','rawHeaders','rawBody','getdigits','getsecretdigits','channel','rpc','getVariable','then','name','catch','prototype','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbcById','dsn','getUser','getSound','getSoundPath','save_name','getMailAccount','sendMailMessage','getIntervals','getIntervalById','IntervalId','Intervals','interval','format','%s/sounds/converted/%s','getQueryOdbc','open','error','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','getSmsAccount','createSmsMessage','createSquareDetailsReport','agicommand','arg_1','callerid','createSquareRecording','uniqueid','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','callback_','random','lastName','isNil','phone','list_id','callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','number','includes','POST','toUpperCase','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','headers','stringify','body','parse','statusMessage','statusCode','message','options','key','dialogflow_language','googleDialogflowV2'];(function(_0x1ca3f6,_0x5a587c){var _0x140af4=function(_0x4e224b){while(--_0x4e224b){_0x1ca3f6['push'](_0x1ca3f6['shift']());}};_0x140af4(++_0x5a587c);}(_0x7d9f,0x15c));var _0xf7d9=function(_0x20cf0c,_0x14259b){_0x20cf0c=_0x20cf0c-0x0;var _0x4a5336=_0x7d9f[_0x20cf0c];return _0x4a5336;};'use strict';var fs=require('fs');var util=require(_0xf7d9('0x0'));var _=require(_0xf7d9('0x1'));var sh=require(_0xf7d9('0x2'));var odbc=require(_0xf7d9('0x3'))();var rs=require(_0xf7d9('0x4'));var moment=require('moment');var Mustache=require(_0xf7d9('0x5'));var rp=require(_0xf7d9('0x6'));var logger=require(_0xf7d9('0x7'))(_0xf7d9('0x8'));var config=require(_0xf7d9('0x9'));var scripts=require('./scripts');var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0xf7d9('0xa'),_0xf7d9('0xb')];var verticesWithRetry=['menu',_0xf7d9('0xc'),_0xf7d9('0xd')];var AGIVertices=function(_0x5e4087,_0x572d51,_0x4cd620){this[_0xf7d9('0xe')]=_0x5e4087;this[_0xf7d9('0xf')]=_0x572d51;this['mailRpc']=_0x4cd620;};AGIVertices['prototype'][_0xf7d9('0x10')]=function(_0x90a7f9,_0x2a14e2){this['rpc']['getVariableById'](_0x90a7f9)[_0xf7d9('0x11')](function(_0x2db1c9){_0x2a14e2(null,_0x2db1c9?_0x2db1c9[_0xf7d9('0x12')]:![]);})[_0xf7d9('0x13')](function(_0x594dfe){_0x2a14e2(_0x594dfe);});};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x15')]=function(_0x22787d,_0x403859){this['rpc'][_0xf7d9('0x16')](_0x22787d)[_0xf7d9('0x11')](function(_0x296348){_0x403859(null,_0x296348?_0x296348[_0xf7d9('0x12')]:![]);})['catch'](function(_0x405ed4){_0x403859(_0x405ed4);});};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x17')]=function(_0x4c1972,_0x539ea7){this[_0xf7d9('0xf')][_0xf7d9('0x18')](_0x4c1972)[_0xf7d9('0x11')](function(_0x5d1098){_0x539ea7(null,_0x5d1098?_0x5d1098[_0xf7d9('0x12')]:![]);})[_0xf7d9('0x13')](function(_0x5eb7c9){_0x539ea7(_0x5eb7c9);});};AGIVertices[_0xf7d9('0x14')]['getSquareOdbc']=function(_0x377b67,_0x1bbc77){this['rpc'][_0xf7d9('0x19')](_0x377b67)[_0xf7d9('0x11')](function(_0x896c61){_0x1bbc77(null,_0x896c61?_0x896c61[_0xf7d9('0x1a')]:![]);})[_0xf7d9('0x13')](function(_0x23e297){_0x1bbc77(_0x23e297);});};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x1b')]=function(_0x5d2ab3,_0x5e96df){this[_0xf7d9('0xf')]['getUserById'](_0x5d2ab3)[_0xf7d9('0x11')](function(_0x44adbf){_0x5e96df(null,_0x44adbf?_0x44adbf['name']:![]);})[_0xf7d9('0x13')](function(_0x27ba8c){_0x5e96df(_0x27ba8c);});};AGIVertices['prototype']['getTrunk']=function(_0x19d595,_0x2d6ad6){this[_0xf7d9('0xf')]['getTrunkById'](_0x19d595)[_0xf7d9('0x11')](function(_0x496ab7){_0x2d6ad6(null,_0x496ab7?_0x496ab7[_0xf7d9('0x12')]:![]);})[_0xf7d9('0x13')](function(_0x144ae2){_0x2d6ad6(_0x144ae2);});};AGIVertices['prototype'][_0xf7d9('0x1c')]=function(_0x3218bb,_0x2e52){var _0xf9373a=this;this[_0xf7d9('0xf')]['getSoundById'](_0x3218bb)[_0xf7d9('0x11')](function(_0x3847ff){_0x2e52(null,_0x3847ff?_0xf9373a[_0xf7d9('0x1d')](_0x3847ff[_0xf7d9('0x1e')]):![]);})['catch'](function(_0x20315e){_0x2e52(_0x20315e);});};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x1f')]=function(_0x198402,_0xef45cc){this[_0xf7d9('0xf')]['getMailAccountById'](_0x198402)['then'](function(_0x5a673a){_0xef45cc(null,_0x5a673a?_0x5a673a:![]);})[_0xf7d9('0x13')](function(_0x4dcaab){_0xef45cc(_0x4dcaab);});};AGIVertices[_0xf7d9('0x14')]['sendMailMessage']=function(_0x3ecbb9,_0x59c246,_0x4ecfbd){this['mailRpc'][_0xf7d9('0x20')](_0x3ecbb9,_0x59c246)['then'](function(){_0x4ecfbd(null);})[_0xf7d9('0x13')](function(_0x27e314){_0x4ecfbd(_0x27e314);});};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x21')]=function(_0x1ff3e3,_0x86a7a1){this[_0xf7d9('0xf')][_0xf7d9('0x22')](_0x1ff3e3)['then'](function(_0x200d72){if(_0x200d72){if(_0x200d72[_0xf7d9('0x23')]){_0x86a7a1(null,[_0x200d72['interval']]);}else{_0x86a7a1(null,_['map'](_0x200d72[_0xf7d9('0x24')],_0xf7d9('0x25')));}}else{_0x86a7a1(null,![]);}})[_0xf7d9('0x13')](function(_0x5301a8){_0x86a7a1(_0x5301a8);});};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x1d')]=function(_0x40e6f7){return util[_0xf7d9('0x26')](_0xf7d9('0x27'),FILES_PATH,_0x40e6f7);};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x28')]=function(_0x1280fa,_0x447508,_0x1c42bb){odbc[_0xf7d9('0x29')](_0x1280fa,function(_0x4cf26d){if(_0x4cf26d){logger[_0xf7d9('0x2a')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x4cf26d);_0x1c42bb(_0x4cf26d);}else{logger[_0xf7d9('0x2b')](_0xf7d9('0x2c'));odbc[_0xf7d9('0x2d')](_0x447508,function(_0x3ce3be,_0x562b3e){if(_0x3ce3be){logger['info'](_0xf7d9('0x2e'),_0x447508);_0x1c42bb(_0x3ce3be);}else{logger['info'](_0xf7d9('0x2f'),_0x447508);odbc[_0xf7d9('0x30')](function(_0x4067dd){if(_0x4067dd){logger[_0xf7d9('0x2a')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x4067dd);}_0x1c42bb(null,_0x562b3e);});}});}});};AGIVertices['prototype'][_0xf7d9('0x31')]=function(_0x410c72,_0x148872){this[_0xf7d9('0xf')]['getSmsAccountById'](_0x410c72)[_0xf7d9('0x11')](function(_0xd6d84f){_0x148872(null,_0xd6d84f?_0xd6d84f:![]);})[_0xf7d9('0x13')](function(_0x33e692){_0x148872(_0x33e692);});};AGIVertices[_0xf7d9('0x14')]['createSmsMessage']=function(_0x28c932,_0x6fc249){this[_0xf7d9('0xf')][_0xf7d9('0x32')](_0x28c932)[_0xf7d9('0x11')](function(_0x373472){_0x6fc249(null,_0x373472);})[_0xf7d9('0x13')](function(_0xf66431){_0x6fc249(_0xf66431);});};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x33')]=function(_0x2a349b,_0x46b7d4,_0x590d03){this[_0xf7d9('0xf')][_0xf7d9('0x33')]({'uniqueid':this['channel']['uniqueid'],'node':_0x2a349b['label'],'application':_0x2a349b[_0xf7d9('0x34')],'data':_0x46b7d4||null,'project_name':this['channel'][_0xf7d9('0x35')],'callerid':this[_0xf7d9('0xe')][_0xf7d9('0x36')]})[_0xf7d9('0x11')](function(_0x468234){if(_0x590d03){_0x590d03(null,_0x468234);}})['catch'](function(_0x30a1ef){if(_0x590d03){_0x590d03(_0x30a1ef);}});};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x37')]=function(_0x4651fc,_0x37f6be,_0x5582a7,_0x556f7e){this[_0xf7d9('0xf')][_0xf7d9('0x37')]({'uniqueid':this[_0xf7d9('0xe')][_0xf7d9('0x38')],'callerid':this[_0xf7d9('0xe')]['callerid'],'calleridname':this[_0xf7d9('0xe')]['calleridname'],'context':this[_0xf7d9('0xe')][_0xf7d9('0x39')],'extension':this[_0xf7d9('0xe')][_0xf7d9('0x3a')],'priority':this[_0xf7d9('0xe')][_0xf7d9('0x3b')],'accountcode':this[_0xf7d9('0xe')][_0xf7d9('0x3c')],'dnid':this[_0xf7d9('0xe')][_0xf7d9('0x3d')],'projectName':this[_0xf7d9('0xe')][_0xf7d9('0x35')],'saveName':_0x37f6be,'filename':_0x4651fc[_0xf7d9('0x3e')]||_0x37f6be,'savePath':_0x5582a7})[_0xf7d9('0x11')](function(_0x50731a){_0x556f7e(null,_0x50731a);})[_0xf7d9('0x13')](function(_0x1f1ee5){_0x556f7e(_0x1f1ee5);});};AGIVertices['prototype']['createSquareMessage']=function(_0x3c1341,_0x540e0e,_0x51ba8a,_0x333dc9,_0x1dae4b){this[_0xf7d9('0xf')][_0xf7d9('0x3f')]({'uniqueid':this[_0xf7d9('0xe')][_0xf7d9('0x38')],'body':_0x3c1341,'direction':_0x540e0e,'providerName':_0x51ba8a,'providerResponse':_0x333dc9})[_0xf7d9('0x11')](function(_0x446234){if(_0x1dae4b){_0x1dae4b(null,_0x446234);}})[_0xf7d9('0x13')](function(_0x200e07){if(_0x1dae4b){_0x1dae4b(_0x200e07);}});};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x40')]=function(_0x5a44a7,_0x48076b){this[_0xf7d9('0xf')][_0xf7d9('0x40')]({'firstName':_[_0xf7d9('0x41')](_0x5a44a7[_0xf7d9('0x12')])||_['isNil'](_0x5a44a7[_0xf7d9('0x12')])?_0xf7d9('0x42')+Math[_0xf7d9('0x43')]():_0x5a44a7[_0xf7d9('0x12')],'lastName':_[_0xf7d9('0x41')](_0x5a44a7[_0xf7d9('0x44')])||_[_0xf7d9('0x45')](_0x5a44a7[_0xf7d9('0x44')])?null:_0x5a44a7[_0xf7d9('0x44')],'phone':_0x5a44a7[_0xf7d9('0x46')],'ListId':_0x5a44a7[_0xf7d9('0x47')],'scheduledat':_0x5a44a7['scheduledAt'],'callbackUniqueid':this[_0xf7d9('0xe')][_0xf7d9('0x38')],'tags':_0xf7d9('0x48'),'description':_0xf7d9('0x49')+_0x5a44a7[_0xf7d9('0x4a')][_0xf7d9('0x4b')](),'priority':_0x5a44a7['callback_priority']})[_0xf7d9('0x11')](function(_0x404110){_0x48076b(null,_0x404110);})[_0xf7d9('0x13')](function(_0x3d839d){_0x48076b(_0x3d839d);});};AGIVertices[_0xf7d9('0x14')]['getPause']=function(_0x8b6b10,_0x12942d){this[_0xf7d9('0xf')][_0xf7d9('0x4c')](_0x8b6b10)[_0xf7d9('0x11')](function(_0x379f88){_0x12942d(null,_0x379f88?_0x379f88[_0xf7d9('0x12')]:![]);})[_0xf7d9('0x13')](function(_0x3189f0){_0x12942d(_0x3189f0);});};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x4d')]=function(_0x1e98fb,_0x1f763e,_0x2adf9c){var _0x125dc7={'role':_0xf7d9('0x4e')};_0x125dc7[_0x1e98fb]=this['channel'][_0xf7d9('0x36')];this[_0xf7d9('0xf')]['agentPause'](_0x125dc7,_0x1f763e,this[_0xf7d9('0xe')][_0xf7d9('0x38')])[_0xf7d9('0x11')](function(_0xac8342){_0x2adf9c(null,_[_0xf7d9('0x45')](_0xac8342)?![]:!![]);})['catch'](function(_0xb17352){logger[_0xf7d9('0x2a')](_0xb17352);_0x2adf9c(null,![]);});};AGIVertices['prototype'][_0xf7d9('0x4f')]=function(_0x1f2378,_0x5cc42e){var _0x45d998={'role':_0xf7d9('0x4e')};_0x45d998[_0x1f2378]=this[_0xf7d9('0xe')]['callerid'];this['rpc']['agentUnpause'](_0x45d998)[_0xf7d9('0x11')](function(_0x51b3b6){_0x5cc42e(null,_[_0xf7d9('0x45')](_0x51b3b6)?![]:!![]);})['catch'](function(_0x5d5b57){logger[_0xf7d9('0x2a')](_0x5d5b57);_0x5cc42e(null,![]);});};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x50')]=function(_0x3f2826,_0x1a5349){var _0x226cba={'role':'agent'};_0x226cba[_0x3f2826]=this[_0xf7d9('0xe')]['callerid'];this[_0xf7d9('0xf')][_0xf7d9('0x50')](_0x226cba)[_0xf7d9('0x11')](function(_0x1f76d7){_0x1a5349(null,_[_0xf7d9('0x45')](_0x1f76d7)?![]:!![]);})[_0xf7d9('0x13')](function(_0x1088d5){logger['error'](_0x1088d5);_0x1a5349(null,![]);});};AGIVertices['prototype'][_0xf7d9('0x51')]=function(_0x184e02,_0x4d7dfe){var _0x2595e4={'role':_0xf7d9('0x4e')};_0x2595e4[_0x184e02]=this['channel'][_0xf7d9('0x36')];var _0xc4856=_0x184e02!=_0xf7d9('0x52')?util[_0xf7d9('0x26')](_0xf7d9('0x53'),_0xf7d9('0x54'),this['channel'][_0xf7d9('0x36')]):undefined;this[_0xf7d9('0xf')]['agentLogin'](_0x2595e4,_0xc4856)[_0xf7d9('0x11')](function(_0x5c1be8){_0x4d7dfe(null,_[_0xf7d9('0x45')](_0x5c1be8)?![]:!![]);})[_0xf7d9('0x13')](function(_0x5a6c01){logger['error'](_0x5a6c01);_0x4d7dfe(null,![]);});};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x55')]=function(_0x128ce2,_0x1e56f4){sh['exec'](_[_0xf7d9('0x56')](_0x128ce2),function(_0x120ec9,_0x27b983){var _0x272088=_0x27b983[_0xf7d9('0x57')](/(\r\n|\n|\r)/gm,'');_0x1e56f4(null,_0x272088);});};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x58')]=function(_0x376738,_0x1730de){scripts[_0xf7d9('0x58')](_0x376738[_0xf7d9('0x59')],_0x376738[_0xf7d9('0x5a')]||'text',_0x376738[_0xf7d9('0x5b')],_0x376738[_0xf7d9('0x5c')]||_0xf7d9('0x5d'),_0x376738['ssmlGender']||_0xf7d9('0x5e'),_0x376738[_0xf7d9('0x5f')]||_0xf7d9('0x60'))[_0xf7d9('0x11')](function(_0xba0145){_0x1730de(null,_0xba0145);})[_0xf7d9('0x13')](function(_0x2d76c0){_0x1730de(_0x2d76c0);});};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x61')]=function(_0x2bbd27,_0x516658){scripts[_0xf7d9('0x61')](_0x2bbd27[_0xf7d9('0x5b')],_0x2bbd27[_0xf7d9('0x62')]||'en',0x1)[_0xf7d9('0x11')](function(_0x305fcf){_0x516658(null,_0x305fcf);})[_0xf7d9('0x13')](function(_0x296319){_0x516658(_0x296319);});};AGIVertices['prototype'][_0xf7d9('0x63')]=function(_0x559ee7,_0x486994){var _0x7e094c={'uri':_0x559ee7[_0xf7d9('0x64')],'method':_0x559ee7[_0xf7d9('0x65')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x559ee7[_0xf7d9('0x66')])===_0xf7d9('0x67')&&parseInt(_0x559ee7[_0xf7d9('0x66')])>=0x1?parseInt(_0x559ee7[_0xf7d9('0x66')])*0x3e8:0x5*0x3e8};if(_[_0xf7d9('0x68')]([_0xf7d9('0x69'),'PUT'],_0x7e094c[_0xf7d9('0x65')][_0xf7d9('0x6a')]())){try{_0x7e094c['body']=_0x559ee7['rawBody']?JSON['parse'](_0x559ee7['rawBody']):{};}catch(_0x4dadb2){logger[_0xf7d9('0x2a')](_0xf7d9('0x6b'),_0x4dadb2);}}try{_0x7e094c['headers']=_0x559ee7[_0xf7d9('0xa')]?JSON['parse'](_0x559ee7[_0xf7d9('0xa')]):{};}catch(_0x4aad70){logger[_0xf7d9('0x2a')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x4aad70);}if(_0x559ee7[_0xf7d9('0x6c')]){try{var _0x4abd04=require(_0x559ee7[_0xf7d9('0x6c')])[_0xf7d9('0x6d')](this,_0x7e094c);_0x7e094c[_0xf7d9('0x6e')]=Mustache[_0xf7d9('0x6f')](_0x559ee7[_0xf7d9('0x64')],_0x4abd04,{},['$$','$$']);if(_0x7e094c['headers']){_0x7e094c[_0xf7d9('0x70')]=JSON['parse'](Mustache[_0xf7d9('0x6f')](JSON[_0xf7d9('0x71')](_0x7e094c['headers']),_0x4abd04,{},['$$','$$']));}if(_0x7e094c[_0xf7d9('0x72')]){_0x7e094c['body']=JSON[_0xf7d9('0x73')](Mustache[_0xf7d9('0x6f')](JSON[_0xf7d9('0x71')](_0x7e094c['body']),_0x4abd04,{},['$$','$$']));}}catch(_0x1b97cc){logger['error']('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x1b97cc);}}rp(_0x7e094c)[_0xf7d9('0x11')](function(_0x5a0d13){var _0x11bff3={'statusCode':_0x5a0d13['statusCode']||0xc8,'statusMessage':_0x5a0d13[_0xf7d9('0x74')]||'OK','headers':_0x5a0d13[_0xf7d9('0x70')]||{},'body':_0x5a0d13[_0xf7d9('0x72')]||{}};_0x486994(null,_0x11bff3);})[_0xf7d9('0x13')](function(_0x340793){var _0x755fda={'statusCode':_0x340793[_0xf7d9('0x75')]||0x1f4,'statusMessage':_0x340793[_0xf7d9('0x76')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x340793[_0xf7d9('0x77')][_0xf7d9('0x70')]||{},'body':_0x340793['options'][_0xf7d9('0x72')]||{}};_0x486994(null,_0x755fda);});};AGIVertices['prototype']['googleDialogflow']=function(_0x2bf903,_0x3e16b0){scripts['googleDialogflow'](this[_0xf7d9('0xe')][_0xf7d9('0x38')],_0x2bf903[_0xf7d9('0x78')],_0x2bf903[_0xf7d9('0x5b')],_0x2bf903[_0xf7d9('0x79')]||'en')[_0xf7d9('0x11')](function(_0x429da0){_0x3e16b0(null,_0x429da0);})[_0xf7d9('0x13')](function(_0x412c91){_0x3e16b0(_0x412c91);});};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x7a')]=function(_0x3461c0,_0x2cc0f9){scripts[_0xf7d9('0x7a')](this[_0xf7d9('0xe')][_0xf7d9('0x38')],_0x3461c0[_0xf7d9('0x7b')],_0x3461c0['client_email'],_0x3461c0[_0xf7d9('0x7c')],_0x3461c0[_0xf7d9('0x5b')],_0x3461c0[_0xf7d9('0x7d')]||'en')[_0xf7d9('0x11')](function(_0x1836ca){_0x2cc0f9(null,_0x1836ca);})[_0xf7d9('0x13')](function(_0x36931b){_0x2cc0f9(_0x36931b);});};AGIVertices['prototype'][_0xf7d9('0x7e')]=function(_0x149982,_0x3d93c1){scripts[_0xf7d9('0x7e')](this[_0xf7d9('0xe')],_0x149982)['then'](function(_0x194c91){_0x3d93c1(null,_0x194c91);})[_0xf7d9('0x13')](function(_0x533598){_0x3d93c1(_0x533598);});};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x7f')]=function(_0x1d2533,_0x4edf55){scripts[_0xf7d9('0x7f')](_0x1d2533[_0xf7d9('0x78')],_0x1d2533[_0xf7d9('0x5b')],_0x1d2533[_0xf7d9('0x80')]||_0xf7d9('0x5d'),_0x1d2533[_0xf7d9('0x81')])[_0xf7d9('0x11')](function(_0x4354c2){_0x4edf55(null,_0x4354c2);})[_0xf7d9('0x13')](function(_0x33c1e6){_0x4edf55(_0x33c1e6);});};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x82')]=function(_0x4bc2bc,_0xe6b589,_0x2bdad1){scripts[_0xf7d9('0x82')](_0xe6b589,_0x4bc2bc[_0xf7d9('0x78')],_0x4bc2bc['ispeech_asr_language']||_0xf7d9('0x5d'),this[_0xf7d9('0x83')](_0x4bc2bc[_0xf7d9('0x84')])?_0x4bc2bc[_0xf7d9('0x84')]:undefined)[_0xf7d9('0x11')](function(_0x57303b){_0x2bdad1(null,_0x57303b);})[_0xf7d9('0x13')](function(_0x2d0d81){_0x2bdad1(_0x2d0d81);});};AGIVertices['prototype'][_0xf7d9('0x85')]=function(_0x17e1fd,_0x11488a){scripts[_0xf7d9('0x85')](_0x17e1fd[_0xf7d9('0x86')],_0x17e1fd['aws_secret_access_key'],_0x17e1fd[_0xf7d9('0x87')],_0x17e1fd['aws_polly_voice']||'Amy',_0x17e1fd[_0xf7d9('0x5b')],_0x17e1fd[_0xf7d9('0x88')]||_0xf7d9('0x5b'))[_0xf7d9('0x11')](function(_0x30d652){_0x11488a(null,_0x30d652);})[_0xf7d9('0x13')](function(_0x45abfc){_0x11488a(_0x45abfc);});};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x89')]=function(_0x4b6b2b,_0x353cfc){scripts[_0xf7d9('0x89')](this[_0xf7d9('0xe')]['uniqueid'],_0x4b6b2b[_0xf7d9('0x86')],_0x4b6b2b[_0xf7d9('0x8a')],_0x4b6b2b[_0xf7d9('0x8b')],_0x4b6b2b[_0xf7d9('0x5b')],_0x4b6b2b[_0xf7d9('0x8c')])[_0xf7d9('0x11')](function(_0x49f586){_0x353cfc(null,_0x49f586);})['catch'](function(_0x21c05c){_0x353cfc(_0x21c05c);});};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x8d')]=function(_0x12f944,_0x49ab3c,_0x2c1710){scripts[_0xf7d9('0x8d')](_0x49ab3c,_0x12f944['key'],_0x12f944[_0xf7d9('0x8e')]||_0xf7d9('0x5d'))['then'](function(_0x2a3f19){_0x2c1710(null,_0x2a3f19);})['catch'](function(_0x44ec79){_0x2c1710(_0x44ec79);});};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x8f')]=function(_0x3f6310,_0x265d82,_0x43fcac){scripts[_0xf7d9('0x8f')](_0x265d82,_0x3f6310[_0xf7d9('0x90')],_0x3f6310[_0xf7d9('0x91')],_0x3f6310[_0xf7d9('0x6e')])[_0xf7d9('0x11')](function(_0x1cf7cd){_0x43fcac(null,_0x1cf7cd);})[_0xf7d9('0x13')](function(_0x4499f9){_0x43fcac(_0x4499f9);});};AGIVertices['prototype']['clear']=function(_0x2fb42b){var _0x206f39=_[_0xf7d9('0x68')](verticesWithRetry,_0x2fb42b['agicommand'])?_0x2fb42b:_[_0xf7d9('0x92')](_0x2fb42b);for(var _0x56800b in _0x206f39){if(_0x206f39['hasOwnProperty'](_0x56800b)){if(_0x206f39[_0x56800b]&&_[_0xf7d9('0x93')](_0x206f39[_0x56800b])){if(_[_0xf7d9('0x68')](recursiveMapAttributes,_0x56800b)){_0x206f39[_0x56800b]=this[_0xf7d9('0x94')](_0x206f39[_0x56800b]);}else{_0x206f39[_0x56800b]=this[_0xf7d9('0x95')](_0x206f39[_0x56800b]);}}}}return _0x206f39;};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x96')]=function(_0x1baad5){for(var _0x4a3e07 in _0x1baad5){if(_0x1baad5[_0xf7d9('0x97')](_0x4a3e07)){if(_[_0xf7d9('0x98')](_0x1baad5[_0x4a3e07])){this['recursiveNodeIndex'](_0x1baad5[_0x4a3e07]);}else if(_[_0xf7d9('0x99')](_0x1baad5[_0x4a3e07])){for(var _0x902b98=0x0;_0x902b98<_0x1baad5[_0x4a3e07][_0xf7d9('0x9a')];_0x902b98++){this[_0xf7d9('0x96')](_0x1baad5[_0x4a3e07][_0x902b98]);}}else if(_['isString'](_0x1baad5[_0x4a3e07])){_0x1baad5[_0x4a3e07]=this[_0xf7d9('0x95')](_0x1baad5[_0x4a3e07]);}}}};AGIVertices['prototype'][_0xf7d9('0x9b')]=function(_0x1cb17b,_0x5318f3){for(var _0x3bf90c in _0x1cb17b){if(_0x1cb17b['hasOwnProperty'](_0x3bf90c)){if(_['isPlainObject'](_0x1cb17b[_0x3bf90c])){if(!_[_0xf7d9('0x41')](_0x1cb17b[_0x3bf90c])){this[_0xf7d9('0x9b')](_0x1cb17b[_0x3bf90c],util[_0xf7d9('0x26')](_0xf7d9('0x9c'),_0x5318f3,_0x3bf90c));}}else if(_[_0xf7d9('0x99')](_0x1cb17b[_0x3bf90c])){for(var _0x431514=0x0;_0x431514<_0x1cb17b[_0x3bf90c][_0xf7d9('0x9a')];_0x431514++){this[_0xf7d9('0x9b')](_0x1cb17b[_0x3bf90c][_0x431514],util['format']('%s.%s',_0x5318f3,_0x3bf90c+'['+_0x431514+']'));}}else{if(!_['isNil'](_0x1cb17b[_0x3bf90c])){this['channel'][_0xf7d9('0x9d')](util[_0xf7d9('0x26')]('%s.%s',_0x5318f3,_0x3bf90c),_0x1cb17b[_0x3bf90c]);}}}}};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x94')]=function(_0x336f91){try{var _0x1046ad=JSON[_0xf7d9('0x73')](_0x336f91);this[_0xf7d9('0x96')](_0x1046ad);return JSON[_0xf7d9('0x71')](_0x1046ad);}catch(_0x3bfbd1){return this['replaceAllVariables'](_0x336f91);}};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x95')]=function(_0x3296dc){var _0x2517cd=_0x3296dc['split']('{');for(var _0x40f545=0x1;_0x40f545<_0x2517cd['length'];_0x40f545+=0x1){var _0x553e71=_0x2517cd[_0x40f545][_0xf7d9('0x9e')]('}');if(_0x553e71['length']>0x1){_0x3296dc=_0x3296dc[_0xf7d9('0x9f')]('{'+_0x553e71[0x0]+'}',this[_0xf7d9('0xe')]['getVariable'](_0x553e71[0x0])[_0xf7d9('0xa0')]||_0x553e71[0x0]);}}if(_0x2517cd[_0xf7d9('0x9a')]===0x1){return _0x3296dc[_0xf7d9('0x4b')]();}return this[_0xf7d9('0x95')](_0x3296dc);};AGIVertices['prototype'][_0xf7d9('0xa1')]=function(_0x33a3e5,_0x56f5f2){var _0x584d6d=this['channel']['getVariable'](_0x33a3e5);if(_0x584d6d[_0xf7d9('0xa2')]===-0x1){return _0x584d6d;}logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x56f5f2,_0x584d6d['extra']));return this['channel'][_0xf7d9('0x9d')](_0x56f5f2,_0x584d6d[_0xf7d9('0xa0')]);};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x83')]=function(_0x411db8){return _0x411db8&&_0x411db8!=='0'&&_0x411db8!=='-1'&&_0x411db8!=='';};AGIVertices['prototype'][_0xf7d9('0xa3')]=function(_0x58f87d){this[_0xf7d9('0x33')]['sync'](this,_0x58f87d,'-');_0x58f87d[_0xf7d9('0xa4')]=_0x58f87d[_0xf7d9('0xa3')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0xa5')]=function(_0x354f93){logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')](_0xf7d9('0xa6'),_0x354f93[_0xf7d9('0xa7')]));if(!this[_0xf7d9('0x83')](_0x354f93[_0xf7d9('0x5b')])){return this['channel'][_0xf7d9('0xa8')](_0xf7d9('0xa9'));}var _0x510d17='\x22'+_0x354f93[_0xf7d9('0x5b')]+'\x22';if(this[_0xf7d9('0x83')](_0x354f93['options'])){_0x510d17+=','+_0x354f93['options'];}var _0x5b3bbc=this[_0xf7d9('0xe')][_0xf7d9('0xaa')](_0xf7d9('0xab'),_0x510d17);if(_0x5b3bbc['result']===-0x1){return _0x5b3bbc;}return this['channel'][_0xf7d9('0xa8')](util[_0xf7d9('0x26')](_0xf7d9('0xac'),_0x510d17));};AGIVertices[_0xf7d9('0x14')]['mrcprecog']=function(_0x31991e){logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')](_0xf7d9('0xad'),_0x31991e[_0xf7d9('0xa7')]));if(!this[_0xf7d9('0x83')](_0x31991e[_0xf7d9('0xae')])){return this['channel'][_0xf7d9('0xa8')](_0xf7d9('0xaf'));}var _0x19a1ff=_0x31991e['grammar'];if(this['isConfigured'](_0x31991e[_0xf7d9('0x77')])){_0x19a1ff+=','+_0x31991e['options'];}var _0x44d586=this[_0xf7d9('0xe')][_0xf7d9('0xaa')]('MRCPRecog',_0x19a1ff);if(_0x44d586[_0xf7d9('0xa2')]===-0x1){return _0x44d586;}var _0x4649bd=this[_0xf7d9('0xa1')](_0xf7d9('0xb0'),_0xf7d9('0xb1'));if(_0x4649bd[_0xf7d9('0xa2')]===-0x1){return _0x4649bd;}var _0x235e8b=this[_0xf7d9('0xa1')](_0xf7d9('0xb2'),_0xf7d9('0xb3'));if(_0x235e8b[_0xf7d9('0xa2')]===-0x1){return _0x235e8b;}var _0x43e143=this[_0xf7d9('0xa1')](_0xf7d9('0xb4'),_0xf7d9('0xb5'));if(_0x43e143[_0xf7d9('0xa2')]===-0x1){return _0x43e143;}return this[_0xf7d9('0xe')]['noop'](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x19a1ff));};AGIVertices['prototype'][_0xf7d9('0x8')]=function(_0x2357bf){logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')](_0xf7d9('0xb6'),_0x2357bf[_0xf7d9('0xa7')]));return this[_0xf7d9('0xe')]['agi']([_0x2357bf['command'],_0x2357bf[_0xf7d9('0xb7')]]);};AGIVertices[_0xf7d9('0x14')]['answer']=function(_0x4ae1c4){logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')](_0xf7d9('0xb8'),_0x4ae1c4['label']));if(this[_0xf7d9('0x83')](_0x4ae1c4[_0xf7d9('0x66')])){logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')](_0xf7d9('0xb9'),_0x4ae1c4[_0xf7d9('0x66')]));var _0x305d2c=this['channel'][_0xf7d9('0xba')](_0x4ae1c4[_0xf7d9('0x66')]);if(_0x305d2c[_0xf7d9('0xa2')]===-0x1){return _0x305d2c;}}return this['channel'][_0xf7d9('0xbb')]();};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x48')]=function(_0x4fcf18){logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')](_0xf7d9('0xbc'),_0x4fcf18[_0xf7d9('0xa7')]));if(!this[_0xf7d9('0x83')](_0x4fcf18[_0xf7d9('0x47')])){return this['channel'][_0xf7d9('0x2a')](_0x4fcf18,_0xf7d9('0xbd'));}_0x4fcf18[_0xf7d9('0x4a')]=moment();if(this[_0xf7d9('0x83')](_0x4fcf18[_0xf7d9('0xbe')])){_0x4fcf18[_0xf7d9('0x4a')]=moment()['add'](_0x4fcf18[_0xf7d9('0xbe')],_0xf7d9('0xbf'));}if(!this[_0xf7d9('0x83')](_0x4fcf18[_0xf7d9('0xc0')])){_0x4fcf18['callback_priority']=0x2;}this[_0xf7d9('0x40')][_0xf7d9('0x6d')](this,_0x4fcf18);return this[_0xf7d9('0xe')]['noop'](util['format'](_0xf7d9('0xc1'),_0x4fcf18[_0xf7d9('0x46')],_0x4fcf18[_0xf7d9('0x47')],_0x4fcf18['scheduledAt']));};AGIVertices[_0xf7d9('0x14')]['custom_app']=function(_0x167154){logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')](_0xf7d9('0xc2'),_0x167154[_0xf7d9('0xa7')]));var _0x28b792=this[_0xf7d9('0xe')][_0xf7d9('0xaa')](_0x167154[_0xf7d9('0xc3')],_0x167154[_0xf7d9('0x77')]);if(_0x28b792[_0xf7d9('0xa2')]===-0x1){return _0x28b792;}return this[_0xf7d9('0xe')][_0xf7d9('0xa8')](util[_0xf7d9('0x26')]('Executed\x20command\x20%s\x20%s',_0x167154[_0xf7d9('0xc3')],_0x167154['options']));};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0xc4')]=function(_0x5ab95d){logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x5ab95d['label']));if(!this['isConfigured'](_0x5ab95d[_0xf7d9('0x5b')])){return this[_0xf7d9('0xe')]['noop'](_0xf7d9('0xa9'));}var _0x551b34='\x22'+_0x5ab95d[_0xf7d9('0x5b')]+'\x22';if(this['isConfigured'](_0x5ab95d[_0xf7d9('0x77')])){_0x551b34+=','+_0x5ab95d[_0xf7d9('0x77')];}var _0x45fe47=this[_0xf7d9('0xe')][_0xf7d9('0xaa')](_0xf7d9('0xab'),_0x551b34);if(_0x45fe47[_0xf7d9('0xa2')]===-0x1){return _0x45fe47;}return this[_0xf7d9('0xe')]['noop'](util[_0xf7d9('0x26')](_0xf7d9('0xac'),_0x551b34));};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0xc5')]=function(_0x22f5dd){logger[_0xf7d9('0x2b')](util['format']('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x22f5dd[_0xf7d9('0xa7')]));if(!this[_0xf7d9('0x83')](_0x22f5dd['text'])){return this[_0xf7d9('0xe')][_0xf7d9('0xa8')](_0xf7d9('0xa9'));}var _0x4855da='\x22'+_0x22f5dd[_0xf7d9('0x5b')]+'\x22';if(this[_0xf7d9('0x83')](_0x22f5dd[_0xf7d9('0x77')])){_0x4855da+=','+_0x22f5dd[_0xf7d9('0x77')];}var _0xe6bc0f=this[_0xf7d9('0xe')]['exec']('MRCPSynth',_0x4855da);if(_0xe6bc0f['result']===-0x1){return _0xe6bc0f;}return this[_0xf7d9('0xe')][_0xf7d9('0xa8')](util[_0xf7d9('0x26')](_0xf7d9('0xac'),_0x4855da));};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0xc6')]=function(_0x153b82){logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')](_0xf7d9('0xc7'),_0x153b82[_0xf7d9('0xa7')]));if(!this[_0xf7d9('0x83')](_0x153b82[_0xf7d9('0xae')])){return this[_0xf7d9('0xe')][_0xf7d9('0xa8')](_0xf7d9('0xaf'));}var _0x9e1bab=_0x153b82[_0xf7d9('0xae')];if(this[_0xf7d9('0x83')](_0x153b82[_0xf7d9('0x77')])){_0x9e1bab+=','+_0x153b82[_0xf7d9('0x77')];}var _0x1da5a5=this[_0xf7d9('0xe')][_0xf7d9('0xaa')](_0xf7d9('0xc8'),_0x9e1bab);if(_0x1da5a5['result']===-0x1){return _0x1da5a5;}var _0x496d5d=this[_0xf7d9('0xa1')](_0xf7d9('0xb0'),_0xf7d9('0xc9'));if(_0x496d5d[_0xf7d9('0xa2')]===-0x1){return _0x496d5d;}var _0x31d932=this['getAndSetVariable'](_0xf7d9('0xb2'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x31d932['result']===-0x1){return _0x31d932;}var _0x6f545b=this[_0xf7d9('0xa1')]('RECOG_INSTANCE()',_0xf7d9('0xca'));if(_0x6f545b[_0xf7d9('0xa2')]===-0x1){return _0x6f545b;}return this[_0xf7d9('0xe')][_0xf7d9('0xa8')](util[_0xf7d9('0x26')]('Executed\x20command\x20MRCPRecog\x20%s',_0x9e1bab));};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0xcb')]=function(_0x1b9591){logger[_0xf7d9('0x2b')](util['format'](_0xf7d9('0xcc'),_0x1b9591['label']));if(!this['isConfigured'](_0x1b9591[_0xf7d9('0xae')])){return this[_0xf7d9('0xe')][_0xf7d9('0xa8')]('no\x20grammar\x20configured');}var _0x3da505=_0x1b9591['grammar'];if(this[_0xf7d9('0x83')](_0x1b9591[_0xf7d9('0x77')])){_0x3da505+=','+_0x1b9591[_0xf7d9('0x77')];}var _0x31f5cb=this[_0xf7d9('0xe')][_0xf7d9('0xaa')]('MRCPRecog',_0x3da505);if(_0x31f5cb['result']===-0x1){return _0x31f5cb;}var _0x195df6=this[_0xf7d9('0xa1')](_0xf7d9('0xb0'),'SESTEK_ASR_CONFIDENCE');if(_0x195df6['result']===-0x1){return _0x195df6;}var _0x592e4e=this[_0xf7d9('0xa1')]('RECOG_INPUT()',_0xf7d9('0xcd'));if(_0x592e4e['result']===-0x1){return _0x592e4e;}var _0x52952f=this['getAndSetVariable']('RECOG_INSTANCE()',_0xf7d9('0xce'));if(_0x52952f['result']===-0x1){return _0x52952f;}return this['channel'][_0xf7d9('0xa8')](util['format'](_0xf7d9('0xcf'),_0x3da505));};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0xd0')]=function(_0xf3e8fe){logger['info'](util[_0xf7d9('0x26')](_0xf7d9('0xd1'),_0xf3e8fe[_0xf7d9('0xa7')]));if(!this['isConfigured'](_0xf3e8fe[_0xf7d9('0xd2')])){return this[_0xf7d9('0xe')]['error'](_0xf3e8fe,'no\x20database\x20selected');}var _0x34d673=this['getSquareOdbc'][_0xf7d9('0x6d')](this,_0xf3e8fe[_0xf7d9('0xd2')]);if(!_0x34d673){return this[_0xf7d9('0xe')]['error'](_0xf3e8fe,'no\x20odbc\x20database\x20found');}if(!this[_0xf7d9('0x83')](_0xf3e8fe['query'])){return this[_0xf7d9('0xe')][_0xf7d9('0x2a')](_0xf3e8fe,_0xf7d9('0xd3'));}var _0x20b12a=_0xf3e8fe['query']['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0xf7d9('0xe')][_0xf7d9('0xa8')](util[_0xf7d9('0x26')](_0xf7d9('0xd4'),_0x20b12a));var _0x21332b=this[_0xf7d9('0x28')]['sync'](this,_0x34d673,_0x20b12a);this[_0xf7d9('0x33')]['sync'](this,_0xf3e8fe,_0x20b12a);if(!this[_0xf7d9('0x83')](_0xf3e8fe[_0xf7d9('0xd5')])){return this[_0xf7d9('0xe')][_0xf7d9('0xa8')](_0xf7d9('0xd6'));}var _0x16b3b2=this[_0xf7d9('0x10')][_0xf7d9('0x6d')](this,_0xf3e8fe[_0xf7d9('0xd5')]);if(!_0x16b3b2){return this[_0xf7d9('0xe')]['error'](_0xf3e8fe,_0xf7d9('0xd7'));}var _0x24ddca=this;_0x21332b['forEach'](function(_0x8ccdaf,_0x2b602c){Object[_0xf7d9('0xd8')](_0x8ccdaf)[_0xf7d9('0xd9')](function(_0x40f2a1){_0x24ddca[_0xf7d9('0xe')]['setVariable'](util[_0xf7d9('0x26')]('%s[%s][%s]',_0x16b3b2,_0x2b602c,_0x40f2a1),_0x8ccdaf[_0x40f2a1]);});});this['channel'][_0xf7d9('0x9d')](util[_0xf7d9('0x26')](_0xf7d9('0xda'),_0x16b3b2),_0x21332b[_0xf7d9('0x9a')]);return this[_0xf7d9('0xe')][_0xf7d9('0xa8')](util[_0xf7d9('0x26')](_0xf7d9('0xdb'),_0x16b3b2));};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0xdc')]=function(_0x4c1ffa){logger['debug'](util[_0xf7d9('0x26')](_0xf7d9('0xdd'),_0x4c1ffa['label']));if(!this[_0xf7d9('0x83')](_0x4c1ffa[_0xf7d9('0xde')])){return this[_0xf7d9('0xe')][_0xf7d9('0x2a')](_0x4c1ffa,_0xf7d9('0xdf'));}var _0x40e73c=this[_0xf7d9('0x1b')][_0xf7d9('0x6d')](this,_0x4c1ffa[_0xf7d9('0xde')]);if(!_0x40e73c){return this[_0xf7d9('0xe')][_0xf7d9('0x2a')](_0x4c1ffa,_0xf7d9('0xe0'));}var _0x28455f=this[_0xf7d9('0xe')]['exec']('DIAL',[util[_0xf7d9('0x26')](_0xf7d9('0xe1'),_0x40e73c),_0x4c1ffa[_0xf7d9('0x66')],_0x4c1ffa['opts'],_0x4c1ffa[_0xf7d9('0x64')]]);if(_0x28455f[_0xf7d9('0xa2')]===-0x1){return _0x28455f;}return this[_0xf7d9('0xe')][_0xf7d9('0xa8')](util[_0xf7d9('0x26')](_0xf7d9('0xe2'),_0xf7d9('0xe3')));};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0xe4')]=function(_0x464d64){logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')](_0xf7d9('0xe5'),_0x464d64[_0xf7d9('0xa7')]));if(!this[_0xf7d9('0x83')](_0x464d64[_0xf7d9('0x78')])){return this[_0xf7d9('0xe')][_0xf7d9('0xa8')](_0xf7d9('0xe6'));}if(!this['isConfigured'](_0x464d64[_0xf7d9('0x5b')])){return this[_0xf7d9('0xe')]['noop']('no\x20text\x20configured');}this[_0xf7d9('0xe')][_0xf7d9('0xe7')]=!![];this[_0xf7d9('0x33')](_0x464d64);this[_0xf7d9('0x3f')](_0x464d64[_0xf7d9('0x5b')],'in','','');this[_0xf7d9('0xe')]['noop'](util['format'](_0xf7d9('0xe8'),_0x464d64[_0xf7d9('0x5b')]));var _0x982571=this[_0xf7d9('0xe9')][_0xf7d9('0x6d')](this,_0x464d64);if(_0x982571){for(var _0x1454fd in _0x982571){if(_0x982571['hasOwnProperty'](_0x1454fd)){this[_0xf7d9('0xe')][_0xf7d9('0x9d')](util[_0xf7d9('0x26')](_0xf7d9('0xea'),_0x1454fd[_0xf7d9('0x6a')]()),_0x982571[_0x1454fd]);}}this[_0xf7d9('0x3f')](_0x982571[_0xf7d9('0xeb')],_0xf7d9('0xec'),_0xf7d9('0xe4'),'');return this[_0xf7d9('0xe')]['noop'](util[_0xf7d9('0x26')](_0xf7d9('0xed'),_0x982571['speech']));}return this[_0xf7d9('0xe')][_0xf7d9('0x2a')](_0x464d64,_0xf7d9('0xee'));};AGIVertices['prototype'][_0xf7d9('0xef')]=function(_0x40cfca){logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')](_0xf7d9('0xf0'),_0x40cfca['label']));if(!this[_0xf7d9('0x83')](_0x40cfca[_0xf7d9('0x7b')])){return this['channel'][_0xf7d9('0xa8')](_0xf7d9('0xf1'));}if(!this['isConfigured'](_0x40cfca[_0xf7d9('0xf2')])){return this[_0xf7d9('0xe')]['noop'](_0xf7d9('0xf3'));}if(!this['isConfigured'](_0x40cfca[_0xf7d9('0x7c')])){return this[_0xf7d9('0xe')]['noop'](_0xf7d9('0xf4'));}if(!this['isConfigured'](_0x40cfca['dialogflowV2_language'])){return this['channel']['noop'](_0xf7d9('0xf5'));}if(!this[_0xf7d9('0x83')](_0x40cfca[_0xf7d9('0x5b')])){return this[_0xf7d9('0xe')][_0xf7d9('0xa8')](_0xf7d9('0xa9'));}this[_0xf7d9('0xe')][_0xf7d9('0xe7')]=!![];this['createSquareDetailsReport'](_0x40cfca);this[_0xf7d9('0x3f')](_0x40cfca['text'],'in','','');this['channel'][_0xf7d9('0xa8')](util[_0xf7d9('0x26')]('Trying\x20DialogflowV2:\x20%s',_0x40cfca[_0xf7d9('0x5b')]));var _0x4b14b2=this['googleDialogflowV2']['sync'](this,_0x40cfca);if(_0x4b14b2){for(var _0x5901d5 in _0x4b14b2){if(_0x4b14b2['hasOwnProperty'](_0x5901d5)){if(_0x5901d5!==_0xf7d9('0xf6')){this['channel'][_0xf7d9('0x9d')](util[_0xf7d9('0x26')](_0xf7d9('0xea'),_0x5901d5['toUpperCase']()),_0x4b14b2[_0x5901d5]);}}}this[_0xf7d9('0x3f')](_0x4b14b2[_0xf7d9('0xeb')],_0xf7d9('0xec'),_0xf7d9('0xef'),_0x4b14b2['providerResponse']);return this['channel'][_0xf7d9('0xa8')](util[_0xf7d9('0x26')](_0xf7d9('0xf7'),_0x4b14b2[_0xf7d9('0xeb')]));}return this['channel']['error'](_0x40cfca,_0xf7d9('0xf8'));};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0xf9')]=function(_0x536d40){logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')](_0xf7d9('0xfa'),_0x536d40[_0xf7d9('0xa7')]));if(!this['isConfigured'](_0x536d40[_0xf7d9('0xfb')])){return this['channel'][_0xf7d9('0xa8')](_0xf7d9('0xfc'));}if(!this[_0xf7d9('0x83')](_0x536d40[_0xf7d9('0xfd')])){return this[_0xf7d9('0xe')]['noop'](_0xf7d9('0xfe'));}if(!this['isConfigured'](_0x536d40['password'])){return this[_0xf7d9('0xe')]['noop'](_0xf7d9('0xff'));}if(!this[_0xf7d9('0x83')](_0x536d40[_0xf7d9('0x100')])){return this['channel']['noop'](_0xf7d9('0xa9'));}this[_0xf7d9('0xe')]['bot']=!![];this[_0xf7d9('0x33')](_0x536d40);this[_0xf7d9('0x3f')](_0x536d40[_0xf7d9('0x5b')],'in','','');this['channel'][_0xf7d9('0xa8')](util[_0xf7d9('0x26')](_0xf7d9('0x101'),_0x536d40[_0xf7d9('0x5b')]));var _0x33eef2=this[_0xf7d9('0x7e')][_0xf7d9('0x6d')](this,_0x536d40);if(_0x33eef2){for(var _0x4962b1 in _0x33eef2){if(_0x33eef2[_0xf7d9('0x97')](_0x4962b1)){this['channel'][_0xf7d9('0x9d')](util[_0xf7d9('0x26')]('SESTEK_NDA_%s',_0x4962b1['toUpperCase']()),_0x33eef2[_0x4962b1]);}}this[_0xf7d9('0x3f')](_0x33eef2[_0xf7d9('0xeb')],_0xf7d9('0xec'),_0xf7d9('0xf9'),'');if(_0x33eef2[_0xf7d9('0x102')]){this[_0xf7d9('0xe')][_0xf7d9('0xa8')](util[_0xf7d9('0x26')](_0xf7d9('0x103'),_0x33eef2[_0xf7d9('0x102')]));var _0x24aa3b=this['channel'][_0xf7d9('0x104')](_0x33eef2[_0xf7d9('0x102')]);try{fs['unlink'](_0x33eef2[_0xf7d9('0x102')]+_0xf7d9('0x105'));}catch(_0x32e9c3){logger['error'](_0x32e9c3);}return _0x24aa3b;}else{return this['channel'][_0xf7d9('0xa8')](util[_0xf7d9('0x26')](_0xf7d9('0x106'),_0x33eef2[_0xf7d9('0xeb')]));}}return this[_0xf7d9('0xe')][_0xf7d9('0x2a')](_0x536d40,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0xf7d9('0x14')]['end']=function(_0x30dfc0){logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')]('Enter\x20in\x20END\x20(%s)\x20block',_0x30dfc0[_0xf7d9('0xa7')]));return this[_0xf7d9('0xe')]['noop'](_0xf7d9('0x107'));};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x108')]=function(_0x435932){logger[_0xf7d9('0x2b')](util['format'](_0xf7d9('0x109'),_0x435932[_0xf7d9('0xa7')]));var _0x1590a9='';if(_0x435932[_0xf7d9('0x10a')]){if(!this[_0xf7d9('0x83')](_0x435932[_0xf7d9('0x10a')])){return this[_0xf7d9('0xe')][_0xf7d9('0x2a')](_0x435932,_0xf7d9('0x10b'));}else{var _0x1edd14=parseInt(_0x435932[_0xf7d9('0x10a')],0xa);if(isNaN(_0x1edd14)){_0x1590a9=_0x435932[_0xf7d9('0x10a')];}else{_0x1590a9=this['getTrunk'][_0xf7d9('0x6d')](this,_0x435932[_0xf7d9('0x10a')]);if(!_0x1590a9){return this['channel'][_0xf7d9('0x2a')](_0x435932,_0xf7d9('0x10c'));}}}}else if(_0x435932['trunk_name']){_0x1590a9=_0x435932[_0xf7d9('0x10d')];}else{return this[_0xf7d9('0xe')][_0xf7d9('0x2a')](_0x435932,_0xf7d9('0x10b'));}var _0x332815=this[_0xf7d9('0xe')][_0xf7d9('0xaa')](_0xf7d9('0xe3'),[util['format'](_0xf7d9('0x10e'),_0x1590a9,_0x435932[_0xf7d9('0x46')]),_0x435932[_0xf7d9('0x66')],_0x435932['opts'],_0x435932[_0xf7d9('0x64')]]);if(_0x332815[_0xf7d9('0xa2')]===-0x1){return _0x332815;}return this[_0xf7d9('0xe')][_0xf7d9('0xa8')](util[_0xf7d9('0x26')](_0xf7d9('0xe2'),_0xf7d9('0xe3')));};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x10f')]=function(_0x5ddf0d){logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')](_0xf7d9('0x110'),_0x5ddf0d['label']));return this[_0xf7d9('0xe')][_0xf7d9('0xa8')](_0xf7d9('0x10f'));};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0xc')]=function(_0x1c0860){logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')](_0xf7d9('0x111'),_0x1c0860[_0xf7d9('0xa7')]));if(_0x1c0860['retry']===0x0){return this[_0xf7d9('0xa3')](_0x1c0860);}_0x1c0860['retry']-=0x1;if(!this[_0xf7d9('0x83')](_0x1c0860[_0xf7d9('0x112')])){return this[_0xf7d9('0xe')]['error'](_0x1c0860,'no\x20file\x20audio\x20selected');}var _0x34f9f1=this[_0xf7d9('0x1c')][_0xf7d9('0x6d')](this,_0x1c0860[_0xf7d9('0x112')]);if(!_0x34f9f1){return this[_0xf7d9('0xe')][_0xf7d9('0x2a')](_0x1c0860,'no\x20file\x20audio\x20found');}if(!this['isConfigured'](_0x1c0860[_0xf7d9('0xd5')])){return this[_0xf7d9('0xe')][_0xf7d9('0x2a')](_0xf7d9('0xd6'));}var _0x42420e=this[_0xf7d9('0xe')][_0xf7d9('0x113')](_0x34f9f1,_0x1c0860[_0xf7d9('0x114')],_0x1c0860[_0xf7d9('0x115')]);var _0x3b437a=_0x42420e[_0xf7d9('0xa2')]?_0x42420e[_0xf7d9('0xa2')]['toString']():'';logger[_0xf7d9('0x2b')](_0xf7d9('0x116'),JSON[_0xf7d9('0x71')](_0x42420e));if(_0x42420e[_0xf7d9('0xa2')]===-0x1){this[_0xf7d9('0x33')][_0xf7d9('0x6d')](this,_0x1c0860,_0x3b437a);return _0x42420e;}else if(_0x42420e[_0xf7d9('0xa0')]===_0xf7d9('0x66')){_0x42420e[_0xf7d9('0xa2')]=_0x3b437a['length']>=parseInt(_0x1c0860[_0xf7d9('0x117')])?'x':'i';}else{_0x42420e[_0xf7d9('0xa2')]=_0x3b437a['length']>=parseInt(_0x1c0860['mindigit'])&&_0x3b437a['length']<=parseInt(_0x1c0860[_0xf7d9('0x115')])?'x':'i';}var _0x5bdde8=this['getVariable'][_0xf7d9('0x6d')](this,_0x1c0860['variable_id']);if(!_0x5bdde8){return this[_0xf7d9('0xe')][_0xf7d9('0x2a')](_0x1c0860,_0xf7d9('0xd7'));}this['channel']['setVariable'](_0x5bdde8,_0x3b437a);if(this[_0xf7d9('0x83')](_0x1c0860[_0xf7d9('0x118')])){var _0x517681=parseInt(_0x1c0860[_0xf7d9('0x118')],0xa);var _0x4f430d=rs[_0xf7d9('0x119')]({'charset':'*','length':_0x517681});var _0x52535d=_0x3b437a[_0xf7d9('0x9a')];if(_0x52535d>0x0){if(_0x52535d>_0x517681){this[_0xf7d9('0x33')][_0xf7d9('0x6d')](this,_0x1c0860,_0x1c0860['hiddendigitspos']===_0xf7d9('0x11a')?_0x4f430d+_0x3b437a[_0xf7d9('0x11b')](_0x517681):_0x3b437a[_0xf7d9('0x11b')](0x0,_0x52535d-_0x517681)+_0x4f430d);}else{this[_0xf7d9('0x33')][_0xf7d9('0x6d')](this,_0x1c0860,rs[_0xf7d9('0x119')]({'charset':'*','length':_0x52535d}));}}else{this['createSquareDetailsReport'][_0xf7d9('0x6d')](this,_0x1c0860,'');}}else{this[_0xf7d9('0x33')]['sync'](this,_0x1c0860,_0x3b437a);}return _0x42420e;};AGIVertices['prototype']['getsecretdigits']=function(_0x42b186){logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')](_0xf7d9('0x11c'),_0x42b186[_0xf7d9('0xa7')]));return this[_0xf7d9('0xc')](_0x42b186);};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x11d')]=function(_0x2239f5){logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')](_0xf7d9('0x11e'),_0x2239f5[_0xf7d9('0xa7')]));this[_0xf7d9('0x33')]['sync'](this,_0x2239f5,_0x2239f5[_0xf7d9('0x11f')]);return this[_0xf7d9('0xe')][_0xf7d9('0xa8')](util['format'](_0xf7d9('0x120'),_0x2239f5['goalname']));};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x121')]=function(_0x5311c6){logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')](_0xf7d9('0x122'),_0x5311c6[_0xf7d9('0xa7')]));if(!this[_0xf7d9('0x83')](_0x5311c6[_0xf7d9('0x86')])||!this[_0xf7d9('0x83')](_0x5311c6[_0xf7d9('0x8a')])){return this[_0xf7d9('0xe')][_0xf7d9('0xa8')](_0xf7d9('0x123'));}if(!this['isConfigured'](_0x5311c6[_0xf7d9('0x5b')])){return this[_0xf7d9('0xe')][_0xf7d9('0xa8')]('no\x20text\x20configured');}this[_0xf7d9('0xe')][_0xf7d9('0xa8')](util[_0xf7d9('0x26')](_0xf7d9('0x124'),_0x5311c6['text']));var _0x4da77f=this[_0xf7d9('0x85')]['sync'](this,_0x5311c6);if(_0x4da77f){this[_0xf7d9('0xe')][_0xf7d9('0xa8')](util[_0xf7d9('0x26')]('aws\x20Polly\x20%s\x20file\x20created',_0x4da77f));var _0x43538c=this['channel'][_0xf7d9('0x104')](_0x4da77f);try{fs['unlink'](_0x4da77f+_0xf7d9('0x105'));}catch(_0x3e0894){logger[_0xf7d9('0x2a')](_0x3e0894);}return _0x43538c;}return this[_0xf7d9('0xe')][_0xf7d9('0x2a')](_0x5311c6,_0xf7d9('0x125'));};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x126')]=function(_0x1660c9){logger['info'](util[_0xf7d9('0x26')](_0xf7d9('0x127'),_0x1660c9[_0xf7d9('0xa7')]));if(!this[_0xf7d9('0x83')](_0x1660c9[_0xf7d9('0x86')])||!this[_0xf7d9('0x83')](_0x1660c9[_0xf7d9('0x8a')])){return this[_0xf7d9('0xe')]['noop'](_0xf7d9('0x123'));}if(!this[_0xf7d9('0x83')](_0x1660c9['aws_bot_name'])){return this[_0xf7d9('0xe')][_0xf7d9('0xa8')](_0xf7d9('0x128'));}if(!this[_0xf7d9('0x83')](_0x1660c9[_0xf7d9('0x5b')])){return this['channel']['noop']('no\x20text\x20configured');}this[_0xf7d9('0xe')][_0xf7d9('0xe7')]=!![];this[_0xf7d9('0x33')](_0x1660c9);this['createSquareMessage'](_0x1660c9[_0xf7d9('0x5b')],'in','','');this['channel'][_0xf7d9('0xa8')](util[_0xf7d9('0x26')](_0xf7d9('0x129'),_0x1660c9[_0xf7d9('0x5b')]));var _0x3edd03=this[_0xf7d9('0x89')]['sync'](this,_0x1660c9);if(_0x3edd03){for(var _0x3addae in _0x3edd03){if(_0x3edd03[_0xf7d9('0x97')](_0x3addae)&&_[_0xf7d9('0x93')](_0x3edd03[_0x3addae])){this[_0xf7d9('0xe')][_0xf7d9('0x9d')](util[_0xf7d9('0x26')](_0xf7d9('0x12a'),_0x3addae['toUpperCase']()),_0x3edd03[_0x3addae]);}}if(_['isNil'](_0x3edd03['message'])){return this[_0xf7d9('0xe')][_0xf7d9('0xa8')](_0xf7d9('0x12b'));}else{this[_0xf7d9('0x3f')](_0x3edd03[_0xf7d9('0x76')],'out',_0xf7d9('0x12c'),'');return this['channel'][_0xf7d9('0xa8')](util[_0xf7d9('0x26')](_0xf7d9('0x12d'),_0x3edd03[_0xf7d9('0x76')]));}}return this[_0xf7d9('0xe')][_0xf7d9('0x2a')](_0x1660c9,_0xf7d9('0x12e'));};AGIVertices[_0xf7d9('0x14')]['googleasr']=function(_0x4282b7){logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')](_0xf7d9('0x12f'),_0x4282b7['label'],_0x4282b7[_0xf7d9('0x66')]));if(!this[_0xf7d9('0x83')](_0x4282b7[_0xf7d9('0x78')])){return this['channel'][_0xf7d9('0xa8')]('no\x20key\x20configured');}var _0x48f947=_0xf7d9('0x130');var _0x2de7bb=util[_0xf7d9('0x26')](_0xf7d9('0x131'),FILES_PATH,rs['generate'](0x4));var _0x4f6922=util[_0xf7d9('0x26')](_0xf7d9('0x9c'),_0x2de7bb,_0x48f947);var _0xd99ec4=!![];if(_0x4282b7[_0xf7d9('0x132')]===_0xf7d9('0x133')){_0xd99ec4=![];}var _0xa4106d=this[_0xf7d9('0xe')][_0xf7d9('0x134')](_0x2de7bb,_0x48f947,_0x4282b7[_0xf7d9('0x135')],_0x4282b7['timeout'],undefined,_0xd99ec4);if(_0xa4106d[_0xf7d9('0xa2')]!==-0x1){this[_0xf7d9('0xe')]['noop'](util['format'](_0xf7d9('0x136'),_0x4f6922));var _0x2e42ec=this[_0xf7d9('0x8d')][_0xf7d9('0x6d')](this,_0x4282b7,_0x4f6922);if(_0x2e42ec){for(var _0xaef8d4 in _0x2e42ec){if(_0x2e42ec[_0xf7d9('0x97')](_0xaef8d4)){this[_0xf7d9('0xe')][_0xf7d9('0x9d')](util[_0xf7d9('0x26')]('GOOGLE_ASR_%s',_0xaef8d4[_0xf7d9('0x6a')]()),_0x2e42ec[_0xaef8d4]);}}return this[_0xf7d9('0xe')]['noop'](util['format']('GoogleASR\x20Result\x20%s',JSON[_0xf7d9('0x71')](_0x2e42ec)));}}return _0xa4106d;};AGIVertices[_0xf7d9('0x14')]['tildeasr']=function(_0x1a788a){logger['info'](util[_0xf7d9('0x26')](_0xf7d9('0x137'),_0x1a788a[_0xf7d9('0xa7')]));if(!this['isConfigured'](_0x1a788a[_0xf7d9('0x90')])){return this['channel']['noop'](_0xf7d9('0x138'));}if(!this[_0xf7d9('0x83')](_0x1a788a[_0xf7d9('0x91')])){return this[_0xf7d9('0xe')][_0xf7d9('0xa8')](_0xf7d9('0x139'));}var _0x3bd544=_0xf7d9('0x130');var _0x5ee9c5=util[_0xf7d9('0x26')](_0xf7d9('0x131'),FILES_PATH,rs[_0xf7d9('0x119')](0x4));var _0x4bd93a=util[_0xf7d9('0x26')](_0xf7d9('0x9c'),_0x5ee9c5,_0x3bd544);var _0x6f2d6e=!![];if(_0x1a788a['beep']===_0xf7d9('0x133')){_0x6f2d6e=![];}var _0x30a2c5=this[_0xf7d9('0xe')]['recordFile'](_0x5ee9c5,_0x3bd544,_0x1a788a['intKey'],_0x1a788a[_0xf7d9('0x66')],undefined,_0x6f2d6e);if(_0x30a2c5['result']!==-0x1){this['channel'][_0xf7d9('0xa8')](util['format'](_0xf7d9('0x13a'),_0x4bd93a));var _0x596fa5=this['tildeASR'][_0xf7d9('0x6d')](this,_0x1a788a,_0x4bd93a);if(_0x596fa5){for(var _0x58b306 in _0x596fa5){if(_0x596fa5[_0xf7d9('0x97')](_0x58b306)){this[_0xf7d9('0xe')]['setVariable'](util['format'](_0xf7d9('0x13b'),_0x58b306[_0xf7d9('0x6a')]()),_0x596fa5[_0x58b306]);}}return this[_0xf7d9('0xe')][_0xf7d9('0xa8')](util[_0xf7d9('0x26')]('TildeASR\x20Result\x20%s',JSON['stringify'](_0x596fa5)));}}return _0x30a2c5;};AGIVertices[_0xf7d9('0x14')]['gotoc']=function(_0x302ccc){logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')](_0xf7d9('0x13c'),_0x302ccc[_0xf7d9('0xa7')]));return this[_0xf7d9('0xe')][_0xf7d9('0x13d')](_0x302ccc['context'],_0x302ccc[_0xf7d9('0x3a')],_0x302ccc[_0xf7d9('0x3b')]);};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x13e')]=function(_0x202a0b){logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')](_0xf7d9('0x13f'),_0x202a0b[_0xf7d9('0xa7')]));if(!this['isConfigured'](_0x202a0b['condition'])){return this[_0xf7d9('0xe')][_0xf7d9('0x2a')](_0x202a0b,_0xf7d9('0x140'));}try{var _0x18a28a=eval(_0x202a0b[_0xf7d9('0x141')])?_0xf7d9('0x142'):_0xf7d9('0x143');this[_0xf7d9('0xe')][_0xf7d9('0xa8')](util[_0xf7d9('0x26')](_0xf7d9('0x144'),_0x202a0b[_0xf7d9('0x141')],_0x18a28a));return{'code':0xc8,'result':_0x18a28a};}catch(_0x3871fa){return{'code':0xc8,'result':_0xf7d9('0x143')};}};AGIVertices['prototype'][_0xf7d9('0x145')]=function(_0x4046e0){logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')](_0xf7d9('0x146'),_0x4046e0[_0xf7d9('0xa7')]));if(!this[_0xf7d9('0x83')](_0x4046e0[_0xf7d9('0x147')])){return this[_0xf7d9('0xe')][_0xf7d9('0x2a')](_0x4046e0,_0xf7d9('0x148'));}var _0x51513f=this[_0xf7d9('0x21')][_0xf7d9('0x6d')](this,_0x4046e0['interval_id']);if(!_0x51513f){return this[_0xf7d9('0xe')][_0xf7d9('0x2a')](_0x4046e0,_0xf7d9('0x149'));}for(var _0x2faa71=0x0;_0x2faa71<_0x51513f[_0xf7d9('0x9a')];_0x2faa71+=0x1){var _0x540862=this[_0xf7d9('0xe')][_0xf7d9('0x10')](util[_0xf7d9('0x26')](_0xf7d9('0x14a'),_0x51513f[_0x2faa71]));if(_0x540862['result']===-0x1){return _0x540862;}logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')](_0xf7d9('0x14b'),_0x51513f[_0x2faa71],_0x540862[_0xf7d9('0xa0')]));if(_0x540862[_0xf7d9('0xa0')]===_0xf7d9('0x142')){logger['info'](util[_0xf7d9('0x26')](_0xf7d9('0x14b'),_0x51513f[_0x2faa71],'true'));this[_0xf7d9('0xe')][_0xf7d9('0xa8')](util[_0xf7d9('0x26')](_0xf7d9('0x14b'),_0x51513f[_0x2faa71],_0xf7d9('0x142')));return{'code':0xc8,'result':_0xf7d9('0x142')};}else{logger[_0xf7d9('0x2b')](util['format'](_0xf7d9('0x14b'),_0x51513f[_0x2faa71],_0xf7d9('0x143')));this[_0xf7d9('0xe')][_0xf7d9('0xa8')](util['format'](_0xf7d9('0x14b'),_0x51513f[_0x2faa71],_0xf7d9('0x143')));}}return{'code':0xc8,'result':_0xf7d9('0x143')};};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x14c')]=function(_0x5e419d){logger[_0xf7d9('0x2b')](util['format'](_0xf7d9('0x14d'),_0x5e419d[_0xf7d9('0xa7')]));return this[_0xf7d9('0xe')][_0xf7d9('0x14c')]();};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x14e')]=function(_0x2c669a){logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')](_0xf7d9('0x14f'),_0x2c669a[_0xf7d9('0xa7')]));if(!this[_0xf7d9('0x83')](_0x2c669a[_0xf7d9('0x78')])){return this[_0xf7d9('0xe')]['noop']('no\x20key\x20configured');}var _0x27e55e=_0xf7d9('0x130');var _0x15bb62=util[_0xf7d9('0x26')](_0xf7d9('0x131'),FILES_PATH,rs[_0xf7d9('0x119')](0x4));var _0x36e7c2=util['format'](_0xf7d9('0x9c'),_0x15bb62,_0x27e55e);var _0x5d3580=!![];if(_0x2c669a[_0xf7d9('0x132')]===_0xf7d9('0x133')){_0x5d3580=![];}var _0xe1c3f7=this[_0xf7d9('0xe')]['recordFile'](_0x15bb62,_0x27e55e,_0x2c669a['intKey'],_0x2c669a[_0xf7d9('0x66')],undefined,_0x5d3580);if(_0xe1c3f7['result']!==-0x1){this['channel'][_0xf7d9('0xa8')](util[_0xf7d9('0x26')](_0xf7d9('0x150'),_0x36e7c2));var _0xd0036=this[_0xf7d9('0x82')][_0xf7d9('0x6d')](this,_0x2c669a,_0x36e7c2);if(_0xd0036){for(var _0x2e46a3 in _0xd0036){if(_0xd0036[_0xf7d9('0x97')](_0x2e46a3)){this[_0xf7d9('0xe')][_0xf7d9('0x9d')](util['format'](_0xf7d9('0x151'),_0x2e46a3['toUpperCase']()),_0xd0036[_0x2e46a3]);}}return this['channel'][_0xf7d9('0xa8')](util[_0xf7d9('0x26')](_0xf7d9('0x152'),JSON['stringify'](_0xd0036)));}}return _0xe1c3f7;};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x153')]=function(_0x2651ba){logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x2651ba[_0xf7d9('0xa7')]));if(!this[_0xf7d9('0x83')](_0x2651ba[_0xf7d9('0x78')])){return this[_0xf7d9('0xe')]['noop'](_0xf7d9('0xe6'));}if(!this['isConfigured'](_0x2651ba[_0xf7d9('0x5b')])){return this[_0xf7d9('0xe')]['noop']('no\x20text\x20configured');}this['channel']['noop'](util[_0xf7d9('0x26')](_0xf7d9('0x154'),_0x2651ba['text']));var _0x2287e3=this[_0xf7d9('0x7f')][_0xf7d9('0x6d')](this,_0x2651ba);if(_0x2287e3){this[_0xf7d9('0xe')][_0xf7d9('0xa8')](util[_0xf7d9('0x26')]('ispeech\x20%s\x20file\x20created',_0x2287e3));var _0x402f6a=this[_0xf7d9('0xe')][_0xf7d9('0x104')](_0x2287e3,_0x2651ba[_0xf7d9('0x135')]);try{fs[_0xf7d9('0x155')](_0x2287e3+_0xf7d9('0x105'));}catch(_0x2205f9){logger[_0xf7d9('0x2a')](_0x2205f9);}return _0x402f6a;}return this[_0xf7d9('0xe')][_0xf7d9('0x2a')](_0x2651ba,_0xf7d9('0x156'));};AGIVertices[_0xf7d9('0x14')]['login']=function(_0xf1ee9e){logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')](_0xf7d9('0x157'),_0xf1ee9e[_0xf7d9('0xa7')]));if(!this[_0xf7d9('0x83')](_0xf1ee9e[_0xf7d9('0x158')])){return this[_0xf7d9('0xe')][_0xf7d9('0x2a')](_0xf1ee9e,_0xf7d9('0x159'));}logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')](_0xf7d9('0x15a'),this['channel'][_0xf7d9('0x36')],_0xf1ee9e[_0xf7d9('0x158')]));var _0x1d6ece=this[_0xf7d9('0x51')][_0xf7d9('0x6d')](this,_0xf1ee9e['findBy']);if(_0x1d6ece){logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xf7d9('0xe')]['callerid'],_0xf1ee9e[_0xf7d9('0x158')]));this[_0xf7d9('0xe')][_0xf7d9('0xa8')](util[_0xf7d9('0x26')](_0xf7d9('0x15b'),this[_0xf7d9('0xe')][_0xf7d9('0x36')],_0xf1ee9e[_0xf7d9('0x158')]));return{'code':0xc8,'result':_0xf7d9('0x15c')};}else{logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xf7d9('0xe')][_0xf7d9('0x36')],_0xf1ee9e[_0xf7d9('0x158')]));this[_0xf7d9('0xe')][_0xf7d9('0xa8')](util[_0xf7d9('0x26')](_0xf7d9('0x15d'),this['channel']['callerid'],_0xf1ee9e[_0xf7d9('0x158')]));return{'code':0xc8,'result':_0xf7d9('0x15e')};}};AGIVertices['prototype'][_0xf7d9('0x15f')]=function(_0x3514a6){logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')](_0xf7d9('0x160'),_0x3514a6[_0xf7d9('0xa7')]));if(!this['isConfigured'](_0x3514a6[_0xf7d9('0x158')])){return this[_0xf7d9('0xe')][_0xf7d9('0x2a')](_0x3514a6,_0xf7d9('0x159'));}logger[_0xf7d9('0x2b')](util['format'](_0xf7d9('0x15a'),this[_0xf7d9('0xe')]['callerid'],_0x3514a6[_0xf7d9('0x158')]));var _0x7238ed=this[_0xf7d9('0x50')][_0xf7d9('0x6d')](this,_0x3514a6[_0xf7d9('0x158')]);if(_0x7238ed){logger['info'](util[_0xf7d9('0x26')](_0xf7d9('0x15b'),this['channel']['callerid'],_0x3514a6[_0xf7d9('0x158')]));this['channel'][_0xf7d9('0xa8')](util[_0xf7d9('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xf7d9('0xe')]['callerid'],_0x3514a6[_0xf7d9('0x158')]));return{'code':0xc8,'result':_0xf7d9('0x15c')};}else{logger['info'](util['format'](_0xf7d9('0x15d'),this['channel']['callerid'],_0x3514a6[_0xf7d9('0x158')]));this[_0xf7d9('0xe')][_0xf7d9('0xa8')](util[_0xf7d9('0x26')](_0xf7d9('0x15d'),this[_0xf7d9('0xe')][_0xf7d9('0x36')],_0x3514a6[_0xf7d9('0x158')]));return{'code':0xc8,'result':_0xf7d9('0x15e')};}};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x161')]=function(_0x173068){logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')](_0xf7d9('0x162'),_0x173068['label']));if(!this[_0xf7d9('0x83')](_0x173068[_0xf7d9('0x163')])){return this[_0xf7d9('0xe')][_0xf7d9('0x2a')](_0x173068,_0xf7d9('0x164'));}this[_0xf7d9('0xe')][_0xf7d9('0xa8')](util[_0xf7d9('0x26')](_0xf7d9('0x165'),_0x173068['operation']));var _0x2b14e4=eval(_0x173068[_0xf7d9('0x163')]);if(!this[_0xf7d9('0x83')](_0x173068[_0xf7d9('0xd5')])){return this[_0xf7d9('0xe')][_0xf7d9('0xa8')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x2f127e=this[_0xf7d9('0x10')]['sync'](this,_0x173068[_0xf7d9('0xd5')]);if(!_0x2f127e){return this['channel'][_0xf7d9('0x2a')](_0x173068,_0xf7d9('0xd7'));}if(_[_0xf7d9('0x99')](_0x2b14e4)){var _0x769037=this;_0x2b14e4[_0xf7d9('0xd9')](function(_0x530bad,_0x37901d){_0x769037[_0xf7d9('0xe')][_0xf7d9('0x9d')](util['format'](_0xf7d9('0x166'),_0x2f127e,_0x37901d),_0x530bad);});return this[_0xf7d9('0xe')][_0xf7d9('0xa8')](util['format'](_0xf7d9('0x167'),_0x2f127e));}else{return this[_0xf7d9('0xe')]['setVariable'](_0x2f127e,_0x2b14e4);}};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x168')]=function(_0x53795f){logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')](_0xf7d9('0x169'),_0x53795f[_0xf7d9('0xa7')]));if(_0x53795f[_0xf7d9('0xa4')]===0x0){return this[_0xf7d9('0xa3')](_0x53795f);}_0x53795f[_0xf7d9('0xa4')]-=0x1;if(!this[_0xf7d9('0x83')](_0x53795f[_0xf7d9('0x112')])){return this[_0xf7d9('0xe')]['error'](_0x53795f,_0xf7d9('0x16a'));}var _0x41d3b0=this[_0xf7d9('0x1c')][_0xf7d9('0x6d')](this,_0x53795f[_0xf7d9('0x112')]);if(!_0x41d3b0){return this['channel'][_0xf7d9('0x2a')](_0x53795f,_0xf7d9('0x16b'));}var _0xcf1da8=this[_0xf7d9('0xe')][_0xf7d9('0x113')](_0x41d3b0,_0x53795f[_0xf7d9('0x114')],_0x53795f[_0xf7d9('0x16c')]);var _0x4f98d9=_0xcf1da8[_0xf7d9('0xa2')];if(_0xcf1da8['result']===-0x1){this[_0xf7d9('0x33')][_0xf7d9('0x6d')](this,_0x53795f,'-1');return _0xcf1da8;}else if(_0xcf1da8['extra']==='timeout'){_0xcf1da8[_0xf7d9('0xa2')]=_0xcf1da8['result'][_0xf7d9('0x9a')]>0x0?_0xcf1da8[_0xf7d9('0xa2')]:'t';}else if(_[_0xf7d9('0x41')](_0xcf1da8['result'])){_0xcf1da8[_0xf7d9('0xa2')]='#';_0x4f98d9='#';}if(!this[_0xf7d9('0x83')](_0x53795f[_0xf7d9('0xd5')])){this[_0xf7d9('0xe')][_0xf7d9('0xa8')](_0xf7d9('0xd6'));}else{var _0x2c4819=this['getVariable'][_0xf7d9('0x6d')](this,_0x53795f[_0xf7d9('0xd5')]);if(!_0x2c4819){return this[_0xf7d9('0xe')][_0xf7d9('0x2a')](_0x53795f,_0xf7d9('0xd7'));}this['channel'][_0xf7d9('0x9d')](_0x2c4819,_0x4f98d9);}this[_0xf7d9('0x33')][_0xf7d9('0x6d')](this,_0x53795f,_0x4f98d9);return _0xcf1da8;};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0xa8')]=function(_0x862b7b){logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')](_0xf7d9('0x16d'),_0x862b7b[_0xf7d9('0xa7')]));return this['channel'][_0xf7d9('0xa8')](_0x862b7b[_0xf7d9('0x16e')]||_0x862b7b['label']);};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x16f')]=function(_0xfab4f9){logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')](_0xf7d9('0x170'),_0xfab4f9['label']));if(!this[_0xf7d9('0x83')](_0xfab4f9[_0xf7d9('0x158')])){return this[_0xf7d9('0xe')]['error'](_0xfab4f9,_0xf7d9('0x159'));}logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')](_0xf7d9('0x15a'),this[_0xf7d9('0xe')][_0xf7d9('0x36')],_0xfab4f9[_0xf7d9('0x158')]));var _0x11840c=this[_0xf7d9('0x171')][_0xf7d9('0x6d')](this,_0xfab4f9['pause_id']);var _0x3c71a2=this[_0xf7d9('0x4d')][_0xf7d9('0x6d')](this,_0xfab4f9[_0xf7d9('0x158')],_0x11840c);if(_0x3c71a2){logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')](_0xf7d9('0x15b'),this[_0xf7d9('0xe')][_0xf7d9('0x36')],_0xfab4f9[_0xf7d9('0x158')]));this['channel'][_0xf7d9('0xa8')](util[_0xf7d9('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xf7d9('0x36')],_0xfab4f9[_0xf7d9('0x158')]));return{'code':0xc8,'result':_0xf7d9('0x15c')};}else{logger['info'](util[_0xf7d9('0x26')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xf7d9('0xe')]['callerid'],_0xfab4f9[_0xf7d9('0x158')]));this[_0xf7d9('0xe')][_0xf7d9('0xa8')](util[_0xf7d9('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xf7d9('0xe')][_0xf7d9('0x36')],_0xfab4f9[_0xf7d9('0x158')]));return{'code':0xc8,'result':_0xf7d9('0x15e')};}};AGIVertices['prototype'][_0xf7d9('0x172')]=function(_0x4fdd56){logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')](_0xf7d9('0x173'),_0x4fdd56[_0xf7d9('0xa7')]));if(!this['isConfigured'](_0x4fdd56['file_id'])){return this['channel']['error'](_0x4fdd56,_0xf7d9('0x16a'));}var _0x42f529=this['getSound'][_0xf7d9('0x6d')](this,_0x4fdd56[_0xf7d9('0x112')]);if(!_0x42f529){return this[_0xf7d9('0xe')][_0xf7d9('0x2a')](_0x4fdd56,'no\x20file\x20audio\x20found');}var _0x164bbb=this[_0xf7d9('0xe')][_0xf7d9('0xaa')]('PLAYBACK',[_0x42f529,_0x4fdd56[_0xf7d9('0x174')]]);if(_0x164bbb[_0xf7d9('0xa2')]===-0x1){return _0x164bbb;}return this[_0xf7d9('0xe')]['noop'](util[_0xf7d9('0x26')]('Executed\x20command\x20%s\x20%s',_0xf7d9('0x175'),_0x42f529));};AGIVertices[_0xf7d9('0x14')]['queue']=function(_0xedc083){logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')](_0xf7d9('0x176'),_0xedc083[_0xf7d9('0xa7')]));if(!this[_0xf7d9('0x83')](_0xedc083[_0xf7d9('0x177')])){return this['channel']['error'](_0xedc083,_0xf7d9('0x178'));}var _0x15d45e='';var _0xf48eee=parseInt(_0xedc083[_0xf7d9('0x177')],0xa);if(isNaN(_0xf48eee)){_0x15d45e=_0xedc083[_0xf7d9('0x177')];}else{_0x15d45e=this['getVoiceQueue'][_0xf7d9('0x6d')](this,_0xedc083['queue_id']);if(!_0x15d45e){return this[_0xf7d9('0xe')][_0xf7d9('0x2a')](_0xedc083,_0xf7d9('0x179'));}}var _0x138d54='';if(this[_0xf7d9('0x83')](_0xedc083['file_id'])){var _0x4efd3a=this[_0xf7d9('0x1c')][_0xf7d9('0x6d')](this,_0xedc083[_0xf7d9('0x112')]);if(_0x4efd3a){_0x138d54=_0x4efd3a;}}this[_0xf7d9('0x33')]['sync'](this,_0xedc083,_0x15d45e);if(_0xedc083[_0xf7d9('0x174')][_0xf7d9('0x17a')]('x')<0x0){_0xedc083[_0xf7d9('0x174')]+='x';}if(_0xedc083['opts'][_0xf7d9('0x17a')]('X')<0x0){_0xedc083[_0xf7d9('0x174')]+='X';}this[_0xf7d9('0xe')]['setVariable'](_0xf7d9('0x17b'),_0x15d45e?_0x15d45e[_0xf7d9('0x17c')]():'');var _0x306bc2=this[_0xf7d9('0xe')][_0xf7d9('0xaa')]('QUEUE',[_0x15d45e,_0xedc083['opts'],_0xedc083[_0xf7d9('0x64')],_0x138d54,_0xedc083['timeout'],_0xedc083[_0xf7d9('0x8')],_0xedc083[_0xf7d9('0x17d')],_0xedc083[_0xf7d9('0x17e')],'',_0xedc083[_0xf7d9('0x17f')]]);if(_0x306bc2[_0xf7d9('0xa2')]===-0x1){return _0x306bc2;}return this['channel'][_0xf7d9('0xa8')](util[_0xf7d9('0x26')]('Executed\x20command\x20%s\x20%s',_0xf7d9('0x180'),_0x15d45e));};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x181')]=function(_0x54f301){logger['info'](util[_0xf7d9('0x26')](_0xf7d9('0x182'),_0x54f301[_0xf7d9('0xa7')]));var _0x2a3534=_0x54f301[_0xf7d9('0x183')]||'wav';var _0x180ad8=util[_0xf7d9('0x26')](_0xf7d9('0x184'),this[_0xf7d9('0xe')][_0xf7d9('0x38')],rs[_0xf7d9('0x119')](0x5));var _0x456ac4=util[_0xf7d9('0x26')](_0xf7d9('0x185'),FILES_PATH,_0x180ad8,_0x2a3534);var _0xe54468=util[_0xf7d9('0x26')](_0xf7d9('0x131'),FILES_PATH,_0x180ad8);this[_0xf7d9('0x37')][_0xf7d9('0x6d')](this,_0x54f301,_0x180ad8,_0x456ac4);this[_0xf7d9('0xe')][_0xf7d9('0x9d')](_0xf7d9('0x186'),_0x180ad8);logger[_0xf7d9('0x2b')](_0xf7d9('0x187'),_0xe54468,_0x2a3534,_0x54f301[_0xf7d9('0x188')],_0x54f301[_0xf7d9('0x66')]);return this['channel'][_0xf7d9('0x134')](_0xe54468,_0x2a3534,_0x54f301['escape_digits'],_0x54f301[_0xf7d9('0x66')],undefined,!![]);};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x189')]=function(_0x4dd4d7){logger['info'](util['format']('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x4dd4d7['label']));if(!this[_0xf7d9('0x83')](_0x4dd4d7[_0xf7d9('0x64')])){return this['channel']['noop'](_0xf7d9('0x18a'));}var _0x422d53=this['restAPI'][_0xf7d9('0x6d')](this,_0x4dd4d7);logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')](_0xf7d9('0x18b'),util[_0xf7d9('0x18c')](_0x422d53,{'showHidden':![],'depth':null})));if(!this[_0xf7d9('0x83')](_0x4dd4d7['variable_id'])){return this[_0xf7d9('0xe')]['noop'](_0xf7d9('0x18d'));}var _0x4f5b0e=this[_0xf7d9('0x10')][_0xf7d9('0x6d')](this,_0x4dd4d7[_0xf7d9('0xd5')]);if(!_0x4f5b0e){return this[_0xf7d9('0xe')][_0xf7d9('0x2a')](_0x4dd4d7,_0xf7d9('0xd7'));}this['channel'][_0xf7d9('0x9d')](util[_0xf7d9('0x26')](_0xf7d9('0x18e'),_0x4f5b0e),_0x422d53[_0xf7d9('0x75')]?_0x422d53['statusCode']:_0xf7d9('0x18f'));this[_0xf7d9('0xe')][_0xf7d9('0x9d')](util[_0xf7d9('0x26')](_0xf7d9('0x190'),_0x4f5b0e),_0x422d53['statusMessage']?_0x422d53[_0xf7d9('0x74')]:'OK');if(_0x422d53[_0xf7d9('0x72')]){try{this[_0xf7d9('0x9b')](_0x422d53['body'],_0x4f5b0e);}catch(_0xe599a7){logger['error'](util[_0xf7d9('0x26')](_0xf7d9('0x191'),_0x4f5b0e));}}return this['channel'][_0xf7d9('0xa8')](util[_0xf7d9('0x26')](_0xf7d9('0xdb'),_0x4f5b0e));};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x192')]=function(_0x2ff24f){logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')](_0xf7d9('0x193'),_0x2ff24f[_0xf7d9('0xa7')]));return this[_0xf7d9('0xe')][_0xf7d9('0x194')](_0x2ff24f['digits'][_0xf7d9('0x57')](/\s+/g,''),_0x2ff24f['escape_digits']);};AGIVertices[_0xf7d9('0x14')]['saynumber']=function(_0xd05dff){logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0xd05dff[_0xf7d9('0xa7')]));return this['channel']['sayNumber'](_0xd05dff[_0xf7d9('0x67')][_0xf7d9('0x57')](/\s+/g,''),_0xd05dff[_0xf7d9('0x188')]);};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x195')]=function(_0xb8ad46){logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')](_0xf7d9('0x196'),_0xb8ad46[_0xf7d9('0xa7')]));return this['channel'][_0xf7d9('0x197')](_0xb8ad46[_0xf7d9('0x5b')],_0xb8ad46[_0xf7d9('0x188')]);};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x198')]=function(_0xc014d6){logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0xc014d6[_0xf7d9('0xa7')]));if(!this[_0xf7d9('0x83')](_0xc014d6['account_id'])){return this[_0xf7d9('0xe')][_0xf7d9('0xa8')](_0xf7d9('0x199'));}var _0x1e2726=this[_0xf7d9('0x1f')][_0xf7d9('0x6d')](this,_0xc014d6[_0xf7d9('0x19a')]);if(!_0x1e2726||!_0x1e2726['Smtp']){return this['channel'][_0xf7d9('0x2a')](_0xc014d6,_0xf7d9('0x19b'));}var _0x47478f={'from':util[_0xf7d9('0x26')](_0xf7d9('0x19c'),_0x1e2726[_0xf7d9('0x12')],_0x1e2726[_0xf7d9('0x19d')]||_0x1e2726[_0xf7d9('0x19e')]['user']),'to':_0xc014d6['to']||'','cc':_0xc014d6['cc']||'','bcc':_0xc014d6[_0xf7d9('0x19f')]||'','subject':_0xc014d6[_0xf7d9('0x1a0')],'html':_0xc014d6[_0xf7d9('0x5b')],'text':_0xc014d6[_0xf7d9('0x5b')]};if(this[_0xf7d9('0x83')](_0xc014d6[_0xf7d9('0x1a1')])){}logger[_0xf7d9('0x1a2')]('sendMail\x20message',JSON[_0xf7d9('0x71')](_0x47478f));this['createSquareDetailsReport'][_0xf7d9('0x6d')](this,_0xc014d6,_0xc014d6[_0xf7d9('0x19a')]);this[_0xf7d9('0xe')][_0xf7d9('0xa8')](util['format'](_0xf7d9('0x1a3'),_0x1e2726['name']));this[_0xf7d9('0x20')][_0xf7d9('0x6d')](this,_0x1e2726[_0xf7d9('0x1a4')],_0x47478f);return this['channel'][_0xf7d9('0xa8')](_0xf7d9('0x1a5'));};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x1a6')]=function(_0x576234){logger[_0xf7d9('0x2b')](util['format']('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x576234[_0xf7d9('0xa7')]));return this[_0xf7d9('0xe')]['noop'](_0xf7d9('0x1a7'));};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x1a8')]=function(_0x1aa997){logger['info'](util['format'](_0xf7d9('0x1a9'),_0x1aa997['label']));if(!this['isConfigured'](_0x1aa997[_0xf7d9('0x1aa')])){return this['channel']['noop'](_0xf7d9('0x1ab'));}var _0x4109be=this[_0xf7d9('0x31')][_0xf7d9('0x6d')](this,_0x1aa997[_0xf7d9('0x1aa')]);if(!_0x4109be){return this[_0xf7d9('0xe')][_0xf7d9('0x2a')](_0x1aa997,_0xf7d9('0x1ac'));}var _0x159d03={'body':_0x1aa997[_0xf7d9('0x1ad')],'phone':_0x1aa997['to']||'','SmsAccountId':_0x4109be['id']};logger[_0xf7d9('0x1a2')](_0xf7d9('0x1ae'),JSON[_0xf7d9('0x71')](_0x159d03));this[_0xf7d9('0x33')][_0xf7d9('0x6d')](this,_0x1aa997,_0x1aa997[_0xf7d9('0x1aa')]);this[_0xf7d9('0xe')][_0xf7d9('0xa8')](util[_0xf7d9('0x26')](_0xf7d9('0x1af'),_0x4109be['name']));this[_0xf7d9('0x32')][_0xf7d9('0x6d')](this,_0x159d03);return this['channel'][_0xf7d9('0xa8')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype'][_0xf7d9('0x1b0')]=function(_0x272e17){logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')](_0xf7d9('0x1b1'),_0x272e17[_0xf7d9('0xa7')]));if(!this[_0xf7d9('0x83')](_0x272e17['variable_id'])){return this[_0xf7d9('0xe')][_0xf7d9('0x2a')](_0x272e17,_0xf7d9('0x1b2'));}var _0x8ccab1=this[_0xf7d9('0x10')]['sync'](this,_0x272e17[_0xf7d9('0xd5')]);if(!_0x8ccab1){return this['channel'][_0xf7d9('0x2a')](_0x272e17,_0xf7d9('0xd7'));}return this['channel'][_0xf7d9('0x9d')](_0x8ccab1,_0x272e17['variable_value']);};AGIVertices['prototype']['start']=function(_0x3ea538){logger['info'](util[_0xf7d9('0x26')](_0xf7d9('0x1b3'),_0x3ea538['label']));this[_0xf7d9('0xe')][_0xf7d9('0xa8')](_0xf7d9('0x1b4'));var _0x31d2c7=this['channel'][_0xf7d9('0x10')](_0xf7d9('0x1b5'));if(!_[_0xf7d9('0x41')](_0x31d2c7[_0xf7d9('0xa0')])){this[_0xf7d9('0xe')][_0xf7d9('0x38')]=_0x31d2c7[_0xf7d9('0xa0')];}if(_0x3ea538[_0xf7d9('0xbb')]===_0xf7d9('0x1b6')){this['channel'][_0xf7d9('0xa8')](_0xf7d9('0x1b7'));return this['channel']['answer']();}return this[_0xf7d9('0xe')][_0xf7d9('0xa8')](_0xf7d9('0x1b8'));};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x1b9')]=function(_0x3ad1ce){logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')](_0xf7d9('0x1ba'),_0x3ad1ce[_0xf7d9('0xa7')]));if(!this[_0xf7d9('0x83')](_0x3ad1ce['project_id'])){return this['channel']['error'](_0x3ad1ce,_0xf7d9('0x1bb'));}var _0x487b02=this[_0xf7d9('0x17')][_0xf7d9('0x6d')](this,_0x3ad1ce['project_id']);if(!this[_0xf7d9('0x83')](_0x487b02)){return this['channel'][_0xf7d9('0x2a')](_0x3ad1ce,util[_0xf7d9('0x26')](_0xf7d9('0x1bc'),_0x3ad1ce[_0xf7d9('0x1bd')]));}if(_0x487b02===this['channel'][_0xf7d9('0x35')]){return this[_0xf7d9('0xe')][_0xf7d9('0x2a')](_0x3ad1ce,_0xf7d9('0x1be'));}this[_0xf7d9('0x33')][_0xf7d9('0x6d')](this,_0x3ad1ce,_0x487b02);var _0x2deba6=this[_0xf7d9('0xe')][_0xf7d9('0xaa')](_0xf7d9('0x1bf'),util['format']('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0xf7d9('0x8')]['host']||_0xf7d9('0x1c0'),_0x487b02,this['channel'][_0xf7d9('0x35')]));if(_0x2deba6[_0xf7d9('0xa2')]===-0x1){return _0x2deba6;}return this[_0xf7d9('0xe')]['noop'](util[_0xf7d9('0x26')](_0xf7d9('0x1c1'),_0xf7d9('0x1bf'),_0x487b02));};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x1c2')]=function(_0x5a4ac8){logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')](_0xf7d9('0x1c3'),_0x5a4ac8[_0xf7d9('0xa7')]));var _0x455b9e=this[_0xf7d9('0x55')][_0xf7d9('0x6d')](this,_0x5a4ac8[_0xf7d9('0x1c4')]);this['createSquareDetailsReport'][_0xf7d9('0x6d')](this,_0x5a4ac8,_0x5a4ac8[_0xf7d9('0x1c4')]);if(this[_0xf7d9('0x83')](_0x5a4ac8[_0xf7d9('0xd5')])){var _0x22b6e0=this['getVariable'][_0xf7d9('0x6d')](this,_0x5a4ac8[_0xf7d9('0xd5')]);if(_0x22b6e0){this[_0xf7d9('0xe')][_0xf7d9('0x9d')](_0x22b6e0,_0x455b9e);return this['channel'][_0xf7d9('0xa8')](util['format'](_0xf7d9('0x1c5'),_0x5a4ac8[_0xf7d9('0x1c4')],_0x22b6e0));}}return this[_0xf7d9('0xe')][_0xf7d9('0xa8')](util[_0xf7d9('0x26')](_0xf7d9('0x1c6'),_0x5a4ac8[_0xf7d9('0x1c4')]));};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x1c7')]=function(_0x2b376a){logger['info'](util[_0xf7d9('0x26')](_0xf7d9('0x1c8'),_0x2b376a[_0xf7d9('0xa7')]));_0x2b376a[_0xf7d9('0x5b')]=_0x2b376a['text'][_0xf7d9('0x57')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xf7d9('0x83')](_0x2b376a[_0xf7d9('0x59')])){return this['channel'][_0xf7d9('0xa8')](_0xf7d9('0x1c9'));}if(!this[_0xf7d9('0x83')](_0x2b376a['text'])){return this['channel'][_0xf7d9('0xa8')](_0xf7d9('0xa9'));}this[_0xf7d9('0xe')][_0xf7d9('0xa8')](util[_0xf7d9('0x26')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x2b376a['text']));var _0x16d53d=this[_0xf7d9('0x58')][_0xf7d9('0x6d')](this,_0x2b376a);if(_0x16d53d){this[_0xf7d9('0xe')][_0xf7d9('0xa8')](util[_0xf7d9('0x26')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x16d53d));var _0x4156d7=this[_0xf7d9('0xe')][_0xf7d9('0x104')](_0x16d53d);try{fs[_0xf7d9('0x155')](_0x16d53d+_0xf7d9('0x105'));}catch(_0x1aaa2e){logger[_0xf7d9('0x2a')](_0x1aaa2e);}return _0x4156d7;}return this[_0xf7d9('0xe')][_0xf7d9('0x2a')](_0x2b376a,_0xf7d9('0x1ca'));};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x1cb')]=function(_0x2f9e48){logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')](_0xf7d9('0x1cc'),_0x2f9e48[_0xf7d9('0xa7')]));_0x2f9e48[_0xf7d9('0x5b')]=_0x2f9e48[_0xf7d9('0x5b')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xf7d9('0x83')](_0x2f9e48[_0xf7d9('0x5b')])){return this[_0xf7d9('0xe')][_0xf7d9('0xa8')](_0xf7d9('0xa9'));}this[_0xf7d9('0xe')][_0xf7d9('0xa8')](util['format'](_0xf7d9('0x1cd'),_0x2f9e48[_0xf7d9('0x5b')]));var _0x40059a=this[_0xf7d9('0x61')][_0xf7d9('0x6d')](this,_0x2f9e48);if(_0x40059a){this[_0xf7d9('0xe')][_0xf7d9('0xa8')](util[_0xf7d9('0x26')](_0xf7d9('0x1ce'),_0x40059a));var _0x30f873=this['channel'][_0xf7d9('0x104')](_0x40059a);try{fs[_0xf7d9('0x155')](_0x40059a+_0xf7d9('0x105'));}catch(_0x2bcda3){logger[_0xf7d9('0x2a')](_0x2bcda3);}return _0x30f873;}return this[_0xf7d9('0xe')]['error'](_0x2f9e48,_0xf7d9('0x1cf'));};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x1d0')]=function(_0x100320){logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')](_0xf7d9('0x1d1'),_0x100320[_0xf7d9('0xa7')]));if(!this[_0xf7d9('0x83')](_0x100320[_0xf7d9('0x158')])){return this[_0xf7d9('0xe')][_0xf7d9('0x2a')](_0x100320,_0xf7d9('0x159'));}logger['info'](util['format'](_0xf7d9('0x15a'),this[_0xf7d9('0xe')][_0xf7d9('0x36')],_0x100320[_0xf7d9('0x158')]));var _0x1da5be=this[_0xf7d9('0x4f')][_0xf7d9('0x6d')](this,_0x100320[_0xf7d9('0x158')]);if(_0x1da5be){logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')](_0xf7d9('0x15b'),this[_0xf7d9('0xe')]['callerid'],_0x100320[_0xf7d9('0x158')]));this[_0xf7d9('0xe')][_0xf7d9('0xa8')](util['format'](_0xf7d9('0x15b'),this[_0xf7d9('0xe')][_0xf7d9('0x36')],_0x100320['findBy']));return{'code':0xc8,'result':_0xf7d9('0x15c')};}else{logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')](_0xf7d9('0x15d'),this['channel']['callerid'],_0x100320[_0xf7d9('0x158')]));this[_0xf7d9('0xe')][_0xf7d9('0xa8')](util[_0xf7d9('0x26')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xf7d9('0x36')],_0x100320[_0xf7d9('0x158')]));return{'code':0xc8,'result':_0xf7d9('0x15e')};}};AGIVertices[_0xf7d9('0x14')]['voicemail']=function(_0x5ab2cb){logger[_0xf7d9('0x2b')](util[_0xf7d9('0x26')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x5ab2cb[_0xf7d9('0xa7')]));var _0x33987e=this[_0xf7d9('0xe')]['exec'](_0xf7d9('0x1d2'),[_0x5ab2cb[_0xf7d9('0x1d3')],_0x5ab2cb['options']]);if(_0x33987e[_0xf7d9('0xa2')]===-0x1){return _0x33987e;}return this[_0xf7d9('0xe')][_0xf7d9('0xa8')](util['format']('Executed\x20command\x20%s\x20%s',_0xf7d9('0x1d2'),_0x5ab2cb['mailbox']));};AGIVertices[_0xf7d9('0x14')][_0xf7d9('0x1d4')]=function(_0x476df8){logger[_0xf7d9('0x2b')](util['format'](_0xf7d9('0x1d5'),_0x476df8[_0xf7d9('0xa7')]));if(!this[_0xf7d9('0x83')](_0x476df8['variable_id'])){return this[_0xf7d9('0xe')][_0xf7d9('0x2a')](_0x476df8,_0xf7d9('0x1b2'));}var _0x428ff0=this[_0xf7d9('0x10')][_0xf7d9('0x6d')](this,_0x476df8[_0xf7d9('0xd5')]);if(!_0x428ff0){return this[_0xf7d9('0xe')]['error'](_0x476df8,_0xf7d9('0xd7'));}var _0x9f84d0=this[_0xf7d9('0xe')]['getVariable'](_0x428ff0);return{'code':0xc8,'result':_0x9f84d0[_0xf7d9('0xa0')]?_0x9f84d0[_0xf7d9('0xa0')]:'-'};};String[_0xf7d9('0x14')]['replaceAll']=function(_0x279073,_0x3bc4c2){return this[_0xf7d9('0x9e')](_0x279073)['join'](_0x3bc4c2);};module[_0xf7d9('0x1d6')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 83e53ca..a31dcb2 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 _0xe082=['[ACW][syncAgentConnect]\x20%s','isUndefined','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../ami','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','hanguprequest','syncHangupRequest','hangup','syncHangup','bind','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','updateAcw','lastPauseAt','timer','uniqueid','then','info','[%s][UPDATE][ACWTIME:%s]','error','finally','startAcw','interface','queue','mandatoryDisposition','name','resolve','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','available','paused','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','format','YYYY-MM-DD\x20HH:mm:ss','catch','[ACW][START]\x20%s','message','prototype','getAgent','ACW','saveUnpause','update','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','acw'];(function(_0x28580c,_0x2b0dc7){var _0x5c5100=function(_0x18d7d4){while(--_0x18d7d4){_0x28580c['push'](_0x28580c['shift']());}};_0x5c5100(++_0x2b0dc7);}(_0xe082,0x75));var _0x2e08=function(_0x42f687,_0x558724){_0x42f687=_0x42f687-0x0;var _0x108838=_0xe082[_0x42f687];return _0x108838;};'use strict';var _=require(_0x2e08('0x0'));var moment=require(_0x2e08('0x1'));var ami=require(_0x2e08('0x2'));var logger=require(_0x2e08('0x3'))('acw');var RpcUser=require(_0x2e08('0x4'));var RpcVoiceAgentReport=require(_0x2e08('0x5'));function Acw(_0x42972){this[_0x2e08('0x6')]=_0x42972[_0x2e08('0x6')];this[_0x2e08('0x7')]=_0x42972[_0x2e08('0x7')];this[_0x2e08('0x8')]=_0x42972[_0x2e08('0x8')];this[_0x2e08('0x9')]={};ami['on'](_0x2e08('0xa'),this[_0x2e08('0xb')]['bind'](this));ami['on'](_0x2e08('0xc'),this[_0x2e08('0xd')]['bind'](this));ami['on'](_0x2e08('0xe'),this[_0x2e08('0xf')][_0x2e08('0x10')](this));ami['on'](_0x2e08('0x11'),this[_0x2e08('0x12')]['bind'](this));ami['on'](_0x2e08('0x13'),this[_0x2e08('0x14')][_0x2e08('0x10')](this));ami['on'](_0x2e08('0x15'),this[_0x2e08('0x16')]['bind'](this));ami['on'](_0x2e08('0x17'),this[_0x2e08('0x18')][_0x2e08('0x10')](this));}function getDiff(_0x697c19){var _0x9ea798=moment()[_0x2e08('0x19')](0x0);var _0x3b88a4=moment(_0x697c19)[_0x2e08('0x19')](0x0);return _0x9ea798[_0x2e08('0x1a')](_0x3b88a4,'seconds');}Acw['prototype'][_0x2e08('0x1b')]=function(_0x2555e8,_0x52cc67){var _0x432ddb=this;var _0x35b78b=getDiff(_0x432ddb[_0x2e08('0x8')][_0x2555e8][_0x2e08('0x1c')]);clearTimeout(_0x432ddb['timers'][_0x2555e8]['timer']);_0x432ddb[_0x2e08('0x8')][_0x2555e8][_0x2e08('0x1d')]=![];return RpcVoiceAgentReport['update']({'acwtime':_0x35b78b},_0x432ddb[_0x2e08('0x8')][_0x2555e8][_0x2e08('0x1e')],_0x2555e8)[_0x2e08('0x1f')](function(_0xea341d){logger[_0x2e08('0x20')](_0x2e08('0x21'),_0x52cc67,_0x35b78b,_0xea341d);})['catch'](function(_0x10aed0){logger[_0x2e08('0x22')]('[%s][UPDATE][ERRORS:%s]',_0x52cc67,_0x10aed0);})[_0x2e08('0x23')](function(){delete _0x432ddb[_0x2e08('0x8')][_0x2555e8];});};Acw['prototype'][_0x2e08('0x24')]=function(_0x5cf2e3){try{var _0x5485ba=this;var _0x165920=this[_0x2e08('0x9')][_0x5cf2e3][_0x2e08('0x25')];var _0x49eae0=this[_0x2e08('0x9')][_0x5cf2e3][_0x2e08('0x26')];var _0x27a08f=this[_0x2e08('0x6')][_0x49eae0];var _0x21e4fd=![];var _0x17913a='ACW';if(_0x27a08f[_0x2e08('0x27')]&&_0x27a08f['mandatoryDispositionPause'][_0x2e08('0x28')]){_0x21e4fd=!![];_0x17913a=_0x27a08f['mandatoryDispositionPause'][_0x2e08('0x28')];}if(!_0x5485ba['agents'][_0x165920]){return Promise[_0x2e08('0x29')]();}return RpcUser['getAgent'](_0x5485ba[_0x2e08('0x7')][_0x165920]['id'])['then'](function(_0x3758cf){if(!_0x3758cf||_0x3758cf[_0x2e08('0x2a')]){logger[_0x2e08('0x20')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x5cf2e3,_0x165920,_0x49eae0);return;}logger['info'](_0x2e08('0x2b'),_0x5cf2e3,_0x165920,_0x49eae0);var _0x3d2657=_0x5485ba[_0x2e08('0x9')][_0x5cf2e3][_0x2e08('0x2c')]&&_0x5485ba[_0x2e08('0x9')][_0x5cf2e3][_0x2e08('0x2d')]?_0x5485ba[_0x2e08('0x9')][_0x5cf2e3]['destlinkedid']:_0x5cf2e3;return RpcUser['savePause'](_0x5485ba[_0x2e08('0x7')][_0x165920],_0x17913a,_0x3d2657)['then'](function(_0x55425e){_0x5485ba[_0x2e08('0x6')][_0x49eae0][_0x2e08('0x2e')]-=0x1;_0x5485ba[_0x2e08('0x6')][_0x49eae0][_0x2e08('0x2f')]+=0x1;return _0x55425e;});})['then'](function(_0x58ffd3){if(_0x21e4fd||!_0x58ffd3){return;}_0x5485ba[_0x2e08('0x8')][_0x165920]={};logger[_0x2e08('0x20')](_0x2e08('0x30'),_0x5cf2e3,_0x5485ba[_0x2e08('0x6')][_0x49eae0][_0x2e08('0x31')],_0x165920,_0x49eae0);_0x5485ba['timers'][_0x165920][_0x2e08('0x1d')]=setTimeout(_0x5485ba[_0x2e08('0x32')][_0x2e08('0x10')](_0x5485ba,_0x165920),_0x5485ba[_0x2e08('0x6')][_0x49eae0][_0x2e08('0x31')]*0x3e8);_0x5485ba[_0x2e08('0x8')][_0x165920][_0x2e08('0x1c')]=moment()[_0x2e08('0x33')](_0x2e08('0x34'));_0x5485ba[_0x2e08('0x8')][_0x165920][_0x2e08('0x1e')]=_0x5cf2e3;_0x5485ba['timers'][_0x165920]['queue']=_0x49eae0;_0x5485ba[_0x2e08('0x8')][_0x165920][_0x2e08('0x1b')]=_0x5485ba[_0x2e08('0x1b')]['bind'](_0x5485ba,_0x165920,_0x5cf2e3);})[_0x2e08('0x35')](function(){logger[_0x2e08('0x22')](_0x2e08('0x30'),_0x5cf2e3,_0x5485ba[_0x2e08('0x6')][_0x49eae0]['acwTimeout'],_0x165920,_0x49eae0);})['finally'](function(){delete _0x5485ba['channels'][_0x5cf2e3];});}catch(_0x3bd7f7){logger[_0x2e08('0x22')](_0x2e08('0x36'),_0x3bd7f7[_0x2e08('0x37')]);}};Acw[_0x2e08('0x38')][_0x2e08('0x32')]=function(_0x2f5cc5){try{var _0x4f5009=this;if(_0x4f5009[_0x2e08('0x8')][_0x2f5cc5]){_0x4f5009[_0x2e08('0x8')][_0x2f5cc5][_0x2e08('0x1d')]=![];var _0x4488d6=_0x4f5009[_0x2e08('0x8')][_0x2f5cc5]['uniqueid'];var _0x16d927=_0x4f5009[_0x2e08('0x8')][_0x2f5cc5]['queue'];var _0xd42a80=_0x4f5009[_0x2e08('0x6')][_0x16d927][_0x2e08('0x31')];logger['info']('[%s][TIMER][STOP][AGENT:%s]',_0x4488d6,_0x2f5cc5);RpcUser[_0x2e08('0x39')](this['agents'][_0x2f5cc5]['id'])[_0x2e08('0x1f')](function(_0x541366){if(_0x541366['pauseType']===_0x2e08('0x3a')){return RpcUser[_0x2e08('0x3b')](_0x4f5009[_0x2e08('0x7')][_0x2f5cc5]);}});RpcVoiceAgentReport[_0x2e08('0x3c')]({'acwtime':_0xd42a80,'agentacw':!![]},_0x4488d6,_0x2f5cc5)[_0x2e08('0x1f')](function(_0xafdbe4){logger[_0x2e08('0x20')](_0x2e08('0x21'),_0x4488d6,_0xd42a80,_0xafdbe4);})['catch'](function(_0xc289fd){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x4488d6,_0xc289fd);});}else{logger[_0x2e08('0x22')](_0x2e08('0x3d'),_0x2f5cc5);if(_0x4f5009[_0x2e08('0x8')]){logger[_0x2e08('0x20')](_0x2e08('0x3e'),JSON[_0x2e08('0x3f')](_0x4f5009[_0x2e08('0x8')]));}}}catch(_0x3709c1){logger[_0x2e08('0x22')]('[ACW][STOP]\x20%s',_0x3709c1[_0x2e08('0x37')]);}};Acw[_0x2e08('0x38')][_0x2e08('0xb')]=function(_0x28f0e6){try{if(this[_0x2e08('0x6')][_0x28f0e6[_0x2e08('0x26')]]&&(this['voiceQueues'][_0x28f0e6[_0x2e08('0x26')]][_0x2e08('0x40')]||this[_0x2e08('0x6')][_0x28f0e6[_0x2e08('0x26')]][_0x2e08('0x27')])){if(this['agents'][_0x28f0e6[_0x2e08('0x25')]]){this['channels'][_0x28f0e6[_0x2e08('0x1e')]]={'queue':_0x28f0e6[_0x2e08('0x26')],'interface':_0x28f0e6[_0x2e08('0x25')],'destlinkedid':_0x28f0e6[_0x2e08('0x2d')]};}}}catch(_0x2414c1){logger[_0x2e08('0x22')](_0x2e08('0x41'),_0x2414c1[_0x2e08('0x37')]);}};Acw['prototype'][_0x2e08('0x18')]=function(_0x1f3e7f){try{if(this[_0x2e08('0x6')][_0x1f3e7f[_0x2e08('0x26')]]&&(this['voiceQueues'][_0x1f3e7f[_0x2e08('0x26')]]['acw']||this[_0x2e08('0x6')][_0x1f3e7f['queue']][_0x2e08('0x27')])){if(this[_0x2e08('0x7')][_0x1f3e7f['interface']]){this[_0x2e08('0x9')][_0x1f3e7f['uniqueid']]={'queue':_0x1f3e7f[_0x2e08('0x26')],'interface':_0x1f3e7f['interface']};}}}catch(_0x4de769){logger[_0x2e08('0x22')]('[ACW][syncAgentConnectPreview]\x20%s',_0x4de769[_0x2e08('0x37')]);}};Acw[_0x2e08('0x38')][_0x2e08('0xd')]=function(_0x4abb39){try{if(this[_0x2e08('0x9')][_0x4abb39[_0x2e08('0x1e')]]&&_['isUndefined'](this[_0x2e08('0x9')][_0x4abb39[_0x2e08('0x1e')]][_0x2e08('0x2c')])){logger['info']('[%s][HANGUP:UNIQUEID]',_0x4abb39[_0x2e08('0x1e')]);this['startAcw'](_0x4abb39['uniqueid']);}else if(this['channels'][_0x4abb39['linkedid']]&&_[_0x2e08('0x42')](this['channels'][_0x4abb39[_0x2e08('0x43')]][_0x2e08('0x2c')])){logger[_0x2e08('0x20')](_0x2e08('0x44'),_0x4abb39[_0x2e08('0x43')]);this[_0x2e08('0x24')](_0x4abb39[_0x2e08('0x43')]);}}catch(_0x5d1566){logger[_0x2e08('0x22')](_0x2e08('0x45'),_0x5d1566[_0x2e08('0x37')]);}};Acw[_0x2e08('0x38')][_0x2e08('0xf')]=function(_0x564c24){try{if(this[_0x2e08('0x9')][_0x564c24[_0x2e08('0x1e')]]&&this[_0x2e08('0x9')][_0x564c24[_0x2e08('0x1e')]]['attended']){logger[_0x2e08('0x20')](_0x2e08('0x46'),_0x564c24[_0x2e08('0x1e')]);this[_0x2e08('0x24')](_0x564c24['uniqueid']);}else if(this[_0x2e08('0x9')][_0x564c24[_0x2e08('0x43')]]&&this[_0x2e08('0x9')][_0x564c24[_0x2e08('0x43')]][_0x2e08('0x2c')]){logger[_0x2e08('0x20')](_0x2e08('0x47'),_0x564c24['linkedid']);this[_0x2e08('0x24')](_0x564c24['linkedid']);}}catch(_0x3d3c37){logger[_0x2e08('0x22')](_0x2e08('0x48'),_0x3d3c37[_0x2e08('0x37')]);}};Acw[_0x2e08('0x38')]['syncAttendedTransfer']=function(_0x17d5e7){try{if(!_[_0x2e08('0x49')](this[_0x2e08('0x9')][_0x17d5e7[_0x2e08('0x4a')]])){this['startAcw'](_0x17d5e7['transfereeuniqueid']);if(this[_0x2e08('0x9')][_0x17d5e7[_0x2e08('0x4b')]]){this[_0x2e08('0x9')][_0x17d5e7[_0x2e08('0x4b')]][_0x2e08('0x2c')]=!![];this[_0x2e08('0x9')][_0x17d5e7[_0x2e08('0x4c')]]=this[_0x2e08('0x9')][_0x17d5e7[_0x2e08('0x4b')]];delete this[_0x2e08('0x9')][_0x17d5e7[_0x2e08('0x4b')]];}}else if(!_[_0x2e08('0x49')](this[_0x2e08('0x9')][_0x17d5e7[_0x2e08('0x4c')]])){this[_0x2e08('0x24')](_0x17d5e7[_0x2e08('0x4c')]);if(this[_0x2e08('0x9')][_0x17d5e7[_0x2e08('0x4d')]]){this[_0x2e08('0x9')][_0x17d5e7['origtransfereruniqueid']][_0x2e08('0x2c')]=!![];this[_0x2e08('0x9')][_0x17d5e7[_0x2e08('0x4a')]]=this[_0x2e08('0x9')][_0x17d5e7[_0x2e08('0x4d')]];delete this[_0x2e08('0x9')][_0x17d5e7[_0x2e08('0x4d')]];}}}catch(_0x52278f){logger[_0x2e08('0x22')](_0x2e08('0x4e'),_0x52278f[_0x2e08('0x37')]);}};Acw[_0x2e08('0x38')][_0x2e08('0x16')]=function(_0x1c8607){try{if(this[_0x2e08('0x9')][_0x1c8607[_0x2e08('0x4f')]]){logger[_0x2e08('0x20')](_0x2e08('0x50'),JSON['stringify'](_0x1c8607[_0x2e08('0x4f')]));this[_0x2e08('0x24')](_0x1c8607['transfereruniqueid']);}else if(this[_0x2e08('0x9')][_0x1c8607[_0x2e08('0x51')]]){logger['info'](_0x2e08('0x52'),JSON[_0x2e08('0x3f')](_0x1c8607[_0x2e08('0x51')]));this[_0x2e08('0x24')](_0x1c8607['transfererlinkedid']);}}catch(_0x286dd9){logger[_0x2e08('0x22')](_0x2e08('0x53'),_0x286dd9[_0x2e08('0x37')]);}};Acw['prototype'][_0x2e08('0x12')]=function(_0x40c104){try{if(this[_0x2e08('0x6')][_0x40c104[_0x2e08('0x26')]]&&this['voiceQueues'][_0x40c104[_0x2e08('0x26')]][_0x2e08('0x54')]===_0x2e08('0x55')){if(this[_0x2e08('0x7')][_0x40c104[_0x2e08('0x25')]]){logger[_0x2e08('0x20')](_0x2e08('0x56'),_0x40c104[_0x2e08('0x1e')],_0x40c104[_0x2e08('0x25')],_0x40c104[_0x2e08('0x26')]);return RpcUser[_0x2e08('0x57')](this[_0x2e08('0x7')][_0x40c104[_0x2e08('0x25')]],_0x2e08('0x58'),_0x40c104['uniqueid']);}}}catch(_0x5c1e4e){logger['error'](_0x2e08('0x59'),_0x5c1e4e[_0x2e08('0x37')]);}};module[_0x2e08('0x5a')]=Acw; \ No newline at end of file +var _0x453b=['acw','../rpc/user','voiceQueues','agents','timers','channels','syncAgentConnect','bind','syncHangupRequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','blindtransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','updateAcw','lastPauseAt','timer','update','uniqueid','then','info','[%s][UPDATE][ACWTIME:%s]','[%s][UPDATE][ERRORS:%s]','prototype','interface','queue','ACW','mandatoryDisposition','name','mandatoryDispositionPause','resolve','getAgent','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','paused','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','format','YYYY-MM-DD\x20HH:mm:ss','catch','error','finally','[ACW][START]\x20%s','message','pauseType','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','syncAttendedTransfer','isNil','transfereeuniqueid','transfertargetuniqueid','secondtransfereruniqueid','origtransfereruniqueid','syncBlindTransfer','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','moment','../ami'];(function(_0x3874ae,_0x43e259){var _0x4ce656=function(_0x1cd85b){while(--_0x1cd85b){_0x3874ae['push'](_0x3874ae['shift']());}};_0x4ce656(++_0x43e259);}(_0x453b,0x19d));var _0xb453=function(_0x6cf3b6,_0x4b7560){_0x6cf3b6=_0x6cf3b6-0x0;var _0xdbe948=_0x453b[_0x6cf3b6];return _0xdbe948;};'use strict';var _=require('lodash');var moment=require(_0xb453('0x0'));var ami=require(_0xb453('0x1'));var logger=require('../../../config/logger')(_0xb453('0x2'));var RpcUser=require(_0xb453('0x3'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0xd7631){this[_0xb453('0x4')]=_0xd7631[_0xb453('0x4')];this['agents']=_0xd7631[_0xb453('0x5')];this[_0xb453('0x6')]=_0xd7631['timers'];this[_0xb453('0x7')]={};ami['on']('agentconnect',this[_0xb453('0x8')][_0xb453('0x9')](this));ami['on']('hanguprequest',this[_0xb453('0xa')]['bind'](this));ami['on'](_0xb453('0xb'),this['syncHangup'][_0xb453('0x9')](this));ami['on'](_0xb453('0xc'),this[_0xb453('0xd')]['bind'](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0xb453('0x9')](this));ami['on'](_0xb453('0xe'),this['syncBlindTransfer'][_0xb453('0x9')](this));ami['on'](_0xb453('0xf'),this[_0xb453('0x10')][_0xb453('0x9')](this));}function getDiff(_0x2af45e){var _0x5c3440=moment()['milliseconds'](0x0);var _0x385f4b=moment(_0x2af45e)[_0xb453('0x11')](0x0);return _0x5c3440[_0xb453('0x12')](_0x385f4b,'seconds');}Acw['prototype'][_0xb453('0x13')]=function(_0x2fe3fe,_0x363f79){var _0x127117=this;var _0x2ceafe=getDiff(_0x127117[_0xb453('0x6')][_0x2fe3fe][_0xb453('0x14')]);clearTimeout(_0x127117[_0xb453('0x6')][_0x2fe3fe]['timer']);_0x127117[_0xb453('0x6')][_0x2fe3fe][_0xb453('0x15')]=![];return RpcVoiceAgentReport[_0xb453('0x16')]({'acwtime':_0x2ceafe},_0x127117['timers'][_0x2fe3fe][_0xb453('0x17')],_0x2fe3fe)[_0xb453('0x18')](function(_0x4f9cc8){logger[_0xb453('0x19')](_0xb453('0x1a'),_0x363f79,_0x2ceafe,_0x4f9cc8);})['catch'](function(_0x29657c){logger['error'](_0xb453('0x1b'),_0x363f79,_0x29657c);})['finally'](function(){delete _0x127117[_0xb453('0x6')][_0x2fe3fe];});};Acw[_0xb453('0x1c')]['startAcw']=function(_0x14f844){try{var _0x208547=this;var _0x497888=this['channels'][_0x14f844][_0xb453('0x1d')];var _0x4aa8a7=this['channels'][_0x14f844][_0xb453('0x1e')];var _0x467bc7=this[_0xb453('0x4')][_0x4aa8a7];var _0x2e321f=![];var _0xcf2665=_0xb453('0x1f');if(_0x467bc7[_0xb453('0x20')]&&_0x467bc7['mandatoryDispositionPause'][_0xb453('0x21')]){_0x2e321f=!![];_0xcf2665=_0x467bc7[_0xb453('0x22')][_0xb453('0x21')];}if(!_0x208547['agents'][_0x497888]){return Promise[_0xb453('0x23')]();}return RpcUser[_0xb453('0x24')](_0x208547[_0xb453('0x5')][_0x497888]['id'])[_0xb453('0x18')](function(_0x3d1929){if(!_0x3d1929||_0x3d1929['voicePause']){logger['info']('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x14f844,_0x497888,_0x4aa8a7);return;}logger['info'](_0xb453('0x25'),_0x14f844,_0x497888,_0x4aa8a7);var _0x32046f=_0x208547[_0xb453('0x7')][_0x14f844][_0xb453('0x26')]&&_0x208547[_0xb453('0x7')][_0x14f844][_0xb453('0x27')]?_0x208547[_0xb453('0x7')][_0x14f844][_0xb453('0x27')]:_0x14f844;return RpcUser[_0xb453('0x28')](_0x208547[_0xb453('0x5')][_0x497888],_0xcf2665,_0x32046f)[_0xb453('0x18')](function(_0x1ce658){_0x208547[_0xb453('0x4')][_0x4aa8a7]['available']-=0x1;_0x208547[_0xb453('0x4')][_0x4aa8a7][_0xb453('0x29')]+=0x1;return _0x1ce658;});})[_0xb453('0x18')](function(_0x2c13fe){if(_0x2e321f||!_0x2c13fe){return;}_0x208547['timers'][_0x497888]={};logger['info'](_0xb453('0x2a'),_0x14f844,_0x208547[_0xb453('0x4')][_0x4aa8a7][_0xb453('0x2b')],_0x497888,_0x4aa8a7);_0x208547[_0xb453('0x6')][_0x497888][_0xb453('0x15')]=setTimeout(_0x208547[_0xb453('0x2c')][_0xb453('0x9')](_0x208547,_0x497888),_0x208547[_0xb453('0x4')][_0x4aa8a7]['acwTimeout']*0x3e8);_0x208547[_0xb453('0x6')][_0x497888][_0xb453('0x14')]=moment()[_0xb453('0x2d')](_0xb453('0x2e'));_0x208547[_0xb453('0x6')][_0x497888]['uniqueid']=_0x14f844;_0x208547[_0xb453('0x6')][_0x497888][_0xb453('0x1e')]=_0x4aa8a7;_0x208547[_0xb453('0x6')][_0x497888][_0xb453('0x13')]=_0x208547[_0xb453('0x13')][_0xb453('0x9')](_0x208547,_0x497888,_0x14f844);})[_0xb453('0x2f')](function(){logger[_0xb453('0x30')](_0xb453('0x2a'),_0x14f844,_0x208547['voiceQueues'][_0x4aa8a7][_0xb453('0x2b')],_0x497888,_0x4aa8a7);})[_0xb453('0x31')](function(){delete _0x208547['channels'][_0x14f844];});}catch(_0x2f1400){logger[_0xb453('0x30')](_0xb453('0x32'),_0x2f1400[_0xb453('0x33')]);}};Acw[_0xb453('0x1c')][_0xb453('0x2c')]=function(_0x3bc7e0){try{var _0x1a46ff=this;if(_0x1a46ff['timers'][_0x3bc7e0]){_0x1a46ff[_0xb453('0x6')][_0x3bc7e0][_0xb453('0x15')]=![];var _0x8cf047=_0x1a46ff[_0xb453('0x6')][_0x3bc7e0]['uniqueid'];var _0xd94ab2=_0x1a46ff[_0xb453('0x6')][_0x3bc7e0][_0xb453('0x1e')];var _0x145438=_0x1a46ff[_0xb453('0x4')][_0xd94ab2][_0xb453('0x2b')];logger['info']('[%s][TIMER][STOP][AGENT:%s]',_0x8cf047,_0x3bc7e0);RpcUser[_0xb453('0x24')](this['agents'][_0x3bc7e0]['id'])[_0xb453('0x18')](function(_0x2a5934){if(_0x2a5934[_0xb453('0x34')]===_0xb453('0x1f')){return RpcUser[_0xb453('0x35')](_0x1a46ff['agents'][_0x3bc7e0]);}});RpcVoiceAgentReport[_0xb453('0x16')]({'acwtime':_0x145438,'agentacw':!![]},_0x8cf047,_0x3bc7e0)['then'](function(_0x1bfd34){logger[_0xb453('0x19')](_0xb453('0x1a'),_0x8cf047,_0x145438,_0x1bfd34);})[_0xb453('0x2f')](function(_0x1c18fb){logger[_0xb453('0x30')](_0xb453('0x1b'),_0x8cf047,_0x1c18fb);});}else{logger[_0xb453('0x30')](_0xb453('0x36'),_0x3bc7e0);if(_0x1a46ff[_0xb453('0x6')]){logger['info']('[ACW][TIMERS]',JSON[_0xb453('0x37')](_0x1a46ff['timers']));}}}catch(_0x4e599b){logger[_0xb453('0x30')](_0xb453('0x38'),_0x4e599b[_0xb453('0x33')]);}};Acw[_0xb453('0x1c')][_0xb453('0x8')]=function(_0x5d2216){try{if(this[_0xb453('0x4')][_0x5d2216[_0xb453('0x1e')]]&&(this[_0xb453('0x4')][_0x5d2216[_0xb453('0x1e')]]['acw']||this[_0xb453('0x4')][_0x5d2216[_0xb453('0x1e')]]['mandatoryDisposition'])){if(this[_0xb453('0x5')][_0x5d2216[_0xb453('0x1d')]]){this[_0xb453('0x7')][_0x5d2216[_0xb453('0x17')]]={'queue':_0x5d2216[_0xb453('0x1e')],'interface':_0x5d2216[_0xb453('0x1d')],'destlinkedid':_0x5d2216['destlinkedid']};}}}catch(_0x4d9236){logger[_0xb453('0x30')]('[ACW][syncAgentConnect]\x20%s',_0x4d9236[_0xb453('0x33')]);}};Acw['prototype'][_0xb453('0x10')]=function(_0x45e565){try{if(this[_0xb453('0x4')][_0x45e565[_0xb453('0x1e')]]&&(this[_0xb453('0x4')][_0x45e565[_0xb453('0x1e')]][_0xb453('0x2')]||this[_0xb453('0x4')][_0x45e565['queue']][_0xb453('0x20')])){if(this['agents'][_0x45e565['interface']]){this[_0xb453('0x7')][_0x45e565['uniqueid']]={'queue':_0x45e565[_0xb453('0x1e')],'interface':_0x45e565[_0xb453('0x1d')]};}}}catch(_0x465544){logger[_0xb453('0x30')](_0xb453('0x39'),_0x465544[_0xb453('0x33')]);}};Acw[_0xb453('0x1c')][_0xb453('0xa')]=function(_0x637deb){try{if(this['channels'][_0x637deb['uniqueid']]&&_[_0xb453('0x3a')](this[_0xb453('0x7')][_0x637deb[_0xb453('0x17')]][_0xb453('0x26')])){logger['info'](_0xb453('0x3b'),_0x637deb[_0xb453('0x17')]);this[_0xb453('0x3c')](_0x637deb[_0xb453('0x17')]);}else if(this[_0xb453('0x7')][_0x637deb[_0xb453('0x3d')]]&&_['isUndefined'](this[_0xb453('0x7')][_0x637deb['linkedid']][_0xb453('0x26')])){logger['info']('[%s][HANGUP:LINKEDID]',_0x637deb[_0xb453('0x3d')]);this[_0xb453('0x3c')](_0x637deb[_0xb453('0x3d')]);}}catch(_0x531b22){logger[_0xb453('0x30')](_0xb453('0x3e'),_0x531b22['message']);}};Acw[_0xb453('0x1c')]['syncHangup']=function(_0x3e40f6){try{if(this[_0xb453('0x7')][_0x3e40f6[_0xb453('0x17')]]&&this[_0xb453('0x7')][_0x3e40f6[_0xb453('0x17')]]['attended']){logger[_0xb453('0x19')](_0xb453('0x3f'),_0x3e40f6['uniqueid']);this[_0xb453('0x3c')](_0x3e40f6['uniqueid']);}else if(this[_0xb453('0x7')][_0x3e40f6['linkedid']]&&this[_0xb453('0x7')][_0x3e40f6[_0xb453('0x3d')]][_0xb453('0x26')]){logger['info'](_0xb453('0x40'),_0x3e40f6[_0xb453('0x3d')]);this['startAcw'](_0x3e40f6[_0xb453('0x3d')]);}}catch(_0x1d4a66){logger[_0xb453('0x30')](_0xb453('0x41'),_0x1d4a66[_0xb453('0x33')]);}};Acw[_0xb453('0x1c')][_0xb453('0x42')]=function(_0x4f789f){try{if(!_[_0xb453('0x43')](this[_0xb453('0x7')][_0x4f789f[_0xb453('0x44')]])){this[_0xb453('0x3c')](_0x4f789f['transfereeuniqueid']);if(this['channels'][_0x4f789f['secondtransfereruniqueid']]){this['channels'][_0x4f789f['secondtransfereruniqueid']][_0xb453('0x26')]=!![];this[_0xb453('0x7')][_0x4f789f[_0xb453('0x45')]]=this[_0xb453('0x7')][_0x4f789f[_0xb453('0x46')]];delete this[_0xb453('0x7')][_0x4f789f['secondtransfereruniqueid']];}}else if(!_[_0xb453('0x43')](this[_0xb453('0x7')][_0x4f789f[_0xb453('0x45')]])){this[_0xb453('0x3c')](_0x4f789f[_0xb453('0x45')]);if(this[_0xb453('0x7')][_0x4f789f[_0xb453('0x47')]]){this[_0xb453('0x7')][_0x4f789f[_0xb453('0x47')]]['attended']=!![];this[_0xb453('0x7')][_0x4f789f[_0xb453('0x44')]]=this[_0xb453('0x7')][_0x4f789f[_0xb453('0x47')]];delete this[_0xb453('0x7')][_0x4f789f[_0xb453('0x47')]];}}}catch(_0x49af47){logger[_0xb453('0x30')]('[ACW][syncAttendedTransfer]\x20%s',_0x49af47['message']);}};Acw[_0xb453('0x1c')][_0xb453('0x48')]=function(_0x1aedf8){try{if(this[_0xb453('0x7')][_0x1aedf8['transfereruniqueid']]){logger[_0xb453('0x19')](_0xb453('0x49'),JSON[_0xb453('0x37')](_0x1aedf8[_0xb453('0x4a')]));this[_0xb453('0x3c')](_0x1aedf8[_0xb453('0x4a')]);}else if(this[_0xb453('0x7')][_0x1aedf8['transfererlinkedid']]){logger[_0xb453('0x19')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0xb453('0x37')](_0x1aedf8[_0xb453('0x4b')]));this[_0xb453('0x3c')](_0x1aedf8[_0xb453('0x4b')]);}}catch(_0x21efcc){logger[_0xb453('0x30')](_0xb453('0x4c'),_0x21efcc[_0xb453('0x33')]);}};Acw[_0xb453('0x1c')][_0xb453('0xd')]=function(_0x1fa868){try{if(this[_0xb453('0x4')][_0x1fa868['queue']]&&this['voiceQueues'][_0x1fa868['queue']][_0xb453('0x4d')]===_0xb453('0x4e')){if(this[_0xb453('0x5')][_0x1fa868[_0xb453('0x1d')]]){logger['info'](_0xb453('0x4f'),_0x1fa868['uniqueid'],_0x1fa868[_0xb453('0x1d')],_0x1fa868['queue']);return RpcUser[_0xb453('0x28')](this[_0xb453('0x5')][_0x1fa868[_0xb453('0x1d')]],_0xb453('0x50'),_0x1fa868['uniqueid']);}}}catch(_0xe8e8a3){logger[_0xb453('0x30')](_0xb453('0x51'),_0xe8e8a3[_0xb453('0x33')]);}};module[_0xb453('0x52')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index af9c317..254753b 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 _0x1334=['Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','connect','shutdown','inspect','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionDeviceStateList','actionQueueSummary','catch','close','exports','asterisk-manager','bluebird','util','../../config/logger','ami','../../config/environment','port','asterisk','Action','promisify','error','format','username','actionSipShowRegistry','sipshowregistry','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info'];(function(_0x4fbd85,_0x26945a){var _0x3341da=function(_0xeeb51){while(--_0xeeb51){_0x4fbd85['push'](_0x4fbd85['shift']());}};_0x3341da(++_0x26945a);}(_0x1334,0x1a5));var _0x4133=function(_0xcfeff4,_0x3f2e19){_0xcfeff4=_0xcfeff4-0x0;var _0xb2fadc=_0x1334[_0xcfeff4];return _0xb2fadc;};'use strict';var Manager=require(_0x4133('0x0'));var BPromise=require(_0x4133('0x1'));var util=require(_0x4133('0x2'));var logger=require(_0x4133('0x3'))(_0x4133('0x4'));var config=require(_0x4133('0x5'));var ami=new Manager(config['asterisk'][_0x4133('0x6')],config[_0x4133('0x7')]['ip'],config[_0x4133('0x7')]['username'],config[_0x4133('0x7')]['password'],!![]);ami['keepConnected']();ami[_0x4133('0x8')]=BPromise[_0x4133('0x9')](ami['action']);function error(_0x458b97){logger[_0x4133('0xa')](util[_0x4133('0xb')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x4133('0x7')][_0x4133('0xc')],config['asterisk']['ip'],config['asterisk'][_0x4133('0x6')],util['inspect'](_0x458b97,![],null)));}function close(){logger['error'](util[_0x4133('0xb')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0x4133('0x7')][_0x4133('0xc')],config[_0x4133('0x7')]['ip'],config['asterisk'][_0x4133('0x6')]));}ami[_0x4133('0xd')]=function(){return function(){return ami[_0x4133('0x8')]({'action':_0x4133('0xe')});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x4133('0x8')]({'action':'devicestatelist'});};};ami[_0x4133('0xf')]=function(){return function(){return ami[_0x4133('0x8')]({'action':_0x4133('0x10')});};};ami['actionQueueSummary']=function(){return function(){return ami[_0x4133('0x8')]({'action':_0x4133('0x11')});};};ami[_0x4133('0x12')]=function(){return function(){return ami['Action']({'action':_0x4133('0x13')});};};function connect(){logger[_0x4133('0x14')](util['format'](_0x4133('0x15'),config[_0x4133('0x7')][_0x4133('0xc')],config[_0x4133('0x7')]['ip'],config[_0x4133('0x7')]['port']));ami['once'](_0x4133('0xa'),error);ami[_0x4133('0x16')]('close',close);}ami['on'](_0x4133('0x17'),connect);ami['on'](_0x4133('0x18'),function(_0x142fcd){logger['info'](util[_0x4133('0xb')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0x4133('0x7')][_0x4133('0xc')],config['asterisk']['ip'],config[_0x4133('0x7')]['port'],util[_0x4133('0x19')](_0x142fcd,![],null)));});ami['on']('fullybooted',function(){logger[_0x4133('0x14')](util['format'](_0x4133('0x1a'),config[_0x4133('0x7')][_0x4133('0xc')],config[_0x4133('0x7')]['ip'],config['asterisk'][_0x4133('0x6')]));return Promise[_0x4133('0x1b')]()[_0x4133('0x1c')](ami[_0x4133('0xd')]())[_0x4133('0x1c')](ami[_0x4133('0x1d')]())[_0x4133('0x1c')](ami[_0x4133('0xf')]())[_0x4133('0x1c')](ami[_0x4133('0x1e')]())[_0x4133('0x1c')](ami['actionCoreShowChannels']())[_0x4133('0x1f')](function(_0x36c417){logger[_0x4133('0xa')]('[ami.js][fullybooted]',util['inspect'](_0x36c417,{'showHidden':![],'depth':null}));});});ami[_0x4133('0x16')](_0x4133('0xa'),error);ami['once'](_0x4133('0x20'),close);module[_0x4133('0x21')]=ami; \ No newline at end of file +var _0xa23b=['inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','fullybooted','resolve','then','actionSipShowRegistry','actionQueueSummary','catch','[ami.js][fullybooted]','exports','bluebird','../../config/logger','../../config/environment','asterisk','port','password','keepConnected','Action','error','format','username'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa23b,0x1d1));var _0xba23=function(_0x373016,_0x58e861){_0x373016=_0x373016-0x0;var _0xf028d0=_0xa23b[_0x373016];return _0xf028d0;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0xba23('0x0'));var util=require('util');var logger=require(_0xba23('0x1'))('ami');var config=require(_0xba23('0x2'));var ami=new Manager(config[_0xba23('0x3')][_0xba23('0x4')],config[_0xba23('0x3')]['ip'],config[_0xba23('0x3')]['username'],config[_0xba23('0x3')][_0xba23('0x5')],!![]);ami[_0xba23('0x6')]();ami[_0xba23('0x7')]=BPromise['promisify'](ami['action']);function error(_0x4e94b6){logger[_0xba23('0x8')](util[_0xba23('0x9')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0xba23('0x3')][_0xba23('0xa')],config[_0xba23('0x3')]['ip'],config['asterisk']['port'],util[_0xba23('0xb')](_0x4e94b6,![],null)));}function close(){logger['error'](util[_0xba23('0x9')](_0xba23('0xc'),config[_0xba23('0x3')][_0xba23('0xa')],config[_0xba23('0x3')]['ip'],config[_0xba23('0x3')][_0xba23('0x4')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0xba23('0x7')]({'action':'sipshowregistry'});};};ami[_0xba23('0xd')]=function(){return function(){return ami[_0xba23('0x7')]({'action':_0xba23('0xe')});};};ami[_0xba23('0xf')]=function(){return function(){return ami[_0xba23('0x7')]({'action':_0xba23('0x10')});};};ami['actionQueueSummary']=function(){return function(){return ami[_0xba23('0x7')]({'action':_0xba23('0x11')});};};ami[_0xba23('0x12')]=function(){return function(){return ami[_0xba23('0x7')]({'action':_0xba23('0x13')});};};function connect(){logger[_0xba23('0x14')](util['format'](_0xba23('0x15'),config[_0xba23('0x3')][_0xba23('0xa')],config[_0xba23('0x3')]['ip'],config[_0xba23('0x3')][_0xba23('0x4')]));ami[_0xba23('0x16')](_0xba23('0x8'),error);ami[_0xba23('0x16')](_0xba23('0x17'),close);}ami['on'](_0xba23('0x18'),connect);ami['on'](_0xba23('0x19'),function(_0x5585bc){logger[_0xba23('0x14')](util[_0xba23('0x9')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0xba23('0x3')][_0xba23('0xa')],config[_0xba23('0x3')]['ip'],config[_0xba23('0x3')]['port'],util[_0xba23('0xb')](_0x5585bc,![],null)));});ami['on'](_0xba23('0x1a'),function(){logger[_0xba23('0x14')](util[_0xba23('0x9')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0xba23('0x3')][_0xba23('0xa')],config[_0xba23('0x3')]['ip'],config[_0xba23('0x3')][_0xba23('0x4')]));return Promise[_0xba23('0x1b')]()[_0xba23('0x1c')](ami[_0xba23('0x1d')]())['then'](ami[_0xba23('0xd')]())['then'](ami[_0xba23('0xf')]())[_0xba23('0x1c')](ami[_0xba23('0x1e')]())[_0xba23('0x1c')](ami[_0xba23('0x12')]())[_0xba23('0x1f')](function(_0x55cefc){logger[_0xba23('0x8')](_0xba23('0x20'),util[_0xba23('0xb')](_0x55cefc,{'showHidden':![],'depth':null}));});});ami[_0xba23('0x16')]('error',error);ami[_0xba23('0x16')](_0xba23('0x17'),close);module[_0xba23('0x21')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 21a82c8..44e7a14 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 _0xb7e7=['exports','jayson/promise','../../config/logger','client','Request','debug','rpc','error','memberReport','message','result','catch'];(function(_0x4f3b2d,_0x3bbf46){var _0x3dddfa=function(_0xb8179a){while(--_0xb8179a){_0x4f3b2d['push'](_0x4f3b2d['shift']());}};_0x3dddfa(++_0x3bbf46);}(_0xb7e7,0x121));var _0x7b7e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb7e7[_0x20a584];return _0x4b41a8;};'use strict';var jayson=require(_0x7b7e('0x0'));var BPromise=require('bluebird');var logger=require(_0x7b7e('0x1'))('ami');var client=jayson[_0x7b7e('0x2')]['http']({'port':0x2329});client[_0x7b7e('0x3')]=function(_0x556d68,_0x31d0ed){return new BPromise(function(_0x118577,_0x1d9384){return client['request'](_0x556d68,_0x31d0ed)['then'](function(_0x333fa4){logger[_0x7b7e('0x4')](_0x7b7e('0x5'),'memberReport',_0x556d68,_0x31d0ed,_0x333fa4);if(_0x333fa4[_0x7b7e('0x6')]){logger[_0x7b7e('0x6')](_0x7b7e('0x5'),_0x7b7e('0x7'),_0x556d68,_0x333fa4[_0x7b7e('0x6')][_0x7b7e('0x8')],_0x31d0ed);return _0x1d9384(_0x333fa4[_0x7b7e('0x6')]['message']);}else{return _0x118577(_0x333fa4[_0x7b7e('0x9')]);}})[_0x7b7e('0xa')](function(_0x10a666){logger[_0x7b7e('0x6')](_0x7b7e('0x5'),_0x7b7e('0x7'),_0x556d68,_0x10a666,_0x31d0ed);return _0x1d9384(_0x10a666);});});};module[_0x7b7e('0xb')]=client; \ No newline at end of file +var _0xcb91=['request','debug','memberReport','error','rpc','message','result','catch','exports','../../config/logger','ami','client','http'];(function(_0x152121,_0x120c53){var _0x592a85=function(_0x241cab){while(--_0x241cab){_0x152121['push'](_0x152121['shift']());}};_0x592a85(++_0x120c53);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4b03c9,_0x17ce03){_0x4b03c9=_0x4b03c9-0x0;var _0x161ba2=_0xcb91[_0x4b03c9];return _0x161ba2;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var client=jayson[_0x1cb9('0x2')][_0x1cb9('0x3')]({'port':0x2329});client['Request']=function(_0x8c392f,_0x2c17b8){return new BPromise(function(_0x545a34,_0x13d5fd){return client[_0x1cb9('0x4')](_0x8c392f,_0x2c17b8)['then'](function(_0x226b69){logger[_0x1cb9('0x5')]('rpc',_0x1cb9('0x6'),_0x8c392f,_0x2c17b8,_0x226b69);if(_0x226b69[_0x1cb9('0x7')]){logger['error'](_0x1cb9('0x8'),'memberReport',_0x8c392f,_0x226b69['error'][_0x1cb9('0x9')],_0x2c17b8);return _0x13d5fd(_0x226b69[_0x1cb9('0x7')][_0x1cb9('0x9')]);}else{return _0x545a34(_0x226b69[_0x1cb9('0xa')]);}})[_0x1cb9('0xb')](function(_0x50ce71){logger[_0x1cb9('0x7')](_0x1cb9('0x8'),_0x1cb9('0x6'),_0x8c392f,_0x50ce71,_0x2c17b8);return _0x13d5fd(_0x50ce71);});});};module[_0x1cb9('0xc')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 437e390..1750b3b 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 _0x1b1a=['[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','launchHandleIvr','handleIvr','actionOriginate','object','voiceQueue\x20is\x20undefine','phone','originate','getCaller','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','setXMDContactVariables','Trunk','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','from-sip','dialOriginateTimeout','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Drop]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','reason','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberRetryFrequency','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','custom:agentnoanswer','outboundBusyCallsDay','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','predictiveIntervalAvailable','round','predictiveIntervalMinThreshold','floor','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','dialPredictiveInterval','avgHandleTime','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','getDataPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalHitRate','dialPredictiveOptimization','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalAnsweredCalls','predictiveIntervalPauses','[CatchErlangB]','loggedIn','predictiveIntervalTotalCalls','check\x20failure','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[booked][checkContactBlack][else]','dialRecallMeTimeout','voicePause','unlockContact','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','limitCalls','temp','getContactDialerIvr','checkContactEmpty','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','checkIsBlackListIvr','[getContactCampaign2]','dialLimitQueue','not_inuse','getContactDialer','RUNNING','Contact','checkIsBlackList','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','checkContactLowerLimitOriginate','countReScheduled','[countReScheduled]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','[busyFactor]','p\x20=\x20','Umin\x20=\x20','exports','util','lodash','uuid','moment','ioredis','./utils/hopper','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','../rpc/interval','./models/action','./models/history','./models/final','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','env','XCALLY_IP_AGI','127.0.0.1','enqueue','tail','finally','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','uniqueId','optionPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','bind','queuecallerabandon','originateresponse','syncOriginateResponse','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','syncQueueMember','syncQueueStatusComplete','loopCampaigns','getSettings','then','previewRecallmeReminderInterval','emit','type','outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','name','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','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','isUndefined','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','predictiveIntervalAvgHoldtime','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','erlangBusyFactor','---------------------------','merge','getSeconds','startProgressive\x20value\x20cleared','startPredictive','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','statedesc','starttime','queueStatusComplete','[booked][unlockQueueStatus]','stringify','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','INACTIVE','\x20NOT\x20Active','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','DISACTIVED','is\x20disactive','[ifTime][Action]','Error','prototype','isTrunkReachable','active','SIP/%s','status','reachable','unmonitored','checkIsTrunkReachable','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','Failure','\x20Intervals\x20is\x20null\x20','ifTime','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','length','push','Action','command','interval','content','true','catch','iftime\x20%s,%s','indexOf','some','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','syncCampaigns','undefined','isIVRCampaign','isIVRCampaignActive','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','[syncCampaigns]','checkDialMethod','dialMethod','progressive','dialPowerLevel','handlePower','Queue','method\x20not\x20recognized','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','OVERTIME_GLOBAL_INTERVAL','\x20Interval\x20is\x20overtime:\x20','isGlobal','AMI\x20IfTime','queue','uniqueid','answertime','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','syncQueueCallerAbandon','ivr','updateOriginated','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','TIMEOUT','countdropretry','countglobal','dialDropRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','voiceQueue','additional','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','add','ContactId','ListId','VoiceQueueId','Drop','endtime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','Abandoned','dropreason','CALLEREXIT','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','countabandonedretry','minutes','[rescheduleContact][Abandoned]','channel','actions','actionid','strategy','rrmemory','isNil','locked','stateinterface','pick','idHopper','paused','roundrobin','run','CampaignId','[unlock][syncQueueStatusComplete]','_rr','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','preview','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock3][syncQueueStatusComplete]','Success','callProgressDetecting','[callProgressDetecting]\x20','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','AMD','buildObj','[syncHangupInAMD]','MACHINE','membername','countmachineretry','custom:amd','amd','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','[syncAgentComplete][createHistory][0]','countnosuchnumberretry','dialGlobalMaxRetry','dialMachineRetryFrequency','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','dialQueueProject','AnswerAGI','AGI','cause-txt','outboundUnknownCallsDay','Unknow','[syncHangupIvr]','running','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','resolve','available','talking','pTalking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','syncQueueSummaryComplete','throttle','dialPreviewRecallmeReminder','filter','online','handlePreviewRecallNotifications','map','Agent','user:dialPreviewRecallReminder','checkPreviewRecallReminder','loopClearZombieChannels','[uniqueid]','clearZombieChannels','[actions]','No\x20such\x20channel','getVoiceQueueRtPauses','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','notFound','saveInDb','UserId','[emptyContact][createHistory]'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x1b1a,0xce));var _0xa1b1=function(_0x5471ec,_0x1ce81a){_0x5471ec=_0x5471ec-0x0;var _0x121d4c=_0x1b1a[_0x5471ec];return _0x121d4c;};'use strict';var util=require(_0xa1b1('0x0'));var _=require(_0xa1b1('0x1'));var uuid=require(_0xa1b1('0x2'));var moment=require(_0xa1b1('0x3'));var rr=require('rr');var Redis=require(_0xa1b1('0x4'));var utils=require('./utils');var hopperUtils=require(_0xa1b1('0x5'));var ut=require('../preview/util/util');var config=require('../../../config/environment/');var logger=require(_0xa1b1('0x6'))(_0xa1b1('0x7'));var loggerBooked=require('../../../config/logger')(_0xa1b1('0x8'));var loggerPredictive=require('../../../config/logger')(_0xa1b1('0x9'));var loggerPredictiveCalls=require(_0xa1b1('0x6'))(_0xa1b1('0xa'));var loggerSyncQueueSummary=require(_0xa1b1('0x6'))(_0xa1b1('0xb'));var ami=require(_0xa1b1('0xc'));config[_0xa1b1('0xd')]=_['defaults'](config[_0xa1b1('0xd')],{'host':_0xa1b1('0xe'),'port':0x18eb});var io=require(_0xa1b1('0xf'))(new Redis(config[_0xa1b1('0xd')]));var cmHopper=require(_0xa1b1('0x10'));var voiceQueueRt=require(_0xa1b1('0x11'));var RpcSetting=require(_0xa1b1('0x12'));var Interval=require(_0xa1b1('0x13'));var Action=require(_0xa1b1('0x14'));var History=require(_0xa1b1('0x15'));var Final=require(_0xa1b1('0x16'));var AgentComplete=require(_0xa1b1('0x17'));var QueueCallerAbandon=require(_0xa1b1('0x18'));var Hangup=require(_0xa1b1('0x19'));var ipAgi=process[_0xa1b1('0x1a')][_0xa1b1('0x1b')]||_0xa1b1('0x1c');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype'][_0xa1b1('0x1d')]=function(_0x492873){this[_0xa1b1('0x1e')]=this[_0xa1b1('0x1e')]?this['tail'][_0xa1b1('0x1f')](_0x492873):_0x492873();};function Dialer(_0x3fadf2,_0x2d170c){this['sequence']=new Sequence();this['preview']=_0x2d170c;this['voiceQueues']=_0x3fadf2[_0xa1b1('0x20')];this[_0xa1b1('0x21')]=_0x3fadf2[_0xa1b1('0x21')];this[_0xa1b1('0x22')]=_0x3fadf2[_0xa1b1('0x22')];this['trunks']=_0x3fadf2[_0xa1b1('0x23')];this[_0xa1b1('0x24')]=config['maxNumberOriginate']||0x2;this[_0xa1b1('0x25')]={};this['actions']={};this[_0xa1b1('0x26')]={};this[_0xa1b1('0x27')]={};this[_0xa1b1('0x28')]={};this['startPredictive']={};this[_0xa1b1('0x29')]={};this[_0xa1b1('0x2a')]={};this[_0xa1b1('0x2b')]={};this[_0xa1b1('0x2c')]={};this[_0xa1b1('0x2d')]={};ami['on']('agentconnect',this['syncAgentConnect'][_0xa1b1('0x2e')](this));ami['on'](_0xa1b1('0x2f'),this['syncQueueCallerAbandon'][_0xa1b1('0x2e')](this));ami['on'](_0xa1b1('0x30'),this[_0xa1b1('0x31')]['bind'](this));ami['on']('agentcomplete',this[_0xa1b1('0x32')][_0xa1b1('0x2e')](this));ami['on'](_0xa1b1('0x33'),this[_0xa1b1('0xb')][_0xa1b1('0x2e')](this));ami['on']('custom:queuesummarycomplete',this['syncQueueSummaryComplete']['bind'](this));ami['on'](_0xa1b1('0x34'),this[_0xa1b1('0x35')][_0xa1b1('0x2e')](this));ami['on'](_0xa1b1('0x36'),this[_0xa1b1('0x37')][_0xa1b1('0x2e')](this));ami['on'](_0xa1b1('0x38'),this[_0xa1b1('0x39')][_0xa1b1('0x2e')](this));ami['on']('queuemember',this[_0xa1b1('0x3a')][_0xa1b1('0x2e')](this));ami['on']('queuestatuscomplete',this[_0xa1b1('0x3b')][_0xa1b1('0x2e')](this));this[_0xa1b1('0x3c')]();this['loopClearZombieChannels']();RpcSetting[_0xa1b1('0x3d')]()[_0xa1b1('0x3e')](function(_0x1c6597){previewRecallmeReminderInterval=_0x1c6597[_0xa1b1('0x3f')];});}function isNotNull(_0x3f4eb9){return _0x3f4eb9!==null&&!_['isUndefined'](_0x3f4eb9);}function msgResponse(_0x38de1b,_0x5760f4,_0x5a9521){return{'action':_0x38de1b,'response':_0x5760f4,'message':_0x5a9521,'stack':_0x5a9521};}function emit(_0x4c5109,_0x45889c,_0x144730){io['to'](_0x4c5109)[_0xa1b1('0x40')](_0x45889c,_0x144730);}function emitOutboundVoiceQueueSummary(_0x27b3f2){if(_0x27b3f2[_0xa1b1('0x41')]===_0xa1b1('0x42')){logger[_0xa1b1('0x43')](_0xa1b1('0x44'),util[_0xa1b1('0x45')](_0x27b3f2,{'showHidden':![],'depth':null}));emit(util[_0xa1b1('0x46')]('voice:queue:%s',_0x27b3f2[_0xa1b1('0x47')]),'voice_queue:save',_0x27b3f2);}}function checkGetDataPredictive(_0x4a8875){if(isNotNull(_0x4a8875)&&!_[_0xa1b1('0x48')](_0x4a8875)){loggerPredictive[_0xa1b1('0x49')](_0xa1b1('0x4a'));loggerPredictive[_0xa1b1('0x49')](_0xa1b1('0x4b'),_0x4a8875['predictiveIntervalTotalCalls']);loggerPredictive[_0xa1b1('0x49')](_0xa1b1('0x4c'),_0x4a8875['predictiveIntervalAnsweredCalls']);loggerPredictive[_0xa1b1('0x49')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4a8875[_0xa1b1('0x4d')]);loggerPredictive[_0xa1b1('0x49')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4a8875[_0xa1b1('0x4e')]);loggerPredictive[_0xa1b1('0x49')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4a8875['predictiveIntervalAvgHoldtime']);loggerPredictive['info']('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4a8875[_0xa1b1('0x4f')]);loggerPredictive['info']('---------------------------');if(_0x4a8875['predictiveIntervalTotalCalls']>0x0){if(!_[_0xa1b1('0x50')](_0x4a8875[_0xa1b1('0x4f')])&&_0x4a8875[_0xa1b1('0x4f')]>0x0){return!![];}loggerPredictive['info'](_0xa1b1('0x51'));if(!_['isUndefined'](_0x4a8875[_0xa1b1('0x52')])&&_0x4a8875[_0xa1b1('0x52')]>0x0){return!![];}loggerPredictive[_0xa1b1('0x49')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive['info']('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0xa1b1('0x49')](_0xa1b1('0x53'));}return![];}function mergeDataErlangB(_0x28b0e5){return function(_0x459dfc){loggerPredictive[_0xa1b1('0x49')](_0xa1b1('0x54'));loggerPredictive[_0xa1b1('0x49')](_0xa1b1('0x55'),_0x459dfc[_0xa1b1('0x56')]);loggerPredictive['info']('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x459dfc[_0xa1b1('0x57')]);loggerPredictive[_0xa1b1('0x49')](_0xa1b1('0x58'),_0x459dfc[_0xa1b1('0x59')]);loggerPredictive['info']('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x459dfc[_0xa1b1('0x5a')]);loggerPredictive[_0xa1b1('0x49')](_0xa1b1('0x58'),_0x459dfc['erlangAbandonmentRate']);loggerPredictive[_0xa1b1('0x49')](_0xa1b1('0x5b'));_[_0xa1b1('0x5c')](_0x28b0e5,_0x459dfc);};}function ifInterval(_0x4d77ff,_0x3851d6){if(_['isUndefined'](_0x3851d6)){return![];}return utils[_0xa1b1('0x5d')](undefined,_0x3851d6)<_0x4d77ff*0x3c;}function clearPredictiveAttributes(_0x5a4805){if(_0x5a4805['startProgressive']){_0x5a4805['startProgressive']=undefined;loggerPredictive[_0xa1b1('0x43')](_0x5a4805[_0xa1b1('0x47')],_0xa1b1('0x5e'));}if(_0x5a4805['startPredictive']){_0x5a4805[_0xa1b1('0x5f')]=undefined;loggerPredictive[_0xa1b1('0x43')](_0x5a4805['name'],'startPredictive\x20value\x20cleared');}if(_0x5a4805[_0xa1b1('0x60')]){clearInterval(_0x5a4805[_0xa1b1('0x60')]);_0x5a4805['handlePredictive']=undefined;loggerPredictive[_0xa1b1('0x43')](_0x5a4805[_0xa1b1('0x47')],_0xa1b1('0x61'));}}function loggerCatchPredictive(_0x4c5a23,_0x43e2a9){return function(_0x2165e5){loggerPredictive[_0xa1b1('0x62')](_0x43e2a9[_0xa1b1('0x47')],_0x4c5a23);loggerPredictive['error'](_0x2165e5[_0xa1b1('0x63')]);clearPredictiveAttributes(_0x43e2a9);};}function loggerCatch(_0x3d6b53){return function(_0x255868){logger['error'](_0x3d6b53,util[_0xa1b1('0x45')](_0x255868,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x34c8cb,_0x4ebfdb,_0x4af02f){return function(_0x21ce59){utils['checkContactLowerLimitOriginate'](_0x4ebfdb,_0x4af02f,0x0);_0x4ebfdb['temp']=0x0;logger[_0xa1b1('0x62')](_0x34c8cb,util[_0xa1b1('0x45')](_0x21ce59,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x583dff){return function(_0x18d067){if(isNotNull(_0x18d067)&&isNotNull(_0x18d067[0x0])){if(_0x18d067[0x0][_0xa1b1('0x64')]>0x0){_0x583dff[_0xa1b1('0x65')]=utils[_0xa1b1('0x66')][_0xa1b1('0x67')];logger[_0xa1b1('0x49')](_0xa1b1('0x68')+_0x583dff[_0xa1b1('0x47')],_0x18d067[0x0][_0xa1b1('0x64')],_0xa1b1('0x69'));}else{_0x583dff['message']=utils[_0xa1b1('0x66')][_0xa1b1('0x6a')];logger['info'](_0xa1b1('0x6b')+_0x583dff[_0xa1b1('0x47')]);}}};}function createObjHistory(_0x33a587,_0x24bbd3,_0x141a85,_0x1acae0,_0x218a72){_0x33a587[_0xa1b1('0x65')]=_0x141a85;var _0x2a577c=new Action(_0x33a587,_0x24bbd3);var _0x26ec79=new History(_0x2a577c);_0x26ec79[_0xa1b1('0x6c')]=_0x1acae0;_0x26ec79[_0xa1b1('0x6d')]=_0x218a72;_0x26ec79['endtime']=_0x2a577c[_0xa1b1('0x6e')];return _0x26ec79;}function unlockQueueStatus(_0x48f9bb,_0x39f8c1){setTimeout(function(){if(_['isUndefined'](_0x48f9bb['queueStatusComplete'])){loggerBooked['error']('[unlockQueueStatus][undefined]',_0x39f8c1);}_0x48f9bb[_0xa1b1('0x6f')]=!![];loggerBooked[_0xa1b1('0x49')](_0xa1b1('0x70'),_0x39f8c1,JSON[_0xa1b1('0x71')](_['pick'](_0x48f9bb,[_0xa1b1('0x47'),'queueStatusComplete'])));},0x1f3);}function checkInterval(_0x3ae183){return function(){if(!isNotNull(_0x3ae183[_0xa1b1('0x72')])){_0x3ae183['message']=utils[_0xa1b1('0x66')][_0xa1b1('0x73')];throw _0x3ae183['name']+_0xa1b1('0x74');}if(!isNotNull(_0x3ae183[_0xa1b1('0x72')][_0xa1b1('0x75')])){_0x3ae183[_0xa1b1('0x65')]=utils['CAMPAIGN_STATUS'][_0xa1b1('0x73')];throw _0x3ae183[_0xa1b1('0x47')]+_0xa1b1('0x74');}if(!isNotNull(_[_0xa1b1('0x48')](_0x3ae183[_0xa1b1('0x72')][_0xa1b1('0x75')]))){_0x3ae183['message']=utils['CAMPAIGN_STATUS'][_0xa1b1('0x73')];throw _0x3ae183[_0xa1b1('0x47')]+'\x20INTERVAL_IS_NULL';}};}function checkIsIVRCampaignActive(_0x3a8aa1){return function(){if(!utils['isIVRCampaignActive'](_0x3a8aa1)){_0x3a8aa1[_0xa1b1('0x65')]=utils[_0xa1b1('0x66')][_0xa1b1('0x76')];throw _0x3a8aa1[_0xa1b1('0x47')]+_0xa1b1('0x77');}};}function emitCampaignSummary(_0x444581){if(utils['isIVRCampaign'](_0x444581)){emit(util[_0xa1b1('0x46')](_0xa1b1('0x78'),_0x444581[_0xa1b1('0x47')]),_0xa1b1('0x79'),_0x444581);}}function loggerCatchQueueSummary(_0x6ddc67,_0x699d40){return function(_0x382aa0){clearPredictiveAttributes(_0x699d40);emitCampaignSummary(_0x699d40);loggerSyncQueueSummary['debug'](_0x6ddc67,util['inspect'](_0x382aa0,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x1c4478){if(_0x1c4478[_0xa1b1('0x7a')]){if(_0x1c4478[_0xa1b1('0x7b')]===0x0){_0x1c4478[_0xa1b1('0x7a')]=![];_0x1c4478[_0xa1b1('0x65')]=utils['CAMPAIGN_STATUS'][_0xa1b1('0x76')];loggerSyncQueueSummary[_0xa1b1('0x43')](_0xa1b1('0x7c'),_0x1c4478[_0xa1b1('0x47')],_0xa1b1('0x7d'));}else{_0x1c4478[_0xa1b1('0x65')]=utils[_0xa1b1('0x66')][_0xa1b1('0x7e')];loggerSyncQueueSummary['debug']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x1c4478[_0xa1b1('0x47')],_0xa1b1('0x7f'));}emitCampaignSummary(_0x1c4478);}}function myreject(_0x2fc784){return function(_0x5cded0){return _0x2fc784(msgResponse(_0xa1b1('0x80'),_0xa1b1('0x81'),JSON[_0xa1b1('0x71')](_0x5cded0)));};}Dialer[_0xa1b1('0x82')][_0xa1b1('0x83')]=function(_0x4112b8){return!_['isUndefined'](_0x4112b8)&&_0x4112b8&&!_['isUndefined'](_0x4112b8[_0xa1b1('0x47')])&&!_[_0xa1b1('0x50')](_0x4112b8[_0xa1b1('0x84')])&&_0x4112b8[_0xa1b1('0x84')]&&(this[_0xa1b1('0x23')][util['format'](_0xa1b1('0x85'),_0x4112b8['name'])][_0xa1b1('0x86')]===_0xa1b1('0x87')||this[_0xa1b1('0x23')][util['format'](_0xa1b1('0x85'),_0x4112b8[_0xa1b1('0x47')])][_0xa1b1('0x86')]===_0xa1b1('0x88'));};Dialer[_0xa1b1('0x82')][_0xa1b1('0x89')]=function(_0x4c071f){var _0x5023c9=this;return function(){if(!_0x5023c9[_0xa1b1('0x83')](_0x4c071f['Trunk'])){if(!_0x5023c9[_0xa1b1('0x83')](_0x4c071f[_0xa1b1('0x8a')])){_0x4c071f[_0xa1b1('0x65')]=utils['CAMPAIGN_STATUS'][_0xa1b1('0x8b')];throw _0x4c071f['name']+_0xa1b1('0x8c');}}};};Dialer['prototype'][_0xa1b1('0x8d')]=function(_0x51e473,_0x200b95,_0x538410,_0x35a10a){var _0x528745=this;return function(){var _0x28c3fd=!![];return _0x528745[_0xa1b1('0x8e')](_0x51e473,_0x200b95,_0x538410,_0x35a10a,_0x28c3fd);};};Dialer[_0xa1b1('0x82')]['checkIfTimeIntervals']=function(_0x5a42e3,_0x3ace32,_0x2b7c72,_0x48ad70){var _0x545f82=this;return function(){var _0x4c4c15=![];return _0x545f82['ifTimeIvr'](_0x5a42e3['Intervals'],_0x3ace32,_0x2b7c72,_0x48ad70,_0x4c4c15);};};Dialer[_0xa1b1('0x82')][_0xa1b1('0x8e')]=function(_0xa487d3,_0x1bbe78,_0x210e2f,_0x363f4c,_0x460362){var _0x4e4ff2=[];return new Promise(function(_0x222fd3,_0x1a6ba7){if(!isNotNull(_0xa487d3)){_0x363f4c['message']=utils[_0xa1b1('0x66')]['NULL_INTERVAL'];return _0x1a6ba7(msgResponse('ifTime',_0xa1b1('0x8f'),_0x210e2f+_0xa1b1('0x90')));}if(_[_0xa1b1('0x48')](_0xa487d3)){_0x363f4c[_0xa1b1('0x65')]=utils[_0xa1b1('0x66')]['EMPTY_INTERVAL'];return _0x1a6ba7(msgResponse(_0xa1b1('0x91'),_0xa1b1('0x8f'),_0x210e2f+'\x20Intervals\x20is\x20empty\x20'));}if(_0x1bbe78&&_['isUndefined'](config[_0xa1b1('0x92')][_0x1bbe78])){_0x363f4c[_0xa1b1('0x65')]=utils[_0xa1b1('0x66')][_0xa1b1('0x93')];return _0x1a6ba7(msgResponse(_0xa1b1('0x91'),_0xa1b1('0x8f'),_0x210e2f+_0xa1b1('0x94')+_0x1bbe78));}if(_[_0xa1b1('0x95')](_0xa487d3)){for(var _0x11052b=0x0;_0x11052b<_0xa487d3[_0xa1b1('0x96')];_0x11052b+=0x1){_0x4e4ff2[_0xa1b1('0x97')](ami[_0xa1b1('0x98')]({'action':_0xa1b1('0x99'),'command':util[_0xa1b1('0x46')]('iftime\x20%s,%s',_0xa487d3[_0x11052b][_0xa1b1('0x9a')],!_['isUndefined'](config[_0xa1b1('0x92')][_0x1bbe78])?_0x1bbe78:'')})[_0xa1b1('0x3e')](function(_0x16bf03){return _0x16bf03[_0xa1b1('0x9b')]['indexOf'](_0xa1b1('0x9c'))>=0x0;})[_0xa1b1('0x9d')](myreject(_0x1a6ba7)));}}else{_0x4e4ff2[_0xa1b1('0x97')](ami[_0xa1b1('0x98')]({'action':_0xa1b1('0x99'),'command':util['format'](_0xa1b1('0x9e'),_0xa487d3,!_[_0xa1b1('0x50')](config[_0xa1b1('0x92')][_0x1bbe78])?_0x1bbe78:'')})[_0xa1b1('0x3e')](function(_0x24f8f8){return _0x24f8f8[_0xa1b1('0x9b')][_0xa1b1('0x9f')](_0xa1b1('0x9c'))>=0x0;})[_0xa1b1('0x9d')](myreject(_0x1a6ba7)));}Promise['all'](_0x4e4ff2)['then'](function(_0x27c20d){var _0x272faa=_[_0xa1b1('0xa0')](_0x27c20d);if(_0x272faa){return _0x222fd3(_0x272faa);}else{_0x363f4c['message']=_0x460362?utils['CAMPAIGN_STATUS']['OVERTIME_GLOBAL_INTERVAL']:utils[_0xa1b1('0x66')][_0xa1b1('0xa1')];return _0x1a6ba7(msgResponse(_0xa1b1('0xa2'),_0xa1b1('0x8f'),_0xa1b1('0xa3')+_0x460362+'\x20'+_0x210e2f+'\x20Interval\x20is\x20overtime:\x20'+util[_0xa1b1('0x45')](_0xa487d3,{'showHidden':![],'depth':null})+_0xa1b1('0xa4')+_0x1bbe78));}})[_0xa1b1('0x9d')](function(_0x280fc5){return _0x1a6ba7(msgResponse(_0xa1b1('0x91'),'Failure',JSON[_0xa1b1('0x71')](_0x280fc5)));});});};Dialer[_0xa1b1('0x82')]['loopCampaigns']=function(){var _0x453f1a=this;return cmHopper['resetActiveCalls']({'active':![]},{'where':{'active':!![]}})[_0xa1b1('0x3e')](function(){setInterval(function(){_0x453f1a[_0xa1b1('0xa5')]();},0x3e8);});};Dialer[_0xa1b1('0x82')][_0xa1b1('0xa5')]=function(){var _0x20bc05=this;var _0x48f6a3;for(var _0x54e4ff in this['campaigns']){if(typeof this[_0xa1b1('0x21')][_0x54e4ff]!==_0xa1b1('0xa6')){_0x48f6a3=this['campaigns'][_0x54e4ff];if(utils[_0xa1b1('0xa7')](_0x48f6a3)&&utils[_0xa1b1('0xa8')](_0x48f6a3)){_0x48f6a3[_0xa1b1('0x7a')]=!![];Promise['resolve']()[_0xa1b1('0x3e')](checkIsIVRCampaignActive(_0x48f6a3))[_0xa1b1('0x3e')](checkInterval(_0x48f6a3))[_0xa1b1('0x3e')](_0x20bc05[_0xa1b1('0x89')](_0x48f6a3))[_0xa1b1('0x3e')](_0x20bc05[_0xa1b1('0x8d')](_0x48f6a3[_0xa1b1('0xa9')],_0x48f6a3[_0xa1b1('0xaa')],_0x48f6a3[_0xa1b1('0x47')],_0x48f6a3))['then'](_0x20bc05[_0xa1b1('0xab')](_0x48f6a3[_0xa1b1('0x72')],_0x48f6a3[_0xa1b1('0xaa')],_0x48f6a3[_0xa1b1('0x47')],_0x48f6a3))[_0xa1b1('0x3e')](_0x20bc05['launchHandleIvr'](_0x48f6a3))[_0xa1b1('0x9d')](loggerCatchQueueSummary(_0xa1b1('0xac'),_0x48f6a3));}else{notSendMessagesCampaign(_0x48f6a3);}}}};Dialer[_0xa1b1('0x82')][_0xa1b1('0xad')]=function(_0x3384b9){if(_0x3384b9['dialMethod']!==_0xa1b1('0x9')){clearPredictiveAttributes(_0x3384b9);}switch(_0x3384b9[_0xa1b1('0xae')]){case _0xa1b1('0xaf'):this['handlePower'](_0x3384b9,0x1);break;case'power':this['handlePower'](_0x3384b9,_0x3384b9[_0xa1b1('0xb0')]);break;case _0xa1b1('0x9'):this[_0xa1b1('0x9')](_0x3384b9);break;case _0xa1b1('0x8'):this[_0xa1b1('0xb1')](_0x3384b9,0x1);break;default:logger[_0xa1b1('0x62')](_0xa1b1('0xb2'),_0x3384b9[_0xa1b1('0x47')],_0xa1b1('0xb3'));}};Dialer['prototype'][_0xa1b1('0x91')]=function(_0x15b436,_0x1f8591){var _0x6d1cef=_0x15b436['dialTimezone'];var _0x1f8491=_0x1f8591?_0x15b436[_0xa1b1('0xa9')]:_0x15b436['Interval']['Intervals'];logger[_0xa1b1('0xb4')](_0xa1b1('0xb5'),_0x1f8491,_0x6d1cef,_0x15b436[_0xa1b1('0x47')],util[_0xa1b1('0x46')](_0xa1b1('0xb6'),_0x15b436[_0xa1b1('0x47')],_0x15b436['id']));var _0x24840c=null;return Interval[_0xa1b1('0xb7')](_0x1f8491,_0x6d1cef)[_0xa1b1('0x3e')](function(_0x2f7cd6){if(_0x2f7cd6===!![]){return _0x2f7cd6;}else{_0x15b436[_0xa1b1('0x65')]=_0x1f8591?utils[_0xa1b1('0x66')][_0xa1b1('0xb8')]:utils['CAMPAIGN_STATUS']['OVERTIME_INTERVAL'];_0x24840c=msgResponse(_0xa1b1('0xa2'),_0xa1b1('0x8f'),'Global:\x20'+_0x1f8591+'\x20'+_0x15b436['name']+_0xa1b1('0xb9')+util['inspect'](_0x1f8491,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x6d1cef);}if(_0x24840c!==null){logger[_0xa1b1('0xb4')]('Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:',_0x24840c);_0x24840c[_0xa1b1('0xba')]=_0x1f8591;throw _0x24840c;}})['catch'](function(_0x3a6a2f){logger['error'](_0xa1b1('0xbb'),_0x3a6a2f);throw msgResponse('[ifTime][Action]','Error',util[_0xa1b1('0x45')](_0x3a6a2f,{'showHidden':![],'depth':null}));});};Dialer[_0xa1b1('0x82')]['syncAgentConnect']=function(_0x3010c0){if(this[_0xa1b1('0x20')][_0x3010c0[_0xa1b1('0xbc')]]){if(this[_0xa1b1('0x27')][_0x3010c0[_0xa1b1('0xbd')]]&&this[_0xa1b1('0x27')][_0x3010c0[_0xa1b1('0xbd')]][_0xa1b1('0x41')]!=='ivr'){this['updateOriginated'](this[_0xa1b1('0x20')][_0x3010c0[_0xa1b1('0xbc')]]);this[_0xa1b1('0x27')][_0x3010c0['uniqueid']][_0xa1b1('0xbe')]=moment()[_0xa1b1('0x46')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0xa1b1('0x82')][_0xa1b1('0x32')]=function(_0x597033){var _0x3ac0ca=this['uniqueId'][_0x597033[_0xa1b1('0xbd')]];if(this['voiceQueues'][_0x597033[_0xa1b1('0xbc')]]){if(_0x3ac0ca&&_0x3ac0ca[_0xa1b1('0x41')]!=='ivr'){delete this[_0xa1b1('0x27')][_0x597033[_0xa1b1('0xbd')]];this[_0xa1b1('0x20')][_0x597033['queue']]['outboundAnswerCallsDay']+=0x1;var _0x45dee8=new AgentComplete(_0x3ac0ca,_0x597033);if(_0x597033['reason']==='agent'){_0x45dee8[_0xa1b1('0xbf')]=this[_0xa1b1('0x20')][_0x597033[_0xa1b1('0xbc')]][_0xa1b1('0xc0')]&&this[_0xa1b1('0x20')][_0x597033[_0xa1b1('0xbc')]][_0xa1b1('0xc1')]?moment()[_0xa1b1('0x46')](_0xa1b1('0xc2')):undefined;}hopperUtils[_0xa1b1('0xc3')](_0x45dee8)[_0xa1b1('0x9d')](loggerCatch(_0xa1b1('0xc4')));hopperUtils[_0xa1b1('0xc5')](_0x45dee8)['catch'](loggerCatch(_0xa1b1('0xc6')));}}};Dialer['prototype'][_0xa1b1('0xc7')]=function(_0x1fd312){var _0x467e90=this['uniqueId'][_0x1fd312['uniqueid']];var _0x4b6e3b=this;var _0x5df357=![];var _0x2e29e0;var _0x427732;if(this['voiceQueues'][_0x1fd312['queue']]){if(_0x467e90&&_0x467e90[_0xa1b1('0x41')]!==_0xa1b1('0xc8')){delete this[_0xa1b1('0x27')][_0x1fd312[_0xa1b1('0xbd')]];this[_0xa1b1('0xc9')](this[_0xa1b1('0x20')][_0x1fd312[_0xa1b1('0xbc')]]);_0x467e90[_0xa1b1('0xca')]=moment()[_0xa1b1('0x46')]('YYYY-MM-DD\x20HH:mm:ss');var _0x265425=new QueueCallerAbandon(_0x467e90,_0x1fd312);if(utils['getSeconds'](_0x467e90[_0xa1b1('0xca')],_0x467e90[_0xa1b1('0xcb')])>=_0x467e90[_0xa1b1('0xcc')]){this[_0xa1b1('0x20')][_0x1fd312[_0xa1b1('0xbc')]][_0xa1b1('0x4d')]+=0x1;this[_0xa1b1('0x20')][_0x1fd312['queue']][_0xa1b1('0xcd')]+=0x1;this[_0xa1b1('0x20')][_0x1fd312[_0xa1b1('0xbc')]][_0xa1b1('0xce')]+=0x1;_0x265425[_0xa1b1('0x6c')]=0xa;_0x265425[_0xa1b1('0x6d')]='Drop';_0x265425['dropreason']=_0xa1b1('0xcf');_0x265425[_0xa1b1('0xbf')]=this[_0xa1b1('0x20')][_0x1fd312[_0xa1b1('0xbc')]]['dialQueueProject2']?moment()[_0xa1b1('0x46')](_0xa1b1('0xc2')):undefined;_0x265425[_0xa1b1('0xd0')]+=0x1;_0x265425[_0xa1b1('0xd1')]+=0x1;_0x2e29e0=this['voiceQueues'][_0x1fd312[_0xa1b1('0xbc')]][_0xa1b1('0xd2')];_0x427732=this[_0xa1b1('0x20')][_0x1fd312[_0xa1b1('0xbc')]][_0xa1b1('0xd3')];hopperUtils[_0xa1b1('0xd4')](_0x265425,_0x265425[_0xa1b1('0x6c')],_0x467e90[_0xa1b1('0xd5')])[_0xa1b1('0x3e')](function(_0x121140){_0x5df357=_0x121140[_0xa1b1('0xd6')]==0x1;if(_0x265425[_0xa1b1('0xd0')]>=_0x4b6e3b[_0xa1b1('0x20')][_0x1fd312[_0xa1b1('0xbc')]][_0xa1b1('0xd7')]){_0x4b6e3b[_0xa1b1('0xd8')](_0x265425,_0x121140[_0xa1b1('0xd6')]);}else{hopperUtils[_0xa1b1('0xd9')]({'active':![],'countdropretry':_0x265425[_0xa1b1('0xd0')],'scheduledat':moment()[_0xa1b1('0xda')](_0x4b6e3b[_0xa1b1('0x20')][_0x1fd312[_0xa1b1('0xbc')]][_0xa1b1('0xd2')],'minutes')[_0xa1b1('0x46')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x467e90[_0xa1b1('0xdb')],'ListId':_0x467e90[_0xa1b1('0xdc')],'VoiceQueueId':_0x467e90[_0xa1b1('0xdd')]||undefined,'CampaignId':_0x467e90['CampaignId']||undefined})[_0xa1b1('0x9d')](loggerCatch('[rescheduleContact][Drop]'));var _0x382b47=new History(_0x265425);_0x382b47['state']=0xa;_0x382b47['statedesc']=_0xa1b1('0xde');_0x382b47[_0xa1b1('0x6e')]=moment()[_0xa1b1('0x46')](_0xa1b1('0xc2'));_0x382b47[_0xa1b1('0xdf')]=_0x382b47[_0xa1b1('0x6e')];_0x382b47[_0xa1b1('0xe0')]=_0x265425[_0xa1b1('0xe0')];_0x382b47[_0xa1b1('0xe1')]=_0x265425[_0xa1b1('0xe1')];hopperUtils[_0xa1b1('0xc3')](_0x382b47)[_0xa1b1('0x9d')](loggerCatch(_0xa1b1('0xe2')));}})[_0xa1b1('0x3e')](function(){if(_0x5df357)hopperUtils[_0xa1b1('0xe3')](_0x265425,_0x2e29e0,_0x427732)[_0xa1b1('0x3e')](function(){return 0x1;});});}else{this[_0xa1b1('0x20')][_0x1fd312[_0xa1b1('0xbc')]][_0xa1b1('0x4e')]+=0x1;this[_0xa1b1('0x20')][_0x1fd312[_0xa1b1('0xbc')]]['outboundDropCallsDayCallersExit']+=0x1;_0x265425['state']=0xb;_0x265425[_0xa1b1('0x6d')]=_0xa1b1('0xe4');_0x265425[_0xa1b1('0xe5')]=_0xa1b1('0xe6');_0x265425['countabandonedretry']+=0x1;_0x265425[_0xa1b1('0xd1')]+=0x1;_0x2e29e0=this[_0xa1b1('0x20')][_0x1fd312['queue']][_0xa1b1('0xe7')];_0x427732=this[_0xa1b1('0x20')][_0x1fd312[_0xa1b1('0xbc')]][_0xa1b1('0xd3')];hopperUtils[_0xa1b1('0xd4')](_0x265425,_0x265425[_0xa1b1('0x6c')],_0x467e90[_0xa1b1('0xd5')])[_0xa1b1('0x3e')](function(_0x1a226c){if(_0x265425['countabandonedretry']>=_0x4b6e3b['voiceQueues'][_0x1fd312['queue']][_0xa1b1('0xe8')]){_0x4b6e3b[_0xa1b1('0xd8')](_0x265425,_0x1a226c[_0xa1b1('0xd6')]);}else{hopperUtils[_0xa1b1('0xd9')]({'active':![],'countabandonedretry':_0x265425[_0xa1b1('0xe9')],'scheduledat':moment()[_0xa1b1('0xda')](_0x4b6e3b[_0xa1b1('0x20')][_0x1fd312[_0xa1b1('0xbc')]]['dialAbandonedRetryFrequency'],_0xa1b1('0xea'))[_0xa1b1('0x46')](_0xa1b1('0xc2')),'ContactId':_0x467e90[_0xa1b1('0xdb')],'ListId':_0x467e90['ListId'],'VoiceQueueId':_0x467e90[_0xa1b1('0xdd')]||undefined,'CampaignId':_0x467e90['CampaignId']||undefined})['catch'](loggerCatch(_0xa1b1('0xeb')));var _0x4d235b=new History(_0x265425);_0x4d235b['state']=0xb;_0x4d235b['statedesc']=_0xa1b1('0xe4');_0x4d235b[_0xa1b1('0x6e')]=moment()['format'](_0xa1b1('0xc2'));_0x4d235b[_0xa1b1('0xdf')]=_0x4d235b[_0xa1b1('0x6e')];_0x4d235b[_0xa1b1('0xe0')]=_0x265425[_0xa1b1('0xe0')];_0x4d235b[_0xa1b1('0xe1')]=_0x265425[_0xa1b1('0xe1')];hopperUtils[_0xa1b1('0xc3')](_0x4d235b)['catch'](loggerCatch('[syncAgentComplete][createHistory][11]'));}})[_0xa1b1('0x3e')](function(){if(_0x5df357)hopperUtils[_0xa1b1('0xe3')](_0x265425,_0x2e29e0,_0x427732)['then'](function(){return 0x1;});});}}}};Dialer[_0xa1b1('0x82')][_0xa1b1('0x37')]=function(_0x4f2cf7){if(this['actions'][_0x4f2cf7['uniqueid']]){this['actions'][_0x4f2cf7[_0xa1b1('0xbd')]]['channel']=_0x4f2cf7[_0xa1b1('0xec')];}if(this[_0xa1b1('0x27')][_0x4f2cf7[_0xa1b1('0xbd')]]){this[_0xa1b1('0x27')][_0x4f2cf7[_0xa1b1('0xbd')]]['channel']=_0x4f2cf7[_0xa1b1('0xec')];}};Dialer[_0xa1b1('0x82')][_0xa1b1('0x3a')]=function(_0x262475){if(!this[_0xa1b1('0xed')][_0x262475[_0xa1b1('0xee')]]){return;}var _0x5aeb8a=this['voiceQueues'][this[_0xa1b1('0xed')][_0x262475['actionid']]['queue']][_0xa1b1('0xef')]||_0xa1b1('0xf0');if(_0x5aeb8a==='roundrobin'){if(this[_0xa1b1('0xed')][_0x262475[_0xa1b1('0xee')]]&&_[_0xa1b1('0xf1')](this['actions'][_0x262475[_0xa1b1('0xee')]][_0xa1b1('0xf2')])&&_0x262475['status']==='1'&&_0x262475['paused']==='0'){if(this[_0xa1b1('0x22')][_0x262475[_0xa1b1('0xf3')]]){if(!this[_0xa1b1('0x22')][_0x262475[_0xa1b1('0xf3')]][_0xa1b1('0xf2')]){this['agents'][_0x262475[_0xa1b1('0xf3')]]['locked']=!![];this[_0xa1b1('0xed')][_0x262475[_0xa1b1('0xee')]][_0xa1b1('0xf2')]=!![];this[_0xa1b1('0xed')][_0x262475['actionid']][_0xa1b1('0xf3')]=_0x262475[_0xa1b1('0xf3')];}}}}else if(_0x5aeb8a===_0xa1b1('0xf0')){if(this[_0xa1b1('0xed')][_0x262475[_0xa1b1('0xee')]]){if(this[_0xa1b1('0x22')][_0x262475[_0xa1b1('0xf3')]]){this[_0xa1b1('0xed')][_0x262475[_0xa1b1('0xee')]][_0xa1b1('0xf3')]=_0x262475['stateinterface'];if(_['isNil'](this[_0xa1b1('0x2b')][this['actions'][_0x262475[_0xa1b1('0xee')]][_0xa1b1('0xbc')]])){this[_0xa1b1('0x2b')][this[_0xa1b1('0xed')][_0x262475[_0xa1b1('0xee')]][_0xa1b1('0xbc')]]=[];}this[_0xa1b1('0x2b')][this[_0xa1b1('0xed')][_0x262475[_0xa1b1('0xee')]][_0xa1b1('0xbc')]][_0xa1b1('0x97')](_[_0xa1b1('0x5c')](_[_0xa1b1('0xf4')](this[_0xa1b1('0xed')][_0x262475['actionid']],[_0xa1b1('0xf5'),'stateinterface']),{'status':_0x262475[_0xa1b1('0x86')],'paused':_0x262475[_0xa1b1('0xf6')]}));}}}};Dialer[_0xa1b1('0x82')]['syncQueueStatusComplete']=function(_0x5dbaf1){if(!this['actions'][_0x5dbaf1[_0xa1b1('0xee')]]){return;}var _0x1ab585=this;var _0x3a5081=this[_0xa1b1('0x20')][this[_0xa1b1('0xed')][_0x5dbaf1[_0xa1b1('0xee')]][_0xa1b1('0xbc')]];var _0xf0d67d=_0x3a5081['strategy']||_0xa1b1('0xf0');if(_0xf0d67d===_0xa1b1('0xf7')){if(this[_0xa1b1('0xed')][_0x5dbaf1['actionid']]&&this[_0xa1b1('0xed')][_0x5dbaf1['actionid']]['stateinterface']){this['preview'][_0xa1b1('0xf8')](this['actions'][_0x5dbaf1[_0xa1b1('0xee')]][_0xa1b1('0xf5')],this['actions'][_0x5dbaf1[_0xa1b1('0xee')]]['stateinterface'])[_0xa1b1('0x9d')](function(_0x53641e){logger[_0xa1b1('0x62')]('[Catch][Preview][syncQueueStatusComplete]',util[_0xa1b1('0x45')](_0x53641e,{'showHidden':![],'depth':null}));})[_0xa1b1('0x1f')](function(){_0x1ab585[_0xa1b1('0xc9')](_0x1ab585['voiceQueues'][_0x1ab585[_0xa1b1('0xed')][_0x5dbaf1[_0xa1b1('0xee')]]['queue']]);_0x1ab585[_0xa1b1('0x22')][_0x1ab585[_0xa1b1('0xed')][_0x5dbaf1[_0xa1b1('0xee')]][_0xa1b1('0xf3')]][_0xa1b1('0xf2')]=![];delete _0x1ab585[_0xa1b1('0xed')][_0x5dbaf1[_0xa1b1('0xee')]];unlockQueueStatus(_0x3a5081);});}else{this[_0xa1b1('0xc9')](this[_0xa1b1('0x20')][this[_0xa1b1('0xed')][_0x5dbaf1['actionid']][_0xa1b1('0xbc')]]);hopperUtils[_0xa1b1('0xd9')]({'active':![],'ContactId':this[_0xa1b1('0xed')][_0x5dbaf1['actionid']][_0xa1b1('0xdb')],'ListId':this['actions'][_0x5dbaf1[_0xa1b1('0xee')]]['ListId'],'VoiceQueueId':this[_0xa1b1('0xed')][_0x5dbaf1[_0xa1b1('0xee')]]['VoiceQueueId']||undefined,'CampaignId':this[_0xa1b1('0xed')][_0x5dbaf1[_0xa1b1('0xee')]][_0xa1b1('0xf9')]||undefined})[_0xa1b1('0x9d')](loggerCatch(_0xa1b1('0xfa')));delete this[_0xa1b1('0xed')][_0x5dbaf1['actionid']];unlockQueueStatus(_0x3a5081);}}else if(_0xf0d67d===_0xa1b1('0xf0')){var _0x56a4f4;if(this[_0xa1b1('0xed')][_0x5dbaf1[_0xa1b1('0xee')]]&&!_[_0xa1b1('0x48')](this[_0xa1b1('0x2b')][this['actions'][_0x5dbaf1[_0xa1b1('0xee')]]['queue']])){if(this[_0xa1b1('0x2c')][_0x1ab585[_0xa1b1('0xed')][_0x5dbaf1[_0xa1b1('0xee')]][_0xa1b1('0xbc')]]){this[_0xa1b1('0x2c')][_0x1ab585[_0xa1b1('0xed')][_0x5dbaf1['actionid']]['queue']]=this[_0xa1b1('0x2c')][this[_0xa1b1('0xed')][_0x5dbaf1[_0xa1b1('0xee')]]['queue']]?this[_0xa1b1('0x2c')][this[_0xa1b1('0xed')][_0x5dbaf1[_0xa1b1('0xee')]][_0xa1b1('0xbc')]]:this[_0xa1b1('0x2b')][this['actions'][_0x5dbaf1[_0xa1b1('0xee')]]['queue']]?this[_0xa1b1('0x2b')][this[_0xa1b1('0xed')][_0x5dbaf1[_0xa1b1('0xee')]][_0xa1b1('0xbc')]][_0xa1b1('0xfb')]||0x0:0x0;}this[_0xa1b1('0x2b')][this[_0xa1b1('0xed')][_0x5dbaf1[_0xa1b1('0xee')]][_0xa1b1('0xbc')]]['_rr']=this['queueBookedRR'][this[_0xa1b1('0xed')][_0x5dbaf1[_0xa1b1('0xee')]]['queue']];for(var _0x5595df=0x0;_0x5595df=_0x4501d1['dialGlobalMaxRetry']){_0x179416[_0xa1b1('0x11d')](_0x5d0bf1,_0x2a8b51,_0x5861ce,_0xa1b1('0x11e'));}else{if(_0x5d0bf1['countmachineretry']>=_0x4501d1[_0xa1b1('0x11f')]){_0x179416[_0xa1b1('0x120')](_0x5d0bf1,_0x2a8b51,_0x5861ce,_0xa1b1('0x121'));}else{hopperUtils[_0xa1b1('0xd9')]({'active':![],'countmachineretry':_0x5d0bf1[_0xa1b1('0x116')],'scheduledat':moment()['add'](_0x4501d1['dialMachineRetryFrequency'],'minutes')[_0xa1b1('0x46')](_0xa1b1('0xc2')),'ContactId':_0x5d0bf1[_0xa1b1('0xdb')],'ListId':_0x5d0bf1[_0xa1b1('0xdc')],'VoiceQueueId':_0x5d0bf1[_0xa1b1('0xdd')]||undefined,'CampaignId':_0x5d0bf1['CampaignId']||undefined})[_0xa1b1('0x9d')](loggerCatch(_0xa1b1('0x122')));_0x2a8b51({'reschedule':0x1});}}});}if(_0x20190a[_0xa1b1('0x41')]==='ivr'&&this[_0xa1b1('0x21')][_0x20190a['queue']][_0xa1b1('0x10c')]&&_0x79e7e1[_0xa1b1('0x10d')]===_0xa1b1('0x10e')){delete this[_0xa1b1('0x27')][_0x79e7e1[_0xa1b1('0xbd')]];this[_0xa1b1('0xc9')](this[_0xa1b1('0x21')][_0x20190a[_0xa1b1('0xbc')]]);_0xf2f43f=new Hangup(_0x20190a,_0x79e7e1);_0xf2f43f[_0xa1b1('0x6c')]=0x12;_0xf2f43f[_0xa1b1('0x6d')]='HangupInAMD';_0xf2f43f[_0xa1b1('0x115')]=_0xa1b1('0x111');ami[_0xa1b1('0x40')](_0xa1b1('0x117'),ut[_0xa1b1('0x112')](_0xf2f43f,_0xa1b1('0x118')));this['saveInDb'](_0xf2f43f,_0xa1b1('0x123'),_0xa1b1('0x124'));}if(_0x20190a['type']===_0xa1b1('0xc8')&&this['campaigns'][_0x20190a[_0xa1b1('0xbc')]]['dialAMDActive']&&_0x79e7e1[_0xa1b1('0x10d')]===_0xa1b1('0x114')){return new Promise(function(_0x5177f,_0x5e9135){delete _0x179416['uniqueId'][_0x79e7e1['uniqueid']];_0x179416[_0xa1b1('0xc9')](_0x179416[_0xa1b1('0x21')][_0x20190a[_0xa1b1('0xbc')]]);_0x179416['campaigns'][_0x20190a['queue']][_0xa1b1('0x10f')]+=0x1;_0x179416[_0xa1b1('0x21')][_0x20190a[_0xa1b1('0xbc')]][_0xa1b1('0x110')]+=0x1;var _0x497650=_0x179416['campaigns'][_0x20190a[_0xa1b1('0xbc')]];var _0x158494=new Hangup(_0x20190a,_0x79e7e1);_0x158494['state']=0x13;_0x158494['statedesc']='Machine';_0x158494[_0xa1b1('0x115')]=_0xa1b1('0x111');_0x158494[_0xa1b1('0x116')]+=0x1;_0x158494['countglobal']+=0x1;_0x158494[_0xa1b1('0x118')]=!![];ami['emit'](_0xa1b1('0x117'),ut['buildObj'](_0x158494,'amd'));hopperUtils[_0xa1b1('0xc3')](_0x158494)['catch'](loggerCatch(_0xa1b1('0x125')));if(_0x158494['countbusyretry']+_0x158494[_0xa1b1('0x11a')]+_0x158494[_0xa1b1('0x11b')]+_0x158494[_0xa1b1('0x126')]+_0x158494[_0xa1b1('0xd0')]+_0x158494[_0xa1b1('0xe9')]+_0x158494[_0xa1b1('0x116')]+_0x158494[_0xa1b1('0x11c')]>=_0x497650[_0xa1b1('0x127')]){_0x179416['stateGlobal'](_0x158494,_0x5177f,_0x5e9135,_0xa1b1('0x11e'));}else{if(_0x158494['countmachineretry']>=_0x497650[_0xa1b1('0x11f')]){_0x179416[_0xa1b1('0x120')](_0x158494,_0x5177f,_0x5e9135,_0xa1b1('0x121'));}else{hopperUtils[_0xa1b1('0xd9')]({'active':![],'countmachineretry':_0x158494[_0xa1b1('0x116')],'scheduledat':moment()['add'](_0x497650[_0xa1b1('0x128')],_0xa1b1('0xea'))[_0xa1b1('0x46')](_0xa1b1('0xc2')),'ContactId':_0x158494[_0xa1b1('0xdb')],'ListId':_0x158494['ListId'],'VoiceQueueId':_0x158494['VoiceQueueId']||undefined,'CampaignId':_0x158494[_0xa1b1('0xf9')]||undefined})['catch'](loggerCatch(_0xa1b1('0x122')));_0x5177f({'reschedule':0x1});}}});}}};Dialer[_0xa1b1('0x82')][_0xa1b1('0x35')]=function(_0x1402b8){var _0x19cbf6=this[_0xa1b1('0x27')][_0x1402b8[_0xa1b1('0xbd')]];var _0x568649;if(_0x19cbf6&&_0x19cbf6[_0xa1b1('0x41')]===_0xa1b1('0xc8')){delete this[_0xa1b1('0x27')][_0x1402b8[_0xa1b1('0xbd')]];this[_0xa1b1('0xc9')](this[_0xa1b1('0x21')][_0x19cbf6[_0xa1b1('0xbc')]]);this[_0xa1b1('0x21')][_0x19cbf6[_0xa1b1('0xbc')]][_0xa1b1('0x129')]+=0x1;_0x568649=new Hangup(_0x19cbf6,_0x1402b8);hopperUtils[_0xa1b1('0xc3')](_0x568649)[_0xa1b1('0x9d')](loggerCatch(_0xa1b1('0x12a')));hopperUtils[_0xa1b1('0xc5')](_0x568649)[_0xa1b1('0x9d')](loggerCatch('[syncHangupIvr]'));}if(_0x19cbf6&&_0x19cbf6[_0xa1b1('0x41')]!=='ivr'&&isNotNull(this[_0xa1b1('0x20')][_0x19cbf6[_0xa1b1('0xbc')]][_0xa1b1('0x12b')])){delete this[_0xa1b1('0x27')][_0x1402b8[_0xa1b1('0xbd')]];this[_0xa1b1('0xc9')](this['voiceQueues'][_0x19cbf6[_0xa1b1('0xbc')]]);this['voiceQueues'][_0x19cbf6[_0xa1b1('0xbc')]][_0xa1b1('0x10f')]+=0x1;this[_0xa1b1('0x20')][_0x19cbf6[_0xa1b1('0xbc')]][_0xa1b1('0x110')]+=0x1;_0x568649=new Hangup(_0x19cbf6,_0x1402b8);_0x568649[_0xa1b1('0x6c')]=0x10;_0x568649['statedesc']=_0xa1b1('0x12c');_0x568649['membername']=_0xa1b1('0x12d');hopperUtils[_0xa1b1('0xc3')](_0x568649)['catch'](loggerCatch(_0xa1b1('0x12a')));hopperUtils[_0xa1b1('0xc5')](_0x568649)[_0xa1b1('0x9d')](loggerCatch('[syncHangupIvr]'));}if(_0x19cbf6&&_0x19cbf6[_0xa1b1('0x41')]!==_0xa1b1('0xc8')&&!isNotNull(this[_0xa1b1('0x20')][_0x19cbf6['queue']]['dialQueueProject'])){if(_0x1402b8[_0xa1b1('0x12e')]==='Normal\x20Clearing'){delete this[_0xa1b1('0x27')][_0x1402b8['uniqueid']];this[_0xa1b1('0x20')][_0x19cbf6[_0xa1b1('0xbc')]][_0xa1b1('0x10f')]+=0x1;const _0x2147e7=new AgentComplete(_0x19cbf6,_0x1402b8);_0x2147e7['CampaignId']=this[_0xa1b1('0x20')][_0x19cbf6[_0xa1b1('0xbc')]]['id'];hopperUtils['createHistory'](_0x2147e7)['catch'](loggerCatch(_0xa1b1('0xc4')));hopperUtils[_0xa1b1('0xc5')](_0x2147e7)[_0xa1b1('0x9d')](loggerCatch(_0xa1b1('0xc6')));}else{delete this[_0xa1b1('0x27')][_0x1402b8['uniqueid']];this[_0xa1b1('0xc9')](this[_0xa1b1('0x20')][_0x19cbf6[_0xa1b1('0xbc')]]);this['voiceQueues'][_0x19cbf6[_0xa1b1('0xbc')]][_0xa1b1('0x12f')]+=0x1;_0x568649=new Hangup(_0x19cbf6,_0x1402b8);_0x568649[_0xa1b1('0x6c')]=0xc;_0x568649['statedesc']=_0x1402b8['cause-txt'];_0x568649[_0xa1b1('0x115')]=_0xa1b1('0x130');hopperUtils[_0xa1b1('0xc3')](_0x568649)['catch'](loggerCatch(_0xa1b1('0x12a')));hopperUtils[_0xa1b1('0xc5')](_0x568649)[_0xa1b1('0x9d')](loggerCatch(_0xa1b1('0x131')));}}};Dialer[_0xa1b1('0x82')]['syncQueueSummary']=function(_0x1ef3a0){var _0x3cde2d=this;if(!_0x3cde2d[_0xa1b1('0x2d')][_0x1ef3a0[_0xa1b1('0x47')]]){_0x3cde2d[_0xa1b1('0x2d')][_0x1ef3a0[_0xa1b1('0x47')]]={'running':![]};}else if(_0x3cde2d[_0xa1b1('0x2d')][_0x1ef3a0[_0xa1b1('0x47')]]['running']===!![]){return;}else if(_0x3cde2d['queuesSummary'][_0x1ef3a0[_0xa1b1('0x47')]][_0xa1b1('0x132')]===![]){_0x3cde2d[_0xa1b1('0x2d')][_0x1ef3a0[_0xa1b1('0x47')]][_0xa1b1('0x132')]=!![];}var _0x5b1164=_0x3cde2d[_0xa1b1('0x20')][_0x1ef3a0[_0xa1b1('0x47')]];var _0x191d3f=_0x5b1164[_0xa1b1('0x65')]!==utils[_0xa1b1('0x66')][_0xa1b1('0x76')];var _0x12c3ee=utils[_0xa1b1('0x133')](_0x5b1164);_0x5b1164[_0xa1b1('0x134')]=utils[_0xa1b1('0x135')](_0x5b1164,_0x3cde2d[_0xa1b1('0x23')]);Promise[_0xa1b1('0x136')]()[_0xa1b1('0x3e')](function(){if(_0x5b1164[_0xa1b1('0x134')]===utils[_0xa1b1('0x66')]['INACTIVE']){if(_0x191d3f){clearPredictiveAttributes(_0x5b1164);_0x1ef3a0[_0xa1b1('0x5f')]=undefined;_0x1ef3a0[_0xa1b1('0x29')]=undefined;}if(_0x5b1164[_0xa1b1('0x134')]===utils['CAMPAIGN_STATUS'][_0xa1b1('0x76')]){_0x1ef3a0[_0xa1b1('0x137')]=0x0;_0x1ef3a0[_0xa1b1('0xf6')]=0x0;_0x1ef3a0['inUse']=0x0;_0x1ef3a0[_0xa1b1('0x138')]=0x0;_0x1ef3a0[_0xa1b1('0x139')]=0x0;}}else if(_0x5b1164[_0xa1b1('0x134')]===utils[_0xa1b1('0x66')][_0xa1b1('0x13a')]&&!_0x12c3ee){return _0x3cde2d[_0xa1b1('0x91')](_0x5b1164,!![])[_0xa1b1('0x3e')](function(){return _0x3cde2d[_0xa1b1('0x91')](_0x5b1164,![]);})[_0xa1b1('0x3e')](function(){return _0x3cde2d['checkDialMethod'](_0x5b1164);})[_0xa1b1('0x9d')](function(_0x2ead9a){loggerSyncQueueSummary[_0xa1b1('0x43')](_0xa1b1('0x13b'),util[_0xa1b1('0x45')](_0x2ead9a,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x5b1164);});}else{clearPredictiveAttributes(_0x5b1164);}})[_0xa1b1('0x3e')](function(){var _0x3c9bd3=_0x1ef3a0[_0xa1b1('0x13c')](_0x5b1164);if(_0x3c9bd3||_0x5b1164[_0xa1b1('0x13d')]){_0x5b1164[_0xa1b1('0x13d')]=![];_0x1ef3a0[_0xa1b1('0x13e')](_0x5b1164);Object[_0xa1b1('0x13f')](_0x5b1164,_0x1ef3a0);emitOutboundVoiceQueueSummary(_0x1ef3a0);}_0x3cde2d[_0xa1b1('0x2d')][_0x5b1164[_0xa1b1('0x47')]]['running']=![];})[_0xa1b1('0x9d')](function(_0x2cc3e3){logger['error'](_0xa1b1('0x13b'),util[_0xa1b1('0x45')](_0x2cc3e3,{'showHidden':![],'depth':null}));_0x3cde2d[_0xa1b1('0x2d')][_0x5b1164['name']][_0xa1b1('0x132')]=![];});};Dialer[_0xa1b1('0x82')][_0xa1b1('0x140')]=_[_0xa1b1('0x141')](function(){var _0x17610e=_['filter'](this[_0xa1b1('0x20')],function(_0x21e85a){return _0x21e85a[_0xa1b1('0x142')];});var _0x104668=_[_0xa1b1('0x143')](this[_0xa1b1('0x22')],function(_0x20fe7e){return _0x20fe7e[_0xa1b1('0x144')]&&_0x20fe7e[_0xa1b1('0x86')]===_0xa1b1('0x87');});if(_0x17610e[_0xa1b1('0x96')]>0x0&&_0x104668[_0xa1b1('0x96')]>0x0){return Promise[_0xa1b1('0x136')]()[_0xa1b1('0x3e')](cmHopper[_0xa1b1('0x145')](_[_0xa1b1('0x146')](_0x17610e,'id'),previewRecallmeReminderInterval,_['map'](_0x104668,'id')))[_0xa1b1('0x3e')](function(_0x244b59){for(var _0x4de936=0x0;_0x4de936<_0x244b59['length'];_0x4de936++){var _0x9a113b=_0x244b59[_0x4de936][_0xa1b1('0x147')]['name'];if(_0x9a113b)io['to'](util[_0xa1b1('0x46')]('user:%s',_0x9a113b))[_0xa1b1('0x40')](_0xa1b1('0x148'),{'hopper':_0x244b59[_0x4de936]});}})['catch'](function(_0x3ffc38){logger[_0xa1b1('0x62')](_0xa1b1('0x149'),_0x3ffc38);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0xa1b1('0x82')][_0xa1b1('0x14a')]=function(){var _0x1e2b7=this;setInterval(function(){_0x1e2b7['clearZombieChannels'](_0x1e2b7[_0xa1b1('0x27')],_0xa1b1('0x14b'));_0x1e2b7[_0xa1b1('0x14c')](_0x1e2b7['actions'],_0xa1b1('0x14d'));},0x32c8);};Dialer['prototype'][_0xa1b1('0x14c')]=function(_0x405ce5,_0x693895){var _0x14b510=this;for(var _0x27a931 in _0x405ce5){if(typeof _0x405ce5[_0x27a931]!==_0xa1b1('0xa6')){this['sequence'][_0xa1b1('0x1d')](function(){if(!_[_0xa1b1('0xf1')](_0x405ce5[_0x27a931])){return ami[_0xa1b1('0x98')]({'action':_0xa1b1('0x86'),'channel':_0x405ce5[_0x27a931][_0xa1b1('0xec')]})[_0xa1b1('0x9d')](function(_0x39c4f8){if(_0x39c4f8[_0xa1b1('0x65')]===_0xa1b1('0x14e')){setTimeout(function(){if(_0x405ce5[_0x27a931]&&_0x405ce5[_0x27a931][_0xa1b1('0x41')]!==_0xa1b1('0xc8')){_0x14b510[_0xa1b1('0xc9')](_0x14b510[_0xa1b1('0x20')][_0x405ce5[_0x27a931][_0xa1b1('0xbc')]]);logger[_0xa1b1('0x62')]('[Dialer][checkChannel]',_0x693895,_0x27a931,_0x405ce5[_0x27a931][_0xa1b1('0xbc')]);delete _0x405ce5[_0x27a931];}if(_0x405ce5[_0x27a931]&&_0x405ce5[_0x27a931]['type']==='ivr'){_0x14b510[_0xa1b1('0xc9')](_0x14b510[_0xa1b1('0x21')][_0x405ce5[_0x27a931][_0xa1b1('0xbc')]]);logger[_0xa1b1('0x62')]('[Dialer][checkChannel][ivr]',_0x693895,_0x27a931,_0x405ce5[_0x27a931]['queue']);delete _0x405ce5[_0x27a931];}},0x2328);}});}});}}};Dialer[_0xa1b1('0x82')][_0xa1b1('0x14f')]=function(_0x2e96da){return Promise['resolve']()[_0xa1b1('0x3e')](voiceQueueRt[_0xa1b1('0x14f')](_0x2e96da))[_0xa1b1('0x9d')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0xa1b1('0x82')][_0xa1b1('0xc9')]=function(_0x3b55df){if(!_[_0xa1b1('0x50')](_0x3b55df)&&_0x3b55df!==null){if(typeof _0x3b55df[_0xa1b1('0x7b')]!==_0xa1b1('0xa6')){if(_0x3b55df[_0xa1b1('0x7b')]>0x0){_0x3b55df[_0xa1b1('0x7b')]-=0x1;}else{logger[_0xa1b1('0x62')](_0xa1b1('0x150'));}}}else{logger[_0xa1b1('0x62')](_0xa1b1('0x151'));}};Dialer['prototype'][_0xa1b1('0x152')]=function(_0x12ac9b,_0x347a48){var _0x279e88=this;return function(_0x50c118){_0x279e88['updateOriginated'](_0x347a48);logger[_0xa1b1('0x62')](_0x12ac9b,util[_0xa1b1('0x45')](_0x50c118,{'showHidden':![],'depth':null}));};};Dialer['prototype']['emptyContact']=function(_0x736df6,_0xb7bd42,_0x427733){var _0x1eb097={'state':0x19,'statedesc':_0xa1b1('0x153')};this[_0xa1b1('0xc9')](_0xb7bd42);this[_0xa1b1('0x154')](_[_0xa1b1('0x5c')](_0x1eb097,_[_0xa1b1('0xf4')](_0x427733,[_0xa1b1('0xdb'),_0xa1b1('0xdc'),_0xa1b1('0x155'),_0xa1b1('0xdd'),_0xa1b1('0xf9')])),_0xa1b1('0x156'),_0xa1b1('0x157'));logger[_0xa1b1('0x62')](_0x736df6);};Dialer['prototype'][_0xa1b1('0x154')]=function(_0xf648ae,_0x18314c,_0x4daab4){hopperUtils[_0xa1b1('0xc3')](_0xf648ae)['catch'](loggerCatch(_0x18314c));hopperUtils[_0xa1b1('0xc5')](_0xf648ae)[_0xa1b1('0x9d')](loggerCatch(_0x4daab4));};Dialer[_0xa1b1('0x82')][_0xa1b1('0xd8')]=function(_0x8de310,_0xc4b80c){hopperUtils[_0xa1b1('0xc3')](_0x8de310)[_0xa1b1('0x9d')](loggerCatch(_0xa1b1('0xc4')));if(_0xc4b80c==0x0){hopperUtils['moveContactManagedDialer'](_0x8de310)['catch'](loggerCatch(_0xa1b1('0x158')));}};Dialer[_0xa1b1('0x82')][_0xa1b1('0x149')]=function(_0x239cbb){return Promise[_0xa1b1('0x136')]()['then'](cmHopper[_0xa1b1('0x145')](_0x239cbb['id'],previewRecallmeReminderInterval))[_0xa1b1('0x3e')](function(_0x357e51){for(var _0x28c2be=0x0;_0x28c2be<_0x357e51['length'];_0x28c2be++){var _0x1c6fd8=_0x357e51[_0x28c2be][_0xa1b1('0x147')][_0xa1b1('0x47')];if(_0x1c6fd8)io['to'](util[_0xa1b1('0x46')]('user:%s',_0x1c6fd8))['emit'](_0xa1b1('0x148'),{'hopper':_0x357e51[_0x28c2be]});}})[_0xa1b1('0x9d')](function(){});};Dialer[_0xa1b1('0x82')][_0xa1b1('0x159')]=function(_0x568b19){var _0x59096f=this;return function(){_0x59096f[_0xa1b1('0x15a')](_0x568b19);};};Dialer[_0xa1b1('0x82')][_0xa1b1('0x15b')]=function(_0xf008d,_0x2388d1){var _0x316614=this;var _0x56a9d5=uuid['v4']();this[_0xa1b1('0xed')][_0x56a9d5]=new Action(_0xf008d,_0x2388d1,_0x56a9d5);return new Promise(function(_0x47fa46,_0x3b0b55){if(_[_0xa1b1('0x50')](_0xf008d)&&typeof _0xf008d!==_0xa1b1('0x15c')){return _0x3b0b55(msgResponse('originate',_0xa1b1('0x8f'),_0xa1b1('0x15d')));}if(_['isUndefined'](_0x2388d1[_0xa1b1('0x15e')])||_0x2388d1[_0xa1b1('0x15e')]===null){return _0x3b0b55(msgResponse(_0xa1b1('0x15f'),'Failure','contact\x20is\x20undefine'));}var _0x4b04ab={'XMD-CALLERID':_0x316614['actions'][_0x56a9d5][_0xa1b1('0x160')](),'XMD-AGI':_0xf008d[_0xa1b1('0x12b')]?util[_0xa1b1('0x46')](_0xa1b1('0x161'),ipAgi,_0xf008d[_0xa1b1('0x12b')]):'NONE','XMD-AGIAFTER':_0xf008d[_0xa1b1('0xc0')]?util[_0xa1b1('0x46')](_0xa1b1('0x161'),ipAgi,_0xf008d[_0xa1b1('0xc0')]):_0xa1b1('0x162'),'XMD-QUEUE':utils[_0xa1b1('0x163')](_0xf008d)?util[_0xa1b1('0x46')]('\x22%s,%s%s,,,%s\x22',_0xf008d[_0xa1b1('0x47')],_0xf008d['dialQueueOptions']||'',_0xf008d[_0xa1b1('0xc1')]?'c':'',_0xf008d['dialQueueTimeout']||0x3):_0xa1b1('0x162'),'XMD-CONTACTID':_0x2388d1['ContactId'],'XMD-CDRTYPE':_0xa1b1('0x7'),'CALLERID(all)':_0x316614[_0xa1b1('0xed')][_0x56a9d5][_0xa1b1('0x160')](),'XMD-AMD':_0xf008d['dialAMDActive']?'ACTIVE':_0xa1b1('0x162'),'XMD-DESTINATION':_0xa1b1('0x10b')};if(_0xf008d[_0xa1b1('0x10c')]){_0x4b04ab[_0xa1b1('0x164')]=_0xf008d[_0xa1b1('0x165')]||0x9c4;_0x4b04ab[_0xa1b1('0x166')]=_0xf008d['dialAMDGreeting']||0x5dc;_0x4b04ab[_0xa1b1('0x167')]=_0xf008d[_0xa1b1('0x168')]||0x320;_0x4b04ab[_0xa1b1('0x169')]=_0xf008d['dialAMDTotalAnalysisTime']||0x1388;_0x4b04ab[_0xa1b1('0x16a')]=_0xf008d['dialAMDMinWordLength']||0x64;_0x4b04ab[_0xa1b1('0x16b')]=_0xf008d[_0xa1b1('0x16c')]||0x32;_0x4b04ab[_0xa1b1('0x16d')]=_0xf008d[_0xa1b1('0x16e')]||0x3;_0x4b04ab[_0xa1b1('0x16f')]=_0xf008d[_0xa1b1('0x170')]||0x100;_0x4b04ab[_0xa1b1('0x171')]=_0xf008d[_0xa1b1('0x172')]||0x1388;}if(utils['isOutboundQueue'](_0xf008d)){_0x4b04ab[_0xa1b1('0x173')]=_0x2388d1['VoiceQueueId'];}else{_0x4b04ab[_0xa1b1('0x174')]=_0x2388d1[_0xa1b1('0xf9')];}var _0x19400d=utils[_0xa1b1('0x175')](_0x2388d1['Contact']);Object['assign'](_0x4b04ab,_0x19400d);var _0x4385c3=_0x316614[_0xa1b1('0x83')](_0xf008d[_0xa1b1('0x176')])?utils[_0xa1b1('0x177')](_0xf008d['Trunk'][_0xa1b1('0x178')],_0xf008d[_0xa1b1('0x179')],_0xf008d[_0xa1b1('0x17a')]>0x0?utils[_0xa1b1('0x17b')](_0xf008d[_0xa1b1('0x17c')],_0xf008d[_0xa1b1('0x17a')]):_0xf008d[_0xa1b1('0x17c')]):utils[_0xa1b1('0x177')](_[_0xa1b1('0xf1')](_0xf008d[_0xa1b1('0x8a')])?_0xf008d[_0xa1b1('0x176')][_0xa1b1('0x178')]:_0xf008d['TrunkBackup'][_0xa1b1('0x178')],_0xf008d['dialOriginateCallerIdName'],_0xf008d[_0xa1b1('0x17a')]>0x0?utils[_0xa1b1('0x17b')](_0xf008d['dialOriginateCallerIdNumber'],_0xf008d['dialRandomLastDigitCallerIdNumber']):_0xf008d[_0xa1b1('0x17c')]);if(_0x4385c3){_0x4b04ab[_0xa1b1('0x17d')]=_0x316614[_0xa1b1('0xed')][_0x56a9d5][_0xa1b1('0x17e')]=utils['extractCalleridName'](_0x4385c3);_0x4b04ab[_0xa1b1('0x17f')]=_0x2388d1['phone'];}_0xf008d[_0xa1b1('0x180')]=_0x4b04ab;return ami['Action']({'actionid':_0x56a9d5,'action':_0xa1b1('0x15f'),'channel':_0x316614[_0xa1b1('0x83')](_0xf008d[_0xa1b1('0x176')])?util[_0xa1b1('0x46')](_0xa1b1('0x181'),_0xf008d['Trunk'][_0xa1b1('0x47')],isNotNull(_0xf008d[_0xa1b1('0x182')])?_0xf008d['dialPrefix'][_0xa1b1('0x183')]()||'':'',_0xf008d[_0xa1b1('0x184')]>0x0?_0x2388d1[_0xa1b1('0x15e')]['substring'](_0xf008d[_0xa1b1('0x184')]):_0x2388d1[_0xa1b1('0x15e')]):util[_0xa1b1('0x46')](_0xa1b1('0x181'),_['isNil'](_0xf008d[_0xa1b1('0x8a')])?_0xf008d[_0xa1b1('0x176')][_0xa1b1('0x47')]:_0xf008d['TrunkBackup'][_0xa1b1('0x47')],isNotNull(_0xf008d[_0xa1b1('0x182')])?_0xf008d[_0xa1b1('0x182')][_0xa1b1('0x183')]()||'':'',_0xf008d[_0xa1b1('0x184')]>0x0?_0x2388d1[_0xa1b1('0x15e')][_0xa1b1('0x185')](_0xf008d[_0xa1b1('0x184')]):_0x2388d1['phone']),'callerid':_0x4385c3,'Exten':_0xa1b1('0x10b'),'Context':_0xa1b1('0x186'),'Priority':'1','variable':_0x4b04ab,'timeout':(_0xf008d[_0xa1b1('0x187')]||0x1e)*0x3e8,'async':!![],'channelid':_0x56a9d5})[_0xa1b1('0x3e')](function(_0x13f2af){return _0x47fa46(_0x13f2af);})[_0xa1b1('0x9d')](function(_0x1549df){_0xf008d['outboundOriginateFailureCallsDay']+=0x1;var _0xf2d6ab=new History(_0x316614['actions'][_0x56a9d5]);logger[_0xa1b1('0x62')](util['format'](_0xa1b1('0x188'),JSON[_0xa1b1('0x71')](_0x1549df)));_0xf2d6ab[_0xa1b1('0x6c')]=0xe;_0xf2d6ab[_0xa1b1('0x6d')]=_0xa1b1('0x189');_0xf2d6ab['starttime']=moment()['format'](_0xa1b1('0xc2'));_0xf2d6ab[_0xa1b1('0xdf')]=_0xf2d6ab[_0xa1b1('0x6e')];hopperUtils['createHistory'](_0xf2d6ab)[_0xa1b1('0x9d')](loggerCatch(_0xa1b1('0x18a')));_0x316614[_0xa1b1('0xc5')](_0xf2d6ab)[_0xa1b1('0x9d')](loggerCatch('[originate][error]'))[_0xa1b1('0x1f')](function(){delete _0x316614['actions'][_0x56a9d5];return _0x3b0b55(msgResponse(_0xa1b1('0x15f'),'Error',_0xa1b1('0x18b')));});});});};Dialer['prototype'][_0xa1b1('0x18c')]=function(_0x4cff28,_0x556340,_0x38906e){var _0x3a5c55=new History(_0x556340);if(_0x3a5c55[_0xa1b1('0x119')]+_0x3a5c55[_0xa1b1('0x11a')]+_0x3a5c55['countnoanswerretry']+_0x3a5c55[_0xa1b1('0x126')]+_0x3a5c55[_0xa1b1('0xd0')]+_0x3a5c55[_0xa1b1('0xe9')]+_0x3a5c55[_0xa1b1('0x116')]+_0x3a5c55[_0xa1b1('0x11c')]>=_0x38906e[_0xa1b1('0x127')]-0x1){return!![];}switch(_0x4cff28){case 0x3:if(_0x3a5c55['countnoanswerretry']>=_0x38906e[_0xa1b1('0x18d')]-0x1){return!![];}hopperUtils[_0xa1b1('0xd9')]({'active':![],'countnoanswerretry':_0x3a5c55[_0xa1b1('0x11b')]+=0x1,'scheduledat':moment()[_0xa1b1('0xda')](_0x38906e[_0xa1b1('0x18e')],_0xa1b1('0xea'))[_0xa1b1('0x46')](_0xa1b1('0xc2')),'ContactId':_0x3a5c55[_0xa1b1('0xdb')],'ListId':_0x3a5c55['ListId'],'VoiceQueueId':_0x3a5c55['VoiceQueueId']||undefined,'CampaignId':_0x3a5c55[_0xa1b1('0xf9')]||undefined})[_0xa1b1('0x9d')](loggerCatch(_0xa1b1('0x18f')));break;case 0x5:if(_0x3a5c55[_0xa1b1('0x119')]>=_0x38906e[_0xa1b1('0x190')]-0x1){return!![];}hopperUtils[_0xa1b1('0xd9')]({'active':![],'countbusyretry':_0x3a5c55[_0xa1b1('0x119')]+=0x1,'scheduledat':moment()['add'](_0x38906e[_0xa1b1('0x191')],_0xa1b1('0xea'))['format'](_0xa1b1('0xc2')),'ContactId':_0x3a5c55[_0xa1b1('0xdb')],'ListId':_0x3a5c55[_0xa1b1('0xdc')],'VoiceQueueId':_0x3a5c55['VoiceQueueId']||undefined,'CampaignId':_0x3a5c55[_0xa1b1('0xf9')]||undefined})[_0xa1b1('0x9d')](loggerCatch(_0xa1b1('0x192')));break;case 0x8:if(_0x3a5c55[_0xa1b1('0x11a')]>=_0x38906e['dialCongestionMaxRetry']-0x1){return!![];}hopperUtils[_0xa1b1('0xd9')]({'active':![],'countcongestionretry':_0x3a5c55['countcongestionretry']+=0x1,'scheduledat':moment()[_0xa1b1('0xda')](_0x38906e['dialCongestionRetryFrequency'],_0xa1b1('0xea'))[_0xa1b1('0x46')](_0xa1b1('0xc2')),'ContactId':_0x3a5c55[_0xa1b1('0xdb')],'ListId':_0x3a5c55[_0xa1b1('0xdc')],'VoiceQueueId':_0x3a5c55[_0xa1b1('0xdd')]||undefined,'CampaignId':_0x3a5c55[_0xa1b1('0xf9')]||undefined})[_0xa1b1('0x9d')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x3a5c55[_0xa1b1('0x126')]>=_0x38906e[_0xa1b1('0x193')]-0x1){return!![];}else{hopperUtils[_0xa1b1('0xd9')]({'active':![],'countnosuchnumberretry':_0x3a5c55[_0xa1b1('0x126')]+=0x1,'scheduledat':moment()[_0xa1b1('0xda')](_0x38906e['dialNoSuchNumberRetryFrequency'],'minutes')['format'](_0xa1b1('0xc2')),'ContactId':_0x3a5c55[_0xa1b1('0xdb')],'ListId':_0x3a5c55['ListId'],'VoiceQueueId':_0x3a5c55[_0xa1b1('0xdd')]||undefined,'CampaignId':_0x3a5c55[_0xa1b1('0xf9')]||undefined})[_0xa1b1('0x9d')](loggerCatch(_0xa1b1('0x194')));}break;case 0xa:if(_0x3a5c55['countdropretry']>=_0x38906e['dialDropMaxRetry']-0x1){return!![];}hopperUtils[_0xa1b1('0xd9')]({'active':![],'countdropretry':_0x3a5c55[_0xa1b1('0xd0')]+=0x1,'scheduledat':moment()['add'](_0x38906e[_0xa1b1('0xd2')],_0xa1b1('0xea'))[_0xa1b1('0x46')](_0xa1b1('0xc2')),'ContactId':_0x3a5c55[_0xa1b1('0xdb')],'ListId':_0x3a5c55[_0xa1b1('0xdc')],'VoiceQueueId':_0x3a5c55[_0xa1b1('0xdd')]||undefined,'CampaignId':_0x3a5c55[_0xa1b1('0xf9')]||undefined})[_0xa1b1('0x9d')](loggerCatch(_0xa1b1('0x195')));break;case 0xb:if(_0x3a5c55[_0xa1b1('0xe9')]>=_0x38906e[_0xa1b1('0xe8')]-0x1){return!![];}hopperUtils[_0xa1b1('0xd9')]({'active':![],'countabandonedretry':_0x3a5c55[_0xa1b1('0xe9')]+=0x1,'scheduledat':moment()['add'](_0x38906e['dialAbandonedRetryFrequency'],_0xa1b1('0xea'))[_0xa1b1('0x46')](_0xa1b1('0xc2')),'ContactId':_0x3a5c55[_0xa1b1('0xdb')],'ListId':_0x3a5c55[_0xa1b1('0xdc')],'VoiceQueueId':_0x3a5c55[_0xa1b1('0xdd')]||undefined,'CampaignId':_0x3a5c55['CampaignId']||undefined})['catch'](loggerCatch(_0xa1b1('0xeb')));break;case 0x13:if(_0x3a5c55['countmachineretry']>=_0x38906e[_0xa1b1('0x11f')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x3a5c55[_0xa1b1('0x116')]+=0x1,'scheduledat':moment()[_0xa1b1('0xda')](_0x38906e[_0xa1b1('0x128')],_0xa1b1('0xea'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3a5c55['ContactId'],'ListId':_0x3a5c55['ListId'],'VoiceQueueId':_0x3a5c55[_0xa1b1('0xdd')]||undefined,'CampaignId':_0x3a5c55[_0xa1b1('0xf9')]||undefined})[_0xa1b1('0x9d')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x3a5c55[_0xa1b1('0x11c')]>=_0x38906e[_0xa1b1('0x196')]-0x1){return!![];}hopperUtils[_0xa1b1('0xd9')]({'active':![],'countagentrejectretry':_0x3a5c55[_0xa1b1('0x11c')]+=0x1,'scheduledat':moment()[_0xa1b1('0xda')](_0x38906e[_0xa1b1('0x197')],'minutes')[_0xa1b1('0x46')](_0xa1b1('0xc2')),'ContactId':_0x3a5c55[_0xa1b1('0xdb')],'ListId':_0x3a5c55[_0xa1b1('0xdc')],'VoiceQueueId':_0x3a5c55[_0xa1b1('0xdd')]||undefined,'CampaignId':_0x3a5c55[_0xa1b1('0xf9')]||undefined})[_0xa1b1('0x9d')](loggerCatch(_0xa1b1('0x198')));break;default:return!![];}};Dialer[_0xa1b1('0x82')][_0xa1b1('0x106')]=function(_0x4f0bd4,_0x1904ab,_0xd59a58){var _0x287332=this;var _0x5eec3c=new History(_0x4f0bd4);var _0x41f3aa=![];var _0x281d08;var _0x1e303d;return new Promise(function(_0x273d80,_0x413015){if(_[_0xa1b1('0x50')](_0x1904ab)&&typeof _0x1904ab!=='object'){return _0x413015(msgResponse('[callProgressDetecting]',_0xa1b1('0x8f'),'entity\x20is\x20undefine'));}if(_['isUndefined'](_0xd59a58)&&typeof _0xd59a58!==_0xa1b1('0x15c')){return _0x413015(msgResponse(_0xa1b1('0x199'),_0xa1b1('0x8f'),'evt\x20is\x20undefine'));}hopperUtils['verifyAdditionalPhones'](_0x5eec3c,_0xd59a58[_0xa1b1('0x19a')],_0x1904ab)[_0xa1b1('0x3e')](function(_0x2b610c){if(_0x2b610c[_0xa1b1('0xd6')]==0x1)_0x41f3aa=!![];switch(_0xd59a58['reason']){case'0':_0x1904ab[_0xa1b1('0x19b')]+=0x1;_0x5eec3c['state']=0x0;_0x5eec3c[_0xa1b1('0x6d')]=_0xa1b1('0x19c');_0x5eec3c[_0xa1b1('0x126')]+=0x1;_0x5eec3c[_0xa1b1('0xd1')]+=0x1;ami[_0xa1b1('0x40')](_0xa1b1('0x19d'),ut[_0xa1b1('0x112')](_0x4f0bd4,_0xa1b1('0x19e')));_0x281d08=_0x1904ab[_0xa1b1('0x19f')];_0x1e303d=_0x1904ab['callAdditionalPhoneAfterMin'];hopperUtils[_0xa1b1('0xc3')](_0x5eec3c)[_0xa1b1('0x9d')](loggerCatch(_0xa1b1('0x125')));if(_0x287332[_0xa1b1('0x18c')](0x0,_0x4f0bd4,_0x1904ab)&&!_0x41f3aa){if(_0x5eec3c[_0xa1b1('0x126')]>=_0x1904ab[_0xa1b1('0x193')]){_0x287332[_0xa1b1('0x120')](_0x5eec3c,_0x273d80,_0x413015,_0xa1b1('0x1a0'));}else{_0x287332[_0xa1b1('0x11d')](_0x5eec3c,_0x273d80,_0x413015,_0xa1b1('0x1a0'));}}break;case'3':_0x1904ab[_0xa1b1('0x1a1')]+=0x1;_0x5eec3c[_0xa1b1('0x6c')]=0x3;_0x5eec3c[_0xa1b1('0x6d')]=_0xa1b1('0x1a2');_0x5eec3c[_0xa1b1('0x11b')]+=0x1;_0x5eec3c[_0xa1b1('0xd1')]+=0x1;var _0x557d21=ut['buildNoAnswerEventPayload'](_0x4f0bd4,_0x1904ab);ami[_0xa1b1('0x40')](_0xa1b1('0x1a3'),_0x557d21);_0x281d08=_0x1904ab['dialNoAnswerRetryFrequency'];_0x1e303d=_0x1904ab['callAdditionalPhoneAfterMin'];hopperUtils['createHistory'](_0x5eec3c)[_0xa1b1('0x9d')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x287332['checkRetriveMax'](0x3,_0x4f0bd4,_0x1904ab)&&!_0x41f3aa){if(_0x5eec3c[_0xa1b1('0x11b')]>=_0x1904ab[_0xa1b1('0x18d')]){_0x287332[_0xa1b1('0x120')](_0x5eec3c,_0x273d80,_0x413015,'reason\x203\x20ringing\x20no\x20answer');}else{_0x287332[_0xa1b1('0x11d')](_0x5eec3c,_0x273d80,_0x413015,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x1904ab[_0xa1b1('0x1a4')]+=0x1;_0x5eec3c[_0xa1b1('0x6c')]=0x5;_0x5eec3c[_0xa1b1('0x6d')]=_0xa1b1('0x1a5');_0x5eec3c['countbusyretry']+=0x1;_0x5eec3c[_0xa1b1('0xd1')]+=0x1;ami['emit'](_0xa1b1('0x1a6'),ut['buildObj'](_0x4f0bd4,_0xa1b1('0x1a7')));_0x281d08=_0x1904ab[_0xa1b1('0x191')];_0x1e303d=_0x1904ab[_0xa1b1('0xd3')];hopperUtils['createHistory'](_0x5eec3c)[_0xa1b1('0x9d')](loggerCatch(_0xa1b1('0x1a8')));if(_0x287332[_0xa1b1('0x18c')](0x5,_0x4f0bd4,_0x1904ab)&&!_0x41f3aa){if(_0x5eec3c[_0xa1b1('0x119')]>=_0x1904ab[_0xa1b1('0x190')]){_0x287332[_0xa1b1('0x120')](_0x5eec3c,_0x273d80,_0x413015,_0xa1b1('0x1a9'));}else{_0x287332[_0xa1b1('0x11d')](_0x5eec3c,_0x273d80,_0x413015,'reason\x205\x20busy');}}break;case'8':_0x1904ab[_0xa1b1('0x1aa')]+=0x1;_0x5eec3c['state']=0x8;_0x5eec3c[_0xa1b1('0x6d')]=_0xa1b1('0x1ab');_0x5eec3c[_0xa1b1('0x11a')]+=0x1;_0x5eec3c[_0xa1b1('0xd1')]+=0x1;_0x281d08=_0x1904ab['dialCongestionRetryFrequency'];_0x1e303d=_0x1904ab[_0xa1b1('0xd3')];ami['emit'](_0xa1b1('0x1ac'),ut['buildObj'](_0x4f0bd4,_0xa1b1('0x1ad')));hopperUtils[_0xa1b1('0xc3')](_0x5eec3c)[_0xa1b1('0x9d')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x287332[_0xa1b1('0x18c')](0x8,_0x4f0bd4,_0x1904ab)&&!_0x41f3aa){if(_0x5eec3c['countcongestionretry']>=_0x1904ab[_0xa1b1('0x1ae')]){_0x287332[_0xa1b1('0x120')](_0x5eec3c,_0x273d80,_0x413015,_0xa1b1('0x1af'));}else{_0x287332[_0xa1b1('0x11d')](_0x5eec3c,_0x273d80,_0x413015,_0xa1b1('0x1af'));}}break;case'11':_0x1904ab[_0xa1b1('0x1b0')]+=0x1;_0x5eec3c[_0xa1b1('0x6c')]=0xb;_0x5eec3c[_0xa1b1('0x6d')]=_0xa1b1('0xe4');_0x5eec3c[_0xa1b1('0xe9')]+=0x1;_0x5eec3c['countglobal']+=0x1;_0x281d08=_0x1904ab[_0xa1b1('0xe7')];_0x1e303d=_0x1904ab[_0xa1b1('0xd3')];hopperUtils[_0xa1b1('0xc3')](_0x5eec3c)[_0xa1b1('0x9d')](loggerCatch(_0xa1b1('0x1b1')));if(_0x287332[_0xa1b1('0x18c')](0xb,_0x4f0bd4,_0x1904ab)&&!_0x41f3aa){if(_0x5eec3c[_0xa1b1('0xe9')]>=_0x1904ab[_0xa1b1('0xe8')]){_0x287332[_0xa1b1('0x120')](_0x5eec3c,_0x273d80,_0x413015,'reason\x2011\x20abandoned');}else{_0x287332[_0xa1b1('0x11d')](_0x5eec3c,_0x273d80,_0x413015,_0xa1b1('0x1b2'));}}break;case'20':_0x1904ab[_0xa1b1('0x1b3')]+=0x1;_0x5eec3c[_0xa1b1('0x6c')]=0x14;_0x5eec3c['statedesc']=_0xa1b1('0x1b4');_0x5eec3c[_0xa1b1('0x11c')]+=0x1;_0x5eec3c[_0xa1b1('0xd1')]+=0x1;_0x281d08=_0x1904ab[_0xa1b1('0x197')];_0x1e303d=_0x1904ab[_0xa1b1('0xd3')];ami[_0xa1b1('0x40')](_0xa1b1('0x1b5'),ut[_0xa1b1('0x112')](_0x4f0bd4,'agentreject'));hopperUtils[_0xa1b1('0xc3')](_0x5eec3c)[_0xa1b1('0x9d')](loggerCatch(_0xa1b1('0x1b6')));if(_0x287332['checkRetriveMax'](0x14,_0x4f0bd4,_0x1904ab)&&!_0x41f3aa){if(_0x5eec3c[_0xa1b1('0x11c')]>=_0x1904ab[_0xa1b1('0x196')]){_0x287332['createStateFinal'](_0x5eec3c,_0x273d80,_0x413015,_0xa1b1('0x1b7'));}else{_0x287332['stateGlobal'](_0x5eec3c,_0x273d80,_0x413015,_0xa1b1('0x1b7'));}}break;default:_0x1904ab['outboundUnknownCallsDay']+=0x1;_0x5eec3c['state']=0xc;_0x5eec3c['statedesc']=_0xd59a58[_0xa1b1('0x19a')];_0x281d08=_0x1904ab[_0xa1b1('0x197')];_0x1e303d=_0x1904ab[_0xa1b1('0xd3')];hopperUtils['createHistory'](_0x5eec3c)['catch'](loggerCatch(_0xa1b1('0x1b8')));if(_0x287332[_0xa1b1('0x18c')](_0xd59a58[_0xa1b1('0x19a')],_0x4f0bd4,_0x1904ab)&&!_0x41f3aa){if(_0x5eec3c[_0xa1b1('0x119')]+_0x5eec3c[_0xa1b1('0x11a')]+_0x5eec3c[_0xa1b1('0x11b')]+_0x5eec3c[_0xa1b1('0x126')]+_0x5eec3c[_0xa1b1('0xd0')]+_0x5eec3c[_0xa1b1('0xe9')]+_0x5eec3c['countmachineretry']+_0x5eec3c[_0xa1b1('0x11c')]>=_0x1904ab[_0xa1b1('0x127')]){_0x287332['stateGlobal'](_0x5eec3c,_0x273d80,_0x413015,_0xd59a58[_0xa1b1('0x19a')]);}else{_0x287332[_0xa1b1('0x120')](_0x5eec3c,_0x273d80,_0x413015,_0xd59a58[_0xa1b1('0x19a')]);}}}})[_0xa1b1('0x3e')](function(){if(_0x41f3aa){hopperUtils[_0xa1b1('0xe3')](_0x5eec3c,_0x281d08,_0x1e303d)[_0xa1b1('0x3e')](function(){return _0x273d80(0x1);});}});});};Dialer[_0xa1b1('0x82')][_0xa1b1('0x11d')]=function(_0x4127a3,_0x492ae3,_0x165ed9,_0x481334){var _0xe8ec41=new Final(_0x4127a3);_0xe8ec41['state']=0xf;_0xe8ec41['statedesc']=_0xa1b1('0x1b9');this[_0xa1b1('0x120')](_0xe8ec41,_0x492ae3,_0x165ed9,_0x481334);};Dialer[_0xa1b1('0x82')]['createStateFinal']=function(_0x3267fa,_0x20ef21,_0x196492,_0x1cce52){hopperUtils['moveContactManagedDialer'](_0x3267fa)[_0xa1b1('0x3e')](function(){return _0x20ef21(msgResponse(_0xa1b1('0x199'),_0xa1b1('0x105'),_0x1cce52));})[_0xa1b1('0x9d')](function(){return _0x196492(msgResponse(_0xa1b1('0x1ba'),_0xa1b1('0x8f'),_0xa1b1('0x1bb')));});};Dialer[_0xa1b1('0x82')][_0xa1b1('0x9')]=function(_0x2a6079){var _0x4f33bd=_0x2a6079[_0xa1b1('0x1bc')]/0x64;var _0x46106c=_0x2a6079[_0xa1b1('0xcd')]/(_0x2a6079[_0xa1b1('0xcd')]+_0x2a6079[_0xa1b1('0x10f')]);var _0x2eb989=Math['round'](_0x2a6079[_0xa1b1('0x1bd')]*(_0x2a6079['predictiveIntervalMaxThreshold']/0x64));var _0x26849c=Math[_0xa1b1('0x1be')](_0x2a6079[_0xa1b1('0x1bd')]*(_0x2a6079[_0xa1b1('0x1bf')]/0x64));var _0x3042ac=_0x2a6079['available']+_0x2a6079[_0xa1b1('0x138')];var _0x1af45a=Math[_0xa1b1('0x1c0')](_0x2a6079[_0xa1b1('0x56')]*_0x2a6079[_0xa1b1('0x59')]*_0x2a6079['predictiveIntervalHitRate']*_0x2a6079[_0xa1b1('0x1c1')]);if(_[_0xa1b1('0x50')](_0x2a6079[_0xa1b1('0x29')])){if(!_['isUndefined'](_0x2a6079[_0xa1b1('0x5f')])){_0x2a6079[_0xa1b1('0x5f')]=undefined;loggerPredictive[_0xa1b1('0x62')](_0xa1b1('0x1c2'),_0xa1b1('0x1c3'));}if(!_[_0xa1b1('0x50')](_0x2a6079[_0xa1b1('0x60')])){loggerPredictive[_0xa1b1('0x62')](_0xa1b1('0x1c2'),_0xa1b1('0x1c4'));clearInterval(_0x2a6079[_0xa1b1('0x60')]);_0x2a6079[_0xa1b1('0x60')]=undefined;}_0x2a6079['startProgressive']=moment()[_0xa1b1('0x46')](_0xa1b1('0xc2'));loggerPredictive[_0xa1b1('0x49')](_0x2a6079['name'],_0xa1b1('0x1c5'),_0x2a6079[_0xa1b1('0x29')]);this[_0xa1b1('0xb1')](_0x2a6079,0x1);}else if(ifInterval(_0x2a6079['dialPredictiveInterval'],_0x2a6079[_0xa1b1('0x29')])){this[_0xa1b1('0xb1')](_0x2a6079,0x1);loggerPredictiveCalls['info'](_0xa1b1('0x1c6'),_0x2a6079[_0xa1b1('0x29')],_0x2a6079[_0xa1b1('0x47')]);_0x2a6079[_0xa1b1('0x56')]=0x0;_0x2a6079[_0xa1b1('0xce')]=0x0;}else if(_0x4f33bd<_0x46106c&&_0x2a6079['dialPredictiveOptimization']==='dropRate'){clearPredictiveAttributes(_0x2a6079);loggerPredictive[_0xa1b1('0x49')](_0xa1b1('0x1c7'),_0xa1b1('0x1c8'),_0x46106c,_0xa1b1('0x29'),_0x2a6079['name']);}else if(_0x1af45a<_0x2a6079[_0xa1b1('0xce')]&&_0x2a6079['dialPredictiveOptimization']===_0xa1b1('0x1c9')){clearPredictiveAttributes(_0x2a6079);loggerPredictive[_0xa1b1('0x49')](_0xa1b1('0x1ca'),_0xa1b1('0x1cb'),_0x1af45a,'Drop\x20in\x20this\x20interval',_0x2a6079['predictiveIntervalErlangCallsDroppedCalls'],_0xa1b1('0x29'),_0x2a6079['name']);}else if(!ifInterval(_0x2a6079[_0xa1b1('0x1cc')],_0x2a6079[_0xa1b1('0x29')])&&_[_0xa1b1('0x50')](_0x2a6079[_0xa1b1('0x5f')])&&!_[_0xa1b1('0x50')](_0x2a6079[_0xa1b1('0x29')])){_0x2a6079[_0xa1b1('0x5f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x2a6079[_0xa1b1('0x47')],'started\x20in\x20predictive\x20at',_0x2a6079[_0xa1b1('0x5f')]);hopperUtils[_0xa1b1('0x1cd')](_0x2a6079[_0xa1b1('0x1cc')])['then'](this['getDataPredictive'](_0x2a6079))[_0xa1b1('0x3e')](mergeDataErlangB(_0x2a6079))[_0xa1b1('0x3e')](this[_0xa1b1('0x1ce')](_0x2a6079))[_0xa1b1('0x9d')](loggerCatchPredictive(_0xa1b1('0x1cf'),_0x2a6079));}else if(!ifInterval(_0x2a6079[_0xa1b1('0x1cc')],_0x2a6079[_0xa1b1('0x5f')])){_0x2a6079['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x2a6079[_0xa1b1('0x5f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xa1b1('0x49')](_0x2a6079['name'],_0xa1b1('0x1d0'),_0x2a6079['startPredictive']);clearInterval(_0x2a6079['handlePredictive']);_0x2a6079[_0xa1b1('0x60')]=undefined;hopperUtils['avgHandleTime'](_0x2a6079[_0xa1b1('0x1cc')])[_0xa1b1('0x3e')](this[_0xa1b1('0x1d1')](_0x2a6079))['then'](mergeDataErlangB(_0x2a6079))[_0xa1b1('0x3e')](this[_0xa1b1('0x1ce')](_0x2a6079))['catch'](loggerCatchPredictive(_0xa1b1('0x1d2'),_0x2a6079));}else if(_0x2a6079['predictiveIntervalAvailable']&&_0x3042ac<_0x2a6079[_0xa1b1('0x1bd')]-_0x26849c){clearPredictiveAttributes(_0x2a6079);loggerPredictive['info'](_0x2a6079[_0xa1b1('0x47')],_0xa1b1('0x1d3'),_0x3042ac,_0xa1b1('0x1d4'),_0x2a6079[_0xa1b1('0x1bd')],'-',_0x26849c,'=',_0x2a6079[_0xa1b1('0x1bd')]-_0x26849c,')');}else if(_0x2a6079['predictiveIntervalAvailable']&&_0x3042ac>_0x2a6079[_0xa1b1('0x1bd')]+_0x2eb989){clearPredictiveAttributes(_0x2a6079);loggerPredictive[_0xa1b1('0x49')](_0x2a6079['name'],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x3042ac,_0xa1b1('0x1d5'),_0x2a6079[_0xa1b1('0x1bd')],'+',_0x2eb989,'=',_0x2a6079[_0xa1b1('0x1bd')]+_0x2eb989,')');}};Dialer['prototype'][_0xa1b1('0x1d1')]=function(_0x2e0978){var _0x3a68a4=this;return function(_0x6af23c){return new Promise(function(_0x626668,_0x42bdb5){_[_0xa1b1('0x5c')](_0x2e0978,_0x6af23c[0x0]);if(checkGetDataPredictive(_0x6af23c[0x0])){var _0x574aee=_0x2e0978['predictiveIntervalAvailable']=_0x2e0978[_0xa1b1('0x138')]+_0x2e0978[_0xa1b1('0x137')];var _0x19dc06=_0x2e0978['dialPredictiveInterval']*0x3c;var _0x3bb707=_0x6af23c[0x0][_0xa1b1('0x4f')]+_0x6af23c[0x0][_0xa1b1('0x52')];var _0x3138f4=(_0x6af23c[0x0]['predictiveIntervalAnsweredCalls']+_0x6af23c[0x0][_0xa1b1('0x4d')]+_0x6af23c[0x0][_0xa1b1('0x4e')])/_0x6af23c[0x0]['predictiveIntervalTotalCalls'];_0x2e0978[_0xa1b1('0x1d6')]=_0x3138f4>0x0?_0x3138f4:0x1;switch(_0x2e0978[_0xa1b1('0x1d7')]){case _0xa1b1('0x1c9'):var _0x18d49d=_0x2e0978['dialPredictiveOptimizationPercentage']/0x64;return _0x3a68a4[_0xa1b1('0x1d8')](_0x574aee,_0x19dc06,_0x3bb707,_0x3138f4,_0x18d49d)['then'](function(_0x478456){return _0x626668(_0x478456);});case _0xa1b1('0x1d9'):var _0x51387e=_0x2e0978[_0xa1b1('0x1bc')]/0x64;return _0x3a68a4[_0xa1b1('0x1da')](_0x574aee,_0x19dc06,_0x3bb707,_0x3138f4,_0x51387e)[_0xa1b1('0x3e')](function(_0x251f0c){return _0x626668(_0x251f0c);});default:return _0x42bdb5(msgResponse(_0xa1b1('0x1db'),_0xa1b1('0x8f'),_0xa1b1('0x1dc')));}}else{return _0x42bdb5(msgResponse(_0xa1b1('0x1db'),_0xa1b1('0x8f'),'check\x20failure'));}});};};Dialer[_0xa1b1('0x82')][_0xa1b1('0x1dd')]=function(_0x5d04f5){var _0x5b1315=this;return function(_0x3aa580){return new Promise(function(_0xb6ef55,_0xccdfca){_[_0xa1b1('0x5c')](_0x5d04f5,_0x3aa580[0x0]);if(checkGetDataPredictive(_0x3aa580[0x0])){loggerPredictive[_0xa1b1('0x49')](JSON[_0xa1b1('0x71')](_0x3aa580[0x0]));if(_0x5d04f5[_0xa1b1('0x1d7')]==='dropRate'){return _0x5b1315[_0xa1b1('0x14f')](_0x5d04f5['id'])[_0xa1b1('0x3e')](function(_0x231349){var _0x8fcf1b=_0x5d04f5['loggedIn']-_0x231349[0x0][_0xa1b1('0x1de')];var _0x4aa69d=_0x5d04f5[_0xa1b1('0x1cc')]*0x3c;var _0x1b7cb6=_0x3aa580[0x0][_0xa1b1('0x4f')]+_0x3aa580[0x0][_0xa1b1('0x52')];var _0x1e1b8e=(_0x3aa580[0x0][_0xa1b1('0x1df')]+_0x3aa580[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x3aa580[0x0][_0xa1b1('0x4e')])/_0x3aa580[0x0]['predictiveIntervalTotalCalls'];var _0x7eedca=_0x5d04f5['dialPredictiveOptimizationPercentage']/0x64;_0x5d04f5[_0xa1b1('0x1e0')]=_0x231349[0x0][_0xa1b1('0x1de')]||0x0;_0x5d04f5[_0xa1b1('0x1d6')]=_0x1e1b8e>0x0?_0x1e1b8e:0x1;return _0x5b1315['abandonmentRate'](_0x8fcf1b,_0x4aa69d,_0x1b7cb6,_0x1e1b8e,_0x7eedca);})[_0xa1b1('0x3e')](function(_0x2ab990){return _0xb6ef55(_0x2ab990);})[_0xa1b1('0x9d')](function(_0x76781c){return _0xccdfca(msgResponse(_0xa1b1('0x1e1'),'Failure',JSON['stringify'](_0x76781c)));});}if(_0x5d04f5[_0xa1b1('0x1d7')]===_0xa1b1('0x1d9')){return _0x5b1315[_0xa1b1('0x14f')](_0x5d04f5['id'])[_0xa1b1('0x3e')](function(_0x102273){var _0x3d8aff=_0x5d04f5[_0xa1b1('0x1e2')]-_0x102273[0x0][_0xa1b1('0x1de')];var _0x19e5bd=_0x5d04f5[_0xa1b1('0x1cc')]*0x3c;var _0x31ba17=_0x3aa580[0x0]['predictiveIntervalAvgTalktime']+_0x3aa580[0x0][_0xa1b1('0x52')];var _0x4728e2=(_0x3aa580[0x0][_0xa1b1('0x1df')]+_0x3aa580[0x0][_0xa1b1('0x4d')]+_0x3aa580[0x0][_0xa1b1('0x4e')])/_0x3aa580[0x0][_0xa1b1('0x1e3')];var _0x450870=_0x5d04f5[_0xa1b1('0x1bc')]/0x64;_0x5d04f5[_0xa1b1('0x1e0')]=_0x102273[0x0][_0xa1b1('0x1de')]||0x0;_0x5d04f5[_0xa1b1('0x1d6')]=_0x4728e2>0x0?_0x4728e2:0x1;return _0x5b1315['busyFactor'](_0x3d8aff,_0x19e5bd,_0x31ba17,_0x4728e2,_0x450870);})[_0xa1b1('0x3e')](function(_0x56c055){return _0xb6ef55(_0x56c055);})[_0xa1b1('0x9d')](function(_0x1ac255){return _0xccdfca(msgResponse('[CatchErlangB]',_0xa1b1('0x8f'),JSON[_0xa1b1('0x71')](_0x1ac255)));});}}else{return _0xccdfca(msgResponse(_0xa1b1('0x1db'),'Failure',_0xa1b1('0x1e4')));}});};};Dialer[_0xa1b1('0x82')][_0xa1b1('0x1ce')]=function(_0xa227bb){var _0x19dfc7=this;return function(){var _0x423fb9=0x0;var _0x477e37=Math[_0xa1b1('0x1c0')](_0xa227bb['erlangCallToSecond']*0x3e8);if(_0x477e37>0x0){_0x477e37=_0x477e37<0x64?0x64:_0x477e37;loggerPredictive[_0xa1b1('0x49')](_0xa227bb['name'],'one\x20call\x20every:',_0x477e37,_0xa1b1('0x1e5'));_0xa227bb[_0xa1b1('0x60')]=setInterval(function(){_0x19dfc7['handlePredictive'](_0xa227bb);loggerPredictiveCalls[_0xa1b1('0x49')](_0xa1b1('0x1e6'),_0x423fb9+=0x1);},_0x477e37);}else{loggerPredictive[_0xa1b1('0x49')](_0xa227bb[_0xa1b1('0x47')],_0xa1b1('0x1e7'));}};};Dialer[_0xa1b1('0x82')][_0xa1b1('0x1e8')]=function(_0x58e76b,_0xd7b31a){var _0x5cbbd7=this;return function(_0x46c338){if(_[_0xa1b1('0x48')](_0x46c338)){if(_[_0xa1b1('0xf1')](_0xd7b31a[_0xa1b1('0x155')])||!_0xd7b31a[_0xa1b1('0x1e9')]){if(_0x58e76b[_0xa1b1('0xae')]==='booked'){_0x58e76b[_0xa1b1('0x6f')]=_[_0xa1b1('0x50')](_0x58e76b[_0xa1b1('0x6f')])?!![]:_0x58e76b['queueStatusComplete'];var _0x4afeec=uuid['v4']();_0x5cbbd7[_0xa1b1('0xed')][_0x4afeec]=new Action(_0x58e76b,_0xd7b31a,_0x4afeec);loggerBooked[_0xa1b1('0x49')](_0xa1b1('0x1ea'),_0x4afeec,_0xa1b1('0x1eb'),JSON['stringify'](_0x58e76b['queueStatusComplete']),_0xa1b1('0x1ec'),_0x58e76b[_0xa1b1('0x47')]);if(_0x58e76b[_0xa1b1('0x6f')]){_0x58e76b['queueStatusComplete']=![];_0x5cbbd7['queueBooked'][_0x5cbbd7[_0xa1b1('0xed')][_0x4afeec][_0xa1b1('0xbc')]]=[];ami['Action']({'actionid':_0x4afeec,'action':_0xa1b1('0x1ed'),'queue':_0x58e76b['name']})[_0xa1b1('0x9d')](function(){_0x5cbbd7[_0xa1b1('0xc9')](_0x58e76b);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x5cbbd7[_0xa1b1('0xed')][_0x4afeec][_0xa1b1('0xdb')],'ListId':_0x5cbbd7[_0xa1b1('0xed')][_0x4afeec][_0xa1b1('0xdc')],'VoiceQueueId':_0x5cbbd7['actions'][_0x4afeec][_0xa1b1('0xdd')]||undefined,'CampaignId':_0x5cbbd7[_0xa1b1('0xed')][_0x4afeec][_0xa1b1('0xf9')]||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x5cbbd7[_0xa1b1('0xed')][_0x4afeec];});}else{loggerBooked[_0xa1b1('0x49')](_0xa1b1('0x1ee'),JSON[_0xa1b1('0x71')](_0x58e76b['queueStatusComplete']),_0xa1b1('0x1ec'),_0x58e76b[_0xa1b1('0x47')]);_0x5cbbd7[_0xa1b1('0xc9')](_0x58e76b);hopperUtils[_0xa1b1('0xd9')]({'active':![],'ContactId':_0x5cbbd7['actions'][_0x4afeec]['ContactId'],'ListId':_0x5cbbd7['actions'][_0x4afeec][_0xa1b1('0xdc')],'VoiceQueueId':_0x5cbbd7[_0xa1b1('0xed')][_0x4afeec][_0xa1b1('0xdd')]||undefined,'CampaignId':_0x5cbbd7[_0xa1b1('0xed')][_0x4afeec]['CampaignId']||undefined})[_0xa1b1('0x9d')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x5cbbd7['actions'][_0x4afeec];}}else{return _0x5cbbd7[_0xa1b1('0x15b')](_0x58e76b,_0xd7b31a);}}else{if(utils[_0xa1b1('0x5d')](undefined,_0xd7b31a['scheduledat'])<_0x58e76b[_0xa1b1('0x1ef')]*0x3c){if(_0xd7b31a[_0xa1b1('0x147')]&&!_0xd7b31a[_0xa1b1('0x147')][_0xa1b1('0x1f0')]){_0x5cbbd7[_0xa1b1('0xff')]['run'](_0xd7b31a['id'])['finally'](function(){_0x5cbbd7['updateOriginated'](_0x58e76b);});}else{hopperUtils[_0xa1b1('0x1f1')]({'active':![]},_0xd7b31a['id'],0x1)['finally'](function(){_0x5cbbd7[_0xa1b1('0xc9')](_0x58e76b);});}}else{_0x58e76b[_0xa1b1('0x1f2')]+=0x1;_0x5cbbd7[_0xa1b1('0xc9')](_0x58e76b);if(_0x58e76b[_0xa1b1('0x1f3')]){hopperUtils[_0xa1b1('0xd9')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0xd7b31a[_0xa1b1('0xdb')],'ListId':_0xd7b31a[_0xa1b1('0xdc')],'VoiceQueueId':_0xd7b31a[_0xa1b1('0xdd')]||undefined,'CampaignId':_0xd7b31a[_0xa1b1('0xf9')]||undefined})[_0xa1b1('0x9d')](loggerCatch(_0xa1b1('0x1f4')));hopperUtils['createHistory'](createObjHistory(_0x58e76b,_0xd7b31a,utils[_0xa1b1('0x66')][_0xa1b1('0x1f5')],0x17,_0xa1b1('0x1f6')))[_0xa1b1('0x9d')](loggerCatch(_0xa1b1('0x1f7')));}else{_0x5cbbd7[_0xa1b1('0x154')](createObjHistory(_0x58e76b,_0xd7b31a,utils[_0xa1b1('0x66')][_0xa1b1('0x1f8')],0x16,_0xa1b1('0x1f9')),_0xa1b1('0x1fa'),_0xa1b1('0x1fb'));}}}}else{_0x58e76b[_0xa1b1('0x1fc')]+=0x1;_0x5cbbd7['saveInDb'](createObjHistory(_0x58e76b,_0xd7b31a,utils['CAMPAIGN_STATUS'][_0xa1b1('0x1fd')],0xd,_0xa1b1('0x1fe')),_0xa1b1('0x1ff'),_0xa1b1('0x200'));throw'inBlackList';}};};Dialer['prototype'][_0xa1b1('0x15a')]=function(_0x516710){var _0x370929=this;var _0x464652=_0x516710[_0xa1b1('0x201')]-_0x516710[_0xa1b1('0x7b')];emitCampaignSummary(_0x516710);if(_0x464652>0x0&&_0x516710[_0xa1b1('0x202')]==0x0){if(_0x464652>this['maxNumberOriginate']){_0x464652=this[_0xa1b1('0x24')];}_0x516710[_0xa1b1('0x202')]=0x1;hopperUtils[_0xa1b1('0x203')](_0x516710,_0x464652)[_0xa1b1('0x3e')](function(_0x5a232d){_0x516710['temp']=0x0;if(_0x5a232d){if(!utils[_0xa1b1('0x204')](_0x5a232d)){_0x516710[_0xa1b1('0x65')]=utils[_0xa1b1('0x66')][_0xa1b1('0x6a')];logger[_0xa1b1('0x49')]('[getContactCampaign2][Empty]'+_0x516710[_0xa1b1('0x47')]);}else{_0x516710[_0xa1b1('0x7b')]+=_0x5a232d[_0xa1b1('0x96')];_0x516710[_0xa1b1('0x65')]=utils[_0xa1b1('0x66')]['RUNNING'];for(var _0x39808b=0x0;_0x39808b<_0x5a232d[_0xa1b1('0x96')];_0x39808b+=0x1){_0x516710[_0xa1b1('0x205')]+=0x1;if(_['isNil'](_0x5a232d[_0x39808b])||_['isNil'](_0x5a232d[_0x39808b]['Contact'])||_[_0xa1b1('0xf1')](_0x5a232d[_0x39808b][_0xa1b1('0x15e')])){_0x370929[_0xa1b1('0x206')](_0xa1b1('0x207'),_0x516710,_0x5a232d[_0x39808b]);}else{hopperUtils[_0xa1b1('0x208')](_[_0xa1b1('0xf4')](_0x5a232d[_0x39808b],[_0xa1b1('0xf9'),_0xa1b1('0x15e')]))['then'](_0x370929['checkContactBlack'](_0x516710,_0x5a232d[_0x39808b]))[_0xa1b1('0x9d')](_0x370929[_0xa1b1('0x152')]('[actionOriginateIvr]\x20',_0x516710));}}}}})['catch'](loggerGetContactDialer(_0xa1b1('0x209'),_0x516710,_0x464652));}};Dialer[_0xa1b1('0x82')][_0xa1b1('0xb1')]=function(_0x239409,_0x1ccd58){var _0x1d61b6=this;var _0x359d70=[];if(_0x1ccd58<0x1||_0x239409[_0xa1b1('0xae')]===_0xa1b1('0x8')){_0x1ccd58=0x1;}var _0x584df3=Math[_0xa1b1('0x1c0')](_0x239409[_0xa1b1('0x137')]*_0x1ccd58)-_0x239409['originated'];if(_0x239409[_0xa1b1('0x20a')]>0x0){var _0x57fa9b=_0x239409[_0xa1b1('0x20a')]-_0x239409['originated']-_0x239409[_0xa1b1('0x138')]-_0x239409[_0xa1b1('0x139')];if(_0x584df3>_0x57fa9b){_0x584df3=_0x57fa9b;}}if(_0x584df3>0x0&&_0x239409[_0xa1b1('0x202')]==0x0){if(_0x239409[_0xa1b1('0xae')]===_0xa1b1('0x8')){_0x584df3=0x1;}if(_0x584df3>this[_0xa1b1('0x24')]){_0x584df3=this['maxNumberOriginate'];}for(var _0x12559c in this['agents']){if(typeof this[_0xa1b1('0x22')][_0x12559c]!=='undefined'){if(this[_0xa1b1('0x22')][_0x12559c][_0xa1b1('0x6c')]===_0xa1b1('0x20b')&&this[_0xa1b1('0x22')][_0x12559c][_0xa1b1('0x86')]===_0xa1b1('0x87')){_0x359d70[_0xa1b1('0x97')](this['agents'][_0x12559c]['id']);}}}_0x239409[_0xa1b1('0x202')]=0x1;hopperUtils[_0xa1b1('0x20c')](_0x239409,_0x359d70,_0x584df3)[_0xa1b1('0x3e')](function(_0x1ceadc){_0x239409['temp']=0x0;if(_0x1ceadc){if(!utils[_0xa1b1('0x204')](_0x1ceadc)){hopperUtils['countReScheduled'](_0x239409)['then'](sendMessageReschedule(_0x239409))[_0xa1b1('0x9d')](loggerCatch('[countReScheduled]\x20'));}else{_0x239409[_0xa1b1('0x7b')]+=_0x1ceadc[_0xa1b1('0x96')];_0x239409[_0xa1b1('0x65')]=_0x239409[_0xa1b1('0xae')]===_0xa1b1('0x8')?utils['CAMPAIGN_STATUS'][_0xa1b1('0x13a')]:utils[_0xa1b1('0x66')][_0xa1b1('0x20d')];for(var _0x1fe039=0x0;_0x1fe039<_0x1ceadc['length'];_0x1fe039+=0x1){if(_[_0xa1b1('0xf1')](_0x1ceadc[_0x1fe039])||_[_0xa1b1('0xf1')](_0x1ceadc[_0x1fe039][_0xa1b1('0x20e')])||_[_0xa1b1('0xf1')](_0x1ceadc[_0x1fe039][_0xa1b1('0x15e')])){_0x1d61b6[_0xa1b1('0x206')](_0xa1b1('0x207'),_0x239409,_0x1ceadc[_0x1fe039]);}else{hopperUtils[_0xa1b1('0x20f')](_[_0xa1b1('0xf4')](_0x1ceadc[_0x1fe039],['VoiceQueueId',_0xa1b1('0x15e')]))[_0xa1b1('0x3e')](_0x1d61b6[_0xa1b1('0x1e8')](_0x239409,_0x1ceadc[_0x1fe039]))[_0xa1b1('0x9d')](_0x1d61b6['loggerHandler'](_0xa1b1('0x207'),_0x239409));}}}}})[_0xa1b1('0x9d')](loggerGetContactDialer(_0xa1b1('0x210'),_0x239409,_0x584df3));}};Dialer['prototype'][_0xa1b1('0x60')]=function(_0x3ba557){if(_0x3ba557[_0xa1b1('0x20a')]>0x0){var _0x1c01f5=_0x3ba557['dialLimitQueue']-_0x3ba557[_0xa1b1('0x7b')]-_0x3ba557[_0xa1b1('0x138')];if(_0x1c01f5>0x0&&_0x3ba557[_0xa1b1('0x202')]==0x0){this[_0xa1b1('0x211')](_0x3ba557);}else{loggerPredictiveCalls[_0xa1b1('0x49')](_0xa1b1('0x212'));}}else{this[_0xa1b1('0x211')](_0x3ba557);}};Dialer['prototype'][_0xa1b1('0x211')]=function(_0x32e115){var _0x128734=this;var _0x575bf9=[];_0x32e115['originated']+=0x1;for(var _0x4d7d5a in this[_0xa1b1('0x22')]){if(typeof this[_0xa1b1('0x22')][_0x4d7d5a]!==_0xa1b1('0xa6')){if(this['agents'][_0x4d7d5a][_0xa1b1('0x6c')]===_0xa1b1('0x20b')&&this[_0xa1b1('0x22')][_0x4d7d5a]['status']===_0xa1b1('0x87')){_0x575bf9[_0xa1b1('0x97')](this[_0xa1b1('0x22')][_0x4d7d5a]['id']);}}}_0x32e115[_0xa1b1('0x202')]=0x1;return this[_0xa1b1('0x20c')](_0x32e115['id'],_0x575bf9,0x1,_0x32e115['dialOrderByScheduledAt'],_0x32e115)['then'](function(_0x35572){_0x32e115[_0xa1b1('0x202')]=0x1;if(_0x35572){if(!utils[_0xa1b1('0x204')](_0x35572)){utils[_0xa1b1('0x213')](_0x32e115,0x1,0x0);return hopperUtils[_0xa1b1('0x214')](_0x32e115)['then'](sendMessageReschedule(_0x32e115))[_0xa1b1('0x9d')](loggerCatch(_0xa1b1('0x215')));}else{_0x32e115[_0xa1b1('0x65')]=utils[_0xa1b1('0x66')][_0xa1b1('0x20d')];if(_[_0xa1b1('0xf1')](_0x35572[0x0])||_[_0xa1b1('0xf1')](_0x35572[0x0][_0xa1b1('0x20e')])||_[_0xa1b1('0xf1')](_0x35572[0x0][_0xa1b1('0x15e')])){_0x128734['emptyContact'](_0xa1b1('0x207'),_0x32e115,_0x35572[0x0]);}else{return hopperUtils[_0xa1b1('0x20f')](_[_0xa1b1('0xf4')](_0x35572[0x0],[_0xa1b1('0xdd'),_0xa1b1('0x15e')]))[_0xa1b1('0x3e')](_0x128734[_0xa1b1('0x1e8')](_0x32e115,_0x35572[0x0]))[_0xa1b1('0x9d')](_0x128734[_0xa1b1('0x152')]('[actionOriginatePredictive]\x20',_0x32e115));}}}})['catch'](loggerGetContactDialer(_0xa1b1('0x216'),_0x32e115,0x1));};Dialer['prototype'][_0xa1b1('0x1d8')]=function(_0x58bbb0,_0x492614,_0x3cab98,_0x1795c9,_0x42429f,_0x148ba1){loggerPredictive[_0xa1b1('0x49')](_0xa1b1('0x217'));loggerPredictive[_0xa1b1('0x49')](_0xa1b1('0x218'),_0x58bbb0);loggerPredictive[_0xa1b1('0x49')](_0xa1b1('0x219'),_0x492614);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',_0x3cab98);loggerPredictive[_0xa1b1('0x49')]('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',_0x1795c9);loggerPredictive[_0xa1b1('0x49')](_0xa1b1('0x21a'),_0x42429f);loggerPredictive['info']('---------------------------');return new Promise(function(_0x2019d8,_0x571bf9){if(_0x58bbb0<=0x0||isNaN(_0x58bbb0)){return _0x571bf9(msgResponse('[abandonmentRate]',_0xa1b1('0x81'),'m\x20=\x20'+_0x58bbb0));}if(_0x3cab98<=0x0||isNaN(_0x3cab98)){return _0x571bf9(msgResponse(_0xa1b1('0x21b'),_0xa1b1('0x81'),_0xa1b1('0x21c')+_0x3cab98));}if(_0x1795c9<=0x0||isNaN(_0x1795c9)){return _0x571bf9(msgResponse('[abandonmentRate]',_0xa1b1('0x81'),'p\x20=\x20'+_0x1795c9));}if(_0x492614<=0x0||isNaN(_0x492614)){return _0x571bf9(msgResponse(_0xa1b1('0x21b'),_0xa1b1('0x81'),_0xa1b1('0x21d')+_0x492614));}if(_0x42429f<=0x0||isNaN(_0x42429f)){return _0x571bf9(msgResponse(_0xa1b1('0x21b'),_0xa1b1('0x81'),_0xa1b1('0x21e')+_0x42429f));}_0x148ba1=_0x148ba1||0x0;var _0x31c504=0x1/_0x3cab98;var _0x53e823=0x0;var _0x4e22e4=0x0;var _0x48af26=0x0;var _0x78bbb1=0x0;for(var _0x2629b3=0x0;_0x48af26<_0x42429f;_0x2629b3+=0x1){_0x4e22e4=_0x2629b3/_0x492614;_0x53e823=(_0x1795c9*_0x4e22e4+_0x148ba1)/_0x31c504;_0x48af26=utils[_0xa1b1('0x21f')](_0x53e823,_0x58bbb0);_0x78bbb1=_0x53e823/_0x58bbb0*(0x1-utils[_0xa1b1('0x21f')](_0x53e823,_0x58bbb0));}return _0x2019d8({'erlangCalls':_0x2629b3,'erlangCallToSecond':_0x492614/_0x2629b3,'erlangAbandonmentRate':_0x48af26,'erlangBusyFactor':_0x78bbb1});});};Dialer[_0xa1b1('0x82')]['busyFactor']=function(_0x4d6b38,_0x4088b4,_0x11057b,_0x188041,_0x24cc90,_0x2d5cc3){loggerPredictive[_0xa1b1('0x49')](_0xa1b1('0x220'));loggerPredictive[_0xa1b1('0x49')](_0xa1b1('0x218'),_0x4d6b38);loggerPredictive[_0xa1b1('0x49')](_0xa1b1('0x219'),_0x4088b4);loggerPredictive[_0xa1b1('0x49')]('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x11057b);loggerPredictive[_0xa1b1('0x49')]('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',_0x188041);loggerPredictive[_0xa1b1('0x49')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x24cc90);loggerPredictive[_0xa1b1('0x49')](_0xa1b1('0x5b'));return new Promise(function(_0x43420e,_0x36b99a){if(_0x4d6b38<=0x0||isNaN(_0x4d6b38)){return _0x36b99a(msgResponse(_0xa1b1('0x221'),_0xa1b1('0x81'),'m\x20=\x20'+_0x4d6b38));}if(_0x11057b<=0x0||isNaN(_0x11057b)){return _0x36b99a(msgResponse(_0xa1b1('0x221'),_0xa1b1('0x81'),_0xa1b1('0x21c')+_0x11057b));}if(_0x188041<=0x0||isNaN(_0x188041)){return _0x36b99a(msgResponse(_0xa1b1('0x221'),_0xa1b1('0x81'),_0xa1b1('0x222')+_0x188041));}if(_0x4088b4<=0x0||isNaN(_0x4088b4)){return _0x36b99a(msgResponse(_0xa1b1('0x221'),_0xa1b1('0x81'),_0xa1b1('0x21d')+_0x4088b4));}if(_0x24cc90<=0x0||isNaN(_0x24cc90)){return _0x36b99a(msgResponse('[busyFactor]',_0xa1b1('0x81'),_0xa1b1('0x223')+_0x24cc90));}_0x2d5cc3=_0x2d5cc3||0x0;var _0xcf646c=0x1/_0x11057b;var _0x3b9493=0x0;var _0xb9bb5e=0x0;var _0x2f3070=0x0;var _0x376121=0x0;for(var _0x324879=0x0;_0x376121<_0x24cc90;_0x324879+=0x1){_0xb9bb5e=_0x324879/_0x4088b4;_0x3b9493=(_0x188041*_0xb9bb5e+_0x2d5cc3)/_0xcf646c;_0x2f3070=utils[_0xa1b1('0x21f')](_0x3b9493,_0x4d6b38);_0x376121=_0x3b9493/_0x4d6b38*(0x1-utils[_0xa1b1('0x21f')](_0x3b9493,_0x4d6b38));}return _0x43420e({'erlangCalls':_0x324879,'erlangCallToSecond':_0x4088b4/_0x324879,'erlangAbandonmentRate':_0x2f3070,'erlangBusyFactor':_0x376121});});};module[_0xa1b1('0x224')]=Dialer; \ No newline at end of file +var _0xf792=['AGI','cause-txt','Normal\x20Clearing','Unknow','queuesSummary','running','statusMessage','getQueueCampaignStatusMessage','available','inUse','talking','pTalking','ACTIVE','[syncQueueSummary]','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','syncQueueSummaryComplete','throttle','filter','online','length','handlePreviewRecallNotifications','map','Agent','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','[actions]','undefined','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','[emptyContact][createHistory]','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','NONE','\x22agi://%s/square,%s\x22','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialQueueTimeout','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','Contact','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','getCallerId','callerid','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','dialPrefix','trim','dialCutDigit','SIP/%s/%s%s','substring','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','[originate][error]','originate\x20action\x20Error','checkRetriveMax','dialGlobalMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','object','[callProgressDetecting]','evt\x20is\x20undefine','reason','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','buildNoAnswerEventPayload','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','outboundUnknownCallsDay','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','outboundDropCallsDayTimeout','round','predictiveIntervalAvailable','predictiveIntervalMinThreshold','floor','erlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','dialPredictiveOptimization','dropRate','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','getDataPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','abandonmentRate','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','loggedIn','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','agentBusyFactor','busyFactor','check\x20failure','one\x20call\x20every:','milliseconds','[handlePredictive]','checkContactBlack','UserId','recallme','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','dialRecallMeTimeout','voicePause','run','unlockContact','outboundReCallsDay','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','inBlackList','handleIvr','temp','maxNumberOriginate','getContactDialerIvr','checkContactEmpty','[getContactCampaign2][Empty]','ivrTotalCallsDays','[actionOriginate]\x20','checkIsBlackListIvr','[getContactCampaign2]','dialLimitQueue','getContactDialer','countReScheduled','RUNNING','checkIsBlackList','[handlePredictive][limitChannel]','tryOriginatePredictive','not_inuse','dialOrderByScheduledAt','[countReScheduled]\x20','[actionOriginatePredictive]\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','Amax\x20=\x20','erlangb','----\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','interval\x20=\x20','Umin\x20=\x20','exports','util','lodash','moment','ioredis','./utils','./utils/hopper','../../../config/environment/','dialer','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/voiceQueueRt','../rpc/setting','../rpc/interval','./models/action','./models/history','./models/final','./models/queueCallerAbandon','./models/hangup','env','127.0.0.1','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','actions','contactsId','optionPredictive','startPredictive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','syncHangup','syncNewExten','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','then','previewRecallmeReminderInterval','isUndefined','emit','type','outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','voice:queue:%s','voice_queue:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','merge','startProgressive','name','startProgressive\x20value\x20cleared','startPredictive\x20value\x20cleared','handlePredictive','error','checkContactLowerLimitOriginate','contactsRescheduled','message','CAMPAIGN_STATUS','contacts','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','isIVRCampaignActive','INACTIVE','isIVRCampaign','campaign:ivr:%s','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','DISACTIVED','[ifTime][Action]','Error','isTrunkReachable','active','format','SIP/%s','reachable','status','unmonitored','Trunk','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','ifTime','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','push','Action','command','iftime\x20%s,%s','interval','timezones','content','catch','indexOf','true','all','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','syncCampaigns','sendMessageOneNotActive','resolve','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','launchHandleIvr','[syncCampaigns]','dialMethod','progressive','handlePower','power','Queue','method\x20not\x20recognized','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','AMI\x20IfTime','queue','uniqueId','uniqueid','ivr','YYYY-MM-DD\x20HH:mm:ss','outboundAnswerCallsDay','agent','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','updateOriginated','droptime','getSeconds','responsetime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','dropreason','TIMEOUT','agiafterat','countdropretry','countglobal','dialDropRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','voiceQueue','additional','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','minutes','ContactId','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','Drop','calleridname','calleridnum','createHistory','[syncAgentComplete][createHistory][10]','statedesc','Abandoned','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','add','[syncAgentComplete][createHistory][11]','swapAdditionalPhones','channel','actionid','strategy','locked','stateinterface','isNil','idHopper','paused','rrmemory','roundrobin','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','getQueue','response','Success','callProgressDetecting','[callProgressDetecting]\x20','syncVarSet','amdstatus','exten','xcally-motion-dialer','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','buildObj','saveInDb','[syncHangupInAMD][createHistory]','dialAMDActive','MACHINE','countmachineretry','amd','custom:amd','[syncAgentComplete][createHistory][0]','countbusyretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','stateGlobal','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','[rescheduleContact][Machine]','[syncHangupInAMDIvr]','countcongestionretry','dialMachineMaxRetry','dialMachineRetryFrequency','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI'];(function(_0x59bcb1,_0x5a4b6c){var _0x4a737f=function(_0x546a49){while(--_0x546a49){_0x59bcb1['push'](_0x59bcb1['shift']());}};_0x4a737f(++_0x5a4b6c);}(_0xf792,0xf6));var _0x2f79=function(_0x20ee30,_0x191bd6){_0x20ee30=_0x20ee30-0x0;var _0x3d7f60=_0xf792[_0x20ee30];return _0x3d7f60;};'use strict';var util=require(_0x2f79('0x0'));var _=require(_0x2f79('0x1'));var uuid=require('uuid');var moment=require(_0x2f79('0x2'));var rr=require('rr');var Redis=require(_0x2f79('0x3'));var utils=require(_0x2f79('0x4'));var hopperUtils=require(_0x2f79('0x5'));var ut=require('../preview/util/util');var config=require(_0x2f79('0x6'));var logger=require('../../../config/logger')(_0x2f79('0x7'));var loggerBooked=require(_0x2f79('0x8'))(_0x2f79('0x9'));var loggerPredictive=require('../../../config/logger')(_0x2f79('0xa'));var loggerPredictiveCalls=require('../../../config/logger')(_0x2f79('0xb'));var loggerSyncQueueSummary=require(_0x2f79('0x8'))(_0x2f79('0xc'));var ami=require(_0x2f79('0xd'));config[_0x2f79('0xe')]=_[_0x2f79('0xf')](config[_0x2f79('0xe')],{'host':_0x2f79('0x10'),'port':0x18eb});var io=require(_0x2f79('0x11'))(new Redis(config[_0x2f79('0xe')]));var cmHopper=require('../rpc/cmHopper');var voiceQueueRt=require(_0x2f79('0x12'));var RpcSetting=require(_0x2f79('0x13'));var Interval=require(_0x2f79('0x14'));var Action=require(_0x2f79('0x15'));var History=require(_0x2f79('0x16'));var Final=require(_0x2f79('0x17'));var AgentComplete=require('./models/agentComplete');var QueueCallerAbandon=require(_0x2f79('0x18'));var Hangup=require(_0x2f79('0x19'));var ipAgi=process[_0x2f79('0x1a')]['XCALLY_IP_AGI']||_0x2f79('0x1b');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x2f79('0x1c')][_0x2f79('0x1d')]=function(_0x242836){this['tail']=this[_0x2f79('0x1e')]?this[_0x2f79('0x1e')][_0x2f79('0x1f')](_0x242836):_0x242836();};function Dialer(_0x674610,_0x4508df){this[_0x2f79('0x20')]=new Sequence();this[_0x2f79('0x21')]=_0x4508df;this['voiceQueues']=_0x674610[_0x2f79('0x22')];this['campaigns']=_0x674610[_0x2f79('0x23')];this[_0x2f79('0x24')]=_0x674610[_0x2f79('0x24')];this['trunks']=_0x674610[_0x2f79('0x25')];this['maxNumberOriginate']=config['maxNumberOriginate']||0x2;this['channels']={};this[_0x2f79('0x26')]={};this[_0x2f79('0x27')]={};this['uniqueId']={};this[_0x2f79('0x28')]={};this[_0x2f79('0x29')]={};this['startProgressive']={};this[_0x2f79('0x2a')]={};this[_0x2f79('0x2b')]={};this[_0x2f79('0x2c')]={};this['queuesSummary']={};ami['on'](_0x2f79('0x2d'),this[_0x2f79('0x2e')][_0x2f79('0x2f')](this));ami['on'](_0x2f79('0x30'),this[_0x2f79('0x31')][_0x2f79('0x2f')](this));ami['on'](_0x2f79('0x32'),this[_0x2f79('0x33')]['bind'](this));ami['on'](_0x2f79('0x34'),this[_0x2f79('0x35')][_0x2f79('0x2f')](this));ami['on'](_0x2f79('0x36'),this[_0x2f79('0xc')]['bind'](this));ami['on'](_0x2f79('0x37'),this['syncQueueSummaryComplete'][_0x2f79('0x2f')](this));ami['on']('hangup',this[_0x2f79('0x38')][_0x2f79('0x2f')](this));ami['on']('newexten',this[_0x2f79('0x39')][_0x2f79('0x2f')](this));ami['on']('varset',this['syncVarSet'][_0x2f79('0x2f')](this));ami['on'](_0x2f79('0x3a'),this[_0x2f79('0x3b')][_0x2f79('0x2f')](this));ami['on'](_0x2f79('0x3c'),this[_0x2f79('0x3d')]['bind'](this));this[_0x2f79('0x3e')]();this[_0x2f79('0x3f')]();RpcSetting['getSettings']()[_0x2f79('0x40')](function(_0x519f99){previewRecallmeReminderInterval=_0x519f99[_0x2f79('0x41')];});}function isNotNull(_0x40620d){return _0x40620d!==null&&!_[_0x2f79('0x42')](_0x40620d);}function msgResponse(_0x12abc7,_0x5d656,_0x58ea31){return{'action':_0x12abc7,'response':_0x5d656,'message':_0x58ea31,'stack':_0x58ea31};}function emit(_0x657f30,_0x426690,_0x24a343){io['to'](_0x657f30)[_0x2f79('0x43')](_0x426690,_0x24a343);}function emitOutboundVoiceQueueSummary(_0x3c23ca){if(_0x3c23ca[_0x2f79('0x44')]===_0x2f79('0x45')){logger[_0x2f79('0x46')](_0x2f79('0x47'),util[_0x2f79('0x48')](_0x3c23ca,{'showHidden':![],'depth':null}));emit(util['format'](_0x2f79('0x49'),_0x3c23ca['name']),_0x2f79('0x4a'),_0x3c23ca);}}function checkGetDataPredictive(_0xbfd44b){if(isNotNull(_0xbfd44b)&&!_[_0x2f79('0x4b')](_0xbfd44b)){loggerPredictive[_0x2f79('0x4c')](_0x2f79('0x4d'));loggerPredictive[_0x2f79('0x4c')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xbfd44b[_0x2f79('0x4e')]);loggerPredictive['info']('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xbfd44b[_0x2f79('0x4f')]);loggerPredictive[_0x2f79('0x4c')](_0x2f79('0x50'),_0xbfd44b['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0x2f79('0x4c')](_0x2f79('0x51'),_0xbfd44b[_0x2f79('0x52')]);loggerPredictive['info'](_0x2f79('0x53'),_0xbfd44b[_0x2f79('0x54')]);loggerPredictive[_0x2f79('0x4c')](_0x2f79('0x55'),_0xbfd44b[_0x2f79('0x56')]);loggerPredictive[_0x2f79('0x4c')](_0x2f79('0x57'));if(_0xbfd44b[_0x2f79('0x4e')]>0x0){if(!_[_0x2f79('0x42')](_0xbfd44b[_0x2f79('0x56')])&&_0xbfd44b['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0x2f79('0x4c')](_0x2f79('0x58'));if(!_[_0x2f79('0x42')](_0xbfd44b[_0x2f79('0x54')])&&_0xbfd44b[_0x2f79('0x54')]>0x0){return!![];}loggerPredictive['info'](_0x2f79('0x59'));}else{loggerPredictive[_0x2f79('0x4c')](_0x2f79('0x5a'));}}else{loggerPredictive['info'](_0x2f79('0x5b'));}return![];}function mergeDataErlangB(_0x2ea14e){return function(_0x1e4958){loggerPredictive[_0x2f79('0x4c')]('---------\x20ErlangB\x20---------');loggerPredictive['info'](_0x2f79('0x5c'),_0x1e4958['erlangCalls']);loggerPredictive[_0x2f79('0x4c')](_0x2f79('0x5d'),_0x1e4958[_0x2f79('0x5e')]);loggerPredictive[_0x2f79('0x4c')](_0x2f79('0x5f'),_0x1e4958[_0x2f79('0x60')]);loggerPredictive[_0x2f79('0x4c')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1e4958['erlangBusyFactor']);loggerPredictive[_0x2f79('0x4c')](_0x2f79('0x5f'),_0x1e4958[_0x2f79('0x60')]);loggerPredictive[_0x2f79('0x4c')](_0x2f79('0x57'));_[_0x2f79('0x61')](_0x2ea14e,_0x1e4958);};}function ifInterval(_0x22bf3b,_0x5df179){if(_[_0x2f79('0x42')](_0x5df179)){return![];}return utils['getSeconds'](undefined,_0x5df179)<_0x22bf3b*0x3c;}function clearPredictiveAttributes(_0x25992f){if(_0x25992f[_0x2f79('0x62')]){_0x25992f[_0x2f79('0x62')]=undefined;loggerPredictive['debug'](_0x25992f[_0x2f79('0x63')],_0x2f79('0x64'));}if(_0x25992f[_0x2f79('0x29')]){_0x25992f['startPredictive']=undefined;loggerPredictive[_0x2f79('0x46')](_0x25992f[_0x2f79('0x63')],_0x2f79('0x65'));}if(_0x25992f[_0x2f79('0x66')]){clearInterval(_0x25992f[_0x2f79('0x66')]);_0x25992f['handlePredictive']=undefined;loggerPredictive[_0x2f79('0x46')](_0x25992f['name'],'handlePredictive\x20interval\x20cleared');}}function loggerCatchPredictive(_0x3628f0,_0x4c1486){return function(_0x245532){loggerPredictive['error'](_0x4c1486[_0x2f79('0x63')],_0x3628f0);loggerPredictive[_0x2f79('0x67')](_0x245532['stack']);clearPredictiveAttributes(_0x4c1486);};}function loggerCatch(_0x4083c6){return function(_0x5ab93a){logger['error'](_0x4083c6,util[_0x2f79('0x48')](_0x5ab93a,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0xd458be,_0x184255,_0x163e71){return function(_0x4de05c){utils[_0x2f79('0x68')](_0x184255,_0x163e71,0x0);_0x184255['temp']=0x0;logger[_0x2f79('0x67')](_0xd458be,util['inspect'](_0x4de05c,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x25419c){return function(_0x3a5891){if(isNotNull(_0x3a5891)&&isNotNull(_0x3a5891[0x0])){if(_0x3a5891[0x0][_0x2f79('0x69')]>0x0){_0x25419c[_0x2f79('0x6a')]=utils[_0x2f79('0x6b')]['CONTACTS_RESCHEDULED'];logger[_0x2f79('0x4c')]('[getContactDialer2][ReScheduled]'+_0x25419c['name'],_0x3a5891[0x0][_0x2f79('0x69')],_0x2f79('0x6c'));}else{_0x25419c['message']=utils[_0x2f79('0x6b')][_0x2f79('0x6d')];logger[_0x2f79('0x4c')](_0x2f79('0x6e')+_0x25419c['name']);}}};}function createObjHistory(_0x5ba048,_0x47b71c,_0x647eda,_0x41d794,_0x34de80){_0x5ba048['message']=_0x647eda;var _0x3df31b=new Action(_0x5ba048,_0x47b71c);var _0x244fc4=new History(_0x3df31b);_0x244fc4[_0x2f79('0x6f')]=_0x41d794;_0x244fc4['statedesc']=_0x34de80;_0x244fc4[_0x2f79('0x70')]=_0x3df31b[_0x2f79('0x71')];return _0x244fc4;}function unlockQueueStatus(_0x56e3ee,_0x52bd09){setTimeout(function(){if(_[_0x2f79('0x42')](_0x56e3ee[_0x2f79('0x72')])){loggerBooked[_0x2f79('0x67')](_0x2f79('0x73'),_0x52bd09);}_0x56e3ee[_0x2f79('0x72')]=!![];loggerBooked[_0x2f79('0x4c')](_0x2f79('0x74'),_0x52bd09,JSON[_0x2f79('0x75')](_[_0x2f79('0x76')](_0x56e3ee,[_0x2f79('0x63'),'queueStatusComplete'])));},0x1f3);}function checkInterval(_0x1b0ba5){return function(){if(!isNotNull(_0x1b0ba5[_0x2f79('0x77')])){_0x1b0ba5[_0x2f79('0x6a')]=utils[_0x2f79('0x6b')][_0x2f79('0x78')];throw _0x1b0ba5[_0x2f79('0x63')]+_0x2f79('0x79');}if(!isNotNull(_0x1b0ba5[_0x2f79('0x77')]['Intervals'])){_0x1b0ba5['message']=utils[_0x2f79('0x6b')]['NULL_INTERVAL'];throw _0x1b0ba5['name']+_0x2f79('0x79');}if(!isNotNull(_[_0x2f79('0x4b')](_0x1b0ba5[_0x2f79('0x77')][_0x2f79('0x7a')]))){_0x1b0ba5[_0x2f79('0x6a')]=utils['CAMPAIGN_STATUS'][_0x2f79('0x78')];throw _0x1b0ba5['name']+_0x2f79('0x79');}};}function checkIsIVRCampaignActive(_0x53231d){return function(){if(!utils[_0x2f79('0x7b')](_0x53231d)){_0x53231d[_0x2f79('0x6a')]=utils['CAMPAIGN_STATUS'][_0x2f79('0x7c')];throw _0x53231d[_0x2f79('0x63')]+'\x20NOT\x20Active';}};}function emitCampaignSummary(_0x46e4ae){if(utils[_0x2f79('0x7d')](_0x46e4ae)){emit(util['format'](_0x2f79('0x7e'),_0x46e4ae[_0x2f79('0x63')]),'campaign:save',_0x46e4ae);}}function loggerCatchQueueSummary(_0xc3fa28,_0x24811b){return function(_0x496929){clearPredictiveAttributes(_0x24811b);emitCampaignSummary(_0x24811b);loggerSyncQueueSummary[_0x2f79('0x46')](_0xc3fa28,util['inspect'](_0x496929,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x544476){if(_0x544476['sendMessageOneNotActive']){if(_0x544476[_0x2f79('0x7f')]===0x0){_0x544476['sendMessageOneNotActive']=![];_0x544476[_0x2f79('0x6a')]=utils[_0x2f79('0x6b')][_0x2f79('0x7c')];loggerSyncQueueSummary[_0x2f79('0x46')](_0x2f79('0x80'),_0x544476[_0x2f79('0x63')],_0x2f79('0x81'));}else{_0x544476['message']=utils['CAMPAIGN_STATUS'][_0x2f79('0x82')];loggerSyncQueueSummary['debug'](_0x2f79('0x80'),_0x544476[_0x2f79('0x63')],'is\x20disactive');}emitCampaignSummary(_0x544476);}}function myreject(_0x195348){return function(_0x28817d){return _0x195348(msgResponse(_0x2f79('0x83'),_0x2f79('0x84'),JSON[_0x2f79('0x75')](_0x28817d)));};}Dialer[_0x2f79('0x1c')][_0x2f79('0x85')]=function(_0x26fa92){return!_['isUndefined'](_0x26fa92)&&_0x26fa92&&!_[_0x2f79('0x42')](_0x26fa92['name'])&&!_['isUndefined'](_0x26fa92[_0x2f79('0x86')])&&_0x26fa92[_0x2f79('0x86')]&&(this['trunks'][util[_0x2f79('0x87')](_0x2f79('0x88'),_0x26fa92[_0x2f79('0x63')])]['status']===_0x2f79('0x89')||this[_0x2f79('0x25')][util[_0x2f79('0x87')](_0x2f79('0x88'),_0x26fa92['name'])][_0x2f79('0x8a')]===_0x2f79('0x8b'));};Dialer[_0x2f79('0x1c')]['checkIsTrunkReachable']=function(_0x1ebc84){var _0x221fac=this;return function(){if(!_0x221fac['isTrunkReachable'](_0x1ebc84[_0x2f79('0x8c')])){if(!_0x221fac[_0x2f79('0x85')](_0x1ebc84[_0x2f79('0x8d')])){_0x1ebc84[_0x2f79('0x6a')]=utils[_0x2f79('0x6b')][_0x2f79('0x8e')];throw _0x1ebc84[_0x2f79('0x63')]+_0x2f79('0x8f');}}};};Dialer[_0x2f79('0x1c')][_0x2f79('0x90')]=function(_0x8f616d,_0x5162ef,_0x5a2800,_0x131470){var _0x5cac9f=this;return function(){var _0x492214=!![];return _0x5cac9f[_0x2f79('0x91')](_0x8f616d,_0x5162ef,_0x5a2800,_0x131470,_0x492214);};};Dialer[_0x2f79('0x1c')]['checkIfTimeIntervals']=function(_0x46e4f8,_0x4e70f6,_0x1d67ec,_0x97041b){var _0x1aca5c=this;return function(){var _0x4ac79a=![];return _0x1aca5c[_0x2f79('0x91')](_0x46e4f8[_0x2f79('0x7a')],_0x4e70f6,_0x1d67ec,_0x97041b,_0x4ac79a);};};Dialer['prototype'][_0x2f79('0x91')]=function(_0x4de4d4,_0x18bf22,_0x5b8028,_0x1080e5,_0xcc255){var _0x51dad5=[];return new Promise(function(_0x381560,_0x4b46cd){if(!isNotNull(_0x4de4d4)){_0x1080e5[_0x2f79('0x6a')]=utils[_0x2f79('0x6b')][_0x2f79('0x78')];return _0x4b46cd(msgResponse(_0x2f79('0x92'),_0x2f79('0x93'),_0x5b8028+_0x2f79('0x94')));}if(_[_0x2f79('0x4b')](_0x4de4d4)){_0x1080e5[_0x2f79('0x6a')]=utils[_0x2f79('0x6b')][_0x2f79('0x95')];return _0x4b46cd(msgResponse(_0x2f79('0x92'),_0x2f79('0x93'),_0x5b8028+'\x20Intervals\x20is\x20empty\x20'));}if(_0x18bf22&&_[_0x2f79('0x42')](config['timezones'][_0x18bf22])){_0x1080e5[_0x2f79('0x6a')]=utils[_0x2f79('0x6b')][_0x2f79('0x96')];return _0x4b46cd(msgResponse(_0x2f79('0x92'),'Failure',_0x5b8028+_0x2f79('0x97')+_0x18bf22));}if(_[_0x2f79('0x98')](_0x4de4d4)){for(var _0x521e33=0x0;_0x521e33<_0x4de4d4['length'];_0x521e33+=0x1){_0x51dad5[_0x2f79('0x99')](ami[_0x2f79('0x9a')]({'action':_0x2f79('0x9b'),'command':util[_0x2f79('0x87')](_0x2f79('0x9c'),_0x4de4d4[_0x521e33][_0x2f79('0x9d')],!_[_0x2f79('0x42')](config[_0x2f79('0x9e')][_0x18bf22])?_0x18bf22:'')})['then'](function(_0x134131){return _0x134131[_0x2f79('0x9f')]['indexOf']('true')>=0x0;})[_0x2f79('0xa0')](myreject(_0x4b46cd)));}}else{_0x51dad5['push'](ami[_0x2f79('0x9a')]({'action':'command','command':util['format'](_0x2f79('0x9c'),_0x4de4d4,!_[_0x2f79('0x42')](config['timezones'][_0x18bf22])?_0x18bf22:'')})['then'](function(_0x598248){return _0x598248[_0x2f79('0x9f')][_0x2f79('0xa1')](_0x2f79('0xa2'))>=0x0;})['catch'](myreject(_0x4b46cd)));}Promise[_0x2f79('0xa3')](_0x51dad5)[_0x2f79('0x40')](function(_0x594221){var _0x1a395f=_[_0x2f79('0xa4')](_0x594221);if(_0x1a395f){return _0x381560(_0x1a395f);}else{_0x1080e5[_0x2f79('0x6a')]=_0xcc255?utils[_0x2f79('0x6b')][_0x2f79('0xa5')]:utils[_0x2f79('0x6b')][_0x2f79('0xa6')];return _0x4b46cd(msgResponse(_0x2f79('0xa7'),_0x2f79('0x93'),_0x2f79('0xa8')+_0xcc255+'\x20'+_0x5b8028+_0x2f79('0xa9')+util['inspect'](_0x4de4d4,{'showHidden':![],'depth':null})+_0x2f79('0xaa')+_0x18bf22));}})[_0x2f79('0xa0')](function(_0x28225d){return _0x4b46cd(msgResponse('ifTime','Failure',JSON[_0x2f79('0x75')](_0x28225d)));});});};Dialer[_0x2f79('0x1c')][_0x2f79('0x3e')]=function(){var _0x1bcd73=this;return cmHopper['resetActiveCalls']({'active':![]},{'where':{'active':!![]}})[_0x2f79('0x40')](function(){setInterval(function(){_0x1bcd73[_0x2f79('0xab')]();},0x3e8);});};Dialer[_0x2f79('0x1c')][_0x2f79('0xab')]=function(){var _0xbef395=this;var _0x32875c;for(var _0x6002c5 in this[_0x2f79('0x23')]){if(typeof this[_0x2f79('0x23')][_0x6002c5]!=='undefined'){_0x32875c=this[_0x2f79('0x23')][_0x6002c5];if(utils['isIVRCampaign'](_0x32875c)&&utils['isIVRCampaignActive'](_0x32875c)){_0x32875c[_0x2f79('0xac')]=!![];Promise[_0x2f79('0xad')]()[_0x2f79('0x40')](checkIsIVRCampaignActive(_0x32875c))['then'](checkInterval(_0x32875c))['then'](_0xbef395[_0x2f79('0xae')](_0x32875c))[_0x2f79('0x40')](_0xbef395[_0x2f79('0x90')](_0x32875c[_0x2f79('0xaf')],_0x32875c[_0x2f79('0xb0')],_0x32875c['name'],_0x32875c))['then'](_0xbef395[_0x2f79('0xb1')](_0x32875c[_0x2f79('0x77')],_0x32875c[_0x2f79('0xb0')],_0x32875c[_0x2f79('0x63')],_0x32875c))['then'](_0xbef395[_0x2f79('0xb2')](_0x32875c))[_0x2f79('0xa0')](loggerCatchQueueSummary(_0x2f79('0xb3'),_0x32875c));}else{notSendMessagesCampaign(_0x32875c);}}}};Dialer[_0x2f79('0x1c')]['checkDialMethod']=function(_0x5102f4){if(_0x5102f4[_0x2f79('0xb4')]!==_0x2f79('0xa')){clearPredictiveAttributes(_0x5102f4);}switch(_0x5102f4[_0x2f79('0xb4')]){case _0x2f79('0xb5'):this[_0x2f79('0xb6')](_0x5102f4,0x1);break;case _0x2f79('0xb7'):this[_0x2f79('0xb6')](_0x5102f4,_0x5102f4['dialPowerLevel']);break;case _0x2f79('0xa'):this[_0x2f79('0xa')](_0x5102f4);break;case'booked':this[_0x2f79('0xb6')](_0x5102f4,0x1);break;default:logger[_0x2f79('0x67')](_0x2f79('0xb8'),_0x5102f4['name'],_0x2f79('0xb9'));}};Dialer['prototype']['ifTime']=function(_0x221da7,_0xabc803){var _0x430e9f=_0x221da7['dialTimezone'];var _0x46f89e=_0xabc803?_0x221da7['dialGlobalInterval']:_0x221da7[_0x2f79('0x77')]['Intervals'];logger[_0x2f79('0xba')](_0x2f79('0xbb'),_0x46f89e,_0x430e9f,_0x221da7[_0x2f79('0x63')],util[_0x2f79('0x87')](_0x2f79('0xbc'),_0x221da7['name'],_0x221da7['id']));var _0x34ff90=null;return Interval['intervalIftime'](_0x46f89e,_0x430e9f)[_0x2f79('0x40')](function(_0x52073a){if(_0x52073a===!![]){return _0x52073a;}else{_0x221da7[_0x2f79('0x6a')]=_0xabc803?utils[_0x2f79('0x6b')][_0x2f79('0xa5')]:utils[_0x2f79('0x6b')]['OVERTIME_INTERVAL'];_0x34ff90=msgResponse(_0x2f79('0xa7'),'Failure',_0x2f79('0xa8')+_0xabc803+'\x20'+_0x221da7['name']+'\x20Interval\x20is\x20overtime:\x20'+util[_0x2f79('0x48')](_0x46f89e,{'showHidden':![],'depth':null})+_0x2f79('0xaa')+_0x430e9f);}if(_0x34ff90!==null){logger[_0x2f79('0xba')](_0x2f79('0xbd'),_0x34ff90);_0x34ff90['isGlobal']=_0xabc803;throw _0x34ff90;}})['catch'](function(_0x137655){logger[_0x2f79('0x67')](_0x2f79('0xbe'),_0x137655);throw msgResponse('[ifTime][Action]',_0x2f79('0x84'),util['inspect'](_0x137655,{'showHidden':![],'depth':null}));});};Dialer['prototype'][_0x2f79('0x2e')]=function(_0xfbc85c){if(this[_0x2f79('0x22')][_0xfbc85c[_0x2f79('0xbf')]]){if(this[_0x2f79('0xc0')][_0xfbc85c[_0x2f79('0xc1')]]&&this[_0x2f79('0xc0')][_0xfbc85c[_0x2f79('0xc1')]][_0x2f79('0x44')]!==_0x2f79('0xc2')){this['updateOriginated'](this[_0x2f79('0x22')][_0xfbc85c[_0x2f79('0xbf')]]);this[_0x2f79('0xc0')][_0xfbc85c[_0x2f79('0xc1')]]['answertime']=moment()[_0x2f79('0x87')](_0x2f79('0xc3'));}}};Dialer['prototype'][_0x2f79('0x35')]=function(_0x39187e){var _0x3815c1=this['uniqueId'][_0x39187e[_0x2f79('0xc1')]];if(this['voiceQueues'][_0x39187e['queue']]){if(_0x3815c1&&_0x3815c1[_0x2f79('0x44')]!==_0x2f79('0xc2')){delete this[_0x2f79('0xc0')][_0x39187e[_0x2f79('0xc1')]];this[_0x2f79('0x22')][_0x39187e[_0x2f79('0xbf')]][_0x2f79('0xc4')]+=0x1;var _0x2c1dee=new AgentComplete(_0x3815c1,_0x39187e);if(_0x39187e['reason']===_0x2f79('0xc5')){_0x2c1dee['agiafterat']=this[_0x2f79('0x22')][_0x39187e['queue']][_0x2f79('0xc6')]&&this[_0x2f79('0x22')][_0x39187e[_0x2f79('0xbf')]][_0x2f79('0xc7')]?moment()[_0x2f79('0x87')](_0x2f79('0xc3')):undefined;}hopperUtils['createHistory'](_0x2c1dee)['catch'](loggerCatch(_0x2f79('0xc8')));hopperUtils[_0x2f79('0xc9')](_0x2c1dee)['catch'](loggerCatch(_0x2f79('0xca')));}}};Dialer['prototype'][_0x2f79('0x31')]=function(_0x3cf0a3){var _0x207a8b=this['uniqueId'][_0x3cf0a3['uniqueid']];var _0x51151d=this;var _0xd22cf4=![];var _0x31d6b8;var _0x26b16e;if(this[_0x2f79('0x22')][_0x3cf0a3[_0x2f79('0xbf')]]){if(_0x207a8b&&_0x207a8b['type']!=='ivr'){delete this[_0x2f79('0xc0')][_0x3cf0a3[_0x2f79('0xc1')]];this[_0x2f79('0xcb')](this[_0x2f79('0x22')][_0x3cf0a3[_0x2f79('0xbf')]]);_0x207a8b[_0x2f79('0xcc')]=moment()['format'](_0x2f79('0xc3'));var _0x28ed91=new QueueCallerAbandon(_0x207a8b,_0x3cf0a3);if(utils[_0x2f79('0xcd')](_0x207a8b[_0x2f79('0xcc')],_0x207a8b[_0x2f79('0xce')])>=_0x207a8b['dialQueueTimeout']){this[_0x2f79('0x22')][_0x3cf0a3[_0x2f79('0xbf')]][_0x2f79('0xcf')]+=0x1;this[_0x2f79('0x22')][_0x3cf0a3['queue']]['outboundDropCallsDayTimeout']+=0x1;this['voiceQueues'][_0x3cf0a3[_0x2f79('0xbf')]][_0x2f79('0xd0')]+=0x1;_0x28ed91[_0x2f79('0x6f')]=0xa;_0x28ed91['statedesc']='Drop';_0x28ed91[_0x2f79('0xd1')]=_0x2f79('0xd2');_0x28ed91[_0x2f79('0xd3')]=this['voiceQueues'][_0x3cf0a3['queue']][_0x2f79('0xc6')]?moment()[_0x2f79('0x87')](_0x2f79('0xc3')):undefined;_0x28ed91[_0x2f79('0xd4')]+=0x1;_0x28ed91[_0x2f79('0xd5')]+=0x1;_0x31d6b8=this[_0x2f79('0x22')][_0x3cf0a3[_0x2f79('0xbf')]][_0x2f79('0xd6')];_0x26b16e=this[_0x2f79('0x22')][_0x3cf0a3['queue']][_0x2f79('0xd7')];hopperUtils[_0x2f79('0xd8')](_0x28ed91,_0x28ed91[_0x2f79('0x6f')],_0x207a8b[_0x2f79('0xd9')])['then'](function(_0x18c5c0){_0xd22cf4=_0x18c5c0[_0x2f79('0xda')]==0x1;if(_0x28ed91[_0x2f79('0xd4')]>=_0x51151d[_0x2f79('0x22')][_0x3cf0a3[_0x2f79('0xbf')]][_0x2f79('0xdb')]){_0x51151d[_0x2f79('0xdc')](_0x28ed91,_0x18c5c0[_0x2f79('0xda')]);}else{hopperUtils[_0x2f79('0xdd')]({'active':![],'countdropretry':_0x28ed91['countdropretry'],'scheduledat':moment()['add'](_0x51151d[_0x2f79('0x22')][_0x3cf0a3['queue']]['dialDropRetryFrequency'],_0x2f79('0xde'))['format'](_0x2f79('0xc3')),'ContactId':_0x207a8b[_0x2f79('0xdf')],'ListId':_0x207a8b[_0x2f79('0xe0')],'VoiceQueueId':_0x207a8b[_0x2f79('0xe1')]||undefined,'CampaignId':_0x207a8b[_0x2f79('0xe2')]||undefined})['catch'](loggerCatch(_0x2f79('0xe3')));var _0x403303=new History(_0x28ed91);_0x403303[_0x2f79('0x6f')]=0xa;_0x403303['statedesc']=_0x2f79('0xe4');_0x403303[_0x2f79('0x71')]=moment()[_0x2f79('0x87')]('YYYY-MM-DD\x20HH:mm:ss');_0x403303[_0x2f79('0x70')]=_0x403303[_0x2f79('0x71')];_0x403303[_0x2f79('0xe5')]=_0x28ed91[_0x2f79('0xe5')];_0x403303[_0x2f79('0xe6')]=_0x28ed91[_0x2f79('0xe6')];hopperUtils[_0x2f79('0xe7')](_0x403303)[_0x2f79('0xa0')](loggerCatch(_0x2f79('0xe8')));}})['then'](function(){if(_0xd22cf4)hopperUtils['swapAdditionalPhones'](_0x28ed91,_0x31d6b8,_0x26b16e)[_0x2f79('0x40')](function(){return 0x1;});});}else{this[_0x2f79('0x22')][_0x3cf0a3[_0x2f79('0xbf')]][_0x2f79('0x52')]+=0x1;this['voiceQueues'][_0x3cf0a3['queue']]['outboundDropCallsDayCallersExit']+=0x1;_0x28ed91['state']=0xb;_0x28ed91[_0x2f79('0xe9')]=_0x2f79('0xea');_0x28ed91[_0x2f79('0xd1')]=_0x2f79('0xeb');_0x28ed91[_0x2f79('0xec')]+=0x1;_0x28ed91['countglobal']+=0x1;_0x31d6b8=this['voiceQueues'][_0x3cf0a3[_0x2f79('0xbf')]][_0x2f79('0xed')];_0x26b16e=this[_0x2f79('0x22')][_0x3cf0a3['queue']][_0x2f79('0xd7')];hopperUtils['verifyAdditionalPhones'](_0x28ed91,_0x28ed91[_0x2f79('0x6f')],_0x207a8b[_0x2f79('0xd9')])[_0x2f79('0x40')](function(_0x4332e6){if(_0x28ed91[_0x2f79('0xec')]>=_0x51151d[_0x2f79('0x22')][_0x3cf0a3['queue']][_0x2f79('0xee')]){_0x51151d['queueCallerAbandonCreateState'](_0x28ed91,_0x4332e6[_0x2f79('0xda')]);}else{hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x28ed91[_0x2f79('0xec')],'scheduledat':moment()[_0x2f79('0xef')](_0x51151d['voiceQueues'][_0x3cf0a3['queue']][_0x2f79('0xed')],_0x2f79('0xde'))[_0x2f79('0x87')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x207a8b[_0x2f79('0xdf')],'ListId':_0x207a8b[_0x2f79('0xe0')],'VoiceQueueId':_0x207a8b[_0x2f79('0xe1')]||undefined,'CampaignId':_0x207a8b[_0x2f79('0xe2')]||undefined})[_0x2f79('0xa0')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x13da68=new History(_0x28ed91);_0x13da68[_0x2f79('0x6f')]=0xb;_0x13da68[_0x2f79('0xe9')]=_0x2f79('0xea');_0x13da68[_0x2f79('0x71')]=moment()[_0x2f79('0x87')](_0x2f79('0xc3'));_0x13da68[_0x2f79('0x70')]=_0x13da68[_0x2f79('0x71')];_0x13da68[_0x2f79('0xe5')]=_0x28ed91[_0x2f79('0xe5')];_0x13da68[_0x2f79('0xe6')]=_0x28ed91[_0x2f79('0xe6')];hopperUtils[_0x2f79('0xe7')](_0x13da68)[_0x2f79('0xa0')](loggerCatch(_0x2f79('0xf0')));}})[_0x2f79('0x40')](function(){if(_0xd22cf4)hopperUtils[_0x2f79('0xf1')](_0x28ed91,_0x31d6b8,_0x26b16e)[_0x2f79('0x40')](function(){return 0x1;});});}}}};Dialer[_0x2f79('0x1c')][_0x2f79('0x39')]=function(_0x4354d4){if(this[_0x2f79('0x26')][_0x4354d4[_0x2f79('0xc1')]]){this['actions'][_0x4354d4[_0x2f79('0xc1')]][_0x2f79('0xf2')]=_0x4354d4[_0x2f79('0xf2')];}if(this[_0x2f79('0xc0')][_0x4354d4[_0x2f79('0xc1')]]){this[_0x2f79('0xc0')][_0x4354d4[_0x2f79('0xc1')]][_0x2f79('0xf2')]=_0x4354d4[_0x2f79('0xf2')];}};Dialer[_0x2f79('0x1c')]['syncQueueMember']=function(_0x5f5444){if(!this[_0x2f79('0x26')][_0x5f5444[_0x2f79('0xf3')]]){return;}var _0x4b16c8=this[_0x2f79('0x22')][this[_0x2f79('0x26')][_0x5f5444[_0x2f79('0xf3')]][_0x2f79('0xbf')]][_0x2f79('0xf4')]||'rrmemory';if(_0x4b16c8==='roundrobin'){if(this[_0x2f79('0x26')][_0x5f5444['actionid']]&&_['isNil'](this[_0x2f79('0x26')][_0x5f5444[_0x2f79('0xf3')]][_0x2f79('0xf5')])&&_0x5f5444[_0x2f79('0x8a')]==='1'&&_0x5f5444['paused']==='0'){if(this[_0x2f79('0x24')][_0x5f5444[_0x2f79('0xf6')]]){if(!this[_0x2f79('0x24')][_0x5f5444[_0x2f79('0xf6')]][_0x2f79('0xf5')]){this[_0x2f79('0x24')][_0x5f5444['stateinterface']][_0x2f79('0xf5')]=!![];this[_0x2f79('0x26')][_0x5f5444[_0x2f79('0xf3')]][_0x2f79('0xf5')]=!![];this[_0x2f79('0x26')][_0x5f5444[_0x2f79('0xf3')]]['stateinterface']=_0x5f5444[_0x2f79('0xf6')];}}}}else if(_0x4b16c8==='rrmemory'){if(this['actions'][_0x5f5444[_0x2f79('0xf3')]]){if(this[_0x2f79('0x24')][_0x5f5444[_0x2f79('0xf6')]]){this[_0x2f79('0x26')][_0x5f5444[_0x2f79('0xf3')]][_0x2f79('0xf6')]=_0x5f5444['stateinterface'];if(_[_0x2f79('0xf7')](this[_0x2f79('0x2b')][this['actions'][_0x5f5444[_0x2f79('0xf3')]]['queue']])){this[_0x2f79('0x2b')][this[_0x2f79('0x26')][_0x5f5444['actionid']][_0x2f79('0xbf')]]=[];}this[_0x2f79('0x2b')][this[_0x2f79('0x26')][_0x5f5444[_0x2f79('0xf3')]][_0x2f79('0xbf')]][_0x2f79('0x99')](_[_0x2f79('0x61')](_[_0x2f79('0x76')](this[_0x2f79('0x26')][_0x5f5444['actionid']],[_0x2f79('0xf8'),_0x2f79('0xf6')]),{'status':_0x5f5444[_0x2f79('0x8a')],'paused':_0x5f5444[_0x2f79('0xf9')]}));}}}};Dialer[_0x2f79('0x1c')][_0x2f79('0x3d')]=function(_0x914ae0){if(!this[_0x2f79('0x26')][_0x914ae0[_0x2f79('0xf3')]]){return;}var _0x52d209=this;var _0x356a78=this[_0x2f79('0x22')][this[_0x2f79('0x26')][_0x914ae0[_0x2f79('0xf3')]][_0x2f79('0xbf')]];var _0x39a4df=_0x356a78[_0x2f79('0xf4')]||_0x2f79('0xfa');if(_0x39a4df===_0x2f79('0xfb')){if(this['actions'][_0x914ae0[_0x2f79('0xf3')]]&&this['actions'][_0x914ae0[_0x2f79('0xf3')]][_0x2f79('0xf6')]){this['preview']['run'](this['actions'][_0x914ae0[_0x2f79('0xf3')]][_0x2f79('0xf8')],this[_0x2f79('0x26')][_0x914ae0[_0x2f79('0xf3')]]['stateinterface'])[_0x2f79('0xa0')](function(_0x417e24){logger[_0x2f79('0x67')](_0x2f79('0xfc'),util['inspect'](_0x417e24,{'showHidden':![],'depth':null}));})['finally'](function(){_0x52d209[_0x2f79('0xcb')](_0x52d209[_0x2f79('0x22')][_0x52d209[_0x2f79('0x26')][_0x914ae0['actionid']][_0x2f79('0xbf')]]);_0x52d209[_0x2f79('0x24')][_0x52d209[_0x2f79('0x26')][_0x914ae0['actionid']][_0x2f79('0xf6')]][_0x2f79('0xf5')]=![];delete _0x52d209[_0x2f79('0x26')][_0x914ae0['actionid']];unlockQueueStatus(_0x356a78);});}else{this['updateOriginated'](this[_0x2f79('0x22')][this[_0x2f79('0x26')][_0x914ae0['actionid']][_0x2f79('0xbf')]]);hopperUtils[_0x2f79('0xdd')]({'active':![],'ContactId':this[_0x2f79('0x26')][_0x914ae0[_0x2f79('0xf3')]][_0x2f79('0xdf')],'ListId':this[_0x2f79('0x26')][_0x914ae0[_0x2f79('0xf3')]][_0x2f79('0xe0')],'VoiceQueueId':this[_0x2f79('0x26')][_0x914ae0[_0x2f79('0xf3')]][_0x2f79('0xe1')]||undefined,'CampaignId':this[_0x2f79('0x26')][_0x914ae0[_0x2f79('0xf3')]][_0x2f79('0xe2')]||undefined})[_0x2f79('0xa0')](loggerCatch(_0x2f79('0xfd')));delete this['actions'][_0x914ae0['actionid']];unlockQueueStatus(_0x356a78);}}else if(_0x39a4df==='rrmemory'){var _0x3e9920;if(this['actions'][_0x914ae0[_0x2f79('0xf3')]]&&!_[_0x2f79('0x4b')](this[_0x2f79('0x2b')][this[_0x2f79('0x26')][_0x914ae0[_0x2f79('0xf3')]]['queue']])){if(this[_0x2f79('0x2c')][_0x52d209[_0x2f79('0x26')][_0x914ae0[_0x2f79('0xf3')]]['queue']]){this[_0x2f79('0x2c')][_0x52d209[_0x2f79('0x26')][_0x914ae0[_0x2f79('0xf3')]]['queue']]=this[_0x2f79('0x2c')][this[_0x2f79('0x26')][_0x914ae0['actionid']]['queue']]?this[_0x2f79('0x2c')][this[_0x2f79('0x26')][_0x914ae0[_0x2f79('0xf3')]]['queue']]:this[_0x2f79('0x2b')][this[_0x2f79('0x26')][_0x914ae0[_0x2f79('0xf3')]][_0x2f79('0xbf')]]?this[_0x2f79('0x2b')][this[_0x2f79('0x26')][_0x914ae0[_0x2f79('0xf3')]][_0x2f79('0xbf')]][_0x2f79('0xfe')]||0x0:0x0;}this[_0x2f79('0x2b')][this[_0x2f79('0x26')][_0x914ae0[_0x2f79('0xf3')]][_0x2f79('0xbf')]][_0x2f79('0xfe')]=this[_0x2f79('0x2c')][this[_0x2f79('0x26')][_0x914ae0[_0x2f79('0xf3')]]['queue']];for(var _0x3c839b=0x0;_0x3c839b=_0x277848['dialGlobalMaxRetry']){_0x5dafa9[_0x2f79('0x123')](_0x46d011,_0x4c4426,_0x1f288e,_0x2f79('0x124'));}else{if(_0x46d011[_0x2f79('0x11b')]>=_0x277848['dialMachineMaxRetry']){_0x5dafa9[_0x2f79('0x125')](_0x46d011,_0x4c4426,_0x1f288e,_0x2f79('0x126'));}else{hopperUtils[_0x2f79('0xdd')]({'active':![],'countmachineretry':_0x46d011[_0x2f79('0x11b')],'scheduledat':moment()[_0x2f79('0xef')](_0x277848['dialMachineRetryFrequency'],_0x2f79('0xde'))[_0x2f79('0x87')](_0x2f79('0xc3')),'ContactId':_0x46d011[_0x2f79('0xdf')],'ListId':_0x46d011[_0x2f79('0xe0')],'VoiceQueueId':_0x46d011[_0x2f79('0xe1')]||undefined,'CampaignId':_0x46d011[_0x2f79('0xe2')]||undefined})[_0x2f79('0xa0')](loggerCatch(_0x2f79('0x127')));_0x4c4426({'reschedule':0x1});}}});}if(_0x26b6ee[_0x2f79('0x44')]===_0x2f79('0xc2')&&this[_0x2f79('0x23')][_0x26b6ee[_0x2f79('0xbf')]][_0x2f79('0x119')]&&_0x40eb74['value']===_0x2f79('0x111')){delete this[_0x2f79('0xc0')][_0x40eb74[_0x2f79('0xc1')]];this[_0x2f79('0xcb')](this[_0x2f79('0x23')][_0x26b6ee[_0x2f79('0xbf')]]);_0x23377a=new Hangup(_0x26b6ee,_0x40eb74);_0x23377a[_0x2f79('0x6f')]=0x12;_0x23377a[_0x2f79('0xe9')]='HangupInAMD';_0x23377a[_0x2f79('0x114')]='AMD';ami[_0x2f79('0x43')](_0x2f79('0x11d'),ut[_0x2f79('0x116')](_0x23377a,_0x2f79('0x11c')));this[_0x2f79('0x117')](_0x23377a,'[syncHangupInAMDIvr][createHistory]',_0x2f79('0x128'));}if(_0x26b6ee[_0x2f79('0x44')]===_0x2f79('0xc2')&&this[_0x2f79('0x23')][_0x26b6ee[_0x2f79('0xbf')]]['dialAMDActive']&&_0x40eb74['value']===_0x2f79('0x11a')){return new Promise(function(_0x169daa,_0x45705e){delete _0x5dafa9[_0x2f79('0xc0')][_0x40eb74[_0x2f79('0xc1')]];_0x5dafa9[_0x2f79('0xcb')](_0x5dafa9[_0x2f79('0x23')][_0x26b6ee[_0x2f79('0xbf')]]);_0x5dafa9[_0x2f79('0x23')][_0x26b6ee['queue']][_0x2f79('0xc4')]+=0x1;_0x5dafa9[_0x2f79('0x23')][_0x26b6ee[_0x2f79('0xbf')]][_0x2f79('0x112')]+=0x1;var _0x4272ac=_0x5dafa9[_0x2f79('0x23')][_0x26b6ee[_0x2f79('0xbf')]];var _0x540d7c=new Hangup(_0x26b6ee,_0x40eb74);_0x540d7c[_0x2f79('0x6f')]=0x13;_0x540d7c[_0x2f79('0xe9')]='Machine';_0x540d7c[_0x2f79('0x114')]=_0x2f79('0x115');_0x540d7c[_0x2f79('0x11b')]+=0x1;_0x540d7c[_0x2f79('0xd5')]+=0x1;_0x540d7c[_0x2f79('0x11c')]=!![];ami['emit']('custom:amd',ut[_0x2f79('0x116')](_0x540d7c,'amd'));hopperUtils[_0x2f79('0xe7')](_0x540d7c)['catch'](loggerCatch(_0x2f79('0x11e')));if(_0x540d7c[_0x2f79('0x11f')]+_0x540d7c[_0x2f79('0x129')]+_0x540d7c['countnoanswerretry']+_0x540d7c[_0x2f79('0x121')]+_0x540d7c[_0x2f79('0xd4')]+_0x540d7c[_0x2f79('0xec')]+_0x540d7c['countmachineretry']+_0x540d7c[_0x2f79('0x122')]>=_0x4272ac['dialGlobalMaxRetry']){_0x5dafa9[_0x2f79('0x123')](_0x540d7c,_0x169daa,_0x45705e,_0x2f79('0x124'));}else{if(_0x540d7c[_0x2f79('0x11b')]>=_0x4272ac[_0x2f79('0x12a')]){_0x5dafa9[_0x2f79('0x125')](_0x540d7c,_0x169daa,_0x45705e,_0x2f79('0x126'));}else{hopperUtils[_0x2f79('0xdd')]({'active':![],'countmachineretry':_0x540d7c[_0x2f79('0x11b')],'scheduledat':moment()['add'](_0x4272ac[_0x2f79('0x12b')],_0x2f79('0xde'))[_0x2f79('0x87')](_0x2f79('0xc3')),'ContactId':_0x540d7c[_0x2f79('0xdf')],'ListId':_0x540d7c[_0x2f79('0xe0')],'VoiceQueueId':_0x540d7c['VoiceQueueId']||undefined,'CampaignId':_0x540d7c[_0x2f79('0xe2')]||undefined})[_0x2f79('0xa0')](loggerCatch(_0x2f79('0x127')));_0x169daa({'reschedule':0x1});}}});}}};Dialer['prototype'][_0x2f79('0x38')]=function(_0x5c38d0){var _0x147c02=this[_0x2f79('0xc0')][_0x5c38d0[_0x2f79('0xc1')]];var _0x2ae63e;if(_0x147c02&&_0x147c02[_0x2f79('0x44')]===_0x2f79('0xc2')){delete this[_0x2f79('0xc0')][_0x5c38d0[_0x2f79('0xc1')]];this[_0x2f79('0xcb')](this[_0x2f79('0x23')][_0x147c02[_0x2f79('0xbf')]]);this[_0x2f79('0x23')][_0x147c02[_0x2f79('0xbf')]][_0x2f79('0x12c')]+=0x1;_0x2ae63e=new Hangup(_0x147c02,_0x5c38d0);hopperUtils['createHistory'](_0x2ae63e)[_0x2f79('0xa0')](loggerCatch(_0x2f79('0x12d')));hopperUtils[_0x2f79('0xc9')](_0x2ae63e)[_0x2f79('0xa0')](loggerCatch(_0x2f79('0x12e')));}if(_0x147c02&&_0x147c02[_0x2f79('0x44')]!==_0x2f79('0xc2')&&isNotNull(this[_0x2f79('0x22')][_0x147c02[_0x2f79('0xbf')]][_0x2f79('0x12f')])){delete this['uniqueId'][_0x5c38d0[_0x2f79('0xc1')]];this[_0x2f79('0xcb')](this[_0x2f79('0x22')][_0x147c02[_0x2f79('0xbf')]]);this[_0x2f79('0x22')][_0x147c02[_0x2f79('0xbf')]][_0x2f79('0xc4')]+=0x1;this[_0x2f79('0x22')][_0x147c02[_0x2f79('0xbf')]][_0x2f79('0x112')]+=0x1;_0x2ae63e=new Hangup(_0x147c02,_0x5c38d0);_0x2ae63e[_0x2f79('0x6f')]=0x10;_0x2ae63e[_0x2f79('0xe9')]=_0x2f79('0x130');_0x2ae63e[_0x2f79('0x114')]=_0x2f79('0x131');hopperUtils['createHistory'](_0x2ae63e)['catch'](loggerCatch(_0x2f79('0x12d')));hopperUtils['moveContactManagedDialer'](_0x2ae63e)[_0x2f79('0xa0')](loggerCatch(_0x2f79('0x12e')));}if(_0x147c02&&_0x147c02[_0x2f79('0x44')]!=='ivr'&&!isNotNull(this['voiceQueues'][_0x147c02['queue']][_0x2f79('0x12f')])){if(_0x5c38d0[_0x2f79('0x132')]===_0x2f79('0x133')){delete this[_0x2f79('0xc0')][_0x5c38d0[_0x2f79('0xc1')]];this[_0x2f79('0x22')][_0x147c02[_0x2f79('0xbf')]][_0x2f79('0xc4')]+=0x1;const _0x8c4fd8=new AgentComplete(_0x147c02,_0x5c38d0);_0x8c4fd8[_0x2f79('0xe2')]=this[_0x2f79('0x22')][_0x147c02['queue']]['id'];hopperUtils['createHistory'](_0x8c4fd8)[_0x2f79('0xa0')](loggerCatch('[syncAgentComplete][createHistory]'));hopperUtils[_0x2f79('0xc9')](_0x8c4fd8)[_0x2f79('0xa0')](loggerCatch(_0x2f79('0xca')));}else{delete this[_0x2f79('0xc0')][_0x5c38d0[_0x2f79('0xc1')]];this['updateOriginated'](this['voiceQueues'][_0x147c02[_0x2f79('0xbf')]]);this[_0x2f79('0x22')][_0x147c02['queue']]['outboundUnknownCallsDay']+=0x1;_0x2ae63e=new Hangup(_0x147c02,_0x5c38d0);_0x2ae63e[_0x2f79('0x6f')]=0xc;_0x2ae63e[_0x2f79('0xe9')]=_0x5c38d0[_0x2f79('0x132')];_0x2ae63e['membername']=_0x2f79('0x134');hopperUtils[_0x2f79('0xe7')](_0x2ae63e)[_0x2f79('0xa0')](loggerCatch(_0x2f79('0x12d')));hopperUtils[_0x2f79('0xc9')](_0x2ae63e)['catch'](loggerCatch(_0x2f79('0x12e')));}}};Dialer[_0x2f79('0x1c')][_0x2f79('0xc')]=function(_0x4c684f){var _0x1b4215=this;if(!_0x1b4215['queuesSummary'][_0x4c684f[_0x2f79('0x63')]]){_0x1b4215[_0x2f79('0x135')][_0x4c684f[_0x2f79('0x63')]]={'running':![]};}else if(_0x1b4215[_0x2f79('0x135')][_0x4c684f[_0x2f79('0x63')]][_0x2f79('0x136')]===!![]){return;}else if(_0x1b4215['queuesSummary'][_0x4c684f[_0x2f79('0x63')]][_0x2f79('0x136')]===![]){_0x1b4215[_0x2f79('0x135')][_0x4c684f[_0x2f79('0x63')]][_0x2f79('0x136')]=!![];}var _0x404baf=_0x1b4215['voiceQueues'][_0x4c684f['name']];var _0x35192e=_0x404baf['message']!==utils[_0x2f79('0x6b')]['INACTIVE'];var _0xd4806d=utils['isPreviewCampaign'](_0x404baf);_0x404baf[_0x2f79('0x137')]=utils[_0x2f79('0x138')](_0x404baf,_0x1b4215['trunks']);Promise[_0x2f79('0xad')]()[_0x2f79('0x40')](function(){if(_0x404baf[_0x2f79('0x137')]===utils[_0x2f79('0x6b')][_0x2f79('0x7c')]){if(_0x35192e){clearPredictiveAttributes(_0x404baf);_0x4c684f[_0x2f79('0x29')]=undefined;_0x4c684f[_0x2f79('0x62')]=undefined;}if(_0x404baf[_0x2f79('0x137')]===utils['CAMPAIGN_STATUS'][_0x2f79('0x7c')]){_0x4c684f[_0x2f79('0x139')]=0x0;_0x4c684f['paused']=0x0;_0x4c684f[_0x2f79('0x13a')]=0x0;_0x4c684f[_0x2f79('0x13b')]=0x0;_0x4c684f[_0x2f79('0x13c')]=0x0;}}else if(_0x404baf['statusMessage']===utils[_0x2f79('0x6b')][_0x2f79('0x13d')]&&!_0xd4806d){return _0x1b4215[_0x2f79('0x92')](_0x404baf,!![])[_0x2f79('0x40')](function(){return _0x1b4215['ifTime'](_0x404baf,![]);})[_0x2f79('0x40')](function(){return _0x1b4215['checkDialMethod'](_0x404baf);})[_0x2f79('0xa0')](function(_0x2dd44e){loggerSyncQueueSummary[_0x2f79('0x46')](_0x2f79('0x13e'),util[_0x2f79('0x48')](_0x2dd44e,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x404baf);});}else{clearPredictiveAttributes(_0x404baf);}})[_0x2f79('0x40')](function(){var _0x537cea=_0x4c684f['compareToOutboundQueue'](_0x404baf);if(_0x537cea||_0x404baf[_0x2f79('0x13f')]){_0x404baf[_0x2f79('0x13f')]=![];_0x4c684f[_0x2f79('0x140')](_0x404baf);Object[_0x2f79('0x141')](_0x404baf,_0x4c684f);emitOutboundVoiceQueueSummary(_0x4c684f);}_0x1b4215[_0x2f79('0x135')][_0x404baf[_0x2f79('0x63')]][_0x2f79('0x136')]=![];})[_0x2f79('0xa0')](function(_0x1e5e3a){logger['error'](_0x2f79('0x13e'),util[_0x2f79('0x48')](_0x1e5e3a,{'showHidden':![],'depth':null}));_0x1b4215[_0x2f79('0x135')][_0x404baf[_0x2f79('0x63')]]['running']=![];});};Dialer[_0x2f79('0x1c')][_0x2f79('0x142')]=_[_0x2f79('0x143')](function(){var _0x2d4e2a=_['filter'](this['voiceQueues'],function(_0x3a5c09){return _0x3a5c09['dialPreviewRecallmeReminder'];});var _0x4a3f60=_[_0x2f79('0x144')](this[_0x2f79('0x24')],function(_0x35a77b){return _0x35a77b[_0x2f79('0x145')]&&_0x35a77b[_0x2f79('0x8a')]==='reachable';});if(_0x2d4e2a[_0x2f79('0x146')]>0x0&&_0x4a3f60['length']>0x0){return Promise[_0x2f79('0xad')]()[_0x2f79('0x40')](cmHopper[_0x2f79('0x147')](_[_0x2f79('0x148')](_0x2d4e2a,'id'),previewRecallmeReminderInterval,_['map'](_0x4a3f60,'id')))['then'](function(_0xd52fc4){for(var _0x482f17=0x0;_0x482f17<_0xd52fc4['length'];_0x482f17++){var _0x7c84b0=_0xd52fc4[_0x482f17][_0x2f79('0x149')][_0x2f79('0x63')];if(_0x7c84b0)io['to'](util[_0x2f79('0x87')](_0x2f79('0x14a'),_0x7c84b0))[_0x2f79('0x43')](_0x2f79('0x14b'),{'hopper':_0xd52fc4[_0x482f17]});}})[_0x2f79('0xa0')](function(_0x2f5756){logger['error'](_0x2f79('0x14c'),_0x2f5756);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x2f79('0x1c')]['loopClearZombieChannels']=function(){var _0x3b7897=this;setInterval(function(){_0x3b7897[_0x2f79('0x14d')](_0x3b7897[_0x2f79('0xc0')],_0x2f79('0x14e'));_0x3b7897[_0x2f79('0x14d')](_0x3b7897[_0x2f79('0x26')],_0x2f79('0x14f'));},0x32c8);};Dialer[_0x2f79('0x1c')]['clearZombieChannels']=function(_0x23550c,_0x4cd7b8){var _0x23706e=this;for(var _0x45ee11 in _0x23550c){if(typeof _0x23550c[_0x45ee11]!==_0x2f79('0x150')){this['sequence'][_0x2f79('0x1d')](function(){if(!_[_0x2f79('0xf7')](_0x23550c[_0x45ee11])){return ami[_0x2f79('0x9a')]({'action':_0x2f79('0x8a'),'channel':_0x23550c[_0x45ee11][_0x2f79('0xf2')]})[_0x2f79('0xa0')](function(_0x3efbe1){if(_0x3efbe1[_0x2f79('0x6a')]===_0x2f79('0x151')){setTimeout(function(){if(_0x23550c[_0x45ee11]&&_0x23550c[_0x45ee11][_0x2f79('0x44')]!=='ivr'){_0x23706e['updateOriginated'](_0x23706e[_0x2f79('0x22')][_0x23550c[_0x45ee11][_0x2f79('0xbf')]]);logger[_0x2f79('0x67')](_0x2f79('0x152'),_0x4cd7b8,_0x45ee11,_0x23550c[_0x45ee11][_0x2f79('0xbf')]);delete _0x23550c[_0x45ee11];}if(_0x23550c[_0x45ee11]&&_0x23550c[_0x45ee11][_0x2f79('0x44')]===_0x2f79('0xc2')){_0x23706e[_0x2f79('0xcb')](_0x23706e[_0x2f79('0x23')][_0x23550c[_0x45ee11][_0x2f79('0xbf')]]);logger['error'](_0x2f79('0x153'),_0x4cd7b8,_0x45ee11,_0x23550c[_0x45ee11][_0x2f79('0xbf')]);delete _0x23550c[_0x45ee11];}},0x2328);}});}});}}};Dialer[_0x2f79('0x1c')][_0x2f79('0x154')]=function(_0x434adc){return Promise[_0x2f79('0xad')]()[_0x2f79('0x40')](voiceQueueRt[_0x2f79('0x154')](_0x434adc))['catch'](loggerCatch(_0x2f79('0x155')));};Dialer[_0x2f79('0x1c')]['updateOriginated']=function(_0xa4415e){if(!_['isUndefined'](_0xa4415e)&&_0xa4415e!==null){if(typeof _0xa4415e[_0x2f79('0x7f')]!==_0x2f79('0x150')){if(_0xa4415e[_0x2f79('0x7f')]>0x0){_0xa4415e[_0x2f79('0x7f')]-=0x1;}else{logger[_0x2f79('0x67')](_0x2f79('0x156'));}}}else{logger[_0x2f79('0x67')](_0x2f79('0x157'));}};Dialer[_0x2f79('0x1c')][_0x2f79('0x158')]=function(_0x36070e,_0x493fd2){var _0x587dff=this;return function(_0x4d1aa9){_0x587dff[_0x2f79('0xcb')](_0x493fd2);logger[_0x2f79('0x67')](_0x36070e,util[_0x2f79('0x48')](_0x4d1aa9,{'showHidden':![],'depth':null}));};};Dialer[_0x2f79('0x1c')][_0x2f79('0x159')]=function(_0x3e9e4e,_0x42424f,_0x194765){var _0x4d82ec={'state':0x19,'statedesc':'notFound'};this[_0x2f79('0xcb')](_0x42424f);this[_0x2f79('0x117')](_[_0x2f79('0x61')](_0x4d82ec,_[_0x2f79('0x76')](_0x194765,[_0x2f79('0xdf'),_0x2f79('0xe0'),'UserId',_0x2f79('0xe1'),'CampaignId'])),_0x2f79('0x15a'),'[emptyContact]');logger[_0x2f79('0x67')](_0x3e9e4e);};Dialer[_0x2f79('0x1c')][_0x2f79('0x117')]=function(_0x2b251e,_0x2777ba,_0x55196a){hopperUtils['createHistory'](_0x2b251e)[_0x2f79('0xa0')](loggerCatch(_0x2777ba));hopperUtils[_0x2f79('0xc9')](_0x2b251e)['catch'](loggerCatch(_0x55196a));};Dialer[_0x2f79('0x1c')][_0x2f79('0xdc')]=function(_0x581fd7,_0x5f29ee){hopperUtils[_0x2f79('0xe7')](_0x581fd7)['catch'](loggerCatch(_0x2f79('0xc8')));if(_0x5f29ee==0x0){hopperUtils[_0x2f79('0xc9')](_0x581fd7)[_0x2f79('0xa0')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer[_0x2f79('0x1c')][_0x2f79('0x14c')]=function(_0x2baf52){return Promise['resolve']()[_0x2f79('0x40')](cmHopper[_0x2f79('0x147')](_0x2baf52['id'],previewRecallmeReminderInterval))[_0x2f79('0x40')](function(_0x51351b){for(var _0x541694=0x0;_0x541694<_0x51351b[_0x2f79('0x146')];_0x541694++){var _0x3d36ef=_0x51351b[_0x541694][_0x2f79('0x149')]['name'];if(_0x3d36ef)io['to'](util[_0x2f79('0x87')](_0x2f79('0x14a'),_0x3d36ef))['emit'](_0x2f79('0x14b'),{'hopper':_0x51351b[_0x541694]});}})[_0x2f79('0xa0')](function(){});};Dialer[_0x2f79('0x1c')][_0x2f79('0xb2')]=function(_0x1764d7){var _0x3726c8=this;return function(){_0x3726c8['handleIvr'](_0x1764d7);};};Dialer['prototype']['actionOriginate']=function(_0x353feb,_0x25796f){var _0x393ef2=this;var _0x5f0d4e=uuid['v4']();this[_0x2f79('0x26')][_0x5f0d4e]=new Action(_0x353feb,_0x25796f,_0x5f0d4e);return new Promise(function(_0x569cd0,_0xf6ab8e){if(_[_0x2f79('0x42')](_0x353feb)&&typeof _0x353feb!=='object'){return _0xf6ab8e(msgResponse(_0x2f79('0x15b'),'Failure',_0x2f79('0x15c')));}if(_['isUndefined'](_0x25796f[_0x2f79('0x15d')])||_0x25796f['phone']===null){return _0xf6ab8e(msgResponse(_0x2f79('0x15b'),_0x2f79('0x93'),_0x2f79('0x15e')));}var _0x240969={'XMD-CALLERID':_0x393ef2[_0x2f79('0x26')][_0x5f0d4e][_0x2f79('0x15f')](),'XMD-AGI':_0x353feb[_0x2f79('0x12f')]?util[_0x2f79('0x87')]('\x22agi://%s/square,%s\x22',ipAgi,_0x353feb['dialQueueProject']):_0x2f79('0x160'),'XMD-AGIAFTER':_0x353feb[_0x2f79('0xc6')]?util[_0x2f79('0x87')](_0x2f79('0x161'),ipAgi,_0x353feb[_0x2f79('0xc6')]):_0x2f79('0x160'),'XMD-QUEUE':utils[_0x2f79('0x162')](_0x353feb)?util[_0x2f79('0x87')](_0x2f79('0x163'),_0x353feb[_0x2f79('0x63')],_0x353feb[_0x2f79('0x164')]||'',_0x353feb[_0x2f79('0xc7')]?'c':'',_0x353feb[_0x2f79('0x165')]||0x3):_0x2f79('0x160'),'XMD-CONTACTID':_0x25796f['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x393ef2[_0x2f79('0x26')][_0x5f0d4e][_0x2f79('0x15f')](),'XMD-AMD':_0x353feb[_0x2f79('0x119')]?_0x2f79('0x13d'):'NONE','XMD-DESTINATION':_0x2f79('0x10f')};if(_0x353feb[_0x2f79('0x119')]){_0x240969[_0x2f79('0x166')]=_0x353feb[_0x2f79('0x167')]||0x9c4;_0x240969[_0x2f79('0x168')]=_0x353feb['dialAMDGreeting']||0x5dc;_0x240969[_0x2f79('0x169')]=_0x353feb[_0x2f79('0x16a')]||0x320;_0x240969[_0x2f79('0x16b')]=_0x353feb['dialAMDTotalAnalysisTime']||0x1388;_0x240969[_0x2f79('0x16c')]=_0x353feb[_0x2f79('0x16d')]||0x64;_0x240969[_0x2f79('0x16e')]=_0x353feb['dialAMDBetweenWordsSilence']||0x32;_0x240969[_0x2f79('0x16f')]=_0x353feb[_0x2f79('0x170')]||0x3;_0x240969[_0x2f79('0x171')]=_0x353feb[_0x2f79('0x172')]||0x100;_0x240969[_0x2f79('0x173')]=_0x353feb[_0x2f79('0x174')]||0x1388;}if(utils[_0x2f79('0x162')](_0x353feb)){_0x240969[_0x2f79('0x175')]=_0x25796f[_0x2f79('0xe1')];}else{_0x240969['XMD-CAMPAIGNID']=_0x25796f[_0x2f79('0xe2')];}var _0x11efcf=utils['setXMDContactVariables'](_0x25796f[_0x2f79('0x176')]);Object[_0x2f79('0x141')](_0x240969,_0x11efcf);var _0x2fe0ff=_0x393ef2[_0x2f79('0x85')](_0x353feb[_0x2f79('0x8c')])?utils['getCallerId'](_0x353feb[_0x2f79('0x8c')]['callerid'],_0x353feb[_0x2f79('0x177')],_0x353feb[_0x2f79('0x178')]>0x0?utils[_0x2f79('0x179')](_0x353feb[_0x2f79('0x17a')],_0x353feb[_0x2f79('0x178')]):_0x353feb[_0x2f79('0x17a')]):utils[_0x2f79('0x17b')](_[_0x2f79('0xf7')](_0x353feb['TrunkBackup'])?_0x353feb[_0x2f79('0x8c')][_0x2f79('0x17c')]:_0x353feb[_0x2f79('0x8d')][_0x2f79('0x17c')],_0x353feb[_0x2f79('0x177')],_0x353feb['dialRandomLastDigitCallerIdNumber']>0x0?utils[_0x2f79('0x179')](_0x353feb['dialOriginateCallerIdNumber'],_0x353feb[_0x2f79('0x178')]):_0x353feb[_0x2f79('0x17a')]);if(_0x2fe0ff){_0x240969[_0x2f79('0x17d')]=_0x393ef2[_0x2f79('0x26')][_0x5f0d4e][_0x2f79('0x17e')]=utils[_0x2f79('0x17f')](_0x2fe0ff);_0x240969[_0x2f79('0x180')]=_0x25796f[_0x2f79('0x15d')];}_0x353feb[_0x2f79('0x181')]=_0x240969;return ami[_0x2f79('0x9a')]({'actionid':_0x5f0d4e,'action':_0x2f79('0x15b'),'channel':_0x393ef2[_0x2f79('0x85')](_0x353feb[_0x2f79('0x8c')])?util[_0x2f79('0x87')]('SIP/%s/%s%s',_0x353feb['Trunk']['name'],isNotNull(_0x353feb[_0x2f79('0x182')])?_0x353feb[_0x2f79('0x182')][_0x2f79('0x183')]()||'':'',_0x353feb[_0x2f79('0x184')]>0x0?_0x25796f[_0x2f79('0x15d')]['substring'](_0x353feb[_0x2f79('0x184')]):_0x25796f['phone']):util[_0x2f79('0x87')](_0x2f79('0x185'),_['isNil'](_0x353feb[_0x2f79('0x8d')])?_0x353feb[_0x2f79('0x8c')][_0x2f79('0x63')]:_0x353feb['TrunkBackup'][_0x2f79('0x63')],isNotNull(_0x353feb[_0x2f79('0x182')])?_0x353feb[_0x2f79('0x182')]['trim']()||'':'',_0x353feb['dialCutDigit']>0x0?_0x25796f[_0x2f79('0x15d')][_0x2f79('0x186')](_0x353feb['dialCutDigit']):_0x25796f[_0x2f79('0x15d')]),'callerid':_0x2fe0ff,'Exten':'xcally-motion-dialer','Context':_0x2f79('0x187'),'Priority':'1','variable':_0x240969,'timeout':(_0x353feb[_0x2f79('0x188')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5f0d4e})['then'](function(_0x4d1830){return _0x569cd0(_0x4d1830);})['catch'](function(_0x5ccca4){_0x353feb[_0x2f79('0x189')]+=0x1;var _0x49f175=new History(_0x393ef2[_0x2f79('0x26')][_0x5f0d4e]);logger[_0x2f79('0x67')](util[_0x2f79('0x87')](_0x2f79('0x18a'),JSON[_0x2f79('0x75')](_0x5ccca4)));_0x49f175[_0x2f79('0x6f')]=0xe;_0x49f175[_0x2f79('0xe9')]='OriginateError';_0x49f175['starttime']=moment()['format'](_0x2f79('0xc3'));_0x49f175[_0x2f79('0x70')]=_0x49f175[_0x2f79('0x71')];hopperUtils[_0x2f79('0xe7')](_0x49f175)[_0x2f79('0xa0')](loggerCatch(_0x2f79('0x18b')));_0x393ef2['moveContactManagedDialer'](_0x49f175)[_0x2f79('0xa0')](loggerCatch(_0x2f79('0x18b')))[_0x2f79('0x1f')](function(){delete _0x393ef2[_0x2f79('0x26')][_0x5f0d4e];return _0xf6ab8e(msgResponse(_0x2f79('0x15b'),_0x2f79('0x84'),_0x2f79('0x18c')));});});});};Dialer[_0x2f79('0x1c')][_0x2f79('0x18d')]=function(_0x2b0959,_0x6af241,_0x3849fe){var _0x4e5591=new History(_0x6af241);if(_0x4e5591['countbusyretry']+_0x4e5591[_0x2f79('0x129')]+_0x4e5591['countnoanswerretry']+_0x4e5591[_0x2f79('0x121')]+_0x4e5591[_0x2f79('0xd4')]+_0x4e5591['countabandonedretry']+_0x4e5591[_0x2f79('0x11b')]+_0x4e5591[_0x2f79('0x122')]>=_0x3849fe[_0x2f79('0x18e')]-0x1){return!![];}switch(_0x2b0959){case 0x3:if(_0x4e5591[_0x2f79('0x120')]>=_0x3849fe[_0x2f79('0x18f')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countnoanswerretry':_0x4e5591[_0x2f79('0x120')]+=0x1,'scheduledat':moment()[_0x2f79('0xef')](_0x3849fe[_0x2f79('0x190')],_0x2f79('0xde'))[_0x2f79('0x87')](_0x2f79('0xc3')),'ContactId':_0x4e5591[_0x2f79('0xdf')],'ListId':_0x4e5591[_0x2f79('0xe0')],'VoiceQueueId':_0x4e5591['VoiceQueueId']||undefined,'CampaignId':_0x4e5591[_0x2f79('0xe2')]||undefined})[_0x2f79('0xa0')](loggerCatch(_0x2f79('0x191')));break;case 0x5:if(_0x4e5591[_0x2f79('0x11f')]>=_0x3849fe[_0x2f79('0x192')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countbusyretry':_0x4e5591[_0x2f79('0x11f')]+=0x1,'scheduledat':moment()[_0x2f79('0xef')](_0x3849fe[_0x2f79('0x193')],_0x2f79('0xde'))[_0x2f79('0x87')](_0x2f79('0xc3')),'ContactId':_0x4e5591[_0x2f79('0xdf')],'ListId':_0x4e5591['ListId'],'VoiceQueueId':_0x4e5591['VoiceQueueId']||undefined,'CampaignId':_0x4e5591[_0x2f79('0xe2')]||undefined})[_0x2f79('0xa0')](loggerCatch(_0x2f79('0x194')));break;case 0x8:if(_0x4e5591['countcongestionretry']>=_0x3849fe[_0x2f79('0x195')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countcongestionretry':_0x4e5591[_0x2f79('0x129')]+=0x1,'scheduledat':moment()[_0x2f79('0xef')](_0x3849fe[_0x2f79('0x196')],_0x2f79('0xde'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4e5591[_0x2f79('0xdf')],'ListId':_0x4e5591[_0x2f79('0xe0')],'VoiceQueueId':_0x4e5591[_0x2f79('0xe1')]||undefined,'CampaignId':_0x4e5591[_0x2f79('0xe2')]||undefined})[_0x2f79('0xa0')](loggerCatch(_0x2f79('0x197')));break;case 0x0:if(_0x4e5591[_0x2f79('0x121')]>=_0x3849fe[_0x2f79('0x198')]-0x1){return!![];}else{hopperUtils[_0x2f79('0xdd')]({'active':![],'countnosuchnumberretry':_0x4e5591['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0x2f79('0xef')](_0x3849fe[_0x2f79('0x199')],_0x2f79('0xde'))[_0x2f79('0x87')](_0x2f79('0xc3')),'ContactId':_0x4e5591[_0x2f79('0xdf')],'ListId':_0x4e5591['ListId'],'VoiceQueueId':_0x4e5591[_0x2f79('0xe1')]||undefined,'CampaignId':_0x4e5591[_0x2f79('0xe2')]||undefined})['catch'](loggerCatch(_0x2f79('0x19a')));}break;case 0xa:if(_0x4e5591['countdropretry']>=_0x3849fe[_0x2f79('0xdb')]-0x1){return!![];}hopperUtils[_0x2f79('0xdd')]({'active':![],'countdropretry':_0x4e5591[_0x2f79('0xd4')]+=0x1,'scheduledat':moment()['add'](_0x3849fe[_0x2f79('0xd6')],_0x2f79('0xde'))['format'](_0x2f79('0xc3')),'ContactId':_0x4e5591[_0x2f79('0xdf')],'ListId':_0x4e5591[_0x2f79('0xe0')],'VoiceQueueId':_0x4e5591[_0x2f79('0xe1')]||undefined,'CampaignId':_0x4e5591[_0x2f79('0xe2')]||undefined})[_0x2f79('0xa0')](loggerCatch(_0x2f79('0xe3')));break;case 0xb:if(_0x4e5591[_0x2f79('0xec')]>=_0x3849fe[_0x2f79('0xee')]-0x1){return!![];}hopperUtils[_0x2f79('0xdd')]({'active':![],'countabandonedretry':_0x4e5591[_0x2f79('0xec')]+=0x1,'scheduledat':moment()['add'](_0x3849fe['dialAbandonedRetryFrequency'],_0x2f79('0xde'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4e5591['ContactId'],'ListId':_0x4e5591[_0x2f79('0xe0')],'VoiceQueueId':_0x4e5591[_0x2f79('0xe1')]||undefined,'CampaignId':_0x4e5591['CampaignId']||undefined})[_0x2f79('0xa0')](loggerCatch(_0x2f79('0x19b')));break;case 0x13:if(_0x4e5591['countmachineretry']>=_0x3849fe[_0x2f79('0x12a')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x4e5591['countmachineretry']+=0x1,'scheduledat':moment()[_0x2f79('0xef')](_0x3849fe[_0x2f79('0x12b')],_0x2f79('0xde'))[_0x2f79('0x87')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4e5591[_0x2f79('0xdf')],'ListId':_0x4e5591['ListId'],'VoiceQueueId':_0x4e5591[_0x2f79('0xe1')]||undefined,'CampaignId':_0x4e5591[_0x2f79('0xe2')]||undefined})[_0x2f79('0xa0')](loggerCatch(_0x2f79('0x127')));break;case 0x14:if(_0x4e5591['countagentrejectretry']>=_0x3849fe[_0x2f79('0x19c')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countagentrejectretry':_0x4e5591['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x2f79('0xef')](_0x3849fe[_0x2f79('0x19d')],'minutes')[_0x2f79('0x87')](_0x2f79('0xc3')),'ContactId':_0x4e5591[_0x2f79('0xdf')],'ListId':_0x4e5591[_0x2f79('0xe0')],'VoiceQueueId':_0x4e5591[_0x2f79('0xe1')]||undefined,'CampaignId':_0x4e5591[_0x2f79('0xe2')]||undefined})[_0x2f79('0xa0')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer['prototype']['callProgressDetecting']=function(_0x24f656,_0x417896,_0x136716){var _0x9d1177=this;var _0x1f9d04=new History(_0x24f656);var _0x3c72ce=![];var _0x129c08;var _0x27e9e8;return new Promise(function(_0x1b7f14,_0x46dad4){if(_[_0x2f79('0x42')](_0x417896)&&typeof _0x417896!==_0x2f79('0x19e')){return _0x46dad4(msgResponse(_0x2f79('0x19f'),_0x2f79('0x93'),'entity\x20is\x20undefine'));}if(_[_0x2f79('0x42')](_0x136716)&&typeof _0x136716!==_0x2f79('0x19e')){return _0x46dad4(msgResponse('[callProgressDetecting]',_0x2f79('0x93'),_0x2f79('0x1a0')));}hopperUtils[_0x2f79('0xd8')](_0x1f9d04,_0x136716[_0x2f79('0x1a1')],_0x417896)['then'](function(_0x5dee92){if(_0x5dee92[_0x2f79('0xda')]==0x1)_0x3c72ce=!![];switch(_0x136716[_0x2f79('0x1a1')]){case'0':_0x417896[_0x2f79('0x1a2')]+=0x1;_0x1f9d04[_0x2f79('0x6f')]=0x0;_0x1f9d04[_0x2f79('0xe9')]=_0x2f79('0x1a3');_0x1f9d04[_0x2f79('0x121')]+=0x1;_0x1f9d04[_0x2f79('0xd5')]+=0x1;ami[_0x2f79('0x43')](_0x2f79('0x1a4'),ut[_0x2f79('0x116')](_0x24f656,_0x2f79('0x1a5')));_0x129c08=_0x417896[_0x2f79('0x199')];_0x27e9e8=_0x417896[_0x2f79('0xd7')];hopperUtils[_0x2f79('0xe7')](_0x1f9d04)[_0x2f79('0xa0')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x9d1177[_0x2f79('0x18d')](0x0,_0x24f656,_0x417896)&&!_0x3c72ce){if(_0x1f9d04['countnosuchnumberretry']>=_0x417896[_0x2f79('0x198')]){_0x9d1177['createStateFinal'](_0x1f9d04,_0x1b7f14,_0x46dad4,_0x2f79('0x1a6'));}else{_0x9d1177[_0x2f79('0x123')](_0x1f9d04,_0x1b7f14,_0x46dad4,_0x2f79('0x1a6'));}}break;case'3':_0x417896[_0x2f79('0x1a7')]+=0x1;_0x1f9d04['state']=0x3;_0x1f9d04['statedesc']='NoAnswer';_0x1f9d04[_0x2f79('0x120')]+=0x1;_0x1f9d04['countglobal']+=0x1;var _0x3ef606=ut[_0x2f79('0x1a8')](_0x24f656,_0x417896);ami[_0x2f79('0x43')]('custom:agentnoanswer',_0x3ef606);_0x129c08=_0x417896[_0x2f79('0x190')];_0x27e9e8=_0x417896[_0x2f79('0xd7')];hopperUtils[_0x2f79('0xe7')](_0x1f9d04)['catch'](loggerCatch(_0x2f79('0x1a9')));if(_0x9d1177[_0x2f79('0x18d')](0x3,_0x24f656,_0x417896)&&!_0x3c72ce){if(_0x1f9d04['countnoanswerretry']>=_0x417896[_0x2f79('0x18f')]){_0x9d1177[_0x2f79('0x125')](_0x1f9d04,_0x1b7f14,_0x46dad4,_0x2f79('0x1aa'));}else{_0x9d1177[_0x2f79('0x123')](_0x1f9d04,_0x1b7f14,_0x46dad4,_0x2f79('0x1aa'));}}break;case'5':_0x417896[_0x2f79('0x1ab')]+=0x1;_0x1f9d04['state']=0x5;_0x1f9d04[_0x2f79('0xe9')]=_0x2f79('0x1ac');_0x1f9d04['countbusyretry']+=0x1;_0x1f9d04[_0x2f79('0xd5')]+=0x1;ami[_0x2f79('0x43')](_0x2f79('0x1ad'),ut[_0x2f79('0x116')](_0x24f656,'busy'));_0x129c08=_0x417896['dialBusyRetryFrequency'];_0x27e9e8=_0x417896[_0x2f79('0xd7')];hopperUtils[_0x2f79('0xe7')](_0x1f9d04)[_0x2f79('0xa0')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x9d1177[_0x2f79('0x18d')](0x5,_0x24f656,_0x417896)&&!_0x3c72ce){if(_0x1f9d04[_0x2f79('0x11f')]>=_0x417896[_0x2f79('0x192')]){_0x9d1177[_0x2f79('0x125')](_0x1f9d04,_0x1b7f14,_0x46dad4,'reason\x205\x20busy');}else{_0x9d1177[_0x2f79('0x123')](_0x1f9d04,_0x1b7f14,_0x46dad4,_0x2f79('0x1ae'));}}break;case'8':_0x417896[_0x2f79('0x1af')]+=0x1;_0x1f9d04[_0x2f79('0x6f')]=0x8;_0x1f9d04['statedesc']=_0x2f79('0x1b0');_0x1f9d04[_0x2f79('0x129')]+=0x1;_0x1f9d04[_0x2f79('0xd5')]+=0x1;_0x129c08=_0x417896[_0x2f79('0x196')];_0x27e9e8=_0x417896[_0x2f79('0xd7')];ami['emit'](_0x2f79('0x1b1'),ut[_0x2f79('0x116')](_0x24f656,_0x2f79('0x1b2')));hopperUtils[_0x2f79('0xe7')](_0x1f9d04)[_0x2f79('0xa0')](loggerCatch(_0x2f79('0x1b3')));if(_0x9d1177[_0x2f79('0x18d')](0x8,_0x24f656,_0x417896)&&!_0x3c72ce){if(_0x1f9d04[_0x2f79('0x129')]>=_0x417896[_0x2f79('0x195')]){_0x9d1177[_0x2f79('0x125')](_0x1f9d04,_0x1b7f14,_0x46dad4,'reason\x208\x20congestion');}else{_0x9d1177[_0x2f79('0x123')](_0x1f9d04,_0x1b7f14,_0x46dad4,_0x2f79('0x1b4'));}}break;case'11':_0x417896[_0x2f79('0x1b5')]+=0x1;_0x1f9d04['state']=0xb;_0x1f9d04['statedesc']='Abandoned';_0x1f9d04[_0x2f79('0xec')]+=0x1;_0x1f9d04[_0x2f79('0xd5')]+=0x1;_0x129c08=_0x417896['dialAbandonedRetryFrequency'];_0x27e9e8=_0x417896[_0x2f79('0xd7')];hopperUtils[_0x2f79('0xe7')](_0x1f9d04)[_0x2f79('0xa0')](loggerCatch(_0x2f79('0xf0')));if(_0x9d1177[_0x2f79('0x18d')](0xb,_0x24f656,_0x417896)&&!_0x3c72ce){if(_0x1f9d04[_0x2f79('0xec')]>=_0x417896[_0x2f79('0xee')]){_0x9d1177[_0x2f79('0x125')](_0x1f9d04,_0x1b7f14,_0x46dad4,_0x2f79('0x1b6'));}else{_0x9d1177[_0x2f79('0x123')](_0x1f9d04,_0x1b7f14,_0x46dad4,_0x2f79('0x1b6'));}}break;case'20':_0x417896[_0x2f79('0x1b7')]+=0x1;_0x1f9d04[_0x2f79('0x6f')]=0x14;_0x1f9d04['statedesc']='AgentReject';_0x1f9d04[_0x2f79('0x122')]+=0x1;_0x1f9d04['countglobal']+=0x1;_0x129c08=_0x417896[_0x2f79('0x19d')];_0x27e9e8=_0x417896['callAdditionalPhoneAfterMin'];ami[_0x2f79('0x43')](_0x2f79('0x1b8'),ut[_0x2f79('0x116')](_0x24f656,_0x2f79('0x1b9')));hopperUtils[_0x2f79('0xe7')](_0x1f9d04)[_0x2f79('0xa0')](loggerCatch(_0x2f79('0x1ba')));if(_0x9d1177[_0x2f79('0x18d')](0x14,_0x24f656,_0x417896)&&!_0x3c72ce){if(_0x1f9d04[_0x2f79('0x122')]>=_0x417896[_0x2f79('0x19c')]){_0x9d1177[_0x2f79('0x125')](_0x1f9d04,_0x1b7f14,_0x46dad4,_0x2f79('0x1bb'));}else{_0x9d1177[_0x2f79('0x123')](_0x1f9d04,_0x1b7f14,_0x46dad4,_0x2f79('0x1bb'));}}break;default:_0x417896[_0x2f79('0x1bc')]+=0x1;_0x1f9d04[_0x2f79('0x6f')]=0xc;_0x1f9d04[_0x2f79('0xe9')]=_0x136716[_0x2f79('0x1a1')];_0x129c08=_0x417896[_0x2f79('0x19d')];_0x27e9e8=_0x417896[_0x2f79('0xd7')];hopperUtils['createHistory'](_0x1f9d04)[_0x2f79('0xa0')](loggerCatch(_0x2f79('0x1bd')));if(_0x9d1177[_0x2f79('0x18d')](_0x136716[_0x2f79('0x1a1')],_0x24f656,_0x417896)&&!_0x3c72ce){if(_0x1f9d04[_0x2f79('0x11f')]+_0x1f9d04[_0x2f79('0x129')]+_0x1f9d04[_0x2f79('0x120')]+_0x1f9d04['countnosuchnumberretry']+_0x1f9d04[_0x2f79('0xd4')]+_0x1f9d04['countabandonedretry']+_0x1f9d04['countmachineretry']+_0x1f9d04[_0x2f79('0x122')]>=_0x417896[_0x2f79('0x18e')]){_0x9d1177[_0x2f79('0x123')](_0x1f9d04,_0x1b7f14,_0x46dad4,_0x136716['reason']);}else{_0x9d1177[_0x2f79('0x125')](_0x1f9d04,_0x1b7f14,_0x46dad4,_0x136716['reason']);}}}})[_0x2f79('0x40')](function(){if(_0x3c72ce){hopperUtils[_0x2f79('0xf1')](_0x1f9d04,_0x129c08,_0x27e9e8)[_0x2f79('0x40')](function(){return _0x1b7f14(0x1);});}});});};Dialer[_0x2f79('0x1c')][_0x2f79('0x123')]=function(_0x24c2de,_0x19ca27,_0x3f7c81,_0x4d5b75){var _0x4c68d6=new Final(_0x24c2de);_0x4c68d6['state']=0xf;_0x4c68d6['statedesc']=_0x2f79('0x1be');this[_0x2f79('0x125')](_0x4c68d6,_0x19ca27,_0x3f7c81,_0x4d5b75);};Dialer['prototype']['createStateFinal']=function(_0x526d23,_0x5d9011,_0x156c06,_0x2ab74d){hopperUtils['moveContactManagedDialer'](_0x526d23)[_0x2f79('0x40')](function(){return _0x5d9011(msgResponse(_0x2f79('0x19f'),'Success',_0x2ab74d));})[_0x2f79('0xa0')](function(){return _0x156c06(msgResponse(_0x2f79('0x1bf'),'Failure',_0x2f79('0x1c0')));});};Dialer[_0x2f79('0x1c')][_0x2f79('0xa')]=function(_0x25a956){var _0x496b8f=_0x25a956['dialPredictiveOptimizationPercentage']/0x64;var _0x474916=_0x25a956[_0x2f79('0x1c1')]/(_0x25a956[_0x2f79('0x1c1')]+_0x25a956[_0x2f79('0xc4')]);var _0x4c9bfb=Math[_0x2f79('0x1c2')](_0x25a956['predictiveIntervalAvailable']*(_0x25a956['predictiveIntervalMaxThreshold']/0x64));var _0x1bb8a3=Math['round'](_0x25a956[_0x2f79('0x1c3')]*(_0x25a956[_0x2f79('0x1c4')]/0x64));var _0x5412f5=_0x25a956[_0x2f79('0x139')]+_0x25a956[_0x2f79('0x13b')];var _0x218dee=Math[_0x2f79('0x1c5')](_0x25a956[_0x2f79('0x1c6')]*_0x25a956[_0x2f79('0x60')]*_0x25a956[_0x2f79('0x1c7')]*_0x25a956[_0x2f79('0x1c8')]);if(_[_0x2f79('0x42')](_0x25a956[_0x2f79('0x62')])){if(!_[_0x2f79('0x42')](_0x25a956['startPredictive'])){_0x25a956[_0x2f79('0x29')]=undefined;loggerPredictive[_0x2f79('0x67')](_0x2f79('0x1c9'),_0x2f79('0x1ca'));}if(!_['isUndefined'](_0x25a956[_0x2f79('0x66')])){loggerPredictive[_0x2f79('0x67')](_0x2f79('0x1c9'),_0x2f79('0x1cb'));clearInterval(_0x25a956[_0x2f79('0x66')]);_0x25a956['handlePredictive']=undefined;}_0x25a956['startProgressive']=moment()[_0x2f79('0x87')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x2f79('0x4c')](_0x25a956['name'],_0x2f79('0x1cc'),_0x25a956['startProgressive']);this[_0x2f79('0xb6')](_0x25a956,0x1);}else if(ifInterval(_0x25a956[_0x2f79('0x1cd')],_0x25a956[_0x2f79('0x62')])){this[_0x2f79('0xb6')](_0x25a956,0x1);loggerPredictiveCalls[_0x2f79('0x4c')](_0x2f79('0x1ce'),_0x25a956['startProgressive'],_0x25a956[_0x2f79('0x63')]);_0x25a956[_0x2f79('0x1c6')]=0x0;_0x25a956[_0x2f79('0xd0')]=0x0;}else if(_0x496b8f<_0x474916&&_0x25a956['dialPredictiveOptimization']==='dropRate'){clearPredictiveAttributes(_0x25a956);loggerPredictive[_0x2f79('0x4c')](_0x2f79('0x1cf'),'Dropped\x20calls\x20day',_0x474916,_0x2f79('0x62'),_0x25a956[_0x2f79('0x63')]);}else if(_0x218dee<_0x25a956[_0x2f79('0xd0')]&&_0x25a956[_0x2f79('0x1d0')]===_0x2f79('0x1d1')){clearPredictiveAttributes(_0x25a956);loggerPredictive[_0x2f79('0x4c')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x2f79('0x1d2'),_0x218dee,_0x2f79('0x1d3'),_0x25a956['predictiveIntervalErlangCallsDroppedCalls'],_0x2f79('0x62'),_0x25a956[_0x2f79('0x63')]);}else if(!ifInterval(_0x25a956['dialPredictiveInterval'],_0x25a956['startProgressive'])&&_[_0x2f79('0x42')](_0x25a956['startPredictive'])&&!_[_0x2f79('0x42')](_0x25a956[_0x2f79('0x62')])){_0x25a956[_0x2f79('0x29')]=moment()[_0x2f79('0x87')](_0x2f79('0xc3'));loggerPredictive[_0x2f79('0x4c')](_0x25a956[_0x2f79('0x63')],'started\x20in\x20predictive\x20at',_0x25a956['startPredictive']);hopperUtils['avgHandleTime'](_0x25a956['dialPredictiveInterval'])[_0x2f79('0x40')](this['getDataPredictive'](_0x25a956))[_0x2f79('0x40')](mergeDataErlangB(_0x25a956))[_0x2f79('0x40')](this[_0x2f79('0x1d4')](_0x25a956))[_0x2f79('0xa0')](loggerCatchPredictive(_0x2f79('0x1d5'),_0x25a956));}else if(!ifInterval(_0x25a956[_0x2f79('0x1cd')],_0x25a956[_0x2f79('0x29')])){_0x25a956[_0x2f79('0xd0')]=0x0;_0x25a956['startPredictive']=moment()[_0x2f79('0x87')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x2f79('0x4c')](_0x25a956[_0x2f79('0x63')],_0x2f79('0x1d6'),_0x25a956['startPredictive']);clearInterval(_0x25a956[_0x2f79('0x66')]);_0x25a956[_0x2f79('0x66')]=undefined;hopperUtils['avgHandleTime'](_0x25a956[_0x2f79('0x1cd')])['then'](this[_0x2f79('0x1d7')](_0x25a956))[_0x2f79('0x40')](mergeDataErlangB(_0x25a956))[_0x2f79('0x40')](this[_0x2f79('0x1d4')](_0x25a956))[_0x2f79('0xa0')](loggerCatchPredictive(_0x2f79('0x1d8'),_0x25a956));}else if(_0x25a956['predictiveIntervalAvailable']&&_0x5412f5<_0x25a956[_0x2f79('0x1c3')]-_0x1bb8a3){clearPredictiveAttributes(_0x25a956);loggerPredictive[_0x2f79('0x4c')](_0x25a956[_0x2f79('0x63')],_0x2f79('0x1d9'),_0x5412f5,_0x2f79('0x1da'),_0x25a956[_0x2f79('0x1c3')],'-',_0x1bb8a3,'=',_0x25a956[_0x2f79('0x1c3')]-_0x1bb8a3,')');}else if(_0x25a956['predictiveIntervalAvailable']&&_0x5412f5>_0x25a956[_0x2f79('0x1c3')]+_0x4c9bfb){clearPredictiveAttributes(_0x25a956);loggerPredictive[_0x2f79('0x4c')](_0x25a956[_0x2f79('0x63')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x5412f5,')\x20are\x20more\x20than\x20threshold\x20(',_0x25a956[_0x2f79('0x1c3')],'+',_0x4c9bfb,'=',_0x25a956['predictiveIntervalAvailable']+_0x4c9bfb,')');}};Dialer['prototype'][_0x2f79('0x1d7')]=function(_0x2bb263){var _0x11a245=this;return function(_0x147581){return new Promise(function(_0x28c6ab,_0x57c94d){_[_0x2f79('0x61')](_0x2bb263,_0x147581[0x0]);if(checkGetDataPredictive(_0x147581[0x0])){var _0xd760b6=_0x2bb263[_0x2f79('0x1c3')]=_0x2bb263['talking']+_0x2bb263[_0x2f79('0x139')];var _0x27a2ce=_0x2bb263[_0x2f79('0x1cd')]*0x3c;var _0x2a11fc=_0x147581[0x0][_0x2f79('0x56')]+_0x147581[0x0][_0x2f79('0x54')];var _0x5f1b1b=(_0x147581[0x0][_0x2f79('0x4f')]+_0x147581[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x147581[0x0][_0x2f79('0x52')])/_0x147581[0x0][_0x2f79('0x4e')];_0x2bb263['predictiveIntervalHitRate']=_0x5f1b1b>0x0?_0x5f1b1b:0x1;switch(_0x2bb263['dialPredictiveOptimization']){case _0x2f79('0x1d1'):var _0x212e29=_0x2bb263[_0x2f79('0x1db')]/0x64;return _0x11a245[_0x2f79('0x1dc')](_0xd760b6,_0x27a2ce,_0x2a11fc,_0x5f1b1b,_0x212e29)[_0x2f79('0x40')](function(_0x3d364a){return _0x28c6ab(_0x3d364a);});case'agentBusyFactor':var _0x57c5f4=_0x2bb263[_0x2f79('0x1db')]/0x64;return _0x11a245['busyFactor'](_0xd760b6,_0x27a2ce,_0x2a11fc,_0x5f1b1b,_0x57c5f4)[_0x2f79('0x40')](function(_0x1f9c4a){return _0x28c6ab(_0x1f9c4a);});default:return _0x57c94d(msgResponse(_0x2f79('0x1dd'),_0x2f79('0x93'),_0x2f79('0x1de')));}}else{return _0x57c94d(msgResponse(_0x2f79('0x1dd'),_0x2f79('0x93'),'check\x20failure'));}});};};Dialer[_0x2f79('0x1c')][_0x2f79('0x1df')]=function(_0xd241d8){var _0x43a41e=this;return function(_0x4714c1){return new Promise(function(_0x251b60,_0x590c0e){_[_0x2f79('0x61')](_0xd241d8,_0x4714c1[0x0]);if(checkGetDataPredictive(_0x4714c1[0x0])){loggerPredictive[_0x2f79('0x4c')](JSON[_0x2f79('0x75')](_0x4714c1[0x0]));if(_0xd241d8[_0x2f79('0x1d0')]===_0x2f79('0x1d1')){return _0x43a41e[_0x2f79('0x154')](_0xd241d8['id'])[_0x2f79('0x40')](function(_0x51a8b9){var _0xc25fe6=_0xd241d8[_0x2f79('0x1e0')]-_0x51a8b9[0x0][_0x2f79('0x1e1')];var _0x430a45=_0xd241d8[_0x2f79('0x1cd')]*0x3c;var _0xaa994f=_0x4714c1[0x0][_0x2f79('0x56')]+_0x4714c1[0x0][_0x2f79('0x54')];var _0x580253=(_0x4714c1[0x0][_0x2f79('0x4f')]+_0x4714c1[0x0][_0x2f79('0xcf')]+_0x4714c1[0x0][_0x2f79('0x52')])/_0x4714c1[0x0]['predictiveIntervalTotalCalls'];var _0x336f27=_0xd241d8['dialPredictiveOptimizationPercentage']/0x64;_0xd241d8[_0x2f79('0x1e2')]=_0x51a8b9[0x0][_0x2f79('0x1e1')]||0x0;_0xd241d8[_0x2f79('0x1c7')]=_0x580253>0x0?_0x580253:0x1;return _0x43a41e['abandonmentRate'](_0xc25fe6,_0x430a45,_0xaa994f,_0x580253,_0x336f27);})[_0x2f79('0x40')](function(_0x155f4c){return _0x251b60(_0x155f4c);})[_0x2f79('0xa0')](function(_0x2cf4e5){return _0x590c0e(msgResponse(_0x2f79('0x1e3'),'Failure',JSON[_0x2f79('0x75')](_0x2cf4e5)));});}if(_0xd241d8[_0x2f79('0x1d0')]===_0x2f79('0x1e4')){return _0x43a41e[_0x2f79('0x154')](_0xd241d8['id'])['then'](function(_0x4e34e6){var _0xfd5219=_0xd241d8['loggedIn']-_0x4e34e6[0x0][_0x2f79('0x1e1')];var _0x1157a0=_0xd241d8['dialPredictiveInterval']*0x3c;var _0x3bbade=_0x4714c1[0x0][_0x2f79('0x56')]+_0x4714c1[0x0]['predictiveIntervalAvgHoldtime'];var _0x27fdbe=(_0x4714c1[0x0][_0x2f79('0x4f')]+_0x4714c1[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x4714c1[0x0][_0x2f79('0x52')])/_0x4714c1[0x0]['predictiveIntervalTotalCalls'];var _0x330fbb=_0xd241d8[_0x2f79('0x1db')]/0x64;_0xd241d8[_0x2f79('0x1e2')]=_0x4e34e6[0x0][_0x2f79('0x1e1')]||0x0;_0xd241d8[_0x2f79('0x1c7')]=_0x27fdbe>0x0?_0x27fdbe:0x1;return _0x43a41e[_0x2f79('0x1e5')](_0xfd5219,_0x1157a0,_0x3bbade,_0x27fdbe,_0x330fbb);})[_0x2f79('0x40')](function(_0x569d71){return _0x251b60(_0x569d71);})[_0x2f79('0xa0')](function(_0x3e325e){return _0x590c0e(msgResponse('[CatchErlangB]',_0x2f79('0x93'),JSON[_0x2f79('0x75')](_0x3e325e)));});}}else{return _0x590c0e(msgResponse('[getDataPredictive]',_0x2f79('0x93'),_0x2f79('0x1e6')));}});};};Dialer['prototype']['startMethodPredictive']=function(_0x1d522c){var _0x55855e=this;return function(){var _0x584bc8=0x0;var _0x16d7a0=Math[_0x2f79('0x1c5')](_0x1d522c[_0x2f79('0x5e')]*0x3e8);if(_0x16d7a0>0x0){_0x16d7a0=_0x16d7a0<0x64?0x64:_0x16d7a0;loggerPredictive['info'](_0x1d522c['name'],_0x2f79('0x1e7'),_0x16d7a0,_0x2f79('0x1e8'));_0x1d522c[_0x2f79('0x66')]=setInterval(function(){_0x55855e[_0x2f79('0x66')](_0x1d522c);loggerPredictiveCalls[_0x2f79('0x4c')](_0x2f79('0x1e9'),_0x584bc8+=0x1);},_0x16d7a0);}else{loggerPredictive[_0x2f79('0x4c')](_0x1d522c[_0x2f79('0x63')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x2f79('0x1c')][_0x2f79('0x1ea')]=function(_0x41de19,_0x471638){var _0x4b5259=this;return function(_0x4fb81e){if(_[_0x2f79('0x4b')](_0x4fb81e)){if(_[_0x2f79('0xf7')](_0x471638[_0x2f79('0x1eb')])||!_0x471638[_0x2f79('0x1ec')]){if(_0x41de19[_0x2f79('0xb4')]==='booked'){_0x41de19[_0x2f79('0x72')]=_['isUndefined'](_0x41de19[_0x2f79('0x72')])?!![]:_0x41de19[_0x2f79('0x72')];var _0x481e02=uuid['v4']();_0x4b5259[_0x2f79('0x26')][_0x481e02]=new Action(_0x41de19,_0x471638,_0x481e02);loggerBooked['info']('[booked][checkContactBlack]',_0x481e02,_0x2f79('0x1ed'),JSON['stringify'](_0x41de19[_0x2f79('0x72')]),_0x2f79('0x1ee'),_0x41de19[_0x2f79('0x63')]);if(_0x41de19['queueStatusComplete']){_0x41de19[_0x2f79('0x72')]=![];_0x4b5259[_0x2f79('0x2b')][_0x4b5259[_0x2f79('0x26')][_0x481e02]['queue']]=[];ami['Action']({'actionid':_0x481e02,'action':_0x2f79('0x1ef'),'queue':_0x41de19[_0x2f79('0x63')]})['catch'](function(){_0x4b5259[_0x2f79('0xcb')](_0x41de19);hopperUtils[_0x2f79('0xdd')]({'active':![],'ContactId':_0x4b5259[_0x2f79('0x26')][_0x481e02][_0x2f79('0xdf')],'ListId':_0x4b5259[_0x2f79('0x26')][_0x481e02][_0x2f79('0xe0')],'VoiceQueueId':_0x4b5259[_0x2f79('0x26')][_0x481e02]['VoiceQueueId']||undefined,'CampaignId':_0x4b5259[_0x2f79('0x26')][_0x481e02]['CampaignId']||undefined})[_0x2f79('0xa0')](loggerCatch(_0x2f79('0x1f0')));delete _0x4b5259[_0x2f79('0x26')][_0x481e02];});}else{loggerBooked['info']('[booked][checkContactBlack][else]',JSON[_0x2f79('0x75')](_0x41de19[_0x2f79('0x72')]),_0x2f79('0x1ee'),_0x41de19[_0x2f79('0x63')]);_0x4b5259['updateOriginated'](_0x41de19);hopperUtils[_0x2f79('0xdd')]({'active':![],'ContactId':_0x4b5259[_0x2f79('0x26')][_0x481e02]['ContactId'],'ListId':_0x4b5259[_0x2f79('0x26')][_0x481e02][_0x2f79('0xe0')],'VoiceQueueId':_0x4b5259[_0x2f79('0x26')][_0x481e02][_0x2f79('0xe1')]||undefined,'CampaignId':_0x4b5259[_0x2f79('0x26')][_0x481e02][_0x2f79('0xe2')]||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x4b5259[_0x2f79('0x26')][_0x481e02];}}else{return _0x4b5259['actionOriginate'](_0x41de19,_0x471638);}}else{if(utils['getSeconds'](undefined,_0x471638['scheduledat'])<_0x41de19[_0x2f79('0x1f1')]*0x3c){if(_0x471638['Agent']&&!_0x471638[_0x2f79('0x149')][_0x2f79('0x1f2')]){_0x4b5259['preview'][_0x2f79('0x1f3')](_0x471638['id'])[_0x2f79('0x1f')](function(){_0x4b5259['updateOriginated'](_0x41de19);});}else{hopperUtils[_0x2f79('0x1f4')]({'active':![]},_0x471638['id'],0x1)[_0x2f79('0x1f')](function(){_0x4b5259[_0x2f79('0xcb')](_0x41de19);});}}else{_0x41de19[_0x2f79('0x1f5')]+=0x1;_0x4b5259['updateOriginated'](_0x41de19);if(_0x41de19['dialRecallInQueue']){hopperUtils['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x471638[_0x2f79('0xdf')],'ListId':_0x471638[_0x2f79('0xe0')],'VoiceQueueId':_0x471638['VoiceQueueId']||undefined,'CampaignId':_0x471638[_0x2f79('0xe2')]||undefined})[_0x2f79('0xa0')](loggerCatch(_0x2f79('0x1f6')));hopperUtils[_0x2f79('0xe7')](createObjHistory(_0x41de19,_0x471638,utils[_0x2f79('0x6b')]['QUEUE_RECALL'],0x17,_0x2f79('0x1f7')))[_0x2f79('0xa0')](loggerCatch(_0x2f79('0x1f8')));}else{_0x4b5259[_0x2f79('0x117')](createObjHistory(_0x41de19,_0x471638,utils[_0x2f79('0x6b')]['RECALL_TIMEOUT'],0x16,_0x2f79('0x1f9')),_0x2f79('0x1fa'),_0x2f79('0x1fb'));}}}}else{_0x41de19[_0x2f79('0x1fc')]+=0x1;_0x4b5259[_0x2f79('0x117')](createObjHistory(_0x41de19,_0x471638,utils[_0x2f79('0x6b')][_0x2f79('0x1fd')],0xd,_0x2f79('0x1fe')),_0x2f79('0x1ff'),'[Originate][MoveBlacklist]');throw _0x2f79('0x200');}};};Dialer[_0x2f79('0x1c')][_0x2f79('0x201')]=function(_0x53f5b2){var _0x216a15=this;var _0x3f359b=_0x53f5b2['limitCalls']-_0x53f5b2[_0x2f79('0x7f')];emitCampaignSummary(_0x53f5b2);if(_0x3f359b>0x0&&_0x53f5b2[_0x2f79('0x202')]==0x0){if(_0x3f359b>this['maxNumberOriginate']){_0x3f359b=this[_0x2f79('0x203')];}_0x53f5b2[_0x2f79('0x202')]=0x1;hopperUtils[_0x2f79('0x204')](_0x53f5b2,_0x3f359b)['then'](function(_0x1abef8){_0x53f5b2[_0x2f79('0x202')]=0x0;if(_0x1abef8){if(!utils[_0x2f79('0x205')](_0x1abef8)){_0x53f5b2[_0x2f79('0x6a')]=utils[_0x2f79('0x6b')][_0x2f79('0x6d')];logger['info'](_0x2f79('0x206')+_0x53f5b2[_0x2f79('0x63')]);}else{_0x53f5b2[_0x2f79('0x7f')]+=_0x1abef8[_0x2f79('0x146')];_0x53f5b2[_0x2f79('0x6a')]=utils[_0x2f79('0x6b')]['RUNNING'];for(var _0x43255a=0x0;_0x43255a<_0x1abef8[_0x2f79('0x146')];_0x43255a+=0x1){_0x53f5b2[_0x2f79('0x207')]+=0x1;if(_[_0x2f79('0xf7')](_0x1abef8[_0x43255a])||_['isNil'](_0x1abef8[_0x43255a][_0x2f79('0x176')])||_[_0x2f79('0xf7')](_0x1abef8[_0x43255a][_0x2f79('0x15d')])){_0x216a15['emptyContact'](_0x2f79('0x208'),_0x53f5b2,_0x1abef8[_0x43255a]);}else{hopperUtils[_0x2f79('0x209')](_[_0x2f79('0x76')](_0x1abef8[_0x43255a],[_0x2f79('0xe2'),_0x2f79('0x15d')]))['then'](_0x216a15[_0x2f79('0x1ea')](_0x53f5b2,_0x1abef8[_0x43255a]))[_0x2f79('0xa0')](_0x216a15[_0x2f79('0x158')]('[actionOriginateIvr]\x20',_0x53f5b2));}}}}})[_0x2f79('0xa0')](loggerGetContactDialer(_0x2f79('0x20a'),_0x53f5b2,_0x3f359b));}};Dialer[_0x2f79('0x1c')][_0x2f79('0xb6')]=function(_0x13ca09,_0x496c20){var _0x38dacf=this;var _0x3f624a=[];if(_0x496c20<0x1||_0x13ca09[_0x2f79('0xb4')]==='booked'){_0x496c20=0x1;}var _0x30671f=Math[_0x2f79('0x1c5')](_0x13ca09[_0x2f79('0x139')]*_0x496c20)-_0x13ca09['originated'];if(_0x13ca09[_0x2f79('0x20b')]>0x0){var _0x21afc7=_0x13ca09[_0x2f79('0x20b')]-_0x13ca09[_0x2f79('0x7f')]-_0x13ca09[_0x2f79('0x13b')]-_0x13ca09[_0x2f79('0x13c')];if(_0x30671f>_0x21afc7){_0x30671f=_0x21afc7;}}if(_0x30671f>0x0&&_0x13ca09[_0x2f79('0x202')]==0x0){if(_0x13ca09[_0x2f79('0xb4')]==='booked'){_0x30671f=0x1;}if(_0x30671f>this[_0x2f79('0x203')]){_0x30671f=this[_0x2f79('0x203')];}for(var _0x256052 in this['agents']){if(typeof this[_0x2f79('0x24')][_0x256052]!==_0x2f79('0x150')){if(this['agents'][_0x256052][_0x2f79('0x6f')]==='not_inuse'&&this[_0x2f79('0x24')][_0x256052][_0x2f79('0x8a')]==='reachable'){_0x3f624a['push'](this[_0x2f79('0x24')][_0x256052]['id']);}}}_0x13ca09[_0x2f79('0x202')]=0x1;hopperUtils[_0x2f79('0x20c')](_0x13ca09,_0x3f624a,_0x30671f)[_0x2f79('0x40')](function(_0x3a904b){_0x13ca09[_0x2f79('0x202')]=0x0;if(_0x3a904b){if(!utils[_0x2f79('0x205')](_0x3a904b)){hopperUtils[_0x2f79('0x20d')](_0x13ca09)[_0x2f79('0x40')](sendMessageReschedule(_0x13ca09))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x13ca09[_0x2f79('0x7f')]+=_0x3a904b[_0x2f79('0x146')];_0x13ca09[_0x2f79('0x6a')]=_0x13ca09['dialMethod']===_0x2f79('0x9')?utils[_0x2f79('0x6b')][_0x2f79('0x13d')]:utils[_0x2f79('0x6b')][_0x2f79('0x20e')];for(var _0x1a8a95=0x0;_0x1a8a95<_0x3a904b[_0x2f79('0x146')];_0x1a8a95+=0x1){if(_[_0x2f79('0xf7')](_0x3a904b[_0x1a8a95])||_[_0x2f79('0xf7')](_0x3a904b[_0x1a8a95][_0x2f79('0x176')])||_[_0x2f79('0xf7')](_0x3a904b[_0x1a8a95][_0x2f79('0x15d')])){_0x38dacf[_0x2f79('0x159')](_0x2f79('0x208'),_0x13ca09,_0x3a904b[_0x1a8a95]);}else{hopperUtils[_0x2f79('0x20f')](_[_0x2f79('0x76')](_0x3a904b[_0x1a8a95],[_0x2f79('0xe1'),_0x2f79('0x15d')]))[_0x2f79('0x40')](_0x38dacf[_0x2f79('0x1ea')](_0x13ca09,_0x3a904b[_0x1a8a95]))[_0x2f79('0xa0')](_0x38dacf[_0x2f79('0x158')](_0x2f79('0x208'),_0x13ca09));}}}}})[_0x2f79('0xa0')](loggerGetContactDialer('[getContactDialer2]',_0x13ca09,_0x30671f));}};Dialer[_0x2f79('0x1c')]['handlePredictive']=function(_0x177897){if(_0x177897[_0x2f79('0x20b')]>0x0){var _0x42be56=_0x177897[_0x2f79('0x20b')]-_0x177897[_0x2f79('0x7f')]-_0x177897[_0x2f79('0x13b')];if(_0x42be56>0x0&&_0x177897['temp']==0x0){this['tryOriginatePredictive'](_0x177897);}else{loggerPredictiveCalls[_0x2f79('0x4c')](_0x2f79('0x210'));}}else{this[_0x2f79('0x211')](_0x177897);}};Dialer['prototype'][_0x2f79('0x211')]=function(_0xeccc44){var _0x464590=this;var _0x4f989b=[];_0xeccc44['originated']+=0x1;for(var _0xa41838 in this[_0x2f79('0x24')]){if(typeof this[_0x2f79('0x24')][_0xa41838]!==_0x2f79('0x150')){if(this[_0x2f79('0x24')][_0xa41838][_0x2f79('0x6f')]===_0x2f79('0x212')&&this[_0x2f79('0x24')][_0xa41838][_0x2f79('0x8a')]==='reachable'){_0x4f989b[_0x2f79('0x99')](this['agents'][_0xa41838]['id']);}}}_0xeccc44['temp']=0x1;return this[_0x2f79('0x20c')](_0xeccc44['id'],_0x4f989b,0x1,_0xeccc44[_0x2f79('0x213')],_0xeccc44)[_0x2f79('0x40')](function(_0x1dd5e1){_0xeccc44[_0x2f79('0x202')]=0x1;if(_0x1dd5e1){if(!utils[_0x2f79('0x205')](_0x1dd5e1)){utils['checkContactLowerLimitOriginate'](_0xeccc44,0x1,0x0);return hopperUtils[_0x2f79('0x20d')](_0xeccc44)[_0x2f79('0x40')](sendMessageReschedule(_0xeccc44))['catch'](loggerCatch(_0x2f79('0x214')));}else{_0xeccc44[_0x2f79('0x6a')]=utils[_0x2f79('0x6b')]['RUNNING'];if(_[_0x2f79('0xf7')](_0x1dd5e1[0x0])||_[_0x2f79('0xf7')](_0x1dd5e1[0x0]['Contact'])||_['isNil'](_0x1dd5e1[0x0][_0x2f79('0x15d')])){_0x464590[_0x2f79('0x159')](_0x2f79('0x208'),_0xeccc44,_0x1dd5e1[0x0]);}else{return hopperUtils[_0x2f79('0x20f')](_[_0x2f79('0x76')](_0x1dd5e1[0x0],[_0x2f79('0xe1'),_0x2f79('0x15d')]))[_0x2f79('0x40')](_0x464590[_0x2f79('0x1ea')](_0xeccc44,_0x1dd5e1[0x0]))[_0x2f79('0xa0')](_0x464590[_0x2f79('0x158')](_0x2f79('0x215'),_0xeccc44));}}}})[_0x2f79('0xa0')](loggerGetContactDialer('[getContactDialerPredictive]',_0xeccc44,0x1));};Dialer[_0x2f79('0x1c')][_0x2f79('0x1dc')]=function(_0x28b0c3,_0x3e9571,_0x3958e8,_0xb439f3,_0x57006f,_0x11c6ca){loggerPredictive['info']('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x2f79('0x4c')]('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',_0x28b0c3);loggerPredictive[_0x2f79('0x4c')](_0x2f79('0x216'),_0x3e9571);loggerPredictive['info'](_0x2f79('0x217'),_0x3958e8);loggerPredictive[_0x2f79('0x4c')](_0x2f79('0x218'),_0xb439f3);loggerPredictive[_0x2f79('0x4c')](_0x2f79('0x219'),_0x57006f);loggerPredictive[_0x2f79('0x4c')](_0x2f79('0x57'));return new Promise(function(_0x30a289,_0x224c9a){if(_0x28b0c3<=0x0||isNaN(_0x28b0c3)){return _0x224c9a(msgResponse(_0x2f79('0x21a'),_0x2f79('0x84'),_0x2f79('0x21b')+_0x28b0c3));}if(_0x3958e8<=0x0||isNaN(_0x3958e8)){return _0x224c9a(msgResponse(_0x2f79('0x21a'),_0x2f79('0x84'),'Ts\x20=\x20'+_0x3958e8));}if(_0xb439f3<=0x0||isNaN(_0xb439f3)){return _0x224c9a(msgResponse('[abandonmentRate]',_0x2f79('0x84'),_0x2f79('0x21c')+_0xb439f3));}if(_0x3e9571<=0x0||isNaN(_0x3e9571)){return _0x224c9a(msgResponse(_0x2f79('0x21a'),_0x2f79('0x84'),'interval\x20=\x20'+_0x3e9571));}if(_0x57006f<=0x0||isNaN(_0x57006f)){return _0x224c9a(msgResponse(_0x2f79('0x21a'),_0x2f79('0x84'),_0x2f79('0x21d')+_0x57006f));}_0x11c6ca=_0x11c6ca||0x0;var _0x36488a=0x1/_0x3958e8;var _0x5a0d02=0x0;var _0x5d06fa=0x0;var _0x490d1d=0x0;var _0x1689a4=0x0;for(var _0x15536e=0x0;_0x490d1d<_0x57006f;_0x15536e+=0x1){_0x5d06fa=_0x15536e/_0x3e9571;_0x5a0d02=(_0xb439f3*_0x5d06fa+_0x11c6ca)/_0x36488a;_0x490d1d=utils[_0x2f79('0x21e')](_0x5a0d02,_0x28b0c3);_0x1689a4=_0x5a0d02/_0x28b0c3*(0x1-utils[_0x2f79('0x21e')](_0x5a0d02,_0x28b0c3));}return _0x30a289({'erlangCalls':_0x15536e,'erlangCallToSecond':_0x3e9571/_0x15536e,'erlangAbandonmentRate':_0x490d1d,'erlangBusyFactor':_0x1689a4});});};Dialer['prototype']['busyFactor']=function(_0x22017d,_0x2cbd16,_0x52b13b,_0x5b7e65,_0x313eee,_0xd26f75){loggerPredictive[_0x2f79('0x4c')](_0x2f79('0x21f'));loggerPredictive[_0x2f79('0x4c')](_0x2f79('0x220'),_0x22017d);loggerPredictive[_0x2f79('0x4c')](_0x2f79('0x216'),_0x2cbd16);loggerPredictive[_0x2f79('0x4c')](_0x2f79('0x217'),_0x52b13b);loggerPredictive[_0x2f79('0x4c')]('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',_0x5b7e65);loggerPredictive[_0x2f79('0x4c')](_0x2f79('0x221'),_0x313eee);loggerPredictive[_0x2f79('0x4c')](_0x2f79('0x57'));return new Promise(function(_0x162cee,_0x3bfba2){if(_0x22017d<=0x0||isNaN(_0x22017d)){return _0x3bfba2(msgResponse(_0x2f79('0x222'),_0x2f79('0x84'),_0x2f79('0x21b')+_0x22017d));}if(_0x52b13b<=0x0||isNaN(_0x52b13b)){return _0x3bfba2(msgResponse(_0x2f79('0x222'),_0x2f79('0x84'),_0x2f79('0x223')+_0x52b13b));}if(_0x5b7e65<=0x0||isNaN(_0x5b7e65)){return _0x3bfba2(msgResponse('[busyFactor]',_0x2f79('0x84'),_0x2f79('0x21c')+_0x5b7e65));}if(_0x2cbd16<=0x0||isNaN(_0x2cbd16)){return _0x3bfba2(msgResponse('[busyFactor]',_0x2f79('0x84'),_0x2f79('0x224')+_0x2cbd16));}if(_0x313eee<=0x0||isNaN(_0x313eee)){return _0x3bfba2(msgResponse(_0x2f79('0x222'),'Error',_0x2f79('0x225')+_0x313eee));}_0xd26f75=_0xd26f75||0x0;var _0x4f4dfa=0x1/_0x52b13b;var _0xb953bb=0x0;var _0x4756ae=0x0;var _0x2ca1a9=0x0;var _0x3ee1a1=0x0;for(var _0x55ba16=0x0;_0x3ee1a1<_0x313eee;_0x55ba16+=0x1){_0x4756ae=_0x55ba16/_0x2cbd16;_0xb953bb=(_0x5b7e65*_0x4756ae+_0xd26f75)/_0x4f4dfa;_0x2ca1a9=utils['erlangb'](_0xb953bb,_0x22017d);_0x3ee1a1=_0xb953bb/_0x22017d*(0x1-utils['erlangb'](_0xb953bb,_0x22017d));}return _0x162cee({'erlangCalls':_0x55ba16,'erlangCallToSecond':_0x2cbd16/_0x55ba16,'erlangAbandonmentRate':_0x2ca1a9,'erlangBusyFactor':_0x3ee1a1});});};module[_0x2f79('0x226')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/models/action.js b/server/services/ami/dialer/models/action.js index 9e8af64..4097ad5 100644 --- a/server/services/ami/dialer/models/action.js +++ b/server/services/ami/dialer/models/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb17d=['phone','firstName','lastName','number','queue','active','type','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','\x22%s\x22\x20<%s>','voiceQueue','dialCutDigit','substring','prototype','exports','util','lodash','moment','isNil','string','uniqueid','name','Contact'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0xb17d,0xf4));var _0xdb17=function(_0x391d18,_0x2cdd28){_0x391d18=_0x391d18-0x0;var _0x1d9c65=_0xb17d[_0x391d18];return _0x1d9c65;};'use strict';var util=require(_0xdb17('0x0'));var _=require(_0xdb17('0x1'));var moment=require(_0xdb17('0x2'));function checkNameSurname(_0x30e78d,_0x47b0d8,_0x2743c2){var _0x241cbf='';if(!_[_0xdb17('0x3')](_0x47b0d8)&&_0xdb17('0x4')===typeof _0x47b0d8){_0x241cbf+=_0x47b0d8;}if(!_['isNil'](_0x2743c2)&&_0xdb17('0x4')===typeof _0x2743c2){_0x241cbf+='\x20'+_0x2743c2;}if(_0x241cbf!==''){return _0x241cbf;}return _0x30e78d;}function Action(_0x411d90,_0x244348,_0x3c0b58){this['voiceQueue']=_0x411d90;this[_0xdb17('0x5')]=_0x3c0b58||undefined;this[_0xdb17('0x6')]=checkNameSurname(_0x244348[_0xdb17('0x7')][_0xdb17('0x8')],_0x244348['Contact'][_0xdb17('0x9')],_0x244348[_0xdb17('0x7')][_0xdb17('0xa')]);this[_0xdb17('0xb')]=_0x244348['phone'];this[_0xdb17('0xc')]=_0x411d90[_0xdb17('0x6')];this[_0xdb17('0xd')]=_0x244348[_0xdb17('0xd')]||![];this[_0xdb17('0xe')]=_0x411d90[_0xdb17('0xe')];this['dialQueueTimeout']=_0x411d90['dialQueueTimeout']||0x3;this['scheduledat']=_0x244348['scheduledat'];this[_0xdb17('0xf')]=_0x244348[_0xdb17('0xf')];this[_0xdb17('0x10')]=_0x244348[_0xdb17('0x10')];this['countnoanswerretry']=_0x244348[_0xdb17('0x11')];this[_0xdb17('0x12')]=_0x244348[_0xdb17('0x12')];this[_0xdb17('0x13')]=_0x244348['countdropretry'];this[_0xdb17('0x14')]=_0x244348['countabandonedretry'];this[_0xdb17('0x15')]=_0x244348[_0xdb17('0x15')];this[_0xdb17('0x16')]=_0x244348[_0xdb17('0x16')];this[_0xdb17('0x17')]=_0x244348[_0xdb17('0x17')];this[_0xdb17('0x18')]=_0x244348[_0xdb17('0x18')];this[_0xdb17('0x19')]=_0x244348['UserId'];this[_0xdb17('0x1a')]=_0x244348['VoiceQueueId'];this[_0xdb17('0x1b')]=_0x244348['CampaignId'];this['idHopper']=_0x244348['id'];this[_0xdb17('0x1c')]=_0x244348[_0xdb17('0x7')]['firstName']||'';this['starttime']=moment()[_0xdb17('0x1d')](_0xdb17('0x1e'));this[_0xdb17('0x1f')]=_0x244348[_0xdb17('0x1f')];this['callbackuniqueid']=_0x244348[_0xdb17('0x20')];this[_0xdb17('0x21')]=_0x244348[_0xdb17('0x21')];this[_0xdb17('0x22')]=_0x244348['recallme'];this['originatecalleridnum']='';this[_0xdb17('0x23')]='';}Action['prototype']['getCaller']=function(){return util[_0xdb17('0x1d')](_0xdb17('0x24'),this[_0xdb17('0x6')],this[_0xdb17('0x25')][_0xdb17('0x26')]>0x0?this[_0xdb17('0xb')][_0xdb17('0x27')](this[_0xdb17('0x25')][_0xdb17('0x26')]):this[_0xdb17('0xb')]);};Action[_0xdb17('0x28')]['getQueue']=function(){return this[_0xdb17('0xc')];};module[_0xdb17('0x29')]=Action; \ No newline at end of file +var _0x7a1b=['name','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','number','substring','voiceQueue','prototype','getQueue','exports','util','lodash','moment','isNil','Contact','phone','firstName','lastName','queue'];(function(_0x2c1950,_0xaa01d){var _0x5e4934=function(_0x25394f){while(--_0x25394f){_0x2c1950['push'](_0x2c1950['shift']());}};_0x5e4934(++_0xaa01d);}(_0x7a1b,0x81));var _0xb7a1=function(_0xae201a,_0x48b0f8){_0xae201a=_0xae201a-0x0;var _0x145423=_0x7a1b[_0xae201a];return _0x145423;};'use strict';var util=require(_0xb7a1('0x0'));var _=require(_0xb7a1('0x1'));var moment=require(_0xb7a1('0x2'));function checkNameSurname(_0x3c4a11,_0x11c258,_0x55c7b2){var _0x578579='';if(!_[_0xb7a1('0x3')](_0x11c258)&&'string'===typeof _0x11c258){_0x578579+=_0x11c258;}if(!_[_0xb7a1('0x3')](_0x55c7b2)&&'string'===typeof _0x55c7b2){_0x578579+='\x20'+_0x55c7b2;}if(_0x578579!==''){return _0x578579;}return _0x3c4a11;}function Action(_0x2fff45,_0x2e44a3,_0x1eaeaa){this['voiceQueue']=_0x2fff45;this['uniqueid']=_0x1eaeaa||undefined;this['name']=checkNameSurname(_0x2e44a3[_0xb7a1('0x4')][_0xb7a1('0x5')],_0x2e44a3[_0xb7a1('0x4')][_0xb7a1('0x6')],_0x2e44a3[_0xb7a1('0x4')][_0xb7a1('0x7')]);this['number']=_0x2e44a3['phone'];this[_0xb7a1('0x8')]=_0x2fff45[_0xb7a1('0x9')];this[_0xb7a1('0xa')]=_0x2e44a3[_0xb7a1('0xa')]||![];this[_0xb7a1('0xb')]=_0x2fff45[_0xb7a1('0xb')];this[_0xb7a1('0xc')]=_0x2fff45[_0xb7a1('0xc')]||0x3;this[_0xb7a1('0xd')]=_0x2e44a3[_0xb7a1('0xd')];this[_0xb7a1('0xe')]=_0x2e44a3[_0xb7a1('0xe')];this[_0xb7a1('0xf')]=_0x2e44a3['countcongestionretry'];this[_0xb7a1('0x10')]=_0x2e44a3[_0xb7a1('0x10')];this[_0xb7a1('0x11')]=_0x2e44a3[_0xb7a1('0x11')];this['countdropretry']=_0x2e44a3[_0xb7a1('0x12')];this[_0xb7a1('0x13')]=_0x2e44a3['countabandonedretry'];this['countmachineretry']=_0x2e44a3[_0xb7a1('0x14')];this[_0xb7a1('0x15')]=_0x2e44a3[_0xb7a1('0x15')];this[_0xb7a1('0x16')]=_0x2e44a3['ContactId'];this[_0xb7a1('0x17')]=_0x2e44a3['ListId'];this[_0xb7a1('0x18')]=_0x2e44a3['UserId'];this[_0xb7a1('0x19')]=_0x2e44a3['VoiceQueueId'];this[_0xb7a1('0x1a')]=_0x2e44a3[_0xb7a1('0x1a')];this[_0xb7a1('0x1b')]=_0x2e44a3['id'];this[_0xb7a1('0x1c')]=_0x2e44a3['Contact'][_0xb7a1('0x6')]||'';this[_0xb7a1('0x1d')]=moment()[_0xb7a1('0x1e')](_0xb7a1('0x1f'));this['callback']=_0x2e44a3[_0xb7a1('0x20')];this[_0xb7a1('0x21')]=_0x2e44a3[_0xb7a1('0x21')];this[_0xb7a1('0x22')]=_0x2e44a3[_0xb7a1('0x22')];this[_0xb7a1('0x23')]=_0x2e44a3[_0xb7a1('0x23')];this[_0xb7a1('0x24')]='';this['originatecalleridname']='';}Action['prototype'][_0xb7a1('0x25')]=function(){return util['format'](_0xb7a1('0x26'),this['name'],this['voiceQueue'][_0xb7a1('0x27')]>0x0?this[_0xb7a1('0x28')][_0xb7a1('0x29')](this[_0xb7a1('0x2a')][_0xb7a1('0x27')]):this[_0xb7a1('0x28')]);};Action[_0xb7a1('0x2b')][_0xb7a1('0x2c')]=function(){return this['queue'];};module[_0xb7a1('0x2d')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/models/agentComplete.js b/server/services/ami/dialer/models/agentComplete.js index 5a4cac1..1358f65 100644 --- a/server/services/ami/dialer/models/agentComplete.js +++ b/server/services/ami/dialer/models/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c50=['countagentrejectretry','countdropretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','answertime','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','endtime','membername','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','moment','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry'];(function(_0x506a66,_0x4fab8a){var _0x10780d=function(_0x45a2b3){while(--_0x45a2b3){_0x506a66['push'](_0x506a66['shift']());}};_0x10780d(++_0x4fab8a);}(_0x9c50,0x158));var _0x09c5=function(_0x283257,_0x145ec7){_0x283257=_0x283257-0x0;var _0x30a6f0=_0x9c50[_0x283257];return _0x30a6f0;};'use strict';var moment=require(_0x09c5('0x0'));var utils=require('../utils');function AgentComplete(_0x558ea2,_0x524d23){this[_0x09c5('0x1')]=0x4;this[_0x09c5('0x2')]=_0x09c5('0x3');this['scheduledat']=_0x558ea2[_0x09c5('0x4')];this['type']=_0x558ea2[_0x09c5('0x5')];this[_0x09c5('0x6')]=_0x558ea2['type']===_0x09c5('0x7')?_0x09c5('0x8'):_0x558ea2[_0x09c5('0x5')];this[_0x09c5('0x9')]=_0x558ea2[_0x09c5('0x9')];this['countcongestionretry']=_0x558ea2[_0x09c5('0xa')];this[_0x09c5('0xb')]=_0x558ea2['countnoanswerretry'];this[_0x09c5('0xc')]=_0x558ea2[_0x09c5('0x9')]+_0x558ea2[_0x09c5('0xa')]+_0x558ea2[_0x09c5('0xb')]+_0x558ea2[_0x09c5('0xd')]+_0x558ea2['countdropretry']+_0x558ea2[_0x09c5('0xe')]+_0x558ea2[_0x09c5('0xf')]+_0x558ea2[_0x09c5('0x10')];this['countnosuchnumberretry']=_0x558ea2[_0x09c5('0xd')];this['countdropretry']=_0x558ea2[_0x09c5('0x11')];this[_0x09c5('0xe')]=_0x558ea2[_0x09c5('0xe')];this['countmachineretry']=_0x558ea2['countmachineretry'];this['countagentrejectretry']=_0x558ea2['countagentrejectretry'];this['uniqueid']=_0x524d23[_0x09c5('0x12')];this[_0x09c5('0x13')]=_0x558ea2[_0x09c5('0x14')];this[_0x09c5('0x15')]=_0x558ea2['number'];this[_0x09c5('0x16')]=_0x558ea2[_0x09c5('0x16')];this[_0x09c5('0x17')]=_0x558ea2[_0x09c5('0x17')];this[_0x09c5('0x18')]=_0x558ea2[_0x09c5('0x18')];this['endtime']=moment()['format'](_0x09c5('0x19'));this[_0x09c5('0x1a')]=utils[_0x09c5('0x1b')](_0x558ea2[_0x09c5('0x17')],_0x558ea2['starttime']);this[_0x09c5('0x1c')]=utils[_0x09c5('0x1b')](_0x558ea2['answertime'],_0x558ea2[_0x09c5('0x17')]);this[_0x09c5('0x1d')]=utils[_0x09c5('0x1b')](this[_0x09c5('0x1e')],_0x558ea2['answertime']);this[_0x09c5('0x8')]=_0x524d23['queue'];this['membername']=_0x524d23[_0x09c5('0x1f')];this['reason']=_0x524d23['reason'];this[_0x09c5('0x20')]=_0x558ea2[_0x09c5('0x20')];this[_0x09c5('0x21')]=_0x558ea2[_0x09c5('0x21')];this[_0x09c5('0x22')]=_0x558ea2['callbackat'];this[_0x09c5('0x23')]=_0x558ea2['recallme'];this[_0x09c5('0x24')]=_0x558ea2[_0x09c5('0x24')];this[_0x09c5('0x25')]=_0x558ea2[_0x09c5('0x25')];this['UserId']=_0x558ea2[_0x09c5('0x26')];this[_0x09c5('0x27')]=_0x558ea2['VoiceQueueId'];this[_0x09c5('0x28')]=_0x558ea2[_0x09c5('0x28')];this[_0x09c5('0x29')]=_0x558ea2['originatecalleridnum']||'';this[_0x09c5('0x2a')]=_0x558ea2[_0x09c5('0x2a')]||'';this[_0x09c5('0x2b')]=_0x558ea2[_0x09c5('0x2b')];}module[_0x09c5('0x2c')]=AgentComplete; \ No newline at end of file +var _0xf7d8=['reason','callback','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','moment','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countbusyretry','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','uniqueid','name','number','starttime','responsetime','answertime','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','talktime','endtime','membername'];(function(_0x37897a,_0x1a355a){var _0x2701fb=function(_0x545c7e){while(--_0x545c7e){_0x37897a['push'](_0x37897a['shift']());}};_0x2701fb(++_0x1a355a);}(_0xf7d8,0x154));var _0x8f7d=function(_0x2bbc07,_0x1e2168){_0x2bbc07=_0x2bbc07-0x0;var _0x6879e4=_0xf7d8[_0x2bbc07];return _0x6879e4;};'use strict';var moment=require(_0x8f7d('0x0'));var utils=require('../utils');function AgentComplete(_0x663b29,_0xa860c1){this[_0x8f7d('0x1')]=0x4;this[_0x8f7d('0x2')]=_0x8f7d('0x3');this[_0x8f7d('0x4')]=_0x663b29[_0x8f7d('0x4')];this[_0x8f7d('0x5')]=_0x663b29[_0x8f7d('0x5')];this[_0x8f7d('0x6')]=_0x663b29['type']===_0x8f7d('0x7')?_0x8f7d('0x8'):_0x663b29['type'];this['countbusyretry']=_0x663b29['countbusyretry'];this[_0x8f7d('0x9')]=_0x663b29[_0x8f7d('0x9')];this[_0x8f7d('0xa')]=_0x663b29[_0x8f7d('0xa')];this['countglobal']=_0x663b29[_0x8f7d('0xb')]+_0x663b29[_0x8f7d('0x9')]+_0x663b29[_0x8f7d('0xa')]+_0x663b29['countnosuchnumberretry']+_0x663b29[_0x8f7d('0xc')]+_0x663b29[_0x8f7d('0xd')]+_0x663b29[_0x8f7d('0xe')]+_0x663b29['countagentrejectretry'];this['countnosuchnumberretry']=_0x663b29[_0x8f7d('0xf')];this[_0x8f7d('0xc')]=_0x663b29[_0x8f7d('0xc')];this[_0x8f7d('0xd')]=_0x663b29['countabandonedretry'];this['countmachineretry']=_0x663b29['countmachineretry'];this[_0x8f7d('0x10')]=_0x663b29[_0x8f7d('0x10')];this[_0x8f7d('0x11')]=_0xa860c1['uniqueid'];this['calleridname']=_0x663b29[_0x8f7d('0x12')];this['calleridnum']=_0x663b29[_0x8f7d('0x13')];this[_0x8f7d('0x14')]=_0x663b29[_0x8f7d('0x14')];this[_0x8f7d('0x15')]=_0x663b29['responsetime'];this[_0x8f7d('0x16')]=_0x663b29['answertime'];this['endtime']=moment()['format'](_0x8f7d('0x17'));this[_0x8f7d('0x18')]=utils[_0x8f7d('0x19')](_0x663b29['responsetime'],_0x663b29[_0x8f7d('0x14')]);this['holdtime']=utils[_0x8f7d('0x19')](_0x663b29[_0x8f7d('0x16')],_0x663b29[_0x8f7d('0x15')]);this[_0x8f7d('0x1a')]=utils[_0x8f7d('0x19')](this[_0x8f7d('0x1b')],_0x663b29[_0x8f7d('0x16')]);this[_0x8f7d('0x8')]=_0xa860c1[_0x8f7d('0x8')];this['membername']=_0xa860c1[_0x8f7d('0x1c')];this[_0x8f7d('0x1d')]=_0xa860c1[_0x8f7d('0x1d')];this['callback']=_0x663b29[_0x8f7d('0x1e')];this['callbackuniqueid']=_0x663b29['callbackuniqueid'];this[_0x8f7d('0x1f')]=_0x663b29['callbackat'];this[_0x8f7d('0x20')]=_0x663b29[_0x8f7d('0x20')];this[_0x8f7d('0x21')]=_0x663b29[_0x8f7d('0x21')];this[_0x8f7d('0x22')]=_0x663b29[_0x8f7d('0x22')];this['UserId']=_0x663b29['UserId'];this[_0x8f7d('0x23')]=_0x663b29[_0x8f7d('0x23')];this[_0x8f7d('0x24')]=_0x663b29[_0x8f7d('0x24')];this[_0x8f7d('0x25')]=_0x663b29[_0x8f7d('0x25')]||'';this['originatecalleridname']=_0x663b29[_0x8f7d('0x26')]||'';this[_0x8f7d('0x27')]=_0x663b29[_0x8f7d('0x27')];}module[_0x8f7d('0x28')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/models/final.js b/server/services/ami/dialer/models/final.js index 7393b37..5f66921 100644 --- a/server/services/ami/dialer/models/final.js +++ b/server/services/ami/dialer/models/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2951=['VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId'];(function(_0xcb5ece,_0x2d699f){var _0x221fcc=function(_0x4c5056){while(--_0x4c5056){_0xcb5ece['push'](_0xcb5ece['shift']());}};_0x221fcc(++_0x2d699f);}(_0x2951,0x15a));var _0x1295=function(_0x2e9187,_0x3763f6){_0x2e9187=_0x2e9187-0x0;var _0x1fc3a8=_0x2951[_0x2e9187];return _0x1fc3a8;};'use strict';function Final(_0xe89959){this[_0x1295('0x0')]=_0xe89959[_0x1295('0x0')];this[_0x1295('0x1')]=_0xe89959[_0x1295('0x1')];this[_0x1295('0x2')]=_0xe89959[_0x1295('0x2')];this['campaigntype']=_0xe89959[_0x1295('0x2')]===_0x1295('0x3')?_0x1295('0x4'):_0xe89959[_0x1295('0x2')];this[_0x1295('0x5')]=_0xe89959[_0x1295('0x5')];this[_0x1295('0x6')]=_0xe89959[_0x1295('0x6')];this['countnoanswerretry']=_0xe89959['countnoanswerretry'];this[_0x1295('0x7')]=_0xe89959[_0x1295('0x5')]+_0xe89959[_0x1295('0x6')]+_0xe89959['countnoanswerretry']+_0xe89959[_0x1295('0x8')]+_0xe89959[_0x1295('0x9')]+_0xe89959[_0x1295('0xa')]+_0xe89959[_0x1295('0xb')]+_0xe89959[_0x1295('0xc')];this[_0x1295('0x8')]=_0xe89959[_0x1295('0x8')];this['countdropretry']=_0xe89959[_0x1295('0x9')];this['countabandonedretry']=_0xe89959[_0x1295('0xa')];this[_0x1295('0xb')]=_0xe89959[_0x1295('0xb')];this['countagentrejectretry']=_0xe89959[_0x1295('0xc')];this[_0x1295('0x4')]=_0xe89959[_0x1295('0x4')];this[_0x1295('0xd')]=_0xe89959[_0x1295('0xd')];this[_0x1295('0xe')]=_0xe89959[_0x1295('0xe')];this[_0x1295('0xf')]=_0xe89959[_0x1295('0xf')];this[_0x1295('0x10')]=_0xe89959['responsetime'];this[_0x1295('0x11')]=_0xe89959['responsetime'];this[_0x1295('0x12')]=_0xe89959[_0x1295('0x12')]||0x0;this[_0x1295('0x13')]=_0xe89959['holdtime']||0x0;this[_0x1295('0x14')]=_0xe89959['talktime']||0x0;this[_0x1295('0x15')]=_0xe89959[_0x1295('0x15')];this[_0x1295('0x16')]=_0xe89959['callbackuniqueid'];this['callbackat']=_0xe89959[_0x1295('0x17')];this[_0x1295('0x18')]=_0xe89959[_0x1295('0x18')];this['ContactId']=_0xe89959[_0x1295('0x19')];this[_0x1295('0x1a')]=_0xe89959[_0x1295('0x1a')];this[_0x1295('0x1b')]=_0xe89959[_0x1295('0x1b')];this[_0x1295('0x1c')]=_0xe89959[_0x1295('0x1c')];this['CampaignId']=_0xe89959[_0x1295('0x1d')];this[_0x1295('0x1e')]=_0xe89959[_0x1295('0x1e')]||'';this[_0x1295('0x1f')]=_0xe89959[_0x1295('0x1f')]||'';this[_0x1295('0x20')]=_0xe89959['state'];this[_0x1295('0x21')]=_0xe89959['statedesc'];}module['exports']=Final; \ No newline at end of file +var _0xc820=['countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','calleridname','calleridnum','responsetime','ringtime','holdtime','talktime','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','campaigntype','type','outbound','queue'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0xc820,0x1b4));var _0x0c82=function(_0x18e3de,_0x435606){_0x18e3de=_0x18e3de-0x0;var _0x5bde92=_0xc820[_0x18e3de];return _0x5bde92;};'use strict';function Final(_0xbdc9c4){this['uniqueid']=_0xbdc9c4[_0x0c82('0x0')];this[_0x0c82('0x1')]=_0xbdc9c4[_0x0c82('0x1')];this['type']=_0xbdc9c4['type'];this[_0x0c82('0x2')]=_0xbdc9c4[_0x0c82('0x3')]===_0x0c82('0x4')?_0x0c82('0x5'):_0xbdc9c4[_0x0c82('0x3')];this[_0x0c82('0x6')]=_0xbdc9c4[_0x0c82('0x6')];this['countcongestionretry']=_0xbdc9c4[_0x0c82('0x7')];this[_0x0c82('0x8')]=_0xbdc9c4[_0x0c82('0x8')];this[_0x0c82('0x9')]=_0xbdc9c4[_0x0c82('0x6')]+_0xbdc9c4['countcongestionretry']+_0xbdc9c4[_0x0c82('0x8')]+_0xbdc9c4['countnosuchnumberretry']+_0xbdc9c4['countdropretry']+_0xbdc9c4[_0x0c82('0xa')]+_0xbdc9c4[_0x0c82('0xb')]+_0xbdc9c4[_0x0c82('0xc')];this[_0x0c82('0xd')]=_0xbdc9c4[_0x0c82('0xd')];this[_0x0c82('0xe')]=_0xbdc9c4['countdropretry'];this['countabandonedretry']=_0xbdc9c4[_0x0c82('0xa')];this[_0x0c82('0xb')]=_0xbdc9c4[_0x0c82('0xb')];this[_0x0c82('0xc')]=_0xbdc9c4['countagentrejectretry'];this[_0x0c82('0x5')]=_0xbdc9c4[_0x0c82('0x5')];this[_0x0c82('0xf')]=_0xbdc9c4[_0x0c82('0xf')];this[_0x0c82('0x10')]=_0xbdc9c4[_0x0c82('0x10')];this['starttime']=_0xbdc9c4['starttime'];this[_0x0c82('0x11')]=_0xbdc9c4[_0x0c82('0x11')];this['endtime']=_0xbdc9c4[_0x0c82('0x11')];this[_0x0c82('0x12')]=_0xbdc9c4[_0x0c82('0x12')]||0x0;this[_0x0c82('0x13')]=_0xbdc9c4[_0x0c82('0x13')]||0x0;this[_0x0c82('0x14')]=_0xbdc9c4[_0x0c82('0x14')]||0x0;this[_0x0c82('0x15')]=_0xbdc9c4[_0x0c82('0x15')];this['callbackuniqueid']=_0xbdc9c4['callbackuniqueid'];this[_0x0c82('0x16')]=_0xbdc9c4[_0x0c82('0x16')];this['recallme']=_0xbdc9c4[_0x0c82('0x17')];this['ContactId']=_0xbdc9c4[_0x0c82('0x18')];this[_0x0c82('0x19')]=_0xbdc9c4['ListId'];this[_0x0c82('0x1a')]=_0xbdc9c4['UserId'];this[_0x0c82('0x1b')]=_0xbdc9c4[_0x0c82('0x1b')];this[_0x0c82('0x1c')]=_0xbdc9c4['CampaignId'];this[_0x0c82('0x1d')]=_0xbdc9c4[_0x0c82('0x1d')]||'';this['originatecalleridname']=_0xbdc9c4[_0x0c82('0x1e')]||'';this[_0x0c82('0x1f')]=_0xbdc9c4[_0x0c82('0x1f')];this['statedesc']=_0xbdc9c4[_0x0c82('0x20')];}module[_0x0c82('0x21')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/models/hangup.js b/server/services/ami/dialer/models/hangup.js index 8c606b2..63d5c3d 100644 --- a/server/services/ami/dialer/models/hangup.js +++ b/server/services/ami/dialer/models/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4b0c=['recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','../utils','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','responsetime','format','ringtime','getSeconds','starttime','holdtime','queue','IVR','cause-txt','callback','callbackuniqueid','callbackat'];(function(_0x2ed8f3,_0x4aa12f){var _0x525a55=function(_0x4cfb58){while(--_0x4cfb58){_0x2ed8f3['push'](_0x2ed8f3['shift']());}};_0x525a55(++_0x4aa12f);}(_0x4b0c,0x181));var _0xc4b0=function(_0xb283cf,_0x2a471a){_0xb283cf=_0xb283cf-0x0;var _0x4c9f26=_0x4b0c[_0xb283cf];return _0x4c9f26;};'use strict';var moment=require('moment');var utils=require(_0xc4b0('0x0'));function Hangup(_0x421044,_0x426f2f){this[_0xc4b0('0x1')]=0x4;this[_0xc4b0('0x2')]=_0xc4b0('0x3');this[_0xc4b0('0x4')]=_0x421044[_0xc4b0('0x4')];this['type']=_0x421044[_0xc4b0('0x5')];this[_0xc4b0('0x6')]=_0x421044['type']===_0xc4b0('0x7')?'queue':_0x421044[_0xc4b0('0x5')];this[_0xc4b0('0x8')]=_0x421044[_0xc4b0('0x8')]||![];this[_0xc4b0('0x9')]=_0x421044['countbusyretry'];this[_0xc4b0('0xa')]=_0x421044['countcongestionretry'];this[_0xc4b0('0xb')]=_0x421044['countnoanswerretry'];this[_0xc4b0('0xc')]=_0x421044[_0xc4b0('0x9')]+_0x421044[_0xc4b0('0xa')]+_0x421044[_0xc4b0('0xb')]+_0x421044[_0xc4b0('0xd')]+_0x421044[_0xc4b0('0xe')]+_0x421044[_0xc4b0('0xf')]+_0x421044[_0xc4b0('0x10')]+_0x421044[_0xc4b0('0x11')];this['countnosuchnumberretry']=_0x421044['countnosuchnumberretry'];this['countdropretry']=_0x421044[_0xc4b0('0xe')];this[_0xc4b0('0xf')]=_0x421044[_0xc4b0('0xf')];this[_0xc4b0('0x10')]=_0x421044[_0xc4b0('0x10')];this[_0xc4b0('0x11')]=_0x421044[_0xc4b0('0x11')];this[_0xc4b0('0x12')]=_0x426f2f['uniqueid'];this[_0xc4b0('0x13')]=_0x421044[_0xc4b0('0x14')];this[_0xc4b0('0x15')]=_0x421044[_0xc4b0('0x16')];this['starttime']=_0x421044['starttime'];this[_0xc4b0('0x17')]=_0x421044[_0xc4b0('0x17')];this['endtime']=moment()[_0xc4b0('0x18')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xc4b0('0x19')]=utils[_0xc4b0('0x1a')](_0x421044[_0xc4b0('0x17')],_0x421044[_0xc4b0('0x1b')]);this[_0xc4b0('0x1c')]=0x0;this['talktime']=utils[_0xc4b0('0x1a')](this['endtime'],_0x421044['responsetime']);this[_0xc4b0('0x1d')]=_0x421044['queue'];this['membername']=_0xc4b0('0x1e');this['reason']=_0x426f2f[_0xc4b0('0x1f')];this[_0xc4b0('0x20')]=_0x421044[_0xc4b0('0x20')];this[_0xc4b0('0x21')]=_0x421044[_0xc4b0('0x21')];this[_0xc4b0('0x22')]=_0x421044[_0xc4b0('0x22')];this[_0xc4b0('0x23')]=_0x421044[_0xc4b0('0x23')];this[_0xc4b0('0x24')]=_0x421044[_0xc4b0('0x24')];this['ListId']=_0x421044[_0xc4b0('0x25')];this[_0xc4b0('0x26')]=_0x421044[_0xc4b0('0x26')];this[_0xc4b0('0x27')]=_0x421044[_0xc4b0('0x27')];this[_0xc4b0('0x28')]=_0x421044['CampaignId'];}module[_0xc4b0('0x29')]=Hangup; \ No newline at end of file +var _0xcc9d=['callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','moment','../utils','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countabandonedretry','countagentrejectretry','uniqueid','name','calleridnum','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','responsetime','talktime','membername','IVR','reason'];(function(_0x65ee0c,_0x5eaafb){var _0x341559=function(_0x16ae26){while(--_0x16ae26){_0x65ee0c['push'](_0x65ee0c['shift']());}};_0x341559(++_0x5eaafb);}(_0xcc9d,0xdb));var _0xdcc9=function(_0x44e0fd,_0x58f7f3){_0x44e0fd=_0x44e0fd-0x0;var _0xa16357=_0xcc9d[_0x44e0fd];return _0xa16357;};'use strict';var moment=require(_0xdcc9('0x0'));var utils=require(_0xdcc9('0x1'));function Hangup(_0x901d2e,_0x2df8a3){this[_0xdcc9('0x2')]=0x4;this[_0xdcc9('0x3')]=_0xdcc9('0x4');this[_0xdcc9('0x5')]=_0x901d2e[_0xdcc9('0x5')];this['type']=_0x901d2e[_0xdcc9('0x6')];this[_0xdcc9('0x7')]=_0x901d2e[_0xdcc9('0x6')]===_0xdcc9('0x8')?_0xdcc9('0x9'):_0x901d2e[_0xdcc9('0x6')];this[_0xdcc9('0xa')]=_0x901d2e[_0xdcc9('0xa')]||![];this[_0xdcc9('0xb')]=_0x901d2e[_0xdcc9('0xb')];this['countcongestionretry']=_0x901d2e[_0xdcc9('0xc')];this[_0xdcc9('0xd')]=_0x901d2e[_0xdcc9('0xd')];this[_0xdcc9('0xe')]=_0x901d2e[_0xdcc9('0xb')]+_0x901d2e[_0xdcc9('0xc')]+_0x901d2e[_0xdcc9('0xd')]+_0x901d2e[_0xdcc9('0xf')]+_0x901d2e[_0xdcc9('0x10')]+_0x901d2e['countabandonedretry']+_0x901d2e[_0xdcc9('0x11')]+_0x901d2e['countagentrejectretry'];this[_0xdcc9('0xf')]=_0x901d2e[_0xdcc9('0xf')];this['countdropretry']=_0x901d2e[_0xdcc9('0x10')];this[_0xdcc9('0x12')]=_0x901d2e[_0xdcc9('0x12')];this[_0xdcc9('0x11')]=_0x901d2e[_0xdcc9('0x11')];this['countagentrejectretry']=_0x901d2e[_0xdcc9('0x13')];this[_0xdcc9('0x14')]=_0x2df8a3[_0xdcc9('0x14')];this['calleridname']=_0x901d2e[_0xdcc9('0x15')];this[_0xdcc9('0x16')]=_0x901d2e['number'];this[_0xdcc9('0x17')]=_0x901d2e['starttime'];this['responsetime']=_0x901d2e['responsetime'];this[_0xdcc9('0x18')]=moment()[_0xdcc9('0x19')](_0xdcc9('0x1a'));this[_0xdcc9('0x1b')]=utils['getSeconds'](_0x901d2e[_0xdcc9('0x1c')],_0x901d2e['starttime']);this['holdtime']=0x0;this[_0xdcc9('0x1d')]=utils['getSeconds'](this['endtime'],_0x901d2e['responsetime']);this[_0xdcc9('0x9')]=_0x901d2e[_0xdcc9('0x9')];this[_0xdcc9('0x1e')]=_0xdcc9('0x1f');this[_0xdcc9('0x20')]=_0x2df8a3['cause-txt'];this[_0xdcc9('0x21')]=_0x901d2e['callback'];this['callbackuniqueid']=_0x901d2e[_0xdcc9('0x22')];this['callbackat']=_0x901d2e[_0xdcc9('0x23')];this['recallme']=_0x901d2e[_0xdcc9('0x24')];this[_0xdcc9('0x25')]=_0x901d2e[_0xdcc9('0x25')];this[_0xdcc9('0x26')]=_0x901d2e[_0xdcc9('0x26')];this[_0xdcc9('0x27')]=_0x901d2e['UserId'];this[_0xdcc9('0x28')]=_0x901d2e['VoiceQueueId'];this['CampaignId']=_0x901d2e[_0xdcc9('0x29')];}module['exports']=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/models/history.js b/server/services/ami/dialer/models/history.js index ded46c0..6d9487b 100644 --- a/server/services/ami/dialer/models/history.js +++ b/server/services/ami/dialer/models/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c42=['ringtime','getSeconds','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','calleridname','name','number','starttime','responsetime','endtime'];(function(_0x3ba422,_0x53303c){var _0x20b5dd=function(_0x10b8a7){while(--_0x10b8a7){_0x3ba422['push'](_0x3ba422['shift']());}};_0x20b5dd(++_0x53303c);}(_0x5c42,0xa9));var _0x25c4=function(_0x1c8f6f,_0x1de15b){_0x1c8f6f=_0x1c8f6f-0x0;var _0x33b77d=_0x5c42[_0x1c8f6f];return _0x33b77d;};'use strict';var utils=require(_0x25c4('0x0'));function History(_0x52d6e8){this[_0x25c4('0x1')]=_0x52d6e8[_0x25c4('0x1')];this[_0x25c4('0x2')]=_0x52d6e8[_0x25c4('0x2')]||undefined;this[_0x25c4('0x3')]=_0x52d6e8[_0x25c4('0x3')];this[_0x25c4('0x4')]=_0x52d6e8[_0x25c4('0x3')]===_0x25c4('0x5')?_0x25c4('0x6'):_0x52d6e8[_0x25c4('0x3')];this[_0x25c4('0x7')]=_0x52d6e8[_0x25c4('0x7')];this[_0x25c4('0x8')]=_0x52d6e8[_0x25c4('0x8')];this[_0x25c4('0x9')]=_0x52d6e8[_0x25c4('0x9')];this['countglobal']=_0x52d6e8[_0x25c4('0x7')]+_0x52d6e8[_0x25c4('0x8')]+_0x52d6e8[_0x25c4('0x9')]+_0x52d6e8[_0x25c4('0xa')]+_0x52d6e8['countdropretry']+_0x52d6e8[_0x25c4('0xb')]+_0x52d6e8[_0x25c4('0xc')]+_0x52d6e8[_0x25c4('0xd')];this[_0x25c4('0xa')]=_0x52d6e8[_0x25c4('0xa')];this[_0x25c4('0xe')]=_0x52d6e8[_0x25c4('0xe')];this[_0x25c4('0xb')]=_0x52d6e8[_0x25c4('0xb')];this[_0x25c4('0xc')]=_0x52d6e8[_0x25c4('0xc')];this['countagentrejectretry']=_0x52d6e8[_0x25c4('0xd')];this['queue']=_0x52d6e8['queue'];this[_0x25c4('0xf')]=_0x52d6e8[_0x25c4('0x10')];this['calleridnum']=_0x52d6e8[_0x25c4('0x11')];this[_0x25c4('0x12')]=_0x52d6e8[_0x25c4('0x12')];this[_0x25c4('0x13')]=_0x52d6e8['responsetime'];this[_0x25c4('0x14')]=_0x52d6e8[_0x25c4('0x13')];this[_0x25c4('0x15')]=utils[_0x25c4('0x16')](_0x52d6e8[_0x25c4('0x13')],_0x52d6e8['starttime']);this[_0x25c4('0x17')]=0x0;this['talktime']=0x0;this[_0x25c4('0x18')]=_0x52d6e8[_0x25c4('0x18')];this[_0x25c4('0x19')]=_0x52d6e8[_0x25c4('0x19')];this[_0x25c4('0x1a')]=_0x52d6e8[_0x25c4('0x1a')];this[_0x25c4('0x1b')]=_0x52d6e8[_0x25c4('0x1b')];this[_0x25c4('0x1c')]=_0x52d6e8['ContactId'];this[_0x25c4('0x1d')]=_0x52d6e8[_0x25c4('0x1d')];this[_0x25c4('0x1e')]=_0x52d6e8[_0x25c4('0x1e')];this[_0x25c4('0x1f')]=_0x52d6e8[_0x25c4('0x1f')];this[_0x25c4('0x20')]=_0x52d6e8['CampaignId'];this[_0x25c4('0x21')]=_0x52d6e8[_0x25c4('0x21')]||'';this[_0x25c4('0x22')]=_0x52d6e8[_0x25c4('0x22')]||'';this['state']=_0x52d6e8[_0x25c4('0x23')];this[_0x25c4('0x24')]=_0x52d6e8['statedesc'];}module[_0x25c4('0x25')]=History; \ No newline at end of file +var _0x8ca2=['uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','calleridname','calleridnum','number','starttime','responsetime','endtime','ringtime','getSeconds','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','../utils'];(function(_0x25662e,_0x4cec68){var _0x59b7bc=function(_0xafb159){while(--_0xafb159){_0x25662e['push'](_0x25662e['shift']());}};_0x59b7bc(++_0x4cec68);}(_0x8ca2,0x109));var _0x28ca=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x8ca2[_0x491a7f];return _0x3d8f44;};'use strict';var utils=require(_0x28ca('0x0'));function History(_0x4e9599){this['uniqueid']=_0x4e9599[_0x28ca('0x1')];this[_0x28ca('0x2')]=_0x4e9599['scheduledat']||undefined;this['type']=_0x4e9599[_0x28ca('0x3')];this[_0x28ca('0x4')]=_0x4e9599[_0x28ca('0x3')]===_0x28ca('0x5')?_0x28ca('0x6'):_0x4e9599[_0x28ca('0x3')];this[_0x28ca('0x7')]=_0x4e9599['countbusyretry'];this[_0x28ca('0x8')]=_0x4e9599[_0x28ca('0x8')];this[_0x28ca('0x9')]=_0x4e9599[_0x28ca('0x9')];this[_0x28ca('0xa')]=_0x4e9599['countbusyretry']+_0x4e9599['countcongestionretry']+_0x4e9599['countnoanswerretry']+_0x4e9599[_0x28ca('0xb')]+_0x4e9599['countdropretry']+_0x4e9599[_0x28ca('0xc')]+_0x4e9599[_0x28ca('0xd')]+_0x4e9599[_0x28ca('0xe')];this[_0x28ca('0xb')]=_0x4e9599['countnosuchnumberretry'];this['countdropretry']=_0x4e9599[_0x28ca('0xf')];this['countabandonedretry']=_0x4e9599['countabandonedretry'];this[_0x28ca('0xd')]=_0x4e9599[_0x28ca('0xd')];this[_0x28ca('0xe')]=_0x4e9599['countagentrejectretry'];this[_0x28ca('0x6')]=_0x4e9599['queue'];this[_0x28ca('0x10')]=_0x4e9599['name'];this[_0x28ca('0x11')]=_0x4e9599[_0x28ca('0x12')];this[_0x28ca('0x13')]=_0x4e9599['starttime'];this[_0x28ca('0x14')]=_0x4e9599[_0x28ca('0x14')];this[_0x28ca('0x15')]=_0x4e9599['responsetime'];this[_0x28ca('0x16')]=utils[_0x28ca('0x17')](_0x4e9599[_0x28ca('0x14')],_0x4e9599[_0x28ca('0x13')]);this[_0x28ca('0x18')]=0x0;this['talktime']=0x0;this[_0x28ca('0x19')]=_0x4e9599[_0x28ca('0x19')];this[_0x28ca('0x1a')]=_0x4e9599['callbackuniqueid'];this[_0x28ca('0x1b')]=_0x4e9599[_0x28ca('0x1b')];this['recallme']=_0x4e9599[_0x28ca('0x1c')];this[_0x28ca('0x1d')]=_0x4e9599[_0x28ca('0x1d')];this['ListId']=_0x4e9599[_0x28ca('0x1e')];this['UserId']=_0x4e9599[_0x28ca('0x1f')];this[_0x28ca('0x20')]=_0x4e9599[_0x28ca('0x20')];this[_0x28ca('0x21')]=_0x4e9599[_0x28ca('0x21')];this[_0x28ca('0x22')]=_0x4e9599[_0x28ca('0x22')]||'';this[_0x28ca('0x23')]=_0x4e9599[_0x28ca('0x23')]||'';this['state']=_0x4e9599[_0x28ca('0x24')];this[_0x28ca('0x25')]=_0x4e9599['statedesc'];}module['exports']=History; \ No newline at end of file diff --git a/server/services/ami/dialer/models/queueCallerAbandon.js b/server/services/ami/dialer/models/queueCallerAbandon.js index 5770684..97e673f 100644 --- a/server/services/ami/dialer/models/queueCallerAbandon.js +++ b/server/services/ami/dialer/models/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4a88=['countdropretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime','droptime','dropreason','ringtime','getSeconds','holdtime','talktime','queue','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x4a88,0x1ad));var _0x84a8=function(_0x34cc73,_0x3a3c21){_0x34cc73=_0x34cc73-0x0;var _0x427632=_0x4a88[_0x34cc73];return _0x427632;};'use strict';var utils=require(_0x84a8('0x0'));function QueueCallerAbandon(_0x332ec5,_0x18ed74){this['scheduledat']=_0x332ec5[_0x84a8('0x1')];this[_0x84a8('0x2')]=_0x332ec5[_0x84a8('0x2')];this[_0x84a8('0x3')]=_0x332ec5[_0x84a8('0x2')]==='outbound'?'queue':_0x332ec5[_0x84a8('0x2')];this[_0x84a8('0x4')]=_0x332ec5[_0x84a8('0x4')];this[_0x84a8('0x5')]=_0x332ec5[_0x84a8('0x5')];this[_0x84a8('0x6')]=_0x332ec5['countnoanswerretry'];this[_0x84a8('0x7')]=_0x332ec5[_0x84a8('0x4')]+_0x332ec5[_0x84a8('0x5')]+_0x332ec5[_0x84a8('0x6')]+_0x332ec5[_0x84a8('0x8')]+_0x332ec5['countdropretry']+_0x332ec5[_0x84a8('0x9')]+_0x332ec5[_0x84a8('0xa')]+_0x332ec5['countagentrejectretry'];this[_0x84a8('0x8')]=_0x332ec5['countnosuchnumberretry'];this[_0x84a8('0xb')]=_0x332ec5[_0x84a8('0xb')];this[_0x84a8('0x9')]=_0x332ec5[_0x84a8('0x9')];this[_0x84a8('0xa')]=_0x332ec5['countmachineretry'];this[_0x84a8('0xc')]=_0x332ec5[_0x84a8('0xc')];this[_0x84a8('0xd')]=_0x18ed74[_0x84a8('0xd')];this[_0x84a8('0xe')]=_0x332ec5[_0x84a8('0xf')];this['calleridnum']=_0x332ec5[_0x84a8('0x10')];this[_0x84a8('0x11')]=_0x332ec5[_0x84a8('0x11')];this[_0x84a8('0x12')]=_0x332ec5[_0x84a8('0x12')];this[_0x84a8('0x13')]=_0x332ec5[_0x84a8('0x13')];this[_0x84a8('0x14')]=_0x332ec5[_0x84a8('0x14')];this['endtime']=this[_0x84a8('0x13')];this[_0x84a8('0x15')]=utils[_0x84a8('0x16')](_0x332ec5[_0x84a8('0x12')],_0x332ec5[_0x84a8('0x11')]);this[_0x84a8('0x17')]=utils[_0x84a8('0x16')](this[_0x84a8('0x13')],_0x332ec5[_0x84a8('0x12')]);this[_0x84a8('0x18')]=0x0;this[_0x84a8('0x19')]=_0x18ed74[_0x84a8('0x19')];this[_0x84a8('0x1a')]=_0x18ed74[_0x84a8('0x1b')];this[_0x84a8('0x1c')]=_0x18ed74[_0x84a8('0x1c')];this[_0x84a8('0x1d')]=_0x332ec5['callback'];this['callbackuniqueid']=_0x332ec5[_0x84a8('0x1e')];this[_0x84a8('0x1f')]=_0x332ec5[_0x84a8('0x1f')];this['recallme']=_0x332ec5[_0x84a8('0x20')];this['ContactId']=_0x332ec5[_0x84a8('0x21')];this[_0x84a8('0x22')]=_0x332ec5[_0x84a8('0x22')];this[_0x84a8('0x23')]=_0x332ec5[_0x84a8('0x23')];this[_0x84a8('0x24')]=_0x332ec5[_0x84a8('0x24')];this[_0x84a8('0x25')]=_0x332ec5[_0x84a8('0x25')];this[_0x84a8('0x26')]=_0x332ec5['originatecalleridnum']||'';this[_0x84a8('0x27')]=_0x332ec5[_0x84a8('0x27')]||'';this[_0x84a8('0x28')]=_0x332ec5[_0x84a8('0x28')];this[_0x84a8('0x29')]=_0x332ec5[_0x84a8('0x29')];this['statedesc']=_0x332ec5[_0x84a8('0x2a')];}module[_0x84a8('0x2b')]=QueueCallerAbandon; \ No newline at end of file +var _0x03a1=['countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','droptime','dropreason','endtime','getSeconds','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','type','campaigntype','outbound','queue'];(function(_0x46cf00,_0x457a43){var _0x3974dc=function(_0x4b5d0a){while(--_0x4b5d0a){_0x46cf00['push'](_0x46cf00['shift']());}};_0x3974dc(++_0x457a43);}(_0x03a1,0x186));var _0x103a=function(_0xada6ba,_0x4511ab){_0xada6ba=_0xada6ba-0x0;var _0x561170=_0x03a1[_0xada6ba];return _0x561170;};'use strict';var utils=require(_0x103a('0x0'));function QueueCallerAbandon(_0x4a59db,_0x393d5a){this['scheduledat']=_0x4a59db[_0x103a('0x1')];this[_0x103a('0x2')]=_0x4a59db[_0x103a('0x2')];this[_0x103a('0x3')]=_0x4a59db[_0x103a('0x2')]===_0x103a('0x4')?_0x103a('0x5'):_0x4a59db['type'];this[_0x103a('0x6')]=_0x4a59db[_0x103a('0x6')];this['countcongestionretry']=_0x4a59db[_0x103a('0x7')];this[_0x103a('0x8')]=_0x4a59db[_0x103a('0x8')];this[_0x103a('0x9')]=_0x4a59db[_0x103a('0x6')]+_0x4a59db[_0x103a('0x7')]+_0x4a59db['countnoanswerretry']+_0x4a59db['countnosuchnumberretry']+_0x4a59db[_0x103a('0xa')]+_0x4a59db['countabandonedretry']+_0x4a59db[_0x103a('0xb')]+_0x4a59db[_0x103a('0xc')];this[_0x103a('0xd')]=_0x4a59db[_0x103a('0xd')];this['countdropretry']=_0x4a59db[_0x103a('0xa')];this[_0x103a('0xe')]=_0x4a59db[_0x103a('0xe')];this[_0x103a('0xb')]=_0x4a59db[_0x103a('0xb')];this[_0x103a('0xc')]=_0x4a59db[_0x103a('0xc')];this['uniqueid']=_0x393d5a[_0x103a('0xf')];this[_0x103a('0x10')]=_0x4a59db['name'];this[_0x103a('0x11')]=_0x4a59db[_0x103a('0x12')];this[_0x103a('0x13')]=_0x4a59db[_0x103a('0x13')];this[_0x103a('0x14')]=_0x4a59db['responsetime'];this[_0x103a('0x15')]=_0x4a59db[_0x103a('0x15')];this['dropreason']=_0x4a59db[_0x103a('0x16')];this[_0x103a('0x17')]=this[_0x103a('0x15')];this['ringtime']=utils[_0x103a('0x18')](_0x4a59db['responsetime'],_0x4a59db[_0x103a('0x13')]);this[_0x103a('0x19')]=utils['getSeconds'](this[_0x103a('0x15')],_0x4a59db[_0x103a('0x14')]);this[_0x103a('0x1a')]=0x0;this[_0x103a('0x5')]=_0x393d5a['queue'];this[_0x103a('0x1b')]=_0x393d5a['connectedlinename'];this['reason']=_0x393d5a[_0x103a('0x1c')];this[_0x103a('0x1d')]=_0x4a59db['callback'];this[_0x103a('0x1e')]=_0x4a59db['callbackuniqueid'];this[_0x103a('0x1f')]=_0x4a59db[_0x103a('0x1f')];this[_0x103a('0x20')]=_0x4a59db[_0x103a('0x20')];this['ContactId']=_0x4a59db[_0x103a('0x21')];this[_0x103a('0x22')]=_0x4a59db[_0x103a('0x22')];this[_0x103a('0x23')]=_0x4a59db['UserId'];this['VoiceQueueId']=_0x4a59db[_0x103a('0x24')];this[_0x103a('0x25')]=_0x4a59db[_0x103a('0x25')];this[_0x103a('0x26')]=_0x4a59db[_0x103a('0x26')]||'';this[_0x103a('0x27')]=_0x4a59db[_0x103a('0x27')]||'';this['agiafterat']=_0x4a59db[_0x103a('0x28')];this['state']=_0x4a59db[_0x103a('0x29')];this[_0x103a('0x2a')]=_0x4a59db['statedesc'];}module[_0x103a('0x2b')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/hopper.js b/server/services/ami/dialer/utils/hopper.js index 8e4be41..97085a1 100644 --- a/server/services/ami/dialer/utils/hopper.js +++ b/server/services/ami/dialer/utils/hopper.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7096=['countReScheduled','[countReScheduled]','rescheduleContact','[rescheduleContact]','unlockContact','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr','[checkIsBlackListIvr]','verifyAdditionalPhones','[swapAdditionalPhone]','swapAdditionalPhones','avgHandleTime','[createHistory]','../../../../config/logger','../../rpc/cmHopper','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','getContactDialer','dialOrderByScheduledAt','catch','temp','error','getContactDialerIvr','[getContactDialerIvr]'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7096,0x10c));var _0x6709=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x7096[_0x4e9628];return _0x27bc8c;};'use strict';var util=require('util');var logger=require(_0x6709('0x0'))('dialer');var cmHopper=require(_0x6709('0x1'));var cmHopperAdditionalPhone=require('../../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0x6709('0x2'));var cmHopperHistory=require(_0x6709('0x3'));function inspectError(_0x3e85e4){return util[_0x6709('0x4')](_0x3e85e4,{'showHidden':![],'depth':null});}function getContactDialer(_0x3cd087,_0x3c8599,_0xb8fe6d){return cmHopper[_0x6709('0x5')](_0x3cd087['id'],_0x3c8599,_0xb8fe6d,_0x3cd087[_0x6709('0x6')])[_0x6709('0x7')](function(_0x11ad23){_0x3cd087[_0x6709('0x8')]=0x0;logger[_0x6709('0x9')]('[getContactDialer]',inspectError(_0x11ad23));});}exports['getContactDialer']=getContactDialer;function getContactDialerIvr(_0x2c07b1,_0x2d8c0b){return cmHopper[_0x6709('0xa')](_0x2c07b1['id'],_0x2d8c0b,_0x2c07b1[_0x6709('0x6')])[_0x6709('0x7')](function(_0x426ea1){_0x2c07b1['temp']=0x0;logger['error'](_0x6709('0xb'),inspectError(_0x426ea1));});}exports[_0x6709('0xa')]=getContactDialerIvr;function countReScheduled(_0x275dd3){return cmHopper[_0x6709('0xc')](_0x275dd3)[_0x6709('0x7')](function(_0x288f51){logger[_0x6709('0x9')](_0x6709('0xd'),inspectError(_0x288f51));});}exports['countReScheduled']=countReScheduled;function rescheduleContact(_0x78ce3){return cmHopper[_0x6709('0xe')](_0x78ce3)[_0x6709('0x7')](function(_0x3706e1){logger['error'](_0x6709('0xf'),inspectError(_0x3706e1));});}exports['rescheduleContact']=rescheduleContact;function unlockContact(_0x41af1f,_0x4bc059,_0x149233){return cmHopper[_0x6709('0x10')](_0x41af1f,_0x4bc059,_0x149233)[_0x6709('0x7')](function(_0x3d5c28){logger['error']('[unlockContact]',inspectError(_0x3d5c28));});}exports['unlockContact']=unlockContact;function moveContactManagedDialer(_0x3fa5b1){return cmHopper[_0x6709('0x11')](_0x3fa5b1)['catch'](function(_0x9c1fd8){logger[_0x6709('0x9')](_0x6709('0x12'),inspectError(_0x9c1fd8));});}exports['moveContactManagedDialer']=moveContactManagedDialer;function checkIsBlackList(_0x13cf04){return cmHopperBlack[_0x6709('0x13')](_0x13cf04)[_0x6709('0x7')](function(_0x27a27b){logger['error'](_0x6709('0x14'),inspectError(_0x27a27b));});}exports[_0x6709('0x13')]=checkIsBlackList;function checkIsBlackListIvr(_0x373047){return cmHopperBlack[_0x6709('0x15')](_0x373047)[_0x6709('0x7')](function(_0x224e8a){logger[_0x6709('0x9')](_0x6709('0x16'),inspectError(_0x224e8a));});}exports[_0x6709('0x15')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x1c5153,_0x2f3415,_0xa36371){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x1c5153,_0x2f3415,_0xa36371)[_0x6709('0x7')](function(_0x81138e){logger[_0x6709('0x9')]('[verifyAdditionalPhone]',inspectError(_0x81138e));});}exports[_0x6709('0x17')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x32d346,_0x20a347,_0x44b465){return cmHopperAdditionalPhone['swapAdditionalPhones'](_0x32d346,_0x20a347,_0x44b465)[_0x6709('0x7')](function(_0x3076fe){logger['error'](_0x6709('0x18'),inspectError(_0x3076fe));});}exports[_0x6709('0x19')]=swapAdditionalPhones;function avgHandleTime(_0x5dbb87){return cmHopperHistory[_0x6709('0x1a')](_0x5dbb87)[_0x6709('0x7')](function(_0x50ada6){logger[_0x6709('0x9')]('[avgHandleTime]',inspectError(_0x50ada6));});}exports[_0x6709('0x1a')]=avgHandleTime;function createHistory(_0x3cd555){return cmHopperHistory['createHistory'](_0x3cd555)[_0x6709('0x7')](function(_0x4e6989){logger[_0x6709('0x9')](_0x6709('0x1b'),inspectError(_0x4e6989));});}exports['createHistory']=createHistory; \ No newline at end of file +var _0xbd51=['[swapAdditionalPhone]','[avgHandleTime]','avgHandleTime','createHistory','util','dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','getContactDialer','catch','temp','error','[getContactDialer]','getContactDialerIvr','dialOrderByScheduledAt','countReScheduled','[countReScheduled]','[rescheduleContact]','rescheduleContact','unlockContact','[unlockContact]','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr','[checkIsBlackListIvr]','verifyAdditionalPhones','swapAdditionalPhones'];(function(_0x216ce6,_0x46c8d4){var _0xef63ab=function(_0x76d4be){while(--_0x76d4be){_0x216ce6['push'](_0x216ce6['shift']());}};_0xef63ab(++_0x46c8d4);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x3baa77,_0x3e9a9d){_0x3baa77=_0x3baa77-0x0;var _0x364d77=_0xbd51[_0x3baa77];return _0x364d77;};'use strict';var util=require(_0x1bd5('0x0'));var logger=require('../../../../config/logger')(_0x1bd5('0x1'));var cmHopper=require(_0x1bd5('0x2'));var cmHopperAdditionalPhone=require(_0x1bd5('0x3'));var cmHopperBlack=require(_0x1bd5('0x4'));var cmHopperHistory=require('../../rpc/cmHopperHistory');function inspectError(_0x4d1bba){return util['inspect'](_0x4d1bba,{'showHidden':![],'depth':null});}function getContactDialer(_0x531028,_0x3bce00,_0x362b24){return cmHopper[_0x1bd5('0x5')](_0x531028['id'],_0x3bce00,_0x362b24,_0x531028['dialOrderByScheduledAt'])[_0x1bd5('0x6')](function(_0x30a385){_0x531028[_0x1bd5('0x7')]=0x0;logger[_0x1bd5('0x8')](_0x1bd5('0x9'),inspectError(_0x30a385));});}exports['getContactDialer']=getContactDialer;function getContactDialerIvr(_0x36ef1a,_0x5c8e0d){return cmHopper[_0x1bd5('0xa')](_0x36ef1a['id'],_0x5c8e0d,_0x36ef1a[_0x1bd5('0xb')])[_0x1bd5('0x6')](function(_0x1fbc68){_0x36ef1a[_0x1bd5('0x7')]=0x0;logger[_0x1bd5('0x8')]('[getContactDialerIvr]',inspectError(_0x1fbc68));});}exports[_0x1bd5('0xa')]=getContactDialerIvr;function countReScheduled(_0x4e666c){return cmHopper[_0x1bd5('0xc')](_0x4e666c)[_0x1bd5('0x6')](function(_0x37e8e1){logger[_0x1bd5('0x8')](_0x1bd5('0xd'),inspectError(_0x37e8e1));});}exports[_0x1bd5('0xc')]=countReScheduled;function rescheduleContact(_0x1527c1){return cmHopper['rescheduleContact'](_0x1527c1)['catch'](function(_0x8b2390){logger[_0x1bd5('0x8')](_0x1bd5('0xe'),inspectError(_0x8b2390));});}exports[_0x1bd5('0xf')]=rescheduleContact;function unlockContact(_0x48d048,_0x5072c2,_0xa63190){return cmHopper[_0x1bd5('0x10')](_0x48d048,_0x5072c2,_0xa63190)[_0x1bd5('0x6')](function(_0x4793dd){logger[_0x1bd5('0x8')](_0x1bd5('0x11'),inspectError(_0x4793dd));});}exports[_0x1bd5('0x10')]=unlockContact;function moveContactManagedDialer(_0x3afc4a){return cmHopper[_0x1bd5('0x12')](_0x3afc4a)['catch'](function(_0x53ad5e){logger[_0x1bd5('0x8')](_0x1bd5('0x13'),inspectError(_0x53ad5e));});}exports[_0x1bd5('0x12')]=moveContactManagedDialer;function checkIsBlackList(_0xb95d4e){return cmHopperBlack[_0x1bd5('0x14')](_0xb95d4e)[_0x1bd5('0x6')](function(_0x3fbb39){logger[_0x1bd5('0x8')](_0x1bd5('0x15'),inspectError(_0x3fbb39));});}exports[_0x1bd5('0x14')]=checkIsBlackList;function checkIsBlackListIvr(_0x34bd6a){return cmHopperBlack[_0x1bd5('0x16')](_0x34bd6a)[_0x1bd5('0x6')](function(_0x7ff933){logger[_0x1bd5('0x8')](_0x1bd5('0x17'),inspectError(_0x7ff933));});}exports[_0x1bd5('0x16')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x29c340,_0x5567c9,_0x42c43d){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x29c340,_0x5567c9,_0x42c43d)[_0x1bd5('0x6')](function(_0x1e534e){logger[_0x1bd5('0x8')]('[verifyAdditionalPhone]',inspectError(_0x1e534e));});}exports[_0x1bd5('0x18')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x4fa37c,_0x2ed551,_0x30676d){return cmHopperAdditionalPhone[_0x1bd5('0x19')](_0x4fa37c,_0x2ed551,_0x30676d)[_0x1bd5('0x6')](function(_0x47c84b){logger[_0x1bd5('0x8')](_0x1bd5('0x1a'),inspectError(_0x47c84b));});}exports[_0x1bd5('0x19')]=swapAdditionalPhones;function avgHandleTime(_0x3b1090){return cmHopperHistory['avgHandleTime'](_0x3b1090)[_0x1bd5('0x6')](function(_0x24d4d9){logger[_0x1bd5('0x8')](_0x1bd5('0x1b'),inspectError(_0x24d4d9));});}exports[_0x1bd5('0x1c')]=avgHandleTime;function createHistory(_0xc73670){return cmHopperHistory['createHistory'](_0xc73670)[_0x1bd5('0x6')](function(_0x472b22){logger[_0x1bd5('0x8')]('[createHistory]',inspectError(_0x472b22));});}exports[_0x1bd5('0x1d')]=createHistory; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/index.js b/server/services/ami/dialer/utils/index.js index 90efd90..418204f 100644 --- a/server/services/ami/dialer/utils/index.js +++ b/server/services/ami/dialer/utils/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9b58=['IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','CAMPAIGN_STATUS','dialMethod','preview','isPreviewCampaign','ivr','isIVRCampaign','type','isOutboundQueue','dialActive','isQueueCampaignActive','isIVRCampaignActive','diff','seconds','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','active','hasQueueCampaignDataChanged','dialTimezone','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','includes','TrunkBackup','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','match','extractCalleridName','isUndefined','string','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','getCallerId','pow','replace','random','toString','getCallerIdRandom','error','decrementOriginate','length','checkContactEmpty','erlangb','tags','updatedAt','undefined','description','XMD-','toUpperCase','substring','setXMDContactVariables','lodash','moment','util','dialer','../../../../config/environment/shared','timezones','ACTIVE','BLACKLIST'];(function(_0x39b957,_0x45ed84){var _0x17609a=function(_0x701d3e){while(--_0x701d3e){_0x39b957['push'](_0x39b957['shift']());}};_0x17609a(++_0x45ed84);}(_0x9b58,0x160));var _0x89b5=function(_0x1b4d59,_0x52610a){_0x1b4d59=_0x1b4d59-0x0;var _0x5e3006=_0x9b58[_0x1b4d59];return _0x5e3006;};'use strict';var _=require(_0x89b5('0x0'));var moment=require(_0x89b5('0x1'));var util=require(_0x89b5('0x2'));var logger=require('../../../../config/logger')(_0x89b5('0x3'));var timezones=require(_0x89b5('0x4'))[_0x89b5('0x5')];var CAMPAIGN_STATUS={'ACTIVE':_0x89b5('0x6'),'BLACKLIST':_0x89b5('0x7'),'CONTACTS_RESCHEDULED':'RESCHEDULED_CONTACTS','DEACTIVATED':'DEACTIVATED','DISACTIVED':_0x89b5('0x8'),'EMPTY_INTERVAL':_0x89b5('0x9'),'INACTIVE':_0x89b5('0xa'),'NO_AGENTS_LOGGED':_0x89b5('0xb'),'NO_AVAILABLE_CONTACTS':_0x89b5('0xc'),'NULL_INTERVAL':'INTERVAL_IS_NULL','OVERTIME_INTERVAL':_0x89b5('0xd'),'OVERTIME_GLOBAL_INTERVAL':_0x89b5('0xe'),'QUEUE_RECALL':_0x89b5('0xf'),'RECALL_TIMEOUT':_0x89b5('0x10'),'RUNNING':'RUNNING','UNKNOWN_TIMEZONE':'TIMEZONE_UNKNOW','UNREACHABLE_TRUNK':'TRUNK_IS_NOT_REACHABLE'};exports[_0x89b5('0x11')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x11ff2d){return _0x11ff2d[_0x89b5('0x12')]===_0x89b5('0x13');}exports[_0x89b5('0x14')]=isPreviewCampaign;function isIVRCampaign(_0x4e3cb3){return _0x4e3cb3['type']===_0x89b5('0x15');}exports[_0x89b5('0x16')]=isIVRCampaign;function isOutboundQueue(_0x3a05f2){return _0x3a05f2[_0x89b5('0x17')]==='outbound';}exports[_0x89b5('0x18')]=isOutboundQueue;function isQueueCampaignActive(_0x53841f){return _0x53841f[_0x89b5('0x19')];}exports[_0x89b5('0x1a')]=isQueueCampaignActive;function isIVRCampaignActive(_0x3ffa33){return _0x3ffa33['active'];}exports[_0x89b5('0x1b')]=isIVRCampaignActive;function getSeconds(_0x1193d1,_0x556725){var _0x56c5b4=moment(_0x1193d1)['milliseconds'](0x0);var _0x32add1=moment(_0x556725)['milliseconds'](0x0);return _0x56c5b4[_0x89b5('0x1c')](_0x32add1,_0x89b5('0x1d'));}exports[_0x89b5('0x1e')]=getSeconds;function hasQueueCampaignDataChanged(_0x3f9625,_0x197e84){var _0xf14e6d=![];var _0x3d4813=_0x3f9625[_0x89b5('0x12')]!==_0x197e84[_0x89b5('0x12')]||_0x3f9625['dialActive']!==_0x197e84[_0x89b5('0x19')]||_0x3f9625['message']!==_0x197e84[_0x89b5('0x1f')];var _0xac4283=_0x3f9625[_0x89b5('0x20')]!==_0x197e84[_0x89b5('0x20')]||_0x3f9625[_0x89b5('0x21')]!==_0x197e84['loggedIn']||_0x3f9625[_0x89b5('0x22')]!==_0x197e84[_0x89b5('0x22')]||_0x3f9625[_0x89b5('0x23')]!==_0x197e84[_0x89b5('0x23')]||_0x3f9625[_0x89b5('0x24')]!==_0x197e84['talking']||_0x3f9625[_0x89b5('0x25')]!==_0x197e84[_0x89b5('0x25')]||_0x3f9625[_0x89b5('0x26')]!==_0x197e84[_0x89b5('0x26')]||_0x3f9625[_0x89b5('0x27')]!==_0x197e84['inUse']||_0x3f9625[_0x89b5('0x28')]!==_0x197e84[_0x89b5('0x28')];if(_0x3f9625[_0x89b5('0x29')]&&_0x197e84[_0x89b5('0x29')]){_0xf14e6d=_0x3f9625['Trunk'][_0x89b5('0x2a')]!==_0x197e84[_0x89b5('0x29')][_0x89b5('0x2a')]||_0x3f9625[_0x89b5('0x29')][_0x89b5('0x2b')]!==_0x197e84['Trunk'][_0x89b5('0x2b')];}return _0x3d4813||_0xac4283||_0xf14e6d;}exports[_0x89b5('0x2c')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x7db09c){var _0x8669f9=null;var _0x6fbb7b=_0x7db09c[_0x89b5('0x2d')];if(_[_0x89b5('0x2e')](_0x7db09c[_0x89b5('0x2f')])||_['isNil'](_0x7db09c[_0x89b5('0x30')])||_['isNil'](_0x7db09c[_0x89b5('0x30')][_0x89b5('0x31')])){_0x8669f9=CAMPAIGN_STATUS[_0x89b5('0x32')];}else if(_[_0x89b5('0x33')](_0x7db09c[_0x89b5('0x2f')])||_[_0x89b5('0x33')](_0x7db09c[_0x89b5('0x30')]['Intervals'])){_0x8669f9=CAMPAIGN_STATUS[_0x89b5('0x34')];}else if(_0x6fbb7b&&!timezones[_0x6fbb7b]){_0x8669f9=CAMPAIGN_STATUS[_0x89b5('0x35')];}return _0x8669f9;}function checkAnyValidTrunk(_0x58a374,_0x4f83c9){var _0x362982=null;var _0x24a43f=_0x89b5('0x36');var _0x2a620f=[_0x89b5('0x37'),'unmonitored'];var _0x4bd9d7=!![];if(_0x58a374[_0x89b5('0x29')]&&_0x58a374['Trunk']['active']){_0x24a43f+=_0x58a374[_0x89b5('0x29')][_0x89b5('0x2a')];_0x362982=_0x4f83c9[_0x24a43f];_0x4bd9d7=_0x2a620f[_0x89b5('0x38')](_0x362982['status']);}else if(_0x58a374[_0x89b5('0x39')]&&_0x58a374[_0x89b5('0x39')]['active']){_0x24a43f+=_0x58a374[_0x89b5('0x39')]['name'];_0x362982=_0x4f83c9[_0x24a43f];_0x4bd9d7=_0x2a620f['includes'](_0x362982['status']);}return _0x4bd9d7;}function getQueueCampaignStatusMessage(_0x2a5244,_0x394e35){var _0x243cd2=CAMPAIGN_STATUS[_0x89b5('0x6')];var _0x3fe9f9=isPreviewCampaign(_0x2a5244);if(!isQueueCampaignActive(_0x2a5244)){if(_0x3fe9f9){_0x243cd2=CAMPAIGN_STATUS['INACTIVE'];}else{if(_0x2a5244['originated']===0x0&&_0x2a5244[_0x89b5('0x24')]===0x0&&_0x2a5244['waiting']===0x0&&(_0x2a5244[_0x89b5('0x25')]||0x0)===0x0){_0x243cd2=CAMPAIGN_STATUS[_0x89b5('0x3a')];}else{_0x243cd2=CAMPAIGN_STATUS[_0x89b5('0x3b')];}}}else if(_0x2a5244['loggedIn']===0x0){_0x243cd2=CAMPAIGN_STATUS[_0x89b5('0x3c')];}else if(!checkAnyValidTrunk(_0x2a5244,_0x394e35)){_0x243cd2=CAMPAIGN_STATUS[_0x89b5('0x3d')];}else if(!isPreviewCampaign(_0x2a5244)){var _0x39dd5c=checkAnyValidQueueCampaignInterval(_0x2a5244);if(_0x39dd5c){_0x243cd2=_0x39dd5c;}}return _0x243cd2;}exports[_0x89b5('0x3e')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x525ab1){var _0x5a7d5d=CAMPAIGN_STATUS[_0x89b5('0x3b')];if(_0x525ab1[_0x89b5('0x28')]===0x0&&_0x525ab1[_0x89b5('0x24')]===0x0&&_0x525ab1[_0x89b5('0x26')]===0x0&&(_0x525ab1[_0x89b5('0x25')]||0x0)===0x0){_0x5a7d5d=CAMPAIGN_STATUS[_0x89b5('0x3a')];}return _0x5a7d5d;}exports[_0x89b5('0x3f')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x20c13b){var _0x1dcdf7=_0x20c13b[_0x89b5('0x40')](/"(.*?)"/);return _0x1dcdf7?_0x1dcdf7[0x1]:_0x20c13b;}exports[_0x89b5('0x41')]=extractCalleridName;function getCallerId(_0x130310,_0x495f04,_0x4184b4){if(!_[_0x89b5('0x42')](_0x4184b4)&&typeof _0x4184b4===_0x89b5('0x43')&&!_[_0x89b5('0x33')](_0x4184b4)){if(!_[_0x89b5('0x42')](_0x495f04)&&typeof _0x495f04==='string'&&!_[_0x89b5('0x33')](_0x495f04)){return util['format'](_0x89b5('0x44'),_0x495f04,_0x4184b4);}return util[_0x89b5('0x45')](_0x89b5('0x44'),_0x4184b4,_0x4184b4);}if(!_['isUndefined'](_0x130310)&&typeof _0x130310===_0x89b5('0x43')&&!_['isEmpty'](_0x130310)){return _0x130310;}return _0x89b5('0x46');}exports[_0x89b5('0x47')]=getCallerId;function getCallerIdRandom(_0x5f5561,_0x51dfdf){var _0x4465f8;var _0x5a4bd8;var _0x34ec8f;if(_0x51dfdf<=0x0){_0x51dfdf=0x1;}_0x4465f8=new RegExp('\x5cw{0,'+_0x51dfdf+'}$');_0x5a4bd8=Math[_0x89b5('0x48')](0xa,_0x51dfdf-0x1);_0x34ec8f=Math[_0x89b5('0x48')](0xa,_0x51dfdf)-0x1;return util[_0x89b5('0x45')]('%s',_[_0x89b5('0x49')](_0x5f5561,_0x4465f8,_[_0x89b5('0x4a')](_0x5a4bd8,_0x34ec8f)[_0x89b5('0x4b')]()));}exports[_0x89b5('0x4c')]=getCallerIdRandom;function decrementOriginate(_0x549d48){if(_0x549d48[_0x89b5('0x28')]&&_0x549d48[_0x89b5('0x28')]>0x0){_0x549d48[_0x89b5('0x28')]-=0x1;}else{logger[_0x89b5('0x4d')]('[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative');}}exports[_0x89b5('0x4e')]=decrementOriginate;function checkContactEmpty(_0x1066ec){return _0x1066ec&&_0x1066ec[_0x89b5('0x4f')]>0x0;}exports[_0x89b5('0x50')]=checkContactEmpty;function erlangb(_0x2114b3,_0x13bc46){if(_0x13bc46===0x0){return 0x0;}var _0x555d1e=0x1;for(var _0x412e0b=0x1;_0x412e0b<=_0x13bc46;_0x412e0b+=0x1){_0x555d1e=0x1+_0x555d1e*_0x412e0b/_0x2114b3;}return 0x1/_0x555d1e;}exports[_0x89b5('0x51')]=erlangb;function checkContactLowerLimitOriginate(_0x5bf922,_0xe32361,_0x3c222d){if(_0xe32361>_0x3c222d){for(var _0x1910ed=0x0;_0x1910ed<_0xe32361-_0x3c222d;_0x1910ed+=0x1){decrementOriginate(_0x5bf922);}}}exports['checkContactLowerLimitOriginate']=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x4c5743){var _0x4efce2={};var _0x4f3923=['id','createdAt',_0x89b5('0x52'),_0x89b5('0x53')];const _0x219e9c=0xfa;if(_0x4c5743){for(var _0x32082b in _0x4c5743){if(typeof _0x4c5743[_0x32082b]!==_0x89b5('0x54')){if(!_[_0x89b5('0x2e')](_0x4c5743[_0x32082b])&&!_0x4f3923['includes'](_0x32082b)){if(_0x32082b===_0x89b5('0x55')&&_0x4c5743[_0x32082b][_0x89b5('0x4f')]>_0x219e9c){_0x4efce2[_0x89b5('0x56')+_0x32082b[_0x89b5('0x57')]()]=_0x4c5743[_0x32082b]['toString']()[_0x89b5('0x58')](0x0,_0x219e9c);}else{_0x4efce2[_0x89b5('0x56')+_0x32082b['toUpperCase']()]=_0x4c5743[_0x32082b];}}}}}return _0x4efce2;}exports[_0x89b5('0x59')]=setXMDContactVariables; \ No newline at end of file +var _0xc014=['INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','preview','isPreviewCampaign','ivr','type','outbound','isOutboundQueue','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds','diff','getSeconds','dialActive','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','dialTimezone','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','SIP/','reachable','unmonitored','includes','status','TrunkBackup','INACTIVE','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','DISACTIVED','getQueueCampaignActiveStatusMessage','match','extractCalleridName','string','format','\x22%s\x22\x20<%s>','getCallerId','\x5cw{0,','pow','replace','toString','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','checkContactEmpty','erlangb','createdAt','description','length','XMD-','toUpperCase','substring','setXMDContactVariables','lodash','util','../../../../config/logger','dialer','../../../../config/environment/shared','timezones','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL'];(function(_0x446d05,_0x411daf){var _0x130580=function(_0x499168){while(--_0x499168){_0x446d05['push'](_0x446d05['shift']());}};_0x130580(++_0x411daf);}(_0xc014,0x14e));var _0x4c01=function(_0x38eb23,_0x196e8b){_0x38eb23=_0x38eb23-0x0;var _0x48506a=_0xc014[_0x38eb23];return _0x48506a;};'use strict';var _=require(_0x4c01('0x0'));var moment=require('moment');var util=require(_0x4c01('0x1'));var logger=require(_0x4c01('0x2'))(_0x4c01('0x3'));var timezones=require(_0x4c01('0x4'))[_0x4c01('0x5')];var CAMPAIGN_STATUS={'ACTIVE':_0x4c01('0x6'),'BLACKLIST':_0x4c01('0x7'),'CONTACTS_RESCHEDULED':_0x4c01('0x8'),'DEACTIVATED':_0x4c01('0x9'),'DISACTIVED':'IS_DISACTIVED','EMPTY_INTERVAL':_0x4c01('0xa'),'INACTIVE':_0x4c01('0xb'),'NO_AGENTS_LOGGED':'AGENTS_NOT_LOGGED','NO_AVAILABLE_CONTACTS':_0x4c01('0xc'),'NULL_INTERVAL':_0x4c01('0xd'),'OVERTIME_INTERVAL':_0x4c01('0xe'),'OVERTIME_GLOBAL_INTERVAL':'GLOBAL_INTERVAL_IS_OVERTIME','QUEUE_RECALL':_0x4c01('0xf'),'RECALL_TIMEOUT':_0x4c01('0x10'),'RUNNING':_0x4c01('0x11'),'UNKNOWN_TIMEZONE':_0x4c01('0x12'),'UNREACHABLE_TRUNK':_0x4c01('0x13')};exports[_0x4c01('0x14')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x3b3237){return _0x3b3237[_0x4c01('0x15')]===_0x4c01('0x16');}exports[_0x4c01('0x17')]=isPreviewCampaign;function isIVRCampaign(_0x125b98){return _0x125b98['type']===_0x4c01('0x18');}exports['isIVRCampaign']=isIVRCampaign;function isOutboundQueue(_0x475a10){return _0x475a10[_0x4c01('0x19')]===_0x4c01('0x1a');}exports[_0x4c01('0x1b')]=isOutboundQueue;function isQueueCampaignActive(_0x200711){return _0x200711['dialActive'];}exports[_0x4c01('0x1c')]=isQueueCampaignActive;function isIVRCampaignActive(_0x57f89d){return _0x57f89d[_0x4c01('0x1d')];}exports[_0x4c01('0x1e')]=isIVRCampaignActive;function getSeconds(_0x2554a2,_0x71a836){var _0x5e769e=moment(_0x2554a2)[_0x4c01('0x1f')](0x0);var _0x57a60b=moment(_0x71a836)[_0x4c01('0x1f')](0x0);return _0x5e769e[_0x4c01('0x20')](_0x57a60b,'seconds');}exports[_0x4c01('0x21')]=getSeconds;function hasQueueCampaignDataChanged(_0x2900bd,_0x29f454){var _0x4a47e1=![];var _0x5443e7=_0x2900bd[_0x4c01('0x15')]!==_0x29f454[_0x4c01('0x15')]||_0x2900bd[_0x4c01('0x22')]!==_0x29f454[_0x4c01('0x22')]||_0x2900bd[_0x4c01('0x23')]!==_0x29f454[_0x4c01('0x23')];var _0x31633b=_0x2900bd[_0x4c01('0x24')]!==_0x29f454[_0x4c01('0x24')]||_0x2900bd[_0x4c01('0x25')]!==_0x29f454[_0x4c01('0x25')]||_0x2900bd[_0x4c01('0x26')]!==_0x29f454[_0x4c01('0x26')]||_0x2900bd[_0x4c01('0x27')]!==_0x29f454[_0x4c01('0x27')]||_0x2900bd[_0x4c01('0x28')]!==_0x29f454[_0x4c01('0x28')]||_0x2900bd[_0x4c01('0x29')]!==_0x29f454[_0x4c01('0x29')]||_0x2900bd[_0x4c01('0x2a')]!==_0x29f454['waiting']||_0x2900bd[_0x4c01('0x2b')]!==_0x29f454[_0x4c01('0x2b')]||_0x2900bd[_0x4c01('0x2c')]!==_0x29f454[_0x4c01('0x2c')];if(_0x2900bd[_0x4c01('0x2d')]&&_0x29f454[_0x4c01('0x2d')]){_0x4a47e1=_0x2900bd[_0x4c01('0x2d')][_0x4c01('0x2e')]!==_0x29f454[_0x4c01('0x2d')][_0x4c01('0x2e')]||_0x2900bd[_0x4c01('0x2d')][_0x4c01('0x1d')]!==_0x29f454[_0x4c01('0x2d')][_0x4c01('0x1d')];}return _0x5443e7||_0x31633b||_0x4a47e1;}exports[_0x4c01('0x2f')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x5c29bb){var _0x5d3905=null;var _0x252101=_0x5c29bb[_0x4c01('0x30')];if(_[_0x4c01('0x31')](_0x5c29bb[_0x4c01('0x32')])||_[_0x4c01('0x31')](_0x5c29bb[_0x4c01('0x33')])||_[_0x4c01('0x31')](_0x5c29bb[_0x4c01('0x33')][_0x4c01('0x34')])){_0x5d3905=CAMPAIGN_STATUS[_0x4c01('0x35')];}else if(_[_0x4c01('0x36')](_0x5c29bb['dialGlobalInterval'])||_[_0x4c01('0x36')](_0x5c29bb['Interval'][_0x4c01('0x34')])){_0x5d3905=CAMPAIGN_STATUS[_0x4c01('0x37')];}else if(_0x252101&&!timezones[_0x252101]){_0x5d3905=CAMPAIGN_STATUS['UNKNOWN_TIMEZONE'];}return _0x5d3905;}function checkAnyValidTrunk(_0x3e3de6,_0x162896){var _0x32375a=null;var _0x2aacc9=_0x4c01('0x38');var _0x2d1641=[_0x4c01('0x39'),_0x4c01('0x3a')];var _0x1ac70a=!![];if(_0x3e3de6[_0x4c01('0x2d')]&&_0x3e3de6[_0x4c01('0x2d')][_0x4c01('0x1d')]){_0x2aacc9+=_0x3e3de6[_0x4c01('0x2d')]['name'];_0x32375a=_0x162896[_0x2aacc9];_0x1ac70a=_0x2d1641[_0x4c01('0x3b')](_0x32375a[_0x4c01('0x3c')]);}else if(_0x3e3de6[_0x4c01('0x3d')]&&_0x3e3de6['TrunkBackup'][_0x4c01('0x1d')]){_0x2aacc9+=_0x3e3de6['TrunkBackup'][_0x4c01('0x2e')];_0x32375a=_0x162896[_0x2aacc9];_0x1ac70a=_0x2d1641[_0x4c01('0x3b')](_0x32375a[_0x4c01('0x3c')]);}return _0x1ac70a;}function getQueueCampaignStatusMessage(_0x2d0f20,_0x20806b){var _0x2aa5af=CAMPAIGN_STATUS[_0x4c01('0x6')];var _0xa67337=isPreviewCampaign(_0x2d0f20);if(!isQueueCampaignActive(_0x2d0f20)){if(_0xa67337){_0x2aa5af=CAMPAIGN_STATUS[_0x4c01('0x3e')];}else{if(_0x2d0f20['originated']===0x0&&_0x2d0f20['talking']===0x0&&_0x2d0f20[_0x4c01('0x2a')]===0x0&&(_0x2d0f20[_0x4c01('0x29')]||0x0)===0x0){_0x2aa5af=CAMPAIGN_STATUS[_0x4c01('0x3e')];}else{_0x2aa5af=CAMPAIGN_STATUS['DISACTIVED'];}}}else if(_0x2d0f20[_0x4c01('0x25')]===0x0){_0x2aa5af=CAMPAIGN_STATUS[_0x4c01('0x3f')];}else if(!checkAnyValidTrunk(_0x2d0f20,_0x20806b)){_0x2aa5af=CAMPAIGN_STATUS[_0x4c01('0x40')];}else if(!isPreviewCampaign(_0x2d0f20)){var _0x1f9994=checkAnyValidQueueCampaignInterval(_0x2d0f20);if(_0x1f9994){_0x2aa5af=_0x1f9994;}}return _0x2aa5af;}exports['getQueueCampaignStatusMessage']=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x500f8f){var _0x1a053f=CAMPAIGN_STATUS[_0x4c01('0x41')];if(_0x500f8f[_0x4c01('0x2c')]===0x0&&_0x500f8f[_0x4c01('0x28')]===0x0&&_0x500f8f[_0x4c01('0x2a')]===0x0&&(_0x500f8f[_0x4c01('0x29')]||0x0)===0x0){_0x1a053f=CAMPAIGN_STATUS[_0x4c01('0x3e')];}return _0x1a053f;}exports[_0x4c01('0x42')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0xc44a79){var _0xc1df4d=_0xc44a79[_0x4c01('0x43')](/"(.*?)"/);return _0xc1df4d?_0xc1df4d[0x1]:_0xc44a79;}exports[_0x4c01('0x44')]=extractCalleridName;function getCallerId(_0x2bc7c3,_0x47bfc0,_0x1ca68f){if(!_['isUndefined'](_0x1ca68f)&&typeof _0x1ca68f===_0x4c01('0x45')&&!_[_0x4c01('0x36')](_0x1ca68f)){if(!_['isUndefined'](_0x47bfc0)&&typeof _0x47bfc0===_0x4c01('0x45')&&!_[_0x4c01('0x36')](_0x47bfc0)){return util[_0x4c01('0x46')](_0x4c01('0x47'),_0x47bfc0,_0x1ca68f);}return util[_0x4c01('0x46')](_0x4c01('0x47'),_0x1ca68f,_0x1ca68f);}if(!_['isUndefined'](_0x2bc7c3)&&typeof _0x2bc7c3===_0x4c01('0x45')&&!_[_0x4c01('0x36')](_0x2bc7c3)){return _0x2bc7c3;}return'\x22\x22\x20<>';}exports[_0x4c01('0x48')]=getCallerId;function getCallerIdRandom(_0x10b588,_0x28317a){var _0x1c2d14;var _0x1598a7;var _0xacfeba;if(_0x28317a<=0x0){_0x28317a=0x1;}_0x1c2d14=new RegExp(_0x4c01('0x49')+_0x28317a+'}$');_0x1598a7=Math[_0x4c01('0x4a')](0xa,_0x28317a-0x1);_0xacfeba=Math[_0x4c01('0x4a')](0xa,_0x28317a)-0x1;return util['format']('%s',_[_0x4c01('0x4b')](_0x10b588,_0x1c2d14,_['random'](_0x1598a7,_0xacfeba)[_0x4c01('0x4c')]()));}exports['getCallerIdRandom']=getCallerIdRandom;function decrementOriginate(_0x5613fb){if(_0x5613fb['originated']&&_0x5613fb[_0x4c01('0x2c')]>0x0){_0x5613fb[_0x4c01('0x2c')]-=0x1;}else{logger['error'](_0x4c01('0x4d'));}}exports['decrementOriginate']=decrementOriginate;function checkContactEmpty(_0x4440a7){return _0x4440a7&&_0x4440a7['length']>0x0;}exports[_0x4c01('0x4e')]=checkContactEmpty;function erlangb(_0x5508ed,_0x218ddf){if(_0x218ddf===0x0){return 0x0;}var _0x57cf70=0x1;for(var _0x25a6ef=0x1;_0x25a6ef<=_0x218ddf;_0x25a6ef+=0x1){_0x57cf70=0x1+_0x57cf70*_0x25a6ef/_0x5508ed;}return 0x1/_0x57cf70;}exports[_0x4c01('0x4f')]=erlangb;function checkContactLowerLimitOriginate(_0x2e97df,_0x5b3b30,_0xd743a4){if(_0x5b3b30>_0xd743a4){for(var _0x10d0d2=0x0;_0x10d0d2<_0x5b3b30-_0xd743a4;_0x10d0d2+=0x1){decrementOriginate(_0x2e97df);}}}exports['checkContactLowerLimitOriginate']=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x406bad){var _0x478878={};var _0x40d1f4=['id',_0x4c01('0x50'),'tags','updatedAt'];const _0x165b5c=0xfa;if(_0x406bad){for(var _0x8286d0 in _0x406bad){if(typeof _0x406bad[_0x8286d0]!=='undefined'){if(!_[_0x4c01('0x31')](_0x406bad[_0x8286d0])&&!_0x40d1f4[_0x4c01('0x3b')](_0x8286d0)){if(_0x8286d0===_0x4c01('0x51')&&_0x406bad[_0x8286d0][_0x4c01('0x52')]>_0x165b5c){_0x478878[_0x4c01('0x53')+_0x8286d0[_0x4c01('0x54')]()]=_0x406bad[_0x8286d0]['toString']()[_0x4c01('0x55')](0x0,_0x165b5c);}else{_0x478878[_0x4c01('0x53')+_0x8286d0[_0x4c01('0x54')]()]=_0x406bad[_0x8286d0];}}}}}return _0x478878;}exports[_0x4c01('0x56')]=setXMDContactVariables; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index d66f409..85df154 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(_0x33877b,_0x54db8e){var _0x13f29c=function(_0x5a38bb){while(--_0x5a38bb){_0x33877b['push'](_0x33877b['shift']());}};_0x13f29c(++_0x54db8e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var 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(_0x288919,_0x43c5cd){var _0x3198a7=function(_0xf24186){while(--_0xf24186){_0x288919['push'](_0x288919['shift']());}};_0x3198a7(++_0x43c5cd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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 0bcb959..88d5772 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 _0xaa08=['./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','newchannel','syncNewchannel','bind','varset','newstate','syncNewState','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','context','from-voip-provider','exten','localstationid','uniqueid','channel','\x20syncNewchannel\x20','actions','info','syncVarSet','variable','hasOwnProperty','value','channelstate','channelstatedesc','prototype','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','name','.pdf','then','catch','\x20notify\x20','stringify','error','merge','pick','response','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate2]','updateStatus','update','[Fax][Message][Updated]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','faxpages','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkTrunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','lodash','bluebird','uuid','moment','path','tiff2pdf','./util/gs','fax','../ami','./rpcDb'];(function(_0x1efc82,_0x10c1ed){var _0x1686d8=function(_0x334a86){while(--_0x334a86){_0x1efc82['push'](_0x1efc82['shift']());}};_0x1686d8(++_0x10c1ed);}(_0xaa08,0x15b));var _0x8aa0=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xaa08[_0x397e5f];return _0x5302b8;};'use strict';var util=require('util');var _=require(_0x8aa0('0x0'));var BPromise=require(_0x8aa0('0x1'));var uuid=require(_0x8aa0('0x2'));var moment=require(_0x8aa0('0x3'));var path=require(_0x8aa0('0x4'));var tiff2pdf=require(_0x8aa0('0x5'));var gs=require(_0x8aa0('0x6'));var logger=require('../../../config/logger')(_0x8aa0('0x7'));var ami=require(_0x8aa0('0x8'));var rpcDb=require(_0x8aa0('0x9'));var Channel=require(_0x8aa0('0xa'));var ut=require(_0x8aa0('0xb'));var Action=require(_0x8aa0('0xc'));var faxAccount=require(_0x8aa0('0xd'));var attachment=require(_0x8aa0('0xe'));var faxMessage=require(_0x8aa0('0xf'));function Fax(_0x229050){this[_0x8aa0('0x10')]={};this[_0x8aa0('0x11')]=_0x229050[_0x8aa0('0x11')];this['trunks']=_0x229050[_0x8aa0('0x12')];this['actions']={};ami['on'](_0x8aa0('0x13'),this[_0x8aa0('0x14')][_0x8aa0('0x15')](this));ami['on'](_0x8aa0('0x16'),this['syncVarSet'][_0x8aa0('0x15')](this));ami['on'](_0x8aa0('0x17'),this[_0x8aa0('0x18')][_0x8aa0('0x15')](this));ami['on']('newexten',this[_0x8aa0('0x19')][_0x8aa0('0x15')](this));ami['on'](_0x8aa0('0x1a'),this[_0x8aa0('0x1b')][_0x8aa0('0x15')](this));ami['on'](_0x8aa0('0x1c'),this[_0x8aa0('0x1d')][_0x8aa0('0x15')](this));ami['on'](_0x8aa0('0x1e'),this[_0x8aa0('0x1f')]['bind'](this));ami['on'](_0x8aa0('0x20'),this['syncOriginateResponse'][_0x8aa0('0x15')](this));}Fax['prototype'][_0x8aa0('0x14')]=function(_0x5719d6){if(_0x5719d6[_0x8aa0('0x21')]===_0x8aa0('0x22')){for(var _0x38b962 in this[_0x8aa0('0x11')]){if(this[_0x8aa0('0x11')]['hasOwnProperty'](_0x38b962)){if(_0x5719d6[_0x8aa0('0x23')]===this[_0x8aa0('0x11')][_0x38b962][_0x8aa0('0x24')]){this[_0x8aa0('0x10')][_0x5719d6[_0x8aa0('0x25')]]={};this['channels'][_0x5719d6['uniqueid']]['channel']=_0x5719d6[_0x8aa0('0x26')];this[_0x8aa0('0x10')][_0x5719d6[_0x8aa0('0x25')]]['id']=this[_0x8aa0('0x11')][_0x38b962]['id'];this[_0x8aa0('0x10')][_0x5719d6['uniqueid']]['name']=this[_0x8aa0('0x11')][_0x38b962]['name'];logger['info'](_0x5719d6[_0x8aa0('0x25')],_0x8aa0('0x27'));}}}}if(this[_0x8aa0('0x28')][_0x5719d6[_0x8aa0('0x25')]]){this[_0x8aa0('0x10')][_0x5719d6[_0x8aa0('0x25')]]={};this['channels'][_0x5719d6['uniqueid']][_0x8aa0('0x26')]=_0x5719d6[_0x8aa0('0x26')];logger[_0x8aa0('0x29')](_0x5719d6[_0x8aa0('0x25')],_0x8aa0('0x27'));}};Fax['prototype'][_0x8aa0('0x2a')]=function(_0x5563a1){if(this[_0x8aa0('0x10')][_0x5563a1[_0x8aa0('0x25')]]){for(var _0x196b04 in _0x5563a1[_0x8aa0('0x2b')]){if(_0x5563a1['variable'][_0x8aa0('0x2c')](_0x196b04)){this[_0x8aa0('0x10')][_0x5563a1[_0x8aa0('0x25')]][_0x196b04]=_0x5563a1[_0x8aa0('0x2d')];}}}};Fax['prototype'][_0x8aa0('0x18')]=function(_0x179b81){if(this['channels'][_0x179b81[_0x8aa0('0x25')]]){this[_0x8aa0('0x10')][_0x179b81[_0x8aa0('0x25')]][_0x8aa0('0x2e')]=_0x179b81[_0x8aa0('0x2e')];this[_0x8aa0('0x10')][_0x179b81['uniqueid']][_0x8aa0('0x2f')]=_0x179b81[_0x8aa0('0x2f')];}};Fax[_0x8aa0('0x30')][_0x8aa0('0x19')]=function(_0x159f81){if(this[_0x8aa0('0x10')][_0x159f81[_0x8aa0('0x25')]]){for(var _0xb67910 in _0x159f81[_0x8aa0('0x2b')]){if(_0x159f81['variable']['hasOwnProperty'](_0xb67910)){this[_0x8aa0('0x10')][_0x159f81['uniqueid']][_0xb67910]=_0x159f81['value'];}}}};Fax[_0x8aa0('0x30')][_0x8aa0('0x1b')]=function(_0x4092f3){if(this[_0x8aa0('0x10')][_0x4092f3[_0x8aa0('0x25')]]){this['channels'][_0x4092f3[_0x8aa0('0x25')]][_0x8aa0('0x31')]=_0x4092f3[_0x8aa0('0x31')];this[_0x8aa0('0x10')][_0x4092f3[_0x8aa0('0x25')]][_0x8aa0('0x32')]=_0x4092f3[_0x8aa0('0x32')];this[_0x8aa0('0x10')][_0x4092f3[_0x8aa0('0x25')]][_0x8aa0('0x24')]=_0x4092f3[_0x8aa0('0x24')];this[_0x8aa0('0x10')][_0x4092f3[_0x8aa0('0x25')]][_0x8aa0('0x33')]=_0x4092f3[_0x8aa0('0x33')];logger[_0x8aa0('0x29')](_0x4092f3[_0x8aa0('0x25')],_0x8aa0('0x34'));}};Fax[_0x8aa0('0x30')][_0x8aa0('0x1d')]=function(_0x17b786){var _0x4fbc54=this;if(this[_0x8aa0('0x10')][_0x17b786['uniqueid']]){var _0x18e4ed=this['channels'][_0x17b786['uniqueid']]['id'];this[_0x8aa0('0x10')][_0x17b786[_0x8aa0('0x25')]]['remotestationid']=_0x17b786[_0x8aa0('0x35')];this[_0x8aa0('0x10')][_0x17b786[_0x8aa0('0x25')]][_0x8aa0('0x36')]=_0x17b786[_0x8aa0('0x36')];this[_0x8aa0('0x10')][_0x17b786[_0x8aa0('0x25')]]['localstationid']=_0x17b786[_0x8aa0('0x24')];this[_0x8aa0('0x10')][_0x17b786[_0x8aa0('0x25')]][_0x8aa0('0x37')]=_0x17b786[_0x8aa0('0x37')];this[_0x8aa0('0x10')][_0x17b786[_0x8aa0('0x25')]]['transferrate']=_0x17b786[_0x8aa0('0x38')];this[_0x8aa0('0x10')][_0x17b786[_0x8aa0('0x25')]][_0x8aa0('0x33')]=_0x17b786[_0x8aa0('0x33')];this[_0x8aa0('0x10')][_0x17b786['uniqueid']]['calleridnum']=_0x17b786[_0x8aa0('0x39')];if(this[_0x8aa0('0x10')][_0x17b786[_0x8aa0('0x25')]][_0x8aa0('0x36')]>0x0){tiff2pdf(_0x17b786[_0x8aa0('0x33')],_0x8aa0('0x3a'),function(_0x59642f){logger['info'](_0x17b786[_0x8aa0('0x25')],_0x8aa0('0x3b'),_0x59642f[_0x8aa0('0x3c')]);attachment[_0x8aa0('0x3d')]({'name':path[_0x8aa0('0x3e')](_0x17b786[_0x8aa0('0x33')])[_0x8aa0('0x3f')],'basename':path[_0x8aa0('0x3e')](_0x17b786[_0x8aa0('0x33')])[_0x8aa0('0x3f')]+_0x8aa0('0x40'),'type':'application/pdf'})[_0x8aa0('0x41')](function(_0x52ffdd){faxAccount['notify'](_0x18e4ed,{'from':_0x17b786['calleridnum'],'mapKey':_0x8aa0('0x7'),'body':path[_0x8aa0('0x3e')](_0x17b786[_0x8aa0('0x33')])[_0x8aa0('0x3f')]+_0x8aa0('0x40'),'AttachmentId':_0x52ffdd['id']})[_0x8aa0('0x42')](function(_0x25e3a3){logger['error'](_0x17b786[_0x8aa0('0x25')],_0x8aa0('0x43'),JSON[_0x8aa0('0x44')](_0x25e3a3));});})[_0x8aa0('0x42')](function(_0x5dad08){logger[_0x8aa0('0x45')](_0x17b786[_0x8aa0('0x25')],'\x20receiveFax\x20',JSON[_0x8aa0('0x44')](_0x5dad08));});});}logger[_0x8aa0('0x29')](_0x17b786[_0x8aa0('0x25')],'\x20receiveFax\x20');}};Fax[_0x8aa0('0x30')]['syncOriginateResponse']=function(_0xbdb399){if(this[_0x8aa0('0x28')][_0xbdb399[_0x8aa0('0x25')]]){_[_0x8aa0('0x46')](this['channels'][_0xbdb399['uniqueid']],_[_0x8aa0('0x47')](_0xbdb399,[_0x8aa0('0x48'),'reason']));}};function updateStatus(_0xf4c948){if(_0xf4c948[_0x8aa0('0x49')]){faxMessage['update'](_0xf4c948[_0x8aa0('0x49')],{'failMessage':_0x8aa0('0x4a')})['then'](function(_0x546ffb){ut[_0x8aa0('0x4b')](_0x8aa0('0x4c'),_0x546ffb);})['catch'](function(_0x1c6e1f){ut[_0x8aa0('0x4b')]('[Fax][Message][Error][NoUpdate1]',_0x1c6e1f);});}else{ut[_0x8aa0('0x4b')](_0x8aa0('0x4d'));}}Fax[_0x8aa0('0x30')][_0x8aa0('0x4e')]=function(_0xdcb409,_0x3b5a55,_0x30e420){var _0x177265=this;var _0x3fc0fd={};if(_0x3b5a55){_0x3fc0fd={'read':_0x3b5a55};}else{_0x3fc0fd={'failMessage':_0x30e420};}if(this[_0x8aa0('0x28')][_0xdcb409]['AttachmentId']){faxMessage[_0x8aa0('0x4f')](this[_0x8aa0('0x28')][_0xdcb409][_0x8aa0('0x49')],_0x3fc0fd)['then'](function(_0x2b0ab7){ut['logger'](_0x8aa0('0x50'),_0x2b0ab7);})[_0x8aa0('0x42')](function(_0x3f38a7){ut['logger']('[Fax][Message][NoUpdate1]',_0x3f38a7);})[_0x8aa0('0x51')](function(){delete _0x177265[_0x8aa0('0x10')][_0xdcb409];delete _0x177265['actions'][_0xdcb409];});}else{ut['logger'](_0x8aa0('0x52'));delete this[_0x8aa0('0x10')][_0xdcb409];delete this[_0x8aa0('0x28')][_0xdcb409];}};Fax['prototype'][_0x8aa0('0x1f')]=function(_0xe1f2e7){var _0xaac743=this;if(this[_0x8aa0('0x10')][_0xe1f2e7[_0x8aa0('0x25')]]){if(this[_0x8aa0('0x28')][_0xe1f2e7[_0x8aa0('0x25')]]){this[_0x8aa0('0x10')][_0xe1f2e7['uniqueid']]['id']=this['actions'][_0xe1f2e7['uniqueid']]['id'];this[_0x8aa0('0x10')][_0xe1f2e7[_0x8aa0('0x25')]][_0x8aa0('0x3f')]=this['actions'][_0xe1f2e7['uniqueid']][_0x8aa0('0x3f')];}logger[_0x8aa0('0x29')](_0xe1f2e7[_0x8aa0('0x25')],this['actions'][_0xe1f2e7[_0x8aa0('0x25')]]?_0x8aa0('0x53'):'\x20hangup\x20faxRiceive\x20',JSON[_0x8aa0('0x44')](this[_0x8aa0('0x10')][_0xe1f2e7[_0x8aa0('0x25')]]));if(this[_0x8aa0('0x28')][_0xe1f2e7[_0x8aa0('0x25')]]){if(this['channels'][_0xe1f2e7['uniqueid']][_0x8aa0('0x54')]>0x0&&this[_0x8aa0('0x10')][_0xe1f2e7[_0x8aa0('0x25')]]['faxstatus']==='SUCCESS'){this['updateStatus'](_0xe1f2e7['uniqueid'],!![]);}else{this['updateStatus'](_0xe1f2e7['uniqueid'],![],this[_0x8aa0('0x10')][_0xe1f2e7[_0x8aa0('0x25')]][_0x8aa0('0x55')]?_0x8aa0('0x56')+this[_0x8aa0('0x10')][_0xe1f2e7[_0x8aa0('0x25')]][_0x8aa0('0x55')]:_0x8aa0('0x57'));}}}};Fax['prototype']['send']=function(_0x2d19f1){var _0x821b6a=this;return new BPromise(function(_0x976513,_0x3b113e){_0x821b6a[_0x8aa0('0x58')](_0x2d19f1,_0x821b6a[_0x8aa0('0x11')][_0x2d19f1[_0x8aa0('0x59')]])['then'](function(_0x1baa35){ut[_0x8aa0('0x4b')](_0x8aa0('0x5a'),_0x1baa35);_0x976513(ut[_0x8aa0('0x3c')](_0x8aa0('0x5b')));})['catch'](function(_0x3578a1){ut['logger'](_0x8aa0('0x5c'),_0x3578a1);updateStatus(_0x2d19f1);_0x3b113e(ut[_0x8aa0('0x3c')](_0x8aa0('0x5d')));});});};Fax[_0x8aa0('0x30')]['checkAfterSend']=function(_0x5c8d11){var _0x46a79b=this;return new BPromise(function(_0x231ed7,_0x13bab0){var _0x10d633=_0x46a79b[_0x8aa0('0x5e')](_0x46a79b['faxAccounts'][_0x5c8d11[_0x8aa0('0x59')]]['Trunk'],_0x5c8d11);if(_0x10d633[_0x8aa0('0x5f')]){_0x231ed7(ut['message'](_0x8aa0('0x60')));}else{_0x13bab0(ut[_0x8aa0('0x3c')](_0x10d633[_0x8aa0('0x3c')]));}});};function originate(_0xf4ab9,_0x184f98,_0x467f1c){return new BPromise(function(_0xf061b1,_0x1eb95d){if(_0x467f1c){var _0x3bd62e=util[_0x8aa0('0x61')](_0x8aa0('0x62'),path[_0x8aa0('0x3e')](_0xf4ab9[_0x8aa0('0x4')])[_0x8aa0('0x3f')],_0xf4ab9[_0x8aa0('0x4')]);gs[_0x8aa0('0x63')](_0x3bd62e)['then'](function(){_0xf4ab9['path']=util[_0x8aa0('0x61')](_0x8aa0('0x64'),path[_0x8aa0('0x3e')](_0xf4ab9[_0x8aa0('0x4')])['dir'],path['parse'](_0xf4ab9[_0x8aa0('0x4')])[_0x8aa0('0x3f')]);_0x184f98[_0x8aa0('0x65')]=_0xf4ab9['path'];ut[_0x8aa0('0x4b')](_0x8aa0('0x66'),'');ami[_0x8aa0('0x67')](ut[_0x8aa0('0x68')](_0xf4ab9,_0x184f98))['then'](function(_0x4a5a4f){_0xf061b1(_0x4a5a4f);})[_0x8aa0('0x42')](function(_0x530755){_0x1eb95d(_0x530755);});})[_0x8aa0('0x42')](function(_0x48909a){_0x1eb95d(_0x48909a);});}else{ami[_0x8aa0('0x67')](ut[_0x8aa0('0x68')](_0xf4ab9,_0x184f98))[_0x8aa0('0x41')](function(_0x25baf4){_0xf061b1(_0x25baf4);})[_0x8aa0('0x42')](function(_0x86a748){_0x1eb95d(_0x86a748);});}});}Fax[_0x8aa0('0x30')][_0x8aa0('0x58')]=function(_0x5802c8,_0x2fb99e){var _0x5e4131=this;return new BPromise(function(_0x4d9a31,_0x5be7c8){var _0x45394d=uuid['v4']();var _0x1dc0b1=ut['addVariables'](_0x5802c8,_0x2fb99e);_0x5e4131['actions'][_0x45394d]=new Action(_0x45394d,_0x2fb99e,_0x5802c8);var _0x1ae60f=_0x5e4131[_0x8aa0('0x28')][_0x45394d];if(path[_0x8aa0('0x3e')](_0x5802c8[_0x8aa0('0x4')])['ext']===_0x8aa0('0x40')){originate(_0x1ae60f,_0x1dc0b1,!![])[_0x8aa0('0x41')](function(_0x2ef8ad){_0x4d9a31(_0x2ef8ad);})['catch'](function(_0x32e790){_0x5be7c8(_0x32e790);});}else{originate(_0x1ae60f,_0x1dc0b1,![])[_0x8aa0('0x41')](function(_0x4c9cdd){_0x4d9a31(_0x4c9cdd);})[_0x8aa0('0x42')](function(_0x5c8acb){_0x5be7c8(_0x5c8acb);});}});};Fax[_0x8aa0('0x30')][_0x8aa0('0x69')]=function(_0x416d78){return!_[_0x8aa0('0x6a')](_0x416d78)&&!_[_0x8aa0('0x6a')](_0x416d78[_0x8aa0('0x3f')])&&!_[_0x8aa0('0x6a')](_0x416d78[_0x8aa0('0x6b')])&&_0x416d78[_0x8aa0('0x6b')]&&!_[_0x8aa0('0x6a')](this[_0x8aa0('0x12')][util[_0x8aa0('0x61')](_0x8aa0('0x6c'),_0x416d78[_0x8aa0('0x3f')])])&&!_[_0x8aa0('0x6a')](this['trunks'][util[_0x8aa0('0x61')](_0x8aa0('0x6c'),_0x416d78[_0x8aa0('0x3f')])][_0x8aa0('0x32')])&&(this[_0x8aa0('0x12')][util[_0x8aa0('0x61')](_0x8aa0('0x6c'),_0x416d78[_0x8aa0('0x3f')])][_0x8aa0('0x32')]===_0x8aa0('0x6d')||this[_0x8aa0('0x12')][util[_0x8aa0('0x61')](_0x8aa0('0x6c'),_0x416d78[_0x8aa0('0x3f')])]['status']===_0x8aa0('0x6e'));};Fax[_0x8aa0('0x30')]['checkTrunk']=function(_0x3a5cdd,_0x5a1949){if(!this[_0x8aa0('0x69')](_0x3a5cdd)){ut[_0x8aa0('0x4b')](_0x8aa0('0x6f'),_['isNil'](_0x3a5cdd)?'':_0x3a5cdd[_0x8aa0('0x3f')]+_0x8aa0('0x70'));return{'isValid':![],'message':_0x8aa0('0x71')};}if(_[_0x8aa0('0x6a')](_0x5a1949[_0x8aa0('0x7')])){ut[_0x8aa0('0x4b')](_0x8aa0('0x72'),JSON['stringify'](_0x5a1949));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x8aa0('0x6a')](_0x5a1949[_0x8aa0('0x4')])){ut[_0x8aa0('0x4b')](_0x8aa0('0x73'),JSON[_0x8aa0('0x44')](_0x5a1949));return{'isValid':![],'message':_0x8aa0('0x74')};}return{'isValid':!![],'message':_0x8aa0('0x75')};};module[_0x8aa0('0x76')]=Fax; \ No newline at end of file +var _0xac74=['moment','tiff2pdf','./util/gs','../../../config/logger','fax','./rpcDb','./channel','./util/util','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','faxstatus','syncFaxStatus','syncReceiveFax','syncHangup','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','channelstate','channelstatedesc','value','operation','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','parse','application/pdf','then','notify','.pdf','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','reason','update','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate1]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED','send','FaxAccountId','[Fax][execOriginate][success]','message','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','Trunk','isValid','Trunk\x20Reachable','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','path','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','execOriginate','addVariables','isTrunkReachable','isNil','active','format','SIP/%s','status','reachable','unmonitored','checkTrunk','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','Trunk\x20not\x20working\x20correctly','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','bluebird','uuid'];(function(_0x585133,_0x2412a1){var _0x18254a=function(_0x4c8aaf){while(--_0x4c8aaf){_0x585133['push'](_0x585133['shift']());}};_0x18254a(++_0x2412a1);}(_0xac74,0x77));var _0x4ac7=function(_0x34c063,_0x11d3d7){_0x34c063=_0x34c063-0x0;var _0x2c63a3=_0xac74[_0x34c063];return _0x2c63a3;};'use strict';var util=require(_0x4ac7('0x0'));var _=require('lodash');var BPromise=require(_0x4ac7('0x1'));var uuid=require(_0x4ac7('0x2'));var moment=require(_0x4ac7('0x3'));var path=require('path');var tiff2pdf=require(_0x4ac7('0x4'));var gs=require(_0x4ac7('0x5'));var logger=require(_0x4ac7('0x6'))(_0x4ac7('0x7'));var ami=require('../ami');var rpcDb=require(_0x4ac7('0x8'));var Channel=require(_0x4ac7('0x9'));var ut=require(_0x4ac7('0xa'));var Action=require('./action');var faxAccount=require(_0x4ac7('0xb'));var attachment=require(_0x4ac7('0xc'));var faxMessage=require(_0x4ac7('0xd'));function Fax(_0x2e5b4f){this[_0x4ac7('0xe')]={};this['faxAccounts']=_0x2e5b4f[_0x4ac7('0xf')];this['trunks']=_0x2e5b4f[_0x4ac7('0x10')];this[_0x4ac7('0x11')]={};ami['on'](_0x4ac7('0x12'),this[_0x4ac7('0x13')][_0x4ac7('0x14')](this));ami['on'](_0x4ac7('0x15'),this[_0x4ac7('0x16')][_0x4ac7('0x14')](this));ami['on'](_0x4ac7('0x17'),this[_0x4ac7('0x18')][_0x4ac7('0x14')](this));ami['on'](_0x4ac7('0x19'),this['syncNewExten']['bind'](this));ami['on'](_0x4ac7('0x1a'),this[_0x4ac7('0x1b')][_0x4ac7('0x14')](this));ami['on']('receivefax',this[_0x4ac7('0x1c')][_0x4ac7('0x14')](this));ami['on']('hangup',this[_0x4ac7('0x1d')]['bind'](this));ami['on']('originateresponse',this[_0x4ac7('0x1e')][_0x4ac7('0x14')](this));}Fax[_0x4ac7('0x1f')][_0x4ac7('0x13')]=function(_0x5b57a8){if(_0x5b57a8[_0x4ac7('0x20')]===_0x4ac7('0x21')){for(var _0x332ca0 in this['faxAccounts']){if(this[_0x4ac7('0xf')][_0x4ac7('0x22')](_0x332ca0)){if(_0x5b57a8[_0x4ac7('0x23')]===this[_0x4ac7('0xf')][_0x332ca0]['localstationid']){this['channels'][_0x5b57a8[_0x4ac7('0x24')]]={};this['channels'][_0x5b57a8[_0x4ac7('0x24')]][_0x4ac7('0x25')]=_0x5b57a8[_0x4ac7('0x25')];this[_0x4ac7('0xe')][_0x5b57a8['uniqueid']]['id']=this[_0x4ac7('0xf')][_0x332ca0]['id'];this[_0x4ac7('0xe')][_0x5b57a8[_0x4ac7('0x24')]][_0x4ac7('0x26')]=this['faxAccounts'][_0x332ca0][_0x4ac7('0x26')];logger[_0x4ac7('0x27')](_0x5b57a8[_0x4ac7('0x24')],_0x4ac7('0x28'));}}}}if(this['actions'][_0x5b57a8[_0x4ac7('0x24')]]){this[_0x4ac7('0xe')][_0x5b57a8[_0x4ac7('0x24')]]={};this['channels'][_0x5b57a8['uniqueid']][_0x4ac7('0x25')]=_0x5b57a8[_0x4ac7('0x25')];logger[_0x4ac7('0x27')](_0x5b57a8[_0x4ac7('0x24')],'\x20syncNewchannel\x20');}};Fax[_0x4ac7('0x1f')][_0x4ac7('0x16')]=function(_0x3e64ef){if(this['channels'][_0x3e64ef[_0x4ac7('0x24')]]){for(var _0x15966d in _0x3e64ef[_0x4ac7('0x29')]){if(_0x3e64ef[_0x4ac7('0x29')][_0x4ac7('0x22')](_0x15966d)){this[_0x4ac7('0xe')][_0x3e64ef['uniqueid']][_0x15966d]=_0x3e64ef['value'];}}}};Fax[_0x4ac7('0x1f')][_0x4ac7('0x18')]=function(_0x4373cd){if(this[_0x4ac7('0xe')][_0x4373cd[_0x4ac7('0x24')]]){this['channels'][_0x4373cd[_0x4ac7('0x24')]][_0x4ac7('0x2a')]=_0x4373cd[_0x4ac7('0x2a')];this['channels'][_0x4373cd[_0x4ac7('0x24')]][_0x4ac7('0x2b')]=_0x4373cd[_0x4ac7('0x2b')];}};Fax[_0x4ac7('0x1f')]['syncNewExten']=function(_0x5aaaf0){if(this[_0x4ac7('0xe')][_0x5aaaf0[_0x4ac7('0x24')]]){for(var _0x576b87 in _0x5aaaf0['variable']){if(_0x5aaaf0['variable'][_0x4ac7('0x22')](_0x576b87)){this[_0x4ac7('0xe')][_0x5aaaf0[_0x4ac7('0x24')]][_0x576b87]=_0x5aaaf0[_0x4ac7('0x2c')];}}}};Fax[_0x4ac7('0x1f')][_0x4ac7('0x1b')]=function(_0x35cfac){if(this[_0x4ac7('0xe')][_0x35cfac[_0x4ac7('0x24')]]){this[_0x4ac7('0xe')][_0x35cfac[_0x4ac7('0x24')]]['operation']=_0x35cfac[_0x4ac7('0x2d')];this['channels'][_0x35cfac[_0x4ac7('0x24')]]['status']=_0x35cfac['status'];this[_0x4ac7('0xe')][_0x35cfac[_0x4ac7('0x24')]][_0x4ac7('0x2e')]=_0x35cfac[_0x4ac7('0x2e')];this[_0x4ac7('0xe')][_0x35cfac[_0x4ac7('0x24')]]['filename']=_0x35cfac[_0x4ac7('0x2f')];logger['info'](_0x35cfac[_0x4ac7('0x24')],_0x4ac7('0x30'));}};Fax[_0x4ac7('0x1f')][_0x4ac7('0x1c')]=function(_0x3d9da5){var _0x5343bc=this;if(this[_0x4ac7('0xe')][_0x3d9da5[_0x4ac7('0x24')]]){var _0xc9cc2e=this[_0x4ac7('0xe')][_0x3d9da5[_0x4ac7('0x24')]]['id'];this[_0x4ac7('0xe')][_0x3d9da5[_0x4ac7('0x24')]][_0x4ac7('0x31')]=_0x3d9da5[_0x4ac7('0x31')];this[_0x4ac7('0xe')][_0x3d9da5['uniqueid']][_0x4ac7('0x32')]=_0x3d9da5[_0x4ac7('0x32')];this[_0x4ac7('0xe')][_0x3d9da5[_0x4ac7('0x24')]]['localstationid']=_0x3d9da5['localstationid'];this['channels'][_0x3d9da5[_0x4ac7('0x24')]][_0x4ac7('0x33')]=_0x3d9da5[_0x4ac7('0x33')];this[_0x4ac7('0xe')][_0x3d9da5[_0x4ac7('0x24')]][_0x4ac7('0x34')]=_0x3d9da5['transferrate'];this[_0x4ac7('0xe')][_0x3d9da5[_0x4ac7('0x24')]][_0x4ac7('0x2f')]=_0x3d9da5['filename'];this[_0x4ac7('0xe')][_0x3d9da5['uniqueid']][_0x4ac7('0x35')]=_0x3d9da5[_0x4ac7('0x35')];if(this[_0x4ac7('0xe')][_0x3d9da5[_0x4ac7('0x24')]][_0x4ac7('0x32')]>0x0){tiff2pdf(_0x3d9da5[_0x4ac7('0x2f')],_0x4ac7('0x36'),function(_0x21a847){logger[_0x4ac7('0x27')](_0x3d9da5[_0x4ac7('0x24')],_0x4ac7('0x37'),_0x21a847['message']);attachment['create']({'name':path['parse'](_0x3d9da5[_0x4ac7('0x2f')])[_0x4ac7('0x26')],'basename':path[_0x4ac7('0x38')](_0x3d9da5[_0x4ac7('0x2f')])[_0x4ac7('0x26')]+'.pdf','type':_0x4ac7('0x39')})[_0x4ac7('0x3a')](function(_0x5038b9){faxAccount[_0x4ac7('0x3b')](_0xc9cc2e,{'from':_0x3d9da5[_0x4ac7('0x35')],'mapKey':_0x4ac7('0x7'),'body':path['parse'](_0x3d9da5[_0x4ac7('0x2f')])[_0x4ac7('0x26')]+_0x4ac7('0x3c'),'AttachmentId':_0x5038b9['id']})[_0x4ac7('0x3d')](function(_0x3e4062){logger[_0x4ac7('0x3e')](_0x3d9da5['uniqueid'],_0x4ac7('0x3f'),JSON[_0x4ac7('0x40')](_0x3e4062));});})[_0x4ac7('0x3d')](function(_0x557831){logger[_0x4ac7('0x3e')](_0x3d9da5['uniqueid'],_0x4ac7('0x41'),JSON[_0x4ac7('0x40')](_0x557831));});});}logger[_0x4ac7('0x27')](_0x3d9da5[_0x4ac7('0x24')],'\x20receiveFax\x20');}};Fax[_0x4ac7('0x1f')][_0x4ac7('0x1e')]=function(_0x593c0f){if(this['actions'][_0x593c0f[_0x4ac7('0x24')]]){_[_0x4ac7('0x42')](this['channels'][_0x593c0f[_0x4ac7('0x24')]],_[_0x4ac7('0x43')](_0x593c0f,[_0x4ac7('0x44'),_0x4ac7('0x45')]));}};function updateStatus(_0x51133d){if(_0x51133d['AttachmentId']){faxMessage[_0x4ac7('0x46')](_0x51133d[_0x4ac7('0x47')],{'failMessage':_0x4ac7('0x48')})[_0x4ac7('0x3a')](function(_0x4ce340){ut[_0x4ac7('0x49')]('[Fax][Message][Error][Updated]',_0x4ce340);})[_0x4ac7('0x3d')](function(_0x3a690a){ut['logger'](_0x4ac7('0x4a'),_0x3a690a);});}else{ut[_0x4ac7('0x49')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x4ac7('0x1f')][_0x4ac7('0x4b')]=function(_0x5b3c39,_0x52b6ee,_0x4bffd0){var _0x2b8b66=this;var _0x31acb5={};if(_0x52b6ee){_0x31acb5={'read':_0x52b6ee};}else{_0x31acb5={'failMessage':_0x4bffd0};}if(this[_0x4ac7('0x11')][_0x5b3c39][_0x4ac7('0x47')]){faxMessage[_0x4ac7('0x46')](this[_0x4ac7('0x11')][_0x5b3c39]['AttachmentId'],_0x31acb5)[_0x4ac7('0x3a')](function(_0x38d719){ut[_0x4ac7('0x49')](_0x4ac7('0x4c'),_0x38d719);})['catch'](function(_0x243dee){ut[_0x4ac7('0x49')](_0x4ac7('0x4d'),_0x243dee);})['finally'](function(){delete _0x2b8b66[_0x4ac7('0xe')][_0x5b3c39];delete _0x2b8b66[_0x4ac7('0x11')][_0x5b3c39];});}else{ut[_0x4ac7('0x49')](_0x4ac7('0x4e'));delete this['channels'][_0x5b3c39];delete this[_0x4ac7('0x11')][_0x5b3c39];}};Fax['prototype']['syncHangup']=function(_0x58e48f){var _0x5a48d6=this;if(this[_0x4ac7('0xe')][_0x58e48f['uniqueid']]){if(this[_0x4ac7('0x11')][_0x58e48f[_0x4ac7('0x24')]]){this[_0x4ac7('0xe')][_0x58e48f['uniqueid']]['id']=this['actions'][_0x58e48f[_0x4ac7('0x24')]]['id'];this['channels'][_0x58e48f['uniqueid']][_0x4ac7('0x26')]=this[_0x4ac7('0x11')][_0x58e48f['uniqueid']]['name'];}logger['info'](_0x58e48f[_0x4ac7('0x24')],this[_0x4ac7('0x11')][_0x58e48f[_0x4ac7('0x24')]]?_0x4ac7('0x4f'):_0x4ac7('0x50'),JSON[_0x4ac7('0x40')](this[_0x4ac7('0xe')][_0x58e48f[_0x4ac7('0x24')]]));if(this[_0x4ac7('0x11')][_0x58e48f[_0x4ac7('0x24')]]){if(this[_0x4ac7('0xe')][_0x58e48f[_0x4ac7('0x24')]][_0x4ac7('0x51')]>0x0&&this[_0x4ac7('0xe')][_0x58e48f[_0x4ac7('0x24')]][_0x4ac7('0x1a')]===_0x4ac7('0x52')){this[_0x4ac7('0x4b')](_0x58e48f[_0x4ac7('0x24')],!![]);}else{this[_0x4ac7('0x4b')](_0x58e48f[_0x4ac7('0x24')],![],this['channels'][_0x58e48f['uniqueid']][_0x4ac7('0x53')]?'SENDING\x20FAILED:\x20'+this['channels'][_0x58e48f[_0x4ac7('0x24')]][_0x4ac7('0x53')]:_0x4ac7('0x54'));}}}};Fax['prototype'][_0x4ac7('0x55')]=function(_0x494418){var _0xde29b4=this;return new BPromise(function(_0x399a70,_0x504099){_0xde29b4['execOriginate'](_0x494418,_0xde29b4[_0x4ac7('0xf')][_0x494418[_0x4ac7('0x56')]])[_0x4ac7('0x3a')](function(_0x17438e){ut[_0x4ac7('0x49')](_0x4ac7('0x57'),_0x17438e);_0x399a70(ut[_0x4ac7('0x58')]('Fax\x20received'));})['catch'](function(_0x574295){ut['logger'](_0x4ac7('0x59'),_0x574295);updateStatus(_0x494418);_0x504099(ut[_0x4ac7('0x58')](_0x4ac7('0x5a')));});});};Fax['prototype'][_0x4ac7('0x5b')]=function(_0x76e983){var _0x4f0019=this;return new BPromise(function(_0x5a06a6,_0x38f1f7){var _0x171ed3=_0x4f0019['checkTrunk'](_0x4f0019[_0x4ac7('0xf')][_0x76e983[_0x4ac7('0x56')]][_0x4ac7('0x5c')],_0x76e983);if(_0x171ed3[_0x4ac7('0x5d')]){_0x5a06a6(ut['message'](_0x4ac7('0x5e')));}else{_0x38f1f7(ut[_0x4ac7('0x58')](_0x171ed3['message']));}});};function originate(_0x534cf2,_0x380788,_0x373065){return new BPromise(function(_0x4c3705,_0x405fd7){if(_0x373065){var _0x298451=util['format'](_0x4ac7('0x5f'),path[_0x4ac7('0x38')](_0x534cf2['path'])[_0x4ac7('0x26')],_0x534cf2['path']);gs[_0x4ac7('0x60')](_0x298451)[_0x4ac7('0x3a')](function(){_0x534cf2['path']=util['format'](_0x4ac7('0x61'),path[_0x4ac7('0x38')](_0x534cf2[_0x4ac7('0x62')])[_0x4ac7('0x63')],path[_0x4ac7('0x38')](_0x534cf2['path'])['name']);_0x380788[_0x4ac7('0x64')]=_0x534cf2['path'];ut[_0x4ac7('0x49')](_0x4ac7('0x65'),'');ami[_0x4ac7('0x66')](ut[_0x4ac7('0x67')](_0x534cf2,_0x380788))[_0x4ac7('0x3a')](function(_0x585fc2){_0x4c3705(_0x585fc2);})['catch'](function(_0xb290b){_0x405fd7(_0xb290b);});})['catch'](function(_0x58d262){_0x405fd7(_0x58d262);});}else{ami['Action'](ut['variablesAction'](_0x534cf2,_0x380788))[_0x4ac7('0x3a')](function(_0x5a51b2){_0x4c3705(_0x5a51b2);})[_0x4ac7('0x3d')](function(_0x2ca760){_0x405fd7(_0x2ca760);});}});}Fax[_0x4ac7('0x1f')][_0x4ac7('0x68')]=function(_0x36a527,_0xad5205){var _0x4ef716=this;return new BPromise(function(_0x5ce96b,_0x1b460a){var _0x7d5c5a=uuid['v4']();var _0x1d4a88=ut[_0x4ac7('0x69')](_0x36a527,_0xad5205);_0x4ef716[_0x4ac7('0x11')][_0x7d5c5a]=new Action(_0x7d5c5a,_0xad5205,_0x36a527);var _0x35095c=_0x4ef716[_0x4ac7('0x11')][_0x7d5c5a];if(path['parse'](_0x36a527[_0x4ac7('0x62')])['ext']==='.pdf'){originate(_0x35095c,_0x1d4a88,!![])[_0x4ac7('0x3a')](function(_0xad405a){_0x5ce96b(_0xad405a);})[_0x4ac7('0x3d')](function(_0x1fca2a){_0x1b460a(_0x1fca2a);});}else{originate(_0x35095c,_0x1d4a88,![])['then'](function(_0x78b192){_0x5ce96b(_0x78b192);})[_0x4ac7('0x3d')](function(_0x1943cb){_0x1b460a(_0x1943cb);});}});};Fax[_0x4ac7('0x1f')][_0x4ac7('0x6a')]=function(_0x326562){return!_[_0x4ac7('0x6b')](_0x326562)&&!_[_0x4ac7('0x6b')](_0x326562[_0x4ac7('0x26')])&&!_[_0x4ac7('0x6b')](_0x326562[_0x4ac7('0x6c')])&&_0x326562['active']&&!_[_0x4ac7('0x6b')](this['trunks'][util[_0x4ac7('0x6d')](_0x4ac7('0x6e'),_0x326562[_0x4ac7('0x26')])])&&!_[_0x4ac7('0x6b')](this[_0x4ac7('0x10')][util[_0x4ac7('0x6d')](_0x4ac7('0x6e'),_0x326562['name'])][_0x4ac7('0x6f')])&&(this[_0x4ac7('0x10')][util['format']('SIP/%s',_0x326562[_0x4ac7('0x26')])][_0x4ac7('0x6f')]===_0x4ac7('0x70')||this[_0x4ac7('0x10')][util['format'](_0x4ac7('0x6e'),_0x326562[_0x4ac7('0x26')])][_0x4ac7('0x6f')]===_0x4ac7('0x71'));};Fax[_0x4ac7('0x1f')][_0x4ac7('0x72')]=function(_0x75130,_0x16dacf){if(!this['isTrunkReachable'](_0x75130)){ut[_0x4ac7('0x49')](_0x4ac7('0x73'),_['isNil'](_0x75130)?'':_0x75130['name']+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x4ac7('0x74')};}if(_[_0x4ac7('0x6b')](_0x16dacf[_0x4ac7('0x7')])){ut[_0x4ac7('0x49')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0x4ac7('0x40')](_0x16dacf));return{'isValid':![],'message':_0x4ac7('0x75')};}if(_[_0x4ac7('0x6b')](_0x16dacf[_0x4ac7('0x62')])){ut[_0x4ac7('0x49')](_0x4ac7('0x76'),JSON[_0x4ac7('0x40')](_0x16dacf));return{'isValid':![],'message':_0x4ac7('0x77')};}return{'isValid':!![],'message':_0x4ac7('0x78')};};module[_0x4ac7('0x79')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index a2bd20a..43acdeb 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 _0x26d1=['catch','[Notify]\x20','util','../../../config/logger','preview','lodash','../rpc/faxAccount','error','notify','resolve'];(function(_0x5d2a31,_0x4920fb){var _0x577a7e=function(_0x164c39){while(--_0x164c39){_0x5d2a31['push'](_0x5d2a31['shift']());}};_0x577a7e(++_0x4920fb);}(_0x26d1,0x1e2));var _0x126d=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x26d1[_0x21a9d9];return _0x46adce;};'use strict';var util=require(_0x126d('0x0'));var BPromise=require('bluebird');var logger=require(_0x126d('0x1'))(_0x126d('0x2'));var _=require(_0x126d('0x3'));var faxAccount=require(_0x126d('0x4'));function loggerCatch(_0x24d000){return function(_0x5ed806){logger[_0x126d('0x5')](_0x24d000,util['inspect'](_0x5ed806,{'showHidden':![],'depth':null}));};}exports[_0x126d('0x6')]=function(_0x25a8d7,_0xa24d4){return BPromise[_0x126d('0x7')]()['then'](faxAccount[_0x126d('0x6')](_0x25a8d7,_0xa24d4))[_0x126d('0x8')](loggerCatch(_0x126d('0x9')));}; \ No newline at end of file +var _0xfc62=['[Notify]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','resolve','then','catch'];(function(_0x2b6145,_0x3f6f21){var _0x46ac90=function(_0x59751a){while(--_0x59751a){_0x2b6145['push'](_0x2b6145['shift']());}};_0x46ac90(++_0x3f6f21);}(_0xfc62,0x1cd));var _0x2fc6=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xfc62[_0x199572];return _0x13cfa3;};'use strict';var util=require(_0x2fc6('0x0'));var BPromise=require(_0x2fc6('0x1'));var logger=require(_0x2fc6('0x2'))(_0x2fc6('0x3'));var _=require(_0x2fc6('0x4'));var faxAccount=require(_0x2fc6('0x5'));function loggerCatch(_0x2afaf9){return function(_0x5a8133){logger['error'](_0x2afaf9,util['inspect'](_0x5a8133,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x451c44,_0x586c90){return BPromise[_0x2fc6('0x6')]()[_0x2fc6('0x7')](faxAccount['notify'](_0x451c44,_0x586c90))[_0x2fc6('0x8')](loggerCatch(_0x2fc6('0x9')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index 714543e..694f91e 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 _0xf96e=['child_process','info','\x20Error\x20:','../../../../config/logger','bluebird'];(function(_0x54b180,_0x6de701){var _0x426b2a=function(_0x41224d){while(--_0x41224d){_0x54b180['push'](_0x54b180['shift']());}};_0x426b2a(++_0x6de701);}(_0xf96e,0x99));var _0xef96=function(_0x3db345,_0x33d6be){_0x3db345=_0x3db345-0x0;var _0x37ec46=_0xf96e[_0x3db345];return _0x37ec46;};'use strict';var util=require('util');var logger=require(_0xef96('0x0'))('fax');var BPromise=require(_0xef96('0x1'));var exec=require(_0xef96('0x2'))['exec'];exports['execute']=function(_0x1d0559){return new BPromise(function(_0x7df4e9,_0x2b52fb){exec(_0x1d0559,function(_0xc7a3f2,_0x5c0484,_0x5beb92){logger[_0xef96('0x3')]('Exec\x20gs',_0x5c0484);if(_0xc7a3f2){logger['info']('Exec\x20gs',_0xef96('0x4'),util['inspect'](_0xc7a3f2,{'showHidden':![],'depth':null}),_0x5c0484,_0x5beb92);_0x2b52fb(_0xc7a3f2);}_0x7df4e9(_0x5c0484);});});}; \ No newline at end of file +var _0x45d5=['info','Exec\x20gs','\x20Error\x20:','util','../../../../config/logger','fax','bluebird','child_process','exec','execute'];(function(_0xb3b452,_0x582e8e){var _0x238983=function(_0x3bc866){while(--_0x3bc866){_0xb3b452['push'](_0xb3b452['shift']());}};_0x238983(++_0x582e8e);}(_0x45d5,0x1cf));var _0x545d=function(_0x5b57ee,_0x44436f){_0x5b57ee=_0x5b57ee-0x0;var _0x12cd78=_0x45d5[_0x5b57ee];return _0x12cd78;};'use strict';var util=require(_0x545d('0x0'));var logger=require(_0x545d('0x1'))(_0x545d('0x2'));var BPromise=require(_0x545d('0x3'));var exec=require(_0x545d('0x4'))[_0x545d('0x5')];exports[_0x545d('0x6')]=function(_0x2db079){return new BPromise(function(_0x4dd1f8,_0x4541cd){exec(_0x2db079,function(_0x26b821,_0x4e4664,_0x5b19fd){logger[_0x545d('0x7')](_0x545d('0x8'),_0x4e4664);if(_0x26b821){logger[_0x545d('0x7')](_0x545d('0x8'),_0x545d('0x9'),util['inspect'](_0x26b821,{'showHidden':![],'depth':null}),_0x4e4664,_0x5b19fd);_0x4541cd(_0x26b821);}_0x4dd1f8(_0x4e4664);});});}; \ 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 d129e36..2ea887b 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 _0x1a1e=['minrate','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax','\x22%s\x22\x20<%s>','localstationid','moment','../../../../config/logger','fax','message','logger','info','inspect','addVariables','ecm','headerinfo'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x1a1e,0x114));var _0xe1a1=function(_0x36e64e,_0x3a5e9a){_0x36e64e=_0x36e64e-0x0;var _0x3e9125=_0x1a1e[_0x36e64e];return _0x3e9125;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xe1a1('0x0'));var logger=require(_0xe1a1('0x1'))(_0xe1a1('0x2'));exports[_0xe1a1('0x3')]=function(_0x323e19){return{'message':_0x323e19};};exports[_0xe1a1('0x4')]=function(_0x5abf35,_0x30ab25){logger[_0xe1a1('0x5')](_0x5abf35,util[_0xe1a1('0x6')](_0x30ab25,{'showHidden':![],'depth':null}));};exports[_0xe1a1('0x7')]=function(_0x3305d2,_0xb0db3b){var _0x48c4d0={'XMF-ECM':_0xb0db3b[_0xe1a1('0x8')],'XMF-HEADERINFO':_0xb0db3b[_0xe1a1('0x9')],'XMF-MINRATE':_0xb0db3b[_0xe1a1('0xa')],'XMF-MAXRATE':_0xb0db3b[_0xe1a1('0xb')],'XMF-MODEM':util[_0xe1a1('0xc')](_0xe1a1('0xd'),_0xb0db3b[_0xe1a1('0xe')]),'XMF-GATEWAY':_0xb0db3b[_0xe1a1('0xf')],'XMF-FAXDETECT':_0xb0db3b[_0xe1a1('0x10')],'XMF-T38TIMEOUT':_0xb0db3b[_0xe1a1('0x11')],'XMF-LOCALSTATIONID':_0xb0db3b['localstationid'],'XMF-PATH':_0x3305d2[_0xe1a1('0x12')]};return _0x48c4d0;};exports[_0xe1a1('0x13')]=function(_0x51e7d5,_0x2f814f){return{'actionid':_0x51e7d5[_0xe1a1('0x14')],'action':_0xe1a1('0x15'),'channel':_0x51e7d5[_0xe1a1('0x16')],'Exten':_0xe1a1('0x17'),'Context':'from-sip','Priority':'1','callerid':util[_0xe1a1('0xc')](_0xe1a1('0x18'),_0x51e7d5[_0xe1a1('0x9')]?_0x51e7d5[_0xe1a1('0x9')]:'',_0x51e7d5[_0xe1a1('0x19')]),'variable':_0x2f814f,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x51e7d5['uniqueid']};}; \ No newline at end of file +var _0x47d6=['../../../../config/logger','fax','message','logger','info','inspect','addVariables','headerinfo','minrate','modem','gateway','faxdetect','t38timeout','localstationid','path','uniqueid','originate','channel','from-sip','\x22%s\x22\x20<%s>','lodash','moment'];(function(_0x18c996,_0x4a43c4){var _0x1b26e9=function(_0x40c9a3){while(--_0x40c9a3){_0x18c996['push'](_0x18c996['shift']());}};_0x1b26e9(++_0x4a43c4);}(_0x47d6,0x18a));var _0x647d=function(_0x5ea2e0,_0x2f40ab){_0x5ea2e0=_0x5ea2e0-0x0;var _0x5b0313=_0x47d6[_0x5ea2e0];return _0x5b0313;};'use strict';var util=require('util');var _=require(_0x647d('0x0'));var moment=require(_0x647d('0x1'));var logger=require(_0x647d('0x2'))(_0x647d('0x3'));exports[_0x647d('0x4')]=function(_0x2a8bff){return{'message':_0x2a8bff};};exports[_0x647d('0x5')]=function(_0x207d60,_0x1be228){logger[_0x647d('0x6')](_0x207d60,util[_0x647d('0x7')](_0x1be228,{'showHidden':![],'depth':null}));};exports[_0x647d('0x8')]=function(_0x37d7fb,_0x8ca959){var _0x28a284={'XMF-ECM':_0x8ca959['ecm'],'XMF-HEADERINFO':_0x8ca959[_0x647d('0x9')],'XMF-MINRATE':_0x8ca959[_0x647d('0xa')],'XMF-MAXRATE':_0x8ca959['maxrate'],'XMF-MODEM':util['format']('\x22%s\x22',_0x8ca959[_0x647d('0xb')]),'XMF-GATEWAY':_0x8ca959[_0x647d('0xc')],'XMF-FAXDETECT':_0x8ca959[_0x647d('0xd')],'XMF-T38TIMEOUT':_0x8ca959[_0x647d('0xe')],'XMF-LOCALSTATIONID':_0x8ca959[_0x647d('0xf')],'XMF-PATH':_0x37d7fb[_0x647d('0x10')]};return _0x28a284;};exports['variablesAction']=function(_0x598ff4,_0x4ebd21){return{'actionid':_0x598ff4[_0x647d('0x11')],'action':_0x647d('0x12'),'channel':_0x598ff4[_0x647d('0x13')],'Exten':'xcally-motion-fax','Context':_0x647d('0x14'),'Priority':'1','callerid':util['format'](_0x647d('0x15'),_0x598ff4[_0x647d('0x9')]?_0x598ff4[_0x647d('0x9')]:'',_0x598ff4[_0x647d('0xf')]),'variable':_0x4ebd21,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x598ff4[_0x647d('0x11')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 0109248..a5ee918 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 _0x2d58=['./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','getTriggers','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','getVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','listen','sync','[index.js][main]','moment','./realtime','./report','./acw','./trigger','./fax','./rpc/user','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/template','./rpc/cmHopperHistory'];(function(_0x437d4d,_0x214aeb){var _0x234105=function(_0x8d2904){while(--_0x8d2904){_0x437d4d['push'](_0x437d4d['shift']());}};_0x234105(++_0x214aeb);}(_0x2d58,0xd2));var _0x82d5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2d58[_0x20a584];return _0x4b41a8;};'use strict';var util=require('util');var moment=require(_0x82d5('0x0'));var server=require('./server');var Realtime=require(_0x82d5('0x1'));var Report=require(_0x82d5('0x2'));var Acw=require(_0x82d5('0x3'));var Trigger=require(_0x82d5('0x4'));var Dialer=require('./dialer');var Preview=require('./preview');var Fax=require(_0x82d5('0x5'));var user=require(_0x82d5('0x6'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x82d5('0x7'));var voiceCallReport=require(_0x82d5('0x8'));var trunk=require(_0x82d5('0x9'));var trigger=require('./rpc/trigger');var template=require(_0x82d5('0xa'));var cmHopperHistory=require(_0x82d5('0xb'));var campaign=require(_0x82d5('0xc'));var voiceExtension=require(_0x82d5('0xd'));var faxAccount=require(_0x82d5('0xe'));var zendesk=require(_0x82d5('0xf'));var salesforce=require(_0x82d5('0x10'));var sugarcrm=require(_0x82d5('0x11'));var freshdesk=require(_0x82d5('0x12'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x82d5('0x13'));var vtiger=require(_0x82d5('0x14'));var freshsales=require(_0x82d5('0x15'));var servicenow=require(_0x82d5('0x16'));var dynamics365=require(_0x82d5('0x17'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x82d5('0x18'))('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x82d5('0x19')](_0x82d5('0x1a'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x82d5('0x19')](_0x82d5('0x1a'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x82d5('0x1b')]()[_0x82d5('0x1c')](user[_0x82d5('0x1d')]())[_0x82d5('0x1c')](realtime[_0x82d5('0x1e')]())[_0x82d5('0x1c')](user[_0x82d5('0x1f')]())[_0x82d5('0x1c')](realtime[_0x82d5('0x20')]())[_0x82d5('0x1c')](trunk[_0x82d5('0x21')]())[_0x82d5('0x1c')](realtime[_0x82d5('0x22')]())['then'](voiceQueue[_0x82d5('0x23')]())[_0x82d5('0x1c')](realtime['initVoiceQueues']())[_0x82d5('0x1c')](trigger[_0x82d5('0x24')]())[_0x82d5('0x1c')](realtime['initTriggers']())['then'](template['getTemplates']())[_0x82d5('0x1c')](realtime[_0x82d5('0x25')]())['then'](zendesk[_0x82d5('0x26')]())[_0x82d5('0x1c')](realtime[_0x82d5('0x27')]())[_0x82d5('0x1c')](salesforce[_0x82d5('0x28')]())[_0x82d5('0x1c')](realtime[_0x82d5('0x29')]())[_0x82d5('0x1c')](sugarcrm['getSugarcrmAccounts']())[_0x82d5('0x1c')](realtime[_0x82d5('0x2a')]())[_0x82d5('0x1c')](freshdesk[_0x82d5('0x2b')]())[_0x82d5('0x1c')](realtime[_0x82d5('0x2c')]())['then'](desk[_0x82d5('0x2d')]())['then'](realtime[_0x82d5('0x2e')]())['then'](zoho[_0x82d5('0x2f')]())[_0x82d5('0x1c')](realtime[_0x82d5('0x30')]())['then'](vtiger[_0x82d5('0x31')]())['then'](realtime[_0x82d5('0x32')]())[_0x82d5('0x1c')](freshsales[_0x82d5('0x33')]())['then'](realtime[_0x82d5('0x34')]())[_0x82d5('0x1c')](servicenow[_0x82d5('0x35')]())[_0x82d5('0x1c')](realtime[_0x82d5('0x36')]())[_0x82d5('0x1c')](dynamics365[_0x82d5('0x37')]())[_0x82d5('0x1c')](realtime[_0x82d5('0x38')]())[_0x82d5('0x1c')](campaign[_0x82d5('0x39')]())[_0x82d5('0x1c')](realtime[_0x82d5('0x3a')]())[_0x82d5('0x1c')](voiceExtension[_0x82d5('0x3b')]())[_0x82d5('0x1c')](realtime[_0x82d5('0x3c')]())[_0x82d5('0x1c')](faxAccount[_0x82d5('0x3d')]())[_0x82d5('0x1c')](realtime['initFaxAccounts']())[_0x82d5('0x1c')](function(){return realtime;});}function initParams(){return Promise['resolve']()['then'](voiceQueueReport[_0x82d5('0x3e')]())[_0x82d5('0x1c')](realtime['initVoiceQueueReports']())[_0x82d5('0x1c')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x82d5('0x1c')](realtime[_0x82d5('0x3f')]())['then'](cmHopperHistory[_0x82d5('0x40')]())[_0x82d5('0x1c')](realtime[_0x82d5('0x41')]())['then'](voiceCallReport['getVoiceCallReports']())[_0x82d5('0x1c')](realtime[_0x82d5('0x42')]())[_0x82d5('0x43')](function(_0x280aa8){logger[_0x82d5('0x44')](_0x82d5('0x45'),util[_0x82d5('0x46')](_0x280aa8,{'showHidden':![],'depth':null}));});}function main(){return server[_0x82d5('0x47')](realtime,preview,fax)['then'](function(){return initRealtime();})[_0x82d5('0x1c')](function(){return initParams();})[_0x82d5('0x1c')](function(){report[_0x82d5('0x48')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x12d4c9){logger[_0x82d5('0x44')](_0x82d5('0x49'),util[_0x82d5('0x46')](_0x12d4c9,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x47eb=['initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','initVtigerAccounts','getServicenowAccounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','catch','error','[index.js][initParams]','listen','[index.js][main]','inspect','util','moment','./server','./realtime','./report','./acw','./trigger','./preview','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','hour','get','resolve','getAgents','then','initAgents','getTelephones'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x47eb,0xb7));var _0xb47e=function(_0x1c88f9,_0x211646){_0x1c88f9=_0x1c88f9-0x0;var _0x1779f7=_0x47eb[_0x1c88f9];return _0x1779f7;};'use strict';var util=require(_0xb47e('0x0'));var moment=require(_0xb47e('0x1'));var server=require(_0xb47e('0x2'));var Realtime=require(_0xb47e('0x3'));var Report=require(_0xb47e('0x4'));var Acw=require(_0xb47e('0x5'));var Trigger=require(_0xb47e('0x6'));var Dialer=require('./dialer');var Preview=require(_0xb47e('0x7'));var Fax=require('./fax');var user=require('./rpc/user');var voiceQueue=require(_0xb47e('0x8'));var voiceQueueReport=require(_0xb47e('0x9'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0xb47e('0xa'));var trigger=require('./rpc/trigger');var template=require('./rpc/template');var cmHopperHistory=require(_0xb47e('0xb'));var campaign=require(_0xb47e('0xc'));var voiceExtension=require(_0xb47e('0xd'));var faxAccount=require(_0xb47e('0xe'));var zendesk=require(_0xb47e('0xf'));var salesforce=require(_0xb47e('0x10'));var sugarcrm=require(_0xb47e('0x11'));var freshdesk=require(_0xb47e('0x12'));var desk=require(_0xb47e('0x13'));var zoho=require(_0xb47e('0x14'));var vtiger=require(_0xb47e('0x15'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0xb47e('0x16'));var dynamics365=require(_0xb47e('0x17'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0xb47e('0x18'))(_0xb47e('0x19'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0xb47e('0x1a'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xb47e('0x1b')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0xb47e('0x1c')]()['then'](user[_0xb47e('0x1d')]())[_0xb47e('0x1e')](realtime[_0xb47e('0x1f')]())[_0xb47e('0x1e')](user[_0xb47e('0x20')]())[_0xb47e('0x1e')](realtime[_0xb47e('0x21')]())[_0xb47e('0x1e')](trunk[_0xb47e('0x22')]())[_0xb47e('0x1e')](realtime[_0xb47e('0x23')]())[_0xb47e('0x1e')](voiceQueue[_0xb47e('0x24')]())[_0xb47e('0x1e')](realtime[_0xb47e('0x25')]())[_0xb47e('0x1e')](trigger[_0xb47e('0x26')]())[_0xb47e('0x1e')](realtime[_0xb47e('0x27')]())[_0xb47e('0x1e')](template[_0xb47e('0x28')]())[_0xb47e('0x1e')](realtime[_0xb47e('0x29')]())['then'](zendesk[_0xb47e('0x2a')]())[_0xb47e('0x1e')](realtime[_0xb47e('0x2b')]())['then'](salesforce[_0xb47e('0x2c')]())[_0xb47e('0x1e')](realtime[_0xb47e('0x2d')]())[_0xb47e('0x1e')](sugarcrm[_0xb47e('0x2e')]())[_0xb47e('0x1e')](realtime['initSugarcrmAccounts']())[_0xb47e('0x1e')](freshdesk['getFreshdeskAccounts']())[_0xb47e('0x1e')](realtime[_0xb47e('0x2f')]())[_0xb47e('0x1e')](desk[_0xb47e('0x30')]())[_0xb47e('0x1e')](realtime[_0xb47e('0x31')]())['then'](zoho[_0xb47e('0x32')]())[_0xb47e('0x1e')](realtime[_0xb47e('0x33')]())[_0xb47e('0x1e')](vtiger['getVtigerAccounts']())['then'](realtime[_0xb47e('0x34')]())[_0xb47e('0x1e')](freshsales['getFreshsalesAccounts']())[_0xb47e('0x1e')](realtime['initFreshsalesAccounts']())[_0xb47e('0x1e')](servicenow[_0xb47e('0x35')]())[_0xb47e('0x1e')](realtime['initServicenowAccounts']())['then'](dynamics365['getDynamics365Accounts']())['then'](realtime[_0xb47e('0x36')]())[_0xb47e('0x1e')](campaign[_0xb47e('0x37')]())[_0xb47e('0x1e')](realtime[_0xb47e('0x38')]())[_0xb47e('0x1e')](voiceExtension[_0xb47e('0x39')]())[_0xb47e('0x1e')](realtime[_0xb47e('0x3a')]())[_0xb47e('0x1e')](faxAccount[_0xb47e('0x3b')]())[_0xb47e('0x1e')](realtime[_0xb47e('0x3c')]())['then'](function(){return realtime;});}function initParams(){return Promise[_0xb47e('0x1c')]()[_0xb47e('0x1e')](voiceQueueReport[_0xb47e('0x3d')]())[_0xb47e('0x1e')](realtime[_0xb47e('0x3e')]())[_0xb47e('0x1e')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0xb47e('0x1e')](realtime['initVoiceQueueHopperHistory']())[_0xb47e('0x1e')](cmHopperHistory[_0xb47e('0x3f')]())[_0xb47e('0x1e')](realtime[_0xb47e('0x40')]())[_0xb47e('0x1e')](voiceCallReport[_0xb47e('0x41')]())[_0xb47e('0x1e')](realtime['initVoiceCallReports']())[_0xb47e('0x42')](function(_0x44f9d8){logger[_0xb47e('0x43')](_0xb47e('0x44'),util['inspect'](_0x44f9d8,{'showHidden':![],'depth':null}));});}function main(){return server[_0xb47e('0x45')](realtime,preview,fax)['then'](function(){return initRealtime();})['then'](function(){return initParams();})['then'](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0xb47e('0x42')](function(_0x381c83){logger[_0xb47e('0x43')](_0xb47e('0x46'),util[_0xb47e('0x47')](_0x381c83,{'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 9f0bd17..5e00f8d 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 _0xedd6=['voiceStatusTime','toNumber','format','stateTime','voiceStatusQueue','stringify','emit','user:ami:update','omit','user:presence','exports','lodash','util','moment','md5','ioredis','../../../config/environment','redis','name','email','accountcode','fullname','state','unknown','status','address','phone','interface','online','voiceStatus','voiceStatusCallerIdNumber','onhold','local','prototype','updateStatusRealtime','idle','inuse','talking','statePause'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0xedd6,0x1df));var _0x6edd=function(_0x385553,_0x3d9568){_0x385553=_0x385553-0x0;var _0x30d012=_0xedd6[_0x385553];return _0x30d012;};'use strict';var _=require(_0x6edd('0x0'));var util=require(_0x6edd('0x1'));var moment=require(_0x6edd('0x2'));var md5=require(_0x6edd('0x3'));var Redis=require(_0x6edd('0x4'));var config=require(_0x6edd('0x5'));config[_0x6edd('0x6')]=_['defaults'](config[_0x6edd('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6edd('0x6')]));function Agent(_0x114cbf){this['id']=_0x114cbf['id']||0x0;this[_0x6edd('0x7')]=_0x114cbf['name']||'';this[_0x6edd('0x8')]=_0x114cbf[_0x6edd('0x8')]||'';this['accountcode']=_0x114cbf[_0x6edd('0x9')]||'';this[_0x6edd('0xa')]=_0x114cbf[_0x6edd('0xa')]||'';this[_0x6edd('0xb')]=_0x6edd('0xc');this['stateTime']=0x0;this[_0x6edd('0xd')]='unknown';this[_0x6edd('0xe')]='';this[_0x6edd('0xf')]='';this['mobile']='';this[_0x6edd('0x10')]='';this[_0x6edd('0x11')]=_0x114cbf['online']||![];this[_0x6edd('0x12')]=_0x6edd('0xc');this['voiceStatusTime']=0x0;this[_0x6edd('0x13')]='';this['voiceStatusQueue']='';this[_0x6edd('0x14')]=![];this[_0x6edd('0x15')]=![];this['md5']='';}Agent[_0x6edd('0x16')][_0x6edd('0x17')]=function(_0xa23ec2){var _0x39b243;if(_0xa23ec2&&_0xa23ec2[_0x6edd('0xb')]){_0x39b243=_0xa23ec2[_0x6edd('0xb')]['toLowerCase']();switch(_0x39b243){case'not_inuse':_0x39b243=_0x6edd('0x18');break;case _0x6edd('0x19'):_0x39b243=_0x6edd('0x1a');break;}}if(_0x39b243&&this['voiceStatus']!==_0x39b243||_0xa23ec2[_0x6edd('0x1b')]){this[_0x6edd('0x1c')]=_[_0x6edd('0x1d')](moment()[_0x6edd('0x1e')]('x'));}if(_0x39b243){this[_0x6edd('0x12')]=_0x39b243;}var _0x1a7788={'id':this['id'],'name':this[_0x6edd('0x7')],'email':this[_0x6edd('0x8')],'accountcode':this[_0x6edd('0x9')],'fullname':this[_0x6edd('0xa')],'state':this[_0x6edd('0xb')],'stateTime':this[_0x6edd('0x1f')],'status':this[_0x6edd('0xd')],'address':this['address'],'online':this[_0x6edd('0x11')],'voiceStatus':this[_0x6edd('0x12')],'voiceStatusTime':this[_0x6edd('0x1c')],'voiceStatusCallerIdNumber':this[_0x6edd('0x13')],'voiceStatusQueue':this[_0x6edd('0x20')],'interface':this['interface'],'onhold':this[_0x6edd('0x14')]};var _0x1f891c=md5(JSON[_0x6edd('0x21')](_0x1a7788));if(this[_0x6edd('0x3')]!==_0x1f891c){this[_0x6edd('0x3')]=_0x1f891c;io['to'](util['format']('user:%s',_0x1a7788[_0x6edd('0x7')]))[_0x6edd('0x22')](_0x6edd('0x23'),_[_0x6edd('0x24')](_0x1a7788,[_0x6edd('0x11')]));io[_0x6edd('0x22')](_0x6edd('0x25'),_0x1a7788);}};module[_0x6edd('0x26')]=Agent; \ No newline at end of file +var _0x6cf3=['omit','emit','exports','lodash','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status','address','phone','mobile','interface','online','voiceStatus','voiceStatusCallerIdNumber','onhold','prototype','toLowerCase','inuse','talking','voiceStatusTime','toNumber','format','stringify','user:%s','user:ami:update'];(function(_0x5192de,_0x4e91cd){var _0x4e287e=function(_0x3639bc){while(--_0x3639bc){_0x5192de['push'](_0x5192de['shift']());}};_0x4e287e(++_0x4e91cd);}(_0x6cf3,0x19a));var _0x36cf=function(_0x53ac70,_0x2c5cec){_0x53ac70=_0x53ac70-0x0;var _0x25450b=_0x6cf3[_0x53ac70];return _0x25450b;};'use strict';var _=require(_0x36cf('0x0'));var util=require('util');var moment=require(_0x36cf('0x1'));var md5=require(_0x36cf('0x2'));var Redis=require(_0x36cf('0x3'));var config=require(_0x36cf('0x4'));config['redis']=_['defaults'](config[_0x36cf('0x5')],{'host':_0x36cf('0x6'),'port':0x18eb});var io=require(_0x36cf('0x7'))(new Redis(config[_0x36cf('0x5')]));function Agent(_0x2315af){this['id']=_0x2315af['id']||0x0;this['name']=_0x2315af[_0x36cf('0x8')]||'';this[_0x36cf('0x9')]=_0x2315af[_0x36cf('0x9')]||'';this[_0x36cf('0xa')]=_0x2315af[_0x36cf('0xa')]||'';this[_0x36cf('0xb')]=_0x2315af[_0x36cf('0xb')]||'';this[_0x36cf('0xc')]=_0x36cf('0xd');this[_0x36cf('0xe')]=0x0;this[_0x36cf('0xf')]=_0x36cf('0xd');this[_0x36cf('0x10')]='';this[_0x36cf('0x11')]='';this[_0x36cf('0x12')]='';this[_0x36cf('0x13')]='';this[_0x36cf('0x14')]=_0x2315af['online']||![];this[_0x36cf('0x15')]=_0x36cf('0xd');this['voiceStatusTime']=0x0;this[_0x36cf('0x16')]='';this['voiceStatusQueue']='';this[_0x36cf('0x17')]=![];this['local']=![];this['md5']='';}Agent[_0x36cf('0x18')]['updateStatusRealtime']=function(_0x3a8019){var _0x40620e;if(_0x3a8019&&_0x3a8019[_0x36cf('0xc')]){_0x40620e=_0x3a8019[_0x36cf('0xc')][_0x36cf('0x19')]();switch(_0x40620e){case'not_inuse':_0x40620e='idle';break;case _0x36cf('0x1a'):_0x40620e=_0x36cf('0x1b');break;}}if(_0x40620e&&this[_0x36cf('0x15')]!==_0x40620e||_0x3a8019['statePause']){this[_0x36cf('0x1c')]=_[_0x36cf('0x1d')](moment()[_0x36cf('0x1e')]('x'));}if(_0x40620e){this[_0x36cf('0x15')]=_0x40620e;}var _0xbe74da={'id':this['id'],'name':this[_0x36cf('0x8')],'email':this[_0x36cf('0x9')],'accountcode':this[_0x36cf('0xa')],'fullname':this[_0x36cf('0xb')],'state':this[_0x36cf('0xc')],'stateTime':this[_0x36cf('0xe')],'status':this['status'],'address':this['address'],'online':this[_0x36cf('0x14')],'voiceStatus':this[_0x36cf('0x15')],'voiceStatusTime':this[_0x36cf('0x1c')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0x36cf('0x13')],'onhold':this[_0x36cf('0x17')]};var _0x1cb98d=md5(JSON[_0x36cf('0x1f')](_0xbe74da));if(this[_0x36cf('0x2')]!==_0x1cb98d){this['md5']=_0x1cb98d;io['to'](util[_0x36cf('0x1e')](_0x36cf('0x20'),_0xbe74da[_0x36cf('0x8')]))['emit'](_0x36cf('0x21'),_[_0x36cf('0x22')](_0xbe74da,[_0x36cf('0x14')]));io[_0x36cf('0x23')]('user:presence',_0xbe74da);}};module[_0x36cf('0x24')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 6970204..5e1803e 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 _0x0a56=['dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','type','campaign','originated','ivrAnswerCallsDay','ivrTotalCallsDays','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x0a56,0x1de));var _0x60a5=function(_0x91bdcb,_0xc35800){_0x91bdcb=_0x91bdcb-0x0;var _0x3ee55f=_0x0a56[_0x91bdcb];return _0x3ee55f;};'use strict';function Campaign(_0x2d6634){this['id']=_0x2d6634['id']||0x0;this['name']=_0x2d6634['name']||'';this['type']=_0x2d6634[_0x60a5('0x0')]||_0x60a5('0x1');this[_0x60a5('0x2')]=0x0;this['temp']=0x0;this[_0x60a5('0x3')]=0x0;this[_0x60a5('0x4')]=0x0;this['message']='';this[_0x60a5('0x5')]=!![];this[_0x60a5('0x6')]=_0x2d6634[_0x60a5('0x6')];this[_0x60a5('0x7')]=_0x2d6634[_0x60a5('0x7')];this[_0x60a5('0x8')]=_0x2d6634[_0x60a5('0x8')]||null;this[_0x60a5('0x9')]=_0x2d6634['dialGlobalInterval']?_0x2d6634['dialGlobalInterval']:null;this['dialOriginateCallerIdName']=_0x2d6634[_0x60a5('0xa')];this['dialOriginateCallerIdNumber']=_0x2d6634[_0x60a5('0xb')];this[_0x60a5('0xc')]=_0x2d6634[_0x60a5('0xc')]||0x1e;this['dialCongestionMaxRetry']=_0x2d6634[_0x60a5('0xd')];this[_0x60a5('0xe')]=_0x2d6634[_0x60a5('0xe')];this[_0x60a5('0xf')]=_0x2d6634['dialBusyMaxRetry'];this[_0x60a5('0x10')]=_0x2d6634['dialBusyRetryFrequency'];this['dialNoAnswerMaxRetry']=_0x2d6634[_0x60a5('0x11')];this[_0x60a5('0x12')]=_0x2d6634[_0x60a5('0x12')];this[_0x60a5('0x13')]=_0x2d6634[_0x60a5('0x13')];this[_0x60a5('0x14')]=_0x2d6634[_0x60a5('0x14')]||0x3;this[_0x60a5('0x15')]=_0x2d6634['dialNoSuchNumberRetryFrequency']||0x96;this['dialDropMaxRetry']=_0x2d6634[_0x60a5('0x16')]||0x3;this[_0x60a5('0x17')]=_0x2d6634[_0x60a5('0x17')]||0x96;this[_0x60a5('0x18')]=_0x2d6634[_0x60a5('0x18')]||0x3;this[_0x60a5('0x19')]=_0x2d6634['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0x2d6634[_0x60a5('0x1a')]||0x3;this[_0x60a5('0x1b')]=_0x2d6634[_0x60a5('0x1b')]||0x96;this[_0x60a5('0x1c')]=_0x2d6634[_0x60a5('0x1c')]||0x3;this['dialAgentRejectRetryFrequency']=_0x2d6634[_0x60a5('0x1d')]||0x96;this['dialOrderByScheduledAt']=_0x2d6634[_0x60a5('0x1e')]||_0x60a5('0x1f');this[_0x60a5('0x20')]=_0x2d6634[_0x60a5('0x20')]||undefined;this[_0x60a5('0x21')]=_0x2d6634[_0x60a5('0x21')]||undefined;this['dialCutDigit']=_0x2d6634['dialCutDigit']||undefined;this[_0x60a5('0x22')]=_0x2d6634['TrunkBackup']?_0x2d6634[_0x60a5('0x22')]:undefined;this['Trunk']=_0x2d6634[_0x60a5('0x23')]?_0x2d6634[_0x60a5('0x23')]:undefined;this[_0x60a5('0x24')]=_0x2d6634[_0x60a5('0x24')]?_0x2d6634[_0x60a5('0x24')]:undefined;this['SquareProject']=_0x2d6634[_0x60a5('0x25')]?_0x2d6634[_0x60a5('0x25')]:undefined;this[_0x60a5('0x26')]=_0x2d6634[_0x60a5('0x25')]?_0x2d6634[_0x60a5('0x25')]['name']:undefined;this[_0x60a5('0x27')]=_0x2d6634[_0x60a5('0x27')]||![];this[_0x60a5('0x28')]=_0x2d6634[_0x60a5('0x28')];this[_0x60a5('0x29')]=_0x2d6634[_0x60a5('0x29')];this[_0x60a5('0x2a')]=_0x2d6634[_0x60a5('0x2a')];this[_0x60a5('0x2b')]=_0x2d6634[_0x60a5('0x2b')];this[_0x60a5('0x2c')]=_0x2d6634['dialAMDMinWordLength'];this[_0x60a5('0x2d')]=_0x2d6634[_0x60a5('0x2d')];this[_0x60a5('0x2e')]=_0x2d6634[_0x60a5('0x2e')];this[_0x60a5('0x2f')]=_0x2d6634[_0x60a5('0x2f')];this[_0x60a5('0x30')]=_0x2d6634[_0x60a5('0x30')];}module[_0x60a5('0x31')]=Campaign; \ No newline at end of file +var _0x5e4a=['dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC'];(function(_0xcfeff4,_0x3f2e19){var _0xb2fadc=function(_0x4cd013){while(--_0x4cd013){_0xcfeff4['push'](_0xcfeff4['shift']());}};_0xb2fadc(++_0x3f2e19);}(_0x5e4a,0x199));var _0xa5e4=function(_0x9b30e8,_0x175049){_0x9b30e8=_0x9b30e8-0x0;var _0x266437=_0x5e4a[_0x9b30e8];return _0x266437;};'use strict';function Campaign(_0x281b40){this['id']=_0x281b40['id']||0x0;this[_0xa5e4('0x0')]=_0x281b40[_0xa5e4('0x0')]||'';this['type']=_0x281b40[_0xa5e4('0x1')]||'campaign';this[_0xa5e4('0x2')]=0x0;this[_0xa5e4('0x3')]=0x0;this[_0xa5e4('0x4')]=0x0;this[_0xa5e4('0x5')]=0x0;this[_0xa5e4('0x6')]='';this[_0xa5e4('0x7')]=!![];this['active']=_0x281b40[_0xa5e4('0x8')];this[_0xa5e4('0x9')]=_0x281b40[_0xa5e4('0x9')];this['dialTimezone']=_0x281b40[_0xa5e4('0xa')]||null;this[_0xa5e4('0xb')]=_0x281b40[_0xa5e4('0xb')]?_0x281b40[_0xa5e4('0xb')]:null;this[_0xa5e4('0xc')]=_0x281b40[_0xa5e4('0xc')];this['dialOriginateCallerIdNumber']=_0x281b40[_0xa5e4('0xd')];this[_0xa5e4('0xe')]=_0x281b40[_0xa5e4('0xe')]||0x1e;this[_0xa5e4('0xf')]=_0x281b40[_0xa5e4('0xf')];this[_0xa5e4('0x10')]=_0x281b40[_0xa5e4('0x10')];this[_0xa5e4('0x11')]=_0x281b40[_0xa5e4('0x11')];this['dialBusyRetryFrequency']=_0x281b40[_0xa5e4('0x12')];this[_0xa5e4('0x13')]=_0x281b40[_0xa5e4('0x13')];this[_0xa5e4('0x14')]=_0x281b40[_0xa5e4('0x14')];this[_0xa5e4('0x15')]=_0x281b40[_0xa5e4('0x15')];this[_0xa5e4('0x16')]=_0x281b40[_0xa5e4('0x16')]||0x3;this[_0xa5e4('0x17')]=_0x281b40['dialNoSuchNumberRetryFrequency']||0x96;this['dialDropMaxRetry']=_0x281b40['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x281b40['dialDropRetryFrequency']||0x96;this[_0xa5e4('0x18')]=_0x281b40[_0xa5e4('0x18')]||0x3;this[_0xa5e4('0x19')]=_0x281b40[_0xa5e4('0x19')]||0x96;this[_0xa5e4('0x1a')]=_0x281b40[_0xa5e4('0x1a')]||0x3;this[_0xa5e4('0x1b')]=_0x281b40[_0xa5e4('0x1b')]||0x96;this['dialAgentRejectMaxRetry']=_0x281b40[_0xa5e4('0x1c')]||0x3;this[_0xa5e4('0x1d')]=_0x281b40[_0xa5e4('0x1d')]||0x96;this[_0xa5e4('0x1e')]=_0x281b40[_0xa5e4('0x1e')]||_0xa5e4('0x1f');this['dialPrefix']=_0x281b40['dialPrefix']||undefined;this[_0xa5e4('0x20')]=_0x281b40[_0xa5e4('0x20')]||undefined;this[_0xa5e4('0x21')]=_0x281b40[_0xa5e4('0x21')]||undefined;this[_0xa5e4('0x22')]=_0x281b40['TrunkBackup']?_0x281b40[_0xa5e4('0x22')]:undefined;this[_0xa5e4('0x23')]=_0x281b40[_0xa5e4('0x23')]?_0x281b40[_0xa5e4('0x23')]:undefined;this[_0xa5e4('0x24')]=_0x281b40['Interval']?_0x281b40[_0xa5e4('0x24')]:undefined;this[_0xa5e4('0x25')]=_0x281b40[_0xa5e4('0x25')]?_0x281b40[_0xa5e4('0x25')]:undefined;this['dialQueueProject']=_0x281b40[_0xa5e4('0x25')]?_0x281b40['SquareProject']['name']:undefined;this[_0xa5e4('0x26')]=_0x281b40[_0xa5e4('0x26')]||![];this['dialAMDInitialSilence']=_0x281b40[_0xa5e4('0x27')];this[_0xa5e4('0x28')]=_0x281b40[_0xa5e4('0x28')];this[_0xa5e4('0x29')]=_0x281b40[_0xa5e4('0x29')];this[_0xa5e4('0x2a')]=_0x281b40['dialAMDTotalAnalysisTime'];this[_0xa5e4('0x2b')]=_0x281b40[_0xa5e4('0x2b')];this[_0xa5e4('0x2c')]=_0x281b40[_0xa5e4('0x2c')];this[_0xa5e4('0x2d')]=_0x281b40['dialAMDMaximumNumberOfWords'];this[_0xa5e4('0x2e')]=_0x281b40[_0xa5e4('0x2e')];this[_0xa5e4('0x2f')]=_0x281b40['dialAMDMaximumWordLength'];}module[_0xa5e4('0x30')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index b673d50..c751428 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 _0x235b=['calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','context','linkedid','exten','answered','endtime','unmanaged','abandoned','lastapplication','lastdata','holdtime','type','tag','disposition','monitor','monitorFilename','queue','monitors','transferconnectedlinenum','transferType','mohtime','starttime'];(function(_0x5e3b04,_0xbb6795){var _0x1fc44d=function(_0x3472a1){while(--_0x3472a1){_0x5e3b04['push'](_0x5e3b04['shift']());}};_0x1fc44d(++_0xbb6795);}(_0x235b,0x1ed));var _0xb235=function(_0x4167e0,_0x955464){_0x4167e0=_0x4167e0-0x0;var _0x55a313=_0x235b[_0x4167e0];return _0x55a313;};'use strict';function Channel(){this[_0xb235('0x0')]=null;this['channel']='';this['destinationchannel']='';this[_0xb235('0x1')]=0x0;this[_0xb235('0x2')]='';this[_0xb235('0x3')]=undefined;this[_0xb235('0x4')]=undefined;this[_0xb235('0x5')]=0x0;this[_0xb235('0x6')]='';this['uniqueid']=0x0;this[_0xb235('0x7')]=0x0;this[_0xb235('0x8')]=0x0;this[_0xb235('0x9')]=![];this['answertime']=null;this[_0xb235('0xa')]=null;this[_0xb235('0xb')]=![];this[_0xb235('0xc')]=![];this[_0xb235('0xd')]='';this[_0xb235('0xe')]='';this['duration']=0x0;this['billableseconds']=0x0;this[_0xb235('0xf')]=0x0;this[_0xb235('0x10')]=null;this[_0xb235('0x11')]=null;this[_0xb235('0x12')]=null;this[_0xb235('0x13')]=![];this[_0xb235('0x14')]=null;this[_0xb235('0x15')]=null;this[_0xb235('0x16')]=[];this['transfercalleridnum']=undefined;this[_0xb235('0x17')]=undefined;this[_0xb235('0x18')]=undefined;this[_0xb235('0x19')]=0x0;}module['exports']=Channel; \ No newline at end of file +var _0x1a62=['channel','destinationchannel','calleridname','connectedlinenum','context','linkedid','exten','answered','answertime','endtime','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','tag','disposition','monitorFilename','queue','transfercalleridnum','transferconnectedlinenum','transferType','exports','starttime'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1a62,0x176));var _0x21a6=function(_0x2b8ef1,_0x52fe1a){_0x2b8ef1=_0x2b8ef1-0x0;var _0x19f5ed=_0x1a62[_0x2b8ef1];return _0x19f5ed;};'use strict';function Channel(){this[_0x21a6('0x0')]=null;this[_0x21a6('0x1')]='';this[_0x21a6('0x2')]='';this['calleridnum']=0x0;this[_0x21a6('0x3')]='';this[_0x21a6('0x4')]=undefined;this['connectedlinename']=undefined;this['accountcode']=0x0;this[_0x21a6('0x5')]='';this['uniqueid']=0x0;this[_0x21a6('0x6')]=0x0;this[_0x21a6('0x7')]=0x0;this[_0x21a6('0x8')]=![];this[_0x21a6('0x9')]=null;this[_0x21a6('0xa')]=null;this['unmanaged']=![];this[_0x21a6('0xb')]=![];this[_0x21a6('0xc')]='';this[_0x21a6('0xd')]='';this[_0x21a6('0xe')]=0x0;this[_0x21a6('0xf')]=0x0;this[_0x21a6('0x10')]=0x0;this['type']=null;this[_0x21a6('0x11')]=null;this[_0x21a6('0x12')]=null;this['monitor']=![];this[_0x21a6('0x13')]=null;this[_0x21a6('0x14')]=null;this['monitors']=[];this[_0x21a6('0x15')]=undefined;this[_0x21a6('0x16')]=undefined;this[_0x21a6('0x17')]=undefined;this['mohtime']=0x0;}module[_0x21a6('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 ff8ff52..e37b99d 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 _0x4bc2=['token','tokenSecret','type','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret'];(function(_0x3777c2,_0x41cae1){var _0x37ec12=function(_0x27b12d){while(--_0x27b12d){_0x3777c2['push'](_0x3777c2['shift']());}};_0x37ec12(++_0x41cae1);}(_0x4bc2,0x1d9));var _0x24bc=function(_0x4418b6,_0x4f24a0){_0x4418b6=_0x4418b6-0x0;var _0x312c31=_0x4bc2[_0x4418b6];return _0x312c31;};'use strict';function DeskAccount(_0x2d13b3){this['id']=_0x2d13b3['id']||0x0;this[_0x24bc('0x0')]=_0x2d13b3['name']||'';this[_0x24bc('0x1')]=_0x2d13b3[_0x24bc('0x1')]||'';this[_0x24bc('0x2')]=_0x2d13b3[_0x24bc('0x2')]||'';this['authType']=_0x2d13b3[_0x24bc('0x3')]||'';this['password']=_0x2d13b3[_0x24bc('0x4')]||'';this['consumerKey']=_0x2d13b3[_0x24bc('0x5')]||'';this[_0x24bc('0x6')]=_0x2d13b3[_0x24bc('0x6')]||'';this[_0x24bc('0x7')]=_0x2d13b3[_0x24bc('0x7')]||'';this[_0x24bc('0x8')]=_0x2d13b3[_0x24bc('0x8')]||'';this[_0x24bc('0x9')]=_0x2d13b3[_0x24bc('0x9')]||'';this['serverUrl']=_0x2d13b3['serverUrl']||'';this['Configurations']=_0x2d13b3[_0x24bc('0xa')]||{};}module[_0x24bc('0xb')]=DeskAccount; \ No newline at end of file +var _0x1816=['tokenSecret','type','Configurations','exports','username','remoteUri','authType','password','consumerKey','token'];(function(_0x22123d,_0x45ae06){var _0xeabce1=function(_0x239cae){while(--_0x239cae){_0x22123d['push'](_0x22123d['shift']());}};_0xeabce1(++_0x45ae06);}(_0x1816,0xcc));var _0x6181=function(_0x2aa33e,_0x30d8a9){_0x2aa33e=_0x2aa33e-0x0;var _0x358103=_0x1816[_0x2aa33e];return _0x358103;};'use strict';function DeskAccount(_0x37af7e){this['id']=_0x37af7e['id']||0x0;this['name']=_0x37af7e['name']||'';this[_0x6181('0x0')]=_0x37af7e[_0x6181('0x0')]||'';this[_0x6181('0x1')]=_0x37af7e['remoteUri']||'';this[_0x6181('0x2')]=_0x37af7e[_0x6181('0x2')]||'';this[_0x6181('0x3')]=_0x37af7e[_0x6181('0x3')]||'';this[_0x6181('0x4')]=_0x37af7e['consumerKey']||'';this['consumerSecret']=_0x37af7e['consumerSecret']||'';this[_0x6181('0x5')]=_0x37af7e[_0x6181('0x5')]||'';this['tokenSecret']=_0x37af7e[_0x6181('0x6')]||'';this[_0x6181('0x7')]=_0x37af7e[_0x6181('0x7')]||'';this['serverUrl']=_0x37af7e['serverUrl']||'';this[_0x6181('0x8')]=_0x37af7e['Configurations']||{};}module[_0x6181('0x9')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index c035ea2..fee0bf6 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 _0xed16=['CloudProvider','name','username','password','remoteUri','tenantId','clientId','serverUrl','Configurations'];(function(_0x108904,_0x52c660){var _0x52df85=function(_0x2cc877){while(--_0x2cc877){_0x108904['push'](_0x108904['shift']());}};_0x52df85(++_0x52c660);}(_0xed16,0xbe));var _0x6ed1=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xed16[_0x4e9628];return _0x27bc8c;};'use strict';function Dynamics365Account(_0x1f1492){this['id']=_0x1f1492['id']||0x0;this[_0x6ed1('0x0')]=_0x1f1492[_0x6ed1('0x0')]||'';this[_0x6ed1('0x1')]=_0x1f1492[_0x6ed1('0x1')]||'';this[_0x6ed1('0x2')]=_0x1f1492[_0x6ed1('0x2')]||'';this[_0x6ed1('0x3')]=_0x1f1492[_0x6ed1('0x3')]||'';this['tenantId']=_0x1f1492[_0x6ed1('0x4')]||'';this[_0x6ed1('0x5')]=_0x1f1492[_0x6ed1('0x5')]||'';this['clientSecret']=_0x1f1492['clientSecret']||{};this['serverUrl']=_0x1f1492[_0x6ed1('0x6')]||'';this['modernAuthentication']=_0x1f1492['modernAuthentication']||![];this[_0x6ed1('0x7')]=_0x1f1492[_0x6ed1('0x7')]||{};this[_0x6ed1('0x8')]=_0x1f1492[_0x6ed1('0x8')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0xc345=['exports','name','username','password','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider'];(function(_0x187e79,_0x3037a5){var _0xa94a0a=function(_0x32d439){while(--_0x32d439){_0x187e79['push'](_0x187e79['shift']());}};_0xa94a0a(++_0x3037a5);}(_0xc345,0x109));var _0x5c34=function(_0x4066c2,_0xad48e8){_0x4066c2=_0x4066c2-0x0;var _0x3870a0=_0xc345[_0x4066c2];return _0x3870a0;};'use strict';function Dynamics365Account(_0x556ce2){this['id']=_0x556ce2['id']||0x0;this[_0x5c34('0x0')]=_0x556ce2[_0x5c34('0x0')]||'';this[_0x5c34('0x1')]=_0x556ce2[_0x5c34('0x1')]||'';this[_0x5c34('0x2')]=_0x556ce2[_0x5c34('0x2')]||'';this['remoteUri']=_0x556ce2['remoteUri']||'';this[_0x5c34('0x3')]=_0x556ce2[_0x5c34('0x3')]||'';this[_0x5c34('0x4')]=_0x556ce2[_0x5c34('0x4')]||'';this[_0x5c34('0x5')]=_0x556ce2[_0x5c34('0x5')]||{};this[_0x5c34('0x6')]=_0x556ce2[_0x5c34('0x6')]||'';this[_0x5c34('0x7')]=_0x556ce2[_0x5c34('0x7')]||![];this['Configurations']=_0x556ce2[_0x5c34('0x8')]||{};this[_0x5c34('0x9')]=_0x556ce2[_0x5c34('0x9')]||{};}module[_0x5c34('0xa')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 337c16a..7cfcac3 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 _0xf26b=['gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29'];(function(_0x1c87ea,_0x136680){var _0xf5eec4=function(_0x581fc4){while(--_0x581fc4){_0x1c87ea['push'](_0x1c87ea['shift']());}};_0xf5eec4(++_0x136680);}(_0xf26b,0x17e));var _0xbf26=function(_0x1d0b74,_0x2b9295){_0x1d0b74=_0x1d0b74-0x0;var _0x1c18e7=_0xf26b[_0x1d0b74];return _0x1c18e7;};'use strict';function FaxAccount(_0x3173d1){this['id']=_0x3173d1['id']||0x0;this[_0xbf26('0x0')]=_0x3173d1[_0xbf26('0x0')]||'';this[_0xbf26('0x1')]=_0x3173d1[_0xbf26('0x1')];this[_0xbf26('0x2')]=_0x3173d1['ecm'];this['headerinfo']=_0x3173d1[_0xbf26('0x3')];this['localstationid']=_0x3173d1[_0xbf26('0x4')];this[_0xbf26('0x5')]=_0x3173d1['minrate']||0x960;this[_0xbf26('0x6')]=_0x3173d1[_0xbf26('0x6')]||0x3840;this['modem']=_0x3173d1[_0xbf26('0x7')]||_0xbf26('0x8');this[_0xbf26('0x9')]=_0x3173d1[_0xbf26('0x9')]||'no';this[_0xbf26('0xa')]=_0x3173d1[_0xbf26('0xa')]||'no';this[_0xbf26('0xb')]=_0x3173d1['t38timeout']||0x1388;this[_0xbf26('0xc')]=_0x3173d1[_0xbf26('0xc')]||_0xbf26('0xd');this['Trunk']=_0x3173d1[_0xbf26('0xe')]?_0x3173d1[_0xbf26('0xe')]:undefined;this[_0xbf26('0xf')]=_0x3173d1[_0xbf26('0xf')];this[_0xbf26('0x10')]=_0x3173d1['key'];}module['exports']=FaxAccount; \ No newline at end of file +var _0xd497=['name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId'];(function(_0x59516f,_0x3d6857){var _0x3746c5=function(_0x2821c){while(--_0x2821c){_0x59516f['push'](_0x59516f['shift']());}};_0x3746c5(++_0x3d6857);}(_0xd497,0x170));var _0x7d49=function(_0x458a48,_0x2ee504){_0x458a48=_0x458a48-0x0;var _0x9c952f=_0xd497[_0x458a48];return _0x9c952f;};'use strict';function FaxAccount(_0xb364a2){this['id']=_0xb364a2['id']||0x0;this['name']=_0xb364a2[_0x7d49('0x0')]||'';this[_0x7d49('0x1')]=_0xb364a2[_0x7d49('0x1')];this['ecm']=_0xb364a2[_0x7d49('0x2')];this[_0x7d49('0x3')]=_0xb364a2[_0x7d49('0x3')];this['localstationid']=_0xb364a2[_0x7d49('0x4')];this[_0x7d49('0x5')]=_0xb364a2[_0x7d49('0x5')]||0x960;this[_0x7d49('0x6')]=_0xb364a2[_0x7d49('0x6')]||0x3840;this[_0x7d49('0x7')]=_0xb364a2['modem']||_0x7d49('0x8');this[_0x7d49('0x9')]=_0xb364a2['gateway']||'no';this['faxdetect']=_0xb364a2[_0x7d49('0xa')]||'no';this[_0x7d49('0xb')]=_0xb364a2[_0x7d49('0xb')]||0x1388;this[_0x7d49('0xc')]=_0xb364a2['tech']||_0x7d49('0xd');this[_0x7d49('0xe')]=_0xb364a2[_0x7d49('0xe')]?_0xb364a2['Trunk']:undefined;this[_0x7d49('0xf')]=_0xb364a2[_0x7d49('0xf')];this['key']=_0xb364a2['key'];}module['exports']=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index b8c7e04..5cffd63 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 _0x03da=['remoteUri','serverUrl','name','username','apiKey'];(function(_0x2a94d8,_0x47d4fe){var _0xe1f74d=function(_0x1c5735){while(--_0x1c5735){_0x2a94d8['push'](_0x2a94d8['shift']());}};_0xe1f74d(++_0x47d4fe);}(_0x03da,0xd4));var _0xa03d=function(_0x2a478e,_0x404251){_0x2a478e=_0x2a478e-0x0;var _0x51322c=_0x03da[_0x2a478e];return _0x51322c;};'use strict';function FreshdeskAccount(_0x19c563){this['id']=_0x19c563['id']||0x0;this[_0xa03d('0x0')]=_0x19c563[_0xa03d('0x0')]||'';this[_0xa03d('0x1')]=_0x19c563[_0xa03d('0x1')]||'';this[_0xa03d('0x2')]=_0x19c563['token']||'';this[_0xa03d('0x3')]=_0x19c563['remoteUri']||'';this[_0xa03d('0x4')]=_0x19c563[_0xa03d('0x4')]||'';this['Configurations']=_0x19c563['Configurations']||{};}module['exports']=FreshdeskAccount; \ No newline at end of file +var _0x4e9c=['name','username','apiKey','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x3a48aa,_0x535d3a){var _0xbaa321=function(_0x1367f4){while(--_0x1367f4){_0x3a48aa['push'](_0x3a48aa['shift']());}};_0xbaa321(++_0x535d3a);}(_0x4e9c,0x90));var _0xc4e9=function(_0x2439d0,_0x34c4cf){_0x2439d0=_0x2439d0-0x0;var _0xbbfc41=_0x4e9c[_0x2439d0];return _0xbbfc41;};'use strict';function FreshdeskAccount(_0x3683c7){this['id']=_0x3683c7['id']||0x0;this[_0xc4e9('0x0')]=_0x3683c7[_0xc4e9('0x0')]||'';this[_0xc4e9('0x1')]=_0x3683c7[_0xc4e9('0x1')]||'';this[_0xc4e9('0x2')]=_0x3683c7[_0xc4e9('0x3')]||'';this[_0xc4e9('0x4')]=_0x3683c7[_0xc4e9('0x4')]||'';this['serverUrl']=_0x3683c7[_0xc4e9('0x5')]||'';this[_0xc4e9('0x6')]=_0x3683c7[_0xc4e9('0x6')]||{};}module[_0xc4e9('0x7')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 335aba1..9c19725 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 _0xac0a=['apiKey','token','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x13fe64,_0xc50d55){var _0x2908cf=function(_0x263f80){while(--_0x263f80){_0x13fe64['push'](_0x13fe64['shift']());}};_0x2908cf(++_0xc50d55);}(_0xac0a,0x11e));var _0xaac0=function(_0x5958a5,_0x576571){_0x5958a5=_0x5958a5-0x0;var _0x17cae9=_0xac0a[_0x5958a5];return _0x17cae9;};'use strict';function FreshsalesAccount(_0x886d8){this['id']=_0x886d8['id']||0x0;this['name']=_0x886d8[_0xaac0('0x0')]||'';this[_0xaac0('0x1')]=_0x886d8['username']||'';this[_0xaac0('0x2')]=_0x886d8[_0xaac0('0x3')]||'';this[_0xaac0('0x4')]=_0x886d8[_0xaac0('0x4')]||'';this[_0xaac0('0x5')]=_0x886d8[_0xaac0('0x5')]||'';this[_0xaac0('0x6')]=_0x886d8[_0xaac0('0x6')]||{};}module[_0xaac0('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0x56da=['exports','name','username','apiKey','token','remoteUri','serverUrl','Configurations'];(function(_0x567d01,_0x5994a8){var _0x2eeb1c=function(_0x5b66e5){while(--_0x5b66e5){_0x567d01['push'](_0x567d01['shift']());}};_0x2eeb1c(++_0x5994a8);}(_0x56da,0x119));var _0xa56d=function(_0x47408e,_0x481428){_0x47408e=_0x47408e-0x0;var _0x1636bc=_0x56da[_0x47408e];return _0x1636bc;};'use strict';function FreshsalesAccount(_0x36a5c2){this['id']=_0x36a5c2['id']||0x0;this['name']=_0x36a5c2[_0xa56d('0x0')]||'';this[_0xa56d('0x1')]=_0x36a5c2['username']||'';this[_0xa56d('0x2')]=_0x36a5c2[_0xa56d('0x3')]||'';this[_0xa56d('0x4')]=_0x36a5c2[_0xa56d('0x4')]||'';this[_0xa56d('0x5')]=_0x36a5c2[_0xa56d('0x5')]||'';this[_0xa56d('0x6')]=_0x36a5c2[_0xa56d('0x6')]||{};}module[_0xa56d('0x7')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index a671e8a..b39d11f 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 _0x0594=['uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','originalposition','channel','connectedlinenum','connectedlinename','accountcode','exten','priority','routealias','mohtime','exports','type','inbound'];(function(_0x3774b0,_0x35b50f){var _0x427685=function(_0x31df15){while(--_0x31df15){_0x3774b0['push'](_0x3774b0['shift']());}};_0x427685(++_0x35b50f);}(_0x0594,0x1a7));var _0x4059=function(_0x103096,_0x3ed91b){_0x103096=_0x103096-0x0;var _0x322f4f=_0x0594[_0x103096];return _0x322f4f;};'use strict';function QueueReport(){this[_0x4059('0x0')]=_0x4059('0x1');this[_0x4059('0x2')]='';this[_0x4059('0x3')]='';this[_0x4059('0x4')]='';this[_0x4059('0x5')]='';this[_0x4059('0x6')]=null;this[_0x4059('0x7')]=null;this[_0x4059('0x8')]=0x1;this[_0x4059('0x9')]=0x1;this[_0x4059('0xa')]=![];this[_0x4059('0xb')]=null;this[_0x4059('0xc')]=![];this[_0x4059('0xd')]=null;this[_0x4059('0xe')]=![];this['queuecallerexitAt']=null;this[_0x4059('0xf')]=0x1;this[_0x4059('0x10')]='';this[_0x4059('0x11')]='';this[_0x4059('0x12')]='';this[_0x4059('0x13')]='';this['context']='';this[_0x4059('0x14')]='';this[_0x4059('0x15')]='';this['holdtime']=0x0;this['assigned']=![];this['lastAssignedTo']='';this['motionChannel']='voice';this[_0x4059('0x16')]=null;this[_0x4059('0x17')]=0x0;this['variables']={};}module[_0x4059('0x18')]=QueueReport; \ No newline at end of file +var _0x56c6=['queuecallerjoinAt','queuecallerleaveAt','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','context','exten','priority','holdtime','assigned','lastAssignedTo','motionChannel','routealias','mohtime','variables','exports','inbound','uniqueid','calleridnum','calleridname','queue'];(function(_0x5c059d,_0x360da0){var _0x78e05c=function(_0x393518){while(--_0x393518){_0x5c059d['push'](_0x5c059d['shift']());}};_0x78e05c(++_0x360da0);}(_0x56c6,0x167));var _0x656c=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x56c6[_0x209941];return _0x1e8729;};'use strict';function QueueReport(){this['type']=_0x656c('0x0');this[_0x656c('0x1')]='';this[_0x656c('0x2')]='';this[_0x656c('0x3')]='';this[_0x656c('0x4')]='';this[_0x656c('0x5')]=null;this[_0x656c('0x6')]=null;this['position']=0x1;this[_0x656c('0x7')]=0x1;this[_0x656c('0x8')]=![];this[_0x656c('0x9')]=null;this[_0x656c('0xa')]=![];this[_0x656c('0xb')]=null;this['queuecallerexit']=![];this[_0x656c('0xc')]=null;this[_0x656c('0xd')]=0x1;this[_0x656c('0xe')]='';this[_0x656c('0xf')]='';this[_0x656c('0x10')]='';this['accountcode']='';this[_0x656c('0x11')]='';this[_0x656c('0x12')]='';this[_0x656c('0x13')]='';this[_0x656c('0x14')]=0x0;this[_0x656c('0x15')]=![];this[_0x656c('0x16')]='';this[_0x656c('0x17')]='voice';this[_0x656c('0x18')]=null;this[_0x656c('0x19')]=0x0;this[_0x656c('0x1a')]={};}module[_0x656c('0x1b')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 68392bc..4cf30b6 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 _0x5732=['name','username','remoteUri','password','clientId','clientSecret','type','integrationTab','Configurations','exports'];(function(_0x574617,_0x42eccc){var _0x29de90=function(_0x367aff){while(--_0x367aff){_0x574617['push'](_0x574617['shift']());}};_0x29de90(++_0x42eccc);}(_0x5732,0xdc));var _0x2573=function(_0x5021b9,_0x1440d7){_0x5021b9=_0x5021b9-0x0;var _0x516b81=_0x5732[_0x5021b9];return _0x516b81;};'use strict';function SalesforceAccount(_0x401a17){this['id']=_0x401a17['id']||0x0;this[_0x2573('0x0')]=_0x401a17[_0x2573('0x0')]||'';this[_0x2573('0x1')]=_0x401a17['username']||'';this[_0x2573('0x2')]=_0x401a17[_0x2573('0x2')]||'';this[_0x2573('0x3')]=_0x401a17[_0x2573('0x3')]||'';this[_0x2573('0x4')]=_0x401a17[_0x2573('0x4')]||'';this[_0x2573('0x5')]=_0x401a17['clientSecret']||'';this['securityToken']=_0x401a17['securityToken']||'';this[_0x2573('0x6')]=_0x401a17[_0x2573('0x6')]||_0x2573('0x7');this['serverUrl']=_0x401a17['serverUrl']||'';this[_0x2573('0x8')]=_0x401a17['Configurations']||{};}module[_0x2573('0x9')]=SalesforceAccount; \ No newline at end of file +var _0x83a7=['remoteUri','clientId','clientSecret','securityToken','type','serverUrl','Configurations','exports','name','username'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x83a7,0x1f2));var _0x783a=function(_0xa51fdc,_0x21e27e){_0xa51fdc=_0xa51fdc-0x0;var _0x29d763=_0x83a7[_0xa51fdc];return _0x29d763;};'use strict';function SalesforceAccount(_0x5d05a9){this['id']=_0x5d05a9['id']||0x0;this[_0x783a('0x0')]=_0x5d05a9['name']||'';this['username']=_0x5d05a9[_0x783a('0x1')]||'';this[_0x783a('0x2')]=_0x5d05a9[_0x783a('0x2')]||'';this['password']=_0x5d05a9['password']||'';this[_0x783a('0x3')]=_0x5d05a9[_0x783a('0x3')]||'';this[_0x783a('0x4')]=_0x5d05a9['clientSecret']||'';this[_0x783a('0x5')]=_0x5d05a9[_0x783a('0x5')]||'';this['type']=_0x5d05a9[_0x783a('0x6')]||'integrationTab';this[_0x783a('0x7')]=_0x5d05a9['serverUrl']||'';this['Configurations']=_0x5d05a9[_0x783a('0x8')]||{};}module[_0x783a('0x9')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 65825fd..9f9f74a 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 _0x8428=['remoteUri','Configurations','exports','name','username','password'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x8428,0x159));var _0x8842=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8428[_0x14add3];return _0x4a174f;};'use strict';function ServicenowAccount(_0x3c39fd){this['id']=_0x3c39fd['id']||0x0;this['name']=_0x3c39fd[_0x8842('0x0')]||'';this[_0x8842('0x1')]=_0x3c39fd['username']||'';this[_0x8842('0x2')]=_0x3c39fd[_0x8842('0x2')]||'';this[_0x8842('0x3')]=_0x3c39fd[_0x8842('0x3')]||'';this['serverUrl']=_0x3c39fd['serverUrl']||'';this[_0x8842('0x4')]=_0x3c39fd[_0x8842('0x4')]||{};}module[_0x8842('0x5')]=ServicenowAccount; \ No newline at end of file +var _0x82e5=['password','remoteUri','serverUrl','Configurations','exports','username'];(function(_0x3c7869,_0x207240){var _0x23bc0b=function(_0x1d5f28){while(--_0x1d5f28){_0x3c7869['push'](_0x3c7869['shift']());}};_0x23bc0b(++_0x207240);}(_0x82e5,0x16d));var _0x582e=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0x82e5[_0x2cf2e9];return _0xd3670d;};'use strict';function ServicenowAccount(_0x247f37){this['id']=_0x247f37['id']||0x0;this['name']=_0x247f37['name']||'';this[_0x582e('0x0')]=_0x247f37['username']||'';this[_0x582e('0x1')]=_0x247f37[_0x582e('0x1')]||'';this[_0x582e('0x2')]=_0x247f37[_0x582e('0x2')]||'';this[_0x582e('0x3')]=_0x247f37[_0x582e('0x3')]||'';this[_0x582e('0x4')]=_0x247f37[_0x582e('0x4')]||{};}module[_0x582e('0x5')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index c87fceb..85830c8 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 _0xb36e=['remoteUri','serverUrl','Configurations','name','username','password'];(function(_0x1b3235,_0x39d7ff){var _0x4af933=function(_0x1ff9c5){while(--_0x1ff9c5){_0x1b3235['push'](_0x1b3235['shift']());}};_0x4af933(++_0x39d7ff);}(_0xb36e,0xc3));var _0xeb36=function(_0x2479d1,_0x368393){_0x2479d1=_0x2479d1-0x0;var _0x5104d3=_0xb36e[_0x2479d1];return _0x5104d3;};'use strict';function SugarcrmAccount(_0x21fcf9){this['id']=_0x21fcf9['id']||0x0;this[_0xeb36('0x0')]=_0x21fcf9[_0xeb36('0x0')]||'';this[_0xeb36('0x1')]=_0x21fcf9[_0xeb36('0x1')]||'';this['password']=_0x21fcf9[_0xeb36('0x2')]||'';this[_0xeb36('0x3')]=_0x21fcf9[_0xeb36('0x3')]||'';this[_0xeb36('0x4')]=_0x21fcf9[_0xeb36('0x4')]||'';this[_0xeb36('0x5')]=_0x21fcf9[_0xeb36('0x5')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file +var _0xa1b1=['password','remoteUri','serverUrl','name','username'];(function(_0xf61c79,_0x43c6fa){var _0x127d26=function(_0x598bf6){while(--_0x598bf6){_0xf61c79['push'](_0xf61c79['shift']());}};_0x127d26(++_0x43c6fa);}(_0xa1b1,0xda));var _0x1a1b=function(_0x4d50b4,_0x314aaa){_0x4d50b4=_0x4d50b4-0x0;var _0x18bcbf=_0xa1b1[_0x4d50b4];return _0x18bcbf;};'use strict';function SugarcrmAccount(_0xebce8f){this['id']=_0xebce8f['id']||0x0;this['name']=_0xebce8f[_0x1a1b('0x0')]||'';this['username']=_0xebce8f[_0x1a1b('0x1')]||'';this[_0x1a1b('0x2')]=_0xebce8f[_0x1a1b('0x2')]||'';this[_0x1a1b('0x3')]=_0xebce8f[_0x1a1b('0x3')]||'';this['serverUrl']=_0xebce8f[_0x1a1b('0x4')]||'';this['Configurations']=_0xebce8f['Configurations']||{};}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 7eba497..d654622 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 _0x8747=['stateTime','status','address','name','accountcode','state','unknown'];(function(_0x4c97d8,_0xf49b5c){var _0x4b257f=function(_0x421482){while(--_0x421482){_0x4c97d8['push'](_0x4c97d8['shift']());}};_0x4b257f(++_0xf49b5c);}(_0x8747,0xab));var _0x7874=function(_0x810025,_0x34bb04){_0x810025=_0x810025-0x0;var _0x4dbc81=_0x8747[_0x810025];return _0x4dbc81;};'use strict';function Telephone(_0x53ac1b){this['id']=_0x53ac1b['id']||0x0;this['name']=_0x53ac1b[_0x7874('0x0')]||'';this['accountcode']=_0x53ac1b[_0x7874('0x1')]||'';this[_0x7874('0x2')]=_0x7874('0x3');this[_0x7874('0x4')]=0x0;this[_0x7874('0x5')]=_0x7874('0x3');this[_0x7874('0x6')]='';}module['exports']=Telephone; \ No newline at end of file +var _0xc2da=['unknown','stateTime','status','address','exports','name','accountcode'];(function(_0x173452,_0x3aa870){var _0xee3fd0=function(_0x10eb01){while(--_0x10eb01){_0x173452['push'](_0x173452['shift']());}};_0xee3fd0(++_0x3aa870);}(_0xc2da,0x124));var _0xac2d=function(_0x57e14f,_0x17f93c){_0x57e14f=_0x57e14f-0x0;var _0x39fce2=_0xc2da[_0x57e14f];return _0x39fce2;};'use strict';function Telephone(_0x1409a5){this['id']=_0x1409a5['id']||0x0;this['name']=_0x1409a5[_0xac2d('0x0')]||'';this['accountcode']=_0x1409a5[_0xac2d('0x1')]||'';this['state']=_0xac2d('0x2');this[_0xac2d('0x3')]=0x0;this[_0xac2d('0x4')]=_0xac2d('0x2');this[_0xac2d('0x5')]='';}module[_0xac2d('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 f767df2..a06a591 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['exports','name'];(function(_0x941c29,_0x4a9928){var _0x45a501=function(_0x3cca61){while(--_0x3cca61){_0x941c29['push'](_0x941c29['shift']());}};_0x45a501(++_0x4a9928);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x2f7125,_0x21cae0){var _0x267f5b=function(_0x5b2b4e){while(--_0x5b2b4e){_0x2f7125['push'](_0x2f7125['shift']());}};_0x267f5b(++_0x21cae0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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 57d740d..8a47c8c 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 _0xb10b=['AllConditions','AnyConditions','Actions','exports','name','channel','status'];(function(_0x4363a4,_0x262d0e){var _0x171867=function(_0x1a4f02){while(--_0x1a4f02){_0x4363a4['push'](_0x4363a4['shift']());}};_0x171867(++_0x262d0e);}(_0xb10b,0x12a));var _0xbb10=function(_0x2b91ac,_0x310741){_0x2b91ac=_0x2b91ac-0x0;var _0xe88814=_0xb10b[_0x2b91ac];return _0xe88814;};'use strict';function Trigger(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'voice';this[_0xbb10('0x2')]=_0x13ce8d[_0xbb10('0x2')]||![];this[_0xbb10('0x3')]=_0x13ce8d[_0xbb10('0x3')]||[];this[_0xbb10('0x4')]=_0x13ce8d[_0xbb10('0x4')]||[];this['Actions']=_0x13ce8d[_0xbb10('0x5')]||[];}module[_0xbb10('0x6')]=Trigger; \ No newline at end of file +var _0x2032=['exports','name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0xde2d92,_0x4fcd56){var _0x2d7e92=function(_0x52a318){while(--_0x52a318){_0xde2d92['push'](_0xde2d92['shift']());}};_0x2d7e92(++_0x4fcd56);}(_0x2032,0xd9));var _0x2203=function(_0x3f303b,_0x889cb4){_0x3f303b=_0x3f303b-0x0;var _0x1b35f9=_0x2032[_0x3f303b];return _0x1b35f9;};'use strict';function Trigger(_0x4d6c97){this['id']=_0x4d6c97['id']||0x0;this[_0x2203('0x0')]=_0x4d6c97[_0x2203('0x0')]||'';this[_0x2203('0x1')]=_0x4d6c97['channel']||_0x2203('0x2');this[_0x2203('0x3')]=_0x4d6c97['status']||![];this[_0x2203('0x4')]=_0x4d6c97[_0x2203('0x4')]||[];this[_0x2203('0x5')]=_0x4d6c97[_0x2203('0x5')]||[];this[_0x2203('0x6')]=_0x4d6c97[_0x2203('0x6')]||[];}module[_0x2203('0x7')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index a9de10f..28d341a 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 _0xd3db=['split','host','port','domain','refresh','stateRegistry','registrationtime','address','defaultuser','active','unknown','stateTime','status','registry','indexOf'];(function(_0x40f09a,_0x3743b6){var _0x2eb96c=function(_0xe6203d){while(--_0xe6203d){_0x40f09a['push'](_0x40f09a['shift']());}};_0x2eb96c(++_0x3743b6);}(_0xd3db,0x1ad));var _0xbd3d=function(_0x3ea942,_0x1a0bd5){_0x3ea942=_0x3ea942-0x0;var _0x3185a2=_0xd3db[_0x3ea942];return _0x3185a2;};'use strict';function Trunk(_0x1e35be){this['id']=_0x1e35be['id']||0x0;this[_0xbd3d('0x0')]=_0x1e35be['active']||![];this['name']=_0x1e35be['name']||'';this['state']=_0xbd3d('0x1');this[_0xbd3d('0x2')]=0x0;this[_0xbd3d('0x3')]=_0xbd3d('0x1');this[_0xbd3d('0x4')]=_0x1e35be[_0xbd3d('0x4')]&&_0x1e35be[_0xbd3d('0x4')][_0xbd3d('0x5')](':')?_0x1e35be['registry'][_0xbd3d('0x6')](':')[0x0]:'';this[_0xbd3d('0x7')]='';this[_0xbd3d('0x8')]='';this[_0xbd3d('0x9')]='';this['domainport']='';this[_0xbd3d('0xa')]='';this[_0xbd3d('0xb')]=_0xbd3d('0x1');this[_0xbd3d('0xc')]='';this[_0xbd3d('0xd')]='';this[_0xbd3d('0xe')]=_0x1e35be[_0xbd3d('0xe')]||'';}module['exports']=Trunk; \ No newline at end of file +var _0xaa0e=['registrationtime','defaultuser','exports','active','name','state','unknown','stateTime','status','registry','split','port','domain','domainport','refresh'];(function(_0x5de532,_0x2941c4){var _0x4e9192=function(_0x548a81){while(--_0x548a81){_0x5de532['push'](_0x5de532['shift']());}};_0x4e9192(++_0x2941c4);}(_0xaa0e,0x16b));var _0xeaa0=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0xaa0e[_0xa6cc5c];return _0x44803d;};'use strict';function Trunk(_0x338691){this['id']=_0x338691['id']||0x0;this[_0xeaa0('0x0')]=_0x338691[_0xeaa0('0x0')]||![];this[_0xeaa0('0x1')]=_0x338691[_0xeaa0('0x1')]||'';this[_0xeaa0('0x2')]=_0xeaa0('0x3');this[_0xeaa0('0x4')]=0x0;this[_0xeaa0('0x5')]=_0xeaa0('0x3');this[_0xeaa0('0x6')]=_0x338691[_0xeaa0('0x6')]&&_0x338691['registry']['indexOf'](':')?_0x338691[_0xeaa0('0x6')][_0xeaa0('0x7')](':')[0x0]:'';this['host']='';this[_0xeaa0('0x8')]='';this[_0xeaa0('0x9')]='';this[_0xeaa0('0xa')]='';this[_0xeaa0('0xb')]='';this['stateRegistry']=_0xeaa0('0x3');this[_0xeaa0('0xc')]='';this['address']='';this[_0xeaa0('0xd')]=_0x338691[_0xeaa0('0xd')]||'';}module[_0xeaa0('0xe')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index bedd19b..c893067 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 _0xec2d=['exten','recordingFormat','none','mandatoryDisposition'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xec2d,0x198));var _0xdec2=function(_0x2a0a38,_0x4a6de5){_0x2a0a38=_0x2a0a38-0x0;var _0x4a200e=_0xec2d[_0x2a0a38];return _0x4a200e;};'use strict';function voiceExtension(_0x5a6c7f){this['id']=_0x5a6c7f['id']||0x0;this[_0xdec2('0x0')]=_0x5a6c7f[_0xdec2('0x0')]||'';this[_0xdec2('0x1')]=_0x5a6c7f[_0xdec2('0x1')]||_0xdec2('0x2');this[_0xdec2('0x3')]=_0x5a6c7f[_0xdec2('0x3')]||![];}module['exports']=voiceExtension; \ No newline at end of file +var _0x6786=['mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x26eb17,_0x1fcee7){var _0x4acf2f=function(_0x19921b){while(--_0x19921b){_0x26eb17['push'](_0x26eb17['shift']());}};_0x4acf2f(++_0x1fcee7);}(_0x6786,0x1aa));var _0x6678=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x6786[_0x38537f];return _0x141e23;};'use strict';function voiceExtension(_0x5145fe){this['id']=_0x5145fe['id']||0x0;this[_0x6678('0x0')]=_0x5145fe[_0x6678('0x0')]||'';this[_0x6678('0x1')]=_0x5145fe['recordingFormat']||'none';this[_0x6678('0x2')]=_0x5145fe[_0x6678('0x2')]||![];}module[_0x6678('0x3')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index ddc7926..c42a0bf 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 _0xcf12=['dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','outboundAbandonedDay','startProgressive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav49','fewestcalls','leastrecent','linear','ringall','roundrobin','rrmemory','rrordered','wrandom','name','monitor_format','type','inbound','waiting','total','answered','unmanaged','available','busy','inUse','loggedIn','onHold','paused','ringing','ringInUse','talking','unavailable','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','message','statusMessage','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval'];(function(_0x2e4795,_0x350ba2){var _0x344b5b=function(_0x4a7558){while(--_0x4a7558){_0x2e4795['push'](_0x2e4795['shift']());}};_0x344b5b(++_0x350ba2);}(_0xcf12,0x140));var _0x2cf1=function(_0x4ba5f5,_0x52b2ca){_0x4ba5f5=_0x4ba5f5-0x0;var _0x4b6ab4=_0xcf12[_0x4ba5f5];return _0x4b6ab4;};'use strict';var monitorFormat={'wav':'wav','wav49':_0x2cf1('0x0'),'gsm':'gsm'};var strategy={'fewestcalls':_0x2cf1('0x1'),'leastrecent':_0x2cf1('0x2'),'linear':_0x2cf1('0x3'),'random':'random','ringall':_0x2cf1('0x4'),'rr':_0x2cf1('0x5'),'rrmemory':_0x2cf1('0x6'),'rrordered':_0x2cf1('0x7'),'wrandom':_0x2cf1('0x8')};function VoiceQueue(_0x2da534){this['id']=_0x2da534['id']||0x0;this[_0x2cf1('0x9')]=_0x2da534[_0x2cf1('0x9')]||'';this[_0x2cf1('0xa')]=_0x2da534['monitor_format']||'';this[_0x2cf1('0xb')]=_0x2da534[_0x2cf1('0xb')]||_0x2cf1('0xc');this[_0x2cf1('0xd')]=0x0;this[_0x2cf1('0xe')]=0x0;this[_0x2cf1('0xf')]=0x0;this['sumDuration']=0x0;this['sumHoldTime']=0x0;this['sumBillable']=0x0;this[_0x2cf1('0x10')]=0x0;this['abandoned']=0x0;this[_0x2cf1('0x11')]=0x0;this[_0x2cf1('0x12')]=0x0;this[_0x2cf1('0x13')]=0x0;this['invalid']=0x0;this[_0x2cf1('0x14')]=0x0;this['notInUse']=0x0;this[_0x2cf1('0x15')]=0x0;this[_0x2cf1('0x16')]=0x0;this[_0x2cf1('0x17')]=0x0;this[_0x2cf1('0x18')]=0x0;this[_0x2cf1('0x19')]=0x0;this[_0x2cf1('0x1a')]=0x0;this[_0x2cf1('0x1b')]=0x0;this[_0x2cf1('0x1c')]=_0x2da534[_0x2cf1('0x1c')]||![];this['acwTimeout']=_0x2da534[_0x2cf1('0x1d')]||0xa;this[_0x2cf1('0x1e')]=_0x2da534['autopause']||'no';this[_0x2cf1('0x1f')]=!![];this[_0x2cf1('0x20')]='';this[_0x2cf1('0x21')]='';this[_0x2cf1('0x22')]=0x0;this[_0x2cf1('0x23')]=0x0;this[_0x2cf1('0x24')]=_0x2da534[_0x2cf1('0x24')]||null;this[_0x2cf1('0x25')]=_0x2da534[_0x2cf1('0x25')]?_0x2da534[_0x2cf1('0x25')]:null;this[_0x2cf1('0x26')]=_0x2da534['dialActive'];this[_0x2cf1('0x27')]=_0x2da534['dialMethod']||_0x2cf1('0x28');this[_0x2cf1('0x29')]=_0x2da534[_0x2cf1('0x29')]||0x0;this[_0x2cf1('0x2a')]=_0x2da534[_0x2cf1('0x2a')]||0x0;this[_0x2cf1('0x2b')]=_0x2da534[_0x2cf1('0x2b')]||0x1;this[_0x2cf1('0x2c')]=_0x2da534['dialPredictiveOptimization']||_0x2cf1('0x2d');this[_0x2cf1('0x2e')]=_0x2da534[_0x2cf1('0x2e')]||0.03;this['dialPredictiveInterval']=_0x2da534[_0x2cf1('0x2f')]||0x258;this['dialOriginateCallerIdName']=_0x2da534[_0x2cf1('0x30')]||_0x2cf1('0x31');this[_0x2cf1('0x32')]=_0x2da534[_0x2cf1('0x32')]||'anonymous';this[_0x2cf1('0x33')]=_0x2da534[_0x2cf1('0x33')]||0x1e;this[_0x2cf1('0x34')]=_0x2da534[_0x2cf1('0x34')]||'tTxX';this[_0x2cf1('0x35')]=_0x2da534['dialQueueTimeout']||0x3;this['dialQueueProject']=_0x2da534[_0x2cf1('0x36')]||undefined;this['dialCongestionMaxRetry']=_0x2da534[_0x2cf1('0x37')]||0x3;this[_0x2cf1('0x38')]=_0x2da534[_0x2cf1('0x38')]||0x96;this['dialBusyMaxRetry']=_0x2da534[_0x2cf1('0x39')]||0x3;this[_0x2cf1('0x3a')]=_0x2da534['dialBusyRetryFrequency']||0x96;this[_0x2cf1('0x3b')]=_0x2da534[_0x2cf1('0x3b')]||0x3;this[_0x2cf1('0x3c')]=_0x2da534[_0x2cf1('0x3c')]||0x96;this[_0x2cf1('0x3d')]=_0x2da534[_0x2cf1('0x3d')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x2da534['dialNoSuchNumberRetryFrequency']||0x96;this[_0x2cf1('0x3e')]=_0x2da534[_0x2cf1('0x3e')]||0x3;this[_0x2cf1('0x3f')]=_0x2da534[_0x2cf1('0x3f')]||0x96;this[_0x2cf1('0x40')]=_0x2da534[_0x2cf1('0x40')]||0x3;this['dialAbandonedRetryFrequency']=_0x2da534[_0x2cf1('0x41')]||0x96;this['dialMachineMaxRetry']=_0x2da534[_0x2cf1('0x42')]||0x3;this['dialMachineRetryFrequency']=_0x2da534[_0x2cf1('0x43')]||0x96;this[_0x2cf1('0x44')]=_0x2da534['dialAgentRejectMaxRetry']||0x3;this[_0x2cf1('0x45')]=_0x2da534[_0x2cf1('0x45')]||0x96;this[_0x2cf1('0x46')]=_0x2da534[_0x2cf1('0x46')]||0x3;this['dialGlobalMaxRetry']=_0x2da534[_0x2cf1('0x47')]||0x4;this[_0x2cf1('0x48')]=_0x2da534[_0x2cf1('0x48')]?_0x2da534[_0x2cf1('0x48')]:undefined;this[_0x2cf1('0x49')]=_0x2da534[_0x2cf1('0x49')]?_0x2da534['TrunkBackup']:undefined;this['dialPrefix']=_0x2da534[_0x2cf1('0x4a')]||undefined;this['Interval']=_0x2da534[_0x2cf1('0x4b')]?_0x2da534[_0x2cf1('0x4b')]:undefined;this[_0x2cf1('0x4c')]=_0x2da534[_0x2cf1('0x4c')]||_0x2cf1('0x4d');this[_0x2cf1('0x4e')]=_0x2da534['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x2cf1('0x4f')]=_0x2da534[_0x2cf1('0x4f')]||undefined;this[_0x2cf1('0x50')]=strategy[_0x2da534[_0x2cf1('0x50')]];this[_0x2cf1('0x51')]=!![];this[_0x2cf1('0x52')]=_0x2da534['dialAMDActive']||![];this[_0x2cf1('0x53')]=_0x2da534[_0x2cf1('0x53')];this[_0x2cf1('0x54')]=_0x2da534['dialAMDGreeting'];this[_0x2cf1('0x55')]=_0x2da534[_0x2cf1('0x55')];this[_0x2cf1('0x56')]=_0x2da534['dialAMDTotalAnalysisTime'];this[_0x2cf1('0x57')]=_0x2da534['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0x2da534[_0x2cf1('0x58')];this['dialAMDMaximumNumberOfWords']=_0x2da534[_0x2cf1('0x59')];this[_0x2cf1('0x5a')]=_0x2da534[_0x2cf1('0x5a')];this[_0x2cf1('0x5b')]=_0x2da534['dialAMDMaximumWordLength'];this[_0x2cf1('0x5c')]=0x0;this[_0x2cf1('0x5d')]=0x0;this[_0x2cf1('0x5e')]=_0x2da534[_0x2cf1('0x5e')];this[_0x2cf1('0x5f')]=0x0;this[_0x2cf1('0x60')]=0x0;this[_0x2cf1('0x61')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0x2cf1('0x62')]=0x0;this[_0x2cf1('0x63')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0x2cf1('0x64')]=0x0;this[_0x2cf1('0x65')]=0x0;this[_0x2cf1('0x66')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0x2cf1('0x67')]=0x0;this['outboundReCallsDay']=0x0;this[_0x2cf1('0x68')]=0x0;this[_0x2cf1('0x69')]=undefined;this['startPredictive']=undefined;this[_0x2cf1('0x6a')]=undefined;this[_0x2cf1('0x6b')]=1.05;this[_0x2cf1('0x6c')]=0x0;this[_0x2cf1('0x6d')]=0x0;this[_0x2cf1('0x6e')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0x2cf1('0x6f')]=0x0;this[_0x2cf1('0x70')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0x2cf1('0x71')]=0x0;this[_0x2cf1('0x72')]=_0x2da534[_0x2cf1('0x73')]||0x14;this['predictiveIntervalMinThreshold']=_0x2da534[_0x2cf1('0x73')]||0xa;this[_0x2cf1('0x74')]=0x0;this[_0x2cf1('0x75')]=0x0;this[_0x2cf1('0x76')]=0x1;this[_0x2cf1('0x77')]=0x0;this['erlangCallToSecond']=0x0;this[_0x2cf1('0x78')]=0x0;this[_0x2cf1('0x79')]=0x0;this[_0x2cf1('0x7a')]=_0x2da534[_0x2cf1('0x7a')]||0x1e;this[_0x2cf1('0x7b')]=_0x2da534['dialRecallInQueue']||![];this[_0x2cf1('0x7c')]=!!_0x2da534[_0x2cf1('0x7c')]||![];this['dialPreviewRecallmeReminder']=!!_0x2da534['dialPreviewRecallmeReminder']||![];this[_0x2cf1('0x7d')]=_0x2da534[_0x2cf1('0x7d')]||undefined;this[_0x2cf1('0x7e')]=_0x2da534[_0x2cf1('0x7e')]||![];this[_0x2cf1('0x7f')]=_0x2da534[_0x2cf1('0x7f')]||![];this[_0x2cf1('0xa')]=monitorFormat[_0x2da534[_0x2cf1('0xa')]]?monitorFormat[_0x2da534[_0x2cf1('0xa')]]:undefined;this[_0x2cf1('0x80')]=_0x2da534[_0x2cf1('0x80')]||![];this[_0x2cf1('0x81')]=_0x2da534[_0x2cf1('0x81')]?_0x2da534['mandatoryDispositionPause']:undefined;this[_0x2cf1('0x82')]=![];}module[_0x2cf1('0x83')]=VoiceQueue; \ No newline at end of file +var _0x4672=['outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','gsm','fewestcalls','linear','ringall','roundrobin','rrmemory','rrordered','name','monitor_format','type','inbound','waiting','total','answered','sumHoldTime','sumBillable','unmanaged','abandoned','busy','inUse','invalid','loggedIn','notInUse','onHold','ringing','ringInUse','talking','unavailable','unknown','acw','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay'];(function(_0x32580f,_0x309f20){var _0x319628=function(_0xdfbb19){while(--_0xdfbb19){_0x32580f['push'](_0x32580f['shift']());}};_0x319628(++_0x309f20);}(_0x4672,0x18a));var _0x2467=function(_0x1ce7d8,_0x1b1c3b){_0x1ce7d8=_0x1ce7d8-0x0;var _0x36ecea=_0x4672[_0x1ce7d8];return _0x36ecea;};'use strict';var monitorFormat={'wav':_0x2467('0x0'),'wav49':'wav49','gsm':_0x2467('0x1')};var strategy={'fewestcalls':_0x2467('0x2'),'leastrecent':'leastrecent','linear':_0x2467('0x3'),'random':'random','ringall':_0x2467('0x4'),'rr':_0x2467('0x5'),'rrmemory':_0x2467('0x6'),'rrordered':_0x2467('0x7'),'wrandom':'wrandom'};function VoiceQueue(_0x19e085){this['id']=_0x19e085['id']||0x0;this['name']=_0x19e085[_0x2467('0x8')]||'';this[_0x2467('0x9')]=_0x19e085[_0x2467('0x9')]||'';this[_0x2467('0xa')]=_0x19e085[_0x2467('0xa')]||_0x2467('0xb');this[_0x2467('0xc')]=0x0;this[_0x2467('0xd')]=0x0;this[_0x2467('0xe')]=0x0;this['sumDuration']=0x0;this[_0x2467('0xf')]=0x0;this[_0x2467('0x10')]=0x0;this[_0x2467('0x11')]=0x0;this[_0x2467('0x12')]=0x0;this['available']=0x0;this[_0x2467('0x13')]=0x0;this[_0x2467('0x14')]=0x0;this[_0x2467('0x15')]=0x0;this[_0x2467('0x16')]=0x0;this[_0x2467('0x17')]=0x0;this[_0x2467('0x18')]=0x0;this['paused']=0x0;this[_0x2467('0x19')]=0x0;this[_0x2467('0x1a')]=0x0;this[_0x2467('0x1b')]=0x0;this[_0x2467('0x1c')]=0x0;this[_0x2467('0x1d')]=0x0;this[_0x2467('0x1e')]=_0x19e085[_0x2467('0x1e')]||![];this['acwTimeout']=_0x19e085['acwTimeout']||0xa;this['autopause']=_0x19e085[_0x2467('0x1f')]||'no';this[_0x2467('0x20')]=!![];this[_0x2467('0x21')]='';this['statusMessage']='';this[_0x2467('0x22')]=0x0;this[_0x2467('0x23')]=0x0;this['dialTimezone']=_0x19e085[_0x2467('0x24')]||null;this[_0x2467('0x25')]=_0x19e085[_0x2467('0x25')]?_0x19e085[_0x2467('0x25')]:null;this[_0x2467('0x26')]=_0x19e085[_0x2467('0x26')];this[_0x2467('0x27')]=_0x19e085['dialMethod']||'progressive';this[_0x2467('0x28')]=_0x19e085['dialLimitChannel']||0x0;this[_0x2467('0x29')]=_0x19e085[_0x2467('0x29')]||0x0;this['dialPowerLevel']=_0x19e085['dialPowerLevel']||0x1;this[_0x2467('0x2a')]=_0x19e085[_0x2467('0x2a')]||'dropRate';this[_0x2467('0x2b')]=_0x19e085[_0x2467('0x2b')]||0.03;this[_0x2467('0x2c')]=_0x19e085[_0x2467('0x2c')]||0x258;this['dialOriginateCallerIdName']=_0x19e085[_0x2467('0x2d')]||'anonymous';this['dialOriginateCallerIdNumber']=_0x19e085[_0x2467('0x2e')]||'anonymous';this['dialOriginateTimeout']=_0x19e085['dialOriginateTimeout']||0x1e;this[_0x2467('0x2f')]=_0x19e085[_0x2467('0x2f')]||'tTxX';this[_0x2467('0x30')]=_0x19e085[_0x2467('0x30')]||0x3;this[_0x2467('0x31')]=_0x19e085[_0x2467('0x31')]||undefined;this[_0x2467('0x32')]=_0x19e085[_0x2467('0x32')]||0x3;this['dialCongestionRetryFrequency']=_0x19e085[_0x2467('0x33')]||0x96;this[_0x2467('0x34')]=_0x19e085[_0x2467('0x34')]||0x3;this[_0x2467('0x35')]=_0x19e085[_0x2467('0x35')]||0x96;this[_0x2467('0x36')]=_0x19e085[_0x2467('0x36')]||0x3;this[_0x2467('0x37')]=_0x19e085['dialNoAnswerRetryFrequency']||0x96;this[_0x2467('0x38')]=_0x19e085[_0x2467('0x38')]||0x3;this[_0x2467('0x39')]=_0x19e085[_0x2467('0x39')]||0x96;this[_0x2467('0x3a')]=_0x19e085[_0x2467('0x3a')]||0x3;this[_0x2467('0x3b')]=_0x19e085['dialDropRetryFrequency']||0x96;this[_0x2467('0x3c')]=_0x19e085['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x19e085[_0x2467('0x3d')]||0x96;this['dialMachineMaxRetry']=_0x19e085['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0x19e085[_0x2467('0x3e')]||0x96;this[_0x2467('0x3f')]=_0x19e085[_0x2467('0x3f')]||0x3;this[_0x2467('0x40')]=_0x19e085['dialAgentRejectRetryFrequency']||0x96;this[_0x2467('0x41')]=_0x19e085[_0x2467('0x41')]||0x3;this[_0x2467('0x42')]=_0x19e085['dialGlobalMaxRetry']||0x4;this[_0x2467('0x43')]=_0x19e085['Trunk']?_0x19e085['Trunk']:undefined;this[_0x2467('0x44')]=_0x19e085[_0x2467('0x44')]?_0x19e085[_0x2467('0x44')]:undefined;this[_0x2467('0x45')]=_0x19e085[_0x2467('0x45')]||undefined;this['Interval']=_0x19e085['Interval']?_0x19e085['Interval']:undefined;this[_0x2467('0x46')]=_0x19e085[_0x2467('0x46')]||_0x2467('0x47');this[_0x2467('0x48')]=_0x19e085[_0x2467('0x48')]||undefined;this[_0x2467('0x49')]=_0x19e085[_0x2467('0x49')]||undefined;this[_0x2467('0x4a')]=strategy[_0x19e085[_0x2467('0x4a')]];this['queueStatusComplete']=!![];this[_0x2467('0x4b')]=_0x19e085[_0x2467('0x4b')]||![];this[_0x2467('0x4c')]=_0x19e085[_0x2467('0x4c')];this[_0x2467('0x4d')]=_0x19e085[_0x2467('0x4d')];this['dialAMDAfterGreetingSilence']=_0x19e085['dialAMDAfterGreetingSilence'];this[_0x2467('0x4e')]=_0x19e085[_0x2467('0x4e')];this[_0x2467('0x4f')]=_0x19e085[_0x2467('0x4f')];this[_0x2467('0x50')]=_0x19e085['dialAMDBetweenWordsSilence'];this[_0x2467('0x51')]=_0x19e085['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0x19e085[_0x2467('0x52')];this[_0x2467('0x53')]=_0x19e085[_0x2467('0x53')];this[_0x2467('0x54')]=0x0;this[_0x2467('0x55')]=0x0;this[_0x2467('0x56')]=_0x19e085[_0x2467('0x56')];this[_0x2467('0x57')]=0x0;this[_0x2467('0x58')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x2467('0x59')]=0x0;this['outboundCongestionCallsDay']=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x2467('0x5a')]=0x0;this[_0x2467('0x5b')]=0x0;this[_0x2467('0x5c')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this['outboundDropCallsDayTimeout']=0x0;this['outboundDropCallsDayACS']=0x0;this[_0x2467('0x5d')]=0x0;this['outboundAbandonedDay']=0x0;this[_0x2467('0x5e')]=undefined;this[_0x2467('0x5f')]=undefined;this[_0x2467('0x60')]=undefined;this[_0x2467('0x61')]=1.05;this[_0x2467('0x62')]=0x0;this[_0x2467('0x63')]=0x0;this[_0x2467('0x64')]=0x0;this[_0x2467('0x65')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x2467('0x66')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0x2467('0x67')]=0x0;this[_0x2467('0x68')]=_0x19e085['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x2467('0x69')]=_0x19e085[_0x2467('0x6a')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x2467('0x6b')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x2467('0x6c')]=0x0;this['erlangCallToSecond']=0x0;this['erlangAbandonmentRate']=0x0;this[_0x2467('0x6d')]=0x0;this[_0x2467('0x6e')]=_0x19e085[_0x2467('0x6e')]||0x1e;this[_0x2467('0x6f')]=_0x19e085[_0x2467('0x6f')]||![];this[_0x2467('0x70')]=!!_0x19e085[_0x2467('0x70')]||![];this[_0x2467('0x71')]=!!_0x19e085[_0x2467('0x71')]||![];this[_0x2467('0x72')]=_0x19e085[_0x2467('0x72')]||undefined;this[_0x2467('0x73')]=_0x19e085['dialAgiAfterHangupClient']||![];this['dialAgiAfterHangupAgent']=_0x19e085[_0x2467('0x74')]||![];this[_0x2467('0x9')]=monitorFormat[_0x19e085[_0x2467('0x9')]]?monitorFormat[_0x19e085[_0x2467('0x9')]]:undefined;this[_0x2467('0x75')]=_0x19e085[_0x2467('0x75')]||![];this[_0x2467('0x76')]=_0x19e085[_0x2467('0x76')]?_0x19e085['mandatoryDispositionPause']:undefined;this[_0x2467('0x77')]=![];}module[_0x2467('0x78')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index d6a0519..d82d648 100644 --- a/server/services/ami/model/voiceQueueSummary.js +++ b/server/services/ami/model/voiceQueueSummary.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x44e8=['originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid','prototype','loggedin','callers','length','SIP/','online','includes','status','booked','keys','queue','dialer','exten','xcally-motion-preview','compareToInboundQueue','some','compareToOutboundQueue','preview','exports','available','paused','ringing','talking','waiting','answered','inUse','loggedIn','loggedInDb','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','sumBillable','sumDuration','total','name','strategy','abandoned','busy','invalid','onHold','notInUse','ringInUse','sumHoldTime','type','unavailable','unknown','unmanaged','outbound','pTalking','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls'];(function(_0x2511c6,_0x5859ca){var _0x10a803=function(_0x3fb3a2){while(--_0x3fb3a2){_0x2511c6['push'](_0x2511c6['shift']());}};_0x10a803(++_0x5859ca);}(_0x44e8,0xd7));var _0x844e=function(_0x436171,_0x2616fb){_0x436171=_0x436171-0x0;var _0x41fdd1=_0x44e8[_0x436171];return _0x41fdd1;};'use strict';var INBOUND_COUNTERS=[_0x844e('0x0'),'loggedIn','loggedInDb',_0x844e('0x1'),_0x844e('0x2'),_0x844e('0x3'),_0x844e('0x4')];var OUTBOUND_COUNTERS=['available',_0x844e('0x5'),_0x844e('0x6'),_0x844e('0x7'),_0x844e('0x8'),'originated',_0x844e('0x9'),_0x844e('0xa'),_0x844e('0xb'),_0x844e('0xc'),'outboundCongestionCallsDay',_0x844e('0xd'),_0x844e('0xe'),_0x844e('0xf'),_0x844e('0x10'),_0x844e('0x11'),_0x844e('0x1'),'pTalking',_0x844e('0x3'),_0x844e('0x12'),_0x844e('0x13'),_0x844e('0x14'),_0x844e('0x4')];function VoiceQueueSummary(_0x37b2a3){this['id']=_0x37b2a3['id'];this[_0x844e('0x15')]=_0x37b2a3['name'];this[_0x844e('0x16')]=_0x37b2a3[_0x844e('0x16')];this['abandoned']=_0x37b2a3[_0x844e('0x17')]||0x0;this[_0x844e('0x5')]=_0x37b2a3['answered']||0x0;this[_0x844e('0x0')]=_0x37b2a3[_0x844e('0x0')]||0x0;this[_0x844e('0x18')]=_0x37b2a3['busy']||0x0;this[_0x844e('0x6')]=_0x37b2a3[_0x844e('0x6')]||0x0;this[_0x844e('0x19')]=_0x37b2a3[_0x844e('0x19')]||0x0;this[_0x844e('0x7')]=_0x37b2a3[_0x844e('0x7')]||0x0;this[_0x844e('0x8')]=_0x37b2a3[_0x844e('0x8')]||0x0;this['onHold']=_0x37b2a3[_0x844e('0x1a')]||0x0;this['notInUse']=_0x37b2a3[_0x844e('0x1b')]||0x0;this['paused']=_0x37b2a3[_0x844e('0x1')]||0x0;this['ringing']=_0x37b2a3[_0x844e('0x2')]||0x0;this[_0x844e('0x1c')]=_0x37b2a3[_0x844e('0x1c')];this[_0x844e('0x12')]=_0x37b2a3[_0x844e('0x12')];this[_0x844e('0x13')]=_0x37b2a3[_0x844e('0x13')];this[_0x844e('0x1d')]=_0x37b2a3['sumHoldTime']||0x0;this[_0x844e('0x3')]=_0x37b2a3['talking']||0x0;this['total']=_0x37b2a3[_0x844e('0x14')]||0x0;this[_0x844e('0x1e')]=_0x37b2a3[_0x844e('0x1e')];this[_0x844e('0x1f')]=_0x37b2a3['unavailable']||0x0;this[_0x844e('0x20')]=_0x37b2a3[_0x844e('0x20')]||0x0;this['unmanaged']=_0x37b2a3[_0x844e('0x21')]||0x0;this[_0x844e('0x4')]=_0x37b2a3[_0x844e('0x4')]||0x0;if(_0x37b2a3[_0x844e('0x1e')]===_0x844e('0x22')){this[_0x844e('0x23')]=_0x37b2a3['pTalking']||0x0;this[_0x844e('0x24')]=_0x37b2a3[_0x844e('0x24')];this[_0x844e('0x25')]=_0x37b2a3[_0x844e('0x25')];this[_0x844e('0x26')]=_0x37b2a3['dialOriginateCallerIdName'];this[_0x844e('0x27')]=_0x37b2a3['dialOriginateCallerIdNumber'];this['dialOriginateTimeout']=_0x37b2a3[_0x844e('0x28')];this[_0x844e('0x29')]=_0x37b2a3[_0x844e('0x29')];this['temp']=_0x37b2a3[_0x844e('0x2a')];this[_0x844e('0x2b')]=_0x37b2a3[_0x844e('0x2b')];this['outboundAnswerCallsDay']=_0x37b2a3[_0x844e('0xa')];this[_0x844e('0xb')]=_0x37b2a3[_0x844e('0xb')];this[_0x844e('0xc')]=_0x37b2a3[_0x844e('0xc')];this[_0x844e('0x2c')]=_0x37b2a3[_0x844e('0x2c')];this[_0x844e('0x2d')]=_0x37b2a3[_0x844e('0x2d')];this[_0x844e('0x2e')]=_0x37b2a3['outboundDropCallsDayCallersExit'];this[_0x844e('0x2f')]=_0x37b2a3[_0x844e('0x2f')];this[_0x844e('0xd')]=_0x37b2a3[_0x844e('0xd')];this[_0x844e('0xe')]=_0x37b2a3[_0x844e('0xe')];this[_0x844e('0x30')]=_0x37b2a3['outboundOriginateFailureCallsDay'];this[_0x844e('0xf')]=_0x37b2a3[_0x844e('0xf')];this[_0x844e('0x10')]=_0x37b2a3['outboundRejectCallsDay'];this[_0x844e('0x11')]=_0x37b2a3[_0x844e('0x11')];this['predictiveIntervalAnsweredCalls']=_0x37b2a3[_0x844e('0x31')];this[_0x844e('0x32')]=_0x37b2a3['predictiveIntervalAvgHoldtime'];this[_0x844e('0x33')]=_0x37b2a3[_0x844e('0x33')];this[_0x844e('0x34')]=_0x37b2a3[_0x844e('0x34')];this[_0x844e('0x35')]=_0x37b2a3[_0x844e('0x35')];this[_0x844e('0x36')]=_0x37b2a3['predictiveIntervalErlangCalls'];this[_0x844e('0x37')]=_0x37b2a3[_0x844e('0x37')];this[_0x844e('0x38')]=_0x37b2a3[_0x844e('0x38')];this[_0x844e('0x39')]=_0x37b2a3[_0x844e('0x39')];this[_0x844e('0x3a')]=_0x37b2a3[_0x844e('0x3a')];this[_0x844e('0x3b')]=_0x37b2a3[_0x844e('0x3b')];this[_0x844e('0x3c')]=_0x37b2a3['predictiveIntervalTotalCalls'];this['originated']=_0x37b2a3[_0x844e('0x3d')];this[_0x844e('0x3e')]=_0x37b2a3[_0x844e('0x3e')];this[_0x844e('0x3f')]=_0x37b2a3[_0x844e('0x3f')];this[_0x844e('0x40')]=_0x37b2a3[_0x844e('0x40')];this[_0x844e('0x41')]=_0x37b2a3[_0x844e('0x41')];this['startPredictive']=_0x37b2a3[_0x844e('0x42')];this['startProgressive']=_0x37b2a3[_0x844e('0x43')];this['message']=_0x37b2a3[_0x844e('0x44')];this['statusMessage']=_0x37b2a3[_0x844e('0x45')];}if(_0x37b2a3[_0x844e('0x46')]){this[_0x844e('0x46')]={'id':_0x37b2a3[_0x844e('0x46')]['id'],'name':_0x37b2a3[_0x844e('0x46')][_0x844e('0x15')],'active':_0x37b2a3[_0x844e('0x46')][_0x844e('0x47')],'callerid':_0x37b2a3[_0x844e('0x46')][_0x844e('0x48')]};}}VoiceQueueSummary[_0x844e('0x49')]['createReport']=function(_0x3ecb60,_0x39de35,_0x3eb5b9,_0x511c83){this['loggedInDb']=0x0;this[_0x844e('0x3')]=0x0;this[_0x844e('0x1')]=0x0;this[_0x844e('0x20')]=0x0;this['notInUse']=0x0;this['inUse']=0x0;this['busy']=0x0;this['invalid']=0x0;this[_0x844e('0x1f')]=0x0;this[_0x844e('0x2')]=0x0;this[_0x844e('0x1c')]=0x0;this[_0x844e('0x1a')]=0x0;if(_0x3eb5b9){if(_0x3eb5b9[_0x844e('0x0')]){this['available']=Number(_0x3eb5b9[_0x844e('0x0')]);}if(_0x3eb5b9['loggedin']){this['loggedIn']=Number(_0x3eb5b9[_0x844e('0x4a')]);}if(_0x3eb5b9[_0x844e('0x4b')]){this[_0x844e('0x4')]=Number(_0x3eb5b9[_0x844e('0x4b')]);}}for(var _0x55c938=0x0;_0x55c938<_0x3ecb60[_0x844e('0x4c')];_0x55c938++){var _0x46f258=_0x39de35[_0x844e('0x4d')+_0x3ecb60[_0x55c938]['name']];if(_0x46f258&&_0x46f258[_0x844e('0x4e')]){this[_0x844e('0x8')]+=0x1;}if(_0x3ecb60[_0x55c938]['incall']==='1'){this[_0x844e('0x3')]+=0x1;}if(_0x3ecb60[_0x55c938][_0x844e('0x1')]==='1'&&!['2','7','8'][_0x844e('0x4f')](_0x3ecb60[_0x55c938][_0x844e('0x50')])){this[_0x844e('0x1')]+=0x1;}switch(_0x3ecb60[_0x55c938][_0x844e('0x50')]){case'0':this['unknown']+=0x1;break;case'1':this[_0x844e('0x1b')]+=0x1;break;case'2':this[_0x844e('0x6')]+=0x1;break;case'3':this[_0x844e('0x18')]+=0x1;break;case'4':this[_0x844e('0x19')]+=0x1;break;case'5':this[_0x844e('0x1f')]+=0x1;break;case'6':this[_0x844e('0x2')]+=0x1;break;case'7':this[_0x844e('0x1c')]+=0x1;break;case'8':this[_0x844e('0x1a')]+=0x1;break;}}if(this[_0x844e('0x25')]===_0x844e('0x51')){var _0x4a6924=Object[_0x844e('0x52')](_0x511c83);for(var _0x694791=0x0;_0x694791<_0x4a6924[_0x844e('0x4c')];_0x694791++){var _0x510089=_0x4a6924[_0x694791];var _0xe74f8=_0x511c83[_0x510089];if(_0xe74f8[_0x844e('0x53')]===this[_0x844e('0x15')]&&_0xe74f8[_0x844e('0x1e')]===_0x844e('0x54')&&_0xe74f8[_0x844e('0x55')]===_0x844e('0x56')){this['talking']+=0x1;}}if(this[_0x844e('0x3')]>this[_0x844e('0x6')]){this[_0x844e('0x3')]=this[_0x844e('0x6')];}this[_0x844e('0x23')]=0x0;}return this;};VoiceQueueSummary[_0x844e('0x49')][_0x844e('0x57')]=function(_0x3acef5){var _0x202fbc=![];if(_0x3acef5){_0x202fbc=INBOUND_COUNTERS[_0x844e('0x58')](function(_0x3af2fe){return this[_0x3af2fe]!==_0x3acef5[_0x3af2fe];},this);}return _0x202fbc;};VoiceQueueSummary[_0x844e('0x49')][_0x844e('0x59')]=function(_0x5356e4){var _0x166466=![];var _0x3d4a20=![];var _0x5dca66=![];if(_0x5356e4){_0x166466=this[_0x844e('0x25')]!==_0x5356e4[_0x844e('0x25')]||this[_0x844e('0x24')]!==_0x5356e4['dialActive']||this[_0x844e('0x44')]!==_0x5356e4[_0x844e('0x44')]||this['statusMessage']!==_0x5356e4[_0x844e('0x45')];_0x3d4a20=OUTBOUND_COUNTERS[_0x844e('0x58')](function(_0x2e94ac){return this[_0x2e94ac]!==_0x5356e4[_0x2e94ac];},this);if(this[_0x844e('0x46')]&&_0x5356e4[_0x844e('0x46')]){_0x5dca66=this[_0x844e('0x46')][_0x844e('0x15')]!==_0x5356e4[_0x844e('0x46')][_0x844e('0x15')]||this[_0x844e('0x46')][_0x844e('0x47')]!==_0x5356e4[_0x844e('0x46')][_0x844e('0x47')];}}return _0x166466||_0x3d4a20||_0x5dca66;};VoiceQueueSummary[_0x844e('0x49')]['updateReportFromOutboundQueue']=function(_0x44d3de){this[_0x844e('0x5')]=_0x44d3de['answered'];this[_0x844e('0x44')]=_0x44d3de['message'];this[_0x844e('0x45')]=_0x44d3de[_0x844e('0x45')];this[_0x844e('0x3d')]=_0x44d3de['originated'];this['outboundAbandonedCallsDay']=_0x44d3de[_0x844e('0x9')];this[_0x844e('0xa')]=_0x44d3de[_0x844e('0xa')];this[_0x844e('0xb')]=_0x44d3de[_0x844e('0xb')];this['outboundBusyCallsDay']=_0x44d3de[_0x844e('0xc')];this[_0x844e('0x2c')]=_0x44d3de[_0x844e('0x2c')];this[_0x844e('0xd')]=_0x44d3de['outboundNoAnswerCallsDay'];this[_0x844e('0xe')]=_0x44d3de[_0x844e('0xe')];this[_0x844e('0xf')]=_0x44d3de['outboundReCallsDay'];this['outboundRejectCallsDay']=_0x44d3de[_0x844e('0x10')];this[_0x844e('0x11')]=_0x44d3de[_0x844e('0x11')];this['sumBillable']=_0x44d3de['sumBillable'];this[_0x844e('0x13')]=_0x44d3de[_0x844e('0x13')];this[_0x844e('0x14')]=_0x44d3de['total'];if(this[_0x844e('0x25')]===_0x844e('0x5a')){this[_0x844e('0x23')]=_0x44d3de['pTalking'];}};module[_0x844e('0x5b')]=VoiceQueueSummary; \ No newline at end of file +var _0x8b2d=['dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','temp','outboundAnswerAgiCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','prototype','createReport','busy','callers','length','SIP/','online','incall','includes','status','booked','queue','dialer','exten','xcally-motion-preview','compareToInboundQueue','some','active','updateReportFromOutboundQueue','total','exports','loggedInDb','ringing','talking','available','answered','loggedIn','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundRejectCallsDay','paused','pTalking','sumBillable','sumDuration','name','strategy','abandoned','inUse','invalid','onHold','notInUse','ringInUse','sumHoldTime','type','unavailable','unknown','unmanaged','waiting','dialActive','dialMethod'];(function(_0x2a65c2,_0x42cea7){var _0x3f1ee5=function(_0x46d29d){while(--_0x46d29d){_0x2a65c2['push'](_0x2a65c2['shift']());}};_0x3f1ee5(++_0x42cea7);}(_0x8b2d,0xe5));var _0xd8b2=function(_0x27a0cc,_0x58979b){_0x27a0cc=_0x27a0cc-0x0;var _0x491de6=_0x8b2d[_0x27a0cc];return _0x491de6;};'use strict';var INBOUND_COUNTERS=['available','loggedIn',_0xd8b2('0x0'),'paused',_0xd8b2('0x1'),_0xd8b2('0x2'),'waiting'];var OUTBOUND_COUNTERS=[_0xd8b2('0x3'),_0xd8b2('0x4'),'inUse',_0xd8b2('0x5'),_0xd8b2('0x0'),_0xd8b2('0x6'),_0xd8b2('0x7'),_0xd8b2('0x8'),_0xd8b2('0x9'),_0xd8b2('0xa'),_0xd8b2('0xb'),_0xd8b2('0xc'),_0xd8b2('0xd'),'outboundReCallsDay',_0xd8b2('0xe'),'outboundUnknownCallsDay',_0xd8b2('0xf'),_0xd8b2('0x10'),_0xd8b2('0x2'),_0xd8b2('0x11'),_0xd8b2('0x12'),'total','waiting'];function VoiceQueueSummary(_0x55207b){this['id']=_0x55207b['id'];this[_0xd8b2('0x13')]=_0x55207b[_0xd8b2('0x13')];this[_0xd8b2('0x14')]=_0x55207b['strategy'];this[_0xd8b2('0x15')]=_0x55207b[_0xd8b2('0x15')]||0x0;this[_0xd8b2('0x4')]=_0x55207b[_0xd8b2('0x4')]||0x0;this['available']=_0x55207b[_0xd8b2('0x3')]||0x0;this['busy']=_0x55207b['busy']||0x0;this[_0xd8b2('0x16')]=_0x55207b[_0xd8b2('0x16')]||0x0;this[_0xd8b2('0x17')]=_0x55207b[_0xd8b2('0x17')]||0x0;this[_0xd8b2('0x5')]=_0x55207b[_0xd8b2('0x5')]||0x0;this[_0xd8b2('0x0')]=_0x55207b['loggedInDb']||0x0;this['onHold']=_0x55207b[_0xd8b2('0x18')]||0x0;this['notInUse']=_0x55207b[_0xd8b2('0x19')]||0x0;this[_0xd8b2('0xf')]=_0x55207b[_0xd8b2('0xf')]||0x0;this[_0xd8b2('0x1')]=_0x55207b[_0xd8b2('0x1')]||0x0;this['ringInUse']=_0x55207b[_0xd8b2('0x1a')];this[_0xd8b2('0x11')]=_0x55207b[_0xd8b2('0x11')];this[_0xd8b2('0x12')]=_0x55207b['sumDuration'];this[_0xd8b2('0x1b')]=_0x55207b['sumHoldTime']||0x0;this['talking']=_0x55207b[_0xd8b2('0x2')]||0x0;this['total']=_0x55207b['total']||0x0;this[_0xd8b2('0x1c')]=_0x55207b[_0xd8b2('0x1c')];this['unavailable']=_0x55207b[_0xd8b2('0x1d')]||0x0;this[_0xd8b2('0x1e')]=_0x55207b[_0xd8b2('0x1e')]||0x0;this['unmanaged']=_0x55207b[_0xd8b2('0x1f')]||0x0;this['waiting']=_0x55207b[_0xd8b2('0x20')]||0x0;if(_0x55207b[_0xd8b2('0x1c')]==='outbound'){this[_0xd8b2('0x10')]=_0x55207b[_0xd8b2('0x10')]||0x0;this['dialActive']=_0x55207b[_0xd8b2('0x21')];this[_0xd8b2('0x22')]=_0x55207b['dialMethod'];this[_0xd8b2('0x23')]=_0x55207b[_0xd8b2('0x23')];this[_0xd8b2('0x24')]=_0x55207b[_0xd8b2('0x24')];this[_0xd8b2('0x25')]=_0x55207b[_0xd8b2('0x25')];this['dialPrefix']=_0x55207b['dialPrefix'];this[_0xd8b2('0x26')]=_0x55207b[_0xd8b2('0x26')];this[_0xd8b2('0x27')]=_0x55207b[_0xd8b2('0x27')];this[_0xd8b2('0x8')]=_0x55207b[_0xd8b2('0x8')];this['outboundBlacklistCallsDay']=_0x55207b[_0xd8b2('0x9')];this[_0xd8b2('0xa')]=_0x55207b[_0xd8b2('0xa')];this[_0xd8b2('0xb')]=_0x55207b[_0xd8b2('0xb')];this[_0xd8b2('0x28')]=_0x55207b[_0xd8b2('0x28')];this[_0xd8b2('0x29')]=_0x55207b[_0xd8b2('0x29')];this[_0xd8b2('0x2a')]=_0x55207b[_0xd8b2('0x2a')];this['outboundNoAnswerCallsDay']=_0x55207b[_0xd8b2('0xc')];this['outboundNoSuchCallsDay']=_0x55207b[_0xd8b2('0xd')];this[_0xd8b2('0x2b')]=_0x55207b[_0xd8b2('0x2b')];this[_0xd8b2('0x2c')]=_0x55207b[_0xd8b2('0x2c')];this[_0xd8b2('0xe')]=_0x55207b[_0xd8b2('0xe')];this[_0xd8b2('0x2d')]=_0x55207b['outboundUnknownCallsDay'];this[_0xd8b2('0x2e')]=_0x55207b[_0xd8b2('0x2e')];this[_0xd8b2('0x2f')]=_0x55207b[_0xd8b2('0x2f')];this[_0xd8b2('0x30')]=_0x55207b[_0xd8b2('0x30')];this[_0xd8b2('0x31')]=_0x55207b[_0xd8b2('0x31')];this[_0xd8b2('0x32')]=_0x55207b[_0xd8b2('0x32')];this['predictiveIntervalErlangCalls']=_0x55207b[_0xd8b2('0x33')];this[_0xd8b2('0x34')]=_0x55207b['predictiveIntervalErlangCallsDroppedCalls'];this['predictiveIntervalHitRate']=_0x55207b[_0xd8b2('0x35')];this['predictiveIntervalMultiplicativeFactor']=_0x55207b[_0xd8b2('0x36')];this['predictiveIntervalPauses']=_0x55207b[_0xd8b2('0x37')];this[_0xd8b2('0x38')]=_0x55207b[_0xd8b2('0x38')];this[_0xd8b2('0x39')]=_0x55207b[_0xd8b2('0x39')];this[_0xd8b2('0x6')]=_0x55207b[_0xd8b2('0x6')];this[_0xd8b2('0x3a')]=_0x55207b[_0xd8b2('0x3a')];this[_0xd8b2('0x3b')]=_0x55207b[_0xd8b2('0x3b')];this[_0xd8b2('0x3c')]=_0x55207b[_0xd8b2('0x3c')];this[_0xd8b2('0x3d')]=_0x55207b[_0xd8b2('0x3d')];this[_0xd8b2('0x3e')]=_0x55207b[_0xd8b2('0x3e')];this[_0xd8b2('0x3f')]=_0x55207b[_0xd8b2('0x3f')];this[_0xd8b2('0x40')]=_0x55207b[_0xd8b2('0x40')];this[_0xd8b2('0x41')]=_0x55207b['statusMessage'];}if(_0x55207b[_0xd8b2('0x42')]){this['Trunk']={'id':_0x55207b[_0xd8b2('0x42')]['id'],'name':_0x55207b[_0xd8b2('0x42')][_0xd8b2('0x13')],'active':_0x55207b['Trunk']['active'],'callerid':_0x55207b['Trunk']['callerid']};}}VoiceQueueSummary[_0xd8b2('0x43')][_0xd8b2('0x44')]=function(_0x363355,_0x4e342a,_0x212a9a,_0x270959){this['loggedInDb']=0x0;this[_0xd8b2('0x2')]=0x0;this['paused']=0x0;this['unknown']=0x0;this[_0xd8b2('0x19')]=0x0;this[_0xd8b2('0x16')]=0x0;this[_0xd8b2('0x45')]=0x0;this['invalid']=0x0;this['unavailable']=0x0;this[_0xd8b2('0x1')]=0x0;this[_0xd8b2('0x1a')]=0x0;this['onHold']=0x0;if(_0x212a9a){if(_0x212a9a[_0xd8b2('0x3')]){this[_0xd8b2('0x3')]=Number(_0x212a9a[_0xd8b2('0x3')]);}if(_0x212a9a['loggedin']){this[_0xd8b2('0x5')]=Number(_0x212a9a['loggedin']);}if(_0x212a9a[_0xd8b2('0x46')]){this[_0xd8b2('0x20')]=Number(_0x212a9a[_0xd8b2('0x46')]);}}for(var _0x1ee64c=0x0;_0x1ee64c<_0x363355[_0xd8b2('0x47')];_0x1ee64c++){var _0x4dab1b=_0x4e342a[_0xd8b2('0x48')+_0x363355[_0x1ee64c][_0xd8b2('0x13')]];if(_0x4dab1b&&_0x4dab1b[_0xd8b2('0x49')]){this[_0xd8b2('0x0')]+=0x1;}if(_0x363355[_0x1ee64c][_0xd8b2('0x4a')]==='1'){this[_0xd8b2('0x2')]+=0x1;}if(_0x363355[_0x1ee64c][_0xd8b2('0xf')]==='1'&&!['2','7','8'][_0xd8b2('0x4b')](_0x363355[_0x1ee64c][_0xd8b2('0x4c')])){this[_0xd8b2('0xf')]+=0x1;}switch(_0x363355[_0x1ee64c]['status']){case'0':this[_0xd8b2('0x1e')]+=0x1;break;case'1':this['notInUse']+=0x1;break;case'2':this[_0xd8b2('0x16')]+=0x1;break;case'3':this[_0xd8b2('0x45')]+=0x1;break;case'4':this[_0xd8b2('0x17')]+=0x1;break;case'5':this[_0xd8b2('0x1d')]+=0x1;break;case'6':this[_0xd8b2('0x1')]+=0x1;break;case'7':this[_0xd8b2('0x1a')]+=0x1;break;case'8':this[_0xd8b2('0x18')]+=0x1;break;}}if(this[_0xd8b2('0x22')]===_0xd8b2('0x4d')){var _0x17bf9c=Object['keys'](_0x270959);for(var _0x5462cc=0x0;_0x5462cc<_0x17bf9c[_0xd8b2('0x47')];_0x5462cc++){var _0x3ad037=_0x17bf9c[_0x5462cc];var _0x5db550=_0x270959[_0x3ad037];if(_0x5db550[_0xd8b2('0x4e')]===this[_0xd8b2('0x13')]&&_0x5db550[_0xd8b2('0x1c')]===_0xd8b2('0x4f')&&_0x5db550[_0xd8b2('0x50')]===_0xd8b2('0x51')){this[_0xd8b2('0x2')]+=0x1;}}if(this[_0xd8b2('0x2')]>this[_0xd8b2('0x16')]){this['talking']=this['inUse'];}this[_0xd8b2('0x10')]=0x0;}return this;};VoiceQueueSummary[_0xd8b2('0x43')][_0xd8b2('0x52')]=function(_0x38e412){var _0x4a4b38=![];if(_0x38e412){_0x4a4b38=INBOUND_COUNTERS[_0xd8b2('0x53')](function(_0x14a6cb){return this[_0x14a6cb]!==_0x38e412[_0x14a6cb];},this);}return _0x4a4b38;};VoiceQueueSummary[_0xd8b2('0x43')]['compareToOutboundQueue']=function(_0x3133e1){var _0x30edab=![];var _0x4a0308=![];var _0x424fb9=![];if(_0x3133e1){_0x30edab=this[_0xd8b2('0x22')]!==_0x3133e1[_0xd8b2('0x22')]||this[_0xd8b2('0x21')]!==_0x3133e1['dialActive']||this['message']!==_0x3133e1[_0xd8b2('0x40')]||this[_0xd8b2('0x41')]!==_0x3133e1[_0xd8b2('0x41')];_0x4a0308=OUTBOUND_COUNTERS[_0xd8b2('0x53')](function(_0x597524){return this[_0x597524]!==_0x3133e1[_0x597524];},this);if(this[_0xd8b2('0x42')]&&_0x3133e1['Trunk']){_0x424fb9=this[_0xd8b2('0x42')][_0xd8b2('0x13')]!==_0x3133e1['Trunk'][_0xd8b2('0x13')]||this[_0xd8b2('0x42')][_0xd8b2('0x54')]!==_0x3133e1['Trunk'][_0xd8b2('0x54')];}}return _0x30edab||_0x4a0308||_0x424fb9;};VoiceQueueSummary[_0xd8b2('0x43')][_0xd8b2('0x55')]=function(_0x2e6c66){this[_0xd8b2('0x4')]=_0x2e6c66['answered'];this[_0xd8b2('0x40')]=_0x2e6c66[_0xd8b2('0x40')];this['statusMessage']=_0x2e6c66[_0xd8b2('0x41')];this[_0xd8b2('0x6')]=_0x2e6c66['originated'];this[_0xd8b2('0x7')]=_0x2e6c66[_0xd8b2('0x7')];this[_0xd8b2('0x8')]=_0x2e6c66[_0xd8b2('0x8')];this[_0xd8b2('0x9')]=_0x2e6c66[_0xd8b2('0x9')];this[_0xd8b2('0xa')]=_0x2e6c66['outboundBusyCallsDay'];this[_0xd8b2('0xb')]=_0x2e6c66[_0xd8b2('0xb')];this[_0xd8b2('0xc')]=_0x2e6c66[_0xd8b2('0xc')];this[_0xd8b2('0xd')]=_0x2e6c66[_0xd8b2('0xd')];this[_0xd8b2('0x2c')]=_0x2e6c66['outboundReCallsDay'];this[_0xd8b2('0xe')]=_0x2e6c66[_0xd8b2('0xe')];this['outboundUnknownCallsDay']=_0x2e6c66['outboundUnknownCallsDay'];this[_0xd8b2('0x11')]=_0x2e6c66[_0xd8b2('0x11')];this['sumDuration']=_0x2e6c66['sumDuration'];this[_0xd8b2('0x56')]=_0x2e6c66[_0xd8b2('0x56')];if(this[_0xd8b2('0x22')]==='preview'){this[_0xd8b2('0x10')]=_0x2e6c66['pTalking'];}};module[_0xd8b2('0x57')]=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index f6d8867..e91f65e 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 _0xb601=['accessKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x860d3f,_0x1414af){var _0x5b6019=function(_0x51bfdf){while(--_0x51bfdf){_0x860d3f['push'](_0x860d3f['shift']());}};_0x5b6019(++_0x1414af);}(_0xb601,0xc2));var _0x1b60=function(_0x7c4840,_0x43dc5c){_0x7c4840=_0x7c4840-0x0;var _0x1a19a5=_0xb601[_0x7c4840];return _0x1a19a5;};'use strict';function VtigerAccount(_0x408ed6){this['id']=_0x408ed6['id']||0x0;this[_0x1b60('0x0')]=_0x408ed6[_0x1b60('0x0')]||'';this['username']=_0x408ed6[_0x1b60('0x1')]||'';this[_0x1b60('0x2')]=_0x408ed6[_0x1b60('0x2')]||'';this[_0x1b60('0x3')]=_0x408ed6[_0x1b60('0x3')]||'';this['serverUrl']=_0x408ed6[_0x1b60('0x4')]||'';this['Configurations']=_0x408ed6[_0x1b60('0x5')]||{};}module[_0x1b60('0x6')]=VtigerAccount; \ No newline at end of file +var _0x902a=['name','username','accessKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x415090,_0x394b39){var _0xa6aba8=function(_0x430252){while(--_0x430252){_0x415090['push'](_0x415090['shift']());}};_0xa6aba8(++_0x394b39);}(_0x902a,0x134));var _0xa902=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x902a[_0x3dd15e];return _0x231fd0;};'use strict';function VtigerAccount(_0x50ddac){this['id']=_0x50ddac['id']||0x0;this['name']=_0x50ddac[_0xa902('0x0')]||'';this['username']=_0x50ddac[_0xa902('0x1')]||'';this[_0xa902('0x2')]=_0x50ddac[_0xa902('0x2')]||'';this['remoteUri']=_0x50ddac[_0xa902('0x3')]||'';this['serverUrl']=_0x50ddac[_0xa902('0x4')]||'';this[_0xa902('0x5')]=_0x50ddac[_0xa902('0x5')]||{};}module[_0xa902('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index ccfc6e3..47a105b 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 _0xce15=['remoteUri','authType','type','integrationTab','serverUrl','name','username','password'];(function(_0x3409ae,_0x11e373){var _0x1dd163=function(_0x1a7d98){while(--_0x1a7d98){_0x3409ae['push'](_0x3409ae['shift']());}};_0x1dd163(++_0x11e373);}(_0xce15,0x8d));var _0x5ce1=function(_0x22a028,_0x5bb05e){_0x22a028=_0x22a028-0x0;var _0x3184d4=_0xce15[_0x22a028];return _0x3184d4;};'use strict';function ZendeskAccount(_0x18edc3){this['id']=_0x18edc3['id']||0x0;this[_0x5ce1('0x0')]=_0x18edc3[_0x5ce1('0x0')]||'';this[_0x5ce1('0x1')]=_0x18edc3[_0x5ce1('0x1')]||'';this[_0x5ce1('0x2')]=_0x18edc3[_0x5ce1('0x2')]||'';this['token']=_0x18edc3['token']||'';this['remoteUri']=_0x18edc3[_0x5ce1('0x3')]||'';this[_0x5ce1('0x4')]=_0x18edc3[_0x5ce1('0x4')]||'';this['type']=_0x18edc3[_0x5ce1('0x5')]||_0x5ce1('0x6');this[_0x5ce1('0x7')]=_0x18edc3[_0x5ce1('0x7')]||'';this['Configurations']=_0x18edc3['Configurations']||{};}module['exports']=ZendeskAccount; \ No newline at end of file +var _0x61a8=['remoteUri','type','integrationTab','serverUrl','Configurations','exports','name','username','password','token'];(function(_0x44ba1f,_0x233b30){var _0x13c865=function(_0x189e03){while(--_0x189e03){_0x44ba1f['push'](_0x44ba1f['shift']());}};_0x13c865(++_0x233b30);}(_0x61a8,0xc4));var _0x861a=function(_0x4a7b64,_0x16733c){_0x4a7b64=_0x4a7b64-0x0;var _0x500da6=_0x61a8[_0x4a7b64];return _0x500da6;};'use strict';function ZendeskAccount(_0x5736dd){this['id']=_0x5736dd['id']||0x0;this[_0x861a('0x0')]=_0x5736dd['name']||'';this[_0x861a('0x1')]=_0x5736dd[_0x861a('0x1')]||'';this[_0x861a('0x2')]=_0x5736dd[_0x861a('0x2')]||'';this[_0x861a('0x3')]=_0x5736dd['token']||'';this[_0x861a('0x4')]=_0x5736dd[_0x861a('0x4')]||'';this['authType']=_0x5736dd['authType']||'';this[_0x861a('0x5')]=_0x5736dd[_0x861a('0x5')]||_0x861a('0x6');this[_0x861a('0x7')]=_0x5736dd[_0x861a('0x7')]||'';this['Configurations']=_0x5736dd[_0x861a('0x8')]||{};}module[_0x861a('0x9')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 512cb0d..12b9931 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 _0xa156=['code','refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret'];(function(_0x26425a,_0x1b4d6f){var _0x12802a=function(_0x5db8a7){while(--_0x5db8a7){_0x26425a['push'](_0x26425a['shift']());}};_0x12802a(++_0x1b4d6f);}(_0xa156,0x176));var _0x6a15=function(_0x31a30a,_0x1c635e){_0x31a30a=_0x31a30a-0x0;var _0x2c2146=_0xa156[_0x31a30a];return _0x2c2146;};'use strict';function ZohoAccount(_0x351dbf){this['id']=_0x351dbf['id']||0x0;this[_0x6a15('0x0')]=_0x351dbf['name']||'';this['description']=_0x351dbf[_0x6a15('0x1')]||'';this[_0x6a15('0x2')]=_0x351dbf[_0x6a15('0x2')]||'';this[_0x6a15('0x3')]=_0x351dbf[_0x6a15('0x3')]||'';this[_0x6a15('0x4')]=_0x351dbf[_0x6a15('0x4')]||'';this[_0x6a15('0x5')]=_0x351dbf[_0x6a15('0x5')]||'';this['serverUrl']=_0x351dbf['serverUrl']||'';this[_0x6a15('0x6')]=_0x351dbf[_0x6a15('0x6')]||'';this[_0x6a15('0x7')]=_0x351dbf['refreshToken']||'';this[_0x6a15('0x8')]=_0x351dbf[_0x6a15('0x8')]||{};}module[_0x6a15('0x9')]=ZohoAccount; \ No newline at end of file +var _0xb62f=['Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken'];(function(_0x1ef2fa,_0x5048c9){var _0x3a2b79=function(_0xb9fbf1){while(--_0xb9fbf1){_0x1ef2fa['push'](_0x1ef2fa['shift']());}};_0x3a2b79(++_0x5048c9);}(_0xb62f,0x10a));var _0xfb62=function(_0x194b2f,_0x10ef4b){_0x194b2f=_0x194b2f-0x0;var _0x30252f=_0xb62f[_0x194b2f];return _0x30252f;};'use strict';function ZohoAccount(_0x574b54){this['id']=_0x574b54['id']||0x0;this[_0xfb62('0x0')]=_0x574b54[_0xfb62('0x0')]||'';this[_0xfb62('0x1')]=_0x574b54[_0xfb62('0x1')]||'';this[_0xfb62('0x2')]=_0x574b54['host']||'';this[_0xfb62('0x3')]=_0x574b54[_0xfb62('0x3')]||'';this[_0xfb62('0x4')]=_0x574b54['clientId']||'';this['clientSecret']=_0x574b54[_0xfb62('0x5')]||'';this[_0xfb62('0x6')]=_0x574b54['serverUrl']||'';this[_0xfb62('0x7')]=_0x574b54[_0xfb62('0x7')]||'';this[_0xfb62('0x8')]=_0x574b54[_0xfb62('0x8')]||'';this[_0xfb62('0x9')]=_0x574b54[_0xfb62('0x9')]||{};}module[_0xfb62('0xa')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 41e3a7b..d80d791 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 _0x8e3f=['prototype','getCaller','format','\x22%s\x22\x20<%s>','number','util','lodash','moment','string','isNil','uniqueid','idContact','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','SIP/%s','calleridname','Contact','firstName','active','calleridnum','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x8e3f[_0x4a9fb1];return _0x348672;};'use strict';var util=require(_0xf8e3('0x0'));var _=require(_0xf8e3('0x1'));var moment=require(_0xf8e3('0x2'));function checkNameSurname(_0x4d334a,_0x3f3440,_0x292de5){var _0x3b07a5='';if(!_['isNil'](_0x3f3440)&&_0xf8e3('0x3')===typeof _0x3f3440){_0x3b07a5+=_0x3f3440;}if(!_[_0xf8e3('0x4')](_0x292de5)&&'string'===typeof _0x292de5){_0x3b07a5+='\x20'+_0x292de5;}if(_0x3b07a5!==''){return _0x3b07a5;}return _0x4d334a;}function Action(_0x35e88f,_0xb21f8d,_0x2621c5,_0x1ee9f3,_0x4e9e57){this[_0xf8e3('0x5')]=_0x2621c5||undefined;this[_0xf8e3('0x6')]=_0x35e88f['id'];this[_0xf8e3('0x7')]=_0xb21f8d[_0xf8e3('0x8')];this[_0xf8e3('0x9')]=_0xb21f8d[_0xf8e3('0x9')];this[_0xf8e3('0xa')]=_0xf8e3('0x7');this[_0xf8e3('0xb')]=![];this[_0xf8e3('0xc')]=_[_0xf8e3('0x4')](_0x35e88f[_0xf8e3('0xd')])?undefined:_0x35e88f['Agent'][_0xf8e3('0x8')];this[_0xf8e3('0xe')]=this[_0xf8e3('0xc')]?util['format'](_0xf8e3('0xf'),this[_0xf8e3('0xc')]):_0x1ee9f3||undefined;this[_0xf8e3('0x10')]=checkNameSurname(_0x35e88f[_0xf8e3('0x11')]['phone'],_0x35e88f[_0xf8e3('0x11')][_0xf8e3('0x12')],_0x35e88f[_0xf8e3('0x11')]['lastName']);this[_0xf8e3('0x13')]=_0x35e88f['active']||![];this[_0xf8e3('0x14')]=_0x35e88f[_0xf8e3('0x15')];this[_0xf8e3('0x16')]=_0x35e88f['scheduledat'];this['countbusyretry']=_0x35e88f[_0xf8e3('0x17')]||0x0;this[_0xf8e3('0x18')]=_0x35e88f[_0xf8e3('0x18')]||0x0;this[_0xf8e3('0x19')]=_0x35e88f[_0xf8e3('0x19')]||0x0;this[_0xf8e3('0x1a')]=(_0x35e88f[_0xf8e3('0x17')]||0x0)+(_0x35e88f[_0xf8e3('0x18')]||0x0)+(_0x35e88f[_0xf8e3('0x19')]||0x0)+(_0x35e88f[_0xf8e3('0x1b')]||0x0)+(_0x35e88f['countdropretry']||0x0)+(_0x35e88f[_0xf8e3('0x1c')]||0x0)+(_0x35e88f[_0xf8e3('0x1d')]||0x0)+(_0x35e88f[_0xf8e3('0x1e')]||0x0);this[_0xf8e3('0x1b')]=_0x35e88f[_0xf8e3('0x1b')]||0x0;this[_0xf8e3('0x1f')]=_0x35e88f[_0xf8e3('0x1f')]||0x0;this[_0xf8e3('0x1c')]=_0x35e88f['countabandonedretry']||0x0;this[_0xf8e3('0x1d')]=_0x35e88f[_0xf8e3('0x1d')]||0x0;this[_0xf8e3('0x1e')]=_0x35e88f[_0xf8e3('0x1e')]||0x0;this['callback']=_0x35e88f[_0xf8e3('0x20')];this['callbackuniqueid']=_0x35e88f[_0xf8e3('0x21')];this[_0xf8e3('0x22')]=_0x35e88f[_0xf8e3('0x22')];this[_0xf8e3('0x23')]=_0x35e88f[_0xf8e3('0x23')];this[_0xf8e3('0x24')]=_0x35e88f['ContactId'];this[_0xf8e3('0x25')]=_0x35e88f[_0xf8e3('0x25')];this[_0xf8e3('0x26')]=_[_0xf8e3('0x4')](_0x35e88f[_0xf8e3('0xd')])?_0x35e88f[_0xf8e3('0x26')]:_0x35e88f[_0xf8e3('0xd')]['id'];this[_0xf8e3('0x27')]=_0x35e88f['VoiceQueueId'];this[_0xf8e3('0x28')]='';this[_0xf8e3('0x29')]='';}Action[_0xf8e3('0x2a')][_0xf8e3('0x2b')]=function(){return util[_0xf8e3('0x2c')](_0xf8e3('0x2d'),this[_0xf8e3('0x10')],this[_0xf8e3('0x2e')]);};module['exports']=Action; \ No newline at end of file +var _0x236c=['recallme','ContactId','ListId','UserId','originatecalleridnum','prototype','calleridname','number','util','moment','string','isNil','uniqueid','type','campaigntype','queue','dialAnswer','membername','Agent','name','format','phone','Contact','firstName','active','scheduledat','countbusyretry','countnoanswerretry','countglobal','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','callback','callbackuniqueid','callbackat'];(function(_0x5e67a1,_0x386ccd){var _0x3b70c4=function(_0x1f4fae){while(--_0x1f4fae){_0x5e67a1['push'](_0x5e67a1['shift']());}};_0x3b70c4(++_0x386ccd);}(_0x236c,0x155));var _0xc236=function(_0xd61222,_0x417e58){_0xd61222=_0xd61222-0x0;var _0x6c56db=_0x236c[_0xd61222];return _0x6c56db;};'use strict';var util=require(_0xc236('0x0'));var _=require('lodash');var moment=require(_0xc236('0x1'));function checkNameSurname(_0x404d50,_0x39c024,_0x8072){var _0x2bf2d3='';if(!_['isNil'](_0x39c024)&&_0xc236('0x2')===typeof _0x39c024){_0x2bf2d3+=_0x39c024;}if(!_[_0xc236('0x3')](_0x8072)&&_0xc236('0x2')===typeof _0x8072){_0x2bf2d3+='\x20'+_0x8072;}if(_0x2bf2d3!==''){return _0x2bf2d3;}return _0x404d50;}function Action(_0xd582f6,_0x23d3cc,_0x461c3a,_0x5abd65,_0xd612c6){this[_0xc236('0x4')]=_0x461c3a||undefined;this['idContact']=_0xd582f6['id'];this['queue']=_0x23d3cc['name'];this[_0xc236('0x5')]=_0x23d3cc['type'];this[_0xc236('0x6')]=_0xc236('0x7');this[_0xc236('0x8')]=![];this[_0xc236('0x9')]=_[_0xc236('0x3')](_0xd582f6['Agent'])?undefined:_0xd582f6[_0xc236('0xa')][_0xc236('0xb')];this['channelAgent']=this[_0xc236('0x9')]?util[_0xc236('0xc')]('SIP/%s',this[_0xc236('0x9')]):_0x5abd65||undefined;this['calleridname']=checkNameSurname(_0xd582f6['Contact'][_0xc236('0xd')],_0xd582f6[_0xc236('0xe')][_0xc236('0xf')],_0xd582f6[_0xc236('0xe')]['lastName']);this[_0xc236('0x10')]=_0xd582f6['active']||![];this['calleridnum']=_0xd582f6[_0xc236('0xd')];this[_0xc236('0x11')]=_0xd582f6[_0xc236('0x11')];this[_0xc236('0x12')]=_0xd582f6[_0xc236('0x12')]||0x0;this['countcongestionretry']=_0xd582f6['countcongestionretry']||0x0;this['countnoanswerretry']=_0xd582f6[_0xc236('0x13')]||0x0;this[_0xc236('0x14')]=(_0xd582f6[_0xc236('0x12')]||0x0)+(_0xd582f6['countcongestionretry']||0x0)+(_0xd582f6[_0xc236('0x13')]||0x0)+(_0xd582f6['countnosuchnumberretry']||0x0)+(_0xd582f6['countdropretry']||0x0)+(_0xd582f6[_0xc236('0x15')]||0x0)+(_0xd582f6[_0xc236('0x16')]||0x0)+(_0xd582f6[_0xc236('0x17')]||0x0);this[_0xc236('0x18')]=_0xd582f6[_0xc236('0x18')]||0x0;this[_0xc236('0x19')]=_0xd582f6[_0xc236('0x19')]||0x0;this[_0xc236('0x15')]=_0xd582f6[_0xc236('0x15')]||0x0;this[_0xc236('0x16')]=_0xd582f6[_0xc236('0x16')]||0x0;this['countagentrejectretry']=_0xd582f6[_0xc236('0x17')]||0x0;this[_0xc236('0x1a')]=_0xd582f6[_0xc236('0x1a')];this[_0xc236('0x1b')]=_0xd582f6[_0xc236('0x1b')];this[_0xc236('0x1c')]=_0xd582f6[_0xc236('0x1c')];this[_0xc236('0x1d')]=_0xd582f6[_0xc236('0x1d')];this[_0xc236('0x1e')]=_0xd582f6[_0xc236('0x1e')];this['ListId']=_0xd582f6[_0xc236('0x1f')];this[_0xc236('0x20')]=_[_0xc236('0x3')](_0xd582f6[_0xc236('0xa')])?_0xd582f6['UserId']:_0xd582f6[_0xc236('0xa')]['id'];this['VoiceQueueId']=_0xd582f6['VoiceQueueId'];this[_0xc236('0x21')]='';this['originatecalleridname']='';}Action[_0xc236('0x22')]['getCaller']=function(){return util[_0xc236('0xc')]('\x22%s\x22\x20<%s>',this[_0xc236('0x23')],this[_0xc236('0x24')]);};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 530553a..00a5256 100644 --- a/server/services/ami/preview/index.js +++ b/server/services/ami/preview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','setMessage','recallMe','clearZombieChannel','sequence','isNil','Queue','queue','originated:\x20','stringify','pick','UserId','VoiceQueueId','ListId','channel','message','No\x20such\x20channel','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','[RecallMe]','catch','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[getContactRecallMe]','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','UNREACHABLE_TRUNK','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','linkedid','idContact','incrementPreviewCounters','ANSWER','answertime','[syncHangup][talking][increment]','pTalking:\x20','custom:agentconnect','connect','acw','mandatoryDisposition','custom:agentConnectPreview','channelAgent','uniqueid','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','swapAdditionalPhones','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countmachineretry','cause-txt','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','status','reachable','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','response','rejected','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncHangupRequest','addVariable','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','../dialer/utils','redis','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','syncNewExten'];(function(_0x28284a,_0x2a082e){var _0x9ffa0c=function(_0x37e984){while(--_0x37e984){_0x28284a['push'](_0x28284a['shift']());}};_0x9ffa0c(++_0x2a082e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var uuid=require(_0x0a9e('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));var logger=require('../../../config/logger')(_0x0a9e('0x4'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var ami=require(_0x0a9e('0x7'));var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x0a9e('0x9'));var ut=require(_0x0a9e('0xa'));var utils=require(_0x0a9e('0xb'));config['redis']=_['defaults'](config[_0x0a9e('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0xc')]));var Sequence=function(){};Sequence[_0x0a9e('0xd')][_0x0a9e('0xe')]=function(_0x3ab53f){this[_0x0a9e('0xf')]=this[_0x0a9e('0xf')]?this['tail']['finally'](_0x3ab53f):_0x3ab53f();};function Preview(_0x527cdd){this['sequence']=new Sequence();this[_0x0a9e('0x10')]=_0x527cdd[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x527cdd[_0x0a9e('0x12')];this[_0x0a9e('0x13')]={};this[_0x0a9e('0x14')]=_0x527cdd['agents'];this[_0x0a9e('0x15')]=0x0;ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x19'),this[_0x0a9e('0x1a')]['bind'](this));ami['on'](_0x0a9e('0x1b'),this['syncHangupRequest'][_0x0a9e('0x18')](this));ami['on']('dialend',this[_0x0a9e('0x1c')][_0x0a9e('0x18')](this));ami['on']('newexten',this[_0x0a9e('0x1d')]['bind'](this));ami['on'](_0x0a9e('0x1e'),this[_0x0a9e('0x1f')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x18')](this));this[_0x0a9e('0x24')](this[_0x0a9e('0x10')]);}function emit(_0x105080,_0x4bb1e3,_0x2c3407){io['to'](_0x105080)[_0x0a9e('0x25')](_0x4bb1e3,_0x2c3407);}function emitVoiceQueueChannelRemove(_0x53682f){logger[_0x0a9e('0x26')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x53682f));emit(util[_0x0a9e('0x27')](_0x0a9e('0x28'),_0x53682f[_0x0a9e('0x29')]),_0x0a9e('0x2a'),_0x53682f);io['emit'](_0x0a9e('0x2b'),_0x53682f);}function notSendMessagesQueue(_0x2fb0e4){if(_0x2fb0e4[_0x0a9e('0x2c')]){if(_0x2fb0e4[_0x0a9e('0x2d')]===0x0&&_0x2fb0e4[_0x0a9e('0x2e')]===0x0){_0x2fb0e4[_0x0a9e('0x2c')]=![];_0x2fb0e4[_0x0a9e('0x2f')]=0x0;_0x2fb0e4['paused']=0x0;_0x2fb0e4['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4['name']+_0x0a9e('0x34'));}else{_0x2fb0e4['message']=utils[_0x0a9e('0x30')]['DEACTIVATED'];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4[_0x0a9e('0x29')]+_0x0a9e('0x35'));}}}Preview[_0x0a9e('0xd')][_0x0a9e('0x24')]=function(){var _0x11c3b6=this;setInterval(function(){_0x11c3b6[_0x0a9e('0x36')]();},0x7cf);};Preview['prototype'][_0x0a9e('0x36')]=function(){var _0x468813=this[_0x0a9e('0x10')];this[_0x0a9e('0x15')]+=0x1;for(var _0x5c877d in _0x468813){if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&(_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x4')||_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x39'))&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(this[_0x0a9e('0x15')]>0x7){this[_0x0a9e('0x15')]=0x0;this['clearZombieChannels']();}}if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&_0x468813[_0x5c877d]['dialMethod']===_0x0a9e('0x4')&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(_0x468813[_0x5c877d][_0x0a9e('0x3c')]){this[_0x0a9e('0x3d')](_0x468813[_0x5c877d]);if(_0x468813[_0x5c877d]['dialPreviewAutoRecallMe'])this[_0x0a9e('0x3e')](_0x468813[_0x5c877d]);}else{notSendMessagesQueue(_0x468813[_0x5c877d]);}}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3f')]=function(_0x2da5c0){var _0x2b45ea=this;this[_0x0a9e('0x40')][_0x0a9e('0xe')](function(){if(!_[_0x0a9e('0x41')](_0x2b45ea['actions'][_0x2da5c0])){loggerAction[_0x0a9e('0x26')]('[clearZombieChannels][talking]',_0x2da5c0,_0x0a9e('0x42'),_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')],_0x0a9e('0x44'),JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2d')]),'pTalking:\x20',JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea['actions'][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2e')]),JSON[_0x0a9e('0x45')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]['dialAnswer']),JSON[_0x0a9e('0x45')](_[_0x0a9e('0x46')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0],['contactId',_0x0a9e('0x47'),_0x0a9e('0x48'),_0x0a9e('0x49')])));return ami['Action']({'action':'status','channel':_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4a')]})['catch'](function(_0x2b814e){if(_0x2b814e[_0x0a9e('0x4b')]===_0x0a9e('0x4c')){setTimeout(function(){if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]){ut['updateOriginated'](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],'[clearZombieChannel]');if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4d')]===!![]){ut[_0x0a9e('0x4e')](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],_0x0a9e('0x4f'));ut[_0x0a9e('0x50')](_0x0a9e('0x51')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);}ut[_0x0a9e('0x50')](_0x0a9e('0x52')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);delete _0x2b45ea[_0x0a9e('0x13')][_0x2da5c0];}},0x2328);}});}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x53')]=function(){var _0x37f6cc=this;loggerAction['info']('[action]',_[_0x0a9e('0x54')](this[_0x0a9e('0x13')]));for(var _0x405c8f in this[_0x0a9e('0x13')]){if(_0x37f6cc[_0x0a9e('0x13')][_0x0a9e('0x37')](_0x405c8f)){_0x37f6cc[_0x0a9e('0x3f')](_0x405c8f);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3e')]=function(_0x25c6e6){var _0x2c2cb0=this;rpcDb[_0x0a9e('0x55')](_0x25c6e6['id'],ut['agentReadyId'](this[_0x0a9e('0x14')]))[_0x0a9e('0x56')](function(_0xdd268f){if(!_[_0x0a9e('0x41')](_0xdd268f)){for(var _0x2e8caf=0x0;_0x2e8caf<_0xdd268f[_0x0a9e('0x57')];_0x2e8caf+=0x1){if(ut[_0x0a9e('0x58')](_0xdd268f[_0x2e8caf][_0x0a9e('0x59')])<_0x25c6e6['dialRecallMeTimeout']*0x3c){if(_0xdd268f[_0x2e8caf][_0x0a9e('0x5a')]&&!_0xdd268f[_0x2e8caf]['Agent'][_0x0a9e('0x5b')]){_0x2c2cb0[_0x0a9e('0x5c')](_0xdd268f[_0x2e8caf]['id'])[_0x0a9e('0x56')](ut['logger2'](_0x0a9e('0x5d')))[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x5d')));}else{rpcDb[_0x0a9e('0x60')](_0xdd268f[_0x2e8caf]['id']);}}else{var _0x37be73=new Action(_0xdd268f[_0x2e8caf],_0x25c6e6);_0x37be73[_0x0a9e('0x61')]=moment()['format'](_0x0a9e('0x62'));_0x25c6e6[_0x0a9e('0x63')]+=0x1;ut[_0x0a9e('0x64')](_0x37be73,0x17,_0x0a9e('0x65'));if(_0x25c6e6[_0x0a9e('0x66')]){rpcDb[_0x0a9e('0x67')](ut[_0x0a9e('0x68')](_0xdd268f[_0x2e8caf]));rpcDb[_0x0a9e('0x69')](_0x37be73,_0x0a9e('0x6a'));}else{ut['logCustomer'](_0x37be73,0x16,_0x0a9e('0x6b'));rpcDb[_0x0a9e('0x69')](_0x37be73,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x37be73,'[HistoryRecallClose]');}}}}})[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x6c')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x3d')]=function(_0x30decb){_0x30decb[_0x0a9e('0x2c')]=!![];if(ut[_0x0a9e('0x6d')](_0x30decb['loggedIn'])){_0x30decb['message']=utils['CAMPAIGN_STATUS'][_0x0a9e('0x6e')];}else if(!ut[_0x0a9e('0x6f')](_0x30decb[_0x0a9e('0x3c')])){_0x30decb['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];}else if(!this['isTrunkReachable'](_0x30decb['Trunk'])){if(!this[_0x0a9e('0x70')](_0x30decb['TrunkBackup'])){_0x30decb[_0x0a9e('0x4b')]=utils['CAMPAIGN_STATUS'][_0x0a9e('0x71')];}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}};Preview['prototype'][_0x0a9e('0x72')]=function(_0x3aedd0,_0x49c095,_0x145931){var _0x5ce9ac=this;var _0x211ef9=this['actions'][_0x49c095];var _0xe22ccc=this['campaignsPreview'][_0x211ef9['queue']];var _0x5df0ad;var _0x2da03c=![];var _0x47de4c=0x2;var _0x2f7092=0x3;if(_0xe22ccc){switch(_0x145931){case'1':_0xe22ccc[_0x0a9e('0x73')]+=0x1;_0x211ef9[_0x0a9e('0x74')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x0,_0x0a9e('0x77'));ami[_0x0a9e('0x25')]('custom:agentnosuchnumber',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x79')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0x7a'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'0',_0xe22ccc)[_0x0a9e('0x56')](function(_0x5d86e9){_0x2da03c=_0x5d86e9[_0x0a9e('0x7c')]==0x1;_0x47de4c=_0xe22ccc[_0x0a9e('0x7d')];_0x2f7092=_0xe22ccc['callAdditionalPhoneAfterMin'];if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc['dialGlobalMaxRetry']){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb['createCustomerFinal'](_0x5df0ad,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x211ef9[_0x0a9e('0x74')]>=_0xe22ccc['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x80'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0x74'),_0xe22ccc[_0x0a9e('0x7d')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}delete this['actions'][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x211ef9[_0x0a9e('0x74')]++;logger[_0x0a9e('0x26')]('actioncountonusuch',_0x211ef9[_0x0a9e('0x74')]);logger[_0x0a9e('0x26')]('id',_0x211ef9[_0x0a9e('0x85')]);_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnosuchnumberretry':_0x211ef9[_0x0a9e('0x74')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0x87'):var _0x88dcbf=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x211ef9['responsetime']=_0x88dcbf;_0x211ef9[_0x0a9e('0x88')]=_0x88dcbf;_0x211ef9[_0x0a9e('0x4d')]=!![];_0xe22ccc[_0x0a9e('0x2e')]+=0x1;logger['info'](_0x0a9e('0x89'),_0x211ef9['uniqueid'],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0xe22ccc[_0x0a9e('0x2e')]);ami[_0x0a9e('0x25')](_0x0a9e('0x8b'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x8c'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));if(_0xe22ccc[_0x0a9e('0x8d')]||_0xe22ccc[_0x0a9e('0x8e')]){ami[_0x0a9e('0x25')](_0x0a9e('0x8f'),{'queue':_0x211ef9[_0x0a9e('0x43')],'interface':_0x211ef9[_0x0a9e('0x90')],'uniqueid':_0x211ef9[_0x0a9e('0x91')]});}break;case'16':ami[_0x0a9e('0x25')](_0x0a9e('0x92'),ut['buildObj'](_0x211ef9,_0x0a9e('0x93'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x211ef9,_0x0a9e('0x93')));_0xe22ccc[_0x0a9e('0x94')]+=0x1;_0xe22ccc['total']+=0x1;_0xe22ccc[_0x0a9e('0x95')]+=0x1;ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0x96'));_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x4,'Answer');rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0x97'));rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x98'));rpcDb[_0x0a9e('0x99')](_0x211ef9);_0xe22ccc[_0x0a9e('0x9a')]+=_0x211ef9[_0x0a9e('0x9b')];_0xe22ccc[_0x0a9e('0x9c')]+=_0x211ef9[_0x0a9e('0x9b')];logger['info'](_0x0a9e('0x9d'),_0x211ef9[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0xe22ccc['name'],_0x0a9e('0x8a'),_0xe22ccc['pTalking']);delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'BUSY':_0xe22ccc[_0x0a9e('0x9f')]+=0x1;_0x211ef9[_0x0a9e('0xa0')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x5,_0x0a9e('0xa1'));_0x47de4c=_0xe22ccc[_0x0a9e('0xa2')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')]('custom:agentbusy',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xa4')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xa5'));_0x5ce9ac['verifyAdditionalPhones'](_0x211ef9,'5',_0xe22ccc)[_0x0a9e('0x56')](function(_0x3511c9){_0x2da03c=_0x3511c9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xa8'));}else{if(_0x211ef9[_0x0a9e('0xa0')]>=_0xe22ccc[_0x0a9e('0xa9')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xa5'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xa0'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xa0')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countbusyretry':_0x211ef9[_0x0a9e('0xa0')]}})['then'](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xab'):_0xe22ccc['outboundNoAnswerCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xac')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x3,'NoAnswer');_0x47de4c=_0xe22ccc[_0x0a9e('0xad')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];var _0x2d2286=ut[_0x0a9e('0xae')](_0x211ef9,_0xe22ccc);ami[_0x0a9e('0x25')](_0x0a9e('0xaf'),_0x2d2286);rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logNoAnswer]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'3',_0xe22ccc)[_0x0a9e('0x56')](function(_0x45c109){_0x2da03c=_0x45c109[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x211ef9[_0x0a9e('0xac')]>=_0xe22ccc[_0x0a9e('0xb0')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xb1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xac'),_0xe22ccc[_0x0a9e('0xad')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'CONGESTION':_0xe22ccc[_0x0a9e('0xb2')]+=0x1;_0x211ef9[_0x0a9e('0xb3')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x8,_0x0a9e('0xb4'));_0x47de4c=_0xe22ccc['dialCongestionRetryFrequency'];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami['emit'](_0x0a9e('0xb5'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xb6')));rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logCongestion]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'8',_0xe22ccc)[_0x0a9e('0x56')](function(_0x1d4877){_0x2da03c=_0x1d4877['additional']==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xb7'));}else{if(_0x211ef9[_0x0a9e('0xb3')]>=_0xe22ccc[_0x0a9e('0xb8')]){rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xb9'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xb3'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xb3')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countcongestionretry':_0x211ef9[_0x0a9e('0xb3')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xbb'):_0xe22ccc[_0x0a9e('0xbc')]+=0x1;_0x211ef9[_0x0a9e('0xbd')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x14,_0x0a9e('0xbe'));_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')](_0x0a9e('0xc0'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xc1')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc2'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)[_0x0a9e('0x56')](function(_0x4989f9){_0x2da03c=_0x4989f9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x14,_0x0a9e('0xbe'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xc3'));}else{if(_0x211ef9[_0x0a9e('0xbd')]>=_0xe22ccc['dialAgentRejectMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0xbd'),_0xe22ccc[_0x0a9e('0xbf')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case'ABANDONED':_0xe22ccc['outboundAbandonedCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc4')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xb,_0x0a9e('0xc5'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc6'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'11',_0xe22ccc)[_0x0a9e('0x56')](function(_0x586510){_0x2da03c=_0x586510[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xc6'));}else{if(_0x211ef9['countabandonedetry']>=_0xe22ccc[_0x0a9e('0xc7')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xc6'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,'countabandonedretry',_0xe22ccc['dialAbandonedRetryFrequency']),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'18':_0xe22ccc['outboundUnknownCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc8')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x12,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0['dialstatus']);ami['emit'](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xcb'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2eb028){_0x2da03c=_0x2eb028['additional']==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x12,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xcb'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xcb'));}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'19':_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x13,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);ami[_0x0a9e('0x25')](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0xce'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2fea95){_0x2da03c=_0x2fea95[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xce'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xce'));}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})['then'](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;default:if(_0x211ef9[_0x0a9e('0x4d')]){ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0xcf'));ut[_0x0a9e('0x50')](_0x0a9e('0xd0')+_0xe22ccc[_0x0a9e('0x29')],_0x3aedd0);}_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xc,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];rpcDb['createCustomerHistory'](_0x211ef9,'[callProgressDetectingCustomer][logUnknown]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)['then'](function(_0x1d999b){_0x2da03c=_0x1d999b[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xd1'));}delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});}});}if(!(_0x211ef9[_0x0a9e('0x4d')]&&_0x145931==='16')){ut[_0x0a9e('0xd2')](_0xe22ccc,'[callProgressDetectingCustomer]');logger[_0x0a9e('0x26')](_0x0a9e('0xd3'),_0x211ef9[_0x0a9e('0x91')],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x44'),_0xe22ccc[_0x0a9e('0x2d')]);}if(_0x145931!==_0x0a9e('0x87')){delete this[_0x0a9e('0x13')][_0x3aedd0['linkedid']];delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0xd4')]];}_0xe22ccc['queueSummaryCountersUpdated']=!![];}};Preview[_0x0a9e('0xd')][_0x0a9e('0xd5')]=function(_0x1f6f1c,_0x5822a7,_0x5c3b6f){if(_['isUndefined'](_0x5822a7)&&_0x0a9e('0xd6')!==typeof _0x5822a7){return;}if(_[_0x0a9e('0xd7')](_0x5c3b6f)&&'object'!==typeof _0x5c3b6f){return;}switch(_0x5c3b6f[_0x0a9e('0xd8')]){case'0':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x0,_0x0a9e('0x77'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xda'));break;case'3':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x3,_0x0a9e('0xdb'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdd'));break;case'5':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x5,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xde'));break;case'8':ut['logAgent'](_0x1f6f1c,0x8,_0x0a9e('0xb4'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xdf'));break;case'22':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x16,_0x0a9e('0xe0'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xe1'));break;default:ut[_0x0a9e('0xd9')](_0x1f6f1c,0xc,_0x5c3b6f['reason']);rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdf'));}ut[_0x0a9e('0xd2')](_0x5822a7,_0x0a9e('0xe2'));logger['info'](_0x0a9e('0xe3'),_0x1f6f1c[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0x5822a7[_0x0a9e('0x29')],_0x0a9e('0x44'),_0x5822a7[_0x0a9e('0x2d')]);delete this[_0x0a9e('0x13')][_0x1f6f1c[_0x0a9e('0x91')]];};Preview[_0x0a9e('0xd')][_0x0a9e('0x7b')]=function(_0x57f0ad,_0x2272bc,_0x88b25f){return cmHopperAdditionalPhone[_0x0a9e('0x7b')](_0x57f0ad,_0x2272bc,_0x88b25f)[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')](_0x0a9e('0xe4')));};Preview[_0x0a9e('0xd')][_0x0a9e('0xba')]=function(_0x566b90,_0x3b581c,_0xd2391){return cmHopperAdditionalPhone[_0x0a9e('0xba')](_0x566b90,_0x3b581c,_0xd2391)['catch'](logger[_0x0a9e('0x26')](_0x0a9e('0xe5')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x86')]=function(_0x370b5e){return Promise[_0x0a9e('0xe6')]()[_0x0a9e('0x56')](cmHopperAdditionalPhone[_0x0a9e('0x86')](_0x370b5e))[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')]('[incrementPreviewCounters]\x20'));};Preview[_0x0a9e('0xd')][_0x0a9e('0xe7')]=function(_0x15a9ed,_0x3db98f,_0x2b624e,_0x3942fd,_0x5cb48d){var _0x382687=this;return new Promise(function(_0x4f854b,_0x5bd139){if(_['isNil'](_0x3db98f)||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe8')])||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe9')])||_['isNil'](_0x3db98f[_0x0a9e('0x48')])){_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xea'),_0x3942fd,_0x5cb48d));return;}var _0x1fdb10=uuid['v4']();var _0x2c8d1d=_0x382687['campaignsPreview'][_0x3db98f['Queue'][_0x0a9e('0x29')]];var _0x33bcb2=_0x2b624e?_0x382687[_0x0a9e('0x14')][_0x2b624e]['id']:undefined;_0x382687['actions'][_0x1fdb10]=new Action(_0x3db98f,_0x2c8d1d,_0x1fdb10,_0x2b624e,_0x33bcb2);var _0x319752=_0x382687[_0x0a9e('0x13')][_0x1fdb10];_0x319752[_0x0a9e('0xaa')]=_0x3942fd;_0x319752['activeContact']=_0x5cb48d;_0x319752[_0x0a9e('0xeb')]=_0x2b624e;if(_[_0x0a9e('0xec')](_0x15a9ed)){_0x382687[_0x0a9e('0xed')](_0x319752,_0x2c8d1d,_0x3db98f,_0x2b624e)['then'](function(_0x272291){logger[_0x0a9e('0x26')](_0x0a9e('0xee'),'Queue:\x20'+_0x319752['queue']+'\x20IdHopper:\x20'+_0x319752[_0x0a9e('0x85')],JSON[_0x0a9e('0x45')](_0x272291));ami[_0x0a9e('0x25')](_0x0a9e('0xef'),ut['buildObj'](_0x319752,_0x0a9e('0xf0'),_0x382687['campaignsPreview'][_0x319752[_0x0a9e('0x43')]]));_0x4f854b(ut[_0x0a9e('0x4b')](_0x0a9e('0xf1')));})['catch'](function(_0x33b4b3){ut[_0x0a9e('0x32')](_0x0a9e('0xf2'),_0x33b4b3);_0x5bd139(ut['message'](_0x0a9e('0xf3'),_0x3942fd,_0x5cb48d));});}else{_0x2c8d1d['outboundBlacklistCallsDay']+=0x1;ut[_0x0a9e('0xf4')](_0x319752);rpcDb['createHistory'](_0x319752,_0x0a9e('0xf5'));delete _0x382687['actions'][_0x1fdb10];_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xf6'),_0x3942fd,_0x5cb48d));}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x70')]=function(_0x1e306c){return!_[_0x0a9e('0x41')](_0x1e306c)&&!_[_0x0a9e('0x41')](_0x1e306c['name'])&&!_[_0x0a9e('0x41')](_0x1e306c[_0x0a9e('0xf7')])&&_0x1e306c['active']&&!_[_0x0a9e('0x41')](this[_0x0a9e('0x12')][util['format'](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])])&&!_[_0x0a9e('0x41')](this['trunks'][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')])&&(this[_0x0a9e('0x12')][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfa')||this['trunks'][util[_0x0a9e('0x27')]('SIP/%s',_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfb'));};Preview[_0x0a9e('0xd')][_0x0a9e('0x5c')]=function(_0x2d45db,_0x5691ac){return this[_0x0a9e('0xfc')](_0x2d45db,_0x5691ac)[_0x0a9e('0x56')](function(_0x2977a7){return _['pick'](_0x2977a7,[_0x0a9e('0x4b')]);})[_0x0a9e('0x5e')](function(_0x4435d2){if(_0x4435d2[_0x0a9e('0xfd')]){rpcDb[_0x0a9e('0xfe')](_0x2d45db);}if(_0x4435d2[_0x0a9e('0xf7')]){rpcDb[_0x0a9e('0x60')](_0x2d45db);}throw _['pick'](_0x4435d2,[_0x0a9e('0x4b')]);});};Preview[_0x0a9e('0xd')][_0x0a9e('0xfc')]=function(_0x2ce3be,_0x3de77e){var _0x241404=this;var _0x8120e,_0x5d6a48;return rpcDb['getContactPreview'](_0x2ce3be)[_0x0a9e('0x56')](function(_0x3f507c){if(!_[_0x0a9e('0x41')](_0x3f507c[0x0])){_0x5d6a48=_0x3f507c[0x0][_0x0a9e('0xff')]?![]:!![];_0x8120e=_0x3f507c[0x0][_0x0a9e('0xff')]?!![]:![];_0x8120e=_0x3de77e?!![]:_0x8120e;}var _0x131da8=_0x241404[_0x0a9e('0x100')](_0x3f507c);if(_0x131da8['isValid']){rpcDb[_0x0a9e('0x101')](_[_0x0a9e('0x46')](_0x3f507c[0x0],[_0x0a9e('0x48'),_0x0a9e('0xe9')]))[_0x0a9e('0x56')](function(_0x3c6082){_0x241404[_0x0a9e('0xe7')](_0x3c6082,_0x3f507c[0x0],_0x3de77e,_0x5d6a48,_0x8120e)['then'](function(_0x311288){return _0x311288;})[_0x0a9e('0x5e')](function(_0x231826){throw _0x231826;});})['catch'](function(_0x2b8ad4){ut[_0x0a9e('0x32')](_0x0a9e('0x102'),_0x2b8ad4);throw ut[_0x0a9e('0x4b')]('Call\x20unsuccessful',_0x5d6a48,_0x8120e);});}else{throw ut[_0x0a9e('0x4b')](_0x131da8[_0x0a9e('0x4b')],_0x5d6a48,_0x8120e);}})[_0x0a9e('0x5e')](function(_0x93d953){ut[_0x0a9e('0x32')](_0x0a9e('0x103'),_0x93d953);throw ut[_0x0a9e('0x4b')](_0x0a9e('0x104'),![],!![]);});};Preview['prototype'][_0x0a9e('0x100')]=function(_0x266aa1){if(_[_0x0a9e('0x41')](_0x266aa1)||_[_0x0a9e('0xec')](_0x266aa1)||!_['isNil'](_0x266aa1[0x0]['Agent'])&&_[_0x0a9e('0x41')](_0x266aa1[0x0][_0x0a9e('0x5a')][_0x0a9e('0x29')])){ut['logger'](_0x0a9e('0x105'),_0x266aa1);return{'isValid':![],'message':_0x0a9e('0x106')};}var _0x4d8a67=this[_0x0a9e('0x10')][_0x266aa1[0x0]['Queue'][_0x0a9e('0x29')]];_0x4d8a67['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0x0a9e('0x41')](_0x4d8a67)){ut[_0x0a9e('0x32')](_0x0a9e('0x107'),_0x4d8a67);return{'isValid':![],'message':_0x0a9e('0x108')};}if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x109')])){ut['logger'](_0x0a9e('0x10a'),_0x0a9e('0x10b')+_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x10c'));if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x10d')])){ut[_0x0a9e('0x32')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x4d8a67['name']+_0x0a9e('0x10e'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x0a9e('0x6f')](_0x4d8a67[_0x0a9e('0x3c')])){ut[_0x0a9e('0x32')](_0x0a9e('0x10f'),_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x110'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x4d8a67[_0x0a9e('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x0a9e('0xd')]['execCall']=function(_0x38dceb,_0x5dc978,_0x550cbf,_0x26223f){var _0x4a7a3c=this;return new Promise(function(_0x24470a,_0x142e53){var _0xe1ab0d=_0x38dceb['uniqueid'];var _0x4152cd=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?util['format']('SIP/%s/%s%s',_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978[_0x0a9e('0x111')][_0x0a9e('0x112')]()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')][_0x0a9e('0x114')](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf['phone']):util['format']('SIP/%s/%s%s',_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978['dialPrefix']['trim']()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')]['substring'](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf[_0x0a9e('0xe9')]);var _0x2e2280=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?ut[_0x0a9e('0x115')](_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978[_0x0a9e('0x11a')]):ut[_0x0a9e('0x115')](_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978['dialOriginateCallerIdNumber']);if(_0x2e2280){_0x38dceb[_0x0a9e('0x11b')]=ut[_0x0a9e('0x11c')](_0x2e2280);_0x38dceb[_0x0a9e('0x11d')]=ut[_0x0a9e('0x11e')](_0x2e2280);}var _0x33359a=ut[_0x0a9e('0x11f')](_0x5dc978,_0x550cbf,_0x4152cd,_0x2e2280,_0xe1ab0d,_0x38dceb);var _0xa8b5de=utils['setXMDContactVariables'](_0x550cbf[_0x0a9e('0xe8')]);Object['assign'](_0x33359a,_0xa8b5de);_[_0x0a9e('0x120')](_0x38dceb,ut[_0x0a9e('0x121')](_0x33359a));_0x38dceb[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x5dc978[_0x0a9e('0x122')]=_0x33359a;var _0x465003=ut[_0x0a9e('0x123')](_0x38dceb,_0x5dc978,_0x33359a,_0x38dceb[_0x0a9e('0x83')],_0x26223f);return ami[_0x0a9e('0x124')](_0x465003)[_0x0a9e('0x56')](function(_0x8231e5){_0x5dc978[_0x0a9e('0x2d')]+=0x1;logger[_0x0a9e('0x26')](_0x0a9e('0x125'),_0xe1ab0d,_0x0a9e('0x9e'),_0x5dc978['name'],'originated:\x20',_0x5dc978[_0x0a9e('0x2d')]);_0x24470a(_0x8231e5);})[_0x0a9e('0x5e')](function(_0x52b365){ut['logAgent'](_0x38dceb,0xe,_0x0a9e('0x126'));rpcDb[_0x0a9e('0xdc')](_0x38dceb,_0x0a9e('0x127'));_0x142e53(_0x52b365);});});};Preview['prototype'][_0x0a9e('0x1d')]=function(_0x5b6447){if(this[_0x0a9e('0x13')][_0x5b6447['linkedid']]){this[_0x0a9e('0x13')][_0x5b6447['linkedid']][_0x0a9e('0x4a')]=_0x5b6447[_0x0a9e('0x4a')];}};Preview[_0x0a9e('0xd')]['syncOriginateResponse']=function(_0x316b51){var _0x497fda=this;var _0x505ffd=this[_0x0a9e('0x13')][_0x316b51[_0x0a9e('0x128')]];if(_0x505ffd){if(_0x505ffd[_0x0a9e('0xeb')]&&this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]){ut[_0x0a9e('0x129')](_0x505ffd,this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]][_0x0a9e('0x29')],this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]['id']);}var _0x98bf26=_[_0x0a9e('0x12a')](_0x505ffd);_0x98bf26[_0x0a9e('0x12b')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));var _0x310026=_0x497fda[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]];if(ut['isFailure'](_0x316b51[_0x0a9e('0x12c')])){if(_0x505ffd[_0x0a9e('0xaa')]){rpcDb[_0x0a9e('0xfe')](_0x505ffd[_0x0a9e('0x85')]);}if(_0x505ffd['activeContact']){rpcDb['disableContact'](_0x505ffd['idContact']);}ami[_0x0a9e('0x25')]('custom:agentringnoanswer',ut[_0x0a9e('0x78')](_0x505ffd,_0x0a9e('0x12d'),this[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]]));this[_0x0a9e('0xd5')](_0x98bf26,_0x310026,_0x316b51);}else{_0x505ffd[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));ut[_0x0a9e('0xd9')](_0x98bf26,0x4,_0x0a9e('0x12e'));rpcDb['createAgentHistory'](_0x98bf26,_0x0a9e('0x12f'));}}};Preview['prototype'][_0x0a9e('0x1a')]=function(_0x586d2f){var _0xf4de86=this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]];var _0x556bb7;if(_0xf4de86){_0x556bb7=this[_0x0a9e('0x10')][_0xf4de86[_0x0a9e('0x43')]];logger['info']('[syncHangup][talking]',_0x586d2f[_0x0a9e('0x84')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],'pTalking:\x20',_0x556bb7['pTalking']);}if(this['actions'][_0x586d2f[_0x0a9e('0x84')]]&&_0x586d2f[_0x0a9e('0x84')]!==_0x586d2f[_0x0a9e('0x91')]){if(_0x586d2f[_0x0a9e('0x130')]==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')](_0x0a9e('0x131'),_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}}else if(_0xf4de86&&_[_0x0a9e('0x41')](_0xf4de86['statedesc'])&&_0x556bb7[_0x0a9e('0x132')]&&_0x586d2f[_0x0a9e('0x84')]===_0x586d2f[_0x0a9e('0x91')]&&_[_0x0a9e('0x41')](_0x586d2f[_0x0a9e('0xd8')])&&_0x586d2f[_0x0a9e('0x130')]==='16'&&_0x586d2f[_0x0a9e('0x133')]==='6'&&_[_0x0a9e('0xd7')](_0xf4de86[_0x0a9e('0x134')])){if(_0xf4de86['unlockAgent']){rpcDb['unlockContact'](_0xf4de86[_0x0a9e('0x85')]);}if(_0xf4de86[_0x0a9e('0x83')]){rpcDb['disableContact'](_0xf4de86[_0x0a9e('0x85')]);}_0x586d2f[_0x0a9e('0xd8')]='22';this['callProgressDetectingAgent'](_0xf4de86,_0x556bb7,_0x586d2f);}else if(_0xf4de86&&_0xf4de86[_0x0a9e('0x134')]){if(_0x586d2f['cause']==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]]['dialAnswer']){logger[_0x0a9e('0x26')](_0x0a9e('0x135'),_0x586d2f['linkedid'],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f['linkedid']][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')]('[syncHangup][talking][cause]',_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f['linkedid'],_0x586d2f['cause']);}}};Preview['prototype']['syncDialEnd']=function(_0x5e9817){if(this[_0x0a9e('0x13')][_0x5e9817[_0x0a9e('0xd4')]]&&_0x5e9817['destlinkedid']!==_0x5e9817['destuniqueid']){this[_0x0a9e('0x72')](_0x5e9817,_0x5e9817['destlinkedid'],_0x5e9817[_0x0a9e('0xcd')]);}};Preview[_0x0a9e('0xd')][_0x0a9e('0x136')]=function(_0x175c97){if(this[_0x0a9e('0x13')][_0x175c97[_0x0a9e('0x84')]]&&_0x175c97['linkedid']!==_0x175c97[_0x0a9e('0x91')]&&!this[_0x0a9e('0x13')][_0x175c97['linkedid']][_0x0a9e('0x4d')]){if(_0x175c97[_0x0a9e('0x130')]==='1'){this[_0x0a9e('0x72')](_0x175c97,_0x175c97[_0x0a9e('0x84')],_0x175c97[_0x0a9e('0x130')]);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x137')]=function(_0x4a36df,_0x331216,_0x508395){if(this[_0x0a9e('0x13')][_0x4a36df]){if(_[_0x0a9e('0x41')](this['actions'][_0x4a36df][_0x0a9e('0x122')])){this[_0x0a9e('0x13')][_0x4a36df]['variables']={};}this[_0x0a9e('0x13')][_0x4a36df]['variables'][_0x331216]=_0x508395;}};Preview[_0x0a9e('0xd')][_0x0a9e('0x1f')]=function(_0x5d0620){try{if(!_[_0x0a9e('0x41')](_0x5d0620)){if(ut['filterKey'](_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0])){this[_0x0a9e('0x137')](_0x5d0620[_0x0a9e('0x91')],_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0],_0x5d0620[_0x0a9e('0x13a')]);}}}catch(_0x53b5c2){logger[_0x0a9e('0x13b')](_0x0a9e('0x13c'),util[_0x0a9e('0x13d')](_0x53b5c2,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xd')][_0x0a9e('0x21')]=function(_0x5932ad){if(_0x5932ad){if(this[_0x0a9e('0x13')][_0x5932ad['transfertargetlinkedid']]){this['actions'][_0x5932ad[_0x0a9e('0x13e')]]['transfer']=!![];}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x23')]=function(_0x58d5fd){if(_0x58d5fd){if(this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]]){this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]][_0x0a9e('0x134')]=!![];}}};module[_0x0a9e('0x140')]=Preview; \ No newline at end of file +var _0xa9e0=['varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','setMessage','recallMe','clearZombieChannel','sequence','isNil','Queue','queue','originated:\x20','stringify','pick','UserId','VoiceQueueId','ListId','channel','message','No\x20such\x20channel','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','[RecallMe]','catch','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[getContactRecallMe]','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','UNREACHABLE_TRUNK','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','linkedid','idContact','incrementPreviewCounters','ANSWER','answertime','[syncHangup][talking][increment]','pTalking:\x20','custom:agentconnect','connect','acw','mandatoryDisposition','custom:agentConnectPreview','channelAgent','uniqueid','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','swapAdditionalPhones','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countmachineretry','cause-txt','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','status','reachable','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','response','rejected','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncHangupRequest','addVariable','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','../dialer/utils','redis','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','syncNewExten'];(function(_0xf7b919,_0x3d5802){var _0x3e8127=function(_0x57b373){while(--_0x57b373){_0xf7b919['push'](_0xf7b919['shift']());}};_0x3e8127(++_0x3d5802);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var uuid=require(_0x0a9e('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));var logger=require('../../../config/logger')(_0x0a9e('0x4'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var ami=require(_0x0a9e('0x7'));var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x0a9e('0x9'));var ut=require(_0x0a9e('0xa'));var utils=require(_0x0a9e('0xb'));config['redis']=_['defaults'](config[_0x0a9e('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0xc')]));var Sequence=function(){};Sequence[_0x0a9e('0xd')][_0x0a9e('0xe')]=function(_0x3ab53f){this[_0x0a9e('0xf')]=this[_0x0a9e('0xf')]?this['tail']['finally'](_0x3ab53f):_0x3ab53f();};function Preview(_0x527cdd){this['sequence']=new Sequence();this[_0x0a9e('0x10')]=_0x527cdd[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x527cdd[_0x0a9e('0x12')];this[_0x0a9e('0x13')]={};this[_0x0a9e('0x14')]=_0x527cdd['agents'];this[_0x0a9e('0x15')]=0x0;ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x19'),this[_0x0a9e('0x1a')]['bind'](this));ami['on'](_0x0a9e('0x1b'),this['syncHangupRequest'][_0x0a9e('0x18')](this));ami['on']('dialend',this[_0x0a9e('0x1c')][_0x0a9e('0x18')](this));ami['on']('newexten',this[_0x0a9e('0x1d')]['bind'](this));ami['on'](_0x0a9e('0x1e'),this[_0x0a9e('0x1f')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x18')](this));this[_0x0a9e('0x24')](this[_0x0a9e('0x10')]);}function emit(_0x105080,_0x4bb1e3,_0x2c3407){io['to'](_0x105080)[_0x0a9e('0x25')](_0x4bb1e3,_0x2c3407);}function emitVoiceQueueChannelRemove(_0x53682f){logger[_0x0a9e('0x26')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x53682f));emit(util[_0x0a9e('0x27')](_0x0a9e('0x28'),_0x53682f[_0x0a9e('0x29')]),_0x0a9e('0x2a'),_0x53682f);io['emit'](_0x0a9e('0x2b'),_0x53682f);}function notSendMessagesQueue(_0x2fb0e4){if(_0x2fb0e4[_0x0a9e('0x2c')]){if(_0x2fb0e4[_0x0a9e('0x2d')]===0x0&&_0x2fb0e4[_0x0a9e('0x2e')]===0x0){_0x2fb0e4[_0x0a9e('0x2c')]=![];_0x2fb0e4[_0x0a9e('0x2f')]=0x0;_0x2fb0e4['paused']=0x0;_0x2fb0e4['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4['name']+_0x0a9e('0x34'));}else{_0x2fb0e4['message']=utils[_0x0a9e('0x30')]['DEACTIVATED'];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4[_0x0a9e('0x29')]+_0x0a9e('0x35'));}}}Preview[_0x0a9e('0xd')][_0x0a9e('0x24')]=function(){var _0x11c3b6=this;setInterval(function(){_0x11c3b6[_0x0a9e('0x36')]();},0x7cf);};Preview['prototype'][_0x0a9e('0x36')]=function(){var _0x468813=this[_0x0a9e('0x10')];this[_0x0a9e('0x15')]+=0x1;for(var _0x5c877d in _0x468813){if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&(_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x4')||_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x39'))&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(this[_0x0a9e('0x15')]>0x7){this[_0x0a9e('0x15')]=0x0;this['clearZombieChannels']();}}if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&_0x468813[_0x5c877d]['dialMethod']===_0x0a9e('0x4')&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(_0x468813[_0x5c877d][_0x0a9e('0x3c')]){this[_0x0a9e('0x3d')](_0x468813[_0x5c877d]);if(_0x468813[_0x5c877d]['dialPreviewAutoRecallMe'])this[_0x0a9e('0x3e')](_0x468813[_0x5c877d]);}else{notSendMessagesQueue(_0x468813[_0x5c877d]);}}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3f')]=function(_0x2da5c0){var _0x2b45ea=this;this[_0x0a9e('0x40')][_0x0a9e('0xe')](function(){if(!_[_0x0a9e('0x41')](_0x2b45ea['actions'][_0x2da5c0])){loggerAction[_0x0a9e('0x26')]('[clearZombieChannels][talking]',_0x2da5c0,_0x0a9e('0x42'),_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')],_0x0a9e('0x44'),JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2d')]),'pTalking:\x20',JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea['actions'][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2e')]),JSON[_0x0a9e('0x45')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]['dialAnswer']),JSON[_0x0a9e('0x45')](_[_0x0a9e('0x46')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0],['contactId',_0x0a9e('0x47'),_0x0a9e('0x48'),_0x0a9e('0x49')])));return ami['Action']({'action':'status','channel':_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4a')]})['catch'](function(_0x2b814e){if(_0x2b814e[_0x0a9e('0x4b')]===_0x0a9e('0x4c')){setTimeout(function(){if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]){ut['updateOriginated'](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],'[clearZombieChannel]');if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4d')]===!![]){ut[_0x0a9e('0x4e')](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],_0x0a9e('0x4f'));ut[_0x0a9e('0x50')](_0x0a9e('0x51')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);}ut[_0x0a9e('0x50')](_0x0a9e('0x52')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);delete _0x2b45ea[_0x0a9e('0x13')][_0x2da5c0];}},0x2328);}});}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x53')]=function(){var _0x37f6cc=this;loggerAction['info']('[action]',_[_0x0a9e('0x54')](this[_0x0a9e('0x13')]));for(var _0x405c8f in this[_0x0a9e('0x13')]){if(_0x37f6cc[_0x0a9e('0x13')][_0x0a9e('0x37')](_0x405c8f)){_0x37f6cc[_0x0a9e('0x3f')](_0x405c8f);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3e')]=function(_0x25c6e6){var _0x2c2cb0=this;rpcDb[_0x0a9e('0x55')](_0x25c6e6['id'],ut['agentReadyId'](this[_0x0a9e('0x14')]))[_0x0a9e('0x56')](function(_0xdd268f){if(!_[_0x0a9e('0x41')](_0xdd268f)){for(var _0x2e8caf=0x0;_0x2e8caf<_0xdd268f[_0x0a9e('0x57')];_0x2e8caf+=0x1){if(ut[_0x0a9e('0x58')](_0xdd268f[_0x2e8caf][_0x0a9e('0x59')])<_0x25c6e6['dialRecallMeTimeout']*0x3c){if(_0xdd268f[_0x2e8caf][_0x0a9e('0x5a')]&&!_0xdd268f[_0x2e8caf]['Agent'][_0x0a9e('0x5b')]){_0x2c2cb0[_0x0a9e('0x5c')](_0xdd268f[_0x2e8caf]['id'])[_0x0a9e('0x56')](ut['logger2'](_0x0a9e('0x5d')))[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x5d')));}else{rpcDb[_0x0a9e('0x60')](_0xdd268f[_0x2e8caf]['id']);}}else{var _0x37be73=new Action(_0xdd268f[_0x2e8caf],_0x25c6e6);_0x37be73[_0x0a9e('0x61')]=moment()['format'](_0x0a9e('0x62'));_0x25c6e6[_0x0a9e('0x63')]+=0x1;ut[_0x0a9e('0x64')](_0x37be73,0x17,_0x0a9e('0x65'));if(_0x25c6e6[_0x0a9e('0x66')]){rpcDb[_0x0a9e('0x67')](ut[_0x0a9e('0x68')](_0xdd268f[_0x2e8caf]));rpcDb[_0x0a9e('0x69')](_0x37be73,_0x0a9e('0x6a'));}else{ut['logCustomer'](_0x37be73,0x16,_0x0a9e('0x6b'));rpcDb[_0x0a9e('0x69')](_0x37be73,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x37be73,'[HistoryRecallClose]');}}}}})[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x6c')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x3d')]=function(_0x30decb){_0x30decb[_0x0a9e('0x2c')]=!![];if(ut[_0x0a9e('0x6d')](_0x30decb['loggedIn'])){_0x30decb['message']=utils['CAMPAIGN_STATUS'][_0x0a9e('0x6e')];}else if(!ut[_0x0a9e('0x6f')](_0x30decb[_0x0a9e('0x3c')])){_0x30decb['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];}else if(!this['isTrunkReachable'](_0x30decb['Trunk'])){if(!this[_0x0a9e('0x70')](_0x30decb['TrunkBackup'])){_0x30decb[_0x0a9e('0x4b')]=utils['CAMPAIGN_STATUS'][_0x0a9e('0x71')];}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}};Preview['prototype'][_0x0a9e('0x72')]=function(_0x3aedd0,_0x49c095,_0x145931){var _0x5ce9ac=this;var _0x211ef9=this['actions'][_0x49c095];var _0xe22ccc=this['campaignsPreview'][_0x211ef9['queue']];var _0x5df0ad;var _0x2da03c=![];var _0x47de4c=0x2;var _0x2f7092=0x3;if(_0xe22ccc){switch(_0x145931){case'1':_0xe22ccc[_0x0a9e('0x73')]+=0x1;_0x211ef9[_0x0a9e('0x74')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x0,_0x0a9e('0x77'));ami[_0x0a9e('0x25')]('custom:agentnosuchnumber',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x79')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0x7a'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'0',_0xe22ccc)[_0x0a9e('0x56')](function(_0x5d86e9){_0x2da03c=_0x5d86e9[_0x0a9e('0x7c')]==0x1;_0x47de4c=_0xe22ccc[_0x0a9e('0x7d')];_0x2f7092=_0xe22ccc['callAdditionalPhoneAfterMin'];if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc['dialGlobalMaxRetry']){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb['createCustomerFinal'](_0x5df0ad,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x211ef9[_0x0a9e('0x74')]>=_0xe22ccc['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x80'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0x74'),_0xe22ccc[_0x0a9e('0x7d')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}delete this['actions'][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x211ef9[_0x0a9e('0x74')]++;logger[_0x0a9e('0x26')]('actioncountonusuch',_0x211ef9[_0x0a9e('0x74')]);logger[_0x0a9e('0x26')]('id',_0x211ef9[_0x0a9e('0x85')]);_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnosuchnumberretry':_0x211ef9[_0x0a9e('0x74')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0x87'):var _0x88dcbf=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x211ef9['responsetime']=_0x88dcbf;_0x211ef9[_0x0a9e('0x88')]=_0x88dcbf;_0x211ef9[_0x0a9e('0x4d')]=!![];_0xe22ccc[_0x0a9e('0x2e')]+=0x1;logger['info'](_0x0a9e('0x89'),_0x211ef9['uniqueid'],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0xe22ccc[_0x0a9e('0x2e')]);ami[_0x0a9e('0x25')](_0x0a9e('0x8b'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x8c'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));if(_0xe22ccc[_0x0a9e('0x8d')]||_0xe22ccc[_0x0a9e('0x8e')]){ami[_0x0a9e('0x25')](_0x0a9e('0x8f'),{'queue':_0x211ef9[_0x0a9e('0x43')],'interface':_0x211ef9[_0x0a9e('0x90')],'uniqueid':_0x211ef9[_0x0a9e('0x91')]});}break;case'16':ami[_0x0a9e('0x25')](_0x0a9e('0x92'),ut['buildObj'](_0x211ef9,_0x0a9e('0x93'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x211ef9,_0x0a9e('0x93')));_0xe22ccc[_0x0a9e('0x94')]+=0x1;_0xe22ccc['total']+=0x1;_0xe22ccc[_0x0a9e('0x95')]+=0x1;ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0x96'));_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x4,'Answer');rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0x97'));rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x98'));rpcDb[_0x0a9e('0x99')](_0x211ef9);_0xe22ccc[_0x0a9e('0x9a')]+=_0x211ef9[_0x0a9e('0x9b')];_0xe22ccc[_0x0a9e('0x9c')]+=_0x211ef9[_0x0a9e('0x9b')];logger['info'](_0x0a9e('0x9d'),_0x211ef9[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0xe22ccc['name'],_0x0a9e('0x8a'),_0xe22ccc['pTalking']);delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'BUSY':_0xe22ccc[_0x0a9e('0x9f')]+=0x1;_0x211ef9[_0x0a9e('0xa0')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x5,_0x0a9e('0xa1'));_0x47de4c=_0xe22ccc[_0x0a9e('0xa2')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')]('custom:agentbusy',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xa4')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xa5'));_0x5ce9ac['verifyAdditionalPhones'](_0x211ef9,'5',_0xe22ccc)[_0x0a9e('0x56')](function(_0x3511c9){_0x2da03c=_0x3511c9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xa8'));}else{if(_0x211ef9[_0x0a9e('0xa0')]>=_0xe22ccc[_0x0a9e('0xa9')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xa5'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xa0'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xa0')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countbusyretry':_0x211ef9[_0x0a9e('0xa0')]}})['then'](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xab'):_0xe22ccc['outboundNoAnswerCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xac')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x3,'NoAnswer');_0x47de4c=_0xe22ccc[_0x0a9e('0xad')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];var _0x2d2286=ut[_0x0a9e('0xae')](_0x211ef9,_0xe22ccc);ami[_0x0a9e('0x25')](_0x0a9e('0xaf'),_0x2d2286);rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logNoAnswer]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'3',_0xe22ccc)[_0x0a9e('0x56')](function(_0x45c109){_0x2da03c=_0x45c109[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x211ef9[_0x0a9e('0xac')]>=_0xe22ccc[_0x0a9e('0xb0')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xb1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xac'),_0xe22ccc[_0x0a9e('0xad')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'CONGESTION':_0xe22ccc[_0x0a9e('0xb2')]+=0x1;_0x211ef9[_0x0a9e('0xb3')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x8,_0x0a9e('0xb4'));_0x47de4c=_0xe22ccc['dialCongestionRetryFrequency'];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami['emit'](_0x0a9e('0xb5'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xb6')));rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logCongestion]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'8',_0xe22ccc)[_0x0a9e('0x56')](function(_0x1d4877){_0x2da03c=_0x1d4877['additional']==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xb7'));}else{if(_0x211ef9[_0x0a9e('0xb3')]>=_0xe22ccc[_0x0a9e('0xb8')]){rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xb9'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xb3'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xb3')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countcongestionretry':_0x211ef9[_0x0a9e('0xb3')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xbb'):_0xe22ccc[_0x0a9e('0xbc')]+=0x1;_0x211ef9[_0x0a9e('0xbd')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x14,_0x0a9e('0xbe'));_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')](_0x0a9e('0xc0'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xc1')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc2'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)[_0x0a9e('0x56')](function(_0x4989f9){_0x2da03c=_0x4989f9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x14,_0x0a9e('0xbe'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xc3'));}else{if(_0x211ef9[_0x0a9e('0xbd')]>=_0xe22ccc['dialAgentRejectMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0xbd'),_0xe22ccc[_0x0a9e('0xbf')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case'ABANDONED':_0xe22ccc['outboundAbandonedCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc4')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xb,_0x0a9e('0xc5'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc6'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'11',_0xe22ccc)[_0x0a9e('0x56')](function(_0x586510){_0x2da03c=_0x586510[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xc6'));}else{if(_0x211ef9['countabandonedetry']>=_0xe22ccc[_0x0a9e('0xc7')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xc6'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,'countabandonedretry',_0xe22ccc['dialAbandonedRetryFrequency']),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'18':_0xe22ccc['outboundUnknownCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc8')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x12,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0['dialstatus']);ami['emit'](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xcb'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2eb028){_0x2da03c=_0x2eb028['additional']==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x12,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xcb'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xcb'));}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'19':_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x13,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);ami[_0x0a9e('0x25')](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0xce'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2fea95){_0x2da03c=_0x2fea95[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xce'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xce'));}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})['then'](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;default:if(_0x211ef9[_0x0a9e('0x4d')]){ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0xcf'));ut[_0x0a9e('0x50')](_0x0a9e('0xd0')+_0xe22ccc[_0x0a9e('0x29')],_0x3aedd0);}_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xc,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];rpcDb['createCustomerHistory'](_0x211ef9,'[callProgressDetectingCustomer][logUnknown]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)['then'](function(_0x1d999b){_0x2da03c=_0x1d999b[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xd1'));}delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});}});}if(!(_0x211ef9[_0x0a9e('0x4d')]&&_0x145931==='16')){ut[_0x0a9e('0xd2')](_0xe22ccc,'[callProgressDetectingCustomer]');logger[_0x0a9e('0x26')](_0x0a9e('0xd3'),_0x211ef9[_0x0a9e('0x91')],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x44'),_0xe22ccc[_0x0a9e('0x2d')]);}if(_0x145931!==_0x0a9e('0x87')){delete this[_0x0a9e('0x13')][_0x3aedd0['linkedid']];delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0xd4')]];}_0xe22ccc['queueSummaryCountersUpdated']=!![];}};Preview[_0x0a9e('0xd')][_0x0a9e('0xd5')]=function(_0x1f6f1c,_0x5822a7,_0x5c3b6f){if(_['isUndefined'](_0x5822a7)&&_0x0a9e('0xd6')!==typeof _0x5822a7){return;}if(_[_0x0a9e('0xd7')](_0x5c3b6f)&&'object'!==typeof _0x5c3b6f){return;}switch(_0x5c3b6f[_0x0a9e('0xd8')]){case'0':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x0,_0x0a9e('0x77'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xda'));break;case'3':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x3,_0x0a9e('0xdb'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdd'));break;case'5':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x5,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xde'));break;case'8':ut['logAgent'](_0x1f6f1c,0x8,_0x0a9e('0xb4'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xdf'));break;case'22':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x16,_0x0a9e('0xe0'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xe1'));break;default:ut[_0x0a9e('0xd9')](_0x1f6f1c,0xc,_0x5c3b6f['reason']);rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdf'));}ut[_0x0a9e('0xd2')](_0x5822a7,_0x0a9e('0xe2'));logger['info'](_0x0a9e('0xe3'),_0x1f6f1c[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0x5822a7[_0x0a9e('0x29')],_0x0a9e('0x44'),_0x5822a7[_0x0a9e('0x2d')]);delete this[_0x0a9e('0x13')][_0x1f6f1c[_0x0a9e('0x91')]];};Preview[_0x0a9e('0xd')][_0x0a9e('0x7b')]=function(_0x57f0ad,_0x2272bc,_0x88b25f){return cmHopperAdditionalPhone[_0x0a9e('0x7b')](_0x57f0ad,_0x2272bc,_0x88b25f)[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')](_0x0a9e('0xe4')));};Preview[_0x0a9e('0xd')][_0x0a9e('0xba')]=function(_0x566b90,_0x3b581c,_0xd2391){return cmHopperAdditionalPhone[_0x0a9e('0xba')](_0x566b90,_0x3b581c,_0xd2391)['catch'](logger[_0x0a9e('0x26')](_0x0a9e('0xe5')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x86')]=function(_0x370b5e){return Promise[_0x0a9e('0xe6')]()[_0x0a9e('0x56')](cmHopperAdditionalPhone[_0x0a9e('0x86')](_0x370b5e))[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')]('[incrementPreviewCounters]\x20'));};Preview[_0x0a9e('0xd')][_0x0a9e('0xe7')]=function(_0x15a9ed,_0x3db98f,_0x2b624e,_0x3942fd,_0x5cb48d){var _0x382687=this;return new Promise(function(_0x4f854b,_0x5bd139){if(_['isNil'](_0x3db98f)||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe8')])||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe9')])||_['isNil'](_0x3db98f[_0x0a9e('0x48')])){_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xea'),_0x3942fd,_0x5cb48d));return;}var _0x1fdb10=uuid['v4']();var _0x2c8d1d=_0x382687['campaignsPreview'][_0x3db98f['Queue'][_0x0a9e('0x29')]];var _0x33bcb2=_0x2b624e?_0x382687[_0x0a9e('0x14')][_0x2b624e]['id']:undefined;_0x382687['actions'][_0x1fdb10]=new Action(_0x3db98f,_0x2c8d1d,_0x1fdb10,_0x2b624e,_0x33bcb2);var _0x319752=_0x382687[_0x0a9e('0x13')][_0x1fdb10];_0x319752[_0x0a9e('0xaa')]=_0x3942fd;_0x319752['activeContact']=_0x5cb48d;_0x319752[_0x0a9e('0xeb')]=_0x2b624e;if(_[_0x0a9e('0xec')](_0x15a9ed)){_0x382687[_0x0a9e('0xed')](_0x319752,_0x2c8d1d,_0x3db98f,_0x2b624e)['then'](function(_0x272291){logger[_0x0a9e('0x26')](_0x0a9e('0xee'),'Queue:\x20'+_0x319752['queue']+'\x20IdHopper:\x20'+_0x319752[_0x0a9e('0x85')],JSON[_0x0a9e('0x45')](_0x272291));ami[_0x0a9e('0x25')](_0x0a9e('0xef'),ut['buildObj'](_0x319752,_0x0a9e('0xf0'),_0x382687['campaignsPreview'][_0x319752[_0x0a9e('0x43')]]));_0x4f854b(ut[_0x0a9e('0x4b')](_0x0a9e('0xf1')));})['catch'](function(_0x33b4b3){ut[_0x0a9e('0x32')](_0x0a9e('0xf2'),_0x33b4b3);_0x5bd139(ut['message'](_0x0a9e('0xf3'),_0x3942fd,_0x5cb48d));});}else{_0x2c8d1d['outboundBlacklistCallsDay']+=0x1;ut[_0x0a9e('0xf4')](_0x319752);rpcDb['createHistory'](_0x319752,_0x0a9e('0xf5'));delete _0x382687['actions'][_0x1fdb10];_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xf6'),_0x3942fd,_0x5cb48d));}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x70')]=function(_0x1e306c){return!_[_0x0a9e('0x41')](_0x1e306c)&&!_[_0x0a9e('0x41')](_0x1e306c['name'])&&!_[_0x0a9e('0x41')](_0x1e306c[_0x0a9e('0xf7')])&&_0x1e306c['active']&&!_[_0x0a9e('0x41')](this[_0x0a9e('0x12')][util['format'](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])])&&!_[_0x0a9e('0x41')](this['trunks'][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')])&&(this[_0x0a9e('0x12')][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfa')||this['trunks'][util[_0x0a9e('0x27')]('SIP/%s',_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfb'));};Preview[_0x0a9e('0xd')][_0x0a9e('0x5c')]=function(_0x2d45db,_0x5691ac){return this[_0x0a9e('0xfc')](_0x2d45db,_0x5691ac)[_0x0a9e('0x56')](function(_0x2977a7){return _['pick'](_0x2977a7,[_0x0a9e('0x4b')]);})[_0x0a9e('0x5e')](function(_0x4435d2){if(_0x4435d2[_0x0a9e('0xfd')]){rpcDb[_0x0a9e('0xfe')](_0x2d45db);}if(_0x4435d2[_0x0a9e('0xf7')]){rpcDb[_0x0a9e('0x60')](_0x2d45db);}throw _['pick'](_0x4435d2,[_0x0a9e('0x4b')]);});};Preview[_0x0a9e('0xd')][_0x0a9e('0xfc')]=function(_0x2ce3be,_0x3de77e){var _0x241404=this;var _0x8120e,_0x5d6a48;return rpcDb['getContactPreview'](_0x2ce3be)[_0x0a9e('0x56')](function(_0x3f507c){if(!_[_0x0a9e('0x41')](_0x3f507c[0x0])){_0x5d6a48=_0x3f507c[0x0][_0x0a9e('0xff')]?![]:!![];_0x8120e=_0x3f507c[0x0][_0x0a9e('0xff')]?!![]:![];_0x8120e=_0x3de77e?!![]:_0x8120e;}var _0x131da8=_0x241404[_0x0a9e('0x100')](_0x3f507c);if(_0x131da8['isValid']){rpcDb[_0x0a9e('0x101')](_[_0x0a9e('0x46')](_0x3f507c[0x0],[_0x0a9e('0x48'),_0x0a9e('0xe9')]))[_0x0a9e('0x56')](function(_0x3c6082){_0x241404[_0x0a9e('0xe7')](_0x3c6082,_0x3f507c[0x0],_0x3de77e,_0x5d6a48,_0x8120e)['then'](function(_0x311288){return _0x311288;})[_0x0a9e('0x5e')](function(_0x231826){throw _0x231826;});})['catch'](function(_0x2b8ad4){ut[_0x0a9e('0x32')](_0x0a9e('0x102'),_0x2b8ad4);throw ut[_0x0a9e('0x4b')]('Call\x20unsuccessful',_0x5d6a48,_0x8120e);});}else{throw ut[_0x0a9e('0x4b')](_0x131da8[_0x0a9e('0x4b')],_0x5d6a48,_0x8120e);}})[_0x0a9e('0x5e')](function(_0x93d953){ut[_0x0a9e('0x32')](_0x0a9e('0x103'),_0x93d953);throw ut[_0x0a9e('0x4b')](_0x0a9e('0x104'),![],!![]);});};Preview['prototype'][_0x0a9e('0x100')]=function(_0x266aa1){if(_[_0x0a9e('0x41')](_0x266aa1)||_[_0x0a9e('0xec')](_0x266aa1)||!_['isNil'](_0x266aa1[0x0]['Agent'])&&_[_0x0a9e('0x41')](_0x266aa1[0x0][_0x0a9e('0x5a')][_0x0a9e('0x29')])){ut['logger'](_0x0a9e('0x105'),_0x266aa1);return{'isValid':![],'message':_0x0a9e('0x106')};}var _0x4d8a67=this[_0x0a9e('0x10')][_0x266aa1[0x0]['Queue'][_0x0a9e('0x29')]];_0x4d8a67['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0x0a9e('0x41')](_0x4d8a67)){ut[_0x0a9e('0x32')](_0x0a9e('0x107'),_0x4d8a67);return{'isValid':![],'message':_0x0a9e('0x108')};}if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x109')])){ut['logger'](_0x0a9e('0x10a'),_0x0a9e('0x10b')+_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x10c'));if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x10d')])){ut[_0x0a9e('0x32')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x4d8a67['name']+_0x0a9e('0x10e'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x0a9e('0x6f')](_0x4d8a67[_0x0a9e('0x3c')])){ut[_0x0a9e('0x32')](_0x0a9e('0x10f'),_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x110'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x4d8a67[_0x0a9e('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x0a9e('0xd')]['execCall']=function(_0x38dceb,_0x5dc978,_0x550cbf,_0x26223f){var _0x4a7a3c=this;return new Promise(function(_0x24470a,_0x142e53){var _0xe1ab0d=_0x38dceb['uniqueid'];var _0x4152cd=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?util['format']('SIP/%s/%s%s',_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978[_0x0a9e('0x111')][_0x0a9e('0x112')]()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')][_0x0a9e('0x114')](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf['phone']):util['format']('SIP/%s/%s%s',_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978['dialPrefix']['trim']()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')]['substring'](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf[_0x0a9e('0xe9')]);var _0x2e2280=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?ut[_0x0a9e('0x115')](_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978[_0x0a9e('0x11a')]):ut[_0x0a9e('0x115')](_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978['dialOriginateCallerIdNumber']);if(_0x2e2280){_0x38dceb[_0x0a9e('0x11b')]=ut[_0x0a9e('0x11c')](_0x2e2280);_0x38dceb[_0x0a9e('0x11d')]=ut[_0x0a9e('0x11e')](_0x2e2280);}var _0x33359a=ut[_0x0a9e('0x11f')](_0x5dc978,_0x550cbf,_0x4152cd,_0x2e2280,_0xe1ab0d,_0x38dceb);var _0xa8b5de=utils['setXMDContactVariables'](_0x550cbf[_0x0a9e('0xe8')]);Object['assign'](_0x33359a,_0xa8b5de);_[_0x0a9e('0x120')](_0x38dceb,ut[_0x0a9e('0x121')](_0x33359a));_0x38dceb[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x5dc978[_0x0a9e('0x122')]=_0x33359a;var _0x465003=ut[_0x0a9e('0x123')](_0x38dceb,_0x5dc978,_0x33359a,_0x38dceb[_0x0a9e('0x83')],_0x26223f);return ami[_0x0a9e('0x124')](_0x465003)[_0x0a9e('0x56')](function(_0x8231e5){_0x5dc978[_0x0a9e('0x2d')]+=0x1;logger[_0x0a9e('0x26')](_0x0a9e('0x125'),_0xe1ab0d,_0x0a9e('0x9e'),_0x5dc978['name'],'originated:\x20',_0x5dc978[_0x0a9e('0x2d')]);_0x24470a(_0x8231e5);})[_0x0a9e('0x5e')](function(_0x52b365){ut['logAgent'](_0x38dceb,0xe,_0x0a9e('0x126'));rpcDb[_0x0a9e('0xdc')](_0x38dceb,_0x0a9e('0x127'));_0x142e53(_0x52b365);});});};Preview['prototype'][_0x0a9e('0x1d')]=function(_0x5b6447){if(this[_0x0a9e('0x13')][_0x5b6447['linkedid']]){this[_0x0a9e('0x13')][_0x5b6447['linkedid']][_0x0a9e('0x4a')]=_0x5b6447[_0x0a9e('0x4a')];}};Preview[_0x0a9e('0xd')]['syncOriginateResponse']=function(_0x316b51){var _0x497fda=this;var _0x505ffd=this[_0x0a9e('0x13')][_0x316b51[_0x0a9e('0x128')]];if(_0x505ffd){if(_0x505ffd[_0x0a9e('0xeb')]&&this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]){ut[_0x0a9e('0x129')](_0x505ffd,this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]][_0x0a9e('0x29')],this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]['id']);}var _0x98bf26=_[_0x0a9e('0x12a')](_0x505ffd);_0x98bf26[_0x0a9e('0x12b')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));var _0x310026=_0x497fda[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]];if(ut['isFailure'](_0x316b51[_0x0a9e('0x12c')])){if(_0x505ffd[_0x0a9e('0xaa')]){rpcDb[_0x0a9e('0xfe')](_0x505ffd[_0x0a9e('0x85')]);}if(_0x505ffd['activeContact']){rpcDb['disableContact'](_0x505ffd['idContact']);}ami[_0x0a9e('0x25')]('custom:agentringnoanswer',ut[_0x0a9e('0x78')](_0x505ffd,_0x0a9e('0x12d'),this[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]]));this[_0x0a9e('0xd5')](_0x98bf26,_0x310026,_0x316b51);}else{_0x505ffd[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));ut[_0x0a9e('0xd9')](_0x98bf26,0x4,_0x0a9e('0x12e'));rpcDb['createAgentHistory'](_0x98bf26,_0x0a9e('0x12f'));}}};Preview['prototype'][_0x0a9e('0x1a')]=function(_0x586d2f){var _0xf4de86=this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]];var _0x556bb7;if(_0xf4de86){_0x556bb7=this[_0x0a9e('0x10')][_0xf4de86[_0x0a9e('0x43')]];logger['info']('[syncHangup][talking]',_0x586d2f[_0x0a9e('0x84')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],'pTalking:\x20',_0x556bb7['pTalking']);}if(this['actions'][_0x586d2f[_0x0a9e('0x84')]]&&_0x586d2f[_0x0a9e('0x84')]!==_0x586d2f[_0x0a9e('0x91')]){if(_0x586d2f[_0x0a9e('0x130')]==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')](_0x0a9e('0x131'),_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}}else if(_0xf4de86&&_[_0x0a9e('0x41')](_0xf4de86['statedesc'])&&_0x556bb7[_0x0a9e('0x132')]&&_0x586d2f[_0x0a9e('0x84')]===_0x586d2f[_0x0a9e('0x91')]&&_[_0x0a9e('0x41')](_0x586d2f[_0x0a9e('0xd8')])&&_0x586d2f[_0x0a9e('0x130')]==='16'&&_0x586d2f[_0x0a9e('0x133')]==='6'&&_[_0x0a9e('0xd7')](_0xf4de86[_0x0a9e('0x134')])){if(_0xf4de86['unlockAgent']){rpcDb['unlockContact'](_0xf4de86[_0x0a9e('0x85')]);}if(_0xf4de86[_0x0a9e('0x83')]){rpcDb['disableContact'](_0xf4de86[_0x0a9e('0x85')]);}_0x586d2f[_0x0a9e('0xd8')]='22';this['callProgressDetectingAgent'](_0xf4de86,_0x556bb7,_0x586d2f);}else if(_0xf4de86&&_0xf4de86[_0x0a9e('0x134')]){if(_0x586d2f['cause']==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]]['dialAnswer']){logger[_0x0a9e('0x26')](_0x0a9e('0x135'),_0x586d2f['linkedid'],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f['linkedid']][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')]('[syncHangup][talking][cause]',_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f['linkedid'],_0x586d2f['cause']);}}};Preview['prototype']['syncDialEnd']=function(_0x5e9817){if(this[_0x0a9e('0x13')][_0x5e9817[_0x0a9e('0xd4')]]&&_0x5e9817['destlinkedid']!==_0x5e9817['destuniqueid']){this[_0x0a9e('0x72')](_0x5e9817,_0x5e9817['destlinkedid'],_0x5e9817[_0x0a9e('0xcd')]);}};Preview[_0x0a9e('0xd')][_0x0a9e('0x136')]=function(_0x175c97){if(this[_0x0a9e('0x13')][_0x175c97[_0x0a9e('0x84')]]&&_0x175c97['linkedid']!==_0x175c97[_0x0a9e('0x91')]&&!this[_0x0a9e('0x13')][_0x175c97['linkedid']][_0x0a9e('0x4d')]){if(_0x175c97[_0x0a9e('0x130')]==='1'){this[_0x0a9e('0x72')](_0x175c97,_0x175c97[_0x0a9e('0x84')],_0x175c97[_0x0a9e('0x130')]);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x137')]=function(_0x4a36df,_0x331216,_0x508395){if(this[_0x0a9e('0x13')][_0x4a36df]){if(_[_0x0a9e('0x41')](this['actions'][_0x4a36df][_0x0a9e('0x122')])){this[_0x0a9e('0x13')][_0x4a36df]['variables']={};}this[_0x0a9e('0x13')][_0x4a36df]['variables'][_0x331216]=_0x508395;}};Preview[_0x0a9e('0xd')][_0x0a9e('0x1f')]=function(_0x5d0620){try{if(!_[_0x0a9e('0x41')](_0x5d0620)){if(ut['filterKey'](_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0])){this[_0x0a9e('0x137')](_0x5d0620[_0x0a9e('0x91')],_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0],_0x5d0620[_0x0a9e('0x13a')]);}}}catch(_0x53b5c2){logger[_0x0a9e('0x13b')](_0x0a9e('0x13c'),util[_0x0a9e('0x13d')](_0x53b5c2,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xd')][_0x0a9e('0x21')]=function(_0x5932ad){if(_0x5932ad){if(this[_0x0a9e('0x13')][_0x5932ad['transfertargetlinkedid']]){this['actions'][_0x5932ad[_0x0a9e('0x13e')]]['transfer']=!![];}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x23')]=function(_0x58d5fd){if(_0x58d5fd){if(this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]]){this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]][_0x0a9e('0x134')]=!![];}}};module[_0x0a9e('0x140')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index d501592..d6636a5 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 _0xc472=['assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','inspect','createHistory','catch','then','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','resolve','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercompleteAt','endtime','context','from-sip','xcally-motion-preview'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xc472,0x10d));var _0x2c47=function(_0x2aefff,_0x26a24b){_0x2aefff=_0x2aefff-0x0;var _0x4e4534=_0xc472[_0x2aefff];return _0x4e4534;};'use strict';var util=require(_0x2c47('0x0'));var BPromise=require(_0x2c47('0x1'));var logger=require(_0x2c47('0x2'))(_0x2c47('0x3'));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x2c47('0x4'));var cmHopperBlack=require(_0x2c47('0x5'));var agentReportPreview=require(_0x2c47('0x6'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x194f8e){return function(_0x2e1ae6){logger['error'](_0x194f8e,util[_0x2c47('0x7')](_0x2e1ae6,{'showHidden':![],'depth':null}));};}function create(_0x292c4a){return cmHopperHistory[_0x2c47('0x8')](_0x292c4a)[_0x2c47('0x9')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x3df89d){return BPromise['resolve']()[_0x2c47('0xa')](agentReportPreview[_0x2c47('0x8')](_0x3df89d))[_0x2c47('0x9')](loggerCatch(_0x2c47('0xb')));}function moveContact(_0x34d066){return cmHopper[_0x2c47('0xc')](_0x34d066,!![])[_0x2c47('0x9')](loggerCatch(_0x2c47('0xd')));}exports[_0x2c47('0xe')]=function(_0x4d2644){return cmHopperBlack[_0x2c47('0xe')](_0x4d2644)[_0x2c47('0x9')](loggerCatch(_0x2c47('0xf')));};exports['getContactPreview']=function(_0x3edffc){return BPromise[_0x2c47('0x10')]()[_0x2c47('0xa')](cmHopper['getContactPreview'](_0x3edffc))['catch'](loggerCatch(_0x2c47('0x11')));};exports['createHistory']=function(_0x13f415,_0x287f82){create(_0x13f415)[_0x2c47('0x9')](loggerCatch(_0x287f82));moveContact(_0x13f415)[_0x2c47('0x9')](loggerCatch(_0x287f82));};exports[_0x2c47('0x12')]=function(_0x516ffb,_0x37d63){createAgent(_0x516ffb)[_0x2c47('0x9')](loggerCatch(_0x37d63));};exports[_0x2c47('0x13')]=function(_0xe10114,_0x4090f4){create(_0xe10114)['catch'](loggerCatch(_0x4090f4));};exports[_0x2c47('0x14')]=function(_0x45ca91,_0x284e84){moveContact(_0x45ca91)[_0x2c47('0x9')](loggerCatch(_0x284e84));};exports[_0x2c47('0x15')]=function(_0x355b8f,_0x39fd07,_0x5802cb){if(_0x39fd07){_0x355b8f[_0x2c47('0x16')]=null;}if(_0x5802cb){_0x355b8f[_0x2c47('0x17')]=![];}return cmHopper[_0x2c47('0x15')](_0x355b8f)[_0x2c47('0x9')](loggerCatch(_0x2c47('0x18')));};exports[_0x2c47('0x19')]=function(_0x3a13d2){return cmHopper['countReScheduled'](_0x3a13d2)[_0x2c47('0x9')](loggerCatch(_0x2c47('0x1a')));};exports[_0x2c47('0x1b')]=function(_0x9ce565){return cmHopper[_0x2c47('0x1b')]({'UserId':null},_0x9ce565,0x1)[_0x2c47('0x9')](loggerCatch(_0x2c47('0x1c')));};exports[_0x2c47('0x1d')]=function(_0x4ff910){return cmHopper['unlockContact']({'active':![]},_0x4ff910,0x1)['catch'](loggerCatch(_0x2c47('0x1e')));};exports['crateCustomerReportQueue']=function(_0x1c24bc){var _0x4e4777={};_0x4e4777[_0x2c47('0x1f')]=_0x1c24bc['type'];_0x4e4777[_0x2c47('0x20')]=_0x1c24bc['uniqueid'];_0x4e4777[_0x2c47('0x21')]=_0x1c24bc[_0x2c47('0x21')];_0x4e4777[_0x2c47('0x22')]=_0x1c24bc['calleridname'];_0x4e4777[_0x2c47('0x23')]=_0x1c24bc[_0x2c47('0x23')];_0x4e4777['queuecallerjoinAt']=_0x1c24bc[_0x2c47('0x24')];_0x4e4777[_0x2c47('0x25')]=_0x1c24bc[_0x2c47('0x24')];_0x4e4777['queuecallercomplete']=0x1;_0x4e4777[_0x2c47('0x26')]=_0x1c24bc[_0x2c47('0x27')];_0x4e4777['connectedlinename']=_0x1c24bc['membername'];_0x4e4777[_0x2c47('0x28')]=_0x2c47('0x29');_0x4e4777['exten']=_0x2c47('0x2a');_0x4e4777['holdtime']=0x0;_0x4e4777[_0x2c47('0x2b')]=0x1;_0x4e4777[_0x2c47('0x2c')]=_0x1c24bc['membername'];_0x4e4777[_0x2c47('0x2d')]=_0x2c47('0x2e');return BPromise[_0x2c47('0x10')]()[_0x2c47('0xa')](voiceQueueReport['create'](_0x4e4777))['catch'](loggerCatch(_0x2c47('0x2f')));};exports[_0x2c47('0x30')]=function(_0x1dbdcd,_0x3b7de3){return BPromise[_0x2c47('0x10')]()['then'](cmHopper[_0x2c47('0x30')](_0x1dbdcd,_0x3b7de3))['catch'](loggerCatch(_0x2c47('0x31')));};exports[_0x2c47('0x32')]=function(_0x38dbcb){return cmHopper[_0x2c47('0x15')](_0x38dbcb,!![],!![])[_0x2c47('0x9')](loggerCatch(_0x2c47('0x33')));}; \ No newline at end of file +var _0x7d79=['resolve','then','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerHistory','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallercomplete','queuecallercompleteAt','endtime','membername','context','from-sip','xcally-motion-preview','holdtime','lastAssignedTo','queuecallerexitreason','COMPLETED','[voiceQueueReport]\x20','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','error','createHistory','catch','[createHistory]\x20'];(function(_0x5ad07c,_0x324dcd){var _0x204bae=function(_0x1245bc){while(--_0x1245bc){_0x5ad07c['push'](_0x5ad07c['shift']());}};_0x204bae(++_0x324dcd);}(_0x7d79,0x152));var _0x97d7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7d79[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0x97d7('0x0'));var BPromise=require(_0x97d7('0x1'));var logger=require(_0x97d7('0x2'))(_0x97d7('0x3'));var cmHopper=require(_0x97d7('0x4'));var cmHopperHistory=require(_0x97d7('0x5'));var cmHopperBlack=require(_0x97d7('0x6'));var agentReportPreview=require(_0x97d7('0x7'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x278be7){return function(_0xc1e8b3){logger[_0x97d7('0x8')](_0x278be7,util['inspect'](_0xc1e8b3,{'showHidden':![],'depth':null}));};}function create(_0x547d4c){return cmHopperHistory[_0x97d7('0x9')](_0x547d4c)[_0x97d7('0xa')](loggerCatch(_0x97d7('0xb')));}function createAgent(_0x54b6bf){return BPromise[_0x97d7('0xc')]()[_0x97d7('0xd')](agentReportPreview['createHistory'](_0x54b6bf))[_0x97d7('0xa')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x4719bd){return cmHopper['moveContactManagedDialer'](_0x4719bd,!![])[_0x97d7('0xa')](loggerCatch(_0x97d7('0xe')));}exports[_0x97d7('0xf')]=function(_0x430b04){return cmHopperBlack[_0x97d7('0xf')](_0x430b04)[_0x97d7('0xa')](loggerCatch(_0x97d7('0x10')));};exports[_0x97d7('0x11')]=function(_0x263707){return BPromise[_0x97d7('0xc')]()[_0x97d7('0xd')](cmHopper['getContactPreview'](_0x263707))[_0x97d7('0xa')](loggerCatch('[getContactPreview]\x20'));};exports[_0x97d7('0x9')]=function(_0xc89466,_0xda3ad9){create(_0xc89466)['catch'](loggerCatch(_0xda3ad9));moveContact(_0xc89466)[_0x97d7('0xa')](loggerCatch(_0xda3ad9));};exports[_0x97d7('0x12')]=function(_0x16cf2f,_0x28a867){createAgent(_0x16cf2f)[_0x97d7('0xa')](loggerCatch(_0x28a867));};exports[_0x97d7('0x13')]=function(_0xa8533d,_0x30533d){create(_0xa8533d)['catch'](loggerCatch(_0x30533d));};exports['createCustomerFinal']=function(_0xde21b7,_0x11e8b5){moveContact(_0xde21b7)[_0x97d7('0xa')](loggerCatch(_0x11e8b5));};exports[_0x97d7('0x14')]=function(_0x5bdceb,_0x59284f,_0x82dca7){if(_0x59284f){_0x5bdceb[_0x97d7('0x15')]=null;}if(_0x82dca7){_0x5bdceb[_0x97d7('0x16')]=![];}return cmHopper[_0x97d7('0x14')](_0x5bdceb)[_0x97d7('0xa')](loggerCatch(_0x97d7('0x17')));};exports[_0x97d7('0x18')]=function(_0x3d05c7){return cmHopper[_0x97d7('0x18')](_0x3d05c7)[_0x97d7('0xa')](loggerCatch('[countReScheduled]\x20'));};exports[_0x97d7('0x19')]=function(_0x185641){return cmHopper['unlockContact']({'UserId':null},_0x185641,0x1)[_0x97d7('0xa')](loggerCatch(_0x97d7('0x1a')));};exports[_0x97d7('0x1b')]=function(_0x263fb4){return cmHopper[_0x97d7('0x19')]({'active':![]},_0x263fb4,0x1)['catch'](loggerCatch(_0x97d7('0x1c')));};exports[_0x97d7('0x1d')]=function(_0x54d058){var _0x42644a={};_0x42644a[_0x97d7('0x1e')]=_0x54d058['type'];_0x42644a[_0x97d7('0x1f')]=_0x54d058['uniqueid'];_0x42644a[_0x97d7('0x20')]=_0x54d058[_0x97d7('0x20')];_0x42644a[_0x97d7('0x21')]=_0x54d058[_0x97d7('0x21')];_0x42644a['queue']=_0x54d058[_0x97d7('0x22')];_0x42644a['queuecallerjoinAt']=_0x54d058[_0x97d7('0x23')];_0x42644a['queuecallerleaveAt']=_0x54d058['answertime'];_0x42644a[_0x97d7('0x24')]=0x1;_0x42644a[_0x97d7('0x25')]=_0x54d058[_0x97d7('0x26')];_0x42644a['connectedlinename']=_0x54d058[_0x97d7('0x27')];_0x42644a[_0x97d7('0x28')]=_0x97d7('0x29');_0x42644a['exten']=_0x97d7('0x2a');_0x42644a[_0x97d7('0x2b')]=0x0;_0x42644a['assigned']=0x1;_0x42644a[_0x97d7('0x2c')]=_0x54d058['membername'];_0x42644a[_0x97d7('0x2d')]=_0x97d7('0x2e');return BPromise[_0x97d7('0xc')]()[_0x97d7('0xd')](voiceQueueReport['create'](_0x42644a))['catch'](loggerCatch(_0x97d7('0x2f')));};exports['getContactRecallMe']=function(_0x449bbf,_0x4b6ad4){return BPromise['resolve']()['then'](cmHopper['getContactRecallMe'](_0x449bbf,_0x4b6ad4))['catch'](loggerCatch(_0x97d7('0x30')));};exports['rescheduleContactInQueue']=function(_0x5a9745){return cmHopper['rescheduleContact'](_0x5a9745,!![],!![])[_0x97d7('0xa')](loggerCatch(_0x97d7('0x31')));}; \ 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 832514f..56d21e1 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 _0xd012=['util','lodash','moment','XCALLY_IP_AGI','../../dialer/utils','error','inspect','logger','info','loggerError','logger2','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','addVariables','Queue','name','calleridname','ContactId','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','hasOwnProperty','toLower','isNil','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','starttime','responsetime','endtime','logAgent','logLookAgent','UserId','logCustomer','ringtime','getSeconds','talktime','answertime','isFailure','Failure','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countagentrejectretry','clone','Global','scheduledAt','active','scheduledat','add','minutes','ListId','VoiceQueueId','decrementTalkink','pTalking','IsNotLoggedIn','lastevent','queue','interface','motionChannel','voice','mandatoryDisposition','buildObj','not_inuse','status','reachable','getDiff','milliseconds','seconds','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','membername','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitterbridged','bridgepeer','bridgepvtcallid','pow','replace','extractCalleridName','match','extractCalleridNumber','noanswer','variables','keys','forEach','toLowerCase','buildNoAnswerEventPayload'];(function(_0x2c585c,_0xe115bf){var _0xe3b848=function(_0x160abc){while(--_0x160abc){_0x2c585c['push'](_0x2c585c['shift']());}};_0xe3b848(++_0xe115bf);}(_0xd012,0x8d));var _0x2d01=function(_0xd4ded0,_0xfbd5e9){_0xd4ded0=_0xd4ded0-0x0;var _0x4a6a91=_0xd012[_0xd4ded0];return _0x4a6a91;};'use strict';var util=require(_0x2d01('0x0'));var _=require(_0x2d01('0x1'));var moment=require(_0x2d01('0x2'));var logger=require('../../../../config/logger')('preview');var ipAgi=process['env'][_0x2d01('0x3')]||'127.0.0.1';var utils=require(_0x2d01('0x4'));exports['loggerCatch']=function(_0x2c942f){return function(_0x4876bc){logger[_0x2d01('0x5')](_0x2c942f,util[_0x2d01('0x6')](_0x4876bc,{'showHidden':![],'depth':null}));};};exports[_0x2d01('0x7')]=function(_0x380043,_0x3f93c1){logger[_0x2d01('0x8')](_0x380043,util[_0x2d01('0x6')](_0x3f93c1,{'showHidden':![],'depth':null}));};exports[_0x2d01('0x9')]=function(_0x34c0ac,_0x518e98){logger[_0x2d01('0x5')](_0x34c0ac,util[_0x2d01('0x6')](_0x518e98,{'showHidden':![],'depth':null}));};exports[_0x2d01('0xa')]=function(_0x4968eb){return function(_0x244ea5){logger[_0x2d01('0x8')](_0x4968eb,util[_0x2d01('0x6')](_0x244ea5,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x4bbcf2,_0x576484,_0xea2de0){return{'message':_0x4bbcf2,'unlock':_0x576484,'active':_0xea2de0};};exports[_0x2d01('0xb')]=function(_0x5e3b91,_0x26ee47,_0x49818d){if(!_[_0x2d01('0xc')](_0x49818d)&&_0x2d01('0xd')===typeof _0x49818d&&!_[_0x2d01('0xe')](_0x49818d)){if(!_[_0x2d01('0xc')](_0x26ee47)&&_0x2d01('0xd')===typeof _0x26ee47&&!_[_0x2d01('0xe')](_0x26ee47)){return util[_0x2d01('0xf')](_0x2d01('0x10'),_0x26ee47,_0x49818d);}return util[_0x2d01('0xf')]('\x22%s\x22\x20<%s>',_0x49818d,_0x49818d);}if(!_['isUndefined'](_0x5e3b91)&&_0x2d01('0xd')===typeof _0x5e3b91&&!_['isEmpty'](_0x5e3b91)){return _0x5e3b91;}return _0x2d01('0x11');};exports[_0x2d01('0x12')]=function(_0x4a9a7a){if(_['isNil'](_0x4a9a7a)){return![];}return _0x4a9a7a;};exports[_0x2d01('0x13')]=function(_0x5c6166,_0x5e5197,_0x4aeac8,_0x59e037,_0x8cc485,_0x294980){var _0x152207={'XMD-QUEUE':_0x5e5197[_0x2d01('0x14')]?_0x5e5197[_0x2d01('0x14')][_0x2d01('0x15')]:'','XMD-CALLERID':_0x59e037,'XMD-CALLERID-PREVIEW':_0x294980?util[_0x2d01('0xf')](_0x2d01('0x10'),_0x294980[_0x2d01('0x16')],_0x294980['calleridnum']):_0x59e037,'XMD-DIALID':_0x8cc485,'XMD-CONTACTID':_0x5e5197[_0x2d01('0x17')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x59e037,'XMD-VOICEQUEUEID':_0x5e5197['VoiceQueueId'],'XMD-DIALCHANNEL':_0x4aeac8,'XMD-DIALTIMEOUT':_0x5c6166['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0x2d01('0xf')](_0x2d01('0x18'),_0x5c6166[_0x2d01('0x19')]?'g':'',_[_0x2d01('0xe')](_0x5c6166[_0x2d01('0x1a')])?'':_0x2d01('0x1b')),'XMD-DIALURL':_0x5c6166['dialPreviewUrl']||'','XMD-AGI':_0x5c6166[_0x2d01('0x1c')]?util['format'](_0x2d01('0x1d'),ipAgi,_0x5c6166['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x5c6166[_0x2d01('0x19')]?util[_0x2d01('0xf')](_0x2d01('0x1d'),ipAgi,_0x5c6166[_0x2d01('0x19')]):_0x2d01('0x1e'),'XMD-ORIGINATECALLERIDNUM':_0x294980?_0x294980[_0x2d01('0x1f')]:'','XMD-ORIGINATECALLERIDNAME':_0x294980?_0x294980[_0x2d01('0x20')]:'','XMD-DESTINATION':_0x2d01('0x21'),'SIPADDHEADER':_0x2d01('0x22')};if(!_[_0x2d01('0xe')](_0x5c6166[_0x2d01('0x1a')])){_0x152207[util[_0x2d01('0xf')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x5c6166['monitor_format'];_0x152207[util[_0x2d01('0xf')]('%s',_0x2d01('0x23'))]=_0x8cc485;}return _0x152207;};exports[_0x2d01('0x24')]=function(_0x19fc54){var _0x48bd8b={};for(var _0x46ca5f in _0x19fc54){if(_0x19fc54[_0x2d01('0x25')](_0x46ca5f)){_0x48bd8b[util[_0x2d01('0xf')]('%s',_[_0x2d01('0x26')](_0x46ca5f))]=_0x19fc54[_0x46ca5f];}}return{'variables':_0x48bd8b};};exports['updateOriginated']=function(_0x213f70,_0x373030){if(!_[_0x2d01('0x27')](_0x213f70)){if(_0x213f70[_0x2d01('0x25')](_0x2d01('0x28'))){if(_0x213f70[_0x2d01('0x28')]>0x0){_0x213f70['originated']-=0x1;}else{logger[_0x2d01('0x5')](_0x2d01('0x29'),_0x373030);}}}else{logger[_0x2d01('0x5')](_0x2d01('0x2a'),_0x373030);}};exports[_0x2d01('0x2b')]=function(_0x1b77dc){var _0x344ed4=moment()[_0x2d01('0xf')](_0x2d01('0x2c'));_0x1b77dc[_0x2d01('0x2d')]=0xd;_0x1b77dc[_0x2d01('0x2e')]='Blacklist';_0x1b77dc[_0x2d01('0x2f')]=_0x344ed4;_0x1b77dc[_0x2d01('0x30')]=_0x344ed4;_0x1b77dc[_0x2d01('0x31')]=_0x344ed4;};exports[_0x2d01('0x32')]=function(_0x35fa4f,_0x318763,_0x205918){var _0x58f560=moment()[_0x2d01('0xf')](_0x2d01('0x2c'));_0x35fa4f[_0x2d01('0x2d')]=_0x318763;_0x35fa4f[_0x2d01('0x2e')]=_0x205918;_0x35fa4f[_0x2d01('0x30')]=_0x58f560;_0x35fa4f['ringtime']=utils['getSeconds'](_0x35fa4f[_0x2d01('0x30')],_0x35fa4f[_0x2d01('0x2f')]);};exports[_0x2d01('0x33')]=function(_0x3a3c44,_0x505787,_0x36016d){_0x3a3c44['membername']=_0x505787;_0x3a3c44[_0x2d01('0x34')]=_0x36016d;};exports[_0x2d01('0x35')]=function(_0x485880,_0x319090,_0x1b6a40){var _0x1ba2d2=moment()['format'](_0x2d01('0x2c'));_0x485880[_0x2d01('0x2d')]=_0x319090;_0x485880['statedesc']=_0x1b6a40;_0x485880['responsetime']=_0x485880[_0x2d01('0x30')]?_0x485880['responsetime']:_0x1ba2d2;_0x485880[_0x2d01('0x31')]=_0x485880[_0x2d01('0x31')]?_0x485880['endtime']:_0x1ba2d2;_0x485880[_0x2d01('0x36')]=utils[_0x2d01('0x37')](_0x485880[_0x2d01('0x30')]||0x0,_0x485880[_0x2d01('0x2f')]||0x0);_0x485880[_0x2d01('0x38')]=_0x485880[_0x2d01('0x39')]?utils['getSeconds'](_0x485880[_0x2d01('0x31')],_0x485880[_0x2d01('0x39')]):0x0;};exports[_0x2d01('0x3a')]=function(_0x43cbf8){return _0x43cbf8===_0x2d01('0x3b');};exports['variablesAction']=function(_0x55bffb,_0x1d11cb,_0x2c7b48,_0x16c98b,_0x504bf2){var _0x24a560=_0x16c98b?'RECALL':_0x55bffb[_0x2d01('0x16')];_0x24a560=_0x504bf2?_0x2d01('0x3c'):_0x24a560;return{'actionid':_0x55bffb[_0x2d01('0x3d')],'action':_0x2d01('0x3e'),'channel':_0x55bffb[_0x2d01('0x3f')],'callerid':util['format']('\x22%s\x22\x20<%s>',_0x24a560,_0x55bffb['calleridnum']),'Exten':_0x2d01('0x21'),'Context':_0x2d01('0x40'),'Priority':'1','variable':_0x2c7b48,'timeout':(_0x1d11cb[_0x2d01('0x41')]||0x1e)*0x3e8,'async':!![],'channelid':_0x55bffb['uniqueid']};};exports[_0x2d01('0x42')]=function(_0x361543){return _0x361543[_0x2d01('0x43')]+_0x361543[_0x2d01('0x44')]+_0x361543['countnoanswerretry']+_0x361543[_0x2d01('0x45')]+_0x361543['countnosuchnumberretry'];};exports['cloneAction']=function(_0x4fed02){var _0x2e1da2=_[_0x2d01('0x46')](_0x4fed02);_0x2e1da2['state']=0xf;_0x2e1da2[_0x2d01('0x2e')]=_0x2d01('0x47');return _0x2e1da2;};exports[_0x2d01('0x48')]=function(_0x5ae824,_0x457352,_0x40c792){var _0x1f0d3e={};_0x1f0d3e[_0x457352]=_0x5ae824[_0x457352];_0x1f0d3e[_0x2d01('0x49')]=![];_0x1f0d3e[_0x2d01('0x4a')]=moment()[_0x2d01('0x4b')](_0x40c792,_0x2d01('0x4c'))['format'](_0x2d01('0x2c'));_0x1f0d3e[_0x2d01('0x17')]=_0x5ae824['ContactId'];_0x1f0d3e[_0x2d01('0x4d')]=_0x5ae824['ListId'];_0x1f0d3e[_0x2d01('0x4e')]=_0x5ae824[_0x2d01('0x4e')]||undefined;return _0x1f0d3e;};exports[_0x2d01('0x4f')]=function(_0x2ef052,_0x126062){if(!_[_0x2d01('0x27')](_0x2ef052)){if(_0x2ef052[_0x2d01('0x50')]>0x0){_0x2ef052[_0x2d01('0x50')]-=0x1;}else{logger[_0x2d01('0x5')](_0x126062,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x2d01('0x5')](_0x126062,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0x2d01('0x51')]=function(_0x2a09c6){if(_0x2a09c6<=0x0){return!![];}return![];};function buildObj(_0x4a3a46,_0x21e370,_0x5bf71b){_0x4a3a46[_0x2d01('0x52')]=_0x21e370;_0x4a3a46['name']=_0x4a3a46[_0x2d01('0x53')];_0x4a3a46[_0x2d01('0x54')]=_0x4a3a46[_0x2d01('0x3f')];_0x4a3a46[_0x2d01('0x55')]=_0x2d01('0x56');if(_0x5bf71b){_0x4a3a46[_0x2d01('0x57')]=_0x5bf71b[_0x2d01('0x57')];}return _0x4a3a46;}exports[_0x2d01('0x58')]=buildObj;exports['agentReadyId']=function(_0x306939){var _0xc8b299=[];for(var _0x4e0916 in _0x306939){if(_0x306939['hasOwnProperty'](_0x4e0916)){if(!_[_0x2d01('0x27')](_0x306939[_0x4e0916])&&_0x306939[_0x4e0916][_0x2d01('0x2d')]===_0x2d01('0x59')&&_0x306939[_0x4e0916][_0x2d01('0x5a')]===_0x2d01('0x5b')){_0xc8b299['push'](_0x306939[_0x4e0916]['id']);}}}return _0xc8b299;};exports[_0x2d01('0x5c')]=function(_0x3e737d){var _0x164e51=moment()[_0x2d01('0x5d')](0x0);var _0x4ed3db=moment(_0x3e737d)[_0x2d01('0x5d')](0x0);return _0x164e51['diff'](_0x4ed3db,_0x2d01('0x5e'));};exports[_0x2d01('0x5f')]=function(_0x531dce){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x531dce['ContactId'],'ListId':_0x531dce[_0x2d01('0x4d')],'VoiceQueueId':_0x531dce[_0x2d01('0x4e')]||undefined,'CampaignId':_0x531dce[_0x2d01('0x60')]||undefined};};exports[_0x2d01('0x61')]=function(_0xf5d5b){if(_0xf5d5b===_0x2d01('0x3d')||_0xf5d5b===_0x2d01('0x62')||_0xf5d5b===_0x2d01('0x53')||_0xf5d5b===_0x2d01('0x63')||_0xf5d5b===_0x2d01('0x64')||_0xf5d5b===_0x2d01('0x65')||_0xf5d5b===_0x2d01('0x66')||_0xf5d5b===_0x2d01('0x3f')||_0xf5d5b===_0x2d01('0x16')||_0xf5d5b===_0x2d01('0x49')||_0xf5d5b==='calleridnum'||_0xf5d5b===_0x2d01('0x4a')||_0xf5d5b===_0x2d01('0x43')||_0xf5d5b===_0x2d01('0x44')||_0xf5d5b===_0x2d01('0x67')||_0xf5d5b===_0x2d01('0x68')||_0xf5d5b===_0x2d01('0x69')||_0xf5d5b===_0x2d01('0x6a')||_0xf5d5b===_0x2d01('0x6b')||_0xf5d5b===_0x2d01('0x6c')||_0xf5d5b===_0x2d01('0x17')||_0xf5d5b==='ListId'||_0xf5d5b===_0x2d01('0x34')||_0xf5d5b===_0x2d01('0x4e')||_0xf5d5b===_0x2d01('0x6d')||_0xf5d5b==='xmd-voicequeueid'||_0xf5d5b===_0x2d01('0x6e')||_0xf5d5b===_0x2d01('0x6f')||_0xf5d5b===_0x2d01('0x70')||_0xf5d5b===_0x2d01('0x71')||_0xf5d5b===_0x2d01('0x72')||_0xf5d5b==='xmd-dialoptions'||_0xf5d5b===_0x2d01('0x73')||_0xf5d5b===_0x2d01('0x74')||_0xf5d5b===_0x2d01('0x75')||_0xf5d5b===_0x2d01('0x76')||_0xf5d5b===_0x2d01('0x77')||_0xf5d5b==='xmd-agiafter'||_0xf5d5b==='xmd-agi'||_0xf5d5b===_0x2d01('0x78')||_0xf5d5b===_0x2d01('0x79')||_0xf5d5b===_0x2d01('0x7a')||_0xf5d5b==='rtpaudioqosjitterbridged'||_0xf5d5b===_0x2d01('0x7b')||_0xf5d5b===_0x2d01('0x7c')||_0xf5d5b===_0x2d01('0x7d')||_0xf5d5b===_0x2d01('0x7e')||_0xf5d5b===_0x2d01('0x78')||_0xf5d5b===_0x2d01('0x79')||_0xf5d5b===_0x2d01('0x7a')||_0xf5d5b===_0x2d01('0x7f')||_0xf5d5b===_0x2d01('0x7b')||_0xf5d5b===_0x2d01('0x7c')||_0xf5d5b==='rtpaudioqosrtt'||_0xf5d5b==='rtpaudioqosrttbridged'||_0xf5d5b===_0x2d01('0x80')||_0xf5d5b===_0x2d01('0x81')||_0xf5d5b==='state'||_0xf5d5b===_0x2d01('0x2e')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x5aba62,_0x560fb4){var _0x198478,_0x56c712,_0x4de03f;if(_0x560fb4<=0x0){_0x560fb4=0x1;}_0x198478=new RegExp('\x5cw{0,'+_0x560fb4+'}$');_0x56c712=Math[_0x2d01('0x82')](0xa,_0x560fb4-0x1);_0x4de03f=Math[_0x2d01('0x82')](0xa,_0x560fb4)-0x1;return util[_0x2d01('0xf')]('%s',_[_0x2d01('0x83')](_0x5aba62,_0x198478,_['random'](_0x56c712,_0x4de03f)));};exports[_0x2d01('0x84')]=function(_0xd95260){var _0x3a97e3=_0xd95260[_0x2d01('0x85')](/"(.*?)"/);return _0x3a97e3?_0x3a97e3[0x1]:_0xd95260;};exports[_0x2d01('0x86')]=function(_0x32bad4){var _0x2518b8=_0x32bad4['match'](/<(.*?)>/);return _0x2518b8?_0x2518b8[0x1]:_0x32bad4;};function buildNoAnswerEventPayload(_0x18457f,_0x581f1b){var _0x3a4d3a=buildObj(_0x18457f,_0x2d01('0x87'));if(!_['isEmpty'](_0x581f1b[_0x2d01('0x88')])){Object[_0x2d01('0x89')](_0x581f1b[_0x2d01('0x88')])[_0x2d01('0x8a')](function(_0x16d4a2){_0x3a4d3a[_0x16d4a2[_0x2d01('0x8b')]()]=_0x581f1b[_0x2d01('0x88')][_0x16d4a2];});}return _0x3a4d3a;}exports[_0x2d01('0x8c')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0xf3bb=['minutes','ListId','VoiceQueueId','decrementTalkink','pTalking','IsNotLoggedIn','lastevent','queue','motionChannel','voice','mandatoryDisposition','buildObj','agentReadyId','not_inuse','status','reachable','getDiff','milliseconds','diff','createBody','CampaignId','filterKey','type','dialAnswer','calleridname','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','bridgepvtcallid','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','noanswer','variables','keys','forEach','toLowerCase','util','lodash','moment','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','loggerCatch','inspect','logger','info','loggerError','logger2','message','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','isActive','addVariables','Queue','name','calleridnum','ContactId','dialOriginateTimeout','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','originatecalleridnum','xcally-motion-preview','Call-Type:\x20PREVIEW','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','isNil','hasOwnProperty','originated','error','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','state','starttime','responsetime','endtime','logAgent','statedesc','logLookAgent','membername','UserId','logCustomer','getSeconds','answertime','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','active','scheduledat','add'];(function(_0x456200,_0x3d4c03){var _0x551f2e=function(_0x807f2d){while(--_0x807f2d){_0x456200['push'](_0x456200['shift']());}};_0x551f2e(++_0x3d4c03);}(_0xf3bb,0x15a));var _0xbf3b=function(_0x5c061b,_0x1f0786){_0x5c061b=_0x5c061b-0x0;var _0x5ade92=_0xf3bb[_0x5c061b];return _0x5ade92;};'use strict';var util=require(_0xbf3b('0x0'));var _=require(_0xbf3b('0x1'));var moment=require(_0xbf3b('0x2'));var logger=require('../../../../config/logger')('preview');var ipAgi=process['env'][_0xbf3b('0x3')]||_0xbf3b('0x4');var utils=require(_0xbf3b('0x5'));exports[_0xbf3b('0x6')]=function(_0x2e7653){return function(_0x35081c){logger['error'](_0x2e7653,util[_0xbf3b('0x7')](_0x35081c,{'showHidden':![],'depth':null}));};};exports[_0xbf3b('0x8')]=function(_0x183351,_0x45ca4c){logger[_0xbf3b('0x9')](_0x183351,util[_0xbf3b('0x7')](_0x45ca4c,{'showHidden':![],'depth':null}));};exports[_0xbf3b('0xa')]=function(_0x3bf2be,_0x1eace9){logger['error'](_0x3bf2be,util[_0xbf3b('0x7')](_0x1eace9,{'showHidden':![],'depth':null}));};exports[_0xbf3b('0xb')]=function(_0x2ad56e){return function(_0x2047d0){logger[_0xbf3b('0x9')](_0x2ad56e,util['inspect'](_0x2047d0,{'showHidden':![],'depth':null}));};};exports[_0xbf3b('0xc')]=function(_0xc82b3d,_0xc4882e,_0x2dfdb1){return{'message':_0xc82b3d,'unlock':_0xc4882e,'active':_0x2dfdb1};};exports[_0xbf3b('0xd')]=function(_0x305a84,_0x44dce5,_0x4d7aa3){if(!_[_0xbf3b('0xe')](_0x4d7aa3)&&'string'===typeof _0x4d7aa3&&!_['isEmpty'](_0x4d7aa3)){if(!_[_0xbf3b('0xe')](_0x44dce5)&&_0xbf3b('0xf')===typeof _0x44dce5&&!_[_0xbf3b('0x10')](_0x44dce5)){return util['format'](_0xbf3b('0x11'),_0x44dce5,_0x4d7aa3);}return util[_0xbf3b('0x12')]('\x22%s\x22\x20<%s>',_0x4d7aa3,_0x4d7aa3);}if(!_['isUndefined'](_0x305a84)&&_0xbf3b('0xf')===typeof _0x305a84&&!_[_0xbf3b('0x10')](_0x305a84)){return _0x305a84;}return _0xbf3b('0x13');};exports[_0xbf3b('0x14')]=function(_0x29f702){if(_['isNil'](_0x29f702)){return![];}return _0x29f702;};exports[_0xbf3b('0x15')]=function(_0x589064,_0x3467eb,_0x1ff995,_0x14a5af,_0x4c82c8,_0xa7ebc8){var _0x4b38cd={'XMD-QUEUE':_0x3467eb[_0xbf3b('0x16')]?_0x3467eb[_0xbf3b('0x16')][_0xbf3b('0x17')]:'','XMD-CALLERID':_0x14a5af,'XMD-CALLERID-PREVIEW':_0xa7ebc8?util[_0xbf3b('0x12')](_0xbf3b('0x11'),_0xa7ebc8['calleridname'],_0xa7ebc8[_0xbf3b('0x18')]):_0x14a5af,'XMD-DIALID':_0x4c82c8,'XMD-CONTACTID':_0x3467eb[_0xbf3b('0x19')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x14a5af,'XMD-VOICEQUEUEID':_0x3467eb['VoiceQueueId'],'XMD-DIALCHANNEL':_0x1ff995,'XMD-DIALTIMEOUT':_0x589064[_0xbf3b('0x1a')]||0x1e,'XMD-DIALOPTIONS':util[_0xbf3b('0x12')]('\x22rtTxX%s%s\x22',_0x589064[_0xbf3b('0x1b')]?'g':'',_[_0xbf3b('0x10')](_0x589064['monitor_format'])?'':_0xbf3b('0x1c')),'XMD-DIALURL':_0x589064[_0xbf3b('0x1d')]||'','XMD-AGI':_0x589064[_0xbf3b('0x1e')]?util[_0xbf3b('0x12')](_0xbf3b('0x1f'),ipAgi,_0x589064[_0xbf3b('0x1e')]):'NONE','XMD-AGIAFTER':_0x589064[_0xbf3b('0x1b')]?util[_0xbf3b('0x12')](_0xbf3b('0x1f'),ipAgi,_0x589064[_0xbf3b('0x1b')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0xa7ebc8?_0xa7ebc8[_0xbf3b('0x20')]:'','XMD-ORIGINATECALLERIDNAME':_0xa7ebc8?_0xa7ebc8['originatecalleridname']:'','XMD-DESTINATION':_0xbf3b('0x21'),'SIPADDHEADER':_0xbf3b('0x22')};if(!_[_0xbf3b('0x10')](_0x589064[_0xbf3b('0x23')])){_0x4b38cd[util[_0xbf3b('0x12')]('%s',_0xbf3b('0x24'))]=_0x589064[_0xbf3b('0x23')];_0x4b38cd[util[_0xbf3b('0x12')]('%s',_0xbf3b('0x25'))]=_0x4c82c8;}return _0x4b38cd;};exports['toLowerVariables']=function(_0x32bb1f){var _0x3928f9={};for(var _0x3a22b2 in _0x32bb1f){if(_0x32bb1f['hasOwnProperty'](_0x3a22b2)){_0x3928f9[util['format']('%s',_['toLower'](_0x3a22b2))]=_0x32bb1f[_0x3a22b2];}}return{'variables':_0x3928f9};};exports['updateOriginated']=function(_0x385f4f,_0x53b146){if(!_[_0xbf3b('0x26')](_0x385f4f)){if(_0x385f4f[_0xbf3b('0x27')](_0xbf3b('0x28'))){if(_0x385f4f[_0xbf3b('0x28')]>0x0){_0x385f4f['originated']-=0x1;}else{logger[_0xbf3b('0x29')](_0xbf3b('0x2a'),_0x53b146);}}}else{logger['error'](_0xbf3b('0x2b'),_0x53b146);}};exports['logBlacklist']=function(_0x2b7a50){var _0x375c59=moment()[_0xbf3b('0x12')](_0xbf3b('0x2c'));_0x2b7a50[_0xbf3b('0x2d')]=0xd;_0x2b7a50['statedesc']='Blacklist';_0x2b7a50[_0xbf3b('0x2e')]=_0x375c59;_0x2b7a50[_0xbf3b('0x2f')]=_0x375c59;_0x2b7a50[_0xbf3b('0x30')]=_0x375c59;};exports[_0xbf3b('0x31')]=function(_0x32cfce,_0x12c8bf,_0x451f64){var _0x240a13=moment()[_0xbf3b('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x32cfce['state']=_0x12c8bf;_0x32cfce[_0xbf3b('0x32')]=_0x451f64;_0x32cfce[_0xbf3b('0x2f')]=_0x240a13;_0x32cfce['ringtime']=utils['getSeconds'](_0x32cfce[_0xbf3b('0x2f')],_0x32cfce[_0xbf3b('0x2e')]);};exports[_0xbf3b('0x33')]=function(_0x119091,_0xe13660,_0xd3bf8){_0x119091[_0xbf3b('0x34')]=_0xe13660;_0x119091[_0xbf3b('0x35')]=_0xd3bf8;};exports[_0xbf3b('0x36')]=function(_0x1a0468,_0x33445f,_0x5b915f){var _0xe7a614=moment()[_0xbf3b('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x1a0468[_0xbf3b('0x2d')]=_0x33445f;_0x1a0468[_0xbf3b('0x32')]=_0x5b915f;_0x1a0468[_0xbf3b('0x2f')]=_0x1a0468['responsetime']?_0x1a0468[_0xbf3b('0x2f')]:_0xe7a614;_0x1a0468['endtime']=_0x1a0468[_0xbf3b('0x30')]?_0x1a0468[_0xbf3b('0x30')]:_0xe7a614;_0x1a0468['ringtime']=utils[_0xbf3b('0x37')](_0x1a0468[_0xbf3b('0x2f')]||0x0,_0x1a0468[_0xbf3b('0x2e')]||0x0);_0x1a0468['talktime']=_0x1a0468[_0xbf3b('0x38')]?utils['getSeconds'](_0x1a0468[_0xbf3b('0x30')],_0x1a0468['answertime']):0x0;};exports['isFailure']=function(_0xe55206){return _0xe55206==='Failure';};exports[_0xbf3b('0x39')]=function(_0xd46a77,_0x2ca092,_0x1c313d,_0x13db0c,_0x138c6f){var _0x1104ab=_0x13db0c?_0xbf3b('0x3a'):_0xd46a77['calleridname'];_0x1104ab=_0x138c6f?_0xbf3b('0x3b'):_0x1104ab;return{'actionid':_0xd46a77[_0xbf3b('0x3c')],'action':_0xbf3b('0x3d'),'channel':_0xd46a77[_0xbf3b('0x3e')],'callerid':util['format'](_0xbf3b('0x11'),_0x1104ab,_0xd46a77[_0xbf3b('0x18')]),'Exten':_0xbf3b('0x21'),'Context':_0xbf3b('0x3f'),'Priority':'1','variable':_0x1c313d,'timeout':(_0x2ca092[_0xbf3b('0x40')]||0x1e)*0x3e8,'async':!![],'channelid':_0xd46a77['uniqueid']};};exports['totalGlobal']=function(_0x51242e){return _0x51242e[_0xbf3b('0x41')]+_0x51242e[_0xbf3b('0x42')]+_0x51242e[_0xbf3b('0x43')]+_0x51242e[_0xbf3b('0x44')]+_0x51242e[_0xbf3b('0x45')];};exports[_0xbf3b('0x46')]=function(_0x54908d){var _0x37d1f6=_['clone'](_0x54908d);_0x37d1f6[_0xbf3b('0x2d')]=0xf;_0x37d1f6[_0xbf3b('0x32')]='Global';return _0x37d1f6;};exports['scheduledAt']=function(_0x361fad,_0xef1877,_0x4b7f80){var _0x5e0dd2={};_0x5e0dd2[_0xef1877]=_0x361fad[_0xef1877];_0x5e0dd2[_0xbf3b('0x47')]=![];_0x5e0dd2[_0xbf3b('0x48')]=moment()[_0xbf3b('0x49')](_0x4b7f80,_0xbf3b('0x4a'))[_0xbf3b('0x12')](_0xbf3b('0x2c'));_0x5e0dd2[_0xbf3b('0x19')]=_0x361fad[_0xbf3b('0x19')];_0x5e0dd2[_0xbf3b('0x4b')]=_0x361fad[_0xbf3b('0x4b')];_0x5e0dd2[_0xbf3b('0x4c')]=_0x361fad[_0xbf3b('0x4c')]||undefined;return _0x5e0dd2;};exports[_0xbf3b('0x4d')]=function(_0x50e7d1,_0x159949){if(!_[_0xbf3b('0x26')](_0x50e7d1)){if(_0x50e7d1[_0xbf3b('0x4e')]>0x0){_0x50e7d1[_0xbf3b('0x4e')]-=0x1;}else{logger[_0xbf3b('0x29')](_0x159949,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0xbf3b('0x29')](_0x159949,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0xbf3b('0x4f')]=function(_0x968c0b){if(_0x968c0b<=0x0){return!![];}return![];};function buildObj(_0x47829d,_0x2df6e2,_0x5986c8){_0x47829d[_0xbf3b('0x50')]=_0x2df6e2;_0x47829d[_0xbf3b('0x17')]=_0x47829d[_0xbf3b('0x51')];_0x47829d['interface']=_0x47829d[_0xbf3b('0x3e')];_0x47829d[_0xbf3b('0x52')]=_0xbf3b('0x53');if(_0x5986c8){_0x47829d['mandatoryDisposition']=_0x5986c8[_0xbf3b('0x54')];}return _0x47829d;}exports[_0xbf3b('0x55')]=buildObj;exports[_0xbf3b('0x56')]=function(_0x20e4d9){var _0x5b7f48=[];for(var _0x42999d in _0x20e4d9){if(_0x20e4d9['hasOwnProperty'](_0x42999d)){if(!_['isNil'](_0x20e4d9[_0x42999d])&&_0x20e4d9[_0x42999d][_0xbf3b('0x2d')]===_0xbf3b('0x57')&&_0x20e4d9[_0x42999d][_0xbf3b('0x58')]===_0xbf3b('0x59')){_0x5b7f48['push'](_0x20e4d9[_0x42999d]['id']);}}}return _0x5b7f48;};exports[_0xbf3b('0x5a')]=function(_0x2e8aed){var _0x431333=moment()['milliseconds'](0x0);var _0x4606ef=moment(_0x2e8aed)[_0xbf3b('0x5b')](0x0);return _0x431333[_0xbf3b('0x5c')](_0x4606ef,'seconds');};exports[_0xbf3b('0x5d')]=function(_0x17dca8){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x17dca8[_0xbf3b('0x19')],'ListId':_0x17dca8[_0xbf3b('0x4b')],'VoiceQueueId':_0x17dca8[_0xbf3b('0x4c')]||undefined,'CampaignId':_0x17dca8[_0xbf3b('0x5e')]||undefined};};exports[_0xbf3b('0x5f')]=function(_0x39e306){if(_0x39e306===_0xbf3b('0x3c')||_0x39e306==='idContact'||_0x39e306===_0xbf3b('0x51')||_0x39e306===_0xbf3b('0x60')||_0x39e306==='campaigntype'||_0x39e306===_0xbf3b('0x61')||_0x39e306===_0xbf3b('0x34')||_0x39e306==='channelAgent'||_0x39e306===_0xbf3b('0x62')||_0x39e306==='active'||_0x39e306===_0xbf3b('0x18')||_0x39e306===_0xbf3b('0x48')||_0x39e306===_0xbf3b('0x41')||_0x39e306===_0xbf3b('0x42')||_0x39e306===_0xbf3b('0x43')||_0x39e306===_0xbf3b('0x63')||_0x39e306===_0xbf3b('0x64')||_0x39e306===_0xbf3b('0x65')||_0x39e306===_0xbf3b('0x66')||_0x39e306===_0xbf3b('0x67')||_0x39e306===_0xbf3b('0x19')||_0x39e306===_0xbf3b('0x4b')||_0x39e306===_0xbf3b('0x35')||_0x39e306==='VoiceQueueId'||_0x39e306===_0xbf3b('0x68')||_0x39e306===_0xbf3b('0x69')||_0x39e306===_0xbf3b('0x6a')||_0x39e306===_0xbf3b('0x6b')||_0x39e306===_0xbf3b('0x6c')||_0x39e306===_0xbf3b('0x6d')||_0x39e306===_0xbf3b('0x6e')||_0x39e306===_0xbf3b('0x6f')||_0x39e306===_0xbf3b('0x70')||_0x39e306===_0xbf3b('0x71')||_0x39e306===_0xbf3b('0x72')||_0x39e306===_0xbf3b('0x73')||_0x39e306===_0xbf3b('0x74')||_0x39e306===_0xbf3b('0x75')||_0x39e306===_0xbf3b('0x76')||_0x39e306===_0xbf3b('0x77')||_0x39e306===_0xbf3b('0x78')||_0x39e306===_0xbf3b('0x79')||_0x39e306==='rtpaudioqosjitterbridged'||_0x39e306===_0xbf3b('0x7a')||_0x39e306==='rtpaudioqoslossbridged'||_0x39e306===_0xbf3b('0x7b')||_0x39e306===_0xbf3b('0x7c')||_0x39e306===_0xbf3b('0x77')||_0x39e306===_0xbf3b('0x78')||_0x39e306===_0xbf3b('0x79')||_0x39e306===_0xbf3b('0x7d')||_0x39e306===_0xbf3b('0x7a')||_0x39e306===_0xbf3b('0x7e')||_0x39e306===_0xbf3b('0x7b')||_0x39e306===_0xbf3b('0x7c')||_0x39e306==='bridgepeer'||_0x39e306===_0xbf3b('0x7f')||_0x39e306==='state'||_0x39e306==='statedesc'){return![];}return!![];};exports['getCallerIdRandom']=function(_0x1818b6,_0x11b409){var _0x22148e,_0x511b38,_0x381425;if(_0x11b409<=0x0){_0x11b409=0x1;}_0x22148e=new RegExp(_0xbf3b('0x80')+_0x11b409+'}$');_0x511b38=Math['pow'](0xa,_0x11b409-0x1);_0x381425=Math[_0xbf3b('0x81')](0xa,_0x11b409)-0x1;return util[_0xbf3b('0x12')]('%s',_[_0xbf3b('0x82')](_0x1818b6,_0x22148e,_[_0xbf3b('0x83')](_0x511b38,_0x381425)));};exports[_0xbf3b('0x84')]=function(_0x223e6f){var _0x225c0a=_0x223e6f[_0xbf3b('0x85')](/"(.*?)"/);return _0x225c0a?_0x225c0a[0x1]:_0x223e6f;};exports[_0xbf3b('0x86')]=function(_0xc745ae){var _0x5563b2=_0xc745ae[_0xbf3b('0x85')](/<(.*?)>/);return _0x5563b2?_0x5563b2[0x1]:_0xc745ae;};function buildNoAnswerEventPayload(_0x1d1247,_0x444497){var _0x42f4b2=buildObj(_0x1d1247,_0xbf3b('0x87'));if(!_['isEmpty'](_0x444497[_0xbf3b('0x88')])){Object[_0xbf3b('0x89')](_0x444497['variables'])[_0xbf3b('0x8a')](function(_0x50fa61){_0x42f4b2[_0x50fa61[_0xbf3b('0x8b')]()]=_0x444497[_0xbf3b('0x88')][_0x50fa61];});}return _0x42f4b2;}exports['buildNoAnswerEventPayload']=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index cd99863..a75cc39 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 _0x2fd5=['queuepause','reload','voicequeuechannelredirect','string','number','boolean','queueremove'];(function(_0x5a2a2a,_0x2c3d87){var _0x57ee23=function(_0x57031d){while(--_0x57031d){_0x5a2a2a['push'](_0x5a2a2a['shift']());}};_0x57ee23(++_0x2c3d87);}(_0x2fd5,0x168));var _0x52fd=function(_0x491610,_0x3b61a2){_0x491610=_0x491610-0x0;var _0x5d6718=_0x2fd5[_0x491610];return _0x5d6718;};'use strict';exports['queueadd']={'queue':{'type':_0x52fd('0x0'),'required':!![]},'interface':{'type':_0x52fd('0x0'),'required':!![]},'membername':{'type':_0x52fd('0x0'),'required':!![]},'penalty':{'type':_0x52fd('0x1'),'required':![]},'paused':{'type':_0x52fd('0x2'),'required':![]}};exports[_0x52fd('0x3')]={'queue':{'type':_0x52fd('0x0'),'required':!![]},'interface':{'type':_0x52fd('0x0'),'required':!![]}};exports[_0x52fd('0x4')]={'interface':{'type':_0x52fd('0x0'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0x52fd('0x0'),'required':![]}};exports[_0x52fd('0x5')]={'module':{'type':_0x52fd('0x0'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x52fd('0x0'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x52fd('0x0'),'required':!![]},'filename':{'type':_0x52fd('0x0')},'format':{'type':_0x52fd('0x0')},'mixmonitorid':{'type':_0x52fd('0x0')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0x52fd('0x0'),'required':!![]}};exports[_0x52fd('0x6')]={'uniqueid':{'type':_0x52fd('0x0'),'required':!![]},'exten':{'type':_0x52fd('0x0'),'required':!![]},'context':{'type':'string'}}; \ No newline at end of file +var _0x8357=['queuepause','reload','voicequeuechannel','voicechannel','voicequeuechannelredirect','queueadd','string','boolean'];(function(_0x94d236,_0x522c3e){var _0x2b82f7=function(_0x39df09){while(--_0x39df09){_0x94d236['push'](_0x94d236['shift']());}};_0x2b82f7(++_0x522c3e);}(_0x8357,0x18d));var _0x7835=function(_0xd1428f,_0x3e332f){_0xd1428f=_0xd1428f-0x0;var _0x4566a9=_0x8357[_0xd1428f];return _0x4566a9;};'use strict';exports[_0x7835('0x0')]={'queue':{'type':_0x7835('0x1'),'required':!![]},'interface':{'type':_0x7835('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0x7835('0x2'),'required':![]}};exports['queueremove']={'queue':{'type':'string','required':!![]},'interface':{'type':'string','required':!![]}};exports[_0x7835('0x3')]={'interface':{'type':_0x7835('0x1'),'required':!![]},'paused':{'type':_0x7835('0x2')},'reason':{'type':'string','required':![]}};exports[_0x7835('0x4')]={'module':{'type':_0x7835('0x1'),'required':![]}};exports[_0x7835('0x5')]={'uniqueid':{'type':_0x7835('0x1'),'required':!![]}};exports[_0x7835('0x6')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x7835('0x1')},'format':{'type':_0x7835('0x1')},'mixmonitorid':{'type':'string'}};exports['voicequeuechannelhangup']={'uniqueid':{'type':'string','required':!![]}};exports[_0x7835('0x7')]={'uniqueid':{'type':_0x7835('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0x7835('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 2f38a12..ef56415 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 _0x2032=['voiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','exports','moment','util','../model/agent','../model/trunk','../model/voiceQueue','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/faxAccount','telephones','trunks','voiceQueues','campaigns','outbound','channels','queueChannels','sugarcrmAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','format','SIP/%s','name','hasOwnProperty','interface','total','answered','sumHoldTime','sumDuration','sumBillable','ivrTotalCallsDays','isEmpty','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundReCallsDay','queueStatusComplete','prototype','length','isNil','isUndefined','agents','initTelephones','initTrunks','mergeFromDatabase','initTriggers','triggers','initTemplates','templates','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2032,0xd9));var _0x2203=function(_0x4beecc,_0x1dc796){_0x4beecc=_0x4beecc-0x0;var _0x238fc5=_0x2032[_0x4beecc];return _0x238fc5;};'use strict';var _=require('lodash');var moment=require(_0x2203('0x0'));var util=require(_0x2203('0x1'));var Agent=require(_0x2203('0x2'));var Telephone=require('../model/telephone');var Trunk=require(_0x2203('0x3'));var VoiceQueue=require(_0x2203('0x4'));var Trigger=require('../model/trigger');var Template=require(_0x2203('0x5'));var Campaign=require(_0x2203('0x6'));var VoiceExtension=require(_0x2203('0x7'));var ZendeskAccount=require(_0x2203('0x8'));var SalesforceAccount=require(_0x2203('0x9'));var FreshdeskAccount=require(_0x2203('0xa'));var SugarcrmAccount=require(_0x2203('0xb'));var ZohoAccount=require(_0x2203('0xc'));var DeskAccount=require(_0x2203('0xd'));var VtigerAccount=require(_0x2203('0xe'));var ServicenowAccount=require(_0x2203('0xf'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0x2203('0x10'));function Realtime(){this['agents']={};this[_0x2203('0x11')]={};this[_0x2203('0x12')]={};this[_0x2203('0x13')]={};this['triggers']={};this[_0x2203('0x14')]={};this['templates']={};this[_0x2203('0x15')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x2203('0x16')]={};this[_0x2203('0x17')]={};this['outboundChannels']={};this['timers']={};this['settings']={};this['zendeskAccounts']={};this['salesforceAccounts']={};this[_0x2203('0x18')]={};this['freshdeskAccounts']={};this['zohoAccounts']={};this[_0x2203('0x19')]={};this[_0x2203('0x1a')]={};this[_0x2203('0x1b')]={};this[_0x2203('0x1c')]={};this[_0x2203('0x1d')]={};this[_0x2203('0x1e')]={};}function freeIsNotKey(_0x2c36e6,_0x2c085c,_0xdf9d0b){var _0x3053f3=_['mapKeys'](_0x2c36e6,function(_0x280eda){return _0x280eda[_0xdf9d0b];});for(var _0x2ee127 in _0x2c085c){if(_0x2c085c['hasOwnProperty'](_0x2ee127)){if(!_0x3053f3[_0x2ee127]){delete _0x2c085c[_0x2ee127];}}}}function freeIsNotKeySip(_0x3f9ef6,_0x8906e1){var _0x4aeb9f=_[_0x2203('0x1f')](_0x3f9ef6,function(_0x5ee83c){return util[_0x2203('0x20')](_0x2203('0x21'),_0x5ee83c[_0x2203('0x22')]);});for(var _0x3b4034 in _0x8906e1){if(_0x8906e1[_0x2203('0x23')](_0x3b4034)){if(!_0x4aeb9f[_0x3b4034]){delete _0x8906e1[_0x3b4034];}}}}function freeIsNotKeyAgent(_0x449039,_0x538c23){var _0x13d3f7=_['mapKeys'](_0x449039,function(_0x5ac866){var _0x15f543=_['isNil'](_0x5ac866[_0x2203('0x24')])?util[_0x2203('0x20')]('SIP/%s',_0x5ac866[_0x2203('0x22')]):_0x5ac866['interface'];return _0x15f543;});for(var _0x5c8da9 in _0x538c23){if(_0x538c23[_0x2203('0x23')](_0x5c8da9)){if(!_0x13d3f7[_0x5c8da9]){delete _0x538c23[_0x5c8da9];}}}}function clearVoiceCallReports(_0x2718f5){_0x2718f5[_0x2203('0x25')]=0x0;_0x2718f5[_0x2203('0x26')]=0x0;_0x2718f5[_0x2203('0x27')]=0x0;_0x2718f5[_0x2203('0x28')]=0x0;_0x2718f5[_0x2203('0x29')]=0x0;}function clearCampaigns(_0x250349){if(!_['isEmpty'](_0x250349)){for(var _0x143f41 in _0x250349){if(_0x250349[_0x2203('0x23')](_0x143f41)){_0x250349[_0x143f41][_0x2203('0x2a')]=0x0;_0x250349[_0x143f41]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0xb2071b){if(!_[_0x2203('0x2b')](_0xb2071b)){for(var _0x5c5fd3 in _0xb2071b){if(_0xb2071b[_0x2203('0x23')](_0x5c5fd3)){_0xb2071b[_0x5c5fd3][_0x2203('0x25')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x26')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2c')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2d')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x27')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x28')]=0x0;_0xb2071b[_0x5c5fd3]['sumBillable']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2e')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2f')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x30')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x31')]=0x0;_0xb2071b[_0x5c5fd3]['outboundNoSuchCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x32')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x33')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x34')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x35')]=0x0;_0xb2071b[_0x5c5fd3]['outboundOriginateFailureCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x36')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x37')]=0x0;_0xb2071b[_0x5c5fd3]['outboundAnswerAgiCallsDay']=0x0;_0xb2071b[_0x5c5fd3]['outboundAnswerCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x38')]=!![];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x125dfc,_0x464c88){for(var _0x191894 in _0x464c88){if(_0x125dfc[_0x2203('0x23')](_0x191894)){_0x125dfc[_0x191894]=_0x464c88[_0x191894];}}};Realtime[_0x2203('0x39')]['initAgents']=function(){var _0xb22e28=this;return function(_0x2324c0){if(_0x2324c0){freeIsNotKeyAgent(_0x2324c0,_0xb22e28['agents']);for(var _0x2a2ee7=0x0,_0x20fbe1={};_0x2a2ee7<_0x2324c0[_0x2203('0x3a')];_0x2a2ee7+=0x1){_0x20fbe1=_0x2324c0[_0x2a2ee7];var _0x4187b4=_[_0x2203('0x3b')](_0x20fbe1[_0x2203('0x24')])?util[_0x2203('0x20')](_0x2203('0x21'),_0x20fbe1[_0x2203('0x22')]):_0x20fbe1['interface'];if(_[_0x2203('0x3c')](_0xb22e28[_0x2203('0x3d')][_0x4187b4])){_0xb22e28['agents'][_0x4187b4]=new Agent(_0x20fbe1);}else{_0xb22e28['mergeFromDatabase'](_0xb22e28[_0x2203('0x3d')][_0x4187b4],_0x20fbe1);}}}return _0xb22e28['agents'];};};Realtime[_0x2203('0x39')][_0x2203('0x3e')]=function(){var _0x127ee3=this;return function(_0x5221f0){if(_0x5221f0){freeIsNotKeySip(_0x5221f0,_0x127ee3['telephones']);for(var _0x34cdeb=0x0,_0x47c93a={};_0x34cdeb<_0x5221f0[_0x2203('0x3a')];_0x34cdeb+=0x1){_0x47c93a=_0x5221f0[_0x34cdeb];if(_['isUndefined'](_0x127ee3[_0x2203('0x11')][util['format'](_0x2203('0x21'),_0x47c93a[_0x2203('0x22')])])){_0x127ee3[_0x2203('0x11')][util[_0x2203('0x20')](_0x2203('0x21'),_0x47c93a['name'])]=new Telephone(_0x47c93a);}else{_0x127ee3['mergeFromDatabase'](_0x127ee3['telephones'][util[_0x2203('0x20')](_0x2203('0x21'),_0x47c93a[_0x2203('0x22')])],_0x47c93a);}}}return _0x127ee3[_0x2203('0x11')];};};Realtime[_0x2203('0x39')][_0x2203('0x3f')]=function(){var _0x1c7e3d=this;return function(_0x590b4e){if(_0x590b4e){freeIsNotKeySip(_0x590b4e,_0x1c7e3d[_0x2203('0x12')]);for(var _0x1b12c3=0x0,_0x108fde={};_0x1b12c3<_0x590b4e[_0x2203('0x3a')];_0x1b12c3+=0x1){_0x108fde=_0x590b4e[_0x1b12c3];if(_['isUndefined'](_0x1c7e3d['trunks'][util[_0x2203('0x20')]('SIP/%s',_0x108fde[_0x2203('0x22')])])){_0x1c7e3d[_0x2203('0x12')][util[_0x2203('0x20')]('SIP/%s',_0x108fde['name'])]=new Trunk(_0x108fde);}else{_0x1c7e3d[_0x2203('0x40')](_0x1c7e3d[_0x2203('0x12')][util[_0x2203('0x20')](_0x2203('0x21'),_0x108fde[_0x2203('0x22')])],_0x108fde);}}}return _0x1c7e3d[_0x2203('0x12')];};};Realtime['prototype'][_0x2203('0x41')]=function(){var _0x165a3f=this;return function(_0x3a866c){if(_0x3a866c){freeIsNotKey(_0x3a866c,_0x165a3f[_0x2203('0x42')],'id');for(var _0x16b452=0x0,_0x36b99f={};_0x16b452<_0x3a866c[_0x2203('0x3a')];_0x16b452+=0x1){_0x36b99f=_0x3a866c[_0x16b452];if(_[_0x2203('0x3c')](_0x165a3f[_0x2203('0x42')][_0x36b99f['id']])){_0x165a3f[_0x2203('0x42')][_0x36b99f['id']]=new Trigger(_0x36b99f);}else{_0x165a3f['mergeFromDatabase'](_0x165a3f[_0x2203('0x42')][_0x36b99f['id']],_0x36b99f);}}}return _0x165a3f[_0x2203('0x42')];};};Realtime[_0x2203('0x39')][_0x2203('0x43')]=function(){var _0x4c3259=this;return function(_0x58bd5c){if(_0x58bd5c){freeIsNotKey(_0x58bd5c,_0x4c3259[_0x2203('0x44')],'id');for(var _0x48129c=0x0,_0x273e5f={};_0x48129c<_0x58bd5c[_0x2203('0x3a')];_0x48129c+=0x1){_0x273e5f=_0x58bd5c[_0x48129c];if(_[_0x2203('0x3c')](_0x4c3259[_0x2203('0x44')][_0x273e5f['id']])){_0x4c3259['templates'][_0x273e5f['id']]=new Template(_0x273e5f);}else{_0x4c3259[_0x2203('0x40')](_0x4c3259[_0x2203('0x44')][_0x273e5f['id']],_0x273e5f);}}}return _0x4c3259['templates'];};};Realtime[_0x2203('0x39')][_0x2203('0x45')]=function(){var _0x35b2e9=this;return function(_0x2600a9){if(_0x2600a9){freeIsNotKey(_0x2600a9,_0x35b2e9['zendeskAccounts'],'id');for(var _0x4c1a29=0x0,_0x21b8ab={};_0x4c1a29<_0x2600a9['length'];_0x4c1a29+=0x1){_0x21b8ab=_0x2600a9[_0x4c1a29];if(_['isUndefined'](_0x35b2e9[_0x2203('0x46')][_0x21b8ab['id']])){_0x35b2e9[_0x2203('0x46')][_0x21b8ab['id']]=new ZendeskAccount(_0x21b8ab);}else{_0x35b2e9[_0x2203('0x40')](_0x35b2e9['zendeskAccounts'][_0x21b8ab['id']],_0x21b8ab);}}}return _0x35b2e9['zendeskAccounts'];};};Realtime[_0x2203('0x39')][_0x2203('0x47')]=function(){var _0x12d7fa=this;return function(_0x21d2d7){if(_0x21d2d7){freeIsNotKey(_0x21d2d7,_0x12d7fa[_0x2203('0x48')],'id');for(var _0x21fd78=0x0,_0x4a7f4e={};_0x21fd78<_0x21d2d7[_0x2203('0x3a')];_0x21fd78+=0x1){_0x4a7f4e=_0x21d2d7[_0x21fd78];if(_['isUndefined'](_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']])){_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']]=new SalesforceAccount(_0x4a7f4e);}else{_0x12d7fa[_0x2203('0x40')](_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']],_0x4a7f4e);}}}return _0x12d7fa['salesforceAccounts'];};};Realtime['prototype'][_0x2203('0x49')]=function(){var _0x1f772d=this;return function(_0x126aad){if(_0x126aad){freeIsNotKey(_0x126aad,_0x1f772d[_0x2203('0x4a')],'id');for(var _0x559370=0x0,_0x4de47a={};_0x559370<_0x126aad['length'];_0x559370+=0x1){_0x4de47a=_0x126aad[_0x559370];if(_[_0x2203('0x3c')](_0x1f772d[_0x2203('0x4a')][_0x4de47a['id']])){_0x1f772d['freshdeskAccounts'][_0x4de47a['id']]=new FreshdeskAccount(_0x4de47a);}else{_0x1f772d[_0x2203('0x40')](_0x1f772d[_0x2203('0x4a')][_0x4de47a['id']],_0x4de47a);}}}return _0x1f772d['freshdeskAccounts'];};};Realtime[_0x2203('0x39')][_0x2203('0x4b')]=function(){var _0x172c6a=this;return function(_0x6a1877){if(_0x6a1877){freeIsNotKey(_0x6a1877,_0x172c6a['zohoAccounts'],'id');for(var _0x120db1=0x0,_0x5268d6={};_0x120db1<_0x6a1877[_0x2203('0x3a')];_0x120db1+=0x1){_0x5268d6=_0x6a1877[_0x120db1];if(_[_0x2203('0x3c')](_0x172c6a['zohoAccounts'][_0x5268d6['id']])){_0x172c6a[_0x2203('0x4c')][_0x5268d6['id']]=new ZohoAccount(_0x5268d6);}else{_0x172c6a[_0x2203('0x40')](_0x172c6a[_0x2203('0x4c')][_0x5268d6['id']],_0x5268d6);}}}return _0x172c6a[_0x2203('0x4c')];};};Realtime[_0x2203('0x39')][_0x2203('0x4d')]=function(){var _0x569d4a=this;return function(_0x562a3d){if(_0x562a3d){freeIsNotKey(_0x562a3d,_0x569d4a[_0x2203('0x19')],'id');for(var _0x524356=0x0,_0x56e881={};_0x524356<_0x562a3d[_0x2203('0x3a')];_0x524356+=0x1){_0x56e881=_0x562a3d[_0x524356];if(_[_0x2203('0x3c')](_0x569d4a[_0x2203('0x19')][_0x56e881['id']])){_0x569d4a['deskAccounts'][_0x56e881['id']]=new DeskAccount(_0x56e881);}else{_0x569d4a[_0x2203('0x40')](_0x569d4a['deskAccounts'][_0x56e881['id']],_0x56e881);}}}return _0x569d4a['deskAccounts'];};};Realtime[_0x2203('0x39')]['initSugarcrmAccounts']=function(){var _0x54ec71=this;return function(_0x5efc59){if(_0x5efc59){freeIsNotKey(_0x5efc59,_0x54ec71[_0x2203('0x18')],'id');for(var _0x31256b=0x0,_0x367122={};_0x31256b<_0x5efc59[_0x2203('0x3a')];_0x31256b+=0x1){_0x367122=_0x5efc59[_0x31256b];if(_[_0x2203('0x3c')](_0x54ec71[_0x2203('0x18')][_0x367122['id']])){_0x54ec71[_0x2203('0x18')][_0x367122['id']]=new SugarcrmAccount(_0x367122);}else{_0x54ec71[_0x2203('0x40')](_0x54ec71[_0x2203('0x18')][_0x367122['id']],_0x367122);}}}return _0x54ec71[_0x2203('0x18')];};};Realtime[_0x2203('0x39')][_0x2203('0x4e')]=function(){var _0x58ff57=this;return function(_0x585bde){if(_0x585bde){freeIsNotKey(_0x585bde,_0x58ff57[_0x2203('0x1a')],'id');for(var _0x43d8c0=0x0,_0x2511bd={};_0x43d8c0<_0x585bde[_0x2203('0x3a')];_0x43d8c0+=0x1){_0x2511bd=_0x585bde[_0x43d8c0];if(_[_0x2203('0x3c')](_0x58ff57[_0x2203('0x1a')][_0x2511bd['id']])){_0x58ff57['vtigerAccounts'][_0x2511bd['id']]=new VtigerAccount(_0x2511bd);}else{_0x58ff57['mergeFromDatabase'](_0x58ff57[_0x2203('0x1a')][_0x2511bd['id']],_0x2511bd);}}}return _0x58ff57[_0x2203('0x1a')];};};Realtime[_0x2203('0x39')][_0x2203('0x4f')]=function(){var _0xcab922=this;return function(_0x7b0b9c){if(_0x7b0b9c){freeIsNotKey(_0x7b0b9c,_0xcab922[_0x2203('0x1b')],'id');for(var _0x191b67=0x0,_0x2c6bcc={};_0x191b67<_0x7b0b9c[_0x2203('0x3a')];_0x191b67+=0x1){_0x2c6bcc=_0x7b0b9c[_0x191b67];if(_[_0x2203('0x3c')](_0xcab922['servicenowAccounts'][_0x2c6bcc['id']])){_0xcab922[_0x2203('0x1b')][_0x2c6bcc['id']]=new ServicenowAccount(_0x2c6bcc);}else{_0xcab922[_0x2203('0x40')](_0xcab922[_0x2203('0x1b')][_0x2c6bcc['id']],_0x2c6bcc);}}}return _0xcab922[_0x2203('0x1b')];};};Realtime[_0x2203('0x39')][_0x2203('0x50')]=function(){var _0x52c159=this;return function(_0x544756){if(_0x544756){freeIsNotKey(_0x544756,_0x52c159[_0x2203('0x1c')],'id');for(var _0x35b7b9=0x0,_0x49e795={};_0x35b7b9<_0x544756[_0x2203('0x3a')];_0x35b7b9+=0x1){_0x49e795=_0x544756[_0x35b7b9];if(_[_0x2203('0x3c')](_0x52c159[_0x2203('0x1c')][_0x49e795['id']])){_0x52c159[_0x2203('0x1c')][_0x49e795['id']]=new Dynamics365Account(_0x49e795);}else{_0x52c159[_0x2203('0x40')](_0x52c159[_0x2203('0x1c')][_0x49e795['id']],_0x49e795);}}}return _0x52c159[_0x2203('0x1c')];};};Realtime[_0x2203('0x39')][_0x2203('0x51')]=function(){var _0x519120=this;return function(_0x468619){if(_0x468619){freeIsNotKey(_0x468619,_0x519120[_0x2203('0x1d')],'id');for(var _0x465898=0x0,_0x4e461e={};_0x465898<_0x468619[_0x2203('0x3a')];_0x465898+=0x1){_0x4e461e=_0x468619[_0x465898];if(_[_0x2203('0x3c')](_0x519120[_0x2203('0x1d')][_0x4e461e['id']])){_0x519120[_0x2203('0x1d')][_0x4e461e['id']]=new FreshsalesAccount(_0x4e461e);}else{_0x519120[_0x2203('0x40')](_0x519120['freshsalesAccounts'][_0x4e461e['id']],_0x4e461e);}}}return _0x519120[_0x2203('0x1d')];};};Realtime[_0x2203('0x39')][_0x2203('0x52')]=function(){var _0x4dde80=this;return function(_0x5507b6){for(var _0x5d9ae2=0x0;_0x5d9ae2<_0x5507b6['length'];_0x5d9ae2+=0x1){_['merge'](_0x4dde80[_0x2203('0x13')][_0x5507b6[_0x5d9ae2][_0x2203('0x22')]],_0x5507b6[_0x5d9ae2]);}return _0x4dde80[_0x2203('0x13')];};};Realtime[_0x2203('0x39')][_0x2203('0x53')]=function(){var _0x169845=this;return function(_0x3f7926){clearVoiceQueues(_0x169845[_0x2203('0x13')]);if(_0x3f7926){_0x3f7926=_['groupBy'](_0x3f7926,'uniqueid');for(var _0xb54e51 in _0x3f7926){if(_0x3f7926[_0x2203('0x23')](_0xb54e51)){for(var _0xafcc82=0x0;_0xafcc82<_0x3f7926[_0xb54e51][_0x2203('0x3a')];_0xafcc82+=0x1){var _0x1bbd2d=_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x54')];if(_0x169845[_0x2203('0x13')][_0x1bbd2d]){if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x55')]){_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x2c')]+=0x1;}if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x56')]){_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x2d')]+=0x1;}_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x27')]+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x57')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x59')]),_0x2203('0x5a'))||0x0;if(_0xafcc82===_0x3f7926[_0xb54e51]['length']-0x1){_0x169845[_0x2203('0x13')][_0x1bbd2d]['sumDuration']+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5b')]||_0x3f7926[_0xb54e51][_0xafcc82]['queuecallerabandonAt']||_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5c')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x59')]),_0x2203('0x5a'))||0x0;_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x25')]+=0x1;if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5d')]){_0x169845[_0x2203('0x13')][_0x1bbd2d]['answered']+=0x1;_0x169845['voiceQueues'][_0x1bbd2d][_0x2203('0x29')]+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5b')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x169845['voiceQueues'][_0x1bbd2d][_0x2203('0x28')]+=_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x27')]||0x0;}}}}}}return _0x169845[_0x2203('0x13')];};};Realtime['prototype'][_0x2203('0x5e')]=function(){var _0x47a2c7=this;return function(_0x48bd5){clearVoiceCallReports(_0x47a2c7[_0x2203('0x15')]);if(_0x48bd5){for(var _0xe3bee5=0x0;_0xe3bee5<_0x48bd5[_0x2203('0x3a')];_0xe3bee5+=0x1){_0x47a2c7[_0x2203('0x15')]['total']+=0x1;_0x47a2c7[_0x2203('0x15')][_0x2203('0x28')]+=_0x48bd5[_0xe3bee5][_0x2203('0x5f')];if(_0x48bd5[_0xe3bee5]['disposition']===_0x2203('0x60')){_0x47a2c7[_0x2203('0x15')][_0x2203('0x26')]+=0x1;_0x47a2c7[_0x2203('0x15')][_0x2203('0x27')]+=_0x48bd5[_0xe3bee5][_0x2203('0x5f')]-_0x48bd5[_0xe3bee5][_0x2203('0x61')]||0x0;_0x47a2c7[_0x2203('0x15')][_0x2203('0x29')]+=_0x48bd5[_0xe3bee5][_0x2203('0x61')];}}}return _0x47a2c7[_0x2203('0x15')];};};Realtime['prototype'][_0x2203('0x62')]=function(){var _0x7f71b8=this;return function(_0x21b755){if(_0x21b755){freeIsNotKey(_0x21b755,_0x7f71b8[_0x2203('0x14')],_0x2203('0x22'));for(var _0x52c35e=0x0,_0x23f7b1={};_0x52c35e<_0x21b755[_0x2203('0x3a')];_0x52c35e+=0x1){_0x23f7b1=_0x21b755[_0x52c35e];if(_[_0x2203('0x3c')](_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]])){_0x7f71b8[_0x2203('0x14')][_0x23f7b1['name']]=new Campaign(_0x23f7b1);}else{_0x7f71b8['mergeFromDatabase'](_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]],_0x23f7b1);_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]][_0x2203('0x63')]=_0x23f7b1['SquareProject']?_0x23f7b1[_0x2203('0x64')][_0x2203('0x22')]:undefined;}}}return _0x7f71b8['campaigns'];};};Realtime['prototype']['initVoiceExtensions']=function(){var _0x4fc51a=this;return function(_0x5e07d7){if(_0x5e07d7){freeIsNotKey(_0x5e07d7,_0x4fc51a[_0x2203('0x65')],'id');for(var _0x6319a3=0x0,_0x437095={};_0x6319a3<_0x5e07d7['length'];_0x6319a3+=0x1){_0x437095=_0x5e07d7[_0x6319a3];if(_['isUndefined'](_0x4fc51a['voiceExtensions'][_0x437095['id']])){_0x4fc51a[_0x2203('0x65')][_0x437095['id']]=new VoiceExtension(_0x437095);}else{_0x4fc51a[_0x2203('0x40')](_0x4fc51a[_0x2203('0x65')][_0x437095['id']],_0x437095);}}}return _0x4fc51a[_0x2203('0x65')];};};Realtime[_0x2203('0x39')][_0x2203('0x66')]=function(){var _0x3d1797=this;return function(_0x52f25e){clearCampaigns(_0x3d1797[_0x2203('0x14')]);for(var _0x74843=0x0;_0x74843<_0x52f25e[_0x2203('0x3a')];_0x74843+=0x1){_[_0x2203('0x67')](_0x3d1797[_0x2203('0x14')][_0x52f25e[_0x74843][_0x2203('0x22')]],_0x52f25e[_0x74843]);}return _0x3d1797[_0x2203('0x14')];};};Realtime['prototype'][_0x2203('0x68')]=function(){var _0x51a2fe=this;return function(_0x5d0176){if(_0x5d0176){freeIsNotKey(_0x5d0176,_0x51a2fe[_0x2203('0x1e')],'id');for(var _0x5cd030=0x0,_0xb9588e={};_0x5cd030<_0x5d0176[_0x2203('0x3a')];_0x5cd030+=0x1){_0xb9588e=_0x5d0176[_0x5cd030];if(_['isUndefined'](_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']])){_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']]=new FaxAccount(_0xb9588e);}else{_0x51a2fe[_0x2203('0x40')](_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']],_0xb9588e);}}}return _0x51a2fe[_0x2203('0x1e')];};};Realtime[_0x2203('0x39')]['initVoiceQueues']=function(){var _0x215638=this;return function(_0x3541b3){if(_0x3541b3){freeIsNotKey(_0x3541b3,_0x215638['voiceQueues'],'name');for(var _0x377176=0x0,_0x3fe71b={};_0x377176<_0x3541b3[_0x2203('0x3a')];_0x377176+=0x1){_0x3fe71b=_0x3541b3[_0x377176];if(_[_0x2203('0x3c')](_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]])){_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]]=new VoiceQueue(_0x3fe71b);}else{_0x215638[_0x2203('0x40')](_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]],_0x3fe71b);}}}return _0x215638[_0x2203('0x13')];};};module[_0x2203('0x69')]=Realtime; \ No newline at end of file +var _0xb10b=['../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','triggers','campaigns','templates','voiceExtensions','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','SIP/%s','name','interface','format','total','answered','sumHoldTime','sumDuration','ivrTotalCallsDays','isEmpty','unmanaged','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','length','isNil','isUndefined','initTelephones','trunks','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initVoiceQueueHopperHistory','voiceQueues','groupBy','uniqueid','queue','queuecallerexit','abandoned','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','outbound','duration','billableseconds','initCampaigns','dialQueueProject','initCampaignHopperHistory','merge','initFaxAccounts','initVoiceQueues','lodash','util','../model/agent','../model/telephone','../model/voiceQueue','../model/trigger','../model/template','../model/campaign'];(function(_0x485af0,_0x275ea0){var _0x295d39=function(_0x420679){while(--_0x420679){_0x485af0['push'](_0x485af0['shift']());}};_0x295d39(++_0x275ea0);}(_0xb10b,0x12a));var _0xbb10=function(_0x2e02ae,_0x4a4623){_0x2e02ae=_0x2e02ae-0x0;var _0x375a6b=_0xb10b[_0x2e02ae];return _0x375a6b;};'use strict';var _=require(_0xbb10('0x0'));var moment=require('moment');var util=require(_0xbb10('0x1'));var Agent=require(_0xbb10('0x2'));var Telephone=require(_0xbb10('0x3'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0xbb10('0x4'));var Trigger=require(_0xbb10('0x5'));var Template=require(_0xbb10('0x6'));var Campaign=require(_0xbb10('0x7'));var VoiceExtension=require(_0xbb10('0x8'));var ZendeskAccount=require(_0xbb10('0x9'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xbb10('0xa'));var SugarcrmAccount=require(_0xbb10('0xb'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0xbb10('0xc'));var VtigerAccount=require(_0xbb10('0xd'));var ServicenowAccount=require(_0xbb10('0xe'));var Dynamics365Account=require(_0xbb10('0xf'));var FreshsalesAccount=require(_0xbb10('0x10'));var FaxAccount=require(_0xbb10('0x11'));function Realtime(){this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['trunks']={};this['voiceQueues']={};this[_0xbb10('0x14')]={};this[_0xbb10('0x15')]={};this[_0xbb10('0x16')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xbb10('0x17')]={};this['channels']={};this[_0xbb10('0x18')]={};this[_0xbb10('0x19')]={};this[_0xbb10('0x1a')]={};this[_0xbb10('0x1b')]={};this[_0xbb10('0x1c')]={};this[_0xbb10('0x1d')]={};this['sugarcrmAccounts']={};this[_0xbb10('0x1e')]={};this[_0xbb10('0x1f')]={};this[_0xbb10('0x20')]={};this[_0xbb10('0x21')]={};this[_0xbb10('0x22')]={};this[_0xbb10('0x23')]={};this[_0xbb10('0x24')]={};this[_0xbb10('0x25')]={};}function freeIsNotKey(_0x3e26f4,_0x2b184e,_0x4a2bfc){var _0x2eca0f=_[_0xbb10('0x26')](_0x3e26f4,function(_0x133ac2){return _0x133ac2[_0x4a2bfc];});for(var _0x42db98 in _0x2b184e){if(_0x2b184e[_0xbb10('0x27')](_0x42db98)){if(!_0x2eca0f[_0x42db98]){delete _0x2b184e[_0x42db98];}}}}function freeIsNotKeySip(_0x1682a4,_0x575cca){var _0x30efc6=_[_0xbb10('0x26')](_0x1682a4,function(_0xe1c665){return util['format'](_0xbb10('0x28'),_0xe1c665[_0xbb10('0x29')]);});for(var _0x388fab in _0x575cca){if(_0x575cca[_0xbb10('0x27')](_0x388fab)){if(!_0x30efc6[_0x388fab]){delete _0x575cca[_0x388fab];}}}}function freeIsNotKeyAgent(_0xdf237d,_0x44e563){var _0x4deb49=_[_0xbb10('0x26')](_0xdf237d,function(_0x12ef77){var _0x50aea1=_['isNil'](_0x12ef77[_0xbb10('0x2a')])?util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x12ef77[_0xbb10('0x29')]):_0x12ef77[_0xbb10('0x2a')];return _0x50aea1;});for(var _0x1824b7 in _0x44e563){if(_0x44e563[_0xbb10('0x27')](_0x1824b7)){if(!_0x4deb49[_0x1824b7]){delete _0x44e563[_0x1824b7];}}}}function clearVoiceCallReports(_0x436104){_0x436104[_0xbb10('0x2c')]=0x0;_0x436104[_0xbb10('0x2d')]=0x0;_0x436104[_0xbb10('0x2e')]=0x0;_0x436104[_0xbb10('0x2f')]=0x0;_0x436104['sumBillable']=0x0;}function clearCampaigns(_0x4fedac){if(!_['isEmpty'](_0x4fedac)){for(var _0xc93a04 in _0x4fedac){if(_0x4fedac[_0xbb10('0x27')](_0xc93a04)){_0x4fedac[_0xc93a04][_0xbb10('0x30')]=0x0;_0x4fedac[_0xc93a04]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x2fdde9){if(!_[_0xbb10('0x31')](_0x2fdde9)){for(var _0x6ed43b in _0x2fdde9){if(_0x2fdde9[_0xbb10('0x27')](_0x6ed43b)){_0x2fdde9[_0x6ed43b][_0xbb10('0x2c')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2d')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x32')]=0x0;_0x2fdde9[_0x6ed43b]['abandoned']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2e')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2f')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x33')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x34')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x35')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x36')]=0x0;_0x2fdde9[_0x6ed43b]['outboundCongestionCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x37')]=0x0;_0x2fdde9[_0x6ed43b]['outboundUnknownCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x38')]=0x0;_0x2fdde9[_0x6ed43b]['outboundDropCallsDayCallersExit']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x39')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3a')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3b')]=0x0;_0x2fdde9[_0x6ed43b]['outboundReCallsDay']=0x0;_0x2fdde9[_0x6ed43b]['outboundAnswerAgiCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3c')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3d')]=!![];}}}}Realtime['prototype'][_0xbb10('0x3e')]=function(_0x37dde7,_0x2f653f){for(var _0x1c0b57 in _0x2f653f){if(_0x37dde7[_0xbb10('0x27')](_0x1c0b57)){_0x37dde7[_0x1c0b57]=_0x2f653f[_0x1c0b57];}}};Realtime[_0xbb10('0x3f')][_0xbb10('0x40')]=function(){var _0x4975f5=this;return function(_0x25acb3){if(_0x25acb3){freeIsNotKeyAgent(_0x25acb3,_0x4975f5[_0xbb10('0x12')]);for(var _0x441d15=0x0,_0x8c1ce6={};_0x441d15<_0x25acb3[_0xbb10('0x41')];_0x441d15+=0x1){_0x8c1ce6=_0x25acb3[_0x441d15];var _0x9de708=_[_0xbb10('0x42')](_0x8c1ce6[_0xbb10('0x2a')])?util[_0xbb10('0x2b')]('SIP/%s',_0x8c1ce6[_0xbb10('0x29')]):_0x8c1ce6[_0xbb10('0x2a')];if(_[_0xbb10('0x43')](_0x4975f5[_0xbb10('0x12')][_0x9de708])){_0x4975f5['agents'][_0x9de708]=new Agent(_0x8c1ce6);}else{_0x4975f5[_0xbb10('0x3e')](_0x4975f5['agents'][_0x9de708],_0x8c1ce6);}}}return _0x4975f5['agents'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x44')]=function(){var _0x26e76a=this;return function(_0x120d21){if(_0x120d21){freeIsNotKeySip(_0x120d21,_0x26e76a[_0xbb10('0x13')]);for(var _0x29d11a=0x0,_0x547062={};_0x29d11a<_0x120d21[_0xbb10('0x41')];_0x29d11a+=0x1){_0x547062=_0x120d21[_0x29d11a];if(_[_0xbb10('0x43')](_0x26e76a['telephones'][util['format']('SIP/%s',_0x547062[_0xbb10('0x29')])])){_0x26e76a[_0xbb10('0x13')][util[_0xbb10('0x2b')]('SIP/%s',_0x547062[_0xbb10('0x29')])]=new Telephone(_0x547062);}else{_0x26e76a[_0xbb10('0x3e')](_0x26e76a[_0xbb10('0x13')][util['format'](_0xbb10('0x28'),_0x547062[_0xbb10('0x29')])],_0x547062);}}}return _0x26e76a[_0xbb10('0x13')];};};Realtime[_0xbb10('0x3f')]['initTrunks']=function(){var _0xd238e9=this;return function(_0x110eb5){if(_0x110eb5){freeIsNotKeySip(_0x110eb5,_0xd238e9['trunks']);for(var _0xe2040f=0x0,_0x2e3214={};_0xe2040f<_0x110eb5[_0xbb10('0x41')];_0xe2040f+=0x1){_0x2e3214=_0x110eb5[_0xe2040f];if(_[_0xbb10('0x43')](_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')]('SIP/%s',_0x2e3214[_0xbb10('0x29')])])){_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x2e3214['name'])]=new Trunk(_0x2e3214);}else{_0xd238e9[_0xbb10('0x3e')](_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x2e3214['name'])],_0x2e3214);}}}return _0xd238e9[_0xbb10('0x45')];};};Realtime[_0xbb10('0x3f')]['initTriggers']=function(){var _0x5d9a4f=this;return function(_0x38d78f){if(_0x38d78f){freeIsNotKey(_0x38d78f,_0x5d9a4f['triggers'],'id');for(var _0x318984=0x0,_0x180933={};_0x318984<_0x38d78f['length'];_0x318984+=0x1){_0x180933=_0x38d78f[_0x318984];if(_[_0xbb10('0x43')](_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']])){_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']]=new Trigger(_0x180933);}else{_0x5d9a4f['mergeFromDatabase'](_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']],_0x180933);}}}return _0x5d9a4f[_0xbb10('0x14')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x46')]=function(){var _0x36e1fa=this;return function(_0x19f94d){if(_0x19f94d){freeIsNotKey(_0x19f94d,_0x36e1fa[_0xbb10('0x16')],'id');for(var _0x3efa96=0x0,_0x205bb4={};_0x3efa96<_0x19f94d[_0xbb10('0x41')];_0x3efa96+=0x1){_0x205bb4=_0x19f94d[_0x3efa96];if(_[_0xbb10('0x43')](_0x36e1fa[_0xbb10('0x16')][_0x205bb4['id']])){_0x36e1fa['templates'][_0x205bb4['id']]=new Template(_0x205bb4);}else{_0x36e1fa[_0xbb10('0x3e')](_0x36e1fa[_0xbb10('0x16')][_0x205bb4['id']],_0x205bb4);}}}return _0x36e1fa['templates'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x47')]=function(){var _0x1a7df6=this;return function(_0x5a5226){if(_0x5a5226){freeIsNotKey(_0x5a5226,_0x1a7df6[_0xbb10('0x1c')],'id');for(var _0x39f0de=0x0,_0x3e06b0={};_0x39f0de<_0x5a5226['length'];_0x39f0de+=0x1){_0x3e06b0=_0x5a5226[_0x39f0de];if(_['isUndefined'](_0x1a7df6[_0xbb10('0x1c')][_0x3e06b0['id']])){_0x1a7df6[_0xbb10('0x1c')][_0x3e06b0['id']]=new ZendeskAccount(_0x3e06b0);}else{_0x1a7df6[_0xbb10('0x3e')](_0x1a7df6['zendeskAccounts'][_0x3e06b0['id']],_0x3e06b0);}}}return _0x1a7df6['zendeskAccounts'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x48')]=function(){var _0x1bd054=this;return function(_0xf820fe){if(_0xf820fe){freeIsNotKey(_0xf820fe,_0x1bd054[_0xbb10('0x1d')],'id');for(var _0x22b315=0x0,_0x2f2552={};_0x22b315<_0xf820fe[_0xbb10('0x41')];_0x22b315+=0x1){_0x2f2552=_0xf820fe[_0x22b315];if(_[_0xbb10('0x43')](_0x1bd054[_0xbb10('0x1d')][_0x2f2552['id']])){_0x1bd054['salesforceAccounts'][_0x2f2552['id']]=new SalesforceAccount(_0x2f2552);}else{_0x1bd054['mergeFromDatabase'](_0x1bd054[_0xbb10('0x1d')][_0x2f2552['id']],_0x2f2552);}}}return _0x1bd054[_0xbb10('0x1d')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x49')]=function(){var _0x36aa7d=this;return function(_0x440f9e){if(_0x440f9e){freeIsNotKey(_0x440f9e,_0x36aa7d[_0xbb10('0x1e')],'id');for(var _0x445870=0x0,_0x1c0d8f={};_0x445870<_0x440f9e[_0xbb10('0x41')];_0x445870+=0x1){_0x1c0d8f=_0x440f9e[_0x445870];if(_[_0xbb10('0x43')](_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']])){_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']]=new FreshdeskAccount(_0x1c0d8f);}else{_0x36aa7d[_0xbb10('0x3e')](_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']],_0x1c0d8f);}}}return _0x36aa7d['freshdeskAccounts'];};};Realtime[_0xbb10('0x3f')]['initZohoAccounts']=function(){var _0x33d60a=this;return function(_0x2e21a0){if(_0x2e21a0){freeIsNotKey(_0x2e21a0,_0x33d60a[_0xbb10('0x1f')],'id');for(var _0x3f27ce=0x0,_0x26e66e={};_0x3f27ce<_0x2e21a0[_0xbb10('0x41')];_0x3f27ce+=0x1){_0x26e66e=_0x2e21a0[_0x3f27ce];if(_[_0xbb10('0x43')](_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']])){_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']]=new ZohoAccount(_0x26e66e);}else{_0x33d60a[_0xbb10('0x3e')](_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']],_0x26e66e);}}}return _0x33d60a[_0xbb10('0x1f')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4a')]=function(){var _0x4475e1=this;return function(_0x5de0cc){if(_0x5de0cc){freeIsNotKey(_0x5de0cc,_0x4475e1[_0xbb10('0x20')],'id');for(var _0x466eb7=0x0,_0x1b83a9={};_0x466eb7<_0x5de0cc[_0xbb10('0x41')];_0x466eb7+=0x1){_0x1b83a9=_0x5de0cc[_0x466eb7];if(_[_0xbb10('0x43')](_0x4475e1[_0xbb10('0x20')][_0x1b83a9['id']])){_0x4475e1['deskAccounts'][_0x1b83a9['id']]=new DeskAccount(_0x1b83a9);}else{_0x4475e1[_0xbb10('0x3e')](_0x4475e1[_0xbb10('0x20')][_0x1b83a9['id']],_0x1b83a9);}}}return _0x4475e1[_0xbb10('0x20')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4b')]=function(){var _0x22de7f=this;return function(_0x175872){if(_0x175872){freeIsNotKey(_0x175872,_0x22de7f[_0xbb10('0x4c')],'id');for(var _0x205e01=0x0,_0x40c4fb={};_0x205e01<_0x175872[_0xbb10('0x41')];_0x205e01+=0x1){_0x40c4fb=_0x175872[_0x205e01];if(_[_0xbb10('0x43')](_0x22de7f[_0xbb10('0x4c')][_0x40c4fb['id']])){_0x22de7f['sugarcrmAccounts'][_0x40c4fb['id']]=new SugarcrmAccount(_0x40c4fb);}else{_0x22de7f['mergeFromDatabase'](_0x22de7f[_0xbb10('0x4c')][_0x40c4fb['id']],_0x40c4fb);}}}return _0x22de7f[_0xbb10('0x4c')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4d')]=function(){var _0x5573bb=this;return function(_0x506498){if(_0x506498){freeIsNotKey(_0x506498,_0x5573bb[_0xbb10('0x21')],'id');for(var _0xaf2cc3=0x0,_0x410bef={};_0xaf2cc3<_0x506498[_0xbb10('0x41')];_0xaf2cc3+=0x1){_0x410bef=_0x506498[_0xaf2cc3];if(_[_0xbb10('0x43')](_0x5573bb[_0xbb10('0x21')][_0x410bef['id']])){_0x5573bb[_0xbb10('0x21')][_0x410bef['id']]=new VtigerAccount(_0x410bef);}else{_0x5573bb['mergeFromDatabase'](_0x5573bb[_0xbb10('0x21')][_0x410bef['id']],_0x410bef);}}}return _0x5573bb[_0xbb10('0x21')];};};Realtime['prototype']['initServicenowAccounts']=function(){var _0x5a231f=this;return function(_0x32c1e8){if(_0x32c1e8){freeIsNotKey(_0x32c1e8,_0x5a231f[_0xbb10('0x22')],'id');for(var _0x155dc5=0x0,_0x5bd1c0={};_0x155dc5<_0x32c1e8['length'];_0x155dc5+=0x1){_0x5bd1c0=_0x32c1e8[_0x155dc5];if(_['isUndefined'](_0x5a231f[_0xbb10('0x22')][_0x5bd1c0['id']])){_0x5a231f[_0xbb10('0x22')][_0x5bd1c0['id']]=new ServicenowAccount(_0x5bd1c0);}else{_0x5a231f[_0xbb10('0x3e')](_0x5a231f['servicenowAccounts'][_0x5bd1c0['id']],_0x5bd1c0);}}}return _0x5a231f[_0xbb10('0x22')];};};Realtime[_0xbb10('0x3f')]['initDynamics365Accounts']=function(){var _0x4a560c=this;return function(_0x27d7b9){if(_0x27d7b9){freeIsNotKey(_0x27d7b9,_0x4a560c[_0xbb10('0x23')],'id');for(var _0xd77753=0x0,_0x237246={};_0xd77753<_0x27d7b9['length'];_0xd77753+=0x1){_0x237246=_0x27d7b9[_0xd77753];if(_[_0xbb10('0x43')](_0x4a560c[_0xbb10('0x23')][_0x237246['id']])){_0x4a560c[_0xbb10('0x23')][_0x237246['id']]=new Dynamics365Account(_0x237246);}else{_0x4a560c['mergeFromDatabase'](_0x4a560c[_0xbb10('0x23')][_0x237246['id']],_0x237246);}}}return _0x4a560c[_0xbb10('0x23')];};};Realtime[_0xbb10('0x3f')]['initFreshsalesAccounts']=function(){var _0x2ca491=this;return function(_0x31e85e){if(_0x31e85e){freeIsNotKey(_0x31e85e,_0x2ca491[_0xbb10('0x24')],'id');for(var _0x37b65f=0x0,_0x5e4a6e={};_0x37b65f<_0x31e85e[_0xbb10('0x41')];_0x37b65f+=0x1){_0x5e4a6e=_0x31e85e[_0x37b65f];if(_[_0xbb10('0x43')](_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']])){_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']]=new FreshsalesAccount(_0x5e4a6e);}else{_0x2ca491['mergeFromDatabase'](_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']],_0x5e4a6e);}}}return _0x2ca491[_0xbb10('0x24')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4e')]=function(){var _0x12f750=this;return function(_0x17807e){for(var _0x1e4694=0x0;_0x1e4694<_0x17807e['length'];_0x1e4694+=0x1){_['merge'](_0x12f750['voiceQueues'][_0x17807e[_0x1e4694][_0xbb10('0x29')]],_0x17807e[_0x1e4694]);}return _0x12f750[_0xbb10('0x4f')];};};Realtime[_0xbb10('0x3f')]['initVoiceQueueReports']=function(){var _0x5cd089=this;return function(_0x46f462){clearVoiceQueues(_0x5cd089[_0xbb10('0x4f')]);if(_0x46f462){_0x46f462=_[_0xbb10('0x50')](_0x46f462,_0xbb10('0x51'));for(var _0x260e06 in _0x46f462){if(_0x46f462[_0xbb10('0x27')](_0x260e06)){for(var _0x4cf2f3=0x0;_0x4cf2f3<_0x46f462[_0x260e06][_0xbb10('0x41')];_0x4cf2f3+=0x1){var _0x15fae2=_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x52')];if(_0x5cd089[_0xbb10('0x4f')][_0x15fae2]){if(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x53')]){_0x5cd089['voiceQueues'][_0x15fae2]['unmanaged']+=0x1;}if(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerabandon']){_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x54')]+=0x1;}_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2e')]+=moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x55')])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerjoinAt']),_0xbb10('0x57'))||0x0;if(_0x4cf2f3===_0x46f462[_0x260e06]['length']-0x1){_0x5cd089['voiceQueues'][_0x15fae2]['sumDuration']+=moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x58')]||_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x59')]||_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x5a')])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerjoinAt']),_0xbb10('0x57'))||0x0;_0x5cd089['voiceQueues'][_0x15fae2]['total']+=0x1;if(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x5b')]){_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2d')]+=0x1;_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x33')]+=moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallercompleteAt'])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x55')]),_0xbb10('0x57'))||0x0;}}else{_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2f')]+=_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2e')]||0x0;}}}}}}return _0x5cd089['voiceQueues'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x5c')]=function(){var _0x30f3ea=this;return function(_0x322b41){clearVoiceCallReports(_0x30f3ea[_0xbb10('0x5d')]);if(_0x322b41){for(var _0x172be3=0x0;_0x172be3<_0x322b41[_0xbb10('0x41')];_0x172be3+=0x1){_0x30f3ea[_0xbb10('0x5d')]['total']+=0x1;_0x30f3ea[_0xbb10('0x5d')][_0xbb10('0x2f')]+=_0x322b41[_0x172be3][_0xbb10('0x5e')];if(_0x322b41[_0x172be3]['disposition']==='ANSWERED'){_0x30f3ea['outbound'][_0xbb10('0x2d')]+=0x1;_0x30f3ea['outbound']['sumHoldTime']+=_0x322b41[_0x172be3][_0xbb10('0x5e')]-_0x322b41[_0x172be3][_0xbb10('0x5f')]||0x0;_0x30f3ea[_0xbb10('0x5d')][_0xbb10('0x33')]+=_0x322b41[_0x172be3][_0xbb10('0x5f')];}}}return _0x30f3ea[_0xbb10('0x5d')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x60')]=function(){var _0x188b97=this;return function(_0x5206e1){if(_0x5206e1){freeIsNotKey(_0x5206e1,_0x188b97[_0xbb10('0x15')],_0xbb10('0x29'));for(var _0x46b6d2=0x0,_0x35b811={};_0x46b6d2<_0x5206e1['length'];_0x46b6d2+=0x1){_0x35b811=_0x5206e1[_0x46b6d2];if(_['isUndefined'](_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]])){_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]]=new Campaign(_0x35b811);}else{_0x188b97['mergeFromDatabase'](_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]],_0x35b811);_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]][_0xbb10('0x61')]=_0x35b811['SquareProject']?_0x35b811['SquareProject'][_0xbb10('0x29')]:undefined;}}}return _0x188b97[_0xbb10('0x15')];};};Realtime[_0xbb10('0x3f')]['initVoiceExtensions']=function(){var _0x256b35=this;return function(_0x13e2ab){if(_0x13e2ab){freeIsNotKey(_0x13e2ab,_0x256b35['voiceExtensions'],'id');for(var _0x5caa06=0x0,_0x2f667f={};_0x5caa06<_0x13e2ab[_0xbb10('0x41')];_0x5caa06+=0x1){_0x2f667f=_0x13e2ab[_0x5caa06];if(_[_0xbb10('0x43')](_0x256b35['voiceExtensions'][_0x2f667f['id']])){_0x256b35[_0xbb10('0x17')][_0x2f667f['id']]=new VoiceExtension(_0x2f667f);}else{_0x256b35[_0xbb10('0x3e')](_0x256b35[_0xbb10('0x17')][_0x2f667f['id']],_0x2f667f);}}}return _0x256b35[_0xbb10('0x17')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x62')]=function(){var _0x45bd4e=this;return function(_0x226363){clearCampaigns(_0x45bd4e[_0xbb10('0x15')]);for(var _0x479d51=0x0;_0x479d51<_0x226363[_0xbb10('0x41')];_0x479d51+=0x1){_[_0xbb10('0x63')](_0x45bd4e[_0xbb10('0x15')][_0x226363[_0x479d51][_0xbb10('0x29')]],_0x226363[_0x479d51]);}return _0x45bd4e[_0xbb10('0x15')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x64')]=function(){var _0x305d52=this;return function(_0x17ed20){if(_0x17ed20){freeIsNotKey(_0x17ed20,_0x305d52[_0xbb10('0x25')],'id');for(var _0x15e043=0x0,_0x2a4278={};_0x15e043<_0x17ed20['length'];_0x15e043+=0x1){_0x2a4278=_0x17ed20[_0x15e043];if(_['isUndefined'](_0x305d52[_0xbb10('0x25')][_0x2a4278['id']])){_0x305d52[_0xbb10('0x25')][_0x2a4278['id']]=new FaxAccount(_0x2a4278);}else{_0x305d52[_0xbb10('0x3e')](_0x305d52[_0xbb10('0x25')][_0x2a4278['id']],_0x2a4278);}}}return _0x305d52[_0xbb10('0x25')];};};Realtime['prototype'][_0xbb10('0x65')]=function(){var _0x332fbe=this;return function(_0x3b4d0b){if(_0x3b4d0b){freeIsNotKey(_0x3b4d0b,_0x332fbe[_0xbb10('0x4f')],_0xbb10('0x29'));for(var _0x379d49=0x0,_0x546db5={};_0x379d49<_0x3b4d0b[_0xbb10('0x41')];_0x379d49+=0x1){_0x546db5=_0x3b4d0b[_0x379d49];if(_[_0xbb10('0x43')](_0x332fbe['voiceQueues'][_0x546db5[_0xbb10('0x29')]])){_0x332fbe['voiceQueues'][_0x546db5[_0xbb10('0x29')]]=new VoiceQueue(_0x546db5);}else{_0x332fbe[_0xbb10('0x3e')](_0x332fbe[_0xbb10('0x4f')][_0x546db5[_0xbb10('0x29')]],_0x546db5);}}}return _0x332fbe[_0xbb10('0x4f')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index aed76e7..575ef15 100644 --- a/server/services/ami/realtime/utils.js +++ b/server/services/ami/realtime/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4367=['hasOwnProperty','mergeDBDataToRealtime'];(function(_0x1b1306,_0xf1346e){var _0x3f23ac=function(_0x16cb46){while(--_0x16cb46){_0x1b1306['push'](_0x1b1306['shift']());}};_0x3f23ac(++_0xf1346e);}(_0x4367,0x114));var _0x7436=function(_0x25e887,_0xe99431){_0x25e887=_0x25e887-0x0;var _0x4890e6=_0x4367[_0x25e887];return _0x4890e6;};'use strict';function mergeDBDataToRealtime(_0x56e250,_0x3b5553){var _0x10f7cd=Object['assign']({},_0x56e250);for(var _0x254fc8 in _0x3b5553){if(_0x10f7cd[_0x7436('0x0')](_0x254fc8)){_0x10f7cd[_0x254fc8]=_0x3b5553[_0x254fc8];}}return _0x10f7cd;}exports[_0x7436('0x1')]=mergeDBDataToRealtime; \ No newline at end of file +var _0xfbb6=['mergeDBDataToRealtime','assign','hasOwnProperty'];(function(_0xd4b806,_0x2b8195){var _0x5cf7e7=function(_0x14a3a2){while(--_0x14a3a2){_0xd4b806['push'](_0xd4b806['shift']());}};_0x5cf7e7(++_0x2b8195);}(_0xfbb6,0xb2));var _0x6fbb=function(_0xd93cbe,_0x11202e){_0xd93cbe=_0xd93cbe-0x0;var _0xe0bb40=_0xfbb6[_0xd93cbe];return _0xe0bb40;};'use strict';function mergeDBDataToRealtime(_0x207ad8,_0x21fbf0){var _0x8bad2f=Object[_0x6fbb('0x0')]({},_0x207ad8);for(var _0x4320d0 in _0x21fbf0){if(_0x8bad2f[_0x6fbb('0x1')](_0x4320d0)){_0x8bad2f[_0x4320d0]=_0x21fbf0[_0x4320d0];}}return _0x8bad2f;}exports[_0x6fbb('0x2')]=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 41238b4..72dca07 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 _0x7d56=['transfers','linkedid','uniqueid','blindTransfer','UserId','membername','monitor','monitors','length','monitorFilename','filename','createdAt','connectedlinename','xcally-motion-dialer','voiceAgentReport','isArray','startsWith','Local','substring','indexOf','lastIndexOf','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceTransferReport','./voiceQueueReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','attendedTransfer','findAgent','accountcode','name','isNil','find','SIP/%s','connectedlinenum','assigned','lastAssignedTo','interface','format','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','voiceQueueReport','create','match','getAgentByInternal','keys','getCallType','split','calleridnum','outbound','internal','destination','exten','type','dialer','lastdata','context','from-voip-provider','callerid','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','channel','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x7d56,0x196));var _0x67d5=function(_0x31e362,_0x59cff3){_0x31e362=_0x31e362-0x0;var _0x38c4a4=_0x7d56[_0x31e362];return _0x38c4a4;};'use strict';var _=require(_0x67d5('0x0'));var moment=require(_0x67d5('0x1'));var util=require(_0x67d5('0x2'));var config=require(_0x67d5('0x3'));var ami=require(_0x67d5('0x4'));var RpcVoiceAgentReport=require(_0x67d5('0x5'));var RpcVoiceCallReport=require(_0x67d5('0x6'));var RpcVoiceDialReport=require(_0x67d5('0x7'));var RpcMemberReport=require(_0x67d5('0x8'));var RpcVoiceQueueReport=require(_0x67d5('0x9'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0x67d5('0xa'));var VoiceQueueReport=require(_0x67d5('0xb'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0x67d5('0xc'));var VoiceDialReport=require(_0x67d5('0xd'));var UserReport=require(_0x67d5('0xe'));function Report(_0x141be8){this[_0x67d5('0xf')]=_0x141be8;this[_0x67d5('0x10')]=_0x141be8[_0x67d5('0x10')];this[_0x67d5('0x11')]=_0x141be8[_0x67d5('0x11')];}Report[_0x67d5('0x12')][_0x67d5('0x13')]=function(_0x57a099){var _0x69abd4=new VoiceQueueReport(this['realtime']);var _0x5ee83a=new VoiceAgentReport(this[_0x67d5('0xf')]);var _0x117879=new VoiceDialReport(this[_0x67d5('0xf')]);var _0x4c71c9=new VoiceCallReport(this[_0x67d5('0xf')]);var _0x517935=new UserReport(this[_0x67d5('0xf')]);if(config[_0x67d5('0x14')]&&config[_0x67d5('0x14')][_0x67d5('0x15')]){ami['on'](_0x67d5('0x16'),this['voiceQueueReport'][_0x67d5('0x17')](this));ami['on'](_0x67d5('0x18'),this[_0x67d5('0x19')]['bind'](this));ami['on'](_0x67d5('0x1a'),this['voiceAgentReport'][_0x67d5('0x17')](this));ami['on'](_0x67d5('0x1b'),this[_0x67d5('0x1c')][_0x67d5('0x17')](this));ami['on'](_0x67d5('0x1d'),this['blindTransfer'][_0x67d5('0x17')](this));ami['on']('attendedtransfer',this[_0x67d5('0x1e')][_0x67d5('0x17')](this));}};Report[_0x67d5('0x12')][_0x67d5('0x1f')]=function(_0x1137fc){var _0x4f3715;_0x4f3715=_['find'](this['agents'],function(_0x2ac3dd){return _0x2ac3dd[_0x67d5('0x20')]==_0x1137fc||_0x2ac3dd[_0x67d5('0x21')]==_0x1137fc;});if(_[_0x67d5('0x22')](_0x4f3715)){var _0xd54dcd=_[_0x67d5('0x23')](this[_0x67d5('0x11')],function(_0x4ea574){return _0x4ea574['accountcode']==_0x1137fc||_0x4ea574[_0x67d5('0x21')]==_0x1137fc;});if(_0xd54dcd){_0x4f3715=_[_0x67d5('0x23')](this[_0x67d5('0x10')],function(_0x4dc746){return _0x4dc746['interface']==util['format'](_0x67d5('0x24'),_0xd54dcd[_0x67d5('0x21')]);});}}return _0x4f3715;};Report[_0x67d5('0x12')]['voiceQueueReport']=function(_0x598eb5){for(var _0x1bd2e1=0x0;_0x1bd2e1<_0x598eb5['length'];_0x1bd2e1+=0x1){var _0x570499=this[_0x67d5('0x1f')](_0x598eb5[_0x1bd2e1][_0x67d5('0x25')]);if(_0x570499){_0x598eb5[_0x1bd2e1][_0x67d5('0x20')]=_0x570499[_0x67d5('0x20')];_0x598eb5[_0x1bd2e1][_0x67d5('0x26')]=!![];_0x598eb5[_0x1bd2e1][_0x67d5('0x27')]=_0x570499[_0x67d5('0x21')];_0x598eb5[_0x1bd2e1][_0x67d5('0x28')]=_['isNil'](_0x570499[_0x67d5('0x28')])?util[_0x67d5('0x29')]('SIP/%s',_0x570499[_0x67d5('0x21')]):_0x570499['interface'];if(_0x598eb5[_0x1bd2e1][_0x67d5('0x2a')]){_0x598eb5[_0x1bd2e1][_0x67d5('0x2b')]=moment()[_0x67d5('0x29')](_0x67d5('0x2c'));}if(_0x598eb5[_0x1bd2e1][_0x67d5('0x2d')]){_0x598eb5[_0x1bd2e1][_0x67d5('0x2e')]=moment()[_0x67d5('0x29')](_0x67d5('0x2c'));}RpcMemberReport[_0x67d5('0x2f')](_0x598eb5[_0x1bd2e1]);}RpcVoiceQueueReport[_0x67d5('0x30')](_0x598eb5[_0x1bd2e1]);}};function extractCalleridNumber(_0x471b08){var _0x3890b5=_0x471b08[_0x67d5('0x31')](/<(.*?)>/);return _0x3890b5?_0x3890b5[0x1]:_0x471b08;}Report[_0x67d5('0x12')][_0x67d5('0x32')]=function(_0x4b0d51){for(var _0x448ce0=0x0;_0x448ce0','calleridname','linkedid','transfers','getCallType','UserId','membername','monitor','monitors','monitorFilename','createdAt','connectedlinename','exten','startsWith','Local','substring','indexOf','mobile','lastIndexOf','exports','lodash','moment','util','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./userReport','realtime','telephones','sync','xdr','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','agents','accountcode','name','isNil','format','SIP/%s','prototype','length','connectedlinenum','lastAssignedTo','interface'];(function(_0x462d17,_0x9fb0f5){var _0x176548=function(_0x20d459){while(--_0x20d459){_0x462d17['push'](_0x462d17['shift']());}};_0x176548(++_0x9fb0f5);}(_0x8a35,0x123));var _0x58a3=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x8a35[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x58a3('0x0'));var moment=require(_0x58a3('0x1'));var util=require(_0x58a3('0x2'));var config=require('../../../config/environment');var ami=require('../ami');var RpcVoiceAgentReport=require(_0x58a3('0x3'));var RpcVoiceCallReport=require(_0x58a3('0x4'));var RpcVoiceDialReport=require(_0x58a3('0x5'));var RpcMemberReport=require(_0x58a3('0x6'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0x58a3('0x7'));var RpcVoiceTransferReport=require(_0x58a3('0x8'));var VoiceQueueReport=require(_0x58a3('0x9'));var VoiceCallReport=require(_0x58a3('0xa'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0x58a3('0xb'));function Report(_0x3ca882){this[_0x58a3('0xc')]=_0x3ca882;this['agents']=_0x3ca882['agents'];this[_0x58a3('0xd')]=_0x3ca882[_0x58a3('0xd')];}Report['prototype'][_0x58a3('0xe')]=function(_0x226071){var _0xc241e7=new VoiceQueueReport(this[_0x58a3('0xc')]);var _0x2eb03f=new VoiceAgentReport(this['realtime']);var _0xe7a498=new VoiceDialReport(this[_0x58a3('0xc')]);var _0x1fa155=new VoiceCallReport(this[_0x58a3('0xc')]);var _0x42615b=new UserReport(this[_0x58a3('0xc')]);if(config[_0x58a3('0xf')]&&config[_0x58a3('0xf')]['disabled']){ami['on'](_0x58a3('0x10'),this[_0x58a3('0x11')][_0x58a3('0x12')](this));ami['on'](_0x58a3('0x13'),this[_0x58a3('0x14')]['bind'](this));ami['on'](_0x58a3('0x15'),this['voiceAgentReport'][_0x58a3('0x12')](this));ami['on'](_0x58a3('0x16'),this[_0x58a3('0x17')][_0x58a3('0x12')](this));ami['on'](_0x58a3('0x18'),this[_0x58a3('0x19')]['bind'](this));ami['on'](_0x58a3('0x1a'),this[_0x58a3('0x1b')][_0x58a3('0x12')](this));}};Report['prototype'][_0x58a3('0x1c')]=function(_0x2abb56){var _0x3fb4d4;_0x3fb4d4=_[_0x58a3('0x1d')](this[_0x58a3('0x1e')],function(_0xb05137){return _0xb05137[_0x58a3('0x1f')]==_0x2abb56||_0xb05137[_0x58a3('0x20')]==_0x2abb56;});if(_[_0x58a3('0x21')](_0x3fb4d4)){var _0x42888f=_['find'](this[_0x58a3('0xd')],function(_0x23897f){return _0x23897f[_0x58a3('0x1f')]==_0x2abb56||_0x23897f[_0x58a3('0x20')]==_0x2abb56;});if(_0x42888f){_0x3fb4d4=_[_0x58a3('0x1d')](this[_0x58a3('0x1e')],function(_0x376079){return _0x376079['interface']==util[_0x58a3('0x22')](_0x58a3('0x23'),_0x42888f[_0x58a3('0x20')]);});}}return _0x3fb4d4;};Report[_0x58a3('0x24')][_0x58a3('0x11')]=function(_0x134b7e){for(var _0x5140fe=0x0;_0x5140fe<_0x134b7e[_0x58a3('0x25')];_0x5140fe+=0x1){var _0x308555=this[_0x58a3('0x1c')](_0x134b7e[_0x5140fe][_0x58a3('0x26')]);if(_0x308555){_0x134b7e[_0x5140fe][_0x58a3('0x1f')]=_0x308555[_0x58a3('0x1f')];_0x134b7e[_0x5140fe]['assigned']=!![];_0x134b7e[_0x5140fe][_0x58a3('0x27')]=_0x308555[_0x58a3('0x20')];_0x134b7e[_0x5140fe][_0x58a3('0x28')]=_[_0x58a3('0x21')](_0x308555['interface'])?util[_0x58a3('0x22')](_0x58a3('0x23'),_0x308555[_0x58a3('0x20')]):_0x308555['interface'];if(_0x134b7e[_0x5140fe][_0x58a3('0x29')]){_0x134b7e[_0x5140fe]['queuecallercompleteAt']=moment()['format'](_0x58a3('0x2a'));}if(_0x134b7e[_0x5140fe][_0x58a3('0x2b')]){_0x134b7e[_0x5140fe][_0x58a3('0x2c')]=moment()[_0x58a3('0x22')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0x58a3('0x11')](_0x134b7e[_0x5140fe]);}RpcVoiceQueueReport[_0x58a3('0x2d')](_0x134b7e[_0x5140fe]);}};function extractCalleridNumber(_0x59e858){var _0x217b4e=_0x59e858['match'](/<(.*?)>/);return _0x217b4e?_0x217b4e[0x1]:_0x59e858;}Report['prototype']['getAgentByInternal']=function(_0x318eba){for(var _0xc1234c=0x0;_0xc1234c0x0?!![]:![];if(!_0x16e48b){return this['syncQueueSummaryComplete'](this[_0xe07a('0x12')]['completeEvent']);}};VoiceQueueReport[_0xe07a('0x7')][_0xe07a('0x18')]=function(_0x6b73c8){var _0x2d416f=this[_0xe07a('0x12')]['id'];if(this[_0xe07a('0x12')][_0xe07a('0x62')][_0x2d416f]&&this[_0xe07a('0x12')][_0xe07a('0x62')][_0x2d416f][_0x6b73c8[_0xe07a('0x61')]]){this[_0xe07a('0x12')][_0xe07a('0x62')][_0x2d416f][_0x6b73c8[_0xe07a('0x61')]][_0xe07a('0xd')][_0xe07a('0x6b')](_0x6b73c8);}};VoiceQueueReport[_0xe07a('0x7')][_0xe07a('0x15')]=function(_0xd07bf7){var _0x217658=this;try{if(this[_0xe07a('0x59')](_0xd07bf7)&&this[_0xe07a('0x59')](_0xd07bf7[_0xe07a('0x4e')])){logger['debug'](_0xe07a('0x6c'),util[_0xe07a('0x40')](_0xd07bf7,{'showHidden':![],'depth':null}));var _0x10721d=this[_0xe07a('0x10')][_0xd07bf7['queue']];if(_0x10721d){logger['debug'](_0xe07a('0x6d'),_0x10721d[_0xe07a('0x65')]);this[_0xe07a('0x12')][_0xe07a('0x5c')][_0x10721d[_0xe07a('0x65')]]={'summaryEvent':_0xd07bf7};this[_0xe07a('0x12')][_0xe07a('0x6a')]+=0x1;return ami[_0xe07a('0x39')]({'action':_0xe07a('0x62'),'queue':_0x10721d[_0xe07a('0x65')]})[_0xe07a('0x60')](function(_0x5a038e){if(!_0x217658['summary'][_0xe07a('0x62')][_0xd07bf7[_0xe07a('0x61')]]){_0x217658[_0xe07a('0x12')][_0xe07a('0x62')][_0xd07bf7['actionid']]={};}_0x217658[_0xe07a('0x12')][_0xe07a('0x62')][_0xd07bf7[_0xe07a('0x61')]][_0x5a038e[_0xe07a('0x61')]]={'queue':_0x10721d['name'],'agents':[]};})[_0xe07a('0x3c')](function(_0xd28a9c){throw _0xd28a9c;});}}}catch(_0x24b096){logger[_0xe07a('0x3f')](_0xe07a('0x63'),util[_0xe07a('0x40')](_0x24b096,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe07a('0x7')][_0xe07a('0x6e')]=function(_0x2da279){if(this[_0xe07a('0x12')]['statusRequests']>0x0){this['summary'][_0xe07a('0x6f')]=_0x2da279;return;}logger[_0xe07a('0x48')](_0xe07a('0x70'),util[_0xe07a('0x40')](_0x2da279,{'showHidden':![],'depth':null}));this[_0xe07a('0x12')]=initializeSummary();ami['emit'](_0xe07a('0x71'),{});};VoiceQueueReport['prototype'][_0xe07a('0x1c')]=function(_0x24886c){try{if(this[_0xe07a('0x59')](_0x24886c)){logger[_0xe07a('0x48')]('[%s][voiceQueueReport][queuecallerjoin]',_0x24886c[_0xe07a('0x4b')],util[_0xe07a('0x40')](_0x24886c,{'showHidden':![],'depth':null}));if(_[_0xe07a('0x5a')](this[_0xe07a('0xb')][_0x24886c[_0xe07a('0x4b')]])){this[_0xe07a('0xb')][_0x24886c[_0xe07a('0x4b')]]=[];}if(_[_0xe07a('0x5a')](this[_0xe07a('0xe')][_0x24886c[_0xe07a('0x4b')]])){this[_0xe07a('0xe')][_0x24886c[_0xe07a('0x4b')]]={};}var _0x3767e3=new QueueReport();_0x3767e3[_0xe07a('0x4e')]=_0x24886c['queue'];_0x3767e3[_0xe07a('0x55')]=this[_0xe07a('0x10')][_0x3767e3[_0xe07a('0x4e')]]&&this[_0xe07a('0x10')][_0x3767e3[_0xe07a('0x4e')]][_0xe07a('0x55')]?this[_0xe07a('0x10')][_0x3767e3[_0xe07a('0x4e')]][_0xe07a('0x55')]||_0xe07a('0x56'):_0xe07a('0x56');_0x3767e3[_0xe07a('0x72')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3767e3[_0xe07a('0x73')]=_0x24886c[_0xe07a('0x73')];_0x3767e3['count']=_0x24886c[_0xe07a('0x74')];_0x3767e3[_0xe07a('0x4b')]=_0x24886c['uniqueid'];_0x3767e3[_0xe07a('0x75')]=this['channels'][_0x24886c['uniqueid']][_0xe07a('0x75')];logger[_0xe07a('0x76')](_0xe07a('0x77'),_0x3767e3[_0xe07a('0x4e')],_0x3767e3[_0xe07a('0x55')]);Object[_0xe07a('0x68')](_0x3767e3,_['pick'](_0x24886c,_[_0xe07a('0x78')](_0x3767e3)));this[_0xe07a('0xb')][_0x24886c[_0xe07a('0x4b')]][_0xe07a('0x6b')](_0x3767e3);this[_0xe07a('0xe')][_0x24886c[_0xe07a('0x4b')]]=_0x3767e3;this[_0xe07a('0x47')](_0x3767e3,_0xe07a('0x1b'));}}catch(_0x5e579d){logger[_0xe07a('0x3f')]('[%s][voiceQueueReport][queuecallerjoin]',_0x24886c['uniqueid'],util[_0xe07a('0x40')](_0x5e579d,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xe07a('0x1e')]=function(_0x3afa53){try{if(this[_0xe07a('0x59')](_0x3afa53)){logger[_0xe07a('0x48')](_0xe07a('0x79'),_0x3afa53[_0xe07a('0x4b')],util[_0xe07a('0x40')](_0x3afa53,{'showHidden':![],'depth':null}));if(this[_0xe07a('0xb')][_0x3afa53[_0xe07a('0x4b')]]){var _0x261c7b=_[_0xe07a('0x7a')](this[_0xe07a('0xb')][_0x3afa53[_0xe07a('0x4b')]]);_0x261c7b['queuecallercomplete']=![];_0x261c7b[_0xe07a('0x7b')]=null;_0x261c7b[_0xe07a('0x7c')]=_0x3afa53['holdtime'];_0x261c7b[_0xe07a('0x7d')]=_0x3afa53[_0xe07a('0x7d')];_0x261c7b['queuecallerabandon']=!![];_0x261c7b[_0xe07a('0x7e')]=moment()[_0xe07a('0x4c')](_0xe07a('0x7f'));_0x261c7b[_0xe07a('0x80')]=_0xe07a('0x81');_0x261c7b[_0xe07a('0x82')]=null;logger['info'](_0xe07a('0x83'),_0x261c7b[_0xe07a('0x4e')],_0x261c7b['type']);this[_0xe07a('0xe')][_0x3afa53[_0xe07a('0x4b')]]=_0x261c7b;this[_0xe07a('0x44')](_0x261c7b,'queuecallerabandon');}}}catch(_0x237ea9){logger['error'](_0xe07a('0x79'),_0x3afa53[_0xe07a('0x4b')],util[_0xe07a('0x40')](_0x237ea9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe07a('0x7')][_0xe07a('0x20')]=function(_0x3f6bee){try{if(this[_0xe07a('0x59')](_0x3f6bee)){logger[_0xe07a('0x48')]('[%s][voiceQueueReport][queuecallerleave]',_0x3f6bee[_0xe07a('0x4b')],util[_0xe07a('0x40')](_0x3f6bee,{'showHidden':![],'depth':null}));if(this[_0xe07a('0xb')][_0x3f6bee[_0xe07a('0x4b')]]){var _0x40a62b=_['last'](this[_0xe07a('0xb')][_0x3f6bee[_0xe07a('0x4b')]]);_0x40a62b['queuecallerleaveAt']=moment()[_0xe07a('0x4c')](_0xe07a('0x7f'));_0x40a62b[_0xe07a('0x84')]=_0x3f6bee[_0xe07a('0x84')];_0x40a62b[_0xe07a('0x85')]=_0x3f6bee['connectedlinename'];logger[_0xe07a('0x76')](_0xe07a('0x86'),_0x40a62b[_0xe07a('0x4e')],_0x40a62b[_0xe07a('0x55')],_0x3f6bee['connectedlinenum'],_0x3f6bee[_0xe07a('0x85')]);this[_0xe07a('0xe')][_0x3f6bee[_0xe07a('0x4b')]]=_0x40a62b;this[_0xe07a('0x47')](_0x40a62b,_0xe07a('0x1f'));}}}catch(_0x2ad9c7){logger['error'](_0xe07a('0x87'),_0x3f6bee['uniqueid'],util[_0xe07a('0x40')](_0x2ad9c7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe07a('0x7')][_0xe07a('0x23')]=function(_0x42795f){try{if(this[_0xe07a('0x59')](_0x42795f)){logger[_0xe07a('0x48')](_0xe07a('0x88'),_0x42795f[_0xe07a('0x4b')],util['inspect'](_0x42795f,{'showHidden':![],'depth':null}));if(this[_0xe07a('0xb')][_0x42795f[_0xe07a('0x4b')]]){var _0x688d2=_[_0xe07a('0x7a')](this[_0xe07a('0xb')][_0x42795f[_0xe07a('0x4b')]]);_0x688d2[_0xe07a('0x36')]=!![];_0x688d2[_0xe07a('0x80')]='COMPLETEDBYAGENT';logger[_0xe07a('0x76')](_0xe07a('0x89'),_0x688d2['queue'],_0x688d2[_0xe07a('0x55')]);}}}catch(_0x33c37c){logger['error'](_0xe07a('0x88'),_0x42795f[_0xe07a('0x4b')],util[_0xe07a('0x40')](_0x33c37c,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xe07a('0x8a')]=function(_0x2146ac){try{if(this[_0xe07a('0x59')](_0x2146ac)){logger['debug'](_0xe07a('0x8b'),_0x2146ac[_0xe07a('0x4b')],util[_0xe07a('0x40')](_0x2146ac,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2146ac[_0xe07a('0x4b')]]){var _0x93e901=_['last'](this[_0xe07a('0xb')][_0x2146ac['uniqueid']]);_0x93e901[_0xe07a('0x1d')]=![];_0x93e901[_0xe07a('0x7e')]=null;_0x93e901['assigned']=!![];_0x93e901['lastAssignedTo']=_0x2146ac[_0xe07a('0x8c')];_0x93e901[_0xe07a('0x7c')]=_0x2146ac[_0xe07a('0x7c')];_0x93e901['queuecallercomplete']=!![];_0x93e901[_0xe07a('0x35')]=![];_0x93e901[_0xe07a('0x8d')]=null;if(!_0x93e901[_0xe07a('0x8e')]){if(_0x2146ac['reason']==_0xe07a('0x8e')){_0x93e901[_0xe07a('0x80')]=_0xe07a('0x8f');logger[_0xe07a('0x76')](_0xe07a('0x90'),_0x93e901[_0xe07a('0x4e')],_0x93e901['type']);}else{if(_[_0xe07a('0x91')](_0x2146ac[_0xe07a('0x3b')][_0xe07a('0x92')](),_0xe07a('0x93'))){if(this[_0xe07a('0xb')][_0x2146ac[_0xe07a('0x94')]]){var _0x427a3a=_[_0xe07a('0x7a')](this[_0xe07a('0xb')][_0x2146ac[_0xe07a('0x94')]]);_0x427a3a[_0xe07a('0x36')]=![];_0x427a3a[_0xe07a('0x35')]=!![];_0x427a3a[_0xe07a('0x8d')]=moment(_0x93e901[_0xe07a('0x72')])['add'](_0x2146ac[_0xe07a('0x7c')],_0xe07a('0x95'))['format'](_0xe07a('0x7f'));_0x427a3a[_0xe07a('0x80')]='FORWARDTRANSFER';_0x427a3a['transfer']=!![];_0x427a3a[_0xe07a('0x96')]=_0xe07a('0x97');_0x427a3a[_0xe07a('0x98')]=_0x2146ac[_0xe07a('0x99')];_0x427a3a[_0xe07a('0x9a')]=_0x2146ac['uniqueid'];logger['info'](_0xe07a('0x9b'),_0x427a3a[_0xe07a('0x4e')],_0x427a3a[_0xe07a('0x55')]);var _0x15b31b=this['queueReports'][_0x2146ac['linkedid']];this[_0xe07a('0xb')][_0x2146ac[_0xe07a('0x94')]]=this[_0xe07a('0xb')][_0x2146ac[_0xe07a('0x4b')]];this['queueReports'][_0x2146ac[_0xe07a('0x4b')]]=_0x15b31b;}}else{_0x93e901['queuecallerexitreason']='COMPLETEDBY'+_0x2146ac['reason']['toUpperCase']();logger[_0xe07a('0x76')](_0xe07a('0x9c'),_0x93e901[_0xe07a('0x4e')],_0x93e901['type'],_0x93e901[_0xe07a('0x80')]);}}}this[_0xe07a('0xe')][_0x2146ac[_0xe07a('0x4b')]]=_0x93e901;}}}catch(_0x236792){logger[_0xe07a('0x3f')](_0xe07a('0x8b'),_0x2146ac[_0xe07a('0x4b')],util['inspect'](_0x236792,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe07a('0x7')][_0xe07a('0x9d')]=function(_0x3feb07){try{if(this[_0xe07a('0x59')](_0x3feb07)){logger[_0xe07a('0x48')](_0xe07a('0x9e'),_0x3feb07[_0xe07a('0x4b')],util['inspect'](_0x3feb07,{'showHidden':![],'depth':null}));this[_0xe07a('0x9f')](_0x3feb07[_0xe07a('0x4b')],_[_0xe07a('0x78')](_0x3feb07[_0xe07a('0xa0')])[0x0],_0x3feb07[_0xe07a('0xa1')]);if(this['queueReports'][_0x3feb07[_0xe07a('0x4b')]]){var _0x4e7579=_['last'](this['queueReports'][_0x3feb07[_0xe07a('0x4b')]]);if(_0x4e7579){if(this['isNotNull'](_0x3feb07[_0xe07a('0xa0')])&&this[_0xe07a('0x59')](_0x3feb07[_0xe07a('0xa0')][_0xe07a('0x62')])){switch(_0x3feb07[_0xe07a('0xa1')]){case _0xe07a('0xa2'):_0x4e7579[_0xe07a('0x35')]=![];_0x4e7579[_0xe07a('0x8d')]=null;break;case _0xe07a('0xa3'):_0x4e7579[_0xe07a('0xa4')]=_0xe07a('0xa5');_0x4e7579[_0xe07a('0x35')]=!![];_0x4e7579[_0xe07a('0x8d')]=moment()[_0xe07a('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0x4e7579['queuecallerleaveAt']=moment()[_0xe07a('0x4c')](_0xe07a('0x7f'));logger['debug']('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x3feb07[_0xe07a('0x4b')],util[_0xe07a('0x40')](_0x4e7579,{'showHidden':![],'depth':null}));ami[_0xe07a('0x46')](_0xe07a('0xa6'),_0x4e7579);break;default:_0x4e7579['queuecallerexit']=!![];_0x4e7579['queuecallerexitAt']=moment()[_0xe07a('0x4c')](_0xe07a('0x7f'));_0x4e7579['queuecallerleaveAt']=moment()['format'](_0xe07a('0x7f'));}_0x4e7579[_0xe07a('0x1d')]=![];_0x4e7579[_0xe07a('0x7e')]=null;_0x4e7579[_0xe07a('0x80')]=_0x3feb07[_0xe07a('0xa1')];this['channels'][_0x3feb07[_0xe07a('0x4b')]]=_0x4e7579;this['emitVoiceQueueChannelRemove'](_0x4e7579,'varset');}else if(this[_0xe07a('0x59')](_0x3feb07[_0xe07a('0xa0')])&&this[_0xe07a('0x59')](_0x3feb07['variable']['queueposition'])){if(!_0x4e7579[_0xe07a('0x1d')]){_0x4e7579[_0xe07a('0x35')]=!![];_0x4e7579['queuecallerexitAt']=moment()['format'](_0xe07a('0x7f'));_0x4e7579[_0xe07a('0x80')]='EXITWITHKEY';_0x4e7579['queuecallerleaveAt']=moment()[_0xe07a('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x3feb07[_0xe07a('0x4b')]]=_0x4e7579;}}logger[_0xe07a('0x76')](_0xe07a('0xa7'),_0x3feb07[_0xe07a('0x4b')],_0x4e7579['queue'],_0x4e7579[_0xe07a('0x55')],_[_0xe07a('0x78')](_0x3feb07[_0xe07a('0xa0')])[0x0],_0x3feb07['value']);_0x4e7579[_0xe07a('0x13')]=this[_0xe07a('0x13')][_0x3feb07[_0xe07a('0x4b')]];}}}}catch(_0x4a2817){logger[_0xe07a('0x3f')](_0xe07a('0x9e'),_0x3feb07[_0xe07a('0x4b')],util[_0xe07a('0x40')](_0x4a2817,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe07a('0x7')][_0xe07a('0x9f')]=function(_0x2c5418,_0x19277e,_0xec5d1d){var _0xedd629=[_0xe07a('0xa8'),_0xe07a('0xa9'),_0xe07a('0xaa'),'rtpaudioqosjitterbridged','rtpaudioqosloss',_0xe07a('0xab'),_0xe07a('0xac'),_0xe07a('0xad'),_0xe07a('0xae'),_0xe07a('0xaf'),_0xe07a('0xb0'),'bridgepvtcallid',_0xe07a('0xb1'),_0xe07a('0xb2'),_0xe07a('0xb3'),_0xe07a('0xb4'),_0xe07a('0x8c'),_0xe07a('0xb5'),_0xe07a('0xb6')];if(!_[_0xe07a('0x38')](_0x19277e)&&!_[_0xe07a('0xb7')](_0xedd629,_0x19277e)){if(_['isUndefined'](this[_0xe07a('0x13')][_0x2c5418])){this[_0xe07a('0x13')][_0x2c5418]={};}this[_0xe07a('0x13')][_0x2c5418][_0x19277e]=_0xec5d1d;}};VoiceQueueReport[_0xe07a('0x7')]['handleHangup']=function(_0x2dbd76,_0x8445d3,_0xa3934c){try{var _0x32d148={};if(this[_0xe07a('0xb')][_0x2dbd76]){for(var _0x1ea342=0x0;_0x1ea3420x0?!![]:![];if(!_0x44ca42){return this['syncQueueSummaryComplete'](this[_0x685c('0x46')][_0x685c('0x68')]);}};VoiceQueueReport[_0x685c('0x8')]['syncQueueMember']=function(_0x16c29a){var _0x4d49f8=this[_0x685c('0x46')]['id'];if(this[_0x685c('0x46')][_0x685c('0x5e')][_0x4d49f8]&&this[_0x685c('0x46')]['queuestatus'][_0x4d49f8][_0x16c29a[_0x685c('0x5c')]]){this[_0x685c('0x46')][_0x685c('0x5e')][_0x4d49f8][_0x16c29a[_0x685c('0x5c')]][_0x685c('0xd')][_0x685c('0x69')](_0x16c29a);}};VoiceQueueReport[_0x685c('0x8')][_0x685c('0x13')]=function(_0x3acf01){var _0x44f93f=this;try{if(this[_0x685c('0x6a')](_0x3acf01)&&this[_0x685c('0x6a')](_0x3acf01[_0x685c('0x4d')])){logger[_0x685c('0x48')]('[voiceQueueReport][queuesummary]\x20event:',util[_0x685c('0x41')](_0x3acf01,{'showHidden':![],'depth':null}));var _0x5b8d56=this[_0x685c('0xf')][_0x3acf01[_0x685c('0x4d')]];if(_0x5b8d56){logger['debug']('[voiceQueueReport][queuesummary]\x20name:%s',_0x5b8d56[_0x685c('0x59')]);this[_0x685c('0x46')][_0x685c('0x61')][_0x5b8d56[_0x685c('0x59')]]={'summaryEvent':_0x3acf01};this[_0x685c('0x46')][_0x685c('0x67')]+=0x1;return ami[_0x685c('0x3b')]({'action':_0x685c('0x5e'),'queue':_0x5b8d56[_0x685c('0x59')]})[_0x685c('0x5b')](function(_0x30aff3){if(!_0x44f93f[_0x685c('0x46')][_0x685c('0x5e')][_0x3acf01[_0x685c('0x5c')]]){_0x44f93f['summary']['queuestatus'][_0x3acf01[_0x685c('0x5c')]]={};}_0x44f93f['summary'][_0x685c('0x5e')][_0x3acf01[_0x685c('0x5c')]][_0x30aff3[_0x685c('0x5c')]]={'queue':_0x5b8d56[_0x685c('0x59')],'agents':[]};})[_0x685c('0x3e')](function(_0x25cee0){throw _0x25cee0;});}}}catch(_0x303079){logger['error'](_0x685c('0x5f'),util['inspect'](_0x303079,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x685c('0x8')][_0x685c('0x16')]=function(_0x341834){if(this[_0x685c('0x46')][_0x685c('0x67')]>0x0){this[_0x685c('0x46')][_0x685c('0x68')]=_0x341834;return;}logger['debug'](_0x685c('0x6b'),util[_0x685c('0x41')](_0x341834,{'showHidden':![],'depth':null}));this[_0x685c('0x46')]=initializeSummary();ami[_0x685c('0x4e')](_0x685c('0x6c'),{});};VoiceQueueReport[_0x685c('0x8')][_0x685c('0x1b')]=function(_0x54af43){try{if(this[_0x685c('0x6a')](_0x54af43)){logger[_0x685c('0x48')](_0x685c('0x6d'),_0x54af43['uniqueid'],util[_0x685c('0x41')](_0x54af43,{'showHidden':![],'depth':null}));if(_[_0x685c('0x6e')](this[_0x685c('0x42')][_0x54af43['uniqueid']])){this[_0x685c('0x42')][_0x54af43['uniqueid']]=[];}if(_[_0x685c('0x6e')](this[_0x685c('0x39')][_0x54af43[_0x685c('0x4a')]])){this['channels'][_0x54af43[_0x685c('0x4a')]]={};}var _0xa0012c=new QueueReport();_0xa0012c[_0x685c('0x4d')]=_0x54af43[_0x685c('0x4d')];_0xa0012c['type']=this[_0x685c('0xf')][_0xa0012c[_0x685c('0x4d')]]&&this['voiceQueues'][_0xa0012c[_0x685c('0x4d')]][_0x685c('0x56')]?this[_0x685c('0xf')][_0xa0012c[_0x685c('0x4d')]][_0x685c('0x56')]||_0x685c('0x57'):_0x685c('0x57');_0xa0012c['queuecallerjoinAt']=moment()[_0x685c('0x4b')](_0x685c('0x6f'));_0xa0012c[_0x685c('0x70')]=_0x54af43['position'];_0xa0012c[_0x685c('0x71')]=_0x54af43[_0x685c('0x71')];_0xa0012c[_0x685c('0x4a')]=_0x54af43[_0x685c('0x4a')];_0xa0012c[_0x685c('0x72')]=this[_0x685c('0x39')][_0x54af43[_0x685c('0x4a')]][_0x685c('0x72')];logger['info'](_0x685c('0x73'),_0xa0012c[_0x685c('0x4d')],_0xa0012c[_0x685c('0x56')]);Object['assign'](_0xa0012c,_[_0x685c('0x74')](_0x54af43,_[_0x685c('0x75')](_0xa0012c)));this[_0x685c('0x42')][_0x54af43[_0x685c('0x4a')]][_0x685c('0x69')](_0xa0012c);this[_0x685c('0x39')][_0x54af43[_0x685c('0x4a')]]=_0xa0012c;this[_0x685c('0x76')](_0xa0012c,_0x685c('0x1a'));}}catch(_0x1543f6){logger[_0x685c('0x40')](_0x685c('0x6d'),_0x54af43[_0x685c('0x4a')],util[_0x685c('0x41')](_0x1543f6,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x685c('0x1c')]=function(_0x24149e){try{if(this['isNotNull'](_0x24149e)){logger['debug'](_0x685c('0x77'),_0x24149e['uniqueid'],util[_0x685c('0x41')](_0x24149e,{'showHidden':![],'depth':null}));if(this[_0x685c('0x42')][_0x24149e[_0x685c('0x4a')]]){var _0x43458e=_[_0x685c('0x78')](this[_0x685c('0x42')][_0x24149e[_0x685c('0x4a')]]);_0x43458e[_0x685c('0x79')]=![];_0x43458e[_0x685c('0x7a')]=null;_0x43458e[_0x685c('0x7b')]=_0x24149e[_0x685c('0x7b')];_0x43458e[_0x685c('0x7c')]=_0x24149e[_0x685c('0x7c')];_0x43458e[_0x685c('0x37')]=!![];_0x43458e[_0x685c('0x7d')]=moment()[_0x685c('0x4b')](_0x685c('0x6f'));_0x43458e[_0x685c('0x51')]=_0x685c('0x7e');_0x43458e[_0x685c('0x7f')]=null;logger[_0x685c('0x80')](_0x685c('0x81'),_0x43458e[_0x685c('0x4d')],_0x43458e[_0x685c('0x56')]);this[_0x685c('0x39')][_0x24149e['uniqueid']]=_0x43458e;this[_0x685c('0x4f')](_0x43458e,'queuecallerabandon');}}}catch(_0x2b1a93){logger[_0x685c('0x40')]('[%s][voiceQueueReport][queuecallerabandon]',_0x24149e[_0x685c('0x4a')],util[_0x685c('0x41')](_0x2b1a93,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x685c('0x8')][_0x685c('0x1d')]=function(_0x558fa2){try{if(this['isNotNull'](_0x558fa2)){logger[_0x685c('0x48')](_0x685c('0x82'),_0x558fa2[_0x685c('0x4a')],util['inspect'](_0x558fa2,{'showHidden':![],'depth':null}));if(this[_0x685c('0x42')][_0x558fa2[_0x685c('0x4a')]]){var _0x3aa6c4=_[_0x685c('0x78')](this[_0x685c('0x42')][_0x558fa2[_0x685c('0x4a')]]);_0x3aa6c4[_0x685c('0x83')]=moment()[_0x685c('0x4b')](_0x685c('0x6f'));_0x3aa6c4[_0x685c('0x84')]=_0x558fa2[_0x685c('0x84')];_0x3aa6c4['connectedlinename']=_0x558fa2[_0x685c('0x85')];logger['info'](_0x685c('0x86'),_0x3aa6c4[_0x685c('0x4d')],_0x3aa6c4[_0x685c('0x56')],_0x558fa2[_0x685c('0x84')],_0x558fa2[_0x685c('0x85')]);this[_0x685c('0x39')][_0x558fa2[_0x685c('0x4a')]]=_0x3aa6c4;this[_0x685c('0x76')](_0x3aa6c4,'queuecallerleave');}}}catch(_0x1a24e3){logger['error'](_0x685c('0x82'),_0x558fa2[_0x685c('0x4a')],util['inspect'](_0x1a24e3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x685c('0x8')][_0x685c('0x21')]=function(_0x5af948){try{if(this[_0x685c('0x6a')](_0x5af948)){logger['debug'](_0x685c('0x87'),_0x5af948[_0x685c('0x4a')],util[_0x685c('0x41')](_0x5af948,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x5af948[_0x685c('0x4a')]]){var _0x3c1189=_[_0x685c('0x78')](this[_0x685c('0x42')][_0x5af948['uniqueid']]);_0x3c1189['queuecallercomplete']=!![];_0x3c1189[_0x685c('0x51')]=_0x685c('0x88');logger[_0x685c('0x80')](_0x685c('0x89'),_0x3c1189['queue'],_0x3c1189[_0x685c('0x56')]);}}}catch(_0x4ff49c){logger[_0x685c('0x40')]('[%s][voiceQueueReport][agentconnect]',_0x5af948[_0x685c('0x4a')],util[_0x685c('0x41')](_0x4ff49c,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x685c('0x1f')]=function(_0x26fbcd){try{if(this[_0x685c('0x6a')](_0x26fbcd)){logger[_0x685c('0x48')](_0x685c('0x8a'),_0x26fbcd[_0x685c('0x4a')],util[_0x685c('0x41')](_0x26fbcd,{'showHidden':![],'depth':null}));if(this[_0x685c('0x42')][_0x26fbcd[_0x685c('0x4a')]]){var _0x51fb53=_['last'](this[_0x685c('0x42')][_0x26fbcd[_0x685c('0x4a')]]);_0x51fb53[_0x685c('0x37')]=![];_0x51fb53[_0x685c('0x7d')]=null;_0x51fb53[_0x685c('0x8b')]=!![];_0x51fb53[_0x685c('0x7f')]=_0x26fbcd[_0x685c('0x8c')];_0x51fb53['holdtime']=_0x26fbcd[_0x685c('0x7b')];_0x51fb53['queuecallercomplete']=!![];_0x51fb53[_0x685c('0x36')]=![];_0x51fb53[_0x685c('0x8d')]=null;if(!_0x51fb53[_0x685c('0x8e')]){if(_0x26fbcd['reason']==_0x685c('0x8e')){_0x51fb53[_0x685c('0x51')]=_0x685c('0x8f');logger[_0x685c('0x80')](_0x685c('0x90'),_0x51fb53[_0x685c('0x4d')],_0x51fb53[_0x685c('0x56')]);}else{if(_[_0x685c('0x91')](_0x26fbcd[_0x685c('0x3d')][_0x685c('0x92')](),'local/')){if(this['queueReports'][_0x26fbcd[_0x685c('0x93')]]){var _0x249580=_[_0x685c('0x78')](this[_0x685c('0x42')][_0x26fbcd[_0x685c('0x93')]]);_0x249580['queuecallercomplete']=![];_0x249580[_0x685c('0x36')]=!![];_0x249580['queuecallerexitAt']=moment(_0x51fb53[_0x685c('0x94')])[_0x685c('0x95')](_0x26fbcd['holdtime'],'seconds')[_0x685c('0x4b')](_0x685c('0x6f'));_0x249580[_0x685c('0x51')]=_0x685c('0x96');_0x249580[_0x685c('0x8e')]=!![];_0x249580[_0x685c('0x97')]=_0x685c('0x98');_0x249580['transferexten']=_0x26fbcd[_0x685c('0x99')];_0x249580[_0x685c('0x9a')]=_0x26fbcd[_0x685c('0x4a')];logger['info'](_0x685c('0x9b'),_0x249580[_0x685c('0x4d')],_0x249580[_0x685c('0x56')]);var _0x484864=this[_0x685c('0x42')][_0x26fbcd[_0x685c('0x93')]];this[_0x685c('0x42')][_0x26fbcd[_0x685c('0x93')]]=this[_0x685c('0x42')][_0x26fbcd['uniqueid']];this[_0x685c('0x42')][_0x26fbcd[_0x685c('0x4a')]]=_0x484864;}}else{_0x51fb53[_0x685c('0x51')]='COMPLETEDBY'+_0x26fbcd[_0x685c('0x9c')][_0x685c('0x9d')]();logger[_0x685c('0x80')](_0x685c('0x9e'),_0x51fb53[_0x685c('0x4d')],_0x51fb53['type'],_0x51fb53[_0x685c('0x51')]);}}}this[_0x685c('0x39')][_0x26fbcd[_0x685c('0x4a')]]=_0x51fb53;}}}catch(_0x5384ee){logger[_0x685c('0x40')](_0x685c('0x8a'),_0x26fbcd['uniqueid'],util[_0x685c('0x41')](_0x5384ee,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncVarSet']=function(_0x47ed22){try{if(this['isNotNull'](_0x47ed22)){logger['debug'](_0x685c('0x9f'),_0x47ed22[_0x685c('0x4a')],util['inspect'](_0x47ed22,{'showHidden':![],'depth':null}));this['addVariable'](_0x47ed22[_0x685c('0x4a')],_[_0x685c('0x75')](_0x47ed22[_0x685c('0xa0')])[0x0],_0x47ed22[_0x685c('0xa1')]);if(this[_0x685c('0x42')][_0x47ed22[_0x685c('0x4a')]]){var _0x505305=_[_0x685c('0x78')](this[_0x685c('0x42')][_0x47ed22[_0x685c('0x4a')]]);if(_0x505305){if(this['isNotNull'](_0x47ed22['variable'])&&this['isNotNull'](_0x47ed22[_0x685c('0xa0')][_0x685c('0x5e')])){switch(_0x47ed22[_0x685c('0xa1')]){case'CONTINUE':_0x505305[_0x685c('0x36')]=![];_0x505305[_0x685c('0x8d')]=null;break;case'TIMEOUT':_0x505305[_0x685c('0xa2')]=_0x685c('0xa3');_0x505305['queuecallerexit']=!![];_0x505305[_0x685c('0x8d')]=moment()[_0x685c('0x4b')](_0x685c('0x6f'));_0x505305[_0x685c('0x83')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');logger[_0x685c('0x48')](_0x685c('0xa4'),_0x47ed22['uniqueid'],util[_0x685c('0x41')](_0x505305,{'showHidden':![],'depth':null}));ami[_0x685c('0x4e')]('custom:timeout',_0x505305);break;default:_0x505305[_0x685c('0x36')]=!![];_0x505305[_0x685c('0x8d')]=moment()[_0x685c('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');_0x505305[_0x685c('0x83')]=moment()[_0x685c('0x4b')](_0x685c('0x6f'));}_0x505305[_0x685c('0x37')]=![];_0x505305[_0x685c('0x7d')]=null;_0x505305[_0x685c('0x51')]=_0x47ed22[_0x685c('0xa1')];this[_0x685c('0x39')][_0x47ed22[_0x685c('0x4a')]]=_0x505305;this['emitVoiceQueueChannelRemove'](_0x505305,_0x685c('0x22'));}else if(this[_0x685c('0x6a')](_0x47ed22[_0x685c('0xa0')])&&this[_0x685c('0x6a')](_0x47ed22[_0x685c('0xa0')][_0x685c('0xa5')])){if(!_0x505305['queuecallerabandon']){_0x505305[_0x685c('0x36')]=!![];_0x505305['queuecallerexitAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x505305[_0x685c('0x51')]=_0x685c('0xa6');_0x505305['queuecallerleaveAt']=moment()[_0x685c('0x4b')](_0x685c('0x6f'));this[_0x685c('0x39')][_0x47ed22[_0x685c('0x4a')]]=_0x505305;}}logger[_0x685c('0x80')](_0x685c('0xa7'),_0x47ed22['uniqueid'],_0x505305[_0x685c('0x4d')],_0x505305[_0x685c('0x56')],_[_0x685c('0x75')](_0x47ed22[_0x685c('0xa0')])[0x0],_0x47ed22[_0x685c('0xa1')]);_0x505305[_0x685c('0x11')]=this[_0x685c('0x11')][_0x47ed22['uniqueid']];}}}}catch(_0x2b0243){logger['error']('[%s][voiceQueueReport][varset]',_0x47ed22[_0x685c('0x4a')],util[_0x685c('0x41')](_0x2b0243,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x685c('0x8')][_0x685c('0xa8')]=function(_0x49596b,_0x449455,_0x1bee31){var _0x4e8de6=[_0x685c('0xa9'),'rtpaudioqosbridged',_0x685c('0xaa'),_0x685c('0xab'),_0x685c('0xac'),_0x685c('0xad'),_0x685c('0xae'),_0x685c('0xaf'),_0x685c('0xb0'),_0x685c('0xb1'),_0x685c('0xb2'),_0x685c('0xb3'),_0x685c('0xb4'),_0x685c('0xb5'),_0x685c('0xb6'),'memberlastcall',_0x685c('0x8c'),'memberpenalty',_0x685c('0xb7')];if(!_[_0x685c('0xb8')](_0x449455)&&!_[_0x685c('0xb9')](_0x4e8de6,_0x449455)){if(_[_0x685c('0x6e')](this[_0x685c('0x11')][_0x49596b])){this['variables'][_0x49596b]={};}this['variables'][_0x49596b][_0x449455]=_0x1bee31;}};VoiceQueueReport['prototype']['handleHangup']=function(_0x4023cb,_0x3d36d5,_0x123837){try{var _0x1a03a0={};if(this[_0x685c('0x42')][_0x4023cb]){for(var _0x49568e=0x0;_0x49568e=0x0?moment(_0x5d0405[_0x90f0('0x16')])[_0x90f0('0xe')](_0x5d0405[_0x90f0('0x17')],_0x90f0('0xf')):null,'data1':_0x90f0('0x18'),'data2':_0x5d0405[_0x90f0('0x12')],'data3':_0x5d0405[_0x90f0('0x11')],'data4':_0x5d0405[_0x90f0('0x19')]||null,'role':'agent','internal':_0x5d0405[_0x90f0('0x12')]?_['toNumber'](_0x5d0405['accountcode']):undefined,'uniqueid':_0x5d0405[_0x90f0('0x14')]},'log':_0x90f0('0x7')});}; \ No newline at end of file +var _0x4384=['agent','toNumber','accountcode','voiceDialReport','membername','starttime','endtime','outbound','dialstring','uniqueid','lodash','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','interface','format','SIP/%s','TALKING','diff','queuecallerleaveAt','seconds','inbound','calleridnum','exten','queue'];(function(_0x47a094,_0x7a94eb){var _0x597dc3=function(_0xf041cc){while(--_0xf041cc){_0x47a094['push'](_0x47a094['shift']());}};_0x597dc3(++_0x7a94eb);}(_0x4384,0x1a0));var _0x4438=function(_0x36779f,_0x3ce119){_0x36779f=_0x36779f-0x0;var _0x387339=_0x4384[_0x36779f];return _0x387339;};'use strict';var moment=require('moment');var _=require(_0x4438('0x0'));var util=require('util');var client=require('../client');exports[_0x4438('0x1')]=function(_0x6d7526){var _0x2402e2=_0x6d7526[_0x4438('0x2')]||_0x6d7526[_0x4438('0x3')];return client[_0x4438('0x4')](_0x4438('0x5'),{'body':{'channel':_0x4438('0x6'),'membername':_0x6d7526[_0x4438('0x7')],'interface':_['isNil'](_0x6d7526[_0x4438('0x8')])?util[_0x4438('0x9')](_0x4438('0xa'),_0x6d7526[_0x4438('0x7')]):_0x6d7526[_0x4438('0x8')],'type':_0x4438('0xb'),'enterAt':_0x6d7526['queuecallerleaveAt'],'exitAt':_0x2402e2,'duration':moment(_0x2402e2)[_0x4438('0xc')](_0x6d7526[_0x4438('0xd')],_0x4438('0xe')),'data1':_0x4438('0xf'),'data2':_0x6d7526[_0x4438('0x10')],'data3':_0x6d7526[_0x4438('0x11')],'data4':null,'data5':_0x6d7526[_0x4438('0x12')],'role':_0x4438('0x13'),'internal':_0x6d7526['accountcode']?_[_0x4438('0x14')](_0x6d7526[_0x4438('0x15')]):undefined,'uniqueid':_0x6d7526['uniqueid']},'log':'CreateMemberReport'});};exports[_0x4438('0x16')]=function(_0x510b8a){return client[_0x4438('0x4')](_0x4438('0x5'),{'body':{'channel':_0x4438('0x6'),'membername':_0x510b8a[_0x4438('0x17')],'interface':_0x510b8a[_0x4438('0x8')],'type':_0x4438('0xb'),'enterAt':_0x510b8a[_0x4438('0x18')],'exitAt':_0x510b8a[_0x4438('0x19')],'duration':moment(_0x510b8a[_0x4438('0x19')])[_0x4438('0xc')](_0x510b8a[_0x4438('0x18')],'seconds')>=0x0?moment(_0x510b8a[_0x4438('0x19')])[_0x4438('0xc')](_0x510b8a[_0x4438('0x18')],_0x4438('0xe')):null,'data1':_0x4438('0x1a'),'data2':_0x510b8a[_0x4438('0x15')],'data3':_0x510b8a[_0x4438('0x11')],'data4':_0x510b8a[_0x4438('0x1b')]||null,'role':'agent','internal':_0x510b8a['accountcode']?_[_0x4438('0x14')](_0x510b8a['accountcode']):undefined,'uniqueid':_0x510b8a[_0x4438('0x1c')]},'log':'CreateMemberReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 6ac583e..01dca4c 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 _0x18a6=['stopRecordingOnTransfer','Request','ShowSetting'];(function(_0x3e32a8,_0x255953){var _0x2997b0=function(_0x2d564a){while(--_0x2d564a){_0x3e32a8['push'](_0x3e32a8['shift']());}};_0x2997b0(++_0x255953);}(_0x18a6,0x190));var _0x618a=function(_0x1c4030,_0x3b0b50){_0x1c4030=_0x1c4030-0x0;var _0x357f16=_0x18a6[_0x1c4030];return _0x357f16;};'use strict';var client=require('../client');exports['getSettings']=function(){return client[_0x618a('0x0')](_0x618a('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x618a('0x2'),'previewRecallmeReminderInterval']},'log':'GetSettings'});}; \ No newline at end of file +var _0xfde3=['GetSettings','../client','getSettings','Request','ShowSetting','previewRecallmeReminderInterval'];(function(_0x2de246,_0x5871fc){var _0x3b03ba=function(_0xb4438){while(--_0xb4438){_0x2de246['push'](_0x2de246['shift']());}};_0x3b03ba(++_0x5871fc);}(_0xfde3,0x19f));var _0x3fde=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xfde3[_0x21a9d9];return _0x46adce;};'use strict';var client=require(_0x3fde('0x0'));exports[_0x3fde('0x1')]=function(){return client[_0x3fde('0x2')](_0x3fde('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer',_0x3fde('0x4')]},'log':_0x3fde('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 3fc2708..9235e2a 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 _0x9137=['getTemplates','GetTemplate','name','../client'];(function(_0x44afb4,_0x51d8dc){var _0x3f3779=function(_0x3c2c2e){while(--_0x3c2c2e){_0x44afb4['push'](_0x44afb4['shift']());}};_0x3f3779(++_0x51d8dc);}(_0x9137,0x7b));var _0x7913=function(_0x15fab0,_0x416c7d){_0x15fab0=_0x15fab0-0x0;var _0x1b41a8=_0x9137[_0x15fab0];return _0x1b41a8;};'use strict';var client=require(_0x7913('0x0'));exports[_0x7913('0x1')]=function(_0x569cdc){return function(_0x35075d){return client['Request'](_0x7913('0x2'),{'options':{'raw':!![],'attributes':['id',_0x7913('0x3'),'html']},'log':_0x7913('0x2')});};}; \ No newline at end of file +var _0x653d=['Request','GetTemplate','html','../client','getTemplates'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x653d,0xfd));var _0xd653=function(_0x5c22a5,_0x59266a){_0x5c22a5=_0x5c22a5-0x0;var _0x365a7e=_0x653d[_0x5c22a5];return _0x365a7e;};'use strict';var client=require(_0xd653('0x0'));exports[_0xd653('0x1')]=function(_0x3a8ee1){return function(_0x30be82){return client[_0xd653('0x2')](_0xd653('0x3'),{'options':{'raw':!![],'attributes':['id','name',_0xd653('0x4')]},'log':_0xd653('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 7332f66..d719265 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 _0x2410=['operator','value','AnyConditions','Action','Actions','data1','data2','data3','data4','data5','GetTrigger','getTriggers','Request','channel','status','Condition','field'];(function(_0x47b8c8,_0xf752d9){var _0x2fd1fd=function(_0x1d33fd){while(--_0x1d33fd){_0x47b8c8['push'](_0x47b8c8['shift']());}};_0x2fd1fd(++_0xf752d9);}(_0x2410,0x82));var _0x0241=function(_0x11013c,_0x1abc82){_0x11013c=_0x11013c-0x0;var _0x56cf79=_0x2410[_0x11013c];return _0x56cf79;};'use strict';var client=require('../client');exports[_0x0241('0x0')]=function(_0x101ad4){return function(_0x6d213e){return client[_0x0241('0x1')]('GetTrigger',{'options':{'raw':![],'attributes':['id','name',_0x0241('0x2'),_0x0241('0x3')],'include':[{'model':_0x0241('0x4'),'as':'AllConditions','attributes':['id',_0x0241('0x5'),_0x0241('0x6'),_0x0241('0x7')]},{'model':_0x0241('0x4'),'as':_0x0241('0x8'),'attributes':['id',_0x0241('0x5'),_0x0241('0x6'),_0x0241('0x7')]},{'model':_0x0241('0x9'),'as':_0x0241('0xa'),'attributes':['id','action',_0x0241('0xb'),_0x0241('0xc'),_0x0241('0xd'),_0x0241('0xe'),_0x0241('0xf'),'data6','data7']}]},'log':_0x0241('0x10')});};}; \ No newline at end of file +var _0x964e=['operator','value','Action','Actions','action','data1','data2','data3','data4','data6','data7','../client','getTriggers','GetTrigger','name','Condition','AllConditions','field'];(function(_0xac72d0,_0x33dde9){var _0x205e67=function(_0x48e80b){while(--_0x48e80b){_0xac72d0['push'](_0xac72d0['shift']());}};_0x205e67(++_0x33dde9);}(_0x964e,0x173));var _0xe964=function(_0x4877f7,_0x4c82c9){_0x4877f7=_0x4877f7-0x0;var _0x36feb7=_0x964e[_0x4877f7];return _0x36feb7;};'use strict';var client=require(_0xe964('0x0'));exports[_0xe964('0x1')]=function(_0x1c6534){return function(_0x1fce26){return client['Request'](_0xe964('0x2'),{'options':{'raw':![],'attributes':['id',_0xe964('0x3'),'channel','status'],'include':[{'model':_0xe964('0x4'),'as':_0xe964('0x5'),'attributes':['id',_0xe964('0x6'),_0xe964('0x7'),'value']},{'model':_0xe964('0x4'),'as':'AnyConditions','attributes':['id',_0xe964('0x6'),_0xe964('0x7'),_0xe964('0x8')]},{'model':_0xe964('0x9'),'as':_0xe964('0xa'),'attributes':['id',_0xe964('0xb'),_0xe964('0xc'),_0xe964('0xd'),_0xe964('0xe'),_0xe964('0xf'),'data5',_0xe964('0x10'),_0xe964('0x11')]}]},'log':'GetTrigger'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index b405df9..3895592 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 _0x605e=['../client','getTrunks','Request','defaultuser','GetTrunk'];(function(_0x104b47,_0x491eff){var _0x34a3f1=function(_0x467a15){while(--_0x467a15){_0x104b47['push'](_0x104b47['shift']());}};_0x34a3f1(++_0x491eff);}(_0x605e,0x1b8));var _0xe605=function(_0x241c9b,_0x282f5){_0x241c9b=_0x241c9b-0x0;var _0x4e66c4=_0x605e[_0x241c9b];return _0x4e66c4;};'use strict';var client=require(_0xe605('0x0'));exports[_0xe605('0x1')]=function(_0x5b883a){return function(_0xe9c2f0){return client[_0xe605('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name','registry',_0xe605('0x3')]},'log':_0xe605('0x4')});};}; \ No newline at end of file +var _0xd634=['defaultuser','../client','getTrunks','Request','GetTrunk','name','registry'];(function(_0x3bab09,_0x217c29){var _0x164376=function(_0x277730){while(--_0x277730){_0x3bab09['push'](_0x3bab09['shift']());}};_0x164376(++_0x217c29);}(_0xd634,0x151));var _0x4d63=function(_0x1f530d,_0x18a19e){_0x1f530d=_0x1f530d-0x0;var _0x22103f=_0xd634[_0x1f530d];return _0x22103f;};'use strict';var client=require(_0x4d63('0x0'));exports[_0x4d63('0x1')]=function(_0x2de3c5){return function(_0x2d7e16){return client[_0x4d63('0x2')](_0x4d63('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x4d63('0x4'),_0x4d63('0x5'),_0x4d63('0x6')]},'log':_0x4d63('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 6f8d56c..97b9e7b 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 _0x0713=['getAgent','Request','GetUser','agent','name','email','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getAgents','getTelephones','accountcode','internal','savePause','PauseUser'];(function(_0x2f5cb2,_0x2093c2){var _0x4704f4=function(_0x2be00a){while(--_0x2be00a){_0x2f5cb2['push'](_0x2f5cb2['shift']());}};_0x4704f4(++_0x2093c2);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'where':{'role':_0x3071('0x2')},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),'accountcode',_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),_0x3071('0xb'),_0x3071('0xc'),_0x3071('0xd')]},'log':_0x3071('0xe')});};};exports[_0x3071('0xf')]=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x3071('0x3'),_0x3071('0x10'),_0x3071('0x11')]},'log':_0x3071('0xf')});};};exports[_0x3071('0x12')]=function(_0x4a470a,_0x2ace21,_0x11a7ee){return client[_0x3071('0x0')](_0x3071('0x13'),{'body':{'type':_0x2ace21,'uniqueid':_0x11a7ee},'options':{'where':{'id':_0x4a470a['id']}},'log':_0x3071('0x12')});};exports['saveUnpause']=function(_0x5330a8){return client[_0x3071('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5330a8['id']}},'log':_0x3071('0x12')});};exports[_0x3071('0x14')]=function(_0x5d4883){return client[_0x3071('0x0')]('ShowUser',{'options':{'raw':![],'where':{'role':_0x3071('0x2'),'id':_0x5d4883},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),_0x3071('0x10'),_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),'interface']},'log':_0x3071('0x14')});}; \ No newline at end of file +var _0x0713=['getAgent','Request','GetUser','agent','name','email','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getAgents','getTelephones','accountcode','internal','savePause','PauseUser'];(function(_0x1b42e2,_0x253d59){var _0x257ad9=function(_0x4599e7){while(--_0x4599e7){_0x1b42e2['push'](_0x1b42e2['shift']());}};_0x257ad9(++_0x253d59);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'where':{'role':_0x3071('0x2')},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),'accountcode',_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),_0x3071('0xb'),_0x3071('0xc'),_0x3071('0xd')]},'log':_0x3071('0xe')});};};exports[_0x3071('0xf')]=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x3071('0x3'),_0x3071('0x10'),_0x3071('0x11')]},'log':_0x3071('0xf')});};};exports[_0x3071('0x12')]=function(_0x4a470a,_0x2ace21,_0x11a7ee){return client[_0x3071('0x0')](_0x3071('0x13'),{'body':{'type':_0x2ace21,'uniqueid':_0x11a7ee},'options':{'where':{'id':_0x4a470a['id']}},'log':_0x3071('0x12')});};exports['saveUnpause']=function(_0x5330a8){return client[_0x3071('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5330a8['id']}},'log':_0x3071('0x12')});};exports[_0x3071('0x14')]=function(_0x5d4883){return client[_0x3071('0x0')]('ShowUser',{'options':{'raw':![],'where':{'role':_0x3071('0x2'),'id':_0x5d4883},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),_0x3071('0x10'),_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),'interface']},'log':_0x3071('0x14')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index cef0882..82d293d 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 _0x2fad=['Request','CreateVoiceAgentReport','UpdateVoiceAgentReport'];(function(_0x483add,_0x3b6ce8){var _0xa5c374=function(_0x22519d){while(--_0x22519d){_0x483add['push'](_0x483add['shift']());}};_0xa5c374(++_0x3b6ce8);}(_0x2fad,0x156));var _0xd2fa=function(_0x1ab0e6,_0x17ba8d){_0x1ab0e6=_0x1ab0e6-0x0;var _0x248815=_0x2fad[_0x1ab0e6];return _0x248815;};'use strict';var client=require('../client');exports['create']=function(_0x36de6c){return client[_0xd2fa('0x0')](_0xd2fa('0x1'),{'body':_0x36de6c,'log':_0xd2fa('0x1')});};exports['update']=function(_0x27c786,_0x346418,_0x29a441){return client['Request'](_0xd2fa('0x2'),{'body':_0x27c786,'options':{'where':{'uniqueid':_0x346418,'interface':_0x29a441,'agentcomplete':!![]}},'log':_0xd2fa('0x2')});}; \ No newline at end of file +var _0x3edc=['update','UpdateVoiceAgentReport','../client','Request','CreateVoiceAgentReport'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x3edc,0xca));var _0xc3ed=function(_0x260072,_0x163b97){_0x260072=_0x260072-0x0;var _0x28380a=_0x3edc[_0x260072];return _0x28380a;};'use strict';var client=require(_0xc3ed('0x0'));exports['create']=function(_0x2c3c2d){return client[_0xc3ed('0x1')](_0xc3ed('0x2'),{'body':_0x2c3c2d,'log':_0xc3ed('0x2')});};exports[_0xc3ed('0x3')]=function(_0x46af69,_0x344ccb,_0x5c516e){return client[_0xc3ed('0x1')](_0xc3ed('0x4'),{'body':_0x46af69,'options':{'where':{'uniqueid':_0x344ccb,'interface':_0x5c516e,'agentcomplete':!![]}},'log':_0xc3ed('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index e452434..0e29c98 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 _0xd29e=['GetVoiceCallReports','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','duration'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd29e,0x1c9));var _0xed29=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd29e[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require('moment');var util=require('util');var _=require('lodash');var client=require(_0xed29('0x0'));exports[_0xed29('0x1')]=function(_0x183c6f){return client[_0xed29('0x2')](_0xed29('0x3'),{'body':_[_0xed29('0x4')](_0x183c6f,{'source':_0x183c6f[_0xed29('0x5')],'destinationcontext':_0x183c6f['context'],'callerid':_0x183c6f[_0xed29('0x6')],'amaflags':_0xed29('0x7')}),'log':_0xed29('0x3')});};exports[_0xed29('0x8')]=function(){return function(){return client[_0xed29('0x2')](_0xed29('0x9'),{'options':{'where':{'type':[_0xed29('0xa')],'createdAt':{'$between':[moment()['startOf'](_0xed29('0xb'))[_0xed29('0xc')](_0xed29('0xd')),moment()[_0xed29('0xe')](_0xed29('0xb'))['format'](_0xed29('0xd'))]}},'attributes':[_0xed29('0xf'),_0xed29('0x10'),_0xed29('0x11'),'billableseconds']},'log':_0xed29('0x12')});};}; \ No newline at end of file +var _0xd8fd=['context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','day','type','disposition','billableseconds','GetVoiceCallReports','moment','util','lodash','../client','Request','CreateVoiceCallReport','merge','calleridnum'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd8fd,0x168));var _0xdd8f=function(_0x293023,_0x4ac622){_0x293023=_0x293023-0x0;var _0x49751d=_0xd8fd[_0x293023];return _0x49751d;};'use strict';var moment=require(_0xdd8f('0x0'));var util=require(_0xdd8f('0x1'));var _=require(_0xdd8f('0x2'));var client=require(_0xdd8f('0x3'));exports['create']=function(_0x21dfab){return client[_0xdd8f('0x4')](_0xdd8f('0x5'),{'body':_[_0xdd8f('0x6')](_0x21dfab,{'source':_0x21dfab[_0xdd8f('0x7')],'destinationcontext':_0x21dfab[_0xdd8f('0x8')],'callerid':_0x21dfab[_0xdd8f('0x9')],'amaflags':_0xdd8f('0xa')}),'log':_0xdd8f('0x5')});};exports[_0xdd8f('0xb')]=function(){return function(){return client[_0xdd8f('0x4')](_0xdd8f('0xc'),{'options':{'where':{'type':[_0xdd8f('0xd')],'createdAt':{'$between':[moment()[_0xdd8f('0xe')]('day')[_0xdd8f('0xf')](_0xdd8f('0x10')),moment()[_0xdd8f('0x11')](_0xdd8f('0x12'))[_0xdd8f('0xf')](_0xdd8f('0x10'))]}},'attributes':[_0xdd8f('0x13'),_0xdd8f('0x14'),'duration',_0xdd8f('0x15')]},'log':_0xdd8f('0x16')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index bb255bb..13f1c6b 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 _0x4c7d=['Request','CreateVoiceDialReport','../client','create'];(function(_0x1bbc08,_0x444008){var _0x5d825b=function(_0x522920){while(--_0x522920){_0x1bbc08['push'](_0x1bbc08['shift']());}};_0x5d825b(++_0x444008);}(_0x4c7d,0xfa));var _0xd4c7=function(_0x3063d1,_0x64e673){_0x3063d1=_0x3063d1-0x0;var _0x5d30da=_0x4c7d[_0x3063d1];return _0x5d30da;};'use strict';var client=require(_0xd4c7('0x0'));exports[_0xd4c7('0x1')]=function(_0x2ec788){return client[_0xd4c7('0x2')]('CreateVoiceDialReport',{'body':_0x2ec788,'log':_0xd4c7('0x3')});}; \ No newline at end of file +var _0xe0da=['CreateVoiceDialReport','../client','create','Request'];(function(_0x5d54a0,_0x2194e1){var _0x5677cf=function(_0x53cc93){while(--_0x53cc93){_0x5d54a0['push'](_0x5d54a0['shift']());}};_0x5677cf(++_0x2194e1);}(_0xe0da,0x99));var _0xae0d=function(_0x5ed236,_0x400117){_0x5ed236=_0x5ed236-0x0;var _0x2bde63=_0xe0da[_0x5ed236];return _0x2bde63;};'use strict';var client=require(_0xae0d('0x0'));exports[_0xae0d('0x1')]=function(_0x124993){return client[_0xae0d('0x2')]('CreateVoiceDialReport',{'body':_0x124993,'log':_0xae0d('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index ef35d89..bfabff8 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 _0x0647=['GetVoiceExtension','exten','recordingFormat','getVoiceExtensions','../client','Request'];(function(_0x158c15,_0x54a908){var _0x131a10=function(_0x1f05c8){while(--_0x1f05c8){_0x158c15['push'](_0x158c15['shift']());}};_0x131a10(++_0x54a908);}(_0x0647,0xd0));var _0x7064=function(_0x466af7,_0x2f7551){_0x466af7=_0x466af7-0x0;var _0x348c96=_0x0647[_0x466af7];return _0x348c96;};'use strict';var client=require(_0x7064('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0x7064('0x1')](_0x7064('0x2'),{'options':{'raw':!![],'attributes':['id',_0x7064('0x3'),_0x7064('0x4')],'where':{'VoiceExtensionId':null}},'log':_0x7064('0x5')});};}; \ No newline at end of file +var _0xc831=['Request','GetVoiceExtension','exten','recordingFormat','getVoiceExtensions'];(function(_0x5f0501,_0x19196e){var _0x3c2c45=function(_0x107fe6){while(--_0x107fe6){_0x5f0501['push'](_0x5f0501['shift']());}};_0x3c2c45(++_0x19196e);}(_0xc831,0x103));var _0x1c83=function(_0x2b69a7,_0x47225a){_0x2b69a7=_0x2b69a7-0x0;var _0x20ffdc=_0xc831[_0x2b69a7];return _0x20ffdc;};'use strict';var client=require('../client');exports[_0x1c83('0x0')]=function(){return function(){return client[_0x1c83('0x1')](_0x1c83('0x2'),{'options':{'raw':!![],'attributes':['id',_0x1c83('0x3'),_0x1c83('0x4')],'where':{'VoiceExtensionId':null}},'log':_0x1c83('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 7cf221f..181a428 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 _0x3385=['dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','mandatoryDispositionPause','active','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialCheckDuplicateType','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialAbandonedMaxRetry'];(function(_0x48736b,_0x15ab78){var _0x144d7f=function(_0x34e2eb){while(--_0x34e2eb){_0x48736b['push'](_0x48736b['shift']());}};_0x144d7f(++_0x15ab78);}(_0x3385,0xfe));var _0x5338=function(_0x1cfe2e,_0x1ebbcd){_0x1cfe2e=_0x1cfe2e-0x0;var _0x39233f=_0x3385[_0x1cfe2e];return _0x39233f;};'use strict';var client=require(_0x5338('0x0'));exports[_0x5338('0x1')]=function(){return function(){return client[_0x5338('0x2')](_0x5338('0x3'),{'options':{'raw':![],'attributes':['id',_0x5338('0x4'),_0x5338('0x5'),_0x5338('0x6'),'autopause',_0x5338('0x7'),_0x5338('0x8'),_0x5338('0x9'),_0x5338('0xa'),_0x5338('0xb'),_0x5338('0xc'),'dialPowerLevel',_0x5338('0xd'),_0x5338('0xe'),_0x5338('0xf'),_0x5338('0x10'),_0x5338('0x11'),_0x5338('0x12'),_0x5338('0x13'),_0x5338('0x14'),_0x5338('0x15'),_0x5338('0x16'),_0x5338('0x17'),'dialBusyMaxRetry',_0x5338('0x18'),_0x5338('0x19'),'dialNoAnswerRetryFrequency',_0x5338('0x1a'),_0x5338('0x1b'),_0x5338('0x1c'),'dialPrefix',_0x5338('0x1d'),'dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence',_0x5338('0x1e'),_0x5338('0x1f'),_0x5338('0x20'),_0x5338('0x21'),_0x5338('0x22'),'dialAMDMaximumWordLength',_0x5338('0x23'),_0x5338('0x24'),_0x5338('0x25'),_0x5338('0x26'),_0x5338('0x27'),'dialAgiAfterHangupClient',_0x5338('0x28'),_0x5338('0x7'),_0x5338('0x29'),_0x5338('0x2a'),'dialCutDigit',_0x5338('0x2b'),'dialNoSuchNumberRetryFrequency',_0x5338('0x2c'),'dialDropRetryFrequency',_0x5338('0x2d'),_0x5338('0x2e'),'dialMachineMaxRetry',_0x5338('0x2f'),_0x5338('0x30'),_0x5338('0x31'),'mandatoryDisposition','dialPredictiveIntervalMaxThreshold',_0x5338('0x32'),_0x5338('0x33'),_0x5338('0x34')],'include':[{'model':_0x5338('0x35'),'as':'Trunk','attributes':['id',_0x5338('0x4'),_0x5338('0x36'),'active']},{'model':'Pause','as':_0x5338('0x37'),'attributes':['id',_0x5338('0x4')]},{'model':'Trunk','as':'TrunkBackup','attributes':['id',_0x5338('0x4'),_0x5338('0x36'),_0x5338('0x38')]},{'model':_0x5338('0x39'),'as':_0x5338('0x39'),'attributes':['id',_0x5338('0x4')],'include':[{'model':'Interval','as':_0x5338('0x3a'),'attributes':['id',_0x5338('0x4'),_0x5338('0x3b')]}]}]},'log':_0x5338('0x1')});};}; \ No newline at end of file +var _0xf04a=['acwTimeout','autopause','monitor_format','type','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','active','Pause','TrunkBackup','Interval','interval','getVoiceQueues','Request','GetVoiceQueue','name','acw'];(function(_0x5309ed,_0x3fb9ba){var _0x590497=function(_0x1dc540){while(--_0x1dc540){_0x5309ed['push'](_0x5309ed['shift']());}};_0x590497(++_0x3fb9ba);}(_0xf04a,0xa9));var _0xaf04=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xf04a[_0x57b54c];return _0x59cc19;};'use strict';var client=require('../client');exports[_0xaf04('0x0')]=function(){return function(){return client[_0xaf04('0x1')](_0xaf04('0x2'),{'options':{'raw':![],'attributes':['id',_0xaf04('0x3'),_0xaf04('0x4'),_0xaf04('0x5'),_0xaf04('0x6'),_0xaf04('0x7'),_0xaf04('0x8'),'dialActive',_0xaf04('0x9'),_0xaf04('0xa'),'dialLimitQueue',_0xaf04('0xb'),_0xaf04('0xc'),'dialPredictiveOptimizationPercentage',_0xaf04('0xd'),_0xaf04('0xe'),_0xaf04('0xf'),_0xaf04('0x10'),_0xaf04('0x11'),'dialQueueTimeout','dialQueueProject',_0xaf04('0x12'),'dialCongestionRetryFrequency',_0xaf04('0x13'),_0xaf04('0x14'),_0xaf04('0x15'),_0xaf04('0x16'),_0xaf04('0x17'),_0xaf04('0x18'),_0xaf04('0x19'),'dialPrefix',_0xaf04('0x1a'),'dialAMDActive',_0xaf04('0x1b'),'dialAMDGreeting',_0xaf04('0x1c'),_0xaf04('0x1d'),'dialAMDMinWordLength',_0xaf04('0x1e'),_0xaf04('0x1f'),_0xaf04('0x20'),'dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue',_0xaf04('0x21'),_0xaf04('0x22'),_0xaf04('0x23'),_0xaf04('0x24'),_0xaf04('0x7'),'strategy',_0xaf04('0x25'),_0xaf04('0x26'),_0xaf04('0x27'),_0xaf04('0x28'),_0xaf04('0x29'),_0xaf04('0x2a'),_0xaf04('0x2b'),'dialAbandonedRetryFrequency','dialMachineMaxRetry',_0xaf04('0x2c'),_0xaf04('0x2d'),_0xaf04('0x2e'),_0xaf04('0x2f'),_0xaf04('0x30'),_0xaf04('0x31'),_0xaf04('0x32'),_0xaf04('0x33')],'include':[{'model':_0xaf04('0x34'),'as':_0xaf04('0x34'),'attributes':['id',_0xaf04('0x3'),'callerid',_0xaf04('0x35')]},{'model':_0xaf04('0x36'),'as':'mandatoryDispositionPause','attributes':['id','name']},{'model':_0xaf04('0x34'),'as':_0xaf04('0x37'),'attributes':['id','name','callerid',_0xaf04('0x35')]},{'model':'Interval','as':_0xaf04('0x38'),'attributes':['id',_0xaf04('0x3')],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0xaf04('0x3'),_0xaf04('0x39')]}]}]},'log':_0xaf04('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index f0e861b..73f5d53 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(_0x30945b,_0x1a54ad){var _0x27bb35=function(_0x8d5260){while(--_0x8d5260){_0x30945b['push'](_0x30945b['shift']());}};_0x27bb35(++_0x1a54ad);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'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(_0xa29b37,_0x41f51e){var _0x487c42=function(_0x3ae00){while(--_0x3ae00){_0xa29b37['push'](_0xa29b37['shift']());}};_0x487c42(++_0x41f51e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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 dbd6290..71197c3 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 _0x393b=['getVoiceQueueRtPauses','../client'];(function(_0x4d43b1,_0x43eb6c){var _0x378a38=function(_0x55f060){while(--_0x55f060){_0x4d43b1['push'](_0x4d43b1['shift']());}};_0x378a38(++_0x43eb6c);}(_0x393b,0xad));var _0xb393=function(_0x3050b5,_0x182c6a){_0x3050b5=_0x3050b5-0x0;var _0x37cceb=_0x393b[_0x3050b5];return _0x37cceb;};'use strict';var client=require(_0xb393('0x0'));exports['getVoiceQueueRtPauses']=function(_0x2e56de){return function(){return client['Request']('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x2e56de,'paused':!![]},'raw':!![]},'log':_0xb393('0x1')});};}; \ No newline at end of file +var _0xdd23=['Request','GetVoiceQueueRtPauses','getVoiceQueueRtPauses','../client'];(function(_0x2932cf,_0x362fd9){var _0x1711dd=function(_0x2d8de6){while(--_0x2d8de6){_0x2932cf['push'](_0x2932cf['shift']());}};_0x1711dd(++_0x362fd9);}(_0xdd23,0x183));var _0x3dd2=function(_0x959849,_0x1bcfbc){_0x959849=_0x959849-0x0;var _0x21c8b6=_0xdd23[_0x959849];return _0x21c8b6;};'use strict';var client=require(_0x3dd2('0x0'));exports['getVoiceQueueRtPauses']=function(_0x41fb8f){return function(){return client[_0x3dd2('0x1')](_0x3dd2('0x2'),{'options':{'where':{'VoiceQueueId':_0x41fb8f,'paused':!![]},'raw':!![]},'log':_0x3dd2('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 9613165..8e636b6 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(_0x57096d,_0x38ff23){var _0x399f4f=function(_0x427761){while(--_0x427761){_0x57096d['push'](_0x57096d['shift']());}};_0x399f4f(++_0x38ff23);}(_0x7a54,0x106));var _0x47a5=function(_0x3cd864,_0x775859){_0x3cd864=_0x3cd864-0x0;var _0x4c0b66=_0x7a54[_0x3cd864];return _0x4c0b66;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x34c49e,_0x434f2d){var _0x39b972=function(_0x1a4b50){while(--_0x1a4b50){_0x34c49e['push'](_0x34c49e['shift']());}};_0x39b972(++_0x434f2d);}(_0x7a54,0x106));var _0x47a5=function(_0x4362d7,_0x2d532b){_0x4362d7=_0x4362d7-0x0;var _0x5b8415=_0x7a54[_0x4362d7];return _0x5b8415;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 5bec89a..99d8e30 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 _0x00b8=['../client','blindTransfer','Request','CreateVoiceTransferReport','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinename','transferercontext','transfererexten','transfereechannel','transfereeconnectedlinenum','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','attended'];(function(_0x373218,_0x57df4b){var _0x596349=function(_0x15ddf9){while(--_0x15ddf9){_0x373218['push'](_0x373218['shift']());}};_0x596349(++_0x57df4b);}(_0x00b8,0x1c7));var _0x800b=function(_0x5161b5,_0x3c376c){_0x5161b5=_0x5161b5-0x0;var _0xae206=_0x00b8[_0x5161b5];return _0xae206;};'use strict';var client=require(_0x800b('0x0'));exports['transfers']={};exports[_0x800b('0x1')]=function(_0x297b5e){return client[_0x800b('0x2')](_0x800b('0x3'),{'body':{'result':_0x297b5e['result'],'transfererchannel':_0x297b5e[_0x800b('0x4')],'transferercalleridnum':_0x297b5e[_0x800b('0x5')],'transferercalleridname':_0x297b5e[_0x800b('0x6')],'transfererconnectedlinenum':_0x297b5e['transfererconnectedlinenum'],'transfererconnectedlinename':_0x297b5e[_0x800b('0x7')],'transfereraccountcode':_0x297b5e['transfereraccountcode'],'transferercontext':_0x297b5e[_0x800b('0x8')],'transfererexten':_0x297b5e[_0x800b('0x9')],'transfererlinkedid':_0x297b5e['transfererlinkedid'],'transfereechannel':_0x297b5e[_0x800b('0xa')],'transfereecalleridnum':_0x297b5e['transfereecalleridnum'],'transfereecalleridname':_0x297b5e['transfereecalleridname'],'transfereeconnectedlinenum':_0x297b5e[_0x800b('0xb')],'transfereeconnectedlinename':_0x297b5e['transfereeconnectedlinename'],'transfereeaccountcode':_0x297b5e[_0x800b('0xc')],'transfereecontext':_0x297b5e[_0x800b('0xd')],'transfereeexten':_0x297b5e[_0x800b('0xe')],'transfereelinkedid':_0x297b5e[_0x800b('0xf')],'isexternal':_0x297b5e[_0x800b('0x10')],'context':_0x297b5e[_0x800b('0x11')],'extension':_0x297b5e[_0x800b('0x12')],'type':_0x800b('0x13')},'log':_0x800b('0x3')});};exports[_0x800b('0x14')]=function(_0x47bf6d){return client[_0x800b('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x47bf6d['result'],'transfererchannel':_0x47bf6d['origtransfererchannel'],'transferercalleridnum':_0x47bf6d[_0x800b('0x15')],'transferercalleridname':_0x47bf6d[_0x800b('0x16')],'transfererconnectedlinenum':_0x47bf6d[_0x800b('0x17')],'transfererconnectedlinename':_0x47bf6d['secondtransfererconnectedlinename'],'transfereraccountcode':_0x47bf6d[_0x800b('0x18')],'transferercontext':_0x47bf6d[_0x800b('0x19')],'transfererexten':_0x47bf6d[_0x800b('0x1a')],'transfererlinkedid':_0x47bf6d[_0x800b('0x1b')],'transfereechannel':_0x47bf6d['transfertargetchannel'],'transfereecalleridnum':_0x47bf6d['transfertargetcalleridnum'],'transfereecalleridname':_0x47bf6d[_0x800b('0x1c')],'transfereeconnectedlinenum':_0x47bf6d[_0x800b('0x1d')],'transfereeconnectedlinename':_0x47bf6d[_0x800b('0x1e')],'transfereeaccountcode':_0x47bf6d[_0x800b('0x1f')],'transfereecontext':_0x47bf6d[_0x800b('0x20')],'transfereeexten':_0x47bf6d['transfertargetexten'],'transfereelinkedid':_0x47bf6d[_0x800b('0x21')],'isexternal':_0x47bf6d[_0x800b('0x10')],'context':_0x47bf6d['origtransferercontext'],'extension':_0x47bf6d['origtransfererexten'],'type':_0x800b('0x22')},'log':_0x800b('0x3')});}; \ No newline at end of file +var _0xfc98=['transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','extension','blind','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetexten','transfertargetlinkedid','isexternal','origtransfererexten','../client','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfereraccountcode','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname'];(function(_0x1f4f14,_0x570d4b){var _0x3135b1=function(_0x89b844){while(--_0x89b844){_0x1f4f14['push'](_0x1f4f14['shift']());}};_0x3135b1(++_0x570d4b);}(_0xfc98,0x1ba));var _0x8fc9=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xfc98[_0x82129b];return _0x2ae5dc;};'use strict';var client=require(_0x8fc9('0x0'));exports['transfers']={};exports['blindTransfer']=function(_0x5cd4a1){return client[_0x8fc9('0x1')](_0x8fc9('0x2'),{'body':{'result':_0x5cd4a1[_0x8fc9('0x3')],'transfererchannel':_0x5cd4a1[_0x8fc9('0x4')],'transferercalleridnum':_0x5cd4a1[_0x8fc9('0x5')],'transferercalleridname':_0x5cd4a1[_0x8fc9('0x6')],'transfererconnectedlinenum':_0x5cd4a1[_0x8fc9('0x7')],'transfererconnectedlinename':_0x5cd4a1['transfererconnectedlinename'],'transfereraccountcode':_0x5cd4a1[_0x8fc9('0x8')],'transferercontext':_0x5cd4a1['transferercontext'],'transfererexten':_0x5cd4a1[_0x8fc9('0x9')],'transfererlinkedid':_0x5cd4a1[_0x8fc9('0xa')],'transfereechannel':_0x5cd4a1[_0x8fc9('0xb')],'transfereecalleridnum':_0x5cd4a1[_0x8fc9('0xc')],'transfereecalleridname':_0x5cd4a1[_0x8fc9('0xd')],'transfereeconnectedlinenum':_0x5cd4a1['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x5cd4a1[_0x8fc9('0xe')],'transfereeaccountcode':_0x5cd4a1[_0x8fc9('0xf')],'transfereecontext':_0x5cd4a1[_0x8fc9('0x10')],'transfereeexten':_0x5cd4a1[_0x8fc9('0x11')],'transfereelinkedid':_0x5cd4a1[_0x8fc9('0x12')],'isexternal':_0x5cd4a1['isexternal'],'context':_0x5cd4a1['context'],'extension':_0x5cd4a1[_0x8fc9('0x13')],'type':_0x8fc9('0x14')},'log':_0x8fc9('0x2')});};exports['attendedTransfer']=function(_0x4d2660){return client['Request'](_0x8fc9('0x2'),{'body':{'result':_0x4d2660['result'],'transfererchannel':_0x4d2660[_0x8fc9('0x15')],'transferercalleridnum':_0x4d2660[_0x8fc9('0x16')],'transferercalleridname':_0x4d2660[_0x8fc9('0x17')],'transfererconnectedlinenum':_0x4d2660[_0x8fc9('0x18')],'transfererconnectedlinename':_0x4d2660[_0x8fc9('0x19')],'transfereraccountcode':_0x4d2660['origtransfereraccountcode'],'transferercontext':_0x4d2660[_0x8fc9('0x1a')],'transfererexten':_0x4d2660[_0x8fc9('0x1b')],'transfererlinkedid':_0x4d2660[_0x8fc9('0x1c')],'transfereechannel':_0x4d2660[_0x8fc9('0x1d')],'transfereecalleridnum':_0x4d2660[_0x8fc9('0x1e')],'transfereecalleridname':_0x4d2660[_0x8fc9('0x1f')],'transfereeconnectedlinenum':_0x4d2660[_0x8fc9('0x20')],'transfereeconnectedlinename':_0x4d2660[_0x8fc9('0x21')],'transfereeaccountcode':_0x4d2660['transfertargetaccountcode'],'transfereecontext':_0x4d2660['transfertargetcontext'],'transfereeexten':_0x4d2660[_0x8fc9('0x22')],'transfereelinkedid':_0x4d2660[_0x8fc9('0x23')],'isexternal':_0x4d2660[_0x8fc9('0x24')],'context':_0x4d2660['origtransferercontext'],'extension':_0x4d2660[_0x8fc9('0x25')],'type':'attended'},'log':_0x8fc9('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 941eab9..e2b9126 100644 --- a/server/services/ami/server/index.js +++ b/server/services/ami/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['type','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','telephones','trunks','run','event','Event\x20name\x20mandatory','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','moment','../properties','../ami','../model/voiceQueueSummary','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','voiceStatus','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','command','Command','content','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','voicechannel','map','channels','uniqueid','channel','%s.%s','filename','wav','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','monitors','stop','queueChannels','inbound','outbound','includes'];(function(_0x590751,_0xa0b845){var _0xbaaaee=function(_0x238605){while(--_0x238605){_0x590751['push'](_0x590751['shift']());}};_0xbaaaee(++_0xa0b845);}(_0xb10b,0x12a));var _0xbb10=function(_0x546f72,_0x3b10bc){_0x546f72=_0x546f72-0x0;var _0x45dea6=_0xb10b[_0x546f72];return _0x45dea6;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var jayson=require(_0xbb10('0x1'));var schema=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var config=require('../../../config/environment');var properties=require(_0xbb10('0x4'));var ami=require(_0xbb10('0x5'));var VoiceQueueSummary=require(_0xbb10('0x6'));exports[_0xbb10('0x7')]=function(_0x49baf4,_0x312b72,_0x481979){return new Promise(function(_0x328583,_0x3cdd53){var _0x513741={'QueuePause':function(_0x1b9e94){return new Promise(function(_0x3fb675){var _0x21370f=util[_0xbb10('0x8')](_0xbb10('0x9'),_0xbb10('0xa'),_0x1b9e94[_0xbb10('0xb')]);if(_0x49baf4[_0xbb10('0xc')]&&_0x49baf4['timers'][_0x21370f]&&_0x49baf4['timers'][_0x21370f][_0xbb10('0xd')]){_0x49baf4[_0xbb10('0xc')][_0x21370f][_0xbb10('0xe')]();}if(_0x49baf4['agents'][_0x21370f]){_0x49baf4[_0xbb10('0xf')][_0x21370f]['updateStatusRealtime']({'state':_0x49baf4[_0xbb10('0xf')][_0x21370f][_0xbb10('0x10')],'statePause':_0x1b9e94[_0xbb10('0x11')]?!![]:![]});}_0x3fb675({'code':0xc8,'message':_0xbb10('0x12')});});},'Reload':function(_0x442548){var _0x147230=this;return new Promise(function(_0x58a612,_0x26e021){if(ami[_0xbb10('0x13')]()==![]){return _0x26e021(_0x147230[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}_0x442548=_[_0xbb10('0x19')](_0x442548,_[_0xbb10('0x1a')](properties['reload'][_0xbb10('0x1b')]));_0x442548[_0xbb10('0x1c')]=_0xbb10('0x1d');return ami[_0xbb10('0x1e')](_0x442548)[_0xbb10('0x1f')](function(_0x1682a4){_0x58a612({'code':0xc8,'message':_0x1682a4[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xbf2906){_0x26e021(_0x147230[_0xbb10('0x14')](0x1f5,_0xbf2906['message']));});});},'Command':function(_0x5ff0cf){var _0x19f48d=this;return new Promise(function(_0x388fab,_0x109908){if(ami[_0xbb10('0x13')]()==![]){return _0x109908(_0x19f48d[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected']['join']('\x20')));}_0x5ff0cf=_[_0xbb10('0x19')](_0x5ff0cf,_0xbb10('0x22'));_0x5ff0cf[_0xbb10('0x1c')]=_0xbb10('0x23');return ami[_0xbb10('0x1e')](_0x5ff0cf)[_0xbb10('0x1f')](function(_0x407cb4){_0x388fab({'code':0xc8,'message':_0x407cb4[_0xbb10('0x24')]});})[_0xbb10('0x21')](function(_0x395404){_0x109908(_0x19f48d[_0xbb10('0x14')](0x1f5,_0x395404[_0xbb10('0x20')]));});});},'VoiceQueues':function(){return new Promise(function(_0x537898){var _0x4fedac=[];for(var _0x4fb5e0 in _0x49baf4[_0xbb10('0x25')]){if(_0x49baf4[_0xbb10('0x25')][_0xbb10('0x26')](_0x4fb5e0)){var _0x4e25ff=_0x49baf4[_0xbb10('0x25')][_0x4fb5e0];var _0x24d586=new VoiceQueueSummary(_0x4e25ff);_0x4fedac[_0xbb10('0x27')](_0x24d586);}}_0x537898({'count':_0x4fedac[_0xbb10('0x28')],'rows':_0x4fedac});});},'UpdateVoiceQueue':function(_0x1acce9){return new Promise(function(_0x20d946,_0x2a0e8b){var _0x4aabb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x25')],{'id':parseInt(_0x1acce9['id'])});var _0xfc3595=_[_0xbb10('0x2a')](_0x1acce9,['id']);if(_0x4aabb9){for(var _0x1d30aa in _0xfc3595){if(typeof _0xfc3595[_0x1d30aa]!==_0xbb10('0x2b')&&typeof _0x4aabb9[_0x1d30aa]!=='undefined'){_0x4aabb9[_0x1d30aa]=_0xfc3595[_0x1d30aa];}}_0x20d946(_0x4aabb9);}else{_0x2a0e8b();}});},'VoiceChannels':function(){return new Promise(function(_0x221624){var _0x4ee02e=_[_0xbb10('0x2c')](_0x49baf4['channels']);_0x221624({'count':_0x4ee02e[_0xbb10('0x28')],'rows':_0x4ee02e});});},'VoiceChannelMixMonitor':function(_0x1dcc9c){var _0x1b59f9=this;return new Promise(function(_0x491db4,_0x518d47){if(ami[_0xbb10('0x13')]()==![]){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x37a83f=schema(properties[_0xbb10('0x2d')])[_0xbb10('0x2')](_0x1dcc9c);if(_0x37a83f['length']>0x0){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x37a83f,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0xfb2c5e=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x2f')],{'uniqueid':_0x1dcc9c[_0xbb10('0x30')]});if(_0xfb2c5e&&_0xfb2c5e[_0xbb10('0x31')]){var _0x56943c=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1dcc9c[_0xbb10('0x33')]||_0x1dcc9c[_0xbb10('0x30')],_0x1dcc9c['format']||_0xbb10('0x34'));return ami['Action']({'action':'MixMonitor','channel':_0xfb2c5e[_0xbb10('0x31')],'file':_0x56943c,'options':_0xbb10('0x35')})[_0xbb10('0x1f')](function(_0x120d21){var _0x15d895=_[_0xbb10('0x29')](_0xfb2c5e['monitors'],{'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')]()});if(_['isNil'](_0x15d895)){_0xfb2c5e['monitors']['push']({'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')](),'createdAt':moment()[_0xbb10('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x120d21[_0xbb10('0x38')],'status':_0xbb10('0x39')});}else{_0x15d895[_0xbb10('0x38')]=_0x120d21['mixmonitorid'];_0x15d895[_0xbb10('0x3a')]=_0xbb10('0x39');}_0x491db4({'code':0xc8,'message':[_0x1dcc9c[_0xbb10('0x30')],_0xbb10('0x3b'),_0x120d21['mixmonitorid']][_0xbb10('0x18')]('\x20'),'mixmonitorid':_0x120d21[_0xbb10('0x38')]});})['catch'](function(_0xe2040f){_0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f5,[_0x1dcc9c[_0xbb10('0x30')],_0xe2040f[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x518d47(_0x1b59f9['error'](0x1f5,_0xbb10('0x3c')));}});},'VoiceChannelStopMixMonitor':function(_0x1c7fae){var _0x3e7b4c=this;return new Promise(function(_0x3d3c41,_0x4943d9){if(ami[_0xbb10('0x13')]()==![]){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')]['username'],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x54ac18=schema(properties['voicechannel'])[_0xbb10('0x2')](_0x1c7fae);if(_0x54ac18['length']>0x0){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x54ac18,'message')[_0xbb10('0x18')](',\x20')));}var _0x1d82bf=_[_0xbb10('0x29')](_0x49baf4['channels'],{'uniqueid':_0x1c7fae[_0xbb10('0x30')]});if(_0x1d82bf){return Promise[_0xbb10('0x3d')]()[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x3e'),'channel':_0x1d82bf[_0xbb10('0x31')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})[_0xbb10('0x21')](function(){});}})[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x3f')]){return ami[_0xbb10('0x1e')]({'action':'StopMixMonitor','channel':_0x1d82bf[_0xbb10('0x3f')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})['catch'](function(){});}})[_0xbb10('0x1f')](function(){var _0x2f5027=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]});if(_0x2f5027){_0x2f5027[_0xbb10('0x3a')]=_0xbb10('0x41');}})['then'](function(){var _0x4a9793=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1c7fae[_0xbb10('0x33')]||_0x1c7fae['uniqueid'],_0x1c7fae['format']||_0xbb10('0x34'));var _0x34cf4e=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'filename':_0xbb10('0x36')+_0x4a9793[_0xbb10('0x37')]()});if(_0x34cf4e){_0x34cf4e[_0xbb10('0x3a')]=_0xbb10('0x41');}})[_0xbb10('0x1f')](function(){_0x3d3c41({'code':0xc8,'message':[_0x1c7fae[_0xbb10('0x30')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0xbb10('0x21')](function(_0x467dba){_0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,[_0x1c7fae[_0xbb10('0x30')],_0x467dba[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannels':function(_0x1214f7){var _0x19ca3e=this;return new Promise(function(_0x20e18a){var _0x61e689=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x42')]);var _0x547a7a={'count':_0x61e689[_0xbb10('0x28')],'rows':_0x61e689};if(_0x1214f7&&_0x1214f7['type']){if(![_0xbb10('0x43'),_0xbb10('0x44')][_0xbb10('0x45')](_0x1214f7[_0xbb10('0x46')])){return _0x3cdd53(_0x19ca3e[_0xbb10('0x14')](0x190,_0xbb10('0x47')));}var _0x2e3326=_[_0xbb10('0x48')](_0x61e689,function(_0x180400){return _0x180400[_0xbb10('0x46')]===_0x1214f7[_0xbb10('0x46')];});_0x547a7a[_0xbb10('0x49')]=_0x2e3326[_0xbb10('0x28')];_0x547a7a[_0xbb10('0x4a')]=_0x2e3326;}_0x20e18a(_0x547a7a);});},'VoiceQueuesChannel':function(_0x4475e1){var _0x5de0cc=this;return new Promise(function(_0x4571b6,_0x466eb7){var _0x1b83a9=schema(properties[_0xbb10('0x4b')])[_0xbb10('0x2')](_0x4475e1);if(_0x1b83a9[_0xbb10('0x28')]>0x0){return _0x466eb7(_0x5de0cc['error'](0x1f4,_[_0xbb10('0x2e')](_0x1b83a9,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x14fed3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x4475e1[_0xbb10('0x30')]});if(_0x14fed3){_0x4571b6(_0x14fed3);}else{return _0x466eb7(_0x5de0cc[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelHangup':function(_0x40c4fb){var _0x2eb05a=this;return new Promise(function(_0x2a1ce1,_0x16932f){if(ami['isConnected']()==![]){return _0x16932f(_0x2eb05a['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')]['join']('\x20')));}var _0x506498=schema(properties[_0xbb10('0x4c')])[_0xbb10('0x2')](_0x40c4fb);if(_0x506498[_0xbb10('0x28')]>0x0){return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x506498,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x4a5fb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x40c4fb['uniqueid']});if(_0x4a5fb9&&_0x4a5fb9['channel']){return ami['Action']({'action':_0xbb10('0x4d'),'channel':_0x4a5fb9[_0xbb10('0x31')]})[_0xbb10('0x1f')](function(_0x5bd1c0){_0x2a1ce1({'code':0xc8,'message':[_0x40c4fb['uniqueid'],_0x5bd1c0['message'][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0x4e9fbd){_0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,[_0x40c4fb[_0xbb10('0x30')],_0x4e9fbd['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelRedirect':function(_0x237246){var _0x54b7c5=this;return new Promise(function(_0x43eaec,_0xec48ac){if(ami[_0xbb10('0x13')]()==![]){return _0xec48ac(_0x54b7c5['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected'][_0xbb10('0x18')]('\x20')));}var _0x31e85e=schema(properties[_0xbb10('0x4e')])[_0xbb10('0x2')](_0x237246);if(_0x31e85e['length']>0x0){return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x31e85e,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x56b3a3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x237246[_0xbb10('0x30')]});if(_0x56b3a3&&_0x56b3a3[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x4f'),'channel':_0x56b3a3[_0xbb10('0x31')],'exten':_0x237246['exten'],'context':_0x237246['context']||_0x56b3a3['context'],'priority':0x1})[_0xbb10('0x1f')](function(_0x9c672d){_0x43eaec({'code':0xc8,'message':[_0x237246[_0xbb10('0x30')],_0x9c672d['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0xd9e743){_0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,[_0x237246[_0xbb10('0x30')],_0xd9e743[_0xbb10('0x20')]['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'Agents':function(_0x14f16b){return new Promise(function(_0x2aaaa6){var _0x5bfc68=_['values'](_0x49baf4['agents']);if(_0x14f16b&&_0x14f16b['id']){var _0x329da7=_[_0xbb10('0x29')](_0x5bfc68,function(_0x36917f){return _0x36917f['id']===_0x14f16b['id'];});_0x2aaaa6(_0x329da7);}else{_0x2aaaa6({'count':_0x5bfc68[_0xbb10('0x28')],'rows':_0x5bfc68});}});},'Telephones':function(){return new Promise(function(_0x2f7d2a){var _0x1d40b8=_['values'](_0x49baf4[_0xbb10('0x50')]);_0x2f7d2a({'count':_0x1d40b8['length'],'rows':_0x1d40b8});});},'Trunks':function(){return new Promise(function(_0x4fe3b5){var _0x519a54=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x51')]);_0x4fe3b5({'count':_0x519a54[_0xbb10('0x28')],'rows':_0x519a54});});},'OutboundChannels':function(){return new Promise(function(_0x108f99){var _0x5ce94f=_[_0xbb10('0x2c')](_0x49baf4['outboundChannels']);_0x108f99({'count':_0x5ce94f['length'],'rows':_0x5ce94f});});},'Outbound':function(){return new Promise(function(_0x165fe9){_0x165fe9(_0x49baf4[_0xbb10('0x44')]);});},'Campaigns':function(){return new Promise(function(_0x29529c){var _0x2bd2ab=_[_0xbb10('0x2c')](_0x49baf4['campaigns']);_0x29529c({'count':_0x2bd2ab[_0xbb10('0x28')],'rows':_0x2bd2ab});});},'VoiceQueuesPreview':function(_0x19fcec){var _0x2c6429=this;return new Promise(function(_0x3f3d38,_0x43cdb7){_0x312b72[_0xbb10('0x52')](_0x19fcec['id'])[_0xbb10('0x1f')](function(_0x53fa98){_0x3f3d38({'code':0xc8,'message':_0x53fa98[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x30f3ea){_0x43cdb7(_0x2c6429[_0xbb10('0x14')](0x1f4,_0x30f3ea[_0xbb10('0x20')]));});});},'EventManager':function(_0x172be3){var _0xa3b23=this;return new Promise(function(_0x312a08,_0x5a4429){if(!_0x172be3[_0xbb10('0x53')]){return _0x5a4429(_0xa3b23[_0xbb10('0x14')](0x1f4,_0xbb10('0x54')));}ami['emit']('custom:'+_0x172be3['event'],_0x172be3[_0xbb10('0x20')]);_0x312a08({'code':0xc8,'message':_0x172be3});});},'FaxAccounts':function(){return new Promise(function(_0x5a3c44){var _0x4e3d6a=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x55')]);_0x5a3c44({'count':_0x4e3d6a[_0xbb10('0x28')],'rows':_0x4e3d6a});});},'SendFax':function(_0x12ed63){var _0x32ec27=this;return new Promise(function(_0x24dca6,_0x33116){_0x481979[_0xbb10('0x56')](_0x12ed63)[_0xbb10('0x1f')](function(_0x5206e1){_0x24dca6({'code':0xc8,'message':_0x5206e1[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x46b6d2){_0x33116(_0x32ec27[_0xbb10('0x14')](0x1f4,_0x46b6d2['message']));});});},'CheckAfterSend':function(_0x4c0795){var _0x3547a3=this;return new Promise(function(_0x2280bd,_0x30f0a4){_0x481979[_0xbb10('0x57')](_0x4c0795)['then'](function(_0x17d596){_0x2280bd({'code':0xc8,'message':_0x17d596[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xf7b3e1){_0x30f0a4(_0x3547a3[_0xbb10('0x14')](0x1f4,_0xf7b3e1['message']));});});}};var _0x5f0691=jayson[_0xbb10('0x58')](_0x513741)[_0xbb10('0x59')]();_0x5f0691['on'](_0xbb10('0x14'),function(_0x5239da){return _0x3cdd53(_0x5239da);});_0x5f0691[_0xbb10('0x7')](0x232a,_0xbb10('0x5a'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x328583(_0xbb10('0x5b')+0x232a);});});}; \ No newline at end of file +var _0x7a54=['http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','moment','../../../config/environment','../ami','../model/voiceQueueSummary','listen','name','timers','updateAcw','agents','updateStatusRealtime','voiceStatus','pause','isConnected','error','asterisk','ami\x20disconnected','join','pick','keys','reload','Reload','message','catch','username','command','action','Command','then','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','channels','validate','map','uniqueid','channel','format','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','toLowerCase','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','Action','StopMixMonitor','destinationchannel','stop','filename','queueChannels','type','outbound','includes','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','run','custom:','event','faxAccounts','send'];(function(_0x2f523e,_0x335feb){var _0x217307=function(_0x17cda7){while(--_0x17cda7){_0x2f523e['push'](_0x2f523e['shift']());}};_0x217307(++_0x335feb);}(_0x7a54,0x106));var _0x47a5=function(_0x2a310c,_0x4ca49e){_0x2a310c=_0x2a310c-0x0;var _0x104763=_0x7a54[_0x2a310c];return _0x104763;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var jayson=require(_0x47a5('0x2'));var schema=require('validate');var moment=require(_0x47a5('0x3'));var config=require(_0x47a5('0x4'));var properties=require('../properties');var ami=require(_0x47a5('0x5'));var VoiceQueueSummary=require(_0x47a5('0x6'));exports[_0x47a5('0x7')]=function(_0x3717e1,_0xfdf934,_0x545a97){return new Promise(function(_0x3d5629,_0x59199c){var _0x343372={'QueuePause':function(_0x30e405){return new Promise(function(_0x506eda){var _0x194fb0=util['format']('%s/%s','SIP',_0x30e405[_0x47a5('0x8')]);if(_0x3717e1[_0x47a5('0x9')]&&_0x3717e1['timers'][_0x194fb0]&&_0x3717e1[_0x47a5('0x9')][_0x194fb0]['timer']){_0x3717e1['timers'][_0x194fb0][_0x47a5('0xa')]();}if(_0x3717e1[_0x47a5('0xb')][_0x194fb0]){_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xc')]({'state':_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xd')],'statePause':_0x30e405[_0x47a5('0xe')]?!![]:![]});}_0x506eda({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x44bd3e){var _0x221b54=this;return new Promise(function(_0x1cf309,_0x711793){if(ami[_0x47a5('0xf')]()==![]){return _0x711793(_0x221b54[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}_0x44bd3e=_[_0x47a5('0x14')](_0x44bd3e,_[_0x47a5('0x15')](properties[_0x47a5('0x16')]['module']));_0x44bd3e['action']=_0x47a5('0x17');return ami['Action'](_0x44bd3e)['then'](function(_0x423a81){_0x1cf309({'code':0xc8,'message':_0x423a81[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x1ef371){_0x711793(_0x221b54[_0x47a5('0x10')](0x1f5,_0x1ef371[_0x47a5('0x18')]));});});},'Command':function(_0x2763d6){var _0xe3c618=this;return new Promise(function(_0x3aed38,_0x4a9fcb){if(ami[_0x47a5('0xf')]()==![]){return _0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f4,[config['asterisk']['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')]['join']('\x20')));}_0x2763d6=_[_0x47a5('0x14')](_0x2763d6,_0x47a5('0x1b'));_0x2763d6[_0x47a5('0x1c')]=_0x47a5('0x1d');return ami['Action'](_0x2763d6)[_0x47a5('0x1e')](function(_0x385687){_0x3aed38({'code':0xc8,'message':_0x385687['content']});})[_0x47a5('0x19')](function(_0xc4cd63){_0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f5,_0xc4cd63[_0x47a5('0x18')]));});});},'VoiceQueues':function(){return new Promise(function(_0x3abd6a){var _0x50bf17=[];for(var _0x53078a in _0x3717e1[_0x47a5('0x1f')]){if(_0x3717e1['voiceQueues'][_0x47a5('0x20')](_0x53078a)){var _0x5b6c4e=_0x3717e1[_0x47a5('0x1f')][_0x53078a];var _0x378208=new VoiceQueueSummary(_0x5b6c4e);_0x50bf17[_0x47a5('0x21')](_0x378208);}}_0x3abd6a({'count':_0x50bf17[_0x47a5('0x22')],'rows':_0x50bf17});});},'UpdateVoiceQueue':function(_0x21f296){return new Promise(function(_0x3ba0b7,_0x24b162){var _0x136b14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x1f')],{'id':parseInt(_0x21f296['id'])});var _0x1127f8=_[_0x47a5('0x24')](_0x21f296,['id']);if(_0x136b14){for(var _0x3ad507 in _0x1127f8){if(typeof _0x1127f8[_0x3ad507]!=='undefined'&&typeof _0x136b14[_0x3ad507]!==_0x47a5('0x25')){_0x136b14[_0x3ad507]=_0x1127f8[_0x3ad507];}}_0x3ba0b7(_0x136b14);}else{_0x24b162();}});},'VoiceChannels':function(){return new Promise(function(_0x51833b){var _0x2ef875=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x27')]);_0x51833b({'count':_0x2ef875['length'],'rows':_0x2ef875});});},'VoiceChannelMixMonitor':function(_0x256650){var _0x625952=this;return new Promise(function(_0x39b50b,_0x1f1c68){if(ami['isConnected']()==![]){return _0x1f1c68(_0x625952['error'](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],'ami\x20disconnected'][_0x47a5('0x13')]('\x20')));}var _0x51544e=schema(properties['voicechannel'])[_0x47a5('0x28')](_0x256650);if(_0x51544e['length']>0x0){return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x51544e,'message')['join'](',\x20')));}var _0x274e34=_['find'](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x256650[_0x47a5('0x2a')]});if(_0x274e34&&_0x274e34[_0x47a5('0x2b')]){var _0x52749b=util[_0x47a5('0x2c')]('%s.%s',_0x256650['filename']||_0x256650[_0x47a5('0x2a')],_0x256650['format']||_0x47a5('0x2d'));return ami['Action']({'action':_0x47a5('0x2e'),'channel':_0x274e34[_0x47a5('0x2b')],'file':_0x52749b,'options':_0x47a5('0x2f')})[_0x47a5('0x1e')](function(_0x36add5){var _0xed6320=_[_0x47a5('0x23')](_0x274e34[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52749b['toLowerCase']()});if(_[_0x47a5('0x32')](_0xed6320)){_0x274e34[_0x47a5('0x30')]['push']({'filename':_0x47a5('0x31')+_0x52749b[_0x47a5('0x33')](),'createdAt':moment()[_0x47a5('0x2c')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x36add5[_0x47a5('0x34')],'status':_0x47a5('0x35')});}else{_0xed6320['mixmonitorid']=_0x36add5[_0x47a5('0x34')];_0xed6320[_0x47a5('0x36')]='rec';}_0x39b50b({'code':0xc8,'message':[_0x256650['uniqueid'],'MixMonitor\x20Success',_0x36add5[_0x47a5('0x34')]]['join']('\x20'),'mixmonitorid':_0x36add5[_0x47a5('0x34')]});})[_0x47a5('0x19')](function(_0x301a85){_0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,[_0x256650[_0x47a5('0x2a')],_0x301a85[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,_0x47a5('0x37')));}});},'VoiceChannelStopMixMonitor':function(_0x280500){var _0x1658e8=this;return new Promise(function(_0x23d6d8,_0x56dbbd){if(ami[_0x47a5('0xf')]()==![]){return _0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')]['join']('\x20')));}var _0x47c7a2=schema(properties['voicechannel'])['validate'](_0x280500);if(_0x47c7a2[_0x47a5('0x22')]>0x0){return _0x56dbbd(_0x1658e8['error'](0x1f4,_[_0x47a5('0x29')](_0x47c7a2,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x494526=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x280500['uniqueid']});if(_0x494526){return Promise['resolve']()[_0x47a5('0x1e')](function(){if(_0x494526['channel']){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x2b')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){if(_0x494526[_0x47a5('0x3a')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x3a')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){var _0x3574d4=_[_0x47a5('0x23')](_0x494526[_0x47a5('0x30')],{'mixmonitorid':_0x280500['mixmonitorid']});if(_0x3574d4){_0x3574d4[_0x47a5('0x36')]=_0x47a5('0x3b');}})['then'](function(){var _0x52b3a8=util[_0x47a5('0x2c')]('%s.%s',_0x280500[_0x47a5('0x3c')]||_0x280500[_0x47a5('0x2a')],_0x280500['format']||'wav');var _0x3d85cc=_['find'](_0x494526[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52b3a8[_0x47a5('0x33')]()});if(_0x3d85cc){_0x3d85cc[_0x47a5('0x36')]=_0x47a5('0x3b');}})[_0x47a5('0x1e')](function(){_0x23d6d8({'code':0xc8,'message':[_0x280500[_0x47a5('0x2a')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0x47a5('0x19')](function(_0x411230){_0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f5,[_0x280500[_0x47a5('0x2a')],_0x411230[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x56dbbd(_0x1658e8['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannels':function(_0x1c9a62){var _0x5f6a=this;return new Promise(function(_0x5c3c75){var _0x12ca40=_['values'](_0x3717e1[_0x47a5('0x3d')]);var _0xe31817={'count':_0x12ca40[_0x47a5('0x22')],'rows':_0x12ca40};if(_0x1c9a62&&_0x1c9a62[_0x47a5('0x3e')]){if(!['inbound',_0x47a5('0x3f')][_0x47a5('0x40')](_0x1c9a62[_0x47a5('0x3e')])){return _0x59199c(_0x5f6a[_0x47a5('0x10')](0x190,_0x47a5('0x41')));}var _0x6a53b3=_[_0x47a5('0x42')](_0x12ca40,function(_0x481089){return _0x481089[_0x47a5('0x3e')]===_0x1c9a62[_0x47a5('0x3e')];});_0xe31817[_0x47a5('0x43')]=_0x6a53b3[_0x47a5('0x22')];_0xe31817[_0x47a5('0x44')]=_0x6a53b3;}_0x5c3c75(_0xe31817);});},'VoiceQueuesChannel':function(_0x1ab0bf){var _0x572233=this;return new Promise(function(_0x1ad6a9,_0x245a15){var _0x1aa581=schema(properties['voicequeuechannel'])[_0x47a5('0x28')](_0x1ab0bf);if(_0x1aa581[_0x47a5('0x22')]>0x0){return _0x245a15(_0x572233[_0x47a5('0x10')](0x1f4,_['map'](_0x1aa581,'message')[_0x47a5('0x13')](',\x20')));}var _0x376e1d=_['find'](_0x3717e1['queueChannels'],{'uniqueid':_0x1ab0bf[_0x47a5('0x2a')]});if(_0x376e1d){_0x1ad6a9(_0x376e1d);}else{return _0x245a15(_0x572233['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannelHangup':function(_0x5d383d){var _0x482de6=this;return new Promise(function(_0x389ed9,_0x46d2d3){if(ami['isConnected']()==![]){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config['asterisk']['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x867da0=schema(properties[_0x47a5('0x45')])['validate'](_0x5d383d);if(_0x867da0[_0x47a5('0x22')]>0x0){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x867da0,'message')[_0x47a5('0x13')](',\x20')));}var _0x4db625=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x5d383d[_0x47a5('0x2a')]});if(_0x4db625&&_0x4db625[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':'Hangup','channel':_0x4db625[_0x47a5('0x2b')]})['then'](function(_0x5cbe97){_0x389ed9({'code':0xc8,'message':[_0x5d383d['uniqueid'],_0x5cbe97['message'][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')});})[_0x47a5('0x19')](function(_0x52e3ee){_0x46d2d3(_0x482de6['error'](0x1f5,[_0x5d383d[_0x47a5('0x2a')],_0x52e3ee[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x3474b7){var _0x519e9e=this;return new Promise(function(_0x22c886,_0x274d31){if(ami['isConnected']()==![]){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x35cca8=schema(properties[_0x47a5('0x46')])['validate'](_0x3474b7);if(_0x35cca8[_0x47a5('0x22')]>0x0){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x35cca8,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x4bbe14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x3474b7[_0x47a5('0x2a')]});if(_0x4bbe14&&_0x4bbe14[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x47'),'channel':_0x4bbe14[_0x47a5('0x2b')],'exten':_0x3474b7[_0x47a5('0x48')],'context':_0x3474b7[_0x47a5('0x49')]||_0x4bbe14[_0x47a5('0x49')],'priority':0x1})[_0x47a5('0x1e')](function(_0x44fda9){_0x22c886({'code':0xc8,'message':[_0x3474b7[_0x47a5('0x2a')],_0x44fda9[_0x47a5('0x18')][_0x47a5('0x33')]()]['join']('\x20')});})[_0x47a5('0x19')](function(_0x284fb8){_0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,[_0x3474b7['uniqueid'],_0x284fb8[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x3ac402){return new Promise(function(_0x522ccf){var _0x2d5ee6=_['values'](_0x3717e1[_0x47a5('0xb')]);if(_0x3ac402&&_0x3ac402['id']){var _0x4cf7c5=_[_0x47a5('0x23')](_0x2d5ee6,function(_0x2f27c3){return _0x2f27c3['id']===_0x3ac402['id'];});_0x522ccf(_0x4cf7c5);}else{_0x522ccf({'count':_0x2d5ee6[_0x47a5('0x22')],'rows':_0x2d5ee6});}});},'Telephones':function(){return new Promise(function(_0x58473b){var _0x4af557=_['values'](_0x3717e1[_0x47a5('0x4a')]);_0x58473b({'count':_0x4af557[_0x47a5('0x22')],'rows':_0x4af557});});},'Trunks':function(){return new Promise(function(_0xe3c0a7){var _0x117510=_['values'](_0x3717e1[_0x47a5('0x4b')]);_0xe3c0a7({'count':_0x117510[_0x47a5('0x22')],'rows':_0x117510});});},'OutboundChannels':function(){return new Promise(function(_0x390bc0){var _0xd5b23f=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x4c')]);_0x390bc0({'count':_0xd5b23f[_0x47a5('0x22')],'rows':_0xd5b23f});});},'Outbound':function(){return new Promise(function(_0x39939a){_0x39939a(_0x3717e1[_0x47a5('0x3f')]);});},'Campaigns':function(){return new Promise(function(_0xc69a68){var _0x2e6fcc=_[_0x47a5('0x26')](_0x3717e1['campaigns']);_0xc69a68({'count':_0x2e6fcc[_0x47a5('0x22')],'rows':_0x2e6fcc});});},'VoiceQueuesPreview':function(_0x4833be){var _0x2ad00a=this;return new Promise(function(_0x2ac30f,_0x281e5f){_0xfdf934[_0x47a5('0x4d')](_0x4833be['id'])[_0x47a5('0x1e')](function(_0xa9c853){_0x2ac30f({'code':0xc8,'message':_0xa9c853[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x11c1db){_0x281e5f(_0x2ad00a[_0x47a5('0x10')](0x1f4,_0x11c1db[_0x47a5('0x18')]));});});},'EventManager':function(_0x1f07ac){var _0x8f0035=this;return new Promise(function(_0x2d434c,_0x441d64){if(!_0x1f07ac['event']){return _0x441d64(_0x8f0035['error'](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0x47a5('0x4e')+_0x1f07ac[_0x47a5('0x4f')],_0x1f07ac['message']);_0x2d434c({'code':0xc8,'message':_0x1f07ac});});},'FaxAccounts':function(){return new Promise(function(_0x732e00){var _0x44dda2=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x50')]);_0x732e00({'count':_0x44dda2[_0x47a5('0x22')],'rows':_0x44dda2});});},'SendFax':function(_0x930d25){var _0x218dfa=this;return new Promise(function(_0x1c7302,_0x2e9a96){_0x545a97[_0x47a5('0x51')](_0x930d25)[_0x47a5('0x1e')](function(_0x5e5f16){_0x1c7302({'code':0xc8,'message':_0x5e5f16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x420671){_0x2e9a96(_0x218dfa['error'](0x1f4,_0x420671[_0x47a5('0x18')]));});});},'CheckAfterSend':function(_0x32f393){var _0x17b61d=this;return new Promise(function(_0x5d41d8,_0x19dc8c){_0x545a97['checkAfterSend'](_0x32f393)['then'](function(_0x356e16){_0x5d41d8({'code':0xc8,'message':_0x356e16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x27333e){_0x19dc8c(_0x17b61d[_0x47a5('0x10')](0x1f4,_0x27333e[_0x47a5('0x18')]));});});}};var _0x479a82=jayson['server'](_0x343372)[_0x47a5('0x52')]();_0x479a82['on']('error',function(_0x24dbee){return _0x59199c(_0x24dbee);});_0x479a82[_0x47a5('0x7')](0x232a,_0x47a5('0x53'),function(){console[_0x47a5('0x54')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x3d5629(_0x47a5('0x55')+0x232a);});});}; \ No newline at end of file diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js index 3ecfa78..847d8c2 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 _0x24e4=['socket.io-emitter','[CM][%s][%s]','stringify','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','map','destcalleridnum','calleridnum','routeId','firstName','phone','mobile','fax','createdAt','scheduledAt','updatedAt','then','isEmpty','length','info','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','calleridname','Unknown','destcalleridname','','resolve','createContact','push','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','trigger:%s','toLowerCase','merge','lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','redis','defaults','localhost'];(function(_0x435565,_0x5ba561){var _0x32186f=function(_0x50060e){while(--_0x50060e){_0x435565['push'](_0x435565['shift']());}};_0x32186f(++_0x5ba561);}(_0x24e4,0x10e));var _0x424e=function(_0x3e32a8,_0x255953){_0x3e32a8=_0x3e32a8-0x0;var _0x2997b0=_0x24e4[_0x3e32a8];return _0x2997b0;};'use strict';var _=require(_0x424e('0x0'));var BPromise=require(_0x424e('0x1'));var Redis=require(_0x424e('0x2'));var util=require(_0x424e('0x3'));var config=require(_0x424e('0x4'));var logger=require(_0x424e('0x5'))(_0x424e('0x6'));var cmContactRpc=require('../../rpc/cmContact');config[_0x424e('0x7')]=_[_0x424e('0x8')](config[_0x424e('0x7')],{'host':_0x424e('0x9'),'port':0x18eb});var io=require(_0x424e('0xa'))(new Redis(config[_0x424e('0x7')]));function emit(_0x1ce650,_0x2860df,_0x261964,_0x53d6a4,_0x34bbfa){logger['info'](_0x424e('0xb'),_0x1ce650,_0x2860df['id'],_0x261964,_0x53d6a4,JSON[_0x424e('0xc')](_0x34bbfa));io['to'](_0x261964)['emit'](_0x53d6a4,_0x34bbfa);}exports[_0x424e('0xd')]=function(_0x4c6daf,_0x39d05f,_0x33a2b2,_0x3dda80){var _0x54d6f1,_0x498c89;var _0x40dcff={};var _0x1408d5;var _0x178fc5=Number(_0x33a2b2[_0x424e('0xe')]);var _0x4f19c8=_0x33a2b2[_0x424e('0xf')]?Boolean(Number(_0x33a2b2[_0x424e('0xf')])):![];var _0x3ca264;var _0x168947=![];if(!_[_0x424e('0x10')](_0x33a2b2[_0x424e('0x11')])){if(_0x33a2b2[_0x424e('0x11')]=='1')_0x168947=!![];}if(!_0x168947){if(_0x3dda80['xmd-contactid']){_0x40dcff['id']=_0x3dda80[_0x424e('0x12')];}}if(!_0x40dcff['id']){_0x40dcff[_0x424e('0x13')]=_0x178fc5;_0x3ca264=_0x33a2b2[_0x424e('0x14')]&&_0x33a2b2['data3']!=='0'?_0x33a2b2[_0x424e('0x14')][_0x424e('0x15')](','):['phone'];_0x40dcff['$or']=_[_0x424e('0x16')](_0x3ca264,function(_0xf493cb){var _0x20d248={};_0x20d248[_0xf493cb]=_0x3dda80['routeId']?_0x3dda80[_0x424e('0x17')]:_0x3dda80[_0x424e('0x18')];return _0x20d248;});_0x1408d5=_0x3dda80[_0x424e('0x19')]?_0x3dda80[_0x424e('0x17')]:_0x3dda80[_0x424e('0x18')];}var _0x5c6ce0=['id',_0x424e('0x1a'),'lastName',_0x424e('0x1b'),_0x424e('0x1c'),_0x424e('0x1d'),'ListId',_0x424e('0x1e'),_0x424e('0x1f'),_0x424e('0x20')];var _0x469717=_['union'](_0x5c6ce0,_0x3ca264);BPromise['resolve']()[_0x424e('0x21')](cmContactRpc['getContacts']({'attributes':_0x469717,'where':_0x40dcff,'phone':_0x1408d5}))[_0x424e('0x21')](function(_0x21cc27){_0x498c89=_0x21cc27;if(!_[_0x424e('0x22')](_0x498c89)){if(_0x498c89[_0x424e('0x23')]===0x1){_0x54d6f1=_0x498c89[0x0];logger[_0x424e('0x24')](_0x424e('0x25'),_0x3dda80[_0x424e('0x26')],_0x39d05f['id'],_0x54d6f1['id']);}else{logger[_0x424e('0x24')](_0x424e('0x27'),_0x3dda80['uniqueid'],_0x39d05f['id'],_[_0x424e('0x16')](_0x498c89,'id')[_0x424e('0x28')](','));}return;}else{logger[_0x424e('0x24')](_0x424e('0x29'),_0x3dda80['uniqueid'],_0x39d05f['id']);var _0x4257b9={'ListId':_0x178fc5};var _0x2ba4ef=_0x33a2b2[_0x424e('0x2a')]&&_0x33a2b2[_0x424e('0x2a')]!=='0'?_0x33a2b2[_0x424e('0x2a')]:_0x424e('0x1b');if(_0x4f19c8){logger[_0x424e('0x24')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x3dda80[_0x424e('0x26')],_0x39d05f['id']);_0x4257b9[_0x2ba4ef]=_[_0x424e('0x10')](_0x3dda80[_0x424e('0x19')])?_0x3dda80[_0x424e('0x18')]:_0x3dda80[_0x424e('0x17')];if(_[_0x424e('0x10')](_0x3dda80[_0x424e('0x19')])){_0x4257b9[_0x424e('0x1a')]=_0x3dda80[_0x424e('0x2b')]&&_0x3dda80[_0x424e('0x2b')]!==''?_0x3dda80[_0x424e('0x2b')]:_0x424e('0x2c');}else{_0x4257b9[_0x424e('0x1a')]=_0x3dda80[_0x424e('0x2d')]&&_0x3dda80['destcalleridname']!==_0x424e('0x2e')?_0x3dda80['destcalleridname']:_0x424e('0x2c');}return BPromise[_0x424e('0x2f')]()[_0x424e('0x21')](cmContactRpc[_0x424e('0x30')](_0x4257b9))[_0x424e('0x21')](function(_0x23648c){_0x54d6f1=_0x23648c;_0x498c89[_0x424e('0x31')](_0x23648c);if(_0x54d6f1){logger[_0x424e('0x24')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x3dda80[_0x424e('0x26')],_0x39d05f['id'],_0x54d6f1['id']);}return;});}else{logger['info'](_0x424e('0x32'),_0x3dda80[_0x424e('0x26')],_0x39d05f['id']);_0x4257b9[_0x2ba4ef]=_[_0x424e('0x10')](_0x3dda80['routeId'])?_0x3dda80[_0x424e('0x18')]:_0x3dda80[_0x424e('0x17')];if(_[_0x424e('0x10')](_0x3dda80[_0x424e('0x19')])){_0x4257b9['firstName']=_0x3dda80[_0x424e('0x2b')]&&_0x3dda80['calleridname']!==_0x424e('0x2e')?_0x3dda80[_0x424e('0x2b')]:'Unknown';}else{_0x4257b9[_0x424e('0x1a')]=_0x3dda80[_0x424e('0x2d')]&&_0x3dda80['destcalleridname']!==_0x424e('0x2e')?_0x3dda80[_0x424e('0x2d')]:_0x424e('0x2c');}_0x54d6f1=_0x4257b9;_0x498c89[_0x424e('0x31')](_0x4257b9);return;}}})[_0x424e('0x21')](function(){if(_0x4c6daf){emit(_0x3dda80[_0x424e('0x26')],_0x39d05f,util[_0x424e('0x33')](_0x424e('0x34'),_0x4c6daf['name']),util[_0x424e('0x33')](_0x424e('0x35'),_0x33a2b2['action'][_0x424e('0x36')]()),{'evt':_[_0x424e('0x37')](_0x3dda80,{'autoCreate':_0x4f19c8}),'contact':_0x54d6f1===undefined?{}:_0x54d6f1,'contacts':_0x498c89[_0x424e('0x23')]===0x0?undefined:_0x498c89});}});}; \ No newline at end of file +var _0x8cdb=['Unknown','destcalleridname','resolve','createContact','push','format','name','trigger:%s','action','toLowerCase','merge','lodash','bluebird','ioredis','util','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','[CM][%s][%s]','stringify','emit','data2','isNil','data5','xmd-contactid','ListId','data3','phone','$or','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','fax','createdAt','updatedAt','union','then','getContacts','isEmpty','length','info','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','map','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname',''];(function(_0x27b0fe,_0x1d2394){var _0x393919=function(_0x2eea9a){while(--_0x2eea9a){_0x27b0fe['push'](_0x27b0fe['shift']());}};_0x393919(++_0x1d2394);}(_0x8cdb,0x193));var _0xb8cd=function(_0x4b2489,_0x4aeed8){_0x4b2489=_0x4b2489-0x0;var _0xc3038=_0x8cdb[_0x4b2489];return _0xc3038;};'use strict';var _=require(_0xb8cd('0x0'));var BPromise=require(_0xb8cd('0x1'));var Redis=require(_0xb8cd('0x2'));var util=require(_0xb8cd('0x3'));var config=require('../../../../config/environment');var logger=require(_0xb8cd('0x4'))(_0xb8cd('0x5'));var cmContactRpc=require(_0xb8cd('0x6'));config[_0xb8cd('0x7')]=_[_0xb8cd('0x8')](config[_0xb8cd('0x7')],{'host':_0xb8cd('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb8cd('0x7')]));function emit(_0x16194f,_0x9b6438,_0x197189,_0x2046df,_0x138bd3){logger['info'](_0xb8cd('0xa'),_0x16194f,_0x9b6438['id'],_0x197189,_0x2046df,JSON[_0xb8cd('0xb')](_0x138bd3));io['to'](_0x197189)[_0xb8cd('0xc')](_0x2046df,_0x138bd3);}exports['exec']=function(_0x2fcd6e,_0xaa2c52,_0x575d71,_0x446a2e){var _0x92facf,_0x204d8b;var _0x2d3925={};var _0x4d75dc;var _0x199dfd=Number(_0x575d71['data1']);var _0x2aa990=_0x575d71[_0xb8cd('0xd')]?Boolean(Number(_0x575d71[_0xb8cd('0xd')])):![];var _0x43adcd;var _0x204256=![];if(!_[_0xb8cd('0xe')](_0x575d71[_0xb8cd('0xf')])){if(_0x575d71[_0xb8cd('0xf')]=='1')_0x204256=!![];}if(!_0x204256){if(_0x446a2e[_0xb8cd('0x10')]){_0x2d3925['id']=_0x446a2e[_0xb8cd('0x10')];}}if(!_0x2d3925['id']){_0x2d3925[_0xb8cd('0x11')]=_0x199dfd;_0x43adcd=_0x575d71[_0xb8cd('0x12')]&&_0x575d71[_0xb8cd('0x12')]!=='0'?_0x575d71[_0xb8cd('0x12')]['split'](','):[_0xb8cd('0x13')];_0x2d3925[_0xb8cd('0x14')]=_['map'](_0x43adcd,function(_0x21b38c){var _0x264051={};_0x264051[_0x21b38c]=_0x446a2e[_0xb8cd('0x15')]?_0x446a2e[_0xb8cd('0x16')]:_0x446a2e[_0xb8cd('0x17')];return _0x264051;});_0x4d75dc=_0x446a2e[_0xb8cd('0x15')]?_0x446a2e[_0xb8cd('0x16')]:_0x446a2e[_0xb8cd('0x17')];}var _0x5cdf00=['id',_0xb8cd('0x18'),_0xb8cd('0x19'),'phone',_0xb8cd('0x1a'),_0xb8cd('0x1b'),_0xb8cd('0x11'),_0xb8cd('0x1c'),'scheduledAt',_0xb8cd('0x1d')];var _0x53204a=_[_0xb8cd('0x1e')](_0x5cdf00,_0x43adcd);BPromise['resolve']()[_0xb8cd('0x1f')](cmContactRpc[_0xb8cd('0x20')]({'attributes':_0x53204a,'where':_0x2d3925,'phone':_0x4d75dc}))['then'](function(_0x718186){_0x204d8b=_0x718186;if(!_[_0xb8cd('0x21')](_0x204d8b)){if(_0x204d8b[_0xb8cd('0x22')]===0x1){_0x92facf=_0x204d8b[0x0];logger[_0xb8cd('0x23')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x446a2e[_0xb8cd('0x24')],_0xaa2c52['id'],_0x92facf['id']);}else{logger[_0xb8cd('0x23')](_0xb8cd('0x25'),_0x446a2e[_0xb8cd('0x24')],_0xaa2c52['id'],_[_0xb8cd('0x26')](_0x204d8b,'id')[_0xb8cd('0x27')](','));}return;}else{logger['info'](_0xb8cd('0x28'),_0x446a2e[_0xb8cd('0x24')],_0xaa2c52['id']);var _0x23fcf7={'ListId':_0x199dfd};var _0x22de6a=_0x575d71[_0xb8cd('0x29')]&&_0x575d71[_0xb8cd('0x29')]!=='0'?_0x575d71[_0xb8cd('0x29')]:'phone';if(_0x2aa990){logger[_0xb8cd('0x23')](_0xb8cd('0x2a'),_0x446a2e[_0xb8cd('0x24')],_0xaa2c52['id']);_0x23fcf7[_0x22de6a]=_[_0xb8cd('0xe')](_0x446a2e[_0xb8cd('0x15')])?_0x446a2e[_0xb8cd('0x17')]:_0x446a2e['destcalleridnum'];if(_['isNil'](_0x446a2e[_0xb8cd('0x15')])){_0x23fcf7[_0xb8cd('0x18')]=_0x446a2e[_0xb8cd('0x2b')]&&_0x446a2e[_0xb8cd('0x2b')]!==_0xb8cd('0x2c')?_0x446a2e[_0xb8cd('0x2b')]:_0xb8cd('0x2d');}else{_0x23fcf7['firstName']=_0x446a2e[_0xb8cd('0x2e')]&&_0x446a2e[_0xb8cd('0x2e')]!==_0xb8cd('0x2c')?_0x446a2e[_0xb8cd('0x2e')]:_0xb8cd('0x2d');}return BPromise[_0xb8cd('0x2f')]()[_0xb8cd('0x1f')](cmContactRpc[_0xb8cd('0x30')](_0x23fcf7))[_0xb8cd('0x1f')](function(_0xb044a0){_0x92facf=_0xb044a0;_0x204d8b[_0xb8cd('0x31')](_0xb044a0);if(_0x92facf){logger[_0xb8cd('0x23')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x446a2e[_0xb8cd('0x24')],_0xaa2c52['id'],_0x92facf['id']);}return;});}else{logger['info']('[CM][%s][%s]\x20Autocreate\x20disabled',_0x446a2e[_0xb8cd('0x24')],_0xaa2c52['id']);_0x23fcf7[_0x22de6a]=_[_0xb8cd('0xe')](_0x446a2e[_0xb8cd('0x15')])?_0x446a2e[_0xb8cd('0x17')]:_0x446a2e['destcalleridnum'];if(_[_0xb8cd('0xe')](_0x446a2e[_0xb8cd('0x15')])){_0x23fcf7[_0xb8cd('0x18')]=_0x446a2e[_0xb8cd('0x2b')]&&_0x446a2e[_0xb8cd('0x2b')]!==_0xb8cd('0x2c')?_0x446a2e[_0xb8cd('0x2b')]:_0xb8cd('0x2d');}else{_0x23fcf7['firstName']=_0x446a2e[_0xb8cd('0x2e')]&&_0x446a2e[_0xb8cd('0x2e')]!==''?_0x446a2e[_0xb8cd('0x2e')]:_0xb8cd('0x2d');}_0x92facf=_0x23fcf7;_0x204d8b[_0xb8cd('0x31')](_0x23fcf7);return;}}})[_0xb8cd('0x1f')](function(){if(_0x2fcd6e){emit(_0x446a2e['uniqueid'],_0xaa2c52,util[_0xb8cd('0x32')]('user:%s',_0x2fcd6e[_0xb8cd('0x33')]),util[_0xb8cd('0x32')](_0xb8cd('0x34'),_0x575d71[_0xb8cd('0x35')][_0xb8cd('0x36')]()),{'evt':_[_0xb8cd('0x37')](_0x446a2e,{'autoCreate':_0x2aa990}),'contact':_0x92facf===undefined?{}:_0x92facf,'contacts':_0x204d8b[_0xb8cd('0x22')]===0x0?undefined:_0x204d8b});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 40fdeba..d8c2b15 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 _0x483f=['every','checkConditions','channel','AnyConditions','some','field','account','ChatWebsiteId','AccountId','operator','value','upperFirst','event','agent','membername','lastevent','mailSubstatus','substatus','offlineMessage','equals','exports','util','lodash','ioredis','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','../ami','redis','localhost','url','winapp','triggers','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','bind','custom:agentringnoanswer','syncCustomEvent','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','emit','info','prototype','motionChannel','undefined','voice','debug','inspect','checkTriggers','agents','interface','status','checkTrigger','merge','variables','length','Actions','contactmanager','motionbar','browser','data1','TemplateId','data2','render','html','template\x20not\x20found','uri','buildUri','isNil','data3','data4','location','uriLocation','windowWidth','800','data5','windowHeight','600','winApplication','format','user:%s','name','trigger:%s:%s','toLowerCase','trigger:%s','action','exec','integration','queue','routeId','urlforward','script','search','AllConditions'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x483f,0x10d));var _0xf483=function(_0x15bdd9,_0x22deae){_0x15bdd9=_0x15bdd9-0x0;var _0x5b3709=_0x483f[_0x15bdd9];return _0x5b3709;};'use strict';var util=require(_0xf483('0x0'));var _=require(_0xf483('0x1'));var url=require('url');var Mustache=require('mustache');var Redis=require(_0xf483('0x2'));var urlforward=require('./urlforward');var integration=require('./integration');var cmContact=require(_0xf483('0x3'));var script=require(_0xf483('0x4'));var config=require(_0xf483('0x5'));var logger=require(_0xf483('0x6'))(_0xf483('0x7'));var ami=require(_0xf483('0x8'));config['redis']=_['defaults'](config[_0xf483('0x9')],{'host':_0xf483('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf483('0x9')]));var operators={'equals':function(_0x2e3495,_0x33161c){return _0x2e3495==_0x33161c;},'not_equals':function(_0xc7f931,_0x1cdf77){return _0xc7f931!=_0x1cdf77;}};var barAndWebActions=['popup',_0xf483('0xb'),_0xf483('0xc')];function Trigger(_0x5a6379){this['triggers']=_0x5a6379[_0xf483('0xd')];this['agents']=_0x5a6379['agents'];this[_0xf483('0xe')]=_0x5a6379['voiceQueues'];this[_0xf483('0xf')]=_0x5a6379[_0xf483('0xf')];this[_0xf483('0x10')]=_0x5a6379[_0xf483('0x10')];this[_0xf483('0x11')]=_0x5a6379['zendeskAccounts'];this[_0xf483('0x12')]=_0x5a6379[_0xf483('0x12')];this[_0xf483('0x13')]=_0x5a6379[_0xf483('0x13')];this[_0xf483('0x14')]=_0x5a6379[_0xf483('0x14')];this[_0xf483('0x15')]=_0x5a6379['zohoAccounts'];this[_0xf483('0x16')]=_0x5a6379[_0xf483('0x16')];this[_0xf483('0x17')]=_0x5a6379[_0xf483('0x17')];this[_0xf483('0x18')]=_0x5a6379[_0xf483('0x18')];this[_0xf483('0x19')]=_0x5a6379[_0xf483('0x19')];this[_0xf483('0x1a')]=_0x5a6379[_0xf483('0x1a')];this['accounts']={'zendesk':this[_0xf483('0x11')],'salesforce':this['salesforceAccounts'],'freshdesk':this[_0xf483('0x12')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0xf483('0x15')],'desk':this[_0xf483('0x16')],'vtiger':this[_0xf483('0x17')],'dynamics365':this[_0xf483('0x19')],'freshsales':this[_0xf483('0x1a')],'servicenow':this[_0xf483('0x18')]};ami['on']('custom:agentcalled',this['syncCustomEvent'][_0xf483('0x1b')](this));ami['on']('custom:agentconnect',this['syncCustomEvent'][_0xf483('0x1b')](this));ami['on'](_0xf483('0x1c'),this[_0xf483('0x1d')][_0xf483('0x1b')](this));ami['on'](_0xf483('0x1e'),this[_0xf483('0x1d')][_0xf483('0x1b')](this));ami['on'](_0xf483('0x1f'),this['syncCustomEvent'][_0xf483('0x1b')](this));ami['on'](_0xf483('0x20'),this[_0xf483('0x1d')]['bind'](this));ami['on'](_0xf483('0x21'),this[_0xf483('0x1d')]['bind'](this));ami['on'](_0xf483('0x22'),this['syncCustomEvent']['bind'](this));ami['on'](_0xf483('0x23'),this[_0xf483('0x1d')][_0xf483('0x1b')](this));ami['on'](_0xf483('0x24'),this[_0xf483('0x1d')]['bind'](this));ami['on']('custom:queuecallerabandon',this[_0xf483('0x1d')]['bind'](this));ami['on'](_0xf483('0x25'),this[_0xf483('0x1d')][_0xf483('0x1b')](this));ami['on'](_0xf483('0x26'),this[_0xf483('0x27')]['bind'](this));ami['on'](_0xf483('0x28'),this['syncAgentDial'][_0xf483('0x1b')](this));ami['on'](_0xf483('0x29'),this[_0xf483('0x27')][_0xf483('0x1b')](this));ami['on'](_0xf483('0x2a'),this[_0xf483('0x1d')][_0xf483('0x1b')](this));ami['on']('custom:closedinteraction',this[_0xf483('0x1d')][_0xf483('0x1b')](this));ami['on'](_0xf483('0x2b'),this['syncCustomEvent'][_0xf483('0x1b')](this));ami['on'](_0xf483('0x2c'),this[_0xf483('0x1d')][_0xf483('0x1b')](this));ami['on'](_0xf483('0x2d'),this[_0xf483('0x1d')][_0xf483('0x1b')](this));ami['on'](_0xf483('0x2e'),this[_0xf483('0x1d')][_0xf483('0x1b')](this));ami['on'](_0xf483('0x2f'),this[_0xf483('0x1d')][_0xf483('0x1b')](this));ami['on'](_0xf483('0x30'),this['syncCustomEvent'][_0xf483('0x1b')](this));}Trigger['prototype'][_0xf483('0x31')]=function(_0x80792b,_0x5ae215,_0x61d91){logger[_0xf483('0x32')](_0x80792b,_0x5ae215,JSON['stringify'](_0x61d91));io['to'](_0x80792b)[_0xf483('0x31')](_0x5ae215,_0x61d91);};Trigger[_0xf483('0x33')][_0xf483('0x1d')]=function(_0x5ea3fb){var _0x1c1ea8=_['clone'](_0x5ea3fb);if(typeof _0x1c1ea8[_0xf483('0x34')]===_0xf483('0x35')){_0x1c1ea8['motionChannel']=_0xf483('0x36');}logger[_0xf483('0x37')](_0xf483('0x1d'),util[_0xf483('0x38')](_0x1c1ea8,{'showHidden':!![],'depth':null}));this[_0xf483('0x39')](_0x1c1ea8);};Trigger[_0xf483('0x33')]['syncAgentDial']=function(_0x29c8db){if(this[_0xf483('0x3a')][_0x29c8db[_0xf483('0x3b')]]){this[_0xf483('0x1d')](_0x29c8db);}};Trigger[_0xf483('0x33')][_0xf483('0x39')]=function(_0xf8c00f){var _0x48ee75;for(var _0x469fc0 in this['triggers']){if(this[_0xf483('0xd')]['hasOwnProperty'](_0x469fc0)){if(this[_0xf483('0xd')][_0x469fc0][_0xf483('0x3c')]){_0x48ee75=this[_0xf483('0x3d')](this[_0xf483('0xd')][_0x469fc0],_0xf8c00f);if(_0x48ee75){_[_0xf483('0x3e')](_0xf8c00f,_0xf8c00f[_0xf483('0x3f')]);for(var _0x1aa556=0x0,_0x26fdb7,_0x3b55fe,_0x4a8a30;_0x1aa5560x0){_0x53c904=_[_0x7721('0x2a')](_0x315202,_0x343c19);}return _0x53c904;}function getCustomFields(_0x37b9f0,_0xd7d703){var _0x1da2d8=[];var _0x5c54f0={'custom_fields':{}};if(_0x37b9f0[_0x7721('0x29')]>0x0){_[_0x7721('0x2b')](_0x37b9f0,function(_0x497f9f){if(_['includes']([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x2e')]&&!_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x497f9f[_0x7721('0x2e')]['toLowerCase']()]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_[_0x7721('0x32')]([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x7721('0x34')][_0x497f9f['idField']]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_0x497f9f['type']===_0x7721('0x35')&&_0x497f9f['variableName']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0xd7d703[_0x497f9f[_0x7721('0x36')]]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x36')]][_0x7721('0x31')]());}else if(_0x497f9f[_0x7721('0x37')]===_0x7721('0x38')&&_0x497f9f[_0x7721('0x39')]&&_0x497f9f[_0x7721('0x39')]['name']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f['customField']){_0xd7d703[_0x497f9f[_0x7721('0x39')][_0x7721('0x3a')][_0x7721('0x3b')]()]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x39')]['name']['toLowerCase']()]['toString']());}});}if(_0x5c54f0['priority']){_0x5c54f0[_0x7721('0x3c')]=Number(_0x5c54f0[_0x7721('0x3c')]);}return _0x5c54f0;}function getTicket(_0x1acc72,_0x22ef35,_0x4a90ce,_0xa389fa,_0x4cf659){logger[_0x7721('0x15')](_0x7721('0x3d'));var _0x5a278e=_[_0x7721('0x3e')]({'subject':intUtil[_0x7721('0x3f')](_0xa389fa['Subjects'],_0x4cf659,'\x20'),'type':'phone','status':_0x7721('0x40'),'labels':[_0x7721('0x41'),_0x7721('0x42'),_0x7721('0x43')]['concat'](getTags(_0xa389fa[_0x7721('0x44')],_0x7721('0x3a'))),'description':intUtil[_0x7721('0x3f')](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7721('0xe')]('/api/v2/users/%d',_0x22ef35['id']),'class':_0x7721('0x46')}},'message':{'direction':'in','body':intUtil['getString'](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a')}},getCustomFields(_0xa389fa['Fields'],_0x4cf659));return request({'uri':util[_0x7721('0xe')](_0x7721('0x47'),_0x1acc72[_0x7721('0x10')],_0x4a90ce['id']),'method':'POST','body':_0x5a278e});}exports[_0x7721('0x48')]=function(_0x11d853,_0x1ad315,_0x481fa8,_0x9f7b1d,_0x754071,_0xdb3033){var _0x2d5f35,_0x135dbc;_0xdb3033[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0xdb3033['remoteUri']);_0xdb3033['serverUrl']=intUtil[_0x7721('0x49')](_0xdb3033[_0x7721('0x4a')]);if(_0x754071&&_0x754071[_0x7721('0x4b')]){logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x4d'));_0x1ad315[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0xdb3033[_0x7721('0x4a')],_0x1ad315['uniqueid'],md5(_0x1ad315['uniqueid']));}else{_0x1ad315[_0x7721('0x4e')]='';}headers[_0x7721('0x50')]=getAuth(_0xdb3033);return getUser(_0xdb3033,_0x9f7b1d[_0x7721('0x51')])[_0x7721('0x11')](function(_0x589e95){_0x2d5f35=_0x589e95;logger[_0x7721('0x15')](_0x7721('0x52'),_0x2d5f35['id']);return getEndUser(_0xdb3033,_0x1ad315['calleridname'],_0x1ad315[_0x7721('0x53')]);})['then'](function(_0x2682b1){_0x135dbc=_0x2682b1;logger['info'](_0x7721('0x54'),_0x135dbc['id']);return getTicket(_0xdb3033,_0x2d5f35,_0x135dbc,_0x481fa8,_0x1ad315);})[_0x7721('0x11')](function(_0xf17c40){if(_0xf17c40){logger['info'](_0x7721('0x55'));logger[_0x7721('0x15')]('The\x20Ticket\x20ID\x20is:',_0xf17c40['id']);switch(_0xdb3033[_0x7721('0x37')]){case _0x7721('0x56'):logger[_0x7721('0x15')]('[QUEUE]',_0x7721('0x57'));emit(util['format'](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0xf17c40['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x5d'),_0xf17c40['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x4c'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2f6f30){console[_0x7721('0x5e')](_0x2f6f30);logger[_0x7721('0x5e')](_0x7721('0x4c'),JSON[_0x7721('0x1a')](_0x2f6f30));});};exports[_0x7721('0x60')]=function(_0x57484c,_0x234bee,_0x17036e,_0x134908,_0x3b7382,_0x1f1e84,_0x9c0d4){var _0x7fbd6c,_0x33287d;_0x1f1e84[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x10')]);_0x1f1e84['serverUrl']=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x4a')]);if(_0x9c0d4&&_0x9c0d4[_0x7721('0x61')]&&_0x9c0d4[_0x7721('0x61')]!==_0x7721('0x62')){logger[_0x7721('0x15')](_0x7721('0x63'),_0x7721('0x4d'));_0x234bee[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0x1f1e84[_0x7721('0x4a')],_0x234bee[_0x7721('0x64')],md5(_0x234bee[_0x7721('0x64')]));}headers[_0x7721('0x50')]=getAuth(_0x1f1e84);return getUser(_0x1f1e84,_0x134908['email'])['then'](function(_0x4e112e){_0x7fbd6c=_0x4e112e;logger[_0x7721('0x15')]('The\x20User\x20ID\x20is:',_0x7fbd6c['id']);return getEndUser(_0x1f1e84,_0x234bee['destcalleridname'],_0x234bee['destcalleridnum']);})['then'](function(_0x47925a){_0x33287d=_0x47925a;logger[_0x7721('0x15')](_0x7721('0x54'),_0x33287d['id']);return getTicket(_0x1f1e84,_0x7fbd6c,_0x33287d,_0x17036e,_0x234bee);})['then'](function(_0x5181d7){if(_0x5181d7){logger['info']('Ticket\x20created!');logger['info'](_0x7721('0x65'),_0x5181d7['id']);switch(_0x1f1e84['type']){case'integrationTab':logger['info'](_0x7721('0x4c'),_0x7721('0x57'));emit(util[_0x7721('0xe')]('user:%s',_0x134908[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0x5181d7['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x134908[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x66'),_0x1f1e84[_0x7721('0x10')],_0x5181d7['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x63'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2c93b0){logger[_0x7721('0x5e')](_0x7721('0x63'),JSON['stringify'](_0x2c93b0));});};exports[_0x7721('0x67')]=function(_0x104f05,_0x4c8284,_0x3e7df3,_0x5d37ad,_0x1f508d,_0x4bfb48){var _0x36a3a6,_0x3f9eaa;_0x4bfb48[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x4bfb48[_0x7721('0x10')]);_0x4bfb48[_0x7721('0x4a')]=intUtil[_0x7721('0x49')](_0x4bfb48['serverUrl']);if(_0x1f508d&&_0x1f508d[_0x7721('0x4b')]){logger[_0x7721('0x15')]('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',_0x7721('0x4d'));_0x4c8284[_0x7721('0x4e')]=util[_0x7721('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4bfb48[_0x7721('0x4a')],_0x4c8284[_0x7721('0x64')],md5(_0x4c8284['uniqueid']));}else{_0x4c8284[_0x7721('0x4e')]='';}headers['Authorization']=getAuth(_0x4bfb48);return getUser(_0x4bfb48)[_0x7721('0x11')](function(_0x382800){_0x36a3a6=_0x382800;logger[_0x7721('0x15')](_0x7721('0x52'),_0x36a3a6['id']);return getEndUser(_0x4bfb48,_0x4c8284[_0x7721('0x6a')],_0x4c8284[_0x7721('0x53')]);})[_0x7721('0x11')](function(_0x5dca04){_0x3f9eaa=_0x5dca04;logger[_0x7721('0x15')](_0x7721('0x54'),_0x3f9eaa['id']);return getTicket(_0x4bfb48,_0x36a3a6,_0x3f9eaa,_0x3e7df3,_0x4c8284);})[_0x7721('0x11')](function(_0x5f08cc){if(_0x5f08cc){logger['info']('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x5f08cc['id']);}})[_0x7721('0x5f')](function(_0x2645dd){logger['error']('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',JSON[_0x7721('0x1a')](_0x2645dd));});}; \ No newline at end of file +var _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(_0x48c14e,_0x5efe91){var _0x481a70=function(_0xacd075){while(--_0xacd075){_0x48c14e['push'](_0x48c14e['shift']());}};_0x481a70(++_0x5efe91);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'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 b076b8f..ef045ca 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 _0x4718=['ticketType','POST','incidents','assign','getString','/contacts(','Fields','phonecall','queue','phonecalls','Subjects','Descriptions','callDirection','odata-entityid','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','stripTrailingSlash','serverUrl','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','ticketId',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','./util','../../../../config/logger','dynamics365','../../../../config/environment','redis','localhost','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','data2','resolve','data5','username','password','clientSecret','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','value','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled',']\x20Agent\x20found\x20','systemuserid','userId','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','Bearer\x20','body','headers','substring','lastIndexOf','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','enduserId','contactid',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','forEach','includes','string','picklist','nameField','customField','idField','indexOf','content'];(function(_0x73b80e,_0x4daa4a){var _0x4c31cd=function(_0x3663a0){while(--_0x3663a0){_0x73b80e['push'](_0x73b80e['shift']());}};_0x4c31cd(++_0x4daa4a);}(_0x4718,0x1d2));var _0x8471=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x4718[_0x334841];return _0x5beb4b;};'use strict';var _=require(_0x8471('0x0'));var rp=require('request-promise');var util=require('util');var intUtil=require(_0x8471('0x1'));var md5=require('md5');var Redis=require('ioredis');var logger=require(_0x8471('0x2'))(_0x8471('0x3'));var config=require(_0x8471('0x4'));config[_0x8471('0x5')]=_['defaults'](config[_0x8471('0x5')],{'host':_0x8471('0x6'),'port':0x18eb});var io=require(_0x8471('0x7'))(new Redis(config[_0x8471('0x5')]));function getAuthToken(_0x4268ec,_0x3dfe2,_0x29bd8c){if(_0x4268ec[_0x8471('0x8')]){_0x4268ec[_0x8471('0x9')]=_0x4268ec[_0x8471('0xa')][_0x8471('0xb')];_0x4268ec[_0x8471('0xc')]=_0x4268ec[_0x8471('0xa')][_0x8471('0xd')];return Promise[_0x8471('0xe')](_0x4268ec['CloudProvider'][_0x8471('0xf')]);}var _0x1f2d53={'method':'POST','uri':_0x3dfe2,'form':{'client_id':_0x4268ec['clientId'],'resource':_0x4268ec['remoteUri'],'username':_0x4268ec[_0x8471('0x10')],'password':_0x4268ec[_0x8471('0x11')],'grant_type':_0x8471('0x11'),'client_secret':_0x4268ec[_0x8471('0x12')]},'json':!![]};return rp(_0x1f2d53)[_0x8471('0x13')](function(_0x93791b){return _0x93791b[_0x8471('0x14')];})[_0x8471('0x15')](function(_0x342f2f){logger[_0x8471('0x16')]('['+[_0x29bd8c[_0x8471('0x17')]()]+_0x8471('0x18'));return _0x342f2f[_0x8471('0x19')];});}function getUser(_0x4d74f4,_0x47c3af,_0x38ed27,_0x3bdb54,_0x5648fa,_0x33e984){return new Promise(function(_0x2206eb,_0x2f23bf){return getAuthToken(_0x47c3af,_0x3bdb54,_0x33e984)['then'](function(_0x49bd2){var _0x243c83={'method':_0x8471('0x1a'),'uri':_0x5648fa+_0x8471('0x1b'),'headers':{'Authorization':'Bearer\x20'+_0x49bd2,'OData-Version':_0x8471('0x1c')},'json':!![]};return rp(_0x243c83);})['then'](function(_0x4bc00e){var _0x5f33b1=_0x4bc00e[_0x8471('0x1d')];var _0x4c7010=![];var _0x272ff4=null;if(!_[_0x8471('0x1e')](_0x38ed27)){if(intUtil[_0x8471('0x1f')](_0x38ed27[_0x8471('0x20')])){_0x4d74f4[_0x8471('0x21')]=_0x38ed27[_0x8471('0x20')];for(_0x272ff4=0x0;_0x272ff4<_0x5f33b1[_0x8471('0x22')];_0x272ff4++){if(_0x5f33b1[_0x272ff4][_0x8471('0x23')]===_0x38ed27[_0x8471('0x20')]&&!_0x5f33b1[_0x272ff4][_0x8471('0x24')]){_0x4c7010=!![];logger['info']('['+[_0x33e984[_0x8471('0x17')]()]+_0x8471('0x25')+_0x5f33b1[_0x272ff4][_0x8471('0x26')]+'!');_0x4d74f4[_0x8471('0x27')]=_0x5f33b1[_0x272ff4][_0x8471('0x26')];}}}}if(!_0x4c7010){logger[_0x8471('0x28')]('['+[_0x33e984['toUpperCase']()]+_0x8471('0x29'));_0x4d74f4[_0x8471('0x21')]=_0x47c3af['username'];for(_0x272ff4=0x0;_0x272ff4<_0x5f33b1[_0x8471('0x22')];_0x272ff4++){if(_0x5f33b1[_0x272ff4][_0x8471('0x23')]===_0x47c3af['username']){_0x4d74f4[_0x8471('0x27')]=_0x5f33b1[_0x272ff4][_0x8471('0x26')];}}}_0x2206eb(_0x4d74f4);})[_0x8471('0x15')](function(_0x4b605a){_0x2f23bf(_0x4b605a['message']);});});}function createEndUser(_0x29f300,_0x4e002b,_0x2c7096,_0x13e6d3,_0x1ce4e6,_0x2ab291,_0xb82162){return new Promise(function(_0x2db9e3,_0x25dfcd){return getAuthToken(_0x4e002b,_0x2c7096,_0x2ab291)[_0x8471('0x13')](function(_0x1ae910){var _0x5206a2=_0x2ab291[_0x8471('0x2a')]()===_0x8471('0x2b')?_0x1ce4e6[_0x8471('0x2c')]:_0x1ce4e6[_0x8471('0x2d')];var _0x193b97={'method':'POST','uri':_0x13e6d3+_0x8471('0x2e'),'body':{'fullname':_0x5206a2,'firstname':_0x5206a2,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x8471('0x2f')+_0x29f300['userId']+')'},'headers':{'Authorization':_0x8471('0x30')+_0x1ae910,'OData-Version':_0x8471('0x1c')},'json':!![],'resolveWithFullResponse':!![]};_0x193b97[_0x8471('0x31')][_0xb82162]=_0x5206a2;return rp(_0x193b97);})[_0x8471('0x13')](function(_0x33ee80){var _0x4cef36=_0x33ee80[_0x8471('0x32')]['odata-entityid'];var _0x48e066=_0x4cef36[_0x8471('0x33')](_0x4cef36[_0x8471('0x34')]('(')+0x1,_0x4cef36[_0x8471('0x34')](')'));_0x29f300['enduserId']=_0x48e066;_0x2db9e3(_0x29f300);})[_0x8471('0x15')](function(_0x220c14){_0x25dfcd(_0x220c14[_0x8471('0x19')]);});});}function getEndUser(_0x16b7f5,_0xcd99b,_0x77009c,_0x5874b9,_0x126fe5,_0x39ab7a,_0x363f3c,_0x2543f7){var _0x51278d=_0x39ab7a['toLowerCase']()===_0x8471('0x2b')?_0x126fe5[_0x8471('0x2c')]:_0x126fe5['calleridnum'];return getAuthToken(_0xcd99b,_0x77009c,_0x39ab7a)[_0x8471('0x13')](function(_0x482133){_0x2543f7=_0x2543f7?_0x2543f7:_0x8471('0x35');var _0x3b60cd={'method':'GET','uri':_0x5874b9+_0x8471('0x36')+_0x2543f7+_0x8471('0x37')+_0x2543f7+_0x8471('0x38')+_0x51278d['replace']('+','%2b')+'\x27','headers':{'Authorization':'Bearer\x20'+_0x482133,'If-None-Match':null,'OData-Version':_0x8471('0x1c')},'json':!![]};return rp(_0x3b60cd);})[_0x8471('0x13')](function(_0x3e4f34){var _0x242777=![];if(!_0x3e4f34)return _0x242777;var _0x11fcf6=_0x3e4f34[_0x8471('0x1d')];for(var _0x40835f=0x0;_0x40835f<_0x11fcf6['length'];_0x40835f++){if(_0x11fcf6[_0x40835f][_0x2543f7]===_0x51278d){_0x242777=!![];_0x16b7f5[_0x8471('0x39')]=_0x11fcf6[_0x40835f][_0x8471('0x3a')];}}return _0x242777;})['then'](function(_0x28609d){if(_0x28609d)return _0x16b7f5;if(_0x363f3c==='nothing'){logger[_0x8471('0x28')]('['+[_0x39ab7a[_0x8471('0x17')]()]+_0x8471('0x3b'));return _0x16b7f5;}return createEndUser(_0x16b7f5,_0xcd99b,_0x77009c,_0x5874b9,_0x126fe5,_0x39ab7a,_0x2543f7)['then'](function(_0x2a9cd8){logger['info']('['+[_0x39ab7a[_0x8471('0x17')]()]+']\x20Enduser\x20created!',_0x2a9cd8[_0x8471('0x39')]);return _0x2a9cd8;});});}function getCustomFields(_0x152559,_0x194ecd,_0x1b8b76){var _0x38a1e8={};if(_0x152559[_0x8471('0x22')]>0x0){_[_0x8471('0x3c')](_0x152559,function(_0x292fbb){if(_[_0x8471('0x3d')]([_0x8471('0x3e'),_0x8471('0x3f')],_0x292fbb['type'])&&_0x292fbb[_0x8471('0x40')]&&!_0x292fbb[_0x8471('0x41')]){var _0x2766af=_0x292fbb[_0x8471('0x42')]['toLowerCase']();var _0x15deeb=_0x2766af[_0x8471('0x33')](0x0,_0x2766af['indexOf']('_'));var _0x102e4e=_0x2766af['substring'](_0x2766af[_0x8471('0x43')]('_')+0x1);if(_0x15deeb===_0x1b8b76){_0x38a1e8[_0x102e4e]=_0x292fbb[_0x8471('0x44')];}}});}return _0x38a1e8;}function getTicket(_0x23b0f1,_0xdddc16,_0x1b3873,_0x3aea10,_0xe93951,_0x5c999f,_0x593dac){return new Promise(function(_0x4f728f,_0x23d42a){var _0x59b212;return getAuthToken(_0xdddc16,_0x1b3873,_0x593dac)[_0x8471('0x13')](function(_0x38a29e){if(_0x5c999f[_0x8471('0x45')]==='incident'){_0x59b212={'method':_0x8471('0x46'),'uri':_0x3aea10+_0x8471('0x47'),'body':Object[_0x8471('0x48')]({},{'title':intUtil[_0x8471('0x49')](_0x5c999f['Subjects'],_0xe93951,'\x20'),'description':intUtil['getString'](_0x5c999f['Descriptions'],_0xe93951,'\x0a'),'customerid_contact@odata.bind':_0x23b0f1[_0x8471('0x39')]?_0x8471('0x4a')+_0x23b0f1['enduserId']+')':undefined,'ownerid@odata.bind':_0x8471('0x2f')+_0x23b0f1[_0x8471('0x27')]+')','caseorigincode':'1'},getCustomFields(_0x5c999f[_0x8471('0x4b')],_0xe93951,_0x5c999f[_0x8471('0x45')])),'headers':{'Authorization':_0x8471('0x30')+_0x38a29e,'OData-Version':_0x8471('0x1c')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x5c999f[_0x8471('0x45')]===_0x8471('0x4c')){var _0x1eddc1=_0x23b0f1['enduserId']?[{'partyid_systemuser@odata.bind':_0x8471('0x2f')+_0x23b0f1[_0x8471('0x27')]+')','participationtypemask':_0x23b0f1['callDirection']===_0x8471('0x4d')?0x2:0x1},{'partyid_contact@odata.bind':_0x8471('0x4a')+_0x23b0f1[_0x8471('0x39')]+')','participationtypemask':_0x23b0f1['callDirection']===_0x8471('0x4d')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0x23b0f1[_0x8471('0x27')]+')','participationtypemask':_0x23b0f1['callDirection']===_0x8471('0x4d')?0x2:0x1}];_0x59b212={'method':_0x8471('0x46'),'uri':_0x3aea10+_0x8471('0x4e'),'body':Object[_0x8471('0x48')]({},{'subject':intUtil[_0x8471('0x49')](_0x5c999f[_0x8471('0x4f')],_0xe93951,'\x20'),'phonenumber':String(_0xe93951[_0x8471('0x2d')]),'description':intUtil[_0x8471('0x49')](_0x5c999f[_0x8471('0x50')],_0xe93951,'\x0a'),'regardingobjectid_contact@odata.bind':_0x23b0f1[_0x8471('0x39')]?_0x8471('0x4a')+_0x23b0f1[_0x8471('0x39')]+')':undefined,'ownerid@odata.bind':_0x8471('0x2f')+_0x23b0f1['userId']+')','directioncode':_0x23b0f1[_0x8471('0x51')]===_0x8471('0x4d')?![]:!![],'phonecall_activity_parties':_0x1eddc1},getCustomFields(_0x5c999f[_0x8471('0x4b')],_0xe93951,_0x5c999f['ticketType'])),'headers':{'Authorization':_0x8471('0x30')+_0x38a29e,'OData-Version':_0x8471('0x1c')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x59b212);})['then'](function(_0x376db7){var _0x63e286=_0x376db7[_0x8471('0x32')][_0x8471('0x52')];var _0xa17ef2=_0x63e286[_0x8471('0x33')](_0x63e286[_0x8471('0x34')]('(')+0x1,_0x63e286[_0x8471('0x34')](')'));_0x23b0f1['ticketId']=_0xa17ef2;_0x4f728f(_0x23b0f1);})[_0x8471('0x15')](function(_0x440d5e){_0x23d42a(_0x440d5e['message']);});});}function emit(_0x2365d0,_0x761b45,_0x7b3e75,_0x5687f4){var _0x21bfa6={'uri':util[_0x8471('0x53')](_0x8471('0x54'),_0x2365d0,_0x7b3e75,_0x5687f4)};io['to'](util[_0x8471('0x53')](_0x8471('0x55'),_0x761b45))['emit']('trigger:browser:url',_0x21bfa6);}exports['cs']=function(_0x51ccbb,_0xd0222f,_0x2d1dfb,_0x4aece1,_0x3c063e,_0x4a7fed,_0x505be7,_0x39ebef){var _0x44cfd4={};_0x4a7fed[_0x8471('0x9')]=_0x4a7fed[_0x8471('0x8')]?intUtil['stripTrailingSlash'](_0x4a7fed[_0x8471('0xa')]['data7']):intUtil[_0x8471('0x56')](_0x4a7fed[_0x8471('0x9')]);_0x4a7fed[_0x8471('0x57')]=intUtil[_0x8471('0x56')](_0x4a7fed['serverUrl']);_0x44cfd4[_0x8471('0x51')]=_0x39ebef===_0x8471('0x4d')||_0x39ebef==='unmanaged'?_0x8471('0x4d'):_0x8471('0x2b');var _0x2fba62=_0x4a7fed[_0x8471('0x8')]?util[_0x8471('0x53')](_0x8471('0x58'),_0x4a7fed['CloudProvider'][_0x8471('0xb')]):util['format']('%s/api/data/v9.0/',_0x4a7fed[_0x8471('0x9')]);var _0x12b3c4=util[_0x8471('0x53')](_0x8471('0x59'),_0x4a7fed[_0x8471('0xc')]);var _0x4abe2c=util[_0x8471('0x53')](_0x8471('0x5a'),_0x4a7fed[_0x8471('0x57')],_0xd0222f[_0x8471('0x5b')],md5(_0xd0222f['uniqueid']));if(_0x3c063e&&_0x3c063e[_0x8471('0x5c')]){logger['info']('[QUEUE]',_0x8471('0x5d'));_0xd0222f['recordingURL']=_0x4abe2c;}else if(_0x505be7&&_0x505be7[_0x8471('0x5e')]&&_0x505be7['recordingFormat']!==_0x8471('0x5f')){logger['info'](_0x8471('0x60'),'Recording\x20is\x20enabled!');_0xd0222f[_0x8471('0x61')]=_0x4abe2c;}else{_0xd0222f[_0x8471('0x61')]='';}return getUser(_0x44cfd4,_0x4a7fed,_0x4aece1,_0x12b3c4,_0x2fba62,_0x39ebef)[_0x8471('0x13')](function(_0x3991ba){logger[_0x8471('0x28')]('['+_0x39ebef[_0x8471('0x17')]()+_0x8471('0x62'),_0x3991ba[_0x8471('0x27')]);logger[_0x8471('0x28')]('['+_0x39ebef[_0x8471('0x17')]()+_0x8471('0x63'),_0x3991ba['userEmail']);return getEndUser(_0x3991ba,_0x4a7fed,_0x12b3c4,_0x2fba62,_0xd0222f,_0x39ebef,_0x2d1dfb['moduleCreate'],_0x2d1dfb['additionalSearchContact']);})[_0x8471('0x13')](function(_0x2afc6c){logger[_0x8471('0x28')]('['+_0x39ebef[_0x8471('0x17')]()+_0x8471('0x64'),_0x2afc6c[_0x8471('0x39')]);logger[_0x8471('0x28')]('['+_0x39ebef[_0x8471('0x17')]()+']\x20The\x20Enduser\x20phone\x20is:',_0xd0222f[_0x8471('0x2d')]);return getTicket(_0x2afc6c,_0x4a7fed,_0x12b3c4,_0x2fba62,_0xd0222f,_0x2d1dfb,_0x39ebef);})['then'](function(_0x190e28){logger['info'](util[_0x8471('0x53')]('['+_0x39ebef[_0x8471('0x17')]()+_0x8471('0x65'),_0x2d1dfb[_0x8471('0x45')],_0x190e28['ticketId']));logger[_0x8471('0x28')](util[_0x8471('0x53')]('['+_0x39ebef[_0x8471('0x17')]()+']\x20Call\x20direction:\x20%s',_0x39ebef));if(_0x39ebef!=='unmanaged'&&_0x2d1dfb[_0x8471('0x66')]){logger['info']('['+_0x39ebef['toUpperCase']()+']',_0x8471('0x67'));emit(_0x4a7fed[_0x8471('0x9')],_0x4aece1[_0x8471('0x68')],_0x2d1dfb[_0x8471('0x45')],_0x190e28[_0x8471('0x69')]);}})[_0x8471('0x15')](function(_0x367ec6){logger[_0x8471('0x16')]('['+_0x39ebef[_0x8471('0x17')]()+_0x8471('0x6a'),_0x367ec6[_0x8471('0x19')]);console[_0x8471('0x16')]('Error\x20running\x20Dynamics365\x20integration',_0x367ec6);});}; \ No newline at end of file +var _0x6370=['queue','callDirection','phonecalls','assign','ticketId','format','emit','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','util','./util','md5','../../../../config/logger','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','CloudProvider','data7','tenantId','data2','resolve','data5','POST','clientId','remoteUri','username','password','clientSecret','then','access_token','catch','error',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','userEmail','length','email','isdisabled','info','toUpperCase',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','internalemailaddress','toLowerCase','outbound','destcalleridnum','contacts','body','headers','odata-entityid','substring','lastIndexOf','enduserId','calleridnum','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','%2b','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','forEach','includes','string','picklist','type','nameField','indexOf','content','ticketType','incident','incidents','Subjects','getString','Descriptions','/contacts(','/systemusers(','Fields','phonecall'];(function(_0x103561,_0xe85fdf){var _0x50223e=function(_0x89e159){while(--_0x89e159){_0x103561['push'](_0x103561['shift']());}};_0x50223e(++_0xe85fdf);}(_0x6370,0xfa));var _0x0637=function(_0x118733,_0x2bd820){_0x118733=_0x118733-0x0;var _0x4777af=_0x6370[_0x118733];return _0x4777af;};'use strict';var _=require(_0x0637('0x0'));var rp=require('request-promise');var util=require(_0x0637('0x1'));var intUtil=require(_0x0637('0x2'));var md5=require(_0x0637('0x3'));var Redis=require('ioredis');var logger=require(_0x0637('0x4'))('dynamics365');var config=require(_0x0637('0x5'));config[_0x0637('0x6')]=_[_0x0637('0x7')](config[_0x0637('0x6')],{'host':_0x0637('0x8'),'port':0x18eb});var io=require(_0x0637('0x9'))(new Redis(config['redis']));function getAuthToken(_0xafe166,_0x5bfccf,_0x2a3180){if(_0xafe166['modernAuthentication']){_0xafe166['remoteUri']=_0xafe166[_0x0637('0xa')][_0x0637('0xb')];_0xafe166[_0x0637('0xc')]=_0xafe166[_0x0637('0xa')][_0x0637('0xd')];return Promise[_0x0637('0xe')](_0xafe166[_0x0637('0xa')][_0x0637('0xf')]);}var _0x4f785a={'method':_0x0637('0x10'),'uri':_0x5bfccf,'form':{'client_id':_0xafe166[_0x0637('0x11')],'resource':_0xafe166[_0x0637('0x12')],'username':_0xafe166[_0x0637('0x13')],'password':_0xafe166[_0x0637('0x14')],'grant_type':'password','client_secret':_0xafe166[_0x0637('0x15')]},'json':!![]};return rp(_0x4f785a)[_0x0637('0x16')](function(_0xcaa4c9){return _0xcaa4c9[_0x0637('0x17')];})[_0x0637('0x18')](function(_0x917226){logger[_0x0637('0x19')]('['+[_0x2a3180['toUpperCase']()]+_0x0637('0x1a'));return _0x917226[_0x0637('0x1b')];});}function getUser(_0x2fa82e,_0x3d8dfd,_0x2761a2,_0x2038e1,_0x153a4a,_0x21dcc1){return new Promise(function(_0x194d24,_0x46d021){return getAuthToken(_0x3d8dfd,_0x2038e1,_0x21dcc1)['then'](function(_0x2e18ab){var _0x297f47={'method':_0x0637('0x1c'),'uri':_0x153a4a+_0x0637('0x1d'),'headers':{'Authorization':_0x0637('0x1e')+_0x2e18ab,'OData-Version':_0x0637('0x1f')},'json':!![]};return rp(_0x297f47);})[_0x0637('0x16')](function(_0x1d2f6e){var _0x143bd6=_0x1d2f6e[_0x0637('0x20')];var _0x6b11e3=![];var _0x1dd925=null;if(!_[_0x0637('0x21')](_0x2761a2)){if(intUtil[_0x0637('0x22')](_0x2761a2['email'])){_0x2fa82e[_0x0637('0x23')]=_0x2761a2['email'];for(_0x1dd925=0x0;_0x1dd925<_0x143bd6[_0x0637('0x24')];_0x1dd925++){if(_0x143bd6[_0x1dd925]['internalemailaddress']===_0x2761a2[_0x0637('0x25')]&&!_0x143bd6[_0x1dd925][_0x0637('0x26')]){_0x6b11e3=!![];logger[_0x0637('0x27')]('['+[_0x21dcc1[_0x0637('0x28')]()]+_0x0637('0x29')+_0x143bd6[_0x1dd925][_0x0637('0x2a')]+'!');_0x2fa82e[_0x0637('0x2b')]=_0x143bd6[_0x1dd925][_0x0637('0x2a')];}}}}if(!_0x6b11e3){logger[_0x0637('0x27')]('['+[_0x21dcc1[_0x0637('0x28')]()]+_0x0637('0x2c'));_0x2fa82e[_0x0637('0x23')]=_0x3d8dfd[_0x0637('0x13')];for(_0x1dd925=0x0;_0x1dd925<_0x143bd6[_0x0637('0x24')];_0x1dd925++){if(_0x143bd6[_0x1dd925][_0x0637('0x2d')]===_0x3d8dfd['username']){_0x2fa82e[_0x0637('0x2b')]=_0x143bd6[_0x1dd925][_0x0637('0x2a')];}}}_0x194d24(_0x2fa82e);})['catch'](function(_0x2f1884){_0x46d021(_0x2f1884[_0x0637('0x1b')]);});});}function createEndUser(_0x1c99cf,_0x56f8a0,_0x398061,_0x30a4f3,_0xc711d,_0x491569,_0x1f2b3b){return new Promise(function(_0x3eb509,_0x306f61){return getAuthToken(_0x56f8a0,_0x398061,_0x491569)[_0x0637('0x16')](function(_0x433148){var _0x505140=_0x491569[_0x0637('0x2e')]()===_0x0637('0x2f')?_0xc711d[_0x0637('0x30')]:_0xc711d['calleridnum'];var _0x3e3fd1={'method':'POST','uri':_0x30a4f3+_0x0637('0x31'),'body':{'fullname':_0x505140,'firstname':_0x505140,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x1c99cf['userId']+')'},'headers':{'Authorization':_0x0637('0x1e')+_0x433148,'OData-Version':_0x0637('0x1f')},'json':!![],'resolveWithFullResponse':!![]};_0x3e3fd1[_0x0637('0x32')][_0x1f2b3b]=_0x505140;return rp(_0x3e3fd1);})[_0x0637('0x16')](function(_0x30bb98){var _0x3ed9c3=_0x30bb98[_0x0637('0x33')][_0x0637('0x34')];var _0x532388=_0x3ed9c3[_0x0637('0x35')](_0x3ed9c3['lastIndexOf']('(')+0x1,_0x3ed9c3[_0x0637('0x36')](')'));_0x1c99cf[_0x0637('0x37')]=_0x532388;_0x3eb509(_0x1c99cf);})[_0x0637('0x18')](function(_0x220e34){_0x306f61(_0x220e34[_0x0637('0x1b')]);});});}function getEndUser(_0x4bdd40,_0xd0fa18,_0x21365d,_0x15a48c,_0x3c391e,_0x5ae70e,_0x2f43ee,_0x4de06b){var _0x411c02=_0x5ae70e[_0x0637('0x2e')]()===_0x0637('0x2f')?_0x3c391e[_0x0637('0x30')]:_0x3c391e[_0x0637('0x38')];return getAuthToken(_0xd0fa18,_0x21365d,_0x5ae70e)[_0x0637('0x16')](function(_0x538f66){_0x4de06b=_0x4de06b?_0x4de06b:_0x0637('0x39');var _0x2eee59={'method':'GET','uri':_0x15a48c+_0x0637('0x3a')+_0x4de06b+_0x0637('0x3b')+_0x4de06b+_0x0637('0x3c')+_0x411c02[_0x0637('0x3d')]('+',_0x0637('0x3e'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x538f66,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2eee59);})[_0x0637('0x16')](function(_0x5ae932){var _0x580e8f=![];if(!_0x5ae932)return _0x580e8f;var _0x5af252=_0x5ae932[_0x0637('0x20')];for(var _0x83f06f=0x0;_0x83f06f<_0x5af252[_0x0637('0x24')];_0x83f06f++){if(_0x5af252[_0x83f06f][_0x4de06b]===_0x411c02){_0x580e8f=!![];_0x4bdd40[_0x0637('0x37')]=_0x5af252[_0x83f06f]['contactid'];}}return _0x580e8f;})['then'](function(_0x49bb36){if(_0x49bb36)return _0x4bdd40;if(_0x2f43ee===_0x0637('0x3f')){logger[_0x0637('0x27')]('['+[_0x5ae70e[_0x0637('0x28')]()]+_0x0637('0x40'));return _0x4bdd40;}return createEndUser(_0x4bdd40,_0xd0fa18,_0x21365d,_0x15a48c,_0x3c391e,_0x5ae70e,_0x4de06b)['then'](function(_0x3854d9){logger[_0x0637('0x27')]('['+[_0x5ae70e['toUpperCase']()]+']\x20Enduser\x20created!',_0x3854d9[_0x0637('0x37')]);return _0x3854d9;});});}function getCustomFields(_0x4e6f5e,_0x5d3bb5,_0x2b0b07){var _0x13e075={};if(_0x4e6f5e[_0x0637('0x24')]>0x0){_[_0x0637('0x41')](_0x4e6f5e,function(_0xc254d9){if(_[_0x0637('0x42')]([_0x0637('0x43'),_0x0637('0x44')],_0xc254d9[_0x0637('0x45')])&&_0xc254d9[_0x0637('0x46')]&&!_0xc254d9['customField']){var _0x2b3f66=_0xc254d9['idField'][_0x0637('0x2e')]();var _0x2a916d=_0x2b3f66['substring'](0x0,_0x2b3f66['indexOf']('_'));var _0x1a159a=_0x2b3f66[_0x0637('0x35')](_0x2b3f66[_0x0637('0x47')]('_')+0x1);if(_0x2a916d===_0x2b0b07){_0x13e075[_0x1a159a]=_0xc254d9[_0x0637('0x48')];}}});}return _0x13e075;}function getTicket(_0x7117b3,_0x518519,_0x40a27d,_0x8ae933,_0x2ddcff,_0x5e2ecb,_0x35335a){return new Promise(function(_0x468ff2,_0x24d689){var _0x4900cc;return getAuthToken(_0x518519,_0x40a27d,_0x35335a)[_0x0637('0x16')](function(_0x5708ab){if(_0x5e2ecb[_0x0637('0x49')]===_0x0637('0x4a')){_0x4900cc={'method':_0x0637('0x10'),'uri':_0x8ae933+_0x0637('0x4b'),'body':Object['assign']({},{'title':intUtil['getString'](_0x5e2ecb[_0x0637('0x4c')],_0x2ddcff,'\x20'),'description':intUtil[_0x0637('0x4d')](_0x5e2ecb[_0x0637('0x4e')],_0x2ddcff,'\x0a'),'customerid_contact@odata.bind':_0x7117b3[_0x0637('0x37')]?_0x0637('0x4f')+_0x7117b3[_0x0637('0x37')]+')':undefined,'ownerid@odata.bind':_0x0637('0x50')+_0x7117b3[_0x0637('0x2b')]+')','caseorigincode':'1'},getCustomFields(_0x5e2ecb[_0x0637('0x51')],_0x2ddcff,_0x5e2ecb[_0x0637('0x49')])),'headers':{'Authorization':_0x0637('0x1e')+_0x5708ab,'OData-Version':_0x0637('0x1f')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x5e2ecb[_0x0637('0x49')]===_0x0637('0x52')){var _0x39fb31=_0x7117b3['enduserId']?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x7117b3['userId']+')','participationtypemask':_0x7117b3['callDirection']===_0x0637('0x53')?0x2:0x1},{'partyid_contact@odata.bind':_0x0637('0x4f')+_0x7117b3[_0x0637('0x37')]+')','participationtypemask':_0x7117b3['callDirection']==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x0637('0x50')+_0x7117b3[_0x0637('0x2b')]+')','participationtypemask':_0x7117b3[_0x0637('0x54')]==='queue'?0x2:0x1}];_0x4900cc={'method':'POST','uri':_0x8ae933+_0x0637('0x55'),'body':Object[_0x0637('0x56')]({},{'subject':intUtil[_0x0637('0x4d')](_0x5e2ecb[_0x0637('0x4c')],_0x2ddcff,'\x20'),'phonenumber':String(_0x2ddcff[_0x0637('0x38')]),'description':intUtil['getString'](_0x5e2ecb[_0x0637('0x4e')],_0x2ddcff,'\x0a'),'regardingobjectid_contact@odata.bind':_0x7117b3[_0x0637('0x37')]?'/contacts('+_0x7117b3[_0x0637('0x37')]+')':undefined,'ownerid@odata.bind':_0x0637('0x50')+_0x7117b3[_0x0637('0x2b')]+')','directioncode':_0x7117b3['callDirection']===_0x0637('0x53')?![]:!![],'phonecall_activity_parties':_0x39fb31},getCustomFields(_0x5e2ecb[_0x0637('0x51')],_0x2ddcff,_0x5e2ecb[_0x0637('0x49')])),'headers':{'Authorization':_0x0637('0x1e')+_0x5708ab,'OData-Version':_0x0637('0x1f')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x4900cc);})['then'](function(_0x441da){var _0x930464=_0x441da[_0x0637('0x33')][_0x0637('0x34')];var _0xf3068f=_0x930464[_0x0637('0x35')](_0x930464[_0x0637('0x36')]('(')+0x1,_0x930464[_0x0637('0x36')](')'));_0x7117b3[_0x0637('0x57')]=_0xf3068f;_0x468ff2(_0x7117b3);})['catch'](function(_0x2ee915){_0x24d689(_0x2ee915[_0x0637('0x1b')]);});});}function emit(_0x51843c,_0x54bb42,_0x208de2,_0x58cf4b){var _0x4a9f67={'uri':util[_0x0637('0x58')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x51843c,_0x208de2,_0x58cf4b)};io['to'](util[_0x0637('0x58')]('user:%s',_0x54bb42))[_0x0637('0x59')]('trigger:browser:url',_0x4a9f67);}exports['cs']=function(_0x486ca2,_0x140076,_0x16dcea,_0x480069,_0x3b9bb1,_0x88bb6b,_0x1e2d8a,_0xea4647){var _0x57746e={};_0x88bb6b[_0x0637('0x12')]=_0x88bb6b['modernAuthentication']?intUtil[_0x0637('0x5a')](_0x88bb6b[_0x0637('0xa')][_0x0637('0xb')]):intUtil[_0x0637('0x5a')](_0x88bb6b[_0x0637('0x12')]);_0x88bb6b[_0x0637('0x5b')]=intUtil[_0x0637('0x5a')](_0x88bb6b[_0x0637('0x5b')]);_0x57746e[_0x0637('0x54')]=_0xea4647===_0x0637('0x53')||_0xea4647===_0x0637('0x5c')?_0x0637('0x53'):_0x0637('0x2f');var _0x24abf1=_0x88bb6b['modernAuthentication']?util[_0x0637('0x58')](_0x0637('0x5d'),_0x88bb6b[_0x0637('0xa')][_0x0637('0xb')]):util[_0x0637('0x58')](_0x0637('0x5d'),_0x88bb6b[_0x0637('0x12')]);var _0x4047bb=util[_0x0637('0x58')](_0x0637('0x5e'),_0x88bb6b['tenantId']);var _0x54b15d=util[_0x0637('0x58')](_0x0637('0x5f'),_0x88bb6b[_0x0637('0x5b')],_0x140076[_0x0637('0x60')],md5(_0x140076[_0x0637('0x60')]));if(_0x3b9bb1&&_0x3b9bb1['monitor_format']){logger[_0x0637('0x27')](_0x0637('0x61'),_0x0637('0x62'));_0x140076[_0x0637('0x63')]=_0x54b15d;}else if(_0x1e2d8a&&_0x1e2d8a[_0x0637('0x64')]&&_0x1e2d8a['recordingFormat']!=='none'){logger[_0x0637('0x27')](_0x0637('0x65'),_0x0637('0x62'));_0x140076[_0x0637('0x63')]=_0x54b15d;}else{_0x140076[_0x0637('0x63')]='';}return getUser(_0x57746e,_0x88bb6b,_0x480069,_0x4047bb,_0x24abf1,_0xea4647)[_0x0637('0x16')](function(_0x4312da){logger[_0x0637('0x27')]('['+_0xea4647[_0x0637('0x28')]()+_0x0637('0x66'),_0x4312da[_0x0637('0x2b')]);logger[_0x0637('0x27')]('['+_0xea4647[_0x0637('0x28')]()+_0x0637('0x67'),_0x4312da[_0x0637('0x23')]);return getEndUser(_0x4312da,_0x88bb6b,_0x4047bb,_0x24abf1,_0x140076,_0xea4647,_0x16dcea[_0x0637('0x68')],_0x16dcea[_0x0637('0x69')]);})['then'](function(_0x254fa6){logger[_0x0637('0x27')]('['+_0xea4647[_0x0637('0x28')]()+_0x0637('0x6a'),_0x254fa6[_0x0637('0x37')]);logger[_0x0637('0x27')]('['+_0xea4647[_0x0637('0x28')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x140076[_0x0637('0x38')]);return getTicket(_0x254fa6,_0x88bb6b,_0x4047bb,_0x24abf1,_0x140076,_0x16dcea,_0xea4647);})[_0x0637('0x16')](function(_0x1960bc){logger[_0x0637('0x27')](util[_0x0637('0x58')]('['+_0xea4647['toUpperCase']()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x16dcea[_0x0637('0x49')],_0x1960bc[_0x0637('0x57')]));logger[_0x0637('0x27')](util[_0x0637('0x58')]('['+_0xea4647[_0x0637('0x28')]()+_0x0637('0x6b'),_0xea4647));if(_0xea4647!==_0x0637('0x5c')&&_0x16dcea['openNewTab']){logger['info']('['+_0xea4647['toUpperCase']()+']',_0x0637('0x6c'));emit(_0x88bb6b[_0x0637('0x12')],_0x480069[_0x0637('0x6d')],_0x16dcea[_0x0637('0x49')],_0x1960bc[_0x0637('0x57')]);}})['catch'](function(_0x4ca114){logger[_0x0637('0x19')]('['+_0xea4647[_0x0637('0x28')]()+_0x0637('0x6e'),_0x4ca114[_0x0637('0x1b')]);console[_0x0637('0x19')]('Error\x20running\x20Dynamics365\x20integration',_0x4ca114);});}; \ 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 e9f9349..28be551 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 _0xe6d8=['mapValues','keyBy','custom_fields','%s/api/v2/tickets','then','Ticket\x20created!','remoteUri','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','length','Enduser\x20found!','%s/api/v2/contacts','POST','Enduser\x20created.','apiKey','toString','[HTTP]','GET','map','forEach','includes','string','picklist','nameField','toLowerCase','content','type','idField','variable','variableName','customField','Variable','name','push','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','calleridnum','The\x20Enduser\x20ID\x20is:','trigger:browser:url','%s/helpdesk/tickets/%d','error','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','stringify','unmanaged','The\x20Ticket\x20ID\x20is:','lastevent','lodash','request-promise','util','ioredis','./util','../../../../config/logger','freshdesk','defaults','socket.io-emitter','redis','application/json','emit','info','merge','format','Caller\x20-\x20%s','calleridname','Subjects','getString','Descriptions','
','Tags','Fields'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe6d8,0x1ba));var _0x8e6d=function(_0x492954,_0x40707c){_0x492954=_0x492954-0x0;var _0x40c5b3=_0xe6d8[_0x492954];return _0x40c5b3;};'use strict';var _=require(_0x8e6d('0x0'));var rp=require(_0x8e6d('0x1'));var md5=require('md5');var util=require(_0x8e6d('0x2'));var Redis=require(_0x8e6d('0x3'));var intUtil=require(_0x8e6d('0x4'));var config=require('../../../../config/environment');var logger=require(_0x8e6d('0x5'))(_0x8e6d('0x6'));config['redis']=_[_0x8e6d('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x8e6d('0x8'))(new Redis(config[_0x8e6d('0x9')]));var headers={'Content-Type':_0x8e6d('0xa'),'Accept':_0x8e6d('0xa')};function emit(_0x3c81ee,_0x3a31eb,_0x5c2e32){io['to'](_0x3c81ee)[_0x8e6d('0xb')](_0x3a31eb,_0x5c2e32);}function getTicket(_0x975ecd,_0x1532f0,_0x71653d,_0x200fcf,_0x3c80ea){logger[_0x8e6d('0xc')]('Creating\x20new\x20ticket...');var _0x2d98f4=_[_0x8e6d('0xd')]({'responder_id':_0x1532f0['id'],'requester_id':_0x71653d['id'],'name':util[_0x8e6d('0xe')](_0x8e6d('0xf'),_0x3c80ea[_0x8e6d('0x10')]),'phone':_0x3c80ea['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x200fcf[_0x8e6d('0x11')],_0x3c80ea,'\x20'),'description':intUtil[_0x8e6d('0x12')](_0x200fcf[_0x8e6d('0x13')],_0x3c80ea,_0x8e6d('0x14')),'tags':getTags(_0x200fcf[_0x8e6d('0x15')],'name')},getCustomFields(_0x200fcf[_0x8e6d('0x16')],_0x3c80ea));_0x2d98f4['custom_fields']=_[_0x8e6d('0x17')](_[_0x8e6d('0x18')](_0x2d98f4[_0x8e6d('0x19')],'id'),'value');return request({'uri':util['format'](_0x8e6d('0x1a'),_0x975ecd['remoteUri']),'method':'POST','body':_0x2d98f4})[_0x8e6d('0x1b')](function(_0x1ba980){logger['info'](_0x8e6d('0x1c'));return _0x1ba980;});}function getUser(_0x42e87b,_0x31cb36){if(intUtil['validateEmail'](_0x31cb36)){return request({'uri':util[_0x8e6d('0xe')]('%s/api/v2/agents',_0x42e87b[_0x8e6d('0x1d')]),'qs':{'email':_0x31cb36}})['then'](function(_0x2abb3f){if(_0x2abb3f['length']){logger[_0x8e6d('0xc')](_0x8e6d('0x1e'));return _[_0x8e6d('0x1f')](_0x2abb3f,function(_0x2abfeb){return _0x2abfeb[_0x8e6d('0x20')][_0x8e6d('0x21')]===_0x31cb36;});}else{logger[_0x8e6d('0xc')](_0x8e6d('0x22'));return request({'uri':util[_0x8e6d('0xe')](_0x8e6d('0x23'),_0x42e87b['remoteUri'])})[_0x8e6d('0x1b')](function(_0x3f9b07){logger['info'](_0x8e6d('0x24'));return _0x3f9b07;});}});}else{logger['info'](_0x8e6d('0x25'));return request({'uri':util['format'](_0x8e6d('0x23'),_0x42e87b[_0x8e6d('0x1d')])})['then'](function(_0x825e2e){logger[_0x8e6d('0xc')](_0x8e6d('0x24'));return _0x825e2e;});}}function getEndUser(_0x279550,_0x1bb583,_0x572644){logger[_0x8e6d('0xc')](_0x8e6d('0x26'),_0x572644);return request({'uri':util[_0x8e6d('0xe')]('%s/api/v2/contacts',_0x279550[_0x8e6d('0x1d')]),'qs':{'phone':_0x572644}})['then'](function(_0x510493){if(_0x510493[_0x8e6d('0x27')]){logger['info'](_0x8e6d('0x28'));return _['find'](_0x510493,{'phone':_0x572644});}else{logger[_0x8e6d('0xc')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x8e6d('0xe')](_0x8e6d('0x29'),_0x279550[_0x8e6d('0x1d')]),'method':_0x8e6d('0x2a'),'body':{'name':_0x1bb583,'phone':_0x572644}})[_0x8e6d('0x1b')](function(_0x6e9c13){logger[_0x8e6d('0xc')](_0x8e6d('0x2b'));return _0x6e9c13;});}});}function getAuth(_0x42bef8){return util[_0x8e6d('0xe')]('Basic\x20%s',new Buffer(_0x42bef8[_0x8e6d('0x2c')]+':X')[_0x8e6d('0x2d')]('base64'));}function request(_0x3b53ce){logger['debug'](_0x8e6d('0x2e'),JSON['stringify'](_0x3b53ce));return rp(_[_0x8e6d('0x7')](_0x3b53ce,{'method':_0x8e6d('0x2f'),'headers':headers,'json':!![]}));}function getTags(_0x5d14d8,_0x131f95){var _0x156412=[];if(_0x5d14d8&&_0x5d14d8[_0x8e6d('0x27')]>0x0){_0x156412=_[_0x8e6d('0x30')](_0x5d14d8,_0x131f95);}return _0x156412;}function getCustomFields(_0x1a810e,_0x4e919c){var _0x10f874=[];var _0xfc6a55={'custom_fields':[]};if(_0x1a810e[_0x8e6d('0x27')]>0x0){_[_0x8e6d('0x31')](_0x1a810e,function(_0x13e435){if(_[_0x8e6d('0x32')]([_0x8e6d('0x33'),_0x8e6d('0x34')],_0x13e435['type'])&&_0x13e435[_0x8e6d('0x35')]&&!_0x13e435['customField']){_0xfc6a55[_0x13e435['nameField'][_0x8e6d('0x36')]()]=_0x13e435[_0x8e6d('0x37')][_0x8e6d('0x2d')]();}else if(_[_0x8e6d('0x32')]([_0x8e6d('0x33'),_0x8e6d('0x34')],_0x13e435[_0x8e6d('0x38')])&&_0x13e435[_0x8e6d('0x39')]&&_0x13e435['customField']){_0xfc6a55[_0x8e6d('0x19')]['push']({'id':_0x13e435['idField'],'value':_0x13e435[_0x8e6d('0x37')][_0x8e6d('0x2d')]()});}else if(_0x13e435[_0x8e6d('0x38')]===_0x8e6d('0x3a')&&_0x13e435[_0x8e6d('0x3b')]&&_0x13e435[_0x8e6d('0x39')]&&_0x13e435[_0x8e6d('0x3c')]){_0x4e919c[_0x13e435['variableName']]&&_0xfc6a55[_0x8e6d('0x19')]['push']({'id':_0x13e435['idField'],'value':_0x4e919c[_0x13e435[_0x8e6d('0x3b')]][_0x8e6d('0x2d')]()});}else if(_0x13e435[_0x8e6d('0x38')]==='customVariable'&&_0x13e435['Variable']&&_0x13e435[_0x8e6d('0x3d')][_0x8e6d('0x3e')]&&_0x13e435['idField']&&_0x13e435[_0x8e6d('0x3c')]){_0x4e919c[_0x13e435['Variable'][_0x8e6d('0x3e')][_0x8e6d('0x36')]()]&&_0xfc6a55[_0x8e6d('0x19')][_0x8e6d('0x3f')]({'id':_0x13e435[_0x8e6d('0x39')],'value':_0x4e919c[_0x13e435[_0x8e6d('0x3d')][_0x8e6d('0x3e')]['toLowerCase']()][_0x8e6d('0x2d')]()});}});}return _0xfc6a55;}exports[_0x8e6d('0x40')]=function(_0x1164a2,_0x5ba82e,_0x1e930d,_0x50e2a9,_0x3951f0,_0xa8f490){var _0x22c513,_0x1ec4aa;_0xa8f490[_0x8e6d('0x1d')]=intUtil[_0x8e6d('0x41')](_0xa8f490['remoteUri']);_0xa8f490[_0x8e6d('0x42')]=intUtil['stripTrailingSlash'](_0xa8f490[_0x8e6d('0x42')]);if(_0x3951f0&&_0x3951f0[_0x8e6d('0x43')]){logger[_0x8e6d('0xc')](_0x8e6d('0x44'),_0x8e6d('0x45'));_0x5ba82e[_0x8e6d('0x46')]=util[_0x8e6d('0xe')](_0x8e6d('0x47'),_0xa8f490[_0x8e6d('0x42')],_0x5ba82e[_0x8e6d('0x48')],md5(_0x5ba82e[_0x8e6d('0x48')]));}else{_0x5ba82e['recordingURL']='';}headers[_0x8e6d('0x49')]=getAuth(_0xa8f490);return getUser(_0xa8f490,_0x50e2a9[_0x8e6d('0x21')])[_0x8e6d('0x1b')](function(_0x4c42d7){_0x22c513=_0x4c42d7;logger['info']('The\x20User\x20ID\x20is:',_0x22c513['id']);return getEndUser(_0xa8f490,_0x5ba82e[_0x8e6d('0x10')],_0x5ba82e[_0x8e6d('0x4a')]);})['then'](function(_0x21cf54){_0x1ec4aa=_0x21cf54;logger[_0x8e6d('0xc')](_0x8e6d('0x4b'),_0x1ec4aa['id']);return getTicket(_0xa8f490,_0x22c513,_0x1ec4aa,_0x1e930d,_0x5ba82e);})[_0x8e6d('0x1b')](function(_0x2c48f5){if(_0x2c48f5&&_0x2c48f5['id']){logger[_0x8e6d('0xc')]('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x2c48f5['id']);logger['info'](_0x8e6d('0x44'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x8e6d('0xe')]('user:%s',_0x50e2a9[_0x8e6d('0x3e')]),_0x8e6d('0x4c'),{'uri':util[_0x8e6d('0xe')](_0x8e6d('0x4d'),_0xa8f490[_0x8e6d('0x1d')],_0x2c48f5['id'])});}})['catch'](function(_0x14d458){logger[_0x8e6d('0x4e')](_0x8e6d('0x44'),JSON['stringify'](_0x14d458));});};exports[_0x8e6d('0x4f')]=function(_0x22017c,_0x50ad9b,_0x4fd89e,_0x38e2b8,_0x4678c6,_0xe58d24,_0x37342b){var _0x28c9e3,_0x1e0a59;_0xe58d24[_0x8e6d('0x1d')]=intUtil['stripTrailingSlash'](_0xe58d24[_0x8e6d('0x1d')]);_0xe58d24[_0x8e6d('0x42')]=intUtil[_0x8e6d('0x41')](_0xe58d24[_0x8e6d('0x42')]);if(_0x37342b&&_0x37342b[_0x8e6d('0x50')]&&_0x37342b[_0x8e6d('0x50')]!==_0x8e6d('0x51')){logger[_0x8e6d('0xc')](_0x8e6d('0x52'),_0x8e6d('0x45'));_0x50ad9b[_0x8e6d('0x46')]=util[_0x8e6d('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xe58d24[_0x8e6d('0x42')],_0x50ad9b['uniqueid'],md5(_0x50ad9b['uniqueid']));}headers[_0x8e6d('0x49')]=getAuth(_0xe58d24);return getUser(_0xe58d24,_0x38e2b8[_0x8e6d('0x21')])['then'](function(_0xecade1){_0x28c9e3=_0xecade1;logger[_0x8e6d('0xc')](_0x8e6d('0x53'),_0x28c9e3['id']);return getEndUser(_0xe58d24,_0x50ad9b[_0x8e6d('0x54')],_0x50ad9b[_0x8e6d('0x55')]);})[_0x8e6d('0x1b')](function(_0x1688bc){_0x1e0a59=_0x1688bc;logger['info'](_0x8e6d('0x4b'),_0x1e0a59['id']);return getTicket(_0xe58d24,_0x28c9e3,_0x1e0a59,_0x4fd89e,_0x50ad9b);})[_0x8e6d('0x1b')](function(_0x2d573a){if(_0x2d573a&&_0x2d573a['id']){logger[_0x8e6d('0xc')](_0x8e6d('0x1c'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x2d573a['id']);logger['info'](_0x8e6d('0x52'),_0x8e6d('0x56'));emit(util[_0x8e6d('0xe')](_0x8e6d('0x57'),_0x38e2b8[_0x8e6d('0x3e')]),_0x8e6d('0x4c'),{'uri':util['format'](_0x8e6d('0x4d'),_0xe58d24[_0x8e6d('0x1d')],_0x2d573a['id'])});}})[_0x8e6d('0x58')](function(_0xc00a5d){logger['error'](_0x8e6d('0x52'),JSON[_0x8e6d('0x59')](_0xc00a5d));});};exports[_0x8e6d('0x5a')]=function(_0x4da47f,_0x12bf4f,_0x1a2afe,_0x2a7bcc,_0x1fc827,_0x5d40d6){var _0x3e2f90,_0x227eea;_0x5d40d6[_0x8e6d('0x1d')]=intUtil[_0x8e6d('0x41')](_0x5d40d6[_0x8e6d('0x1d')]);_0x5d40d6['serverUrl']=intUtil['stripTrailingSlash'](_0x5d40d6[_0x8e6d('0x42')]);if(_0x1fc827&&_0x1fc827[_0x8e6d('0x43')]){logger[_0x8e6d('0xc')]('['+_0x12bf4f['lastevent']['toUpperCase']()+']',_0x8e6d('0x45'));_0x12bf4f[_0x8e6d('0x46')]=util[_0x8e6d('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5d40d6['serverUrl'],_0x12bf4f['uniqueid'],md5(_0x12bf4f['uniqueid']));}else{_0x12bf4f[_0x8e6d('0x46')]='';}headers[_0x8e6d('0x49')]=getAuth(_0x5d40d6);return getUser(_0x5d40d6,'')['then'](function(_0x5631a9){_0x3e2f90=_0x5631a9;logger[_0x8e6d('0xc')](_0x8e6d('0x53'),_0x3e2f90['id']);return getEndUser(_0x5d40d6,_0x12bf4f['calleridname'],_0x12bf4f['calleridnum']);})[_0x8e6d('0x1b')](function(_0x2ae2f1){_0x227eea=_0x2ae2f1;logger[_0x8e6d('0xc')](_0x8e6d('0x4b'),_0x227eea['id']);return getTicket(_0x5d40d6,_0x3e2f90,_0x227eea,_0x1a2afe,_0x12bf4f);})['then'](function(_0x1114ca){if(_0x1114ca){logger['info']('Ticket\x20created!');logger['info'](_0x8e6d('0x5b'),_0x1114ca['id']);}})[_0x8e6d('0x58')](function(_0x3ec9c8){logger[_0x8e6d('0x4e')]('['+_0x12bf4f[_0x8e6d('0x5c')]['toUpperCase']()+']',JSON[_0x8e6d('0x59')](_0x3ec9c8));});}; \ No newline at end of file +var _0x6dad=['Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','toString','base64','debug','GET','map','includes','string','picklist','type','nameField','customField','toLowerCase','content','push','idField','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','stringify','outbound','none','[OUTBOUND]','destcalleridname','%s/helpdesk/tickets/%d','error','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','freshdesk','redis','defaults','localhost','application/json','emit','info','Caller\x20-\x20%s','calleridname','calleridnum','Subjects','getString','Descriptions','
','name','mapValues','keyBy','custom_fields','value','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','format','length','Agent\x20found!','find','contact','email','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!'];(function(_0x45ae58,_0x1e7127){var _0x325111=function(_0x386dca){while(--_0x386dca){_0x45ae58['push'](_0x45ae58['shift']());}};_0x325111(++_0x1e7127);}(_0x6dad,0x19f));var _0xd6da=function(_0x130f40,_0x395bdf){_0x130f40=_0x130f40-0x0;var _0x27428a=_0x6dad[_0x130f40];return _0x27428a;};'use strict';var _=require(_0xd6da('0x0'));var rp=require(_0xd6da('0x1'));var md5=require(_0xd6da('0x2'));var util=require(_0xd6da('0x3'));var Redis=require(_0xd6da('0x4'));var intUtil=require(_0xd6da('0x5'));var config=require(_0xd6da('0x6'));var logger=require('../../../../config/logger')(_0xd6da('0x7'));config[_0xd6da('0x8')]=_[_0xd6da('0x9')](config[_0xd6da('0x8')],{'host':_0xd6da('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd6da('0x8')]));var headers={'Content-Type':_0xd6da('0xb'),'Accept':_0xd6da('0xb')};function emit(_0x5d0efe,_0x44ba4d,_0xa7eb8d){io['to'](_0x5d0efe)[_0xd6da('0xc')](_0x44ba4d,_0xa7eb8d);}function getTicket(_0x1c4809,_0x386cc1,_0x5452d3,_0x4f0c65,_0x2a2760){logger[_0xd6da('0xd')]('Creating\x20new\x20ticket...');var _0x379fd7=_['merge']({'responder_id':_0x386cc1['id'],'requester_id':_0x5452d3['id'],'name':util['format'](_0xd6da('0xe'),_0x2a2760[_0xd6da('0xf')]),'phone':_0x2a2760[_0xd6da('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x4f0c65[_0xd6da('0x11')],_0x2a2760,'\x20'),'description':intUtil[_0xd6da('0x12')](_0x4f0c65[_0xd6da('0x13')],_0x2a2760,_0xd6da('0x14')),'tags':getTags(_0x4f0c65['Tags'],_0xd6da('0x15'))},getCustomFields(_0x4f0c65['Fields'],_0x2a2760));_0x379fd7['custom_fields']=_[_0xd6da('0x16')](_[_0xd6da('0x17')](_0x379fd7[_0xd6da('0x18')],'id'),_0xd6da('0x19'));return request({'uri':util['format'](_0xd6da('0x1a'),_0x1c4809[_0xd6da('0x1b')]),'method':_0xd6da('0x1c'),'body':_0x379fd7})[_0xd6da('0x1d')](function(_0x4aab32){logger['info'](_0xd6da('0x1e'));return _0x4aab32;});}function getUser(_0x53237d,_0x5cdf99){if(intUtil['validateEmail'](_0x5cdf99)){return request({'uri':util[_0xd6da('0x1f')]('%s/api/v2/agents',_0x53237d['remoteUri']),'qs':{'email':_0x5cdf99}})['then'](function(_0x32a995){if(_0x32a995[_0xd6da('0x20')]){logger[_0xd6da('0xd')](_0xd6da('0x21'));return _[_0xd6da('0x22')](_0x32a995,function(_0x26d4c1){return _0x26d4c1[_0xd6da('0x23')][_0xd6da('0x24')]===_0x5cdf99;});}else{logger[_0xd6da('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xd6da('0x1f')](_0xd6da('0x25'),_0x53237d[_0xd6da('0x1b')])})[_0xd6da('0x1d')](function(_0x44872c){logger[_0xd6da('0xd')](_0xd6da('0x26'));return _0x44872c;});}});}else{logger[_0xd6da('0xd')](_0xd6da('0x27'));return request({'uri':util[_0xd6da('0x1f')](_0xd6da('0x25'),_0x53237d[_0xd6da('0x1b')])})[_0xd6da('0x1d')](function(_0x405996){logger[_0xd6da('0xd')](_0xd6da('0x26'));return _0x405996;});}}function getEndUser(_0x2b3bb4,_0x1a4eca,_0xa3711a){logger[_0xd6da('0xd')](_0xd6da('0x28'),_0xa3711a);return request({'uri':util[_0xd6da('0x1f')](_0xd6da('0x29'),_0x2b3bb4[_0xd6da('0x1b')]),'qs':{'phone':_0xa3711a}})[_0xd6da('0x1d')](function(_0x20a823){if(_0x20a823[_0xd6da('0x20')]){logger[_0xd6da('0xd')](_0xd6da('0x2a'));return _[_0xd6da('0x22')](_0x20a823,{'phone':_0xa3711a});}else{logger['info'](_0xd6da('0x2b'));return request({'uri':util[_0xd6da('0x1f')](_0xd6da('0x29'),_0x2b3bb4[_0xd6da('0x1b')]),'method':_0xd6da('0x1c'),'body':{'name':_0x1a4eca,'phone':_0xa3711a}})['then'](function(_0x422d3e){logger['info'](_0xd6da('0x2c'));return _0x422d3e;});}});}function getAuth(_0x5e1d12){return util['format'](_0xd6da('0x2d'),new Buffer(_0x5e1d12['apiKey']+':X')[_0xd6da('0x2e')](_0xd6da('0x2f')));}function request(_0xa37a5a){logger[_0xd6da('0x30')]('[HTTP]',JSON['stringify'](_0xa37a5a));return rp(_[_0xd6da('0x9')](_0xa37a5a,{'method':_0xd6da('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x30aa7f,_0x172046){var _0x3d29d0=[];if(_0x30aa7f&&_0x30aa7f[_0xd6da('0x20')]>0x0){_0x3d29d0=_[_0xd6da('0x32')](_0x30aa7f,_0x172046);}return _0x3d29d0;}function getCustomFields(_0x1851ce,_0x56d5a4){var _0x27e2d7=[];var _0x39e656={'custom_fields':[]};if(_0x1851ce[_0xd6da('0x20')]>0x0){_['forEach'](_0x1851ce,function(_0x3a86a5){if(_[_0xd6da('0x33')]([_0xd6da('0x34'),_0xd6da('0x35')],_0x3a86a5[_0xd6da('0x36')])&&_0x3a86a5[_0xd6da('0x37')]&&!_0x3a86a5[_0xd6da('0x38')]){_0x39e656[_0x3a86a5['nameField'][_0xd6da('0x39')]()]=_0x3a86a5[_0xd6da('0x3a')][_0xd6da('0x2e')]();}else if(_[_0xd6da('0x33')](['string',_0xd6da('0x35')],_0x3a86a5[_0xd6da('0x36')])&&_0x3a86a5['idField']&&_0x3a86a5['customField']){_0x39e656[_0xd6da('0x18')][_0xd6da('0x3b')]({'id':_0x3a86a5[_0xd6da('0x3c')],'value':_0x3a86a5[_0xd6da('0x3a')][_0xd6da('0x2e')]()});}else if(_0x3a86a5[_0xd6da('0x36')]==='variable'&&_0x3a86a5[_0xd6da('0x3d')]&&_0x3a86a5[_0xd6da('0x3c')]&&_0x3a86a5[_0xd6da('0x38')]){_0x56d5a4[_0x3a86a5[_0xd6da('0x3d')]]&&_0x39e656[_0xd6da('0x18')]['push']({'id':_0x3a86a5[_0xd6da('0x3c')],'value':_0x56d5a4[_0x3a86a5[_0xd6da('0x3d')]]['toString']()});}else if(_0x3a86a5[_0xd6da('0x36')]===_0xd6da('0x3e')&&_0x3a86a5[_0xd6da('0x3f')]&&_0x3a86a5[_0xd6da('0x3f')]['name']&&_0x3a86a5[_0xd6da('0x3c')]&&_0x3a86a5[_0xd6da('0x38')]){_0x56d5a4[_0x3a86a5[_0xd6da('0x3f')]['name']['toLowerCase']()]&&_0x39e656[_0xd6da('0x18')]['push']({'id':_0x3a86a5[_0xd6da('0x3c')],'value':_0x56d5a4[_0x3a86a5[_0xd6da('0x3f')][_0xd6da('0x15')]['toLowerCase']()][_0xd6da('0x2e')]()});}});}return _0x39e656;}exports[_0xd6da('0x40')]=function(_0x520650,_0x4e2fa3,_0x1a5fa9,_0x3e6003,_0x51884d,_0x1eab56){var _0x25edcd,_0x2f17b2;_0x1eab56[_0xd6da('0x1b')]=intUtil[_0xd6da('0x41')](_0x1eab56['remoteUri']);_0x1eab56[_0xd6da('0x42')]=intUtil[_0xd6da('0x41')](_0x1eab56[_0xd6da('0x42')]);if(_0x51884d&&_0x51884d[_0xd6da('0x43')]){logger['info'](_0xd6da('0x44'),_0xd6da('0x45'));_0x4e2fa3[_0xd6da('0x46')]=util[_0xd6da('0x1f')](_0xd6da('0x47'),_0x1eab56['serverUrl'],_0x4e2fa3[_0xd6da('0x48')],md5(_0x4e2fa3[_0xd6da('0x48')]));}else{_0x4e2fa3[_0xd6da('0x46')]='';}headers[_0xd6da('0x49')]=getAuth(_0x1eab56);return getUser(_0x1eab56,_0x3e6003['email'])['then'](function(_0x834a38){_0x25edcd=_0x834a38;logger['info'](_0xd6da('0x4a'),_0x25edcd['id']);return getEndUser(_0x1eab56,_0x4e2fa3['calleridname'],_0x4e2fa3[_0xd6da('0x10')]);})[_0xd6da('0x1d')](function(_0x315e5d){_0x2f17b2=_0x315e5d;logger[_0xd6da('0xd')](_0xd6da('0x4b'),_0x2f17b2['id']);return getTicket(_0x1eab56,_0x25edcd,_0x2f17b2,_0x1a5fa9,_0x4e2fa3);})[_0xd6da('0x1d')](function(_0x5913f5){if(_0x5913f5&&_0x5913f5['id']){logger[_0xd6da('0xd')](_0xd6da('0x1e'));logger[_0xd6da('0xd')](_0xd6da('0x4c'),_0x5913f5['id']);logger[_0xd6da('0xd')](_0xd6da('0x44'),_0xd6da('0x4d'));emit(util[_0xd6da('0x1f')](_0xd6da('0x4e'),_0x3e6003['name']),_0xd6da('0x4f'),{'uri':util[_0xd6da('0x1f')]('%s/helpdesk/tickets/%d',_0x1eab56[_0xd6da('0x1b')],_0x5913f5['id'])});}})[_0xd6da('0x50')](function(_0x428423){logger['error']('[QUEUE]',JSON[_0xd6da('0x51')](_0x428423));});};exports[_0xd6da('0x52')]=function(_0x219d03,_0x3109c6,_0x433b69,_0x5a3679,_0x389acc,_0x10f0be,_0x8fa05a){var _0x11c82a,_0x79c293;_0x10f0be[_0xd6da('0x1b')]=intUtil[_0xd6da('0x41')](_0x10f0be[_0xd6da('0x1b')]);_0x10f0be[_0xd6da('0x42')]=intUtil[_0xd6da('0x41')](_0x10f0be[_0xd6da('0x42')]);if(_0x8fa05a&&_0x8fa05a['recordingFormat']&&_0x8fa05a['recordingFormat']!==_0xd6da('0x53')){logger[_0xd6da('0xd')](_0xd6da('0x54'),_0xd6da('0x45'));_0x3109c6[_0xd6da('0x46')]=util[_0xd6da('0x1f')](_0xd6da('0x47'),_0x10f0be[_0xd6da('0x42')],_0x3109c6[_0xd6da('0x48')],md5(_0x3109c6[_0xd6da('0x48')]));}headers[_0xd6da('0x49')]=getAuth(_0x10f0be);return getUser(_0x10f0be,_0x5a3679[_0xd6da('0x24')])[_0xd6da('0x1d')](function(_0x122bdc){_0x11c82a=_0x122bdc;logger[_0xd6da('0xd')]('The\x20User\x20ID\x20is:',_0x11c82a['id']);return getEndUser(_0x10f0be,_0x3109c6[_0xd6da('0x55')],_0x3109c6['destcalleridnum']);})[_0xd6da('0x1d')](function(_0x5fa8c7){_0x79c293=_0x5fa8c7;logger[_0xd6da('0xd')]('The\x20Enduser\x20ID\x20is:',_0x79c293['id']);return getTicket(_0x10f0be,_0x11c82a,_0x79c293,_0x433b69,_0x3109c6);})[_0xd6da('0x1d')](function(_0x3290a8){if(_0x3290a8&&_0x3290a8['id']){logger[_0xd6da('0xd')](_0xd6da('0x1e'));logger[_0xd6da('0xd')]('The\x20Ticket\x20ID\x20is:',_0x3290a8['id']);logger[_0xd6da('0xd')]('[OUTBOUND]',_0xd6da('0x4d'));emit(util[_0xd6da('0x1f')](_0xd6da('0x4e'),_0x5a3679['name']),_0xd6da('0x4f'),{'uri':util[_0xd6da('0x1f')](_0xd6da('0x56'),_0x10f0be['remoteUri'],_0x3290a8['id'])});}})['catch'](function(_0x4a2b69){logger[_0xd6da('0x57')](_0xd6da('0x54'),JSON['stringify'](_0x4a2b69));});};exports[_0xd6da('0x58')]=function(_0x371330,_0x12b76e,_0x3c2a60,_0x40aaf0,_0x3237a8,_0x3a8516){var _0x5a2d53,_0x34cff5;_0x3a8516[_0xd6da('0x1b')]=intUtil[_0xd6da('0x41')](_0x3a8516['remoteUri']);_0x3a8516[_0xd6da('0x42')]=intUtil[_0xd6da('0x41')](_0x3a8516[_0xd6da('0x42')]);if(_0x3237a8&&_0x3237a8[_0xd6da('0x43')]){logger[_0xd6da('0xd')]('['+_0x12b76e[_0xd6da('0x59')][_0xd6da('0x5a')]()+']',_0xd6da('0x45'));_0x12b76e[_0xd6da('0x46')]=util[_0xd6da('0x1f')](_0xd6da('0x47'),_0x3a8516[_0xd6da('0x42')],_0x12b76e[_0xd6da('0x48')],md5(_0x12b76e[_0xd6da('0x48')]));}else{_0x12b76e[_0xd6da('0x46')]='';}headers[_0xd6da('0x49')]=getAuth(_0x3a8516);return getUser(_0x3a8516,'')[_0xd6da('0x1d')](function(_0x2447c3){_0x5a2d53=_0x2447c3;logger[_0xd6da('0xd')](_0xd6da('0x4a'),_0x5a2d53['id']);return getEndUser(_0x3a8516,_0x12b76e[_0xd6da('0xf')],_0x12b76e[_0xd6da('0x10')]);})[_0xd6da('0x1d')](function(_0x52b1e8){_0x34cff5=_0x52b1e8;logger['info'](_0xd6da('0x4b'),_0x34cff5['id']);return getTicket(_0x3a8516,_0x5a2d53,_0x34cff5,_0x3c2a60,_0x12b76e);})[_0xd6da('0x1d')](function(_0x34e9ec){if(_0x34e9ec){logger[_0xd6da('0xd')](_0xd6da('0x1e'));logger[_0xd6da('0xd')](_0xd6da('0x4c'),_0x34e9ec['id']);}})[_0xd6da('0x50')](function(_0x7d3ca0){logger[_0xd6da('0x57')]('['+_0x12b76e[_0xd6da('0x59')][_0xd6da('0x5a')]()+']',JSON[_0xd6da('0x51')](_0x7d3ca0));});}; \ 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 7451de6..2c12235 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 _0xf245=['YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','Creating\x20new\x20task','getString','Subjects','Contact','add','ticketId','task','Task\x20created:','/contacts/','user:%s','trigger:browser:url','Token\x20token=','apiKey','remoteUri','serverUrl','username','toLowerCase','outbound','calleridnum','queue','uniqueid','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','lodash','request-promise','md5','util','moment','ioredis','../../../../config/environment','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','email','adminEmail','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','error','message','Getting\x20user\x20with\x20email','userEmail','agentEmail','userId','User\x20found:','Admin\x20selected','catch','toUpperCase','/api/lookup?q=','&f=','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','/api/contacts','contactNumber'];(function(_0xd8c941,_0x750f35){var _0xf95f50=function(_0x193c42){while(--_0x193c42){_0xd8c941['push'](_0xd8c941['shift']());}};_0xf95f50(++_0x750f35);}(_0xf245,0x10d));var _0x5f24=function(_0x5ef161,_0x27d16c){_0x5ef161=_0x5ef161-0x0;var _0x1c6e9e=_0xf245[_0x5ef161];return _0x1c6e9e;};'use strict';var _=require(_0x5f24('0x0'));var rp=require(_0x5f24('0x1'));var md5=require(_0x5f24('0x2'));var util=require(_0x5f24('0x3'));var moment=require(_0x5f24('0x4'));var Promise=require('bluebird');var Redis=require(_0x5f24('0x5'));var intUtil=require('./util');var config=require(_0x5f24('0x6'));var logger=require(_0x5f24('0x7'))('freshsales');config['redis']=_[_0x5f24('0x8')](config[_0x5f24('0x9')],{'host':_0x5f24('0xa'),'port':0x18eb});var io=require(_0x5f24('0xb'))(new Redis(config[_0x5f24('0x9')]));function getAdminId(_0x2b2103,_0xc4927d,_0x44bea5,_0x28aded){return new Promise(function(_0x2183ac,_0x29c764){var _0x37f9bf=![];var _0x11ec3d={'method':_0x5f24('0xc'),'uri':_0x28aded+_0x5f24('0xd'),'json':!![]};_0x11ec3d[_0x5f24('0xe')]=_0x44bea5;logger[_0x5f24('0xf')](_0x5f24('0x10'));return rp(_0x11ec3d)[_0x5f24('0x11')](function(_0xf4a27a){if(_0xf4a27a){var _0x5bb7f9=_0xf4a27a[_0x5f24('0x12')];var _0x167a10=null;for(_0x167a10=0x0;_0x167a10<_0x5bb7f9['length'];_0x167a10++){if(_0x5bb7f9[_0x167a10][_0x5f24('0x13')]===_0x2b2103[_0x5f24('0x14')]){_0x2b2103['adminId']=_0x5bb7f9[_0x167a10]['id'];_0x37f9bf=!![];}}if(_0x37f9bf){logger['info'](_0x5f24('0x15'),_0x2b2103[_0x5f24('0x16')]);_0x2183ac(_0x2b2103);}else{_0x29c764({'statusCode':0x194,'message':_0x5f24('0x17')});}}else{_0x29c764({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x1e7f4a){logger[_0x5f24('0x18')]('['+[_0xc4927d['toUpperCase']()]+']',_0x1e7f4a[_0x5f24('0x19')]);_0x29c764(_0x1e7f4a);});});}function getUser(_0x4ea4e1,_0x2a4e40,_0x46bc49){return function(_0x30fc61){return new Promise(function(_0x8bc938,_0x26cc00){var _0x355240={'method':_0x5f24('0xc'),'uri':_0x46bc49+'/api/selector/owners','json':!![]};_0x355240[_0x5f24('0xe')]=_0x2a4e40;logger[_0x5f24('0xf')]('Getting\x20user\x20list');return rp(_0x355240)[_0x5f24('0x11')](function(_0x3065db){if(_0x3065db){var _0x472e8b=_0x3065db[_0x5f24('0x12')];var _0x4babaf=![];var _0x2ab45a=null;if(_0x30fc61['agentEmail']!==null){logger[_0x5f24('0xf')](_0x5f24('0x1a'),_0x30fc61['agentEmail']);_0x30fc61[_0x5f24('0x1b')]=_0x30fc61[_0x5f24('0x1c')];for(_0x2ab45a=0x0;_0x2ab45a<_0x472e8b['length'];_0x2ab45a++){if(_0x472e8b[_0x2ab45a][_0x5f24('0x13')]===_0x30fc61[_0x5f24('0x1c')]){_0x4babaf=!![];_0x30fc61[_0x5f24('0x1d')]=_0x472e8b[_0x2ab45a]['id'];logger[_0x5f24('0xf')](_0x5f24('0x1e'),_0x30fc61['userId']);}}}if(!_0x4babaf){logger[_0x5f24('0xf')](_0x5f24('0x1f'));_0x30fc61[_0x5f24('0x1b')]=_0x30fc61[_0x5f24('0x14')];_0x30fc61[_0x5f24('0x1d')]=_0x30fc61[_0x5f24('0x16')];_0x4babaf=!![];}if(_0x4babaf){_0x8bc938(_0x30fc61);}else{_0x26cc00({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x26cc00({'statusCode':0x194,'message':_0x5f24('0x17')});}})[_0x5f24('0x20')](function(_0x4ed8f6){logger['error']('['+[_0x4ea4e1[_0x5f24('0x21')]()]+']',_0x4ed8f6[_0x5f24('0x19')]);_0x26cc00(_0x4ed8f6);});});};}function searchContact(_0x7755f1,_0x3c6567,_0x14c281,_0xd3368d){return new Promise(function(_0x54a80,_0x2cbdcf){var _0x1de732={'method':_0x5f24('0xc'),'headers':_0x3c6567,'uri':_0x7755f1+_0x5f24('0x22')+_0xd3368d+_0x5f24('0x23')+_0x14c281+'&entities=contact','json':!![]};rp(_0x1de732)['then'](function(_0x1630d8){var _0x5e1e56=_[_0x5f24('0x24')](_0x1630d8[_0x5f24('0x25')][_0x5f24('0x25')],[_0x14c281,_0xd3368d]);_0x54a80(_0x5e1e56);})[_0x5f24('0x20')](function(_0x53a4cb){_0x2cbdcf(_0x53a4cb);});});}function getEndUser(_0x186000,_0x1ac910,_0x57dbac){return function(_0x291366){return new Promise(function(_0x45d745,_0x59c19e){logger[_0x5f24('0xf')](util[_0x5f24('0x26')](_0x5f24('0x27'),_0x291366['contactNumber']));searchContact(_0x57dbac,_0x1ac910,_0x5f24('0x28'),_0x291366['contactNumber'])[_0x5f24('0x11')](function(_0x4be4c5){if(_0x4be4c5){_0x291366[_0x5f24('0x29')]=_0x4be4c5['id'];logger[_0x5f24('0xf')](_0x5f24('0x2a'),_0x291366['endUserId']);return _0x45d745(_0x291366);}searchContact(_0x57dbac,_0x1ac910,_0x5f24('0x2b'),_0x291366['contactNumber'])[_0x5f24('0x11')](function(_0x5559fa){if(_0x5559fa){_0x291366[_0x5f24('0x29')]=_0x5559fa['id'];logger[_0x5f24('0xf')](_0x5f24('0x2c'),_0x291366[_0x5f24('0x29')]);return _0x45d745(_0x291366);}createEndUser(_0x291366,_0x186000,_0x1ac910,_0x57dbac)[_0x5f24('0x11')](function(_0x4daa84){logger[_0x5f24('0xf')]('Contact\x20created:',_0x4daa84[_0x5f24('0x29')]);return _0x45d745(_0x4daa84);});});})[_0x5f24('0x20')](function(_0x222bb6){_0x59c19e(_0x222bb6);});});};}function createEndUser(_0x22d522,_0x6bfedf,_0xf9b987,_0x461373){return new Promise(function(_0x2acfb7,_0x242a06){var _0x3e451a=moment();var _0x1e5a74={'method':'POST','uri':_0x461373+_0x5f24('0x2d'),'body':{'contact':{'last_name':_0x22d522['contactNumber'],'work_number':_0x22d522['contactNumber'],'mobile_number':_0x22d522[_0x5f24('0x2e')],'owner_id':_0x22d522['userId'],'created_at':_0x3e451a[_0x5f24('0x26')](_0x5f24('0x2f'))}},'json':!![]};_0x1e5a74[_0x5f24('0xe')]=_0xf9b987;logger[_0x5f24('0xf')](_0x5f24('0x30'));return rp(_0x1e5a74)[_0x5f24('0x11')](function(_0x1837fb){_0x22d522['endUserId']=_0x1837fb['contact']['id'];_0x2acfb7(_0x22d522);})[_0x5f24('0x20')](function(_0x26d185){logger[_0x5f24('0x18')]('['+[_0x6bfedf[_0x5f24('0x21')]()]+']',_0x26d185[_0x5f24('0x19')]);_0x242a06(_0x26d185['message']);});});}function getTicket(_0x19ab29,_0x22fb52,_0x47f304,_0x2597cf,_0x3f31aa){return function(_0x55b6fc){logger[_0x5f24('0xf')](_0x5f24('0x31'));return new Promise(function(_0x2d9ac9,_0x447c4c){var _0x3f930d=moment();var _0x15a189={'method':'POST','uri':_0x47f304+'/api/tasks','body':{'title':intUtil[_0x5f24('0x32')](_0x2597cf[_0x5f24('0x33')],_0x3f31aa,'\x20'),'description':intUtil['getString'](_0x2597cf['Descriptions'],_0x3f31aa,'\x0a'),'owner_id':_0x55b6fc[_0x5f24('0x1d')],'creater_id':_0x55b6fc[_0x5f24('0x16')],'targetable_id':_0x55b6fc[_0x5f24('0x29')],'targetable_type':_0x5f24('0x34'),'created_at':_0x3f930d[_0x5f24('0x26')](_0x5f24('0x2f')),'due_date':_0x3f930d[_0x5f24('0x35')](0x1e,'m')[_0x5f24('0x26')](_0x5f24('0x2f'))},'json':!![]};_0x15a189[_0x5f24('0xe')]=_0x22fb52;return rp(_0x15a189)[_0x5f24('0x11')](function(_0x808a5e){_0x55b6fc[_0x5f24('0x36')]=_0x808a5e[_0x5f24('0x37')]['id'];logger[_0x5f24('0xf')](_0x5f24('0x38'),_0x55b6fc['ticketId']);_0x2d9ac9(_0x55b6fc);})[_0x5f24('0x20')](function(_0x46b80c){logger['error']('['+[_0x19ab29['toUpperCase']()]+']',_0x46b80c[_0x5f24('0x19')]);_0x447c4c(_0x46b80c[_0x5f24('0x19')]);});});};}function emit(_0x3aa564,_0x1895a7,_0x2c740d){var _0x24b24d={'uri':_0x3aa564+_0x5f24('0x39')+_0x2c740d};io['to'](util[_0x5f24('0x26')](_0x5f24('0x3a'),_0x1895a7))['emit'](_0x5f24('0x3b'),_0x24b24d);}exports['cs']=function(_0x273ca3,_0xc25e20,_0x216476,_0x2dec22,_0x34bd52,_0x139be5,_0xece5f,_0x20ba42){var _0x1afebc={};var _0x483af0={'Authorization':_0x5f24('0x3c')+_0x139be5[_0x5f24('0x3d')]};_0x139be5['remoteUri']=intUtil['stripTrailingSlash'](_0x139be5[_0x5f24('0x3e')]);_0x139be5['serverUrl']=intUtil['stripTrailingSlash'](_0x139be5[_0x5f24('0x3f')]);var _0x5d9511=_0x139be5['remoteUri'];_0x1afebc['adminEmail']=_0x139be5[_0x5f24('0x40')];_0x1afebc[_0x5f24('0x2e')]=_0x20ba42[_0x5f24('0x41')]()===_0x5f24('0x42')?_0xc25e20['destcalleridnum']:_0xc25e20[_0x5f24('0x43')];_0x1afebc['callDirection']=_0x20ba42==='queue'||_0x20ba42==='unmanaged'?_0x5f24('0x44'):'outbound';if(_0x2dec22){_0x1afebc[_0x5f24('0x1c')]=_0x2dec22[_0x5f24('0x13')];}var _0x7554c6=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x139be5[_0x5f24('0x3f')],_0xc25e20[_0x5f24('0x45')],md5(_0xc25e20[_0x5f24('0x45')]));if(_0x34bd52&&_0x34bd52['monitor_format']){logger[_0x5f24('0xf')]('[QUEUE]',_0x5f24('0x46'));_0xc25e20[_0x5f24('0x47')]=_0x7554c6;}else if(_0xece5f&&_0xece5f[_0x5f24('0x48')]&&_0xece5f['recordingFormat']!==_0x5f24('0x49')){logger[_0x5f24('0xf')](_0x5f24('0x4a'),_0x5f24('0x46'));_0xc25e20[_0x5f24('0x47')]=_0x7554c6;}else{_0xc25e20[_0x5f24('0x47')]='';}return getAdminId(_0x1afebc,_0x20ba42,_0x483af0,_0x5d9511)[_0x5f24('0x11')](getUser(_0x20ba42,_0x483af0,_0x5d9511))[_0x5f24('0x11')](getEndUser(_0x20ba42,_0x483af0,_0x5d9511))[_0x5f24('0x11')](getTicket(_0x20ba42,_0x483af0,_0x5d9511,_0x216476,_0xc25e20))[_0x5f24('0x11')](function(_0x5d2faf){logger['info'](util[_0x5f24('0x26')](_0x5f24('0x4b'),_0x5d2faf['ticketId']));if(_0x20ba42!==_0x5f24('0x4c')){logger['info']('['+[_0x20ba42[_0x5f24('0x21')]()]+']',_0x5f24('0x4d'));emit(_0x5d9511,_0x2dec22[_0x5f24('0x4e')],_0x5d2faf['endUserId']);}})[_0x5f24('0x20')](function(_0x2b5842){logger[_0x5f24('0x18')]('['+[_0x20ba42[_0x5f24('0x21')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util['inspect'](_0x2b5842,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x0d53=['toUpperCase','GET','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','message','&f=','&entities=contact','find','contacts','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','catch','POST','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact','add','ticketId','task','Task\x20created:','emit','trigger:browser:url','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','destcalleridnum','callDirection','queue','unmanaged','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','localhost','/api/selector/owners','headers','Getting\x20admin\x20information','then','users','length','email','adminEmail','adminId','info','Admin\x20found:','Requested\x20Resource\x20not\x20Found','error'];(function(_0x4cba56,_0x5b2c44){var _0x3cc9f3=function(_0x5bb80a){while(--_0x5bb80a){_0x4cba56['push'](_0x4cba56['shift']());}};_0x3cc9f3(++_0x5b2c44);}(_0x0d53,0x17d));var _0x30d5=function(_0x48704b,_0x77819a){_0x48704b=_0x48704b-0x0;var _0x7804b2=_0x0d53[_0x48704b];return _0x7804b2;};'use strict';var _=require(_0x30d5('0x0'));var rp=require(_0x30d5('0x1'));var md5=require(_0x30d5('0x2'));var util=require('util');var moment=require(_0x30d5('0x3'));var Promise=require(_0x30d5('0x4'));var Redis=require(_0x30d5('0x5'));var intUtil=require(_0x30d5('0x6'));var config=require(_0x30d5('0x7'));var logger=require(_0x30d5('0x8'))('freshsales');config[_0x30d5('0x9')]=_['defaults'](config[_0x30d5('0x9')],{'host':_0x30d5('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x30d5('0x9')]));function getAdminId(_0x11ed45,_0x189c30,_0x29fe99,_0x3de1cc){return new Promise(function(_0x3f393d,_0x23171f){var _0x76564a=![];var _0x2551e9={'method':'GET','uri':_0x3de1cc+_0x30d5('0xb'),'json':!![]};_0x2551e9[_0x30d5('0xc')]=_0x29fe99;logger['info'](_0x30d5('0xd'));return rp(_0x2551e9)[_0x30d5('0xe')](function(_0x194f4e){if(_0x194f4e){var _0x1be9bf=_0x194f4e[_0x30d5('0xf')];var _0x43aa68=null;for(_0x43aa68=0x0;_0x43aa68<_0x1be9bf[_0x30d5('0x10')];_0x43aa68++){if(_0x1be9bf[_0x43aa68][_0x30d5('0x11')]===_0x11ed45[_0x30d5('0x12')]){_0x11ed45[_0x30d5('0x13')]=_0x1be9bf[_0x43aa68]['id'];_0x76564a=!![];}}if(_0x76564a){logger[_0x30d5('0x14')](_0x30d5('0x15'),_0x11ed45[_0x30d5('0x13')]);_0x3f393d(_0x11ed45);}else{_0x23171f({'statusCode':0x194,'message':_0x30d5('0x16')});}}else{_0x23171f({'statusCode':0x194,'message':_0x30d5('0x16')});}})['catch'](function(_0x29b050){logger[_0x30d5('0x17')]('['+[_0x189c30[_0x30d5('0x18')]()]+']',_0x29b050['message']);_0x23171f(_0x29b050);});});}function getUser(_0x55f2dc,_0x4ef23c,_0x451eb1){return function(_0x476973){return new Promise(function(_0x221f01,_0x36d67e){var _0x5009af={'method':_0x30d5('0x19'),'uri':_0x451eb1+_0x30d5('0xb'),'json':!![]};_0x5009af[_0x30d5('0xc')]=_0x4ef23c;logger['info'](_0x30d5('0x1a'));return rp(_0x5009af)[_0x30d5('0xe')](function(_0x4a9b41){if(_0x4a9b41){var _0x4a1825=_0x4a9b41['users'];var _0x5540a8=![];var _0x3a8947=null;if(_0x476973[_0x30d5('0x1b')]!==null){logger[_0x30d5('0x14')](_0x30d5('0x1c'),_0x476973[_0x30d5('0x1b')]);_0x476973[_0x30d5('0x1d')]=_0x476973[_0x30d5('0x1b')];for(_0x3a8947=0x0;_0x3a8947<_0x4a1825[_0x30d5('0x10')];_0x3a8947++){if(_0x4a1825[_0x3a8947][_0x30d5('0x11')]===_0x476973[_0x30d5('0x1b')]){_0x5540a8=!![];_0x476973[_0x30d5('0x1e')]=_0x4a1825[_0x3a8947]['id'];logger[_0x30d5('0x14')]('User\x20found:',_0x476973[_0x30d5('0x1e')]);}}}if(!_0x5540a8){logger['info']('Admin\x20selected');_0x476973[_0x30d5('0x1d')]=_0x476973[_0x30d5('0x12')];_0x476973[_0x30d5('0x1e')]=_0x476973[_0x30d5('0x13')];_0x5540a8=!![];}if(_0x5540a8){_0x221f01(_0x476973);}else{_0x36d67e({'statusCode':0x194,'message':_0x30d5('0x16')});}}else{_0x36d67e({'statusCode':0x194,'message':_0x30d5('0x16')});}})['catch'](function(_0xa0ff94){logger['error']('['+[_0x55f2dc[_0x30d5('0x18')]()]+']',_0xa0ff94[_0x30d5('0x1f')]);_0x36d67e(_0xa0ff94);});});};}function searchContact(_0x1c322f,_0x426a2a,_0xc64964,_0x2d0b6e){return new Promise(function(_0x1ca784,_0x282fe1){var _0x9c76c2={'method':_0x30d5('0x19'),'headers':_0x426a2a,'uri':_0x1c322f+'/api/lookup?q='+_0x2d0b6e+_0x30d5('0x20')+_0xc64964+_0x30d5('0x21'),'json':!![]};rp(_0x9c76c2)[_0x30d5('0xe')](function(_0x359646){var _0x51f559=_[_0x30d5('0x22')](_0x359646[_0x30d5('0x23')][_0x30d5('0x23')],[_0xc64964,_0x2d0b6e]);_0x1ca784(_0x51f559);})['catch'](function(_0x597624){_0x282fe1(_0x597624);});});}function getEndUser(_0x5765d9,_0x1650e0,_0x283c01){return function(_0x4b3c3a){return new Promise(function(_0x550d99,_0xc5a618){logger[_0x30d5('0x14')](util['format']('Searching\x20contact\x20with\x20phone\x20%s',_0x4b3c3a[_0x30d5('0x24')]));searchContact(_0x283c01,_0x1650e0,_0x30d5('0x25'),_0x4b3c3a[_0x30d5('0x24')])['then'](function(_0x27b37a){if(_0x27b37a){_0x4b3c3a[_0x30d5('0x26')]=_0x27b37a['id'];logger[_0x30d5('0x14')](_0x30d5('0x27'),_0x4b3c3a[_0x30d5('0x26')]);return _0x550d99(_0x4b3c3a);}searchContact(_0x283c01,_0x1650e0,_0x30d5('0x28'),_0x4b3c3a['contactNumber'])['then'](function(_0x23b88c){if(_0x23b88c){_0x4b3c3a[_0x30d5('0x26')]=_0x23b88c['id'];logger[_0x30d5('0x14')](_0x30d5('0x29'),_0x4b3c3a[_0x30d5('0x26')]);return _0x550d99(_0x4b3c3a);}createEndUser(_0x4b3c3a,_0x5765d9,_0x1650e0,_0x283c01)[_0x30d5('0xe')](function(_0x131e8c){logger['info'](_0x30d5('0x2a'),_0x131e8c[_0x30d5('0x26')]);return _0x550d99(_0x131e8c);});});})[_0x30d5('0x2b')](function(_0x4d7cef){_0xc5a618(_0x4d7cef);});});};}function createEndUser(_0x1d40f7,_0x382c4b,_0x10f24d,_0x2ec7c6){return new Promise(function(_0x2c23de,_0x16bc80){var _0x1a5c66=moment();var _0x5dd91e={'method':_0x30d5('0x2c'),'uri':_0x2ec7c6+_0x30d5('0x2d'),'body':{'contact':{'last_name':_0x1d40f7[_0x30d5('0x24')],'work_number':_0x1d40f7[_0x30d5('0x24')],'mobile_number':_0x1d40f7['contactNumber'],'owner_id':_0x1d40f7['userId'],'created_at':_0x1a5c66[_0x30d5('0x2e')](_0x30d5('0x2f'))}},'json':!![]};_0x5dd91e[_0x30d5('0xc')]=_0x10f24d;logger[_0x30d5('0x14')](_0x30d5('0x30'));return rp(_0x5dd91e)[_0x30d5('0xe')](function(_0x456ba8){_0x1d40f7[_0x30d5('0x26')]=_0x456ba8[_0x30d5('0x31')]['id'];_0x2c23de(_0x1d40f7);})[_0x30d5('0x2b')](function(_0x46769c){logger['error']('['+[_0x382c4b['toUpperCase']()]+']',_0x46769c[_0x30d5('0x1f')]);_0x16bc80(_0x46769c['message']);});});}function getTicket(_0x2cfb8b,_0x215054,_0x45149d,_0x8d1813,_0x12c003){return function(_0x54a0fc){logger[_0x30d5('0x14')](_0x30d5('0x32'));return new Promise(function(_0x214d21,_0x5c14f6){var _0x49508c=moment();var _0x51619c={'method':'POST','uri':_0x45149d+_0x30d5('0x33'),'body':{'title':intUtil[_0x30d5('0x34')](_0x8d1813[_0x30d5('0x35')],_0x12c003,'\x20'),'description':intUtil[_0x30d5('0x34')](_0x8d1813[_0x30d5('0x36')],_0x12c003,'\x0a'),'owner_id':_0x54a0fc[_0x30d5('0x1e')],'creater_id':_0x54a0fc[_0x30d5('0x13')],'targetable_id':_0x54a0fc[_0x30d5('0x26')],'targetable_type':_0x30d5('0x37'),'created_at':_0x49508c[_0x30d5('0x2e')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x49508c[_0x30d5('0x38')](0x1e,'m')['format']('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x51619c[_0x30d5('0xc')]=_0x215054;return rp(_0x51619c)[_0x30d5('0xe')](function(_0x58862e){_0x54a0fc[_0x30d5('0x39')]=_0x58862e[_0x30d5('0x3a')]['id'];logger[_0x30d5('0x14')](_0x30d5('0x3b'),_0x54a0fc['ticketId']);_0x214d21(_0x54a0fc);})[_0x30d5('0x2b')](function(_0x25e4b8){logger[_0x30d5('0x17')]('['+[_0x2cfb8b['toUpperCase']()]+']',_0x25e4b8[_0x30d5('0x1f')]);_0x5c14f6(_0x25e4b8[_0x30d5('0x1f')]);});});};}function emit(_0x45a347,_0x593408,_0x1a4a34){var _0x10fee4={'uri':_0x45a347+'/contacts/'+_0x1a4a34};io['to'](util[_0x30d5('0x2e')]('user:%s',_0x593408))[_0x30d5('0x3c')](_0x30d5('0x3d'),_0x10fee4);}exports['cs']=function(_0x292e89,_0x48a12b,_0x447728,_0x4c2d66,_0x1431ac,_0x1b4f1f,_0x3a93fd,_0x14f3ab){var _0x51f4d2={};var _0x4414f6={'Authorization':'Token\x20token='+_0x1b4f1f[_0x30d5('0x3e')]};_0x1b4f1f[_0x30d5('0x3f')]=intUtil[_0x30d5('0x40')](_0x1b4f1f[_0x30d5('0x3f')]);_0x1b4f1f[_0x30d5('0x41')]=intUtil[_0x30d5('0x40')](_0x1b4f1f[_0x30d5('0x41')]);var _0x415626=_0x1b4f1f[_0x30d5('0x3f')];_0x51f4d2['adminEmail']=_0x1b4f1f[_0x30d5('0x42')];_0x51f4d2[_0x30d5('0x24')]=_0x14f3ab[_0x30d5('0x43')]()==='outbound'?_0x48a12b[_0x30d5('0x44')]:_0x48a12b['calleridnum'];_0x51f4d2[_0x30d5('0x45')]=_0x14f3ab===_0x30d5('0x46')||_0x14f3ab===_0x30d5('0x47')?_0x30d5('0x46'):'outbound';if(_0x4c2d66){_0x51f4d2[_0x30d5('0x1b')]=_0x4c2d66['email'];}var _0x397ffb=util[_0x30d5('0x2e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1b4f1f[_0x30d5('0x41')],_0x48a12b['uniqueid'],md5(_0x48a12b[_0x30d5('0x48')]));if(_0x1431ac&&_0x1431ac[_0x30d5('0x49')]){logger[_0x30d5('0x14')]('[QUEUE]',_0x30d5('0x4a'));_0x48a12b[_0x30d5('0x4b')]=_0x397ffb;}else if(_0x3a93fd&&_0x3a93fd[_0x30d5('0x4c')]&&_0x3a93fd[_0x30d5('0x4c')]!=='none'){logger[_0x30d5('0x14')](_0x30d5('0x4d'),_0x30d5('0x4a'));_0x48a12b[_0x30d5('0x4b')]=_0x397ffb;}else{_0x48a12b[_0x30d5('0x4b')]='';}return getAdminId(_0x51f4d2,_0x14f3ab,_0x4414f6,_0x415626)[_0x30d5('0xe')](getUser(_0x14f3ab,_0x4414f6,_0x415626))['then'](getEndUser(_0x14f3ab,_0x4414f6,_0x415626))[_0x30d5('0xe')](getTicket(_0x14f3ab,_0x4414f6,_0x415626,_0x447728,_0x48a12b))[_0x30d5('0xe')](function(_0x38880a){logger['info'](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x38880a[_0x30d5('0x39')]));if(_0x14f3ab!==_0x30d5('0x47')){logger[_0x30d5('0x14')]('['+[_0x14f3ab[_0x30d5('0x18')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x415626,_0x4c2d66[_0x30d5('0x4e')],_0x38880a[_0x30d5('0x26')]);}})[_0x30d5('0x2b')](function(_0x4a400c){logger[_0x30d5('0x17')]('['+[_0x14f3ab[_0x30d5('0x18')]()]+_0x30d5('0x4f'),util[_0x30d5('0x50')](_0x4a400c,{'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 6ec90b3..5de7a62 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 _0xdda0=['toLowerCase','data2','find','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','sugarcrm','freshdesk','servicenow','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','./zendesk','./salesforce','./sugarcrm','./zoho','./desk','./vtiger','./servicenow','./dynamics365','zendesk','salesforce','zoho','vtiger','dynamics365','freshsales','includes','data1'];(function(_0x1b0a6e,_0x235929){var _0x36f6ce=function(_0x269665){while(--_0x269665){_0x1b0a6e['push'](_0x1b0a6e['shift']());}};_0x36f6ce(++_0x235929);}(_0xdda0,0x186));var _0x0dda=function(_0x1bf89e,_0x3d520f){_0x1bf89e=_0x1bf89e-0x0;var _0x4262c0=_0xdda0[_0x1bf89e];return _0x4262c0;};'use strict';var _=require(_0x0dda('0x0'));var util=require('util');var zendesk=require(_0x0dda('0x1'));var salesforce=require(_0x0dda('0x2'));var sugarcrm=require(_0x0dda('0x3'));var freshdesk=require('./freshdesk');var zoho=require(_0x0dda('0x4'));var desk=require(_0x0dda('0x5'));var vtiger=require(_0x0dda('0x6'));var servicenow=require(_0x0dda('0x7'));var dynamics365=require(_0x0dda('0x8'));var freshsales=require('./freshsales');var integrations=[_0x0dda('0x9'),_0x0dda('0xa'),'sugarcrm','freshdesk',_0x0dda('0xb'),'desk',_0x0dda('0xc'),_0x0dda('0xd'),_0x0dda('0xe'),'servicenow'];exports['exec']=function(_0x2d7cae,_0x49ab9b,_0x27d196,_0x4c7b5f,_0x540ea6,_0x31e68a){if(_0x27d196){if(_[_0x0dda('0xf')](integrations,_0x2d7cae[_0x0dda('0x10')]['toLowerCase']())){try{var _0x5f5999=null;var _0xc5b15d='';var _0x478a22=_0x27d196[_0x2d7cae[_0x0dda('0x10')][_0x0dda('0x11')]()];if(_0x478a22){var _0x29c5db=_0x478a22[_0x2d7cae[_0x0dda('0x12')]];if(_0x29c5db){var _0x2007fb=_[_0x0dda('0x13')](_0x29c5db[_0x0dda('0x14')],{'id':parseInt(_0x2d7cae[_0x0dda('0x15')],0xa)});if(_0x2007fb){if(_0x4c7b5f){if(_0x540ea6&&_0x49ab9b[_0x0dda('0x16')]){_0xc5b15d=_0x0dda('0x16');}else if(_0x49ab9b[_0x0dda('0x17')]){_0xc5b15d=_0x0dda('0x18');}else{console[_0x0dda('0x19')](_0x0dda('0x1a'),_0x49ab9b);}}else{_0xc5b15d='unmanaged';}switch(_0x2d7cae['data1']['toLowerCase']()){case'zendesk':zendesk[_0xc5b15d](_0x2d7cae,_0x49ab9b,_0x2007fb,_0x4c7b5f,_0x540ea6,_0x29c5db,_0x31e68a);break;case _0x0dda('0xa'):salesforce[_0xc5b15d](_0x2d7cae,_0x49ab9b,_0x2007fb,_0x4c7b5f,_0x540ea6,_0x29c5db,_0x31e68a);break;case _0x0dda('0x1b'):sugarcrm[_0xc5b15d](_0x2d7cae,_0x49ab9b,_0x2007fb,_0x4c7b5f,_0x540ea6,_0x29c5db,_0x31e68a);break;case _0x0dda('0x1c'):freshdesk[_0xc5b15d](_0x2d7cae,_0x49ab9b,_0x2007fb,_0x4c7b5f,_0x540ea6,_0x29c5db,_0x31e68a);break;case'zoho':zoho[_0xc5b15d](_0x2d7cae,_0x49ab9b,_0x2007fb,_0x4c7b5f,_0x540ea6,_0x29c5db,_0x31e68a);break;case'desk':desk[_0xc5b15d](_0x2d7cae,_0x49ab9b,_0x2007fb,_0x4c7b5f,_0x540ea6,_0x29c5db,_0x31e68a);break;case'vtiger':vtiger[_0xc5b15d](_0x2d7cae,_0x49ab9b,_0x2007fb,_0x4c7b5f,_0x540ea6,_0x29c5db,_0x31e68a);break;case _0x0dda('0xe'):freshsales['cs'](_0x2d7cae,_0x49ab9b,_0x2007fb,_0x4c7b5f,_0x540ea6,_0x29c5db,_0x31e68a,_0xc5b15d);break;case _0x0dda('0x1d'):servicenow['cs'](_0x2d7cae,_0x49ab9b,_0x2007fb,_0x4c7b5f,_0x540ea6,_0x29c5db,_0x31e68a,_0xc5b15d);break;case _0x0dda('0xd'):dynamics365['cs'](_0x2d7cae,_0x49ab9b,_0x2007fb,_0x4c7b5f,_0x540ea6,_0x29c5db,_0x31e68a,_0xc5b15d);break;default:console[_0x0dda('0x19')](_0x0dda('0x1e'));}}else{_0x5f5999=require(_0x0dda('0x1f'))(_0x2d7cae[_0x0dda('0x10')][_0x0dda('0x11')]());_0x5f5999[_0x0dda('0x20')](_0x0dda('0x21'),util[_0x0dda('0x22')](_0x0dda('0x23'),_0x2d7cae['data1'][_0x0dda('0x11')](),_0x2d7cae['data3']));}}else{_0x5f5999=require(_0x0dda('0x1f'))(_0x2d7cae[_0x0dda('0x10')][_0x0dda('0x11')]());_0x5f5999['error'](_0x0dda('0x21'),util[_0x0dda('0x22')](_0x0dda('0x24'),_0x2d7cae[_0x0dda('0x10')]['toLowerCase'](),_0x2d7cae['data2']));}}else{}}catch(_0x291eaf){console[_0x0dda('0x20')](_0x291eaf);}}}}; \ No newline at end of file +var _0xb7fd=['Configurations','data3','queue','log','sugarcrm','zoho','error','format','%s\x20configuration\x20#%s\x20not\x20found','../../../../config/logger','lodash','util','./salesforce','./sugarcrm','./freshdesk','./zoho','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','freshdesk','desk','vtiger','dynamics365','freshsales','servicenow','exec','data1','toLowerCase','data2','find'];(function(_0x379010,_0x4dbd71){var _0x583161=function(_0x4bcc72){while(--_0x4bcc72){_0x379010['push'](_0x379010['shift']());}};_0x583161(++_0x4dbd71);}(_0xb7fd,0x112));var _0xdb7f=function(_0xfcb2ca,_0xe83c1d){_0xfcb2ca=_0xfcb2ca-0x0;var _0x5bba49=_0xb7fd[_0xfcb2ca];return _0x5bba49;};'use strict';var _=require(_0xdb7f('0x0'));var util=require(_0xdb7f('0x1'));var zendesk=require('./zendesk');var salesforce=require(_0xdb7f('0x2'));var sugarcrm=require(_0xdb7f('0x3'));var freshdesk=require(_0xdb7f('0x4'));var zoho=require(_0xdb7f('0x5'));var desk=require('./desk');var vtiger=require(_0xdb7f('0x6'));var servicenow=require(_0xdb7f('0x7'));var dynamics365=require(_0xdb7f('0x8'));var freshsales=require(_0xdb7f('0x9'));var integrations=[_0xdb7f('0xa'),_0xdb7f('0xb'),'sugarcrm',_0xdb7f('0xc'),'zoho',_0xdb7f('0xd'),_0xdb7f('0xe'),_0xdb7f('0xf'),_0xdb7f('0x10'),_0xdb7f('0x11')];exports[_0xdb7f('0x12')]=function(_0x4fcfe8,_0x30edc9,_0x5892a7,_0x399fbb,_0x388603,_0x1b4b0a){if(_0x5892a7){if(_['includes'](integrations,_0x4fcfe8[_0xdb7f('0x13')][_0xdb7f('0x14')]())){try{var _0x1fe9c2=null;var _0x17a43d='';var _0x451fd1=_0x5892a7[_0x4fcfe8['data1'][_0xdb7f('0x14')]()];if(_0x451fd1){var _0x3c5174=_0x451fd1[_0x4fcfe8[_0xdb7f('0x15')]];if(_0x3c5174){var _0x474dc6=_[_0xdb7f('0x16')](_0x3c5174[_0xdb7f('0x17')],{'id':parseInt(_0x4fcfe8[_0xdb7f('0x18')],0xa)});if(_0x474dc6){if(_0x399fbb){if(_0x388603&&_0x30edc9[_0xdb7f('0x19')]){_0x17a43d=_0xdb7f('0x19');}else if(_0x30edc9['routeId']){_0x17a43d='outbound';}else{console[_0xdb7f('0x1a')]('EVENT\x20UNKNOWN',_0x30edc9);}}else{_0x17a43d='unmanaged';}switch(_0x4fcfe8['data1'][_0xdb7f('0x14')]()){case'zendesk':zendesk[_0x17a43d](_0x4fcfe8,_0x30edc9,_0x474dc6,_0x399fbb,_0x388603,_0x3c5174,_0x1b4b0a);break;case _0xdb7f('0xb'):salesforce[_0x17a43d](_0x4fcfe8,_0x30edc9,_0x474dc6,_0x399fbb,_0x388603,_0x3c5174,_0x1b4b0a);break;case _0xdb7f('0x1b'):sugarcrm[_0x17a43d](_0x4fcfe8,_0x30edc9,_0x474dc6,_0x399fbb,_0x388603,_0x3c5174,_0x1b4b0a);break;case'freshdesk':freshdesk[_0x17a43d](_0x4fcfe8,_0x30edc9,_0x474dc6,_0x399fbb,_0x388603,_0x3c5174,_0x1b4b0a);break;case _0xdb7f('0x1c'):zoho[_0x17a43d](_0x4fcfe8,_0x30edc9,_0x474dc6,_0x399fbb,_0x388603,_0x3c5174,_0x1b4b0a);break;case _0xdb7f('0xd'):desk[_0x17a43d](_0x4fcfe8,_0x30edc9,_0x474dc6,_0x399fbb,_0x388603,_0x3c5174,_0x1b4b0a);break;case _0xdb7f('0xe'):vtiger[_0x17a43d](_0x4fcfe8,_0x30edc9,_0x474dc6,_0x399fbb,_0x388603,_0x3c5174,_0x1b4b0a);break;case _0xdb7f('0x10'):freshsales['cs'](_0x4fcfe8,_0x30edc9,_0x474dc6,_0x399fbb,_0x388603,_0x3c5174,_0x1b4b0a,_0x17a43d);break;case _0xdb7f('0x11'):servicenow['cs'](_0x4fcfe8,_0x30edc9,_0x474dc6,_0x399fbb,_0x388603,_0x3c5174,_0x1b4b0a,_0x17a43d);break;case _0xdb7f('0xf'):dynamics365['cs'](_0x4fcfe8,_0x30edc9,_0x474dc6,_0x399fbb,_0x388603,_0x3c5174,_0x1b4b0a,_0x17a43d);break;default:console[_0xdb7f('0x1a')]('unknown\x20integration');}}else{_0x1fe9c2=require('../../../../config/logger')(_0x4fcfe8[_0xdb7f('0x13')][_0xdb7f('0x14')]());_0x1fe9c2[_0xdb7f('0x1d')]('[EXEC]',util[_0xdb7f('0x1e')](_0xdb7f('0x1f'),_0x4fcfe8['data1'][_0xdb7f('0x14')](),_0x4fcfe8[_0xdb7f('0x18')]));}}else{_0x1fe9c2=require(_0xdb7f('0x20'))(_0x4fcfe8[_0xdb7f('0x13')][_0xdb7f('0x14')]());_0x1fe9c2['error']('[EXEC]',util[_0xdb7f('0x1e')]('%s\x20account\x20#%s\x20not\x20found',_0x4fcfe8[_0xdb7f('0x13')][_0xdb7f('0x14')](),_0x4fcfe8['data2']));}}else{}}catch(_0x262fed){console[_0xdb7f('0x1d')](_0x262fed);}}}}; \ 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 e53c3f5..874dbac 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 _0xf1dd=['execute','then','length','Email','Agent\x20%s\x20found.','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','resolve','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','additionalSearchLead','Lead','additionalSearchAccount','Account','Contact','first','Name','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','Caller\x20-\x20%s','format','Company','No\x20Company','upperFirst','forEach','includes','string','picklist','idField','content','toString','variable','variableName','customVariable','Variable','name','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','Connection\x20established.','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','outbound','recordingFormat','none','[OUTBOUND]','recordingURL','destcalleridname','destcalleridnum','trigger:salesforce:display','newTab','Salesforce\x20account\x20type\x20not\x20recognized','catch','unmanaged','monitor_format','isNil','calleridname','calleridnum','lastevent','toUpperCase',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','md5','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','assign','getString','Subjects','Descriptions','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','lead','account','WhatId','ticketType','Case','contact','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','validateEmail','User','find'];(function(_0x8c7309,_0x4b4317){var _0x5dcdf0=function(_0x549676){while(--_0x549676){_0x8c7309['push'](_0x8c7309['shift']());}};_0x5dcdf0(++_0x4b4317);}(_0xf1dd,0x1f2));var _0xdf1d=function(_0x5575cd,_0x73ab7a){_0x5575cd=_0x5575cd-0x0;var _0x4979a0=_0xf1dd[_0x5575cd];return _0x4979a0;};'use strict';var _=require('lodash');var rp=require(_0xdf1d('0x0'));var moment=require(_0xdf1d('0x1'));var BPromise=require(_0xdf1d('0x2'));var md5=require(_0xdf1d('0x3'));var jsforce=require('jsforce');var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xdf1d('0x4'));var config=require(_0xdf1d('0x5'));var logger=require(_0xdf1d('0x6'))(_0xdf1d('0x7'));config[_0xdf1d('0x8')]=_[_0xdf1d('0x9')](config[_0xdf1d('0x8')],{'host':_0xdf1d('0xa'),'port':0x18eb});var io=require(_0xdf1d('0xb'))(new Redis(config['redis']));function emit(_0x3e55f6,_0x57890c,_0x293e05){io['to'](_0x3e55f6)['emit'](_0x57890c,_0x293e05);}function getTicket(_0x54d732,_0x2382fa,_0x21e24f,_0x4da251,_0xfb1840,_0x33672e,_0x3e7bbd,_0x5d43bf){var _0x433511=Object[_0xdf1d('0xc')]({},{'OwnerId':_0x2382fa['id'],'Subject':intUtil[_0xdf1d('0xd')](_0x4da251[_0xdf1d('0xe')],_0xfb1840,'\x20'),'Description':intUtil[_0xdf1d('0xd')](_0x4da251[_0xdf1d('0xf')],_0xfb1840,'\x0a')},getCustomFields(_0x33672e,_0xfb1840));if(_0x21e24f){if(_0x4da251['ticketType']===_0xdf1d('0x10')){_0x433511[_0xdf1d('0x11')]=moment[_0xdf1d('0x12')]();_0x433511[_0xdf1d('0x13')]=![];_0x433511[_0xdf1d('0x14')]=![];if(_0x21e24f[_0xdf1d('0x15')]==='contact'||_0x21e24f[_0xdf1d('0x15')]===_0xdf1d('0x16')){_0x433511['WhoId']=_0x21e24f['id'];}else if(_0x21e24f[_0xdf1d('0x15')]===_0xdf1d('0x17')){_0x433511[_0xdf1d('0x18')]=_0x21e24f['id'];}}else if(_0x4da251[_0xdf1d('0x19')]===_0xdf1d('0x1a')){if(_0x21e24f[_0xdf1d('0x15')]===_0xdf1d('0x1b')){_0x433511[_0xdf1d('0x1c')]=_0x21e24f['id'];}else if(_0x21e24f[_0xdf1d('0x15')]===_0xdf1d('0x17')){_0x433511[_0xdf1d('0x1d')]=_0x21e24f['id'];}else if(_0x21e24f[_0xdf1d('0x15')]===_0xdf1d('0x16')&&_0x4da251[_0xdf1d('0x1e')]){_0x433511[_0x4da251['leadId']]=_0x21e24f['id'];}else{logger[_0xdf1d('0x1f')](_0xdf1d('0x20'));}}}return _0x3e7bbd[_0xdf1d('0x21')](_0x4da251[_0xdf1d('0x19')])[_0xdf1d('0x22')](_0x433511);}function getUser(_0x178a9a,_0x2088a0,_0x4b3216){if(!_['isNil'](_0x2088a0)&&intUtil[_0xdf1d('0x23')](_0x2088a0)){var _0x4e1fdb={'Email':_0x2088a0};var _0x38150a={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x4b3216[_0xdf1d('0x21')](_0xdf1d('0x24'))[_0xdf1d('0x25')](_0x4e1fdb,_0x38150a)[_0xdf1d('0x26')]()[_0xdf1d('0x27')](function(_0x47b0d3){if(_0x47b0d3[_0xdf1d('0x28')]){var _0x1e1e57=_[_0xdf1d('0x25')](_0x47b0d3,function(_0x1287f2){return _0x1287f2[_0xdf1d('0x29')]===_0x2088a0;});if(_0x1e1e57){logger[_0xdf1d('0x1f')](_0xdf1d('0x2a'),_0x2088a0);return BPromise['resolve']({'id':_0x1e1e57['Id'],'name':_0x1e1e57['Name']});}}else{logger[_0xdf1d('0x1f')](_0xdf1d('0x2b'),_0x2088a0);return _0x4b3216[_0xdf1d('0x2c')]()[_0xdf1d('0x27')](function(_0x213b12){return BPromise[_0xdf1d('0x2d')]({'id':_0x213b12[_0xdf1d('0x2e')],'name':_0x213b12[_0xdf1d('0x2f')]});});}});}else{logger[_0xdf1d('0x1f')](_0xdf1d('0x2b'),_0x2088a0);return _0x4b3216[_0xdf1d('0x2c')]()[_0xdf1d('0x27')](function(_0x4bb61a){return BPromise[_0xdf1d('0x2d')]({'id':_0x4bb61a[_0xdf1d('0x2e')],'name':_0x4bb61a['display_name']});});}}function getEndUser(_0x3a1d1e,_0x1149b6,_0xf640ac,_0x23c801,_0x30faef){var _0x25e3ec={'$or':{'Phone':_0x23c801}};var _0x194d64={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xdf1d('0x2d')]()[_0xdf1d('0x27')](function(){logger[_0xdf1d('0x1f')](_0xdf1d('0x30'),_0x23c801,_0x1149b6[_0xdf1d('0x31')]);switch(_0x1149b6[_0xdf1d('0x31')]){case _0xdf1d('0x32'):var _0x35b2fc=_[_0xdf1d('0x33')](_0x25e3ec);if(_0x1149b6[_0xdf1d('0x34')]){var _0x2012b1={};_0x2012b1[_0x1149b6['additionalSearchContact']]=_0x23c801;_[_0xdf1d('0x35')](_0x35b2fc[_0xdf1d('0x36')],_0x2012b1);}return _0x30faef[_0xdf1d('0x21')]('Contact')[_0xdf1d('0x25')](_0x35b2fc,_0x194d64)[_0xdf1d('0x26')]()[_0xdf1d('0x27')](function(_0x38aa0e){if(_0x38aa0e&&_0x38aa0e[_0xdf1d('0x28')]){return _0x38aa0e;}else{var _0x577268=_[_0xdf1d('0x33')](_0x25e3ec);if(_0x1149b6['additionalSearchLead']){var _0x38d5b8={};_0x38d5b8[_0x1149b6[_0xdf1d('0x37')]]=_0x23c801;_[_0xdf1d('0x35')](_0x577268['$or'],_0x38d5b8);}return _0x30faef[_0xdf1d('0x21')](_0xdf1d('0x38'))[_0xdf1d('0x25')](_0x577268,_0x194d64);}});case'account_contact_lead':var _0x463a32=_['cloneDeep'](_0x25e3ec);if(_0x1149b6['additionalSearchAccount']){var _0x2012b1={};_0x2012b1[_0x1149b6[_0xdf1d('0x39')]]=_0x23c801;_[_0xdf1d('0x35')](_0x463a32[_0xdf1d('0x36')],_0x2012b1);}return _0x30faef[_0xdf1d('0x21')](_0xdf1d('0x3a'))[_0xdf1d('0x25')](_0x463a32,_0x194d64)[_0xdf1d('0x26')]()[_0xdf1d('0x27')](function(_0x3f43f0){if(_0x3f43f0&&_0x3f43f0[_0xdf1d('0x28')]){return _0x3f43f0;}else{var _0x303032=_[_0xdf1d('0x33')](_0x25e3ec);if(_0x1149b6[_0xdf1d('0x34')]){var _0x17fa8c={};_0x17fa8c[_0x1149b6['additionalSearchContact']]=_0x23c801;_[_0xdf1d('0x35')](_0x303032[_0xdf1d('0x36')],_0x17fa8c);}return _0x30faef['sobject']('Contact')[_0xdf1d('0x25')](_0x303032,_0x194d64)['then'](function(_0x20cef6){if(_0x20cef6&&_0x20cef6['length']){return _0x20cef6;}else{var _0x39f41c=_[_0xdf1d('0x33')](_0x25e3ec);if(_0x1149b6[_0xdf1d('0x37')]){var _0x29a087={};_0x29a087[_0x1149b6[_0xdf1d('0x37')]]=_0x23c801;_[_0xdf1d('0x35')](_0x39f41c[_0xdf1d('0x36')],_0x29a087);}return _0x30faef[_0xdf1d('0x21')](_0xdf1d('0x38'))[_0xdf1d('0x25')](_0x39f41c,_0x194d64);}});}});case _0xdf1d('0x1b'):var _0x35b2fc=_['cloneDeep'](_0x25e3ec);if(_0x1149b6[_0xdf1d('0x34')]){var _0x2012b1={};_0x2012b1[_0x1149b6[_0xdf1d('0x34')]]=_0x23c801;_['merge'](_0x35b2fc[_0xdf1d('0x36')],_0x2012b1);}return _0x30faef['sobject'](_0xdf1d('0x3b'))[_0xdf1d('0x25')](_0x35b2fc,_0x194d64)[_0xdf1d('0x26')]();case'lead':var _0x5aee53=_[_0xdf1d('0x33')](_0x25e3ec);if(_0x1149b6['additionalSearchLead']){var _0x2012b1={};_0x2012b1[_0x1149b6[_0xdf1d('0x37')]]=_0x23c801;_['merge'](_0x5aee53[_0xdf1d('0x36')],_0x2012b1);}return _0x30faef[_0xdf1d('0x21')](_0xdf1d('0x38'))['find'](_0x5aee53,_0x194d64);case _0xdf1d('0x17'):var _0x463a32=_['cloneDeep'](_0x25e3ec);if(_0x1149b6[_0xdf1d('0x39')]){var _0x2012b1={};_0x2012b1[_0x1149b6[_0xdf1d('0x39')]]=_0x23c801;_['merge'](_0x463a32[_0xdf1d('0x36')],_0x2012b1);}return _0x30faef[_0xdf1d('0x21')]('Account')[_0xdf1d('0x25')](_0x463a32,_0x194d64);default:return null;}})['then'](function(_0x39cc25){if(_0x39cc25&&_0x39cc25[_0xdf1d('0x28')]){var _0x1e34ed=_[_0xdf1d('0x3c')](_0x39cc25);if(_0x1e34ed){return BPromise[_0xdf1d('0x2d')]({'id':_0x1e34ed['Id'],'name':_0x1e34ed[_0xdf1d('0x3d')],'phone':_0x1e34ed[_0xdf1d('0x3e')],'endUserType':_0x1e34ed[_0xdf1d('0x3f')][_0xdf1d('0x40')][_0xdf1d('0x41')]()});}}})[_0xdf1d('0x27')](function(_0x57dd14){if(_0x57dd14){logger['info'](_0xdf1d('0x42'),_0x57dd14['endUserType'],_0x23c801);return BPromise['resolve'](_0x57dd14);}else{logger[_0xdf1d('0x1f')](_0xdf1d('0x43'),_0x23c801);var _0x5c89e7={'Phone':_0x23c801};if(_0x1149b6[_0xdf1d('0x44')]){if(_0x1149b6['moduleCreate']===_0xdf1d('0x1b')){logger[_0xdf1d('0x1f')](_0xdf1d('0x45'),_0x23c801,_0x1149b6['moduleCreate']);_0x5c89e7[_0xdf1d('0x46')]=_0xf640ac!==_0xdf1d('0x47')?_0xf640ac:util['format'](_0xdf1d('0x48'),_0x23c801);}else if(_0x1149b6[_0xdf1d('0x44')]===_0xdf1d('0x16')){logger[_0xdf1d('0x1f')](_0xdf1d('0x45'),_0x23c801,_0x1149b6[_0xdf1d('0x44')]);_0x5c89e7[_0xdf1d('0x46')]=_0xf640ac!==_0xdf1d('0x47')?_0xf640ac:util[_0xdf1d('0x49')](_0xdf1d('0x48'),_0x23c801);_0x5c89e7[_0xdf1d('0x4a')]=_0xdf1d('0x4b');}else if(_0x1149b6[_0xdf1d('0x44')]===_0xdf1d('0x17')){logger[_0xdf1d('0x1f')](_0xdf1d('0x45'),_0x23c801,_0x1149b6[_0xdf1d('0x44')]);_0x5c89e7[_0xdf1d('0x3d')]=_0xf640ac!==''?_0xf640ac:util[_0xdf1d('0x49')](_0xdf1d('0x48'),_0x23c801);}else{return null;}}return _0x30faef[_0xdf1d('0x21')](_[_0xdf1d('0x4c')](_0x1149b6[_0xdf1d('0x44')]))[_0xdf1d('0x22')](_0x5c89e7)['then'](function(_0x2bc579){return BPromise[_0xdf1d('0x2d')]({'id':_0x2bc579['id'],'endUserType':_0x1149b6[_0xdf1d('0x44')]});});}});}function getCustomFields(_0x421cd0,_0x4b2179){var _0x3734fc={};if(_0x421cd0['length']>0x0){_[_0xdf1d('0x4d')](_0x421cd0,function(_0x75a132){if(_[_0xdf1d('0x4e')]([_0xdf1d('0x4f'),_0xdf1d('0x50')],_0x75a132[_0xdf1d('0x40')])&&_0x75a132[_0xdf1d('0x51')]){_0x3734fc[_0x75a132[_0xdf1d('0x51')]]=_0x75a132[_0xdf1d('0x52')][_0xdf1d('0x53')]();}else if(_0x75a132[_0xdf1d('0x40')]===_0xdf1d('0x54')&&_0x75a132[_0xdf1d('0x55')]&&_0x75a132[_0xdf1d('0x51')]){_0x4b2179[_0x75a132[_0xdf1d('0x55')]]&&(_0x3734fc[_0x75a132['idField']]=_0x4b2179[_0x75a132[_0xdf1d('0x55')]][_0xdf1d('0x53')]());}else if(_0x75a132[_0xdf1d('0x40')]===_0xdf1d('0x56')&&_0x75a132[_0xdf1d('0x57')]&&_0x75a132[_0xdf1d('0x57')][_0xdf1d('0x58')]&&_0x75a132[_0xdf1d('0x51')]){_0x4b2179[_0x75a132['Variable'][_0xdf1d('0x58')][_0xdf1d('0x41')]()]&&(_0x3734fc[_0x75a132[_0xdf1d('0x51')]]=_0x4b2179[_0x75a132[_0xdf1d('0x57')]['name']['toLowerCase']()][_0xdf1d('0x53')]());}});}return _0x3734fc;}function getConnection(_0x1dfe37){var _0x315d20=_0x1dfe37[_0xdf1d('0x59')][_0xdf1d('0x5a')](_0x1dfe37[_0xdf1d('0x5b')]);var _0x203a2a=new jsforce[(_0xdf1d('0x5c'))]({'oauth2':{'loginUrl':_0x1dfe37[_0xdf1d('0x5d')]||_0xdf1d('0x5e'),'clientId':_0x1dfe37[_0xdf1d('0x5f')],'clientSecret':_0x1dfe37[_0xdf1d('0x60')]}});return _0x203a2a['login'](_0x1dfe37['username'],_0x315d20)[_0xdf1d('0x27')](function(){logger['info'](_0xdf1d('0x61'));return _0x203a2a;});}exports[_0xdf1d('0x62')]=function(_0x4d4f88,_0x3e8d21,_0x55bbad,_0x19c593,_0x29b360,_0x504716){var _0x45cc83,_0x5f2e9b,_0x18dc5e,_0x29b159;_0x504716['serverUrl']=intUtil[_0xdf1d('0x63')](_0x504716[_0xdf1d('0x64')]);_0x504716[_0xdf1d('0x5d')]=intUtil['stripTrailingSlash'](_0x504716[_0xdf1d('0x5d')]);if(_0x29b360&&_0x29b360['monitor_format']){logger[_0xdf1d('0x1f')](_0xdf1d('0x65'),_0xdf1d('0x66'));_0x3e8d21['recordingURL']=util[_0xdf1d('0x49')](_0xdf1d('0x67'),_0x504716[_0xdf1d('0x64')],_0x3e8d21[_0xdf1d('0x68')],md5(_0x3e8d21['uniqueid']));}else{_0x3e8d21['recordingURL']='';}return getConnection(_0x504716)['then'](function(_0x5d780e){_0x29b159=_0x5d780e;return getUser(_0x504716,_0x19c593[_0xdf1d('0x69')],_0x29b159);})[_0xdf1d('0x27')](function(_0x57626){_0x45cc83=_0x57626;return getEndUser(_0x504716,_0x55bbad,_0x3e8d21['calleridname'],_0x3e8d21['calleridnum'],_0x29b159);})[_0xdf1d('0x27')](function(_0x85e284){_0x5f2e9b=_0x85e284;return getTicket(_0x504716,_0x45cc83,_0x5f2e9b,_0x55bbad,_0x3e8d21,_0x55bbad[_0xdf1d('0x6a')],_0x29b159,_0xdf1d('0x62'));})[_0xdf1d('0x27')](function(_0x39a3bb){_0x18dc5e=_0x39a3bb;logger['info'](_0xdf1d('0x6b'),_0x18dc5e['id']);logger[_0xdf1d('0x1f')](_0xdf1d('0x6c'),_0x18dc5e['id'],_0x19c593[_0xdf1d('0x58')],_0x504716[_0xdf1d('0x40')]);switch(_0x504716['type']){case _0xdf1d('0x6d'):emit(util['format']('user:%s',_0x19c593['name']),'trigger:salesforce:display',{'recordId':_0x18dc5e['id']});break;case'newTab':emit(util[_0xdf1d('0x49')](_0xdf1d('0x6e'),_0x19c593[_0xdf1d('0x58')]),_0xdf1d('0x6f'),{'uri':util[_0xdf1d('0x49')](_0xdf1d('0x70'),_0x29b159[_0xdf1d('0x71')],_0x18dc5e['id'])});break;default:logger[_0xdf1d('0x72')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})['catch'](function(_0x4b0f2b){logger[_0xdf1d('0x72')](_0xdf1d('0x65'),_0x4b0f2b);});};exports[_0xdf1d('0x73')]=function(_0x4a29f9,_0x8170c2,_0x3a322b,_0x1101c7,_0x474653,_0x37500c,_0x2345eb){var _0x51401c,_0xf261de,_0x24ae02,_0x378be2;_0x37500c['serverUrl']=intUtil[_0xdf1d('0x63')](_0x37500c['serverUrl']);_0x37500c[_0xdf1d('0x5d')]=intUtil[_0xdf1d('0x63')](_0x37500c[_0xdf1d('0x5d')]);if(_0x2345eb&&_0x2345eb[_0xdf1d('0x74')]&&_0x2345eb['recordingFormat']!==_0xdf1d('0x75')){logger[_0xdf1d('0x1f')](_0xdf1d('0x76'),_0xdf1d('0x66'));_0x8170c2[_0xdf1d('0x77')]=util['format'](_0xdf1d('0x67'),_0x37500c[_0xdf1d('0x64')],_0x8170c2['uniqueid'],md5(_0x8170c2[_0xdf1d('0x68')]));}return getConnection(_0x37500c)['then'](function(_0x1964b1){_0x378be2=_0x1964b1;return getUser(_0x37500c,_0x1101c7[_0xdf1d('0x69')],_0x378be2);})[_0xdf1d('0x27')](function(_0x5c9a39){_0x51401c=_0x5c9a39;return getEndUser(_0x37500c,_0x3a322b,_0x8170c2[_0xdf1d('0x78')],_0x8170c2[_0xdf1d('0x79')],_0x378be2);})[_0xdf1d('0x27')](function(_0xc8b72b){_0xf261de=_0xc8b72b;return getTicket(_0x37500c,_0x51401c,_0xf261de,_0x3a322b,_0x8170c2,_0x3a322b[_0xdf1d('0x6a')],_0x378be2,_0xdf1d('0x73'));})[_0xdf1d('0x27')](function(_0xc0d362){_0x24ae02=_0xc0d362;logger['info']('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x24ae02['id']);logger[_0xdf1d('0x1f')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x24ae02['id'],_0x1101c7['name'],_0x37500c[_0xdf1d('0x40')]);switch(_0x37500c['type']){case _0xdf1d('0x6d'):emit(util[_0xdf1d('0x49')](_0xdf1d('0x6e'),_0x1101c7[_0xdf1d('0x58')]),_0xdf1d('0x7a'),{'recordId':_0x24ae02['id']});break;case _0xdf1d('0x7b'):emit(util[_0xdf1d('0x49')](_0xdf1d('0x6e'),_0x1101c7[_0xdf1d('0x58')]),_0xdf1d('0x6f'),{'uri':util[_0xdf1d('0x49')](_0xdf1d('0x70'),_0x378be2['instanceUrl'],_0x24ae02['id'])});break;default:logger[_0xdf1d('0x72')]('[OUTBOUND]',_0xdf1d('0x7c'));}})[_0xdf1d('0x7d')](function(_0x5cc93d){logger[_0xdf1d('0x72')]('[OUTBOUND]',_0x5cc93d);});};exports[_0xdf1d('0x7e')]=function(_0x133b23,_0x3a5f4f,_0x54e698,_0x137694,_0x562d5b,_0x562643){var _0x209501,_0x14ec87,_0x8242d0,_0x2d9907;_0x562643[_0xdf1d('0x64')]=intUtil[_0xdf1d('0x63')](_0x562643[_0xdf1d('0x64')]);_0x562643[_0xdf1d('0x5d')]=intUtil['stripTrailingSlash'](_0x562643['remoteUri']);if(_0x562d5b&&_0x562d5b[_0xdf1d('0x7f')]){logger[_0xdf1d('0x1f')]('['+_0x3a5f4f['lastevent']['toUpperCase']()+']',_0xdf1d('0x66'));_0x3a5f4f['recordingURL']=util[_0xdf1d('0x49')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x562643['serverUrl'],_0x3a5f4f[_0xdf1d('0x68')],md5(_0x3a5f4f[_0xdf1d('0x68')]));}else{_0x3a5f4f[_0xdf1d('0x77')]='';}return getConnection(_0x562643)[_0xdf1d('0x27')](function(_0x2c9196){_0x2d9907=_0x2c9196;if(!_[_0xdf1d('0x80')](_0x137694)){return getUser(_0x562643,_0x137694[_0xdf1d('0x58')],_0x2d9907);}else{return getUser(_0x562643,null,_0x2d9907);}})[_0xdf1d('0x27')](function(_0x5c6197){_0x209501=_0x5c6197;return getEndUser(_0x562643,_0x54e698,_0x3a5f4f[_0xdf1d('0x81')],_0x3a5f4f[_0xdf1d('0x82')],_0x2d9907);})[_0xdf1d('0x27')](function(_0x44b751){_0x14ec87=_0x44b751;return getTicket(_0x562643,_0x209501,_0x14ec87,_0x54e698,_0x3a5f4f,_0x54e698[_0xdf1d('0x6a')],_0x2d9907);})[_0xdf1d('0x27')](function(_0x17fd15){_0x8242d0=_0x17fd15;logger[_0xdf1d('0x1f')]('['+_0x3a5f4f[_0xdf1d('0x83')][_0xdf1d('0x84')]()+']\x20Ticket\x20%s\x20created.',_0x8242d0['id']);logger['info']('['+_0x3a5f4f[_0xdf1d('0x83')][_0xdf1d('0x84')]()+_0xdf1d('0x85'),_0x562643[_0xdf1d('0x40')]);})[_0xdf1d('0x7d')](function(_0xd6d797){logger[_0xdf1d('0x72')]('['+_0x3a5f4f[_0xdf1d('0x83')][_0xdf1d('0x84')]()+']',_0xd6d797);});}; \ No newline at end of file +var _0x5139=['customVariable','Variable','name','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','queue','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','newTab','user:%s','%s/%s/e','instanceUrl','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','error','outbound','recordingFormat','[OUTBOUND]','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:browser:url','monitor_format','toUpperCase','isNil','calleridname',']\x20Ticket\x20%s\x20created.','lastevent',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/logger','salesforce','localhost','redis','getString','Subjects','Descriptions','ticketType','ActivityDate','IsRecurrence','endUserType','contact','lead','WhoId','account','WhatId','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','validateEmail','User','find','execute','length','Email','info','Agent\x20%s\x20found.','resolve','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','then','display_name','user_id','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','additionalSearchLead','$or','account_contact_lead','additionalSearchAccount','Account','first','Phone','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Caller\x20-\x20%s','LastName','','Company','Name','format','upperFirst','create','forEach','includes','string','picklist','idField','content','variable','variableName','toString'];(function(_0x276214,_0x18bfc8){var _0x557d8a=function(_0x1ba2e5){while(--_0x1ba2e5){_0x276214['push'](_0x276214['shift']());}};_0x557d8a(++_0x18bfc8);}(_0x5139,0x12d));var _0x9513=function(_0x18703c,_0x125f2a){_0x18703c=_0x18703c-0x0;var _0x29d475=_0x5139[_0x18703c];return _0x29d475;};'use strict';var _=require(_0x9513('0x0'));var rp=require(_0x9513('0x1'));var moment=require(_0x9513('0x2'));var BPromise=require(_0x9513('0x3'));var md5=require(_0x9513('0x4'));var jsforce=require(_0x9513('0x5'));var util=require(_0x9513('0x6'));var Redis=require(_0x9513('0x7'));var intUtil=require(_0x9513('0x8'));var config=require('../../../../config/environment');var logger=require(_0x9513('0x9'))(_0x9513('0xa'));config['redis']=_['defaults'](config['redis'],{'host':_0x9513('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9513('0xc')]));function emit(_0x3ca24e,_0x1d6364,_0x5421b9){io['to'](_0x3ca24e)['emit'](_0x1d6364,_0x5421b9);}function getTicket(_0x5ee9c8,_0x2030bf,_0x352ed4,_0x1863d5,_0x4944a2,_0x50e6b9,_0x402684,_0x35018e){var _0x3a16f2=Object['assign']({},{'OwnerId':_0x2030bf['id'],'Subject':intUtil[_0x9513('0xd')](_0x1863d5[_0x9513('0xe')],_0x4944a2,'\x20'),'Description':intUtil[_0x9513('0xd')](_0x1863d5[_0x9513('0xf')],_0x4944a2,'\x0a')},getCustomFields(_0x50e6b9,_0x4944a2));if(_0x352ed4){if(_0x1863d5[_0x9513('0x10')]==='Task'){_0x3a16f2[_0x9513('0x11')]=moment['utc']();_0x3a16f2['IsReminderSet']=![];_0x3a16f2[_0x9513('0x12')]=![];if(_0x352ed4[_0x9513('0x13')]===_0x9513('0x14')||_0x352ed4[_0x9513('0x13')]===_0x9513('0x15')){_0x3a16f2[_0x9513('0x16')]=_0x352ed4['id'];}else if(_0x352ed4[_0x9513('0x13')]===_0x9513('0x17')){_0x3a16f2[_0x9513('0x18')]=_0x352ed4['id'];}}else if(_0x1863d5[_0x9513('0x10')]==='Case'){if(_0x352ed4['endUserType']==='contact'){_0x3a16f2['ContactId']=_0x352ed4['id'];}else if(_0x352ed4[_0x9513('0x13')]===_0x9513('0x17')){_0x3a16f2['AccountId']=_0x352ed4['id'];}else if(_0x352ed4[_0x9513('0x13')]===_0x9513('0x15')&&_0x1863d5[_0x9513('0x19')]){_0x3a16f2[_0x1863d5['leadId']]=_0x352ed4['id'];}else{logger['info'](_0x9513('0x1a'));}}}return _0x402684[_0x9513('0x1b')](_0x1863d5[_0x9513('0x10')])['create'](_0x3a16f2);}function getUser(_0x171def,_0x5d1fd8,_0x2c04ff){if(!_['isNil'](_0x5d1fd8)&&intUtil[_0x9513('0x1c')](_0x5d1fd8)){var _0x278337={'Email':_0x5d1fd8};var _0x5772d9={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x2c04ff['sobject'](_0x9513('0x1d'))[_0x9513('0x1e')](_0x278337,_0x5772d9)[_0x9513('0x1f')]()['then'](function(_0x374be9){if(_0x374be9[_0x9513('0x20')]){var _0x14634b=_[_0x9513('0x1e')](_0x374be9,function(_0x5792af){return _0x5792af[_0x9513('0x21')]===_0x5d1fd8;});if(_0x14634b){logger[_0x9513('0x22')](_0x9513('0x23'),_0x5d1fd8);return BPromise[_0x9513('0x24')]({'id':_0x14634b['Id'],'name':_0x14634b['Name']});}}else{logger[_0x9513('0x22')](_0x9513('0x25'),_0x5d1fd8);return _0x2c04ff[_0x9513('0x26')]()[_0x9513('0x27')](function(_0x2fb635){return BPromise[_0x9513('0x24')]({'id':_0x2fb635['user_id'],'name':_0x2fb635[_0x9513('0x28')]});});}});}else{logger[_0x9513('0x22')](_0x9513('0x25'),_0x5d1fd8);return _0x2c04ff['identity']()[_0x9513('0x27')](function(_0xacfed2){return BPromise[_0x9513('0x24')]({'id':_0xacfed2[_0x9513('0x29')],'name':_0xacfed2[_0x9513('0x28')]});});}}function getEndUser(_0x29d2e5,_0x124d1b,_0x430395,_0x90505d,_0x666e4a){var _0x4b5b8b={'$or':{'Phone':_0x90505d}};var _0x1e3422={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x9513('0x24')]()[_0x9513('0x27')](function(){logger[_0x9513('0x22')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x90505d,_0x124d1b[_0x9513('0x2a')]);switch(_0x124d1b[_0x9513('0x2a')]){case _0x9513('0x2b'):var _0x5573f5=_[_0x9513('0x2c')](_0x4b5b8b);if(_0x124d1b[_0x9513('0x2d')]){var _0x4c5f97={};_0x4c5f97[_0x124d1b[_0x9513('0x2d')]]=_0x90505d;_[_0x9513('0x2e')](_0x5573f5['$or'],_0x4c5f97);}return _0x666e4a[_0x9513('0x1b')]('Contact')[_0x9513('0x1e')](_0x5573f5,_0x1e3422)['execute']()['then'](function(_0x3dfa4c){if(_0x3dfa4c&&_0x3dfa4c['length']){return _0x3dfa4c;}else{var _0x1e3fac=_[_0x9513('0x2c')](_0x4b5b8b);if(_0x124d1b['additionalSearchLead']){var _0x3d4c6b={};_0x3d4c6b[_0x124d1b[_0x9513('0x2f')]]=_0x90505d;_['merge'](_0x1e3fac[_0x9513('0x30')],_0x3d4c6b);}return _0x666e4a[_0x9513('0x1b')]('Lead')[_0x9513('0x1e')](_0x1e3fac,_0x1e3422);}});case _0x9513('0x31'):var _0x2e948e=_[_0x9513('0x2c')](_0x4b5b8b);if(_0x124d1b[_0x9513('0x32')]){var _0x4c5f97={};_0x4c5f97[_0x124d1b[_0x9513('0x32')]]=_0x90505d;_[_0x9513('0x2e')](_0x2e948e[_0x9513('0x30')],_0x4c5f97);}return _0x666e4a[_0x9513('0x1b')](_0x9513('0x33'))[_0x9513('0x1e')](_0x2e948e,_0x1e3422)[_0x9513('0x1f')]()[_0x9513('0x27')](function(_0x533d46){if(_0x533d46&&_0x533d46[_0x9513('0x20')]){return _0x533d46;}else{var _0x2633b0=_['cloneDeep'](_0x4b5b8b);if(_0x124d1b[_0x9513('0x2d')]){var _0x2106f8={};_0x2106f8[_0x124d1b['additionalSearchContact']]=_0x90505d;_[_0x9513('0x2e')](_0x2633b0[_0x9513('0x30')],_0x2106f8);}return _0x666e4a[_0x9513('0x1b')]('Contact')[_0x9513('0x1e')](_0x2633b0,_0x1e3422)[_0x9513('0x27')](function(_0x5ef917){if(_0x5ef917&&_0x5ef917[_0x9513('0x20')]){return _0x5ef917;}else{var _0x5148f2=_[_0x9513('0x2c')](_0x4b5b8b);if(_0x124d1b['additionalSearchLead']){var _0x431764={};_0x431764[_0x124d1b[_0x9513('0x2f')]]=_0x90505d;_['merge'](_0x5148f2['$or'],_0x431764);}return _0x666e4a[_0x9513('0x1b')]('Lead')[_0x9513('0x1e')](_0x5148f2,_0x1e3422);}});}});case _0x9513('0x14'):var _0x5573f5=_[_0x9513('0x2c')](_0x4b5b8b);if(_0x124d1b[_0x9513('0x2d')]){var _0x4c5f97={};_0x4c5f97[_0x124d1b[_0x9513('0x2d')]]=_0x90505d;_[_0x9513('0x2e')](_0x5573f5[_0x9513('0x30')],_0x4c5f97);}return _0x666e4a['sobject']('Contact')[_0x9513('0x1e')](_0x5573f5,_0x1e3422)[_0x9513('0x1f')]();case'lead':var _0x4af5a1=_['cloneDeep'](_0x4b5b8b);if(_0x124d1b[_0x9513('0x2f')]){var _0x4c5f97={};_0x4c5f97[_0x124d1b['additionalSearchLead']]=_0x90505d;_[_0x9513('0x2e')](_0x4af5a1[_0x9513('0x30')],_0x4c5f97);}return _0x666e4a[_0x9513('0x1b')]('Lead')['find'](_0x4af5a1,_0x1e3422);case _0x9513('0x17'):var _0x2e948e=_[_0x9513('0x2c')](_0x4b5b8b);if(_0x124d1b[_0x9513('0x32')]){var _0x4c5f97={};_0x4c5f97[_0x124d1b['additionalSearchAccount']]=_0x90505d;_[_0x9513('0x2e')](_0x2e948e[_0x9513('0x30')],_0x4c5f97);}return _0x666e4a[_0x9513('0x1b')]('Account')[_0x9513('0x1e')](_0x2e948e,_0x1e3422);default:return null;}})[_0x9513('0x27')](function(_0x164e3f){if(_0x164e3f&&_0x164e3f[_0x9513('0x20')]){var _0x34f683=_[_0x9513('0x34')](_0x164e3f);if(_0x34f683){return BPromise[_0x9513('0x24')]({'id':_0x34f683['Id'],'name':_0x34f683['Name'],'phone':_0x34f683[_0x9513('0x35')],'endUserType':_0x34f683['attributes'][_0x9513('0x36')][_0x9513('0x37')]()});}}})[_0x9513('0x27')](function(_0x483f02){if(_0x483f02){logger[_0x9513('0x22')](_0x9513('0x38'),_0x483f02[_0x9513('0x13')],_0x90505d);return BPromise[_0x9513('0x24')](_0x483f02);}else{logger[_0x9513('0x22')](_0x9513('0x39'),_0x90505d);var _0xd52f00={'Phone':_0x90505d};if(_0x124d1b[_0x9513('0x3a')]){if(_0x124d1b[_0x9513('0x3a')]===_0x9513('0x14')){logger['info'](_0x9513('0x3b'),_0x90505d,_0x124d1b[_0x9513('0x3a')]);_0xd52f00['LastName']=_0x430395!==''?_0x430395:util['format'](_0x9513('0x3c'),_0x90505d);}else if(_0x124d1b[_0x9513('0x3a')]===_0x9513('0x15')){logger[_0x9513('0x22')](_0x9513('0x3b'),_0x90505d,_0x124d1b['moduleCreate']);_0xd52f00[_0x9513('0x3d')]=_0x430395!==_0x9513('0x3e')?_0x430395:util['format'](_0x9513('0x3c'),_0x90505d);_0xd52f00[_0x9513('0x3f')]='No\x20Company';}else if(_0x124d1b[_0x9513('0x3a')]===_0x9513('0x17')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x90505d,_0x124d1b[_0x9513('0x3a')]);_0xd52f00[_0x9513('0x40')]=_0x430395!==_0x9513('0x3e')?_0x430395:util[_0x9513('0x41')](_0x9513('0x3c'),_0x90505d);}else{return null;}}return _0x666e4a['sobject'](_[_0x9513('0x42')](_0x124d1b['moduleCreate']))[_0x9513('0x43')](_0xd52f00)[_0x9513('0x27')](function(_0x565a74){return BPromise[_0x9513('0x24')]({'id':_0x565a74['id'],'endUserType':_0x124d1b[_0x9513('0x3a')]});});}});}function getCustomFields(_0x5bc1f7,_0x19ae7c){var _0x54c23a={};if(_0x5bc1f7[_0x9513('0x20')]>0x0){_[_0x9513('0x44')](_0x5bc1f7,function(_0x573920){if(_[_0x9513('0x45')]([_0x9513('0x46'),_0x9513('0x47')],_0x573920[_0x9513('0x36')])&&_0x573920[_0x9513('0x48')]){_0x54c23a[_0x573920[_0x9513('0x48')]]=_0x573920[_0x9513('0x49')]['toString']();}else if(_0x573920[_0x9513('0x36')]===_0x9513('0x4a')&&_0x573920[_0x9513('0x4b')]&&_0x573920[_0x9513('0x48')]){_0x19ae7c[_0x573920[_0x9513('0x4b')]]&&(_0x54c23a[_0x573920[_0x9513('0x48')]]=_0x19ae7c[_0x573920[_0x9513('0x4b')]][_0x9513('0x4c')]());}else if(_0x573920[_0x9513('0x36')]===_0x9513('0x4d')&&_0x573920['Variable']&&_0x573920[_0x9513('0x4e')][_0x9513('0x4f')]&&_0x573920[_0x9513('0x48')]){_0x19ae7c[_0x573920[_0x9513('0x4e')][_0x9513('0x4f')][_0x9513('0x37')]()]&&(_0x54c23a[_0x573920[_0x9513('0x48')]]=_0x19ae7c[_0x573920[_0x9513('0x4e')][_0x9513('0x4f')][_0x9513('0x37')]()][_0x9513('0x4c')]());}});}return _0x54c23a;}function getConnection(_0x40528d){var _0x59a29b=_0x40528d[_0x9513('0x50')][_0x9513('0x51')](_0x40528d[_0x9513('0x52')]);var _0xbaf48=new jsforce[(_0x9513('0x53'))]({'oauth2':{'loginUrl':_0x40528d[_0x9513('0x54')]||_0x9513('0x55'),'clientId':_0x40528d[_0x9513('0x56')],'clientSecret':_0x40528d[_0x9513('0x57')]}});return _0xbaf48[_0x9513('0x58')](_0x40528d[_0x9513('0x59')],_0x59a29b)[_0x9513('0x27')](function(){logger['info']('Connection\x20established.');return _0xbaf48;});}exports[_0x9513('0x5a')]=function(_0x1a8f00,_0x34b398,_0x44877a,_0x54f1bd,_0x3b29a2,_0x49d083){var _0xf9739f,_0x176aee,_0x29dc71,_0x10989f;_0x49d083[_0x9513('0x5b')]=intUtil[_0x9513('0x5c')](_0x49d083['serverUrl']);_0x49d083['remoteUri']=intUtil['stripTrailingSlash'](_0x49d083[_0x9513('0x54')]);if(_0x3b29a2&&_0x3b29a2['monitor_format']){logger[_0x9513('0x22')](_0x9513('0x5d'),_0x9513('0x5e'));_0x34b398[_0x9513('0x5f')]=util[_0x9513('0x41')](_0x9513('0x60'),_0x49d083['serverUrl'],_0x34b398[_0x9513('0x61')],md5(_0x34b398[_0x9513('0x61')]));}else{_0x34b398[_0x9513('0x5f')]='';}return getConnection(_0x49d083)[_0x9513('0x27')](function(_0xccc2a){_0x10989f=_0xccc2a;return getUser(_0x49d083,_0x54f1bd[_0x9513('0x62')],_0x10989f);})[_0x9513('0x27')](function(_0x2225e5){_0xf9739f=_0x2225e5;return getEndUser(_0x49d083,_0x44877a,_0x34b398['calleridname'],_0x34b398[_0x9513('0x63')],_0x10989f);})[_0x9513('0x27')](function(_0x6b44d8){_0x176aee=_0x6b44d8;return getTicket(_0x49d083,_0xf9739f,_0x176aee,_0x44877a,_0x34b398,_0x44877a[_0x9513('0x64')],_0x10989f,_0x9513('0x5a'));})[_0x9513('0x27')](function(_0x435a92){_0x29dc71=_0x435a92;logger[_0x9513('0x22')](_0x9513('0x65'),_0x29dc71['id']);logger[_0x9513('0x22')](_0x9513('0x66'),_0x29dc71['id'],_0x54f1bd['name'],_0x49d083[_0x9513('0x36')]);switch(_0x49d083[_0x9513('0x36')]){case _0x9513('0x67'):emit(util[_0x9513('0x41')]('user:%s',_0x54f1bd[_0x9513('0x4f')]),_0x9513('0x68'),{'recordId':_0x29dc71['id']});break;case _0x9513('0x69'):emit(util[_0x9513('0x41')](_0x9513('0x6a'),_0x54f1bd['name']),'trigger:browser:url',{'uri':util[_0x9513('0x41')](_0x9513('0x6b'),_0x10989f[_0x9513('0x6c')],_0x29dc71['id'])});break;default:logger['error'](_0x9513('0x6d'));}})[_0x9513('0x6e')](function(_0x21676a){logger[_0x9513('0x6f')]('[QUEUE]',_0x21676a);});};exports[_0x9513('0x70')]=function(_0xa00b5d,_0x1004bc,_0x30f6d9,_0x528c96,_0x1f02da,_0x4007ff,_0xa4e4eb){var _0x285558,_0x3e9b1b,_0x4b541f,_0x4a13ad;_0x4007ff['serverUrl']=intUtil[_0x9513('0x5c')](_0x4007ff[_0x9513('0x5b')]);_0x4007ff[_0x9513('0x54')]=intUtil[_0x9513('0x5c')](_0x4007ff['remoteUri']);if(_0xa4e4eb&&_0xa4e4eb[_0x9513('0x71')]&&_0xa4e4eb[_0x9513('0x71')]!=='none'){logger[_0x9513('0x22')](_0x9513('0x72'),_0x9513('0x5e'));_0x1004bc[_0x9513('0x5f')]=util[_0x9513('0x41')](_0x9513('0x60'),_0x4007ff[_0x9513('0x5b')],_0x1004bc[_0x9513('0x61')],md5(_0x1004bc[_0x9513('0x61')]));}return getConnection(_0x4007ff)['then'](function(_0x2dfd48){_0x4a13ad=_0x2dfd48;return getUser(_0x4007ff,_0x528c96[_0x9513('0x62')],_0x4a13ad);})[_0x9513('0x27')](function(_0x37fe87){_0x285558=_0x37fe87;return getEndUser(_0x4007ff,_0x30f6d9,_0x1004bc['destcalleridname'],_0x1004bc[_0x9513('0x73')],_0x4a13ad);})[_0x9513('0x27')](function(_0x26492){_0x3e9b1b=_0x26492;return getTicket(_0x4007ff,_0x285558,_0x3e9b1b,_0x30f6d9,_0x1004bc,_0x30f6d9[_0x9513('0x64')],_0x4a13ad,_0x9513('0x70'));})['then'](function(_0x46ffcd){_0x4b541f=_0x46ffcd;logger[_0x9513('0x22')](_0x9513('0x74'),_0x4b541f['id']);logger['info'](_0x9513('0x75'),_0x4b541f['id'],_0x528c96[_0x9513('0x4f')],_0x4007ff[_0x9513('0x36')]);switch(_0x4007ff[_0x9513('0x36')]){case _0x9513('0x67'):emit(util[_0x9513('0x41')](_0x9513('0x6a'),_0x528c96[_0x9513('0x4f')]),'trigger:salesforce:display',{'recordId':_0x4b541f['id']});break;case _0x9513('0x69'):emit(util[_0x9513('0x41')](_0x9513('0x6a'),_0x528c96['name']),_0x9513('0x76'),{'uri':util['format'](_0x9513('0x6b'),_0x4a13ad[_0x9513('0x6c')],_0x4b541f['id'])});break;default:logger['error'](_0x9513('0x72'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0x9513('0x6e')](function(_0x4b790e){logger[_0x9513('0x6f')](_0x9513('0x72'),_0x4b790e);});};exports['unmanaged']=function(_0x194909,_0x50bc16,_0x227f21,_0x12127c,_0x3c2f22,_0x120cf7){var _0x531cff,_0x215849,_0x467f64,_0x6d7b4c;_0x120cf7['serverUrl']=intUtil[_0x9513('0x5c')](_0x120cf7[_0x9513('0x5b')]);_0x120cf7['remoteUri']=intUtil[_0x9513('0x5c')](_0x120cf7['remoteUri']);if(_0x3c2f22&&_0x3c2f22[_0x9513('0x77')]){logger[_0x9513('0x22')]('['+_0x50bc16['lastevent'][_0x9513('0x78')]()+']',_0x9513('0x5e'));_0x50bc16[_0x9513('0x5f')]=util['format'](_0x9513('0x60'),_0x120cf7[_0x9513('0x5b')],_0x50bc16[_0x9513('0x61')],md5(_0x50bc16['uniqueid']));}else{_0x50bc16[_0x9513('0x5f')]='';}return getConnection(_0x120cf7)['then'](function(_0x249bdd){_0x6d7b4c=_0x249bdd;if(!_[_0x9513('0x79')](_0x12127c)){return getUser(_0x120cf7,_0x12127c[_0x9513('0x4f')],_0x6d7b4c);}else{return getUser(_0x120cf7,null,_0x6d7b4c);}})[_0x9513('0x27')](function(_0xf858ee){_0x531cff=_0xf858ee;return getEndUser(_0x120cf7,_0x227f21,_0x50bc16[_0x9513('0x7a')],_0x50bc16[_0x9513('0x63')],_0x6d7b4c);})[_0x9513('0x27')](function(_0x13d726){_0x215849=_0x13d726;return getTicket(_0x120cf7,_0x531cff,_0x215849,_0x227f21,_0x50bc16,_0x227f21[_0x9513('0x64')],_0x6d7b4c);})[_0x9513('0x27')](function(_0x305576){_0x467f64=_0x305576;logger[_0x9513('0x22')]('['+_0x50bc16['lastevent']['toUpperCase']()+_0x9513('0x7b'),_0x467f64['id']);logger[_0x9513('0x22')]('['+_0x50bc16[_0x9513('0x7c')][_0x9513('0x78')]()+_0x9513('0x7d'),_0x120cf7[_0x9513('0x36')]);})['catch'](function(_0x14251b){logger[_0x9513('0x6f')]('['+_0x50bc16['lastevent'][_0x9513('0x78')]()+']',_0x14251b);});}; \ 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 157e036..77f63f5 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 _0xa215=['recordingFormat','none','[OUTBOUND]','recordingURL','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','request-promise','util','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','adminId','sys_id','toUpperCase','],\x20getAdminUser\x20crm','error','message','info','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','length','active','true','userId','adminEmail','catch','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','endUserId','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','picklist','type','nameField','customField','toLowerCase','content','toString','includes','string','idField','variableName','customVariable','name','outbound','assign','Subjects','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','?sysparm_query=name%3D','label_entry','incident','Incident','Incident\x20-\x20','push','all','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','format','emit','trigger:browser:url','password','sysparm_display_value=true','serverUrl','%s/api/now/table/','remoteUri','isNil','email','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!'];(function(_0x219bd1,_0x977bf){var _0x5ddf55=function(_0x5b3394){while(--_0x5b3394){_0x219bd1['push'](_0x219bd1['shift']());}};_0x5ddf55(++_0x977bf);}(_0xa215,0x142));var _0x5a21=function(_0x57171b,_0xfe67c6){_0x57171b=_0x57171b-0x0;var _0x33a2c8=_0xa215[_0x57171b];return _0x33a2c8;};'use strict';var _=require(_0x5a21('0x0'));var Promise=require('bluebird');var rp=require(_0x5a21('0x1'));var util=require(_0x5a21('0x2'));var md5=require('md5');var Redis=require(_0x5a21('0x3'));var intUtil=require('./util');var config=require(_0x5a21('0x4'));var logger=require(_0x5a21('0x5'))(_0x5a21('0x6'));config[_0x5a21('0x7')]=_['defaults'](config[_0x5a21('0x7')],{'host':_0x5a21('0x8'),'port':0x18eb});var io=require(_0x5a21('0x9'))(new Redis(config[_0x5a21('0x7')]));function getAdminUser(_0xd63df3,_0x35a928,_0x372946,_0x403ad5,_0x4dcdad,_0x41bbc8){return new Promise(function(_0x3c5fc0,_0x214909){var _0x59012e={'method':_0x5a21('0xa'),'uri':_0x403ad5+_0x5a21('0xb')+'&'+_0x4dcdad+'&'+_0x41bbc8,'auth':_0x35a928,'json':!![]};return rp(_0x59012e)[_0x5a21('0xc')](function(_0x199fd6){if(_0x199fd6[_0x5a21('0xd')]['length']>0x0){_0x372946[_0x5a21('0xe')]=_0x199fd6[_0x5a21('0xd')][0x0][_0x5a21('0xf')];}logger['info']('['+[_0xd63df3[_0x5a21('0x10')]()]+_0x5a21('0x11'),_0x372946);_0x3c5fc0(_0x372946);})['catch'](function(_0x1228ff){logger[_0x5a21('0x12')]('['+[_0xd63df3[_0x5a21('0x10')]()]+']',_0x1228ff[_0x5a21('0x13')]);_0x214909(_0x1228ff['message']);});});}function getUser(_0x5d2f6c,_0x11c439,_0x4187c4,_0x2c8a74,_0x50f722){return function(_0x57c74a){logger[_0x5a21('0x14')]('['+[_0x5d2f6c[_0x5a21('0x10')]()]+'],\x20getUser\x20input\x20crm',_0x57c74a);return new Promise(function(_0x4de2eb,_0xf2ec12){if(intUtil[_0x5a21('0x15')](_0x57c74a[_0x5a21('0x16')])){var _0x462117={'method':_0x5a21('0xa'),'uri':_0x4187c4+_0x5a21('0x17')+_0x57c74a[_0x5a21('0x16')]+'&'+_0x2c8a74+'&'+_0x50f722,'auth':_0x11c439,'json':!![]};logger[_0x5a21('0x14')]('['+[_0x5d2f6c[_0x5a21('0x10')]()]+_0x5a21('0x18'),_0x462117);return rp(_0x462117)[_0x5a21('0xc')](function(_0x522dad){logger[_0x5a21('0x14')]('['+[_0x5d2f6c[_0x5a21('0x10')]()]+_0x5a21('0x19'),_0x522dad);if(_0x522dad[_0x5a21('0xd')][_0x5a21('0x1a')]>0x0&&String(_0x522dad[_0x5a21('0xd')][0x0][_0x5a21('0x1b')])===_0x5a21('0x1c')){_0x57c74a[_0x5a21('0x1d')]=_0x522dad[_0x5a21('0xd')][0x0][_0x5a21('0xf')];}else{_0x57c74a[_0x5a21('0x1d')]=_0x57c74a[_0x5a21('0xe')];_0x57c74a['userEmail']=_0x57c74a[_0x5a21('0x1e')];}logger['info']('['+[_0x5d2f6c[_0x5a21('0x10')]()]+'],\x20getUser\x20crm',_0x57c74a);_0x4de2eb(_0x57c74a);})[_0x5a21('0x1f')](function(_0x527fb1){logger['error']('['+[_0x5d2f6c[_0x5a21('0x10')]()]+']',_0x527fb1[_0x5a21('0x13')]);_0xf2ec12(_0x527fb1['message']);});}else{logger[_0x5a21('0x14')]('['+[_0x5d2f6c['toUpperCase']()]+']\x20using\x20admin\x20profile');_0x57c74a[_0x5a21('0x1d')]=_0x57c74a[_0x5a21('0xe')];_0x57c74a[_0x5a21('0x16')]=_0x57c74a[_0x5a21('0x1e')];_0x4de2eb(_0x57c74a);}});};}function createEndUser(_0x114ef3,_0x4105af,_0x12095d,_0x445c33,_0x57282){logger[_0x5a21('0x14')]('['+[_0x114ef3[_0x5a21('0x10')]()]+_0x5a21('0x20'),_0x12095d);return new Promise(function(_0x1cc147,_0x1ee990){var _0x10ea24={'method':_0x5a21('0x21'),'uri':_0x445c33+_0x5a21('0x22')+_0x57282,'body':{'user_name':_0x12095d[_0x5a21('0x23')],'roles':_0x5a21('0x24'),'first_name':_0x12095d[_0x5a21('0x23')],'active':_0x5a21('0x1c'),'date_format':_0x5a21('0x25'),'phone':_0x12095d[_0x5a21('0x23')]},'auth':_0x4105af,'json':!![]};return rp(_0x10ea24)['then'](function(_0x19d25d){logger[_0x5a21('0x14')]('['+[_0x114ef3[_0x5a21('0x10')]()]+'],\x20EndUser\x20schema',_0x19d25d[_0x5a21('0xd')]);_0x12095d[_0x5a21('0x26')]=_0x19d25d[_0x5a21('0xd')][_0x5a21('0xf')];_0x1cc147(_0x12095d);})[_0x5a21('0x1f')](function(_0x29ff22){logger[_0x5a21('0x12')]('['+[_0x114ef3['toUpperCase']()]+']',_0x29ff22[_0x5a21('0x13')]);_0x1ee990(_0x29ff22[_0x5a21('0x13')]);});});}function getEndUser(_0x5a5830,_0x3f6371,_0x498d4c,_0xe76b09,_0x14858f){return function(_0x2915dd){logger[_0x5a21('0x14')]('['+[_0x5a5830[_0x5a21('0x10')]()]+'],\x20getEndUser\x20input\x20crm',_0x2915dd);return new Promise(function(_0x261357,_0x465815){var _0x4f3c83={'method':'GET','uri':_0x498d4c+_0x5a21('0x27')+_0x2915dd['endUserNumber']+'&'+_0xe76b09+'&'+_0x14858f,'auth':_0x3f6371,'json':!![]};return rp(_0x4f3c83)[_0x5a21('0xc')](function(_0x4113c0){if(_0x4113c0[_0x5a21('0xd')][_0x5a21('0x1a')]>0x0){_0x2915dd[_0x5a21('0x26')]=_0x4113c0[_0x5a21('0xd')][0x0][_0x5a21('0xf')];logger['info']('['+[_0x5a5830['toUpperCase']()]+_0x5a21('0x28'),_0x2915dd);_0x261357(_0x2915dd);}else{return createEndUser(_0x5a5830,_0x3f6371,_0x2915dd,_0x498d4c,_0xe76b09)[_0x5a21('0xc')](function(_0x497ca8){logger[_0x5a21('0x14')]('['+[_0x5a5830[_0x5a21('0x10')]()]+_0x5a21('0x29'),_0x497ca8);_0x261357(_0x497ca8);});}})[_0x5a21('0x1f')](function(_0x194934){logger[_0x5a21('0x12')]('['+[_0x5a5830[_0x5a21('0x10')]()]+']',_0x194934[_0x5a21('0x13')]);_0x465815(_0x194934[_0x5a21('0x13')]);});});};}function getCustomFields(_0x54ae84,_0x5b4ae6){var _0x5a0939={};if(_0x54ae84[_0x5a21('0x1a')]>0x0){_[_0x5a21('0x2a')](_0x54ae84,function(_0x51afda){if(_['includes'](['string',_0x5a21('0x2b')],_0x51afda[_0x5a21('0x2c')])&&_0x51afda[_0x5a21('0x2d')]&&!_0x51afda[_0x5a21('0x2e')]){_0x5a0939[_0x51afda[_0x5a21('0x2d')][_0x5a21('0x2f')]()]=_0x51afda[_0x5a21('0x30')][_0x5a21('0x31')]();}else if(_[_0x5a21('0x32')]([_0x5a21('0x33'),'picklist'],_0x51afda[_0x5a21('0x2c')])&&_0x51afda['idField']&&_0x51afda[_0x5a21('0x2e')]){_0x5a0939[_0x51afda[_0x5a21('0x34')][_0x5a21('0x2f')]()]=_0x51afda[_0x5a21('0x30')][_0x5a21('0x31')]();}else if(_0x51afda[_0x5a21('0x2c')]==='variable'&&_0x51afda[_0x5a21('0x35')]&&_0x51afda[_0x5a21('0x34')]&&_0x51afda[_0x5a21('0x2e')]){_0x5a0939[_0x51afda[_0x5a21('0x34')][_0x5a21('0x2f')]()]=_0x5b4ae6[_0x51afda[_0x5a21('0x35')]][_0x5a21('0x31')]();}else if(_0x51afda[_0x5a21('0x2c')]===_0x5a21('0x36')&&_0x51afda['Variable']&&_0x51afda['Variable'][_0x5a21('0x37')]&&_0x51afda[_0x5a21('0x34')]&&_0x51afda[_0x5a21('0x2e')]){_0x5a0939[_0x51afda[_0x5a21('0x34')][_0x5a21('0x2f')]()]=_0x5b4ae6[_0x51afda['Variable'][_0x5a21('0x37')][_0x5a21('0x2f')]()][_0x5a21('0x31')]();}});}return _0x5a0939;}function getTicket(_0x5d9b35,_0x244a98,_0x3d478c,_0x44b3cb,_0x38510b,_0x2d4ea6){return function(_0x40bf7f){logger['info']('['+[_0x5d9b35[_0x5a21('0x10')]()]+']\x20getTicket\x20input\x20crm',_0x40bf7f);return new Promise(function(_0x5e2786,_0x7b05d1){var _0x48865f=_0x5d9b35[_0x5a21('0x2f')]()===_0x5a21('0x38')?_0x40bf7f['userId']:_0x40bf7f['endUserId'];var _0x5a2df5={'method':_0x5a21('0x21'),'uri':_0x3d478c+'incident'+'?'+_0x2d4ea6,'body':Object[_0x5a21('0x39')]({},{'active':_0x5a21('0x1c'),'caller_id':_0x48865f,'assigned_to':_0x40bf7f[_0x5a21('0x1d')],'short_description':intUtil['getString'](_0x44b3cb[_0x5a21('0x3a')],_0x38510b,'\x20'),'description':intUtil[_0x5a21('0x3b')](_0x44b3cb[_0x5a21('0x3c')],_0x38510b,'\x0a')},getCustomFields(_0x44b3cb[_0x5a21('0x3d')],_0x38510b)),'auth':_0x244a98,'json':!![]};return rp(_0x5a2df5)[_0x5a21('0xc')](function(_0x5068af){logger[_0x5a21('0x14')]('['+[_0x5d9b35[_0x5a21('0x10')]()]+_0x5a21('0x3e'),_0x5068af[_0x5a21('0xd')]);_0x40bf7f[_0x5a21('0x3f')]=_0x5068af[_0x5a21('0xd')][_0x5a21('0xf')];_0x40bf7f[_0x5a21('0x40')]=_0x5068af[_0x5a21('0xd')][_0x5a21('0x41')];logger[_0x5a21('0x14')]('['+[_0x5d9b35['toUpperCase']()]+_0x5a21('0x42'),_0x40bf7f);_0x5e2786(_0x40bf7f);})[_0x5a21('0x1f')](function(_0x54393b){logger['error']('['+[_0x5d9b35[_0x5a21('0x10')]()]+']',_0x54393b['message']);_0x7b05d1(_0x54393b[_0x5a21('0x13')]);});});};}function createRemoteTag(_0xf1a27f,_0x5f44a8,_0x56d16d,_0x4edcf3){return new Promise(function(_0x1c3932,_0x4d3b49){var _0x924f69={'method':_0x5a21('0x21'),'uri':_0x56d16d+'label'+'?'+_0x4edcf3,'body':{'short_description':_0xf1a27f,'global':!![],'active':!![],'name':_0xf1a27f},'auth':_0x5f44a8,'json':!![]};return rp(_0x924f69)[_0x5a21('0xc')](function(_0x1af5d0){var _0x24bf4d=_0x1af5d0[_0x5a21('0xd')]['sys_id'];_0x1c3932(_0x24bf4d);});});}function getRemoteTag(_0x349fec,_0x726572,_0x7d543a,_0x23eba,_0x2fcf12){return new Promise(function(_0x39b9ce,_0x54438e){var _0xaec4a0={'method':'GET','uri':_0x7d543a+'label'+_0x5a21('0x43')+_0x349fec+'&'+_0x23eba,'auth':_0x726572,'json':!![]};return rp(_0xaec4a0)['then'](function(_0x491915){if(_0x491915[_0x5a21('0xd')][_0x5a21('0x1a')]>0x0){var _0x506f28=_0x491915[_0x5a21('0xd')][0x0][_0x5a21('0xf')];_0x39b9ce(_0x506f28);}else{return createRemoteTag(_0x349fec,_0x726572,_0x7d543a,_0x23eba)[_0x5a21('0xc')](function(_0x36cb97){_0x39b9ce(_0x36cb97);});}});});}function assignTagToIncident(_0x5888b5,_0x25e31c,_0x23afe6,_0x1dbde1,_0x48bc2d){return new Promise(function(_0x5912bb,_0x54368f){var _0x209be7={'method':_0x5a21('0x21'),'uri':_0x23afe6+_0x5a21('0x44')+'?'+_0x48bc2d,'body':{'label':_0x5888b5,'table':_0x5a21('0x45'),'id_type':_0x5a21('0x46'),'table_key':_0x1dbde1['ticketId'],'title':_0x5a21('0x47')+_0x1dbde1[_0x5a21('0x40')],'id_display':_0x1dbde1[_0x5a21('0x40')]},'auth':_0x25e31c,'json':!![]};return rp(_0x209be7)['then'](function(_0x49a2f1){_0x5912bb();})[_0x5a21('0x1f')](function(){_0x5912bb();});});}function manageTags(_0x450dcc,_0xd34462,_0x3ac215,_0xe357fb,_0x80ef53,_0x218648,_0x37c66f){return new Promise(function(_0x325bc2,_0x398a36){var _0x514721=[];_0xd34462[_0x5a21('0x2a')](function(_0x6996d5){_0x514721[_0x5a21('0x48')](getRemoteTag(_0x6996d5,_0x3ac215,_0xe357fb,_0x218648,_0x37c66f));});return Promise[_0x5a21('0x49')](_0x514721)[_0x5a21('0xc')](function(_0x2be042){if(_0x2be042[_0x5a21('0x1a')]){logger[_0x5a21('0x14')]('['+[_0x450dcc[_0x5a21('0x10')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x2be042);var _0x9d46e=[];_0x2be042['forEach'](function(_0x412d08){_0x9d46e[_0x5a21('0x48')](assignTagToIncident(_0x412d08,_0x3ac215,_0xe357fb,_0x80ef53,_0x218648));});return Promise['all'](_0x9d46e)[_0x5a21('0xc')](function(){_0x325bc2();})[_0x5a21('0x1f')](function(){_0x325bc2();});}else{_0x325bc2();}});});}function getTags(_0x1fc5fe,_0x3b736c,_0x6dddbb,_0x288016,_0x333b52,_0x5d5a76){return function(_0x4b644d){return new Promise(function(_0x471d5d,_0x14cadb){var _0x39e551=[];var _0x413a9a=_0x288016[_0x5a21('0x4a')];if(_0x413a9a&&_0x413a9a[_0x5a21('0x1a')]>0x0){_0x39e551=_['map'](_0x413a9a,'name');}if(_0x39e551[_0x5a21('0x1a')]>0x0){return manageTags(_0x1fc5fe,_0x39e551,_0x3b736c,_0x6dddbb,_0x4b644d,_0x333b52,_0x5d5a76)[_0x5a21('0xc')](function(){_0x471d5d(_0x4b644d);});}else{_0x471d5d(_0x4b644d);}});};}function emit(_0x130c3c,_0x3163ef,_0xb21438){var _0x476c6c=_0x5a21('0x4b')+_0x5a21('0x4c')+_0x5a21('0x4d')+'%255EORDERBYDESCnumber';var _0x5d3c63={'uri':_0x130c3c+_0x5a21('0x4e')+_0xb21438+_0x476c6c};io['to'](util[_0x5a21('0x4f')]('user:%s',_0x3163ef))[_0x5a21('0x50')](_0x5a21('0x51'),_0x5d3c63);}exports['cs']=function(_0x41e8a3,_0x272f2e,_0x521f94,_0x4d21f2,_0x4c1368,_0x11baed,_0x30b0f1,_0x313340){var _0x40a2b6={};var _0x31c8ae={'user':_0x11baed['username'],'pass':_0x11baed[_0x5a21('0x52')]};var _0x1f5f15='sysparm_limit=1';var _0x27ea3c=_0x5a21('0x53');_0x11baed['remoteUri']=intUtil['stripTrailingSlash'](_0x11baed['remoteUri']);_0x11baed['serverUrl']=intUtil['stripTrailingSlash'](_0x11baed[_0x5a21('0x54')]);var _0xe9ec3e=util[_0x5a21('0x4f')](_0x5a21('0x55'),_0x11baed[_0x5a21('0x56')]);_0x40a2b6[_0x5a21('0x16')]=!_[_0x5a21('0x57')](_0x4d21f2)?_0x4d21f2['email']:null;_0x40a2b6['adminEmail']=_0x11baed[_0x5a21('0x58')];_0x40a2b6[_0x5a21('0x23')]=_0x313340[_0x5a21('0x2f')]()==='outbound'?_0x272f2e['destcalleridnum']:_0x272f2e[_0x5a21('0x59')];_0x40a2b6[_0x5a21('0x5a')]=_0x313340===_0x5a21('0x5b')||_0x313340===_0x5a21('0x5c')?_0x5a21('0x5b'):_0x5a21('0x38');var _0xa4c92e=util['format'](_0x5a21('0x5d'),_0x11baed[_0x5a21('0x54')],_0x272f2e[_0x5a21('0x5e')],md5(_0x272f2e[_0x5a21('0x5e')]));if(_0x4c1368&&_0x4c1368[_0x5a21('0x5f')]){logger[_0x5a21('0x14')](_0x5a21('0x60'),_0x5a21('0x61'));_0x272f2e['recordingURL']=_0xa4c92e;}else if(_0x30b0f1&&_0x30b0f1[_0x5a21('0x62')]&&_0x30b0f1['recordingFormat']!==_0x5a21('0x63')){logger[_0x5a21('0x14')](_0x5a21('0x64'),'Recording\x20is\x20enabled!');_0x272f2e[_0x5a21('0x65')]=_0xa4c92e;}else{_0x272f2e[_0x5a21('0x65')]='';}return getAdminUser(_0x313340,_0x31c8ae,_0x40a2b6,_0xe9ec3e,_0x27ea3c,_0x1f5f15)[_0x5a21('0xc')](getUser(_0x313340,_0x31c8ae,_0xe9ec3e,_0x27ea3c,_0x1f5f15))[_0x5a21('0xc')](getEndUser(_0x313340,_0x31c8ae,_0xe9ec3e,_0x27ea3c,_0x1f5f15))[_0x5a21('0xc')](getTicket(_0x313340,_0x31c8ae,_0xe9ec3e,_0x521f94,_0x272f2e,_0x27ea3c))[_0x5a21('0xc')](function(_0x460121){logger['info'](util[_0x5a21('0x4f')]('The\x20ticket\x20ID\x20is:\x20%s',_0x460121[_0x5a21('0x3f')]));logger[_0x5a21('0x14')](util[_0x5a21('0x4f')](_0x5a21('0x66'),_0x313340));if(_0x313340!==_0x5a21('0x5c')){logger[_0x5a21('0x14')]('['+[_0x313340[_0x5a21('0x10')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x11baed[_0x5a21('0x56')],_0x4d21f2[_0x5a21('0x37')],_0x460121[_0x5a21('0x3f')]);}})[_0x5a21('0x1f')](function(_0x25eb98){logger[_0x5a21('0x12')]('['+[_0x313340[_0x5a21('0x10')]()]+_0x5a21('0x67'),util[_0x5a21('0x68')](_0x25eb98,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xdc7c=['callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','request-promise','util','md5','ioredis','./util','../../../../config/environment','servicenow','redis','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','info','],\x20getAdminUser\x20crm','catch','toUpperCase','message','],\x20getUser\x20input\x20crm','userEmail','GET','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','active','true','userId','sys_id','],\x20getUser\x20crm','error',']\x20using\x20admin\x20profile','adminEmail','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','System','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','string','idField','toString','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','map','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','format','user:%s','emit','trigger:browser:url','username','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','calleridnum'];(function(_0x408de5,_0x24fa7b){var _0x2015a1=function(_0x13082c){while(--_0x13082c){_0x408de5['push'](_0x408de5['shift']());}};_0x2015a1(++_0x24fa7b);}(_0xdc7c,0xe8));var _0xcdc7=function(_0x501796,_0x4b5374){_0x501796=_0x501796-0x0;var _0x27aace=_0xdc7c[_0x501796];return _0x27aace;};'use strict';var _=require('lodash');var Promise=require('bluebird');var rp=require(_0xcdc7('0x0'));var util=require(_0xcdc7('0x1'));var md5=require(_0xcdc7('0x2'));var Redis=require(_0xcdc7('0x3'));var intUtil=require(_0xcdc7('0x4'));var config=require(_0xcdc7('0x5'));var logger=require('../../../../config/logger')(_0xcdc7('0x6'));config[_0xcdc7('0x7')]=_['defaults'](config['redis'],{'host':_0xcdc7('0x8'),'port':0x18eb});var io=require(_0xcdc7('0x9'))(new Redis(config[_0xcdc7('0x7')]));function getAdminUser(_0x1d03d3,_0x5d6f36,_0x32735c,_0x2215b2,_0x217ef5,_0x5863fa){return new Promise(function(_0x352f40,_0x46e67b){var _0x5237ab={'method':'GET','uri':_0x2215b2+_0xcdc7('0xa')+'&'+_0x217ef5+'&'+_0x5863fa,'auth':_0x5d6f36,'json':!![]};return rp(_0x5237ab)[_0xcdc7('0xb')](function(_0x171f6e){if(_0x171f6e[_0xcdc7('0xc')][_0xcdc7('0xd')]>0x0){_0x32735c[_0xcdc7('0xe')]=_0x171f6e['result'][0x0]['sys_id'];}logger[_0xcdc7('0xf')]('['+[_0x1d03d3['toUpperCase']()]+_0xcdc7('0x10'),_0x32735c);_0x352f40(_0x32735c);})[_0xcdc7('0x11')](function(_0x26dac1){logger['error']('['+[_0x1d03d3[_0xcdc7('0x12')]()]+']',_0x26dac1[_0xcdc7('0x13')]);_0x46e67b(_0x26dac1[_0xcdc7('0x13')]);});});}function getUser(_0x5159ab,_0x2100be,_0x469146,_0x171463,_0x43829f){return function(_0x4f880c){logger['info']('['+[_0x5159ab[_0xcdc7('0x12')]()]+_0xcdc7('0x14'),_0x4f880c);return new Promise(function(_0x405c46,_0x2374d9){if(intUtil['validateEmail'](_0x4f880c[_0xcdc7('0x15')])){var _0x327b0f={'method':_0xcdc7('0x16'),'uri':_0x469146+_0xcdc7('0x17')+_0x4f880c[_0xcdc7('0x15')]+'&'+_0x171463+'&'+_0x43829f,'auth':_0x2100be,'json':!![]};logger[_0xcdc7('0xf')]('['+[_0x5159ab['toUpperCase']()]+_0xcdc7('0x18'),_0x327b0f);return rp(_0x327b0f)[_0xcdc7('0xb')](function(_0x4c1a60){logger[_0xcdc7('0xf')]('['+[_0x5159ab[_0xcdc7('0x12')]()]+'],\x20getUser\x20entity',_0x4c1a60);if(_0x4c1a60[_0xcdc7('0xc')]['length']>0x0&&String(_0x4c1a60[_0xcdc7('0xc')][0x0][_0xcdc7('0x19')])===_0xcdc7('0x1a')){_0x4f880c[_0xcdc7('0x1b')]=_0x4c1a60[_0xcdc7('0xc')][0x0][_0xcdc7('0x1c')];}else{_0x4f880c[_0xcdc7('0x1b')]=_0x4f880c[_0xcdc7('0xe')];_0x4f880c[_0xcdc7('0x15')]=_0x4f880c['adminEmail'];}logger[_0xcdc7('0xf')]('['+[_0x5159ab[_0xcdc7('0x12')]()]+_0xcdc7('0x1d'),_0x4f880c);_0x405c46(_0x4f880c);})[_0xcdc7('0x11')](function(_0x4183a9){logger[_0xcdc7('0x1e')]('['+[_0x5159ab[_0xcdc7('0x12')]()]+']',_0x4183a9[_0xcdc7('0x13')]);_0x2374d9(_0x4183a9['message']);});}else{logger[_0xcdc7('0xf')]('['+[_0x5159ab['toUpperCase']()]+_0xcdc7('0x1f'));_0x4f880c['userId']=_0x4f880c['adminId'];_0x4f880c[_0xcdc7('0x15')]=_0x4f880c[_0xcdc7('0x20')];_0x405c46(_0x4f880c);}});};}function createEndUser(_0x4fe11c,_0x2cbccd,_0x457c12,_0x4d361e,_0x40d0e1){logger['info']('['+[_0x4fe11c[_0xcdc7('0x12')]()]+_0xcdc7('0x21'),_0x457c12);return new Promise(function(_0x599550,_0x424055){var _0x3b7818={'method':_0xcdc7('0x22'),'uri':_0x4d361e+_0xcdc7('0x23')+_0x40d0e1,'body':{'user_name':_0x457c12[_0xcdc7('0x24')],'roles':'user','first_name':_0x457c12['endUserNumber'],'active':_0xcdc7('0x1a'),'date_format':_0xcdc7('0x25'),'phone':_0x457c12['endUserNumber']},'auth':_0x2cbccd,'json':!![]};return rp(_0x3b7818)[_0xcdc7('0xb')](function(_0x4461d6){logger[_0xcdc7('0xf')]('['+[_0x4fe11c[_0xcdc7('0x12')]()]+'],\x20EndUser\x20schema',_0x4461d6[_0xcdc7('0xc')]);_0x457c12[_0xcdc7('0x26')]=_0x4461d6['result'][_0xcdc7('0x1c')];_0x599550(_0x457c12);})[_0xcdc7('0x11')](function(_0x3b34be){logger[_0xcdc7('0x1e')]('['+[_0x4fe11c[_0xcdc7('0x12')]()]+']',_0x3b34be['message']);_0x424055(_0x3b34be[_0xcdc7('0x13')]);});});}function getEndUser(_0x5dc253,_0x28b4b6,_0x6805b7,_0x5cafd7,_0x5616d8){return function(_0x4a56dd){logger['info']('['+[_0x5dc253[_0xcdc7('0x12')]()]+_0xcdc7('0x27'),_0x4a56dd);return new Promise(function(_0x274552,_0x52a1a1){var _0x370ad2={'method':_0xcdc7('0x16'),'uri':_0x6805b7+_0xcdc7('0x28')+_0x4a56dd[_0xcdc7('0x24')]+'&'+_0x5cafd7+'&'+_0x5616d8,'auth':_0x28b4b6,'json':!![]};return rp(_0x370ad2)[_0xcdc7('0xb')](function(_0x55a304){if(_0x55a304[_0xcdc7('0xc')][_0xcdc7('0xd')]>0x0){_0x4a56dd[_0xcdc7('0x26')]=_0x55a304[_0xcdc7('0xc')][0x0][_0xcdc7('0x1c')];logger[_0xcdc7('0xf')]('['+[_0x5dc253[_0xcdc7('0x12')]()]+_0xcdc7('0x29'),_0x4a56dd);_0x274552(_0x4a56dd);}else{return createEndUser(_0x5dc253,_0x28b4b6,_0x4a56dd,_0x6805b7,_0x5cafd7)['then'](function(_0x1959ba){logger['info']('['+[_0x5dc253['toUpperCase']()]+'],\x20createEndUser\x20crm',_0x1959ba);_0x274552(_0x1959ba);});}})['catch'](function(_0x2c43a7){logger[_0xcdc7('0x1e')]('['+[_0x5dc253['toUpperCase']()]+']',_0x2c43a7[_0xcdc7('0x13')]);_0x52a1a1(_0x2c43a7['message']);});});};}function getCustomFields(_0x120075,_0x58c237){var _0x7c5e60={};if(_0x120075['length']>0x0){_[_0xcdc7('0x2a')](_0x120075,function(_0xd84f33){if(_[_0xcdc7('0x2b')](['string',_0xcdc7('0x2c')],_0xd84f33[_0xcdc7('0x2d')])&&_0xd84f33[_0xcdc7('0x2e')]&&!_0xd84f33[_0xcdc7('0x2f')]){_0x7c5e60[_0xd84f33[_0xcdc7('0x2e')][_0xcdc7('0x30')]()]=_0xd84f33[_0xcdc7('0x31')]['toString']();}else if(_['includes']([_0xcdc7('0x32'),_0xcdc7('0x2c')],_0xd84f33[_0xcdc7('0x2d')])&&_0xd84f33[_0xcdc7('0x33')]&&_0xd84f33[_0xcdc7('0x2f')]){_0x7c5e60[_0xd84f33[_0xcdc7('0x33')][_0xcdc7('0x30')]()]=_0xd84f33[_0xcdc7('0x31')][_0xcdc7('0x34')]();}else if(_0xd84f33[_0xcdc7('0x2d')]===_0xcdc7('0x35')&&_0xd84f33[_0xcdc7('0x36')]&&_0xd84f33[_0xcdc7('0x33')]&&_0xd84f33[_0xcdc7('0x2f')]){_0x7c5e60[_0xd84f33[_0xcdc7('0x33')][_0xcdc7('0x30')]()]=_0x58c237[_0xd84f33[_0xcdc7('0x36')]][_0xcdc7('0x34')]();}else if(_0xd84f33[_0xcdc7('0x2d')]===_0xcdc7('0x37')&&_0xd84f33[_0xcdc7('0x38')]&&_0xd84f33[_0xcdc7('0x38')][_0xcdc7('0x39')]&&_0xd84f33[_0xcdc7('0x33')]&&_0xd84f33['customField']){_0x7c5e60[_0xd84f33[_0xcdc7('0x33')][_0xcdc7('0x30')]()]=_0x58c237[_0xd84f33[_0xcdc7('0x38')][_0xcdc7('0x39')][_0xcdc7('0x30')]()][_0xcdc7('0x34')]();}});}return _0x7c5e60;}function getTicket(_0x4aef44,_0x41873f,_0x4b12a9,_0x23e8e1,_0x5b4eec,_0x176e18){return function(_0x283ba1){logger[_0xcdc7('0xf')]('['+[_0x4aef44[_0xcdc7('0x12')]()]+_0xcdc7('0x3a'),_0x283ba1);return new Promise(function(_0x20ee28,_0x4f5eba){var _0x45f19a=_0x4aef44[_0xcdc7('0x30')]()===_0xcdc7('0x3b')?_0x283ba1[_0xcdc7('0x1b')]:_0x283ba1[_0xcdc7('0x26')];var _0x464f6f={'method':_0xcdc7('0x22'),'uri':_0x4b12a9+_0xcdc7('0x3c')+'?'+_0x176e18,'body':Object[_0xcdc7('0x3d')]({},{'active':_0xcdc7('0x1a'),'caller_id':_0x45f19a,'assigned_to':_0x283ba1[_0xcdc7('0x1b')],'short_description':intUtil[_0xcdc7('0x3e')](_0x23e8e1[_0xcdc7('0x3f')],_0x5b4eec,'\x20'),'description':intUtil['getString'](_0x23e8e1[_0xcdc7('0x40')],_0x5b4eec,'\x0a')},getCustomFields(_0x23e8e1[_0xcdc7('0x41')],_0x5b4eec)),'auth':_0x41873f,'json':!![]};return rp(_0x464f6f)[_0xcdc7('0xb')](function(_0x33f0dc){logger[_0xcdc7('0xf')]('['+[_0x4aef44[_0xcdc7('0x12')]()]+_0xcdc7('0x42'),_0x33f0dc[_0xcdc7('0xc')]);_0x283ba1[_0xcdc7('0x43')]=_0x33f0dc[_0xcdc7('0xc')][_0xcdc7('0x1c')];_0x283ba1[_0xcdc7('0x44')]=_0x33f0dc['result'][_0xcdc7('0x45')];logger[_0xcdc7('0xf')]('['+[_0x4aef44[_0xcdc7('0x12')]()]+_0xcdc7('0x46'),_0x283ba1);_0x20ee28(_0x283ba1);})[_0xcdc7('0x11')](function(_0x5df5e5){logger[_0xcdc7('0x1e')]('['+[_0x4aef44['toUpperCase']()]+']',_0x5df5e5[_0xcdc7('0x13')]);_0x4f5eba(_0x5df5e5[_0xcdc7('0x13')]);});});};}function createRemoteTag(_0x7a7628,_0x56ec4c,_0x276e1f,_0x5b7b8d){return new Promise(function(_0x261659,_0x3fd970){var _0x538207={'method':_0xcdc7('0x22'),'uri':_0x276e1f+_0xcdc7('0x47')+'?'+_0x5b7b8d,'body':{'short_description':_0x7a7628,'global':!![],'active':!![],'name':_0x7a7628},'auth':_0x56ec4c,'json':!![]};return rp(_0x538207)[_0xcdc7('0xb')](function(_0x363e26){var _0xfa8c59=_0x363e26[_0xcdc7('0xc')][_0xcdc7('0x1c')];_0x261659(_0xfa8c59);});});}function getRemoteTag(_0x20eb00,_0x27807b,_0xd015fe,_0x98cb72,_0x2396b5){return new Promise(function(_0x59b352,_0x20b82a){var _0x356594={'method':_0xcdc7('0x16'),'uri':_0xd015fe+_0xcdc7('0x47')+_0xcdc7('0x48')+_0x20eb00+'&'+_0x98cb72,'auth':_0x27807b,'json':!![]};return rp(_0x356594)[_0xcdc7('0xb')](function(_0xa0de9e){if(_0xa0de9e[_0xcdc7('0xc')][_0xcdc7('0xd')]>0x0){var _0x6c265a=_0xa0de9e[_0xcdc7('0xc')][0x0][_0xcdc7('0x1c')];_0x59b352(_0x6c265a);}else{return createRemoteTag(_0x20eb00,_0x27807b,_0xd015fe,_0x98cb72)[_0xcdc7('0xb')](function(_0x5db6d4){_0x59b352(_0x5db6d4);});}});});}function assignTagToIncident(_0x371bf4,_0x174c33,_0x542f03,_0x13e351,_0x3056be){return new Promise(function(_0xad75f,_0x3897a1){var _0x39f1fa={'method':'POST','uri':_0x542f03+_0xcdc7('0x49')+'?'+_0x3056be,'body':{'label':_0x371bf4,'table':_0xcdc7('0x3c'),'id_type':'Incident','table_key':_0x13e351['ticketId'],'title':_0xcdc7('0x4a')+_0x13e351[_0xcdc7('0x44')],'id_display':_0x13e351[_0xcdc7('0x44')]},'auth':_0x174c33,'json':!![]};return rp(_0x39f1fa)['then'](function(_0x783e5d){_0xad75f();})[_0xcdc7('0x11')](function(){_0xad75f();});});}function manageTags(_0x5ca44c,_0x38285b,_0x2a7c62,_0x2a0844,_0x32bc54,_0x290fe5,_0x1ada94){return new Promise(function(_0x53effe,_0x4c6c7f){var _0x3420d1=[];_0x38285b[_0xcdc7('0x2a')](function(_0x3916e3){_0x3420d1[_0xcdc7('0x4b')](getRemoteTag(_0x3916e3,_0x2a7c62,_0x2a0844,_0x290fe5,_0x1ada94));});return Promise[_0xcdc7('0x4c')](_0x3420d1)[_0xcdc7('0xb')](function(_0x1bfd7f){if(_0x1bfd7f[_0xcdc7('0xd')]){logger['info']('['+[_0x5ca44c[_0xcdc7('0x12')]()]+_0xcdc7('0x4d'),_0x1bfd7f);var _0xbf24ea=[];_0x1bfd7f[_0xcdc7('0x2a')](function(_0x1de764){_0xbf24ea[_0xcdc7('0x4b')](assignTagToIncident(_0x1de764,_0x2a7c62,_0x2a0844,_0x32bc54,_0x290fe5));});return Promise[_0xcdc7('0x4c')](_0xbf24ea)['then'](function(){_0x53effe();})['catch'](function(){_0x53effe();});}else{_0x53effe();}});});}function getTags(_0x4bea4b,_0x1761b3,_0x48cbb8,_0x46614e,_0x26a006,_0x1de507){return function(_0xd8ca96){return new Promise(function(_0x1af0b9,_0x5c55d5){var _0x163394=[];var _0x1c9a50=_0x46614e['Tags'];if(_0x1c9a50&&_0x1c9a50['length']>0x0){_0x163394=_[_0xcdc7('0x4e')](_0x1c9a50,_0xcdc7('0x39'));}if(_0x163394[_0xcdc7('0xd')]>0x0){return manageTags(_0x4bea4b,_0x163394,_0x1761b3,_0x48cbb8,_0xd8ca96,_0x26a006,_0x1de507)['then'](function(){_0x1af0b9(_0xd8ca96);});}else{_0x1af0b9(_0xd8ca96);}});};}function emit(_0x28cb91,_0x278dad,_0x1ecdd1){var _0x3f6596=_0xcdc7('0x4f')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0xcdc7('0x50')+'%255EORDERBYDESCnumber';var _0xf81d3a={'uri':_0x28cb91+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x1ecdd1+_0x3f6596};io['to'](util[_0xcdc7('0x51')](_0xcdc7('0x52'),_0x278dad))[_0xcdc7('0x53')](_0xcdc7('0x54'),_0xf81d3a);}exports['cs']=function(_0x28eed0,_0x4df27f,_0xad97c1,_0x4fdc68,_0x1fca8b,_0x5caebc,_0x30a807,_0x4047fe){var _0xaa4072={};var _0x5bff6d={'user':_0x5caebc[_0xcdc7('0x55')],'pass':_0x5caebc['password']};var _0x1b516f=_0xcdc7('0x56');var _0x535e31=_0xcdc7('0x57');_0x5caebc[_0xcdc7('0x58')]=intUtil[_0xcdc7('0x59')](_0x5caebc[_0xcdc7('0x58')]);_0x5caebc['serverUrl']=intUtil[_0xcdc7('0x59')](_0x5caebc[_0xcdc7('0x5a')]);var _0x14b807=util[_0xcdc7('0x51')](_0xcdc7('0x5b'),_0x5caebc['remoteUri']);_0xaa4072['userEmail']=!_[_0xcdc7('0x5c')](_0x4fdc68)?_0x4fdc68[_0xcdc7('0x5d')]:null;_0xaa4072[_0xcdc7('0x20')]=_0x5caebc[_0xcdc7('0x5d')];_0xaa4072[_0xcdc7('0x24')]=_0x4047fe['toLowerCase']()===_0xcdc7('0x3b')?_0x4df27f['destcalleridnum']:_0x4df27f[_0xcdc7('0x5e')];_0xaa4072[_0xcdc7('0x5f')]=_0x4047fe===_0xcdc7('0x60')||_0x4047fe===_0xcdc7('0x61')?_0xcdc7('0x60'):'outbound';var _0x59e177=util[_0xcdc7('0x51')](_0xcdc7('0x62'),_0x5caebc['serverUrl'],_0x4df27f[_0xcdc7('0x63')],md5(_0x4df27f[_0xcdc7('0x63')]));if(_0x1fca8b&&_0x1fca8b['monitor_format']){logger[_0xcdc7('0xf')](_0xcdc7('0x64'),'Recording\x20is\x20enabled!');_0x4df27f['recordingURL']=_0x59e177;}else if(_0x30a807&&_0x30a807[_0xcdc7('0x65')]&&_0x30a807[_0xcdc7('0x65')]!==_0xcdc7('0x66')){logger['info'](_0xcdc7('0x67'),'Recording\x20is\x20enabled!');_0x4df27f['recordingURL']=_0x59e177;}else{_0x4df27f[_0xcdc7('0x68')]='';}return getAdminUser(_0x4047fe,_0x5bff6d,_0xaa4072,_0x14b807,_0x535e31,_0x1b516f)[_0xcdc7('0xb')](getUser(_0x4047fe,_0x5bff6d,_0x14b807,_0x535e31,_0x1b516f))[_0xcdc7('0xb')](getEndUser(_0x4047fe,_0x5bff6d,_0x14b807,_0x535e31,_0x1b516f))[_0xcdc7('0xb')](getTicket(_0x4047fe,_0x5bff6d,_0x14b807,_0xad97c1,_0x4df27f,_0x535e31))['then'](function(_0x55c730){logger[_0xcdc7('0xf')](util[_0xcdc7('0x51')](_0xcdc7('0x69'),_0x55c730[_0xcdc7('0x43')]));logger[_0xcdc7('0xf')](util[_0xcdc7('0x51')](_0xcdc7('0x6a'),_0x4047fe));if(_0x4047fe!==_0xcdc7('0x61')){logger[_0xcdc7('0xf')]('['+[_0x4047fe[_0xcdc7('0x12')]()]+']',_0xcdc7('0x6b'));emit(_0x5caebc['remoteUri'],_0x4fdc68['name'],_0x55c730[_0xcdc7('0x43')]);}})[_0xcdc7('0x11')](function(_0x22904b){logger[_0xcdc7('0x1e')]('['+[_0x4047fe[_0xcdc7('0x12')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0xcdc7('0x6c')](_0x22904b,{'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 f864017..df4d5ed 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 _0xae1c=['Descriptions','date_start','slice','replace','duration_minutes','parent_type','Contacts','direction','forEach','variableName','push','set_entry','JSON','stringify','Calls','format','apiKey','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','entry_list','length','name_value_list','value','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','resolve','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','then','find','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','Caller\x20-\x20%s','Enduser\x20created.','debug','merge','string','nameField','toLowerCase','toString','type','idField','custom_fields','content','customField','customVariable','Variable','username','password','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','stripTrailingSlash','remoteUri','uri','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','trigger:browser:url','catch','error','outbound','serverUrl','%s/service/v4_1/rest.php','recordingFormat','destcalleridname','destcalleridnum','Outbound','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','lastevent','toUpperCase','Recording\x20is\x20enabled!','calleridname','calleridnum','lodash','bluebird','md5','util','./util','../../../../config/logger','sugarcrm','defaults','redis','localhost','socket.io-emitter','POST','emit','info','name','getString','Subjects','created_by','description'];(function(_0x3bd7bb,_0xf8bfcc){var _0x14834f=function(_0x3c5126){while(--_0x3c5126){_0x3bd7bb['push'](_0x3bd7bb['shift']());}};_0x14834f(++_0xf8bfcc);}(_0xae1c,0x1cd));var _0xcae1=function(_0x3e2ce9,_0x5ba7b7){_0x3e2ce9=_0x3e2ce9-0x0;var _0x42bf9d=_0xae1c[_0x3e2ce9];return _0x42bf9d;};'use strict';var _=require(_0xcae1('0x0'));var rp=require('request-promise');var BPromise=require(_0xcae1('0x1'));var md5=require(_0xcae1('0x2'));var util=require(_0xcae1('0x3'));var Redis=require('ioredis');var intUtil=require(_0xcae1('0x4'));var config=require('../../../../config/environment');var logger=require(_0xcae1('0x5'))(_0xcae1('0x6'));config['redis']=_[_0xcae1('0x7')](config[_0xcae1('0x8')],{'host':_0xcae1('0x9'),'port':0x18eb});var io=require(_0xcae1('0xa'))(new Redis(config['redis']));var def={'method':_0xcae1('0xb'),'json':!![]};function emit(_0x33902f,_0x5caf01,_0x41801c){io['to'](_0x33902f)[_0xcae1('0xc')](_0x5caf01,_0x41801c);}function getTicket(_0x24eaaf,_0x5f1b71,_0x133364,_0x40bd1a,_0x41ee8b,_0x3ad73e,_0x47be56,_0x56c6c2){logger[_0xcae1('0xd')]('Creating\x20new\x20ticket...');var _0x2014f1=new Date();var _0x30d90c=[{'name':_0xcae1('0xe'),'value':intUtil[_0xcae1('0xf')](_0x40bd1a[_0xcae1('0x10')],_0x41ee8b,'\x20')},{'name':'assigned_user_id','value':_0x5f1b71['id']},{'name':_0xcae1('0x11'),'value':_0x5f1b71['id']},{'name':_0xcae1('0x12'),'value':intUtil[_0xcae1('0xf')](_0x40bd1a[_0xcae1('0x13')],_0x41ee8b,'\x0a')},{'name':_0xcae1('0x14'),'value':_0x2014f1['toISOString']()[_0xcae1('0x15')](0x0,0x13)[_0xcae1('0x16')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0xcae1('0x17'),'value':'15'},{'name':'parent_id','value':_0x133364['id']},{'name':_0xcae1('0x18'),'value':_0xcae1('0x19')},{'name':'parent_name','value':_0x133364['name']},{'name':_0xcae1('0x1a'),'value':_0x56c6c2}];if(_0x3ad73e['length']){_[_0xcae1('0x1b')](_0x3ad73e,function(_0x181a29){if(_0x41ee8b[_0x181a29[_0xcae1('0x1c')]]){_0x30d90c[_0xcae1('0x1d')]({'name':_0x181a29['idField'],'value':_0x41ee8b[_0x181a29[_0xcae1('0x1c')]]});}});}return request({'form':{'method':_0xcae1('0x1e'),'input_type':'JSON','response_type':_0xcae1('0x1f'),'rest_data':JSON[_0xcae1('0x20')]({'session':_0x47be56['id'],'module_name':_0xcae1('0x21'),'name_value_list':_0x30d90c})}});}function getAuth(_0x383357){return util[_0xcae1('0x22')]('Basic\x20%s',new Buffer(_0x383357[_0xcae1('0x23')]+':X')['toString'](_0xcae1('0x24')));}function getServerInfo(_0x55c095){return request({'form':{'method':_0xcae1('0x25'),'input_type':'JSON','response_type':_0xcae1('0x1f'),'rest_data':JSON[_0xcae1('0x20')]({'session':_0x55c095['id']})}});}function getUser(_0x4d399d,_0x141251,_0x57e9ed){if(!_[_0xcae1('0x26')](_0x141251)){logger[_0xcae1('0xd')](_0xcae1('0x27'),_0x141251);return request({'form':{'method':_0xcae1('0x28'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xcae1('0x20')]({'session':_0x57e9ed['id'],'module_name':_0xcae1('0x29'),'query':util[_0xcae1('0x22')](_0xcae1('0x2a'),_0x141251),'order_by':'','offset':'0','select_fields':['id',_0xcae1('0xe'),_0xcae1('0x2b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x493e38){if(_0x493e38[_0xcae1('0x2c')][_0xcae1('0x2d')]){var _0x137196=_['find'](_0x493e38[_0xcae1('0x2c')],function(_0x290632){return _0x290632[_0xcae1('0x2e')][_0xcae1('0x2b')][_0xcae1('0x2f')]===_0x141251;});if(_0x137196){logger[_0xcae1('0xd')](_0xcae1('0x30'));return BPromise['resolve']({'id':_0x137196[_0xcae1('0x2e')]['id'][_0xcae1('0x2f')],'name':_0x137196[_0xcae1('0x2e')][_0xcae1('0xe')][_0xcae1('0x2f')]});}}logger[_0xcae1('0xd')](_0xcae1('0x31'));return BPromise['resolve']({'id':_0x57e9ed[_0xcae1('0x2e')][_0xcae1('0x32')][_0xcae1('0x2f')],'name':_0x57e9ed[_0xcae1('0x2e')]['user_name'][_0xcae1('0x2f')]});});}else{logger[_0xcae1('0xd')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0xcae1('0x33')]({'id':_0x57e9ed['name_value_list']['user_id'][_0xcae1('0x2f')],'name':_0x57e9ed[_0xcae1('0x2e')][_0xcae1('0x2b')][_0xcae1('0x2f')]});}}function getEndUser(_0x23a0fd,_0x36c428,_0x440486,_0x757265){logger[_0xcae1('0xd')](_0xcae1('0x34'),_0x440486);return request({'form':{'method':_0xcae1('0x28'),'input_type':_0xcae1('0x1f'),'response_type':_0xcae1('0x1f'),'rest_data':JSON[_0xcae1('0x20')]({'session':_0x757265['id'],'module_name':_0xcae1('0x19'),'query':util[_0xcae1('0x22')](_0xcae1('0x35'),_0x440486),'order_by':'','offset':'0','select_fields':['id','name',_0xcae1('0x36')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xcae1('0x37')](function(_0x536d4e){if(_0x536d4e[_0xcae1('0x2c')][_0xcae1('0x2d')]){var _0x5f4b96=_[_0xcae1('0x38')](_0x536d4e['entry_list'],function(_0x3f0b5d){return _0x3f0b5d[_0xcae1('0x2e')]['phone_home']['value']===_0x440486;});if(_0x5f4b96){logger[_0xcae1('0xd')](_0xcae1('0x39'));return BPromise[_0xcae1('0x33')]({'id':_0x5f4b96[_0xcae1('0x2e')]['id']['value'],'name':_0x5f4b96[_0xcae1('0x2e')][_0xcae1('0xe')]['value'],'phone':_0x5f4b96['name_value_list'][_0xcae1('0x36')][_0xcae1('0x2f')]});}}else{logger[_0xcae1('0xd')](_0xcae1('0x3a'));return request({'form':{'method':_0xcae1('0x1e'),'input_type':_0xcae1('0x1f'),'response_type':_0xcae1('0x1f'),'rest_data':JSON['stringify']({'session':_0x757265['id'],'module_name':_0xcae1('0x19'),'name_value_list':[{'name':_0xcae1('0x3b'),'value':_0x36c428!==''?_0x36c428:util[_0xcae1('0x22')](_0xcae1('0x3c'),_0x440486)},{'name':_0xcae1('0x36'),'value':_0x440486}]})}})[_0xcae1('0x37')](function(_0x1ef797){logger[_0xcae1('0xd')](_0xcae1('0x3d'));return BPromise[_0xcae1('0x33')]({'id':_0x1ef797['id'],'name':_0x1ef797[_0xcae1('0x2c')][_0xcae1('0x3b')][_0xcae1('0x2f')],'phone':_0x1ef797['entry_list']['phone_home'][_0xcae1('0x2f')]});});}});}function request(_0x694211){logger[_0xcae1('0x3e')]('[HTTP]',JSON[_0xcae1('0x20')](_0x694211));return rp(_[_0xcae1('0x3f')](def,_0x694211));}function getTags(_0x1afbb7,_0x86e7b){var _0x37b282=[];if(_0x1afbb7&&_0x1afbb7[_0xcae1('0x2d')]>0x0){_0x37b282=_['map'](_0x1afbb7,_0x86e7b);}return _0x37b282;}function getCustomFields(_0x35994c,_0x4df17a){var _0x500254=[];var _0x46ea7b={'custom_fields':[]};if(_0x35994c[_0xcae1('0x2d')]>0x0){_['forEach'](_0x35994c,function(_0x3b8807){if(_0x3b8807['type']===_0xcae1('0x40')&&_0x3b8807[_0xcae1('0x41')]&&!_0x3b8807['customField']){_0x46ea7b[_0x3b8807[_0xcae1('0x41')][_0xcae1('0x42')]()]=_0x3b8807['content'][_0xcae1('0x43')]();}else if(_0x3b8807[_0xcae1('0x44')]===_0xcae1('0x40')&&_0x3b8807[_0xcae1('0x45')]&&_0x3b8807['customField']){_0x46ea7b[_0xcae1('0x46')][_0xcae1('0x1d')]({'id':_0x3b8807[_0xcae1('0x45')],'value':_0x3b8807[_0xcae1('0x47')][_0xcae1('0x43')]()});}else if(_0x3b8807[_0xcae1('0x44')]==='variable'&&_0x3b8807[_0xcae1('0x1c')]&&_0x3b8807[_0xcae1('0x45')]&&_0x3b8807[_0xcae1('0x48')]){_0x4df17a[_0x3b8807[_0xcae1('0x1c')]]&&_0x46ea7b['custom_fields'][_0xcae1('0x1d')]({'id':_0x3b8807[_0xcae1('0x45')],'value':_0x4df17a[_0x3b8807[_0xcae1('0x1c')]][_0xcae1('0x43')]()});}else if(_0x3b8807[_0xcae1('0x44')]===_0xcae1('0x49')&&_0x3b8807['Variable']&&_0x3b8807[_0xcae1('0x4a')]['name']&&_0x3b8807[_0xcae1('0x45')]&&_0x3b8807[_0xcae1('0x48')]){_0x4df17a[_0x3b8807[_0xcae1('0x4a')][_0xcae1('0xe')]['toLowerCase']()]&&_0x46ea7b[_0xcae1('0x46')][_0xcae1('0x1d')]({'id':_0x3b8807['idField'],'value':_0x4df17a[_0x3b8807[_0xcae1('0x4a')][_0xcae1('0xe')][_0xcae1('0x42')]()]['toString']()});}});}return _0x46ea7b;}function getConnection(_0x105a6c){return request({'method':_0xcae1('0xb'),'form':{'method':'login','input_type':_0xcae1('0x1f'),'response_type':_0xcae1('0x1f'),'rest_data':JSON[_0xcae1('0x20')]({'user_auth':{'user_name':_0x105a6c[_0xcae1('0x4b')],'password':_0x105a6c[_0xcae1('0x4c')],'encryption':'PLAIN'},'application':_0xcae1('0x4d')})}})[_0xcae1('0x37')](function(_0x46446e){var _0x323a82=_0x46446e;if(_0x323a82['id']){def[_0xcae1('0x4e')]=_0x323a82['id'];return BPromise[_0xcae1('0x33')](_0x323a82);}else{throw new Error(util[_0xcae1('0x22')](_0xcae1('0x4f'),_0x105a6c['id']));}});}function setRelationship(_0x155dae,_0x55288f,_0x40b941,_0x555b4b){return request({'form':{'method':_0xcae1('0x50'),'input_type':_0xcae1('0x1f'),'response_type':'JSON','rest_data':JSON[_0xcae1('0x20')]({'session':_0x155dae['id'],'module_name':'Calls','module_id':_0x40b941['id'],'link_field_name':_0x555b4b,'related_ids':[_0x55288f['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xcae1('0x51')]=function(_0x371c74,_0x4edd48,_0x4e0889,_0xc9932a,_0x378da7,_0x4f7f2a){var _0x1529b4,_0x556bed,_0x1c429f,_0x534606;_0x4f7f2a['remoteUri']=intUtil[_0xcae1('0x52')](_0x4f7f2a[_0xcae1('0x53')]);_0x4f7f2a['serverUrl']=intUtil[_0xcae1('0x52')](_0x4f7f2a['serverUrl']);def[_0xcae1('0x54')]=util[_0xcae1('0x22')]('%s/service/v4_1/rest.php',_0x4f7f2a['remoteUri']);if(_0x378da7&&_0x378da7[_0xcae1('0x55')]){logger[_0xcae1('0xd')](_0xcae1('0x56'),'Recording\x20is\x20enabled!');_0x4edd48[_0xcae1('0x57')]=util[_0xcae1('0x22')](_0xcae1('0x58'),_0x4f7f2a['serverUrl'],_0x4edd48[_0xcae1('0x59')],md5(_0x4edd48[_0xcae1('0x59')]));}else{_0x4edd48[_0xcae1('0x57')]='';}return getConnection(_0x4f7f2a)[_0xcae1('0x37')](function(_0x3f7b36){_0x534606=_0x3f7b36;return getUser(_0x4f7f2a,_0xc9932a['name'],_0x534606);})['then'](function(_0x495fc8){_0x1529b4=_0x495fc8;logger[_0xcae1('0xd')](_0xcae1('0x5a'),_0x1529b4['id']);return getEndUser(_0x4f7f2a,_0x4edd48['calleridname'],_0x4edd48['calleridnum'],_0x534606);})[_0xcae1('0x37')](function(_0x2edf91){_0x556bed=_0x2edf91;logger[_0xcae1('0xd')](_0xcae1('0x5b'),_0x556bed['id']);return getTicket(_0x4f7f2a,_0x1529b4,_0x556bed,_0x4e0889,_0x4edd48,_0x4e0889[_0xcae1('0x5c')],_0x534606,_0xcae1('0x5d'));})[_0xcae1('0x37')](function(_0x3da86b){_0x1c429f=_0x3da86b;logger['info'](_0xcae1('0x5e'));logger[_0xcae1('0xd')](_0xcae1('0x5f'),_0x1c429f['id']);return setRelationship(_0x534606,_0x1529b4,_0x1c429f,_0xcae1('0x60'));})[_0xcae1('0x37')](function(){return setRelationship(_0x534606,_0x556bed,_0x1c429f,_0xcae1('0x61'));})[_0xcae1('0x37')](function(){return getServerInfo(_0x534606);})[_0xcae1('0x37')](function(_0x323b4d){var _0x266c67=parseInt(_0x323b4d[_0xcae1('0x62')][_0xcae1('0x63')](0x0));var _0x31fc3c=util[_0xcae1('0x22')](_0xcae1('0x64'),_0x4f7f2a[_0xcae1('0x53')],_0x1c429f['id']);if(_0x266c67>0x6){_0x31fc3c=util['format'](_0xcae1('0x65'),_0x4f7f2a['remoteUri'],_0x1c429f['id']);}logger[_0xcae1('0xd')](_0xcae1('0x56'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xcae1('0x22')]('user:%s',_0xc9932a[_0xcae1('0xe')]),_0xcae1('0x66'),{'uri':_0x31fc3c});})[_0xcae1('0x67')](function(_0x4cd475){logger[_0xcae1('0x68')](_0xcae1('0x56'),JSON[_0xcae1('0x20')](_0x4cd475));});};exports[_0xcae1('0x69')]=function(_0x56f1e3,_0x1534af,_0x3b92c0,_0xc6e686,_0x55dc6a,_0xfc28c3,_0x10c8b9){var _0x56e2a2,_0x44ad4e,_0x91b3f4,_0x39b9d4;_0xfc28c3['remoteUri']=intUtil[_0xcae1('0x52')](_0xfc28c3[_0xcae1('0x53')]);_0xfc28c3[_0xcae1('0x6a')]=intUtil[_0xcae1('0x52')](_0xfc28c3['serverUrl']);def[_0xcae1('0x54')]=util[_0xcae1('0x22')](_0xcae1('0x6b'),_0xfc28c3[_0xcae1('0x53')]);if(_0x10c8b9&&_0x10c8b9['recordingFormat']&&_0x10c8b9[_0xcae1('0x6c')]!=='none'){logger[_0xcae1('0xd')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x1534af[_0xcae1('0x57')]=util[_0xcae1('0x22')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xfc28c3[_0xcae1('0x6a')],_0x1534af[_0xcae1('0x59')],md5(_0x1534af['uniqueid']));}return getConnection(_0xfc28c3)['then'](function(_0x55e441){_0x39b9d4=_0x55e441;return getUser(_0xfc28c3,_0xc6e686[_0xcae1('0xe')],_0x39b9d4);})[_0xcae1('0x37')](function(_0x3e0ffa){_0x56e2a2=_0x3e0ffa;logger[_0xcae1('0xd')](_0xcae1('0x5a'),_0x56e2a2['id']);return getEndUser(_0xfc28c3,_0x1534af[_0xcae1('0x6d')],_0x1534af[_0xcae1('0x6e')],_0x39b9d4);})['then'](function(_0x1482de){_0x44ad4e=_0x1482de;logger[_0xcae1('0xd')](_0xcae1('0x5b'),_0x44ad4e['id']);return getTicket(_0xfc28c3,_0x56e2a2,_0x44ad4e,_0x3b92c0,_0x1534af,_0x3b92c0['Fields'],_0x39b9d4,_0xcae1('0x6f'));})[_0xcae1('0x37')](function(_0x39ed70){_0x91b3f4=_0x39ed70;logger['info'](_0xcae1('0x5e'));logger[_0xcae1('0xd')](_0xcae1('0x5f'),_0x91b3f4['id']);return setRelationship(_0x39b9d4,_0x56e2a2,_0x91b3f4,_0xcae1('0x60'));})[_0xcae1('0x37')](function(){return setRelationship(_0x39b9d4,_0x44ad4e,_0x91b3f4,'contacts');})[_0xcae1('0x37')](function(){return getServerInfo(_0x39b9d4);})[_0xcae1('0x37')](function(_0x1fd29a){var _0x2366ff=parseInt(_0x1fd29a[_0xcae1('0x62')][_0xcae1('0x63')](0x0));var _0x17db0f=util[_0xcae1('0x22')](_0xcae1('0x64'),_0xfc28c3[_0xcae1('0x53')],_0x91b3f4['id']);if(_0x2366ff>0x6){_0x17db0f=util[_0xcae1('0x22')](_0xcae1('0x65'),_0xfc28c3['remoteUri'],_0x91b3f4['id']);}logger[_0xcae1('0xd')](_0xcae1('0x70'),_0xcae1('0x71'));emit(util[_0xcae1('0x22')](_0xcae1('0x72'),_0xc6e686[_0xcae1('0xe')]),_0xcae1('0x66'),{'uri':_0x17db0f});})[_0xcae1('0x67')](function(_0x4ef6cd){logger[_0xcae1('0x68')](_0xcae1('0x70'),JSON[_0xcae1('0x20')](_0x4ef6cd));});};exports['unmanaged']=function(_0xa3d23f,_0x131b7a,_0x12e0be,_0x5803e9,_0x2e5618,_0x4ee863){var _0x4d29d3,_0x1c3024,_0x159857,_0x5d160a;_0x4ee863[_0xcae1('0x53')]=intUtil[_0xcae1('0x52')](_0x4ee863[_0xcae1('0x53')]);_0x4ee863[_0xcae1('0x6a')]=intUtil['stripTrailingSlash'](_0x4ee863[_0xcae1('0x6a')]);def[_0xcae1('0x54')]=util[_0xcae1('0x22')](_0xcae1('0x6b'),_0x4ee863[_0xcae1('0x53')]);if(_0x2e5618&&_0x2e5618[_0xcae1('0x55')]){logger['info']('['+_0x131b7a[_0xcae1('0x73')][_0xcae1('0x74')]()+']',_0xcae1('0x75'));_0x131b7a['recordingURL']=util[_0xcae1('0x22')](_0xcae1('0x58'),_0x4ee863[_0xcae1('0x6a')],_0x131b7a['uniqueid'],md5(_0x131b7a[_0xcae1('0x59')]));}else{_0x131b7a[_0xcae1('0x57')]='';}return getConnection(_0x4ee863)[_0xcae1('0x37')](function(_0x45944e){_0x5d160a=_0x45944e;if(!_['isNil'](_0x5803e9)){return getUser(_0x4ee863,_0x5803e9[_0xcae1('0xe')],_0x5d160a);}else{return getUser(_0x4ee863,null,_0x5d160a);}})[_0xcae1('0x37')](function(_0xf4146d){_0x4d29d3=_0xf4146d;logger['info'](_0xcae1('0x5a'),_0x4d29d3['id']);return getEndUser(_0x4ee863,_0x131b7a[_0xcae1('0x76')],_0x131b7a[_0xcae1('0x77')],_0x5d160a);})[_0xcae1('0x37')](function(_0x5f310a){_0x1c3024=_0x5f310a;logger[_0xcae1('0xd')](_0xcae1('0x5b'),_0x1c3024['id']);return getTicket(_0x4ee863,_0x4d29d3,_0x1c3024,_0x12e0be,_0x131b7a,_0x12e0be['Fields'],_0x5d160a,_0xcae1('0x5d'));})['then'](function(_0x260a23){_0x159857=_0x260a23;logger[_0xcae1('0xd')](_0xcae1('0x5e'));logger[_0xcae1('0xd')](_0xcae1('0x5f'),_0x159857['id']);return setRelationship(_0x5d160a,_0x4d29d3,_0x159857,_0xcae1('0x60'));})[_0xcae1('0x37')](function(){return setRelationship(_0x5d160a,_0x1c3024,_0x159857,'contacts');})[_0xcae1('0x37')](function(){return getServerInfo(_0x5d160a);})['catch'](function(_0x5cb904){logger[_0xcae1('0x68')]('['+_0x131b7a[_0xcae1('0x73')][_0xcae1('0x74')]()+']',JSON[_0xcae1('0x20')](_0x5cb904));});}; \ No newline at end of file +var _0x4796=['contacts','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','error','outbound','recordingFormat','[OUTBOUND]','Outbound','users','charAt','lastevent','calleridname','Fields','toUpperCase','request-promise','bluebird','ioredis','../../../../config/logger','sugarcrm','defaults','redis','localhost','socket.io-emitter','POST','Creating\x20new\x20ticket...','name','getString','created_by','Descriptions','date_start','toISOString','slice','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','length','forEach','push','idField','set_entry','stringify','Calls','format','Basic\x20%s','toString','base64','get_server_info','JSON','isNil','info','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','name_value_list','value','Agent\x20found!','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','phone_home','Enduser\x20created.','[HTTP]','map','nameField','toLowerCase','content','string','customField','custom_fields','type','variableName','customVariable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:'];(function(_0x497629,_0x4f17ce){var _0x32c0e0=function(_0x2052b3){while(--_0x2052b3){_0x497629['push'](_0x497629['shift']());}};_0x32c0e0(++_0x4f17ce);}(_0x4796,0xf8));var _0x6479=function(_0x2adba0,_0x311ae9){_0x2adba0=_0x2adba0-0x0;var _0x483ac3=_0x4796[_0x2adba0];return _0x483ac3;};'use strict';var _=require('lodash');var rp=require(_0x6479('0x0'));var BPromise=require(_0x6479('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0x6479('0x2'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x6479('0x3'))(_0x6479('0x4'));config['redis']=_[_0x6479('0x5')](config[_0x6479('0x6')],{'host':_0x6479('0x7'),'port':0x18eb});var io=require(_0x6479('0x8'))(new Redis(config[_0x6479('0x6')]));var def={'method':_0x6479('0x9'),'json':!![]};function emit(_0x4bcff8,_0x213e5e,_0x417ba2){io['to'](_0x4bcff8)['emit'](_0x213e5e,_0x417ba2);}function getTicket(_0x555c23,_0x3dc362,_0x598455,_0x1427c6,_0x2f7ea5,_0x48dc2a,_0x20a7f6,_0x174dc5){logger['info'](_0x6479('0xa'));var _0x29ca32=new Date();var _0x3c3e9f=[{'name':_0x6479('0xb'),'value':intUtil[_0x6479('0xc')](_0x1427c6['Subjects'],_0x2f7ea5,'\x20')},{'name':'assigned_user_id','value':_0x3dc362['id']},{'name':_0x6479('0xd'),'value':_0x3dc362['id']},{'name':'description','value':intUtil[_0x6479('0xc')](_0x1427c6[_0x6479('0xe')],_0x2f7ea5,'\x0a')},{'name':_0x6479('0xf'),'value':_0x29ca32[_0x6479('0x10')]()[_0x6479('0x11')](0x0,0x13)['replace']('T','\x20')},{'name':_0x6479('0x12'),'value':'0'},{'name':_0x6479('0x13'),'value':'15'},{'name':_0x6479('0x14'),'value':_0x598455['id']},{'name':_0x6479('0x15'),'value':_0x6479('0x16')},{'name':_0x6479('0x17'),'value':_0x598455[_0x6479('0xb')]},{'name':'direction','value':_0x174dc5}];if(_0x48dc2a[_0x6479('0x18')]){_[_0x6479('0x19')](_0x48dc2a,function(_0x224f2d){if(_0x2f7ea5[_0x224f2d['variableName']]){_0x3c3e9f[_0x6479('0x1a')]({'name':_0x224f2d[_0x6479('0x1b')],'value':_0x2f7ea5[_0x224f2d['variableName']]});}});}return request({'form':{'method':_0x6479('0x1c'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x6479('0x1d')]({'session':_0x20a7f6['id'],'module_name':_0x6479('0x1e'),'name_value_list':_0x3c3e9f})}});}function getAuth(_0xde989e){return util[_0x6479('0x1f')](_0x6479('0x20'),new Buffer(_0xde989e['apiKey']+':X')[_0x6479('0x21')](_0x6479('0x22')));}function getServerInfo(_0x444ba7){return request({'form':{'method':_0x6479('0x23'),'input_type':'JSON','response_type':_0x6479('0x24'),'rest_data':JSON[_0x6479('0x1d')]({'session':_0x444ba7['id']})}});}function getUser(_0x16a7aa,_0x2ce05f,_0x44d40a){if(!_[_0x6479('0x25')](_0x2ce05f)){logger[_0x6479('0x26')]('Getting\x20agent\x20with\x20name',_0x2ce05f);return request({'form':{'method':_0x6479('0x27'),'input_type':_0x6479('0x24'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x44d40a['id'],'module_name':_0x6479('0x28'),'query':util[_0x6479('0x1f')](_0x6479('0x29'),_0x2ce05f),'order_by':'','offset':'0','select_fields':['id',_0x6479('0xb'),_0x6479('0x2a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x6479('0x2b')](function(_0x448a97){if(_0x448a97[_0x6479('0x2c')][_0x6479('0x18')]){var _0xb27dc9=_['find'](_0x448a97[_0x6479('0x2c')],function(_0x4a68c6){return _0x4a68c6[_0x6479('0x2d')][_0x6479('0x2a')][_0x6479('0x2e')]===_0x2ce05f;});if(_0xb27dc9){logger[_0x6479('0x26')](_0x6479('0x2f'));return BPromise[_0x6479('0x30')]({'id':_0xb27dc9['name_value_list']['id'][_0x6479('0x2e')],'name':_0xb27dc9['name_value_list'][_0x6479('0xb')][_0x6479('0x2e')]});}}logger[_0x6479('0x26')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x6479('0x30')]({'id':_0x44d40a[_0x6479('0x2d')][_0x6479('0x31')]['value'],'name':_0x44d40a[_0x6479('0x2d')][_0x6479('0x2a')][_0x6479('0x2e')]});});}else{logger[_0x6479('0x26')](_0x6479('0x32'));return BPromise[_0x6479('0x30')]({'id':_0x44d40a[_0x6479('0x2d')][_0x6479('0x31')][_0x6479('0x2e')],'name':_0x44d40a[_0x6479('0x2d')]['user_name'][_0x6479('0x2e')]});}}function getEndUser(_0x4be129,_0x3d8a74,_0x5c5a60,_0x22af9e){logger[_0x6479('0x26')](_0x6479('0x33'),_0x5c5a60);return request({'form':{'method':_0x6479('0x27'),'input_type':_0x6479('0x24'),'response_type':_0x6479('0x24'),'rest_data':JSON[_0x6479('0x1d')]({'session':_0x22af9e['id'],'module_name':_0x6479('0x16'),'query':util[_0x6479('0x1f')](_0x6479('0x34'),_0x5c5a60),'order_by':'','offset':'0','select_fields':['id',_0x6479('0xb'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x6479('0x2b')](function(_0x19be51){if(_0x19be51[_0x6479('0x2c')][_0x6479('0x18')]){var _0x3de9c4=_['find'](_0x19be51[_0x6479('0x2c')],function(_0x273e76){return _0x273e76[_0x6479('0x2d')]['phone_home'][_0x6479('0x2e')]===_0x5c5a60;});if(_0x3de9c4){logger[_0x6479('0x26')](_0x6479('0x35'));return BPromise['resolve']({'id':_0x3de9c4[_0x6479('0x2d')]['id'][_0x6479('0x2e')],'name':_0x3de9c4[_0x6479('0x2d')]['name'][_0x6479('0x2e')],'phone':_0x3de9c4[_0x6479('0x2d')]['phone_home']['value']});}}else{logger[_0x6479('0x26')](_0x6479('0x36'));return request({'form':{'method':'set_entry','input_type':_0x6479('0x24'),'response_type':'JSON','rest_data':JSON[_0x6479('0x1d')]({'session':_0x22af9e['id'],'module_name':_0x6479('0x16'),'name_value_list':[{'name':_0x6479('0x37'),'value':_0x3d8a74!==_0x6479('0x38')?_0x3d8a74:util[_0x6479('0x1f')](_0x6479('0x39'),_0x5c5a60)},{'name':_0x6479('0x3a'),'value':_0x5c5a60}]})}})['then'](function(_0x47b8d4){logger[_0x6479('0x26')](_0x6479('0x3b'));return BPromise[_0x6479('0x30')]({'id':_0x47b8d4['id'],'name':_0x47b8d4[_0x6479('0x2c')]['first_name'][_0x6479('0x2e')],'phone':_0x47b8d4['entry_list'][_0x6479('0x3a')]['value']});});}});}function request(_0x5a1a65){logger['debug'](_0x6479('0x3c'),JSON[_0x6479('0x1d')](_0x5a1a65));return rp(_['merge'](def,_0x5a1a65));}function getTags(_0x53aecc,_0xf5f2bb){var _0x5a83f7=[];if(_0x53aecc&&_0x53aecc[_0x6479('0x18')]>0x0){_0x5a83f7=_[_0x6479('0x3d')](_0x53aecc,_0xf5f2bb);}return _0x5a83f7;}function getCustomFields(_0x4c582c,_0x5dd800){var _0x5bdd55=[];var _0x30d0da={'custom_fields':[]};if(_0x4c582c[_0x6479('0x18')]>0x0){_['forEach'](_0x4c582c,function(_0x41d336){if(_0x41d336['type']==='string'&&_0x41d336['nameField']&&!_0x41d336['customField']){_0x30d0da[_0x41d336[_0x6479('0x3e')][_0x6479('0x3f')]()]=_0x41d336[_0x6479('0x40')][_0x6479('0x21')]();}else if(_0x41d336['type']===_0x6479('0x41')&&_0x41d336[_0x6479('0x1b')]&&_0x41d336[_0x6479('0x42')]){_0x30d0da[_0x6479('0x43')]['push']({'id':_0x41d336[_0x6479('0x1b')],'value':_0x41d336['content']['toString']()});}else if(_0x41d336[_0x6479('0x44')]==='variable'&&_0x41d336['variableName']&&_0x41d336[_0x6479('0x1b')]&&_0x41d336[_0x6479('0x42')]){_0x5dd800[_0x41d336[_0x6479('0x45')]]&&_0x30d0da['custom_fields'][_0x6479('0x1a')]({'id':_0x41d336[_0x6479('0x1b')],'value':_0x5dd800[_0x41d336[_0x6479('0x45')]][_0x6479('0x21')]()});}else if(_0x41d336[_0x6479('0x44')]===_0x6479('0x46')&&_0x41d336['Variable']&&_0x41d336[_0x6479('0x47')][_0x6479('0xb')]&&_0x41d336[_0x6479('0x1b')]&&_0x41d336[_0x6479('0x42')]){_0x5dd800[_0x41d336[_0x6479('0x47')]['name'][_0x6479('0x3f')]()]&&_0x30d0da['custom_fields'][_0x6479('0x1a')]({'id':_0x41d336['idField'],'value':_0x5dd800[_0x41d336['Variable'][_0x6479('0xb')][_0x6479('0x3f')]()][_0x6479('0x21')]()});}});}return _0x30d0da;}function getConnection(_0x40b25a){return request({'method':_0x6479('0x9'),'form':{'method':_0x6479('0x48'),'input_type':_0x6479('0x24'),'response_type':_0x6479('0x24'),'rest_data':JSON[_0x6479('0x1d')]({'user_auth':{'user_name':_0x40b25a[_0x6479('0x49')],'password':_0x40b25a[_0x6479('0x4a')],'encryption':_0x6479('0x4b')},'application':_0x6479('0x4c')})}})[_0x6479('0x2b')](function(_0x10b898){var _0x18c20e=_0x10b898;if(_0x18c20e['id']){def['sessionID']=_0x18c20e['id'];return BPromise['resolve'](_0x18c20e);}else{throw new Error(util['format'](_0x6479('0x4d'),_0x40b25a['id']));}});}function setRelationship(_0x13fabc,_0x263ae0,_0x3ea5f2,_0x48943f){return request({'form':{'method':_0x6479('0x4e'),'input_type':'JSON','response_type':_0x6479('0x24'),'rest_data':JSON['stringify']({'session':_0x13fabc['id'],'module_name':'Calls','module_id':_0x3ea5f2['id'],'link_field_name':_0x48943f,'related_ids':[_0x263ae0['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x6479('0x4f')]=function(_0x19bf28,_0x544e9c,_0x5ea798,_0x47516c,_0x314b5a,_0x2d4a3c){var _0x50e7ef,_0x138030,_0x5c4daf,_0xe55d59;_0x2d4a3c[_0x6479('0x50')]=intUtil[_0x6479('0x51')](_0x2d4a3c[_0x6479('0x50')]);_0x2d4a3c[_0x6479('0x52')]=intUtil[_0x6479('0x51')](_0x2d4a3c['serverUrl']);def[_0x6479('0x53')]=util['format'](_0x6479('0x54'),_0x2d4a3c['remoteUri']);if(_0x314b5a&&_0x314b5a[_0x6479('0x55')]){logger[_0x6479('0x26')](_0x6479('0x56'),_0x6479('0x57'));_0x544e9c[_0x6479('0x58')]=util['format'](_0x6479('0x59'),_0x2d4a3c[_0x6479('0x52')],_0x544e9c[_0x6479('0x5a')],md5(_0x544e9c[_0x6479('0x5a')]));}else{_0x544e9c[_0x6479('0x58')]='';}return getConnection(_0x2d4a3c)['then'](function(_0x3798ac){_0xe55d59=_0x3798ac;return getUser(_0x2d4a3c,_0x47516c[_0x6479('0xb')],_0xe55d59);})[_0x6479('0x2b')](function(_0x50d715){_0x50e7ef=_0x50d715;logger[_0x6479('0x26')](_0x6479('0x5b'),_0x50e7ef['id']);return getEndUser(_0x2d4a3c,_0x544e9c['calleridname'],_0x544e9c[_0x6479('0x5c')],_0xe55d59);})[_0x6479('0x2b')](function(_0x2daee0){_0x138030=_0x2daee0;logger[_0x6479('0x26')](_0x6479('0x5d'),_0x138030['id']);return getTicket(_0x2d4a3c,_0x50e7ef,_0x138030,_0x5ea798,_0x544e9c,_0x5ea798['Fields'],_0xe55d59,_0x6479('0x5e'));})[_0x6479('0x2b')](function(_0x4b7e19){_0x5c4daf=_0x4b7e19;logger[_0x6479('0x26')](_0x6479('0x5f'));logger['info'](_0x6479('0x60'),_0x5c4daf['id']);return setRelationship(_0xe55d59,_0x50e7ef,_0x5c4daf,'users');})[_0x6479('0x2b')](function(){return setRelationship(_0xe55d59,_0x138030,_0x5c4daf,_0x6479('0x61'));})[_0x6479('0x2b')](function(){return getServerInfo(_0xe55d59);})[_0x6479('0x2b')](function(_0x52e451){var _0x4f757a=parseInt(_0x52e451[_0x6479('0x62')]['charAt'](0x0));var _0x2a4346=util['format'](_0x6479('0x63'),_0x2d4a3c[_0x6479('0x50')],_0x5c4daf['id']);if(_0x4f757a>0x6){_0x2a4346=util['format'](_0x6479('0x64'),_0x2d4a3c[_0x6479('0x50')],_0x5c4daf['id']);}logger[_0x6479('0x26')]('[QUEUE]',_0x6479('0x65'));emit(util['format'](_0x6479('0x66'),_0x47516c[_0x6479('0xb')]),'trigger:browser:url',{'uri':_0x2a4346});})[_0x6479('0x67')](function(_0x5b2355){logger[_0x6479('0x68')](_0x6479('0x56'),JSON[_0x6479('0x1d')](_0x5b2355));});};exports[_0x6479('0x69')]=function(_0xe7b4f8,_0x4588f9,_0x43f91d,_0x23273a,_0x5f0a72,_0x2c0416,_0x105029){var _0x2454dd,_0x541915,_0x406c34,_0x239ba1;_0x2c0416[_0x6479('0x50')]=intUtil[_0x6479('0x51')](_0x2c0416['remoteUri']);_0x2c0416['serverUrl']=intUtil[_0x6479('0x51')](_0x2c0416[_0x6479('0x52')]);def[_0x6479('0x53')]=util[_0x6479('0x1f')]('%s/service/v4_1/rest.php',_0x2c0416['remoteUri']);if(_0x105029&&_0x105029[_0x6479('0x6a')]&&_0x105029[_0x6479('0x6a')]!=='none'){logger[_0x6479('0x26')](_0x6479('0x6b'),_0x6479('0x57'));_0x4588f9[_0x6479('0x58')]=util[_0x6479('0x1f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2c0416[_0x6479('0x52')],_0x4588f9[_0x6479('0x5a')],md5(_0x4588f9['uniqueid']));}return getConnection(_0x2c0416)[_0x6479('0x2b')](function(_0x4981eb){_0x239ba1=_0x4981eb;return getUser(_0x2c0416,_0x23273a[_0x6479('0xb')],_0x239ba1);})[_0x6479('0x2b')](function(_0x1024e6){_0x2454dd=_0x1024e6;logger[_0x6479('0x26')]('The\x20User\x20ID\x20is:',_0x2454dd['id']);return getEndUser(_0x2c0416,_0x4588f9['destcalleridname'],_0x4588f9['destcalleridnum'],_0x239ba1);})[_0x6479('0x2b')](function(_0xb03dce){_0x541915=_0xb03dce;logger[_0x6479('0x26')]('The\x20Enduser\x20ID\x20is:',_0x541915['id']);return getTicket(_0x2c0416,_0x2454dd,_0x541915,_0x43f91d,_0x4588f9,_0x43f91d['Fields'],_0x239ba1,_0x6479('0x6c'));})[_0x6479('0x2b')](function(_0x582399){_0x406c34=_0x582399;logger['info'](_0x6479('0x5f'));logger[_0x6479('0x26')]('The\x20Ticket\x20ID\x20is:',_0x406c34['id']);return setRelationship(_0x239ba1,_0x2454dd,_0x406c34,_0x6479('0x6d'));})['then'](function(){return setRelationship(_0x239ba1,_0x541915,_0x406c34,_0x6479('0x61'));})['then'](function(){return getServerInfo(_0x239ba1);})[_0x6479('0x2b')](function(_0x3eb9cd){var _0x48e05a=parseInt(_0x3eb9cd[_0x6479('0x62')][_0x6479('0x6e')](0x0));var _0x1eb95c=util['format'](_0x6479('0x63'),_0x2c0416[_0x6479('0x50')],_0x406c34['id']);if(_0x48e05a>0x6){_0x1eb95c=util[_0x6479('0x1f')](_0x6479('0x64'),_0x2c0416[_0x6479('0x50')],_0x406c34['id']);}logger[_0x6479('0x26')]('[OUTBOUND]',_0x6479('0x65'));emit(util[_0x6479('0x1f')](_0x6479('0x66'),_0x23273a[_0x6479('0xb')]),'trigger:browser:url',{'uri':_0x1eb95c});})['catch'](function(_0x1b386a){logger[_0x6479('0x68')](_0x6479('0x6b'),JSON[_0x6479('0x1d')](_0x1b386a));});};exports['unmanaged']=function(_0x2ef944,_0x1c9221,_0x211095,_0x4d80db,_0x2430d9,_0xe320ca){var _0x165cb7,_0xf1c3b6,_0x2f7ce4,_0x40b1bc;_0xe320ca['remoteUri']=intUtil['stripTrailingSlash'](_0xe320ca[_0x6479('0x50')]);_0xe320ca[_0x6479('0x52')]=intUtil['stripTrailingSlash'](_0xe320ca['serverUrl']);def[_0x6479('0x53')]=util['format'](_0x6479('0x54'),_0xe320ca[_0x6479('0x50')]);if(_0x2430d9&&_0x2430d9[_0x6479('0x55')]){logger[_0x6479('0x26')]('['+_0x1c9221[_0x6479('0x6f')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1c9221[_0x6479('0x58')]=util['format'](_0x6479('0x59'),_0xe320ca['serverUrl'],_0x1c9221[_0x6479('0x5a')],md5(_0x1c9221[_0x6479('0x5a')]));}else{_0x1c9221[_0x6479('0x58')]='';}return getConnection(_0xe320ca)[_0x6479('0x2b')](function(_0x4708b1){_0x40b1bc=_0x4708b1;if(!_['isNil'](_0x4d80db)){return getUser(_0xe320ca,_0x4d80db[_0x6479('0xb')],_0x40b1bc);}else{return getUser(_0xe320ca,null,_0x40b1bc);}})[_0x6479('0x2b')](function(_0x137ebb){_0x165cb7=_0x137ebb;logger[_0x6479('0x26')](_0x6479('0x5b'),_0x165cb7['id']);return getEndUser(_0xe320ca,_0x1c9221[_0x6479('0x70')],_0x1c9221[_0x6479('0x5c')],_0x40b1bc);})[_0x6479('0x2b')](function(_0x9215b6){_0xf1c3b6=_0x9215b6;logger['info'](_0x6479('0x5d'),_0xf1c3b6['id']);return getTicket(_0xe320ca,_0x165cb7,_0xf1c3b6,_0x211095,_0x1c9221,_0x211095[_0x6479('0x71')],_0x40b1bc,_0x6479('0x5e'));})[_0x6479('0x2b')](function(_0x2c33cf){_0x2f7ce4=_0x2c33cf;logger['info'](_0x6479('0x5f'));logger['info'](_0x6479('0x60'),_0x2f7ce4['id']);return setRelationship(_0x40b1bc,_0x165cb7,_0x2f7ce4,_0x6479('0x6d'));})[_0x6479('0x2b')](function(){return setRelationship(_0x40b1bc,_0xf1c3b6,_0x2f7ce4,'contacts');})[_0x6479('0x2b')](function(){return getServerInfo(_0x40b1bc);})[_0x6479('0x67')](function(_0x503a97){logger[_0x6479('0x68')]('['+_0x1c9221[_0x6479('0x6f')][_0x6479('0x72')]()+']',JSON[_0x6479('0x1d')](_0x503a97));});}; \ 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 706ba95..b5ffc3d 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 _0x5f12=['keyContent','join','stripTrailingSlash','slice','substring','validateEmail','isNil','util','getString','length','sortBy','string','push','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0x5f12,0x130));var _0x25f1=function(_0x1467f6,_0x49031a){_0x1467f6=_0x1467f6-0x0;var _0xd05ef6=_0x5f12[_0x1467f6];return _0xd05ef6;};'use strict';var _=require('lodash');var util=require(_0x25f1('0x0'));exports[_0x25f1('0x1')]=function(_0x47431c,_0x4c86bf,_0x3d7544){var _0x18f936=[];if(_0x47431c[_0x25f1('0x2')]>0x0){var _0x3fa287=_[_0x25f1('0x3')](_0x47431c,['id']);for(var _0x50abf7=0x0;_0x50abf7<_0x3fa287[_0x25f1('0x2')];_0x50abf7++){var _0x346635=_0x3fa287[_0x50abf7];if(_0x346635['type']===_0x25f1('0x4')){_0x18f936[_0x25f1('0x5')](_0x346635[_0x25f1('0x6')]);}else if(_0x346635[_0x25f1('0x7')]===_0x25f1('0x8')&&_0x346635['variableName']){_0x4c86bf[_0x346635[_0x25f1('0x9')]]&&_0x18f936[_0x25f1('0x5')](_0x4c86bf[_0x346635[_0x25f1('0x9')]][_0x25f1('0xa')]());}else if(_0x346635[_0x25f1('0x7')]===_0x25f1('0xb')&&_0x346635[_0x25f1('0xc')]&&_0x346635[_0x25f1('0xc')][_0x25f1('0xd')]){_0x4c86bf[_0x346635['Variable'][_0x25f1('0xd')][_0x25f1('0xe')]()]&&_0x18f936[_0x25f1('0x5')](_0x4c86bf[_0x346635['Variable'][_0x25f1('0xd')]['toLowerCase']()][_0x25f1('0xa')]());}else if(_0x346635[_0x25f1('0x7')]===_0x25f1('0xf')){if(_0x346635[_0x25f1('0x10')]===_0x25f1('0x4')&&_0x346635[_0x25f1('0x11')]){_0x18f936[_0x25f1('0x5')](util[_0x25f1('0x12')](_0x25f1('0x13'),_0x346635['key'],_0x346635[_0x25f1('0x14')]));}else if(_0x346635[_0x25f1('0x10')]===_0x25f1('0x8')&&_0x346635[_0x25f1('0x9')]&&_0x346635[_0x25f1('0x11')]){_0x4c86bf[_0x346635[_0x25f1('0x9')]]&&_0x18f936['push'](util[_0x25f1('0x12')]('%s:\x20%s',_0x346635[_0x25f1('0x11')],_0x4c86bf[_0x346635[_0x25f1('0x9')]]));}else if(_0x346635[_0x25f1('0x10')]===_0x25f1('0xb')&&_0x346635[_0x25f1('0xc')]&&_0x346635[_0x25f1('0xc')][_0x25f1('0xd')]&&_0x346635[_0x25f1('0x11')]){_0x4c86bf[_0x346635[_0x25f1('0xc')][_0x25f1('0xd')]['toLowerCase']()]&&_0x18f936['push'](util[_0x25f1('0x12')](_0x25f1('0x13'),_0x346635[_0x25f1('0x11')],_0x4c86bf[_0x346635[_0x25f1('0xc')][_0x25f1('0xd')][_0x25f1('0xe')]()]));}}}}return _0x18f936[_0x25f1('0x15')](_0x3d7544);};exports[_0x25f1('0x16')]=function(_0x2bb599){var _0x31eb29=_0x2bb599[_0x25f1('0x17')](-0x1);if(_0x31eb29==='/'){_0x2bb599=_0x2bb599[_0x25f1('0x18')](0x0,_0x2bb599['lastIndexOf'](_0x31eb29));}return _0x2bb599;};exports[_0x25f1('0x19')]=function(_0x433531){if(!_[_0x25f1('0x1a')](_0x433531)&&_0x433531!==''){var _0x53599c=/^(([^<>()\[\]\\.,;:\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 _0x53599c['test'](String(_0x433531)[_0x25f1('0xe')]());}else{return![];}}; \ No newline at end of file +var _0x6e95=['keyValue','keyType','%s:\x20%s','key','keyContent','format','name','join','slice','lastIndexOf','validateEmail','isNil','test','lodash','length','sortBy','type','string','push','variable','variableName','toString','customVariable','Variable','toLowerCase'];(function(_0x3b2b0b,_0x5191a0){var _0x5b49cc=function(_0x30475a){while(--_0x30475a){_0x3b2b0b['push'](_0x3b2b0b['shift']());}};_0x5b49cc(++_0x5191a0);}(_0x6e95,0xa3));var _0x56e9=function(_0x625a73,_0x50ae08){_0x625a73=_0x625a73-0x0;var _0x3eceb5=_0x6e95[_0x625a73];return _0x3eceb5;};'use strict';var _=require(_0x56e9('0x0'));var util=require('util');exports['getString']=function(_0x53b416,_0x28f042,_0xae5f1b){var _0x365461=[];if(_0x53b416[_0x56e9('0x1')]>0x0){var _0x522ba=_[_0x56e9('0x2')](_0x53b416,['id']);for(var _0x498f27=0x0;_0x498f27<_0x522ba['length'];_0x498f27++){var _0x5a8243=_0x522ba[_0x498f27];if(_0x5a8243[_0x56e9('0x3')]===_0x56e9('0x4')){_0x365461[_0x56e9('0x5')](_0x5a8243['content']);}else if(_0x5a8243[_0x56e9('0x3')]===_0x56e9('0x6')&&_0x5a8243[_0x56e9('0x7')]){_0x28f042[_0x5a8243[_0x56e9('0x7')]]&&_0x365461[_0x56e9('0x5')](_0x28f042[_0x5a8243[_0x56e9('0x7')]][_0x56e9('0x8')]());}else if(_0x5a8243[_0x56e9('0x3')]===_0x56e9('0x9')&&_0x5a8243[_0x56e9('0xa')]&&_0x5a8243['Variable']['name']){_0x28f042[_0x5a8243[_0x56e9('0xa')]['name']['toLowerCase']()]&&_0x365461[_0x56e9('0x5')](_0x28f042[_0x5a8243[_0x56e9('0xa')]['name'][_0x56e9('0xb')]()]['toString']());}else if(_0x5a8243[_0x56e9('0x3')]===_0x56e9('0xc')){if(_0x5a8243[_0x56e9('0xd')]==='string'&&_0x5a8243['key']){_0x365461[_0x56e9('0x5')](util['format'](_0x56e9('0xe'),_0x5a8243[_0x56e9('0xf')],_0x5a8243[_0x56e9('0x10')]));}else if(_0x5a8243['keyType']===_0x56e9('0x6')&&_0x5a8243[_0x56e9('0x7')]&&_0x5a8243['key']){_0x28f042[_0x5a8243['variableName']]&&_0x365461[_0x56e9('0x5')](util[_0x56e9('0x11')]('%s:\x20%s',_0x5a8243[_0x56e9('0xf')],_0x28f042[_0x5a8243[_0x56e9('0x7')]]));}else if(_0x5a8243['keyType']===_0x56e9('0x9')&&_0x5a8243[_0x56e9('0xa')]&&_0x5a8243[_0x56e9('0xa')][_0x56e9('0x12')]&&_0x5a8243['key']){_0x28f042[_0x5a8243[_0x56e9('0xa')][_0x56e9('0x12')][_0x56e9('0xb')]()]&&_0x365461['push'](util[_0x56e9('0x11')](_0x56e9('0xe'),_0x5a8243['key'],_0x28f042[_0x5a8243[_0x56e9('0xa')][_0x56e9('0x12')][_0x56e9('0xb')]()]));}}}}return _0x365461[_0x56e9('0x13')](_0xae5f1b);};exports['stripTrailingSlash']=function(_0x1563c6){var _0x578e72=_0x1563c6[_0x56e9('0x14')](-0x1);if(_0x578e72==='/'){_0x1563c6=_0x1563c6['substring'](0x0,_0x1563c6[_0x56e9('0x15')](_0x578e72));}return _0x1563c6;};exports[_0x56e9('0x16')]=function(_0x3acbd0){if(!_[_0x56e9('0x17')](_0x3acbd0)&&_0x3acbd0!==''){var _0x491594=/^(([^<>()\[\]\\.,;:\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 _0x491594[_0x56e9('0x18')](String(_0x3acbd0)[_0x56e9('0xb')]());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index 0abe119..f2f7af8 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 _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x51bb81,_0x2b55f0){var _0x260a19=function(_0x59322d){while(--_0x59322d){_0x51bb81['push'](_0x51bb81['shift']());}};_0x260a19(++_0x2b55f0);}(_0xe706,0xa3));var _0x6e70=function(_0x1ca7ed,_0x2cccb4){_0x1ca7ed=_0x1ca7ed-0x0;var _0x5d706a=_0xe706[_0x1ca7ed];return _0x5d706a;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});}; \ No newline at end of file +var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index e91f1a5..784e1fa 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 _0xae29=['none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','monitor_format','lastevent','toUpperCase','lodash','md5','util','../../../../config/environment','../../../../config/logger','redis','emit','application/json','format','remoteUri','POST','merge','name','getString','Subjects','Descriptions','then','Ticket\x20created!','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','info','Agent\x20found!','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','results','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','%s:%s','password','authType','token','%s/token:%s','username','toString','base64','debug','stringify','defaults','GET','map','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','custom_fields','push','variable','variableName','customVariable','Variable','queue','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat'];(function(_0x29d88b,_0x3480b8){var _0x8c0bde=function(_0xc8bb1a){while(--_0xc8bb1a){_0x29d88b['push'](_0x29d88b['shift']());}};_0x8c0bde(++_0x3480b8);}(_0xae29,0xe1));var _0x9ae2=function(_0x44eebe,_0x94fd9d){_0x44eebe=_0x44eebe-0x0;var _0x32fdfa=_0xae29[_0x44eebe];return _0x32fdfa;};'use strict';var _=require(_0x9ae2('0x0'));var rp=require('request-promise');var md5=require(_0x9ae2('0x1'));var util=require(_0x9ae2('0x2'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x9ae2('0x3'));var logger=require(_0x9ae2('0x4'))('zendesk');config[_0x9ae2('0x5')]=_['defaults'](config[_0x9ae2('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x258648,_0x2c53ba,_0x18a333){io['to'](_0x258648)[_0x9ae2('0x6')](_0x2c53ba,_0x18a333);}var headers={'Content-Type':'application/json','Accept':_0x9ae2('0x7')};function getTicket(_0x2940e6,_0x16f216,_0x264bab,_0x2e9dc0,_0x5a19e4){logger['info']('Creating\x20new\x20ticket...');return request({'uri':util[_0x9ae2('0x8')]('%s/tickets.json',_0x2940e6[_0x9ae2('0x9')]),'method':_0x9ae2('0xa'),'body':{'ticket':_[_0x9ae2('0xb')]({'requester_id':_0x264bab['id'],'submitter_id':_0x16f216?_0x16f216['id']:undefined,'assignee_id':_0x16f216?_0x16f216['id']:undefined,'tags':getTags(_0x2e9dc0['Tags'],_0x9ae2('0xc')),'subject':intUtil[_0x9ae2('0xd')](_0x2e9dc0[_0x9ae2('0xe')],_0x5a19e4,'\x20'),'description':intUtil[_0x9ae2('0xd')](_0x2e9dc0[_0x9ae2('0xf')],_0x5a19e4,'\x0a'),'comment':{'public':![],'body':intUtil[_0x9ae2('0xd')](_0x2e9dc0['Descriptions'],_0x5a19e4,'\x0a')}},getCustomFields(_0x2e9dc0['Fields'],_0x5a19e4))}})[_0x9ae2('0x10')](function(_0x39c8ac){logger['info'](_0x9ae2('0x11'));return _0x39c8ac['ticket'];});}function getUser(_0x2b2ca8,_0x56cec9){if(intUtil['validateEmail'](_0x56cec9)){logger['info'](_0x9ae2('0x12'),_0x56cec9);return request({'uri':util['format'](_0x9ae2('0x13'),_0x2b2ca8['remoteUri']),'qs':{'query':util['format'](_0x9ae2('0x14'),_0x56cec9)}})[_0x9ae2('0x10')](function(_0x4a1eaa){if(_0x4a1eaa[_0x9ae2('0x15')]){logger[_0x9ae2('0x16')](_0x9ae2('0x17'));return _[_0x9ae2('0x18')](_0x4a1eaa['results'],{'email':_0x56cec9,'role':'agent'});}else{logger[_0x9ae2('0x16')](_0x9ae2('0x19'));return request({'uri':util[_0x9ae2('0x8')](_0x9ae2('0x1a'),_0x2b2ca8[_0x9ae2('0x9')])})[_0x9ae2('0x10')](function(_0x1910d6){logger[_0x9ae2('0x16')](_0x9ae2('0x1b'));return _0x1910d6['user'];});}});}else{logger[_0x9ae2('0x16')](_0x9ae2('0x19'));return request({'uri':util['format']('%s/users/me.json',_0x2b2ca8[_0x9ae2('0x9')])})['then'](function(_0x1cec6f){logger[_0x9ae2('0x16')]('Admin\x20account\x20selected.');return _0x1cec6f[_0x9ae2('0x1c')];});}}function getEndUser(_0x593d43,_0x4c3288,_0x3e18b9){logger[_0x9ae2('0x16')]('Searching\x20enduser\x20with\x20phone',_0x3e18b9);return request({'uri':util[_0x9ae2('0x8')](_0x9ae2('0x13'),_0x593d43['remoteUri']),'qs':{'query':util[_0x9ae2('0x8')]('type:user\x20role:end-user\x20phone:%s',_0x3e18b9)}})[_0x9ae2('0x10')](function(_0x4ea199){var _0x4dbc28;if(_0x4ea199[_0x9ae2('0x1d')][_0x9ae2('0x1e')]){_0x4ea199['results']=_[_0x9ae2('0x1f')](_0x4ea199[_0x9ae2('0x1d')],{'suspended':![],'role':_0x9ae2('0x20')});if(_0x4ea199['results'][_0x9ae2('0x1e')]){_0x4dbc28=_[_0x9ae2('0x21')](_0x4ea199['results']);}}if(_0x4dbc28){logger['info'](_0x9ae2('0x22'));return _0x4dbc28;}else{logger['info'](_0x9ae2('0x23'));return request({'uri':util[_0x9ae2('0x8')](_0x9ae2('0x24'),_0x593d43[_0x9ae2('0x9')]),'method':_0x9ae2('0xa'),'body':{'user':{'role':_0x9ae2('0x20'),'name':util['format'](_0x9ae2('0x25'),_0x4c3288||_0x3e18b9),'phone':_0x3e18b9}}})[_0x9ae2('0x10')](function(_0x451719){logger[_0x9ae2('0x16')](_0x9ae2('0x26'));return _0x451719[_0x9ae2('0x1c')];});}});}function getAuth(_0x1463c4){var _0xe1c7aa;if(_0x1463c4['authType']==='password'){_0xe1c7aa=util['format'](_0x9ae2('0x27'),_0x1463c4['username'],_0x1463c4[_0x9ae2('0x28')]);}else if(_0x1463c4[_0x9ae2('0x29')]===_0x9ae2('0x2a')){_0xe1c7aa=util[_0x9ae2('0x8')](_0x9ae2('0x2b'),_0x1463c4[_0x9ae2('0x2c')],_0x1463c4['token']);}return util[_0x9ae2('0x8')]('Basic\x20%s',new Buffer(_0xe1c7aa)[_0x9ae2('0x2d')](_0x9ae2('0x2e')));}function request(_0x5a5e93){logger[_0x9ae2('0x2f')]('[HTTP]',JSON[_0x9ae2('0x30')](_0x5a5e93));return rp(_[_0x9ae2('0x31')](_0x5a5e93,{'method':_0x9ae2('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x309b72,_0x103552){var _0xcce644=[];if(_0x309b72&&_0x309b72[_0x9ae2('0x1e')]>0x0){_0xcce644=_[_0x9ae2('0x33')](_0x309b72,_0x103552);}return _0xcce644;}function getCustomFields(_0x46c984,_0x44630e){var _0x396457=[];var _0x2b4de1={'custom_fields':[]};if(_0x46c984[_0x9ae2('0x1e')]>0x0){_['forEach'](_0x46c984,function(_0x90d20f){if(_[_0x9ae2('0x34')]([_0x9ae2('0x35'),_0x9ae2('0x36')],_0x90d20f[_0x9ae2('0x37')])&&_0x90d20f[_0x9ae2('0x38')]&&!_0x90d20f[_0x9ae2('0x39')]){_0x2b4de1[_0x90d20f['nameField'][_0x9ae2('0x3a')]()]=_0x90d20f[_0x9ae2('0x3b')][_0x9ae2('0x2d')]();}else if(_[_0x9ae2('0x34')]([_0x9ae2('0x35'),'picklist'],_0x90d20f[_0x9ae2('0x37')])&&_0x90d20f[_0x9ae2('0x3c')]&&_0x90d20f['customField']){_0x2b4de1[_0x9ae2('0x3d')][_0x9ae2('0x3e')]({'id':_0x90d20f[_0x9ae2('0x3c')],'value':_0x90d20f['content'][_0x9ae2('0x2d')]()});}else if(_0x90d20f[_0x9ae2('0x37')]===_0x9ae2('0x3f')&&_0x90d20f[_0x9ae2('0x40')]&&_0x90d20f[_0x9ae2('0x3c')]&&_0x90d20f[_0x9ae2('0x39')]){_0x44630e[_0x90d20f[_0x9ae2('0x40')]]&&_0x2b4de1['custom_fields']['push']({'id':_0x90d20f[_0x9ae2('0x3c')],'value':_0x44630e[_0x90d20f['variableName']][_0x9ae2('0x2d')]()});}else if(_0x90d20f[_0x9ae2('0x37')]===_0x9ae2('0x41')&&_0x90d20f[_0x9ae2('0x42')]&&_0x90d20f[_0x9ae2('0x42')][_0x9ae2('0xc')]&&_0x90d20f[_0x9ae2('0x3c')]&&_0x90d20f[_0x9ae2('0x39')]){_0x44630e[_0x90d20f[_0x9ae2('0x42')][_0x9ae2('0xc')][_0x9ae2('0x3a')]()]&&_0x2b4de1[_0x9ae2('0x3d')][_0x9ae2('0x3e')]({'id':_0x90d20f[_0x9ae2('0x3c')],'value':_0x44630e[_0x90d20f[_0x9ae2('0x42')]['name'][_0x9ae2('0x3a')]()][_0x9ae2('0x2d')]()});}});}return _0x2b4de1;}exports[_0x9ae2('0x43')]=function(_0x34e734,_0x5d4271,_0x22dec4,_0x327923,_0x213dae,_0x3b0c54){var _0x586904,_0x5ea5a7;_0x3b0c54['remoteUri']=intUtil['stripTrailingSlash'](_0x3b0c54['remoteUri']);_0x3b0c54[_0x9ae2('0x44')]=intUtil[_0x9ae2('0x45')](_0x3b0c54[_0x9ae2('0x44')]);if(_0x213dae&&_0x213dae['monitor_format']){logger[_0x9ae2('0x16')](_0x9ae2('0x46'),_0x9ae2('0x47'));_0x5d4271[_0x9ae2('0x48')]=util[_0x9ae2('0x8')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3b0c54['serverUrl'],_0x5d4271[_0x9ae2('0x49')],md5(_0x5d4271[_0x9ae2('0x49')]));}else{_0x5d4271[_0x9ae2('0x48')]='';}headers[_0x9ae2('0x4a')]=getAuth(_0x3b0c54);return getUser(_0x3b0c54,_0x327923[_0x9ae2('0x4b')])['then'](function(_0x38c4fd){_0x586904=_0x38c4fd;logger[_0x9ae2('0x16')](_0x9ae2('0x4c'),_0x586904['id']);return getEndUser(_0x3b0c54,_0x5d4271[_0x9ae2('0x4d')],_0x5d4271[_0x9ae2('0x4e')]);})[_0x9ae2('0x10')](function(_0x1c120c){_0x5ea5a7=_0x1c120c;logger[_0x9ae2('0x16')](_0x9ae2('0x4f'),_0x5ea5a7['id']);return getTicket(_0x3b0c54,_0x586904,_0x5ea5a7,_0x22dec4,_0x5d4271);})['then'](function(_0xd5b4e0){if(_0xd5b4e0){logger[_0x9ae2('0x16')](_0x9ae2('0x50'),_0xd5b4e0['id']);switch(_0x3b0c54[_0x9ae2('0x37')]){case _0x9ae2('0x51'):logger[_0x9ae2('0x16')](_0x9ae2('0x46'),_0x9ae2('0x52'));return request({'uri':util[_0x9ae2('0x8')](_0x9ae2('0x53'),_0x3b0c54['remoteUri'],_0x586904['id'],_0xd5b4e0['id']),'method':_0x9ae2('0xa')});case _0x9ae2('0x54'):logger[_0x9ae2('0x16')](_0x9ae2('0x46'),_0x9ae2('0x55'));emit(util[_0x9ae2('0x8')](_0x9ae2('0x56'),_0x327923[_0x9ae2('0xc')]),_0x9ae2('0x57'),{'uri':util[_0x9ae2('0x8')](_0x9ae2('0x58'),_0x3b0c54['remoteUri'][_0x9ae2('0x59')]('/api/v2',''),_0xd5b4e0['id'])});break;default:logger[_0x9ae2('0x5a')](_0x9ae2('0x46'),_0x9ae2('0x5b'));}}})[_0x9ae2('0x5c')](function(_0x311dd6){logger[_0x9ae2('0x5a')](_0x9ae2('0x5d'),util['inspect'](_0x311dd6,{'showHidden':!![],'depth':null}));});};exports[_0x9ae2('0x5e')]=function(_0xf4c01e,_0x5e4f3e,_0x6484c8,_0x52ecd2,_0x6b854c,_0x2fe9a4,_0x1eb187){var _0x281a40,_0x56f812;_0x2fe9a4[_0x9ae2('0x9')]=intUtil['stripTrailingSlash'](_0x2fe9a4[_0x9ae2('0x9')]);_0x2fe9a4['serverUrl']=intUtil[_0x9ae2('0x45')](_0x2fe9a4[_0x9ae2('0x44')]);if(_0x1eb187&&_0x1eb187[_0x9ae2('0x5f')]&&_0x1eb187[_0x9ae2('0x5f')]!==_0x9ae2('0x60')){logger['info'](_0x9ae2('0x61'),'Recording\x20is\x20enabled!');_0x5e4f3e[_0x9ae2('0x48')]=util[_0x9ae2('0x8')](_0x9ae2('0x62'),_0x2fe9a4[_0x9ae2('0x44')],_0x5e4f3e[_0x9ae2('0x49')],md5(_0x5e4f3e[_0x9ae2('0x49')]));}headers['Authorization']=getAuth(_0x2fe9a4);return getUser(_0x2fe9a4,_0x52ecd2[_0x9ae2('0x4b')])[_0x9ae2('0x10')](function(_0x115181){_0x281a40=_0x115181;logger[_0x9ae2('0x16')](_0x9ae2('0x4c'),_0x281a40['id']);return getEndUser(_0x2fe9a4,_0x5e4f3e[_0x9ae2('0x63')],_0x5e4f3e[_0x9ae2('0x64')]);})[_0x9ae2('0x10')](function(_0x385c64){_0x56f812=_0x385c64;logger[_0x9ae2('0x16')](_0x9ae2('0x4f'),_0x56f812['id']);return getTicket(_0x2fe9a4,_0x281a40,_0x56f812,_0x6484c8,_0x5e4f3e);})[_0x9ae2('0x10')](function(_0x2d75bb){if(_0x2d75bb){logger['info'](_0x9ae2('0x50'),_0x2d75bb['id']);switch(_0x2fe9a4[_0x9ae2('0x37')]){case'integrationTab':logger[_0x9ae2('0x16')](_0x9ae2('0x61'),_0x9ae2('0x52'));return request({'uri':util[_0x9ae2('0x8')](_0x9ae2('0x53'),_0x2fe9a4[_0x9ae2('0x9')],_0x281a40['id'],_0x2d75bb['id']),'method':'POST'});case _0x9ae2('0x54'):logger[_0x9ae2('0x16')]('[OUTBOUND]',_0x9ae2('0x55'));emit(util['format']('user:%s',_0x52ecd2[_0x9ae2('0xc')]),_0x9ae2('0x57'),{'uri':util['format']('%s/agent/tickets/%s',_0x2fe9a4[_0x9ae2('0x9')]['replace']('/api/v2',''),_0x2d75bb['id'])});break;default:logger[_0x9ae2('0x5a')](_0x9ae2('0x61'),_0x9ae2('0x5b'));}}})[_0x9ae2('0x5c')](function(_0xc13130){logger[_0x9ae2('0x5a')](_0x9ae2('0x65'),util[_0x9ae2('0x66')](_0xc13130,{'showHidden':!![],'depth':null}));});};exports[_0x9ae2('0x67')]=function(_0x34cdfa,_0x3eada9,_0x33b803,_0x1e4d30,_0x28e628,_0x4a344d){var _0x285080,_0x3030af;_0x4a344d[_0x9ae2('0x9')]=intUtil[_0x9ae2('0x45')](_0x4a344d['remoteUri']);_0x4a344d[_0x9ae2('0x44')]=intUtil[_0x9ae2('0x45')](_0x4a344d[_0x9ae2('0x44')]);if(_0x28e628&&_0x28e628[_0x9ae2('0x68')]){logger[_0x9ae2('0x16')]('['+_0x3eada9['lastevent']['toUpperCase']()+']',_0x9ae2('0x47'));_0x3eada9[_0x9ae2('0x48')]=util['format'](_0x9ae2('0x62'),_0x4a344d[_0x9ae2('0x44')],_0x3eada9[_0x9ae2('0x49')],md5(_0x3eada9[_0x9ae2('0x49')]));}else{_0x3eada9['recordingURL']='';}headers[_0x9ae2('0x4a')]=getAuth(_0x4a344d);return getUser(_0x4a344d)[_0x9ae2('0x10')](function(_0x587c8c){_0x285080=_0x587c8c;logger[_0x9ae2('0x16')](_0x9ae2('0x4c'),_0x285080['id']);return getEndUser(_0x4a344d,_0x3eada9['calleridname'],_0x3eada9[_0x9ae2('0x4e')]);})[_0x9ae2('0x10')](function(_0x170b3c){_0x3030af=_0x170b3c;logger[_0x9ae2('0x16')](_0x9ae2('0x4f'),_0x3030af['id']);return getTicket(_0x4a344d,_0x285080,_0x3030af,_0x33b803,_0x3eada9);})[_0x9ae2('0x10')](function(_0xcd4523){if(_0xcd4523){logger[_0x9ae2('0x16')]('The\x20Ticket\x20ID\x20is:',_0xcd4523['id']);}})[_0x9ae2('0x5c')](function(_0x3ff6f4){logger[_0x9ae2('0x5a')]('['+_0x3eada9[_0x9ae2('0x69')][_0x9ae2('0x6a')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0x9ae2('0x66')](_0x3ff6f4,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xec4c=['outbound','recordingFormat','none','Recording\x20is\x20enabled!','Authorization','destcalleridname','destcalleridnum','[OUTBOUND]','user:%s','/api/v2','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','toUpperCase','calleridnum','lastevent','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','./util','../../../../config/logger','defaults','redis','localhost','emit','application/json','info','Creating\x20new\x20ticket...','format','remoteUri','POST','merge','Tags','name','Subjects','getString','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','%s/search.json','type:user\x20role:agent\x20email:%s','count','find','agent','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','results','length','filter','end-user','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','token','%s/token:%s','username','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','idField','push','content','variable','variableName','custom_fields','customVariable','Variable','queue','stripTrailingSlash','serverUrl','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/agent/tickets/%s','replace','Zendesk\x20account\x20type\x20not\x20recognized','catch','error'];(function(_0x387662,_0x40f7a0){var _0x165513=function(_0x370dbd){while(--_0x370dbd){_0x387662['push'](_0x387662['shift']());}};_0x165513(++_0x40f7a0);}(_0xec4c,0xf7));var _0xcec4=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xec4c[_0x521929];return _0x632436;};'use strict';var _=require(_0xcec4('0x0'));var rp=require(_0xcec4('0x1'));var md5=require(_0xcec4('0x2'));var util=require(_0xcec4('0x3'));var Redis=require('ioredis');var intUtil=require(_0xcec4('0x4'));var config=require('../../../../config/environment');var logger=require(_0xcec4('0x5'))('zendesk');config['redis']=_[_0xcec4('0x6')](config[_0xcec4('0x7')],{'host':_0xcec4('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x303854,_0x2d98f3,_0x10e6d3){io['to'](_0x303854)[_0xcec4('0x9')](_0x2d98f3,_0x10e6d3);}var headers={'Content-Type':_0xcec4('0xa'),'Accept':_0xcec4('0xa')};function getTicket(_0x3df479,_0x11e533,_0x3b2ff3,_0x15dc5d,_0x5ebfb5){logger[_0xcec4('0xb')](_0xcec4('0xc'));return request({'uri':util[_0xcec4('0xd')]('%s/tickets.json',_0x3df479[_0xcec4('0xe')]),'method':_0xcec4('0xf'),'body':{'ticket':_[_0xcec4('0x10')]({'requester_id':_0x3b2ff3['id'],'submitter_id':_0x11e533?_0x11e533['id']:undefined,'assignee_id':_0x11e533?_0x11e533['id']:undefined,'tags':getTags(_0x15dc5d[_0xcec4('0x11')],_0xcec4('0x12')),'subject':intUtil['getString'](_0x15dc5d[_0xcec4('0x13')],_0x5ebfb5,'\x20'),'description':intUtil[_0xcec4('0x14')](_0x15dc5d[_0xcec4('0x15')],_0x5ebfb5,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x15dc5d[_0xcec4('0x15')],_0x5ebfb5,'\x0a')}},getCustomFields(_0x15dc5d[_0xcec4('0x16')],_0x5ebfb5))}})[_0xcec4('0x17')](function(_0xba7f1a){logger[_0xcec4('0xb')](_0xcec4('0x18'));return _0xba7f1a[_0xcec4('0x19')];});}function getUser(_0x1a4bc8,_0x4330cb){if(intUtil[_0xcec4('0x1a')](_0x4330cb)){logger[_0xcec4('0xb')]('Getting\x20agent\x20with\x20email',_0x4330cb);return request({'uri':util['format'](_0xcec4('0x1b'),_0x1a4bc8['remoteUri']),'qs':{'query':util[_0xcec4('0xd')](_0xcec4('0x1c'),_0x4330cb)}})[_0xcec4('0x17')](function(_0x2e62f1){if(_0x2e62f1[_0xcec4('0x1d')]){logger[_0xcec4('0xb')]('Agent\x20found!');return _[_0xcec4('0x1e')](_0x2e62f1['results'],{'email':_0x4330cb,'role':_0xcec4('0x1f')});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/users/me.json',_0x1a4bc8[_0xcec4('0xe')])})[_0xcec4('0x17')](function(_0x251a79){logger[_0xcec4('0xb')](_0xcec4('0x20'));return _0x251a79[_0xcec4('0x21')];});}});}else{logger[_0xcec4('0xb')](_0xcec4('0x22'));return request({'uri':util[_0xcec4('0xd')](_0xcec4('0x23'),_0x1a4bc8[_0xcec4('0xe')])})[_0xcec4('0x17')](function(_0x3cc71b){logger[_0xcec4('0xb')](_0xcec4('0x20'));return _0x3cc71b[_0xcec4('0x21')];});}}function getEndUser(_0x221aa5,_0x5aa0b4,_0x25e729){logger[_0xcec4('0xb')](_0xcec4('0x24'),_0x25e729);return request({'uri':util[_0xcec4('0xd')]('%s/search.json',_0x221aa5['remoteUri']),'qs':{'query':util[_0xcec4('0xd')](_0xcec4('0x25'),_0x25e729)}})[_0xcec4('0x17')](function(_0x3c6072){var _0x3ababc;if(_0x3c6072[_0xcec4('0x26')][_0xcec4('0x27')]){_0x3c6072[_0xcec4('0x26')]=_[_0xcec4('0x28')](_0x3c6072[_0xcec4('0x26')],{'suspended':![],'role':_0xcec4('0x29')});if(_0x3c6072[_0xcec4('0x26')][_0xcec4('0x27')]){_0x3ababc=_[_0xcec4('0x2a')](_0x3c6072[_0xcec4('0x26')]);}}if(_0x3ababc){logger['info']('Enduser\x20found!');return _0x3ababc;}else{logger[_0xcec4('0xb')](_0xcec4('0x2b'));return request({'uri':util['format'](_0xcec4('0x2c'),_0x221aa5['remoteUri']),'method':'POST','body':{'user':{'role':'end-user','name':util['format'](_0xcec4('0x2d'),_0x5aa0b4||_0x25e729),'phone':_0x25e729}}})[_0xcec4('0x17')](function(_0x2e130e){logger[_0xcec4('0xb')](_0xcec4('0x2e'));return _0x2e130e[_0xcec4('0x21')];});}});}function getAuth(_0x527795){var _0xdfa0be;if(_0x527795[_0xcec4('0x2f')]===_0xcec4('0x30')){_0xdfa0be=util[_0xcec4('0xd')](_0xcec4('0x31'),_0x527795['username'],_0x527795[_0xcec4('0x30')]);}else if(_0x527795[_0xcec4('0x2f')]===_0xcec4('0x32')){_0xdfa0be=util[_0xcec4('0xd')](_0xcec4('0x33'),_0x527795[_0xcec4('0x34')],_0x527795['token']);}return util['format'](_0xcec4('0x35'),new Buffer(_0xdfa0be)[_0xcec4('0x36')](_0xcec4('0x37')));}function request(_0x123e5c){logger[_0xcec4('0x38')](_0xcec4('0x39'),JSON[_0xcec4('0x3a')](_0x123e5c));return rp(_[_0xcec4('0x6')](_0x123e5c,{'method':_0xcec4('0x3b'),'headers':headers,'json':!![]}));}function getTags(_0x5536e4,_0x373166){var _0x25a9c9=[];if(_0x5536e4&&_0x5536e4['length']>0x0){_0x25a9c9=_[_0xcec4('0x3c')](_0x5536e4,_0x373166);}return _0x25a9c9;}function getCustomFields(_0x2d96cf,_0x45183a){var _0x35b3d5=[];var _0x756e1b={'custom_fields':[]};if(_0x2d96cf[_0xcec4('0x27')]>0x0){_[_0xcec4('0x3d')](_0x2d96cf,function(_0x53f6a6){if(_[_0xcec4('0x3e')]([_0xcec4('0x3f'),_0xcec4('0x40')],_0x53f6a6[_0xcec4('0x41')])&&_0x53f6a6[_0xcec4('0x42')]&&!_0x53f6a6[_0xcec4('0x43')]){_0x756e1b[_0x53f6a6['nameField'][_0xcec4('0x44')]()]=_0x53f6a6['content'][_0xcec4('0x36')]();}else if(_[_0xcec4('0x3e')]([_0xcec4('0x3f'),'picklist'],_0x53f6a6[_0xcec4('0x41')])&&_0x53f6a6[_0xcec4('0x45')]&&_0x53f6a6[_0xcec4('0x43')]){_0x756e1b['custom_fields'][_0xcec4('0x46')]({'id':_0x53f6a6['idField'],'value':_0x53f6a6[_0xcec4('0x47')]['toString']()});}else if(_0x53f6a6[_0xcec4('0x41')]===_0xcec4('0x48')&&_0x53f6a6['variableName']&&_0x53f6a6['idField']&&_0x53f6a6[_0xcec4('0x43')]){_0x45183a[_0x53f6a6[_0xcec4('0x49')]]&&_0x756e1b[_0xcec4('0x4a')][_0xcec4('0x46')]({'id':_0x53f6a6[_0xcec4('0x45')],'value':_0x45183a[_0x53f6a6[_0xcec4('0x49')]][_0xcec4('0x36')]()});}else if(_0x53f6a6[_0xcec4('0x41')]===_0xcec4('0x4b')&&_0x53f6a6[_0xcec4('0x4c')]&&_0x53f6a6[_0xcec4('0x4c')][_0xcec4('0x12')]&&_0x53f6a6[_0xcec4('0x45')]&&_0x53f6a6['customField']){_0x45183a[_0x53f6a6[_0xcec4('0x4c')][_0xcec4('0x12')][_0xcec4('0x44')]()]&&_0x756e1b[_0xcec4('0x4a')]['push']({'id':_0x53f6a6[_0xcec4('0x45')],'value':_0x45183a[_0x53f6a6[_0xcec4('0x4c')][_0xcec4('0x12')][_0xcec4('0x44')]()][_0xcec4('0x36')]()});}});}return _0x756e1b;}exports[_0xcec4('0x4d')]=function(_0x10b225,_0x199039,_0x21d013,_0x5d5af6,_0x161489,_0x32def6){var _0x54f519,_0x5109b1;_0x32def6[_0xcec4('0xe')]=intUtil[_0xcec4('0x4e')](_0x32def6[_0xcec4('0xe')]);_0x32def6[_0xcec4('0x4f')]=intUtil['stripTrailingSlash'](_0x32def6['serverUrl']);if(_0x161489&&_0x161489['monitor_format']){logger[_0xcec4('0xb')](_0xcec4('0x50'),'Recording\x20is\x20enabled!');_0x199039['recordingURL']=util['format'](_0xcec4('0x51'),_0x32def6['serverUrl'],_0x199039[_0xcec4('0x52')],md5(_0x199039[_0xcec4('0x52')]));}else{_0x199039[_0xcec4('0x53')]='';}headers['Authorization']=getAuth(_0x32def6);return getUser(_0x32def6,_0x5d5af6[_0xcec4('0x54')])[_0xcec4('0x17')](function(_0x257369){_0x54f519=_0x257369;logger[_0xcec4('0xb')](_0xcec4('0x55'),_0x54f519['id']);return getEndUser(_0x32def6,_0x199039[_0xcec4('0x56')],_0x199039['calleridnum']);})[_0xcec4('0x17')](function(_0x537d77){_0x5109b1=_0x537d77;logger[_0xcec4('0xb')](_0xcec4('0x57'),_0x5109b1['id']);return getTicket(_0x32def6,_0x54f519,_0x5109b1,_0x21d013,_0x199039);})[_0xcec4('0x17')](function(_0x5bba5b){if(_0x5bba5b){logger['info'](_0xcec4('0x58'),_0x5bba5b['id']);switch(_0x32def6['type']){case _0xcec4('0x59'):logger[_0xcec4('0xb')](_0xcec4('0x50'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xcec4('0xd')](_0xcec4('0x5a'),_0x32def6['remoteUri'],_0x54f519['id'],_0x5bba5b['id']),'method':_0xcec4('0xf')});case'newTab':logger[_0xcec4('0xb')](_0xcec4('0x50'),_0xcec4('0x5b'));emit(util[_0xcec4('0xd')]('user:%s',_0x5d5af6[_0xcec4('0x12')]),_0xcec4('0x5c'),{'uri':util[_0xcec4('0xd')](_0xcec4('0x5d'),_0x32def6[_0xcec4('0xe')][_0xcec4('0x5e')]('/api/v2',''),_0x5bba5b['id'])});break;default:logger['error']('[QUEUE]',_0xcec4('0x5f'));}}})[_0xcec4('0x60')](function(_0xf418b){logger[_0xcec4('0x61')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0xf418b,{'showHidden':!![],'depth':null}));});};exports[_0xcec4('0x62')]=function(_0x333782,_0x578431,_0xac7cd2,_0x23ba24,_0x5bf804,_0x466ac6,_0x276011){var _0x15c675,_0x129430;_0x466ac6[_0xcec4('0xe')]=intUtil[_0xcec4('0x4e')](_0x466ac6[_0xcec4('0xe')]);_0x466ac6[_0xcec4('0x4f')]=intUtil['stripTrailingSlash'](_0x466ac6[_0xcec4('0x4f')]);if(_0x276011&&_0x276011[_0xcec4('0x63')]&&_0x276011[_0xcec4('0x63')]!==_0xcec4('0x64')){logger[_0xcec4('0xb')]('[OUTBOUND]',_0xcec4('0x65'));_0x578431[_0xcec4('0x53')]=util['format'](_0xcec4('0x51'),_0x466ac6[_0xcec4('0x4f')],_0x578431[_0xcec4('0x52')],md5(_0x578431[_0xcec4('0x52')]));}headers[_0xcec4('0x66')]=getAuth(_0x466ac6);return getUser(_0x466ac6,_0x23ba24['email'])[_0xcec4('0x17')](function(_0x12d0d2){_0x15c675=_0x12d0d2;logger[_0xcec4('0xb')](_0xcec4('0x55'),_0x15c675['id']);return getEndUser(_0x466ac6,_0x578431[_0xcec4('0x67')],_0x578431[_0xcec4('0x68')]);})[_0xcec4('0x17')](function(_0x5ca72f){_0x129430=_0x5ca72f;logger[_0xcec4('0xb')]('The\x20Enduser\x20ID\x20is:',_0x129430['id']);return getTicket(_0x466ac6,_0x15c675,_0x129430,_0xac7cd2,_0x578431);})[_0xcec4('0x17')](function(_0x612845){if(_0x612845){logger[_0xcec4('0xb')]('The\x20Ticket\x20ID\x20is:',_0x612845['id']);switch(_0x466ac6[_0xcec4('0x41')]){case _0xcec4('0x59'):logger[_0xcec4('0xb')](_0xcec4('0x69'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xcec4('0xd')](_0xcec4('0x5a'),_0x466ac6[_0xcec4('0xe')],_0x15c675['id'],_0x612845['id']),'method':_0xcec4('0xf')});case'newTab':logger[_0xcec4('0xb')](_0xcec4('0x69'),_0xcec4('0x5b'));emit(util[_0xcec4('0xd')](_0xcec4('0x6a'),_0x23ba24[_0xcec4('0x12')]),_0xcec4('0x5c'),{'uri':util['format'](_0xcec4('0x5d'),_0x466ac6[_0xcec4('0xe')]['replace'](_0xcec4('0x6b'),''),_0x612845['id'])});break;default:logger[_0xcec4('0x61')](_0xcec4('0x69'),_0xcec4('0x5f'));}}})[_0xcec4('0x60')](function(_0x1b1dda){logger[_0xcec4('0x61')](_0xcec4('0x6c'),util[_0xcec4('0x6d')](_0x1b1dda,{'showHidden':!![],'depth':null}));});};exports[_0xcec4('0x6e')]=function(_0x569a29,_0x1bba62,_0x16e13f,_0x295e4f,_0x54a34a,_0x597a4f){var _0x36893a,_0x58b48d;_0x597a4f[_0xcec4('0xe')]=intUtil[_0xcec4('0x4e')](_0x597a4f['remoteUri']);_0x597a4f['serverUrl']=intUtil[_0xcec4('0x4e')](_0x597a4f[_0xcec4('0x4f')]);if(_0x54a34a&&_0x54a34a['monitor_format']){logger[_0xcec4('0xb')]('['+_0x1bba62['lastevent'][_0xcec4('0x6f')]()+']',_0xcec4('0x65'));_0x1bba62[_0xcec4('0x53')]=util[_0xcec4('0xd')](_0xcec4('0x51'),_0x597a4f[_0xcec4('0x4f')],_0x1bba62[_0xcec4('0x52')],md5(_0x1bba62[_0xcec4('0x52')]));}else{_0x1bba62[_0xcec4('0x53')]='';}headers[_0xcec4('0x66')]=getAuth(_0x597a4f);return getUser(_0x597a4f)[_0xcec4('0x17')](function(_0x111988){_0x36893a=_0x111988;logger[_0xcec4('0xb')](_0xcec4('0x55'),_0x36893a['id']);return getEndUser(_0x597a4f,_0x1bba62[_0xcec4('0x56')],_0x1bba62[_0xcec4('0x70')]);})[_0xcec4('0x17')](function(_0x17f2ce){_0x58b48d=_0x17f2ce;logger[_0xcec4('0xb')](_0xcec4('0x57'),_0x58b48d['id']);return getTicket(_0x597a4f,_0x36893a,_0x58b48d,_0x16e13f,_0x1bba62);})[_0xcec4('0x17')](function(_0x1d5870){if(_0x1d5870){logger[_0xcec4('0xb')](_0xcec4('0x58'),_0x1d5870['id']);}})[_0xcec4('0x60')](function(_0x234a5b){logger[_0xcec4('0x61')]('['+_0x1bba62[_0xcec4('0x71')][_0xcec4('0x6f')]()+']'+_0xcec4('0x72'),util[_0xcec4('0x6d')](_0x234a5b,{'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 b4ede31..e0881f1 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 _0xb145=['merge','Fields','/crm/v2/Calls','SUCCESS','Call\x20created!','details','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','/downloads?type=uniqueid&token=','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','[OUTBOUND]','zoho.eu','com','destcalleridname','destcalleridnum','unmanaged','toUpperCase','lodash','request-promise','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','[HTTP]','stringify','length','forEach','includes','picklist','type','idField','content','toString','variableName','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','seconds','catch','error','stack','info','GET','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','users','isArrayLikeObject','findIndex','email','Using\x20the\x20admin\x20account!','profile','Administrator','user','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','startCase','role','first_name','last_name','Zoho-oauthtoken\x20','code','log','CREATE\x20ERROR','moduleSearch','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','moduleCreate','nothing','contact','lead','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Subjects','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','format','lastevent','called','Call_Result','Called','complete','connect','rejected','Rejected','abandoned','Abandoned','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb145,0x15f));var _0x5b14=function(_0x42de20,_0x474f5d){_0x42de20=_0x42de20-0x0;var _0x28c3b6=_0xb145[_0x42de20];return _0x28c3b6;};'use strict';var _=require(_0x5b14('0x0'));var rp=require(_0x5b14('0x1'));var md5=require('md5');var util=require(_0x5b14('0x2'));var intUtil=require(_0x5b14('0x3'));var moment=require(_0x5b14('0x4'));var Redis=require(_0x5b14('0x5'));var BPromise=require(_0x5b14('0x6'));var config=require(_0x5b14('0x7'));var logger=require(_0x5b14('0x8'))(_0x5b14('0x9'));config[_0x5b14('0xa')]=_[_0x5b14('0xb')](config[_0x5b14('0xa')],{'host':_0x5b14('0xc'),'port':0x18eb});var io=require(_0x5b14('0xd'))(new Redis(config[_0x5b14('0xa')]));function emit(_0x231917,_0x195454,_0x32bf4f){io['to'](_0x231917)[_0x5b14('0xe')](_0x195454,_0x32bf4f);}function request(_0x2ab9b1){logger['debug'](_0x5b14('0xf'),JSON[_0x5b14('0x10')](_0x2ab9b1));return rp(_0x2ab9b1);}function getCustomFields(_0x355149,_0x3f1d4c){var _0x44d5b0={};if(_0x355149[_0x5b14('0x11')]>0x0){_[_0x5b14('0x12')](_0x355149,function(_0x30fc38){if(_[_0x5b14('0x13')](['string',_0x5b14('0x14')],_0x30fc38[_0x5b14('0x15')])&&_0x30fc38[_0x5b14('0x16')]){_0x44d5b0[_0x30fc38[_0x5b14('0x16')]]=_0x30fc38[_0x5b14('0x17')][_0x5b14('0x18')]();}else if(_0x30fc38[_0x5b14('0x15')]==='variable'&&_0x30fc38[_0x5b14('0x19')]&&_0x30fc38[_0x5b14('0x16')]&&_0x3f1d4c[_0x30fc38[_0x5b14('0x19')]]){_0x44d5b0[_0x30fc38[_0x5b14('0x16')]]=_0x3f1d4c[_0x30fc38[_0x5b14('0x19')]]['toString']();}else if(_0x30fc38['type']==='customVariable'&&_0x30fc38['Variable']&&_0x30fc38[_0x5b14('0x1a')][_0x5b14('0x1b')]&&_0x30fc38[_0x5b14('0x16')]&&_0x3f1d4c[_0x30fc38[_0x5b14('0x1a')]['name'][_0x5b14('0x1c')]()]){_0x44d5b0[_0x30fc38['idField']]=_0x3f1d4c[_0x30fc38[_0x5b14('0x1a')][_0x5b14('0x1b')][_0x5b14('0x1c')]()]['toString']();}});}return _0x44d5b0;}function getName(_0x193cd7){if(_0x193cd7[_0x5b14('0x1d')]('\x20')>0x0){var _0x26c302=_0x193cd7[_0x5b14('0x1e')](/ (.+)/);if(_0x26c302[0x1]){return _0x26c302;}}return[_0x193cd7,_0x193cd7];}var accountsTokens={};function getAccessToken(_0x5bed1c){return new Promise(function(_0x1ddeb6,_0x409075){if(!_['isNil'](accountsTokens[_0x5bed1c['id']])&&!_[_0x5b14('0x1f')](accountsTokens[_0x5bed1c['id']][_0x5b14('0x20')])){if(moment()[_0x5b14('0x21')](accountsTokens[_0x5bed1c['id']][_0x5b14('0x22')])){_0x1ddeb6(accountsTokens[_0x5bed1c['id']]['access_token']);}}var _0xb3a26f;switch(_0x5bed1c[_0x5b14('0x23')]){case'US':_0xb3a26f=_0x5b14('0x24');break;case'AU':_0xb3a26f='https://accounts.zoho.com.au';break;case'EU':_0xb3a26f=_0x5b14('0x25');break;case'IN':_0xb3a26f=_0x5b14('0x26');break;case'CN':_0xb3a26f=_0x5b14('0x27');break;default:_0xb3a26f=_0x5b14('0x25');break;}var _0x2e59ef={'method':_0x5b14('0x28'),'uri':_0xb3a26f+_0x5b14('0x29'),'qs':{'refresh_token':_0x5bed1c[_0x5b14('0x2a')],'client_id':_0x5bed1c[_0x5b14('0x2b')],'client_secret':_0x5bed1c[_0x5b14('0x2c')],'grant_type':_0x5b14('0x2d')},'json':!![]};return rp(_0x2e59ef)[_0x5b14('0x2e')](function(_0xa40b6b){accountsTokens[_0x5bed1c['id']]={'access_token':_0xa40b6b[_0x5b14('0x20')],'expires_in':moment()['add'](_0xa40b6b['expires_in'],_0x5b14('0x2f'))};_0x1ddeb6(_0xa40b6b['access_token']);})[_0x5b14('0x30')](function(_0x5c2c41){logger[_0x5b14('0x31')]('Failing\x20creating\x20the\x20access_token',_0x5c2c41[_0x5b14('0x32')]);_0x409075(_0x5c2c41);});});}function getUser(_0x4e6d46,_0x32ce4d,_0x4ca083,_0xf3b8f1){logger[_0x5b14('0x33')]('Search\x20user');return request({'method':_0x5b14('0x34'),'uri':util['format'](_0x5b14('0x35'),_0x32ce4d),'qs':{'type':_0x5b14('0x36')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x4e6d46},'json':!![]})[_0x5b14('0x2e')](function(_0xb19e63){if(_0xb19e63[_0x5b14('0x37')]){var _0x28aac0=-0x1;if(_[_0x5b14('0x38')](_0xb19e63[_0x5b14('0x37')])){if(!_[_0x5b14('0x1f')](_0xf3b8f1)){_0x28aac0=_[_0x5b14('0x39')](_0xb19e63[_0x5b14('0x37')],function(_0x404159){return _0x404159[_0x5b14('0x3a')]===_0xf3b8f1;});}if(_0x28aac0>=0x0){logger['info']('Agent\x20found!');}else{logger['info'](_0x5b14('0x3b'));_0x28aac0=_[_0x5b14('0x39')](_0xb19e63[_0x5b14('0x37')],function(_0x288904){return _0x288904[_0x5b14('0x3c')][_0x5b14('0x1b')]===_0x5b14('0x3d');});}return _0xb19e63[_0x5b14('0x37')][_0x28aac0];}else{if(_0xb19e63[_0x5b14('0x3e')][_0x5b14('0x3c')]['name']===_0x5b14('0x3d')){logger[_0x5b14('0x33')](_0x5b14('0x3b'));user=_0xb19e63['user'];return user;}else{logger[_0x5b14('0x31')]('The\x20failing\x20result\x20is',JSON[_0x5b14('0x10')](_0xb19e63));throw new Error(_0x5b14('0x3f')+JSON[_0x5b14('0x10')](_0xb19e63));}}}else{logger['error']('The\x20failing\x20result\x20is',JSON[_0x5b14('0x10')](_0xb19e63));throw new Error(_0x5b14('0x3f')+JSON['stringify'](_0xb19e63));}})[_0x5b14('0x30')](function(_0x4e933e){console[_0x5b14('0x31')](_0x4e933e);});}function getZohoUser(_0x5566a4,_0x1eab97){return new BPromise(function(_0x22876d,_0x1aba0a){request(_0x5566a4)[_0x5b14('0x2e')](function(_0x5936c2){var _0x468565=null;if(_0x5936c2){_0x468565=_0x5936c2[_0x5b14('0x40')][0x0];_0x468565[_0x5b14('0x41')]=_0x1eab97;}_0x22876d(_0x468565);})[_0x5b14('0x30')](function(_0x168831){_0x1aba0a(_0x168831);});});}function createEndUser(_0x4c6856,_0x158b40,_0x4aa6a8,_0x560d7c,_0x35abc2,_0x259393){var _0x4aa6a8=getName(_0x4aa6a8);return request({'method':'POST','uri':_0x5b14('0x42')+_0x158b40+'/crm/v2/'+_[_0x5b14('0x43')](_0x259393['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x4aa6a8[0x1],'First_Name':_0x4aa6a8[0x0],'Phone':_0x560d7c,'Owner':{'name':!_[_0x5b14('0x1f')](_0x35abc2[_0x5b14('0x44')][_0x5b14('0x1b')])?_0x35abc2['role'][_0x5b14('0x1b')]:!_['isNil'](_0x35abc2[_0x5b14('0x45')])?_0x35abc2['first_name']+'\x20'+_0x35abc2[_0x5b14('0x46')]:_0x35abc2[_0x5b14('0x46')],'id':_0x35abc2['id']}}]},'headers':{'Authorization':_0x5b14('0x47')+_0x4c6856},'json':!![]})[_0x5b14('0x2e')](function(_0x22ca1e){if(_0x22ca1e&&_0x22ca1e['data'][0x0][_0x5b14('0x48')]==='SUCCESS'){var _0xa6f23c=_0x22ca1e[_0x5b14('0x40')][0x0]['details'];_0xa6f23c[_0x5b14('0x41')]=_[_0x5b14('0x43')](_0x259393['moduleCreate'])+'s';return _0xa6f23c;}logger[_0x5b14('0x31')]('The\x20failing\x20result\x20is',JSON['stringify'](data));throw new Error('Error:\x20'+JSON[_0x5b14('0x10')](data));})[_0x5b14('0x30')](function(_0x4cbccc){console[_0x5b14('0x49')](_0x5b14('0x4a'),_0x4cbccc);});}function getEndUser(_0x50b5c1,_0x4ed297,_0x555994,_0x2249d1,_0x522b41,_0x433197,_0x1e6b52){var _0xc6fa5e={'method':_0x5b14('0x34'),'uri':'','headers':{'Authorization':_0x5b14('0x47')+_0x50b5c1},'json':!![]};switch(_0x1e6b52[_0x5b14('0x4b')]){case'contact_lead':_0xc6fa5e[_0x5b14('0x4c')]='https://www.zohoapis.'+_0x4ed297+_0x5b14('0x4d')+_0x522b41+'))';return getZohoUser(_0xc6fa5e,_0x5b14('0x4e'))[_0x5b14('0x2e')](function(_0x41536a){if(_0x41536a)return _0x41536a;_0xc6fa5e[_0x5b14('0x4c')]=_0x5b14('0x42')+_0x4ed297+_0x5b14('0x4f')+_0x522b41+'))';return getZohoUser(_0xc6fa5e,_0x5b14('0x50'))[_0x5b14('0x2e')](function(_0x1298ba){if(_0x1298ba)return _0x1298ba;if(_0x1e6b52[_0x5b14('0x51')]!=_0x5b14('0x52')){return createEndUser(_0x50b5c1,_0x4ed297,_0x2249d1,_0x522b41,_0x433197,_0x1e6b52);}else{return{};}});});break;case _0x5b14('0x53'):_0xc6fa5e[_0x5b14('0x4c')]=_0x5b14('0x42')+_0x4ed297+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x522b41+'))';return getZohoUser(_0xc6fa5e,_0x5b14('0x4e'))['then'](function(_0x1ac715){if(_0x1ac715)return _0x1ac715;if(_0x1e6b52[_0x5b14('0x51')]!='nothing'){return createEndUser(_0x50b5c1,_0x4ed297,_0x2249d1,_0x522b41,_0x433197,_0x1e6b52);}else{return{};}});break;case _0x5b14('0x54'):_0xc6fa5e[_0x5b14('0x4c')]=_0x5b14('0x42')+_0x4ed297+_0x5b14('0x4f')+_0x522b41+'))';return getZohoUser(_0xc6fa5e,_0x5b14('0x50'))[_0x5b14('0x2e')](function(_0x5c8ef5){if(_0x5c8ef5)return _0x5c8ef5;if(_0x1e6b52[_0x5b14('0x51')]!=_0x5b14('0x52')){return createEndUser(_0x50b5c1,_0x4ed297,_0x2249d1,_0x522b41,_0x433197,_0x1e6b52);}else{return{};}});break;}}function getCall(_0x4f518b,_0x38d830,_0x3d0a52,_0x20f691,_0x28049c,_0x5ca8f8,_0x5b0aa6,_0x2b520b){logger[_0x5b14('0x33')](_0x5b14('0x55'));var _0x4524e6={};_0x4524e6[_0x5b14('0x56')]={'name':!_[_0x5b14('0x1f')](_0x20f691[_0x5b14('0x44')][_0x5b14('0x1b')])&&!_[_0x5b14('0x1f')](_0x20f691['profile'][_0x5b14('0x1b')])&&_0x20f691[_0x5b14('0x3c')][_0x5b14('0x1b')]===_0x5b14('0x57')?_0x20f691[_0x5b14('0x44')][_0x5b14('0x1b')]:!_[_0x5b14('0x1f')](_0x20f691[_0x5b14('0x45')])?_0x20f691['first_name']+'\x20'+_0x20f691[_0x5b14('0x46')]:_0x20f691[_0x5b14('0x46')],'id':_0x20f691['id']};_0x4524e6[_0x5b14('0x58')]=intUtil[_0x5b14('0x59')](_0x5ca8f8[_0x5b14('0x5a')],_0x5b0aa6,'\x20');_0x4524e6['Description']=intUtil[_0x5b14('0x59')](_0x5ca8f8[_0x5b14('0x5b')],_0x5b0aa6,'\x0a');if(_0x28049c[_0x5b14('0x41')]===_0x5b14('0x4e')){_0x4524e6[_0x5b14('0x5c')]={'name':!_[_0x5b14('0x1f')](_0x28049c[_0x5b14('0x5d')])?_0x28049c[_0x5b14('0x5d')]:!_[_0x5b14('0x1f')](_0x28049c['First_Name'])?_0x28049c[_0x5b14('0x5e')]+'\x20'+_0x28049c[_0x5b14('0x5f')]:_0x28049c[_0x5b14('0x5f')],'id':_0x28049c['id']};}if(_0x28049c[_0x5b14('0x41')]===_0x5b14('0x50')){_0x4524e6[_0x5b14('0x60')]={'name':!_[_0x5b14('0x1f')](_0x28049c[_0x5b14('0x5d')])?_0x28049c[_0x5b14('0x5d')]:!_[_0x5b14('0x1f')](_0x28049c['First_Name'])?_0x28049c[_0x5b14('0x5e')]+'\x20'+_0x28049c[_0x5b14('0x5f')]:_0x28049c[_0x5b14('0x5f')],'id':_0x28049c['id']};_0x4524e6[_0x5b14('0x61')]=_['startCase'](_0x28049c[_0x5b14('0x41')]);}if(_0x5b0aa6[_0x5b14('0x62')]){_0x4524e6[_0x5b14('0x63')]=moment[_0x5b14('0x64')](parseInt(_0x5b0aa6[_0x5b14('0x62')])*0x3e8)['format'](_0x5b14('0x65'));}else if(_0x5b0aa6[_0x5b14('0x66')]&&_0x5b0aa6[_0x5b14('0x67')]){_0x4524e6[_0x5b14('0x63')]=moment[_0x5b14('0x64')](moment(_0x5b0aa6['endtime'],_0x5b14('0x68'))[_0x5b14('0x69')](moment(_0x5b0aa6[_0x5b14('0x6a')],_0x5b14('0x68'))))[_0x5b14('0x6b')](_0x5b14('0x65'));}switch(_0x5b0aa6[_0x5b14('0x6c')]){case _0x5b14('0x6d'):_0x4524e6[_0x5b14('0x6e')]=_0x5b14('0x6f');break;case _0x5b14('0x70'):case _0x5b14('0x71'):_0x4524e6[_0x5b14('0x6e')]='Answered';break;case _0x5b14('0x72'):_0x4524e6[_0x5b14('0x6e')]=_0x5b14('0x73');break;case _0x5b14('0x74'):_0x4524e6[_0x5b14('0x6e')]=_0x5b14('0x75');break;case'timeout':_0x4524e6[_0x5b14('0x6e')]='Timeout';default:}_0x4524e6[_0x5b14('0x76')]=(_0x2b520b===_0x5b14('0x77')?moment(_0x5b0aa6[_0x5b14('0x6a')])[_0x5b14('0x6b')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x5b0aa6[_0x5b14('0x78')])[_0x5b14('0x6b')](_0x5b14('0x68')))||moment()[_0x5b14('0x6b')]('YYYY-MM-DDTHH:mm:ss');_0x4524e6[_0x5b14('0x79')]=_0x2b520b||_0x5b14('0x7a');_0x4524e6=_[_0x5b14('0x7b')](_0x4524e6,getCustomFields(_0x5ca8f8[_0x5b14('0x7c')],_0x5b0aa6));return request({'method':_0x5b14('0x28'),'uri':_0x5b14('0x42')+_0x38d830+_0x5b14('0x7d'),'headers':{'Authorization':_0x5b14('0x47')+_0x4f518b},'body':{'data':[_0x4524e6]},'json':!![]})[_0x5b14('0x2e')](function(_0x4d35ae){if(_0x4d35ae&&_0x4d35ae[_0x5b14('0x40')][0x0]['code']===_0x5b14('0x7e')){logger[_0x5b14('0x33')](_0x5b14('0x7f'));return{'id':_0x4d35ae[_0x5b14('0x40')][0x0][_0x5b14('0x80')]['id']};}})[_0x5b14('0x30')](function(_0x2cb9fd){logger[_0x5b14('0x33')](_0x5b14('0x81'),_0x2cb9fd['stack']);console[_0x5b14('0x49')](_0x5b14('0x81'),_0x2cb9fd);});}exports[_0x5b14('0x82')]=function(_0x4bcc5d,_0x50c662,_0x439a56,_0x8c77bc,_0x4a9014,_0x4be09a){var _0x32aa26,_0x28df4a,_0x338ce3;_0x4be09a[_0x5b14('0x83')]=intUtil[_0x5b14('0x84')](_0x4be09a['host']);_0x4be09a[_0x5b14('0x85')]=intUtil[_0x5b14('0x84')](_0x4be09a[_0x5b14('0x85')]);if(_0x4a9014&&_0x4a9014[_0x5b14('0x86')]){logger['info']('[QUEUE]',_0x5b14('0x87'));_0x50c662[_0x5b14('0x88')]=_0x4be09a[_0x5b14('0x85')]+_0x5b14('0x89')+_0x50c662['uniqueid']+_0x5b14('0x8a')+md5(_0x50c662[_0x5b14('0x8b')]);}else{_0x50c662[_0x5b14('0x88')]='';}var _0x4e7acc=_0x4be09a[_0x5b14('0x83')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x4be09a)[_0x5b14('0x2e')](function(_0x17f764){_0x338ce3=_0x17f764;return getUser(_0x338ce3,_0x4e7acc,_0x4be09a,_0x8c77bc['email']);})[_0x5b14('0x2e')](function(_0x3af04c){_0x32aa26=_0x3af04c;logger['info'](_0x5b14('0x8c'),_0x32aa26['id']);return getEndUser(_0x338ce3,_0x4e7acc,_0x4be09a,_0x50c662[_0x5b14('0x8d')],_0x50c662[_0x5b14('0x8e')],_0x32aa26,_0x439a56);})['then'](function(_0x5aee2e){_0x28df4a=_0x5aee2e;return getCall(_0x338ce3,_0x4e7acc,_0x4be09a,_0x32aa26,_0x28df4a,_0x439a56,_0x50c662,_0x5b14('0x7a'));})['then'](function(_0x5412da){if(_0x5412da){logger['info'](_0x5b14('0x8f'),_0x5412da['id']);logger[_0x5b14('0x33')](_0x5b14('0x90'),_0x5b14('0x91'));emit(util[_0x5b14('0x6b')](_0x5b14('0x92'),_0x8c77bc['name']),_0x5b14('0x93'),{'uri':_0x5b14('0x94')+_0x4be09a['host']+_0x5b14('0x95')+_0x5412da['id']});}})['catch'](function(_0x30059b){logger['error'](_0x5b14('0x90'),JSON['stringify'](_0x30059b));});};exports[_0x5b14('0x77')]=function(_0x1b08c8,_0x1ae9b7,_0x1e0426,_0xe0ac69,_0x1f2863,_0x557338,_0x43d02d){var _0x541578,_0x378bed,_0x596266;_0x557338[_0x5b14('0x83')]=intUtil[_0x5b14('0x84')](_0x557338[_0x5b14('0x83')]);_0x557338[_0x5b14('0x85')]=intUtil[_0x5b14('0x84')](_0x557338[_0x5b14('0x85')]);if(_0x43d02d&&_0x43d02d[_0x5b14('0x96')]&&_0x43d02d['recordingFormat']!=='none'){logger[_0x5b14('0x33')](_0x5b14('0x97'),_0x5b14('0x87'));_0x1ae9b7[_0x5b14('0x88')]=_0x557338['serverUrl']+_0x5b14('0x89')+_0x1ae9b7['uniqueid']+_0x5b14('0x8a')+md5(_0x1ae9b7[_0x5b14('0x8b')]);}var _0x46df0f=_0x557338['host']===_0x5b14('0x98')?'eu':_0x5b14('0x99');return getAccessToken(_0x557338)[_0x5b14('0x2e')](function(_0x33cff5){_0x596266=_0x33cff5;return getUser(_0x596266,_0x46df0f,_0x557338,_0xe0ac69[_0x5b14('0x3a')]);})[_0x5b14('0x2e')](function(_0x28ee6e){_0x541578=_0x28ee6e;logger['info'](_0x5b14('0x8c'),_0x541578['id']);return getEndUser(_0x596266,_0x46df0f,_0x557338,_0x1ae9b7[_0x5b14('0x9a')],_0x1ae9b7[_0x5b14('0x9b')],_0x541578,_0x1e0426);})['then'](function(_0x446c81){_0x378bed=_0x446c81;return getCall(_0x596266,_0x46df0f,_0x557338,_0x541578,_0x378bed,_0x1e0426,_0x1ae9b7,'Outbound');})[_0x5b14('0x2e')](function(_0x290126){if(_0x290126){logger[_0x5b14('0x33')]('The\x20Call\x20ID\x20is:',_0x290126['id']);logger[_0x5b14('0x33')](_0x5b14('0x97'),_0x5b14('0x91'));emit(util[_0x5b14('0x6b')]('user:%s',_0xe0ac69['name']),_0x5b14('0x93'),{'uri':_0x5b14('0x94')+_0x557338['host']+'/crm/EntityInfo.do?module=Calls&id='+_0x290126['id']});}})[_0x5b14('0x30')](function(_0x28eb93){logger['error'](_0x5b14('0x97'),JSON[_0x5b14('0x10')](_0x28eb93));});};exports[_0x5b14('0x9c')]=function(_0x34f1f2,_0x5dcc8c,_0x42dad8,_0x4ac44f,_0x474839,_0x30b385){var _0x255e50,_0xa8b385,_0x52cb70;_0x30b385[_0x5b14('0x83')]=intUtil[_0x5b14('0x84')](_0x30b385[_0x5b14('0x83')]);_0x30b385[_0x5b14('0x85')]=intUtil['stripTrailingSlash'](_0x30b385[_0x5b14('0x85')]);if(_0x474839&&_0x474839[_0x5b14('0x86')]){logger['info']('['+_0x5dcc8c[_0x5b14('0x6c')][_0x5b14('0x9d')]()+']',_0x5b14('0x87'));_0x5dcc8c[_0x5b14('0x88')]=_0x30b385[_0x5b14('0x85')]+_0x5b14('0x89')+_0x5dcc8c[_0x5b14('0x8b')]+_0x5b14('0x8a')+md5(_0x5dcc8c['uniqueid']);}else{_0x5dcc8c[_0x5b14('0x88')]='';}var _0x5e3b8a=_0x30b385[_0x5b14('0x83')]==='zoho.eu'?'eu':_0x5b14('0x99');return getAccessToken(_0x30b385)[_0x5b14('0x2e')](function(_0x34c039){_0x52cb70=_0x34c039;return getUser(_0x52cb70,_0x5e3b8a,_0x30b385);})[_0x5b14('0x2e')](function(_0x495d2b){_0x255e50=_0x495d2b;logger[_0x5b14('0x33')](_0x5b14('0x8c'),_0x255e50['id']);return getEndUser(_0x52cb70,_0x5e3b8a,_0x30b385,_0x5dcc8c[_0x5b14('0x8d')],_0x5dcc8c[_0x5b14('0x8e')],_0x255e50,_0x42dad8);})['then'](function(_0x4db3dc){_0xa8b385=_0x4db3dc;return getCall(_0x52cb70,_0x5e3b8a,_0x30b385,_0x255e50,_0xa8b385,_0x42dad8,_0x5dcc8c,_0x5b14('0x7a'));})[_0x5b14('0x2e')](function(_0x5f5821){if(_0x5f5821){logger['info'](_0x5b14('0x8f'),_0x5f5821['id']);}})['catch'](function(_0x3124e8){logger[_0x5b14('0x31')]('['+_0x5dcc8c['lastevent'][_0x5b14('0x9d')]()+']',JSON[_0x5b14('0x10')](_0x3124e8));});}; \ No newline at end of file +var _0x6e77=['role','first_name','code','SUCCESS','details','The\x20failing\x20result\x20is','Error:\x20','log','moduleSearch','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','lead','Creating\x20new\x20call...','Owner','administrator','last_name','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','endtime','YYYY-MM-DDTHH:mm:ss','diff','called','Call_Result','Called','complete','connect','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','starttime','agentcalledAt','Call_Type','merge','Fields','/crm/v2/Calls','err','queue','host','serverUrl','stripTrailingSlash','[QUEUE]','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','Inbound','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','https://crm.','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','trigger:browser:url','unmanaged','monitor_format','lastevent','toUpperCase','request-promise','./util','moment','bluebird','../../../../config/environment','../../../../config/logger','defaults','redis','localhost','emit','[HTTP]','stringify','length','forEach','includes','string','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','refreshToken','clientId','refresh_token','then','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','Search\x20user','GET','format','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','info','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','user','profile','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','startCase','moduleCreate'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x6e77,0xef));var _0x76e7=function(_0x374305,_0x3bf2b1){_0x374305=_0x374305-0x0;var _0x48f9c6=_0x6e77[_0x374305];return _0x48f9c6;};'use strict';var _=require('lodash');var rp=require(_0x76e7('0x0'));var md5=require('md5');var util=require('util');var intUtil=require(_0x76e7('0x1'));var moment=require(_0x76e7('0x2'));var Redis=require('ioredis');var BPromise=require(_0x76e7('0x3'));var config=require(_0x76e7('0x4'));var logger=require(_0x76e7('0x5'))('zoho');config['redis']=_[_0x76e7('0x6')](config[_0x76e7('0x7')],{'host':_0x76e7('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x76e7('0x7')]));function emit(_0x464a99,_0x4ab2ff,_0x5dbea3){io['to'](_0x464a99)[_0x76e7('0x9')](_0x4ab2ff,_0x5dbea3);}function request(_0x2b2f4f){logger['debug'](_0x76e7('0xa'),JSON[_0x76e7('0xb')](_0x2b2f4f));return rp(_0x2b2f4f);}function getCustomFields(_0x46c82f,_0x1b16c8){var _0x498585={};if(_0x46c82f[_0x76e7('0xc')]>0x0){_[_0x76e7('0xd')](_0x46c82f,function(_0x1606c3){if(_[_0x76e7('0xe')]([_0x76e7('0xf'),_0x76e7('0x10')],_0x1606c3[_0x76e7('0x11')])&&_0x1606c3[_0x76e7('0x12')]){_0x498585[_0x1606c3[_0x76e7('0x12')]]=_0x1606c3[_0x76e7('0x13')][_0x76e7('0x14')]();}else if(_0x1606c3['type']===_0x76e7('0x15')&&_0x1606c3['variableName']&&_0x1606c3[_0x76e7('0x12')]&&_0x1b16c8[_0x1606c3[_0x76e7('0x16')]]){_0x498585[_0x1606c3['idField']]=_0x1b16c8[_0x1606c3[_0x76e7('0x16')]][_0x76e7('0x14')]();}else if(_0x1606c3[_0x76e7('0x11')]===_0x76e7('0x17')&&_0x1606c3[_0x76e7('0x18')]&&_0x1606c3[_0x76e7('0x18')][_0x76e7('0x19')]&&_0x1606c3['idField']&&_0x1b16c8[_0x1606c3[_0x76e7('0x18')]['name'][_0x76e7('0x1a')]()]){_0x498585[_0x1606c3[_0x76e7('0x12')]]=_0x1b16c8[_0x1606c3[_0x76e7('0x18')][_0x76e7('0x19')][_0x76e7('0x1a')]()]['toString']();}});}return _0x498585;}function getName(_0xfd3d29){if(_0xfd3d29['indexOf']('\x20')>0x0){var _0x143c36=_0xfd3d29[_0x76e7('0x1b')](/ (.+)/);if(_0x143c36[0x1]){return _0x143c36;}}return[_0xfd3d29,_0xfd3d29];}var accountsTokens={};function getAccessToken(_0x2d8995){return new Promise(function(_0x2d9893,_0x23d2f9){if(!_[_0x76e7('0x1c')](accountsTokens[_0x2d8995['id']])&&!_[_0x76e7('0x1c')](accountsTokens[_0x2d8995['id']][_0x76e7('0x1d')])){if(moment()[_0x76e7('0x1e')](accountsTokens[_0x2d8995['id']][_0x76e7('0x1f')])){_0x2d9893(accountsTokens[_0x2d8995['id']][_0x76e7('0x1d')]);}}var _0x1bec45;switch(_0x2d8995[_0x76e7('0x20')]){case'US':_0x1bec45=_0x76e7('0x21');break;case'AU':_0x1bec45='https://accounts.zoho.com.au';break;case'EU':_0x1bec45=_0x76e7('0x22');break;case'IN':_0x1bec45='https://accounts.zoho.in';break;case'CN':_0x1bec45=_0x76e7('0x23');break;default:_0x1bec45=_0x76e7('0x22');break;}var _0x39b3f8={'method':_0x76e7('0x24'),'uri':_0x1bec45+'/oauth/v2/token','qs':{'refresh_token':_0x2d8995[_0x76e7('0x25')],'client_id':_0x2d8995[_0x76e7('0x26')],'client_secret':_0x2d8995['clientSecret'],'grant_type':_0x76e7('0x27')},'json':!![]};return rp(_0x39b3f8)[_0x76e7('0x28')](function(_0x38238c){accountsTokens[_0x2d8995['id']]={'access_token':_0x38238c[_0x76e7('0x1d')],'expires_in':moment()['add'](_0x38238c[_0x76e7('0x1f')],_0x76e7('0x29'))};_0x2d9893(_0x38238c[_0x76e7('0x1d')]);})[_0x76e7('0x2a')](function(_0x180bb1){logger[_0x76e7('0x2b')](_0x76e7('0x2c'),_0x180bb1[_0x76e7('0x2d')]);_0x23d2f9(_0x180bb1);});});}function getUser(_0x10d6c6,_0x38ea19,_0x5f2039,_0x473e20){logger['info'](_0x76e7('0x2e'));return request({'method':_0x76e7('0x2f'),'uri':util[_0x76e7('0x30')]('https://www.zohoapis.%s/crm/v2/users',_0x38ea19),'qs':{'type':_0x76e7('0x31')},'headers':{'Authorization':_0x76e7('0x32')+_0x10d6c6},'json':!![]})['then'](function(_0x2e1df3){if(_0x2e1df3[_0x76e7('0x33')]){var _0x51d6c1=-0x1;if(_[_0x76e7('0x34')](_0x2e1df3[_0x76e7('0x33')])){if(!_['isNil'](_0x473e20)){_0x51d6c1=_[_0x76e7('0x35')](_0x2e1df3[_0x76e7('0x33')],function(_0x227050){return _0x227050[_0x76e7('0x36')]===_0x473e20;});}if(_0x51d6c1>=0x0){logger[_0x76e7('0x37')](_0x76e7('0x38'));}else{logger['info'](_0x76e7('0x39'));_0x51d6c1=_['findIndex'](_0x2e1df3[_0x76e7('0x33')],function(_0x2f9fab){return _0x2f9fab['profile']['name']===_0x76e7('0x3a');});}return _0x2e1df3[_0x76e7('0x33')][_0x51d6c1];}else{if(_0x2e1df3[_0x76e7('0x3b')][_0x76e7('0x3c')][_0x76e7('0x19')]===_0x76e7('0x3a')){logger[_0x76e7('0x37')](_0x76e7('0x39'));user=_0x2e1df3[_0x76e7('0x3b')];return user;}else{logger[_0x76e7('0x2b')]('The\x20failing\x20result\x20is',JSON[_0x76e7('0xb')](_0x2e1df3));throw new Error(_0x76e7('0x3d')+JSON[_0x76e7('0xb')](_0x2e1df3));}}}else{logger[_0x76e7('0x2b')]('The\x20failing\x20result\x20is',JSON['stringify'](_0x2e1df3));throw new Error(_0x76e7('0x3d')+JSON[_0x76e7('0xb')](_0x2e1df3));}})[_0x76e7('0x2a')](function(_0x3698db){console[_0x76e7('0x2b')](_0x3698db);});}function getZohoUser(_0x51bcae,_0x15a199){return new BPromise(function(_0x5087ca,_0x462297){request(_0x51bcae)[_0x76e7('0x28')](function(_0x26ae11){var _0x268232=null;if(_0x26ae11){_0x268232=_0x26ae11[_0x76e7('0x3e')][0x0];_0x268232[_0x76e7('0x3f')]=_0x15a199;}_0x5087ca(_0x268232);})[_0x76e7('0x2a')](function(_0x5ea5a9){_0x462297(_0x5ea5a9);});});}function createEndUser(_0x4dd106,_0x3ae1be,_0x317e73,_0x48f8a2,_0x1a54c,_0x56eece){var _0x317e73=getName(_0x317e73);return request({'method':_0x76e7('0x24'),'uri':_0x76e7('0x40')+_0x3ae1be+'/crm/v2/'+_[_0x76e7('0x41')](_0x56eece[_0x76e7('0x42')])+'s','body':{'data':[{'Last_Name':_0x317e73[0x1],'First_Name':_0x317e73[0x0],'Phone':_0x48f8a2,'Owner':{'name':!_[_0x76e7('0x1c')](_0x1a54c[_0x76e7('0x43')]['name'])?_0x1a54c[_0x76e7('0x43')][_0x76e7('0x19')]:!_[_0x76e7('0x1c')](_0x1a54c[_0x76e7('0x44')])?_0x1a54c[_0x76e7('0x44')]+'\x20'+_0x1a54c['last_name']:_0x1a54c['last_name'],'id':_0x1a54c['id']}}]},'headers':{'Authorization':_0x76e7('0x32')+_0x4dd106},'json':!![]})[_0x76e7('0x28')](function(_0x214a45){if(_0x214a45&&_0x214a45[_0x76e7('0x3e')][0x0][_0x76e7('0x45')]===_0x76e7('0x46')){var _0x44d21e=_0x214a45['data'][0x0][_0x76e7('0x47')];_0x44d21e[_0x76e7('0x3f')]=_[_0x76e7('0x41')](_0x56eece[_0x76e7('0x42')])+'s';return _0x44d21e;}logger[_0x76e7('0x2b')](_0x76e7('0x48'),JSON[_0x76e7('0xb')](data));throw new Error(_0x76e7('0x49')+JSON['stringify'](data));})[_0x76e7('0x2a')](function(_0x4b9467){console[_0x76e7('0x4a')]('CREATE\x20ERROR',_0x4b9467);});}function getEndUser(_0x49e159,_0x1b86e7,_0x5abd14,_0x589dbe,_0x409a00,_0x23cdd8,_0x4b11b3){var _0x44efc8={'method':_0x76e7('0x2f'),'uri':'','headers':{'Authorization':_0x76e7('0x32')+_0x49e159},'json':!![]};switch(_0x4b11b3[_0x76e7('0x4b')]){case'contact_lead':_0x44efc8[_0x76e7('0x4c')]=_0x76e7('0x40')+_0x1b86e7+_0x76e7('0x4d')+_0x409a00+'))';return getZohoUser(_0x44efc8,_0x76e7('0x4e'))[_0x76e7('0x28')](function(_0x3e2c0b){if(_0x3e2c0b)return _0x3e2c0b;_0x44efc8[_0x76e7('0x4c')]='https://www.zohoapis.'+_0x1b86e7+_0x76e7('0x4f')+_0x409a00+'))';return getZohoUser(_0x44efc8,_0x76e7('0x50'))[_0x76e7('0x28')](function(_0xd28b35){if(_0xd28b35)return _0xd28b35;if(_0x4b11b3['moduleCreate']!=_0x76e7('0x51')){return createEndUser(_0x49e159,_0x1b86e7,_0x589dbe,_0x409a00,_0x23cdd8,_0x4b11b3);}else{return{};}});});break;case _0x76e7('0x52'):_0x44efc8[_0x76e7('0x4c')]=_0x76e7('0x40')+_0x1b86e7+_0x76e7('0x4d')+_0x409a00+'))';return getZohoUser(_0x44efc8,_0x76e7('0x4e'))[_0x76e7('0x28')](function(_0xdf8216){if(_0xdf8216)return _0xdf8216;if(_0x4b11b3[_0x76e7('0x42')]!='nothing'){return createEndUser(_0x49e159,_0x1b86e7,_0x589dbe,_0x409a00,_0x23cdd8,_0x4b11b3);}else{return{};}});break;case _0x76e7('0x53'):_0x44efc8[_0x76e7('0x4c')]=_0x76e7('0x40')+_0x1b86e7+_0x76e7('0x4f')+_0x409a00+'))';return getZohoUser(_0x44efc8,'Leads')['then'](function(_0x35250a){if(_0x35250a)return _0x35250a;if(_0x4b11b3[_0x76e7('0x42')]!=_0x76e7('0x51')){return createEndUser(_0x49e159,_0x1b86e7,_0x589dbe,_0x409a00,_0x23cdd8,_0x4b11b3);}else{return{};}});break;}}function getCall(_0x5a9945,_0x23585a,_0x3fd0e6,_0x3099dd,_0x57255d,_0x133132,_0x2e9d97,_0xfb22f2){logger[_0x76e7('0x37')](_0x76e7('0x54'));var _0x64a841={};_0x64a841[_0x76e7('0x55')]={'name':!_[_0x76e7('0x1c')](_0x3099dd[_0x76e7('0x43')]['name'])&&!_[_0x76e7('0x1c')](_0x3099dd[_0x76e7('0x3c')][_0x76e7('0x19')])&&_0x3099dd['profile'][_0x76e7('0x19')]===_0x76e7('0x56')?_0x3099dd[_0x76e7('0x43')]['name']:!_[_0x76e7('0x1c')](_0x3099dd[_0x76e7('0x44')])?_0x3099dd[_0x76e7('0x44')]+'\x20'+_0x3099dd[_0x76e7('0x57')]:_0x3099dd['last_name'],'id':_0x3099dd['id']};_0x64a841[_0x76e7('0x58')]=intUtil[_0x76e7('0x59')](_0x133132[_0x76e7('0x5a')],_0x2e9d97,'\x20');_0x64a841[_0x76e7('0x5b')]=intUtil['getString'](_0x133132[_0x76e7('0x5c')],_0x2e9d97,'\x0a');if(_0x57255d[_0x76e7('0x3f')]===_0x76e7('0x4e')){_0x64a841[_0x76e7('0x5d')]={'name':!_[_0x76e7('0x1c')](_0x57255d[_0x76e7('0x5e')])?_0x57255d[_0x76e7('0x5e')]:!_[_0x76e7('0x1c')](_0x57255d[_0x76e7('0x5f')])?_0x57255d[_0x76e7('0x5f')]+'\x20'+_0x57255d[_0x76e7('0x60')]:_0x57255d['Last_Name'],'id':_0x57255d['id']};}if(_0x57255d[_0x76e7('0x3f')]===_0x76e7('0x50')){_0x64a841[_0x76e7('0x61')]={'name':!_[_0x76e7('0x1c')](_0x57255d[_0x76e7('0x5e')])?_0x57255d['Full_Name']:!_[_0x76e7('0x1c')](_0x57255d['First_Name'])?_0x57255d['First_Name']+'\x20'+_0x57255d[_0x76e7('0x60')]:_0x57255d['Last_Name'],'id':_0x57255d['id']};_0x64a841[_0x76e7('0x62')]=_[_0x76e7('0x41')](_0x57255d[_0x76e7('0x3f')]);}if(_0x2e9d97[_0x76e7('0x63')]){_0x64a841[_0x76e7('0x64')]=moment['utc'](parseInt(_0x2e9d97[_0x76e7('0x63')])*0x3e8)[_0x76e7('0x30')]('mm:ss');}else if(_0x2e9d97['answertime']&&_0x2e9d97['endtime']){_0x64a841[_0x76e7('0x64')]=moment[_0x76e7('0x65')](moment(_0x2e9d97[_0x76e7('0x66')],_0x76e7('0x67'))[_0x76e7('0x68')](moment(_0x2e9d97['starttime'],_0x76e7('0x67'))))[_0x76e7('0x30')]('mm:ss');}switch(_0x2e9d97['lastevent']){case _0x76e7('0x69'):_0x64a841[_0x76e7('0x6a')]=_0x76e7('0x6b');break;case _0x76e7('0x6c'):case _0x76e7('0x6d'):_0x64a841['Call_Result']='Answered';break;case'rejected':_0x64a841[_0x76e7('0x6a')]='Rejected';break;case _0x76e7('0x6e'):_0x64a841['Call_Result']=_0x76e7('0x6f');break;case _0x76e7('0x70'):_0x64a841['Call_Result']=_0x76e7('0x71');default:}_0x64a841[_0x76e7('0x72')]=(_0xfb22f2===_0x76e7('0x73')?moment(_0x2e9d97[_0x76e7('0x74')])['format'](_0x76e7('0x67')):moment(_0x2e9d97[_0x76e7('0x75')])[_0x76e7('0x30')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x76e7('0x30')](_0x76e7('0x67'));_0x64a841[_0x76e7('0x76')]=_0xfb22f2||'Inbound';_0x64a841=_[_0x76e7('0x77')](_0x64a841,getCustomFields(_0x133132[_0x76e7('0x78')],_0x2e9d97));return request({'method':'POST','uri':_0x76e7('0x40')+_0x23585a+_0x76e7('0x79'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x5a9945},'body':{'data':[_0x64a841]},'json':!![]})[_0x76e7('0x28')](function(_0x4e57f3){if(_0x4e57f3&&_0x4e57f3[_0x76e7('0x3e')][0x0]['code']===_0x76e7('0x46')){logger[_0x76e7('0x37')]('Call\x20created!');return{'id':_0x4e57f3['data'][0x0][_0x76e7('0x47')]['id']};}})[_0x76e7('0x2a')](function(_0x12a0fd){logger[_0x76e7('0x37')](_0x76e7('0x7a'),_0x12a0fd[_0x76e7('0x2d')]);console[_0x76e7('0x4a')](_0x76e7('0x7a'),_0x12a0fd);});}exports[_0x76e7('0x7b')]=function(_0x2860e5,_0x560b99,_0x4916f0,_0x7ec97d,_0x2e8fe5,_0x2aeed2){var _0x3fdfeb,_0x572a88,_0x119462;_0x2aeed2[_0x76e7('0x7c')]=intUtil['stripTrailingSlash'](_0x2aeed2[_0x76e7('0x7c')]);_0x2aeed2[_0x76e7('0x7d')]=intUtil[_0x76e7('0x7e')](_0x2aeed2[_0x76e7('0x7d')]);if(_0x2e8fe5&&_0x2e8fe5['monitor_format']){logger[_0x76e7('0x37')](_0x76e7('0x7f'),'Recording\x20is\x20enabled!');_0x560b99[_0x76e7('0x80')]=_0x2aeed2[_0x76e7('0x7d')]+_0x76e7('0x81')+_0x560b99[_0x76e7('0x82')]+_0x76e7('0x83')+md5(_0x560b99[_0x76e7('0x82')]);}else{_0x560b99[_0x76e7('0x80')]='';}var _0x5d02f1=_0x2aeed2[_0x76e7('0x7c')]===_0x76e7('0x84')?'eu':_0x76e7('0x85');return getAccessToken(_0x2aeed2)[_0x76e7('0x28')](function(_0x2d7943){_0x119462=_0x2d7943;return getUser(_0x119462,_0x5d02f1,_0x2aeed2,_0x7ec97d[_0x76e7('0x36')]);})[_0x76e7('0x28')](function(_0x8e0951){_0x3fdfeb=_0x8e0951;logger[_0x76e7('0x37')](_0x76e7('0x86'),_0x3fdfeb['id']);return getEndUser(_0x119462,_0x5d02f1,_0x2aeed2,_0x560b99[_0x76e7('0x87')],_0x560b99[_0x76e7('0x88')],_0x3fdfeb,_0x4916f0);})[_0x76e7('0x28')](function(_0x353a68){_0x572a88=_0x353a68;return getCall(_0x119462,_0x5d02f1,_0x2aeed2,_0x3fdfeb,_0x572a88,_0x4916f0,_0x560b99,_0x76e7('0x89'));})[_0x76e7('0x28')](function(_0x54f07c){if(_0x54f07c){logger[_0x76e7('0x37')](_0x76e7('0x8a'),_0x54f07c['id']);logger['info']('[QUEUE]',_0x76e7('0x8b'));emit(util[_0x76e7('0x30')](_0x76e7('0x8c'),_0x7ec97d[_0x76e7('0x19')]),'trigger:browser:url',{'uri':_0x76e7('0x8d')+_0x2aeed2[_0x76e7('0x7c')]+'/crm/EntityInfo.do?module=Calls&id='+_0x54f07c['id']});}})[_0x76e7('0x2a')](function(_0x2a18f7){logger[_0x76e7('0x2b')](_0x76e7('0x7f'),JSON[_0x76e7('0xb')](_0x2a18f7));});};exports[_0x76e7('0x73')]=function(_0x22cd51,_0x5140e2,_0x5d10ed,_0x53a037,_0x38ebf3,_0x5a9e78,_0x238726){var _0x7b8b78,_0x179e9f,_0xa679fe;_0x5a9e78[_0x76e7('0x7c')]=intUtil[_0x76e7('0x7e')](_0x5a9e78[_0x76e7('0x7c')]);_0x5a9e78[_0x76e7('0x7d')]=intUtil[_0x76e7('0x7e')](_0x5a9e78[_0x76e7('0x7d')]);if(_0x238726&&_0x238726['recordingFormat']&&_0x238726[_0x76e7('0x8e')]!==_0x76e7('0x8f')){logger[_0x76e7('0x37')](_0x76e7('0x90'),'Recording\x20is\x20enabled!');_0x5140e2[_0x76e7('0x80')]=_0x5a9e78['serverUrl']+_0x76e7('0x81')+_0x5140e2[_0x76e7('0x82')]+_0x76e7('0x83')+md5(_0x5140e2[_0x76e7('0x82')]);}var _0x2276bb=_0x5a9e78[_0x76e7('0x7c')]===_0x76e7('0x84')?'eu':_0x76e7('0x85');return getAccessToken(_0x5a9e78)[_0x76e7('0x28')](function(_0x1fb3a3){_0xa679fe=_0x1fb3a3;return getUser(_0xa679fe,_0x2276bb,_0x5a9e78,_0x53a037[_0x76e7('0x36')]);})[_0x76e7('0x28')](function(_0xf6e7d4){_0x7b8b78=_0xf6e7d4;logger['info'](_0x76e7('0x86'),_0x7b8b78['id']);return getEndUser(_0xa679fe,_0x2276bb,_0x5a9e78,_0x5140e2[_0x76e7('0x91')],_0x5140e2[_0x76e7('0x92')],_0x7b8b78,_0x5d10ed);})[_0x76e7('0x28')](function(_0x47c177){_0x179e9f=_0x47c177;return getCall(_0xa679fe,_0x2276bb,_0x5a9e78,_0x7b8b78,_0x179e9f,_0x5d10ed,_0x5140e2,_0x76e7('0x93'));})[_0x76e7('0x28')](function(_0x35ede1){if(_0x35ede1){logger['info'](_0x76e7('0x8a'),_0x35ede1['id']);logger['info'](_0x76e7('0x90'),_0x76e7('0x8b'));emit(util[_0x76e7('0x30')](_0x76e7('0x8c'),_0x53a037['name']),_0x76e7('0x94'),{'uri':'https://crm.'+_0x5a9e78[_0x76e7('0x7c')]+'/crm/EntityInfo.do?module=Calls&id='+_0x35ede1['id']});}})[_0x76e7('0x2a')](function(_0x5654a7){logger['error'](_0x76e7('0x90'),JSON[_0x76e7('0xb')](_0x5654a7));});};exports[_0x76e7('0x95')]=function(_0x8f3da9,_0x7d9bd3,_0x6a94dd,_0x30b089,_0x32d6f1,_0x2328b4){var _0x4a6974,_0x5ecb1b,_0x548475;_0x2328b4[_0x76e7('0x7c')]=intUtil['stripTrailingSlash'](_0x2328b4[_0x76e7('0x7c')]);_0x2328b4[_0x76e7('0x7d')]=intUtil[_0x76e7('0x7e')](_0x2328b4[_0x76e7('0x7d')]);if(_0x32d6f1&&_0x32d6f1[_0x76e7('0x96')]){logger[_0x76e7('0x37')]('['+_0x7d9bd3[_0x76e7('0x97')][_0x76e7('0x98')]()+']','Recording\x20is\x20enabled!');_0x7d9bd3[_0x76e7('0x80')]=_0x2328b4[_0x76e7('0x7d')]+_0x76e7('0x81')+_0x7d9bd3[_0x76e7('0x82')]+_0x76e7('0x83')+md5(_0x7d9bd3[_0x76e7('0x82')]);}else{_0x7d9bd3[_0x76e7('0x80')]='';}var _0x341dae=_0x2328b4[_0x76e7('0x7c')]==='zoho.eu'?'eu':_0x76e7('0x85');return getAccessToken(_0x2328b4)[_0x76e7('0x28')](function(_0x38dbb4){_0x548475=_0x38dbb4;return getUser(_0x548475,_0x341dae,_0x2328b4);})[_0x76e7('0x28')](function(_0xeedf47){_0x4a6974=_0xeedf47;logger[_0x76e7('0x37')](_0x76e7('0x86'),_0x4a6974['id']);return getEndUser(_0x548475,_0x341dae,_0x2328b4,_0x7d9bd3[_0x76e7('0x87')],_0x7d9bd3[_0x76e7('0x88')],_0x4a6974,_0x6a94dd);})[_0x76e7('0x28')](function(_0x5ec203){_0x5ecb1b=_0x5ec203;return getCall(_0x548475,_0x341dae,_0x2328b4,_0x4a6974,_0x5ecb1b,_0x6a94dd,_0x7d9bd3,_0x76e7('0x89'));})[_0x76e7('0x28')](function(_0x5bff8a){if(_0x5bff8a){logger[_0x76e7('0x37')](_0x76e7('0x8a'),_0x5bff8a['id']);}})['catch'](function(_0x572349){logger[_0x76e7('0x2b')]('['+_0x7d9bd3[_0x76e7('0x97')][_0x76e7('0x98')]()+']',JSON[_0x76e7('0xb')](_0x572349));});}; \ 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 68a4a7a..f0d77fe 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 _0xbb40=['trigger','exec','data2','render','data3','error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','shelljs','mustache','../../../../config/logger'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xbb40,0xa5));var _0x0bb4=function(_0x52e1af,_0x3f1a57){_0x52e1af=_0x52e1af-0x0;var _0x239e20=_0xbb40[_0x52e1af];return _0x239e20;};'use strict';var util=require('util');var sh=require(_0x0bb4('0x0'));var Mustache=require(_0x0bb4('0x1'));var logger=require(_0x0bb4('0x2'))(_0x0bb4('0x3'));exports[_0x0bb4('0x4')]=function(_0x2dfc5e,_0x3d6ff7){var _0xaa7766=_0x2dfc5e[_0x0bb4('0x5')]?_0x2dfc5e['data2']:'Script';var _0x1cb181=_0x2dfc5e['data3']?Mustache[_0x0bb4('0x6')](_0x2dfc5e[_0x0bb4('0x7')],_0x3d6ff7):_0x3d6ff7;sh[_0x0bb4('0x4')](_0x1cb181,function(_0x8bebae,_0x5d7e6c,_0x273b1c){if(_0x8bebae!==0x0){logger[_0x0bb4('0x8')](util['format'](_0x0bb4('0x9'),_0xaa7766,_0x1cb181,_0x8bebae,_0x273b1c));}else{logger['info'](util[_0x0bb4('0xa')](_0x0bb4('0xb'),_0xaa7766,_0x1cb181,_0x5d7e6c));}});}; \ No newline at end of file +var _0xbca6=['render','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','../../../../config/logger','trigger','exec','data2','Script','data3'];(function(_0x89427,_0x533fa3){var _0x5695ad=function(_0x184ed7){while(--_0x184ed7){_0x89427['push'](_0x89427['shift']());}};_0x5695ad(++_0x533fa3);}(_0xbca6,0x1a4));var _0x6bca=function(_0x3ceabb,_0x5d0382){_0x3ceabb=_0x3ceabb-0x0;var _0xc6884e=_0xbca6[_0x3ceabb];return _0xc6884e;};'use strict';var util=require(_0x6bca('0x0'));var sh=require(_0x6bca('0x1'));var Mustache=require(_0x6bca('0x2'));var logger=require(_0x6bca('0x3'))(_0x6bca('0x4'));exports[_0x6bca('0x5')]=function(_0x3bbf38,_0x46d460){var _0x5ea3b9=_0x3bbf38[_0x6bca('0x6')]?_0x3bbf38[_0x6bca('0x6')]:_0x6bca('0x7');var _0x4ee899=_0x3bbf38[_0x6bca('0x8')]?Mustache[_0x6bca('0x9')](_0x3bbf38[_0x6bca('0x8')],_0x46d460):_0x46d460;sh[_0x6bca('0x5')](_0x4ee899,function(_0x122f8b,_0x397b6c,_0x4626cf){if(_0x122f8b!==0x0){logger['error'](util[_0x6bca('0xa')](_0x6bca('0xb'),_0x5ea3b9,_0x4ee899,_0x122f8b,_0x4626cf));}else{logger['info'](util[_0x6bca('0xa')](_0x6bca('0xc'),_0x5ea3b9,_0x4ee899,_0x397b6c));}});}; \ 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 6cfcd70..8c01b35 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 _0x25ba=['then','isNil',',\x20request\x20body:\x20','object','stringify','info','format','statusCode','catch','message','request-promise','util','lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','data5','number','headers','data6','parse','render','stack','GET','DELETE','POST','data7','body','error','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2'];(function(_0x3edc32,_0x2efad9){var _0x53ba95=function(_0x567054){while(--_0x567054){_0x3edc32['push'](_0x3edc32['shift']());}};_0x53ba95(++_0x2efad9);}(_0x25ba,0x180));var _0xa25b=function(_0x17ff4b,_0x483e64){_0x17ff4b=_0x17ff4b-0x0;var _0x510f7b=_0x25ba[_0x17ff4b];return _0x510f7b;};'use strict';var rp=require(_0xa25b('0x0'));var util=require(_0xa25b('0x1'));var _=require(_0xa25b('0x2'));var Mustache=require(_0xa25b('0x3'));var logger=require(_0xa25b('0x4'))(_0xa25b('0x5'));exports[_0xa25b('0x6')]=function(_0x16d457,_0xa95859){var _0x44322c,_0x52a90a;var _0x552812={'method':_0x16d457[_0xa25b('0x7')][_0xa25b('0x8')](),'uri':Mustache['render'](_0x16d457['data2'],_0xa95859),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x16d457[_0xa25b('0x9')])===_0xa25b('0xa')&&parseInt(_0x16d457['data5'])>=0x1&&parseInt(_0x16d457[_0xa25b('0x9')])<=0xa?parseInt(_0x16d457[_0xa25b('0x9')])*0x3e8:0x5*0x3e8};try{_0x552812[_0xa25b('0xb')]=_0x16d457[_0xa25b('0xc')]?JSON[_0xa25b('0xd')](Mustache[_0xa25b('0xe')](_0x16d457['data6'],_0xa95859)):{};}catch(_0xb80108){logger['error'](_0xb80108[_0xa25b('0xf')]);}switch(_0x16d457[_0xa25b('0x7')][_0xa25b('0x8')]()){case _0xa25b('0x10'):case _0xa25b('0x11'):_0x44322c=null;_0x552812['qs']=_0xa95859;break;case _0xa25b('0x12'):case'PUT':if(_0x16d457[_0xa25b('0x13')]){try{_0x44322c=JSON[_0xa25b('0xd')](Mustache['render'](_0x16d457[_0xa25b('0x13')],_0xa95859));_0x552812[_0xa25b('0x14')]=_0x44322c;}catch(_0x40f23b){logger[_0xa25b('0x15')](_0x40f23b[_0xa25b('0xf')]);logger['error']('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x44322c=_0xa95859;_0x552812['body']=_0x44322c;}break;}logger['info'](util['format'](_0xa25b('0x16'),_0x16d457[_0xa25b('0x7')],_0x16d457[_0xa25b('0x17')],JSON['stringify'](_0x552812)));rp(_0x552812)[_0xa25b('0x18')](function(_0x3c9f04){_0x44322c=!_[_0xa25b('0x19')](_0x44322c)?_0xa25b('0x1a')+_0x44322c:'';_0x52a90a=typeof _0x3c9f04[_0xa25b('0x14')]===_0xa25b('0x1b')?JSON[_0xa25b('0x1c')](_0x3c9f04[_0xa25b('0x14')]):_0x3c9f04['body'];logger[_0xa25b('0x1d')](util[_0xa25b('0x1e')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x16d457[_0xa25b('0x7')],_0x16d457[_0xa25b('0x17')],_0x3c9f04[_0xa25b('0x1f')],_0x52a90a));})[_0xa25b('0x20')](function(_0x56305b){logger[_0xa25b('0x15')](util['format']('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x16d457[_0xa25b('0x7')],_0x16d457['data2'],_0x56305b['statusCode'],_0x56305b['name'],_0x56305b[_0xa25b('0x21')]));});}; \ No newline at end of file +var _0xde2c=['data1','render','data2','data5','headers','data6','parse','stack','toUpperCase','GET','POST','PUT','data7','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','lodash','mustache','../../../../config/logger','trigger'];(function(_0x4d12bf,_0x3d32a3){var _0x28e482=function(_0x429d79){while(--_0x429d79){_0x4d12bf['push'](_0x4d12bf['shift']());}};_0x28e482(++_0x3d32a3);}(_0xde2c,0x170));var _0xcde2=function(_0x4dd479,_0x26d87a){_0x4dd479=_0x4dd479-0x0;var _0x1b6807=_0xde2c[_0x4dd479];return _0x1b6807;};'use strict';var rp=require(_0xcde2('0x0'));var util=require(_0xcde2('0x1'));var _=require(_0xcde2('0x2'));var Mustache=require(_0xcde2('0x3'));var logger=require(_0xcde2('0x4'))(_0xcde2('0x5'));exports['exec']=function(_0x7497db,_0x4a8e7b){var _0x2653e4,_0x128072;var _0x1c9d0e={'method':_0x7497db[_0xcde2('0x6')]['toUpperCase'](),'uri':Mustache[_0xcde2('0x7')](_0x7497db[_0xcde2('0x8')],_0x4a8e7b),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x7497db['data5'])==='number'&&parseInt(_0x7497db[_0xcde2('0x9')])>=0x1&&parseInt(_0x7497db[_0xcde2('0x9')])<=0xa?parseInt(_0x7497db[_0xcde2('0x9')])*0x3e8:0x5*0x3e8};try{_0x1c9d0e[_0xcde2('0xa')]=_0x7497db[_0xcde2('0xb')]?JSON[_0xcde2('0xc')](Mustache[_0xcde2('0x7')](_0x7497db['data6'],_0x4a8e7b)):{};}catch(_0xb9f78a){logger['error'](_0xb9f78a[_0xcde2('0xd')]);}switch(_0x7497db[_0xcde2('0x6')][_0xcde2('0xe')]()){case _0xcde2('0xf'):case'DELETE':_0x2653e4=null;_0x1c9d0e['qs']=_0x4a8e7b;break;case _0xcde2('0x10'):case _0xcde2('0x11'):if(_0x7497db[_0xcde2('0x12')]){try{_0x2653e4=JSON[_0xcde2('0xc')](Mustache['render'](_0x7497db[_0xcde2('0x12')],_0x4a8e7b));_0x1c9d0e[_0xcde2('0x13')]=_0x2653e4;}catch(_0x344d2b){logger['error'](_0x344d2b[_0xcde2('0xd')]);logger[_0xcde2('0x14')](_0xcde2('0x15'));}}else{_0x2653e4=_0x4a8e7b;_0x1c9d0e[_0xcde2('0x13')]=_0x2653e4;}break;}logger[_0xcde2('0x16')](util[_0xcde2('0x17')](_0xcde2('0x18'),_0x7497db['data1'],_0x7497db['data2'],JSON['stringify'](_0x1c9d0e)));rp(_0x1c9d0e)[_0xcde2('0x19')](function(_0x3ea981){_0x2653e4=!_[_0xcde2('0x1a')](_0x2653e4)?_0xcde2('0x1b')+_0x2653e4:'';_0x128072=typeof _0x3ea981[_0xcde2('0x13')]===_0xcde2('0x1c')?JSON['stringify'](_0x3ea981[_0xcde2('0x13')]):_0x3ea981[_0xcde2('0x13')];logger[_0xcde2('0x16')](util[_0xcde2('0x17')](_0xcde2('0x1d'),_0x7497db[_0xcde2('0x6')],_0x7497db[_0xcde2('0x8')],_0x3ea981[_0xcde2('0x1e')],_0x128072));})['catch'](function(_0x13552d){logger[_0xcde2('0x14')](util[_0xcde2('0x17')](_0xcde2('0x1f'),_0x7497db[_0xcde2('0x6')],_0x7497db[_0xcde2('0x8')],_0x13552d[_0xcde2('0x1e')],_0x13552d[_0xcde2('0x20')],_0x13552d[_0xcde2('0x21')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index d07543b..3b9626c 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 _0xba7c=['debug','rpc','error','message','result','catch','exports','jayson/promise','bluebird','routing','client','http','Request','request'];(function(_0x56f84c,_0x1774cd){var _0x671cd=function(_0x4252c5){while(--_0x4252c5){_0x56f84c['push'](_0x56f84c['shift']());}};_0x671cd(++_0x1774cd);}(_0xba7c,0x19d));var _0xcba7=function(_0x248e85,_0x313681){_0x248e85=_0x248e85-0x0;var _0x1923b4=_0xba7c[_0x248e85];return _0x1923b4;};'use strict';var jayson=require(_0xcba7('0x0'));var BPromise=require(_0xcba7('0x1'));var logger=require('../../config/logger')(_0xcba7('0x2'));var client=jayson[_0xcba7('0x3')][_0xcba7('0x4')]({'port':0x2329});client[_0xcba7('0x5')]=function(_0x47c820,_0x8fa15){return new BPromise(function(_0x3a9762,_0x12bde3){return client[_0xcba7('0x6')](_0x47c820,_0x8fa15)['then'](function(_0x1f4160){logger[_0xcba7('0x7')](_0xcba7('0x8'),_0xcba7('0x2'),_0x47c820,_0x8fa15,_0x1f4160);if(_0x1f4160['error']){logger[_0xcba7('0x9')](_0xcba7('0x8'),'routing',_0x47c820,_0x1f4160[_0xcba7('0x9')][_0xcba7('0xa')],_0x8fa15);return _0x12bde3(_0x1f4160[_0xcba7('0x9')][_0xcba7('0xa')]);}else{return _0x3a9762(_0x1f4160[_0xcba7('0xb')]);}})[_0xcba7('0xc')](function(_0x4698f7){logger[_0xcba7('0x9')](_0xcba7('0x8'),'routing',_0x47c820,_0x4698f7,_0x8fa15);return _0x12bde3(_0x4698f7);});});};module[_0xcba7('0xd')]=client; \ No newline at end of file +var _0x5845=['debug','rpc','error','message','result','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request'];(function(_0x29ce76,_0x2731f1){var _0x1b53c0=function(_0x1e71ea){while(--_0x1e71ea){_0x29ce76['push'](_0x29ce76['shift']());}};_0x1b53c0(++_0x2731f1);}(_0x5845,0xf0));var _0x5584=function(_0x57143c,_0x5cf5e9){_0x57143c=_0x57143c-0x0;var _0x47845b=_0x5845[_0x57143c];return _0x47845b;};'use strict';var jayson=require(_0x5584('0x0'));var BPromise=require(_0x5584('0x1'));var logger=require(_0x5584('0x2'))(_0x5584('0x3'));var client=jayson[_0x5584('0x4')][_0x5584('0x5')]({'port':0x2329});client[_0x5584('0x6')]=function(_0x4f5351,_0x4cb131){return new BPromise(function(_0x39280d,_0x2423fc){return client['request'](_0x4f5351,_0x4cb131)['then'](function(_0x3bd4e7){logger[_0x5584('0x7')](_0x5584('0x8'),_0x5584('0x3'),_0x4f5351,_0x4cb131,_0x3bd4e7);if(_0x3bd4e7[_0x5584('0x9')]){logger[_0x5584('0x9')]('rpc',_0x5584('0x3'),_0x4f5351,_0x3bd4e7[_0x5584('0x9')][_0x5584('0xa')],_0x4cb131);return _0x2423fc(_0x3bd4e7[_0x5584('0x9')][_0x5584('0xa')]);}else{return _0x39280d(_0x3bd4e7[_0x5584('0xb')]);}})['catch'](function(_0x187157){logger[_0x5584('0x9')](_0x5584('0x8'),'routing',_0x4f5351,_0x187157,_0x4cb131);return _0x2423fc(_0x187157);});});};module[_0x5584('0xc')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index f42c662..4f308b5 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 _0xfd01=['getMailAccounts','initMailAccounts','mailAccounts','listen','getSettings','loginMailFrequency','catch','error','Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/setting','../../config/logger','email','resolve','then'];(function(_0x3ed53d,_0x1fc31c){var _0x281239=function(_0xa4793f){while(--_0xa4793f){_0x3ed53d['push'](_0x3ed53d['shift']());}};_0x281239(++_0x1fc31c);}(_0xfd01,0xc4));var _0x1fd0=function(_0x3770a7,_0x2e6a58){_0x3770a7=_0x3770a7-0x0;var _0x14f104=_0xfd01[_0x3770a7];return _0x14f104;};'use strict';var server=require(_0x1fd0('0x0'));var Realtime=require(_0x1fd0('0x1'));var EmailChannel=require(_0x1fd0('0x2'));var mailAccount=require('./rpc/mailAccount');var setting=require(_0x1fd0('0x3'));var logger=require(_0x1fd0('0x4'))(_0x1fd0('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x1fd0('0x6')]()[_0x1fd0('0x7')](mailAccount[_0x1fd0('0x8')]())[_0x1fd0('0x7')](realtime[_0x1fd0('0x9')]())[_0x1fd0('0x7')](function(){email['refresh'](realtime[_0x1fd0('0xa')]);return realtime;});}function main(){return server[_0x1fd0('0xb')](realtime,email)['then'](function(){return initRealtime();})['then'](function(){return setting[_0x1fd0('0xc')]();})[_0x1fd0('0x7')](function(_0x3dd3ec){return setInterval(initRealtime,_0x3dd3ec[_0x1fd0('0xd')]*0x3e8);})[_0x1fd0('0xe')](function(_0x9e56bd){logger[_0x1fd0('0xf')](_0x1fd0('0x10'),_0x9e56bd);});}main(); \ No newline at end of file +var _0x2c37=['error','Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','email','resolve','then','initMailAccounts','refresh','listen','getSettings','loginMailFrequency','catch'];(function(_0xd422ea,_0x1cffcc){var _0x50235d=function(_0x36c8db){while(--_0x36c8db){_0xd422ea['push'](_0xd422ea['shift']());}};_0x50235d(++_0x1cffcc);}(_0x2c37,0xd2));var _0x72c3=function(_0x43f6b0,_0x2262eb){_0x43f6b0=_0x43f6b0-0x0;var _0x1fd909=_0x2c37[_0x43f6b0];return _0x1fd909;};'use strict';var server=require(_0x72c3('0x0'));var Realtime=require(_0x72c3('0x1'));var EmailChannel=require(_0x72c3('0x2'));var mailAccount=require(_0x72c3('0x3'));var setting=require(_0x72c3('0x4'));var logger=require('../../config/logger')(_0x72c3('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x72c3('0x6')]()[_0x72c3('0x7')](mailAccount['getMailAccounts']())['then'](realtime[_0x72c3('0x8')]())[_0x72c3('0x7')](function(){email[_0x72c3('0x9')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x72c3('0xa')](realtime,email)['then'](function(){return initRealtime();})[_0x72c3('0x7')](function(){return setting[_0x72c3('0xb')]();})['then'](function(_0x5976b3){return setInterval(initRealtime,_0x5976b3[_0x72c3('0xc')]*0x3e8);})[_0x72c3('0xd')](function(_0x464213){logger[_0x72c3('0xe')](_0x72c3('0xf'),_0x464213);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 29ee44d..10ff904 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 _0x892b=['md5','mailAccount:update','refresh','hasOwnProperty','provider','custom','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','isNil','disabled','connected','messages','info','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','smtp','verifySmtp','Smtp','verify','catch','exports','lodash','moment','bluebird','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./imap','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','imapAccounts','prototype','emit','name','key','active','Imap','status','messageStatus','total','stringify'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x892b,0x138));var _0xb892=function(_0x1766f2,_0x3ecb5d){_0x1766f2=_0x1766f2-0x0;var _0x3c0024=_0x892b[_0x1766f2];return _0x3c0024;};'use strict';var _=require(_0xb892('0x0'));var moment=require(_0xb892('0x1'));var BPromise=require(_0xb892('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0xb892('0x3'))(_0xb892('0x4'));config[_0xb892('0x5')]=_[_0xb892('0x6')](config[_0xb892('0x5')],{'host':_0xb892('0x7'),'port':0x18eb});var io=require(_0xb892('0x8'))(new Redis(config[_0xb892('0x5')]));var EmailImap=require(_0xb892('0x9'));var EmailSmtp=require('./smtp');var mailAccount=require(_0xb892('0xa'));var md5Accounts={};function EmailChannel(_0x445495){logger['info'](_0xb892('0xb'));this[_0xb892('0xc')]=_0x445495['mailAccounts'];this[_0xb892('0xd')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0xb892('0xe')][_0xb892('0xf')]=function(_0x55c9b7){var _0x5f8304=this[_0xb892('0xc')][_0x55c9b7];var _0x2c32e4={'id':_0x5f8304['id'],'name':_0x5f8304[_0xb892('0x10')],'key':_0x5f8304[_0xb892('0x11')],'active':_0x5f8304[_0xb892('0x12')],'Imap':{'status':_0x5f8304[_0xb892('0x13')][_0xb892('0x14')],'messageStatus':_0x5f8304[_0xb892('0x13')][_0xb892('0x15')],'total':_0x5f8304[_0xb892('0x13')][_0xb892('0x16')]}};if(_['isNil'](md5Accounts[_0x55c9b7])){md5Accounts[_0x55c9b7]={};}var _0x3f3b53=md5(JSON[_0xb892('0x17')](_0x2c32e4));if(md5Accounts[_0x55c9b7]['md5']!==_0x3f3b53){md5Accounts[_0x55c9b7][_0xb892('0x18')]=_0x3f3b53;io[_0xb892('0xf')](_0xb892('0x19'),_0x2c32e4);}};EmailChannel['prototype'][_0xb892('0x1a')]=function(_0x273cdb){for(var _0x277b44 in _0x273cdb){if(_0x273cdb[_0xb892('0x1b')](_0x277b44)){if(_0x273cdb[_0x277b44]['Imap']&&_0x273cdb[_0x277b44][_0xb892('0x12')]){var _0x50b2d4=_0x273cdb[_0x277b44][_0xb892('0x13')];if(!_0x50b2d4['service']&&_0x273cdb[_0x277b44][_0xb892('0x1c')]!==_0xb892('0x1d'))_0x50b2d4['service']=_0x273cdb[_0x277b44][_0xb892('0x1c')];if(!this['imapAccounts'][_0xb892('0x1b')](_0x50b2d4['id'])){this[_0xb892('0xd')][_0x50b2d4['id']]=new EmailImap(_0x50b2d4,_0x273cdb[_0x277b44][_0xb892('0x4')]);this[_0xb892('0xd')][_0x50b2d4['id']]['on']('box',this[_0xb892('0x1e')][_0xb892('0x1f')](this,_0x277b44));this[_0xb892('0xd')][_0x50b2d4['id']]['on'](_0xb892('0x4'),this[_0xb892('0x20')][_0xb892('0x1f')](this,_0x277b44));this[_0xb892('0xd')][_0x50b2d4['id']]['on'](_0xb892('0x21'),this[_0xb892('0x22')][_0xb892('0x1f')](this,_0x277b44));this[_0xb892('0xd')][_0x50b2d4['id']]['on'](_0xb892('0x23'),this['handleImapError'][_0xb892('0x1f')](this,_0x277b44));}}else{if(_[_0xb892('0x24')](this['mailAccounts'][_0x277b44][_0xb892('0x13')])){this[_0xb892('0xc')][_0x277b44][_0xb892('0x13')]={};}this['mailAccounts'][_0x277b44][_0xb892('0x13')][_0xb892('0x14')]=_0xb892('0x25');this[_0xb892('0xc')][_0x277b44][_0xb892('0x13')]['messageStatus']='';this[_0xb892('0xf')](_0x277b44);}}}};EmailChannel[_0xb892('0xe')]['handleImapBox']=function(_0x326a5e,_0x531f17){if(this['mailAccounts'][_0x326a5e]){this[_0xb892('0xc')][_0x326a5e][_0xb892('0x13')][_0xb892('0x14')]=_0xb892('0x26');this[_0xb892('0xc')][_0x326a5e][_0xb892('0x13')][_0xb892('0x15')]=_0x531f17[_0xb892('0x10')];if(_0x531f17[_0xb892('0x27')]){this[_0xb892('0xc')][_0x326a5e]['Imap'][_0xb892('0x16')]=_0x531f17[_0xb892('0x27')][_0xb892('0x16')];}return this[_0xb892('0xf')](_0x326a5e);}};EmailChannel[_0xb892('0xe')][_0xb892('0x20')]=function(_0x4f6380,_0x5b1d71){logger[_0xb892('0x28')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x5b1d71[_0xb892('0x29')],_0x5b1d71[_0xb892('0x2a')],_0x5b1d71[_0xb892('0x2b')],_0x4f6380);if(this[_0xb892('0xc')][_0x4f6380]){return mailAccount[_0xb892('0x2c')](_0x4f6380,_0x5b1d71)[_0xb892('0x2d')](function(_0x145504){if(_0x145504){logger['info'](_0xb892('0x2e'));}})['catch'](function(_0x4d0f8a){logger[_0xb892('0x23')](_0xb892('0x2f'),JSON[_0xb892('0x17')](_0x4d0f8a));});}};EmailChannel[_0xb892('0xe')][_0xb892('0x22')]=function(_0x45757e){if(this['mailAccounts'][_0x45757e]&&this[_0xb892('0xc')][_0x45757e]['Imap']){if(this[_0xb892('0xd')][this[_0xb892('0xc')][_0x45757e][_0xb892('0x13')]['id']]){delete this[_0xb892('0xd')][this[_0xb892('0xc')][_0x45757e]['Imap']['id']];}this[_0xb892('0xc')][_0x45757e][_0xb892('0x13')][_0xb892('0x30')]=moment();this['emit'](_0x45757e);}};EmailChannel[_0xb892('0xe')]['handleImapError']=function(_0x5e7dd4,_0x69a77d){if(this['mailAccounts'][_0x5e7dd4]){this['mailAccounts'][_0x5e7dd4]['Imap'][_0xb892('0x14')]=_0xb892('0x23');this[_0xb892('0xc')][_0x5e7dd4]['Imap']['messageStatus']=_0x69a77d;return this[_0xb892('0xf')](_0x5e7dd4);}};EmailChannel[_0xb892('0xe')][_0xb892('0x31')]=function(_0x5d27e9,_0x53b826){return this[_0xb892('0x32')]['send'](_0x5d27e9,_0x53b826);};EmailChannel['prototype'][_0xb892('0x33')]=function(_0x375495){var _0x5326d1=this;if(this[_0xb892('0xc')][_0x375495['id']]){if(_[_0xb892('0x24')](this['mailAccounts'][_0x375495['id']][_0xb892('0x34')])){this['mailAccounts'][_0x375495['id']][_0xb892('0x34')]={};}this['mailAccounts'][_0x375495['id']][_0xb892('0x34')]['lastSync']=moment();return new BPromise(function(_0x212298,_0x5840ab){return _0x5326d1['smtp'][_0xb892('0x35')](_0x375495)[_0xb892('0x2d')](function(_0x55c543){_0x5326d1[_0xb892('0xc')][_0x375495['id']]['Smtp'][_0xb892('0x14')]='verified';_0x5326d1[_0xb892('0xc')][_0x375495['id']][_0xb892('0x34')]['messageStatus']='';_0x5326d1['emit'](_0x375495['id']);_0x212298(_0x55c543);})[_0xb892('0x36')](function(_0x57f948){_0x5326d1[_0xb892('0xc')][_0x375495['id']]['Smtp'][_0xb892('0x14')]='error';_0x5326d1[_0xb892('0xc')][_0x375495['id']][_0xb892('0x34')]['messageStatus']=_0x57f948;_0x5326d1[_0xb892('0xf')](_0x375495['id']);_0x5840ab(_0x57f948);});});}return this[_0xb892('0x32')][_0xb892('0x35')](_0x375495);};module[_0xb892('0x37')]=EmailChannel; \ No newline at end of file +var _0x2629=['error','handleImapError','connected','messages','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','notify','then','catch','sendMail','send','verifySmtp','Smtp','verify','verified','exports','lodash','moment','bluebird','md5','../../../config/logger','defaults','redis','./smtp','../rpc/mailAccount','start\x20email\x20channel','imapAccounts','smtp','prototype','emit','mailAccounts','name','active','Imap','status','messageStatus','total','isNil','stringify','refresh','hasOwnProperty','provider','custom','email','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd'];(function(_0x6d58db,_0x1a5d95){var _0x21942e=function(_0x137f41){while(--_0x137f41){_0x6d58db['push'](_0x6d58db['shift']());}};_0x21942e(++_0x1a5d95);}(_0x2629,0x1d2));var _0x9262=function(_0x2089b3,_0x31fbde){_0x2089b3=_0x2089b3-0x0;var _0x181087=_0x2629[_0x2089b3];return _0x181087;};'use strict';var _=require(_0x9262('0x0'));var moment=require(_0x9262('0x1'));var BPromise=require(_0x9262('0x2'));var md5=require(_0x9262('0x3'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x9262('0x4'))('email');config['redis']=_[_0x9262('0x5')](config[_0x9262('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9262('0x6')]));var EmailImap=require('./imap');var EmailSmtp=require(_0x9262('0x7'));var mailAccount=require(_0x9262('0x8'));var md5Accounts={};function EmailChannel(_0x5a0623){logger['info'](_0x9262('0x9'));this['mailAccounts']=_0x5a0623['mailAccounts'];this[_0x9262('0xa')]={};this[_0x9262('0xb')]=new EmailSmtp();}EmailChannel[_0x9262('0xc')][_0x9262('0xd')]=function(_0x5df454){var _0x418db4=this[_0x9262('0xe')][_0x5df454];var _0x2c9e57={'id':_0x418db4['id'],'name':_0x418db4[_0x9262('0xf')],'key':_0x418db4['key'],'active':_0x418db4[_0x9262('0x10')],'Imap':{'status':_0x418db4[_0x9262('0x11')][_0x9262('0x12')],'messageStatus':_0x418db4[_0x9262('0x11')][_0x9262('0x13')],'total':_0x418db4[_0x9262('0x11')][_0x9262('0x14')]}};if(_[_0x9262('0x15')](md5Accounts[_0x5df454])){md5Accounts[_0x5df454]={};}var _0x18beb3=md5(JSON[_0x9262('0x16')](_0x2c9e57));if(md5Accounts[_0x5df454][_0x9262('0x3')]!==_0x18beb3){md5Accounts[_0x5df454][_0x9262('0x3')]=_0x18beb3;io[_0x9262('0xd')]('mailAccount:update',_0x2c9e57);}};EmailChannel['prototype'][_0x9262('0x17')]=function(_0x217c00){for(var _0x42c2ad in _0x217c00){if(_0x217c00[_0x9262('0x18')](_0x42c2ad)){if(_0x217c00[_0x42c2ad][_0x9262('0x11')]&&_0x217c00[_0x42c2ad][_0x9262('0x10')]){var _0x447f90=_0x217c00[_0x42c2ad][_0x9262('0x11')];if(!_0x447f90['service']&&_0x217c00[_0x42c2ad][_0x9262('0x19')]!==_0x9262('0x1a'))_0x447f90['service']=_0x217c00[_0x42c2ad][_0x9262('0x19')];if(!this[_0x9262('0xa')][_0x9262('0x18')](_0x447f90['id'])){this[_0x9262('0xa')][_0x447f90['id']]=new EmailImap(_0x447f90,_0x217c00[_0x42c2ad][_0x9262('0x1b')]);this['imapAccounts'][_0x447f90['id']]['on'](_0x9262('0x1c'),this[_0x9262('0x1d')][_0x9262('0x1e')](this,_0x42c2ad));this[_0x9262('0xa')][_0x447f90['id']]['on'](_0x9262('0x1b'),this[_0x9262('0x1f')]['bind'](this,_0x42c2ad));this[_0x9262('0xa')][_0x447f90['id']]['on'](_0x9262('0x20'),this[_0x9262('0x21')][_0x9262('0x1e')](this,_0x42c2ad));this[_0x9262('0xa')][_0x447f90['id']]['on'](_0x9262('0x22'),this[_0x9262('0x23')][_0x9262('0x1e')](this,_0x42c2ad));}}else{if(_['isNil'](this[_0x9262('0xe')][_0x42c2ad][_0x9262('0x11')])){this[_0x9262('0xe')][_0x42c2ad][_0x9262('0x11')]={};}this[_0x9262('0xe')][_0x42c2ad][_0x9262('0x11')][_0x9262('0x12')]='disabled';this[_0x9262('0xe')][_0x42c2ad][_0x9262('0x11')][_0x9262('0x13')]='';this[_0x9262('0xd')](_0x42c2ad);}}}};EmailChannel[_0x9262('0xc')]['handleImapBox']=function(_0x16123a,_0x236f45){if(this['mailAccounts'][_0x16123a]){this[_0x9262('0xe')][_0x16123a][_0x9262('0x11')][_0x9262('0x12')]=_0x9262('0x24');this[_0x9262('0xe')][_0x16123a][_0x9262('0x11')][_0x9262('0x13')]=_0x236f45[_0x9262('0xf')];if(_0x236f45[_0x9262('0x25')]){this['mailAccounts'][_0x16123a]['Imap']['total']=_0x236f45[_0x9262('0x25')]['total'];}return this[_0x9262('0xd')](_0x16123a);}};EmailChannel[_0x9262('0xc')][_0x9262('0x1f')]=function(_0x4f2bbd,_0x1b94ba){logger[_0x9262('0x26')](_0x9262('0x27'),_0x1b94ba['firstName'],_0x1b94ba['lastName'],_0x1b94ba['from'],_0x4f2bbd);if(this[_0x9262('0xe')][_0x4f2bbd]){return mailAccount[_0x9262('0x28')](_0x4f2bbd,_0x1b94ba)[_0x9262('0x29')](function(_0x4d8c92){if(_0x4d8c92){logger[_0x9262('0x26')]('Mail\x20accepted\x20from\x20routing');}})[_0x9262('0x2a')](function(_0xae22dd){logger['error']('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON['stringify'](_0xae22dd));});}};EmailChannel['prototype']['handleImapEnd']=function(_0x58b2cf){if(this[_0x9262('0xe')][_0x58b2cf]&&this['mailAccounts'][_0x58b2cf][_0x9262('0x11')]){if(this[_0x9262('0xa')][this[_0x9262('0xe')][_0x58b2cf][_0x9262('0x11')]['id']]){delete this[_0x9262('0xa')][this['mailAccounts'][_0x58b2cf]['Imap']['id']];}this['mailAccounts'][_0x58b2cf]['Imap']['lastSync']=moment();this[_0x9262('0xd')](_0x58b2cf);}};EmailChannel[_0x9262('0xc')]['handleImapError']=function(_0x4c6b62,_0x50b10f){if(this[_0x9262('0xe')][_0x4c6b62]){this[_0x9262('0xe')][_0x4c6b62][_0x9262('0x11')][_0x9262('0x12')]=_0x9262('0x22');this[_0x9262('0xe')][_0x4c6b62][_0x9262('0x11')][_0x9262('0x13')]=_0x50b10f;return this[_0x9262('0xd')](_0x4c6b62);}};EmailChannel[_0x9262('0xc')][_0x9262('0x2b')]=function(_0x10256c,_0x33cb40){return this['smtp'][_0x9262('0x2c')](_0x10256c,_0x33cb40);};EmailChannel[_0x9262('0xc')][_0x9262('0x2d')]=function(_0xfe84b1){var _0x8d563f=this;if(this[_0x9262('0xe')][_0xfe84b1['id']]){if(_[_0x9262('0x15')](this[_0x9262('0xe')][_0xfe84b1['id']][_0x9262('0x2e')])){this['mailAccounts'][_0xfe84b1['id']][_0x9262('0x2e')]={};}this[_0x9262('0xe')][_0xfe84b1['id']][_0x9262('0x2e')]['lastSync']=moment();return new BPromise(function(_0x36f532,_0x279e35){return _0x8d563f[_0x9262('0xb')][_0x9262('0x2f')](_0xfe84b1)['then'](function(_0x408cab){_0x8d563f[_0x9262('0xe')][_0xfe84b1['id']][_0x9262('0x2e')][_0x9262('0x12')]=_0x9262('0x30');_0x8d563f['mailAccounts'][_0xfe84b1['id']][_0x9262('0x2e')]['messageStatus']='';_0x8d563f[_0x9262('0xd')](_0xfe84b1['id']);_0x36f532(_0x408cab);})[_0x9262('0x2a')](function(_0x1dbd4d){_0x8d563f['mailAccounts'][_0xfe84b1['id']][_0x9262('0x2e')]['status']='error';_0x8d563f[_0x9262('0xe')][_0xfe84b1['id']]['Smtp']['messageStatus']=_0x1dbd4d;_0x8d563f['emit'](_0xfe84b1['id']);_0x279e35(_0x1dbd4d);});});}return this[_0x9262('0xb')][_0x9262('0x2f')](_0xfe84b1);};module[_0x9262('0x31')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 44f0453..e4f68fe 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 _0xe242=['handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','emit','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','util','imap','mailparser','simpleParser','iconv','events','EventEmitter','./utils','../../../config/logger','mailbox','account','once','ready','handleReady','bind','end','handleEnd','error','handleError','connect','inherits','prototype','getAccount','authTimeout','service','user','modernAuthentication','xoauth2','CloudProvider','data5','authentication','password','email','anonymous@xcally.com','host','port','tls','autotls','required','handleOpenBox','box','search','UNSEEN','handleReadUnseen','length','fetch','handleFetchError','handleFetchEnd','closeBox','handleCloseBox','handleFetchMessage','body','handleMessageBody','attributes'];(function(_0x26e9d7,_0x2cfd78){var _0xf39dd5=function(_0x2c5ec1){while(--_0x2c5ec1){_0x26e9d7['push'](_0x26e9d7['shift']());}};_0xf39dd5(++_0x2cfd78);}(_0xe242,0x14f));var _0x2e24=function(_0x44d1dc,_0xabb37c){_0x44d1dc=_0x44d1dc-0x0;var _0x4f6793=_0xe242[_0x44d1dc];return _0x4f6793;};'use strict';var _=require(_0x2e24('0x0'));var util=require(_0x2e24('0x1'));var Imap=require(_0x2e24('0x2'));var simpleParser=require(_0x2e24('0x3'))[_0x2e24('0x4')];var Iconv=require(_0x2e24('0x5'))['Iconv'];var EventEmitter=require(_0x2e24('0x6'))[_0x2e24('0x7')];var utils=require(_0x2e24('0x8'));var logger=require(_0x2e24('0x9'))('email');function EmailImap(_0x3aca84,_0x115909){this[_0x2e24('0xa')]=_0x3aca84['mailbox'];this[_0x2e24('0xb')]=this['getAccount'](_0x3aca84,_0x115909);this[_0x2e24('0x2')]=new Imap(this[_0x2e24('0xb')]);this[_0x2e24('0x2')][_0x2e24('0xc')](_0x2e24('0xd'),this[_0x2e24('0xe')][_0x2e24('0xf')](this));this['imap'][_0x2e24('0xc')](_0x2e24('0x10'),this[_0x2e24('0x11')]['bind'](this));this['imap']['on'](_0x2e24('0x12'),this[_0x2e24('0x13')][_0x2e24('0xf')](this));this[_0x2e24('0x2')][_0x2e24('0x14')]();}util[_0x2e24('0x15')](EmailImap,EventEmitter);EmailImap[_0x2e24('0x16')][_0x2e24('0x17')]=function(_0x162b07,_0x4a7fbe){var _0xbc2b94={'connTimeout':_0x162b07['connTimeout']?_0x162b07['connTimeout']*0x3e8:0x2710,'authTimeout':_0x162b07[_0x2e24('0x18')]?_0x162b07[_0x2e24('0x18')]*0x3e8:0x1388};if(_0x162b07[_0x2e24('0x19')]){_0xbc2b94[_0x2e24('0x1a')]=_0x162b07[_0x2e24('0x1a')];if(_0x162b07[_0x2e24('0x1b')]){_0xbc2b94[_0x2e24('0x1c')]=utils['generateXOAuth2Token'](_0x162b07[_0x2e24('0x1d')][_0x2e24('0x1e')],_0x162b07[_0x2e24('0x1a')]);}else{_0xbc2b94['password']=_0x162b07['password'];}}else{if(_0x162b07[_0x2e24('0x1f')]){_0xbc2b94[_0x2e24('0x1a')]=_0x162b07[_0x2e24('0x1a')];_0xbc2b94['password']=_0x162b07[_0x2e24('0x20')];}}_0xbc2b94[_0x2e24('0x21')]=_0x4a7fbe||_0x162b07[_0x2e24('0x1a')]||_0x2e24('0x22');_0xbc2b94[_0x2e24('0x23')]=_0x162b07[_0x2e24('0x23')];_0xbc2b94['port']=_0x162b07[_0x2e24('0x24')]||0x3e1;if(_0x162b07[_0x2e24('0x25')]){_0xbc2b94['tls']=!![];}else{_0xbc2b94[_0x2e24('0x25')]=![];_0xbc2b94[_0x2e24('0x26')]=_0x2e24('0x27');}return _0xbc2b94;};EmailImap[_0x2e24('0x16')]['handleReady']=function(){this[_0x2e24('0x2')]['openBox'](this['mailbox'],![],this['handleOpenBox'][_0x2e24('0xf')](this));};EmailImap[_0x2e24('0x16')][_0x2e24('0x28')]=function(_0x42e388,_0x302adf){if(_0x42e388){this['handleError'](_0x42e388,!![]);}else{this['emit'](_0x2e24('0x29'),_0x302adf);this['readUnseen']();}};EmailImap['prototype']['handleCloseBox']=function(_0x41e27b){if(_0x41e27b){this[_0x2e24('0x13')](_0x41e27b,!![]);}else{this['imap'][_0x2e24('0x10')]();}};EmailImap['prototype']['readUnseen']=function(){this[_0x2e24('0x2')][_0x2e24('0x2a')]([_0x2e24('0x2b')],this['handleReadUnseen'][_0x2e24('0xf')](this));};EmailImap[_0x2e24('0x16')][_0x2e24('0x2c')]=function(_0x18d282,_0x24ae41){if(_0x18d282){this[_0x2e24('0x13')](_0x18d282,!![]);}else{if(_0x24ae41[_0x2e24('0x2d')]){try{var _0x4b8784=this[_0x2e24('0x2')][_0x2e24('0x2e')](_0x24ae41,{'bodies':'','markSeen':!![]});_0x4b8784['on']('message',this['handleFetchMessage'][_0x2e24('0xf')](this));_0x4b8784[_0x2e24('0xc')](_0x2e24('0x12'),this[_0x2e24('0x2f')][_0x2e24('0xf')](this));_0x4b8784[_0x2e24('0xc')]('end',this[_0x2e24('0x30')][_0x2e24('0xf')](this));}catch(_0x37ec54){logger[_0x2e24('0x12')](_0x37ec54);}}else{this[_0x2e24('0x2')][_0x2e24('0x31')](!![],this[_0x2e24('0x32')][_0x2e24('0xf')](this));}}};EmailImap[_0x2e24('0x16')][_0x2e24('0x33')]=function(_0x43dfe5){_0x43dfe5['on'](_0x2e24('0x34'),this[_0x2e24('0x35')][_0x2e24('0xf')](this));_0x43dfe5['once'](_0x2e24('0x36'),this[_0x2e24('0x37')][_0x2e24('0xf')](this));_0x43dfe5[_0x2e24('0xc')](_0x2e24('0x10'),this[_0x2e24('0x38')]['bind'](this));};EmailImap[_0x2e24('0x16')]['handleMessageBody']=function(_0x1bb61a){simpleParser(_0x1bb61a,{'Iconv':Iconv},this['handleSimpleParser'][_0x2e24('0xf')](this));};EmailImap['prototype']['handleMessageAttributes']=function(){};EmailImap['prototype'][_0x2e24('0x38')]=function(){};EmailImap['prototype'][_0x2e24('0x39')]=function(_0x331bd6,_0x437d7e){if(_0x331bd6){logger[_0x2e24('0x12')](_0x331bd6);}else{var _0x453905=this;utils[_0x2e24('0x3a')](this['account'],_0x437d7e,function(_0x586710){_0x453905['emit'](_0x2e24('0x21'),_0x586710);});}};EmailImap[_0x2e24('0x16')][_0x2e24('0x30')]=function(){this[_0x2e24('0x2')][_0x2e24('0x31')](!![],this[_0x2e24('0x32')][_0x2e24('0xf')](this));};EmailImap[_0x2e24('0x16')][_0x2e24('0x2f')]=function(_0xc5b7e5){this[_0x2e24('0x13')](_0xc5b7e5);this[_0x2e24('0x2')]['closeBox'](!![],this[_0x2e24('0x32')][_0x2e24('0xf')](this));};EmailImap[_0x2e24('0x16')][_0x2e24('0x11')]=function(){this[_0x2e24('0x3b')](_0x2e24('0x10'));};EmailImap['prototype']['handleError']=function(_0x5e595c,_0x4009be){logger[_0x2e24('0x12')](_0x2e24('0x13'),this[_0x2e24('0xb')][_0x2e24('0x21')],JSON[_0x2e24('0x3c')](_0x5e595c));var _0x22bac5='';if(_0x5e595c){if(_0x5e595c[_0x2e24('0x3d')]){_0x22bac5=_0x5e595c['textCode'];}else{for(var _0x1dd859 in _0x5e595c){if(_0x5e595c[_0x2e24('0x3e')](_0x1dd859)){_0x22bac5+=_[_0x2e24('0x3f')](_0x1dd859)+':\x20'+_0x5e595c[_0x1dd859]+'\x0a';}}}}if(_0x4009be){this['imap'][_0x2e24('0x10')]();}else{this[_0x2e24('0x3b')](_0x2e24('0x12'),_0x22bac5);this[_0x2e24('0x3b')]('end');}};module[_0x2e24('0x40')]=EmailImap; \ No newline at end of file +var _0xfb99=['handleCloseBox','readUnseen','UNSEEN','handleReadUnseen','fetch','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','handleMessageBody','handleMessageAttributes','handleSimpleParser','handleMessageEnd','parser','textCode','hasOwnProperty','upperFirst','exports','util','mailparser','simpleParser','iconv','events','./utils','email','mailbox','account','getAccount','imap','once','ready','handleReady','bind','end','handleEnd','error','handleError','connect','connTimeout','authTimeout','user','modernAuthentication','xoauth2','CloudProvider','data5','password','anonymous@xcally.com','host','port','tls','autotls','prototype','openBox','handleOpenBox','emit','box'];(function(_0x13b853,_0x409644){var _0xec64c2=function(_0x441774){while(--_0x441774){_0x13b853['push'](_0x13b853['shift']());}};_0xec64c2(++_0x409644);}(_0xfb99,0x82));var _0x9fb9=function(_0x21a476,_0xf3982a){_0x21a476=_0x21a476-0x0;var _0xdfb305=_0xfb99[_0x21a476];return _0xdfb305;};'use strict';var _=require('lodash');var util=require(_0x9fb9('0x0'));var Imap=require('imap');var simpleParser=require(_0x9fb9('0x1'))[_0x9fb9('0x2')];var Iconv=require(_0x9fb9('0x3'))['Iconv'];var EventEmitter=require(_0x9fb9('0x4'))['EventEmitter'];var utils=require(_0x9fb9('0x5'));var logger=require('../../../config/logger')(_0x9fb9('0x6'));function EmailImap(_0x366b13,_0x36f02d){this[_0x9fb9('0x7')]=_0x366b13[_0x9fb9('0x7')];this[_0x9fb9('0x8')]=this[_0x9fb9('0x9')](_0x366b13,_0x36f02d);this[_0x9fb9('0xa')]=new Imap(this['account']);this[_0x9fb9('0xa')][_0x9fb9('0xb')](_0x9fb9('0xc'),this[_0x9fb9('0xd')][_0x9fb9('0xe')](this));this[_0x9fb9('0xa')][_0x9fb9('0xb')](_0x9fb9('0xf'),this[_0x9fb9('0x10')][_0x9fb9('0xe')](this));this[_0x9fb9('0xa')]['on'](_0x9fb9('0x11'),this[_0x9fb9('0x12')]['bind'](this));this[_0x9fb9('0xa')][_0x9fb9('0x13')]();}util['inherits'](EmailImap,EventEmitter);EmailImap['prototype']['getAccount']=function(_0x4369f9,_0x5dfaba){var _0x53d29a={'connTimeout':_0x4369f9[_0x9fb9('0x14')]?_0x4369f9[_0x9fb9('0x14')]*0x3e8:0x2710,'authTimeout':_0x4369f9[_0x9fb9('0x15')]?_0x4369f9[_0x9fb9('0x15')]*0x3e8:0x1388};if(_0x4369f9['service']){_0x53d29a[_0x9fb9('0x16')]=_0x4369f9[_0x9fb9('0x16')];if(_0x4369f9[_0x9fb9('0x17')]){_0x53d29a[_0x9fb9('0x18')]=utils['generateXOAuth2Token'](_0x4369f9[_0x9fb9('0x19')][_0x9fb9('0x1a')],_0x4369f9[_0x9fb9('0x16')]);}else{_0x53d29a[_0x9fb9('0x1b')]=_0x4369f9[_0x9fb9('0x1b')];}}else{if(_0x4369f9['authentication']){_0x53d29a['user']=_0x4369f9[_0x9fb9('0x16')];_0x53d29a[_0x9fb9('0x1b')]=_0x4369f9[_0x9fb9('0x1b')];}}_0x53d29a['email']=_0x5dfaba||_0x4369f9[_0x9fb9('0x16')]||_0x9fb9('0x1c');_0x53d29a['host']=_0x4369f9[_0x9fb9('0x1d')];_0x53d29a[_0x9fb9('0x1e')]=_0x4369f9[_0x9fb9('0x1e')]||0x3e1;if(_0x4369f9[_0x9fb9('0x1f')]){_0x53d29a['tls']=!![];}else{_0x53d29a[_0x9fb9('0x1f')]=![];_0x53d29a[_0x9fb9('0x20')]='required';}return _0x53d29a;};EmailImap[_0x9fb9('0x21')][_0x9fb9('0xd')]=function(){this[_0x9fb9('0xa')][_0x9fb9('0x22')](this['mailbox'],![],this[_0x9fb9('0x23')][_0x9fb9('0xe')](this));};EmailImap[_0x9fb9('0x21')]['handleOpenBox']=function(_0x50276a,_0x4d246b){if(_0x50276a){this['handleError'](_0x50276a,!![]);}else{this[_0x9fb9('0x24')](_0x9fb9('0x25'),_0x4d246b);this['readUnseen']();}};EmailImap[_0x9fb9('0x21')][_0x9fb9('0x26')]=function(_0x5a8b47){if(_0x5a8b47){this[_0x9fb9('0x12')](_0x5a8b47,!![]);}else{this['imap'][_0x9fb9('0xf')]();}};EmailImap[_0x9fb9('0x21')][_0x9fb9('0x27')]=function(){this[_0x9fb9('0xa')]['search']([_0x9fb9('0x28')],this[_0x9fb9('0x29')][_0x9fb9('0xe')](this));};EmailImap[_0x9fb9('0x21')][_0x9fb9('0x29')]=function(_0x5b1e06,_0x8725c2){if(_0x5b1e06){this['handleError'](_0x5b1e06,!![]);}else{if(_0x8725c2['length']){try{var _0x211931=this[_0x9fb9('0xa')][_0x9fb9('0x2a')](_0x8725c2,{'bodies':'','markSeen':!![]});_0x211931['on']('message',this[_0x9fb9('0x2b')][_0x9fb9('0xe')](this));_0x211931['once'](_0x9fb9('0x11'),this[_0x9fb9('0x2c')][_0x9fb9('0xe')](this));_0x211931[_0x9fb9('0xb')](_0x9fb9('0xf'),this[_0x9fb9('0x2d')][_0x9fb9('0xe')](this));}catch(_0xe29c30){logger['error'](_0xe29c30);}}else{this[_0x9fb9('0xa')][_0x9fb9('0x2e')](!![],this[_0x9fb9('0x26')]['bind'](this));}}};EmailImap[_0x9fb9('0x21')][_0x9fb9('0x2b')]=function(_0x3277cf){_0x3277cf['on']('body',this[_0x9fb9('0x2f')][_0x9fb9('0xe')](this));_0x3277cf[_0x9fb9('0xb')]('attributes',this[_0x9fb9('0x30')][_0x9fb9('0xe')](this));_0x3277cf[_0x9fb9('0xb')]('end',this['handleMessageEnd'][_0x9fb9('0xe')](this));};EmailImap[_0x9fb9('0x21')][_0x9fb9('0x2f')]=function(_0x5e04eb){simpleParser(_0x5e04eb,{'Iconv':Iconv},this[_0x9fb9('0x31')][_0x9fb9('0xe')](this));};EmailImap['prototype']['handleMessageAttributes']=function(){};EmailImap['prototype'][_0x9fb9('0x32')]=function(){};EmailImap[_0x9fb9('0x21')][_0x9fb9('0x31')]=function(_0x570a0a,_0x1e3a60){if(_0x570a0a){logger[_0x9fb9('0x11')](_0x570a0a);}else{var _0x4b1d92=this;utils[_0x9fb9('0x33')](this[_0x9fb9('0x8')],_0x1e3a60,function(_0x294182){_0x4b1d92[_0x9fb9('0x24')]('email',_0x294182);});}};EmailImap[_0x9fb9('0x21')][_0x9fb9('0x2d')]=function(){this[_0x9fb9('0xa')][_0x9fb9('0x2e')](!![],this[_0x9fb9('0x26')][_0x9fb9('0xe')](this));};EmailImap[_0x9fb9('0x21')][_0x9fb9('0x2c')]=function(_0x4df6b9){this[_0x9fb9('0x12')](_0x4df6b9);this[_0x9fb9('0xa')][_0x9fb9('0x2e')](!![],this['handleCloseBox'][_0x9fb9('0xe')](this));};EmailImap[_0x9fb9('0x21')]['handleEnd']=function(){this[_0x9fb9('0x24')](_0x9fb9('0xf'));};EmailImap[_0x9fb9('0x21')][_0x9fb9('0x12')]=function(_0x3c4b52,_0x1339bf){logger[_0x9fb9('0x11')](_0x9fb9('0x12'),this[_0x9fb9('0x8')][_0x9fb9('0x6')],JSON['stringify'](_0x3c4b52));var _0x22dd65='';if(_0x3c4b52){if(_0x3c4b52['textCode']){_0x22dd65=_0x3c4b52[_0x9fb9('0x34')];}else{for(var _0x46c2ab in _0x3c4b52){if(_0x3c4b52[_0x9fb9('0x35')](_0x46c2ab)){_0x22dd65+=_[_0x9fb9('0x36')](_0x46c2ab)+':\x20'+_0x3c4b52[_0x46c2ab]+'\x0a';}}}}if(_0x1339bf){this[_0x9fb9('0xa')][_0x9fb9('0xf')]();}else{this['emit'](_0x9fb9('0x11'),_0x22dd65);this[_0x9fb9('0x24')]('end');}};module[_0x9fb9('0x37')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index db94a74..8dc4ca0 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 _0x5744=['Not\x20verifired','exports','nodemailer-plugin-inline-base64','prototype','createTransport','compile','sendMail','toString','verify'];(function(_0xbce81a,_0xa48131){var _0x272233=function(_0x504cdc){while(--_0x504cdc){_0xbce81a['push'](_0xbce81a['shift']());}};_0x272233(++_0xa48131);}(_0x5744,0x122));var _0x4574=function(_0x17b45f,_0x24f28d){_0x17b45f=_0x17b45f-0x0;var _0x49ede4=_0x5744[_0x17b45f];return _0x49ede4;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0x4574('0x0'));function EmailSmtp(){}EmailSmtp[_0x4574('0x1')]['send']=function(_0x5d2fea,_0x2fab43){return new Promise(function(_0x5c2af8,_0x2d6087){var _0x4ce4bc=nodemailer[_0x4574('0x2')](_0x5d2fea);_0x4ce4bc['use'](_0x4574('0x3'),inlineBase64());_0x4ce4bc[_0x4574('0x4')](_0x2fab43,function(_0x4af2c8,_0x515c2d){if(_0x4af2c8){_0x2d6087(_0x4af2c8[_0x4574('0x5')]());}else{_0x5c2af8(_0x515c2d);}});});};EmailSmtp['prototype']['verify']=function(_0x4e8ab6){return new Promise(function(_0xab333,_0x56e4e7){var _0x34ef56=nodemailer[_0x4574('0x2')](_0x4e8ab6);_0x34ef56[_0x4574('0x6')](function(_0x325db0,_0x40c0a1){if(_0x325db0){_0x56e4e7(_0x325db0[_0x4574('0x5')]());}else{if(_0x40c0a1){_0xab333(_0x40c0a1);}else{_0x56e4e7(_0x4574('0x7'));}}});});};module[_0x4574('0x8')]=EmailSmtp; \ No newline at end of file +var _0xdebc=['use','compile','toString','verify','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','prototype','send','createTransport'];(function(_0x46bdac,_0x568fc5){var _0x2b1828=function(_0x3ed1c5){while(--_0x3ed1c5){_0x46bdac['push'](_0x46bdac['shift']());}};_0x2b1828(++_0x568fc5);}(_0xdebc,0x150));var _0xcdeb=function(_0x39dea5,_0x52fa8e){_0x39dea5=_0x39dea5-0x0;var _0x5d3111=_0xdebc[_0x39dea5];return _0x5d3111;};'use strict';var nodemailer=require(_0xcdeb('0x0'));var inlineBase64=require(_0xcdeb('0x1'));function EmailSmtp(){}EmailSmtp[_0xcdeb('0x2')][_0xcdeb('0x3')]=function(_0x4bbb1d,_0x525c32){return new Promise(function(_0x2fc3d2,_0x216ca9){var _0x13b7c0=nodemailer[_0xcdeb('0x4')](_0x4bbb1d);_0x13b7c0[_0xcdeb('0x5')](_0xcdeb('0x6'),inlineBase64());_0x13b7c0['sendMail'](_0x525c32,function(_0x5cefbb,_0x7bd3cf){if(_0x5cefbb){_0x216ca9(_0x5cefbb[_0xcdeb('0x7')]());}else{_0x2fc3d2(_0x7bd3cf);}});});};EmailSmtp[_0xcdeb('0x2')]['verify']=function(_0x8a8914){return new Promise(function(_0x169a7f,_0x197179){var _0x400bb3=nodemailer['createTransport'](_0x8a8914);_0x400bb3[_0xcdeb('0x8')](function(_0x45a0be,_0x2a80eb){if(_0x45a0be){_0x197179(_0x45a0be[_0xcdeb('0x7')]());}else{if(_0x2a80eb){_0x169a7f(_0x2a80eb);}else{_0x197179(_0xcdeb('0x9'));}}});});};module[_0xcdeb('0xa')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 249e13d..9b36427 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 _0xc333=['email','message','originCc','includes','bcc','attachments','type','attachment','format','%s-%s','now','root','server/files/attachments/','push','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','line','isAutoreply','parser','messageId','inReplyTo','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','content','BodyHTML','

Empty\x20message

','Attachments','Title','from','Data','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','base64','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','substring','indexOf','length','slice','join','Anonymous','split','pop','isEmpty','html','test','replace','\x20[Attachment:\x20','body','textAsHtml','originTo'];(function(_0x559adf,_0x5989cc){var _0x53f28f=function(_0x536804){while(--_0x536804){_0x559adf['push'](_0x559adf['shift']());}};_0x53f28f(++_0x5989cc);}(_0xc333,0x115));var _0x3c33=function(_0x3e3278,_0xdde28e){_0x3e3278=_0x3e3278-0x0;var _0xcc445b=_0xc333[_0x3e3278];return _0xcc445b;};'use strict';var _=require(_0x3c33('0x0'));var moment=require(_0x3c33('0x1'));var random=require(_0x3c33('0x2'));var fs=require('fs');var path=require(_0x3c33('0x3'));var util=require(_0x3c33('0x4'));var tnef=require(_0x3c33('0x5'));var logger=require(_0x3c33('0x6'))('email');var config=require(_0x3c33('0x7'));function getAddress(_0x4aaa35){var _0xd5e2f9=_[_0x3c33('0x8')](_0x4aaa35[_0x3c33('0x9')]);return _0xd5e2f9&&_0xd5e2f9[_0x3c33('0xa')]?_0xd5e2f9[_0x3c33('0xa')]:_0x3c33('0xb')+random[_0x3c33('0xc')](0x6)+_0x3c33('0xd');}function getFirstName(_0x202e74){var _0x4baac9=_['head'](_0x202e74[_0x3c33('0x9')]);if(_0x4baac9&&_0x4baac9[_0x3c33('0xe')]){if(_0x4baac9[_0x3c33('0xe')]==_0x4baac9[_0x3c33('0xa')]){return _0x4baac9[_0x3c33('0xe')][_0x3c33('0xf')](0x0,_0x4baac9[_0x3c33('0xe')][_0x3c33('0x10')]('@'));}var _0x7c9a82=_0x4baac9[_0x3c33('0xe')]['split'](/\s+/);return _0x7c9a82[_0x3c33('0x11')]>0x1?_0x7c9a82[_0x3c33('0x12')](0x0,-0x1)[_0x3c33('0x13')]('\x20'):_0x4baac9[_0x3c33('0xe')];}return _0x3c33('0x14');}function getLastName(_0x333147){var _0x328b40=_[_0x3c33('0x8')](_0x333147[_0x3c33('0x9')]);if(_0x328b40&&_0x328b40['name']){var _0x351ffc=_0x328b40['name'][_0x3c33('0x15')](/\s+/);return _0x351ffc['length']>0x1?_0x351ffc[_0x3c33('0x16')]():'';}return'';}function getMails(_0x687040,_0x12024b){var _0x3d3f0c='';for(var _0x1e72a6=0x0;_0x1e72a6<_0x12024b[_0x3c33('0x9')][_0x3c33('0x11')];_0x1e72a6+=0x1){if(_0x12024b[_0x3c33('0x9')][_0x1e72a6][_0x3c33('0xa')]!==_0x687040){if(!_[_0x3c33('0x17')](_0x3d3f0c)){_0x3d3f0c+=',';}_0x3d3f0c+=_0x12024b[_0x3c33('0x9')][_0x1e72a6][_0x3c33('0xe')]||_0x12024b['value'][_0x1e72a6][_0x3c33('0xa')]||'';_0x3d3f0c+='\x20<';_0x3d3f0c+=_0x12024b[_0x3c33('0x9')][_0x1e72a6][_0x3c33('0xa')]?_0x12024b[_0x3c33('0x9')][_0x1e72a6]['address']:_0x3c33('0xb')+random['generate'](0x6)+_0x3c33('0xd');_0x3d3f0c+='>';}}return _0x3d3f0c;}function parseEmail(_0xb7ca7a,_0x1fb43c,_0x1617fa){if(_0x1fb43c[_0x3c33('0x18')]){var _0x563377=/)<[^<]*)*<\/script>/gi;while(_0x563377[_0x3c33('0x19')](_0x1fb43c[_0x3c33('0x18')])){_0x1fb43c['html']=_0x1fb43c['html'][_0x3c33('0x1a')](_0x563377,'');}if(_0x1fb43c[_0x3c33('0x18')]['includes'](_0x3c33('0x1b'))){var _0x1f08a5=[];_0x1fb43c['attachments'][_0x3c33('0x1c')](_0x3196a7=>{_0x1f08a5['push'](_0x3196a7[_0x3c33('0x1d')]);});var _0x14d2c8=/]+>/g;var _0xc5f16c=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x105176=_0x1fb43c[_0x3c33('0x18')][_0x3c33('0x1a')](_0xc5f16c,'_SRC');var _0x493f96=_0x105176[_0x3c33('0x1a')](_0x14d2c8,_0x3c33('0x1e'));for(let _0x2176da=0x0;_0x2176da<_0x1f08a5[_0x3c33('0x11')];_0x2176da++){var _0xa239ed=_0x493f96[_0x3c33('0x1a')](_0x3c33('0x1e'),_0x3c33('0x1f')+_0x1f08a5[_0x2176da]+'\x20]');_0x493f96=_0xa239ed;}_0x1fb43c['html']=_0x493f96;}_0x1617fa[_0x3c33('0x20')]=_0x1fb43c['html'];}else{_0x1617fa[_0x3c33('0x20')]=_0x1fb43c[_0x3c33('0x21')];}if(_0x1617fa[_0x3c33('0x20')]){_0x1617fa[_0x3c33('0x20')]=_0x1617fa[_0x3c33('0x20')][_0x3c33('0x1a')](/0x0){var _0x5c312b=[_0x3c33('0x33'),_0x3c33('0x34'),'Precedence:\x20auto_reply'];for(var _0x1c2a05=0x0;_0x1c2a05<_0x1fb43c[_0x3c33('0x32')][_0x3c33('0x11')];_0x1c2a05++){var _0x349a08=_[_0x3c33('0x10')](_0x5c312b,_0x1fb43c['headerLines'][_0x1c2a05][_0x3c33('0x35')]);if(_0x349a08>=0x0){_0x1617fa[_0x3c33('0x36')]=!![];}}}return _0x1617fa;}exports[_0x3c33('0x37')]=function(_0x1bbdfa,_0x1a4607,_0x10f56f){var _0x3d52d9={'from':getAddress(_0x1a4607['from']),'firstName':getFirstName(_0x1a4607['from']),'lastName':getLastName(_0x1a4607['from']),'mapKey':_0x3c33('0x23'),'message':{'from':getMails(_0x1bbdfa[_0x3c33('0x23')],_0x1a4607['from']),'to':_0x1bbdfa[_0x3c33('0x23')],'cc':'','subject':_0x1a4607['subject']||'','messageId':_0x1a4607[_0x3c33('0x38')],'inReplyTo':_0x1a4607[_0x3c33('0x39')],'sentAt':moment(_0x1a4607['date'])[_0x3c33('0x2b')](_0x3c33('0x3a')),'attach':![],'attachments':[]}};if(!_0x1a4607[_0x3c33('0x18')]&&!_0x1a4607[_0x3c33('0x21')]){var _0x4ef554=_[_0x3c33('0x3b')](_0x1a4607[_0x3c33('0x28')],{'contentType':_0x3c33('0x3c')});if(_0x4ef554[_0x3c33('0x11')]){logger[_0x3c33('0x3d')](util[_0x3c33('0x2b')](_0x3c33('0x3e'),_0x1a4607[_0x3c33('0x38')]));tnef[_0x3c33('0x3f')](_[_0x3c33('0x40')](_0x4ef554)[_0x3c33('0x41')],function(_0x152d61,_0x3eeb5a){if(_0x3eeb5a){_0x1a4607[_0x3c33('0x18')]=_0x3eeb5a[_0x3c33('0x42')]||_0x3c33('0x43');if(_0x3eeb5a[_0x3c33('0x44')]){for(var _0x323360=0x0;_0x323360<_0x3eeb5a['Attachments'][_0x3c33('0x11')];_0x323360++){var _0xa2266d=_0x3eeb5a[_0x3c33('0x44')][_0x323360];_0x3d52d9['message'][_0x3c33('0x28')][_0x3c33('0x30')]({'filename':_0xa2266d[_0x3c33('0x45')],'content':Buffer[_0x3c33('0x46')](_0xa2266d[_0x3c33('0x47')])});}}}_0x10f56f(parseEmail(_0x1bbdfa,_0x1a4607,_0x3d52d9));});}else{_0x1a4607[_0x3c33('0x18')]='

Empty\x20message

';_0x10f56f(parseEmail(_0x1bbdfa,_0x1a4607,_0x3d52d9));}}else{_0x10f56f(parseEmail(_0x1bbdfa,_0x1a4607,_0x3d52d9));}};exports[_0x3c33('0x48')]=function(_0x20b497,_0x3db490){var _0x1d3c83=[_0x3c33('0x49')+(_0x3db490||''),_0x3c33('0x4a')+_0x20b497,'',''];return Buffer['from'](_0x1d3c83['join'](''),_0x3c33('0x4b'))[_0x3c33('0x4c')](_0x3c33('0x4d'));}; \ No newline at end of file +var _0xb493=['filename','_SRC','_IMG','\x20[Attachment:\x20','\x20]','body','textAsHtml','message','originTo','email','isEmpty','originCc','bcc','attach','type','attachment-','format','root','server/files/attachments/','writeFileSync','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','line','isAutoreply','from','subject','messageId','inReplyTo','date','filter','application/ms-tnef','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','BodyHTML','Attachments','Title','Data','generateXOAuth2Token','user=','auth=Bearer\x20','base64','randomstring','path','util','../../../config/logger','../../../config/environment','head','value','address','generate','@xcally.com','name','indexOf','length','join','split','html','test','replace','includes','0x1?_0x173a02['slice'](0x0,-0x1)[_0x3b49('0xd')]('\x20'):_0x1ec0c5[_0x3b49('0xa')];}return'Anonymous';}function getLastName(_0x304775){var _0x44f9e1=_[_0x3b49('0x5')](_0x304775[_0x3b49('0x6')]);if(_0x44f9e1&&_0x44f9e1[_0x3b49('0xa')]){var _0x35268d=_0x44f9e1[_0x3b49('0xa')][_0x3b49('0xe')](/\s+/);return _0x35268d[_0x3b49('0xc')]>0x1?_0x35268d['pop']():'';}return'';}function getMails(_0x3bbe92,_0xb0a072){var _0x2e6dec='';for(var _0x1df057=0x0;_0x1df057<_0xb0a072['value'][_0x3b49('0xc')];_0x1df057+=0x1){if(_0xb0a072[_0x3b49('0x6')][_0x1df057]['address']!==_0x3bbe92){if(!_['isEmpty'](_0x2e6dec)){_0x2e6dec+=',';}_0x2e6dec+=_0xb0a072[_0x3b49('0x6')][_0x1df057][_0x3b49('0xa')]||_0xb0a072[_0x3b49('0x6')][_0x1df057]['address']||'';_0x2e6dec+='\x20<';_0x2e6dec+=_0xb0a072[_0x3b49('0x6')][_0x1df057]['address']?_0xb0a072['value'][_0x1df057][_0x3b49('0x7')]:'anonymous'+random['generate'](0x6)+'@xcally.com';_0x2e6dec+='>';}}return _0x2e6dec;}function parseEmail(_0x7fe753,_0x1c8be4,_0x8029c2){if(_0x1c8be4[_0x3b49('0xf')]){var _0x2a70c0=/)<[^<]*)*<\/script>/gi;while(_0x2a70c0[_0x3b49('0x10')](_0x1c8be4['html'])){_0x1c8be4[_0x3b49('0xf')]=_0x1c8be4['html'][_0x3b49('0x11')](_0x2a70c0,'');}if(_0x1c8be4['html'][_0x3b49('0x12')](_0x3b49('0x13'))){var _0x17c13c=[];_0x1c8be4[_0x3b49('0x14')]['forEach'](_0xb843aa=>{_0x17c13c[_0x3b49('0x15')](_0xb843aa[_0x3b49('0x16')]);});var _0x58a714=/]+>/g;var _0x52559a=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x573f34=_0x1c8be4[_0x3b49('0xf')]['replace'](_0x52559a,_0x3b49('0x17'));var _0x2991bd=_0x573f34[_0x3b49('0x11')](_0x58a714,_0x3b49('0x18'));for(let _0x844d4b=0x0;_0x844d4b<_0x17c13c[_0x3b49('0xc')];_0x844d4b++){var _0x3a7164=_0x2991bd[_0x3b49('0x11')]('_IMG',_0x3b49('0x19')+_0x17c13c[_0x844d4b]+_0x3b49('0x1a'));_0x2991bd=_0x3a7164;}_0x1c8be4[_0x3b49('0xf')]=_0x2991bd;}_0x8029c2[_0x3b49('0x1b')]=_0x1c8be4[_0x3b49('0xf')];}else{_0x8029c2[_0x3b49('0x1b')]=_0x1c8be4[_0x3b49('0x1c')];}if(_0x8029c2[_0x3b49('0x1b')]){_0x8029c2['body']=_0x8029c2['body'][_0x3b49('0x11')](/0x0){var _0x2bb7e2=[_0x3b49('0x2d'),_0x3b49('0x2e'),'Precedence:\x20auto_reply'];for(var _0x1a55cb=0x0;_0x1a55cb<_0x1c8be4[_0x3b49('0x2c')][_0x3b49('0xc')];_0x1a55cb++){var _0x559b59=_[_0x3b49('0xb')](_0x2bb7e2,_0x1c8be4['headerLines'][_0x1a55cb][_0x3b49('0x2f')]);if(_0x559b59>=0x0){_0x8029c2[_0x3b49('0x30')]=!![];}}}return _0x8029c2;}exports['parser']=function(_0x5053ba,_0x19eea4,_0x129a9e){var _0x1df54c={'from':getAddress(_0x19eea4['from']),'firstName':getFirstName(_0x19eea4[_0x3b49('0x31')]),'lastName':getLastName(_0x19eea4[_0x3b49('0x31')]),'mapKey':'email','message':{'from':getMails(_0x5053ba[_0x3b49('0x1f')],_0x19eea4['from']),'to':_0x5053ba[_0x3b49('0x1f')],'cc':'','subject':_0x19eea4[_0x3b49('0x32')]||'','messageId':_0x19eea4[_0x3b49('0x33')],'inReplyTo':_0x19eea4[_0x3b49('0x34')],'sentAt':moment(_0x19eea4[_0x3b49('0x35')])[_0x3b49('0x26')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x19eea4[_0x3b49('0xf')]&&!_0x19eea4['textAsHtml']){var _0x4f3a51=_[_0x3b49('0x36')](_0x19eea4['attachments'],{'contentType':_0x3b49('0x37')});if(_0x4f3a51['length']){logger['info'](util[_0x3b49('0x26')](_0x3b49('0x38'),_0x19eea4['messageId']));tnef[_0x3b49('0x39')](_[_0x3b49('0x3a')](_0x4f3a51)[_0x3b49('0x2a')],function(_0xaaecf6,_0x2413ff){if(_0x2413ff){_0x19eea4[_0x3b49('0xf')]=_0x2413ff[_0x3b49('0x3b')]||'

Empty\x20message

';if(_0x2413ff[_0x3b49('0x3c')]){for(var _0x3c5876=0x0;_0x3c5876<_0x2413ff[_0x3b49('0x3c')]['length'];_0x3c5876++){var _0x5851eb=_0x2413ff[_0x3b49('0x3c')][_0x3c5876];_0x1df54c[_0x3b49('0x1d')][_0x3b49('0x14')]['push']({'filename':_0x5851eb[_0x3b49('0x3d')],'content':Buffer[_0x3b49('0x31')](_0x5851eb[_0x3b49('0x3e')])});}}}_0x129a9e(parseEmail(_0x5053ba,_0x19eea4,_0x1df54c));});}else{_0x19eea4[_0x3b49('0xf')]='

Empty\x20message

';_0x129a9e(parseEmail(_0x5053ba,_0x19eea4,_0x1df54c));}}else{_0x129a9e(parseEmail(_0x5053ba,_0x19eea4,_0x1df54c));}};exports[_0x3b49('0x3f')]=function(_0x4facf9,_0x357a89){var _0x8bc146=[_0x3b49('0x40')+(_0x357a89||''),_0x3b49('0x41')+_0x4facf9,'',''];return Buffer[_0x3b49('0x31')](_0x8bc146[_0x3b49('0xd')](''),'utf-8')['toString'](_0x3b49('0x42'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 082a78d..c5f9ee6 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 _0x57e5=['Imap','Smtp','exports','lodash','name','key','SERV','active'];(function(_0x28e8df,_0x31367c){var _0x561dbf=function(_0x2950a7){while(--_0x2950a7){_0x28e8df['push'](_0x28e8df['shift']());}};_0x561dbf(++_0x31367c);}(_0x57e5,0x14b));var _0x557e=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x57e5[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x557e('0x0'));function MailAccount(_0x90651c){this['id']=_0x90651c['id']||0x0;this[_0x557e('0x1')]=_0x90651c[_0x557e('0x1')]||'Service';this[_0x557e('0x2')]=_0x90651c[_0x557e('0x2')]||_0x557e('0x3');this[_0x557e('0x4')]=_0x90651c[_0x557e('0x4')]||![];this[_0x557e('0x5')]=_0x90651c['Imap']||[];this[_0x557e('0x6')]=_0x90651c['Smtp']||[];}module[_0x557e('0x7')]=MailAccount; \ No newline at end of file +var _0x4fba=['Smtp','exports','lodash','name','Service','key','SERV','active','Imap'];(function(_0x13b42f,_0x24ad11){var _0x48339e=function(_0x5026cc){while(--_0x5026cc){_0x13b42f['push'](_0x13b42f['shift']());}};_0x48339e(++_0x24ad11);}(_0x4fba,0x119));var _0xa4fb=function(_0x49364a,_0x425c8a){_0x49364a=_0x49364a-0x0;var _0x5ac082=_0x4fba[_0x49364a];return _0x5ac082;};'use strict';var _=require(_0xa4fb('0x0'));function MailAccount(_0x7897cb){this['id']=_0x7897cb['id']||0x0;this['name']=_0x7897cb[_0xa4fb('0x1')]||_0xa4fb('0x2');this[_0xa4fb('0x3')]=_0x7897cb['key']||_0xa4fb('0x4');this['active']=_0x7897cb[_0xa4fb('0x5')]||![];this[_0xa4fb('0x6')]=_0x7897cb[_0xa4fb('0x6')]||[];this['Smtp']=_0x7897cb[_0xa4fb('0x7')]||[];}module[_0xa4fb('0x8')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index fc72b1c..2a5cf29 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 _0xea76=['../model/mailAccount','mapKeys','mergeFromDatabase','hasOwnProperty','prototype','initMailAccounts','mailAccounts','length','isUndefined','merge','exports','lodash'];(function(_0x411b14,_0x3f9e36){var _0x402736=function(_0x2be12e){while(--_0x2be12e){_0x411b14['push'](_0x411b14['shift']());}};_0x402736(++_0x3f9e36);}(_0xea76,0x6b));var _0x6ea7=function(_0x10f08a,_0x286b40){_0x10f08a=_0x10f08a-0x0;var _0x576c65=_0xea76[_0x10f08a];return _0x576c65;};'use strict';var _=require(_0x6ea7('0x0'));var MailAccount=require(_0x6ea7('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x5441b2,_0x2bcd3a,_0x3e2802){var _0x44bec2=_[_0x6ea7('0x2')](_0x5441b2,function(_0x5ce094,_0x46f79e){return _0x5ce094[_0x3e2802];});for(var _0x47410e in _0x2bcd3a){if(_0x2bcd3a['hasOwnProperty'](_0x47410e)){if(!_0x44bec2[_0x47410e]){delete _0x2bcd3a[_0x47410e];}}}}Realtime['prototype'][_0x6ea7('0x3')]=function(_0x4d1b63,_0x2da58c){for(var _0x28998f in _0x2da58c){if(_0x4d1b63[_0x6ea7('0x4')](_0x28998f)){_0x4d1b63[_0x28998f]=_0x2da58c[_0x28998f];}}};Realtime[_0x6ea7('0x5')][_0x6ea7('0x6')]=function(){var _0x3ef997=this;return function(_0xc7f0d9){if(_0xc7f0d9){freeIsNotKey(_0xc7f0d9,_0x3ef997[_0x6ea7('0x7')],'id');for(var _0x5ccb22=0x0,_0x10a113={},_0x15858c={};_0x5ccb22<_0xc7f0d9[_0x6ea7('0x8')];_0x5ccb22+=0x1){_0x10a113=_0xc7f0d9[_0x5ccb22];if(_[_0x6ea7('0x9')](_0x3ef997['mailAccounts'][_0x10a113['id']])){_0x3ef997[_0x6ea7('0x7')][_0x10a113['id']]=new MailAccount(_0x10a113);}else{_[_0x6ea7('0xa')](_0x3ef997[_0x6ea7('0x7')][_0x10a113['id']],_0x10a113);}}}return _0x3ef997[_0x6ea7('0x7')];};};module[_0x6ea7('0xb')]=Realtime; \ No newline at end of file +var _0x2be9=['isUndefined','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','initMailAccounts','length'];(function(_0x4a563b,_0x36f42d){var _0x2935ef=function(_0x32593f){while(--_0x32593f){_0x4a563b['push'](_0x4a563b['shift']());}};_0x2935ef(++_0x36f42d);}(_0x2be9,0xe2));var _0x92be=function(_0x399d76,_0xdc4493){_0x399d76=_0x399d76-0x0;var _0x3b19a1=_0x2be9[_0x399d76];return _0x3b19a1;};'use strict';var _=require(_0x92be('0x0'));var MailAccount=require(_0x92be('0x1'));var Realtime=function(){this[_0x92be('0x2')]={};};function freeIsNotKey(_0x52b624,_0xf42ca6,_0x16500f){var _0x58e50f=_[_0x92be('0x3')](_0x52b624,function(_0x1a9d55,_0x4f0950){return _0x1a9d55[_0x16500f];});for(var _0x1892fa in _0xf42ca6){if(_0xf42ca6[_0x92be('0x4')](_0x1892fa)){if(!_0x58e50f[_0x1892fa]){delete _0xf42ca6[_0x1892fa];}}}}Realtime[_0x92be('0x5')]['mergeFromDatabase']=function(_0x45fca0,_0x2d1f0c){for(var _0x33c016 in _0x2d1f0c){if(_0x45fca0[_0x92be('0x4')](_0x33c016)){_0x45fca0[_0x33c016]=_0x2d1f0c[_0x33c016];}}};Realtime[_0x92be('0x5')][_0x92be('0x6')]=function(){var _0x567b4e=this;return function(_0x454179){if(_0x454179){freeIsNotKey(_0x454179,_0x567b4e[_0x92be('0x2')],'id');for(var _0x359d65=0x0,_0x48c5e1={},_0x360442={};_0x359d65<_0x454179[_0x92be('0x7')];_0x359d65+=0x1){_0x48c5e1=_0x454179[_0x359d65];if(_[_0x92be('0x8')](_0x567b4e[_0x92be('0x2')][_0x48c5e1['id']])){_0x567b4e['mailAccounts'][_0x48c5e1['id']]=new MailAccount(_0x48c5e1);}else{_['merge'](_0x567b4e[_0x92be('0x2')][_0x48c5e1['id']],_0x48c5e1);}}}return _0x567b4e['mailAccounts'];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index c94bc69..4af5bf1 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 _0xcd2f=['ListId','MailServerIn','Imap','CloudProvider','type','data5','MailServerOut','Smtp','getMailAccount','NotifyMailAccount','GetMailAccount','name','provider','service','email','active','key'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0xcd2f,0xf8));var _0xfcd2=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0xcd2f[_0x278e3c];return _0x3e2d9b;};'use strict';var client=require('../client');exports['getMailAccounts']=function(){return function(){return client['Request'](_0xfcd2('0x0'),{'options':{'attributes':['id',_0xfcd2('0x1'),_0xfcd2('0x2'),_0xfcd2('0x3'),_0xfcd2('0x4'),_0xfcd2('0x5'),_0xfcd2('0x6'),_0xfcd2('0x7'),'TemplateId'],'raw':![],'include':[{'model':_0xfcd2('0x8'),'as':_0xfcd2('0x9'),'include':[{'model':_0xfcd2('0xa'),'attributes':['id',_0xfcd2('0x1'),_0xfcd2('0x3'),_0xfcd2('0xb'),_0xfcd2('0xc')],'as':_0xfcd2('0xa')}]},{'model':_0xfcd2('0xd'),'as':_0xfcd2('0xe'),'include':[{'model':_0xfcd2('0xa'),'attributes':['id','name',_0xfcd2('0x3'),_0xfcd2('0xb'),_0xfcd2('0xc')],'as':_0xfcd2('0xa')}]}]},'log':_0xfcd2('0xf')});};};exports['notify']=function(_0x4fb319,_0x4791e9){return client['Request']('NotifyMailAccount',{'account':{'id':_0x4fb319},'body':_0x4791e9,'log':_0xfcd2('0x10')});}; \ No newline at end of file +var _0xe75a=['key','ListId','TemplateId','MailServerIn','CloudProvider','type','Smtp','getMailAccount','Request','NotifyMailAccount','../client','getMailAccounts','GetMailAccount','name','provider','service','email','active'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xe75a,0x1de));var _0xae75=function(_0x3d8ba1,_0x5ba1fd){_0x3d8ba1=_0x3d8ba1-0x0;var _0x87804e=_0xe75a[_0x3d8ba1];return _0x87804e;};'use strict';var client=require(_0xae75('0x0'));exports[_0xae75('0x1')]=function(){return function(){return client['Request'](_0xae75('0x2'),{'options':{'attributes':['id',_0xae75('0x3'),_0xae75('0x4'),_0xae75('0x5'),_0xae75('0x6'),_0xae75('0x7'),_0xae75('0x8'),_0xae75('0x9'),_0xae75('0xa')],'raw':![],'include':[{'model':_0xae75('0xb'),'as':'Imap','include':[{'model':_0xae75('0xc'),'attributes':['id','name','service',_0xae75('0xd'),'data5'],'as':'CloudProvider'}]},{'model':'MailServerOut','as':_0xae75('0xe'),'include':[{'model':'CloudProvider','attributes':['id','name',_0xae75('0x5'),_0xae75('0xd'),'data5'],'as':_0xae75('0xc')}]}]},'log':_0xae75('0xf')});};};exports['notify']=function(_0x3dbe51,_0x1b56d9){return client[_0xae75('0x10')]('NotifyMailAccount',{'account':{'id':_0x3dbe51},'body':_0x1b56d9,'log':_0xae75('0x11')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 3d914b0..9290fff 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 _0x12d1=['ShowSetting','loginMailFrequency','GetSettings','getSettings','Request'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x12d1,0xdf));var _0x112d=function(_0xa7306,_0x3f8744){_0xa7306=_0xa7306-0x0;var _0x23efa3=_0x12d1[_0xa7306];return _0x23efa3;};'use strict';var client=require('../client');exports[_0x112d('0x0')]=function(){return client[_0x112d('0x1')](_0x112d('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x112d('0x3')]},'log':_0x112d('0x4')});}; \ No newline at end of file +var _0x2b93=['ShowSetting','loginMailFrequency','GetSettings','../client','Request'];(function(_0x11304a,_0x3c7648){var _0x57b42a=function(_0x42a8da){while(--_0x42a8da){_0x11304a['push'](_0x11304a['shift']());}};_0x57b42a(++_0x3c7648);}(_0x2b93,0x1bb));var _0x32b9=function(_0x4c6cf0,_0x826f70){_0x4c6cf0=_0x4c6cf0-0x0;var _0x108145=_0x2b93[_0x4c6cf0];return _0x108145;};'use strict';var client=require(_0x32b9('0x0'));exports['getSettings']=function(){return client[_0x32b9('0x1')](_0x32b9('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x32b9('0x3')]},'log':_0x32b9('0x4')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 3615485..54c1fd2 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'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(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file diff --git a/server/services/express/index.js b/server/services/express/index.js index 4301337..bfbbbd6 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 _0x525a=['localhost','adapter','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','listening','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','sticky-session','ioredis','../../config/environment','createServer','timeout','port','socket.io','websocket','polling','redis','defaults'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x525a,0x18a));var _0xa525=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x525a[_0x1caf6a];return _0x1bf493;};'use strict';var _=require(_0xa525('0x0'));var http=require(_0xa525('0x1'));var express=require(_0xa525('0x2'));var sticky=require(_0xa525('0x3'));var Redis=require(_0xa525('0x4'));var config=require(_0xa525('0x5'));var app=express();var server=http[_0xa525('0x6')](app);server[_0xa525('0x7')]=0xdbba0;if(sticky['listen'](server,config[_0xa525('0x8')])){var socketio=require(_0xa525('0x9'))(server,{'transports':[_0xa525('0xa'),_0xa525('0xb')]});config[_0xa525('0xc')]=_[_0xa525('0xd')](config[_0xa525('0xc')],{'host':_0xa525('0xe'),'port':0x18eb});socketio[_0xa525('0xf')](require('socket.io-redis')({'pubClient':new Redis(config[_0xa525('0xc')]),'subClient':new Redis(config[_0xa525('0xc')])}));require(_0xa525('0x10'))[_0xa525('0x11')]();require(_0xa525('0x12'))[_0xa525('0x11')](socketio);require(_0xa525('0x13'))[_0xa525('0x11')](app);require(_0xa525('0x14'))[_0xa525('0x11')](app);}else{server['once'](_0xa525('0x15'),function(){console['log'](_0xa525('0x16'),config[_0xa525('0x8')]);});}exports=module[_0xa525('0x17')]=app; \ No newline at end of file +var _0xac7e=['websocket','defaults','localhost','adapter','socket.io-redis','redis','../../config/triggers','default','listening','Express\x20server\x20listening\x20on\x20port\x20%d!','lodash','http','express','ioredis','../../config/environment','listen','port','socket.io'];(function(_0x4f5194,_0xc8ff7){var _0x258b44=function(_0x19d11e){while(--_0x19d11e){_0x4f5194['push'](_0x4f5194['shift']());}};_0x258b44(++_0xc8ff7);}(_0xac7e,0x13c));var _0xeac7=function(_0x1c862b,_0x2c1bd0){_0x1c862b=_0x1c862b-0x0;var _0x213b59=_0xac7e[_0x1c862b];return _0x213b59;};'use strict';var _=require(_0xeac7('0x0'));var http=require(_0xeac7('0x1'));var express=require(_0xeac7('0x2'));var sticky=require('sticky-session');var Redis=require(_0xeac7('0x3'));var config=require(_0xeac7('0x4'));var app=express();var server=http['createServer'](app);server['timeout']=0xdbba0;if(sticky[_0xeac7('0x5')](server,config[_0xeac7('0x6')])){var socketio=require(_0xeac7('0x7'))(server,{'transports':[_0xeac7('0x8'),'polling']});config['redis']=_[_0xeac7('0x9')](config['redis'],{'host':_0xeac7('0xa'),'port':0x18eb});socketio[_0xeac7('0xb')](require(_0xeac7('0xc'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0xeac7('0xd')])}));require(_0xeac7('0xe'))['default']();require('../../config/socketio')[_0xeac7('0xf')](socketio);require('../../config/express')['default'](app);require('../../routes')[_0xeac7('0xf')](app);}else{server['once'](_0xeac7('0x10'),function(){console['log'](_0xeac7('0x11'),config[_0xeac7('0x6')]);});}exports=module['exports']=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index f22c20d..79daae7 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 _0x8342=['exports','bluebird','../../config/logger','routing','client','http','Request','then','debug','rpc','error','message','result','catch'];(function(_0x7aa0b0,_0x260e94){var _0x44f513=function(_0x2aefc4){while(--_0x2aefc4){_0x7aa0b0['push'](_0x7aa0b0['shift']());}};_0x44f513(++_0x260e94);}(_0x8342,0x8d));var _0x2834=function(_0x1785e8,_0x492aac){_0x1785e8=_0x1785e8-0x0;var _0x5e6021=_0x8342[_0x1785e8];return _0x5e6021;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x2834('0x0'));var logger=require(_0x2834('0x1'))(_0x2834('0x2'));var client=jayson[_0x2834('0x3')][_0x2834('0x4')]({'port':0x2329});client[_0x2834('0x5')]=function(_0xe8245,_0x505199){return new BPromise(function(_0x477fb1,_0x54343b){return client['request'](_0xe8245,_0x505199)[_0x2834('0x6')](function(_0x5c5725){logger[_0x2834('0x7')](_0x2834('0x8'),'routing',_0xe8245,_0x505199,_0x5c5725);if(_0x5c5725[_0x2834('0x9')]){logger[_0x2834('0x9')](_0x2834('0x8'),_0x2834('0x2'),_0xe8245,_0x5c5725[_0x2834('0x9')][_0x2834('0xa')],_0x505199);return _0x54343b(_0x5c5725['error'][_0x2834('0xa')]);}else{return _0x477fb1(_0x5c5725[_0x2834('0xb')]);}})[_0x2834('0xc')](function(_0x597be1){logger['error'](_0x2834('0x8'),_0x2834('0x2'),_0xe8245,_0x597be1,_0x505199);return _0x54343b(_0x597be1);});});};module[_0x2834('0xd')]=client; \ No newline at end of file +var _0xe056=['Request','request','then','rpc','error','exports','jayson/promise','bluebird','../../config/logger','routing','client'];(function(_0x20f71f,_0x400188){var _0x32f58f=function(_0x49cdc9){while(--_0x49cdc9){_0x20f71f['push'](_0x20f71f['shift']());}};_0x32f58f(++_0x400188);}(_0xe056,0x69));var _0x6e05=function(_0xc0d9bc,_0x2bd6be){_0xc0d9bc=_0xc0d9bc-0x0;var _0x32ff73=_0xe056[_0xc0d9bc];return _0x32ff73;};'use strict';var jayson=require(_0x6e05('0x0'));var BPromise=require(_0x6e05('0x1'));var logger=require(_0x6e05('0x2'))(_0x6e05('0x3'));var client=jayson[_0x6e05('0x4')]['http']({'port':0x2329});client[_0x6e05('0x5')]=function(_0x2c9780,_0x171755){return new BPromise(function(_0x39c405,_0x2fc8d9){return client[_0x6e05('0x6')](_0x2c9780,_0x171755)[_0x6e05('0x7')](function(_0x5cc05c){logger['debug'](_0x6e05('0x8'),_0x6e05('0x3'),_0x2c9780,_0x171755,_0x5cc05c);if(_0x5cc05c[_0x6e05('0x9')]){logger[_0x6e05('0x9')](_0x6e05('0x8'),_0x6e05('0x3'),_0x2c9780,_0x5cc05c[_0x6e05('0x9')]['message'],_0x171755);return _0x2fc8d9(_0x5cc05c['error']['message']);}else{return _0x39c405(_0x5cc05c['result']);}})['catch'](function(_0x51610c){logger[_0x6e05('0x9')]('rpc',_0x6e05('0x3'),_0x2c9780,_0x51610c,_0x171755);return _0x2fc8d9(_0x51610c);});});};module[_0x6e05('0xa')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index a8b5e1a..fae9909 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 _0x5a24=['getAgents','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','getChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getWhatsappQueues','initWhatsappQueues','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/chatQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve'];(function(_0x17957c,_0x2314ea){var _0x164ef9=function(_0x38f7b7){while(--_0x38f7b7){_0x17957c['push'](_0x17957c['shift']());}};_0x164ef9(++_0x2314ea);}(_0x5a24,0x109));var _0x45a2=function(_0x44c694,_0x2358bf){_0x44c694=_0x44c694-0x0;var _0x404954=_0x5a24[_0x44c694];return _0x404954;};'use strict';var BPromise=require(_0x45a2('0x0'));var server=require(_0x45a2('0x1'));var Realtime=require(_0x45a2('0x2'));var user=require(_0x45a2('0x3'));var interval=require(_0x45a2('0x4'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0x45a2('0x5'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0x45a2('0x6'));var faxQueue=require(_0x45a2('0x7'));var whatsappQueue=require(_0x45a2('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x45a2('0x9')]()['then'](user[_0x45a2('0xa')]())[_0x45a2('0xb')](realtime[_0x45a2('0xc')]())[_0x45a2('0xb')](interval[_0x45a2('0xd')]())[_0x45a2('0xb')](realtime[_0x45a2('0xe')]())['then'](openchannelQueue[_0x45a2('0xf')]())[_0x45a2('0xb')](realtime['initOpenchannelQueues']())[_0x45a2('0xb')](chatQueue[_0x45a2('0x10')]())[_0x45a2('0xb')](realtime['initChatQueues']())[_0x45a2('0xb')](smsQueue[_0x45a2('0x11')]())[_0x45a2('0xb')](realtime[_0x45a2('0x12')]())[_0x45a2('0xb')](mailQueue[_0x45a2('0x13')]())[_0x45a2('0xb')](realtime[_0x45a2('0x14')]())[_0x45a2('0xb')](faxQueue['getFaxQueues']())[_0x45a2('0xb')](realtime['initFaxQueues']())['then'](whatsappQueue[_0x45a2('0x15')]())[_0x45a2('0xb')](realtime[_0x45a2('0x16')]())[_0x45a2('0xb')](function(){return realtime;});}function main(){return server['listen'](realtime)[_0x45a2('0xb')](function(_0x1d589e){return initRealtime();})[_0x45a2('0xb')](function(_0x1a5e71){return setInterval(initRealtime,0x1388);})[_0x45a2('0x17')](function(_0x40a10c){console[_0x45a2('0x18')](_0x40a10c);});}main(); \ No newline at end of file +var _0x5015=['./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/whatsappQueue','resolve','then','getAgents','getIntervals','initIntervals','initOpenchannelQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','initWhatsappQueues','bluebird','./server','./rpc/user','./rpc/interval','./rpc/openchannelQueue'];(function(_0x4e7196,_0x5cd0ab){var _0x149ab2=function(_0x2a039e){while(--_0x2a039e){_0x4e7196['push'](_0x4e7196['shift']());}};_0x149ab2(++_0x5cd0ab);}(_0x5015,0x154));var _0x5501=function(_0x6e4a9e,_0x506af2){_0x6e4a9e=_0x6e4a9e-0x0;var _0xbd0fb1=_0x5015[_0x6e4a9e];return _0xbd0fb1;};'use strict';var BPromise=require(_0x5501('0x0'));var server=require(_0x5501('0x1'));var Realtime=require('./realtime');var user=require(_0x5501('0x2'));var interval=require(_0x5501('0x3'));var openchannelQueue=require(_0x5501('0x4'));var chatQueue=require(_0x5501('0x5'));var smsQueue=require(_0x5501('0x6'));var mailQueue=require(_0x5501('0x7'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0x5501('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x5501('0x9')]()[_0x5501('0xa')](user[_0x5501('0xb')]())[_0x5501('0xa')](realtime['initAgents']())[_0x5501('0xa')](interval[_0x5501('0xc')]())[_0x5501('0xa')](realtime[_0x5501('0xd')]())[_0x5501('0xa')](openchannelQueue['getOpenchannelQueues']())[_0x5501('0xa')](realtime[_0x5501('0xe')]())[_0x5501('0xa')](chatQueue['getChatQueues']())[_0x5501('0xa')](realtime[_0x5501('0xf')]())[_0x5501('0xa')](smsQueue[_0x5501('0x10')]())[_0x5501('0xa')](realtime[_0x5501('0x11')]())[_0x5501('0xa')](mailQueue[_0x5501('0x12')]())['then'](realtime[_0x5501('0x13')]())[_0x5501('0xa')](faxQueue[_0x5501('0x14')]())[_0x5501('0xa')](realtime[_0x5501('0x15')]())[_0x5501('0xa')](whatsappQueue['getWhatsappQueues']())[_0x5501('0xa')](realtime[_0x5501('0x16')]())[_0x5501('0xa')](function(){return realtime;});}function main(){return server['listen'](realtime)[_0x5501('0xa')](function(_0x190e56){return initRealtime();})[_0x5501('0xa')](function(_0x411bee){return setInterval(initRealtime,0x1388);})['catch'](function(_0xfb4cf0){console['log'](_0xfb4cf0);});}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 9063839..da3c756 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(_0x14735c,_0x56c131){var _0x44e4f4=function(_0x5d565f){while(--_0x5d565f){_0x14735c['push'](_0x14735c['shift']());}};_0x44e4f4(++_0x56c131);}(_0x326f,0xd1));var _0xf326=function(_0x4f7ee3,_0x38e927){_0x4f7ee3=_0x4f7ee3-0x0;var _0x3e3f99=_0x326f[_0x4f7ee3];return _0x3e3f99;};'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 _0x814b=['init','parse','map','object','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','prototype','rules','isArray','concat','isObject','push','sync','filter','activeRules','orderBy','asc','execute','result','clone','name','ruleRef','call','next','isEqual','nextTick','restart','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','consequence','fromJSON'];(function(_0x920ae3,_0x4652ef){var _0x19ea79=function(_0x4ce49f){while(--_0x4ce49f){_0x920ae3['push'](_0x920ae3['shift']());}};_0x19ea79(++_0x4652ef);}(_0x814b,0x1a2));var _0xb814=function(_0x48c2ae,_0x4cea90){_0x48c2ae=_0x48c2ae-0x0;var _0x8f7531=_0x814b[_0x48c2ae];return _0x8f7531;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var EventEmitter=require(_0xb814('0x2'))[_0xb814('0x3')];function RuleEngine(_0xfbb64b,_0x477725){this['init']();if(!_[_0xb814('0x4')](_0xfbb64b)){this[_0xb814('0x5')](_0xfbb64b);}if(_0x477725){this[_0xb814('0x6')]=_0x477725[_0xb814('0x6')];}return this;}util[_0xb814('0x7')](RuleEngine,EventEmitter);RuleEngine[_0xb814('0x8')]['init']=function(_0x3b0829){this[_0xb814('0x9')]=[];this['activeRules']=[];};RuleEngine[_0xb814('0x8')][_0xb814('0x5')]=function(_0x186d5a){if(Array[_0xb814('0xa')](_0x186d5a)){this[_0xb814('0x9')]=this[_0xb814('0x9')][_0xb814('0xb')](_0x186d5a);}else if(_0x186d5a!==null&&_[_0xb814('0xc')](_0x186d5a)){this[_0xb814('0x9')][_0xb814('0xd')](_0x186d5a);}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0xe')]=function(){this['activeRules']=this[_0xb814('0x9')][_0xb814('0xf')](function(_0x35b10d){if(_[_0xb814('0x4')](_0x35b10d['on'])){_0x35b10d['on']=!![];}if(_0x35b10d['on']===!![]){return _0x35b10d;}});this[_0xb814('0x10')]=_[_0xb814('0x11')](this[_0xb814('0x10')],['p'],[_0xb814('0x12')]);};RuleEngine[_0xb814('0x8')][_0xb814('0x13')]=function(_0x3f4881,_0x44fb96){var _0x17f5bd=![];_0x3f4881[_0xb814('0x14')]=!![];var _0x303aca=_[_0xb814('0x15')](_0x3f4881);var _0x45e0d0=_[_0xb814('0x15')](_0x3f4881);var _0x125ce2=this[_0xb814('0x10')];var _0x7a21ef=[];var _0x48c9df=this[_0xb814('0x6')];(function FnRuleLoop(_0x55ba16){var _0x270598={'rules':function(){return _0x125ce2;},'rule':function(){return _0x125ce2[_0x55ba16];},'when':function(_0xfac75b){if(_0xfac75b){var _0x4c3007=_0x125ce2[_0x55ba16]['consequence'];_0x4c3007['ruleRef']=_0x125ce2[_0x55ba16]['id']||_0x125ce2[_0x55ba16][_0xb814('0x16')]||'index_'+_0x55ba16;process['nextTick'](function(){_0x7a21ef[_0xb814('0xd')](_0x4c3007[_0xb814('0x17')]);_0x4c3007[_0xb814('0x18')](_0x303aca,_0x270598);});}else{process['nextTick'](function(){_0x270598[_0xb814('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x17f5bd=!![];return FnRuleLoop(0x0);},'next':function(_0x531032){if(!_0x48c9df&&!_[_0xb814('0x1a')](_0x45e0d0,_0x303aca)){_0x45e0d0=_[_0xb814('0x15')](_0x303aca);process[_0xb814('0x1b')](function(){_0x270598[_0xb814('0x1c')]();});}else{process[_0xb814('0x1b')](function(){if(_[_0xb814('0x4')](_0x531032)){return FnRuleLoop(_0x55ba16+0x1);}else{return FnRuleLoop(_0x531032);}});}}};if(_0x55ba16<_0x125ce2[_0xb814('0x1d')]&&_0x17f5bd===![]){var _0x594470=_0x125ce2[_0x55ba16][_0xb814('0x1e')];_0x594470['call'](_0x303aca,_0x270598);}else{process[_0xb814('0x1b')](function(){_0x303aca[_0xb814('0x1f')]=_0x7a21ef;return _0x44fb96?_0x44fb96(_0x303aca):_[_0xb814('0x20')]();});}}(0x0));};RuleEngine[_0xb814('0x8')][_0xb814('0x21')]=function(_0xb9e57d){if(_[_0xb814('0x4')](_0xb9e57d)){return this['rules'];}else{var _0x392222=_[_0xb814('0x22')](_0xb9e57d);return _[_0xb814('0xf')](this[_0xb814('0x9')],_0x392222);}};RuleEngine[_0xb814('0x8')][_0xb814('0x23')]=function(_0x3f0150,_0x1e4e89){var _0x5a6291=_0x3f0150==='on'||_0x3f0150==='ON'?!![]:![];var _0x271aa8=this[_0xb814('0x21')](_0x1e4e89);for(var _0x52ed64=0x0,_0x9008b2=_0x271aa8[_0xb814('0x1d')];_0x52ed64<_0x9008b2;_0x52ed64+=0x1){_0x271aa8[_0x52ed64]['on']=_0x5a6291;}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0x24')]=function(_0x2051d0,_0x58c3ca){_0x2051d0=parseInt(_0x2051d0,0xa);var _0x338a28=this['findRules'](_0x58c3ca);for(var _0x6efe9a=0x0,_0x5f3e9b=_0x338a28['length'];_0x6efe9a<_0x5f3e9b;_0x6efe9a+=0x1){_0x338a28[_0x6efe9a][_0xb814('0x25')]=_0x2051d0;}this['sync']();};RuleEngine[_0xb814('0x8')][_0xb814('0x26')]=function(){var _0x2b91bd=this['rules'];if(_0x2b91bd instanceof Array){_0x2b91bd=_0x2b91bd['map'](function(_0x26d3a9){_0x26d3a9[_0xb814('0x1e')]=_0x26d3a9['condition'][_0xb814('0x27')]();_0x26d3a9[_0xb814('0x28')]=_0x26d3a9[_0xb814('0x28')][_0xb814('0x27')]();return _0x26d3a9;});}else if(!_[_0xb814('0x4')](_0x2b91bd)){_0x2b91bd[_0xb814('0x1e')]=_0x2b91bd[_0xb814('0x1e')]['toString']();_0x2b91bd[_0xb814('0x28')]=_0x2b91bd[_0xb814('0x28')][_0xb814('0x27')]();}return _0x2b91bd;};RuleEngine[_0xb814('0x8')][_0xb814('0x29')]=function(_0x4ff31a){this[_0xb814('0x2a')]();if(_['isString'](_0x4ff31a)){_0x4ff31a=JSON[_0xb814('0x2b')](_0x4ff31a);}if(_0x4ff31a instanceof Array){_0x4ff31a=_0x4ff31a[_0xb814('0x2c')](function(_0xe0f509){_0xe0f509['condition']=eval('('+_0xe0f509[_0xb814('0x1e')]+')');_0xe0f509[_0xb814('0x28')]=eval('('+_0xe0f509['consequence']+')');return _0xe0f509;});}else if(_0x4ff31a!==null&&typeof _0x4ff31a==_0xb814('0x2d')){_0x4ff31a[_0xb814('0x1e')]=eval('('+_0x4ff31a[_0xb814('0x1e')]+')');_0x4ff31a[_0xb814('0x28')]=eval('('+_0x4ff31a[_0xb814('0x28')]+')');}this[_0xb814('0x5')](_0x4ff31a);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index eaeece9..b6f29bd 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 _0x8368=['client','http','request','then','result','catch','sendMailMessage','bluebird','jayson/promise'];(function(_0x3d6f7a,_0x3da829){var _0x8ac6e7=function(_0x47d1c4){while(--_0x47d1c4){_0x3d6f7a['push'](_0x3d6f7a['shift']());}};_0x8ac6e7(++_0x3da829);}(_0x8368,0x154));var _0x8836=function(_0x124d5d,_0x19a1ad){_0x124d5d=_0x124d5d-0x0;var _0x37359a=_0x8368[_0x124d5d];return _0x37359a;};'use strict';var BPromise=require(_0x8836('0x0'));var jayson=require(_0x8836('0x1'));var client=jayson[_0x8836('0x2')][_0x8836('0x3')]({'port':0x232b});function request(_0x57cedd,_0x366164){return new BPromise(function(_0x51a546,_0x4b72d4){return client[_0x8836('0x4')](_0x57cedd,_0x366164)[_0x8836('0x5')](function(_0x4659c2){if(_0x4659c2['error']){return _0x4b72d4(_0x4659c2['error']['message']);}else{return _0x51a546(_0x4659c2[_0x8836('0x6')]);}})[_0x8836('0x7')](function(_0x17100c){return _0x4b72d4(_0x17100c);});});}exports[_0x8836('0x8')]=function(_0x2fc6e0,_0x1514b1){return request('SendMail',{'account':_0x2fc6e0,'message':_0x1514b1});}; \ No newline at end of file +var _0xbcac=['bluebird','jayson/promise','http','request','then','error','catch','sendMailMessage'];(function(_0x1de859,_0x27283a){var _0x2dd2da=function(_0x265a55){while(--_0x265a55){_0x1de859['push'](_0x1de859['shift']());}};_0x2dd2da(++_0x27283a);}(_0xbcac,0x130));var _0xcbca=function(_0x39b8be,_0x10d98c){_0x39b8be=_0x39b8be-0x0;var _0x12d8b2=_0xbcac[_0x39b8be];return _0x12d8b2;};'use strict';var BPromise=require(_0xcbca('0x0'));var jayson=require(_0xcbca('0x1'));var client=jayson['client'][_0xcbca('0x2')]({'port':0x232b});function request(_0x51eb3b,_0x1054dc){return new BPromise(function(_0x16a838,_0x494aa9){return client[_0xcbca('0x3')](_0x51eb3b,_0x1054dc)[_0xcbca('0x4')](function(_0x38ef1a){if(_0x38ef1a[_0xcbca('0x5')]){return _0x494aa9(_0x38ef1a[_0xcbca('0x5')]['message']);}else{return _0x16a838(_0x38ef1a['result']);}})[_0xcbca('0x6')](function(_0x2f3f8e){return _0x494aa9(_0x2f3f8e);});});}exports[_0xcbca('0x7')]=function(_0x394618,_0xca8729){return request('SendMail',{'account':_0x394618,'message':_0xca8729});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index bd4811a..29ea171 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 _0x3d04=['chatCapacity','chatCurrentCapacity','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','working','mail','chat','fax','sms','whatsapp','length','Status','StatusTime','toNumber','format','online','faxPause','mailStatus','faxStatusTime','smsStatusTime','stringify','emit','omit','exports','lodash','md5','moment','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','voicePause','chatPause','mailPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime'];(function(_0x4fbed1,_0x17f025){var _0x3c4545=function(_0x3430be){while(--_0x3430be){_0x4fbed1['push'](_0x4fbed1['shift']());}};_0x3c4545(++_0x17f025);}(_0x3d04,0xbe));var _0x43d0=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x3d04[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x43d0('0x0'));var md5=require(_0x43d0('0x1'));var moment=require(_0x43d0('0x2'));var Redis=require(_0x43d0('0x3'));var config=require(_0x43d0('0x4'));config[_0x43d0('0x5')]=_[_0x43d0('0x6')](config[_0x43d0('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x43d0('0x7'))(new Redis(config[_0x43d0('0x5')]));function Agent(_0x746f5e){this['id']=_0x746f5e['id']||0x0;this[_0x43d0('0x8')]=_0x746f5e['name']||'';this['online']=_0x746f5e['online']||!![];this['voicePause']=_0x746f5e[_0x43d0('0x9')]||![];this[_0x43d0('0xa')]=_0x746f5e[_0x43d0('0xa')]||![];this[_0x43d0('0xb')]=_0x746f5e[_0x43d0('0xb')]||![];this['faxPause']=_0x746f5e['faxPause']||![];this[_0x43d0('0xc')]=_0x746f5e['smsPause']||![];this['openchannelPause']=_0x746f5e[_0x43d0('0xd')]||![];this[_0x43d0('0xe')]=_0x43d0('0xf');this[_0x43d0('0x10')]=0x0;this['chatCapacity']=_0x746f5e[_0x43d0('0x11')]||0x0;this[_0x43d0('0x12')]=0x0;this['mailStatus']=_0x43d0('0xf');this[_0x43d0('0x13')]=0x0;this[_0x43d0('0x14')]=_0x746f5e['mailCapacity']||0x0;this[_0x43d0('0x15')]=0x0;this[_0x43d0('0x16')]=_0x43d0('0xf');this['faxStatusTime']=0x0;this[_0x43d0('0x17')]=_0x746f5e[_0x43d0('0x17')]||0x0;this[_0x43d0('0x18')]=0x0;this[_0x43d0('0x19')]=_0x43d0('0xf');this['smsStatusTime']=0x0;this['smsCapacity']=_0x746f5e[_0x43d0('0x1a')]||0x0;this[_0x43d0('0x1b')]=0x0;this[_0x43d0('0x1c')]='unknown';this[_0x43d0('0x1d')]=0x0;this['whatsappCapacity']=_0x746f5e[_0x43d0('0x1e')]||0x0;this[_0x43d0('0x1f')]=0x0;this[_0x43d0('0x20')]='unknown';this[_0x43d0('0x21')]=0x0;this[_0x43d0('0x22')]=_0x746f5e['openchannelCapacity']||0x0;this[_0x43d0('0x23')]=0x0;this[_0x43d0('0x24')]=![];this[_0x43d0('0x25')]=undefined;this[_0x43d0('0x1')]='';this[_0x43d0('0x26')]={};this[_0x43d0('0x27')]={};this[_0x43d0('0x28')]={};this[_0x43d0('0x29')]={};this[_0x43d0('0x2a')]={};this[_0x43d0('0x2b')]={};this[_0x43d0('0x2c')]();}Agent[_0x43d0('0x2d')][_0x43d0('0x2e')]=function(_0xbc72e6){if(this[_0xbc72e6+_0x43d0('0x2f')]>0x0){if(this[_0xbc72e6+'Capacity']>0x0&&this[_0xbc72e6+_0x43d0('0x2f')]>=this[_0xbc72e6+_0x43d0('0x30')]){return'maxcapacity';}else{return _0x43d0('0x31');}}else{return'idle';}};Agent[_0x43d0('0x2d')][_0x43d0('0x2c')]=function(){var _0x5dd310=[_0x43d0('0x32'),_0x43d0('0x33'),'openchannel',_0x43d0('0x34'),_0x43d0('0x35'),_0x43d0('0x36')];for(var _0x5f16ac=0x0;_0x5f16ac<_0x5dd310[_0x43d0('0x37')];_0x5f16ac+=0x1){var _0x38e89e=this[_0x43d0('0x2e')](_0x5dd310[_0x5f16ac]);if(this[_0x5dd310[_0x5f16ac]+_0x43d0('0x38')]!==_0x38e89e){this[_0x5dd310[_0x5f16ac]+_0x43d0('0x39')]=_[_0x43d0('0x3a')](moment()[_0x43d0('0x3b')]('x'));}this[_0x5dd310[_0x5f16ac]+'Status']=_0x38e89e;}var _0x2b0784={'id':this['id'],'name':this[_0x43d0('0x8')],'online':this[_0x43d0('0x3c')],'voicePause':this['voicePause'],'chatPause':this['chatPause'],'mailPause':this['mailPause'],'smsPause':this[_0x43d0('0xc')],'faxPause':this[_0x43d0('0x3d')],'openchannelPause':this[_0x43d0('0xd')],'chatStatus':this[_0x43d0('0xe')],'chatStatusTime':this[_0x43d0('0x10')],'chatCapacity':this[_0x43d0('0x11')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x43d0('0x3e')],'mailStatusTime':this[_0x43d0('0x13')],'mailCapacity':this[_0x43d0('0x14')],'mailCurrentCapacity':this[_0x43d0('0x15')],'faxStatus':this[_0x43d0('0x16')],'faxStatusTime':this[_0x43d0('0x3f')],'faxCapacity':this[_0x43d0('0x17')],'faxCurrentCapacity':this[_0x43d0('0x18')],'smsStatus':this[_0x43d0('0x19')],'smsStatusTime':this[_0x43d0('0x40')],'smsCapacity':this[_0x43d0('0x1a')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0x43d0('0x1c')],'whatsappStatusTime':this[_0x43d0('0x1d')],'whatsappCapacity':this[_0x43d0('0x1e')],'whatsappCurrentCapacity':this[_0x43d0('0x1f')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x43d0('0x21')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0x43d0('0x23')],'busy':this[_0x43d0('0x24')],'busyQueue':this['busyQueue'],'chatWaitingInteractions':this[_0x43d0('0x26')],'faxWaitingInteractions':this[_0x43d0('0x27')],'mailWaitingInteractions':this[_0x43d0('0x28')],'openchannelWaitingInteractions':this[_0x43d0('0x29')],'smsWaitingInteractions':this[_0x43d0('0x2a')],'whatsappWaitingInteractions':this[_0x43d0('0x2b')]};var _0x35a375=md5(JSON[_0x43d0('0x41')](_0x2b0784));if(this[_0x43d0('0x1')]!==_0x35a375){this[_0x43d0('0x1')]=_0x35a375;io[_0x43d0('0x42')]('user:routing:update',_[_0x43d0('0x43')](_0x2b0784,[_0x43d0('0x3c')]));}};module[_0x43d0('0x44')]=Agent; \ No newline at end of file +var _0x6343=['chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','smsStatus','smsStatusTime','smsCapacity','whatsappStatus','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelCapacity','busy','md5','chatWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','updateRealtime','prototype','CurrentCapacity','Capacity','working','idle','mail','chat','openchannel','fax','whatsapp','getChannelStatus','StatusTime','toNumber','smsPause','chatStatus','faxCurrentCapacity','smsCurrentCapacity','whatsappStatusTime','openchannelStatusTime','openchannelCurrentCapacity','busyQueue','faxWaitingInteractions','whatsappWaitingInteractions','emit','user:routing:update','exports','moment','ioredis','localhost','socket.io-emitter','name','online','chatPause','mailPause','faxPause','openchannelPause','unknown','chatStatusTime'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6343,0x168));var _0x3634=function(_0x310328,_0x4ab2f3){_0x310328=_0x310328-0x0;var _0xc549b8=_0x6343[_0x310328];return _0xc549b8;};'use strict';var _=require('lodash');var md5=require('md5');var moment=require(_0x3634('0x0'));var Redis=require(_0x3634('0x1'));var config=require('../../../config/environment');config['redis']=_['defaults'](config['redis'],{'host':_0x3634('0x2'),'port':0x18eb});var io=require(_0x3634('0x3'))(new Redis(config['redis']));function Agent(_0x247964){this['id']=_0x247964['id']||0x0;this[_0x3634('0x4')]=_0x247964['name']||'';this[_0x3634('0x5')]=_0x247964[_0x3634('0x5')]||!![];this['voicePause']=_0x247964['voicePause']||![];this[_0x3634('0x6')]=_0x247964[_0x3634('0x6')]||![];this[_0x3634('0x7')]=_0x247964[_0x3634('0x7')]||![];this[_0x3634('0x8')]=_0x247964[_0x3634('0x8')]||![];this['smsPause']=_0x247964['smsPause']||![];this[_0x3634('0x9')]=_0x247964[_0x3634('0x9')]||![];this['chatStatus']=_0x3634('0xa');this[_0x3634('0xb')]=0x0;this[_0x3634('0xc')]=_0x247964[_0x3634('0xc')]||0x0;this[_0x3634('0xd')]=0x0;this[_0x3634('0xe')]=_0x3634('0xa');this[_0x3634('0xf')]=0x0;this[_0x3634('0x10')]=_0x247964[_0x3634('0x10')]||0x0;this[_0x3634('0x11')]=0x0;this[_0x3634('0x12')]=_0x3634('0xa');this[_0x3634('0x13')]=0x0;this['faxCapacity']=_0x247964[_0x3634('0x14')]||0x0;this['faxCurrentCapacity']=0x0;this[_0x3634('0x15')]=_0x3634('0xa');this[_0x3634('0x16')]=0x0;this[_0x3634('0x17')]=_0x247964[_0x3634('0x17')]||0x0;this['smsCurrentCapacity']=0x0;this[_0x3634('0x18')]='unknown';this['whatsappStatusTime']=0x0;this[_0x3634('0x19')]=_0x247964['whatsappCapacity']||0x0;this[_0x3634('0x1a')]=0x0;this[_0x3634('0x1b')]=_0x3634('0xa');this['openchannelStatusTime']=0x0;this[_0x3634('0x1c')]=_0x247964[_0x3634('0x1c')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0x3634('0x1d')]=![];this['busyQueue']=undefined;this[_0x3634('0x1e')]='';this[_0x3634('0x1f')]={};this['faxWaitingInteractions']={};this[_0x3634('0x20')]={};this[_0x3634('0x21')]={};this[_0x3634('0x22')]={};this['whatsappWaitingInteractions']={};this[_0x3634('0x23')]();}Agent[_0x3634('0x24')]['getChannelStatus']=function(_0x3936ee){if(this[_0x3936ee+'CurrentCapacity']>0x0){if(this[_0x3936ee+'Capacity']>0x0&&this[_0x3936ee+_0x3634('0x25')]>=this[_0x3936ee+_0x3634('0x26')]){return'maxcapacity';}else{return _0x3634('0x27');}}else{return _0x3634('0x28');}};Agent[_0x3634('0x24')][_0x3634('0x23')]=function(){var _0x363ca2=[_0x3634('0x29'),_0x3634('0x2a'),_0x3634('0x2b'),_0x3634('0x2c'),'sms',_0x3634('0x2d')];for(var _0x552cc3=0x0;_0x552cc3<_0x363ca2['length'];_0x552cc3+=0x1){var _0x59f481=this[_0x3634('0x2e')](_0x363ca2[_0x552cc3]);if(this[_0x363ca2[_0x552cc3]+'Status']!==_0x59f481){this[_0x363ca2[_0x552cc3]+_0x3634('0x2f')]=_[_0x3634('0x30')](moment()['format']('x'));}this[_0x363ca2[_0x552cc3]+'Status']=_0x59f481;}var _0x282f73={'id':this['id'],'name':this['name'],'online':this[_0x3634('0x5')],'voicePause':this['voicePause'],'chatPause':this[_0x3634('0x6')],'mailPause':this[_0x3634('0x7')],'smsPause':this[_0x3634('0x31')],'faxPause':this[_0x3634('0x8')],'openchannelPause':this[_0x3634('0x9')],'chatStatus':this[_0x3634('0x32')],'chatStatusTime':this[_0x3634('0xb')],'chatCapacity':this[_0x3634('0xc')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this['mailStatus'],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0x3634('0x10')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x3634('0x12')],'faxStatusTime':this[_0x3634('0x13')],'faxCapacity':this[_0x3634('0x14')],'faxCurrentCapacity':this[_0x3634('0x33')],'smsStatus':this[_0x3634('0x15')],'smsStatusTime':this[_0x3634('0x16')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x3634('0x34')],'whatsappStatus':this[_0x3634('0x18')],'whatsappStatusTime':this[_0x3634('0x35')],'whatsappCapacity':this[_0x3634('0x19')],'whatsappCurrentCapacity':this[_0x3634('0x1a')],'openchannelStatus':this[_0x3634('0x1b')],'openchannelStatusTime':this[_0x3634('0x36')],'openchannelCapacity':this[_0x3634('0x1c')],'openchannelCurrentCapacity':this[_0x3634('0x37')],'busy':this['busy'],'busyQueue':this[_0x3634('0x38')],'chatWaitingInteractions':this[_0x3634('0x1f')],'faxWaitingInteractions':this[_0x3634('0x39')],'mailWaitingInteractions':this[_0x3634('0x20')],'openchannelWaitingInteractions':this['openchannelWaitingInteractions'],'smsWaitingInteractions':this[_0x3634('0x22')],'whatsappWaitingInteractions':this[_0x3634('0x3a')]};var _0x22d091=md5(JSON['stringify'](_0x282f73));if(this['md5']!==_0x22d091){this['md5']=_0x22d091;io[_0x3634('0x3b')](_0x3634('0x3c'),_['omit'](_0x282f73,[_0x3634('0x5')]));}};module[_0x3634('0x3d')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 748b18a..844e2df 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 _0xff73=['map','loggedIn','paused','length','chatPause','available','waiting','stringify','format','chat:queue:%s','emit','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','updateRealtime','prototype','updateRouting','mapAgentsId'];(function(_0x1a4417,_0x4673d3){var _0x463159=function(_0x213688){while(--_0x213688){_0x1a4417['push'](_0x1a4417['shift']());}};_0x463159(++_0x4673d3);}(_0xff73,0x110));var _0x3ff7=function(_0x23e8ee,_0x259afd){_0x23e8ee=_0x23e8ee-0x0;var _0x952c2=_0xff73[_0x23e8ee];return _0x952c2;};'use strict';var _=require(_0x3ff7('0x0'));var md5=require(_0x3ff7('0x1'));var util=require(_0x3ff7('0x2'));var Redis=require(_0x3ff7('0x3'));var config=require(_0x3ff7('0x4'));config[_0x3ff7('0x5')]=_[_0x3ff7('0x6')](config[_0x3ff7('0x5')],{'host':_0x3ff7('0x7'),'port':0x18eb});var io=require(_0x3ff7('0x8'))(new Redis(config[_0x3ff7('0x5')]));function ChatQueue(_0x19fb1b){this['id']=_0x19fb1b['id']||0x0;this[_0x3ff7('0x9')]=_0x19fb1b[_0x3ff7('0x9')]||'';this['timeout']=_0x19fb1b[_0x3ff7('0xa')]||0xa;this[_0x3ff7('0xb')]=_0x19fb1b[_0x3ff7('0xb')]||_0x3ff7('0xc');this[_0x3ff7('0xd')]=_0x19fb1b['Agents'];this['mapAgentsId']={};this['waiting']=0x0;this[_0x3ff7('0x1')]='';this['updateRouting']();this[_0x3ff7('0xe')]();}ChatQueue[_0x3ff7('0xf')][_0x3ff7('0x10')]=function(){var _0x282c2a=this[_0x3ff7('0x11')]['_rr'];this[_0x3ff7('0x11')]=_[_0x3ff7('0x12')](this['Agents'],'id');this[_0x3ff7('0x11')]['_rr']=_0x282c2a;};ChatQueue['prototype'][_0x3ff7('0xe')]=function(){this[_0x3ff7('0x13')]=0x0;this[_0x3ff7('0x14')]=0x0;for(var _0x4a7285=0x0;_0x4a7285=0x0?this[_0x3ff7('0x17')]:0x0;var _0x3ad855={'id':this['id'],'available':this[_0x3ff7('0x17')],'loggedIn':this[_0x3ff7('0x13')],'name':this[_0x3ff7('0x9')],'paused':this[_0x3ff7('0x14')],'waiting':this[_0x3ff7('0x18')]};var _0x22f489=md5(JSON[_0x3ff7('0x19')](_0x3ad855));if(this[_0x3ff7('0x1')]!==_0x22f489){this['md5']=_0x22f489;io['to'](util[_0x3ff7('0x1a')](_0x3ff7('0x1b'),_0x3ad855[_0x3ff7('0x9')]))[_0x3ff7('0x1c')]('chat_queue:save',_0x3ad855);}};module['exports']=ChatQueue; \ No newline at end of file +var _0xa0d1=['map','loggedIn','paused','online','available','waiting','stringify','format','chat:queue:%s','chat_queue:save','md5','util','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','updateRouting','updateRealtime','prototype','mapAgentsId','_rr'];(function(_0x18cf50,_0x3d88f9){var _0x408c31=function(_0x57fe02){while(--_0x57fe02){_0x18cf50['push'](_0x18cf50['shift']());}};_0x408c31(++_0x3d88f9);}(_0xa0d1,0x1aa));var _0x1a0d=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xa0d1[_0x2070da];return _0x4f9fe1;};'use strict';var _=require('lodash');var md5=require(_0x1a0d('0x0'));var util=require(_0x1a0d('0x1'));var Redis=require('ioredis');var config=require(_0x1a0d('0x2'));config[_0x1a0d('0x3')]=_['defaults'](config[_0x1a0d('0x3')],{'host':_0x1a0d('0x4'),'port':0x18eb});var io=require(_0x1a0d('0x5'))(new Redis(config[_0x1a0d('0x3')]));function ChatQueue(_0x20e26d){this['id']=_0x20e26d['id']||0x0;this[_0x1a0d('0x6')]=_0x20e26d[_0x1a0d('0x6')]||'';this[_0x1a0d('0x7')]=_0x20e26d['timeout']||0xa;this[_0x1a0d('0x8')]=_0x20e26d[_0x1a0d('0x8')]||_0x1a0d('0x9');this['Agents']=_0x20e26d[_0x1a0d('0xa')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x1a0d('0x0')]='';this[_0x1a0d('0xb')]();this[_0x1a0d('0xc')]();}ChatQueue[_0x1a0d('0xd')][_0x1a0d('0xb')]=function(){var _0x54f004=this[_0x1a0d('0xe')][_0x1a0d('0xf')];this['mapAgentsId']=_[_0x1a0d('0x10')](this[_0x1a0d('0xa')],'id');this[_0x1a0d('0xe')]['_rr']=_0x54f004;};ChatQueue[_0x1a0d('0xd')][_0x1a0d('0xc')]=function(){this[_0x1a0d('0x11')]=0x0;this[_0x1a0d('0x12')]=0x0;for(var _0x23a625=0x0;_0x23a625=0x0?this['available']:0x0;var _0x126930={'id':this['id'],'available':this[_0x1a0d('0x14')],'loggedIn':this[_0x1a0d('0x11')],'name':this['name'],'paused':this[_0x1a0d('0x12')],'waiting':this[_0x1a0d('0x15')]};var _0x2ba0c2=md5(JSON[_0x1a0d('0x16')](_0x126930));if(this[_0x1a0d('0x0')]!==_0x2ba0c2){this[_0x1a0d('0x0')]=_0x2ba0c2;io['to'](util[_0x1a0d('0x17')](_0x1a0d('0x18'),_0x126930[_0x1a0d('0x6')]))['emit'](_0x1a0d('0x19'),_0x126930);}};module['exports']=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 92f1ade..e23bcab 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 _0x1a51=['redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRealtime','prototype','updateRouting','mapAgentsId','map','_rr','loggedIn','paused','length','online','faxPause','available','format','emit','md5','util','ioredis','../../../config/environment'];(function(_0x4c111e,_0x351ca2){var _0x3f9721=function(_0x25f20a){while(--_0x25f20a){_0x4c111e['push'](_0x4c111e['shift']());}};_0x3f9721(++_0x351ca2);}(_0x1a51,0xd4));var _0x11a5=function(_0x5d7f21,_0x62bd18){_0x5d7f21=_0x5d7f21-0x0;var _0x3977ec=_0x1a51[_0x5d7f21];return _0x3977ec;};'use strict';var _=require('lodash');var md5=require(_0x11a5('0x0'));var util=require(_0x11a5('0x1'));var Redis=require(_0x11a5('0x2'));var config=require(_0x11a5('0x3'));config[_0x11a5('0x4')]=_['defaults'](config[_0x11a5('0x4')],{'host':_0x11a5('0x5'),'port':0x18eb});var io=require(_0x11a5('0x6'))(new Redis(config[_0x11a5('0x4')]));function FaxQueue(_0x50d9bc){this['id']=_0x50d9bc['id']||0x0;this['name']=_0x50d9bc[_0x11a5('0x7')]||'';this[_0x11a5('0x8')]=_0x50d9bc[_0x11a5('0x8')]||0xa;this['strategy']=_0x50d9bc[_0x11a5('0x9')]||_0x11a5('0xa');this[_0x11a5('0xb')]=_0x50d9bc[_0x11a5('0xb')];this['mapAgentsId']={};this[_0x11a5('0xc')]=0x0;this[_0x11a5('0x0')]='';this['updateRouting']();this[_0x11a5('0xd')]();}FaxQueue[_0x11a5('0xe')][_0x11a5('0xf')]=function(){var _0x1b8b96=this[_0x11a5('0x10')]['_rr'];this[_0x11a5('0x10')]=_[_0x11a5('0x11')](this['Agents'],'id');this[_0x11a5('0x10')][_0x11a5('0x12')]=_0x1b8b96;};FaxQueue['prototype'][_0x11a5('0xd')]=function(){this[_0x11a5('0x13')]=0x0;this[_0x11a5('0x14')]=0x0;for(var _0x2a8919=0x0;_0x2a8919=0x0?this[_0x11a5('0x18')]:0x0;var _0x9f19d7={'id':this['id'],'available':this[_0x11a5('0x18')],'loggedIn':this['loggedIn'],'name':this[_0x11a5('0x7')],'paused':this[_0x11a5('0x14')],'waiting':this[_0x11a5('0xc')]};var _0x460ba6=md5(JSON['stringify'](_0x9f19d7));if(this['md5']!==_0x460ba6){this[_0x11a5('0x0')]=_0x460ba6;io['to'](util[_0x11a5('0x19')]('fax:queue:%s',_0x9f19d7[_0x11a5('0x7')]))[_0x11a5('0x1a')]('fax_queue:save',_0x9f19d7);}};module['exports']=FaxQueue; \ No newline at end of file +var _0xde42=['timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','updateRouting','_rr','prototype','loggedIn','paused','online','faxPause','available','format','emit','fax_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name'];(function(_0x1d3801,_0x50ea37){var _0x504ece=function(_0x1da48c){while(--_0x1da48c){_0x1d3801['push'](_0x1d3801['shift']());}};_0x504ece(++_0x50ea37);}(_0xde42,0x117));var _0x2de4=function(_0x3e63c6,_0x2c3160){_0x3e63c6=_0x3e63c6-0x0;var _0x5216af=_0xde42[_0x3e63c6];return _0x5216af;};'use strict';var _=require('lodash');var md5=require(_0x2de4('0x0'));var util=require(_0x2de4('0x1'));var Redis=require(_0x2de4('0x2'));var config=require(_0x2de4('0x3'));config[_0x2de4('0x4')]=_['defaults'](config[_0x2de4('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x2de4('0x5'))(new Redis(config[_0x2de4('0x4')]));function FaxQueue(_0x14d3ee){this['id']=_0x14d3ee['id']||0x0;this[_0x2de4('0x6')]=_0x14d3ee[_0x2de4('0x6')]||'';this['timeout']=_0x14d3ee[_0x2de4('0x7')]||0xa;this[_0x2de4('0x8')]=_0x14d3ee[_0x2de4('0x8')]||_0x2de4('0x9');this[_0x2de4('0xa')]=_0x14d3ee[_0x2de4('0xa')];this[_0x2de4('0xb')]={};this[_0x2de4('0xc')]=0x0;this[_0x2de4('0x0')]='';this['updateRouting']();this[_0x2de4('0xd')]();}FaxQueue['prototype'][_0x2de4('0xe')]=function(){var _0x3764e7=this[_0x2de4('0xb')]['_rr'];this[_0x2de4('0xb')]=_['map'](this[_0x2de4('0xa')],'id');this[_0x2de4('0xb')][_0x2de4('0xf')]=_0x3764e7;};FaxQueue[_0x2de4('0x10')]['updateRealtime']=function(){this[_0x2de4('0x11')]=0x0;this[_0x2de4('0x12')]=0x0;for(var _0x2fb3a5=0x0;_0x2fb3a5=0x0?this[_0x2de4('0x15')]:0x0;var _0x2ecfa8={'id':this['id'],'available':this[_0x2de4('0x15')],'loggedIn':this[_0x2de4('0x11')],'name':this[_0x2de4('0x6')],'paused':this[_0x2de4('0x12')],'waiting':this['waiting']};var _0x4b3a8f=md5(JSON['stringify'](_0x2ecfa8));if(this[_0x2de4('0x0')]!==_0x4b3a8f){this[_0x2de4('0x0')]=_0x4b3a8f;io['to'](util[_0x2de4('0x16')]('fax:queue:%s',_0x2ecfa8['name']))[_0x2de4('0x17')](_0x2de4('0x18'),_0x2ecfa8);}};module[_0x2de4('0x19')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 31fe9b2..d88b2c9 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 _0x2681=['Intervals','exports','name'];(function(_0x5d606b,_0x4c507a){var _0x9d8da7=function(_0x5c2b21){while(--_0x5c2b21){_0x5d606b['push'](_0x5d606b['shift']());}};_0x9d8da7(++_0x4c507a);}(_0x2681,0x12e));var _0x1268=function(_0x211906,_0x3552fa){_0x211906=_0x211906-0x0;var _0x4448e9=_0x2681[_0x211906];return _0x4448e9;};'use strict';function Interval(_0x5db1e0){this['id']=_0x5db1e0['id']||0x0;this[_0x1268('0x0')]=_0x5db1e0['name']||'';this[_0x1268('0x1')]=_0x5db1e0[_0x1268('0x1')]||{};}module[_0x1268('0x2')]=Interval; \ No newline at end of file +var _0x2fa6=['Intervals','name'];(function(_0x2f1cc3,_0x5649fe){var _0x112f12=function(_0x44ce67){while(--_0x44ce67){_0x2f1cc3['push'](_0x2f1cc3['shift']());}};_0x112f12(++_0x5649fe);}(_0x2fa6,0x173));var _0x62fa=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x2fa6[_0x134c2e];return _0x2825db;};'use strict';function Interval(_0x142400){this['id']=_0x142400['id']||0x0;this[_0x62fa('0x0')]=_0x142400[_0x62fa('0x0')]||'';this[_0x62fa('0x1')]=_0x142400[_0x62fa('0x1')]||{};}module['exports']=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 3b0b84d..3db37d6 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 _0x806b=['md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','length','online','mailPause','paused','available','stringify','format','mail:queue:%s','mail_queue:save','exports','lodash'];(function(_0x213ff4,_0x25803f){var _0x133453=function(_0x5845df){while(--_0x5845df){_0x213ff4['push'](_0x213ff4['shift']());}};_0x133453(++_0x25803f);}(_0x806b,0x7b));var _0xb806=function(_0x270398,_0x195653){_0x270398=_0x270398-0x0;var _0x59bc9e=_0x806b[_0x270398];return _0x59bc9e;};'use strict';var _=require(_0xb806('0x0'));var md5=require(_0xb806('0x1'));var util=require(_0xb806('0x2'));var Redis=require('ioredis');var config=require(_0xb806('0x3'));config[_0xb806('0x4')]=_[_0xb806('0x5')](config['redis'],{'host':_0xb806('0x6'),'port':0x18eb});var io=require(_0xb806('0x7'))(new Redis(config[_0xb806('0x4')]));function MailQueue(_0x5ce604){this['id']=_0x5ce604['id']||0x0;this[_0xb806('0x8')]=_0x5ce604['name']||'';this[_0xb806('0x9')]=_0x5ce604[_0xb806('0x9')]||0xa;this[_0xb806('0xa')]=_0x5ce604[_0xb806('0xa')]||_0xb806('0xb');this[_0xb806('0xc')]=_0x5ce604[_0xb806('0xc')];this[_0xb806('0xd')]={};this[_0xb806('0xe')]=0x0;this['md5']='';this[_0xb806('0xf')]();this[_0xb806('0x10')]();}MailQueue[_0xb806('0x11')]['updateRouting']=function(){var _0xa16a42=this[_0xb806('0xd')][_0xb806('0x12')];this[_0xb806('0xd')]=_[_0xb806('0x13')](this[_0xb806('0xc')],'id');this[_0xb806('0xd')]['_rr']=_0xa16a42;};MailQueue[_0xb806('0x11')][_0xb806('0x10')]=function(){this[_0xb806('0x14')]=0x0;this['paused']=0x0;for(var _0x99e328=0x0;_0x99e328=0x0?this[_0xb806('0x19')]:0x0;var _0xd33580={'id':this['id'],'available':this['available'],'loggedIn':this[_0xb806('0x14')],'name':this[_0xb806('0x8')],'paused':this[_0xb806('0x18')],'waiting':this[_0xb806('0xe')]};var _0x4549ae=md5(JSON[_0xb806('0x1a')](_0xd33580));if(this[_0xb806('0x1')]!==_0x4549ae){this[_0xb806('0x1')]=_0x4549ae;io['to'](util[_0xb806('0x1b')](_0xb806('0x1c'),_0xd33580[_0xb806('0x8')]))['emit'](_0xb806('0x1d'),_0xd33580);}};module[_0xb806('0x1e')]=MailQueue; \ No newline at end of file +var _0x4cd2=['prototype','updateRouting','mapAgentsId','_rr','map','loggedIn','paused','length','online','mailPause','available','format','mail:queue:%s','emit','mail_queue:save','exports','ioredis','../../../config/environment','redis','localhost','name','timeout','strategy','beepall','Agents','waiting','md5','updateRealtime'];(function(_0x10c16a,_0x51513b){var _0x3de30c=function(_0x2d28e4){while(--_0x2d28e4){_0x10c16a['push'](_0x10c16a['shift']());}};_0x3de30c(++_0x51513b);}(_0x4cd2,0x198));var _0x24cd=function(_0x3fafdf,_0x452014){_0x3fafdf=_0x3fafdf-0x0;var _0x3779fb=_0x4cd2[_0x3fafdf];return _0x3779fb;};'use strict';var _=require('lodash');var md5=require('md5');var util=require('util');var Redis=require(_0x24cd('0x0'));var config=require(_0x24cd('0x1'));config[_0x24cd('0x2')]=_['defaults'](config[_0x24cd('0x2')],{'host':_0x24cd('0x3'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x24cd('0x2')]));function MailQueue(_0x4620d2){this['id']=_0x4620d2['id']||0x0;this[_0x24cd('0x4')]=_0x4620d2['name']||'';this[_0x24cd('0x5')]=_0x4620d2[_0x24cd('0x5')]||0xa;this[_0x24cd('0x6')]=_0x4620d2[_0x24cd('0x6')]||_0x24cd('0x7');this['Agents']=_0x4620d2[_0x24cd('0x8')];this['mapAgentsId']={};this[_0x24cd('0x9')]=0x0;this[_0x24cd('0xa')]='';this['updateRouting']();this[_0x24cd('0xb')]();}MailQueue[_0x24cd('0xc')][_0x24cd('0xd')]=function(){var _0x1e38e1=this[_0x24cd('0xe')][_0x24cd('0xf')];this[_0x24cd('0xe')]=_[_0x24cd('0x10')](this[_0x24cd('0x8')],'id');this['mapAgentsId'][_0x24cd('0xf')]=_0x1e38e1;};MailQueue[_0x24cd('0xc')][_0x24cd('0xb')]=function(){this[_0x24cd('0x11')]=0x0;this[_0x24cd('0x12')]=0x0;for(var _0x36002d=0x0;_0x36002d=0x0?this['available']:0x0;var _0x1e6cb9={'id':this['id'],'available':this[_0x24cd('0x16')],'loggedIn':this[_0x24cd('0x11')],'name':this[_0x24cd('0x4')],'paused':this['paused'],'waiting':this[_0x24cd('0x9')]};var _0x329d5a=md5(JSON['stringify'](_0x1e6cb9));if(this['md5']!==_0x329d5a){this[_0x24cd('0xa')]=_0x329d5a;io['to'](util[_0x24cd('0x17')](_0x24cd('0x18'),_0x1e6cb9['name']))[_0x24cd('0x19')](_0x24cd('0x1a'),_0x1e6cb9);}};module[_0x24cd('0x1b')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 7f7ec9d..df8a5bf 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 _0x2ef3=['stringify','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','timeout','strategy','beepall','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','paused','length','online','available','loggedIn','name'];(function(_0x1ff2ec,_0x386e86){var _0x405683=function(_0x22f921){while(--_0x22f921){_0x1ff2ec['push'](_0x1ff2ec['shift']());}};_0x405683(++_0x386e86);}(_0x2ef3,0xba));var _0x32ef=function(_0xd9da65,_0xaa3ba6){_0xd9da65=_0xd9da65-0x0;var _0x2e22b1=_0x2ef3[_0xd9da65];return _0x2e22b1;};'use strict';var _=require(_0x32ef('0x0'));var md5=require(_0x32ef('0x1'));var util=require(_0x32ef('0x2'));var Redis=require(_0x32ef('0x3'));var config=require(_0x32ef('0x4'));config[_0x32ef('0x5')]=_['defaults'](config[_0x32ef('0x5')],{'host':_0x32ef('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x32ef('0x5')]));function OpenchannelQueue(_0x37dd1d){this['id']=_0x37dd1d['id']||0x0;this['name']=_0x37dd1d['name']||'';this[_0x32ef('0x7')]=_0x37dd1d[_0x32ef('0x7')]||0xa;this[_0x32ef('0x8')]=_0x37dd1d[_0x32ef('0x8')]||_0x32ef('0x9');this[_0x32ef('0xa')]=_0x37dd1d[_0x32ef('0xa')];this[_0x32ef('0xb')]={};this[_0x32ef('0xc')]=0x0;this[_0x32ef('0x1')]='';this['updateRouting']();this['updateRealtime']();}OpenchannelQueue[_0x32ef('0xd')][_0x32ef('0xe')]=function(){var _0x45bfd5=this[_0x32ef('0xb')]['_rr'];this[_0x32ef('0xb')]=_['map'](this[_0x32ef('0xa')],'id');this['mapAgentsId'][_0x32ef('0xf')]=_0x45bfd5;};OpenchannelQueue[_0x32ef('0xd')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x32ef('0x10')]=0x0;for(var _0x4d8009=0x0;_0x4d8009=0x0?this[_0x32ef('0x13')]:0x0;var _0x286bfb={'id':this['id'],'available':this['available'],'loggedIn':this[_0x32ef('0x14')],'name':this[_0x32ef('0x15')],'paused':this['paused'],'waiting':this[_0x32ef('0xc')]};var _0x314ef1=md5(JSON[_0x32ef('0x16')](_0x286bfb));if(this[_0x32ef('0x1')]!==_0x314ef1){this[_0x32ef('0x1')]=_0x314ef1;io['to'](util[_0x32ef('0x17')]('openchannel:queue:%s',_0x286bfb[_0x32ef('0x15')]))['emit'](_0x32ef('0x18'),_0x286bfb);}};module[_0x32ef('0x19')]=OpenchannelQueue; \ No newline at end of file +var _0x2ef3=['stringify','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','timeout','strategy','beepall','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','paused','length','online','available','loggedIn','name'];(function(_0x59befa,_0x4af99b){var _0x1dd63d=function(_0x4c1df4){while(--_0x4c1df4){_0x59befa['push'](_0x59befa['shift']());}};_0x1dd63d(++_0x4af99b);}(_0x2ef3,0xba));var _0x32ef=function(_0x1a9d20,_0x3a6a6a){_0x1a9d20=_0x1a9d20-0x0;var _0x375049=_0x2ef3[_0x1a9d20];return _0x375049;};'use strict';var _=require(_0x32ef('0x0'));var md5=require(_0x32ef('0x1'));var util=require(_0x32ef('0x2'));var Redis=require(_0x32ef('0x3'));var config=require(_0x32ef('0x4'));config[_0x32ef('0x5')]=_['defaults'](config[_0x32ef('0x5')],{'host':_0x32ef('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x32ef('0x5')]));function OpenchannelQueue(_0x37dd1d){this['id']=_0x37dd1d['id']||0x0;this['name']=_0x37dd1d['name']||'';this[_0x32ef('0x7')]=_0x37dd1d[_0x32ef('0x7')]||0xa;this[_0x32ef('0x8')]=_0x37dd1d[_0x32ef('0x8')]||_0x32ef('0x9');this[_0x32ef('0xa')]=_0x37dd1d[_0x32ef('0xa')];this[_0x32ef('0xb')]={};this[_0x32ef('0xc')]=0x0;this[_0x32ef('0x1')]='';this['updateRouting']();this['updateRealtime']();}OpenchannelQueue[_0x32ef('0xd')][_0x32ef('0xe')]=function(){var _0x45bfd5=this[_0x32ef('0xb')]['_rr'];this[_0x32ef('0xb')]=_['map'](this[_0x32ef('0xa')],'id');this['mapAgentsId'][_0x32ef('0xf')]=_0x45bfd5;};OpenchannelQueue[_0x32ef('0xd')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x32ef('0x10')]=0x0;for(var _0x4d8009=0x0;_0x4d8009=0x0?this[_0x32ef('0x13')]:0x0;var _0x286bfb={'id':this['id'],'available':this['available'],'loggedIn':this[_0x32ef('0x14')],'name':this[_0x32ef('0x15')],'paused':this['paused'],'waiting':this[_0x32ef('0xc')]};var _0x314ef1=md5(JSON[_0x32ef('0x16')](_0x286bfb));if(this[_0x32ef('0x1')]!==_0x314ef1){this[_0x32ef('0x1')]=_0x314ef1;io['to'](util[_0x32ef('0x17')]('openchannel:queue:%s',_0x286bfb[_0x32ef('0x15')]))['emit'](_0x32ef('0x18'),_0x286bfb);}};module[_0x32ef('0x19')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index e75b12f..6490925 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 _0xca8d=['localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','online','smsPause','available','waiting','stringify','format','sms:queue:%s','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults'];(function(_0x342c28,_0x120194){var _0x43c1e4=function(_0x52c590){while(--_0x52c590){_0x342c28['push'](_0x342c28['shift']());}};_0x43c1e4(++_0x120194);}(_0xca8d,0x172));var _0xdca8=function(_0x34d38c,_0x4f1295){_0x34d38c=_0x34d38c-0x0;var _0x4be108=_0xca8d[_0x34d38c];return _0x4be108;};'use strict';var _=require(_0xdca8('0x0'));var md5=require(_0xdca8('0x1'));var util=require(_0xdca8('0x2'));var Redis=require(_0xdca8('0x3'));var config=require(_0xdca8('0x4'));config[_0xdca8('0x5')]=_[_0xdca8('0x6')](config[_0xdca8('0x5')],{'host':_0xdca8('0x7'),'port':0x18eb});var io=require(_0xdca8('0x8'))(new Redis(config[_0xdca8('0x5')]));function SmsQueue(_0x32e549){this['id']=_0x32e549['id']||0x0;this['name']=_0x32e549[_0xdca8('0x9')]||'';this[_0xdca8('0xa')]=_0x32e549[_0xdca8('0xa')]||0xa;this[_0xdca8('0xb')]=_0x32e549[_0xdca8('0xb')]||'beepall';this[_0xdca8('0xc')]=_0x32e549[_0xdca8('0xc')];this[_0xdca8('0xd')]={};this['waiting']=0x0;this[_0xdca8('0x1')]='';this[_0xdca8('0xe')]();this[_0xdca8('0xf')]();}SmsQueue[_0xdca8('0x10')][_0xdca8('0xe')]=function(){var _0x349f88=this[_0xdca8('0xd')][_0xdca8('0x11')];this[_0xdca8('0xd')]=_['map'](this['Agents'],'id');this[_0xdca8('0xd')][_0xdca8('0x11')]=_0x349f88;};SmsQueue[_0xdca8('0x10')][_0xdca8('0xf')]=function(){this[_0xdca8('0x12')]=0x0;this[_0xdca8('0x13')]=0x0;for(var _0x3ea305=0x0;_0x3ea305=0x0?this[_0xdca8('0x17')]:0x0;var _0x490650={'id':this['id'],'available':this['available'],'loggedIn':this[_0xdca8('0x12')],'name':this[_0xdca8('0x9')],'paused':this[_0xdca8('0x13')],'waiting':this[_0xdca8('0x18')]};var _0x4ffe19=md5(JSON[_0xdca8('0x19')](_0x490650));if(this[_0xdca8('0x1')]!==_0x4ffe19){this['md5']=_0x4ffe19;io['to'](util[_0xdca8('0x1a')](_0xdca8('0x1b'),_0x490650[_0xdca8('0x9')]))['emit']('sms_queue:save',_0x490650);}};module[_0xdca8('0x1c')]=SmsQueue; \ No newline at end of file +var _0x3b75=['updateRouting','updateRealtime','prototype','_rr','map','mapAgentsId','loggedIn','paused','length','online','available','stringify','format','sms:queue:%s','sms_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','name','strategy','beepall','Agents','waiting'];(function(_0x322387,_0x4a33a0){var _0x5b3b45=function(_0x58d3c2){while(--_0x58d3c2){_0x322387['push'](_0x322387['shift']());}};_0x5b3b45(++_0x4a33a0);}(_0x3b75,0x144));var _0x53b7=function(_0x375325,_0x57a850){_0x375325=_0x375325-0x0;var _0x228f57=_0x3b75[_0x375325];return _0x228f57;};'use strict';var _=require(_0x53b7('0x0'));var md5=require(_0x53b7('0x1'));var util=require(_0x53b7('0x2'));var Redis=require(_0x53b7('0x3'));var config=require(_0x53b7('0x4'));config[_0x53b7('0x5')]=_[_0x53b7('0x6')](config[_0x53b7('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x53b7('0x5')]));function SmsQueue(_0x2f8b3d){this['id']=_0x2f8b3d['id']||0x0;this[_0x53b7('0x7')]=_0x2f8b3d[_0x53b7('0x7')]||'';this['timeout']=_0x2f8b3d['timeout']||0xa;this[_0x53b7('0x8')]=_0x2f8b3d[_0x53b7('0x8')]||_0x53b7('0x9');this[_0x53b7('0xa')]=_0x2f8b3d[_0x53b7('0xa')];this['mapAgentsId']={};this[_0x53b7('0xb')]=0x0;this[_0x53b7('0x1')]='';this[_0x53b7('0xc')]();this[_0x53b7('0xd')]();}SmsQueue[_0x53b7('0xe')][_0x53b7('0xc')]=function(){var _0x4d8a1f=this['mapAgentsId'][_0x53b7('0xf')];this['mapAgentsId']=_[_0x53b7('0x10')](this['Agents'],'id');this[_0x53b7('0x11')][_0x53b7('0xf')]=_0x4d8a1f;};SmsQueue[_0x53b7('0xe')]['updateRealtime']=function(){this[_0x53b7('0x12')]=0x0;this[_0x53b7('0x13')]=0x0;for(var _0x4a64f4=0x0;_0x4a64f4=0x0?this[_0x53b7('0x16')]:0x0;var _0x47da7c={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x53b7('0x7')],'paused':this[_0x53b7('0x13')],'waiting':this[_0x53b7('0xb')]};var _0x113cb7=md5(JSON[_0x53b7('0x17')](_0x47da7c));if(this[_0x53b7('0x1')]!==_0x113cb7){this[_0x53b7('0x1')]=_0x113cb7;io['to'](util[_0x53b7('0x18')](_0x53b7('0x19'),_0x47da7c[_0x53b7('0x7')]))['emit'](_0x53b7('0x1a'),_0x47da7c);}};module[_0x53b7('0x1b')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index e282102..673a3d8 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 _0x32a4=['available','waiting','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','md5','util','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','_rr','prototype','loggedIn','online','whatsappPause','paused'];(function(_0x197c29,_0x51df0d){var _0x4cda74=function(_0x17178f){while(--_0x17178f){_0x197c29['push'](_0x197c29['shift']());}};_0x4cda74(++_0x51df0d);}(_0x32a4,0x88));var _0x432a=function(_0x1d2ff6,_0x2216b4){_0x1d2ff6=_0x1d2ff6-0x0;var _0x4b269f=_0x32a4[_0x1d2ff6];return _0x4b269f;};'use strict';var _=require('lodash');var md5=require(_0x432a('0x0'));var util=require(_0x432a('0x1'));var Redis=require('ioredis');var config=require(_0x432a('0x2'));config[_0x432a('0x3')]=_[_0x432a('0x4')](config['redis'],{'host':_0x432a('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x432a('0x3')]));function WhatsappQueue(_0x580190){this['id']=_0x580190['id']||0x0;this[_0x432a('0x6')]=_0x580190['name']||'';this[_0x432a('0x7')]=_0x580190[_0x432a('0x7')]||0xa;this[_0x432a('0x8')]=_0x580190[_0x432a('0x8')]||_0x432a('0x9');this[_0x432a('0xa')]=_0x580190[_0x432a('0xa')];this[_0x432a('0xb')]={};this['waiting']=0x0;this[_0x432a('0x0')]='';this[_0x432a('0xc')]();this[_0x432a('0xd')]();}WhatsappQueue['prototype'][_0x432a('0xc')]=function(){var _0x2e8e85=this[_0x432a('0xb')]['_rr'];this[_0x432a('0xb')]=_['map'](this[_0x432a('0xa')],'id');this[_0x432a('0xb')][_0x432a('0xe')]=_0x2e8e85;};WhatsappQueue[_0x432a('0xf')][_0x432a('0xd')]=function(){this[_0x432a('0x10')]=0x0;this['paused']=0x0;for(var _0x71aadc=0x0;_0x71aadc=0x0?this[_0x432a('0x14')]:0x0;var _0x57b1bc={'id':this['id'],'available':this[_0x432a('0x14')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x432a('0x13')],'waiting':this[_0x432a('0x15')]};var _0x3791e3=md5(JSON['stringify'](_0x57b1bc));if(this[_0x432a('0x0')]!==_0x3791e3){this['md5']=_0x3791e3;io['to'](util['format'](_0x432a('0x16'),_0x57b1bc[_0x432a('0x6')]))[_0x432a('0x17')](_0x432a('0x18'),_0x57b1bc);}};module[_0x432a('0x19')]=WhatsappQueue; \ No newline at end of file +var _0xb769=['available','waiting','stringify','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','length','online','whatsappPause','paused'];(function(_0x12b294,_0x192e53){var _0x7b92cb=function(_0x16898e){while(--_0x16898e){_0x12b294['push'](_0x12b294['shift']());}};_0x7b92cb(++_0x192e53);}(_0xb769,0x9d));var _0x9b76=function(_0x1ef517,_0x3cc989){_0x1ef517=_0x1ef517-0x0;var _0x53b05b=_0xb769[_0x1ef517];return _0x53b05b;};'use strict';var _=require(_0x9b76('0x0'));var md5=require(_0x9b76('0x1'));var util=require(_0x9b76('0x2'));var Redis=require(_0x9b76('0x3'));var config=require(_0x9b76('0x4'));config['redis']=_[_0x9b76('0x5')](config[_0x9b76('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9b76('0x6')]));function WhatsappQueue(_0x17879e){this['id']=_0x17879e['id']||0x0;this[_0x9b76('0x7')]=_0x17879e[_0x9b76('0x7')]||'';this[_0x9b76('0x8')]=_0x17879e[_0x9b76('0x8')]||0xa;this[_0x9b76('0x9')]=_0x17879e[_0x9b76('0x9')]||_0x9b76('0xa');this['Agents']=_0x17879e[_0x9b76('0xb')];this[_0x9b76('0xc')]={};this['waiting']=0x0;this[_0x9b76('0x1')]='';this[_0x9b76('0xd')]();this[_0x9b76('0xe')]();}WhatsappQueue[_0x9b76('0xf')][_0x9b76('0xd')]=function(){var _0x3c81c9=this['mapAgentsId'][_0x9b76('0x10')];this['mapAgentsId']=_[_0x9b76('0x11')](this[_0x9b76('0xb')],'id');this[_0x9b76('0xc')][_0x9b76('0x10')]=_0x3c81c9;};WhatsappQueue[_0x9b76('0xf')][_0x9b76('0xe')]=function(){this[_0x9b76('0x12')]=0x0;this['paused']=0x0;for(var _0x4f4d65=0x0;_0x4f4d65=0x0?this[_0x9b76('0x17')]:0x0;var _0x68dc99={'id':this['id'],'available':this[_0x9b76('0x17')],'loggedIn':this[_0x9b76('0x12')],'name':this[_0x9b76('0x7')],'paused':this[_0x9b76('0x16')],'waiting':this[_0x9b76('0x18')]};var _0xd87dd5=md5(JSON[_0x9b76('0x19')](_0x68dc99));if(this['md5']!==_0xd87dd5){this['md5']=_0xd87dd5;io['to'](util['format'](_0x9b76('0x1a'),_0x68dc99['name']))[_0x9b76('0x1b')](_0x9b76('0x1c'),_0x68dc99);}};module[_0x9b76('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 0b953b2..ebf6919 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(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index be815dc..4c50f55 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 _0x99cc=['Request','UpdateChatInteraction','addTags','AddTagsToChatInteraction','../client'];(function(_0x2a558d,_0x2df0ff){var _0xa7bc9c=function(_0x12a30e){while(--_0x12a30e){_0x2a558d['push'](_0x2a558d['shift']());}};_0xa7bc9c(++_0x2df0ff);}(_0x99cc,0x117));var _0xc99c=function(_0x2d88a5,_0x16c5e1){_0x2d88a5=_0x2d88a5-0x0;var _0x1363ab=_0x99cc[_0x2d88a5];return _0x1363ab;};'use strict';var client=require(_0xc99c('0x0'));exports['update']=function(_0x34f385,_0x95a6f6){return client[_0xc99c('0x1')](_0xc99c('0x2'),{'body':_0x95a6f6,'options':{'where':{'id':_0x34f385}},'log':'updateChatInteraction'});};exports[_0xc99c('0x3')]=function(_0x40b7ca,_0x23d801){return client[_0xc99c('0x1')](_0xc99c('0x4'),{'body':_0x23d801,'options':{'where':{'id':_0x40b7ca}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x7509=['updateChatInteraction','addTags','AddTagsToChatInteraction','Request','UpdateChatInteraction'];(function(_0x2580d8,_0x18c091){var _0x2b873a=function(_0x4a81ff){while(--_0x4a81ff){_0x2580d8['push'](_0x2580d8['shift']());}};_0x2b873a(++_0x18c091);}(_0x7509,0x1f2));var _0x9750=function(_0x19e00c,_0x58e31c){_0x19e00c=_0x19e00c-0x0;var _0x573eb9=_0x7509[_0x19e00c];return _0x573eb9;};'use strict';var client=require('../client');exports['update']=function(_0x355558,_0x4f3dc8){return client[_0x9750('0x0')](_0x9750('0x1'),{'body':_0x4f3dc8,'options':{'where':{'id':_0x355558}},'log':_0x9750('0x2')});};exports[_0x9750('0x3')]=function(_0x18201c,_0xbe8821){return client['Request'](_0x9750('0x4'),{'body':_0xbe8821,'options':{'where':{'id':_0x18201c}},'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 31214c6..4c99432 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 _0x11ee=['createChatMessage','../client','create','Request'];(function(_0x44084c,_0x59f54c){var _0x14457f=function(_0x1adea2){while(--_0x1adea2){_0x44084c['push'](_0x44084c['shift']());}};_0x14457f(++_0x59f54c);}(_0x11ee,0x1dd));var _0xe11e=function(_0x487496,_0x249683){_0x487496=_0x487496-0x0;var _0x539dc8=_0x11ee[_0x487496];return _0x539dc8;};'use strict';var client=require(_0xe11e('0x0'));exports[_0xe11e('0x1')]=function(_0x2642d8){return client[_0xe11e('0x2')]('CreateChatMessage',{'body':_0x2642d8,'log':_0xe11e('0x3')});}; \ No newline at end of file +var _0x8108=['CreateChatMessage','createChatMessage','create','Request'];(function(_0x46d5e5,_0x34c9ef){var _0xfcca3b=function(_0x164c52){while(--_0x164c52){_0x46d5e5['push'](_0x46d5e5['shift']());}};_0xfcca3b(++_0x34c9ef);}(_0x8108,0x18a));var _0x8810=function(_0x42bafd,_0x3f0fe3){_0x42bafd=_0x42bafd-0x0;var _0x2ed705=_0x8108[_0x42bafd];return _0x2ed705;};'use strict';var client=require('../client');exports[_0x8810('0x0')]=function(_0x5e7462){return client[_0x8810('0x1')](_0x8810('0x2'),{'body':_0x5e7462,'log':_0x8810('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 8dc672b..c366d62 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 _0xf8de=['User','Agents','online','chatPause','getChatQueues','Request','name','strategy'];(function(_0x285dd2,_0x522ee8){var _0x26c04e=function(_0x3bc9af){while(--_0x3bc9af){_0x285dd2['push'](_0x285dd2['shift']());}};_0x26c04e(++_0x522ee8);}(_0xf8de,0x1d4));var _0xef8d=function(_0x5578e2,_0x319dec){_0x5578e2=_0x5578e2-0x0;var _0x3b9fe7=_0xf8de[_0x5578e2];return _0x3b9fe7;};'use strict';var client=require('../client');exports[_0xef8d('0x0')]=function(){return function(){return client[_0xef8d('0x1')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0xef8d('0x2'),'timeout',_0xef8d('0x3')],'include':[{'model':_0xef8d('0x4'),'as':_0xef8d('0x5'),'attributes':['id','name',_0xef8d('0x6'),_0xef8d('0x7')]}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0x37cc=['online','chatPause','../client','getChatQueues','Request','GetChatQueue','name','timeout','Agents'];(function(_0x7ea1fb,_0x2f0b74){var _0x478241=function(_0xd06b3a){while(--_0xd06b3a){_0x7ea1fb['push'](_0x7ea1fb['shift']());}};_0x478241(++_0x2f0b74);}(_0x37cc,0x185));var _0xc37c=function(_0x5cdcff,_0x3118f2){_0x5cdcff=_0x5cdcff-0x0;var _0x46b31a=_0x37cc[_0x5cdcff];return _0x46b31a;};'use strict';var client=require(_0xc37c('0x0'));exports[_0xc37c('0x1')]=function(){return function(){return client[_0xc37c('0x2')](_0xc37c('0x3'),{'options':{'raw':![],'attributes':['id',_0xc37c('0x4'),_0xc37c('0x5'),'strategy'],'include':[{'model':'User','as':_0xc37c('0x6'),'attributes':['id',_0xc37c('0x4'),_0xc37c('0x7'),_0xc37c('0x8')]}]},'log':_0xc37c('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index a09cf1d..2466f99 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 _0xa4db=['UpdateChatQueueReport','Request','CreateChatQueueReport','update'];(function(_0x24a207,_0x3f99ad){var _0x4c6844=function(_0xee8e5c){while(--_0xee8e5c){_0x24a207['push'](_0x24a207['shift']());}};_0x4c6844(++_0x3f99ad);}(_0xa4db,0x139));var _0xba4d=function(_0x24639b,_0x1a9ff9){_0x24639b=_0x24639b-0x0;var _0x270e29=_0xa4db[_0x24639b];return _0x270e29;};'use strict';var client=require('../client');exports['create']=function(_0x5a4e93){return client[_0xba4d('0x0')](_0xba4d('0x1'),{'body':_0x5a4e93,'log':_0xba4d('0x1')});};exports[_0xba4d('0x2')]=function(_0x32ad53,_0x158edc){return client['Request'](_0xba4d('0x3'),{'body':_0x158edc,'options':{'where':{'uniqueid':_0x32ad53},'order':[['id','DESC']],'limit':0x1},'log':_0xba4d('0x3')});}; \ No newline at end of file +var _0x4fdb=['../client','create','Request','CreateChatQueueReport','update','UpdateChatQueueReport'];(function(_0x1751df,_0x3704fe){var _0x31cdcb=function(_0x282fb9){while(--_0x282fb9){_0x1751df['push'](_0x1751df['shift']());}};_0x31cdcb(++_0x3704fe);}(_0x4fdb,0x9c));var _0xb4fd=function(_0xc917cc,_0x3fb35d){_0xc917cc=_0xc917cc-0x0;var _0x15194c=_0x4fdb[_0xc917cc];return _0x15194c;};'use strict';var client=require(_0xb4fd('0x0'));exports[_0xb4fd('0x1')]=function(_0x243990){return client[_0xb4fd('0x2')](_0xb4fd('0x3'),{'body':_0x243990,'log':_0xb4fd('0x3')});};exports[_0xb4fd('0x4')]=function(_0xd55d8e,_0x1c0b08){return client['Request'](_0xb4fd('0x5'),{'body':_0x1c0b08,'options':{'where':{'uniqueid':_0xd55d8e},'order':[['id','DESC']],'limit':0x1},'log':_0xb4fd('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index f919d0b..0e4ad84 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(_0x373096,_0x4d37aa){var _0x14a6d0=function(_0xb3b614){while(--_0xb3b614){_0x373096['push'](_0x373096['shift']());}};_0x14a6d0(++_0x4d37aa);}(_0x7a54,0x106));var _0x47a5=function(_0x2d9f8c,_0x261f11){_0x2d9f8c=_0x2d9f8c-0x0;var _0x46c925=_0x7a54[_0x2d9f8c];return _0x46c925;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x7a54,0x106));var _0x47a5=function(_0x4e08e7,_0x984b32){_0x4e08e7=_0x4e08e7-0x0;var _0x272323=_0x7a54[_0x4e08e7];return _0x272323;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index f5f8300..6ebcb5c 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 _0xf716=['CreateFaxMessage','../client'];(function(_0x253bd2,_0x4e88ff){var _0x457ff9=function(_0x15cb2e){while(--_0x15cb2e){_0x253bd2['push'](_0x253bd2['shift']());}};_0x457ff9(++_0x4e88ff);}(_0xf716,0x8f));var _0x6f71=function(_0x553e36,_0x5e84ac){_0x553e36=_0x553e36-0x0;var _0x5732a6=_0xf716[_0x553e36];return _0x5732a6;};'use strict';var client=require(_0x6f71('0x0'));exports['create']=function(_0x47ef42){return client['Request'](_0x6f71('0x1'),{'body':_0x47ef42,'log':'createFaxMessage'});}; \ No newline at end of file +var _0xa9ee=['../client','create','Request','CreateFaxMessage','createFaxMessage'];(function(_0x317cc5,_0x3b6179){var _0x44fe81=function(_0x3b43b5){while(--_0x3b43b5){_0x317cc5['push'](_0x317cc5['shift']());}};_0x44fe81(++_0x3b6179);}(_0xa9ee,0x1b3));var _0xea9e=function(_0x237cc2,_0x12ecdb){_0x237cc2=_0x237cc2-0x0;var _0x374559=_0xa9ee[_0x237cc2];return _0x374559;};'use strict';var client=require(_0xea9e('0x0'));exports[_0xea9e('0x1')]=function(_0xa5890b){return client[_0xea9e('0x2')](_0xea9e('0x3'),{'body':_0xa5890b,'log':_0xea9e('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index a4d11ba..344fb17 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 _0xed3a=['Request','GetFaxQueue','timeout','strategy','Agents','name','online','../client','getFaxQueues'];(function(_0x294f3d,_0x1b0f82){var _0x2c8f6c=function(_0x2303e6){while(--_0x2303e6){_0x294f3d['push'](_0x294f3d['shift']());}};_0x2c8f6c(++_0x1b0f82);}(_0xed3a,0xa0));var _0xaed3=function(_0x12f067,_0x25ff87){_0x12f067=_0x12f067-0x0;var _0x277f97=_0xed3a[_0x12f067];return _0x277f97;};'use strict';var client=require(_0xaed3('0x0'));exports[_0xaed3('0x1')]=function(){return function(){return client[_0xaed3('0x2')](_0xaed3('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xaed3('0x4'),_0xaed3('0x5')],'include':[{'model':'User','as':_0xaed3('0x6'),'attributes':['id',_0xaed3('0x7'),_0xaed3('0x8'),'faxPause']}]},'log':_0xaed3('0x1')});};}; \ No newline at end of file +var _0x3ce2=['../client','getFaxQueues','Request','GetFaxQueue','timeout','User','Agents','name','online','faxPause'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x3ce2,0x96));var _0x23ce=function(_0x585d81,_0xf6d74f){_0x585d81=_0x585d81-0x0;var _0x1aca0d=_0x3ce2[_0x585d81];return _0x1aca0d;};'use strict';var client=require(_0x23ce('0x0'));exports[_0x23ce('0x1')]=function(){return function(){return client[_0x23ce('0x2')](_0x23ce('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x23ce('0x4'),'strategy'],'include':[{'model':_0x23ce('0x5'),'as':_0x23ce('0x6'),'attributes':['id',_0x23ce('0x7'),_0x23ce('0x8'),_0x23ce('0x9')]}]},'log':_0x23ce('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 8ca55e0..0e6b8ba 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 _0x6b3f=['DESC','../client','create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport'];(function(_0x2e9280,_0x44d032){var _0x17f9e5=function(_0x4c915){while(--_0x4c915){_0x2e9280['push'](_0x2e9280['shift']());}};_0x17f9e5(++_0x44d032);}(_0x6b3f,0x190));var _0xf6b3=function(_0x3dab21,_0x48cd1e){_0x3dab21=_0x3dab21-0x0;var _0x563a23=_0x6b3f[_0x3dab21];return _0x563a23;};'use strict';var client=require(_0xf6b3('0x0'));exports[_0xf6b3('0x1')]=function(_0x49b706){return client[_0xf6b3('0x2')](_0xf6b3('0x3'),{'body':_0x49b706,'log':_0xf6b3('0x3')});};exports[_0xf6b3('0x4')]=function(_0x11de69,_0x1a14b7){return client[_0xf6b3('0x2')](_0xf6b3('0x5'),{'body':_0x1a14b7,'options':{'where':{'uniqueid':_0x11de69},'order':[['id',_0xf6b3('0x6')]],'limit':0x1},'log':_0xf6b3('0x5')});}; \ No newline at end of file +var _0xf765=['DESC','../client','create','CreateFaxQueueReport','update','Request','UpdateFaxQueueReport'];(function(_0x58dc25,_0x49b9d5){var _0x21b0a7=function(_0x38a186){while(--_0x38a186){_0x58dc25['push'](_0x58dc25['shift']());}};_0x21b0a7(++_0x49b9d5);}(_0xf765,0xe1));var _0x5f76=function(_0x1ee151,_0x37948b){_0x1ee151=_0x1ee151-0x0;var _0x43871b=_0xf765[_0x1ee151];return _0x43871b;};'use strict';var client=require(_0x5f76('0x0'));exports[_0x5f76('0x1')]=function(_0x1e78d1){return client['Request'](_0x5f76('0x2'),{'body':_0x1e78d1,'log':_0x5f76('0x2')});};exports[_0x5f76('0x3')]=function(_0x16b5ae,_0x3f8fb9){return client[_0x5f76('0x4')](_0x5f76('0x5'),{'body':_0x3f8fb9,'options':{'where':{'uniqueid':_0x16b5ae},'order':[['id',_0x5f76('0x6')]],'limit':0x1},'log':_0x5f76('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 0df8baf..0eecdb9 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 _0x91a2=['getIntervals','name','Interval','Intervals','interval','../client'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x91a2,0x8f));var _0x291a=function(_0x160248,_0x2a57e6){_0x160248=_0x160248-0x0;var _0x4e589d=_0x91a2[_0x160248];return _0x4e589d;};'use strict';var client=require(_0x291a('0x0'));exports[_0x291a('0x1')]=function(){return function(){return client['Request']('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x291a('0x2')],'include':[{'model':_0x291a('0x3'),'as':_0x291a('0x4'),'attributes':['id',_0x291a('0x2'),_0x291a('0x5')]}]},'log':_0x291a('0x1')});};}; \ No newline at end of file +var _0x9085=['Intervals','interval','../client','getIntervals','Request','GetInterval','name','Interval'];(function(_0x761b6d,_0x7c7fa8){var _0x3a1639=function(_0x33b90a){while(--_0x33b90a){_0x761b6d['push'](_0x761b6d['shift']());}};_0x3a1639(++_0x7c7fa8);}(_0x9085,0x12a));var _0x5908=function(_0x556bca,_0x573fb9){_0x556bca=_0x556bca-0x0;var _0x16c8fd=_0x9085[_0x556bca];return _0x16c8fd;};'use strict';var client=require(_0x5908('0x0'));exports[_0x5908('0x1')]=function(){return function(){return client[_0x5908('0x2')](_0x5908('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x5908('0x4')],'include':[{'model':_0x5908('0x5'),'as':_0x5908('0x6'),'attributes':['id',_0x5908('0x4'),_0x5908('0x7')]}]},'log':_0x5908('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 1222670..16548c6 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 _0xb44a=['AddTagsToMailInteraction','addTagsToChatInteraction','Request','addTags'];(function(_0x2261ce,_0x9ed8b6){var _0x524640=function(_0x3cbb90){while(--_0x3cbb90){_0x2261ce['push'](_0x2261ce['shift']());}};_0x524640(++_0x9ed8b6);}(_0xb44a,0x1c2));var _0xab44=function(_0x32b4aa,_0x12eba6){_0x32b4aa=_0x32b4aa-0x0;var _0x473160=_0xb44a[_0x32b4aa];return _0x473160;};'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 +var _0x5b12=['addTagsToChatInteraction','../client','update','Request','updateMailInteraction','addTags'];(function(_0x141c13,_0x51f15a){var _0x5bf8ee=function(_0x32576a){while(--_0x32576a){_0x141c13['push'](_0x141c13['shift']());}};_0x5bf8ee(++_0x51f15a);}(_0x5b12,0xa3));var _0x25b1=function(_0x3307fa,_0x234130){_0x3307fa=_0x3307fa-0x0;var _0x5309c8=_0x5b12[_0x3307fa];return _0x5309c8;};'use strict';var client=require(_0x25b1('0x0'));exports[_0x25b1('0x1')]=function(_0x1fe5c1,_0x569948){return client[_0x25b1('0x2')]('UpdateMailInteraction',{'body':_0x569948,'options':{'where':{'id':_0x1fe5c1}},'log':_0x25b1('0x3')});};exports[_0x25b1('0x4')]=function(_0x47995b,_0x31f3fc){return client['Request']('AddTagsToMailInteraction',{'body':_0x31f3fc,'options':{'where':{'id':_0x47995b}},'log':_0x25b1('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 06b7949..acdba9c 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 _0xe798=['Request','createMailMessage','create'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0xe798,0x95));var _0x8e79=function(_0x17ee4d,_0x1bb14a){_0x17ee4d=_0x17ee4d-0x0;var _0x2ca2f3=_0xe798[_0x17ee4d];return _0x2ca2f3;};'use strict';var client=require('../client');exports[_0x8e79('0x0')]=function(_0x57be56){return client[_0x8e79('0x1')]('CreateMailMessage',{'body':_0x57be56,'log':_0x8e79('0x2')});}; \ No newline at end of file +var _0xf19d=['create','Request','CreateMailMessage','../client'];(function(_0x58fa7f,_0x4ed6e3){var _0x526007=function(_0x4d6fbc){while(--_0x4d6fbc){_0x58fa7f['push'](_0x58fa7f['shift']());}};_0x526007(++_0x4ed6e3);}(_0xf19d,0x103));var _0xdf19=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xf19d[_0x3e112d];return _0x531c31;};'use strict';var client=require(_0xdf19('0x0'));exports[_0xdf19('0x1')]=function(_0x1adcd8){return client[_0xdf19('0x2')](_0xdf19('0x3'),{'body':_0x1adcd8,'log':'createMailMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index c0376ca..1692b51 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 _0x54bb=['name','timeout','strategy','Agents','mailPause','../client','Request'];(function(_0x4f3cce,_0x4088c4){var _0xc23f2a=function(_0x31291f){while(--_0x31291f){_0x4f3cce['push'](_0x4f3cce['shift']());}};_0xc23f2a(++_0x4088c4);}(_0x54bb,0x7c));var _0xb54b=function(_0x1a7e4b,_0x2fbd40){_0x1a7e4b=_0x1a7e4b-0x0;var _0x37a8fd=_0x54bb[_0x1a7e4b];return _0x37a8fd;};'use strict';var client=require(_0xb54b('0x0'));exports['getMailQueues']=function(){return function(){return client[_0xb54b('0x1')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0xb54b('0x2'),_0xb54b('0x3'),_0xb54b('0x4')],'include':[{'model':'User','as':_0xb54b('0x5'),'attributes':['id',_0xb54b('0x2'),'online',_0xb54b('0x6')]}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0xea36=['strategy','User','Agents','online','../client','getMailQueues','Request','GetMailQueue','name','timeout'];(function(_0x470f63,_0x48d80b){var _0x4f09e2=function(_0x3aa3a4){while(--_0x3aa3a4){_0x470f63['push'](_0x470f63['shift']());}};_0x4f09e2(++_0x48d80b);}(_0xea36,0x1c6));var _0x6ea3=function(_0x4a4811,_0x43dba5){_0x4a4811=_0x4a4811-0x0;var _0xdb9586=_0xea36[_0x4a4811];return _0xdb9586;};'use strict';var client=require(_0x6ea3('0x0'));exports[_0x6ea3('0x1')]=function(){return function(){return client[_0x6ea3('0x2')](_0x6ea3('0x3'),{'options':{'raw':![],'attributes':['id',_0x6ea3('0x4'),_0x6ea3('0x5'),_0x6ea3('0x6')],'include':[{'model':_0x6ea3('0x7'),'as':_0x6ea3('0x8'),'attributes':['id',_0x6ea3('0x4'),_0x6ea3('0x9'),'mailPause']}]},'log':_0x6ea3('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 1880c13..d0e2a51 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 _0xefc4=['DESC','create','Request','CreateMailQueueReport','UpdateMailQueueReport'];(function(_0x3d007f,_0x52f761){var _0x341999=function(_0x414676){while(--_0x414676){_0x3d007f['push'](_0x3d007f['shift']());}};_0x341999(++_0x52f761);}(_0xefc4,0xd8));var _0x4efc=function(_0x3e91a9,_0x53c466){_0x3e91a9=_0x3e91a9-0x0;var _0x25c9ad=_0xefc4[_0x3e91a9];return _0x25c9ad;};'use strict';var client=require('../client');exports[_0x4efc('0x0')]=function(_0x5a40f5){return client[_0x4efc('0x1')](_0x4efc('0x2'),{'body':_0x5a40f5,'log':_0x4efc('0x2')});};exports['update']=function(_0x5a3a28,_0x207eb1){return client['Request'](_0x4efc('0x3'),{'body':_0x207eb1,'options':{'where':{'uniqueid':_0x5a3a28},'order':[['id',_0x4efc('0x4')]],'limit':0x1},'log':_0x4efc('0x3')});}; \ No newline at end of file +var _0x3a3e=['create','Request','CreateMailQueueReport','DESC','../client'];(function(_0x4f663e,_0x5029b9){var _0x58e23f=function(_0x49700e){while(--_0x49700e){_0x4f663e['push'](_0x4f663e['shift']());}};_0x58e23f(++_0x5029b9);}(_0x3a3e,0xbd));var _0xe3a3=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x3a3e[_0x2064e5];return _0x21a233;};'use strict';var client=require(_0xe3a3('0x0'));exports[_0xe3a3('0x1')]=function(_0x49cf75){return client[_0xe3a3('0x2')]('CreateMailQueueReport',{'body':_0x49cf75,'log':_0xe3a3('0x3')});};exports['update']=function(_0xcb97d7,_0x1c4109){return client['Request']('UpdateMailQueueReport',{'body':_0x1c4109,'options':{'where':{'uniqueid':_0xcb97d7},'order':[['id',_0xe3a3('0x4')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 419f6c2..27400cc 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 _0x63fb=['addTags','addTagsToChatInteraction','../client','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction'];(function(_0x14f88d,_0x4b9d99){var _0xc36bba=function(_0x4506df){while(--_0x4506df){_0x14f88d['push'](_0x14f88d['shift']());}};_0xc36bba(++_0x4b9d99);}(_0x63fb,0x16a));var _0xb63f=function(_0x28576e,_0x2d5cff){_0x28576e=_0x28576e-0x0;var _0x1df21c=_0x63fb[_0x28576e];return _0x1df21c;};'use strict';var client=require(_0xb63f('0x0'));exports['update']=function(_0x20c086,_0xc2a54b){return client[_0xb63f('0x1')](_0xb63f('0x2'),{'body':_0xc2a54b,'options':{'where':{'id':_0x20c086}},'log':_0xb63f('0x3')});};exports[_0xb63f('0x4')]=function(_0x192ff9,_0x5617c0){return client[_0xb63f('0x1')]('AddTagsToOpenchannelInteraction',{'body':_0x5617c0,'options':{'where':{'id':_0x192ff9}},'log':_0xb63f('0x5')});}; \ No newline at end of file +var _0xecff=['addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','Request','UpdateOpenchannelInteraction'];(function(_0x35d4e9,_0x298c61){var _0x5c2770=function(_0x2f326a){while(--_0x2f326a){_0x35d4e9['push'](_0x35d4e9['shift']());}};_0x5c2770(++_0x298c61);}(_0xecff,0x19b));var _0xfecf=function(_0xcd4a43,_0x2e1434){_0xcd4a43=_0xcd4a43-0x0;var _0x573f34=_0xecff[_0xcd4a43];return _0x573f34;};'use strict';var client=require(_0xfecf('0x0'));exports['update']=function(_0x34ac2e,_0x413d92){return client[_0xfecf('0x1')](_0xfecf('0x2'),{'body':_0x413d92,'options':{'where':{'id':_0x34ac2e}},'log':'updateOpenchannelInteraction'});};exports[_0xfecf('0x3')]=function(_0x61c898,_0x18cbfd){return client[_0xfecf('0x1')](_0xfecf('0x4'),{'body':_0x18cbfd,'options':{'where':{'id':_0x61c898}},'log':_0xfecf('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index ee37381..97c2abd 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 _0xb248=['CreateOpenchannelMessage','createOpenchannelMessage','create'];(function(_0x1f4449,_0xe1b863){var _0x1c860a=function(_0x89df4f){while(--_0x89df4f){_0x1f4449['push'](_0x1f4449['shift']());}};_0x1c860a(++_0xe1b863);}(_0xb248,0xc8));var _0x8b24=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xb248[_0x565c49];return _0x20ca34;};'use strict';var client=require('../client');exports[_0x8b24('0x0')]=function(_0x3e4f18){return client['Request'](_0x8b24('0x1'),{'body':_0x3e4f18,'log':_0x8b24('0x2')});}; \ No newline at end of file +var _0xa82c=['../client','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x40d218,_0x51d7af){var _0x2fd285=function(_0x502e5c){while(--_0x502e5c){_0x40d218['push'](_0x40d218['shift']());}};_0x2fd285(++_0x51d7af);}(_0xa82c,0x14a));var _0xca82=function(_0x36b6ec,_0x335e79){_0x36b6ec=_0x36b6ec-0x0;var _0x139f08=_0xa82c[_0x36b6ec];return _0x139f08;};'use strict';var client=require(_0xca82('0x0'));exports['create']=function(_0x5d162e){return client['Request'](_0xca82('0x1'),{'body':_0x5d162e,'log':_0xca82('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index af8342f..cb3e86a 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 _0x10a7=['name','strategy','User','Agents','../client','getOpenchannelQueues','Request','GetOpenchannelQueue'];(function(_0x398bbd,_0x46d80b){var _0x223e3c=function(_0xd89de1){while(--_0xd89de1){_0x398bbd['push'](_0x398bbd['shift']());}};_0x223e3c(++_0x46d80b);}(_0x10a7,0xd4));var _0x710a=function(_0x43d320,_0x20ae4c){_0x43d320=_0x43d320-0x0;var _0xa81463=_0x10a7[_0x43d320];return _0xa81463;};'use strict';var client=require(_0x710a('0x0'));exports[_0x710a('0x1')]=function(){return function(){return client[_0x710a('0x2')](_0x710a('0x3'),{'options':{'raw':![],'attributes':['id',_0x710a('0x4'),'timeout',_0x710a('0x5')],'include':[{'model':_0x710a('0x6'),'as':_0x710a('0x7'),'attributes':['id','name','online','openchannelPause']}]},'log':_0x710a('0x1')});};}; \ No newline at end of file +var _0x58fd=['getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','strategy','User','Agents','online','openchannelPause','../client'];(function(_0x50e26b,_0x5b14b4){var _0x3efdc5=function(_0x45ce58){while(--_0x45ce58){_0x50e26b['push'](_0x50e26b['shift']());}};_0x3efdc5(++_0x5b14b4);}(_0x58fd,0xe6));var _0xd58f=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x58fd[_0x30ae5e];return _0x1f2e93;};'use strict';var client=require(_0xd58f('0x0'));exports[_0xd58f('0x1')]=function(){return function(){return client[_0xd58f('0x2')](_0xd58f('0x3'),{'options':{'raw':![],'attributes':['id',_0xd58f('0x4'),_0xd58f('0x5'),_0xd58f('0x6')],'include':[{'model':_0xd58f('0x7'),'as':_0xd58f('0x8'),'attributes':['id',_0xd58f('0x4'),_0xd58f('0x9'),_0xd58f('0xa')]}]},'log':_0xd58f('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index d2560d6..eb78dd5 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 _0xf5fd=['../client','create','Request','UpdateOpenchannelQueueReport'];(function(_0x3b0d02,_0x408bd0){var _0x11b827=function(_0xc494c3){while(--_0xc494c3){_0x3b0d02['push'](_0x3b0d02['shift']());}};_0x11b827(++_0x408bd0);}(_0xf5fd,0xc8));var _0xdf5f=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xf5fd[_0x59ee6f];return _0x4c0979;};'use strict';var client=require(_0xdf5f('0x0'));exports[_0xdf5f('0x1')]=function(_0x1b8f2b){return client[_0xdf5f('0x2')]('CreateOpenchannelQueueReport',{'body':_0x1b8f2b,'log':'CreateOpenchannelQueueReport'});};exports['update']=function(_0xd6f969,_0x3ad100){return client[_0xdf5f('0x2')](_0xdf5f('0x3'),{'body':_0x3ad100,'options':{'where':{'uniqueid':_0xd6f969},'order':[['id','DESC']],'limit':0x1},'log':_0xdf5f('0x3')});}; \ No newline at end of file +var _0x205d=['Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','create'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x205d,0x1f1));var _0xd205=function(_0xfcdda0,_0x32479b){_0xfcdda0=_0xfcdda0-0x0;var _0x17ebe3=_0x205d[_0xfcdda0];return _0x17ebe3;};'use strict';var client=require('../client');exports[_0xd205('0x0')]=function(_0x8c1861){return client[_0xd205('0x1')]('CreateOpenchannelQueueReport',{'body':_0x8c1861,'log':_0xd205('0x2')});};exports[_0xd205('0x3')]=function(_0xd60755,_0x305da1){return client[_0xd205('0x1')](_0xd205('0x4'),{'body':_0x305da1,'options':{'where':{'uniqueid':_0xd60755},'order':[['id',_0xd205('0x5')]],'limit':0x1},'log':_0xd205('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index d8d1273..a2a300b 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 _0xa37e=['UpdateSmsInteraction','addTags','AddTagsToSmsInteraction','Request'];(function(_0x5d56b3,_0xc6aa3c){var _0x306ae0=function(_0x1dd0a8){while(--_0x1dd0a8){_0x5d56b3['push'](_0x5d56b3['shift']());}};_0x306ae0(++_0xc6aa3c);}(_0xa37e,0x97));var _0xea37=function(_0x18d3b3,_0x5253b1){_0x18d3b3=_0x18d3b3-0x0;var _0x1ebfcd=_0xa37e[_0x18d3b3];return _0x1ebfcd;};'use strict';var client=require('../client');exports['update']=function(_0x474450,_0x42f098){return client[_0xea37('0x0')](_0xea37('0x1'),{'body':_0x42f098,'options':{'where':{'id':_0x474450}},'log':'updateSmsInteraction'});};exports[_0xea37('0x2')]=function(_0x537c5a,_0x360ed5){return client[_0xea37('0x0')](_0xea37('0x3'),{'body':_0x360ed5,'options':{'where':{'id':_0x537c5a}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file +var _0xaf9b=['updateSmsInteraction','addTags','AddTagsToSmsInteraction','../client','Request','UpdateSmsInteraction'];(function(_0x15681c,_0x542320){var _0x59645f=function(_0x536751){while(--_0x536751){_0x15681c['push'](_0x15681c['shift']());}};_0x59645f(++_0x542320);}(_0xaf9b,0x1d7));var _0xbaf9=function(_0x51721f,_0xce6304){_0x51721f=_0x51721f-0x0;var _0x2a20e0=_0xaf9b[_0x51721f];return _0x2a20e0;};'use strict';var client=require(_0xbaf9('0x0'));exports['update']=function(_0x2c58cf,_0x58d1a2){return client[_0xbaf9('0x1')](_0xbaf9('0x2'),{'body':_0x58d1a2,'options':{'where':{'id':_0x2c58cf}},'log':_0xbaf9('0x3')});};exports[_0xbaf9('0x4')]=function(_0x512b7c,_0x64585f){return client[_0xbaf9('0x1')](_0xbaf9('0x5'),{'body':_0x64585f,'options':{'where':{'id':_0x512b7c}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 72226ff..774a55c 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 _0x1f71=['create','Request','CreateSmsMessage','createSmsMessage','../client'];(function(_0x1149b2,_0x33eebc){var _0x2b7ec0=function(_0x5512e9){while(--_0x5512e9){_0x1149b2['push'](_0x1149b2['shift']());}};_0x2b7ec0(++_0x33eebc);}(_0x1f71,0x90));var _0x11f7=function(_0x1945c9,_0x4db56a){_0x1945c9=_0x1945c9-0x0;var _0x2a1b45=_0x1f71[_0x1945c9];return _0x2a1b45;};'use strict';var client=require(_0x11f7('0x0'));exports[_0x11f7('0x1')]=function(_0x4ee357){return client[_0x11f7('0x2')](_0x11f7('0x3'),{'body':_0x4ee357,'log':_0x11f7('0x4')});}; \ No newline at end of file +var _0x4419=['Request','CreateSmsMessage','createSmsMessage','../client','create'];(function(_0x3f4b66,_0x3fab58){var _0x1d5ff0=function(_0x13b734){while(--_0x13b734){_0x3f4b66['push'](_0x3f4b66['shift']());}};_0x1d5ff0(++_0x3fab58);}(_0x4419,0x157));var _0x9441=function(_0x20b35d,_0x21243a){_0x20b35d=_0x20b35d-0x0;var _0x50463c=_0x4419[_0x20b35d];return _0x50463c;};'use strict';var client=require(_0x9441('0x0'));exports[_0x9441('0x1')]=function(_0x5742e2){return client[_0x9441('0x2')](_0x9441('0x3'),{'body':_0x5742e2,'log':_0x9441('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 253e5a3..afd6295 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(_0x41b363,_0x474049){var _0x68e722=function(_0xf2f315){while(--_0xf2f315){_0x41b363['push'](_0x41b363['shift']());}};_0x68e722(++_0x474049);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x356127,_0x4873ac){_0x356127=_0x356127-0x0;var _0x5d4c75=_0xcb91[_0x356127];return _0x5d4c75;};'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(_0x3e3bce,_0x5e9ff1){var _0x458d9c=function(_0x2c58dc){while(--_0x2c58dc){_0x3e3bce['push'](_0x3e3bce['shift']());}};_0x458d9c(++_0x5e9ff1);}(_0xe706,0xa3));var _0x6e70=function(_0x248d46,_0xba08ec){_0x248d46=_0x248d46-0x0;var _0x354942=_0xe706[_0x248d46];return _0x354942;};'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 85ed493..e0bda4b 100644 --- a/server/services/routing/rpc/smsQueueReport.js +++ b/server/services/routing/rpc/smsQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['CreateSmsQueueReport','UpdateSmsQueueReport','DESC','../client','Request'];(function(_0x3bc989,_0x158774){var _0x185939=function(_0x5c15bf){while(--_0x5c15bf){_0x3bc989['push'](_0x3bc989['shift']());}};_0x185939(++_0x158774);}(_0x3e74,0x175));var _0x43e7=function(_0x19b4b1,_0xae6489){_0x19b4b1=_0x19b4b1-0x0;var _0x2d60e9=_0x3e74[_0x19b4b1];return _0x2d60e9;};'use strict';var client=require(_0x43e7('0x0'));exports['create']=function(_0x349480){return client[_0x43e7('0x1')](_0x43e7('0x2'),{'body':_0x349480,'log':'CreateSmsQueueReport'});};exports['update']=function(_0xc58479,_0x4f9bbe){return client[_0x43e7('0x1')](_0x43e7('0x3'),{'body':_0x4f9bbe,'options':{'where':{'uniqueid':_0xc58479},'order':[['id',_0x43e7('0x4')]],'limit':0x1},'log':_0x43e7('0x3')});}; \ No newline at end of file +var _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0xcc24bd,_0x191d8f){var _0x54de04=function(_0x4fe63f){while(--_0x4fe63f){_0xcc24bd['push'](_0xcc24bd['shift']());}};_0x54de04(++_0x191d8f);}(_0x9c44,0x178));var _0x49c4=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x9c44[_0x2d2c16];return _0x53f2fb;};'use strict';var client=require('../client');exports['create']=function(_0x1ffbbf){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'body':_0x1ffbbf,'log':_0x49c4('0x1')});};exports[_0x49c4('0x2')]=function(_0x2ad237,_0x4e0313){return client['Request'](_0x49c4('0x3'),{'body':_0x4e0313,'options':{'where':{'uniqueid':_0x2ad237},'order':[['id','DESC']],'limit':0x1},'log':_0x49c4('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 99d89f3..d4b3be9 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(_0x1b8873,_0xd62bef){var _0x35fa2=function(_0x1fe822){while(--_0x1fe822){_0x1b8873['push'](_0x1b8873['shift']());}};_0x35fa2(++_0xd62bef);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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(_0x51d0e8,_0x5b6b12){var _0x5db1c9=function(_0x15d866){while(--_0x15d866){_0x51d0e8['push'](_0x51d0e8['shift']());}};_0x5db1c9(++_0x5b6b12);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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 4cef234..2b9d863 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 _0x8ace=['updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','Request','UpdateWhatsappInteraction'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x36cf3c,_0x317ae3){_0x36cf3c=_0x36cf3c-0x0;var _0x2a2c00=_0x8ace[_0x36cf3c];return _0x2a2c00;};'use strict';var client=require(_0xe8ac('0x0'));exports[_0xe8ac('0x1')]=function(_0x2b36fd,_0x17e173){return client[_0xe8ac('0x2')](_0xe8ac('0x3'),{'body':_0x17e173,'options':{'where':{'id':_0x2b36fd}},'log':_0xe8ac('0x4')});};exports[_0xe8ac('0x5')]=function(_0x114351,_0xf6af00){return client[_0xe8ac('0x2')](_0xe8ac('0x6'),{'body':_0xf6af00,'options':{'where':{'id':_0x114351}},'log':_0xe8ac('0x7')});}; \ No newline at end of file +var _0x83d0=['addTagsToWhatsappInteraction','../client','update','Request','UpdateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction'];(function(_0x1db206,_0x59251c){var _0x703468=function(_0x22d8fe){while(--_0x22d8fe){_0x1db206['push'](_0x1db206['shift']());}};_0x703468(++_0x59251c);}(_0x83d0,0xb7));var _0x083d=function(_0x4f844f,_0x4a90fa){_0x4f844f=_0x4f844f-0x0;var _0x866f44=_0x83d0[_0x4f844f];return _0x866f44;};'use strict';var client=require(_0x083d('0x0'));exports[_0x083d('0x1')]=function(_0x38e45f,_0x13e585){return client[_0x083d('0x2')](_0x083d('0x3'),{'body':_0x13e585,'options':{'where':{'id':_0x38e45f}},'log':'updateWhatsappInteraction'});};exports[_0x083d('0x4')]=function(_0x4ff4cb,_0x5625dc){return client[_0x083d('0x2')](_0x083d('0x5'),{'body':_0x5625dc,'options':{'where':{'id':_0x4ff4cb}},'log':_0x083d('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 3b88348..739d32b 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 _0x8eee=['../client','CreateWhatsappMessage'];(function(_0x23aa51,_0x17245a){var _0x33d11a=function(_0x5200c4){while(--_0x5200c4){_0x23aa51['push'](_0x23aa51['shift']());}};_0x33d11a(++_0x17245a);}(_0x8eee,0xae));var _0xe8ee=function(_0x55841f,_0x487812){_0x55841f=_0x55841f-0x0;var _0x4c5ccf=_0x8eee[_0x55841f];return _0x4c5ccf;};'use strict';var client=require(_0xe8ee('0x0'));exports['create']=function(_0x253365){return client['Request'](_0xe8ee('0x1'),{'body':_0x253365,'log':'createWhatsappMessage'});}; \ No newline at end of file +var _0x25c9=['createWhatsappMessage','../client','Request','CreateWhatsappMessage'];(function(_0x5097f3,_0x333899){var _0x489d74=function(_0x37dcb0){while(--_0x37dcb0){_0x5097f3['push'](_0x5097f3['shift']());}};_0x489d74(++_0x333899);}(_0x25c9,0x1e9));var _0x925c=function(_0x316fa4,_0x13807e){_0x316fa4=_0x316fa4-0x0;var _0x4b8063=_0x25c9[_0x316fa4];return _0x4b8063;};'use strict';var client=require(_0x925c('0x0'));exports['create']=function(_0x15fed7){return client[_0x925c('0x1')](_0x925c('0x2'),{'body':_0x15fed7,'log':_0x925c('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 7335b04..cdb4e09 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 _0xa194=['../client','getWhatsappQueues','GetWhatsappQueue','name','timeout','strategy','User','Agents','online'];(function(_0x34a573,_0x2ca9bf){var _0x288e2f=function(_0x533c8e){while(--_0x533c8e){_0x34a573['push'](_0x34a573['shift']());}};_0x288e2f(++_0x2ca9bf);}(_0xa194,0x105));var _0x4a19=function(_0x52dfa5,_0x3908fd){_0x52dfa5=_0x52dfa5-0x0;var _0x1eaf0b=_0xa194[_0x52dfa5];return _0x1eaf0b;};'use strict';var client=require(_0x4a19('0x0'));exports[_0x4a19('0x1')]=function(){return function(){return client['Request'](_0x4a19('0x2'),{'options':{'raw':![],'attributes':['id',_0x4a19('0x3'),_0x4a19('0x4'),_0x4a19('0x5')],'include':[{'model':_0x4a19('0x6'),'as':_0x4a19('0x7'),'attributes':['id',_0x4a19('0x3'),_0x4a19('0x8'),'whatsappPause']}]},'log':_0x4a19('0x1')});};}; \ No newline at end of file +var _0xe705=['timeout','online','whatsappPause','getWhatsappQueues','Request','GetWhatsappQueue','name'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xe705,0x168));var _0x5e70=function(_0x5dd351,_0x19ebc5){_0x5dd351=_0x5dd351-0x0;var _0x1fbdba=_0xe705[_0x5dd351];return _0x1fbdba;};'use strict';var client=require('../client');exports[_0x5e70('0x0')]=function(){return function(){return client[_0x5e70('0x1')](_0x5e70('0x2'),{'options':{'raw':![],'attributes':['id',_0x5e70('0x3'),_0x5e70('0x4'),'strategy'],'include':[{'model':'User','as':'Agents','attributes':['id',_0x5e70('0x3'),_0x5e70('0x5'),_0x5e70('0x6')]}]},'log':_0x5e70('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index c9be631..becff56 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 _0x3977=['DESC','create','CreateWhatsappQueueReport','Request','UpdateWhatsappQueueReport'];(function(_0x5906a5,_0x48af0a){var _0x1b9a31=function(_0x4b72ac){while(--_0x4b72ac){_0x5906a5['push'](_0x5906a5['shift']());}};_0x1b9a31(++_0x48af0a);}(_0x3977,0xbf));var _0x7397=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x3977[_0x5b644e];return _0x49c6bf;};'use strict';var client=require('../client');exports[_0x7397('0x0')]=function(_0xb9d00a){return client['Request'](_0x7397('0x1'),{'body':_0xb9d00a,'log':'CreateWhatsappQueueReport'});};exports['update']=function(_0x4f1b59,_0x2b2308){return client[_0x7397('0x2')](_0x7397('0x3'),{'body':_0x2b2308,'options':{'where':{'uniqueid':_0x4f1b59},'order':[['id',_0x7397('0x4')]],'limit':0x1},'log':_0x7397('0x3')});}; \ No newline at end of file +var _0x4d11=['CreateWhatsappQueueReport','UpdateWhatsappQueueReport','Request'];(function(_0x222fdb,_0x4ba223){var _0x3b9924=function(_0x333e1f){while(--_0x333e1f){_0x222fdb['push'](_0x222fdb['shift']());}};_0x3b9924(++_0x4ba223);}(_0x4d11,0x1d6));var _0x14d1=function(_0x114c1c,_0x5bfd6d){_0x114c1c=_0x114c1c-0x0;var _0x50a0a6=_0x4d11[_0x114c1c];return _0x50a0a6;};'use strict';var client=require('../client');exports['create']=function(_0x3861fe){return client[_0x14d1('0x0')](_0x14d1('0x1'),{'body':_0x3861fe,'log':'CreateWhatsappQueueReport'});};exports['update']=function(_0x33eb68,_0x44a46f){return client['Request'](_0x14d1('0x2'),{'body':_0x44a46f,'options':{'where':{'uniqueid':_0x33eb68},'order':[['id','DESC']],'limit':0x1},'log':_0x14d1('0x2')});}; \ 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 90ecd45..df126c0 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 _0xd5f0=['seq-queue','../../../../config/logger','routing','./strategy','string','timeout\x20is\x20a\x20number','info','format','name','toLowerCase','consequence','error','[%s][AGENT]\x20%s','map','message','join','stop','find','createQueue','channel','START:%s','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','close','[%s][AGENT]\x20ROUTING\x20END','validate','lodash','util'];(function(_0x35f748,_0x2cd546){var _0x17ae2b=function(_0xec9002){while(--_0xec9002){_0x35f748['push'](_0x35f748['shift']());}};_0x17ae2b(++_0x2cd546);}(_0xd5f0,0x1bd));var _0x0d5f=function(_0x35b6cd,_0x1e1cff){_0x35b6cd=_0x35b6cd-0x0;var _0xac2b87=_0xd5f0[_0x35b6cd];return _0xac2b87;};'use strict';var schema=require(_0x0d5f('0x0'));var _=require(_0x0d5f('0x1'));var util=require(_0x0d5f('0x2'));var seqqueue=require(_0x0d5f('0x3'));var logger=require(_0x0d5f('0x4'))(_0x0d5f('0x5'));var strategy=require(_0x0d5f('0x6'));var queue=schema({'name':{'type':_0x0d5f('0x7'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0x0d5f('0x8')}});function writeLog(_0x5816b2,_0x4e3f1a,_0x4dcce1){return logger[_0x0d5f('0x9')](util[_0x0d5f('0xa')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x5816b2,_0x4e3f1a[_0x0d5f('0xb')],_0x4dcce1));}function handleFindAgent(_0x321ae0){return function(_0x37e45b){return _0x37e45b['name'][_0x0d5f('0xc')]()===_0x321ae0['toLowerCase']();};}exports[_0x0d5f('0xd')]=function(_0x50a2a4,_0x506f6a,_0xa43106,_0xa153ce){return function(_0x31ac72){try{var _0x25c76d={'name':_0x506f6a[0x0],'timeout':_0x506f6a[0x1]};var _0x262b9b=queue[_0x0d5f('0x0')](_0x25c76d,{'typecast':!![]});if(_0x262b9b['length']){logger[_0x0d5f('0xe')](_0x0d5f('0xf'),_0x50a2a4,_[_0x0d5f('0x10')](_0x262b9b,_0x0d5f('0x11'))[_0x0d5f('0x12')](',\x20'));_0x31ac72[_0x0d5f('0x13')]();}else{var _0x3c56b1=_[_0x0d5f('0x14')](_0xa43106['agents'],handleFindAgent(_0x25c76d[_0x0d5f('0xb')]));if(_0x3c56b1){var _0x87a8a5=(_0x25c76d['timeout']||0xa)*0x3e8;var _0x27138b,_0xf98e53;var _0x6c76f8=seqqueue[_0x0d5f('0x15')](_0x87a8a5);_0x6c76f8['id']=_0x50a2a4;_0x6c76f8['atimeout']=_0x87a8a5;_0x6c76f8['channel']=_0xa153ce[_0x0d5f('0x16')];writeLog(_0x50a2a4,_0x3c56b1,util[_0x0d5f('0xa')](_0x0d5f('0x17'),_0x87a8a5));_0xa43106[_0x0d5f('0x18')][_0x50a2a4]['on']('end',function(){logger[_0x0d5f('0x9')](_0x0d5f('0x19'),_0x50a2a4);clearTimeout(_0xf98e53);_0xf98e53=undefined;_0x6c76f8[_0x0d5f('0x1a')]();if(_0xa43106['rules'][_0x50a2a4]){delete _0xa43106['rules'][_0x50a2a4];}_0x31ac72[_0x0d5f('0x13')]();});_0xa43106['rules'][_0x50a2a4]['on']('complete',function(){if(_0xa43106[_0x0d5f('0x18')][_0x50a2a4]){delete _0xa43106[_0x0d5f('0x18')][_0x50a2a4];}});_0xf98e53=setTimeout(function(){logger['info'](_0x0d5f('0x1b'),_0x50a2a4);clearTimeout(_0xf98e53);_0x6c76f8[_0x0d5f('0x1a')]();_0x31ac72['next']();},_0x87a8a5);strategy['agent'](_0x6c76f8,_0x3c56b1,_0xa43106,_0xa153ce);}else{logger[_0x0d5f('0xe')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x50a2a4,_0x25c76d[_0x0d5f('0xb')]);_0x31ac72[_0x0d5f('0x13')]();}}}catch(_0x3db8c2){console['log'](_0x3db8c2);logger[_0x0d5f('0xe')]('[%s][QUEUE]\x20%s',_0x50a2a4,_0x3db8c2['stack']);_0x31ac72[_0x0d5f('0x13')]();}};}; \ No newline at end of file +var _0x1e21=['../../../../config/logger','routing','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','timeout','atimeout','channel','rules','end','info','close','complete','next','agent','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','stack','validate','lodash','util','seq-queue'];(function(_0x1a285a,_0xa0539a){var _0x2b180b=function(_0x1480d1){while(--_0x1480d1){_0x1a285a['push'](_0x1a285a['shift']());}};_0x2b180b(++_0xa0539a);}(_0x1e21,0x149));var _0x11e2=function(_0x318cd9,_0x54d8be){_0x318cd9=_0x318cd9-0x0;var _0xbdb4b1=_0x1e21[_0x318cd9];return _0xbdb4b1;};'use strict';var schema=require(_0x11e2('0x0'));var _=require(_0x11e2('0x1'));var util=require(_0x11e2('0x2'));var seqqueue=require(_0x11e2('0x3'));var logger=require(_0x11e2('0x4'))(_0x11e2('0x5'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0x11e2('0x6'),'required':!![],'message':_0x11e2('0x7')},'timeout':{'type':_0x11e2('0x8'),'message':_0x11e2('0x9')}});function writeLog(_0x3e419e,_0x62bcae,_0x53deeb){return logger['info'](util[_0x11e2('0xa')](_0x11e2('0xb'),_0x3e419e,_0x62bcae[_0x11e2('0xc')],_0x53deeb));}function handleFindAgent(_0xd1265){return function(_0x53097c){return _0x53097c[_0x11e2('0xc')][_0x11e2('0xd')]()===_0xd1265[_0x11e2('0xd')]();};}exports[_0x11e2('0xe')]=function(_0x4ebb09,_0x39fc3f,_0x645f96,_0x12ed15){return function(_0x48015b){try{var _0x52a752={'name':_0x39fc3f[0x0],'timeout':_0x39fc3f[0x1]};var _0x2defe6=queue[_0x11e2('0x0')](_0x52a752,{'typecast':!![]});if(_0x2defe6[_0x11e2('0xf')]){logger['error'](_0x11e2('0x10'),_0x4ebb09,_[_0x11e2('0x11')](_0x2defe6,_0x11e2('0x12'))[_0x11e2('0x13')](',\x20'));_0x48015b[_0x11e2('0x14')]();}else{var _0x4199b1=_[_0x11e2('0x15')](_0x645f96[_0x11e2('0x16')],handleFindAgent(_0x52a752[_0x11e2('0xc')]));if(_0x4199b1){var _0x545958=(_0x52a752[_0x11e2('0x17')]||0xa)*0x3e8;var _0x2e71ae,_0x12705e;var _0x9875c3=seqqueue['createQueue'](_0x545958);_0x9875c3['id']=_0x4ebb09;_0x9875c3[_0x11e2('0x18')]=_0x545958;_0x9875c3[_0x11e2('0x19')]=_0x12ed15['channel'];writeLog(_0x4ebb09,_0x4199b1,util[_0x11e2('0xa')]('START:%s',_0x545958));_0x645f96[_0x11e2('0x1a')][_0x4ebb09]['on'](_0x11e2('0x1b'),function(){logger[_0x11e2('0x1c')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x4ebb09);clearTimeout(_0x12705e);_0x12705e=undefined;_0x9875c3[_0x11e2('0x1d')]();if(_0x645f96['rules'][_0x4ebb09]){delete _0x645f96[_0x11e2('0x1a')][_0x4ebb09];}_0x48015b['stop']();});_0x645f96['rules'][_0x4ebb09]['on'](_0x11e2('0x1e'),function(){if(_0x645f96[_0x11e2('0x1a')][_0x4ebb09]){delete _0x645f96['rules'][_0x4ebb09];}});_0x12705e=setTimeout(function(){logger[_0x11e2('0x1c')]('[%s][AGENT]\x20ROUTING\x20END',_0x4ebb09);clearTimeout(_0x12705e);_0x9875c3[_0x11e2('0x1d')]();_0x48015b[_0x11e2('0x1f')]();},_0x545958);strategy[_0x11e2('0x20')](_0x9875c3,_0x4199b1,_0x645f96,_0x12ed15);}else{logger[_0x11e2('0x21')](_0x11e2('0x22'),_0x4ebb09,_0x52a752['name']);_0x48015b['stop']();}}}catch(_0x81a15d){console[_0x11e2('0x23')](_0x81a15d);logger[_0x11e2('0x21')]('[%s][QUEUE]\x20%s',_0x4ebb09,_0x81a15d[_0x11e2('0x24')]);_0x48015b['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index 2ff43c2..435bc52 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 _0x0f88=['lodash','moment','aws-sdk','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','sms','channel','whatsapp','phone','interaction','chat','ChatWebsiteId','upperFirst','InteractionId','created','body','getMustacheRender','Message','create','[%s][AMAZONLEX]\x20%s','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','amazonlex','providerName','providerResponse','dialogState','Failed'];(function(_0x18d5d7,_0x19074b){var _0x30a9ea=function(_0x514f3f){while(--_0x514f3f){_0x18d5d7['push'](_0x18d5d7['shift']());}};_0x30a9ea(++_0x19074b);}(_0x0f88,0x66));var _0x80f8=function(_0x1b0597,_0xeffacc){_0x1b0597=_0x1b0597-0x0;var _0x2b6a2a=_0x0f88[_0x1b0597];return _0x2b6a2a;};'use strict';var _=require(_0x80f8('0x0'));var moment=require(_0x80f8('0x1'));var AWS=require(_0x80f8('0x2'));var utils=require('./utils');var logger=require(_0x80f8('0x3'))(_0x80f8('0x4'));var rpc={'chatMessage':require(_0x80f8('0x5')),'openchannelMessage':require(_0x80f8('0x6')),'mailMessage':require(_0x80f8('0x7')),'smsMessage':require(_0x80f8('0x8')),'faxMessage':require(_0x80f8('0x9')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x80f8('0xa')]=function(_0x436762,_0x4fcd0b){return function(_0x3bce04){try{if(!_[_0x80f8('0xb')](this['interaction'][_0x80f8('0xc')])){logger[_0x80f8('0xd')]('[%s][AMAZONLEX]\x20%s',_0x436762,_0x80f8('0xe'));return _0x3bce04[_0x80f8('0xf')]();}var _0x2671d8={'ContactId':this[_0x80f8('0x10')]['id'],'sentAt':moment()[_0x80f8('0x11')](_0x80f8('0x12')),'direction':'out'};if(this['channel']===_0x80f8('0x13')||this[_0x80f8('0x14')]===_0x80f8('0x15')){_0x2671d8[_0x80f8('0x16')]=this[_0x80f8('0x17')][_0x80f8('0x16')];}var _0x3047bf=this[_0x80f8('0x14')];if(_0x3047bf===_0x80f8('0x18')){_0x2671d8[_0x80f8('0x19')]=this['account']['id'];}else{_0x2671d8[_[_0x80f8('0x1a')](_0x3047bf)+'AccountId']=this['account']['id'];}_0x2671d8[_[_0x80f8('0x1a')](_0x3047bf)+_0x80f8('0x1b')]=this['interaction']['id'];if(this[_0x80f8('0x17')][_0x80f8('0x1c')]){var _0xc48563=_0x4fcd0b[0x4];if(!_['isEmpty'](_0xc48563)){_0x2671d8[_0x80f8('0x1d')]=utils[_0x80f8('0x1e')](_0xc48563,this);return rpc[_0x3047bf+_0x80f8('0x1f')][_0x80f8('0x20')](_0x2671d8)['then'](function(_0x317218){logger[_0x80f8('0xd')](_0x80f8('0x21'),_0x436762,_0x2671d8[_0x80f8('0x1d')]);})[_0x80f8('0x22')](function(_0xe8d5b0){logger[_0x80f8('0x23')](_0x80f8('0x21'),_0x436762,JSON[_0x80f8('0x24')](_0xe8d5b0));})[_0x80f8('0x25')](function(){logger[_0x80f8('0xd')](_0x80f8('0x26'),_0x436762);_0x3bce04[_0x80f8('0x27')]();});}else{logger[_0x80f8('0xd')](_0x80f8('0x28'),_0x436762);_0x3bce04[_0x80f8('0x27')]();}}else{var _0x5e62bc=this;var _0x15c649=new AWS[(_0x80f8('0x29'))]({'accessKeyId':_0x4fcd0b[0x0],'secretAccessKey':_0x4fcd0b[0x1],'region':_0x4fcd0b[0x2]});var _0x291037={'botAlias':_0x80f8('0x2a'),'botName':_0x4fcd0b[0x3],'inputText':this[_0x80f8('0x2b')]['body'],'userId':this[_0x80f8('0x14')]+':'+this[_0x80f8('0x17')]['id'][_0x80f8('0x2c')]()};_0x15c649[_0x80f8('0x2d')](_0x291037,function(_0xa62f1e,_0x55dea8){if(_0xa62f1e){logger['error'](_0x80f8('0x21'),_0x436762,_0xa62f1e[_0x80f8('0x2b')]);_0x3bce04[_0x80f8('0xf')]();}else if(_0x55dea8&&_0x55dea8[_0x80f8('0x2b')]){_0x5e62bc[_0x80f8('0x1d')][_0x80f8('0x2e')]=_0x55dea8;_0x2671d8['body']=_0x55dea8[_0x80f8('0x2b')];_0x2671d8[_0x80f8('0x2f')]=_0x80f8('0x2e');_0x2671d8[_0x80f8('0x30')]=JSON[_0x80f8('0x24')](_0x55dea8);return rpc[_0x3047bf+_0x80f8('0x1f')][_0x80f8('0x20')](_0x2671d8)['then'](function(_0x28c4cc){logger['info'](_0x80f8('0x21'),_0x436762,_0x2671d8[_0x80f8('0x1d')]);if(_0x55dea8[_0x80f8('0x31')]==_0x80f8('0x32')){_0x3bce04['next']();}else{_0x3bce04[_0x80f8('0x27')]();}})[_0x80f8('0x22')](function(_0x48c483){logger[_0x80f8('0x23')](_0x80f8('0x21'),_0x436762,JSON[_0x80f8('0x24')](_0x48c483));_0x3bce04[_0x80f8('0xf')]();});}else{_0x3bce04[_0x80f8('0xf')]();}});}}catch(_0x1d9780){logger[_0x80f8('0x23')](_0x80f8('0x21'),_0x436762,JSON['stringify'](_0x1d9780));_0x3bce04['stop']();}};}; \ No newline at end of file +var _0x8d44=['InteractionId','created','isEmpty','body','then','info','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','$LATEST','message','toString','postText','amazonlex','providerName','create','dialogState','Failed','aws-sdk','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0x8d44,0x1b4));var _0x48d4=function(_0x284781,_0x564f94){_0x284781=_0x284781-0x0;var _0x524363=_0x8d44[_0x284781];return _0x524363;};'use strict';var _=require('lodash');var moment=require('moment');var AWS=require(_0x48d4('0x0'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x48d4('0x1'));var rpc={'chatMessage':require(_0x48d4('0x2')),'openchannelMessage':require(_0x48d4('0x3')),'mailMessage':require(_0x48d4('0x4')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x48d4('0x5')),'whatsappMessage':require(_0x48d4('0x6'))};exports[_0x48d4('0x7')]=function(_0x2ec91c,_0x563686){return function(_0x17d8fb){try{if(!_[_0x48d4('0x8')](this[_0x48d4('0x9')][_0x48d4('0xa')])){logger['info'](_0x48d4('0xb'),_0x2ec91c,_0x48d4('0xc'));return _0x17d8fb[_0x48d4('0xd')]();}var _0xa21902={'ContactId':this['contact']['id'],'sentAt':moment()[_0x48d4('0xe')](_0x48d4('0xf')),'direction':'out'};if(this[_0x48d4('0x10')]===_0x48d4('0x11')||this[_0x48d4('0x10')]===_0x48d4('0x12')){_0xa21902['phone']=this[_0x48d4('0x9')][_0x48d4('0x13')];}var _0x427ce1=this[_0x48d4('0x10')];if(_0x427ce1===_0x48d4('0x14')){_0xa21902[_0x48d4('0x15')]=this[_0x48d4('0x16')]['id'];}else{_0xa21902[_['upperFirst'](_0x427ce1)+'AccountId']=this[_0x48d4('0x16')]['id'];}_0xa21902[_[_0x48d4('0x17')](_0x427ce1)+_0x48d4('0x18')]=this[_0x48d4('0x9')]['id'];if(this['interaction'][_0x48d4('0x19')]){var _0x262e1a=_0x563686[0x4];if(!_[_0x48d4('0x1a')](_0x262e1a)){_0xa21902[_0x48d4('0x1b')]=utils['getMustacheRender'](_0x262e1a,this);return rpc[_0x427ce1+'Message']['create'](_0xa21902)[_0x48d4('0x1c')](function(_0x16e749){logger[_0x48d4('0x1d')]('[%s][AMAZONLEX]\x20%s',_0x2ec91c,_0xa21902[_0x48d4('0x1b')]);})[_0x48d4('0x1e')](function(_0x56952d){logger[_0x48d4('0x1f')](_0x48d4('0xb'),_0x2ec91c,JSON[_0x48d4('0x20')](_0x56952d));})[_0x48d4('0x21')](function(){logger[_0x48d4('0x1d')](_0x48d4('0x22'),_0x2ec91c);_0x17d8fb[_0x48d4('0x23')]();});}else{logger[_0x48d4('0x1d')](_0x48d4('0x24'),_0x2ec91c);_0x17d8fb[_0x48d4('0x23')]();}}else{var _0x56c6c3=this;var _0xd1349e=new AWS['LexRuntime']({'accessKeyId':_0x563686[0x0],'secretAccessKey':_0x563686[0x1],'region':_0x563686[0x2]});var _0x53e815={'botAlias':_0x48d4('0x25'),'botName':_0x563686[0x3],'inputText':this[_0x48d4('0x26')][_0x48d4('0x1b')],'userId':this[_0x48d4('0x10')]+':'+this[_0x48d4('0x9')]['id'][_0x48d4('0x27')]()};_0xd1349e[_0x48d4('0x28')](_0x53e815,function(_0x18bb3b,_0x4c0cee){if(_0x18bb3b){logger['error'](_0x48d4('0xb'),_0x2ec91c,_0x18bb3b[_0x48d4('0x26')]);_0x17d8fb[_0x48d4('0xd')]();}else if(_0x4c0cee&&_0x4c0cee[_0x48d4('0x26')]){_0x56c6c3[_0x48d4('0x1b')][_0x48d4('0x29')]=_0x4c0cee;_0xa21902[_0x48d4('0x1b')]=_0x4c0cee[_0x48d4('0x26')];_0xa21902[_0x48d4('0x2a')]=_0x48d4('0x29');_0xa21902['providerResponse']=JSON['stringify'](_0x4c0cee);return rpc[_0x427ce1+'Message'][_0x48d4('0x2b')](_0xa21902)[_0x48d4('0x1c')](function(_0x51b3fe){logger[_0x48d4('0x1d')](_0x48d4('0xb'),_0x2ec91c,_0xa21902[_0x48d4('0x1b')]);if(_0x4c0cee[_0x48d4('0x2c')]==_0x48d4('0x2d')){_0x17d8fb[_0x48d4('0xd')]();}else{_0x17d8fb['stop']();}})[_0x48d4('0x1e')](function(_0x59102e){logger[_0x48d4('0x1f')](_0x48d4('0xb'),_0x2ec91c,JSON[_0x48d4('0x20')](_0x59102e));_0x17d8fb[_0x48d4('0xd')]();});}else{_0x17d8fb[_0x48d4('0xd')]();}});}}catch(_0x2b4f6d){logger[_0x48d4('0x1f')](_0x48d4('0xb'),_0x2ec91c,JSON[_0x48d4('0x20')](_0x2b4f6d));_0x17d8fb['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index 3164065..ba6d7e2 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 _0x98ac=['[%s][AUTOREPLY][autoreplyExecuted]\x20%s','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','./utils','routing','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','channel','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','next','isNil','interaction','Autoreply\x20already\x20sent','autoreplyExecuted','One\x20Time\x20already\x20sent','contact','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','Re:\x20','account','upperFirst','AccountId','Message','inReplyTo','messageId','html','','replace','','headers','auto-replied','All','auto_reply','sendMailMessage','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','resolve','Interaction','finally','update'];(function(_0x1b912,_0x557f9e){var _0x539927=function(_0x49a7fc){while(--_0x49a7fc){_0x1b912['push'](_0x1b912['shift']());}};_0x539927(++_0x557f9e);}(_0x98ac,0x8d));var _0xc98a=function(_0x1b450b,_0x40be04){_0x1b450b=_0x1b450b-0x0;var _0x450af9=_0x98ac[_0x1b450b];return _0x450af9;};'use strict';var _=require(_0xc98a('0x0'));var moment=require('moment');var utils=require(_0xc98a('0x1'));var logger=require('../../../../config/logger')(_0xc98a('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xc98a('0x3')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xc98a('0x4')),'faxMessage':require(_0xc98a('0x5')),'whatsappMessage':require(_0xc98a('0x6')),'chatInteraction':require(_0xc98a('0x7')),'openchannelInteraction':require(_0xc98a('0x8')),'mailInteraction':require(_0xc98a('0x9')),'smsInteraction':require(_0xc98a('0xa')),'faxInteraction':require(_0xc98a('0xb')),'whatsappInteraction':require(_0xc98a('0xc'))};var mailRpc=require(_0xc98a('0xd'));exports['consequence']=function(_0x587d37,_0x4acb2d,_0x2b2c09,_0x31139b){return function(_0x612f4e){try{var _0x14cc4b=this[_0xc98a('0xe')];if(_0x14cc4b===_0xc98a('0xf')&&_0x31139b[_0xc98a('0x10')][_0xc98a('0x11')]){logger[_0xc98a('0x12')](_0xc98a('0x13'),_0x587d37,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x612f4e[_0xc98a('0x14')]();}if(_0x4acb2d[0x0]==='1'&&(_[_0xc98a('0x15')](this[_0xc98a('0x16')]['created'])||!this[_0xc98a('0x16')]['created'])){logger[_0xc98a('0x12')](_0xc98a('0x13'),_0x587d37,_0xc98a('0x17'));return _0x612f4e[_0xc98a('0x14')]();}if(_0x4acb2d[0x0]==='2'&&this[_0xc98a('0x16')][_0xc98a('0x18')]){logger[_0xc98a('0x12')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x587d37,_0xc98a('0x19'));return _0x612f4e[_0xc98a('0x14')]();}var _0x5d756a={'ContactId':this[_0xc98a('0x1a')]['id'],'sentAt':moment()['format'](_0xc98a('0x1b')),'direction':_0xc98a('0x1c')};if(this[_0xc98a('0xe')]===_0xc98a('0xf')){_0x5d756a[_0xc98a('0x10')]=utils['getMustacheRender'](_0x4acb2d[0x2],this);}else{_0x5d756a['body']=utils[_0xc98a('0x1d')](_0x4acb2d[0x1],this);}if(this[_0xc98a('0x1e')]){_0x5d756a['to']=this['message'][_0xc98a('0x1f')]||'';if(this[_0xc98a('0xe')]===_0xc98a('0xf')&&_0x4acb2d[0x1]==='1'){_0x5d756a['cc']=this['message']['cc']||'';}_0x5d756a[_0xc98a('0x1f')]=this[_0xc98a('0x1e')]['to']||'';_0x5d756a[_0xc98a('0x20')]=this[_0xc98a('0x1e')][_0xc98a('0x20')]||'';_0x5d756a[_0xc98a('0x21')]=!![];if(this[_0xc98a('0x1e')][_0xc98a('0x22')]){_0x5d756a[_0xc98a('0x22')]='';_0x5d756a[_0xc98a('0x22')]+=_[_0xc98a('0x23')](this[_0xc98a('0x1e')][_0xc98a('0x22')],_0xc98a('0x24'))?'':_0xc98a('0x25');_0x5d756a['subject']+=this[_0xc98a('0x1e')]['subject'];}}if(this[_0xc98a('0xe')]==='chat'){_0x5d756a['ChatWebsiteId']=this[_0xc98a('0x26')]['id'];}else{_0x5d756a[_[_0xc98a('0x27')](this[_0xc98a('0xe')])+_0xc98a('0x28')]=this[_0xc98a('0x26')]['id'];}_0x5d756a[_[_0xc98a('0x27')](this[_0xc98a('0xe')])+'InteractionId']=this[_0xc98a('0x16')]['id'];var _0x236a09=this['interaction'];if(rpc[this[_0xc98a('0xe')]+_0xc98a('0x29')]){if(this[_0xc98a('0xe')]===_0xc98a('0xf')){_0x5d756a[_0xc98a('0x2a')]=this[_0xc98a('0x1e')][_0xc98a('0x2b')];_0x5d756a[_0xc98a('0x2c')]=_0xc98a('0x2d')+_[_0xc98a('0x2e')](_0x5d756a[_0xc98a('0x10')],'','headers','All','sendMailMessage','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','Message','create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','resolve','autoreplyExecuted','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','finally','stop'];(function(_0x1bbed4,_0x1a6018){var _0x59016a=function(_0x567ea1){while(--_0x567ea1){_0x1bbed4['push'](_0x1bbed4['shift']());}};_0x59016a(++_0x1a6018);}(_0x0ec8,0xc3));var _0x80ec=function(_0xd8af6a,_0x4bfacc){_0xd8af6a=_0xd8af6a-0x0;var _0x119bf2=_0x0ec8[_0xd8af6a];return _0x119bf2;};'use strict';var _=require(_0x80ec('0x0'));var moment=require('moment');var utils=require(_0x80ec('0x1'));var logger=require('../../../../config/logger')(_0x80ec('0x2'));var rpc={'chatMessage':require(_0x80ec('0x3')),'openchannelMessage':require(_0x80ec('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x80ec('0x5')),'faxMessage':require(_0x80ec('0x6')),'whatsappMessage':require(_0x80ec('0x7')),'chatInteraction':require(_0x80ec('0x8')),'openchannelInteraction':require(_0x80ec('0x9')),'mailInteraction':require(_0x80ec('0xa')),'smsInteraction':require(_0x80ec('0xb')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x80ec('0xc'))};var mailRpc=require(_0x80ec('0xd'));exports['consequence']=function(_0x13a0b6,_0x17c83b,_0x8188e8,_0x329e5c){return function(_0x3893b8){try{var _0x111c28=this['channel'];if(_0x111c28===_0x80ec('0xe')&&_0x329e5c[_0x80ec('0xf')]['isAutoreply']){logger[_0x80ec('0x10')](_0x80ec('0x11'),_0x13a0b6,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x3893b8[_0x80ec('0x12')]();}if(_0x17c83b[0x0]==='1'&&(_['isNil'](this[_0x80ec('0x13')][_0x80ec('0x14')])||!this[_0x80ec('0x13')][_0x80ec('0x14')])){logger['info'](_0x80ec('0x11'),_0x13a0b6,_0x80ec('0x15'));return _0x3893b8['next']();}if(_0x17c83b[0x0]==='2'&&this[_0x80ec('0x13')]['autoreplyExecuted']){logger[_0x80ec('0x10')](_0x80ec('0x16'),_0x13a0b6,_0x80ec('0x17'));return _0x3893b8['next']();}var _0x4c594c={'ContactId':this[_0x80ec('0x18')]['id'],'sentAt':moment()[_0x80ec('0x19')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x80ec('0x1a')};if(this[_0x80ec('0x1b')]===_0x80ec('0xe')){_0x4c594c[_0x80ec('0xf')]=utils[_0x80ec('0x1c')](_0x17c83b[0x2],this);}else{_0x4c594c[_0x80ec('0xf')]=utils['getMustacheRender'](_0x17c83b[0x1],this);}if(this[_0x80ec('0x1d')]){_0x4c594c['to']=this[_0x80ec('0x1d')][_0x80ec('0x1e')]||'';if(this[_0x80ec('0x1b')]===_0x80ec('0xe')&&_0x17c83b[0x1]==='1'){_0x4c594c['cc']=this[_0x80ec('0x1d')]['cc']||'';}_0x4c594c[_0x80ec('0x1e')]=this['message']['to']||'';_0x4c594c[_0x80ec('0x1f')]=this['message'][_0x80ec('0x1f')]||'';_0x4c594c['read']=!![];if(this[_0x80ec('0x1d')]['subject']){_0x4c594c[_0x80ec('0x20')]='';_0x4c594c[_0x80ec('0x20')]+=_[_0x80ec('0x21')](this[_0x80ec('0x1d')][_0x80ec('0x20')],_0x80ec('0x22'))?'':_0x80ec('0x23');_0x4c594c['subject']+=this['message'][_0x80ec('0x20')];}}if(this['channel']==='chat'){_0x4c594c[_0x80ec('0x24')]=this[_0x80ec('0x25')]['id'];}else{_0x4c594c[_[_0x80ec('0x26')](this['channel'])+_0x80ec('0x27')]=this[_0x80ec('0x25')]['id'];}_0x4c594c[_[_0x80ec('0x26')](this[_0x80ec('0x1b')])+_0x80ec('0x28')]=this[_0x80ec('0x13')]['id'];var _0x258a60=this['interaction'];if(rpc[this[_0x80ec('0x1b')]+'Message']){if(this[_0x80ec('0x1b')]==='mail'){_0x4c594c[_0x80ec('0x29')]=this[_0x80ec('0x1d')][_0x80ec('0x2a')];_0x4c594c[_0x80ec('0x2b')]=''+_['replace'](_0x4c594c[_0x80ec('0xf')],']+(>|$)/g,''),'priorityTrue':_0x555fc7[0x1],'priorityFalse':_0x555fc7[0x2]};var _0x4ad4b5=gotoif[_0x63ec('0x0')](_0x1d2f44,{'typecast':!![]});if(_0x4ad4b5['length']){logger[_0x63ec('0xa')]('[%s][GOTOIF]\x20%s',_0x2b8806,_[_0x63ec('0xb')](_0x4ad4b5,_0x63ec('0xc'))[_0x63ec('0xd')](',\x20'));_0x1e5a4f[_0x63ec('0xe')]();}else{try{var _0x298c1c=eval('('+_0x1d2f44[_0x63ec('0xf')]+')');var _0x2e2cdc=_0x298c1c?_0x1d2f44['priorityTrue']:_0x1d2f44[_0x63ec('0x10')];logger[_0x63ec('0x11')](_0x63ec('0x12'),_0x2b8806,_0x1d2f44['condition'],_0x298c1c,_0x2e2cdc||_0x63ec('0x13'));if(_0x2e2cdc){var _0x27ca5d=_[_0x63ec('0x14')](_0x1e5a4f[_0x63ec('0x15')](),{'p':_0x2e2cdc});if(_0x27ca5d>=0x0){logger[_0x63ec('0x11')](_0x63ec('0x16'),_0x2b8806,_0x2e2cdc||_0x63ec('0x13'),_0x27ca5d);_0x1e5a4f[_0x63ec('0x13')](_0x27ca5d);}else{logger[_0x63ec('0x11')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x2b8806,_0x2e2cdc||_0x63ec('0x13'));_0x1e5a4f['stop']();}}else{_0x1e5a4f['next']();}}catch(_0x13bc65){logger['error'](_0x63ec('0x17'),_0x2b8806,_0x13bc65[_0x63ec('0xc')]);_0x1e5a4f['stop']();}}}catch(_0x297c20){logger['error'](_0x63ec('0x18'),_0x2b8806,JSON[_0x63ec('0x19')](_0x297c20));_0x1e5a4f[_0x63ec('0xe')]();}};}; \ No newline at end of file +var _0xbe0e=['error','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','html-to-text','./utils','../../../../config/logger','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length','[%s][GOTOIF]\x20%s','map','message','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found'];(function(_0x8068d8,_0x21b563){var _0x3e9102=function(_0x4b0fa0){while(--_0x4b0fa0){_0x8068d8['push'](_0x8068d8['shift']());}};_0x3e9102(++_0x21b563);}(_0xbe0e,0x142));var _0xebe0=function(_0x4828a8,_0x480b6c){_0x4828a8=_0x4828a8-0x0;var _0x482723=_0xbe0e[_0x4828a8];return _0x482723;};'use strict';var schema=require(_0xebe0('0x0'));var _=require('lodash');var htmlToText=require(_0xebe0('0x1'));var utils=require(_0xebe0('0x2'));var logger=require(_0xebe0('0x3'))(_0xebe0('0x4'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0xebe0('0x5')},'priorityTrue':{'type':_0xebe0('0x6'),'message':_0xebe0('0x7')},'priorityFalse':{'type':_0xebe0('0x6'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0xebe0('0x8')]=function(_0x195309,_0x2a360a){return function(_0x3b2a4b){try{var _0x147c80={'condition':htmlToText[_0xebe0('0x9')](utils[_0xebe0('0xa')](_0x2a360a[0x0],this),{'wordwrap':![]})[_0xebe0('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x2a360a[0x1],'priorityFalse':_0x2a360a[0x2]};var _0x52468c=gotoif['validate'](_0x147c80,{'typecast':!![]});if(_0x52468c[_0xebe0('0xc')]){logger['error'](_0xebe0('0xd'),_0x195309,_[_0xebe0('0xe')](_0x52468c,_0xebe0('0xf'))['join'](',\x20'));_0x3b2a4b[_0xebe0('0x10')]();}else{try{var _0x5eb7d5=eval('('+_0x147c80[_0xebe0('0x11')]+')');var _0x150353=_0x5eb7d5?_0x147c80[_0xebe0('0x12')]:_0x147c80[_0xebe0('0x13')];logger[_0xebe0('0x14')](_0xebe0('0x15'),_0x195309,_0x147c80[_0xebe0('0x11')],_0x5eb7d5,_0x150353||'next');if(_0x150353){var _0x1d9e76=_['findIndex'](_0x3b2a4b[_0xebe0('0x16')](),{'p':_0x150353});if(_0x1d9e76>=0x0){logger[_0xebe0('0x14')](_0xebe0('0x17'),_0x195309,_0x150353||_0xebe0('0x18'),_0x1d9e76);_0x3b2a4b['next'](_0x1d9e76);}else{logger[_0xebe0('0x14')](_0xebe0('0x19'),_0x195309,_0x150353||_0xebe0('0x18'));_0x3b2a4b[_0xebe0('0x10')]();}}else{_0x3b2a4b[_0xebe0('0x18')]();}}catch(_0x4707e1){logger[_0xebe0('0x1a')](_0xebe0('0x1b'),_0x195309,_0x4707e1[_0xebe0('0xf')]);_0x3b2a4b[_0xebe0('0x10')]();}}}catch(_0x37a9e9){logger[_0xebe0('0x1a')](_0xebe0('0xd'),_0x195309,JSON[_0xebe0('0x1c')](_0x37a9e9));_0x3b2a4b[_0xebe0('0x10')]();}};}; \ 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 096aa71..d6bea88 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 _0xc1b3=['map','join','info','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stringify','validate','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s'];(function(_0x5f3424,_0x2fbb96){var _0x4fbd4a=function(_0x4d286f){while(--_0x4d286f){_0x5f3424['push'](_0x5f3424['shift']());}};_0x4fbd4a(++_0x2fbb96);}(_0xc1b3,0xa9));var _0x3c1b=function(_0x1b3e1e,_0xb24b96){_0x1b3e1e=_0x1b3e1e-0x0;var _0x4c4969=_0xc1b3[_0x1b3e1e];return _0x4c4969;};'use strict';var schema=require(_0x3c1b('0x0'));var _=require('lodash');var logger=require('../../../../config/logger')('routing');var gotop=schema({'priority':{'type':_0x3c1b('0x1'),'required':!![],'message':_0x3c1b('0x2')}});exports[_0x3c1b('0x3')]=function(_0x5e972b,_0x264156){return function(_0x2de779){try{var _0x3d40cc={'priority':_0x264156[0x0]};var _0x560f74=gotop[_0x3c1b('0x0')](_0x3d40cc,{'typecast':!![]});if(_0x560f74[_0x3c1b('0x4')]){logger[_0x3c1b('0x5')](_0x3c1b('0x6'),_0x5e972b,_[_0x3c1b('0x7')](_0x560f74,'message')[_0x3c1b('0x8')](',\x20'));_0x2de779['stop']();}else{logger[_0x3c1b('0x9')]('[%s][GOTOP]\x20priority\x20%s',_0x5e972b,_0x3d40cc['priority']);if(_0x3d40cc[_0x3c1b('0xa')]){var _0x3b8b22=_[_0x3c1b('0xb')](_0x2de779[_0x3c1b('0xc')](),{'p':_0x3d40cc[_0x3c1b('0xa')]});if(_0x3b8b22>=0x0){logger[_0x3c1b('0x9')](_0x3c1b('0xd'),_0x5e972b,_0x3d40cc['priority']||_0x3c1b('0xe'),_0x3b8b22);_0x2de779[_0x3c1b('0xe')](_0x3b8b22);}else{logger[_0x3c1b('0x9')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x5e972b,_0x3d40cc[_0x3c1b('0xa')]||_0x3c1b('0xe'));_0x2de779['stop']();}}else{_0x2de779[_0x3c1b('0xe')]();}}}catch(_0xfa772d){logger[_0x3c1b('0x5')](_0x3c1b('0x6'),_0x5e972b,JSON[_0x3c1b('0xf')](_0xfa772d));_0x2de779['stop']();}};}; \ No newline at end of file +var _0x91fb=['error','map','message','stop','priority','info','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','[%s][GOTOP]\x20%s','stringify','validate','lodash','../../../../config/logger','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length'];(function(_0x344aa0,_0x3e96bc){var _0x2346de=function(_0x2d92d5){while(--_0x2d92d5){_0x344aa0['push'](_0x344aa0['shift']());}};_0x2346de(++_0x3e96bc);}(_0x91fb,0x10a));var _0xb91f=function(_0x38b2d9,_0x19fd42){_0x38b2d9=_0x38b2d9-0x0;var _0x23a3e1=_0x91fb[_0x38b2d9];return _0x23a3e1;};'use strict';var schema=require(_0xb91f('0x0'));var _=require(_0xb91f('0x1'));var logger=require(_0xb91f('0x2'))('routing');var gotop=schema({'priority':{'type':'number','required':!![],'message':_0xb91f('0x3')}});exports[_0xb91f('0x4')]=function(_0x5eacbe,_0x4854f4){return function(_0x257b57){try{var _0x45049f={'priority':_0x4854f4[0x0]};var _0x5b62f8=gotop[_0xb91f('0x0')](_0x45049f,{'typecast':!![]});if(_0x5b62f8[_0xb91f('0x5')]){logger[_0xb91f('0x6')]('[%s][GOTOP]\x20%s',_0x5eacbe,_[_0xb91f('0x7')](_0x5b62f8,_0xb91f('0x8'))['join'](',\x20'));_0x257b57[_0xb91f('0x9')]();}else{logger['info']('[%s][GOTOP]\x20priority\x20%s',_0x5eacbe,_0x45049f[_0xb91f('0xa')]);if(_0x45049f['priority']){var _0x2a3f30=_['findIndex'](_0x257b57['rules'](),{'p':_0x45049f[_0xb91f('0xa')]});if(_0x2a3f30>=0x0){logger[_0xb91f('0xb')](_0xb91f('0xc'),_0x5eacbe,_0x45049f['priority']||'next',_0x2a3f30);_0x257b57[_0xb91f('0xd')](_0x2a3f30);}else{logger[_0xb91f('0xb')](_0xb91f('0xe'),_0x5eacbe,_0x45049f['priority']||'next');_0x257b57['stop']();}}else{_0x257b57['next']();}}}catch(_0x48b040){logger[_0xb91f('0x6')](_0xb91f('0xf'),_0x5eacbe,JSON[_0xb91f('0x10')](_0x48b040));_0x257b57[_0xb91f('0x9')]();}};}; \ 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 c7ca3df..97a0ae8 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 _0x7e7b=['./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','ChatWebsiteId','upperFirst','channel','AccountId','account','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','catch','error','stringify','stop','lodash'];(function(_0x2644f8,_0x40977c){var _0x233fea=function(_0x308f49){while(--_0x308f49){_0x2644f8['push'](_0x2644f8['shift']());}};_0x233fea(++_0x40977c);}(_0x7e7b,0x133));var _0xb7e7=function(_0x45f0d3,_0xc3f785){_0x45f0d3=_0x45f0d3-0x0;var _0x160650=_0x7e7b[_0x45f0d3];return _0x160650;};'use strict';var _=require(_0xb7e7('0x0'));var utils=require(_0xb7e7('0x1'));var logger=require('../../../../config/logger')(_0xb7e7('0x2'));var rpc={'chatMessage':require(_0xb7e7('0x3')),'openchannelMessage':require(_0xb7e7('0x4')),'mailMessage':require(_0xb7e7('0x5')),'smsMessage':require(_0xb7e7('0x6')),'faxMessage':require(_0xb7e7('0x7')),'whatsappMessage':require(_0xb7e7('0x8'))};exports[_0xb7e7('0x9')]=function(_0x1f2c48,_0x4d4fa8){return function(_0x4c1ca6){try{var _0x2c95f8={'body':utils[_0xb7e7('0xa')](_0x4d4fa8[0x0],this),'ContactId':this[_0xb7e7('0xb')]['id']};if(this['channel']==='chat'){_0x2c95f8[_0xb7e7('0xc')]=this['account']['id'];}else{_0x2c95f8[_[_0xb7e7('0xd')](this[_0xb7e7('0xe')])+_0xb7e7('0xf')]=this[_0xb7e7('0x10')]['id'];}_0x2c95f8[_['upperFirst'](this['channel'])+'InteractionId']=this[_0xb7e7('0x11')]['id'];if(rpc[this[_0xb7e7('0xe')]+_0xb7e7('0x12')]){return rpc[this['channel']+_0xb7e7('0x12')][_0xb7e7('0x13')](_0x2c95f8)[_0xb7e7('0x14')](function(_0x4169f6){logger[_0xb7e7('0x15')](_0xb7e7('0x16'),_0x1f2c48,_0x2c95f8[_0xb7e7('0x17')]);_0x4c1ca6['next']();})[_0xb7e7('0x18')](function(_0x516fd6){logger[_0xb7e7('0x19')](_0xb7e7('0x16'),_0x1f2c48,JSON[_0xb7e7('0x1a')](_0x516fd6));_0x4c1ca6[_0xb7e7('0x1b')]();});}}catch(_0x9b5106){logger[_0xb7e7('0x19')](_0xb7e7('0x16'),_0x1f2c48,JSON[_0xb7e7('0x1a')](_0x9b5106));_0x4c1ca6['stop']();}};}; \ No newline at end of file +var _0x8137=['body','next','catch','error','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','Message','create','then','info'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x8137,0x11d));var _0x7813=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x8137[_0x819464];return _0x49dcc0;};'use strict';var _=require(_0x7813('0x0'));var utils=require(_0x7813('0x1'));var logger=require(_0x7813('0x2'))(_0x7813('0x3'));var rpc={'chatMessage':require(_0x7813('0x4')),'openchannelMessage':require(_0x7813('0x5')),'mailMessage':require(_0x7813('0x6')),'smsMessage':require(_0x7813('0x7')),'faxMessage':require(_0x7813('0x8')),'whatsappMessage':require(_0x7813('0x9'))};exports[_0x7813('0xa')]=function(_0x18ab75,_0xa6a513){return function(_0x2a3ad0){try{var _0x953086={'body':utils[_0x7813('0xb')](_0xa6a513[0x0],this),'ContactId':this[_0x7813('0xc')]['id']};if(this[_0x7813('0xd')]===_0x7813('0xe')){_0x953086[_0x7813('0xf')]=this[_0x7813('0x10')]['id'];}else{_0x953086[_[_0x7813('0x11')](this[_0x7813('0xd')])+_0x7813('0x12')]=this[_0x7813('0x10')]['id'];}_0x953086[_[_0x7813('0x11')](this[_0x7813('0xd')])+_0x7813('0x13')]=this[_0x7813('0x14')]['id'];if(rpc[this[_0x7813('0xd')]+_0x7813('0x15')]){return rpc[this[_0x7813('0xd')]+_0x7813('0x15')][_0x7813('0x16')](_0x953086)[_0x7813('0x17')](function(_0x2ae2c6){logger[_0x7813('0x18')]('[%s][MESSAGE]\x20%s',_0x18ab75,_0x953086[_0x7813('0x19')]);_0x2a3ad0[_0x7813('0x1a')]();})[_0x7813('0x1b')](function(_0x28b275){logger[_0x7813('0x1c')]('[%s][MESSAGE]\x20%s',_0x18ab75,JSON[_0x7813('0x1d')](_0x28b275));_0x2a3ad0[_0x7813('0x1e')]();});}}catch(_0x48f874){logger[_0x7813('0x1c')]('[%s][MESSAGE]\x20%s',_0x18ab75,JSON[_0x7813('0x1d')](_0x48f874));_0x2a3ad0[_0x7813('0x1e')]();}};}; \ 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 95dc69c..1666c3e 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 _0xd760=['stop','./utils','routing','[%s][NOOP]\x20%s','getMustacheRender','error','stringify'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd760,0x71));var _0x0d76=function(_0x511c83,_0x1210eb){_0x511c83=_0x511c83-0x0;var _0xad55f3=_0xd760[_0x511c83];return _0xad55f3;};'use strict';var utils=require(_0x0d76('0x0'));var logger=require('../../../../config/logger')(_0x0d76('0x1'));exports['consequence']=function(_0xe4cf3d,_0x1acd3b){return function(_0x1889c4){try{logger['info'](_0x0d76('0x2'),_0xe4cf3d,utils[_0x0d76('0x3')](_0x1acd3b[0x0],this));_0x1889c4['next']();}catch(_0x415439){logger[_0x0d76('0x4')]('[%s][NOOP]\x20%s',_0xe4cf3d,JSON[_0x0d76('0x5')](_0x415439));_0x1889c4[_0x0d76('0x6')]();}};}; \ No newline at end of file +var _0xbc7b=['routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','error','stop','../../../../config/logger'];(function(_0xb70970,_0x25e21a){var _0x4dbfa5=function(_0x571c83){while(--_0x571c83){_0xb70970['push'](_0xb70970['shift']());}};_0x4dbfa5(++_0x25e21a);}(_0xbc7b,0xd7));var _0xbbc7=function(_0x1dab81,_0x757c64){_0x1dab81=_0x1dab81-0x0;var _0x5636cb=_0xbc7b[_0x1dab81];return _0x5636cb;};'use strict';var utils=require('./utils');var logger=require(_0xbbc7('0x0'))(_0xbbc7('0x1'));exports[_0xbbc7('0x2')]=function(_0x2c3d8f,_0x576560){return function(_0xa7b121){try{logger[_0xbbc7('0x3')](_0xbbc7('0x4'),_0x2c3d8f,utils[_0xbbc7('0x5')](_0x576560[0x0],this));_0xa7b121['next']();}catch(_0x33fe2d){logger[_0xbbc7('0x6')]('[%s][NOOP]\x20%s',_0x2c3d8f,JSON['stringify'](_0x33fe2d));_0xa7b121[_0xbbc7('0x7')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index 171a19e..018b7d4 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 _0x5801=['length','map','join','stop','find','createQueue','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','stack','validate','lodash','seq-queue','ioredis','./strategy','defaults','redis','socket.io-emitter','queue_id','account','from','joinAt','emit','clone','queue','push','capitalize','InteractionId','format','%sQueuesWaitingInteractions','pick','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','../../rpc/chatInteraction','../../rpc/faxInteraction','../../rpc/mailInteraction','../../rpc/openchannelInteraction','../../rpc/whatsappInteraction','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','interaction','MessageId','message','chat','AccountId','WebsiteId','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','info','[%s][STOP:QUEUE][NAME:%s]','Interaction','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase'];(function(_0x4ac60a,_0x503a99){var _0x4b22e8=function(_0x145c47){while(--_0x145c47){_0x4ac60a['push'](_0x4ac60a['shift']());}};_0x4b22e8(++_0x503a99);}(_0x5801,0x115));var _0x1580=function(_0x208034,_0x4e16d6){_0x208034=_0x208034-0x0;var _0x8e160a=_0x5801[_0x208034];return _0x8e160a;};'use strict';var schema=require(_0x1580('0x0'));var _=require(_0x1580('0x1'));var util=require('util');var seqqueue=require(_0x1580('0x2'));var moment=require('moment');var Redis=require(_0x1580('0x3'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('routing');var strategy=require(_0x1580('0x4'));config['redis']=_[_0x1580('0x5')](config[_0x1580('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x1580('0x7'))(new Redis(config[_0x1580('0x6')]));var attributes=['id',_0x1580('0x8'),_0x1580('0x9'),'queue',_0x1580('0xa'),_0x1580('0xb')];function emit(_0x1d91e8,_0x33a959,_0x325b75){io['to'](_0x1d91e8)[_0x1580('0xc')](_0x33a959,_0x325b75);}function emitChannelQueueInteraction(_0x446004,_0x52d1f8,_0x346e2a,_0x1f7ebe,_0x1d9660,_0x54eac8,_0x5812ee,_0xad296e){var _0x5047e5=_[_0x1580('0xd')](_0x346e2a);_0x5047e5[_0x1580('0x8')]=_0xad296e;_0x5047e5[_0x1580('0xe')]=_0x52d1f8;_0x5047e5[_0x1580('0x9')]=_0x1f7ebe;_0x5047e5['id']=_0x1d9660;if(_0x54eac8){attributes[_0x1580('0xf')](_[_0x1580('0x10')](_0x446004)+_0x1580('0x11'));_0x5812ee[util[_0x1580('0x12')](_0x1580('0x13'),_0x446004)][_0x1d9660]=_[_0x1580('0x14')](_0x5047e5,attributes);}else{delete _0x5812ee[util[_0x1580('0x12')]('%sQueuesWaitingInteractions',_0x446004)][_0x1d9660];}emit(util['format']('%s:queue:%s',_0x446004,_0x52d1f8),util[_0x1580('0x12')](_0x1580('0x15'),_0x446004,_0x54eac8?_0x1580('0x16'):_0x1580('0x17')),_['pick'](_0x5047e5,attributes));}var rpc={'openchannelQueueReport':require(_0x1580('0x18')),'mailQueueReport':require(_0x1580('0x19')),'chatQueueReport':require(_0x1580('0x1a')),'smsQueueReport':require(_0x1580('0x1b')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x1580('0x1c')),'chatInteraction':require(_0x1580('0x1d')),'faxInteraction':require(_0x1580('0x1e')),'mailInteraction':require(_0x1580('0x1f')),'openchannelInteraction':require(_0x1580('0x20')),'smsInteraction':require('../../rpc/smsInteraction'),'whatsappInteraction':require(_0x1580('0x21'))};var queue=schema({'name':{'type':_0x1580('0x22'),'required':!![],'message':_0x1580('0x23')},'timeout':{'type':_0x1580('0x24'),'message':_0x1580('0x25')}});function startRouting(_0x3e8826,_0x2dab3c,_0x5b0afe,_0x14ee46){if(_0x3e8826&&_0x2dab3c&&_0x5b0afe){_0x2dab3c[_0x1580('0x26')]+=0x1;var _0x54a463={'uniqueid':_0x3e8826,'from':_0x5b0afe[_0x1580('0x27')]?_0x5b0afe[_0x1580('0x27')][_0x1580('0xa')]:'','joinAt':moment()['format'](_0x1580('0x28')),'ContactId':_0x5b0afe['contact']?_0x5b0afe[_0x1580('0x29')]['id']:null,'ListId':_0x5b0afe[_0x1580('0x2a')]?_0x5b0afe['list']['id']:null};_0x54a463[_[_0x1580('0x2b')](_0x5b0afe[_0x1580('0x2c')])+_0x1580('0x2d')]=_0x2dab3c['id']||null;_0x54a463[_['upperFirst'](_0x5b0afe['channel'])+_0x1580('0x11')]=_0x5b0afe[_0x1580('0x2e')]?_0x5b0afe[_0x1580('0x2e')]['id']:null;_0x54a463[_[_0x1580('0x2b')](_0x5b0afe[_0x1580('0x2c')])+_0x1580('0x2f')]=_0x5b0afe[_0x1580('0x30')]?_0x5b0afe[_0x1580('0x30')]['id']:null;_0x54a463[_[_0x1580('0x2b')](_0x5b0afe[_0x1580('0x2c')])+(_0x5b0afe['channel']!==_0x1580('0x31')?_0x1580('0x32'):_0x1580('0x33'))]=_0x5b0afe['account']?_0x5b0afe[_0x1580('0x9')]['id']:null;logger['info'](util[_0x1580('0x12')](_0x1580('0x34'),_0x3e8826,_0x2dab3c[_0x1580('0x35')]));emitChannelQueueInteraction(_0x5b0afe['channel'],_0x2dab3c[_0x1580('0x35')],_0x54a463,_0x5b0afe[_0x1580('0x9')][_0x1580('0x35')],_0x5b0afe['message']['id'],!![],_0x14ee46,_0x2dab3c['id']);if(rpc[_0x5b0afe['channel']+_0x1580('0x36')]){return rpc[_0x5b0afe[_0x1580('0x2c')]+_0x1580('0x36')][_0x1580('0x37')](_0x54a463)[_0x1580('0x38')](function(_0x29311f){logger[_0x1580('0x39')](_0x1580('0x3a'),_0x29311f);});}}}function stopRouting(_0x2707ea,_0x468e34,_0x4f8d50,_0x24b7fe){if(_0x2707ea&&_0x468e34){_0x468e34[_0x1580('0x26')]-=0x1;var _0x380d11={'leaveAt':moment()[_0x1580('0x12')](_0x1580('0x28')),'acceptAt':moment()[_0x1580('0x12')](_0x1580('0x28')),'reason':'accepted'};logger[_0x1580('0x3b')](util[_0x1580('0x12')](_0x1580('0x3c'),_0x2707ea,_0x468e34[_0x1580('0x35')]));emitChannelQueueInteraction(_0x4f8d50[_0x1580('0x2c')],_0x468e34[_0x1580('0x35')],_0x4f8d50[_0x1580('0x27')],_0x4f8d50['account'][_0x1580('0x35')],_0x4f8d50['message']['id'],![],_0x24b7fe,_0x468e34['id']);return rpc[_0x4f8d50[_0x1580('0x2c')]+_0x1580('0x3d')]['update'](_0x4f8d50[_0x1580('0x2e')]['id'],{'queueId':_0x468e34['id']})['then'](function(){if(rpc[_0x4f8d50[_0x1580('0x2c')]+_0x1580('0x36')]){return rpc[_0x4f8d50[_0x1580('0x2c')]+_0x1580('0x36')][_0x1580('0x3e')](_0x2707ea,_0x380d11)[_0x1580('0x38')](function(_0x605a33){logger[_0x1580('0x39')](_0x1580('0x3f'),_0x605a33);});}});}}function endRouting(_0x3f1222,_0xe723bb,_0x57b51f,_0x5ae37f){if(_0x3f1222&&_0xe723bb){_0xe723bb[_0x1580('0x26')]-=0x1;var _0x115e18={'leaveAt':moment()[_0x1580('0x12')](_0x1580('0x28')),'exitAt':moment()['format'](_0x1580('0x28')),'reason':_0x1580('0x40')};logger[_0x1580('0x3b')](util[_0x1580('0x12')](_0x1580('0x41'),_0x3f1222,_0xe723bb['name']));emitChannelQueueInteraction(_0x57b51f[_0x1580('0x2c')],_0xe723bb[_0x1580('0x35')],_0x57b51f['body'],_0x57b51f[_0x1580('0x9')]['name'],_0x57b51f[_0x1580('0x30')]['id'],![],_0x5ae37f);if(rpc[_0x57b51f['channel']+'QueueReport']){return rpc[_0x57b51f[_0x1580('0x2c')]+_0x1580('0x36')]['update'](_0x3f1222,_0x115e18)[_0x1580('0x38')](function(_0x2dc1aa){logger['error'](_0x1580('0x3f'),_0x2dc1aa);});}}}function handleFindQueue(_0x5e411f){return function(_0x15c747){return _0x15c747[_0x1580('0x35')][_0x1580('0x42')]()===_0x5e411f[_0x1580('0x42')]();};}exports['consequence']=function(_0x16b2c1,_0x376bfe,_0x6eb9cd,_0x104ba6){return function(_0x24857d){try{var _0xb11afe={'name':_0x376bfe[0x0],'timeout':_0x376bfe[0x1]};var _0x34c0a1=queue[_0x1580('0x0')](_0xb11afe,{'typecast':!![]});if(_0x34c0a1[_0x1580('0x43')]){logger[_0x1580('0x39')]('[%s][QUEUE]\x20%s',_0x16b2c1,_[_0x1580('0x44')](_0x34c0a1,_0x1580('0x30'))[_0x1580('0x45')](',\x20'));_0x24857d[_0x1580('0x46')]();}else{var _0x10cbeb=_[_0x1580('0x47')](_0x6eb9cd[_0x104ba6['channel']+'Queues'],handleFindQueue(_0xb11afe[_0x1580('0x35')]));if(_0x10cbeb){startRouting(_0x16b2c1,_0x10cbeb,_0x104ba6,_0x6eb9cd);var _0x4bfe71=(_0x10cbeb['timeout']||0xa)*0x3e8;var _0x40076a=(_0xb11afe['timeout']||0x14)*0x3e8;var _0x416676;if(_0x4bfe71>_0x40076a){_0x40076a=_0x4bfe71;}var _0xdaec9c=seqqueue[_0x1580('0x48')](_0x4bfe71);_0xdaec9c['id']=_0x16b2c1;_0xdaec9c['atimeout']=_0x4bfe71;_0xdaec9c[_0x1580('0x49')]=_0x40076a;_0xdaec9c[_0x1580('0x2c')]=_0x104ba6['channel'];_0x6eb9cd[_0x1580('0x4a')][_0x16b2c1]['on'](_0x1580('0x4b'),function(){logger[_0x1580('0x3b')](_0x1580('0x4c'),_0x16b2c1);stopRouting(_0x16b2c1,_0x10cbeb,_0x104ba6,_0x6eb9cd);clearTimeout(_0x416676);_0x416676=undefined;_0xdaec9c[_0x1580('0x4d')](!![]);if(_0x6eb9cd[_0x1580('0x4a')][_0x16b2c1]){delete _0x6eb9cd[_0x1580('0x4a')][_0x16b2c1];}_0x24857d[_0x1580('0x46')]();});_0x6eb9cd['rules'][_0x16b2c1]['on'](_0x1580('0x4e'),function(){if(_0x6eb9cd[_0x1580('0x4a')][_0x16b2c1]){delete _0x6eb9cd[_0x1580('0x4a')][_0x16b2c1];}});_0x416676=setTimeout(function(){logger['info'](_0x1580('0x4f'),_0x16b2c1);endRouting(_0x16b2c1,_0x10cbeb,_0x104ba6,_0x6eb9cd);clearTimeout(_0x416676);_0xdaec9c[_0x1580('0x4d')](!![]);_0x24857d['next']();},_0x40076a);switch(_0x10cbeb[_0x1580('0x50')]){case _0x1580('0x51'):strategy[_0x1580('0x51')](_0xdaec9c,_0x10cbeb,_0x6eb9cd,_0x104ba6);break;default:strategy[_0x1580('0x52')](_0xdaec9c,_0x10cbeb,_0x6eb9cd,_0x104ba6);}}else{logger[_0x1580('0x39')](_0x1580('0x53'),_0x16b2c1,_0xb11afe[_0x1580('0x35')]);_0x24857d[_0x1580('0x46')]();}}}catch(_0x2840db){logger['error'](_0x1580('0x54'),_0x16b2c1,_0x2840db[_0x1580('0x55')]);_0x24857d[_0x1580('0x46')]();}};}; \ No newline at end of file +var _0x8174=['./strategy','defaults','redis','localhost','socket.io-emitter','queue_id','account','queue','from','joinAt','emit','clone','push','capitalize','InteractionId','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','../../rpc/chatInteraction','../../rpc/faxInteraction','../../rpc/smsInteraction','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','waiting','body','contact','list','channel','QueueId','upperFirst','interaction','MessageId','message','chat','AccountId','WebsiteId','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','accepted','[%s][STOP:QUEUE][NAME:%s]','Interaction','update','then','update\x20queue\x20report','timeout','info','[%s][END:QUEUE][NAME:%s]','toLowerCase','length','[%s][QUEUE]\x20%s','join','stop','find','Queues','rules','end','close','[%s][QUEUE]\x20APPLICATION\x20END','next','rrmemory','beepall','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','routing'];(function(_0x39a1c4,_0x5b25d5){var _0x283d28=function(_0x4433f8){while(--_0x4433f8){_0x39a1c4['push'](_0x39a1c4['shift']());}};_0x283d28(++_0x5b25d5);}(_0x8174,0xf7));var _0x4817=function(_0x3efe87,_0x35ad48){_0x3efe87=_0x3efe87-0x0;var _0x56a4cc=_0x8174[_0x3efe87];return _0x56a4cc;};'use strict';var schema=require(_0x4817('0x0'));var _=require(_0x4817('0x1'));var util=require(_0x4817('0x2'));var seqqueue=require(_0x4817('0x3'));var moment=require(_0x4817('0x4'));var Redis=require(_0x4817('0x5'));var config=require(_0x4817('0x6'));var logger=require('../../../../config/logger')(_0x4817('0x7'));var strategy=require(_0x4817('0x8'));config['redis']=_[_0x4817('0x9')](config[_0x4817('0xa')],{'host':_0x4817('0xb'),'port':0x18eb});var io=require(_0x4817('0xc'))(new Redis(config[_0x4817('0xa')]));var attributes=['id',_0x4817('0xd'),_0x4817('0xe'),_0x4817('0xf'),_0x4817('0x10'),_0x4817('0x11')];function emit(_0x23c9cb,_0x523610,_0x7a53ef){io['to'](_0x23c9cb)[_0x4817('0x12')](_0x523610,_0x7a53ef);}function emitChannelQueueInteraction(_0x286a38,_0xf225fa,_0x4fb7fa,_0x14c271,_0x53b5ec,_0x585be3,_0x476935,_0x52e0c0){var _0x5b4158=_[_0x4817('0x13')](_0x4fb7fa);_0x5b4158['queue_id']=_0x52e0c0;_0x5b4158[_0x4817('0xf')]=_0xf225fa;_0x5b4158[_0x4817('0xe')]=_0x14c271;_0x5b4158['id']=_0x53b5ec;if(_0x585be3){attributes[_0x4817('0x14')](_[_0x4817('0x15')](_0x286a38)+_0x4817('0x16'));_0x476935[util[_0x4817('0x17')](_0x4817('0x18'),_0x286a38)][_0x53b5ec]=_[_0x4817('0x19')](_0x5b4158,attributes);}else{delete _0x476935[util['format']('%sQueuesWaitingInteractions',_0x286a38)][_0x53b5ec];}emit(util['format'](_0x4817('0x1a'),_0x286a38,_0xf225fa),util['format'](_0x4817('0x1b'),_0x286a38,_0x585be3?_0x4817('0x1c'):_0x4817('0x1d')),_[_0x4817('0x19')](_0x5b4158,attributes));}var rpc={'openchannelQueueReport':require(_0x4817('0x1e')),'mailQueueReport':require(_0x4817('0x1f')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0x4817('0x20')),'whatsappQueueReport':require(_0x4817('0x21')),'chatInteraction':require(_0x4817('0x22')),'faxInteraction':require(_0x4817('0x23')),'mailInteraction':require('../../rpc/mailInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x4817('0x24')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var queue=schema({'name':{'type':_0x4817('0x25'),'required':!![],'message':_0x4817('0x26')},'timeout':{'type':_0x4817('0x27'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x3cf417,_0x584570,_0x483dbd,_0x49b87e){if(_0x3cf417&&_0x584570&&_0x483dbd){_0x584570[_0x4817('0x28')]+=0x1;var _0x26e43c={'uniqueid':_0x3cf417,'from':_0x483dbd[_0x4817('0x29')]?_0x483dbd['body'][_0x4817('0x10')]:'','joinAt':moment()[_0x4817('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x483dbd[_0x4817('0x2a')]?_0x483dbd[_0x4817('0x2a')]['id']:null,'ListId':_0x483dbd['list']?_0x483dbd[_0x4817('0x2b')]['id']:null};_0x26e43c[_['upperFirst'](_0x483dbd[_0x4817('0x2c')])+_0x4817('0x2d')]=_0x584570['id']||null;_0x26e43c[_[_0x4817('0x2e')](_0x483dbd[_0x4817('0x2c')])+'InteractionId']=_0x483dbd['interaction']?_0x483dbd[_0x4817('0x2f')]['id']:null;_0x26e43c[_[_0x4817('0x2e')](_0x483dbd['channel'])+_0x4817('0x30')]=_0x483dbd['message']?_0x483dbd[_0x4817('0x31')]['id']:null;_0x26e43c[_['upperFirst'](_0x483dbd[_0x4817('0x2c')])+(_0x483dbd[_0x4817('0x2c')]!==_0x4817('0x32')?_0x4817('0x33'):_0x4817('0x34'))]=_0x483dbd[_0x4817('0xe')]?_0x483dbd[_0x4817('0xe')]['id']:null;logger['info'](util[_0x4817('0x17')](_0x4817('0x35'),_0x3cf417,_0x584570[_0x4817('0x36')]));emitChannelQueueInteraction(_0x483dbd[_0x4817('0x2c')],_0x584570[_0x4817('0x36')],_0x26e43c,_0x483dbd['account'][_0x4817('0x36')],_0x483dbd[_0x4817('0x31')]['id'],!![],_0x49b87e,_0x584570['id']);if(rpc[_0x483dbd[_0x4817('0x2c')]+_0x4817('0x37')]){return rpc[_0x483dbd['channel']+_0x4817('0x37')][_0x4817('0x38')](_0x26e43c)[_0x4817('0x39')](function(_0x5256d3){logger[_0x4817('0x3a')](_0x4817('0x3b'),_0x5256d3);});}}}function stopRouting(_0x2acd1d,_0x3d46dc,_0x30a422,_0x1ac045){if(_0x2acd1d&&_0x3d46dc){_0x3d46dc[_0x4817('0x28')]-=0x1;var _0x188dd8={'leaveAt':moment()[_0x4817('0x17')](_0x4817('0x3c')),'acceptAt':moment()[_0x4817('0x17')](_0x4817('0x3c')),'reason':_0x4817('0x3d')};logger['info'](util[_0x4817('0x17')](_0x4817('0x3e'),_0x2acd1d,_0x3d46dc[_0x4817('0x36')]));emitChannelQueueInteraction(_0x30a422['channel'],_0x3d46dc[_0x4817('0x36')],_0x30a422[_0x4817('0x29')],_0x30a422[_0x4817('0xe')][_0x4817('0x36')],_0x30a422['message']['id'],![],_0x1ac045,_0x3d46dc['id']);return rpc[_0x30a422[_0x4817('0x2c')]+_0x4817('0x3f')][_0x4817('0x40')](_0x30a422['interaction']['id'],{'queueId':_0x3d46dc['id']})[_0x4817('0x41')](function(){if(rpc[_0x30a422[_0x4817('0x2c')]+_0x4817('0x37')]){return rpc[_0x30a422['channel']+'QueueReport'][_0x4817('0x40')](_0x2acd1d,_0x188dd8)[_0x4817('0x39')](function(_0x4785fb){logger[_0x4817('0x3a')](_0x4817('0x42'),_0x4785fb);});}});}}function endRouting(_0x9676eb,_0x397e2b,_0x4d68f3,_0x2e1a56){if(_0x9676eb&&_0x397e2b){_0x397e2b['waiting']-=0x1;var _0x2d2248={'leaveAt':moment()[_0x4817('0x17')](_0x4817('0x3c')),'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x4817('0x43')};logger[_0x4817('0x44')](util['format'](_0x4817('0x45'),_0x9676eb,_0x397e2b[_0x4817('0x36')]));emitChannelQueueInteraction(_0x4d68f3[_0x4817('0x2c')],_0x397e2b[_0x4817('0x36')],_0x4d68f3[_0x4817('0x29')],_0x4d68f3[_0x4817('0xe')][_0x4817('0x36')],_0x4d68f3[_0x4817('0x31')]['id'],![],_0x2e1a56);if(rpc[_0x4d68f3['channel']+_0x4817('0x37')]){return rpc[_0x4d68f3[_0x4817('0x2c')]+_0x4817('0x37')][_0x4817('0x40')](_0x9676eb,_0x2d2248)[_0x4817('0x39')](function(_0x954346){logger['error'](_0x4817('0x42'),_0x954346);});}}}function handleFindQueue(_0xd3b8a3){return function(_0x184ce3){return _0x184ce3['name'][_0x4817('0x46')]()===_0xd3b8a3[_0x4817('0x46')]();};}exports['consequence']=function(_0x4bd3fb,_0x2c0618,_0x5a330b,_0x77db9b){return function(_0x38e4b8){try{var _0x14a246={'name':_0x2c0618[0x0],'timeout':_0x2c0618[0x1]};var _0x15053f=queue['validate'](_0x14a246,{'typecast':!![]});if(_0x15053f[_0x4817('0x47')]){logger[_0x4817('0x3a')](_0x4817('0x48'),_0x4bd3fb,_['map'](_0x15053f,'message')[_0x4817('0x49')](',\x20'));_0x38e4b8[_0x4817('0x4a')]();}else{var _0x2dde92=_[_0x4817('0x4b')](_0x5a330b[_0x77db9b[_0x4817('0x2c')]+_0x4817('0x4c')],handleFindQueue(_0x14a246[_0x4817('0x36')]));if(_0x2dde92){startRouting(_0x4bd3fb,_0x2dde92,_0x77db9b,_0x5a330b);var _0x2a6d7a=(_0x2dde92['timeout']||0xa)*0x3e8;var _0x22b9b9=(_0x14a246[_0x4817('0x43')]||0x14)*0x3e8;var _0x1b68bb;if(_0x2a6d7a>_0x22b9b9){_0x22b9b9=_0x2a6d7a;}var _0x648807=seqqueue['createQueue'](_0x2a6d7a);_0x648807['id']=_0x4bd3fb;_0x648807['atimeout']=_0x2a6d7a;_0x648807['qtimeout']=_0x22b9b9;_0x648807[_0x4817('0x2c')]=_0x77db9b[_0x4817('0x2c')];_0x5a330b[_0x4817('0x4d')][_0x4bd3fb]['on'](_0x4817('0x4e'),function(){logger[_0x4817('0x44')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x4bd3fb);stopRouting(_0x4bd3fb,_0x2dde92,_0x77db9b,_0x5a330b);clearTimeout(_0x1b68bb);_0x1b68bb=undefined;_0x648807[_0x4817('0x4f')](!![]);if(_0x5a330b[_0x4817('0x4d')][_0x4bd3fb]){delete _0x5a330b[_0x4817('0x4d')][_0x4bd3fb];}_0x38e4b8[_0x4817('0x4a')]();});_0x5a330b[_0x4817('0x4d')][_0x4bd3fb]['on']('complete',function(){if(_0x5a330b[_0x4817('0x4d')][_0x4bd3fb]){delete _0x5a330b[_0x4817('0x4d')][_0x4bd3fb];}});_0x1b68bb=setTimeout(function(){logger[_0x4817('0x44')](_0x4817('0x50'),_0x4bd3fb);endRouting(_0x4bd3fb,_0x2dde92,_0x77db9b,_0x5a330b);clearTimeout(_0x1b68bb);_0x648807['close'](!![]);_0x38e4b8[_0x4817('0x51')]();},_0x22b9b9);switch(_0x2dde92['strategy']){case _0x4817('0x52'):strategy[_0x4817('0x52')](_0x648807,_0x2dde92,_0x5a330b,_0x77db9b);break;default:strategy[_0x4817('0x53')](_0x648807,_0x2dde92,_0x5a330b,_0x77db9b);}}else{logger[_0x4817('0x3a')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x4bd3fb,_0x14a246[_0x4817('0x36')]);_0x38e4b8[_0x4817('0x4a')]();}}}catch(_0x6462f8){logger[_0x4817('0x3a')](_0x4817('0x48'),_0x4bd3fb,_0x6462f8[_0x4817('0x54')]);_0x38e4b8[_0x4817('0x4a')]();}};}; \ 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 1db7283..06c8e27 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 _0xcb99=['busy','busyQueue','saveWaitingNotification','routing','writeLog','RINGING','forcedOwnership','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','removeWaitingNotification','TIMEOUT','lodash','./util','notificationId','squeue','realtime','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','debug','[%s][AGENT]\x20try\x20with\x20%s','agent','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel'];(function(_0x13518d,_0x5536b0){var _0x1fe3e8=function(_0x33d72c){while(--_0x33d72c){_0x13518d['push'](_0x13518d['shift']());}};_0x1fe3e8(++_0x5536b0);}(_0xcb99,0x8b));var _0x9cb9=function(_0xcb6d2b,_0x1a56ac){_0xcb6d2b=_0xcb6d2b-0x0;var _0x2c3687=_0xcb99[_0xcb6d2b];return _0x2c3687;};'use strict';var _=require(_0x9cb9('0x0'));var uuid=require('uuid');var util=require(_0x9cb9('0x1'));var logger=require('../../../../../config/logger')('routing');var Agent=function(_0x3a2f21,_0x1308a8,_0x124c48,_0x51f2ee){this[_0x9cb9('0x2')]=uuid['v4']();this[_0x9cb9('0x3')]=_0x3a2f21;this['agent']=_0x1308a8;this[_0x9cb9('0x4')]=_0x124c48;this['routing']=_0x51f2ee;this[_0x9cb9('0x3')][_0x9cb9('0x5')](this[_0x9cb9('0x6')][_0x9cb9('0x7')](this),this[_0x9cb9('0x8')][_0x9cb9('0x7')](this));this[_0x9cb9('0x3')]['on'](_0x9cb9('0x9'),this['handleTimeout']['bind'](this));this[_0x9cb9('0x3')]['on'](_0x9cb9('0xa'),this[_0x9cb9('0xb')]['bind'](this));};Agent[_0x9cb9('0xc')][_0x9cb9('0x5')]=function(){this['squeue']['push'](this[_0x9cb9('0x6')][_0x9cb9('0x7')](this),this[_0x9cb9('0x8')][_0x9cb9('0x7')](this));};Agent['prototype'][_0x9cb9('0xb')]=function(){this[_0x9cb9('0x8')](!![]);};Agent[_0x9cb9('0xc')][_0x9cb9('0x6')]=function(){logger[_0x9cb9('0xd')](_0x9cb9('0xe'),this[_0x9cb9('0x3')]['id'],this[_0x9cb9('0xf')]['id']);if(_[_0x9cb9('0x10')](this[_0x9cb9('0x4')][_0x9cb9('0x11')][this[_0x9cb9('0xf')]['id']])){logger[_0x9cb9('0xd')](_0x9cb9('0x12'),this[_0x9cb9('0x3')]['id'],this[_0x9cb9('0xf')]['id']);setTimeout(this[_0x9cb9('0x5')][_0x9cb9('0x7')](this),0x3e8);}else{if(this['routing']['forcedOwnership']||util[_0x9cb9('0x13')](this['squeue']['id'],this['realtime']['agents'][this[_0x9cb9('0xf')]['id']],this['squeue'][_0x9cb9('0x14')],![])){this[_0x9cb9('0x4')][_0x9cb9('0x11')][this[_0x9cb9('0xf')]['id']][_0x9cb9('0x15')]=!![];this[_0x9cb9('0x4')][_0x9cb9('0x11')][this[_0x9cb9('0xf')]['id']][_0x9cb9('0x16')]=undefined;util[_0x9cb9('0x17')](this[_0x9cb9('0x4')],this[_0x9cb9('0x18')],this[_0x9cb9('0xf')],this[_0x9cb9('0x3')]['channel']);util['showNotification'](this[_0x9cb9('0x2')],this[_0x9cb9('0x3')]['id'],this[_0x9cb9('0x4')][_0x9cb9('0x11')][this[_0x9cb9('0xf')]['id']],null,this[_0x9cb9('0x18')]);util[_0x9cb9('0x19')](this[_0x9cb9('0x3')]['id'],this[_0x9cb9('0x4')]['agents'][this[_0x9cb9('0xf')]['id']],_0x9cb9('0x1a')+(this[_0x9cb9('0x18')][_0x9cb9('0x1b')]?':FORCED':''));}else{logger[_0x9cb9('0xd')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x9cb9('0x3')]['id'],this[_0x9cb9('0xf')]['id']);setTimeout(this[_0x9cb9('0x5')][_0x9cb9('0x7')](this),0x3e8);}}};Agent['prototype'][_0x9cb9('0x8')]=function(_0x3b7bba){if(_[_0x9cb9('0x10')](this['realtime'][_0x9cb9('0x11')][this['agent']['id']])){return logger[_0x9cb9('0xd')](_0x9cb9('0x12'),this[_0x9cb9('0x3')]['id'],this[_0x9cb9('0xf')]['id']);}else{logger[_0x9cb9('0xd')](_0x9cb9('0x1c'),this['squeue']['id'],this[_0x9cb9('0xf')]['id']);util[_0x9cb9('0x1d')](this[_0x9cb9('0x2')],this['squeue']['id'],this['realtime'][_0x9cb9('0x11')][this[_0x9cb9('0xf')]['id']],null,this[_0x9cb9('0x18')]);this['realtime']['agents'][this[_0x9cb9('0xf')]['id']][_0x9cb9('0x15')]=![];this['realtime'][_0x9cb9('0x11')][this[_0x9cb9('0xf')]['id']][_0x9cb9('0x16')]=undefined;util[_0x9cb9('0x1e')](this[_0x9cb9('0x4')],this['routing'],this[_0x9cb9('0xf')],this[_0x9cb9('0x3')]['channel']);util[_0x9cb9('0x19')](this['squeue']['id'],this[_0x9cb9('0x4')][_0x9cb9('0x11')][this['agent']['id']],_0x3b7bba?'STOP':_0x9cb9('0x1f'));}if(!_0x3b7bba){setTimeout(this[_0x9cb9('0x5')][_0x9cb9('0x7')](this),0x3e8);}};function agent(_0x2595f9,_0x448e2c,_0x2dd463,_0x10a355){return new Agent(_0x2595f9,_0x448e2c,_0x2dd463,_0x10a355);}module['exports']=agent; \ No newline at end of file +var _0x5178=['isNil','realtime','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','busy','saveWaitingNotification','channel','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','busyQueue','removeWaitingNotification','writeLog','STOP','TIMEOUT','exports','uuid','./util','../../../../../config/logger','routing','notificationId','agent','squeue','push','handleRun','bind','handleTimeout','drained','handleDrained','prototype','debug','[%s][AGENT]\x20try\x20with\x20%s'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x5178,0x171));var _0x8517=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x5178[_0xbca1b1];return _0x4e1686;};'use strict';var _=require('lodash');var uuid=require(_0x8517('0x0'));var util=require(_0x8517('0x1'));var logger=require(_0x8517('0x2'))(_0x8517('0x3'));var Agent=function(_0x38d5b3,_0x5e0a44,_0x483381,_0x3ed6a5){this[_0x8517('0x4')]=uuid['v4']();this['squeue']=_0x38d5b3;this[_0x8517('0x5')]=_0x5e0a44;this['realtime']=_0x483381;this[_0x8517('0x3')]=_0x3ed6a5;this[_0x8517('0x6')][_0x8517('0x7')](this[_0x8517('0x8')][_0x8517('0x9')](this),this['handleTimeout'][_0x8517('0x9')](this));this['squeue']['on']('timeout',this[_0x8517('0xa')][_0x8517('0x9')](this));this['squeue']['on'](_0x8517('0xb'),this[_0x8517('0xc')][_0x8517('0x9')](this));};Agent[_0x8517('0xd')][_0x8517('0x7')]=function(){this[_0x8517('0x6')][_0x8517('0x7')](this[_0x8517('0x8')]['bind'](this),this[_0x8517('0xa')][_0x8517('0x9')](this));};Agent[_0x8517('0xd')][_0x8517('0xc')]=function(){this[_0x8517('0xa')](!![]);};Agent['prototype'][_0x8517('0x8')]=function(){logger[_0x8517('0xe')](_0x8517('0xf'),this[_0x8517('0x6')]['id'],this[_0x8517('0x5')]['id']);if(_[_0x8517('0x10')](this[_0x8517('0x11')][_0x8517('0x12')][this[_0x8517('0x5')]['id']])){logger[_0x8517('0xe')](_0x8517('0x13'),this[_0x8517('0x6')]['id'],this['agent']['id']);setTimeout(this[_0x8517('0x7')][_0x8517('0x9')](this),0x3e8);}else{if(this[_0x8517('0x3')][_0x8517('0x14')]||util[_0x8517('0x15')](this[_0x8517('0x6')]['id'],this[_0x8517('0x11')]['agents'][this[_0x8517('0x5')]['id']],this['squeue']['channel'],![])){this[_0x8517('0x11')][_0x8517('0x12')][this[_0x8517('0x5')]['id']][_0x8517('0x16')]=!![];this[_0x8517('0x11')][_0x8517('0x12')][this['agent']['id']]['busyQueue']=undefined;util[_0x8517('0x17')](this[_0x8517('0x11')],this[_0x8517('0x3')],this[_0x8517('0x5')],this[_0x8517('0x6')][_0x8517('0x18')]);util['showNotification'](this[_0x8517('0x4')],this[_0x8517('0x6')]['id'],this['realtime'][_0x8517('0x12')][this[_0x8517('0x5')]['id']],null,this[_0x8517('0x3')]);util['writeLog'](this[_0x8517('0x6')]['id'],this['realtime'][_0x8517('0x12')][this[_0x8517('0x5')]['id']],_0x8517('0x19')+(this[_0x8517('0x3')][_0x8517('0x14')]?_0x8517('0x1a'):''));}else{logger['debug'](_0x8517('0x1b'),this['squeue']['id'],this[_0x8517('0x5')]['id']);setTimeout(this[_0x8517('0x7')][_0x8517('0x9')](this),0x3e8);}}};Agent[_0x8517('0xd')][_0x8517('0xa')]=function(_0x1b2423){if(_['isNil'](this[_0x8517('0x11')]['agents'][this[_0x8517('0x5')]['id']])){return logger[_0x8517('0xe')](_0x8517('0x13'),this[_0x8517('0x6')]['id'],this[_0x8517('0x5')]['id']);}else{logger[_0x8517('0xe')](_0x8517('0x1c'),this[_0x8517('0x6')]['id'],this[_0x8517('0x5')]['id']);util['hideNotification'](this[_0x8517('0x4')],this[_0x8517('0x6')]['id'],this[_0x8517('0x11')]['agents'][this['agent']['id']],null,this['routing']);this[_0x8517('0x11')][_0x8517('0x12')][this[_0x8517('0x5')]['id']][_0x8517('0x16')]=![];this[_0x8517('0x11')][_0x8517('0x12')][this['agent']['id']][_0x8517('0x1d')]=undefined;util[_0x8517('0x1e')](this[_0x8517('0x11')],this['routing'],this[_0x8517('0x5')],this['squeue'][_0x8517('0x18')]);util[_0x8517('0x1f')](this['squeue']['id'],this['realtime'][_0x8517('0x12')][this[_0x8517('0x5')]['id']],_0x1b2423?_0x8517('0x20'):_0x8517('0x21'));}if(!_0x1b2423){setTimeout(this['push']['bind'](this),0x3e8);}};function agent(_0x2cb889,_0x11a1b3,_0x1835ac,_0x516fb1){return new Agent(_0x2cb889,_0x11a1b3,_0x1835ac,_0x516fb1);}module[_0x8517('0x22')]=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index 24aa496..047ce14 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 _0x484c=['[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','writeLog','busy','name','channel','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','hideNotification','STOP','busyQueue','removeWaitingNotification','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','queue','realtime','handleTimeout','bind','drained','handleDrained','prototype','push','handleRun','isNil','Agents','length','agents','debug'];(function(_0x421cf8,_0x23152c){var _0x145c48=function(_0x565862){while(--_0x565862){_0x421cf8['push'](_0x421cf8['shift']());}};_0x145c48(++_0x23152c);}(_0x484c,0x198));var _0xc484=function(_0x37295a,_0x47a939){_0x37295a=_0x37295a-0x0;var _0x44fe6c=_0x484c[_0x37295a];return _0x44fe6c;};'use strict';var _=require(_0xc484('0x0'));var uuid=require(_0xc484('0x1'));var util=require(_0xc484('0x2'));var logger=require(_0xc484('0x3'))(_0xc484('0x4'));var Beepall=function(_0x12869d,_0x59d953,_0x59f5f8,_0x1d0362){this[_0xc484('0x5')]=uuid['v4']();this[_0xc484('0x6')]=_0x12869d;this[_0xc484('0x7')]=_0x59d953;this[_0xc484('0x8')]=_0x59f5f8;this[_0xc484('0x4')]=_0x1d0362;this[_0xc484('0x6')]['push'](this['handleRun']['bind'](this),this[_0xc484('0x9')][_0xc484('0xa')](this));this[_0xc484('0x6')]['on']('timeout',this[_0xc484('0x9')][_0xc484('0xa')](this));this['squeue']['on'](_0xc484('0xb'),this[_0xc484('0xc')][_0xc484('0xa')](this));};Beepall[_0xc484('0xd')][_0xc484('0xe')]=function(){this['squeue'][_0xc484('0xe')](this[_0xc484('0xf')][_0xc484('0xa')](this),this[_0xc484('0x9')][_0xc484('0xa')](this));};Beepall[_0xc484('0xd')][_0xc484('0xc')]=function(){this[_0xc484('0x9')](!![]);};Beepall[_0xc484('0xd')]['handleRun']=function(){var _0x253aa8=!![];if(!_[_0xc484('0x10')](this[_0xc484('0x7')])&&!_['isNil'](this['queue'][_0xc484('0x11')])&&this[_0xc484('0x7')][_0xc484('0x11')][_0xc484('0x12')]>0x0){for(var _0x4891d1=0x0,_0x580dc7;_0x4891d10x0){for(var _0x32c31b=0x0,_0x3e0bbe;_0x32c31b0x0&&_0xf991c3[_0xa6cb07+'CurrentCapacity']>=_0xf991c3[_0xa6cb07+_0x04d2('0x21')]){writeLog(_0x549556,_0xf991c3,_0xa6cb07['toUpperCase']()+_0x04d2('0x22'));return![];}}return!![];};exports[_0x04d2('0x23')]=function(_0x25dba5,_0x42b7db,_0x4f8ccc,_0x5675e6,_0x571369){return sendNotification(!![],_0x25dba5,_0x42b7db,_0x4f8ccc,_0x5675e6,_0x571369);};exports['hideNotification']=function(_0x52b562,_0x4d548a,_0x1529a3,_0x50f258,_0x5c5d45){return sendNotification(![],_0x52b562,_0x4d548a,_0x1529a3,_0x50f258,_0x5c5d45);};exports['checkWaitingNotifications']=function(_0x1b2fd2,_0x37c45c,_0x560063){var _0x207316=_0x37c45c[_0x04d2('0x24')][_0x04d2('0x25')];if(!_0x207316&&_0x560063){_0x207316=_0x560063['id'];}var _0x175ec6=_[_0x04d2('0x26')](_0x1b2fd2[_0x37c45c[_0x04d2('0x27')]+'QueuesWaitingInteractions'],function(_0x5484bc){var _0x41c368=_[_0x04d2('0x28')](_0x37c45c['channel'])+_0x04d2('0x29');return _0x5484bc[_0x41c368]===_0x37c45c[_0x04d2('0x24')]['id'];});if(!_0x175ec6&&_0x207316&&_0x1b2fd2['agents'][_0x207316]){_0x175ec6=_[_0x04d2('0x26')](_0x1b2fd2[_0x04d2('0x2a')][_0x207316][_0x37c45c[_0x04d2('0x27')]+_0x04d2('0x2b')],function(_0x4514ce){return _0x4514ce['id']===_0x37c45c[_0x04d2('0x24')]['id'];});}return _0x175ec6;};exports[_0x04d2('0x2c')]=function(_0x4cd888,_0x213018,_0x21bdf1,_0x28409c){if(_0x21bdf1&&_0x21bdf1['id']&&_0x4cd888['agents']&&_0x4cd888[_0x04d2('0x2a')][_0x21bdf1['id']]){_0x4cd888[_0x04d2('0x2a')][_0x21bdf1['id']][_0x28409c+_0x04d2('0x2b')][_0x213018[_0x04d2('0x2d')]['id']]={'id':_0x213018[_0x04d2('0x24')]['id']};}};exports[_0x04d2('0x2e')]=function(_0x149286,_0x14cb53,_0x11f173,_0x3e5f28){if(_0x11f173&&_0x11f173['id']&&_0x149286['agents']&&_0x149286[_0x04d2('0x2a')][_0x11f173['id']]){delete _0x149286[_0x04d2('0x2a')][_0x11f173['id']][_0x3e5f28+_0x04d2('0x2b')][_0x14cb53['message']['id']];}};exports[_0x04d2('0x2f')]=writeLog; \ No newline at end of file +var _0x9666=['OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','checkWaitingNotifications','UserId','channel','capitalize','InteractionId','interaction','agents','some','WaitingInteractions','saveWaitingNotification','removeWaitingNotification','lodash','util','../utils','ioredis','../../../../../config/logger','routing','redis','localhost','socket.io-emitter','split','\x20interaction','name','account','notificationSound','notificationShake','body','queue','notificationTemplate','msg','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','message','user:%s','emit','notification:%s','remove','debug','BUSY','online'];(function(_0x253141,_0x396c1e){var _0x4472f3=function(_0x28b591){while(--_0x28b591){_0x253141['push'](_0x253141['shift']());}};_0x4472f3(++_0x396c1e);}(_0x9666,0x17a));var _0x6966=function(_0x901197,_0x1b27b8){_0x901197=_0x901197-0x0;var _0x4f6a25=_0x9666[_0x901197];return _0x4f6a25;};'use strict';var _=require(_0x6966('0x0'));var util=require(_0x6966('0x1'));var utils=require(_0x6966('0x2'));var Redis=require(_0x6966('0x3'));var config=require('../../../../../config/environment');var logger=require(_0x6966('0x4'))(_0x6966('0x5'));config[_0x6966('0x6')]=_['defaults'](config['redis'],{'host':_0x6966('0x7'),'port':0x18eb});var io=require(_0x6966('0x8'))(new Redis(config[_0x6966('0x6')]));function sendNotification(_0x17198b,_0x363f5f,_0x18fa4c,_0x484a87,_0xb381c4,_0x3d08bf){var _0xb880d1=_0x3d08bf||{};var _0x524f5d=_0x18fa4c[_0x6966('0x9')]('.');var _0x377666={'uniqueid':_0x363f5f,'channel':_0x524f5d[0x0],'id':_0x524f5d[0x1],'title':_0x524f5d[0x0]+_0x6966('0xa'),'interactionId':_0x524f5d[0x2],'queue':_0xb381c4?_0xb381c4[_0x6966('0xb')]:null,'sound':_0xb880d1[_0x6966('0xc')][_0x6966('0xd')],'shake':_0xb880d1[_0x6966('0xc')][_0x6966('0xe')]};try{if(!_0xb880d1[_0x6966('0xf')]){_0xb880d1[_0x6966('0xf')]={};}if(_0xb381c4){_0xb880d1['body']['queue']=_0xb381c4;}else if(_0xb880d1['body'][_0x6966('0x10')]){delete _0xb880d1[_0x6966('0xf')][_0x6966('0x10')];}_0x377666['msg']=utils['getMustacheRender'](_0xb880d1['account'][_0x6966('0x11')],_0xb880d1);}catch(_0xbd4ea2){_0x377666[_0x6966('0x12')]=_0x6966('0x13');logger[_0x6966('0x14')](util['format'](_0x6966('0x15'),_0x363f5f,_0xbd4ea2[_0x6966('0x16')]));}io['to'](util['format'](_0x6966('0x17'),_0x484a87[_0x6966('0xb')]))[_0x6966('0x18')](util['format'](_0x6966('0x19'),_0x17198b?'save':_0x6966('0x1a')),_0x377666);}function writeLog(_0x519049,_0x5a4ea7,_0x5de186){return logger[_0x6966('0x1b')](util['format']('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x519049,_0x5a4ea7['name'],_0x5de186));}exports['isAgentAvailable']=function(_0x5e66b3,_0x197c2c,_0x247570,_0x10b9f6){if(_0x197c2c['busy']){writeLog(_0x5e66b3,_0x197c2c,_0x6966('0x1c'));return![];}if(!_0x197c2c[_0x6966('0x1d')]){writeLog(_0x5e66b3,_0x197c2c,_0x6966('0x1e'));return![];}if(_0x197c2c[_0x247570+_0x6966('0x1f')]){writeLog(_0x5e66b3,_0x197c2c,_0x6966('0x20'));return![];}if(_0x10b9f6&&_0x197c2c[_0x6966('0x21')](_0x247570+_0x6966('0x22'))&&_0x197c2c[_0x6966('0x21')](_0x247570+_0x6966('0x23'))){if(_0x197c2c[_0x247570+'Capacity']>0x0&&_0x197c2c[_0x247570+_0x6966('0x23')]>=_0x197c2c[_0x247570+_0x6966('0x22')]){writeLog(_0x5e66b3,_0x197c2c,_0x247570[_0x6966('0x24')]()+_0x6966('0x25'));return![];}}return!![];};exports[_0x6966('0x26')]=function(_0x27db0e,_0x44a5df,_0x4e4c30,_0x221b7d,_0x5a7f85){return sendNotification(!![],_0x27db0e,_0x44a5df,_0x4e4c30,_0x221b7d,_0x5a7f85);};exports[_0x6966('0x27')]=function(_0x4f7aa2,_0x17292b,_0x307b70,_0xeae4fb,_0x85106d){return sendNotification(![],_0x4f7aa2,_0x17292b,_0x307b70,_0xeae4fb,_0x85106d);};exports[_0x6966('0x28')]=function(_0x29c91e,_0x8dec9,_0x1b86a7){var _0x2c9fbb=_0x8dec9['interaction'][_0x6966('0x29')];if(!_0x2c9fbb&&_0x1b86a7){_0x2c9fbb=_0x1b86a7['id'];}var _0x35fdb4=_['some'](_0x29c91e[_0x8dec9[_0x6966('0x2a')]+'QueuesWaitingInteractions'],function(_0x44b6b0){var _0x297c21=_[_0x6966('0x2b')](_0x8dec9[_0x6966('0x2a')])+_0x6966('0x2c');return _0x44b6b0[_0x297c21]===_0x8dec9[_0x6966('0x2d')]['id'];});if(!_0x35fdb4&&_0x2c9fbb&&_0x29c91e[_0x6966('0x2e')][_0x2c9fbb]){_0x35fdb4=_[_0x6966('0x2f')](_0x29c91e[_0x6966('0x2e')][_0x2c9fbb][_0x8dec9[_0x6966('0x2a')]+_0x6966('0x30')],function(_0x39834d){return _0x39834d['id']===_0x8dec9[_0x6966('0x2d')]['id'];});}return _0x35fdb4;};exports[_0x6966('0x31')]=function(_0x8e7e81,_0x35ccee,_0x4af933,_0x41b400){if(_0x4af933&&_0x4af933['id']&&_0x8e7e81['agents']&&_0x8e7e81[_0x6966('0x2e')][_0x4af933['id']]){_0x8e7e81[_0x6966('0x2e')][_0x4af933['id']][_0x41b400+_0x6966('0x30')][_0x35ccee[_0x6966('0x16')]['id']]={'id':_0x35ccee[_0x6966('0x2d')]['id']};}};exports[_0x6966('0x32')]=function(_0x3316b0,_0x12f579,_0x129a56,_0x34b671){if(_0x129a56&&_0x129a56['id']&&_0x3316b0['agents']&&_0x3316b0[_0x6966('0x2e')][_0x129a56['id']]){delete _0x3316b0[_0x6966('0x2e')][_0x129a56['id']][_0x34b671+_0x6966('0x30')][_0x12f579['message']['id']];}};exports['writeLog']=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index 446b5ee..f1a3c06 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 _0xa1e4=['routing','string','length','error','map','message','join','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','replace','isNil','isEmpty','info','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','[%s][SYSTEM]\x20%s','isObject','stringify','validate','shelljs','lodash','./utils','../../../../config/logger'];(function(_0x22a8c4,_0x388848){var _0x35a230=function(_0x37871d){while(--_0x37871d){_0x22a8c4['push'](_0x22a8c4['shift']());}};_0x35a230(++_0x388848);}(_0xa1e4,0xb8));var _0x4a1e=function(_0x15bb39,_0x42bd41){_0x15bb39=_0x15bb39-0x0;var _0x88fadc=_0xa1e4[_0x15bb39];return _0x88fadc;};'use strict';var schema=require(_0x4a1e('0x0'));var sh=require(_0x4a1e('0x1'));var _=require(_0x4a1e('0x2'));var utils=require(_0x4a1e('0x3'));var logger=require(_0x4a1e('0x4'))(_0x4a1e('0x5'));var system=schema({'command':{'type':_0x4a1e('0x6'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x2a02ea,_0x4e7abe){return function(_0x3e56b6){try{var _0x472a1e={'command':_0x4e7abe[0x0]};var _0x1b1635=system[_0x4a1e('0x0')](_0x472a1e,{'typecast':!![]});if(_0x1b1635[_0x4a1e('0x7')]){logger[_0x4a1e('0x8')]('[%s][SYSTEM]\x20%s',_0x2a02ea,_[_0x4a1e('0x9')](_0x1b1635,_0x4a1e('0xa'))[_0x4a1e('0xb')](',\x20'));logger['info'](_0x4a1e('0xc'),_0x2a02ea);_0x3e56b6[_0x4a1e('0xd')]();}else{var _0x7c0e9b=this;var _0x384dab=utils['getMustacheRender'](_0x4e7abe[0x0],this);logger['info'](_0x4a1e('0xe'),_0x2a02ea,_0x384dab);sh[_0x4a1e('0xf')](_[_0x4a1e('0x10')](_0x384dab),function(_0xa130da,_0x13cc41){logger['info']('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x2a02ea,_0xa130da);if(_0xa130da==0x0){var _0x3254f0=_0x13cc41[_0x4a1e('0x11')](/(\r\n|\n|\r)/gm,'');if(_[_0x4a1e('0x12')](_0x4e7abe[0x1])||_[_0x4a1e('0x13')](_0x4e7abe[0x1])){logger[_0x4a1e('0x14')](_0x4a1e('0x15'),_0x2a02ea);_0x7c0e9b[_0x4a1e('0x16')][_0x4e7abe[0x1]]=_0x3254f0;}else{logger[_0x4a1e('0x14')](_0x4a1e('0x17'),_0x2a02ea,_0x4e7abe[0x1],_0x3254f0);_0x7c0e9b[_0x4a1e('0x16')][_0x4e7abe[0x1]]=_0x3254f0;}}_0x3e56b6[_0x4a1e('0xd')]();});}}catch(_0x45a85a){logger[_0x4a1e('0x8')](_0x4a1e('0x18'),_0x2a02ea,_[_0x4a1e('0x19')](_0x45a85a)?JSON[_0x4a1e('0x1a')](_0x45a85a):_0x45a85a);logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x2a02ea);_0x3e56b6[_0x4a1e('0xd')]();}};}; \ No newline at end of file +var _0x5da1=['../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','validate','length','error','[%s][SYSTEM]\x20%s','map','message','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','trim','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','isObject','stringify','./utils'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x5da1,0xbf));var _0x15da=function(_0x3a5172,_0x4eedc6){_0x3a5172=_0x3a5172-0x0;var _0x569102=_0x5da1[_0x3a5172];return _0x569102;};'use strict';var schema=require('validate');var sh=require('shelljs');var _=require('lodash');var utils=require(_0x15da('0x0'));var logger=require(_0x15da('0x1'))(_0x15da('0x2'));var system=schema({'command':{'type':'string','required':!![],'message':_0x15da('0x3')}});exports['consequence']=function(_0x8f8f9d,_0x162361){return function(_0x4ade97){try{var _0x261900={'command':_0x162361[0x0]};var _0x4054bd=system[_0x15da('0x4')](_0x261900,{'typecast':!![]});if(_0x4054bd[_0x15da('0x5')]){logger[_0x15da('0x6')](_0x15da('0x7'),_0x8f8f9d,_[_0x15da('0x8')](_0x4054bd,_0x15da('0x9'))['join'](',\x20'));logger[_0x15da('0xa')](_0x15da('0xb'),_0x8f8f9d);_0x4ade97['next']();}else{var _0x23123b=this;var _0x7e41fe=utils[_0x15da('0xc')](_0x162361[0x0],this);logger['info'](_0x15da('0xd'),_0x8f8f9d,_0x7e41fe);sh['exec'](_[_0x15da('0xe')](_0x7e41fe),function(_0x5e9359,_0x2093e2){logger[_0x15da('0xa')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x8f8f9d,_0x5e9359);if(_0x5e9359==0x0){var _0x2a145d=_0x2093e2[_0x15da('0xf')](/(\r\n|\n|\r)/gm,'');if(_[_0x15da('0x10')](_0x162361[0x1])||_[_0x15da('0x11')](_0x162361[0x1])){logger[_0x15da('0xa')](_0x15da('0x12'),_0x8f8f9d);_0x23123b[_0x15da('0x13')][_0x162361[0x1]]=_0x2a145d;}else{logger['info'](_0x15da('0x14'),_0x8f8f9d,_0x162361[0x1],_0x2a145d);_0x23123b[_0x15da('0x13')][_0x162361[0x1]]=_0x2a145d;}}_0x4ade97[_0x15da('0x15')]();});}}catch(_0x35c2ba){logger[_0x15da('0x6')](_0x15da('0x7'),_0x8f8f9d,_[_0x15da('0x16')](_0x35c2ba)?JSON[_0x15da('0x17')](_0x35c2ba):_0x35c2ba);logger[_0x15da('0xa')](_0x15da('0xb'),_0x8f8f9d);_0x4ade97['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 c92d7e2..b9999bd 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 _0x01ff=['lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','error','[%s][TAG]\x20%s','map','message','join','next','channel','Interaction','addTags','interaction','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','finally','validate'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x01ff,0x77));var _0xf01f=function(_0x443411,_0x1a16a9){_0x443411=_0x443411-0x0;var _0x5875fa=_0x01ff[_0x443411];return _0x5875fa;};'use strict';var schema=require(_0xf01f('0x0'));var _=require(_0xf01f('0x1'));var rpc={'chatInteraction':require(_0xf01f('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0xf01f('0x3')),'mailInteraction':require(_0xf01f('0x4')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xf01f('0x5'))};var logger=require(_0xf01f('0x6'))(_0xf01f('0x7'));var tag=schema({'tag':{'type':'number','required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x3a511c,_0x41bc64,_0x27b35b,_0x510ade){return function(_0x3772e7){try{var _0x588147={'tag':_0x41bc64[0x0]};var _0x387760=tag[_0xf01f('0x0')](_0x588147,{'typecast':!![]});if(_0x387760['length']){logger[_0xf01f('0x8')](_0xf01f('0x9'),_0x3a511c,_[_0xf01f('0xa')](_0x387760,_0xf01f('0xb'))[_0xf01f('0xc')](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x3a511c);_0x3772e7[_0xf01f('0xd')]();}else{var _0x35eb35={'ids':[_0x41bc64[0x0]]};if(rpc[_0x510ade[_0xf01f('0xe')]+_0xf01f('0xf')]){rpc[_0x510ade['channel']+'Interaction'][_0xf01f('0x10')](_0x510ade[_0xf01f('0x11')]['id'],_0x35eb35)[_0xf01f('0x12')](function(_0x5029af){logger[_0xf01f('0x13')](_0xf01f('0x14'),_0x3a511c,_0x41bc64[0x1],_0x510ade[_0xf01f('0xe')],_0x510ade[_0xf01f('0x11')]['id']);})['catch'](function(_0x196fee){logger[_0xf01f('0x8')](_0xf01f('0x9'),_0x3a511c,JSON[_0xf01f('0x15')](_0x196fee));logger[_0xf01f('0x13')](_0xf01f('0x16'),_0x3a511c);})[_0xf01f('0x17')](function(){_0x3772e7[_0xf01f('0xd')]();});}}}catch(_0x2cf776){logger['error'](_0xf01f('0x9'),_0x3a511c,_['isObject'](_0x2cf776)?JSON[_0xf01f('0x15')](_0x2cf776):_0x2cf776);logger[_0xf01f('0x13')](_0xf01f('0x16'),_0x3a511c);_0x3772e7[_0xf01f('0xd')]();}};}; \ No newline at end of file +var _0x725a=['../../rpc/chatInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','routing','number','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','next','channel','Interaction','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','finally','isObject','validate'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0x725a,0x6b));var _0xa725=function(_0x1b10c6,_0x4f62aa){_0x1b10c6=_0x1b10c6-0x0;var _0x46f513=_0x725a[_0x1b10c6];return _0x46f513;};'use strict';var schema=require(_0xa725('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0xa725('0x1')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0xa725('0x2')),'whatsappInteraction':require(_0xa725('0x3'))};var logger=require('../../../../config/logger')(_0xa725('0x4'));var tag=schema({'tag':{'type':_0xa725('0x5'),'required':!![],'message':_0xa725('0x6')}});exports[_0xa725('0x7')]=function(_0x572fa6,_0x516945,_0x380009,_0x5b26c1){return function(_0x39acf5){try{var _0x592b7e={'tag':_0x516945[0x0]};var _0xae4d1b=tag[_0xa725('0x0')](_0x592b7e,{'typecast':!![]});if(_0xae4d1b[_0xa725('0x8')]){logger[_0xa725('0x9')](_0xa725('0xa'),_0x572fa6,_[_0xa725('0xb')](_0xae4d1b,_0xa725('0xc'))[_0xa725('0xd')](',\x20'));logger[_0xa725('0xe')](_0xa725('0xf'),_0x572fa6);_0x39acf5[_0xa725('0x10')]();}else{var _0x9591c5={'ids':[_0x516945[0x0]]};if(rpc[_0x5b26c1[_0xa725('0x11')]+_0xa725('0x12')]){rpc[_0x5b26c1[_0xa725('0x11')]+_0xa725('0x12')][_0xa725('0x13')](_0x5b26c1[_0xa725('0x14')]['id'],_0x9591c5)[_0xa725('0x15')](function(_0x899fec){logger[_0xa725('0xe')](_0xa725('0x16'),_0x572fa6,_0x516945[0x1],_0x5b26c1[_0xa725('0x11')],_0x5b26c1[_0xa725('0x14')]['id']);})[_0xa725('0x17')](function(_0x430031){logger[_0xa725('0x9')]('[%s][TAG]\x20%s',_0x572fa6,JSON[_0xa725('0x18')](_0x430031));logger[_0xa725('0xe')](_0xa725('0xf'),_0x572fa6);})[_0xa725('0x19')](function(){_0x39acf5[_0xa725('0x10')]();});}}}catch(_0x2ca13b){logger[_0xa725('0x9')](_0xa725('0xa'),_0x572fa6,_[_0xa725('0x1a')](_0x2ca13b)?JSON[_0xa725('0x18')](_0x2ca13b):_0x2ca13b);logger['info'](_0xa725('0xf'),_0x572fa6);_0x39acf5['next']();}};}; \ 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 21e3f2a..f7a49f5 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 _0x15cd=['2.0','login','push','params','stringify','POST','application/json-rpc','then','result','logged','&serviceId=','&sessionId=','&data=','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','error','[%s][TVOX]\x20%s','isObject','info','next','request-promise','../../../../config/logger','lodash','consequence','replace','\x20-\x20','includes','urlOnAnswer','?params=','title','jsonrpc'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x15cd,0xce));var _0xd15c=function(_0x5b84e5,_0x26076b){_0x5b84e5=_0x5b84e5-0x0;var _0xff9066=_0x15cd[_0x5b84e5];return _0xff9066;};'use strict';var rp=require(_0xd15c('0x0'));var logger=require(_0xd15c('0x1'))('routing');var _=require(_0xd15c('0x2'));var arr=[];exports[_0xd15c('0x3')]=function(_0x29508b,_0x4ca304){return function(_0x5a6283){var _0x3ea6ca=_0x4ca304[0xa];var _0x543e16=_0x4ca304[0xb];var _0x56304b=_0x4ca304[0xc];var _0x2eb449=_0x4ca304[0xd];var _0x440a91=_0x4ca304[0xe];var _0x392d5b=_0x4ca304[0xf][_0xd15c('0x4')](/\n/g,_0xd15c('0x5'));var _0x36b696=_0x4ca304[0x10][_0xd15c('0x4')](/\n/g,'\x20');if(!arr[_0xd15c('0x6')](_0x543e16)){arr['push'](_0x543e16);var _0x10bc04=_0x4ca304[0x3];var _0x4990a6=_0x4ca304[0x4];var _0x4c12a2=_0x4ca304[0x1];var _0x1262af=_0x4ca304[0x0];var _0x1c7818={};_0x1c7818[_0xd15c('0x7')]=_0x4ca304[0x8]+'?params='+_0x56304b+'|'+_0x3ea6ca+'|'+_0x2eb449+'|'+_0x543e16+'|'+_0x440a91;_0x1c7818['urlOnRing']=_0x4ca304[0x7]+_0xd15c('0x8')+_0x56304b+'|'+_0x3ea6ca+'|'+_0x2eb449+'|'+_0x543e16+'|'+_0x440a91+'|'+_0x392d5b+'|'+_0x36b696;_0x1c7818[_0xd15c('0x9')]=_0x4ca304[0x9];var _0x41cff9={};_0x41cff9[_0xd15c('0xa')]=_0xd15c('0xb');_0x41cff9['method']=_0xd15c('0xc');var _0x3b9105=[];_0x3b9105[_0xd15c('0xd')](_0x4ca304[0x2]);_0x3b9105[_0xd15c('0xd')](_0x4ca304[0x5]);_0x3b9105[_0xd15c('0xd')](_0x4ca304[0x6]);_0x41cff9[_0xd15c('0xe')]=_0x3b9105;_0x41cff9['id']=0x1;var _0x5e0730=JSON[_0xd15c('0xf')](_0x41cff9);var _0x41073d={'encoding':'utf8','method':_0xd15c('0x10'),'timeout':0x2710,'url':_0x10bc04,'headers':{'Content-Type':_0xd15c('0x11')},'body':_0x5e0730};return rp(_0x41073d)[_0xd15c('0x12')](function(_0x315b12){const _0x3bbe86=JSON['parse'](_0x315b12);if(!_0x3bbe86[_0xd15c('0x13')][_0xd15c('0x14')]){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x3545ac=_0x543e16;var _0x457dc4='channelId='+_0x4c12a2+_0xd15c('0x15')+_0x1262af+_0xd15c('0x16')+_0x3545ac+_0xd15c('0x17')+JSON[_0xd15c('0xf')](_0x1c7818);var _0x418cd6=_0x4990a6+'?'+_0x457dc4;return rp(_0x418cd6);})[_0xd15c('0x12')](function(_0x530cdd){logger['info'](_0xd15c('0x18'),_0x29508b,_0x530cdd);_0x5a6283[_0xd15c('0x19')]();})['catch'](function(_0x57f204){logger[_0xd15c('0x1a')](_0xd15c('0x1b'),_0x29508b,_[_0xd15c('0x1c')](_0x57f204)?JSON[_0xd15c('0xf')](_0x57f204):_0x57f204);_0x5a6283[_0xd15c('0x19')]();});}else{logger[_0xd15c('0x1d')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x29508b);_0x5a6283[_0xd15c('0x1e')]();}};}; \ No newline at end of file +var _0x6549=['info','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','request-promise','../../../../config/logger','lodash','consequence','replace','\x20-\x20','includes','push','?params=','urlOnRing','title','jsonrpc','2.0','method','params','stringify','utf8','then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','stop','error','isObject'];(function(_0x143322,_0x561813){var _0x3062bc=function(_0xb025d5){while(--_0xb025d5){_0x143322['push'](_0x143322['shift']());}};_0x3062bc(++_0x561813);}(_0x6549,0x1b4));var _0x9654=function(_0x159ce4,_0x5dca11){_0x159ce4=_0x159ce4-0x0;var _0x4c8cc4=_0x6549[_0x159ce4];return _0x4c8cc4;};'use strict';var rp=require(_0x9654('0x0'));var logger=require(_0x9654('0x1'))('routing');var _=require(_0x9654('0x2'));var arr=[];exports[_0x9654('0x3')]=function(_0x4ed004,_0x5510cb){return function(_0x5d52a9){var _0x5c70e7=_0x5510cb[0xa];var _0x30f436=_0x5510cb[0xb];var _0x24c80b=_0x5510cb[0xc];var _0x322b40=_0x5510cb[0xd];var _0x83f4a2=_0x5510cb[0xe];var _0x64f109=_0x5510cb[0xf][_0x9654('0x4')](/\n/g,_0x9654('0x5'));var _0xd3c547=_0x5510cb[0x10]['replace'](/\n/g,'\x20');if(!arr[_0x9654('0x6')](_0x30f436)){arr[_0x9654('0x7')](_0x30f436);var _0x468cec=_0x5510cb[0x3];var _0xb5ae68=_0x5510cb[0x4];var _0x541a38=_0x5510cb[0x1];var _0x24362f=_0x5510cb[0x0];var _0x537214={};_0x537214['urlOnAnswer']=_0x5510cb[0x8]+_0x9654('0x8')+_0x24c80b+'|'+_0x5c70e7+'|'+_0x322b40+'|'+_0x30f436+'|'+_0x83f4a2;_0x537214[_0x9654('0x9')]=_0x5510cb[0x7]+_0x9654('0x8')+_0x24c80b+'|'+_0x5c70e7+'|'+_0x322b40+'|'+_0x30f436+'|'+_0x83f4a2+'|'+_0x64f109+'|'+_0xd3c547;_0x537214[_0x9654('0xa')]=_0x5510cb[0x9];var _0x300dc1={};_0x300dc1[_0x9654('0xb')]=_0x9654('0xc');_0x300dc1[_0x9654('0xd')]='login';var _0x5c6a12=[];_0x5c6a12['push'](_0x5510cb[0x2]);_0x5c6a12[_0x9654('0x7')](_0x5510cb[0x5]);_0x5c6a12[_0x9654('0x7')](_0x5510cb[0x6]);_0x300dc1[_0x9654('0xe')]=_0x5c6a12;_0x300dc1['id']=0x1;var _0x1ad822=JSON[_0x9654('0xf')](_0x300dc1);var _0x53eae9={'encoding':_0x9654('0x10'),'method':'POST','timeout':0x2710,'url':_0x468cec,'headers':{'Content-Type':'application/json-rpc'},'body':_0x1ad822};return rp(_0x53eae9)[_0x9654('0x11')](function(_0x1c17e7){const _0x1431dc=JSON[_0x9654('0x12')](_0x1c17e7);if(!_0x1431dc[_0x9654('0x13')][_0x9654('0x14')]){throw new Error(_0x9654('0x15'));}var _0x1e0d97=_0x30f436;var _0xc42095=_0x9654('0x16')+_0x541a38+_0x9654('0x17')+_0x24362f+_0x9654('0x18')+_0x1e0d97+_0x9654('0x19')+JSON[_0x9654('0xf')](_0x537214);var _0x513889=_0xb5ae68+'?'+_0xc42095;return rp(_0x513889);})[_0x9654('0x11')](function(_0x295d32){logger['info']('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x4ed004,_0x295d32);_0x5d52a9[_0x9654('0x1a')]();})['catch'](function(_0x127cd9){logger[_0x9654('0x1b')]('[%s][TVOX]\x20%s',_0x4ed004,_[_0x9654('0x1c')](_0x127cd9)?JSON[_0x9654('0xf')](_0x127cd9):_0x127cd9);_0x5d52a9[_0x9654('0x1a')]();});}else{logger[_0x9654('0x1d')](_0x9654('0x1e'),_0x4ed004);_0x5d52a9['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 e792df3..f644d45 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(_0x1f4e66,_0x58422f){var _0x41cb76=function(_0x5cc7be){while(--_0x5cc7be){_0x1f4e66['push'](_0x1f4e66['shift']());}};_0x41cb76(++_0x58422f);}(_0xe706,0xa3));var _0x6e70=function(_0x142020,_0x1f7233){_0x142020=_0x142020-0x0;var _0x40da8f=_0xe706[_0x142020];return _0x40da8f;};'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 _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x3ad7a7,_0x456ae2){var _0x1decad=function(_0x200f8c){while(--_0x200f8c){_0x3ad7a7['push'](_0x3ad7a7['shift']());}};_0x1decad(++_0x456ae2);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 0b5886f..bcf30c5 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 _0x3c36=['amazonlex','tag','TagId','getMustacheRender','account','notificationTemplate','ChatWebsiteId','ContactId','body','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','error','Please\x20create\x20a\x20new\x20file\x20under','.js','execute','Applications\x20executed','stringify','matchPath','emit','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','stack','agent','agents','busy','end','QueueReport','update','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','busyQueue','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','chatQueues','available','name','paused','waiting','mailQueues','loggedIn','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','path','jayson/promise','bluebird','./applications/strategy/util','../../../config/logger','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','transfer','applications','length','existsSync','app','toLowerCase','autoreply','appdata','split','mail','push','slice','join','dialogflow'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x3c36,0x10c));var _0x63c3=function(_0x172c82,_0x58cb0a){_0x172c82=_0x172c82-0x0;var _0x45a6b3=_0x3c36[_0x172c82];return _0x45a6b3;};'use strict';var _=require('lodash');var util=require('util');var path=require(_0x63c3('0x0'));var fs=require('fs');var jayson=require(_0x63c3('0x1'));var BPromise=require(_0x63c3('0x2'));var utils=require('./applications/utils');var sUtils=require(_0x63c3('0x3'));var logger=require(_0x63c3('0x4'))(_0x63c3('0x5'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x63c3('0x6')),'chatQueueReport':require(_0x63c3('0x7')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0x63c3('0x8'));function getId(_0x5f4422,_0x1e3cf4,_0x5ea273){return util[_0x63c3('0x9')](_0x63c3('0xa'),_0x5f4422,_0x1e3cf4||0x0,_0x5ea273||0x0);}function getIntervals(_0x17d81d,_0x3fd39a){var _0x59b54f=[];if(!_[_0x63c3('0xb')](_0x3fd39a['IntervalId'])&&!_['isNil'](_0x17d81d[_0x3fd39a[_0x63c3('0xc')]])&&!_[_0x63c3('0xb')](_0x17d81d[_0x3fd39a[_0x63c3('0xc')]][_0x63c3('0xd')])){_0x59b54f=_[_0x63c3('0xe')](_0x17d81d[_0x3fd39a[_0x63c3('0xc')]]['Intervals'],'interval');}else if(!_['isNil'](_0x3fd39a['interval'])){_0x59b54f=[_0x3fd39a[_0x63c3('0xf')]];}return _0x59b54f;}exports[_0x63c3('0x10')]=function(_0x222c7d){_0x222c7d[_0x63c3('0x11')]={};return new BPromise(function(_0x4355e2,_0x143550){var _0x5c3a3e={'Start':function(_0x13a600){var _0x2aad91=this;return new Promise(function(_0x1b0cbd,_0x37977f){if(_0x13a600){try{var _0x12cec7=[];var _0xfb1421=getId(_0x13a600[_0x63c3('0x12')],_0x13a600[_0x63c3('0x13')]?_0x13a600[_0x63c3('0x13')]['id']:0x0,_0x13a600[_0x63c3('0x14')]?_0x13a600['interaction']['id']:0x0);var _0x95d113=sUtils['checkWaitingNotifications'](_0x222c7d,_0x13a600);if(_0x13a600[_0x63c3('0x15')]||!_0x95d113&&_0x13a600[_0x63c3('0x16')]&&_['isArray'](_0x13a600[_0x63c3('0x16')])&&_0x13a600[_0x63c3('0x16')][_0x63c3('0x17')]){for(var _0x251e91=0x0;_0x251e91<_0x13a600[_0x63c3('0x16')]['length'];_0x251e91+=0x1){var _0x95271c=_0x13a600[_0x63c3('0x16')][_0x251e91];if(fs[_0x63c3('0x18')](path['join'](__dirname,_0x63c3('0x16'),_0x95271c[_0x63c3('0x19')]+'.js'))){var _0x4e2adf=[];switch(_0x95271c['app'][_0x63c3('0x1a')]()){case _0x63c3('0x1b'):var _0x431e63=_0x95271c[_0x63c3('0x1c')][_0x63c3('0x1d')](',');if(_0x13a600['channel']===_0x63c3('0x1e')){_0x4e2adf[_0x63c3('0x1f')](_0x431e63[0x0]);_0x4e2adf['push'](_0x431e63[0x1]);_0x4e2adf[_0x63c3('0x1f')](_0x431e63[_0x63c3('0x20')](0x2,_0x431e63[_0x63c3('0x17')])[_0x63c3('0x21')](','));}else{_0x4e2adf[_0x63c3('0x1f')](_0x431e63[0x0]);_0x4e2adf[_0x63c3('0x1f')](_0x431e63[_0x63c3('0x20')](0x1,_0x431e63[_0x63c3('0x17')])[_0x63c3('0x21')](','));}break;case _0x63c3('0x22'):var _0x49d3f4=_0x95271c[_0x63c3('0x1c')][_0x63c3('0x1d')](',');_0x4e2adf[_0x63c3('0x1f')](_0x49d3f4[0x0]);_0x4e2adf[_0x63c3('0x1f')](_0x49d3f4[0x1]);_0x4e2adf[_0x63c3('0x1f')](_0x49d3f4[_0x63c3('0x20')](0x2,_0x49d3f4[_0x63c3('0x17')])[_0x63c3('0x21')](','));break;case'dialogflowv2':var _0x354540=_0x95271c[_0x63c3('0x1c')]['split'](',');_0x4e2adf[_0x63c3('0x1f')](_0x354540[0x0]);_0x4e2adf[_0x63c3('0x1f')](_0x354540[0x1]);_0x4e2adf[_0x63c3('0x1f')](_0x354540[0x2]);_0x4e2adf[_0x63c3('0x1f')](_0x354540[0x3]);_0x4e2adf[_0x63c3('0x1f')](_0x354540[_0x63c3('0x20')](0x4,_0x354540[_0x63c3('0x17')])[_0x63c3('0x21')](','));break;case _0x63c3('0x23'):var _0x5867db=_0x95271c[_0x63c3('0x1c')]['split'](',');_0x4e2adf['push'](_0x5867db[0x0]);_0x4e2adf['push'](_0x5867db[0x1]);_0x4e2adf[_0x63c3('0x1f')](_0x5867db[0x2]);_0x4e2adf[_0x63c3('0x1f')](_0x5867db[0x3]);_0x4e2adf['push'](_0x5867db[_0x63c3('0x20')](0x4,_0x5867db[_0x63c3('0x17')])[_0x63c3('0x21')](','));break;case _0x63c3('0x13'):_0x4e2adf[_0x63c3('0x1f')](_0x95271c[_0x63c3('0x1c')]);break;case _0x63c3('0x24'):_0x4e2adf[_0x63c3('0x1f')](_0x95271c[_0x63c3('0x25')]);_0x4e2adf[_0x63c3('0x1f')](_0x95271c[_0x63c3('0x1c')]);break;case'tvox':var _0x3f6f33=utils[_0x63c3('0x26')](_0x13a600[_0x63c3('0x27')][_0x63c3('0x28')],_0x13a600);var _0x32970f=_0x95271c['appdata'][_0x63c3('0x1d')](',');_0x4e2adf[_0x63c3('0x1f')](_0x32970f[0x0]);_0x4e2adf['push'](_0x32970f[0x1]);_0x4e2adf[_0x63c3('0x1f')](_0x32970f[0x2]);_0x4e2adf[_0x63c3('0x1f')](_0x32970f[0x3]);_0x4e2adf['push'](_0x32970f[0x4]);_0x4e2adf[_0x63c3('0x1f')](_0x32970f[0x5]);_0x4e2adf[_0x63c3('0x1f')](_0x32970f[0x6]);_0x4e2adf['push'](_0x32970f[0x7]);_0x4e2adf[_0x63c3('0x1f')](_0x32970f[0x8]);_0x4e2adf[_0x63c3('0x1f')](_0x32970f[0x9]);_0x4e2adf['push'](_0x32970f[0xa]);_0x4e2adf[_0x63c3('0x1f')](_0x13a600['interaction']['id']);_0x4e2adf[_0x63c3('0x1f')](_0x13a600[_0x63c3('0x13')]['id']);_0x4e2adf[_0x63c3('0x1f')](_0x95271c[_0x63c3('0x29')]);_0x4e2adf[_0x63c3('0x1f')](_0x13a600[_0x63c3('0x14')][_0x63c3('0x2a')]);_0x4e2adf[_0x63c3('0x1f')](_0x13a600['body'][_0x63c3('0x2b')]);_0x4e2adf['push'](_0x3f6f33);break;default:_0x4e2adf=_[_0x63c3('0xb')](_0x95271c[_0x63c3('0x1c')])?[]:_0x95271c[_0x63c3('0x1c')][_0x63c3('0x1d')](',');}var _0x31963a={'id':util['format']('%s:%s:%s',_0xfb1421,_0x95271c['id'],_0x95271c[_0x63c3('0x19')]),'condition':require(_0x63c3('0x2c'))[_0x63c3('0x2d')](_0xfb1421,getIntervals(_0x222c7d[_0x63c3('0x2e')],_0x95271c),_0x222c7d),'consequence':require(_0x63c3('0x2f')+_0x95271c['app'])[_0x63c3('0x30')](_0xfb1421,_0x4e2adf,_0x222c7d,_0x13a600),'p':_0x95271c[_0x63c3('0x31')]||0x0};logger[_0x63c3('0x32')](_0x63c3('0x33'),_0x31963a['id'],_0x63c3('0x34'),getIntervals(_0x222c7d[_0x63c3('0x2e')],_0x95271c)['join']('\x20|\x20'));_0x12cec7[_0x63c3('0x1f')](_0x31963a);}else{logger[_0x63c3('0x35')](_0x63c3('0x36'),path[_0x63c3('0x21')](__dirname,_0x63c3('0x16'),_0x95271c[_0x63c3('0x19')]+_0x63c3('0x37')));}}_0x222c7d['rules'][_0xfb1421]=new RuleEngine(_0x12cec7);_0x222c7d[_0x63c3('0x11')][_0xfb1421][_0x63c3('0x38')](_0x13a600,function(_0x5c206e){logger[_0x63c3('0x32')](_0x63c3('0x39'),JSON[_0x63c3('0x3a')](_0x5c206e[_0x63c3('0x3b')]));if(_0x222c7d['rules'][_0xfb1421]){_0x222c7d[_0x63c3('0x11')][_0xfb1421][_0x63c3('0x3c')]('complete');}});return _0x1b0cbd({'code':0xc8,'message':_0x13a600});}else{if(_0x95d113){logger[_0x63c3('0x32')](util[_0x63c3('0x9')](_0x63c3('0x3d'),_0xfb1421));}else{logger[_0x63c3('0x32')](_0x63c3('0x3e'));}return _0x1b0cbd({'code':0xc8,'message':_0x13a600});}}catch(_0xe142e5){logger[_0x63c3('0x35')](_0xe142e5[_0x63c3('0x3f')]);return _0x37977f(_0x2aad91[_0x63c3('0x35')](0x1f4,_0xe142e5));}}return _0x37977f('routing\x20is\x20empty');});},'AcceptMessage':function(_0x54c635){var _0x12590b=this;return new Promise(function(_0x172a44,_0x1ce534){if(_0x54c635[_0x63c3('0x40')]&&_0x54c635['agent']['id']){if(_0x222c7d[_0x63c3('0x41')][_0x54c635[_0x63c3('0x40')]['id']]){_0x222c7d[_0x63c3('0x41')][_0x54c635[_0x63c3('0x40')]['id']][_0x63c3('0x42')]=![];_0x222c7d['agents'][_0x54c635['agent']['id']]['busyQueue']=undefined;}}if(_0x54c635[_0x63c3('0x13')]&&_0x54c635[_0x63c3('0x13')]['id']){try{var _0x3faf49=getId(_0x54c635[_0x63c3('0x12')],_0x54c635[_0x63c3('0x13')]?_0x54c635[_0x63c3('0x13')]['id']:0x0,_0x54c635['interaction']?_0x54c635[_0x63c3('0x14')]['id']:0x0);if(_0x222c7d[_0x63c3('0x11')][_0x3faf49]){_0x222c7d[_0x63c3('0x11')][_0x3faf49][_0x63c3('0x3c')](_0x63c3('0x43'));if(rpc[_0x54c635[_0x63c3('0x12')]+'QueueReport']){rpc[_0x54c635['channel']+_0x63c3('0x44')][_0x63c3('0x45')](_0x3faf49,{'UserId':_0x54c635['message']['UserId']})[_0x63c3('0x46')](function(){logger['error'](_0x63c3('0x47'));});}}return _0x172a44({'code':0xc8,'message':_0x54c635});}catch(_0x12a84c){logger[_0x63c3('0x35')](_0x12a84c[_0x63c3('0x3f')]);return _0x1ce534(_0x12590b[_0x63c3('0x35')](0x1f4,_0x12a84c));}}logger[_0x63c3('0x35')](_0x63c3('0x48'));return _0x1ce534(_0x12590b[_0x63c3('0x35')](0x1f4,_0x63c3('0x48')));});},'RejectMessage':function(_0x35b086){var _0x47f751=this;return new Promise(function(_0x3b7c87,_0x4bcf37){if(_0x35b086['agent']&&_0x35b086[_0x63c3('0x40')]['id']){try{if(_0x222c7d['agents'][_0x35b086[_0x63c3('0x40')]['id']]){_0x222c7d[_0x63c3('0x41')][_0x35b086[_0x63c3('0x40')]['id']][_0x63c3('0x42')]=![];_0x222c7d[_0x63c3('0x41')][_0x35b086[_0x63c3('0x40')]['id']][_0x63c3('0x49')]=undefined;}return _0x3b7c87({'code':0xc8,'message':_0x35b086});}catch(_0x1ee838){logger[_0x63c3('0x35')](_0x1ee838[_0x63c3('0x3f')]);return _0x4bcf37(_0x47f751['error'](0x1f4,_0x1ee838));}}logger[_0x63c3('0x35')](_0x63c3('0x48'));return _0x4bcf37(_0x47f751['error'](0x1f4,_0x63c3('0x48')));});},'AbandonInteraction':function(_0x395f2f){var _0x5d3a16=this;return new Promise(function(_0x5eeee6,_0x4cb022){if(_0x395f2f[_0x63c3('0x12')]&&_0x395f2f[_0x63c3('0x14')]&&_0x395f2f['interaction']['id']){try{var _0x3f5701=getId(_0x395f2f[_0x63c3('0x12')],_0x395f2f[_0x63c3('0x13')]?_0x395f2f['message']['id']:0x0,_0x395f2f['interaction']?_0x395f2f[_0x63c3('0x14')]['id']:0x0);if(_0x222c7d[_0x63c3('0x11')][_0x3f5701]){_0x222c7d[_0x63c3('0x11')][_0x3f5701][_0x63c3('0x3c')](_0x63c3('0x43'));}return _0x5eeee6({'code':0xc8,'message':_0x395f2f});}catch(_0x2d8649){logger[_0x63c3('0x35')](_0x2d8649['stack']);return _0x4cb022(_0x5d3a16[_0x63c3('0x35')](0x1f4,_0x2d8649));}}logger[_0x63c3('0x35')](_0x63c3('0x48'));return _0x4cb022(_0x5d3a16['error'](0x1f4,_0x63c3('0x48')));});},'AgentCapacity':function(_0x1ce6dc){var _0x1e3826=this;return new Promise(function(_0x6a29b4,_0x446266){if(_0x222c7d[_0x63c3('0x41')][_0x63c3('0x4a')](_0x1ce6dc['id'])){for(var _0x358cb in _0x1ce6dc[_0x63c3('0x4b')]){if(_0x1ce6dc[_0x63c3('0x4b')][_0x63c3('0x4a')](_0x358cb)){if(_0x222c7d[_0x63c3('0x41')][_0x1ce6dc['id']][_0x63c3('0x4a')](_0x358cb+_0x63c3('0x4c'))){_0x222c7d[_0x63c3('0x41')][_0x1ce6dc['id']][_0x358cb+_0x63c3('0x4c')]=parseInt(_0x1ce6dc[_0x63c3('0x4b')][_0x358cb],0xa);}}}_0x222c7d[_0x63c3('0x41')][_0x1ce6dc['id']][_0x63c3('0x4d')]();return _0x6a29b4({'code':0xc8,'message':_0x222c7d['agents'][_0x1ce6dc['id']]});}else{return _0x446266(_0x1e3826[_0x63c3('0x35')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x3ddbb4){return new Promise(function(_0x50fd2d){var _0x25f13e=_['values'](_0x222c7d[_0x63c3('0x41')]);if(_0x3ddbb4&&_0x3ddbb4['id']){var _0x1d8430=_['find'](_0x25f13e,function(_0x4b5487){return _0x4b5487['id']===_0x3ddbb4['id'];});_0x50fd2d(_0x1d8430);}else{_0x50fd2d({'count':_0x25f13e['length'],'rows':_0x25f13e});}});},'ChatQueues':function(){return new Promise(function(_0x5497fc){var _0x401901=[];for(var _0x5121d4 in _0x222c7d[_0x63c3('0x4e')]){if(_0x222c7d[_0x63c3('0x4e')]['hasOwnProperty'](_0x5121d4)){var _0xaaa6c6=_0x222c7d[_0x63c3('0x4e')][_0x5121d4];var _0x1d4e11={'id':_0xaaa6c6['id'],'available':_0xaaa6c6[_0x63c3('0x4f')],'loggedIn':_0xaaa6c6['loggedIn'],'name':_0xaaa6c6[_0x63c3('0x50')],'paused':_0xaaa6c6[_0x63c3('0x51')],'waiting':_0xaaa6c6[_0x63c3('0x52')]};_0x401901[_0x63c3('0x1f')](_0x1d4e11);}}_0x5497fc({'count':_0x401901['length'],'rows':_0x401901});});},'MailQueues':function(){return new Promise(function(_0x4bc673){var _0x4f0a6d=[];for(var _0x2d38bd in _0x222c7d['mailQueues']){if(_0x222c7d[_0x63c3('0x53')][_0x63c3('0x4a')](_0x2d38bd)){var _0x24002c=_0x222c7d['mailQueues'][_0x2d38bd];var _0x34f530={'id':_0x24002c['id'],'available':_0x24002c['available'],'loggedIn':_0x24002c[_0x63c3('0x54')],'name':_0x24002c[_0x63c3('0x50')],'paused':_0x24002c[_0x63c3('0x51')],'waiting':_0x24002c['waiting']};_0x4f0a6d[_0x63c3('0x1f')](_0x34f530);}}_0x4bc673({'count':_0x4f0a6d[_0x63c3('0x17')],'rows':_0x4f0a6d});});},'OpenchannelQueues':function(){return new Promise(function(_0x548ad4){var _0x41d5f5=[];for(var _0x572b04 in _0x222c7d['openchannelQueues']){if(_0x222c7d[_0x63c3('0x55')][_0x63c3('0x4a')](_0x572b04)){var _0x13bcc4=_0x222c7d[_0x63c3('0x55')][_0x572b04];var _0x14b43f={'id':_0x13bcc4['id'],'available':_0x13bcc4['available'],'loggedIn':_0x13bcc4[_0x63c3('0x54')],'name':_0x13bcc4[_0x63c3('0x50')],'paused':_0x13bcc4[_0x63c3('0x51')],'waiting':_0x13bcc4['waiting']};_0x41d5f5[_0x63c3('0x1f')](_0x14b43f);}}_0x548ad4({'count':_0x41d5f5[_0x63c3('0x17')],'rows':_0x41d5f5});});},'SmsQueues':function(){return new Promise(function(_0x45f1c7){var _0x3d5da5=[];for(var _0x5375e4 in _0x222c7d['smsQueues']){if(_0x222c7d[_0x63c3('0x56')][_0x63c3('0x4a')](_0x5375e4)){var _0x585eca=_0x222c7d[_0x63c3('0x56')][_0x5375e4];var _0x3a3517={'id':_0x585eca['id'],'available':_0x585eca['available'],'loggedIn':_0x585eca[_0x63c3('0x54')],'name':_0x585eca[_0x63c3('0x50')],'paused':_0x585eca[_0x63c3('0x51')],'waiting':_0x585eca[_0x63c3('0x52')]};_0x3d5da5[_0x63c3('0x1f')](_0x3a3517);}}_0x45f1c7({'count':_0x3d5da5[_0x63c3('0x17')],'rows':_0x3d5da5});});},'FaxQueues':function(){return new Promise(function(_0x2d6568){var _0x32b88c=[];for(var _0xe482a in _0x222c7d[_0x63c3('0x57')]){if(_0x222c7d['faxQueues'][_0x63c3('0x4a')](_0xe482a)){var _0x3f5db5=_0x222c7d['faxQueues'][_0xe482a];var _0x385506={'id':_0x3f5db5['id'],'available':_0x3f5db5[_0x63c3('0x4f')],'loggedIn':_0x3f5db5[_0x63c3('0x54')],'name':_0x3f5db5['name'],'paused':_0x3f5db5[_0x63c3('0x51')],'waiting':_0x3f5db5[_0x63c3('0x52')]};_0x32b88c[_0x63c3('0x1f')](_0x385506);}}_0x2d6568({'count':_0x32b88c[_0x63c3('0x17')],'rows':_0x32b88c});});},'WhatsappQueues':function(){return new Promise(function(_0x1cebed){var _0x8c9d02=[];for(var _0x962924 in _0x222c7d[_0x63c3('0x58')]){if(_0x222c7d[_0x63c3('0x58')][_0x63c3('0x4a')](_0x962924)){var _0x53ef88=_0x222c7d[_0x63c3('0x58')][_0x962924];var _0xfabcae={'id':_0x53ef88['id'],'available':_0x53ef88[_0x63c3('0x4f')],'loggedIn':_0x53ef88[_0x63c3('0x54')],'name':_0x53ef88['name'],'paused':_0x53ef88[_0x63c3('0x51')],'waiting':_0x53ef88[_0x63c3('0x52')]};_0x8c9d02[_0x63c3('0x1f')](_0xfabcae);}}_0x1cebed({'count':_0x8c9d02[_0x63c3('0x17')],'rows':_0x8c9d02});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x51061e){var _0x5bc9f8=_[_0x63c3('0x59')](_0x222c7d[_0x63c3('0x5a')]);_0x51061e({'count':_0x5bc9f8[_0x63c3('0x17')],'rows':_0x5bc9f8});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x4227b0){var _0x36f000=_['values'](_0x222c7d[_0x63c3('0x5b')]);_0x4227b0({'count':_0x36f000[_0x63c3('0x17')],'rows':_0x36f000});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x314f80){var _0x3cded0=_[_0x63c3('0x59')](_0x222c7d[_0x63c3('0x5c')]);_0x314f80({'count':_0x3cded0['length'],'rows':_0x3cded0});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x19d988){var _0xb3221a=_['values'](_0x222c7d[_0x63c3('0x5d')]);_0x19d988({'count':_0xb3221a[_0x63c3('0x17')],'rows':_0xb3221a});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x11883f){var _0xa9acd3=_['values'](_0x222c7d[_0x63c3('0x5e')]);_0x11883f({'count':_0xa9acd3[_0x63c3('0x17')],'rows':_0xa9acd3});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x2843af){var _0x535fb4=_[_0x63c3('0x59')](_0x222c7d[_0x63c3('0x5f')]);_0x2843af({'count':_0x535fb4['length'],'rows':_0x535fb4});});}};var _0xfbb4=jayson[_0x63c3('0x60')](_0x5c3a3e)[_0x63c3('0x61')]();_0xfbb4['on'](_0x63c3('0x35'),function(_0x279229){logger[_0x63c3('0x35')](JSON[_0x63c3('0x3a')](_0x279229));return _0x143550(_0x279229);});_0xfbb4['listen'](0x232c,_0x63c3('0x62'),function(){console[_0x63c3('0x63')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x4355e2(_0x63c3('0x64')+0x232c);});});}; \ No newline at end of file +var _0x6a58=['applications','length','existsSync','app','.js','autoreply','appdata','mail','push','slice','join','dialogflow','dialogflowv2','amazonlex','split','message','tag','tvox','getMustacheRender','account','notificationTemplate','ChatWebsiteId','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','Applications\x20executed','stringify','matchPath','emit','complete','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','UserId','catch','message\x20is\x20empty','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','values','find','chatQueues','loggedIn','name','waiting','mailQueues','available','openchannelQueues','smsQueues','faxQueues','paused','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','listen','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','./applications/utils','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','rules','channel','interaction','checkWaitingNotifications','transfer','isArray'];(function(_0x4f1086,_0x8352ec){var _0x2b9e52=function(_0x1feb6e){while(--_0x1feb6e){_0x4f1086['push'](_0x4f1086['shift']());}};_0x2b9e52(++_0x8352ec);}(_0x6a58,0x120));var _0x86a5=function(_0x4c73ac,_0x46b73c){_0x4c73ac=_0x4c73ac-0x0;var _0x9839ee=_0x6a58[_0x4c73ac];return _0x9839ee;};'use strict';var _=require(_0x86a5('0x0'));var util=require(_0x86a5('0x1'));var path=require('path');var fs=require('fs');var jayson=require(_0x86a5('0x2'));var BPromise=require('bluebird');var utils=require(_0x86a5('0x3'));var sUtils=require('./applications/strategy/util');var logger=require(_0x86a5('0x4'))(_0x86a5('0x5'));var rpc={'openchannelQueueReport':require(_0x86a5('0x6')),'mailQueueReport':require(_0x86a5('0x7')),'chatQueueReport':require(_0x86a5('0x8')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0x86a5('0x9')),'whatsappQueueReport':require(_0x86a5('0xa'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x425c8f,_0xe98bdc,_0x43a1a2){return util[_0x86a5('0xb')](_0x86a5('0xc'),_0x425c8f,_0xe98bdc||0x0,_0x43a1a2||0x0);}function getIntervals(_0x3084f3,_0x36e998){var _0x44c8de=[];if(!_[_0x86a5('0xd')](_0x36e998[_0x86a5('0xe')])&&!_['isNil'](_0x3084f3[_0x36e998['IntervalId']])&&!_[_0x86a5('0xd')](_0x3084f3[_0x36e998['IntervalId']][_0x86a5('0xf')])){_0x44c8de=_[_0x86a5('0x10')](_0x3084f3[_0x36e998['IntervalId']][_0x86a5('0xf')],_0x86a5('0x11'));}else if(!_['isNil'](_0x36e998[_0x86a5('0x11')])){_0x44c8de=[_0x36e998[_0x86a5('0x11')]];}return _0x44c8de;}exports['listen']=function(_0x40dcf6){_0x40dcf6[_0x86a5('0x12')]={};return new BPromise(function(_0xc8ccdb,_0x80785c){var _0x41661c={'Start':function(_0x5bbdbe){var _0x485829=this;return new Promise(function(_0x12999d,_0x5c3c99){if(_0x5bbdbe){try{var _0x61d809=[];var _0x2a9b90=getId(_0x5bbdbe[_0x86a5('0x13')],_0x5bbdbe['message']?_0x5bbdbe['message']['id']:0x0,_0x5bbdbe[_0x86a5('0x14')]?_0x5bbdbe[_0x86a5('0x14')]['id']:0x0);var _0x146327=sUtils[_0x86a5('0x15')](_0x40dcf6,_0x5bbdbe);if(_0x5bbdbe[_0x86a5('0x16')]||!_0x146327&&_0x5bbdbe['applications']&&_[_0x86a5('0x17')](_0x5bbdbe['applications'])&&_0x5bbdbe[_0x86a5('0x18')][_0x86a5('0x19')]){for(var _0x7f94ed=0x0;_0x7f94ed<_0x5bbdbe[_0x86a5('0x18')][_0x86a5('0x19')];_0x7f94ed+=0x1){var _0x390feb=_0x5bbdbe[_0x86a5('0x18')][_0x7f94ed];if(fs[_0x86a5('0x1a')](path['join'](__dirname,'applications',_0x390feb[_0x86a5('0x1b')]+_0x86a5('0x1c')))){var _0x54ffc0=[];switch(_0x390feb['app']['toLowerCase']()){case _0x86a5('0x1d'):var _0x2960f7=_0x390feb[_0x86a5('0x1e')]['split'](',');if(_0x5bbdbe['channel']===_0x86a5('0x1f')){_0x54ffc0[_0x86a5('0x20')](_0x2960f7[0x0]);_0x54ffc0[_0x86a5('0x20')](_0x2960f7[0x1]);_0x54ffc0['push'](_0x2960f7[_0x86a5('0x21')](0x2,_0x2960f7['length'])[_0x86a5('0x22')](','));}else{_0x54ffc0['push'](_0x2960f7[0x0]);_0x54ffc0[_0x86a5('0x20')](_0x2960f7[_0x86a5('0x21')](0x1,_0x2960f7[_0x86a5('0x19')])[_0x86a5('0x22')](','));}break;case _0x86a5('0x23'):var _0x887e58=_0x390feb['appdata']['split'](',');_0x54ffc0[_0x86a5('0x20')](_0x887e58[0x0]);_0x54ffc0[_0x86a5('0x20')](_0x887e58[0x1]);_0x54ffc0[_0x86a5('0x20')](_0x887e58[_0x86a5('0x21')](0x2,_0x887e58[_0x86a5('0x19')])[_0x86a5('0x22')](','));break;case _0x86a5('0x24'):var _0x5108f0=_0x390feb[_0x86a5('0x1e')]['split'](',');_0x54ffc0['push'](_0x5108f0[0x0]);_0x54ffc0[_0x86a5('0x20')](_0x5108f0[0x1]);_0x54ffc0['push'](_0x5108f0[0x2]);_0x54ffc0[_0x86a5('0x20')](_0x5108f0[0x3]);_0x54ffc0[_0x86a5('0x20')](_0x5108f0[_0x86a5('0x21')](0x4,_0x5108f0[_0x86a5('0x19')])[_0x86a5('0x22')](','));break;case _0x86a5('0x25'):var _0x20a77b=_0x390feb[_0x86a5('0x1e')][_0x86a5('0x26')](',');_0x54ffc0[_0x86a5('0x20')](_0x20a77b[0x0]);_0x54ffc0[_0x86a5('0x20')](_0x20a77b[0x1]);_0x54ffc0[_0x86a5('0x20')](_0x20a77b[0x2]);_0x54ffc0[_0x86a5('0x20')](_0x20a77b[0x3]);_0x54ffc0[_0x86a5('0x20')](_0x20a77b['slice'](0x4,_0x20a77b[_0x86a5('0x19')])[_0x86a5('0x22')](','));break;case _0x86a5('0x27'):_0x54ffc0[_0x86a5('0x20')](_0x390feb[_0x86a5('0x1e')]);break;case _0x86a5('0x28'):_0x54ffc0[_0x86a5('0x20')](_0x390feb['TagId']);_0x54ffc0['push'](_0x390feb[_0x86a5('0x1e')]);break;case _0x86a5('0x29'):var _0x391ccd=utils[_0x86a5('0x2a')](_0x5bbdbe[_0x86a5('0x2b')][_0x86a5('0x2c')],_0x5bbdbe);var _0x5cfaa1=_0x390feb[_0x86a5('0x1e')][_0x86a5('0x26')](',');_0x54ffc0['push'](_0x5cfaa1[0x0]);_0x54ffc0[_0x86a5('0x20')](_0x5cfaa1[0x1]);_0x54ffc0[_0x86a5('0x20')](_0x5cfaa1[0x2]);_0x54ffc0['push'](_0x5cfaa1[0x3]);_0x54ffc0['push'](_0x5cfaa1[0x4]);_0x54ffc0[_0x86a5('0x20')](_0x5cfaa1[0x5]);_0x54ffc0[_0x86a5('0x20')](_0x5cfaa1[0x6]);_0x54ffc0[_0x86a5('0x20')](_0x5cfaa1[0x7]);_0x54ffc0[_0x86a5('0x20')](_0x5cfaa1[0x8]);_0x54ffc0['push'](_0x5cfaa1[0x9]);_0x54ffc0[_0x86a5('0x20')](_0x5cfaa1[0xa]);_0x54ffc0[_0x86a5('0x20')](_0x5bbdbe[_0x86a5('0x14')]['id']);_0x54ffc0[_0x86a5('0x20')](_0x5bbdbe[_0x86a5('0x27')]['id']);_0x54ffc0['push'](_0x390feb[_0x86a5('0x2d')]);_0x54ffc0[_0x86a5('0x20')](_0x5bbdbe[_0x86a5('0x14')]['ContactId']);_0x54ffc0[_0x86a5('0x20')](_0x5bbdbe['body']['body']);_0x54ffc0['push'](_0x391ccd);break;default:_0x54ffc0=_[_0x86a5('0xd')](_0x390feb[_0x86a5('0x1e')])?[]:_0x390feb['appdata'][_0x86a5('0x26')](',');}var _0x2fedaa={'id':util['format'](_0x86a5('0x2e'),_0x2a9b90,_0x390feb['id'],_0x390feb[_0x86a5('0x1b')]),'condition':require(_0x86a5('0x2f'))[_0x86a5('0x30')](_0x2a9b90,getIntervals(_0x40dcf6[_0x86a5('0x31')],_0x390feb),_0x40dcf6),'consequence':require(_0x86a5('0x32')+_0x390feb[_0x86a5('0x1b')])[_0x86a5('0x33')](_0x2a9b90,_0x54ffc0,_0x40dcf6,_0x5bbdbe),'p':_0x390feb[_0x86a5('0x34')]||0x0};logger[_0x86a5('0x35')](_0x86a5('0x36'),_0x2fedaa['id'],_0x86a5('0x37'),getIntervals(_0x40dcf6[_0x86a5('0x31')],_0x390feb)['join'](_0x86a5('0x38')));_0x61d809['push'](_0x2fedaa);}else{logger[_0x86a5('0x39')](_0x86a5('0x3a'),path[_0x86a5('0x22')](__dirname,_0x86a5('0x18'),_0x390feb[_0x86a5('0x1b')]+'.js'));}}_0x40dcf6[_0x86a5('0x12')][_0x2a9b90]=new RuleEngine(_0x61d809);_0x40dcf6[_0x86a5('0x12')][_0x2a9b90]['execute'](_0x5bbdbe,function(_0x370ce5){logger[_0x86a5('0x35')](_0x86a5('0x3b'),JSON[_0x86a5('0x3c')](_0x370ce5[_0x86a5('0x3d')]));if(_0x40dcf6[_0x86a5('0x12')][_0x2a9b90]){_0x40dcf6[_0x86a5('0x12')][_0x2a9b90][_0x86a5('0x3e')](_0x86a5('0x3f'));}});return _0x12999d({'code':0xc8,'message':_0x5bbdbe});}else{if(_0x146327){logger[_0x86a5('0x35')](util[_0x86a5('0xb')]('Skipped\x20routing\x20for\x20%s',_0x2a9b90));}else{logger['info']('No\x20applications\x20to\x20execute');}return _0x12999d({'code':0xc8,'message':_0x5bbdbe});}}catch(_0x31e041){logger[_0x86a5('0x39')](_0x31e041[_0x86a5('0x40')]);return _0x5c3c99(_0x485829[_0x86a5('0x39')](0x1f4,_0x31e041));}}return _0x5c3c99(_0x86a5('0x41'));});},'AcceptMessage':function(_0x365b2d){var _0x52ef57=this;return new Promise(function(_0x2777e6,_0x1f90e1){if(_0x365b2d['agent']&&_0x365b2d[_0x86a5('0x42')]['id']){if(_0x40dcf6[_0x86a5('0x43')][_0x365b2d[_0x86a5('0x42')]['id']]){_0x40dcf6[_0x86a5('0x43')][_0x365b2d[_0x86a5('0x42')]['id']][_0x86a5('0x44')]=![];_0x40dcf6['agents'][_0x365b2d[_0x86a5('0x42')]['id']][_0x86a5('0x45')]=undefined;}}if(_0x365b2d[_0x86a5('0x27')]&&_0x365b2d[_0x86a5('0x27')]['id']){try{var _0x29d119=getId(_0x365b2d[_0x86a5('0x13')],_0x365b2d[_0x86a5('0x27')]?_0x365b2d['message']['id']:0x0,_0x365b2d['interaction']?_0x365b2d[_0x86a5('0x14')]['id']:0x0);if(_0x40dcf6['rules'][_0x29d119]){_0x40dcf6['rules'][_0x29d119][_0x86a5('0x3e')](_0x86a5('0x46'));if(rpc[_0x365b2d[_0x86a5('0x13')]+_0x86a5('0x47')]){rpc[_0x365b2d[_0x86a5('0x13')]+'QueueReport']['update'](_0x29d119,{'UserId':_0x365b2d[_0x86a5('0x27')][_0x86a5('0x48')]})[_0x86a5('0x49')](function(){logger[_0x86a5('0x39')]('error\x20update\x20queue\x20report');});}}return _0x2777e6({'code':0xc8,'message':_0x365b2d});}catch(_0x2be006){logger[_0x86a5('0x39')](_0x2be006[_0x86a5('0x40')]);return _0x1f90e1(_0x52ef57[_0x86a5('0x39')](0x1f4,_0x2be006));}}logger[_0x86a5('0x39')](_0x86a5('0x4a'));return _0x1f90e1(_0x52ef57[_0x86a5('0x39')](0x1f4,_0x86a5('0x4a')));});},'RejectMessage':function(_0x5d9d3a){var _0x3c7cd3=this;return new Promise(function(_0x2ea352,_0xdd8752){if(_0x5d9d3a[_0x86a5('0x42')]&&_0x5d9d3a[_0x86a5('0x42')]['id']){try{if(_0x40dcf6[_0x86a5('0x43')][_0x5d9d3a[_0x86a5('0x42')]['id']]){_0x40dcf6[_0x86a5('0x43')][_0x5d9d3a[_0x86a5('0x42')]['id']]['busy']=![];_0x40dcf6['agents'][_0x5d9d3a[_0x86a5('0x42')]['id']][_0x86a5('0x45')]=undefined;}return _0x2ea352({'code':0xc8,'message':_0x5d9d3a});}catch(_0x5bca72){logger[_0x86a5('0x39')](_0x5bca72[_0x86a5('0x40')]);return _0xdd8752(_0x3c7cd3[_0x86a5('0x39')](0x1f4,_0x5bca72));}}logger[_0x86a5('0x39')](_0x86a5('0x4a'));return _0xdd8752(_0x3c7cd3[_0x86a5('0x39')](0x1f4,_0x86a5('0x4a')));});},'AbandonInteraction':function(_0x553dd6){var _0x2b039f=this;return new Promise(function(_0x514654,_0x1c32ba){if(_0x553dd6[_0x86a5('0x13')]&&_0x553dd6[_0x86a5('0x14')]&&_0x553dd6['interaction']['id']){try{var _0x2d1e31=getId(_0x553dd6['channel'],_0x553dd6[_0x86a5('0x27')]?_0x553dd6[_0x86a5('0x27')]['id']:0x0,_0x553dd6[_0x86a5('0x14')]?_0x553dd6[_0x86a5('0x14')]['id']:0x0);if(_0x40dcf6['rules'][_0x2d1e31]){_0x40dcf6[_0x86a5('0x12')][_0x2d1e31]['emit'](_0x86a5('0x46'));}return _0x514654({'code':0xc8,'message':_0x553dd6});}catch(_0x31ad18){logger[_0x86a5('0x39')](_0x31ad18['stack']);return _0x1c32ba(_0x2b039f['error'](0x1f4,_0x31ad18));}}logger[_0x86a5('0x39')]('message\x20is\x20empty');return _0x1c32ba(_0x2b039f[_0x86a5('0x39')](0x1f4,_0x86a5('0x4a')));});},'AgentCapacity':function(_0x117172){var _0x1ff4d3=this;return new Promise(function(_0x4d4507,_0x37c20f){if(_0x40dcf6[_0x86a5('0x43')]['hasOwnProperty'](_0x117172['id'])){for(var _0x354bf2 in _0x117172[_0x86a5('0x4b')]){if(_0x117172[_0x86a5('0x4b')][_0x86a5('0x4c')](_0x354bf2)){if(_0x40dcf6['agents'][_0x117172['id']]['hasOwnProperty'](_0x354bf2+_0x86a5('0x4d'))){_0x40dcf6['agents'][_0x117172['id']][_0x354bf2+_0x86a5('0x4d')]=parseInt(_0x117172['capacity'][_0x354bf2],0xa);}}}_0x40dcf6['agents'][_0x117172['id']][_0x86a5('0x4e')]();return _0x4d4507({'code':0xc8,'message':_0x40dcf6[_0x86a5('0x43')][_0x117172['id']]});}else{return _0x37c20f(_0x1ff4d3['error'](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x2ee5ee){return new Promise(function(_0x252a5b){var _0x29feeb=_[_0x86a5('0x4f')](_0x40dcf6['agents']);if(_0x2ee5ee&&_0x2ee5ee['id']){var _0x4da083=_[_0x86a5('0x50')](_0x29feeb,function(_0x123aa0){return _0x123aa0['id']===_0x2ee5ee['id'];});_0x252a5b(_0x4da083);}else{_0x252a5b({'count':_0x29feeb[_0x86a5('0x19')],'rows':_0x29feeb});}});},'ChatQueues':function(){return new Promise(function(_0x80cbf4){var _0x82ef2b=[];for(var _0x581638 in _0x40dcf6[_0x86a5('0x51')]){if(_0x40dcf6['chatQueues']['hasOwnProperty'](_0x581638)){var _0x57a04=_0x40dcf6[_0x86a5('0x51')][_0x581638];var _0x5129a3={'id':_0x57a04['id'],'available':_0x57a04['available'],'loggedIn':_0x57a04[_0x86a5('0x52')],'name':_0x57a04[_0x86a5('0x53')],'paused':_0x57a04['paused'],'waiting':_0x57a04[_0x86a5('0x54')]};_0x82ef2b[_0x86a5('0x20')](_0x5129a3);}}_0x80cbf4({'count':_0x82ef2b['length'],'rows':_0x82ef2b});});},'MailQueues':function(){return new Promise(function(_0x25f354){var _0x101f93=[];for(var _0x19822a in _0x40dcf6[_0x86a5('0x55')]){if(_0x40dcf6[_0x86a5('0x55')][_0x86a5('0x4c')](_0x19822a)){var _0x4000ed=_0x40dcf6[_0x86a5('0x55')][_0x19822a];var _0xa1e498={'id':_0x4000ed['id'],'available':_0x4000ed[_0x86a5('0x56')],'loggedIn':_0x4000ed[_0x86a5('0x52')],'name':_0x4000ed[_0x86a5('0x53')],'paused':_0x4000ed['paused'],'waiting':_0x4000ed[_0x86a5('0x54')]};_0x101f93[_0x86a5('0x20')](_0xa1e498);}}_0x25f354({'count':_0x101f93[_0x86a5('0x19')],'rows':_0x101f93});});},'OpenchannelQueues':function(){return new Promise(function(_0x4f434c){var _0x3b9eaf=[];for(var _0x49b28c in _0x40dcf6[_0x86a5('0x57')]){if(_0x40dcf6['openchannelQueues'][_0x86a5('0x4c')](_0x49b28c)){var _0x44626f=_0x40dcf6[_0x86a5('0x57')][_0x49b28c];var _0x55e284={'id':_0x44626f['id'],'available':_0x44626f[_0x86a5('0x56')],'loggedIn':_0x44626f['loggedIn'],'name':_0x44626f['name'],'paused':_0x44626f['paused'],'waiting':_0x44626f[_0x86a5('0x54')]};_0x3b9eaf[_0x86a5('0x20')](_0x55e284);}}_0x4f434c({'count':_0x3b9eaf[_0x86a5('0x19')],'rows':_0x3b9eaf});});},'SmsQueues':function(){return new Promise(function(_0x2d9b20){var _0x3b3565=[];for(var _0x1370da in _0x40dcf6['smsQueues']){if(_0x40dcf6['smsQueues'][_0x86a5('0x4c')](_0x1370da)){var _0x560de3=_0x40dcf6[_0x86a5('0x58')][_0x1370da];var _0xc612f3={'id':_0x560de3['id'],'available':_0x560de3[_0x86a5('0x56')],'loggedIn':_0x560de3[_0x86a5('0x52')],'name':_0x560de3[_0x86a5('0x53')],'paused':_0x560de3['paused'],'waiting':_0x560de3[_0x86a5('0x54')]};_0x3b3565[_0x86a5('0x20')](_0xc612f3);}}_0x2d9b20({'count':_0x3b3565[_0x86a5('0x19')],'rows':_0x3b3565});});},'FaxQueues':function(){return new Promise(function(_0x264329){var _0x3fda43=[];for(var _0x52f00d in _0x40dcf6['faxQueues']){if(_0x40dcf6[_0x86a5('0x59')][_0x86a5('0x4c')](_0x52f00d)){var _0x3ff58b=_0x40dcf6['faxQueues'][_0x52f00d];var _0x9769f9={'id':_0x3ff58b['id'],'available':_0x3ff58b[_0x86a5('0x56')],'loggedIn':_0x3ff58b[_0x86a5('0x52')],'name':_0x3ff58b[_0x86a5('0x53')],'paused':_0x3ff58b[_0x86a5('0x5a')],'waiting':_0x3ff58b[_0x86a5('0x54')]};_0x3fda43['push'](_0x9769f9);}}_0x264329({'count':_0x3fda43['length'],'rows':_0x3fda43});});},'WhatsappQueues':function(){return new Promise(function(_0x22f153){var _0x471928=[];for(var _0x22d864 in _0x40dcf6[_0x86a5('0x5b')]){if(_0x40dcf6[_0x86a5('0x5b')][_0x86a5('0x4c')](_0x22d864)){var _0x5eddf6=_0x40dcf6[_0x86a5('0x5b')][_0x22d864];var _0x4685da={'id':_0x5eddf6['id'],'available':_0x5eddf6[_0x86a5('0x56')],'loggedIn':_0x5eddf6['loggedIn'],'name':_0x5eddf6[_0x86a5('0x53')],'paused':_0x5eddf6[_0x86a5('0x5a')],'waiting':_0x5eddf6[_0x86a5('0x54')]};_0x471928[_0x86a5('0x20')](_0x4685da);}}_0x22f153({'count':_0x471928['length'],'rows':_0x471928});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x4d6138){var _0xf8807f=_[_0x86a5('0x4f')](_0x40dcf6[_0x86a5('0x5c')]);_0x4d6138({'count':_0xf8807f[_0x86a5('0x19')],'rows':_0xf8807f});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x471b81){var _0x30e2bf=_[_0x86a5('0x4f')](_0x40dcf6[_0x86a5('0x5d')]);_0x471b81({'count':_0x30e2bf['length'],'rows':_0x30e2bf});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x2b829c){var _0x57e00b=_[_0x86a5('0x4f')](_0x40dcf6[_0x86a5('0x5e')]);_0x2b829c({'count':_0x57e00b[_0x86a5('0x19')],'rows':_0x57e00b});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x3dc6f2){var _0x37ea8c=_[_0x86a5('0x4f')](_0x40dcf6[_0x86a5('0x5f')]);_0x3dc6f2({'count':_0x37ea8c['length'],'rows':_0x37ea8c});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x18bad5){var _0x47043b=_[_0x86a5('0x4f')](_0x40dcf6[_0x86a5('0x60')]);_0x18bad5({'count':_0x47043b[_0x86a5('0x19')],'rows':_0x47043b});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x3691f1){var _0x35cfcb=_[_0x86a5('0x4f')](_0x40dcf6[_0x86a5('0x61')]);_0x3691f1({'count':_0x35cfcb[_0x86a5('0x19')],'rows':_0x35cfcb});});}};var _0x4ea208=jayson[_0x86a5('0x62')](_0x41661c)[_0x86a5('0x63')]();_0x4ea208['on'](_0x86a5('0x39'),function(_0x2a5853){logger[_0x86a5('0x39')](JSON['stringify'](_0x2a5853));return _0x80785c(_0x2a5853);});_0x4ea208[_0x86a5('0x64')](0x232c,_0x86a5('0x65'),function(){console['log'](_0x86a5('0x66'),0x232c);return _0xc8ccdb(_0x86a5('0x67')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 299527b..9ceef06 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 _0x4127=['[%s][INTERVAL]\x20ROUTING\x20STOPPED','map','some','[%s][INTERVAL\x20VALID]\x20%s\x20%s','join','\x20|\x20','when','[%s][INTERVAL\x20NOT\x20VALID]\x20%s\x20%s','stop','lodash','iftime','../../../config/logger','condition','rules','info'];(function(_0x204f45,_0x225d77){var _0x30badd=function(_0x318089){while(--_0x318089){_0x204f45['push'](_0x204f45['shift']());}};_0x30badd(++_0x225d77);}(_0x4127,0x72));var _0x7412=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x4127[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7412('0x0'));var iftime=require('../../../utils/iftime')[_0x7412('0x1')];var logger=require(_0x7412('0x2'))('routing');exports[_0x7412('0x3')]=function(_0x249abc,_0x4daa03,_0x2dc124){return function(_0x361219){if(_0x2dc124[_0x7412('0x4')]&&!_0x2dc124[_0x7412('0x4')][_0x249abc]){logger[_0x7412('0x5')](_0x7412('0x6'),_0x249abc);return _0x361219['stop']();}var _0x435b7c=_0x4daa03[_0x7412('0x7')](function(_0x4dfd4c){return iftime(_0x4dfd4c);});var _0x41c816=_[_0x7412('0x8')](_0x435b7c);if(_0x41c816){logger[_0x7412('0x5')](_0x7412('0x9'),_0x249abc,_0x4daa03[_0x7412('0xa')](_0x7412('0xb')),_0x41c816);_0x361219[_0x7412('0xc')](_0x41c816);}else{logger[_0x7412('0x5')](_0x7412('0xd'),_0x249abc,_0x4daa03['join'](_0x7412('0xb')));_0x361219[_0x7412('0xe')]();}};}; \ No newline at end of file +var _0x7163=['join','stop','lodash','iftime','../../../config/logger','routing','condition','rules','info','map','some','[%s][INTERVAL\x20VALID]\x20%s\x20%s','\x20|\x20','when','[%s][INTERVAL\x20NOT\x20VALID]\x20%s\x20%s'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0x7163,0x1a6));var _0x3716=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0x7163[_0x346737];return _0x1ade2e;};'use strict';var _=require(_0x3716('0x0'));var iftime=require('../../../utils/iftime')[_0x3716('0x1')];var logger=require(_0x3716('0x2'))(_0x3716('0x3'));exports[_0x3716('0x4')]=function(_0x112f2b,_0x3205d1,_0x11fae9){return function(_0x5f0990){if(_0x11fae9[_0x3716('0x5')]&&!_0x11fae9[_0x3716('0x5')][_0x112f2b]){logger[_0x3716('0x6')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x112f2b);return _0x5f0990['stop']();}var _0x5acb69=_0x3205d1[_0x3716('0x7')](function(_0x146bcf){return iftime(_0x146bcf);});var _0x474090=_[_0x3716('0x8')](_0x5acb69);if(_0x474090){logger[_0x3716('0x6')](_0x3716('0x9'),_0x112f2b,_0x3205d1['join'](_0x3716('0xa')),_0x474090);_0x5f0990[_0x3716('0xb')](_0x474090);}else{logger['info'](_0x3716('0xc'),_0x112f2b,_0x3205d1[_0x3716('0xd')](_0x3716('0xa')));_0x5f0990[_0x3716('0xe')]();}};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 5131697..96d4bdd 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 _0x087b=['calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','diffTime','lodash','util','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentcomplete','acw','acwtime','agentacw','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','debug','[%s][agents][agentcalled]','agentcalledAt','now','called','connectedlinename','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentringnoanswer]','agentringnoanswerAt','reason','timeout','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswer','abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','answeredelsewheredestinationuniqueid','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','isNil','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone'];(function(_0x404cd2,_0x1a8a08){var _0x5e8497=function(_0xbcc2a2){while(--_0xbcc2a2){_0x404cd2['push'](_0x404cd2['shift']());}};_0x5e8497(++_0x1a8a08);}(_0x087b,0x11a));var _0xb087=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0x087b[_0x47fd36];return _0x21a0fc;};'use strict';var _=require(_0xb087('0x0'));var util=require(_0xb087('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x5f3606,_0x40e6d6){utils['info'](util[_0xb087('0x2')](_0xb087('0x3'),_0x5f3606[_0xb087('0x4')],_0x5f3606[_0xb087('0x5')],_0x5f3606[_0xb087('0x6')],_0x5f3606[_0xb087('0x7')],_0x5f3606[_0xb087('0x8')],_0x5f3606[_0xb087('0x9')],_0x5f3606[_0xb087('0xa')],_0x5f3606[_0xb087('0xb')]));if(_0x5f3606[_0xb087('0x6')]){utils[_0xb087('0xc')](_0x5f3606[_0xb087('0x6')])[_0xb087('0xd')](function(_0x2f14bc){if(_0x2f14bc){_0x5f3606[_0xb087('0xe')]=_0x2f14bc[_0xb087('0xe')];_0x5f3606['agentacw']=_0x5f3606[_0xb087('0xf')]?_0x2f14bc[_0xb087('0x10')]:![];_0x5f3606[_0xb087('0x11')]=_0x5f3606[_0xb087('0x12')]?_0x2f14bc[_0xb087('0x13')]:0x0;}utils[_0xb087('0x14')](_0xb087('0x15'),_0x5f3606);});}else{utils['request'](_0xb087('0x15'),_0x5f3606);}if(_0x40e6d6){delete transfers[_0x5f3606[_0xb087('0x4')]];}else{delete agents[_0x5f3606[_0xb087('0x16')]];}}exports['agentcalled']=function(_0x3001e3){try{utils[_0xb087('0x17')](util[_0xb087('0x2')](_0xb087('0x18'),_0x3001e3[_0xb087('0x4')]),_0x3001e3);agents[_0x3001e3[_0xb087('0x16')]]=_0x3001e3;agents[_0x3001e3[_0xb087('0x16')]][_0xb087('0x19')]=utils[_0xb087('0x1a')]();agents[_0x3001e3[_0xb087('0x16')]]['lastevent']=_0xb087('0x1b');agents[_0x3001e3[_0xb087('0x16')]]['connectedlinenum']=null;agents[_0x3001e3[_0xb087('0x16')]][_0xb087('0x1c')]=null;utils[_0xb087('0x1d')](util['format'](_0xb087('0x1e'),_0x3001e3[_0xb087('0x4')],agents[_0x3001e3[_0xb087('0x16')]][_0xb087('0x7')],_0x3001e3['destuniqueid']));}catch(_0x13d534){utils[_0xb087('0x1f')](util[_0xb087('0x2')](_0xb087('0x18'),_0x3001e3['uniqueid']),_0x13d534);}};exports['agentringnoanswer']=function(_0x5ea3dc){try{if(!_['isNil'](agents[_0x5ea3dc[_0xb087('0x16')]])){utils[_0xb087('0x17')](util[_0xb087('0x2')](_0xb087('0x20'),_0x5ea3dc[_0xb087('0x4')]),_0x5ea3dc);utils[_0xb087('0x1d')](util[_0xb087('0x2')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x5ea3dc[_0xb087('0x4')],agents[_0x5ea3dc[_0xb087('0x16')]][_0xb087('0x7')],_0x5ea3dc[_0xb087('0x16')]));agents[_0x5ea3dc[_0xb087('0x16')]]['agentringnoanswer']=!![];agents[_0x5ea3dc[_0xb087('0x16')]][_0xb087('0x21')]=utils['now']();agents[_0x5ea3dc['destuniqueid']]['lastevent']='timeout';agents[_0x5ea3dc['destuniqueid']][_0xb087('0x22')]=_0xb087('0x23');agents[_0x5ea3dc[_0xb087('0x16')]][_0xb087('0x24')]=_0x5ea3dc[_0xb087('0x25')]?parseInt(_0x5ea3dc[_0xb087('0x25')])/0x3e8:0x0;agents[_0x5ea3dc[_0xb087('0x16')]][_0xb087('0x26')]=0x0;unanswered[_0xb087('0x27')](_0x5ea3dc[_0xb087('0x16')]);}}catch(_0x18058c){utils[_0xb087('0x1f')](util[_0xb087('0x2')](_0xb087('0x20'),_0x5ea3dc['uniqueid']),_0x18058c);}};exports[_0xb087('0x28')]=function(_0x1335d9){try{_[_0xb087('0x29')](agents,function(_0x15c9ac,_0x22d441){if(_0x15c9ac[_0xb087('0x4')]==_0x1335d9[_0xb087('0x4')]&&!_[_0xb087('0x2a')](unanswered,_0x15c9ac['destuniqueid'])){utils['debug'](util[_0xb087('0x2')](_0xb087('0x2b'),_0x1335d9['uniqueid']),_0x1335d9);utils[_0xb087('0x1d')](util[_0xb087('0x2')](_0xb087('0x2c'),_0x1335d9[_0xb087('0x4')],_0x15c9ac[_0xb087('0x7')],_0x15c9ac[_0xb087('0x16')]));_0x15c9ac[_0xb087('0x2d')]=!![];_0x15c9ac[_0xb087('0x21')]=utils[_0xb087('0x1a')]();_0x15c9ac[_0xb087('0xb')]=_0xb087('0x2e');_0x15c9ac[_0xb087('0x22')]='abandoned';_0x15c9ac[_0xb087('0x24')]=_0x1335d9['holdtime'];_0x15c9ac[_0xb087('0x26')]=0x0;writeDB(_0x15c9ac);}});}catch(_0x296e9b){utils[_0xb087('0x1f')](util[_0xb087('0x2')](_0xb087('0x2b'),_0x1335d9[_0xb087('0x4')]),_0x296e9b);}};exports[_0xb087('0x2f')]=function(_0x29df58){try{if(agents[_0x29df58[_0xb087('0x16')]]){utils['debug'](util['format'](_0xb087('0x30'),_0x29df58[_0xb087('0x4')]),_0x29df58);utils[_0xb087('0x1d')](util[_0xb087('0x2')](_0xb087('0x31'),_0x29df58['uniqueid'],agents[_0x29df58[_0xb087('0x16')]][_0xb087('0x7')],_0x29df58['destuniqueid']));agents[_0x29df58['destuniqueid']][_0xb087('0x32')]=utils[_0xb087('0x1a')]();agents[_0x29df58[_0xb087('0x16')]]['connectedlinenum']=_0x29df58[_0xb087('0xa')];agents[_0x29df58[_0xb087('0x16')]][_0xb087('0x1c')]=_0x29df58[_0xb087('0x1c')];agents[_0x29df58[_0xb087('0x16')]]['holdtime']=_0x29df58[_0xb087('0x25')];agents[_0x29df58['destuniqueid']][_0xb087('0xb')]='connect';_[_0xb087('0x29')](agents,function(_0xc9f9e9,_0x513332){if(_0xc9f9e9[_0xb087('0x16')]!=_0x29df58['destuniqueid']&&_0xc9f9e9[_0xb087('0x4')]==_0x29df58['uniqueid']){_0xc9f9e9[_0xb087('0x26')]=0x0;_0xc9f9e9[_0xb087('0x24')]=_0x29df58[_0xb087('0x25')];_0xc9f9e9[_0xb087('0x2d')]=!![];_0xc9f9e9[_0xb087('0x21')]=utils[_0xb087('0x1a')]();_0xc9f9e9[_0xb087('0xb')]='answered_elsewhere';_0xc9f9e9[_0xb087('0x22')]='answered_elsewhere';_0xc9f9e9[_0xb087('0x33')]=_0x29df58[_0xb087('0x16')];_0xc9f9e9['answeredelsewheremembername']=_0x29df58[_0xb087('0x7')];writeDB(_0xc9f9e9);}});}}catch(_0x45dc6f){utils[_0xb087('0x1f')](util['format'](_0xb087('0x30'),_0x29df58['uniqueid']),_0x45dc6f);}};exports[_0xb087('0xf')]=function(_0x32b9d3){try{if(!_['isNil'](agents[_0x32b9d3[_0xb087('0x16')]])){utils[_0xb087('0x17')](util['format'](_0xb087('0x34'),_0x32b9d3[_0xb087('0x4')]),_0x32b9d3);utils['info'](util[_0xb087('0x2')](_0xb087('0x35'),_0x32b9d3[_0xb087('0x4')],agents[_0x32b9d3[_0xb087('0x16')]]['membername'],_0x32b9d3['destuniqueid']));agents[_0x32b9d3[_0xb087('0x16')]][_0xb087('0xf')]=!![];agents[_0x32b9d3[_0xb087('0x16')]][_0xb087('0x36')]=utils[_0xb087('0x1a')]();agents[_0x32b9d3[_0xb087('0x16')]]['talktime']=utils['diffTime'](agents[_0x32b9d3[_0xb087('0x16')]]['agentcompleteAt'],agents[_0x32b9d3[_0xb087('0x16')]][_0xb087('0x32')]);agents[_0x32b9d3[_0xb087('0x16')]][_0xb087('0x22')]=_0x32b9d3['reason'];agents[_0x32b9d3[_0xb087('0x16')]]['lastevent']=_0xb087('0x37');writeDB(agents[_0x32b9d3[_0xb087('0x16')]]);}}catch(_0xcb56c7){utils[_0xb087('0x1f')](util[_0xb087('0x2')]('[%s][agents][agentcomplete]',_0x32b9d3[_0xb087('0x4')]),_0xcb56c7);}};exports[_0xb087('0x38')]=function(_0x588d96){try{if(!_['isNil'](agents[_0x588d96[_0xb087('0x39')]])){utils['debug'](util['format'](_0xb087('0x3a'),_0x588d96[_0xb087('0x4')]),_0x588d96);utils['info'](util[_0xb087('0x2')](_0xb087('0x3b'),_0x588d96[_0xb087('0x4')],agents[_0x588d96['transfereruniqueid']]['membername'],agents[_0x588d96[_0xb087('0x39')]]['uniqueid']));agents[_0x588d96['transfereruniqueid']][_0xb087('0x3c')]=!![];agents[_0x588d96[_0xb087('0x39')]][_0xb087('0x3d')]=_0xb087('0x3e');agents[_0x588d96[_0xb087('0x39')]][_0xb087('0x3f')]=_0x588d96[_0xb087('0x40')];agents[_0x588d96[_0xb087('0x39')]][_0xb087('0x41')]=agents[_0x588d96[_0xb087('0x39')]][_0xb087('0x4')];}}catch(_0x2cfc44){utils['error'](util[_0xb087('0x2')](_0xb087('0x3a'),_0x588d96['uniqueid']),_0x2cfc44);}};exports[_0xb087('0x42')]=function(_0x458301){try{utils[_0xb087('0x17')](util[_0xb087('0x2')](_0xb087('0x43'),_0x458301[_0xb087('0x44')]),_0x458301);if(_0x458301[_0xb087('0x44')]==_0x458301[_0xb087('0x45')]){if(!_[_0xb087('0x46')](agents[_0x458301[_0xb087('0x47')]])){utils[_0xb087('0x1d')](util['format'](_0xb087('0x48'),_0x458301['origtransfereruniqueid'],agents[_0x458301[_0xb087('0x47')]]['membername']));agents[_0x458301[_0xb087('0x47')]][_0xb087('0x3c')]=!![];agents[_0x458301[_0xb087('0x47')]][_0xb087('0x3d')]=_0xb087('0x49');agents[_0x458301[_0xb087('0x47')]][_0xb087('0x3f')]=_0x458301[_0xb087('0x4a')];agents[_0x458301[_0xb087('0x47')]][_0xb087('0x41')]=_0x458301[_0xb087('0x44')];}if(_0x458301[_0xb087('0x4b')]&&agents[_0x458301[_0xb087('0x4b')]]){agents[_0x458301[_0xb087('0x4b')]][_0xb087('0x4c')]=0x1;transfers[_0x458301[_0xb087('0x4b')]]=_[_0xb087('0x4d')](agents[_0x458301[_0xb087('0x4b')]]);transfers[_0x458301[_0xb087('0x4b')]][_0xb087('0x9')]=agents[_0x458301[_0xb087('0x47')]][_0xb087('0x9')];transfers[_0x458301['transfereeuniqueid']][_0xb087('0x4e')]=agents[_0x458301[_0xb087('0x47')]][_0xb087('0x4e')];transfers[_0x458301['transfereeuniqueid']][_0xb087('0x19')]=utils[_0xb087('0x1a')]();transfers[_0x458301['transfereeuniqueid']][_0xb087('0x32')]=utils[_0xb087('0x1a')]();transfers[_0x458301[_0xb087('0x4b')]]['holdtime']=0x0;transfers[_0x458301[_0xb087('0x4b')]][_0xb087('0x4c')]=0x2;}}else if(_0x458301[_0xb087('0x47')]==_0x458301[_0xb087('0x4f')]){if(!_[_0xb087('0x46')](agents[_0x458301[_0xb087('0x44')]])){utils[_0xb087('0x1d')](util[_0xb087('0x2')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x458301[_0xb087('0x44')],agents[_0x458301[_0xb087('0x44')]][_0xb087('0x7')]));agents[_0x458301['origtransfereruniqueid']][_0xb087('0x3c')]=!![];agents[_0x458301['origtransfereruniqueid']]['transfertype']=_0xb087('0x49');agents[_0x458301[_0xb087('0x44')]]['transferexten']=_0x458301[_0xb087('0x50')];agents[_0x458301['origtransfereruniqueid']][_0xb087('0x41')]=_0x458301[_0xb087('0x47')];}if(_0x458301['transfertargetuniqueid']&&agents[_0x458301['transfertargetuniqueid']]){agents[_0x458301[_0xb087('0x51')]]['agententerreason']=0x1;transfers[_0x458301['transfertargetuniqueid']]=_[_0xb087('0x4d')](agents[_0x458301['transfertargetuniqueid']]);transfers[_0x458301[_0xb087('0x51')]]['calleridnum']=agents[_0x458301[_0xb087('0x44')]][_0xb087('0x9')];transfers[_0x458301[_0xb087('0x51')]][_0xb087('0x4e')]=agents[_0x458301[_0xb087('0x44')]][_0xb087('0x4e')];transfers[_0x458301['transfertargetuniqueid']][_0xb087('0x19')]=utils['now']();transfers[_0x458301[_0xb087('0x51')]][_0xb087('0x32')]=utils[_0xb087('0x1a')]();transfers[_0x458301['transfertargetuniqueid']][_0xb087('0x24')]=0x0;transfers[_0x458301['transfertargetuniqueid']][_0xb087('0x4c')]=0x2;}}}catch(_0x3784f7){utils[_0xb087('0x1f')](util[_0xb087('0x2')](_0xb087('0x43'),_0x458301[_0xb087('0x44')]),_0x3784f7);}};exports['hangup']=function(_0x245d68){try{utils[_0xb087('0x17')](util['format'](_0xb087('0x52'),_0x245d68['uniqueid']),_0x245d68);if(agents[_0x245d68[_0xb087('0x4')]]&&agents[_0x245d68[_0xb087('0x4')]][_0xb087('0x22')]===_0xb087('0x23')){if(_0x245d68[_0xb087('0x53')]==='21'){agents[_0x245d68[_0xb087('0x4')]][_0xb087('0x22')]=_0xb087('0x54');agents[_0x245d68['uniqueid']]['lastevent']='rejected';}utils[_0xb087('0x1d')](util['format'](_0xb087('0x55'),_0x245d68['uniqueid'],agents[_0x245d68[_0xb087('0x4')]][_0xb087('0x7')],agents[_0x245d68[_0xb087('0x4')]][_0xb087('0x22')],agents[_0x245d68['uniqueid']][_0xb087('0xb')]));writeDB(agents[_0x245d68['uniqueid']]);var _0x185102=unanswered[_0xb087('0x56')](_0x245d68[_0xb087('0x4')]);if(_0x185102>-0x1){unanswered[_0xb087('0x57')](_0x185102,0x1);}}if(transfers[_0x245d68['uniqueid']]){transfers[_0x245d68['uniqueid']][_0xb087('0xf')]=!![];transfers[_0x245d68['uniqueid']][_0xb087('0x36')]=utils[_0xb087('0x1a')]();transfers[_0x245d68[_0xb087('0x4')]][_0xb087('0x26')]=utils['diffTime'](transfers[_0x245d68['uniqueid']][_0xb087('0x36')],transfers[_0x245d68['uniqueid']][_0xb087('0x32')]);transfers[_0x245d68[_0xb087('0x4')]][_0xb087('0x22')]=_0xb087('0x58');transfers[_0x245d68[_0xb087('0x4')]]['lastevent']=_0xb087('0x37');utils[_0xb087('0x1d')](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x245d68['uniqueid'],transfers[_0x245d68[_0xb087('0x4')]][_0xb087('0x7')],transfers[_0x245d68[_0xb087('0x4')]][_0xb087('0x22')],transfers[_0x245d68[_0xb087('0x4')]][_0xb087('0xb')]));writeDB(transfers[_0x245d68['uniqueid']],!![]);}if(agents[_0x245d68[_0xb087('0x4')]]&&agents[_0x245d68[_0xb087('0x4')]][_0xb087('0x32')]){agents[_0x245d68[_0xb087('0x4')]][_0xb087('0xf')]=!![];agents[_0x245d68[_0xb087('0x4')]][_0xb087('0x36')]=utils['now']();agents[_0x245d68[_0xb087('0x4')]][_0xb087('0x26')]=utils[_0xb087('0x59')](agents[_0x245d68['uniqueid']][_0xb087('0x36')],agents[_0x245d68['uniqueid']][_0xb087('0x32')]);agents[_0x245d68[_0xb087('0x4')]][_0xb087('0x22')]=agents[_0x245d68[_0xb087('0x4')]][_0xb087('0x3c')]?_0xb087('0x3c'):'agent';agents[_0x245d68['uniqueid']][_0xb087('0xb')]=_0xb087('0x37');utils['info'](util[_0xb087('0x2')](_0xb087('0x55'),_0x245d68[_0xb087('0x4')],agents[_0x245d68[_0xb087('0x4')]][_0xb087('0x7')],agents[_0x245d68[_0xb087('0x4')]]['reason'],agents[_0x245d68[_0xb087('0x4')]][_0xb087('0xb')]));writeDB(agents[_0x245d68[_0xb087('0x4')]]);}}catch(_0x3114ce){utils[_0xb087('0x1f')](util[_0xb087('0x2')](_0xb087('0x52'),_0x245d68[_0xb087('0x4')]),_0x3114ce);}}; \ No newline at end of file +var _0x8f59=['transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','origtransfererexten','transfereeuniqueid','clone','calleridname','agententerreason','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','lodash','util','./utils','info','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','interface','calleridnum','connectedlinenum','getVoiceQueueByName','then','type','agentacw','agentcomplete','acwtime','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','lastevent','called','connectedlinename','format','membername','error','agentringnoanswer','[%s][agents][agentringnoanswer]','agentringnoanswerAt','reason','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','abandoned','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','answered_elsewhere','answeredelsewheredestinationuniqueid','[%s][agents][agentconnect]','isNil','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diffTime','agentcompleteAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]'];(function(_0x248ffe,_0x52fe3e){var _0x354c53=function(_0x3a7554){while(--_0x3a7554){_0x248ffe['push'](_0x248ffe['shift']());}};_0x354c53(++_0x52fe3e);}(_0x8f59,0x11d));var _0x98f5=function(_0x5de6c7,_0x350ee6){_0x5de6c7=_0x5de6c7-0x0;var _0x3aaa63=_0x8f59[_0x5de6c7];return _0x3aaa63;};'use strict';var _=require(_0x98f5('0x0'));var util=require(_0x98f5('0x1'));var utils=require(_0x98f5('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0xe809bb,_0x1d9fb3){utils[_0x98f5('0x3')](util['format'](_0x98f5('0x4'),_0xe809bb[_0x98f5('0x5')],_0xe809bb[_0x98f5('0x6')],_0xe809bb[_0x98f5('0x7')],_0xe809bb['membername'],_0xe809bb[_0x98f5('0x8')],_0xe809bb[_0x98f5('0x9')],_0xe809bb[_0x98f5('0xa')],_0xe809bb['lastevent']));if(_0xe809bb['queue']){utils[_0x98f5('0xb')](_0xe809bb[_0x98f5('0x7')])[_0x98f5('0xc')](function(_0x53493e){if(_0x53493e){_0xe809bb[_0x98f5('0xd')]=_0x53493e[_0x98f5('0xd')];_0xe809bb[_0x98f5('0xe')]=_0xe809bb[_0x98f5('0xf')]?_0x53493e['acw']:![];_0xe809bb[_0x98f5('0x10')]=_0xe809bb['agentacw']?_0x53493e['acwTimeout']:0x0;}utils[_0x98f5('0x11')](_0x98f5('0x12'),_0xe809bb);});}else{utils['request'](_0x98f5('0x12'),_0xe809bb);}if(_0x1d9fb3){delete transfers[_0xe809bb[_0x98f5('0x5')]];}else{delete agents[_0xe809bb[_0x98f5('0x13')]];}}exports[_0x98f5('0x14')]=function(_0x3286f7){try{utils[_0x98f5('0x15')](util['format'](_0x98f5('0x16'),_0x3286f7[_0x98f5('0x5')]),_0x3286f7);agents[_0x3286f7['destuniqueid']]=_0x3286f7;agents[_0x3286f7[_0x98f5('0x13')]][_0x98f5('0x17')]=utils[_0x98f5('0x18')]();agents[_0x3286f7['destuniqueid']][_0x98f5('0x19')]=_0x98f5('0x1a');agents[_0x3286f7[_0x98f5('0x13')]]['connectedlinenum']=null;agents[_0x3286f7[_0x98f5('0x13')]][_0x98f5('0x1b')]=null;utils['info'](util[_0x98f5('0x1c')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x3286f7[_0x98f5('0x5')],agents[_0x3286f7[_0x98f5('0x13')]][_0x98f5('0x1d')],_0x3286f7[_0x98f5('0x13')]));}catch(_0xd6f409){utils[_0x98f5('0x1e')](util['format'](_0x98f5('0x16'),_0x3286f7['uniqueid']),_0xd6f409);}};exports[_0x98f5('0x1f')]=function(_0x191f23){try{if(!_['isNil'](agents[_0x191f23[_0x98f5('0x13')]])){utils[_0x98f5('0x15')](util[_0x98f5('0x1c')](_0x98f5('0x20'),_0x191f23[_0x98f5('0x5')]),_0x191f23);utils[_0x98f5('0x3')](util[_0x98f5('0x1c')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x191f23[_0x98f5('0x5')],agents[_0x191f23['destuniqueid']][_0x98f5('0x1d')],_0x191f23['destuniqueid']));agents[_0x191f23[_0x98f5('0x13')]][_0x98f5('0x1f')]=!![];agents[_0x191f23[_0x98f5('0x13')]][_0x98f5('0x21')]=utils[_0x98f5('0x18')]();agents[_0x191f23[_0x98f5('0x13')]][_0x98f5('0x19')]='timeout';agents[_0x191f23[_0x98f5('0x13')]][_0x98f5('0x22')]='timeout';agents[_0x191f23[_0x98f5('0x13')]][_0x98f5('0x23')]=_0x191f23[_0x98f5('0x24')]?parseInt(_0x191f23[_0x98f5('0x24')])/0x3e8:0x0;agents[_0x191f23[_0x98f5('0x13')]][_0x98f5('0x25')]=0x0;unanswered[_0x98f5('0x26')](_0x191f23[_0x98f5('0x13')]);}}catch(_0x576c4b){utils['error'](util[_0x98f5('0x1c')](_0x98f5('0x20'),_0x191f23[_0x98f5('0x5')]),_0x576c4b);}};exports[_0x98f5('0x27')]=function(_0x15bf92){try{_[_0x98f5('0x28')](agents,function(_0x5e9d73,_0x29e1f5){if(_0x5e9d73[_0x98f5('0x5')]==_0x15bf92[_0x98f5('0x5')]&&!_[_0x98f5('0x29')](unanswered,_0x5e9d73[_0x98f5('0x13')])){utils[_0x98f5('0x15')](util['format'](_0x98f5('0x2a'),_0x15bf92[_0x98f5('0x5')]),_0x15bf92);utils[_0x98f5('0x3')](util[_0x98f5('0x1c')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x15bf92[_0x98f5('0x5')],_0x5e9d73[_0x98f5('0x1d')],_0x5e9d73[_0x98f5('0x13')]));_0x5e9d73[_0x98f5('0x1f')]=!![];_0x5e9d73[_0x98f5('0x21')]=utils[_0x98f5('0x18')]();_0x5e9d73[_0x98f5('0x19')]=_0x98f5('0x2b');_0x5e9d73[_0x98f5('0x22')]=_0x98f5('0x2b');_0x5e9d73[_0x98f5('0x23')]=_0x15bf92[_0x98f5('0x23')];_0x5e9d73[_0x98f5('0x25')]=0x0;writeDB(_0x5e9d73);}});}catch(_0xe4a944){utils[_0x98f5('0x1e')](util[_0x98f5('0x1c')](_0x98f5('0x2a'),_0x15bf92[_0x98f5('0x5')]),_0xe4a944);}};exports[_0x98f5('0x2c')]=function(_0x39d935){try{if(agents[_0x39d935['destuniqueid']]){utils[_0x98f5('0x15')](util['format']('[%s][agents][agentconnect]',_0x39d935[_0x98f5('0x5')]),_0x39d935);utils[_0x98f5('0x3')](util[_0x98f5('0x1c')](_0x98f5('0x2d'),_0x39d935['uniqueid'],agents[_0x39d935[_0x98f5('0x13')]][_0x98f5('0x1d')],_0x39d935[_0x98f5('0x13')]));agents[_0x39d935['destuniqueid']][_0x98f5('0x2e')]=utils[_0x98f5('0x18')]();agents[_0x39d935['destuniqueid']][_0x98f5('0xa')]=_0x39d935[_0x98f5('0xa')];agents[_0x39d935[_0x98f5('0x13')]]['connectedlinename']=_0x39d935[_0x98f5('0x1b')];agents[_0x39d935[_0x98f5('0x13')]][_0x98f5('0x23')]=_0x39d935[_0x98f5('0x24')];agents[_0x39d935[_0x98f5('0x13')]]['lastevent']='connect';_[_0x98f5('0x28')](agents,function(_0x14faf2,_0x33e6e2){if(_0x14faf2[_0x98f5('0x13')]!=_0x39d935[_0x98f5('0x13')]&&_0x14faf2[_0x98f5('0x5')]==_0x39d935['uniqueid']){_0x14faf2['talktime']=0x0;_0x14faf2[_0x98f5('0x23')]=_0x39d935[_0x98f5('0x24')];_0x14faf2[_0x98f5('0x1f')]=!![];_0x14faf2[_0x98f5('0x21')]=utils['now']();_0x14faf2['lastevent']=_0x98f5('0x2f');_0x14faf2[_0x98f5('0x22')]=_0x98f5('0x2f');_0x14faf2[_0x98f5('0x30')]=_0x39d935['destuniqueid'];_0x14faf2['answeredelsewheremembername']=_0x39d935[_0x98f5('0x1d')];writeDB(_0x14faf2);}});}}catch(_0x3a191f){utils[_0x98f5('0x1e')](util['format'](_0x98f5('0x31'),_0x39d935['uniqueid']),_0x3a191f);}};exports[_0x98f5('0xf')]=function(_0x4ff7b0){try{if(!_[_0x98f5('0x32')](agents[_0x4ff7b0[_0x98f5('0x13')]])){utils[_0x98f5('0x15')](util['format'](_0x98f5('0x33'),_0x4ff7b0[_0x98f5('0x5')]),_0x4ff7b0);utils['info'](util[_0x98f5('0x1c')](_0x98f5('0x34'),_0x4ff7b0['uniqueid'],agents[_0x4ff7b0[_0x98f5('0x13')]]['membername'],_0x4ff7b0[_0x98f5('0x13')]));agents[_0x4ff7b0[_0x98f5('0x13')]]['agentcomplete']=!![];agents[_0x4ff7b0['destuniqueid']]['agentcompleteAt']=utils['now']();agents[_0x4ff7b0[_0x98f5('0x13')]]['talktime']=utils[_0x98f5('0x35')](agents[_0x4ff7b0[_0x98f5('0x13')]][_0x98f5('0x36')],agents[_0x4ff7b0[_0x98f5('0x13')]][_0x98f5('0x2e')]);agents[_0x4ff7b0[_0x98f5('0x13')]]['reason']=_0x4ff7b0[_0x98f5('0x22')];agents[_0x4ff7b0[_0x98f5('0x13')]][_0x98f5('0x19')]=_0x98f5('0x37');writeDB(agents[_0x4ff7b0[_0x98f5('0x13')]]);}}catch(_0x459649){utils['error'](util[_0x98f5('0x1c')](_0x98f5('0x33'),_0x4ff7b0[_0x98f5('0x5')]),_0x459649);}};exports[_0x98f5('0x38')]=function(_0x4a0cda){try{if(!_[_0x98f5('0x32')](agents[_0x4a0cda[_0x98f5('0x39')]])){utils[_0x98f5('0x15')](util[_0x98f5('0x1c')](_0x98f5('0x3a'),_0x4a0cda['uniqueid']),_0x4a0cda);utils[_0x98f5('0x3')](util[_0x98f5('0x1c')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x4a0cda[_0x98f5('0x5')],agents[_0x4a0cda['transfereruniqueid']][_0x98f5('0x1d')],agents[_0x4a0cda['transfereruniqueid']][_0x98f5('0x5')]));agents[_0x4a0cda[_0x98f5('0x39')]][_0x98f5('0x3b')]=!![];agents[_0x4a0cda['transfereruniqueid']][_0x98f5('0x3c')]=_0x98f5('0x3d');agents[_0x4a0cda[_0x98f5('0x39')]][_0x98f5('0x3e')]=_0x4a0cda[_0x98f5('0x3f')];agents[_0x4a0cda[_0x98f5('0x39')]][_0x98f5('0x40')]=agents[_0x4a0cda[_0x98f5('0x39')]][_0x98f5('0x5')];}}catch(_0x2e48a1){utils[_0x98f5('0x1e')](util[_0x98f5('0x1c')](_0x98f5('0x3a'),_0x4a0cda[_0x98f5('0x5')]),_0x2e48a1);}};exports[_0x98f5('0x41')]=function(_0x1289a7){try{utils[_0x98f5('0x15')](util['format'](_0x98f5('0x42'),_0x1289a7[_0x98f5('0x43')]),_0x1289a7);if(_0x1289a7[_0x98f5('0x43')]==_0x1289a7[_0x98f5('0x44')]){if(!_[_0x98f5('0x32')](agents[_0x1289a7[_0x98f5('0x45')]])){utils['info'](util['format']('[%s][agents][attendedtransfer]\x20agent:%s',_0x1289a7[_0x98f5('0x43')],agents[_0x1289a7[_0x98f5('0x45')]][_0x98f5('0x1d')]));agents[_0x1289a7[_0x98f5('0x45')]]['transfer']=!![];agents[_0x1289a7[_0x98f5('0x45')]]['transfertype']=_0x98f5('0x46');agents[_0x1289a7['secondtransfereruniqueid']]['transferexten']=_0x1289a7[_0x98f5('0x47')];agents[_0x1289a7[_0x98f5('0x45')]][_0x98f5('0x40')]=_0x1289a7['origtransfereruniqueid'];}if(_0x1289a7['transfereeuniqueid']&&agents[_0x1289a7[_0x98f5('0x48')]]){agents[_0x1289a7[_0x98f5('0x48')]]['agententerreason']=0x1;transfers[_0x1289a7[_0x98f5('0x48')]]=_[_0x98f5('0x49')](agents[_0x1289a7['transfereeuniqueid']]);transfers[_0x1289a7[_0x98f5('0x48')]][_0x98f5('0x9')]=agents[_0x1289a7[_0x98f5('0x45')]]['calleridnum'];transfers[_0x1289a7[_0x98f5('0x48')]][_0x98f5('0x4a')]=agents[_0x1289a7[_0x98f5('0x45')]][_0x98f5('0x4a')];transfers[_0x1289a7[_0x98f5('0x48')]][_0x98f5('0x17')]=utils[_0x98f5('0x18')]();transfers[_0x1289a7['transfereeuniqueid']][_0x98f5('0x2e')]=utils[_0x98f5('0x18')]();transfers[_0x1289a7[_0x98f5('0x48')]]['holdtime']=0x0;transfers[_0x1289a7['transfereeuniqueid']][_0x98f5('0x4b')]=0x2;}}else if(_0x1289a7[_0x98f5('0x45')]==_0x1289a7['secondtransfererlinkedid']){if(!_['isNil'](agents[_0x1289a7['origtransfereruniqueid']])){utils['info'](util[_0x98f5('0x1c')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x1289a7[_0x98f5('0x43')],agents[_0x1289a7[_0x98f5('0x43')]][_0x98f5('0x1d')]));agents[_0x1289a7[_0x98f5('0x43')]][_0x98f5('0x3b')]=!![];agents[_0x1289a7[_0x98f5('0x43')]][_0x98f5('0x3c')]=_0x98f5('0x46');agents[_0x1289a7['origtransfereruniqueid']]['transferexten']=_0x1289a7[_0x98f5('0x4c')];agents[_0x1289a7['origtransfereruniqueid']][_0x98f5('0x40')]=_0x1289a7[_0x98f5('0x45')];}if(_0x1289a7[_0x98f5('0x4d')]&&agents[_0x1289a7['transfertargetuniqueid']]){agents[_0x1289a7[_0x98f5('0x4d')]]['agententerreason']=0x1;transfers[_0x1289a7['transfertargetuniqueid']]=_['clone'](agents[_0x1289a7[_0x98f5('0x4d')]]);transfers[_0x1289a7['transfertargetuniqueid']][_0x98f5('0x9')]=agents[_0x1289a7[_0x98f5('0x43')]][_0x98f5('0x9')];transfers[_0x1289a7['transfertargetuniqueid']]['calleridname']=agents[_0x1289a7['origtransfereruniqueid']][_0x98f5('0x4a')];transfers[_0x1289a7[_0x98f5('0x4d')]]['agentcalledAt']=utils['now']();transfers[_0x1289a7[_0x98f5('0x4d')]][_0x98f5('0x2e')]=utils[_0x98f5('0x18')]();transfers[_0x1289a7[_0x98f5('0x4d')]][_0x98f5('0x23')]=0x0;transfers[_0x1289a7[_0x98f5('0x4d')]][_0x98f5('0x4b')]=0x2;}}}catch(_0x1cc6e3){utils[_0x98f5('0x1e')](util['format'](_0x98f5('0x42'),_0x1289a7[_0x98f5('0x43')]),_0x1cc6e3);}};exports[_0x98f5('0x4e')]=function(_0xb64efb){try{utils['debug'](util[_0x98f5('0x1c')](_0x98f5('0x4f'),_0xb64efb[_0x98f5('0x5')]),_0xb64efb);if(agents[_0xb64efb['uniqueid']]&&agents[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x22')]==='timeout'){if(_0xb64efb[_0x98f5('0x50')]==='21'){agents[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x22')]='rejected';agents[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x19')]=_0x98f5('0x51');}utils[_0x98f5('0x3')](util[_0x98f5('0x1c')](_0x98f5('0x52'),_0xb64efb[_0x98f5('0x5')],agents[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x1d')],agents[_0xb64efb['uniqueid']][_0x98f5('0x22')],agents[_0xb64efb['uniqueid']][_0x98f5('0x19')]));writeDB(agents[_0xb64efb[_0x98f5('0x5')]]);var _0x3bb728=unanswered[_0x98f5('0x53')](_0xb64efb['uniqueid']);if(_0x3bb728>-0x1){unanswered[_0x98f5('0x54')](_0x3bb728,0x1);}}if(transfers[_0xb64efb[_0x98f5('0x5')]]){transfers[_0xb64efb['uniqueid']][_0x98f5('0xf')]=!![];transfers[_0xb64efb['uniqueid']][_0x98f5('0x36')]=utils[_0x98f5('0x18')]();transfers[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x25')]=utils['diffTime'](transfers[_0xb64efb['uniqueid']][_0x98f5('0x36')],transfers[_0xb64efb[_0x98f5('0x5')]]['agentconnectAt']);transfers[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x22')]=_0x98f5('0x55');transfers[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x19')]=_0x98f5('0x37');utils[_0x98f5('0x3')](util[_0x98f5('0x1c')](_0x98f5('0x52'),_0xb64efb[_0x98f5('0x5')],transfers[_0xb64efb[_0x98f5('0x5')]]['membername'],transfers[_0xb64efb['uniqueid']][_0x98f5('0x22')],transfers[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x19')]));writeDB(transfers[_0xb64efb['uniqueid']],!![]);}if(agents[_0xb64efb[_0x98f5('0x5')]]&&agents[_0xb64efb[_0x98f5('0x5')]]['agentconnectAt']){agents[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0xf')]=!![];agents[_0xb64efb['uniqueid']]['agentcompleteAt']=utils['now']();agents[_0xb64efb['uniqueid']][_0x98f5('0x25')]=utils[_0x98f5('0x35')](agents[_0xb64efb['uniqueid']][_0x98f5('0x36')],agents[_0xb64efb[_0x98f5('0x5')]]['agentconnectAt']);agents[_0xb64efb[_0x98f5('0x5')]]['reason']=agents[_0xb64efb['uniqueid']][_0x98f5('0x3b')]?_0x98f5('0x3b'):_0x98f5('0x55');agents[_0xb64efb[_0x98f5('0x5')]]['lastevent']=_0x98f5('0x37');utils['info'](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0xb64efb[_0x98f5('0x5')],agents[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x1d')],agents[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x22')],agents[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x19')]));writeDB(agents[_0xb64efb[_0x98f5('0x5')]]);}}catch(_0x1a3a76){utils[_0x98f5('0x1e')](util['format'](_0x98f5('0x4f'),_0xb64efb[_0x98f5('0x5')]),_0x1a3a76);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 369bb6f..1cc10eb 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 _0x5b35=['xmd-queue','lastapplication','Queue','lastdata','queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','cdr','substring','lastIndexOf','noop','execif','gotoif','[%s][calls][newexten]','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','calleridnum','connectedlinenum','lastevent','getUserByInternal','accountcode','UserId','CreateVoiceCallReport','request','uniqueid','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','context','DOCUMENTATION','error','[%s][calls][newstate]','isNil','channelstate','systemanswertime','now','transfer','destinationchannel','answertime','disposition','toNumber','hangup','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','duration','diffTime','billableseconds','endtime','[%s][calls][hangup]','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','secondtransfererchannel','userfield','_attended','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstartAt','[%s][calls][musiconholdstart]','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','xmd-originatecalleridnum','value','source','variable','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmcs-queue'];(function(_0x241b49,_0x42f57a){var _0x4c1f03=function(_0x2819a3){while(--_0x2819a3){_0x241b49['push'](_0x241b49['shift']());}};_0x4c1f03(++_0x42f57a);}(_0x5b35,0x15a));var _0x55b3=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x5b35[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x55b3('0x0'));var util=require(_0x55b3('0x1'));var utils=require(_0x55b3('0x2'));var dispositions=[_0x55b3('0x3'),_0x55b3('0x4'),_0x55b3('0x4'),_0x55b3('0x3'),_0x55b3('0x3'),_0x55b3('0x3'),_0x55b3('0x5'),_0x55b3('0x6'),_0x55b3('0x4'),_0x55b3('0x4'),'FAILED'];var channels={};function writeDB(_0x589a9e){utils[_0x55b3('0x7')](util[_0x55b3('0x8')](_0x55b3('0x9'),_0x589a9e['uniqueid'],_0x589a9e[_0x55b3('0xa')],_0x589a9e['queue'],_0x589a9e['membername'],_0x589a9e['interface'],_0x589a9e[_0x55b3('0xb')],_0x589a9e[_0x55b3('0xc')],_0x589a9e[_0x55b3('0xd')]));if(_0x589a9e['accountcode']){utils[_0x55b3('0xe')](_0x589a9e[_0x55b3('0xf')])['then'](function(_0x35859e){if(_0x35859e){_0x589a9e[_0x55b3('0x10')]=_0x35859e['id'];}utils['request'](_0x55b3('0x11'),_0x589a9e);});}else{utils[_0x55b3('0x12')](_0x55b3('0x11'),_0x589a9e);}if(channels[_0x589a9e['uniqueid']]){delete channels[_0x589a9e[_0x55b3('0x13')]];}}exports[_0x55b3('0x14')]=function(_0x4fa72f){try{utils[_0x55b3('0x15')](util[_0x55b3('0x8')](_0x55b3('0x16'),_0x4fa72f['uniqueid']),_0x4fa72f);if(_0x4fa72f[_0x55b3('0x13')]==_0x4fa72f[_0x55b3('0x17')]&&_0x4fa72f[_0x55b3('0xa')]!=_0x55b3('0x18')){utils['info'](util[_0x55b3('0x8')](_0x55b3('0x19'),_0x4fa72f['uniqueid'],_0x4fa72f['context'],_0x4fa72f[_0x55b3('0x1a')]));channels[_0x4fa72f['uniqueid']]={'uniqueid':_0x4fa72f['uniqueid'],'accountcode':_0x4fa72f['accountcode'],'source':_0x4fa72f[_0x55b3('0xb')],'destination':_0x4fa72f['exten'],'destinationcontext':_0x4fa72f[_0x55b3('0x1b')],'channel':_0x4fa72f[_0x55b3('0xa')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x55b3('0x1c')};}}catch(_0x1dac5b){utils[_0x55b3('0x1d')](util['format'](_0x55b3('0x16'),_0x4fa72f[_0x55b3('0x13')]),_0x1dac5b);}};exports['newstate']=function(_0x2ff952){try{utils[_0x55b3('0x15')](util[_0x55b3('0x8')](_0x55b3('0x1e'),_0x2ff952[_0x55b3('0x13')]),_0x2ff952);if(!_[_0x55b3('0x1f')](channels[_0x2ff952[_0x55b3('0x13')]])&&_0x2ff952[_0x55b3('0x20')]==0x6){utils['info'](util[_0x55b3('0x8')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x2ff952[_0x55b3('0x13')],_0x2ff952[_0x55b3('0x1b')],_0x2ff952['channel']));if(_[_0x55b3('0x1f')](channels[_0x2ff952[_0x55b3('0x13')]]['systemanswertime'])){channels[_0x2ff952[_0x55b3('0x13')]][_0x55b3('0x21')]=utils[_0x55b3('0x22')]();}}else if(!_[_0x55b3('0x1f')](channels[_0x2ff952[_0x55b3('0x17')]])&&_0x2ff952[_0x55b3('0x20')]==0x6&&_0x2ff952[_0x55b3('0x1b')]!=_0x55b3('0x23')){utils[_0x55b3('0x7')](util['format']('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x2ff952[_0x55b3('0x13')],_0x2ff952['linkedid'],_0x2ff952[_0x55b3('0x1b')],_0x2ff952[_0x55b3('0xa')]));channels[_0x2ff952[_0x55b3('0x17')]]['accountcode']=_0x2ff952[_0x55b3('0xf')];channels[_0x2ff952[_0x55b3('0x17')]][_0x55b3('0x24')]=_0x2ff952[_0x55b3('0xa')];if(_[_0x55b3('0x1f')](channels[_0x2ff952[_0x55b3('0x17')]][_0x55b3('0x25')])){channels[_0x2ff952[_0x55b3('0x17')]][_0x55b3('0x25')]=utils[_0x55b3('0x22')]();}channels[_0x2ff952[_0x55b3('0x17')]][_0x55b3('0x26')]=dispositions[_[_0x55b3('0x27')](_0x2ff952[_0x55b3('0x20')])]||_0x55b3('0x5');}}catch(_0x35389c){utils[_0x55b3('0x1d')](util['format'](_0x55b3('0x1e'),_0x2ff952[_0x55b3('0x13')]),_0x35389c);}};exports[_0x55b3('0x28')]=function(_0x23f0d3){try{if(!_[_0x55b3('0x1f')](channels[_0x23f0d3[_0x55b3('0x13')]])){utils[_0x55b3('0x15')](util['format']('[%s][calls][hangup]',_0x23f0d3[_0x55b3('0x13')]),_0x23f0d3);if(_[_0x55b3('0x1f')](channels[_0x23f0d3['uniqueid']]['callerid'])){channels[_0x23f0d3[_0x55b3('0x13')]][_0x55b3('0x29')]=_0x23f0d3[_0x55b3('0x2a')]+'\x20<'+_0x23f0d3[_0x55b3('0xb')]+'>';}utils['info'](util[_0x55b3('0x8')](_0x55b3('0x2b'),_0x23f0d3['uniqueid'],channels[_0x23f0d3['uniqueid']][_0x55b3('0x29')],_0x23f0d3[_0x55b3('0x2c')]));channels[_0x23f0d3[_0x55b3('0x13')]]['endtime']=utils[_0x55b3('0x22')]();channels[_0x23f0d3[_0x55b3('0x13')]][_0x55b3('0x2d')]=utils[_0x55b3('0x2e')](channels[_0x23f0d3[_0x55b3('0x13')]]['endtime'],channels[_0x23f0d3[_0x55b3('0x13')]]['starttime']);channels[_0x23f0d3['uniqueid']][_0x55b3('0x2f')]=channels[_0x23f0d3[_0x55b3('0x13')]][_0x55b3('0x25')]?utils[_0x55b3('0x2e')](channels[_0x23f0d3[_0x55b3('0x13')]][_0x55b3('0x30')],channels[_0x23f0d3['uniqueid']]['answertime']):0x0;writeDB(channels[_0x23f0d3[_0x55b3('0x13')]]);}}catch(_0x52e211){utils['error'](util['format'](_0x55b3('0x31'),_0x23f0d3['uniqueid']),_0x52e211);}};exports[_0x55b3('0x32')]=function(_0x587886){try{if(!_[_0x55b3('0x1f')](channels[_0x587886[_0x55b3('0x33')]])){utils[_0x55b3('0x15')](util[_0x55b3('0x8')](_0x55b3('0x34'),_0x587886['origtransfereruniqueid']),_0x587886);if(channels[_0x587886[_0x55b3('0x33')]][_0x55b3('0xa')]==_0x587886[_0x55b3('0x35')]){utils[_0x55b3('0x7')](util['format'](_0x55b3('0x36'),_0x587886[_0x55b3('0x37')],_0x587886[_0x55b3('0x33')],_0x587886[_0x55b3('0x38')]));channels[_0x587886[_0x55b3('0x33')]][_0x55b3('0x24')]=_0x587886[_0x55b3('0x38')];channels[_0x587886[_0x55b3('0x33')]][_0x55b3('0x39')]=_0x55b3('0x3a');}else if(channels[_0x587886['localtwolinkedid']]['channel']=_0x587886['transfertargetchannel']){utils['info'](util[_0x55b3('0x8')](_0x55b3('0x36'),_0x587886[_0x55b3('0x37')],_0x587886[_0x55b3('0x33')],_0x587886[_0x55b3('0x3b')]));channels[_0x587886['localtwolinkedid']][_0x55b3('0x24')]=_0x587886[_0x55b3('0x3b')];channels[_0x587886[_0x55b3('0x33')]][_0x55b3('0x39')]=_0x55b3('0x3a');}}}catch(_0x32f99b){utils['error'](util[_0x55b3('0x8')]('[%s][calls][attendedtransfer]',_0x587886[_0x55b3('0x37')]),_0x32f99b);}};exports[_0x55b3('0x3c')]=function(_0x40790a){try{if(!_['isNil'](channels[_0x40790a[_0x55b3('0x13')]])){utils[_0x55b3('0x15')](util[_0x55b3('0x8')]('[%s][calls][musiconholdstart]',_0x40790a[_0x55b3('0x13')]),_0x40790a);channels[_0x40790a[_0x55b3('0x13')]]['musiconholdstartAt']=utils[_0x55b3('0x22')]();utils[_0x55b3('0x7')](util[_0x55b3('0x8')](_0x55b3('0x3d'),_0x40790a[_0x55b3('0x13')],channels[_0x40790a[_0x55b3('0x13')]][_0x55b3('0x3e')]));}}catch(_0x3d5a79){utils[_0x55b3('0x1d')](util[_0x55b3('0x8')](_0x55b3('0x3f'),_0x40790a[_0x55b3('0x13')]),_0x3d5a79);}};exports[_0x55b3('0x40')]=function(_0x1a2bd2){try{if(!_[_0x55b3('0x1f')](channels[_0x1a2bd2[_0x55b3('0x13')]])){utils[_0x55b3('0x15')](util['format'](_0x55b3('0x41'),_0x1a2bd2[_0x55b3('0x13')]),_0x1a2bd2);if(!_[_0x55b3('0x1f')](channels[_0x1a2bd2[_0x55b3('0x13')]][_0x55b3('0x3e')])){channels[_0x1a2bd2['uniqueid']][_0x55b3('0x42')]+=utils[_0x55b3('0x2e')](utils['now'](),channels[_0x1a2bd2[_0x55b3('0x13')]][_0x55b3('0x3e')]);utils[_0x55b3('0x7')](util[_0x55b3('0x8')](_0x55b3('0x43'),_0x1a2bd2[_0x55b3('0x13')],channels[_0x1a2bd2[_0x55b3('0x13')]][_0x55b3('0x42')]));delete channels[_0x1a2bd2[_0x55b3('0x13')]][_0x55b3('0x3e')];}}}catch(_0x12551c){utils['error'](util[_0x55b3('0x8')](_0x55b3('0x41'),_0x1a2bd2[_0x55b3('0x13')]),_0x12551c);}};exports[_0x55b3('0x44')]=function(_0x532010){try{if(!_[_0x55b3('0x1f')](channels[_0x532010[_0x55b3('0x13')]])){utils[_0x55b3('0x15')](util[_0x55b3('0x8')](_0x55b3('0x45'),_0x532010[_0x55b3('0x13')]),_0x532010);if(!_[_0x55b3('0x1f')](_0x532010['variable'][_0x55b3('0x46')])){utils[_0x55b3('0x7')](util['format']('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x532010[_0x55b3('0x13')],_0x532010[_0x55b3('0x47')]));channels[_0x532010['uniqueid']][_0x55b3('0x48')]=_0x532010[_0x55b3('0x47')];}if(!_[_0x55b3('0x1f')](_0x532010[_0x55b3('0x49')][_0x55b3('0x4a')])){utils[_0x55b3('0x7')](util['format'](_0x55b3('0x4b'),_0x532010['uniqueid'],_0x532010[_0x55b3('0x47')]));channels[_0x532010[_0x55b3('0x13')]][_0x55b3('0x4c')]=_0x532010[_0x55b3('0x47')];channels[_0x532010[_0x55b3('0x13')]][_0x55b3('0x29')]='\x22'+_0x532010['value']+_0x55b3('0x4d')+_0x532010[_0x55b3('0x47')]+'>';}if(!_[_0x55b3('0x1f')](_0x532010[_0x55b3('0x49')][_0x55b3('0x4e')])||!_[_0x55b3('0x1f')](_0x532010[_0x55b3('0x49')][_0x55b3('0x4f')])){utils['info'](util[_0x55b3('0x8')](_0x55b3('0x50'),_0x532010[_0x55b3('0x13')],!_[_0x55b3('0x1f')](_0x532010[_0x55b3('0x49')][_0x55b3('0x4e')])?_0x55b3('0x4e'):_0x55b3('0x4f'),_0x532010['value']));channels[_0x532010[_0x55b3('0x13')]][_0x55b3('0x29')]=_0x532010['value'];}if(!_[_0x55b3('0x1f')](_0x532010[_0x55b3('0x49')]['xmd-queue'])||!_[_0x55b3('0x1f')](_0x532010[_0x55b3('0x49')][_0x55b3('0x51')])){utils[_0x55b3('0x7')](util[_0x55b3('0x8')](_0x55b3('0x50'),_0x532010[_0x55b3('0x13')],!_[_0x55b3('0x1f')](_0x532010[_0x55b3('0x49')][_0x55b3('0x52')])?'xmd-queue':'xmcs-queue',_0x532010[_0x55b3('0x47')]));channels[_0x532010[_0x55b3('0x13')]][_0x55b3('0x53')]=_0x55b3('0x54');channels[_0x532010[_0x55b3('0x13')]][_0x55b3('0x55')]=_0x532010[_0x55b3('0x47')];channels[_0x532010['uniqueid']][_0x55b3('0x56')]=!![];}if(!_[_0x55b3('0x1f')](_0x532010['variable'][_0x55b3('0x57')])){utils[_0x55b3('0x7')](util[_0x55b3('0x8')](_0x55b3('0x58'),_0x532010['uniqueid'],_0x532010[_0x55b3('0x47')]));channels[_0x532010[_0x55b3('0x13')]][_0x55b3('0x59')]=_0x532010['value'];}if(!_[_0x55b3('0x1f')](_0x532010['variable']['xmd-cdrtype'])){utils[_0x55b3('0x7')](util['format'](_0x55b3('0x5a'),_0x532010[_0x55b3('0x13')],_0x532010[_0x55b3('0x47')]));channels[_0x532010[_0x55b3('0x13')]][_0x55b3('0x5b')]=_0x532010['value'];}if(!_['isNil'](_0x532010[_0x55b3('0x49')][_0x55b3('0x5c')])){utils['info'](util[_0x55b3('0x8')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x532010[_0x55b3('0x13')],_0x532010['value']));channels[_0x532010[_0x55b3('0x13')]][_0x55b3('0x5d')]=_0x532010[_0x55b3('0x47')];}if(!_[_0x55b3('0x1f')](_0x532010[_0x55b3('0x49')][_0x55b3('0x5e')])){utils[_0x55b3('0x7')](util[_0x55b3('0x8')](_0x55b3('0x5f'),_0x532010[_0x55b3('0x13')],_0x532010[_0x55b3('0x47')]));channels[_0x532010['uniqueid']]['sipcallid']=_0x532010[_0x55b3('0x47')];}}}catch(_0x96eb58){utils['error'](util[_0x55b3('0x8')](_0x55b3('0x45'),_0x532010[_0x55b3('0x13')]),_0x96eb58);}};exports['newexten']=function(_0x1f30c4){try{if(!_[_0x55b3('0x1f')](channels[_0x1f30c4[_0x55b3('0x13')]])){utils[_0x55b3('0x15')](util[_0x55b3('0x8')]('[%s][calls][newexten]',_0x1f30c4['uniqueid']),_0x1f30c4);utils[_0x55b3('0x7')](util['format'](_0x55b3('0x60'),_0x1f30c4['uniqueid'],_0x1f30c4[_0x55b3('0x61')],_0x1f30c4[_0x55b3('0x62')]));if(_0x1f30c4[_0x55b3('0x61')][_0x55b3('0x63')]()=='set'&&_['startsWith'](_0x1f30c4['appdata']['toLowerCase'](),_0x55b3('0x64'))){var _0x23a85e=_0x1f30c4[_0x55b3('0x62')]['split']('=');var _0x17d12c=_0x23a85e[0x0][_0x55b3('0x65')](_0x23a85e[0x0]['lastIndexOf']('(')+0x1,_0x23a85e[0x0][_0x55b3('0x66')](')'));var _0x42dc5f=_0x23a85e[0x1];channels[_0x1f30c4[_0x55b3('0x13')]][_0x17d12c]=_0x42dc5f;}if(!_['includes']([_0x55b3('0x28'),_0x55b3('0x67'),_0x55b3('0x68'),'set',_0x55b3('0x69')],_0x1f30c4[_0x55b3('0x61')]['toLowerCase']())){channels[_0x1f30c4[_0x55b3('0x13')]][_0x55b3('0x53')]=_0x1f30c4[_0x55b3('0x61')];channels[_0x1f30c4[_0x55b3('0x13')]][_0x55b3('0x55')]=_0x1f30c4[_0x55b3('0x62')];}}}catch(_0x289cf3){utils['error'](util[_0x55b3('0x8')](_0x55b3('0x6a'),_0x1f30c4[_0x55b3('0x13')]),_0x289cf3);}}; \ No newline at end of file +var _0x0b1d=['ANSWERED','BUSY','info','format','channel','queue','membername','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','uniqueid','debug','context','exten','now','DOCUMENTATION','error','[%s][calls][newchannel]','newstate','[%s][calls][newstate]','isNil','systemanswertime','linkedid','channelstate','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','answertime','disposition','toNumber','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','starttime','billableseconds','[%s][calls][hangup]','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','localtwolinkedid','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','destinationchannel','musiconholdstart','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstartAt','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][musiconholdstop]','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmcs-queue','xmd-queue','lastapplication','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','outboundrouteid','routeid','sipcallid','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','appdata','cdr','split','substring','includes','hangup','noop','execif','gotoif','lodash','util','NO\x20ANSWER','FAILED'];(function(_0x15ea8d,_0x132b40){var _0x17e921=function(_0x51ed14){while(--_0x51ed14){_0x15ea8d['push'](_0x15ea8d['shift']());}};_0x17e921(++_0x132b40);}(_0x0b1d,0xce));var _0xd0b1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0b1d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd0b1('0x0'));var util=require(_0xd0b1('0x1'));var utils=require('./utils');var dispositions=[_0xd0b1('0x2'),_0xd0b1('0x3'),_0xd0b1('0x3'),_0xd0b1('0x2'),_0xd0b1('0x2'),_0xd0b1('0x2'),_0xd0b1('0x4'),_0xd0b1('0x5'),_0xd0b1('0x3'),'FAILED',_0xd0b1('0x3')];var channels={};function writeDB(_0x20cff5){utils[_0xd0b1('0x6')](util[_0xd0b1('0x7')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x20cff5['uniqueid'],_0x20cff5[_0xd0b1('0x8')],_0x20cff5[_0xd0b1('0x9')],_0x20cff5[_0xd0b1('0xa')],_0x20cff5['interface'],_0x20cff5[_0xd0b1('0xb')],_0x20cff5[_0xd0b1('0xc')],_0x20cff5[_0xd0b1('0xd')]));if(_0x20cff5[_0xd0b1('0xe')]){utils[_0xd0b1('0xf')](_0x20cff5[_0xd0b1('0xe')])[_0xd0b1('0x10')](function(_0xef9d69){if(_0xef9d69){_0x20cff5[_0xd0b1('0x11')]=_0xef9d69['id'];}utils[_0xd0b1('0x12')](_0xd0b1('0x13'),_0x20cff5);});}else{utils[_0xd0b1('0x12')](_0xd0b1('0x13'),_0x20cff5);}if(channels[_0x20cff5[_0xd0b1('0x14')]]){delete channels[_0x20cff5[_0xd0b1('0x14')]];}}exports['newchannel']=function(_0x9ff3ac){try{utils[_0xd0b1('0x15')](util[_0xd0b1('0x7')]('[%s][calls][newchannel]',_0x9ff3ac[_0xd0b1('0x14')]),_0x9ff3ac);if(_0x9ff3ac[_0xd0b1('0x14')]==_0x9ff3ac['linkedid']&&_0x9ff3ac[_0xd0b1('0x8')]!='OutgoingSpoolFailed'){utils[_0xd0b1('0x6')](util[_0xd0b1('0x7')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x9ff3ac[_0xd0b1('0x14')],_0x9ff3ac[_0xd0b1('0x16')],_0x9ff3ac[_0xd0b1('0x17')]));channels[_0x9ff3ac[_0xd0b1('0x14')]]={'uniqueid':_0x9ff3ac[_0xd0b1('0x14')],'accountcode':_0x9ff3ac[_0xd0b1('0xe')],'source':_0x9ff3ac[_0xd0b1('0xb')],'destination':_0x9ff3ac['exten'],'destinationcontext':_0x9ff3ac[_0xd0b1('0x16')],'channel':_0x9ff3ac[_0xd0b1('0x8')],'starttime':utils[_0xd0b1('0x18')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xd0b1('0x2'),'amaflags':_0xd0b1('0x19')};}}catch(_0x14fe68){utils[_0xd0b1('0x1a')](util[_0xd0b1('0x7')](_0xd0b1('0x1b'),_0x9ff3ac[_0xd0b1('0x14')]),_0x14fe68);}};exports[_0xd0b1('0x1c')]=function(_0x48ecb2){try{utils['debug'](util['format'](_0xd0b1('0x1d'),_0x48ecb2[_0xd0b1('0x14')]),_0x48ecb2);if(!_['isNil'](channels[_0x48ecb2['uniqueid']])&&_0x48ecb2['channelstate']==0x6){utils[_0xd0b1('0x6')](util[_0xd0b1('0x7')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x48ecb2[_0xd0b1('0x14')],_0x48ecb2[_0xd0b1('0x16')],_0x48ecb2[_0xd0b1('0x8')]));if(_[_0xd0b1('0x1e')](channels[_0x48ecb2[_0xd0b1('0x14')]][_0xd0b1('0x1f')])){channels[_0x48ecb2[_0xd0b1('0x14')]][_0xd0b1('0x1f')]=utils[_0xd0b1('0x18')]();}}else if(!_[_0xd0b1('0x1e')](channels[_0x48ecb2[_0xd0b1('0x20')]])&&_0x48ecb2[_0xd0b1('0x21')]==0x6&&_0x48ecb2[_0xd0b1('0x16')]!='transfer'){utils['info'](util[_0xd0b1('0x7')](_0xd0b1('0x22'),_0x48ecb2[_0xd0b1('0x14')],_0x48ecb2[_0xd0b1('0x20')],_0x48ecb2[_0xd0b1('0x16')],_0x48ecb2[_0xd0b1('0x8')]));channels[_0x48ecb2[_0xd0b1('0x20')]][_0xd0b1('0xe')]=_0x48ecb2[_0xd0b1('0xe')];channels[_0x48ecb2[_0xd0b1('0x20')]]['destinationchannel']=_0x48ecb2[_0xd0b1('0x8')];if(_['isNil'](channels[_0x48ecb2[_0xd0b1('0x20')]][_0xd0b1('0x23')])){channels[_0x48ecb2['linkedid']][_0xd0b1('0x23')]=utils[_0xd0b1('0x18')]();}channels[_0x48ecb2['linkedid']][_0xd0b1('0x24')]=dispositions[_[_0xd0b1('0x25')](_0x48ecb2[_0xd0b1('0x21')])]||_0xd0b1('0x4');}}catch(_0x3a1862){utils[_0xd0b1('0x1a')](util[_0xd0b1('0x7')](_0xd0b1('0x1d'),_0x48ecb2['uniqueid']),_0x3a1862);}};exports['hangup']=function(_0x1959ed){try{if(!_[_0xd0b1('0x1e')](channels[_0x1959ed[_0xd0b1('0x14')]])){utils[_0xd0b1('0x15')](util[_0xd0b1('0x7')]('[%s][calls][hangup]',_0x1959ed[_0xd0b1('0x14')]),_0x1959ed);if(_[_0xd0b1('0x1e')](channels[_0x1959ed['uniqueid']][_0xd0b1('0x26')])){channels[_0x1959ed['uniqueid']][_0xd0b1('0x26')]=_0x1959ed[_0xd0b1('0x27')]+'\x20<'+_0x1959ed['calleridnum']+'>';}utils['info'](util[_0xd0b1('0x7')](_0xd0b1('0x28'),_0x1959ed['uniqueid'],channels[_0x1959ed[_0xd0b1('0x14')]][_0xd0b1('0x26')],_0x1959ed[_0xd0b1('0x29')]));channels[_0x1959ed[_0xd0b1('0x14')]][_0xd0b1('0x2a')]=utils[_0xd0b1('0x18')]();channels[_0x1959ed[_0xd0b1('0x14')]][_0xd0b1('0x2b')]=utils[_0xd0b1('0x2c')](channels[_0x1959ed[_0xd0b1('0x14')]][_0xd0b1('0x2a')],channels[_0x1959ed[_0xd0b1('0x14')]][_0xd0b1('0x2d')]);channels[_0x1959ed[_0xd0b1('0x14')]][_0xd0b1('0x2e')]=channels[_0x1959ed['uniqueid']][_0xd0b1('0x23')]?utils[_0xd0b1('0x2c')](channels[_0x1959ed[_0xd0b1('0x14')]][_0xd0b1('0x2a')],channels[_0x1959ed['uniqueid']][_0xd0b1('0x23')]):0x0;writeDB(channels[_0x1959ed[_0xd0b1('0x14')]]);}}catch(_0xfbeb7d){utils[_0xd0b1('0x1a')](util['format'](_0xd0b1('0x2f'),_0x1959ed[_0xd0b1('0x14')]),_0xfbeb7d);}};exports[_0xd0b1('0x30')]=function(_0x3a4cc5){try{if(!_[_0xd0b1('0x1e')](channels[_0x3a4cc5['localtwolinkedid']])){utils[_0xd0b1('0x15')](util[_0xd0b1('0x7')](_0xd0b1('0x31'),_0x3a4cc5[_0xd0b1('0x32')]),_0x3a4cc5);if(channels[_0x3a4cc5['localtwolinkedid']]['channel']==_0x3a4cc5['transfereechannel']){utils['info'](util[_0xd0b1('0x7')](_0xd0b1('0x33'),_0x3a4cc5['origtransfereruniqueid'],_0x3a4cc5[_0xd0b1('0x34')],_0x3a4cc5[_0xd0b1('0x35')]));channels[_0x3a4cc5['localtwolinkedid']]['destinationchannel']=_0x3a4cc5[_0xd0b1('0x35')];channels[_0x3a4cc5['localtwolinkedid']][_0xd0b1('0x36')]=_0xd0b1('0x37');}else if(channels[_0x3a4cc5[_0xd0b1('0x34')]]['channel']=_0x3a4cc5[_0xd0b1('0x38')]){utils[_0xd0b1('0x6')](util[_0xd0b1('0x7')](_0xd0b1('0x33'),_0x3a4cc5[_0xd0b1('0x32')],_0x3a4cc5[_0xd0b1('0x34')],_0x3a4cc5[_0xd0b1('0x39')]));channels[_0x3a4cc5['localtwolinkedid']][_0xd0b1('0x3a')]=_0x3a4cc5['origtransfererchannel'];channels[_0x3a4cc5[_0xd0b1('0x34')]][_0xd0b1('0x36')]=_0xd0b1('0x37');}}}catch(_0x54aa14){utils[_0xd0b1('0x1a')](util[_0xd0b1('0x7')]('[%s][calls][attendedtransfer]',_0x3a4cc5[_0xd0b1('0x32')]),_0x54aa14);}};exports[_0xd0b1('0x3b')]=function(_0x5adba0){try{if(!_[_0xd0b1('0x1e')](channels[_0x5adba0[_0xd0b1('0x14')]])){utils[_0xd0b1('0x15')](util[_0xd0b1('0x7')](_0xd0b1('0x3c'),_0x5adba0['uniqueid']),_0x5adba0);channels[_0x5adba0[_0xd0b1('0x14')]]['musiconholdstartAt']=utils[_0xd0b1('0x18')]();utils[_0xd0b1('0x6')](util[_0xd0b1('0x7')](_0xd0b1('0x3d'),_0x5adba0[_0xd0b1('0x14')],channels[_0x5adba0['uniqueid']][_0xd0b1('0x3e')]));}}catch(_0xd1d1b9){utils[_0xd0b1('0x1a')](util[_0xd0b1('0x7')](_0xd0b1('0x3c'),_0x5adba0[_0xd0b1('0x14')]),_0xd1d1b9);}};exports['musiconholdstop']=function(_0x1dde80){try{if(!_[_0xd0b1('0x1e')](channels[_0x1dde80['uniqueid']])){utils[_0xd0b1('0x15')](util[_0xd0b1('0x7')]('[%s][calls][musiconholdstop]',_0x1dde80[_0xd0b1('0x14')]),_0x1dde80);if(!_['isNil'](channels[_0x1dde80[_0xd0b1('0x14')]][_0xd0b1('0x3e')])){channels[_0x1dde80[_0xd0b1('0x14')]][_0xd0b1('0x3f')]+=utils[_0xd0b1('0x2c')](utils[_0xd0b1('0x18')](),channels[_0x1dde80[_0xd0b1('0x14')]][_0xd0b1('0x3e')]);utils[_0xd0b1('0x6')](util['format'](_0xd0b1('0x40'),_0x1dde80[_0xd0b1('0x14')],channels[_0x1dde80['uniqueid']][_0xd0b1('0x3f')]));delete channels[_0x1dde80[_0xd0b1('0x14')]]['musiconholdstartAt'];}}}catch(_0x471b4c){utils[_0xd0b1('0x1a')](util[_0xd0b1('0x7')](_0xd0b1('0x41'),_0x1dde80['uniqueid']),_0x471b4c);}};exports['varset']=function(_0x3cf2a2){try{if(!_[_0xd0b1('0x1e')](channels[_0x3cf2a2[_0xd0b1('0x14')]])){utils[_0xd0b1('0x15')](util[_0xd0b1('0x7')](_0xd0b1('0x42'),_0x3cf2a2[_0xd0b1('0x14')]),_0x3cf2a2);if(!_[_0xd0b1('0x1e')](_0x3cf2a2[_0xd0b1('0x43')][_0xd0b1('0x44')])){utils[_0xd0b1('0x6')](util[_0xd0b1('0x7')](_0xd0b1('0x45'),_0x3cf2a2[_0xd0b1('0x14')],_0x3cf2a2[_0xd0b1('0x46')]));channels[_0x3cf2a2[_0xd0b1('0x14')]][_0xd0b1('0x47')]=_0x3cf2a2[_0xd0b1('0x46')];}if(!_[_0xd0b1('0x1e')](_0x3cf2a2[_0xd0b1('0x43')][_0xd0b1('0x48')])){utils[_0xd0b1('0x6')](util['format'](_0xd0b1('0x49'),_0x3cf2a2[_0xd0b1('0x14')],_0x3cf2a2[_0xd0b1('0x46')]));channels[_0x3cf2a2[_0xd0b1('0x14')]]['destination']=_0x3cf2a2[_0xd0b1('0x46')];channels[_0x3cf2a2[_0xd0b1('0x14')]][_0xd0b1('0x26')]='\x22'+_0x3cf2a2[_0xd0b1('0x46')]+_0xd0b1('0x4a')+_0x3cf2a2[_0xd0b1('0x46')]+'>';}if(!_[_0xd0b1('0x1e')](_0x3cf2a2[_0xd0b1('0x43')][_0xd0b1('0x4b')])||!_[_0xd0b1('0x1e')](_0x3cf2a2[_0xd0b1('0x43')][_0xd0b1('0x4c')])){utils[_0xd0b1('0x6')](util[_0xd0b1('0x7')](_0xd0b1('0x4d'),_0x3cf2a2[_0xd0b1('0x14')],!_[_0xd0b1('0x1e')](_0x3cf2a2[_0xd0b1('0x43')][_0xd0b1('0x4b')])?_0xd0b1('0x4b'):_0xd0b1('0x4c'),_0x3cf2a2['value']));channels[_0x3cf2a2[_0xd0b1('0x14')]][_0xd0b1('0x26')]=_0x3cf2a2[_0xd0b1('0x46')];}if(!_['isNil'](_0x3cf2a2[_0xd0b1('0x43')]['xmd-queue'])||!_[_0xd0b1('0x1e')](_0x3cf2a2['variable'][_0xd0b1('0x4e')])){utils['info'](util[_0xd0b1('0x7')](_0xd0b1('0x4d'),_0x3cf2a2[_0xd0b1('0x14')],!_[_0xd0b1('0x1e')](_0x3cf2a2[_0xd0b1('0x43')][_0xd0b1('0x4f')])?_0xd0b1('0x4f'):_0xd0b1('0x4e'),_0x3cf2a2[_0xd0b1('0x46')]));channels[_0x3cf2a2[_0xd0b1('0x14')]][_0xd0b1('0x50')]='Queue';channels[_0x3cf2a2[_0xd0b1('0x14')]][_0xd0b1('0x51')]=_0x3cf2a2[_0xd0b1('0x46')];channels[_0x3cf2a2['uniqueid']][_0xd0b1('0x9')]=!![];}if(!_[_0xd0b1('0x1e')](_0x3cf2a2[_0xd0b1('0x43')][_0xd0b1('0x52')])){utils[_0xd0b1('0x6')](util[_0xd0b1('0x7')](_0xd0b1('0x53'),_0x3cf2a2[_0xd0b1('0x14')],_0x3cf2a2[_0xd0b1('0x46')]));channels[_0x3cf2a2[_0xd0b1('0x14')]][_0xd0b1('0x54')]=_0x3cf2a2[_0xd0b1('0x46')];}if(!_['isNil'](_0x3cf2a2[_0xd0b1('0x43')][_0xd0b1('0x55')])){utils[_0xd0b1('0x6')](util[_0xd0b1('0x7')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x3cf2a2[_0xd0b1('0x14')],_0x3cf2a2[_0xd0b1('0x46')]));channels[_0x3cf2a2['uniqueid']]['type']=_0x3cf2a2['value'];}if(!_[_0xd0b1('0x1e')](_0x3cf2a2['variable'][_0xd0b1('0x56')])){utils['info'](util['format']('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x3cf2a2[_0xd0b1('0x14')],_0x3cf2a2[_0xd0b1('0x46')]));channels[_0x3cf2a2[_0xd0b1('0x14')]][_0xd0b1('0x57')]=_0x3cf2a2[_0xd0b1('0x46')];}if(!_[_0xd0b1('0x1e')](_0x3cf2a2['variable'][_0xd0b1('0x58')])){utils[_0xd0b1('0x6')](util[_0xd0b1('0x7')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x3cf2a2['uniqueid'],_0x3cf2a2['value']));channels[_0x3cf2a2[_0xd0b1('0x14')]][_0xd0b1('0x58')]=_0x3cf2a2['value'];}}}catch(_0x210596){utils[_0xd0b1('0x1a')](util['format']('[%s][calls][varset]',_0x3cf2a2[_0xd0b1('0x14')]),_0x210596);}};exports[_0xd0b1('0x59')]=function(_0x2f76af){try{if(!_[_0xd0b1('0x1e')](channels[_0x2f76af[_0xd0b1('0x14')]])){utils[_0xd0b1('0x15')](util[_0xd0b1('0x7')](_0xd0b1('0x5a'),_0x2f76af[_0xd0b1('0x14')]),_0x2f76af);utils[_0xd0b1('0x6')](util[_0xd0b1('0x7')](_0xd0b1('0x5b'),_0x2f76af[_0xd0b1('0x14')],_0x2f76af[_0xd0b1('0x5c')],_0x2f76af['appdata']));if(_0x2f76af['application'][_0xd0b1('0x5d')]()==_0xd0b1('0x5e')&&_[_0xd0b1('0x5f')](_0x2f76af[_0xd0b1('0x60')]['toLowerCase'](),_0xd0b1('0x61'))){var _0x1292cc=_0x2f76af['appdata'][_0xd0b1('0x62')]('=');var _0x107666=_0x1292cc[0x0][_0xd0b1('0x63')](_0x1292cc[0x0]['lastIndexOf']('(')+0x1,_0x1292cc[0x0]['lastIndexOf'](')'));var _0x18ba86=_0x1292cc[0x1];channels[_0x2f76af[_0xd0b1('0x14')]][_0x107666]=_0x18ba86;}if(!_[_0xd0b1('0x64')]([_0xd0b1('0x65'),_0xd0b1('0x66'),_0xd0b1('0x67'),_0xd0b1('0x5e'),_0xd0b1('0x68')],_0x2f76af['application']['toLowerCase']())){channels[_0x2f76af[_0xd0b1('0x14')]]['lastapplication']=_0x2f76af['application'];channels[_0x2f76af[_0xd0b1('0x14')]][_0xd0b1('0x51')]=_0x2f76af[_0xd0b1('0x60')];}}}catch(_0x39e1d3){utils[_0xd0b1('0x1a')](util['format'](_0xd0b1('0x5a'),_0x2f76af[_0xd0b1('0x14')]),_0x39e1d3);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 890979c..e2a635d 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 _0x2dc3=['[core]\x20shutdown','fullybooted','info','[core]\x20fullybooted','error','close','./utils','shutdown'];(function(_0x372590,_0x1ebb65){var _0x21abe6=function(_0xce83f4){while(--_0xce83f4){_0x372590['push'](_0x372590['shift']());}};_0x21abe6(++_0x1ebb65);}(_0x2dc3,0x16e));var _0x32dc=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x2dc3[_0x2dafbe];return _0x58a45a;};'use strict';var utils=require(_0x32dc('0x0'));exports['connect']=function(){utils['info']('[core]\x20connected');};exports[_0x32dc('0x1')]=function(){utils['info'](_0x32dc('0x2'));};exports[_0x32dc('0x3')]=function(){utils[_0x32dc('0x4')](_0x32dc('0x5'));};exports[_0x32dc('0x6')]=function(_0x3c5d06){utils[_0x32dc('0x6')]('[core]\x20error',_0x3c5d06);};exports[_0x32dc('0x7')]=function(){utils['info']('[core]\x20close');};exports['managerevent']=function(_0x14b99c){}; \ No newline at end of file +var _0x52e3=['[core]\x20fullybooted','error','[core]\x20error','close','managerevent','./utils','info','[core]\x20connected','[core]\x20shutdown','fullybooted'];(function(_0x2cbd58,_0x278e75){var _0x42ef2a=function(_0x4d2ceb){while(--_0x4d2ceb){_0x2cbd58['push'](_0x2cbd58['shift']());}};_0x42ef2a(++_0x278e75);}(_0x52e3,0x159));var _0x352e=function(_0x3b28cf,_0x14a6d7){_0x3b28cf=_0x3b28cf-0x0;var _0x1ddaf0=_0x52e3[_0x3b28cf];return _0x1ddaf0;};'use strict';var utils=require(_0x352e('0x0'));exports['connect']=function(){utils[_0x352e('0x1')](_0x352e('0x2'));};exports['shutdown']=function(){utils[_0x352e('0x1')](_0x352e('0x3'));};exports[_0x352e('0x4')]=function(){utils[_0x352e('0x1')](_0x352e('0x5'));};exports[_0x352e('0x6')]=function(_0x1f7348){utils[_0x352e('0x6')](_0x352e('0x7'),_0x1f7348);};exports[_0x352e('0x8')]=function(){utils[_0x352e('0x1')]('[core]\x20close');};exports[_0x352e('0x9')]=function(_0xd80ddc){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index f7a84aa..ed13577 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 _0xe5b3=['channel','dialstring','calleridnum','request','CreateVoiceDialReport','uniqueid','newexten','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','split','error','varset','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][varset]','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','isNil','[%s][dials][dialend]','dialstatus','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','diffTime','endtime','holdtime','billableseconds','./utils','info','format'];(function(_0x6a1e55,_0x3f22b7){var _0x31fe0a=function(_0x4c5bf6){while(--_0x4c5bf6){_0x6a1e55['push'](_0x6a1e55['shift']());}};_0x31fe0a(++_0x3f22b7);}(_0xe5b3,0xc1));var _0x3e5b=function(_0x2b28bb,_0x2b1ca7){_0x2b28bb=_0x2b28bb-0x0;var _0x1b4b59=_0xe5b3[_0x2b28bb];return _0x1b4b59;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x3e5b('0x0'));var dials={};function writeDB(_0x10601d){utils[_0x3e5b('0x1')](util[_0x3e5b('0x2')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x10601d['uniqueid'],_0x10601d[_0x3e5b('0x3')],_0x10601d[_0x3e5b('0x4')],_0x10601d[_0x3e5b('0x5')],_0x10601d['connectedlinenum'],_0x10601d['dialstatus']));utils[_0x3e5b('0x6')](_0x3e5b('0x7'),_0x10601d);delete dials[_0x10601d[_0x3e5b('0x8')]];}exports[_0x3e5b('0x9')]=function(_0x975694){try{utils[_0x3e5b('0xa')](util[_0x3e5b('0x2')](_0x3e5b('0xb'),_0x975694[_0x3e5b('0x8')]),_0x975694);utils[_0x3e5b('0x1')](util[_0x3e5b('0x2')](_0x3e5b('0xc'),_0x975694[_0x3e5b('0x8')],_0x975694[_0x3e5b('0xd')],_0x975694[_0x3e5b('0xe')]));if(_0x975694[_0x3e5b('0xd')][_0x3e5b('0xf')]()==_0x3e5b('0x10')&&_[_0x3e5b('0x11')](_0x975694['appdata'][_0x3e5b('0xf')](),'cdr(routeid)')){var _0x15ed1d=_0x975694['appdata'][_0x3e5b('0x12')]('=');dials[_0x975694[_0x3e5b('0x8')]]={'routeId':_0x15ed1d[0x1]};}}catch(_0x26f2e9){utils[_0x3e5b('0x13')](util['format'](_0x3e5b('0xb'),_0x975694[_0x3e5b('0x8')]),_0x26f2e9);}};exports[_0x3e5b('0x14')]=function(_0x127a0d){try{utils[_0x3e5b('0xa')](util[_0x3e5b('0x2')]('[%s][dials][varset]',_0x127a0d['uniqueid']),_0x127a0d);if(!_['isNil'](_0x127a0d[_0x3e5b('0x15')][_0x3e5b('0x16')])){utils['info'](util[_0x3e5b('0x2')](_0x3e5b('0x17'),_0x127a0d['uniqueid'],_0x127a0d[_0x3e5b('0x18')]));dials[_0x127a0d['uniqueid']]={'routeId':_0x127a0d['value']};}}catch(_0x16ac30){utils[_0x3e5b('0x13')](util['format'](_0x3e5b('0x19'),_0x127a0d[_0x3e5b('0x8')]),_0x16ac30);}};exports[_0x3e5b('0x1a')]=function(_0x20c1ea){try{if(!_['isNil'](dials[_0x20c1ea[_0x3e5b('0x8')]])){utils[_0x3e5b('0xa')](util[_0x3e5b('0x2')](_0x3e5b('0x1b'),_0x20c1ea[_0x3e5b('0x8')]),_0x20c1ea);dials[_0x20c1ea[_0x3e5b('0x8')]]=_[_0x3e5b('0x1c')](dials[_0x20c1ea['uniqueid']],_0x20c1ea);dials[_0x20c1ea[_0x3e5b('0x8')]][_0x3e5b('0x1d')]=utils[_0x3e5b('0x1e')]();dials[_0x20c1ea[_0x3e5b('0x8')]][_0x3e5b('0x1f')]=_0x3e5b('0x20');utils[_0x3e5b('0x1')](util[_0x3e5b('0x2')](_0x3e5b('0x21'),_0x20c1ea[_0x3e5b('0x8')],dials[_0x20c1ea[_0x3e5b('0x8')]][_0x3e5b('0x1d')]));}}catch(_0x34cd1b){utils[_0x3e5b('0x13')](util[_0x3e5b('0x2')](_0x3e5b('0x1b'),_0x20c1ea['uniqueid']),_0x34cd1b);}};exports[_0x3e5b('0x22')]=function(_0x37ab15){try{if(!_[_0x3e5b('0x23')](dials[_0x37ab15[_0x3e5b('0x8')]])){utils['debug'](util[_0x3e5b('0x2')](_0x3e5b('0x24'),_0x37ab15[_0x3e5b('0x8')]),_0x37ab15);dials[_0x37ab15[_0x3e5b('0x8')]][_0x3e5b('0x25')]=_0x37ab15[_0x3e5b('0x25')];if(_0x37ab15[_0x3e5b('0x25')]==_0x3e5b('0x26')){dials[_0x37ab15['uniqueid']]=_[_0x3e5b('0x1c')](dials[_0x37ab15[_0x3e5b('0x8')]],_0x37ab15);dials[_0x37ab15[_0x3e5b('0x8')]][_0x3e5b('0x27')]=utils[_0x3e5b('0x1e')]();dials[_0x37ab15[_0x3e5b('0x8')]]['lastevent']=_0x3e5b('0x28');utils['info'](util[_0x3e5b('0x2')](_0x3e5b('0x29'),_0x37ab15[_0x3e5b('0x8')],_0x37ab15[_0x3e5b('0x25')],dials[_0x37ab15[_0x3e5b('0x8')]][_0x3e5b('0x27')]));}else{utils[_0x3e5b('0x1')](util[_0x3e5b('0x2')](_0x3e5b('0x2a'),_0x37ab15[_0x3e5b('0x8')],_0x37ab15[_0x3e5b('0x25')]));}}}catch(_0xfe54f3){utils[_0x3e5b('0x13')](util[_0x3e5b('0x2')](_0x3e5b('0x24'),_0x37ab15['uniqueid']),_0xfe54f3);}};exports[_0x3e5b('0x2b')]=function(_0x40d0e1){try{if(!_[_0x3e5b('0x23')](dials[_0x40d0e1[_0x3e5b('0x8')]])){utils[_0x3e5b('0xa')](util['format'](_0x3e5b('0x2c'),_0x40d0e1[_0x3e5b('0x8')]),_0x40d0e1);utils[_0x3e5b('0x1')](util[_0x3e5b('0x2')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x40d0e1[_0x3e5b('0x8')],_0x40d0e1[_0x3e5b('0x5')],_0x40d0e1['calleridname'],_0x40d0e1['cause-txt']));dials[_0x40d0e1[_0x3e5b('0x8')]]=_['assign'](dials[_0x40d0e1[_0x3e5b('0x8')]],{'endtime':utils[_0x3e5b('0x1e')](),'lastevent':'complete'});dials[_0x40d0e1['uniqueid']]['duration']=utils[_0x3e5b('0x2d')](dials[_0x40d0e1[_0x3e5b('0x8')]][_0x3e5b('0x2e')],dials[_0x40d0e1[_0x3e5b('0x8')]][_0x3e5b('0x1d')]);dials[_0x40d0e1[_0x3e5b('0x8')]][_0x3e5b('0x2f')]=utils[_0x3e5b('0x2d')](dials[_0x40d0e1['uniqueid']][_0x3e5b('0x27')]||dials[_0x40d0e1[_0x3e5b('0x8')]]['endtime'],dials[_0x40d0e1[_0x3e5b('0x8')]][_0x3e5b('0x1d')]);dials[_0x40d0e1['uniqueid']][_0x3e5b('0x30')]=dials[_0x40d0e1[_0x3e5b('0x8')]][_0x3e5b('0x27')]?utils[_0x3e5b('0x2d')](dials[_0x40d0e1[_0x3e5b('0x8')]][_0x3e5b('0x2e')],dials[_0x40d0e1[_0x3e5b('0x8')]][_0x3e5b('0x27')]):0x0;writeDB(dials[_0x40d0e1[_0x3e5b('0x8')]]);}}catch(_0x3e097b){utils['error'](util[_0x3e5b('0x2')](_0x3e5b('0x2c'),_0x40d0e1[_0x3e5b('0x8')]),_0x3e097b);}}; \ No newline at end of file +var _0xc88e=['billableseconds','lodash','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','application','toLowerCase','set','startsWith','appdata','cdr(routeid)','split','error','varset','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','[%s][dials][varset]','dialbegin','isNil','[%s][dials][dialbegin]','lastevent','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','[%s][dials][dialend]','assign','answertime','now','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime','endtime','holdtime'];(function(_0x4f1bc7,_0x43877f){var _0x50d317=function(_0xbc9d24){while(--_0xbc9d24){_0x4f1bc7['push'](_0x4f1bc7['shift']());}};_0x50d317(++_0x43877f);}(_0xc88e,0xcd));var _0xec88=function(_0x3f5af4,_0x1a2d76){_0x3f5af4=_0x3f5af4-0x0;var _0xeecbd9=_0xc88e[_0x3f5af4];return _0xeecbd9;};'use strict';var _=require(_0xec88('0x0'));var util=require(_0xec88('0x1'));var utils=require(_0xec88('0x2'));var dials={};function writeDB(_0x1edeb9){utils[_0xec88('0x3')](util[_0xec88('0x4')](_0xec88('0x5'),_0x1edeb9[_0xec88('0x6')],_0x1edeb9[_0xec88('0x7')],_0x1edeb9['dialstring'],_0x1edeb9[_0xec88('0x8')],_0x1edeb9[_0xec88('0x9')],_0x1edeb9[_0xec88('0xa')]));utils[_0xec88('0xb')](_0xec88('0xc'),_0x1edeb9);delete dials[_0x1edeb9[_0xec88('0x6')]];}exports[_0xec88('0xd')]=function(_0x11c53f){try{utils[_0xec88('0xe')](util[_0xec88('0x4')](_0xec88('0xf'),_0x11c53f['uniqueid']),_0x11c53f);utils[_0xec88('0x3')](util[_0xec88('0x4')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x11c53f[_0xec88('0x6')],_0x11c53f[_0xec88('0x10')],_0x11c53f['appdata']));if(_0x11c53f['application'][_0xec88('0x11')]()==_0xec88('0x12')&&_[_0xec88('0x13')](_0x11c53f[_0xec88('0x14')]['toLowerCase'](),_0xec88('0x15'))){var _0x34e9b1=_0x11c53f[_0xec88('0x14')][_0xec88('0x16')]('=');dials[_0x11c53f[_0xec88('0x6')]]={'routeId':_0x34e9b1[0x1]};}}catch(_0xf63b1f){utils[_0xec88('0x17')](util[_0xec88('0x4')](_0xec88('0xf'),_0x11c53f[_0xec88('0x6')]),_0xf63b1f);}};exports[_0xec88('0x18')]=function(_0x1438b8){try{utils['debug'](util[_0xec88('0x4')]('[%s][dials][varset]',_0x1438b8[_0xec88('0x6')]),_0x1438b8);if(!_['isNil'](_0x1438b8[_0xec88('0x19')][_0xec88('0x1a')])){utils[_0xec88('0x3')](util[_0xec88('0x4')](_0xec88('0x1b'),_0x1438b8[_0xec88('0x6')],_0x1438b8['value']));dials[_0x1438b8['uniqueid']]={'routeId':_0x1438b8['value']};}}catch(_0x2fc71d){utils['error'](util[_0xec88('0x4')](_0xec88('0x1c'),_0x1438b8[_0xec88('0x6')]),_0x2fc71d);}};exports[_0xec88('0x1d')]=function(_0x56b423){try{if(!_[_0xec88('0x1e')](dials[_0x56b423[_0xec88('0x6')]])){utils['debug'](util[_0xec88('0x4')](_0xec88('0x1f'),_0x56b423['uniqueid']),_0x56b423);dials[_0x56b423[_0xec88('0x6')]]=_['assign'](dials[_0x56b423[_0xec88('0x6')]],_0x56b423);dials[_0x56b423['uniqueid']]['starttime']=utils['now']();dials[_0x56b423[_0xec88('0x6')]][_0xec88('0x20')]='called';utils[_0xec88('0x3')](util[_0xec88('0x4')](_0xec88('0x21'),_0x56b423[_0xec88('0x6')],dials[_0x56b423[_0xec88('0x6')]][_0xec88('0x22')]));}}catch(_0x26c5d4){utils[_0xec88('0x17')](util[_0xec88('0x4')](_0xec88('0x1f'),_0x56b423[_0xec88('0x6')]),_0x26c5d4);}};exports['dialend']=function(_0x3115e5){try{if(!_['isNil'](dials[_0x3115e5[_0xec88('0x6')]])){utils[_0xec88('0xe')](util[_0xec88('0x4')](_0xec88('0x23'),_0x3115e5[_0xec88('0x6')]),_0x3115e5);dials[_0x3115e5['uniqueid']][_0xec88('0xa')]=_0x3115e5['dialstatus'];if(_0x3115e5['dialstatus']=='ANSWER'){dials[_0x3115e5[_0xec88('0x6')]]=_[_0xec88('0x24')](dials[_0x3115e5[_0xec88('0x6')]],_0x3115e5);dials[_0x3115e5[_0xec88('0x6')]][_0xec88('0x25')]=utils[_0xec88('0x26')]();dials[_0x3115e5[_0xec88('0x6')]][_0xec88('0x20')]='connect';utils['info'](util[_0xec88('0x4')](_0xec88('0x27'),_0x3115e5[_0xec88('0x6')],_0x3115e5['dialstatus'],dials[_0x3115e5[_0xec88('0x6')]][_0xec88('0x25')]));}else{utils[_0xec88('0x3')](util['format'](_0xec88('0x28'),_0x3115e5[_0xec88('0x6')],_0x3115e5[_0xec88('0xa')]));}}}catch(_0x441d09){utils[_0xec88('0x17')](util[_0xec88('0x4')](_0xec88('0x23'),_0x3115e5['uniqueid']),_0x441d09);}};exports['hangup']=function(_0x4daa65){try{if(!_[_0xec88('0x1e')](dials[_0x4daa65['uniqueid']])){utils[_0xec88('0xe')](util['format'](_0xec88('0x29'),_0x4daa65[_0xec88('0x6')]),_0x4daa65);utils[_0xec88('0x3')](util[_0xec88('0x4')](_0xec88('0x2a'),_0x4daa65[_0xec88('0x6')],_0x4daa65[_0xec88('0x8')],_0x4daa65[_0xec88('0x2b')],_0x4daa65[_0xec88('0x2c')]));dials[_0x4daa65[_0xec88('0x6')]]=_[_0xec88('0x24')](dials[_0x4daa65[_0xec88('0x6')]],{'endtime':utils[_0xec88('0x26')](),'lastevent':_0xec88('0x2d')});dials[_0x4daa65['uniqueid']][_0xec88('0x2e')]=utils[_0xec88('0x2f')](dials[_0x4daa65[_0xec88('0x6')]][_0xec88('0x30')],dials[_0x4daa65['uniqueid']][_0xec88('0x22')]);dials[_0x4daa65[_0xec88('0x6')]][_0xec88('0x31')]=utils[_0xec88('0x2f')](dials[_0x4daa65[_0xec88('0x6')]][_0xec88('0x25')]||dials[_0x4daa65[_0xec88('0x6')]][_0xec88('0x30')],dials[_0x4daa65[_0xec88('0x6')]][_0xec88('0x22')]);dials[_0x4daa65[_0xec88('0x6')]][_0xec88('0x32')]=dials[_0x4daa65[_0xec88('0x6')]]['answertime']?utils[_0xec88('0x2f')](dials[_0x4daa65[_0xec88('0x6')]][_0xec88('0x30')],dials[_0x4daa65['uniqueid']]['answertime']):0x0;writeDB(dials[_0x4daa65[_0xec88('0x6')]]);}}catch(_0x2b35fd){utils['error'](util[_0xec88('0x4')]('[%s][dials][hangup]',_0x4daa65['uniqueid']),_0x2b35fd);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index c425949..5acaa68 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 _0xfadd=['asterisk','username','password','keepConnected','XDR\x20DISABLED','info','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./recordings.controller','./members.controller','./dials.controller','connect','shutdown','fullybooted','close','managerevent','format','[%s][index][devicestatechange]','device','devicestatechange','error','agentcalled','debug','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','attendedtransfer','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','xdr','disabled','env','local'];(function(_0x4bcb3c,_0x192122){var _0xfe09bb=function(_0xcd8ad2){while(--_0xcd8ad2){_0x4bcb3c['push'](_0x4bcb3c['shift']());}};_0xfe09bb(++_0x192122);}(_0xfadd,0x102));var _0xdfad=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfadd[_0x20a584];return _0x4b41a8;};var AsteriskManager=require(_0xdfad('0x0'));var config=require(_0xdfad('0x1'));var utils=require('./utils');var util=require('util');var isXDREnabled=config[_0xdfad('0x2')]&&config['xdr'][_0xdfad('0x3')]?!config[_0xdfad('0x2')][_0xdfad('0x3')]:!![];var isProduction=config[_0xdfad('0x4')]==='production'||![];var isLocalAsterisk=config['xdr']&&config[_0xdfad('0x2')][_0xdfad('0x5')]===!![]||![];var ami=new AsteriskManager(config[_0xdfad('0x6')]['port'],config[_0xdfad('0x6')]['ip'],config[_0xdfad('0x6')][_0xdfad('0x7')],config['asterisk'][_0xdfad('0x8')],!![]);ami[_0xdfad('0x9')]();if(!isXDREnabled){utils['info'](_0xdfad('0xa'));}else if(!isProduction&&!isLocalAsterisk){utils[_0xdfad('0xb')](_0xdfad('0xc'));}else{var agents=require(_0xdfad('0xd'));var calls=require(_0xdfad('0xe'));var queues=require('./queues.controller');var recordings=require(_0xdfad('0xf'));var members=require(_0xdfad('0x10'));var dials=require(_0xdfad('0x11'));var transfers=require('./transfers.controller');var core=require('./core.controller');ami['on'](_0xdfad('0x12'),core[_0xdfad('0x12')]);ami['on'](_0xdfad('0x13'),core[_0xdfad('0x13')]);ami['on'](_0xdfad('0x14'),core[_0xdfad('0x14')]);ami['on']('error',core['error']);ami['on'](_0xdfad('0x15'),core['close']);ami['on'](_0xdfad('0x16'),core['managerevent']);ami['on']('devicestatechange',function(_0x26244c){try{utils['debug'](util[_0xdfad('0x17')](_0xdfad('0x18'),_0x26244c[_0xdfad('0x19')]),_0x26244c);members[_0xdfad('0x1a')](_0x26244c);}catch(_0x58443d){utils[_0xdfad('0x1b')](util['format'](_0xdfad('0x18'),_0x26244c[_0xdfad('0x19')]),_0x58443d);}});ami['on'](_0xdfad('0x1c'),function(_0x33f765){try{utils[_0xdfad('0x1d')](util['format'](_0xdfad('0x1e'),_0x33f765[_0xdfad('0x1f')]),_0x33f765);agents[_0xdfad('0x1c')](_0x33f765);}catch(_0x49dc1a){utils[_0xdfad('0x1b')](util[_0xdfad('0x17')](_0xdfad('0x1e'),_0x33f765[_0xdfad('0x1f')]),_0x49dc1a);}});ami['on'](_0xdfad('0x20'),function(_0x9dad22){try{utils[_0xdfad('0x1d')](util[_0xdfad('0x17')](_0xdfad('0x21'),_0x9dad22[_0xdfad('0x1f')]),_0x9dad22);agents['agentringnoanswer'](_0x9dad22);}catch(_0x8555ff){utils['error'](util[_0xdfad('0x17')]('[%s][index][agentringnoanswer]',_0x9dad22['uniqueid']),_0x8555ff);}});ami['on'](_0xdfad('0x22'),function(_0x5c838e){try{utils[_0xdfad('0x1d')](util[_0xdfad('0x17')](_0xdfad('0x23'),_0x5c838e['uniqueid']),_0x5c838e);agents[_0xdfad('0x22')](_0x5c838e);queues[_0xdfad('0x22')](_0x5c838e);}catch(_0x394396){utils['error'](util[_0xdfad('0x17')](_0xdfad('0x23'),_0x5c838e[_0xdfad('0x1f')]),_0x394396);}});ami['on']('agentcomplete',function(_0x4b7161){try{utils['debug'](util[_0xdfad('0x17')](_0xdfad('0x24'),_0x4b7161[_0xdfad('0x1f')]),_0x4b7161);agents[_0xdfad('0x25')](_0x4b7161);queues['agentcomplete'](_0x4b7161);members[_0xdfad('0x25')](_0x4b7161);}catch(_0x52a4ff){utils[_0xdfad('0x1b')](util[_0xdfad('0x17')](_0xdfad('0x24'),_0x4b7161['uniqueid']),_0x52a4ff);}});ami['on'](_0xdfad('0x26'),function(_0x152787){try{utils[_0xdfad('0x1d')](util[_0xdfad('0x17')](_0xdfad('0x27'),_0x152787[_0xdfad('0x1f')]),_0x152787);agents['queuecallerabandon'](_0x152787);queues[_0xdfad('0x26')](_0x152787);}catch(_0x125484){utils[_0xdfad('0x1b')](util['format'](_0xdfad('0x27'),_0x152787[_0xdfad('0x1f')]),_0x125484);}});ami['on'](_0xdfad('0x28'),function(_0x745c74){try{utils[_0xdfad('0x1d')](util[_0xdfad('0x17')]('[%s][index][queuecallerjoin]',_0x745c74[_0xdfad('0x1f')]),_0x745c74);queues[_0xdfad('0x28')](_0x745c74);recordings[_0xdfad('0x28')](_0x745c74);}catch(_0x2f4040){utils[_0xdfad('0x1b')](util[_0xdfad('0x17')]('[%s][index][queuecallerjoin]',_0x745c74[_0xdfad('0x1f')]),_0x2f4040);}});ami['on'](_0xdfad('0x29'),function(_0x2ef0cc){try{utils[_0xdfad('0x1d')](util[_0xdfad('0x17')]('[%s][index][queuecallerleave]',_0x2ef0cc[_0xdfad('0x1f')]),_0x2ef0cc);queues[_0xdfad('0x29')](_0x2ef0cc);}catch(_0x50f8ed){utils[_0xdfad('0x1b')](util['format'](_0xdfad('0x2a'),_0x2ef0cc[_0xdfad('0x1f')]),_0x50f8ed);}});ami['on'](_0xdfad('0x2b'),function(_0x473253){try{utils['debug'](util[_0xdfad('0x17')]('[%s][index][musiconholdstart]',_0x473253[_0xdfad('0x1f')]),_0x473253);queues[_0xdfad('0x2b')](_0x473253);calls[_0xdfad('0x2b')](_0x473253);}catch(_0x5afae3){utils['error'](util[_0xdfad('0x17')]('[%s][index][musiconholdstart]',_0x473253[_0xdfad('0x1f')]),_0x5afae3);}});ami['on'](_0xdfad('0x2c'),function(_0x23c2c8){try{utils[_0xdfad('0x1d')](util[_0xdfad('0x17')](_0xdfad('0x2d'),_0x23c2c8[_0xdfad('0x1f')]),_0x23c2c8);queues['musiconholdstop'](_0x23c2c8);calls[_0xdfad('0x2c')](_0x23c2c8);}catch(_0x4cddb0){utils[_0xdfad('0x1b')](util[_0xdfad('0x17')](_0xdfad('0x2d'),_0x23c2c8[_0xdfad('0x1f')]),_0x4cddb0);}});ami['on'](_0xdfad('0x2e'),function(_0x3624bc){try{utils['debug'](util[_0xdfad('0x17')](_0xdfad('0x2f'),_0x3624bc[_0xdfad('0x1f')]),_0x3624bc);calls[_0xdfad('0x2e')](_0x3624bc);recordings[_0xdfad('0x2e')](_0x3624bc);}catch(_0x54f104){utils[_0xdfad('0x1b')](util[_0xdfad('0x17')]('[%s][index][newstate]',_0x3624bc['uniqueid']),_0x54f104);}});ami['on'](_0xdfad('0x30'),function(_0x3bafab){try{utils[_0xdfad('0x1d')](util[_0xdfad('0x17')]('[%s][index][hangup]',_0x3bafab[_0xdfad('0x1f')]),_0x3bafab);calls[_0xdfad('0x30')](_0x3bafab);recordings[_0xdfad('0x30')](_0x3bafab);dials[_0xdfad('0x30')](_0x3bafab);agents[_0xdfad('0x30')](_0x3bafab);queues[_0xdfad('0x30')](_0x3bafab);}catch(_0x2fe1ab){utils[_0xdfad('0x1b')](util[_0xdfad('0x17')](_0xdfad('0x31'),_0x3bafab[_0xdfad('0x1f')]),_0x2fe1ab);}});ami['on'](_0xdfad('0x32'),function(_0x1b6486){try{utils[_0xdfad('0x1d')](util[_0xdfad('0x17')]('[%s][index][cdr]',_0x1b6486[_0xdfad('0x1f')]),_0x1b6486);members[_0xdfad('0x32')](_0x1b6486);}catch(_0x5ce196){utils['error'](util[_0xdfad('0x17')](_0xdfad('0x33'),_0x1b6486[_0xdfad('0x1f')]),_0x5ce196);}});ami['on'](_0xdfad('0x34'),function(_0x32bc93){try{utils[_0xdfad('0x1d')](util[_0xdfad('0x17')]('[%s][index][blindtransfer]',_0x32bc93['uniqueid']),_0x32bc93);queues['blindtransfer'](_0x32bc93);agents[_0xdfad('0x34')](_0x32bc93);transfers['blindtransfer'](_0x32bc93);}catch(_0x57462b){utils[_0xdfad('0x1b')](util[_0xdfad('0x17')]('[%s][index][blindtransfer]',_0x32bc93[_0xdfad('0x1f')]),_0x57462b);}});ami['on'](_0xdfad('0x35'),function(_0x1dd409){try{utils[_0xdfad('0x1d')](util[_0xdfad('0x17')]('[%s][index][attendedtransfer]',_0x1dd409[_0xdfad('0x36')]),_0x1dd409);queues[_0xdfad('0x35')](_0x1dd409);transfers[_0xdfad('0x35')](_0x1dd409);agents[_0xdfad('0x35')](_0x1dd409);calls[_0xdfad('0x35')](_0x1dd409);}catch(_0x38220e){utils[_0xdfad('0x1b')](util[_0xdfad('0x17')]('[%s][index][attendedtransfer]',_0x1dd409[_0xdfad('0x36')]),_0x38220e);}});ami['on'](_0xdfad('0x37'),function(_0x30a106){try{utils[_0xdfad('0x1d')](util[_0xdfad('0x17')](_0xdfad('0x38'),_0x30a106[_0xdfad('0x1f')]),_0x30a106);queues[_0xdfad('0x37')](_0x30a106);recordings['varset'](_0x30a106);calls['varset'](_0x30a106);dials[_0xdfad('0x37')](_0x30a106);}catch(_0x4942a9){utils[_0xdfad('0x1b')](util[_0xdfad('0x17')](_0xdfad('0x38'),_0x30a106['uniqueid']),_0x4942a9);}});ami['on'](_0xdfad('0x39'),function(_0x28f59b){try{utils['debug'](util[_0xdfad('0x17')](_0xdfad('0x3a'),_0x28f59b[_0xdfad('0x1f')]),_0x28f59b);calls[_0xdfad('0x39')](_0x28f59b);recordings[_0xdfad('0x39')](_0x28f59b);dials[_0xdfad('0x39')](_0x28f59b);}catch(_0x46913d){utils[_0xdfad('0x1b')](util[_0xdfad('0x17')](_0xdfad('0x3a'),_0x28f59b[_0xdfad('0x1f')]),_0x46913d);}});ami['on'](_0xdfad('0x3b'),function(_0x210494){try{utils['debug'](util[_0xdfad('0x17')](_0xdfad('0x3c'),_0x210494[_0xdfad('0x1f')]),_0x210494);calls[_0xdfad('0x3b')](_0x210494);recordings[_0xdfad('0x3b')](_0x210494);}catch(_0x405b84){utils['error'](util[_0xdfad('0x17')]('[%s][index][newchannel]',_0x210494[_0xdfad('0x1f')]),_0x405b84);}});ami['on'](_0xdfad('0x3d'),function(_0x5a3492){try{utils['debug'](util['format'](_0xdfad('0x3e'),_0x5a3492[_0xdfad('0x1f')]),_0x5a3492);dials['dialbegin'](_0x5a3492);}catch(_0x3eb8cf){utils[_0xdfad('0x1b')](util[_0xdfad('0x17')](_0xdfad('0x3f'),_0x5a3492[_0xdfad('0x1f')]),_0x3eb8cf);}});ami['on'](_0xdfad('0x40'),function(_0x13252e){try{utils[_0xdfad('0x1d')](util[_0xdfad('0x17')](_0xdfad('0x41'),_0x13252e[_0xdfad('0x1f')]),_0x13252e);dials[_0xdfad('0x40')](_0x13252e);}catch(_0x480709){utils[_0xdfad('0x1b')](util[_0xdfad('0x17')]('[%s][index][dialend]',_0x13252e[_0xdfad('0x1f')]),_0x480709);}});} \ No newline at end of file +var _0xc81b=['fullybooted','close','managerevent','debug','format','[%s][index][devicestatechange]','devicestatechange','error','device','[%s][index][agentcalled]','uniqueid','agentcalled','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','[%s][index][queuecallerabandon]','queuecallerabandon','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstop]','[%s][index][newstate]','newstate','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','[%s][index][dialbegin]','dialbegin','[%s]dialbegin','dialend','asterisk-manager','../../config/environment','./utils','xdr','disabled','env','production','local','asterisk','port','username','keepConnected','info','XDR\x20DISABLED','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','connect','shutdown'];(function(_0x2d150f,_0x24aeb3){var _0x2b8af7=function(_0xb36cf2){while(--_0xb36cf2){_0x2d150f['push'](_0x2d150f['shift']());}};_0x2b8af7(++_0x24aeb3);}(_0xc81b,0x17c));var _0xbc81=function(_0x1e0991,_0x4ade0a){_0x1e0991=_0x1e0991-0x0;var _0x107923=_0xc81b[_0x1e0991];return _0x107923;};var AsteriskManager=require(_0xbc81('0x0'));var config=require(_0xbc81('0x1'));var utils=require(_0xbc81('0x2'));var util=require('util');var isXDREnabled=config['xdr']&&config[_0xbc81('0x3')][_0xbc81('0x4')]?!config[_0xbc81('0x3')][_0xbc81('0x4')]:!![];var isProduction=config[_0xbc81('0x5')]===_0xbc81('0x6')||![];var isLocalAsterisk=config[_0xbc81('0x3')]&&config[_0xbc81('0x3')][_0xbc81('0x7')]===!![]||![];var ami=new AsteriskManager(config[_0xbc81('0x8')][_0xbc81('0x9')],config[_0xbc81('0x8')]['ip'],config['asterisk'][_0xbc81('0xa')],config[_0xbc81('0x8')]['password'],!![]);ami[_0xbc81('0xb')]();if(!isXDREnabled){utils[_0xbc81('0xc')](_0xbc81('0xd'));}else if(!isProduction&&!isLocalAsterisk){utils[_0xbc81('0xc')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require('./agents.controller');var calls=require(_0xbc81('0xe'));var queues=require(_0xbc81('0xf'));var recordings=require(_0xbc81('0x10'));var members=require(_0xbc81('0x11'));var dials=require(_0xbc81('0x12'));var transfers=require(_0xbc81('0x13'));var core=require('./core.controller');ami['on'](_0xbc81('0x14'),core[_0xbc81('0x14')]);ami['on'](_0xbc81('0x15'),core[_0xbc81('0x15')]);ami['on'](_0xbc81('0x16'),core[_0xbc81('0x16')]);ami['on']('error',core['error']);ami['on'](_0xbc81('0x17'),core[_0xbc81('0x17')]);ami['on'](_0xbc81('0x18'),core[_0xbc81('0x18')]);ami['on']('devicestatechange',function(_0x30e4dd){try{utils[_0xbc81('0x19')](util[_0xbc81('0x1a')](_0xbc81('0x1b'),_0x30e4dd['device']),_0x30e4dd);members[_0xbc81('0x1c')](_0x30e4dd);}catch(_0x487b34){utils[_0xbc81('0x1d')](util[_0xbc81('0x1a')](_0xbc81('0x1b'),_0x30e4dd[_0xbc81('0x1e')]),_0x487b34);}});ami['on']('agentcalled',function(_0xfcddb5){try{utils[_0xbc81('0x19')](util['format'](_0xbc81('0x1f'),_0xfcddb5[_0xbc81('0x20')]),_0xfcddb5);agents[_0xbc81('0x21')](_0xfcddb5);}catch(_0x210d99){utils[_0xbc81('0x1d')](util[_0xbc81('0x1a')](_0xbc81('0x1f'),_0xfcddb5['uniqueid']),_0x210d99);}});ami['on'](_0xbc81('0x22'),function(_0x4057e5){try{utils['debug'](util['format'](_0xbc81('0x23'),_0x4057e5['uniqueid']),_0x4057e5);agents[_0xbc81('0x22')](_0x4057e5);}catch(_0x435d39){utils['error'](util[_0xbc81('0x1a')](_0xbc81('0x23'),_0x4057e5[_0xbc81('0x20')]),_0x435d39);}});ami['on']('agentconnect',function(_0xed085c){try{utils[_0xbc81('0x19')](util['format']('[%s][index][agentconnect]',_0xed085c[_0xbc81('0x20')]),_0xed085c);agents[_0xbc81('0x24')](_0xed085c);queues[_0xbc81('0x24')](_0xed085c);}catch(_0x2865a9){utils[_0xbc81('0x1d')](util[_0xbc81('0x1a')](_0xbc81('0x25'),_0xed085c[_0xbc81('0x20')]),_0x2865a9);}});ami['on']('agentcomplete',function(_0x39ef50){try{utils[_0xbc81('0x19')](util['format'](_0xbc81('0x26'),_0x39ef50[_0xbc81('0x20')]),_0x39ef50);agents['agentcomplete'](_0x39ef50);queues[_0xbc81('0x27')](_0x39ef50);members[_0xbc81('0x27')](_0x39ef50);}catch(_0x39cb43){utils[_0xbc81('0x1d')](util['format']('[%s][index][agentcomplete]',_0x39ef50[_0xbc81('0x20')]),_0x39cb43);}});ami['on']('queuecallerabandon',function(_0x54ea0f){try{utils['debug'](util['format'](_0xbc81('0x28'),_0x54ea0f[_0xbc81('0x20')]),_0x54ea0f);agents['queuecallerabandon'](_0x54ea0f);queues[_0xbc81('0x29')](_0x54ea0f);}catch(_0x11f645){utils[_0xbc81('0x1d')](util[_0xbc81('0x1a')](_0xbc81('0x28'),_0x54ea0f['uniqueid']),_0x11f645);}});ami['on'](_0xbc81('0x2a'),function(_0xb60ebb){try{utils[_0xbc81('0x19')](util[_0xbc81('0x1a')]('[%s][index][queuecallerjoin]',_0xb60ebb[_0xbc81('0x20')]),_0xb60ebb);queues['queuecallerjoin'](_0xb60ebb);recordings[_0xbc81('0x2a')](_0xb60ebb);}catch(_0x4b6051){utils['error'](util['format']('[%s][index][queuecallerjoin]',_0xb60ebb[_0xbc81('0x20')]),_0x4b6051);}});ami['on'](_0xbc81('0x2b'),function(_0x5b6f4b){try{utils[_0xbc81('0x19')](util[_0xbc81('0x1a')](_0xbc81('0x2c'),_0x5b6f4b[_0xbc81('0x20')]),_0x5b6f4b);queues[_0xbc81('0x2b')](_0x5b6f4b);}catch(_0x673c09){utils[_0xbc81('0x1d')](util[_0xbc81('0x1a')](_0xbc81('0x2c'),_0x5b6f4b[_0xbc81('0x20')]),_0x673c09);}});ami['on'](_0xbc81('0x2d'),function(_0x5e77ea){try{utils[_0xbc81('0x19')](util[_0xbc81('0x1a')]('[%s][index][musiconholdstart]',_0x5e77ea[_0xbc81('0x20')]),_0x5e77ea);queues['musiconholdstart'](_0x5e77ea);calls['musiconholdstart'](_0x5e77ea);}catch(_0x52ac90){utils[_0xbc81('0x1d')](util[_0xbc81('0x1a')]('[%s][index][musiconholdstart]',_0x5e77ea['uniqueid']),_0x52ac90);}});ami['on']('musiconholdstop',function(_0x389321){try{utils[_0xbc81('0x19')](util[_0xbc81('0x1a')]('[%s][index][musiconholdstop]',_0x389321[_0xbc81('0x20')]),_0x389321);queues['musiconholdstop'](_0x389321);calls['musiconholdstop'](_0x389321);}catch(_0x1c2382){utils['error'](util['format'](_0xbc81('0x2e'),_0x389321[_0xbc81('0x20')]),_0x1c2382);}});ami['on']('newstate',function(_0x314c88){try{utils[_0xbc81('0x19')](util[_0xbc81('0x1a')](_0xbc81('0x2f'),_0x314c88['uniqueid']),_0x314c88);calls[_0xbc81('0x30')](_0x314c88);recordings[_0xbc81('0x30')](_0x314c88);}catch(_0x4a9d60){utils[_0xbc81('0x1d')](util[_0xbc81('0x1a')]('[%s][index][newstate]',_0x314c88[_0xbc81('0x20')]),_0x4a9d60);}});ami['on'](_0xbc81('0x31'),function(_0x4eeaf0){try{utils[_0xbc81('0x19')](util[_0xbc81('0x1a')]('[%s][index][hangup]',_0x4eeaf0[_0xbc81('0x20')]),_0x4eeaf0);calls[_0xbc81('0x31')](_0x4eeaf0);recordings[_0xbc81('0x31')](_0x4eeaf0);dials[_0xbc81('0x31')](_0x4eeaf0);agents[_0xbc81('0x31')](_0x4eeaf0);queues[_0xbc81('0x31')](_0x4eeaf0);}catch(_0xc14c19){utils['error'](util[_0xbc81('0x1a')](_0xbc81('0x32'),_0x4eeaf0[_0xbc81('0x20')]),_0xc14c19);}});ami['on'](_0xbc81('0x33'),function(_0x180d79){try{utils[_0xbc81('0x19')](util[_0xbc81('0x1a')]('[%s][index][cdr]',_0x180d79[_0xbc81('0x20')]),_0x180d79);members[_0xbc81('0x33')](_0x180d79);}catch(_0x346250){utils[_0xbc81('0x1d')](util[_0xbc81('0x1a')](_0xbc81('0x34'),_0x180d79[_0xbc81('0x20')]),_0x346250);}});ami['on'](_0xbc81('0x35'),function(_0x3a73ee){try{utils[_0xbc81('0x19')](util[_0xbc81('0x1a')](_0xbc81('0x36'),_0x3a73ee[_0xbc81('0x20')]),_0x3a73ee);queues[_0xbc81('0x35')](_0x3a73ee);agents[_0xbc81('0x35')](_0x3a73ee);transfers['blindtransfer'](_0x3a73ee);}catch(_0x1db8e1){utils[_0xbc81('0x1d')](util[_0xbc81('0x1a')](_0xbc81('0x36'),_0x3a73ee['uniqueid']),_0x1db8e1);}});ami['on'](_0xbc81('0x37'),function(_0x2d47af){try{utils['debug'](util[_0xbc81('0x1a')](_0xbc81('0x38'),_0x2d47af[_0xbc81('0x39')]),_0x2d47af);queues[_0xbc81('0x37')](_0x2d47af);transfers[_0xbc81('0x37')](_0x2d47af);agents['attendedtransfer'](_0x2d47af);calls[_0xbc81('0x37')](_0x2d47af);}catch(_0x49782f){utils[_0xbc81('0x1d')](util['format'](_0xbc81('0x38'),_0x2d47af[_0xbc81('0x39')]),_0x49782f);}});ami['on'](_0xbc81('0x3a'),function(_0x93a6f8){try{utils[_0xbc81('0x19')](util['format']('[%s][index][varset]',_0x93a6f8[_0xbc81('0x20')]),_0x93a6f8);queues[_0xbc81('0x3a')](_0x93a6f8);recordings[_0xbc81('0x3a')](_0x93a6f8);calls[_0xbc81('0x3a')](_0x93a6f8);dials['varset'](_0x93a6f8);}catch(_0x396908){utils['error'](util['format']('[%s][index][varset]',_0x93a6f8[_0xbc81('0x20')]),_0x396908);}});ami['on'](_0xbc81('0x3b'),function(_0x4dbfd8){try{utils[_0xbc81('0x19')](util[_0xbc81('0x1a')](_0xbc81('0x3c'),_0x4dbfd8['uniqueid']),_0x4dbfd8);calls['newexten'](_0x4dbfd8);recordings[_0xbc81('0x3b')](_0x4dbfd8);dials[_0xbc81('0x3b')](_0x4dbfd8);}catch(_0x43a5a0){utils[_0xbc81('0x1d')](util[_0xbc81('0x1a')](_0xbc81('0x3c'),_0x4dbfd8['uniqueid']),_0x43a5a0);}});ami['on'](_0xbc81('0x3d'),function(_0x5b98a2){try{utils['debug'](util[_0xbc81('0x1a')](_0xbc81('0x3e'),_0x5b98a2[_0xbc81('0x20')]),_0x5b98a2);calls[_0xbc81('0x3d')](_0x5b98a2);recordings['newchannel'](_0x5b98a2);}catch(_0x4986a6){utils[_0xbc81('0x1d')](util['format'](_0xbc81('0x3e'),_0x5b98a2[_0xbc81('0x20')]),_0x4986a6);}});ami['on']('dialbegin',function(_0x136cdf){try{utils[_0xbc81('0x19')](util[_0xbc81('0x1a')](_0xbc81('0x3f'),_0x136cdf[_0xbc81('0x20')]),_0x136cdf);dials[_0xbc81('0x40')](_0x136cdf);}catch(_0x47f307){utils[_0xbc81('0x1d')](util[_0xbc81('0x1a')](_0xbc81('0x41'),_0x136cdf['uniqueid']),_0x47f307);}});ami['on'](_0xbc81('0x42'),function(_0x27a50e){try{utils[_0xbc81('0x19')](util[_0xbc81('0x1a')]('[%s][index][dialend]',_0x27a50e[_0xbc81('0x20')]),_0x27a50e);dials['dialend'](_0x27a50e);}catch(_0x58f26b){utils['error'](util[_0xbc81('0x1a')]('[%s][index][dialend]',_0x27a50e[_0xbc81('0x20')]),_0x58f26b);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index b28d1ef..ac7bf0e 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 _0x3e8e=['[%s][members][cdr]','source','data3','data1','destinationchannel','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','util','./utils','Local/_attended@transfer','Queue:','info','format','interface','channel','data2','membername','type','name','internal','request','CreateMemberReport','getUserByName','split','then','[%s][members][writeDB]','uniqueid','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','BUSY','voice','TALKING','agent','NOT_INUSE','isNil','exitAt','now','duration','diffTime','error','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr'];(function(_0x186953,_0x7f2629){var _0x493989=function(_0x2f796b){while(--_0x2f796b){_0x186953['push'](_0x186953['shift']());}};_0x493989(++_0x7f2629);}(_0x3e8e,0x106));var _0xe3e8=function(_0x58872b,_0x160525){_0x58872b=_0x58872b-0x0;var _0x43ee45=_0x3e8e[_0x58872b];return _0x43ee45;};'use strict';var _=require('lodash');var util=require(_0xe3e8('0x0'));var utils=require(_0xe3e8('0x1'));var members={};var exclude=[_0xe3e8('0x2'),_0xe3e8('0x3')];function writeDB(_0x421254){utils[_0xe3e8('0x4')](util[_0xe3e8('0x5')]('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x421254['uniqueid'],_0x421254[_0xe3e8('0x6')],_0x421254[_0xe3e8('0x7')],_0x421254[_0xe3e8('0x8')],_0x421254[_0xe3e8('0x9')],_0x421254[_0xe3e8('0xa')]));if(_0x421254[_0xe3e8('0x6')]){utils['getUserByInterface'](_0x421254[_0xe3e8('0x6')])['then'](function(_0x4d8759){if(_0x4d8759){_0x421254[_0xe3e8('0x9')]=_0x4d8759[_0xe3e8('0xb')];_0x421254['internal']=_0x4d8759[_0xe3e8('0xc')];utils[_0xe3e8('0xd')](_0xe3e8('0xe'),_0x421254);}else{utils[_0xe3e8('0xf')](_0x421254[_0xe3e8('0x6')][_0xe3e8('0x10')]('/')[0x1])[_0xe3e8('0x11')](function(_0x54ac89){if(_0x54ac89){_0x421254[_0xe3e8('0x9')]=_0x54ac89['name'];_0x421254[_0xe3e8('0xc')]=_0x54ac89[_0xe3e8('0xc')];utils['request'](_0xe3e8('0xe'),_0x421254);}});}})['catch'](function(_0x58b19b){utils['error'](util[_0xe3e8('0x5')](_0xe3e8('0x12'),_0x421254[_0xe3e8('0x13')]),_0x58b19b);});}delete members[_0x421254[_0xe3e8('0x6')]];}function startsWith(_0x4324f1,_0x5ded97){return _['some'](_0x4324f1,function(_0x4f95c6){return _[_0xe3e8('0x14')](_0x5ded97,_0x4f95c6);});}exports[_0xe3e8('0x15')]=function(_0x5455a8){try{utils[_0xe3e8('0x16')](util[_0xe3e8('0x5')](_0xe3e8('0x17'),members[_0x5455a8[_0xe3e8('0x18')]]?members[_0x5455a8[_0xe3e8('0x18')]][_0xe3e8('0x13')]:_0x5455a8[_0xe3e8('0x18')]),_0x5455a8);utils[_0xe3e8('0x4')](util[_0xe3e8('0x5')](_0xe3e8('0x19'),members[_0x5455a8[_0xe3e8('0x18')]]?members[_0x5455a8[_0xe3e8('0x18')]][_0xe3e8('0x13')]:_0x5455a8[_0xe3e8('0x18')],_0x5455a8[_0xe3e8('0x1a')],_0x5455a8[_0xe3e8('0x18')]));switch(_0x5455a8[_0xe3e8('0x1a')]){case'INUSE':case _0xe3e8('0x1b'):if(!startsWith(exclude,_0x5455a8[_0xe3e8('0x18')])){members[_0x5455a8[_0xe3e8('0x18')]]={'channel':_0xe3e8('0x1c'),'interface':_0x5455a8[_0xe3e8('0x18')],'type':_0xe3e8('0x1d'),'enterAt':utils['now'](),'role':_0xe3e8('0x1e')};}break;case _0xe3e8('0x1f'):if(!_[_0xe3e8('0x20')](members[_0x5455a8['device']])){members[_0x5455a8['device']][_0xe3e8('0x21')]=utils[_0xe3e8('0x22')]();members[_0x5455a8['device']][_0xe3e8('0x23')]=utils[_0xe3e8('0x24')](members[_0x5455a8[_0xe3e8('0x18')]][_0xe3e8('0x21')],members[_0x5455a8['device']]['enterAt']);if(members[_0x5455a8['device']]['uniqueid']){writeDB(members[_0x5455a8[_0xe3e8('0x18')]]);}}break;default:break;}}catch(_0x14a093){utils[_0xe3e8('0x25')](util['format']('[%s][members][devicestatechange]',members[_0x5455a8['device']]?members[_0x5455a8[_0xe3e8('0x18')]][_0xe3e8('0x13')]:_0x5455a8[_0xe3e8('0x18')]),_0x14a093);}};exports[_0xe3e8('0x26')]=function(_0x14f144){try{if(!_['isNil'](members[_0x14f144[_0xe3e8('0x6')]])){utils[_0xe3e8('0x16')](util['format'](_0xe3e8('0x27'),_0x14f144[_0xe3e8('0x13')]),_0x14f144);utils['info'](util[_0xe3e8('0x5')](_0xe3e8('0x28'),_0x14f144[_0xe3e8('0x13')],_0x14f144['interface'],_0x14f144[_0xe3e8('0x29')]));members[_0x14f144[_0xe3e8('0x6')]]=_[_0xe3e8('0x2a')](members[_0x14f144['interface']],{'data4':_0x14f144[_0xe3e8('0x29')],'uniqueid':_0x14f144['uniqueid']});}}catch(_0x1b794e){utils[_0xe3e8('0x25')](util[_0xe3e8('0x5')](_0xe3e8('0x27'),_0x14f144[_0xe3e8('0x13')]),_0x1b794e);}};exports[_0xe3e8('0x2b')]=function(_0x2b9537){try{utils[_0xe3e8('0x16')](util['format'](_0xe3e8('0x2c'),_0x2b9537[_0xe3e8('0x13')]),_0x2b9537);if(_0x2b9537['channel']){var _0x50430f=_0x2b9537[_0xe3e8('0x7')][_0xe3e8('0x10')]('-')[0x0];if(!_[_0xe3e8('0x20')](members[_0x50430f])){members[_0x50430f]=_['assign'](members[_0x50430f],{'data1':members[_0x50430f]['data1']||_0x2b9537[_0xe3e8('0xa')],'data2':members[_0x50430f][_0xe3e8('0x8')]||_0x2b9537[_0xe3e8('0x2d')],'data3':members[_0x50430f][_0xe3e8('0x2e')]||_0x2b9537['destination'],'uniqueid':members[_0x50430f][_0xe3e8('0x13')]||_0x2b9537[_0xe3e8('0x13')]});utils[_0xe3e8('0x4')](util[_0xe3e8('0x5')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x2b9537[_0xe3e8('0x13')],members[_0x50430f][_0xe3e8('0x2f')],members[_0x50430f]['data2'],members[_0x50430f][_0xe3e8('0x2e')]));if(members[_0x50430f][_0xe3e8('0x21')]){writeDB(members[_0x50430f]);}}}if(_0x2b9537[_0xe3e8('0x30')]){var _0x30049f=_0x2b9537['destinationchannel']['split']('-')[0x0];if(!_[_0xe3e8('0x20')](members[_0x30049f])){members[_0x30049f]=_[_0xe3e8('0x2a')](members[_0x30049f],{'data1':members[_0x30049f][_0xe3e8('0x2f')]||_0x2b9537[_0xe3e8('0xa')],'data2':members[_0x30049f][_0xe3e8('0x8')]||_0x2b9537[_0xe3e8('0x2d')],'data3':members[_0x30049f][_0xe3e8('0x2e')]||_0x2b9537[_0xe3e8('0x31')],'uniqueid':members[_0x30049f][_0xe3e8('0x13')]||_0x2b9537['uniqueid']});utils['info'](util['format'](_0xe3e8('0x32'),_0x2b9537[_0xe3e8('0x13')],members[_0x30049f]['data1'],members[_0x30049f][_0xe3e8('0x8')],members[_0x30049f]['data3']));if(members[_0x30049f][_0xe3e8('0x21')]){writeDB(members[_0x30049f]);}}}}catch(_0x5b9f95){utils[_0xe3e8('0x25')](util['format']('[%s][members][cdr]',_0x2b9537[_0xe3e8('0x13')]),_0x5b9f95);}}; \ No newline at end of file +var _0x599f=['[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','[%s][members][cdr]','channel','assign','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','data2','destinationchannel','type','source','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','membername','interface','getUserByInterface','then','name','internal','CreateMemberReport','getUserByName','split','error','some','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','TALKING','now','agent','isNil','duration','diffTime','exitAt','enterAt','agentcomplete'];(function(_0x46361e,_0x243aaf){var _0x14e302=function(_0x9ebecf){while(--_0x9ebecf){_0x46361e['push'](_0x46361e['shift']());}};_0x14e302(++_0x243aaf);}(_0x599f,0x74));var _0xf599=function(_0x3f3514,_0x4dbfea){_0x3f3514=_0x3f3514-0x0;var _0x1203de=_0x599f[_0x3f3514];return _0x1203de;};'use strict';var _=require(_0xf599('0x0'));var util=require(_0xf599('0x1'));var utils=require(_0xf599('0x2'));var members={};var exclude=[_0xf599('0x3'),_0xf599('0x4')];function writeDB(_0x4008b6){utils[_0xf599('0x5')](util[_0xf599('0x6')](_0xf599('0x7'),_0x4008b6[_0xf599('0x8')],_0x4008b6['interface'],_0x4008b6['channel'],_0x4008b6['data2'],_0x4008b6[_0xf599('0x9')],_0x4008b6['type']));if(_0x4008b6[_0xf599('0xa')]){utils[_0xf599('0xb')](_0x4008b6[_0xf599('0xa')])[_0xf599('0xc')](function(_0x762cec){if(_0x762cec){_0x4008b6[_0xf599('0x9')]=_0x762cec[_0xf599('0xd')];_0x4008b6[_0xf599('0xe')]=_0x762cec[_0xf599('0xe')];utils['request'](_0xf599('0xf'),_0x4008b6);}else{utils[_0xf599('0x10')](_0x4008b6[_0xf599('0xa')][_0xf599('0x11')]('/')[0x1])[_0xf599('0xc')](function(_0x22c119){if(_0x22c119){_0x4008b6[_0xf599('0x9')]=_0x22c119['name'];_0x4008b6[_0xf599('0xe')]=_0x22c119['internal'];utils['request']('CreateMemberReport',_0x4008b6);}});}})['catch'](function(_0x332c7b){utils[_0xf599('0x12')](util[_0xf599('0x6')]('[%s][members][writeDB]',_0x4008b6['uniqueid']),_0x332c7b);});}delete members[_0x4008b6[_0xf599('0xa')]];}function startsWith(_0x58f810,_0x5d5bc8){return _[_0xf599('0x13')](_0x58f810,function(_0x1ead22){return _['startsWith'](_0x5d5bc8,_0x1ead22);});}exports[_0xf599('0x14')]=function(_0x17e544){try{utils[_0xf599('0x15')](util[_0xf599('0x6')](_0xf599('0x16'),members[_0x17e544[_0xf599('0x17')]]?members[_0x17e544[_0xf599('0x17')]][_0xf599('0x8')]:_0x17e544[_0xf599('0x17')]),_0x17e544);utils['info'](util['format'](_0xf599('0x18'),members[_0x17e544[_0xf599('0x17')]]?members[_0x17e544[_0xf599('0x17')]][_0xf599('0x8')]:_0x17e544[_0xf599('0x17')],_0x17e544[_0xf599('0x19')],_0x17e544[_0xf599('0x17')]));switch(_0x17e544['state']){case _0xf599('0x1a'):case _0xf599('0x1b'):if(!startsWith(exclude,_0x17e544['device'])){members[_0x17e544[_0xf599('0x17')]]={'channel':'voice','interface':_0x17e544[_0xf599('0x17')],'type':_0xf599('0x1c'),'enterAt':utils[_0xf599('0x1d')](),'role':_0xf599('0x1e')};}break;case'NOT_INUSE':if(!_[_0xf599('0x1f')](members[_0x17e544['device']])){members[_0x17e544[_0xf599('0x17')]]['exitAt']=utils[_0xf599('0x1d')]();members[_0x17e544[_0xf599('0x17')]][_0xf599('0x20')]=utils[_0xf599('0x21')](members[_0x17e544['device']][_0xf599('0x22')],members[_0x17e544['device']][_0xf599('0x23')]);if(members[_0x17e544['device']][_0xf599('0x8')]){writeDB(members[_0x17e544[_0xf599('0x17')]]);}}break;default:break;}}catch(_0x40ed53){utils['error'](util[_0xf599('0x6')](_0xf599('0x16'),members[_0x17e544['device']]?members[_0x17e544[_0xf599('0x17')]][_0xf599('0x8')]:_0x17e544['device']),_0x40ed53);}};exports[_0xf599('0x24')]=function(_0x4ea078){try{if(!_[_0xf599('0x1f')](members[_0x4ea078[_0xf599('0xa')]])){utils[_0xf599('0x15')](util['format'](_0xf599('0x25'),_0x4ea078['uniqueid']),_0x4ea078);utils['info'](util[_0xf599('0x6')](_0xf599('0x26'),_0x4ea078[_0xf599('0x8')],_0x4ea078[_0xf599('0xa')],_0x4ea078[_0xf599('0x27')]));members[_0x4ea078[_0xf599('0xa')]]=_['assign'](members[_0x4ea078[_0xf599('0xa')]],{'data4':_0x4ea078[_0xf599('0x27')],'uniqueid':_0x4ea078[_0xf599('0x8')]});}}catch(_0xd73c96){utils[_0xf599('0x12')](util[_0xf599('0x6')](_0xf599('0x25'),_0x4ea078[_0xf599('0x8')]),_0xd73c96);}};exports['cdr']=function(_0xcdc26b){try{utils[_0xf599('0x15')](util[_0xf599('0x6')](_0xf599('0x28'),_0xcdc26b[_0xf599('0x8')]),_0xcdc26b);if(_0xcdc26b[_0xf599('0x29')]){var _0x49a5dd=_0xcdc26b[_0xf599('0x29')][_0xf599('0x11')]('-')[0x0];if(!_[_0xf599('0x1f')](members[_0x49a5dd])){members[_0x49a5dd]=_[_0xf599('0x2a')](members[_0x49a5dd],{'data1':members[_0x49a5dd]['data1']||_0xcdc26b['type'],'data2':members[_0x49a5dd]['data2']||_0xcdc26b['source'],'data3':members[_0x49a5dd][_0xf599('0x2b')]||_0xcdc26b[_0xf599('0x2c')],'uniqueid':members[_0x49a5dd][_0xf599('0x8')]||_0xcdc26b[_0xf599('0x8')]});utils[_0xf599('0x5')](util[_0xf599('0x6')](_0xf599('0x2d'),_0xcdc26b['uniqueid'],members[_0x49a5dd][_0xf599('0x2e')],members[_0x49a5dd][_0xf599('0x2f')],members[_0x49a5dd]['data3']));if(members[_0x49a5dd]['exitAt']){writeDB(members[_0x49a5dd]);}}}if(_0xcdc26b[_0xf599('0x30')]){var _0x21fb5d=_0xcdc26b[_0xf599('0x30')][_0xf599('0x11')]('-')[0x0];if(!_[_0xf599('0x1f')](members[_0x21fb5d])){members[_0x21fb5d]=_[_0xf599('0x2a')](members[_0x21fb5d],{'data1':members[_0x21fb5d][_0xf599('0x2e')]||_0xcdc26b[_0xf599('0x31')],'data2':members[_0x21fb5d]['data2']||_0xcdc26b[_0xf599('0x32')],'data3':members[_0x21fb5d]['data3']||_0xcdc26b['destination'],'uniqueid':members[_0x21fb5d][_0xf599('0x8')]||_0xcdc26b[_0xf599('0x8')]});utils[_0xf599('0x5')](util[_0xf599('0x6')](_0xf599('0x2d'),_0xcdc26b[_0xf599('0x8')],members[_0x21fb5d][_0xf599('0x2e')],members[_0x21fb5d][_0xf599('0x2f')],members[_0x21fb5d][_0xf599('0x2b')]));if(members[_0x21fb5d][_0xf599('0x22')]){writeDB(members[_0x21fb5d]);}}}}catch(_0x73d7a6){utils[_0xf599('0x12')](util['format'](_0xf599('0x28'),_0xcdc26b[_0xf599('0x8')]),_0x73d7a6);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index c4283eb..033a7de 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 _0x5ae5=['[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','assigned','destaccountcode','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','ATTENDED','transfertargetlinkedid','clone','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','util','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','lastAssignedTo','calleridnum','accountcode','queue','type','CreateVoiceQueueReport','request','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','info','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','queuecallerexitreason','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerenterreason','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexit','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerexitAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','holdtime','diffTime','queuecallerjoinAt','count','connectedlinenum','connectedlinename','agentconnect'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x5ae5,0x171));var _0x55ae=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x5ae5[_0x2bf141];return _0x48277b;};'use strict';var _=require('lodash');var util=require(_0x55ae('0x0'));var utils=require('./utils');var queues={};function writeDB(_0x2eeef8){utils['info'](util[_0x55ae('0x1')](_0x55ae('0x2'),_0x2eeef8[_0x55ae('0x3')],_0x2eeef8[_0x55ae('0x4')],_0x2eeef8['queue'],_0x2eeef8[_0x55ae('0x5')],_0x2eeef8[_0x55ae('0x6')],_0x2eeef8[_0x55ae('0x7')],_0x2eeef8['queuecallerexitreason']));if(_0x2eeef8[_0x55ae('0x8')]){utils['getVoiceQueueByName'](_0x2eeef8[_0x55ae('0x8')])['then'](function(_0x2e9544){if(_0x2e9544){_0x2eeef8['type']=_0x2e9544[_0x55ae('0x9')];}utils['request'](_0x55ae('0xa'),_0x2eeef8);});}else{utils[_0x55ae('0xb')]('CreateVoiceQueueReport',_0x2eeef8);}if(_0x2eeef8[_0x55ae('0xc')]){delete queues[_0x2eeef8['transfereduniqueid']];}else{delete queues[_0x2eeef8['uniqueid']];}}exports[_0x55ae('0xd')]=function(_0x4a16e3){try{utils[_0x55ae('0xe')](util[_0x55ae('0x1')](_0x55ae('0xf'),_0x4a16e3['uniqueid']),_0x4a16e3);utils[_0x55ae('0x10')](util[_0x55ae('0x1')](_0x55ae('0x11'),_0x4a16e3['uniqueid'],_0x4a16e3[_0x55ae('0x8')],_0x4a16e3[_0x55ae('0x12')]));queues[_0x4a16e3['uniqueid']]=_[_0x55ae('0x13')](_0x4a16e3,{'originalposition':_0x4a16e3['position'],'queuecallerjoinAt':utils[_0x55ae('0x14')](),'mohtime':0x0});}catch(_0x5818e9){utils[_0x55ae('0x15')](util[_0x55ae('0x1')](_0x55ae('0xf'),_0x4a16e3[_0x55ae('0x3')]),_0x5818e9);}};exports[_0x55ae('0x16')]=function(_0x3f5288){try{if(!_[_0x55ae('0x17')](queues[_0x3f5288['uniqueid']])){utils[_0x55ae('0xe')](util[_0x55ae('0x1')](_0x55ae('0x18'),_0x3f5288[_0x55ae('0x3')]),_0x3f5288);if(queues[_0x3f5288[_0x55ae('0x3')]][_0x55ae('0x19')]){if(!queues[_0x3f5288[_0x55ae('0x3')]][_0x55ae('0x1a')]&&!queues[_0x3f5288[_0x55ae('0x3')]]['queuecallerexit']){queues[_0x3f5288[_0x55ae('0x3')]][_0x55ae('0x1b')]=!![];queues[_0x3f5288['uniqueid']][_0x55ae('0x1c')]=utils['now']();queues[_0x3f5288[_0x55ae('0x3')]][_0x55ae('0x1d')]='COMPLETEDBYAGENT';}utils[_0x55ae('0x10')](util[_0x55ae('0x1')](_0x55ae('0x1e'),_0x3f5288[_0x55ae('0x3')],queues[_0x3f5288[_0x55ae('0x3')]][_0x55ae('0x1f')],queues[_0x3f5288[_0x55ae('0x3')]][_0x55ae('0x1d')]));writeDB(queues[_0x3f5288[_0x55ae('0x3')]]);}else if(queues[_0x3f5288[_0x55ae('0x3')]][_0x55ae('0xc')]){utils[_0x55ae('0x10')](util['format']('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x3f5288[_0x55ae('0x3')],queues[_0x3f5288[_0x55ae('0x3')]][_0x55ae('0x1f')],queues[_0x3f5288[_0x55ae('0x3')]][_0x55ae('0xc')]));queues[queues[_0x3f5288['uniqueid']][_0x55ae('0xc')]]=queues[_0x3f5288[_0x55ae('0x3')]];queues[queues[_0x3f5288[_0x55ae('0x3')]][_0x55ae('0xc')]][_0x55ae('0x20')]=0x2;delete queues[_0x3f5288['uniqueid']];}}}catch(_0x45bf90){utils[_0x55ae('0x15')](util['format']('[%s][queues][hangup]',_0x3f5288['uniqueid']),_0x45bf90);}};exports[_0x55ae('0x21')]=function(_0x3d9307){try{utils[_0x55ae('0xe')](util[_0x55ae('0x1')](_0x55ae('0x22'),_0x3d9307[_0x55ae('0x3')]),_0x3d9307);if(!_[_0x55ae('0x17')](_0x3d9307[_0x55ae('0x23')][_0x55ae('0x24')])&&_0x3d9307[_0x55ae('0x25')][_0x55ae('0x26')]()!==_0x55ae('0x27')){if(!_['isNil'](queues[_0x3d9307[_0x55ae('0x3')]])){queues[_0x3d9307[_0x55ae('0x3')]][_0x55ae('0x1a')]=![];queues[_0x3d9307['uniqueid']][_0x55ae('0x28')]=null;queues[_0x3d9307[_0x55ae('0x3')]][_0x55ae('0x29')]=!![];queues[_0x3d9307[_0x55ae('0x3')]]['queuecallerexitAt']=utils[_0x55ae('0x14')]();queues[_0x3d9307[_0x55ae('0x3')]][_0x55ae('0x1d')]=_0x3d9307[_0x55ae('0x25')][_0x55ae('0x26')]();utils[_0x55ae('0x10')](util[_0x55ae('0x1')](_0x55ae('0x2a'),_0x3d9307[_0x55ae('0x3')],queues[_0x3d9307[_0x55ae('0x3')]]['name'],_0x3d9307[_0x55ae('0x25')],queues[_0x3d9307[_0x55ae('0x3')]][_0x55ae('0x1d')]));writeDB(queues[_0x3d9307[_0x55ae('0x3')]]);}}else if(!_[_0x55ae('0x17')](_0x3d9307[_0x55ae('0x23')][_0x55ae('0x2b')])){if(!_[_0x55ae('0x17')](queues[_0x3d9307[_0x55ae('0x3')]])&&!queues[_0x3d9307['uniqueid']][_0x55ae('0x1a')]){queues[_0x3d9307[_0x55ae('0x3')]][_0x55ae('0x1a')]=![];queues[_0x3d9307['uniqueid']][_0x55ae('0x28')]=null;queues[_0x3d9307[_0x55ae('0x3')]][_0x55ae('0x29')]=!![];queues[_0x3d9307[_0x55ae('0x3')]][_0x55ae('0x2c')]=utils[_0x55ae('0x14')]();queues[_0x3d9307['uniqueid']][_0x55ae('0x1d')]=_0x55ae('0x2d');utils[_0x55ae('0x10')](util[_0x55ae('0x1')](_0x55ae('0x2e'),_0x3d9307[_0x55ae('0x3')],queues[_0x3d9307['uniqueid']]['name'],_0x3d9307[_0x55ae('0x25')],queues[_0x3d9307['uniqueid']][_0x55ae('0x1d')]));}}}catch(_0x394e74){utils[_0x55ae('0x15')](util[_0x55ae('0x1')]('[%s][queues][varset]',_0x3d9307[_0x55ae('0x3')]),_0x394e74);}};exports['queuecallerabandon']=function(_0x5a3b09){try{if(!_[_0x55ae('0x17')](queues[_0x5a3b09[_0x55ae('0x3')]])){utils[_0x55ae('0xe')](util['format'](_0x55ae('0x2f'),_0x5a3b09[_0x55ae('0x3')]),_0x5a3b09);queues[_0x5a3b09[_0x55ae('0x3')]][_0x55ae('0x29')]=![];queues[_0x5a3b09[_0x55ae('0x3')]]['queuecallerexitAt']=null;queues[_0x5a3b09[_0x55ae('0x3')]]['queuecallerabandon']=!![];queues[_0x5a3b09['uniqueid']][_0x55ae('0x28')]=utils['now']();queues[_0x5a3b09[_0x55ae('0x3')]]['queuecallerexitreason']='ABANDONED';utils[_0x55ae('0x10')](util[_0x55ae('0x1')](_0x55ae('0x30'),_0x5a3b09['uniqueid'],queues[_0x5a3b09[_0x55ae('0x3')]][_0x55ae('0x1f')],queues[_0x5a3b09[_0x55ae('0x3')]][_0x55ae('0x1d')]));}}catch(_0x55841b){utils[_0x55ae('0x15')](util[_0x55ae('0x1')](_0x55ae('0x2f'),_0x5a3b09[_0x55ae('0x3')]),_0x55841b);}};exports[_0x55ae('0x31')]=function(_0x4bab79){try{if(!_['isNil'](queues[_0x4bab79[_0x55ae('0x3')]])){utils[_0x55ae('0xe')](util[_0x55ae('0x1')](_0x55ae('0x32'),_0x4bab79[_0x55ae('0x3')]),_0x4bab79);utils[_0x55ae('0x10')](util[_0x55ae('0x1')](_0x55ae('0x33'),_0x4bab79[_0x55ae('0x3')],queues[_0x4bab79['uniqueid']][_0x55ae('0x1f')],_0x4bab79['connectedlinenum'],_0x4bab79['connectedlinename']));queues[_0x4bab79[_0x55ae('0x3')]]['queuecallerleave']=!![];queues[_0x4bab79[_0x55ae('0x3')]][_0x55ae('0x19')]=utils[_0x55ae('0x14')]();queues[_0x4bab79[_0x55ae('0x3')]][_0x55ae('0x34')]=utils[_0x55ae('0x35')](queues[_0x4bab79[_0x55ae('0x3')]][_0x55ae('0x19')],queues[_0x4bab79['uniqueid']][_0x55ae('0x36')]);queues[_0x4bab79[_0x55ae('0x3')]][_0x55ae('0x12')]=_0x4bab79[_0x55ae('0x12')];queues[_0x4bab79[_0x55ae('0x3')]][_0x55ae('0x37')]=_0x4bab79['count'];queues[_0x4bab79[_0x55ae('0x3')]][_0x55ae('0x38')]=_0x4bab79['connectedlinenum'];queues[_0x4bab79['uniqueid']][_0x55ae('0x39')]=_0x4bab79[_0x55ae('0x39')];}}catch(_0x34edfe){utils[_0x55ae('0x15')](util[_0x55ae('0x1')](_0x55ae('0x32'),_0x4bab79['uniqueid']),_0x34edfe);}};exports[_0x55ae('0x3a')]=function(_0x24e073){try{if(!_[_0x55ae('0x17')](queues[_0x24e073[_0x55ae('0x3')]])){utils['debug'](util[_0x55ae('0x1')](_0x55ae('0x3b'),_0x24e073[_0x55ae('0x3')]),_0x24e073);utils[_0x55ae('0x10')](util[_0x55ae('0x1')](_0x55ae('0x3c'),_0x24e073[_0x55ae('0x3')],queues[_0x24e073['uniqueid']][_0x55ae('0x1f')],_0x24e073[_0x55ae('0x3d')],_0x24e073['destaccountcode']));queues[_0x24e073[_0x55ae('0x3')]]['queuecallerabandon']=![];queues[_0x24e073['uniqueid']][_0x55ae('0x1a')]=![];queues[_0x24e073[_0x55ae('0x3')]]['queuecallerabandonAt']=null;queues[_0x24e073[_0x55ae('0x3')]][_0x55ae('0x29')]=![];queues[_0x24e073[_0x55ae('0x3')]][_0x55ae('0x1d')]=null;queues[_0x24e073['uniqueid']]['queuecallerexitAt']=null;queues[_0x24e073['uniqueid']][_0x55ae('0x3e')]=!![];queues[_0x24e073[_0x55ae('0x3')]][_0x55ae('0x7')]=_0x24e073[_0x55ae('0x3f')];queues[_0x24e073['uniqueid']]['lastAssignedTo']=_0x24e073[_0x55ae('0x3d')];}}catch(_0x3e66fd){utils['error'](util[_0x55ae('0x1')](_0x55ae('0x3b'),_0x24e073[_0x55ae('0x3')]),_0x3e66fd);}};exports[_0x55ae('0x40')]=function(_0x557624){try{if(!_['isNil'](queues[_0x557624[_0x55ae('0x3')]])){if(queues[_0x557624[_0x55ae('0x3')]][_0x55ae('0x19')]){utils[_0x55ae('0xe')](util[_0x55ae('0x1')](_0x55ae('0x41'),_0x557624[_0x55ae('0x3')]),_0x557624);queues[_0x557624[_0x55ae('0x3')]][_0x55ae('0x1a')]=![];queues[_0x557624[_0x55ae('0x3')]][_0x55ae('0x1a')]=![];queues[_0x557624['uniqueid']][_0x55ae('0x28')]=null;queues[_0x557624[_0x55ae('0x3')]][_0x55ae('0x29')]=![];queues[_0x557624[_0x55ae('0x3')]][_0x55ae('0x2c')]=null;queues[_0x557624[_0x55ae('0x3')]]['assigned']=!![];queues[_0x557624[_0x55ae('0x3')]][_0x55ae('0x5')]=_0x557624['membername'];queues[_0x557624[_0x55ae('0x3')]][_0x55ae('0x1b')]=!![];queues[_0x557624[_0x55ae('0x3')]][_0x55ae('0x1c')]=utils[_0x55ae('0x14')]();if(_0x557624[_0x55ae('0x42')]==_0x55ae('0x43')){if(!queues[_0x557624[_0x55ae('0x3')]]['transfer']){queues[_0x557624[_0x55ae('0x3')]][_0x55ae('0x1d')]=_0x55ae('0x44');}}else{queues[_0x557624[_0x55ae('0x3')]][_0x55ae('0x1d')]=_0x55ae('0x45')+_0x557624['reason'][_0x55ae('0x26')]();}utils['info'](util[_0x55ae('0x1')](_0x55ae('0x46'),_0x557624['uniqueid'],queues[_0x557624[_0x55ae('0x3')]]['name'],_0x557624[_0x55ae('0x3d')],queues[_0x557624[_0x55ae('0x3')]][_0x55ae('0x1d')]));writeDB(queues[_0x557624[_0x55ae('0x3')]]);}}}catch(_0x21b2bb){utils[_0x55ae('0x15')](util[_0x55ae('0x1')](_0x55ae('0x41'),_0x557624[_0x55ae('0x3')]),_0x21b2bb);}};exports[_0x55ae('0x47')]=function(_0x74d8d5){try{if(!_[_0x55ae('0x17')](queues[_0x74d8d5[_0x55ae('0x48')]])){utils[_0x55ae('0xe')](util['format'](_0x55ae('0x49'),_0x74d8d5[_0x55ae('0x3')]),_0x74d8d5);queues[_0x74d8d5[_0x55ae('0x48')]][_0x55ae('0x43')]=!![];queues[_0x74d8d5[_0x55ae('0x48')]][_0x55ae('0x4a')]='BLIND';queues[_0x74d8d5['transfereeuniqueid']][_0x55ae('0x4b')]=_0x74d8d5[_0x55ae('0x4c')];queues[_0x74d8d5['transfereeuniqueid']][_0x55ae('0x4d')]=_0x74d8d5[_0x55ae('0x48')];queues[_0x74d8d5[_0x55ae('0x48')]][_0x55ae('0x1d')]=_0x55ae('0x4e');utils[_0x55ae('0x10')](util[_0x55ae('0x1')](_0x55ae('0x4f'),_0x74d8d5[_0x55ae('0x3')],queues[_0x74d8d5[_0x55ae('0x48')]][_0x55ae('0x1f')],_0x74d8d5[_0x55ae('0x48')],_0x74d8d5[_0x55ae('0x4c')]));}}catch(_0x5294fc){utils[_0x55ae('0x15')](util[_0x55ae('0x1')](_0x55ae('0x49'),_0x74d8d5[_0x55ae('0x3')]),_0x5294fc);}};exports[_0x55ae('0x50')]=function(_0x1156b8){try{utils['debug'](util[_0x55ae('0x1')](_0x55ae('0x51'),_0x1156b8[_0x55ae('0x52')]),_0x1156b8);if(_0x1156b8['origtransfereruniqueid']==_0x1156b8[_0x55ae('0x53')]){if(!_['isNil'](queues[_0x1156b8[_0x55ae('0x54')]])){utils[_0x55ae('0x10')](util[_0x55ae('0x1')](_0x55ae('0x55'),_0x1156b8[_0x55ae('0x52')],queues[_0x1156b8[_0x55ae('0x54')]]['name'],_0x1156b8['origtransfererexten']));queues[_0x1156b8[_0x55ae('0x54')]][_0x55ae('0x43')]=!![];queues[_0x1156b8['secondtransfererlinkedid']]['transfertype']='ATTENDED';queues[_0x1156b8[_0x55ae('0x54')]][_0x55ae('0x4b')]=_0x1156b8[_0x55ae('0x56')];queues[_0x1156b8[_0x55ae('0x54')]][_0x55ae('0x4d')]=_0x1156b8['origtransfereruniqueid'];queues[_0x1156b8['secondtransfererlinkedid']][_0x55ae('0x1d')]=_0x55ae('0x57');}if(!_['isNil'](queues[_0x1156b8[_0x55ae('0x53')]])){if(_0x1156b8[_0x55ae('0x58')]&&queues[_0x1156b8[_0x55ae('0x58')]]){queues[_0x1156b8[_0x55ae('0x58')]]['queuecallerenterreason']=0x1;queues[_0x1156b8[_0x55ae('0x48')]]=_['clone'](queues[_0x1156b8[_0x55ae('0x58')]]);queues[_0x1156b8[_0x55ae('0x48')]][_0x55ae('0xc')]=_0x1156b8[_0x55ae('0x59')];queues[_0x1156b8[_0x55ae('0x48')]][_0x55ae('0x20')]=0x2;queues[_0x1156b8[_0x55ae('0x48')]][_0x55ae('0x6')]=queues[_0x1156b8[_0x55ae('0x54')]][_0x55ae('0x6')];queues[_0x1156b8[_0x55ae('0x48')]][_0x55ae('0x5a')]=queues[_0x1156b8['secondtransfererlinkedid']]['calleridname'];queues[_0x1156b8[_0x55ae('0x48')]][_0x55ae('0x36')]=utils[_0x55ae('0x14')]();queues[_0x1156b8[_0x55ae('0x48')]][_0x55ae('0x19')]=utils[_0x55ae('0x14')]();queues[_0x1156b8[_0x55ae('0x48')]][_0x55ae('0x34')]=0x0;queues[_0x1156b8[_0x55ae('0x48')]][_0x55ae('0x5b')]=0x0;utils[_0x55ae('0x10')](util['format'](_0x55ae('0x5c'),_0x1156b8[_0x55ae('0x52')],queues[_0x1156b8[_0x55ae('0x48')]][_0x55ae('0x1f')],queues[_0x1156b8[_0x55ae('0x48')]]['calleridnum'],queues[_0x1156b8[_0x55ae('0x48')]][_0x55ae('0x5a')]));}else{utils[_0x55ae('0x10')](util[_0x55ae('0x1')](_0x55ae('0x5d'),_0x1156b8[_0x55ae('0x52')],queues[_0x1156b8[_0x55ae('0x53')]][_0x55ae('0x1f')],_0x1156b8[_0x55ae('0x54')]));queues[_0x1156b8[_0x55ae('0x53')]][_0x55ae('0xc')]=_0x1156b8['secondtransfererlinkedid'];}}}else if(_0x1156b8[_0x55ae('0x5e')]==_0x1156b8['secondtransfererlinkedid']){if(!_[_0x55ae('0x17')](queues[_0x1156b8[_0x55ae('0x53')]])){utils['info'](util['format'](_0x55ae('0x5f'),_0x1156b8['origtransfereruniqueid'],queues[_0x1156b8[_0x55ae('0x53')]][_0x55ae('0x1f')],_0x1156b8[_0x55ae('0x5e')],_0x1156b8[_0x55ae('0x60')]));queues[_0x1156b8[_0x55ae('0x53')]]['transfer']=!![];queues[_0x1156b8[_0x55ae('0x53')]][_0x55ae('0x4a')]=_0x55ae('0x61');queues[_0x1156b8[_0x55ae('0x53')]][_0x55ae('0x4b')]=_0x1156b8[_0x55ae('0x60')];queues[_0x1156b8['origtransfererlinkedid']]['transferuniqueid']=_0x1156b8[_0x55ae('0x5e')];queues[_0x1156b8['origtransfererlinkedid']]['queuecallerexitreason']=_0x55ae('0x57');}if(!_['isNil'](queues[_0x1156b8['secondtransfererlinkedid']])){if(_0x1156b8[_0x55ae('0x62')]&&queues[_0x1156b8[_0x55ae('0x62')]]){queues[_0x1156b8[_0x55ae('0x62')]][_0x55ae('0x20')]=0x1;queues[_0x1156b8[_0x55ae('0x59')]]=_[_0x55ae('0x63')](queues[_0x1156b8[_0x55ae('0x62')]]);queues[_0x1156b8[_0x55ae('0x59')]]['transfereduniqueid']=_0x1156b8[_0x55ae('0x59')];queues[_0x1156b8[_0x55ae('0x59')]][_0x55ae('0x20')]=0x2;queues[_0x1156b8[_0x55ae('0x59')]][_0x55ae('0x6')]=queues[_0x1156b8[_0x55ae('0x53')]][_0x55ae('0x6')];queues[_0x1156b8['transfertargetuniqueid']]['calleridname']=queues[_0x1156b8['origtransfererlinkedid']][_0x55ae('0x5a')];queues[_0x1156b8[_0x55ae('0x59')]][_0x55ae('0x36')]=utils[_0x55ae('0x14')]();queues[_0x1156b8['transfertargetuniqueid']][_0x55ae('0x19')]=utils[_0x55ae('0x14')]();queues[_0x1156b8[_0x55ae('0x59')]]['holdtime']=0x0;queues[_0x1156b8[_0x55ae('0x59')]][_0x55ae('0x5b')]=0x0;utils[_0x55ae('0x10')](util[_0x55ae('0x1')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x1156b8[_0x55ae('0x52')],queues[_0x1156b8[_0x55ae('0x59')]][_0x55ae('0x1f')],queues[_0x1156b8['transfertargetuniqueid']][_0x55ae('0xc')],queues[_0x1156b8[_0x55ae('0x59')]][_0x55ae('0x6')],queues[_0x1156b8[_0x55ae('0x59')]][_0x55ae('0x5a')]));}else{utils[_0x55ae('0x10')](util[_0x55ae('0x1')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x1156b8[_0x55ae('0x52')],queues[_0x1156b8['secondtransfererlinkedid']][_0x55ae('0x1f')],_0x1156b8[_0x55ae('0x53')]));queues[_0x1156b8[_0x55ae('0x54')]][_0x55ae('0xc')]=_0x1156b8[_0x55ae('0x53')];}}}}catch(_0x1b73cd){utils[_0x55ae('0x15')](util[_0x55ae('0x1')](_0x55ae('0x51'),_0x1156b8[_0x55ae('0x52')]),_0x1b73cd);}};exports[_0x55ae('0x64')]=function(_0x199b63){try{if(!_[_0x55ae('0x17')](queues[_0x199b63[_0x55ae('0x3')]])){utils['debug'](util[_0x55ae('0x1')](_0x55ae('0x65'),_0x199b63[_0x55ae('0x3')]),_0x199b63);queues[_0x199b63[_0x55ae('0x3')]][_0x55ae('0x66')]=utils['now']();utils[_0x55ae('0x10')](util[_0x55ae('0x1')](_0x55ae('0x67'),_0x199b63[_0x55ae('0x3')],queues[_0x199b63[_0x55ae('0x3')]][_0x55ae('0x1f')],queues[_0x199b63['uniqueid']][_0x55ae('0x66')]));}}catch(_0x59e016){utils[_0x55ae('0x15')](util['format'](_0x55ae('0x65'),_0x199b63[_0x55ae('0x3')]),_0x59e016);}};exports[_0x55ae('0x68')]=function(_0x10109a){try{if(!_[_0x55ae('0x17')](queues[_0x10109a['uniqueid']])){if(!_[_0x55ae('0x17')](queues[_0x10109a['uniqueid']][_0x55ae('0x66')])){utils['debug'](util[_0x55ae('0x1')](_0x55ae('0x69'),_0x10109a[_0x55ae('0x3')]),_0x10109a);queues[_0x10109a[_0x55ae('0x3')]][_0x55ae('0x5b')]+=utils[_0x55ae('0x35')](utils[_0x55ae('0x14')](),queues[_0x10109a[_0x55ae('0x3')]][_0x55ae('0x66')]);utils[_0x55ae('0x10')](util[_0x55ae('0x1')](_0x55ae('0x6a'),_0x10109a[_0x55ae('0x3')],queues[_0x10109a[_0x55ae('0x3')]][_0x55ae('0x1f')],queues[_0x10109a[_0x55ae('0x3')]][_0x55ae('0x5b')]));delete queues[_0x10109a[_0x55ae('0x3')]][_0x55ae('0x66')];}}}catch(_0x163823){utils[_0x55ae('0x15')](util[_0x55ae('0x1')]('[%s][queues][musiconholdstop]',_0x10109a['uniqueid']),_0x163823);}}; \ No newline at end of file +var _0xd5b4=['mohtime','lodash','util','./utils','format','uniqueid','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','queue','getVoiceQueueByName','type','request','CreateVoiceQueueReport','transfereduniqueid','debug','[%s][queues][queuecallerjoin]','info','assign','position','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','variable','queuestatus','value','toUpperCase','CONTINUE','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerabandonAt','queuecallerexitAt','EXITWITHKEY','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleave','holdtime','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','[%s][queues][agentconnect]','transfer','TRANSFER','COMPLETEDBY','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','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','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','ATTENDED','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstartAt','[%s][queues][musiconholdstart]','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd5b4,0x6b));var _0x4d5b=function(_0x1a6c54,_0x53ec8c){_0x1a6c54=_0x1a6c54-0x0;var _0x20543f=_0xd5b4[_0x1a6c54];return _0x20543f;};'use strict';var _=require(_0x4d5b('0x0'));var util=require(_0x4d5b('0x1'));var utils=require(_0x4d5b('0x2'));var queues={};function writeDB(_0x30c096){utils['info'](util[_0x4d5b('0x3')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x30c096[_0x4d5b('0x4')],_0x30c096['channel'],_0x30c096['queue'],_0x30c096[_0x4d5b('0x5')],_0x30c096[_0x4d5b('0x6')],_0x30c096[_0x4d5b('0x7')],_0x30c096[_0x4d5b('0x8')]));if(_0x30c096[_0x4d5b('0x9')]){utils[_0x4d5b('0xa')](_0x30c096['queue'])['then'](function(_0x3f09f9){if(_0x3f09f9){_0x30c096[_0x4d5b('0xb')]=_0x3f09f9[_0x4d5b('0xb')];}utils[_0x4d5b('0xc')](_0x4d5b('0xd'),_0x30c096);});}else{utils['request']('CreateVoiceQueueReport',_0x30c096);}if(_0x30c096['transfereduniqueid']){delete queues[_0x30c096[_0x4d5b('0xe')]];}else{delete queues[_0x30c096[_0x4d5b('0x4')]];}}exports['queuecallerjoin']=function(_0x2d588d){try{utils[_0x4d5b('0xf')](util[_0x4d5b('0x3')](_0x4d5b('0x10'),_0x2d588d[_0x4d5b('0x4')]),_0x2d588d);utils[_0x4d5b('0x11')](util[_0x4d5b('0x3')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x2d588d[_0x4d5b('0x4')],_0x2d588d[_0x4d5b('0x9')],_0x2d588d['position']));queues[_0x2d588d['uniqueid']]=_[_0x4d5b('0x12')](_0x2d588d,{'originalposition':_0x2d588d[_0x4d5b('0x13')],'queuecallerjoinAt':utils[_0x4d5b('0x14')](),'mohtime':0x0});}catch(_0x52de9f){utils[_0x4d5b('0x15')](util[_0x4d5b('0x3')]('[%s][queues][queuecallerjoin]',_0x2d588d[_0x4d5b('0x4')]),_0x52de9f);}};exports[_0x4d5b('0x16')]=function(_0x1b6740){try{if(!_[_0x4d5b('0x17')](queues[_0x1b6740[_0x4d5b('0x4')]])){utils[_0x4d5b('0xf')](util['format'](_0x4d5b('0x18'),_0x1b6740['uniqueid']),_0x1b6740);if(queues[_0x1b6740['uniqueid']][_0x4d5b('0x19')]){if(!queues[_0x1b6740[_0x4d5b('0x4')]][_0x4d5b('0x1a')]&&!queues[_0x1b6740['uniqueid']][_0x4d5b('0x1b')]){queues[_0x1b6740[_0x4d5b('0x4')]][_0x4d5b('0x1c')]=!![];queues[_0x1b6740[_0x4d5b('0x4')]][_0x4d5b('0x1d')]=utils[_0x4d5b('0x14')]();queues[_0x1b6740[_0x4d5b('0x4')]][_0x4d5b('0x8')]='COMPLETEDBYAGENT';}utils[_0x4d5b('0x11')](util[_0x4d5b('0x3')](_0x4d5b('0x1e'),_0x1b6740['uniqueid'],queues[_0x1b6740[_0x4d5b('0x4')]][_0x4d5b('0x1f')],queues[_0x1b6740[_0x4d5b('0x4')]][_0x4d5b('0x8')]));writeDB(queues[_0x1b6740[_0x4d5b('0x4')]]);}else if(queues[_0x1b6740[_0x4d5b('0x4')]][_0x4d5b('0xe')]){utils['info'](util['format'](_0x4d5b('0x20'),_0x1b6740[_0x4d5b('0x4')],queues[_0x1b6740['uniqueid']][_0x4d5b('0x1f')],queues[_0x1b6740[_0x4d5b('0x4')]][_0x4d5b('0xe')]));queues[queues[_0x1b6740[_0x4d5b('0x4')]][_0x4d5b('0xe')]]=queues[_0x1b6740[_0x4d5b('0x4')]];queues[queues[_0x1b6740[_0x4d5b('0x4')]][_0x4d5b('0xe')]][_0x4d5b('0x21')]=0x2;delete queues[_0x1b6740[_0x4d5b('0x4')]];}}}catch(_0x2e7168){utils['error'](util[_0x4d5b('0x3')]('[%s][queues][hangup]',_0x1b6740['uniqueid']),_0x2e7168);}};exports[_0x4d5b('0x22')]=function(_0x22d633){try{utils[_0x4d5b('0xf')](util['format']('[%s][queues][varset]',_0x22d633[_0x4d5b('0x4')]),_0x22d633);if(!_[_0x4d5b('0x17')](_0x22d633[_0x4d5b('0x23')][_0x4d5b('0x24')])&&_0x22d633[_0x4d5b('0x25')][_0x4d5b('0x26')]()!==_0x4d5b('0x27')){if(!_['isNil'](queues[_0x22d633[_0x4d5b('0x4')]])){queues[_0x22d633[_0x4d5b('0x4')]][_0x4d5b('0x1a')]=![];queues[_0x22d633[_0x4d5b('0x4')]]['queuecallerabandonAt']=null;queues[_0x22d633[_0x4d5b('0x4')]][_0x4d5b('0x1b')]=!![];queues[_0x22d633['uniqueid']]['queuecallerexitAt']=utils[_0x4d5b('0x14')]();queues[_0x22d633[_0x4d5b('0x4')]][_0x4d5b('0x8')]=_0x22d633['value'][_0x4d5b('0x26')]();utils['info'](util[_0x4d5b('0x3')](_0x4d5b('0x28'),_0x22d633[_0x4d5b('0x4')],queues[_0x22d633['uniqueid']][_0x4d5b('0x1f')],_0x22d633[_0x4d5b('0x25')],queues[_0x22d633[_0x4d5b('0x4')]]['queuecallerexitreason']));writeDB(queues[_0x22d633['uniqueid']]);}}else if(!_[_0x4d5b('0x17')](_0x22d633[_0x4d5b('0x23')][_0x4d5b('0x29')])){if(!_[_0x4d5b('0x17')](queues[_0x22d633[_0x4d5b('0x4')]])&&!queues[_0x22d633[_0x4d5b('0x4')]]['queuecallerabandon']){queues[_0x22d633['uniqueid']][_0x4d5b('0x1a')]=![];queues[_0x22d633[_0x4d5b('0x4')]][_0x4d5b('0x2a')]=null;queues[_0x22d633[_0x4d5b('0x4')]][_0x4d5b('0x1b')]=!![];queues[_0x22d633[_0x4d5b('0x4')]][_0x4d5b('0x2b')]=utils[_0x4d5b('0x14')]();queues[_0x22d633[_0x4d5b('0x4')]][_0x4d5b('0x8')]=_0x4d5b('0x2c');utils['info'](util[_0x4d5b('0x3')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x22d633['uniqueid'],queues[_0x22d633[_0x4d5b('0x4')]][_0x4d5b('0x1f')],_0x22d633[_0x4d5b('0x25')],queues[_0x22d633[_0x4d5b('0x4')]]['queuecallerexitreason']));}}}catch(_0x1d6401){utils[_0x4d5b('0x15')](util[_0x4d5b('0x3')]('[%s][queues][varset]',_0x22d633[_0x4d5b('0x4')]),_0x1d6401);}};exports[_0x4d5b('0x1a')]=function(_0x31d473){try{if(!_[_0x4d5b('0x17')](queues[_0x31d473['uniqueid']])){utils['debug'](util[_0x4d5b('0x3')](_0x4d5b('0x2d'),_0x31d473['uniqueid']),_0x31d473);queues[_0x31d473[_0x4d5b('0x4')]][_0x4d5b('0x1b')]=![];queues[_0x31d473['uniqueid']][_0x4d5b('0x2b')]=null;queues[_0x31d473['uniqueid']][_0x4d5b('0x1a')]=!![];queues[_0x31d473[_0x4d5b('0x4')]][_0x4d5b('0x2a')]=utils[_0x4d5b('0x14')]();queues[_0x31d473[_0x4d5b('0x4')]]['queuecallerexitreason']=_0x4d5b('0x2e');utils[_0x4d5b('0x11')](util[_0x4d5b('0x3')](_0x4d5b('0x2f'),_0x31d473[_0x4d5b('0x4')],queues[_0x31d473[_0x4d5b('0x4')]][_0x4d5b('0x1f')],queues[_0x31d473['uniqueid']][_0x4d5b('0x8')]));}}catch(_0x175217){utils['error'](util['format'](_0x4d5b('0x2d'),_0x31d473[_0x4d5b('0x4')]),_0x175217);}};exports['queuecallerleave']=function(_0x45fc73){try{if(!_['isNil'](queues[_0x45fc73['uniqueid']])){utils[_0x4d5b('0xf')](util[_0x4d5b('0x3')](_0x4d5b('0x30'),_0x45fc73[_0x4d5b('0x4')]),_0x45fc73);utils['info'](util['format'](_0x4d5b('0x31'),_0x45fc73['uniqueid'],queues[_0x45fc73[_0x4d5b('0x4')]][_0x4d5b('0x1f')],_0x45fc73[_0x4d5b('0x32')],_0x45fc73[_0x4d5b('0x33')]));queues[_0x45fc73[_0x4d5b('0x4')]][_0x4d5b('0x34')]=!![];queues[_0x45fc73[_0x4d5b('0x4')]][_0x4d5b('0x19')]=utils[_0x4d5b('0x14')]();queues[_0x45fc73[_0x4d5b('0x4')]][_0x4d5b('0x35')]=utils[_0x4d5b('0x36')](queues[_0x45fc73[_0x4d5b('0x4')]][_0x4d5b('0x19')],queues[_0x45fc73[_0x4d5b('0x4')]][_0x4d5b('0x37')]);queues[_0x45fc73['uniqueid']][_0x4d5b('0x13')]=_0x45fc73['position'];queues[_0x45fc73[_0x4d5b('0x4')]][_0x4d5b('0x38')]=_0x45fc73[_0x4d5b('0x38')];queues[_0x45fc73[_0x4d5b('0x4')]]['connectedlinenum']=_0x45fc73[_0x4d5b('0x32')];queues[_0x45fc73['uniqueid']][_0x4d5b('0x33')]=_0x45fc73['connectedlinename'];}}catch(_0x3c8864){utils['error'](util[_0x4d5b('0x3')](_0x4d5b('0x30'),_0x45fc73['uniqueid']),_0x3c8864);}};exports[_0x4d5b('0x39')]=function(_0x361c45){try{if(!_[_0x4d5b('0x17')](queues[_0x361c45[_0x4d5b('0x4')]])){utils[_0x4d5b('0xf')](util[_0x4d5b('0x3')]('[%s][queues][agentconnect]',_0x361c45[_0x4d5b('0x4')]),_0x361c45);utils[_0x4d5b('0x11')](util[_0x4d5b('0x3')](_0x4d5b('0x3a'),_0x361c45[_0x4d5b('0x4')],queues[_0x361c45['uniqueid']][_0x4d5b('0x1f')],_0x361c45[_0x4d5b('0x3b')],_0x361c45[_0x4d5b('0x3c')]));queues[_0x361c45[_0x4d5b('0x4')]][_0x4d5b('0x1a')]=![];queues[_0x361c45[_0x4d5b('0x4')]][_0x4d5b('0x1a')]=![];queues[_0x361c45[_0x4d5b('0x4')]]['queuecallerabandonAt']=null;queues[_0x361c45['uniqueid']][_0x4d5b('0x1b')]=![];queues[_0x361c45[_0x4d5b('0x4')]][_0x4d5b('0x8')]=null;queues[_0x361c45[_0x4d5b('0x4')]][_0x4d5b('0x2b')]=null;queues[_0x361c45['uniqueid']][_0x4d5b('0x3d')]=!![];queues[_0x361c45['uniqueid']][_0x4d5b('0x7')]=_0x361c45['destaccountcode'];queues[_0x361c45[_0x4d5b('0x4')]][_0x4d5b('0x5')]=_0x361c45[_0x4d5b('0x3b')];}}catch(_0x5c1dbd){utils['error'](util['format'](_0x4d5b('0x3e'),_0x361c45[_0x4d5b('0x4')]),_0x5c1dbd);}};exports['agentcomplete']=function(_0xf0d842){try{if(!_[_0x4d5b('0x17')](queues[_0xf0d842[_0x4d5b('0x4')]])){if(queues[_0xf0d842[_0x4d5b('0x4')]][_0x4d5b('0x19')]){utils[_0x4d5b('0xf')](util[_0x4d5b('0x3')]('[%s][queues][agentcomplete]',_0xf0d842[_0x4d5b('0x4')]),_0xf0d842);queues[_0xf0d842[_0x4d5b('0x4')]][_0x4d5b('0x1a')]=![];queues[_0xf0d842[_0x4d5b('0x4')]][_0x4d5b('0x1a')]=![];queues[_0xf0d842[_0x4d5b('0x4')]][_0x4d5b('0x2a')]=null;queues[_0xf0d842['uniqueid']][_0x4d5b('0x1b')]=![];queues[_0xf0d842['uniqueid']][_0x4d5b('0x2b')]=null;queues[_0xf0d842[_0x4d5b('0x4')]][_0x4d5b('0x3d')]=!![];queues[_0xf0d842[_0x4d5b('0x4')]][_0x4d5b('0x5')]=_0xf0d842[_0x4d5b('0x3b')];queues[_0xf0d842[_0x4d5b('0x4')]][_0x4d5b('0x1c')]=!![];queues[_0xf0d842[_0x4d5b('0x4')]][_0x4d5b('0x1d')]=utils[_0x4d5b('0x14')]();if(_0xf0d842['reason']==_0x4d5b('0x3f')){if(!queues[_0xf0d842[_0x4d5b('0x4')]]['transfer']){queues[_0xf0d842[_0x4d5b('0x4')]]['queuecallerexitreason']=_0x4d5b('0x40');}}else{queues[_0xf0d842['uniqueid']][_0x4d5b('0x8')]=_0x4d5b('0x41')+_0xf0d842[_0x4d5b('0x42')][_0x4d5b('0x26')]();}utils[_0x4d5b('0x11')](util[_0x4d5b('0x3')](_0x4d5b('0x43'),_0xf0d842[_0x4d5b('0x4')],queues[_0xf0d842['uniqueid']][_0x4d5b('0x1f')],_0xf0d842[_0x4d5b('0x3b')],queues[_0xf0d842[_0x4d5b('0x4')]]['queuecallerexitreason']));writeDB(queues[_0xf0d842[_0x4d5b('0x4')]]);}}}catch(_0x572f6f){utils['error'](util[_0x4d5b('0x3')](_0x4d5b('0x44'),_0xf0d842[_0x4d5b('0x4')]),_0x572f6f);}};exports[_0x4d5b('0x45')]=function(_0x1a3913){try{if(!_[_0x4d5b('0x17')](queues[_0x1a3913[_0x4d5b('0x46')]])){utils['debug'](util[_0x4d5b('0x3')](_0x4d5b('0x47'),_0x1a3913[_0x4d5b('0x4')]),_0x1a3913);queues[_0x1a3913['transfereeuniqueid']][_0x4d5b('0x3f')]=!![];queues[_0x1a3913[_0x4d5b('0x46')]][_0x4d5b('0x48')]=_0x4d5b('0x49');queues[_0x1a3913[_0x4d5b('0x46')]][_0x4d5b('0x4a')]=_0x1a3913[_0x4d5b('0x4b')];queues[_0x1a3913[_0x4d5b('0x46')]][_0x4d5b('0x4c')]=_0x1a3913[_0x4d5b('0x46')];queues[_0x1a3913[_0x4d5b('0x46')]][_0x4d5b('0x8')]=_0x4d5b('0x4d');utils[_0x4d5b('0x11')](util[_0x4d5b('0x3')](_0x4d5b('0x4e'),_0x1a3913[_0x4d5b('0x4')],queues[_0x1a3913[_0x4d5b('0x46')]]['name'],_0x1a3913[_0x4d5b('0x46')],_0x1a3913[_0x4d5b('0x4b')]));}}catch(_0xd57abf){utils[_0x4d5b('0x15')](util[_0x4d5b('0x3')](_0x4d5b('0x47'),_0x1a3913[_0x4d5b('0x4')]),_0xd57abf);}};exports[_0x4d5b('0x4f')]=function(_0x429b49){try{utils[_0x4d5b('0xf')](util['format']('[%s][queues][attendedtransfer]',_0x429b49[_0x4d5b('0x50')]),_0x429b49);if(_0x429b49[_0x4d5b('0x50')]==_0x429b49[_0x4d5b('0x51')]){if(!_[_0x4d5b('0x17')](queues[_0x429b49[_0x4d5b('0x52')]])){utils[_0x4d5b('0x11')](util['format'](_0x4d5b('0x53'),_0x429b49['origtransfereruniqueid'],queues[_0x429b49[_0x4d5b('0x52')]][_0x4d5b('0x1f')],_0x429b49[_0x4d5b('0x54')]));queues[_0x429b49[_0x4d5b('0x52')]][_0x4d5b('0x3f')]=!![];queues[_0x429b49[_0x4d5b('0x52')]][_0x4d5b('0x48')]='ATTENDED';queues[_0x429b49[_0x4d5b('0x52')]]['transferexten']=_0x429b49['origtransfererexten'];queues[_0x429b49[_0x4d5b('0x52')]][_0x4d5b('0x4c')]=_0x429b49[_0x4d5b('0x50')];queues[_0x429b49[_0x4d5b('0x52')]][_0x4d5b('0x8')]=_0x4d5b('0x55');}if(!_['isNil'](queues[_0x429b49[_0x4d5b('0x51')]])){if(_0x429b49[_0x4d5b('0x56')]&&queues[_0x429b49[_0x4d5b('0x56')]]){queues[_0x429b49[_0x4d5b('0x56')]][_0x4d5b('0x21')]=0x1;queues[_0x429b49[_0x4d5b('0x46')]]=_[_0x4d5b('0x57')](queues[_0x429b49[_0x4d5b('0x56')]]);queues[_0x429b49['transfereeuniqueid']][_0x4d5b('0xe')]=_0x429b49[_0x4d5b('0x58')];queues[_0x429b49['transfereeuniqueid']][_0x4d5b('0x21')]=0x2;queues[_0x429b49[_0x4d5b('0x46')]]['calleridnum']=queues[_0x429b49[_0x4d5b('0x52')]]['calleridnum'];queues[_0x429b49[_0x4d5b('0x46')]][_0x4d5b('0x59')]=queues[_0x429b49[_0x4d5b('0x52')]]['calleridname'];queues[_0x429b49[_0x4d5b('0x46')]][_0x4d5b('0x37')]=utils[_0x4d5b('0x14')]();queues[_0x429b49[_0x4d5b('0x46')]][_0x4d5b('0x19')]=utils[_0x4d5b('0x14')]();queues[_0x429b49[_0x4d5b('0x46')]][_0x4d5b('0x35')]=0x0;queues[_0x429b49[_0x4d5b('0x46')]]['mohtime']=0x0;utils['info'](util['format'](_0x4d5b('0x5a'),_0x429b49[_0x4d5b('0x50')],queues[_0x429b49[_0x4d5b('0x46')]][_0x4d5b('0x1f')],queues[_0x429b49['transfereeuniqueid']][_0x4d5b('0x6')],queues[_0x429b49[_0x4d5b('0x46')]][_0x4d5b('0x59')]));}else{utils['info'](util[_0x4d5b('0x3')](_0x4d5b('0x5b'),_0x429b49['origtransfereruniqueid'],queues[_0x429b49['origtransfererlinkedid']][_0x4d5b('0x1f')],_0x429b49[_0x4d5b('0x52')]));queues[_0x429b49[_0x4d5b('0x51')]][_0x4d5b('0xe')]=_0x429b49[_0x4d5b('0x52')];}}}else if(_0x429b49[_0x4d5b('0x5c')]==_0x429b49['secondtransfererlinkedid']){if(!_[_0x4d5b('0x17')](queues[_0x429b49[_0x4d5b('0x51')]])){utils['info'](util[_0x4d5b('0x3')](_0x4d5b('0x5d'),_0x429b49[_0x4d5b('0x50')],queues[_0x429b49['origtransfererlinkedid']][_0x4d5b('0x1f')],_0x429b49[_0x4d5b('0x5c')],_0x429b49[_0x4d5b('0x5e')]));queues[_0x429b49[_0x4d5b('0x51')]][_0x4d5b('0x3f')]=!![];queues[_0x429b49[_0x4d5b('0x51')]][_0x4d5b('0x48')]=_0x4d5b('0x5f');queues[_0x429b49[_0x4d5b('0x51')]][_0x4d5b('0x4a')]=_0x429b49[_0x4d5b('0x5e')];queues[_0x429b49[_0x4d5b('0x51')]][_0x4d5b('0x4c')]=_0x429b49[_0x4d5b('0x5c')];queues[_0x429b49[_0x4d5b('0x51')]][_0x4d5b('0x8')]=_0x4d5b('0x55');}if(!_[_0x4d5b('0x17')](queues[_0x429b49[_0x4d5b('0x52')]])){if(_0x429b49[_0x4d5b('0x60')]&&queues[_0x429b49['transfertargetlinkedid']]){queues[_0x429b49[_0x4d5b('0x60')]][_0x4d5b('0x21')]=0x1;queues[_0x429b49[_0x4d5b('0x58')]]=_['clone'](queues[_0x429b49[_0x4d5b('0x60')]]);queues[_0x429b49[_0x4d5b('0x58')]][_0x4d5b('0xe')]=_0x429b49['transfertargetuniqueid'];queues[_0x429b49[_0x4d5b('0x58')]][_0x4d5b('0x21')]=0x2;queues[_0x429b49['transfertargetuniqueid']][_0x4d5b('0x6')]=queues[_0x429b49['origtransfererlinkedid']]['calleridnum'];queues[_0x429b49['transfertargetuniqueid']][_0x4d5b('0x59')]=queues[_0x429b49[_0x4d5b('0x51')]]['calleridname'];queues[_0x429b49['transfertargetuniqueid']][_0x4d5b('0x37')]=utils[_0x4d5b('0x14')]();queues[_0x429b49[_0x4d5b('0x58')]]['queuecallerleaveAt']=utils[_0x4d5b('0x14')]();queues[_0x429b49[_0x4d5b('0x58')]][_0x4d5b('0x35')]=0x0;queues[_0x429b49['transfertargetuniqueid']]['mohtime']=0x0;utils[_0x4d5b('0x11')](util[_0x4d5b('0x3')](_0x4d5b('0x61'),_0x429b49[_0x4d5b('0x50')],queues[_0x429b49['transfertargetuniqueid']][_0x4d5b('0x1f')],queues[_0x429b49[_0x4d5b('0x58')]][_0x4d5b('0xe')],queues[_0x429b49[_0x4d5b('0x58')]]['calleridnum'],queues[_0x429b49[_0x4d5b('0x58')]][_0x4d5b('0x59')]));}else{utils['info'](util[_0x4d5b('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x429b49['origtransfereruniqueid'],queues[_0x429b49[_0x4d5b('0x52')]]['name'],_0x429b49[_0x4d5b('0x51')]));queues[_0x429b49['secondtransfererlinkedid']][_0x4d5b('0xe')]=_0x429b49[_0x4d5b('0x51')];}}}}catch(_0x4fa547){utils[_0x4d5b('0x15')](util[_0x4d5b('0x3')]('[%s][queues][attendedtransfer]',_0x429b49[_0x4d5b('0x50')]),_0x4fa547);}};exports[_0x4d5b('0x62')]=function(_0x1de833){try{if(!_['isNil'](queues[_0x1de833['uniqueid']])){utils['debug'](util[_0x4d5b('0x3')]('[%s][queues][musiconholdstart]',_0x1de833['uniqueid']),_0x1de833);queues[_0x1de833[_0x4d5b('0x4')]]['musiconholdstartAt']=utils[_0x4d5b('0x14')]();utils[_0x4d5b('0x11')](util[_0x4d5b('0x3')](_0x4d5b('0x63'),_0x1de833[_0x4d5b('0x4')],queues[_0x1de833[_0x4d5b('0x4')]][_0x4d5b('0x1f')],queues[_0x1de833[_0x4d5b('0x4')]][_0x4d5b('0x64')]));}}catch(_0x4d78cb){utils[_0x4d5b('0x15')](util[_0x4d5b('0x3')](_0x4d5b('0x65'),_0x1de833['uniqueid']),_0x4d78cb);}};exports[_0x4d5b('0x66')]=function(_0x209255){try{if(!_[_0x4d5b('0x17')](queues[_0x209255[_0x4d5b('0x4')]])){if(!_[_0x4d5b('0x17')](queues[_0x209255[_0x4d5b('0x4')]][_0x4d5b('0x64')])){utils[_0x4d5b('0xf')](util[_0x4d5b('0x3')](_0x4d5b('0x67'),_0x209255[_0x4d5b('0x4')]),_0x209255);queues[_0x209255[_0x4d5b('0x4')]]['mohtime']+=utils[_0x4d5b('0x36')](utils[_0x4d5b('0x14')](),queues[_0x209255[_0x4d5b('0x4')]][_0x4d5b('0x64')]);utils[_0x4d5b('0x11')](util[_0x4d5b('0x3')](_0x4d5b('0x68'),_0x209255[_0x4d5b('0x4')],queues[_0x209255[_0x4d5b('0x4')]][_0x4d5b('0x1f')],queues[_0x209255[_0x4d5b('0x4')]][_0x4d5b('0x69')]));delete queues[_0x209255['uniqueid']][_0x4d5b('0x64')];}}}catch(_0x221749){utils[_0x4d5b('0x15')](util['format'](_0x4d5b('0x67'),_0x209255[_0x4d5b('0x4')]),_0x221749);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 5341e75..86fd45b 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 _0x4aeb=['./utils','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','then','membername','name','request','CreateVoiceRecording','newchannel','[%s][recordings][newchannel]','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','error','newstate','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','linkedid','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','variable','mixmonitor_filename','endsWith','value','.wav49','replace','.WAV','find','monitors','push','[%s][recordings][varset]','hangup','debug','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','connectedlinenum','connectedlinename','outbound','forEach','clone','[%s][recordings][hangup]','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','[%s][recordings][queuecallerjoin]','queue','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4aeb,0x1b0));var _0xb4ae=function(_0x306ddc,_0x9c4d60){_0x306ddc=_0x306ddc-0x0;var _0x11767f=_0x4aeb[_0x306ddc];return _0x11767f;};'use strict';var _=require(_0xb4ae('0x0'));var util=require(_0xb4ae('0x1'));var utils=require(_0xb4ae('0x2'));var recordings={};function writeDB(_0x551976){utils[_0xb4ae('0x3')](util[_0xb4ae('0x4')](_0xb4ae('0x5'),_0x551976[_0xb4ae('0x6')]));if(_0x551976[_0xb4ae('0x7')]){utils[_0xb4ae('0x8')](_0x551976[_0xb4ae('0x7')])[_0xb4ae('0x9')](function(_0x481824){if(_0x481824){_0x551976[_0xb4ae('0xa')]=_0x481824[_0xb4ae('0xb')];_0x551976['UserId']=_0x481824['id'];}utils[_0xb4ae('0xc')](_0xb4ae('0xd'),_0x551976);});}else{utils[_0xb4ae('0xc')](_0xb4ae('0xd'),_0x551976);}}exports[_0xb4ae('0xe')]=function(_0x4336d1){try{utils['debug'](util[_0xb4ae('0x4')](_0xb4ae('0xf'),_0x4336d1[_0xb4ae('0x6')]),_0x4336d1);if(_0x4336d1['uniqueid']==_0x4336d1['linkedid']){utils[_0xb4ae('0x3')](util[_0xb4ae('0x4')](_0xb4ae('0x10'),_0x4336d1[_0xb4ae('0x6')],_0x4336d1[_0xb4ae('0x11')],_0x4336d1[_0xb4ae('0x12')]));recordings[_0x4336d1[_0xb4ae('0x6')]]={'uniqueid':_0x4336d1['uniqueid'],'accountcode':_0x4336d1[_0xb4ae('0x7')],'exten':_0x4336d1[_0xb4ae('0x12')],'context':_0x4336d1[_0xb4ae('0x11')],'channel':_0x4336d1['channel'],'monitors':[]};}}catch(_0x16aced){utils[_0xb4ae('0x13')](util[_0xb4ae('0x4')]('[%s][recordings][newchannel]',_0x4336d1[_0xb4ae('0x6')]),_0x16aced);}};exports[_0xb4ae('0x14')]=function(_0x2cbe29){try{utils['debug'](util[_0xb4ae('0x4')]('[%s][recordings][newstate]',_0x2cbe29[_0xb4ae('0x6')]),_0x2cbe29);if(!_[_0xb4ae('0x15')](recordings[_0x2cbe29['uniqueid']])&&_0x2cbe29[_0xb4ae('0x16')]==0x6){utils[_0xb4ae('0x3')](util[_0xb4ae('0x4')](_0xb4ae('0x17'),_0x2cbe29[_0xb4ae('0x6')],_0x2cbe29[_0xb4ae('0x11')],_0x2cbe29['channel']));}else if(!_['isNil'](recordings[_0x2cbe29[_0xb4ae('0x18')]])&&_0x2cbe29[_0xb4ae('0x16')]==0x6&&_0x2cbe29['context']!=_0xb4ae('0x19')){utils[_0xb4ae('0x3')](util[_0xb4ae('0x4')](_0xb4ae('0x1a'),_0x2cbe29['uniqueid'],_0x2cbe29[_0xb4ae('0x18')],_0x2cbe29[_0xb4ae('0x11')],_0x2cbe29['channel']));recordings[_0x2cbe29[_0xb4ae('0x18')]]['accountcode']=_0x2cbe29[_0xb4ae('0x7')];}}catch(_0x50e4b0){utils['error'](util[_0xb4ae('0x4')]('[%s][recordings][newstate]',_0x2cbe29[_0xb4ae('0x6')]),_0x50e4b0);}};exports['varset']=function(_0x45c7f7){try{if(!_[_0xb4ae('0x15')](_0x45c7f7[_0xb4ae('0x1b')])&&!_['isNil'](_0x45c7f7[_0xb4ae('0x1b')][_0xb4ae('0x1c')])){utils['debug'](util[_0xb4ae('0x4')]('[%s][recordings][varset]',_0x45c7f7[_0xb4ae('0x6')]),_0x45c7f7);utils[_0xb4ae('0x3')](util[_0xb4ae('0x4')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x45c7f7[_0xb4ae('0x6')],_0x45c7f7['variable'],_0x45c7f7['value']));if(_[_0xb4ae('0x1d')](_0x45c7f7[_0xb4ae('0x1e')],_0xb4ae('0x1f'))){_0x45c7f7[_0xb4ae('0x1e')]=_0x45c7f7[_0xb4ae('0x1e')][_0xb4ae('0x20')]('.wav49',_0xb4ae('0x21'));}if(recordings[_0x45c7f7[_0xb4ae('0x18')]]){var _0x12ef35=_[_0xb4ae('0x22')](recordings[_0x45c7f7[_0xb4ae('0x18')]][_0xb4ae('0x23')],{'value':_0x45c7f7[_0xb4ae('0x1e')]});if(_[_0xb4ae('0x15')](_0x12ef35)){recordings[_0x45c7f7[_0xb4ae('0x18')]]['monitors'][_0xb4ae('0x24')]({'value':_0x45c7f7[_0xb4ae('0x1e')]});}}}}catch(_0x26501f){utils[_0xb4ae('0x13')](util[_0xb4ae('0x4')](_0xb4ae('0x25'),_0x45c7f7['uniqueid']),_0x26501f);}};exports[_0xb4ae('0x26')]=function(_0x2342a0){try{if(!_[_0xb4ae('0x15')](recordings[_0x2342a0[_0xb4ae('0x6')]])){utils[_0xb4ae('0x27')](util['format']('[%s][recordings][hangup]',_0x2342a0['uniqueid']),_0x2342a0);utils[_0xb4ae('0x3')](util[_0xb4ae('0x4')](_0xb4ae('0x28'),_0x2342a0['uniqueid'],_0x2342a0[_0xb4ae('0x29')],_0x2342a0[_0xb4ae('0x2a')],_0x2342a0['cause-txt']));recordings[_0x2342a0[_0xb4ae('0x6')]]['calleridnum']=_0x2342a0[_0xb4ae('0x29')];recordings[_0x2342a0[_0xb4ae('0x6')]][_0xb4ae('0x2a')]=_0x2342a0[_0xb4ae('0x2a')];recordings[_0x2342a0[_0xb4ae('0x6')]][_0xb4ae('0x2b')]=_0x2342a0[_0xb4ae('0x2b')];recordings[_0x2342a0[_0xb4ae('0x6')]][_0xb4ae('0x2c')]=_0x2342a0[_0xb4ae('0x2c')];if(recordings[_0x2342a0[_0xb4ae('0x6')]]['type']==_0xb4ae('0x2d')&&recordings[_0x2342a0[_0xb4ae('0x6')]][_0xb4ae('0x7')]){recordings[_0x2342a0[_0xb4ae('0x6')]][_0xb4ae('0x2b')]=recordings[_0x2342a0[_0xb4ae('0x6')]]['accountcode'];recordings[_0x2342a0[_0xb4ae('0x6')]][_0xb4ae('0x2c')]='';}recordings[_0x2342a0['uniqueid']][_0xb4ae('0x23')][_0xb4ae('0x2e')](function(_0x5cfbd2){var _0x148b59=_[_0xb4ae('0x2f')](recordings[_0x2342a0[_0xb4ae('0x6')]]);_0x148b59[_0xb4ae('0x1e')]=_0x5cfbd2[_0xb4ae('0x1e')];writeDB(_0x148b59);});delete recordings[_0x2342a0[_0xb4ae('0x6')]];}}catch(_0x5da203){utils[_0xb4ae('0x13')](util['format'](_0xb4ae('0x30'),_0x2342a0[_0xb4ae('0x6')]),_0x5da203);}};exports['newexten']=function(_0x44743f){try{if(!_[_0xb4ae('0x15')](recordings[_0x44743f[_0xb4ae('0x6')]])){utils['debug'](util[_0xb4ae('0x4')](_0xb4ae('0x31'),_0x44743f[_0xb4ae('0x6')]),_0x44743f);utils[_0xb4ae('0x3')](util[_0xb4ae('0x4')](_0xb4ae('0x32'),_0x44743f[_0xb4ae('0x6')],_0x44743f['application'],_0x44743f[_0xb4ae('0x33')]));if(_0x44743f[_0xb4ae('0x34')][_0xb4ae('0x35')]()==_0xb4ae('0x36')&&_[_0xb4ae('0x37')](_0x44743f[_0xb4ae('0x33')][_0xb4ae('0x35')](),_0xb4ae('0x38'))){var _0x43d86a=_0x44743f[_0xb4ae('0x33')][_0xb4ae('0x39')]('=');var _0x552901=_0x43d86a[0x0][_0xb4ae('0x3a')](_0x43d86a[0x0][_0xb4ae('0x3b')]('(')+0x1,_0x43d86a[0x0][_0xb4ae('0x3b')](')'));var _0x4a11f4=_0x43d86a[0x1];recordings[_0x44743f['uniqueid']][_0x552901]=_0x4a11f4;}}}catch(_0x56c7cc){utils[_0xb4ae('0x13')](util['format']('[%s][recordings][newexten]',_0x44743f[_0xb4ae('0x6')]),_0x56c7cc);}};exports['queuecallerjoin']=function(_0x492715){try{if(!_['isNil'](recordings[_0x492715[_0xb4ae('0x6')]])){utils['debug'](util[_0xb4ae('0x4')](_0xb4ae('0x3c'),_0x492715[_0xb4ae('0x6')]),_0x492715);utils['info'](util['format']('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x492715[_0xb4ae('0x6')],_0x492715[_0xb4ae('0x3d')]));recordings[_0x492715[_0xb4ae('0x6')]][_0xb4ae('0x3d')]=_0x492715[_0xb4ae('0x3d')];}}catch(_0x1a0f7e){utils[_0xb4ae('0x13')](util[_0xb4ae('0x4')](_0xb4ae('0x3c'),_0x492715['uniqueid']),_0x1a0f7e);}}; \ No newline at end of file +var _0x767b=['lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','./utils','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','then','membername','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%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','.WAV','find','monitors','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','connectedlinenum','outbound','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','toLowerCase','cdr','split','substring'];(function(_0x404431,_0x2833cc){var _0x583f81=function(_0x5db979){while(--_0x5db979){_0x404431['push'](_0x404431['shift']());}};_0x583f81(++_0x2833cc);}(_0x767b,0x1e4));var _0xb767=function(_0x3e948f,_0x19484d){_0x3e948f=_0x3e948f-0x0;var _0x4cc3de=_0x767b[_0x3e948f];return _0x4cc3de;};'use strict';var _=require(_0xb767('0x0'));var util=require(_0xb767('0x1'));var utils=require(_0xb767('0x2'));var recordings={};function writeDB(_0x20e849){utils[_0xb767('0x3')](util[_0xb767('0x4')](_0xb767('0x5'),_0x20e849[_0xb767('0x6')]));if(_0x20e849[_0xb767('0x7')]){utils['getUserByInternal'](_0x20e849['accountcode'])[_0xb767('0x8')](function(_0x5b6219){if(_0x5b6219){_0x20e849[_0xb767('0x9')]=_0x5b6219['name'];_0x20e849['UserId']=_0x5b6219['id'];}utils[_0xb767('0xa')](_0xb767('0xb'),_0x20e849);});}else{utils[_0xb767('0xa')](_0xb767('0xb'),_0x20e849);}}exports[_0xb767('0xc')]=function(_0x167cbe){try{utils[_0xb767('0xd')](util[_0xb767('0x4')](_0xb767('0xe'),_0x167cbe[_0xb767('0x6')]),_0x167cbe);if(_0x167cbe[_0xb767('0x6')]==_0x167cbe[_0xb767('0xf')]){utils[_0xb767('0x3')](util['format'](_0xb767('0x10'),_0x167cbe[_0xb767('0x6')],_0x167cbe[_0xb767('0x11')],_0x167cbe['exten']));recordings[_0x167cbe[_0xb767('0x6')]]={'uniqueid':_0x167cbe['uniqueid'],'accountcode':_0x167cbe[_0xb767('0x7')],'exten':_0x167cbe[_0xb767('0x12')],'context':_0x167cbe[_0xb767('0x11')],'channel':_0x167cbe[_0xb767('0x13')],'monitors':[]};}}catch(_0x40b6e2){utils[_0xb767('0x14')](util[_0xb767('0x4')](_0xb767('0xe'),_0x167cbe[_0xb767('0x6')]),_0x40b6e2);}};exports[_0xb767('0x15')]=function(_0x4f3997){try{utils[_0xb767('0xd')](util[_0xb767('0x4')]('[%s][recordings][newstate]',_0x4f3997[_0xb767('0x6')]),_0x4f3997);if(!_[_0xb767('0x16')](recordings[_0x4f3997[_0xb767('0x6')]])&&_0x4f3997[_0xb767('0x17')]==0x6){utils[_0xb767('0x3')](util[_0xb767('0x4')](_0xb767('0x18'),_0x4f3997[_0xb767('0x6')],_0x4f3997[_0xb767('0x11')],_0x4f3997[_0xb767('0x13')]));}else if(!_[_0xb767('0x16')](recordings[_0x4f3997[_0xb767('0xf')]])&&_0x4f3997[_0xb767('0x17')]==0x6&&_0x4f3997[_0xb767('0x11')]!=_0xb767('0x19')){utils[_0xb767('0x3')](util['format'](_0xb767('0x1a'),_0x4f3997[_0xb767('0x6')],_0x4f3997[_0xb767('0xf')],_0x4f3997[_0xb767('0x11')],_0x4f3997['channel']));recordings[_0x4f3997[_0xb767('0xf')]][_0xb767('0x7')]=_0x4f3997[_0xb767('0x7')];}}catch(_0x35dbba){utils[_0xb767('0x14')](util[_0xb767('0x4')]('[%s][recordings][newstate]',_0x4f3997[_0xb767('0x6')]),_0x35dbba);}};exports[_0xb767('0x1b')]=function(_0x30cc34){try{if(!_[_0xb767('0x16')](_0x30cc34[_0xb767('0x1c')])&&!_['isNil'](_0x30cc34[_0xb767('0x1c')][_0xb767('0x1d')])){utils[_0xb767('0xd')](util[_0xb767('0x4')](_0xb767('0x1e'),_0x30cc34[_0xb767('0x6')]),_0x30cc34);utils[_0xb767('0x3')](util['format'](_0xb767('0x1f'),_0x30cc34[_0xb767('0x6')],_0x30cc34[_0xb767('0x1c')],_0x30cc34[_0xb767('0x20')]));if(_[_0xb767('0x21')](_0x30cc34[_0xb767('0x20')],'.wav49')){_0x30cc34[_0xb767('0x20')]=_0x30cc34['value']['replace'](_0xb767('0x22'),_0xb767('0x23'));}if(recordings[_0x30cc34['linkedid']]){var _0xc14dcf=_[_0xb767('0x24')](recordings[_0x30cc34[_0xb767('0xf')]][_0xb767('0x25')],{'value':_0x30cc34[_0xb767('0x20')]});if(_[_0xb767('0x16')](_0xc14dcf)){recordings[_0x30cc34[_0xb767('0xf')]][_0xb767('0x25')]['push']({'value':_0x30cc34[_0xb767('0x20')]});}}}}catch(_0x4664a7){utils[_0xb767('0x14')](util['format'](_0xb767('0x1e'),_0x30cc34[_0xb767('0x6')]),_0x4664a7);}};exports[_0xb767('0x26')]=function(_0x61f7ba){try{if(!_[_0xb767('0x16')](recordings[_0x61f7ba[_0xb767('0x6')]])){utils[_0xb767('0xd')](util[_0xb767('0x4')](_0xb767('0x27'),_0x61f7ba[_0xb767('0x6')]),_0x61f7ba);utils[_0xb767('0x3')](util['format'](_0xb767('0x28'),_0x61f7ba[_0xb767('0x6')],_0x61f7ba[_0xb767('0x29')],_0x61f7ba[_0xb767('0x2a')],_0x61f7ba['cause-txt']));recordings[_0x61f7ba[_0xb767('0x6')]][_0xb767('0x29')]=_0x61f7ba[_0xb767('0x29')];recordings[_0x61f7ba[_0xb767('0x6')]][_0xb767('0x2a')]=_0x61f7ba['calleridname'];recordings[_0x61f7ba[_0xb767('0x6')]]['connectedlinenum']=_0x61f7ba[_0xb767('0x2b')];recordings[_0x61f7ba['uniqueid']]['connectedlinename']=_0x61f7ba['connectedlinename'];if(recordings[_0x61f7ba['uniqueid']]['type']==_0xb767('0x2c')&&recordings[_0x61f7ba[_0xb767('0x6')]][_0xb767('0x7')]){recordings[_0x61f7ba['uniqueid']][_0xb767('0x2b')]=recordings[_0x61f7ba[_0xb767('0x6')]][_0xb767('0x7')];recordings[_0x61f7ba[_0xb767('0x6')]]['connectedlinename']='';}recordings[_0x61f7ba[_0xb767('0x6')]][_0xb767('0x25')]['forEach'](function(_0x3f7ce9){var _0x380c55=_['clone'](recordings[_0x61f7ba[_0xb767('0x6')]]);_0x380c55['value']=_0x3f7ce9[_0xb767('0x20')];writeDB(_0x380c55);});delete recordings[_0x61f7ba[_0xb767('0x6')]];}}catch(_0x4a912f){utils[_0xb767('0x14')](util[_0xb767('0x4')](_0xb767('0x27'),_0x61f7ba[_0xb767('0x6')]),_0x4a912f);}};exports[_0xb767('0x2d')]=function(_0x39dc0f){try{if(!_['isNil'](recordings[_0x39dc0f[_0xb767('0x6')]])){utils['debug'](util[_0xb767('0x4')](_0xb767('0x2e'),_0x39dc0f[_0xb767('0x6')]),_0x39dc0f);utils[_0xb767('0x3')](util[_0xb767('0x4')](_0xb767('0x2f'),_0x39dc0f[_0xb767('0x6')],_0x39dc0f[_0xb767('0x30')],_0x39dc0f[_0xb767('0x31')]));if(_0x39dc0f[_0xb767('0x30')]['toLowerCase']()==_0xb767('0x32')&&_[_0xb767('0x33')](_0x39dc0f['appdata'][_0xb767('0x34')](),_0xb767('0x35'))){var _0x312057=_0x39dc0f[_0xb767('0x31')][_0xb767('0x36')]('=');var _0x11221b=_0x312057[0x0][_0xb767('0x37')](_0x312057[0x0][_0xb767('0x38')]('(')+0x1,_0x312057[0x0]['lastIndexOf'](')'));var _0x4749c4=_0x312057[0x1];recordings[_0x39dc0f[_0xb767('0x6')]][_0x11221b]=_0x4749c4;}}}catch(_0x1bdedf){utils[_0xb767('0x14')](util[_0xb767('0x4')]('[%s][recordings][newexten]',_0x39dc0f[_0xb767('0x6')]),_0x1bdedf);}};exports[_0xb767('0x39')]=function(_0x1b9587){try{if(!_[_0xb767('0x16')](recordings[_0x1b9587[_0xb767('0x6')]])){utils[_0xb767('0xd')](util[_0xb767('0x4')]('[%s][recordings][queuecallerjoin]',_0x1b9587[_0xb767('0x6')]),_0x1b9587);utils['info'](util[_0xb767('0x4')](_0xb767('0x3a'),_0x1b9587[_0xb767('0x6')],_0x1b9587[_0xb767('0x3b')]));recordings[_0x1b9587['uniqueid']][_0xb767('0x3b')]=_0x1b9587[_0xb767('0x3b')];}}catch(_0x16372b){utils[_0xb767('0x14')](util['format']('[%s][recordings][queuecallerjoin]',_0x1b9587['uniqueid']),_0x16372b);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 929808d..d8ce52d 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 _0xf32a=['transfertargetlinkedid','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','uniqueid','CreateVoiceTransferReport','blindtransfer','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','error','[%s][transfers][blindtransfer]','attendedtransfer','debug','[%s][transfers][attendedtransfer]','origtransfereruniqueid','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transfertargetcalleridname','assign','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','origtransfererexten','isNil','transfereechannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten'];(function(_0x3746fd,_0x596976){var _0x3dd97a=function(_0x4d893a){while(--_0x4d893a){_0x3746fd['push'](_0x3746fd['shift']());}};_0x3dd97a(++_0x596976);}(_0xf32a,0x19b));var _0xaf32=function(_0x9c1b6b,_0x17f5f5){_0x9c1b6b=_0x9c1b6b-0x0;var _0xdf303e=_0xf32a[_0x9c1b6b];return _0xdf303e;};'use strict';var _=require(_0xaf32('0x0'));var util=require(_0xaf32('0x1'));var utils=require(_0xaf32('0x2'));function writeDB(_0x416ed3){utils[_0xaf32('0x3')](util[_0xaf32('0x4')](_0xaf32('0x5'),_0x416ed3[_0xaf32('0x6')]===_0xaf32('0x7')?_0x416ed3['origtransfereruniqueid']:_0x416ed3[_0xaf32('0x8')],_0x416ed3[_0xaf32('0x6')]));utils['request'](_0xaf32('0x9'),_0x416ed3);}exports[_0xaf32('0xa')]=function(_0x3b0085){try{utils['debug'](util['format']('[%s][transfers][blindtransfer]',_0x3b0085[_0xaf32('0x8')]),_0x3b0085);utils[_0xaf32('0x3')](util[_0xaf32('0x4')](_0xaf32('0xb'),_0x3b0085[_0xaf32('0x8')],_0x3b0085[_0xaf32('0xc')],_0x3b0085[_0xaf32('0xd')],_0x3b0085[_0xaf32('0xe')],_0x3b0085[_0xaf32('0xf')]));_0x3b0085['type']=_0xaf32('0x10');writeDB(_0x3b0085);}catch(_0x1d9caf){utils[_0xaf32('0x11')](util[_0xaf32('0x4')](_0xaf32('0x12'),_0x3b0085['uniqueid']),_0x1d9caf);}};exports[_0xaf32('0x13')]=function(_0x50c1a6){try{utils[_0xaf32('0x14')](util[_0xaf32('0x4')](_0xaf32('0x15'),_0x50c1a6[_0xaf32('0x16')]),_0x50c1a6);utils[_0xaf32('0x3')](util[_0xaf32('0x4')](_0xaf32('0x17'),_0x50c1a6[_0xaf32('0x16')],_0x50c1a6['origtransferercalleridnum'],_0x50c1a6['origtransferercalleridname'],_0x50c1a6['transfertargetcalleridnum'],_0x50c1a6[_0xaf32('0x18')]));_0x50c1a6=_[_0xaf32('0x19')](_0x50c1a6,{'transfererchannel':_0x50c1a6['origtransfererchannel'],'transferercalleridnum':_0x50c1a6[_0xaf32('0x1a')],'transferercalleridname':_0x50c1a6[_0xaf32('0x1b')],'transfererconnectedlinenum':_0x50c1a6['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x50c1a6[_0xaf32('0x1c')],'transfereraccountcode':_0x50c1a6[_0xaf32('0x1d')],'transferercontext':_0x50c1a6[_0xaf32('0x1e')],'transfererexten':_0x50c1a6['secondtransfererexten'],'transfererlinkedid':_0x50c1a6[_0xaf32('0x1f')],'context':_0x50c1a6['origtransferercontext'],'extension':_0x50c1a6[_0xaf32('0x20')],'type':'attended'});if(_[_0xaf32('0x21')](_0x50c1a6[_0xaf32('0x22')])){_0x50c1a6=_[_0xaf32('0x19')](_0x50c1a6,{'transfereechannel':_0x50c1a6['transfertargetchannel'],'transfereecalleridnum':_0x50c1a6[_0xaf32('0x23')],'transfereecalleridname':_0x50c1a6[_0xaf32('0x18')],'transfereeconnectedlinenum':_0x50c1a6[_0xaf32('0x24')],'transfereeconnectedlinename':_0x50c1a6[_0xaf32('0x25')],'transfereeaccountcode':_0x50c1a6['transfertargetaccountcode'],'transfereecontext':_0x50c1a6[_0xaf32('0x26')],'transfereeexten':_0x50c1a6[_0xaf32('0x27')],'transfereelinkedid':_0x50c1a6[_0xaf32('0x28')]});}writeDB(_0x50c1a6);}catch(_0x24f196){utils[_0xaf32('0x11')](util[_0xaf32('0x4')]('[%s][transfers][attendedtransfer]',_0x50c1a6['origtransfereruniqueid']),_0x24f196);}}; \ No newline at end of file +var _0x0e4a=['[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','error','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','assign','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetaccountcode','transfertargetcontext','./utils','info','format','origtransfereruniqueid','uniqueid','type','request','CreateVoiceTransferReport','blindtransfer','debug'];(function(_0x5a397c,_0x37cec6){var _0x20c297=function(_0x262494){while(--_0x262494){_0x5a397c['push'](_0x5a397c['shift']());}};_0x20c297(++_0x37cec6);}(_0x0e4a,0x68));var _0xa0e4=function(_0xea101b,_0x6c9f3){_0xea101b=_0xea101b-0x0;var _0x5e107e=_0x0e4a[_0xea101b];return _0x5e107e;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xa0e4('0x0'));function writeDB(_0x220d78){utils[_0xa0e4('0x1')](util[_0xa0e4('0x2')]('[%s][transfers][writeDB]\x20type:%s',_0x220d78['type']==='attended'?_0x220d78[_0xa0e4('0x3')]:_0x220d78[_0xa0e4('0x4')],_0x220d78[_0xa0e4('0x5')]));utils[_0xa0e4('0x6')](_0xa0e4('0x7'),_0x220d78);}exports[_0xa0e4('0x8')]=function(_0x215d0a){try{utils[_0xa0e4('0x9')](util[_0xa0e4('0x2')](_0xa0e4('0xa'),_0x215d0a[_0xa0e4('0x4')]),_0x215d0a);utils['info'](util[_0xa0e4('0x2')](_0xa0e4('0xb'),_0x215d0a['uniqueid'],_0x215d0a[_0xa0e4('0xc')],_0x215d0a[_0xa0e4('0xd')],_0x215d0a[_0xa0e4('0xe')],_0x215d0a[_0xa0e4('0xf')]));_0x215d0a[_0xa0e4('0x5')]='blind';writeDB(_0x215d0a);}catch(_0xcaa388){utils[_0xa0e4('0x10')](util[_0xa0e4('0x2')]('[%s][transfers][blindtransfer]',_0x215d0a[_0xa0e4('0x4')]),_0xcaa388);}};exports['attendedtransfer']=function(_0x3c7703){try{utils[_0xa0e4('0x9')](util['format'](_0xa0e4('0x11'),_0x3c7703[_0xa0e4('0x3')]),_0x3c7703);utils[_0xa0e4('0x1')](util['format'](_0xa0e4('0x12'),_0x3c7703[_0xa0e4('0x3')],_0x3c7703['origtransferercalleridnum'],_0x3c7703['origtransferercalleridname'],_0x3c7703['transfertargetcalleridnum'],_0x3c7703['transfertargetcalleridname']));_0x3c7703=_[_0xa0e4('0x13')](_0x3c7703,{'transfererchannel':_0x3c7703[_0xa0e4('0x14')],'transferercalleridnum':_0x3c7703[_0xa0e4('0x15')],'transferercalleridname':_0x3c7703[_0xa0e4('0x16')],'transfererconnectedlinenum':_0x3c7703[_0xa0e4('0x17')],'transfererconnectedlinename':_0x3c7703[_0xa0e4('0x18')],'transfereraccountcode':_0x3c7703[_0xa0e4('0x19')],'transferercontext':_0x3c7703[_0xa0e4('0x1a')],'transfererexten':_0x3c7703[_0xa0e4('0x1b')],'transfererlinkedid':_0x3c7703[_0xa0e4('0x1c')],'context':_0x3c7703[_0xa0e4('0x1d')],'extension':_0x3c7703[_0xa0e4('0x1e')],'type':'attended'});if(_[_0xa0e4('0x1f')](_0x3c7703[_0xa0e4('0x20')])){_0x3c7703=_[_0xa0e4('0x13')](_0x3c7703,{'transfereechannel':_0x3c7703[_0xa0e4('0x21')],'transfereecalleridnum':_0x3c7703[_0xa0e4('0x22')],'transfereecalleridname':_0x3c7703[_0xa0e4('0x23')],'transfereeconnectedlinenum':_0x3c7703['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x3c7703['transfertargetconnectedlinename'],'transfereeaccountcode':_0x3c7703[_0xa0e4('0x24')],'transfereecontext':_0x3c7703[_0xa0e4('0x25')],'transfereeexten':_0x3c7703['transfertargetexten'],'transfereelinkedid':_0x3c7703['transfertargetlinkedid']});}writeDB(_0x3c7703);}catch(_0x10f53c){utils[_0xa0e4('0x10')](util[_0xa0e4('0x2')]('[%s][transfers][attendedtransfer]',_0x3c7703[_0xa0e4('0x3')]),_0x10f53c);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 64b7f6f..4dd4b15 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 _0x2e79=['YYYY-MM-DD\x20HH:mm:ss','diffTime','now','isAfter','isBefore','bluebird','moment','util','client','http','../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','getVoiceQueueByName','GetVoiceQueue','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','seconds','format','subtractTime','subtract'];(function(_0x3aaf10,_0xfbcca0){var _0x1ace66=function(_0x22fc2f){while(--_0x22fc2f){_0x3aaf10['push'](_0x3aaf10['shift']());}};_0x1ace66(++_0xfbcca0);}(_0x2e79,0x155));var _0x92e7=function(_0xd1fc7,_0x1524f7){_0xd1fc7=_0xd1fc7-0x0;var _0x5b75e7=_0x2e79[_0xd1fc7];return _0x5b75e7;};'use strict';var BPromise=require(_0x92e7('0x0'));var jayson=require('jayson/promise');var moment=require(_0x92e7('0x1'));var util=require(_0x92e7('0x2'));var client=jayson[_0x92e7('0x3')][_0x92e7('0x4')]({'port':0x2329});var logger=require(_0x92e7('0x5'))(_0x92e7('0x6'));exports[_0x92e7('0x7')]=function(_0x2f2f7d,_0x4f115a){logger[_0x92e7('0x7')](_0x2f2f7d,_0x4f115a?util[_0x92e7('0x8')](_0x4f115a,{'showHidden':![],'depth':null}):'');};exports[_0x92e7('0x9')]=function(_0x2cf04c,_0x1d0a5d){logger[_0x92e7('0x9')](_0x2cf04c,_0x1d0a5d?util[_0x92e7('0x8')](_0x1d0a5d,{'showHidden':![],'depth':null}):'');};exports[_0x92e7('0xa')]=function(_0x35a8a3,_0xc6e067){logger['error'](_0x35a8a3,_0xc6e067?util[_0x92e7('0x8')](_0xc6e067,{'showHidden':![],'depth':null}):'');};exports[_0x92e7('0xb')]=function(_0x2c1353,_0x45eb28){return client[_0x92e7('0xb')](_0x2c1353,{'body':_0x45eb28})[_0x92e7('0xc')](function(_0x2c8eaf){logger[_0x92e7('0x9')](_0x92e7('0xd'),_0x2c1353,_0x2c8eaf?util['inspect'](_0x2c8eaf,{'showHidden':![],'depth':null}):'');})[_0x92e7('0xe')](function(_0xa3a6ee){logger[_0x92e7('0xa')](_0x92e7('0xd'),_0x2c1353,_0xa3a6ee?util[_0x92e7('0x8')](_0xa3a6ee,{'showHidden':![],'depth':null}):'');});};function getUser(_0x117025){return client['request'](_0x92e7('0xf'),{'options':{'raw':!![],'attributes':['id',_0x92e7('0x10'),_0x92e7('0x11'),_0x92e7('0x12')],'where':_0x117025,'limit':0x1}})[_0x92e7('0xc')](function(_0x440f60){logger[_0x92e7('0x9')](_0x92e7('0x13'),JSON[_0x92e7('0x14')](_0x117025),_0x440f60?util[_0x92e7('0x8')](_0x440f60,{'showHidden':![],'depth':null}):'');return _0x440f60[_0x92e7('0x15')][_0x92e7('0x16')]?_0x440f60[_0x92e7('0x15')][0x0]:null;});}exports[_0x92e7('0x17')]=function(_0x423013){return new BPromise(function(_0x1757c1,_0xdc53e0){if(_0x423013){return getUser({'internal':_0x423013})[_0x92e7('0xc')](function(_0x5e5c18){logger[_0x92e7('0x7')](_0x92e7('0x18'),_0x423013,_0x5e5c18?_0x92e7('0x19'):_0x92e7('0x1a'));return _0x1757c1(_0x5e5c18);})[_0x92e7('0xe')](function(_0x49d217){logger['error'](_0x92e7('0x1b'),_0x49d217?util[_0x92e7('0x8')](_0x49d217,{'showHidden':![],'depth':null}):'');return _0x1757c1(null);});}return _0x1757c1(null);});};exports[_0x92e7('0x1c')]=function(_0x31f159){return new BPromise(function(_0xda5cc4,_0x535a58){if(_0x31f159){return getUser({'interface':_0x31f159})[_0x92e7('0xc')](function(_0x5589c3){logger[_0x92e7('0x7')](_0x92e7('0x1d'),_0x31f159,_0x5589c3?'found':_0x92e7('0x1a'));return _0xda5cc4(_0x5589c3);})[_0x92e7('0xe')](function(_0x22ad50){logger['error'](_0x92e7('0x1e'),_0x22ad50?util[_0x92e7('0x8')](_0x22ad50,{'showHidden':![],'depth':null}):'');return _0xda5cc4(null);});}return _0xda5cc4(null);});};exports[_0x92e7('0x1f')]=function(_0x5397d9){return new BPromise(function(_0x1ea5fc,_0x265e95){if(_0x5397d9){return getUser({'name':_0x5397d9})['then'](function(_0x540c5e){logger[_0x92e7('0x7')](_0x92e7('0x20'),_0x5397d9,_0x540c5e?_0x92e7('0x19'):_0x92e7('0x1a'));return _0x1ea5fc(_0x540c5e);})[_0x92e7('0xe')](function(_0x4d8fdf){logger[_0x92e7('0xa')]('[utils][getUserByName]',_0x4d8fdf?util[_0x92e7('0x8')](_0x4d8fdf,{'showHidden':![],'depth':null}):'');return _0x1ea5fc(null);});}return _0x1ea5fc(null);});};exports[_0x92e7('0x21')]=function(_0x18d47e){return new BPromise(function(_0x56ef77,_0x11adc9){if(_0x18d47e){return client['request'](_0x92e7('0x22'),{'options':{'raw':!![],'attributes':['id',_0x92e7('0x11'),'type','acw',_0x92e7('0x23')],'where':{'name':_0x18d47e},'limit':0x1}})[_0x92e7('0xc')](function(_0x27b2c6){logger[_0x92e7('0x9')](_0x92e7('0x24'),_0x18d47e,_0x27b2c6?util['inspect'](_0x27b2c6,{'showHidden':![],'depth':null}):'');logger['info'](_0x92e7('0x25'),_0x18d47e,_0x27b2c6?'found':_0x92e7('0x1a'));return _0x56ef77(_0x27b2c6[_0x92e7('0x15')][_0x92e7('0x16')]?_0x27b2c6[_0x92e7('0x15')][0x0]:null);})[_0x92e7('0xe')](function(_0x57d77c){logger[_0x92e7('0xa')](_0x92e7('0x26'),_0x57d77c?util[_0x92e7('0x8')](_0x57d77c,{'showHidden':![],'depth':null}):'');return _0x56ef77(null);});}return _0x56ef77(null);});};exports['addTime']=function(_0x2529dc,_0x3b08ef){return moment(_0x2529dc)['add'](_0x3b08ef,_0x92e7('0x27'))[_0x92e7('0x28')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x92e7('0x29')]=function(_0x3bd8e4,_0x2769bb){return moment(_0x3bd8e4)[_0x92e7('0x2a')](_0x2769bb,_0x92e7('0x27'))[_0x92e7('0x28')](_0x92e7('0x2b'));};exports[_0x92e7('0x2c')]=function(_0x64509b,_0x2059d3){return moment(_0x64509b)['diff'](moment(_0x2059d3),_0x92e7('0x27'));};exports['sumTime']=function(_0x5690a1,_0x290966){return parseInt(_0x5690a1,0xa)+parseInt(_0x290966,0xa);};exports[_0x92e7('0x2d')]=function(){return moment()['format'](_0x92e7('0x2b'));};exports[_0x92e7('0x2e')]=function(_0x58c46a,_0x138e9b){if(_0x138e9b){return moment(_0x58c46a)[_0x92e7('0x2e')](_0x138e9b);}return!![];};exports['isBefore']=function(_0x7b5c54,_0x38adf2){if(_0x38adf2){return moment(_0x7b5c54)[_0x92e7('0x2f')](_0x38adf2);}else if(_0x7b5c54){return!![];}return![];}; \ No newline at end of file +var _0x3a6d=['[utils][getUserByInternal]\x20internal:%s\x20%s','notfound','[utils][getUserByInternal]','getUserByInterface','catch','[utils][getUserByName]\x20name:%s\x20%s','found','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','name','type','acw','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','result','[utils][getVoiceQueueByName]','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','util','client','http','../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','GetUser','internal','interface','[utils][getUser]\x20where:%s','stringify','length'];(function(_0x2333b5,_0x188f7e){var _0x3baa0b=function(_0x5d5075){while(--_0x5d5075){_0x2333b5['push'](_0x2333b5['shift']());}};_0x3baa0b(++_0x188f7e);}(_0x3a6d,0x143));var _0xd3a6=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x3a6d[_0xa148b7];return _0x51efd3;};'use strict';var BPromise=require(_0xd3a6('0x0'));var jayson=require(_0xd3a6('0x1'));var moment=require('moment');var util=require(_0xd3a6('0x2'));var client=jayson[_0xd3a6('0x3')][_0xd3a6('0x4')]({'port':0x2329});var logger=require(_0xd3a6('0x5'))(_0xd3a6('0x6'));exports['info']=function(_0x1cb966,_0x27d641){logger[_0xd3a6('0x7')](_0x1cb966,_0x27d641?util[_0xd3a6('0x8')](_0x27d641,{'showHidden':![],'depth':null}):'');};exports[_0xd3a6('0x9')]=function(_0x282cb1,_0x58d83a){logger[_0xd3a6('0x9')](_0x282cb1,_0x58d83a?util[_0xd3a6('0x8')](_0x58d83a,{'showHidden':![],'depth':null}):'');};exports[_0xd3a6('0xa')]=function(_0x410dac,_0x14b46b){logger[_0xd3a6('0xa')](_0x410dac,_0x14b46b?util[_0xd3a6('0x8')](_0x14b46b,{'showHidden':![],'depth':null}):'');};exports[_0xd3a6('0xb')]=function(_0x1f04cd,_0x5ab5a9){return client[_0xd3a6('0xb')](_0x1f04cd,{'body':_0x5ab5a9})[_0xd3a6('0xc')](function(_0x3f4d74){logger[_0xd3a6('0x9')](_0xd3a6('0xd'),_0x1f04cd,_0x3f4d74?util['inspect'](_0x3f4d74,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x4b0467){logger[_0xd3a6('0xa')](_0xd3a6('0xd'),_0x1f04cd,_0x4b0467?util[_0xd3a6('0x8')](_0x4b0467,{'showHidden':![],'depth':null}):'');});};function getUser(_0x41eca8){return client[_0xd3a6('0xb')](_0xd3a6('0xe'),{'options':{'raw':!![],'attributes':['id',_0xd3a6('0xf'),'name',_0xd3a6('0x10')],'where':_0x41eca8,'limit':0x1}})[_0xd3a6('0xc')](function(_0x171a8f){logger['debug'](_0xd3a6('0x11'),JSON[_0xd3a6('0x12')](_0x41eca8),_0x171a8f?util[_0xd3a6('0x8')](_0x171a8f,{'showHidden':![],'depth':null}):'');return _0x171a8f['result'][_0xd3a6('0x13')]?_0x171a8f['result'][0x0]:null;});}exports['getUserByInternal']=function(_0x28b63c){return new BPromise(function(_0x8d1286,_0x32683f){if(_0x28b63c){return getUser({'internal':_0x28b63c})[_0xd3a6('0xc')](function(_0x22fb05){logger[_0xd3a6('0x7')](_0xd3a6('0x14'),_0x28b63c,_0x22fb05?'found':_0xd3a6('0x15'));return _0x8d1286(_0x22fb05);})['catch'](function(_0x6c6d21){logger[_0xd3a6('0xa')](_0xd3a6('0x16'),_0x6c6d21?util[_0xd3a6('0x8')](_0x6c6d21,{'showHidden':![],'depth':null}):'');return _0x8d1286(null);});}return _0x8d1286(null);});};exports[_0xd3a6('0x17')]=function(_0x6ecd88){return new BPromise(function(_0x54c193,_0xe7d595){if(_0x6ecd88){return getUser({'interface':_0x6ecd88})[_0xd3a6('0xc')](function(_0x57cf15){logger['info']('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x6ecd88,_0x57cf15?'found':'notfound');return _0x54c193(_0x57cf15);})[_0xd3a6('0x18')](function(_0x400982){logger[_0xd3a6('0xa')]('[utils][getUserByInterface]',_0x400982?util[_0xd3a6('0x8')](_0x400982,{'showHidden':![],'depth':null}):'');return _0x54c193(null);});}return _0x54c193(null);});};exports['getUserByName']=function(_0x350a11){return new BPromise(function(_0x16afc8,_0x429079){if(_0x350a11){return getUser({'name':_0x350a11})['then'](function(_0x14316b){logger[_0xd3a6('0x7')](_0xd3a6('0x19'),_0x350a11,_0x14316b?_0xd3a6('0x1a'):_0xd3a6('0x15'));return _0x16afc8(_0x14316b);})[_0xd3a6('0x18')](function(_0x5650d1){logger[_0xd3a6('0xa')](_0xd3a6('0x1b'),_0x5650d1?util[_0xd3a6('0x8')](_0x5650d1,{'showHidden':![],'depth':null}):'');return _0x16afc8(null);});}return _0x16afc8(null);});};exports[_0xd3a6('0x1c')]=function(_0x30abc2){return new BPromise(function(_0x45c628,_0x5c2186){if(_0x30abc2){return client['request'](_0xd3a6('0x1d'),{'options':{'raw':!![],'attributes':['id',_0xd3a6('0x1e'),_0xd3a6('0x1f'),_0xd3a6('0x20'),'acwTimeout'],'where':{'name':_0x30abc2},'limit':0x1}})[_0xd3a6('0xc')](function(_0xa4efd){logger['debug'](_0xd3a6('0x21'),_0x30abc2,_0xa4efd?util['inspect'](_0xa4efd,{'showHidden':![],'depth':null}):'');logger[_0xd3a6('0x7')](_0xd3a6('0x22'),_0x30abc2,_0xa4efd?_0xd3a6('0x1a'):_0xd3a6('0x15'));return _0x45c628(_0xa4efd[_0xd3a6('0x23')][_0xd3a6('0x13')]?_0xa4efd[_0xd3a6('0x23')][0x0]:null);})['catch'](function(_0x4d7b56){logger[_0xd3a6('0xa')](_0xd3a6('0x24'),_0x4d7b56?util[_0xd3a6('0x8')](_0x4d7b56,{'showHidden':![],'depth':null}):'');return _0x45c628(null);});}return _0x45c628(null);});};exports['addTime']=function(_0x1d662d,_0x1316c0){return moment(_0x1d662d)[_0xd3a6('0x25')](_0x1316c0,_0xd3a6('0x26'))[_0xd3a6('0x27')](_0xd3a6('0x28'));};exports[_0xd3a6('0x29')]=function(_0x10352a,_0x59428a){return moment(_0x10352a)[_0xd3a6('0x2a')](_0x59428a,_0xd3a6('0x26'))[_0xd3a6('0x27')](_0xd3a6('0x28'));};exports[_0xd3a6('0x2b')]=function(_0x1c161f,_0x5e6aaf){return moment(_0x1c161f)[_0xd3a6('0x2c')](moment(_0x5e6aaf),'seconds');};exports[_0xd3a6('0x2d')]=function(_0x459e78,_0x180bb9){return parseInt(_0x459e78,0xa)+parseInt(_0x180bb9,0xa);};exports[_0xd3a6('0x2e')]=function(){return moment()['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xd3a6('0x2f')]=function(_0x44f162,_0x2e7940){if(_0x2e7940){return moment(_0x44f162)['isAfter'](_0x2e7940);}return!![];};exports[_0xd3a6('0x30')]=function(_0x114784,_0x515b2c){if(_0x515b2c){return moment(_0x114784)[_0xd3a6('0x30')](_0x515b2c);}else if(_0x114784){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 1f45c91..1711869 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 _0xa943=['maskSensitiveData','join','/var','log','xcally','client','role','ensureDir','catch','user','then','no-user','data','error','api','auth','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','\x20body=%s','format','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','name','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','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)','other','agent_name','setupLoggers','fs-extra','lodash','path','./loggers','./safe-template','./mask-sensitive-data'];(function(_0x4066ef,_0x2694f3){var _0x1049c3=function(_0xdb7606){while(--_0xdb7606){_0x4066ef['push'](_0x4066ef['shift']());}};_0x1049c3(++_0x2694f3);}(_0xa943,0x10e));var _0x3a94=function(_0x1e7ccf,_0x1c602a){_0x1e7ccf=_0x1e7ccf-0x0;var _0x2e6325=_0xa943[_0x1e7ccf];return _0x2e6325;};var fs=require(_0x3a94('0x0'));var _=require(_0x3a94('0x1'));var ewinston=require('express-winston');var path=require(_0x3a94('0x2'));var util=require('util');var fileLogger=require(_0x3a94('0x3'))['fileLogger'];var safeTemplate=require(_0x3a94('0x4'))['safeTemplate'];var maskSensitiveData=require(_0x3a94('0x5'))[_0x3a94('0x6')];function ClientSideLogger(){function _0x5c372f(_0x4b7e61){var _0x480970=path[_0x3a94('0x7')](_0x3a94('0x8'),_0x3a94('0x9'),_0x3a94('0xa'));var _0x2f017c=path['join'](_0x3a94('0xb'),_0x4b7e61[_0x3a94('0xc')]+'-'+_0x4b7e61['name']);return fs[_0x3a94('0xd')](path['join'](_0x480970,_0x2f017c))['then'](function(){var _0x4569ca=fileLogger(_0x3a94('0xb'),path[_0x3a94('0x7')](_0x480970,_0x2f017c));return _0x4569ca;})[_0x3a94('0xe')](function(_0x4437dc){throw _0x4437dc;});}this[_0x3a94('0x9')]=function(_0x5eae99,_0xd0404d,_0x58d32b,_0x1baff1){return _0x5c372f(_0x5eae99[_0x3a94('0xf')])[_0x3a94('0x10')](function(_0x330cc7){var _0x1205be=_0x330cc7[_0xd0404d];return _0x1205be;})[_0x3a94('0x10')](function(_0x592507){var _0x47c8c4=_0x5eae99[_0x3a94('0xf')]?_0x5eae99[_0x3a94('0xf')]['id']:_0x3a94('0x11');var _0x1585f1=_0x1baff1[_0x3a94('0x12')];var _0x412ee7=_0x1baff1['timestamp'];var _0x391218=new Date(Number(_0x412ee7));return _0x592507(_0x47c8c4,_0x391218,_0x58d32b,_0x1585f1);})[_0x3a94('0xe')](function(_0x19ad96){fileLogger(_0x3a94('0xb'))[_0x3a94('0x13')](_0x19ad96);});};}function setupLoggers(_0x119557){return new Promise(function(_0x40ba04){var _0x180479=new ClientSideLogger();var _0xa32bc9=fileLogger(_0x3a94('0x14'));var _0x533e15=fileLogger(_0x3a94('0x15'));_0x119557['set'](_0x3a94('0x16'),_0x180479);_0x119557[_0x3a94('0x17')](ewinston[_0x3a94('0x18')]({'winstonInstance':_0xa32bc9,'meta':![],'statusLevels':!![],'msg':function(_0x1aa839,_0xe44242){var _0x92f8eb=_0x3a94('0x19');if(!_[_0x3a94('0x1a')](_0x1aa839['body'])){_0x92f8eb+=_0x3a94('0x1b');var _0x452586=_0x1aa839['body'];maskSensitiveData(_0x452586);}return safeTemplate(util[_0x3a94('0x1c')](_0x92f8eb,_0x1aa839[_0x3a94('0x1d')],_0x1aa839[_0x3a94('0x1e')][_0x3a94('0x1f')]?_0x1aa839[_0x3a94('0x1e')]['x-forwarded-for']:_0x1aa839[_0x3a94('0x20')][_0x3a94('0x21')]||_0x1aa839['ip'],_0x1aa839[_0x3a94('0x22')],_0xe44242[_0x3a94('0x23')],_0xe44242[_0x3a94('0x24')],_0x1aa839[_0x3a94('0xf')]?_0x1aa839[_0x3a94('0xf')]['id']:null,_0x1aa839[_0x3a94('0xf')]?_0x1aa839[_0x3a94('0xf')][_0x3a94('0x25')]:null,_0x1aa839['user']?_0x1aa839[_0x3a94('0xf')]['role']:null,_0x452586?util['inspect'](_0x452586,![],null):''));}}));_0x119557[_0x3a94('0x17')](ewinston['logger']({'winstonInstance':_0x533e15,'meta':![],'statusLevels':!![],'msg':function(_0x264732,_0xa8e362){var _0x5dfb3e=_0x3a94('0x26');if(_0x264732[_0x3a94('0x27')]&&_0x264732[_0x3a94('0x27')][_0x3a94('0x28')]&&_0x264732[_0x3a94('0x27')][_0x3a94('0x29')]){_0x5dfb3e=_0x3a94('0x2a');}return util[_0x3a94('0x1c')](_0x5dfb3e,_0x264732['method'],_0x264732['headers'][_0x3a94('0x1f')]?_0x264732['headers'][_0x3a94('0x1f')]:_0x264732[_0x3a94('0x20')][_0x3a94('0x21')]||_0x264732['ip'],_0x264732[_0x3a94('0x22')],_0xa8e362['statusCode'],_0xa8e362[_0x3a94('0x24')],_0x264732[_0x3a94('0xf')]?_0x264732['user']['id']:null,_0x264732[_0x3a94('0xf')]?_0x264732['user']['name']:null,_0x264732[_0x3a94('0xf')]?_0x264732[_0x3a94('0xf')][_0x3a94('0xc')]:null,_0x264732['body']&&_0x264732[_0x3a94('0x27')][_0x3a94('0x28')]?_0x264732['body'][_0x3a94('0x28')]:_0x3a94('0x2b'),_0x264732[_0x3a94('0x27')]&&_0x264732[_0x3a94('0x27')]['agent_id']?_0x264732['body']['agent_id']:'',_0x264732[_0x3a94('0x27')]&&_0x264732['body'][_0x3a94('0x2c')]?_0x264732[_0x3a94('0x27')]['agent_name']:'');},'ignoreRoute':function(_0x4d2b57){var _0x166ebd=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x166ebd['test'](_0x4d2b57[_0x3a94('0x22')]);}}));return _0x40ba04();});}exports[_0x3a94('0x2d')]=setupLoggers; \ No newline at end of file +var _0xfcb3=['method','headers','x-forwarded-for','connection','remoteAddress','url','inspect','use','logger','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)','statusCode','responseTime','other','agent_name','fs-extra','lodash','express-winston','util','fileLogger','./safe-template','./mask-sensitive-data','maskSensitiveData','join','/var','log','xcally','client','role','name','ensureDir','then','catch','user','data','timestamp','error','api','auth','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','format'];(function(_0x481753,_0x2786a5){var _0x392bc1=function(_0xeb67c7){while(--_0xeb67c7){_0x481753['push'](_0x481753['shift']());}};_0x392bc1(++_0x2786a5);}(_0xfcb3,0xec));var _0x3fcb=function(_0x46a2ff,_0x1de7f8){_0x46a2ff=_0x46a2ff-0x0;var _0x10762b=_0xfcb3[_0x46a2ff];return _0x10762b;};var fs=require(_0x3fcb('0x0'));var _=require(_0x3fcb('0x1'));var ewinston=require(_0x3fcb('0x2'));var path=require('path');var util=require(_0x3fcb('0x3'));var fileLogger=require('./loggers')[_0x3fcb('0x4')];var safeTemplate=require(_0x3fcb('0x5'))['safeTemplate'];var maskSensitiveData=require(_0x3fcb('0x6'))[_0x3fcb('0x7')];function ClientSideLogger(){function _0x5eb35c(_0x577fe3){var _0x22d260=path[_0x3fcb('0x8')](_0x3fcb('0x9'),_0x3fcb('0xa'),_0x3fcb('0xb'));var _0x44d6e9=path[_0x3fcb('0x8')](_0x3fcb('0xc'),_0x577fe3[_0x3fcb('0xd')]+'-'+_0x577fe3[_0x3fcb('0xe')]);return fs[_0x3fcb('0xf')](path[_0x3fcb('0x8')](_0x22d260,_0x44d6e9))[_0x3fcb('0x10')](function(){var _0x471dea=fileLogger(_0x3fcb('0xc'),path[_0x3fcb('0x8')](_0x22d260,_0x44d6e9));return _0x471dea;})[_0x3fcb('0x11')](function(_0x1a5b75){throw _0x1a5b75;});}this[_0x3fcb('0xa')]=function(_0x278aba,_0x896676,_0xe676dc,_0x2a4be8){return _0x5eb35c(_0x278aba[_0x3fcb('0x12')])['then'](function(_0x1f819a){var _0x56fd27=_0x1f819a[_0x896676];return _0x56fd27;})[_0x3fcb('0x10')](function(_0x327db7){var _0x3e3faf=_0x278aba[_0x3fcb('0x12')]?_0x278aba[_0x3fcb('0x12')]['id']:'no-user';var _0x20817a=_0x2a4be8[_0x3fcb('0x13')];var _0x38be2c=_0x2a4be8[_0x3fcb('0x14')];var _0x3076ec=new Date(Number(_0x38be2c));return _0x327db7(_0x3e3faf,_0x3076ec,_0xe676dc,_0x20817a);})[_0x3fcb('0x11')](function(_0x3d4ed5){fileLogger('client')[_0x3fcb('0x15')](_0x3d4ed5);});};}function setupLoggers(_0x5827f1){return new Promise(function(_0x1167b9){var _0x328717=new ClientSideLogger();var _0x1eb4f6=fileLogger(_0x3fcb('0x16'));var _0x466c92=fileLogger(_0x3fcb('0x17'));_0x5827f1['set']('client-side-logger',_0x328717);_0x5827f1['use'](ewinston['logger']({'winstonInstance':_0x1eb4f6,'meta':![],'statusLevels':!![],'msg':function(_0x454393,_0x3b733f){var _0x44a4b5=_0x3fcb('0x18');if(!_[_0x3fcb('0x19')](_0x454393[_0x3fcb('0x1a')])){_0x44a4b5+='\x20body=%s';var _0x21b68c=_0x454393[_0x3fcb('0x1a')];maskSensitiveData(_0x21b68c);}return safeTemplate(util[_0x3fcb('0x1b')](_0x44a4b5,_0x454393[_0x3fcb('0x1c')],_0x454393[_0x3fcb('0x1d')][_0x3fcb('0x1e')]?_0x454393[_0x3fcb('0x1d')]['x-forwarded-for']:_0x454393[_0x3fcb('0x1f')][_0x3fcb('0x20')]||_0x454393['ip'],_0x454393[_0x3fcb('0x21')],_0x3b733f['statusCode'],_0x3b733f['responseTime'],_0x454393['user']?_0x454393[_0x3fcb('0x12')]['id']:null,_0x454393[_0x3fcb('0x12')]?_0x454393['user'][_0x3fcb('0xe')]:null,_0x454393[_0x3fcb('0x12')]?_0x454393[_0x3fcb('0x12')][_0x3fcb('0xd')]:null,_0x21b68c?util[_0x3fcb('0x22')](_0x21b68c,![],null):''));}}));_0x5827f1[_0x3fcb('0x23')](ewinston[_0x3fcb('0x24')]({'winstonInstance':_0x466c92,'meta':![],'statusLevels':!![],'msg':function(_0x3083a4,_0x18575e){var _0x535a87='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x3083a4[_0x3fcb('0x1a')]&&_0x3083a4['body'][_0x3fcb('0x25')]&&_0x3083a4['body'][_0x3fcb('0x26')]){_0x535a87=_0x3fcb('0x27');}return util[_0x3fcb('0x1b')](_0x535a87,_0x3083a4[_0x3fcb('0x1c')],_0x3083a4[_0x3fcb('0x1d')][_0x3fcb('0x1e')]?_0x3083a4[_0x3fcb('0x1d')][_0x3fcb('0x1e')]:_0x3083a4[_0x3fcb('0x1f')][_0x3fcb('0x20')]||_0x3083a4['ip'],_0x3083a4[_0x3fcb('0x21')],_0x18575e[_0x3fcb('0x28')],_0x18575e[_0x3fcb('0x29')],_0x3083a4[_0x3fcb('0x12')]?_0x3083a4[_0x3fcb('0x12')]['id']:null,_0x3083a4[_0x3fcb('0x12')]?_0x3083a4[_0x3fcb('0x12')]['name']:null,_0x3083a4['user']?_0x3083a4[_0x3fcb('0x12')][_0x3fcb('0xd')]:null,_0x3083a4[_0x3fcb('0x1a')]&&_0x3083a4[_0x3fcb('0x1a')][_0x3fcb('0x25')]?_0x3083a4[_0x3fcb('0x1a')][_0x3fcb('0x25')]:_0x3fcb('0x2a'),_0x3083a4[_0x3fcb('0x1a')]&&_0x3083a4[_0x3fcb('0x1a')][_0x3fcb('0x26')]?_0x3083a4[_0x3fcb('0x1a')][_0x3fcb('0x26')]:'',_0x3083a4[_0x3fcb('0x1a')]&&_0x3083a4[_0x3fcb('0x1a')][_0x3fcb('0x2b')]?_0x3083a4['body']['agent_name']:'');},'ignoreRoute':function(_0x5943a2){var _0x3f2b50=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x3f2b50['test'](_0x5943a2[_0x3fcb('0x21')]);}}));return _0x1167b9();});}exports['setupLoggers']=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index 91f482e..d3ee67b 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd80f=['isMoment','padStart','split','length','iftime','lodash','moment-timezone','map','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','locale','weekdaysShort','toLowerCase','indexOf','slice','concat','exports','monthsShort','circularMonthInterval','clone','minutes','hours','isBefore','day','endOf','isBetween','timeCompare','ddd','includes','dowCompare','date','daysInMonth','max','min','domCompare','MMM','monthCompare','guess'];(function(_0x482999,_0x2e4c80){var _0x1c5d31=function(_0xa39c23){while(--_0xa39c23){_0x482999['push'](_0x482999['shift']());}};_0x1c5d31(++_0x2e4c80);}(_0xd80f,0x116));var _0xfd80=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd80f[_0x3dd15e];return _0x231fd0;};var _=require(_0xfd80('0x0'));var moment=require(_0xfd80('0x1'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0xfd80('0x2')](function(_0x106cdc){return _0x106cdc['source'];})[_0xfd80('0x3')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0xfd80('0x4');var EINVALID_DATE=_0xfd80('0x5');function throwIfDateNotValid(_0x4272d5){if(!_0x4272d5['isValid']()){throw new Error(EINVALID_DATE);}}function extractTime(_0xff2a2e){var _0x3b3a3a=_0xff2a2e['split'](':')[_0xfd80('0x2')](function(_0x59e306){return parseInt(_0x59e306,0xa);});var _0x58147f=_0x3b3a3a[0x0];var _0x35196f=_0x3b3a3a[0x1];if(_0x58147f<0x0||_0x58147f>0x17||_0x35196f<0x0||_0x35196f>0x3b){throw new Error(EINVALID_DATE);}return[_0x58147f,_0x35196f];}function circularDoWInterval(_0xd260ea,_0x585594){if(_0xd260ea===_0x585594){return[_0xd260ea];}else{var _0x76d21b=moment[_0xfd80('0x6')]();moment[_0xfd80('0x6')]('en');var _0x13dade=moment[_0xfd80('0x7')]()[_0xfd80('0x2')](function(_0x372326){return _0x372326[_0xfd80('0x8')]();});moment[_0xfd80('0x6')](_0x76d21b);var _0x3d3c56=_0x13dade[_0xfd80('0x9')](_0xd260ea);var _0x1bad46=_0x13dade[_0xfd80('0x9')](_0x585594);if(_0x1bad46>_0x3d3c56){return _0x13dade[_0xfd80('0xa')](_0x3d3c56,_0x1bad46+0x1);}else{var _0x74aacf=_0x13dade['slice'](0x0,_0x1bad46+0x1);var _0x2326d9=_0x13dade[_0xfd80('0xa')](_0x3d3c56);return _0x2326d9[_0xfd80('0xb')](_0x74aacf);}}}module[_0xfd80('0xc')]['circularDoWInterval']=circularDoWInterval;function circularMonthInterval(_0x1b7f68,_0x4b9d5d){if(_0x1b7f68===_0x4b9d5d){return[_0x1b7f68];}else{var _0x29e377=moment[_0xfd80('0x6')]();moment[_0xfd80('0x6')]('en');var _0x2d77e9=moment[_0xfd80('0xd')]()[_0xfd80('0x2')](function(_0x28acbb){return _0x28acbb[_0xfd80('0x8')]();});moment[_0xfd80('0x6')](_0x29e377);var _0x1cbcd0=_0x2d77e9[_0xfd80('0x9')](_0x1b7f68);var _0x1f6cfc=_0x2d77e9[_0xfd80('0x9')](_0x4b9d5d);if(_0x1f6cfc>_0x1cbcd0){return _0x2d77e9[_0xfd80('0xa')](_0x1cbcd0,_0x1f6cfc+0x1);}else{var _0x38f65c=_0x2d77e9[_0xfd80('0xa')](0x0,_0x1f6cfc+0x1);var _0x44da2d=_0x2d77e9['slice'](_0x1cbcd0);return _0x44da2d['concat'](_0x38f65c);}}}module[_0xfd80('0xc')][_0xfd80('0xe')]=circularMonthInterval;function parseDom(_0x346274){var _0x56cc0e=parseInt(_0x346274,0xa);if(_0x56cc0e<0x1||_0x56cc0e>0x1f){throw new Error(EINVALID_DATE);}return _0x56cc0e;}function timeCompare(_0x4754fe,_0x529c2a,_0x1a3cec){var _0x19438b=_0x4754fe[_0xfd80('0xf')]();var _0x398ec9=extractTime(_0x529c2a);var _0x3999a2=_0x398ec9[0x0];var _0x234a0d=_0x398ec9[0x1];var _0x2e8035=_0x4754fe[_0xfd80('0xf')]()['hours'](_0x3999a2)[_0xfd80('0x10')](_0x234a0d);throwIfDateNotValid(_0x2e8035);var _0x437e7b=extractTime(_0x1a3cec);var _0x1c8f79=_0x437e7b[0x0];var _0x5670b6=_0x437e7b[0x1];var _0x5d5bed=_0x4754fe['clone']()[_0xfd80('0x11')](_0x1c8f79)[_0xfd80('0x10')](_0x5670b6);throwIfDateNotValid(_0x5d5bed);if(_0x5d5bed[_0xfd80('0x12')](_0x2e8035)){var _0x223caf=_0x19438b['clone']()['startOf'](_0xfd80('0x13'));var _0x479461=_0x19438b[_0xfd80('0xf')]()[_0xfd80('0x14')](_0xfd80('0x13'));return _0x19438b[_0xfd80('0x15')](_0x2e8035,_0x479461,undefined,'[]')||_0x19438b[_0xfd80('0x15')](_0x223caf,_0x5d5bed,undefined,'[]');}else{return _0x19438b[_0xfd80('0x15')](_0x2e8035,_0x5d5bed,undefined,'[]');}}module['exports'][_0xfd80('0x16')]=timeCompare;function dowCompare(_0x14cbfb,_0x546008,_0xa91204){var _0x59e92f=_0x14cbfb['locale']('en')['format'](_0xfd80('0x17'))[_0xfd80('0x8')]();return circularDoWInterval(_0x546008,_0xa91204)[_0xfd80('0x18')](_0x59e92f);}module[_0xfd80('0xc')][_0xfd80('0x19')]=dowCompare;function domCompare(_0x17ef5e,_0x10cd5f,_0x421a67){var _0x47a0c3=_0x17ef5e[_0xfd80('0x1a')]();if(_0x10cd5f===_0x421a67){return _0x47a0c3===_0x10cd5f;}else{var _0x5cb990=_0x17ef5e[_0xfd80('0x1b')]();var _0x2a1ff5=_0x10cd5f<_0x421a67;let _0x4b2d6b=![];var _0x353ace=0x0;var _0xcc01c8=0x0;if(_0x2a1ff5){_0x353ace=Math[_0xfd80('0x1c')](0x1,_0x10cd5f);_0xcc01c8=Math[_0xfd80('0x1d')](_0x421a67,_0x5cb990);_0x4b2d6b=_0x47a0c3>=_0x353ace&&_0x47a0c3<=_0xcc01c8;}else{_0x353ace=Math['min'](_0x10cd5f,_0x5cb990);_0xcc01c8=Math[_0xfd80('0x1c')](0x1,_0x421a67);_0x4b2d6b=_0x47a0c3>=_0x353ace||_0x47a0c3<=_0xcc01c8;}return _0x4b2d6b;}}module[_0xfd80('0xc')][_0xfd80('0x1e')]=domCompare;function monthCompare(_0x4467d1,_0x2fae10,_0x24b06c){var _0x116bfa=_0x4467d1[_0xfd80('0x6')]('en')['format'](_0xfd80('0x1f'))[_0xfd80('0x8')]();return circularMonthInterval(_0x2fae10,_0x24b06c)[_0xfd80('0x18')](_0x116bfa);}module[_0xfd80('0xc')][_0xfd80('0x20')]=monthCompare;function iftime(_0xec9c98,_0x5881a6=moment['tz'][_0xfd80('0x21')](),_0x4039b5=moment()){if(!validateRx['test'](_0xec9c98)){throw new Error(EINVALID_STRING);}else{var _0x230bec=(moment[_0xfd80('0x22')](_0x4039b5)?_0x4039b5[_0xfd80('0xf')]():moment(_0x4039b5))['tz'](_0x5881a6)[_0xfd80('0x6')]('en');throwIfDateNotValid(_0x230bec);var _0x165dbf=_0xec9c98['split'](',');var _0x4ead63=_0x165dbf[0x0];var _0xbb66fb=_0x165dbf[0x1];var _0x4a1034=_0x165dbf[0x2];var _0x2e1895=_0x165dbf[0x3];let _0x151e9b=!![];if(_0x4ead63!=='*'){var _0x4331e1=_0x4ead63['split']('-');var _0x54fa59=_['padStart'](_0x4331e1[0x0],0x5,'0');var _0x663156=_0x4331e1['length']===0x2?_[_0xfd80('0x23')](_0x4331e1[0x1],0x5,'0'):_0x54fa59;_0x151e9b=timeCompare(_0x230bec,_0x54fa59,_0x663156);}let _0x16808f=!![];if(_0xbb66fb!=='*'){var _0x31d25e=_0xbb66fb['split']('-');var _0x33f257=_0x31d25e[0x0];var _0x29b0d4=_0x31d25e['length']===0x2?_0x31d25e[0x1]:_0x33f257;_0x16808f=dowCompare(_0x230bec,_0x33f257,_0x29b0d4);}let _0x57abad=!![];if(_0x4a1034!=='*'){var _0x3812a0=_0x4a1034[_0xfd80('0x24')]('-');var _0x4b4737=parseDom(_0x3812a0[0x0]);var _0x5c8ae7=_0x3812a0[_0xfd80('0x25')]===0x2?parseDom(_0x3812a0[0x1]):_0x4b4737;_0x57abad=domCompare(_0x230bec,_0x4b4737,_0x5c8ae7);}let _0x5263fb=!![];if(_0x2e1895!=='*'){var _0x366521=_0x2e1895['split']('-');var _0x20c4f1=_0x366521[0x0];var _0x3c71db=_0x366521[_0xfd80('0x25')]===0x2?_0x366521[0x1]:_0x366521[0x0];_0x5263fb=monthCompare(_0x230bec,_0x20c4f1,_0x3c71db);}return _0x151e9b&&_0x16808f&&_0x57abad&&_0x5263fb;}}module['exports'][_0xfd80('0x26')]=iftime; \ No newline at end of file +var _0xf891=['min','domCompare','MMM','monthCompare','guess','test','isMoment','padStart','length','iftime','lodash','moment-timezone','map','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','split','locale','weekdaysShort','toLowerCase','indexOf','slice','concat','exports','circularDoWInterval','monthsShort','circularMonthInterval','clone','hours','minutes','isBefore','startOf','day','isBetween','format','ddd','includes','dowCompare','date','daysInMonth'];(function(_0x2ef329,_0xfc0183){var _0x582b32=function(_0x5d17dc){while(--_0x5d17dc){_0x2ef329['push'](_0x2ef329['shift']());}};_0x582b32(++_0xfc0183);}(_0xf891,0x82));var _0x1f89=function(_0x50cafd,_0x5e741b){_0x50cafd=_0x50cafd-0x0;var _0x155a22=_0xf891[_0x50cafd];return _0x155a22;};var _=require(_0x1f89('0x0'));var moment=require(_0x1f89('0x1'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0x1f89('0x2')](function(_0x97e4cc){return _0x97e4cc['source'];})[_0x1f89('0x3')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x1f89('0x4');var EINVALID_DATE=_0x1f89('0x5');function throwIfDateNotValid(_0x5d6eda){if(!_0x5d6eda['isValid']()){throw new Error(EINVALID_DATE);}}function extractTime(_0x48ce2d){var _0x24a642=_0x48ce2d[_0x1f89('0x6')](':')['map'](function(_0x4a29e1){return parseInt(_0x4a29e1,0xa);});var _0x1ff8cb=_0x24a642[0x0];var _0x14692c=_0x24a642[0x1];if(_0x1ff8cb<0x0||_0x1ff8cb>0x17||_0x14692c<0x0||_0x14692c>0x3b){throw new Error(EINVALID_DATE);}return[_0x1ff8cb,_0x14692c];}function circularDoWInterval(_0x2f0bc9,_0x3f339e){if(_0x2f0bc9===_0x3f339e){return[_0x2f0bc9];}else{var _0x42f453=moment[_0x1f89('0x7')]();moment[_0x1f89('0x7')]('en');var _0x3a9402=moment[_0x1f89('0x8')]()[_0x1f89('0x2')](function(_0x67039a){return _0x67039a[_0x1f89('0x9')]();});moment[_0x1f89('0x7')](_0x42f453);var _0x505ac4=_0x3a9402['indexOf'](_0x2f0bc9);var _0x5bfc40=_0x3a9402[_0x1f89('0xa')](_0x3f339e);if(_0x5bfc40>_0x505ac4){return _0x3a9402[_0x1f89('0xb')](_0x505ac4,_0x5bfc40+0x1);}else{var _0x48ce22=_0x3a9402[_0x1f89('0xb')](0x0,_0x5bfc40+0x1);var _0x28750b=_0x3a9402[_0x1f89('0xb')](_0x505ac4);return _0x28750b[_0x1f89('0xc')](_0x48ce22);}}}module[_0x1f89('0xd')][_0x1f89('0xe')]=circularDoWInterval;function circularMonthInterval(_0x20453f,_0x241b64){if(_0x20453f===_0x241b64){return[_0x20453f];}else{var _0x2bc819=moment[_0x1f89('0x7')]();moment[_0x1f89('0x7')]('en');var _0x55911c=moment[_0x1f89('0xf')]()[_0x1f89('0x2')](function(_0x15cd63){return _0x15cd63['toLowerCase']();});moment[_0x1f89('0x7')](_0x2bc819);var _0x32d372=_0x55911c[_0x1f89('0xa')](_0x20453f);var _0xfa485c=_0x55911c[_0x1f89('0xa')](_0x241b64);if(_0xfa485c>_0x32d372){return _0x55911c[_0x1f89('0xb')](_0x32d372,_0xfa485c+0x1);}else{var _0x541b5d=_0x55911c[_0x1f89('0xb')](0x0,_0xfa485c+0x1);var _0x2db2f4=_0x55911c['slice'](_0x32d372);return _0x2db2f4['concat'](_0x541b5d);}}}module[_0x1f89('0xd')][_0x1f89('0x10')]=circularMonthInterval;function parseDom(_0xa33702){var _0x363044=parseInt(_0xa33702,0xa);if(_0x363044<0x1||_0x363044>0x1f){throw new Error(EINVALID_DATE);}return _0x363044;}function timeCompare(_0x13285d,_0x57cef3,_0x59e37f){var _0x14467c=_0x13285d['clone']();var _0x60eb25=extractTime(_0x57cef3);var _0x277e4b=_0x60eb25[0x0];var _0x49eae3=_0x60eb25[0x1];var _0x43bdef=_0x13285d[_0x1f89('0x11')]()[_0x1f89('0x12')](_0x277e4b)[_0x1f89('0x13')](_0x49eae3);throwIfDateNotValid(_0x43bdef);var _0x3ebe68=extractTime(_0x59e37f);var _0xeb4014=_0x3ebe68[0x0];var _0x5efe1d=_0x3ebe68[0x1];var _0x679c8e=_0x13285d[_0x1f89('0x11')]()[_0x1f89('0x12')](_0xeb4014)['minutes'](_0x5efe1d);throwIfDateNotValid(_0x679c8e);if(_0x679c8e[_0x1f89('0x14')](_0x43bdef)){var _0x4a94a0=_0x14467c[_0x1f89('0x11')]()[_0x1f89('0x15')]('day');var _0x488d38=_0x14467c['clone']()['endOf'](_0x1f89('0x16'));return _0x14467c['isBetween'](_0x43bdef,_0x488d38,undefined,'[]')||_0x14467c[_0x1f89('0x17')](_0x4a94a0,_0x679c8e,undefined,'[]');}else{return _0x14467c[_0x1f89('0x17')](_0x43bdef,_0x679c8e,undefined,'[]');}}module[_0x1f89('0xd')]['timeCompare']=timeCompare;function dowCompare(_0x3ca718,_0x2f47b8,_0x449966){var _0x3c1122=_0x3ca718[_0x1f89('0x7')]('en')[_0x1f89('0x18')](_0x1f89('0x19'))['toLowerCase']();return circularDoWInterval(_0x2f47b8,_0x449966)[_0x1f89('0x1a')](_0x3c1122);}module[_0x1f89('0xd')][_0x1f89('0x1b')]=dowCompare;function domCompare(_0xadf7c1,_0x3a91f2,_0x8a51d3){var _0x162e78=_0xadf7c1[_0x1f89('0x1c')]();if(_0x3a91f2===_0x8a51d3){return _0x162e78===_0x3a91f2;}else{var _0x1b1ddd=_0xadf7c1[_0x1f89('0x1d')]();var _0x3f9613=_0x3a91f2<_0x8a51d3;let _0x212faa=![];var _0x2d2a9a=0x0;var _0x9e205d=0x0;if(_0x3f9613){_0x2d2a9a=Math['max'](0x1,_0x3a91f2);_0x9e205d=Math['min'](_0x8a51d3,_0x1b1ddd);_0x212faa=_0x162e78>=_0x2d2a9a&&_0x162e78<=_0x9e205d;}else{_0x2d2a9a=Math[_0x1f89('0x1e')](_0x3a91f2,_0x1b1ddd);_0x9e205d=Math['max'](0x1,_0x8a51d3);_0x212faa=_0x162e78>=_0x2d2a9a||_0x162e78<=_0x9e205d;}return _0x212faa;}}module[_0x1f89('0xd')][_0x1f89('0x1f')]=domCompare;function monthCompare(_0x2963f9,_0x270f5b,_0x3103b4){var _0x29ee17=_0x2963f9[_0x1f89('0x7')]('en')[_0x1f89('0x18')](_0x1f89('0x20'))[_0x1f89('0x9')]();return circularMonthInterval(_0x270f5b,_0x3103b4)[_0x1f89('0x1a')](_0x29ee17);}module[_0x1f89('0xd')][_0x1f89('0x21')]=monthCompare;function iftime(_0xa201df,_0x232fea=moment['tz'][_0x1f89('0x22')](),_0x39245a=moment()){if(!validateRx[_0x1f89('0x23')](_0xa201df)){throw new Error(EINVALID_STRING);}else{var _0x27d653=(moment[_0x1f89('0x24')](_0x39245a)?_0x39245a[_0x1f89('0x11')]():moment(_0x39245a))['tz'](_0x232fea)[_0x1f89('0x7')]('en');throwIfDateNotValid(_0x27d653);var _0x59833a=_0xa201df[_0x1f89('0x6')](',');var _0xd4c250=_0x59833a[0x0];var _0x203b4f=_0x59833a[0x1];var _0x41e437=_0x59833a[0x2];var _0x9915af=_0x59833a[0x3];let _0x4b178b=!![];if(_0xd4c250!=='*'){var _0x4810b1=_0xd4c250['split']('-');var _0x2d0fbf=_[_0x1f89('0x25')](_0x4810b1[0x0],0x5,'0');var _0xee7b97=_0x4810b1[_0x1f89('0x26')]===0x2?_['padStart'](_0x4810b1[0x1],0x5,'0'):_0x2d0fbf;_0x4b178b=timeCompare(_0x27d653,_0x2d0fbf,_0xee7b97);}let _0x1d14b9=!![];if(_0x203b4f!=='*'){var _0x2f8ce4=_0x203b4f[_0x1f89('0x6')]('-');var _0x44be77=_0x2f8ce4[0x0];var _0x11ac59=_0x2f8ce4[_0x1f89('0x26')]===0x2?_0x2f8ce4[0x1]:_0x44be77;_0x1d14b9=dowCompare(_0x27d653,_0x44be77,_0x11ac59);}let _0x5ac90d=!![];if(_0x41e437!=='*'){var _0x38f854=_0x41e437[_0x1f89('0x6')]('-');var _0x484f86=parseDom(_0x38f854[0x0]);var _0x2209e1=_0x38f854[_0x1f89('0x26')]===0x2?parseDom(_0x38f854[0x1]):_0x484f86;_0x5ac90d=domCompare(_0x27d653,_0x484f86,_0x2209e1);}let _0x57f05d=!![];if(_0x9915af!=='*'){var _0x2d3fd1=_0x9915af[_0x1f89('0x6')]('-');var _0x58156b=_0x2d3fd1[0x0];var _0x31273c=_0x2d3fd1[_0x1f89('0x26')]===0x2?_0x2d3fd1[0x1]:_0x2d3fd1[0x0];_0x57f05d=monthCompare(_0x27d653,_0x58156b,_0x31273c);}return _0x4b178b&&_0x1d14b9&&_0x5ac90d&&_0x57f05d;}}module[_0x1f89('0xd')][_0x1f89('0x27')]=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index bcc7d2b..7c446fb 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7eda=['error','warn','consoleLogger','path','util','moment','debugLevel','toLowerCase','redBG\x20white','bold\x20yellow','white','bold\x20white','bold\x20magenta','bold\x20blue','bold\x20cyan','addColors','join','format','message','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','meta','keys','length','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','Console','File','%s-%s'];(function(_0x471b36,_0x2095a9){var _0x1e10c6=function(_0x2077e6){while(--_0x2077e6){_0x471b36['push'](_0x471b36['shift']());}};_0x1e10c6(++_0x2095a9);}(_0x7eda,0xf1));var _0xa7ed=function(_0x5c70d1,_0x233fa2){_0x5c70d1=_0x5c70d1-0x0;var _0x5cef7b=_0x7eda[_0x5c70d1];return _0x5cef7b;};'use strict';var path=require(_0xa7ed('0x0'));var util=require(_0xa7ed('0x1'));var moment=require(_0xa7ed('0x2'));var winston=require('winston');var config=require('../config/environment');var debugLevel=config['debugLevel']?config[_0xa7ed('0x3')][_0xa7ed('0x4')]():'info';var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0xa7ed('0x5'),'error':'red','warn':_0xa7ed('0x6'),'info':_0xa7ed('0x7'),'print':_0xa7ed('0x8'),'success':'bold\x20green','http':'gray','verbose':_0xa7ed('0x9'),'debug':_0xa7ed('0xa'),'silly':_0xa7ed('0xb')};winston[_0xa7ed('0xc')](XC_LOG_COLORS);function getLogFileName(_0x1bb580,_0x2e14ec,_0x4e64c0){var _0x3fd6c1=_0x1bb580||'/var/log/xcally';return path[_0xa7ed('0xd')](_0x3fd6c1,util[_0xa7ed('0xe')]('%s-%s.log',_0x2e14ec,_0x4e64c0));}function formatter(_0x57f5f8,_0x110dce){_0x110dce[_0xa7ed('0xf')]=_0x110dce[_0xa7ed('0xf')][_0xa7ed('0x10')](/@@{/g,'{{{')[_0xa7ed('0x10')](/}@@/g,_0xa7ed('0x11'))[_0xa7ed('0x10')](/@{/g,'{{')[_0xa7ed('0x10')](/}@/g,'}}');return util[_0xa7ed('0xe')](_0xa7ed('0x12'),moment()[_0xa7ed('0xe')](_0xa7ed('0x13')),_0x110dce[_0xa7ed('0x14')][_0xa7ed('0x15')](),_0x57f5f8,_0x110dce[_0xa7ed('0xf')]);}function fileFormat(_0x48250d,_0x216683){_0x216683['message']=_0x216683[_0xa7ed('0xf')][_0xa7ed('0x10')](/@@{/g,'{{{')[_0xa7ed('0x10')](/}@@/g,_0xa7ed('0x11'))['replace'](/@{/g,'{{')[_0xa7ed('0x10')](/}@/g,'}}');var _0x20631d=_0x216683[_0xa7ed('0x16')]&&Object[_0xa7ed('0x17')](_0x216683[_0xa7ed('0x16')])[_0xa7ed('0x18')]?'\x0a\x09'+JSON['stringify'](_0x216683['meta']):'';return util['format'](_0xa7ed('0x19'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0x216683[_0xa7ed('0x14')]['toUpperCase'](),_0x48250d,_0x216683[_0xa7ed('0xf')],_0x20631d);}function consoleLogger(){var _0x31d758=new winston[(_0xa7ed('0x1a'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xa7ed('0x1b'))][(_0xa7ed('0x1c'))]({'level':'warn','json':![],'formatter':function(_0x9aaceb){return formatter('',_0x9aaceb);}})]});return _0x31d758;}function fileLogger(_0x1f1e98,_0x5791ba){var _0x46390d=new winston[(_0xa7ed('0x1a'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xa7ed('0x1b'))][(_0xa7ed('0x1d'))]({'name':util[_0xa7ed('0xe')](_0xa7ed('0x1e'),_0x1f1e98,_0xa7ed('0x1f')),'filename':getLogFileName(_0x5791ba,_0x1f1e98,'error'),'level':_0xa7ed('0x1f'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xb74a05){return fileFormat(_0x1f1e98,_0xb74a05);}}),new winston[(_0xa7ed('0x1b'))][(_0xa7ed('0x1d'))]({'name':util[_0xa7ed('0xe')](_0xa7ed('0x1e'),_0x1f1e98,debugLevel),'filename':getLogFileName(_0x5791ba,_0x1f1e98,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4746eb){return fileFormat(_0x1f1e98,_0x4746eb);}}),new winston[(_0xa7ed('0x1b'))]['Console']({'level':_0xa7ed('0x20'),'json':![],'formatter':function(_0x4e5210){return fileFormat(_0x1f1e98,_0x4e5210);}})]});return _0x46390d;}exports[_0xa7ed('0x21')]=consoleLogger;exports['fileLogger']=fileLogger; \ No newline at end of file +var _0x10db=['%s-%s.log','message','replace','{{{','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','}}}','meta','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','warn','%s-%s','error','File','Console','consoleLogger','fileLogger','path','util','../config/environment','debugLevel','info','redBG\x20white','red','bold\x20yellow','white','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','addColors','join','format'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x10db,0x1dd));var _0xb10d=function(_0x47acae,_0x464bb8){_0x47acae=_0x47acae-0x0;var _0x33a9ca=_0x10db[_0x47acae];return _0x33a9ca;};'use strict';var path=require(_0xb10d('0x0'));var util=require(_0xb10d('0x1'));var moment=require('moment');var winston=require('winston');var config=require(_0xb10d('0x2'));var debugLevel=config[_0xb10d('0x3')]?config[_0xb10d('0x3')]['toLowerCase']():_0xb10d('0x4');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0xb10d('0x5'),'error':_0xb10d('0x6'),'warn':_0xb10d('0x7'),'info':_0xb10d('0x8'),'print':_0xb10d('0x9'),'success':_0xb10d('0xa'),'http':_0xb10d('0xb'),'verbose':_0xb10d('0xc'),'debug':_0xb10d('0xd'),'silly':'bold\x20cyan'};winston[_0xb10d('0xe')](XC_LOG_COLORS);function getLogFileName(_0x28ad7c,_0x164799,_0x567e1d){var _0x34c569=_0x28ad7c||'/var/log/xcally';return path[_0xb10d('0xf')](_0x34c569,util[_0xb10d('0x10')](_0xb10d('0x11'),_0x164799,_0x567e1d));}function formatter(_0x5326c5,_0xe48e0){_0xe48e0[_0xb10d('0x12')]=_0xe48e0['message'][_0xb10d('0x13')](/@@{/g,_0xb10d('0x14'))[_0xb10d('0x13')](/}@@/g,'}}}')[_0xb10d('0x13')](/@{/g,'{{')[_0xb10d('0x13')](/}@/g,'}}');return util['format'](_0xb10d('0x15'),moment()['format'](_0xb10d('0x16')),_0xe48e0[_0xb10d('0x17')][_0xb10d('0x18')](),_0x5326c5,_0xe48e0[_0xb10d('0x12')]);}function fileFormat(_0x6c58d0,_0x4e50c7){_0x4e50c7[_0xb10d('0x12')]=_0x4e50c7[_0xb10d('0x12')][_0xb10d('0x13')](/@@{/g,'{{{')[_0xb10d('0x13')](/}@@/g,_0xb10d('0x19'))[_0xb10d('0x13')](/@{/g,'{{')[_0xb10d('0x13')](/}@/g,'}}');var _0x31eb45=_0x4e50c7[_0xb10d('0x1a')]&&Object['keys'](_0x4e50c7[_0xb10d('0x1a')])['length']?'\x0a\x09'+JSON[_0xb10d('0x1b')](_0x4e50c7['meta']):'';return util[_0xb10d('0x10')](_0xb10d('0x1c'),moment()['format'](_0xb10d('0x16')),_0x4e50c7[_0xb10d('0x17')]['toUpperCase'](),_0x6c58d0,_0x4e50c7[_0xb10d('0x12')],_0x31eb45);}function consoleLogger(){var _0x548177=new winston[(_0xb10d('0x1d'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xb10d('0x1e'))]['Console']({'level':_0xb10d('0x1f'),'json':![],'formatter':function(_0x515fc7){return formatter('',_0x515fc7);}})]});return _0x548177;}function fileLogger(_0x464048,_0x539825){var _0x2cf580=new winston[(_0xb10d('0x1d'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xb10d('0x1e'))]['File']({'name':util['format'](_0xb10d('0x20'),_0x464048,_0xb10d('0x21')),'filename':getLogFileName(_0x539825,_0x464048,_0xb10d('0x21')),'level':_0xb10d('0x21'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3e2683){return fileFormat(_0x464048,_0x3e2683);}}),new winston[(_0xb10d('0x1e'))][(_0xb10d('0x22'))]({'name':util['format']('%s-%s',_0x464048,debugLevel),'filename':getLogFileName(_0x539825,_0x464048,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x14f41f){return fileFormat(_0x464048,_0x14f41f);}}),new winston[(_0xb10d('0x1e'))][(_0xb10d('0x23'))]({'level':_0xb10d('0x1f'),'json':![],'formatter':function(_0x43f6f8){return fileFormat(_0x464048,_0x43f6f8);}})]});return _0x2cf580;}exports[_0xb10d('0x24')]=consoleLogger;exports[_0xb10d('0x25')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 07f5542..2cdbf64 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 _0x7a54=['code','accessKey','token','authToken','consumerKey','membername','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','pass','accountSid','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','replace','}@@','includes','exports','maskSensitiveData','lodash','username','password','apiKey','firstName','street','phone','mobile','fax','email','clientSecret'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7a54,0x106));var _0x47a5=function(_0x3eebbd,_0xbb29a5){_0x3eebbd=_0x3eebbd-0x0;var _0x4792d3=_0x7a54[_0x3eebbd];return _0x4792d3;};var _=require(_0x47a5('0x0'));var sensitiveFields=[_0x47a5('0x1'),_0x47a5('0x2'),'newPassword',_0x47a5('0x3'),_0x47a5('0x4'),'lastName',_0x47a5('0x5'),_0x47a5('0x6'),_0x47a5('0x7'),_0x47a5('0x8'),_0x47a5('0x9'),'clientId',_0x47a5('0xa'),'securityToken',_0x47a5('0xb'),_0x47a5('0xc'),'tenantId',_0x47a5('0xd'),'channelSecret','accessToken','accessTokenSecret',_0x47a5('0xe'),_0x47a5('0xf'),'consumerSecret',_0x47a5('0x10'),'calleridname','calleridnum',_0x47a5('0x11'),_0x47a5('0x12'),_0x47a5('0x13'),_0x47a5('0x14'),_0x47a5('0x15'),_0x47a5('0x16'),_0x47a5('0x17'),'user',_0x47a5('0x18'),_0x47a5('0x19'),_0x47a5('0x1a'),_0x47a5('0x1b'),_0x47a5('0x1c'),_0x47a5('0x1d'),_0x47a5('0x1e')];function maskSensitiveData(_0x190faa){const _0x4e99a8=/(?!^)[\s\S](?!$)/g;if(_[_0x47a5('0x1f')](_0x190faa)){for(const _0x11faf5 in _0x190faa){if(_[_0x47a5('0x20')](_0x190faa[_0x11faf5])){for(let _0x2a2cbb=0x0;_0x2a2cbb<_0x190faa[_0x11faf5][_0x47a5('0x21')];_0x2a2cbb++){maskSensitiveData(_0x190faa[_0x11faf5][_0x2a2cbb]);}}else if(_['isPlainObject'](_0x190faa[_0x11faf5])){maskSensitiveData(_0x190faa[_0x11faf5]);}else if(_['isString'](_0x190faa[_0x11faf5])){_0x190faa[_0x11faf5]=_0x190faa[_0x11faf5][_0x47a5('0x22')](/{{{/g,'@@{')['replace'](/}}}/g,_0x47a5('0x23'))[_0x47a5('0x22')](/{{/g,'@{')[_0x47a5('0x22')](/}}/g,'}@');if(_[_0x47a5('0x24')](sensitiveFields,_0x11faf5)){_0x190faa[_0x11faf5]=_0x190faa[_0x11faf5][_0x47a5('0x22')](_0x4e99a8,'*');}}}}}module[_0x47a5('0x25')][_0x47a5('0x26')]=maskSensitiveData; \ No newline at end of file +var _0x1a85=['isString','@@{','replace','}@@','includes','exports','maskSensitiveData','password','newPassword','apiKey','street','phone','mobile','email','clientSecret','code','accessKey','token','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','user','pass','accountSid','dsn','secret','registry','isPlainObject','isArray','length'];(function(_0x3fb9dd,_0x174fff){var _0x20136a=function(_0x480081){while(--_0x480081){_0x3fb9dd['push'](_0x3fb9dd['shift']());}};_0x20136a(++_0x174fff);}(_0x1a85,0x178));var _0x51a8=function(_0x31021e,_0x248900){_0x31021e=_0x31021e-0x0;var _0x1e6fe5=_0x1a85[_0x31021e];return _0x1e6fe5;};var _=require('lodash');var sensitiveFields=['username',_0x51a8('0x0'),_0x51a8('0x1'),_0x51a8('0x2'),'firstName','lastName',_0x51a8('0x3'),_0x51a8('0x4'),_0x51a8('0x5'),'fax',_0x51a8('0x6'),'clientId',_0x51a8('0x7'),'securityToken',_0x51a8('0x8'),_0x51a8('0x9'),'tenantId',_0x51a8('0xa'),'channelSecret','accessToken',_0x51a8('0xb'),_0x51a8('0xc'),_0x51a8('0xd'),_0x51a8('0xe'),_0x51a8('0xf'),_0x51a8('0x10'),_0x51a8('0x11'),_0x51a8('0x12'),_0x51a8('0x13'),_0x51a8('0x14'),_0x51a8('0x15'),_0x51a8('0x16'),_0x51a8('0x17'),_0x51a8('0x18'),_0x51a8('0x19'),_0x51a8('0x1a'),_0x51a8('0x1b'),'localstationid',_0x51a8('0x1c'),_0x51a8('0x1d'),_0x51a8('0x1e'),'oldPassword'];function maskSensitiveData(_0xf4eb6e){const _0x547d40=/(?!^)[\s\S](?!$)/g;if(_[_0x51a8('0x1f')](_0xf4eb6e)){for(const _0x2b8d37 in _0xf4eb6e){if(_[_0x51a8('0x20')](_0xf4eb6e[_0x2b8d37])){for(let _0x2b0521=0x0;_0x2b0521<_0xf4eb6e[_0x2b8d37][_0x51a8('0x21')];_0x2b0521++){maskSensitiveData(_0xf4eb6e[_0x2b8d37][_0x2b0521]);}}else if(_[_0x51a8('0x1f')](_0xf4eb6e[_0x2b8d37])){maskSensitiveData(_0xf4eb6e[_0x2b8d37]);}else if(_[_0x51a8('0x22')](_0xf4eb6e[_0x2b8d37])){_0xf4eb6e[_0x2b8d37]=_0xf4eb6e[_0x2b8d37]['replace'](/{{{/g,_0x51a8('0x23'))[_0x51a8('0x24')](/}}}/g,_0x51a8('0x25'))[_0x51a8('0x24')](/{{/g,'@{')[_0x51a8('0x24')](/}}/g,'}@');if(_[_0x51a8('0x26')](sensitiveFields,_0x2b8d37)){_0xf4eb6e[_0x2b8d37]=_0xf4eb6e[_0x2b8d37]['replace'](_0x547d40,'*');}}}}}module[_0x51a8('0x27')][_0x51a8('0x28')]=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 5949cad..1f06291 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 _0x5eb8=['{\x20{\x20','\x20}\x20}','string','replace','isArray','map','isPlainObject','keys','reduce','exports','safeTemplate'];(function(_0x430682,_0x5c089e){var _0x4db366=function(_0xd5e0c0){while(--_0xd5e0c0){_0x430682['push'](_0x430682['shift']());}};_0x4db366(++_0x5c089e);}(_0x5eb8,0xb0));var _0x85eb=function(_0x7611ce,_0x4a4441){_0x7611ce=_0x7611ce-0x0;var _0x67d3ab=_0x5eb8[_0x7611ce];return _0x67d3ab;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x57e9bc){return _0x57e9bc==='{{'?_0x85eb('0x0'):_0x85eb('0x1');}function safeTemplate(_0x393a8a){var _0xd2f5dc=_0x393a8a;if(typeof _0x393a8a===_0x85eb('0x2')){_0xd2f5dc=_0x393a8a[_0x85eb('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x85eb('0x4')](_0x393a8a)){_0xd2f5dc=_0x393a8a[_0x85eb('0x5')](function(_0x3c5798){return safeTemplate(_0x3c5798);});}else if(_[_0x85eb('0x6')](_0x393a8a)){_0xd2f5dc=Object[_0x85eb('0x7')](_0x393a8a)[_0x85eb('0x8')](function(_0x4a8814,_0x16d7b9){_0x4a8814[_0x16d7b9]=safeTemplate(_0x393a8a[_0x16d7b9]);return _0x4a8814;},{});}return _0xd2f5dc;}module[_0x85eb('0x9')][_0x85eb('0xa')]=safeTemplate; \ No newline at end of file +var _0xdd4f=['isArray','map','isPlainObject','keys','reduce','safeTemplate','lodash','replace'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0xcae16f,_0x10af35){_0xcae16f=_0xcae16f-0x0;var _0x3c73dc=_0xdd4f[_0xcae16f];return _0x3c73dc;};var _=require(_0xfdd4('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x51d240){return _0x51d240==='{{'?'{\x20{\x20':'\x20}\x20}';}function safeTemplate(_0x291ae7){var _0x19cda7=_0x291ae7;if(typeof _0x291ae7==='string'){_0x19cda7=_0x291ae7[_0xfdd4('0x1')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xfdd4('0x2')](_0x291ae7)){_0x19cda7=_0x291ae7[_0xfdd4('0x3')](function(_0x554e44){return safeTemplate(_0x554e44);});}else if(_[_0xfdd4('0x4')](_0x291ae7)){_0x19cda7=Object[_0xfdd4('0x5')](_0x291ae7)[_0xfdd4('0x6')](function(_0x307ac6,_0x3c72d4){_0x307ac6[_0x3c72d4]=safeTemplate(_0x291ae7[_0x3c72d4]);return _0x307ac6;},{});}return _0x19cda7;}module['exports'][_0xfdd4('0x7')]=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js index 1d8be47..a22f218 100644 --- a/server/utils/update-app-config.js +++ b/server/utils/update-app-config.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf287=['server/app.json','legacy-libs','apps','findIndex','motion2','env','NODE_PATH','string','pathExists','then','readJSON','info','Updating\x20app.json','writeJSON','fs-extra','path','../config/environment','root','resolve'];(function(_0x23f4ad,_0xb1c02f){var _0x42e2ec=function(_0x4f39e0){while(--_0x4f39e0){_0x23f4ad['push'](_0x23f4ad['shift']());}};_0x42e2ec(++_0xb1c02f);}(_0xf287,0x12b));var _0x7f28=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xf287[_0x2641f9];return _0x585741;};var fs=require(_0x7f28('0x0'));var path=require(_0x7f28('0x1'));var config=require(_0x7f28('0x2'));var root=config[_0x7f28('0x3')];var APP_JSON_PATH=path[_0x7f28('0x4')](root,_0x7f28('0x5'));var NODEPATH=path[_0x7f28('0x4')](root,_0x7f28('0x6'));function setLegacyLibsNodeEnvPath(_0x5ab7c5){let _0x4fc748=![];if(Array['isArray'](_0x5ab7c5[_0x7f28('0x7')])){var _0x1a7cab=_0x5ab7c5[_0x7f28('0x7')][_0x7f28('0x8')](function(_0x35ccfe){return _0x35ccfe['name']===_0x7f28('0x9');});if(_0x1a7cab>-0x1){var _0x5b57f1=_0x5ab7c5[_0x7f28('0x7')][_0x1a7cab];if(typeof _0x5b57f1[_0x7f28('0xa')][_0x7f28('0xb')]!==_0x7f28('0xc')){_0x5b57f1[_0x7f28('0xa')][_0x7f28('0xb')]=NODEPATH;_0x4fc748=!![];}}return{'appConfig':_0x5ab7c5,'updated':_0x4fc748};}}function updateAppConfig(_0x5892d2){return fs[_0x7f28('0xd')](APP_JSON_PATH)[_0x7f28('0xe')](function(_0x2a5839){if(_0x2a5839){return fs[_0x7f28('0xf')](APP_JSON_PATH)[_0x7f28('0xe')](function(_0x2ae215){var _0x5cbd5b=setLegacyLibsNodeEnvPath(_0x2ae215);if(_0x5cbd5b['updated']){_0x5892d2[_0x7f28('0x10')](_0x7f28('0x11'));return fs[_0x7f28('0x12')](APP_JSON_PATH,_0x2ae215,{'spaces':0x2});}else{return Promise[_0x7f28('0x4')]();}});}else{return Promise[_0x7f28('0x4')]();}});}module['exports']=updateAppConfig; \ No newline at end of file +var _0xc65a=['motion2','NODE_PATH','string','env','pathExists','then','updated','info','writeJSON','resolve','exports','fs-extra','path','../config/environment','root','server/app.json','legacy-libs','isArray','apps','findIndex','name'];(function(_0x240f74,_0x280929){var _0x39ff55=function(_0xe0bfdf){while(--_0xe0bfdf){_0x240f74['push'](_0x240f74['shift']());}};_0x39ff55(++_0x280929);}(_0xc65a,0xdd));var _0xac65=function(_0x38203a,_0x1ced29){_0x38203a=_0x38203a-0x0;var _0x3757b9=_0xc65a[_0x38203a];return _0x3757b9;};var fs=require(_0xac65('0x0'));var path=require(_0xac65('0x1'));var config=require(_0xac65('0x2'));var root=config[_0xac65('0x3')];var APP_JSON_PATH=path['resolve'](root,_0xac65('0x4'));var NODEPATH=path['resolve'](root,_0xac65('0x5'));function setLegacyLibsNodeEnvPath(_0x4903d7){let _0x37c077=![];if(Array[_0xac65('0x6')](_0x4903d7[_0xac65('0x7')])){var _0x1d45e8=_0x4903d7[_0xac65('0x7')][_0xac65('0x8')](function(_0x2a47c9){return _0x2a47c9[_0xac65('0x9')]===_0xac65('0xa');});if(_0x1d45e8>-0x1){var _0x2e06f6=_0x4903d7['apps'][_0x1d45e8];if(typeof _0x2e06f6['env'][_0xac65('0xb')]!==_0xac65('0xc')){_0x2e06f6[_0xac65('0xd')][_0xac65('0xb')]=NODEPATH;_0x37c077=!![];}}return{'appConfig':_0x4903d7,'updated':_0x37c077};}}function updateAppConfig(_0x48ae1f){return fs[_0xac65('0xe')](APP_JSON_PATH)[_0xac65('0xf')](function(_0x52c86b){if(_0x52c86b){return fs['readJSON'](APP_JSON_PATH)['then'](function(_0x36de71){var _0x10dc25=setLegacyLibsNodeEnvPath(_0x36de71);if(_0x10dc25[_0xac65('0x10')]){_0x48ae1f[_0xac65('0x11')]('Updating\x20app.json');return fs[_0xac65('0x12')](APP_JSON_PATH,_0x36de71,{'spaces':0x2});}else{return Promise[_0xac65('0x13')]();}});}else{return Promise['resolve']();}});}module[_0xac65('0x14')]=updateAppConfig; \ No newline at end of file